From: support Date: Thu, 24 Nov 2022 06:43:45 +0000 (+0000) Subject: Built motion from commit f091f0c6.|2.6.24 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=d262c9644f0cd8bff58004fec9cf541402083cf3;p=motion2.git Built motion from commit f091f0c6.|2.6.24 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 10f7d00..1cb1251 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.23", + "version": "2.6.24", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-23T13:59:53.734Z", + "time": "2022-11-24T06:35:15.232Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4bcccb2..0687233 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.23", + "version": "2.6.24", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-23T13:59:53.734Z", + "time": "2022-11-24T06:35:15.232Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b9ad350..7ce8e58 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.23", + "version": "2.6.24", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index da326f9..5d06901 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.23", + "version": "2.6.24", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 0100867..8be8e35 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 _0xe44f=['integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','getDataValue','action','STRING','contactManager'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xe44f,0x95));var _0xfe44=function(_0x5b0c93,_0x4ca03a){_0x5b0c93=_0x5b0c93-0x0;var _0x22acb5=_0xe44f[_0x5b0c93];return _0x22acb5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x7799d9){return this[_0xfe44('0x0')](_0xfe44('0x1'));}},'action':{'type':Sequelize[_0xfe44('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfe44('0x3'),_0xfe44('0x4'),_0xfe44('0x5'),_0xfe44('0x6'),_0xfe44('0x7'),'browser',_0xfe44('0x8'),'script']],'msg':_0xfe44('0x9')}},'comment':_0xfe44('0x9')},'data1':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xa')},'data2':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comment':_0xfe44('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfe44('0xc')},'data4':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xd')},'data5':{'type':Sequelize[_0xfe44('0x2')](0x1000),'comments':_0xfe44('0xe')},'data6':{'type':Sequelize[_0xfe44('0x2')],'comments':_0xfe44('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xfe44('0x10')}}; \ No newline at end of file +var _0x1856=['browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x1f39b8,_0x38e661){var _0x774782=function(_0x41bef4){while(--_0x41bef4){_0x1f39b8['push'](_0x1f39b8['shift']());}};_0x774782(++_0x38e661);}(_0x1856,0x121));var _0x6185=function(_0x60179,_0x30cb78){_0x60179=_0x60179-0x0;var _0x1ef0f1=_0x1856[_0x60179];return _0x1ef0f1;};'use strict';var Sequelize=require(_0x6185('0x0'));module[_0x6185('0x1')]={'name':{'type':Sequelize[_0x6185('0x2')],'get':function(_0x5aadcc){return this[_0x6185('0x3')](_0x6185('0x4'));}},'action':{'type':Sequelize[_0x6185('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6185('0x6'),_0x6185('0x7'),_0x6185('0x8'),_0x6185('0x9'),_0x6185('0xa'),_0x6185('0xb'),'bot',_0x6185('0xc')]],'msg':_0x6185('0xd')}},'comment':_0x6185('0xd')},'data1':{'type':Sequelize[_0x6185('0x5')](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[_0x6185('0x5')](0x1000),'comment':_0x6185('0xe')},'data3':{'type':Sequelize[_0x6185('0x5')](0x1000),'comment':_0x6185('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6185('0x5')](0x1000),'comments':_0x6185('0x10')},'data6':{'type':Sequelize[_0x6185('0x5')],'comments':_0x6185('0x11')},'data7':{'type':Sequelize[_0x6185('0x12')],'comments':_0x6185('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3384338..dfd1a43 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 _0xfe91=['moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0xfe91,0xdc));var _0x1fe9=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xfe91[_0x19ac6e];return _0x1cdcf3;};'use strict';var emlformat=require(_0x1fe9('0x0'));var rimraf=require(_0x1fe9('0x1'));var zipdir=require(_0x1fe9('0x2'));var jsonpatch=require(_0x1fe9('0x3'));var rp=require(_0x1fe9('0x4'));var moment=require(_0x1fe9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fe9('0x6'));var path=require('path');var sox=require(_0x1fe9('0x7'));var csv=require(_0x1fe9('0x8'));var ejs=require(_0x1fe9('0x9'));var fs=require('fs');var fs_extra=require(_0x1fe9('0xa'));var _=require(_0x1fe9('0xb'));var squel=require(_0x1fe9('0xc'));var crypto=require(_0x1fe9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fe9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1fe9('0xf'));var Papa=require('papaparse');var Redis=require(_0x1fe9('0x10'));var authService=require(_0x1fe9('0x11'));var qs=require(_0x1fe9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fe9('0x13'));var utils=require('../../config/utils');var config=require(_0x1fe9('0x14'));var licenseUtil=require(_0x1fe9('0x15'));var db=require(_0x1fe9('0x16'))['db'];function respondWithStatusCode(_0x7960cf,_0x5f39ff){_0x5f39ff=_0x5f39ff||0xcc;return function(_0xde69b8){if(_0xde69b8){return _0x7960cf[_0x1fe9('0x17')](_0x5f39ff);}return _0x7960cf[_0x1fe9('0x18')](_0x5f39ff)[_0x1fe9('0x19')]();};}function respondWithResult(_0x3c3764,_0x3f2340){_0x3f2340=_0x3f2340||0xc8;return function(_0x192031){if(_0x192031){return _0x3c3764[_0x1fe9('0x18')](_0x3f2340)[_0x1fe9('0x1a')](_0x192031);}};}function respondWithFilteredResult(_0x3dd7aa,_0x322280){return function(_0x5cf274){if(_0x5cf274){var _0x44a086=typeof _0x322280[_0x1fe9('0x1b')]===_0x1fe9('0x1c')&&typeof _0x322280[_0x1fe9('0x1d')]===_0x1fe9('0x1c');var _0x5f0b8d=_0x5cf274[_0x1fe9('0x1e')];var _0x2262a1=_0x44a086?0x0:_0x322280[_0x1fe9('0x1b')];var _0x22188f=_0x44a086?_0x5cf274['count']:_0x322280[_0x1fe9('0x1b')]+_0x322280[_0x1fe9('0x1d')];var _0x195f0b;if(_0x22188f>=_0x5f0b8d){_0x22188f=_0x5f0b8d;_0x195f0b=0xc8;}else{_0x195f0b=0xce;}_0x3dd7aa[_0x1fe9('0x18')](_0x195f0b);return _0x3dd7aa[_0x1fe9('0x1f')]('Content-Range',_0x2262a1+'-'+_0x22188f+'/'+_0x5f0b8d)[_0x1fe9('0x1a')](_0x5cf274);}return null;};}function patchUpdates(_0x238410){return function(_0x3430ff){try{jsonpatch['apply'](_0x3430ff,_0x238410,!![]);}catch(_0x544567){return BPromise[_0x1fe9('0x20')](_0x544567);}return _0x3430ff[_0x1fe9('0x21')]();};}function saveUpdates(_0x166ef5,_0x4ce214){return function(_0x24d6fb){if(_0x24d6fb){return _0x24d6fb[_0x1fe9('0x22')](_0x166ef5)[_0x1fe9('0x23')](function(_0x192d5e){return _0x192d5e;});}return null;};}function removeEntity(_0x3f9a52,_0x58aead){return function(_0xa3e335){if(_0xa3e335){return _0xa3e335[_0x1fe9('0x24')]()[_0x1fe9('0x23')](function(){_0x3f9a52[_0x1fe9('0x18')](0xcc)[_0x1fe9('0x19')]();});}};}function handleEntityNotFound(_0x4a9bbe,_0x371873){return function(_0x15768f){if(!_0x15768f){_0x4a9bbe[_0x1fe9('0x17')](0x194);}return _0x15768f;};}function handleError(_0x1b69e5,_0x25fc87){_0x25fc87=_0x25fc87||0x1f4;return function(_0x438ca4){logger['error'](_0x438ca4[_0x1fe9('0x25')]);if(_0x438ca4[_0x1fe9('0x26')]){delete _0x438ca4[_0x1fe9('0x26')];}_0x1b69e5[_0x1fe9('0x18')](_0x25fc87)[_0x1fe9('0x27')](_0x438ca4);};}exports[_0x1fe9('0x22')]=function(_0x1a00a4,_0x1a9b4d){if(_0x1a00a4['body']['id']){delete _0x1a00a4[_0x1fe9('0x28')]['id'];}return db[_0x1fe9('0x29')][_0x1fe9('0x2a')]({'where':{'id':_0x1a00a4['params']['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x1a9b4d,null))['then'](saveUpdates(_0x1a00a4[_0x1fe9('0x28')],null))['then'](respondWithResult(_0x1a9b4d,null))['catch'](handleError(_0x1a9b4d,null));};exports[_0x1fe9('0x24')]=function(_0x3f1188,_0x3e4bcd){return db['Action']['find']({'where':{'id':_0x3f1188[_0x1fe9('0x2b')]['id']}})[_0x1fe9('0x23')](handleEntityNotFound(_0x3e4bcd,null))['then'](removeEntity(_0x3e4bcd,null))[_0x1fe9('0x2c')](handleError(_0x3e4bcd,null));}; \ No newline at end of file +var _0x299c=['offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x299c,0x120));var _0xc299=function(_0x24502d,_0x3a7c6f){_0x24502d=_0x24502d-0x0;var _0xd3f48c=_0x299c[_0x24502d];return _0xd3f48c;};'use strict';var emlformat=require(_0xc299('0x0'));var rimraf=require(_0xc299('0x1'));var zipdir=require(_0xc299('0x2'));var jsonpatch=require(_0xc299('0x3'));var rp=require(_0xc299('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc299('0x5'));var csv=require('to-csv');var ejs=require(_0xc299('0x6'));var fs=require('fs');var fs_extra=require(_0xc299('0x7'));var _=require(_0xc299('0x8'));var squel=require('squel');var crypto=require(_0xc299('0x9'));var jsforce=require(_0xc299('0xa'));var deskjs=require(_0xc299('0xb'));var toCsv=require(_0xc299('0xc'));var querystring=require(_0xc299('0xd'));var Papa=require(_0xc299('0xe'));var Redis=require('ioredis');var authService=require(_0xc299('0xf'));var qs=require(_0xc299('0x10'));var as=require(_0xc299('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc299('0x12'));var utils=require(_0xc299('0x13'));var config=require(_0xc299('0x14'));var licenseUtil=require(_0xc299('0x15'));var db=require(_0xc299('0x16'))['db'];function respondWithStatusCode(_0x4096e4,_0x150eaf){_0x150eaf=_0x150eaf||0xcc;return function(_0x3b0209){if(_0x3b0209){return _0x4096e4[_0xc299('0x17')](_0x150eaf);}return _0x4096e4['status'](_0x150eaf)[_0xc299('0x18')]();};}function respondWithResult(_0x3cf260,_0x5135cc){_0x5135cc=_0x5135cc||0xc8;return function(_0x5ec60b){if(_0x5ec60b){return _0x3cf260[_0xc299('0x19')](_0x5135cc)[_0xc299('0x1a')](_0x5ec60b);}};}function respondWithFilteredResult(_0x20ac81,_0x48320e){return function(_0x10d2b6){if(_0x10d2b6){var _0x56b164=typeof _0x48320e[_0xc299('0x1b')]===_0xc299('0x1c')&&typeof _0x48320e['limit']==='undefined';var _0x128700=_0x10d2b6[_0xc299('0x1d')];var _0x374b59=_0x56b164?0x0:_0x48320e['offset'];var _0x5791b3=_0x56b164?_0x10d2b6[_0xc299('0x1d')]:_0x48320e[_0xc299('0x1b')]+_0x48320e['limit'];var _0x17a39f;if(_0x5791b3>=_0x128700){_0x5791b3=_0x128700;_0x17a39f=0xc8;}else{_0x17a39f=0xce;}_0x20ac81[_0xc299('0x19')](_0x17a39f);return _0x20ac81[_0xc299('0x1e')](_0xc299('0x1f'),_0x374b59+'-'+_0x5791b3+'/'+_0x128700)[_0xc299('0x1a')](_0x10d2b6);}return null;};}function patchUpdates(_0x183a34){return function(_0x3a0ba1){try{jsonpatch['apply'](_0x3a0ba1,_0x183a34,!![]);}catch(_0x887826){return BPromise[_0xc299('0x20')](_0x887826);}return _0x3a0ba1[_0xc299('0x21')]();};}function saveUpdates(_0x48a5f5,_0x478f20){return function(_0x3483a8){if(_0x3483a8){return _0x3483a8['update'](_0x48a5f5)[_0xc299('0x22')](function(_0x18ce39){return _0x18ce39;});}return null;};}function removeEntity(_0x4ac818,_0x3b1a7b){return function(_0x38e533){if(_0x38e533){return _0x38e533[_0xc299('0x23')]()[_0xc299('0x22')](function(){_0x4ac818[_0xc299('0x19')](0xcc)[_0xc299('0x18')]();});}};}function handleEntityNotFound(_0x265b30,_0x28617a){return function(_0x21a22e){if(!_0x21a22e){_0x265b30['sendStatus'](0x194);}return _0x21a22e;};}function handleError(_0x3662e8,_0x3b0ac1){_0x3b0ac1=_0x3b0ac1||0x1f4;return function(_0x3a63ca){logger[_0xc299('0x24')](_0x3a63ca[_0xc299('0x25')]);if(_0x3a63ca['name']){delete _0x3a63ca['name'];}_0x3662e8['status'](_0x3b0ac1)[_0xc299('0x26')](_0x3a63ca);};}exports[_0xc299('0x27')]=function(_0x6b89b5,_0x5352dc){if(_0x6b89b5[_0xc299('0x28')]['id']){delete _0x6b89b5['body']['id'];}return db[_0xc299('0x29')][_0xc299('0x2a')]({'where':{'id':_0x6b89b5[_0xc299('0x2b')]['id']}})[_0xc299('0x22')](handleEntityNotFound(_0x5352dc,null))[_0xc299('0x22')](saveUpdates(_0x6b89b5[_0xc299('0x28')],null))['then'](respondWithResult(_0x5352dc,null))[_0xc299('0x2c')](handleError(_0x5352dc,null));};exports[_0xc299('0x23')]=function(_0x30877a,_0x44392f){return db[_0xc299('0x29')][_0xc299('0x2a')]({'where':{'id':_0x30877a[_0xc299('0x2b')]['id']}})[_0xc299('0x22')](handleEntityNotFound(_0x44392f,null))[_0xc299('0x22')](removeEntity(_0x44392f,null))[_0xc299('0x2c')](handleError(_0x44392f,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index b2bc4ef..375ee62 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 _0xa5bf=['moment','bluebird','path','../../config/environment','./action.attributes','exports','tools_actions','lodash','../../config/logger','api'];(function(_0x34d277,_0x16ef66){var _0x5210e=function(_0x314cc4){while(--_0x314cc4){_0x34d277['push'](_0x34d277['shift']());}};_0x5210e(++_0x16ef66);}(_0xa5bf,0x101));var _0xfa5b=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xa5bf[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0xfa5b('0x0'));var util=require('util');var logger=require(_0xfa5b('0x1'))(_0xfa5b('0x2'));var moment=require(_0xfa5b('0x3'));var BPromise=require(_0xfa5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa5b('0x5'));var rimraf=require('rimraf');var config=require(_0xfa5b('0x6'));var attributes=require(_0xfa5b('0x7'));module[_0xfa5b('0x8')]=function(_0x3d46c8,_0x38d68e){return _0x3d46c8['define']('Action',attributes,{'tableName':_0xfa5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c68=['rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b629c,_0x52a4b7){var _0x9dc71b=function(_0x549101){while(--_0x549101){_0x3b629c['push'](_0x3b629c['shift']());}};_0x9dc71b(++_0x52a4b7);}(_0x0c68,0x165));var _0x80c6=function(_0x45a09a,_0x50c7cd){_0x45a09a=_0x45a09a-0x0;var _0x506ede=_0x0c68[_0x45a09a];return _0x506ede;};'use strict';var _=require(_0x80c6('0x0'));var util=require('util');var logger=require(_0x80c6('0x1'))(_0x80c6('0x2'));var moment=require(_0x80c6('0x3'));var BPromise=require(_0x80c6('0x4'));var rp=require(_0x80c6('0x5'));var fs=require('fs');var path=require(_0x80c6('0x6'));var rimraf=require(_0x80c6('0x7'));var config=require(_0x80c6('0x8'));var attributes=require('./action.attributes');module[_0x80c6('0x9')]=function(_0x2e2914,_0x2156ee){return _0x2e2914[_0x80c6('0xa')](_0x80c6('0xb'),attributes,{'tableName':_0x80c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 79edcb7..e898e8c 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x11f2b5,_0x161b25){var _0x2a0d41=function(_0x126ddc){while(--_0x126ddc){_0x11f2b5['push'](_0x11f2b5['shift']());}};_0x2a0d41(++_0x161b25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 334586c..f216825 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 _0x764a=['../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x41be4a,_0x16fb7f){var _0xfd0ae1=function(_0x3e94b6){while(--_0x3e94b6){_0x41be4a['push'](_0x41be4a['shift']());}};_0xfd0ae1(++_0x16fb7f);}(_0x764a,0x19f));var _0xa764=function(_0x3ba5fd,_0xbe4159){_0x3ba5fd=_0x3ba5fd-0x0;var _0x3574d3=_0x764a[_0x3ba5fd];return _0x3574d3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa764('0x0'));var router=express[_0xa764('0x1')]();var fs_extra=require(_0xa764('0x2'));var auth=require(_0xa764('0x3'));var interaction=require(_0xa764('0x4'));var config=require(_0xa764('0x5'));var controller=require(_0xa764('0x6'));router[_0xa764('0x7')]('/:id',auth[_0xa764('0x8')](),controller[_0xa764('0x9')]);router[_0xa764('0xa')](_0xa764('0xb'),auth[_0xa764('0x8')](),controller[_0xa764('0xc')]);module[_0xa764('0xd')]=router; \ No newline at end of file +var _0x4999=['put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x14f009,_0x4bec47){var _0x3a812f=function(_0x827fa5){while(--_0x827fa5){_0x14f009['push'](_0x14f009['shift']());}};_0x3a812f(++_0x4bec47);}(_0x4999,0x1e6));var _0x9499=function(_0x4d5d28,_0x26bd9b){_0x4d5d28=_0x4d5d28-0x0;var _0x2026b1=_0x4999[_0x4d5d28];return _0x2026b1;};'use strict';var multer=require(_0x9499('0x0'));var util=require(_0x9499('0x1'));var path=require(_0x9499('0x2'));var timeout=require(_0x9499('0x3'));var express=require(_0x9499('0x4'));var router=express[_0x9499('0x5')]();var fs_extra=require(_0x9499('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9499('0x7'));var config=require(_0x9499('0x8'));var controller=require(_0x9499('0x9'));router[_0x9499('0xa')](_0x9499('0xb'),auth[_0x9499('0xc')](),controller[_0x9499('0xd')]);router['delete'](_0x9499('0xb'),auth[_0x9499('0xc')](),controller[_0x9499('0xe')]);module[_0x9499('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 5129e1d..342cfd8 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x297259,_0x17e45d){var _0x2f137c=function(_0x5cb8bf){while(--_0x5cb8bf){_0x297259['push'](_0x297259['shift']());}};_0x2f137c(++_0x17e45d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file +var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x5a4fe4,_0x13daca){var _0x42aa6e=function(_0x42703c){while(--_0x42703c){_0x5a4fe4['push'](_0x5a4fe4['shift']());}};_0x42aa6e(++_0x13daca);}(_0xf494,0x1c6));var _0x4f49=function(_0x40ff4d,_0x72c2dd){_0x40ff4d=_0x40ff4d-0x0;var _0xc6b831=_0xf494[_0x40ff4d];return _0xc6b831;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 3fa351c..06506e7 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 _0xceff=['foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','cross_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','MetricId','web','fullPath','%s-%s.%s','generate','output','csv','custom','cdr','startDate','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','DATE(%s)','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','create','body','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey'];(function(_0x12e451,_0xd5bbdf){var _0x1cbcb7=function(_0x30c11b){while(--_0x30c11b){_0x12e451['push'](_0x12e451['shift']());}};_0x1cbcb7(++_0xd5bbdf);}(_0xceff,0xc5));var _0xfcef=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xceff[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xfcef('0x0'));var rimraf=require(_0xfcef('0x1'));var zipdir=require(_0xfcef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcef('0x3'));var moment=require(_0xfcef('0x4'));var BPromise=require(_0xfcef('0x5'));var Mustache=require(_0xfcef('0x6'));var util=require(_0xfcef('0x7'));var path=require(_0xfcef('0x8'));var sox=require(_0xfcef('0x9'));var csv=require(_0xfcef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcef('0xb'));var _=require(_0xfcef('0xc'));var squel=require(_0xfcef('0xd'));var crypto=require(_0xfcef('0xe'));var jsforce=require(_0xfcef('0xf'));var deskjs=require(_0xfcef('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfcef('0x11'));var Papa=require('papaparse');var Redis=require(_0xfcef('0x12'));var authService=require(_0xfcef('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfcef('0x14'));var hardwareService=require(_0xfcef('0x15'));var logger=require('../../config/logger')(_0xfcef('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfcef('0x17'));var db=require(_0xfcef('0x18'))['db'];var dbH=require(_0xfcef('0x18'))['dbH'];function respondWithStatusCode(_0x306bd9,_0x122b03){_0x122b03=_0x122b03||0xcc;return function(_0x157c18){if(_0x157c18){return _0x306bd9[_0xfcef('0x19')](_0x122b03);}return _0x306bd9[_0xfcef('0x1a')](_0x122b03)[_0xfcef('0x1b')]();};}function respondWithResult(_0x557260,_0x106480){_0x106480=_0x106480||0xc8;return function(_0x5958d3){if(_0x5958d3){return _0x557260[_0xfcef('0x1a')](_0x106480)['json'](_0x5958d3);}};}function respondWithFilteredResult(_0x2a9585,_0x27c284){return function(_0x2370c4){if(_0x2370c4){var _0x5c213d=typeof _0x27c284[_0xfcef('0x1c')]==='undefined'&&typeof _0x27c284['limit']===_0xfcef('0x1d');var _0x4adace=_0x2370c4['count'];var _0x217a17=_0x5c213d?0x0:_0x27c284[_0xfcef('0x1c')];var _0x20dae4=_0x5c213d?_0x2370c4[_0xfcef('0x1e')]:_0x27c284[_0xfcef('0x1c')]+_0x27c284[_0xfcef('0x1f')];var _0x5c7d67;if(_0x20dae4>=_0x4adace){_0x20dae4=_0x4adace;_0x5c7d67=0xc8;}else{_0x5c7d67=0xce;}_0x2a9585[_0xfcef('0x1a')](_0x5c7d67);return _0x2a9585['set']('Content-Range',_0x217a17+'-'+_0x20dae4+'/'+_0x4adace)[_0xfcef('0x20')](_0x2370c4);}return null;};}function patchUpdates(_0x5d987b){return function(_0x47a10e){try{jsonpatch[_0xfcef('0x21')](_0x47a10e,_0x5d987b,!![]);}catch(_0x11f194){return BPromise[_0xfcef('0x22')](_0x11f194);}return _0x47a10e[_0xfcef('0x23')]();};}function saveUpdates(_0x59ed14,_0x122197){return function(_0x22bbd3){if(_0x22bbd3){return _0x22bbd3[_0xfcef('0x24')](_0x59ed14)[_0xfcef('0x25')](function(_0x190835){return _0x190835;});}return null;};}function removeEntity(_0xa8e476,_0x33d798){return function(_0x19179f){if(_0x19179f){return _0x19179f[_0xfcef('0x26')]()[_0xfcef('0x25')](function(){var _0x2ddcd8=_0x19179f[_0xfcef('0x27')]({'plain':!![]});var _0x2eca98=_0xfcef('0x28');return db[_0xfcef('0x29')]['destroy']({'where':{'type':_0x2eca98,'resourceId':_0x2ddcd8['id']}})[_0xfcef('0x25')](function(){return _0x19179f;});})[_0xfcef('0x25')](function(){_0xa8e476[_0xfcef('0x1a')](0xcc)[_0xfcef('0x1b')]();});}};}function handleEntityNotFound(_0x323e53,_0x3fb0f2){return function(_0x53f2ea){if(!_0x53f2ea){_0x323e53[_0xfcef('0x19')](0x194);}return _0x53f2ea;};}function handleError(_0x4d6946,_0x5beb6d){_0x5beb6d=_0x5beb6d||0x1f4;return function(_0xd0332b){logger['error'](_0xd0332b[_0xfcef('0x2a')]);if(_0xd0332b[_0xfcef('0x2b')]){delete _0xd0332b[_0xfcef('0x2b')];}_0x4d6946[_0xfcef('0x1a')](_0x5beb6d)['send'](_0xd0332b);};}exports[_0xfcef('0x2c')]=function(_0x1dada5,_0xc677a2){var _0x1a2e29={},_0x10d121={},_0x31cf07={'count':0x0,'rows':[]};var _0x2840da=_['map'](db[_0xfcef('0x2d')]['rawAttributes'],function(_0x682b8c){return{'name':_0x682b8c[_0xfcef('0x2e')],'type':_0x682b8c[_0xfcef('0x2f')][_0xfcef('0x30')]};});_0x10d121[_0xfcef('0x31')]=_[_0xfcef('0x32')](_0x2840da,_0xfcef('0x2b'));_0x10d121['query']=_[_0xfcef('0x33')](_0x1dada5[_0xfcef('0x34')]);_0x10d121['filters']=_['intersection'](_0x10d121[_0xfcef('0x31')],_0x10d121[_0xfcef('0x34')]);_0x1a2e29[_0xfcef('0x35')]=_['intersection'](_0x10d121['model'],qs[_0xfcef('0x36')](_0x1dada5[_0xfcef('0x34')]['fields']));_0x1a2e29['attributes']=_0x1a2e29['attributes'][_0xfcef('0x37')]?_0x1a2e29[_0xfcef('0x35')]:_0x10d121[_0xfcef('0x31')];if(!_0x1dada5[_0xfcef('0x34')][_0xfcef('0x38')](_0xfcef('0x39'))){_0x1a2e29[_0xfcef('0x1f')]=qs[_0xfcef('0x1f')](_0x1dada5['query'][_0xfcef('0x1f')]);_0x1a2e29['offset']=qs['offset'](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x1c')]);}_0x1a2e29['order']=qs[_0xfcef('0x3a')](_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3a')]);_0x1a2e29[_0xfcef('0x3b')]=qs[_0xfcef('0x3c')](_[_0xfcef('0x3d')](_0x1dada5[_0xfcef('0x34')],_0x10d121['filters']),_0x2840da);if(_0x1dada5['query']['filter']){_0x1a2e29[_0xfcef('0x3b')]=_['merge'](_0x1a2e29['where'],{'$or':_[_0xfcef('0x32')](_0x2840da,function(_0x1496d1){if(_0x1496d1['type']!==_0xfcef('0x3e')){var _0x1e8ab1={};_0x1e8ab1[_0x1496d1[_0xfcef('0x2b')]]={'$like':'%'+_0x1dada5[_0xfcef('0x34')][_0xfcef('0x3f')]+'%'};return _0x1e8ab1;}})});}_0x1a2e29=_[_0xfcef('0x40')]({},_0x1a2e29,_0x1dada5[_0xfcef('0x41')]);var _0x4ef584={'where':_0x1a2e29['where']};return db[_0xfcef('0x2d')][_0xfcef('0x1e')](_0x4ef584)[_0xfcef('0x25')](function(_0x23c44c){_0x31cf07[_0xfcef('0x1e')]=_0x23c44c;if(_0x1dada5['query'][_0xfcef('0x42')]){_0x1a2e29[_0xfcef('0x43')]=[{'all':!![]}];}return db[_0xfcef('0x2d')][_0xfcef('0x44')](_0x1a2e29);})[_0xfcef('0x25')](function(_0x240008){_0x31cf07[_0xfcef('0x45')]=_0x240008;return _0x31cf07;})[_0xfcef('0x25')](respondWithFilteredResult(_0xc677a2,_0x1a2e29))['catch'](handleError(_0xc677a2,null));};exports[_0xfcef('0x46')]=function(_0x303129,_0x128a81){var _0x559be7={'raw':![],'where':{'id':_0x303129[_0xfcef('0x47')]['id']}},_0x515ae4={};_0x515ae4[_0xfcef('0x31')]=_[_0xfcef('0x33')](db[_0xfcef('0x2d')][_0xfcef('0x48')]);_0x515ae4[_0xfcef('0x34')]=_[_0xfcef('0x33')](_0x303129[_0xfcef('0x34')]);_0x515ae4[_0xfcef('0x3c')]=_[_0xfcef('0x49')](_0x515ae4['model'],_0x515ae4[_0xfcef('0x34')]);_0x559be7['attributes']=_[_0xfcef('0x49')](_0x515ae4[_0xfcef('0x31')],qs[_0xfcef('0x36')](_0x303129[_0xfcef('0x34')]['fields']));_0x559be7[_0xfcef('0x35')]=_0x559be7['attributes']['length']?_0x559be7[_0xfcef('0x35')]:_0x515ae4[_0xfcef('0x31')];if(_0x303129[_0xfcef('0x34')]['includeAll']){_0x559be7['include']=[{'all':!![]}];}_0x559be7=_[_0xfcef('0x40')]({},_0x559be7,_0x303129[_0xfcef('0x41')]);return db['AnalyticCustomReport'][_0xfcef('0x4a')](_0x559be7)['then'](handleEntityNotFound(_0x128a81,null))[_0xfcef('0x25')](respondWithResult(_0x128a81,null))['catch'](handleError(_0x128a81,null));};exports['create']=function(_0x59c0ea,_0x5014ed){return db[_0xfcef('0x2d')][_0xfcef('0x4b')](_0x59c0ea[_0xfcef('0x4c')],{})[_0xfcef('0x25')](function(_0x2f3dc6){var _0x52440d=_0x59c0ea['user'][_0xfcef('0x27')]({'plain':!![]});if(!_0x52440d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52440d['role']==='user'){var _0x2c429d=_0x2f3dc6[_0xfcef('0x27')]({'plain':!![]});var _0x12186e='Reports';return db['UserProfileSection'][_0xfcef('0x4a')]({'where':{'name':_0x12186e,'userProfileId':_0x52440d[_0xfcef('0x4d')]},'raw':!![]})[_0xfcef('0x25')](function(_0x5e5108){if(_0x5e5108&&_0x5e5108['autoAssociation']===0x0){return db[_0xfcef('0x29')]['create']({'name':_0x2c429d[_0xfcef('0x2b')],'resourceId':_0x2c429d['id'],'type':'CustomReports','sectionId':_0x5e5108['id']},{})[_0xfcef('0x25')](function(){return _0x2f3dc6;});}else{return _0x2f3dc6;}})[_0xfcef('0x4e')](function(_0x331d3b){logger[_0xfcef('0x4f')](_0xfcef('0x50'),_0x331d3b);throw _0x331d3b;});}return _0x2f3dc6;})[_0xfcef('0x25')](respondWithResult(_0x5014ed,0xc9))[_0xfcef('0x4e')](handleError(_0x5014ed,null));};exports[_0xfcef('0x24')]=function(_0x20cc47,_0x3a2f1d){if(_0x20cc47['body']['id']){delete _0x20cc47[_0xfcef('0x4c')]['id'];}return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x20cc47[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x3a2f1d,null))['then'](saveUpdates(_0x20cc47['body'],null))['then'](respondWithResult(_0x3a2f1d,null))['catch'](handleError(_0x3a2f1d,null));};exports[_0xfcef('0x26')]=function(_0x19d984,_0x392296){return db[_0xfcef('0x2d')][_0xfcef('0x4a')]({'where':{'id':_0x19d984[_0xfcef('0x47')]['id']}})[_0xfcef('0x25')](handleEntityNotFound(_0x392296,null))['then'](removeEntity(_0x392296,null))[_0xfcef('0x4e')](handleError(_0x392296,null));};exports[_0xfcef('0x51')]=function(_0x4873c5,_0x3dc98b){var _0x48d05a=0xa;var _0x39e7cd=[_0xfcef('0x52'),'left_join',_0xfcef('0x53'),'cross_join'];var _0x2e3258={'SUM':'SUM(%s)','COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':'MAX(%s)','MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':_0xfcef('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x583b85={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4040e2=function(_0x516d91){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),_0xfcef('0x61')],_0x516d91);};var _0x78eaf4=function(_0x19a2bc){if(!_0x19a2bc||!_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x2d408d='(',_0xd9d927=0x0;_0xd9d927<_0x19a2bc[_0xfcef('0x62')][_0xfcef('0x37')];_0xd9d927+=0x1){_0xd9d927>0x0&&(_0x2d408d+='\x20'+_0x19a2bc[_0xfcef('0x63')]+'\x20');_0x2d408d+=_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x64')]?_0x78eaf4(_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x64')]):_0x19a2bc['rules'][_0xd9d927][_0xfcef('0x65')]+'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')]+(_0x4040e2(_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x66')])?'\x20'+_0x19a2bc[_0xfcef('0x62')][_0xd9d927][_0xfcef('0x67')]:'');}return _0x2d408d+')';};var _0x4818f3={'where':{'id':_0x4873c5[_0xfcef('0x47')]['id']}},_0x4a3e93,_0x400c50,_0x450b12,_0x1f13c8,_0x9bd881;_0x4818f3=_['merge']({},_0x4818f3,_0x4873c5['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x4818f3)['then'](function(_0x2b727c){if(_0x2b727c){_0x4a3e93=_0x2b727c;return _0x2b727c[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x1a87c5){if(_0x1a87c5){if(!_0x1a87c5[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x400c50=_0x1a87c5;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xfcef('0x25')](function(_0x1084a9){if(_0x1084a9){_0x450b12=_[_0xfcef('0x6d')](_0x1084a9,'id');var _0x2e2420;var _0x37fffa=squel[_0xfcef('0x6e')]();_0x37fffa[_0xfcef('0x6f')](_0x4a3e93[_0xfcef('0x70')]);for(var _0x3d7601=0x0;_0x3d7601<_0x400c50[_0xfcef('0x37')];_0x3d7601+=0x1){_0x2e2420=_0x400c50[_0x3d7601]['MetricId']?_0x450b12[_0x400c50[_0x3d7601]['MetricId']][_0xfcef('0x71')]:_0x400c50[_0x3d7601][_0xfcef('0x65')];_0x2e2420=_0x400c50[_0x3d7601]['function']?_[_0xfcef('0x72')](_0x2e3258[_0x400c50[_0x3d7601][_0xfcef('0x73')]],'%s',_0x2e2420):_0x2e2420;_0x2e2420=_0x400c50[_0x3d7601][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x583b85[_0x400c50[_0x3d7601][_0xfcef('0x74')]],'%s',_0x2e2420):_0x2e2420;if(_0x400c50[_0x3d7601][_0xfcef('0x75')]){_0x37fffa[_0xfcef('0x64')](_0x2e2420);}_0x400c50[_0x3d7601][_0xfcef('0x76')]&&_0x37fffa[_0xfcef('0x77')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x37fffa[_0xfcef('0x65')](_0x2e2420,_0x400c50[_0x3d7601][_0xfcef('0x79')]||_0x2e2420);}if(_0x4a3e93[_0xfcef('0x7a')]){_0x4a3e93[_0xfcef('0x7a')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7a')]);for(var _0x11e5ac=0x0;_0x11e5ac<_0x4a3e93[_0xfcef('0x7a')][_0xfcef('0x37')];_0x11e5ac+=0x1){if(_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x39e7cd,_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x2f')])&&_0x4a3e93['joins'][_0x11e5ac][_0xfcef('0x7c')]&&_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')]&&_0x4a3e93['joins'][_0x11e5ac]['foreignKey']){_0x37fffa[_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['type']](_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4a3e93[_0xfcef('0x70')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac]['parentKey'],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7d')],_0x4a3e93[_0xfcef('0x7a')][_0x11e5ac][_0xfcef('0x7e')]));}}}if(_0x4a3e93[_0xfcef('0x7f')]){_0x4a3e93[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x4a3e93[_0xfcef('0x7f')]);_0x37fffa[_0xfcef('0x3b')](_0x78eaf4(_0x4a3e93['conditions'][_0xfcef('0x64')]));}_0x9bd881=_0x37fffa[_0xfcef('0x80')]();_0x37fffa[_0xfcef('0x1f')](_0x48d05a);_0x37fffa['offset'](0x0);logger['debug'](_0xfcef('0x81'),_0x37fffa[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x37fffa[_0xfcef('0x82')](),{'type':dbH['sequelize'][_0xfcef('0x84')]['SELECT']});}})['then'](respondWithResult(_0x3dc98b,null))[_0xfcef('0x4e')](handleError(_0x3dc98b,null));};function runReport(_0x51a700,_0x42b9b9,_0x2e232e){var _0x12af18=_0x42b9b9[_0xfcef('0x2b')];var _0x207e66=0xa;var _0x5c0030=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),_0xfcef('0x86')];var _0x432719={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfcef('0x89')};var _0x5bb62c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':_0xfcef('0x8a')};var _0x19ab04=function(_0xcfba98){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0xcfba98);};var _0x5480dc=function(_0x14d65e){if(!_0x14d65e||!_0x14d65e[_0xfcef('0x62')][_0xfcef('0x37')]){return'';}for(var _0x4ff2dc='(',_0x499471=0x0;_0x499471<_0x14d65e[_0xfcef('0x62')]['length'];_0x499471+=0x1){_0x499471>0x0&&(_0x4ff2dc+='\x20'+_0x14d65e['operator']+'\x20');_0x4ff2dc+=_0x14d65e['rules'][_0x499471][_0xfcef('0x64')]?_0x5480dc(_0x14d65e[_0xfcef('0x62')][_0x499471]['group']):_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x65')]+'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')]+(_0x19ab04(_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x66')])?'\x20'+_0x14d65e[_0xfcef('0x62')][_0x499471][_0xfcef('0x67')]:'');}return _0x4ff2dc+')';};var _0x403d45={'where':{'id':_0x51a700['id']}},_0x5548d5,_0x3d6b1b,_0x2c4a5f,_0x4e6aa4,_0x189836;_0x403d45=_['merge']({},_0x403d45,_0x2e232e);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x403d45)[_0xfcef('0x25')](function(_0x548d4f){if(_0x548d4f){_0x5548d5=_0x548d4f;return _0x548d4f[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x539bfa){if(_0x539bfa){if(!_0x539bfa[_0xfcef('0x37')]){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x3d6b1b=_0x539bfa;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x434976){if(_0x434976){_0x2c4a5f=_['keyBy'](_0x434976,'id');var _0x200549;var _0x48b0d1=squel[_0xfcef('0x6e')]();_0x48b0d1[_0xfcef('0x6f')](_0x5548d5[_0xfcef('0x70')]);for(var _0x15b836=0x0;_0x15b836<_0x3d6b1b[_0xfcef('0x37')];_0x15b836+=0x1){_0x200549=_0x3d6b1b[_0x15b836]['MetricId']?_0x2c4a5f[_0x3d6b1b[_0x15b836][_0xfcef('0x8b')]]['metric']:_0x3d6b1b[_0x15b836][_0xfcef('0x65')];_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x432719[_0x3d6b1b[_0x15b836][_0xfcef('0x73')]],'%s',_0x200549):_0x200549;_0x200549=_0x3d6b1b[_0x15b836][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x5bb62c[_0x3d6b1b[_0x15b836][_0xfcef('0x74')]],'%s',_0x200549):_0x200549;if(_0x3d6b1b[_0x15b836]['groupBy']){_0x48b0d1['group'](_0x200549);}_0x3d6b1b[_0x15b836][_0xfcef('0x76')]&&_0x48b0d1[_0xfcef('0x77')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x48b0d1[_0xfcef('0x65')](_0x200549,_0x3d6b1b[_0x15b836][_0xfcef('0x79')]||_0x200549);}if(_0x5548d5[_0xfcef('0x7a')]){_0x5548d5[_0xfcef('0x7a')]=JSON['parse'](_0x5548d5['joins']);for(var _0x4cb967=0x0;_0x4cb967<_0x5548d5[_0xfcef('0x7a')][_0xfcef('0x37')];_0x4cb967+=0x1){if(_0x5548d5['joins'][_0x4cb967][_0xfcef('0x2f')]&&_['includes'](_0x5c0030,_0x5548d5['joins'][_0x4cb967]['type'])&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')]&&_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']){_0x48b0d1[_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x2f')]](_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7d')],null,util[_0xfcef('0x74')]('%s.%s\x20=\x20%s.%s',_0x5548d5[_0xfcef('0x70')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967][_0xfcef('0x7c')],_0x5548d5['joins'][_0x4cb967][_0xfcef('0x7d')],_0x5548d5[_0xfcef('0x7a')][_0x4cb967]['foreignKey']));}}}if(_0x5548d5[_0xfcef('0x7f')]){_0x5548d5[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0x5548d5['conditions']);_0x48b0d1['where'](_0x5480dc(_0x5548d5[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x189836=_0x48b0d1[_0xfcef('0x80')]();_0x48b0d1['limit'](_0x207e66);_0x48b0d1['offset'](0x0);return;}})[_0xfcef('0x25')](function(){if(_0x42b9b9['output']===_0xfcef('0x8c')){return null;}var _0x24ef3b=_['merge'](_0x42b9b9,{'name':_0x42b9b9[_0xfcef('0x8d')]||_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],'basename':_0x12af18,'savename':util['format'](_0xfcef('0x8e'),_0x42b9b9[_0xfcef('0x2b')]||_0x5548d5[_0xfcef('0x2b')],require('randomstring')[_0xfcef('0x8f')](0x4),_0x42b9b9[_0xfcef('0x90')]||_0xfcef('0x91')),'reportId':_0x5548d5['id'],'reportType':_0xfcef('0x92')});return db['AnalyticExtractedReport'][_0xfcef('0x4b')](_0x24ef3b,{'raw':!![]});})[_0xfcef('0x25')](function(_0x48aea3){if(_0x5548d5[_0xfcef('0x70')]===_0xfcef('0x93')){_0x189836[_0xfcef('0x3b')](_0x5548d5['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9[_0xfcef('0x95')]);}else{_0x189836[_0xfcef('0x3b')](_0x5548d5[_0xfcef('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42b9b9[_0xfcef('0x94')],_0x42b9b9['endDate']);}if(_0x48aea3){logger['info'](_0xfcef('0x96'),_0x189836[_0xfcef('0x82')]());require(_0xfcef('0x97'))['fork'](path['join'](__dirname,_0xfcef('0x98'),_0x48aea3[_0xfcef('0x90')]),[_0x48aea3['id'],_0x189836[_0xfcef('0x82')](),path[_0xfcef('0x52')](__dirname,_0xfcef('0x99'),_0x48aea3[_0xfcef('0x9a')]),_0x12af18]);return _0x48aea3;}else{var _0x2ced8a=squel[_0xfcef('0x6e')]();_0x2ced8a[_0xfcef('0x6f')]('('+_0x189836[_0xfcef('0x82')]()+')',_0xfcef('0x9b'));_0x2ced8a[_0xfcef('0x65')](_0xfcef('0x9c'),_0xfcef('0x1e'));_0x189836[_0xfcef('0x1f')](_0x42b9b9[_0xfcef('0x1f')]||_0x207e66);_0x189836[_0xfcef('0x1c')](_0x42b9b9[_0xfcef('0x1c')]||0x0);return dbH[_0xfcef('0x83')][_0xfcef('0x34')](_0x2ced8a[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]})[_0xfcef('0x25')](function(_0x390d87){if(!_0x390d87['length']){_0x4e6aa4=0x0;}else{_0x4e6aa4=_0x390d87[0x0][_0xfcef('0x1e')]||0x0;}return dbH['sequelize'][_0xfcef('0x34')](_0x189836['toString'](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});})[_0xfcef('0x25')](function(_0x1a15bc){return{'rows':_0x1a15bc||[],'count':_0x4e6aa4};});}});}exports['run']=function(_0xe7d43e,_0x311f4a){return runReport(_0xe7d43e[_0xfcef('0x47')],_0xe7d43e[_0xfcef('0x34')],_0xe7d43e[_0xfcef('0x41')])[_0xfcef('0x25')](respondWithResult(_0x311f4a,null))[_0xfcef('0x4e')](handleError(_0x311f4a,null));};exports['runReport']=runReport;exports[_0xfcef('0x34')]=function(_0x3413dc,_0x5e0eb1){var _0x4fef91=0xa;var _0x2e5ab1=[_0xfcef('0x52'),_0xfcef('0x85'),_0xfcef('0x53'),'cross_join'];var _0x30622a={'SUM':_0xfcef('0x87'),'COUNT':_0xfcef('0x54'),'COUNT DISTINCT':_0xfcef('0x55'),'MAX':_0xfcef('0x88'),'MIN':_0xfcef('0x56'),'AVG':_0xfcef('0x57'),'GROUP_CONCAT':_0xfcef('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x474dde={'SEC_TO_TIME':_0xfcef('0x5a'),'DATE':_0xfcef('0x9e'),'HOUR':_0xfcef('0x5b'),'ROUND':_0xfcef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x552a79=function(_0x162a2e){return!_[_0xfcef('0x5d')]([_0xfcef('0x5e'),_0xfcef('0x5f'),_0xfcef('0x60'),'IS\x20NOT\x20EMPTY'],_0x162a2e);};var _0x3b163a=function(_0xa29368){if(!_0xa29368||!_0xa29368['rules'][_0xfcef('0x37')]){return'';}for(var _0x45e05f='(',_0x4b839d=0x0;_0x4b839d<_0xa29368[_0xfcef('0x62')][_0xfcef('0x37')];_0x4b839d+=0x1){_0x4b839d>0x0&&(_0x45e05f+='\x20'+_0xa29368['operator']+'\x20');_0x45e05f+=_0xa29368['rules'][_0x4b839d][_0xfcef('0x64')]?_0x3b163a(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x64')]):_0xa29368['rules'][_0x4b839d][_0xfcef('0x65')]+'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')]+(_0x552a79(_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x66')])?'\x20'+_0xa29368[_0xfcef('0x62')][_0x4b839d][_0xfcef('0x67')]:'');}return _0x45e05f+')';};var _0x50bec2={'where':{'id':_0x3413dc[_0xfcef('0x47')]['id']}},_0xd29185,_0x45dc86,_0x2f5a99,_0x182085,_0x24c580;_0x50bec2=_[_0xfcef('0x40')]({},_0x50bec2,_0x3413dc['options']);return db[_0xfcef('0x2d')][_0xfcef('0x4a')](_0x50bec2)[_0xfcef('0x25')](function(_0x1fce6b){if(_0x1fce6b){_0xd29185=_0x1fce6b;return _0x1fce6b[_0xfcef('0x68')]();}return null;})[_0xfcef('0x25')](function(_0x596499){if(_0x596499){if(!_0x596499['length']){throw new db[(_0xfcef('0x69'))][(_0xfcef('0x6a'))](_0xfcef('0x6b'),0x193);}_0x45dc86=_0x596499;return db[_0xfcef('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18f582){if(_0x18f582){_0x2f5a99=_['keyBy'](_0x18f582,'id');var _0x1e41ae;var _0x235173=squel['select']();_0x235173['from'](_0xd29185[_0xfcef('0x70')]);for(var _0x3a9ab4=0x0;_0x3a9ab4<_0x45dc86[_0xfcef('0x37')];_0x3a9ab4+=0x1){_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]?_0x2f5a99[_0x45dc86[_0x3a9ab4][_0xfcef('0x8b')]][_0xfcef('0x71')]:_0x45dc86[_0x3a9ab4]['field'];_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]?_[_0xfcef('0x72')](_0x30622a[_0x45dc86[_0x3a9ab4][_0xfcef('0x73')]],'%s',_0x1e41ae):_0x1e41ae;_0x1e41ae=_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]?_[_0xfcef('0x72')](_0x474dde[_0x45dc86[_0x3a9ab4][_0xfcef('0x74')]],'%s',_0x1e41ae):_0x1e41ae;if(_0x45dc86[_0x3a9ab4][_0xfcef('0x75')]){_0x235173[_0xfcef('0x64')](_0x1e41ae);}_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]&&_0x235173[_0xfcef('0x77')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x76')]===_0xfcef('0x78')?![]:!![]);_0x235173[_0xfcef('0x65')](_0x1e41ae,_0x45dc86[_0x3a9ab4][_0xfcef('0x79')]||_0x1e41ae);}if(_0xd29185[_0xfcef('0x7a')]){_0xd29185['joins']=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7a')]);for(var _0x3d4020=0x0;_0x3d4020<_0xd29185[_0xfcef('0x7a')][_0xfcef('0x37')];_0x3d4020+=0x1){if(_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')]&&_[_0xfcef('0x5d')](_0x2e5ab1,_0xd29185['joins'][_0x3d4020][_0xfcef('0x2f')])&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7c')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7d')]&&_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignKey']){_0x235173[_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x2f')]](_0xd29185[_0xfcef('0x7a')][_0x3d4020]['foreignTable'],null,util['format'](_0xfcef('0x9f'),_0xd29185[_0xfcef('0x70')],_0xd29185['joins'][_0x3d4020]['parentKey'],_0xd29185['joins'][_0x3d4020]['foreignTable'],_0xd29185[_0xfcef('0x7a')][_0x3d4020][_0xfcef('0x7e')]));}}}if(_0xd29185[_0xfcef('0x7f')]){_0xd29185[_0xfcef('0x7f')]=JSON[_0xfcef('0x7b')](_0xd29185[_0xfcef('0x7f')]);_0x235173[_0xfcef('0x3b')](_0x3b163a(_0xd29185[_0xfcef('0x7f')][_0xfcef('0x64')]));}_0x24c580=_0x235173[_0xfcef('0x80')]();_0x235173['limit'](_0x4fef91);_0x235173['offset'](0x0);logger[_0xfcef('0xa0')](_0xfcef('0x81'),_0x235173[_0xfcef('0x82')]());return dbH[_0xfcef('0x83')]['query'](_0x235173[_0xfcef('0x82')](),{'type':dbH[_0xfcef('0x83')][_0xfcef('0x84')][_0xfcef('0x9d')]});}})[_0xfcef('0x25')](function(){return{'sql':_0x24c580[_0xfcef('0x82')]()};})[_0xfcef('0x25')](respondWithResult(_0x5e0eb1,null))['catch'](handleError(_0x5e0eb1,null));}; \ No newline at end of file +var _0xcd6f=['name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','right_join','COUNT(%s)','Sequelize','DESC','output','fullPath','%s-%s.%s','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','alias','debug','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack'];(function(_0x4b4122,_0x1295e6){var _0x167fd1=function(_0x2ceaf3){while(--_0x2ceaf3){_0x4b4122['push'](_0x4b4122['shift']());}};_0x167fd1(++_0x1295e6);}(_0xcd6f,0x73));var _0xfcd6=function(_0x29c53b,_0x1e529d){_0x29c53b=_0x29c53b-0x0;var _0xb07516=_0xcd6f[_0x29c53b];return _0xb07516;};'use strict';var emlformat=require(_0xfcd6('0x0'));var rimraf=require(_0xfcd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd6('0x2'));var rp=require('request-promise');var moment=require(_0xfcd6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfcd6('0x4'));var util=require(_0xfcd6('0x5'));var path=require('path');var sox=require(_0xfcd6('0x6'));var csv=require(_0xfcd6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcd6('0x8'));var _=require(_0xfcd6('0x9'));var squel=require(_0xfcd6('0xa'));var crypto=require(_0xfcd6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfcd6('0xc'));var toCsv=require(_0xfcd6('0x7'));var querystring=require(_0xfcd6('0xd'));var Papa=require(_0xfcd6('0xe'));var Redis=require('ioredis');var authService=require(_0xfcd6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfcd6('0x10'));var hardwareService=require(_0xfcd6('0x11'));var logger=require('../../config/logger')(_0xfcd6('0x12'));var utils=require(_0xfcd6('0x13'));var config=require(_0xfcd6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcd6('0x15'))['db'];var dbH=require(_0xfcd6('0x15'))['dbH'];function respondWithStatusCode(_0x2b8723,_0x269259){_0x269259=_0x269259||0xcc;return function(_0x4da21b){if(_0x4da21b){return _0x2b8723['sendStatus'](_0x269259);}return _0x2b8723['status'](_0x269259)[_0xfcd6('0x16')]();};}function respondWithResult(_0x6df0d5,_0x56ca6b){_0x56ca6b=_0x56ca6b||0xc8;return function(_0x162e91){if(_0x162e91){return _0x6df0d5[_0xfcd6('0x17')](_0x56ca6b)['json'](_0x162e91);}};}function respondWithFilteredResult(_0x5c4e5d,_0x499c74){return function(_0x5150dc){if(_0x5150dc){var _0x46b6b5=typeof _0x499c74[_0xfcd6('0x18')]===_0xfcd6('0x19')&&typeof _0x499c74[_0xfcd6('0x1a')]==='undefined';var _0x275a6f=_0x5150dc['count'];var _0x1eff7e=_0x46b6b5?0x0:_0x499c74[_0xfcd6('0x18')];var _0xf0003a=_0x46b6b5?_0x5150dc[_0xfcd6('0x1b')]:_0x499c74['offset']+_0x499c74[_0xfcd6('0x1a')];var _0x1b72c6;if(_0xf0003a>=_0x275a6f){_0xf0003a=_0x275a6f;_0x1b72c6=0xc8;}else{_0x1b72c6=0xce;}_0x5c4e5d[_0xfcd6('0x17')](_0x1b72c6);return _0x5c4e5d[_0xfcd6('0x1c')](_0xfcd6('0x1d'),_0x1eff7e+'-'+_0xf0003a+'/'+_0x275a6f)[_0xfcd6('0x1e')](_0x5150dc);}return null;};}function patchUpdates(_0x53a8d7){return function(_0x15c101){try{jsonpatch[_0xfcd6('0x1f')](_0x15c101,_0x53a8d7,!![]);}catch(_0xadd9ba){return BPromise[_0xfcd6('0x20')](_0xadd9ba);}return _0x15c101['save']();};}function saveUpdates(_0x2b0664,_0x4feaa2){return function(_0x51d809){if(_0x51d809){return _0x51d809[_0xfcd6('0x21')](_0x2b0664)['then'](function(_0xe83980){return _0xe83980;});}return null;};}function removeEntity(_0x47000b,_0x1985c4){return function(_0x58c328){if(_0x58c328){return _0x58c328[_0xfcd6('0x22')]()[_0xfcd6('0x23')](function(){var _0x1a597c=_0x58c328[_0xfcd6('0x24')]({'plain':!![]});var _0x38d8e0=_0xfcd6('0x25');return db[_0xfcd6('0x26')][_0xfcd6('0x22')]({'where':{'type':_0x38d8e0,'resourceId':_0x1a597c['id']}})[_0xfcd6('0x23')](function(){return _0x58c328;});})[_0xfcd6('0x23')](function(){_0x47000b[_0xfcd6('0x17')](0xcc)[_0xfcd6('0x16')]();});}};}function handleEntityNotFound(_0xc7ddbd,_0x165a60){return function(_0x1ef8b3){if(!_0x1ef8b3){_0xc7ddbd[_0xfcd6('0x27')](0x194);}return _0x1ef8b3;};}function handleError(_0x33395e,_0x5587e3){_0x5587e3=_0x5587e3||0x1f4;return function(_0x2c9ac5){logger[_0xfcd6('0x28')](_0x2c9ac5[_0xfcd6('0x29')]);if(_0x2c9ac5[_0xfcd6('0x2a')]){delete _0x2c9ac5[_0xfcd6('0x2a')];}_0x33395e[_0xfcd6('0x17')](_0x5587e3)[_0xfcd6('0x2b')](_0x2c9ac5);};}exports[_0xfcd6('0x2c')]=function(_0x1c7399,_0x461dc2){var _0x4b6889={},_0x5d074c={},_0x5b8e9f={'count':0x0,'rows':[]};var _0x524fdc=_[_0xfcd6('0x2d')](db[_0xfcd6('0x2e')][_0xfcd6('0x2f')],function(_0x2393c4){return{'name':_0x2393c4[_0xfcd6('0x30')],'type':_0x2393c4[_0xfcd6('0x31')][_0xfcd6('0x32')]};});_0x5d074c[_0xfcd6('0x33')]=_[_0xfcd6('0x2d')](_0x524fdc,_0xfcd6('0x2a'));_0x5d074c[_0xfcd6('0x34')]=_[_0xfcd6('0x35')](_0x1c7399[_0xfcd6('0x34')]);_0x5d074c[_0xfcd6('0x36')]=_[_0xfcd6('0x37')](_0x5d074c[_0xfcd6('0x33')],_0x5d074c[_0xfcd6('0x34')]);_0x4b6889[_0xfcd6('0x38')]=_['intersection'](_0x5d074c[_0xfcd6('0x33')],qs['fields'](_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x39')]));_0x4b6889['attributes']=_0x4b6889[_0xfcd6('0x38')][_0xfcd6('0x3a')]?_0x4b6889['attributes']:_0x5d074c[_0xfcd6('0x33')];if(!_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x3b')](_0xfcd6('0x3c'))){_0x4b6889[_0xfcd6('0x1a')]=qs[_0xfcd6('0x1a')](_0x1c7399['query'][_0xfcd6('0x1a')]);_0x4b6889[_0xfcd6('0x18')]=qs[_0xfcd6('0x18')](_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x18')]);}_0x4b6889[_0xfcd6('0x3d')]=qs[_0xfcd6('0x3e')](_0x1c7399[_0xfcd6('0x34')]['sort']);_0x4b6889[_0xfcd6('0x3f')]=qs['filters'](_[_0xfcd6('0x40')](_0x1c7399['query'],_0x5d074c[_0xfcd6('0x36')]),_0x524fdc);if(_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x41')]){_0x4b6889[_0xfcd6('0x3f')]=_['merge'](_0x4b6889[_0xfcd6('0x3f')],{'$or':_[_0xfcd6('0x2d')](_0x524fdc,function(_0x37e530){if(_0x37e530[_0xfcd6('0x31')]!=='VIRTUAL'){var _0x1b0d8d={};_0x1b0d8d[_0x37e530['name']]={'$like':'%'+_0x1c7399[_0xfcd6('0x34')][_0xfcd6('0x41')]+'%'};return _0x1b0d8d;}})});}_0x4b6889=_[_0xfcd6('0x42')]({},_0x4b6889,_0x1c7399[_0xfcd6('0x43')]);var _0xed5bbd={'where':_0x4b6889['where']};return db[_0xfcd6('0x2e')][_0xfcd6('0x1b')](_0xed5bbd)[_0xfcd6('0x23')](function(_0x3fbdc4){_0x5b8e9f['count']=_0x3fbdc4;if(_0x1c7399['query'][_0xfcd6('0x44')]){_0x4b6889[_0xfcd6('0x45')]=[{'all':!![]}];}return db[_0xfcd6('0x2e')][_0xfcd6('0x46')](_0x4b6889);})[_0xfcd6('0x23')](function(_0x42c0a4){_0x5b8e9f[_0xfcd6('0x47')]=_0x42c0a4;return _0x5b8e9f;})['then'](respondWithFilteredResult(_0x461dc2,_0x4b6889))[_0xfcd6('0x48')](handleError(_0x461dc2,null));};exports['show']=function(_0x3d7ae0,_0xa66c26){var _0xc59895={'raw':![],'where':{'id':_0x3d7ae0[_0xfcd6('0x49')]['id']}},_0x456a7b={};_0x456a7b[_0xfcd6('0x33')]=_[_0xfcd6('0x35')](db[_0xfcd6('0x2e')]['rawAttributes']);_0x456a7b['query']=_[_0xfcd6('0x35')](_0x3d7ae0[_0xfcd6('0x34')]);_0x456a7b[_0xfcd6('0x36')]=_[_0xfcd6('0x37')](_0x456a7b[_0xfcd6('0x33')],_0x456a7b[_0xfcd6('0x34')]);_0xc59895[_0xfcd6('0x38')]=_[_0xfcd6('0x37')](_0x456a7b[_0xfcd6('0x33')],qs['fields'](_0x3d7ae0['query'][_0xfcd6('0x39')]));_0xc59895[_0xfcd6('0x38')]=_0xc59895[_0xfcd6('0x38')]['length']?_0xc59895[_0xfcd6('0x38')]:_0x456a7b[_0xfcd6('0x33')];if(_0x3d7ae0[_0xfcd6('0x34')]['includeAll']){_0xc59895[_0xfcd6('0x45')]=[{'all':!![]}];}_0xc59895=_[_0xfcd6('0x42')]({},_0xc59895,_0x3d7ae0[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0xc59895)[_0xfcd6('0x23')](handleEntityNotFound(_0xa66c26,null))[_0xfcd6('0x23')](respondWithResult(_0xa66c26,null))[_0xfcd6('0x48')](handleError(_0xa66c26,null));};exports[_0xfcd6('0x4b')]=function(_0xeb7f8f,_0x23c07c){return db[_0xfcd6('0x2e')][_0xfcd6('0x4b')](_0xeb7f8f[_0xfcd6('0x4c')],{})[_0xfcd6('0x23')](function(_0x56cb04){var _0x5a24ef=_0xeb7f8f[_0xfcd6('0x4d')][_0xfcd6('0x24')]({'plain':!![]});if(!_0x5a24ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a24ef[_0xfcd6('0x4e')]===_0xfcd6('0x4d')){var _0x396088=_0x56cb04[_0xfcd6('0x24')]({'plain':!![]});var _0x582f5d='Reports';return db['UserProfileSection'][_0xfcd6('0x4a')]({'where':{'name':_0x582f5d,'userProfileId':_0x5a24ef[_0xfcd6('0x4f')]},'raw':!![]})[_0xfcd6('0x23')](function(_0x4e0fe1){if(_0x4e0fe1&&_0x4e0fe1['autoAssociation']===0x0){return db['UserProfileResource'][_0xfcd6('0x4b')]({'name':_0x396088['name'],'resourceId':_0x396088['id'],'type':_0xfcd6('0x25'),'sectionId':_0x4e0fe1['id']},{})[_0xfcd6('0x23')](function(){return _0x56cb04;});}else{return _0x56cb04;}})[_0xfcd6('0x48')](function(_0x147c47){logger['error'](_0xfcd6('0x50'),_0x147c47);throw _0x147c47;});}return _0x56cb04;})[_0xfcd6('0x23')](respondWithResult(_0x23c07c,0xc9))[_0xfcd6('0x48')](handleError(_0x23c07c,null));};exports[_0xfcd6('0x21')]=function(_0x27804e,_0x2e3abb){if(_0x27804e[_0xfcd6('0x4c')]['id']){delete _0x27804e[_0xfcd6('0x4c')]['id'];}return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')]({'where':{'id':_0x27804e[_0xfcd6('0x49')]['id']}})[_0xfcd6('0x23')](handleEntityNotFound(_0x2e3abb,null))[_0xfcd6('0x23')](saveUpdates(_0x27804e[_0xfcd6('0x4c')],null))['then'](respondWithResult(_0x2e3abb,null))['catch'](handleError(_0x2e3abb,null));};exports[_0xfcd6('0x22')]=function(_0x8f206a,_0x55f02b){return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')]({'where':{'id':_0x8f206a[_0xfcd6('0x49')]['id']}})['then'](handleEntityNotFound(_0x55f02b,null))['then'](removeEntity(_0x55f02b,null))[_0xfcd6('0x48')](handleError(_0x55f02b,null));};exports['preview']=function(_0x5c339e,_0x37e54a){var _0x2567ea=0xa;var _0x4b8c2e=[_0xfcd6('0x51'),_0xfcd6('0x52'),'right_join','cross_join'];var _0x3b2b82={'SUM':_0xfcd6('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfcd6('0x54'),'MAX':_0xfcd6('0x55'),'MIN':_0xfcd6('0x56'),'AVG':_0xfcd6('0x57'),'GROUP_CONCAT':_0xfcd6('0x58'),'GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':_0xfcd6('0x5a')};var _0x33233b={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':'DATE(%s)','HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x477f47=function(_0x13a8e9){return!_['includes'](['IS\x20NULL',_0xfcd6('0x5e'),_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x13a8e9);};var _0x29320a=function(_0x32b8d2){if(!_0x32b8d2||!_0x32b8d2['rules'][_0xfcd6('0x3a')]){return'';}for(var _0x3adc51='(',_0x1c1c33=0x0;_0x1c1c33<_0x32b8d2[_0xfcd6('0x61')]['length'];_0x1c1c33+=0x1){_0x1c1c33>0x0&&(_0x3adc51+='\x20'+_0x32b8d2[_0xfcd6('0x62')]+'\x20');_0x3adc51+=_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x63')]?_0x29320a(_0x32b8d2['rules'][_0x1c1c33]['group']):_0x32b8d2['rules'][_0x1c1c33]['field']+'\x20'+_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x64')]+(_0x477f47(_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x64')])?'\x20'+_0x32b8d2[_0xfcd6('0x61')][_0x1c1c33][_0xfcd6('0x65')]:'');}return _0x3adc51+')';};var _0xd77141={'where':{'id':_0x5c339e['params']['id']}},_0x32e61d,_0x530806,_0x5765c8,_0x6bd7a5,_0x5c7140;_0xd77141=_[_0xfcd6('0x42')]({},_0xd77141,_0x5c339e[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0xd77141)['then'](function(_0x542a2e){if(_0x542a2e){_0x32e61d=_0x542a2e;return _0x542a2e[_0xfcd6('0x66')]();}return null;})[_0xfcd6('0x23')](function(_0x20ba7e){if(_0x20ba7e){if(!_0x20ba7e[_0xfcd6('0x3a')]){throw new db['Sequelize'][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x530806=_0x20ba7e;return db[_0xfcd6('0x69')][_0xfcd6('0x46')]({'raw':!![]});}return null;})['then'](function(_0x15a960){if(_0x15a960){_0x5765c8=_[_0xfcd6('0x6a')](_0x15a960,'id');var _0x5049d9;var _0x25ee04=squel[_0xfcd6('0x6b')]();_0x25ee04[_0xfcd6('0x6c')](_0x32e61d[_0xfcd6('0x6d')]);for(var _0x5af4e0=0x0;_0x5af4e0<_0x530806[_0xfcd6('0x3a')];_0x5af4e0+=0x1){_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x6e')]?_0x5765c8[_0x530806[_0x5af4e0][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x530806[_0x5af4e0][_0xfcd6('0x70')];_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x3b2b82[_0x530806[_0x5af4e0]['function']],'%s',_0x5049d9):_0x5049d9;_0x5049d9=_0x530806[_0x5af4e0][_0xfcd6('0x73')]?_[_0xfcd6('0x72')](_0x33233b[_0x530806[_0x5af4e0][_0xfcd6('0x73')]],'%s',_0x5049d9):_0x5049d9;if(_0x530806[_0x5af4e0][_0xfcd6('0x74')]){_0x25ee04[_0xfcd6('0x63')](_0x5049d9);}_0x530806[_0x5af4e0]['orderBy']&&_0x25ee04[_0xfcd6('0x3d')](_0x5049d9,_0x530806[_0x5af4e0][_0xfcd6('0x75')]==='DESC'?![]:!![]);_0x25ee04[_0xfcd6('0x70')](_0x5049d9,_0x530806[_0x5af4e0]['alias']||_0x5049d9);}if(_0x32e61d[_0xfcd6('0x76')]){_0x32e61d[_0xfcd6('0x76')]=JSON['parse'](_0x32e61d[_0xfcd6('0x76')]);for(var _0x2e7f46=0x0;_0x2e7f46<_0x32e61d['joins']['length'];_0x2e7f46+=0x1){if(_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x4b8c2e,_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x31')])&&_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x78')]&&_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x79')]&&_0x32e61d['joins'][_0x2e7f46][_0xfcd6('0x7a')]){_0x25ee04[_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x31')]](_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x79')],null,util['format'](_0xfcd6('0x7b'),_0x32e61d[_0xfcd6('0x6d')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x78')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x79')],_0x32e61d[_0xfcd6('0x76')][_0x2e7f46][_0xfcd6('0x7a')]));}}}if(_0x32e61d['conditions']){_0x32e61d[_0xfcd6('0x7c')]=JSON[_0xfcd6('0x7d')](_0x32e61d[_0xfcd6('0x7c')]);_0x25ee04['where'](_0x29320a(_0x32e61d['conditions'][_0xfcd6('0x63')]));}_0x5c7140=_0x25ee04[_0xfcd6('0x7e')]();_0x25ee04[_0xfcd6('0x1a')](_0x2567ea);_0x25ee04[_0xfcd6('0x18')](0x0);logger['debug'](_0xfcd6('0x7f'),_0x25ee04['toString']());return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x25ee04[_0xfcd6('0x81')](),{'type':dbH['sequelize'][_0xfcd6('0x82')][_0xfcd6('0x83')]});}})[_0xfcd6('0x23')](respondWithResult(_0x37e54a,null))[_0xfcd6('0x48')](handleError(_0x37e54a,null));};function runReport(_0x4619a5,_0x4ff4bb,_0x5f2b8b){var _0x356f9c=_0x4ff4bb[_0xfcd6('0x2a')];var _0x51c84a=0xa;var _0x42c8af=[_0xfcd6('0x51'),_0xfcd6('0x52'),_0xfcd6('0x84'),'cross_join'];var _0x43dde6={'SUM':_0xfcd6('0x53'),'COUNT':_0xfcd6('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xfcd6('0x57'),'GROUP_CONCAT':_0xfcd6('0x58'),'GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x549cb3={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':'DATE(%s)','HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a63bd=function(_0x253778){return!_[_0xfcd6('0x77')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x253778);};var _0x4e0736=function(_0x247b54){if(!_0x247b54||!_0x247b54[_0xfcd6('0x61')][_0xfcd6('0x3a')]){return'';}for(var _0x51ef42='(',_0x38dab0=0x0;_0x38dab0<_0x247b54[_0xfcd6('0x61')][_0xfcd6('0x3a')];_0x38dab0+=0x1){_0x38dab0>0x0&&(_0x51ef42+='\x20'+_0x247b54['operator']+'\x20');_0x51ef42+=_0x247b54['rules'][_0x38dab0][_0xfcd6('0x63')]?_0x4e0736(_0x247b54['rules'][_0x38dab0][_0xfcd6('0x63')]):_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x70')]+'\x20'+_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x64')]+(_0x5a63bd(_0x247b54[_0xfcd6('0x61')][_0x38dab0][_0xfcd6('0x64')])?'\x20'+_0x247b54[_0xfcd6('0x61')][_0x38dab0]['value']:'');}return _0x51ef42+')';};var _0x5d058e={'where':{'id':_0x4619a5['id']}},_0x537075,_0x3e4285,_0x546ef8,_0x56150f,_0xa25976;_0x5d058e=_['merge']({},_0x5d058e,_0x5f2b8b);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0x5d058e)[_0xfcd6('0x23')](function(_0x3e7d61){if(_0x3e7d61){_0x537075=_0x3e7d61;return _0x3e7d61['getFields']();}return null;})[_0xfcd6('0x23')](function(_0x164ae8){if(_0x164ae8){if(!_0x164ae8[_0xfcd6('0x3a')]){throw new db[(_0xfcd6('0x86'))][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x3e4285=_0x164ae8;return db['AnalyticMetric'][_0xfcd6('0x46')]({'raw':!![]});}return null;})[_0xfcd6('0x23')](function(_0x139375){if(_0x139375){_0x546ef8=_[_0xfcd6('0x6a')](_0x139375,'id');var _0x21d055;var _0x491db3=squel[_0xfcd6('0x6b')]();_0x491db3[_0xfcd6('0x6c')](_0x537075[_0xfcd6('0x6d')]);for(var _0x1a6678=0x0;_0x1a6678<_0x3e4285[_0xfcd6('0x3a')];_0x1a6678+=0x1){_0x21d055=_0x3e4285[_0x1a6678][_0xfcd6('0x6e')]?_0x546ef8[_0x3e4285[_0x1a6678][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x3e4285[_0x1a6678][_0xfcd6('0x70')];_0x21d055=_0x3e4285[_0x1a6678][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x43dde6[_0x3e4285[_0x1a6678][_0xfcd6('0x71')]],'%s',_0x21d055):_0x21d055;_0x21d055=_0x3e4285[_0x1a6678]['format']?_[_0xfcd6('0x72')](_0x549cb3[_0x3e4285[_0x1a6678][_0xfcd6('0x73')]],'%s',_0x21d055):_0x21d055;if(_0x3e4285[_0x1a6678]['groupBy']){_0x491db3[_0xfcd6('0x63')](_0x21d055);}_0x3e4285[_0x1a6678][_0xfcd6('0x75')]&&_0x491db3[_0xfcd6('0x3d')](_0x21d055,_0x3e4285[_0x1a6678]['orderBy']===_0xfcd6('0x87')?![]:!![]);_0x491db3[_0xfcd6('0x70')](_0x21d055,_0x3e4285[_0x1a6678]['alias']||_0x21d055);}if(_0x537075['joins']){_0x537075[_0xfcd6('0x76')]=JSON[_0xfcd6('0x7d')](_0x537075['joins']);for(var _0x138e2e=0x0;_0x138e2e<_0x537075[_0xfcd6('0x76')][_0xfcd6('0x3a')];_0x138e2e+=0x1){if(_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x42c8af,_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')])&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x78')]&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x79')]&&_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x7a')]){_0x491db3[_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x31')]](_0x537075[_0xfcd6('0x76')][_0x138e2e][_0xfcd6('0x79')],null,util['format'](_0xfcd6('0x7b'),_0x537075['table'],_0x537075[_0xfcd6('0x76')][_0x138e2e]['parentKey'],_0x537075['joins'][_0x138e2e][_0xfcd6('0x79')],_0x537075['joins'][_0x138e2e]['foreignKey']));}}}if(_0x537075[_0xfcd6('0x7c')]){_0x537075['conditions']=JSON[_0xfcd6('0x7d')](_0x537075[_0xfcd6('0x7c')]);_0x491db3[_0xfcd6('0x3f')](_0x4e0736(_0x537075['conditions'][_0xfcd6('0x63')]));}_0xa25976=_0x491db3[_0xfcd6('0x7e')]();_0x491db3['limit'](_0x51c84a);_0x491db3['offset'](0x0);return;}})['then'](function(){if(_0x4ff4bb[_0xfcd6('0x88')]==='web'){return null;}var _0x47772a=_[_0xfcd6('0x42')](_0x4ff4bb,{'name':_0x4ff4bb[_0xfcd6('0x89')]||_0x4ff4bb[_0xfcd6('0x2a')]||_0x537075['name'],'basename':_0x356f9c,'savename':util['format'](_0xfcd6('0x8a'),_0x4ff4bb[_0xfcd6('0x2a')]||_0x537075[_0xfcd6('0x2a')],require('randomstring')[_0xfcd6('0x8b')](0x4),_0x4ff4bb[_0xfcd6('0x88')]||_0xfcd6('0x8c')),'reportId':_0x537075['id'],'reportType':_0xfcd6('0x8d')});return db['AnalyticExtractedReport']['create'](_0x47772a,{'raw':!![]});})[_0xfcd6('0x23')](function(_0x4b7200){if(_0x537075[_0xfcd6('0x6d')]===_0xfcd6('0x8e')){_0xa25976[_0xfcd6('0x3f')](_0x537075[_0xfcd6('0x6d')]+_0xfcd6('0x8f'),_0x4ff4bb['startDate'],_0x4ff4bb['endDate']);}else{_0xa25976[_0xfcd6('0x3f')](_0x537075[_0xfcd6('0x6d')]+_0xfcd6('0x90'),_0x4ff4bb[_0xfcd6('0x91')],_0x4ff4bb['endDate']);}if(_0x4b7200){logger[_0xfcd6('0x92')](_0xfcd6('0x93'),_0xa25976['toString']());require(_0xfcd6('0x94'))['fork'](path[_0xfcd6('0x51')](__dirname,_0xfcd6('0x95'),_0x4b7200[_0xfcd6('0x88')]),[_0x4b7200['id'],_0xa25976[_0xfcd6('0x81')](),path[_0xfcd6('0x51')](__dirname,'../../files/reports',_0x4b7200[_0xfcd6('0x96')]),_0x356f9c]);return _0x4b7200;}else{var _0x4c91c2=squel[_0xfcd6('0x6b')]();_0x4c91c2[_0xfcd6('0x6c')]('('+_0xa25976[_0xfcd6('0x81')]()+')',_0xfcd6('0x97'));_0x4c91c2['field']('COUNT(*)',_0xfcd6('0x1b'));_0xa25976[_0xfcd6('0x1a')](_0x4ff4bb['limit']||_0x51c84a);_0xa25976[_0xfcd6('0x18')](_0x4ff4bb[_0xfcd6('0x18')]||0x0);return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x4c91c2['toString'](),{'type':dbH[_0xfcd6('0x80')][_0xfcd6('0x82')][_0xfcd6('0x83')]})['then'](function(_0x39d70c){if(!_0x39d70c[_0xfcd6('0x3a')]){_0x56150f=0x0;}else{_0x56150f=_0x39d70c[0x0]['count']||0x0;}return dbH['sequelize'][_0xfcd6('0x34')](_0xa25976[_0xfcd6('0x81')](),{'type':dbH[_0xfcd6('0x80')][_0xfcd6('0x82')][_0xfcd6('0x83')]});})[_0xfcd6('0x23')](function(_0x5ab089){return{'rows':_0x5ab089||[],'count':_0x56150f};});}});}exports['run']=function(_0x485844,_0x526284){return runReport(_0x485844[_0xfcd6('0x49')],_0x485844[_0xfcd6('0x34')],_0x485844[_0xfcd6('0x43')])[_0xfcd6('0x23')](respondWithResult(_0x526284,null))[_0xfcd6('0x48')](handleError(_0x526284,null));};exports['runReport']=runReport;exports['query']=function(_0x307904,_0x5898fa){var _0x46dc3a=0xa;var _0x3df4b7=[_0xfcd6('0x51'),'left_join','right_join','cross_join'];var _0x2c3ade={'SUM':_0xfcd6('0x53'),'COUNT':_0xfcd6('0x85'),'COUNT DISTINCT':_0xfcd6('0x54'),'MAX':'MAX(%s)','MIN':_0xfcd6('0x56'),'AVG':_0xfcd6('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfcd6('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2426a4={'SEC_TO_TIME':_0xfcd6('0x5b'),'DATE':_0xfcd6('0x98'),'HOUR':_0xfcd6('0x5c'),'ROUND':_0xfcd6('0x5d'),'UNIX_TIMESTAMP':_0xfcd6('0x99')};var _0x19fdf8=function(_0x3a2fcf){return!_[_0xfcd6('0x77')]([_0xfcd6('0x9a'),_0xfcd6('0x5e'),_0xfcd6('0x5f'),_0xfcd6('0x60')],_0x3a2fcf);};var _0x17f584=function(_0x55ded7){if(!_0x55ded7||!_0x55ded7[_0xfcd6('0x61')]['length']){return'';}for(var _0x12dcef='(',_0x2e1ea4=0x0;_0x2e1ea4<_0x55ded7[_0xfcd6('0x61')]['length'];_0x2e1ea4+=0x1){_0x2e1ea4>0x0&&(_0x12dcef+='\x20'+_0x55ded7[_0xfcd6('0x62')]+'\x20');_0x12dcef+=_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x63')]?_0x17f584(_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4]['group']):_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x70')]+'\x20'+_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x64')]+(_0x19fdf8(_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4][_0xfcd6('0x64')])?'\x20'+_0x55ded7[_0xfcd6('0x61')][_0x2e1ea4]['value']:'');}return _0x12dcef+')';};var _0x293fd7={'where':{'id':_0x307904[_0xfcd6('0x49')]['id']}},_0xbd5d78,_0x43f9de,_0x399a0f,_0x3a3a74,_0x2c09e9;_0x293fd7=_[_0xfcd6('0x42')]({},_0x293fd7,_0x307904[_0xfcd6('0x43')]);return db[_0xfcd6('0x2e')][_0xfcd6('0x4a')](_0x293fd7)[_0xfcd6('0x23')](function(_0x5da4b9){if(_0x5da4b9){_0xbd5d78=_0x5da4b9;return _0x5da4b9[_0xfcd6('0x66')]();}return null;})['then'](function(_0x1e7603){if(_0x1e7603){if(!_0x1e7603[_0xfcd6('0x3a')]){throw new db[(_0xfcd6('0x86'))][(_0xfcd6('0x67'))](_0xfcd6('0x68'),0x193);}_0x43f9de=_0x1e7603;return db[_0xfcd6('0x69')]['findAll']({'raw':!![]});}return null;})[_0xfcd6('0x23')](function(_0x5a20fe){if(_0x5a20fe){_0x399a0f=_[_0xfcd6('0x6a')](_0x5a20fe,'id');var _0x1e75e1;var _0x1b7953=squel[_0xfcd6('0x6b')]();_0x1b7953['from'](_0xbd5d78[_0xfcd6('0x6d')]);for(var _0x26c831=0x0;_0x26c831<_0x43f9de[_0xfcd6('0x3a')];_0x26c831+=0x1){_0x1e75e1=_0x43f9de[_0x26c831][_0xfcd6('0x6e')]?_0x399a0f[_0x43f9de[_0x26c831][_0xfcd6('0x6e')]][_0xfcd6('0x6f')]:_0x43f9de[_0x26c831][_0xfcd6('0x70')];_0x1e75e1=_0x43f9de[_0x26c831][_0xfcd6('0x71')]?_[_0xfcd6('0x72')](_0x2c3ade[_0x43f9de[_0x26c831][_0xfcd6('0x71')]],'%s',_0x1e75e1):_0x1e75e1;_0x1e75e1=_0x43f9de[_0x26c831]['format']?_[_0xfcd6('0x72')](_0x2426a4[_0x43f9de[_0x26c831][_0xfcd6('0x73')]],'%s',_0x1e75e1):_0x1e75e1;if(_0x43f9de[_0x26c831]['groupBy']){_0x1b7953[_0xfcd6('0x63')](_0x1e75e1);}_0x43f9de[_0x26c831][_0xfcd6('0x75')]&&_0x1b7953[_0xfcd6('0x3d')](_0x1e75e1,_0x43f9de[_0x26c831][_0xfcd6('0x75')]==='DESC'?![]:!![]);_0x1b7953[_0xfcd6('0x70')](_0x1e75e1,_0x43f9de[_0x26c831][_0xfcd6('0x9b')]||_0x1e75e1);}if(_0xbd5d78[_0xfcd6('0x76')]){_0xbd5d78[_0xfcd6('0x76')]=JSON[_0xfcd6('0x7d')](_0xbd5d78['joins']);for(var _0x22b977=0x0;_0x22b977<_0xbd5d78['joins'][_0xfcd6('0x3a')];_0x22b977+=0x1){if(_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')]&&_[_0xfcd6('0x77')](_0x3df4b7,_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')])&&_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x78')]&&_0xbd5d78['joins'][_0x22b977][_0xfcd6('0x79')]&&_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x7a')]){_0x1b7953[_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x31')]](_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x79')],null,util[_0xfcd6('0x73')](_0xfcd6('0x7b'),_0xbd5d78['table'],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x78')],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x79')],_0xbd5d78[_0xfcd6('0x76')][_0x22b977][_0xfcd6('0x7a')]));}}}if(_0xbd5d78['conditions']){_0xbd5d78[_0xfcd6('0x7c')]=JSON['parse'](_0xbd5d78[_0xfcd6('0x7c')]);_0x1b7953['where'](_0x17f584(_0xbd5d78['conditions']['group']));}_0x2c09e9=_0x1b7953[_0xfcd6('0x7e')]();_0x1b7953[_0xfcd6('0x1a')](_0x46dc3a);_0x1b7953[_0xfcd6('0x18')](0x0);logger[_0xfcd6('0x9c')]('Limited\x20Query:',_0x1b7953['toString']());return dbH[_0xfcd6('0x80')][_0xfcd6('0x34')](_0x1b7953[_0xfcd6('0x81')](),{'type':dbH[_0xfcd6('0x80')]['QueryTypes'][_0xfcd6('0x83')]});}})[_0xfcd6('0x23')](function(){return{'sql':_0x2c09e9[_0xfcd6('0x81')]()};})[_0xfcd6('0x23')](respondWithResult(_0x5898fa,null))[_0xfcd6('0x48')](handleError(_0x5898fa,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 8dc386d..685c1c2 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 _0xd129=['exports','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x463683,_0x403c60){var _0x1c7fa1=function(_0x224c11){while(--_0x224c11){_0x463683['push'](_0x463683['shift']());}};_0x1c7fa1(++_0x403c60);}(_0xd129,0x134));var _0x9d12=function(_0x32594b,_0x528a37){_0x32594b=_0x32594b-0x0;var _0x86c97=_0xd129[_0x32594b];return _0x86c97;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var logger=require(_0x9d12('0x1'))(_0x9d12('0x2'));var moment=require(_0x9d12('0x3'));var BPromise=require(_0x9d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d12('0x5'));var rimraf=require(_0x9d12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9d12('0x7')]=function(_0x44df39,_0x4ce38c){return _0x44df39['define']('AnalyticCustomReport',attributes,{'tableName':_0x9d12('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4807=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e7eb1,_0xeac85b){var _0x4a5384=function(_0x3bb51a){while(--_0x3bb51a){_0x5e7eb1['push'](_0x5e7eb1['shift']());}};_0x4a5384(++_0xeac85b);}(_0x4807,0x126));var _0x7480=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4807[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7480('0x0'))(_0x7480('0x1'));var moment=require(_0x7480('0x2'));var BPromise=require(_0x7480('0x3'));var rp=require(_0x7480('0x4'));var fs=require('fs');var path=require(_0x7480('0x5'));var rimraf=require('rimraf');var config=require(_0x7480('0x6'));var attributes=require(_0x7480('0x7'));module[_0x7480('0x8')]=function(_0x549fe3,_0x656342){return _0x549fe3[_0x7480('0x9')](_0x7480('0xa'),attributes,{'tableName':_0x7480('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 5916de3..47b150e 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 _0x9b51=['rpc','../../config/environment','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x497acd,_0x90d88){var _0xf8e61c=function(_0xf79d5d){while(--_0xf79d5d){_0x497acd['push'](_0x497acd['shift']());}};_0xf8e61c(++_0x90d88);}(_0x9b51,0xf5));var _0x19b5=function(_0x122da1,_0x158e84){_0x122da1=_0x122da1-0x0;var _0x273065=_0x9b51[_0x122da1];return _0x273065;};'use strict';var _=require(_0x19b5('0x0'));var util=require(_0x19b5('0x1'));var moment=require(_0x19b5('0x2'));var BPromise=require(_0x19b5('0x3'));var rs=require(_0x19b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19b5('0x5'));var logger=require(_0x19b5('0x6'))(_0x19b5('0x7'));var config=require(_0x19b5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f004,_0x5b1637,_0x288cc0){return new BPromise(function(_0x28bc5a,_0x1b0ff7){return client[_0x19b5('0xa')](_0x21f004,_0x288cc0)['then'](function(_0x15bba2){logger[_0x19b5('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5b1637,_0x19b5('0xc'));logger[_0x19b5('0xd')](_0x19b5('0xe'),_0x5b1637,_0x19b5('0xc'),JSON[_0x19b5('0xf')](_0x15bba2));if(_0x15bba2[_0x19b5('0x10')]){if(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x11')]===0x1f4){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')]['message']);return _0x1b0ff7(_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);}logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x15bba2[_0x19b5('0x10')][_0x19b5('0x13')]);return _0x28bc5a(_0x15bba2['error'][_0x19b5('0x13')]);}else{logger[_0x19b5('0xb')](_0x19b5('0x12'),_0x5b1637,_0x19b5('0xc'));_0x28bc5a(_0x15bba2['result'][_0x19b5('0x13')]);}})[_0x19b5('0x14')](function(_0x4cd530){logger[_0x19b5('0x10')](_0x19b5('0x12'),_0x5b1637,_0x4cd530);_0x1b0ff7(_0x4cd530);});});} \ No newline at end of file +var _0x0d62=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfb0bf9,_0x17b4a8){var _0x440f17=function(_0xf5282){while(--_0xf5282){_0xfb0bf9['push'](_0xfb0bf9['shift']());}};_0x440f17(++_0x17b4a8);}(_0x0d62,0x6f));var _0x20d6=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x0d62[_0xd93b26];return _0x25f668;};'use strict';var _=require(_0x20d6('0x0'));var util=require(_0x20d6('0x1'));var moment=require(_0x20d6('0x2'));var BPromise=require(_0x20d6('0x3'));var rs=require(_0x20d6('0x4'));var fs=require('fs');var Redis=require(_0x20d6('0x5'));var db=require(_0x20d6('0x6'))['db'];var utils=require(_0x20d6('0x7'));var logger=require(_0x20d6('0x8'))(_0x20d6('0x9'));var config=require(_0x20d6('0xa'));var jayson=require(_0x20d6('0xb'));var client=jayson[_0x20d6('0xc')][_0x20d6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3e411a,_0x20c24f,_0x278cb6){return new BPromise(function(_0x4a97cb,_0x1cdad7){return client['request'](_0x3e411a,_0x278cb6)[_0x20d6('0xe')](function(_0x3412e4){logger[_0x20d6('0xf')](_0x20d6('0x10'),_0x20c24f,_0x20d6('0x11'));logger[_0x20d6('0x12')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x20c24f,_0x20d6('0x11'),JSON[_0x20d6('0x13')](_0x3412e4));if(_0x3412e4['error']){if(_0x3412e4['error']['code']===0x1f4){logger[_0x20d6('0x14')](_0x20d6('0x10'),_0x20c24f,_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);return _0x1cdad7(_0x3412e4[_0x20d6('0x14')]['message']);}logger['error'](_0x20d6('0x10'),_0x20c24f,_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);return _0x4a97cb(_0x3412e4[_0x20d6('0x14')][_0x20d6('0x15')]);}else{logger[_0x20d6('0xf')](_0x20d6('0x10'),_0x20c24f,'request\x20sent');_0x4a97cb(_0x3412e4[_0x20d6('0x16')][_0x20d6('0x15')]);}})[_0x20d6('0x17')](function(_0x5db050){logger[_0x20d6('0x14')](_0x20d6('0x10'),_0x20c24f,_0x5db050);_0x1cdad7(_0x5db050);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index db4ac21..2aec7c2 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 _0x9c69=['/:id/query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','preview','/:id/run','run'];(function(_0x57ed97,_0x149ea){var _0x9cb533=function(_0x5dd737){while(--_0x5dd737){_0x57ed97['push'](_0x57ed97['shift']());}};_0x9cb533(++_0x149ea);}(_0x9c69,0x14a));var _0x99c6=function(_0x23983a,_0x38947d){_0x23983a=_0x23983a-0x0;var _0x127ff1=_0x9c69[_0x23983a];return _0x127ff1;};'use strict';var multer=require(_0x99c6('0x0'));var util=require(_0x99c6('0x1'));var path=require(_0x99c6('0x2'));var timeout=require(_0x99c6('0x3'));var express=require(_0x99c6('0x4'));var router=express[_0x99c6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99c6('0x6'));var interaction=require(_0x99c6('0x7'));var config=require(_0x99c6('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x99c6('0x9')]('/',auth[_0x99c6('0xa')](),controller['index']);router['get']('/:id',auth[_0x99c6('0xa')](),controller[_0x99c6('0xb')]);router[_0x99c6('0x9')]('/:id/preview',auth[_0x99c6('0xa')](),controller[_0x99c6('0xc')]);router['get'](_0x99c6('0xd'),auth[_0x99c6('0xa')](),controller[_0x99c6('0xe')]);router[_0x99c6('0x9')](_0x99c6('0xf'),auth[_0x99c6('0xa')](),controller['query']);router[_0x99c6('0x10')]('/',auth['isAuthenticated'](),controller[_0x99c6('0x11')]);router[_0x99c6('0x12')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x14')]);router[_0x99c6('0x15')](_0x99c6('0x13'),auth[_0x99c6('0xa')](),controller[_0x99c6('0x16')]);module['exports']=router; \ No newline at end of file +var _0x51c6=['/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x2afdcd,_0x1cd724){var _0x2b1314=function(_0x4a05d3){while(--_0x4a05d3){_0x2afdcd['push'](_0x2afdcd['shift']());}};_0x2b1314(++_0x1cd724);}(_0x51c6,0x152));var _0x651c=function(_0x440ff1,_0x1e67d1){_0x440ff1=_0x440ff1-0x0;var _0x4b534d=_0x51c6[_0x440ff1];return _0x4b534d;};'use strict';var multer=require(_0x651c('0x0'));var util=require(_0x651c('0x1'));var path=require(_0x651c('0x2'));var timeout=require(_0x651c('0x3'));var express=require(_0x651c('0x4'));var router=express[_0x651c('0x5')]();var fs_extra=require(_0x651c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x651c('0x7'));var config=require('../../config/environment');var controller=require(_0x651c('0x8'));router[_0x651c('0x9')]('/',auth[_0x651c('0xa')](),controller[_0x651c('0xb')]);router[_0x651c('0x9')](_0x651c('0xc'),auth[_0x651c('0xa')](),controller[_0x651c('0xd')]);router[_0x651c('0x9')](_0x651c('0xe'),auth[_0x651c('0xa')](),controller[_0x651c('0xf')]);router[_0x651c('0x9')](_0x651c('0x10'),auth['isAuthenticated'](),controller[_0x651c('0x11')]);router[_0x651c('0x9')]('/:id/query',auth[_0x651c('0xa')](),controller[_0x651c('0x12')]);router[_0x651c('0x13')]('/',auth[_0x651c('0xa')](),controller[_0x651c('0x14')]);router[_0x651c('0x15')](_0x651c('0xc'),auth[_0x651c('0xa')](),controller[_0x651c('0x16')]);router[_0x651c('0x17')](_0x651c('0xc'),auth['isAuthenticated'](),controller[_0x651c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index bcd5b1c..f5f28b7 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 _0x4819=['TEXT','exports','STRING'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x4819,0xcd));var _0x9481=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x4819[_0x4df671];return _0x3f9658;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file +var _0xc4aa=['STRING','sequelize','exports'];(function(_0xd38274,_0x2cc06e){var _0x37cc67=function(_0x20cea5){while(--_0x20cea5){_0xd38274['push'](_0xd38274['shift']());}};_0x37cc67(++_0x2cc06e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'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 3134b3a..5b3c286 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x488e86,_0x4acf5e){var _0x2c94c3=function(_0x6647f){while(--_0x6647f){_0x488e86['push'](_0x488e86['shift']());}};_0x2c94c3(++_0x4acf5e);}(_0x1261,0x144));var _0x1126=function(_0x14915a,_0x222f6b){_0x14915a=_0x14915a-0x0;var _0x2f683c=_0x1261[_0x14915a];return _0x2f683c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file +var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x40ff3c,_0x1c6580){var _0x16e888=function(_0x1d472f){while(--_0x1d472f){_0x40ff3c['push'](_0x40ff3c['shift']());}};_0x16e888(++_0x1c6580);}(_0x2675,0x75));var _0x5267=function(_0x29c915,_0x3def05){_0x29c915=_0x29c915-0x0;var _0x1b33a6=_0x2675[_0x29c915];return _0x1b33a6;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a04da64..7f9bd69 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 _0x7027=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util'];(function(_0x190349,_0x5b508e){var _0x1a236c=function(_0x4b1e56){while(--_0x4b1e56){_0x190349['push'](_0x190349['shift']());}};_0x1a236c(++_0x5b508e);}(_0x7027,0x1af));var _0x7702=function(_0x1076ae,_0x4da4e1){_0x1076ae=_0x1076ae-0x0;var _0x263108=_0x7027[_0x1076ae];return _0x263108;};'use strict';var _=require('lodash');var util=require(_0x7702('0x0'));var logger=require('../../config/logger')(_0x7702('0x1'));var moment=require(_0x7702('0x2'));var BPromise=require(_0x7702('0x3'));var rp=require(_0x7702('0x4'));var fs=require('fs');var path=require(_0x7702('0x5'));var rimraf=require(_0x7702('0x6'));var config=require(_0x7702('0x7'));var attributes=require(_0x7702('0x8'));module[_0x7702('0x9')]=function(_0xb07ec4,_0x1aa36a){return _0xb07ec4[_0x7702('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x7702('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3e2=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xd3e2,0x196));var _0x2d3e=function(_0x4475ad,_0x322373){_0x4475ad=_0x4475ad-0x0;var _0x414539=_0xd3e2[_0x4475ad];return _0x414539;};'use strict';var _=require(_0x2d3e('0x0'));var util=require(_0x2d3e('0x1'));var logger=require(_0x2d3e('0x2'))(_0x2d3e('0x3'));var moment=require(_0x2d3e('0x4'));var BPromise=require(_0x2d3e('0x5'));var rp=require(_0x2d3e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d3e('0x7'));var config=require(_0x2d3e('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x5aa4c5,_0x3e5642){return _0x5aa4c5['define'](_0x2d3e('0x9'),attributes,{'tableName':_0x2d3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index bdaf87d..c9a4799 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 _0xf5cc=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','then','info','debug'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf5cc,0x127));var _0xcf5c=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xf5cc[_0x571c1d];return _0x33c609;};'use strict';var _=require('lodash');var util=require(_0xcf5c('0x0'));var moment=require(_0xcf5c('0x1'));var BPromise=require(_0xcf5c('0x2'));var rs=require(_0xcf5c('0x3'));var fs=require('fs');var Redis=require(_0xcf5c('0x4'));var db=require(_0xcf5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcf5c('0x6'));var client=jayson[_0xcf5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263938,_0xbf6e20,_0x407c0c){return new BPromise(function(_0x26c5ca,_0x3f7d64){return client['request'](_0x263938,_0x407c0c)[_0xcf5c('0x8')](function(_0x26607c){logger[_0xcf5c('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,'request\x20sent');logger[_0xcf5c('0xa')](_0xcf5c('0xb'),_0xbf6e20,_0xcf5c('0xc'),JSON['stringify'](_0x26607c));if(_0x26607c[_0xcf5c('0xd')]){if(_0x26607c[_0xcf5c('0xd')][_0xcf5c('0xe')]===0x1f4){logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x3f7d64(_0x26607c[_0xcf5c('0xd')]['message']);}logger[_0xcf5c('0xd')](_0xcf5c('0xf'),_0xbf6e20,_0x26607c[_0xcf5c('0xd')][_0xcf5c('0x10')]);return _0x26c5ca(_0x26607c['error'][_0xcf5c('0x10')]);}else{logger[_0xcf5c('0x9')](_0xcf5c('0xf'),_0xbf6e20,_0xcf5c('0xc'));_0x26c5ca(_0x26607c[_0xcf5c('0x11')]['message']);}})['catch'](function(_0x4e9817){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xbf6e20,_0x4e9817);_0x3f7d64(_0x4e9817);});});} \ No newline at end of file +var _0x058f=['then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1d3026,_0x4960f3){var _0x2777c6=function(_0x540052){while(--_0x540052){_0x1d3026['push'](_0x1d3026['shift']());}};_0x2777c6(++_0x4960f3);}(_0x058f,0x1ee));var _0xf058=function(_0x25cef5,_0x495238){_0x25cef5=_0x25cef5-0x0;var _0x2ae4a4=_0x058f[_0x25cef5];return _0x2ae4a4;};'use strict';var _=require(_0xf058('0x0'));var util=require('util');var moment=require(_0xf058('0x1'));var BPromise=require(_0xf058('0x2'));var rs=require(_0xf058('0x3'));var fs=require('fs');var Redis=require(_0xf058('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf058('0x5'));var logger=require(_0xf058('0x6'))(_0xf058('0x7'));var config=require(_0xf058('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf058('0x9')][_0xf058('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f253,_0x218227,_0x35b488){return new BPromise(function(_0x4893c0,_0x1961ad){return client[_0xf058('0xb')](_0x30f253,_0x35b488)[_0xf058('0xc')](function(_0x4b4ae1){logger[_0xf058('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x218227,'request\x20sent');logger[_0xf058('0xe')](_0xf058('0xf'),_0x218227,_0xf058('0x10'),JSON[_0xf058('0x11')](_0x4b4ae1));if(_0x4b4ae1[_0xf058('0x12')]){if(_0x4b4ae1[_0xf058('0x12')]['code']===0x1f4){logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x4b4ae1[_0xf058('0x12')][_0xf058('0x14')]);return _0x1961ad(_0x4b4ae1['error'][_0xf058('0x14')]);}logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x4b4ae1[_0xf058('0x12')]['message']);return _0x4893c0(_0x4b4ae1[_0xf058('0x12')][_0xf058('0x14')]);}else{logger['info'](_0xf058('0x13'),_0x218227,'request\x20sent');_0x4893c0(_0x4b4ae1['result'][_0xf058('0x14')]);}})[_0xf058('0x15')](function(_0x33e9bb){logger[_0xf058('0x12')](_0xf058('0x13'),_0x218227,_0x33e9bb);_0x1961ad(_0x33e9bb);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 36e6a57..6de040d 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 _0x68fb=['put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x5749fa,_0x57f51e){var _0x2ffe02=function(_0xb18855){while(--_0xb18855){_0x5749fa['push'](_0x5749fa['shift']());}};_0x2ffe02(++_0x57f51e);}(_0x68fb,0x1d1));var _0xb68f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68fb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb68f('0x0'));var path=require('path');var timeout=require(_0xb68f('0x1'));var express=require('express');var router=express[_0xb68f('0x2')]();var fs_extra=require(_0xb68f('0x3'));var auth=require(_0xb68f('0x4'));var interaction=require(_0xb68f('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xb68f('0x6')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x8')]);router[_0xb68f('0x6')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xa')]);router[_0xb68f('0x6')](_0xb68f('0xb'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xc')]);router[_0xb68f('0x6')](_0xb68f('0xd'),auth[_0xb68f('0x7')](),controller[_0xb68f('0xe')]);router['get'](_0xb68f('0xf'),auth[_0xb68f('0x7')](),controller[_0xb68f('0x10')]);router[_0xb68f('0x11')]('/',auth[_0xb68f('0x7')](),controller[_0xb68f('0x12')]);router[_0xb68f('0x13')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['update']);router[_0xb68f('0x14')](_0xb68f('0x9'),auth[_0xb68f('0x7')](),controller['destroy']);module[_0xb68f('0x15')]=router; \ No newline at end of file +var _0xf6e9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post','create','update','delete','exports','multer'];(function(_0x19a4ac,_0x5d763d){var _0x8f3876=function(_0x26047d){while(--_0x26047d){_0x19a4ac['push'](_0x19a4ac['shift']());}};_0x8f3876(++_0x5d763d);}(_0xf6e9,0x137));var _0x9f6e=function(_0x347e8a,_0x2921ad){_0x347e8a=_0x347e8a-0x0;var _0x2d2354=_0xf6e9[_0x347e8a];return _0x2d2354;};'use strict';var multer=require(_0x9f6e('0x0'));var util=require('util');var path=require(_0x9f6e('0x1'));var timeout=require(_0x9f6e('0x2'));var express=require(_0x9f6e('0x3'));var router=express[_0x9f6e('0x4')]();var fs_extra=require(_0x9f6e('0x5'));var auth=require(_0x9f6e('0x6'));var interaction=require(_0x9f6e('0x7'));var config=require('../../config/environment');var controller=require(_0x9f6e('0x8'));router[_0x9f6e('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f6e('0xa')]);router[_0x9f6e('0x9')](_0x9f6e('0xb'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0xd')]);router[_0x9f6e('0x9')](_0x9f6e('0xe'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0xf')]);router[_0x9f6e('0x9')](_0x9f6e('0x10'),auth['isAuthenticated'](),controller[_0x9f6e('0x11')]);router[_0x9f6e('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x9f6e('0x12')]);router[_0x9f6e('0x13')]('/',auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x14')]);router['put'](_0x9f6e('0xb'),auth[_0x9f6e('0xc')](),controller[_0x9f6e('0x15')]);router[_0x9f6e('0x16')]('/:id',auth[_0x9f6e('0xc')](),controller['destroy']);module[_0x9f6e('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 5a983fc..1ca1118 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 _0x156b=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM'];(function(_0x2142f0,_0x4ffea8){var _0x573b7f=function(_0x3c9853){while(--_0x3c9853){_0x2142f0['push'](_0x2142f0['shift']());}};_0x573b7f(++_0x4ffea8);}(_0x156b,0x87));var _0xb156=function(_0x1a1131,_0x404e25){_0x1a1131=_0x1a1131-0x0;var _0x2a73ee=_0x156b[_0x1a1131];return _0x2a73ee;};'use strict';var Sequelize=require(_0xb156('0x0'));var moment=require(_0xb156('0x1'));module[_0xb156('0x2')]={'name':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xb156('0x4'),_0xb156('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xb156('0x4')},'savename':{'type':Sequelize[_0xb156('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb156('0x6')]},'endDate':{'type':Sequelize[_0xb156('0x6')]},'status':{'type':Sequelize[_0xb156('0x3')],'defaultValue':_0xb156('0x7')},'type':{'type':Sequelize[_0xb156('0x8')](_0xb156('0x9'),_0xb156('0xa')),'allowNull':![],'defaultValue':_0xb156('0x9')},'reportId':{'type':Sequelize[_0xb156('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xb156('0x3')]}}; \ No newline at end of file +var _0x2dc1=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x2325fe,_0x49c18a){var _0x2955cf=function(_0x2d3600){while(--_0x2d3600){_0x2325fe['push'](_0x2325fe['shift']());}};_0x2955cf(++_0x49c18a);}(_0x2dc1,0x7d));var _0x12dc=function(_0x5ce850,_0x28bfe5){_0x5ce850=_0x5ce850-0x0;var _0x12753a=_0x2dc1[_0x5ce850];return _0x12753a;};'use strict';var Sequelize=require(_0x12dc('0x0'));var moment=require(_0x12dc('0x1'));module[_0x12dc('0x2')]={'name':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x12dc('0x4')](_0x12dc('0x5'),_0x12dc('0x6'),_0x12dc('0x7')),'allowNull':![],'defaultValue':_0x12dc('0x5')},'savename':{'type':Sequelize[_0x12dc('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x12dc('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x12dc('0x3')],'defaultValue':_0x12dc('0x9')},'type':{'type':Sequelize[_0x12dc('0x4')](_0x12dc('0xa'),_0x12dc('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x12dc('0xc')](0xb)[_0x12dc('0xd')]},'reportType':{'type':Sequelize[_0x12dc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 99e8a9c..303304f 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 _0x1daf=['apply','reject','save','destroy','then','get','ExtractedReports','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json'];(function(_0x2597cc,_0x40b415){var _0xaa509f=function(_0x121adf){while(--_0x121adf){_0x2597cc['push'](_0x2597cc['shift']());}};_0xaa509f(++_0x40b415);}(_0x1daf,0xa0));var _0xf1da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1daf[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xf1da('0x0'));var rimraf=require(_0xf1da('0x1'));var zipdir=require(_0xf1da('0x2'));var jsonpatch=require(_0xf1da('0x3'));var rp=require(_0xf1da('0x4'));var moment=require(_0xf1da('0x5'));var BPromise=require(_0xf1da('0x6'));var Mustache=require(_0xf1da('0x7'));var util=require('util');var path=require(_0xf1da('0x8'));var sox=require(_0xf1da('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1da('0xa'));var _=require(_0xf1da('0xb'));var squel=require('squel');var crypto=require(_0xf1da('0xc'));var jsforce=require(_0xf1da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf1da('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf1da('0xf'));var qs=require(_0xf1da('0x10'));var as=require(_0xf1da('0x11'));var hardwareService=require(_0xf1da('0x12'));var logger=require(_0xf1da('0x13'))(_0xf1da('0x14'));var utils=require(_0xf1da('0x15'));var config=require(_0xf1da('0x16'));var licenseUtil=require(_0xf1da('0x17'));var db=require(_0xf1da('0x18'))['db'];function respondWithStatusCode(_0x17f470,_0x5a71e5){_0x5a71e5=_0x5a71e5||0xcc;return function(_0x2d5aee){if(_0x2d5aee){return _0x17f470[_0xf1da('0x19')](_0x5a71e5);}return _0x17f470[_0xf1da('0x1a')](_0x5a71e5)[_0xf1da('0x1b')]();};}function respondWithResult(_0x1944ce,_0x2e46f4){_0x2e46f4=_0x2e46f4||0xc8;return function(_0x329515){if(_0x329515){return _0x1944ce[_0xf1da('0x1a')](_0x2e46f4)['json'](_0x329515);}};}function respondWithFilteredResult(_0x1f3222,_0x14afb6){return function(_0x511ce7){if(_0x511ce7){var _0x4af491=typeof _0x14afb6['offset']===_0xf1da('0x1c')&&typeof _0x14afb6[_0xf1da('0x1d')]==='undefined';var _0x504b40=_0x511ce7[_0xf1da('0x1e')];var _0x3b1a0c=_0x4af491?0x0:_0x14afb6[_0xf1da('0x1f')];var _0x5e444b=_0x4af491?_0x511ce7['count']:_0x14afb6['offset']+_0x14afb6[_0xf1da('0x1d')];var _0x23ca7a;if(_0x5e444b>=_0x504b40){_0x5e444b=_0x504b40;_0x23ca7a=0xc8;}else{_0x23ca7a=0xce;}_0x1f3222[_0xf1da('0x1a')](_0x23ca7a);return _0x1f3222['set'](_0xf1da('0x20'),_0x3b1a0c+'-'+_0x5e444b+'/'+_0x504b40)[_0xf1da('0x21')](_0x511ce7);}return null;};}function patchUpdates(_0x5eaf15){return function(_0x34e8bd){try{jsonpatch[_0xf1da('0x22')](_0x34e8bd,_0x5eaf15,!![]);}catch(_0x4c5f4a){return BPromise[_0xf1da('0x23')](_0x4c5f4a);}return _0x34e8bd[_0xf1da('0x24')]();};}function saveUpdates(_0x1050c1,_0x46c0bd){return function(_0x111903){if(_0x111903){return _0x111903['update'](_0x1050c1)['then'](function(_0x5c7510){return _0x5c7510;});}return null;};}function removeEntity(_0x52cb0c,_0x411599){return function(_0x57e242){if(_0x57e242){return _0x57e242[_0xf1da('0x25')]()[_0xf1da('0x26')](function(){var _0x529853=_0x57e242[_0xf1da('0x27')]({'plain':!![]});var _0x109844=_0xf1da('0x28');return db[_0xf1da('0x29')][_0xf1da('0x25')]({'where':{'type':_0x109844,'resourceId':_0x529853['id']}})[_0xf1da('0x26')](function(){return _0x57e242;});})[_0xf1da('0x26')](function(){_0x52cb0c['status'](0xcc)[_0xf1da('0x1b')]();});}};}function handleEntityNotFound(_0x38407b,_0x2a7ad1){return function(_0x4af31d){if(!_0x4af31d){_0x38407b[_0xf1da('0x19')](0x194);}return _0x4af31d;};}function handleError(_0x166297,_0x4ae60e){_0x4ae60e=_0x4ae60e||0x1f4;return function(_0x5be13e){logger[_0xf1da('0x2a')](_0x5be13e['stack']);if(_0x5be13e[_0xf1da('0x2b')]){delete _0x5be13e[_0xf1da('0x2b')];}_0x166297[_0xf1da('0x1a')](_0x4ae60e)['send'](_0x5be13e);};}exports[_0xf1da('0x2c')]=function(_0x507b25,_0x23ca4e){var _0x4b667f={},_0xc09377={},_0x497e41={'count':0x0,'rows':[]};var _0xab71b=_[_0xf1da('0x2d')](db['AnalyticExtractedReport'][_0xf1da('0x2e')],function(_0x243e35){return{'name':_0x243e35[_0xf1da('0x2f')],'type':_0x243e35[_0xf1da('0x30')][_0xf1da('0x31')]};});_0xc09377[_0xf1da('0x32')]=_[_0xf1da('0x2d')](_0xab71b,_0xf1da('0x2b'));_0xc09377[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x507b25[_0xf1da('0x33')]);_0xc09377[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0xc09377['model'],_0xc09377[_0xf1da('0x33')]);_0x4b667f[_0xf1da('0x37')]=_['intersection'](_0xc09377['model'],qs[_0xf1da('0x38')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x38')]));_0x4b667f[_0xf1da('0x37')]=_0x4b667f[_0xf1da('0x37')]['length']?_0x4b667f[_0xf1da('0x37')]:_0xc09377[_0xf1da('0x32')];if(!_0x507b25[_0xf1da('0x33')][_0xf1da('0x39')](_0xf1da('0x3a'))){_0x4b667f[_0xf1da('0x1d')]=qs['limit'](_0x507b25['query'][_0xf1da('0x1d')]);_0x4b667f[_0xf1da('0x1f')]=qs[_0xf1da('0x1f')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x1f')]);}_0x4b667f[_0xf1da('0x3b')]=qs[_0xf1da('0x3c')](_0x507b25[_0xf1da('0x33')][_0xf1da('0x3c')]);_0x4b667f[_0xf1da('0x3d')]=qs[_0xf1da('0x35')](_['pick'](_0x507b25[_0xf1da('0x33')],_0xc09377[_0xf1da('0x35')]),_0xab71b);if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x3e')]){_0x4b667f['where']=_[_0xf1da('0x3f')](_0x4b667f['where'],{'$or':_[_0xf1da('0x2d')](_0xab71b,function(_0x479720){if(_0x479720['type']!==_0xf1da('0x40')){var _0x3bee35={};_0x3bee35[_0x479720['name']]={'$like':'%'+_0x507b25['query'][_0xf1da('0x3e')]+'%'};return _0x3bee35;}})});}_0x4b667f=_[_0xf1da('0x3f')]({},_0x4b667f,_0x507b25['options']);var _0x475b3c={'where':_0x4b667f['where']};return db[_0xf1da('0x41')]['count'](_0x475b3c)['then'](function(_0xbf0f){_0x497e41['count']=_0xbf0f;if(_0x507b25[_0xf1da('0x33')][_0xf1da('0x42')]){_0x4b667f[_0xf1da('0x43')]=[{'all':!![]}];}return db[_0xf1da('0x41')][_0xf1da('0x44')](_0x4b667f);})['then'](function(_0x48a5d0){_0x497e41[_0xf1da('0x45')]=_0x48a5d0;return _0x497e41;})[_0xf1da('0x26')](respondWithFilteredResult(_0x23ca4e,_0x4b667f))[_0xf1da('0x46')](handleError(_0x23ca4e,null));};exports[_0xf1da('0x47')]=function(_0x6407b5,_0x2e0c35){var _0x316949={'raw':!![],'where':{'id':_0x6407b5[_0xf1da('0x48')]['id']}},_0x5a7070={};_0x5a7070[_0xf1da('0x32')]=_[_0xf1da('0x34')](db[_0xf1da('0x41')][_0xf1da('0x2e')]);_0x5a7070[_0xf1da('0x33')]=_[_0xf1da('0x34')](_0x6407b5[_0xf1da('0x33')]);_0x5a7070[_0xf1da('0x35')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],_0x5a7070[_0xf1da('0x33')]);_0x316949[_0xf1da('0x37')]=_[_0xf1da('0x36')](_0x5a7070[_0xf1da('0x32')],qs[_0xf1da('0x38')](_0x6407b5[_0xf1da('0x33')]['fields']));_0x316949[_0xf1da('0x37')]=_0x316949['attributes'][_0xf1da('0x49')]?_0x316949[_0xf1da('0x37')]:_0x5a7070[_0xf1da('0x32')];if(_0x6407b5['query']['includeAll']){_0x316949[_0xf1da('0x43')]=[{'all':!![]}];}_0x316949=_[_0xf1da('0x3f')]({},_0x316949,_0x6407b5['options']);return db[_0xf1da('0x41')][_0xf1da('0x4a')](_0x316949)[_0xf1da('0x26')](handleEntityNotFound(_0x2e0c35,null))[_0xf1da('0x26')](respondWithResult(_0x2e0c35,null))[_0xf1da('0x46')](handleError(_0x2e0c35,null));};exports['create']=function(_0x25f90b,_0x5d8739){return db[_0xf1da('0x41')]['create'](_0x25f90b[_0xf1da('0x4b')],{})[_0xf1da('0x26')](function(_0x6d798){var _0x4e5540=_0x25f90b[_0xf1da('0x4c')][_0xf1da('0x27')]({'plain':!![]});if(!_0x4e5540)throw new Error(_0xf1da('0x4d'));if(_0x4e5540[_0xf1da('0x4e')]===_0xf1da('0x4c')){var _0x24c714=_0x6d798['get']({'plain':!![]});var _0x1bf52a='ExtractedReports';return db[_0xf1da('0x4f')][_0xf1da('0x4a')]({'where':{'name':_0x1bf52a,'userProfileId':_0x4e5540['userProfileId']},'raw':!![]})[_0xf1da('0x26')](function(_0x22bfbd){if(_0x22bfbd&&_0x22bfbd['autoAssociation']===0x0){return db[_0xf1da('0x29')][_0xf1da('0x50')]({'name':_0x24c714[_0xf1da('0x2b')],'resourceId':_0x24c714['id'],'type':_0x22bfbd[_0xf1da('0x2b')],'sectionId':_0x22bfbd['id']},{})[_0xf1da('0x26')](function(){return _0x6d798;});}else{return _0x6d798;}})[_0xf1da('0x46')](function(_0x187672){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x187672);throw _0x187672;});}return _0x6d798;})[_0xf1da('0x26')](respondWithResult(_0x5d8739,0xc9))['catch'](handleError(_0x5d8739,null));};exports[_0xf1da('0x51')]=function(_0x24ef7a,_0x3336ee){if(_0x24ef7a['body']['id']){delete _0x24ef7a[_0xf1da('0x4b')]['id'];}return db[_0xf1da('0x41')]['find']({'where':{'id':_0x24ef7a[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3336ee,null))[_0xf1da('0x26')](saveUpdates(_0x24ef7a[_0xf1da('0x4b')],null))[_0xf1da('0x26')](respondWithResult(_0x3336ee,null))[_0xf1da('0x46')](handleError(_0x3336ee,null));};exports[_0xf1da('0x25')]=function(_0x3b85dd,_0x3e46c2){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x3b85dd[_0xf1da('0x48')]['id']}})[_0xf1da('0x26')](handleEntityNotFound(_0x3e46c2,null))['then'](removeEntity(_0x3e46c2,null))['catch'](handleError(_0x3e46c2,null));};exports[_0xf1da('0x52')]=function(_0x549482,_0x254dcb,_0x77874e){return db[_0xf1da('0x41')][_0xf1da('0x4a')]({'where':{'id':_0x549482['params']['id']},'attributes':[_0xf1da('0x2b'),_0xf1da('0x53'),_0xf1da('0x54'),_0xf1da('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x254dcb,null))['then'](function(_0x197d4e){if(_0x197d4e){if(!fs[_0xf1da('0x56')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]))){throw new db[(_0xf1da('0x5a'))][(_0xf1da('0x5b'))](_0xf1da('0x5c'));}if(_0x549482[_0xf1da('0x33')][_0xf1da('0x5d')]){return _0x254dcb[_0xf1da('0x19')](0xc8);}return _0x254dcb[_0xf1da('0x52')](path[_0xf1da('0x57')](config[_0xf1da('0x58')],_0xf1da('0x59'),_0x197d4e[_0xf1da('0x54')]),util[_0xf1da('0x5e')](_0xf1da('0x5f'),_0x197d4e[_0xf1da('0x53')]||_0x197d4e[_0xf1da('0x2b')],_0x197d4e['output'][_0xf1da('0x60')]()));}})[_0xf1da('0x46')](handleError(_0x254dcb,null));}; \ No newline at end of file +var _0xbc08=['mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','sendStatus','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x18674c,_0x3c40f7){var _0x3dc010=function(_0x406283){while(--_0x406283){_0x18674c['push'](_0x18674c['shift']());}};_0x3dc010(++_0x3c40f7);}(_0xbc08,0x169));var _0x8bc0=function(_0x5e92b7,_0x47623){_0x5e92b7=_0x5e92b7-0x0;var _0x2554d0=_0xbc08[_0x5e92b7];return _0x2554d0;};'use strict';var emlformat=require(_0x8bc0('0x0'));var rimraf=require(_0x8bc0('0x1'));var zipdir=require(_0x8bc0('0x2'));var jsonpatch=require(_0x8bc0('0x3'));var rp=require(_0x8bc0('0x4'));var moment=require(_0x8bc0('0x5'));var BPromise=require(_0x8bc0('0x6'));var Mustache=require(_0x8bc0('0x7'));var util=require(_0x8bc0('0x8'));var path=require(_0x8bc0('0x9'));var sox=require('sox');var csv=require(_0x8bc0('0xa'));var ejs=require(_0x8bc0('0xb'));var fs=require('fs');var fs_extra=require(_0x8bc0('0xc'));var _=require(_0x8bc0('0xd'));var squel=require('squel');var crypto=require(_0x8bc0('0xe'));var jsforce=require(_0x8bc0('0xf'));var deskjs=require(_0x8bc0('0x10'));var toCsv=require(_0x8bc0('0xa'));var querystring=require(_0x8bc0('0x11'));var Papa=require(_0x8bc0('0x12'));var Redis=require('ioredis');var authService=require(_0x8bc0('0x13'));var qs=require(_0x8bc0('0x14'));var as=require(_0x8bc0('0x15'));var hardwareService=require(_0x8bc0('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8bc0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc0('0x18'))['db'];function respondWithStatusCode(_0x90e162,_0x552f53){_0x552f53=_0x552f53||0xcc;return function(_0x26178b){if(_0x26178b){return _0x90e162['sendStatus'](_0x552f53);}return _0x90e162[_0x8bc0('0x19')](_0x552f53)['end']();};}function respondWithResult(_0x46d02a,_0x1f6a35){_0x1f6a35=_0x1f6a35||0xc8;return function(_0xd70b16){if(_0xd70b16){return _0x46d02a[_0x8bc0('0x19')](_0x1f6a35)[_0x8bc0('0x1a')](_0xd70b16);}};}function respondWithFilteredResult(_0x47ef90,_0x210d2f){return function(_0x49f9ee){if(_0x49f9ee){var _0x47f35a=typeof _0x210d2f['offset']===_0x8bc0('0x1b')&&typeof _0x210d2f[_0x8bc0('0x1c')]===_0x8bc0('0x1b');var _0x6b117=_0x49f9ee['count'];var _0x278da4=_0x47f35a?0x0:_0x210d2f[_0x8bc0('0x1d')];var _0x1a920f=_0x47f35a?_0x49f9ee[_0x8bc0('0x1e')]:_0x210d2f[_0x8bc0('0x1d')]+_0x210d2f[_0x8bc0('0x1c')];var _0x56f365;if(_0x1a920f>=_0x6b117){_0x1a920f=_0x6b117;_0x56f365=0xc8;}else{_0x56f365=0xce;}_0x47ef90[_0x8bc0('0x19')](_0x56f365);return _0x47ef90[_0x8bc0('0x1f')]('Content-Range',_0x278da4+'-'+_0x1a920f+'/'+_0x6b117)[_0x8bc0('0x1a')](_0x49f9ee);}return null;};}function patchUpdates(_0x324268){return function(_0x53d5a6){try{jsonpatch[_0x8bc0('0x20')](_0x53d5a6,_0x324268,!![]);}catch(_0x3c476b){return BPromise[_0x8bc0('0x21')](_0x3c476b);}return _0x53d5a6[_0x8bc0('0x22')]();};}function saveUpdates(_0x29138f,_0x15520f){return function(_0x1ca1dc){if(_0x1ca1dc){return _0x1ca1dc['update'](_0x29138f)[_0x8bc0('0x23')](function(_0x53c25f){return _0x53c25f;});}return null;};}function removeEntity(_0xb8e545,_0x3b177f){return function(_0x3bd98d){if(_0x3bd98d){return _0x3bd98d[_0x8bc0('0x24')]()[_0x8bc0('0x23')](function(){var _0x4c73d6=_0x3bd98d['get']({'plain':!![]});var _0x470197=_0x8bc0('0x25');return db[_0x8bc0('0x26')][_0x8bc0('0x24')]({'where':{'type':_0x470197,'resourceId':_0x4c73d6['id']}})['then'](function(){return _0x3bd98d;});})[_0x8bc0('0x23')](function(){_0xb8e545[_0x8bc0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xea013b,_0x368fdc){return function(_0x3a27ec){if(!_0x3a27ec){_0xea013b['sendStatus'](0x194);}return _0x3a27ec;};}function handleError(_0x5cc47d,_0x35551d){_0x35551d=_0x35551d||0x1f4;return function(_0x300368){logger[_0x8bc0('0x27')](_0x300368[_0x8bc0('0x28')]);if(_0x300368[_0x8bc0('0x29')]){delete _0x300368['name'];}_0x5cc47d[_0x8bc0('0x19')](_0x35551d)[_0x8bc0('0x2a')](_0x300368);};}exports[_0x8bc0('0x2b')]=function(_0x5d2778,_0x2b8ba0){var _0x534bf6={},_0x53057f={},_0x46a69d={'count':0x0,'rows':[]};var _0x41ba43=_[_0x8bc0('0x2c')](db[_0x8bc0('0x2d')]['rawAttributes'],function(_0x2b9958){return{'name':_0x2b9958[_0x8bc0('0x2e')],'type':_0x2b9958['type'][_0x8bc0('0x2f')]};});_0x53057f[_0x8bc0('0x30')]=_[_0x8bc0('0x2c')](_0x41ba43,'name');_0x53057f[_0x8bc0('0x31')]=_[_0x8bc0('0x32')](_0x5d2778[_0x8bc0('0x31')]);_0x53057f[_0x8bc0('0x33')]=_[_0x8bc0('0x34')](_0x53057f['model'],_0x53057f['query']);_0x534bf6[_0x8bc0('0x35')]=_['intersection'](_0x53057f[_0x8bc0('0x30')],qs[_0x8bc0('0x36')](_0x5d2778['query'][_0x8bc0('0x36')]));_0x534bf6[_0x8bc0('0x35')]=_0x534bf6[_0x8bc0('0x35')][_0x8bc0('0x37')]?_0x534bf6[_0x8bc0('0x35')]:_0x53057f[_0x8bc0('0x30')];if(!_0x5d2778['query'][_0x8bc0('0x38')](_0x8bc0('0x39'))){_0x534bf6['limit']=qs[_0x8bc0('0x1c')](_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x1c')]);_0x534bf6['offset']=qs['offset'](_0x5d2778['query'][_0x8bc0('0x1d')]);}_0x534bf6[_0x8bc0('0x3a')]=qs[_0x8bc0('0x3b')](_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x3b')]);_0x534bf6[_0x8bc0('0x3c')]=qs[_0x8bc0('0x33')](_['pick'](_0x5d2778[_0x8bc0('0x31')],_0x53057f['filters']),_0x41ba43);if(_0x5d2778['query'][_0x8bc0('0x3d')]){_0x534bf6[_0x8bc0('0x3c')]=_[_0x8bc0('0x3e')](_0x534bf6[_0x8bc0('0x3c')],{'$or':_['map'](_0x41ba43,function(_0x2348d0){if(_0x2348d0[_0x8bc0('0x3f')]!==_0x8bc0('0x40')){var _0x2f9fc5={};_0x2f9fc5[_0x2348d0[_0x8bc0('0x29')]]={'$like':'%'+_0x5d2778[_0x8bc0('0x31')][_0x8bc0('0x3d')]+'%'};return _0x2f9fc5;}})});}_0x534bf6=_[_0x8bc0('0x3e')]({},_0x534bf6,_0x5d2778['options']);var _0x1b62d0={'where':_0x534bf6[_0x8bc0('0x3c')]};return db[_0x8bc0('0x2d')]['count'](_0x1b62d0)[_0x8bc0('0x23')](function(_0x29fd23){_0x46a69d['count']=_0x29fd23;if(_0x5d2778['query']['includeAll']){_0x534bf6[_0x8bc0('0x41')]=[{'all':!![]}];}return db[_0x8bc0('0x2d')][_0x8bc0('0x42')](_0x534bf6);})['then'](function(_0xeea591){_0x46a69d[_0x8bc0('0x43')]=_0xeea591;return _0x46a69d;})[_0x8bc0('0x23')](respondWithFilteredResult(_0x2b8ba0,_0x534bf6))[_0x8bc0('0x44')](handleError(_0x2b8ba0,null));};exports[_0x8bc0('0x45')]=function(_0x4fcd09,_0x322a5c){var _0x3ec3f1={'raw':!![],'where':{'id':_0x4fcd09[_0x8bc0('0x46')]['id']}},_0x5a2be7={};_0x5a2be7[_0x8bc0('0x30')]=_[_0x8bc0('0x32')](db[_0x8bc0('0x2d')]['rawAttributes']);_0x5a2be7[_0x8bc0('0x31')]=_['keys'](_0x4fcd09[_0x8bc0('0x31')]);_0x5a2be7[_0x8bc0('0x33')]=_[_0x8bc0('0x34')](_0x5a2be7[_0x8bc0('0x30')],_0x5a2be7[_0x8bc0('0x31')]);_0x3ec3f1['attributes']=_['intersection'](_0x5a2be7[_0x8bc0('0x30')],qs[_0x8bc0('0x36')](_0x4fcd09[_0x8bc0('0x31')][_0x8bc0('0x36')]));_0x3ec3f1[_0x8bc0('0x35')]=_0x3ec3f1['attributes']['length']?_0x3ec3f1[_0x8bc0('0x35')]:_0x5a2be7[_0x8bc0('0x30')];if(_0x4fcd09[_0x8bc0('0x31')][_0x8bc0('0x47')]){_0x3ec3f1[_0x8bc0('0x41')]=[{'all':!![]}];}_0x3ec3f1=_[_0x8bc0('0x3e')]({},_0x3ec3f1,_0x4fcd09['options']);return db[_0x8bc0('0x2d')][_0x8bc0('0x48')](_0x3ec3f1)[_0x8bc0('0x23')](handleEntityNotFound(_0x322a5c,null))[_0x8bc0('0x23')](respondWithResult(_0x322a5c,null))['catch'](handleError(_0x322a5c,null));};exports[_0x8bc0('0x49')]=function(_0x1f4b4c,_0x29bef5){return db[_0x8bc0('0x2d')]['create'](_0x1f4b4c['body'],{})[_0x8bc0('0x23')](function(_0x3e4f88){var _0x1f1b5b=_0x1f4b4c['user'][_0x8bc0('0x4a')]({'plain':!![]});if(!_0x1f1b5b)throw new Error(_0x8bc0('0x4b'));if(_0x1f1b5b['role']===_0x8bc0('0x4c')){var _0x5d7fdf=_0x3e4f88[_0x8bc0('0x4a')]({'plain':!![]});var _0x450391='ExtractedReports';return db[_0x8bc0('0x4d')][_0x8bc0('0x48')]({'where':{'name':_0x450391,'userProfileId':_0x1f1b5b[_0x8bc0('0x4e')]},'raw':!![]})[_0x8bc0('0x23')](function(_0x572343){if(_0x572343&&_0x572343['autoAssociation']===0x0){return db[_0x8bc0('0x26')]['create']({'name':_0x5d7fdf['name'],'resourceId':_0x5d7fdf['id'],'type':_0x572343['name'],'sectionId':_0x572343['id']},{})[_0x8bc0('0x23')](function(){return _0x3e4f88;});}else{return _0x3e4f88;}})[_0x8bc0('0x44')](function(_0x23a419){logger[_0x8bc0('0x27')](_0x8bc0('0x4f'),_0x23a419);throw _0x23a419;});}return _0x3e4f88;})[_0x8bc0('0x23')](respondWithResult(_0x29bef5,0xc9))[_0x8bc0('0x44')](handleError(_0x29bef5,null));};exports[_0x8bc0('0x50')]=function(_0x4588f6,_0x2671f3){if(_0x4588f6['body']['id']){delete _0x4588f6['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4588f6['params']['id']}})[_0x8bc0('0x23')](handleEntityNotFound(_0x2671f3,null))[_0x8bc0('0x23')](saveUpdates(_0x4588f6['body'],null))[_0x8bc0('0x23')](respondWithResult(_0x2671f3,null))['catch'](handleError(_0x2671f3,null));};exports[_0x8bc0('0x24')]=function(_0x348750,_0x2e7ab5){return db[_0x8bc0('0x2d')][_0x8bc0('0x48')]({'where':{'id':_0x348750['params']['id']}})['then'](handleEntityNotFound(_0x2e7ab5,null))[_0x8bc0('0x23')](removeEntity(_0x2e7ab5,null))['catch'](handleError(_0x2e7ab5,null));};exports[_0x8bc0('0x51')]=function(_0x1b098a,_0x5408d8,_0x153978){return db['AnalyticExtractedReport'][_0x8bc0('0x48')]({'where':{'id':_0x1b098a[_0x8bc0('0x46')]['id']},'attributes':[_0x8bc0('0x29'),_0x8bc0('0x52'),_0x8bc0('0x53'),_0x8bc0('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x5408d8,null))[_0x8bc0('0x23')](function(_0x9eb889){if(_0x9eb889){if(!fs['existsSync'](path[_0x8bc0('0x55')](config[_0x8bc0('0x56')],_0x8bc0('0x57'),_0x9eb889[_0x8bc0('0x53')]))){throw new db['Sequelize'][(_0x8bc0('0x58'))](_0x8bc0('0x59'));}if(_0x1b098a[_0x8bc0('0x31')]['exists']){return _0x5408d8[_0x8bc0('0x5a')](0xc8);}return _0x5408d8[_0x8bc0('0x51')](path[_0x8bc0('0x55')](config['root'],'server/files/reports',_0x9eb889[_0x8bc0('0x53')]),util['format']('%s.%s',_0x9eb889[_0x8bc0('0x52')]||_0x9eb889[_0x8bc0('0x29')],_0x9eb889[_0x8bc0('0x54')][_0x8bc0('0x5b')]()));}})[_0x8bc0('0x44')](handleError(_0x5408d8,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 8b9eca2..c1487e5 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 _0x8785=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x8785,0x1ed));var _0x5878=function(_0x2c9cf1,_0x1cf0f1){_0x2c9cf1=_0x2c9cf1-0x0;var _0x133ef4=_0x8785[_0x2c9cf1];return _0x133ef4;};'use strict';var _=require(_0x5878('0x0'));var util=require(_0x5878('0x1'));var logger=require(_0x5878('0x2'))('api');var moment=require(_0x5878('0x3'));var BPromise=require(_0x5878('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5878('0x5'));var rimraf=require(_0x5878('0x6'));var config=require(_0x5878('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x5878('0x8')]=function(_0x38e90a,_0x3d85f5){return _0x38e90a[_0x5878('0x9')](_0x5878('0xa'),attributes,{'tableName':_0x5878('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0e1=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb0e1,0xd5));var _0x1b0e=function(_0x5e7ea3,_0x3b4870){_0x5e7ea3=_0x5e7ea3-0x0;var _0x2daabe=_0xb0e1[_0x5e7ea3];return _0x2daabe;};'use strict';var _=require(_0x1b0e('0x0'));var util=require(_0x1b0e('0x1'));var logger=require('../../config/logger')(_0x1b0e('0x2'));var moment=require(_0x1b0e('0x3'));var BPromise=require(_0x1b0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b0e('0x5'));var attributes=require(_0x1b0e('0x6'));module[_0x1b0e('0x7')]=function(_0x40b7e8,_0x2e52fb){return _0x40b7e8[_0x1b0e('0x8')](_0x1b0e('0x9'),attributes,{'tableName':_0x1b0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 078d7b1..6e226dc 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 _0x4c35=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x4c35,0xd9));var _0x54c3=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x4c35[_0x342700];return _0x53406f;};'use strict';var _=require(_0x54c3('0x0'));var util=require('util');var moment=require(_0x54c3('0x1'));var BPromise=require(_0x54c3('0x2'));var rs=require(_0x54c3('0x3'));var fs=require('fs');var Redis=require(_0x54c3('0x4'));var db=require(_0x54c3('0x5'))['db'];var utils=require(_0x54c3('0x6'));var logger=require(_0x54c3('0x7'))('rpc');var config=require(_0x54c3('0x8'));var jayson=require(_0x54c3('0x9'));var client=jayson[_0x54c3('0xa')][_0x54c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc7cf,_0x5bfa2a,_0x2707c4){return new BPromise(function(_0x3488e9,_0x1c951f){return client['request'](_0x3bc7cf,_0x2707c4)[_0x54c3('0xc')](function(_0x13be2c){logger[_0x54c3('0xd')](_0x54c3('0xe'),_0x5bfa2a,_0x54c3('0xf'));logger[_0x54c3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'),JSON[_0x54c3('0x11')](_0x13be2c));if(_0x13be2c['error']){if(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x13')]===0x1f4){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x1c951f(_0x13be2c[_0x54c3('0x12')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x13be2c['error'][_0x54c3('0x14')]);return _0x3488e9(_0x13be2c[_0x54c3('0x12')][_0x54c3('0x14')]);}else{logger[_0x54c3('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa2a,_0x54c3('0xf'));_0x3488e9(_0x13be2c[_0x54c3('0x15')][_0x54c3('0x14')]);}})[_0x54c3('0x16')](function(_0x2472d3){logger[_0x54c3('0x12')](_0x54c3('0xe'),_0x5bfa2a,_0x2472d3);_0x1c951f(_0x2472d3);});});} \ No newline at end of file +var _0x13e3=['error','message','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x13e3,0x6e));var _0x313e=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x13e3[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x313e('0x0'));var BPromise=require(_0x313e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x313e('0x2'));var db=require(_0x313e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x313e('0x4'))('rpc');var config=require(_0x313e('0x5'));var jayson=require(_0x313e('0x6'));var client=jayson[_0x313e('0x7')][_0x313e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x113baf,_0x488c20,_0x29519d){return new BPromise(function(_0x159eaf,_0x52e29b){return client['request'](_0x113baf,_0x29519d)['then'](function(_0x1d2da5){logger[_0x313e('0x9')](_0x313e('0xa'),_0x488c20,_0x313e('0xb'));logger[_0x313e('0xc')](_0x313e('0xd'),_0x488c20,_0x313e('0xb'),JSON[_0x313e('0xe')](_0x1d2da5));if(_0x1d2da5['error']){if(_0x1d2da5['error'][_0x313e('0xf')]===0x1f4){logger[_0x313e('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x488c20,_0x1d2da5[_0x313e('0x10')]['message']);return _0x52e29b(_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);}logger[_0x313e('0x10')](_0x313e('0xa'),_0x488c20,_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);return _0x159eaf(_0x1d2da5[_0x313e('0x10')][_0x313e('0x11')]);}else{logger[_0x313e('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x488c20,_0x313e('0xb'));_0x159eaf(_0x1d2da5['result'][_0x313e('0x11')]);}})['catch'](function(_0x28ac07){logger['error'](_0x313e('0xa'),_0x488c20,_0x28ac07);_0x52e29b(_0x28ac07);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ce40ca0..73ee5e2 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 _0xef56=['isAuthenticated','index','/:id','/:id/download','download','post','create','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xef56,0xce));var _0x6ef5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xef56[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x6ef5('0x0'));var util=require(_0x6ef5('0x1'));var path=require(_0x6ef5('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ef5('0x3'));var router=express[_0x6ef5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ef5('0x5'));var interaction=require(_0x6ef5('0x6'));var config=require(_0x6ef5('0x7'));var controller=require(_0x6ef5('0x8'));router[_0x6ef5('0x9')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0xb')]);router[_0x6ef5('0x9')](_0x6ef5('0xc'),auth[_0x6ef5('0xa')](),controller['show']);router['get'](_0x6ef5('0xd'),auth['isAuthenticated'](),controller[_0x6ef5('0xe')]);router[_0x6ef5('0xf')]('/',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x10')]);router['put']('/:id',auth[_0x6ef5('0xa')](),controller[_0x6ef5('0x11')]);router['delete']('/:id',auth[_0x6ef5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x20f4=['../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','download','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x404dea,_0x49844e){var _0x4d076e=function(_0x234d54){while(--_0x234d54){_0x404dea['push'](_0x404dea['shift']());}};_0x4d076e(++_0x49844e);}(_0x20f4,0x1c4));var _0x420f=function(_0x25e782,_0x55d2dd){_0x25e782=_0x25e782-0x0;var _0x10871f=_0x20f4[_0x25e782];return _0x10871f;};'use strict';var multer=require(_0x420f('0x0'));var util=require(_0x420f('0x1'));var path=require(_0x420f('0x2'));var timeout=require('connect-timeout');var express=require(_0x420f('0x3'));var router=express[_0x420f('0x4')]();var fs_extra=require(_0x420f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x420f('0x6'));var config=require(_0x420f('0x7'));var controller=require(_0x420f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x420f('0x9')](_0x420f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x420f('0x9')]('/:id/download',auth[_0x420f('0xb')](),controller[_0x420f('0xc')]);router['post']('/',auth[_0x420f('0xb')](),controller['create']);router[_0x420f('0xd')](_0x420f('0xa'),auth[_0x420f('0xb')](),controller[_0x420f('0xe')]);router[_0x420f('0xf')](_0x420f('0xa'),auth[_0x420f('0xb')](),controller[_0x420f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 502ac94..e136b78 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 _0xe4eb=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12a890,_0x4f3cb5){var _0x1a79ef=function(_0x5723f4){while(--_0x5723f4){_0x12a890['push'](_0x12a890['shift']());}};_0x1a79ef(++_0x4f3cb5);}(_0xe4eb,0x67));var _0xbe4e=function(_0x3a4c87,_0x3068ff){_0x3a4c87=_0x3a4c87-0x0;var _0x5ef79c=_0xe4eb[_0x3a4c87];return _0x5ef79c;};'use strict';var Sequelize=require(_0xbe4e('0x0'));module[_0xbe4e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xbe4e('0x2')]},'function':{'type':Sequelize[_0xbe4e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe4e('0x2')]},'custom':{'type':Sequelize[_0xbe4e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x57e7=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2161d8,_0x14e2d2){var _0x3acfb8=function(_0x5095fd){while(--_0x5095fd){_0x2161d8['push'](_0x2161d8['shift']());}};_0x3acfb8(++_0x14e2d2);}(_0x57e7,0x1c4));var _0x757e=function(_0x13f6fc,_0x54fabe){_0x13f6fc=_0x13f6fc-0x0;var _0x4f82ab=_0x57e7[_0x13f6fc];return _0x4f82ab;};'use strict';var Sequelize=require(_0x757e('0x0'));module[_0x757e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x757e('0x2')]},'function':{'type':Sequelize[_0x757e('0x2')]},'format':{'type':Sequelize[_0x757e('0x2')]},'groupBy':{'type':Sequelize[_0x757e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x757e('0x2')]},'custom':{'type':Sequelize[_0x757e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 7e37868..2f7661e 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 _0xa0e9=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','map','type','options','AnalyticFieldReport','findAll','catch','show','includeAll','body','bulkCreate','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes'];(function(_0x26dbc0,_0xf2424f){var _0x2a8e66=function(_0x1526d4){while(--_0x1526d4){_0x26dbc0['push'](_0x26dbc0['shift']());}};_0x2a8e66(++_0xf2424f);}(_0xa0e9,0x1eb));var _0x9a0e=function(_0x497274,_0x274702){_0x497274=_0x497274-0x0;var _0x1eb43c=_0xa0e9[_0x497274];return _0x1eb43c;};'use strict';var emlformat=require(_0x9a0e('0x0'));var rimraf=require(_0x9a0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a0e('0x2'));var moment=require(_0x9a0e('0x3'));var BPromise=require(_0x9a0e('0x4'));var Mustache=require(_0x9a0e('0x5'));var util=require(_0x9a0e('0x6'));var path=require(_0x9a0e('0x7'));var sox=require('sox');var csv=require(_0x9a0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a0e('0x9'));var _=require('lodash');var squel=require(_0x9a0e('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a0e('0xb'));var deskjs=require(_0x9a0e('0xc'));var toCsv=require(_0x9a0e('0x8'));var querystring=require('querystring');var Papa=require(_0x9a0e('0xd'));var Redis=require(_0x9a0e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a0e('0xf'));var hardwareService=require(_0x9a0e('0x10'));var logger=require(_0x9a0e('0x11'))(_0x9a0e('0x12'));var utils=require(_0x9a0e('0x13'));var config=require(_0x9a0e('0x14'));var licenseUtil=require(_0x9a0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203dec,_0x41d64d){_0x41d64d=_0x41d64d||0xcc;return function(_0x315f68){if(_0x315f68){return _0x203dec['sendStatus'](_0x41d64d);}return _0x203dec['status'](_0x41d64d)[_0x9a0e('0x16')]();};}function respondWithResult(_0x1b6132,_0x151fbb){_0x151fbb=_0x151fbb||0xc8;return function(_0x2a869){if(_0x2a869){return _0x1b6132[_0x9a0e('0x17')](_0x151fbb)[_0x9a0e('0x18')](_0x2a869);}};}function respondWithFilteredResult(_0x5a25ff,_0x1392e4){return function(_0x329c86){if(_0x329c86){var _0x238741=typeof _0x1392e4[_0x9a0e('0x19')]===_0x9a0e('0x1a')&&typeof _0x1392e4['limit']==='undefined';var _0x311cf4=_0x329c86[_0x9a0e('0x1b')];var _0x5007c4=_0x238741?0x0:_0x1392e4['offset'];var _0x41aa1c=_0x238741?_0x329c86[_0x9a0e('0x1b')]:_0x1392e4[_0x9a0e('0x19')]+_0x1392e4['limit'];var _0xc6d3f6;if(_0x41aa1c>=_0x311cf4){_0x41aa1c=_0x311cf4;_0xc6d3f6=0xc8;}else{_0xc6d3f6=0xce;}_0x5a25ff['status'](_0xc6d3f6);return _0x5a25ff[_0x9a0e('0x1c')](_0x9a0e('0x1d'),_0x5007c4+'-'+_0x41aa1c+'/'+_0x311cf4)[_0x9a0e('0x18')](_0x329c86);}return null;};}function patchUpdates(_0xf6d33){return function(_0x47f6c6){try{jsonpatch['apply'](_0x47f6c6,_0xf6d33,!![]);}catch(_0x3bc6d1){return BPromise['reject'](_0x3bc6d1);}return _0x47f6c6[_0x9a0e('0x1e')]();};}function saveUpdates(_0x28bcb4,_0x282b6){return function(_0x1cdac5){if(_0x1cdac5){return _0x1cdac5[_0x9a0e('0x1f')](_0x28bcb4)['then'](function(_0x1fd478){return _0x1fd478;});}return null;};}function removeEntity(_0x190ed2,_0x4fda96){return function(_0x599e81){if(_0x599e81){return _0x599e81[_0x9a0e('0x20')]()[_0x9a0e('0x21')](function(){_0x190ed2[_0x9a0e('0x17')](0xcc)[_0x9a0e('0x16')]();});}};}function handleEntityNotFound(_0x207aa6,_0x2a000d){return function(_0x1466df){if(!_0x1466df){_0x207aa6[_0x9a0e('0x22')](0x194);}return _0x1466df;};}function handleError(_0x1e1383,_0x5ad194){_0x5ad194=_0x5ad194||0x1f4;return function(_0x36630c){logger[_0x9a0e('0x23')](_0x36630c[_0x9a0e('0x24')]);if(_0x36630c[_0x9a0e('0x25')]){delete _0x36630c[_0x9a0e('0x25')];}_0x1e1383[_0x9a0e('0x17')](_0x5ad194)[_0x9a0e('0x26')](_0x36630c);};}exports[_0x9a0e('0x27')]=function(_0xcbbe7b,_0x2c873){var _0x1af0db={},_0x32340a={},_0x27b1c1={'count':0x0,'rows':[]};var _0x4a31d0=_['map'](db['AnalyticFieldReport'][_0x9a0e('0x28')],function(_0x373a3b){return{'name':_0x373a3b[_0x9a0e('0x29')],'type':_0x373a3b['type'][_0x9a0e('0x2a')]};});_0x32340a[_0x9a0e('0x2b')]=_['map'](_0x4a31d0,_0x9a0e('0x25'));_0x32340a[_0x9a0e('0x2c')]=_[_0x9a0e('0x2d')](_0xcbbe7b[_0x9a0e('0x2c')]);_0x32340a[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x32340a['model'],_0x32340a['query']);_0x1af0db[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x32340a[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0xcbbe7b['query'][_0x9a0e('0x31')]));_0x1af0db[_0x9a0e('0x30')]=_0x1af0db[_0x9a0e('0x30')][_0x9a0e('0x32')]?_0x1af0db['attributes']:_0x32340a[_0x9a0e('0x2b')];if(!_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x33')]('nolimit')){_0x1af0db['limit']=qs[_0x9a0e('0x34')](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x34')]);_0x1af0db[_0x9a0e('0x19')]=qs['offset'](_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x19')]);}_0x1af0db['order']=qs[_0x9a0e('0x35')](_0xcbbe7b['query']['sort']);_0x1af0db[_0x9a0e('0x36')]=qs[_0x9a0e('0x2e')](_['pick'](_0xcbbe7b[_0x9a0e('0x2c')],_0x32340a[_0x9a0e('0x2e')]),_0x4a31d0);if(_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]){_0x1af0db[_0x9a0e('0x36')]=_[_0x9a0e('0x38')](_0x1af0db['where'],{'$or':_[_0x9a0e('0x39')](_0x4a31d0,function(_0x59163f){if(_0x59163f[_0x9a0e('0x3a')]!=='VIRTUAL'){var _0x38beea={};_0x38beea[_0x59163f[_0x9a0e('0x25')]]={'$like':'%'+_0xcbbe7b[_0x9a0e('0x2c')][_0x9a0e('0x37')]+'%'};return _0x38beea;}})});}_0x1af0db=_[_0x9a0e('0x38')]({},_0x1af0db,_0xcbbe7b[_0x9a0e('0x3b')]);var _0xbae5e9={'where':_0x1af0db[_0x9a0e('0x36')]};return db['AnalyticFieldReport'][_0x9a0e('0x1b')](_0xbae5e9)[_0x9a0e('0x21')](function(_0x470be2){_0x27b1c1[_0x9a0e('0x1b')]=_0x470be2;if(_0xcbbe7b['query']['includeAll']){_0x1af0db['include']=[{'all':!![]}];}return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')](_0x1af0db);})['then'](function(_0x2e6b88){_0x27b1c1['rows']=_0x2e6b88;return _0x27b1c1;})[_0x9a0e('0x21')](respondWithFilteredResult(_0x2c873,_0x1af0db))[_0x9a0e('0x3e')](handleError(_0x2c873,null));};exports[_0x9a0e('0x3f')]=function(_0x3094ae,_0x1258e4){var _0x291ae7={'raw':![],'where':{'id':_0x3094ae['params']['id']}},_0x279b25={};_0x279b25[_0x9a0e('0x2b')]=_['keys'](db[_0x9a0e('0x3c')][_0x9a0e('0x28')]);_0x279b25['query']=_[_0x9a0e('0x2d')](_0x3094ae[_0x9a0e('0x2c')]);_0x279b25[_0x9a0e('0x2e')]=_[_0x9a0e('0x2f')](_0x279b25['model'],_0x279b25[_0x9a0e('0x2c')]);_0x291ae7[_0x9a0e('0x30')]=_[_0x9a0e('0x2f')](_0x279b25[_0x9a0e('0x2b')],qs[_0x9a0e('0x31')](_0x3094ae['query'][_0x9a0e('0x31')]));_0x291ae7[_0x9a0e('0x30')]=_0x291ae7[_0x9a0e('0x30')]['length']?_0x291ae7[_0x9a0e('0x30')]:_0x279b25['model'];if(_0x3094ae[_0x9a0e('0x2c')][_0x9a0e('0x40')]){_0x291ae7['include']=[{'all':!![]}];}_0x291ae7=_[_0x9a0e('0x38')]({},_0x291ae7,_0x3094ae[_0x9a0e('0x3b')]);return db[_0x9a0e('0x3c')]['find'](_0x291ae7)['then'](handleEntityNotFound(_0x1258e4,null))[_0x9a0e('0x21')](respondWithResult(_0x1258e4,null))[_0x9a0e('0x3e')](handleError(_0x1258e4,null));};exports['create']=function(_0x59da81,_0x39e97f){return db[_0x9a0e('0x3c')]['create'](_0x59da81[_0x9a0e('0x41')],{})[_0x9a0e('0x21')](respondWithResult(_0x39e97f,0xc9))[_0x9a0e('0x3e')](handleError(_0x39e97f,null));};exports[_0x9a0e('0x42')]=function(_0x3285f2,_0x2bf8c5){return db['AnalyticFieldReport'][_0x9a0e('0x42')](_0x3285f2['body'],{'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0x2bf8c5,0xc9))[_0x9a0e('0x3e')](handleError(_0x2bf8c5,null));};exports[_0x9a0e('0x1f')]=function(_0x2a2e51,_0x3d4edf){if(_0x2a2e51['body']['id']){delete _0x2a2e51[_0x9a0e('0x41')]['id'];}return db[_0x9a0e('0x3c')]['find']({'where':{'id':_0x2a2e51['params']['id']}})['then'](handleEntityNotFound(_0x3d4edf,null))['then'](saveUpdates(_0x2a2e51['body'],null))[_0x9a0e('0x21')](respondWithResult(_0x3d4edf,null))[_0x9a0e('0x3e')](handleError(_0x3d4edf,null));};exports[_0x9a0e('0x20')]=function(_0x2d6a32,_0x86d605){return db['AnalyticFieldReport'][_0x9a0e('0x43')]({'where':{'id':_0x2d6a32[_0x9a0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x86d605,null))[_0x9a0e('0x21')](removeEntity(_0x86d605,null))[_0x9a0e('0x3e')](handleError(_0x86d605,null));};exports[_0x9a0e('0x45')]=function(_0x4659bb,_0xc141f3){return db['AnalyticFieldReport'][_0x9a0e('0x20')]({'where':{'id':_0x4659bb['query'][_0x9a0e('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9a0e('0x21')](respondWithResult(_0xc141f3,0xcc))[_0x9a0e('0x3e')](handleError(_0xc141f3,null));};exports[_0x9a0e('0x47')]=function(_0x23c737,_0x11ef9c,_0x17b2dc){return db[_0x9a0e('0x48')][_0x9a0e('0x49')]({'where':{'id':_0x23c737['params']['id']}})['then'](handleEntityNotFound(_0x11ef9c,null))[_0x9a0e('0x21')](function(_0x2c0073){if(_0x2c0073){return db['sequelize'][_0x9a0e('0x4a')](function(_0x18bd21){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x23c737[_0x9a0e('0x44')]['id']},'transaction':_0x18bd21})[_0x9a0e('0x21')](function(_0x1ef7db){var _0xa2a549=_['map'](_0x23c737['body'],function(_0x466654){delete _0x466654['id'];_0x466654[_0x9a0e('0x4b')]=_0x23c737[_0x9a0e('0x44')]['id'];return _0x466654;});return db[_0x9a0e('0x3c')][_0x9a0e('0x42')](_0xa2a549,{'transaction':_0x18bd21});});})['then'](function(){return db[_0x9a0e('0x3c')][_0x9a0e('0x3d')]({'where':{'CustomReportId':_0x23c737['params']['id']}});});}})[_0x9a0e('0x21')](respondWithResult(_0x11ef9c,null))[_0x9a0e('0x3e')](handleError(_0x11ef9c,null));}; \ No newline at end of file +var _0xab3d=['offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','find','body','bulkCreate','params','ids','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0xab3d,0x82));var _0xdab3=function(_0x3a64d0,_0x5cfabd){_0x3a64d0=_0x3a64d0-0x0;var _0x4e69f3=_0xab3d[_0x3a64d0];return _0x4e69f3;};'use strict';var emlformat=require(_0xdab3('0x0'));var rimraf=require(_0xdab3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdab3('0x2'));var rp=require(_0xdab3('0x3'));var moment=require(_0xdab3('0x4'));var BPromise=require(_0xdab3('0x5'));var Mustache=require(_0xdab3('0x6'));var util=require(_0xdab3('0x7'));var path=require(_0xdab3('0x8'));var sox=require(_0xdab3('0x9'));var csv=require(_0xdab3('0xa'));var ejs=require(_0xdab3('0xb'));var fs=require('fs');var fs_extra=require(_0xdab3('0xc'));var _=require('lodash');var squel=require(_0xdab3('0xd'));var crypto=require(_0xdab3('0xe'));var jsforce=require(_0xdab3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdab3('0xa'));var querystring=require(_0xdab3('0x10'));var Papa=require(_0xdab3('0x11'));var Redis=require(_0xdab3('0x12'));var authService=require(_0xdab3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdab3('0x14'))(_0xdab3('0x15'));var utils=require(_0xdab3('0x16'));var config=require(_0xdab3('0x17'));var licenseUtil=require(_0xdab3('0x18'));var db=require(_0xdab3('0x19'))['db'];function respondWithStatusCode(_0x4632e0,_0x2bfaa7){_0x2bfaa7=_0x2bfaa7||0xcc;return function(_0xd20c28){if(_0xd20c28){return _0x4632e0[_0xdab3('0x1a')](_0x2bfaa7);}return _0x4632e0['status'](_0x2bfaa7)['end']();};}function respondWithResult(_0x214871,_0x358e6d){_0x358e6d=_0x358e6d||0xc8;return function(_0x5f424e){if(_0x5f424e){return _0x214871[_0xdab3('0x1b')](_0x358e6d)['json'](_0x5f424e);}};}function respondWithFilteredResult(_0x3a5230,_0x1b6f32){return function(_0x444ded){if(_0x444ded){var _0x1d030a=typeof _0x1b6f32['offset']==='undefined'&&typeof _0x1b6f32[_0xdab3('0x1c')]==='undefined';var _0x26be72=_0x444ded['count'];var _0x49d2c6=_0x1d030a?0x0:_0x1b6f32['offset'];var _0x124f58=_0x1d030a?_0x444ded[_0xdab3('0x1d')]:_0x1b6f32[_0xdab3('0x1e')]+_0x1b6f32['limit'];var _0x15d205;if(_0x124f58>=_0x26be72){_0x124f58=_0x26be72;_0x15d205=0xc8;}else{_0x15d205=0xce;}_0x3a5230[_0xdab3('0x1b')](_0x15d205);return _0x3a5230['set'](_0xdab3('0x1f'),_0x49d2c6+'-'+_0x124f58+'/'+_0x26be72)['json'](_0x444ded);}return null;};}function patchUpdates(_0x535efa){return function(_0x3bef2d){try{jsonpatch['apply'](_0x3bef2d,_0x535efa,!![]);}catch(_0x45579e){return BPromise[_0xdab3('0x20')](_0x45579e);}return _0x3bef2d[_0xdab3('0x21')]();};}function saveUpdates(_0x1551fc,_0x3700be){return function(_0x531e31){if(_0x531e31){return _0x531e31[_0xdab3('0x22')](_0x1551fc)[_0xdab3('0x23')](function(_0x392d41){return _0x392d41;});}return null;};}function removeEntity(_0xd64d08,_0x43087e){return function(_0x4631be){if(_0x4631be){return _0x4631be[_0xdab3('0x24')]()[_0xdab3('0x23')](function(){_0xd64d08['status'](0xcc)[_0xdab3('0x25')]();});}};}function handleEntityNotFound(_0x3fad3a,_0x5de7ea){return function(_0x19ab8c){if(!_0x19ab8c){_0x3fad3a['sendStatus'](0x194);}return _0x19ab8c;};}function handleError(_0x5e3470,_0x558855){_0x558855=_0x558855||0x1f4;return function(_0x170759){logger[_0xdab3('0x26')](_0x170759[_0xdab3('0x27')]);if(_0x170759[_0xdab3('0x28')]){delete _0x170759[_0xdab3('0x28')];}_0x5e3470[_0xdab3('0x1b')](_0x558855)[_0xdab3('0x29')](_0x170759);};}exports[_0xdab3('0x2a')]=function(_0x24c664,_0x2916da){var _0x342dc2={},_0x9933cd={},_0x3cb761={'count':0x0,'rows':[]};var _0x4358df=_[_0xdab3('0x2b')](db[_0xdab3('0x2c')][_0xdab3('0x2d')],function(_0x20587e){return{'name':_0x20587e[_0xdab3('0x2e')],'type':_0x20587e['type']['key']};});_0x9933cd['model']=_[_0xdab3('0x2b')](_0x4358df,_0xdab3('0x28'));_0x9933cd['query']=_[_0xdab3('0x2f')](_0x24c664[_0xdab3('0x30')]);_0x9933cd[_0xdab3('0x31')]=_[_0xdab3('0x32')](_0x9933cd['model'],_0x9933cd[_0xdab3('0x30')]);_0x342dc2[_0xdab3('0x33')]=_[_0xdab3('0x32')](_0x9933cd[_0xdab3('0x34')],qs[_0xdab3('0x35')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x35')]));_0x342dc2[_0xdab3('0x33')]=_0x342dc2[_0xdab3('0x33')][_0xdab3('0x36')]?_0x342dc2['attributes']:_0x9933cd[_0xdab3('0x34')];if(!_0x24c664[_0xdab3('0x30')][_0xdab3('0x37')]('nolimit')){_0x342dc2[_0xdab3('0x1c')]=qs[_0xdab3('0x1c')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x1c')]);_0x342dc2['offset']=qs[_0xdab3('0x1e')](_0x24c664[_0xdab3('0x30')][_0xdab3('0x1e')]);}_0x342dc2[_0xdab3('0x38')]=qs[_0xdab3('0x39')](_0x24c664[_0xdab3('0x30')]['sort']);_0x342dc2[_0xdab3('0x3a')]=qs[_0xdab3('0x31')](_[_0xdab3('0x3b')](_0x24c664[_0xdab3('0x30')],_0x9933cd[_0xdab3('0x31')]),_0x4358df);if(_0x24c664[_0xdab3('0x30')][_0xdab3('0x3c')]){_0x342dc2[_0xdab3('0x3a')]=_['merge'](_0x342dc2['where'],{'$or':_[_0xdab3('0x2b')](_0x4358df,function(_0x38afd6){if(_0x38afd6[_0xdab3('0x3d')]!=='VIRTUAL'){var _0x12e28a={};_0x12e28a[_0x38afd6['name']]={'$like':'%'+_0x24c664[_0xdab3('0x30')][_0xdab3('0x3c')]+'%'};return _0x12e28a;}})});}_0x342dc2=_[_0xdab3('0x3e')]({},_0x342dc2,_0x24c664[_0xdab3('0x3f')]);var _0x386b99={'where':_0x342dc2[_0xdab3('0x3a')]};return db[_0xdab3('0x2c')][_0xdab3('0x1d')](_0x386b99)[_0xdab3('0x23')](function(_0x7c646){_0x3cb761[_0xdab3('0x1d')]=_0x7c646;if(_0x24c664['query'][_0xdab3('0x40')]){_0x342dc2[_0xdab3('0x41')]=[{'all':!![]}];}return db[_0xdab3('0x2c')][_0xdab3('0x42')](_0x342dc2);})[_0xdab3('0x23')](function(_0x344c9d){_0x3cb761[_0xdab3('0x43')]=_0x344c9d;return _0x3cb761;})[_0xdab3('0x23')](respondWithFilteredResult(_0x2916da,_0x342dc2))[_0xdab3('0x44')](handleError(_0x2916da,null));};exports[_0xdab3('0x45')]=function(_0x2dc9b2,_0x34990f){var _0x25f02b={'raw':![],'where':{'id':_0x2dc9b2['params']['id']}},_0x3a59d0={};_0x3a59d0[_0xdab3('0x34')]=_['keys'](db[_0xdab3('0x2c')][_0xdab3('0x2d')]);_0x3a59d0[_0xdab3('0x30')]=_['keys'](_0x2dc9b2[_0xdab3('0x30')]);_0x3a59d0[_0xdab3('0x31')]=_['intersection'](_0x3a59d0['model'],_0x3a59d0[_0xdab3('0x30')]);_0x25f02b[_0xdab3('0x33')]=_[_0xdab3('0x32')](_0x3a59d0[_0xdab3('0x34')],qs[_0xdab3('0x35')](_0x2dc9b2[_0xdab3('0x30')][_0xdab3('0x35')]));_0x25f02b[_0xdab3('0x33')]=_0x25f02b['attributes'][_0xdab3('0x36')]?_0x25f02b[_0xdab3('0x33')]:_0x3a59d0['model'];if(_0x2dc9b2[_0xdab3('0x30')][_0xdab3('0x40')]){_0x25f02b[_0xdab3('0x41')]=[{'all':!![]}];}_0x25f02b=_[_0xdab3('0x3e')]({},_0x25f02b,_0x2dc9b2['options']);return db[_0xdab3('0x2c')][_0xdab3('0x46')](_0x25f02b)[_0xdab3('0x23')](handleEntityNotFound(_0x34990f,null))[_0xdab3('0x23')](respondWithResult(_0x34990f,null))[_0xdab3('0x44')](handleError(_0x34990f,null));};exports['create']=function(_0xd0204c,_0x40f520){return db[_0xdab3('0x2c')]['create'](_0xd0204c[_0xdab3('0x47')],{})[_0xdab3('0x23')](respondWithResult(_0x40f520,0xc9))[_0xdab3('0x44')](handleError(_0x40f520,null));};exports[_0xdab3('0x48')]=function(_0xd9b734,_0x4bfdc9){return db['AnalyticFieldReport'][_0xdab3('0x48')](_0xd9b734[_0xdab3('0x47')],{'raw':![],'individualHooks':!![]})[_0xdab3('0x23')](respondWithResult(_0x4bfdc9,0xc9))[_0xdab3('0x44')](handleError(_0x4bfdc9,null));};exports[_0xdab3('0x22')]=function(_0x2ddbc7,_0x4dd045){if(_0x2ddbc7[_0xdab3('0x47')]['id']){delete _0x2ddbc7[_0xdab3('0x47')]['id'];}return db[_0xdab3('0x2c')][_0xdab3('0x46')]({'where':{'id':_0x2ddbc7[_0xdab3('0x49')]['id']}})[_0xdab3('0x23')](handleEntityNotFound(_0x4dd045,null))['then'](saveUpdates(_0x2ddbc7[_0xdab3('0x47')],null))[_0xdab3('0x23')](respondWithResult(_0x4dd045,null))[_0xdab3('0x44')](handleError(_0x4dd045,null));};exports[_0xdab3('0x24')]=function(_0x19f8f3,_0x3f46cc){return db[_0xdab3('0x2c')][_0xdab3('0x46')]({'where':{'id':_0x19f8f3[_0xdab3('0x49')]['id']}})[_0xdab3('0x23')](handleEntityNotFound(_0x3f46cc,null))['then'](removeEntity(_0x3f46cc,null))['catch'](handleError(_0x3f46cc,null));};exports['bulkDestroy']=function(_0x4e248a,_0x51ec2b){return db['AnalyticFieldReport'][_0xdab3('0x24')]({'where':{'id':_0x4e248a[_0xdab3('0x30')][_0xdab3('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xdab3('0x23')](respondWithResult(_0x51ec2b,0xcc))[_0xdab3('0x44')](handleError(_0x51ec2b,null));};exports[_0xdab3('0x4b')]=function(_0x11e937,_0x1ed504,_0x17743a){return db['AnalyticCustomReport'][_0xdab3('0x4c')]({'where':{'id':_0x11e937[_0xdab3('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ed504,null))[_0xdab3('0x23')](function(_0x320131){if(_0x320131){return db[_0xdab3('0x4d')][_0xdab3('0x4e')](function(_0x46e47f){return db[_0xdab3('0x2c')][_0xdab3('0x24')]({'where':{'CustomReportId':_0x11e937['params']['id']},'transaction':_0x46e47f})[_0xdab3('0x23')](function(_0x43e6f3){var _0x5ed5e2=_[_0xdab3('0x2b')](_0x11e937[_0xdab3('0x47')],function(_0x570495){delete _0x570495['id'];_0x570495[_0xdab3('0x4f')]=_0x11e937['params']['id'];return _0x570495;});return db[_0xdab3('0x2c')][_0xdab3('0x48')](_0x5ed5e2,{'transaction':_0x46e47f});});})[_0xdab3('0x23')](function(){return db[_0xdab3('0x2c')]['findAll']({'where':{'CustomReportId':_0x11e937[_0xdab3('0x49')]['id']}});});}})[_0xdab3('0x23')](respondWithResult(_0x1ed504,null))[_0xdab3('0x44')](handleError(_0x1ed504,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index cd1bb38..702c353 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 _0x6a55=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6a55,0xeb));var _0x56a5=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x6a55[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0x56a5('0x0'));var util=require(_0x56a5('0x1'));var logger=require(_0x56a5('0x2'))(_0x56a5('0x3'));var moment=require(_0x56a5('0x4'));var BPromise=require(_0x56a5('0x5'));var rp=require(_0x56a5('0x6'));var fs=require('fs');var path=require(_0x56a5('0x7'));var rimraf=require('rimraf');var config=require(_0x56a5('0x8'));var attributes=require(_0x56a5('0x9'));module['exports']=function(_0x178644,_0x5a3bd2){return _0x178644[_0x56a5('0xa')](_0x56a5('0xb'),attributes,{'tableName':_0x56a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1033=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x1033,0x8e));var _0x3103=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1033[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x3103('0x0'));var util=require('util');var logger=require(_0x3103('0x1'))(_0x3103('0x2'));var moment=require(_0x3103('0x3'));var BPromise=require(_0x3103('0x4'));var rp=require(_0x3103('0x5'));var fs=require('fs');var path=require(_0x3103('0x6'));var rimraf=require(_0x3103('0x7'));var config=require(_0x3103('0x8'));var attributes=require(_0x3103('0x9'));module['exports']=function(_0x2fe282,_0x201561){return _0x2fe282[_0x3103('0xa')](_0x3103('0xb'),attributes,{'tableName':_0x3103('0xc'),'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 8996da5..42aa0cb 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 _0x3fc4=['error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xdcde19,_0x224474){var _0x44200c=function(_0x39b31c){while(--_0x39b31c){_0xdcde19['push'](_0xdcde19['shift']());}};_0x44200c(++_0x224474);}(_0x3fc4,0x125));var _0x43fc=function(_0x5c66d2,_0x5f220f){_0x5c66d2=_0x5c66d2-0x0;var _0x8ed5e3=_0x3fc4[_0x5c66d2];return _0x8ed5e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x43fc('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43fc('0x1'));var db=require(_0x43fc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fc('0x3'))('rpc');var config=require(_0x43fc('0x4'));var jayson=require(_0x43fc('0x5'));var client=jayson[_0x43fc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe30928,_0x1be3dc,_0xdc6037){return new BPromise(function(_0x44be1f,_0x5137ea){return client[_0x43fc('0x7')](_0xe30928,_0xdc6037)[_0x43fc('0x8')](function(_0x36f347){logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1be3dc,_0x43fc('0xb'),JSON[_0x43fc('0xc')](_0x36f347));if(_0x36f347[_0x43fc('0xd')]){if(_0x36f347[_0x43fc('0xd')][_0x43fc('0xe')]===0x1f4){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x5137ea(_0x36f347['error']['message']);}logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x36f347[_0x43fc('0xd')][_0x43fc('0xf')]);return _0x44be1f(_0x36f347['error']['message']);}else{logger[_0x43fc('0x9')](_0x43fc('0xa'),_0x1be3dc,_0x43fc('0xb'));_0x44be1f(_0x36f347[_0x43fc('0x10')][_0x43fc('0xf')]);}})['catch'](function(_0x2fa605){logger[_0x43fc('0xd')](_0x43fc('0xa'),_0x1be3dc,_0x2fa605);_0x5137ea(_0x2fa605);});});} \ No newline at end of file +var _0x02d6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x55b307,_0x4c5319){var _0x1b5114=function(_0x4424e0){while(--_0x4424e0){_0x55b307['push'](_0x55b307['shift']());}};_0x1b5114(++_0x4c5319);}(_0x02d6,0x1ce));var _0x602d=function(_0x1d2c3a,_0x249200){_0x1d2c3a=_0x1d2c3a-0x0;var _0x3b5128=_0x02d6[_0x1d2c3a];return _0x3b5128;};'use strict';var _=require(_0x602d('0x0'));var util=require(_0x602d('0x1'));var moment=require(_0x602d('0x2'));var BPromise=require(_0x602d('0x3'));var rs=require(_0x602d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x602d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x602d('0x6'))(_0x602d('0x7'));var config=require(_0x602d('0x8'));var jayson=require(_0x602d('0x9'));var client=jayson['client'][_0x602d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe431,_0x4f5157,_0x524f99){return new BPromise(function(_0x1822cc,_0x43e21b){return client[_0x602d('0xb')](_0x2fe431,_0x524f99)[_0x602d('0xc')](function(_0x3daef2){logger[_0x602d('0xd')](_0x602d('0xe'),_0x4f5157,_0x602d('0xf'));logger[_0x602d('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4f5157,_0x602d('0xf'),JSON[_0x602d('0x11')](_0x3daef2));if(_0x3daef2['error']){if(_0x3daef2[_0x602d('0x12')]['code']===0x1f4){logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);return _0x43e21b(_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);}logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);return _0x1822cc(_0x3daef2[_0x602d('0x12')][_0x602d('0x13')]);}else{logger[_0x602d('0xd')](_0x602d('0xe'),_0x4f5157,_0x602d('0xf'));_0x1822cc(_0x3daef2[_0x602d('0x14')][_0x602d('0x13')]);}})['catch'](function(_0x9ce7a){logger[_0x602d('0x12')](_0x602d('0xe'),_0x4f5157,_0x9ce7a);_0x43e21b(_0x9ce7a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0c5ef49..5c051e4 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(_0x135c0b,_0x4a8182){var _0x3ff6be=function(_0x43ee7f){while(--_0x43ee7f){_0x135c0b['push'](_0x135c0b['shift']());}};_0x3ff6be(++_0x4a8182);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x4d3d19,_0x35edd6){var _0x14ba6c=function(_0x7ed61f){while(--_0x7ed61f){_0x4d3d19['push'](_0x4d3d19['shift']());}};_0x14ba6c(++_0x35edd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 a59cae4..29b8089 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 _0x0901=['STRING','name','TEXT','sequelize','exports'];(function(_0x332339,_0x3a98e1){var _0x2d78e9=function(_0x574ea5){while(--_0x574ea5){_0x332339['push'](_0x332339['shift']());}};_0x2d78e9(++_0x3a98e1);}(_0x0901,0x134));var _0x1090=function(_0x36d65a,_0x2f23e9){_0x36d65a=_0x36d65a-0x0;var _0x859c46=_0x0901[_0x36d65a];return _0x859c46;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'name':{'type':Sequelize[_0x1090('0x2')],'allowNull':![],'unique':_0x1090('0x3')},'table':{'type':Sequelize[_0x1090('0x2')]},'metric':{'type':Sequelize[_0x1090('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5b02=['name','sequelize','exports','STRING'];(function(_0x588d09,_0x1b4518){var _0x37b806=function(_0x573eaf){while(--_0x573eaf){_0x588d09['push'](_0x588d09['shift']());}};_0x37b806(++_0x1b4518);}(_0x5b02,0xe9));var _0x25b0=function(_0x5ec26d,_0x46d3e1){_0x5ec26d=_0x5ec26d-0x0;var _0x43a53c=_0x5b02[_0x5ec26d];return _0x43a53c;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'name':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![],'unique':_0x25b0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x25b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 91d53e5..f0c5408 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x18001b,_0x482b75){_0x18001b=_0x18001b-0x0;var _0x16f3f3=_0x1cb9[_0x18001b];return _0x16f3f3;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x7da7,0x10d));var _0x77da=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x7da7[_0x296754];return _0x1d9f1d;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 399f34c..33744ee 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 _0xd8a5=['analytics_metrics','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x3b80e7,_0x8f4796){var _0x2fdca1=function(_0x446920){while(--_0x446920){_0x3b80e7['push'](_0x3b80e7['shift']());}};_0x2fdca1(++_0x8f4796);}(_0xd8a5,0x160));var _0x5d8a=function(_0x4b187b,_0x431650){_0x4b187b=_0x4b187b-0x0;var _0x321553=_0xd8a5[_0x4b187b];return _0x321553;};'use strict';var _=require(_0x5d8a('0x0'));var util=require('util');var logger=require(_0x5d8a('0x1'))(_0x5d8a('0x2'));var moment=require('moment');var BPromise=require(_0x5d8a('0x3'));var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require(_0x5d8a('0x5'));var rimraf=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var attributes=require(_0x5d8a('0x8'));module[_0x5d8a('0x9')]=function(_0x38eaa5,_0x1ef405){return _0x38eaa5[_0x5d8a('0xa')](_0x5d8a('0xb'),attributes,{'tableName':_0x5d8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2bc=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x26bddd,_0x150143){var _0x179b2d=function(_0x2a6edf){while(--_0x2a6edf){_0x26bddd['push'](_0x26bddd['shift']());}};_0x179b2d(++_0x150143);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xe2bc[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xce2b('0x0'));var util=require('util');var logger=require(_0xce2b('0x1'))('api');var moment=require(_0xce2b('0x2'));var BPromise=require(_0xce2b('0x3'));var rp=require(_0xce2b('0x4'));var fs=require('fs');var path=require(_0xce2b('0x5'));var rimraf=require(_0xce2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xce2b('0x7'));module[_0xce2b('0x8')]=function(_0x3c15d3,_0x343373){return _0x3c15d3[_0xce2b('0x9')]('AnalyticMetric',attributes,{'tableName':_0xce2b('0xa'),'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 c0057f5..d6a572a 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 _0x4f5d=['request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4f9b56,_0x4de94e){var _0x5b1e25=function(_0x4dc9fe){while(--_0x4dc9fe){_0x4f9b56['push'](_0x4f9b56['shift']());}};_0x5b1e25(++_0x4de94e);}(_0x4f5d,0x97));var _0xd4f5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4f5d[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4f5('0x0'));var BPromise=require('bluebird');var rs=require(_0xd4f5('0x1'));var fs=require('fs');var Redis=require(_0xd4f5('0x2'));var db=require(_0xd4f5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4f5('0x4'))(_0xd4f5('0x5'));var config=require(_0xd4f5('0x6'));var jayson=require(_0xd4f5('0x7'));var client=jayson['client'][_0xd4f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33ff92,_0x51f8cf,_0x1a4c53){return new BPromise(function(_0x4336f7,_0x405ae3){return client[_0xd4f5('0x9')](_0x33ff92,_0x1a4c53)[_0xd4f5('0xa')](function(_0x1f73cc){logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));logger[_0xd4f5('0xd')](_0xd4f5('0xe'),_0x51f8cf,_0xd4f5('0xc'),JSON['stringify'](_0x1f73cc));if(_0x1f73cc['error']){if(_0x1f73cc['error']['code']===0x1f4){logger['error'](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc['error'][_0xd4f5('0x10')]);return _0x405ae3(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);return _0x4336f7(_0x1f73cc[_0xd4f5('0x11')][_0xd4f5('0x10')]);}else{logger[_0xd4f5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x51f8cf,_0xd4f5('0xc'));_0x4336f7(_0x1f73cc[_0xd4f5('0x12')][_0xd4f5('0x10')]);}})[_0xd4f5('0x13')](function(_0x323a5a){logger[_0xd4f5('0x11')](_0xd4f5('0xf'),_0x51f8cf,_0x323a5a);_0x405ae3(_0x323a5a);});});} \ No newline at end of file +var _0x23bf=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1cf661,_0x2c4a3c){var _0x2b3877=function(_0x4ca6fb){while(--_0x4ca6fb){_0x1cf661['push'](_0x1cf661['shift']());}};_0x2b3877(++_0x2c4a3c);}(_0x23bf,0x1d8));var _0xf23b=function(_0x27d23c,_0x11fcc7){_0x27d23c=_0x27d23c-0x0;var _0x537ed4=_0x23bf[_0x27d23c];return _0x537ed4;};'use strict';var _=require(_0xf23b('0x0'));var util=require(_0xf23b('0x1'));var moment=require('moment');var BPromise=require(_0xf23b('0x2'));var rs=require(_0xf23b('0x3'));var fs=require('fs');var Redis=require(_0xf23b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf23b('0x5'));var logger=require('../../config/logger')(_0xf23b('0x6'));var config=require(_0xf23b('0x7'));var jayson=require(_0xf23b('0x8'));var client=jayson[_0xf23b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1957ab,_0x16e051,_0x544d5b){return new BPromise(function(_0x291f0d,_0x2792b5){return client[_0xf23b('0xa')](_0x1957ab,_0x544d5b)[_0xf23b('0xb')](function(_0x5506ce){logger[_0xf23b('0xc')](_0xf23b('0xd'),_0x16e051,_0xf23b('0xe'));logger[_0xf23b('0xf')](_0xf23b('0x10'),_0x16e051,_0xf23b('0xe'),JSON[_0xf23b('0x11')](_0x5506ce));if(_0x5506ce[_0xf23b('0x12')]){if(_0x5506ce['error'][_0xf23b('0x13')]===0x1f4){logger[_0xf23b('0x12')](_0xf23b('0xd'),_0x16e051,_0x5506ce[_0xf23b('0x12')][_0xf23b('0x14')]);return _0x2792b5(_0x5506ce['error'][_0xf23b('0x14')]);}logger['error'](_0xf23b('0xd'),_0x16e051,_0x5506ce['error']['message']);return _0x291f0d(_0x5506ce['error'][_0xf23b('0x14')]);}else{logger['info'](_0xf23b('0xd'),_0x16e051,_0xf23b('0xe'));_0x291f0d(_0x5506ce['result'][_0xf23b('0x14')]);}})['catch'](function(_0x39d3c5){logger[_0xf23b('0x12')](_0xf23b('0xd'),_0x16e051,_0x39d3c5);_0x2792b5(_0x39d3c5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c02e9c4..387d3c3 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 _0xa261=['./analyticMetric.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d0cba,_0x2731b1){var _0xdc3278=function(_0x3b20f5){while(--_0x3b20f5){_0x1d0cba['push'](_0x1d0cba['shift']());}};_0xdc3278(++_0x2731b1);}(_0xa261,0x1a3));var _0x1a26=function(_0x20f563,_0x4a3bf6){_0x20f563=_0x20f563-0x0;var _0x5c15a1=_0xa261[_0x20f563];return _0x5c15a1;};'use strict';var multer=require(_0x1a26('0x0'));var util=require('util');var path=require(_0x1a26('0x1'));var timeout=require(_0x1a26('0x2'));var express=require(_0x1a26('0x3'));var router=express[_0x1a26('0x4')]();var fs_extra=require(_0x1a26('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a26('0x6'));router[_0x1a26('0x7')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0x9')]);router[_0x1a26('0x7')]('/:id',auth[_0x1a26('0x8')](),controller['show']);router[_0x1a26('0xa')]('/',auth[_0x1a26('0x8')](),controller[_0x1a26('0xb')]);router['put'](_0x1a26('0xc'),auth[_0x1a26('0x8')](),controller[_0x1a26('0xd')]);router[_0x1a26('0xe')](_0x1a26('0xc'),auth['isAuthenticated'](),controller[_0x1a26('0xf')]);module[_0x1a26('0x10')]=router; \ No newline at end of file +var _0x84e7=['delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','create','put','/:id'];(function(_0x4cc18f,_0x3da515){var _0x46bee6=function(_0x1ac75f){while(--_0x1ac75f){_0x4cc18f['push'](_0x4cc18f['shift']());}};_0x46bee6(++_0x3da515);}(_0x84e7,0x122));var _0x784e=function(_0x4d3786,_0x58cb35){_0x4d3786=_0x4d3786-0x0;var _0x3911f7=_0x84e7[_0x4d3786];return _0x3911f7;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',auth[_0x784e('0x9')](),controller['index']);router[_0x784e('0x8')]('/:id',auth[_0x784e('0x9')](),controller[_0x784e('0xa')]);router['post']('/',auth[_0x784e('0x9')](),controller[_0x784e('0xb')]);router[_0x784e('0xc')](_0x784e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x784e('0xe')](_0x784e('0xd'),auth[_0x784e('0x9')](),controller[_0x784e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 63847d9..8666816 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 _0x4e05=['exports','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4e05,0x193));var _0x54e0=function(_0x5cd25b,_0x950abb){_0x5cd25b=_0x5cd25b-0x0;var _0x1c57a2=_0x4e05[_0x5cd25b];return _0x1c57a2;};'use strict';var Sequelize=require(_0x54e0('0x0'));module[_0x54e0('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x8c16=['sequelize'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x8c16,0xb3));var _0x68c1=function(_0x1dcce7,_0x33761c){_0x1dcce7=_0x1dcce7-0x0;var _0x350d60=_0x8c16[_0x1dcce7];return _0x350d60;};'use strict';var Sequelize=require(_0x68c1('0x0'));module['exports']={'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 566ddf2..cc0805f 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 _0x153a=['catch','keys','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows'];(function(_0x48c444,_0x5e2c6d){var _0x4304c7=function(_0x18136b){while(--_0x18136b){_0x48c444['push'](_0x48c444['shift']());}};_0x4304c7(++_0x5e2c6d);}(_0x153a,0x138));var _0xa153=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x153a[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require(_0xa153('0x0'));var rimraf=require(_0xa153('0x1'));var zipdir=require(_0xa153('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa153('0x3'));var moment=require(_0xa153('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa153('0x5'));var util=require(_0xa153('0x6'));var path=require('path');var sox=require(_0xa153('0x7'));var csv=require(_0xa153('0x8'));var ejs=require(_0xa153('0x9'));var fs=require('fs');var fs_extra=require(_0xa153('0xa'));var _=require(_0xa153('0xb'));var squel=require(_0xa153('0xc'));var crypto=require('crypto');var jsforce=require(_0xa153('0xd'));var deskjs=require(_0xa153('0xe'));var toCsv=require(_0xa153('0x8'));var querystring=require(_0xa153('0xf'));var Papa=require(_0xa153('0x10'));var Redis=require(_0xa153('0x11'));var authService=require(_0xa153('0x12'));var qs=require(_0xa153('0x13'));var as=require(_0xa153('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa153('0x15'))(_0xa153('0x16'));var utils=require(_0xa153('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa153('0x18'));var db=require(_0xa153('0x19'))['db'];function respondWithStatusCode(_0x3c041d,_0x412f27){_0x412f27=_0x412f27||0xcc;return function(_0x24a9c7){if(_0x24a9c7){return _0x3c041d['sendStatus'](_0x412f27);}return _0x3c041d[_0xa153('0x1a')](_0x412f27)[_0xa153('0x1b')]();};}function respondWithResult(_0x468c65,_0x2108ff){_0x2108ff=_0x2108ff||0xc8;return function(_0x10f537){if(_0x10f537){return _0x468c65[_0xa153('0x1a')](_0x2108ff)['json'](_0x10f537);}};}function respondWithFilteredResult(_0x4cd52e,_0x21ed69){return function(_0x4353be){if(_0x4353be){var _0x317943=typeof _0x21ed69[_0xa153('0x1c')]===_0xa153('0x1d')&&typeof _0x21ed69[_0xa153('0x1e')]==='undefined';var _0x41f389=_0x4353be[_0xa153('0x1f')];var _0x479bec=_0x317943?0x0:_0x21ed69[_0xa153('0x1c')];var _0xee6dab=_0x317943?_0x4353be[_0xa153('0x1f')]:_0x21ed69[_0xa153('0x1c')]+_0x21ed69['limit'];var _0x12a98e;if(_0xee6dab>=_0x41f389){_0xee6dab=_0x41f389;_0x12a98e=0xc8;}else{_0x12a98e=0xce;}_0x4cd52e['status'](_0x12a98e);return _0x4cd52e['set'](_0xa153('0x20'),_0x479bec+'-'+_0xee6dab+'/'+_0x41f389)[_0xa153('0x21')](_0x4353be);}return null;};}function patchUpdates(_0x3bd8f0){return function(_0x49fe91){try{jsonpatch[_0xa153('0x22')](_0x49fe91,_0x3bd8f0,!![]);}catch(_0x31c30d){return BPromise[_0xa153('0x23')](_0x31c30d);}return _0x49fe91[_0xa153('0x24')]();};}function saveUpdates(_0x35077d,_0x5b497c){return function(_0x3bc7ed){if(_0x3bc7ed){return _0x3bc7ed['update'](_0x35077d)[_0xa153('0x25')](function(_0x1b2e5f){return _0x1b2e5f;});}return null;};}function removeEntity(_0x214f79,_0x1fc3fb){return function(_0x2a61f4){if(_0x2a61f4){return _0x2a61f4['destroy']()[_0xa153('0x25')](function(){_0x214f79[_0xa153('0x1a')](0xcc)[_0xa153('0x1b')]();});}};}function handleEntityNotFound(_0x55d350,_0x45acf4){return function(_0x3abecd){if(!_0x3abecd){_0x55d350[_0xa153('0x26')](0x194);}return _0x3abecd;};}function handleError(_0x156f45,_0x442df1){_0x442df1=_0x442df1||0x1f4;return function(_0x734897){logger[_0xa153('0x27')](_0x734897[_0xa153('0x28')]);if(_0x734897[_0xa153('0x29')]){delete _0x734897[_0xa153('0x29')];}_0x156f45[_0xa153('0x1a')](_0x442df1)[_0xa153('0x2a')](_0x734897);};}exports[_0xa153('0x2b')]=function(_0x36f811,_0x4c20e0){var _0xbbc6ee={},_0x3ce108={},_0x3f2646={'count':0x0,'rows':[]};var _0x5d62f8=_[_0xa153('0x2c')](db['AnalyticTreeReport'][_0xa153('0x2d')],function(_0x3a2aa2){return{'name':_0x3a2aa2['fieldName'],'type':_0x3a2aa2[_0xa153('0x2e')][_0xa153('0x2f')]};});_0x3ce108[_0xa153('0x30')]=_[_0xa153('0x2c')](_0x5d62f8,_0xa153('0x29'));_0x3ce108['query']=_['keys'](_0x36f811[_0xa153('0x31')]);_0x3ce108['filters']=_[_0xa153('0x32')](_0x3ce108[_0xa153('0x30')],_0x3ce108[_0xa153('0x31')]);_0xbbc6ee['attributes']=_['intersection'](_0x3ce108[_0xa153('0x30')],qs[_0xa153('0x33')](_0x36f811[_0xa153('0x31')]['fields']));_0xbbc6ee['attributes']=_0xbbc6ee['attributes'][_0xa153('0x34')]?_0xbbc6ee[_0xa153('0x35')]:_0x3ce108['model'];if(!_0x36f811[_0xa153('0x31')][_0xa153('0x36')](_0xa153('0x37'))){_0xbbc6ee[_0xa153('0x1e')]=qs['limit'](_0x36f811[_0xa153('0x31')][_0xa153('0x1e')]);_0xbbc6ee[_0xa153('0x1c')]=qs[_0xa153('0x1c')](_0x36f811[_0xa153('0x31')][_0xa153('0x1c')]);}_0xbbc6ee['order']=qs[_0xa153('0x38')](_0x36f811[_0xa153('0x31')][_0xa153('0x38')]);_0xbbc6ee[_0xa153('0x39')]=qs[_0xa153('0x3a')](_[_0xa153('0x3b')](_0x36f811['query'],_0x3ce108[_0xa153('0x3a')]),_0x5d62f8);if(_0x36f811[_0xa153('0x31')][_0xa153('0x3c')]){_0xbbc6ee['where']=_[_0xa153('0x3d')](_0xbbc6ee['where'],{'$or':_[_0xa153('0x2c')](_0x5d62f8,function(_0x2cd152){if(_0x2cd152[_0xa153('0x2e')]!=='VIRTUAL'){var _0x478c7f={};_0x478c7f[_0x2cd152['name']]={'$like':'%'+_0x36f811[_0xa153('0x31')]['filter']+'%'};return _0x478c7f;}})});}_0xbbc6ee=_['merge']({},_0xbbc6ee,_0x36f811[_0xa153('0x3e')]);var _0x27a77c={'where':_0xbbc6ee[_0xa153('0x39')]};return db[_0xa153('0x3f')][_0xa153('0x1f')](_0x27a77c)['then'](function(_0xd3df11){_0x3f2646['count']=_0xd3df11;if(_0x36f811[_0xa153('0x31')][_0xa153('0x40')]){_0xbbc6ee[_0xa153('0x41')]=[{'all':!![]}];}return db[_0xa153('0x3f')][_0xa153('0x42')](_0xbbc6ee);})[_0xa153('0x25')](function(_0x3140a2){_0x3f2646[_0xa153('0x43')]=_0x3140a2;return _0x3f2646;})[_0xa153('0x25')](respondWithFilteredResult(_0x4c20e0,_0xbbc6ee))[_0xa153('0x44')](handleError(_0x4c20e0,null));};exports['show']=function(_0x5a70ed,_0x224afd){var _0xfa67db={'raw':!![],'where':{'id':_0x5a70ed['params']['id']}},_0x44e83d={};_0x44e83d[_0xa153('0x30')]=_[_0xa153('0x45')](db['AnalyticTreeReport'][_0xa153('0x2d')]);_0x44e83d[_0xa153('0x31')]=_[_0xa153('0x45')](_0x5a70ed[_0xa153('0x31')]);_0x44e83d[_0xa153('0x3a')]=_['intersection'](_0x44e83d[_0xa153('0x30')],_0x44e83d['query']);_0xfa67db[_0xa153('0x35')]=_['intersection'](_0x44e83d[_0xa153('0x30')],qs['fields'](_0x5a70ed[_0xa153('0x31')][_0xa153('0x33')]));_0xfa67db[_0xa153('0x35')]=_0xfa67db[_0xa153('0x35')][_0xa153('0x34')]?_0xfa67db['attributes']:_0x44e83d['model'];if(_0x5a70ed[_0xa153('0x31')][_0xa153('0x40')]){_0xfa67db[_0xa153('0x41')]=[{'all':!![]}];}_0xfa67db=_[_0xa153('0x3d')]({},_0xfa67db,_0x5a70ed[_0xa153('0x3e')]);return db['AnalyticTreeReport'][_0xa153('0x46')](_0xfa67db)['then'](handleEntityNotFound(_0x224afd,null))[_0xa153('0x25')](respondWithResult(_0x224afd,null))['catch'](handleError(_0x224afd,null));};exports[_0xa153('0x47')]=function(_0x40e46e,_0x4e7fc4){return db[_0xa153('0x3f')]['create'](_0x40e46e['body'],{})[_0xa153('0x25')](respondWithResult(_0x4e7fc4,0xc9))[_0xa153('0x44')](handleError(_0x4e7fc4,null));};exports[_0xa153('0x48')]=function(_0xd18485,_0x456fe3){if(_0xd18485[_0xa153('0x49')]['id']){delete _0xd18485['body']['id'];}return db[_0xa153('0x3f')]['find']({'where':{'id':_0xd18485[_0xa153('0x4a')]['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x456fe3,null))['then'](saveUpdates(_0xd18485[_0xa153('0x49')],null))['then'](respondWithResult(_0x456fe3,null))['catch'](handleError(_0x456fe3,null));};exports[_0xa153('0x4b')]=function(_0x57e33f,_0x50f310){return db[_0xa153('0x3f')][_0xa153('0x46')]({'where':{'id':_0x57e33f['params']['id']}})[_0xa153('0x25')](handleEntityNotFound(_0x50f310,null))[_0xa153('0x25')](removeEntity(_0x50f310,null))[_0xa153('0x44')](handleError(_0x50f310,null));}; \ No newline at end of file +var _0x9354=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','include','findAll','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x9354,0x69));var _0x4935=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x9354[_0x2134b7];return _0x6c5914;};'use strict';var emlformat=require(_0x4935('0x0'));var rimraf=require(_0x4935('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4935('0x2'));var rp=require(_0x4935('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4935('0x4'));var path=require(_0x4935('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4935('0x6'));var fs=require('fs');var fs_extra=require(_0x4935('0x7'));var _=require(_0x4935('0x8'));var squel=require(_0x4935('0x9'));var crypto=require(_0x4935('0xa'));var jsforce=require(_0x4935('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4935('0xc'));var Papa=require(_0x4935('0xd'));var Redis=require(_0x4935('0xe'));var authService=require(_0x4935('0xf'));var qs=require(_0x4935('0x10'));var as=require(_0x4935('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4935('0x12'))(_0x4935('0x13'));var utils=require(_0x4935('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x15'))['db'];function respondWithStatusCode(_0x43f0bd,_0x58837c){_0x58837c=_0x58837c||0xcc;return function(_0x2a3b47){if(_0x2a3b47){return _0x43f0bd[_0x4935('0x16')](_0x58837c);}return _0x43f0bd[_0x4935('0x17')](_0x58837c)['end']();};}function respondWithResult(_0x33b899,_0x3dc622){_0x3dc622=_0x3dc622||0xc8;return function(_0x196a77){if(_0x196a77){return _0x33b899[_0x4935('0x17')](_0x3dc622)[_0x4935('0x18')](_0x196a77);}};}function respondWithFilteredResult(_0x162d52,_0x2a0de9){return function(_0x3f1b08){if(_0x3f1b08){var _0x36d9f0=typeof _0x2a0de9[_0x4935('0x19')]===_0x4935('0x1a')&&typeof _0x2a0de9['limit']===_0x4935('0x1a');var _0x5000d3=_0x3f1b08[_0x4935('0x1b')];var _0x53b0f4=_0x36d9f0?0x0:_0x2a0de9[_0x4935('0x19')];var _0x2ca23d=_0x36d9f0?_0x3f1b08['count']:_0x2a0de9[_0x4935('0x19')]+_0x2a0de9['limit'];var _0x308459;if(_0x2ca23d>=_0x5000d3){_0x2ca23d=_0x5000d3;_0x308459=0xc8;}else{_0x308459=0xce;}_0x162d52[_0x4935('0x17')](_0x308459);return _0x162d52['set'](_0x4935('0x1c'),_0x53b0f4+'-'+_0x2ca23d+'/'+_0x5000d3)[_0x4935('0x18')](_0x3f1b08);}return null;};}function patchUpdates(_0x1b589e){return function(_0xc7637a){try{jsonpatch[_0x4935('0x1d')](_0xc7637a,_0x1b589e,!![]);}catch(_0x34cca8){return BPromise[_0x4935('0x1e')](_0x34cca8);}return _0xc7637a[_0x4935('0x1f')]();};}function saveUpdates(_0x43c2a5,_0x331324){return function(_0x366793){if(_0x366793){return _0x366793[_0x4935('0x20')](_0x43c2a5)[_0x4935('0x21')](function(_0x5be99e){return _0x5be99e;});}return null;};}function removeEntity(_0x2f5df9,_0x3aa23f){return function(_0x5c96a0){if(_0x5c96a0){return _0x5c96a0[_0x4935('0x22')]()[_0x4935('0x21')](function(){_0x2f5df9[_0x4935('0x17')](0xcc)[_0x4935('0x23')]();});}};}function handleEntityNotFound(_0x1d4579,_0x1945b4){return function(_0x26a759){if(!_0x26a759){_0x1d4579[_0x4935('0x16')](0x194);}return _0x26a759;};}function handleError(_0x10314e,_0x245c6f){_0x245c6f=_0x245c6f||0x1f4;return function(_0x24a0c3){logger[_0x4935('0x24')](_0x24a0c3[_0x4935('0x25')]);if(_0x24a0c3[_0x4935('0x26')]){delete _0x24a0c3['name'];}_0x10314e[_0x4935('0x17')](_0x245c6f)[_0x4935('0x27')](_0x24a0c3);};}exports[_0x4935('0x28')]=function(_0x425595,_0x273205){var _0x5486c8={},_0x44baca={},_0x2d9188={'count':0x0,'rows':[]};var _0x2ce9a0=_[_0x4935('0x29')](db['AnalyticTreeReport'][_0x4935('0x2a')],function(_0x53b37e){return{'name':_0x53b37e[_0x4935('0x2b')],'type':_0x53b37e[_0x4935('0x2c')][_0x4935('0x2d')]};});_0x44baca[_0x4935('0x2e')]=_[_0x4935('0x29')](_0x2ce9a0,_0x4935('0x26'));_0x44baca[_0x4935('0x2f')]=_[_0x4935('0x30')](_0x425595[_0x4935('0x2f')]);_0x44baca['filters']=_[_0x4935('0x31')](_0x44baca[_0x4935('0x2e')],_0x44baca[_0x4935('0x2f')]);_0x5486c8[_0x4935('0x32')]=_[_0x4935('0x31')](_0x44baca['model'],qs[_0x4935('0x33')](_0x425595[_0x4935('0x2f')][_0x4935('0x33')]));_0x5486c8[_0x4935('0x32')]=_0x5486c8[_0x4935('0x32')][_0x4935('0x34')]?_0x5486c8[_0x4935('0x32')]:_0x44baca[_0x4935('0x2e')];if(!_0x425595[_0x4935('0x2f')]['hasOwnProperty']('nolimit')){_0x5486c8[_0x4935('0x35')]=qs[_0x4935('0x35')](_0x425595['query'][_0x4935('0x35')]);_0x5486c8[_0x4935('0x19')]=qs[_0x4935('0x19')](_0x425595['query']['offset']);}_0x5486c8[_0x4935('0x36')]=qs[_0x4935('0x37')](_0x425595[_0x4935('0x2f')][_0x4935('0x37')]);_0x5486c8[_0x4935('0x38')]=qs[_0x4935('0x39')](_[_0x4935('0x3a')](_0x425595[_0x4935('0x2f')],_0x44baca[_0x4935('0x39')]),_0x2ce9a0);if(_0x425595[_0x4935('0x2f')][_0x4935('0x3b')]){_0x5486c8['where']=_[_0x4935('0x3c')](_0x5486c8['where'],{'$or':_['map'](_0x2ce9a0,function(_0x5bbadf){if(_0x5bbadf[_0x4935('0x2c')]!==_0x4935('0x3d')){var _0x21b499={};_0x21b499[_0x5bbadf[_0x4935('0x26')]]={'$like':'%'+_0x425595[_0x4935('0x2f')][_0x4935('0x3b')]+'%'};return _0x21b499;}})});}_0x5486c8=_[_0x4935('0x3c')]({},_0x5486c8,_0x425595[_0x4935('0x3e')]);var _0x53eb99={'where':_0x5486c8['where']};return db[_0x4935('0x3f')][_0x4935('0x1b')](_0x53eb99)[_0x4935('0x21')](function(_0x33bd68){_0x2d9188[_0x4935('0x1b')]=_0x33bd68;if(_0x425595['query']['includeAll']){_0x5486c8[_0x4935('0x40')]=[{'all':!![]}];}return db[_0x4935('0x3f')][_0x4935('0x41')](_0x5486c8);})[_0x4935('0x21')](function(_0x144a0c){_0x2d9188[_0x4935('0x42')]=_0x144a0c;return _0x2d9188;})[_0x4935('0x21')](respondWithFilteredResult(_0x273205,_0x5486c8))[_0x4935('0x43')](handleError(_0x273205,null));};exports[_0x4935('0x44')]=function(_0x195df1,_0x526f3f){var _0x518491={'raw':!![],'where':{'id':_0x195df1[_0x4935('0x45')]['id']}},_0xc6bda3={};_0xc6bda3[_0x4935('0x2e')]=_[_0x4935('0x30')](db[_0x4935('0x3f')]['rawAttributes']);_0xc6bda3['query']=_['keys'](_0x195df1[_0x4935('0x2f')]);_0xc6bda3['filters']=_[_0x4935('0x31')](_0xc6bda3[_0x4935('0x2e')],_0xc6bda3['query']);_0x518491[_0x4935('0x32')]=_[_0x4935('0x31')](_0xc6bda3['model'],qs[_0x4935('0x33')](_0x195df1[_0x4935('0x2f')]['fields']));_0x518491[_0x4935('0x32')]=_0x518491[_0x4935('0x32')]['length']?_0x518491[_0x4935('0x32')]:_0xc6bda3[_0x4935('0x2e')];if(_0x195df1[_0x4935('0x2f')][_0x4935('0x46')]){_0x518491[_0x4935('0x40')]=[{'all':!![]}];}_0x518491=_['merge']({},_0x518491,_0x195df1[_0x4935('0x3e')]);return db[_0x4935('0x3f')]['find'](_0x518491)['then'](handleEntityNotFound(_0x526f3f,null))['then'](respondWithResult(_0x526f3f,null))['catch'](handleError(_0x526f3f,null));};exports['create']=function(_0x17c808,_0x3265f4){return db[_0x4935('0x3f')][_0x4935('0x47')](_0x17c808[_0x4935('0x48')],{})[_0x4935('0x21')](respondWithResult(_0x3265f4,0xc9))[_0x4935('0x43')](handleError(_0x3265f4,null));};exports[_0x4935('0x20')]=function(_0x406c07,_0x108a30){if(_0x406c07[_0x4935('0x48')]['id']){delete _0x406c07[_0x4935('0x48')]['id'];}return db[_0x4935('0x3f')][_0x4935('0x49')]({'where':{'id':_0x406c07['params']['id']}})['then'](handleEntityNotFound(_0x108a30,null))[_0x4935('0x21')](saveUpdates(_0x406c07[_0x4935('0x48')],null))['then'](respondWithResult(_0x108a30,null))[_0x4935('0x43')](handleError(_0x108a30,null));};exports['destroy']=function(_0x4e1838,_0x23cdfc){return db['AnalyticTreeReport'][_0x4935('0x49')]({'where':{'id':_0x4e1838[_0x4935('0x45')]['id']}})[_0x4935('0x21')](handleEntityNotFound(_0x23cdfc,null))[_0x4935('0x21')](removeEntity(_0x23cdfc,null))[_0x4935('0x43')](handleError(_0x23cdfc,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 05be132..29ca64d 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 _0xdc6c=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdc6c,0x68));var _0xcdc6=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xdc6c[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0xcdc6('0x0'));var logger=require('../../config/logger')(_0xcdc6('0x1'));var moment=require('moment');var BPromise=require(_0xcdc6('0x2'));var rp=require(_0xcdc6('0x3'));var fs=require('fs');var path=require(_0xcdc6('0x4'));var rimraf=require(_0xcdc6('0x5'));var config=require(_0xcdc6('0x6'));var attributes=require(_0xcdc6('0x7'));module[_0xcdc6('0x8')]=function(_0x306308,_0x450fdf){return _0x306308[_0xcdc6('0x9')](_0xcdc6('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b57=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','./analyticTreeReport.attributes'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x2b57,0x1ec));var _0x72b5=function(_0x2d699c,_0x52281f){_0x2d699c=_0x2d699c-0x0;var _0xb25aa3=_0x2b57[_0x2d699c];return _0xb25aa3;};'use strict';var _=require(_0x72b5('0x0'));var util=require(_0x72b5('0x1'));var logger=require(_0x72b5('0x2'))(_0x72b5('0x3'));var moment=require(_0x72b5('0x4'));var BPromise=require(_0x72b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72b5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x72b5('0x7'));module['exports']=function(_0x3f5a40,_0x1206c1){return _0x3f5a40['define'](_0x72b5('0x8'),attributes,{'tableName':_0x72b5('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 be42a80..e3b890f 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0xadb5,0xad));var _0x5adb=function(_0x2622a3,_0x2a099e){_0x2622a3=_0x2622a3-0x0;var _0x1000e7=_0xadb5[_0x2622a3];return _0x1000e7;};'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']('AnalyticTreeReport,\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 +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(_0x322743,_0x3903b9){var _0x13de4d=function(_0x13a597){while(--_0x13a597){_0x322743['push'](_0x322743['shift']());}};_0x13de4d(++_0x3903b9);}(_0x2ef3,0xba));var _0x32ef=function(_0x28b178,_0x4d8ead){_0x28b178=_0x28b178-0x0;var _0x413f5b=_0x2ef3[_0x28b178];return _0x413f5b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 57d26b4..7043111 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 _0xa743=['isAuthenticated','get','/:id','show','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa743,0x86));var _0x3a74=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xa743[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0x3a74('0x0'));var util=require('util');var path=require(_0x3a74('0x1'));var timeout=require(_0x3a74('0x2'));var express=require(_0x3a74('0x3'));var router=express[_0x3a74('0x4')]();var fs_extra=require(_0x3a74('0x5'));var auth=require(_0x3a74('0x6'));var interaction=require(_0x3a74('0x7'));var config=require(_0x3a74('0x8'));var controller=require(_0x3a74('0x9'));router['get']('/',auth[_0x3a74('0xa')](),controller['index']);router[_0x3a74('0xb')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0xd')]);router['post']('/',auth[_0x3a74('0xa')](),controller[_0x3a74('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a74('0xf')](_0x3a74('0xc'),auth[_0x3a74('0xa')](),controller[_0x3a74('0x10')]);module[_0x3a74('0x11')]=router; \ No newline at end of file +var _0x4feb=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0x2776db,_0xfb2eda){var _0x572930=function(_0x5e1032){while(--_0x5e1032){_0x2776db['push'](_0x2776db['shift']());}};_0x572930(++_0xfb2eda);}(_0x4feb,0x10d));var _0xb4fe=function(_0x2a2c65,_0x22033b){_0x2a2c65=_0x2a2c65-0x0;var _0x413b09=_0x4feb[_0x2a2c65];return _0x413b09;};'use strict';var multer=require(_0xb4fe('0x0'));var util=require('util');var path=require(_0xb4fe('0x1'));var timeout=require(_0xb4fe('0x2'));var express=require('express');var router=express[_0xb4fe('0x3')]();var fs_extra=require(_0xb4fe('0x4'));var auth=require(_0xb4fe('0x5'));var interaction=require(_0xb4fe('0x6'));var config=require(_0xb4fe('0x7'));var controller=require(_0xb4fe('0x8'));router[_0xb4fe('0x9')]('/',auth['isAuthenticated'](),controller[_0xb4fe('0xa')]);router[_0xb4fe('0x9')](_0xb4fe('0xb'),auth[_0xb4fe('0xc')](),controller[_0xb4fe('0xd')]);router['post']('/',auth[_0xb4fe('0xc')](),controller[_0xb4fe('0xe')]);router[_0xb4fe('0xf')](_0xb4fe('0xb'),auth[_0xb4fe('0xc')](),controller['update']);router[_0xb4fe('0x10')](_0xb4fe('0xb'),auth['isAuthenticated'](),controller[_0xb4fe('0x11')]);module[_0xb4fe('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index a537755..b3fbacc 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 _0x057a=['exports','STRING','sequelize'];(function(_0x1081f0,_0x1d5187){var _0x142afa=function(_0x5c9f4b){while(--_0x5c9f4b){_0x1081f0['push'](_0x1081f0['shift']());}};_0x142afa(++_0x1d5187);}(_0x057a,0x1a6));var _0xa057=function(_0x5d53c0,_0x2e113f){_0x5d53c0=_0x5d53c0-0x0;var _0xb29b20=_0x057a[_0x5d53c0];return _0xb29b20;};'use strict';var Sequelize=require(_0xa057('0x0'));module[_0xa057('0x1')]={'name':{'type':Sequelize[_0xa057('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa057('0x2')]}}; \ No newline at end of file +var _0x01d3=['STRING'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x01d3,0xdb));var _0x301d=function(_0x4c5613,_0x2a18f2){_0x4c5613=_0x4c5613-0x0;var _0x2689da=_0x01d3[_0x4c5613];return _0x2689da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x301d('0x0')]},'basename':{'type':Sequelize[_0x301d('0x0')]},'type':{'type':Sequelize[_0x301d('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3564895..9bfc560 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 _0x3174=['sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','clone','length','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2ee20d,_0x354e70){var _0xade530=function(_0x1db7cc){while(--_0x1db7cc){_0x2ee20d['push'](_0x2ee20d['shift']());}};_0xade530(++_0x354e70);}(_0x3174,0x18c));var _0x4317=function(_0x50df1f,_0x45b8b1){_0x50df1f=_0x50df1f-0x0;var _0x5180e3=_0x3174[_0x50df1f];return _0x5180e3;};'use strict';var emlformat=require(_0x4317('0x0'));var rimraf=require(_0x4317('0x1'));var zipdir=require(_0x4317('0x2'));var jsonpatch=require(_0x4317('0x3'));var rp=require(_0x4317('0x4'));var moment=require('moment');var BPromise=require(_0x4317('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4317('0x6'));var sox=require(_0x4317('0x7'));var csv=require(_0x4317('0x8'));var ejs=require(_0x4317('0x9'));var fs=require('fs');var fs_extra=require(_0x4317('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4317('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4317('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4317('0xd'));var Redis=require(_0x4317('0xe'));var authService=require(_0x4317('0xf'));var qs=require(_0x4317('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4317('0x11'));var logger=require(_0x4317('0x12'))(_0x4317('0x13'));var utils=require(_0x4317('0x14'));var config=require(_0x4317('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4317('0x16'))['db'];function respondWithStatusCode(_0x18a625,_0x33fd1c){_0x33fd1c=_0x33fd1c||0xcc;return function(_0x298aed){if(_0x298aed){return _0x18a625[_0x4317('0x17')](_0x33fd1c);}return _0x18a625[_0x4317('0x18')](_0x33fd1c)[_0x4317('0x19')]();};}function respondWithResult(_0x49920a,_0x26ef32){_0x26ef32=_0x26ef32||0xc8;return function(_0x10024e){if(_0x10024e){return _0x49920a[_0x4317('0x18')](_0x26ef32)[_0x4317('0x1a')](_0x10024e);}};}function respondWithFilteredResult(_0x57901b,_0x250fc3){return function(_0x219adf){if(_0x219adf){var _0x150d36=typeof _0x250fc3[_0x4317('0x1b')]===_0x4317('0x1c')&&typeof _0x250fc3[_0x4317('0x1d')]===_0x4317('0x1c');var _0x17bcf8=_0x219adf['count'];var _0x37aa88=_0x150d36?0x0:_0x250fc3['offset'];var _0x5a4177=_0x150d36?_0x219adf[_0x4317('0x1e')]:_0x250fc3[_0x4317('0x1b')]+_0x250fc3['limit'];var _0x3a9466;if(_0x5a4177>=_0x17bcf8){_0x5a4177=_0x17bcf8;_0x3a9466=0xc8;}else{_0x3a9466=0xce;}_0x57901b[_0x4317('0x18')](_0x3a9466);return _0x57901b[_0x4317('0x1f')](_0x4317('0x20'),_0x37aa88+'-'+_0x5a4177+'/'+_0x17bcf8)[_0x4317('0x1a')](_0x219adf);}return null;};}function patchUpdates(_0x2ea18a){return function(_0xd4cb2c){try{jsonpatch[_0x4317('0x21')](_0xd4cb2c,_0x2ea18a,!![]);}catch(_0x554294){return BPromise['reject'](_0x554294);}return _0xd4cb2c['save']();};}function saveUpdates(_0x2b88cc,_0x5c495a){return function(_0x22d28){if(_0x22d28){return _0x22d28[_0x4317('0x22')](_0x2b88cc)[_0x4317('0x23')](function(_0x35855e){return _0x35855e;});}return null;};}function removeEntity(_0x30360e,_0x2a3eb0){return function(_0x407b6c){if(_0x407b6c){return _0x407b6c[_0x4317('0x24')]()[_0x4317('0x23')](function(){_0x30360e[_0x4317('0x18')](0xcc)[_0x4317('0x19')]();});}};}function handleEntityNotFound(_0x4b179e,_0x3ea927){return function(_0x15c091){if(!_0x15c091){_0x4b179e[_0x4317('0x17')](0x194);}return _0x15c091;};}function handleError(_0x97e718,_0x42c0a6){_0x42c0a6=_0x42c0a6||0x1f4;return function(_0x4c50e7){logger['error'](_0x4c50e7[_0x4317('0x25')]);if(_0x4c50e7[_0x4317('0x26')]){delete _0x4c50e7[_0x4317('0x26')];}_0x97e718[_0x4317('0x18')](_0x42c0a6)['send'](_0x4c50e7);};}exports[_0x4317('0x27')]=function(_0x14ec45,_0x18409e){var _0x36b6d1={},_0x2b21c4={},_0x5702ce={'count':0x0,'rows':[]};var _0xa5b3d3=_[_0x4317('0x28')](db[_0x4317('0x29')][_0x4317('0x2a')],function(_0x260e5f){return{'name':_0x260e5f[_0x4317('0x2b')],'type':_0x260e5f[_0x4317('0x2c')][_0x4317('0x2d')]};});_0x2b21c4['model']=_['map'](_0xa5b3d3,_0x4317('0x26'));_0x2b21c4['query']=_[_0x4317('0x2e')](_0x14ec45[_0x4317('0x2f')]);_0x2b21c4['filters']=_[_0x4317('0x30')](_0x2b21c4[_0x4317('0x31')],_0x2b21c4[_0x4317('0x2f')]);_0x36b6d1[_0x4317('0x32')]=_['intersection'](_0x2b21c4['model'],qs[_0x4317('0x33')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x33')]));_0x36b6d1[_0x4317('0x32')]=_0x36b6d1[_0x4317('0x32')]['length']?_0x36b6d1['attributes']:_0x2b21c4[_0x4317('0x31')];if(!_0x14ec45['query'][_0x4317('0x34')](_0x4317('0x35'))){_0x36b6d1[_0x4317('0x1d')]=qs[_0x4317('0x1d')](_0x14ec45['query'][_0x4317('0x1d')]);_0x36b6d1[_0x4317('0x1b')]=qs[_0x4317('0x1b')](_0x14ec45[_0x4317('0x2f')][_0x4317('0x1b')]);}_0x36b6d1['order']=qs[_0x4317('0x36')](_0x14ec45[_0x4317('0x2f')]['sort']);_0x36b6d1['where']=qs[_0x4317('0x37')](_[_0x4317('0x38')](_0x14ec45[_0x4317('0x2f')],_0x2b21c4[_0x4317('0x37')]),_0xa5b3d3);if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x39')]){_0x36b6d1[_0x4317('0x3a')]=_[_0x4317('0x3b')](_0x36b6d1[_0x4317('0x3a')],{'$or':_['map'](_0xa5b3d3,function(_0x3328d8){if(_0x3328d8[_0x4317('0x2c')]!==_0x4317('0x3c')){var _0xe3e1e7={};_0xe3e1e7[_0x3328d8[_0x4317('0x26')]]={'$like':'%'+_0x14ec45['query']['filter']+'%'};return _0xe3e1e7;}})});}_0x36b6d1=_['merge']({},_0x36b6d1,_0x14ec45[_0x4317('0x3d')]);var _0x344eee={'where':_0x36b6d1[_0x4317('0x3a')]};return db[_0x4317('0x29')]['count'](_0x344eee)[_0x4317('0x23')](function(_0x17a217){_0x5702ce[_0x4317('0x1e')]=_0x17a217;if(_0x14ec45[_0x4317('0x2f')][_0x4317('0x3e')]){_0x36b6d1[_0x4317('0x3f')]=[{'all':!![]}];}return db[_0x4317('0x29')][_0x4317('0x40')](_0x36b6d1);})[_0x4317('0x23')](function(_0x1732d8){_0x5702ce[_0x4317('0x41')]=_0x1732d8;return _0x5702ce;})[_0x4317('0x23')](respondWithFilteredResult(_0x18409e,_0x36b6d1))[_0x4317('0x42')](handleError(_0x18409e,null));};exports[_0x4317('0x43')]=function(_0xe3cf85,_0x5b510b){var _0xc37a78={'raw':!![],'where':{'id':_0xe3cf85[_0x4317('0x44')]['id']}},_0x52f7e0={};_0x52f7e0[_0x4317('0x31')]=_['keys'](db[_0x4317('0x29')][_0x4317('0x2a')]);_0x52f7e0[_0x4317('0x2f')]=_['keys'](_0xe3cf85['query']);_0x52f7e0[_0x4317('0x37')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],_0x52f7e0[_0x4317('0x2f')]);_0xc37a78[_0x4317('0x32')]=_[_0x4317('0x30')](_0x52f7e0[_0x4317('0x31')],qs[_0x4317('0x33')](_0xe3cf85[_0x4317('0x2f')]['fields']));_0xc37a78[_0x4317('0x32')]=_0xc37a78[_0x4317('0x32')]['length']?_0xc37a78[_0x4317('0x32')]:_0x52f7e0[_0x4317('0x31')];if(_0xe3cf85[_0x4317('0x2f')][_0x4317('0x3e')]){_0xc37a78[_0x4317('0x3f')]=[{'all':!![]}];}_0xc37a78=_[_0x4317('0x3b')]({},_0xc37a78,_0xe3cf85[_0x4317('0x3d')]);return db['Attachment'][_0x4317('0x45')](_0xc37a78)[_0x4317('0x23')](handleEntityNotFound(_0x5b510b,null))['then'](respondWithResult(_0x5b510b,null))['catch'](handleError(_0x5b510b,null));};exports[_0x4317('0x46')]=function(_0x501991,_0x5a52a9){var _0x568750={'where':{'id':_0x501991['params']['id']}},_0xfa9647={};_0xfa9647[_0x4317('0x31')]=_[_0x4317('0x2e')](db['Attachment'][_0x4317('0x2a')]);_0x568750['attributes']=_[_0x4317('0x30')](_0xfa9647['model'],qs[_0x4317('0x33')](_0x501991[_0x4317('0x2f')]['fields']));_0x568750[_0x4317('0x32')]=_0x568750[_0x4317('0x32')][_0x4317('0x47')]?_0x568750[_0x4317('0x32')]:_0xfa9647[_0x4317('0x31')];if(_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]){_0x568750[_0x4317('0x3f')]=[{'all':!![]}];}_0x568750=_['merge']({},_0x568750,_0x501991[_0x4317('0x3d')]);return db[_0x4317('0x29')][_0x4317('0x45')](_0x568750)[_0x4317('0x23')](handleEntityNotFound(_0x5a52a9,null))[_0x4317('0x23')](function(_0x41645e){if(_0x41645e){var _0x1fd5d2=_0x41645e[_0x4317('0x48')]({'plain':!![]});_0x1fd5d2=qs[_0x4317('0x49')](_0x1fd5d2,['id',_0x4317('0x4a'),_0x4317('0x4b')]);_0x501991[_0x4317('0x4c')]=_[_0x4317('0x49')](_0x501991[_0x4317('0x4c')],['id',_0x4317('0x4a'),_0x4317('0x4b')]);return db[_0x4317('0x29')][_0x4317('0x4d')](_[_0x4317('0x3b')](_0x1fd5d2,_0x501991[_0x4317('0x4c')]),{'include':_0x501991[_0x4317('0x2f')][_0x4317('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x5a52a9,0xc9))[_0x4317('0x42')](handleError(_0x5a52a9,null));};exports[_0x4317('0x22')]=function(_0x4b6176,_0x2f1b2b){if(_0x4b6176[_0x4317('0x4c')]['id']){delete _0x4b6176[_0x4317('0x4c')]['id'];}return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x4b6176['params']['id']}})[_0x4317('0x23')](handleEntityNotFound(_0x2f1b2b,null))['then'](saveUpdates(_0x4b6176[_0x4317('0x4c')],null))[_0x4317('0x23')](respondWithResult(_0x2f1b2b,null))[_0x4317('0x42')](handleError(_0x2f1b2b,null));};exports['destroy']=function(_0x37d421,_0x80cf75){return db[_0x4317('0x29')][_0x4317('0x45')]({'where':{'id':_0x37d421[_0x4317('0x44')]['id']}})['then'](handleEntityNotFound(_0x80cf75,null))[_0x4317('0x23')](removeEntity(_0x80cf75,null))[_0x4317('0x42')](handleError(_0x80cf75,null));};exports['create']=function(_0x4cabe5,_0x345b02,_0x7183ae){_0x4cabe5['body'][_0x4317('0x26')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x4f')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x50')]=_0x4cabe5[_0x4317('0x4e')][_0x4317('0x51')];_0x4cabe5[_0x4317('0x4c')][_0x4317('0x2c')]=_0x4cabe5['file'][_0x4317('0x52')];return db[_0x4317('0x29')][_0x4317('0x4d')](_0x4cabe5[_0x4317('0x4c')])[_0x4317('0x23')](respondWithResult(_0x345b02,0xc9))[_0x4317('0x42')](handleError(_0x345b02,null));};exports['download']=function(_0x46113e,_0x22b46e,_0x5bed47){return db[_0x4317('0x29')][_0x4317('0x53')]({'where':{'id':_0x46113e['params']['id']},'raw':!![]})[_0x4317('0x23')](handleEntityNotFound(_0x22b46e,null))[_0x4317('0x23')](function(_0x52a3f0){if(_0x52a3f0){var _0x45f418=_0x52a3f0[_0x4317('0x54')]!==null;var _0x469ea0=path[_0x4317('0x55')](config[_0x4317('0x56')],_0x4317('0x57'));if(_0x45f418){_0x469ea0=path[_0x4317('0x55')](_0x469ea0,_0x4317('0x58'));}var _0x555a16=path[_0x4317('0x55')](_0x469ea0,_0x52a3f0[_0x4317('0x50')]);return _0x22b46e[_0x4317('0x59')](_0x555a16);}})[_0x4317('0x42')](handleError(_0x22b46e,null));}; \ No newline at end of file +var _0x10d5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xeab865,_0x15f419){var _0x1c8000=function(_0x27fb80){while(--_0x27fb80){_0xeab865['push'](_0xeab865['shift']());}};_0x1c8000(++_0x15f419);}(_0x10d5,0x1b6));var _0x510d=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x10d5[_0x3dc68d];return _0xdf7f94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x510d('0x0'));var jsonpatch=require(_0x510d('0x1'));var rp=require(_0x510d('0x2'));var moment=require(_0x510d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x510d('0x4'));var util=require(_0x510d('0x5'));var path=require(_0x510d('0x6'));var sox=require(_0x510d('0x7'));var csv=require(_0x510d('0x8'));var ejs=require(_0x510d('0x9'));var fs=require('fs');var fs_extra=require(_0x510d('0xa'));var _=require(_0x510d('0xb'));var squel=require(_0x510d('0xc'));var crypto=require(_0x510d('0xd'));var jsforce=require(_0x510d('0xe'));var deskjs=require(_0x510d('0xf'));var toCsv=require(_0x510d('0x8'));var querystring=require(_0x510d('0x10'));var Papa=require(_0x510d('0x11'));var Redis=require(_0x510d('0x12'));var authService=require(_0x510d('0x13'));var qs=require(_0x510d('0x14'));var as=require(_0x510d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x510d('0x16'))(_0x510d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x510d('0x18'));var db=require(_0x510d('0x19'))['db'];function respondWithStatusCode(_0x14f51e,_0x27a665){_0x27a665=_0x27a665||0xcc;return function(_0x4d5c9d){if(_0x4d5c9d){return _0x14f51e[_0x510d('0x1a')](_0x27a665);}return _0x14f51e[_0x510d('0x1b')](_0x27a665)[_0x510d('0x1c')]();};}function respondWithResult(_0x288aea,_0x2c9159){_0x2c9159=_0x2c9159||0xc8;return function(_0x40f8d0){if(_0x40f8d0){return _0x288aea[_0x510d('0x1b')](_0x2c9159)[_0x510d('0x1d')](_0x40f8d0);}};}function respondWithFilteredResult(_0x76c13a,_0x335771){return function(_0x1b48e2){if(_0x1b48e2){var _0x27b2df=typeof _0x335771[_0x510d('0x1e')]==='undefined'&&typeof _0x335771[_0x510d('0x1f')]===_0x510d('0x20');var _0x8f506=_0x1b48e2[_0x510d('0x21')];var _0x53d75e=_0x27b2df?0x0:_0x335771[_0x510d('0x1e')];var _0x5716af=_0x27b2df?_0x1b48e2['count']:_0x335771['offset']+_0x335771[_0x510d('0x1f')];var _0x4f924a;if(_0x5716af>=_0x8f506){_0x5716af=_0x8f506;_0x4f924a=0xc8;}else{_0x4f924a=0xce;}_0x76c13a[_0x510d('0x1b')](_0x4f924a);return _0x76c13a[_0x510d('0x22')](_0x510d('0x23'),_0x53d75e+'-'+_0x5716af+'/'+_0x8f506)['json'](_0x1b48e2);}return null;};}function patchUpdates(_0x40b107){return function(_0x1cbba9){try{jsonpatch[_0x510d('0x24')](_0x1cbba9,_0x40b107,!![]);}catch(_0x4cbcdb){return BPromise[_0x510d('0x25')](_0x4cbcdb);}return _0x1cbba9['save']();};}function saveUpdates(_0x277e9e,_0xffb878){return function(_0x3d1424){if(_0x3d1424){return _0x3d1424[_0x510d('0x26')](_0x277e9e)[_0x510d('0x27')](function(_0x419fcd){return _0x419fcd;});}return null;};}function removeEntity(_0x2f1aac,_0x57b85d){return function(_0x21ebaa){if(_0x21ebaa){return _0x21ebaa['destroy']()[_0x510d('0x27')](function(){_0x2f1aac['status'](0xcc)[_0x510d('0x1c')]();});}};}function handleEntityNotFound(_0x17102d,_0x3e8d2c){return function(_0x30966e){if(!_0x30966e){_0x17102d[_0x510d('0x1a')](0x194);}return _0x30966e;};}function handleError(_0x459870,_0x22ec9a){_0x22ec9a=_0x22ec9a||0x1f4;return function(_0x2b115e){logger[_0x510d('0x28')](_0x2b115e[_0x510d('0x29')]);if(_0x2b115e[_0x510d('0x2a')]){delete _0x2b115e[_0x510d('0x2a')];}_0x459870[_0x510d('0x1b')](_0x22ec9a)[_0x510d('0x2b')](_0x2b115e);};}exports[_0x510d('0x2c')]=function(_0x20d534,_0x1231e7){var _0x1a9976={},_0x4f90d3={},_0x415286={'count':0x0,'rows':[]};var _0x518ca6=_['map'](db[_0x510d('0x2d')][_0x510d('0x2e')],function(_0x51d206){return{'name':_0x51d206[_0x510d('0x2f')],'type':_0x51d206[_0x510d('0x30')][_0x510d('0x31')]};});_0x4f90d3[_0x510d('0x32')]=_['map'](_0x518ca6,_0x510d('0x2a'));_0x4f90d3[_0x510d('0x33')]=_['keys'](_0x20d534[_0x510d('0x33')]);_0x4f90d3[_0x510d('0x34')]=_[_0x510d('0x35')](_0x4f90d3[_0x510d('0x32')],_0x4f90d3[_0x510d('0x33')]);_0x1a9976['attributes']=_[_0x510d('0x35')](_0x4f90d3[_0x510d('0x32')],qs[_0x510d('0x36')](_0x20d534[_0x510d('0x33')][_0x510d('0x36')]));_0x1a9976['attributes']=_0x1a9976[_0x510d('0x37')][_0x510d('0x38')]?_0x1a9976[_0x510d('0x37')]:_0x4f90d3[_0x510d('0x32')];if(!_0x20d534[_0x510d('0x33')]['hasOwnProperty']('nolimit')){_0x1a9976['limit']=qs[_0x510d('0x1f')](_0x20d534[_0x510d('0x33')][_0x510d('0x1f')]);_0x1a9976[_0x510d('0x1e')]=qs[_0x510d('0x1e')](_0x20d534[_0x510d('0x33')]['offset']);}_0x1a9976['order']=qs[_0x510d('0x39')](_0x20d534[_0x510d('0x33')][_0x510d('0x39')]);_0x1a9976['where']=qs[_0x510d('0x34')](_['pick'](_0x20d534[_0x510d('0x33')],_0x4f90d3[_0x510d('0x34')]),_0x518ca6);if(_0x20d534['query']['filter']){_0x1a9976[_0x510d('0x3a')]=_[_0x510d('0x3b')](_0x1a9976[_0x510d('0x3a')],{'$or':_[_0x510d('0x3c')](_0x518ca6,function(_0x2f55f1){if(_0x2f55f1[_0x510d('0x30')]!==_0x510d('0x3d')){var _0x1cbf30={};_0x1cbf30[_0x2f55f1['name']]={'$like':'%'+_0x20d534[_0x510d('0x33')][_0x510d('0x3e')]+'%'};return _0x1cbf30;}})});}_0x1a9976=_[_0x510d('0x3b')]({},_0x1a9976,_0x20d534[_0x510d('0x3f')]);var _0x201cae={'where':_0x1a9976[_0x510d('0x3a')]};return db['Attachment'][_0x510d('0x21')](_0x201cae)['then'](function(_0x50eea5){_0x415286[_0x510d('0x21')]=_0x50eea5;if(_0x20d534[_0x510d('0x33')][_0x510d('0x40')]){_0x1a9976[_0x510d('0x41')]=[{'all':!![]}];}return db[_0x510d('0x2d')][_0x510d('0x42')](_0x1a9976);})[_0x510d('0x27')](function(_0x2e5d59){_0x415286[_0x510d('0x43')]=_0x2e5d59;return _0x415286;})['then'](respondWithFilteredResult(_0x1231e7,_0x1a9976))[_0x510d('0x44')](handleError(_0x1231e7,null));};exports[_0x510d('0x45')]=function(_0x2cf613,_0x19d06f){var _0x26ef39={'raw':!![],'where':{'id':_0x2cf613[_0x510d('0x46')]['id']}},_0x33893f={};_0x33893f[_0x510d('0x32')]=_[_0x510d('0x47')](db['Attachment'][_0x510d('0x2e')]);_0x33893f['query']=_['keys'](_0x2cf613['query']);_0x33893f[_0x510d('0x34')]=_[_0x510d('0x35')](_0x33893f[_0x510d('0x32')],_0x33893f[_0x510d('0x33')]);_0x26ef39['attributes']=_[_0x510d('0x35')](_0x33893f[_0x510d('0x32')],qs[_0x510d('0x36')](_0x2cf613[_0x510d('0x33')][_0x510d('0x36')]));_0x26ef39['attributes']=_0x26ef39[_0x510d('0x37')][_0x510d('0x38')]?_0x26ef39[_0x510d('0x37')]:_0x33893f['model'];if(_0x2cf613['query'][_0x510d('0x40')]){_0x26ef39['include']=[{'all':!![]}];}_0x26ef39=_[_0x510d('0x3b')]({},_0x26ef39,_0x2cf613[_0x510d('0x3f')]);return db['Attachment'][_0x510d('0x48')](_0x26ef39)[_0x510d('0x27')](handleEntityNotFound(_0x19d06f,null))[_0x510d('0x27')](respondWithResult(_0x19d06f,null))['catch'](handleError(_0x19d06f,null));};exports[_0x510d('0x49')]=function(_0x6360b3,_0x3e316e){var _0x51fa45={'where':{'id':_0x6360b3[_0x510d('0x46')]['id']}},_0x5683f0={};_0x5683f0[_0x510d('0x32')]=_[_0x510d('0x47')](db[_0x510d('0x2d')]['rawAttributes']);_0x51fa45[_0x510d('0x37')]=_[_0x510d('0x35')](_0x5683f0[_0x510d('0x32')],qs['fields'](_0x6360b3[_0x510d('0x33')][_0x510d('0x36')]));_0x51fa45[_0x510d('0x37')]=_0x51fa45[_0x510d('0x37')][_0x510d('0x38')]?_0x51fa45[_0x510d('0x37')]:_0x5683f0[_0x510d('0x32')];if(_0x6360b3[_0x510d('0x33')][_0x510d('0x40')]){_0x51fa45[_0x510d('0x41')]=[{'all':!![]}];}_0x51fa45=_['merge']({},_0x51fa45,_0x6360b3['options']);return db[_0x510d('0x2d')]['find'](_0x51fa45)[_0x510d('0x27')](handleEntityNotFound(_0x3e316e,null))[_0x510d('0x27')](function(_0x35d7cc){if(_0x35d7cc){var _0x1ae92f=_0x35d7cc[_0x510d('0x4a')]({'plain':!![]});_0x1ae92f=qs[_0x510d('0x4b')](_0x1ae92f,['id',_0x510d('0x4c'),_0x510d('0x4d')]);_0x6360b3[_0x510d('0x4e')]=_['omit'](_0x6360b3[_0x510d('0x4e')],['id','createdAt',_0x510d('0x4d')]);return db['Attachment'][_0x510d('0x4f')](_[_0x510d('0x3b')](_0x1ae92f,_0x6360b3[_0x510d('0x4e')]),{'include':_0x6360b3['query'][_0x510d('0x40')]?[{'all':!![]}]:undefined});}})[_0x510d('0x27')](respondWithResult(_0x3e316e,0xc9))[_0x510d('0x44')](handleError(_0x3e316e,null));};exports[_0x510d('0x26')]=function(_0x279dd0,_0x2a3f8e){if(_0x279dd0['body']['id']){delete _0x279dd0['body']['id'];}return db[_0x510d('0x2d')][_0x510d('0x48')]({'where':{'id':_0x279dd0['params']['id']}})[_0x510d('0x27')](handleEntityNotFound(_0x2a3f8e,null))[_0x510d('0x27')](saveUpdates(_0x279dd0[_0x510d('0x4e')],null))[_0x510d('0x27')](respondWithResult(_0x2a3f8e,null))[_0x510d('0x44')](handleError(_0x2a3f8e,null));};exports['destroy']=function(_0xa86035,_0x469101){return db[_0x510d('0x2d')][_0x510d('0x48')]({'where':{'id':_0xa86035['params']['id']}})[_0x510d('0x27')](handleEntityNotFound(_0x469101,null))[_0x510d('0x27')](removeEntity(_0x469101,null))[_0x510d('0x44')](handleError(_0x469101,null));};exports[_0x510d('0x4f')]=function(_0xe2e0ea,_0x5cd59c,_0x2b7f76){_0xe2e0ea['body']['name']=_0xe2e0ea[_0x510d('0x50')][_0x510d('0x51')];_0xe2e0ea[_0x510d('0x4e')]['basename']=_0xe2e0ea[_0x510d('0x50')][_0x510d('0x52')];_0xe2e0ea[_0x510d('0x4e')][_0x510d('0x30')]=_0xe2e0ea['file'][_0x510d('0x53')];return db[_0x510d('0x2d')][_0x510d('0x4f')](_0xe2e0ea['body'])['then'](respondWithResult(_0x5cd59c,0xc9))[_0x510d('0x44')](handleError(_0x5cd59c,null));};exports[_0x510d('0x54')]=function(_0x2761c5,_0x315fbc,_0x11972a){return db[_0x510d('0x2d')][_0x510d('0x55')]({'where':{'id':_0x2761c5[_0x510d('0x46')]['id']},'raw':!![]})[_0x510d('0x27')](handleEntityNotFound(_0x315fbc,null))['then'](function(_0x432f41){if(_0x432f41){var _0x164d07=_0x432f41['ChatOfflineMessageId']!==null;var _0x4592f1=path[_0x510d('0x56')](config[_0x510d('0x57')],_0x510d('0x58'));if(_0x164d07){_0x4592f1=path[_0x510d('0x56')](_0x4592f1,'offline-chat/');}var _0x2c665c=path[_0x510d('0x56')](_0x4592f1,_0x432f41[_0x510d('0x59')]);return _0x315fbc[_0x510d('0x54')](_0x2c665c);}})[_0x510d('0x44')](handleError(_0x315fbc,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a29b5b7..ae9c2e3 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 _0xd390=['moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x6ea56b,_0x4b98e4){var _0x2ef411=function(_0x4271dd){while(--_0x4271dd){_0x6ea56b['push'](_0x6ea56b['shift']());}};_0x2ef411(++_0x4b98e4);}(_0xd390,0x76));var _0x0d39=function(_0x54f298,_0x5681d4){_0x54f298=_0x54f298-0x0;var _0x489e44=_0xd390[_0x54f298];return _0x489e44;};'use strict';var _=require(_0x0d39('0x0'));var util=require(_0x0d39('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0d39('0x2'));var BPromise=require(_0x0d39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d39('0x4'));var rimraf=require(_0x0d39('0x5'));var config=require(_0x0d39('0x6'));var attributes=require(_0x0d39('0x7'));module[_0x0d39('0x8')]=function(_0x4cc6e2,_0x176183){return _0x4cc6e2[_0x0d39('0x9')](_0x0d39('0xa'),attributes,{'tableName':_0x0d39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d32=['api','bluebird','rimraf','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x5e4e54,_0x22683c){var _0x20b557=function(_0x59d565){while(--_0x59d565){_0x5e4e54['push'](_0x5e4e54['shift']());}};_0x20b557(++_0x22683c);}(_0x4d32,0x9d));var _0x24d3=function(_0x283b7c,_0x53bb1f){_0x283b7c=_0x283b7c-0x0;var _0x2a26ea=_0x4d32[_0x283b7c];return _0x2a26ea;};'use strict';var _=require(_0x24d3('0x0'));var util=require(_0x24d3('0x1'));var logger=require(_0x24d3('0x2'))(_0x24d3('0x3'));var moment=require('moment');var BPromise=require(_0x24d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x24d3('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x24d3('0x6')]=function(_0x153c25,_0x24fe05){return _0x153c25[_0x24d3('0x7')](_0x24d3('0x8'),attributes,{'tableName':_0x24d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 50a296e..abd14da 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 _0x7794=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xa61fd1,_0x934c7b){var _0x82399b=function(_0x4c3878){while(--_0x4c3878){_0xa61fd1['push'](_0xa61fd1['shift']());}};_0x82399b(++_0x934c7b);}(_0x7794,0x7b));var _0x4779=function(_0x305093,_0x1826d0){_0x305093=_0x305093-0x0;var _0x8bc9cd=_0x7794[_0x305093];return _0x8bc9cd;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}exports[_0x4779('0x15')]=function(_0x19fbb6){var _0x582e89=this;return new Promise(function(_0x3dbe70,_0x5d9a58){return db[_0x4779('0x16')][_0x4779('0x17')](_0x19fbb6['body'],{'raw':_0x19fbb6[_0x4779('0x18')]?_0x19fbb6['options'][_0x4779('0x19')]===undefined?!![]:![]:!![]})[_0x4779('0x9')](function(_0x143ef6){logger[_0x4779('0xa')](_0x4779('0x15'),_0x19fbb6);logger[_0x4779('0xc')]('CreateAttachment',_0x19fbb6,JSON[_0x4779('0xe')](_0x143ef6));_0x3dbe70(_0x143ef6);})['catch'](function(_0x4ad246){logger[_0x4779('0xf')](_0x4779('0x15'),_0x4ad246[_0x4779('0x12')],_0x19fbb6);_0x5d9a58(_0x582e89[_0x4779('0xf')](0x1f4,_0x4ad246['message']));});});}; \ No newline at end of file +var _0x4746=['request','request\x20sent','debug','error','code','message','Attachment,\x20%s,\x20%s','info','catch','Attachment','create','body','options','raw','CreateAttachment','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5108bf,_0x1e9b2a){var _0x343c7e=function(_0xebcba1){while(--_0xebcba1){_0x5108bf['push'](_0x5108bf['shift']());}};_0x343c7e(++_0x1e9b2a);}(_0x4746,0xc6));var _0x6474=function(_0x1c907e,_0x5d0fcb){_0x1c907e=_0x1c907e-0x0;var _0x20b6f6=_0x4746[_0x1c907e];return _0x20b6f6;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('Attachment,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('Attachment,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('Attachment,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});}exports['CreateAttachment']=function(_0x1505fc){var _0x7585ed=this;return new Promise(function(_0xb6ecb6,_0xc3448d){return db[_0x6474('0x13')][_0x6474('0x14')](_0x1505fc[_0x6474('0x15')],{'raw':_0x1505fc[_0x6474('0x16')]?_0x1505fc['options'][_0x6474('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xd23b18){logger[_0x6474('0x11')](_0x6474('0x18'),_0x1505fc);logger[_0x6474('0xc')](_0x6474('0x18'),_0x1505fc,JSON[_0x6474('0x19')](_0xd23b18));_0xb6ecb6(_0xd23b18);})[_0x6474('0x12')](function(_0x5d0e5c){logger[_0x6474('0xd')]('CreateAttachment',_0x5d0e5c[_0x6474('0xf')],_0x1505fc);_0xc3448d(_0x7585ed['error'](0x1f4,_0x5d0e5c['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index efd6272..6a918b6 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'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('./attachment.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['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x2dcb4d,_0xe886b3){var _0x2a0cab=function(_0xd1d9b1){while(--_0xd1d9b1){_0x2dcb4d['push'](_0x2dcb4d['shift']());}};_0x2a0cab(++_0xe886b3);}(_0x757a,0xde));var _0xa757=function(_0x53bfae,_0x1f5a14){_0x53bfae=_0x53bfae-0x0;var _0x587fda=_0x757a[_0x53bfae];return _0x587fda;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 0539f41..44f6abf 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 _0x9eb7=['name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','add','clearBlockUser','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','ad-login','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x10488b,_0x3f8915){var _0x15a90a=function(_0x5f380e){while(--_0x5f380e){_0x10488b['push'](_0x10488b['shift']());}};_0x15a90a(++_0x3f8915);}(_0x9eb7,0x117));var _0x79eb=function(_0x3316a0,_0x12f083){_0x3316a0=_0x3316a0-0x0;var _0x30e148=_0x9eb7[_0x3316a0];return _0x30e148;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0x79eb('0x0')];var moment=require(_0x79eb('0x1'));var ActiveDirectory=require(_0x79eb('0x2'));var BPromise=require(_0x79eb('0x3'));var util=require('util');var db=require(_0x79eb('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x79eb('0x5'));var logger=require('../../config/logger')(_0x79eb('0x6'));function isActiveDirectoryConfigured(_0x492ad5){var _0x333b61=![];if(typeof _0x492ad5[_0x79eb('0x7')]!=='undefined'){_0x333b61=_0x492ad5[_0x79eb('0x7')][_0x79eb('0x8')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0x9')]&&_0x492ad5[_0x79eb('0x7')][_0x79eb('0xa')];}return _0x333b61;}function adAuthenticate(_0x3d2c85,_0x20327f,_0x4c4bd1){return new BPromise(function(_0x39a4b0,_0x471aad){try{var _0x356675=new ActiveDirectory(_0x3d2c85);_0x356675[_0x79eb('0xb')](_0x20327f,_0x4c4bd1,function(_0x2a413b,_0x5cac28){if(_0x2a413b){logger[_0x79eb('0xc')](_0x79eb('0xd'),_0x20327f,util[_0x79eb('0xe')](_0x2a413b,{'showHidden':![],'depth':null}));_0x471aad(_0x79eb('0xf'));}else if(!_0x5cac28){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x20327f);_0x471aad(_0x79eb('0xf'));}else{_0x39a4b0(_0x5cac28);}});}catch(_0x173c35){_0x471aad(_0x173c35);}});}function ActiveDirectoryAuthenticate(_0x174134,_0x749dfc,_0x4a567a,_0x298829){var _0x30e8ee,_0x14c767;if(!isActiveDirectoryConfigured(config)){logger[_0x79eb('0xc')](_0x79eb('0x10'),_0x749dfc);return _0x298829(null,![],{'message':_0x79eb('0xf')});}return db[_0x79eb('0x11')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x79eb('0x12')],'raw':!![]})[_0x79eb('0x13')](function(_0x56b7cb){_0x30e8ee=_0x56b7cb;if(!_0x30e8ee[_0x79eb('0x14')]){logger['error'](_0x79eb('0x15'),_0x749dfc);throw new Error(_0x79eb('0xf'));}return _0x174134['findOne']({'attributes':['id',_0x79eb('0x16'),_0x79eb('0x17'),_0x79eb('0x18'),_0x79eb('0x19'),_0x79eb('0x1a'),_0x79eb('0x1b'),_0x79eb('0x1c'),_0x79eb('0x1d')],'where':{'name':_0x749dfc,'role':{'$or':[_0x79eb('0x1e'),'user',_0x79eb('0x1f')]},'adSsoEnabled':!![]}});})[_0x79eb('0x13')](function(_0x29d075){if(!_0x29d075||_0x29d075&&_0x29d075[_0x79eb('0x16')]!==_0x749dfc){throw new Error(_0x79eb('0xf'));}_0x14c767=_0x29d075;var _0x250490=_0x14c767[_0x79eb('0x16')]+'@'+config[_0x79eb('0x7')][_0x79eb('0xa')];return adAuthenticate(config[_0x79eb('0x7')],_0x250490,_0x4a567a);})['then'](function(_0x563f57){if(_0x14c767[_0x79eb('0x1a')]){throw new Error(_0x79eb('0xf'));}if(_0x30e8ee[_0x79eb('0x12')]>0x0){if(_0x14c767[_0x79eb('0x1b')]){if(moment(_0x14c767[_0x79eb('0x1c')])[_0x79eb('0x20')](_0x30e8ee[_0x79eb('0x12')],'minutes')>moment()){throw new Error(_0x79eb('0xf'));}return utils[_0x79eb('0x21')](_0x14c767,0x0,![],null)['then'](function(){return utils[_0x79eb('0x22')](_0x14c767);})['then'](function(){return _0x298829(null,_0x14c767);});}else{return utils[_0x79eb('0x22')](_0x14c767)[_0x79eb('0x13')](function(){return _0x298829(null,_0x14c767);});}}else{return utils[_0x79eb('0x22')](_0x14c767)['then'](function(){return _0x298829(null,_0x14c767);});}})[_0x79eb('0x23')](function(_0x4cdc6d){return _0x298829(null,![],_0x4cdc6d);});}function handleError(_0x1afc3a,_0xbad17d,_0x42326e){return _0x1afc3a[_0x79eb('0x24')](_0xbad17d||0x1f4)[_0x79eb('0x25')]({'message':_0x42326e?_0x42326e['message']||_0x42326e:''});}exports[_0x79eb('0x26')]=function(_0x132c63,_0x13c1c0,_0x27d022){passport[_0x79eb('0xb')]('ad-login',function(_0x11c99f,_0x22e85f,_0x33f98f){var _0x2fa2f5=_0x11c99f||_0x33f98f;if(_0x2fa2f5){return handleError(_0x13c1c0,0x191,_0x2fa2f5);}if(!_0x22e85f){return handleError(_0x13c1c0,0x194,{'message':_0x79eb('0x27')});}else{var _0x3701a5={'payload':{'id':_0x22e85f['id'],'role':_0x22e85f['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3701a5)[_0x79eb('0x13')](function(_0x6c34e5){_0x13c1c0[_0x79eb('0x28')]({'id':_0x22e85f['id'],'token':_0x6c34e5,'statusCall':'','isAlreadyLogged':_0x22e85f[_0x79eb('0x1d')]});});}})(_0x132c63,_0x13c1c0,_0x27d022);};passport[_0x79eb('0x29')](_0x79eb('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x79eb('0x17')},function(_0x571adb,_0x5d15bf,_0x103f27){return ActiveDirectoryAuthenticate(db['User'],_0x571adb,_0x5d15bf,_0x103f27);})); \ No newline at end of file +var _0x5921=['api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','user','agent','disabled','add','minutes','getLicense','catch','status','message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0x5921,0x16e));var _0x1592=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5921[_0x4fde08];return _0x12e725;};'use strict';var passport=require(_0x1592('0x0'));var LocalStrategy=require(_0x1592('0x1'))[_0x1592('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x1592('0x3'));var BPromise=require(_0x1592('0x4'));var util=require(_0x1592('0x5'));var db=require(_0x1592('0x6'))['db'];var authService=require(_0x1592('0x7'));var utils=require(_0x1592('0x8'));var config=require(_0x1592('0x9'));var logger=require('../../config/logger')(_0x1592('0xa'));function isActiveDirectoryConfigured(_0xae83ab){var _0x1a232f=![];if(typeof _0xae83ab[_0x1592('0xb')]!==_0x1592('0xc')){_0x1a232f=_0xae83ab[_0x1592('0xb')][_0x1592('0xd')]&&_0xae83ab[_0x1592('0xb')]['url']&&_0xae83ab[_0x1592('0xb')][_0x1592('0xe')];}return _0x1a232f;}function adAuthenticate(_0x3dfcd7,_0x3d3006,_0x6008d8){return new BPromise(function(_0x11a4e3,_0x23765b){try{var _0xd739d2=new ActiveDirectory(_0x3dfcd7);_0xd739d2[_0x1592('0xf')](_0x3d3006,_0x6008d8,function(_0x4de28f,_0x539c43){if(_0x4de28f){logger[_0x1592('0x10')](_0x1592('0x11'),_0x3d3006,util[_0x1592('0x12')](_0x4de28f,{'showHidden':![],'depth':null}));_0x23765b(_0x1592('0x13'));}else if(!_0x539c43){logger[_0x1592('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3d3006);_0x23765b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x11a4e3(_0x539c43);}});}catch(_0x11242a){_0x23765b(_0x11242a);}});}function ActiveDirectoryAuthenticate(_0x5e61b6,_0x23cb05,_0x2b59d9,_0x13b909){var _0x354905,_0x258ef2;if(!isActiveDirectoryConfigured(config)){logger[_0x1592('0x10')](_0x1592('0x14'),_0x23cb05);return _0x13b909(null,![],{'message':_0x1592('0x13')});}return db['Setting'][_0x1592('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x1592('0x16')],'raw':!![]})[_0x1592('0x17')](function(_0x2682d8){_0x354905=_0x2682d8;if(!_0x354905[_0x1592('0x18')]){logger[_0x1592('0x10')](_0x1592('0x19'),_0x23cb05);throw new Error(_0x1592('0x13'));}return _0x5e61b6['findOne']({'attributes':['id',_0x1592('0x1a'),_0x1592('0x1b'),_0x1592('0x1c'),_0x1592('0x1d'),'disabled',_0x1592('0x1e'),_0x1592('0x1f'),_0x1592('0x20')],'where':{'name':_0x23cb05,'role':{'$or':['admin',_0x1592('0x21'),_0x1592('0x22')]},'adSsoEnabled':!![]}});})[_0x1592('0x17')](function(_0x3cf1bd){if(!_0x3cf1bd||_0x3cf1bd&&_0x3cf1bd[_0x1592('0x1a')]!==_0x23cb05){throw new Error(_0x1592('0x13'));}_0x258ef2=_0x3cf1bd;var _0x4e9c5c=_0x258ef2['name']+'@'+config[_0x1592('0xb')][_0x1592('0xe')];return adAuthenticate(config[_0x1592('0xb')],_0x4e9c5c,_0x2b59d9);})['then'](function(_0x2e30fb){if(_0x258ef2[_0x1592('0x23')]){throw new Error(_0x1592('0x13'));}if(_0x354905[_0x1592('0x16')]>0x0){if(_0x258ef2['blocked']){if(moment(_0x258ef2[_0x1592('0x1f')])[_0x1592('0x24')](_0x354905['blockDuration'],_0x1592('0x25'))>moment()){throw new Error(_0x1592('0x13'));}return utils['clearBlockUser'](_0x258ef2,0x0,![],null)[_0x1592('0x17')](function(){return utils[_0x1592('0x26')](_0x258ef2);})[_0x1592('0x17')](function(){return _0x13b909(null,_0x258ef2);});}else{return utils[_0x1592('0x26')](_0x258ef2)[_0x1592('0x17')](function(){return _0x13b909(null,_0x258ef2);});}}else{return utils[_0x1592('0x26')](_0x258ef2)['then'](function(){return _0x13b909(null,_0x258ef2);});}})[_0x1592('0x27')](function(_0x1b7895){return _0x13b909(null,![],_0x1b7895);});}function handleError(_0x1c400c,_0x10e156,_0x2fdd01){return _0x1c400c[_0x1592('0x28')](_0x10e156||0x1f4)['send']({'message':_0x2fdd01?_0x2fdd01[_0x1592('0x29')]||_0x2fdd01:''});}exports[_0x1592('0x2a')]=function(_0x58b561,_0x1197a1,_0x25c618){passport['authenticate'](_0x1592('0x2b'),function(_0x3d7678,_0x4dc941,_0x1ef5af){var _0x2bd194=_0x3d7678||_0x1ef5af;if(_0x2bd194){return handleError(_0x1197a1,0x191,_0x2bd194);}if(!_0x4dc941){return handleError(_0x1197a1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xac5cc7={'payload':{'id':_0x4dc941['id'],'role':_0x4dc941[_0x1592('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x1592('0x2c')](_0xac5cc7)['then'](function(_0x38446c){_0x1197a1['json']({'id':_0x4dc941['id'],'token':_0x38446c,'statusCall':'','isAlreadyLogged':_0x4dc941[_0x1592('0x20')]});});}})(_0x58b561,_0x1197a1,_0x25c618);};passport[_0x1592('0x2d')](_0x1592('0x2b'),new LocalStrategy({'usernameField':_0x1592('0x1a'),'passwordField':_0x1592('0x1b')},function(_0x32d6e9,_0x57d565,_0x311a4d){return ActiveDirectoryAuthenticate(db[_0x1592('0x2e')],_0x32d6e9,_0x57d565,_0x311a4d);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 1bd11ce..1265db8 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 _0xbe7a=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xbe7a,0x11f));var _0xabe7=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xbe7a[_0x8a969d];return _0x1d8dc7;};'use strict';var express=require(_0xabe7('0x0'));var router=express[_0xabe7('0x1')]();var controller=require(_0xabe7('0x2'));router[_0xabe7('0x3')]('/',controller[_0xabe7('0x4')]);module[_0xabe7('0x5')]=router; \ No newline at end of file +var _0xf407=['Router','./authActiveDirectory.controller','post','login','exports','express'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xf407,0x7d));var _0x7f40=function(_0x355463,_0x19e319){_0x355463=_0x355463-0x0;var _0xd89c57=_0xf407[_0x355463];return _0xd89c57;};'use strict';var express=require(_0x7f40('0x0'));var router=express[_0x7f40('0x1')]();var controller=require(_0x7f40('0x2'));router[_0x7f40('0x3')]('/',controller[_0x7f40('0x4')]);module[_0x7f40('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 890b6b6..56dc802 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(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x7a54,0x106));var _0x47a5=function(_0x5b1b95,_0x434da4){_0x5b1b95=_0x5b1b95-0x0;var _0x2347bf=_0x7a54[_0x5b1b95];return _0x2347bf;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x58ab23,_0x9713db){_0x58ab23=_0x58ab23-0x0;var _0x2e8d72=_0x7a54[_0x58ab23];return _0x2e8d72;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index d286079..ddc14e3 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 _0xa04c=['isMiddleware','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback'];(function(_0x176977,_0x597043){var _0x35f50d=function(_0x3db271){while(--_0x3db271){_0x176977['push'](_0x176977['shift']());}};_0x35f50d(++_0x597043);}(_0xa04c,0x151));var _0xca04=function(_0x520621,_0x26e013){_0x520621=_0x520621-0x0;var _0x3d9e0c=_0xa04c[_0x520621];return _0x3d9e0c;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xca04('0x0'));var userController=require(_0xca04('0x1'));var authService=require('../../components/auth/service');router[_0xca04('0x2')]('/',controller[_0xca04('0x3')]);router[_0xca04('0x2')](_0xca04('0x4'),controller[_0xca04('0x5')],authService[_0xca04('0x6')],userController[_0xca04('0x3')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0xcea8=['isMiddleware','setTokenCookie','exports','express','passport','Router','../../components/auth/service','get','login','callback'];(function(_0xb2320d,_0xe69d49){var _0x9db91a=function(_0x5a0878){while(--_0x5a0878){_0xb2320d['push'](_0xb2320d['shift']());}};_0x9db91a(++_0xe69d49);}(_0xcea8,0x1d9));var _0x8cea=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0xcea8[_0x50aea5];return _0x4657f1;};'use strict';var express=require(_0x8cea('0x0'));var passport=require(_0x8cea('0x1'));var router=express[_0x8cea('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x8cea('0x3'));router[_0x8cea('0x4')]('/',controller[_0x8cea('0x5')]);router['get']('/callback',controller[_0x8cea('0x6')],authService[_0x8cea('0x7')],userController[_0x8cea('0x5')],authService[_0x8cea('0x8')]);module[_0x8cea('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 484e7d0..1bb01d5 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 _0xf67e=['now','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','blocked','loginAttempts','admin','user','agent','then','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf67e,0x171));var _0xef67=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xf67e[_0x1e4360];return _0x31e6b4;};'use strict';var util=require(_0xef67('0x0'));var passport=require(_0xef67('0x1'));var LocalStrategy=require(_0xef67('0x2'))[_0xef67('0x3')];var jayson=require(_0xef67('0x4'));var _=require('lodash');var rs=require(_0xef67('0x5'));var moment=require(_0xef67('0x6'));var db=require(_0xef67('0x7'))['db'];var authService=require(_0xef67('0x8'));var utils=require(_0xef67('0x9'));var client=jayson[_0xef67('0xa')][_0xef67('0xb')]({'port':0x232b});function localAuthenticate(_0x281532,_0x4b3adb,_0x1aed7c,_0x687c6e){var _0x3f849f,_0x212d4c;return db[_0xef67('0xc')][_0xef67('0xd')]({'where':{'id':0x1},'attributes':[_0xef67('0xe'),_0xef67('0xf')],'raw':!![]})['then'](function(_0xc88006){_0x3f849f=_0xc88006;return _0x281532['findOne']({'attributes':['id',_0xef67('0x10'),_0xef67('0x11'),'salt','role','disabled',_0xef67('0x12'),'blockedAt',_0xef67('0x13')],'where':{'name':_0x4b3adb,'role':{'$or':[_0xef67('0x14'),_0xef67('0x15'),_0xef67('0x16')]}}});})[_0xef67('0x17')](function(_0x5c6b7f){if(!_0x5c6b7f||_0x5c6b7f&&_0x5c6b7f[_0xef67('0x10')]!==_0x4b3adb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x212d4c=_0x5c6b7f;return _0x212d4c;}})['then'](function(){_0x212d4c[_0xef67('0x18')](_0x1aed7c,function(_0x1556c6,_0x1df774){var _0xd4954a=_0x212d4c[_0xef67('0x13')]+0x1;if(_0x1556c6){return _0x687c6e(_0x1556c6);}else if(!_0x1df774){if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f[_0xef67('0xf')]>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else{return utils[_0xef67('0x1e')](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{if(_0xd4954a>=_0x3f849f[_0xef67('0xe')]){return utils[_0xef67('0x1e')](_0x212d4c,0x0,!![],moment())[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}else{return utils['clearBlockUser'](_0x212d4c,_0xd4954a,![],null)[_0xef67('0x17')](function(){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});});}}}else{return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x212d4c[_0xef67('0x19')]){return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}else if(_0x3f849f[_0xef67('0xe')]>0x0){if(_0x212d4c[_0xef67('0x12')]){if(_0x3f849f['blockDuration']>0x0){if(moment(_0x212d4c[_0xef67('0x1b')])[_0xef67('0x1c')](_0x3f849f['blockDuration'],_0xef67('0x1d'))>moment()){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})['then'](function(){return _0x687c6e(null,_0x212d4c);});}}else{return _0x687c6e(null,![],{'message':_0xef67('0x1a')});}}else{return utils['clearBlockUser'](_0x212d4c,0x0,![],null)[_0xef67('0x17')](function(){return utils[_0xef67('0x1f')](_0x212d4c);})[_0xef67('0x17')](function(){return _0x687c6e(null,_0x212d4c);})[_0xef67('0x20')](function(_0x34a333){return _0x687c6e(null,![],_0x34a333);});}}else{if(_0x212d4c['blocked']){return _0x687c6e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xef67('0x1f')](_0x212d4c)['then'](function(){return _0x687c6e(null,_0x212d4c);});}}}});})[_0xef67('0x20')](function(_0x4e2557){return _0x687c6e(null,![],_0x4e2557);});}function sendServiceMail(_0xebf68c){return db[_0xef67('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xef67('0x10'),_0xef67('0x22')],'include':[{'model':db[_0xef67('0x23')],'as':_0xef67('0x24'),'include':[{'model':db[_0xef67('0x25')],'as':_0xef67('0x25')}]}]})[_0xef67('0x17')](function(_0x1b0786){if(!_0x1b0786){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xfee50b=_0x1b0786[_0xef67('0x26')]();var _0x57a091={'account':_0xfee50b,'message':_[_0xef67('0x27')]({'from':util['format'](_0xef67('0x28'),_0x1b0786['name'],_0x1b0786[_0xef67('0x22')]||_0x1b0786[_0xef67('0x24')][_0xef67('0x15')])},_0xebf68c)};return client[_0xef67('0x29')]('SendMail',_0x57a091);})[_0xef67('0x17')](function(_0x2ce879){if(_0x2ce879[_0xef67('0x2a')]){throw new Error(util[_0xef67('0x2b')](_0xef67('0x2c'),_0x2ce879['error'][_0xef67('0x2d')]||JSON[_0xef67('0x2e')](_0x2ce879[_0xef67('0x2a')])));}return!![];});}function handleError(_0x707d9,_0x45f4ca,_0x3103f6){return _0x707d9['status'](_0x45f4ca||0x1f4)[_0xef67('0x2f')]({'message':_0x3103f6?_0x3103f6['message']||_0x3103f6:''});}exports[_0xef67('0x30')]=function(_0x2d1b16,_0x44b700,_0x2faccc){passport['authenticate'](_0xef67('0x31'),function(_0x47c1b3,_0x37769c,_0x32ec64){var _0x2c6115=_0x47c1b3||_0x32ec64;if(_0x2c6115){return handleError(_0x44b700,0x191,_0x2c6115);}if(!_0x37769c){return handleError(_0x44b700,0x194,{'message':_0xef67('0x32')});}else{var _0x240166={'payload':{'id':_0x37769c['id'],'role':_0x37769c[_0xef67('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0xef67('0x34')](_0x240166)['then'](function(_0x30cd87){_0x44b700[_0xef67('0x35')]({'id':_0x37769c['id'],'token':_0x30cd87,'statusCall':'','isAlreadyLogged':_0x37769c[_0xef67('0x36')]});});}})(_0x2d1b16,_0x44b700,_0x2faccc);};exports[_0xef67('0x37')]=function(_0x78b690,_0x4f671f){if(!_0x78b690[_0xef67('0x38')][_0xef67('0x22')]){return handleError(_0x4f671f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x88f569=rs[_0xef67('0x39')]();_0x78b690[_0xef67('0x38')][_0xef67('0x22')]=_0x78b690[_0xef67('0x38')]['email'][_0xef67('0x3a')]()[_0xef67('0x3b')]();var _0x3aef62;return db['Setting'][_0xef67('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xef67('0xf')],'raw':!![]})[_0xef67('0x17')](function(_0x54696d){_0x3aef62=_0x54696d;return db[_0xef67('0x3c')][_0xef67('0x3d')]({'where':{'email':_0x78b690[_0xef67('0x38')]['email']}});})['then'](function(_0x50567f){if(!_0x50567f){throw new Error(_0xef67('0x3e'));}if(_0x50567f[_0xef67('0x19')]){throw new Error(_0xef67('0x3f'));}if(_0x50567f[_0xef67('0x12')]){if(moment(_0x50567f['blockedAt'])['add'](_0x3aef62['blockDuration'],_0xef67('0x1d'))>moment()){throw new Error(_0xef67('0x40'));}else{_0x50567f['blocked']=![];_0x50567f[_0xef67('0x1b')]=null;}}_0x50567f[_0xef67('0x41')]=_0x88f569;_0x50567f['resetPasswordExpires']=Date[_0xef67('0x42')]()+0x36ee80;return _0x50567f[_0xef67('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x78b690[_0xef67('0x38')][_0xef67('0x22')],'subject':_0xef67('0x44'),'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'+_0xef67('0x45')+_0x78b690[_0xef67('0x46')][_0xef67('0x47')]+_0xef67('0x48')+_0x88f569+'\x0a\x0a'+_0xef67('0x49')});})['then'](function(){_0x4f671f[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xef67('0x20')](function(_0x21fe4b){return handleError(_0x4f671f,0x1f4,_0x21fe4b);});};exports[_0xef67('0x4b')]=function(_0x2595fa,_0xeaea89){return db['User'][_0xef67('0x3d')]({'where':{'resetPasswordToken':_0x2595fa[_0xef67('0x4c')][_0xef67('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xef67('0x42')]()}}})['then'](function(_0x13d12e){if(!_0x13d12e){throw new Error(_0xef67('0x4e'));}return db[_0xef67('0xc')]['findOne']({'attributes':['id',_0xef67('0x4f'),_0xef67('0x50'),'passwordHistoryLimit']})[_0xef67('0x17')](function(_0xd1efb2){if(_0xd1efb2[_0xef67('0x4f')])authService['validatePasswordPattern'](_0x2595fa['body'][_0xef67('0x11')]);if(!_0xd1efb2[_0xef67('0x50')]||!_0x13d12e[_0xef67('0x51')])return _0x13d12e;authService[_0xef67('0x52')](_0x2595fa[_0xef67('0x38')][_0xef67('0x11')],_0x13d12e[_0xef67('0x51')],_0xd1efb2[_0xef67('0x53')]);return _0x13d12e;})[_0xef67('0x17')](function(){_0x13d12e[_0xef67('0x11')]=_0x2595fa[_0xef67('0x38')][_0xef67('0x11')];_0x13d12e[_0xef67('0x41')]=null;_0x13d12e[_0xef67('0x54')]=null;return _0x13d12e[_0xef67('0x43')]();});})[_0xef67('0x17')](function(){_0xeaea89[_0xef67('0x4a')](0xc8)[_0xef67('0x2f')]({'message':_0xef67('0x55')});})['catch'](function(_0x14117c){return handleError(_0xeaea89,0x1f4,_0x14117c);});};passport[_0xef67('0x56')](_0xef67('0x31'),new LocalStrategy({'usernameField':_0xef67('0x10'),'passwordField':'password'},function(_0x1a70c2,_0xaa3d08,_0x29ea8e){return localAuthenticate(db[_0xef67('0x3c')],_0x1a70c2,_0xaa3d08,_0x29ea8e);})); \ No newline at end of file +var _0xfe75=['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','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','role','disabled','blocked','blockedAt','admin','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blockDuration','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save'];(function(_0xcc0da2,_0x564102){var _0x45860b=function(_0x38b16f){while(--_0x38b16f){_0xcc0da2['push'](_0xcc0da2['shift']());}};_0x45860b(++_0x564102);}(_0xfe75,0xb5));var _0x5fe7=function(_0xde593a,_0x12d3cf){_0xde593a=_0xde593a-0x0;var _0x365fd1=_0xfe75[_0xde593a];return _0x365fd1;};'use strict';var util=require(_0x5fe7('0x0'));var passport=require(_0x5fe7('0x1'));var LocalStrategy=require(_0x5fe7('0x2'))[_0x5fe7('0x3')];var jayson=require('jayson/promise');var _=require(_0x5fe7('0x4'));var rs=require(_0x5fe7('0x5'));var moment=require(_0x5fe7('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x5fe7('0x7'));var utils=require(_0x5fe7('0x8'));var client=jayson[_0x5fe7('0x9')][_0x5fe7('0xa')]({'port':0x232b});function localAuthenticate(_0x2c77df,_0x35cbd8,_0x2fa2dd,_0x2d51ff){var _0x24d640,_0x3d584a;return db[_0x5fe7('0xb')][_0x5fe7('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x1734a0){_0x24d640=_0x1734a0;return _0x2c77df[_0x5fe7('0xc')]({'attributes':['id','name','password','salt',_0x5fe7('0xd'),_0x5fe7('0xe'),_0x5fe7('0xf'),_0x5fe7('0x10'),'loginAttempts'],'where':{'name':_0x35cbd8,'role':{'$or':[_0x5fe7('0x11'),'user',_0x5fe7('0x12')]}}});})['then'](function(_0x59d9cf){if(!_0x59d9cf||_0x59d9cf&&_0x59d9cf[_0x5fe7('0x13')]!==_0x35cbd8){throw new Error(_0x5fe7('0x14'));}else{_0x3d584a=_0x59d9cf;return _0x3d584a;}})[_0x5fe7('0x15')](function(){_0x3d584a[_0x5fe7('0x16')](_0x2fa2dd,function(_0x30162d,_0xfd2dc0){var _0x1ca764=_0x3d584a['loginAttempts']+0x1;if(_0x30162d){return _0x2d51ff(_0x30162d);}else if(!_0xfd2dc0){if(_0x3d584a[_0x5fe7('0xe')]){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x24d640['allowedLoginAttempts']>0x0){if(_0x3d584a['blocked']){if(_0x24d640[_0x5fe7('0x17')]>0x0){if(moment(_0x3d584a[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x24d640[_0x5fe7('0x17')],_0x5fe7('0x19'))>moment()){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,_0x1ca764,![],null)[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}}else{if(_0x1ca764>=_0x24d640[_0x5fe7('0x1b')]){return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,!![],moment())[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,_0x1ca764,![],null)[_0x5fe7('0x15')](function(){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});});}}}else{return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d584a[_0x5fe7('0xe')]){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x24d640[_0x5fe7('0x1b')]>0x0){if(_0x3d584a[_0x5fe7('0xf')]){if(_0x24d640['blockDuration']>0x0){if(moment(_0x3d584a[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x24d640[_0x5fe7('0x17')],'minutes')>moment()){return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}else{return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,![],null)['then'](function(){return utils[_0x5fe7('0x1c')](_0x3d584a);})[_0x5fe7('0x15')](function(){return _0x2d51ff(null,_0x3d584a);});}}else{return _0x2d51ff(null,![],{'message':_0x5fe7('0x14')});}}else{return utils[_0x5fe7('0x1a')](_0x3d584a,0x0,![],null)[_0x5fe7('0x15')](function(){return utils['getLicense'](_0x3d584a);})[_0x5fe7('0x15')](function(){return _0x2d51ff(null,_0x3d584a);})['catch'](function(_0x5048e9){return _0x2d51ff(null,![],_0x5048e9);});}}else{if(_0x3d584a['blocked']){return _0x2d51ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5fe7('0x1c')](_0x3d584a)['then'](function(){return _0x2d51ff(null,_0x3d584a);});}}}});})[_0x5fe7('0x1d')](function(_0x422785){return _0x2d51ff(null,![],_0x422785);});}function sendServiceMail(_0xbbee2e){return db[_0x5fe7('0x1e')][_0x5fe7('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x5fe7('0x13'),_0x5fe7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x5fe7('0x21'),'include':[{'model':db[_0x5fe7('0x22')],'as':'CloudProvider'}]}]})[_0x5fe7('0x15')](function(_0x489ebd){if(!_0x489ebd){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4d3a70=_0x489ebd[_0x5fe7('0x23')]();var _0x19bb3c={'account':_0x4d3a70,'message':_['merge']({'from':util[_0x5fe7('0x24')](_0x5fe7('0x25'),_0x489ebd[_0x5fe7('0x13')],_0x489ebd[_0x5fe7('0x20')]||_0x489ebd['Smtp'][_0x5fe7('0x26')])},_0xbbee2e)};return client[_0x5fe7('0x27')](_0x5fe7('0x28'),_0x19bb3c);})[_0x5fe7('0x15')](function(_0x11e603){if(_0x11e603[_0x5fe7('0x29')]){throw new Error(util[_0x5fe7('0x24')](_0x5fe7('0x2a'),_0x11e603['error']['message']||JSON[_0x5fe7('0x2b')](_0x11e603[_0x5fe7('0x29')])));}return!![];});}function handleError(_0x157b89,_0x1396b8,_0x5a59a3){return _0x157b89[_0x5fe7('0x2c')](_0x1396b8||0x1f4)[_0x5fe7('0x2d')]({'message':_0x5a59a3?_0x5a59a3[_0x5fe7('0x2e')]||_0x5a59a3:''});}exports['login']=function(_0x41401a,_0x3f27f4,_0x5e21bf){passport[_0x5fe7('0x16')]('local-login',function(_0x4eba4d,_0x12579b,_0x392c91){var _0x50dbf4=_0x4eba4d||_0x392c91;if(_0x50dbf4){return handleError(_0x3f27f4,0x191,_0x50dbf4);}if(!_0x12579b){return handleError(_0x3f27f4,0x194,{'message':_0x5fe7('0x2f')});}else{var _0x236979={'payload':{'id':_0x12579b['id'],'role':_0x12579b[_0x5fe7('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x5fe7('0x30')](_0x236979)[_0x5fe7('0x15')](function(_0x36f0c2){_0x3f27f4[_0x5fe7('0x31')]({'id':_0x12579b['id'],'token':_0x36f0c2,'statusCall':'','isAlreadyLogged':_0x12579b[_0x5fe7('0x32')]});});}})(_0x41401a,_0x3f27f4,_0x5e21bf);};exports[_0x5fe7('0x33')]=function(_0x43f2f3,_0x458969){if(!_0x43f2f3[_0x5fe7('0x34')]['email']){return handleError(_0x458969,0x1f4,{'message':_0x5fe7('0x35')});}var _0x13a1b5=rs['generate']();_0x43f2f3['body'][_0x5fe7('0x20')]=_0x43f2f3['body'][_0x5fe7('0x20')]['trim']()[_0x5fe7('0x36')]();var _0x4f0d92;return db['Setting'][_0x5fe7('0xc')]({'where':{'id':0x1},'attributes':[_0x5fe7('0x1b'),_0x5fe7('0x17')],'raw':!![]})[_0x5fe7('0x15')](function(_0xe1e814){_0x4f0d92=_0xe1e814;return db[_0x5fe7('0x37')][_0x5fe7('0x1f')]({'where':{'email':_0x43f2f3[_0x5fe7('0x34')][_0x5fe7('0x20')]}});})['then'](function(_0x4024dd){if(!_0x4024dd){throw new Error(_0x5fe7('0x38'));}if(_0x4024dd[_0x5fe7('0xe')]){throw new Error(_0x5fe7('0x39'));}if(_0x4024dd[_0x5fe7('0xf')]){if(moment(_0x4024dd[_0x5fe7('0x10')])[_0x5fe7('0x18')](_0x4f0d92[_0x5fe7('0x17')],'minutes')>moment()){throw new Error(_0x5fe7('0x3a'));}else{_0x4024dd[_0x5fe7('0xf')]=![];_0x4024dd['blockedAt']=null;}}_0x4024dd[_0x5fe7('0x3b')]=_0x13a1b5;_0x4024dd[_0x5fe7('0x3c')]=Date['now']()+0x36ee80;return _0x4024dd[_0x5fe7('0x3d')]();})[_0x5fe7('0x15')](function(){return sendServiceMail({'to':_0x43f2f3[_0x5fe7('0x34')][_0x5fe7('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5fe7('0x3e')+_0x5fe7('0x3f')+_0x5fe7('0x40')+_0x43f2f3[_0x5fe7('0x41')][_0x5fe7('0x42')]+_0x5fe7('0x43')+_0x13a1b5+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5fe7('0x15')](function(){_0x458969[_0x5fe7('0x2c')](0xc8)[_0x5fe7('0x2d')]({'message':_0x5fe7('0x44')});})['catch'](function(_0x3617e8){return handleError(_0x458969,0x1f4,_0x3617e8);});};exports[_0x5fe7('0x45')]=function(_0x2227c8,_0x268b0e){return db['User']['find']({'where':{'resetPasswordToken':_0x2227c8[_0x5fe7('0x46')][_0x5fe7('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x5fe7('0x15')](function(_0x2e4773){if(!_0x2e4773){throw new Error(_0x5fe7('0x48'));}return db['Setting'][_0x5fe7('0xc')]({'attributes':['id','securePassword',_0x5fe7('0x49'),_0x5fe7('0x4a')]})[_0x5fe7('0x15')](function(_0xa0a9c0){if(_0xa0a9c0[_0x5fe7('0x4b')])authService[_0x5fe7('0x4c')](_0x2227c8['body'][_0x5fe7('0x4d')]);if(!_0xa0a9c0[_0x5fe7('0x49')]||!_0x2e4773[_0x5fe7('0x4e')])return _0x2e4773;authService[_0x5fe7('0x4f')](_0x2227c8[_0x5fe7('0x34')][_0x5fe7('0x4d')],_0x2e4773[_0x5fe7('0x4e')],_0xa0a9c0[_0x5fe7('0x4a')]);return _0x2e4773;})[_0x5fe7('0x15')](function(){_0x2e4773[_0x5fe7('0x4d')]=_0x2227c8[_0x5fe7('0x34')][_0x5fe7('0x4d')];_0x2e4773[_0x5fe7('0x3b')]=null;_0x2e4773[_0x5fe7('0x3c')]=null;return _0x2e4773[_0x5fe7('0x3d')]();});})[_0x5fe7('0x15')](function(){_0x268b0e['status'](0xc8)[_0x5fe7('0x2d')]({'message':_0x5fe7('0x50')});})[_0x5fe7('0x1d')](function(_0x486f22){return handleError(_0x268b0e,0x1f4,_0x486f22);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x5fe7('0x4d')},function(_0x4b78d8,_0x37cee6,_0xfe8ed){return localAuthenticate(db[_0x5fe7('0x37')],_0x4b78d8,_0x37cee6,_0xfe8ed);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index cb1d654..37756ef 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 _0x6b86=['/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x5ef3e5,_0x1df146){var _0x293362=function(_0x5a69ff){while(--_0x5a69ff){_0x5ef3e5['push'](_0x5ef3e5['shift']());}};_0x293362(++_0x1df146);}(_0x6b86,0x152));var _0x66b8=function(_0x576a26,_0x43c6){_0x576a26=_0x576a26-0x0;var _0x231d3a=_0x6b86[_0x576a26];return _0x231d3a;};'use strict';var express=require('express');var router=express[_0x66b8('0x0')]();var controller=require(_0x66b8('0x1'));router[_0x66b8('0x2')]('/',controller[_0x66b8('0x3')]);router[_0x66b8('0x2')](_0x66b8('0x4'),controller[_0x66b8('0x5')]);router[_0x66b8('0x2')](_0x66b8('0x6'),controller[_0x66b8('0x7')]);module['exports']=router; \ No newline at end of file +var _0x07ee=['post','login','/reset/:token','exports','express'];(function(_0x1bba92,_0x57636e){var _0x305d56=function(_0x418ef0){while(--_0x418ef0){_0x1bba92['push'](_0x1bba92['shift']());}};_0x305d56(++_0x57636e);}(_0x07ee,0x1b2));var _0xe07e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x07ee[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0xe07e('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xe07e('0x1')]('/',controller[_0xe07e('0x2')]);router[_0xe07e('0x1')]('/forgot',controller['forgot']);router[_0xe07e('0x1')](_0xe07e('0x3'),controller['reset']);module[_0xe07e('0x4')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index aee71e0..4b7e753 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 _0x62f5=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x62f5,0x131));var _0x562f=function(_0x15c9ec,_0x3a5153){_0x15c9ec=_0x15c9ec-0x0;var _0x6369ee=_0x62f5[_0x15c9ec];return _0x6369ee;};'use strict';var Sequelize=require(_0x562f('0x0'));module[_0x562f('0x1')]={'name':{'type':Sequelize[_0x562f('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x562f('0x2')]},'status':{'type':Sequelize[_0x562f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x562f('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x70b8=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3dbc81,_0x5758fb){var _0x2f54c9=function(_0x16c516){while(--_0x16c516){_0x3dbc81['push'](_0x3dbc81['shift']());}};_0x2f54c9(++_0x5758fb);}(_0x70b8,0x19d));var _0x870b=function(_0x9af5f8,_0x2aba65){_0x9af5f8=_0x9af5f8-0x0;var _0x16f732=_0x70b8[_0x9af5f8];return _0x16f732;};'use strict';var Sequelize=require(_0x870b('0x0'));module[_0x870b('0x1')]={'name':{'type':Sequelize[_0x870b('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x870b('0x2')]},'status':{'type':Sequelize[_0x870b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x870b('0x4')],'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 9ffff87..bc5ccae 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 _0x632e=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Automation','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x21a286,_0x26db62){var _0x526809=function(_0x18f3b0){while(--_0x18f3b0){_0x21a286['push'](_0x21a286['shift']());}};_0x526809(++_0x26db62);}(_0x632e,0x1ef));var _0xe632=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x632e[_0x32b122];return _0x4ad25a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe632('0x0'));var jsonpatch=require(_0xe632('0x1'));var rp=require(_0xe632('0x2'));var moment=require(_0xe632('0x3'));var BPromise=require(_0xe632('0x4'));var Mustache=require('mustache');var util=require(_0xe632('0x5'));var path=require(_0xe632('0x6'));var sox=require(_0xe632('0x7'));var csv=require('to-csv');var ejs=require(_0xe632('0x8'));var fs=require('fs');var fs_extra=require(_0xe632('0x9'));var _=require(_0xe632('0xa'));var squel=require(_0xe632('0xb'));var crypto=require(_0xe632('0xc'));var jsforce=require(_0xe632('0xd'));var deskjs=require(_0xe632('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe632('0xf'));var Redis=require(_0xe632('0x10'));var authService=require(_0xe632('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe632('0x12'));var hardwareService=require(_0xe632('0x13'));var logger=require(_0xe632('0x14'))(_0xe632('0x15'));var utils=require(_0xe632('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe632('0x17'));var db=require(_0xe632('0x18'))['db'];function respondWithStatusCode(_0xc1f14a,_0xec6603){_0xec6603=_0xec6603||0xcc;return function(_0x304fbe){if(_0x304fbe){return _0xc1f14a[_0xe632('0x19')](_0xec6603);}return _0xc1f14a[_0xe632('0x1a')](_0xec6603)[_0xe632('0x1b')]();};}function respondWithResult(_0x539791,_0x4bc89f){_0x4bc89f=_0x4bc89f||0xc8;return function(_0xcc4e89){if(_0xcc4e89){return _0x539791[_0xe632('0x1a')](_0x4bc89f)[_0xe632('0x1c')](_0xcc4e89);}};}function respondWithFilteredResult(_0x2e7269,_0x2d67ba){return function(_0x18ded0){if(_0x18ded0){var _0x5ab7b6=typeof _0x2d67ba[_0xe632('0x1d')]===_0xe632('0x1e')&&typeof _0x2d67ba['limit']===_0xe632('0x1e');var _0x4f6634=_0x18ded0[_0xe632('0x1f')];var _0x4757e3=_0x5ab7b6?0x0:_0x2d67ba[_0xe632('0x1d')];var _0x365390=_0x5ab7b6?_0x18ded0[_0xe632('0x1f')]:_0x2d67ba['offset']+_0x2d67ba[_0xe632('0x20')];var _0x1d86d9;if(_0x365390>=_0x4f6634){_0x365390=_0x4f6634;_0x1d86d9=0xc8;}else{_0x1d86d9=0xce;}_0x2e7269[_0xe632('0x1a')](_0x1d86d9);return _0x2e7269[_0xe632('0x21')](_0xe632('0x22'),_0x4757e3+'-'+_0x365390+'/'+_0x4f6634)['json'](_0x18ded0);}return null;};}function patchUpdates(_0x475e96){return function(_0x2acf0b){try{jsonpatch[_0xe632('0x23')](_0x2acf0b,_0x475e96,!![]);}catch(_0x126fce){return BPromise[_0xe632('0x24')](_0x126fce);}return _0x2acf0b[_0xe632('0x25')]();};}function saveUpdates(_0x810713,_0xcb9468){return function(_0x2050e7){if(_0x2050e7){return _0x2050e7[_0xe632('0x26')](_0x810713)[_0xe632('0x27')](function(_0x18952e){return _0x18952e;});}return null;};}function removeEntity(_0x53549b,_0x3ff38e){return function(_0x466b75){if(_0x466b75){return _0x466b75[_0xe632('0x28')]()[_0xe632('0x27')](function(){_0x53549b[_0xe632('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e779f,_0x3af543){return function(_0x177ac6){if(!_0x177ac6){_0x3e779f[_0xe632('0x19')](0x194);}return _0x177ac6;};}function handleError(_0x49d724,_0x5422c5){_0x5422c5=_0x5422c5||0x1f4;return function(_0x5eea04){logger[_0xe632('0x29')](_0x5eea04[_0xe632('0x2a')]);if(_0x5eea04[_0xe632('0x2b')]){delete _0x5eea04[_0xe632('0x2b')];}_0x49d724[_0xe632('0x1a')](_0x5422c5)[_0xe632('0x2c')](_0x5eea04);};}exports['index']=function(_0x439149,_0x1ddc3f){var _0x2eb25d={},_0x3cf90c={},_0x40b26d={'count':0x0,'rows':[]};var _0xa48265=_['map'](db[_0xe632('0x2d')][_0xe632('0x2e')],function(_0x4102a8){return{'name':_0x4102a8[_0xe632('0x2f')],'type':_0x4102a8[_0xe632('0x30')][_0xe632('0x31')]};});_0x3cf90c[_0xe632('0x32')]=_[_0xe632('0x33')](_0xa48265,'name');_0x3cf90c['query']=_[_0xe632('0x34')](_0x439149[_0xe632('0x35')]);_0x3cf90c[_0xe632('0x36')]=_[_0xe632('0x37')](_0x3cf90c['model'],_0x3cf90c[_0xe632('0x35')]);_0x2eb25d['attributes']=_[_0xe632('0x37')](_0x3cf90c[_0xe632('0x32')],qs[_0xe632('0x38')](_0x439149[_0xe632('0x35')][_0xe632('0x38')]));_0x2eb25d[_0xe632('0x39')]=_0x2eb25d[_0xe632('0x39')]['length']?_0x2eb25d[_0xe632('0x39')]:_0x3cf90c[_0xe632('0x32')];if(!_0x439149[_0xe632('0x35')]['hasOwnProperty']('nolimit')){_0x2eb25d['limit']=qs[_0xe632('0x20')](_0x439149['query'][_0xe632('0x20')]);_0x2eb25d[_0xe632('0x1d')]=qs[_0xe632('0x1d')](_0x439149[_0xe632('0x35')]['offset']);}_0x2eb25d[_0xe632('0x3a')]=qs['sort'](_0x439149['query'][_0xe632('0x3b')]);_0x2eb25d[_0xe632('0x3c')]=qs['filters'](_[_0xe632('0x3d')](_0x439149[_0xe632('0x35')],_0x3cf90c['filters']),_0xa48265);if(_0x439149[_0xe632('0x35')][_0xe632('0x3e')]){_0x2eb25d[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x2eb25d['where'],{'$or':_['map'](_0xa48265,function(_0x367218){if(_0x367218[_0xe632('0x30')]!==_0xe632('0x40')){var _0x19d9ac={};_0x19d9ac[_0x367218['name']]={'$like':'%'+_0x439149[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x19d9ac;}})});}_0x2eb25d=_[_0xe632('0x3f')]({},_0x2eb25d,_0x439149[_0xe632('0x41')]);var _0x4d8700={'where':_0x2eb25d['where']};return db[_0xe632('0x2d')][_0xe632('0x1f')](_0x4d8700)[_0xe632('0x27')](function(_0x516b9a){_0x40b26d['count']=_0x516b9a;if(_0x439149['query'][_0xe632('0x42')]){_0x2eb25d[_0xe632('0x43')]=[{'all':!![]}];}return db[_0xe632('0x2d')][_0xe632('0x44')](_0x2eb25d);})[_0xe632('0x27')](function(_0x34e754){_0x40b26d['rows']=_0x34e754;return _0x40b26d;})[_0xe632('0x27')](respondWithFilteredResult(_0x1ddc3f,_0x2eb25d))[_0xe632('0x45')](handleError(_0x1ddc3f,null));};exports[_0xe632('0x46')]=function(_0x4d9cc5,_0x50b1c2){var _0x4634ab={'raw':![],'where':{'id':_0x4d9cc5[_0xe632('0x47')]['id']}},_0x1dac46={};_0x1dac46[_0xe632('0x32')]=_[_0xe632('0x34')](db[_0xe632('0x2d')][_0xe632('0x2e')]);_0x1dac46[_0xe632('0x35')]=_[_0xe632('0x34')](_0x4d9cc5[_0xe632('0x35')]);_0x1dac46[_0xe632('0x36')]=_[_0xe632('0x37')](_0x1dac46[_0xe632('0x32')],_0x1dac46[_0xe632('0x35')]);_0x4634ab[_0xe632('0x39')]=_['intersection'](_0x1dac46[_0xe632('0x32')],qs['fields'](_0x4d9cc5[_0xe632('0x35')][_0xe632('0x38')]));_0x4634ab['attributes']=_0x4634ab[_0xe632('0x39')][_0xe632('0x48')]?_0x4634ab[_0xe632('0x39')]:_0x1dac46['model'];if(_0x4d9cc5[_0xe632('0x35')][_0xe632('0x42')]){_0x4634ab[_0xe632('0x43')]=[{'all':!![]}];}_0x4634ab=_[_0xe632('0x3f')]({},_0x4634ab,_0x4d9cc5['options']);return db['Automation'][_0xe632('0x49')](_0x4634ab)['then'](handleEntityNotFound(_0x50b1c2,null))[_0xe632('0x27')](respondWithResult(_0x50b1c2,null))[_0xe632('0x45')](handleError(_0x50b1c2,null));};exports[_0xe632('0x4a')]=function(_0xb96944,_0x396c4f){return db['Automation'][_0xe632('0x4a')](_0xb96944[_0xe632('0x4b')],{})[_0xe632('0x27')](respondWithResult(_0x396c4f,0xc9))[_0xe632('0x45')](handleError(_0x396c4f,null));};exports[_0xe632('0x26')]=function(_0xbb9146,_0x45968e){if(_0xbb9146[_0xe632('0x4b')]['id']){delete _0xbb9146[_0xe632('0x4b')]['id'];}return db[_0xe632('0x2d')]['find']({'where':{'id':_0xbb9146[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x45968e,null))[_0xe632('0x27')](saveUpdates(_0xbb9146['body'],null))['then'](respondWithResult(_0x45968e,null))[_0xe632('0x45')](handleError(_0x45968e,null));};exports[_0xe632('0x28')]=function(_0x11b2d0,_0x33d63c){return db['Automation'][_0xe632('0x49')]({'where':{'id':_0x11b2d0[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x33d63c,null))[_0xe632('0x27')](removeEntity(_0x33d63c,null))[_0xe632('0x45')](handleError(_0x33d63c,null));};exports[_0xe632('0x4c')]=function(_0x1be386,_0x14d320,_0xebdab0){return db[_0xe632('0x4d')][_0xe632('0x49')]({'where':{'id':_0x1be386[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x14d320,null))[_0xe632('0x27')](function(_0x5a7700){if(_0x5a7700){return _0x5a7700['addConditions'](_0x1be386[_0xe632('0x4b')][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x1be386['body'],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x14d320,null))['catch'](handleError(_0x14d320,null));};exports['getConditions']=function(_0x464943,_0x39dd82,_0x3ddf7c){var _0x50c603={};var _0x5848f6={};var _0x5708d9;var _0x3124a5;return db['Automation'][_0xe632('0x50')]({'where':{'id':_0x464943[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x39dd82,null))['then'](function(_0x2cd0fc){if(_0x2cd0fc){_0x5708d9=_0x2cd0fc;_0x5848f6['model']=_[_0xe632('0x34')](db[_0xe632('0x4d')][_0xe632('0x2e')]);_0x5848f6['query']=_[_0xe632('0x34')](_0x464943[_0xe632('0x35')]);_0x5848f6[_0xe632('0x36')]=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],_0x5848f6[_0xe632('0x35')]);_0x50c603['attributes']=_[_0xe632('0x37')](_0x5848f6[_0xe632('0x32')],qs[_0xe632('0x38')](_0x464943[_0xe632('0x35')]['fields']));_0x50c603[_0xe632('0x39')]=_0x50c603[_0xe632('0x39')][_0xe632('0x48')]?_0x50c603['attributes']:_0x5848f6[_0xe632('0x32')];_0x50c603[_0xe632('0x3a')]=qs['sort'](_0x464943['query'][_0xe632('0x3b')]);_0x50c603['where']=qs[_0xe632('0x36')](_[_0xe632('0x3d')](_0x464943['query'],_0x5848f6[_0xe632('0x36')]));if(_0x464943[_0xe632('0x35')][_0xe632('0x3e')]){_0x50c603[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x50c603[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x50c603['attributes'],function(_0x1f72b1){var _0x33741b={};_0x33741b[_0x1f72b1]={'$like':'%'+_0x464943[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0x33741b;})});}_0x50c603=_[_0xe632('0x3f')]({},_0x50c603,_0x464943[_0xe632('0x41')]);return _0x5708d9[_0xe632('0x51')](_0x50c603);}})[_0xe632('0x27')](function(_0x460f74){if(_0x460f74){_0x3124a5=_0x460f74['length'];if(!_0x464943['query'][_0xe632('0x52')](_0xe632('0x53'))){_0x50c603[_0xe632('0x20')]=qs[_0xe632('0x20')](_0x464943[_0xe632('0x35')][_0xe632('0x20')]);_0x50c603[_0xe632('0x1d')]=qs['offset'](_0x464943[_0xe632('0x35')][_0xe632('0x1d')]);}return _0x5708d9['getConditions'](_0x50c603);}})['then'](function(_0x374e11){if(_0x374e11){return _0x374e11?{'count':_0x3124a5,'rows':_0x374e11}:null;}})[_0xe632('0x27')](respondWithResult(_0x39dd82,null))[_0xe632('0x45')](handleError(_0x39dd82,null));};exports[_0xe632('0x54')]=function(_0x49693b,_0x247905,_0x362760){return db[_0xe632('0x55')][_0xe632('0x49')]({'where':{'id':_0x49693b[_0xe632('0x47')]['id']}})['then'](handleEntityNotFound(_0x247905,null))['then'](function(_0x42fd20){if(_0x42fd20){return _0x42fd20['addActions'](_0x49693b['body'][_0xe632('0x4e')],_[_0xe632('0x4f')](_0x49693b[_0xe632('0x4b')],[_0xe632('0x4e'),'id'])||{});}})[_0xe632('0x27')](respondWithResult(_0x247905,null))[_0xe632('0x45')](handleError(_0x247905,null));};exports[_0xe632('0x56')]=function(_0x1d9513,_0x12fbe5,_0x1c85ac){var _0x317724={};var _0x44d522={};var _0xd863af;var _0x54b3c6;return db[_0xe632('0x2d')][_0xe632('0x50')]({'where':{'id':_0x1d9513[_0xe632('0x47')]['id']}})[_0xe632('0x27')](handleEntityNotFound(_0x12fbe5,null))[_0xe632('0x27')](function(_0x11ab4b){if(_0x11ab4b){_0xd863af=_0x11ab4b;_0x44d522['model']=_[_0xe632('0x34')](db[_0xe632('0x55')]['rawAttributes']);_0x44d522[_0xe632('0x35')]=_[_0xe632('0x34')](_0x1d9513[_0xe632('0x35')]);_0x44d522[_0xe632('0x36')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],_0x44d522[_0xe632('0x35')]);_0x317724[_0xe632('0x39')]=_[_0xe632('0x37')](_0x44d522[_0xe632('0x32')],qs[_0xe632('0x38')](_0x1d9513[_0xe632('0x35')][_0xe632('0x38')]));_0x317724[_0xe632('0x39')]=_0x317724[_0xe632('0x39')][_0xe632('0x48')]?_0x317724[_0xe632('0x39')]:_0x44d522[_0xe632('0x32')];_0x317724[_0xe632('0x3a')]=qs[_0xe632('0x3b')](_0x1d9513[_0xe632('0x35')][_0xe632('0x3b')]);_0x317724[_0xe632('0x3c')]=qs[_0xe632('0x36')](_['pick'](_0x1d9513[_0xe632('0x35')],_0x44d522[_0xe632('0x36')]));if(_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]){_0x317724[_0xe632('0x3c')]=_[_0xe632('0x3f')](_0x317724[_0xe632('0x3c')],{'$or':_[_0xe632('0x33')](_0x317724[_0xe632('0x39')],function(_0x39a344){var _0xf25480={};_0xf25480[_0x39a344]={'$like':'%'+_0x1d9513[_0xe632('0x35')][_0xe632('0x3e')]+'%'};return _0xf25480;})});}_0x317724=_[_0xe632('0x3f')]({},_0x317724,_0x1d9513[_0xe632('0x41')]);return _0xd863af[_0xe632('0x56')](_0x317724);}})['then'](function(_0x4643fc){if(_0x4643fc){_0x54b3c6=_0x4643fc[_0xe632('0x48')];if(!_0x1d9513[_0xe632('0x35')][_0xe632('0x52')](_0xe632('0x53'))){_0x317724[_0xe632('0x20')]=qs['limit'](_0x1d9513[_0xe632('0x35')]['limit']);_0x317724['offset']=qs[_0xe632('0x1d')](_0x1d9513[_0xe632('0x35')]['offset']);}return _0xd863af[_0xe632('0x56')](_0x317724);}})[_0xe632('0x27')](function(_0x129654){if(_0x129654){return _0x129654?{'count':_0x54b3c6,'rows':_0x129654}:null;}})[_0xe632('0x27')](respondWithResult(_0x12fbe5,null))[_0xe632('0x45')](handleError(_0x12fbe5,null));}; \ No newline at end of file +var _0xd915=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','omit','getConditions','length','Action','addActions','findOne','order','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3abf91,_0x52b83c){var _0x429cae=function(_0xaa4612){while(--_0xaa4612){_0x3abf91['push'](_0x3abf91['shift']());}};_0x429cae(++_0x52b83c);}(_0xd915,0x137));var _0x5d91=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd915[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x5d91('0x0'));var rimraf=require(_0x5d91('0x1'));var zipdir=require(_0x5d91('0x2'));var jsonpatch=require(_0x5d91('0x3'));var rp=require(_0x5d91('0x4'));var moment=require('moment');var BPromise=require(_0x5d91('0x5'));var Mustache=require(_0x5d91('0x6'));var util=require(_0x5d91('0x7'));var path=require(_0x5d91('0x8'));var sox=require(_0x5d91('0x9'));var csv=require(_0x5d91('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d91('0xb'));var _=require(_0x5d91('0xc'));var squel=require(_0x5d91('0xd'));var crypto=require(_0x5d91('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5d91('0xf'));var toCsv=require(_0x5d91('0xa'));var querystring=require(_0x5d91('0x10'));var Papa=require(_0x5d91('0x11'));var Redis=require(_0x5d91('0x12'));var authService=require(_0x5d91('0x13'));var qs=require(_0x5d91('0x14'));var as=require(_0x5d91('0x15'));var hardwareService=require(_0x5d91('0x16'));var logger=require(_0x5d91('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d91('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f36da,_0x28f2ce){_0x28f2ce=_0x28f2ce||0xcc;return function(_0x15c9f6){if(_0x15c9f6){return _0x2f36da[_0x5d91('0x19')](_0x28f2ce);}return _0x2f36da['status'](_0x28f2ce)[_0x5d91('0x1a')]();};}function respondWithResult(_0x1e7f89,_0xbb7c9e){_0xbb7c9e=_0xbb7c9e||0xc8;return function(_0x2dcb69){if(_0x2dcb69){return _0x1e7f89[_0x5d91('0x1b')](_0xbb7c9e)['json'](_0x2dcb69);}};}function respondWithFilteredResult(_0x332a07,_0x243fa0){return function(_0x73e2d6){if(_0x73e2d6){var _0x122fcb=typeof _0x243fa0['offset']===_0x5d91('0x1c')&&typeof _0x243fa0['limit']===_0x5d91('0x1c');var _0x5e32ae=_0x73e2d6[_0x5d91('0x1d')];var _0x23c7fd=_0x122fcb?0x0:_0x243fa0[_0x5d91('0x1e')];var _0x3c11ca=_0x122fcb?_0x73e2d6[_0x5d91('0x1d')]:_0x243fa0[_0x5d91('0x1e')]+_0x243fa0[_0x5d91('0x1f')];var _0x139cb4;if(_0x3c11ca>=_0x5e32ae){_0x3c11ca=_0x5e32ae;_0x139cb4=0xc8;}else{_0x139cb4=0xce;}_0x332a07[_0x5d91('0x1b')](_0x139cb4);return _0x332a07[_0x5d91('0x20')]('Content-Range',_0x23c7fd+'-'+_0x3c11ca+'/'+_0x5e32ae)['json'](_0x73e2d6);}return null;};}function patchUpdates(_0x2c5d9c){return function(_0x3f55a3){try{jsonpatch[_0x5d91('0x21')](_0x3f55a3,_0x2c5d9c,!![]);}catch(_0x54b9e0){return BPromise[_0x5d91('0x22')](_0x54b9e0);}return _0x3f55a3['save']();};}function saveUpdates(_0x252474,_0x3b19cd){return function(_0xfa179b){if(_0xfa179b){return _0xfa179b[_0x5d91('0x23')](_0x252474)[_0x5d91('0x24')](function(_0x4b8e6c){return _0x4b8e6c;});}return null;};}function removeEntity(_0x1162b5,_0x428c7f){return function(_0x20e8a6){if(_0x20e8a6){return _0x20e8a6[_0x5d91('0x25')]()['then'](function(){_0x1162b5[_0x5d91('0x1b')](0xcc)[_0x5d91('0x1a')]();});}};}function handleEntityNotFound(_0x5a3a6c,_0x41d632){return function(_0x2eac3f){if(!_0x2eac3f){_0x5a3a6c['sendStatus'](0x194);}return _0x2eac3f;};}function handleError(_0x185e30,_0x11fe03){_0x11fe03=_0x11fe03||0x1f4;return function(_0xbf9eb5){logger[_0x5d91('0x26')](_0xbf9eb5['stack']);if(_0xbf9eb5[_0x5d91('0x27')]){delete _0xbf9eb5[_0x5d91('0x27')];}_0x185e30['status'](_0x11fe03)[_0x5d91('0x28')](_0xbf9eb5);};}exports['index']=function(_0x2f925d,_0x34fe10){var _0x49a65c={},_0x4d37f8={},_0xdf6aec={'count':0x0,'rows':[]};var _0x590a62=_[_0x5d91('0x29')](db[_0x5d91('0x2a')][_0x5d91('0x2b')],function(_0x51cbf1){return{'name':_0x51cbf1[_0x5d91('0x2c')],'type':_0x51cbf1[_0x5d91('0x2d')][_0x5d91('0x2e')]};});_0x4d37f8[_0x5d91('0x2f')]=_['map'](_0x590a62,_0x5d91('0x27'));_0x4d37f8[_0x5d91('0x30')]=_[_0x5d91('0x31')](_0x2f925d[_0x5d91('0x30')]);_0x4d37f8['filters']=_[_0x5d91('0x32')](_0x4d37f8[_0x5d91('0x2f')],_0x4d37f8['query']);_0x49a65c[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x4d37f8[_0x5d91('0x2f')],qs['fields'](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x34')]));_0x49a65c[_0x5d91('0x33')]=_0x49a65c[_0x5d91('0x33')]['length']?_0x49a65c[_0x5d91('0x33')]:_0x4d37f8['model'];if(!_0x2f925d[_0x5d91('0x30')][_0x5d91('0x35')](_0x5d91('0x36'))){_0x49a65c[_0x5d91('0x1f')]=qs[_0x5d91('0x1f')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x1f')]);_0x49a65c[_0x5d91('0x1e')]=qs[_0x5d91('0x1e')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x1e')]);}_0x49a65c['order']=qs[_0x5d91('0x37')](_0x2f925d[_0x5d91('0x30')][_0x5d91('0x37')]);_0x49a65c[_0x5d91('0x38')]=qs[_0x5d91('0x39')](_[_0x5d91('0x3a')](_0x2f925d[_0x5d91('0x30')],_0x4d37f8[_0x5d91('0x39')]),_0x590a62);if(_0x2f925d[_0x5d91('0x30')]['filter']){_0x49a65c[_0x5d91('0x38')]=_[_0x5d91('0x3b')](_0x49a65c['where'],{'$or':_[_0x5d91('0x29')](_0x590a62,function(_0x4dccfc){if(_0x4dccfc['type']!=='VIRTUAL'){var _0x504358={};_0x504358[_0x4dccfc[_0x5d91('0x27')]]={'$like':'%'+_0x2f925d[_0x5d91('0x30')][_0x5d91('0x3c')]+'%'};return _0x504358;}})});}_0x49a65c=_['merge']({},_0x49a65c,_0x2f925d[_0x5d91('0x3d')]);var _0x2a10df={'where':_0x49a65c['where']};return db['Automation'][_0x5d91('0x1d')](_0x2a10df)[_0x5d91('0x24')](function(_0x5e3557){_0xdf6aec['count']=_0x5e3557;if(_0x2f925d[_0x5d91('0x30')][_0x5d91('0x3e')]){_0x49a65c[_0x5d91('0x3f')]=[{'all':!![]}];}return db[_0x5d91('0x2a')][_0x5d91('0x40')](_0x49a65c);})['then'](function(_0x21efde){_0xdf6aec[_0x5d91('0x41')]=_0x21efde;return _0xdf6aec;})[_0x5d91('0x24')](respondWithFilteredResult(_0x34fe10,_0x49a65c))[_0x5d91('0x42')](handleError(_0x34fe10,null));};exports[_0x5d91('0x43')]=function(_0x4d4f74,_0x4ae299){var _0x56af87={'raw':![],'where':{'id':_0x4d4f74[_0x5d91('0x44')]['id']}},_0x713703={};_0x713703[_0x5d91('0x2f')]=_['keys'](db[_0x5d91('0x2a')][_0x5d91('0x2b')]);_0x713703[_0x5d91('0x30')]=_[_0x5d91('0x31')](_0x4d4f74['query']);_0x713703['filters']=_[_0x5d91('0x32')](_0x713703[_0x5d91('0x2f')],_0x713703['query']);_0x56af87['attributes']=_['intersection'](_0x713703[_0x5d91('0x2f')],qs[_0x5d91('0x34')](_0x4d4f74['query']['fields']));_0x56af87[_0x5d91('0x33')]=_0x56af87[_0x5d91('0x33')]['length']?_0x56af87['attributes']:_0x713703[_0x5d91('0x2f')];if(_0x4d4f74[_0x5d91('0x30')][_0x5d91('0x3e')]){_0x56af87[_0x5d91('0x3f')]=[{'all':!![]}];}_0x56af87=_['merge']({},_0x56af87,_0x4d4f74[_0x5d91('0x3d')]);return db[_0x5d91('0x2a')][_0x5d91('0x45')](_0x56af87)[_0x5d91('0x24')](handleEntityNotFound(_0x4ae299,null))[_0x5d91('0x24')](respondWithResult(_0x4ae299,null))[_0x5d91('0x42')](handleError(_0x4ae299,null));};exports['create']=function(_0x4ff1a4,_0x2611f6){return db['Automation'][_0x5d91('0x46')](_0x4ff1a4[_0x5d91('0x47')],{})[_0x5d91('0x24')](respondWithResult(_0x2611f6,0xc9))['catch'](handleError(_0x2611f6,null));};exports[_0x5d91('0x23')]=function(_0x727868,_0x3b8c11){if(_0x727868['body']['id']){delete _0x727868[_0x5d91('0x47')]['id'];}return db[_0x5d91('0x2a')]['find']({'where':{'id':_0x727868['params']['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x3b8c11,null))[_0x5d91('0x24')](saveUpdates(_0x727868[_0x5d91('0x47')],null))['then'](respondWithResult(_0x3b8c11,null))['catch'](handleError(_0x3b8c11,null));};exports[_0x5d91('0x25')]=function(_0x596a35,_0x3006a0){return db['Automation']['find']({'where':{'id':_0x596a35[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x3006a0,null))[_0x5d91('0x24')](removeEntity(_0x3006a0,null))['catch'](handleError(_0x3006a0,null));};exports[_0x5d91('0x48')]=function(_0x3e41b3,_0x560620,_0x3018c9){return db[_0x5d91('0x49')][_0x5d91('0x45')]({'where':{'id':_0x3e41b3[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x560620,null))[_0x5d91('0x24')](function(_0x4a3099){if(_0x4a3099){return _0x4a3099[_0x5d91('0x48')](_0x3e41b3['body'][_0x5d91('0x4a')],_[_0x5d91('0x4b')](_0x3e41b3[_0x5d91('0x47')],[_0x5d91('0x4a'),'id'])||{});}})[_0x5d91('0x24')](respondWithResult(_0x560620,null))['catch'](handleError(_0x560620,null));};exports[_0x5d91('0x4c')]=function(_0x2dae2e,_0x5021dc,_0x3055ac){var _0x41fe58={};var _0x503c1f={};var _0x2c218b;var _0x554f29;return db[_0x5d91('0x2a')]['findOne']({'where':{'id':_0x2dae2e['params']['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x5021dc,null))[_0x5d91('0x24')](function(_0x24b2fa){if(_0x24b2fa){_0x2c218b=_0x24b2fa;_0x503c1f['model']=_[_0x5d91('0x31')](db['Condition'][_0x5d91('0x2b')]);_0x503c1f['query']=_['keys'](_0x2dae2e['query']);_0x503c1f[_0x5d91('0x39')]=_[_0x5d91('0x32')](_0x503c1f['model'],_0x503c1f[_0x5d91('0x30')]);_0x41fe58[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x503c1f[_0x5d91('0x2f')],qs[_0x5d91('0x34')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x34')]));_0x41fe58['attributes']=_0x41fe58['attributes']['length']?_0x41fe58[_0x5d91('0x33')]:_0x503c1f[_0x5d91('0x2f')];_0x41fe58['order']=qs[_0x5d91('0x37')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x37')]);_0x41fe58['where']=qs[_0x5d91('0x39')](_[_0x5d91('0x3a')](_0x2dae2e['query'],_0x503c1f['filters']));if(_0x2dae2e['query'][_0x5d91('0x3c')]){_0x41fe58[_0x5d91('0x38')]=_['merge'](_0x41fe58[_0x5d91('0x38')],{'$or':_[_0x5d91('0x29')](_0x41fe58[_0x5d91('0x33')],function(_0x32c6e0){var _0x54f14b={};_0x54f14b[_0x32c6e0]={'$like':'%'+_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x3c')]+'%'};return _0x54f14b;})});}_0x41fe58=_[_0x5d91('0x3b')]({},_0x41fe58,_0x2dae2e[_0x5d91('0x3d')]);return _0x2c218b[_0x5d91('0x4c')](_0x41fe58);}})[_0x5d91('0x24')](function(_0x5945ec){if(_0x5945ec){_0x554f29=_0x5945ec[_0x5d91('0x4d')];if(!_0x2dae2e['query']['hasOwnProperty']('nolimit')){_0x41fe58[_0x5d91('0x1f')]=qs[_0x5d91('0x1f')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x1f')]);_0x41fe58[_0x5d91('0x1e')]=qs[_0x5d91('0x1e')](_0x2dae2e[_0x5d91('0x30')][_0x5d91('0x1e')]);}return _0x2c218b[_0x5d91('0x4c')](_0x41fe58);}})[_0x5d91('0x24')](function(_0x29ec18){if(_0x29ec18){return _0x29ec18?{'count':_0x554f29,'rows':_0x29ec18}:null;}})['then'](respondWithResult(_0x5021dc,null))[_0x5d91('0x42')](handleError(_0x5021dc,null));};exports['addActions']=function(_0x13f5be,_0x55447b,_0x563342){return db[_0x5d91('0x4e')][_0x5d91('0x45')]({'where':{'id':_0x13f5be[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x55447b,null))[_0x5d91('0x24')](function(_0x5d5054){if(_0x5d5054){return _0x5d5054[_0x5d91('0x4f')](_0x13f5be[_0x5d91('0x47')][_0x5d91('0x4a')],_[_0x5d91('0x4b')](_0x13f5be[_0x5d91('0x47')],[_0x5d91('0x4a'),'id'])||{});}})[_0x5d91('0x24')](respondWithResult(_0x55447b,null))[_0x5d91('0x42')](handleError(_0x55447b,null));};exports['getActions']=function(_0x253200,_0x32c996,_0x5e1192){var _0x32eb6d={};var _0x294ce5={};var _0x294ddc;var _0x78384a;return db['Automation'][_0x5d91('0x50')]({'where':{'id':_0x253200[_0x5d91('0x44')]['id']}})[_0x5d91('0x24')](handleEntityNotFound(_0x32c996,null))['then'](function(_0x422a0a){if(_0x422a0a){_0x294ddc=_0x422a0a;_0x294ce5[_0x5d91('0x2f')]=_[_0x5d91('0x31')](db[_0x5d91('0x4e')][_0x5d91('0x2b')]);_0x294ce5[_0x5d91('0x30')]=_['keys'](_0x253200[_0x5d91('0x30')]);_0x294ce5[_0x5d91('0x39')]=_[_0x5d91('0x32')](_0x294ce5[_0x5d91('0x2f')],_0x294ce5[_0x5d91('0x30')]);_0x32eb6d[_0x5d91('0x33')]=_[_0x5d91('0x32')](_0x294ce5[_0x5d91('0x2f')],qs['fields'](_0x253200[_0x5d91('0x30')]['fields']));_0x32eb6d[_0x5d91('0x33')]=_0x32eb6d['attributes'][_0x5d91('0x4d')]?_0x32eb6d[_0x5d91('0x33')]:_0x294ce5['model'];_0x32eb6d[_0x5d91('0x51')]=qs[_0x5d91('0x37')](_0x253200[_0x5d91('0x30')][_0x5d91('0x37')]);_0x32eb6d[_0x5d91('0x38')]=qs[_0x5d91('0x39')](_['pick'](_0x253200['query'],_0x294ce5[_0x5d91('0x39')]));if(_0x253200['query']['filter']){_0x32eb6d[_0x5d91('0x38')]=_['merge'](_0x32eb6d['where'],{'$or':_[_0x5d91('0x29')](_0x32eb6d[_0x5d91('0x33')],function(_0x2f2b24){var _0x406d7e={};_0x406d7e[_0x2f2b24]={'$like':'%'+_0x253200['query'][_0x5d91('0x3c')]+'%'};return _0x406d7e;})});}_0x32eb6d=_[_0x5d91('0x3b')]({},_0x32eb6d,_0x253200[_0x5d91('0x3d')]);return _0x294ddc['getActions'](_0x32eb6d);}})[_0x5d91('0x24')](function(_0x539478){if(_0x539478){_0x78384a=_0x539478[_0x5d91('0x4d')];if(!_0x253200['query'][_0x5d91('0x35')](_0x5d91('0x36'))){_0x32eb6d['limit']=qs[_0x5d91('0x1f')](_0x253200[_0x5d91('0x30')]['limit']);_0x32eb6d['offset']=qs[_0x5d91('0x1e')](_0x253200[_0x5d91('0x30')]['offset']);}return _0x294ddc[_0x5d91('0x52')](_0x32eb6d);}})[_0x5d91('0x24')](function(_0x10147f){if(_0x10147f){return _0x10147f?{'count':_0x78384a,'rows':_0x10147f}:null;}})[_0x5d91('0x24')](respondWithResult(_0x32c996,null))['catch'](handleError(_0x32c996,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 13b68ac..eb1cb19 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 _0x6dea=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x4cef57,_0x4da0e4){var _0x3bf7dd=function(_0xe01cb4){while(--_0xe01cb4){_0x4cef57['push'](_0x4cef57['shift']());}};_0x3bf7dd(++_0x4da0e4);}(_0x6dea,0xfb));var _0xa6de=function(_0x27f477,_0x5131b0){_0x27f477=_0x27f477-0x0;var _0x300a6f=_0x6dea[_0x27f477];return _0x300a6f;};'use strict';var _=require(_0xa6de('0x0'));var util=require(_0xa6de('0x1'));var logger=require(_0xa6de('0x2'))(_0xa6de('0x3'));var moment=require(_0xa6de('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6de('0x5'));var fs=require('fs');var path=require(_0xa6de('0x6'));var rimraf=require(_0xa6de('0x7'));var config=require(_0xa6de('0x8'));var attributes=require(_0xa6de('0x9'));module['exports']=function(_0x207318,_0x140d16){return _0x207318[_0xa6de('0xa')]('Automation',attributes,{'tableName':_0xa6de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8afd=['../../config/logger','api','moment','bluebird','path','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash'];(function(_0x341422,_0x34e3a3){var _0x237b92=function(_0x20cba3){while(--_0x20cba3){_0x341422['push'](_0x341422['shift']());}};_0x237b92(++_0x34e3a3);}(_0x8afd,0x154));var _0xd8af=function(_0x3907d7,_0xdbc834){_0x3907d7=_0x3907d7-0x0;var _0x5b9610=_0x8afd[_0x3907d7];return _0x5b9610;};'use strict';var _=require(_0xd8af('0x0'));var util=require('util');var logger=require(_0xd8af('0x1'))(_0xd8af('0x2'));var moment=require(_0xd8af('0x3'));var BPromise=require(_0xd8af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8af('0x5'));var rimraf=require('rimraf');var config=require(_0xd8af('0x6'));var attributes=require(_0xd8af('0x7'));module[_0xd8af('0x8')]=function(_0x1ccc17,_0x37faf0){return _0x1ccc17['define'](_0xd8af('0x9'),attributes,{'tableName':_0xd8af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 2808e28..19bcc13 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 _0x7b08=['code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x7b08,0x163));var _0x87b0=function(_0x13c8df,_0x102892){_0x13c8df=_0x13c8df-0x0;var _0xc33f48=_0x7b08[_0x13c8df];return _0xc33f48;};'use strict';var _=require(_0x87b0('0x0'));var util=require('util');var moment=require(_0x87b0('0x1'));var BPromise=require(_0x87b0('0x2'));var rs=require(_0x87b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87b0('0x4'))['db'];var utils=require(_0x87b0('0x5'));var logger=require(_0x87b0('0x6'))(_0x87b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x87b0('0x8'));var client=jayson[_0x87b0('0x9')][_0x87b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x419841,_0x130650,_0x41dcc8){return new BPromise(function(_0x1a7f35,_0x4015e2){return client[_0x87b0('0xb')](_0x419841,_0x41dcc8)[_0x87b0('0xc')](function(_0x52f596){logger[_0x87b0('0xd')](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));logger[_0x87b0('0x10')](_0x87b0('0x11'),_0x130650,_0x87b0('0xf'),JSON['stringify'](_0x52f596));if(_0x52f596['error']){if(_0x52f596[_0x87b0('0x12')][_0x87b0('0x13')]===0x1f4){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x52f596[_0x87b0('0x12')][_0x87b0('0x14')]);return _0x4015e2(_0x52f596['error'][_0x87b0('0x14')]);}logger[_0x87b0('0x12')]('Automation,\x20%s,\x20%s',_0x130650,_0x52f596['error'][_0x87b0('0x14')]);return _0x1a7f35(_0x52f596['error']['message']);}else{logger['info'](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));_0x1a7f35(_0x52f596['result'][_0x87b0('0x14')]);}})[_0x87b0('0x15')](function(_0x2b37d6){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x2b37d6);_0x4015e2(_0x2b37d6);});});} \ No newline at end of file +var _0x4849=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1a39cc,_0x356cac){var _0x1ccebb=function(_0x207168){while(--_0x207168){_0x1a39cc['push'](_0x1a39cc['shift']());}};_0x1ccebb(++_0x356cac);}(_0x4849,0xf8));var _0x9484=function(_0x248a91,_0x173716){_0x248a91=_0x248a91-0x0;var _0x46cd36=_0x4849[_0x248a91];return _0x46cd36;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var moment=require(_0x9484('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9484('0x3'));var db=require(_0x9484('0x4'))['db'];var utils=require(_0x9484('0x5'));var logger=require(_0x9484('0x6'))(_0x9484('0x7'));var config=require(_0x9484('0x8'));var jayson=require(_0x9484('0x9'));var client=jayson[_0x9484('0xa')][_0x9484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x536b43,_0x4a8a70,_0x11f2a1){return new BPromise(function(_0x583079,_0x3929b9){return client[_0x9484('0xc')](_0x536b43,_0x11f2a1)[_0x9484('0xd')](function(_0xe8b216){logger[_0x9484('0xe')](_0x9484('0xf'),_0x4a8a70,_0x9484('0x10'));logger[_0x9484('0x11')](_0x9484('0x12'),_0x4a8a70,_0x9484('0x10'),JSON[_0x9484('0x13')](_0xe8b216));if(_0xe8b216[_0x9484('0x14')]){if(_0xe8b216[_0x9484('0x14')][_0x9484('0x15')]===0x1f4){logger[_0x9484('0x14')]('Automation,\x20%s,\x20%s',_0x4a8a70,_0xe8b216[_0x9484('0x14')]['message']);return _0x3929b9(_0xe8b216[_0x9484('0x14')][_0x9484('0x16')]);}logger[_0x9484('0x14')](_0x9484('0xf'),_0x4a8a70,_0xe8b216[_0x9484('0x14')][_0x9484('0x16')]);return _0x583079(_0xe8b216['error'][_0x9484('0x16')]);}else{logger[_0x9484('0xe')]('Automation,\x20%s,\x20%s',_0x4a8a70,'request\x20sent');_0x583079(_0xe8b216[_0x9484('0x17')]['message']);}})[_0x9484('0x18')](function(_0x4e974f){logger[_0x9484('0x14')](_0x9484('0xf'),_0x4a8a70,_0x4e974f);_0x3929b9(_0x4e974f);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d830a1a..a4671cc 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 _0x826a=['getActions','post','addConditions','put','update','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x6a1321,_0x579f93){var _0x5d84ed=function(_0x477e8d){while(--_0x477e8d){_0x6a1321['push'](_0x6a1321['shift']());}};_0x5d84ed(++_0x579f93);}(_0x826a,0x1aa));var _0xa826=function(_0x21b990,_0x13409d){_0x21b990=_0x21b990-0x0;var _0x42550f=_0x826a[_0x21b990];return _0x42550f;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0x7')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router['post']('/',auth[_0xa826('0x8')](),controller['create']);router[_0xa826('0x10')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x11')]);router[_0xa826('0x10')](_0xa826('0xe'),auth[_0xa826('0x8')](),controller['addActions']);router[_0xa826('0x12')]('/:id',auth[_0xa826('0x8')](),controller[_0xa826('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa826('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6611=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x6611,0xdd));var _0x1661=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6611[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x1661('0x0'));var path=require(_0x1661('0x1'));var timeout=require(_0x1661('0x2'));var express=require(_0x1661('0x3'));var router=express[_0x1661('0x4')]();var fs_extra=require(_0x1661('0x5'));var auth=require(_0x1661('0x6'));var interaction=require(_0x1661('0x7'));var config=require(_0x1661('0x8'));var controller=require(_0x1661('0x9'));router[_0x1661('0xa')]('/',auth[_0x1661('0xb')](),controller['index']);router['get'](_0x1661('0xc'),auth[_0x1661('0xb')](),controller['show']);router['get'](_0x1661('0xd'),auth[_0x1661('0xb')](),controller[_0x1661('0xe')]);router[_0x1661('0xa')](_0x1661('0xf'),auth[_0x1661('0xb')](),controller[_0x1661('0x10')]);router[_0x1661('0x11')]('/',auth['isAuthenticated'](),controller[_0x1661('0x12')]);router[_0x1661('0x11')]('/:id/conditions',auth[_0x1661('0xb')](),controller['addConditions']);router[_0x1661('0x11')](_0x1661('0xf'),auth[_0x1661('0xb')](),controller[_0x1661('0x13')]);router[_0x1661('0x14')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x15')]);router[_0x1661('0x16')](_0x1661('0xc'),auth[_0x1661('0xb')](),controller[_0x1661('0x17')]);module[_0x1661('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3fbe1b3..34067a4 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 _0x94b8=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)','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)'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x94b8,0x111));var _0x894b=function(_0x2a4ea4,_0x5c6b7d){_0x2a4ea4=_0x2a4ea4-0x0;var _0x1d84b3=_0x94b8[_0x2a4ea4];return _0x1d84b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x894b('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x2')),'allowNull':![],'defaultValue':_0x894b('0x2')},'description':{'type':Sequelize[_0x894b('0x0')]},'active':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x894b('0x4')](0x4)[_0x894b('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x894b('0x9')},'dialTimezone':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x894b('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x894b('0xa'),_0x894b('0xb'),_0x894b('0xc')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x894b('0x3')],'defaultValue':0x0,'comment':_0x894b('0xd')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x894b('0xe')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x894b('0xf')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x894b('0x4')](0x9)[_0x894b('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x894b('0x11')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x894b('0x12')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x894b('0x4')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x894b('0x13')},'dialOrderByScheduledAt':{'type':Sequelize[_0x894b('0x1')](_0x894b('0x14'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x894b('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x15')},'dialCutDigit':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x894b('0x16')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x17')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x18')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x19')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1b')},'dialMachineMaxRetry':{'type':Sequelize[_0x894b('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x894b('0x4')](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x894b('0x1c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x894b('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x894b('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x894b('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xc6df=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','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)','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4e1d69,_0x543378){var _0x719b41=function(_0x3db182){while(--_0x3db182){_0x4e1d69['push'](_0x4e1d69['shift']());}};_0x719b41(++_0x543378);}(_0xc6df,0x16a));var _0xfc6d=function(_0x31eaf4,_0x3b2380){_0x31eaf4=_0x31eaf4-0x0;var _0x4df397=_0xc6df[_0x31eaf4];return _0x4df397;};'use strict';var Sequelize=require(_0xfc6d('0x0'));module[_0xfc6d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc6d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xfc6d('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfc6d('0x4')],'defaultValue':0x0,'comment':_0xfc6d('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfc6d('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfc6d('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfc6d('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfc6d('0x8')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'comment':_0xfc6d('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfc6d('0x11')},'dialTimezone':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfc6d('0x12')](_0xfc6d('0x13'),_0xfc6d('0x14'),_0xfc6d('0x15')),'defaultValue':_0xfc6d('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfc6d('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfc6d('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfc6d('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfc6d('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfc6d('0xb')](0x9)[_0xfc6d('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfc6d('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfc6d('0xb')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfc6d('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfc6d('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfc6d('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xfc6d('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfc6d('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfc6d('0x12')](_0xfc6d('0x1e'),_0xfc6d('0x1f')),'defaultValue':_0xfc6d('0x1e')},'dialPrefix':{'type':Sequelize[_0xfc6d('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xfc6d('0xb')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc6d('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfc6d('0xb')](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc6d('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc6d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc6d('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfc6d('0xb')](0x5)[_0xfc6d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 75925fc..f0da8af 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 _0x6f33=['count','offset','Content-Range','apply','reject','update','destroy','get','IvrCampaigns','then','sendStatus','stack','send','index','map','Campaign','rawAttributes','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','nolimit','sort','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','NOW()','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit'];(function(_0x1ac77b,_0x1cbdac){var _0x5c0165=function(_0x22cb2a){while(--_0x22cb2a){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x5c0165(++_0x1cbdac);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x36f3('0x0'));var rimraf=require(_0x36f3('0x1'));var zipdir=require(_0x36f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x36f3('0x3'));var BPromise=require(_0x36f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36f3('0x5'));var sox=require('sox');var csv=require(_0x36f3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36f3('0x7'));var squel=require('squel');var crypto=require(_0x36f3('0x8'));var jsforce=require(_0x36f3('0x9'));var deskjs=require(_0x36f3('0xa'));var toCsv=require(_0x36f3('0x6'));var querystring=require('querystring');var Papa=require(_0x36f3('0xb'));var Redis=require(_0x36f3('0xc'));var authService=require(_0x36f3('0xd'));var qs=require(_0x36f3('0xe'));var as=require(_0x36f3('0xf'));var hardwareService=require(_0x36f3('0x10'));var logger=require(_0x36f3('0x11'))(_0x36f3('0x12'));var utils=require(_0x36f3('0x13'));var config=require(_0x36f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x36f3('0x15'))['db'];function respondWithStatusCode(_0x47740d,_0x4dda9e){_0x4dda9e=_0x4dda9e||0xcc;return function(_0x424a2f){if(_0x424a2f){return _0x47740d['sendStatus'](_0x4dda9e);}return _0x47740d[_0x36f3('0x16')](_0x4dda9e)[_0x36f3('0x17')]();};}function respondWithResult(_0x112a9d,_0x12eb9b){_0x12eb9b=_0x12eb9b||0xc8;return function(_0x9da06a){if(_0x9da06a){return _0x112a9d['status'](_0x12eb9b)[_0x36f3('0x18')](_0x9da06a);}};}function respondWithFilteredResult(_0x25d29a,_0x2b108e){return function(_0x126414){if(_0x126414){var _0x116c49=typeof _0x2b108e['offset']===_0x36f3('0x19')&&typeof _0x2b108e[_0x36f3('0x1a')]===_0x36f3('0x19');var _0x376216=_0x126414[_0x36f3('0x1b')];var _0x2cc9ea=_0x116c49?0x0:_0x2b108e['offset'];var _0x232fd3=_0x116c49?_0x126414[_0x36f3('0x1b')]:_0x2b108e[_0x36f3('0x1c')]+_0x2b108e[_0x36f3('0x1a')];var _0x3cf8a2;if(_0x232fd3>=_0x376216){_0x232fd3=_0x376216;_0x3cf8a2=0xc8;}else{_0x3cf8a2=0xce;}_0x25d29a['status'](_0x3cf8a2);return _0x25d29a['set'](_0x36f3('0x1d'),_0x2cc9ea+'-'+_0x232fd3+'/'+_0x376216)[_0x36f3('0x18')](_0x126414);}return null;};}function patchUpdates(_0x402dc8){return function(_0x1930f4){try{jsonpatch[_0x36f3('0x1e')](_0x1930f4,_0x402dc8,!![]);}catch(_0xbf3556){return BPromise[_0x36f3('0x1f')](_0xbf3556);}return _0x1930f4['save']();};}function saveUpdates(_0x54f131,_0x57d1c2){return function(_0x496d70){if(_0x496d70){return _0x496d70[_0x36f3('0x20')](_0x54f131)['then'](function(_0x2cb42c){return _0x2cb42c;});}return null;};}function removeEntity(_0x292143,_0x481d99){return function(_0x4c45eb){if(_0x4c45eb){return _0x4c45eb[_0x36f3('0x21')]()['then'](function(){var _0x256f53=_0x4c45eb[_0x36f3('0x22')]({'plain':!![]});var _0x165633=_0x36f3('0x23');return db['UserProfileResource'][_0x36f3('0x21')]({'where':{'type':_0x165633,'resourceId':_0x256f53['id']}})['then'](function(){return _0x4c45eb;});})[_0x36f3('0x24')](function(){_0x292143[_0x36f3('0x16')](0xcc)[_0x36f3('0x17')]();});}};}function handleEntityNotFound(_0x4ba389,_0x58036d){return function(_0x405e24){if(!_0x405e24){_0x4ba389[_0x36f3('0x25')](0x194);}return _0x405e24;};}function handleError(_0x1dd545,_0x145edf){_0x145edf=_0x145edf||0x1f4;return function(_0x188080){logger['error'](_0x188080[_0x36f3('0x26')]);if(_0x188080['name']){delete _0x188080['name'];}_0x1dd545[_0x36f3('0x16')](_0x145edf)[_0x36f3('0x27')](_0x188080);};}exports[_0x36f3('0x28')]=function(_0x276b7c,_0x1809b6){var _0x596497={},_0x89d37a={},_0x26b25e={'count':0x0,'rows':[]};var _0x43e167=_[_0x36f3('0x29')](db[_0x36f3('0x2a')][_0x36f3('0x2b')],function(_0x59e157){return{'name':_0x59e157[_0x36f3('0x2c')],'type':_0x59e157['type'][_0x36f3('0x2d')]};});_0x89d37a[_0x36f3('0x2e')]=_[_0x36f3('0x29')](_0x43e167,_0x36f3('0x2f'));_0x89d37a['query']=_[_0x36f3('0x30')](_0x276b7c[_0x36f3('0x31')]);_0x89d37a['filters']=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],_0x89d37a[_0x36f3('0x31')]);_0x596497[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x89d37a[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x34')]));_0x596497[_0x36f3('0x33')]=_0x596497[_0x36f3('0x33')][_0x36f3('0x35')]?_0x596497[_0x36f3('0x33')]:_0x89d37a[_0x36f3('0x2e')];if(!_0x276b7c[_0x36f3('0x31')][_0x36f3('0x36')]('nolimit')){_0x596497[_0x36f3('0x1a')]=qs['limit'](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x596497[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x276b7c[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x596497[_0x36f3('0x37')]=qs['sort'](_0x276b7c['query']['sort']);_0x596497[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_['pick'](_0x276b7c[_0x36f3('0x31')],_0x89d37a[_0x36f3('0x39')]),_0x43e167);if(_0x276b7c[_0x36f3('0x31')]['filter']){_0x596497[_0x36f3('0x38')]=_['merge'](_0x596497[_0x36f3('0x38')],{'$or':_['map'](_0x43e167,function(_0x234f73){if(_0x234f73[_0x36f3('0x3a')]!==_0x36f3('0x3b')){var _0x51732b={};_0x51732b[_0x234f73[_0x36f3('0x2f')]]={'$like':'%'+_0x276b7c[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x51732b;}})});}_0x596497=_[_0x36f3('0x3d')]({},_0x596497,_0x276b7c[_0x36f3('0x3e')]);var _0x565c52={'where':_0x596497['where']};return db['Campaign'][_0x36f3('0x1b')](_0x565c52)[_0x36f3('0x24')](function(_0x1aabc0){_0x26b25e[_0x36f3('0x1b')]=_0x1aabc0;if(_0x276b7c['query'][_0x36f3('0x3f')]){_0x596497[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x2a')][_0x36f3('0x41')](_0x596497);})[_0x36f3('0x24')](function(_0xd63988){_0x26b25e[_0x36f3('0x42')]=_0xd63988;return _0x26b25e;})['then'](respondWithFilteredResult(_0x1809b6,_0x596497))['catch'](handleError(_0x1809b6,null));};exports['show']=function(_0x3f8011,_0x5721af){var _0x4255ff={'raw':![],'where':{'id':_0x3f8011[_0x36f3('0x43')]['id']}},_0x277b40={};_0x277b40['model']=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x277b40[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3f8011[_0x36f3('0x31')]);_0x277b40[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],_0x277b40[_0x36f3('0x31')]);_0x4255ff[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x277b40[_0x36f3('0x2e')],qs['fields'](_0x3f8011[_0x36f3('0x31')][_0x36f3('0x34')]));_0x4255ff[_0x36f3('0x33')]=_0x4255ff[_0x36f3('0x33')][_0x36f3('0x35')]?_0x4255ff[_0x36f3('0x33')]:_0x277b40[_0x36f3('0x2e')];if(_0x3f8011[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x4255ff['include']=[{'all':!![]}];}_0x4255ff=_[_0x36f3('0x3d')]({},_0x4255ff,_0x3f8011[_0x36f3('0x3e')]);return db[_0x36f3('0x2a')][_0x36f3('0x44')](_0x4255ff)[_0x36f3('0x24')](handleEntityNotFound(_0x5721af,null))[_0x36f3('0x24')](respondWithResult(_0x5721af,null))[_0x36f3('0x45')](handleError(_0x5721af,null));};exports[_0x36f3('0x46')]=function(_0x2be4e0,_0x477cf6){return db[_0x36f3('0x2a')][_0x36f3('0x46')](_0x2be4e0[_0x36f3('0x47')],{})[_0x36f3('0x24')](function(_0x24e2c8){var _0x39dad3=_0x2be4e0[_0x36f3('0x48')][_0x36f3('0x22')]({'plain':!![]});if(!_0x39dad3)throw new Error(_0x36f3('0x49'));if(_0x39dad3['role']===_0x36f3('0x48')){var _0x6f3400=_0x24e2c8[_0x36f3('0x22')]({'plain':!![]});var _0x36960c=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x36960c,'userProfileId':_0x39dad3['userProfileId']},'raw':!![]})[_0x36f3('0x24')](function(_0x29d7ac){if(_0x29d7ac&&_0x29d7ac['autoAssociation']===0x0){return db[_0x36f3('0x4a')][_0x36f3('0x46')]({'name':_0x6f3400[_0x36f3('0x2f')],'resourceId':_0x6f3400['id'],'type':_0x29d7ac[_0x36f3('0x2f')],'sectionId':_0x29d7ac['id']},{})['then'](function(){return _0x24e2c8;});}else{return _0x24e2c8;}})[_0x36f3('0x45')](function(_0x167170){logger[_0x36f3('0x4b')](_0x36f3('0x4c'),_0x167170);throw _0x167170;});}return _0x24e2c8;})[_0x36f3('0x24')](respondWithResult(_0x477cf6,0xc9))[_0x36f3('0x45')](handleError(_0x477cf6,null));};exports[_0x36f3('0x4d')]=function(_0x425bc3,_0x2c9fc4){var _0x58c0ec={'where':{'id':_0x425bc3[_0x36f3('0x43')]['id']}},_0x385acd={};_0x385acd[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x2a')][_0x36f3('0x2b')]);_0x58c0ec[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x385acd[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x425bc3['query'][_0x36f3('0x34')]));_0x58c0ec['attributes']=_0x58c0ec[_0x36f3('0x33')][_0x36f3('0x35')]?_0x58c0ec[_0x36f3('0x33')]:_0x385acd['model'];if(_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x58c0ec[_0x36f3('0x40')]=[{'all':!![]}];}_0x58c0ec=_[_0x36f3('0x3d')]({},_0x58c0ec,_0x425bc3[_0x36f3('0x3e')]);return db['Campaign'][_0x36f3('0x44')](_0x58c0ec)['then'](handleEntityNotFound(_0x2c9fc4,null))[_0x36f3('0x24')](function(_0x3b14d6){if(_0x3b14d6){var _0x543f50=_0x3b14d6[_0x36f3('0x22')]({'plain':!![]});_0x543f50=qs[_0x36f3('0x4e')](_0x543f50,['id',_0x36f3('0x4f'),_0x36f3('0x50')]);_0x425bc3[_0x36f3('0x47')]=_[_0x36f3('0x4e')](_0x425bc3['body'],['id',_0x36f3('0x4f'),_0x36f3('0x50')]);return db[_0x36f3('0x2a')][_0x36f3('0x46')](_[_0x36f3('0x3d')](_0x543f50,_0x425bc3['body']),{'include':_0x425bc3[_0x36f3('0x31')][_0x36f3('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0xa51b26){var _0x49b0fe=_0x425bc3['user'][_0x36f3('0x22')]({'plain':!![]});if(!_0x49b0fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49b0fe[_0x36f3('0x51')]==='user'){var _0x5b2e50=_0xa51b26[_0x36f3('0x22')]({'plain':!![]});var _0x35303e=_0x36f3('0x23');return db['UserProfileSection'][_0x36f3('0x44')]({'where':{'name':_0x35303e,'userProfileId':_0x49b0fe[_0x36f3('0x52')]},'raw':!![]})[_0x36f3('0x24')](function(_0x42e06e){if(_0x42e06e&&_0x42e06e[_0x36f3('0x53')]===0x0){return db[_0x36f3('0x4a')]['create']({'name':_0x5b2e50[_0x36f3('0x2f')],'resourceId':_0x5b2e50['id'],'type':_0x42e06e[_0x36f3('0x2f')],'sectionId':_0x42e06e['id']},{})[_0x36f3('0x24')](function(){return _0xa51b26;});}else{return _0xa51b26;}})[_0x36f3('0x45')](function(_0x19bc69){logger['error'](_0x36f3('0x4c'),_0x19bc69);throw _0x19bc69;});}return _0xa51b26;});}})[_0x36f3('0x24')](respondWithResult(_0x2c9fc4,0xc9))[_0x36f3('0x45')](handleError(_0x2c9fc4,null));};exports[_0x36f3('0x20')]=function(_0x941d43,_0x5d0b0e){if(_0x941d43[_0x36f3('0x47')]['id']){delete _0x941d43['body']['id'];}return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x941d43[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d0b0e,null))[_0x36f3('0x24')](saveUpdates(_0x941d43[_0x36f3('0x47')],null))[_0x36f3('0x24')](respondWithResult(_0x5d0b0e,null))['catch'](handleError(_0x5d0b0e,null));};exports[_0x36f3('0x21')]=function(_0x2ec6c2,_0x241835){return db['Campaign']['find']({'where':{'id':_0x2ec6c2[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x241835,null))[_0x36f3('0x24')](removeEntity(_0x241835,null))[_0x36f3('0x45')](handleError(_0x241835,null));};exports[_0x36f3('0x54')]=function(_0x33cc89,_0x34be3b,_0x4be9a5){var _0x174ae6={'raw':!![],'where':{}};var _0x4560e3={};var _0x5bc385={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x33cc89[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x34be3b,null))[_0x36f3('0x24')](function(_0x317add){if(_0x317add){_0x4560e3[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x56')][_0x36f3('0x2b')]);_0x4560e3['query']=_[_0x36f3('0x30')](_0x33cc89[_0x36f3('0x31')]);_0x4560e3[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x4560e3[_0x36f3('0x2e')],_0x4560e3[_0x36f3('0x31')]);_0x174ae6[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x4560e3['model'],qs['fields'](_0x33cc89['query']['fields']));_0x174ae6[_0x36f3('0x33')]=_0x174ae6[_0x36f3('0x33')][_0x36f3('0x35')]?_0x174ae6[_0x36f3('0x33')]:_0x4560e3[_0x36f3('0x2e')];if(!_0x33cc89[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x174ae6[_0x36f3('0x1a')]=qs['limit'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x174ae6['offset']=qs[_0x36f3('0x1c')](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x174ae6[_0x36f3('0x37')]=qs['sort'](_0x33cc89[_0x36f3('0x31')][_0x36f3('0x58')]);_0x174ae6['where']=qs['filters'](_[_0x36f3('0x59')](_0x33cc89[_0x36f3('0x31')],_0x4560e3[_0x36f3('0x39')]));_0x174ae6[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x317add['id'];if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x174ae6[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0x174ae6[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x174ae6['attributes'],function(_0x4a6ea8){var _0x36d33c={};_0x36d33c[_0x4a6ea8]={'$like':'%'+_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x36d33c;})});}_0x174ae6=_[_0x36f3('0x3d')]({},_0x174ae6,_0x33cc89[_0x36f3('0x3e')]);return db[_0x36f3('0x56')][_0x36f3('0x1b')]({'where':_0x174ae6[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x4d0f72){_0x5bc385['count']=_0x4d0f72;if(_0x33cc89[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x174ae6['include']=[{'all':!![]}];}return db[_0x36f3('0x56')][_0x36f3('0x41')](_0x174ae6);})['then'](function(_0x3dfbdc){_0x5bc385[_0x36f3('0x42')]=_0x3dfbdc;return _0x5bc385;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x34be3b,_0x174ae6))[_0x36f3('0x45')](handleError(_0x34be3b,null));};exports[_0x36f3('0x5b')]=function(_0x39fabe,_0x1b8f5e,_0x8ef369){var _0x1474f5={'raw':!![],'where':{}};var _0x503b6d={};var _0x17fe21={'count':0x0,'rows':[]};return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x39fabe['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x1b8f5e,null))[_0x36f3('0x24')](function(_0x4694be){if(_0x4694be){_0x503b6d[_0x36f3('0x2e')]=_['keys'](db[_0x36f3('0x5c')][_0x36f3('0x2b')]);_0x503b6d[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x39fabe[_0x36f3('0x31')]);_0x503b6d[_0x36f3('0x39')]=_['intersection'](_0x503b6d[_0x36f3('0x2e')],_0x503b6d[_0x36f3('0x31')]);_0x1474f5['attributes']=_[_0x36f3('0x32')](_0x503b6d[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x39fabe[_0x36f3('0x31')]['fields']));_0x1474f5['attributes']=_0x1474f5[_0x36f3('0x33')]['length']?_0x1474f5[_0x36f3('0x33')]:_0x503b6d[_0x36f3('0x2e')];if(!_0x39fabe['query'][_0x36f3('0x36')](_0x36f3('0x57'))){_0x1474f5[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x1474f5[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x1474f5[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x39fabe[_0x36f3('0x31')][_0x36f3('0x58')]);_0x1474f5[_0x36f3('0x38')]=qs['filters'](_[_0x36f3('0x59')](_0x39fabe[_0x36f3('0x31')],_0x503b6d[_0x36f3('0x39')]));_0x1474f5[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x4694be['id'];if(_0x39fabe[_0x36f3('0x31')]['filter']){_0x1474f5['where']=_['merge'](_0x1474f5[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x1474f5[_0x36f3('0x33')],function(_0x36fd5b){var _0x5d23d3={};_0x5d23d3[_0x36fd5b]={'$like':'%'+_0x39fabe['query'][_0x36f3('0x3c')]+'%'};return _0x5d23d3;})});}_0x1474f5=_[_0x36f3('0x3d')]({},_0x1474f5,_0x39fabe[_0x36f3('0x3e')]);return db[_0x36f3('0x5c')][_0x36f3('0x1b')]({'where':_0x1474f5['where']})['then'](function(_0x4f45c9){_0x17fe21[_0x36f3('0x1b')]=_0x4f45c9;if(_0x39fabe[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x1474f5[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5c')][_0x36f3('0x41')](_0x1474f5);})[_0x36f3('0x24')](function(_0x46e556){_0x17fe21[_0x36f3('0x42')]=_0x46e556;return _0x17fe21;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x1b8f5e,_0x1474f5))[_0x36f3('0x45')](handleError(_0x1b8f5e,null));};exports[_0x36f3('0x5d')]=function(_0x55d724,_0x5c255e,_0x5a44bd){var _0x39a41e={'raw':!![],'where':{}};var _0x2fcdae={};var _0x24ff28={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')]['findOne']({'where':{'id':_0x55d724[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c255e,null))['then'](function(_0x40bc98){if(_0x40bc98){_0x2fcdae[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db['CmHopperFinal'][_0x36f3('0x2b')]);_0x2fcdae[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x55d724[_0x36f3('0x31')]);_0x2fcdae['filters']=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],_0x2fcdae[_0x36f3('0x31')]);_0x39a41e[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0x2fcdae[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x34')]));_0x39a41e[_0x36f3('0x33')]=_0x39a41e['attributes']['length']?_0x39a41e['attributes']:_0x2fcdae['model'];if(!_0x55d724[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x39a41e[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x55d724[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x39a41e[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x55d724[_0x36f3('0x31')]['offset']);}_0x39a41e[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x55d724['query']['sort']);_0x39a41e[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x55d724[_0x36f3('0x31')],_0x2fcdae['filters']));_0x39a41e[_0x36f3('0x38')]['CampaignId']=_0x40bc98['id'];if(_0x55d724[_0x36f3('0x31')]['filter']){_0x39a41e[_0x36f3('0x38')]=_['merge'](_0x39a41e[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x39a41e[_0x36f3('0x33')],function(_0x54e90a){var _0x3f3fe7={};_0x3f3fe7[_0x54e90a]={'$like':'%'+_0x55d724[_0x36f3('0x31')]['filter']+'%'};return _0x3f3fe7;})});}_0x39a41e=_[_0x36f3('0x3d')]({},_0x39a41e,_0x55d724[_0x36f3('0x3e')]);return db[_0x36f3('0x5e')][_0x36f3('0x1b')]({'where':_0x39a41e[_0x36f3('0x38')]})[_0x36f3('0x24')](function(_0x2c819a){_0x24ff28[_0x36f3('0x1b')]=_0x2c819a;if(_0x55d724[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x39a41e[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x5e')]['findAll'](_0x39a41e);})[_0x36f3('0x24')](function(_0x49e7d3){_0x24ff28[_0x36f3('0x42')]=_0x49e7d3;return _0x24ff28;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x5c255e,_0x39a41e))[_0x36f3('0x45')](handleError(_0x5c255e,null));};exports[_0x36f3('0x5f')]=function(_0x4b3574,_0x517773,_0x2d8f99){var _0x2c5690={'raw':!![],'where':{}};var _0x81dad4={};var _0x1dd6fd={'count':0x0,'rows':[]};return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x4b3574[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x517773,null))[_0x36f3('0x24')](function(_0x235ecb){if(_0x235ecb){_0x81dad4[_0x36f3('0x2e')]=_['keys'](db['CmHopperBlack'][_0x36f3('0x2b')]);_0x81dad4[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x4b3574['query']);_0x81dad4[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0x81dad4['model'],_0x81dad4[_0x36f3('0x31')]);_0x2c5690['attributes']=_[_0x36f3('0x32')](_0x81dad4[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x34')]));_0x2c5690[_0x36f3('0x33')]=_0x2c5690[_0x36f3('0x33')]['length']?_0x2c5690[_0x36f3('0x33')]:_0x81dad4['model'];if(!_0x4b3574[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0x2c5690[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x2c5690[_0x36f3('0x1c')]=qs['offset'](_0x4b3574[_0x36f3('0x31')][_0x36f3('0x1c')]);}_0x2c5690[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x4b3574[_0x36f3('0x31')]['sort']);_0x2c5690[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x4b3574[_0x36f3('0x31')],_0x81dad4[_0x36f3('0x39')]));_0x2c5690[_0x36f3('0x38')][_0x36f3('0x5a')]=_0x235ecb['id'];if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x2c5690['where']=_[_0x36f3('0x3d')](_0x2c5690[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x2c5690[_0x36f3('0x33')],function(_0x36e606){var _0x5e88ce={};_0x5e88ce[_0x36e606]={'$like':'%'+_0x4b3574['query'][_0x36f3('0x3c')]+'%'};return _0x5e88ce;})});}_0x2c5690=_[_0x36f3('0x3d')]({},_0x2c5690,_0x4b3574[_0x36f3('0x3e')]);return db[_0x36f3('0x60')]['count']({'where':_0x2c5690['where']})['then'](function(_0x3ff4c6){_0x1dd6fd[_0x36f3('0x1b')]=_0x3ff4c6;if(_0x4b3574[_0x36f3('0x31')][_0x36f3('0x3f')]){_0x2c5690[_0x36f3('0x40')]=[{'all':!![]}];}return db[_0x36f3('0x60')][_0x36f3('0x41')](_0x2c5690);})[_0x36f3('0x24')](function(_0x3ea5d8){_0x1dd6fd['rows']=_0x3ea5d8;return _0x1dd6fd;});}})[_0x36f3('0x24')](respondWithFilteredResult(_0x517773,_0x2c5690))[_0x36f3('0x45')](handleError(_0x517773,null));};exports[_0x36f3('0x61')]=function(_0x3a5b6b,_0x484f8f,_0x4bc023){var _0x57b113={};var _0x6561e0={};var _0x23f36a;var _0x6d9551;return db[_0x36f3('0x2a')][_0x36f3('0x55')]({'where':{'id':_0x3a5b6b[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x484f8f,null))[_0x36f3('0x24')](function(_0x4af77b){if(_0x4af77b){_0x23f36a=_0x4af77b;_0x6561e0[_0x36f3('0x2e')]=_[_0x36f3('0x30')](db[_0x36f3('0x62')][_0x36f3('0x2b')]);_0x6561e0[_0x36f3('0x31')]=_[_0x36f3('0x30')](_0x3a5b6b[_0x36f3('0x31')]);_0x6561e0['filters']=_[_0x36f3('0x32')](_0x6561e0[_0x36f3('0x2e')],_0x6561e0[_0x36f3('0x31')]);_0x57b113[_0x36f3('0x33')]=_['intersection'](_0x6561e0[_0x36f3('0x2e')],qs['fields'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x34')]));_0x57b113['attributes']=_0x57b113['attributes'][_0x36f3('0x35')]?_0x57b113[_0x36f3('0x33')]:_0x6561e0[_0x36f3('0x2e')];_0x57b113['order']=qs['sort'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x58')]);_0x57b113[_0x36f3('0x38')]=qs[_0x36f3('0x39')](_[_0x36f3('0x59')](_0x3a5b6b[_0x36f3('0x31')],_0x6561e0[_0x36f3('0x39')]));if(_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0x57b113['where']=_[_0x36f3('0x3d')](_0x57b113[_0x36f3('0x38')],{'$or':_[_0x36f3('0x29')](_0x57b113[_0x36f3('0x33')],function(_0x146f03){var _0x3a3704={};_0x3a3704[_0x146f03]={'$like':'%'+_0x3a5b6b[_0x36f3('0x31')]['filter']+'%'};return _0x3a3704;})});}_0x57b113=_[_0x36f3('0x3d')]({},_0x57b113,_0x3a5b6b[_0x36f3('0x3e')]);return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0xedb9e4){if(_0xedb9e4){_0x6d9551=_0xedb9e4[_0x36f3('0x35')];if(!_0x3a5b6b['query']['hasOwnProperty'](_0x36f3('0x57'))){_0x57b113[_0x36f3('0x1a')]=qs['limit'](_0x3a5b6b[_0x36f3('0x31')][_0x36f3('0x1a')]);_0x57b113[_0x36f3('0x1c')]=qs[_0x36f3('0x1c')](_0x3a5b6b['query'][_0x36f3('0x1c')]);}return _0x23f36a[_0x36f3('0x61')](_0x57b113);}})[_0x36f3('0x24')](function(_0x1197bd){if(_0x1197bd){return _0x1197bd?{'count':_0x6d9551,'rows':_0x1197bd}:null;}})['then'](respondWithResult(_0x484f8f,null))[_0x36f3('0x45')](handleError(_0x484f8f,null));};exports[_0x36f3('0x63')]=function(_0x4954ad,_0x473210,_0x44f758){var _0x46c91b,_0x51e520;var _0xc2a3af=[];var _0x2b1ede=moment()[_0x36f3('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x4954ad[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x473210,null))[_0x36f3('0x24')](function(_0x44f7bf){if(_0x44f7bf){_0x51e520=_0x44f7bf;return _0x44f7bf['addLists'](_0x4954ad['body'][_0x36f3('0x65')],_[_0x36f3('0x4e')](_0x4954ad[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x1bbef0){var _0xfc72b;var _0x15fe57;_0x46c91b=_0x1bbef0||[];var _0x5e2954=[];if(_0x1bbef0){for(var _0x91c233=0x0;_0x91c233<_0x1bbef0[_0x36f3('0x35')];_0x91c233+=0x1){var _0x59d425=_0x1bbef0[_0x91c233][_0x36f3('0x22')]({'plain':!![]});_0x51e520['dialCheckDuplicateType']=_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]?_0x4954ad[_0x36f3('0x47')][_0x36f3('0x67')]:_0x51e520[_0x36f3('0x67')];switch(_0x51e520[_0x36f3('0x67')]){case _0x36f3('0x68'):_0xfc72b=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x6a'))[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))['field']('NOW()',_0x36f3('0x6d'))[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad['params']['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))['where'](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')]['toString']())[_0x36f3('0x38')](_0x36f3('0x78'))[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x7a'))[_0x36f3('0x73')]('cm_hopper_final')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]()))['where'](_0x36f3('0x79'),squel[_0x36f3('0x70')]()[_0x36f3('0x71')]('COALESCE(phone,\x27\x27)')[_0x36f3('0x73')]('cm_hopper')[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())))['toString']();break;case _0x36f3('0x7c'):_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')[_0x36f3('0x6b')]([_0x36f3('0x6c'),_0x36f3('0x6d'),_0x36f3('0x6e'),_0x36f3('0x6f'),'CampaignId','createdAt',_0x36f3('0x50')],squel['select']()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),'scheduledAt')[_0x36f3('0x71')]('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id']['toString'](),_0x36f3('0x5a'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','updatedAt')['from'](_0x36f3('0x74'))[_0x36f3('0x38')](_0x36f3('0x75'))[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0x36f3('0x38')](_0x36f3('0x79'),squel[_0x36f3('0x70')]()['field'](_0x36f3('0x7f'))[_0x36f3('0x73')](_0x36f3('0x6a'))[_0x36f3('0x38')](_0x36f3('0x7b'),_0x4954ad['params']['id'][_0x36f3('0x72')]())))['toString']();break;default:_0xfc72b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')]('cm_hopper')['fromQuery'](['phone',_0x36f3('0x6d'),'ContactId',_0x36f3('0x6f'),'CampaignId',_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()[_0x36f3('0x71')](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x6d'))['field']('id',_0x36f3('0x6e'))[_0x36f3('0x71')](_0x59d425['CmListId'][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))['field']('\x27'+_0x2b1ede+'\x27',_0x36f3('0x4f'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();}_0x15fe57=squel['insert']()[_0x36f3('0x69')](_0x36f3('0x80'))['fromQuery']([_0x36f3('0x81'),_0x36f3('0x6d'),_0x36f3('0x6c'),_0x36f3('0x82'),_0x36f3('0x4f'),_0x36f3('0x50')],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x83'),'id')[_0x36f3('0x71')]('NOW()',_0x36f3('0x6d'))['field'](_0x36f3('0x84'),_0x36f3('0x6c'))['field'](_0x36f3('0x85'),_0x36f3('0x82'))[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27','createdAt')[_0x36f3('0x71')]('\x27'+_0x2b1ede+'\x27',_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x86'),'ci')[_0x36f3('0x87')](_0x36f3('0x6a'),'h',_0x36f3('0x88'))[_0x36f3('0x38')](_0x36f3('0x89'),_0x59d425[_0x36f3('0x77')][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8a'),_0x4954ad[_0x36f3('0x43')]['id'][_0x36f3('0x72')]())[_0x36f3('0x38')](_0x36f3('0x8b'),_0x2b1ede))[_0x36f3('0x72')]();_0x5e2954[_0x36f3('0x8c')](db[_0x36f3('0x8d')][_0x36f3('0x31')](_0xfc72b));_0xc2a3af['push'](db[_0x36f3('0x8d')]['query'](_0x15fe57));}return BPromise['all'](_0x5e2954);}})['then'](function(){return BPromise[_0x36f3('0x8e')](_0xc2a3af);})[_0x36f3('0x24')](function(){return _0x46c91b;})[_0x36f3('0x24')](respondWithResult(_0x473210,null))[_0x36f3('0x45')](handleError(_0x473210,null));};exports[_0x36f3('0x8f')]=function(_0x1bc0a0,_0x3892d0,_0x14e89c){return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x1bc0a0[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3892d0,null))[_0x36f3('0x24')](function(_0x351135){if(_0x351135){return _0x351135['removeLists'](_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x568d03){if(_0x568d03){return db[_0x36f3('0x56')][_0x36f3('0x21')]({'where':{'ListId':_0x1bc0a0[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x1bc0a0[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](function(){return _0x568d03;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x3892d0,null))[_0x36f3('0x45')](handleError(_0x3892d0,null));};exports['getBlackLists']=function(_0x126c2b,_0x19df44,_0x268db3){var _0xb907ef={};var _0xd6df25={};var _0x2971e7;var _0x44b358;return db['Campaign'][_0x36f3('0x55')]({'where':{'id':_0x126c2b[_0x36f3('0x43')]['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x19df44,null))[_0x36f3('0x24')](function(_0x511987){if(_0x511987){_0x2971e7=_0x511987;_0xd6df25['model']=_[_0x36f3('0x30')](db['CmList']['rawAttributes']);_0xd6df25['query']=_[_0x36f3('0x30')](_0x126c2b[_0x36f3('0x31')]);_0xd6df25[_0x36f3('0x39')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],_0xd6df25[_0x36f3('0x31')]);_0xb907ef[_0x36f3('0x33')]=_[_0x36f3('0x32')](_0xd6df25[_0x36f3('0x2e')],qs[_0x36f3('0x34')](_0x126c2b[_0x36f3('0x31')][_0x36f3('0x34')]));_0xb907ef['attributes']=_0xb907ef['attributes']['length']?_0xb907ef['attributes']:_0xd6df25['model'];_0xb907ef[_0x36f3('0x37')]=qs[_0x36f3('0x58')](_0x126c2b['query'][_0x36f3('0x58')]);_0xb907ef['where']=qs['filters'](_['pick'](_0x126c2b[_0x36f3('0x31')],_0xd6df25['filters']));if(_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]){_0xb907ef[_0x36f3('0x38')]=_[_0x36f3('0x3d')](_0xb907ef['where'],{'$or':_[_0x36f3('0x29')](_0xb907ef[_0x36f3('0x33')],function(_0x3099bb){var _0x5cdad1={};_0x5cdad1[_0x3099bb]={'$like':'%'+_0x126c2b[_0x36f3('0x31')][_0x36f3('0x3c')]+'%'};return _0x5cdad1;})});}_0xb907ef=_['merge']({},_0xb907ef,_0x126c2b[_0x36f3('0x3e')]);return _0x2971e7['getBlackLists'](_0xb907ef);}})[_0x36f3('0x24')](function(_0x45b91c){if(_0x45b91c){_0x44b358=_0x45b91c[_0x36f3('0x35')];if(!_0x126c2b[_0x36f3('0x31')][_0x36f3('0x36')](_0x36f3('0x57'))){_0xb907ef[_0x36f3('0x1a')]=qs[_0x36f3('0x1a')](_0x126c2b['query'][_0x36f3('0x1a')]);_0xb907ef['offset']=qs[_0x36f3('0x1c')](_0x126c2b[_0x36f3('0x31')]['offset']);}return _0x2971e7[_0x36f3('0x90')](_0xb907ef);}})[_0x36f3('0x24')](function(_0x365b97){if(_0x365b97){return _0x365b97?{'count':_0x44b358,'rows':_0x365b97}:null;}})['then'](respondWithResult(_0x19df44,null))[_0x36f3('0x45')](handleError(_0x19df44,null));};exports[_0x36f3('0x91')]=function(_0x377efa,_0x59671a,_0x1f7cdb){var _0x240087,_0x5dadfc;var _0x399e66=[];var _0x229222=moment()['format'](_0x36f3('0x92'));return db[_0x36f3('0x2a')][_0x36f3('0x44')]({'where':{'id':_0x377efa['params']['id']}})[_0x36f3('0x24')](handleEntityNotFound(_0x59671a,null))['then'](function(_0xe7250b){if(_0xe7250b){_0x5dadfc=_0xe7250b;return _0xe7250b['addBlackLists'](_0x377efa[_0x36f3('0x47')]['ids'],_[_0x36f3('0x4e')](_0x377efa[_0x36f3('0x47')],[_0x36f3('0x65'),'id'])||{});}return null;})[_0x36f3('0x66')](function(_0x5aae79){var _0xd6f65b;var _0xcee22d;_0x240087=_0x5aae79||[];var _0x1c983c=[];if(_0x5aae79){for(var _0x2c81b9=0x0;_0x2c81b9<_0x5aae79[_0x36f3('0x35')];_0x2c81b9+=0x1){var _0xc31b5=_0x5aae79[_0x2c81b9][_0x36f3('0x22')]({'plain':!![]});_0xd6f65b=squel[_0x36f3('0x7d')]()[_0x36f3('0x69')](_0x36f3('0x93'))['fromQuery']([_0x36f3('0x6c'),'ContactId',_0x36f3('0x6f'),_0x36f3('0x5a'),_0x36f3('0x4f'),'updatedAt'],squel[_0x36f3('0x70')]()['field'](_0x36f3('0x6c'),_0x36f3('0x6c'))[_0x36f3('0x71')]('id','ContactId')[_0x36f3('0x71')](_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')](),_0x36f3('0x6f'))[_0x36f3('0x71')](_0x377efa[_0x36f3('0x43')]['id'][_0x36f3('0x72')](),_0x36f3('0x5a'))[_0x36f3('0x71')]('NOW()',_0x36f3('0x4f'))[_0x36f3('0x71')](_0x36f3('0x7e'),_0x36f3('0x50'))[_0x36f3('0x73')](_0x36f3('0x74'))[_0x36f3('0x38')]('deletedAt\x20IS\x20NULL')[_0x36f3('0x38')](_0x36f3('0x76'),_0xc31b5[_0x36f3('0x77')][_0x36f3('0x72')]())['where'](_0x36f3('0x78')))[_0x36f3('0x72')]();_0x1c983c['push'](db['sequelize'][_0x36f3('0x31')](_0xd6f65b));}return BPromise[_0x36f3('0x8e')](_0x1c983c);}})['then'](function(){return _0x240087;})[_0x36f3('0x24')](respondWithResult(_0x59671a,null))[_0x36f3('0x45')](handleError(_0x59671a,null));};exports[_0x36f3('0x94')]=function(_0x18e14c,_0x12d654,_0xfdedbc){return db['Campaign'][_0x36f3('0x44')]({'where':{'id':_0x18e14c[_0x36f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x12d654,null))['then'](function(_0x225fcf){if(_0x225fcf){return _0x225fcf[_0x36f3('0x94')](_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')]);}})[_0x36f3('0x24')](function(_0x5eb44d){if(_0x5eb44d){return db[_0x36f3('0x60')]['destroy']({'where':{'ListId':_0x18e14c[_0x36f3('0x31')][_0x36f3('0x65')],'CampaignId':_0x18e14c['params']['id']}})['then'](function(){return _0x5eb44d;});}})[_0x36f3('0x24')](respondWithStatusCode(_0x12d654,null))['catch'](handleError(_0x12d654,null));}; \ No newline at end of file +var _0x8322=['map','Campaign','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','params','create','body','user','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','findOne','CmHopper','options','count','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','format','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','from','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','insert','ContactId','cm_hopper_additional_phones','fromQuery','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','send','index'];(function(_0x6b475b,_0x3b9f10){var _0x472550=function(_0x3af4f2){while(--_0x3af4f2){_0x6b475b['push'](_0x6b475b['shift']());}};_0x472550(++_0x3b9f10);}(_0x8322,0x186));var _0x2832=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x8322[_0x3818c0];return _0x55ec33;};'use strict';var emlformat=require(_0x2832('0x0'));var rimraf=require(_0x2832('0x1'));var zipdir=require(_0x2832('0x2'));var jsonpatch=require(_0x2832('0x3'));var rp=require(_0x2832('0x4'));var moment=require(_0x2832('0x5'));var BPromise=require(_0x2832('0x6'));var Mustache=require(_0x2832('0x7'));var util=require(_0x2832('0x8'));var path=require(_0x2832('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2832('0xa'));var fs=require('fs');var fs_extra=require(_0x2832('0xb'));var _=require(_0x2832('0xc'));var squel=require(_0x2832('0xd'));var crypto=require(_0x2832('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2832('0xf'));var toCsv=require(_0x2832('0x10'));var querystring=require(_0x2832('0x11'));var Papa=require(_0x2832('0x12'));var Redis=require('ioredis');var authService=require(_0x2832('0x13'));var qs=require(_0x2832('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2832('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2832('0x16'));var licenseUtil=require(_0x2832('0x17'));var db=require(_0x2832('0x18'))['db'];function respondWithStatusCode(_0x362f97,_0x53f53c){_0x53f53c=_0x53f53c||0xcc;return function(_0x2fc06a){if(_0x2fc06a){return _0x362f97[_0x2832('0x19')](_0x53f53c);}return _0x362f97['status'](_0x53f53c)[_0x2832('0x1a')]();};}function respondWithResult(_0x4629fd,_0x285038){_0x285038=_0x285038||0xc8;return function(_0x324a19){if(_0x324a19){return _0x4629fd[_0x2832('0x1b')](_0x285038)[_0x2832('0x1c')](_0x324a19);}};}function respondWithFilteredResult(_0x12dc34,_0x5aa322){return function(_0x1805db){if(_0x1805db){var _0x38f293=typeof _0x5aa322['offset']===_0x2832('0x1d')&&typeof _0x5aa322['limit']===_0x2832('0x1d');var _0x4d11a4=_0x1805db['count'];var _0x1bb3f0=_0x38f293?0x0:_0x5aa322[_0x2832('0x1e')];var _0x2c0355=_0x38f293?_0x1805db['count']:_0x5aa322[_0x2832('0x1e')]+_0x5aa322[_0x2832('0x1f')];var _0x52f067;if(_0x2c0355>=_0x4d11a4){_0x2c0355=_0x4d11a4;_0x52f067=0xc8;}else{_0x52f067=0xce;}_0x12dc34[_0x2832('0x1b')](_0x52f067);return _0x12dc34[_0x2832('0x20')](_0x2832('0x21'),_0x1bb3f0+'-'+_0x2c0355+'/'+_0x4d11a4)[_0x2832('0x1c')](_0x1805db);}return null;};}function patchUpdates(_0x561169){return function(_0x265a6c){try{jsonpatch[_0x2832('0x22')](_0x265a6c,_0x561169,!![]);}catch(_0x3d57f9){return BPromise[_0x2832('0x23')](_0x3d57f9);}return _0x265a6c[_0x2832('0x24')]();};}function saveUpdates(_0x2df647,_0x3f8f4a){return function(_0x22fab6){if(_0x22fab6){return _0x22fab6[_0x2832('0x25')](_0x2df647)[_0x2832('0x26')](function(_0x1ccbd8){return _0x1ccbd8;});}return null;};}function removeEntity(_0x56bb6e,_0x2ac1a7){return function(_0x216357){if(_0x216357){return _0x216357[_0x2832('0x27')]()[_0x2832('0x26')](function(){var _0x24621a=_0x216357[_0x2832('0x28')]({'plain':!![]});var _0x203cd0='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x203cd0,'resourceId':_0x24621a['id']}})[_0x2832('0x26')](function(){return _0x216357;});})[_0x2832('0x26')](function(){_0x56bb6e['status'](0xcc)[_0x2832('0x1a')]();});}};}function handleEntityNotFound(_0x6c1907,_0x4694ac){return function(_0x3703b1){if(!_0x3703b1){_0x6c1907[_0x2832('0x19')](0x194);}return _0x3703b1;};}function handleError(_0x42b595,_0x2469ab){_0x2469ab=_0x2469ab||0x1f4;return function(_0x117b4c){logger[_0x2832('0x29')](_0x117b4c['stack']);if(_0x117b4c[_0x2832('0x2a')]){delete _0x117b4c['name'];}_0x42b595[_0x2832('0x1b')](_0x2469ab)[_0x2832('0x2b')](_0x117b4c);};}exports[_0x2832('0x2c')]=function(_0x2cbd15,_0x23c709){var _0xc472a4={},_0x2e1f81={},_0x57aafa={'count':0x0,'rows':[]};var _0x438735=_[_0x2832('0x2d')](db[_0x2832('0x2e')][_0x2832('0x2f')],function(_0x4db237){return{'name':_0x4db237[_0x2832('0x30')],'type':_0x4db237['type'][_0x2832('0x31')]};});_0x2e1f81['model']=_['map'](_0x438735,_0x2832('0x2a'));_0x2e1f81[_0x2832('0x32')]=_[_0x2832('0x33')](_0x2cbd15[_0x2832('0x32')]);_0x2e1f81[_0x2832('0x34')]=_[_0x2832('0x35')](_0x2e1f81[_0x2832('0x36')],_0x2e1f81[_0x2832('0x32')]);_0xc472a4['attributes']=_[_0x2832('0x35')](_0x2e1f81[_0x2832('0x36')],qs[_0x2832('0x37')](_0x2cbd15['query'][_0x2832('0x37')]));_0xc472a4[_0x2832('0x38')]=_0xc472a4[_0x2832('0x38')][_0x2832('0x39')]?_0xc472a4[_0x2832('0x38')]:_0x2e1f81['model'];if(!_0x2cbd15['query'][_0x2832('0x3a')](_0x2832('0x3b'))){_0xc472a4[_0x2832('0x1f')]=qs['limit'](_0x2cbd15[_0x2832('0x32')][_0x2832('0x1f')]);_0xc472a4[_0x2832('0x1e')]=qs['offset'](_0x2cbd15['query'][_0x2832('0x1e')]);}_0xc472a4[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x2cbd15[_0x2832('0x32')][_0x2832('0x3d')]);_0xc472a4[_0x2832('0x3e')]=qs['filters'](_[_0x2832('0x3f')](_0x2cbd15[_0x2832('0x32')],_0x2e1f81[_0x2832('0x34')]),_0x438735);if(_0x2cbd15[_0x2832('0x32')][_0x2832('0x40')]){_0xc472a4['where']=_[_0x2832('0x41')](_0xc472a4[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x438735,function(_0x834cae){if(_0x834cae[_0x2832('0x42')]!=='VIRTUAL'){var _0x31b5b1={};_0x31b5b1[_0x834cae['name']]={'$like':'%'+_0x2cbd15[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x31b5b1;}})});}_0xc472a4=_[_0x2832('0x41')]({},_0xc472a4,_0x2cbd15['options']);var _0x1300d3={'where':_0xc472a4[_0x2832('0x3e')]};return db['Campaign']['count'](_0x1300d3)[_0x2832('0x26')](function(_0x759be8){_0x57aafa['count']=_0x759be8;if(_0x2cbd15[_0x2832('0x32')][_0x2832('0x43')]){_0xc472a4[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x2e')][_0x2832('0x45')](_0xc472a4);})[_0x2832('0x26')](function(_0x18713b){_0x57aafa[_0x2832('0x46')]=_0x18713b;return _0x57aafa;})[_0x2832('0x26')](respondWithFilteredResult(_0x23c709,_0xc472a4))[_0x2832('0x47')](handleError(_0x23c709,null));};exports['show']=function(_0x1c51e9,_0x5f159c){var _0x133b12={'raw':![],'where':{'id':_0x1c51e9[_0x2832('0x48')]['id']}},_0x5b5a20={};_0x5b5a20[_0x2832('0x36')]=_['keys'](db[_0x2832('0x2e')][_0x2832('0x2f')]);_0x5b5a20['query']=_[_0x2832('0x33')](_0x1c51e9['query']);_0x5b5a20[_0x2832('0x34')]=_[_0x2832('0x35')](_0x5b5a20[_0x2832('0x36')],_0x5b5a20[_0x2832('0x32')]);_0x133b12[_0x2832('0x38')]=_[_0x2832('0x35')](_0x5b5a20[_0x2832('0x36')],qs[_0x2832('0x37')](_0x1c51e9['query']['fields']));_0x133b12[_0x2832('0x38')]=_0x133b12[_0x2832('0x38')][_0x2832('0x39')]?_0x133b12[_0x2832('0x38')]:_0x5b5a20[_0x2832('0x36')];if(_0x1c51e9[_0x2832('0x32')][_0x2832('0x43')]){_0x133b12[_0x2832('0x44')]=[{'all':!![]}];}_0x133b12=_[_0x2832('0x41')]({},_0x133b12,_0x1c51e9['options']);return db[_0x2832('0x2e')]['find'](_0x133b12)['then'](handleEntityNotFound(_0x5f159c,null))[_0x2832('0x26')](respondWithResult(_0x5f159c,null))[_0x2832('0x47')](handleError(_0x5f159c,null));};exports[_0x2832('0x49')]=function(_0xea06cf,_0x514707){return db[_0x2832('0x2e')][_0x2832('0x49')](_0xea06cf[_0x2832('0x4a')],{})[_0x2832('0x26')](function(_0x39b483){var _0x43fa8a=_0xea06cf[_0x2832('0x4b')]['get']({'plain':!![]});if(!_0x43fa8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43fa8a['role']==='user'){var _0x5a9fc7=_0x39b483['get']({'plain':!![]});var _0x31304b=_0x2832('0x4c');return db[_0x2832('0x4d')][_0x2832('0x4e')]({'where':{'name':_0x31304b,'userProfileId':_0x43fa8a[_0x2832('0x4f')]},'raw':!![]})[_0x2832('0x26')](function(_0x2942a9){if(_0x2942a9&&_0x2942a9[_0x2832('0x50')]===0x0){return db['UserProfileResource'][_0x2832('0x49')]({'name':_0x5a9fc7[_0x2832('0x2a')],'resourceId':_0x5a9fc7['id'],'type':_0x2942a9[_0x2832('0x2a')],'sectionId':_0x2942a9['id']},{})[_0x2832('0x26')](function(){return _0x39b483;});}else{return _0x39b483;}})[_0x2832('0x47')](function(_0x426ab5){logger[_0x2832('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426ab5);throw _0x426ab5;});}return _0x39b483;})['then'](respondWithResult(_0x514707,0xc9))[_0x2832('0x47')](handleError(_0x514707,null));};exports[_0x2832('0x51')]=function(_0x3baa71,_0x9ee86b){var _0x1b55ed={'where':{'id':_0x3baa71['params']['id']}},_0x296e03={};_0x296e03[_0x2832('0x36')]=_[_0x2832('0x33')](db[_0x2832('0x2e')]['rawAttributes']);_0x1b55ed[_0x2832('0x38')]=_['intersection'](_0x296e03[_0x2832('0x36')],qs['fields'](_0x3baa71[_0x2832('0x32')][_0x2832('0x37')]));_0x1b55ed['attributes']=_0x1b55ed[_0x2832('0x38')]['length']?_0x1b55ed[_0x2832('0x38')]:_0x296e03['model'];if(_0x3baa71[_0x2832('0x32')]['includeAll']){_0x1b55ed['include']=[{'all':!![]}];}_0x1b55ed=_[_0x2832('0x41')]({},_0x1b55ed,_0x3baa71['options']);return db[_0x2832('0x2e')]['find'](_0x1b55ed)[_0x2832('0x26')](handleEntityNotFound(_0x9ee86b,null))[_0x2832('0x26')](function(_0xda9900){if(_0xda9900){var _0x26484e=_0xda9900[_0x2832('0x28')]({'plain':!![]});_0x26484e=qs[_0x2832('0x52')](_0x26484e,['id',_0x2832('0x53'),_0x2832('0x54')]);_0x3baa71[_0x2832('0x4a')]=_[_0x2832('0x52')](_0x3baa71['body'],['id',_0x2832('0x53'),_0x2832('0x54')]);return db[_0x2832('0x2e')][_0x2832('0x49')](_[_0x2832('0x41')](_0x26484e,_0x3baa71[_0x2832('0x4a')]),{'include':_0x3baa71[_0x2832('0x32')][_0x2832('0x43')]?[{'all':!![]}]:undefined})[_0x2832('0x26')](function(_0x97924a){var _0x350fb1=_0x3baa71[_0x2832('0x4b')]['get']({'plain':!![]});if(!_0x350fb1)throw new Error(_0x2832('0x55'));if(_0x350fb1[_0x2832('0x56')]==='user'){var _0xbe55df=_0x97924a['get']({'plain':!![]});var _0xd4f239=_0x2832('0x4c');return db[_0x2832('0x4d')][_0x2832('0x4e')]({'where':{'name':_0xd4f239,'userProfileId':_0x350fb1[_0x2832('0x4f')]},'raw':!![]})[_0x2832('0x26')](function(_0x27db6e){if(_0x27db6e&&_0x27db6e['autoAssociation']===0x0){return db['UserProfileResource'][_0x2832('0x49')]({'name':_0xbe55df['name'],'resourceId':_0xbe55df['id'],'type':_0x27db6e[_0x2832('0x2a')],'sectionId':_0x27db6e['id']},{})[_0x2832('0x26')](function(){return _0x97924a;});}else{return _0x97924a;}})[_0x2832('0x47')](function(_0xbddbc1){logger[_0x2832('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbddbc1);throw _0xbddbc1;});}return _0x97924a;});}})['then'](respondWithResult(_0x9ee86b,0xc9))['catch'](handleError(_0x9ee86b,null));};exports[_0x2832('0x25')]=function(_0x39ad39,_0x1addfa){if(_0x39ad39['body']['id']){delete _0x39ad39[_0x2832('0x4a')]['id'];}return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x39ad39[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x1addfa,null))['then'](saveUpdates(_0x39ad39['body'],null))[_0x2832('0x26')](respondWithResult(_0x1addfa,null))[_0x2832('0x47')](handleError(_0x1addfa,null));};exports['destroy']=function(_0x1d7668,_0x105696){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x1d7668[_0x2832('0x48')]['id']}})['then'](handleEntityNotFound(_0x105696,null))[_0x2832('0x26')](removeEntity(_0x105696,null))['catch'](handleError(_0x105696,null));};exports['getHoppers']=function(_0x2ed018,_0x127dd1,_0x1b852a){var _0x2f7fbe={'raw':!![],'where':{}};var _0xf5f1af={};var _0x3f389c={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x2ed018[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x127dd1,null))['then'](function(_0x312afb){if(_0x312afb){_0xf5f1af[_0x2832('0x36')]=_['keys'](db[_0x2832('0x58')][_0x2832('0x2f')]);_0xf5f1af[_0x2832('0x32')]=_[_0x2832('0x33')](_0x2ed018[_0x2832('0x32')]);_0xf5f1af[_0x2832('0x34')]=_[_0x2832('0x35')](_0xf5f1af[_0x2832('0x36')],_0xf5f1af[_0x2832('0x32')]);_0x2f7fbe[_0x2832('0x38')]=_[_0x2832('0x35')](_0xf5f1af['model'],qs[_0x2832('0x37')](_0x2ed018[_0x2832('0x32')][_0x2832('0x37')]));_0x2f7fbe[_0x2832('0x38')]=_0x2f7fbe[_0x2832('0x38')][_0x2832('0x39')]?_0x2f7fbe[_0x2832('0x38')]:_0xf5f1af[_0x2832('0x36')];if(!_0x2ed018['query'][_0x2832('0x3a')](_0x2832('0x3b'))){_0x2f7fbe[_0x2832('0x1f')]=qs[_0x2832('0x1f')](_0x2ed018['query'][_0x2832('0x1f')]);_0x2f7fbe[_0x2832('0x1e')]=qs[_0x2832('0x1e')](_0x2ed018[_0x2832('0x32')][_0x2832('0x1e')]);}_0x2f7fbe['order']=qs['sort'](_0x2ed018[_0x2832('0x32')]['sort']);_0x2f7fbe['where']=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x2ed018['query'],_0xf5f1af[_0x2832('0x34')]));_0x2f7fbe[_0x2832('0x3e')]['CampaignId']=_0x312afb['id'];if(_0x2ed018[_0x2832('0x32')][_0x2832('0x40')]){_0x2f7fbe[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x2f7fbe[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x2f7fbe[_0x2832('0x38')],function(_0x301a9b){var _0x150b2e={};_0x150b2e[_0x301a9b]={'$like':'%'+_0x2ed018[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x150b2e;})});}_0x2f7fbe=_[_0x2832('0x41')]({},_0x2f7fbe,_0x2ed018[_0x2832('0x59')]);return db[_0x2832('0x58')][_0x2832('0x5a')]({'where':_0x2f7fbe[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x3444fb){_0x3f389c[_0x2832('0x5a')]=_0x3444fb;if(_0x2ed018[_0x2832('0x32')][_0x2832('0x43')]){_0x2f7fbe[_0x2832('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x2832('0x45')](_0x2f7fbe);})[_0x2832('0x26')](function(_0xa6b8d6){_0x3f389c['rows']=_0xa6b8d6;return _0x3f389c;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x127dd1,_0x2f7fbe))[_0x2832('0x47')](handleError(_0x127dd1,null));};exports[_0x2832('0x5b')]=function(_0x500467,_0x20b961,_0x1f2f7a){var _0x1f358e={'raw':!![],'where':{}};var _0x4f47ae={};var _0x128d9f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x500467[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x20b961,null))[_0x2832('0x26')](function(_0x673521){if(_0x673521){_0x4f47ae[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmHopperHistory'][_0x2832('0x2f')]);_0x4f47ae[_0x2832('0x32')]=_[_0x2832('0x33')](_0x500467['query']);_0x4f47ae['filters']=_[_0x2832('0x35')](_0x4f47ae[_0x2832('0x36')],_0x4f47ae[_0x2832('0x32')]);_0x1f358e[_0x2832('0x38')]=_[_0x2832('0x35')](_0x4f47ae['model'],qs['fields'](_0x500467[_0x2832('0x32')][_0x2832('0x37')]));_0x1f358e[_0x2832('0x38')]=_0x1f358e[_0x2832('0x38')][_0x2832('0x39')]?_0x1f358e[_0x2832('0x38')]:_0x4f47ae[_0x2832('0x36')];if(!_0x500467[_0x2832('0x32')]['hasOwnProperty'](_0x2832('0x3b'))){_0x1f358e[_0x2832('0x1f')]=qs[_0x2832('0x1f')](_0x500467[_0x2832('0x32')][_0x2832('0x1f')]);_0x1f358e['offset']=qs[_0x2832('0x1e')](_0x500467[_0x2832('0x32')]['offset']);}_0x1f358e['order']=qs[_0x2832('0x3d')](_0x500467[_0x2832('0x32')]['sort']);_0x1f358e[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x500467['query'],_0x4f47ae['filters']));_0x1f358e[_0x2832('0x3e')][_0x2832('0x5c')]=_0x673521['id'];if(_0x500467[_0x2832('0x32')][_0x2832('0x40')]){_0x1f358e['where']=_[_0x2832('0x41')](_0x1f358e['where'],{'$or':_['map'](_0x1f358e[_0x2832('0x38')],function(_0x252510){var _0xfa577b={};_0xfa577b[_0x252510]={'$like':'%'+_0x500467[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0xfa577b;})});}_0x1f358e=_['merge']({},_0x1f358e,_0x500467['options']);return db[_0x2832('0x5d')]['count']({'where':_0x1f358e[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x2fe103){_0x128d9f['count']=_0x2fe103;if(_0x500467[_0x2832('0x32')]['includeAll']){_0x1f358e[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x5d')][_0x2832('0x45')](_0x1f358e);})[_0x2832('0x26')](function(_0x90b0fa){_0x128d9f[_0x2832('0x46')]=_0x90b0fa;return _0x128d9f;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x20b961,_0x1f358e))[_0x2832('0x47')](handleError(_0x20b961,null));};exports[_0x2832('0x5e')]=function(_0x431438,_0x3912ea,_0x3d3a9c){var _0x150825={'raw':!![],'where':{}};var _0x3e2800={};var _0xf915b0={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x431438[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x3912ea,null))[_0x2832('0x26')](function(_0x5954fe){if(_0x5954fe){_0x3e2800[_0x2832('0x36')]=_[_0x2832('0x33')](db[_0x2832('0x5f')][_0x2832('0x2f')]);_0x3e2800['query']=_['keys'](_0x431438[_0x2832('0x32')]);_0x3e2800['filters']=_[_0x2832('0x35')](_0x3e2800[_0x2832('0x36')],_0x3e2800[_0x2832('0x32')]);_0x150825[_0x2832('0x38')]=_['intersection'](_0x3e2800[_0x2832('0x36')],qs[_0x2832('0x37')](_0x431438[_0x2832('0x32')][_0x2832('0x37')]));_0x150825[_0x2832('0x38')]=_0x150825[_0x2832('0x38')]['length']?_0x150825[_0x2832('0x38')]:_0x3e2800['model'];if(!_0x431438[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x150825[_0x2832('0x1f')]=qs['limit'](_0x431438[_0x2832('0x32')]['limit']);_0x150825['offset']=qs[_0x2832('0x1e')](_0x431438[_0x2832('0x32')]['offset']);}_0x150825['order']=qs[_0x2832('0x3d')](_0x431438[_0x2832('0x32')][_0x2832('0x3d')]);_0x150825[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x431438[_0x2832('0x32')],_0x3e2800[_0x2832('0x34')]));_0x150825[_0x2832('0x3e')][_0x2832('0x5c')]=_0x5954fe['id'];if(_0x431438['query']['filter']){_0x150825[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x150825[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x150825['attributes'],function(_0x52999e){var _0x25fb5d={};_0x25fb5d[_0x52999e]={'$like':'%'+_0x431438[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x25fb5d;})});}_0x150825=_[_0x2832('0x41')]({},_0x150825,_0x431438[_0x2832('0x59')]);return db[_0x2832('0x5f')][_0x2832('0x5a')]({'where':_0x150825[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x316c10){_0xf915b0['count']=_0x316c10;if(_0x431438[_0x2832('0x32')][_0x2832('0x43')]){_0x150825['include']=[{'all':!![]}];}return db[_0x2832('0x5f')]['findAll'](_0x150825);})['then'](function(_0x20178c){_0xf915b0[_0x2832('0x46')]=_0x20178c;return _0xf915b0;});}})[_0x2832('0x26')](respondWithFilteredResult(_0x3912ea,_0x150825))['catch'](handleError(_0x3912ea,null));};exports['getHopperBlacks']=function(_0x4c6561,_0xa37246,_0x267ddf){var _0x4efd79={'raw':!![],'where':{}};var _0x1a2da9={};var _0x511545={'count':0x0,'rows':[]};return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x4c6561['params']['id']}})['then'](handleEntityNotFound(_0xa37246,null))[_0x2832('0x26')](function(_0x5c7ddc){if(_0x5c7ddc){_0x1a2da9[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmHopperBlack'][_0x2832('0x2f')]);_0x1a2da9[_0x2832('0x32')]=_['keys'](_0x4c6561['query']);_0x1a2da9[_0x2832('0x34')]=_[_0x2832('0x35')](_0x1a2da9['model'],_0x1a2da9['query']);_0x4efd79['attributes']=_['intersection'](_0x1a2da9['model'],qs[_0x2832('0x37')](_0x4c6561[_0x2832('0x32')]['fields']));_0x4efd79['attributes']=_0x4efd79[_0x2832('0x38')][_0x2832('0x39')]?_0x4efd79[_0x2832('0x38')]:_0x1a2da9[_0x2832('0x36')];if(!_0x4c6561[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x4efd79[_0x2832('0x1f')]=qs['limit'](_0x4c6561[_0x2832('0x32')][_0x2832('0x1f')]);_0x4efd79[_0x2832('0x1e')]=qs['offset'](_0x4c6561[_0x2832('0x32')][_0x2832('0x1e')]);}_0x4efd79[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x4c6561[_0x2832('0x32')]['sort']);_0x4efd79[_0x2832('0x3e')]=qs['filters'](_[_0x2832('0x3f')](_0x4c6561[_0x2832('0x32')],_0x1a2da9[_0x2832('0x34')]));_0x4efd79[_0x2832('0x3e')][_0x2832('0x5c')]=_0x5c7ddc['id'];if(_0x4c6561[_0x2832('0x32')][_0x2832('0x40')]){_0x4efd79[_0x2832('0x3e')]=_['merge'](_0x4efd79['where'],{'$or':_[_0x2832('0x2d')](_0x4efd79[_0x2832('0x38')],function(_0x251f03){var _0x484669={};_0x484669[_0x251f03]={'$like':'%'+_0x4c6561[_0x2832('0x32')][_0x2832('0x40')]+'%'};return _0x484669;})});}_0x4efd79=_[_0x2832('0x41')]({},_0x4efd79,_0x4c6561['options']);return db[_0x2832('0x60')][_0x2832('0x5a')]({'where':_0x4efd79[_0x2832('0x3e')]})[_0x2832('0x26')](function(_0x35748d){_0x511545['count']=_0x35748d;if(_0x4c6561[_0x2832('0x32')][_0x2832('0x43')]){_0x4efd79[_0x2832('0x44')]=[{'all':!![]}];}return db[_0x2832('0x60')][_0x2832('0x45')](_0x4efd79);})[_0x2832('0x26')](function(_0x4e6cf0){_0x511545[_0x2832('0x46')]=_0x4e6cf0;return _0x511545;});}})['then'](respondWithFilteredResult(_0xa37246,_0x4efd79))[_0x2832('0x47')](handleError(_0xa37246,null));};exports[_0x2832('0x61')]=function(_0x25000e,_0x3e86d9,_0x47e809){var _0x3bbd0b={};var _0x232346={};var _0x1e6710;var _0x9de397;return db[_0x2832('0x2e')]['findOne']({'where':{'id':_0x25000e['params']['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x3e86d9,null))[_0x2832('0x26')](function(_0x5eb7a9){if(_0x5eb7a9){_0x1e6710=_0x5eb7a9;_0x232346[_0x2832('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x232346[_0x2832('0x32')]=_['keys'](_0x25000e[_0x2832('0x32')]);_0x232346[_0x2832('0x34')]=_[_0x2832('0x35')](_0x232346[_0x2832('0x36')],_0x232346[_0x2832('0x32')]);_0x3bbd0b[_0x2832('0x38')]=_[_0x2832('0x35')](_0x232346['model'],qs['fields'](_0x25000e[_0x2832('0x32')][_0x2832('0x37')]));_0x3bbd0b[_0x2832('0x38')]=_0x3bbd0b[_0x2832('0x38')][_0x2832('0x39')]?_0x3bbd0b[_0x2832('0x38')]:_0x232346[_0x2832('0x36')];_0x3bbd0b[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x25000e['query']['sort']);_0x3bbd0b[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x25000e[_0x2832('0x32')],_0x232346[_0x2832('0x34')]));if(_0x25000e['query'][_0x2832('0x40')]){_0x3bbd0b[_0x2832('0x3e')]=_[_0x2832('0x41')](_0x3bbd0b[_0x2832('0x3e')],{'$or':_['map'](_0x3bbd0b[_0x2832('0x38')],function(_0x343b79){var _0x25b82b={};_0x25b82b[_0x343b79]={'$like':'%'+_0x25000e['query']['filter']+'%'};return _0x25b82b;})});}_0x3bbd0b=_[_0x2832('0x41')]({},_0x3bbd0b,_0x25000e[_0x2832('0x59')]);return _0x1e6710[_0x2832('0x61')](_0x3bbd0b);}})[_0x2832('0x26')](function(_0x4903c6){if(_0x4903c6){_0x9de397=_0x4903c6[_0x2832('0x39')];if(!_0x25000e[_0x2832('0x32')][_0x2832('0x3a')](_0x2832('0x3b'))){_0x3bbd0b['limit']=qs[_0x2832('0x1f')](_0x25000e[_0x2832('0x32')][_0x2832('0x1f')]);_0x3bbd0b['offset']=qs['offset'](_0x25000e[_0x2832('0x32')][_0x2832('0x1e')]);}return _0x1e6710[_0x2832('0x61')](_0x3bbd0b);}})['then'](function(_0x3448f0){if(_0x3448f0){return _0x3448f0?{'count':_0x9de397,'rows':_0x3448f0}:null;}})['then'](respondWithResult(_0x3e86d9,null))[_0x2832('0x47')](handleError(_0x3e86d9,null));};exports['addLists']=function(_0x26046b,_0x5c66fd,_0x4af7d8){var _0xc66e98,_0xf37a67;var _0x1f082b=[];var _0x28f435=moment()[_0x2832('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2832('0x2e')]['find']({'where':{'id':_0x26046b[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x5c66fd,null))['then'](function(_0x56eb8f){if(_0x56eb8f){_0xf37a67=_0x56eb8f;return _0x56eb8f[_0x2832('0x63')](_0x26046b[_0x2832('0x4a')][_0x2832('0x64')],_['omit'](_0x26046b[_0x2832('0x4a')],[_0x2832('0x64'),'id'])||{});}return null;})[_0x2832('0x65')](function(_0x3c7864){var _0x2eb9a9;var _0x1958f2;_0xc66e98=_0x3c7864||[];var _0x2441c0=[];if(_0x3c7864){for(var _0x22bd5c=0x0;_0x22bd5c<_0x3c7864[_0x2832('0x39')];_0x22bd5c+=0x1){var _0x471b58=_0x3c7864[_0x22bd5c]['get']({'plain':!![]});_0xf37a67[_0x2832('0x66')]=_0x26046b[_0x2832('0x4a')][_0x2832('0x66')]?_0x26046b[_0x2832('0x4a')][_0x2832('0x66')]:_0xf37a67['dialCheckDuplicateType'];switch(_0xf37a67[_0x2832('0x66')]){case _0x2832('0x67'):_0x2eb9a9=squel['insert']()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x6b'),'ContactId',_0x2832('0x6c'),_0x2832('0x5c'),_0x2832('0x53'),'updatedAt'],squel[_0x2832('0x6d')]()['field'](_0x2832('0x6a'),_0x2832('0x6a'))[_0x2832('0x6e')](_0x2832('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x2832('0x6e')](_0x471b58[_0x2832('0x70')][_0x2832('0x71')](),'ListId')['field'](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))['field']('\x27'+_0x28f435+'\x27',_0x2832('0x53'))['field']('\x27'+_0x28f435+'\x27',_0x2832('0x54'))['from'](_0x2832('0x72'))['where'](_0x2832('0x73'))['where'](_0x2832('0x74'),_0x471b58[_0x2832('0x70')][_0x2832('0x71')]())[_0x2832('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2832('0x6d')]()[_0x2832('0x6e')](_0x2832('0x75'))['from']('cm_hopper_final')['where'](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]()))[_0x2832('0x3e')](_0x2832('0x77'),squel[_0x2832('0x6d')]()[_0x2832('0x6e')](_0x2832('0x78'))[_0x2832('0x79')](_0x2832('0x69'))['where'](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())))[_0x2832('0x71')]();break;case _0x2832('0x7a'):_0x2eb9a9=squel['insert']()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x6b'),'ContactId',_0x2832('0x6c'),_0x2832('0x5c'),_0x2832('0x53'),_0x2832('0x54')],squel['select']()[_0x2832('0x6e')](_0x2832('0x6a'),'phone')[_0x2832('0x6e')](_0x2832('0x6f'),_0x2832('0x6b'))[_0x2832('0x6e')]('id','ContactId')['field'](_0x471b58['CmListId'][_0x2832('0x71')](),'ListId')[_0x2832('0x6e')](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x53'))['field']('\x27'+_0x28f435+'\x27','updatedAt')[_0x2832('0x79')](_0x2832('0x72'))[_0x2832('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2832('0x3e')](_0x2832('0x74'),_0x471b58['CmListId'][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x7b'))[_0x2832('0x3e')](_0x2832('0x77'),squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('COALESCE(phone,\x27\x27)')[_0x2832('0x79')](_0x2832('0x69'))[_0x2832('0x3e')](_0x2832('0x76'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())))[_0x2832('0x71')]();break;default:_0x2eb9a9=squel[_0x2832('0x7c')]()[_0x2832('0x68')](_0x2832('0x69'))['fromQuery'](['phone','scheduledAt',_0x2832('0x7d'),_0x2832('0x6c'),'CampaignId',_0x2832('0x53'),_0x2832('0x54')],squel[_0x2832('0x6d')]()['field'](_0x2832('0x6a'),'phone')[_0x2832('0x6e')](_0x2832('0x6f'),_0x2832('0x6b'))[_0x2832('0x6e')]('id',_0x2832('0x7d'))['field'](_0x471b58[_0x2832('0x70')][_0x2832('0x71')](),'ListId')['field'](_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27','createdAt')[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x54'))[_0x2832('0x79')](_0x2832('0x72'))[_0x2832('0x3e')](_0x2832('0x73'))[_0x2832('0x3e')](_0x2832('0x74'),_0x471b58[_0x2832('0x70')][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x7b')))[_0x2832('0x71')]();}_0x1958f2=squel[_0x2832('0x7c')]()['into'](_0x2832('0x7e'))[_0x2832('0x7f')]([_0x2832('0x80'),_0x2832('0x6b'),'phone',_0x2832('0x81'),_0x2832('0x53'),'updatedAt'],squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('h.id','id')[_0x2832('0x6e')]('NOW()',_0x2832('0x6b'))[_0x2832('0x6e')](_0x2832('0x82'),'phone')[_0x2832('0x6e')](_0x2832('0x83'),_0x2832('0x81'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x53'))[_0x2832('0x6e')]('\x27'+_0x28f435+'\x27',_0x2832('0x54'))[_0x2832('0x79')](_0x2832('0x84'),'ci')[_0x2832('0x85')](_0x2832('0x69'),'h',_0x2832('0x86'))['where']('h.ListId\x20=\x20?',_0x471b58[_0x2832('0x70')]['toString']())[_0x2832('0x3e')](_0x2832('0x87'),_0x26046b[_0x2832('0x48')]['id'][_0x2832('0x71')]())[_0x2832('0x3e')](_0x2832('0x88'),_0x28f435))[_0x2832('0x71')]();_0x2441c0[_0x2832('0x89')](db[_0x2832('0x8a')]['query'](_0x2eb9a9));_0x1f082b[_0x2832('0x89')](db[_0x2832('0x8a')]['query'](_0x1958f2));}return BPromise[_0x2832('0x8b')](_0x2441c0);}})['then'](function(){return BPromise['all'](_0x1f082b);})['then'](function(){return _0xc66e98;})[_0x2832('0x26')](respondWithResult(_0x5c66fd,null))[_0x2832('0x47')](handleError(_0x5c66fd,null));};exports['removeLists']=function(_0x55032a,_0x2da7ee,_0x275135){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x55032a['params']['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x2da7ee,null))[_0x2832('0x26')](function(_0x5c56b2){if(_0x5c56b2){return _0x5c56b2['removeLists'](_0x55032a[_0x2832('0x32')]['ids']);}})[_0x2832('0x26')](function(_0x4c3932){if(_0x4c3932){return db[_0x2832('0x58')][_0x2832('0x27')]({'where':{'ListId':_0x55032a[_0x2832('0x32')][_0x2832('0x64')],'CampaignId':_0x55032a[_0x2832('0x48')]['id']}})[_0x2832('0x26')](function(){return _0x4c3932;});}})[_0x2832('0x26')](respondWithStatusCode(_0x2da7ee,null))[_0x2832('0x47')](handleError(_0x2da7ee,null));};exports[_0x2832('0x8c')]=function(_0x35a686,_0x58d63a,_0x3f89e4){var _0x14a5de={};var _0x1a298a={};var _0x21b2d1;var _0x17b50f;return db[_0x2832('0x2e')][_0x2832('0x57')]({'where':{'id':_0x35a686[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x58d63a,null))['then'](function(_0x25ef86){if(_0x25ef86){_0x21b2d1=_0x25ef86;_0x1a298a[_0x2832('0x36')]=_[_0x2832('0x33')](db['CmList'][_0x2832('0x2f')]);_0x1a298a[_0x2832('0x32')]=_['keys'](_0x35a686[_0x2832('0x32')]);_0x1a298a[_0x2832('0x34')]=_['intersection'](_0x1a298a['model'],_0x1a298a['query']);_0x14a5de['attributes']=_[_0x2832('0x35')](_0x1a298a[_0x2832('0x36')],qs[_0x2832('0x37')](_0x35a686['query'][_0x2832('0x37')]));_0x14a5de[_0x2832('0x38')]=_0x14a5de[_0x2832('0x38')][_0x2832('0x39')]?_0x14a5de['attributes']:_0x1a298a[_0x2832('0x36')];_0x14a5de[_0x2832('0x3c')]=qs[_0x2832('0x3d')](_0x35a686[_0x2832('0x32')]['sort']);_0x14a5de[_0x2832('0x3e')]=qs[_0x2832('0x34')](_[_0x2832('0x3f')](_0x35a686['query'],_0x1a298a[_0x2832('0x34')]));if(_0x35a686[_0x2832('0x32')][_0x2832('0x40')]){_0x14a5de[_0x2832('0x3e')]=_['merge'](_0x14a5de[_0x2832('0x3e')],{'$or':_[_0x2832('0x2d')](_0x14a5de[_0x2832('0x38')],function(_0x5348de){var _0x31b941={};_0x31b941[_0x5348de]={'$like':'%'+_0x35a686['query'][_0x2832('0x40')]+'%'};return _0x31b941;})});}_0x14a5de=_[_0x2832('0x41')]({},_0x14a5de,_0x35a686[_0x2832('0x59')]);return _0x21b2d1['getBlackLists'](_0x14a5de);}})[_0x2832('0x26')](function(_0x480834){if(_0x480834){_0x17b50f=_0x480834[_0x2832('0x39')];if(!_0x35a686[_0x2832('0x32')]['hasOwnProperty']('nolimit')){_0x14a5de[_0x2832('0x1f')]=qs['limit'](_0x35a686['query'][_0x2832('0x1f')]);_0x14a5de['offset']=qs[_0x2832('0x1e')](_0x35a686[_0x2832('0x32')]['offset']);}return _0x21b2d1[_0x2832('0x8c')](_0x14a5de);}})['then'](function(_0xf2e412){if(_0xf2e412){return _0xf2e412?{'count':_0x17b50f,'rows':_0xf2e412}:null;}})['then'](respondWithResult(_0x58d63a,null))['catch'](handleError(_0x58d63a,null));};exports[_0x2832('0x8d')]=function(_0x330a33,_0x35fe1f,_0x415a1f){var _0x1c11a6,_0x4463ab;var _0x5d342e=[];var _0x16bde5=moment()['format'](_0x2832('0x8e'));return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x330a33[_0x2832('0x48')]['id']}})['then'](handleEntityNotFound(_0x35fe1f,null))[_0x2832('0x26')](function(_0x4529a0){if(_0x4529a0){_0x4463ab=_0x4529a0;return _0x4529a0['addBlackLists'](_0x330a33[_0x2832('0x4a')][_0x2832('0x64')],_[_0x2832('0x52')](_0x330a33[_0x2832('0x4a')],['ids','id'])||{});}return null;})[_0x2832('0x65')](function(_0x5da40f){var _0x3cdd31;var _0xd44100;_0x1c11a6=_0x5da40f||[];var _0x555213=[];if(_0x5da40f){for(var _0x2b3648=0x0;_0x2b3648<_0x5da40f[_0x2832('0x39')];_0x2b3648+=0x1){var _0x14172d=_0x5da40f[_0x2b3648]['get']({'plain':!![]});_0x3cdd31=squel[_0x2832('0x7c')]()[_0x2832('0x68')](_0x2832('0x8f'))['fromQuery']([_0x2832('0x6a'),_0x2832('0x7d'),'ListId','CampaignId',_0x2832('0x53'),_0x2832('0x54')],squel[_0x2832('0x6d')]()[_0x2832('0x6e')]('phone',_0x2832('0x6a'))['field']('id',_0x2832('0x7d'))[_0x2832('0x6e')](_0x14172d['CmListId'][_0x2832('0x71')](),_0x2832('0x6c'))[_0x2832('0x6e')](_0x330a33[_0x2832('0x48')]['id'][_0x2832('0x71')](),_0x2832('0x5c'))['field']('NOW()',_0x2832('0x53'))[_0x2832('0x6e')](_0x2832('0x6f'),'updatedAt')[_0x2832('0x79')](_0x2832('0x72'))['where'](_0x2832('0x73'))[_0x2832('0x3e')]('ListId\x20=\x20?',_0x14172d[_0x2832('0x70')]['toString']())[_0x2832('0x3e')](_0x2832('0x7b')))['toString']();_0x555213[_0x2832('0x89')](db['sequelize'][_0x2832('0x32')](_0x3cdd31));}return BPromise[_0x2832('0x8b')](_0x555213);}})['then'](function(){return _0x1c11a6;})[_0x2832('0x26')](respondWithResult(_0x35fe1f,null))['catch'](handleError(_0x35fe1f,null));};exports['removeBlackLists']=function(_0x7151b3,_0x44ec34,_0x9b2fc4){return db[_0x2832('0x2e')][_0x2832('0x4e')]({'where':{'id':_0x7151b3[_0x2832('0x48')]['id']}})[_0x2832('0x26')](handleEntityNotFound(_0x44ec34,null))['then'](function(_0x50f35b){if(_0x50f35b){return _0x50f35b[_0x2832('0x90')](_0x7151b3[_0x2832('0x32')][_0x2832('0x64')]);}})['then'](function(_0x5b6280){if(_0x5b6280){return db[_0x2832('0x60')][_0x2832('0x27')]({'where':{'ListId':_0x7151b3[_0x2832('0x32')]['ids'],'CampaignId':_0x7151b3[_0x2832('0x48')]['id']}})[_0x2832('0x26')](function(){return _0x5b6280;});}})[_0x2832('0x26')](respondWithStatusCode(_0x44ec34,null))[_0x2832('0x47')](handleError(_0x44ec34,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index ce3418d..481ae88 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4d1f59,_0x4483ec){var _0x468441=function(_0x183185){while(--_0x183185){_0x4d1f59['push'](_0x4d1f59['shift']());}};_0x468441(++_0x4483ec);}(_0x7a54,0x106));var _0x47a5=function(_0x412a12,_0x430906){_0x412a12=_0x412a12-0x0;var _0x18946e=_0x7a54[_0x412a12];return _0x18946e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 c8ed0f3..d691a7e 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 _0x7119=['limit','include','model','map','GetCampaign','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','options','raw','attributes'];(function(_0x592007,_0x522e94){var _0x2c8434=function(_0x2e98c1){while(--_0x2e98c1){_0x592007['push'](_0x592007['shift']());}};_0x2c8434(++_0x522e94);}(_0x7119,0x1c7));var _0x9711=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0x7119[_0x64a51];return _0x1eba45;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var moment=require('moment');var BPromise=require(_0x9711('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9711('0x2'));var db=require(_0x9711('0x3'))['db'];var utils=require(_0x9711('0x4'));var logger=require(_0x9711('0x5'))('rpc');var config=require(_0x9711('0x6'));var jayson=require(_0x9711('0x7'));var client=jayson[_0x9711('0x8')][_0x9711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191701,_0x4c75dd,_0x31af88){return new BPromise(function(_0x3a5f79,_0x132b5b){return client['request'](_0x191701,_0x31af88)[_0x9711('0xa')](function(_0x4b13b9){logger[_0x9711('0xb')](_0x9711('0xc'),_0x4c75dd,_0x9711('0xd'));logger['debug'](_0x9711('0xe'),_0x4c75dd,_0x9711('0xd'),JSON[_0x9711('0xf')](_0x4b13b9));if(_0x4b13b9[_0x9711('0x10')]){if(_0x4b13b9[_0x9711('0x10')][_0x9711('0x11')]===0x1f4){logger[_0x9711('0x10')](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x132b5b(_0x4b13b9[_0x9711('0x10')]['message']);}logger['error'](_0x9711('0xc'),_0x4c75dd,_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);return _0x3a5f79(_0x4b13b9[_0x9711('0x10')][_0x9711('0x12')]);}else{logger['info'](_0x9711('0xc'),_0x4c75dd,'request\x20sent');_0x3a5f79(_0x4b13b9[_0x9711('0x13')][_0x9711('0x12')]);}})[_0x9711('0x14')](function(_0x640894){logger[_0x9711('0x10')]('Campaign,\x20%s,\x20%s',_0x4c75dd,_0x640894);_0x132b5b(_0x640894);});});}exports['GetCampaign']=function(_0x2ef16c){var _0x3615c9=this;return new Promise(function(_0x210f8b,_0x4629e2){return db[_0x9711('0x15')]['findAll']({'raw':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c[_0x9711('0x16')][_0x9711('0x17')]===undefined?!![]:![]:!![],'where':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options']['where']||null:null,'attributes':_0x2ef16c['options']?_0x2ef16c[_0x9711('0x16')][_0x9711('0x18')]||null:null,'limit':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x19')]||null:null,'include':_0x2ef16c[_0x9711('0x16')]?_0x2ef16c['options'][_0x9711('0x1a')]?_['map'](_0x2ef16c[_0x9711('0x16')]['include'],function(_0x3023cf){return{'model':db[_0x3023cf[_0x9711('0x1b')]],'as':_0x3023cf['as'],'attributes':_0x3023cf['attributes'],'include':_0x3023cf[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x3023cf[_0x9711('0x1a')],function(_0x2db327){return{'model':db[_0x2db327['model']],'as':_0x2db327['as'],'attributes':_0x2db327['attributes'],'include':_0x2db327[_0x9711('0x1a')]?_[_0x9711('0x1c')](_0x2db327['include'],function(_0x4d16e5){return{'model':db[_0x4d16e5['model']],'as':_0x4d16e5['as'],'attributes':_0x4d16e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x9711('0xa')](function(_0x270da2){logger['info'](_0x9711('0x1d'),_0x2ef16c);logger['debug'](_0x9711('0x1d'),_0x2ef16c,JSON[_0x9711('0xf')](_0x270da2));_0x210f8b(_0x270da2);})['catch'](function(_0x3fc5bb){logger[_0x9711('0x10')](_0x9711('0x1d'),_0x3fc5bb[_0x9711('0x12')],_0x2ef16c);_0x4629e2(_0x3615c9['error'](0x1f4,_0x3fc5bb[_0x9711('0x12')]));});});}; \ No newline at end of file +var _0xc7e9=['error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a544a,_0x73a217){var _0x342f1e=function(_0x519dce){while(--_0x519dce){_0x3a544a['push'](_0x3a544a['shift']());}};_0x342f1e(++_0x73a217);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc7e9[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x9c7e('0x0'));var util=require(_0x9c7e('0x1'));var moment=require('moment');var BPromise=require(_0x9c7e('0x2'));var rs=require(_0x9c7e('0x3'));var fs=require('fs');var Redis=require(_0x9c7e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c7e('0x5'));var logger=require(_0x9c7e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c7e('0x7'));var client=jayson['client'][_0x9c7e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c96a9,_0x15399d,_0x39b04b){return new BPromise(function(_0x54e2c6,_0x2f97c0){return client[_0x9c7e('0x9')](_0x2c96a9,_0x39b04b)[_0x9c7e('0xa')](function(_0x21f6fe){logger['info'](_0x9c7e('0xb'),_0x15399d,_0x9c7e('0xc'));logger['debug'](_0x9c7e('0xd'),_0x15399d,'request\x20sent',JSON[_0x9c7e('0xe')](_0x21f6fe));if(_0x21f6fe[_0x9c7e('0xf')]){if(_0x21f6fe['error'][_0x9c7e('0x10')]===0x1f4){logger['error'](_0x9c7e('0xb'),_0x15399d,_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x2f97c0(_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);}logger['error'](_0x9c7e('0xb'),_0x15399d,_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);return _0x54e2c6(_0x21f6fe[_0x9c7e('0xf')][_0x9c7e('0x11')]);}else{logger[_0x9c7e('0x12')]('Campaign,\x20%s,\x20%s',_0x15399d,_0x9c7e('0xc'));_0x54e2c6(_0x21f6fe[_0x9c7e('0x13')][_0x9c7e('0x11')]);}})[_0x9c7e('0x14')](function(_0x26871f){logger['error'](_0x9c7e('0xb'),_0x15399d,_0x26871f);_0x2f97c0(_0x26871f);});});}exports[_0x9c7e('0x15')]=function(_0x5af216){var _0x164412=this;return new Promise(function(_0x26dd66,_0x15d639){return db[_0x9c7e('0x16')][_0x9c7e('0x17')]({'raw':_0x5af216['options']?_0x5af216[_0x9c7e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5af216[_0x9c7e('0x18')]?_0x5af216['options']['where']||null:null,'attributes':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x19')]||null:null,'limit':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')]['limit']||null:null,'include':_0x5af216[_0x9c7e('0x18')]?_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x5af216[_0x9c7e('0x18')][_0x9c7e('0x1a')],function(_0x376e0c){return{'model':db[_0x376e0c[_0x9c7e('0x1c')]],'as':_0x376e0c['as'],'attributes':_0x376e0c[_0x9c7e('0x19')],'include':_0x376e0c[_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x376e0c[_0x9c7e('0x1a')],function(_0x4a8a46){return{'model':db[_0x4a8a46[_0x9c7e('0x1c')]],'as':_0x4a8a46['as'],'attributes':_0x4a8a46[_0x9c7e('0x19')],'include':_0x4a8a46[_0x9c7e('0x1a')]?_[_0x9c7e('0x1b')](_0x4a8a46[_0x9c7e('0x1a')],function(_0x224056){return{'model':db[_0x224056['model']],'as':_0x224056['as'],'attributes':_0x224056['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c7e('0xa')](function(_0x46cfe0){logger[_0x9c7e('0x12')](_0x9c7e('0x15'),_0x5af216);logger[_0x9c7e('0x1d')](_0x9c7e('0x15'),_0x5af216,JSON[_0x9c7e('0xe')](_0x46cfe0));_0x26dd66(_0x46cfe0);})[_0x9c7e('0x14')](function(_0x531544){logger[_0x9c7e('0xf')]('GetCampaign',_0x531544[_0x9c7e('0x11')],_0x5af216);_0x15d639(_0x164412['error'](0x1f4,_0x531544['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 080bc7a..1cc03c3 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 _0xb7ef=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','post','create','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router'];(function(_0x157db1,_0x5652bf){var _0x169249=function(_0x463401){while(--_0x463401){_0x157db1['push'](_0x157db1['shift']());}};_0x169249(++_0x5652bf);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x3717a9,_0x17f9bc){_0x3717a9=_0x3717a9-0x0;var _0x485b85=_0xb7ef[_0x3717a9];return _0x485b85;};'use strict';var multer=require(_0xfb7e('0x0'));var util=require(_0xfb7e('0x1'));var path=require(_0xfb7e('0x2'));var timeout=require(_0xfb7e('0x3'));var express=require(_0xfb7e('0x4'));var router=express[_0xfb7e('0x5')]();var fs_extra=require(_0xfb7e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x7'));var config=require(_0xfb7e('0x8'));var controller=require('./campaign.controller');router[_0xfb7e('0x9')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xb')]);router[_0xfb7e('0x9')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['show']);router[_0xfb7e('0x9')](_0xfb7e('0xd'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xfb7e('0xf')]);router[_0xfb7e('0x9')](_0xfb7e('0x10'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x11')]);router['get']('/:id/hopper_black',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x12')]);router[_0xfb7e('0x9')]('/:id/lists',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x13')]);router[_0xfb7e('0x9')]('/:id/blacklists',auth[_0xfb7e('0xa')](),controller['getBlackLists']);router[_0xfb7e('0x14')]('/',auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x15')]);router[_0xfb7e('0x14')](_0xfb7e('0x16'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x17')]);router[_0xfb7e('0x14')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x19')]);router[_0xfb7e('0x14')](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller['addBlackLists']);router['put'](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller['update']);router[_0xfb7e('0x1b')](_0xfb7e('0xc'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1c')]);router[_0xfb7e('0x1b')](_0xfb7e('0x18'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1d')]);router['delete'](_0xfb7e('0x1a'),auth[_0xfb7e('0xa')](),controller[_0xfb7e('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x3fa4=['addLists','addBlackLists','put','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone'];(function(_0x3020cd,_0x1353ec){var _0x57e0aa=function(_0x4172f9){while(--_0x4172f9){_0x3020cd['push'](_0x3020cd['shift']());}};_0x57e0aa(++_0x1353ec);}(_0x3fa4,0x87));var _0x43fa=function(_0x49d427,_0x4a4ef8){_0x49d427=_0x49d427-0x0;var _0x319910=_0x3fa4[_0x49d427];return _0x319910;};'use strict';var multer=require('multer');var util=require(_0x43fa('0x0'));var path=require(_0x43fa('0x1'));var timeout=require(_0x43fa('0x2'));var express=require(_0x43fa('0x3'));var router=express[_0x43fa('0x4')]();var fs_extra=require(_0x43fa('0x5'));var auth=require(_0x43fa('0x6'));var interaction=require(_0x43fa('0x7'));var config=require(_0x43fa('0x8'));var controller=require(_0x43fa('0x9'));router[_0x43fa('0xa')]('/',auth[_0x43fa('0xb')](),controller['index']);router[_0x43fa('0xa')](_0x43fa('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x43fa('0xd'),auth[_0x43fa('0xb')](),controller[_0x43fa('0xe')]);router[_0x43fa('0xa')](_0x43fa('0xf'),auth[_0x43fa('0xb')](),controller['getHopperHistories']);router[_0x43fa('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x43fa('0x10')]);router[_0x43fa('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x43fa('0x11')]);router[_0x43fa('0xa')](_0x43fa('0x12'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x13')]);router[_0x43fa('0xa')](_0x43fa('0x14'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x15')]);router[_0x43fa('0x16')]('/',auth[_0x43fa('0xb')](),controller['create']);router[_0x43fa('0x16')](_0x43fa('0x17'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x18')]);router[_0x43fa('0x16')](_0x43fa('0x12'),auth['isAuthenticated'](),controller[_0x43fa('0x19')]);router[_0x43fa('0x16')](_0x43fa('0x14'),auth[_0x43fa('0xb')](),controller[_0x43fa('0x1a')]);router[_0x43fa('0x1b')](_0x43fa('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43fa('0x1c')](_0x43fa('0xc'),auth[_0x43fa('0xb')](),controller['destroy']);router['delete']('/:id/lists',auth[_0x43fa('0xb')](),controller[_0x43fa('0x1d')]);router[_0x43fa('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x43fa('0x1e')]);module[_0x43fa('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 492a4bb..672111a 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 _0x6248=['STRING','VIRTUAL','key','sequelize','TEXT','medium'];(function(_0x598f75,_0x318fbe){var _0x2351c1=function(_0x12f0b0){while(--_0x12f0b0){_0x598f75['push'](_0x598f75['shift']());}};_0x2351c1(++_0x318fbe);}(_0x6248,0x10b));var _0x8624=function(_0x562eca,_0x3fa3b3){_0x562eca=_0x562eca-0x0;var _0x189dc3=_0x6248[_0x562eca];return _0x189dc3;};'use strict';var Sequelize=require(_0x8624('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8624('0x1')],'length':_0x8624('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8624('0x3')]},'name':{'type':Sequelize[_0x8624('0x4')],'get':function(){return this['getDataValue'](_0x8624('0x5'));}}}; \ No newline at end of file +var _0x2273=['key','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x3ca825,_0x47905a){var _0x89f1ca=function(_0x358b32){while(--_0x358b32){_0x3ca825['push'](_0x3ca825['shift']());}};_0x89f1ca(++_0x47905a);}(_0x2273,0xec));var _0x3227=function(_0x2bd20a,_0x1a9924){_0x2bd20a=_0x2bd20a-0x0;var _0x373500=_0x2273[_0x2bd20a];return _0x373500;};'use strict';var Sequelize=require(_0x3227('0x0'));module['exports']={'key':{'type':Sequelize[_0x3227('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x3227('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x3227('0x1')]},'name':{'type':Sequelize[_0x3227('0x3')],'get':function(){return this['getDataValue'](_0x3227('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9777d53..af15577 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 _0xa7b4=['key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','CannedAnswers','error','stack','name','send','index','map','CannedAnswer','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','options','find','body','params','create'];(function(_0x7179ba,_0x37504f){var _0x4ad820=function(_0x131107){while(--_0x131107){_0x7179ba['push'](_0x7179ba['shift']());}};_0x4ad820(++_0x37504f);}(_0xa7b4,0xc9));var _0x4a7b=function(_0x1716c1,_0x4f3a3b){_0x1716c1=_0x1716c1-0x0;var _0x1ca528=_0xa7b4[_0x1716c1];return _0x1ca528;};'use strict';var emlformat=require(_0x4a7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a7b('0x1'));var jsonpatch=require(_0x4a7b('0x2'));var rp=require(_0x4a7b('0x3'));var moment=require(_0x4a7b('0x4'));var BPromise=require(_0x4a7b('0x5'));var Mustache=require('mustache');var util=require(_0x4a7b('0x6'));var path=require(_0x4a7b('0x7'));var sox=require(_0x4a7b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a7b('0x9'));var squel=require(_0x4a7b('0xa'));var crypto=require('crypto');var jsforce=require(_0x4a7b('0xb'));var deskjs=require(_0x4a7b('0xc'));var toCsv=require(_0x4a7b('0xd'));var querystring=require(_0x4a7b('0xe'));var Papa=require(_0x4a7b('0xf'));var Redis=require(_0x4a7b('0x10'));var authService=require(_0x4a7b('0x11'));var qs=require(_0x4a7b('0x12'));var as=require(_0x4a7b('0x13'));var hardwareService=require(_0x4a7b('0x14'));var logger=require(_0x4a7b('0x15'))(_0x4a7b('0x16'));var utils=require(_0x4a7b('0x17'));var config=require(_0x4a7b('0x18'));var licenseUtil=require(_0x4a7b('0x19'));var db=require(_0x4a7b('0x1a'))['db'];function respondWithStatusCode(_0x1b172f,_0x3b33e1){_0x3b33e1=_0x3b33e1||0xcc;return function(_0x50ad78){if(_0x50ad78){return _0x1b172f[_0x4a7b('0x1b')](_0x3b33e1);}return _0x1b172f[_0x4a7b('0x1c')](_0x3b33e1)[_0x4a7b('0x1d')]();};}function respondWithResult(_0x5c7c08,_0x3b5361){_0x3b5361=_0x3b5361||0xc8;return function(_0x5ba39d){if(_0x5ba39d){return _0x5c7c08['status'](_0x3b5361)['json'](_0x5ba39d);}};}function respondWithFilteredResult(_0x4881f3,_0x204fe7){return function(_0x314285){if(_0x314285){var _0x153d70=typeof _0x204fe7[_0x4a7b('0x1e')]===_0x4a7b('0x1f')&&typeof _0x204fe7[_0x4a7b('0x20')]===_0x4a7b('0x1f');var _0x4a3130=_0x314285[_0x4a7b('0x21')];var _0x6d5a08=_0x153d70?0x0:_0x204fe7['offset'];var _0x25caac=_0x153d70?_0x314285[_0x4a7b('0x21')]:_0x204fe7[_0x4a7b('0x1e')]+_0x204fe7[_0x4a7b('0x20')];var _0x192b47;if(_0x25caac>=_0x4a3130){_0x25caac=_0x4a3130;_0x192b47=0xc8;}else{_0x192b47=0xce;}_0x4881f3['status'](_0x192b47);return _0x4881f3[_0x4a7b('0x22')](_0x4a7b('0x23'),_0x6d5a08+'-'+_0x25caac+'/'+_0x4a3130)[_0x4a7b('0x24')](_0x314285);}return null;};}function patchUpdates(_0x49b0fa){return function(_0x5331bb){try{jsonpatch[_0x4a7b('0x25')](_0x5331bb,_0x49b0fa,!![]);}catch(_0x513164){return BPromise['reject'](_0x513164);}return _0x5331bb[_0x4a7b('0x26')]();};}function saveUpdates(_0x2ab5fd,_0x38a81b){return function(_0x29d759){if(_0x29d759){return _0x29d759[_0x4a7b('0x27')](_0x2ab5fd)[_0x4a7b('0x28')](function(_0x4a4f6d){return _0x4a4f6d;});}return null;};}function removeEntity(_0x5c7d4d,_0x1cef0f){return function(_0x415792){if(_0x415792){return _0x415792[_0x4a7b('0x29')]()[_0x4a7b('0x28')](function(){var _0x3465e8=_0x415792[_0x4a7b('0x2a')]({'plain':!![]});var _0x10d99c=_0x4a7b('0x2b');return db['UserProfileResource'][_0x4a7b('0x29')]({'where':{'type':_0x10d99c,'resourceId':_0x3465e8['id']}})[_0x4a7b('0x28')](function(){return _0x415792;});})[_0x4a7b('0x28')](function(){_0x5c7d4d[_0x4a7b('0x1c')](0xcc)[_0x4a7b('0x1d')]();});}};}function handleEntityNotFound(_0x257f47,_0x3168e1){return function(_0x9572f6){if(!_0x9572f6){_0x257f47[_0x4a7b('0x1b')](0x194);}return _0x9572f6;};}function handleError(_0xb0f608,_0x41e82d){_0x41e82d=_0x41e82d||0x1f4;return function(_0x2748ae){logger[_0x4a7b('0x2c')](_0x2748ae[_0x4a7b('0x2d')]);if(_0x2748ae[_0x4a7b('0x2e')]){delete _0x2748ae[_0x4a7b('0x2e')];}_0xb0f608[_0x4a7b('0x1c')](_0x41e82d)[_0x4a7b('0x2f')](_0x2748ae);};}exports[_0x4a7b('0x30')]=function(_0xd41606,_0x424a39){var _0x33d10d={},_0xe6ca22={},_0x5062a1={'count':0x0,'rows':[]};var _0x51bde7=_[_0x4a7b('0x31')](db[_0x4a7b('0x32')]['rawAttributes'],function(_0x3745b6){return{'name':_0x3745b6['fieldName'],'type':_0x3745b6[_0x4a7b('0x33')]['key']};});_0xe6ca22[_0x4a7b('0x34')]=_['map'](_0x51bde7,_0x4a7b('0x2e'));_0xe6ca22['query']=_[_0x4a7b('0x35')](_0xd41606[_0x4a7b('0x36')]);_0xe6ca22['filters']=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],_0xe6ca22[_0x4a7b('0x36')]);_0x33d10d[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xe6ca22[_0x4a7b('0x34')],qs['fields'](_0xd41606['query'][_0x4a7b('0x39')]));_0x33d10d[_0x4a7b('0x38')]=_0x33d10d[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x33d10d['attributes']:_0xe6ca22[_0x4a7b('0x34')];if(!_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x3b')](_0x4a7b('0x3c'))){_0x33d10d[_0x4a7b('0x20')]=qs[_0x4a7b('0x20')](_0xd41606[_0x4a7b('0x36')]['limit']);_0x33d10d[_0x4a7b('0x1e')]=qs[_0x4a7b('0x1e')](_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x1e')]);}_0x33d10d[_0x4a7b('0x3d')]=qs['sort'](_0xd41606[_0x4a7b('0x36')]['sort']);_0x33d10d[_0x4a7b('0x3e')]=qs[_0x4a7b('0x3f')](_[_0x4a7b('0x40')](_0xd41606['query'],_0xe6ca22['filters']),_0x51bde7);if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]){_0x33d10d[_0x4a7b('0x3e')]=_['merge'](_0x33d10d[_0x4a7b('0x3e')],{'$or':[{'key':{'$like':'%'+_0xd41606['query'][_0x4a7b('0x41')]+'%'}},{'value':{'$like':'%'+_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x41')]+'%'}}]});}_0x33d10d=_[_0x4a7b('0x42')]({},_0x33d10d,_0xd41606['options']);var _0x45f426={'where':_0x33d10d[_0x4a7b('0x3e')]};return db[_0x4a7b('0x32')][_0x4a7b('0x21')](_0x45f426)[_0x4a7b('0x28')](function(_0x131cf5){_0x5062a1[_0x4a7b('0x21')]=_0x131cf5;if(_0xd41606[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x33d10d[_0x4a7b('0x44')]=[{'all':!![]}];}return db[_0x4a7b('0x32')]['findAll'](_0x33d10d);})['then'](function(_0x2b983d){_0x5062a1[_0x4a7b('0x45')]=_0x2b983d;return _0x5062a1;})[_0x4a7b('0x28')](respondWithFilteredResult(_0x424a39,_0x33d10d))[_0x4a7b('0x46')](handleError(_0x424a39,null));};exports[_0x4a7b('0x47')]=function(_0x461d4e,_0x18d947){var _0x364ba5={'raw':!![],'where':{'id':_0x461d4e['params']['id']}},_0xd7bb25={};_0xd7bb25[_0x4a7b('0x34')]=_[_0x4a7b('0x35')](db['CannedAnswer'][_0x4a7b('0x48')]);_0xd7bb25['query']=_['keys'](_0x461d4e[_0x4a7b('0x36')]);_0xd7bb25[_0x4a7b('0x3f')]=_[_0x4a7b('0x37')](_0xd7bb25[_0x4a7b('0x34')],_0xd7bb25[_0x4a7b('0x36')]);_0x364ba5[_0x4a7b('0x38')]=_[_0x4a7b('0x37')](_0xd7bb25['model'],qs['fields'](_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x39')]));_0x364ba5['attributes']=_0x364ba5[_0x4a7b('0x38')][_0x4a7b('0x3a')]?_0x364ba5[_0x4a7b('0x38')]:_0xd7bb25[_0x4a7b('0x34')];if(_0x461d4e[_0x4a7b('0x36')][_0x4a7b('0x43')]){_0x364ba5[_0x4a7b('0x44')]=[{'all':!![]}];}_0x364ba5=_[_0x4a7b('0x42')]({},_0x364ba5,_0x461d4e[_0x4a7b('0x49')]);return db[_0x4a7b('0x32')][_0x4a7b('0x4a')](_0x364ba5)[_0x4a7b('0x28')](handleEntityNotFound(_0x18d947,null))[_0x4a7b('0x28')](respondWithResult(_0x18d947,null))[_0x4a7b('0x46')](handleError(_0x18d947,null));};exports['update']=function(_0x208da2,_0x1d818e){if(_0x208da2[_0x4a7b('0x4b')]['id']){delete _0x208da2[_0x4a7b('0x4b')]['id'];}return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x208da2[_0x4a7b('0x4c')]['id']}})[_0x4a7b('0x28')](handleEntityNotFound(_0x1d818e,null))[_0x4a7b('0x28')](saveUpdates(_0x208da2['body'],null))[_0x4a7b('0x28')](respondWithResult(_0x1d818e,null))[_0x4a7b('0x46')](handleError(_0x1d818e,null));};exports[_0x4a7b('0x29')]=function(_0x30bec3,_0x4c6f0e){return db[_0x4a7b('0x32')]['find']({'where':{'id':_0x30bec3[_0x4a7b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c6f0e,null))[_0x4a7b('0x28')](removeEntity(_0x4c6f0e,null))[_0x4a7b('0x46')](handleError(_0x4c6f0e,null));};exports[_0x4a7b('0x4d')]=function(_0x1b1550,_0x1f5b4e){var _0x52a45f={'key':_0x1b1550['body'][_0x4a7b('0x4e')]};if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')]){_0x52a45f['MailAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x4f')];}else if(_0x1b1550[_0x4a7b('0x4b')]['SmsAccountId']){_0x52a45f['SmsAccountId']=_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x50')];}else if(_0x1b1550[_0x4a7b('0x4b')][_0x4a7b('0x51')]){_0x52a45f[_0x4a7b('0x51')]=_0x1b1550[_0x4a7b('0x4b')]['OpenchannelAccountId'];}else if(_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId']){_0x52a45f[_0x4a7b('0x52')]=_0x1b1550[_0x4a7b('0x4b')]['ChatWebsiteId'];}return db[_0x4a7b('0x32')][_0x4a7b('0x4a')]({'where':_0x52a45f})['then'](function(_0x1f3427){if(_0x1f3427){throw new db[(_0x4a7b('0x53'))][(_0x4a7b('0x54'))](_0x4a7b('0x55'));}return db[_0x4a7b('0x32')][_0x4a7b('0x4d')](_0x1b1550[_0x4a7b('0x4b')]);})[_0x4a7b('0x28')](function(_0x246e0f){var _0x39811c=_0x1b1550[_0x4a7b('0x56')][_0x4a7b('0x2a')]({'plain':!![]});if(!_0x39811c)throw new Error(_0x4a7b('0x57'));if(_0x39811c['role']===_0x4a7b('0x56')){var _0x32f0fc=_0x246e0f['get']({'plain':!![]});return db[_0x4a7b('0x58')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x39811c[_0x4a7b('0x59')]},'raw':!![]})['then'](function(_0x505b62){if(_0x505b62&&_0x505b62[_0x4a7b('0x5a')]===0x0){return db[_0x4a7b('0x5b')][_0x4a7b('0x4d')]({'name':_0x32f0fc[_0x4a7b('0x2e')],'resourceId':_0x32f0fc['id'],'type':_0x505b62['name'],'sectionId':_0x505b62['id']},{})['then'](function(){return _0x246e0f;});}else{return _0x246e0f;}})[_0x4a7b('0x46')](function(_0x4fa965){logger[_0x4a7b('0x2c')](_0x4a7b('0x5c'),_0x4fa965);throw _0x4fa965;});}return _0x246e0f;})[_0x4a7b('0x28')](respondWithResult(_0x1f5b4e,0xc9))[_0x4a7b('0x46')](handleError(_0x1f5b4e,null));}; \ No newline at end of file +var _0xaa2e=['catch','show','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','where','pick','filter','options','includeAll','include','rows'];(function(_0x4b6c62,_0x3a7a89){var _0x377eb6=function(_0x5a1cd6){while(--_0x5a1cd6){_0x4b6c62['push'](_0x4b6c62['shift']());}};_0x377eb6(++_0x3a7a89);}(_0xaa2e,0xc1));var _0xeaa2=function(_0x54fa80,_0x1c2ac9){_0x54fa80=_0x54fa80-0x0;var _0x4c894d=_0xaa2e[_0x54fa80];return _0x4c894d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaa2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeaa2('0x1'));var BPromise=require(_0xeaa2('0x2'));var Mustache=require(_0xeaa2('0x3'));var util=require(_0xeaa2('0x4'));var path=require('path');var sox=require(_0xeaa2('0x5'));var csv=require(_0xeaa2('0x6'));var ejs=require(_0xeaa2('0x7'));var fs=require('fs');var fs_extra=require(_0xeaa2('0x8'));var _=require(_0xeaa2('0x9'));var squel=require(_0xeaa2('0xa'));var crypto=require('crypto');var jsforce=require(_0xeaa2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeaa2('0x6'));var querystring=require('querystring');var Papa=require(_0xeaa2('0xc'));var Redis=require(_0xeaa2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeaa2('0xe'));var hardwareService=require(_0xeaa2('0xf'));var logger=require(_0xeaa2('0x10'))(_0xeaa2('0x11'));var utils=require(_0xeaa2('0x12'));var config=require(_0xeaa2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xeaa2('0x14'))['db'];function respondWithStatusCode(_0x42ee49,_0x378a12){_0x378a12=_0x378a12||0xcc;return function(_0x578cfd){if(_0x578cfd){return _0x42ee49[_0xeaa2('0x15')](_0x378a12);}return _0x42ee49[_0xeaa2('0x16')](_0x378a12)[_0xeaa2('0x17')]();};}function respondWithResult(_0x3d2c78,_0x339dea){_0x339dea=_0x339dea||0xc8;return function(_0x54eef6){if(_0x54eef6){return _0x3d2c78[_0xeaa2('0x16')](_0x339dea)[_0xeaa2('0x18')](_0x54eef6);}};}function respondWithFilteredResult(_0x425d4d,_0x1bff0e){return function(_0x316bc5){if(_0x316bc5){var _0x1ad1f7=typeof _0x1bff0e[_0xeaa2('0x19')]==='undefined'&&typeof _0x1bff0e[_0xeaa2('0x1a')]==='undefined';var _0x3b4dd3=_0x316bc5[_0xeaa2('0x1b')];var _0x362794=_0x1ad1f7?0x0:_0x1bff0e['offset'];var _0x23cfe8=_0x1ad1f7?_0x316bc5[_0xeaa2('0x1b')]:_0x1bff0e[_0xeaa2('0x19')]+_0x1bff0e[_0xeaa2('0x1a')];var _0x5f5d30;if(_0x23cfe8>=_0x3b4dd3){_0x23cfe8=_0x3b4dd3;_0x5f5d30=0xc8;}else{_0x5f5d30=0xce;}_0x425d4d[_0xeaa2('0x16')](_0x5f5d30);return _0x425d4d[_0xeaa2('0x1c')](_0xeaa2('0x1d'),_0x362794+'-'+_0x23cfe8+'/'+_0x3b4dd3)[_0xeaa2('0x18')](_0x316bc5);}return null;};}function patchUpdates(_0x3a832a){return function(_0x26c197){try{jsonpatch[_0xeaa2('0x1e')](_0x26c197,_0x3a832a,!![]);}catch(_0x1986b3){return BPromise[_0xeaa2('0x1f')](_0x1986b3);}return _0x26c197[_0xeaa2('0x20')]();};}function saveUpdates(_0x28f166,_0x3ecaa6){return function(_0x4b334b){if(_0x4b334b){return _0x4b334b[_0xeaa2('0x21')](_0x28f166)[_0xeaa2('0x22')](function(_0x4ed7ab){return _0x4ed7ab;});}return null;};}function removeEntity(_0x31b5fc,_0x34c1a7){return function(_0x4a2890){if(_0x4a2890){return _0x4a2890[_0xeaa2('0x23')]()[_0xeaa2('0x22')](function(){var _0x2b18f5=_0x4a2890[_0xeaa2('0x24')]({'plain':!![]});var _0x5df68f='CannedAnswers';return db[_0xeaa2('0x25')][_0xeaa2('0x23')]({'where':{'type':_0x5df68f,'resourceId':_0x2b18f5['id']}})[_0xeaa2('0x22')](function(){return _0x4a2890;});})[_0xeaa2('0x22')](function(){_0x31b5fc['status'](0xcc)[_0xeaa2('0x17')]();});}};}function handleEntityNotFound(_0x2a6309,_0x42ebce){return function(_0x5f4536){if(!_0x5f4536){_0x2a6309[_0xeaa2('0x15')](0x194);}return _0x5f4536;};}function handleError(_0x4e1851,_0x4af6c9){_0x4af6c9=_0x4af6c9||0x1f4;return function(_0x2f5216){logger[_0xeaa2('0x26')](_0x2f5216['stack']);if(_0x2f5216[_0xeaa2('0x27')]){delete _0x2f5216[_0xeaa2('0x27')];}_0x4e1851[_0xeaa2('0x16')](_0x4af6c9)[_0xeaa2('0x28')](_0x2f5216);};}exports['index']=function(_0x1a969d,_0x5230d5){var _0x2959b0={},_0x224bfe={},_0x465a55={'count':0x0,'rows':[]};var _0x24cdaf=_['map'](db[_0xeaa2('0x29')][_0xeaa2('0x2a')],function(_0x1068c7){return{'name':_0x1068c7[_0xeaa2('0x2b')],'type':_0x1068c7[_0xeaa2('0x2c')][_0xeaa2('0x2d')]};});_0x224bfe[_0xeaa2('0x2e')]=_[_0xeaa2('0x2f')](_0x24cdaf,'name');_0x224bfe['query']=_[_0xeaa2('0x30')](_0x1a969d['query']);_0x224bfe[_0xeaa2('0x31')]=_[_0xeaa2('0x32')](_0x224bfe['model'],_0x224bfe['query']);_0x2959b0[_0xeaa2('0x33')]=_['intersection'](_0x224bfe[_0xeaa2('0x2e')],qs[_0xeaa2('0x34')](_0x1a969d['query'][_0xeaa2('0x34')]));_0x2959b0[_0xeaa2('0x33')]=_0x2959b0[_0xeaa2('0x33')][_0xeaa2('0x35')]?_0x2959b0[_0xeaa2('0x33')]:_0x224bfe['model'];if(!_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x37')](_0xeaa2('0x38'))){_0x2959b0['limit']=qs[_0xeaa2('0x1a')](_0x1a969d['query'][_0xeaa2('0x1a')]);_0x2959b0[_0xeaa2('0x19')]=qs['offset'](_0x1a969d['query'][_0xeaa2('0x19')]);}_0x2959b0[_0xeaa2('0x39')]=qs['sort'](_0x1a969d[_0xeaa2('0x36')]['sort']);_0x2959b0[_0xeaa2('0x3a')]=qs[_0xeaa2('0x31')](_[_0xeaa2('0x3b')](_0x1a969d[_0xeaa2('0x36')],_0x224bfe[_0xeaa2('0x31')]),_0x24cdaf);if(_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x3c')]){_0x2959b0[_0xeaa2('0x3a')]=_['merge'](_0x2959b0[_0xeaa2('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1a969d[_0xeaa2('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x1a969d['query'][_0xeaa2('0x3c')]+'%'}}]});}_0x2959b0=_['merge']({},_0x2959b0,_0x1a969d[_0xeaa2('0x3d')]);var _0x3995bd={'where':_0x2959b0[_0xeaa2('0x3a')]};return db[_0xeaa2('0x29')][_0xeaa2('0x1b')](_0x3995bd)[_0xeaa2('0x22')](function(_0x3360d0){_0x465a55[_0xeaa2('0x1b')]=_0x3360d0;if(_0x1a969d[_0xeaa2('0x36')][_0xeaa2('0x3e')]){_0x2959b0[_0xeaa2('0x3f')]=[{'all':!![]}];}return db[_0xeaa2('0x29')]['findAll'](_0x2959b0);})[_0xeaa2('0x22')](function(_0xa46811){_0x465a55[_0xeaa2('0x40')]=_0xa46811;return _0x465a55;})[_0xeaa2('0x22')](respondWithFilteredResult(_0x5230d5,_0x2959b0))[_0xeaa2('0x41')](handleError(_0x5230d5,null));};exports[_0xeaa2('0x42')]=function(_0x4c4650,_0x5987ec){var _0x44516e={'raw':!![],'where':{'id':_0x4c4650['params']['id']}},_0x53c65d={};_0x53c65d['model']=_[_0xeaa2('0x30')](db['CannedAnswer']['rawAttributes']);_0x53c65d[_0xeaa2('0x36')]=_['keys'](_0x4c4650[_0xeaa2('0x36')]);_0x53c65d[_0xeaa2('0x31')]=_[_0xeaa2('0x32')](_0x53c65d[_0xeaa2('0x2e')],_0x53c65d[_0xeaa2('0x36')]);_0x44516e[_0xeaa2('0x33')]=_['intersection'](_0x53c65d['model'],qs[_0xeaa2('0x34')](_0x4c4650['query'][_0xeaa2('0x34')]));_0x44516e[_0xeaa2('0x33')]=_0x44516e[_0xeaa2('0x33')][_0xeaa2('0x35')]?_0x44516e['attributes']:_0x53c65d[_0xeaa2('0x2e')];if(_0x4c4650['query']['includeAll']){_0x44516e[_0xeaa2('0x3f')]=[{'all':!![]}];}_0x44516e=_['merge']({},_0x44516e,_0x4c4650[_0xeaa2('0x3d')]);return db[_0xeaa2('0x29')]['find'](_0x44516e)[_0xeaa2('0x22')](handleEntityNotFound(_0x5987ec,null))[_0xeaa2('0x22')](respondWithResult(_0x5987ec,null))['catch'](handleError(_0x5987ec,null));};exports[_0xeaa2('0x21')]=function(_0x35e8cf,_0x501b7a){if(_0x35e8cf[_0xeaa2('0x43')]['id']){delete _0x35e8cf['body']['id'];}return db[_0xeaa2('0x29')][_0xeaa2('0x44')]({'where':{'id':_0x35e8cf[_0xeaa2('0x45')]['id']}})[_0xeaa2('0x22')](handleEntityNotFound(_0x501b7a,null))[_0xeaa2('0x22')](saveUpdates(_0x35e8cf['body'],null))[_0xeaa2('0x22')](respondWithResult(_0x501b7a,null))[_0xeaa2('0x41')](handleError(_0x501b7a,null));};exports['destroy']=function(_0x29d710,_0x11f7f8){return db['CannedAnswer'][_0xeaa2('0x44')]({'where':{'id':_0x29d710[_0xeaa2('0x45')]['id']}})['then'](handleEntityNotFound(_0x11f7f8,null))[_0xeaa2('0x22')](removeEntity(_0x11f7f8,null))[_0xeaa2('0x41')](handleError(_0x11f7f8,null));};exports[_0xeaa2('0x46')]=function(_0x40a847,_0x364e42){var _0x44361c={'key':_0x40a847[_0xeaa2('0x43')]['key']};if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x47')]){_0x44361c[_0xeaa2('0x47')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x47')];}else if(_0x40a847[_0xeaa2('0x43')]['SmsAccountId']){_0x44361c[_0xeaa2('0x48')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x48')];}else if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x49')]){_0x44361c['OpenchannelAccountId']=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x49')];}else if(_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x4a')]){_0x44361c[_0xeaa2('0x4a')]=_0x40a847[_0xeaa2('0x43')][_0xeaa2('0x4a')];}return db['CannedAnswer']['find']({'where':_0x44361c})[_0xeaa2('0x22')](function(_0x1f484e){if(_0x1f484e){throw new db[(_0xeaa2('0x4b'))][(_0xeaa2('0x4c'))](_0xeaa2('0x4d'));}return db[_0xeaa2('0x29')][_0xeaa2('0x46')](_0x40a847[_0xeaa2('0x43')]);})[_0xeaa2('0x22')](function(_0x912208){var _0x30dd27=_0x40a847[_0xeaa2('0x4e')][_0xeaa2('0x24')]({'plain':!![]});if(!_0x30dd27)throw new Error(_0xeaa2('0x4f'));if(_0x30dd27[_0xeaa2('0x50')]===_0xeaa2('0x4e')){var _0x2d8b1d=_0x912208[_0xeaa2('0x24')]({'plain':!![]});return db[_0xeaa2('0x51')]['find']({'where':{'name':_0xeaa2('0x52'),'userProfileId':_0x30dd27[_0xeaa2('0x53')]},'raw':!![]})['then'](function(_0x54d3d8){if(_0x54d3d8&&_0x54d3d8[_0xeaa2('0x54')]===0x0){return db['UserProfileResource'][_0xeaa2('0x46')]({'name':_0x2d8b1d[_0xeaa2('0x27')],'resourceId':_0x2d8b1d['id'],'type':_0x54d3d8[_0xeaa2('0x27')],'sectionId':_0x54d3d8['id']},{})[_0xeaa2('0x22')](function(){return _0x912208;});}else{return _0x912208;}})[_0xeaa2('0x41')](function(_0x3f6c01){logger['error'](_0xeaa2('0x55'),_0x3f6c01);throw _0x3f6c01;});}return _0x912208;})[_0xeaa2('0x22')](respondWithResult(_0x364e42,0xc9))[_0xeaa2('0x41')](handleError(_0x364e42,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9a5b990..17d782d 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 _0xee69=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x149254,_0xafe8da){var _0x249023=function(_0x5d99fd){while(--_0x5d99fd){_0x149254['push'](_0x149254['shift']());}};_0x249023(++_0xafe8da);}(_0xee69,0x91));var _0x9ee6=function(_0x1395e7,_0x1138c2){_0x1395e7=_0x1395e7-0x0;var _0x5d5331=_0xee69[_0x1395e7];return _0x5d5331;};'use strict';var _=require('lodash');var util=require(_0x9ee6('0x0'));var logger=require(_0x9ee6('0x1'))(_0x9ee6('0x2'));var moment=require(_0x9ee6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ee6('0x4'));var fs=require('fs');var path=require(_0x9ee6('0x5'));var rimraf=require(_0x9ee6('0x6'));var config=require(_0x9ee6('0x7'));var attributes=require(_0x9ee6('0x8'));module[_0x9ee6('0x9')]=function(_0x136381,_0x327327){return _0x136381[_0x9ee6('0xa')](_0x9ee6('0xb'),attributes,{'tableName':_0x9ee6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ee6('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbbf6=['api','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x19d2c8,_0x3eaadc){var _0x14805a=function(_0x181afd){while(--_0x181afd){_0x19d2c8['push'](_0x19d2c8['shift']());}};_0x14805a(++_0x3eaadc);}(_0xbbf6,0x143));var _0x6bbf=function(_0x227c85,_0x1f839c){_0x227c85=_0x227c85-0x0;var _0x3de7ca=_0xbbf6[_0x227c85];return _0x3de7ca;};'use strict';var _=require(_0x6bbf('0x0'));var util=require('util');var logger=require(_0x6bbf('0x1'))(_0x6bbf('0x2'));var moment=require(_0x6bbf('0x3'));var BPromise=require(_0x6bbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bbf('0x5'));var rimraf=require('rimraf');var config=require(_0x6bbf('0x6'));var attributes=require(_0x6bbf('0x7'));module[_0x6bbf('0x8')]=function(_0x4670a0,_0x37a458){return _0x4670a0[_0x6bbf('0x9')]('CannedAnswer',attributes,{'tableName':_0x6bbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6bbf('0xb'),'collate':_0x6bbf('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0e49142..d59e761 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(_0x3ac366,_0x2d6458){var _0x195225=function(_0x4f4e74){while(--_0x4f4e74){_0x3ac366['push'](_0x3ac366['shift']());}};_0x195225(++_0x2d6458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1f95a4,_0x16db7c){var _0x9e7049=function(_0x4bbd55){while(--_0x4bbd55){_0x1f95a4['push'](_0x1f95a4['shift']());}};_0x9e7049(++_0x16db7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 7bbf6b9..0264e5a 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 _0xbdb8=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xbdb8,0xb3));var _0x8bdb=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xbdb8[_0x137f1a];return _0x439923;};'use strict';var multer=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var path=require('path');var timeout=require(_0x8bdb('0x2'));var express=require(_0x8bdb('0x3'));var router=express[_0x8bdb('0x4')]();var fs_extra=require(_0x8bdb('0x5'));var auth=require(_0x8bdb('0x6'));var interaction=require(_0x8bdb('0x7'));var config=require(_0x8bdb('0x8'));var controller=require(_0x8bdb('0x9'));router[_0x8bdb('0xa')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0xc')]);router[_0x8bdb('0xa')](_0x8bdb('0xd'),auth['isAuthenticated'](),controller[_0x8bdb('0xe')]);router[_0x8bdb('0xf')]('/',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x10')]);router[_0x8bdb('0x11')]('/:id',auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x12')]);router[_0x8bdb('0x13')](_0x8bdb('0xd'),auth[_0x8bdb('0xb')](),controller[_0x8bdb('0x14')]);module[_0x8bdb('0x15')]=router; \ No newline at end of file +var _0x3b63=['show','post','create','put','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x3b63,0x96));var _0x33b6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3b63[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x33b6('0x0'));var util=require(_0x33b6('0x1'));var path=require('path');var timeout=require(_0x33b6('0x2'));var express=require(_0x33b6('0x3'));var router=express['Router']();var fs_extra=require(_0x33b6('0x4'));var auth=require(_0x33b6('0x5'));var interaction=require(_0x33b6('0x6'));var config=require('../../config/environment');var controller=require(_0x33b6('0x7'));router[_0x33b6('0x8')]('/',auth[_0x33b6('0x9')](),controller[_0x33b6('0xa')]);router[_0x33b6('0x8')](_0x33b6('0xb'),auth['isAuthenticated'](),controller[_0x33b6('0xc')]);router[_0x33b6('0xd')]('/',auth[_0x33b6('0x9')](),controller[_0x33b6('0xe')]);router[_0x33b6('0xf')](_0x33b6('0xb'),auth[_0x33b6('0x9')](),controller[_0x33b6('0x10')]);router['delete'](_0x33b6('0xb'),auth[_0x33b6('0x9')](),controller[_0x33b6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ad6183b..5c3eb6b 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 _0x225c=['STRING','INTEGER','sequelize','exports'];(function(_0xba5a61,_0x160004){var _0x4eaab4=function(_0x8ccfb7){while(--_0x8ccfb7){_0xba5a61['push'](_0xba5a61['shift']());}};_0x4eaab4(++_0x160004);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc225('0x0'));module[_0xc225('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xc225('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc225('0x2')]},'dcontext':{'type':Sequelize[_0xc225('0x2')]},'channel':{'type':Sequelize[_0xc225('0x2')]},'dstchannel':{'type':Sequelize[_0xc225('0x2')]},'lastapp':{'type':Sequelize[_0xc225('0x2')]},'lastdata':{'type':Sequelize[_0xc225('0x2')]},'duration':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc225('0x2')]},'amaflags':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc225('0x2')]},'userfield':{'type':Sequelize[_0xc225('0x2')]},'uniqueid':{'type':Sequelize[_0xc225('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc225('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc225('0x2')]},'tag':{'type':Sequelize[_0xc225('0x2')]}}; \ No newline at end of file +var _0xe3ee=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xe3ee,0x116));var _0xee3e=function(_0x13cda6,_0x599fee){_0x13cda6=_0x13cda6-0x0;var _0x3852b4=_0xe3ee[_0x13cda6];return _0x3852b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xee3e('0x0')],'allowNull':![],'defaultValue':_0xee3e('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xee3e('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xee3e('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xee3e('0x2')]},'duration':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee3e('0x2')]},'amaflags':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee3e('0x2')]},'userfield':{'type':Sequelize[_0xee3e('0x2')]},'uniqueid':{'type':Sequelize[_0xee3e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xee3e('0x2')]},'peeraccount':{'type':Sequelize[_0xee3e('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xee3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 10eacdd..9543b34 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 _0xb647=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x437e8a,_0x44dfba){var _0x5e9910=function(_0x3b71e1){while(--_0x3b71e1){_0x437e8a['push'](_0x437e8a['shift']());}};_0x5e9910(++_0x44dfba);}(_0xb647,0xdb));var _0x7b64=function(_0x2014d7,_0x3668de){_0x2014d7=_0x2014d7-0x0;var _0x355af3=_0xb647[_0x2014d7];return _0x355af3;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require(_0x7b64('0x1'));var zipdir=require(_0x7b64('0x2'));var jsonpatch=require(_0x7b64('0x3'));var rp=require(_0x7b64('0x4'));var moment=require(_0x7b64('0x5'));var BPromise=require(_0x7b64('0x6'));var Mustache=require(_0x7b64('0x7'));var util=require('util');var path=require(_0x7b64('0x8'));var sox=require('sox');var csv=require(_0x7b64('0x9'));var ejs=require(_0x7b64('0xa'));var fs=require('fs');var fs_extra=require(_0x7b64('0xb'));var _=require(_0x7b64('0xc'));var squel=require(_0x7b64('0xd'));var crypto=require(_0x7b64('0xe'));var jsforce=require(_0x7b64('0xf'));var deskjs=require(_0x7b64('0x10'));var toCsv=require(_0x7b64('0x9'));var querystring=require('querystring');var Papa=require(_0x7b64('0x11'));var Redis=require('ioredis');var authService=require(_0x7b64('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b64('0x13'));var logger=require(_0x7b64('0x14'))('api');var utils=require(_0x7b64('0x15'));var config=require(_0x7b64('0x16'));var licenseUtil=require(_0x7b64('0x17'));var db=require(_0x7b64('0x18'))['db'];function respondWithStatusCode(_0x25e135,_0x432626){_0x432626=_0x432626||0xcc;return function(_0x5ea1dd){if(_0x5ea1dd){return _0x25e135['sendStatus'](_0x432626);}return _0x25e135[_0x7b64('0x19')](_0x432626)['end']();};}function respondWithResult(_0x530938,_0x2f21d8){_0x2f21d8=_0x2f21d8||0xc8;return function(_0x29a596){if(_0x29a596){return _0x530938[_0x7b64('0x19')](_0x2f21d8)[_0x7b64('0x1a')](_0x29a596);}};}function respondWithFilteredResult(_0x33ebe7,_0x437ddc){return function(_0x306a4e){if(_0x306a4e){var _0x519316=typeof _0x437ddc[_0x7b64('0x1b')]===_0x7b64('0x1c')&&typeof _0x437ddc[_0x7b64('0x1d')]===_0x7b64('0x1c');var _0x157c03=_0x306a4e['count'];var _0x3935c3=_0x519316?0x0:_0x437ddc[_0x7b64('0x1b')];var _0x58517e=_0x519316?_0x306a4e[_0x7b64('0x1e')]:_0x437ddc[_0x7b64('0x1b')]+_0x437ddc['limit'];var _0x23845e;if(_0x58517e>=_0x157c03){_0x58517e=_0x157c03;_0x23845e=0xc8;}else{_0x23845e=0xce;}_0x33ebe7[_0x7b64('0x19')](_0x23845e);return _0x33ebe7[_0x7b64('0x1f')](_0x7b64('0x20'),_0x3935c3+'-'+_0x58517e+'/'+_0x157c03)['json'](_0x306a4e);}return null;};}function patchUpdates(_0x123a3b){return function(_0x5c4135){try{jsonpatch['apply'](_0x5c4135,_0x123a3b,!![]);}catch(_0x3f73cf){return BPromise['reject'](_0x3f73cf);}return _0x5c4135[_0x7b64('0x21')]();};}function saveUpdates(_0x587da6,_0x1bbd87){return function(_0x1ad95f){if(_0x1ad95f){return _0x1ad95f[_0x7b64('0x22')](_0x587da6)[_0x7b64('0x23')](function(_0x450b7e){return _0x450b7e;});}return null;};}function removeEntity(_0x3c0d97,_0x215ea9){return function(_0x3d4bef){if(_0x3d4bef){return _0x3d4bef[_0x7b64('0x24')]()[_0x7b64('0x23')](function(){_0x3c0d97[_0x7b64('0x19')](0xcc)[_0x7b64('0x25')]();});}};}function handleEntityNotFound(_0x24b68e,_0x42efa1){return function(_0x50d06c){if(!_0x50d06c){_0x24b68e[_0x7b64('0x26')](0x194);}return _0x50d06c;};}function handleError(_0x5d9586,_0x1580d0){_0x1580d0=_0x1580d0||0x1f4;return function(_0x21fbd3){logger['error'](_0x21fbd3['stack']);if(_0x21fbd3[_0x7b64('0x27')]){delete _0x21fbd3[_0x7b64('0x27')];}_0x5d9586[_0x7b64('0x19')](_0x1580d0)[_0x7b64('0x28')](_0x21fbd3);};}exports[_0x7b64('0x29')]=function(_0x3c9fad,_0x6740b2){var _0x2729f1={},_0x53e29b={},_0x1616c9={'count':0x0,'rows':[]};var _0x2c4619=_['map'](db[_0x7b64('0x2a')][_0x7b64('0x2b')],function(_0x369402){return{'name':_0x369402[_0x7b64('0x2c')],'type':_0x369402[_0x7b64('0x2d')][_0x7b64('0x2e')]};});_0x53e29b['model']=_['map'](_0x2c4619,_0x7b64('0x27'));_0x53e29b[_0x7b64('0x2f')]=_['keys'](_0x3c9fad['query']);_0x53e29b[_0x7b64('0x30')]=_['intersection'](_0x53e29b[_0x7b64('0x31')],_0x53e29b['query']);_0x2729f1['attributes']=_['intersection'](_0x53e29b[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x3c9fad[_0x7b64('0x2f')]['fields']));_0x2729f1[_0x7b64('0x33')]=_0x2729f1['attributes'][_0x7b64('0x34')]?_0x2729f1[_0x7b64('0x33')]:_0x53e29b[_0x7b64('0x31')];if(!_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x35')]('nolimit')){_0x2729f1[_0x7b64('0x1d')]=qs[_0x7b64('0x1d')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1d')]);_0x2729f1['offset']=qs[_0x7b64('0x1b')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x1b')]);}_0x2729f1[_0x7b64('0x36')]=qs[_0x7b64('0x37')](_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x37')]);_0x2729f1['where']=qs['filters'](_[_0x7b64('0x38')](_0x3c9fad[_0x7b64('0x2f')],_0x53e29b[_0x7b64('0x30')]),_0x2c4619);if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]){_0x2729f1[_0x7b64('0x3a')]=_[_0x7b64('0x3b')](_0x2729f1[_0x7b64('0x3a')],{'$or':_[_0x7b64('0x3c')](_0x2c4619,function(_0x5b1278){if(_0x5b1278[_0x7b64('0x2d')]!==_0x7b64('0x3d')){var _0x451f9b={};_0x451f9b[_0x5b1278[_0x7b64('0x27')]]={'$like':'%'+_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x39')]+'%'};return _0x451f9b;}})});}_0x2729f1=_[_0x7b64('0x3b')]({},_0x2729f1,_0x3c9fad[_0x7b64('0x3e')]);var _0x3c4467={'where':_0x2729f1[_0x7b64('0x3a')]};return db[_0x7b64('0x2a')][_0x7b64('0x1e')](_0x3c4467)[_0x7b64('0x23')](function(_0x36cfce){_0x1616c9[_0x7b64('0x1e')]=_0x36cfce;if(_0x3c9fad[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x2729f1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2a')][_0x7b64('0x41')](_0x2729f1);})['then'](function(_0x442d65){_0x1616c9[_0x7b64('0x42')]=_0x442d65;return _0x1616c9;})[_0x7b64('0x23')](respondWithFilteredResult(_0x6740b2,_0x2729f1))['catch'](handleError(_0x6740b2,null));};exports[_0x7b64('0x43')]=function(_0x2e4d0f,_0x55c889){var _0x216c58={'raw':!![],'where':{'id':_0x2e4d0f['params']['id']}},_0xf0d4a1={};_0xf0d4a1[_0x7b64('0x31')]=_['keys'](db[_0x7b64('0x2a')][_0x7b64('0x2b')]);_0xf0d4a1[_0x7b64('0x2f')]=_['keys'](_0x2e4d0f[_0x7b64('0x2f')]);_0xf0d4a1[_0x7b64('0x30')]=_[_0x7b64('0x44')](_0xf0d4a1[_0x7b64('0x31')],_0xf0d4a1[_0x7b64('0x2f')]);_0x216c58[_0x7b64('0x33')]=_['intersection'](_0xf0d4a1[_0x7b64('0x31')],qs[_0x7b64('0x32')](_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x32')]));_0x216c58[_0x7b64('0x33')]=_0x216c58['attributes']['length']?_0x216c58['attributes']:_0xf0d4a1['model'];if(_0x2e4d0f[_0x7b64('0x2f')][_0x7b64('0x3f')]){_0x216c58[_0x7b64('0x40')]=[{'all':!![]}];}_0x216c58=_[_0x7b64('0x3b')]({},_0x216c58,_0x2e4d0f[_0x7b64('0x3e')]);return db[_0x7b64('0x2a')][_0x7b64('0x45')](_0x216c58)[_0x7b64('0x23')](handleEntityNotFound(_0x55c889,null))[_0x7b64('0x23')](respondWithResult(_0x55c889,null))[_0x7b64('0x46')](handleError(_0x55c889,null));};exports[_0x7b64('0x47')]=function(_0x38983a,_0x4add4d){return db['Cdr'][_0x7b64('0x47')](_0x38983a[_0x7b64('0x48')],{})[_0x7b64('0x23')](respondWithResult(_0x4add4d,0xc9))[_0x7b64('0x46')](handleError(_0x4add4d,null));};exports[_0x7b64('0x22')]=function(_0x5a8639,_0x3e5321){if(_0x5a8639[_0x7b64('0x48')]['id']){delete _0x5a8639[_0x7b64('0x48')]['id'];}return db['Cdr'][_0x7b64('0x45')]({'where':{'id':_0x5a8639[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3e5321,null))[_0x7b64('0x23')](saveUpdates(_0x5a8639[_0x7b64('0x48')],null))['then'](respondWithResult(_0x3e5321,null))[_0x7b64('0x46')](handleError(_0x3e5321,null));};exports[_0x7b64('0x24')]=function(_0x52b04a,_0x3656b8){return db[_0x7b64('0x2a')]['find']({'where':{'id':_0x52b04a[_0x7b64('0x49')]['id']}})[_0x7b64('0x23')](handleEntityNotFound(_0x3656b8,null))[_0x7b64('0x23')](removeEntity(_0x3656b8,null))[_0x7b64('0x46')](handleError(_0x3656b8,null));};exports[_0x7b64('0x4a')]=function(_0x79cbc9,_0x253b33){return db[_0x7b64('0x2a')][_0x7b64('0x4a')]()[_0x7b64('0x23')](respondWithResult(_0x253b33,null))[_0x7b64('0x46')](handleError(_0x253b33,null));}; \ No newline at end of file +var _0x0f4d=['query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','type','options','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','Cdr','model'];(function(_0x2f072f,_0x5803e2){var _0x29aa69=function(_0x4ec359){while(--_0x4ec359){_0x2f072f['push'](_0x2f072f['shift']());}};_0x29aa69(++_0x5803e2);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x1e6428,_0x517bb3){_0x1e6428=_0x1e6428-0x0;var _0x1ff6f4=_0x0f4d[_0x1e6428];return _0x1ff6f4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f4('0x0'));var rp=require('request-promise');var moment=require(_0xd0f4('0x1'));var BPromise=require(_0xd0f4('0x2'));var Mustache=require(_0xd0f4('0x3'));var util=require(_0xd0f4('0x4'));var path=require(_0xd0f4('0x5'));var sox=require(_0xd0f4('0x6'));var csv=require(_0xd0f4('0x7'));var ejs=require(_0xd0f4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0f4('0x9'));var squel=require(_0xd0f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xd0f4('0xb'));var deskjs=require(_0xd0f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd0f4('0xd'));var Papa=require(_0xd0f4('0xe'));var Redis=require('ioredis');var authService=require(_0xd0f4('0xf'));var qs=require(_0xd0f4('0x10'));var as=require(_0xd0f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0f4('0x12'));var utils=require(_0xd0f4('0x13'));var config=require(_0xd0f4('0x14'));var licenseUtil=require(_0xd0f4('0x15'));var db=require(_0xd0f4('0x16'))['db'];function respondWithStatusCode(_0x64232c,_0x134492){_0x134492=_0x134492||0xcc;return function(_0x5679a7){if(_0x5679a7){return _0x64232c[_0xd0f4('0x17')](_0x134492);}return _0x64232c[_0xd0f4('0x18')](_0x134492)['end']();};}function respondWithResult(_0x104d48,_0x536d71){_0x536d71=_0x536d71||0xc8;return function(_0x828792){if(_0x828792){return _0x104d48['status'](_0x536d71)[_0xd0f4('0x19')](_0x828792);}};}function respondWithFilteredResult(_0x4d5aef,_0x4afe4d){return function(_0x54b806){if(_0x54b806){var _0x45b32e=typeof _0x4afe4d[_0xd0f4('0x1a')]===_0xd0f4('0x1b')&&typeof _0x4afe4d[_0xd0f4('0x1c')]===_0xd0f4('0x1b');var _0x10acbe=_0x54b806[_0xd0f4('0x1d')];var _0x35be48=_0x45b32e?0x0:_0x4afe4d[_0xd0f4('0x1a')];var _0x5de07b=_0x45b32e?_0x54b806[_0xd0f4('0x1d')]:_0x4afe4d[_0xd0f4('0x1a')]+_0x4afe4d[_0xd0f4('0x1c')];var _0xa0662;if(_0x5de07b>=_0x10acbe){_0x5de07b=_0x10acbe;_0xa0662=0xc8;}else{_0xa0662=0xce;}_0x4d5aef['status'](_0xa0662);return _0x4d5aef[_0xd0f4('0x1e')](_0xd0f4('0x1f'),_0x35be48+'-'+_0x5de07b+'/'+_0x10acbe)[_0xd0f4('0x19')](_0x54b806);}return null;};}function patchUpdates(_0x208a6f){return function(_0x4e1689){try{jsonpatch[_0xd0f4('0x20')](_0x4e1689,_0x208a6f,!![]);}catch(_0xda1d14){return BPromise[_0xd0f4('0x21')](_0xda1d14);}return _0x4e1689[_0xd0f4('0x22')]();};}function saveUpdates(_0x14ba70,_0x2a1df0){return function(_0x25ee43){if(_0x25ee43){return _0x25ee43['update'](_0x14ba70)[_0xd0f4('0x23')](function(_0x327696){return _0x327696;});}return null;};}function removeEntity(_0x20e0c8,_0x299904){return function(_0x4d49c0){if(_0x4d49c0){return _0x4d49c0[_0xd0f4('0x24')]()['then'](function(){_0x20e0c8[_0xd0f4('0x18')](0xcc)[_0xd0f4('0x25')]();});}};}function handleEntityNotFound(_0x1cf493,_0x567eb4){return function(_0x42d944){if(!_0x42d944){_0x1cf493[_0xd0f4('0x17')](0x194);}return _0x42d944;};}function handleError(_0x459931,_0x1ed6e2){_0x1ed6e2=_0x1ed6e2||0x1f4;return function(_0x366af6){logger['error'](_0x366af6[_0xd0f4('0x26')]);if(_0x366af6[_0xd0f4('0x27')]){delete _0x366af6[_0xd0f4('0x27')];}_0x459931[_0xd0f4('0x18')](_0x1ed6e2)[_0xd0f4('0x28')](_0x366af6);};}exports[_0xd0f4('0x29')]=function(_0x1d3246,_0x33eb58){var _0x3cb97c={},_0x4cff90={},_0x42a44f={'count':0x0,'rows':[]};var _0x2df1ed=_[_0xd0f4('0x2a')](db[_0xd0f4('0x2b')]['rawAttributes'],function(_0x4058d7){return{'name':_0x4058d7['fieldName'],'type':_0x4058d7['type']['key']};});_0x4cff90[_0xd0f4('0x2c')]=_[_0xd0f4('0x2a')](_0x2df1ed,_0xd0f4('0x27'));_0x4cff90[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x1d3246[_0xd0f4('0x2d')]);_0x4cff90[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4cff90['model'],_0x4cff90[_0xd0f4('0x2d')]);_0x3cb97c['attributes']=_[_0xd0f4('0x30')](_0x4cff90[_0xd0f4('0x2c')],qs['fields'](_0x1d3246['query'][_0xd0f4('0x31')]));_0x3cb97c['attributes']=_0x3cb97c[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0x3cb97c['attributes']:_0x4cff90[_0xd0f4('0x2c')];if(!_0x1d3246[_0xd0f4('0x2d')]['hasOwnProperty']('nolimit')){_0x3cb97c[_0xd0f4('0x1c')]=qs[_0xd0f4('0x1c')](_0x1d3246['query'][_0xd0f4('0x1c')]);_0x3cb97c['offset']=qs[_0xd0f4('0x1a')](_0x1d3246[_0xd0f4('0x2d')]['offset']);}_0x3cb97c[_0xd0f4('0x34')]=qs[_0xd0f4('0x35')](_0x1d3246[_0xd0f4('0x2d')][_0xd0f4('0x35')]);_0x3cb97c[_0xd0f4('0x36')]=qs['filters'](_[_0xd0f4('0x37')](_0x1d3246[_0xd0f4('0x2d')],_0x4cff90[_0xd0f4('0x2f')]),_0x2df1ed);if(_0x1d3246[_0xd0f4('0x2d')]['filter']){_0x3cb97c[_0xd0f4('0x36')]=_[_0xd0f4('0x38')](_0x3cb97c[_0xd0f4('0x36')],{'$or':_[_0xd0f4('0x2a')](_0x2df1ed,function(_0xd109a4){if(_0xd109a4[_0xd0f4('0x39')]!=='VIRTUAL'){var _0x269629={};_0x269629[_0xd109a4[_0xd0f4('0x27')]]={'$like':'%'+_0x1d3246[_0xd0f4('0x2d')]['filter']+'%'};return _0x269629;}})});}_0x3cb97c=_[_0xd0f4('0x38')]({},_0x3cb97c,_0x1d3246[_0xd0f4('0x3a')]);var _0x4bebe8={'where':_0x3cb97c[_0xd0f4('0x36')]};return db[_0xd0f4('0x2b')]['count'](_0x4bebe8)['then'](function(_0x3bb4ab){_0x42a44f[_0xd0f4('0x1d')]=_0x3bb4ab;if(_0x1d3246[_0xd0f4('0x2d')]['includeAll']){_0x3cb97c[_0xd0f4('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0xd0f4('0x3c')](_0x3cb97c);})['then'](function(_0x29439d){_0x42a44f[_0xd0f4('0x3d')]=_0x29439d;return _0x42a44f;})[_0xd0f4('0x23')](respondWithFilteredResult(_0x33eb58,_0x3cb97c))[_0xd0f4('0x3e')](handleError(_0x33eb58,null));};exports['show']=function(_0x10509e,_0x198e47){var _0xb02892={'raw':!![],'where':{'id':_0x10509e['params']['id']}},_0x4c8b9a={};_0x4c8b9a[_0xd0f4('0x2c')]=_[_0xd0f4('0x2e')](db[_0xd0f4('0x2b')][_0xd0f4('0x3f')]);_0x4c8b9a[_0xd0f4('0x2d')]=_[_0xd0f4('0x2e')](_0x10509e[_0xd0f4('0x2d')]);_0x4c8b9a[_0xd0f4('0x2f')]=_[_0xd0f4('0x30')](_0x4c8b9a[_0xd0f4('0x2c')],_0x4c8b9a[_0xd0f4('0x2d')]);_0xb02892[_0xd0f4('0x32')]=_['intersection'](_0x4c8b9a[_0xd0f4('0x2c')],qs[_0xd0f4('0x31')](_0x10509e['query'][_0xd0f4('0x31')]));_0xb02892[_0xd0f4('0x32')]=_0xb02892[_0xd0f4('0x32')][_0xd0f4('0x33')]?_0xb02892[_0xd0f4('0x32')]:_0x4c8b9a[_0xd0f4('0x2c')];if(_0x10509e[_0xd0f4('0x2d')]['includeAll']){_0xb02892[_0xd0f4('0x3b')]=[{'all':!![]}];}_0xb02892=_[_0xd0f4('0x38')]({},_0xb02892,_0x10509e[_0xd0f4('0x3a')]);return db['Cdr'][_0xd0f4('0x40')](_0xb02892)[_0xd0f4('0x23')](handleEntityNotFound(_0x198e47,null))[_0xd0f4('0x23')](respondWithResult(_0x198e47,null))[_0xd0f4('0x3e')](handleError(_0x198e47,null));};exports[_0xd0f4('0x41')]=function(_0x563759,_0x54bb8d){return db['Cdr'][_0xd0f4('0x41')](_0x563759[_0xd0f4('0x42')],{})[_0xd0f4('0x23')](respondWithResult(_0x54bb8d,0xc9))[_0xd0f4('0x3e')](handleError(_0x54bb8d,null));};exports['update']=function(_0x31db89,_0x1b1baa){if(_0x31db89['body']['id']){delete _0x31db89[_0xd0f4('0x42')]['id'];}return db[_0xd0f4('0x2b')][_0xd0f4('0x40')]({'where':{'id':_0x31db89[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x1b1baa,null))[_0xd0f4('0x23')](saveUpdates(_0x31db89[_0xd0f4('0x42')],null))[_0xd0f4('0x23')](respondWithResult(_0x1b1baa,null))[_0xd0f4('0x3e')](handleError(_0x1b1baa,null));};exports[_0xd0f4('0x24')]=function(_0x431df3,_0x120c17){return db[_0xd0f4('0x2b')]['find']({'where':{'id':_0x431df3[_0xd0f4('0x43')]['id']}})[_0xd0f4('0x23')](handleEntityNotFound(_0x120c17,null))[_0xd0f4('0x23')](removeEntity(_0x120c17,null))['catch'](handleError(_0x120c17,null));};exports[_0xd0f4('0x44')]=function(_0x3f8bcc,_0x1d8543){return db['Cdr'][_0xd0f4('0x44')]()['then'](respondWithResult(_0x1d8543,null))[_0xd0f4('0x3e')](handleError(_0x1d8543,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ecda3b3..a9f5cfb 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3f6987,_0x1ad59a){var _0x5a8248=function(_0xe2a261){while(--_0xe2a261){_0x3f6987['push'](_0x3f6987['shift']());}};_0x5a8248(++_0x1ad59a);}(_0x7a54,0x106));var _0x47a5=function(_0x97d60f,_0x19d958){_0x97d60f=_0x97d60f-0x0;var _0x5ce0c6=_0x7a54[_0x97d60f];return _0x5ce0c6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index b0737e9..05710b6 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 _0x2353=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3e6cfe,_0x1943c1){var _0x51799b=function(_0x2e8ac1){while(--_0x2e8ac1){_0x3e6cfe['push'](_0x3e6cfe['shift']());}};_0x51799b(++_0x1943c1);}(_0x2353,0x195));var _0x3235=function(_0x482b0b,_0x37ac86){_0x482b0b=_0x482b0b-0x0;var _0x5e5991=_0x2353[_0x482b0b];return _0x5e5991;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3235('0x0'));var BPromise=require(_0x3235('0x1'));var rs=require(_0x3235('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3235('0x3'))['db'];var utils=require(_0x3235('0x4'));var logger=require('../../config/logger')(_0x3235('0x5'));var config=require(_0x3235('0x6'));var jayson=require(_0x3235('0x7'));var client=jayson[_0x3235('0x8')][_0x3235('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x436c8f,_0x399e66,_0x36d16b){return new BPromise(function(_0x146796,_0x2e36fa){return client[_0x3235('0xa')](_0x436c8f,_0x36d16b)[_0x3235('0xb')](function(_0x3a04e9){logger[_0x3235('0xc')](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));logger[_0x3235('0xf')](_0x3235('0x10'),_0x399e66,'request\x20sent',JSON[_0x3235('0x11')](_0x3a04e9));if(_0x3a04e9[_0x3235('0x12')]){if(_0x3a04e9[_0x3235('0x12')]['code']===0x1f4){logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x2e36fa(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}logger['error'](_0x3235('0xd'),_0x399e66,_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);return _0x146796(_0x3a04e9[_0x3235('0x12')][_0x3235('0x13')]);}else{logger['info'](_0x3235('0xd'),_0x399e66,_0x3235('0xe'));_0x146796(_0x3a04e9[_0x3235('0x14')][_0x3235('0x13')]);}})[_0x3235('0x15')](function(_0x459b2b){logger['error'](_0x3235('0xd'),_0x399e66,_0x459b2b);_0x2e36fa(_0x459b2b);});});} \ No newline at end of file +var _0xc0eb=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x462725,_0x2f890b){var _0x581f26=function(_0x126f74){while(--_0x126f74){_0x462725['push'](_0x462725['shift']());}};_0x581f26(++_0x2f890b);}(_0xc0eb,0x1a7));var _0xbc0e=function(_0x25902b,_0x229966){_0x25902b=_0x25902b-0x0;var _0x1884f0=_0xc0eb[_0x25902b];return _0x1884f0;};'use strict';var _=require(_0xbc0e('0x0'));var util=require(_0xbc0e('0x1'));var moment=require('moment');var BPromise=require(_0xbc0e('0x2'));var rs=require(_0xbc0e('0x3'));var fs=require('fs');var Redis=require(_0xbc0e('0x4'));var db=require(_0xbc0e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc0e('0x6'))(_0xbc0e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc0e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2159a1,_0x188bb1,_0xc48094){return new BPromise(function(_0x2e175d,_0x48b65d){return client[_0xbc0e('0x9')](_0x2159a1,_0xc48094)[_0xbc0e('0xa')](function(_0x222f25){logger[_0xbc0e('0xb')](_0xbc0e('0xc'),_0x188bb1,_0xbc0e('0xd'));logger[_0xbc0e('0xe')](_0xbc0e('0xf'),_0x188bb1,_0xbc0e('0xd'),JSON[_0xbc0e('0x10')](_0x222f25));if(_0x222f25[_0xbc0e('0x11')]){if(_0x222f25['error'][_0xbc0e('0x12')]===0x1f4){logger[_0xbc0e('0x11')](_0xbc0e('0xc'),_0x188bb1,_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);return _0x48b65d(_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);}logger['error'](_0xbc0e('0xc'),_0x188bb1,_0x222f25['error'][_0xbc0e('0x13')]);return _0x2e175d(_0x222f25[_0xbc0e('0x11')][_0xbc0e('0x13')]);}else{logger['info'](_0xbc0e('0xc'),_0x188bb1,_0xbc0e('0xd'));_0x2e175d(_0x222f25[_0xbc0e('0x14')][_0xbc0e('0x13')]);}})[_0xbc0e('0x15')](function(_0x525b26){logger[_0xbc0e('0x11')](_0xbc0e('0xc'),_0x188bb1,_0x525b26);_0x48b65d(_0x525b26);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 757dad7..bc71c7f 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(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x6bb9,_0x10f2b6){var _0xe3b3bc=function(_0x3438ed){while(--_0x3438ed){_0x6bb9['push'](_0x6bb9['shift']());}};_0xe3b3bc(++_0x10f2b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 97dda9a..89133c4 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 _0xadeb=['TEXT','sequelize','exports','STRING'];(function(_0xc2f824,_0x5521e4){var _0x2a601e=function(_0x25315e){while(--_0x25315e){_0xc2f824['push'](_0xc2f824['shift']());}};_0x2a601e(++_0x5521e4);}(_0xadeb,0xad));var _0xbade=function(_0x369cc7,_0x16abfc){_0x369cc7=_0x369cc7-0x0;var _0x53273c=_0xadeb[_0x369cc7];return _0x53273c;};'use strict';var Sequelize=require(_0xbade('0x0'));module[_0xbade('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbade('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbade('0x3')]()},'description':{'type':Sequelize[_0xbade('0x2')]},'interval':{'type':Sequelize[_0xbade('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x638d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3d24f9,_0x5c79b7){var _0x2a0278=function(_0x223f27){while(--_0x223f27){_0x3d24f9['push'](_0x3d24f9['shift']());}};_0x2a0278(++_0x5c79b7);}(_0x638d,0x1e2));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd638('0x0'));module[_0xd638('0x1')]={'priority':{'type':Sequelize[_0xd638('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd638('0x3')],'allowNull':![],'defaultValue':_0xd638('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd638('0x3')]},'interval':{'type':Sequelize[_0xd638('0x3')],'defaultValue':_0xd638('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 391de4d..6cedcc0 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 _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x3ba559,_0x131d7e){var _0x4d76fb=function(_0x504678){while(--_0x504678){_0x3ba559['push'](_0x3ba559['shift']());}};_0x4d76fb(++_0x131d7e);}(_0xb676,0xbc));var _0x6b67=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb676[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));}; \ No newline at end of file +var _0x4584=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x4584,0x1cf));var _0x4458=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x4584[_0x43a1b8];return _0x324ecc;};'use strict';var emlformat=require(_0x4458('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4458('0x1'));var jsonpatch=require(_0x4458('0x2'));var rp=require(_0x4458('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4458('0x4'));var util=require(_0x4458('0x5'));var path=require(_0x4458('0x6'));var sox=require(_0x4458('0x7'));var csv=require(_0x4458('0x8'));var ejs=require(_0x4458('0x9'));var fs=require('fs');var fs_extra=require(_0x4458('0xa'));var _=require(_0x4458('0xb'));var squel=require(_0x4458('0xc'));var crypto=require('crypto');var jsforce=require(_0x4458('0xd'));var deskjs=require(_0x4458('0xe'));var toCsv=require(_0x4458('0x8'));var querystring=require(_0x4458('0xf'));var Papa=require(_0x4458('0x10'));var Redis=require(_0x4458('0x11'));var authService=require(_0x4458('0x12'));var qs=require(_0x4458('0x13'));var as=require(_0x4458('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4458('0x15'))(_0x4458('0x16'));var utils=require(_0x4458('0x17'));var config=require(_0x4458('0x18'));var licenseUtil=require(_0x4458('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302552,_0x527809){_0x527809=_0x527809||0xcc;return function(_0x1f13ab){if(_0x1f13ab){return _0x302552['sendStatus'](_0x527809);}return _0x302552[_0x4458('0x1a')](_0x527809)[_0x4458('0x1b')]();};}function respondWithResult(_0x4abaf9,_0x5e2f05){_0x5e2f05=_0x5e2f05||0xc8;return function(_0x42771e){if(_0x42771e){return _0x4abaf9[_0x4458('0x1a')](_0x5e2f05)[_0x4458('0x1c')](_0x42771e);}};}function respondWithFilteredResult(_0x2619ed,_0x30d440){return function(_0x21ff11){if(_0x21ff11){var _0x225679=typeof _0x30d440[_0x4458('0x1d')]==='undefined'&&typeof _0x30d440[_0x4458('0x1e')]==='undefined';var _0x3bb7f4=_0x21ff11[_0x4458('0x1f')];var _0x130d39=_0x225679?0x0:_0x30d440['offset'];var _0x319247=_0x225679?_0x21ff11[_0x4458('0x1f')]:_0x30d440[_0x4458('0x1d')]+_0x30d440[_0x4458('0x1e')];var _0x463809;if(_0x319247>=_0x3bb7f4){_0x319247=_0x3bb7f4;_0x463809=0xc8;}else{_0x463809=0xce;}_0x2619ed[_0x4458('0x1a')](_0x463809);return _0x2619ed[_0x4458('0x20')](_0x4458('0x21'),_0x130d39+'-'+_0x319247+'/'+_0x3bb7f4)[_0x4458('0x1c')](_0x21ff11);}return null;};}function patchUpdates(_0x2dfcf1){return function(_0x531ab6){try{jsonpatch[_0x4458('0x22')](_0x531ab6,_0x2dfcf1,!![]);}catch(_0x24ecd1){return BPromise[_0x4458('0x23')](_0x24ecd1);}return _0x531ab6['save']();};}function saveUpdates(_0xe09a2b,_0x1688f2){return function(_0x58aeca){if(_0x58aeca){return _0x58aeca[_0x4458('0x24')](_0xe09a2b)[_0x4458('0x25')](function(_0x5d3df2){return _0x5d3df2;});}return null;};}function removeEntity(_0xcf668c,_0x17e482){return function(_0x3e7945){if(_0x3e7945){return _0x3e7945['destroy']()[_0x4458('0x25')](function(){_0xcf668c['status'](0xcc)[_0x4458('0x1b')]();});}};}function handleEntityNotFound(_0x504a86,_0x543e21){return function(_0x277b1c){if(!_0x277b1c){_0x504a86[_0x4458('0x26')](0x194);}return _0x277b1c;};}function handleError(_0x1631d3,_0x25ade9){_0x25ade9=_0x25ade9||0x1f4;return function(_0x153a98){logger[_0x4458('0x27')](_0x153a98[_0x4458('0x28')]);if(_0x153a98[_0x4458('0x29')]){delete _0x153a98[_0x4458('0x29')];}_0x1631d3[_0x4458('0x1a')](_0x25ade9)[_0x4458('0x2a')](_0x153a98);};}exports['show']=function(_0x179be7,_0x4e076a){var _0x4579d9={'raw':!![],'where':{'id':_0x179be7[_0x4458('0x2b')]['id']}},_0x5f22be={};_0x5f22be[_0x4458('0x2c')]=_[_0x4458('0x2d')](db[_0x4458('0x2e')][_0x4458('0x2f')]);_0x5f22be[_0x4458('0x30')]=_[_0x4458('0x2d')](_0x179be7[_0x4458('0x30')]);_0x5f22be[_0x4458('0x31')]=_[_0x4458('0x32')](_0x5f22be[_0x4458('0x2c')],_0x5f22be[_0x4458('0x30')]);_0x4579d9[_0x4458('0x33')]=_[_0x4458('0x32')](_0x5f22be['model'],qs[_0x4458('0x34')](_0x179be7[_0x4458('0x30')][_0x4458('0x34')]));_0x4579d9[_0x4458('0x33')]=_0x4579d9[_0x4458('0x33')][_0x4458('0x35')]?_0x4579d9[_0x4458('0x33')]:_0x5f22be[_0x4458('0x2c')];if(_0x179be7['query']['includeAll']){_0x4579d9['include']=[{'all':!![]}];}_0x4579d9=_[_0x4458('0x36')]({},_0x4579d9,_0x179be7[_0x4458('0x37')]);return db[_0x4458('0x2e')][_0x4458('0x38')](_0x4579d9)[_0x4458('0x25')](handleEntityNotFound(_0x4e076a,null))[_0x4458('0x25')](respondWithResult(_0x4e076a,null))[_0x4458('0x39')](handleError(_0x4e076a,null));};exports[_0x4458('0x24')]=function(_0x755e3b,_0xd804f0){if(_0x755e3b[_0x4458('0x3a')]['id']){delete _0x755e3b[_0x4458('0x3a')]['id'];}return db[_0x4458('0x2e')]['find']({'where':{'id':_0x755e3b[_0x4458('0x2b')]['id']}})['then'](handleEntityNotFound(_0xd804f0,null))[_0x4458('0x25')](saveUpdates(_0x755e3b[_0x4458('0x3a')],null))[_0x4458('0x25')](respondWithResult(_0xd804f0,null))[_0x4458('0x39')](handleError(_0xd804f0,null));};exports['destroy']=function(_0x4d08d8,_0x3b573c){return db[_0x4458('0x2e')][_0x4458('0x38')]({'where':{'id':_0x4d08d8['params']['id']}})[_0x4458('0x25')](handleEntityNotFound(_0x3b573c,null))[_0x4458('0x25')](removeEntity(_0x3b573c,null))[_0x4458('0x39')](handleError(_0x3b573c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 448132d..613d905 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 _0x5e4a=['chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x1877a0,_0x5353f6){var _0x49b933=function(_0x288094){while(--_0x288094){_0x1877a0['push'](_0x1877a0['shift']());}};_0x49b933(++_0x5353f6);}(_0x5e4a,0x1b5));var _0xa5e4=function(_0x1e68ef,_0x4546e7){_0x1e68ef=_0x1e68ef-0x0;var _0x547bfa=_0x5e4a[_0x1e68ef];return _0x547bfa;};'use strict';var _=require(_0xa5e4('0x0'));var util=require(_0xa5e4('0x1'));var logger=require(_0xa5e4('0x2'))(_0xa5e4('0x3'));var moment=require(_0xa5e4('0x4'));var BPromise=require(_0xa5e4('0x5'));var rp=require(_0xa5e4('0x6'));var fs=require('fs');var path=require(_0xa5e4('0x7'));var rimraf=require(_0xa5e4('0x8'));var config=require(_0xa5e4('0x9'));var attributes=require(_0xa5e4('0xa'));module[_0xa5e4('0xb')]=function(_0x249dc9,_0x5ca551){return _0x249dc9[_0xa5e4('0xc')]('ChatApplication',attributes,{'tableName':_0xa5e4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5e4('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xca66=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5f2f8f,_0x13390a){var _0x454a0f=function(_0x2c5b71){while(--_0x2c5b71){_0x5f2f8f['push'](_0x5f2f8f['shift']());}};_0x454a0f(++_0x13390a);}(_0xca66,0xb3));var _0x6ca6=function(_0x18626c,_0x4dc2c1){_0x18626c=_0x18626c-0x0;var _0x4b5de6=_0xca66[_0x18626c];return _0x4b5de6;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var logger=require(_0x6ca6('0x1'))(_0x6ca6('0x2'));var moment=require(_0x6ca6('0x3'));var BPromise=require('bluebird');var rp=require(_0x6ca6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ca6('0x5'));var config=require(_0x6ca6('0x6'));var attributes=require(_0x6ca6('0x7'));module[_0x6ca6('0x8')]=function(_0x132583,_0x4ab56d){return _0x132583['define'](_0x6ca6('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ca6('0xa'),'collate':_0x6ca6('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 9f359ad..1235526 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 _0x82df=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','bluebird','ioredis','../../mysqldb'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x82df,0xb1));var _0xf82d=function(_0xefd9a0,_0x663dcd){_0xefd9a0=_0xefd9a0-0x0;var _0x355f43=_0x82df[_0xefd9a0];return _0x355f43;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf82d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf82d('0x1'));var db=require(_0xf82d('0x2'))['db'];var utils=require(_0xf82d('0x3'));var logger=require('../../config/logger')(_0xf82d('0x4'));var config=require(_0xf82d('0x5'));var jayson=require(_0xf82d('0x6'));var client=jayson[_0xf82d('0x7')][_0xf82d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6853b5,_0x4878a0,_0x18ea7a){return new BPromise(function(_0x7d3cd0,_0x5a7bc4){return client[_0xf82d('0x9')](_0x6853b5,_0x18ea7a)[_0xf82d('0xa')](function(_0x300cad){logger['info'](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4878a0,_0xf82d('0xc'),JSON['stringify'](_0x300cad));if(_0x300cad[_0xf82d('0xd')]){if(_0x300cad[_0xf82d('0xd')]['code']===0x1f4){logger[_0xf82d('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4878a0,_0x300cad['error']['message']);return _0x5a7bc4(_0x300cad[_0xf82d('0xd')][_0xf82d('0xe')]);}logger['error'](_0xf82d('0xb'),_0x4878a0,_0x300cad['error']['message']);return _0x7d3cd0(_0x300cad['error']['message']);}else{logger[_0xf82d('0xf')](_0xf82d('0xb'),_0x4878a0,_0xf82d('0xc'));_0x7d3cd0(_0x300cad[_0xf82d('0x10')][_0xf82d('0xe')]);}})[_0xf82d('0x11')](function(_0x1996b8){logger['error'](_0xf82d('0xb'),_0x4878a0,_0x1996b8);_0x5a7bc4(_0x1996b8);});});} \ No newline at end of file +var _0xf5b7=['http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x40bc88,_0x5c07fd){var _0xa87651=function(_0x2170b3){while(--_0x2170b3){_0x40bc88['push'](_0x40bc88['shift']());}};_0xa87651(++_0x5c07fd);}(_0xf5b7,0x76));var _0x7f5b=function(_0x354357,_0x876b35){_0x354357=_0x354357-0x0;var _0x438970=_0xf5b7[_0x354357];return _0x438970;};'use strict';var _=require(_0x7f5b('0x0'));var util=require('util');var moment=require(_0x7f5b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f5b('0x2'));var db=require(_0x7f5b('0x3'))['db'];var utils=require(_0x7f5b('0x4'));var logger=require(_0x7f5b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f5b('0x6'));var client=jayson[_0x7f5b('0x7')][_0x7f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c05e,_0x221649,_0x195bfa){return new BPromise(function(_0x4ba61e,_0x4eff87){return client[_0x7f5b('0x9')](_0x53c05e,_0x195bfa)[_0x7f5b('0xa')](function(_0x5cc2f9){logger[_0x7f5b('0xb')]('ChatApplication,\x20%s,\x20%s',_0x221649,_0x7f5b('0xc'));logger[_0x7f5b('0xd')](_0x7f5b('0xe'),_0x221649,_0x7f5b('0xc'),JSON['stringify'](_0x5cc2f9));if(_0x5cc2f9[_0x7f5b('0xf')]){if(_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x10')]===0x1f4){logger[_0x7f5b('0xf')](_0x7f5b('0x11'),_0x221649,_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x12')]);return _0x4eff87(_0x5cc2f9[_0x7f5b('0xf')][_0x7f5b('0x12')]);}logger[_0x7f5b('0xf')]('ChatApplication,\x20%s,\x20%s',_0x221649,_0x5cc2f9['error'][_0x7f5b('0x12')]);return _0x4ba61e(_0x5cc2f9['error'][_0x7f5b('0x12')]);}else{logger[_0x7f5b('0xb')](_0x7f5b('0x11'),_0x221649,_0x7f5b('0xc'));_0x4ba61e(_0x5cc2f9[_0x7f5b('0x13')][_0x7f5b('0x12')]);}})[_0x7f5b('0x14')](function(_0x1e3203){logger[_0x7f5b('0xf')](_0x7f5b('0x11'),_0x221649,_0x1e3203);_0x4eff87(_0x1e3203);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 529ca3c..9eab644 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 _0x42de=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x42de,0x9d));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe42d('0x0'));var util=require(_0xe42d('0x1'));var path=require(_0xe42d('0x2'));var timeout=require(_0xe42d('0x3'));var express=require(_0xe42d('0x4'));var router=express[_0xe42d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe42d('0x6'));var interaction=require(_0xe42d('0x7'));var config=require(_0xe42d('0x8'));var controller=require(_0xe42d('0x9'));router[_0xe42d('0xa')](_0xe42d('0xb'),auth[_0xe42d('0xc')](),controller[_0xe42d('0xd')]);router[_0xe42d('0xe')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0xf')]);router[_0xe42d('0x10')](_0xe42d('0xb'),auth['isAuthenticated'](),controller[_0xe42d('0x11')]);module[_0xe42d('0x12')]=router; \ No newline at end of file +var _0x30af=['/:id','isAuthenticated','show','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','get'];(function(_0x23002b,_0x33cc05){var _0x54a86c=function(_0x39d003){while(--_0x39d003){_0x23002b['push'](_0x23002b['shift']());}};_0x54a86c(++_0x33cc05);}(_0x30af,0x1c0));var _0xf30a=function(_0x27380a,_0x11b4db){_0x27380a=_0x27380a-0x0;var _0x49557d=_0x30af[_0x27380a];return _0x49557d;};'use strict';var multer=require(_0xf30a('0x0'));var util=require(_0xf30a('0x1'));var path=require(_0xf30a('0x2'));var timeout=require(_0xf30a('0x3'));var express=require(_0xf30a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf30a('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xf30a('0x6')](_0xf30a('0x7'),auth[_0xf30a('0x8')](),controller[_0xf30a('0x9')]);router['put'](_0xf30a('0x7'),auth['isAuthenticated'](),controller[_0xf30a('0xa')]);router['delete'](_0xf30a('0x7'),auth[_0xf30a('0x8')](),controller[_0xf30a('0xb')]);module[_0xf30a('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index de9bb02..36601b7 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 _0xe0c1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5c3c83,_0x4929ef){var _0x1713b9=function(_0x1fd80d){while(--_0x1fd80d){_0x5c3c83['push'](_0x5c3c83['shift']());}};_0x1713b9(++_0x4929ef);}(_0xe0c1,0x175));var _0x1e0c=function(_0xa40467,_0x97ce36){_0xa40467=_0xa40467-0x0;var _0x12f835=_0xe0c1[_0xa40467];return _0x12f835;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module[_0x1e0c('0x1')]={'name':{'type':Sequelize[_0x1e0c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e0c('0x2')]},'write':{'type':Sequelize[_0x1e0c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x09b1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x17afb2,_0x261563){var _0x4cb006=function(_0x5b3b29){while(--_0x5b3b29){_0x17afb2['push'](_0x17afb2['shift']());}};_0x4cb006(++_0x261563);}(_0x09b1,0xa7));var _0x109b=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x09b1[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x109b('0x0'));module[_0x109b('0x1')]={'name':{'type':Sequelize[_0x109b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x109b('0x2')]},'write':{'type':Sequelize[_0x109b('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 acf327c..40befe6 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 _0x40e2=['redis','./chatGroup.socket','register','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x40e2,0x15d));var _0x240e=function(_0x42abd1,_0x7d92f2){_0x42abd1=_0x42abd1-0x0;var _0x115bc1=_0x40e2[_0x42abd1];return _0x115bc1;};'use strict';var emlformat=require(_0x240e('0x0'));var rimraf=require(_0x240e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x240e('0x2'));var moment=require(_0x240e('0x3'));var BPromise=require(_0x240e('0x4'));var Mustache=require(_0x240e('0x5'));var util=require('util');var path=require(_0x240e('0x6'));var sox=require(_0x240e('0x7'));var csv=require(_0x240e('0x8'));var ejs=require(_0x240e('0x9'));var fs=require('fs');var fs_extra=require(_0x240e('0xa'));var _=require(_0x240e('0xb'));var squel=require(_0x240e('0xc'));var crypto=require(_0x240e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x240e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x240e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x240e('0x10'));var qs=require(_0x240e('0x11'));var as=require(_0x240e('0x12'));var hardwareService=require(_0x240e('0x13'));var logger=require('../../config/logger')(_0x240e('0x14'));var utils=require(_0x240e('0x15'));var config=require(_0x240e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x240e('0x17'))['db'];config['redis']=_[_0x240e('0x18')](config['redis'],{'host':_0x240e('0x19'),'port':0x18eb});var socket=require(_0x240e('0x1a'))(new Redis(config[_0x240e('0x1b')]));require(_0x240e('0x1c'))[_0x240e('0x1d')](socket);function respondWithStatusCode(_0x4ea60b,_0x117244){_0x117244=_0x117244||0xcc;return function(_0x5db782){if(_0x5db782){return _0x4ea60b['sendStatus'](_0x117244);}return _0x4ea60b['status'](_0x117244)['end']();};}function respondWithResult(_0x189a08,_0x2966ac){_0x2966ac=_0x2966ac||0xc8;return function(_0x44c50c){if(_0x44c50c){return _0x189a08['status'](_0x2966ac)['json'](_0x44c50c);}};}function respondWithFilteredResult(_0x2dc614,_0x1572c8){return function(_0x2b80b4){if(_0x2b80b4){var _0x427c2f=typeof _0x1572c8[_0x240e('0x1e')]==='undefined'&&typeof _0x1572c8[_0x240e('0x1f')]===_0x240e('0x20');var _0x26a4de=_0x2b80b4['count'];var _0x174452=_0x427c2f?0x0:_0x1572c8[_0x240e('0x1e')];var _0x4517e5=_0x427c2f?_0x2b80b4[_0x240e('0x21')]:_0x1572c8[_0x240e('0x1e')]+_0x1572c8[_0x240e('0x1f')];var _0x441f6e;if(_0x4517e5>=_0x26a4de){_0x4517e5=_0x26a4de;_0x441f6e=0xc8;}else{_0x441f6e=0xce;}_0x2dc614[_0x240e('0x22')](_0x441f6e);return _0x2dc614['set'](_0x240e('0x23'),_0x174452+'-'+_0x4517e5+'/'+_0x26a4de)[_0x240e('0x24')](_0x2b80b4);}return null;};}function patchUpdates(_0x170a9c){return function(_0x233bcd){try{jsonpatch[_0x240e('0x25')](_0x233bcd,_0x170a9c,!![]);}catch(_0x38ad95){return BPromise[_0x240e('0x26')](_0x38ad95);}return _0x233bcd[_0x240e('0x27')]();};}function saveUpdates(_0x47fbd1,_0xf1f331){return function(_0x1b4e96){if(_0x1b4e96){return _0x1b4e96[_0x240e('0x28')](_0x47fbd1)[_0x240e('0x29')](function(_0x4fcb21){return _0x4fcb21;});}return null;};}function removeEntity(_0x3c6e9d,_0x14da96){return function(_0xaef70a){if(_0xaef70a){return _0xaef70a['destroy']()[_0x240e('0x29')](function(){_0x3c6e9d[_0x240e('0x22')](0xcc)[_0x240e('0x2a')]();});}};}function handleEntityNotFound(_0x390c98,_0x4953cc){return function(_0x4c8082){if(!_0x4c8082){_0x390c98['sendStatus'](0x194);}return _0x4c8082;};}function handleError(_0x47e1cf,_0x5a5060){_0x5a5060=_0x5a5060||0x1f4;return function(_0x4b9b57){logger['error'](_0x4b9b57[_0x240e('0x2b')]);if(_0x4b9b57[_0x240e('0x2c')]){delete _0x4b9b57[_0x240e('0x2c')];}_0x47e1cf[_0x240e('0x22')](_0x5a5060)['send'](_0x4b9b57);};}exports['index']=function(_0x45217,_0x291b49){var _0x4da16d={},_0x4f78d8={},_0x37a24a={'count':0x0,'rows':[]};var _0x492b4d=_[_0x240e('0x2d')](db[_0x240e('0x2e')][_0x240e('0x2f')],function(_0x172709){return{'name':_0x172709[_0x240e('0x30')],'type':_0x172709[_0x240e('0x31')][_0x240e('0x32')]};});_0x4f78d8['model']=_[_0x240e('0x2d')](_0x492b4d,_0x240e('0x2c'));_0x4f78d8['query']=_[_0x240e('0x33')](_0x45217[_0x240e('0x34')]);_0x4f78d8['filters']=_['intersection'](_0x4f78d8[_0x240e('0x35')],_0x4f78d8['query']);_0x4da16d['attributes']=_[_0x240e('0x36')](_0x4f78d8[_0x240e('0x35')],qs['fields'](_0x45217[_0x240e('0x34')][_0x240e('0x37')]));_0x4da16d[_0x240e('0x38')]=_0x4da16d[_0x240e('0x38')][_0x240e('0x39')]?_0x4da16d[_0x240e('0x38')]:_0x4f78d8[_0x240e('0x35')];if(!_0x45217[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x4da16d[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x45217[_0x240e('0x34')][_0x240e('0x1f')]);_0x4da16d[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x45217['query'][_0x240e('0x1e')]);}_0x4da16d[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x45217['query'][_0x240e('0x3d')]);_0x4da16d[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x45217['query'],_0x4f78d8[_0x240e('0x3f')]),_0x492b4d);if(_0x45217[_0x240e('0x34')][_0x240e('0x41')]){_0x4da16d['where']=_[_0x240e('0x42')](_0x4da16d['where'],{'$or':_[_0x240e('0x2d')](_0x492b4d,function(_0x5f0ad1){if(_0x5f0ad1['type']!==_0x240e('0x43')){var _0x4f3de5={};_0x4f3de5[_0x5f0ad1[_0x240e('0x2c')]]={'$like':'%'+_0x45217[_0x240e('0x34')][_0x240e('0x41')]+'%'};return _0x4f3de5;}})});}_0x4da16d=_[_0x240e('0x42')]({},_0x4da16d,_0x45217[_0x240e('0x44')]);var _0x45376c={'where':_0x4da16d['where']};return db[_0x240e('0x2e')][_0x240e('0x21')](_0x45376c)[_0x240e('0x29')](function(_0x406d82){_0x37a24a[_0x240e('0x21')]=_0x406d82;if(_0x45217['query'][_0x240e('0x45')]){_0x4da16d['include']=[{'all':!![]}];}return db['ChatGroup'][_0x240e('0x46')](_0x4da16d);})[_0x240e('0x29')](function(_0x394b5e){_0x37a24a['rows']=_0x394b5e;return _0x37a24a;})['then'](respondWithFilteredResult(_0x291b49,_0x4da16d))[_0x240e('0x47')](handleError(_0x291b49,null));};exports[_0x240e('0x48')]=function(_0x756b96,_0x5433e8){var _0x3b7bde={'raw':!![],'where':{'id':_0x756b96[_0x240e('0x49')]['id']}},_0x596658={};_0x596658['model']=_[_0x240e('0x33')](db[_0x240e('0x2e')][_0x240e('0x2f')]);_0x596658[_0x240e('0x34')]=_[_0x240e('0x33')](_0x756b96[_0x240e('0x34')]);_0x596658[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x596658[_0x240e('0x35')],_0x596658['query']);_0x3b7bde[_0x240e('0x38')]=_['intersection'](_0x596658[_0x240e('0x35')],qs['fields'](_0x756b96['query'][_0x240e('0x37')]));_0x3b7bde['attributes']=_0x3b7bde[_0x240e('0x38')][_0x240e('0x39')]?_0x3b7bde[_0x240e('0x38')]:_0x596658[_0x240e('0x35')];if(_0x756b96[_0x240e('0x34')][_0x240e('0x45')]){_0x3b7bde[_0x240e('0x4a')]=[{'all':!![]}];}_0x3b7bde=_[_0x240e('0x42')]({},_0x3b7bde,_0x756b96[_0x240e('0x44')]);return db['ChatGroup'][_0x240e('0x4b')](_0x3b7bde)['then'](handleEntityNotFound(_0x5433e8,null))['then'](respondWithResult(_0x5433e8,null))['catch'](handleError(_0x5433e8,null));};exports[_0x240e('0x4c')]=function(_0x3ff153,_0x19f6e3){return db['ChatGroup'][_0x240e('0x4c')](_0x3ff153[_0x240e('0x4d')],{})[_0x240e('0x29')](respondWithResult(_0x19f6e3,0xc9))[_0x240e('0x47')](handleError(_0x19f6e3,null));};exports[_0x240e('0x28')]=function(_0x2638d1,_0x28e0c6){if(_0x2638d1['body']['id']){delete _0x2638d1[_0x240e('0x4d')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2638d1['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x28e0c6,null))[_0x240e('0x29')](saveUpdates(_0x2638d1['body'],null))['then'](respondWithResult(_0x28e0c6,null))[_0x240e('0x47')](handleError(_0x28e0c6,null));};exports[_0x240e('0x4e')]=function(_0x4e10c4,_0x3dd92e){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4e10c4['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x3dd92e,null))[_0x240e('0x29')](removeEntity(_0x3dd92e,null))[_0x240e('0x47')](handleError(_0x3dd92e,null));};exports[_0x240e('0x4f')]=function(_0x34893e,_0x4947da){return db[_0x240e('0x2e')][_0x240e('0x4f')]()['then'](respondWithResult(_0x4947da,null))[_0x240e('0x47')](handleError(_0x4947da,null));};exports['getUnread']=function(_0x5ef313,_0x1d2bae,_0x26aa2f){return db[_0x240e('0x50')]['count']({'where':{'ChatGroupId':_0x5ef313[_0x240e('0x49')]['id'],'ToId':_0x5ef313['user']['id'],'read':![]}})[_0x240e('0x29')](function(_0x316acd){return{'id':_[_0x240e('0x51')](_0x5ef313['params']['id']),'count':_0x316acd};})[_0x240e('0x29')](respondWithResult(_0x1d2bae,null))['catch'](handleError(_0x1d2bae,null));};exports[_0x240e('0x52')]=function(_0x1835a6,_0x409048,_0x48fe52){return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x1835a6[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x409048,null))[_0x240e('0x29')](function(_0x540c47){if(_0x540c47){return _0x540c47[_0x240e('0x52')](_0x1835a6[_0x240e('0x4d')][_0x240e('0x53')],_['omit'](_0x1835a6['body'],[_0x240e('0x53'),'id'])||{});}})[_0x240e('0x29')](respondWithResult(_0x409048,null))['catch'](handleError(_0x409048,null));};exports[_0x240e('0x54')]=function(_0x2376e8,_0x1e15f4,_0x596959){var _0x314776={};var _0x3a7c78={};var _0x414ae7;var _0x402fa8;return db['ChatGroup'][_0x240e('0x55')]({'where':{'id':_0x2376e8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x1e15f4,null))['then'](function(_0x3c1659){if(_0x3c1659){_0x414ae7=_0x3c1659;_0x3a7c78[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x56')][_0x240e('0x2f')]);_0x3a7c78[_0x240e('0x34')]=_[_0x240e('0x33')](_0x2376e8['query']);_0x3a7c78['filters']=_[_0x240e('0x36')](_0x3a7c78['model'],_0x3a7c78[_0x240e('0x34')]);_0x314776[_0x240e('0x38')]=_['intersection'](_0x3a7c78[_0x240e('0x35')],qs[_0x240e('0x37')](_0x2376e8[_0x240e('0x34')][_0x240e('0x37')]));_0x314776[_0x240e('0x38')]=_0x314776[_0x240e('0x38')][_0x240e('0x39')]?_0x314776[_0x240e('0x38')]:_0x3a7c78[_0x240e('0x35')];_0x314776['order']=qs[_0x240e('0x3d')](_0x2376e8['query'][_0x240e('0x3d')]);_0x314776['where']=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x2376e8[_0x240e('0x34')],_0x3a7c78[_0x240e('0x3f')]));if(_0x2376e8[_0x240e('0x34')][_0x240e('0x41')]){_0x314776[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x314776[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x314776[_0x240e('0x38')],function(_0x19f9e1){var _0x960955={};_0x960955[_0x19f9e1]={'$like':'%'+_0x2376e8[_0x240e('0x34')]['filter']+'%'};return _0x960955;})});}_0x314776=_['merge']({},_0x314776,_0x2376e8[_0x240e('0x44')]);return _0x414ae7[_0x240e('0x54')](_0x314776);}})['then'](function(_0x40353f){if(_0x40353f){_0x402fa8=_0x40353f[_0x240e('0x39')];if(!_0x2376e8[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x314776['limit']=qs[_0x240e('0x1f')](_0x2376e8['query'][_0x240e('0x1f')]);_0x314776['offset']=qs[_0x240e('0x1e')](_0x2376e8[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x414ae7[_0x240e('0x54')](_0x314776);}})[_0x240e('0x29')](function(_0x1be30d){if(_0x1be30d){return _0x1be30d?{'count':_0x402fa8,'rows':_0x1be30d}:null;}})['then'](respondWithResult(_0x1e15f4,null))[_0x240e('0x47')](handleError(_0x1e15f4,null));};exports[_0x240e('0x57')]=function(_0x5ef2a8,_0x35736e,_0x163d49){return db[_0x240e('0x2e')]['find']({'where':{'id':_0x5ef2a8[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x35736e,null))[_0x240e('0x29')](function(_0x5f2004){if(_0x5f2004){return _0x5f2004[_0x240e('0x57')](_0x5ef2a8[_0x240e('0x34')][_0x240e('0x53')]);}})['then'](respondWithStatusCode(_0x35736e,null))['catch'](handleError(_0x35736e,null));};exports[_0x240e('0x58')]=function(_0x4bd5db,_0x5c5dba,_0x52e7e9){if(_0x4bd5db[_0x240e('0x4d')]['id']){delete _0x4bd5db['body']['id'];}return db[_0x240e('0x2e')][_0x240e('0x4b')]({'where':{'id':_0x4bd5db[_0x240e('0x49')]['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5c5dba,null))[_0x240e('0x29')](function(_0x9ecc39){if(_0x9ecc39){_0x4bd5db['body'][_0x240e('0x59')]=_0x9ecc39['id'];return db[_0x240e('0x50')][_0x240e('0x4c')](_0x4bd5db['body']);}})[_0x240e('0x29')](respondWithResult(_0x5c5dba,null))[_0x240e('0x47')](handleError(_0x5c5dba,null));};exports['getMessages']=function(_0x3841ec,_0x5e8e55,_0x15e8f6){var _0x322249={};var _0x37a370={};var _0x5a88d4;var _0x3c8773;return db[_0x240e('0x2e')]['findOne']({'where':{'id':_0x3841ec['params']['id']}})[_0x240e('0x29')](handleEntityNotFound(_0x5e8e55,null))[_0x240e('0x29')](function(_0x599b9d){if(_0x599b9d){_0x5a88d4=_0x599b9d;_0x37a370[_0x240e('0x35')]=_[_0x240e('0x33')](db[_0x240e('0x50')][_0x240e('0x2f')]);_0x37a370[_0x240e('0x34')]=_[_0x240e('0x33')](_0x3841ec['query']);_0x37a370[_0x240e('0x3f')]=_[_0x240e('0x36')](_0x37a370['model'],_0x37a370[_0x240e('0x34')]);_0x322249[_0x240e('0x38')]=_['intersection'](_0x37a370['model'],qs[_0x240e('0x37')](_0x3841ec[_0x240e('0x34')]['fields']));_0x322249[_0x240e('0x38')]=_0x322249[_0x240e('0x38')][_0x240e('0x39')]?_0x322249[_0x240e('0x38')]:_0x37a370[_0x240e('0x35')];_0x322249[_0x240e('0x3c')]=qs[_0x240e('0x3d')](_0x3841ec['query'][_0x240e('0x3d')]);_0x322249[_0x240e('0x3e')]=qs[_0x240e('0x3f')](_[_0x240e('0x40')](_0x3841ec[_0x240e('0x34')],_0x37a370[_0x240e('0x3f')]));if(_0x3841ec['query'][_0x240e('0x41')]){_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],{'$or':_[_0x240e('0x2d')](_0x322249[_0x240e('0x38')],function(_0x21a7a8){var _0x12e549={};_0x12e549[_0x21a7a8]={'$like':'%'+_0x3841ec['query']['filter']+'%'};return _0x12e549;})});}if(_0x3841ec[_0x240e('0x34')]['$gte']){var _0x5683cf=_0x3841ec[_0x240e('0x34')][_0x240e('0x5a')][_0x240e('0x5b')](',');var _0x33136f={};_0x33136f[_0x5683cf[0x0]]={'$gte':moment(_0x5683cf[0x1])[_0x240e('0x5c')](_0x240e('0x5d'))};_0x322249[_0x240e('0x3e')]=_[_0x240e('0x42')](_0x322249[_0x240e('0x3e')],_0x33136f);}_0x322249=_[_0x240e('0x42')]({},_0x322249,_0x3841ec[_0x240e('0x44')]);return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0x268dfc){if(_0x268dfc){_0x3c8773=_0x268dfc[_0x240e('0x39')];if(!_0x3841ec[_0x240e('0x34')][_0x240e('0x3a')](_0x240e('0x3b'))){_0x322249[_0x240e('0x1f')]=qs[_0x240e('0x1f')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1f')]);_0x322249[_0x240e('0x1e')]=qs[_0x240e('0x1e')](_0x3841ec[_0x240e('0x34')][_0x240e('0x1e')]);}return _0x5a88d4['getMessages'](_0x322249);}})[_0x240e('0x29')](function(_0xed495c){if(_0xed495c){return _0xed495c?{'count':_0x3c8773,'rows':_0xed495c}:null;}})['then'](respondWithResult(_0x5e8e55,null))[_0x240e('0x47')](handleError(_0x5e8e55,null));}; \ No newline at end of file +var _0x4197=['create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','order','options','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','map','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','include','findAll','rows','catch','rawAttributes','find'];(function(_0x3f5309,_0x3f30e9){var _0x206858=function(_0x7a7a6f){while(--_0x7a7a6f){_0x3f5309['push'](_0x3f5309['shift']());}};_0x206858(++_0x3f30e9);}(_0x4197,0xd1));var _0x7419=function(_0x55bebc,_0x4dbb47){_0x55bebc=_0x55bebc-0x0;var _0x173674=_0x4197[_0x55bebc];return _0x173674;};'use strict';var emlformat=require(_0x7419('0x0'));var rimraf=require(_0x7419('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7419('0x2'));var rp=require(_0x7419('0x3'));var moment=require(_0x7419('0x4'));var BPromise=require(_0x7419('0x5'));var Mustache=require(_0x7419('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7419('0x7'));var csv=require('to-csv');var ejs=require(_0x7419('0x8'));var fs=require('fs');var fs_extra=require(_0x7419('0x9'));var _=require(_0x7419('0xa'));var squel=require(_0x7419('0xb'));var crypto=require('crypto');var jsforce=require(_0x7419('0xc'));var deskjs=require(_0x7419('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7419('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7419('0xf'));var qs=require(_0x7419('0x10'));var as=require(_0x7419('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7419('0x12'))(_0x7419('0x13'));var utils=require(_0x7419('0x14'));var config=require(_0x7419('0x15'));var licenseUtil=require(_0x7419('0x16'));var db=require('../../mysqldb')['db'];config[_0x7419('0x17')]=_['defaults'](config[_0x7419('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7419('0x18'))(new Redis(config['redis']));require(_0x7419('0x19'))[_0x7419('0x1a')](socket);function respondWithStatusCode(_0x33c059,_0x4d78e3){_0x4d78e3=_0x4d78e3||0xcc;return function(_0x268342){if(_0x268342){return _0x33c059[_0x7419('0x1b')](_0x4d78e3);}return _0x33c059['status'](_0x4d78e3)[_0x7419('0x1c')]();};}function respondWithResult(_0x49107b,_0x2ccbe5){_0x2ccbe5=_0x2ccbe5||0xc8;return function(_0x57ff95){if(_0x57ff95){return _0x49107b['status'](_0x2ccbe5)['json'](_0x57ff95);}};}function respondWithFilteredResult(_0x5d35e4,_0x4029c8){return function(_0x2364e4){if(_0x2364e4){var _0x11b04c=typeof _0x4029c8['offset']===_0x7419('0x1d')&&typeof _0x4029c8[_0x7419('0x1e')]===_0x7419('0x1d');var _0x9269c2=_0x2364e4[_0x7419('0x1f')];var _0x15db56=_0x11b04c?0x0:_0x4029c8['offset'];var _0x36239c=_0x11b04c?_0x2364e4[_0x7419('0x1f')]:_0x4029c8[_0x7419('0x20')]+_0x4029c8['limit'];var _0x33861b;if(_0x36239c>=_0x9269c2){_0x36239c=_0x9269c2;_0x33861b=0xc8;}else{_0x33861b=0xce;}_0x5d35e4[_0x7419('0x21')](_0x33861b);return _0x5d35e4[_0x7419('0x22')](_0x7419('0x23'),_0x15db56+'-'+_0x36239c+'/'+_0x9269c2)[_0x7419('0x24')](_0x2364e4);}return null;};}function patchUpdates(_0xbb931a){return function(_0x598510){try{jsonpatch[_0x7419('0x25')](_0x598510,_0xbb931a,!![]);}catch(_0x147187){return BPromise[_0x7419('0x26')](_0x147187);}return _0x598510['save']();};}function saveUpdates(_0x151640,_0x52f537){return function(_0x505baf){if(_0x505baf){return _0x505baf[_0x7419('0x27')](_0x151640)['then'](function(_0x175064){return _0x175064;});}return null;};}function removeEntity(_0x53847a,_0x63e87){return function(_0x18f0c1){if(_0x18f0c1){return _0x18f0c1[_0x7419('0x28')]()[_0x7419('0x29')](function(){_0x53847a[_0x7419('0x21')](0xcc)[_0x7419('0x1c')]();});}};}function handleEntityNotFound(_0x4dbde6,_0x2ab777){return function(_0x548fb5){if(!_0x548fb5){_0x4dbde6[_0x7419('0x1b')](0x194);}return _0x548fb5;};}function handleError(_0x10631b,_0x56d966){_0x56d966=_0x56d966||0x1f4;return function(_0x1f291a){logger[_0x7419('0x2a')](_0x1f291a[_0x7419('0x2b')]);if(_0x1f291a['name']){delete _0x1f291a['name'];}_0x10631b[_0x7419('0x21')](_0x56d966)['send'](_0x1f291a);};}exports['index']=function(_0x5d1be1,_0x3e351c){var _0x104eec={},_0x4bc9a3={},_0x224761={'count':0x0,'rows':[]};var _0x6b8e60=_[_0x7419('0x2c')](db['ChatGroup']['rawAttributes'],function(_0x29876b){return{'name':_0x29876b[_0x7419('0x2d')],'type':_0x29876b[_0x7419('0x2e')][_0x7419('0x2f')]};});_0x4bc9a3[_0x7419('0x30')]=_[_0x7419('0x2c')](_0x6b8e60,_0x7419('0x31'));_0x4bc9a3['query']=_[_0x7419('0x32')](_0x5d1be1[_0x7419('0x33')]);_0x4bc9a3[_0x7419('0x34')]=_[_0x7419('0x35')](_0x4bc9a3['model'],_0x4bc9a3[_0x7419('0x33')]);_0x104eec[_0x7419('0x36')]=_[_0x7419('0x35')](_0x4bc9a3[_0x7419('0x30')],qs['fields'](_0x5d1be1[_0x7419('0x33')][_0x7419('0x37')]));_0x104eec[_0x7419('0x36')]=_0x104eec[_0x7419('0x36')][_0x7419('0x38')]?_0x104eec['attributes']:_0x4bc9a3['model'];if(!_0x5d1be1['query']['hasOwnProperty']('nolimit')){_0x104eec['limit']=qs[_0x7419('0x1e')](_0x5d1be1[_0x7419('0x33')][_0x7419('0x1e')]);_0x104eec['offset']=qs[_0x7419('0x20')](_0x5d1be1['query'][_0x7419('0x20')]);}_0x104eec['order']=qs[_0x7419('0x39')](_0x5d1be1['query'][_0x7419('0x39')]);_0x104eec[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x5d1be1[_0x7419('0x33')],_0x4bc9a3['filters']),_0x6b8e60);if(_0x5d1be1[_0x7419('0x33')][_0x7419('0x3c')]){_0x104eec[_0x7419('0x3a')]=_[_0x7419('0x3d')](_0x104eec['where'],{'$or':_[_0x7419('0x2c')](_0x6b8e60,function(_0x10e0d7){if(_0x10e0d7['type']!==_0x7419('0x3e')){var _0x30253d={};_0x30253d[_0x10e0d7[_0x7419('0x31')]]={'$like':'%'+_0x5d1be1[_0x7419('0x33')][_0x7419('0x3c')]+'%'};return _0x30253d;}})});}_0x104eec=_[_0x7419('0x3d')]({},_0x104eec,_0x5d1be1['options']);var _0x1c5e28={'where':_0x104eec[_0x7419('0x3a')]};return db[_0x7419('0x3f')][_0x7419('0x1f')](_0x1c5e28)[_0x7419('0x29')](function(_0x377c58){_0x224761[_0x7419('0x1f')]=_0x377c58;if(_0x5d1be1['query']['includeAll']){_0x104eec[_0x7419('0x40')]=[{'all':!![]}];}return db[_0x7419('0x3f')][_0x7419('0x41')](_0x104eec);})[_0x7419('0x29')](function(_0x427738){_0x224761[_0x7419('0x42')]=_0x427738;return _0x224761;})[_0x7419('0x29')](respondWithFilteredResult(_0x3e351c,_0x104eec))[_0x7419('0x43')](handleError(_0x3e351c,null));};exports['show']=function(_0x75829e,_0x1a867a){var _0x352ac7={'raw':!![],'where':{'id':_0x75829e['params']['id']}},_0x555426={};_0x555426[_0x7419('0x30')]=_[_0x7419('0x32')](db[_0x7419('0x3f')][_0x7419('0x44')]);_0x555426[_0x7419('0x33')]=_[_0x7419('0x32')](_0x75829e['query']);_0x555426[_0x7419('0x34')]=_[_0x7419('0x35')](_0x555426[_0x7419('0x30')],_0x555426[_0x7419('0x33')]);_0x352ac7[_0x7419('0x36')]=_[_0x7419('0x35')](_0x555426[_0x7419('0x30')],qs[_0x7419('0x37')](_0x75829e[_0x7419('0x33')][_0x7419('0x37')]));_0x352ac7[_0x7419('0x36')]=_0x352ac7[_0x7419('0x36')][_0x7419('0x38')]?_0x352ac7[_0x7419('0x36')]:_0x555426[_0x7419('0x30')];if(_0x75829e['query']['includeAll']){_0x352ac7[_0x7419('0x40')]=[{'all':!![]}];}_0x352ac7=_[_0x7419('0x3d')]({},_0x352ac7,_0x75829e['options']);return db[_0x7419('0x3f')][_0x7419('0x45')](_0x352ac7)['then'](handleEntityNotFound(_0x1a867a,null))[_0x7419('0x29')](respondWithResult(_0x1a867a,null))['catch'](handleError(_0x1a867a,null));};exports['create']=function(_0x4c4981,_0x210ff7){return db[_0x7419('0x3f')][_0x7419('0x46')](_0x4c4981[_0x7419('0x47')],{})['then'](respondWithResult(_0x210ff7,0xc9))[_0x7419('0x43')](handleError(_0x210ff7,null));};exports[_0x7419('0x27')]=function(_0x5d31f5,_0x366135){if(_0x5d31f5[_0x7419('0x47')]['id']){delete _0x5d31f5[_0x7419('0x47')]['id'];}return db[_0x7419('0x3f')][_0x7419('0x45')]({'where':{'id':_0x5d31f5['params']['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x366135,null))[_0x7419('0x29')](saveUpdates(_0x5d31f5['body'],null))[_0x7419('0x29')](respondWithResult(_0x366135,null))[_0x7419('0x43')](handleError(_0x366135,null));};exports[_0x7419('0x28')]=function(_0x15206d,_0x43dc5a){return db['ChatGroup'][_0x7419('0x45')]({'where':{'id':_0x15206d[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x43dc5a,null))[_0x7419('0x29')](removeEntity(_0x43dc5a,null))['catch'](handleError(_0x43dc5a,null));};exports[_0x7419('0x49')]=function(_0x151e54,_0x5c7071){return db[_0x7419('0x3f')]['describe']()[_0x7419('0x29')](respondWithResult(_0x5c7071,null))[_0x7419('0x43')](handleError(_0x5c7071,null));};exports[_0x7419('0x4a')]=function(_0x3f5f91,_0xad6424,_0x462ca7){return db[_0x7419('0x4b')][_0x7419('0x1f')]({'where':{'ChatGroupId':_0x3f5f91['params']['id'],'ToId':_0x3f5f91[_0x7419('0x4c')]['id'],'read':![]}})[_0x7419('0x29')](function(_0x14fa47){return{'id':_[_0x7419('0x4d')](_0x3f5f91['params']['id']),'count':_0x14fa47};})[_0x7419('0x29')](respondWithResult(_0xad6424,null))[_0x7419('0x43')](handleError(_0xad6424,null));};exports[_0x7419('0x4e')]=function(_0x176d50,_0x1b1edb,_0x558b4d){return db[_0x7419('0x3f')][_0x7419('0x45')]({'where':{'id':_0x176d50[_0x7419('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1edb,null))[_0x7419('0x29')](function(_0x34d34d){if(_0x34d34d){return _0x34d34d[_0x7419('0x4e')](_0x176d50[_0x7419('0x47')][_0x7419('0x4f')],_['omit'](_0x176d50['body'],[_0x7419('0x4f'),'id'])||{});}})[_0x7419('0x29')](respondWithResult(_0x1b1edb,null))[_0x7419('0x43')](handleError(_0x1b1edb,null));};exports[_0x7419('0x50')]=function(_0x43f225,_0x202aa4,_0x32646d){var _0x5f8355={};var _0x1dd8d0={};var _0x5a166d;var _0x46bd9e;return db[_0x7419('0x3f')][_0x7419('0x51')]({'where':{'id':_0x43f225[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x202aa4,null))[_0x7419('0x29')](function(_0x4715d7){if(_0x4715d7){_0x5a166d=_0x4715d7;_0x1dd8d0[_0x7419('0x30')]=_['keys'](db['User']['rawAttributes']);_0x1dd8d0[_0x7419('0x33')]=_[_0x7419('0x32')](_0x43f225[_0x7419('0x33')]);_0x1dd8d0[_0x7419('0x34')]=_['intersection'](_0x1dd8d0[_0x7419('0x30')],_0x1dd8d0[_0x7419('0x33')]);_0x5f8355[_0x7419('0x36')]=_['intersection'](_0x1dd8d0[_0x7419('0x30')],qs[_0x7419('0x37')](_0x43f225['query']['fields']));_0x5f8355[_0x7419('0x36')]=_0x5f8355['attributes'][_0x7419('0x38')]?_0x5f8355[_0x7419('0x36')]:_0x1dd8d0[_0x7419('0x30')];_0x5f8355[_0x7419('0x52')]=qs[_0x7419('0x39')](_0x43f225[_0x7419('0x33')][_0x7419('0x39')]);_0x5f8355[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x43f225[_0x7419('0x33')],_0x1dd8d0['filters']));if(_0x43f225['query']['filter']){_0x5f8355[_0x7419('0x3a')]=_[_0x7419('0x3d')](_0x5f8355[_0x7419('0x3a')],{'$or':_[_0x7419('0x2c')](_0x5f8355[_0x7419('0x36')],function(_0x50354f){var _0x1ceb8e={};_0x1ceb8e[_0x50354f]={'$like':'%'+_0x43f225['query'][_0x7419('0x3c')]+'%'};return _0x1ceb8e;})});}_0x5f8355=_[_0x7419('0x3d')]({},_0x5f8355,_0x43f225[_0x7419('0x53')]);return _0x5a166d[_0x7419('0x50')](_0x5f8355);}})['then'](function(_0x21f077){if(_0x21f077){_0x46bd9e=_0x21f077[_0x7419('0x38')];if(!_0x43f225[_0x7419('0x33')][_0x7419('0x54')]('nolimit')){_0x5f8355[_0x7419('0x1e')]=qs['limit'](_0x43f225['query'][_0x7419('0x1e')]);_0x5f8355[_0x7419('0x20')]=qs['offset'](_0x43f225['query'][_0x7419('0x20')]);}return _0x5a166d[_0x7419('0x50')](_0x5f8355);}})[_0x7419('0x29')](function(_0x5a4fb5){if(_0x5a4fb5){return _0x5a4fb5?{'count':_0x46bd9e,'rows':_0x5a4fb5}:null;}})[_0x7419('0x29')](respondWithResult(_0x202aa4,null))['catch'](handleError(_0x202aa4,null));};exports[_0x7419('0x55')]=function(_0x2093df,_0x434534,_0x55e406){return db['ChatGroup'][_0x7419('0x45')]({'where':{'id':_0x2093df[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x434534,null))[_0x7419('0x29')](function(_0x302cc5){if(_0x302cc5){return _0x302cc5[_0x7419('0x55')](_0x2093df[_0x7419('0x33')][_0x7419('0x4f')]);}})['then'](respondWithStatusCode(_0x434534,null))['catch'](handleError(_0x434534,null));};exports[_0x7419('0x56')]=function(_0x28e6db,_0x3d867c,_0x5361a0){if(_0x28e6db['body']['id']){delete _0x28e6db[_0x7419('0x47')]['id'];}return db[_0x7419('0x3f')]['find']({'where':{'id':_0x28e6db['params']['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x3d867c,null))[_0x7419('0x29')](function(_0x88cd14){if(_0x88cd14){_0x28e6db['body'][_0x7419('0x57')]=_0x88cd14['id'];return db[_0x7419('0x4b')][_0x7419('0x46')](_0x28e6db['body']);}})[_0x7419('0x29')](respondWithResult(_0x3d867c,null))['catch'](handleError(_0x3d867c,null));};exports['getMessages']=function(_0x2924a4,_0x494c58,_0x2ef965){var _0xf112d9={};var _0x2d5e0f={};var _0x48de85;var _0x53d2bf;return db['ChatGroup'][_0x7419('0x51')]({'where':{'id':_0x2924a4[_0x7419('0x48')]['id']}})[_0x7419('0x29')](handleEntityNotFound(_0x494c58,null))[_0x7419('0x29')](function(_0x4a6048){if(_0x4a6048){_0x48de85=_0x4a6048;_0x2d5e0f[_0x7419('0x30')]=_['keys'](db['ChatInternalMessage'][_0x7419('0x44')]);_0x2d5e0f[_0x7419('0x33')]=_['keys'](_0x2924a4[_0x7419('0x33')]);_0x2d5e0f['filters']=_[_0x7419('0x35')](_0x2d5e0f['model'],_0x2d5e0f[_0x7419('0x33')]);_0xf112d9[_0x7419('0x36')]=_['intersection'](_0x2d5e0f[_0x7419('0x30')],qs['fields'](_0x2924a4[_0x7419('0x33')][_0x7419('0x37')]));_0xf112d9[_0x7419('0x36')]=_0xf112d9[_0x7419('0x36')][_0x7419('0x38')]?_0xf112d9[_0x7419('0x36')]:_0x2d5e0f[_0x7419('0x30')];_0xf112d9['order']=qs[_0x7419('0x39')](_0x2924a4[_0x7419('0x33')][_0x7419('0x39')]);_0xf112d9[_0x7419('0x3a')]=qs[_0x7419('0x34')](_[_0x7419('0x3b')](_0x2924a4[_0x7419('0x33')],_0x2d5e0f[_0x7419('0x34')]));if(_0x2924a4[_0x7419('0x33')]['filter']){_0xf112d9['where']=_['merge'](_0xf112d9[_0x7419('0x3a')],{'$or':_[_0x7419('0x2c')](_0xf112d9['attributes'],function(_0x3a79d1){var _0x4c6f9e={};_0x4c6f9e[_0x3a79d1]={'$like':'%'+_0x2924a4[_0x7419('0x33')][_0x7419('0x3c')]+'%'};return _0x4c6f9e;})});}if(_0x2924a4[_0x7419('0x33')]['$gte']){var _0x2e14ff=_0x2924a4[_0x7419('0x33')][_0x7419('0x58')][_0x7419('0x59')](',');var _0x17231a={};_0x17231a[_0x2e14ff[0x0]]={'$gte':moment(_0x2e14ff[0x1])[_0x7419('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf112d9['where']=_['merge'](_0xf112d9[_0x7419('0x3a')],_0x17231a);}_0xf112d9=_['merge']({},_0xf112d9,_0x2924a4['options']);return _0x48de85[_0x7419('0x5b')](_0xf112d9);}})[_0x7419('0x29')](function(_0x330a7a){if(_0x330a7a){_0x53d2bf=_0x330a7a['length'];if(!_0x2924a4['query']['hasOwnProperty'](_0x7419('0x5c'))){_0xf112d9[_0x7419('0x1e')]=qs[_0x7419('0x1e')](_0x2924a4[_0x7419('0x33')][_0x7419('0x1e')]);_0xf112d9[_0x7419('0x20')]=qs[_0x7419('0x20')](_0x2924a4['query'][_0x7419('0x20')]);}return _0x48de85[_0x7419('0x5b')](_0xf112d9);}})[_0x7419('0x29')](function(_0x1727f3){if(_0x1727f3){return _0x1727f3?{'count':_0x53d2bf,'rows':_0x1727f3}:null;}})[_0x7419('0x29')](respondWithResult(_0x494c58,null))['catch'](handleError(_0x494c58,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b7658ab..6c8ace6 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 _0x8786=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x48ac17,_0x1147b5){var _0x12c118=function(_0x1b9bdc){while(--_0x1b9bdc){_0x48ac17['push'](_0x48ac17['shift']());}};_0x12c118(++_0x1147b5);}(_0x8786,0x153));var _0x6878=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8786[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0x6878('0x0'));var ChatGroup=require(_0x6878('0x1'))['db'][_0x6878('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6878('0x3'),'afterUpdate':_0x6878('0x4'),'afterDestroy':_0x6878('0x5')};function emitEvent(_0x57ff21){return function(_0x347e06,_0x439475,_0x23647a){ChatGroupEvents[_0x6878('0x6')](_0x57ff21+':'+_0x347e06['id'],_0x347e06);ChatGroupEvents['emit'](_0x57ff21,_0x347e06);_0x23647a(null);};}for(var e in events){if(events[_0x6878('0x7')](e)){var event=events[e];ChatGroup[_0x6878('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xaecc,0x172));var _0xcaec=function(_0x2e0998,_0x2e4b2c){_0x2e0998=_0x2e0998-0x0;var _0x7ce4bc=_0xaecc[_0x2e0998];return _0x7ce4bc;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c6bf1c5..fdfa869 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 _0xf1d5=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0xf1d5,0x96));var _0x5f1d=function(_0x222240,_0x465d97){_0x222240=_0x222240-0x0;var _0xbe0206=_0xf1d5[_0x222240];return _0xbe0206;};'use strict';var _=require(_0x5f1d('0x0'));var util=require('util');var logger=require(_0x5f1d('0x1'))(_0x5f1d('0x2'));var moment=require('moment');var BPromise=require(_0x5f1d('0x3'));var rp=require(_0x5f1d('0x4'));var fs=require('fs');var path=require(_0x5f1d('0x5'));var rimraf=require('rimraf');var config=require(_0x5f1d('0x6'));var attributes=require('./chatGroup.attributes');module[_0x5f1d('0x7')]=function(_0x7f1525,_0x29b2f7){return _0x7f1525[_0x5f1d('0x8')](_0x5f1d('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfd7=['moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','util','api'];(function(_0x507056,_0xe16b72){var _0x4eaecc=function(_0x440b91){while(--_0x440b91){_0x507056['push'](_0x507056['shift']());}};_0x4eaecc(++_0xe16b72);}(_0xcfd7,0x1ac));var _0x7cfd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7cfd('0x0'));var logger=require('../../config/logger')(_0x7cfd('0x1'));var moment=require(_0x7cfd('0x2'));var BPromise=require('bluebird');var rp=require(_0x7cfd('0x3'));var fs=require('fs');var path=require(_0x7cfd('0x4'));var rimraf=require(_0x7cfd('0x5'));var config=require(_0x7cfd('0x6'));var attributes=require(_0x7cfd('0x7'));module[_0x7cfd('0x8')]=function(_0x25c86d,_0x5dd5a8){return _0x25c86d[_0x7cfd('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','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 e4673d8..d176814 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 _0x3148=['ChatGroup,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x6845ef,_0x3c578b){var _0x57bd16=function(_0x5c5591){while(--_0x5c5591){_0x6845ef['push'](_0x6845ef['shift']());}};_0x57bd16(++_0x3c578b);}(_0x3148,0x1d3));var _0x8314=function(_0x29f82c,_0x5a6380){_0x29f82c=_0x29f82c-0x0;var _0x58a330=_0x3148[_0x29f82c];return _0x58a330;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require('moment');var BPromise=require(_0x8314('0x2'));var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require(_0x8314('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require(_0x8314('0x9'));var client=jayson[_0x8314('0xa')][_0x8314('0xb')]({'port':0x232a});config[_0x8314('0xc')]=_['defaults'](config[_0x8314('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8314('0xd'))(new Redis(config[_0x8314('0xc')]));require(_0x8314('0xe'))[_0x8314('0xf')](socket);function respondWithRpcPromise(_0x118966,_0x5284ac,_0x5b5459){return new BPromise(function(_0xfaf56c,_0x34b949){return client[_0x8314('0x10')](_0x118966,_0x5b5459)[_0x8314('0x11')](function(_0x5cf1cf){logger[_0x8314('0x12')](_0x8314('0x13'),_0x5284ac,'request\x20sent');logger[_0x8314('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5284ac,'request\x20sent',JSON[_0x8314('0x15')](_0x5cf1cf));if(_0x5cf1cf[_0x8314('0x16')]){if(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x17')]===0x1f4){logger['error'](_0x8314('0x13'),_0x5284ac,_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);return _0x34b949(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x5cf1cf['error'][_0x8314('0x18')]);return _0xfaf56c(_0x5cf1cf[_0x8314('0x16')][_0x8314('0x18')]);}else{logger['info'](_0x8314('0x13'),_0x5284ac,_0x8314('0x19'));_0xfaf56c(_0x5cf1cf['result'][_0x8314('0x18')]);}})[_0x8314('0x1a')](function(_0x4ac7c8){logger[_0x8314('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5284ac,_0x4ac7c8);_0x34b949(_0x4ac7c8);});});} \ No newline at end of file +var _0x6a93=['client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5822dc,_0x400557){var _0x2df565=function(_0x5e5471){while(--_0x5e5471){_0x5822dc['push'](_0x5822dc['shift']());}};_0x2df565(++_0x400557);}(_0x6a93,0x1d7));var _0x36a9=function(_0x3247cc,_0x513e80){_0x3247cc=_0x3247cc-0x0;var _0x479941=_0x6a93[_0x3247cc];return _0x479941;};'use strict';var _=require(_0x36a9('0x0'));var util=require(_0x36a9('0x1'));var moment=require(_0x36a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36a9('0x3'));var db=require(_0x36a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x36a9('0x5'))(_0x36a9('0x6'));var config=require(_0x36a9('0x7'));var jayson=require(_0x36a9('0x8'));var client=jayson[_0x36a9('0x9')][_0x36a9('0xa')]({'port':0x232a});config[_0x36a9('0xb')]=_[_0x36a9('0xc')](config[_0x36a9('0xb')],{'host':_0x36a9('0xd'),'port':0x18eb});var socket=require(_0x36a9('0xe'))(new Redis(config['redis']));require(_0x36a9('0xf'))[_0x36a9('0x10')](socket);function respondWithRpcPromise(_0x4abb01,_0x4aaf2f,_0x283a00){return new BPromise(function(_0x116533,_0x1a6db3){return client[_0x36a9('0x11')](_0x4abb01,_0x283a00)[_0x36a9('0x12')](function(_0x220b13){logger[_0x36a9('0x13')](_0x36a9('0x14'),_0x4aaf2f,_0x36a9('0x15'));logger[_0x36a9('0x16')](_0x36a9('0x17'),_0x4aaf2f,_0x36a9('0x15'),JSON[_0x36a9('0x18')](_0x220b13));if(_0x220b13[_0x36a9('0x19')]){if(_0x220b13[_0x36a9('0x19')][_0x36a9('0x1a')]===0x1f4){logger[_0x36a9('0x19')](_0x36a9('0x14'),_0x4aaf2f,_0x220b13[_0x36a9('0x19')]['message']);return _0x1a6db3(_0x220b13[_0x36a9('0x19')]['message']);}logger['error'](_0x36a9('0x14'),_0x4aaf2f,_0x220b13[_0x36a9('0x19')][_0x36a9('0x1b')]);return _0x116533(_0x220b13['error'][_0x36a9('0x1b')]);}else{logger[_0x36a9('0x13')](_0x36a9('0x14'),_0x4aaf2f,_0x36a9('0x15'));_0x116533(_0x220b13[_0x36a9('0x1c')][_0x36a9('0x1b')]);}})[_0x36a9('0x1d')](function(_0x307b15){logger[_0x36a9('0x19')]('ChatGroup,\x20%s,\x20%s',_0x4aaf2f,_0x307b15);_0x1a6db3(_0x307b15);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 99a1a0c..ae36c1d 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 _0x8e53=['length','chatGroup:','./chatGroup.events','update','register'];(function(_0x5f0c5f,_0x1a58ae){var _0x2112e3=function(_0x419017){while(--_0x419017){_0x5f0c5f['push'](_0x5f0c5f['shift']());}};_0x2112e3(++_0x1a58ae);}(_0x8e53,0x1d8));var _0x38e5=function(_0x8522bf,_0x5d0930){_0x8522bf=_0x8522bf-0x0;var _0x32a616=_0x8e53[_0x8522bf];return _0x32a616;};'use strict';var ChatGroupEvents=require(_0x38e5('0x0'));var events=['save','remove',_0x38e5('0x1')];function createListener(_0x20654c,_0x304fed){return function(_0x41c1de){_0x304fed['emit'](_0x20654c,_0x41c1de);};}function removeListener(_0x29c26e,_0x2f0de0){return function(){ChatGroupEvents['removeListener'](_0x29c26e,_0x2f0de0);};}exports[_0x38e5('0x2')]=function(_0x5c692f){for(var _0x132b26=0x0,_0x206e96=events[_0x38e5('0x3')];_0x132b26<_0x206e96;_0x132b26++){var _0xd7b1c5=events[_0x132b26];var _0x4bd88a=createListener(_0x38e5('0x4')+_0xd7b1c5,_0x5c692f);ChatGroupEvents['on'](_0xd7b1c5,_0x4bd88a);}}; \ No newline at end of file +var _0x7980=['save','remove','update','emit','register','length','chatGroup:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7980,0xd9));var _0x0798=function(_0x32bd26,_0x58dba1){_0x32bd26=_0x32bd26-0x0;var _0x196100=_0x7980[_0x32bd26];return _0x196100;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x0798('0x0'),_0x0798('0x1'),_0x0798('0x2')];function createListener(_0x2f78ae,_0x594115){return function(_0x402a45){_0x594115[_0x0798('0x3')](_0x2f78ae,_0x402a45);};}function removeListener(_0x16d6d8,_0x1fb351){return function(){ChatGroupEvents['removeListener'](_0x16d6d8,_0x1fb351);};}exports[_0x0798('0x4')]=function(_0x5013b4){for(var _0x4bb55e=0x0,_0x399858=events[_0x0798('0x5')];_0x4bb55e<_0x399858;_0x4bb55e++){var _0x2df5c9=events[_0x4bb55e];var _0x54ac85=createListener(_0x0798('0x6')+_0x2df5c9,_0x5013b4);ChatGroupEvents['on'](_0x2df5c9,_0x54ac85);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4da985b..b7280c8 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 _0x90cc=['../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','get','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x36b9ba,_0x1a935a){var _0x5ad6d3=function(_0x1b44ca){while(--_0x1b44ca){_0x36b9ba['push'](_0x36b9ba['shift']());}};_0x5ad6d3(++_0x1a935a);}(_0x90cc,0xd1));var _0xc90c=function(_0x169c54,_0x5d3841){_0x169c54=_0x169c54-0x0;var _0x928a9b=_0x90cc[_0x169c54];return _0x928a9b;};'use strict';var multer=require('multer');var util=require(_0xc90c('0x0'));var path=require(_0xc90c('0x1'));var timeout=require(_0xc90c('0x2'));var express=require(_0xc90c('0x3'));var router=express[_0xc90c('0x4')]();var fs_extra=require(_0xc90c('0x5'));var auth=require(_0xc90c('0x6'));var interaction=require(_0xc90c('0x7'));var config=require(_0xc90c('0x8'));var controller=require(_0xc90c('0x9'));router['get']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0xb')]);router['get'](_0xc90c('0xc'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xd')]);router['get'](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0xf')]);router['get'](_0xc90c('0x10'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x11')]);router[_0xc90c('0x12')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x14')]);router[_0xc90c('0x12')](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x16')]);router['post']('/',auth[_0xc90c('0xa')](),controller[_0xc90c('0x17')]);router[_0xc90c('0x18')](_0xc90c('0x13'),auth[_0xc90c('0xa')](),controller['addMembers']);router['post'](_0xc90c('0x15'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x19')]);router[_0xc90c('0x1a')](_0xc90c('0xe'),auth[_0xc90c('0xa')](),controller[_0xc90c('0x1b')]);router[_0xc90c('0x1c')]('/:id',auth[_0xc90c('0xa')](),controller['destroy']);router[_0xc90c('0x1c')](_0xc90c('0x13'),auth['isAuthenticated'](),controller[_0xc90c('0x1d')]);module[_0xc90c('0x1e')]=router; \ No newline at end of file +var _0xa42f=['getUnread','getMessages','post','create','/:id/members','addMessage','put','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xa42f,0x1e6));var _0xfa42=function(_0x3d44c0,_0x24bcc6){_0x3d44c0=_0x3d44c0-0x0;var _0x3441d0=_0xa42f[_0x3d44c0];return _0x3441d0;};'use strict';var multer=require(_0xfa42('0x0'));var util=require(_0xfa42('0x1'));var path=require(_0xfa42('0x2'));var timeout=require(_0xfa42('0x3'));var express=require(_0xfa42('0x4'));var router=express[_0xfa42('0x5')]();var fs_extra=require(_0xfa42('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfa42('0x7'));var config=require(_0xfa42('0x8'));var controller=require(_0xfa42('0x9'));router['get']('/',auth[_0xfa42('0xa')](),controller[_0xfa42('0xb')]);router[_0xfa42('0xc')](_0xfa42('0xd'),auth[_0xfa42('0xa')](),controller[_0xfa42('0xe')]);router[_0xfa42('0xc')](_0xfa42('0xf'),auth['isAuthenticated'](),controller[_0xfa42('0x10')]);router['get'](_0xfa42('0x11'),auth[_0xfa42('0xa')](),controller[_0xfa42('0x12')]);router[_0xfa42('0xc')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xfa42('0x13')]);router[_0xfa42('0x14')]('/',auth['isAuthenticated'](),controller[_0xfa42('0x15')]);router[_0xfa42('0x14')](_0xfa42('0x16'),auth[_0xfa42('0xa')](),controller['addMembers']);router['post']('/:id/messages',auth[_0xfa42('0xa')](),controller[_0xfa42('0x17')]);router[_0xfa42('0x18')](_0xfa42('0xf'),auth[_0xfa42('0xa')](),controller['update']);router[_0xfa42('0x19')](_0xfa42('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0xfa42('0x19')](_0xfa42('0x16'),auth[_0xfa42('0xa')](),controller[_0xfa42('0x1a')]);module[_0xfa42('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 d35c8c1..f85d0fb 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 _0x1cdf=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','out'];(function(_0x4e9d27,_0x8f7f92){var _0x2b1a38=function(_0xae029d){while(--_0xae029d){_0x4e9d27['push'](_0x4e9d27['shift']());}};_0x2b1a38(++_0x8f7f92);}(_0x1cdf,0xf3));var _0xf1cd=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0x1cdf[_0x46939d];return _0x5105e8;};'use strict';var Sequelize=require('sequelize');module[_0xf1cd('0x0')]={'closed':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf1cd('0x2')]},'ratingType':{'type':Sequelize[_0xf1cd('0x3')](_0xf1cd('0x4'),_0xf1cd('0x5')),'defaultValue':_0xf1cd('0x4')},'ratingMessage':{'type':Sequelize[_0xf1cd('0x6')]},'pathTranscript':{'type':Sequelize[_0xf1cd('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf1cd('0x7')]},'secondDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'thirdDisposition':{'type':Sequelize[_0xf1cd('0x7')]},'note':{'type':Sequelize[_0xf1cd('0x7')]},'browserName':{'type':Sequelize[_0xf1cd('0x7')]},'browserVersion':{'type':Sequelize[_0xf1cd('0x7')]},'osName':{'type':Sequelize[_0xf1cd('0x7')]},'osVersion':{'type':Sequelize[_0xf1cd('0x7')]},'deviceModel':{'type':Sequelize[_0xf1cd('0x7')]},'deviceVendor':{'type':Sequelize[_0xf1cd('0x7')]},'deviceType':{'type':Sequelize[_0xf1cd('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf1cd('0x7')]},'formData':{'type':Sequelize[_0xf1cd('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf1cd('0x3')]('in',_0xf1cd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf1cd('0x7')]},'customerPort':{'type':Sequelize[_0xf1cd('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xf1cd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf1cd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc072=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out','BOOLEAN'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xc072,0x96));var _0x2c07=function(_0x130fe4,_0x140f0c){_0x130fe4=_0x130fe4-0x0;var _0x19880f=_0xc072[_0x130fe4];return _0x19880f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2c07('0x0')]},'ratingType':{'type':Sequelize[_0x2c07('0x1')](_0x2c07('0x2'),_0x2c07('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2c07('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2c07('0x5')]},'disposition':{'type':Sequelize[_0x2c07('0x6')]},'secondDisposition':{'type':Sequelize[_0x2c07('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2c07('0x6')]},'osName':{'type':Sequelize[_0x2c07('0x6')]},'osVersion':{'type':Sequelize[_0x2c07('0x6')]},'deviceModel':{'type':Sequelize[_0x2c07('0x6')]},'deviceVendor':{'type':Sequelize[_0x2c07('0x6')]},'deviceType':{'type':Sequelize[_0x2c07('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x2c07('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x2c07('0x7'))},'read1stAt':{'type':Sequelize[_0x2c07('0x5')]},'lastMsgAt':{'type':Sequelize[_0x2c07('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2c07('0x1')]('in',_0x2c07('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2c07('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x2c07('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2c07('0x9')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2c07('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index fe6b6bc..bbad031 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 _0x5a45=['join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','nolimit','includeAgent','push','alias','rows','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','rimraf','bluebird','mustache','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','end','stack','name','send','render','merge','body','contact','agent','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','find','params','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','user','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a45,0x128));var _0x55a4=function(_0x58e8ff,_0x45af96){_0x58e8ff=_0x58e8ff-0x0;var _0x348be2=_0x5a45[_0x58e8ff];return _0x348be2;};'use strict';var rimraf=require(_0x55a4('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x55a4('0x1'));var Mustache=require(_0x55a4('0x2'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x55a4('0x3'));var Redis=require(_0x55a4('0x4'));var interaction=require(_0x55a4('0x5'));var qs=require(_0x55a4('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x55a4('0x7'))(_0x55a4('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x55a4('0x9')]=_['defaults'](config[_0x55a4('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x55a4('0xa'))[_0x55a4('0xb')](socket);var jayson=require(_0x55a4('0xc'));var client=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232b});var client9004=jayson[_0x55a4('0xd')][_0x55a4('0xe')]({'port':0x232c});function respondWithRpcPromise(_0x5c3c05,_0xdd3d7d,_0xe311c1,_0x3c0a9e){return new BPromise(function(_0x562c24,_0x3248da){var _0x541ba0=_0x3c0a9e||client;return _0x541ba0[_0x55a4('0xf')](_0x5c3c05,_0xe311c1)[_0x55a4('0x10')](function(_0x5cca1b){logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));logger[_0x55a4('0x14')](_0x55a4('0x15'),_0xdd3d7d,'request\x20sent',JSON[_0x55a4('0x16')](_0x5cca1b));if(_0x5cca1b['error']){if(_0x5cca1b[_0x55a4('0x17')]['code']===0x1f4){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')]['message']);return _0x3248da(_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);}logger[_0x55a4('0x17')]('ChatInteraction,\x20%s,\x20%s',_0xdd3d7d,_0x5cca1b[_0x55a4('0x17')][_0x55a4('0x18')]);return _0x562c24(_0x5cca1b[_0x55a4('0x17')]['message']);}else{logger[_0x55a4('0x11')](_0x55a4('0x12'),_0xdd3d7d,_0x55a4('0x13'));_0x562c24(_0x5cca1b[_0x55a4('0x19')][_0x55a4('0x18')]);}})[_0x55a4('0x1a')](function(_0x4bd3ab){logger[_0x55a4('0x17')](_0x55a4('0x12'),_0xdd3d7d,_0x4bd3ab);_0x3248da(_0x4bd3ab);});});}function respondWithStatusCode(_0x32760e,_0x5ab941){_0x5ab941=_0x5ab941||0xcc;return function(_0x85b2db){if(_0x85b2db){return _0x32760e[_0x55a4('0x1b')](_0x5ab941);}return _0x32760e[_0x55a4('0x1c')](_0x5ab941)['end']();};}function respondWithResult(_0x58ea4c,_0x40527e){_0x40527e=_0x40527e||0xc8;return function(_0x27b8ba){if(_0x27b8ba){return _0x58ea4c[_0x55a4('0x1c')](_0x40527e)[_0x55a4('0x1d')](_0x27b8ba);}};}function respondWithFilteredResult(_0x2eaba6,_0x991d7e){return function(_0x2b4c1c){if(_0x2b4c1c){var _0x47a26f=typeof _0x991d7e['offset']===_0x55a4('0x1e')&&typeof _0x991d7e[_0x55a4('0x1f')]===_0x55a4('0x1e');var _0x5cb513=_0x2b4c1c[_0x55a4('0x20')];var _0x1b0aa9=_0x47a26f?0x0:_0x991d7e[_0x55a4('0x21')];var _0x1c1f2f=_0x47a26f?_0x2b4c1c['count']:_0x991d7e[_0x55a4('0x21')]+_0x991d7e[_0x55a4('0x1f')];var _0x8f5fde;if(_0x1c1f2f>=_0x5cb513){_0x1c1f2f=_0x5cb513;_0x8f5fde=0xc8;}else{_0x8f5fde=0xce;}_0x2eaba6[_0x55a4('0x1c')](_0x8f5fde);return _0x2eaba6[_0x55a4('0x22')](_0x55a4('0x23'),_0x1b0aa9+'-'+_0x1c1f2f+'/'+_0x5cb513)[_0x55a4('0x1d')](_0x2b4c1c);}return null;};}function saveUpdates(_0x1e846a){return function(_0x1a59de){if(_0x1a59de){return _0x1a59de[_0x55a4('0x24')](_0x1e846a)[_0x55a4('0x10')](function(_0x7f299b){return _0x7f299b;});}return null;};}function removeEntity(_0x2d2d13){return function(_0x5aac7a){if(_0x5aac7a){return _0x5aac7a['destroy']()['then'](function(){_0x2d2d13[_0x55a4('0x1c')](0xcc)[_0x55a4('0x25')]();});}};}function handleEntityNotFound(_0x252e81){return function(_0x214f61){if(!_0x214f61){_0x252e81[_0x55a4('0x1b')](0x194);}return _0x214f61;};}function handleError(_0x46d4aa,_0x3bc04e){_0x3bc04e=_0x3bc04e||0x1f4;return function(_0x24f4a0){logger[_0x55a4('0x17')](_0x24f4a0[_0x55a4('0x26')]);if(_0x24f4a0[_0x55a4('0x27')]){delete _0x24f4a0[_0x55a4('0x27')];}_0x46d4aa[_0x55a4('0x1c')](_0x3bc04e)[_0x55a4('0x28')](_0x24f4a0);};}function getMustacheRender(_0x260612,_0x227695){return Mustache[_0x55a4('0x29')](_0x260612,_[_0x55a4('0x2a')](_0x227695[_0x55a4('0x2b')],{'contact':_0x227695[_0x55a4('0x2c')],'message':_0x227695[_0x55a4('0x18')],'agent':_0x227695[_0x55a4('0x2d')],'interaction':_0x227695['interaction'],'account':_0x227695['account']}))||'';}exports['index']=function(_0x173ddc,_0x396367){var _0x555807={};var _0x4fa371=_[_0x55a4('0x2e')](db[_0x55a4('0x2f')][_0x55a4('0x30')],function(_0x224527){return{'name':_0x224527[_0x55a4('0x31')],'type':_0x224527[_0x55a4('0x32')][_0x55a4('0x33')]};});_0x555807=qs['getOptions'](_0x4fa371,_0x173ddc);return interaction[_0x55a4('0x34')]('chat',_0x173ddc['query'],_0x173ddc['user'],_0x555807,_0x4fa371)['then'](respondWithFilteredResult(_0x396367,_0x555807))[_0x55a4('0x1a')](handleError(_0x396367,null));};exports[_0x55a4('0x35')]=function(_0x1e9b2f,_0x52be91){var _0xe5b93={'raw':![],'where':{'id':_0x1e9b2f['params']['id']}},_0x331a42={};_0x331a42['model']=_[_0x55a4('0x36')](db[_0x55a4('0x2f')][_0x55a4('0x30')]);_0x331a42[_0x55a4('0x37')]=_[_0x55a4('0x36')](_0x1e9b2f[_0x55a4('0x37')]);_0x331a42[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x331a42[_0x55a4('0x3a')],_0x331a42[_0x55a4('0x37')]);_0xe5b93[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x331a42['model'],qs[_0x55a4('0x3c')](_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3c')]));_0xe5b93[_0x55a4('0x3b')]=_0xe5b93[_0x55a4('0x3b')][_0x55a4('0x3d')]?_0xe5b93[_0x55a4('0x3b')]:_0x331a42['model'];if(_0x1e9b2f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0xe5b93[_0x55a4('0x3f')]=[{'all':!![]}];}_0xe5b93=_[_0x55a4('0x2a')]({},_0xe5b93,_0x1e9b2f[_0x55a4('0x40')]);return db['ChatInteraction']['find'](_0xe5b93)[_0x55a4('0x10')](handleEntityNotFound(_0x52be91,null))['then'](respondWithResult(_0x52be91,null))[_0x55a4('0x1a')](handleError(_0x52be91,null));};exports[_0x55a4('0x41')]=function(_0x48e915,_0x23c358){return db[_0x55a4('0x2f')]['create'](_0x48e915[_0x55a4('0x2b')],{})[_0x55a4('0x10')](respondWithResult(_0x23c358,0xc9))[_0x55a4('0x1a')](handleError(_0x23c358,null));};exports[_0x55a4('0x24')]=function(_0x2d5eb7,_0x5c2410){if(_0x2d5eb7[_0x55a4('0x2b')]['id']){delete _0x2d5eb7[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2d5eb7[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5c2410,null))[_0x55a4('0x10')](saveUpdates(_0x2d5eb7['body'],null))['then'](respondWithResult(_0x5c2410,null))['catch'](handleError(_0x5c2410,null));};exports['destroy']=function(_0x2c33e3,_0x30bbdc){return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2c33e3[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x30bbdc,null))[_0x55a4('0x10')](removeEntity(_0x30bbdc,null))['catch'](handleError(_0x30bbdc,null));};exports['describe']=function(_0x2457ee,_0x1754ba){return db[_0x55a4('0x2f')]['describe']()[_0x55a4('0x10')](respondWithResult(_0x1754ba,null))['catch'](handleError(_0x1754ba,null));};exports[_0x55a4('0x44')]=function(_0x57a4c9,_0x14e6bf){var _0x55d6f9=_0x57a4c9['params']['id'];var _0x330603;var _0x476347;var _0xff2c74;return db[_0x55a4('0x2f')]['findOne']({'where':{'id':_0x55d6f9}})['then'](function(_0x1110de){_0x330603=_0x1110de;return db[_0x55a4('0x45')][_0x55a4('0x46')]({'where':{'id':_0x1110de[_0x55a4('0x47')]},'attributes':['id',_0x55a4('0x48'),_0x55a4('0x49'),_0x55a4('0x4a'),'vidaooNote',_0x55a4('0x4b')],'raw':!![]});})[_0x55a4('0x10')](function(_0x3ca227){if(_0x3ca227&&_0x3ca227['vidaooApiKey']&&_0x3ca227[_0x55a4('0x49')]){_0x476347=_0x3ca227;var _0x461ff8={'interaction':{'id':_0x55d6f9},'agent':{'id':_0x57a4c9['user']['id'],'name':_0x57a4c9['user'][_0x55a4('0x27')],'fullname':_0x57a4c9['user'][_0x55a4('0x4c')],'email':_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]},'contact':_0x57a4c9[_0x55a4('0x2b')][_0x55a4('0x2c')],'account':_0x57a4c9[_0x55a4('0x2b')]['account']};var _0xafaebc={'rejectUnauthorized':![],'method':'POST','url':_0x55a4('0x4f'),'headers':{'X-APIKEY':_0x3ca227[_0x55a4('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57a4c9[_0x55a4('0x4d')][_0x55a4('0x4e')]],'buttons':null,'topic':_0x476347[_0x55a4('0x4a')],'note':_[_0x55a4('0x50')](_0x476347['vidaooNote'])?null:getMustacheRender(_0x476347[_0x55a4('0x51')],_0x461ff8),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x55a4('0x50')](_0x476347[_0x55a4('0x4b')])){var _0x34fc6d=getMustacheRender(_0x476347[_0x55a4('0x4b')],_0x461ff8);var _0x1f2997=JSON[_0x55a4('0x52')](_0x34fc6d);_0xafaebc[_0x55a4('0x2b')][_0x55a4('0x53')]=_0x1f2997;}}catch(_0x4c8e07){throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x56'));}return rp(_0xafaebc);}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x57'));}})[_0x55a4('0x10')](function(_0x4540c6){_0xff2c74=_0x4540c6;if(_0xff2c74['id']){var _0x2b8b7f={'body':_0xff2c74['join_url'],'ChatWebsiteId':_0x476347['id'],'ChatInteractionId':_0x330603['id'],'direction':_0x55a4('0x58'),'UserId':_0x57a4c9[_0x55a4('0x4d')]['id']};return db[_0x55a4('0x59')][_0x55a4('0x41')](_0x2b8b7f,{});}else{throw new db[(_0x55a4('0x54'))][(_0x55a4('0x55'))](_0x55a4('0x5a'));}})['then'](function(){return _0x330603[_0x55a4('0x5b')]({'vidaooSessionId':_0xff2c74['id']});})['then'](respondWithResult(_0x14e6bf,null))[_0x55a4('0x1a')](handleError(_0x14e6bf,null));};exports[_0x55a4('0x5c')]=function(_0xb38acb,_0x4f3c60){if(_0xb38acb[_0x55a4('0x2b')]['id']){delete _0xb38acb['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0xb38acb[_0x55a4('0x43')]['id']},'include':[{'model':db['CmContact'],'as':_0x55a4('0x5d')}]})[_0x55a4('0x10')](handleEntityNotFound(_0x4f3c60,null))[_0x55a4('0x10')](saveUpdates(_0xb38acb['body'],null))['then'](respondWithResult(_0x4f3c60,null))['catch'](handleError(_0x4f3c60,null));};exports[_0x55a4('0x5e')]=function(_0x144d80,_0x499a73){if(_0x144d80['body']['id']){delete _0x144d80[_0x55a4('0x2b')]['id'];}return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x144d80['params']['id']}})[_0x55a4('0x10')](function(_0x4cd6ea){if(!_0x4cd6ea){logger[_0x55a4('0x17')](_0x55a4('0x5f'),_0x55a4('0x5e'),0x194,_0x55a4('0x60'));_0x499a73['sendStatus'](0x194);}else{if(_0x4cd6ea[_0x55a4('0x61')]){throw new db['Sequelize']['ValidationError'](_0x55a4('0x62'));}}return _0x4cd6ea;})[_0x55a4('0x10')](function(_0x57dc54){if(_0x57dc54){return _0x57dc54[_0x55a4('0x24')]({'closed':_0x144d80[_0x55a4('0x2b')]['closed'],'disposition':_0x144d80[_0x55a4('0x2b')]['disposition']})[_0x55a4('0x10')](function(_0x4a8d55){return _0x4a8d55;});}})[_0x55a4('0x10')](function(){return respondWithRpcPromise(_0x55a4('0x63'),_0x55a4('0x5e'),_0x144d80['body'],client9004);})['then'](respondWithResult(_0x499a73,null))[_0x55a4('0x1a')](handleError(_0x499a73,null));};exports[_0x55a4('0x64')]=function(_0x22484c,_0x811f6d){_0x22484c[_0x55a4('0x2b')]['name']=_0x22484c['file'][_0x55a4('0x65')];_0x22484c[_0x55a4('0x2b')][_0x55a4('0x66')]=_0x22484c[_0x55a4('0x67')][_0x55a4('0x68')];_0x22484c[_0x55a4('0x2b')]['type']=_0x22484c[_0x55a4('0x67')]['mimetype'];return db[_0x55a4('0x69')][_0x55a4('0x41')](_0x22484c[_0x55a4('0x2b')])[_0x55a4('0x10')](respondWithResult(_0x811f6d,0xc9))[_0x55a4('0x1a')](handleError(_0x811f6d,null));};exports[_0x55a4('0x6a')]=function(_0x203d6e,_0x41dbe7){return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x203d6e['params']['id']},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null))[_0x55a4('0x10')](function(_0x1fdca8){if(_0x1fdca8){if(_0x1fdca8[_0x55a4('0x6b')]){return _0x41dbe7[_0x55a4('0x1c')](0x193)[_0x55a4('0x1d')]({'status':0x193,'message':_0x55a4('0x6c')});}return db[_0x55a4('0x69')][_0x55a4('0x46')]({'where':{'id':_0x203d6e[_0x55a4('0x37')][_0x55a4('0x6d')]},'raw':!![]})[_0x55a4('0x10')](handleEntityNotFound(_0x41dbe7,null));}})['then'](function(_0x540318){if(_0x540318){var _0x17387f=_0x540318['ChatOfflineMessageId']!==null;var _0x2d56f9=path[_0x55a4('0x6e')](config['root'],_0x55a4('0x6f'));if(_0x17387f){_0x2d56f9=path[_0x55a4('0x6e')](_0x2d56f9,_0x55a4('0x70'));}var _0x1b7d98=path['join'](_0x2d56f9,_0x540318['basename']);return _0x41dbe7[_0x55a4('0x71')](_0x1b7d98);}})[_0x55a4('0x1a')](handleError(_0x41dbe7,null));};exports[_0x55a4('0x72')]=function(_0x2b237f,_0x13e270){var _0x5bcdc7=null;var _0x4227f2=null;var _0x328dd9=null;if(_0x2b237f['body']['id']){delete _0x2b237f['body']['id'];}if(_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x73')]){_0x328dd9=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],_0x55a4('0x75'),util[_0x55a4('0x76')]('transcript-%s.txt',Date[_0x55a4('0x77')]()));_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x78')]=_0x328dd9;}return db[_0x55a4('0x2f')][_0x55a4('0x42')]({'where':{'id':_0x2b237f[_0x55a4('0x43')]['id']},'include':[{'model':db[_0x55a4('0x59')],'as':_0x55a4('0x79'),'include':[{'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a')}]}]})[_0x55a4('0x10')](handleEntityNotFound(_0x13e270,null))['then'](saveUpdates(_0x2b237f['body'],null))['then'](function(_0x716346){if(_0x716346){_0x5bcdc7=_0x716346;return db[_0x55a4('0x45')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7['ChatWebsiteId']}});}})[_0x55a4('0x10')](function(_0x1aafc5){if(_0x1aafc5){_0x4227f2=_0x1aafc5;return db[_0x55a4('0x7b')][_0x55a4('0x42')]({'where':{'id':_0x5bcdc7[_0x55a4('0x7c')]}});}})[_0x55a4('0x10')](function(_0x50ad77){if(_0x50ad77){if(_0x328dd9){var _0x5eef13=null;for(var _0x3d62b6=0x1;_0x3d62b6<_0x5bcdc7[_0x55a4('0x79')][_0x55a4('0x3d')];++_0x3d62b6){_0x5eef13=_0x5bcdc7[_0x55a4('0x79')][_0x3d62b6];var _0x282fd3=_0x5eef13['UserId']?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):_0x55a4('0x7e');var _0x3eefe5=_0x2b237f[_0x55a4('0x2b')][_0x55a4('0x7f')]||util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x55a4('0x80'),_0x5eef13[_0x55a4('0x7c')]);switch(_0x4227f2[_0x55a4('0x81')]){case _0x55a4('0x82'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2[_0x55a4('0x83')],_0x5eef13[_0x55a4('0x61')]):_0x55a4('0x7e');break;case _0x55a4('0x84'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')]['alias']||_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e');break;case _0x55a4('0x85'):_0x282fd3=_0x5eef13[_0x55a4('0x61')]?_0x5eef13[_0x55a4('0x7a')][_0x55a4('0x4c')]:'System';break;default:_0x282fd3=_0x5eef13[_0x55a4('0x61')]?util[_0x55a4('0x76')](_0x55a4('0x7d'),_0x4227f2['agentAlias'],_0x5eef13['UserId']):'System';}var _0x4f36b7=util[_0x55a4('0x76')](_0x55a4('0x86'),moment(_0x5eef13['createdAt'])[_0x55a4('0x76')](_0x55a4('0x87')),_0x5eef13[_0x55a4('0x88')]==='in'?_0x3eefe5:_0x282fd3,_0x5eef13[_0x55a4('0x2b')]);if(!_0x5eef13[_0x55a4('0x89')]){fs['appendFileSync'](_0x328dd9,_0x4f36b7);}}return db['MailAccount'][_0x55a4('0x46')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x55a4('0x8a'),'raw':!![],'include':[{'model':db[_0x55a4('0x8b')],'as':_0x55a4('0x8b'),'raw':!![]}]}]});}}})[_0x55a4('0x10')](function(_0x132a41){if(!_0x132a41||!_0x132a41['Smtp']||!_0x2b237f[_0x55a4('0x2b')])return _0x5bcdc7;var _0x5d8da3=_0x132a41[_0x55a4('0x8c')]();return respondWithRpcPromise(_0x55a4('0x8d'),_0x55a4('0x8e'),{'account':_0x5d8da3,'message':{'from':util[_0x55a4('0x76')](_0x55a4('0x8f'),_0x132a41[_0x55a4('0x27')],_0x132a41[_0x55a4('0x4e')]||_0x132a41[_0x55a4('0x8a')][_0x55a4('0x4d')]),'to':_0x2b237f[_0x55a4('0x2b')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x55a4('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2b237f[_0x55a4('0x2b')]['mailTranscript']),'attachments':[{'path':_0x328dd9}]}})[_0x55a4('0x10')](function(){return _0x5bcdc7;})[_0x55a4('0x1a')](function(_0x1d78ed){logger[_0x55a4('0x17')](_0x1d78ed);});})['then'](respondWithStatusCode(_0x13e270,0xc8))[_0x55a4('0x1a')](handleError(_0x13e270,null));};exports[_0x55a4('0x90')]=function(_0x57b88b,_0x3172b2){return db[_0x55a4('0x59')][_0x55a4('0x42')]({'where':{'id':_0x57b88b['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x3172b2,null))['then'](function(_0x580db2){if(_0x580db2){return _0x580db2[_0x55a4('0x90')](_0x57b88b[_0x55a4('0x2b')]['ids'],_[_0x55a4('0x91')](_0x57b88b[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{});}})[_0x55a4('0x10')](respondWithResult(_0x3172b2,null))[_0x55a4('0x1a')](handleError(_0x3172b2,null));};exports[_0x55a4('0x93')]=function(_0x26877f,_0x33447c){var _0x4a72d3={'raw':![],'where':{}};var _0x585084={};var _0x49d237={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x26877f[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x33447c,null))[_0x55a4('0x10')](function(_0x41b7c8){if(_0x41b7c8){_0x585084[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db[_0x55a4('0x59')]['rawAttributes']);_0x585084[_0x55a4('0x37')]=_['keys'](_0x26877f[_0x55a4('0x37')]);_0x585084[_0x55a4('0x38')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],_0x585084[_0x55a4('0x37')]);_0x4a72d3[_0x55a4('0x3b')]=_[_0x55a4('0x39')](_0x585084[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x26877f[_0x55a4('0x37')]['fields']));_0x4a72d3[_0x55a4('0x3b')]=_0x4a72d3['attributes']['length']?_0x4a72d3[_0x55a4('0x3b')]:_0x585084['model'];if(!_0x26877f[_0x55a4('0x37')][_0x55a4('0x94')]('nolimit')){_0x4a72d3[_0x55a4('0x1f')]=qs[_0x55a4('0x1f')](_0x26877f[_0x55a4('0x37')]['limit']);_0x4a72d3[_0x55a4('0x21')]=qs['offset'](_0x26877f[_0x55a4('0x37')]['offset']);}_0x4a72d3[_0x55a4('0x95')]=qs[_0x55a4('0x96')](_0x26877f[_0x55a4('0x37')][_0x55a4('0x96')]);_0x4a72d3[_0x55a4('0x97')]=qs[_0x55a4('0x38')](_[_0x55a4('0x98')](_0x26877f[_0x55a4('0x37')],_0x585084[_0x55a4('0x38')]));_0x4a72d3[_0x55a4('0x97')][_0x55a4('0x99')]=_0x41b7c8['id'];if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x4a72d3[_0x55a4('0x3b')],function(_0x226d04){var _0x1c9ea5={};_0x1c9ea5[_0x226d04]={'$like':'%'+_0x26877f[_0x55a4('0x37')]['filter']+'%'};return _0x1c9ea5;})});}if(_0x26877f['query'][_0x55a4('0x9b')]){var _0x43b9de=_0x26877f[_0x55a4('0x37')][_0x55a4('0x9b')][_0x55a4('0x9c')](',');var _0x268997={};_0x268997[_0x43b9de[0x0]]={'$gte':moment(_0x43b9de[0x1])['format'](_0x55a4('0x9d'))};_0x4a72d3[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x4a72d3[_0x55a4('0x97')],_0x268997);}_0x4a72d3=_[_0x55a4('0x2a')]({},_0x4a72d3,_0x26877f['options']);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x4a72d3['where']})['then'](function(_0x2b2440){_0x49d237[_0x55a4('0x20')]=_0x2b2440;if(_0x26877f[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x4a72d3[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x4a72d3);})[_0x55a4('0x10')](function(_0x448cc2){_0x49d237['rows']=_0x448cc2;return _0x49d237;});}})[_0x55a4('0x10')](respondWithFilteredResult(_0x33447c,_0x4a72d3))[_0x55a4('0x1a')](handleError(_0x33447c,null));};exports[_0x55a4('0x9e')]=function(_0x2f727c,_0x5ab1bf){var _0x57ef7b={'where':{}},_0x4f7e71={},_0x341d47={'count':0x0,'rows':[]};return db[_0x55a4('0x2f')][_0x55a4('0x46')]({'where':{'id':_0x2f727c[_0x55a4('0x43')]['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x5ab1bf,null))[_0x55a4('0x10')](function(_0x79d8b7){if(_0x79d8b7){_0x4f7e71[_0x55a4('0x3a')]=_[_0x55a4('0x36')](db['ChatMessage']['rawAttributes']);_0x4f7e71[_0x55a4('0x37')]=_['keys'](_0x2f727c[_0x55a4('0x37')]);_0x4f7e71[_0x55a4('0x38')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],_0x4f7e71[_0x55a4('0x37')]);_0x57ef7b[_0x55a4('0x3b')]=_['intersection'](_0x4f7e71[_0x55a4('0x3a')],qs[_0x55a4('0x3c')](_0x2f727c[_0x55a4('0x37')]['fields']));_0x57ef7b[_0x55a4('0x3b')]=_0x57ef7b[_0x55a4('0x3b')]['length']?_0x57ef7b[_0x55a4('0x3b')]:_0x4f7e71[_0x55a4('0x3a')];if(!_0x2f727c[_0x55a4('0x37')]['hasOwnProperty'](_0x55a4('0x9f'))){_0x57ef7b['limit']=qs[_0x55a4('0x1f')](_0x2f727c['query']['limit']);_0x57ef7b[_0x55a4('0x21')]=qs[_0x55a4('0x21')](_0x2f727c['query'][_0x55a4('0x21')]);}_0x57ef7b[_0x55a4('0x95')]=qs['sort'](_0x2f727c[_0x55a4('0x37')][_0x55a4('0x96')]);_0x57ef7b['where']=qs['filters'](_[_0x55a4('0x98')](_0x2f727c['query'],_0x4f7e71[_0x55a4('0x38')]));_0x57ef7b[_0x55a4('0x97')][_0x55a4('0x99')]=_0x79d8b7['id'];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x9a')]){_0x57ef7b[_0x55a4('0x97')]=_[_0x55a4('0x2a')](_0x57ef7b[_0x55a4('0x97')],{'$or':_[_0x55a4('0x2e')](_0x57ef7b[_0x55a4('0x3b')],function(_0x50a9ae){var _0x3c818e={};_0x3c818e[_0x50a9ae]={'$like':'%'+_0x2f727c[_0x55a4('0x37')]['filter']+'%'};return _0x3c818e;})});}_0x57ef7b['where']['secret']=![];if(_0x2f727c['query']['id']){_0x57ef7b[_0x55a4('0x97')]['id']={'$gt':_0x2f727c[_0x55a4('0x37')]['id']};}_0x57ef7b=_[_0x55a4('0x2a')]({},_0x57ef7b,_0x2f727c[_0x55a4('0x40')]);return db['ChatMessage'][_0x55a4('0x20')]({'where':_0x57ef7b[_0x55a4('0x97')]})[_0x55a4('0x10')](function(_0x406598){_0x341d47[_0x55a4('0x20')]=_0x406598;_0x57ef7b['include']=[];if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0xa0')]){_0x57ef7b['include'][_0x55a4('0xa1')]({'model':db['User'],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c'),_0x55a4('0xa2')]});}if(_0x2f727c[_0x55a4('0x37')][_0x55a4('0x3e')]){_0x57ef7b[_0x55a4('0x3f')]=[{'all':!![]}];}return db[_0x55a4('0x59')][_0x55a4('0x34')](_0x57ef7b);})[_0x55a4('0x10')](function(_0x2d97cc){_0x341d47[_0x55a4('0xa3')]=_0x2d97cc;return _0x341d47;});}})['then'](respondWithFilteredResult(_0x5ab1bf,_0x57ef7b))['catch'](handleError(_0x5ab1bf,null));};exports[_0x55a4('0xa4')]=function(_0x134bf9,_0x37fc77){return db[_0x55a4('0x2f')]['find']({'where':{'id':_0x134bf9['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x37fc77,null))[_0x55a4('0x10')](function(_0x4a8c8a){if(_0x4a8c8a){return _0x4a8c8a[_0x55a4('0xa5')](_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')],_[_0x55a4('0x91')](_0x134bf9[_0x55a4('0x2b')],[_0x55a4('0x92'),'id'])||{})['spread'](function(){return db[_0x55a4('0xa6')][_0x55a4('0x34')]({'attributes':['id',_0x55a4('0x27'),_0x55a4('0xa7')],'where':{'id':_0x134bf9[_0x55a4('0x2b')][_0x55a4('0x92')]}});})[_0x55a4('0x10')](function(_0x49140a){socket[_0x55a4('0xa8')](_0x55a4('0xa9'),{'id':Number(_0x134bf9['params']['id']),'tags':_0x49140a||[]});return{'id':Number(_0x134bf9[_0x55a4('0x43')]['id']),'tags':_0x49140a||[]};});}})[_0x55a4('0x10')](respondWithResult(_0x37fc77,null))[_0x55a4('0x1a')](handleError(_0x37fc77,null));};exports[_0x55a4('0xaa')]=function(_0x4f9a77,_0x28d96a){return db['ChatInteraction'][_0x55a4('0x42')]({'where':{'id':_0x4f9a77['params']['id']}})[_0x55a4('0x10')](handleEntityNotFound(_0x28d96a,null))[_0x55a4('0x10')](function(_0x4477ab){if(_0x4477ab){return _0x4477ab['removeTags'](_0x4f9a77[_0x55a4('0x37')]['ids']);}})[_0x55a4('0x10')](respondWithStatusCode(_0x28d96a,null))[_0x55a4('0x1a')](handleError(_0x28d96a,null));};exports[_0x55a4('0x71')]=function(_0x24d3b2,_0x27c53f){var _0x3f0351=moment()[_0x55a4('0xab')]()[_0x55a4('0xac')]();var _0x262bcf=path[_0x55a4('0x6e')](config['root'],_0x55a4('0xad'),_0x55a4('0xae'),'tmp');var _0x466a78=path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xae'),_0x55a4('0xaf'));var _0x234213=path[_0x55a4('0x6e')](_0x262bcf,_0x3f0351);var _0x1b88b6=util[_0x55a4('0x76')](_0x55a4('0xb0'),_0x24d3b2[_0x55a4('0x43')]['id'],_0x3f0351);var _0x25538d=path['join'](_0x262bcf,_0x1b88b6);var _0x52adc1=[];_0x52adc1[_0x55a4('0xa1')]({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0x7a'),'attributes':['id',_0x55a4('0x4c')],'raw':!![]});_0x52adc1[_0x55a4('0xa1')]({'model':db['CmContact'],'as':_0x55a4('0x5d'),'attributes':['id',_0x55a4('0xb1'),_0x55a4('0xb2')],'raw':!![]});if(_0x24d3b2['query']['attachments']){_0x52adc1['push']({'model':db[_0x55a4('0x69')],'as':'Attachment','raw':!![]});}var _0x52c232=[{'model':db['ChatMessage'],'as':_0x55a4('0x79'),'attributes':['id',_0x55a4('0x2b'),_0x55a4('0xb3'),_0x55a4('0x88'),'secret','read'],'include':_0x52adc1}];_0x52c232[_0x55a4('0xa1')]({'model':db['ChatWebsite'],'as':_0x55a4('0xb4'),'attributes':['id',_0x55a4('0x27')]});_0x52c232['push']({'model':db[_0x55a4('0x7a')],'as':_0x55a4('0xb5'),'attributes':['id',_0x55a4('0x4c')]});return db['ChatInteraction']['find']({'where':{'id':_0x24d3b2[_0x55a4('0x43')]['id']},'include':_0x52c232})[_0x55a4('0x10')](handleEntityNotFound(_0x27c53f,null))[_0x55a4('0x10')](function(_0x3a1e6b){if(_0x3a1e6b){var _0x5e6fc4=_0x3a1e6b[_0x55a4('0xb6')]({'plain':!![]});fs[_0x55a4('0xb7')](_0x234213);var _0x27556d={'channel':'Chat','account':_0x5e6fc4[_0x55a4('0xb4')]['name'],'agent':_0x5e6fc4[_0x55a4('0xb5')]?_0x5e6fc4[_0x55a4('0xb5')]['fullname']:_0x55a4('0xb8'),'createdAt':moment(_0x5e6fc4[_0x55a4('0xb3')])[_0x55a4('0x76')](_0x55a4('0x9d'))[_0x55a4('0xac')](),'closedAt':_0x5e6fc4[_0x55a4('0x6b')]?moment(_0x5e6fc4[_0x55a4('0xb9')])[_0x55a4('0x76')](_0x55a4('0x9d'))['toString']():'','disposition':_0x5e6fc4[_0x55a4('0xba')],'chatInfo':{'browser':_0x5e6fc4['browserName'],'os':_0x5e6fc4[_0x55a4('0xbb')],'referer':_0x5e6fc4[_0x55a4('0xbc')],'customerIp':_0x5e6fc4[_0x55a4('0xbd')],'customerPort':_0x5e6fc4['customerPort']?_0x5e6fc4[_0x55a4('0xbe')]:_0x55a4('0xb8')},'messages':_(_0x5e6fc4['Messages'])[_0x55a4('0xbf')]()[_0x55a4('0x9a')]({'secret':![]})[_0x55a4('0x2e')](function(_0x251480){if(_0x251480['Attachment']){var _0x3184c7=path[_0x55a4('0x6e')](_0x466a78,_0x251480['Attachment']['basename']);if(fs[_0x55a4('0xc0')](_0x3184c7)){fs[_0x55a4('0xc1')](_0x3184c7)['pipe'](fs['createWriteStream'](path['join'](_0x234213,_0x251480[_0x55a4('0x69')][_0x55a4('0x66')])));}}return{'date':moment(_0x251480[_0x55a4('0xb3')])['format'](_0x55a4('0x9d'))[_0x55a4('0xac')](),'sender':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?_0x251480[_0x55a4('0x7a')]?_0x251480[_0x55a4('0x7a')][_0x55a4('0x4c')]:_0x55a4('0x7e'):_0x251480[_0x55a4('0x5d')][_0x55a4('0xb1')]+(_0x251480['Contact'][_0x55a4('0xb2')]?'\x20'+_0x251480[_0x55a4('0x5d')][_0x55a4('0xb2')]:''),'body':_0x251480[_0x55a4('0x69')]?_0x251480[_0x55a4('0x69')][_0x55a4('0x66')]:_0x251480[_0x55a4('0x2b')],'direction':_0x251480[_0x55a4('0x88')]===_0x55a4('0x58')?'A':'C','secret':_0x251480[_0x55a4('0x89')],'read':_0x251480[_0x55a4('0xc2')],'attachment':_0x251480[_0x55a4('0x69')]};})[_0x55a4('0xc3')]()};return ejs[_0x55a4('0xc4')](path[_0x55a4('0x6e')](config[_0x55a4('0x74')],'server',_0x55a4('0xc5'),_0x55a4('0xc6')),{'interaction':_0x27556d})['then'](function(_0x4d387a){var _0x134c72=path[_0x55a4('0x6e')](_0x234213,_0x55a4('0xc7')+_0x5e6fc4['id']+'-'+_0x3f0351+_0x55a4('0xc8'));var _0x240241={'path':_0x134c72,'channel':_0x55a4('0xc9'),'interactionId':_0x5e6fc4['id']};return pdf['createPdfFromHTML'](_0x4d387a,_0x240241);})[_0x55a4('0x10')](function(){return new Promise(function(_0x1733ac,_0x5501cf){zipdir(_0x234213,{'saveTo':_0x25538d},function(_0x9a10ca,_0x3b17ac){if(_0x9a10ca)return _0x5501cf(_0x9a10ca);return _0x1733ac(_0x3b17ac);});})[_0x55a4('0x10')](function(){return new BPromise(function(_0x19da3e,_0x5c1266){rimraf(_0x234213,function(_0x47e12d){if(_0x47e12d)_0x5c1266(_0x47e12d);return _0x19da3e();});});})[_0x55a4('0x10')](function(){return _0x27c53f[_0x55a4('0x71')](_0x25538d,_0x1b88b6,function(_0x52ddc9){if(_0x52ddc9){logger[_0x55a4('0x17')](_0x55a4('0xca'),_0x52ddc9);}else{fs['unlinkSync'](_0x25538d);}});});});}else{return _0x27c53f[_0x55a4('0x1b')](0xc8);}})['catch'](handleError(_0x27c53f,null));}; \ No newline at end of file +var _0x0a8a=['map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','catch','create','body','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','update','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','closed','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','customer','format','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','merge','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','options','rows','secret','push','setTags','spread','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','Owner','get','Chat','N.A.','toString','browserName','osName','referer','customerPort','existsSync','createReadStream','value','renderFile','views','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','agent','interaction','account','index'];(function(_0x3da556,_0x5bd01f){var _0x49fd15=function(_0x5e0372){while(--_0x5e0372){_0x3da556['push'](_0x3da556['shift']());}};_0x49fd15(++_0x5bd01f);}(_0x0a8a,0x16d));var _0xa0a8=function(_0xad4203,_0x5c5fc5){_0xad4203=_0xad4203-0x0;var _0x455ee1=_0x0a8a[_0xad4203];return _0x455ee1;};'use strict';var rimraf=require(_0xa0a8('0x0'));var zipdir=require('zip-dir');var rp=require(_0xa0a8('0x1'));var moment=require(_0xa0a8('0x2'));var BPromise=require(_0xa0a8('0x3'));var Mustache=require(_0xa0a8('0x4'));var util=require(_0xa0a8('0x5'));var path=require(_0xa0a8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0a8('0x7'));var Redis=require(_0xa0a8('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xa0a8('0x9'));var pdf=require(_0xa0a8('0xa'));var logger=require('../../config/logger')(_0xa0a8('0xb'));var config=require(_0xa0a8('0xc'));var db=require(_0xa0a8('0xd'))['db'];config['redis']=_[_0xa0a8('0xe')](config[_0xa0a8('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a8('0x10'))(new Redis(config['redis']));require(_0xa0a8('0x11'))['register'](socket);var jayson=require(_0xa0a8('0x12'));var client=jayson[_0xa0a8('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0xa0a8('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x188ad,_0x18bc03,_0x1780f5,_0x90779){return new BPromise(function(_0x84ba26,_0x39e23d){var _0x5b0974=_0x90779||client;return _0x5b0974[_0xa0a8('0x15')](_0x188ad,_0x1780f5)[_0xa0a8('0x16')](function(_0x38da7a){logger['info'](_0xa0a8('0x17'),_0x18bc03,_0xa0a8('0x18'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x18bc03,_0xa0a8('0x18'),JSON[_0xa0a8('0x19')](_0x38da7a));if(_0x38da7a[_0xa0a8('0x1a')]){if(_0x38da7a['error'][_0xa0a8('0x1b')]===0x1f4){logger['error'](_0xa0a8('0x17'),_0x18bc03,_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);return _0x39e23d(_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);}logger[_0xa0a8('0x1a')](_0xa0a8('0x17'),_0x18bc03,_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);return _0x84ba26(_0x38da7a[_0xa0a8('0x1a')][_0xa0a8('0x1c')]);}else{logger[_0xa0a8('0x1d')](_0xa0a8('0x17'),_0x18bc03,_0xa0a8('0x18'));_0x84ba26(_0x38da7a[_0xa0a8('0x1e')]['message']);}})['catch'](function(_0x161f49){logger[_0xa0a8('0x1a')](_0xa0a8('0x17'),_0x18bc03,_0x161f49);_0x39e23d(_0x161f49);});});}function respondWithStatusCode(_0x289542,_0x14d47a){_0x14d47a=_0x14d47a||0xcc;return function(_0x31f1de){if(_0x31f1de){return _0x289542[_0xa0a8('0x1f')](_0x14d47a);}return _0x289542[_0xa0a8('0x20')](_0x14d47a)[_0xa0a8('0x21')]();};}function respondWithResult(_0x400631,_0x4ba8ee){_0x4ba8ee=_0x4ba8ee||0xc8;return function(_0x3aea0a){if(_0x3aea0a){return _0x400631[_0xa0a8('0x20')](_0x4ba8ee)[_0xa0a8('0x22')](_0x3aea0a);}};}function respondWithFilteredResult(_0xc44d52,_0xb91cb4){return function(_0x108a60){if(_0x108a60){var _0x4963e1=typeof _0xb91cb4[_0xa0a8('0x23')]===_0xa0a8('0x24')&&typeof _0xb91cb4[_0xa0a8('0x25')]===_0xa0a8('0x24');var _0x29cbbc=_0x108a60[_0xa0a8('0x26')];var _0x404ecc=_0x4963e1?0x0:_0xb91cb4[_0xa0a8('0x23')];var _0x57846f=_0x4963e1?_0x108a60[_0xa0a8('0x26')]:_0xb91cb4[_0xa0a8('0x23')]+_0xb91cb4[_0xa0a8('0x25')];var _0x560cdc;if(_0x57846f>=_0x29cbbc){_0x57846f=_0x29cbbc;_0x560cdc=0xc8;}else{_0x560cdc=0xce;}_0xc44d52[_0xa0a8('0x20')](_0x560cdc);return _0xc44d52[_0xa0a8('0x27')](_0xa0a8('0x28'),_0x404ecc+'-'+_0x57846f+'/'+_0x29cbbc)['json'](_0x108a60);}return null;};}function saveUpdates(_0x18c675){return function(_0x54691d){if(_0x54691d){return _0x54691d['update'](_0x18c675)[_0xa0a8('0x16')](function(_0x43b20f){return _0x43b20f;});}return null;};}function removeEntity(_0x39f80f){return function(_0x2a0e44){if(_0x2a0e44){return _0x2a0e44[_0xa0a8('0x29')]()[_0xa0a8('0x16')](function(){_0x39f80f[_0xa0a8('0x20')](0xcc)[_0xa0a8('0x21')]();});}};}function handleEntityNotFound(_0x300941){return function(_0x19b2b9){if(!_0x19b2b9){_0x300941[_0xa0a8('0x1f')](0x194);}return _0x19b2b9;};}function handleError(_0x54f700,_0x299795){_0x299795=_0x299795||0x1f4;return function(_0x47334e){logger['error'](_0x47334e[_0xa0a8('0x2a')]);if(_0x47334e[_0xa0a8('0x2b')]){delete _0x47334e[_0xa0a8('0x2b')];}_0x54f700['status'](_0x299795)['send'](_0x47334e);};}function getMustacheRender(_0x39e31e,_0x1afb21){return Mustache[_0xa0a8('0x2c')](_0x39e31e,_['merge'](_0x1afb21['body'],{'contact':_0x1afb21['contact'],'message':_0x1afb21[_0xa0a8('0x1c')],'agent':_0x1afb21[_0xa0a8('0x2d')],'interaction':_0x1afb21[_0xa0a8('0x2e')],'account':_0x1afb21[_0xa0a8('0x2f')]}))||'';}exports[_0xa0a8('0x30')]=function(_0x28672b,_0x311981){var _0x38e395={};var _0x4c438c=_[_0xa0a8('0x31')](db[_0xa0a8('0x32')][_0xa0a8('0x33')],function(_0x33087e){return{'name':_0x33087e[_0xa0a8('0x34')],'type':_0x33087e[_0xa0a8('0x35')][_0xa0a8('0x36')]};});_0x38e395=qs[_0xa0a8('0x37')](_0x4c438c,_0x28672b);return interaction[_0xa0a8('0x38')](_0xa0a8('0x39'),_0x28672b[_0xa0a8('0x3a')],_0x28672b[_0xa0a8('0x3b')],_0x38e395,_0x4c438c)[_0xa0a8('0x16')](respondWithFilteredResult(_0x311981,_0x38e395))['catch'](handleError(_0x311981,null));};exports[_0xa0a8('0x3c')]=function(_0x136232,_0x27d55b){var _0x3fa00d={'raw':![],'where':{'id':_0x136232[_0xa0a8('0x3d')]['id']}},_0x3299b8={};_0x3299b8[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x32')][_0xa0a8('0x33')]);_0x3299b8[_0xa0a8('0x3a')]=_[_0xa0a8('0x3f')](_0x136232[_0xa0a8('0x3a')]);_0x3299b8[_0xa0a8('0x40')]=_[_0xa0a8('0x41')](_0x3299b8[_0xa0a8('0x3e')],_0x3299b8['query']);_0x3fa00d[_0xa0a8('0x42')]=_[_0xa0a8('0x41')](_0x3299b8[_0xa0a8('0x3e')],qs[_0xa0a8('0x43')](_0x136232[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x3fa00d[_0xa0a8('0x42')]=_0x3fa00d[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x3fa00d['attributes']:_0x3299b8['model'];if(_0x136232[_0xa0a8('0x3a')][_0xa0a8('0x45')]){_0x3fa00d[_0xa0a8('0x46')]=[{'all':!![]}];}_0x3fa00d=_['merge']({},_0x3fa00d,_0x136232['options']);return db['ChatInteraction'][_0xa0a8('0x47')](_0x3fa00d)[_0xa0a8('0x16')](handleEntityNotFound(_0x27d55b,null))[_0xa0a8('0x16')](respondWithResult(_0x27d55b,null))[_0xa0a8('0x48')](handleError(_0x27d55b,null));};exports[_0xa0a8('0x49')]=function(_0x3bfbe0,_0x3c34aa){return db[_0xa0a8('0x32')][_0xa0a8('0x49')](_0x3bfbe0[_0xa0a8('0x4a')],{})['then'](respondWithResult(_0x3c34aa,0xc9))[_0xa0a8('0x48')](handleError(_0x3c34aa,null));};exports['update']=function(_0x1ab5c8,_0x282466){if(_0x1ab5c8[_0xa0a8('0x4a')]['id']){delete _0x1ab5c8[_0xa0a8('0x4a')]['id'];}return db[_0xa0a8('0x32')]['find']({'where':{'id':_0x1ab5c8[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x282466,null))[_0xa0a8('0x16')](saveUpdates(_0x1ab5c8[_0xa0a8('0x4a')],null))[_0xa0a8('0x16')](respondWithResult(_0x282466,null))[_0xa0a8('0x48')](handleError(_0x282466,null));};exports['destroy']=function(_0x162557,_0x3d05be){return db['ChatInteraction']['find']({'where':{'id':_0x162557[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3d05be,null))[_0xa0a8('0x16')](removeEntity(_0x3d05be,null))[_0xa0a8('0x48')](handleError(_0x3d05be,null));};exports[_0xa0a8('0x4b')]=function(_0x23c05d,_0xa8b6e7){return db[_0xa0a8('0x32')][_0xa0a8('0x4b')]()[_0xa0a8('0x16')](respondWithResult(_0xa8b6e7,null))[_0xa0a8('0x48')](handleError(_0xa8b6e7,null));};exports['createVidaooSession']=function(_0x3c289a,_0x67c994){var _0x403014=_0x3c289a['params']['id'];var _0x30a35d;var _0x55cb91;var _0x5465b3;return db[_0xa0a8('0x32')][_0xa0a8('0x4c')]({'where':{'id':_0x403014}})[_0xa0a8('0x16')](function(_0x259802){_0x30a35d=_0x259802;return db[_0xa0a8('0x4d')][_0xa0a8('0x4c')]({'where':{'id':_0x259802[_0xa0a8('0x4e')]},'attributes':['id',_0xa0a8('0x4f'),_0xa0a8('0x50'),_0xa0a8('0x51'),_0xa0a8('0x52'),_0xa0a8('0x53')],'raw':!![]});})[_0xa0a8('0x16')](function(_0xdb1a69){if(_0xdb1a69&&_0xdb1a69[_0xa0a8('0x4f')]&&_0xdb1a69[_0xa0a8('0x50')]){_0x55cb91=_0xdb1a69;var _0x255ea3={'interaction':{'id':_0x403014},'agent':{'id':_0x3c289a[_0xa0a8('0x3b')]['id'],'name':_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x2b')],'fullname':_0x3c289a[_0xa0a8('0x3b')]['fullname'],'email':_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x54')]},'contact':_0x3c289a['body'][_0xa0a8('0x55')],'account':_0x3c289a[_0xa0a8('0x4a')][_0xa0a8('0x2f')]};var _0x84ea4f={'rejectUnauthorized':![],'method':_0xa0a8('0x56'),'url':_0xa0a8('0x57'),'headers':{'X-APIKEY':_0xdb1a69[_0xa0a8('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c289a[_0xa0a8('0x3b')][_0xa0a8('0x54')]],'buttons':null,'topic':_0x55cb91[_0xa0a8('0x51')],'note':_[_0xa0a8('0x58')](_0x55cb91[_0xa0a8('0x52')])?null:getMustacheRender(_0x55cb91[_0xa0a8('0x52')],_0x255ea3),'metadata':null},'redirect':_0xa0a8('0x59'),'json':!![]};try{if(!_[_0xa0a8('0x58')](_0x55cb91[_0xa0a8('0x53')])){var _0x3b302a=getMustacheRender(_0x55cb91['vidaooMetadata'],_0x255ea3);var _0xbd9866=JSON[_0xa0a8('0x5a')](_0x3b302a);_0x84ea4f[_0xa0a8('0x4a')][_0xa0a8('0x5b')]=_0xbd9866;}}catch(_0x2b230a){throw new db[(_0xa0a8('0x5c'))][(_0xa0a8('0x5d'))](_0xa0a8('0x5e'));}return rp(_0x84ea4f);}else{throw new db['Sequelize']['ValidationError'](_0xa0a8('0x5f'));}})['then'](function(_0x508f1b){_0x5465b3=_0x508f1b;if(_0x5465b3['id']){var _0x299b95={'body':_0x5465b3[_0xa0a8('0x60')],'ChatWebsiteId':_0x55cb91['id'],'ChatInteractionId':_0x30a35d['id'],'direction':_0xa0a8('0x61'),'UserId':_0x3c289a['user']['id']};return db[_0xa0a8('0x62')][_0xa0a8('0x49')](_0x299b95,{});}else{throw new db[(_0xa0a8('0x5c'))][(_0xa0a8('0x5d'))](_0xa0a8('0x63'));}})[_0xa0a8('0x16')](function(){return _0x30a35d[_0xa0a8('0x64')]({'vidaooSessionId':_0x5465b3['id']});})['then'](respondWithResult(_0x67c994,null))['catch'](handleError(_0x67c994,null));};exports[_0xa0a8('0x65')]=function(_0x49de2d,_0x460d0b){if(_0x49de2d[_0xa0a8('0x4a')]['id']){delete _0x49de2d[_0xa0a8('0x4a')]['id'];}return db['ChatInteraction'][_0xa0a8('0x47')]({'where':{'id':_0x49de2d[_0xa0a8('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xa0a8('0x66')}]})[_0xa0a8('0x16')](handleEntityNotFound(_0x460d0b,null))[_0xa0a8('0x16')](saveUpdates(_0x49de2d[_0xa0a8('0x4a')],null))[_0xa0a8('0x16')](respondWithResult(_0x460d0b,null))[_0xa0a8('0x48')](handleError(_0x460d0b,null));};exports[_0xa0a8('0x67')]=function(_0x69cace,_0x2afa5f){if(_0x69cace[_0xa0a8('0x4a')]['id']){delete _0x69cace[_0xa0a8('0x4a')]['id'];}return db['ChatInteraction'][_0xa0a8('0x47')]({'where':{'id':_0x69cace[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](function(_0x43c5ac){if(!_0x43c5ac){logger[_0xa0a8('0x1a')](_0xa0a8('0x68'),_0xa0a8('0x67'),0x194,_0xa0a8('0x69'));_0x2afa5f['sendStatus'](0x194);}else{if(_0x43c5ac[_0xa0a8('0x6a')]){throw new db[(_0xa0a8('0x5c'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x43c5ac;})[_0xa0a8('0x16')](function(_0x30f581){if(_0x30f581){return _0x30f581[_0xa0a8('0x6b')]({'closed':_0x69cace[_0xa0a8('0x4a')]['closed'],'disposition':_0x69cace[_0xa0a8('0x4a')][_0xa0a8('0x6c')]})[_0xa0a8('0x16')](function(_0x2d2bb7){return _0x2d2bb7;});}})[_0xa0a8('0x16')](function(){return respondWithRpcPromise(_0xa0a8('0x6d'),_0xa0a8('0x67'),_0x69cace[_0xa0a8('0x4a')],client9004);})[_0xa0a8('0x16')](respondWithResult(_0x2afa5f,null))[_0xa0a8('0x48')](handleError(_0x2afa5f,null));};exports[_0xa0a8('0x6e')]=function(_0x333b88,_0x424433){_0x333b88[_0xa0a8('0x4a')][_0xa0a8('0x2b')]=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x70')];_0x333b88['body']['basename']=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x71')];_0x333b88['body']['type']=_0x333b88[_0xa0a8('0x6f')][_0xa0a8('0x72')];return db['Attachment'][_0xa0a8('0x49')](_0x333b88['body'])[_0xa0a8('0x16')](respondWithResult(_0x424433,0xc9))[_0xa0a8('0x48')](handleError(_0x424433,null));};exports[_0xa0a8('0x73')]=function(_0x5bbd7f,_0x52f298){return db[_0xa0a8('0x32')]['findOne']({'where':{'id':_0x5bbd7f[_0xa0a8('0x3d')]['id']},'raw':!![]})[_0xa0a8('0x16')](handleEntityNotFound(_0x52f298,null))[_0xa0a8('0x16')](function(_0x36a4cf){if(_0x36a4cf){if(_0x36a4cf[_0xa0a8('0x74')]){return _0x52f298[_0xa0a8('0x20')](0x193)[_0xa0a8('0x22')]({'status':0x193,'message':'Unauthorized'});}return db[_0xa0a8('0x75')][_0xa0a8('0x4c')]({'where':{'id':_0x5bbd7f[_0xa0a8('0x3a')][_0xa0a8('0x76')]},'raw':!![]})[_0xa0a8('0x16')](handleEntityNotFound(_0x52f298,null));}})[_0xa0a8('0x16')](function(_0x16776e){if(_0x16776e){var _0x1ee0a8=_0x16776e[_0xa0a8('0x77')]!==null;var _0x527649=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],'server/files/attachments/');if(_0x1ee0a8){_0x527649=path[_0xa0a8('0x78')](_0x527649,_0xa0a8('0x7a'));}var _0x232b62=path[_0xa0a8('0x78')](_0x527649,_0x16776e[_0xa0a8('0x7b')]);return _0x52f298[_0xa0a8('0x7c')](_0x232b62);}})[_0xa0a8('0x48')](handleError(_0x52f298,null));};exports[_0xa0a8('0x7d')]=function(_0x38df96,_0x484ec3){var _0x1689a7=null;var _0x4d73a4=null;var _0x5a2fe0=null;if(_0x38df96[_0xa0a8('0x4a')]['id']){delete _0x38df96[_0xa0a8('0x4a')]['id'];}if(_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x7e')]){_0x5a2fe0=path['join'](config[_0xa0a8('0x79')],_0xa0a8('0x7f'),util['format'](_0xa0a8('0x80'),Date['now']()));_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x81')]=_0x5a2fe0;}return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x38df96['params']['id']},'include':[{'model':db[_0xa0a8('0x62')],'as':_0xa0a8('0x82'),'include':[{'model':db[_0xa0a8('0x83')],'as':_0xa0a8('0x83')}]}]})[_0xa0a8('0x16')](handleEntityNotFound(_0x484ec3,null))[_0xa0a8('0x16')](saveUpdates(_0x38df96['body'],null))[_0xa0a8('0x16')](function(_0x9be9d6){if(_0x9be9d6){_0x1689a7=_0x9be9d6;return db[_0xa0a8('0x4d')][_0xa0a8('0x47')]({'where':{'id':_0x1689a7[_0xa0a8('0x4e')]}});}})[_0xa0a8('0x16')](function(_0x1944dd){if(_0x1944dd){_0x4d73a4=_0x1944dd;return db[_0xa0a8('0x84')]['find']({'where':{'id':_0x1689a7[_0xa0a8('0x85')]}});}})[_0xa0a8('0x16')](function(_0x2bcd0e){if(_0x2bcd0e){if(_0x5a2fe0){var _0x1a294b=null;for(var _0x50953c=0x1;_0x50953c<_0x1689a7['Messages']['length'];++_0x50953c){_0x1a294b=_0x1689a7[_0xa0a8('0x82')][_0x50953c];var _0x43a90f=_0x1a294b['UserId']?util['format'](_0xa0a8('0x86'),_0x4d73a4[_0xa0a8('0x87')],_0x1a294b[_0xa0a8('0x6a')]):'System';var _0x226c88=_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x88')]||util[_0xa0a8('0x89')]('%s%d',_0xa0a8('0x8a'),_0x1a294b[_0xa0a8('0x85')]);switch(_0x4d73a4[_0xa0a8('0x8b')]){case _0xa0a8('0x8c'):_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?util[_0xa0a8('0x89')](_0xa0a8('0x86'),_0x4d73a4[_0xa0a8('0x87')],_0x1a294b['UserId']):_0xa0a8('0x8d');break;case _0xa0a8('0x8e'):_0x43a90f=_0x1a294b['UserId']?_0x1a294b[_0xa0a8('0x83')][_0xa0a8('0x8f')]||_0x1a294b[_0xa0a8('0x83')][_0xa0a8('0x90')]:_0xa0a8('0x8d');break;case'agent_fullname':_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?_0x1a294b[_0xa0a8('0x83')]['fullname']:_0xa0a8('0x8d');break;default:_0x43a90f=_0x1a294b[_0xa0a8('0x6a')]?util[_0xa0a8('0x89')]('%s%d',_0x4d73a4[_0xa0a8('0x87')],_0x1a294b[_0xa0a8('0x6a')]):'System';}var _0x5e5cb0=util['format'](_0xa0a8('0x91'),moment(_0x1a294b[_0xa0a8('0x92')])[_0xa0a8('0x89')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1a294b['direction']==='in'?_0x226c88:_0x43a90f,_0x1a294b[_0xa0a8('0x4a')]);if(!_0x1a294b['secret']){fs['appendFileSync'](_0x5a2fe0,_0x5e5cb0);}}return db[_0xa0a8('0x93')][_0xa0a8('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa0a8('0x94')],'as':_0xa0a8('0x95'),'raw':!![],'include':[{'model':db[_0xa0a8('0x96')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xa0a8('0x16')](function(_0x5a0d7a){if(!_0x5a0d7a||!_0x5a0d7a[_0xa0a8('0x95')]||!_0x38df96['body'])return _0x1689a7;var _0x51f93c=_0x5a0d7a[_0xa0a8('0x97')]();return respondWithRpcPromise(_0xa0a8('0x98'),_0xa0a8('0x99'),{'account':_0x51f93c,'message':{'from':util[_0xa0a8('0x89')](_0xa0a8('0x9a'),_0x5a0d7a[_0xa0a8('0x2b')],_0x5a0d7a[_0xa0a8('0x54')]||_0x5a0d7a[_0xa0a8('0x95')][_0xa0a8('0x3b')]),'to':_0x38df96[_0xa0a8('0x4a')][_0xa0a8('0x7e')],'subject':_0xa0a8('0x9b'),'text':util[_0xa0a8('0x89')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38df96['body'][_0xa0a8('0x7e')]),'attachments':[{'path':_0x5a2fe0}]}})[_0xa0a8('0x16')](function(){return _0x1689a7;})['catch'](function(_0x548593){logger['error'](_0x548593);});})['then'](respondWithStatusCode(_0x484ec3,0xc8))['catch'](handleError(_0x484ec3,null));};exports[_0xa0a8('0x9c')]=function(_0x30351c,_0x345ccf){return db[_0xa0a8('0x62')][_0xa0a8('0x47')]({'where':{'id':_0x30351c[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x345ccf,null))[_0xa0a8('0x16')](function(_0x1f534d){if(_0x1f534d){return _0x1f534d['addMessage'](_0x30351c[_0xa0a8('0x4a')]['ids'],_[_0xa0a8('0x9d')](_0x30351c[_0xa0a8('0x4a')],[_0xa0a8('0x9e'),'id'])||{});}})[_0xa0a8('0x16')](respondWithResult(_0x345ccf,null))[_0xa0a8('0x48')](handleError(_0x345ccf,null));};exports[_0xa0a8('0x9f')]=function(_0x53867f,_0x4c383b){var _0x3364e5={'raw':![],'where':{}};var _0x30496={};var _0xce8f09={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa0a8('0x4c')]({'where':{'id':_0x53867f[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x4c383b,null))[_0xa0a8('0x16')](function(_0x272467){if(_0x272467){_0x30496[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x62')][_0xa0a8('0x33')]);_0x30496[_0xa0a8('0x3a')]=_[_0xa0a8('0x3f')](_0x53867f[_0xa0a8('0x3a')]);_0x30496[_0xa0a8('0x40')]=_['intersection'](_0x30496[_0xa0a8('0x3e')],_0x30496[_0xa0a8('0x3a')]);_0x3364e5[_0xa0a8('0x42')]=_['intersection'](_0x30496['model'],qs[_0xa0a8('0x43')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x3364e5['attributes']=_0x3364e5[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x3364e5[_0xa0a8('0x42')]:_0x30496[_0xa0a8('0x3e')];if(!_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa0')](_0xa0a8('0xa1'))){_0x3364e5[_0xa0a8('0x25')]=qs[_0xa0a8('0x25')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x25')]);_0x3364e5[_0xa0a8('0x23')]=qs[_0xa0a8('0x23')](_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0x23')]);}_0x3364e5[_0xa0a8('0xa2')]=qs[_0xa0a8('0xa3')](_0x53867f['query'][_0xa0a8('0xa3')]);_0x3364e5[_0xa0a8('0xa4')]=qs[_0xa0a8('0x40')](_[_0xa0a8('0xa5')](_0x53867f[_0xa0a8('0x3a')],_0x30496['filters']));_0x3364e5[_0xa0a8('0xa4')][_0xa0a8('0xa6')]=_0x272467['id'];if(_0x53867f[_0xa0a8('0x3a')]['filter']){_0x3364e5[_0xa0a8('0xa4')]=_[_0xa0a8('0xa7')](_0x3364e5['where'],{'$or':_[_0xa0a8('0x31')](_0x3364e5['attributes'],function(_0x5397ef){var _0x39b85e={};_0x39b85e[_0x5397ef]={'$like':'%'+_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa8')]+'%'};return _0x39b85e;})});}if(_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa9')]){var _0x3be48b=_0x53867f[_0xa0a8('0x3a')][_0xa0a8('0xa9')]['split'](',');var _0x21d64a={};_0x21d64a[_0x3be48b[0x0]]={'$gte':moment(_0x3be48b[0x1])[_0xa0a8('0x89')](_0xa0a8('0xaa'))};_0x3364e5['where']=_['merge'](_0x3364e5[_0xa0a8('0xa4')],_0x21d64a);}_0x3364e5=_[_0xa0a8('0xa7')]({},_0x3364e5,_0x53867f[_0xa0a8('0xab')]);return db[_0xa0a8('0x62')][_0xa0a8('0x26')]({'where':_0x3364e5[_0xa0a8('0xa4')]})[_0xa0a8('0x16')](function(_0xeaf1a0){_0xce8f09['count']=_0xeaf1a0;if(_0x53867f['query'][_0xa0a8('0x45')]){_0x3364e5[_0xa0a8('0x46')]=[{'all':!![]}];}return db[_0xa0a8('0x62')][_0xa0a8('0x38')](_0x3364e5);})['then'](function(_0x406c24){_0xce8f09[_0xa0a8('0xac')]=_0x406c24;return _0xce8f09;});}})[_0xa0a8('0x16')](respondWithFilteredResult(_0x4c383b,_0x3364e5))[_0xa0a8('0x48')](handleError(_0x4c383b,null));};exports['getMyMessages']=function(_0x172a3e,_0x3220ca){var _0x1a0fd6={'where':{}},_0x5e7119={},_0xce83a1={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x172a3e[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3220ca,null))[_0xa0a8('0x16')](function(_0x77be29){if(_0x77be29){_0x5e7119[_0xa0a8('0x3e')]=_[_0xa0a8('0x3f')](db[_0xa0a8('0x62')][_0xa0a8('0x33')]);_0x5e7119['query']=_[_0xa0a8('0x3f')](_0x172a3e[_0xa0a8('0x3a')]);_0x5e7119['filters']=_['intersection'](_0x5e7119[_0xa0a8('0x3e')],_0x5e7119[_0xa0a8('0x3a')]);_0x1a0fd6['attributes']=_[_0xa0a8('0x41')](_0x5e7119[_0xa0a8('0x3e')],qs[_0xa0a8('0x43')](_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x43')]));_0x1a0fd6['attributes']=_0x1a0fd6[_0xa0a8('0x42')][_0xa0a8('0x44')]?_0x1a0fd6[_0xa0a8('0x42')]:_0x5e7119[_0xa0a8('0x3e')];if(!_0x172a3e['query'][_0xa0a8('0xa0')]('nolimit')){_0x1a0fd6[_0xa0a8('0x25')]=qs[_0xa0a8('0x25')](_0x172a3e[_0xa0a8('0x3a')]['limit']);_0x1a0fd6['offset']=qs['offset'](_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x23')]);}_0x1a0fd6[_0xa0a8('0xa2')]=qs[_0xa0a8('0xa3')](_0x172a3e['query'][_0xa0a8('0xa3')]);_0x1a0fd6['where']=qs[_0xa0a8('0x40')](_[_0xa0a8('0xa5')](_0x172a3e[_0xa0a8('0x3a')],_0x5e7119[_0xa0a8('0x40')]));_0x1a0fd6[_0xa0a8('0xa4')][_0xa0a8('0xa6')]=_0x77be29['id'];if(_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0xa8')]){_0x1a0fd6[_0xa0a8('0xa4')]=_[_0xa0a8('0xa7')](_0x1a0fd6[_0xa0a8('0xa4')],{'$or':_['map'](_0x1a0fd6[_0xa0a8('0x42')],function(_0x4144f9){var _0x12332f={};_0x12332f[_0x4144f9]={'$like':'%'+_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0xa8')]+'%'};return _0x12332f;})});}_0x1a0fd6[_0xa0a8('0xa4')][_0xa0a8('0xad')]=![];if(_0x172a3e[_0xa0a8('0x3a')]['id']){_0x1a0fd6[_0xa0a8('0xa4')]['id']={'$gt':_0x172a3e['query']['id']};}_0x1a0fd6=_[_0xa0a8('0xa7')]({},_0x1a0fd6,_0x172a3e[_0xa0a8('0xab')]);return db[_0xa0a8('0x62')][_0xa0a8('0x26')]({'where':_0x1a0fd6[_0xa0a8('0xa4')]})[_0xa0a8('0x16')](function(_0x343a6d){_0xce83a1['count']=_0x343a6d;_0x1a0fd6[_0xa0a8('0x46')]=[];if(_0x172a3e[_0xa0a8('0x3a')]['includeAgent']){_0x1a0fd6[_0xa0a8('0x46')][_0xa0a8('0xae')]({'model':db['User'],'as':_0xa0a8('0x83'),'attributes':['id',_0xa0a8('0x90'),'alias']});}if(_0x172a3e[_0xa0a8('0x3a')][_0xa0a8('0x45')]){_0x1a0fd6[_0xa0a8('0x46')]=[{'all':!![]}];}return db[_0xa0a8('0x62')]['findAll'](_0x1a0fd6);})[_0xa0a8('0x16')](function(_0x26d6ef){_0xce83a1[_0xa0a8('0xac')]=_0x26d6ef;return _0xce83a1;});}})[_0xa0a8('0x16')](respondWithFilteredResult(_0x3220ca,_0x1a0fd6))[_0xa0a8('0x48')](handleError(_0x3220ca,null));};exports['addTags']=function(_0x556efd,_0x25c659){return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x556efd[_0xa0a8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x25c659,null))[_0xa0a8('0x16')](function(_0x4f659d){if(_0x4f659d){return _0x4f659d[_0xa0a8('0xaf')](_0x556efd[_0xa0a8('0x4a')]['ids'],_[_0xa0a8('0x9d')](_0x556efd[_0xa0a8('0x4a')],[_0xa0a8('0x9e'),'id'])||{})[_0xa0a8('0xb0')](function(){return db['Tag'][_0xa0a8('0x38')]({'attributes':['id',_0xa0a8('0x2b'),'color'],'where':{'id':_0x556efd['body'][_0xa0a8('0x9e')]}});})[_0xa0a8('0x16')](function(_0x1cbb6f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x556efd[_0xa0a8('0x3d')]['id']),'tags':_0x1cbb6f||[]});return{'id':Number(_0x556efd[_0xa0a8('0x3d')]['id']),'tags':_0x1cbb6f||[]};});}})[_0xa0a8('0x16')](respondWithResult(_0x25c659,null))['catch'](handleError(_0x25c659,null));};exports[_0xa0a8('0xb1')]=function(_0x412263,_0x3ba9aa){return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x412263[_0xa0a8('0x3d')]['id']}})[_0xa0a8('0x16')](handleEntityNotFound(_0x3ba9aa,null))[_0xa0a8('0x16')](function(_0x47f1fb){if(_0x47f1fb){return _0x47f1fb['removeTags'](_0x412263[_0xa0a8('0x3a')][_0xa0a8('0x9e')]);}})['then'](respondWithStatusCode(_0x3ba9aa,null))[_0xa0a8('0x48')](handleError(_0x3ba9aa,null));};exports[_0xa0a8('0x7c')]=function(_0x4d337d,_0x1adad5){var _0x58c51e=moment()[_0xa0a8('0xb2')]()['toString']();var _0x3218bb=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xb4'),_0xa0a8('0xb5'));var _0x3c9a1e=path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xb4'),_0xa0a8('0xb6'));var _0x2f3928=path[_0xa0a8('0x78')](_0x3218bb,_0x58c51e);var _0x2463ac=util[_0xa0a8('0x89')](_0xa0a8('0xb7'),_0x4d337d[_0xa0a8('0x3d')]['id'],_0x58c51e);var _0xe40df0=path[_0xa0a8('0x78')](_0x3218bb,_0x2463ac);var _0x202ba1=[];_0x202ba1[_0xa0a8('0xae')]({'model':db['User'],'as':_0xa0a8('0x83'),'attributes':['id',_0xa0a8('0x90')],'raw':!![]});_0x202ba1[_0xa0a8('0xae')]({'model':db['CmContact'],'as':_0xa0a8('0x66'),'attributes':['id',_0xa0a8('0xb8'),_0xa0a8('0xb9')],'raw':!![]});if(_0x4d337d[_0xa0a8('0x3a')][_0xa0a8('0xb6')]){_0x202ba1[_0xa0a8('0xae')]({'model':db[_0xa0a8('0x75')],'as':_0xa0a8('0x75'),'raw':!![]});}var _0x575d14=[{'model':db[_0xa0a8('0x62')],'as':_0xa0a8('0x82'),'attributes':['id',_0xa0a8('0x4a'),'createdAt',_0xa0a8('0xba'),_0xa0a8('0xad'),_0xa0a8('0xbb')],'include':_0x202ba1}];_0x575d14[_0xa0a8('0xae')]({'model':db[_0xa0a8('0x4d')],'as':_0xa0a8('0xbc'),'attributes':['id',_0xa0a8('0x2b')]});_0x575d14['push']({'model':db[_0xa0a8('0x83')],'as':_0xa0a8('0xbd'),'attributes':['id',_0xa0a8('0x90')]});return db[_0xa0a8('0x32')][_0xa0a8('0x47')]({'where':{'id':_0x4d337d[_0xa0a8('0x3d')]['id']},'include':_0x575d14})[_0xa0a8('0x16')](handleEntityNotFound(_0x1adad5,null))['then'](function(_0x3ecd23){if(_0x3ecd23){var _0x9366dc=_0x3ecd23[_0xa0a8('0xbe')]({'plain':!![]});fs['mkdirSync'](_0x2f3928);var _0x5b54ac={'channel':_0xa0a8('0xbf'),'account':_0x9366dc[_0xa0a8('0xbc')][_0xa0a8('0x2b')],'agent':_0x9366dc[_0xa0a8('0xbd')]?_0x9366dc[_0xa0a8('0xbd')][_0xa0a8('0x90')]:_0xa0a8('0xc0'),'createdAt':moment(_0x9366dc[_0xa0a8('0x92')])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')](),'closedAt':_0x9366dc['closed']?moment(_0x9366dc['closedAt'])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')]():'','disposition':_0x9366dc[_0xa0a8('0x6c')],'chatInfo':{'browser':_0x9366dc[_0xa0a8('0xc2')],'os':_0x9366dc[_0xa0a8('0xc3')],'referer':_0x9366dc[_0xa0a8('0xc4')],'customerIp':_0x9366dc['customerIp'],'customerPort':_0x9366dc[_0xa0a8('0xc5')]?_0x9366dc[_0xa0a8('0xc5')]:_0xa0a8('0xc0')},'messages':_(_0x9366dc['Messages'])['tail']()[_0xa0a8('0xa8')]({'secret':![]})[_0xa0a8('0x31')](function(_0x10942f){if(_0x10942f[_0xa0a8('0x75')]){var _0x2393d2=path[_0xa0a8('0x78')](_0x3c9a1e,_0x10942f['Attachment'][_0xa0a8('0x7b')]);if(fs[_0xa0a8('0xc6')](_0x2393d2)){fs[_0xa0a8('0xc7')](_0x2393d2)['pipe'](fs['createWriteStream'](path[_0xa0a8('0x78')](_0x2f3928,_0x10942f['Attachment'][_0xa0a8('0x7b')])));}}return{'date':moment(_0x10942f[_0xa0a8('0x92')])[_0xa0a8('0x89')](_0xa0a8('0xaa'))[_0xa0a8('0xc1')](),'sender':_0x10942f['direction']===_0xa0a8('0x61')?_0x10942f[_0xa0a8('0x83')]?_0x10942f['User'][_0xa0a8('0x90')]:_0xa0a8('0x8d'):_0x10942f[_0xa0a8('0x66')]['firstName']+(_0x10942f[_0xa0a8('0x66')]['lastName']?'\x20'+_0x10942f[_0xa0a8('0x66')]['lastName']:''),'body':_0x10942f[_0xa0a8('0x75')]?_0x10942f['Attachment'][_0xa0a8('0x7b')]:_0x10942f['body'],'direction':_0x10942f[_0xa0a8('0xba')]==='out'?'A':'C','secret':_0x10942f[_0xa0a8('0xad')],'read':_0x10942f[_0xa0a8('0xbb')],'attachment':_0x10942f[_0xa0a8('0x75')]};})[_0xa0a8('0xc8')]()};return ejs[_0xa0a8('0xc9')](path[_0xa0a8('0x78')](config[_0xa0a8('0x79')],_0xa0a8('0xb3'),_0xa0a8('0xca'),'downloadInteraction.ejs'),{'interaction':_0x5b54ac})[_0xa0a8('0x16')](function(_0x4fe9f5){var _0x2bdb75=path[_0xa0a8('0x78')](_0x2f3928,'transcript-'+_0x9366dc['id']+'-'+_0x58c51e+_0xa0a8('0xcb'));var _0x1774ab={'path':_0x2bdb75,'channel':_0xa0a8('0xbf'),'interactionId':_0x9366dc['id']};return pdf[_0xa0a8('0xcc')](_0x4fe9f5,_0x1774ab);})[_0xa0a8('0x16')](function(){return new Promise(function(_0x72e462,_0x393aeb){zipdir(_0x2f3928,{'saveTo':_0xe40df0},function(_0x1f2bad,_0x42cd90){if(_0x1f2bad)return _0x393aeb(_0x1f2bad);return _0x72e462(_0x42cd90);});})[_0xa0a8('0x16')](function(){return new BPromise(function(_0xd2f2f2,_0x16eaa2){rimraf(_0x2f3928,function(_0xcf8bad){if(_0xcf8bad)_0x16eaa2(_0xcf8bad);return _0xd2f2f2();});});})[_0xa0a8('0x16')](function(){return _0x1adad5[_0xa0a8('0x7c')](_0xe40df0,_0x2463ac,function(_0x3986c0){if(_0x3986c0){logger[_0xa0a8('0x1a')](_0xa0a8('0xcd'),_0x3986c0);}else{fs[_0xa0a8('0xce')](_0xe40df0);}});});});}else{return _0x1adad5[_0xa0a8('0x1f')](0xc8);}})['catch'](handleError(_0x1adad5,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 186b344..f53eca7 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 _0x8c72=['map','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x1d1860,_0x55062b){var _0x19ddca=function(_0x2e2b62){while(--_0x2e2b62){_0x1d1860['push'](_0x1d1860['shift']());}};_0x19ddca(++_0x55062b);}(_0x8c72,0x19c));var _0x28c7=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x8c72[_0x119d5a];return _0x15bff4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x28c7('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x28c7('0x0'))['db'][_0x28c7('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x28c7('0x2')](0x0);var events={'afterCreate':_0x28c7('0x3'),'afterUpdate':_0x28c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3318dd){return function(_0x249068,_0x9f7639,_0x2d7d54){_0x249068[_0x28c7('0x5')]({'attributes':['id'],'raw':!![]})[_0x28c7('0x6')](function(_0x2a1d8c){_0x249068[_0x28c7('0x7')]('Users',_0x2a1d8c[_0x28c7('0x8')](function(_0x1923b1){return{'id':_0x1923b1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x249068['id'],'direction':'in','read':![]},'raw':!![]});})[_0x28c7('0x6')](function(_0x204754){_0x249068[_0x28c7('0x7')](_0x28c7('0x9'),_0x204754['length']);ChatInteractionEvents['emit'](_0x3318dd+':'+_0x249068['id'],_0x249068);ChatInteractionEvents[_0x28c7('0xa')](_0x3318dd,_0x249068);_0x2d7d54(null);})[_0x28c7('0xb')](_0x2d7d54(null));};}for(var e in events){if(events[_0x28c7('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x28c7('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xcd08=['events','../../mysqldb','ChatInteraction','save','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x57882a,_0x164508){var _0x12a914=function(_0x38ecb0){while(--_0x38ecb0){_0x57882a['push'](_0x57882a['shift']());}};_0x12a914(++_0x164508);}(_0xcd08,0x16c));var _0x8cd0=function(_0x64a0e8,_0x2c86a5){_0x64a0e8=_0x64a0e8-0x0;var _0xb2f2e2=_0xcd08[_0x64a0e8];return _0xb2f2e2;};'use strict';var EventEmitter=require(_0x8cd0('0x0'));var ChatInteraction=require(_0x8cd0('0x1'))['db'][_0x8cd0('0x2')];var ChatMessage=require(_0x8cd0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8cd0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49f160){return function(_0x208ed6,_0x7b29f5,_0x509731){_0x208ed6['getUsers']({'attributes':['id'],'raw':!![]})[_0x8cd0('0x4')](function(_0x1f7e2a){_0x208ed6[_0x8cd0('0x5')](_0x8cd0('0x6'),_0x1f7e2a['map'](function(_0x1f9928){return{'id':_0x1f9928['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x208ed6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8cd0('0x4')](function(_0x3777f5){_0x208ed6[_0x8cd0('0x5')](_0x8cd0('0x7'),_0x3777f5[_0x8cd0('0x8')]);ChatInteractionEvents['emit'](_0x49f160+':'+_0x208ed6['id'],_0x208ed6);ChatInteractionEvents[_0x8cd0('0x9')](_0x49f160,_0x208ed6);_0x509731(null);})[_0x8cd0('0xa')](_0x509731(null));};}for(var e in events){if(events[_0x8cd0('0xb')](e)){var event=events[e];ChatInteraction[_0x8cd0('0xc')](e,emitEvent(event));}}module[_0x8cd0('0xd')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index aa90c8d..e688243 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 _0x2154=['../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a0bc9,_0x33e977){var _0xea2e04=function(_0x48f2d9){while(--_0x48f2d9){_0x5a0bc9['push'](_0x5a0bc9['shift']());}};_0xea2e04(++_0x33e977);}(_0x2154,0xa0));var _0x4215=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x2154[_0x1abb09];return _0xea1c07;};'use strict';var _=require('lodash');var util=require(_0x4215('0x0'));var logger=require(_0x4215('0x1'))(_0x4215('0x2'));var moment=require(_0x4215('0x3'));var BPromise=require(_0x4215('0x4'));var rp=require(_0x4215('0x5'));var fs=require('fs');var path=require(_0x4215('0x6'));var rimraf=require(_0x4215('0x7'));var config=require(_0x4215('0x8'));var attributes=require(_0x4215('0x9'));module[_0x4215('0xa')]=function(_0x44fe7d,_0x18ea4f){return _0x44fe7d[_0x4215('0xb')](_0x4215('0xc'),attributes,{'tableName':_0x4215('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54bf6f,_0x29283f,_0x540479){if(_0x54bf6f[_0x4215('0xe')](_0x4215('0xf'))){_0x54bf6f[_0x4215('0x10')]=moment()[_0x4215('0x11')](_0x4215('0x12'));}_0x540479(null,_0x54bf6f);}},'charset':_0x4215('0x13'),'collate':_0x4215('0x14')});}; \ No newline at end of file +var _0x0ebb=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed','closedAt'];(function(_0x4a0a69,_0x56acd5){var _0x14abbf=function(_0x3e0854){while(--_0x3e0854){_0x4a0a69['push'](_0x4a0a69['shift']());}};_0x14abbf(++_0x56acd5);}(_0x0ebb,0x124));var _0xb0eb=function(_0x4f2861,_0x26eb9e){_0x4f2861=_0x4f2861-0x0;var _0x7504f1=_0x0ebb[_0x4f2861];return _0x7504f1;};'use strict';var _=require(_0xb0eb('0x0'));var util=require('util');var logger=require(_0xb0eb('0x1'))(_0xb0eb('0x2'));var moment=require(_0xb0eb('0x3'));var BPromise=require(_0xb0eb('0x4'));var rp=require(_0xb0eb('0x5'));var fs=require('fs');var path=require(_0xb0eb('0x6'));var rimraf=require(_0xb0eb('0x7'));var config=require(_0xb0eb('0x8'));var attributes=require(_0xb0eb('0x9'));module['exports']=function(_0x3f920a,_0x6083cf){return _0x3f920a['define'](_0xb0eb('0xa'),attributes,{'tableName':_0xb0eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ce48f,_0x274b38,_0xc05d3e){if(_0x5ce48f['changed'](_0xb0eb('0xc'))){_0x5ce48f[_0xb0eb('0xd')]=moment()[_0xb0eb('0xe')](_0xb0eb('0xf'));}_0xc05d3e(null,_0x5ce48f);}},'charset':'utf8mb4','collate':_0xb0eb('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c62c64d..b2ba656 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 _0x0f97=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','UpdateChatInteraction','ChatInteraction','body','options','raw','where','limit','stringify','catch','AddTagsToChatInteraction','addTags','omit','spread','debug','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x4ff81c,_0x5c0db3){var _0x175291=function(_0x3f14c3){while(--_0x3f14c3){_0x4ff81c['push'](_0x4ff81c['shift']());}};_0x175291(++_0x5c0db3);}(_0x0f97,0xaf));var _0x70f9=function(_0x2d6375,_0x149216){_0x2d6375=_0x2d6375-0x0;var _0x29186f=_0x0f97[_0x2d6375];return _0x29186f;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x70f9('0x3'));var fs=require('fs');var Redis=require(_0x70f9('0x4'));var db=require(_0x70f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70f9('0x6'));var config=require(_0x70f9('0x7'));var jayson=require(_0x70f9('0x8'));var client=jayson['client'][_0x70f9('0x9')]({'port':0x232a});config[_0x70f9('0xa')]=_['defaults'](config[_0x70f9('0xa')],{'host':_0x70f9('0xb'),'port':0x18eb});var socket=require(_0x70f9('0xc'))(new Redis(config['redis']));require(_0x70f9('0xd'))[_0x70f9('0xe')](socket);function respondWithRpcPromise(_0xa9bf84,_0x1878bd,_0x108db2){return new BPromise(function(_0x53f04d,_0x229b21){return client[_0x70f9('0xf')](_0xa9bf84,_0x108db2)[_0x70f9('0x10')](function(_0x402489){logger[_0x70f9('0x11')](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));logger['debug'](_0x70f9('0x14'),_0x1878bd,_0x70f9('0x13'),JSON['stringify'](_0x402489));if(_0x402489[_0x70f9('0x15')]){if(_0x402489[_0x70f9('0x15')]['code']===0x1f4){logger['error'](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x229b21(_0x402489['error']['message']);}logger[_0x70f9('0x15')](_0x70f9('0x12'),_0x1878bd,_0x402489[_0x70f9('0x15')][_0x70f9('0x16')]);return _0x53f04d(_0x402489[_0x70f9('0x15')]['message']);}else{logger['info'](_0x70f9('0x12'),_0x1878bd,_0x70f9('0x13'));_0x53f04d(_0x402489['result']['message']);}})['catch'](function(_0x3d7757){logger[_0x70f9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1878bd,_0x3d7757);_0x229b21(_0x3d7757);});});}exports[_0x70f9('0x17')]=function(_0x5ec653){var _0x33dde5=this;return new Promise(function(_0x50d0c4,_0x5e2276){return db[_0x70f9('0x18')]['update'](_0x5ec653[_0x70f9('0x19')],{'raw':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options'][_0x70f9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec653['options']?_0x5ec653['options'][_0x70f9('0x1c')]||null:null,'attributes':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653['options']['attributes']||null:null,'limit':_0x5ec653[_0x70f9('0x1a')]?_0x5ec653[_0x70f9('0x1a')][_0x70f9('0x1d')]||null:null})[_0x70f9('0x10')](function(_0x163b5a){logger[_0x70f9('0x11')](_0x70f9('0x17'),_0x5ec653);logger['debug']('UpdateChatInteraction',_0x5ec653,JSON[_0x70f9('0x1e')](_0x163b5a));_0x50d0c4(_0x163b5a);})[_0x70f9('0x1f')](function(_0x1c474b){logger[_0x70f9('0x15')]('UpdateChatInteraction',_0x1c474b['message'],_0x5ec653);_0x5e2276(_0x33dde5[_0x70f9('0x15')](0x1f4,_0x1c474b[_0x70f9('0x16')]));});});};exports[_0x70f9('0x20')]=function(_0x83e7d0){return new Promise(function(_0xdeca2,_0x308c14){return db[_0x70f9('0x18')]['find']({'where':_0x83e7d0[_0x70f9('0x1a')]?_0x83e7d0[_0x70f9('0x1a')][_0x70f9('0x1c')]||null:null})[_0x70f9('0x10')](function(_0x5d5d6a){if(_0x5d5d6a){return _0x5d5d6a[_0x70f9('0x21')](_0x83e7d0['body']['ids'],_[_0x70f9('0x22')](_0x83e7d0['body'],['ids','id'])||{});}})[_0x70f9('0x23')](function(_0x29d3a4){logger['info']('AddTags',_0x83e7d0);logger[_0x70f9('0x24')](_0x70f9('0x25'),_0x83e7d0,JSON[_0x70f9('0x1e')](_0x29d3a4));_0xdeca2(_0x29d3a4);})[_0x70f9('0x1f')](function(_0x2aa59b){logger[_0x70f9('0x15')]('AddTags',_0x2aa59b['message'],_0x83e7d0);_0x308c14(_this[_0x70f9('0x15')](0x1f4,_0x2aa59b[_0x70f9('0x16')]));});});}; \ No newline at end of file +var _0x2c58=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0x2c58,0x84));var _0x82c5=function(_0x26745a,_0x1771c7){_0x26745a=_0x26745a-0x0;var _0x7cc231=_0x2c58[_0x26745a];return _0x7cc231;};'use strict';var _=require(_0x82c5('0x0'));var util=require(_0x82c5('0x1'));var moment=require(_0x82c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x82c5('0x3'));var fs=require('fs');var Redis=require(_0x82c5('0x4'));var db=require(_0x82c5('0x5'))['db'];var utils=require(_0x82c5('0x6'));var logger=require(_0x82c5('0x7'))(_0x82c5('0x8'));var config=require(_0x82c5('0x9'));var jayson=require(_0x82c5('0xa'));var client=jayson[_0x82c5('0xb')][_0x82c5('0xc')]({'port':0x232a});config[_0x82c5('0xd')]=_[_0x82c5('0xe')](config[_0x82c5('0xd')],{'host':_0x82c5('0xf'),'port':0x18eb});var socket=require(_0x82c5('0x10'))(new Redis(config[_0x82c5('0xd')]));require(_0x82c5('0x11'))['register'](socket);function respondWithRpcPromise(_0x1c3622,_0x559f9a,_0x4231c0){return new BPromise(function(_0x5ec25d,_0x151d9f){return client[_0x82c5('0x12')](_0x1c3622,_0x4231c0)[_0x82c5('0x13')](function(_0x24203){logger[_0x82c5('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x559f9a,_0x82c5('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x559f9a,_0x82c5('0x15'),JSON['stringify'](_0x24203));if(_0x24203[_0x82c5('0x16')]){if(_0x24203[_0x82c5('0x16')][_0x82c5('0x17')]===0x1f4){logger[_0x82c5('0x16')](_0x82c5('0x18'),_0x559f9a,_0x24203[_0x82c5('0x16')][_0x82c5('0x19')]);return _0x151d9f(_0x24203[_0x82c5('0x16')][_0x82c5('0x19')]);}logger[_0x82c5('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x559f9a,_0x24203['error'][_0x82c5('0x19')]);return _0x5ec25d(_0x24203['error']['message']);}else{logger[_0x82c5('0x14')](_0x82c5('0x18'),_0x559f9a,_0x82c5('0x15'));_0x5ec25d(_0x24203[_0x82c5('0x1a')][_0x82c5('0x19')]);}})[_0x82c5('0x1b')](function(_0x5ec106){logger[_0x82c5('0x16')](_0x82c5('0x18'),_0x559f9a,_0x5ec106);_0x151d9f(_0x5ec106);});});}exports[_0x82c5('0x1c')]=function(_0x3757e0){var _0x4d3438=this;return new Promise(function(_0x59905f,_0xaae61c){return db[_0x82c5('0x1d')][_0x82c5('0x1e')](_0x3757e0[_0x82c5('0x1f')],{'raw':_0x3757e0[_0x82c5('0x20')]?_0x3757e0['options'][_0x82c5('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')][_0x82c5('0x22')]||null:null,'attributes':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')]['attributes']||null:null,'limit':_0x3757e0[_0x82c5('0x20')]?_0x3757e0[_0x82c5('0x20')][_0x82c5('0x23')]||null:null})[_0x82c5('0x13')](function(_0x5dc496){logger[_0x82c5('0x14')](_0x82c5('0x1c'),_0x3757e0);logger['debug']('UpdateChatInteraction',_0x3757e0,JSON[_0x82c5('0x24')](_0x5dc496));_0x59905f(_0x5dc496);})[_0x82c5('0x1b')](function(_0xfe3474){logger[_0x82c5('0x16')](_0x82c5('0x1c'),_0xfe3474[_0x82c5('0x19')],_0x3757e0);_0xaae61c(_0x4d3438[_0x82c5('0x16')](0x1f4,_0xfe3474[_0x82c5('0x19')]));});});};exports[_0x82c5('0x25')]=function(_0x5ed1a0){return new Promise(function(_0x484c29,_0x50f443){return db[_0x82c5('0x1d')][_0x82c5('0x26')]({'where':_0x5ed1a0['options']?_0x5ed1a0['options'][_0x82c5('0x22')]||null:null})[_0x82c5('0x13')](function(_0x31c316){if(_0x31c316){return _0x31c316[_0x82c5('0x27')](_0x5ed1a0[_0x82c5('0x1f')][_0x82c5('0x28')],_[_0x82c5('0x29')](_0x5ed1a0[_0x82c5('0x1f')],[_0x82c5('0x28'),'id'])||{});}})[_0x82c5('0x2a')](function(_0x24194b){logger[_0x82c5('0x14')]('AddTags',_0x5ed1a0);logger[_0x82c5('0x2b')](_0x82c5('0x2c'),_0x5ed1a0,JSON['stringify'](_0x24194b));_0x484c29(_0x24194b);})[_0x82c5('0x1b')](function(_0x3813a5){logger[_0x82c5('0x16')]('AddTags',_0x3813a5[_0x82c5('0x19')],_0x5ed1a0);_0x50f443(_this[_0x82c5('0x16')](0x1f4,_0x3813a5[_0x82c5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8927cf8..d60483a 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 _0x98ac=['remove','emit','register','length','chatInteraction:'];(function(_0x47f32a,_0x1dbe9b){var _0x22512d=function(_0x4874a0){while(--_0x4874a0){_0x47f32a['push'](_0x47f32a['shift']());}};_0x22512d(++_0x1dbe9b);}(_0x98ac,0x1d1));var _0xc98a=function(_0x14b1fa,_0x5aa6df){_0x14b1fa=_0x14b1fa-0x0;var _0x5cbea1=_0x98ac[_0x14b1fa];return _0x5cbea1;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc98a('0x0'),'update'];function createListener(_0x54c55e,_0x402f8a){return function(_0x434f17){_0x402f8a[_0xc98a('0x1')](_0x54c55e,_0x434f17);};}function removeListener(_0x141041,_0xe44835){return function(){ChatInteractionEvents['removeListener'](_0x141041,_0xe44835);};}exports[_0xc98a('0x2')]=function(_0x3e95c6){for(var _0x531dba=0x0,_0x22a165=events[_0xc98a('0x3')];_0x531dba<_0x22a165;_0x531dba++){var _0x3d9c82=events[_0x531dba];var _0x17fcf8=createListener(_0xc98a('0x4')+_0x3d9c82,_0x3e95c6);ChatInteractionEvents['on'](_0x3d9c82,_0x17fcf8);}}; \ No newline at end of file +var _0x3aca=['update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x31ae8c,_0x15dd90){var _0x30e30b=function(_0x33676b){while(--_0x33676b){_0x31ae8c['push'](_0x31ae8c['shift']());}};_0x30e30b(++_0x15dd90);}(_0x3aca,0x83));var _0xa3ac=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x3aca[_0x5b27da];return _0x3254f4;};'use strict';var ChatInteractionEvents=require(_0xa3ac('0x0'));var events=['save','remove',_0xa3ac('0x1')];function createListener(_0x2e1dde,_0x3e44a3){return function(_0x585e8f){_0x3e44a3[_0xa3ac('0x2')](_0x2e1dde,_0x585e8f);};}function removeListener(_0x1127ed,_0x520276){return function(){ChatInteractionEvents[_0xa3ac('0x3')](_0x1127ed,_0x520276);};}exports[_0xa3ac('0x4')]=function(_0x56c21d){for(var _0x219b27=0x0,_0x5d9b73=events['length'];_0x219b27<_0x5d9b73;_0x219b27++){var _0x389abc=events[_0x219b27];var _0x4da43d=createListener(_0xa3ac('0x5')+_0x389abc,_0x56c21d);ChatInteractionEvents['on'](_0x389abc,_0x4da43d);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index d0560c4..57a2b92 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 _0xcc17=['../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','format','now','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','/:id/abandon','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1fe0d4,_0x3e9d58){var _0x49675a=function(_0x1c96e9){while(--_0x1c96e9){_0x1fe0d4['push'](_0x1fe0d4['shift']());}};_0x49675a(++_0x3e9d58);}(_0xcc17,0x10e));var _0x7cc1=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xcc17[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var path=require(_0x7cc1('0x2'));var timeout=require('connect-timeout');var express=require(_0x7cc1('0x3'));var router=express[_0x7cc1('0x4')]();var fs_extra=require(_0x7cc1('0x5'));var auth=require(_0x7cc1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7cc1('0x7'));router[_0x7cc1('0x8')]('/',auth[_0x7cc1('0x9')](),controller['index']);router['get'](_0x7cc1('0xa'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0xb')]);router[_0x7cc1('0x8')](_0x7cc1('0xc'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0xe')]);router[_0x7cc1('0x8')](_0x7cc1('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0x7cc1('0x10'),auth[_0x7cc1('0x9')](),controller['getMessages']);router[_0x7cc1('0x8')](_0x7cc1('0x11'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x12')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7cc1('0x13')]);router[_0x7cc1('0x14')]('/',auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x15')]);router[_0x7cc1('0x14')](_0x7cc1('0x16'),auth['isAuthenticated'](),controller[_0x7cc1('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb5148a,_0x537b2d,_0x37beb7){_0x37beb7(null,path[_0x7cc1('0x18')](config['root'],'server/files/attachments/'));},'filename':function(_0x3f7fc5,_0x219443,_0x46b275){_0x46b275(null,util[_0x7cc1('0x19')]('%s-%s',Date[_0x7cc1('0x1a')](),_0x219443['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7cc1('0x1b'),upload[_0x7cc1('0x1c')](_0x7cc1('0x1d')),controller[_0x7cc1('0x1e')]);router['post'](_0x7cc1('0x10'),auth[_0x7cc1('0xd')](),controller[_0x7cc1('0x1f')]);router[_0x7cc1('0x14')]('/:id/tags',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x22')),controller[_0x7cc1('0x23')]);router[_0x7cc1('0x24')](_0x7cc1('0xc'),auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),'chatinteraction:update'),controller[_0x7cc1('0x25')]);router[_0x7cc1('0x24')](_0x7cc1('0x26'),controller['customUpdate']);router[_0x7cc1('0x24')](_0x7cc1('0x27'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x7cc1('0x24')]('/:id/close',controller['close']);router[_0x7cc1('0x28')]('/:id',auth[_0x7cc1('0x9')](),interaction[_0x7cc1('0x20')](_0x7cc1('0x21'),_0x7cc1('0x29')),controller[_0x7cc1('0x2a')]);router['delete'](_0x7cc1('0x2b'),auth[_0x7cc1('0x9')](),controller[_0x7cc1('0x2c')]);module[_0x7cc1('0x2d')]=router; \ No newline at end of file +var _0x15e2=['server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','get','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','post','create','createVidaooSession','join'];(function(_0x1ef48d,_0x19781c){var _0x25776c=function(_0x384d0e){while(--_0x384d0e){_0x1ef48d['push'](_0x1ef48d['shift']());}};_0x25776c(++_0x19781c);}(_0x15e2,0xfe));var _0x215e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x15e2[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0x215e('0x0'));var util=require(_0x215e('0x1'));var path=require(_0x215e('0x2'));var timeout=require('connect-timeout');var express=require(_0x215e('0x3'));var router=express[_0x215e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x215e('0x5'));var controller=require(_0x215e('0x6'));router['get']('/',auth[_0x215e('0x7')](),controller[_0x215e('0x8')]);router['get']('/describe',auth[_0x215e('0x7')](),controller[_0x215e('0x9')]);router['get'](_0x215e('0xa'),auth[_0x215e('0xb')](),controller[_0x215e('0xc')]);router[_0x215e('0xd')](_0x215e('0xe'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x215e('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x215e('0xf'),auth[_0x215e('0xb')](),controller[_0x215e('0x10')]);router[_0x215e('0xd')](_0x215e('0x11'),auth[_0x215e('0x7')](),controller['download']);router[_0x215e('0x12')]('/',auth['isAuthenticated'](),controller[_0x215e('0x13')]);router[_0x215e('0x12')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x215e('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d1d82,_0x224a3a,_0x1b5fff){_0x1b5fff(null,path[_0x215e('0x15')](config['root'],_0x215e('0x16')));},'filename':function(_0x2ad1f2,_0x8aa3e1,_0x128baf){_0x128baf(null,util[_0x215e('0x17')](_0x215e('0x18'),Date[_0x215e('0x19')](),_0x8aa3e1['originalname'][_0x215e('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x215e('0x1b'),upload[_0x215e('0x1c')](_0x215e('0x1d')),controller[_0x215e('0x1e')]);router[_0x215e('0x12')](_0x215e('0x1f'),auth[_0x215e('0xb')](),controller[_0x215e('0x20')]);router[_0x215e('0x12')](_0x215e('0x21'),auth[_0x215e('0x7')](),interaction[_0x215e('0x22')](_0x215e('0x23'),_0x215e('0x24')),controller['addTags']);router[_0x215e('0x25')](_0x215e('0xa'),auth[_0x215e('0x7')](),interaction[_0x215e('0x22')](_0x215e('0x23'),'chatinteraction:update'),controller['update']);router['put']('/:id/custom_update',controller[_0x215e('0x26')]);router['put']('/:id/abandon',auth[_0x215e('0xb')](),controller[_0x215e('0x27')]);router[_0x215e('0x25')](_0x215e('0x28'),controller[_0x215e('0x29')]);router[_0x215e('0x2a')](_0x215e('0xa'),auth[_0x215e('0x7')](),interaction['tracked'](_0x215e('0x23'),_0x215e('0x2b')),controller[_0x215e('0x2c')]);router[_0x215e('0x2a')](_0x215e('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0x215e('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index e3eb276..a3e5ed1 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 _0x2bc9=['TEXT','medium','sequelize','exports'];(function(_0x17590e,_0x426474){var _0x22884e=function(_0x1f9d5f){while(--_0x1f9d5f){_0x17590e['push'](_0x17590e['shift']());}};_0x22884e(++_0x426474);}(_0x2bc9,0x1d6));var _0x92bc=function(_0x2cdd4d,_0x394c2f){_0x2cdd4d=_0x2cdd4d-0x0;var _0x55cbc8=_0x2bc9[_0x2cdd4d];return _0x55cbc8;};'use strict';var Sequelize=require(_0x92bc('0x0'));module[_0x92bc('0x1')]={'body':{'type':Sequelize[_0x92bc('0x2')](_0x92bc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3c3c=['TEXT','sequelize','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3c3c,0x130));var _0xc3c3=function(_0x151dc6,_0x314721){_0x151dc6=_0x151dc6-0x0;var _0x25d2c1=_0x3c3c[_0x151dc6];return _0x25d2c1;};'use strict';var Sequelize=require(_0xc3c3('0x0'));module[_0xc3c3('0x1')]={'body':{'type':Sequelize[_0xc3c3('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 3627c8b..f274df0 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 _0x70ff=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','set','save','update','then','end','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','describe','get','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','resourceId','push','messages','ToId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x16c925,_0x16f4c3){var _0x54e4ca=function(_0x13597b){while(--_0x13597b){_0x16c925['push'](_0x16c925['shift']());}};_0x54e4ca(++_0x16f4c3);}(_0x70ff,0x12f));var _0xf70f=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x70ff[_0x8d8f23];return _0x22bf54;};'use strict';var emlformat=require(_0xf70f('0x0'));var rimraf=require(_0xf70f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf70f('0x2'));var rp=require(_0xf70f('0x3'));var moment=require(_0xf70f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf70f('0x5'));var util=require(_0xf70f('0x6'));var path=require('path');var sox=require(_0xf70f('0x7'));var csv=require('to-csv');var ejs=require(_0xf70f('0x8'));var fs=require('fs');var fs_extra=require(_0xf70f('0x9'));var _=require(_0xf70f('0xa'));var squel=require(_0xf70f('0xb'));var crypto=require(_0xf70f('0xc'));var jsforce=require(_0xf70f('0xd'));var deskjs=require(_0xf70f('0xe'));var toCsv=require(_0xf70f('0xf'));var querystring=require(_0xf70f('0x10'));var Papa=require(_0xf70f('0x11'));var Redis=require(_0xf70f('0x12'));var authService=require(_0xf70f('0x13'));var qs=require(_0xf70f('0x14'));var as=require(_0xf70f('0x15'));var hardwareService=require(_0xf70f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf70f('0x17'));var config=require(_0xf70f('0x18'));var licenseUtil=require(_0xf70f('0x19'));var db=require(_0xf70f('0x1a'))['db'];config[_0xf70f('0x1b')]=_[_0xf70f('0x1c')](config['redis'],{'host':_0xf70f('0x1d'),'port':0x18eb});var socket=require(_0xf70f('0x1e'))(new Redis(config[_0xf70f('0x1b')]));require(_0xf70f('0x1f'))[_0xf70f('0x20')](socket);function respondWithStatusCode(_0x36808b,_0x195827){_0x195827=_0x195827||0xcc;return function(_0x4257e9){if(_0x4257e9){return _0x36808b[_0xf70f('0x21')](_0x195827);}return _0x36808b[_0xf70f('0x22')](_0x195827)['end']();};}function respondWithResult(_0x159cdf,_0x38ba86){_0x38ba86=_0x38ba86||0xc8;return function(_0x3bfdb1){if(_0x3bfdb1){return _0x159cdf[_0xf70f('0x22')](_0x38ba86)[_0xf70f('0x23')](_0x3bfdb1);}};}function respondWithFilteredResult(_0x20177e,_0x1551a4){return function(_0x290314){if(_0x290314){var _0x516680=typeof _0x1551a4[_0xf70f('0x24')]===_0xf70f('0x25')&&typeof _0x1551a4['limit']==='undefined';var _0x41be77=_0x290314[_0xf70f('0x26')];var _0x378b57=_0x516680?0x0:_0x1551a4[_0xf70f('0x24')];var _0x2c1b3b=_0x516680?_0x290314[_0xf70f('0x26')]:_0x1551a4[_0xf70f('0x24')]+_0x1551a4['limit'];var _0x51f86d;if(_0x2c1b3b>=_0x41be77){_0x2c1b3b=_0x41be77;_0x51f86d=0xc8;}else{_0x51f86d=0xce;}_0x20177e['status'](_0x51f86d);return _0x20177e[_0xf70f('0x27')]('Content-Range',_0x378b57+'-'+_0x2c1b3b+'/'+_0x41be77)[_0xf70f('0x23')](_0x290314);}return null;};}function patchUpdates(_0x2189c2){return function(_0x7c71de){try{jsonpatch['apply'](_0x7c71de,_0x2189c2,!![]);}catch(_0x3afe13){return BPromise['reject'](_0x3afe13);}return _0x7c71de[_0xf70f('0x28')]();};}function saveUpdates(_0x4fd583,_0x553221){return function(_0x3e4bdc){if(_0x3e4bdc){return _0x3e4bdc[_0xf70f('0x29')](_0x4fd583)['then'](function(_0x3278c2){return _0x3278c2;});}return null;};}function removeEntity(_0x15949f,_0x2e6849){return function(_0x197d23){if(_0x197d23){return _0x197d23['destroy']()[_0xf70f('0x2a')](function(){_0x15949f[_0xf70f('0x22')](0xcc)[_0xf70f('0x2b')]();});}};}function handleEntityNotFound(_0xe88ba8,_0x17f8a3){return function(_0x3b0d31){if(!_0x3b0d31){_0xe88ba8['sendStatus'](0x194);}return _0x3b0d31;};}function handleError(_0x3e62cc,_0x43d1f5){_0x43d1f5=_0x43d1f5||0x1f4;return function(_0x5d9dcd){logger[_0xf70f('0x2c')](_0x5d9dcd[_0xf70f('0x2d')]);if(_0x5d9dcd['name']){delete _0x5d9dcd[_0xf70f('0x2e')];}_0x3e62cc[_0xf70f('0x22')](_0x43d1f5)[_0xf70f('0x2f')](_0x5d9dcd);};}exports[_0xf70f('0x30')]=function(_0x20e8fd,_0xb7eaa2){var _0x49732d={},_0x5b5e3c={},_0x424925={'count':0x0,'rows':[]};var _0x447b45=_['map'](db[_0xf70f('0x31')]['rawAttributes'],function(_0x5cfe54){return{'name':_0x5cfe54[_0xf70f('0x32')],'type':_0x5cfe54[_0xf70f('0x33')][_0xf70f('0x34')]};});_0x5b5e3c[_0xf70f('0x35')]=_[_0xf70f('0x36')](_0x447b45,_0xf70f('0x2e'));_0x5b5e3c[_0xf70f('0x37')]=_['keys'](_0x20e8fd['query']);_0x5b5e3c['filters']=_[_0xf70f('0x38')](_0x5b5e3c[_0xf70f('0x35')],_0x5b5e3c['query']);_0x49732d[_0xf70f('0x39')]=_['intersection'](_0x5b5e3c[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x20e8fd['query'][_0xf70f('0x3a')]));_0x49732d[_0xf70f('0x39')]=_0x49732d[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x49732d[_0xf70f('0x39')]:_0x5b5e3c[_0xf70f('0x35')];if(!_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x3c')](_0xf70f('0x3d'))){_0x49732d['limit']=qs['limit'](_0x20e8fd[_0xf70f('0x37')]['limit']);_0x49732d[_0xf70f('0x24')]=qs[_0xf70f('0x24')](_0x20e8fd['query'][_0xf70f('0x24')]);}_0x49732d['order']=qs[_0xf70f('0x3e')](_0x20e8fd['query']['sort']);_0x49732d['where']=qs[_0xf70f('0x3f')](_[_0xf70f('0x40')](_0x20e8fd[_0xf70f('0x37')],_0x5b5e3c[_0xf70f('0x3f')]),_0x447b45);if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]){_0x49732d[_0xf70f('0x42')]=_['merge'](_0x49732d[_0xf70f('0x42')],{'$or':_[_0xf70f('0x36')](_0x447b45,function(_0x16f3bc){if(_0x16f3bc[_0xf70f('0x33')]!==_0xf70f('0x43')){var _0x330a54={};_0x330a54[_0x16f3bc['name']]={'$like':'%'+_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x41')]+'%'};return _0x330a54;}})});}_0x49732d=_['merge']({},_0x49732d,_0x20e8fd['options']);var _0x36f549={'where':_0x49732d['where']};return db['ChatInternalMessage'][_0xf70f('0x26')](_0x36f549)[_0xf70f('0x2a')](function(_0x37ec2c){_0x424925['count']=_0x37ec2c;if(_0x20e8fd[_0xf70f('0x37')][_0xf70f('0x44')]){_0x49732d[_0xf70f('0x45')]=[{'all':!![]}];}return db[_0xf70f('0x31')][_0xf70f('0x46')](_0x49732d);})[_0xf70f('0x2a')](function(_0xbff51e){_0x424925[_0xf70f('0x47')]=_0xbff51e;return _0x424925;})['then'](respondWithFilteredResult(_0xb7eaa2,_0x49732d))['catch'](handleError(_0xb7eaa2,null));};exports[_0xf70f('0x48')]=function(_0x1cb4ce,_0x4088d9){var _0x73c4f6={'raw':!![],'where':{'id':_0x1cb4ce[_0xf70f('0x49')]['id']}},_0x597210={};_0x597210['model']=_[_0xf70f('0x4a')](db[_0xf70f('0x31')][_0xf70f('0x4b')]);_0x597210[_0xf70f('0x37')]=_[_0xf70f('0x4a')](_0x1cb4ce['query']);_0x597210[_0xf70f('0x3f')]=_[_0xf70f('0x38')](_0x597210[_0xf70f('0x35')],_0x597210['query']);_0x73c4f6[_0xf70f('0x39')]=_['intersection'](_0x597210[_0xf70f('0x35')],qs[_0xf70f('0x3a')](_0x1cb4ce[_0xf70f('0x37')][_0xf70f('0x3a')]));_0x73c4f6[_0xf70f('0x39')]=_0x73c4f6[_0xf70f('0x39')][_0xf70f('0x3b')]?_0x73c4f6[_0xf70f('0x39')]:_0x597210[_0xf70f('0x35')];if(_0x1cb4ce['query'][_0xf70f('0x44')]){_0x73c4f6[_0xf70f('0x45')]=[{'all':!![]}];}_0x73c4f6=_[_0xf70f('0x4c')]({},_0x73c4f6,_0x1cb4ce['options']);return db[_0xf70f('0x31')][_0xf70f('0x4d')](_0x73c4f6)[_0xf70f('0x2a')](handleEntityNotFound(_0x4088d9,null))[_0xf70f('0x2a')](respondWithResult(_0x4088d9,null))[_0xf70f('0x4e')](handleError(_0x4088d9,null));};exports[_0xf70f('0x4f')]=function(_0x3e5fce,_0x1873eb){return db[_0xf70f('0x31')][_0xf70f('0x4f')](_0x3e5fce[_0xf70f('0x50')],{})[_0xf70f('0x2a')](respondWithResult(_0x1873eb,0xc9))[_0xf70f('0x4e')](handleError(_0x1873eb,null));};exports[_0xf70f('0x29')]=function(_0x36e5bd,_0xe02d6b){if(_0x36e5bd[_0xf70f('0x50')]['id']){delete _0x36e5bd[_0xf70f('0x50')]['id'];}return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0x36e5bd[_0xf70f('0x49')]['id']}})['then'](handleEntityNotFound(_0xe02d6b,null))['then'](saveUpdates(_0x36e5bd[_0xf70f('0x50')],null))[_0xf70f('0x2a')](respondWithResult(_0xe02d6b,null))[_0xf70f('0x4e')](handleError(_0xe02d6b,null));};exports['destroy']=function(_0xa792fe,_0x497144){return db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'id':_0xa792fe[_0xf70f('0x49')]['id']}})[_0xf70f('0x2a')](handleEntityNotFound(_0x497144,null))[_0xf70f('0x2a')](removeEntity(_0x497144,null))[_0xf70f('0x4e')](handleError(_0x497144,null));};exports['describe']=function(_0x2f8f2e,_0x4cc7c7){return db[_0xf70f('0x31')][_0xf70f('0x51')]()[_0xf70f('0x2a')](respondWithResult(_0x4cc7c7,null))[_0xf70f('0x4e')](handleError(_0x4cc7c7,null));};function wrapUser(_0x530998){return function(_0x58cdc5){var _0x4d167e=_0x530998[_0xf70f('0x52')]({'plain':!![]});_0x4d167e['messages']=[];if(_0x58cdc5){_0x4d167e[_0xf70f('0x53')]=_0x58cdc5[_0xf70f('0x54')];_0x4d167e[_0xf70f('0x55')]=_0x58cdc5;}else{_0x4d167e['lastMessageAt']=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4d167e[_0xf70f('0x55')]={};}return _0x4d167e;};}exports[_0xf70f('0x56')]=function(_0x4fc3d,_0x7e5976,_0x5bdac3){var _0x11cd5f=[];return db[_0xf70f('0x57')][_0xf70f('0x46')]({'where':{'role':[_0xf70f('0x58'),_0xf70f('0x59'),'user']},'attributes':['id',_0xf70f('0x5a'),_0xf70f('0x2e'),'role','userpic',_0xf70f('0x5b'),_0xf70f('0x5c'),_0xf70f('0x5d'),_0xf70f('0x5e'),_0xf70f('0x5f')],'order':qs['sort']('-online'),'include':[{'model':db[_0xf70f('0x60')],'as':_0xf70f('0x61'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xf70f('0x2a')](function(_0x3a582b){if(_0x3a582b){var _0x4f02ba=_0x4fc3d[_0xf70f('0x62')]['get']({'plain':!![]});if(!_0x4f02ba)throw new Error(_0xf70f('0x63'));if(_0x4f02ba[_0xf70f('0x64')]===_0xf70f('0x62')){return db[_0xf70f('0x65')]['find']({'where':{'name':'Agents','userProfileId':_0x4f02ba['userProfileId']},'raw':!![]})[_0xf70f('0x2a')](function(_0x316e5c){if(_0x316e5c){if(_0x316e5c[_0xf70f('0x66')]===0x0){return db['UserProfileResource'][_0xf70f('0x46')]({'where':{'sectionId':_0x316e5c['id']},'raw':!![]})[_0xf70f('0x2a')](function(_0x4bd7a7){var _0x279d93=[];if(_['isEmpty'](_0x4bd7a7)){_0x279d93=_['filter'](_0x3a582b,function(_0x19559a){if(_0x19559a[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x19559a;}});return _0x279d93;}else{for(var _0x2a6729=0x0;_0x2a6729<_0x3a582b[_0xf70f('0x3b')];_0x2a6729++){var _0x5c2683=_0x3a582b[_0x2a6729];if(_0x5c2683[_0xf70f('0x64')]===_0xf70f('0x58')){var _0x4ab6af=_[_0xf70f('0x4d')](_0x4bd7a7,function(_0x55ef53){return _0x55ef53[_0xf70f('0x67')]===_0x5c2683['id'];});if(_0x4ab6af)_0x279d93['push'](_0x5c2683);}else{_0x279d93[_0xf70f('0x68')](_0x5c2683);}}return _0x279d93;}});}else{return _0x3a582b;}}else{var _0x1b23cb=_['filter'](_0x3a582b,function(_0x27aa59){if(_0x27aa59[_0xf70f('0x64')]!==_0xf70f('0x58')){return _0x27aa59;}});return _0x1b23cb;}});}else{return _0x3a582b;}}})[_0xf70f('0x2a')](function(_0x40e4bf){var _0xea8cc1=[];if(_0x40e4bf){_0x11cd5f=_0x40e4bf;for(var _0x4af2b0=0x0;_0x4af2b0<_0x40e4bf[_0xf70f('0x3b')];_0x4af2b0+=0x1){_0x11cd5f[_0x4af2b0][_0xf70f('0x69')]=[];_0xea8cc1[_0xf70f('0x68')](db[_0xf70f('0x31')][_0xf70f('0x4d')]({'where':{'FromId':[_0x4fc3d[_0xf70f('0x62')]['id'],_0x40e4bf[_0x4af2b0]['id']],'ToId':[_0x4fc3d['user']['id'],_0x40e4bf[_0x4af2b0]['id']],'ChatGroupId':null},'attributes':['id',_0xf70f('0x54'),'FromId',_0xf70f('0x6a'),_0xf70f('0x6b'),_0xf70f('0x50')],'order':qs['sort'](_0xf70f('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf70f('0x2a')](wrapUser(_0x40e4bf[_0x4af2b0])));}return BPromise['all'](_0xea8cc1);}return[];})[_0xf70f('0x2a')](function(_0x523d0d){return{'rows':_0x523d0d,'count':_0x523d0d[_0xf70f('0x3b')]};})[_0xf70f('0x2a')](respondWithResult(_0x7e5976,null))[_0xf70f('0x4e')](handleError(_0x7e5976,null));}; \ No newline at end of file +var _0xd2ce=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','update','body','destroy','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','role','showWebBar','-online'];(function(_0x4bbada,_0x11a75c){var _0x4b0cfa=function(_0x56a719){while(--_0x56a719){_0x4bbada['push'](_0x4bbada['shift']());}};_0x4b0cfa(++_0x11a75c);}(_0xd2ce,0x14a));var _0xed2c=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd2ce[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xed2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed2c('0x1'));var jsonpatch=require(_0xed2c('0x2'));var rp=require(_0xed2c('0x3'));var moment=require(_0xed2c('0x4'));var BPromise=require(_0xed2c('0x5'));var Mustache=require(_0xed2c('0x6'));var util=require('util');var path=require(_0xed2c('0x7'));var sox=require('sox');var csv=require(_0xed2c('0x8'));var ejs=require(_0xed2c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed2c('0xa'));var squel=require(_0xed2c('0xb'));var crypto=require(_0xed2c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed2c('0xd'));var toCsv=require(_0xed2c('0x8'));var querystring=require(_0xed2c('0xe'));var Papa=require(_0xed2c('0xf'));var Redis=require(_0xed2c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed2c('0x11'));var as=require(_0xed2c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed2c('0x13'))(_0xed2c('0x14'));var utils=require(_0xed2c('0x15'));var config=require(_0xed2c('0x16'));var licenseUtil=require(_0xed2c('0x17'));var db=require(_0xed2c('0x18'))['db'];config['redis']=_[_0xed2c('0x19')](config[_0xed2c('0x1a')],{'host':_0xed2c('0x1b'),'port':0x18eb});var socket=require(_0xed2c('0x1c'))(new Redis(config[_0xed2c('0x1a')]));require(_0xed2c('0x1d'))[_0xed2c('0x1e')](socket);function respondWithStatusCode(_0x45b7cb,_0x522056){_0x522056=_0x522056||0xcc;return function(_0x320323){if(_0x320323){return _0x45b7cb['sendStatus'](_0x522056);}return _0x45b7cb['status'](_0x522056)[_0xed2c('0x1f')]();};}function respondWithResult(_0x184aa6,_0x12fc1e){_0x12fc1e=_0x12fc1e||0xc8;return function(_0x514c4b){if(_0x514c4b){return _0x184aa6[_0xed2c('0x20')](_0x12fc1e)[_0xed2c('0x21')](_0x514c4b);}};}function respondWithFilteredResult(_0x454728,_0x2ff6dc){return function(_0x122a73){if(_0x122a73){var _0xbe10c2=typeof _0x2ff6dc['offset']==='undefined'&&typeof _0x2ff6dc['limit']===_0xed2c('0x22');var _0x1abe1c=_0x122a73[_0xed2c('0x23')];var _0x12b990=_0xbe10c2?0x0:_0x2ff6dc[_0xed2c('0x24')];var _0x16779e=_0xbe10c2?_0x122a73[_0xed2c('0x23')]:_0x2ff6dc[_0xed2c('0x24')]+_0x2ff6dc[_0xed2c('0x25')];var _0x12504b;if(_0x16779e>=_0x1abe1c){_0x16779e=_0x1abe1c;_0x12504b=0xc8;}else{_0x12504b=0xce;}_0x454728['status'](_0x12504b);return _0x454728[_0xed2c('0x26')](_0xed2c('0x27'),_0x12b990+'-'+_0x16779e+'/'+_0x1abe1c)[_0xed2c('0x21')](_0x122a73);}return null;};}function patchUpdates(_0x26bde3){return function(_0x57eb11){try{jsonpatch['apply'](_0x57eb11,_0x26bde3,!![]);}catch(_0x5717bf){return BPromise[_0xed2c('0x28')](_0x5717bf);}return _0x57eb11[_0xed2c('0x29')]();};}function saveUpdates(_0x2cc46f,_0x79dc6e){return function(_0x229587){if(_0x229587){return _0x229587['update'](_0x2cc46f)[_0xed2c('0x2a')](function(_0x8c77a){return _0x8c77a;});}return null;};}function removeEntity(_0x1ec8f5,_0x2aa194){return function(_0x4b2e4f){if(_0x4b2e4f){return _0x4b2e4f['destroy']()[_0xed2c('0x2a')](function(){_0x1ec8f5[_0xed2c('0x20')](0xcc)[_0xed2c('0x1f')]();});}};}function handleEntityNotFound(_0x28449e,_0x19dc62){return function(_0x1230cc){if(!_0x1230cc){_0x28449e[_0xed2c('0x2b')](0x194);}return _0x1230cc;};}function handleError(_0x1f71fd,_0x17b2e0){_0x17b2e0=_0x17b2e0||0x1f4;return function(_0x4178c9){logger[_0xed2c('0x2c')](_0x4178c9[_0xed2c('0x2d')]);if(_0x4178c9[_0xed2c('0x2e')]){delete _0x4178c9['name'];}_0x1f71fd[_0xed2c('0x20')](_0x17b2e0)['send'](_0x4178c9);};}exports['index']=function(_0x41a434,_0x4534f7){var _0x1d3e58={},_0x2b02ea={},_0xb0eca7={'count':0x0,'rows':[]};var _0x20650e=_[_0xed2c('0x2f')](db[_0xed2c('0x30')][_0xed2c('0x31')],function(_0x2005ce){return{'name':_0x2005ce[_0xed2c('0x32')],'type':_0x2005ce[_0xed2c('0x33')][_0xed2c('0x34')]};});_0x2b02ea['model']=_[_0xed2c('0x2f')](_0x20650e,_0xed2c('0x2e'));_0x2b02ea[_0xed2c('0x35')]=_[_0xed2c('0x36')](_0x41a434[_0xed2c('0x35')]);_0x2b02ea['filters']=_['intersection'](_0x2b02ea[_0xed2c('0x37')],_0x2b02ea[_0xed2c('0x35')]);_0x1d3e58[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x2b02ea[_0xed2c('0x37')],qs[_0xed2c('0x3a')](_0x41a434['query'][_0xed2c('0x3a')]));_0x1d3e58[_0xed2c('0x38')]=_0x1d3e58[_0xed2c('0x38')]['length']?_0x1d3e58[_0xed2c('0x38')]:_0x2b02ea[_0xed2c('0x37')];if(!_0x41a434[_0xed2c('0x35')][_0xed2c('0x3b')](_0xed2c('0x3c'))){_0x1d3e58[_0xed2c('0x25')]=qs['limit'](_0x41a434[_0xed2c('0x35')][_0xed2c('0x25')]);_0x1d3e58['offset']=qs[_0xed2c('0x24')](_0x41a434[_0xed2c('0x35')][_0xed2c('0x24')]);}_0x1d3e58['order']=qs['sort'](_0x41a434['query'][_0xed2c('0x3d')]);_0x1d3e58[_0xed2c('0x3e')]=qs[_0xed2c('0x3f')](_[_0xed2c('0x40')](_0x41a434[_0xed2c('0x35')],_0x2b02ea[_0xed2c('0x3f')]),_0x20650e);if(_0x41a434[_0xed2c('0x35')][_0xed2c('0x41')]){_0x1d3e58[_0xed2c('0x3e')]=_[_0xed2c('0x42')](_0x1d3e58[_0xed2c('0x3e')],{'$or':_[_0xed2c('0x2f')](_0x20650e,function(_0x5caa2c){if(_0x5caa2c['type']!==_0xed2c('0x43')){var _0xf1a8b7={};_0xf1a8b7[_0x5caa2c['name']]={'$like':'%'+_0x41a434[_0xed2c('0x35')]['filter']+'%'};return _0xf1a8b7;}})});}_0x1d3e58=_[_0xed2c('0x42')]({},_0x1d3e58,_0x41a434[_0xed2c('0x44')]);var _0x30a1ae={'where':_0x1d3e58[_0xed2c('0x3e')]};return db[_0xed2c('0x30')][_0xed2c('0x23')](_0x30a1ae)[_0xed2c('0x2a')](function(_0x56fe58){_0xb0eca7[_0xed2c('0x23')]=_0x56fe58;if(_0x41a434['query'][_0xed2c('0x45')]){_0x1d3e58[_0xed2c('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xed2c('0x47')](_0x1d3e58);})[_0xed2c('0x2a')](function(_0x573c58){_0xb0eca7['rows']=_0x573c58;return _0xb0eca7;})[_0xed2c('0x2a')](respondWithFilteredResult(_0x4534f7,_0x1d3e58))[_0xed2c('0x48')](handleError(_0x4534f7,null));};exports[_0xed2c('0x49')]=function(_0x55504e,_0x8651c2){var _0x2f6a63={'raw':!![],'where':{'id':_0x55504e['params']['id']}},_0x27f98b={};_0x27f98b[_0xed2c('0x37')]=_[_0xed2c('0x36')](db[_0xed2c('0x30')][_0xed2c('0x31')]);_0x27f98b[_0xed2c('0x35')]=_[_0xed2c('0x36')](_0x55504e['query']);_0x27f98b[_0xed2c('0x3f')]=_[_0xed2c('0x39')](_0x27f98b[_0xed2c('0x37')],_0x27f98b[_0xed2c('0x35')]);_0x2f6a63[_0xed2c('0x38')]=_[_0xed2c('0x39')](_0x27f98b[_0xed2c('0x37')],qs[_0xed2c('0x3a')](_0x55504e[_0xed2c('0x35')][_0xed2c('0x3a')]));_0x2f6a63[_0xed2c('0x38')]=_0x2f6a63[_0xed2c('0x38')][_0xed2c('0x4a')]?_0x2f6a63[_0xed2c('0x38')]:_0x27f98b[_0xed2c('0x37')];if(_0x55504e[_0xed2c('0x35')]['includeAll']){_0x2f6a63[_0xed2c('0x46')]=[{'all':!![]}];}_0x2f6a63=_[_0xed2c('0x42')]({},_0x2f6a63,_0x55504e[_0xed2c('0x44')]);return db[_0xed2c('0x30')][_0xed2c('0x4b')](_0x2f6a63)['then'](handleEntityNotFound(_0x8651c2,null))['then'](respondWithResult(_0x8651c2,null))[_0xed2c('0x48')](handleError(_0x8651c2,null));};exports['create']=function(_0x3d7862,_0x209176){return db[_0xed2c('0x30')][_0xed2c('0x4c')](_0x3d7862['body'],{})['then'](respondWithResult(_0x209176,0xc9))['catch'](handleError(_0x209176,null));};exports[_0xed2c('0x4d')]=function(_0x3d69da,_0x1a345e){if(_0x3d69da[_0xed2c('0x4e')]['id']){delete _0x3d69da[_0xed2c('0x4e')]['id'];}return db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'id':_0x3d69da['params']['id']}})[_0xed2c('0x2a')](handleEntityNotFound(_0x1a345e,null))[_0xed2c('0x2a')](saveUpdates(_0x3d69da['body'],null))[_0xed2c('0x2a')](respondWithResult(_0x1a345e,null))[_0xed2c('0x48')](handleError(_0x1a345e,null));};exports[_0xed2c('0x4f')]=function(_0x44b423,_0x3fea9f){return db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'id':_0x44b423['params']['id']}})[_0xed2c('0x2a')](handleEntityNotFound(_0x3fea9f,null))[_0xed2c('0x2a')](removeEntity(_0x3fea9f,null))[_0xed2c('0x48')](handleError(_0x3fea9f,null));};exports[_0xed2c('0x50')]=function(_0x4bc082,_0x2e1ec8){return db[_0xed2c('0x30')]['describe']()[_0xed2c('0x2a')](respondWithResult(_0x2e1ec8,null))[_0xed2c('0x48')](handleError(_0x2e1ec8,null));};function wrapUser(_0x2e48e4){return function(_0x16fc12){var _0x1726dd=_0x2e48e4[_0xed2c('0x51')]({'plain':!![]});_0x1726dd[_0xed2c('0x52')]=[];if(_0x16fc12){_0x1726dd[_0xed2c('0x53')]=_0x16fc12[_0xed2c('0x54')];_0x1726dd['lastMessage']=_0x16fc12;}else{_0x1726dd[_0xed2c('0x53')]=moment(0x0)[_0xed2c('0x55')](_0xed2c('0x56'));_0x1726dd[_0xed2c('0x57')]={};}return _0x1726dd;};}exports['getUsers']=function(_0x4dd2ce,_0x39ce2b,_0x2d558b){var _0x535797=[];return db[_0xed2c('0x58')][_0xed2c('0x47')]({'where':{'role':[_0xed2c('0x59'),_0xed2c('0x5a'),'user']},'attributes':['id','fullname','name',_0xed2c('0x5b'),'userpic','internal','online','lastLoginAt','allowmessenger',_0xed2c('0x5c')],'order':qs['sort'](_0xed2c('0x5d')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0xed2c('0x33')],'through':{'attributes':[]}}]})[_0xed2c('0x2a')](function(_0x364f07){if(_0x364f07){var _0x1f6a9e=_0x4dd2ce[_0xed2c('0x5e')]['get']({'plain':!![]});if(!_0x1f6a9e)throw new Error(_0xed2c('0x5f'));if(_0x1f6a9e[_0xed2c('0x5b')]===_0xed2c('0x5e')){return db[_0xed2c('0x60')][_0xed2c('0x4b')]({'where':{'name':_0xed2c('0x61'),'userProfileId':_0x1f6a9e['userProfileId']},'raw':!![]})[_0xed2c('0x2a')](function(_0x5ae8bc){if(_0x5ae8bc){if(_0x5ae8bc[_0xed2c('0x62')]===0x0){return db[_0xed2c('0x63')][_0xed2c('0x47')]({'where':{'sectionId':_0x5ae8bc['id']},'raw':!![]})[_0xed2c('0x2a')](function(_0x591c66){var _0x19c49c=[];if(_['isEmpty'](_0x591c66)){_0x19c49c=_['filter'](_0x364f07,function(_0x5439ac){if(_0x5439ac['role']!==_0xed2c('0x59')){return _0x5439ac;}});return _0x19c49c;}else{for(var _0x11bdb2=0x0;_0x11bdb2<_0x364f07['length'];_0x11bdb2++){var _0x51e5e2=_0x364f07[_0x11bdb2];if(_0x51e5e2[_0xed2c('0x5b')]==='agent'){var _0x36f59d=_[_0xed2c('0x4b')](_0x591c66,function(_0x1b32b8){return _0x1b32b8[_0xed2c('0x64')]===_0x51e5e2['id'];});if(_0x36f59d)_0x19c49c['push'](_0x51e5e2);}else{_0x19c49c[_0xed2c('0x65')](_0x51e5e2);}}return _0x19c49c;}});}else{return _0x364f07;}}else{var _0x1aaf84=_[_0xed2c('0x41')](_0x364f07,function(_0x5f1c88){if(_0x5f1c88[_0xed2c('0x5b')]!==_0xed2c('0x59')){return _0x5f1c88;}});return _0x1aaf84;}});}else{return _0x364f07;}}})[_0xed2c('0x2a')](function(_0x2f0040){var _0x25f4f9=[];if(_0x2f0040){_0x535797=_0x2f0040;for(var _0x124621=0x0;_0x124621<_0x2f0040[_0xed2c('0x4a')];_0x124621+=0x1){_0x535797[_0x124621][_0xed2c('0x52')]=[];_0x25f4f9[_0xed2c('0x65')](db[_0xed2c('0x30')][_0xed2c('0x4b')]({'where':{'FromId':[_0x4dd2ce['user']['id'],_0x2f0040[_0x124621]['id']],'ToId':[_0x4dd2ce[_0xed2c('0x5e')]['id'],_0x2f0040[_0x124621]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xed2c('0x66'),_0xed2c('0x67'),_0xed2c('0x68'),'body'],'order':qs[_0xed2c('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xed2c('0x2a')](wrapUser(_0x2f0040[_0x124621])));}return BPromise[_0xed2c('0x69')](_0x25f4f9);}return[];})[_0xed2c('0x2a')](function(_0x273149){return{'rows':_0x273149,'count':_0x273149[_0xed2c('0x4a')]};})[_0xed2c('0x2a')](respondWithResult(_0x39ce2b,null))[_0xed2c('0x48')](handleError(_0x39ce2b,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index bb2c476..2163849 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 _0x6043=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x19006e,_0x554f02){var _0x2d8060=function(_0x30447d){while(--_0x30447d){_0x19006e['push'](_0x19006e['shift']());}};_0x2d8060(++_0x554f02);}(_0x6043,0x185));var _0x3604=function(_0x73f87f,_0x2eb5c5){_0x73f87f=_0x73f87f-0x0;var _0x11899b=_0x6043[_0x73f87f];return _0x11899b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3604('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3604('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3604('0x2'),'afterDestroy':_0x3604('0x3')};function emitEvent(_0x5364a8){return function(_0x506e20,_0x6735da,_0x46d3b3){ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8+':'+_0x506e20['id'],_0x506e20);ChatInternalMessageEvents[_0x3604('0x4')](_0x5364a8,_0x506e20);_0x46d3b3(null);};}for(var e in events){if(events[_0x3604('0x5')](e)){var event=events[e];ChatInternalMessage[_0x3604('0x6')](e,emitEvent(event));}}module[_0x3604('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa0a3=['hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x341569,_0x1edec3){var _0x2cb5c7=function(_0x50dafc){while(--_0x50dafc){_0x341569['push'](_0x341569['shift']());}};_0x2cb5c7(++_0x1edec3);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x98fd67,_0x4abe55){_0x98fd67=_0x98fd67-0x0;var _0x15b8c3=_0xa0a3[_0x98fd67];return _0x15b8c3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3a0a('0x0'))['db'][_0x3a0a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3a0a('0x2'),'afterUpdate':_0x3a0a('0x3'),'afterDestroy':_0x3a0a('0x4')};function emitEvent(_0x438f82){return function(_0x4f9090,_0x7f2ad7,_0xded829){ChatInternalMessageEvents[_0x3a0a('0x5')](_0x438f82+':'+_0x4f9090['id'],_0x4f9090);ChatInternalMessageEvents[_0x3a0a('0x5')](_0x438f82,_0x4f9090);_0xded829(null);};}for(var e in events){if(events[_0x3a0a('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3a0a('0x7')](e,emitEvent(event));}}module[_0x3a0a('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 53eab5f..39fc00a 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 _0x719f=['chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','./chatInternalMessage.attributes','exports','define'];(function(_0x14081a,_0x36ee7c){var _0x1313cf=function(_0x2fae2e){while(--_0x2fae2e){_0x14081a['push'](_0x14081a['shift']());}};_0x1313cf(++_0x36ee7c);}(_0x719f,0x70));var _0xf719=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x719f[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0xf719('0x0'));var util=require(_0xf719('0x1'));var logger=require(_0xf719('0x2'))(_0xf719('0x3'));var moment=require('moment');var BPromise=require(_0xf719('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf719('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf719('0x6'));module[_0xf719('0x7')]=function(_0x4df7ac,_0x5e3ad0){return _0x4df7ac[_0xf719('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xf719('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf719('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x89e0=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2af6f0,_0x1e50a3){var _0x4de96f=function(_0x2ba1a2){while(--_0x2ba1a2){_0x2af6f0['push'](_0x2af6f0['shift']());}};_0x4de96f(++_0x1e50a3);}(_0x89e0,0x119));var _0x089e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x89e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x089e('0x0'));var util=require(_0x089e('0x1'));var logger=require(_0x089e('0x2'))('api');var moment=require(_0x089e('0x3'));var BPromise=require(_0x089e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x089e('0x5'));var rimraf=require(_0x089e('0x6'));var config=require(_0x089e('0x7'));var attributes=require(_0x089e('0x8'));module['exports']=function(_0x2f2a65,_0x1c94c4){return _0x2f2a65['define'](_0x089e('0x9'),attributes,{'tableName':_0x089e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x089e('0xb'),'collate':_0x089e('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a2a626d..b2c612f 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 _0xeb6a=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x482c19,_0x456e39){var _0x57dc03=function(_0x23ebed){while(--_0x23ebed){_0x482c19['push'](_0x482c19['shift']());}};_0x57dc03(++_0x456e39);}(_0xeb6a,0x1f4));var _0xaeb6=function(_0x52decf,_0x1bd6bc){_0x52decf=_0x52decf-0x0;var _0x43e3cd=_0xeb6a[_0x52decf];return _0x43e3cd;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var moment=require(_0xaeb6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb6('0x3'));var db=require(_0xaeb6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb6('0x5'))(_0xaeb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xaeb6('0x7'));var client=jayson[_0xaeb6('0x8')][_0xaeb6('0x9')]({'port':0x232a});config[_0xaeb6('0xa')]=_[_0xaeb6('0xb')](config[_0xaeb6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaeb6('0xc'))(new Redis(config['redis']));require(_0xaeb6('0xd'))['register'](socket);function respondWithRpcPromise(_0x315ec7,_0x49f280,_0x5d996d){return new BPromise(function(_0x150386,_0x3048bf){return client[_0xaeb6('0xe')](_0x315ec7,_0x5d996d)[_0xaeb6('0xf')](function(_0x5efe69){logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));logger[_0xaeb6('0x13')](_0xaeb6('0x14'),_0x49f280,'request\x20sent',JSON[_0xaeb6('0x15')](_0x5efe69));if(_0x5efe69['error']){if(_0x5efe69['error'][_0xaeb6('0x16')]===0x1f4){logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69[_0xaeb6('0x17')]['message']);return _0x3048bf(_0x5efe69[_0xaeb6('0x17')]['message']);}logger[_0xaeb6('0x17')](_0xaeb6('0x11'),_0x49f280,_0x5efe69['error'][_0xaeb6('0x18')]);return _0x150386(_0x5efe69[_0xaeb6('0x17')]['message']);}else{logger[_0xaeb6('0x10')](_0xaeb6('0x11'),_0x49f280,_0xaeb6('0x12'));_0x150386(_0x5efe69['result'][_0xaeb6('0x18')]);}})[_0xaeb6('0x19')](function(_0x199017){logger[_0xaeb6('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x49f280,_0x199017);_0x3048bf(_0x199017);});});} \ No newline at end of file +var _0x8ae5=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x2ee857,_0x51a024){var _0x53ea56=function(_0x5285c4){while(--_0x5285c4){_0x2ee857['push'](_0x2ee857['shift']());}};_0x53ea56(++_0x51a024);}(_0x8ae5,0x1dd));var _0x58ae=function(_0x28e4ea,_0x4856fd){_0x28e4ea=_0x28e4ea-0x0;var _0x545c63=_0x8ae5[_0x28e4ea];return _0x545c63;};'use strict';var _=require(_0x58ae('0x0'));var util=require(_0x58ae('0x1'));var moment=require(_0x58ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x58ae('0x3'));var fs=require('fs');var Redis=require(_0x58ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58ae('0x5'));var logger=require(_0x58ae('0x6'))(_0x58ae('0x7'));var config=require('../../config/environment');var jayson=require(_0x58ae('0x8'));var client=jayson[_0x58ae('0x9')][_0x58ae('0xa')]({'port':0x232a});config[_0x58ae('0xb')]=_[_0x58ae('0xc')](config[_0x58ae('0xb')],{'host':_0x58ae('0xd'),'port':0x18eb});var socket=require(_0x58ae('0xe'))(new Redis(config[_0x58ae('0xb')]));require(_0x58ae('0xf'))[_0x58ae('0x10')](socket);function respondWithRpcPromise(_0x5ecabb,_0x306322,_0x10e440){return new BPromise(function(_0x2d6560,_0x2a8dec){return client[_0x58ae('0x11')](_0x5ecabb,_0x10e440)[_0x58ae('0x12')](function(_0x241363){logger[_0x58ae('0x13')](_0x58ae('0x14'),_0x306322,_0x58ae('0x15'));logger[_0x58ae('0x16')](_0x58ae('0x17'),_0x306322,_0x58ae('0x15'),JSON[_0x58ae('0x18')](_0x241363));if(_0x241363[_0x58ae('0x19')]){if(_0x241363[_0x58ae('0x19')][_0x58ae('0x1a')]===0x1f4){logger['error'](_0x58ae('0x14'),_0x306322,_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);return _0x2a8dec(_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);}logger[_0x58ae('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x306322,_0x241363[_0x58ae('0x19')]['message']);return _0x2d6560(_0x241363[_0x58ae('0x19')][_0x58ae('0x1b')]);}else{logger[_0x58ae('0x13')](_0x58ae('0x14'),_0x306322,'request\x20sent');_0x2d6560(_0x241363['result']['message']);}})[_0x58ae('0x1c')](function(_0xb242bf){logger[_0x58ae('0x19')](_0x58ae('0x14'),_0x306322,_0xb242bf);_0x2a8dec(_0xb242bf);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 288c956..f97ea89 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 _0x9a5b=['removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x4f51ca,_0x568e79){var _0x1c0d86=function(_0x5648ae){while(--_0x5648ae){_0x4f51ca['push'](_0x4f51ca['shift']());}};_0x1c0d86(++_0x568e79);}(_0x9a5b,0x1d0));var _0xb9a5=function(_0xdd5006,_0x178b90){_0xdd5006=_0xdd5006-0x0;var _0x3aecea=_0x9a5b[_0xdd5006];return _0x3aecea;};'use strict';var ChatInternalMessageEvents=require(_0xb9a5('0x0'));var events=[_0xb9a5('0x1'),_0xb9a5('0x2'),_0xb9a5('0x3')];function createListener(_0x3206f1,_0xdd6be){return function(_0x2790f6){_0xdd6be['emit'](_0x3206f1,_0x2790f6);};}function removeListener(_0x293e22,_0x562561){return function(){ChatInternalMessageEvents[_0xb9a5('0x4')](_0x293e22,_0x562561);};}exports['register']=function(_0x3af0e1){for(var _0x3a541e=0x0,_0x3e7508=events['length'];_0x3a541e<_0x3e7508;_0x3a541e++){var _0x1c2435=events[_0x3a541e];var _0x6143ea=createListener(_0xb9a5('0x5')+_0x1c2435,_0x3af0e1);ChatInternalMessageEvents['on'](_0x1c2435,_0x6143ea);}}; \ No newline at end of file +var _0x4472=['./chatInternalMessage.events','save','emit','removeListener','register','chatInternalMessage:'];(function(_0x12b35d,_0x5f3569){var _0x4eb62c=function(_0x564692){while(--_0x564692){_0x12b35d['push'](_0x12b35d['shift']());}};_0x4eb62c(++_0x5f3569);}(_0x4472,0x108));var _0x2447=function(_0x367dbd,_0x106eba){_0x367dbd=_0x367dbd-0x0;var _0x3ddb21=_0x4472[_0x367dbd];return _0x3ddb21;};'use strict';var ChatInternalMessageEvents=require(_0x2447('0x0'));var events=[_0x2447('0x1'),'remove','update'];function createListener(_0xc42efc,_0x55ceba){return function(_0x14bd41){_0x55ceba[_0x2447('0x2')](_0xc42efc,_0x14bd41);};}function removeListener(_0xd22153,_0x27471a){return function(){ChatInternalMessageEvents[_0x2447('0x3')](_0xd22153,_0x27471a);};}exports[_0x2447('0x4')]=function(_0x803e8f){for(var _0x310652=0x0,_0x48081a=events['length'];_0x310652<_0x48081a;_0x310652++){var _0x3d3c7d=events[_0x310652];var _0x333bf2=createListener(_0x2447('0x5')+_0x3d3c7d,_0x803e8f);ChatInternalMessageEvents['on'](_0x3d3c7d,_0x333bf2);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4d27862..ccbab14 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 _0xe2a6=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','post','put','/:id','update','delete','destroy','exports','util'];(function(_0x1ed0e1,_0x45098f){var _0x12b97f=function(_0x1e06dd){while(--_0x1e06dd){_0x1ed0e1['push'](_0x1ed0e1['shift']());}};_0x12b97f(++_0x45098f);}(_0xe2a6,0x8b));var _0x6e2a=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xe2a6[_0x2c0dc0];return _0x4c0990;};'use strict';var multer=require('multer');var util=require(_0x6e2a('0x0'));var path=require(_0x6e2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e2a('0x2'));var router=express[_0x6e2a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6e2a('0x4'));var interaction=require(_0x6e2a('0x5'));var config=require(_0x6e2a('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x6e2a('0x7')]('/',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x9')]);router[_0x6e2a('0x7')]('/describe',auth[_0x6e2a('0x8')](),controller[_0x6e2a('0xa')]);router[_0x6e2a('0x7')](_0x6e2a('0xb'),auth['isAuthenticated'](),controller[_0x6e2a('0xc')]);router[_0x6e2a('0x7')]('/:id',auth[_0x6e2a('0x8')](),controller['show']);router[_0x6e2a('0xd')]('/',auth[_0x6e2a('0x8')](),controller['create']);router[_0x6e2a('0xe')](_0x6e2a('0xf'),controller[_0x6e2a('0x10')]);router[_0x6e2a('0x11')](_0x6e2a('0xf'),auth[_0x6e2a('0x8')](),controller[_0x6e2a('0x12')]);module[_0x6e2a('0x13')]=router; \ No newline at end of file +var _0xb01f=['/users','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xfee9fd,_0x299d5d){var _0x17cd9f=function(_0x343c22){while(--_0x343c22){_0xfee9fd['push'](_0xfee9fd['shift']());}};_0x17cd9f(++_0x299d5d);}(_0xb01f,0x184));var _0xfb01=function(_0x2e124d,_0x31ce4a){_0x2e124d=_0x2e124d-0x0;var _0x1c03d2=_0xb01f[_0x2e124d];return _0x1c03d2;};'use strict';var multer=require(_0xfb01('0x0'));var util=require(_0xfb01('0x1'));var path=require(_0xfb01('0x2'));var timeout=require(_0xfb01('0x3'));var express=require('express');var router=express[_0xfb01('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb01('0x5'));var interaction=require(_0xfb01('0x6'));var config=require(_0xfb01('0x7'));var controller=require('./chatInternalMessage.controller');router[_0xfb01('0x8')]('/',auth[_0xfb01('0x9')](),controller[_0xfb01('0xa')]);router[_0xfb01('0x8')]('/describe',auth[_0xfb01('0x9')](),controller[_0xfb01('0xb')]);router[_0xfb01('0x8')](_0xfb01('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0xfb01('0x8')](_0xfb01('0xd'),auth[_0xfb01('0x9')](),controller[_0xfb01('0xe')]);router[_0xfb01('0xf')]('/',auth[_0xfb01('0x9')](),controller['create']);router['put'](_0xfb01('0xd'),controller[_0xfb01('0x10')]);router[_0xfb01('0x11')](_0xfb01('0xd'),auth[_0xfb01('0x9')](),controller[_0xfb01('0x12')]);module[_0xfb01('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index cac2585..a6f37e5 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 _0x97e7=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x97e7,0x1a1));var _0x797e=function(_0x389342,_0x6658bc){_0x389342=_0x389342-0x0;var _0x5b33e5=_0x97e7[_0x389342];return _0x5b33e5;};'use strict';var Sequelize=require(_0x797e('0x0'));module[_0x797e('0x1')]={'body':{'type':Sequelize[_0x797e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x797e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x797e('0x4')]('in',_0x797e('0x5')),'defaultValue':_0x797e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x797e('0x6')]},'providerName':{'type':Sequelize[_0x797e('0x7')]},'providerResponse':{'type':Sequelize[_0x797e('0x2')]}}; \ No newline at end of file +var _0xb574=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0xa6fd41,_0x5b44e9){var _0xa6ed48=function(_0x3ec7e9){while(--_0x3ec7e9){_0xa6fd41['push'](_0xa6fd41['shift']());}};_0xa6ed48(++_0x5b44e9);}(_0xb574,0x106));var _0x4b57=function(_0x220dba,_0x26ab28){_0x220dba=_0x220dba-0x0;var _0x1abb8b=_0xb574[_0x220dba];return _0x1abb8b;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4b57('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b57('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b57('0x4')]('in',_0x4b57('0x5')),'defaultValue':_0x4b57('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4b57('0x6')]},'providerName':{'type':Sequelize[_0x4b57('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e68de63..efe8c76 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 _0x216b=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','ChatMessage','findAll','rows','show','params','keys','length','includeAll','options','find','create','body','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','motionChannel','channel','event','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','email','SIP/%s','reject','EventManager','rejectmessage','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','end','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x568eef,_0x3494a2){var _0x549955=function(_0x8caa2f){while(--_0x8caa2f){_0x568eef['push'](_0x568eef['shift']());}};_0x549955(++_0x3494a2);}(_0x216b,0x1c8));var _0xb216=function(_0x113302,_0x50f3dd){_0x113302=_0x113302-0x0;var _0xa6343=_0x216b[_0x113302];return _0xa6343;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb216('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb216('0x1'));var rp=require('request-promise');var moment=require(_0xb216('0x2'));var BPromise=require(_0xb216('0x3'));var Mustache=require(_0xb216('0x4'));var util=require(_0xb216('0x5'));var path=require(_0xb216('0x6'));var sox=require(_0xb216('0x7'));var csv=require(_0xb216('0x8'));var ejs=require(_0xb216('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb216('0xa'));var squel=require(_0xb216('0xb'));var crypto=require(_0xb216('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb216('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb216('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb216('0xe'));var hardwareService=require(_0xb216('0xf'));var logger=require(_0xb216('0x10'))(_0xb216('0x11'));var utils=require('../../config/utils');var config=require(_0xb216('0x12'));var licenseUtil=require(_0xb216('0x13'));var db=require(_0xb216('0x14'))['db'];config[_0xb216('0x15')]=_[_0xb216('0x16')](config[_0xb216('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb216('0x15')]));require(_0xb216('0x17'))[_0xb216('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232c});var client9002=jayson[_0xb216('0x19')][_0xb216('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x8ea087,_0x51851b,_0x2fcdd6,_0xdd773b){return new BPromise(function(_0x106ccd,_0x3a6618){var _0x2fa920=_0xdd773b||client;return _0x2fa920[_0xb216('0x1b')](_0x8ea087,_0x2fcdd6)[_0xb216('0x1c')](function(_0x1198c3){logger[_0xb216('0x1d')](_0xb216('0x1e'),_0x51851b,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51851b,'request\x20sent',JSON[_0xb216('0x1f')](_0x1198c3));if(_0x1198c3[_0xb216('0x20')]){if(_0x1198c3[_0xb216('0x20')][_0xb216('0x21')]===0x1f4){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x3a6618(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}logger[_0xb216('0x20')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);return _0x106ccd(_0x1198c3[_0xb216('0x20')][_0xb216('0x22')]);}else{logger[_0xb216('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x51851b,_0xb216('0x23'));_0x106ccd(_0x1198c3[_0xb216('0x24')]['message']);}})[_0xb216('0x25')](function(_0x39c3a8){logger[_0xb216('0x20')](_0xb216('0x1e'),_0x51851b,_0x39c3a8);_0x3a6618(_0x39c3a8);});});}function respondWithStatusCode(_0x13d424,_0x2fa266){_0x2fa266=_0x2fa266||0xcc;return function(_0x459735){if(_0x459735){return _0x13d424[_0xb216('0x26')](_0x2fa266);}return _0x13d424[_0xb216('0x27')](_0x2fa266)['end']();};}function respondWithResult(_0x314988,_0x3da310){_0x3da310=_0x3da310||0xc8;return function(_0x1115a7){if(_0x1115a7){return _0x314988[_0xb216('0x27')](_0x3da310)[_0xb216('0x28')](_0x1115a7);}};}function respondWithFilteredResult(_0x4dfee0,_0x3ffa35){return function(_0x37b0ad){if(_0x37b0ad){var _0x45b89b=typeof _0x3ffa35[_0xb216('0x29')]===_0xb216('0x2a')&&typeof _0x3ffa35['limit']==='undefined';var _0x3385ad=_0x37b0ad[_0xb216('0x2b')];var _0xf31139=_0x45b89b?0x0:_0x3ffa35['offset'];var _0x5cfc62=_0x45b89b?_0x37b0ad[_0xb216('0x2b')]:_0x3ffa35['offset']+_0x3ffa35[_0xb216('0x2c')];var _0x1be53d;if(_0x5cfc62>=_0x3385ad){_0x5cfc62=_0x3385ad;_0x1be53d=0xc8;}else{_0x1be53d=0xce;}_0x4dfee0[_0xb216('0x27')](_0x1be53d);return _0x4dfee0[_0xb216('0x2d')](_0xb216('0x2e'),_0xf31139+'-'+_0x5cfc62+'/'+_0x3385ad)['json'](_0x37b0ad);}return null;};}function patchUpdates(_0x50222a){return function(_0x3e75bb){try{jsonpatch[_0xb216('0x2f')](_0x3e75bb,_0x50222a,!![]);}catch(_0x3d726b){return BPromise['reject'](_0x3d726b);}return _0x3e75bb[_0xb216('0x30')]();};}function saveUpdates(_0x8fdac8,_0x52d851){return function(_0x5a0d49){if(_0x5a0d49){return _0x5a0d49[_0xb216('0x31')](_0x8fdac8)[_0xb216('0x1c')](function(_0x56234d){return _0x56234d;});}return null;};}function removeEntity(_0x98820f,_0x3249d7){return function(_0x39f2fe){if(_0x39f2fe){return _0x39f2fe['destroy']()['then'](function(){_0x98820f['status'](0xcc)[_0xb216('0x32')]();});}};}function handleEntityNotFound(_0x3831aa,_0x5776a3){return function(_0xbf4cf8){if(!_0xbf4cf8){_0x3831aa['sendStatus'](0x194);}return _0xbf4cf8;};}function handleError(_0xe1605a,_0x3e5742){_0x3e5742=_0x3e5742||0x1f4;return function(_0x534720){logger[_0xb216('0x20')](_0x534720[_0xb216('0x33')]);if(_0x534720[_0xb216('0x34')]){delete _0x534720[_0xb216('0x34')];}_0xe1605a[_0xb216('0x27')](_0x3e5742)[_0xb216('0x35')](_0x534720);};}exports[_0xb216('0x36')]=function(_0x30fe71,_0x52c5cf){var _0x234de0={},_0x552590={},_0x3da660={'count':0x0,'rows':[]};var _0x3a9851=_[_0xb216('0x37')](db['ChatMessage'][_0xb216('0x38')],function(_0xc79639){return{'name':_0xc79639[_0xb216('0x39')],'type':_0xc79639['type'][_0xb216('0x3a')]};});_0x552590['model']=_[_0xb216('0x37')](_0x3a9851,'name');_0x552590[_0xb216('0x3b')]=_['keys'](_0x30fe71[_0xb216('0x3b')]);_0x552590[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x552590[_0xb216('0x3e')],_0x552590[_0xb216('0x3b')]);_0x234de0[_0xb216('0x3f')]=_['intersection'](_0x552590['model'],qs[_0xb216('0x40')](_0x30fe71['query'][_0xb216('0x40')]));_0x234de0[_0xb216('0x3f')]=_0x234de0[_0xb216('0x3f')]['length']?_0x234de0[_0xb216('0x3f')]:_0x552590[_0xb216('0x3e')];if(!_0x30fe71['query'][_0xb216('0x41')](_0xb216('0x42'))){_0x234de0['limit']=qs[_0xb216('0x2c')](_0x30fe71[_0xb216('0x3b')][_0xb216('0x2c')]);_0x234de0[_0xb216('0x29')]=qs[_0xb216('0x29')](_0x30fe71['query'][_0xb216('0x29')]);}_0x234de0[_0xb216('0x43')]=qs[_0xb216('0x44')](_0x30fe71[_0xb216('0x3b')]['sort']);_0x234de0[_0xb216('0x45')]=qs[_0xb216('0x3c')](_[_0xb216('0x46')](_0x30fe71[_0xb216('0x3b')],_0x552590[_0xb216('0x3c')]),_0x3a9851);if(_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]){_0x234de0['where']=_[_0xb216('0x48')](_0x234de0['where'],{'$or':_[_0xb216('0x37')](_0x3a9851,function(_0x199963){if(_0x199963[_0xb216('0x49')]!==_0xb216('0x4a')){var _0x1adf5a={};_0x1adf5a[_0x199963[_0xb216('0x34')]]={'$like':'%'+_0x30fe71[_0xb216('0x3b')][_0xb216('0x47')]+'%'};return _0x1adf5a;}})});}_0x234de0=_['merge']({},_0x234de0,_0x30fe71['options']);var _0x2be3ac={'where':_0x234de0['where']};return db['ChatMessage'][_0xb216('0x2b')](_0x2be3ac)[_0xb216('0x1c')](function(_0x1de60b){_0x3da660[_0xb216('0x2b')]=_0x1de60b;if(_0x30fe71['query']['includeAll']){_0x234de0[_0xb216('0x4b')]=[{'all':!![]}];}return db[_0xb216('0x4c')][_0xb216('0x4d')](_0x234de0);})[_0xb216('0x1c')](function(_0x2700f4){_0x3da660[_0xb216('0x4e')]=_0x2700f4;return _0x3da660;})[_0xb216('0x1c')](respondWithFilteredResult(_0x52c5cf,_0x234de0))['catch'](handleError(_0x52c5cf,null));};exports[_0xb216('0x4f')]=function(_0x47b6bc,_0x2209e3){var _0x1a01cc={'raw':!![],'where':{'id':_0x47b6bc[_0xb216('0x50')]['id']}},_0x5e8393={};_0x5e8393[_0xb216('0x3e')]=_['keys'](db[_0xb216('0x4c')][_0xb216('0x38')]);_0x5e8393['query']=_[_0xb216('0x51')](_0x47b6bc[_0xb216('0x3b')]);_0x5e8393[_0xb216('0x3c')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],_0x5e8393[_0xb216('0x3b')]);_0x1a01cc[_0xb216('0x3f')]=_[_0xb216('0x3d')](_0x5e8393[_0xb216('0x3e')],qs['fields'](_0x47b6bc['query'][_0xb216('0x40')]));_0x1a01cc['attributes']=_0x1a01cc[_0xb216('0x3f')][_0xb216('0x52')]?_0x1a01cc[_0xb216('0x3f')]:_0x5e8393[_0xb216('0x3e')];if(_0x47b6bc[_0xb216('0x3b')][_0xb216('0x53')]){_0x1a01cc[_0xb216('0x4b')]=[{'all':!![]}];}_0x1a01cc=_[_0xb216('0x48')]({},_0x1a01cc,_0x47b6bc[_0xb216('0x54')]);return db[_0xb216('0x4c')][_0xb216('0x55')](_0x1a01cc)[_0xb216('0x1c')](handleEntityNotFound(_0x2209e3,null))[_0xb216('0x1c')](respondWithResult(_0x2209e3,null))[_0xb216('0x25')](handleError(_0x2209e3,null));};exports[_0xb216('0x56')]=function(_0x2d2f37,_0x521323){return db['ChatMessage'][_0xb216('0x56')](_0x2d2f37[_0xb216('0x57')],{})[_0xb216('0x1c')](respondWithResult(_0x521323,0xc9))[_0xb216('0x25')](handleError(_0x521323,null));};exports[_0xb216('0x31')]=function(_0xb3bdcf,_0x282012){if(_0xb3bdcf[_0xb216('0x57')]['id']){delete _0xb3bdcf[_0xb216('0x57')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xb3bdcf[_0xb216('0x50')]['id']}})['then'](handleEntityNotFound(_0x282012,null))['then'](saveUpdates(_0xb3bdcf[_0xb216('0x57')],null))['then'](respondWithResult(_0x282012,null))[_0xb216('0x25')](handleError(_0x282012,null));};exports['destroy']=function(_0x46cd5a,_0x34fcde){return db[_0xb216('0x4c')][_0xb216('0x55')]({'where':{'id':_0x46cd5a[_0xb216('0x50')]['id']}})[_0xb216('0x1c')](handleEntityNotFound(_0x34fcde,null))[_0xb216('0x1c')](removeEntity(_0x34fcde,null))['catch'](handleError(_0x34fcde,null));};exports[_0xb216('0x58')]=function(_0x24ccc0,_0x2023cd){return db['ChatMessage'][_0xb216('0x58')]()[_0xb216('0x1c')](respondWithResult(_0x2023cd,null))['catch'](handleError(_0x2023cd,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports[_0xb216('0x59')]=function(_0x41067f,_0x5a78e0,_0x3466c9){var _0x58da9f={'agent':{},'channel':_0xb216('0x5a')};if(_0x41067f[_0xb216('0x57')]['id']){delete _0x41067f[_0xb216('0x57')]['id'];}_0x41067f['body'][_0xb216('0x5b')]=!![];_0x41067f[_0xb216('0x57')][_0xb216('0x5c')]=moment()[_0xb216('0x5d')](_0xb216('0x5e'));_0x41067f[_0xb216('0x57')][_0xb216('0x5f')]=_0x41067f['body'][_0xb216('0x5f')]||_0x41067f[_0xb216('0x60')]['id'];_0x58da9f[_0xb216('0x61')]['id']=_0x41067f[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x41067f[_0xb216('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](saveUpdates(_0x41067f['body'],null))[_0xb216('0x1c')](function(_0x268fa5){if(_0x268fa5){_0x58da9f[_0xb216('0x22')]=_0x268fa5[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x268fa5[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x5a78e0,null))[_0xb216('0x1c')](function(_0xc71487){if(_0xc71487){return _0xc71487[_0xb216('0x31')]({'UserId':_0x41067f[_0xb216('0x57')]['UserId'],'read1stAt':_[_0xb216('0x65')](_0xc71487['read1stAt'])?moment()[_0xb216('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb216('0x1c')](function(_0x34f02a){if(_0x34f02a){_0x58da9f[_0xb216('0x66')]=_0x34f02a[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x67'),_0x41067f[_0xb216('0x60')]['id'],_0x41067f[_0xb216('0x60')][_0xb216('0x34')],_0x41067f[_0xb216('0x60')]['role'],_0x58da9f[_0xb216('0x66')]['id'],_0x41067f['body']?JSON[_0xb216('0x1f')](_0x41067f['body']):_0xb216('0x68'));return respondWithRpcPromise('AcceptMessage',_0xb216('0x69'),_0x58da9f);}return null;})[_0xb216('0x1c')](function(_0xd994c4){var _0x49101a=_0xb216('0x6a')+_0xd994c4[_0xb216('0x22')][_0xb216('0x6b')];return db['sequelize'][_0xb216('0x3b')](_0x49101a,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})[_0xb216('0x1c')](function(_0x47c562){return _0x47c562;});})[_0xb216('0x1c')](function(_0x37aab4){if(_0x37aab4){_0x58da9f[_0xb216('0x22')][_0xb216('0x6f')]=_0x37aab4[0x0];if(!_0x41067f[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User'][_0xb216('0x55')]({'where':{'id':_0x41067f['body']['UserId'],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),'email',_0xb216('0x71')],'raw':!![]});}return null;})['then'](function(_0x50e470){if(!_0x50e470)return null;_0x58da9f['message'][_0xb216('0x61')]=_0x50e470;return _0x58da9f;})['then'](function(_0x3197f9){if(_0x3197f9){if(_0x41067f[_0xb216('0x57')]['manual']){_0x58da9f[_0xb216('0x22')]['interface']=util['format']('SIP/%s',_0x41067f['user'][_0xb216('0x34')]);_0x58da9f[_0xb216('0x22')]['channel']=_0x58da9f['channel'];_0x58da9f[_0xb216('0x22')][_0xb216('0x72')]=_0x58da9f[_0xb216('0x73')];_0x58da9f[_0xb216('0x22')][_0xb216('0x74')]=_0xb216('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb216('0x75'),'message':_[_0xb216('0x48')](_0x58da9f[_0xb216('0x22')],JSON[_0xb216('0x76')](_0x58da9f['interaction'][_0xb216('0x77')]))},client9002)[_0xb216('0x1c')](function(){return _0x58da9f;});}return _0x58da9f;}return null;})['then'](respondWithResult(_0x5a78e0,null))['catch'](handleError(_0x5a78e0,null));};var interaction_log=require(_0xb216('0x10'))('chat-interactions');exports['reject']=function(_0x4992a7,_0x17f280,_0x363563){var _0x17fb1f={'agent':{},'channel':_0xb216('0x5a')};if(_0x4992a7[_0xb216('0x57')]['id']){delete _0x4992a7['body']['id'];}_0x4992a7['body']['UserId']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')]||_0x4992a7[_0xb216('0x60')]['id'];_0x17fb1f[_0xb216('0x61')]['id']=_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')];return db[_0xb216('0x4c')]['find']({'where':{'id':_0x4992a7['params']['id'],'UserId':null}})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x487cad){if(_0x487cad){_0x17fb1f[_0xb216('0x22')]=_0x487cad[_0xb216('0x62')]({'plain':!![]});return db[_0xb216('0x63')][_0xb216('0x55')]({'where':{'id':_0x487cad[_0xb216('0x64')]}});}return null;})[_0xb216('0x1c')](handleEntityNotFound(_0x17f280,null))[_0xb216('0x1c')](function(_0x3c510e){if(_0x3c510e){_0x17fb1f[_0xb216('0x66')]=_0x3c510e[_0xb216('0x62')]({'plain':!![]});interaction_log[_0xb216('0x1d')](_0xb216('0x78'),_0x4992a7[_0xb216('0x60')]['id'],_0x4992a7[_0xb216('0x60')][_0xb216('0x34')],_0x4992a7[_0xb216('0x60')][_0xb216('0x79')],_0x17fb1f['interaction']['id'],_0x4992a7[_0xb216('0x57')]?JSON[_0xb216('0x1f')](_0x4992a7[_0xb216('0x57')]):_0xb216('0x68'));return respondWithRpcPromise(_0xb216('0x7a'),_0xb216('0x7b'),_0x17fb1f);}return null;})[_0xb216('0x1c')](function(_0x22c127){var _0xbf927=_0xb216('0x6a')+_0x22c127[_0xb216('0x22')][_0xb216('0x6b')];return db[_0xb216('0x7c')]['query'](_0xbf927,{'type':db[_0xb216('0x6c')][_0xb216('0x6d')][_0xb216('0x6e')],'raw':!![]})['then'](function(_0x8b9a2f){return _0x8b9a2f;});})['then'](function(_0x5f5e0f){if(_0x5f5e0f){_0x17fb1f[_0xb216('0x22')][_0xb216('0x6f')]=_0x5f5e0f[0x0];if(!_0x4992a7[_0xb216('0x57')][_0xb216('0x5f')])return;return db['User']['find']({'where':{'id':_0x4992a7['body'][_0xb216('0x5f')],'role':_0xb216('0x61')},'attributes':['id',_0xb216('0x34'),_0xb216('0x70'),_0xb216('0x7d'),'internal'],'raw':!![]});}return null;})[_0xb216('0x1c')](function(_0x277ec3){if(!_0x277ec3)return null;_0x17fb1f['message'][_0xb216('0x61')]=_0x277ec3;return _0x17fb1f;})[_0xb216('0x1c')](function(_0x50ee15){if(_0x50ee15){_0x50ee15[_0xb216('0x22')]['interface']=util[_0xb216('0x5d')](_0xb216('0x7e'),_0x4992a7[_0xb216('0x60')][_0xb216('0x34')]);_0x50ee15[_0xb216('0x22')][_0xb216('0x73')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15[_0xb216('0x22')][_0xb216('0x72')]=_0x17fb1f[_0xb216('0x73')];_0x50ee15['message'][_0xb216('0x74')]=_0xb216('0x7f');respondWithRpcPromise('EventManager',_0xb216('0x80'),{'event':_0xb216('0x81'),'message':_[_0xb216('0x48')](_0x17fb1f['message'],JSON[_0xb216('0x76')](_0x17fb1f['interaction'][_0xb216('0x77')]))},client9002);return _0x17fb1f;}return null;})[_0xb216('0x1c')](respondWithResult(_0x17f280,null))['catch'](handleError(_0x17f280,null));}; \ No newline at end of file +var _0x3580=['agent','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','email','internal','manual','interface','channel','motionChannel','event','EventManager','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','QueryTypes','contact','fullname','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','create','body','update','find','describe','chat-interactions','accept','chat','read','readAt','UserId','user'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x3580,0x1b8));var _0x0358=function(_0x3ef6bb,_0x1bb97f){_0x3ef6bb=_0x3ef6bb-0x0;var _0xa5f12a=_0x3580[_0x3ef6bb];return _0xa5f12a;};'use strict';var emlformat=require(_0x0358('0x0'));var rimraf=require(_0x0358('0x1'));var zipdir=require(_0x0358('0x2'));var jsonpatch=require(_0x0358('0x3'));var rp=require(_0x0358('0x4'));var moment=require('moment');var BPromise=require(_0x0358('0x5'));var Mustache=require(_0x0358('0x6'));var util=require(_0x0358('0x7'));var path=require(_0x0358('0x8'));var sox=require(_0x0358('0x9'));var csv=require('to-csv');var ejs=require(_0x0358('0xa'));var fs=require('fs');var fs_extra=require(_0x0358('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0358('0xc'));var jsforce=require(_0x0358('0xd'));var deskjs=require(_0x0358('0xe'));var toCsv=require(_0x0358('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0358('0x10'));var authService=require(_0x0358('0x11'));var qs=require(_0x0358('0x12'));var as=require(_0x0358('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0358('0x14'))(_0x0358('0x15'));var utils=require(_0x0358('0x16'));var config=require(_0x0358('0x17'));var licenseUtil=require(_0x0358('0x18'));var db=require(_0x0358('0x19'))['db'];config['redis']=_['defaults'](config[_0x0358('0x1a')],{'host':_0x0358('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0358('0x1a')]));require(_0x0358('0x1c'))[_0x0358('0x1d')](socket);var jayson=require(_0x0358('0x1e'));var client=jayson[_0x0358('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x0358('0x1f')][_0x0358('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x55643f,_0x310743,_0x25aaf2,_0x35c55c){return new BPromise(function(_0x375a17,_0x2011a5){var _0x335401=_0x35c55c||client;return _0x335401[_0x0358('0x21')](_0x55643f,_0x25aaf2)[_0x0358('0x22')](function(_0x3e4913){logger[_0x0358('0x23')](_0x0358('0x24'),_0x310743,'request\x20sent');logger['debug'](_0x0358('0x25'),_0x310743,_0x0358('0x26'),JSON[_0x0358('0x27')](_0x3e4913));if(_0x3e4913[_0x0358('0x28')]){if(_0x3e4913[_0x0358('0x28')][_0x0358('0x29')]===0x1f4){logger[_0x0358('0x28')](_0x0358('0x24'),_0x310743,_0x3e4913[_0x0358('0x28')][_0x0358('0x2a')]);return _0x2011a5(_0x3e4913['error'][_0x0358('0x2a')]);}logger[_0x0358('0x28')]('ChatMessage,\x20%s,\x20%s',_0x310743,_0x3e4913[_0x0358('0x28')][_0x0358('0x2a')]);return _0x375a17(_0x3e4913['error'][_0x0358('0x2a')]);}else{logger[_0x0358('0x23')](_0x0358('0x24'),_0x310743,'request\x20sent');_0x375a17(_0x3e4913['result'][_0x0358('0x2a')]);}})[_0x0358('0x2b')](function(_0x583106){logger[_0x0358('0x28')](_0x0358('0x24'),_0x310743,_0x583106);_0x2011a5(_0x583106);});});}function respondWithStatusCode(_0x1bd1fa,_0x21bd46){_0x21bd46=_0x21bd46||0xcc;return function(_0x49c14b){if(_0x49c14b){return _0x1bd1fa[_0x0358('0x2c')](_0x21bd46);}return _0x1bd1fa[_0x0358('0x2d')](_0x21bd46)[_0x0358('0x2e')]();};}function respondWithResult(_0x2a99e9,_0x1020e6){_0x1020e6=_0x1020e6||0xc8;return function(_0x353e4f){if(_0x353e4f){return _0x2a99e9[_0x0358('0x2d')](_0x1020e6)[_0x0358('0x2f')](_0x353e4f);}};}function respondWithFilteredResult(_0x53ccdb,_0x2a9d73){return function(_0x3ef6b8){if(_0x3ef6b8){var _0x39e023=typeof _0x2a9d73[_0x0358('0x30')]===_0x0358('0x31')&&typeof _0x2a9d73['limit']===_0x0358('0x31');var _0x252ee5=_0x3ef6b8['count'];var _0x14592d=_0x39e023?0x0:_0x2a9d73[_0x0358('0x30')];var _0x1622d6=_0x39e023?_0x3ef6b8['count']:_0x2a9d73[_0x0358('0x30')]+_0x2a9d73[_0x0358('0x32')];var _0x224660;if(_0x1622d6>=_0x252ee5){_0x1622d6=_0x252ee5;_0x224660=0xc8;}else{_0x224660=0xce;}_0x53ccdb['status'](_0x224660);return _0x53ccdb[_0x0358('0x33')](_0x0358('0x34'),_0x14592d+'-'+_0x1622d6+'/'+_0x252ee5)[_0x0358('0x2f')](_0x3ef6b8);}return null;};}function patchUpdates(_0xab0630){return function(_0x1676a3){try{jsonpatch[_0x0358('0x35')](_0x1676a3,_0xab0630,!![]);}catch(_0x22d5ae){return BPromise[_0x0358('0x36')](_0x22d5ae);}return _0x1676a3[_0x0358('0x37')]();};}function saveUpdates(_0x8520c0,_0x1a9e41){return function(_0xb2180b){if(_0xb2180b){return _0xb2180b['update'](_0x8520c0)[_0x0358('0x22')](function(_0x2bea06){return _0x2bea06;});}return null;};}function removeEntity(_0x4ea71e,_0x267936){return function(_0x1277c8){if(_0x1277c8){return _0x1277c8[_0x0358('0x38')]()[_0x0358('0x22')](function(){_0x4ea71e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x234c61,_0x59c845){return function(_0x4c7f50){if(!_0x4c7f50){_0x234c61[_0x0358('0x2c')](0x194);}return _0x4c7f50;};}function handleError(_0x38da59,_0x3c3b71){_0x3c3b71=_0x3c3b71||0x1f4;return function(_0x2827f8){logger['error'](_0x2827f8[_0x0358('0x39')]);if(_0x2827f8[_0x0358('0x3a')]){delete _0x2827f8[_0x0358('0x3a')];}_0x38da59[_0x0358('0x2d')](_0x3c3b71)['send'](_0x2827f8);};}exports[_0x0358('0x3b')]=function(_0x12df16,_0x5a9e8a){var _0x17a525={},_0x18f029={},_0x9309ef={'count':0x0,'rows':[]};var _0x10f336=_[_0x0358('0x3c')](db[_0x0358('0x3d')][_0x0358('0x3e')],function(_0x4bad8c){return{'name':_0x4bad8c['fieldName'],'type':_0x4bad8c[_0x0358('0x3f')][_0x0358('0x40')]};});_0x18f029[_0x0358('0x41')]=_[_0x0358('0x3c')](_0x10f336,_0x0358('0x3a'));_0x18f029[_0x0358('0x42')]=_[_0x0358('0x43')](_0x12df16[_0x0358('0x42')]);_0x18f029[_0x0358('0x44')]=_['intersection'](_0x18f029[_0x0358('0x41')],_0x18f029[_0x0358('0x42')]);_0x17a525['attributes']=_[_0x0358('0x45')](_0x18f029['model'],qs[_0x0358('0x46')](_0x12df16[_0x0358('0x42')][_0x0358('0x46')]));_0x17a525['attributes']=_0x17a525[_0x0358('0x47')][_0x0358('0x48')]?_0x17a525['attributes']:_0x18f029[_0x0358('0x41')];if(!_0x12df16[_0x0358('0x42')][_0x0358('0x49')]('nolimit')){_0x17a525[_0x0358('0x32')]=qs[_0x0358('0x32')](_0x12df16[_0x0358('0x42')][_0x0358('0x32')]);_0x17a525[_0x0358('0x30')]=qs['offset'](_0x12df16[_0x0358('0x42')][_0x0358('0x30')]);}_0x17a525[_0x0358('0x4a')]=qs[_0x0358('0x4b')](_0x12df16['query']['sort']);_0x17a525['where']=qs[_0x0358('0x44')](_[_0x0358('0x4c')](_0x12df16['query'],_0x18f029['filters']),_0x10f336);if(_0x12df16[_0x0358('0x42')][_0x0358('0x4d')]){_0x17a525[_0x0358('0x4e')]=_[_0x0358('0x4f')](_0x17a525[_0x0358('0x4e')],{'$or':_['map'](_0x10f336,function(_0x5f3e29){if(_0x5f3e29[_0x0358('0x3f')]!==_0x0358('0x50')){var _0x57d17f={};_0x57d17f[_0x5f3e29['name']]={'$like':'%'+_0x12df16[_0x0358('0x42')][_0x0358('0x4d')]+'%'};return _0x57d17f;}})});}_0x17a525=_['merge']({},_0x17a525,_0x12df16[_0x0358('0x51')]);var _0x3d4390={'where':_0x17a525['where']};return db[_0x0358('0x3d')]['count'](_0x3d4390)['then'](function(_0x272e4a){_0x9309ef[_0x0358('0x52')]=_0x272e4a;if(_0x12df16[_0x0358('0x42')][_0x0358('0x53')]){_0x17a525[_0x0358('0x54')]=[{'all':!![]}];}return db[_0x0358('0x3d')]['findAll'](_0x17a525);})['then'](function(_0x48ce4b){_0x9309ef[_0x0358('0x55')]=_0x48ce4b;return _0x9309ef;})[_0x0358('0x22')](respondWithFilteredResult(_0x5a9e8a,_0x17a525))['catch'](handleError(_0x5a9e8a,null));};exports[_0x0358('0x56')]=function(_0x1c20f9,_0x1c7a81){var _0x1a4610={'raw':!![],'where':{'id':_0x1c20f9[_0x0358('0x57')]['id']}},_0x2c7982={};_0x2c7982['model']=_[_0x0358('0x43')](db['ChatMessage'][_0x0358('0x3e')]);_0x2c7982[_0x0358('0x42')]=_['keys'](_0x1c20f9[_0x0358('0x42')]);_0x2c7982[_0x0358('0x44')]=_[_0x0358('0x45')](_0x2c7982[_0x0358('0x41')],_0x2c7982[_0x0358('0x42')]);_0x1a4610[_0x0358('0x47')]=_[_0x0358('0x45')](_0x2c7982['model'],qs[_0x0358('0x46')](_0x1c20f9[_0x0358('0x42')][_0x0358('0x46')]));_0x1a4610[_0x0358('0x47')]=_0x1a4610['attributes'][_0x0358('0x48')]?_0x1a4610[_0x0358('0x47')]:_0x2c7982[_0x0358('0x41')];if(_0x1c20f9[_0x0358('0x42')][_0x0358('0x53')]){_0x1a4610[_0x0358('0x54')]=[{'all':!![]}];}_0x1a4610=_[_0x0358('0x4f')]({},_0x1a4610,_0x1c20f9[_0x0358('0x51')]);return db[_0x0358('0x3d')]['find'](_0x1a4610)[_0x0358('0x22')](handleEntityNotFound(_0x1c7a81,null))['then'](respondWithResult(_0x1c7a81,null))['catch'](handleError(_0x1c7a81,null));};exports[_0x0358('0x58')]=function(_0x34b6eb,_0x365ca6){return db['ChatMessage']['create'](_0x34b6eb[_0x0358('0x59')],{})['then'](respondWithResult(_0x365ca6,0xc9))['catch'](handleError(_0x365ca6,null));};exports[_0x0358('0x5a')]=function(_0x31392f,_0x2713d3){if(_0x31392f['body']['id']){delete _0x31392f[_0x0358('0x59')]['id'];}return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x31392f[_0x0358('0x57')]['id']}})[_0x0358('0x22')](handleEntityNotFound(_0x2713d3,null))['then'](saveUpdates(_0x31392f['body'],null))[_0x0358('0x22')](respondWithResult(_0x2713d3,null))['catch'](handleError(_0x2713d3,null));};exports[_0x0358('0x38')]=function(_0x26817b,_0x1583d7){return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x26817b[_0x0358('0x57')]['id']}})['then'](handleEntityNotFound(_0x1583d7,null))[_0x0358('0x22')](removeEntity(_0x1583d7,null))['catch'](handleError(_0x1583d7,null));};exports[_0x0358('0x5c')]=function(_0x1bf7dc,_0x4bf761){return db[_0x0358('0x3d')][_0x0358('0x5c')]()[_0x0358('0x22')](respondWithResult(_0x4bf761,null))[_0x0358('0x2b')](handleError(_0x4bf761,null));};var interaction_log=require(_0x0358('0x14'))(_0x0358('0x5d'));exports[_0x0358('0x5e')]=function(_0x3e1e4a,_0x3532f1,_0x2e220e){var _0x594911={'agent':{},'channel':_0x0358('0x5f')};if(_0x3e1e4a['body']['id']){delete _0x3e1e4a[_0x0358('0x59')]['id'];}_0x3e1e4a['body'][_0x0358('0x60')]=!![];_0x3e1e4a[_0x0358('0x59')][_0x0358('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')]=_0x3e1e4a[_0x0358('0x59')]['UserId']||_0x3e1e4a[_0x0358('0x63')]['id'];_0x594911[_0x0358('0x64')]['id']=_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')];return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x3e1e4a['params']['id'],'UserId':null}})[_0x0358('0x22')](handleEntityNotFound(_0x3532f1,null))[_0x0358('0x22')](saveUpdates(_0x3e1e4a[_0x0358('0x59')],null))[_0x0358('0x22')](function(_0x2fed87){if(_0x2fed87){_0x594911[_0x0358('0x2a')]=_0x2fed87['get']({'plain':!![]});return db['ChatInteraction'][_0x0358('0x5b')]({'where':{'id':_0x2fed87[_0x0358('0x65')]}});}return null;})[_0x0358('0x22')](handleEntityNotFound(_0x3532f1,null))['then'](function(_0x3c3f5c){if(_0x3c3f5c){return _0x3c3f5c['update']({'UserId':_0x3e1e4a[_0x0358('0x59')]['UserId'],'read1stAt':_['isNil'](_0x3c3f5c[_0x0358('0x66')])?moment()[_0x0358('0x67')](_0x0358('0x68')):undefined});}return null;})['then'](function(_0x1ee4d9){if(_0x1ee4d9){_0x594911[_0x0358('0x69')]=_0x1ee4d9[_0x0358('0x6a')]({'plain':!![]});interaction_log[_0x0358('0x23')](_0x0358('0x6b'),_0x3e1e4a['user']['id'],_0x3e1e4a[_0x0358('0x63')][_0x0358('0x3a')],_0x3e1e4a['user'][_0x0358('0x6c')],_0x594911['interaction']['id'],_0x3e1e4a[_0x0358('0x59')]?JSON['stringify'](_0x3e1e4a['body']):'null');return respondWithRpcPromise(_0x0358('0x6d'),_0x0358('0x6e'),_0x594911);}return null;})[_0x0358('0x22')](function(_0x58a26e){var _0x1f1584=_0x0358('0x6f')+_0x58a26e['message'][_0x0358('0x70')];return db[_0x0358('0x71')][_0x0358('0x42')](_0x1f1584,{'type':db[_0x0358('0x72')]['QueryTypes'][_0x0358('0x73')],'raw':!![]})[_0x0358('0x22')](function(_0x1d6a07){return _0x1d6a07;});})[_0x0358('0x22')](function(_0x396901){if(_0x396901){_0x594911[_0x0358('0x2a')]['contact']=_0x396901[0x0];if(!_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')])return;return db[_0x0358('0x74')][_0x0358('0x5b')]({'where':{'id':_0x3e1e4a[_0x0358('0x59')][_0x0358('0x62')],'role':_0x0358('0x64')},'attributes':['id',_0x0358('0x3a'),'fullname',_0x0358('0x75'),_0x0358('0x76')],'raw':!![]});}return null;})[_0x0358('0x22')](function(_0x47b244){if(!_0x47b244)return null;_0x594911['message'][_0x0358('0x64')]=_0x47b244;return _0x594911;})[_0x0358('0x22')](function(_0x533249){if(_0x533249){if(_0x3e1e4a[_0x0358('0x59')][_0x0358('0x77')]){_0x594911[_0x0358('0x2a')][_0x0358('0x78')]=util[_0x0358('0x67')]('SIP/%s',_0x3e1e4a[_0x0358('0x63')][_0x0358('0x3a')]);_0x594911['message'][_0x0358('0x79')]=_0x594911[_0x0358('0x79')];_0x594911[_0x0358('0x2a')][_0x0358('0x7a')]=_0x594911['channel'];_0x594911[_0x0358('0x2a')][_0x0358('0x7b')]=_0x0358('0x5e');return respondWithRpcPromise(_0x0358('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x0358('0x4f')](_0x594911[_0x0358('0x2a')],JSON[_0x0358('0x7d')](_0x594911[_0x0358('0x69')][_0x0358('0x7e')]))},client9002)[_0x0358('0x22')](function(){return _0x594911;});}return _0x594911;}return null;})[_0x0358('0x22')](respondWithResult(_0x3532f1,null))[_0x0358('0x2b')](handleError(_0x3532f1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x0358('0x36')]=function(_0x3910c7,_0x1fe6ee,_0x1ea44b){var _0x41e0cf={'agent':{},'channel':_0x0358('0x5f')};if(_0x3910c7[_0x0358('0x59')]['id']){delete _0x3910c7['body']['id'];}_0x3910c7[_0x0358('0x59')][_0x0358('0x62')]=_0x3910c7[_0x0358('0x59')]['UserId']||_0x3910c7[_0x0358('0x63')]['id'];_0x41e0cf[_0x0358('0x64')]['id']=_0x3910c7[_0x0358('0x59')][_0x0358('0x62')];return db[_0x0358('0x3d')][_0x0358('0x5b')]({'where':{'id':_0x3910c7['params']['id'],'UserId':null}})[_0x0358('0x22')](handleEntityNotFound(_0x1fe6ee,null))[_0x0358('0x22')](function(_0x281e27){if(_0x281e27){_0x41e0cf[_0x0358('0x2a')]=_0x281e27[_0x0358('0x6a')]({'plain':!![]});return db[_0x0358('0x7f')][_0x0358('0x5b')]({'where':{'id':_0x281e27[_0x0358('0x65')]}});}return null;})[_0x0358('0x22')](handleEntityNotFound(_0x1fe6ee,null))[_0x0358('0x22')](function(_0x37c6a6){if(_0x37c6a6){_0x41e0cf[_0x0358('0x69')]=_0x37c6a6[_0x0358('0x6a')]({'plain':!![]});interaction_log[_0x0358('0x23')](_0x0358('0x80'),_0x3910c7[_0x0358('0x63')]['id'],_0x3910c7[_0x0358('0x63')][_0x0358('0x3a')],_0x3910c7[_0x0358('0x63')][_0x0358('0x6c')],_0x41e0cf[_0x0358('0x69')]['id'],_0x3910c7['body']?JSON[_0x0358('0x27')](_0x3910c7[_0x0358('0x59')]):_0x0358('0x81'));return respondWithRpcPromise('RejectMessage',_0x0358('0x82'),_0x41e0cf);}return null;})[_0x0358('0x22')](function(_0x4e2cf6){var _0x22cfbe=_0x0358('0x6f')+_0x4e2cf6[_0x0358('0x2a')][_0x0358('0x70')];return db[_0x0358('0x71')][_0x0358('0x42')](_0x22cfbe,{'type':db['Sequelize'][_0x0358('0x83')][_0x0358('0x73')],'raw':!![]})[_0x0358('0x22')](function(_0xeaf15f){return _0xeaf15f;});})[_0x0358('0x22')](function(_0x59c816){if(_0x59c816){_0x41e0cf[_0x0358('0x2a')][_0x0358('0x84')]=_0x59c816[0x0];if(!_0x3910c7[_0x0358('0x59')]['UserId'])return;return db[_0x0358('0x74')]['find']({'where':{'id':_0x3910c7['body'][_0x0358('0x62')],'role':_0x0358('0x64')},'attributes':['id',_0x0358('0x3a'),_0x0358('0x85'),_0x0358('0x75'),_0x0358('0x76')],'raw':!![]});}return null;})[_0x0358('0x22')](function(_0x3a0d43){if(!_0x3a0d43)return null;_0x41e0cf[_0x0358('0x2a')][_0x0358('0x64')]=_0x3a0d43;return _0x41e0cf;})['then'](function(_0x127cda){if(_0x127cda){_0x127cda[_0x0358('0x2a')][_0x0358('0x78')]=util[_0x0358('0x67')](_0x0358('0x86'),_0x3910c7[_0x0358('0x63')][_0x0358('0x3a')]);_0x127cda[_0x0358('0x2a')]['channel']=_0x41e0cf['channel'];_0x127cda['message'][_0x0358('0x7a')]=_0x41e0cf['channel'];_0x127cda[_0x0358('0x2a')][_0x0358('0x7b')]=_0x0358('0x36');respondWithRpcPromise(_0x0358('0x7c'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x41e0cf[_0x0358('0x2a')],JSON[_0x0358('0x7d')](_0x41e0cf['interaction'][_0x0358('0x7e')]))},client9002);return _0x41e0cf;}return null;})[_0x0358('0x22')](respondWithResult(_0x1fe6ee,null))[_0x0358('0x2b')](handleError(_0x1fe6ee,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 187dd62..1c58226 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 _0x1a83=['hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x511ee8,_0x1934be){var _0x4386d6=function(_0x3dfc6f){while(--_0x3dfc6f){_0x511ee8['push'](_0x511ee8['shift']());}};_0x4386d6(++_0x1934be);}(_0x1a83,0xfe));var _0x31a8=function(_0x5eb1a7,_0x4acae9){_0x5eb1a7=_0x5eb1a7-0x0;var _0x39fdf3=_0x1a83[_0x5eb1a7];return _0x39fdf3;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x31a8('0x0'))['db'][_0x31a8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x31a8('0x2')](0x0);var events={'afterCreate':_0x31a8('0x3'),'afterUpdate':_0x31a8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1bffcf){return function(_0x431887,_0xa903af,_0x449a3f){ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf+':'+_0x431887['id'],_0x431887);ChatMessageEvents[_0x31a8('0x5')](_0x1bffcf,_0x431887);_0x449a3f(null);};}for(var e in events){if(events[_0x31a8('0x6')](e)){var event=events[e];ChatMessage[_0x31a8('0x7')](e,emitEvent(event));}}module[_0x31a8('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xb5f4=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb5f4,0x15b));var _0x4b5f=function(_0x570b17,_0x3e25d4){_0x570b17=_0x570b17-0x0;var _0x230b47=_0xb5f4[_0x570b17];return _0x230b47;};'use strict';var EventEmitter=require(_0x4b5f('0x0'));var ChatMessage=require(_0x4b5f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4b5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b5f('0x3'),'afterDestroy':_0x4b5f('0x4')};function emitEvent(_0x14a1b0){return function(_0x892dbe,_0x446aa0,_0x3104da){ChatMessageEvents[_0x4b5f('0x5')](_0x14a1b0+':'+_0x892dbe['id'],_0x892dbe);ChatMessageEvents[_0x4b5f('0x5')](_0x14a1b0,_0x892dbe);_0x3104da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x4b5f('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5aec8ea..f2a2027 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 _0x3d7e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger'];(function(_0x2ecd91,_0x1f21e8){var _0x3bf737=function(_0x1563d7){while(--_0x1563d7){_0x2ecd91['push'](_0x2ecd91['shift']());}};_0x3bf737(++_0x1f21e8);}(_0x3d7e,0x1ae));var _0xe3d7=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x3d7e[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0xe3d7('0x0'));var util=require('util');var logger=require(_0xe3d7('0x1'))('api');var moment=require(_0xe3d7('0x2'));var BPromise=require(_0xe3d7('0x3'));var rp=require(_0xe3d7('0x4'));var fs=require('fs');var path=require(_0xe3d7('0x5'));var rimraf=require(_0xe3d7('0x6'));var config=require(_0xe3d7('0x7'));var attributes=require('./chatMessage.attributes');module[_0xe3d7('0x8')]=function(_0x35e1fc,_0x4498e3){return _0x35e1fc['define'](_0xe3d7('0x9'),attributes,{'tableName':_0xe3d7('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d7('0xb'),'fields':['body'],'type':_0xe3d7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d6604,_0x173287,_0x428316){var _0x37b6f9=_0x35e1fc[_0xe3d7('0xd')];var _0x5d7586=_0x2d6604[_0xe3d7('0xe')]({'plain':!![]});if(_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='in'||_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()==='out'&&!_0x5d7586[_0xe3d7('0x11')]&&!_['isNil'](_0x5d7586[_0xe3d7('0x12')])){_0x37b6f9[_0xe3d7('0x13')]['findOne']({'where':{'id':_0x5d7586[_0xe3d7('0x14')]}})[_0xe3d7('0x15')](function(_0xb258cc){if(_0xb258cc){_0xb258cc[_0xe3d7('0x16')]({'lastMsgAt':_0x5d7586[_0xe3d7('0x17')],'lastMsgDirection':_0x5d7586[_0xe3d7('0xf')][_0xe3d7('0x10')]()});}})[_0xe3d7('0x18')](function(_0x2efb98){console[_0xe3d7('0x19')](_0x2efb98);});}_0x428316();}},'charset':_0xe3d7('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcfe5=['rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','ChatInteraction','ChatInteractionId','update','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcfe5,0x1c9));var _0x5cfe=function(_0x1d0aee,_0x2c4454){_0x1d0aee=_0x1d0aee-0x0;var _0x34ee2c=_0xcfe5[_0x1d0aee];return _0x34ee2c;};'use strict';var _=require(_0x5cfe('0x0'));var util=require(_0x5cfe('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5cfe('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cfe('0x3'));var config=require(_0x5cfe('0x4'));var attributes=require(_0x5cfe('0x5'));module['exports']=function(_0x26bdda,_0x4a33f0){return _0x26bdda[_0x5cfe('0x6')]('ChatMessage',attributes,{'tableName':_0x5cfe('0x7'),'paranoid':![],'indexes':[{'name':_0x5cfe('0x8'),'fields':[_0x5cfe('0x9')],'type':_0x5cfe('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x73f7b2,_0x19bce2,_0x1f9cb2){var _0x1e9498=_0x26bdda[_0x5cfe('0xb')];var _0x4788da=_0x73f7b2[_0x5cfe('0xc')]({'plain':!![]});if(_0x4788da[_0x5cfe('0xd')]['toLowerCase']()==='in'||_0x4788da[_0x5cfe('0xd')][_0x5cfe('0xe')]()==='out'&&!_0x4788da[_0x5cfe('0xf')]&&!_['isNil'](_0x4788da['UserId'])){_0x1e9498[_0x5cfe('0x10')]['findOne']({'where':{'id':_0x4788da[_0x5cfe('0x11')]}})['then'](function(_0x59de75){if(_0x59de75){_0x59de75[_0x5cfe('0x12')]({'lastMsgAt':_0x4788da['createdAt'],'lastMsgDirection':_0x4788da[_0x5cfe('0xd')]['toLowerCase']()});}})['catch'](function(_0x169bf5){console['error'](_0x169bf5);});}_0x1f9cb2();}},'charset':'utf8mb4','collate':_0x5cfe('0x13')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2511603..7d6b9e8 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 _0xc5dc=['message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5dc,0x128));var _0xcc5d=function(_0x52826e,_0x3812c4){_0x52826e=_0x52826e-0x0;var _0x3fecd9=_0xc5dc[_0x52826e];return _0x3fecd9;};'use strict';var _=require(_0xcc5d('0x0'));var util=require(_0xcc5d('0x1'));var moment=require(_0xcc5d('0x2'));var BPromise=require(_0xcc5d('0x3'));var rs=require(_0xcc5d('0x4'));var fs=require('fs');var Redis=require(_0xcc5d('0x5'));var db=require(_0xcc5d('0x6'))['db'];var utils=require(_0xcc5d('0x7'));var logger=require(_0xcc5d('0x8'))(_0xcc5d('0x9'));var config=require(_0xcc5d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcc5d('0xb')][_0xcc5d('0xc')]({'port':0x232a});config[_0xcc5d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcc5d('0xe'))(new Redis(config[_0xcc5d('0xd')]));require(_0xcc5d('0xf'))[_0xcc5d('0x10')](socket);function respondWithRpcPromise(_0x469175,_0x11998d,_0x1030e7){return new BPromise(function(_0x5b78e0,_0x532fc1){return client['request'](_0x469175,_0x1030e7)[_0xcc5d('0x11')](function(_0x7ded01){logger[_0xcc5d('0x12')](_0xcc5d('0x13'),_0x11998d,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x11998d,'request\x20sent',JSON[_0xcc5d('0x14')](_0x7ded01));if(_0x7ded01[_0xcc5d('0x15')]){if(_0x7ded01['error'][_0xcc5d('0x16')]===0x1f4){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01['error'][_0xcc5d('0x17')]);return _0x532fc1(_0x7ded01[_0xcc5d('0x15')]['message']);}logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x7ded01[_0xcc5d('0x15')]['message']);return _0x5b78e0(_0x7ded01['error'][_0xcc5d('0x17')]);}else{logger['info'](_0xcc5d('0x13'),_0x11998d,_0xcc5d('0x18'));_0x5b78e0(_0x7ded01[_0xcc5d('0x19')][_0xcc5d('0x17')]);}})[_0xcc5d('0x1a')](function(_0x3f4eea){logger[_0xcc5d('0x15')](_0xcc5d('0x13'),_0x11998d,_0x3f4eea);_0x532fc1(_0x3f4eea);});});}exports[_0xcc5d('0x1b')]=function(_0x306aeb){var _0x302203=this;return new Promise(function(_0x4f2d54,_0x154fea){return db[_0xcc5d('0x1c')]['create'](_0x306aeb['body'],{'raw':_0x306aeb['options']?_0x306aeb['options']['raw']===undefined?!![]:![]:!![]})[_0xcc5d('0x11')](function(_0x2b0ae3){logger['info'](_0xcc5d('0x1b'),_0x306aeb);logger['debug'](_0xcc5d('0x1b'),_0x306aeb,JSON[_0xcc5d('0x14')](_0x2b0ae3));_0x4f2d54(_0x2b0ae3);})[_0xcc5d('0x1a')](function(_0x3c107d){logger[_0xcc5d('0x15')](_0xcc5d('0x1b'),_0x3c107d[_0xcc5d('0x17')],_0x306aeb);_0x154fea(_0x302203[_0xcc5d('0x15')](0x1f4,_0x3c107d[_0xcc5d('0x17')]));});});}; \ No newline at end of file +var _0x9ed7=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create','body'];(function(_0x57f6ac,_0xe1e134){var _0x55a690=function(_0x59e6ed){while(--_0x59e6ed){_0x57f6ac['push'](_0x57f6ac['shift']());}};_0x55a690(++_0xe1e134);}(_0x9ed7,0x1a6));var _0x79ed=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x9ed7[_0x2cacef];return _0x289ba6;};'use strict';var _=require(_0x79ed('0x0'));var util=require(_0x79ed('0x1'));var moment=require(_0x79ed('0x2'));var BPromise=require('bluebird');var rs=require(_0x79ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79ed('0x4'))['db'];var utils=require(_0x79ed('0x5'));var logger=require(_0x79ed('0x6'))(_0x79ed('0x7'));var config=require(_0x79ed('0x8'));var jayson=require(_0x79ed('0x9'));var client=jayson[_0x79ed('0xa')]['http']({'port':0x232a});config[_0x79ed('0xb')]=_[_0x79ed('0xc')](config[_0x79ed('0xb')],{'host':_0x79ed('0xd'),'port':0x18eb});var socket=require(_0x79ed('0xe'))(new Redis(config[_0x79ed('0xb')]));require(_0x79ed('0xf'))['register'](socket);function respondWithRpcPromise(_0xc900c6,_0x5d824b,_0x5ed6ba){return new BPromise(function(_0x47cf4f,_0x130dc8){return client[_0x79ed('0x10')](_0xc900c6,_0x5ed6ba)[_0x79ed('0x11')](function(_0xc84329){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5d824b,_0x79ed('0x12'));logger[_0x79ed('0x13')](_0x79ed('0x14'),_0x5d824b,'request\x20sent',JSON[_0x79ed('0x15')](_0xc84329));if(_0xc84329[_0x79ed('0x16')]){if(_0xc84329[_0x79ed('0x16')][_0x79ed('0x17')]===0x1f4){logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0xc84329[_0x79ed('0x16')]['message']);return _0x130dc8(_0xc84329[_0x79ed('0x16')][_0x79ed('0x19')]);}logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0xc84329['error'][_0x79ed('0x19')]);return _0x47cf4f(_0xc84329[_0x79ed('0x16')][_0x79ed('0x19')]);}else{logger[_0x79ed('0x1a')](_0x79ed('0x18'),_0x5d824b,_0x79ed('0x12'));_0x47cf4f(_0xc84329[_0x79ed('0x1b')][_0x79ed('0x19')]);}})[_0x79ed('0x1c')](function(_0x22d2f7){logger[_0x79ed('0x16')](_0x79ed('0x18'),_0x5d824b,_0x22d2f7);_0x130dc8(_0x22d2f7);});});}exports[_0x79ed('0x1d')]=function(_0x5e7c58){var _0x11f5df=this;return new Promise(function(_0x58c32a,_0x3dc35){return db[_0x79ed('0x1e')][_0x79ed('0x1f')](_0x5e7c58[_0x79ed('0x20')],{'raw':_0x5e7c58['options']?_0x5e7c58[_0x79ed('0x21')][_0x79ed('0x22')]===undefined?!![]:![]:!![]})[_0x79ed('0x11')](function(_0x25d67e){logger[_0x79ed('0x1a')](_0x79ed('0x1d'),_0x5e7c58);logger[_0x79ed('0x13')](_0x79ed('0x1d'),_0x5e7c58,JSON[_0x79ed('0x15')](_0x25d67e));_0x58c32a(_0x25d67e);})['catch'](function(_0x572c85){logger[_0x79ed('0x16')](_0x79ed('0x1d'),_0x572c85[_0x79ed('0x19')],_0x5e7c58);_0x3dc35(_0x11f5df[_0x79ed('0x16')](0x1f4,_0x572c85[_0x79ed('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9dff581..61d276a 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 _0x2caf=['removeListener','register','length','chatMessage:','update','emit'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x2caf,0x6a));var _0xf2ca=function(_0x10c139,_0x356b39){_0x10c139=_0x10c139-0x0;var _0x4dfd12=_0x2caf[_0x10c139];return _0x4dfd12;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){ChatMessageEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);ChatMessageEvents['on'](_0x57e3e8,_0x4ea38c);}}; \ No newline at end of file +var _0xf3cc=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0xf3cc[_0x46939d];return _0x5105e8;};'use strict';var ChatMessageEvents=require(_0xcf3c('0x0'));var events=[_0xcf3c('0x1'),_0xcf3c('0x2'),_0xcf3c('0x3')];function createListener(_0x48d2a6,_0x3b60ce){return function(_0x14ec9a){_0x3b60ce[_0xcf3c('0x4')](_0x48d2a6,_0x14ec9a);};}function removeListener(_0x582153,_0x2e0b47){return function(){ChatMessageEvents[_0xcf3c('0x5')](_0x582153,_0x2e0b47);};}exports['register']=function(_0x41f804){for(var _0x2b5cae=0x0,_0x35cb18=events[_0xcf3c('0x6')];_0x2b5cae<_0x35cb18;_0x2b5cae++){var _0x11deda=events[_0x2b5cae];var _0x147e12=createListener(_0xcf3c('0x7')+_0x11deda,_0x41f804);ChatMessageEvents['on'](_0x11deda,_0x147e12);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index fd34c22..d580049 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 _0x33e3=['fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','post','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x25abad,_0x19f0a3){var _0x3f8903=function(_0x439e08){while(--_0x439e08){_0x25abad['push'](_0x25abad['shift']());}};_0x3f8903(++_0x19f0a3);}(_0x33e3,0x194));var _0x333e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33e3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x333e('0x0'));var util=require('util');var path=require(_0x333e('0x1'));var timeout=require(_0x333e('0x2'));var express=require('express');var router=express[_0x333e('0x3')]();var fs_extra=require(_0x333e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x333e('0x5'));var config=require(_0x333e('0x6'));var controller=require(_0x333e('0x7'));router[_0x333e('0x8')]('/',auth[_0x333e('0x9')](),controller[_0x333e('0xa')]);router[_0x333e('0x8')]('/describe',auth[_0x333e('0x9')](),controller['describe']);router[_0x333e('0x8')](_0x333e('0xb'),auth[_0x333e('0x9')](),controller['show']);router[_0x333e('0xc')]('/',auth[_0x333e('0x9')](),interaction['tracked'](_0x333e('0xd'),_0x333e('0xe')),controller['create']);router['put'](_0x333e('0xb'),controller[_0x333e('0xf')]);router[_0x333e('0x10')](_0x333e('0x11'),auth[_0x333e('0x9')](),controller[_0x333e('0x12')]);router['put'](_0x333e('0x13'),auth[_0x333e('0x9')](),controller[_0x333e('0x14')]);router[_0x333e('0x15')](_0x333e('0xb'),auth['isAuthenticated'](),controller[_0x333e('0x16')]);module[_0x333e('0x17')]=router; \ No newline at end of file +var _0xf961=['show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x290dc1,_0x27decd){var _0x13d597=function(_0x1f2d11){while(--_0x1f2d11){_0x290dc1['push'](_0x290dc1['shift']());}};_0x13d597(++_0x27decd);}(_0xf961,0x68));var _0x1f96=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf961[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0x1f96('0x0'));var util=require(_0x1f96('0x1'));var path=require(_0x1f96('0x2'));var timeout=require(_0x1f96('0x3'));var express=require('express');var router=express[_0x1f96('0x4')]();var fs_extra=require(_0x1f96('0x5'));var auth=require(_0x1f96('0x6'));var interaction=require(_0x1f96('0x7'));var config=require(_0x1f96('0x8'));var controller=require(_0x1f96('0x9'));router[_0x1f96('0xa')]('/',auth[_0x1f96('0xb')](),controller[_0x1f96('0xc')]);router[_0x1f96('0xa')](_0x1f96('0xd'),auth['isAuthenticated'](),controller[_0x1f96('0xe')]);router[_0x1f96('0xa')](_0x1f96('0xf'),auth[_0x1f96('0xb')](),controller[_0x1f96('0x10')]);router[_0x1f96('0x11')]('/',auth[_0x1f96('0xb')](),interaction[_0x1f96('0x12')](_0x1f96('0x13'),_0x1f96('0x14')),controller[_0x1f96('0x15')]);router[_0x1f96('0x16')](_0x1f96('0xf'),controller[_0x1f96('0x17')]);router[_0x1f96('0x16')](_0x1f96('0x18'),auth[_0x1f96('0xb')](),controller[_0x1f96('0x19')]);router[_0x1f96('0x16')]('/:id/reject',auth[_0x1f96('0xb')](),controller[_0x1f96('0x1a')]);router[_0x1f96('0x1b')]('/:id',auth[_0x1f96('0xb')](),controller[_0x1f96('0x1c')]);module[_0x1f96('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8ab366c..7005f07 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 _0x757a=['exports','TEXT'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x757a,0xde));var _0xa757=function(_0x1f6404,_0x37e8b6){_0x1f6404=_0x1f6404-0x0;var _0x235f56=_0x757a[_0x1f6404];return _0x235f56;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0x0b0e[_0x409682];return _0x1ee901;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 57ae78f..a899547 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x968120,_0x31a9ce){var _0x4925d0=function(_0x5d4834){while(--_0x5d4834){_0x968120['push'](_0x968120['shift']());}};_0x4925d0(++_0x31a9ce);}(_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['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7a54,0x106));var _0x47a5=function(_0x735ea2,_0x25d9cb){_0x735ea2=_0x735ea2-0x0;var _0x271167=_0x7a54[_0x735ea2];return _0x271167;};'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 e4bf32d..989456e 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 _0x39c7=['save','update','remove','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x3e4a34,_0x452723){var _0x2d2d2e=function(_0x1378ec){while(--_0x1378ec){_0x3e4a34['push'](_0x3e4a34['shift']());}};_0x2d2d2e(++_0x452723);}(_0x39c7,0x85));var _0x739c=function(_0x14ec1f,_0x59ef2f){_0x14ec1f=_0x14ec1f-0x0;var _0x5cecb3=_0x39c7[_0x14ec1f];return _0x5cecb3;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x739c('0x0'))['db'][_0x739c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x739c('0x2')](0x0);var events={'afterCreate':_0x739c('0x3'),'afterUpdate':_0x739c('0x4'),'afterDestroy':_0x739c('0x5')};function emitEvent(_0x48c547){return function(_0x11c0a6,_0xff8215,_0x43dd74){ChatOfflineMessageEvents['emit'](_0x48c547+':'+_0x11c0a6['id'],_0x11c0a6);ChatOfflineMessageEvents['emit'](_0x48c547,_0x11c0a6);_0x43dd74(null);};}for(var e in events){if(events[_0x739c('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x739c('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xab13=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','update','remove'];(function(_0x13039,_0x19f3fe){var _0x52a0e3=function(_0x107cc3){while(--_0x107cc3){_0x13039['push'](_0x13039['shift']());}};_0x52a0e3(++_0x19f3fe);}(_0xab13,0x8b));var _0x3ab1=function(_0x11c913,_0x1c6f22){_0x11c913=_0x11c913-0x0;var _0x5ba6eb=_0xab13[_0x11c913];return _0x5ba6eb;};'use strict';var EventEmitter=require(_0x3ab1('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3ab1('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3ab1('0x2'),'afterUpdate':_0x3ab1('0x3'),'afterDestroy':_0x3ab1('0x4')};function emitEvent(_0x59262c){return function(_0x49ff19,_0x87151e,_0xb90526){ChatOfflineMessageEvents[_0x3ab1('0x5')](_0x59262c+':'+_0x49ff19['id'],_0x49ff19);ChatOfflineMessageEvents[_0x3ab1('0x5')](_0x59262c,_0x49ff19);_0xb90526(null);};}for(var e in events){if(events[_0x3ab1('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3ab1('0x7')](e,emitEvent(event));}}module[_0x3ab1('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 8a2d7db..404aac7 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 _0x0360=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x504f4a,_0x523da1){var _0x1b029f=function(_0x3f18a4){while(--_0x3f18a4){_0x504f4a['push'](_0x504f4a['shift']());}};_0x1b029f(++_0x523da1);}(_0x0360,0x15e));var _0x0036=function(_0xd9d48b,_0x5389be){_0xd9d48b=_0xd9d48b-0x0;var _0x44973c=_0x0360[_0xd9d48b];return _0x44973c;};'use strict';var attributes=require(_0x0036('0x0'));module[_0x0036('0x1')]=function(_0x356a41){return _0x356a41['define'](_0x0036('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0036('0x3'),'collate':_0x0036('0x4')});}; \ No newline at end of file +var _0x0b7d=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b7d,0x79));var _0xd0b7=function(_0x50d471,_0x2d9086){_0x50d471=_0x50d471-0x0;var _0x214900=_0x0b7d[_0x50d471];return _0x214900;};'use strict';var attributes=require(_0xd0b7('0x0'));module[_0xd0b7('0x1')]=function(_0x4c21ee){return _0x4c21ee[_0xd0b7('0x2')](_0xd0b7('0x3'),attributes,{'tableName':_0xd0b7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd0b7('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 06c3aa7..38809d1 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 _0x55a8=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0xab1898,_0x535f14){var _0x3a9c70=function(_0x57bb36){while(--_0x57bb36){_0xab1898['push'](_0xab1898['shift']());}};_0x3a9c70(++_0x535f14);}(_0x55a8,0x148));var _0x855a=function(_0x20af9d,_0x295b){_0x20af9d=_0x20af9d-0x0;var _0x292bf8=_0x55a8[_0x20af9d];return _0x292bf8;};'use strict';var _=require(_0x855a('0x0'));var util=require(_0x855a('0x1'));var moment=require(_0x855a('0x2'));var BPromise=require(_0x855a('0x3'));var rs=require(_0x855a('0x4'));var fs=require('fs');var Redis=require(_0x855a('0x5'));var db=require(_0x855a('0x6'))['db'];var utils=require(_0x855a('0x7'));var logger=require(_0x855a('0x8'))(_0x855a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x855a('0xa')][_0x855a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c579b,_0x5908d6,_0x336987){return new BPromise(function(_0xd30379,_0x3a038b){return client[_0x855a('0xc')](_0x5c579b,_0x336987)[_0x855a('0xd')](function(_0x2b26a6){logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));logger[_0x855a('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5908d6,_0x855a('0x10'),JSON[_0x855a('0x12')](_0x2b26a6));if(_0x2b26a6['error']){if(_0x2b26a6[_0x855a('0x13')]['code']===0x1f4){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0x3a038b(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);return _0xd30379(_0x2b26a6[_0x855a('0x13')][_0x855a('0x14')]);}else{logger[_0x855a('0xe')](_0x855a('0xf'),_0x5908d6,_0x855a('0x10'));_0xd30379(_0x2b26a6[_0x855a('0x15')][_0x855a('0x14')]);}})[_0x855a('0x16')](function(_0x33d9cb){logger[_0x855a('0x13')](_0x855a('0xf'),_0x5908d6,_0x33d9cb);_0x3a038b(_0x33d9cb);});});} \ No newline at end of file +var _0xde15=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x7a68b,_0x964789){var _0x110d37=function(_0x482401){while(--_0x482401){_0x7a68b['push'](_0x7a68b['shift']());}};_0x110d37(++_0x964789);}(_0xde15,0x148));var _0x5de1=function(_0x3b4db4,_0x322fb8){_0x3b4db4=_0x3b4db4-0x0;var _0x532180=_0xde15[_0x3b4db4];return _0x532180;};'use strict';var _=require(_0x5de1('0x0'));var util=require('util');var moment=require(_0x5de1('0x1'));var BPromise=require(_0x5de1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5de1('0x3'));var db=require(_0x5de1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5de1('0x5'))(_0x5de1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5de1('0x7')][_0x5de1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x851ac3,_0x391db2,_0x1b3512){return new BPromise(function(_0x3baddc,_0x162350){return client[_0x5de1('0x9')](_0x851ac3,_0x1b3512)[_0x5de1('0xa')](function(_0x3c5133){logger[_0x5de1('0xb')](_0x5de1('0xc'),_0x391db2,_0x5de1('0xd'));logger['debug'](_0x5de1('0xe'),_0x391db2,_0x5de1('0xd'),JSON[_0x5de1('0xf')](_0x3c5133));if(_0x3c5133[_0x5de1('0x10')]){if(_0x3c5133[_0x5de1('0x10')][_0x5de1('0x11')]===0x1f4){logger[_0x5de1('0x10')](_0x5de1('0xc'),_0x391db2,_0x3c5133['error'][_0x5de1('0x12')]);return _0x162350(_0x3c5133['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x391db2,_0x3c5133[_0x5de1('0x10')][_0x5de1('0x12')]);return _0x3baddc(_0x3c5133[_0x5de1('0x10')]['message']);}else{logger[_0x5de1('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x391db2,_0x5de1('0xd'));_0x3baddc(_0x3c5133[_0x5de1('0x13')][_0x5de1('0x12')]);}})[_0x5de1('0x14')](function(_0x132a68){logger[_0x5de1('0x10')](_0x5de1('0xc'),_0x391db2,_0x132a68);_0x162350(_0x132a68);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 32b777c..9cf0b97 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 _0x5bc7=['isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5bc7,0x125));var _0x75bc=function(_0x583aa4,_0x42ba7e){_0x583aa4=_0x583aa4-0x0;var _0x4f8b7e=_0x5bc7[_0x583aa4];return _0x4f8b7e;};'use strict';var multer=require(_0x75bc('0x0'));var util=require('util');var path=require(_0x75bc('0x1'));var timeout=require(_0x75bc('0x2'));var express=require(_0x75bc('0x3'));var router=express['Router']();var fs_extra=require(_0x75bc('0x4'));var auth=require(_0x75bc('0x5'));var interaction=require(_0x75bc('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x75bc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75bc('0x7')](_0x75bc('0x8'),auth['isAuthenticated'](),controller[_0x75bc('0x9')]);router['get'](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller[_0x75bc('0xc')]);router[_0x75bc('0xd')]('/',auth[_0x75bc('0xb')](),controller[_0x75bc('0xe')]);router[_0x75bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75bc('0x10')]);router[_0x75bc('0x11')](_0x75bc('0xa'),auth[_0x75bc('0xb')](),controller['destroy']);module[_0x75bc('0x12')]=router; \ No newline at end of file +var _0x73db=['/describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x73db,0x1ec));var _0xb73d=function(_0x35984f,_0x499c98){_0x35984f=_0x35984f-0x0;var _0x5b7bb3=_0x73db[_0x35984f];return _0x5b7bb3;};'use strict';var multer=require(_0xb73d('0x0'));var util=require('util');var path=require(_0xb73d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb73d('0x2'));var router=express[_0xb73d('0x3')]();var fs_extra=require(_0xb73d('0x4'));var auth=require(_0xb73d('0x5'));var interaction=require(_0xb73d('0x6'));var config=require(_0xb73d('0x7'));var controller=require(_0xb73d('0x8'));router[_0xb73d('0x9')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0xb')]);router[_0xb73d('0x9')](_0xb73d('0xc'),auth[_0xb73d('0xa')](),controller['describe']);router[_0xb73d('0x9')](_0xb73d('0xd'),auth[_0xb73d('0xa')](),controller[_0xb73d('0xe')]);router[_0xb73d('0xf')]('/',auth[_0xb73d('0xa')](),controller[_0xb73d('0x10')]);router['put']('/:id',auth[_0xb73d('0xa')](),controller[_0xb73d('0x11')]);router[_0xb73d('0x12')](_0xb73d('0xd'),auth[_0xb73d('0xa')](),controller[_0xb73d('0x13')]);module[_0xb73d('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c14cb0d..b29ac00 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 _0xec46=['exports','STRING','ENUM','INTEGER','sequelize'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xec46,0xf4));var _0x6ec4=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xec46[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'name':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6ec4('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6ec4('0x2')]},'timeout':{'type':Sequelize[_0x6ec4('0x4')]}}; \ No newline at end of file +var _0x1ebd=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x2c504e,_0x380208){var _0x2fc226=function(_0x4b893a){while(--_0x4b893a){_0x2c504e['push'](_0x2c504e['shift']());}};_0x2fc226(++_0x380208);}(_0x1ebd,0x155));var _0xd1eb=function(_0x5804d7,_0x2461bf){_0x5804d7=_0x5804d7-0x0;var _0x15cad0=_0x1ebd[_0x5804d7];return _0x15cad0;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd1eb('0x3')](_0xd1eb('0x4'),_0xd1eb('0x5')),'defaultValue':_0xd1eb('0x4')},'selector':{'type':Sequelize[_0xd1eb('0x2')]},'timeout':{'type':Sequelize[_0xd1eb('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4e358f1..e891936 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 _0x83d3=['bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','show','params','keys','query','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x28c8cb,_0x5895e1){var _0x365af1=function(_0x12b9bd){while(--_0x12b9bd){_0x28c8cb['push'](_0x28c8cb['shift']());}};_0x365af1(++_0x5895e1);}(_0x83d3,0x17c));var _0x383d=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x83d3[_0x36da00];return _0x4b72c5;};'use strict';var emlformat=require(_0x383d('0x0'));var rimraf=require(_0x383d('0x1'));var zipdir=require(_0x383d('0x2'));var jsonpatch=require(_0x383d('0x3'));var rp=require(_0x383d('0x4'));var moment=require('moment');var BPromise=require(_0x383d('0x5'));var Mustache=require(_0x383d('0x6'));var util=require(_0x383d('0x7'));var path=require(_0x383d('0x8'));var sox=require('sox');var csv=require(_0x383d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x383d('0xa'));var squel=require(_0x383d('0xb'));var crypto=require(_0x383d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x383d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x383d('0xe'));var Redis=require(_0x383d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x383d('0x10'));var as=require(_0x383d('0x11'));var hardwareService=require(_0x383d('0x12'));var logger=require(_0x383d('0x13'))(_0x383d('0x14'));var utils=require(_0x383d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e7cf,_0x538c32){_0x538c32=_0x538c32||0xcc;return function(_0x3d5b63){if(_0x3d5b63){return _0x15e7cf[_0x383d('0x16')](_0x538c32);}return _0x15e7cf[_0x383d('0x17')](_0x538c32)[_0x383d('0x18')]();};}function respondWithResult(_0x4c6d4f,_0x556fee){_0x556fee=_0x556fee||0xc8;return function(_0x3999d7){if(_0x3999d7){return _0x4c6d4f['status'](_0x556fee)[_0x383d('0x19')](_0x3999d7);}};}function respondWithFilteredResult(_0x5afc53,_0x531e18){return function(_0x294423){if(_0x294423){var _0x31abf5=typeof _0x531e18['offset']==='undefined'&&typeof _0x531e18[_0x383d('0x1a')]===_0x383d('0x1b');var _0x5be3d7=_0x294423[_0x383d('0x1c')];var _0x18dc97=_0x31abf5?0x0:_0x531e18[_0x383d('0x1d')];var _0xc7868=_0x31abf5?_0x294423[_0x383d('0x1c')]:_0x531e18[_0x383d('0x1d')]+_0x531e18[_0x383d('0x1a')];var _0x55fb74;if(_0xc7868>=_0x5be3d7){_0xc7868=_0x5be3d7;_0x55fb74=0xc8;}else{_0x55fb74=0xce;}_0x5afc53[_0x383d('0x17')](_0x55fb74);return _0x5afc53[_0x383d('0x1e')](_0x383d('0x1f'),_0x18dc97+'-'+_0xc7868+'/'+_0x5be3d7)[_0x383d('0x19')](_0x294423);}return null;};}function patchUpdates(_0x2043e5){return function(_0x45ee85){try{jsonpatch[_0x383d('0x20')](_0x45ee85,_0x2043e5,!![]);}catch(_0x562a28){return BPromise['reject'](_0x562a28);}return _0x45ee85[_0x383d('0x21')]();};}function saveUpdates(_0x28b880,_0x4e3d9e){return function(_0x17d883){if(_0x17d883){return _0x17d883[_0x383d('0x22')](_0x28b880)[_0x383d('0x23')](function(_0x45d1a1){return _0x45d1a1;});}return null;};}function removeEntity(_0x3e36a2,_0x376ea7){return function(_0xcbedc9){if(_0xcbedc9){return _0xcbedc9[_0x383d('0x24')]()[_0x383d('0x23')](function(){_0x3e36a2[_0x383d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x599756,_0x1d5a10){return function(_0x1e5a7f){if(!_0x1e5a7f){_0x599756[_0x383d('0x16')](0x194);}return _0x1e5a7f;};}function handleError(_0x70fdba,_0x267643){_0x267643=_0x267643||0x1f4;return function(_0x1d553b){logger[_0x383d('0x25')](_0x1d553b['stack']);if(_0x1d553b[_0x383d('0x26')]){delete _0x1d553b[_0x383d('0x26')];}_0x70fdba['status'](_0x267643)['send'](_0x1d553b);};}exports[_0x383d('0x27')]=function(_0x3f86e2,_0x13f872){var _0xbe4a1f={'raw':!![],'where':{'id':_0x3f86e2[_0x383d('0x28')]['id']}},_0x202853={};_0x202853['model']=_[_0x383d('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x202853[_0x383d('0x2a')]=_[_0x383d('0x29')](_0x3f86e2[_0x383d('0x2a')]);_0x202853['filters']=_[_0x383d('0x2b')](_0x202853[_0x383d('0x2c')],_0x202853['query']);_0xbe4a1f[_0x383d('0x2d')]=_[_0x383d('0x2b')](_0x202853['model'],qs[_0x383d('0x2e')](_0x3f86e2['query'][_0x383d('0x2e')]));_0xbe4a1f[_0x383d('0x2d')]=_0xbe4a1f['attributes'][_0x383d('0x2f')]?_0xbe4a1f['attributes']:_0x202853[_0x383d('0x2c')];if(_0x3f86e2['query'][_0x383d('0x30')]){_0xbe4a1f['include']=[{'all':!![]}];}_0xbe4a1f=_[_0x383d('0x31')]({},_0xbe4a1f,_0x3f86e2['options']);return db[_0x383d('0x32')][_0x383d('0x33')](_0xbe4a1f)[_0x383d('0x23')](handleEntityNotFound(_0x13f872,null))[_0x383d('0x23')](respondWithResult(_0x13f872,null))['catch'](handleError(_0x13f872,null));};exports[_0x383d('0x34')]=function(_0x5379cc,_0x23aeb4){return db[_0x383d('0x32')][_0x383d('0x34')](_0x5379cc[_0x383d('0x35')],{})[_0x383d('0x23')](respondWithResult(_0x23aeb4,0xc9))[_0x383d('0x36')](handleError(_0x23aeb4,null));};exports['update']=function(_0x386f89,_0x5cc6c4){if(_0x386f89[_0x383d('0x35')]['id']){delete _0x386f89['body']['id'];}return db[_0x383d('0x32')][_0x383d('0x33')]({'where':{'id':_0x386f89[_0x383d('0x28')]['id']}})['then'](handleEntityNotFound(_0x5cc6c4,null))[_0x383d('0x23')](saveUpdates(_0x386f89[_0x383d('0x35')],null))[_0x383d('0x23')](respondWithResult(_0x5cc6c4,null))['catch'](handleError(_0x5cc6c4,null));};exports[_0x383d('0x24')]=function(_0x51aa4c,_0x38f783){return db[_0x383d('0x32')]['find']({'where':{'id':_0x51aa4c['params']['id']}})[_0x383d('0x23')](handleEntityNotFound(_0x38f783,null))[_0x383d('0x23')](removeEntity(_0x38f783,null))[_0x383d('0x36')](handleError(_0x38f783,null));}; \ No newline at end of file +var _0x0e85=['length','include','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0e85,0x7c));var _0x50e8=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x0e85[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['show']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={'raw':!![],'where':{'id':_0x30fedf[_0x50e8('0x28')]['id']}},_0x4f0b88={};_0x4f0b88[_0x50e8('0x29')]=_[_0x50e8('0x2a')](db[_0x50e8('0x2b')][_0x50e8('0x2c')]);_0x4f0b88[_0x50e8('0x2d')]=_[_0x50e8('0x2a')](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x4f0b88['model'],_0x4f0b88['query']);_0x42bbef[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x4f0b88[_0x50e8('0x29')],qs['fields'](_0x30fedf['query'][_0x50e8('0x31')]));_0x42bbef[_0x50e8('0x30')]=_0x42bbef['attributes'][_0x50e8('0x32')]?_0x42bbef[_0x50e8('0x30')]:_0x4f0b88[_0x50e8('0x29')];if(_0x30fedf[_0x50e8('0x2d')]['includeAll']){_0x42bbef[_0x50e8('0x33')]=[{'all':!![]}];}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x34')]);return db[_0x50e8('0x2b')][_0x50e8('0x35')](_0x42bbef)['then'](handleEntityNotFound(_0x39c0c6,null))[_0x50e8('0x23')](respondWithResult(_0x39c0c6,null))[_0x50e8('0x36')](handleError(_0x39c0c6,null));};exports['create']=function(_0x245b45,_0x1c2fdb){return db[_0x50e8('0x2b')][_0x50e8('0x37')](_0x245b45['body'],{})[_0x50e8('0x23')](respondWithResult(_0x1c2fdb,0xc9))[_0x50e8('0x36')](handleError(_0x1c2fdb,null));};exports[_0x50e8('0x22')]=function(_0x4e2a37,_0x5e556c){if(_0x4e2a37[_0x50e8('0x38')]['id']){delete _0x4e2a37[_0x50e8('0x38')]['id'];}return db[_0x50e8('0x2b')]['find']({'where':{'id':_0x4e2a37['params']['id']}})['then'](handleEntityNotFound(_0x5e556c,null))[_0x50e8('0x23')](saveUpdates(_0x4e2a37[_0x50e8('0x38')],null))[_0x50e8('0x23')](respondWithResult(_0x5e556c,null))[_0x50e8('0x36')](handleError(_0x5e556c,null));};exports[_0x50e8('0x39')]=function(_0x18986f,_0xb566c2){return db[_0x50e8('0x2b')][_0x50e8('0x35')]({'where':{'id':_0x18986f[_0x50e8('0x28')]['id']}})['then'](handleEntityNotFound(_0xb566c2,null))[_0x50e8('0x23')](removeEntity(_0xb566c2,null))[_0x50e8('0x36')](handleError(_0xb566c2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ce6a2d6..9466792 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 _0xc491=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x95612a,_0x5e6fbc){var _0x38de09=function(_0xaaf990){while(--_0xaaf990){_0x95612a['push'](_0x95612a['shift']());}};_0x38de09(++_0x5e6fbc);}(_0xc491,0x1a8));var _0x1c49=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xc491[_0x2c6810];return _0x213881;};'use strict';var _=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var logger=require(_0x1c49('0x2'))(_0x1c49('0x3'));var moment=require(_0x1c49('0x4'));var BPromise=require(_0x1c49('0x5'));var rp=require(_0x1c49('0x6'));var fs=require('fs');var path=require(_0x1c49('0x7'));var rimraf=require(_0x1c49('0x8'));var config=require(_0x1c49('0x9'));var attributes=require(_0x1c49('0xa'));module['exports']=function(_0x4dde76,_0x308f17){return _0x4dde76[_0x1c49('0xb')](_0x1c49('0xc'),attributes,{'tableName':_0x1c49('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa04e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x167a7,_0x386464){var _0x32991a=function(_0xf6d675){while(--_0xf6d675){_0x167a7['push'](_0x167a7['shift']());}};_0x32991a(++_0x386464);}(_0xa04e,0x1ad));var _0xea04=function(_0x53a142,_0x3498b0){_0x53a142=_0x53a142-0x0;var _0x461127=_0xa04e[_0x53a142];return _0x461127;};'use strict';var _=require(_0xea04('0x0'));var util=require(_0xea04('0x1'));var logger=require(_0xea04('0x2'))(_0xea04('0x3'));var moment=require(_0xea04('0x4'));var BPromise=require(_0xea04('0x5'));var rp=require(_0xea04('0x6'));var fs=require('fs');var path=require(_0xea04('0x7'));var rimraf=require('rimraf');var config=require(_0xea04('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xea04('0x9')]=function(_0x30d672,_0x973b81){return _0x30d672[_0xea04('0xa')](_0xea04('0xb'),attributes,{'tableName':_0xea04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index fbb4663..ca991e4 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 _0xf8d2=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x274d4b,_0x128681){var _0x1a1f03=function(_0x420675){while(--_0x420675){_0x274d4b['push'](_0x274d4b['shift']());}};_0x1a1f03(++_0x128681);}(_0xf8d2,0x162));var _0x2f8d=function(_0x3f0a7c,_0x16edda){_0x3f0a7c=_0x3f0a7c-0x0;var _0x2b3a28=_0xf8d2[_0x3f0a7c];return _0x2b3a28;};'use strict';var _=require(_0x2f8d('0x0'));var util=require(_0x2f8d('0x1'));var moment=require(_0x2f8d('0x2'));var BPromise=require(_0x2f8d('0x3'));var rs=require(_0x2f8d('0x4'));var fs=require('fs');var Redis=require(_0x2f8d('0x5'));var db=require(_0x2f8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f8d('0x7'))(_0x2f8d('0x8'));var config=require(_0x2f8d('0x9'));var jayson=require(_0x2f8d('0xa'));var client=jayson['client'][_0x2f8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52f9fc,_0x4705b6,_0x2bd0b1){return new BPromise(function(_0x409128,_0x4108b1){return client[_0x2f8d('0xc')](_0x52f9fc,_0x2bd0b1)[_0x2f8d('0xd')](function(_0x10a487){logger[_0x2f8d('0xe')](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));logger[_0x2f8d('0x11')](_0x2f8d('0x12'),_0x4705b6,_0x2f8d('0x10'),JSON[_0x2f8d('0x13')](_0x10a487));if(_0x10a487[_0x2f8d('0x14')]){if(_0x10a487[_0x2f8d('0x14')][_0x2f8d('0x15')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x4108b1(_0x10a487['error'][_0x2f8d('0x16')]);}logger[_0x2f8d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x10a487[_0x2f8d('0x14')]['message']);return _0x409128(_0x10a487[_0x2f8d('0x14')]['message']);}else{logger['info'](_0x2f8d('0xf'),_0x4705b6,_0x2f8d('0x10'));_0x409128(_0x10a487[_0x2f8d('0x17')][_0x2f8d('0x16')]);}})[_0x2f8d('0x18')](function(_0x516dd5){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4705b6,_0x516dd5);_0x4108b1(_0x516dd5);});});} \ No newline at end of file +var _0xbce4=['code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','stringify','error'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0xbce4,0x83));var _0x4bce=function(_0x4c13ca,_0xfad5da){_0x4c13ca=_0x4c13ca-0x0;var _0x17b3d6=_0xbce4[_0x4c13ca];return _0x17b3d6;};'use strict';var _=require(_0x4bce('0x0'));var util=require(_0x4bce('0x1'));var moment=require('moment');var BPromise=require(_0x4bce('0x2'));var rs=require(_0x4bce('0x3'));var fs=require('fs');var Redis=require(_0x4bce('0x4'));var db=require(_0x4bce('0x5'))['db'];var utils=require(_0x4bce('0x6'));var logger=require(_0x4bce('0x7'))(_0x4bce('0x8'));var config=require(_0x4bce('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40e59c,_0x1df39e,_0x14b723){return new BPromise(function(_0x3f193b,_0x2a33f8){return client[_0x4bce('0xb')](_0x40e59c,_0x14b723)['then'](function(_0x3164a1){logger[_0x4bce('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x1df39e,_0x4bce('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1df39e,_0x4bce('0xd'),JSON[_0x4bce('0xe')](_0x3164a1));if(_0x3164a1[_0x4bce('0xf')]){if(_0x3164a1[_0x4bce('0xf')][_0x4bce('0x10')]===0x1f4){logger[_0x4bce('0xf')](_0x4bce('0x11'),_0x1df39e,_0x3164a1[_0x4bce('0xf')][_0x4bce('0x12')]);return _0x2a33f8(_0x3164a1[_0x4bce('0xf')][_0x4bce('0x12')]);}logger['error'](_0x4bce('0x11'),_0x1df39e,_0x3164a1['error'][_0x4bce('0x12')]);return _0x3f193b(_0x3164a1['error'][_0x4bce('0x12')]);}else{logger['info'](_0x4bce('0x11'),_0x1df39e,_0x4bce('0xd'));_0x3f193b(_0x3164a1[_0x4bce('0x13')]['message']);}})[_0x4bce('0x14')](function(_0x58d449){logger[_0x4bce('0xf')](_0x4bce('0x11'),_0x1df39e,_0x58d449);_0x2a33f8(_0x58d449);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c0a4b95..b24f071 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x52c30a,_0x40107d){var _0x33a05b=function(_0x404d55){while(--_0x404d55){_0x52c30a['push'](_0x52c30a['shift']());}};_0x33a05b(++_0x40107d);}(_0xf494,0x1c6));var _0x4f49=function(_0x326109,_0x2055e0){_0x326109=_0x326109-0x0;var _0x3302d4=_0xf494[_0x326109];return _0x3302d4;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router; \ No newline at end of file +var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0xf85f5a,_0x4e8dae){var _0x48408a=function(_0x1ce554){while(--_0x1ce554){_0xf85f5a['push'](_0xf85f5a['shift']());}};_0x48408a(++_0x4e8dae);}(_0xd8fb,0x99));var _0xbd8f=function(_0x590789,_0x13eb39){_0x590789=_0x590789-0x0;var _0x1a4abe=_0xd8fb[_0x590789];return _0x1a4abe;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 861ca7d..a93012f 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 _0x57a3=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x57a3,0xc0));var _0x357a=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x57a3[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x357a('0x0'));module[_0x357a('0x1')]={'name':{'type':Sequelize[_0x357a('0x2')],'unique':_0x357a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x357a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x357a('0x5')](_0x357a('0x6'),'beepall',_0x357a('0x7'))}}; \ No newline at end of file +var _0x0021=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x0021,0x1dc));var _0x1002=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x0021[_0x28014d];return _0x2572cc;};'use strict';var Sequelize=require(_0x1002('0x0'));module[_0x1002('0x1')]={'name':{'type':Sequelize[_0x1002('0x2')],'unique':_0x1002('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1002('0x2')]},'timeout':{'type':Sequelize[_0x1002('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1002('0x5')](_0x1002('0x6'),'beepall',_0x1002('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c205ab0..0b24dfe 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 _0xa578=['chatPause','createdAt','getTeams','Team','length','sort','addTeams','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','rows','catch','show','model','keys','filters','intersection','attributes','fields','query','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','pick','ChatQueueId','filter','findAll','findAndCountAll','agent','updatedAt','SIP'];(function(_0x3a7f15,_0x48ac0d){var _0x3b7ec9=function(_0x356ad3){while(--_0x356ad3){_0x3a7f15['push'](_0x3a7f15['shift']());}};_0x3b7ec9(++_0x48ac0d);}(_0xa578,0x19d));var _0x8a57=function(_0x47df4c,_0x55115e){_0x47df4c=_0x47df4c-0x0;var _0x3e3610=_0xa578[_0x47df4c];return _0x3e3610;};'use strict';var BPromise=require(_0x8a57('0x0'));var util=require(_0x8a57('0x1'));var _=require(_0x8a57('0x2'));var squel=require(_0x8a57('0x3'));var Redis=require(_0x8a57('0x4'));var qs=require(_0x8a57('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x8a57('0x6'));var db=require(_0x8a57('0x7'))['db'];config[_0x8a57('0x8')]=_['defaults'](config['redis'],{'host':_0x8a57('0x9'),'port':0x18eb});var socket=require(_0x8a57('0xa'))(new Redis(config[_0x8a57('0x8')]));require('./chatQueue.socket')[_0x8a57('0xb')](socket);function respondWithStatusCode(_0x37d3ea,_0x123346){_0x123346=_0x123346||0xcc;return function(_0x4a7841){if(_0x4a7841){return _0x37d3ea[_0x8a57('0xc')](_0x123346);}return _0x37d3ea[_0x8a57('0xd')](_0x123346)[_0x8a57('0xe')]();};}function respondWithResult(_0xd8efb7,_0xe7623f){_0xe7623f=_0xe7623f||0xc8;return function(_0x1437d6){if(_0x1437d6){return _0xd8efb7[_0x8a57('0xd')](_0xe7623f)['json'](_0x1437d6);}};}function respondWithFilteredResult(_0x28d411,_0xe2b24f){return function(_0x326c7c){if(_0x326c7c){var _0x28c2e2=typeof _0xe2b24f[_0x8a57('0xf')]===_0x8a57('0x10')&&typeof _0xe2b24f[_0x8a57('0x11')]===_0x8a57('0x10');var _0x38ec1d=_0x326c7c[_0x8a57('0x12')];var _0x661cfb=_0x28c2e2?0x0:_0xe2b24f['offset'];var _0x31b5af=_0x28c2e2?_0x326c7c[_0x8a57('0x12')]:_0xe2b24f[_0x8a57('0xf')]+_0xe2b24f['limit'];var _0x3f91c9;if(_0x31b5af>=_0x38ec1d){_0x31b5af=_0x38ec1d;_0x3f91c9=0xc8;}else{_0x3f91c9=0xce;}_0x28d411[_0x8a57('0xd')](_0x3f91c9);return _0x28d411['set'](_0x8a57('0x13'),_0x661cfb+'-'+_0x31b5af+'/'+_0x38ec1d)[_0x8a57('0x14')](_0x326c7c);}return null;};}function saveUpdates(_0x13eb4f){return function(_0x1415f3){if(_0x1415f3){return _0x1415f3[_0x8a57('0x15')](_0x13eb4f)[_0x8a57('0x16')](function(_0x430191){return _0x430191;});}return null;};}function removeEntity(_0x4356a5){return function(_0x2a137c){if(_0x2a137c){return _0x2a137c[_0x8a57('0x17')]()[_0x8a57('0x16')](function(){var _0x52e899=_0x2a137c[_0x8a57('0x18')]({'plain':!![]});var _0xb409b4=_0x8a57('0x19');return db[_0x8a57('0x1a')]['destroy']({'where':{'type':_0xb409b4,'resourceId':_0x52e899['id']}})[_0x8a57('0x16')](function(){return _0x2a137c;});})[_0x8a57('0x16')](function(){_0x4356a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x75c993){return function(_0x2b9f92){if(!_0x2b9f92){_0x75c993[_0x8a57('0xc')](0x194);}return _0x2b9f92;};}function handleError(_0x395588,_0x61eecb){_0x61eecb=_0x61eecb||0x1f4;return function(_0x18d8d5){logger[_0x8a57('0x1b')](_0x18d8d5[_0x8a57('0x1c')]);if(_0x18d8d5['name']){delete _0x18d8d5[_0x8a57('0x1d')];}_0x395588[_0x8a57('0xd')](_0x61eecb)[_0x8a57('0x1e')](_0x18d8d5);};}exports[_0x8a57('0x1f')]=function(_0x3313fb,_0x3fe7b4){var _0x1d7c6e={};var _0x3c7a99={'count':0x0,'rows':[]};var _0x6c35de=_[_0x8a57('0x20')](db[_0x8a57('0x21')][_0x8a57('0x22')],function(_0x5b5b38){return{'name':_0x5b5b38[_0x8a57('0x23')],'type':_0x5b5b38['type'][_0x8a57('0x24')]};});_0x1d7c6e=qs[_0x8a57('0x25')](_0x6c35de,_0x3313fb);var _0x51a971={'where':_0x1d7c6e[_0x8a57('0x26')]};return db[_0x8a57('0x21')][_0x8a57('0x12')](_0x51a971)[_0x8a57('0x16')](function(_0x2750e1){_0x3c7a99[_0x8a57('0x12')]=_0x2750e1;_0x1d7c6e[_0x8a57('0x27')]=qs['include'](_0x3313fb['query']);return db[_0x8a57('0x21')]['findAll'](_0x1d7c6e);})[_0x8a57('0x16')](function(_0x4e63e8){_0x3c7a99[_0x8a57('0x28')]=_0x4e63e8;return _0x3c7a99;})[_0x8a57('0x16')](respondWithFilteredResult(_0x3fe7b4,_0x1d7c6e))[_0x8a57('0x29')](handleError(_0x3fe7b4,null));};exports[_0x8a57('0x2a')]=function(_0xab4948,_0x454f79){var _0x1d9f65={'raw':!![],'where':{'id':_0xab4948['params']['id']}},_0x38f081={};_0x38f081[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x21')][_0x8a57('0x22')]);_0x38f081['query']=_[_0x8a57('0x2c')](_0xab4948['query']);_0x38f081[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x38f081['model'],_0x38f081['query']);_0x1d9f65[_0x8a57('0x2f')]=_['intersection'](_0x38f081[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0xab4948['query']['fields']));_0x1d9f65['attributes']=_0x1d9f65[_0x8a57('0x2f')]['length']?_0x1d9f65['attributes']:_0x38f081['model'];if(_0xab4948[_0x8a57('0x31')]['includeAll']){_0x1d9f65[_0x8a57('0x27')]=[{'all':!![]}];}_0x1d9f65=_[_0x8a57('0x32')]({},_0x1d9f65,_0xab4948[_0x8a57('0x33')]);return db[_0x8a57('0x21')][_0x8a57('0x34')](_0x1d9f65)[_0x8a57('0x16')](handleEntityNotFound(_0x454f79,null))[_0x8a57('0x16')](respondWithResult(_0x454f79,null))['catch'](handleError(_0x454f79,null));};exports[_0x8a57('0x35')]=function(_0x21d01b,_0x4fec2b){return db[_0x8a57('0x21')][_0x8a57('0x35')](_0x21d01b[_0x8a57('0x36')],{})[_0x8a57('0x16')](function(_0x5d2256){var _0x316d6a=_0x21d01b[_0x8a57('0x37')]['get']({'plain':!![]});if(!_0x316d6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x316d6a[_0x8a57('0x38')]===_0x8a57('0x37')){var _0x17ad4d=_0x5d2256[_0x8a57('0x18')]({'plain':!![]});var _0x1b805e=_0x8a57('0x19');return db[_0x8a57('0x39')]['find']({'where':{'name':_0x1b805e,'userProfileId':_0x316d6a[_0x8a57('0x3a')]},'raw':!![]})[_0x8a57('0x16')](function(_0x52e9d1){if(_0x52e9d1&&_0x52e9d1[_0x8a57('0x3b')]===0x0){return db[_0x8a57('0x1a')]['create']({'name':_0x17ad4d[_0x8a57('0x1d')],'resourceId':_0x17ad4d['id'],'type':_0x52e9d1[_0x8a57('0x1d')],'sectionId':_0x52e9d1['id']},{})[_0x8a57('0x16')](function(){return _0x5d2256;});}else{return _0x5d2256;}})['catch'](function(_0x26e0f5){logger[_0x8a57('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26e0f5);throw _0x26e0f5;});}return _0x5d2256;})[_0x8a57('0x16')](respondWithResult(_0x4fec2b,0xc9))[_0x8a57('0x29')](handleError(_0x4fec2b,null));};exports[_0x8a57('0x15')]=function(_0x50ecfc,_0x24d555){if(_0x50ecfc[_0x8a57('0x36')]['id']){delete _0x50ecfc['body']['id'];}return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x50ecfc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x24d555,null))['then'](saveUpdates(_0x50ecfc[_0x8a57('0x36')],null))[_0x8a57('0x16')](respondWithResult(_0x24d555,null))[_0x8a57('0x29')](handleError(_0x24d555,null));};exports['destroy']=function(_0x34f799,_0x4b5004){return db[_0x8a57('0x21')][_0x8a57('0x34')]({'where':{'id':_0x34f799[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x4b5004,null))[_0x8a57('0x16')](removeEntity(_0x4b5004,null))[_0x8a57('0x29')](handleError(_0x4b5004,null));};exports['describe']=function(_0x2b95fc,_0x5c2805){return db[_0x8a57('0x21')]['describe']()[_0x8a57('0x16')](respondWithResult(_0x5c2805,null))[_0x8a57('0x29')](handleError(_0x5c2805,null));};exports[_0x8a57('0x3d')]=function(_0x332abc,_0x21d62c){var _0xe0d270={'raw':!![],'where':{}},_0x28b472={},_0x27e44d;return db['ChatQueue'][_0x8a57('0x3e')]({'where':{'id':_0x332abc[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x21d62c,null))[_0x8a57('0x16')](function(_0x5921c8){if(_0x5921c8){_0x27e44d=_0x5921c8['get']({'plain':!![]});_0x28b472[_0x8a57('0x2b')]=_['keys'](db[_0x8a57('0x3f')][_0x8a57('0x22')]);_0x28b472[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x332abc['query']);_0x28b472[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x28b472['model'],_0x28b472['query']);_0xe0d270['attributes']=_[_0x8a57('0x2e')](_0x28b472[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x332abc[_0x8a57('0x31')]['fields']));_0xe0d270['attributes']=_0xe0d270[_0x8a57('0x2f')]['length']?_0xe0d270['attributes']:_0x28b472[_0x8a57('0x2b')];if(!_0x332abc[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0xe0d270[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x332abc[_0x8a57('0x31')][_0x8a57('0x11')]);_0xe0d270[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x332abc[_0x8a57('0x31')][_0x8a57('0xf')]);}_0xe0d270[_0x8a57('0x42')]=qs['sort'](_0x332abc[_0x8a57('0x31')]['sort']);_0xe0d270[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x332abc[_0x8a57('0x31')],_0x28b472[_0x8a57('0x2d')]));_0xe0d270[_0x8a57('0x26')][_0x8a57('0x44')]=_0x5921c8['id'];if(_0x332abc['query'][_0x8a57('0x45')]){_0xe0d270['where']=_[_0x8a57('0x32')](_0xe0d270[_0x8a57('0x26')],{'$or':_['map'](_0xe0d270[_0x8a57('0x2f')],function(_0x27689b){var _0x3eacc1={};_0x3eacc1[_0x27689b]={'$like':'%'+_0x332abc['query'][_0x8a57('0x45')]+'%'};return _0x3eacc1;})});}_0xe0d270=_['merge']({},_0xe0d270,_0x332abc[_0x8a57('0x33')]);return db[_0x8a57('0x3f')][_0x8a57('0x46')](_0xe0d270);}})[_0x8a57('0x16')](function(_0x24465f){if(_0x24465f){return db['User'][_0x8a57('0x47')]({'where':{'id':_[_0x8a57('0x20')](_0x24465f,'UserId'),'role':_0x8a57('0x48')},'attributes':['id',_0x8a57('0x1d'),'chatPause',_0x8a57('0x49'),'createdAt']});}})[_0x8a57('0x16')](function(_0x5ac7b7){if(_0x5ac7b7){return{'count':_0x5ac7b7[_0x8a57('0x12')],'rows':_[_0x8a57('0x20')](_0x5ac7b7['rows'],function(_0xcd4da5){return{'membername':_0xcd4da5['name'],'UserId':_0xcd4da5['id'],'queue_name':_0x27e44d[_0x8a57('0x1d')],'ChatQueueId':_0x27e44d['id'],'interface':util['format']('%s/%s',_0x8a57('0x4a'),_0xcd4da5[_0x8a57('0x1d')]),'penalty':0x0,'paused':_0xcd4da5[_0x8a57('0x4b')],'createdAt':_0xcd4da5[_0x8a57('0x4c')],'updatedAt':_0xcd4da5[_0x8a57('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a57('0x16')](respondWithFilteredResult(_0x21d62c,_0xe0d270))['catch'](handleError(_0x21d62c,null));};exports[_0x8a57('0x4d')]=function(_0x49c0c7,_0x15bac){var _0x48b8e5={};var _0x15db5f={};var _0x37279b;var _0x513efc;return db[_0x8a57('0x21')]['findOne']({'where':{'id':_0x49c0c7['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x15bac,null))[_0x8a57('0x16')](function(_0x51bb88){if(_0x51bb88){_0x37279b=_0x51bb88;_0x15db5f[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x4e')]['rawAttributes']);_0x15db5f[_0x8a57('0x31')]=_[_0x8a57('0x2c')](_0x49c0c7[_0x8a57('0x31')]);_0x15db5f[_0x8a57('0x2d')]=_['intersection'](_0x15db5f['model'],_0x15db5f[_0x8a57('0x31')]);_0x48b8e5['attributes']=_[_0x8a57('0x2e')](_0x15db5f['model'],qs[_0x8a57('0x30')](_0x49c0c7['query'][_0x8a57('0x30')]));_0x48b8e5['attributes']=_0x48b8e5[_0x8a57('0x2f')][_0x8a57('0x4f')]?_0x48b8e5[_0x8a57('0x2f')]:_0x15db5f[_0x8a57('0x2b')];_0x48b8e5[_0x8a57('0x42')]=qs[_0x8a57('0x50')](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x50')]);_0x48b8e5[_0x8a57('0x26')]=qs[_0x8a57('0x2d')](_['pick'](_0x49c0c7[_0x8a57('0x31')],_0x15db5f[_0x8a57('0x2d')]));if(_0x49c0c7[_0x8a57('0x31')]['filter']){_0x48b8e5[_0x8a57('0x26')]=_[_0x8a57('0x32')](_0x48b8e5[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x48b8e5[_0x8a57('0x2f')],function(_0x1adf82){var _0x3e9507={};_0x3e9507[_0x1adf82]={'$like':'%'+_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x45')]+'%'};return _0x3e9507;})});}_0x48b8e5=_[_0x8a57('0x32')]({},_0x48b8e5,_0x49c0c7[_0x8a57('0x33')]);return _0x37279b[_0x8a57('0x4d')](_0x48b8e5);}})['then'](function(_0x2daffb){if(_0x2daffb){_0x513efc=_0x2daffb['length'];if(!_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x40')]('nolimit')){_0x48b8e5[_0x8a57('0x11')]=qs['limit'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0x11')]);_0x48b8e5[_0x8a57('0xf')]=qs['offset'](_0x49c0c7[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x37279b['getTeams'](_0x48b8e5);}})[_0x8a57('0x16')](function(_0xec5a02){if(_0xec5a02){return _0xec5a02?{'count':_0x513efc,'rows':_0xec5a02}:null;}})[_0x8a57('0x16')](respondWithResult(_0x15bac,null))[_0x8a57('0x29')](handleError(_0x15bac,null));};exports[_0x8a57('0x51')]=function(_0x4424db,_0x4c488b){var _0x496a2a=_0x4424db[_0x8a57('0x36')]['ids'];return db['Team'][_0x8a57('0x46')]({'where':{'id':_0x496a2a},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':'Agents','attributes':['id',_0x8a57('0x1d'),_0x8a57('0x53'),_0x8a57('0x54'),_0x8a57('0x55')],'raw':!![]}]})['then'](function(_0x41ef34){if(_0x41ef34){var _0x3ceb9c=_[_0x8a57('0x56')](_0x41ef34,function(_0xe84a6b){var _0x22c6e8=_0xe84a6b[_0x8a57('0x18')]({'plain':!![]});return _0x22c6e8[_0x8a57('0x57')];});return db['ChatQueue'][_0x8a57('0x34')]({'where':{'id':_0x4424db[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](function(_0x22622a){return db['sequelize'][_0x8a57('0x58')](function(_0x5baa0b){return _0x22622a[_0x8a57('0x51')](_0x496a2a,{'transaction':_0x5baa0b})['then'](function(){return BPromise[_0x8a57('0x59')](_0x3ceb9c,function(_0x4de154){return db[_0x8a57('0x3f')][_0x8a57('0x5a')]({'where':{'UserId':_0x4de154['id'],'ChatQueueId':_0x4424db['params']['id']},'transaction':_0x5baa0b});});})['then'](function(){_0x3ceb9c[_0x8a57('0x5b')](function(_0x451d22){socket[_0x8a57('0x5c')](_0x8a57('0x5d'),{'UserId':_0x451d22['id'],'ChatQueueId':_0x22622a['id']});});});});});}})[_0x8a57('0x16')](respondWithStatusCode(_0x4c488b,null))['catch'](handleError(_0x4c488b,null));};exports[_0x8a57('0x5e')]=function(_0x3c520d,_0x232823){return db[_0x8a57('0x4e')]['findAll']({'where':{'id':_0x3c520d['query'][_0x8a57('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x8a57('0x52')],'as':_0x8a57('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x232823,null))[_0x8a57('0x16')](function(_0x2e73ae){var _0x107f17=_[_0x8a57('0x20')](_0x2e73ae,'id');var _0x40b548=[];var _0x185dc6=[];var _0x20beed=squel[_0x8a57('0x60')]();_0x20beed[_0x8a57('0x61')](_0x8a57('0x62'))[_0x8a57('0x63')](_0x8a57('0x64'),'tq')[_0x8a57('0x65')]('user_has_teams','ut',_0x8a57('0x66'))[_0x8a57('0x26')](_0x8a57('0x67'),_0x3c520d['params']['id']);for(var _0x56a2ed=0x0;_0x56a2ed<_0x2e73ae[_0x8a57('0x4f')];_0x56a2ed+=0x1){let _0x21b9f4=_0x2e73ae[_0x56a2ed];for(var _0x1a2918=0x0;_0x1a2918<_0x21b9f4[_0x8a57('0x57')][_0x8a57('0x4f')];_0x1a2918+=0x1){let _0x12c3e3=_0x21b9f4['Agents'][_0x1a2918];var _0x37bc14=_0x20beed[_0x8a57('0x68')]();_0x37bc14['where'](_0x8a57('0x69'),_0x12c3e3['id']);_0x185dc6[_0x8a57('0x6a')](db['sequelize'][_0x8a57('0x31')](_0x37bc14[_0x8a57('0x6b')](),{'type':db[_0x8a57('0x6c')][_0x8a57('0x6d')][_0x8a57('0x6e')]})['then'](function(_0x3caecd){if(_0x3caecd[_0x8a57('0x4f')]===0x1){return _0x12c3e3['id'];}else{var _0x2387da=_[_0x8a57('0x6f')](_['map'](_0x3caecd,'TeamId'),function(_0x50671d){return _[_0x8a57('0x70')](_0x107f17,_0x50671d);});if(_0x2387da){return _0x12c3e3['id'];}}}));}}return BPromise[_0x8a57('0x71')](_0x185dc6)[_0x8a57('0x16')](function(_0xdb5ae){_0x40b548=_(_0x40b548)[_0x8a57('0x72')](_0xdb5ae)['compact']()[_0x8a57('0x73')]();return db[_0x8a57('0x21')]['find']({'where':{'id':_0x3c520d[_0x8a57('0x3c')]['id']}})['then'](function(_0x4703f3){return db[_0x8a57('0x6c')][_0x8a57('0x58')](function(_0x462bc6){return _0x4703f3['removeTeams'](_0x3c520d[_0x8a57('0x31')]['ids'],{'transaction':_0x462bc6})[_0x8a57('0x16')](function(){if(!_['isEmpty'](_0x40b548)){return _0x4703f3[_0x8a57('0x74')](_0x40b548,{'transaction':_0x462bc6});}})[_0x8a57('0x16')](function(){_0x40b548['forEach'](function(_0x36ebff){socket['emit']('userChatQueue:remove',{'UserId':_0x36ebff,'ChatQueueId':_0x4703f3['id']});});});});});});})[_0x8a57('0x16')](respondWithStatusCode(_0x232823,null))['catch'](handleError(_0x232823,null));};exports[_0x8a57('0x75')]=function(_0xc1d670,_0x42efe3){return db[_0x8a57('0x21')]['find']({'where':{'id':_0xc1d670['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x42efe3,null))[_0x8a57('0x16')](function(_0x5758f5){if(_0x5758f5){return _0x5758f5[_0x8a57('0x75')](_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')],_[_0x8a57('0x76')](_0xc1d670[_0x8a57('0x36')],[_0x8a57('0x5f'),'id'])||{})['spread'](function(_0x61d6a3){for(var _0xb40c58=0x0;_0xb40c58<_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')]['length'];_0xb40c58+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xc1d670[_0x8a57('0x36')][_0x8a57('0x5f')][_0xb40c58]),'ChatQueueId':Number(_0xc1d670[_0x8a57('0x3c')]['id'])});}return _0x61d6a3;});}})[_0x8a57('0x16')](respondWithResult(_0x42efe3,null))[_0x8a57('0x29')](handleError(_0x42efe3,null));};exports['removeAgents']=function(_0x5619a6,_0xe89474){return db['ChatQueue']['find']({'where':{'id':_0x5619a6[_0x8a57('0x3c')]['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0xe89474,null))['then'](function(_0x395599){if(_0x395599){return _0x395599[_0x8a57('0x74')](_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')])[_0x8a57('0x16')](function(){if(_[_0x8a57('0x77')](_0x5619a6[_0x8a57('0x31')]['ids'])){for(var _0x7b99f4=0x0;_0x7b99f4<_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x8a57('0x4f')];_0x7b99f4+=0x1){socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6[_0x8a57('0x31')][_0x8a57('0x5f')][_0x7b99f4]),'ChatQueueId':Number(_0x5619a6['params']['id'])});}}else{socket[_0x8a57('0x5c')](_0x8a57('0x78'),{'UserId':Number(_0x5619a6['query'][_0x8a57('0x5f')]),'ChatQueueId':Number(_0x5619a6[_0x8a57('0x3c')]['id'])});}});}})[_0x8a57('0x16')](respondWithStatusCode(_0xe89474,null))[_0x8a57('0x29')](handleError(_0xe89474,null));};exports[_0x8a57('0x79')]=function(_0x444598,_0x402e37){var _0x1a87d6={};var _0x334309={};var _0x10073f;var _0x2b6071;return db[_0x8a57('0x21')][_0x8a57('0x3e')]({'where':{'id':_0x444598['params']['id']}})[_0x8a57('0x16')](handleEntityNotFound(_0x402e37,null))[_0x8a57('0x16')](function(_0xdd34bb){if(_0xdd34bb){_0x10073f=_0xdd34bb;_0x334309[_0x8a57('0x2b')]=_[_0x8a57('0x2c')](db[_0x8a57('0x52')]['rawAttributes']);_0x334309[_0x8a57('0x31')]=_['keys'](_0x444598['query']);_0x334309[_0x8a57('0x2d')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],_0x334309[_0x8a57('0x31')]);_0x1a87d6[_0x8a57('0x2f')]=_[_0x8a57('0x2e')](_0x334309[_0x8a57('0x2b')],qs[_0x8a57('0x30')](_0x444598[_0x8a57('0x31')]['fields']));_0x1a87d6[_0x8a57('0x2f')]=_0x1a87d6['attributes'][_0x8a57('0x4f')]?_0x1a87d6['attributes']:_0x334309[_0x8a57('0x2b')];_0x1a87d6[_0x8a57('0x42')]=qs['sort'](_0x444598[_0x8a57('0x31')][_0x8a57('0x50')]);_0x1a87d6['where']=qs[_0x8a57('0x2d')](_[_0x8a57('0x43')](_0x444598[_0x8a57('0x31')],_0x334309[_0x8a57('0x2d')]));if(_0x444598[_0x8a57('0x31')][_0x8a57('0x45')]){_0x1a87d6['where']=_[_0x8a57('0x32')](_0x1a87d6[_0x8a57('0x26')],{'$or':_[_0x8a57('0x20')](_0x1a87d6[_0x8a57('0x2f')],function(_0x242792){var _0x2eadd8={};_0x2eadd8[_0x242792]={'$like':'%'+_0x444598[_0x8a57('0x31')]['filter']+'%'};return _0x2eadd8;})});}_0x1a87d6=_[_0x8a57('0x32')]({},_0x1a87d6,_0x444598['options']);return _0x10073f[_0x8a57('0x79')](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x21af6b){if(_0x21af6b){_0x2b6071=_0x21af6b[_0x8a57('0x4f')];if(!_0x444598[_0x8a57('0x31')][_0x8a57('0x40')](_0x8a57('0x41'))){_0x1a87d6[_0x8a57('0x11')]=qs[_0x8a57('0x11')](_0x444598[_0x8a57('0x31')][_0x8a57('0x11')]);_0x1a87d6[_0x8a57('0xf')]=qs[_0x8a57('0xf')](_0x444598[_0x8a57('0x31')][_0x8a57('0xf')]);}return _0x10073f['getAgents'](_0x1a87d6);}})[_0x8a57('0x16')](function(_0x2a4c6b){if(_0x2a4c6b){return _0x2a4c6b?{'count':_0x2b6071,'rows':_0x2a4c6b}:null;}})[_0x8a57('0x16')](respondWithResult(_0x402e37,null))[_0x8a57('0x29')](handleError(_0x402e37,null));}; \ No newline at end of file +var _0x29a4=['User','findAndCountAll','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','forEach','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','compact','value','userChatQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','lodash','ioredis','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','UserChatQueue'];(function(_0x104212,_0x43f4eb){var _0x1376dc=function(_0x4dc731){while(--_0x4dc731){_0x104212['push'](_0x104212['shift']());}};_0x1376dc(++_0x43f4eb);}(_0x29a4,0x1ef));var _0x429a=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x29a4[_0x341e0f];return _0x59555a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x429a('0x0'));var squel=require('squel');var Redis=require(_0x429a('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x429a('0x2'))('api');var config=require(_0x429a('0x3'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x429a('0x4')](config[_0x429a('0x5')],{'host':_0x429a('0x6'),'port':0x18eb});var socket=require(_0x429a('0x7'))(new Redis(config['redis']));require(_0x429a('0x8'))[_0x429a('0x9')](socket);function respondWithStatusCode(_0x2a31e1,_0x43f526){_0x43f526=_0x43f526||0xcc;return function(_0x4532cd){if(_0x4532cd){return _0x2a31e1['sendStatus'](_0x43f526);}return _0x2a31e1[_0x429a('0xa')](_0x43f526)[_0x429a('0xb')]();};}function respondWithResult(_0x1f9a06,_0x3f70b0){_0x3f70b0=_0x3f70b0||0xc8;return function(_0x36bb71){if(_0x36bb71){return _0x1f9a06[_0x429a('0xa')](_0x3f70b0)['json'](_0x36bb71);}};}function respondWithFilteredResult(_0x564183,_0x5e86f3){return function(_0x314e1a){if(_0x314e1a){var _0x92cecb=typeof _0x5e86f3[_0x429a('0xc')]===_0x429a('0xd')&&typeof _0x5e86f3[_0x429a('0xe')]==='undefined';var _0x2a42ea=_0x314e1a[_0x429a('0xf')];var _0x2f4dcb=_0x92cecb?0x0:_0x5e86f3[_0x429a('0xc')];var _0x5b9ad6=_0x92cecb?_0x314e1a[_0x429a('0xf')]:_0x5e86f3[_0x429a('0xc')]+_0x5e86f3[_0x429a('0xe')];var _0x1d30a2;if(_0x5b9ad6>=_0x2a42ea){_0x5b9ad6=_0x2a42ea;_0x1d30a2=0xc8;}else{_0x1d30a2=0xce;}_0x564183['status'](_0x1d30a2);return _0x564183[_0x429a('0x10')](_0x429a('0x11'),_0x2f4dcb+'-'+_0x5b9ad6+'/'+_0x2a42ea)['json'](_0x314e1a);}return null;};}function saveUpdates(_0x5a0ee1){return function(_0x38a913){if(_0x38a913){return _0x38a913[_0x429a('0x12')](_0x5a0ee1)[_0x429a('0x13')](function(_0x19a335){return _0x19a335;});}return null;};}function removeEntity(_0x17c0f8){return function(_0x4b48d5){if(_0x4b48d5){return _0x4b48d5[_0x429a('0x14')]()[_0x429a('0x13')](function(){var _0x22d3d9=_0x4b48d5['get']({'plain':!![]});var _0xc92608=_0x429a('0x15');return db[_0x429a('0x16')]['destroy']({'where':{'type':_0xc92608,'resourceId':_0x22d3d9['id']}})['then'](function(){return _0x4b48d5;});})[_0x429a('0x13')](function(){_0x17c0f8['status'](0xcc)[_0x429a('0xb')]();});}};}function handleEntityNotFound(_0x592b1e){return function(_0x408f5b){if(!_0x408f5b){_0x592b1e[_0x429a('0x17')](0x194);}return _0x408f5b;};}function handleError(_0xd014a7,_0x11f488){_0x11f488=_0x11f488||0x1f4;return function(_0x460943){logger[_0x429a('0x18')](_0x460943[_0x429a('0x19')]);if(_0x460943['name']){delete _0x460943[_0x429a('0x1a')];}_0xd014a7['status'](_0x11f488)[_0x429a('0x1b')](_0x460943);};}exports['index']=function(_0x444bed,_0x465ba4){var _0x7547e8={};var _0x7353ca={'count':0x0,'rows':[]};var _0x14e24c=_[_0x429a('0x1c')](db[_0x429a('0x1d')][_0x429a('0x1e')],function(_0x50d4b8){return{'name':_0x50d4b8[_0x429a('0x1f')],'type':_0x50d4b8['type'][_0x429a('0x20')]};});_0x7547e8=qs[_0x429a('0x21')](_0x14e24c,_0x444bed);var _0x46b056={'where':_0x7547e8[_0x429a('0x22')]};return db[_0x429a('0x1d')][_0x429a('0xf')](_0x46b056)[_0x429a('0x13')](function(_0x2d5e1a){_0x7353ca[_0x429a('0xf')]=_0x2d5e1a;_0x7547e8['include']=qs[_0x429a('0x23')](_0x444bed[_0x429a('0x24')]);return db[_0x429a('0x1d')][_0x429a('0x25')](_0x7547e8);})[_0x429a('0x13')](function(_0x1e6bfa){_0x7353ca['rows']=_0x1e6bfa;return _0x7353ca;})[_0x429a('0x13')](respondWithFilteredResult(_0x465ba4,_0x7547e8))['catch'](handleError(_0x465ba4,null));};exports[_0x429a('0x26')]=function(_0x4af095,_0x228f71){var _0x1c9a9d={'raw':!![],'where':{'id':_0x4af095[_0x429a('0x27')]['id']}},_0x52f666={};_0x52f666[_0x429a('0x28')]=_[_0x429a('0x29')](db['ChatQueue']['rawAttributes']);_0x52f666[_0x429a('0x24')]=_['keys'](_0x4af095[_0x429a('0x24')]);_0x52f666[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x52f666[_0x429a('0x28')],_0x52f666[_0x429a('0x24')]);_0x1c9a9d[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x52f666[_0x429a('0x28')],qs[_0x429a('0x2d')](_0x4af095[_0x429a('0x24')][_0x429a('0x2d')]));_0x1c9a9d['attributes']=_0x1c9a9d['attributes'][_0x429a('0x2e')]?_0x1c9a9d[_0x429a('0x2c')]:_0x52f666['model'];if(_0x4af095[_0x429a('0x24')][_0x429a('0x2f')]){_0x1c9a9d[_0x429a('0x23')]=[{'all':!![]}];}_0x1c9a9d=_['merge']({},_0x1c9a9d,_0x4af095[_0x429a('0x30')]);return db[_0x429a('0x1d')][_0x429a('0x31')](_0x1c9a9d)['then'](handleEntityNotFound(_0x228f71,null))[_0x429a('0x13')](respondWithResult(_0x228f71,null))['catch'](handleError(_0x228f71,null));};exports[_0x429a('0x32')]=function(_0xabd178,_0x1b6b32){return db[_0x429a('0x1d')][_0x429a('0x32')](_0xabd178[_0x429a('0x33')],{})[_0x429a('0x13')](function(_0x2ff172){var _0x2f6595=_0xabd178[_0x429a('0x34')][_0x429a('0x35')]({'plain':!![]});if(!_0x2f6595)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6595['role']===_0x429a('0x34')){var _0xb6c3e9=_0x2ff172[_0x429a('0x35')]({'plain':!![]});var _0x1549a8=_0x429a('0x15');return db[_0x429a('0x36')]['find']({'where':{'name':_0x1549a8,'userProfileId':_0x2f6595[_0x429a('0x37')]},'raw':!![]})[_0x429a('0x13')](function(_0x58c2a0){if(_0x58c2a0&&_0x58c2a0[_0x429a('0x38')]===0x0){return db['UserProfileResource'][_0x429a('0x32')]({'name':_0xb6c3e9[_0x429a('0x1a')],'resourceId':_0xb6c3e9['id'],'type':_0x58c2a0[_0x429a('0x1a')],'sectionId':_0x58c2a0['id']},{})[_0x429a('0x13')](function(){return _0x2ff172;});}else{return _0x2ff172;}})[_0x429a('0x39')](function(_0x58a9af){logger[_0x429a('0x18')](_0x429a('0x3a'),_0x58a9af);throw _0x58a9af;});}return _0x2ff172;})[_0x429a('0x13')](respondWithResult(_0x1b6b32,0xc9))[_0x429a('0x39')](handleError(_0x1b6b32,null));};exports[_0x429a('0x12')]=function(_0x218357,_0x256d37){if(_0x218357[_0x429a('0x33')]['id']){delete _0x218357['body']['id'];}return db['ChatQueue'][_0x429a('0x31')]({'where':{'id':_0x218357[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x256d37,null))[_0x429a('0x13')](saveUpdates(_0x218357[_0x429a('0x33')],null))[_0x429a('0x13')](respondWithResult(_0x256d37,null))['catch'](handleError(_0x256d37,null));};exports[_0x429a('0x14')]=function(_0x1fa02f,_0x26dbd4){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x1fa02f[_0x429a('0x27')]['id']}})['then'](handleEntityNotFound(_0x26dbd4,null))['then'](removeEntity(_0x26dbd4,null))[_0x429a('0x39')](handleError(_0x26dbd4,null));};exports[_0x429a('0x3b')]=function(_0x315aba,_0x40f7d4){return db[_0x429a('0x1d')][_0x429a('0x3b')]()[_0x429a('0x13')](respondWithResult(_0x40f7d4,null))['catch'](handleError(_0x40f7d4,null));};exports[_0x429a('0x3c')]=function(_0xc22b1c,_0x36ac8f){var _0x57af4e={'raw':!![],'where':{}},_0x36b842={},_0x55ba94;return db[_0x429a('0x1d')]['findOne']({'where':{'id':_0xc22b1c[_0x429a('0x27')]['id']}})['then'](handleEntityNotFound(_0x36ac8f,null))[_0x429a('0x13')](function(_0x516dda){if(_0x516dda){_0x55ba94=_0x516dda['get']({'plain':!![]});_0x36b842[_0x429a('0x28')]=_[_0x429a('0x29')](db['UserChatQueue'][_0x429a('0x1e')]);_0x36b842[_0x429a('0x24')]=_['keys'](_0xc22b1c[_0x429a('0x24')]);_0x36b842['filters']=_[_0x429a('0x2b')](_0x36b842['model'],_0x36b842['query']);_0x57af4e[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x36b842[_0x429a('0x28')],qs[_0x429a('0x2d')](_0xc22b1c[_0x429a('0x24')]['fields']));_0x57af4e[_0x429a('0x2c')]=_0x57af4e[_0x429a('0x2c')][_0x429a('0x2e')]?_0x57af4e[_0x429a('0x2c')]:_0x36b842[_0x429a('0x28')];if(!_0xc22b1c[_0x429a('0x24')][_0x429a('0x3d')](_0x429a('0x3e'))){_0x57af4e[_0x429a('0xe')]=qs[_0x429a('0xe')](_0xc22b1c[_0x429a('0x24')][_0x429a('0xe')]);_0x57af4e[_0x429a('0xc')]=qs['offset'](_0xc22b1c[_0x429a('0x24')]['offset']);}_0x57af4e[_0x429a('0x3f')]=qs['sort'](_0xc22b1c[_0x429a('0x24')][_0x429a('0x40')]);_0x57af4e['where']=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0xc22b1c['query'],_0x36b842[_0x429a('0x2a')]));_0x57af4e[_0x429a('0x22')][_0x429a('0x42')]=_0x516dda['id'];if(_0xc22b1c['query'][_0x429a('0x43')]){_0x57af4e[_0x429a('0x22')]=_['merge'](_0x57af4e[_0x429a('0x22')],{'$or':_[_0x429a('0x1c')](_0x57af4e[_0x429a('0x2c')],function(_0x526d60){var _0x4d39b0={};_0x4d39b0[_0x526d60]={'$like':'%'+_0xc22b1c['query']['filter']+'%'};return _0x4d39b0;})});}_0x57af4e=_[_0x429a('0x44')]({},_0x57af4e,_0xc22b1c['options']);return db[_0x429a('0x45')]['findAll'](_0x57af4e);}})[_0x429a('0x13')](function(_0x342646){if(_0x342646){return db[_0x429a('0x46')][_0x429a('0x47')]({'where':{'id':_[_0x429a('0x1c')](_0x342646,'UserId'),'role':'agent'},'attributes':['id',_0x429a('0x1a'),_0x429a('0x48'),'updatedAt',_0x429a('0x49')]});}})[_0x429a('0x13')](function(_0x237a66){if(_0x237a66){return{'count':_0x237a66[_0x429a('0xf')],'rows':_[_0x429a('0x1c')](_0x237a66[_0x429a('0x4a')],function(_0x2191c7){return{'membername':_0x2191c7[_0x429a('0x1a')],'UserId':_0x2191c7['id'],'queue_name':_0x55ba94['name'],'ChatQueueId':_0x55ba94['id'],'interface':util[_0x429a('0x4b')](_0x429a('0x4c'),_0x429a('0x4d'),_0x2191c7['name']),'penalty':0x0,'paused':_0x2191c7[_0x429a('0x48')],'createdAt':_0x2191c7[_0x429a('0x49')],'updatedAt':_0x2191c7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x429a('0x13')](respondWithFilteredResult(_0x36ac8f,_0x57af4e))[_0x429a('0x39')](handleError(_0x36ac8f,null));};exports[_0x429a('0x4e')]=function(_0x160d30,_0x182aef){var _0x480a79={};var _0x4c654d={};var _0x58899c;var _0x3add2b;return db[_0x429a('0x1d')][_0x429a('0x4f')]({'where':{'id':_0x160d30[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x182aef,null))[_0x429a('0x13')](function(_0x333bc0){if(_0x333bc0){_0x58899c=_0x333bc0;_0x4c654d[_0x429a('0x28')]=_['keys'](db[_0x429a('0x50')][_0x429a('0x1e')]);_0x4c654d['query']=_[_0x429a('0x29')](_0x160d30['query']);_0x4c654d[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x4c654d[_0x429a('0x28')],_0x4c654d[_0x429a('0x24')]);_0x480a79[_0x429a('0x2c')]=_[_0x429a('0x2b')](_0x4c654d[_0x429a('0x28')],qs[_0x429a('0x2d')](_0x160d30['query'][_0x429a('0x2d')]));_0x480a79[_0x429a('0x2c')]=_0x480a79[_0x429a('0x2c')][_0x429a('0x2e')]?_0x480a79[_0x429a('0x2c')]:_0x4c654d[_0x429a('0x28')];_0x480a79[_0x429a('0x3f')]=qs[_0x429a('0x40')](_0x160d30[_0x429a('0x24')][_0x429a('0x40')]);_0x480a79[_0x429a('0x22')]=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0x160d30[_0x429a('0x24')],_0x4c654d['filters']));if(_0x160d30['query'][_0x429a('0x43')]){_0x480a79[_0x429a('0x22')]=_['merge'](_0x480a79[_0x429a('0x22')],{'$or':_['map'](_0x480a79[_0x429a('0x2c')],function(_0x53c326){var _0x392013={};_0x392013[_0x53c326]={'$like':'%'+_0x160d30[_0x429a('0x24')][_0x429a('0x43')]+'%'};return _0x392013;})});}_0x480a79=_['merge']({},_0x480a79,_0x160d30[_0x429a('0x30')]);return _0x58899c[_0x429a('0x4e')](_0x480a79);}})[_0x429a('0x13')](function(_0x1d7887){if(_0x1d7887){_0x3add2b=_0x1d7887['length'];if(!_0x160d30[_0x429a('0x24')]['hasOwnProperty'](_0x429a('0x3e'))){_0x480a79[_0x429a('0xe')]=qs[_0x429a('0xe')](_0x160d30['query'][_0x429a('0xe')]);_0x480a79[_0x429a('0xc')]=qs[_0x429a('0xc')](_0x160d30['query'][_0x429a('0xc')]);}return _0x58899c[_0x429a('0x4e')](_0x480a79);}})[_0x429a('0x13')](function(_0x13d01b){if(_0x13d01b){return _0x13d01b?{'count':_0x3add2b,'rows':_0x13d01b}:null;}})[_0x429a('0x13')](respondWithResult(_0x182aef,null))[_0x429a('0x39')](handleError(_0x182aef,null));};exports[_0x429a('0x51')]=function(_0x4d0c2d,_0x360c7e){var _0x565eca=_0x4d0c2d['body'][_0x429a('0x52')];return db[_0x429a('0x50')][_0x429a('0x25')]({'where':{'id':_0x565eca},'attributes':['id'],'include':[{'model':db['User'],'as':_0x429a('0x53'),'attributes':['id',_0x429a('0x1a'),_0x429a('0x54'),_0x429a('0x55'),'interface'],'raw':!![]}]})[_0x429a('0x13')](function(_0x21edd1){if(_0x21edd1){var _0x37f6d4=_[_0x429a('0x56')](_0x21edd1,function(_0x38a0c5){var _0x379570=_0x38a0c5[_0x429a('0x35')]({'plain':!![]});return _0x379570['Agents'];});return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x4d0c2d['params']['id']}})['then'](function(_0x2104f4){return db['sequelize'][_0x429a('0x57')](function(_0x442cb6){return _0x2104f4['addTeams'](_0x565eca,{'transaction':_0x442cb6})['then'](function(){return BPromise[_0x429a('0x58')](_0x37f6d4,function(_0x30f6f5){return db[_0x429a('0x45')]['findOrCreate']({'where':{'UserId':_0x30f6f5['id'],'ChatQueueId':_0x4d0c2d['params']['id']},'transaction':_0x442cb6});});})[_0x429a('0x13')](function(){_0x37f6d4[_0x429a('0x59')](function(_0xe73202){socket['emit'](_0x429a('0x5a'),{'UserId':_0xe73202['id'],'ChatQueueId':_0x2104f4['id']});});});});});}})[_0x429a('0x13')](respondWithStatusCode(_0x360c7e,null))[_0x429a('0x39')](handleError(_0x360c7e,null));};exports[_0x429a('0x5b')]=function(_0x1041a4,_0x25f406){return db[_0x429a('0x50')]['findAll']({'where':{'id':_0x1041a4[_0x429a('0x24')][_0x429a('0x52')]},'attributes':['id'],'include':[{'model':db[_0x429a('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x429a('0x13')](handleEntityNotFound(_0x25f406,null))[_0x429a('0x13')](function(_0x25bf4c){var _0x378ec1=_[_0x429a('0x1c')](_0x25bf4c,'id');var _0xddca92=[];var _0x182ecc=[];var _0x481de3=squel[_0x429a('0x5c')]();_0x481de3[_0x429a('0x5d')]('tq.TeamId')[_0x429a('0x5e')](_0x429a('0x5f'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x429a('0x22')](_0x429a('0x60'),_0x1041a4[_0x429a('0x27')]['id']);for(var _0x1f79bf=0x0;_0x1f79bf<_0x25bf4c[_0x429a('0x2e')];_0x1f79bf+=0x1){let _0x7750cf=_0x25bf4c[_0x1f79bf];for(var _0x3c5e75=0x0;_0x3c5e75<_0x7750cf['Agents']['length'];_0x3c5e75+=0x1){let _0x193517=_0x7750cf[_0x429a('0x53')][_0x3c5e75];var _0xa8ee2=_0x481de3[_0x429a('0x61')]();_0xa8ee2[_0x429a('0x22')](_0x429a('0x62'),_0x193517['id']);_0x182ecc['push'](db[_0x429a('0x63')][_0x429a('0x24')](_0xa8ee2[_0x429a('0x64')](),{'type':db[_0x429a('0x63')][_0x429a('0x65')]['SELECT']})[_0x429a('0x13')](function(_0x225ee1){if(_0x225ee1[_0x429a('0x2e')]===0x1){return _0x193517['id'];}else{var _0x573531=_[_0x429a('0x66')](_[_0x429a('0x1c')](_0x225ee1,_0x429a('0x67')),function(_0x4cf1b7){return _['includes'](_0x378ec1,_0x4cf1b7);});if(_0x573531){return _0x193517['id'];}}}));}}return BPromise['all'](_0x182ecc)['then'](function(_0x4d6fa2){_0xddca92=_(_0xddca92)['union'](_0x4d6fa2)[_0x429a('0x68')]()[_0x429a('0x69')]();return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x1041a4[_0x429a('0x27')]['id']}})[_0x429a('0x13')](function(_0x4ce60f){return db[_0x429a('0x63')]['transaction'](function(_0x4f770d){return _0x4ce60f[_0x429a('0x5b')](_0x1041a4[_0x429a('0x24')][_0x429a('0x52')],{'transaction':_0x4f770d})[_0x429a('0x13')](function(){if(!_['isEmpty'](_0xddca92)){return _0x4ce60f['removeAgents'](_0xddca92,{'transaction':_0x4f770d});}})[_0x429a('0x13')](function(){_0xddca92[_0x429a('0x59')](function(_0x44f19f){socket['emit'](_0x429a('0x6a'),{'UserId':_0x44f19f,'ChatQueueId':_0x4ce60f['id']});});});});});});})[_0x429a('0x13')](respondWithStatusCode(_0x25f406,null))[_0x429a('0x39')](handleError(_0x25f406,null));};exports[_0x429a('0x6b')]=function(_0x179fca,_0x2407eb){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x179fca[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x2407eb,null))[_0x429a('0x13')](function(_0x3b6697){if(_0x3b6697){return _0x3b6697[_0x429a('0x6b')](_0x179fca['body'][_0x429a('0x52')],_[_0x429a('0x6c')](_0x179fca[_0x429a('0x33')],['ids','id'])||{})['spread'](function(_0xf478bc){for(var _0x3c55bd=0x0;_0x3c55bd<_0x179fca[_0x429a('0x33')][_0x429a('0x52')][_0x429a('0x2e')];_0x3c55bd+=0x1){socket[_0x429a('0x6d')](_0x429a('0x5a'),{'UserId':Number(_0x179fca[_0x429a('0x33')][_0x429a('0x52')][_0x3c55bd]),'ChatQueueId':Number(_0x179fca[_0x429a('0x27')]['id'])});}return _0xf478bc;});}})[_0x429a('0x13')](respondWithResult(_0x2407eb,null))[_0x429a('0x39')](handleError(_0x2407eb,null));};exports[_0x429a('0x6e')]=function(_0x3d25bf,_0x1bb97c){return db[_0x429a('0x1d')][_0x429a('0x31')]({'where':{'id':_0x3d25bf['params']['id']}})['then'](handleEntityNotFound(_0x1bb97c,null))[_0x429a('0x13')](function(_0x172c24){if(_0x172c24){return _0x172c24['removeAgents'](_0x3d25bf['query'][_0x429a('0x52')])['then'](function(){if(_[_0x429a('0x6f')](_0x3d25bf[_0x429a('0x24')][_0x429a('0x52')])){for(var _0x1570ec=0x0;_0x1570ec<_0x3d25bf[_0x429a('0x24')]['ids'][_0x429a('0x2e')];_0x1570ec+=0x1){socket[_0x429a('0x6d')]('userChatQueue:remove',{'UserId':Number(_0x3d25bf[_0x429a('0x24')][_0x429a('0x52')][_0x1570ec]),'ChatQueueId':Number(_0x3d25bf[_0x429a('0x27')]['id'])});}}else{socket[_0x429a('0x6d')](_0x429a('0x6a'),{'UserId':Number(_0x3d25bf['query'][_0x429a('0x52')]),'ChatQueueId':Number(_0x3d25bf['params']['id'])});}});}})[_0x429a('0x13')](respondWithStatusCode(_0x1bb97c,null))['catch'](handleError(_0x1bb97c,null));};exports[_0x429a('0x70')]=function(_0x761779,_0x1ba74a){var _0x37dbb3={};var _0x15a429={};var _0x95617e;var _0x4f4c77;return db['ChatQueue']['findOne']({'where':{'id':_0x761779[_0x429a('0x27')]['id']}})[_0x429a('0x13')](handleEntityNotFound(_0x1ba74a,null))['then'](function(_0x3e7ef4){if(_0x3e7ef4){_0x95617e=_0x3e7ef4;_0x15a429[_0x429a('0x28')]=_[_0x429a('0x29')](db[_0x429a('0x46')][_0x429a('0x1e')]);_0x15a429[_0x429a('0x24')]=_[_0x429a('0x29')](_0x761779[_0x429a('0x24')]);_0x15a429[_0x429a('0x2a')]=_[_0x429a('0x2b')](_0x15a429[_0x429a('0x28')],_0x15a429[_0x429a('0x24')]);_0x37dbb3[_0x429a('0x2c')]=_['intersection'](_0x15a429['model'],qs[_0x429a('0x2d')](_0x761779['query'][_0x429a('0x2d')]));_0x37dbb3['attributes']=_0x37dbb3[_0x429a('0x2c')]['length']?_0x37dbb3[_0x429a('0x2c')]:_0x15a429[_0x429a('0x28')];_0x37dbb3[_0x429a('0x3f')]=qs[_0x429a('0x40')](_0x761779[_0x429a('0x24')][_0x429a('0x40')]);_0x37dbb3['where']=qs[_0x429a('0x2a')](_[_0x429a('0x41')](_0x761779[_0x429a('0x24')],_0x15a429[_0x429a('0x2a')]));if(_0x761779[_0x429a('0x24')][_0x429a('0x43')]){_0x37dbb3['where']=_[_0x429a('0x44')](_0x37dbb3[_0x429a('0x22')],{'$or':_['map'](_0x37dbb3['attributes'],function(_0x15d48b){var _0x14dbb7={};_0x14dbb7[_0x15d48b]={'$like':'%'+_0x761779[_0x429a('0x24')][_0x429a('0x43')]+'%'};return _0x14dbb7;})});}_0x37dbb3=_[_0x429a('0x44')]({},_0x37dbb3,_0x761779[_0x429a('0x30')]);return _0x95617e['getAgents'](_0x37dbb3);}})[_0x429a('0x13')](function(_0x232182){if(_0x232182){_0x4f4c77=_0x232182[_0x429a('0x2e')];if(!_0x761779[_0x429a('0x24')][_0x429a('0x3d')](_0x429a('0x3e'))){_0x37dbb3['limit']=qs[_0x429a('0xe')](_0x761779[_0x429a('0x24')][_0x429a('0xe')]);_0x37dbb3[_0x429a('0xc')]=qs[_0x429a('0xc')](_0x761779[_0x429a('0x24')]['offset']);}return _0x95617e[_0x429a('0x70')](_0x37dbb3);}})['then'](function(_0x1ea080){if(_0x1ea080){return _0x1ea080?{'count':_0x4f4c77,'rows':_0x1ea080}:null;}})[_0x429a('0x13')](respondWithResult(_0x1ba74a,null))['catch'](handleError(_0x1ba74a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6f9a340..e951df3 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 _0xccfc=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5a3ed8,_0x4cf865){var _0x1a894c=function(_0x1d179c){while(--_0x1d179c){_0x5a3ed8['push'](_0x5a3ed8['shift']());}};_0x1a894c(++_0x4cf865);}(_0xccfc,0x19a));var _0xcccf=function(_0x15f0ae,_0x2c4264){_0x15f0ae=_0x15f0ae-0x0;var _0xf4842=_0xccfc[_0x15f0ae];return _0xf4842;};'use strict';var EventEmitter=require(_0xcccf('0x0'));var ChatQueue=require(_0xcccf('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcccf('0x2')](0x0);var events={'afterCreate':_0xcccf('0x3'),'afterUpdate':_0xcccf('0x4'),'afterDestroy':_0xcccf('0x5')};function emitEvent(_0x431940){return function(_0x7425b5,_0x56ca5b,_0x2685a8){ChatQueueEvents['emit'](_0x431940+':'+_0x7425b5['id'],_0x7425b5);ChatQueueEvents['emit'](_0x431940,_0x7425b5);_0x2685a8(null);};}for(var e in events){if(events[_0xcccf('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xcccf('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x56c7=['emit','hook','exports','events','ChatQueue','update','remove'];(function(_0xd93cf7,_0xc8445b){var _0x2791eb=function(_0x8ddfc1){while(--_0x8ddfc1){_0xd93cf7['push'](_0xd93cf7['shift']());}};_0x2791eb(++_0xc8445b);}(_0x56c7,0x14c));var _0x756c=function(_0xd9c529,_0x19f8cc){_0xd9c529=_0xd9c529-0x0;var _0x146760=_0x56c7[_0xd9c529];return _0x146760;};'use strict';var EventEmitter=require(_0x756c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x756c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x756c('0x2'),'afterDestroy':_0x756c('0x3')};function emitEvent(_0x45d7a9){return function(_0x323d10,_0x2df6f5,_0x3c29d7){ChatQueueEvents[_0x756c('0x4')](_0x45d7a9+':'+_0x323d10['id'],_0x323d10);ChatQueueEvents[_0x756c('0x4')](_0x45d7a9,_0x323d10);_0x3c29d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x756c('0x5')](e,emitEvent(event));}}module[_0x756c('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 628c77c..2e135fe 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 _0x237c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues'];(function(_0x1a91f0,_0x11e203){var _0x12f862=function(_0x48983c){while(--_0x48983c){_0x1a91f0['push'](_0x1a91f0['shift']());}};_0x12f862(++_0x11e203);}(_0x237c,0x179));var _0xc237=function(_0x3eeaa9,_0x18f2c1){_0x3eeaa9=_0x3eeaa9-0x0;var _0x40dfde=_0x237c[_0x3eeaa9];return _0x40dfde;};'use strict';var _=require(_0xc237('0x0'));var util=require(_0xc237('0x1'));var logger=require(_0xc237('0x2'))(_0xc237('0x3'));var moment=require('moment');var BPromise=require(_0xc237('0x4'));var rp=require(_0xc237('0x5'));var fs=require('fs');var path=require(_0xc237('0x6'));var rimraf=require(_0xc237('0x7'));var config=require(_0xc237('0x8'));var attributes=require('./chatQueue.attributes');module[_0xc237('0x9')]=function(_0x133f01,_0x17d044){return _0x133f01[_0xc237('0xa')](_0xc237('0xb'),attributes,{'tableName':_0xc237('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1aa=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x3a2373,_0x2ef4fe){var _0x177352=function(_0x53cd26){while(--_0x53cd26){_0x3a2373['push'](_0x3a2373['shift']());}};_0x177352(++_0x2ef4fe);}(_0xf1aa,0x15e));var _0xaf1a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf1aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaf1a('0x0'));var util=require(_0xaf1a('0x1'));var logger=require(_0xaf1a('0x2'))(_0xaf1a('0x3'));var moment=require(_0xaf1a('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf1a('0x5'));var fs=require('fs');var path=require(_0xaf1a('0x6'));var rimraf=require(_0xaf1a('0x7'));var config=require(_0xaf1a('0x8'));var attributes=require(_0xaf1a('0x9'));module[_0xaf1a('0xa')]=function(_0x3d739d,_0x4fb2dd){return _0x3d739d[_0xaf1a('0xb')](_0xaf1a('0xc'),attributes,{'tableName':_0xaf1a('0xd'),'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 33d75e8..1b23a34 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 _0x6f54=['find','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowChatQueue','ChatQueue'];(function(_0x568e42,_0x1e6554){var _0x4f05be=function(_0x4447b6){while(--_0x4447b6){_0x568e42['push'](_0x568e42['shift']());}};_0x4f05be(++_0x1e6554);}(_0x6f54,0xcf));var _0x46f5=function(_0x4bdd47,_0x15f10e){_0x4bdd47=_0x4bdd47-0x0;var _0x2975df=_0x6f54[_0x4bdd47];return _0x2975df;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var moment=require(_0x46f5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46f5('0x3'));var db=require(_0x46f5('0x4'))['db'];var utils=require(_0x46f5('0x5'));var logger=require(_0x46f5('0x6'))('rpc');var config=require(_0x46f5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x46f5('0x8')]({'port':0x232a});config['redis']=_[_0x46f5('0x9')](config[_0x46f5('0xa')],{'host':_0x46f5('0xb'),'port':0x18eb});var socket=require(_0x46f5('0xc'))(new Redis(config[_0x46f5('0xa')]));require(_0x46f5('0xd'))[_0x46f5('0xe')](socket);function respondWithRpcPromise(_0x22fe4e,_0x1a6660,_0x356a21){return new BPromise(function(_0x359b6e,_0x18fdc3){return client[_0x46f5('0xf')](_0x22fe4e,_0x356a21)[_0x46f5('0x10')](function(_0x4b946d){logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,_0x46f5('0x13'));logger['debug'](_0x46f5('0x14'),_0x1a6660,_0x46f5('0x13'),JSON['stringify'](_0x4b946d));if(_0x4b946d[_0x46f5('0x15')]){if(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x16')]===0x1f4){logger[_0x46f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1a6660,_0x4b946d['error'][_0x46f5('0x17')]);return _0x18fdc3(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}logger[_0x46f5('0x15')](_0x46f5('0x12'),_0x1a6660,_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);return _0x359b6e(_0x4b946d[_0x46f5('0x15')][_0x46f5('0x17')]);}else{logger[_0x46f5('0x11')](_0x46f5('0x12'),_0x1a6660,'request\x20sent');_0x359b6e(_0x4b946d[_0x46f5('0x18')][_0x46f5('0x17')]);}})[_0x46f5('0x19')](function(_0x9f9165){logger['error'](_0x46f5('0x12'),_0x1a6660,_0x9f9165);_0x18fdc3(_0x9f9165);});});}exports[_0x46f5('0x1a')]=function(_0x2511d8){var _0x2094b0=this;return new Promise(function(_0xf3a7e9,_0x425a2e){return db['ChatQueue'][_0x46f5('0x1b')]({'raw':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x2511d8[_0x46f5('0x1c')]?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'limit':_0x2511d8['options']?_0x2511d8['options'][_0x46f5('0x20')]||null:null,'include':_0x2511d8['options']?_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')]?_['map'](_0x2511d8[_0x46f5('0x1c')][_0x46f5('0x21')],function(_0x21374d){return{'model':db[_0x21374d[_0x46f5('0x22')]],'as':_0x21374d['as'],'attributes':_0x21374d['attributes'],'include':_0x21374d['include']?_[_0x46f5('0x23')](_0x21374d[_0x46f5('0x21')],function(_0x4b2769){return{'model':db[_0x4b2769['model']],'as':_0x4b2769['as'],'attributes':_0x4b2769[_0x46f5('0x1f')],'include':_0x4b2769[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x4b2769['include'],function(_0x48b761){return{'model':db[_0x48b761['model']],'as':_0x48b761['as'],'attributes':_0x48b761[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0x42837f){logger['info'](_0x46f5('0x1a'),_0x2511d8);logger[_0x46f5('0x24')]('GetChatQueue',_0x2511d8,JSON['stringify'](_0x42837f));_0xf3a7e9(_0x42837f);})[_0x46f5('0x19')](function(_0x456c02){logger[_0x46f5('0x15')](_0x46f5('0x1a'),_0x456c02[_0x46f5('0x17')],_0x2511d8);_0x425a2e(_0x2094b0['error'](0x1f4,_0x456c02[_0x46f5('0x17')]));});});};exports[_0x46f5('0x25')]=function(_0x131f15){var _0x503262=this;return new Promise(function(_0x491aff,_0x5d0c51){return db[_0x46f5('0x26')][_0x46f5('0x27')]({'raw':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x131f15[_0x46f5('0x1c')]?_0x131f15['options'][_0x46f5('0x1e')]||null:null,'attributes':_0x131f15[_0x46f5('0x1c')]?_0x131f15[_0x46f5('0x1c')][_0x46f5('0x1f')]||null:null,'include':_0x131f15['options']?_0x131f15[_0x46f5('0x1c')]['include']?_[_0x46f5('0x23')](_0x131f15['options'][_0x46f5('0x21')],function(_0x1dd293){return{'model':db[_0x1dd293[_0x46f5('0x22')]],'as':_0x1dd293['as'],'attributes':_0x1dd293['attributes'],'include':_0x1dd293[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1dd293[_0x46f5('0x21')],function(_0x1ad90c){return{'model':db[_0x1ad90c[_0x46f5('0x22')]],'as':_0x1ad90c['as'],'attributes':_0x1ad90c['attributes'],'include':_0x1ad90c[_0x46f5('0x21')]?_[_0x46f5('0x23')](_0x1ad90c[_0x46f5('0x21')],function(_0x232e68){return{'model':db[_0x232e68['model']],'as':_0x232e68['as'],'attributes':_0x232e68[_0x46f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46f5('0x10')](function(_0xcb164c){logger['info'](_0x46f5('0x25'),_0x131f15);logger[_0x46f5('0x24')](_0x46f5('0x25'),_0x131f15,JSON[_0x46f5('0x28')](_0xcb164c));_0x491aff(_0xcb164c);})[_0x46f5('0x19')](function(_0x5257ce){logger[_0x46f5('0x15')](_0x46f5('0x25'),_0x5257ce[_0x46f5('0x17')],_0x131f15);_0x5d0c51(_0x503262[_0x46f5('0x15')](0x1f4,_0x5257ce[_0x46f5('0x17')]));});});}; \ No newline at end of file +var _0x2e16=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','GetChatQueue','catch','ShowChatQueue','lodash','randomstring','ioredis'];(function(_0x434c9e,_0xba1333){var _0x5b7169=function(_0x5cd22c){while(--_0x5cd22c){_0x434c9e['push'](_0x434c9e['shift']());}};_0x5b7169(++_0xba1333);}(_0x2e16,0x8d));var _0x62e1=function(_0xb40024,_0x26f783){_0xb40024=_0xb40024-0x0;var _0x57ecb4=_0x2e16[_0xb40024];return _0x57ecb4;};'use strict';var _=require(_0x62e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x62e1('0x1'));var fs=require('fs');var Redis=require(_0x62e1('0x2'));var db=require(_0x62e1('0x3'))['db'];var utils=require(_0x62e1('0x4'));var logger=require('../../config/logger')(_0x62e1('0x5'));var config=require(_0x62e1('0x6'));var jayson=require(_0x62e1('0x7'));var client=jayson[_0x62e1('0x8')][_0x62e1('0x9')]({'port':0x232a});config[_0x62e1('0xa')]=_[_0x62e1('0xb')](config[_0x62e1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x62e1('0xc'))(new Redis(config[_0x62e1('0xa')]));require('./chatQueue.socket')[_0x62e1('0xd')](socket);function respondWithRpcPromise(_0x528ec6,_0x4f66e4,_0x2bd27c){return new BPromise(function(_0xbc14e4,_0x3d741f){return client[_0x62e1('0xe')](_0x528ec6,_0x2bd27c)[_0x62e1('0xf')](function(_0xab7486){logger[_0x62e1('0x10')](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4f66e4,_0x62e1('0x12'),JSON[_0x62e1('0x13')](_0xab7486));if(_0xab7486[_0x62e1('0x14')]){if(_0xab7486[_0x62e1('0x14')][_0x62e1('0x15')]===0x1f4){logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0x3d741f(_0xab7486['error'][_0x62e1('0x16')]);}logger[_0x62e1('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f66e4,_0xab7486[_0x62e1('0x14')][_0x62e1('0x16')]);return _0xbc14e4(_0xab7486['error'][_0x62e1('0x16')]);}else{logger['info'](_0x62e1('0x11'),_0x4f66e4,_0x62e1('0x12'));_0xbc14e4(_0xab7486['result']['message']);}})['catch'](function(_0x4d63a0){logger[_0x62e1('0x14')](_0x62e1('0x11'),_0x4f66e4,_0x4d63a0);_0x3d741f(_0x4d63a0);});});}exports['GetChatQueue']=function(_0x295f93){var _0x3bdf8e=this;return new Promise(function(_0x5d1142,_0x3a232a){return db[_0x62e1('0x17')]['findAll']({'raw':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x295f93['options']?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'limit':_0x295f93[_0x62e1('0x18')]?_0x295f93[_0x62e1('0x18')][_0x62e1('0x1c')]||null:null,'include':_0x295f93[_0x62e1('0x18')]?_0x295f93['options'][_0x62e1('0x1d')]?_['map'](_0x295f93[_0x62e1('0x18')][_0x62e1('0x1d')],function(_0xba9310){return{'model':db[_0xba9310['model']],'as':_0xba9310['as'],'attributes':_0xba9310[_0x62e1('0x1b')],'include':_0xba9310[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0xba9310['include'],function(_0x563338){return{'model':db[_0x563338['model']],'as':_0x563338['as'],'attributes':_0x563338['attributes'],'include':_0x563338[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x563338[_0x62e1('0x1d')],function(_0x48cb73){return{'model':db[_0x48cb73[_0x62e1('0x1f')]],'as':_0x48cb73['as'],'attributes':_0x48cb73[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x62e1('0xf')](function(_0x9b39f2){logger[_0x62e1('0x10')]('GetChatQueue',_0x295f93);logger[_0x62e1('0x20')](_0x62e1('0x21'),_0x295f93,JSON[_0x62e1('0x13')](_0x9b39f2));_0x5d1142(_0x9b39f2);})[_0x62e1('0x22')](function(_0x4482d8){logger['error'](_0x62e1('0x21'),_0x4482d8[_0x62e1('0x16')],_0x295f93);_0x3a232a(_0x3bdf8e[_0x62e1('0x14')](0x1f4,_0x4482d8[_0x62e1('0x16')]));});});};exports[_0x62e1('0x23')]=function(_0x4c0d52){var _0x24cdb5=this;return new Promise(function(_0x405981,_0x48cb78){return db[_0x62e1('0x17')]['find']({'raw':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x19')]===undefined?!![]:![]:!![],'where':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1a')]||null:null,'attributes':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52[_0x62e1('0x18')][_0x62e1('0x1b')]||null:null,'include':_0x4c0d52[_0x62e1('0x18')]?_0x4c0d52['options'][_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x4c0d52['options'][_0x62e1('0x1d')],function(_0x421d76){return{'model':db[_0x421d76[_0x62e1('0x1f')]],'as':_0x421d76['as'],'attributes':_0x421d76[_0x62e1('0x1b')],'include':_0x421d76[_0x62e1('0x1d')]?_[_0x62e1('0x1e')](_0x421d76[_0x62e1('0x1d')],function(_0x5393c2){return{'model':db[_0x5393c2[_0x62e1('0x1f')]],'as':_0x5393c2['as'],'attributes':_0x5393c2[_0x62e1('0x1b')],'include':_0x5393c2[_0x62e1('0x1d')]?_['map'](_0x5393c2[_0x62e1('0x1d')],function(_0x4a5b91){return{'model':db[_0x4a5b91[_0x62e1('0x1f')]],'as':_0x4a5b91['as'],'attributes':_0x4a5b91[_0x62e1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35e413){logger['info'](_0x62e1('0x23'),_0x4c0d52);logger[_0x62e1('0x20')]('ShowChatQueue',_0x4c0d52,JSON[_0x62e1('0x13')](_0x35e413));_0x405981(_0x35e413);})[_0x62e1('0x22')](function(_0x28a416){logger['error'](_0x62e1('0x23'),_0x28a416[_0x62e1('0x16')],_0x4c0d52);_0x48cb78(_0x24cdb5[_0x62e1('0x14')](0x1f4,_0x28a416[_0x62e1('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ba01ef5..7c7a57f 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0xb903,0x185));var _0x3b90=function(_0x29b37a,_0x5debfe){_0x29b37a=_0x29b37a-0x0;var _0x5d9d3f=_0xb903[_0x29b37a];return _0x5d9d3f;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}}; \ No newline at end of file +var _0x9a19=['removeListener','register','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a19,0x114));var _0x99a1=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x9a19[_0x2b9b7f];return _0x4ed19a;};'use strict';var ChatQueueEvents=require(_0x99a1('0x0'));var events=[_0x99a1('0x1'),_0x99a1('0x2'),'update'];function createListener(_0x16fd8b,_0x2ba463){return function(_0x112bcc){_0x2ba463[_0x99a1('0x3')](_0x16fd8b,_0x112bcc);};}function removeListener(_0x214082,_0x3d73c5){return function(){ChatQueueEvents[_0x99a1('0x4')](_0x214082,_0x3d73c5);};}exports[_0x99a1('0x5')]=function(_0x3eff4a){for(var _0xff0240=0x0,_0x65045d=events['length'];_0xff0240<_0x65045d;_0xff0240++){var _0x4d2a5c=events[_0xff0240];var _0x5aa6c2=createListener(_0x99a1('0x6')+_0x4d2a5c,_0x3eff4a);ChatQueueEvents['on'](_0x4d2a5c,_0x5aa6c2);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b5766ab..7365171 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5e60dd,_0x117397){var _0x2fd44e=function(_0x15f7a4){while(--_0x15f7a4){_0x5e60dd['push'](_0x5e60dd['shift']());}};_0x2fd44e(++_0x117397);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x36a00a,_0x86031f){var _0x4fba83=function(_0x5574f2){while(--_0x5574f2){_0x36a00a['push'](_0x36a00a['shift']());}};_0x4fba83(++_0x86031f);}(_0x7217,0x19e));var _0x7721=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7217[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8978c59..e0b62b7 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 _0x20ae=['moment','sequelize','STRING','DATE'];(function(_0x31e482,_0x183b9c){var _0x214aa8=function(_0x281c79){while(--_0x281c79){_0x31e482['push'](_0x31e482['shift']());}};_0x214aa8(++_0x183b9c);}(_0x20ae,0x120));var _0xe20a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x20ae[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0xe20a('0x0'));var Sequelize=require(_0xe20a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe20a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe20a('0x3')]},'leaveAt':{'type':Sequelize[_0xe20a('0x3')]},'acceptAt':{'type':Sequelize[_0xe20a('0x3')]},'exitAt':{'type':Sequelize[_0xe20a('0x3')]},'reason':{'type':Sequelize[_0xe20a('0x2')]}}; \ No newline at end of file +var _0x3954=['DATE','moment','sequelize','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3954,0x16d));var _0x4395=function(_0x5c2c9d,_0x4fafe1){_0x5c2c9d=_0x5c2c9d-0x0;var _0x20cda4=_0x3954[_0x5c2c9d];return _0x20cda4;};'use strict';var moment=require(_0x4395('0x0'));var Sequelize=require(_0x4395('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4395('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4395('0x3')]},'leaveAt':{'type':Sequelize[_0x4395('0x3')]},'acceptAt':{'type':Sequelize[_0x4395('0x3')]},'exitAt':{'type':Sequelize[_0x4395('0x3')]},'reason':{'type':Sequelize[_0x4395('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f6945d4..ba6fee8 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 _0x7b84=['map','ChatQueueReport','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7b84,0x167));var _0x47b8=function(_0x49f3c3,_0x1c2be1){_0x49f3c3=_0x49f3c3-0x0;var _0x32e69b=_0x7b84[_0x49f3c3];return _0x32e69b;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47b8('0x3'));var BPromise=require(_0x47b8('0x4'));var Mustache=require(_0x47b8('0x5'));var util=require(_0x47b8('0x6'));var path=require(_0x47b8('0x7'));var sox=require(_0x47b8('0x8'));var csv=require(_0x47b8('0x9'));var ejs=require(_0x47b8('0xa'));var fs=require('fs');var fs_extra=require(_0x47b8('0xb'));var _=require(_0x47b8('0xc'));var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0x9'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47b8('0x15'));var logger=require(_0x47b8('0x16'))(_0x47b8('0x17'));var utils=require(_0x47b8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x47b8('0x19'));var db=require(_0x47b8('0x1a'))['db'];function respondWithStatusCode(_0x50ff5e,_0x1c3cfd){_0x1c3cfd=_0x1c3cfd||0xcc;return function(_0x4e843f){if(_0x4e843f){return _0x50ff5e[_0x47b8('0x1b')](_0x1c3cfd);}return _0x50ff5e[_0x47b8('0x1c')](_0x1c3cfd)[_0x47b8('0x1d')]();};}function respondWithResult(_0x49834d,_0x59388e){_0x59388e=_0x59388e||0xc8;return function(_0x1b1bc4){if(_0x1b1bc4){return _0x49834d['status'](_0x59388e)[_0x47b8('0x1e')](_0x1b1bc4);}};}function respondWithFilteredResult(_0x30fc0b,_0x105e29){return function(_0x1db4de){if(_0x1db4de){var _0x67a4=typeof _0x105e29[_0x47b8('0x1f')]===_0x47b8('0x20')&&typeof _0x105e29[_0x47b8('0x21')]===_0x47b8('0x20');var _0x5dfacd=_0x1db4de[_0x47b8('0x22')];var _0x4c1c0b=_0x67a4?0x0:_0x105e29[_0x47b8('0x1f')];var _0x3da863=_0x67a4?_0x1db4de[_0x47b8('0x22')]:_0x105e29['offset']+_0x105e29[_0x47b8('0x21')];var _0x50f1ae;if(_0x3da863>=_0x5dfacd){_0x3da863=_0x5dfacd;_0x50f1ae=0xc8;}else{_0x50f1ae=0xce;}_0x30fc0b['status'](_0x50f1ae);return _0x30fc0b[_0x47b8('0x23')]('Content-Range',_0x4c1c0b+'-'+_0x3da863+'/'+_0x5dfacd)[_0x47b8('0x1e')](_0x1db4de);}return null;};}function patchUpdates(_0x227cd7){return function(_0x347306){try{jsonpatch[_0x47b8('0x24')](_0x347306,_0x227cd7,!![]);}catch(_0x3a764c){return BPromise[_0x47b8('0x25')](_0x3a764c);}return _0x347306[_0x47b8('0x26')]();};}function saveUpdates(_0x3a45c6,_0x51b6b9){return function(_0x153159){if(_0x153159){return _0x153159[_0x47b8('0x27')](_0x3a45c6)[_0x47b8('0x28')](function(_0x556a09){return _0x556a09;});}return null;};}function removeEntity(_0x3423e2,_0x1f1dd3){return function(_0x251756){if(_0x251756){return _0x251756['destroy']()[_0x47b8('0x28')](function(){_0x3423e2['status'](0xcc)[_0x47b8('0x1d')]();});}};}function handleEntityNotFound(_0x511dbd,_0x62c5db){return function(_0x3e40a1){if(!_0x3e40a1){_0x511dbd[_0x47b8('0x1b')](0x194);}return _0x3e40a1;};}function handleError(_0x177d5c,_0x287ce5){_0x287ce5=_0x287ce5||0x1f4;return function(_0x1dcd63){logger[_0x47b8('0x29')](_0x1dcd63[_0x47b8('0x2a')]);if(_0x1dcd63[_0x47b8('0x2b')]){delete _0x1dcd63[_0x47b8('0x2b')];}_0x177d5c[_0x47b8('0x1c')](_0x287ce5)[_0x47b8('0x2c')](_0x1dcd63);};}exports[_0x47b8('0x2d')]=function(_0x19a605,_0x573c69){var _0x541e0a={},_0x23a317={},_0x9edecd={'count':0x0,'rows':[]};var _0x3e7406=_[_0x47b8('0x2e')](db[_0x47b8('0x2f')]['rawAttributes'],function(_0x4ddef7){return{'name':_0x4ddef7[_0x47b8('0x30')],'type':_0x4ddef7['type'][_0x47b8('0x31')]};});_0x23a317[_0x47b8('0x32')]=_[_0x47b8('0x2e')](_0x3e7406,'name');_0x23a317[_0x47b8('0x33')]=_['keys'](_0x19a605[_0x47b8('0x33')]);_0x23a317['filters']=_[_0x47b8('0x34')](_0x23a317[_0x47b8('0x32')],_0x23a317['query']);_0x541e0a['attributes']=_[_0x47b8('0x34')](_0x23a317['model'],qs[_0x47b8('0x35')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x35')]));_0x541e0a[_0x47b8('0x36')]=_0x541e0a[_0x47b8('0x36')][_0x47b8('0x37')]?_0x541e0a['attributes']:_0x23a317[_0x47b8('0x32')];if(!_0x19a605[_0x47b8('0x33')][_0x47b8('0x38')](_0x47b8('0x39'))){_0x541e0a[_0x47b8('0x21')]=qs[_0x47b8('0x21')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x21')]);_0x541e0a['offset']=qs[_0x47b8('0x1f')](_0x19a605['query'][_0x47b8('0x1f')]);}_0x541e0a[_0x47b8('0x3a')]=qs[_0x47b8('0x3b')](_0x19a605[_0x47b8('0x33')][_0x47b8('0x3b')]);_0x541e0a[_0x47b8('0x3c')]=qs[_0x47b8('0x3d')](_[_0x47b8('0x3e')](_0x19a605[_0x47b8('0x33')],_0x23a317['filters']),_0x3e7406);if(_0x19a605['query'][_0x47b8('0x3f')]){_0x541e0a[_0x47b8('0x3c')]=_['merge'](_0x541e0a[_0x47b8('0x3c')],{'$or':_[_0x47b8('0x2e')](_0x3e7406,function(_0x52155b){if(_0x52155b[_0x47b8('0x40')]!==_0x47b8('0x41')){var _0x290c0a={};_0x290c0a[_0x52155b[_0x47b8('0x2b')]]={'$like':'%'+_0x19a605[_0x47b8('0x33')]['filter']+'%'};return _0x290c0a;}})});}_0x541e0a=_['merge']({},_0x541e0a,_0x19a605[_0x47b8('0x42')]);var _0xe80645={'where':_0x541e0a[_0x47b8('0x3c')]};return db[_0x47b8('0x2f')][_0x47b8('0x22')](_0xe80645)[_0x47b8('0x28')](function(_0x98aadb){_0x9edecd['count']=_0x98aadb;if(_0x19a605[_0x47b8('0x33')][_0x47b8('0x43')]){_0x541e0a[_0x47b8('0x44')]=[{'all':!![]}];}return db[_0x47b8('0x2f')][_0x47b8('0x45')](_0x541e0a);})[_0x47b8('0x28')](function(_0x576f23){_0x9edecd[_0x47b8('0x46')]=_0x576f23;return _0x9edecd;})[_0x47b8('0x28')](respondWithFilteredResult(_0x573c69,_0x541e0a))[_0x47b8('0x47')](handleError(_0x573c69,null));};exports[_0x47b8('0x48')]=function(_0x331a1d,_0x4a85be){var _0x56c59d={'raw':!![],'where':{'id':_0x331a1d['params']['id']}},_0x99ded6={};_0x99ded6[_0x47b8('0x32')]=_[_0x47b8('0x49')](db['ChatQueueReport'][_0x47b8('0x4a')]);_0x99ded6['query']=_[_0x47b8('0x49')](_0x331a1d[_0x47b8('0x33')]);_0x99ded6[_0x47b8('0x3d')]=_[_0x47b8('0x34')](_0x99ded6[_0x47b8('0x32')],_0x99ded6['query']);_0x56c59d[_0x47b8('0x36')]=_[_0x47b8('0x34')](_0x99ded6['model'],qs[_0x47b8('0x35')](_0x331a1d[_0x47b8('0x33')][_0x47b8('0x35')]));_0x56c59d[_0x47b8('0x36')]=_0x56c59d[_0x47b8('0x36')][_0x47b8('0x37')]?_0x56c59d[_0x47b8('0x36')]:_0x99ded6[_0x47b8('0x32')];if(_0x331a1d[_0x47b8('0x33')][_0x47b8('0x43')]){_0x56c59d[_0x47b8('0x44')]=[{'all':!![]}];}_0x56c59d=_['merge']({},_0x56c59d,_0x331a1d[_0x47b8('0x42')]);return db[_0x47b8('0x2f')][_0x47b8('0x4b')](_0x56c59d)['then'](handleEntityNotFound(_0x4a85be,null))[_0x47b8('0x28')](respondWithResult(_0x4a85be,null))['catch'](handleError(_0x4a85be,null));};exports[_0x47b8('0x4c')]=function(_0x4aed88,_0x35f4db){return db[_0x47b8('0x2f')][_0x47b8('0x4c')](_0x4aed88[_0x47b8('0x4d')],{})['then'](respondWithResult(_0x35f4db,0xc9))[_0x47b8('0x47')](handleError(_0x35f4db,null));};exports[_0x47b8('0x27')]=function(_0x165a31,_0x140df1){if(_0x165a31['body']['id']){delete _0x165a31[_0x47b8('0x4d')]['id'];}return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x165a31[_0x47b8('0x4e')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x140df1,null))[_0x47b8('0x28')](saveUpdates(_0x165a31['body'],null))[_0x47b8('0x28')](respondWithResult(_0x140df1,null))[_0x47b8('0x47')](handleError(_0x140df1,null));};exports[_0x47b8('0x4f')]=function(_0x562eff,_0x411b23){return db[_0x47b8('0x2f')][_0x47b8('0x4b')]({'where':{'id':_0x562eff[_0x47b8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x411b23,null))['then'](removeEntity(_0x411b23,null))[_0x47b8('0x47')](handleError(_0x411b23,null));};exports[_0x47b8('0x50')]=function(_0x814e6c,_0x9e4104){return db[_0x47b8('0x2f')][_0x47b8('0x50')]()[_0x47b8('0x28')](respondWithResult(_0x9e4104,null))[_0x47b8('0x47')](handleError(_0x9e4104,null));}; \ No newline at end of file +var _0x1115=['crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1115,0x1b6));var _0x5111=function(_0x5ec706,_0x60f8df){_0x5ec706=_0x5ec706-0x0;var _0x391992=_0x1115[_0x5ec706];return _0x391992;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5111('0x0'));var zipdir=require(_0x5111('0x1'));var jsonpatch=require(_0x5111('0x2'));var rp=require(_0x5111('0x3'));var moment=require(_0x5111('0x4'));var BPromise=require(_0x5111('0x5'));var Mustache=require(_0x5111('0x6'));var util=require(_0x5111('0x7'));var path=require(_0x5111('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5111('0x9'));var fs=require('fs');var fs_extra=require(_0x5111('0xa'));var _=require('lodash');var squel=require(_0x5111('0xb'));var crypto=require(_0x5111('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5111('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5111('0xe'));var Papa=require(_0x5111('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5111('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5111('0x11'));var logger=require('../../config/logger')(_0x5111('0x12'));var utils=require(_0x5111('0x13'));var config=require(_0x5111('0x14'));var licenseUtil=require(_0x5111('0x15'));var db=require(_0x5111('0x16'))['db'];function respondWithStatusCode(_0x54f83a,_0x266625){_0x266625=_0x266625||0xcc;return function(_0x14b4e3){if(_0x14b4e3){return _0x54f83a[_0x5111('0x17')](_0x266625);}return _0x54f83a[_0x5111('0x18')](_0x266625)[_0x5111('0x19')]();};}function respondWithResult(_0x62ce44,_0x264703){_0x264703=_0x264703||0xc8;return function(_0x3e60b5){if(_0x3e60b5){return _0x62ce44[_0x5111('0x18')](_0x264703)[_0x5111('0x1a')](_0x3e60b5);}};}function respondWithFilteredResult(_0x77ddfd,_0x45052e){return function(_0x478b68){if(_0x478b68){var _0x1ac606=typeof _0x45052e['offset']==='undefined'&&typeof _0x45052e[_0x5111('0x1b')]===_0x5111('0x1c');var _0x638470=_0x478b68['count'];var _0x367f8d=_0x1ac606?0x0:_0x45052e[_0x5111('0x1d')];var _0x52c614=_0x1ac606?_0x478b68[_0x5111('0x1e')]:_0x45052e[_0x5111('0x1d')]+_0x45052e[_0x5111('0x1b')];var _0x1b3b45;if(_0x52c614>=_0x638470){_0x52c614=_0x638470;_0x1b3b45=0xc8;}else{_0x1b3b45=0xce;}_0x77ddfd['status'](_0x1b3b45);return _0x77ddfd[_0x5111('0x1f')](_0x5111('0x20'),_0x367f8d+'-'+_0x52c614+'/'+_0x638470)[_0x5111('0x1a')](_0x478b68);}return null;};}function patchUpdates(_0x1b3136){return function(_0x22c7cd){try{jsonpatch[_0x5111('0x21')](_0x22c7cd,_0x1b3136,!![]);}catch(_0x3e8de1){return BPromise[_0x5111('0x22')](_0x3e8de1);}return _0x22c7cd[_0x5111('0x23')]();};}function saveUpdates(_0x3a3fae,_0x4b73ce){return function(_0x3f462d){if(_0x3f462d){return _0x3f462d[_0x5111('0x24')](_0x3a3fae)[_0x5111('0x25')](function(_0x5bf534){return _0x5bf534;});}return null;};}function removeEntity(_0x28cc87,_0x20a4f7){return function(_0x2d9446){if(_0x2d9446){return _0x2d9446[_0x5111('0x26')]()[_0x5111('0x25')](function(){_0x28cc87[_0x5111('0x18')](0xcc)[_0x5111('0x19')]();});}};}function handleEntityNotFound(_0x316b39,_0x382bd0){return function(_0x1a5793){if(!_0x1a5793){_0x316b39['sendStatus'](0x194);}return _0x1a5793;};}function handleError(_0x1bdd54,_0x3d6825){_0x3d6825=_0x3d6825||0x1f4;return function(_0x151b67){logger[_0x5111('0x27')](_0x151b67[_0x5111('0x28')]);if(_0x151b67[_0x5111('0x29')]){delete _0x151b67[_0x5111('0x29')];}_0x1bdd54['status'](_0x3d6825)[_0x5111('0x2a')](_0x151b67);};}exports[_0x5111('0x2b')]=function(_0x25a75a,_0x5efec6){var _0xdf9031={},_0x28efc1={},_0x16107a={'count':0x0,'rows':[]};var _0x48379a=_['map'](db[_0x5111('0x2c')]['rawAttributes'],function(_0xbacf9e){return{'name':_0xbacf9e['fieldName'],'type':_0xbacf9e[_0x5111('0x2d')]['key']};});_0x28efc1['model']=_['map'](_0x48379a,_0x5111('0x29'));_0x28efc1[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x25a75a[_0x5111('0x2e')]);_0x28efc1[_0x5111('0x30')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],_0x28efc1['query']);_0xdf9031[_0x5111('0x33')]=_[_0x5111('0x31')](_0x28efc1[_0x5111('0x32')],qs[_0x5111('0x34')](_0x25a75a['query']['fields']));_0xdf9031[_0x5111('0x33')]=_0xdf9031[_0x5111('0x33')][_0x5111('0x35')]?_0xdf9031[_0x5111('0x33')]:_0x28efc1[_0x5111('0x32')];if(!_0x25a75a[_0x5111('0x2e')][_0x5111('0x36')](_0x5111('0x37'))){_0xdf9031['limit']=qs[_0x5111('0x1b')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1b')]);_0xdf9031['offset']=qs[_0x5111('0x1d')](_0x25a75a[_0x5111('0x2e')][_0x5111('0x1d')]);}_0xdf9031['order']=qs['sort'](_0x25a75a['query'][_0x5111('0x38')]);_0xdf9031[_0x5111('0x39')]=qs[_0x5111('0x30')](_[_0x5111('0x3a')](_0x25a75a[_0x5111('0x2e')],_0x28efc1['filters']),_0x48379a);if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]){_0xdf9031[_0x5111('0x39')]=_[_0x5111('0x3c')](_0xdf9031['where'],{'$or':_[_0x5111('0x3d')](_0x48379a,function(_0x444d82){if(_0x444d82[_0x5111('0x2d')]!==_0x5111('0x3e')){var _0x2f0224={};_0x2f0224[_0x444d82[_0x5111('0x29')]]={'$like':'%'+_0x25a75a[_0x5111('0x2e')][_0x5111('0x3b')]+'%'};return _0x2f0224;}})});}_0xdf9031=_[_0x5111('0x3c')]({},_0xdf9031,_0x25a75a[_0x5111('0x3f')]);var _0x35c3b5={'where':_0xdf9031[_0x5111('0x39')]};return db[_0x5111('0x2c')]['count'](_0x35c3b5)[_0x5111('0x25')](function(_0xf00f9){_0x16107a['count']=_0xf00f9;if(_0x25a75a[_0x5111('0x2e')][_0x5111('0x40')]){_0xdf9031[_0x5111('0x41')]=[{'all':!![]}];}return db[_0x5111('0x2c')][_0x5111('0x42')](_0xdf9031);})[_0x5111('0x25')](function(_0x1f1534){_0x16107a['rows']=_0x1f1534;return _0x16107a;})[_0x5111('0x25')](respondWithFilteredResult(_0x5efec6,_0xdf9031))[_0x5111('0x43')](handleError(_0x5efec6,null));};exports[_0x5111('0x44')]=function(_0x1c2e17,_0x96893c){var _0x49307f={'raw':!![],'where':{'id':_0x1c2e17[_0x5111('0x45')]['id']}},_0x50a293={};_0x50a293[_0x5111('0x32')]=_['keys'](db[_0x5111('0x2c')][_0x5111('0x46')]);_0x50a293[_0x5111('0x2e')]=_[_0x5111('0x2f')](_0x1c2e17[_0x5111('0x2e')]);_0x50a293[_0x5111('0x30')]=_[_0x5111('0x31')](_0x50a293[_0x5111('0x32')],_0x50a293[_0x5111('0x2e')]);_0x49307f[_0x5111('0x33')]=_['intersection'](_0x50a293['model'],qs[_0x5111('0x34')](_0x1c2e17[_0x5111('0x2e')][_0x5111('0x34')]));_0x49307f[_0x5111('0x33')]=_0x49307f[_0x5111('0x33')][_0x5111('0x35')]?_0x49307f['attributes']:_0x50a293[_0x5111('0x32')];if(_0x1c2e17[_0x5111('0x2e')][_0x5111('0x40')]){_0x49307f[_0x5111('0x41')]=[{'all':!![]}];}_0x49307f=_['merge']({},_0x49307f,_0x1c2e17[_0x5111('0x3f')]);return db[_0x5111('0x2c')][_0x5111('0x47')](_0x49307f)['then'](handleEntityNotFound(_0x96893c,null))[_0x5111('0x25')](respondWithResult(_0x96893c,null))[_0x5111('0x43')](handleError(_0x96893c,null));};exports[_0x5111('0x48')]=function(_0x2d64de,_0x5cd7a5){return db['ChatQueueReport'][_0x5111('0x48')](_0x2d64de['body'],{})['then'](respondWithResult(_0x5cd7a5,0xc9))[_0x5111('0x43')](handleError(_0x5cd7a5,null));};exports[_0x5111('0x24')]=function(_0x4aa934,_0x296f87){if(_0x4aa934[_0x5111('0x49')]['id']){delete _0x4aa934[_0x5111('0x49')]['id'];}return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x4aa934[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x296f87,null))[_0x5111('0x25')](saveUpdates(_0x4aa934[_0x5111('0x49')],null))[_0x5111('0x25')](respondWithResult(_0x296f87,null))[_0x5111('0x43')](handleError(_0x296f87,null));};exports[_0x5111('0x26')]=function(_0x53d631,_0x79427d){return db[_0x5111('0x2c')][_0x5111('0x47')]({'where':{'id':_0x53d631[_0x5111('0x45')]['id']}})[_0x5111('0x25')](handleEntityNotFound(_0x79427d,null))[_0x5111('0x25')](removeEntity(_0x79427d,null))[_0x5111('0x43')](handleError(_0x79427d,null));};exports['describe']=function(_0x55cba5,_0x13fe1b){return db['ChatQueueReport'][_0x5111('0x4a')]()[_0x5111('0x25')](respondWithResult(_0x13fe1b,null))[_0x5111('0x43')](handleError(_0x13fe1b,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 336656a..9854054 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5071d9,_0x2dcf15){var _0x4b92d1=function(_0x2dfdd7){while(--_0x2dfdd7){_0x5071d9['push'](_0x5071d9['shift']());}};_0x4b92d1(++_0x2dcf15);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f6966b8..4a33dfe 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 _0x2b88=['jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a9d06,_0x4c70e3){var _0x7776b9=function(_0x37dfc0){while(--_0x37dfc0){_0x1a9d06['push'](_0x1a9d06['shift']());}};_0x7776b9(++_0x4c70e3);}(_0x2b88,0x1b1));var _0x82b8=function(_0x5d5c49,_0x528f94){_0x5d5c49=_0x5d5c49-0x0;var _0x41cb72=_0x2b88[_0x5d5c49];return _0x41cb72;};'use strict';var _=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var moment=require('moment');var BPromise=require(_0x82b8('0x2'));var rs=require(_0x82b8('0x3'));var fs=require('fs');var Redis=require(_0x82b8('0x4'));var db=require(_0x82b8('0x5'))['db'];var utils=require(_0x82b8('0x6'));var logger=require('../../config/logger')(_0x82b8('0x7'));var config=require(_0x82b8('0x8'));var jayson=require(_0x82b8('0x9'));var client=jayson['client'][_0x82b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13f2d0,_0x41f35f,_0xccf541){return new BPromise(function(_0x30231a,_0x531491){return client[_0x82b8('0xb')](_0x13f2d0,_0xccf541)[_0x82b8('0xc')](function(_0x33a04a){logger[_0x82b8('0xd')](_0x82b8('0xe'),_0x41f35f,_0x82b8('0xf'));logger[_0x82b8('0x10')](_0x82b8('0x11'),_0x41f35f,_0x82b8('0xf'),JSON[_0x82b8('0x12')](_0x33a04a));if(_0x33a04a[_0x82b8('0x13')]){if(_0x33a04a[_0x82b8('0x13')][_0x82b8('0x14')]===0x1f4){logger[_0x82b8('0x13')](_0x82b8('0xe'),_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x531491(_0x33a04a[_0x82b8('0x13')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,_0x33a04a[_0x82b8('0x13')][_0x82b8('0x15')]);return _0x30231a(_0x33a04a[_0x82b8('0x13')]['message']);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x41f35f,'request\x20sent');_0x30231a(_0x33a04a[_0x82b8('0x16')][_0x82b8('0x15')]);}})[_0x82b8('0x17')](function(_0x35b09c){logger['error'](_0x82b8('0xe'),_0x41f35f,_0x35b09c);_0x531491(_0x35b09c);});});}exports[_0x82b8('0x18')]=function(_0x49a755){var _0x35324c=this;return new Promise(function(_0x2161e1,_0x33e945){return db[_0x82b8('0x19')][_0x82b8('0x1a')](_0x49a755['body'],{'raw':_0x49a755[_0x82b8('0x1b')]?_0x49a755['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![]})[_0x82b8('0xc')](function(_0x2fce2f){logger['info'](_0x82b8('0x18'),_0x49a755);logger[_0x82b8('0x10')]('CreateChatQueueReport',_0x49a755,JSON[_0x82b8('0x12')](_0x2fce2f));_0x2161e1(_0x2fce2f);})[_0x82b8('0x17')](function(_0x1c54d8){logger[_0x82b8('0x13')](_0x82b8('0x18'),_0x1c54d8[_0x82b8('0x15')],_0x49a755);_0x33e945(_0x35324c['error'](0x1f4,_0x1c54d8[_0x82b8('0x15')]));});});};exports[_0x82b8('0x1d')]=function(_0x20b7cd){var _0x5831c3=this;return new Promise(function(_0x9aa23c,_0x3315d5){return db[_0x82b8('0x19')][_0x82b8('0x1e')](_0x20b7cd[_0x82b8('0x1f')],{'raw':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd['options'][_0x82b8('0x20')]||null:null,'attributes':_0x20b7cd[_0x82b8('0x1b')]?_0x20b7cd[_0x82b8('0x1b')][_0x82b8('0x21')]||null:null,'limit':_0x20b7cd['options']?_0x20b7cd[_0x82b8('0x1b')]['limit']||null:null})[_0x82b8('0xc')](function(_0x9263aa){logger[_0x82b8('0xd')](_0x82b8('0x1d'),_0x20b7cd);logger[_0x82b8('0x10')]('UpdateChatQueueReport',_0x20b7cd,JSON[_0x82b8('0x12')](_0x9263aa));_0x9aa23c(_0x9263aa);})[_0x82b8('0x17')](function(_0x58b4b0){logger[_0x82b8('0x13')]('UpdateChatQueueReport',_0x58b4b0[_0x82b8('0x15')],_0x20b7cd);_0x3315d5(_0x5831c3[_0x82b8('0x13')](0x1f4,_0x58b4b0['message']));});});}; \ No newline at end of file +var _0xf0b0=['UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateChatQueueReport','create','body','options','raw','ChatQueueReport','update','where','attributes','limit'];(function(_0x31144e,_0x14fc9e){var _0x44553c=function(_0x4431c1){while(--_0x4431c1){_0x31144e['push'](_0x31144e['shift']());}};_0x44553c(++_0x14fc9e);}(_0xf0b0,0x16c));var _0x0f0b=function(_0x2e26eb,_0x49afba){_0x2e26eb=_0x2e26eb-0x0;var _0x432e15=_0xf0b0[_0x2e26eb];return _0x432e15;};'use strict';var _=require('lodash');var util=require(_0x0f0b('0x0'));var moment=require(_0x0f0b('0x1'));var BPromise=require(_0x0f0b('0x2'));var rs=require(_0x0f0b('0x3'));var fs=require('fs');var Redis=require(_0x0f0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f0b('0x5'));var logger=require(_0x0f0b('0x6'))(_0x0f0b('0x7'));var config=require(_0x0f0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fcbb9,_0x444876,_0x34712e){return new BPromise(function(_0x2bd5f5,_0x4f497d){return client[_0x0f0b('0xa')](_0x1fcbb9,_0x34712e)[_0x0f0b('0xb')](function(_0x259167){logger[_0x0f0b('0xc')](_0x0f0b('0xd'),_0x444876,'request\x20sent');logger[_0x0f0b('0xe')](_0x0f0b('0xf'),_0x444876,'request\x20sent',JSON[_0x0f0b('0x10')](_0x259167));if(_0x259167[_0x0f0b('0x11')]){if(_0x259167[_0x0f0b('0x11')][_0x0f0b('0x12')]===0x1f4){logger[_0x0f0b('0x11')](_0x0f0b('0xd'),_0x444876,_0x259167['error'][_0x0f0b('0x13')]);return _0x4f497d(_0x259167['error'][_0x0f0b('0x13')]);}logger[_0x0f0b('0x11')](_0x0f0b('0xd'),_0x444876,_0x259167[_0x0f0b('0x11')][_0x0f0b('0x13')]);return _0x2bd5f5(_0x259167[_0x0f0b('0x11')][_0x0f0b('0x13')]);}else{logger[_0x0f0b('0xc')](_0x0f0b('0xd'),_0x444876,_0x0f0b('0x14'));_0x2bd5f5(_0x259167['result'][_0x0f0b('0x13')]);}})[_0x0f0b('0x15')](function(_0x5eeb66){logger[_0x0f0b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x444876,_0x5eeb66);_0x4f497d(_0x5eeb66);});});}exports[_0x0f0b('0x16')]=function(_0x2c03a6){var _0x5d8fa1=this;return new Promise(function(_0x3d0572,_0x2f52a5){return db['ChatQueueReport'][_0x0f0b('0x17')](_0x2c03a6[_0x0f0b('0x18')],{'raw':_0x2c03a6[_0x0f0b('0x19')]?_0x2c03a6[_0x0f0b('0x19')][_0x0f0b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x365c76){logger[_0x0f0b('0xc')]('CreateChatQueueReport',_0x2c03a6);logger[_0x0f0b('0xe')](_0x0f0b('0x16'),_0x2c03a6,JSON[_0x0f0b('0x10')](_0x365c76));_0x3d0572(_0x365c76);})['catch'](function(_0x3b5a54){logger[_0x0f0b('0x11')]('CreateChatQueueReport',_0x3b5a54['message'],_0x2c03a6);_0x2f52a5(_0x5d8fa1['error'](0x1f4,_0x3b5a54[_0x0f0b('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x69d616){var _0x1fdbb4=this;return new Promise(function(_0xe34c31,_0x2be5d6){return db[_0x0f0b('0x1b')][_0x0f0b('0x1c')](_0x69d616[_0x0f0b('0x18')],{'raw':_0x69d616['options']?_0x69d616[_0x0f0b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x69d616[_0x0f0b('0x19')]?_0x69d616['options'][_0x0f0b('0x1d')]||null:null,'attributes':_0x69d616[_0x0f0b('0x19')]?_0x69d616[_0x0f0b('0x19')][_0x0f0b('0x1e')]||null:null,'limit':_0x69d616[_0x0f0b('0x19')]?_0x69d616[_0x0f0b('0x19')][_0x0f0b('0x1f')]||null:null})['then'](function(_0xa62c01){logger[_0x0f0b('0xc')](_0x0f0b('0x20'),_0x69d616);logger[_0x0f0b('0xe')]('UpdateChatQueueReport',_0x69d616,JSON['stringify'](_0xa62c01));_0xe34c31(_0xa62c01);})[_0x0f0b('0x15')](function(_0x52cd58){logger[_0x0f0b('0x11')]('UpdateChatQueueReport',_0x52cd58[_0x0f0b('0x13')],_0x69d616);_0x2be5d6(_0x1fdbb4[_0x0f0b('0x11')](0x1f4,_0x52cd58[_0x0f0b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 90df9ed..d167297 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 _0x7732=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x42b515,_0x30b55e){var _0x1de82b=function(_0x1c4e81){while(--_0x1c4e81){_0x42b515['push'](_0x42b515['shift']());}};_0x1de82b(++_0x30b55e);}(_0x7732,0xb1));var _0x2773=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x7732[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var path=require(_0x2773('0x2'));var timeout=require('connect-timeout');var express=require(_0x2773('0x3'));var router=express[_0x2773('0x4')]();var fs_extra=require(_0x2773('0x5'));var auth=require(_0x2773('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2773('0x7'));router[_0x2773('0x8')]('/',auth[_0x2773('0x9')](),controller['index']);router[_0x2773('0x8')](_0x2773('0xa'),auth[_0x2773('0x9')](),controller[_0x2773('0xb')]);router[_0x2773('0x8')](_0x2773('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2773('0x9')](),controller[_0x2773('0xd')]);router[_0x2773('0xe')]('/:id',auth[_0x2773('0x9')](),controller[_0x2773('0xf')]);router[_0x2773('0x10')](_0x2773('0xc'),auth[_0x2773('0x9')](),controller[_0x2773('0x11')]);module[_0x2773('0x12')]=router; \ No newline at end of file +var _0x381a=['../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x34412f,_0x116bea){var _0x4b4b5a=function(_0x56fc5b){while(--_0x56fc5b){_0x34412f['push'](_0x34412f['shift']());}};_0x4b4b5a(++_0x116bea);}(_0x381a,0x13a));var _0xa381=function(_0x5127f4,_0xf5363b){_0x5127f4=_0x5127f4-0x0;var _0x3cdbcc=_0x381a[_0x5127f4];return _0x3cdbcc;};'use strict';var multer=require(_0xa381('0x0'));var util=require(_0xa381('0x1'));var path=require(_0xa381('0x2'));var timeout=require('connect-timeout');var express=require(_0xa381('0x3'));var router=express[_0xa381('0x4')]();var fs_extra=require(_0xa381('0x5'));var auth=require(_0xa381('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa381('0x7'));var controller=require('./chatQueueReport.controller');router[_0xa381('0x8')]('/',auth[_0xa381('0x9')](),controller['index']);router[_0xa381('0x8')](_0xa381('0xa'),auth[_0xa381('0x9')](),controller['describe']);router['get'](_0xa381('0xb'),auth['isAuthenticated'](),controller[_0xa381('0xc')]);router[_0xa381('0xd')]('/',auth[_0xa381('0x9')](),controller[_0xa381('0xe')]);router[_0xa381('0xf')](_0xa381('0xb'),auth[_0xa381('0x9')](),controller[_0xa381('0x10')]);router[_0xa381('0x11')](_0xa381('0xb'),auth[_0xa381('0x9')](),controller[_0xa381('0x12')]);module[_0xa381('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 7e97a76..881990e 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1cb077,_0x32990d){_0x1cb077=_0x1cb077-0x0;var _0x46750a=_0xb43b[_0x1cb077];return _0x46750a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 369519f..ba0c96f 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 _0x29c1=['length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys'];(function(_0x4e9dcb,_0xd1fb87){var _0x5105fc=function(_0x2df827){while(--_0x2df827){_0x4e9dcb['push'](_0x4e9dcb['shift']());}};_0x5105fc(++_0xd1fb87);}(_0x29c1,0x1c7));var _0x129c=function(_0x781647,_0x18edc0){_0x781647=_0x781647-0x0;var _0x56fcdb=_0x29c1[_0x781647];return _0x56fcdb;};'use strict';var emlformat=require(_0x129c('0x0'));var rimraf=require(_0x129c('0x1'));var zipdir=require(_0x129c('0x2'));var jsonpatch=require(_0x129c('0x3'));var rp=require(_0x129c('0x4'));var moment=require(_0x129c('0x5'));var BPromise=require(_0x129c('0x6'));var Mustache=require(_0x129c('0x7'));var util=require(_0x129c('0x8'));var path=require(_0x129c('0x9'));var sox=require(_0x129c('0xa'));var csv=require('to-csv');var ejs=require(_0x129c('0xb'));var fs=require('fs');var fs_extra=require(_0x129c('0xc'));var _=require(_0x129c('0xd'));var squel=require(_0x129c('0xe'));var crypto=require(_0x129c('0xf'));var jsforce=require(_0x129c('0x10'));var deskjs=require(_0x129c('0x11'));var toCsv=require(_0x129c('0x12'));var querystring=require('querystring');var Papa=require(_0x129c('0x13'));var Redis=require(_0x129c('0x14'));var authService=require(_0x129c('0x15'));var qs=require(_0x129c('0x16'));var as=require(_0x129c('0x17'));var hardwareService=require(_0x129c('0x18'));var logger=require(_0x129c('0x19'))(_0x129c('0x1a'));var utils=require('../../config/utils');var config=require(_0x129c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48f3b3,_0x56a63b){_0x56a63b=_0x56a63b||0xcc;return function(_0x24785a){if(_0x24785a){return _0x48f3b3['sendStatus'](_0x56a63b);}return _0x48f3b3[_0x129c('0x1c')](_0x56a63b)[_0x129c('0x1d')]();};}function respondWithResult(_0x14bd93,_0x51d514){_0x51d514=_0x51d514||0xc8;return function(_0x3d08b2){if(_0x3d08b2){return _0x14bd93[_0x129c('0x1c')](_0x51d514)[_0x129c('0x1e')](_0x3d08b2);}};}function respondWithFilteredResult(_0x326890,_0x400f8c){return function(_0x54f8ce){if(_0x54f8ce){var _0x4c4bce=typeof _0x400f8c['offset']===_0x129c('0x1f')&&typeof _0x400f8c[_0x129c('0x20')]===_0x129c('0x1f');var _0x2b7939=_0x54f8ce[_0x129c('0x21')];var _0x34ee0b=_0x4c4bce?0x0:_0x400f8c[_0x129c('0x22')];var _0x201359=_0x4c4bce?_0x54f8ce[_0x129c('0x21')]:_0x400f8c[_0x129c('0x22')]+_0x400f8c[_0x129c('0x20')];var _0x1309b8;if(_0x201359>=_0x2b7939){_0x201359=_0x2b7939;_0x1309b8=0xc8;}else{_0x1309b8=0xce;}_0x326890['status'](_0x1309b8);return _0x326890['set'](_0x129c('0x23'),_0x34ee0b+'-'+_0x201359+'/'+_0x2b7939)[_0x129c('0x1e')](_0x54f8ce);}return null;};}function patchUpdates(_0x4b1003){return function(_0x3cbffa){try{jsonpatch['apply'](_0x3cbffa,_0x4b1003,!![]);}catch(_0x116381){return BPromise[_0x129c('0x24')](_0x116381);}return _0x3cbffa[_0x129c('0x25')]();};}function saveUpdates(_0x3a7b40,_0x1e363b){return function(_0x3cab81){if(_0x3cab81){return _0x3cab81[_0x129c('0x26')](_0x3a7b40)[_0x129c('0x27')](function(_0xed5304){return _0xed5304;});}return null;};}function removeEntity(_0x5abf95,_0x17ba8c){return function(_0x22c772){if(_0x22c772){return _0x22c772[_0x129c('0x28')]()[_0x129c('0x27')](function(){_0x5abf95[_0x129c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x158bca,_0x5406d2){return function(_0xbf9fac){if(!_0xbf9fac){_0x158bca['sendStatus'](0x194);}return _0xbf9fac;};}function handleError(_0x12c650,_0x1d3b7c){_0x1d3b7c=_0x1d3b7c||0x1f4;return function(_0x1b4d59){logger[_0x129c('0x29')](_0x1b4d59[_0x129c('0x2a')]);if(_0x1b4d59['name']){delete _0x1b4d59[_0x129c('0x2b')];}_0x12c650[_0x129c('0x1c')](_0x1d3b7c)[_0x129c('0x2c')](_0x1b4d59);};}exports['index']=function(_0x383ad1,_0x2462b4){var _0x5259e6={},_0x4e8193={},_0x5d7110={'count':0x0,'rows':[]};var _0x16a0fe=_[_0x129c('0x2d')](db[_0x129c('0x2e')][_0x129c('0x2f')],function(_0xc6ad63){return{'name':_0xc6ad63[_0x129c('0x30')],'type':_0xc6ad63[_0x129c('0x31')][_0x129c('0x32')]};});_0x4e8193[_0x129c('0x33')]=_[_0x129c('0x2d')](_0x16a0fe,_0x129c('0x2b'));_0x4e8193[_0x129c('0x34')]=_['keys'](_0x383ad1['query']);_0x4e8193[_0x129c('0x35')]=_[_0x129c('0x36')](_0x4e8193['model'],_0x4e8193[_0x129c('0x34')]);_0x5259e6[_0x129c('0x37')]=_[_0x129c('0x36')](_0x4e8193[_0x129c('0x33')],qs[_0x129c('0x38')](_0x383ad1[_0x129c('0x34')][_0x129c('0x38')]));_0x5259e6[_0x129c('0x37')]=_0x5259e6[_0x129c('0x37')]['length']?_0x5259e6[_0x129c('0x37')]:_0x4e8193[_0x129c('0x33')];if(!_0x383ad1[_0x129c('0x34')][_0x129c('0x39')]('nolimit')){_0x5259e6[_0x129c('0x20')]=qs[_0x129c('0x20')](_0x383ad1['query'][_0x129c('0x20')]);_0x5259e6[_0x129c('0x22')]=qs['offset'](_0x383ad1[_0x129c('0x34')][_0x129c('0x22')]);}_0x5259e6['order']=qs[_0x129c('0x3a')](_0x383ad1[_0x129c('0x34')][_0x129c('0x3a')]);_0x5259e6[_0x129c('0x3b')]=qs['filters'](_[_0x129c('0x3c')](_0x383ad1[_0x129c('0x34')],_0x4e8193['filters']),_0x16a0fe);if(_0x383ad1[_0x129c('0x34')]['filter']){_0x5259e6[_0x129c('0x3b')]=_[_0x129c('0x3d')](_0x5259e6['where'],{'$or':_[_0x129c('0x2d')](_0x16a0fe,function(_0x3882b5){if(_0x3882b5[_0x129c('0x31')]!==_0x129c('0x3e')){var _0x82d237={};_0x82d237[_0x3882b5[_0x129c('0x2b')]]={'$like':'%'+_0x383ad1['query']['filter']+'%'};return _0x82d237;}})});}_0x5259e6=_[_0x129c('0x3d')]({},_0x5259e6,_0x383ad1[_0x129c('0x3f')]);var _0x59eb15={'where':_0x5259e6[_0x129c('0x3b')]};return db[_0x129c('0x2e')][_0x129c('0x21')](_0x59eb15)[_0x129c('0x27')](function(_0x21b957){_0x5d7110[_0x129c('0x21')]=_0x21b957;if(_0x383ad1[_0x129c('0x34')][_0x129c('0x40')]){_0x5259e6[_0x129c('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5259e6);})[_0x129c('0x27')](function(_0x47e4ef){_0x5d7110[_0x129c('0x42')]=_0x47e4ef;return _0x5d7110;})[_0x129c('0x27')](respondWithFilteredResult(_0x2462b4,_0x5259e6))[_0x129c('0x43')](handleError(_0x2462b4,null));};exports['show']=function(_0x3fed51,_0x3e0b62){var _0x2e262a={'raw':!![],'where':{'id':_0x3fed51[_0x129c('0x44')]['id']}},_0x34a84d={};_0x34a84d[_0x129c('0x33')]=_[_0x129c('0x45')](db[_0x129c('0x2e')][_0x129c('0x2f')]);_0x34a84d[_0x129c('0x34')]=_['keys'](_0x3fed51[_0x129c('0x34')]);_0x34a84d[_0x129c('0x35')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],_0x34a84d[_0x129c('0x34')]);_0x2e262a[_0x129c('0x37')]=_[_0x129c('0x36')](_0x34a84d[_0x129c('0x33')],qs['fields'](_0x3fed51[_0x129c('0x34')][_0x129c('0x38')]));_0x2e262a[_0x129c('0x37')]=_0x2e262a[_0x129c('0x37')][_0x129c('0x46')]?_0x2e262a[_0x129c('0x37')]:_0x34a84d[_0x129c('0x33')];if(_0x3fed51['query'][_0x129c('0x40')]){_0x2e262a[_0x129c('0x41')]=[{'all':!![]}];}_0x2e262a=_[_0x129c('0x3d')]({},_0x2e262a,_0x3fed51[_0x129c('0x3f')]);return db[_0x129c('0x2e')][_0x129c('0x47')](_0x2e262a)[_0x129c('0x27')](handleEntityNotFound(_0x3e0b62,null))[_0x129c('0x27')](respondWithResult(_0x3e0b62,null))['catch'](handleError(_0x3e0b62,null));};exports[_0x129c('0x48')]=function(_0x5b28a7,_0x306f30){return db[_0x129c('0x2e')]['create'](_0x5b28a7[_0x129c('0x49')],{})['then'](respondWithResult(_0x306f30,0xc9))[_0x129c('0x43')](handleError(_0x306f30,null));};exports[_0x129c('0x26')]=function(_0x18aa0e,_0x4722f5){if(_0x18aa0e['body']['id']){delete _0x18aa0e[_0x129c('0x49')]['id'];}return db['ChatTransferReport'][_0x129c('0x47')]({'where':{'id':_0x18aa0e[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x4722f5,null))[_0x129c('0x27')](saveUpdates(_0x18aa0e['body'],null))[_0x129c('0x27')](respondWithResult(_0x4722f5,null))[_0x129c('0x43')](handleError(_0x4722f5,null));};exports[_0x129c('0x28')]=function(_0x3bec16,_0x1750b7){return db[_0x129c('0x2e')][_0x129c('0x47')]({'where':{'id':_0x3bec16[_0x129c('0x44')]['id']}})[_0x129c('0x27')](handleEntityNotFound(_0x1750b7,null))[_0x129c('0x27')](removeEntity(_0x1750b7,null))[_0x129c('0x43')](handleError(_0x1750b7,null));};exports[_0x129c('0x4a')]=function(_0x446023,_0x202151){return db[_0x129c('0x2e')][_0x129c('0x4a')]()[_0x129c('0x27')](respondWithResult(_0x202151,null))['catch'](handleError(_0x202151,null));}; \ No newline at end of file +var _0x88a2=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x23aa23,_0x4268a0){var _0x28b5e9=function(_0x12dcc2){while(--_0x12dcc2){_0x23aa23['push'](_0x23aa23['shift']());}};_0x28b5e9(++_0x4268a0);}(_0x88a2,0x1b0));var _0x288a=function(_0x28f4c2,_0x1479c4){_0x28f4c2=_0x28f4c2-0x0;var _0x12d573=_0x88a2[_0x28f4c2];return _0x12d573;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x288a('0x0'));var zipdir=require(_0x288a('0x1'));var jsonpatch=require(_0x288a('0x2'));var rp=require('request-promise');var moment=require(_0x288a('0x3'));var BPromise=require(_0x288a('0x4'));var Mustache=require(_0x288a('0x5'));var util=require(_0x288a('0x6'));var path=require(_0x288a('0x7'));var sox=require('sox');var csv=require(_0x288a('0x8'));var ejs=require(_0x288a('0x9'));var fs=require('fs');var fs_extra=require(_0x288a('0xa'));var _=require(_0x288a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x288a('0x8'));var querystring=require(_0x288a('0xc'));var Papa=require(_0x288a('0xd'));var Redis=require(_0x288a('0xe'));var authService=require(_0x288a('0xf'));var qs=require(_0x288a('0x10'));var as=require(_0x288a('0x11'));var hardwareService=require(_0x288a('0x12'));var logger=require(_0x288a('0x13'))(_0x288a('0x14'));var utils=require(_0x288a('0x15'));var config=require(_0x288a('0x16'));var licenseUtil=require(_0x288a('0x17'));var db=require(_0x288a('0x18'))['db'];function respondWithStatusCode(_0x40a5b9,_0x2dd036){_0x2dd036=_0x2dd036||0xcc;return function(_0x5e90eb){if(_0x5e90eb){return _0x40a5b9[_0x288a('0x19')](_0x2dd036);}return _0x40a5b9['status'](_0x2dd036)[_0x288a('0x1a')]();};}function respondWithResult(_0x3d705c,_0x1a11f1){_0x1a11f1=_0x1a11f1||0xc8;return function(_0x3ade07){if(_0x3ade07){return _0x3d705c[_0x288a('0x1b')](_0x1a11f1)[_0x288a('0x1c')](_0x3ade07);}};}function respondWithFilteredResult(_0x50e8e8,_0x5f2849){return function(_0x180c3e){if(_0x180c3e){var _0xcee1c2=typeof _0x5f2849[_0x288a('0x1d')]===_0x288a('0x1e')&&typeof _0x5f2849[_0x288a('0x1f')]===_0x288a('0x1e');var _0x369f5b=_0x180c3e[_0x288a('0x20')];var _0x527603=_0xcee1c2?0x0:_0x5f2849['offset'];var _0x408c8a=_0xcee1c2?_0x180c3e[_0x288a('0x20')]:_0x5f2849['offset']+_0x5f2849[_0x288a('0x1f')];var _0x1e557f;if(_0x408c8a>=_0x369f5b){_0x408c8a=_0x369f5b;_0x1e557f=0xc8;}else{_0x1e557f=0xce;}_0x50e8e8['status'](_0x1e557f);return _0x50e8e8[_0x288a('0x21')](_0x288a('0x22'),_0x527603+'-'+_0x408c8a+'/'+_0x369f5b)['json'](_0x180c3e);}return null;};}function patchUpdates(_0xd23bc3){return function(_0x21fc06){try{jsonpatch[_0x288a('0x23')](_0x21fc06,_0xd23bc3,!![]);}catch(_0x46438b){return BPromise[_0x288a('0x24')](_0x46438b);}return _0x21fc06[_0x288a('0x25')]();};}function saveUpdates(_0x636238,_0x352546){return function(_0x4b1f6d){if(_0x4b1f6d){return _0x4b1f6d[_0x288a('0x26')](_0x636238)[_0x288a('0x27')](function(_0x164bf9){return _0x164bf9;});}return null;};}function removeEntity(_0x40add,_0x1c7a02){return function(_0x480a8e){if(_0x480a8e){return _0x480a8e[_0x288a('0x28')]()['then'](function(){_0x40add[_0x288a('0x1b')](0xcc)[_0x288a('0x1a')]();});}};}function handleEntityNotFound(_0x1c4930,_0x2ab9e3){return function(_0x1ace88){if(!_0x1ace88){_0x1c4930[_0x288a('0x19')](0x194);}return _0x1ace88;};}function handleError(_0x18c960,_0x3a70a4){_0x3a70a4=_0x3a70a4||0x1f4;return function(_0x3eedbf){logger[_0x288a('0x29')](_0x3eedbf['stack']);if(_0x3eedbf[_0x288a('0x2a')]){delete _0x3eedbf['name'];}_0x18c960[_0x288a('0x1b')](_0x3a70a4)[_0x288a('0x2b')](_0x3eedbf);};}exports['index']=function(_0x537c14,_0xe75bec){var _0x5dfd48={},_0x31c5ea={},_0x5dd930={'count':0x0,'rows':[]};var _0xbd2007=_[_0x288a('0x2c')](db['ChatTransferReport'][_0x288a('0x2d')],function(_0x467207){return{'name':_0x467207[_0x288a('0x2e')],'type':_0x467207['type'][_0x288a('0x2f')]};});_0x31c5ea[_0x288a('0x30')]=_[_0x288a('0x2c')](_0xbd2007,_0x288a('0x2a'));_0x31c5ea[_0x288a('0x31')]=_[_0x288a('0x32')](_0x537c14[_0x288a('0x31')]);_0x31c5ea[_0x288a('0x33')]=_['intersection'](_0x31c5ea[_0x288a('0x30')],_0x31c5ea[_0x288a('0x31')]);_0x5dfd48[_0x288a('0x34')]=_[_0x288a('0x35')](_0x31c5ea[_0x288a('0x30')],qs[_0x288a('0x36')](_0x537c14[_0x288a('0x31')]['fields']));_0x5dfd48[_0x288a('0x34')]=_0x5dfd48[_0x288a('0x34')][_0x288a('0x37')]?_0x5dfd48[_0x288a('0x34')]:_0x31c5ea[_0x288a('0x30')];if(!_0x537c14[_0x288a('0x31')][_0x288a('0x38')](_0x288a('0x39'))){_0x5dfd48[_0x288a('0x1f')]=qs[_0x288a('0x1f')](_0x537c14[_0x288a('0x31')]['limit']);_0x5dfd48[_0x288a('0x1d')]=qs[_0x288a('0x1d')](_0x537c14[_0x288a('0x31')][_0x288a('0x1d')]);}_0x5dfd48['order']=qs[_0x288a('0x3a')](_0x537c14[_0x288a('0x31')][_0x288a('0x3a')]);_0x5dfd48[_0x288a('0x3b')]=qs['filters'](_[_0x288a('0x3c')](_0x537c14[_0x288a('0x31')],_0x31c5ea[_0x288a('0x33')]),_0xbd2007);if(_0x537c14[_0x288a('0x31')][_0x288a('0x3d')]){_0x5dfd48[_0x288a('0x3b')]=_[_0x288a('0x3e')](_0x5dfd48[_0x288a('0x3b')],{'$or':_[_0x288a('0x2c')](_0xbd2007,function(_0x2615aa){if(_0x2615aa['type']!==_0x288a('0x3f')){var _0x32f831={};_0x32f831[_0x2615aa[_0x288a('0x2a')]]={'$like':'%'+_0x537c14['query'][_0x288a('0x3d')]+'%'};return _0x32f831;}})});}_0x5dfd48=_[_0x288a('0x3e')]({},_0x5dfd48,_0x537c14[_0x288a('0x40')]);var _0x2b52ec={'where':_0x5dfd48['where']};return db[_0x288a('0x41')][_0x288a('0x20')](_0x2b52ec)['then'](function(_0x442f3f){_0x5dd930['count']=_0x442f3f;if(_0x537c14[_0x288a('0x31')]['includeAll']){_0x5dfd48[_0x288a('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x288a('0x43')](_0x5dfd48);})[_0x288a('0x27')](function(_0x24015f){_0x5dd930['rows']=_0x24015f;return _0x5dd930;})[_0x288a('0x27')](respondWithFilteredResult(_0xe75bec,_0x5dfd48))[_0x288a('0x44')](handleError(_0xe75bec,null));};exports[_0x288a('0x45')]=function(_0x820684,_0x46ae7a){var _0x4d8ffc={'raw':!![],'where':{'id':_0x820684[_0x288a('0x46')]['id']}},_0x30c4d2={};_0x30c4d2[_0x288a('0x30')]=_[_0x288a('0x32')](db[_0x288a('0x41')][_0x288a('0x2d')]);_0x30c4d2[_0x288a('0x31')]=_['keys'](_0x820684['query']);_0x30c4d2['filters']=_[_0x288a('0x35')](_0x30c4d2['model'],_0x30c4d2[_0x288a('0x31')]);_0x4d8ffc[_0x288a('0x34')]=_[_0x288a('0x35')](_0x30c4d2['model'],qs[_0x288a('0x36')](_0x820684[_0x288a('0x31')]['fields']));_0x4d8ffc[_0x288a('0x34')]=_0x4d8ffc[_0x288a('0x34')][_0x288a('0x37')]?_0x4d8ffc['attributes']:_0x30c4d2[_0x288a('0x30')];if(_0x820684['query'][_0x288a('0x47')]){_0x4d8ffc[_0x288a('0x42')]=[{'all':!![]}];}_0x4d8ffc=_['merge']({},_0x4d8ffc,_0x820684[_0x288a('0x40')]);return db[_0x288a('0x41')][_0x288a('0x48')](_0x4d8ffc)[_0x288a('0x27')](handleEntityNotFound(_0x46ae7a,null))[_0x288a('0x27')](respondWithResult(_0x46ae7a,null))['catch'](handleError(_0x46ae7a,null));};exports[_0x288a('0x49')]=function(_0x247508,_0x7f48a7){return db['ChatTransferReport'][_0x288a('0x49')](_0x247508[_0x288a('0x4a')],{})[_0x288a('0x27')](respondWithResult(_0x7f48a7,0xc9))[_0x288a('0x44')](handleError(_0x7f48a7,null));};exports['update']=function(_0x2ed4f2,_0x36d00f){if(_0x2ed4f2[_0x288a('0x4a')]['id']){delete _0x2ed4f2['body']['id'];}return db[_0x288a('0x41')]['find']({'where':{'id':_0x2ed4f2[_0x288a('0x46')]['id']}})[_0x288a('0x27')](handleEntityNotFound(_0x36d00f,null))[_0x288a('0x27')](saveUpdates(_0x2ed4f2[_0x288a('0x4a')],null))['then'](respondWithResult(_0x36d00f,null))[_0x288a('0x44')](handleError(_0x36d00f,null));};exports['destroy']=function(_0x68cf92,_0x218f7c){return db[_0x288a('0x41')][_0x288a('0x48')]({'where':{'id':_0x68cf92[_0x288a('0x46')]['id']}})[_0x288a('0x27')](handleEntityNotFound(_0x218f7c,null))[_0x288a('0x27')](removeEntity(_0x218f7c,null))[_0x288a('0x44')](handleError(_0x218f7c,null));};exports[_0x288a('0x4b')]=function(_0x673190,_0x2faa67){return db[_0x288a('0x41')][_0x288a('0x4b')]()[_0x288a('0x27')](respondWithResult(_0x2faa67,null))[_0x288a('0x44')](handleError(_0x2faa67,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 61bef34..7cd5be0 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 _0xcb3d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','report_chat_transfer','uniqueid','util'];(function(_0x14a468,_0x63dcdf){var _0x4305c6=function(_0x5e1b0e){while(--_0x5e1b0e){_0x14a468['push'](_0x14a468['shift']());}};_0x4305c6(++_0x63dcdf);}(_0xcb3d,0x9f));var _0xdcb3=function(_0x55642e,_0x3f7ab6){_0x55642e=_0x55642e-0x0;var _0x3e5fc9=_0xcb3d[_0x55642e];return _0x3e5fc9;};'use strict';var _=require('lodash');var util=require(_0xdcb3('0x0'));var logger=require(_0xdcb3('0x1'))(_0xdcb3('0x2'));var moment=require('moment');var BPromise=require(_0xdcb3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcb3('0x4'));var rimraf=require(_0xdcb3('0x5'));var config=require(_0xdcb3('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xdcb3('0x7')]=function(_0x26e449,_0x52a5a7){return _0x26e449['define']('ChatTransferReport',attributes,{'tableName':_0xdcb3('0x8'),'paranoid':![],'indexes':[{'name':_0xdcb3('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe6e5=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x6a557,_0x3902d3){var _0x16b815=function(_0x3d8da2){while(--_0x3d8da2){_0x6a557['push'](_0x6a557['shift']());}};_0x16b815(++_0x3902d3);}(_0xe6e5,0xb7));var _0x5e6e=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xe6e5[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x5e6e('0x0'));var util=require(_0x5e6e('0x1'));var logger=require('../../config/logger')(_0x5e6e('0x2'));var moment=require(_0x5e6e('0x3'));var BPromise=require(_0x5e6e('0x4'));var rp=require(_0x5e6e('0x5'));var fs=require('fs');var path=require(_0x5e6e('0x6'));var rimraf=require(_0x5e6e('0x7'));var config=require(_0x5e6e('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x5e6e('0x9')]=function(_0x1ba775,_0x17d96d){return _0x1ba775[_0x5e6e('0xa')](_0x5e6e('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5e6e('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 d04c985..b37add0 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 _0xf51c=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1fe3c8,_0x2be277){var _0x5bdac=function(_0x24cdb0){while(--_0x24cdb0){_0x1fe3c8['push'](_0x1fe3c8['shift']());}};_0x5bdac(++_0x2be277);}(_0xf51c,0x1e8));var _0xcf51=function(_0x1e209e,_0x29d879){_0x1e209e=_0x1e209e-0x0;var _0x1a8e54=_0xf51c[_0x1e209e];return _0x1a8e54;};'use strict';var _=require(_0xcf51('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf51('0x1'));var rs=require(_0xcf51('0x2'));var fs=require('fs');var Redis=require(_0xcf51('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf51('0x4'));var logger=require(_0xcf51('0x5'))(_0xcf51('0x6'));var config=require(_0xcf51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf51('0x8')][_0xcf51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7b8439,_0x1e6f2e,_0x54b8b4){return new BPromise(function(_0x1fc514,_0x37949f){return client[_0xcf51('0xa')](_0x7b8439,_0x54b8b4)[_0xcf51('0xb')](function(_0x4be8f0){logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));logger['debug'](_0xcf51('0xf'),_0x1e6f2e,'request\x20sent',JSON['stringify'](_0x4be8f0));if(_0x4be8f0[_0xcf51('0x10')]){if(_0x4be8f0[_0xcf51('0x10')]['code']===0x1f4){logger[_0xcf51('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1e6f2e,_0x4be8f0['error'][_0xcf51('0x11')]);return _0x37949f(_0x4be8f0['error'][_0xcf51('0x11')]);}logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);return _0x1fc514(_0x4be8f0[_0xcf51('0x10')][_0xcf51('0x11')]);}else{logger[_0xcf51('0xc')](_0xcf51('0xd'),_0x1e6f2e,_0xcf51('0xe'));_0x1fc514(_0x4be8f0[_0xcf51('0x12')][_0xcf51('0x11')]);}})[_0xcf51('0x13')](function(_0x2823a3){logger[_0xcf51('0x10')](_0xcf51('0xd'),_0x1e6f2e,_0x2823a3);_0x37949f(_0x2823a3);});});} \ No newline at end of file +var _0x9908=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x9908,0x11f));var _0x8990=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0x9908[_0x51f632];return _0x24cf36;};'use strict';var _=require(_0x8990('0x0'));var util=require(_0x8990('0x1'));var moment=require(_0x8990('0x2'));var BPromise=require(_0x8990('0x3'));var rs=require(_0x8990('0x4'));var fs=require('fs');var Redis=require(_0x8990('0x5'));var db=require(_0x8990('0x6'))['db'];var utils=require(_0x8990('0x7'));var logger=require(_0x8990('0x8'))(_0x8990('0x9'));var config=require(_0x8990('0xa'));var jayson=require(_0x8990('0xb'));var client=jayson[_0x8990('0xc')][_0x8990('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2715fd,_0x1f947f,_0x25ec39){return new BPromise(function(_0x396a6b,_0x3593a9){return client[_0x8990('0xe')](_0x2715fd,_0x25ec39)[_0x8990('0xf')](function(_0x1d3201){logger[_0x8990('0x10')](_0x8990('0x11'),_0x1f947f,'request\x20sent');logger['debug'](_0x8990('0x12'),_0x1f947f,_0x8990('0x13'),JSON[_0x8990('0x14')](_0x1d3201));if(_0x1d3201[_0x8990('0x15')]){if(_0x1d3201['error']['code']===0x1f4){logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x1d3201['error']['message']);return _0x3593a9(_0x1d3201['error'][_0x8990('0x16')]);}logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x1d3201[_0x8990('0x15')][_0x8990('0x16')]);return _0x396a6b(_0x1d3201[_0x8990('0x15')][_0x8990('0x16')]);}else{logger[_0x8990('0x10')](_0x8990('0x11'),_0x1f947f,_0x8990('0x13'));_0x396a6b(_0x1d3201['result'][_0x8990('0x16')]);}})[_0x8990('0x17')](function(_0x23bbb9){logger[_0x8990('0x15')](_0x8990('0x11'),_0x1f947f,_0x23bbb9);_0x3593a9(_0x23bbb9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 4d9fb27..137facd 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 _0x5c72=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','destroy'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x5c72,0x156));var _0x25c7=function(_0x595f10,_0x9ac872){_0x595f10=_0x595f10-0x0;var _0x53770b=_0x5c72[_0x595f10];return _0x53770b;};'use strict';var multer=require(_0x25c7('0x0'));var util=require(_0x25c7('0x1'));var path=require(_0x25c7('0x2'));var timeout=require(_0x25c7('0x3'));var express=require(_0x25c7('0x4'));var router=express['Router']();var fs_extra=require(_0x25c7('0x5'));var auth=require(_0x25c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25c7('0x7'));router['get']('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0x9')]);router[_0x25c7('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x25c7('0xb')]);router[_0x25c7('0xa')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0xd')]);router[_0x25c7('0xe')]('/',auth[_0x25c7('0x8')](),controller[_0x25c7('0xf')]);router[_0x25c7('0x10')](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x11')]);router['delete'](_0x25c7('0xc'),auth[_0x25c7('0x8')](),controller[_0x25c7('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa34c=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x1cac19,_0x4c902d){var _0x147fe9=function(_0xd52416){while(--_0xd52416){_0x1cac19['push'](_0x1cac19['shift']());}};_0x147fe9(++_0x4c902d);}(_0xa34c,0x13a));var _0xca34=function(_0x5e9794,_0x106c22){_0x5e9794=_0x5e9794-0x0;var _0x4f4840=_0xa34c[_0x5e9794];return _0x4f4840;};'use strict';var multer=require(_0xca34('0x0'));var util=require(_0xca34('0x1'));var path=require(_0xca34('0x2'));var timeout=require(_0xca34('0x3'));var express=require('express');var router=express[_0xca34('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca34('0x5'));var interaction=require(_0xca34('0x6'));var config=require('../../config/environment');var controller=require(_0xca34('0x7'));router[_0xca34('0x8')]('/',auth[_0xca34('0x9')](),controller[_0xca34('0xa')]);router['get'](_0xca34('0xb'),auth['isAuthenticated'](),controller[_0xca34('0xc')]);router[_0xca34('0x8')](_0xca34('0xd'),auth[_0xca34('0x9')](),controller[_0xca34('0xe')]);router[_0xca34('0xf')]('/',auth['isAuthenticated'](),controller[_0xca34('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xca34('0x11')]);router[_0xca34('0x12')](_0xca34('0xd'),auth['isAuthenticated'](),controller[_0xca34('0x13')]);module[_0xca34('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 789452e..d3a0986 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 _0x3e40=['Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','TEXT','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x5b80ff,_0x38517e){var _0x3cb5f5=function(_0x5566dd){while(--_0x5566dd){_0x5b80ff['push'](_0x5b80ff['shift']());}};_0x3cb5f5(++_0x38517e);}(_0x3e40,0x131));var _0x03e4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x3e40[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x03e4('0x0'));var rs=require(_0x03e4('0x1'));module[_0x03e4('0x2')]={'name':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x03e4('0x3')]},'mapKey':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x4')},'key':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x03e4('0x3')]},'animation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x03e4('0x8')](_0x03e4('0x9'),'squared'),'defaultValue':_0x03e4('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xa')},'offline_chat_button':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'header_offline':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xc')},'download_transcript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x11')},'placeholderMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x12')},'closingMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x13')},'closingMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0xb')},'skipMessageButton':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x14')},'conditionAgreement':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x03e4('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x03e4('0x17'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x03e4('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x03e4('0x4'),'type':_0x03e4('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x03e4('0x19')]('onlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x1b'))):{};},'set':function(_0x218201){return this[_0x03e4('0x1c')](_0x03e4('0x1b'),JSON[_0x03e4('0x1d')](_0x218201));}},'offlineForm':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return JSON[_0x03e4('0x1d')]({'items':[{'type':_0x03e4('0x17'),'props':{'title':_0x03e4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x03e4('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x03e4('0x1e')},'props':{'title':_0x03e4('0x1e'),'helpText':_0x03e4('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x03e4('0x19')]('offlineForm')?JSON[_0x03e4('0x1a')](this[_0x03e4('0x19')](_0x03e4('0x20'))):{};},'set':function(_0x14f51c){return this[_0x03e4('0x1c')]('offlineForm',JSON['stringify'](_0x14f51c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x03e4('0x21')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x03e4('0x3')]},'forwardOffline':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x03e4('0x3')]},'waitingTitle':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x03e4('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x24')},'offlineMessageBody':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x26')},'skipUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x03e4('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x03e4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x03e4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x28')},'verticalAlignment':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x03e4('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x03e4('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':_0x03e4('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x03e4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':_0x03e4('0x2b')},'systemAvatar':{'type':Sequelize[_0x03e4('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03e4('0x6')],'comment':_0x03e4('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![],'comment':_0x03e4('0x2d'),'set':function(_0x576549){if(!_0x576549)this[_0x03e4('0x1c')](_0x03e4('0x2e'),null);this['setDataValue'](_0x03e4('0x2f'),_0x576549);}},'vidaooEscalation':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x03e4('0x3')]},'vidaooTopic':{'type':Sequelize[_0x03e4('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x03e4('0x3')],'defaultValue':function(){return _0x03e4('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x03e4('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x03e4('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8d93=['#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Send','Skip','Feedback','star','thumb','stringify','text','name','onlineForm','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x8d93,0x199));var _0x38d9=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x8d93[_0x1db481];return _0x3db95b;};'use strict';var Sequelize=require(_0x38d9('0x0'));var rs=require(_0x38d9('0x1'));module[_0x38d9('0x2')]={'name':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'unique':_0x38d9('0x4')},'description':{'type':Sequelize[_0x38d9('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x5')},'mapKeyOffline':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x5')},'key':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38d9('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':_0x38d9('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x38d9('0x3')]},'animation':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x38d9('0xb')](_0x38d9('0xc'),_0x38d9('0xd')),'defaultValue':_0x38d9('0xc')},'header_online':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0xe')},'start_chat_button':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x38d9('0x11')]},'closingQuestion':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x14')},'placeholderMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x15')},'closingMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x16')},'skipMessageButton':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x18')},'ratingType':{'type':Sequelize[_0x38d9('0xb')](_0x38d9('0x19'),_0x38d9('0x1a')),'defaultValue':_0x38d9('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':function(){return JSON[_0x38d9('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0x38d9('0x1c'),'required':!![]},'props':{'title':_0x38d9('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x38d9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x38d9('0x5'),'type':_0x38d9('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x38d9('0x1e'))?JSON['parse'](this[_0x38d9('0x1f')](_0x38d9('0x1e'))):{};},'set':function(_0x47148c){return this[_0x38d9('0x20')](_0x38d9('0x1e'),JSON['stringify'](_0x47148c));}},'offlineForm':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':function(){return JSON[_0x38d9('0x1b')]({'items':[{'type':'input','props':{'title':_0x38d9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x38d9('0x5'),'type':_0x38d9('0x5')},'variable':null},{'type':_0x38d9('0x21'),'config':{'placeholder':_0x38d9('0x22')},'props':{'title':'Comments','helpText':_0x38d9('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x38d9('0x24'))?JSON[_0x38d9('0x25')](this[_0x38d9('0x1f')](_0x38d9('0x24'))):{};},'set':function(_0x4b87c5){return this['setDataValue'](_0x38d9('0x24'),JSON[_0x38d9('0x1b')](_0x4b87c5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x38d9('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x38d9('0x27')},'waitingMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x17')},'sendUnmanaged':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x38d9('0x2b');}},'notificationSound':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2d')},'verticalAlignment':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':_0x38d9('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x38d9('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x38d9('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x38d9('0x3')],'allowNull':![],'defaultValue':_0x38d9('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x38d9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38d9('0x9')],'comment':_0x38d9('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x38d9('0xa')],'defaultValue':![],'comment':_0x38d9('0x31'),'set':function(_0x2c038a){if(!_0x2c038a)this[_0x38d9('0x20')]('mandatoryDispositionPauseId',null);this[_0x38d9('0x20')]('mandatoryDisposition',_0x2c038a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x38d9('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38d9('0x32')},'vidaooNote':{'type':Sequelize[_0x38d9('0x3')],'defaultValue':function(){return _0x38d9('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x38d9('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x38d9('0xa')],'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 3ee4a82..69febc3 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 _0x72c8=['timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','model','type','vendor','index','Pause','mandatoryDispositionPause','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','show','keys','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','custom','existsSync','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/','download','getSystemAvatar','systemAvatar','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','spread','priority','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','AttachmentId','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','email','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','Tag','color','tag','getSnippet','../../config/license/util','License','server/files/chat/iframe.ejs','utf8','URL','address','origin','3.5.0','remote','x-real-ip','connection','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','end','sendStatus','name','send','Command','format','iftime\x20%s,%s'];(function(_0x5e7644,_0x560054){var _0x3cd663=function(_0x44687f){while(--_0x44687f){_0x5e7644['push'](_0x5e7644['shift']());}};_0x3cd663(++_0x560054);}(_0x72c8,0xf9));var _0x872c=function(_0x3e2849,_0x8d6597){_0x3e2849=_0x3e2849-0x0;var _0x392ef7=_0x72c8[_0x3e2849];return _0x392ef7;};'use strict';var Mustache=require('mustache');var util=require(_0x872c('0x0'));var path=require(_0x872c('0x1'));var ejs=require(_0x872c('0x2'));var fs=require('fs');var fs_extra=require(_0x872c('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require(_0x872c('0x4'));var Redis=require(_0x872c('0x5'));var jayson=require(_0x872c('0x6'));var url=require('url');var qs=require(_0x872c('0x7'));var logger=require(_0x872c('0x8'))('api');var config=require(_0x872c('0x9'));var APIOutOfIntervalError=require(_0x872c('0xa'))[_0x872c('0xb')];var APINotFoundError=require(_0x872c('0xa'))['APINotFoundError'];var APIHandleError=require(_0x872c('0xa'))[_0x872c('0xc')];var db=require(_0x872c('0xd'))['db'];config[_0x872c('0xe')]=_[_0x872c('0xf')](config['redis'],{'host':_0x872c('0x10'),'port':0x18eb});var socket=require(_0x872c('0x11'))(new Redis(config[_0x872c('0xe')]));require(_0x872c('0x12'))[_0x872c('0x13')](socket);var client=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x232c});var client9002=jayson['client'][_0x872c('0x15')]({'port':0x232a});var client9003=jayson[_0x872c('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x872c('0x14')][_0x872c('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x23d0f4,_0x5d6759,_0x27baf9,_0x437a26){return new Promise(function(_0x1a39f8,_0x251277){var _0x4e161c=_0x437a26||client;return _0x4e161c['request'](_0x23d0f4,_0x27baf9)[_0x872c('0x16')](function(_0x7b0f3f){logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,_0x872c('0x19'));logger[_0x872c('0x1a')](_0x872c('0x1b'),_0x5d6759,'request\x20sent',JSON[_0x872c('0x1c')](_0x7b0f3f));if(_0x7b0f3f['error']){if(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1e')]===0x1f4){logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f['error'][_0x872c('0x1f')]);return _0x251277(_0x7b0f3f[_0x872c('0x1d')][_0x872c('0x1f')]);}logger[_0x872c('0x1d')](_0x872c('0x18'),_0x5d6759,_0x7b0f3f[_0x872c('0x1d')]['message']);return _0x1a39f8(_0x7b0f3f[_0x872c('0x1d')]['message']);}else{logger[_0x872c('0x17')](_0x872c('0x18'),_0x5d6759,'request\x20sent');_0x1a39f8(_0x7b0f3f['result']['message']);}})[_0x872c('0x20')](function(_0x4e8aaf){logger[_0x872c('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x5d6759,_0x4e8aaf);_0x251277(_0x4e8aaf);});});}function respondWithStatusCode(_0x3b1855,_0x315768){_0x315768=_0x315768||0xcc;return function(_0x540811){if(_0x540811){return _0x3b1855['sendStatus'](_0x315768);}return _0x3b1855[_0x872c('0x21')](_0x315768)['end']();};}function respondWithResult(_0x3afb7f,_0x2bc0e2){_0x2bc0e2=_0x2bc0e2||0xc8;return function(_0x15f1b0){if(_0x15f1b0){return _0x3afb7f['status'](_0x2bc0e2)[_0x872c('0x22')](_0x15f1b0);}};}function respondWithFilteredResult(_0x1651b9,_0x1290bc){return function(_0x300538){if(_0x300538){var _0x1db7ee=typeof _0x1290bc[_0x872c('0x23')]===_0x872c('0x24')&&typeof _0x1290bc[_0x872c('0x25')]==='undefined';var _0x483217=_0x300538[_0x872c('0x26')];var _0x194a16=_0x1db7ee?0x0:_0x1290bc[_0x872c('0x23')];var _0x5e088e=_0x1db7ee?_0x300538[_0x872c('0x26')]:_0x1290bc['offset']+_0x1290bc[_0x872c('0x25')];var _0xc5b701;if(_0x5e088e>=_0x483217){_0x5e088e=_0x483217;_0xc5b701=0xc8;}else{_0xc5b701=0xce;}_0x1651b9[_0x872c('0x21')](_0xc5b701);return _0x1651b9[_0x872c('0x27')]('Content-Range',_0x194a16+'-'+_0x5e088e+'/'+_0x483217)['json'](_0x300538);}return null;};}function saveUpdates(_0x2589b0){return function(_0x4223bb){if(_0x4223bb){return _0x4223bb[_0x872c('0x28')](_0x2589b0)[_0x872c('0x16')](function(_0x5ef16c){return _0x5ef16c;});}return null;};}function removeEntity(_0x55d9b0){return function(_0x1b3876){if(_0x1b3876){return _0x1b3876[_0x872c('0x29')]()['then'](function(){var _0x225673=_0x1b3876[_0x872c('0x2a')]({'plain':!![]});var _0x59a3af='ChatWebsites';return db[_0x872c('0x2b')][_0x872c('0x29')]({'where':{'type':_0x59a3af,'resourceId':_0x225673['id']}})[_0x872c('0x16')](function(){return _0x1b3876;});})[_0x872c('0x16')](function(){_0x55d9b0['status'](0xcc)[_0x872c('0x2c')]();});}};}function handleEntityNotFound(_0x4d828c){return function(_0x25bca8){if(!_0x25bca8){_0x4d828c[_0x872c('0x2d')](0x194);}return _0x25bca8;};}function handleError(_0x33cb11,_0x4dd56d){_0x4dd56d=_0x4dd56d||0x1f4;return function(_0x5a75b6){logger[_0x872c('0x1d')](_0x5a75b6['stack']);if(_0x5a75b6[_0x872c('0x2e')]){delete _0x5a75b6[_0x872c('0x2e')];}_0x33cb11[_0x872c('0x21')](_0x4dd56d)[_0x872c('0x2f')](_0x5a75b6);};}function iftimePromise(_0x462488,_0x49e929){return respondWithRpcPromise(_0x872c('0x30'),'getSnippet',{'command':_0x49e929['timezone']?util[_0x872c('0x31')](_0x872c('0x32'),_0x462488['interval'],_0x49e929[_0x872c('0x33')]):util[_0x872c('0x31')](_0x872c('0x34'),_0x462488['interval'])},client9002)['then'](function(_0x46fa00){var _0x277e0d=_0x46fa00&&_0x46fa00[_0x872c('0x35')]('true')>=0x0?!![]:![];logger[_0x872c('0x17')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],_0x277e0d?_0x872c('0x38'):_0x872c('0x39'),_0x49e929[_0x872c('0x33')]?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return _0x277e0d;})[_0x872c('0x20')](function(_0x319346){logger[_0x872c('0x1d')](_0x872c('0x36'),_0x49e929['id'],_0x462488['id'],_0x462488[_0x872c('0x37')],util['inspect'](_0x319346,{'showHidden':![],'depth':null}),_0x49e929['timezone']?_0x49e929[_0x872c('0x33')]:_0x872c('0x3a'));return![];});}function checkWebsiteIntervals(_0x56ad93){var _0xb0c839=_[_0x872c('0x3b')](_0x56ad93[_0x872c('0x3c')][_0x872c('0x3d')],function(_0x9b847b){var _0x43c684=_0x9b847b[_0x872c('0x2a')]({'plain':!![]});return iftimePromise(_0x43c684,_0x56ad93);});return Promise[_0x872c('0x3e')](_0xb0c839)[_0x872c('0x16')](function(_0x149252){return _[_0x872c('0x3f')](_0x149252);});}function createInteractionObject(_0x466845,_0x37bf1f,_0x12a1aa,_0x63fc4a){var _0x117b15=require(_0x872c('0x40'));var _0x337b42=new _0x117b15();var _0x2ec63b=_0x337b42['setUA'](_0x12a1aa['user-agent'])[_0x872c('0x41')]();var _0x3cba9e=_0x37bf1f[_0x872c('0x42')];if(_0x12a1aa[_0x872c('0x43')]){_0x3cba9e=_0x12a1aa[_0x872c('0x43')];}else if(_0x12a1aa[_0x872c('0x44')]){_0x3cba9e=_[_0x872c('0x45')](_0x12a1aa[_0x872c('0x44')][_0x872c('0x46')](','));}return{'ContactId':_0x63fc4a['id'],'ChatWebsiteId':_0x466845,'from':(_0x63fc4a[_0x872c('0x47')]||'')+'\x20'+(_0x63fc4a[_0x872c('0x48')]||''),'customerIp':_0x3cba9e,'customerPort':_0x12a1aa[_0x872c('0x49')]?_0x12a1aa[_0x872c('0x49')]:null,'referer':_0x37bf1f[_0x872c('0x4a')],'browserName':_0x2ec63b['browser'][_0x872c('0x2e')]&&_0x2ec63b[_0x872c('0x4b')][_0x872c('0x4c')]?util[_0x872c('0x31')]('%s\x20%s',_0x2ec63b[_0x872c('0x4b')][_0x872c('0x2e')],_0x2ec63b['browser'][_0x872c('0x4c')]):_0x872c('0x4d'),'browserVersion':_0x2ec63b[_0x872c('0x4b')]['version']||_0x872c('0x4d'),'osName':util[_0x872c('0x31')](_0x872c('0x4e'),_0x2ec63b['os'][_0x872c('0x2e')],_0x2ec63b['os'][_0x872c('0x4c')]),'osVersion':_0x2ec63b['os'][_0x872c('0x4c')],'deviceModel':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')]&&_0x2ec63b[_0x872c('0x4f')]['vendor']?util['format']('%s\x20%s\x20%s',_0x2ec63b[_0x872c('0x4f')][_0x872c('0x50')],_0x2ec63b[_0x872c('0x4f')]['vendor'],_0x2ec63b[_0x872c('0x4f')][_0x872c('0x51')]):null,'deviceVendor':_0x2ec63b[_0x872c('0x4f')][_0x872c('0x52')],'deviceType':_0x2ec63b[_0x872c('0x4f')]['type'],'formData':JSON[_0x872c('0x1c')](_0x37bf1f)};}exports[_0x872c('0x53')]=function(_0x361539,_0x27fa07){var _0x4a180b={'include':[{'model':db[_0x872c('0x54')],'as':_0x872c('0x55')}]},_0x505519={},_0x5d3c38={'count':0x0,'rows':[]};var _0x4f162e=_[_0x872c('0x3b')](db['ChatWebsite'][_0x872c('0x56')],function(_0x22a3a8){return{'name':_0x22a3a8['fieldName'],'type':_0x22a3a8[_0x872c('0x51')][_0x872c('0x57')]};});_0x505519[_0x872c('0x50')]=_['map'](_0x4f162e,_0x872c('0x2e'));_0x505519[_0x872c('0x58')]=_['keys'](_0x361539[_0x872c('0x58')]);_0x505519[_0x872c('0x59')]=_['intersection'](_0x505519['model'],_0x505519['query']);_0x4a180b[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x505519[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x361539[_0x872c('0x58')][_0x872c('0x5c')]));_0x4a180b['attributes']=_0x4a180b[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4a180b['attributes']:_0x505519[_0x872c('0x50')];if(!_0x361539[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4a180b['limit']=qs[_0x872c('0x25')](_0x361539[_0x872c('0x58')][_0x872c('0x25')]);_0x4a180b[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x361539['query'][_0x872c('0x23')]);}_0x4a180b['order']=qs[_0x872c('0x60')](_0x361539[_0x872c('0x58')][_0x872c('0x60')]);_0x4a180b['where']=qs[_0x872c('0x59')](_['pick'](_0x361539[_0x872c('0x58')],_0x505519[_0x872c('0x59')]),_0x4f162e);if(_0x361539[_0x872c('0x58')][_0x872c('0x61')]){_0x4a180b[_0x872c('0x62')]=_['merge'](_0x4a180b[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x4f162e,function(_0x3025aa){if(_0x3025aa[_0x872c('0x51')]!==_0x872c('0x63')){var _0x10c0d9={};_0x10c0d9[_0x3025aa['name']]={'$like':'%'+_0x361539[_0x872c('0x58')]['filter']+'%'};return _0x10c0d9;}})});}_0x4a180b=_['merge']({},_0x4a180b,_0x361539['options']);var _0x3fe0d5={'where':_0x4a180b[_0x872c('0x62')]};return db[_0x872c('0x64')][_0x872c('0x26')](_0x3fe0d5)[_0x872c('0x16')](function(_0x557787){_0x5d3c38['count']=_0x557787;if(_0x361539['query'][_0x872c('0x65')]){_0x4a180b[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x64')][_0x872c('0x67')](_0x4a180b);})[_0x872c('0x16')](function(_0x4ad721){_0x5d3c38[_0x872c('0x68')]=_0x4ad721;return _0x5d3c38;})[_0x872c('0x16')](respondWithFilteredResult(_0x27fa07,_0x4a180b))[_0x872c('0x20')](handleError(_0x27fa07,null));};exports[_0x872c('0x69')]=function(_0x1ccc1b,_0xb82f4){var _0x1d1125={'raw':![],'where':{'id':_0x1ccc1b['params']['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]},_0xdb7266={};_0xdb7266[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatWebsite'][_0x872c('0x56')]);_0xdb7266[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x1ccc1b[_0x872c('0x58')]);_0xdb7266[_0x872c('0x59')]=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],_0xdb7266[_0x872c('0x58')]);_0x1d1125['attributes']=_[_0x872c('0x5b')](_0xdb7266[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1ccc1b[_0x872c('0x58')]['fields']));_0x1d1125[_0x872c('0x5a')]=_0x1d1125[_0x872c('0x5a')][_0x872c('0x5d')]?_0x1d1125['attributes']:_0xdb7266[_0x872c('0x50')];if(_0x1ccc1b[_0x872c('0x58')][_0x872c('0x65')]){_0x1d1125['include']=[{'all':!![]}];}_0x1d1125=_[_0x872c('0x6b')]({},_0x1d1125,_0x1ccc1b[_0x872c('0x6c')]);return db['ChatWebsite']['find'](_0x1d1125)[_0x872c('0x16')](handleEntityNotFound(_0xb82f4,null))[_0x872c('0x16')](respondWithResult(_0xb82f4,null))['catch'](handleError(_0xb82f4,null));};exports[_0x872c('0x6d')]=function(_0x36412e,_0x31a52f){return db['ChatWebsite'][_0x872c('0x6d')](_0x36412e[_0x872c('0x6e')],{})[_0x872c('0x16')](function(_0x36a1e8){var _0x341c88=_0x36412e[_0x872c('0x6f')][_0x872c('0x2a')]({'plain':!![]});if(!_0x341c88)throw new Error(_0x872c('0x70'));if(_0x341c88[_0x872c('0x71')]==='user'){var _0xc92436=_0x36a1e8[_0x872c('0x2a')]({'plain':!![]});var _0x4c9aca=_0x872c('0x72');return db['UserProfileSection'][_0x872c('0x73')]({'where':{'name':_0x4c9aca,'userProfileId':_0x341c88['userProfileId']},'raw':!![]})['then'](function(_0x202195){if(_0x202195&&_0x202195[_0x872c('0x74')]===0x0){return db[_0x872c('0x2b')][_0x872c('0x6d')]({'name':_0xc92436[_0x872c('0x2e')],'resourceId':_0xc92436['id'],'type':_0x202195[_0x872c('0x2e')],'sectionId':_0x202195['id']},{})[_0x872c('0x16')](function(){return _0x36a1e8;});}else{return _0x36a1e8;}})[_0x872c('0x20')](function(_0x64460d){logger[_0x872c('0x1d')](_0x872c('0x75'),_0x64460d);throw _0x64460d;});}return _0x36a1e8;})['then'](respondWithResult(_0x31a52f,0xc9))[_0x872c('0x20')](handleError(_0x31a52f,null));};exports[_0x872c('0x28')]=function(_0x1652d7,_0x49e90a){if(_0x1652d7['body']['id']){delete _0x1652d7['body']['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x1652d7[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x54')],'as':'mandatoryDispositionPause'}]})[_0x872c('0x16')](handleEntityNotFound(_0x49e90a,null))[_0x872c('0x16')](saveUpdates(_0x1652d7[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x49e90a,null))[_0x872c('0x20')](handleError(_0x49e90a,null));};exports[_0x872c('0x29')]=function(_0x41106b,_0x57d018){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x41106b[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x57d018,null))[_0x872c('0x16')](removeEntity(_0x57d018,null))[_0x872c('0x20')](handleError(_0x57d018,null));};exports['describe']=function(_0x4da7f9,_0x3d13a4){return db['ChatWebsite'][_0x872c('0x77')]()[_0x872c('0x16')](respondWithResult(_0x3d13a4,null))[_0x872c('0x20')](handleError(_0x3d13a4,null));};exports['addDisposition']=function(_0x25f969,_0x94f246){if(_0x25f969[_0x872c('0x6e')]['id']){delete _0x25f969[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x25f969[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x94f246,null))['then'](function(_0x56dc02){if(_0x56dc02){_0x25f969[_0x872c('0x6e')][_0x872c('0x78')]=_0x56dc02['id'];return db[_0x872c('0x79')]['create'](_0x25f969[_0x872c('0x6e')]);}})[_0x872c('0x16')](respondWithResult(_0x94f246,null))['catch'](handleError(_0x94f246,null));};exports[_0x872c('0x7a')]=function(_0x474849,_0x3d592c){var _0x1760f3={'raw':![],'where':{}};var _0x295ed3={};var _0x421c74={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x872c('0x7b')]({'where':{'id':_0x474849[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x3d592c,null))['then'](function(_0x74d79b){if(_0x74d79b){_0x295ed3[_0x872c('0x50')]=_[_0x872c('0x6a')](db['Disposition'][_0x872c('0x56')]);_0x295ed3['query']=_[_0x872c('0x6a')](_0x474849[_0x872c('0x58')]);_0x295ed3[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],_0x295ed3[_0x872c('0x58')]);_0x1760f3[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x295ed3[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x474849[_0x872c('0x58')][_0x872c('0x5c')]));_0x1760f3[_0x872c('0x5a')]=_0x1760f3['attributes'][_0x872c('0x5d')]?_0x1760f3[_0x872c('0x5a')]:_0x295ed3['model'];if(!_0x474849[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x1760f3[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x474849[_0x872c('0x58')]['limit']);_0x1760f3[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x474849['query']['offset']);}_0x1760f3['order']=qs[_0x872c('0x60')](_0x474849[_0x872c('0x58')][_0x872c('0x60')]);_0x1760f3['where']=qs['filters'](_[_0x872c('0x7c')](_0x474849[_0x872c('0x58')],_0x295ed3[_0x872c('0x59')]));_0x1760f3[_0x872c('0x62')][_0x872c('0x78')]=_0x74d79b['id'];if(_0x474849['query'][_0x872c('0x61')]){_0x1760f3['where']=_[_0x872c('0x6b')](_0x1760f3['where'],{'$or':_['map'](_0x1760f3[_0x872c('0x5a')],function(_0x95941e){var _0x187cfe={};_0x187cfe[_0x95941e]={'$like':'%'+_0x474849[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x187cfe;})});}_0x1760f3=_[_0x872c('0x6b')]({},_0x1760f3,_0x474849[_0x872c('0x6c')]);return db[_0x872c('0x79')][_0x872c('0x26')]({'where':_0x1760f3[_0x872c('0x62')]})['then'](function(_0x52bf7f){_0x421c74['count']=_0x52bf7f;if(_0x474849['query'][_0x872c('0x65')]){_0x1760f3['include']=[{'all':!![]}];}return db[_0x872c('0x79')][_0x872c('0x67')](_0x1760f3);})['then'](function(_0x7db5f5){_0x421c74[_0x872c('0x68')]=_0x7db5f5;return _0x421c74;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x3d592c,_0x1760f3))[_0x872c('0x20')](handleError(_0x3d592c,null));};exports[_0x872c('0x7d')]=function(_0xe40925,_0x433772){return db[_0x872c('0x64')]['find']({'where':{'id':_0xe40925[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x433772,null))[_0x872c('0x16')](function(_0x362554){if(_0x362554){return _0x362554['removeDispositions'](_0xe40925['query'][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x433772,null))['catch'](handleError(_0x433772,null));};exports[_0x872c('0x7f')]=function(_0x3dc64f,_0xb6c2af){if(_0x3dc64f[_0x872c('0x6e')]['id']){delete _0x3dc64f[_0x872c('0x6e')]['id'];}return db[_0x872c('0x64')]['find']({'where':{'id':_0x3dc64f[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0xb6c2af,null))['then'](function(_0x4e9dca){if(_0x4e9dca){_0x3dc64f['body'][_0x872c('0x78')]=_0x4e9dca['id'];return db['CannedAnswer']['create'](_0x3dc64f['body']);}})['then'](respondWithResult(_0xb6c2af,null))[_0x872c('0x20')](handleError(_0xb6c2af,null));};exports[_0x872c('0x80')]=function(_0x61d42d,_0x4a1c8b){var _0x1fc281={'raw':![],'where':{}};var _0x1f26b8={};var _0x409ab3={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x61d42d[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x4a1c8b,null))[_0x872c('0x16')](function(_0x340006){if(_0x340006){_0x1f26b8[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x81')][_0x872c('0x56')]);_0x1f26b8[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x61d42d['query']);_0x1f26b8['filters']=_[_0x872c('0x5b')](_0x1f26b8['model'],_0x1f26b8[_0x872c('0x58')]);_0x1fc281[_0x872c('0x5a')]=_[_0x872c('0x5b')](_0x1f26b8[_0x872c('0x50')],qs['fields'](_0x61d42d['query'][_0x872c('0x5c')]));_0x1fc281['attributes']=_0x1fc281[_0x872c('0x5a')]['length']?_0x1fc281[_0x872c('0x5a')]:_0x1f26b8['model'];if(!_0x61d42d[_0x872c('0x58')]['hasOwnProperty'](_0x872c('0x5f'))){_0x1fc281[_0x872c('0x25')]=qs['limit'](_0x61d42d[_0x872c('0x58')]['limit']);_0x1fc281[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x61d42d['query'][_0x872c('0x23')]);}_0x1fc281[_0x872c('0x82')]=qs['sort'](_0x61d42d[_0x872c('0x58')][_0x872c('0x60')]);_0x1fc281[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x61d42d['query'],_0x1f26b8['filters']));_0x1fc281['where']['ChatWebsiteId']=_0x340006['id'];if(_0x61d42d[_0x872c('0x58')][_0x872c('0x61')]){_0x1fc281['where']=_['merge'](_0x1fc281[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1fc281['attributes'],function(_0x2df526){var _0x2b7f70={};_0x2b7f70[_0x2df526]={'$like':'%'+_0x61d42d[_0x872c('0x58')]['filter']+'%'};return _0x2b7f70;})});}_0x1fc281=_['merge']({},_0x1fc281,_0x61d42d[_0x872c('0x6c')]);return db[_0x872c('0x81')][_0x872c('0x26')]({'where':_0x1fc281[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x443e9a){_0x409ab3[_0x872c('0x26')]=_0x443e9a;if(_0x61d42d[_0x872c('0x58')][_0x872c('0x65')]){_0x1fc281[_0x872c('0x66')]=[{'all':!![]}];}return db[_0x872c('0x81')][_0x872c('0x67')](_0x1fc281);})[_0x872c('0x16')](function(_0xfb5aad){_0x409ab3[_0x872c('0x68')]=_0xfb5aad;return _0x409ab3;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x4a1c8b,_0x1fc281))[_0x872c('0x20')](handleError(_0x4a1c8b,null));};exports[_0x872c('0x83')]=function(_0x2156bd,_0x26696d){return db[_0x872c('0x64')]['find']({'where':{'id':_0x2156bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x26696d,null))[_0x872c('0x16')](function(_0x38e7d6){if(_0x38e7d6){return _0x38e7d6[_0x872c('0x83')](_0x2156bd[_0x872c('0x58')][_0x872c('0x7e')]);}})[_0x872c('0x16')](respondWithStatusCode(_0x26696d,null))['catch'](handleError(_0x26696d,null));};exports[_0x872c('0x84')]=function(_0xe2fe12,_0x230c4f){_0xe2fe12[_0x872c('0x6e')]['sitepic']=_0xe2fe12['file'][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xe2fe12[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x230c4f,null))[_0x872c('0x16')](saveUpdates(_0xe2fe12[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x230c4f,null))[_0x872c('0x20')](handleError(_0x230c4f,null));};exports[_0x872c('0x86')]=function(_0xd04d90,_0x144d63){_0xd04d90[_0x872c('0x6e')][_0x872c('0x87')]=_0xd04d90[_0x872c('0x88')][_0x872c('0x85')];return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0xd04d90[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x144d63,null))[_0x872c('0x16')](saveUpdates(_0xd04d90[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x144d63,null))[_0x872c('0x20')](handleError(_0x144d63,null));};exports[_0x872c('0x89')]=function(_0x2503ad,_0x32c603){_0x2503ad[_0x872c('0x6e')]['customerAvatar']=_0x2503ad[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite']['find']({'where':{'id':_0x2503ad[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x32c603,null))[_0x872c('0x16')](saveUpdates(_0x2503ad['body'],null))[_0x872c('0x16')](respondWithResult(_0x32c603,null))[_0x872c('0x20')](handleError(_0x32c603,null));};exports[_0x872c('0x8a')]=function(_0x48f97a,_0x5e0c3e){_0x48f97a[_0x872c('0x6e')]['systemAvatar']=_0x48f97a[_0x872c('0x88')][_0x872c('0x85')];return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x48f97a[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5e0c3e,null))[_0x872c('0x16')](saveUpdates(_0x48f97a[_0x872c('0x6e')],null))[_0x872c('0x16')](respondWithResult(_0x5e0c3e,null))['catch'](handleError(_0x5e0c3e,null));};exports[_0x872c('0x8b')]=function(_0x21da88,_0x333639){var _0x5b08cc=path['join'](config[_0x872c('0x8c')],_0x872c('0x8d'));var _0x406639={'where':{'id':_0x21da88[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x8e')],'raw':!![]};var _0x283a08=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x18b9bd){if(_0x18b9bd){_0x283a08=_0x18b9bd[_0x872c('0x8f')];}})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')](_0x406639);})[_0x872c('0x16')](handleEntityNotFound(_0x333639,null))[_0x872c('0x16')](function(_0x78a629){if(_0x78a629){if(!_['isNil'](_0x78a629[_0x872c('0x8e')])){if(fs[_0x872c('0x90')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]))&&_0x283a08){_0x5b08cc=path[_0x872c('0x91')](config['root'],_0x872c('0x92'),_0x78a629[_0x872c('0x8e')]);}}return _0x333639['download'](_0x5b08cc);}})[_0x872c('0x20')](handleError(_0x333639,null));};exports[_0x872c('0x93')]=function(_0xeae151,_0x4b168d){var _0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x94'));var _0x2d28ed={'where':{'id':_0xeae151[_0x872c('0x76')]['id']},'attributes':['id',_0x872c('0x87')],'raw':!![]};return db[_0x872c('0x64')][_0x872c('0x73')](_0x2d28ed)['then'](handleEntityNotFound(_0x4b168d,null))[_0x872c('0x16')](function(_0x316e8f){if(_0x316e8f){if(!_[_0x872c('0x95')](_0x316e8f[_0x872c('0x87')])){if(fs[_0x872c('0x90')](path['join'](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]))){_0x350f96=path[_0x872c('0x91')](config[_0x872c('0x8c')],'server/files/images/avatars/',_0x316e8f[_0x872c('0x87')]);}}return _0x4b168d['download'](_0x350f96);}})[_0x872c('0x20')](handleError(_0x4b168d,null));};exports['getCustomerAvatar']=function(_0x4e5d10,_0x2e2c0b){var _0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x96'));var _0x402c58={'where':{'id':_0x4e5d10[_0x872c('0x76')]['id']},'attributes':['id','customerAvatar',_0x872c('0x97')],'raw':!![]};return db['ChatWebsite']['find'](_0x402c58)[_0x872c('0x16')](handleEntityNotFound(_0x2e2c0b,null))[_0x872c('0x16')](function(_0x52f967){if(_0x52f967){if(!_[_0x872c('0x95')](_0x52f967[_0x872c('0x98')])){if(fs['existsSync'](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0x99'),_0x52f967['customerAvatar']))&&_0x52f967['showCustomerAvatar']){_0x44125a=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x52f967[_0x872c('0x98')]);}}return _0x2e2c0b[_0x872c('0x9a')](_0x44125a);}})[_0x872c('0x20')](handleError(_0x2e2c0b,null));};exports[_0x872c('0x9b')]=function(_0xd8c4e9,_0x291a82){var _0x2a735f=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4cb52c={'where':{'id':_0xd8c4e9['params']['id']},'attributes':['id',_0x872c('0x9c')],'raw':!![]};return db['ChatWebsite']['find'](_0x4cb52c)[_0x872c('0x16')](handleEntityNotFound(_0x291a82,null))[_0x872c('0x16')](function(_0x2242b7){if(_0x2242b7){if(!_['isNil'](_0x2242b7[_0x872c('0x9c')])){if(fs['existsSync'](path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7[_0x872c('0x9c')]))){_0x2a735f=path[_0x872c('0x91')](config['root'],_0x872c('0x99'),_0x2242b7['systemAvatar']);}}return _0x291a82[_0x872c('0x9a')](_0x2a735f);}})[_0x872c('0x20')](handleError(_0x291a82,null));};exports[_0x872c('0x9d')]=function(_0x3137b5,_0x2344be){var _0x2c39bb={'body':_0x3137b5[_0x872c('0x6e')],'channel':_0x872c('0x9e')};var _0x210c08=[];var _0x4bf733=[];var _0xa5556e={};var _0x425f1c=![];return db[_0x872c('0x9f')]['describe']()['then'](function(_0x49e5e8){if(!_0x49e5e8){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa1'));}_0x210c08=_['difference'](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),'updatedAt']);_0x4bf733=_[_0x872c('0xa3')](_[_0x872c('0x6a')](_0x49e5e8),[_0x872c('0xa2'),_0x872c('0xa4'),'CompanyId',_0x872c('0xa5')]);if(_0x3137b5[_0x872c('0x6e')]['id']){delete _0x3137b5['body']['id'];}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')])){throw new db[(_0x872c('0xa0'))]['ValidationError'](_0x872c('0xa7'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')]['body'])||_0x3137b5[_0x872c('0x6e')]['body']===''){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa9'));}if(_[_0x872c('0x95')](_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db['Sequelize'][(_0x872c('0xa8'))](_0x872c('0xab')+_0x4bf733);}if(!_['includes'](_0x4bf733,_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')])){throw new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xac')+_0x4bf733);}_0xa5556e[_0x3137b5['body'][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];})[_0x872c('0x16')](function(){return db[_0x872c('0x64')][_0x872c('0x73')]({'where':{'id':_0x3137b5[_0x872c('0x76')]['id']},'include':[{'model':db['CmList'],'as':_0x872c('0xad'),'include':[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xae'),'where':_0xa5556e,'limit':0x1,'order':[['updatedAt',_0x872c('0xaf')]]}]},{'model':db[_0x872c('0xb0')],'as':_0x872c('0xb1')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x872c('0x16')](function(_0x65d1a5){if(!_0x65d1a5)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x3137b5['params']['id']));if(!_0x65d1a5['Interval']||!_0x65d1a5[_0x872c('0x3c')]['Intervals'])return[_0x65d1a5,!![]];return[_0x65d1a5,checkWebsiteIntervals(_0x65d1a5)];})[_0x872c('0xb2')](function(_0x2892d7,_0x1281bc){if(!_0x1281bc)throw new APIOutOfIntervalError();if(!_0x2892d7['List'])return;_0x2c39bb['account']=_0x2892d7;_0x2c39bb['list']=_0x2892d7[_0x872c('0xad')];_0x2c39bb['applications']=_['orderBy'](_0x2892d7[_0x872c('0xb1')],[_0x872c('0xb3')],['asc']);if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')]){delete _0x2c39bb[_0x872c('0xb4')][_0x872c('0xb1')];}if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')]&&_0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][_0x872c('0x5d')]){return _0x2c39bb[_0x872c('0xb4')][_0x872c('0xad')][_0x872c('0xae')][0x0];}var _0x10b0e4=_[_0x872c('0xf')](_0x3137b5[_0x872c('0x6e')],{'firstName':_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x2892d7[_0x872c('0xa5')]});_0x10b0e4[_0x3137b5[_0x872c('0x6e')][_0x872c('0xaa')]]=_0x3137b5[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')][_0x872c('0x6d')](_0x10b0e4,{'fields':_0x210c08,'raw':!![]});})[_0x872c('0x16')](function(_0x4e235b){_0x2c39bb[_0x872c('0xb5')]=_0x4e235b;var _0x1a737a=createInteractionObject(_0x3137b5[_0x872c('0x76')]['id'],_0x3137b5['body'],_0x3137b5[_0x872c('0xb6')],_0x4e235b);var _0x502c78={'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'closed':![]};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]){_0x502c78[_0x872c('0xb7')]=_0x3137b5['body'][_0x872c('0xb7')];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0xfcce36){if(_0xfcce36){_0x425f1c=!![];return _0xfcce36;}_0x1a737a[_0x872c('0xb7')]=_0x3137b5[_0x872c('0x6e')]['threadId'];_0x1a737a['externalUrl']=_0x3137b5['body'][_0x872c('0xb9')];return db['ChatInteraction']['create'](_0x1a737a);});}_0x502c78[_0x872c('0xba')]=_0x4e235b['id'];if(_0x3137b5['body'][_0x872c('0xbb')]&&_0x3137b5[_0x872c('0x6e')]['interaction']['id']){_0x502c78['id']=_0x3137b5[_0x872c('0x6e')][_0x872c('0xbb')]['id'];return db[_0x872c('0xb8')][_0x872c('0x73')]({'where':_0x502c78})[_0x872c('0x16')](function(_0x575f53){if(_0x575f53){_0x425f1c=!![];return _0x575f53;}return db[_0x872c('0xb8')][_0x872c('0x6d')](_0x1a737a);});}return db[_0x872c('0xb8')]['create'](_0x1a737a);})[_0x872c('0x16')](function(_0x10ab74){if(!_0x425f1c)return _0x10ab74;var _0x46ad09={'from':(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x47')]||'')+'\x20'+(_0x2c39bb[_0x872c('0xb5')][_0x872c('0x48')]||'')};if(_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xbc')]&&_0x3137b5[_0x872c('0x6e')][_0x872c('0xb7')]!=_0x3137b5[_0x872c('0x6e')]['messageId']){_0x46ad09['threadId']=_0x3137b5['body'][_0x872c('0xbc')];}return _0x10ab74[_0x872c('0x28')](_0x46ad09);})[_0x872c('0x16')](function(_0xe18644){_0x2c39bb[_0x872c('0xbb')]=_0xe18644['get']({'plain':!![]});_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]=!_0x425f1c;if(_0x2c39bb[_0x872c('0xbb')][_0x872c('0xbd')]){if(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xbe')]){_0x2c39bb['applications'][_0x872c('0xbf')]({'id':0x0,'priority':_0x2c39bb[_0x872c('0xc0')]['length']+0x1,'app':_0x872c('0xc1'),'appdata':_0x872c('0xc2'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x3137b5[_0x872c('0x6e')][_0x872c('0x6e')],'ChatWebsiteId':_0x3137b5[_0x872c('0x76')]['id'],'ChatInteractionId':_0xe18644['id'],'direction':'in','ContactId':_0x2c39bb[_0x872c('0xb5')]['id'],'AttachmentId':_0x3137b5[_0x872c('0x6e')][_0x872c('0xc3')]});})[_0x872c('0x16')](function(_0x30777b){_0x2c39bb[_0x872c('0x1f')]=_0x30777b;if(!_0x2c39bb[_0x872c('0xbb')]['UserId']){return;}return db['User'][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['UserId']}});})[_0x872c('0x16')](function(_0x4e846f){if(_0x4e846f){_0x2c39bb[_0x872c('0xc0')][_0x872c('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e846f[_0x872c('0x2e')]+','+(_0x2c39bb[_0x872c('0xb4')][_0x872c('0xc5')]||0xa),'interval':_0x872c('0xc6')});_0x2c39bb[_0x872c('0xc7')]=!![];}if(!_0x2c39bb['interaction']['queueId']){return;}return db[_0x872c('0xc8')][_0x872c('0x73')]({'attributes':['id',_0x872c('0x2e')],'where':{'id':_0x2c39bb[_0x872c('0xbb')]['queueId']}});})[_0x872c('0x16')](function(_0x4dc75c){if(_0x4dc75c){_0x2c39bb[_0x872c('0xc0')]['unshift']({'id':0x0,'priority':0x1,'app':_0x872c('0xc9'),'appdata':_0x4dc75c[_0x872c('0x2e')]+','+(_0x2c39bb['account'][_0x872c('0xca')]||0x12c),'interval':_0x872c('0xc6')});}return respondWithRpcPromise(_0x872c('0xcb'),_0x872c('0xcc'),_0x2c39bb);})[_0x872c('0x16')](function(_0x1fa142){respondWithRpcPromise(_0x872c('0xcd'),_0x872c('0xcd'),{'event':_0x872c('0x9d'),'message':_0x1fa142},client9002);return _0x1fa142;})[_0x872c('0x16')](respondWithResult(_0x2344be,null))[_0x872c('0x20')](APIHandleError(_0x2344be));};exports['offline']=function(_0xec875b,_0x305247){var _0x24cbb6,_0x5a5906,_0x4a0eb1;var _0xd48f05=[];var _0x599044={};var _0x144373=_0xec875b[_0x872c('0xce')]||[];var _0x227098=[];var _0x519f53;return db[_0x872c('0x9f')]['describe']()[_0x872c('0x16')](function(_0x2a2183){if(!_0x2a2183){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xd48f05=_['difference'](_[_0x872c('0x6a')](_0x2a2183),[_0x872c('0xa2'),_0x872c('0xa4'),_0x872c('0xcf'),_0x872c('0xa5')]);if(_0xec875b['body']['id']){delete _0xec875b['body']['id'];}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['from'])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xa7')));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')]['body'])||_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]===''){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x872c('0x95')](_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247['status'](0x1f4)[_0x872c('0x2f')](new db[(_0x872c('0xa0'))][(_0x872c('0xa8'))](_0x872c('0xd1')+_0xd48f05));}if(!_['includes'](_0xd48f05,_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')])){throw _0x305247[_0x872c('0x21')](0x1f4)[_0x872c('0x2f')](new db['Sequelize']['ValidationError'](_0x872c('0xd2')+_0xd48f05));}_0x599044[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b['body'][_0x872c('0xa6')];})['then'](function(){return db[_0x872c('0x64')]['find']({'where':{'id':_0xec875b['params']['id']},'include':[{'model':db[_0x872c('0xd3')],'as':_0x872c('0xad')},{'model':db[_0x872c('0xd4')],'as':_0x872c('0xd4')}]});})[_0x872c('0x16')](handleEntityNotFound(_0x305247,null))['then'](function(_0x16958e){if(_0x16958e&&_0x16958e[_0x872c('0xad')]){_0x5a5906=_0x16958e;var _0x3b71e7=_[_0x872c('0xf')](_0xec875b['body'],{'firstName':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'phone':_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')],'ListId':_0x16958e['ListId']});_0x3b71e7[_0xec875b[_0x872c('0x6e')][_0x872c('0xd0')]]=_0xec875b[_0x872c('0x6e')][_0x872c('0xa6')];return db[_0x872c('0x9f')]['findOrCreate']({'where':_0x599044,'defaults':_0x3b71e7});}})[_0x872c('0xb2')](function(_0x39a920){if(_0x39a920){_0x4a0eb1=_0x39a920;var _0x376e0e=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xd6')),'utf8');var _0x181c99=ejs[_0x872c('0xd7')](_0x376e0e,{'body':_[_0x872c('0xd8')](_0xec875b[_0x872c('0x6e')][_0x872c('0x6e')]),'bodyTitle':_0x5a5906[_0x872c('0xd9')]});return db[_0x872c('0xda')][_0x872c('0x6d')]({'body':_0x181c99,'plainBody':htmlToText[_0x872c('0xdb')](_0x181c99),'ContactId':_0x39a920['id'],'ChatWebsiteId':_0x5a5906['id']});}})['then'](function(_0x51c7e6){_0x519f53=_0x51c7e6;if(_0x144373[_0x872c('0x5d')]){var _0x1397d7=_0x144373['map'](function(_0x20a6a0){return{'name':_0x20a6a0[_0x872c('0xdc')],'basename':_0x20a6a0[_0x872c('0x85')],'type':_0x20a6a0['mimetype'],'ChatOfflineMessageId':_0x51c7e6['id']};});_0x227098=_0x1397d7[_0x872c('0x3b')](_0x263ce1=>{var _0x56e6f0={'filename':_0x263ce1[_0x872c('0x2e')],'path':path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),_0x872c('0xde'),_0x872c('0xdf'),_0x263ce1['basename'])};return _0x56e6f0;});if(!_0x5a5906[_0x872c('0xe0')]){return db[_0x872c('0xe1')][_0x872c('0xe2')](function(_0x2133a9){return db[_0x872c('0xe3')][_0x872c('0xe4')](_0x1397d7,{'transaction':_0x2133a9});});}}})[_0x872c('0x16')](function(){if(_0x519f53){_0x24cbb6=_0x519f53;return db[_0x872c('0xd4')][_0x872c('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x872c('0xe5')],'as':_0x872c('0xe6'),'raw':!![],'include':[{'model':db[_0x872c('0xe7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x872c('0x16')](function(_0xf4331b){if(_0xf4331b&&_0xf4331b[_0x872c('0xe6')]&&_0x5a5906['forwardOffline']&&_0x5a5906['forwardOfflineAddress']){var _0x53436a=_0xf4331b[_0x872c('0xe8')]();return respondWithRpcPromise(_0x872c('0xe9'),_0x872c('0xea'),{'account':_0x53436a,'message':{'from':util[_0x872c('0x31')]('\x22%s\x22\x20<%s>',_0xf4331b[_0x872c('0x2e')],_0xf4331b[_0x872c('0xeb')]||_0xf4331b[_0x872c('0xe6')][_0x872c('0x6f')]),'to':_0x5a5906['forwardOfflineAddress'],'subject':_0x5a5906['offlineMessageSubject'],'html':_0x24cbb6[_0x872c('0x6e')],'attachments':_0x227098}},client9003)[_0x872c('0x16')](function(){return _0x24cbb6;})[_0x872c('0x20')](function(_0x360398){logger[_0x872c('0x1d')](_0x360398);});}})[_0x872c('0x16')](function(){if(_0x5a5906&&_0x5a5906['openNewInteraction']&&_0x5a5906[_0x872c('0xec')]){var _0x129deb=[];if(_0x144373[_0x872c('0x5d')]){_0x129deb=_0x144373['map'](function(_0x55ea70){return{'name':_0x55ea70[_0x872c('0xdc')],'basename':_0x55ea70[_0x872c('0x85')],'type':_0x55ea70[_0x872c('0xed')],'ChatOfflineMessageId':_0x519f53['id']};});}var _0x134d40;if(!_['isNil'](_0x5a5906[_0x872c('0xee')])){var _0x118b8a=_['map'](_0xec875b[_0x872c('0x6e')],function(_0x45dadc){return _0x45dadc;});var _0x5b0d06=_[_0x872c('0xef')](_0x118b8a)[0x0];var _0xa1cd9=_[_0x872c('0xf0')](_0x5b0d06,function(_0x502801){return _0x502801;});_0x134d40=_0xa1cd9[0x1][_0x5a5906[_0x872c('0xee')]];}var _0x2e77b7={'from':_0x4a0eb1['email'],'firstName':_0x4a0eb1[_0x872c('0x47')],'lastName':_0x4a0eb1[_0x872c('0x48')],'mapKey':'email','message':{'from':_0x4a0eb1[_0x872c('0xeb')],'to':_0x5a5906[_0x872c('0xd4')][_0x872c('0xeb')],'cc':'','subject':_[_0x872c('0x95')](_0x134d40)?_0x5a5906[_0x872c('0xf1')]:_0x134d40,'messageId':'','sentAt':new Date(),'attach':_0x129deb[_0x872c('0x5d')],'attachments':_0x129deb,'originChannel':_0x872c('0xf2'),'ChatWebsiteId':_0x5a5906['id'],'ChatOfflineMessageId':_0x24cbb6['id'],'originTo':_0x5a5906['MailAccount']['email']},'body':_0x24cbb6[_0x872c('0x6e')]};var _0x39d5af={'account':{'id':_0x5a5906[_0x872c('0xec')]},'body':_0x2e77b7,'log':_0x872c('0xf3')};return respondWithRpcPromise(_0x872c('0xf3'),'notifyMail',_0x39d5af,client9001)['then'](function(){return _0x24cbb6;})['catch'](function(_0x2e6e95){logger[_0x872c('0x1d')](_0x2e6e95);});}return;})[_0x872c('0x16')](function(){if(_0x24cbb6){return _0x24cbb6;}})[_0x872c('0x16')](respondWithResult(_0x305247,null))['catch'](function(){for(var _0x1b9832 of _0x144373){var _0x1c9151=path[_0x872c('0x91')](config[_0x872c('0x8c')],_0x872c('0xdd'),_0x872c('0xce'),'attachments','offline-chat',_0x1b9832['filename']);fs_extra['remove'](_0x1c9151)['catch'](function(_0x3348f5){logger[_0x872c('0x1d')](_0x872c('0xf4'),_0x1c9151,_0x3348f5);});}});};exports[_0x872c('0xf5')]=function(_0xf4f5ad,_0xcd2bca){return db['ChatInteraction']['find']({'where':{'id':_0xf4f5ad[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0xcd2bca,null))['then'](function(_0x7c9f59){if(_0x7c9f59){return _0x7c9f59[_0x872c('0xf5')](_0xf4f5ad[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0xf4f5ad[_0x872c('0x6e')],['ids','id'])||{});}})[_0x872c('0x16')](respondWithResult(_0xcd2bca,null))[_0x872c('0x20')](handleError(_0xcd2bca,null));};exports['getInteractions']=function(_0x1cf9bd,_0x1ff4d8){var _0x8b4fa1={'raw':![],'where':{}};var _0x271c89={};var _0x348740={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1cf9bd[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x1ff4d8,null))[_0x872c('0x16')](function(_0x488169){if(_0x488169){_0x271c89[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb8')][_0x872c('0x56')]);_0x271c89['query']=_[_0x872c('0x6a')](_0x1cf9bd[_0x872c('0x58')]);_0x271c89[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x271c89[_0x872c('0x50')],_0x271c89['query']);_0x8b4fa1[_0x872c('0x5a')]=_['intersection'](_0x271c89[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x1cf9bd['query']['fields']));_0x8b4fa1['attributes']=_0x8b4fa1[_0x872c('0x5a')][_0x872c('0x5d')]?_0x8b4fa1[_0x872c('0x5a')]:_0x271c89[_0x872c('0x50')];if(!_0x1cf9bd[_0x872c('0x58')]['hasOwnProperty']('nolimit')){_0x8b4fa1[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x25')]);_0x8b4fa1['offset']=qs[_0x872c('0x23')](_0x1cf9bd[_0x872c('0x58')]['offset']);}_0x8b4fa1[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x1cf9bd[_0x872c('0x58')][_0x872c('0x60')]);_0x8b4fa1[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x1cf9bd[_0x872c('0x58')],_0x271c89[_0x872c('0x59')]));_0x8b4fa1[_0x872c('0x62')]['ChatWebsiteId']=_0x488169['id'];if(_0x1cf9bd[_0x872c('0x58')]['filter']){_0x8b4fa1[_0x872c('0x62')]=_['merge'](_0x8b4fa1[_0x872c('0x62')],{'$or':_['map'](_0x8b4fa1[_0x872c('0x5a')],function(_0x49f8ea){var _0x31138a={};_0x31138a[_0x49f8ea]={'$like':'%'+_0x1cf9bd[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0x31138a;})});}_0x8b4fa1=_[_0x872c('0x6b')]({},_0x8b4fa1,_0x1cf9bd['options']);return db[_0x872c('0xb8')]['count']({'where':_0x8b4fa1[_0x872c('0x62')]})[_0x872c('0x16')](function(_0x3c0d91){_0x348740['count']=_0x3c0d91;if(_0x1cf9bd['query'][_0x872c('0x65')]){_0x8b4fa1[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xf8')],'as':_0x872c('0xf9'),'attributes':[_0x872c('0x2e'),_0x872c('0xfa'),'internal'],'required':![]},{'model':db[_0x872c('0xfb')],'as':'Tags','attributes':['id',_0x872c('0x2e'),_0x872c('0xfc')],'where':_0x1cf9bd[_0x872c('0x58')][_0x872c('0xfd')]?{'id':_0x1cf9bd[_0x872c('0x58')]['tag']}:undefined,'required':_0x1cf9bd[_0x872c('0x58')]['tag']?!![]:![]}];}return db[_0x872c('0xb8')][_0x872c('0x67')](_0x8b4fa1);})[_0x872c('0x16')](function(_0x15f4b7){_0x348740[_0x872c('0x68')]=_0x15f4b7;return _0x348740;});}})[_0x872c('0x16')](respondWithFilteredResult(_0x1ff4d8,_0x8b4fa1))[_0x872c('0x20')](handleError(_0x1ff4d8,null));};exports[_0x872c('0xfe')]=function(_0x33ad57,_0x2a2fac){var _0x1e7cb6=0x0;var _0x1454a8=0x0;var _0x509c3b=![];var _0x123d10;var _0x4ff137;return db[_0x872c('0x64')]['find']({'where':{'id':_0x33ad57[_0x872c('0x76')]['id']},'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3c'),'include':[{'model':db[_0x872c('0x3c')],'as':_0x872c('0x3d'),'attributes':['id',_0x872c('0x37')]}]}]})[_0x872c('0x16')](handleEntityNotFound(_0x2a2fac,null))[_0x872c('0x16')](function(_0x1c7195){if(_0x1c7195){_0x123d10=_0x1c7195;return _0x1c7195['getProactiveActions']({'raw':!![]});}})['then'](function(_0x59c0d4){if(_0x123d10){if(_0x59c0d4){_0x4ff137=_0x59c0d4;}}return require(_0x872c('0xff'))['getLicense']();})['then'](function(_0x301eb1){if(_0x301eb1){_0x1454a8=_0x301eb1['virtual'];_0x509c3b=_0x301eb1['custom'];}})['then'](function(){return db[_0x872c('0xb8')][_0x872c('0x26')]({'where':{'closed':![]}});})[_0x872c('0x16')](function(_0x575cfe){_0x1e7cb6=_0x575cfe;if(_0x1454a8&&_0x575cfe>_0x1454a8){return db[_0x872c('0x100')][_0x872c('0x7b')]({'where':{'id':0x1}})[_0x872c('0x16')](function(_0x1f11bc){if(_0x1f11bc){_0x1f11bc['increment']('chatLicenseExceeded');}});}})[_0x872c('0x16')](function(){if(!_0x123d10[_0x872c('0x3c')]||!_0x123d10[_0x872c('0x3c')][_0x872c('0x3d')])return!![];return checkWebsiteIntervals(_0x123d10);})[_0x872c('0x16')](function(_0x1276bf){var _0x2cd27b=fs[_0x872c('0xd5')](path[_0x872c('0x91')](config['root'],_0x872c('0x101')),_0x872c('0x102'));var _0x4182ff=new url[(_0x872c('0x103'))](_0x123d10[_0x872c('0x104')])[_0x872c('0x105')];var _0x334bd3=_0x872c('0x106');var _0x12ea20=![];var _0x24a032={'chatVersion':_0x334bd3,'chatWebsiteAddressOrigin':_0x4182ff,'remote':_0x123d10[_0x872c('0x107')],'query':querystring[_0x872c('0x1c')](_[_0x872c('0x6b')](_0x123d10[_0x872c('0x2a')]({'plain':!![]}),{'customerIp':_0x33ad57[_0x872c('0xb6')][_0x872c('0x44')]||_0x33ad57[_0x872c('0xb6')][_0x872c('0x108')]||_0x33ad57[_0x872c('0x109')]['remoteAddress']||_0x33ad57['ip'],'referer':_0x33ad57[_0x872c('0xb6')][_0x872c('0x4a')],'openedInteractions':_0x1e7cb6,'maxInteractions':_0x1454a8,'virtual':_0x509c3b[_0x872c('0x10a')],'online':_0x1276bf,'custom':_0x509c3b}))['replace'](/'/g,'\x5c\x27')};_0x2a2fac[_0x872c('0x2f')](ejs[_0x872c('0xd7')](Mustache[_0x872c('0xd7')](_0x2cd27b,_0x24a032),{'proactiveActions':_0x4ff137,'alignment':_0x123d10[_0x872c('0x10b')],'verticalAlignment':_0x123d10[_0x872c('0x10c')],'div_color':_0x123d10[_0x872c('0xfc')],'labelText':_0x123d10[_0x872c('0x10d')],'text_color':_0x123d10[_0x872c('0x10e')],'text_button_color':_0x123d10[_0x872c('0x10f')],'button_color':_0x123d10[_0x872c('0x110')],'background_color':_0x123d10['backgroundColor'],'hideWhenOffline':_0x123d10[_0x872c('0x111')],'intervalId':_0x123d10[_0x872c('0x112')],'isDevelopment':_0x12ea20,'chatVersion':_0x334bd3}));})[_0x872c('0x20')](handleError(_0x2a2fac,null));};exports[_0x872c('0x113')]=function(_0x136729,_0x148551){var _0x1645e4=_0x136729[_0x872c('0x76')]['id'];var _0x4d3d6d=_0x136729[_0x872c('0x6e')];var _0xb3bf6c=0xc8;var _0x5ccb5d=null;return db[_0x872c('0xe1')][_0x872c('0xe2')]({'isolationLevel':db['sequelize'][_0x872c('0x114')][_0x872c('0x115')][_0x872c('0x116')]},function(_0x4439be){return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x1645e4},'transaction':_0x4439be})['then'](function(_0x19e050){if(_0x19e050){return db[_0x872c('0xb0')][_0x872c('0x29')]({'where':{'ChatWebsiteId':_0x1645e4},'transaction':_0x4439be})[_0x872c('0x16')](function(){var _0x6aaec6=_[_0x872c('0x3b')](_0x4d3d6d,function(_0x5e7186){_0x5e7186[_0x872c('0x78')]=_0x1645e4;return _0x5e7186;});return db[_0x872c('0xb0')][_0x872c('0xe4')](_0x6aaec6,{'transaction':_0x4439be});});}else{_0xb3bf6c=0x194;_0x5ccb5d=[];}});})['then'](function(){if(_0xb3bf6c!==0x194){return db[_0x872c('0xb0')][_0x872c('0x117')]({'where':{'ChatWebsiteId':_0x1645e4},'order':_0x872c('0xb3')})[_0x872c('0x16')](function(_0x2d0a1c){_0x5ccb5d=_0x2d0a1c;});}})['catch'](function(_0x20e6db){_0xb3bf6c=0x1f4;logger[_0x872c('0x1d')](_0x20e6db['stack']);if(_0x20e6db['name']){delete _0x20e6db[_0x872c('0x2e')];}_0x5ccb5d=_0x20e6db;})[_0x872c('0x118')](function(){if(_0x5ccb5d===null){_0x148551[_0x872c('0x2d')](_0xb3bf6c);}else{if(_0xb3bf6c===0x1f4){_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x2f')](_0x5ccb5d);}else{_0x148551[_0x872c('0x21')](_0xb3bf6c)[_0x872c('0x22')](_0x5ccb5d);}}});};exports[_0x872c('0x119')]=function(_0x20f6c1,_0x118ff9){var _0x178ee7={};var _0x8dac6b={};var _0x26a035;var _0x56ab33;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x20f6c1[_0x872c('0x76')]['id']}})['then'](handleEntityNotFound(_0x118ff9,null))['then'](function(_0x505f63){if(_0x505f63){_0x26a035=_0x505f63;_0x8dac6b[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xb0')][_0x872c('0x56')]);_0x8dac6b['query']=_[_0x872c('0x6a')](_0x20f6c1[_0x872c('0x58')]);_0x8dac6b[_0x872c('0x59')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],_0x8dac6b[_0x872c('0x58')]);_0x178ee7[_0x872c('0x5a')]=_['intersection'](_0x8dac6b[_0x872c('0x50')],qs['fields'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x5c')]));_0x178ee7['attributes']=_0x178ee7[_0x872c('0x5a')][_0x872c('0x5d')]?_0x178ee7[_0x872c('0x5a')]:_0x8dac6b[_0x872c('0x50')];_0x178ee7[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x60')]);_0x178ee7[_0x872c('0x62')]=qs['filters'](_['pick'](_0x20f6c1[_0x872c('0x58')],_0x8dac6b[_0x872c('0x59')]));if(_0x20f6c1[_0x872c('0x58')]['filter']){_0x178ee7[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x178ee7['where'],{'$or':_[_0x872c('0x3b')](_0x178ee7[_0x872c('0x5a')],function(_0x653260){var _0x944729={};_0x944729[_0x653260]={'$like':'%'+_0x20f6c1[_0x872c('0x58')]['filter']+'%'};return _0x944729;})});}_0x178ee7=_[_0x872c('0x6b')]({},_0x178ee7,_0x20f6c1['options']);return _0x26a035[_0x872c('0x119')](_0x178ee7);}})[_0x872c('0x16')](function(_0x3b475b){if(_0x3b475b){_0x56ab33=_0x3b475b[_0x872c('0x5d')];if(!_0x20f6c1[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x178ee7['limit']=qs[_0x872c('0x25')](_0x20f6c1[_0x872c('0x58')][_0x872c('0x25')]);_0x178ee7[_0x872c('0x23')]=qs['offset'](_0x20f6c1[_0x872c('0x58')][_0x872c('0x23')]);}return _0x26a035[_0x872c('0x119')](_0x178ee7);}})['then'](function(_0x2615af){if(_0x2615af){return _0x2615af?{'count':_0x56ab33,'rows':_0x2615af}:null;}})[_0x872c('0x16')](respondWithResult(_0x118ff9,null))['catch'](handleError(_0x118ff9,null));};exports[_0x872c('0x11a')]=function(_0x5b4604,_0x54c7a1){return db['chatProactiveAction'][_0x872c('0x73')]({'where':{'id':_0x5b4604[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x54c7a1,null))[_0x872c('0x16')](function(_0x404c13){if(_0x404c13){return _0x404c13['addProactiveActions'](_0x5b4604[_0x872c('0x6e')]['ids'],_[_0x872c('0xf6')](_0x5b4604['body'],[_0x872c('0x7e'),'id'])||{});}})[_0x872c('0x16')](respondWithResult(_0x54c7a1,null))[_0x872c('0x20')](handleError(_0x54c7a1,null));};exports[_0x872c('0x11b')]=function(_0x2b71fa,_0x269b3c){var _0xb06672={};var _0x255886={};var _0x5cefce;var _0x5d21dd;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2b71fa['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x269b3c,null))[_0x872c('0x16')](function(_0x4bdd93){if(_0x4bdd93){_0x5cefce=_0x4bdd93;_0x255886[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0x11c')]['rawAttributes']);_0x255886[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x2b71fa[_0x872c('0x58')]);_0x255886[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x255886['model'],_0x255886[_0x872c('0x58')]);_0xb06672['attributes']=_[_0x872c('0x5b')](_0x255886[_0x872c('0x50')],qs[_0x872c('0x5c')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x5c')]));_0xb06672['attributes']=_0xb06672[_0x872c('0x5a')][_0x872c('0x5d')]?_0xb06672[_0x872c('0x5a')]:_0x255886[_0x872c('0x50')];_0xb06672['order']=qs[_0x872c('0x60')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x60')]);_0xb06672[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x2b71fa['query'],_0x255886[_0x872c('0x59')]));if(_0x2b71fa[_0x872c('0x58')]['filter']){_0xb06672['where']=_['merge'](_0xb06672[_0x872c('0x62')],{'$or':_['map'](_0xb06672['attributes'],function(_0x25f2fc){var _0x3163b5={};_0x3163b5[_0x25f2fc]={'$like':'%'+_0x2b71fa['query'][_0x872c('0x61')]+'%'};return _0x3163b5;})});}_0xb06672=_['merge']({},_0xb06672,_0x2b71fa[_0x872c('0x6c')]);return _0x5cefce[_0x872c('0x11b')](_0xb06672);}})['then'](function(_0x212a38){if(_0x212a38){_0x5d21dd=_0x212a38['length'];if(!_0x2b71fa[_0x872c('0x58')][_0x872c('0x5e')]('nolimit')){_0xb06672[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2b71fa[_0x872c('0x58')][_0x872c('0x25')]);_0xb06672[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2b71fa[_0x872c('0x58')]['offset']);}return _0x5cefce['getProactiveActions'](_0xb06672);}})['then'](function(_0x395211){if(_0x395211){return _0x395211?{'count':_0x5d21dd,'rows':_0x395211}:null;}})['then'](respondWithResult(_0x269b3c,null))[_0x872c('0x20')](handleError(_0x269b3c,null));};exports[_0x872c('0x11d')]=function(_0x3f3a49,_0x129037){var _0x4e6d0e=_0x3f3a49[_0x872c('0x58')][_0x872c('0x11e')]===_0x872c('0x11f')?_0x872c('0x120'):_0x872c('0x121');return db[_0x872c('0x64')][_0x872c('0x73')]({'attributes':['id',_0x4e6d0e],'where':{'id':_0x3f3a49[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x129037,null))[_0x872c('0x16')](function(_0xa6333a){if(_0xa6333a){var _0x1ec9ac=_0xa6333a[_0x4e6d0e];var _0x1eae07=_0x1ec9ac&&_0x1ec9ac['items']?_0x1ec9ac[_0x872c('0x122')]:[];_0x129037[_0x872c('0x2f')]({'fromKey':_[_0x872c('0x95')](_0x1ec9ac[_0x872c('0x123')])?undefined:_0x1ec9ac['fromKey'],'count':_0x1eae07[_0x872c('0x5d')],'rows':_0x1eae07});}})['catch'](handleError(_0x129037,null));};exports[_0x872c('0x124')]=function(_0x2328a4,_0x5135d8){var _0x1c8e31={'raw':![],'where':{}};var _0x3a7d2e={};var _0x67a052={'count':0x0,'rows':[]};return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x2328a4[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x5135d8,null))[_0x872c('0x16')](function(_0x5aae44){if(_0x5aae44){_0x3a7d2e[_0x872c('0x50')]=_[_0x872c('0x6a')](db['ChatOfflineMessage']['rawAttributes']);_0x3a7d2e[_0x872c('0x58')]=_['keys'](_0x2328a4[_0x872c('0x58')]);_0x3a7d2e[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x3a7d2e[_0x872c('0x50')],_0x3a7d2e[_0x872c('0x58')]);_0x1c8e31[_0x872c('0x5a')]=_['intersection'](_0x3a7d2e['model'],qs['fields'](_0x2328a4[_0x872c('0x58')][_0x872c('0x5c')]));_0x1c8e31['attributes']=_0x1c8e31[_0x872c('0x5a')]['length']?_0x1c8e31[_0x872c('0x5a')]:_0x3a7d2e[_0x872c('0x50')];if(!_0x2328a4['query']['hasOwnProperty'](_0x872c('0x5f'))){_0x1c8e31[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x2328a4[_0x872c('0x58')][_0x872c('0x25')]);_0x1c8e31[_0x872c('0x23')]=qs[_0x872c('0x23')](_0x2328a4[_0x872c('0x58')][_0x872c('0x23')]);}_0x1c8e31[_0x872c('0x82')]=qs[_0x872c('0x60')](_0x2328a4[_0x872c('0x58')][_0x872c('0x60')]);_0x1c8e31[_0x872c('0x62')]=qs['filters'](_['pick'](_0x2328a4['query'],_0x3a7d2e[_0x872c('0x59')]));_0x1c8e31[_0x872c('0x62')][_0x872c('0x78')]=_0x5aae44['id'];if(_0x2328a4['query'][_0x872c('0x61')]){_0x1c8e31[_0x872c('0x62')]=_[_0x872c('0x6b')](_0x1c8e31[_0x872c('0x62')],{'$or':_[_0x872c('0x3b')](_0x1c8e31[_0x872c('0x5a')],function(_0x2c2053){var _0xf24e18={};_0xf24e18[_0x2c2053]={'$like':'%'+_0x2328a4[_0x872c('0x58')][_0x872c('0x61')]+'%'};return _0xf24e18;})});}_0x1c8e31=_[_0x872c('0x6b')]({},_0x1c8e31,_0x2328a4[_0x872c('0x6c')]);return db[_0x872c('0xda')][_0x872c('0x26')]({'where':_0x1c8e31[_0x872c('0x62')]})['then'](function(_0x3f7c67){_0x67a052[_0x872c('0x26')]=_0x3f7c67;if(_0x2328a4['query'][_0x872c('0x65')]){_0x1c8e31[_0x872c('0x66')]=[{'all':!![]}];}else{_0x1c8e31[_0x872c('0x66')]=[{'model':db[_0x872c('0x9f')],'as':_0x872c('0xf7'),'required':![]},{'model':db[_0x872c('0xe3')],'as':_0x872c('0x125'),'required':![]}];}return db[_0x872c('0xda')][_0x872c('0x67')](_0x1c8e31);})['then'](function(_0x2ec01c){_0x67a052[_0x872c('0x68')]=_0x2ec01c;return _0x67a052;});}})['then'](respondWithFilteredResult(_0x5135d8,_0x1c8e31))['catch'](handleError(_0x5135d8,null));};exports[_0x872c('0x126')]=function(_0x1f88d8,_0x19ce18){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x1f88d8[_0x872c('0x76')]['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x19ce18,null))[_0x872c('0x16')](function(_0x46c2bb){if(_0x46c2bb){return _0x46c2bb[_0x872c('0x126')](_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')],_[_0x872c('0xf6')](_0x1f88d8[_0x872c('0x6e')],[_0x872c('0x7e'),'id'])||{})[_0x872c('0xb2')](function(_0x4e43b3){for(var _0x2bba36=0x0;_0x2bba36<_0x1f88d8[_0x872c('0x6e')]['ids'][_0x872c('0x5d')];_0x2bba36+=0x1){socket[_0x872c('0x127')]('userChatWebsite:save',{'UserId':Number(_0x1f88d8[_0x872c('0x6e')][_0x872c('0x7e')][_0x2bba36]),'ChatWebsiteId':Number(_0x1f88d8[_0x872c('0x76')]['id'])});}return _0x4e43b3;});}})[_0x872c('0x16')](respondWithResult(_0x19ce18,null))[_0x872c('0x20')](handleError(_0x19ce18,null));};exports[_0x872c('0x128')]=function(_0x2b8fa9,_0x36b00b){return db['ChatWebsite'][_0x872c('0x73')]({'where':{'id':_0x2b8fa9['params']['id']}})[_0x872c('0x16')](handleEntityNotFound(_0x36b00b,null))[_0x872c('0x16')](function(_0x5ccd77){if(_0x5ccd77){return _0x5ccd77[_0x872c('0x128')](_0x2b8fa9['query'][_0x872c('0x7e')])['then'](function(){if(_[_0x872c('0x129')](_0x2b8fa9['query']['ids'])){for(var _0x2ad92c=0x0;_0x2ad92c<_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x872c('0x5d')];_0x2ad92c+=0x1){socket[_0x872c('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')][_0x2ad92c]),'ChatWebsiteId':Number(_0x2b8fa9[_0x872c('0x76')]['id'])});}}else{socket[_0x872c('0x127')](_0x872c('0x12a'),{'UserId':Number(_0x2b8fa9[_0x872c('0x58')][_0x872c('0x7e')]),'ChatWebsiteId':Number(_0x2b8fa9['params']['id'])});}});}})[_0x872c('0x16')](respondWithStatusCode(_0x36b00b,null))[_0x872c('0x20')](handleError(_0x36b00b,null));};exports[_0x872c('0x12b')]=function(_0x491f86,_0x369225){var _0x4ffc14={};var _0x43ef84={};var _0x3d5689;var _0x6c55eb;return db[_0x872c('0x64')][_0x872c('0x7b')]({'where':{'id':_0x491f86['params']['id']}})['then'](handleEntityNotFound(_0x369225,null))['then'](function(_0x2fd5e8){if(_0x2fd5e8){_0x3d5689=_0x2fd5e8;_0x43ef84[_0x872c('0x50')]=_[_0x872c('0x6a')](db[_0x872c('0xf8')][_0x872c('0x56')]);_0x43ef84[_0x872c('0x58')]=_[_0x872c('0x6a')](_0x491f86[_0x872c('0x58')]);_0x43ef84[_0x872c('0x59')]=_[_0x872c('0x5b')](_0x43ef84[_0x872c('0x50')],_0x43ef84[_0x872c('0x58')]);_0x4ffc14['attributes']=_['intersection'](_0x43ef84['model'],qs['fields'](_0x491f86[_0x872c('0x58')][_0x872c('0x5c')]));_0x4ffc14[_0x872c('0x5a')]=_0x4ffc14[_0x872c('0x5a')][_0x872c('0x5d')]?_0x4ffc14[_0x872c('0x5a')]:_0x43ef84[_0x872c('0x50')];_0x4ffc14['order']=qs['sort'](_0x491f86[_0x872c('0x58')][_0x872c('0x60')]);_0x4ffc14[_0x872c('0x62')]=qs[_0x872c('0x59')](_[_0x872c('0x7c')](_0x491f86[_0x872c('0x58')],_0x43ef84[_0x872c('0x59')]));if(_0x491f86['query']['filter']){_0x4ffc14['where']=_[_0x872c('0x6b')](_0x4ffc14['where'],{'$or':_[_0x872c('0x3b')](_0x4ffc14[_0x872c('0x5a')],function(_0x21b156){var _0x560d62={};_0x560d62[_0x21b156]={'$like':'%'+_0x491f86['query'][_0x872c('0x61')]+'%'};return _0x560d62;})});}_0x4ffc14=_[_0x872c('0x6b')]({},_0x4ffc14,_0x491f86['options']);return _0x3d5689[_0x872c('0x12b')](_0x4ffc14);}})['then'](function(_0x352b0b){if(_0x352b0b){_0x6c55eb=_0x352b0b['length'];if(!_0x491f86[_0x872c('0x58')][_0x872c('0x5e')](_0x872c('0x5f'))){_0x4ffc14[_0x872c('0x25')]=qs[_0x872c('0x25')](_0x491f86[_0x872c('0x58')][_0x872c('0x25')]);_0x4ffc14['offset']=qs[_0x872c('0x23')](_0x491f86['query']['offset']);}return _0x3d5689['getAgents'](_0x4ffc14);}})['then'](function(_0x3f0134){if(_0x3f0134){return _0x3f0134?{'count':_0x6c55eb,'rows':_0x3f0134}:null;}})[_0x872c('0x16')](respondWithResult(_0x369225,null))[_0x872c('0x20')](handleError(_0x369225,null));}; \ No newline at end of file +var _0x81dc=['order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','ListId','CmList','Contacts','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','List','list','applications','orderBy','priority','asc','account','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','queueId','queue','*,*,*,*','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','difference','Sequelize','ValidationError','from\x20is\x20mandatory','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','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','user','forwardOfflineAddress','MailAccountId','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','License','findOne','increment','chatLicenseExceeded','ifTime','readFileSync','URL','address','origin','3.8.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get','ChatWebsites','stack','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','name','unknown','%s\x20%s','model','format','%s\x20%s\x20%s','device','vendor','type','mandatoryDispositionPause','map','fieldName','key','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','Pause','ChatWebsite','rawAttributes','length','create','body','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer'];(function(_0x33e4a1,_0x135a24){var _0x4b06c4=function(_0xb3fc66){while(--_0xb3fc66){_0x33e4a1['push'](_0x33e4a1['shift']());}};_0x4b06c4(++_0x135a24);}(_0x81dc,0xbe));var _0xc81d=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x81dc[_0x59162a];return _0x35e50d;};'use strict';var Mustache=require(_0xc81d('0x0'));var util=require(_0xc81d('0x1'));var path=require('path');var ejs=require(_0xc81d('0x2'));var fs=require('fs');var fs_extra=require(_0xc81d('0x3'));var _=require(_0xc81d('0x4'));var querystring=require(_0xc81d('0x5'));var htmlToText=require(_0xc81d('0x6'));var Redis=require('ioredis');var jayson=require(_0xc81d('0x7'));var url=require(_0xc81d('0x8'));var qs=require(_0xc81d('0x9'));var logger=require(_0xc81d('0xa'))(_0xc81d('0xb'));var config=require(_0xc81d('0xc'));var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APINotFoundError=require(_0xc81d('0xd'))[_0xc81d('0xe')];var APIOutOfIntervalError=require('../../errors/api')[_0xc81d('0xf')];var APIHandleError=require(_0xc81d('0xd'))[_0xc81d('0x10')];var db=require('../../mysqldb')['db'];config['redis']=_[_0xc81d('0x11')](config[_0xc81d('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xc81d('0x13'))(new Redis(config['redis']));require(_0xc81d('0x14'))[_0xc81d('0x15')](socket);var client=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232c});var client9002=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232a});var client9003=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x232b});var client9001=jayson[_0xc81d('0x16')][_0xc81d('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x3b934a,_0x4e9706,_0x186254,_0x2d4646){return new Promise(function(_0x1fdcd2,_0x21e267){var _0x5e7830=_0x2d4646||client;return _0x5e7830['request'](_0x3b934a,_0x186254)[_0xc81d('0x18')](function(_0x395c2a){logger[_0xc81d('0x19')](_0xc81d('0x1a'),_0x4e9706,_0xc81d('0x1b'));logger[_0xc81d('0x1c')](_0xc81d('0x1d'),_0x4e9706,_0xc81d('0x1b'),JSON[_0xc81d('0x1e')](_0x395c2a));if(_0x395c2a['error']){if(_0x395c2a['error'][_0xc81d('0x1f')]===0x1f4){logger[_0xc81d('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0x395c2a[_0xc81d('0x20')]['message']);return _0x21e267(_0x395c2a['error']['message']);}logger['error'](_0xc81d('0x1a'),_0x4e9706,_0x395c2a[_0xc81d('0x20')][_0xc81d('0x21')]);return _0x1fdcd2(_0x395c2a['error'][_0xc81d('0x21')]);}else{logger[_0xc81d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0xc81d('0x1b'));_0x1fdcd2(_0x395c2a['result']['message']);}})[_0xc81d('0x22')](function(_0x513f0d){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4e9706,_0x513f0d);_0x21e267(_0x513f0d);});});}function respondWithStatusCode(_0x325241,_0x3f2d2e){_0x3f2d2e=_0x3f2d2e||0xcc;return function(_0x4f9158){if(_0x4f9158){return _0x325241[_0xc81d('0x23')](_0x3f2d2e);}return _0x325241[_0xc81d('0x24')](_0x3f2d2e)[_0xc81d('0x25')]();};}function respondWithResult(_0x3f83ea,_0x4a45e7){_0x4a45e7=_0x4a45e7||0xc8;return function(_0x2c6afc){if(_0x2c6afc){return _0x3f83ea[_0xc81d('0x24')](_0x4a45e7)[_0xc81d('0x26')](_0x2c6afc);}};}function respondWithFilteredResult(_0x5ad00b,_0x365eeb){return function(_0x4399a0){if(_0x4399a0){var _0x10d21e=typeof _0x365eeb[_0xc81d('0x27')]===_0xc81d('0x28')&&typeof _0x365eeb[_0xc81d('0x29')]===_0xc81d('0x28');var _0x5404f6=_0x4399a0[_0xc81d('0x2a')];var _0x567819=_0x10d21e?0x0:_0x365eeb['offset'];var _0x47a794=_0x10d21e?_0x4399a0[_0xc81d('0x2a')]:_0x365eeb[_0xc81d('0x27')]+_0x365eeb[_0xc81d('0x29')];var _0x2d42c4;if(_0x47a794>=_0x5404f6){_0x47a794=_0x5404f6;_0x2d42c4=0xc8;}else{_0x2d42c4=0xce;}_0x5ad00b[_0xc81d('0x24')](_0x2d42c4);return _0x5ad00b['set'](_0xc81d('0x2b'),_0x567819+'-'+_0x47a794+'/'+_0x5404f6)[_0xc81d('0x26')](_0x4399a0);}return null;};}function saveUpdates(_0x491892){return function(_0x4c18c6){if(_0x4c18c6){return _0x4c18c6[_0xc81d('0x2c')](_0x491892)[_0xc81d('0x18')](function(_0x1fd674){return _0x1fd674;});}return null;};}function removeEntity(_0x38d2e6){return function(_0x5aab3b){if(_0x5aab3b){return _0x5aab3b[_0xc81d('0x2d')]()[_0xc81d('0x18')](function(){var _0x13f12a=_0x5aab3b[_0xc81d('0x2e')]({'plain':!![]});var _0x55a70=_0xc81d('0x2f');return db['UserProfileResource'][_0xc81d('0x2d')]({'where':{'type':_0x55a70,'resourceId':_0x13f12a['id']}})[_0xc81d('0x18')](function(){return _0x5aab3b;});})['then'](function(){_0x38d2e6[_0xc81d('0x24')](0xcc)[_0xc81d('0x25')]();});}};}function handleEntityNotFound(_0x563dbe){return function(_0x52af82){if(!_0x52af82){_0x563dbe['sendStatus'](0x194);}return _0x52af82;};}function handleError(_0x48478e,_0xd28508){_0xd28508=_0xd28508||0x1f4;return function(_0x3445a3){logger['error'](_0x3445a3[_0xc81d('0x30')]);if(_0x3445a3['name']){delete _0x3445a3['name'];}_0x48478e[_0xc81d('0x24')](_0xd28508)[_0xc81d('0x31')](_0x3445a3);};}function createInteractionObject(_0x5d8ec0,_0x4da75b,_0x21d400,_0x2c63be){var _0xbbb2f3=require(_0xc81d('0x32'));var _0x87358=new _0xbbb2f3();var _0x4b6d92=_0x87358[_0xc81d('0x33')](_0x21d400[_0xc81d('0x34')])[_0xc81d('0x35')]();var _0x19592c=_0x4da75b[_0xc81d('0x36')];if(_0x21d400[_0xc81d('0x37')]){_0x19592c=_0x21d400[_0xc81d('0x37')];}else if(_0x21d400[_0xc81d('0x38')]){_0x19592c=_['first'](_0x21d400[_0xc81d('0x38')]['split'](','));}return{'ContactId':_0x2c63be['id'],'ChatWebsiteId':_0x5d8ec0,'from':(_0x2c63be['firstName']||'')+'\x20'+(_0x2c63be[_0xc81d('0x39')]||''),'customerIp':_0x19592c,'customerPort':_0x21d400[_0xc81d('0x3a')]?_0x21d400['x-real-port']:null,'referer':_0x4da75b[_0xc81d('0x3b')],'browserName':_0x4b6d92[_0xc81d('0x3c')]['name']&&_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3d')]?util['format']('%s\x20%s',_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3e')],_0x4b6d92['browser'][_0xc81d('0x3d')]):_0xc81d('0x3f'),'browserVersion':_0x4b6d92[_0xc81d('0x3c')][_0xc81d('0x3d')]||'unknown','osName':util['format'](_0xc81d('0x40'),_0x4b6d92['os']['name'],_0x4b6d92['os'][_0xc81d('0x3d')]),'osVersion':_0x4b6d92['os'][_0xc81d('0x3d')],'deviceModel':_0x4b6d92['device'][_0xc81d('0x41')]&&_0x4b6d92['device']['vendor']?util[_0xc81d('0x42')](_0xc81d('0x43'),_0x4b6d92[_0xc81d('0x44')][_0xc81d('0x41')],_0x4b6d92['device'][_0xc81d('0x45')],_0x4b6d92['device'][_0xc81d('0x46')]):null,'deviceVendor':_0x4b6d92['device'][_0xc81d('0x45')],'deviceType':_0x4b6d92[_0xc81d('0x44')][_0xc81d('0x46')],'formData':JSON['stringify'](_0x4da75b)};}exports['index']=function(_0x20d5ab,_0x831218){var _0x4f9df2={'include':[{'model':db['Pause'],'as':_0xc81d('0x47')}]},_0x554255={},_0xf9cda8={'count':0x0,'rows':[]};var _0x2890f2=_[_0xc81d('0x48')](db['ChatWebsite']['rawAttributes'],function(_0x974d70){return{'name':_0x974d70[_0xc81d('0x49')],'type':_0x974d70[_0xc81d('0x46')][_0xc81d('0x4a')]};});_0x554255[_0xc81d('0x41')]=_['map'](_0x2890f2,'name');_0x554255[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x20d5ab[_0xc81d('0x4b')]);_0x554255[_0xc81d('0x4d')]=_['intersection'](_0x554255['model'],_0x554255['query']);_0x4f9df2['attributes']=_[_0xc81d('0x4e')](_0x554255['model'],qs[_0xc81d('0x4f')](_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x4f9df2['attributes']=_0x4f9df2['attributes']['length']?_0x4f9df2[_0xc81d('0x50')]:_0x554255[_0xc81d('0x41')];if(!_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x4f9df2[_0xc81d('0x29')]=qs['limit'](_0x20d5ab['query'][_0xc81d('0x29')]);_0x4f9df2[_0xc81d('0x27')]=qs['offset'](_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x27')]);}_0x4f9df2['order']=qs[_0xc81d('0x53')](_0x20d5ab['query']['sort']);_0x4f9df2[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x20d5ab[_0xc81d('0x4b')],_0x554255[_0xc81d('0x4d')]),_0x2890f2);if(_0x20d5ab['query'][_0xc81d('0x56')]){_0x4f9df2['where']=_[_0xc81d('0x57')](_0x4f9df2[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x2890f2,function(_0x34caca){if(_0x34caca['type']!==_0xc81d('0x58')){var _0x5b9cba={};_0x5b9cba[_0x34caca['name']]={'$like':'%'+_0x20d5ab[_0xc81d('0x4b')]['filter']+'%'};return _0x5b9cba;}})});}_0x4f9df2=_['merge']({},_0x4f9df2,_0x20d5ab[_0xc81d('0x59')]);var _0xba4370={'where':_0x4f9df2[_0xc81d('0x54')]};return db['ChatWebsite'][_0xc81d('0x2a')](_0xba4370)[_0xc81d('0x18')](function(_0x22365f){_0xf9cda8[_0xc81d('0x2a')]=_0x22365f;if(_0x20d5ab[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x4f9df2[_0xc81d('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc81d('0x5c')](_0x4f9df2);})[_0xc81d('0x18')](function(_0x5c76ed){_0xf9cda8[_0xc81d('0x5d')]=_0x5c76ed;return _0xf9cda8;})[_0xc81d('0x18')](respondWithFilteredResult(_0x831218,_0x4f9df2))[_0xc81d('0x22')](handleError(_0x831218,null));};exports['show']=function(_0x5ad556,_0x766882){var _0x68f4ce={'raw':![],'where':{'id':_0x5ad556[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x5f')],'as':_0xc81d('0x47')}]},_0x584c40={};_0x584c40[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x60')][_0xc81d('0x61')]);_0x584c40[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x5ad556[_0xc81d('0x4b')]);_0x584c40[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x584c40[_0xc81d('0x41')],_0x584c40[_0xc81d('0x4b')]);_0x68f4ce[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x584c40[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0x5ad556[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x68f4ce['attributes']=_0x68f4ce['attributes'][_0xc81d('0x62')]?_0x68f4ce[_0xc81d('0x50')]:_0x584c40[_0xc81d('0x41')];if(_0x5ad556[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x68f4ce[_0xc81d('0x5b')]=[{'all':!![]}];}_0x68f4ce=_[_0xc81d('0x57')]({},_0x68f4ce,_0x5ad556['options']);return db[_0xc81d('0x60')]['find'](_0x68f4ce)[_0xc81d('0x18')](handleEntityNotFound(_0x766882,null))[_0xc81d('0x18')](respondWithResult(_0x766882,null))['catch'](handleError(_0x766882,null));};exports['create']=function(_0x127f74,_0x44d0cc){return db[_0xc81d('0x60')][_0xc81d('0x63')](_0x127f74[_0xc81d('0x64')],{})[_0xc81d('0x18')](function(_0x54b771){var _0x58c3ad=_0x127f74['user'][_0xc81d('0x2e')]({'plain':!![]});if(!_0x58c3ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c3ad[_0xc81d('0x65')]==='user'){var _0x11d1c5=_0x54b771[_0xc81d('0x2e')]({'plain':!![]});var _0x9ec1f9='ChatWebsites';return db['UserProfileSection'][_0xc81d('0x66')]({'where':{'name':_0x9ec1f9,'userProfileId':_0x58c3ad[_0xc81d('0x67')]},'raw':!![]})[_0xc81d('0x18')](function(_0x44b005){if(_0x44b005&&_0x44b005[_0xc81d('0x68')]===0x0){return db['UserProfileResource'][_0xc81d('0x63')]({'name':_0x11d1c5[_0xc81d('0x3e')],'resourceId':_0x11d1c5['id'],'type':_0x44b005[_0xc81d('0x3e')],'sectionId':_0x44b005['id']},{})['then'](function(){return _0x54b771;});}else{return _0x54b771;}})['catch'](function(_0xe8e6bd){logger[_0xc81d('0x20')](_0xc81d('0x69'),_0xe8e6bd);throw _0xe8e6bd;});}return _0x54b771;})['then'](respondWithResult(_0x44d0cc,0xc9))[_0xc81d('0x22')](handleError(_0x44d0cc,null));};exports[_0xc81d('0x2c')]=function(_0x3d53a2,_0x3d8c9b){if(_0x3d53a2[_0xc81d('0x64')]['id']){delete _0x3d53a2[_0xc81d('0x64')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3d53a2['params']['id']},'include':[{'model':db[_0xc81d('0x5f')],'as':_0xc81d('0x47')}]})[_0xc81d('0x18')](handleEntityNotFound(_0x3d8c9b,null))['then'](saveUpdates(_0x3d53a2[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x3d8c9b,null))[_0xc81d('0x22')](handleError(_0x3d8c9b,null));};exports[_0xc81d('0x2d')]=function(_0xb30286,_0x544652){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0xb30286[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x544652,null))[_0xc81d('0x18')](removeEntity(_0x544652,null))[_0xc81d('0x22')](handleError(_0x544652,null));};exports[_0xc81d('0x6a')]=function(_0x2622f9,_0x38944a){return db[_0xc81d('0x60')][_0xc81d('0x6a')]()[_0xc81d('0x18')](respondWithResult(_0x38944a,null))['catch'](handleError(_0x38944a,null));};exports[_0xc81d('0x6b')]=function(_0xc303da,_0x20115d){if(_0xc303da[_0xc81d('0x64')]['id']){delete _0xc303da[_0xc81d('0x64')]['id'];}return db[_0xc81d('0x60')]['find']({'where':{'id':_0xc303da[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x20115d,null))[_0xc81d('0x18')](function(_0x4bbf56){if(_0x4bbf56){_0xc303da['body'][_0xc81d('0x6c')]=_0x4bbf56['id'];return db[_0xc81d('0x6d')][_0xc81d('0x63')](_0xc303da[_0xc81d('0x64')]);}})[_0xc81d('0x18')](respondWithResult(_0x20115d,null))[_0xc81d('0x22')](handleError(_0x20115d,null));};exports[_0xc81d('0x6e')]=function(_0xb164c4,_0x14ebca){var _0xafb769={'raw':![],'where':{}};var _0x5b588b={};var _0x501191={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0xb164c4['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x14ebca,null))[_0xc81d('0x18')](function(_0x41d63f){if(_0x41d63f){_0x5b588b[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x6d')][_0xc81d('0x61')]);_0x5b588b[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0xb164c4['query']);_0x5b588b[_0xc81d('0x4d')]=_['intersection'](_0x5b588b[_0xc81d('0x41')],_0x5b588b[_0xc81d('0x4b')]);_0xafb769[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x5b588b['model'],qs[_0xc81d('0x4f')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0xafb769['attributes']=_0xafb769[_0xc81d('0x50')][_0xc81d('0x62')]?_0xafb769[_0xc81d('0x50')]:_0x5b588b['model'];if(!_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x51')]('nolimit')){_0xafb769[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x29')]);_0xafb769[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0xb164c4[_0xc81d('0x4b')]['offset']);}_0xafb769['order']=qs[_0xc81d('0x53')](_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x53')]);_0xafb769[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0xb164c4[_0xc81d('0x4b')],_0x5b588b[_0xc81d('0x4d')]));_0xafb769[_0xc81d('0x54')][_0xc81d('0x6c')]=_0x41d63f['id'];if(_0xb164c4[_0xc81d('0x4b')]['filter']){_0xafb769[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0xafb769['where'],{'$or':_[_0xc81d('0x48')](_0xafb769[_0xc81d('0x50')],function(_0x545db4){var _0x5c8b17={};_0x5c8b17[_0x545db4]={'$like':'%'+_0xb164c4[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0x5c8b17;})});}_0xafb769=_['merge']({},_0xafb769,_0xb164c4[_0xc81d('0x59')]);return db[_0xc81d('0x6d')][_0xc81d('0x2a')]({'where':_0xafb769[_0xc81d('0x54')]})['then'](function(_0xc2a165){_0x501191[_0xc81d('0x2a')]=_0xc2a165;if(_0xb164c4[_0xc81d('0x4b')]['includeAll']){_0xafb769[_0xc81d('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xc81d('0x5c')](_0xafb769);})[_0xc81d('0x18')](function(_0x4b8a88){_0x501191[_0xc81d('0x5d')]=_0x4b8a88;return _0x501191;});}})[_0xc81d('0x18')](respondWithFilteredResult(_0x14ebca,_0xafb769))[_0xc81d('0x22')](handleError(_0x14ebca,null));};exports[_0xc81d('0x6f')]=function(_0x5759c0,_0x178e4c){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x5759c0['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x178e4c,null))[_0xc81d('0x18')](function(_0x13b60f){if(_0x13b60f){return _0x13b60f[_0xc81d('0x6f')](_0x5759c0[_0xc81d('0x4b')][_0xc81d('0x70')]);}})[_0xc81d('0x18')](respondWithStatusCode(_0x178e4c,null))[_0xc81d('0x22')](handleError(_0x178e4c,null));};exports['addAnswer']=function(_0x2ba75c,_0x122da5){if(_0x2ba75c[_0xc81d('0x64')]['id']){delete _0x2ba75c[_0xc81d('0x64')]['id'];}return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x2ba75c[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x122da5,null))[_0xc81d('0x18')](function(_0x11711e){if(_0x11711e){_0x2ba75c[_0xc81d('0x64')][_0xc81d('0x6c')]=_0x11711e['id'];return db[_0xc81d('0x71')]['create'](_0x2ba75c[_0xc81d('0x64')]);}})[_0xc81d('0x18')](respondWithResult(_0x122da5,null))['catch'](handleError(_0x122da5,null));};exports['getAnswers']=function(_0x5b422a,_0x5711f2){var _0x3ea02a={'raw':![],'where':{}};var _0x301911={};var _0x528b55={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0x5b422a[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x5711f2,null))['then'](function(_0x3c4d3a){if(_0x3c4d3a){_0x301911[_0xc81d('0x41')]=_[_0xc81d('0x4c')](db[_0xc81d('0x71')][_0xc81d('0x61')]);_0x301911['query']=_[_0xc81d('0x4c')](_0x5b422a[_0xc81d('0x4b')]);_0x301911[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x301911[_0xc81d('0x41')],_0x301911[_0xc81d('0x4b')]);_0x3ea02a[_0xc81d('0x50')]=_['intersection'](_0x301911[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x3ea02a[_0xc81d('0x50')]=_0x3ea02a['attributes'][_0xc81d('0x62')]?_0x3ea02a[_0xc81d('0x50')]:_0x301911['model'];if(!_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x3ea02a[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x5b422a['query'][_0xc81d('0x29')]);_0x3ea02a[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x27')]);}_0x3ea02a[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x3ea02a[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x5b422a[_0xc81d('0x4b')],_0x301911[_0xc81d('0x4d')]));_0x3ea02a[_0xc81d('0x54')]['ChatWebsiteId']=_0x3c4d3a['id'];if(_0x5b422a[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x3ea02a[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x3ea02a['where'],{'$or':_[_0xc81d('0x48')](_0x3ea02a['attributes'],function(_0x4796e1){var _0x5ac618={};_0x5ac618[_0x4796e1]={'$like':'%'+_0x5b422a['query'][_0xc81d('0x56')]+'%'};return _0x5ac618;})});}_0x3ea02a=_[_0xc81d('0x57')]({},_0x3ea02a,_0x5b422a[_0xc81d('0x59')]);return db[_0xc81d('0x71')]['count']({'where':_0x3ea02a[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x34b5aa){_0x528b55[_0xc81d('0x2a')]=_0x34b5aa;if(_0x5b422a['query'][_0xc81d('0x5a')]){_0x3ea02a['include']=[{'all':!![]}];}return db[_0xc81d('0x71')][_0xc81d('0x5c')](_0x3ea02a);})['then'](function(_0xb3f5e0){_0x528b55[_0xc81d('0x5d')]=_0xb3f5e0;return _0x528b55;});}})[_0xc81d('0x18')](respondWithFilteredResult(_0x5711f2,_0x3ea02a))[_0xc81d('0x22')](handleError(_0x5711f2,null));};exports[_0xc81d('0x73')]=function(_0x1dded3,_0x4bf238){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x1dded3[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x4bf238,null))[_0xc81d('0x18')](function(_0x392cdf){if(_0x392cdf){return _0x392cdf[_0xc81d('0x73')](_0x1dded3[_0xc81d('0x4b')][_0xc81d('0x70')]);}})['then'](respondWithStatusCode(_0x4bf238,null))[_0xc81d('0x22')](handleError(_0x4bf238,null));};exports[_0xc81d('0x74')]=function(_0x1dfb3a,_0x27a61c){_0x1dfb3a['body']['sitepic']=_0x1dfb3a['file'][_0xc81d('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x1dfb3a[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x27a61c,null))[_0xc81d('0x18')](saveUpdates(_0x1dfb3a[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x27a61c,null))[_0xc81d('0x22')](handleError(_0x27a61c,null));};exports[_0xc81d('0x76')]=function(_0x28becc,_0x108a09){_0x28becc[_0xc81d('0x64')][_0xc81d('0x77')]=_0x28becc[_0xc81d('0x78')][_0xc81d('0x75')];return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x28becc[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x108a09,null))[_0xc81d('0x18')](saveUpdates(_0x28becc[_0xc81d('0x64')],null))['then'](respondWithResult(_0x108a09,null))['catch'](handleError(_0x108a09,null));};exports[_0xc81d('0x79')]=function(_0x5ab4cc,_0x2294bf){_0x5ab4cc[_0xc81d('0x64')][_0xc81d('0x7a')]=_0x5ab4cc['file'][_0xc81d('0x75')];return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x5ab4cc[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x2294bf,null))[_0xc81d('0x18')](saveUpdates(_0x5ab4cc[_0xc81d('0x64')],null))[_0xc81d('0x18')](respondWithResult(_0x2294bf,null))[_0xc81d('0x22')](handleError(_0x2294bf,null));};exports[_0xc81d('0x7b')]=function(_0x1a352f,_0x2d82dd){_0x1a352f[_0xc81d('0x64')][_0xc81d('0x7c')]=_0x1a352f[_0xc81d('0x78')][_0xc81d('0x75')];return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x1a352f[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2d82dd,null))[_0xc81d('0x18')](saveUpdates(_0x1a352f['body'],null))[_0xc81d('0x18')](respondWithResult(_0x2d82dd,null))['catch'](handleError(_0x2d82dd,null));};exports[_0xc81d('0x7d')]=function(_0x240294,_0x536477){var _0x4e8c89=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x80'));var _0xb7f045={'where':{'id':_0x240294['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x101fae=![];return require(_0xc81d('0x81'))[_0xc81d('0x82')]()[_0xc81d('0x18')](function(_0x4a37df){if(_0x4a37df){_0x101fae=_0x4a37df[_0xc81d('0x83')];}})['then'](function(){return db[_0xc81d('0x60')][_0xc81d('0x66')](_0xb7f045);})[_0xc81d('0x18')](handleEntityNotFound(_0x536477,null))[_0xc81d('0x18')](function(_0x27e696){if(_0x27e696){if(!_[_0xc81d('0x84')](_0x27e696[_0xc81d('0x85')])){if(fs[_0xc81d('0x86')](path['join'](config[_0xc81d('0x7f')],_0xc81d('0x87'),_0x27e696[_0xc81d('0x85')]))&&_0x101fae){_0x4e8c89=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x87'),_0x27e696[_0xc81d('0x85')]);}}return _0x536477[_0xc81d('0x88')](_0x4e8c89);}})[_0xc81d('0x22')](handleError(_0x536477,null));};exports[_0xc81d('0x89')]=function(_0x3c8c58,_0x4265a6){var _0x52270a=path['join'](config['root'],_0xc81d('0x8a'));var _0x3983d3={'where':{'id':_0x3c8c58[_0xc81d('0x5e')]['id']},'attributes':['id',_0xc81d('0x77')],'raw':!![]};return db['ChatWebsite']['find'](_0x3983d3)[_0xc81d('0x18')](handleEntityNotFound(_0x4265a6,null))['then'](function(_0x32f306){if(_0x32f306){if(!_[_0xc81d('0x84')](_0x32f306[_0xc81d('0x77')])){if(fs[_0xc81d('0x86')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x32f306[_0xc81d('0x77')]))){_0x52270a=path['join'](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x32f306[_0xc81d('0x77')]);}}return _0x4265a6['download'](_0x52270a);}})[_0xc81d('0x22')](handleError(_0x4265a6,null));};exports['getCustomerAvatar']=function(_0x50e6cd,_0x1bf038){var _0x4c9f9d=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2a0db8={'where':{'id':_0x50e6cd[_0xc81d('0x5e')]['id']},'attributes':['id',_0xc81d('0x7a'),_0xc81d('0x8c')],'raw':!![]};return db[_0xc81d('0x60')][_0xc81d('0x66')](_0x2a0db8)['then'](handleEntityNotFound(_0x1bf038,null))[_0xc81d('0x18')](function(_0x2e6520){if(_0x2e6520){if(!_[_0xc81d('0x84')](_0x2e6520[_0xc81d('0x7a')])){if(fs['existsSync'](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x2e6520[_0xc81d('0x7a')]))&&_0x2e6520['showCustomerAvatar']){_0x4c9f9d=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x8b'),_0x2e6520[_0xc81d('0x7a')]);}}return _0x1bf038[_0xc81d('0x88')](_0x4c9f9d);}})[_0xc81d('0x22')](handleError(_0x1bf038,null));};exports['getSystemAvatar']=function(_0x8e301a,_0x17464d){var _0x28fc75=path[_0xc81d('0x7e')](config['root'],_0xc81d('0x8d'));var _0xfd2beb={'where':{'id':_0x8e301a[_0xc81d('0x5e')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc81d('0x66')](_0xfd2beb)[_0xc81d('0x18')](handleEntityNotFound(_0x17464d,null))[_0xc81d('0x18')](function(_0x316fc0){if(_0x316fc0){if(!_[_0xc81d('0x84')](_0x316fc0[_0xc81d('0x7c')])){if(fs[_0xc81d('0x86')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server/files/images/avatars/',_0x316fc0[_0xc81d('0x7c')]))){_0x28fc75=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0x8b'),_0x316fc0[_0xc81d('0x7c')]);}}return _0x17464d[_0xc81d('0x88')](_0x28fc75);}})[_0xc81d('0x22')](handleError(_0x17464d,null));};exports[_0xc81d('0x8e')]=function(_0x2d9088,_0x2eb15a){var _0x20ee4f={'body':_0x2d9088[_0xc81d('0x64')],'channel':'chat'};var _0x4a1cf5=[];var _0x390851=[];var _0x344b56={};var _0x572812=![];if(_0x2d9088[_0xc81d('0x64')]['id']){delete _0x2d9088[_0xc81d('0x64')]['id'];}if(_[_0xc81d('0x84')](_0x2d9088['body'][_0xc81d('0x8f')])){throw new APIBadRequestError(_0xc81d('0x90'));}if(_['isNil'](_0x2d9088['body'][_0xc81d('0x91')])){throw new APIBadRequestError(_0xc81d('0x92'));}if(_[_0xc81d('0x93')](_0x2d9088[_0xc81d('0x64')][_0xc81d('0x64')])){throw new APIBadRequestError(_0xc81d('0x94'));}return db[_0xc81d('0x95')][_0xc81d('0x6a')]()['then'](function(_0x22a76e){if(!_0x22a76e){throw new Error('No\x20available\x20attributes');}_0x4a1cf5=Object[_0xc81d('0x4c')](_0x22a76e)[_0xc81d('0x56')](function(_0x298df6){return![_0xc81d('0x96'),_0xc81d('0x97')][_0xc81d('0x98')](_0x298df6);});_0x390851=Object[_0xc81d('0x4c')](_0x22a76e)[_0xc81d('0x56')](function(_0x5480f4){return!['createdAt',_0xc81d('0x97'),_0xc81d('0x99'),_0xc81d('0x9a')][_0xc81d('0x98')](_0x5480f4);});if(!_[_0xc81d('0x98')](_0x390851,_0x2d9088[_0xc81d('0x64')]['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x390851['join'](',\x20'));}_0x344b56[_0x2d9088[_0xc81d('0x64')][_0xc81d('0x91')]]=_0x2d9088['body'][_0xc81d('0x8f')];})[_0xc81d('0x18')](function(){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x2d9088[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x9b')],'as':'List','include':[{'model':db[_0xc81d('0x95')],'as':_0xc81d('0x9c'),'where':_0x344b56,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc81d('0x9d')],'as':_0xc81d('0x9e')},{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0x9f'),'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0xa0'),'attributes':['id',_0xc81d('0xa1')],'raw':!![]}]}]});})[_0xc81d('0x18')](function(_0x4ebc67){if(!_0x4ebc67){throw new APINotFoundError(util['format'](_0xc81d('0xa2'),_0x2d9088[_0xc81d('0x5e')]['id']));}var _0x18780c=_0x4ebc67[_0xc81d('0x9f')];if(_0x18780c){var _0x1dbec7=_0x4ebc67[_0xc81d('0xa3')]||undefined;return _0x18780c['ifTime'](_0x1dbec7)[_0xc81d('0x18')](function(_0x2f9942){if(!_0x2f9942){throw new APIOutOfIntervalError();}return _0x4ebc67;});}else{return _0x4ebc67;}})['then'](function(_0x5a827a){if(!_0x5a827a[_0xc81d('0xa4')]){return;}_0x20ee4f['account']=_0x5a827a;_0x20ee4f[_0xc81d('0xa5')]=_0x5a827a['List'];_0x20ee4f[_0xc81d('0xa6')]=_[_0xc81d('0xa7')](_0x5a827a[_0xc81d('0x9e')],[_0xc81d('0xa8')],[_0xc81d('0xa9')]);if(_0x20ee4f[_0xc81d('0xaa')]['Applications']){delete _0x20ee4f[_0xc81d('0xaa')][_0xc81d('0x9e')];}if(_0x20ee4f[_0xc81d('0xaa')][_0xc81d('0xa4')]&&_0x20ee4f[_0xc81d('0xaa')][_0xc81d('0xa4')][_0xc81d('0x9c')][_0xc81d('0x62')]){return _0x20ee4f[_0xc81d('0xaa')]['List']['Contacts'][0x0];}var _0x4024a3=_[_0xc81d('0x11')](_0x2d9088[_0xc81d('0x64')],{'firstName':_0x2d9088[_0xc81d('0x64')][_0xc81d('0x8f')],'ListId':_0x5a827a[_0xc81d('0x9a')]});_0x4024a3[_0x2d9088[_0xc81d('0x64')]['mapKey']]=_0x2d9088[_0xc81d('0x64')]['from'];return db[_0xc81d('0x95')][_0xc81d('0x63')](_0x4024a3,{'fields':_0x4a1cf5,'raw':!![]});})[_0xc81d('0x18')](function(_0x4a7741){_0x20ee4f[_0xc81d('0xab')]=_0x4a7741;var _0x48fc07=createInteractionObject(_0x2d9088[_0xc81d('0x5e')]['id'],_0x2d9088[_0xc81d('0x64')],_0x2d9088[_0xc81d('0xac')],_0x4a7741);var _0x4dc643={'ChatWebsiteId':_0x2d9088['params']['id'],'closed':![]};if(_0x2d9088[_0xc81d('0x64')]['threadId']){_0x4dc643[_0xc81d('0xad')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')];return db[_0xc81d('0xae')][_0xc81d('0x66')]({'where':_0x4dc643})[_0xc81d('0x18')](function(_0x197d52){if(_0x197d52){_0x572812=!![];return _0x197d52;}_0x48fc07[_0xc81d('0xad')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')];_0x48fc07[_0xc81d('0xaf')]=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xaf')];return db['ChatInteraction'][_0xc81d('0x63')](_0x48fc07);});}_0x4dc643[_0xc81d('0xb0')]=_0x4a7741['id'];if(_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]&&_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]['id']){_0x4dc643['id']=_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb1')]['id'];return db[_0xc81d('0xae')][_0xc81d('0x66')]({'where':_0x4dc643})[_0xc81d('0x18')](function(_0x35b785){if(_0x35b785){_0x572812=!![];return _0x35b785;}return db['ChatInteraction'][_0xc81d('0x63')](_0x48fc07);});}return db[_0xc81d('0xae')][_0xc81d('0x63')](_0x48fc07);})[_0xc81d('0x18')](function(_0x184609){if(!_0x572812){return _0x184609;}var _0x2c6c70={'from':(_0x20ee4f[_0xc81d('0xab')][_0xc81d('0xb2')]||'')+'\x20'+(_0x20ee4f['contact'][_0xc81d('0x39')]||'')};if(_0x2d9088[_0xc81d('0x64')]['threadId']&&_0x2d9088['body'][_0xc81d('0xb3')]&&_0x2d9088[_0xc81d('0x64')][_0xc81d('0xad')]!=_0x2d9088['body'][_0xc81d('0xb3')]){_0x2c6c70[_0xc81d('0xad')]=_0x2d9088['body'][_0xc81d('0xb3')];}return _0x184609[_0xc81d('0x2c')](_0x2c6c70);})[_0xc81d('0x18')](function(_0x28b397){_0x20ee4f[_0xc81d('0xb1')]=_0x28b397['get']({'plain':!![]});_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xb4')]=!_0x572812;if(_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xb4')]){if(_0x20ee4f['account'][_0xc81d('0xb5')]){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xb6')]({'id':0x0,'priority':_0x20ee4f['applications'][_0xc81d('0x62')]+0x1,'app':_0xc81d('0xb7'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xc81d('0xb8')][_0xc81d('0x63')]({'body':_0x2d9088['body']['body'],'ChatWebsiteId':_0x2d9088[_0xc81d('0x5e')]['id'],'ChatInteractionId':_0x28b397['id'],'direction':'in','ContactId':_0x20ee4f[_0xc81d('0xab')]['id'],'AttachmentId':_0x2d9088[_0xc81d('0x64')][_0xc81d('0xb9')]});})[_0xc81d('0x18')](function(_0x1394a4){_0x20ee4f[_0xc81d('0x21')]=_0x1394a4;if(!_0x20ee4f[_0xc81d('0xb1')][_0xc81d('0xba')]){return;}return db[_0xc81d('0xbb')][_0xc81d('0x66')]({'attributes':['id',_0xc81d('0x3e')],'where':{'id':_0x20ee4f['interaction']['UserId']}});})[_0xc81d('0x18')](function(_0x1cc3e2){if(_0x1cc3e2){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xbc')]({'id':0x0,'priority':0x0,'app':_0xc81d('0xbd'),'appdata':_0x1cc3e2[_0xc81d('0x3e')]+','+(_0x20ee4f[_0xc81d('0xaa')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x20ee4f[_0xc81d('0xbe')]=!![];}if(!_0x20ee4f['interaction']['queueId']){return;}return db[_0xc81d('0xbf')][_0xc81d('0x66')]({'attributes':['id',_0xc81d('0x3e')],'where':{'id':_0x20ee4f['interaction'][_0xc81d('0xc0')]}});})[_0xc81d('0x18')](function(_0xe42b6c){if(_0xe42b6c){_0x20ee4f[_0xc81d('0xa6')][_0xc81d('0xbc')]({'id':0x0,'priority':0x1,'app':_0xc81d('0xc1'),'appdata':_0xe42b6c[_0xc81d('0x3e')]+','+(_0x20ee4f[_0xc81d('0xaa')]['waitForTheAssignedQueue']||0x12c),'interval':_0xc81d('0xc2')});}return respondWithRpcPromise(_0xc81d('0xc3'),_0xc81d('0xc4'),_0x20ee4f);})[_0xc81d('0x18')](function(_0x2a0e60){respondWithRpcPromise(_0xc81d('0xc5'),_0xc81d('0xc5'),{'event':_0xc81d('0x8e'),'message':_0x2a0e60},client9002);return _0x2a0e60;})['then'](respondWithResult(_0x2eb15a,null))[_0xc81d('0x22')](APIHandleError(_0x2eb15a));};exports[_0xc81d('0xc6')]=function(_0x3d6804,_0x5a9d5a){var _0x1799d7,_0x51f639,_0x4e7320;var _0x502443=[];var _0x5a88fd={};var _0xd87f0d=_0x3d6804[_0xc81d('0xc7')]||[];var _0x2407db=[];var _0x21c939;return db[_0xc81d('0x95')][_0xc81d('0x6a')]()[_0xc81d('0x18')](function(_0x586728){if(!_0x586728){throw new db['Sequelize']['ValidationError'](_0xc81d('0xc8'));}_0x502443=_[_0xc81d('0xc9')](_[_0xc81d('0x4c')](_0x586728),[_0xc81d('0x96'),_0xc81d('0x97'),_0xc81d('0x99'),_0xc81d('0x9a')]);if(_0x3d6804[_0xc81d('0x64')]['id']){delete _0x3d6804[_0xc81d('0x64')]['id'];}if(_[_0xc81d('0x84')](_0x3d6804['body'][_0xc81d('0x8f')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)['send'](new db[(_0xc81d('0xca'))][(_0xc81d('0xcb'))](_0xc81d('0xcc')));}if(_[_0xc81d('0x84')](_0x3d6804['body'][_0xc81d('0x64')])||_0x3d6804['body'][_0xc81d('0x64')]===''){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db['Sequelize'][(_0xc81d('0xcb'))](_0xc81d('0xcd')));}if(_[_0xc81d('0x84')](_0x3d6804[_0xc81d('0x64')][_0xc81d('0xce')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db[(_0xc81d('0xca'))][(_0xc81d('0xcb'))](_0xc81d('0xcf')+_0x502443));}if(!_[_0xc81d('0x98')](_0x502443,_0x3d6804['body'][_0xc81d('0xce')])){throw _0x5a9d5a[_0xc81d('0x24')](0x1f4)[_0xc81d('0x31')](new db['Sequelize'][(_0xc81d('0xcb'))](_0xc81d('0xd0')+_0x502443));}_0x5a88fd[_0x3d6804['body'][_0xc81d('0xce')]]=_0x3d6804['body']['from'];})[_0xc81d('0x18')](function(){return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x3d6804['params']['id']},'include':[{'model':db['CmList'],'as':_0xc81d('0xa4')},{'model':db['MailAccount'],'as':_0xc81d('0xd1')}]});})[_0xc81d('0x18')](handleEntityNotFound(_0x5a9d5a,null))[_0xc81d('0x18')](function(_0x68ecd3){if(_0x68ecd3&&_0x68ecd3[_0xc81d('0xa4')]){_0x51f639=_0x68ecd3;var _0xde2730=_[_0xc81d('0x11')](_0x3d6804[_0xc81d('0x64')],{'firstName':_0x3d6804['body'][_0xc81d('0x8f')],'phone':_0x3d6804[_0xc81d('0x64')][_0xc81d('0x8f')],'ListId':_0x68ecd3['ListId']});_0xde2730[_0x3d6804['body']['mapKeyOffline']]=_0x3d6804['body'][_0xc81d('0x8f')];return db['CmContact'][_0xc81d('0xd2')]({'where':_0x5a88fd,'defaults':_0xde2730});}})['spread'](function(_0x3a5452){if(_0x3a5452){_0x4e7320=_0x3a5452;var _0x42d39e=fs['readFileSync'](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],_0xc81d('0xd3')),_0xc81d('0xd4'));var _0x2713ee=ejs[_0xc81d('0xd5')](_0x42d39e,{'body':_[_0xc81d('0xd6')](_0x3d6804[_0xc81d('0x64')][_0xc81d('0x64')]),'bodyTitle':_0x51f639[_0xc81d('0xd7')]});return db[_0xc81d('0xd8')]['create']({'body':_0x2713ee,'plainBody':htmlToText[_0xc81d('0xd9')](_0x2713ee),'ContactId':_0x3a5452['id'],'ChatWebsiteId':_0x51f639['id']});}})['then'](function(_0x3890f0){_0x21c939=_0x3890f0;if(_0xd87f0d['length']){var _0x40a060=_0xd87f0d['map'](function(_0x3b98b5){return{'name':_0x3b98b5[_0xc81d('0xda')],'basename':_0x3b98b5[_0xc81d('0x75')],'type':_0x3b98b5[_0xc81d('0xdb')],'ChatOfflineMessageId':_0x3890f0['id']};});_0x2407db=_0x40a060[_0xc81d('0x48')](_0x48a84f=>{var _0x13aba0={'filename':_0x48a84f[_0xc81d('0x3e')],'path':path[_0xc81d('0x7e')](config['root'],_0xc81d('0xdc'),_0xc81d('0xc7'),_0xc81d('0xdd'),_0xc81d('0xde'),_0x48a84f[_0xc81d('0xdf')])};return _0x13aba0;});if(!_0x51f639[_0xc81d('0xe0')]){return db[_0xc81d('0xe1')][_0xc81d('0xe2')](function(_0x292154){return db[_0xc81d('0xe3')]['bulkCreate'](_0x40a060,{'transaction':_0x292154});});}}})[_0xc81d('0x18')](function(){if(_0x21c939){_0x1799d7=_0x21c939;return db[_0xc81d('0xd1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc81d('0xe4')],'as':_0xc81d('0xe5'),'raw':!![],'include':[{'model':db[_0xc81d('0xe6')],'as':_0xc81d('0xe6'),'raw':!![]}]}]});}})[_0xc81d('0x18')](function(_0x19c60c){if(_0x19c60c&&_0x19c60c[_0xc81d('0xe5')]&&_0x51f639[_0xc81d('0xe7')]&&_0x51f639['forwardOfflineAddress']){var _0x2a2f42=_0x19c60c[_0xc81d('0xe8')]();return respondWithRpcPromise(_0xc81d('0xe9'),'sendMail',{'account':_0x2a2f42,'message':{'from':util[_0xc81d('0x42')](_0xc81d('0xea'),_0x19c60c[_0xc81d('0x3e')],_0x19c60c[_0xc81d('0xeb')]||_0x19c60c[_0xc81d('0xe5')][_0xc81d('0xec')]),'to':_0x51f639[_0xc81d('0xed')],'subject':_0x51f639['offlineMessageSubject'],'html':_0x1799d7[_0xc81d('0x64')],'attachments':_0x2407db}},client9003)[_0xc81d('0x18')](function(){return _0x1799d7;})['catch'](function(_0x156da3){logger['error'](_0x156da3);});}})[_0xc81d('0x18')](function(){if(_0x51f639&&_0x51f639['openNewInteraction']&&_0x51f639[_0xc81d('0xee')]){var _0x1232a3=[];if(_0xd87f0d[_0xc81d('0x62')]){_0x1232a3=_0xd87f0d[_0xc81d('0x48')](function(_0x1b4ef4){return{'name':_0x1b4ef4[_0xc81d('0xda')],'basename':_0x1b4ef4['filename'],'type':_0x1b4ef4[_0xc81d('0xdb')],'ChatOfflineMessageId':_0x21c939['id']};});}var _0x29350e;if(!_[_0xc81d('0x84')](_0x51f639['subjectOffline'])){var _0x2755c2=_[_0xc81d('0x48')](_0x3d6804[_0xc81d('0x64')],function(_0x40c638){return _0x40c638;});var _0x29d387=_[_0xc81d('0xef')](_0x2755c2)[0x0];var _0xf5cadf=_[_0xc81d('0xf0')](_0x29d387,function(_0x2f0773){return _0x2f0773;});_0x29350e=_0xf5cadf[0x1][_0x51f639[_0xc81d('0xf1')]];}var _0x1f674c={'from':_0x4e7320[_0xc81d('0xeb')],'firstName':_0x4e7320[_0xc81d('0xb2')],'lastName':_0x4e7320[_0xc81d('0x39')],'mapKey':'email','message':{'from':_0x4e7320[_0xc81d('0xeb')],'to':_0x51f639[_0xc81d('0xd1')][_0xc81d('0xeb')],'cc':'','subject':_[_0xc81d('0x84')](_0x29350e)?_0x51f639[_0xc81d('0xf2')]:_0x29350e,'messageId':'','sentAt':new Date(),'attach':_0x1232a3['length'],'attachments':_0x1232a3,'originChannel':'Chat','ChatWebsiteId':_0x51f639['id'],'ChatOfflineMessageId':_0x1799d7['id'],'originTo':_0x51f639[_0xc81d('0xd1')][_0xc81d('0xeb')]},'body':_0x1799d7[_0xc81d('0x64')]};var _0x697a4c={'account':{'id':_0x51f639[_0xc81d('0xee')]},'body':_0x1f674c,'log':_0xc81d('0xf3')};return respondWithRpcPromise(_0xc81d('0xf3'),'notifyMail',_0x697a4c,client9001)[_0xc81d('0x18')](function(){return _0x1799d7;})[_0xc81d('0x22')](function(_0x34b87f){logger[_0xc81d('0x20')](_0x34b87f);});}return;})['then'](function(){if(_0x1799d7){return _0x1799d7;}})[_0xc81d('0x18')](respondWithResult(_0x5a9d5a,null))['catch'](function(){for(var _0x1d1440 of _0xd87f0d){var _0x3f6bd3=path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server',_0xc81d('0xc7'),_0xc81d('0xdd'),'offline-chat',_0x1d1440[_0xc81d('0x75')]);fs_extra[_0xc81d('0xf4')](_0x3f6bd3)[_0xc81d('0x22')](function(_0x3dbd3b){logger[_0xc81d('0x20')](_0xc81d('0xf5'),_0x3f6bd3,_0x3dbd3b);});}});};exports[_0xc81d('0xf6')]=function(_0x4b6a83,_0x5b3aa1){return db['ChatInteraction'][_0xc81d('0x66')]({'where':{'id':_0x4b6a83[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5b3aa1,null))[_0xc81d('0x18')](function(_0x366897){if(_0x366897){return _0x366897[_0xc81d('0xf6')](_0x4b6a83['body'][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x4b6a83[_0xc81d('0x64')],[_0xc81d('0x70'),'id'])||{});}})['then'](respondWithResult(_0x5b3aa1,null))[_0xc81d('0x22')](handleError(_0x5b3aa1,null));};exports['getInteractions']=function(_0x534a1e,_0x4e0f1c){var _0x9d3fcd={'raw':![],'where':{}};var _0x59e421={};var _0x1b7d3f={'count':0x0,'rows':[]};return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0x534a1e['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x4e0f1c,null))[_0xc81d('0x18')](function(_0x487583){if(_0x487583){_0x59e421[_0xc81d('0x41')]=_['keys'](db['ChatInteraction'][_0xc81d('0x61')]);_0x59e421[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x534a1e[_0xc81d('0x4b')]);_0x59e421[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x59e421[_0xc81d('0x41')],_0x59e421[_0xc81d('0x4b')]);_0x9d3fcd[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x59e421['model'],qs[_0xc81d('0x4f')](_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x9d3fcd[_0xc81d('0x50')]=_0x9d3fcd[_0xc81d('0x50')]['length']?_0x9d3fcd['attributes']:_0x59e421[_0xc81d('0x41')];if(!_0x534a1e[_0xc81d('0x4b')]['hasOwnProperty']('nolimit')){_0x9d3fcd[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x534a1e[_0xc81d('0x4b')]['limit']);_0x9d3fcd['offset']=qs[_0xc81d('0x27')](_0x534a1e[_0xc81d('0x4b')]['offset']);}_0x9d3fcd[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x9d3fcd['where']=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x534a1e[_0xc81d('0x4b')],_0x59e421[_0xc81d('0x4d')]));_0x9d3fcd['where'][_0xc81d('0x6c')]=_0x487583['id'];if(_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x9d3fcd['where']=_['merge'](_0x9d3fcd[_0xc81d('0x54')],{'$or':_['map'](_0x9d3fcd[_0xc81d('0x50')],function(_0x540fec){var _0x300ff6={};_0x300ff6[_0x540fec]={'$like':'%'+_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0x300ff6;})});}_0x9d3fcd=_['merge']({},_0x9d3fcd,_0x534a1e[_0xc81d('0x59')]);return db[_0xc81d('0xae')][_0xc81d('0x2a')]({'where':_0x9d3fcd[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x97188){_0x1b7d3f[_0xc81d('0x2a')]=_0x97188;if(_0x534a1e[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x9d3fcd['include']=[{'model':db['CmContact'],'as':_0xc81d('0xf8'),'required':![]},{'model':db[_0xc81d('0xbb')],'as':'Owner','attributes':['name','fullname',_0xc81d('0xf9')],'required':![]},{'model':db[_0xc81d('0xfa')],'as':_0xc81d('0xfb'),'attributes':['id',_0xc81d('0x3e'),_0xc81d('0xfc')],'where':_0x534a1e['query'][_0xc81d('0xfd')]?{'id':_0x534a1e[_0xc81d('0x4b')][_0xc81d('0xfd')]}:undefined,'required':_0x534a1e[_0xc81d('0x4b')]['tag']?!![]:![]}];}return db[_0xc81d('0xae')]['findAll'](_0x9d3fcd);})['then'](function(_0x2c5d2c){_0x1b7d3f[_0xc81d('0x5d')]=_0x2c5d2c;return _0x1b7d3f;});}})['then'](respondWithFilteredResult(_0x4e0f1c,_0x9d3fcd))[_0xc81d('0x22')](handleError(_0x4e0f1c,null));};exports[_0xc81d('0xfe')]=function(_0x2724ee,_0x3b6af0){var _0x355fff=0x0;var _0x5d7cc2=0x0;var _0x372995=![];var _0x104a72;var _0x3323c8;return db[_0xc81d('0x60')][_0xc81d('0x66')]({'where':{'id':_0x2724ee[_0xc81d('0x5e')]['id']},'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0x9f'),'include':[{'model':db[_0xc81d('0x9f')],'as':_0xc81d('0xa0'),'attributes':['id',_0xc81d('0xa1')]}]}]})['then'](handleEntityNotFound(_0x3b6af0,null))[_0xc81d('0x18')](function(_0x259191){if(_0x259191){_0x104a72=_0x259191;return _0x259191[_0xc81d('0xff')]({'raw':!![]});}})['then'](function(_0x57bbbb){if(_0x104a72){if(_0x57bbbb){_0x3323c8=_0x57bbbb;}}return require(_0xc81d('0x81'))['getLicense']();})[_0xc81d('0x18')](function(_0x3671ba){if(_0x3671ba){_0x5d7cc2=_0x3671ba['virtual'];_0x372995=_0x3671ba['custom'];}})['then'](function(){return db[_0xc81d('0xae')][_0xc81d('0x2a')]({'where':{'closed':![]}});})[_0xc81d('0x18')](function(_0x34819f){_0x355fff=_0x34819f;if(_0x5d7cc2&&_0x34819f>_0x5d7cc2){return db[_0xc81d('0x100')][_0xc81d('0x101')]({'where':{'id':0x1}})['then'](function(_0xe61322){if(_0xe61322){_0xe61322[_0xc81d('0x102')](_0xc81d('0x103'));}});}})[_0xc81d('0x18')](function(){var _0x36716e=_0x104a72[_0xc81d('0x9f')];var _0x33e665=_0x104a72[_0xc81d('0xa3')]||undefined;return _0x36716e?_0x36716e[_0xc81d('0x104')](_0x33e665):!![];})[_0xc81d('0x18')](function(_0x4fc108){var _0x5524bc=fs[_0xc81d('0x105')](path[_0xc81d('0x7e')](config[_0xc81d('0x7f')],'server/files/chat/iframe.ejs'),'utf8');var _0x391123=new url[(_0xc81d('0x106'))](_0x104a72[_0xc81d('0x107')])[_0xc81d('0x108')];var _0x2d47c0=_0xc81d('0x109');var _0x3bc9eb=![];var _0x4124c7={'chatVersion':_0x2d47c0,'chatWebsiteAddressOrigin':_0x391123,'remote':_0x104a72[_0xc81d('0x10a')],'query':querystring[_0xc81d('0x1e')](_[_0xc81d('0x57')](_0x104a72[_0xc81d('0x2e')]({'plain':!![]}),{'customerIp':_0x2724ee['headers']['x-forwarded-for']||_0x2724ee[_0xc81d('0xac')][_0xc81d('0x10b')]||_0x2724ee[_0xc81d('0x10c')][_0xc81d('0x10d')]||_0x2724ee['ip'],'referer':_0x2724ee[_0xc81d('0xac')][_0xc81d('0x3b')],'openedInteractions':_0x355fff,'maxInteractions':_0x5d7cc2,'virtual':_0x372995[_0xc81d('0x10e')],'online':_0x4fc108,'custom':_0x372995}))[_0xc81d('0x10f')](/'/g,'\x5c\x27')};_0x3b6af0[_0xc81d('0x31')](ejs[_0xc81d('0xd5')](Mustache[_0xc81d('0xd5')](_0x5524bc,_0x4124c7),{'proactiveActions':_0x3323c8,'alignment':_0x104a72[_0xc81d('0x110')],'verticalAlignment':_0x104a72[_0xc81d('0x111')],'div_color':_0x104a72['color'],'labelText':_0x104a72[_0xc81d('0x112')],'text_color':_0x104a72[_0xc81d('0x113')],'text_button_color':_0x104a72[_0xc81d('0x114')],'button_color':_0x104a72[_0xc81d('0x115')],'background_color':_0x104a72[_0xc81d('0x116')],'hideWhenOffline':_0x104a72[_0xc81d('0x117')],'intervalId':_0x104a72[_0xc81d('0x118')],'isDevelopment':_0x3bc9eb,'chatVersion':_0x2d47c0}));})[_0xc81d('0x22')](handleError(_0x3b6af0,null));};exports['addApplications']=function(_0x2a6c67,_0x1273b2){var _0x58d6f2=_0x2a6c67[_0xc81d('0x5e')]['id'];var _0x17ecc7=_0x2a6c67['body'];var _0x385ccd=0xc8;var _0x36ab63=null;return db[_0xc81d('0xe1')]['transaction']({'isolationLevel':db['sequelize'][_0xc81d('0x119')][_0xc81d('0x11a')][_0xc81d('0x11b')]},function(_0x2255db){return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x58d6f2},'transaction':_0x2255db})[_0xc81d('0x18')](function(_0x45349d){if(_0x45349d){return db[_0xc81d('0x9d')][_0xc81d('0x2d')]({'where':{'ChatWebsiteId':_0x58d6f2},'transaction':_0x2255db})[_0xc81d('0x18')](function(){var _0x51e936=_[_0xc81d('0x48')](_0x17ecc7,function(_0x22090e){_0x22090e[_0xc81d('0x6c')]=_0x58d6f2;return _0x22090e;});return db[_0xc81d('0x9d')][_0xc81d('0x11c')](_0x51e936,{'transaction':_0x2255db});});}else{_0x385ccd=0x194;_0x36ab63=[];}});})[_0xc81d('0x18')](function(){if(_0x385ccd!==0x194){return db[_0xc81d('0x9d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x58d6f2},'order':'priority'})[_0xc81d('0x18')](function(_0xd9d900){_0x36ab63=_0xd9d900;});}})[_0xc81d('0x22')](function(_0x3c54c8){_0x385ccd=0x1f4;logger[_0xc81d('0x20')](_0x3c54c8['stack']);if(_0x3c54c8[_0xc81d('0x3e')]){delete _0x3c54c8[_0xc81d('0x3e')];}_0x36ab63=_0x3c54c8;})[_0xc81d('0x11d')](function(){if(_0x36ab63===null){_0x1273b2[_0xc81d('0x23')](_0x385ccd);}else{if(_0x385ccd===0x1f4){_0x1273b2[_0xc81d('0x24')](_0x385ccd)[_0xc81d('0x31')](_0x36ab63);}else{_0x1273b2['status'](_0x385ccd)[_0xc81d('0x26')](_0x36ab63);}}});};exports['getApplications']=function(_0xdcd67b,_0x3bcda0){var _0x3cc2f3={};var _0x426e63={};var _0x3228f3;var _0x327ead;return db[_0xc81d('0x60')]['findOne']({'where':{'id':_0xdcd67b['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x3bcda0,null))['then'](function(_0x393de6){if(_0x393de6){_0x3228f3=_0x393de6;_0x426e63['model']=_[_0xc81d('0x4c')](db[_0xc81d('0x9d')][_0xc81d('0x61')]);_0x426e63[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0xdcd67b[_0xc81d('0x4b')]);_0x426e63[_0xc81d('0x4d')]=_['intersection'](_0x426e63[_0xc81d('0x41')],_0x426e63['query']);_0x3cc2f3[_0xc81d('0x50')]=_['intersection'](_0x426e63[_0xc81d('0x41')],qs[_0xc81d('0x4f')](_0xdcd67b[_0xc81d('0x4b')]['fields']));_0x3cc2f3[_0xc81d('0x50')]=_0x3cc2f3[_0xc81d('0x50')][_0xc81d('0x62')]?_0x3cc2f3[_0xc81d('0x50')]:_0x426e63['model'];_0x3cc2f3[_0xc81d('0x72')]=qs['sort'](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x3cc2f3[_0xc81d('0x54')]=qs['filters'](_[_0xc81d('0x55')](_0xdcd67b['query'],_0x426e63[_0xc81d('0x4d')]));if(_0xdcd67b[_0xc81d('0x4b')]['filter']){_0x3cc2f3[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x3cc2f3[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x3cc2f3[_0xc81d('0x50')],function(_0xf2e010){var _0xa0e89d={};_0xa0e89d[_0xf2e010]={'$like':'%'+_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x56')]+'%'};return _0xa0e89d;})});}_0x3cc2f3=_[_0xc81d('0x57')]({},_0x3cc2f3,_0xdcd67b[_0xc81d('0x59')]);return _0x3228f3[_0xc81d('0x11e')](_0x3cc2f3);}})['then'](function(_0x443e69){if(_0x443e69){_0x327ead=_0x443e69[_0xc81d('0x62')];if(!_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x3cc2f3[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x3cc2f3[_0xc81d('0x27')]=qs[_0xc81d('0x27')](_0xdcd67b[_0xc81d('0x4b')][_0xc81d('0x27')]);}return _0x3228f3[_0xc81d('0x11e')](_0x3cc2f3);}})[_0xc81d('0x18')](function(_0x5295d7){if(_0x5295d7){return _0x5295d7?{'count':_0x327ead,'rows':_0x5295d7}:null;}})[_0xc81d('0x18')](respondWithResult(_0x3bcda0,null))[_0xc81d('0x22')](handleError(_0x3bcda0,null));};exports['addProactiveActions']=function(_0x1a131d,_0x37318e){return db[_0xc81d('0x11f')][_0xc81d('0x66')]({'where':{'id':_0x1a131d[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x37318e,null))[_0xc81d('0x18')](function(_0x490b20){if(_0x490b20){return _0x490b20[_0xc81d('0x120')](_0x1a131d['body'][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x1a131d[_0xc81d('0x64')],['ids','id'])||{});}})['then'](respondWithResult(_0x37318e,null))['catch'](handleError(_0x37318e,null));};exports[_0xc81d('0xff')]=function(_0x3e4770,_0x144920){var _0x1c8584={};var _0x559411={};var _0x1d1ae6;var _0x4bd6ad;return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x3e4770[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x144920,null))[_0xc81d('0x18')](function(_0x401324){if(_0x401324){_0x1d1ae6=_0x401324;_0x559411['model']=_[_0xc81d('0x4c')](db[_0xc81d('0x121')][_0xc81d('0x61')]);_0x559411['query']=_[_0xc81d('0x4c')](_0x3e4770[_0xc81d('0x4b')]);_0x559411[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x559411[_0xc81d('0x41')],_0x559411['query']);_0x1c8584[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x559411[_0xc81d('0x41')],qs['fields'](_0x3e4770['query']['fields']));_0x1c8584[_0xc81d('0x50')]=_0x1c8584[_0xc81d('0x50')]['length']?_0x1c8584['attributes']:_0x559411['model'];_0x1c8584['order']=qs[_0xc81d('0x53')](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x53')]);_0x1c8584[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_[_0xc81d('0x55')](_0x3e4770[_0xc81d('0x4b')],_0x559411[_0xc81d('0x4d')]));if(_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x1c8584[_0xc81d('0x54')]=_[_0xc81d('0x57')](_0x1c8584[_0xc81d('0x54')],{'$or':_['map'](_0x1c8584[_0xc81d('0x50')],function(_0x5331aa){var _0x12fb34={};_0x12fb34[_0x5331aa]={'$like':'%'+_0x3e4770['query']['filter']+'%'};return _0x12fb34;})});}_0x1c8584=_[_0xc81d('0x57')]({},_0x1c8584,_0x3e4770[_0xc81d('0x59')]);return _0x1d1ae6[_0xc81d('0xff')](_0x1c8584);}})[_0xc81d('0x18')](function(_0x48c0cf){if(_0x48c0cf){_0x4bd6ad=_0x48c0cf[_0xc81d('0x62')];if(!_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x1c8584[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x1c8584['offset']=qs['offset'](_0x3e4770[_0xc81d('0x4b')][_0xc81d('0x27')]);}return _0x1d1ae6[_0xc81d('0xff')](_0x1c8584);}})['then'](function(_0x349388){if(_0x349388){return _0x349388?{'count':_0x4bd6ad,'rows':_0x349388}:null;}})[_0xc81d('0x18')](respondWithResult(_0x144920,null))[_0xc81d('0x22')](handleError(_0x144920,null));};exports[_0xc81d('0x122')]=function(_0x2ace7e,_0x57f7df){var _0x4113df=_0x2ace7e[_0xc81d('0x4b')]['online']===_0xc81d('0x123')?_0xc81d('0x124'):_0xc81d('0x125');return db['ChatWebsite'][_0xc81d('0x66')]({'attributes':['id',_0x4113df],'where':{'id':_0x2ace7e[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x57f7df,null))[_0xc81d('0x18')](function(_0x51735e){if(_0x51735e){var _0x1b06a1=_0x51735e[_0x4113df];var _0x5f158f=_0x1b06a1&&_0x1b06a1['items']?_0x1b06a1['items']:[];_0x57f7df[_0xc81d('0x31')]({'fromKey':_['isNil'](_0x1b06a1[_0xc81d('0x126')])?undefined:_0x1b06a1[_0xc81d('0x126')],'count':_0x5f158f[_0xc81d('0x62')],'rows':_0x5f158f});}})['catch'](handleError(_0x57f7df,null));};exports[_0xc81d('0x127')]=function(_0x1cc09c,_0x506c7a){var _0x47eef9={'raw':![],'where':{}};var _0x5371e9={};var _0x1c423f={'count':0x0,'rows':[]};return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x1cc09c[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x506c7a,null))[_0xc81d('0x18')](function(_0x6dc3c8){if(_0x6dc3c8){_0x5371e9[_0xc81d('0x41')]=_['keys'](db['ChatOfflineMessage'][_0xc81d('0x61')]);_0x5371e9[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x1cc09c[_0xc81d('0x4b')]);_0x5371e9['filters']=_[_0xc81d('0x4e')](_0x5371e9[_0xc81d('0x41')],_0x5371e9[_0xc81d('0x4b')]);_0x47eef9[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x5371e9['model'],qs[_0xc81d('0x4f')](_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x47eef9[_0xc81d('0x50')]=_0x47eef9[_0xc81d('0x50')][_0xc81d('0x62')]?_0x47eef9['attributes']:_0x5371e9[_0xc81d('0x41')];if(!_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x47eef9[_0xc81d('0x29')]=qs[_0xc81d('0x29')](_0x1cc09c[_0xc81d('0x4b')]['limit']);_0x47eef9[_0xc81d('0x27')]=qs['offset'](_0x1cc09c['query'][_0xc81d('0x27')]);}_0x47eef9[_0xc81d('0x72')]=qs['sort'](_0x1cc09c['query']['sort']);_0x47eef9[_0xc81d('0x54')]=qs[_0xc81d('0x4d')](_['pick'](_0x1cc09c[_0xc81d('0x4b')],_0x5371e9[_0xc81d('0x4d')]));_0x47eef9[_0xc81d('0x54')]['ChatWebsiteId']=_0x6dc3c8['id'];if(_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x56')]){_0x47eef9[_0xc81d('0x54')]=_['merge'](_0x47eef9[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x47eef9[_0xc81d('0x50')],function(_0x5908dd){var _0x500f93={};_0x500f93[_0x5908dd]={'$like':'%'+_0x1cc09c[_0xc81d('0x4b')]['filter']+'%'};return _0x500f93;})});}_0x47eef9=_[_0xc81d('0x57')]({},_0x47eef9,_0x1cc09c['options']);return db[_0xc81d('0xd8')][_0xc81d('0x2a')]({'where':_0x47eef9[_0xc81d('0x54')]})[_0xc81d('0x18')](function(_0x3b03ff){_0x1c423f['count']=_0x3b03ff;if(_0x1cc09c[_0xc81d('0x4b')][_0xc81d('0x5a')]){_0x47eef9[_0xc81d('0x5b')]=[{'all':!![]}];}else{_0x47eef9[_0xc81d('0x5b')]=[{'model':db['CmContact'],'as':_0xc81d('0xf8'),'required':![]},{'model':db[_0xc81d('0xe3')],'as':_0xc81d('0x128'),'required':![]}];}return db[_0xc81d('0xd8')][_0xc81d('0x5c')](_0x47eef9);})[_0xc81d('0x18')](function(_0x21d20c){_0x1c423f['rows']=_0x21d20c;return _0x1c423f;});}})['then'](respondWithFilteredResult(_0x506c7a,_0x47eef9))[_0xc81d('0x22')](handleError(_0x506c7a,null));};exports[_0xc81d('0x129')]=function(_0x1c71be,_0x266365){return db['ChatWebsite'][_0xc81d('0x66')]({'where':{'id':_0x1c71be[_0xc81d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x266365,null))['then'](function(_0x10f2fd){if(_0x10f2fd){return _0x10f2fd[_0xc81d('0x129')](_0x1c71be[_0xc81d('0x64')][_0xc81d('0x70')],_[_0xc81d('0xf7')](_0x1c71be[_0xc81d('0x64')],[_0xc81d('0x70'),'id'])||{})['spread'](function(_0x3be846){for(var _0x4e6601=0x0;_0x4e6601<_0x1c71be[_0xc81d('0x64')][_0xc81d('0x70')]['length'];_0x4e6601+=0x1){socket[_0xc81d('0x12a')](_0xc81d('0x12b'),{'UserId':Number(_0x1c71be[_0xc81d('0x64')]['ids'][_0x4e6601]),'ChatWebsiteId':Number(_0x1c71be[_0xc81d('0x5e')]['id'])});}return _0x3be846;});}})[_0xc81d('0x18')](respondWithResult(_0x266365,null))['catch'](handleError(_0x266365,null));};exports[_0xc81d('0x12c')]=function(_0x4a62,_0x37ecf8){return db[_0xc81d('0x60')]['find']({'where':{'id':_0x4a62[_0xc81d('0x5e')]['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x37ecf8,null))['then'](function(_0x4eecb1){if(_0x4eecb1){return _0x4eecb1[_0xc81d('0x12c')](_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')])[_0xc81d('0x18')](function(){if(_[_0xc81d('0x12d')](_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')])){for(var _0x534af4=0x0;_0x534af4<_0x4a62['query'][_0xc81d('0x70')][_0xc81d('0x62')];_0x534af4+=0x1){socket[_0xc81d('0x12a')](_0xc81d('0x12e'),{'UserId':Number(_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')][_0x534af4]),'ChatWebsiteId':Number(_0x4a62['params']['id'])});}}else{socket[_0xc81d('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x4a62[_0xc81d('0x4b')][_0xc81d('0x70')]),'ChatWebsiteId':Number(_0x4a62[_0xc81d('0x5e')]['id'])});}});}})[_0xc81d('0x18')](respondWithStatusCode(_0x37ecf8,null))[_0xc81d('0x22')](handleError(_0x37ecf8,null));};exports[_0xc81d('0x12f')]=function(_0x3b04d8,_0x447c63){var _0x5cfe19={};var _0x2e78ba={};var _0x327be4;var _0x33edce;return db[_0xc81d('0x60')][_0xc81d('0x101')]({'where':{'id':_0x3b04d8['params']['id']}})[_0xc81d('0x18')](handleEntityNotFound(_0x447c63,null))[_0xc81d('0x18')](function(_0x5412a2){if(_0x5412a2){_0x327be4=_0x5412a2;_0x2e78ba['model']=_['keys'](db[_0xc81d('0xbb')][_0xc81d('0x61')]);_0x2e78ba[_0xc81d('0x4b')]=_[_0xc81d('0x4c')](_0x3b04d8[_0xc81d('0x4b')]);_0x2e78ba[_0xc81d('0x4d')]=_[_0xc81d('0x4e')](_0x2e78ba[_0xc81d('0x41')],_0x2e78ba[_0xc81d('0x4b')]);_0x5cfe19[_0xc81d('0x50')]=_[_0xc81d('0x4e')](_0x2e78ba[_0xc81d('0x41')],qs['fields'](_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x4f')]));_0x5cfe19[_0xc81d('0x50')]=_0x5cfe19[_0xc81d('0x50')][_0xc81d('0x62')]?_0x5cfe19['attributes']:_0x2e78ba['model'];_0x5cfe19[_0xc81d('0x72')]=qs[_0xc81d('0x53')](_0x3b04d8[_0xc81d('0x4b')]['sort']);_0x5cfe19[_0xc81d('0x54')]=qs['filters'](_['pick'](_0x3b04d8[_0xc81d('0x4b')],_0x2e78ba['filters']));if(_0x3b04d8[_0xc81d('0x4b')]['filter']){_0x5cfe19['where']=_['merge'](_0x5cfe19[_0xc81d('0x54')],{'$or':_[_0xc81d('0x48')](_0x5cfe19[_0xc81d('0x50')],function(_0x120868){var _0x5a13e2={};_0x5a13e2[_0x120868]={'$like':'%'+_0x3b04d8['query'][_0xc81d('0x56')]+'%'};return _0x5a13e2;})});}_0x5cfe19=_[_0xc81d('0x57')]({},_0x5cfe19,_0x3b04d8[_0xc81d('0x59')]);return _0x327be4['getAgents'](_0x5cfe19);}})[_0xc81d('0x18')](function(_0x502bc3){if(_0x502bc3){_0x33edce=_0x502bc3[_0xc81d('0x62')];if(!_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x51')](_0xc81d('0x52'))){_0x5cfe19['limit']=qs[_0xc81d('0x29')](_0x3b04d8[_0xc81d('0x4b')][_0xc81d('0x29')]);_0x5cfe19['offset']=qs[_0xc81d('0x27')](_0x3b04d8['query'][_0xc81d('0x27')]);}return _0x327be4[_0xc81d('0x12f')](_0x5cfe19);}})[_0xc81d('0x18')](function(_0x5dbbca){if(_0x5dbbca){return _0x5dbbca?{'count':_0x33edce,'rows':_0x5dbbca}:null;}})[_0xc81d('0x18')](respondWithResult(_0x447c63,null))[_0xc81d('0x22')](handleError(_0x447c63,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 17af6d9..abb3d08 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 _0xe198=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x17de8e,_0x41ad4c){var _0x39aba5=function(_0x255320){while(--_0x255320){_0x17de8e['push'](_0x17de8e['shift']());}};_0x39aba5(++_0x41ad4c);}(_0xe198,0x6f));var _0x8e19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe198[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x8e19('0x0'));var ChatWebsite=require(_0x8e19('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e19('0x2'),'afterUpdate':_0x8e19('0x3'),'afterDestroy':_0x8e19('0x4')};function emitEvent(_0x529200){return function(_0x32f52f,_0x4e3f58,_0x23383d){ChatWebsiteEvents[_0x8e19('0x5')](_0x529200+':'+_0x32f52f['id'],_0x32f52f);ChatWebsiteEvents[_0x8e19('0x5')](_0x529200,_0x32f52f);_0x23383d(null);};}for(var e in events){if(events[_0x8e19('0x6')](e)){var event=events[e];ChatWebsite[_0x8e19('0x7')](e,emitEvent(event));}}module[_0x8e19('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xaefc=['events','../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','exports'];(function(_0x2f0f16,_0x42d05a){var _0x4fbc2a=function(_0x46c91a){while(--_0x46c91a){_0x2f0f16['push'](_0x2f0f16['shift']());}};_0x4fbc2a(++_0x42d05a);}(_0xaefc,0xc8));var _0xcaef=function(_0x4eddb9,_0x10d308){_0x4eddb9=_0x4eddb9-0x0;var _0x4aebd3=_0xaefc[_0x4eddb9];return _0x4aebd3;};'use strict';var EventEmitter=require(_0xcaef('0x0'));var ChatWebsite=require(_0xcaef('0x1'))['db'][_0xcaef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcaef('0x3'),'afterUpdate':_0xcaef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x575523){return function(_0x37a134,_0x46a35e,_0x5f160f){ChatWebsiteEvents['emit'](_0x575523+':'+_0x37a134['id'],_0x37a134);ChatWebsiteEvents[_0xcaef('0x5')](_0x575523,_0x37a134);_0x5f160f(null);};}for(var e in events){if(events[_0xcaef('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcaef('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index ee42be4..8234f4e 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 _0xc80e=['moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','api'];(function(_0x3fa569,_0xf425fe){var _0x44ed1d=function(_0x5801c3){while(--_0x5801c3){_0x3fa569['push'](_0x3fa569['shift']());}};_0x44ed1d(++_0xf425fe);}(_0xc80e,0x152));var _0xec80=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0xc80e[_0x5a2299];return _0xedff0f;};'use strict';var _=require(_0xec80('0x0'));var util=require(_0xec80('0x1'));var logger=require('../../config/logger')(_0xec80('0x2'));var moment=require(_0xec80('0x3'));var BPromise=require(_0xec80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec80('0x5'));var rimraf=require(_0xec80('0x6'));var config=require(_0xec80('0x7'));var attributes=require('./chatWebsite.attributes');module[_0xec80('0x8')]=function(_0x1448b9,_0x1742e3){return _0x1448b9[_0xec80('0x9')]('ChatWebsite',attributes,{'tableName':_0xec80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a17=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x27e7f5,_0x593031){var _0xdfad9c=function(_0x37b89d){while(--_0x37b89d){_0x27e7f5['push'](_0x27e7f5['shift']());}};_0xdfad9c(++_0x593031);}(_0x7a17,0x17e));var _0x77a1=function(_0x400cd8,_0x302f62){_0x400cd8=_0x400cd8-0x0;var _0x39f4e2=_0x7a17[_0x400cd8];return _0x39f4e2;};'use strict';var _=require('lodash');var util=require(_0x77a1('0x0'));var logger=require(_0x77a1('0x1'))(_0x77a1('0x2'));var moment=require(_0x77a1('0x3'));var BPromise=require(_0x77a1('0x4'));var rp=require(_0x77a1('0x5'));var fs=require('fs');var path=require(_0x77a1('0x6'));var rimraf=require('rimraf');var config=require(_0x77a1('0x7'));var attributes=require(_0x77a1('0x8'));module[_0x77a1('0x9')]=function(_0x4bd3fd,_0x4dfbda){return _0x4bd3fd[_0x77a1('0xa')](_0x77a1('0xb'),attributes,{'tableName':_0x77a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 1707400..1c18c0f 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 _0x89ee=['stringify','code','error','message','result','catch','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x23f2a7,_0x3bc14f){var _0x547933=function(_0x4137e0){while(--_0x4137e0){_0x23f2a7['push'](_0x23f2a7['shift']());}};_0x547933(++_0x3bc14f);}(_0x89ee,0x14b));var _0xe89e=function(_0x9b2e01,_0x13c214){_0x9b2e01=_0x9b2e01-0x0;var _0x141a4d=_0x89ee[_0x9b2e01];return _0x141a4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe89e('0x0'));var BPromise=require(_0xe89e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe89e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89e('0x3'))('rpc');var config=require(_0xe89e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe89e('0x5')][_0xe89e('0x6')]({'port':0x232a});config[_0xe89e('0x7')]=_[_0xe89e('0x8')](config['redis'],{'host':_0xe89e('0x9'),'port':0x18eb});var socket=require(_0xe89e('0xa'))(new Redis(config[_0xe89e('0x7')]));require(_0xe89e('0xb'))[_0xe89e('0xc')](socket);function respondWithRpcPromise(_0x564978,_0xfc5150,_0x8a9762){return new BPromise(function(_0x58faf5,_0x24e107){return client[_0xe89e('0xd')](_0x564978,_0x8a9762)[_0xe89e('0xe')](function(_0x57de9d){logger[_0xe89e('0xf')](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));logger['debug'](_0xe89e('0x12'),_0xfc5150,_0xe89e('0x11'),JSON[_0xe89e('0x13')](_0x57de9d));if(_0x57de9d['error']){if(_0x57de9d['error'][_0xe89e('0x14')]===0x1f4){logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d['error'][_0xe89e('0x16')]);return _0x24e107(_0x57de9d[_0xe89e('0x15')][_0xe89e('0x16')]);}logger[_0xe89e('0x15')](_0xe89e('0x10'),_0xfc5150,_0x57de9d[_0xe89e('0x15')]['message']);return _0x58faf5(_0x57de9d['error']['message']);}else{logger['info'](_0xe89e('0x10'),_0xfc5150,_0xe89e('0x11'));_0x58faf5(_0x57de9d[_0xe89e('0x17')][_0xe89e('0x16')]);}})[_0xe89e('0x18')](function(_0x37596f){logger[_0xe89e('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xfc5150,_0x37596f);_0x24e107(_0x37596f);});});} \ No newline at end of file +var _0x63f6=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x444d51,_0x398e25){var _0x37a214=function(_0x11e5a6){while(--_0x11e5a6){_0x444d51['push'](_0x444d51['shift']());}};_0x37a214(++_0x398e25);}(_0x63f6,0x1a2));var _0x663f=function(_0x5a0c3e,_0x5f3780){_0x5a0c3e=_0x5a0c3e-0x0;var _0x318886=_0x63f6[_0x5a0c3e];return _0x318886;};'use strict';var _=require(_0x663f('0x0'));var util=require(_0x663f('0x1'));var moment=require(_0x663f('0x2'));var BPromise=require(_0x663f('0x3'));var rs=require(_0x663f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663f('0x5'))['db'];var utils=require(_0x663f('0x6'));var logger=require(_0x663f('0x7'))(_0x663f('0x8'));var config=require(_0x663f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x663f('0xa')]({'port':0x232a});config[_0x663f('0xb')]=_[_0x663f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x663f('0xb')]));require(_0x663f('0xd'))[_0x663f('0xe')](socket);function respondWithRpcPromise(_0x3e5397,_0x427209,_0x51ea85){return new BPromise(function(_0x522844,_0x37a2f2){return client['request'](_0x3e5397,_0x51ea85)[_0x663f('0xf')](function(_0x1cdc5a){logger[_0x663f('0x10')](_0x663f('0x11'),_0x427209,_0x663f('0x12'));logger[_0x663f('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x427209,_0x663f('0x12'),JSON[_0x663f('0x14')](_0x1cdc5a));if(_0x1cdc5a['error']){if(_0x1cdc5a[_0x663f('0x15')][_0x663f('0x16')]===0x1f4){logger[_0x663f('0x15')](_0x663f('0x11'),_0x427209,_0x1cdc5a[_0x663f('0x15')][_0x663f('0x17')]);return _0x37a2f2(_0x1cdc5a[_0x663f('0x15')]['message']);}logger[_0x663f('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x427209,_0x1cdc5a[_0x663f('0x15')][_0x663f('0x17')]);return _0x522844(_0x1cdc5a['error'][_0x663f('0x17')]);}else{logger[_0x663f('0x10')](_0x663f('0x11'),_0x427209,_0x663f('0x12'));_0x522844(_0x1cdc5a[_0x663f('0x18')]['message']);}})[_0x663f('0x19')](function(_0x385e5f){logger['error'](_0x663f('0x11'),_0x427209,_0x385e5f);_0x37a2f2(_0x385e5f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index cd9257f..9edf55c 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 _0x6188=['chatWebsite:','remove','update','emit','removeListener','register','length'];(function(_0x114e69,_0x48ee4b){var _0x481772=function(_0x5b2a60){while(--_0x5b2a60){_0x114e69['push'](_0x114e69['shift']());}};_0x481772(++_0x48ee4b);}(_0x6188,0x1b3));var _0x8618=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6188[_0x525c7b];return _0x27b33e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x8618('0x0'),_0x8618('0x1')];function createListener(_0x28d4c5,_0x73b45e){return function(_0x1ff4cf){_0x73b45e[_0x8618('0x2')](_0x28d4c5,_0x1ff4cf);};}function removeListener(_0x216b6d,_0xd93a0e){return function(){ChatWebsiteEvents[_0x8618('0x3')](_0x216b6d,_0xd93a0e);};}exports[_0x8618('0x4')]=function(_0x471ec1){for(var _0xbfce31=0x0,_0xa220c3=events[_0x8618('0x5')];_0xbfce31<_0xa220c3;_0xbfce31++){var _0x1b8fa8=events[_0xbfce31];var _0x47a640=createListener(_0x8618('0x6')+_0x1b8fa8,_0x471ec1);ChatWebsiteEvents['on'](_0x1b8fa8,_0x47a640);}}; \ No newline at end of file +var _0x288a=['remove','removeListener','./chatWebsite.events','save'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x288a,0x1b2));var _0xa288=function(_0x10e061,_0x3c25ec){_0x10e061=_0x10e061-0x0;var _0x5f46a3=_0x288a[_0x10e061];return _0x5f46a3;};'use strict';var ChatWebsiteEvents=require(_0xa288('0x0'));var events=[_0xa288('0x1'),_0xa288('0x2'),'update'];function createListener(_0x13f32c,_0x56390a){return function(_0x5f5d71){_0x56390a['emit'](_0x13f32c,_0x5f5d71);};}function removeListener(_0x14be09,_0x368b17){return function(){ChatWebsiteEvents[_0xa288('0x3')](_0x14be09,_0x368b17);};}exports['register']=function(_0x417d4a){for(var _0x3a8ee3=0x0,_0x5b1881=events['length'];_0x3a8ee3<_0x5b1881;_0x3a8ee3++){var _0x1f98ad=events[_0x3a8ee3];var _0x2875e7=createListener('chatWebsite:'+_0x1f98ad,_0x417d4a);ChatWebsiteEvents['on'](_0x1f98ad,_0x2875e7);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 849e147..48dfe9a 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 _0x8368=['/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','format','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','/:id','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x6352a6,_0xdbe9b9){var _0x2b473c=function(_0x330739){while(--_0x330739){_0x6352a6['push'](_0x6352a6['shift']());}};_0x2b473c(++_0xdbe9b9);}(_0x8368,0x186));var _0x8836=function(_0x1ec626,_0x22bba4){_0x1ec626=_0x1ec626-0x0;var _0x128ba3=_0x8368[_0x1ec626];return _0x128ba3;};'use strict';var multer=require(_0x8836('0x0'));var util=require(_0x8836('0x1'));var path=require(_0x8836('0x2'));var timeout=require(_0x8836('0x3'));var express=require(_0x8836('0x4'));var router=express[_0x8836('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8836('0x6'));var config=require(_0x8836('0x7'));var controller=require(_0x8836('0x8'));router['get']('/',auth[_0x8836('0x9')](),controller['index']);router[_0x8836('0xa')](_0x8836('0xb'),auth[_0x8836('0x9')](),controller[_0x8836('0xc')]);router[_0x8836('0xa')]('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0xd')]);router[_0x8836('0xa')](_0x8836('0xe'),auth[_0x8836('0x9')](),controller[_0x8836('0xf')]);router[_0x8836('0xa')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller['getAnswers']);router[_0x8836('0xa')](_0x8836('0x10'),controller[_0x8836('0x11')]);router[_0x8836('0xa')](_0x8836('0x12'),controller[_0x8836('0x13')]);router[_0x8836('0xa')](_0x8836('0x14'),controller[_0x8836('0x15')]);router[_0x8836('0xa')](_0x8836('0x16'),controller[_0x8836('0x17')]);router['get'](_0x8836('0x18'),auth[_0x8836('0x9')](),controller[_0x8836('0x19')]);router[_0x8836('0xa')](_0x8836('0x1a'),controller['getSnippet']);router[_0x8836('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8836('0x1b')]);router[_0x8836('0xa')](_0x8836('0x1c'),auth[_0x8836('0x9')](),controller[_0x8836('0x1d')]);router[_0x8836('0xa')](_0x8836('0x1e'),controller[_0x8836('0x1f')]);router['get']('/:id/offline_messages',auth[_0x8836('0x9')](),controller[_0x8836('0x20')]);router['get'](_0x8836('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8836('0x22')]('/',auth[_0x8836('0x9')](),controller[_0x8836('0x23')]);router[_0x8836('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8836('0x24')]);router[_0x8836('0x22')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4807b9,_0x54852b,_0x5ee6a0){_0x5ee6a0(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x28')));},'filename':function(_0x3d29e8,_0xc435ec,_0x1acb0f){_0x1acb0f(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0xc435ec[_0x8836('0x2b')]));}})});router['post']('/:id/logo',upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x2e')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x9c0ba,_0x552e8f,_0x5943a6){_0x5943a6(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x47aa75,_0x11b1f0,_0xf9dd54){_0xf9dd54(null,util['format'](_0x8836('0x29'),Date[_0x8836('0x2a')](),_0x11b1f0[_0x8836('0x2b')]));}})});router[_0x8836('0x22')](_0x8836('0x12'),upload[_0x8836('0x2c')](_0x8836('0x2d')),controller[_0x8836('0x31')]);var upload=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x11d7c6,_0x642f13,_0x211c33){_0x211c33(null,path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5a55c9,_0x206c9a,_0x37dc2a){_0x37dc2a(null,util['format']('%s-%s',Date[_0x8836('0x2a')](),_0x206c9a['originalname']));}})});router[_0x8836('0x22')](_0x8836('0x14'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45f488,_0xfefdc6,_0x1aa25f){_0x1aa25f(null,path['join'](config[_0x8836('0x27')],_0x8836('0x30')));},'filename':function(_0x5034ae,_0xddce44,_0x26e064){_0x26e064(null,util[_0x8836('0x33')]('%s-%s',Date[_0x8836('0x2a')](),_0xddce44['originalname']));}})});router['post'](_0x8836('0x16'),upload['single'](_0x8836('0x2d')),controller[_0x8836('0x34')]);router[_0x8836('0x22')](_0x8836('0x35'),controller[_0x8836('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x8836('0x2f')]({'destination':function(_0x773826,_0x380111,_0x5c6184){const _0x7d9bfa=path[_0x8836('0x26')](config[_0x8836('0x27')],_0x8836('0x37'),_0x8836('0x38'),'offline-chat');fs_extra[_0x8836('0x39')](_0x7d9bfa,function(){_0x5c6184(null,_0x7d9bfa);});},'filename':function(_0x1c22ee,_0x8059fc,_0x37c0a2){const _0x348db9=_0x8059fc[_0x8836('0x2b')][_0x8836('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xff5c97=path['extname'](_0x348db9);const _0x1dfa7e=Date[_0x8836('0x2a')]()+'-'+_0x348db9[_0x8836('0x3a')](_0xff5c97,'')+_0xff5c97;_0x37c0a2(null,_0x1dfa7e);}})});router[_0x8836('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x8836('0x3b')]);router[_0x8836('0x22')](_0x8836('0x18'),auth['isAuthenticated'](),controller[_0x8836('0x3c')]);router[_0x8836('0x22')]('/:id/applications',auth[_0x8836('0x9')](),controller[_0x8836('0x3d')]);router[_0x8836('0x22')]('/:id/proactive_actions',auth[_0x8836('0x9')](),controller[_0x8836('0x3e')]);router[_0x8836('0x22')]('/:id/users',auth[_0x8836('0x9')](),controller[_0x8836('0x3f')]);router['put']('/:id',auth[_0x8836('0x9')](),controller[_0x8836('0x40')]);router[_0x8836('0x41')](_0x8836('0x42'),auth[_0x8836('0x9')](),controller['destroy']);router[_0x8836('0x41')]('/:id/dispositions',auth[_0x8836('0x9')](),controller['removeDispositions']);router[_0x8836('0x41')]('/:id/canned_answers',auth[_0x8836('0x9')](),controller[_0x8836('0x43')]);router[_0x8836('0x41')](_0x8836('0x21'),auth[_0x8836('0x9')](),controller['removeAgents']);module[_0x8836('0x44')]=router; \ No newline at end of file +var _0xdf0f=['/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x5bf2b3,_0xfcd364){var _0x5e8a9b=function(_0x43546b){while(--_0x43546b){_0x5bf2b3['push'](_0x5bf2b3['shift']());}};_0x5e8a9b(++_0xfcd364);}(_0xdf0f,0x1cc));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xfdf0('0x0'));var util=require(_0xfdf0('0x1'));var path=require(_0xfdf0('0x2'));var timeout=require(_0xfdf0('0x3'));var express=require(_0xfdf0('0x4'));var router=express['Router']();var fs_extra=require(_0xfdf0('0x5'));var auth=require(_0xfdf0('0x6'));var interaction=require(_0xfdf0('0x7'));var config=require(_0xfdf0('0x8'));var controller=require('./chatWebsite.controller');router[_0xfdf0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfdf0('0x9')](_0xfdf0('0xa'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0xc')]);router[_0xfdf0('0x9')](_0xfdf0('0xd'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0xe')]);router[_0xfdf0('0x9')](_0xfdf0('0xf'),auth[_0xfdf0('0xb')](),controller['getDispositions']);router[_0xfdf0('0x9')](_0xfdf0('0x10'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x11')]);router[_0xfdf0('0x9')](_0xfdf0('0x12'),controller['getLogo']);router[_0xfdf0('0x9')](_0xfdf0('0x13'),controller[_0xfdf0('0x14')]);router['get'](_0xfdf0('0x15'),controller[_0xfdf0('0x16')]);router[_0xfdf0('0x9')](_0xfdf0('0x17'),controller[_0xfdf0('0x18')]);router[_0xfdf0('0x9')]('/:id/interactions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x19')]);router['get'](_0xfdf0('0x1a'),controller['getSnippet']);router[_0xfdf0('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xfdf0('0x1b')]);router[_0xfdf0('0x9')](_0xfdf0('0x1c'),auth[_0xfdf0('0xb')](),controller['getProactiveActions']);router[_0xfdf0('0x9')](_0xfdf0('0x1d'),controller[_0xfdf0('0x1e')]);router[_0xfdf0('0x9')](_0xfdf0('0x1f'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x20')]);router['get']('/:id/users',auth[_0xfdf0('0xb')](),controller['getAgents']);router[_0xfdf0('0x21')]('/',auth[_0xfdf0('0xb')](),controller['create']);router[_0xfdf0('0x21')](_0xfdf0('0xf'),auth['isAuthenticated'](),controller[_0xfdf0('0x22')]);router[_0xfdf0('0x21')]('/:id/canned_answers',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x23')]);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x4c9e06,_0x1792d6,_0x2f1fa1){_0x2f1fa1(null,path[_0xfdf0('0x25')](config[_0xfdf0('0x26')],_0xfdf0('0x27')));},'filename':function(_0x2014a9,_0x58a200,_0x34501f){_0x34501f(null,util[_0xfdf0('0x28')](_0xfdf0('0x29'),Date[_0xfdf0('0x2a')](),_0x58a200[_0xfdf0('0x2b')]));}})});router[_0xfdf0('0x21')](_0xfdf0('0x12'),upload[_0xfdf0('0x2c')](_0xfdf0('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x2ff7b8,_0x3d5dde,_0x34b5e0){_0x34b5e0(null,path['join'](config[_0xfdf0('0x26')],_0xfdf0('0x2e')));},'filename':function(_0x1618c3,_0x38b1a8,_0x382777){_0x382777(null,util[_0xfdf0('0x28')](_0xfdf0('0x29'),Date[_0xfdf0('0x2a')](),_0x38b1a8['originalname']));}})});router[_0xfdf0('0x21')](_0xfdf0('0x13'),upload[_0xfdf0('0x2c')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x2e0795,_0x11f028,_0x5cc05e){_0x5cc05e(null,path[_0xfdf0('0x25')](config[_0xfdf0('0x26')],_0xfdf0('0x2e')));},'filename':function(_0x1986fb,_0x17b683,_0x51bea2){_0x51bea2(null,util['format']('%s-%s',Date[_0xfdf0('0x2a')](),_0x17b683[_0xfdf0('0x2b')]));}})});router[_0xfdf0('0x21')](_0xfdf0('0x15'),upload['single']('file'),controller[_0xfdf0('0x2f')]);var upload=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x5d30cc,_0x5db01a,_0x275a17){_0x275a17(null,path[_0xfdf0('0x25')](config['root'],_0xfdf0('0x2e')));},'filename':function(_0xe25b3d,_0x218655,_0x427205){_0x427205(null,util[_0xfdf0('0x28')]('%s-%s',Date[_0xfdf0('0x2a')](),_0x218655['originalname']));}})});router['post'](_0xfdf0('0x17'),upload[_0xfdf0('0x2c')](_0xfdf0('0x2d')),controller[_0xfdf0('0x30')]);router[_0xfdf0('0x21')](_0xfdf0('0x31'),controller[_0xfdf0('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xfdf0('0x24')]({'destination':function(_0x4f134f,_0x2a3f0c,_0x2d5652){const _0x58ecbd=path['join'](config['root'],'server/files',_0xfdf0('0x33'),_0xfdf0('0x34'));fs_extra[_0xfdf0('0x35')](_0x58ecbd,function(){_0x2d5652(null,_0x58ecbd);});},'filename':function(_0x5a2ff0,_0x18d93d,_0x358c1e){const _0x121d4e=_0x18d93d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4dea0f=path[_0xfdf0('0x36')](_0x121d4e);const _0x9b71ac=Date[_0xfdf0('0x2a')]()+'-'+_0x121d4e[_0xfdf0('0x37')](_0x4dea0f,'')+_0x4dea0f;_0x358c1e(null,_0x9b71ac);}})});router[_0xfdf0('0x21')]('/:id/offline',offlineUploadMulter[_0xfdf0('0x38')](),controller[_0xfdf0('0x39')]);router[_0xfdf0('0x21')]('/:id/interactions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3a')]);router[_0xfdf0('0x21')]('/:id/applications',auth['isAuthenticated'](),controller[_0xfdf0('0x3b')]);router[_0xfdf0('0x21')]('/:id/proactive_actions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3c')]);router[_0xfdf0('0x21')](_0xfdf0('0x3d'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3e')]);router['put'](_0xfdf0('0xd'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x3f')]);router[_0xfdf0('0x40')](_0xfdf0('0xd'),auth['isAuthenticated'](),controller[_0xfdf0('0x41')]);router[_0xfdf0('0x40')]('/:id/dispositions',auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x42')]);router['delete'](_0xfdf0('0x10'),auth['isAuthenticated'](),controller[_0xfdf0('0x43')]);router[_0xfdf0('0x40')](_0xfdf0('0x3d'),auth[_0xfdf0('0xb')](),controller[_0xfdf0('0x44')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index bf97744..3b45e16 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 _0xf016=['production','get','client-side-logger','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env'];(function(_0x2caf3a,_0x1d65d6){var _0x34f044=function(_0x31410c){while(--_0x31410c){_0x2caf3a['push'](_0x2caf3a['shift']());}};_0x34f044(++_0x1d65d6);}(_0xf016,0xdf));var _0x6f01=function(_0x36980d,_0x266c7f){_0x36980d=_0x36980d-0x0;var _0x18555d=_0xf016[_0x36980d];return _0x18555d;};var beaverLogger=require('beaver-logger/server');var express=require(_0x6f01('0x0'));var auth=require(_0x6f01('0x1'));var config=require(_0x6f01('0x2'));var router=express[_0x6f01('0x3')]();var isProduction=config[_0x6f01('0x4')]===_0x6f01('0x5')||![];function clientSideLogs(_0x4212de,_0x1aa1b1,_0xada4d2){var _0x4ce592=_0x4212de['app'][_0x6f01('0x6')](_0x6f01('0x7'));if(!_0x4ce592){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x6f01('0x8'),'logger':_0x4ce592,'enableCors':!isProduction})(_0x4212de,_0x1aa1b1,_0xada4d2);}router[_0x6f01('0x9')](auth[_0x6f01('0xa')](),clientSideLogs);module[_0x6f01('0xb')]=router; \ No newline at end of file +var _0xc73e=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router'];(function(_0x1e356c,_0x1761c5){var _0x386592=function(_0x55e079){while(--_0x55e079){_0x1e356c['push'](_0x1e356c['shift']());}};_0x386592(++_0x1761c5);}(_0xc73e,0x1c3));var _0xec73=function(_0x13fcd8,_0x54681a){_0x13fcd8=_0x13fcd8-0x0;var _0x19cd5b=_0xc73e[_0x13fcd8];return _0x19cd5b;};var beaverLogger=require(_0xec73('0x0'));var express=require(_0xec73('0x1'));var auth=require(_0xec73('0x2'));var config=require('../config/environment');var router=express[_0xec73('0x3')]();var isProduction=config[_0xec73('0x4')]===_0xec73('0x5')||![];function clientSideLogs(_0x16995b,_0x504062,_0x32b314){var _0x2f315b=_0x16995b[_0xec73('0x6')][_0xec73('0x7')](_0xec73('0x8'));if(!_0x2f315b){throw new Error(_0xec73('0x9'));}return beaverLogger[_0xec73('0xa')]({'uri':'/client-logs','logger':_0x2f315b,'enableCors':!isProduction})(_0x16995b,_0x504062,_0x32b314);}router['use'](auth[_0xec73('0xb')](),clientSideLogs);module[_0xec73('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 0aa6b89..6957367 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 _0xba9f=['MicrosoftAzure\x20=>\x20access_token','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5d8f86,_0x238cd9){var _0xfece95=function(_0x196473){while(--_0x196473){_0x5d8f86['push'](_0x5d8f86['shift']());}};_0xfece95(++_0x238cd9);}(_0xba9f,0x143));var _0xfba9=function(_0x59af48,_0x54de5c){_0x59af48=_0x59af48-0x0;var _0x386bc6=_0xba9f[_0x59af48];return _0x386bc6;};'use strict';var Sequelize=require(_0xfba9('0x0'));module[_0xfba9('0x1')]={'name':{'type':Sequelize[_0xfba9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x4'),_0xfba9('0x5'),_0xfba9('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xfba9('0x3')](_0xfba9('0x7'),_0xfba9('0x8'))},'data1':{'type':Sequelize[_0xfba9('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0x9')},'data3':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xa')},'data4':{'type':Sequelize[_0xfba9('0x2')],'comment':_0xfba9('0xb')},'data5':{'type':Sequelize[_0xfba9('0xc')],'comment':_0xfba9('0xd')},'data6':{'type':Sequelize[_0xfba9('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x6f85=['MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x490dfe,_0x37a166){var _0x25acd6=function(_0x13b554){while(--_0x13b554){_0x490dfe['push'](_0x490dfe['shift']());}};_0x25acd6(++_0x37a166);}(_0x6f85,0xa2));var _0x56f8=function(_0x54b0f3,_0x1fe2f7){_0x54b0f3=_0x54b0f3-0x0;var _0x5ae957=_0x6f85[_0x54b0f3];return _0x5ae957;};'use strict';var Sequelize=require(_0x56f8('0x0'));module[_0x56f8('0x1')]={'name':{'type':Sequelize[_0x56f8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x56f8('0x3')](_0x56f8('0x4'),_0x56f8('0x5'),_0x56f8('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x56f8('0x3')](_0x56f8('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x56f8('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x56f8('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x56f8('0x2')],'comment':_0x56f8('0x9')},'data5':{'type':Sequelize[_0x56f8('0xa')],'comment':_0x56f8('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x56f8('0xc')},'data7':{'type':Sequelize[_0x56f8('0xa')],'comment':_0x56f8('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 189e0a7..b2e43a8 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 _0x7586=['Invalid\x20state\x20parameter','from','state','base64','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','service','decryptString','data3','catch','params','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get'];(function(_0x5b3c61,_0x3eb2aa){var _0x153389=function(_0x2a1a99){while(--_0x2a1a99){_0x5b3c61['push'](_0x5b3c61['shift']());}};_0x153389(++_0x3eb2aa);}(_0x7586,0xcc));var _0x6758=function(_0x5168e3,_0x4b9c51){_0x5168e3=_0x5168e3-0x0;var _0x3112c3=_0x7586[_0x5168e3];return _0x3112c3;};'use strict';var _=require(_0x6758('0x0'));var Redis=require('ioredis');var qs=require(_0x6758('0x1'));var encryptor=require(_0x6758('0x2'));var config=require(_0x6758('0x3'));var logger=require(_0x6758('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x6758('0x5'));config['redis']=_[_0x6758('0x6')](config[_0x6758('0x7')],{'host':_0x6758('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6758('0x7')]));var redis=new Redis(config[_0x6758('0x7')]);function respondWithStatusCode(_0x2f9c03,_0x20e32b){_0x20e32b=_0x20e32b||0xcc;return function(_0xe9817c){if(_0xe9817c){return _0x2f9c03[_0x6758('0x9')](_0x20e32b);}return _0x2f9c03[_0x6758('0xa')](_0x20e32b)[_0x6758('0xb')]();};}function respondWithResult(_0x454b04,_0x261774){_0x261774=_0x261774||0xc8;return function(_0x577929){if(_0x577929){return _0x454b04['status'](_0x261774)[_0x6758('0xc')](_0x577929);}};}function respondWithFilteredResult(_0x7c5652,_0x13a6f7){return function(_0xdc858b){if(_0xdc858b){var _0x260583=typeof _0x13a6f7[_0x6758('0xd')]===_0x6758('0xe')&&typeof _0x13a6f7[_0x6758('0xf')]==='undefined';var _0x21a6f0=_0xdc858b[_0x6758('0x10')];var _0x196b66=_0x260583?0x0:_0x13a6f7[_0x6758('0xd')];var _0x5c0fcf=_0x260583?_0xdc858b[_0x6758('0x10')]:_0x13a6f7[_0x6758('0xd')]+_0x13a6f7[_0x6758('0xf')];var _0x8c885c;if(_0x5c0fcf>=_0x21a6f0){_0x5c0fcf=_0x21a6f0;_0x8c885c=0xc8;}else{_0x8c885c=0xce;}_0x7c5652[_0x6758('0xa')](_0x8c885c);return _0x7c5652['set'](_0x6758('0x11'),_0x196b66+'-'+_0x5c0fcf+'/'+_0x21a6f0)[_0x6758('0xc')](_0xdc858b);}return null;};}function saveUpdates(_0x34f05e){return function(_0xd1b264){if(_0xd1b264){return _0xd1b264['update'](_0x34f05e)[_0x6758('0x12')](function(_0x51f2b3){return _0x51f2b3;});}return null;};}function removeEntity(_0x374534){return function(_0x4d329b){if(_0x4d329b){return _0x4d329b['destroy']()['then'](function(){_0x374534['status'](0xcc)[_0x6758('0xb')]();});}};}function handleEntityNotFound(_0x4035c3){return function(_0x2e9308){if(!_0x2e9308){_0x4035c3['sendStatus'](0x194);}return _0x2e9308;};}function handleError(_0x236c25,_0x218a89){_0x218a89=_0x218a89||0x1f4;return function(_0x3dcfe8){logger['error'](_0x3dcfe8['stack']);if(_0x3dcfe8['name']){delete _0x3dcfe8[_0x6758('0x13')];}_0x236c25[_0x6758('0xa')](_0x218a89)[_0x6758('0x14')](_0x3dcfe8);};}function maskClientSecret(_0xb1bc03){return _[_0x6758('0x15')](_0xb1bc03[_0x6758('0x16')](0x0,0x3),0x14,'*');}exports[_0x6758('0x17')]=function(_0x962d0c,_0x1e9d70){var _0x2134e7={},_0x215983={},_0x31cad2={'count':0x0,'rows':[]};var _0x4ec5b4=_[_0x6758('0x18')](db[_0x6758('0x19')][_0x6758('0x1a')],function(_0x41bc7d){return{'name':_0x41bc7d['fieldName'],'type':_0x41bc7d[_0x6758('0x1b')]['key']};});_0x215983[_0x6758('0x1c')]=_[_0x6758('0x18')](_0x4ec5b4,_0x6758('0x13'));_0x215983[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x962d0c['query']);_0x215983[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x215983['model'],_0x215983[_0x6758('0x1d')]);_0x2134e7['attributes']=_[_0x6758('0x20')](_0x215983[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x962d0c[_0x6758('0x1d')]['fields']));_0x2134e7[_0x6758('0x22')]=_0x2134e7[_0x6758('0x22')][_0x6758('0x23')]?_0x2134e7['attributes']:_0x215983[_0x6758('0x1c')];if(!_0x962d0c[_0x6758('0x1d')][_0x6758('0x24')](_0x6758('0x25'))){_0x2134e7[_0x6758('0xf')]=qs[_0x6758('0xf')](_0x962d0c[_0x6758('0x1d')][_0x6758('0xf')]);_0x2134e7[_0x6758('0xd')]=qs[_0x6758('0xd')](_0x962d0c['query']['offset']);}_0x2134e7[_0x6758('0x26')]=qs[_0x6758('0x27')](_0x962d0c[_0x6758('0x1d')][_0x6758('0x27')]);_0x2134e7[_0x6758('0x28')]=qs['filters'](_[_0x6758('0x29')](_0x962d0c['query'],_0x215983['filters']),_0x4ec5b4);if(_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]){_0x2134e7['where']=_['merge'](_0x2134e7[_0x6758('0x28')],{'$or':_[_0x6758('0x18')](_0x4ec5b4,function(_0x26e07a){if(_0x26e07a[_0x6758('0x1b')]!==_0x6758('0x2b')){var _0x49327a={};_0x49327a[_0x26e07a[_0x6758('0x13')]]={'$like':'%'+_0x962d0c[_0x6758('0x1d')][_0x6758('0x2a')]+'%'};return _0x49327a;}})});}_0x2134e7=_[_0x6758('0x2c')]({},_0x2134e7,_0x962d0c[_0x6758('0x2d')]);var _0x9270cf={'where':_0x2134e7['where']};return db[_0x6758('0x19')][_0x6758('0x10')](_0x9270cf)[_0x6758('0x12')](function(_0x14fd97){_0x31cad2[_0x6758('0x10')]=_0x14fd97;if(_0x962d0c[_0x6758('0x1d')]['includeAll']){_0x2134e7[_0x6758('0x2e')]=[{'all':!![]}];}return db[_0x6758('0x19')][_0x6758('0x2f')](_0x2134e7);})[_0x6758('0x12')](function(_0x547863){_0x31cad2[_0x6758('0x30')]=_[_0x6758('0x18')](_0x547863,function(_0x47207c){if(_0x47207c[_0x6758('0x31')]==='MicrosoftAzure'){var _0x2ec7b9=encryptor[_0x6758('0x32')](_0x47207c[_0x6758('0x33')]);_0x47207c[_0x6758('0x33')]=maskClientSecret(_0x2ec7b9);}return _0x47207c;});return _0x31cad2;})[_0x6758('0x12')](respondWithFilteredResult(_0x1e9d70,_0x2134e7))[_0x6758('0x34')](handleError(_0x1e9d70,null));};exports['show']=function(_0x57eb7d,_0x368eb7){var _0x4499de={'raw':!![],'where':{'id':_0x57eb7d[_0x6758('0x35')]['id']}},_0x405ca5={};_0x405ca5['model']=_[_0x6758('0x1e')](db['CloudProvider'][_0x6758('0x1a')]);_0x405ca5[_0x6758('0x1d')]=_[_0x6758('0x1e')](_0x57eb7d[_0x6758('0x1d')]);_0x405ca5[_0x6758('0x1f')]=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],_0x405ca5['query']);_0x4499de['attributes']=_[_0x6758('0x20')](_0x405ca5[_0x6758('0x1c')],qs[_0x6758('0x21')](_0x57eb7d[_0x6758('0x1d')]['fields']));_0x4499de[_0x6758('0x22')]=_0x4499de[_0x6758('0x22')]['length']?_0x4499de['attributes']:_0x405ca5[_0x6758('0x1c')];if(_0x57eb7d[_0x6758('0x1d')]['includeAll']){_0x4499de['include']=[{'all':!![]}];}_0x4499de=_['merge']({},_0x4499de,_0x57eb7d['options']);return db[_0x6758('0x19')][_0x6758('0x36')](_0x4499de)[_0x6758('0x12')](handleEntityNotFound(_0x368eb7,null))[_0x6758('0x12')](function(_0x2afbd4){if(_0x2afbd4[_0x6758('0x31')]===_0x6758('0x37')){var _0x46cc7a=encryptor[_0x6758('0x32')](_0x2afbd4[_0x6758('0x33')]);_0x2afbd4['data3']=maskClientSecret(_0x46cc7a);}return _0x2afbd4;})['then'](respondWithResult(_0x368eb7,null))['catch'](handleError(_0x368eb7,null));};exports[_0x6758('0x38')]=function(_0x1a5760,_0x4dea1f){if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x13')])throw new Error(_0x6758('0x3a'));if(!_0x1a5760[_0x6758('0x39')][_0x6758('0x31')])throw new Error(_0x6758('0x3b'));var _0x41c0d6=db[_0x6758('0x19')][_0x6758('0x1a')]['service']['values'];if(!_0x41c0d6[_0x6758('0x3c')](_0x1a5760[_0x6758('0x39')][_0x6758('0x31')]))throw new Error(_0x6758('0x3d')+_0x41c0d6[_0x6758('0x3e')](',\x20'));if(_0x1a5760['body'][_0x6758('0x31')]==='MicrosoftAzure'&&_0x1a5760[_0x6758('0x39')]['data3']){_0x1a5760[_0x6758('0x39')]['data3']=encryptor['encryptString'](_0x1a5760[_0x6758('0x39')]['data3']);}return db[_0x6758('0x19')][_0x6758('0x38')](_0x1a5760['body'],{})[_0x6758('0x12')](respondWithResult(_0x4dea1f,0xc9))[_0x6758('0x34')](handleError(_0x4dea1f,null));};exports[_0x6758('0x3f')]=function(_0x252937,_0x3b5850){if(_0x252937[_0x6758('0x39')]['id']){delete _0x252937[_0x6758('0x39')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x252937[_0x6758('0x35')]['id']}})[_0x6758('0x12')](handleEntityNotFound(_0x3b5850,null))['then'](function(_0x4cdd76){if(_0x4cdd76[_0x6758('0x31')]===_0x6758('0x37')&&_0x252937[_0x6758('0x39')][_0x6758('0x33')]){_0x252937[_0x6758('0x39')][_0x6758('0x33')]=encryptor['encryptString'](_0x252937[_0x6758('0x39')]['data3']);}return _0x4cdd76;})[_0x6758('0x12')](saveUpdates(_0x252937['body'],null))['then'](respondWithResult(_0x3b5850,null))[_0x6758('0x34')](handleError(_0x3b5850,null));};exports[_0x6758('0x40')]=function(_0x41ac59,_0x1c66bc){return db['CloudProvider'][_0x6758('0x36')]({'where':{'id':_0x41ac59[_0x6758('0x35')]['id']}})['then'](handleEntityNotFound(_0x1c66bc,null))[_0x6758('0x12')](removeEntity(_0x1c66bc,null))[_0x6758('0x34')](handleError(_0x1c66bc,null));};exports[_0x6758('0x41')]=function(_0x25fbc6,_0x548ec6){return db[_0x6758('0x19')][_0x6758('0x42')]({'where':{'id':_0x25fbc6[_0x6758('0x35')]['id']},'raw':!![]})[_0x6758('0x12')](function(_0x3f3bac){if(!_0x3f3bac)return _0x548ec6[_0x6758('0x9')](0x194);return{'url':oauth[_0x6758('0x43')](_0x3f3bac,_0x25fbc6[_0x6758('0x44')]['id'])};})['then'](respondWithResult(_0x548ec6,null))[_0x6758('0x34')](handleError(_0x548ec6,null));};exports[_0x6758('0x45')]=function(_0x4dbece,_0xd9dbfd){var _0x560e16=_0x4dbece[_0x6758('0x39')];var _0x14c2f3;var _0x6a412e;if(_0x560e16[_0x6758('0x46')])throw _0x560e16;redis[_0x6758('0x47')](_0x560e16['state'])[_0x6758('0x12')](function(_0x1f451c){if(!_0x1f451c)throw new Error(_0x6758('0x48'));_0x14c2f3=JSON['parse'](_0x1f451c);var _0x3c6885=Buffer[_0x6758('0x49')](_0x560e16[_0x6758('0x4a')],_0x6758('0x4b'))[_0x6758('0x4c')]('ascii');_0x6a412e=JSON['parse'](_0x3c6885);if(!oauth[_0x6758('0x4d')](_0x560e16['id_token'],_0x14c2f3[_0x6758('0x4e')]))throw new Error(_0x6758('0x4f'));redis['del'](_0x560e16[_0x6758('0x4a')]);return oauth[_0x6758('0x50')](_0x560e16[_0x6758('0x51')],_0x14c2f3);})[_0x6758('0x12')](function(_0x29f9bc){_0x14c2f3[_0x6758('0x52')]=_0x29f9bc['access_token'];_0x14c2f3[_0x6758('0x53')]=_0x29f9bc[_0x6758('0x54')];return db[_0x6758('0x19')][_0x6758('0x3f')]({'data5':_0x14c2f3[_0x6758('0x52')],'data6':_0x14c2f3[_0x6758('0x53')]},{'where':{'id':_0x14c2f3['id']}});})[_0x6758('0x12')](function(){oauth[_0x6758('0x55')](_0x14c2f3);socket[_0x6758('0x56')](_0x6758('0x57'),{'id':_0x6a412e['id']});return;})['then'](respondWithStatusCode(_0xd9dbfd,null))[_0x6758('0x34')](function(_0x13d5e6){if(_0x6a412e){socket[_0x6758('0x56')](_0x6758('0x58'),{'id':_0x6a412e['id']});}if(!_0x14c2f3){logger[_0x6758('0x46')](_0x6758('0x59'),_0x13d5e6);return _0xd9dbfd[_0x6758('0xa')](0x1f4)['send'](_0x13d5e6[_0x6758('0x5a')]);}logger[_0x6758('0x46')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x14c2f3['id'],JSON[_0x6758('0x5b')](_0x13d5e6));});}; \ No newline at end of file +var _0x4daa=['join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','ascii','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','redis','defaults','localhost','end','status','offset','limit','undefined','count','set','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','map','CloudProvider','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','keys','rawAttributes','include','find','catch','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0x4daa,0xd7));var _0xa4da=function(_0x389cda,_0x31155c){_0x389cda=_0x389cda-0x0;var _0x5889bc=_0x4daa[_0x389cda];return _0x5889bc;};'use strict';var _=require(_0xa4da('0x0'));var Redis=require(_0xa4da('0x1'));var qs=require(_0xa4da('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xa4da('0x3'));var logger=require(_0xa4da('0x4'))('api');var db=require(_0xa4da('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xa4da('0x6')]=_[_0xa4da('0x7')](config[_0xa4da('0x6')],{'host':_0xa4da('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4da('0x6')]));var redis=new Redis(config[_0xa4da('0x6')]);function respondWithStatusCode(_0x51930f,_0xe23d45){_0xe23d45=_0xe23d45||0xcc;return function(_0x3e964f){if(_0x3e964f){return _0x51930f['sendStatus'](_0xe23d45);}return _0x51930f['status'](_0xe23d45)[_0xa4da('0x9')]();};}function respondWithResult(_0x49fa26,_0x301f30){_0x301f30=_0x301f30||0xc8;return function(_0x2af756){if(_0x2af756){return _0x49fa26[_0xa4da('0xa')](_0x301f30)['json'](_0x2af756);}};}function respondWithFilteredResult(_0x2d1840,_0x7a64b2){return function(_0x2e4728){if(_0x2e4728){var _0x32bc64=typeof _0x7a64b2[_0xa4da('0xb')]==='undefined'&&typeof _0x7a64b2[_0xa4da('0xc')]===_0xa4da('0xd');var _0x588f0d=_0x2e4728[_0xa4da('0xe')];var _0x344f66=_0x32bc64?0x0:_0x7a64b2[_0xa4da('0xb')];var _0x38c282=_0x32bc64?_0x2e4728['count']:_0x7a64b2['offset']+_0x7a64b2[_0xa4da('0xc')];var _0x5e041e;if(_0x38c282>=_0x588f0d){_0x38c282=_0x588f0d;_0x5e041e=0xc8;}else{_0x5e041e=0xce;}_0x2d1840[_0xa4da('0xa')](_0x5e041e);return _0x2d1840[_0xa4da('0xf')]('Content-Range',_0x344f66+'-'+_0x38c282+'/'+_0x588f0d)['json'](_0x2e4728);}return null;};}function saveUpdates(_0x3dcbca){return function(_0xfdd21b){if(_0xfdd21b){return _0xfdd21b[_0xa4da('0x10')](_0x3dcbca)[_0xa4da('0x11')](function(_0x550aab){return _0x550aab;});}return null;};}function removeEntity(_0x245465){return function(_0x199fbb){if(_0x199fbb){return _0x199fbb[_0xa4da('0x12')]()[_0xa4da('0x11')](function(){_0x245465[_0xa4da('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176aa1){return function(_0x3ee147){if(!_0x3ee147){_0x176aa1[_0xa4da('0x13')](0x194);}return _0x3ee147;};}function handleError(_0x2a668e,_0x5e845e){_0x5e845e=_0x5e845e||0x1f4;return function(_0x2c9e77){logger[_0xa4da('0x14')](_0x2c9e77[_0xa4da('0x15')]);if(_0x2c9e77[_0xa4da('0x16')]){delete _0x2c9e77[_0xa4da('0x16')];}_0x2a668e[_0xa4da('0xa')](_0x5e845e)[_0xa4da('0x17')](_0x2c9e77);};}function maskClientSecret(_0x56ffe4){return _[_0xa4da('0x18')](_0x56ffe4[_0xa4da('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4dd4d8,_0x54a764){var _0x23a855={},_0x15f992={},_0x3a3e5d={'count':0x0,'rows':[]};var _0x4e7fcb=_[_0xa4da('0x1a')](db[_0xa4da('0x1b')]['rawAttributes'],function(_0x3180c0){return{'name':_0x3180c0[_0xa4da('0x1c')],'type':_0x3180c0[_0xa4da('0x1d')]['key']};});_0x15f992[_0xa4da('0x1e')]=_['map'](_0x4e7fcb,_0xa4da('0x16'));_0x15f992[_0xa4da('0x1f')]=_['keys'](_0x4dd4d8['query']);_0x15f992[_0xa4da('0x20')]=_[_0xa4da('0x21')](_0x15f992[_0xa4da('0x1e')],_0x15f992[_0xa4da('0x1f')]);_0x23a855[_0xa4da('0x22')]=_[_0xa4da('0x21')](_0x15f992['model'],qs[_0xa4da('0x23')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x23')]));_0x23a855[_0xa4da('0x22')]=_0x23a855[_0xa4da('0x22')][_0xa4da('0x24')]?_0x23a855[_0xa4da('0x22')]:_0x15f992[_0xa4da('0x1e')];if(!_0x4dd4d8['query'][_0xa4da('0x25')](_0xa4da('0x26'))){_0x23a855[_0xa4da('0xc')]=qs[_0xa4da('0xc')](_0x4dd4d8[_0xa4da('0x1f')]['limit']);_0x23a855[_0xa4da('0xb')]=qs[_0xa4da('0xb')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0xb')]);}_0x23a855[_0xa4da('0x27')]=qs[_0xa4da('0x28')](_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x28')]);_0x23a855['where']=qs['filters'](_[_0xa4da('0x29')](_0x4dd4d8[_0xa4da('0x1f')],_0x15f992['filters']),_0x4e7fcb);if(_0x4dd4d8['query'][_0xa4da('0x2a')]){_0x23a855[_0xa4da('0x2b')]=_[_0xa4da('0x2c')](_0x23a855[_0xa4da('0x2b')],{'$or':_[_0xa4da('0x1a')](_0x4e7fcb,function(_0x57a168){if(_0x57a168[_0xa4da('0x1d')]!==_0xa4da('0x2d')){var _0x3f1239={};_0x3f1239[_0x57a168[_0xa4da('0x16')]]={'$like':'%'+_0x4dd4d8[_0xa4da('0x1f')][_0xa4da('0x2a')]+'%'};return _0x3f1239;}})});}_0x23a855=_[_0xa4da('0x2c')]({},_0x23a855,_0x4dd4d8[_0xa4da('0x2e')]);var _0x18c8e6={'where':_0x23a855[_0xa4da('0x2b')]};return db[_0xa4da('0x1b')]['count'](_0x18c8e6)[_0xa4da('0x11')](function(_0x10be09){_0x3a3e5d['count']=_0x10be09;if(_0x4dd4d8['query'][_0xa4da('0x2f')]){_0x23a855['include']=[{'all':!![]}];}return db[_0xa4da('0x1b')][_0xa4da('0x30')](_0x23a855);})[_0xa4da('0x11')](function(_0x150d38){_0x3a3e5d[_0xa4da('0x31')]=_['map'](_0x150d38,function(_0xacecde){if(_0xacecde[_0xa4da('0x32')]===_0xa4da('0x33')){var _0x4a89d4=encryptor[_0xa4da('0x34')](_0xacecde[_0xa4da('0x35')]);_0xacecde[_0xa4da('0x35')]=maskClientSecret(_0x4a89d4);}return _0xacecde;});return _0x3a3e5d;})[_0xa4da('0x11')](respondWithFilteredResult(_0x54a764,_0x23a855))['catch'](handleError(_0x54a764,null));};exports[_0xa4da('0x36')]=function(_0x343098,_0x193b72){var _0x4ef36a={'raw':!![],'where':{'id':_0x343098[_0xa4da('0x37')]['id']}},_0x57492c={};_0x57492c[_0xa4da('0x1e')]=_[_0xa4da('0x38')](db['CloudProvider'][_0xa4da('0x39')]);_0x57492c['query']=_['keys'](_0x343098[_0xa4da('0x1f')]);_0x57492c[_0xa4da('0x20')]=_[_0xa4da('0x21')](_0x57492c[_0xa4da('0x1e')],_0x57492c[_0xa4da('0x1f')]);_0x4ef36a[_0xa4da('0x22')]=_[_0xa4da('0x21')](_0x57492c[_0xa4da('0x1e')],qs['fields'](_0x343098[_0xa4da('0x1f')]['fields']));_0x4ef36a[_0xa4da('0x22')]=_0x4ef36a[_0xa4da('0x22')]['length']?_0x4ef36a[_0xa4da('0x22')]:_0x57492c[_0xa4da('0x1e')];if(_0x343098['query']['includeAll']){_0x4ef36a[_0xa4da('0x3a')]=[{'all':!![]}];}_0x4ef36a=_[_0xa4da('0x2c')]({},_0x4ef36a,_0x343098[_0xa4da('0x2e')]);return db[_0xa4da('0x1b')][_0xa4da('0x3b')](_0x4ef36a)['then'](handleEntityNotFound(_0x193b72,null))['then'](function(_0x3a2d64){if(_0x3a2d64[_0xa4da('0x32')]===_0xa4da('0x33')){var _0x2c3cdd=encryptor[_0xa4da('0x34')](_0x3a2d64['data3']);_0x3a2d64[_0xa4da('0x35')]=maskClientSecret(_0x2c3cdd);}return _0x3a2d64;})[_0xa4da('0x11')](respondWithResult(_0x193b72,null))[_0xa4da('0x3c')](handleError(_0x193b72,null));};exports[_0xa4da('0x3d')]=function(_0x1fa6e1,_0x3ce0be){if(!_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x16')])throw new Error(_0xa4da('0x3f'));if(!_0x1fa6e1['body'][_0xa4da('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0xe4265=db['CloudProvider'][_0xa4da('0x39')][_0xa4da('0x32')][_0xa4da('0x40')];if(!_0xe4265[_0xa4da('0x41')](_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x32')]))throw new Error(_0xa4da('0x42')+_0xe4265[_0xa4da('0x43')](',\x20'));if(_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x32')]==='MicrosoftAzure'&&_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x35')]){_0x1fa6e1[_0xa4da('0x3e')]['data3']=encryptor[_0xa4da('0x44')](_0x1fa6e1[_0xa4da('0x3e')][_0xa4da('0x35')]);}return db[_0xa4da('0x1b')]['create'](_0x1fa6e1[_0xa4da('0x3e')],{})[_0xa4da('0x11')](respondWithResult(_0x3ce0be,0xc9))[_0xa4da('0x3c')](handleError(_0x3ce0be,null));};exports['update']=function(_0x32407a,_0x23495b){if(_0x32407a[_0xa4da('0x3e')]['id']){delete _0x32407a[_0xa4da('0x3e')]['id'];}return db[_0xa4da('0x1b')][_0xa4da('0x3b')]({'where':{'id':_0x32407a[_0xa4da('0x37')]['id']}})[_0xa4da('0x11')](handleEntityNotFound(_0x23495b,null))[_0xa4da('0x11')](function(_0xc78927){if(_0xc78927[_0xa4da('0x32')]==='MicrosoftAzure'&&_0x32407a[_0xa4da('0x3e')]['data3']){_0x32407a[_0xa4da('0x3e')]['data3']=encryptor[_0xa4da('0x44')](_0x32407a[_0xa4da('0x3e')]['data3']);}return _0xc78927;})[_0xa4da('0x11')](saveUpdates(_0x32407a[_0xa4da('0x3e')],null))[_0xa4da('0x11')](respondWithResult(_0x23495b,null))[_0xa4da('0x3c')](handleError(_0x23495b,null));};exports[_0xa4da('0x12')]=function(_0x27dab2,_0x3b5c36){return db['CloudProvider'][_0xa4da('0x3b')]({'where':{'id':_0x27dab2[_0xa4da('0x37')]['id']}})[_0xa4da('0x11')](handleEntityNotFound(_0x3b5c36,null))[_0xa4da('0x11')](removeEntity(_0x3b5c36,null))[_0xa4da('0x3c')](handleError(_0x3b5c36,null));};exports[_0xa4da('0x45')]=function(_0x57b7a0,_0x2b32f3){return db[_0xa4da('0x1b')][_0xa4da('0x46')]({'where':{'id':_0x57b7a0[_0xa4da('0x37')]['id']},'raw':!![]})[_0xa4da('0x11')](function(_0x59de18){if(!_0x59de18)return _0x2b32f3[_0xa4da('0x13')](0x194);return{'url':oauth[_0xa4da('0x47')](_0x59de18,_0x57b7a0[_0xa4da('0x48')]['id'])};})[_0xa4da('0x11')](respondWithResult(_0x2b32f3,null))[_0xa4da('0x3c')](handleError(_0x2b32f3,null));};exports[_0xa4da('0x49')]=function(_0x3f85ed,_0xcd254d){var _0x32b119=_0x3f85ed[_0xa4da('0x3e')];var _0x3e05cb;var _0x5a0d0b;if(_0x32b119[_0xa4da('0x14')])throw _0x32b119;redis[_0xa4da('0x4a')](_0x32b119['state'])[_0xa4da('0x11')](function(_0x2031eb){if(!_0x2031eb)throw new Error(_0xa4da('0x4b'));_0x3e05cb=JSON[_0xa4da('0x4c')](_0x2031eb);var _0x1c313d=Buffer[_0xa4da('0x4d')](_0x32b119['state'],_0xa4da('0x4e'))['toString'](_0xa4da('0x4f'));_0x5a0d0b=JSON[_0xa4da('0x4c')](_0x1c313d);if(!oauth['isValidIdToken'](_0x32b119['id_token'],_0x3e05cb['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xa4da('0x50')](_0x32b119[_0xa4da('0x51')]);return oauth[_0xa4da('0x52')](_0x32b119[_0xa4da('0x53')],_0x3e05cb);})[_0xa4da('0x11')](function(_0x1be52b){_0x3e05cb[_0xa4da('0x54')]=_0x1be52b[_0xa4da('0x55')];_0x3e05cb['data6']=_0x1be52b[_0xa4da('0x56')];return db['CloudProvider'][_0xa4da('0x10')]({'data5':_0x3e05cb['data5'],'data6':_0x3e05cb[_0xa4da('0x57')]},{'where':{'id':_0x3e05cb['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x3e05cb);socket[_0xa4da('0x58')]('microsoftAuthorization:success',{'id':_0x5a0d0b['id']});return;})['then'](respondWithStatusCode(_0xcd254d,null))[_0xa4da('0x3c')](function(_0x1af8de){if(_0x5a0d0b){socket[_0xa4da('0x58')](_0xa4da('0x59'),{'id':_0x5a0d0b['id']});}if(!_0x3e05cb){logger[_0xa4da('0x14')](_0xa4da('0x5a'),_0x1af8de);return _0xcd254d['status'](0x1f4)['send'](_0x1af8de[_0xa4da('0x5b')]);}logger[_0xa4da('0x14')](_0xa4da('0x5c'),_0x3e05cb['id'],JSON[_0xa4da('0x5d')](_0x1af8de));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 84f2a3a..f905e5c 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 _0x62ab=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x62ab,0xd6));var _0xb62a=function(_0x2c8ab8,_0xb3663e){_0x2c8ab8=_0x2c8ab8-0x0;var _0x1bcbe3=_0x62ab[_0x2c8ab8];return _0x1bcbe3;};'use strict';var _=require(_0xb62a('0x0'));var util=require(_0xb62a('0x1'));var logger=require(_0xb62a('0x2'))(_0xb62a('0x3'));var moment=require(_0xb62a('0x4'));var BPromise=require(_0xb62a('0x5'));var rp=require(_0xb62a('0x6'));var fs=require('fs');var path=require(_0xb62a('0x7'));var rimraf=require(_0xb62a('0x8'));var config=require('../../config/environment');var attributes=require(_0xb62a('0x9'));module[_0xb62a('0xa')]=function(_0x48d711,_0x61ed74){return _0x48d711[_0xb62a('0xb')](_0xb62a('0xc'),attributes,{'tableName':_0xb62a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e35=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17d64d,_0x327d53){var _0x17eb46=function(_0x89f708){while(--_0x89f708){_0x17d64d['push'](_0x17d64d['shift']());}};_0x17eb46(++_0x327d53);}(_0x2e35,0xe6));var _0x52e3=function(_0x561913,_0x2f3c72){_0x561913=_0x561913-0x0;var _0x23487f=_0x2e35[_0x561913];return _0x23487f;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))(_0x52e3('0x3'));var moment=require(_0x52e3('0x4'));var BPromise=require(_0x52e3('0x5'));var rp=require(_0x52e3('0x6'));var fs=require('fs');var path=require(_0x52e3('0x7'));var rimraf=require(_0x52e3('0x8'));var config=require(_0x52e3('0x9'));var attributes=require(_0x52e3('0xa'));module['exports']=function(_0x2c2a04,_0x55326f){return _0x2c2a04[_0x52e3('0xb')](_0x52e3('0xc'),attributes,{'tableName':_0x52e3('0xd'),'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 489848f..d57eff4 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 _0x8d6b=['https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','Dynamics365','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token','stringify','toString','hex','client_id','data1','response_type','redirect_uri','form_post','state','nonce','prompt','map','key','value','replace','set','iss','issuer','aud','audience','isAfter','unix','exp','data3','CloudProvider','findOne','then','data6','data4','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','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'];(function(_0x739bf5,_0x50002d){var _0x36510b=function(_0x210c62){while(--_0x210c62){_0x739bf5['push'](_0x739bf5['shift']());}};_0x36510b(++_0x50002d);}(_0x8d6b,0x1a4));var _0xb8d6=function(_0x3f9e3a,_0x524ef1){_0x3f9e3a=_0x3f9e3a-0x0;var _0xd1c420=_0x8d6b[_0x3f9e3a];return _0xd1c420;};'use strict';var _=require(_0xb8d6('0x0'));var crypto=require('crypto');var jwt=require(_0xb8d6('0x1'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xb8d6('0x2'));var encryptor=require(_0xb8d6('0x3'));var config=require(_0xb8d6('0x4'));var logger=require(_0xb8d6('0x5'))(_0xb8d6('0x6'));var schedule=require(_0xb8d6('0x7'));var db=require(_0xb8d6('0x8'))['db'];config[_0xb8d6('0x9')]=_[_0xb8d6('0xa')](config[_0xb8d6('0x9')],{'host':_0xb8d6('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb8d6('0x9')]);var MICROSOFT_AUTH_URL=_0xb8d6('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb8d6('0xd'),_0xb8d6('0xe'),_0xb8d6('0xf'),_0xb8d6('0x10'),_0xb8d6('0x11'),_0xb8d6('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb8d6('0xd'),_0xb8d6('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xb8d6('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x431463){var _0x380cd5=_['map'](AZURE_AUTH_SCOPES[_0x431463[_0xb8d6('0x14')]]);if(_0x431463[_0xb8d6('0x14')]===_0xb8d6('0x15'))_0x380cd5['push'](_0x431463[_0xb8d6('0x16')]+_0xb8d6('0x17'));return _0x380cd5[_0xb8d6('0x18')]('\x20');}function getAccessTokenScope(_0x172434){if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x19'))return _0xb8d6('0x11');if(_0x172434[_0xb8d6('0x14')]===_0xb8d6('0x15'))return _0x172434[_0xb8d6('0x16')]+_0xb8d6('0x17');}function generateMicrosoftAuthorizationUrl(_0x3bf2ec,_0x2963f1){var _0x42e286=MICROSOFT_AUTH_URL['replace'](_0xb8d6('0x1a'),_0x3bf2ec[_0xb8d6('0x1b')]);var _0x1f8739=['code',_0xb8d6('0x1c')];var _0x48e7e2=Buffer['from'](JSON[_0xb8d6('0x1d')]({'id':_0x2963f1}))['toString']('base64');var _0x4b38c7=crypto['randomBytes'](0x10)[_0xb8d6('0x1e')](_0xb8d6('0x1f'));var _0x278dd5=getAuthorizationScopes(_0x3bf2ec);var _0x1c643c=[{'key':_0xb8d6('0x20'),'value':_0x3bf2ec[_0xb8d6('0x21')]},{'key':_0xb8d6('0x22'),'value':encodeURIComponent(_0x1f8739[_0xb8d6('0x18')]('\x20'))},{'key':_0xb8d6('0x23'),'value':_0x3bf2ec['data4']},{'key':'response_mode','value':_0xb8d6('0x24')},{'key':'scope','value':encodeURIComponent(_0x278dd5)},{'key':_0xb8d6('0x25'),'value':_0x48e7e2},{'key':_0xb8d6('0x26'),'value':_0x4b38c7},{'key':_0xb8d6('0x27'),'value':'login'}];var _0x4bea7b=_0x42e286+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb8d6('0x28')](_0x1c643c,function(_0x17d751){return _0x17d751[_0xb8d6('0x29')]+'='+_0x17d751[_0xb8d6('0x2a')];})[_0xb8d6('0x18')]('&');_0x3bf2ec['oauth2Claims']={'issuer':_0x42e286[_0xb8d6('0x2b')]('oauth2/',''),'audience':_0x3bf2ec[_0xb8d6('0x21')],'state':_0x48e7e2,'nonce':_0x4b38c7};redis[_0xb8d6('0x2c')](_0x48e7e2,JSON[_0xb8d6('0x1d')](_0x3bf2ec));return _0x4bea7b;}function isValidIdToken(_0x88c3a1,_0x3080dc){try{var _0x56f77a=jwt['decode'](_0x88c3a1,{'complete':!![]});var _0x40e12b=_0x56f77a['payload'];if(_0x40e12b[_0xb8d6('0x2d')]!==_0x3080dc[_0xb8d6('0x2e')])return![];if(_0x40e12b[_0xb8d6('0x2f')]!==_0x3080dc[_0xb8d6('0x30')])return![];if(_0x40e12b['nonce']!==_0x3080dc[_0xb8d6('0x26')])return![];if(moment()[_0xb8d6('0x31')](moment[_0xb8d6('0x32')](_0x40e12b[_0xb8d6('0x33')])))return![];return!![];}catch(_0x51d7cb){throw _0x51d7cb;}}function refreshOauth2MicrosoftAccessToken(_0x3f3ee0){return Promise['resolve']()['then'](function(){if(_0x3f3ee0[_0xb8d6('0x34')])return _0x3f3ee0;return db[_0xb8d6('0x35')][_0xb8d6('0x36')]({'where':{'id':_0x3f3ee0['id']},'raw':!![]});})[_0xb8d6('0x37')](function(_0x2f16fc){var _0x5bebc1={'grant_type':'refresh_token','refresh_token':_0x2f16fc[_0xb8d6('0x38')],'scope':getAccessTokenScope(_0x2f16fc),'redirect_uri':_0x2f16fc[_0xb8d6('0x39')],'client_id':_0x2f16fc[_0xb8d6('0x21')],'client_secret':encryptor['decryptString'](_0x2f16fc[_0xb8d6('0x34')])};var _0x167dca={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x2f16fc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5bebc1,'json':!![]};return rp(_0x167dca);})[_0xb8d6('0x37')](function(_0x47e367){_0x3f3ee0[_0xb8d6('0x3b')]=_0x47e367[_0xb8d6('0x3c')];_0x3f3ee0[_0xb8d6('0x38')]=_0x47e367['refresh_token'];return db['CloudProvider'][_0xb8d6('0x3d')]({'data5':_0x3f3ee0['data5'],'data6':_0x3f3ee0[_0xb8d6('0x38')]},{'where':{'id':_0x3f3ee0['id']}});})[_0xb8d6('0x37')](function(){return _0x3f3ee0;})[_0xb8d6('0x3e')](function(_0x3e0e6e){logger[_0xb8d6('0x3f')](_0xb8d6('0x40'),_0x3f3ee0['id'],_0x3e0e6e);});}function getOauth2MicrosoftAccessToken(_0xd17c4,_0x199fd8){var _0x2e8dc2={'grant_type':_0xb8d6('0x41'),'code':_0xd17c4,'scope':getAccessTokenScope(_0x199fd8),'redirect_uri':_0x199fd8[_0xb8d6('0x39')],'client_id':_0x199fd8[_0xb8d6('0x21')],'client_secret':encryptor[_0xb8d6('0x42')](_0x199fd8[_0xb8d6('0x34')])};var _0xf341bc={'method':_0xb8d6('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xb8d6('0x2b')](_0xb8d6('0x1a'),_0x199fd8[_0xb8d6('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8dc2,'json':!![]};return rp(_0xf341bc);}function startRefreshInterval(_0x56f827){var _0x310758=schedule['intervals'];if(_0x310758[_0x56f827['id']])clearInterval(_0x310758[_0x56f827['id']]);_0x310758[_0x56f827['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb8d6('0x43')](this,{'id':_0x56f827['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb8d6('0x44')]=_0x310758;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xb8d6('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x18aa20){var _0x4cb686=_0x18aa20[_0xb8d6('0x28')](function(_0x19f94d){return refreshOauth2MicrosoftAccessToken(_0x19f94d)[_0xb8d6('0x37')](function(_0x462641){startRefreshInterval(_0x462641);});});return Promise[_0xb8d6('0x46')](_0x4cb686);})[_0xb8d6('0x3e')](function(_0x3e6a1c){var _0x333195=_0x3e6a1c?util['inspect'](_0x3e6a1c,{'showHidden':![],'depth':null}):'';logger[_0xb8d6('0x3f')](_0xb8d6('0x47'),_0x333195);});}module[_0xb8d6('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x0433=['hex','client_id','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','data1','set','decode','payload','issuer','aud','audience','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','{TENANT_ID}','id_token','from','stringify','base64','randomBytes'];(function(_0x420ab0,_0x500c31){var _0x5b29dd=function(_0x48dab0){while(--_0x48dab0){_0x420ab0['push'](_0x420ab0['shift']());}};_0x5b29dd(++_0x500c31);}(_0x0433,0xd5));var _0x3043=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0433[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x3043('0x0'));var crypto=require('crypto');var jwt=require(_0x3043('0x1'));var moment=require(_0x3043('0x2'));var Redis=require(_0x3043('0x3'));var rp=require(_0x3043('0x4'));var util=require(_0x3043('0x5'));var encryptor=require(_0x3043('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x3043('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x3043('0x8'))['db'];config[_0x3043('0x9')]=_[_0x3043('0xa')](config[_0x3043('0x9')],{'host':_0x3043('0xb'),'port':0x18eb});var redis=new Redis(config[_0x3043('0x9')]);var MICROSOFT_AUTH_URL=_0x3043('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3043('0xd'),'profile','email',_0x3043('0xe'),_0x3043('0xf'),_0x3043('0x10'),_0x3043('0x11')],'Dynamics365':[_0x3043('0xd'),_0x3043('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x3043('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x3043('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x841923){var _0x2ca88e=_[_0x3043('0x14')](AZURE_AUTH_SCOPES[_0x841923[_0x3043('0x15')]]);if(_0x841923['type']===_0x3043('0x16'))_0x2ca88e[_0x3043('0x17')](_0x841923['data7']+_0x3043('0x18'));return _0x2ca88e[_0x3043('0x19')]('\x20');}function getAccessTokenScope(_0xda3a23){if(_0xda3a23[_0x3043('0x15')]===_0x3043('0x1a'))return _0x3043('0xf');if(_0xda3a23[_0x3043('0x15')]===_0x3043('0x16'))return _0xda3a23['data7']+_0x3043('0x18');}function generateMicrosoftAuthorizationUrl(_0x7c3a66,_0x26e90e){var _0x4d3568=MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0x7c3a66['data2']);var _0x27c23e=['code',_0x3043('0x1c')];var _0x1b74b6=Buffer[_0x3043('0x1d')](JSON[_0x3043('0x1e')]({'id':_0x26e90e}))['toString'](_0x3043('0x1f'));var _0x1dc9cf=crypto[_0x3043('0x20')](0x10)['toString'](_0x3043('0x21'));var _0xc49a70=getAuthorizationScopes(_0x7c3a66);var _0x4e226c=[{'key':_0x3043('0x22'),'value':_0x7c3a66['data1']},{'key':_0x3043('0x23'),'value':encodeURIComponent(_0x27c23e[_0x3043('0x19')]('\x20'))},{'key':_0x3043('0x24'),'value':_0x7c3a66['data4']},{'key':_0x3043('0x25'),'value':_0x3043('0x26')},{'key':_0x3043('0x27'),'value':encodeURIComponent(_0xc49a70)},{'key':_0x3043('0x28'),'value':_0x1b74b6},{'key':_0x3043('0x29'),'value':_0x1dc9cf},{'key':_0x3043('0x2a'),'value':_0x3043('0x2b')}];var _0x1aef41=_0x4d3568+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4e226c,function(_0x1f395d){return _0x1f395d[_0x3043('0x2c')]+'='+_0x1f395d[_0x3043('0x2d')];})[_0x3043('0x19')]('&');_0x7c3a66[_0x3043('0x2e')]={'issuer':_0x4d3568[_0x3043('0x2f')](_0x3043('0x30'),''),'audience':_0x7c3a66[_0x3043('0x31')],'state':_0x1b74b6,'nonce':_0x1dc9cf};redis[_0x3043('0x32')](_0x1b74b6,JSON[_0x3043('0x1e')](_0x7c3a66));return _0x1aef41;}function isValidIdToken(_0x1b0220,_0x26d0d9){try{var _0x3d66ea=jwt[_0x3043('0x33')](_0x1b0220,{'complete':!![]});var _0x24c081=_0x3d66ea[_0x3043('0x34')];if(_0x24c081['iss']!==_0x26d0d9[_0x3043('0x35')])return![];if(_0x24c081[_0x3043('0x36')]!==_0x26d0d9[_0x3043('0x37')])return![];if(_0x24c081[_0x3043('0x29')]!==_0x26d0d9[_0x3043('0x29')])return![];if(moment()['isAfter'](moment[_0x3043('0x38')](_0x24c081[_0x3043('0x39')])))return![];return!![];}catch(_0x4972bb){throw _0x4972bb;}}function refreshOauth2MicrosoftAccessToken(_0x3466e7){return Promise[_0x3043('0x3a')]()[_0x3043('0x3b')](function(){if(_0x3466e7['data3'])return _0x3466e7;return db[_0x3043('0x3c')][_0x3043('0x3d')]({'where':{'id':_0x3466e7['id']},'raw':!![]});})[_0x3043('0x3b')](function(_0x2c3dce){var _0xe78a2={'grant_type':_0x3043('0x3e'),'refresh_token':_0x2c3dce[_0x3043('0x3f')],'scope':getAccessTokenScope(_0x2c3dce),'redirect_uri':_0x2c3dce[_0x3043('0x40')],'client_id':_0x2c3dce['data1'],'client_secret':encryptor[_0x3043('0x41')](_0x2c3dce[_0x3043('0x42')])};var _0x342c90={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0x2c3dce[_0x3043('0x43')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe78a2,'json':!![]};return rp(_0x342c90);})[_0x3043('0x3b')](function(_0x12581c){_0x3466e7[_0x3043('0x44')]=_0x12581c[_0x3043('0x45')];_0x3466e7[_0x3043('0x3f')]=_0x12581c[_0x3043('0x3e')];return db[_0x3043('0x3c')][_0x3043('0x46')]({'data5':_0x3466e7[_0x3043('0x44')],'data6':_0x3466e7[_0x3043('0x3f')]},{'where':{'id':_0x3466e7['id']}});})[_0x3043('0x3b')](function(){return _0x3466e7;})[_0x3043('0x47')](function(_0x318de2){logger[_0x3043('0x48')](_0x3043('0x49'),_0x3466e7['id'],_0x318de2);});}function getOauth2MicrosoftAccessToken(_0x4e98d1,_0xb75226){var _0x33bfbd={'grant_type':_0x3043('0x4a'),'code':_0x4e98d1,'scope':getAccessTokenScope(_0xb75226),'redirect_uri':_0xb75226[_0x3043('0x40')],'client_id':_0xb75226[_0x3043('0x31')],'client_secret':encryptor['decryptString'](_0xb75226[_0x3043('0x42')])};var _0x105f89={'method':_0x3043('0x4b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3043('0x1b'),_0xb75226[_0x3043('0x43')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33bfbd,'json':!![]};return rp(_0x105f89);}function startRefreshInterval(_0x13326f){var _0x46a3f3=schedule[_0x3043('0x4c')];if(_0x46a3f3[_0x13326f['id']])clearInterval(_0x46a3f3[_0x13326f['id']]);_0x46a3f3[_0x13326f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3043('0x4d')](this,{'id':_0x13326f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3043('0x4c')]=_0x46a3f3;}function startAllRefreshIntervals(){return db[_0x3043('0x3c')][_0x3043('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3043('0x3b')](function(_0x278744){var _0x73221f=_0x278744[_0x3043('0x14')](function(_0x3c865e){return refreshOauth2MicrosoftAccessToken(_0x3c865e)['then'](function(_0x55b145){startRefreshInterval(_0x55b145);});});return Promise[_0x3043('0x4f')](_0x73221f);})[_0x3043('0x47')](function(_0x36ac9c){var _0x152e5a=_0x36ac9c?util[_0x3043('0x50')](_0x36ac9c,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x152e5a);});}module[_0x3043('0x51')]={'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 6d4668a..7240584 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 _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6ac2,0x184));var _0x26ac=function(_0x34d0e2,_0x5af29d){_0x34d0e2=_0x34d0e2-0x0;var _0x47004f=_0x6ac2[_0x34d0e2];return _0x47004f;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});} \ No newline at end of file +var _0xb511=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x263c58,_0x252bb8){var _0x5232aa=function(_0x25febe){while(--_0x25febe){_0x263c58['push'](_0x263c58['shift']());}};_0x5232aa(++_0x252bb8);}(_0xb511,0x165));var _0x1b51=function(_0x182192,_0x28f6fa){_0x182192=_0x182192-0x0;var _0x1a1293=_0xb511[_0x182192];return _0x1a1293;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475add,_0x43c14c,_0x5e7ece){return new BPromise(function(_0xfa46a3,_0x1690c9){return client[_0x1b51('0xa')](_0x475add,_0x5e7ece)[_0x1b51('0xb')](function(_0x3ceabe){logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,_0x1b51('0xe'));logger['debug'](_0x1b51('0xf'),_0x43c14c,_0x1b51('0xe'),JSON[_0x1b51('0x10')](_0x3ceabe));if(_0x3ceabe[_0x1b51('0x11')]){if(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x12')]===0x1f4){logger['error'](_0x1b51('0xd'),_0x43c14c,_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);return _0x1690c9(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);}logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x3ceabe['error'][_0x1b51('0x13')]);return _0xfa46a3(_0x3ceabe['error']['message']);}else{logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,'request\x20sent');_0xfa46a3(_0x3ceabe[_0x1b51('0x14')][_0x1b51('0x13')]);}})[_0x1b51('0x15')](function(_0x4ea5e3){logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x4ea5e3);_0x1690c9(_0x4ea5e3);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7a07dc0..24a6f9b 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(_0x271fe0,_0x2b0c22){var _0x318b44=function(_0x7c8214){while(--_0x7c8214){_0x271fe0['push'](_0x271fe0['shift']());}};_0x318b44(++_0x2b0c22);}(_0xadb5,0xad));var _0x5adb=function(_0x4e17a8,_0x204391){_0x4e17a8=_0x4e17a8-0x0;var _0x4a53c2=_0xadb5[_0x4e17a8];return _0x4a53c2;};'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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x4b8f43,_0x2534d2){var _0x39d806=function(_0x38490d){while(--_0x38490d){_0x4b8f43['push'](_0x4b8f43['shift']());}};_0x39d806(++_0x2534d2);}(_0xdb28,0x106));var _0x8db2=function(_0xd97d1f,_0xc5377f){_0xd97d1f=_0xd97d1f-0x0;var _0x57cd28=_0xdb28[_0xd97d1f];return _0x57cd28;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 0901a09..8a4ceea 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 _0x2aff=['STRING','name','exports'];(function(_0x265b59,_0x42b00e){var _0x5d81b9=function(_0x17445f){while(--_0x17445f){_0x265b59['push'](_0x265b59['shift']());}};_0x5d81b9(++_0x42b00e);}(_0x2aff,0x6b));var _0xf2af=function(_0x14adfc,_0x2f05fa){_0x14adfc=_0x14adfc-0x0;var _0x384191=_0x2aff[_0x14adfc];return _0x384191;};'use strict';var Sequelize=require('sequelize');module[_0xf2af('0x0')]={'name':{'type':Sequelize[_0xf2af('0x1')],'unique':_0xf2af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf2af('0x1')]},'companyId':{'type':Sequelize[_0xf2af('0x1')]},'website':{'type':Sequelize[_0xf2af('0x1')]},'phone':{'type':Sequelize[_0xf2af('0x1')]},'fax':{'type':Sequelize[_0xf2af('0x1')]},'type':{'type':Sequelize[_0xf2af('0x1')]},'street':{'type':Sequelize[_0xf2af('0x1')]},'postalCode':{'type':Sequelize[_0xf2af('0x1')]},'city':{'type':Sequelize[_0xf2af('0x1')]},'country':{'type':Sequelize[_0xf2af('0x1')]},'email':{'type':Sequelize[_0xf2af('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf2af('0x1')]},'sStreet':{'type':Sequelize[_0xf2af('0x1')]},'sPostalCode':{'type':Sequelize[_0xf2af('0x1')]},'sCity':{'type':Sequelize[_0xf2af('0x1')]},'sCountry':{'type':Sequelize[_0xf2af('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3687=['STRING','name','sequelize'];(function(_0x251300,_0x26dc28){var _0xbe458=function(_0x1b73c8){while(--_0x1b73c8){_0x251300['push'](_0x251300['shift']());}};_0xbe458(++_0x26dc28);}(_0x3687,0x188));var _0x7368=function(_0x10dc3a,_0x274aa8){_0x10dc3a=_0x10dc3a-0x0;var _0x66550b=_0x3687[_0x10dc3a];return _0x66550b;};'use strict';var Sequelize=require(_0x7368('0x0'));module['exports']={'name':{'type':Sequelize[_0x7368('0x1')],'unique':_0x7368('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7368('0x1')]},'companyId':{'type':Sequelize[_0x7368('0x1')]},'website':{'type':Sequelize[_0x7368('0x1')]},'phone':{'type':Sequelize[_0x7368('0x1')]},'fax':{'type':Sequelize[_0x7368('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7368('0x1')]},'city':{'type':Sequelize[_0x7368('0x1')]},'country':{'type':Sequelize[_0x7368('0x1')]},'email':{'type':Sequelize[_0x7368('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7368('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7368('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e0fe10f..12f061e 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 _0xd245=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields'];(function(_0x3de6ad,_0x56ddd2){var _0x5c7ff3=function(_0x2591c5){while(--_0x2591c5){_0x3de6ad['push'](_0x3de6ad['shift']());}};_0x5c7ff3(++_0x56ddd2);}(_0xd245,0x77));var _0x5d24=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xd245[_0x1709e7];return _0x402819;};'use strict';var emlformat=require(_0x5d24('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d24('0x1'));var rp=require(_0x5d24('0x2'));var moment=require('moment');var BPromise=require(_0x5d24('0x3'));var Mustache=require('mustache');var util=require(_0x5d24('0x4'));var path=require(_0x5d24('0x5'));var sox=require('sox');var csv=require(_0x5d24('0x6'));var ejs=require(_0x5d24('0x7'));var fs=require('fs');var fs_extra=require(_0x5d24('0x8'));var _=require(_0x5d24('0x9'));var squel=require(_0x5d24('0xa'));var crypto=require(_0x5d24('0xb'));var jsforce=require(_0x5d24('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d24('0xd'));var Papa=require('papaparse');var Redis=require(_0x5d24('0xe'));var authService=require(_0x5d24('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5d24('0x10'));var hardwareService=require(_0x5d24('0x11'));var logger=require(_0x5d24('0x12'))(_0x5d24('0x13'));var utils=require(_0x5d24('0x14'));var config=require(_0x5d24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d24('0x16'))['db'];function respondWithStatusCode(_0x3da550,_0x2dc999){_0x2dc999=_0x2dc999||0xcc;return function(_0x5c272e){if(_0x5c272e){return _0x3da550['sendStatus'](_0x2dc999);}return _0x3da550['status'](_0x2dc999)[_0x5d24('0x17')]();};}function respondWithResult(_0xb0ee71,_0x94fbde){_0x94fbde=_0x94fbde||0xc8;return function(_0x2b4dde){if(_0x2b4dde){return _0xb0ee71[_0x5d24('0x18')](_0x94fbde)[_0x5d24('0x19')](_0x2b4dde);}};}function respondWithFilteredResult(_0x39109b,_0x2cf044){return function(_0x54a18c){if(_0x54a18c){var _0x64fd1e=typeof _0x2cf044['offset']===_0x5d24('0x1a')&&typeof _0x2cf044['limit']===_0x5d24('0x1a');var _0x44cb4a=_0x54a18c[_0x5d24('0x1b')];var _0x5cf1e8=_0x64fd1e?0x0:_0x2cf044[_0x5d24('0x1c')];var _0x10a9ae=_0x64fd1e?_0x54a18c[_0x5d24('0x1b')]:_0x2cf044[_0x5d24('0x1c')]+_0x2cf044['limit'];var _0x448569;if(_0x10a9ae>=_0x44cb4a){_0x10a9ae=_0x44cb4a;_0x448569=0xc8;}else{_0x448569=0xce;}_0x39109b[_0x5d24('0x18')](_0x448569);return _0x39109b['set'](_0x5d24('0x1d'),_0x5cf1e8+'-'+_0x10a9ae+'/'+_0x44cb4a)['json'](_0x54a18c);}return null;};}function patchUpdates(_0x52605a){return function(_0x2d6b1f){try{jsonpatch[_0x5d24('0x1e')](_0x2d6b1f,_0x52605a,!![]);}catch(_0x4d1690){return BPromise[_0x5d24('0x1f')](_0x4d1690);}return _0x2d6b1f[_0x5d24('0x20')]();};}function saveUpdates(_0x2388aa,_0x5e41ea){return function(_0x40e116){if(_0x40e116){return _0x40e116[_0x5d24('0x21')](_0x2388aa)[_0x5d24('0x22')](function(_0x2eb778){return _0x2eb778;});}return null;};}function removeEntity(_0x3d9c4d,_0x139d35){return function(_0x5873e2){if(_0x5873e2){return _0x5873e2['destroy']()['then'](function(){var _0x889391=_0x5873e2['get']({'plain':!![]});var _0x4b5964='Companies';return db[_0x5d24('0x23')][_0x5d24('0x24')]({'where':{'type':_0x4b5964,'resourceId':_0x889391['id']}})[_0x5d24('0x22')](function(){return _0x5873e2;});})[_0x5d24('0x22')](function(){_0x3d9c4d[_0x5d24('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf3fc1,_0x1652cd){return function(_0x9c4f2b){if(!_0x9c4f2b){_0xcf3fc1[_0x5d24('0x25')](0x194);}return _0x9c4f2b;};}function handleError(_0x2b8b20,_0x2488bd){_0x2488bd=_0x2488bd||0x1f4;return function(_0x134c95){logger[_0x5d24('0x26')](_0x134c95['stack']);if(_0x134c95[_0x5d24('0x27')]){delete _0x134c95[_0x5d24('0x27')];}_0x2b8b20[_0x5d24('0x18')](_0x2488bd)[_0x5d24('0x28')](_0x134c95);};}exports[_0x5d24('0x29')]=function(_0x38b722,_0x4190eb){var _0x48d6fc={},_0x116eaa={},_0x28f80a={'count':0x0,'rows':[]};return db[_0x5d24('0x2a')][_0x5d24('0x2b')]()[_0x5d24('0x22')](function(_0x505918){_0x116eaa[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](_0x505918);_0x116eaa['query']=_['keys'](_0x38b722[_0x5d24('0x2e')]);_0x116eaa[_0x5d24('0x2f')]=_[_0x5d24('0x30')](_0x116eaa['model'],_0x116eaa[_0x5d24('0x2e')]);_0x48d6fc[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x116eaa['model'],qs[_0x5d24('0x32')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x48d6fc['attributes']=_0x48d6fc[_0x5d24('0x31')][_0x5d24('0x33')]?_0x48d6fc[_0x5d24('0x31')]:_0x116eaa[_0x5d24('0x2c')];if(!_0x38b722[_0x5d24('0x2e')][_0x5d24('0x34')](_0x5d24('0x35'))){_0x48d6fc['limit']=qs[_0x5d24('0x36')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x48d6fc[_0x5d24('0x1c')]=qs[_0x5d24('0x1c')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x1c')]);}_0x48d6fc[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x38b722[_0x5d24('0x2e')][_0x5d24('0x38')]);_0x48d6fc[_0x5d24('0x39')]=qs[_0x5d24('0x2f')](_['pick'](_0x38b722[_0x5d24('0x2e')],_0x116eaa[_0x5d24('0x2f')]),_0x505918);if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x48d6fc[_0x5d24('0x39')]=_['merge'](_0x48d6fc[_0x5d24('0x39')],{'$or':_[_0x5d24('0x3b')](_0x48d6fc[_0x5d24('0x31')],function(_0x15ca3b){var _0x149938={};_0x149938[_0x15ca3b]={'$like':'%'+_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3a')]+'%'};return _0x149938;})});}_0x48d6fc=_[_0x5d24('0x3c')]({},_0x48d6fc,_0x38b722[_0x5d24('0x3d')]);var _0x56bc01={'where':_0x48d6fc[_0x5d24('0x39')]};return db[_0x5d24('0x2a')][_0x5d24('0x1b')](_0x56bc01)['then'](function(_0x39ca5c){_0x28f80a['count']=_0x39ca5c;if(_0x38b722[_0x5d24('0x2e')][_0x5d24('0x3e')]){_0x48d6fc[_0x5d24('0x3f')]=[{'all':!![]}];}return db[_0x5d24('0x2a')][_0x5d24('0x40')](_0x48d6fc);})[_0x5d24('0x22')](function(_0x35b446){_0x28f80a['rows']=_0x35b446;return _0x28f80a;})[_0x5d24('0x22')](respondWithFilteredResult(_0x4190eb,_0x48d6fc))['catch'](handleError(_0x4190eb,null));})[_0x5d24('0x41')](handleError(_0x4190eb,null));};exports[_0x5d24('0x42')]=function(_0x382e75,_0x461c23){var _0x1905ee={'raw':![],'where':{'id':_0x382e75[_0x5d24('0x43')]['id']}},_0x1fc4fd={};_0x1fc4fd[_0x5d24('0x2c')]=_[_0x5d24('0x2d')](db[_0x5d24('0x2a')][_0x5d24('0x44')]);_0x1fc4fd['query']=_[_0x5d24('0x2d')](_0x382e75[_0x5d24('0x2e')]);_0x1fc4fd['filters']=_[_0x5d24('0x30')](_0x1fc4fd[_0x5d24('0x2c')],_0x1fc4fd[_0x5d24('0x2e')]);_0x1905ee[_0x5d24('0x31')]=_['intersection'](_0x1fc4fd[_0x5d24('0x2c')],qs[_0x5d24('0x32')](_0x382e75[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x1905ee['attributes']=_0x1905ee[_0x5d24('0x31')][_0x5d24('0x33')]?_0x1905ee[_0x5d24('0x31')]:_0x1fc4fd[_0x5d24('0x2c')];if(_0x382e75[_0x5d24('0x2e')]['includeAll']){_0x1905ee['include']=[{'all':!![]}];}_0x1905ee=_[_0x5d24('0x3c')]({},_0x1905ee,_0x382e75[_0x5d24('0x3d')]);return db['CmCompany'][_0x5d24('0x45')](_0x1905ee)[_0x5d24('0x22')](handleEntityNotFound(_0x461c23,null))[_0x5d24('0x22')](respondWithResult(_0x461c23,null))['catch'](handleError(_0x461c23,null));};exports[_0x5d24('0x46')]=function(_0x5a4740,_0x44bf85){return db[_0x5d24('0x2a')]['create'](_0x5a4740[_0x5d24('0x47')],{})['then'](function(_0x21f322){var _0x226913=_0x5a4740['user'][_0x5d24('0x48')]({'plain':!![]});if(!_0x226913)throw new Error(_0x5d24('0x49'));if(_0x226913[_0x5d24('0x4a')]===_0x5d24('0x4b')){var _0x3e4eab=_0x21f322[_0x5d24('0x48')]({'plain':!![]});var _0x58e987='Companies';return db[_0x5d24('0x4c')][_0x5d24('0x45')]({'where':{'name':_0x58e987,'userProfileId':_0x226913['userProfileId']},'raw':!![]})[_0x5d24('0x22')](function(_0x5c368b){if(_0x5c368b&&_0x5c368b[_0x5d24('0x4d')]===0x0){return db[_0x5d24('0x23')][_0x5d24('0x46')]({'name':_0x3e4eab[_0x5d24('0x27')],'resourceId':_0x3e4eab['id'],'type':_0x5c368b[_0x5d24('0x27')],'sectionId':_0x5c368b['id']},{})['then'](function(){return _0x21f322;});}else{return _0x21f322;}})[_0x5d24('0x41')](function(_0x3b1c77){logger[_0x5d24('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b1c77);throw _0x3b1c77;});}return _0x21f322;})[_0x5d24('0x22')](respondWithResult(_0x44bf85,0xc9))[_0x5d24('0x41')](handleError(_0x44bf85,null));};exports['update']=function(_0x82aa80,_0x1d0501){if(_0x82aa80[_0x5d24('0x47')]['id']){delete _0x82aa80[_0x5d24('0x47')]['id'];}return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x82aa80[_0x5d24('0x43')]['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1d0501,null))[_0x5d24('0x22')](saveUpdates(_0x82aa80[_0x5d24('0x47')],null))[_0x5d24('0x22')](respondWithResult(_0x1d0501,null))[_0x5d24('0x41')](handleError(_0x1d0501,null));};exports['destroy']=function(_0x2e5444,_0x229a4d){return db['CmCompany'][_0x5d24('0x45')]({'where':{'id':_0x2e5444['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x229a4d,null))[_0x5d24('0x22')](removeEntity(_0x229a4d,null))[_0x5d24('0x41')](handleError(_0x229a4d,null));};exports[_0x5d24('0x2b')]=function(_0x2f7d73,_0x23dedc){return db['CmCompany'][_0x5d24('0x2b')]()[_0x5d24('0x22')](respondWithResult(_0x23dedc,null))[_0x5d24('0x41')](handleError(_0x23dedc,null));};exports[_0x5d24('0x4e')]=function(_0x129e6a,_0x1ad52f,_0x4b283f){return db[_0x5d24('0x4f')][_0x5d24('0x45')]({'where':{'id':_0x129e6a['params']['id']}})[_0x5d24('0x22')](handleEntityNotFound(_0x1ad52f,null))[_0x5d24('0x22')](function(_0x102a30){if(_0x102a30){return _0x102a30['addContacts'](_0x129e6a[_0x5d24('0x47')][_0x5d24('0x50')],_[_0x5d24('0x51')](_0x129e6a[_0x5d24('0x47')],[_0x5d24('0x50'),'id'])||{});}})[_0x5d24('0x22')](respondWithResult(_0x1ad52f,null))[_0x5d24('0x41')](handleError(_0x1ad52f,null));};exports[_0x5d24('0x52')]=function(_0x17e55b,_0x268b22,_0xf57e1d){var _0x582034={};var _0x55e221={};var _0x41bdbd;var _0x1a5a94;return db[_0x5d24('0x2a')][_0x5d24('0x53')]({'where':{'id':_0x17e55b[_0x5d24('0x43')]['id']}})['then'](handleEntityNotFound(_0x268b22,null))[_0x5d24('0x22')](function(_0x246304){if(_0x246304){_0x41bdbd=_0x246304;_0x55e221[_0x5d24('0x2c')]=_['keys'](db['CmContact'][_0x5d24('0x44')]);_0x55e221[_0x5d24('0x2e')]=_[_0x5d24('0x2d')](_0x17e55b[_0x5d24('0x2e')]);_0x55e221['filters']=_[_0x5d24('0x30')](_0x55e221[_0x5d24('0x2c')],_0x55e221[_0x5d24('0x2e')]);_0x582034[_0x5d24('0x31')]=_[_0x5d24('0x30')](_0x55e221['model'],qs[_0x5d24('0x32')](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x32')]));_0x582034[_0x5d24('0x31')]=_0x582034[_0x5d24('0x31')][_0x5d24('0x33')]?_0x582034[_0x5d24('0x31')]:_0x55e221[_0x5d24('0x2c')];_0x582034[_0x5d24('0x37')]=qs[_0x5d24('0x38')](_0x17e55b[_0x5d24('0x2e')]['sort']);_0x582034['where']=qs[_0x5d24('0x2f')](_[_0x5d24('0x54')](_0x17e55b['query'],_0x55e221['filters']));if(_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x3a')]){_0x582034[_0x5d24('0x39')]=_[_0x5d24('0x3c')](_0x582034[_0x5d24('0x39')],{'$or':_['map'](_0x582034[_0x5d24('0x31')],function(_0x4f90fd){var _0x2d8dfd={};_0x2d8dfd[_0x4f90fd]={'$like':'%'+_0x17e55b['query']['filter']+'%'};return _0x2d8dfd;})});}_0x582034=_[_0x5d24('0x3c')]({},_0x582034,_0x17e55b[_0x5d24('0x3d')]);return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2617e4){if(_0x2617e4){_0x1a5a94=_0x2617e4[_0x5d24('0x33')];if(!_0x17e55b[_0x5d24('0x2e')]['hasOwnProperty'](_0x5d24('0x35'))){_0x582034[_0x5d24('0x36')]=qs['limit'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x36')]);_0x582034[_0x5d24('0x1c')]=qs['offset'](_0x17e55b[_0x5d24('0x2e')][_0x5d24('0x1c')]);}return _0x41bdbd[_0x5d24('0x52')](_0x582034);}})['then'](function(_0x2afe8f){if(_0x2afe8f){return _0x2afe8f?{'count':_0x1a5a94,'rows':_0x2afe8f}:null;}})[_0x5d24('0x22')](respondWithResult(_0x268b22,null))[_0x5d24('0x41')](handleError(_0x268b22,null));}; \ No newline at end of file +var _0x52f7=['status','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','options','includeAll','include','catch','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','update','body','params','addContacts','CmContact','omit','ids','findOne','filter','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','set','apply','reject','save','then','get','Companies','UserProfileResource','destroy'];(function(_0x41e509,_0x33ab91){var _0x522164=function(_0xc05c2b){while(--_0xc05c2b){_0x41e509['push'](_0x41e509['shift']());}};_0x522164(++_0x33ab91);}(_0x52f7,0xdc));var _0x752f=function(_0x2944d8,_0x2af76d){_0x2944d8=_0x2944d8-0x0;var _0x1245e1=_0x52f7[_0x2944d8];return _0x1245e1;};'use strict';var emlformat=require(_0x752f('0x0'));var rimraf=require(_0x752f('0x1'));var zipdir=require(_0x752f('0x2'));var jsonpatch=require(_0x752f('0x3'));var rp=require(_0x752f('0x4'));var moment=require(_0x752f('0x5'));var BPromise=require(_0x752f('0x6'));var Mustache=require(_0x752f('0x7'));var util=require(_0x752f('0x8'));var path=require(_0x752f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x752f('0xa'));var fs=require('fs');var fs_extra=require(_0x752f('0xb'));var _=require(_0x752f('0xc'));var squel=require(_0x752f('0xd'));var crypto=require(_0x752f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x752f('0xf'));var toCsv=require(_0x752f('0x10'));var querystring=require(_0x752f('0x11'));var Papa=require(_0x752f('0x12'));var Redis=require('ioredis');var authService=require(_0x752f('0x13'));var qs=require(_0x752f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x752f('0x15'));var logger=require('../../config/logger')(_0x752f('0x16'));var utils=require(_0x752f('0x17'));var config=require(_0x752f('0x18'));var licenseUtil=require(_0x752f('0x19'));var db=require(_0x752f('0x1a'))['db'];function respondWithStatusCode(_0x4bbb45,_0xd9142f){_0xd9142f=_0xd9142f||0xcc;return function(_0x4e83a9){if(_0x4e83a9){return _0x4bbb45[_0x752f('0x1b')](_0xd9142f);}return _0x4bbb45['status'](_0xd9142f)[_0x752f('0x1c')]();};}function respondWithResult(_0x3a7c12,_0x3afba1){_0x3afba1=_0x3afba1||0xc8;return function(_0x183d59){if(_0x183d59){return _0x3a7c12['status'](_0x3afba1)[_0x752f('0x1d')](_0x183d59);}};}function respondWithFilteredResult(_0x516846,_0x4feb83){return function(_0x593777){if(_0x593777){var _0x2a7ae1=typeof _0x4feb83[_0x752f('0x1e')]==='undefined'&&typeof _0x4feb83['limit']==='undefined';var _0xf24bba=_0x593777[_0x752f('0x1f')];var _0x487110=_0x2a7ae1?0x0:_0x4feb83[_0x752f('0x1e')];var _0x6df19d=_0x2a7ae1?_0x593777[_0x752f('0x1f')]:_0x4feb83[_0x752f('0x1e')]+_0x4feb83['limit'];var _0x300bcf;if(_0x6df19d>=_0xf24bba){_0x6df19d=_0xf24bba;_0x300bcf=0xc8;}else{_0x300bcf=0xce;}_0x516846['status'](_0x300bcf);return _0x516846[_0x752f('0x20')]('Content-Range',_0x487110+'-'+_0x6df19d+'/'+_0xf24bba)[_0x752f('0x1d')](_0x593777);}return null;};}function patchUpdates(_0x47eb6a){return function(_0xc320e){try{jsonpatch[_0x752f('0x21')](_0xc320e,_0x47eb6a,!![]);}catch(_0x38a273){return BPromise[_0x752f('0x22')](_0x38a273);}return _0xc320e[_0x752f('0x23')]();};}function saveUpdates(_0x450ccf,_0x5a5fdc){return function(_0x446e93){if(_0x446e93){return _0x446e93['update'](_0x450ccf)['then'](function(_0x6c179){return _0x6c179;});}return null;};}function removeEntity(_0x432375,_0x3a91c8){return function(_0x194add){if(_0x194add){return _0x194add['destroy']()[_0x752f('0x24')](function(){var _0x425847=_0x194add[_0x752f('0x25')]({'plain':!![]});var _0x28bc4d=_0x752f('0x26');return db[_0x752f('0x27')][_0x752f('0x28')]({'where':{'type':_0x28bc4d,'resourceId':_0x425847['id']}})[_0x752f('0x24')](function(){return _0x194add;});})[_0x752f('0x24')](function(){_0x432375[_0x752f('0x29')](0xcc)[_0x752f('0x1c')]();});}};}function handleEntityNotFound(_0x1519e4,_0x3bfe37){return function(_0x46de19){if(!_0x46de19){_0x1519e4[_0x752f('0x1b')](0x194);}return _0x46de19;};}function handleError(_0x7fbf73,_0x1c346b){_0x1c346b=_0x1c346b||0x1f4;return function(_0x210ecd){logger[_0x752f('0x2a')](_0x210ecd[_0x752f('0x2b')]);if(_0x210ecd['name']){delete _0x210ecd[_0x752f('0x2c')];}_0x7fbf73[_0x752f('0x29')](_0x1c346b)[_0x752f('0x2d')](_0x210ecd);};}exports[_0x752f('0x2e')]=function(_0x576e6d,_0x40ec34){var _0x55c14c={},_0x152b07={},_0x5898dc={'count':0x0,'rows':[]};return db[_0x752f('0x2f')][_0x752f('0x30')]()[_0x752f('0x24')](function(_0x4f54d4){_0x152b07[_0x752f('0x31')]=_[_0x752f('0x32')](_0x4f54d4);_0x152b07[_0x752f('0x33')]=_['keys'](_0x576e6d[_0x752f('0x33')]);_0x152b07[_0x752f('0x34')]=_[_0x752f('0x35')](_0x152b07['model'],_0x152b07[_0x752f('0x33')]);_0x55c14c[_0x752f('0x36')]=_['intersection'](_0x152b07['model'],qs[_0x752f('0x37')](_0x576e6d[_0x752f('0x33')][_0x752f('0x37')]));_0x55c14c[_0x752f('0x36')]=_0x55c14c['attributes'][_0x752f('0x38')]?_0x55c14c['attributes']:_0x152b07[_0x752f('0x31')];if(!_0x576e6d[_0x752f('0x33')][_0x752f('0x39')](_0x752f('0x3a'))){_0x55c14c[_0x752f('0x3b')]=qs['limit'](_0x576e6d[_0x752f('0x33')][_0x752f('0x3b')]);_0x55c14c[_0x752f('0x1e')]=qs['offset'](_0x576e6d[_0x752f('0x33')][_0x752f('0x1e')]);}_0x55c14c[_0x752f('0x3c')]=qs[_0x752f('0x3d')](_0x576e6d[_0x752f('0x33')][_0x752f('0x3d')]);_0x55c14c['where']=qs['filters'](_['pick'](_0x576e6d['query'],_0x152b07['filters']),_0x4f54d4);if(_0x576e6d[_0x752f('0x33')]['filter']){_0x55c14c[_0x752f('0x3e')]=_[_0x752f('0x3f')](_0x55c14c[_0x752f('0x3e')],{'$or':_[_0x752f('0x40')](_0x55c14c[_0x752f('0x36')],function(_0x3577f6){var _0x46015f={};_0x46015f[_0x3577f6]={'$like':'%'+_0x576e6d[_0x752f('0x33')]['filter']+'%'};return _0x46015f;})});}_0x55c14c=_[_0x752f('0x3f')]({},_0x55c14c,_0x576e6d[_0x752f('0x41')]);var _0x35f3e0={'where':_0x55c14c[_0x752f('0x3e')]};return db[_0x752f('0x2f')][_0x752f('0x1f')](_0x35f3e0)['then'](function(_0x4b8ab7){_0x5898dc[_0x752f('0x1f')]=_0x4b8ab7;if(_0x576e6d[_0x752f('0x33')][_0x752f('0x42')]){_0x55c14c[_0x752f('0x43')]=[{'all':!![]}];}return db[_0x752f('0x2f')]['findAll'](_0x55c14c);})[_0x752f('0x24')](function(_0x523b4c){_0x5898dc['rows']=_0x523b4c;return _0x5898dc;})[_0x752f('0x24')](respondWithFilteredResult(_0x40ec34,_0x55c14c))[_0x752f('0x44')](handleError(_0x40ec34,null));})[_0x752f('0x44')](handleError(_0x40ec34,null));};exports[_0x752f('0x45')]=function(_0xbebd1b,_0x367b3b){var _0x3c41d6={'raw':![],'where':{'id':_0xbebd1b['params']['id']}},_0x3fe7fc={};_0x3fe7fc['model']=_[_0x752f('0x32')](db[_0x752f('0x2f')][_0x752f('0x46')]);_0x3fe7fc[_0x752f('0x33')]=_[_0x752f('0x32')](_0xbebd1b[_0x752f('0x33')]);_0x3fe7fc[_0x752f('0x34')]=_[_0x752f('0x35')](_0x3fe7fc[_0x752f('0x31')],_0x3fe7fc[_0x752f('0x33')]);_0x3c41d6[_0x752f('0x36')]=_[_0x752f('0x35')](_0x3fe7fc[_0x752f('0x31')],qs[_0x752f('0x37')](_0xbebd1b[_0x752f('0x33')][_0x752f('0x37')]));_0x3c41d6[_0x752f('0x36')]=_0x3c41d6['attributes']['length']?_0x3c41d6[_0x752f('0x36')]:_0x3fe7fc[_0x752f('0x31')];if(_0xbebd1b['query'][_0x752f('0x42')]){_0x3c41d6[_0x752f('0x43')]=[{'all':!![]}];}_0x3c41d6=_[_0x752f('0x3f')]({},_0x3c41d6,_0xbebd1b[_0x752f('0x41')]);return db[_0x752f('0x2f')]['find'](_0x3c41d6)[_0x752f('0x24')](handleEntityNotFound(_0x367b3b,null))['then'](respondWithResult(_0x367b3b,null))[_0x752f('0x44')](handleError(_0x367b3b,null));};exports['create']=function(_0x2588fb,_0x11b8d2){return db[_0x752f('0x2f')][_0x752f('0x47')](_0x2588fb['body'],{})[_0x752f('0x24')](function(_0x197a8d){var _0x185d6d=_0x2588fb['user'][_0x752f('0x25')]({'plain':!![]});if(!_0x185d6d)throw new Error(_0x752f('0x48'));if(_0x185d6d[_0x752f('0x49')]==='user'){var _0x4566b9=_0x197a8d[_0x752f('0x25')]({'plain':!![]});var _0xc6d7d6=_0x752f('0x26');return db[_0x752f('0x4a')][_0x752f('0x4b')]({'where':{'name':_0xc6d7d6,'userProfileId':_0x185d6d['userProfileId']},'raw':!![]})['then'](function(_0x1f4de3){if(_0x1f4de3&&_0x1f4de3[_0x752f('0x4c')]===0x0){return db[_0x752f('0x27')][_0x752f('0x47')]({'name':_0x4566b9[_0x752f('0x2c')],'resourceId':_0x4566b9['id'],'type':_0x1f4de3[_0x752f('0x2c')],'sectionId':_0x1f4de3['id']},{})['then'](function(){return _0x197a8d;});}else{return _0x197a8d;}})[_0x752f('0x44')](function(_0x1bc947){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bc947);throw _0x1bc947;});}return _0x197a8d;})[_0x752f('0x24')](respondWithResult(_0x11b8d2,0xc9))['catch'](handleError(_0x11b8d2,null));};exports[_0x752f('0x4d')]=function(_0x5a33df,_0x3ae86b){if(_0x5a33df['body']['id']){delete _0x5a33df[_0x752f('0x4e')]['id'];}return db[_0x752f('0x2f')][_0x752f('0x4b')]({'where':{'id':_0x5a33df['params']['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x3ae86b,null))[_0x752f('0x24')](saveUpdates(_0x5a33df[_0x752f('0x4e')],null))['then'](respondWithResult(_0x3ae86b,null))[_0x752f('0x44')](handleError(_0x3ae86b,null));};exports[_0x752f('0x28')]=function(_0x274927,_0x3ee261){return db[_0x752f('0x2f')][_0x752f('0x4b')]({'where':{'id':_0x274927[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x3ee261,null))[_0x752f('0x24')](removeEntity(_0x3ee261,null))[_0x752f('0x44')](handleError(_0x3ee261,null));};exports[_0x752f('0x30')]=function(_0x5de34c,_0x2af29f){return db[_0x752f('0x2f')][_0x752f('0x30')]()[_0x752f('0x24')](respondWithResult(_0x2af29f,null))[_0x752f('0x44')](handleError(_0x2af29f,null));};exports[_0x752f('0x50')]=function(_0x330233,_0x428bda,_0x45ebe2){return db[_0x752f('0x51')][_0x752f('0x4b')]({'where':{'id':_0x330233[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x428bda,null))['then'](function(_0x52e6e2){if(_0x52e6e2){return _0x52e6e2[_0x752f('0x50')](_0x330233[_0x752f('0x4e')]['ids'],_[_0x752f('0x52')](_0x330233['body'],[_0x752f('0x53'),'id'])||{});}})[_0x752f('0x24')](respondWithResult(_0x428bda,null))[_0x752f('0x44')](handleError(_0x428bda,null));};exports['getContacts']=function(_0x3362fc,_0x5a4dda,_0x327d00){var _0x199706={};var _0x3d50ee={};var _0x20bde8;var _0x503ec8;return db[_0x752f('0x2f')][_0x752f('0x54')]({'where':{'id':_0x3362fc[_0x752f('0x4f')]['id']}})[_0x752f('0x24')](handleEntityNotFound(_0x5a4dda,null))['then'](function(_0x157cb4){if(_0x157cb4){_0x20bde8=_0x157cb4;_0x3d50ee[_0x752f('0x31')]=_[_0x752f('0x32')](db['CmContact'][_0x752f('0x46')]);_0x3d50ee[_0x752f('0x33')]=_[_0x752f('0x32')](_0x3362fc[_0x752f('0x33')]);_0x3d50ee['filters']=_[_0x752f('0x35')](_0x3d50ee['model'],_0x3d50ee[_0x752f('0x33')]);_0x199706[_0x752f('0x36')]=_[_0x752f('0x35')](_0x3d50ee[_0x752f('0x31')],qs[_0x752f('0x37')](_0x3362fc[_0x752f('0x33')]['fields']));_0x199706['attributes']=_0x199706['attributes']['length']?_0x199706[_0x752f('0x36')]:_0x3d50ee[_0x752f('0x31')];_0x199706[_0x752f('0x3c')]=qs[_0x752f('0x3d')](_0x3362fc[_0x752f('0x33')][_0x752f('0x3d')]);_0x199706[_0x752f('0x3e')]=qs[_0x752f('0x34')](_['pick'](_0x3362fc['query'],_0x3d50ee[_0x752f('0x34')]));if(_0x3362fc[_0x752f('0x33')][_0x752f('0x55')]){_0x199706['where']=_[_0x752f('0x3f')](_0x199706[_0x752f('0x3e')],{'$or':_[_0x752f('0x40')](_0x199706['attributes'],function(_0x1c6746){var _0x1d721d={};_0x1d721d[_0x1c6746]={'$like':'%'+_0x3362fc[_0x752f('0x33')][_0x752f('0x55')]+'%'};return _0x1d721d;})});}_0x199706=_[_0x752f('0x3f')]({},_0x199706,_0x3362fc['options']);return _0x20bde8[_0x752f('0x56')](_0x199706);}})['then'](function(_0xd1c4b3){if(_0xd1c4b3){_0x503ec8=_0xd1c4b3[_0x752f('0x38')];if(!_0x3362fc['query'][_0x752f('0x39')](_0x752f('0x3a'))){_0x199706[_0x752f('0x3b')]=qs[_0x752f('0x3b')](_0x3362fc['query']['limit']);_0x199706['offset']=qs[_0x752f('0x1e')](_0x3362fc['query'][_0x752f('0x1e')]);}return _0x20bde8['getContacts'](_0x199706);}})[_0x752f('0x24')](function(_0x13ed7d){if(_0x13ed7d){return _0x13ed7d?{'count':_0x503ec8,'rows':_0x13ed7d}:null;}})[_0x752f('0x24')](respondWithResult(_0x5a4dda,null))[_0x752f('0x44')](handleError(_0x5a4dda,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5ef59f5..6d6bf96 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 _0x1db5=['cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x5f2ece,_0x54639e){var _0x3a4986=function(_0xcfbff0){while(--_0xcfbff0){_0x5f2ece['push'](_0x5f2ece['shift']());}};_0x3a4986(++_0x54639e);}(_0x1db5,0x91));var _0x51db=function(_0x9bbc39,_0x19d669){_0x9bbc39=_0x9bbc39-0x0;var _0xdbc706=_0x1db5[_0x9bbc39];return _0xdbc706;};'use strict';var _=require(_0x51db('0x0'));var util=require('util');var logger=require(_0x51db('0x1'))('api');var moment=require(_0x51db('0x2'));var BPromise=require(_0x51db('0x3'));var rp=require(_0x51db('0x4'));var fs=require('fs');var path=require(_0x51db('0x5'));var rimraf=require('rimraf');var config=require(_0x51db('0x6'));var attributes=require(_0x51db('0x7'));module[_0x51db('0x8')]=function(_0x16d5d1,_0xd7ac2){return _0x16d5d1[_0x51db('0x9')](_0x51db('0xa'),attributes,{'tableName':_0x51db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc923=['define','cm_companies','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x28acc5,_0x34d628){var _0x5ea8e0=function(_0xef8ea5){while(--_0xef8ea5){_0x28acc5['push'](_0x28acc5['shift']());}};_0x5ea8e0(++_0x34d628);}(_0xc923,0x1c5));var _0x3c92=function(_0x4f4707,_0x445387){_0x4f4707=_0x4f4707-0x0;var _0x7731d1=_0xc923[_0x4f4707];return _0x7731d1;};'use strict';var _=require(_0x3c92('0x0'));var util=require('util');var logger=require(_0x3c92('0x1'))('api');var moment=require(_0x3c92('0x2'));var BPromise=require(_0x3c92('0x3'));var rp=require(_0x3c92('0x4'));var fs=require('fs');var path=require(_0x3c92('0x5'));var rimraf=require(_0x3c92('0x6'));var config=require(_0x3c92('0x7'));var attributes=require(_0x3c92('0x8'));module['exports']=function(_0x2b5104,_0x5b070f){return _0x2b5104[_0x3c92('0x9')]('CmCompany',attributes,{'tableName':_0x3c92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index d78acec..63810f1 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 _0xd37d=['../../config/utils','rpc','jayson/promise','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x564242,_0x4159f7){var _0x2906fb=function(_0xed2acc){while(--_0xed2acc){_0x564242['push'](_0x564242['shift']());}};_0x2906fb(++_0x4159f7);}(_0xd37d,0xb6));var _0xdd37=function(_0x33e864,_0x2d8439){_0x33e864=_0x33e864-0x0;var _0x1787d7=_0xd37d[_0x33e864];return _0x1787d7;};'use strict';var _=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var moment=require(_0xdd37('0x2'));var BPromise=require(_0xdd37('0x3'));var rs=require(_0xdd37('0x4'));var fs=require('fs');var Redis=require(_0xdd37('0x5'));var db=require(_0xdd37('0x6'))['db'];var utils=require(_0xdd37('0x7'));var logger=require('../../config/logger')(_0xdd37('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd37('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47c6d1,_0x1ff1de,_0x538515){return new BPromise(function(_0x252a38,_0x385641){return client['request'](_0x47c6d1,_0x538515)[_0xdd37('0xa')](function(_0x27c481){logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));logger['debug'](_0xdd37('0xe'),_0x1ff1de,_0xdd37('0xd'),JSON[_0xdd37('0xf')](_0x27c481));if(_0x27c481['error']){if(_0x27c481[_0xdd37('0x10')][_0xdd37('0x11')]===0x1f4){logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x385641(_0x27c481[_0xdd37('0x10')]['message']);}logger[_0xdd37('0x10')](_0xdd37('0xc'),_0x1ff1de,_0x27c481[_0xdd37('0x10')][_0xdd37('0x12')]);return _0x252a38(_0x27c481[_0xdd37('0x10')]['message']);}else{logger[_0xdd37('0xb')](_0xdd37('0xc'),_0x1ff1de,_0xdd37('0xd'));_0x252a38(_0x27c481[_0xdd37('0x13')]['message']);}})[_0xdd37('0x14')](function(_0x58c586){logger['error'](_0xdd37('0xc'),_0x1ff1de,_0x58c586);_0x385641(_0x58c586);});});} \ No newline at end of file +var _0x83e5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x83e5,0x130));var _0x583e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x83e5[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x583e('0x0'));var util=require('util');var moment=require(_0x583e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x583e('0x2'));var db=require(_0x583e('0x3'))['db'];var utils=require(_0x583e('0x4'));var logger=require('../../config/logger')(_0x583e('0x5'));var config=require(_0x583e('0x6'));var jayson=require(_0x583e('0x7'));var client=jayson[_0x583e('0x8')][_0x583e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555368,_0xae3e5a,_0x5bc2f2){return new BPromise(function(_0x541ff0,_0x19a736){return client['request'](_0x555368,_0x5bc2f2)[_0x583e('0xa')](function(_0x97d4a6){logger[_0x583e('0xb')](_0x583e('0xc'),_0xae3e5a,_0x583e('0xd'));logger[_0x583e('0xe')](_0x583e('0xf'),_0xae3e5a,'request\x20sent',JSON[_0x583e('0x10')](_0x97d4a6));if(_0x97d4a6[_0x583e('0x11')]){if(_0x97d4a6[_0x583e('0x11')][_0x583e('0x12')]===0x1f4){logger['error'](_0x583e('0xc'),_0xae3e5a,_0x97d4a6['error'][_0x583e('0x13')]);return _0x19a736(_0x97d4a6[_0x583e('0x11')]['message']);}logger[_0x583e('0x11')](_0x583e('0xc'),_0xae3e5a,_0x97d4a6[_0x583e('0x11')]['message']);return _0x541ff0(_0x97d4a6[_0x583e('0x11')][_0x583e('0x13')]);}else{logger[_0x583e('0xb')](_0x583e('0xc'),_0xae3e5a,'request\x20sent');_0x541ff0(_0x97d4a6[_0x583e('0x14')][_0x583e('0x13')]);}})[_0x583e('0x15')](function(_0x3a2985){logger[_0x583e('0x11')](_0x583e('0xc'),_0xae3e5a,_0x3a2985);_0x19a736(_0x3a2985);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d7b650f..6d87995 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 _0x6829=['describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6829,0xf3));var _0x9682=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6829[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var path=require(_0x9682('0x2'));var timeout=require(_0x9682('0x3'));var express=require(_0x9682('0x4'));var router=express[_0x9682('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9682('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x9682('0x7')]('/',auth[_0x9682('0x8')](),controller['index']);router[_0x9682('0x7')]('/describe',auth[_0x9682('0x8')](),controller[_0x9682('0x9')]);router[_0x9682('0x7')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0xa')]);router[_0x9682('0x7')](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xc')]);router[_0x9682('0xd')]('/',auth[_0x9682('0x8')](),controller[_0x9682('0xe')]);router['post'](_0x9682('0xb'),auth[_0x9682('0x8')](),controller[_0x9682('0xf')]);router[_0x9682('0x10')](_0x9682('0x11'),auth[_0x9682('0x8')](),controller[_0x9682('0x12')]);router[_0x9682('0x13')]('/:id',auth[_0x9682('0x8')](),controller[_0x9682('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1a58=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe'];(function(_0x55bdd1,_0x440615){var _0x18f9e9=function(_0x3c1c6e){while(--_0x3c1c6e){_0x55bdd1['push'](_0x55bdd1['shift']());}};_0x18f9e9(++_0x440615);}(_0x1a58,0xfe));var _0x81a5=function(_0xa2c37d,_0x644ba2){_0xa2c37d=_0xa2c37d-0x0;var _0x469aca=_0x1a58[_0xa2c37d];return _0x469aca;};'use strict';var multer=require(_0x81a5('0x0'));var util=require('util');var path=require(_0x81a5('0x1'));var timeout=require('connect-timeout');var express=require(_0x81a5('0x2'));var router=express['Router']();var fs_extra=require(_0x81a5('0x3'));var auth=require(_0x81a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x81a5('0x5'));var controller=require(_0x81a5('0x6'));router[_0x81a5('0x7')]('/',auth[_0x81a5('0x8')](),controller['index']);router['get'](_0x81a5('0x9'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xa')]);router['get'](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xc')]);router[_0x81a5('0x7')](_0x81a5('0xd'),auth[_0x81a5('0x8')](),controller[_0x81a5('0xe')]);router[_0x81a5('0xf')]('/',auth[_0x81a5('0x8')](),controller[_0x81a5('0x10')]);router[_0x81a5('0xf')]('/:id/contacts',auth[_0x81a5('0x8')](),controller[_0x81a5('0x11')]);router['put'](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0x12')]);router[_0x81a5('0x13')](_0x81a5('0xb'),auth[_0x81a5('0x8')](),controller[_0x81a5('0x14')]);module[_0x81a5('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4c2a9db..3ded97b 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 _0xb0d1=['DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x42f981,_0x3a8798){var _0x55b62a=function(_0x39ce44){while(--_0x39ce44){_0x42f981['push'](_0x42f981['shift']());}};_0x55b62a(++_0x3a8798);}(_0xb0d1,0x159));var _0x1b0d=function(_0x2d04cf,_0x5706ff){_0x2d04cf=_0x2d04cf-0x0;var _0xc2f0e=_0xb0d1[_0x2d04cf];return _0xc2f0e;};'use strict';var _=require(_0x1b0d('0x0'));var Sequelize=require(_0x1b0d('0x1'));module[_0x1b0d('0x2')]={'firstName':{'type':Sequelize[_0x1b0d('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1b0d('0x3')]},'street':{'type':Sequelize[_0x1b0d('0x3')]},'postalCode':{'type':Sequelize[_0x1b0d('0x3')]},'city':{'type':Sequelize[_0x1b0d('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1b0d('0x3')]},'description':{'type':Sequelize[_0x1b0d('0x4')]},'phone':{'type':Sequelize[_0x1b0d('0x3')]},'mobile':{'type':Sequelize[_0x1b0d('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1b0d('0x3')]},'url':{'type':Sequelize[_0x1b0d('0x3')]},'facebook':{'type':Sequelize[_0x1b0d('0x3')]},'fb_data':{'type':Sequelize[_0x1b0d('0x3')]},'twitter':{'type':Sequelize[_0x1b0d('0x3')]},'skype':{'type':Sequelize[_0x1b0d('0x3')]},'teams':{'type':Sequelize[_0x1b0d('0x3')]},'viber':{'type':Sequelize[_0x1b0d('0x3')]},'line':{'type':Sequelize[_0x1b0d('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1b0d('0x3')]},'UserId':{'type':Sequelize[_0x1b0d('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x1b0d('0x3')]},'priority':{'type':Sequelize[_0x1b0d('0x5')](0x2)[_0x1b0d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1b0d('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x1b0d('0x5')]}}; \ No newline at end of file +var _0xecac=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xecac,0x1a6));var _0xceca=function(_0xb59fda,_0x1f7181){_0xb59fda=_0xb59fda-0x0;var _0x563988=_0xecac[_0xb59fda];return _0x563988;};'use strict';var _=require(_0xceca('0x0'));var Sequelize=require(_0xceca('0x1'));module[_0xceca('0x2')]={'firstName':{'type':Sequelize[_0xceca('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xceca('0x3')]},'postalCode':{'type':Sequelize[_0xceca('0x3')]},'city':{'type':Sequelize[_0xceca('0x3')]},'country':{'type':Sequelize[_0xceca('0x3')]},'dateOfBirth':{'type':Sequelize[_0xceca('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xceca('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xceca('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xceca('0x3')]},'facebook':{'type':Sequelize[_0xceca('0x3')]},'fb_data':{'type':Sequelize[_0xceca('0x3')]},'twitter':{'type':Sequelize[_0xceca('0x3')]},'skype':{'type':Sequelize[_0xceca('0x3')]},'teams':{'type':Sequelize[_0xceca('0x3')]},'viber':{'type':Sequelize[_0xceca('0x3')]},'line':{'type':Sequelize[_0xceca('0x3')]},'wechat':{'type':Sequelize[_0xceca('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xceca('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xceca('0x3')]},'priority':{'type':Sequelize[_0xceca('0x4')](0x2)[_0xceca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xceca('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xceca('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 75362fa..8ea4e0d 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 _0x409d=['CmContact','find','tags','keys','length','startsWith','columnName','displayName','analytics','CmCustomField','findAll','cf_','custom','type','values','hasOwnProperty','merge','body','from','get','mergeWith','isArray','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','all','show','params','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','pickBy','cf_%d','isEmpty','setFields','id\x20=\x20?','toParam','text','phone','findOne','model','rawAttributes','filters','attributes','intersection','fields','order','sort','pick','filter','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','count','includeAll','include','rows','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','nolimit','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','filename','chmodSync','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','agent','binding','No\x20phone\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','child_process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','disposition','secondDisposition','thirdDisposition','key','Owner','Tag','Tags','browserName','customerIp','customerPort','deviceModel','ratingValue','referer','substatus','Interaction','flatten','sortBy','reverse','value','slice','moment','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','json','offset','undefined','limit','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','describe','getOptions','query','user','catch'];(function(_0x5393a6,_0x3c972d){var _0x477463=function(_0x5d6f37){while(--_0x5d6f37){_0x5393a6['push'](_0x5393a6['shift']());}};_0x477463(++_0x3c972d);}(_0x409d,0xdb));var _0xd409=function(_0x3e54d0,_0x1ce9a9){_0x3e54d0=_0x3e54d0-0x0;var _0x444d03=_0x409d[_0x3e54d0];return _0x444d03;};'use strict';var moment=require(_0xd409('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd409('0x1'));var fs=require('fs');var _=require(_0xd409('0x2'));var squel=require(_0xd409('0x3'));var Papa=require(_0xd409('0x4'));var Redis=require('ioredis');var contacts=require(_0xd409('0x5'));var qs=require(_0xd409('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0xd409('0x7'));var db=require(_0xd409('0x8'))['db'];config[_0xd409('0x9')]=_[_0xd409('0xa')](config[_0xd409('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd409('0xb'))(new Redis(config['redis']));require(_0xd409('0xc'))[_0xd409('0xd')](socket);function respondWithResult(_0xdc12a8,_0x1104a6){_0x1104a6=_0x1104a6||0xc8;return function(_0x403e18){if(_0x403e18){return _0xdc12a8['status'](_0x1104a6)[_0xd409('0xe')](_0x403e18);}};}function respondWithFilteredResult(_0x24aed6,_0x1c6eca){return function(_0x3bf5e6){if(_0x3bf5e6){var _0x3ca069=typeof _0x1c6eca[_0xd409('0xf')]===_0xd409('0x10')&&typeof _0x1c6eca[_0xd409('0x11')]==='undefined';var _0x43e33e=_0x3bf5e6['count'];var _0xd903cf=_0x3ca069?0x0:_0x1c6eca[_0xd409('0xf')];var _0x1deb69=_0x3ca069?_0x3bf5e6['count']:_0x1c6eca[_0xd409('0xf')]+_0x1c6eca[_0xd409('0x11')];var _0x50f866;if(_0x1deb69>=_0x43e33e){_0x1deb69=_0x43e33e;_0x50f866=0xc8;}else{_0x50f866=0xce;}_0x24aed6[_0xd409('0x12')](_0x50f866);return _0x24aed6[_0xd409('0x13')](_0xd409('0x14'),_0xd903cf+'-'+_0x1deb69+'/'+_0x43e33e)['json'](_0x3bf5e6);}return null;};}function saveUpdates(_0x2532e9){return function(_0x5ae8a9){if(_0x5ae8a9){return _0x5ae8a9[_0xd409('0x15')](_0x2532e9)[_0xd409('0x16')](function(_0x21ae6f){return _0x21ae6f;});}return null;};}function removeEntity(_0x5155c1){return function(_0x51de57){if(_0x51de57){return _0x51de57[_0xd409('0x17')]()[_0xd409('0x16')](function(){_0x5155c1[_0xd409('0x12')](0xcc)[_0xd409('0x18')]();});}};}function handleEntityNotFound(_0x3e43e6){return function(_0x1313f2){if(!_0x1313f2){_0x3e43e6[_0xd409('0x19')](0x194);}return _0x1313f2;};}function handleError(_0x532ca0,_0x53924b){_0x53924b=_0x53924b||0x1f4;return function(_0x3d9a3e){logger[_0xd409('0x1a')](_0x3d9a3e[_0xd409('0x1b')]);if(_0x3d9a3e['name']){delete _0x3d9a3e[_0xd409('0x1c')];}_0x532ca0[_0xd409('0x12')](_0x53924b)[_0xd409('0x1d')](_0x3d9a3e);};}exports[_0xd409('0x1e')]=function(_0x2ba777,_0x370a72){var _0x34f601={};return contacts[_0xd409('0x1f')]()[_0xd409('0x16')](function(_0x2ee8f2){_0x34f601=qs[_0xd409('0x20')](_0x2ee8f2,_0x2ba777);return contacts['findAll'](_0x2ba777[_0xd409('0x21')],_0x2ba777[_0xd409('0x22')],_0x34f601,_0x2ee8f2);})[_0xd409('0x16')](respondWithFilteredResult(_0x370a72,_0x34f601))[_0xd409('0x23')](handleError(_0x370a72,null));};exports['destroy']=function(_0x9e1559,_0x2d6b93){return db[_0xd409('0x24')][_0xd409('0x25')]({'where':{'id':_0x9e1559['params']['id']}})['then'](handleEntityNotFound(_0x2d6b93,null))['then'](removeEntity(_0x2d6b93,null))['catch'](handleError(_0x2d6b93,null));};exports[_0xd409('0x1f')]=function(_0xabb3d8,_0x1f4e80){return db[_0xd409('0x24')][_0xd409('0x1f')]()[_0xd409('0x16')](function(_0x5b745b){delete _0x5b745b[_0xd409('0x26')];for(var _0x424264=0x0;_0x4242640x0){return new Promise(function(_0x51c1d8){var _0x4d6b39=[];for(var _0x25cb28=0x0;_0x25cb28<_0x5c24b8[_0xd409('0x28')];_0x25cb28++){_0x4d6b39[_0xd409('0x5e')](insertAdditionalPhones(_0x5c24b8[_0x25cb28]['contact'],_0x5c24b8[_0x25cb28][_0xd409('0x59')]));}Promise[_0xd409('0x61')](_0x4d6b39)[_0xd409('0x16')](function(){_0x51c1d8(0x1);});})[_0xd409('0x16')](function(){return{'success':_0x6c170c,'failure':_0x48fda9,'duplicates':_0x340d5d};});}else{return{'success':_0x6c170c,'failure':_0x48fda9,'duplicates':_0x340d5d};}}})[_0xd409('0x16')](respondWithResult(_0x396c69,0xc9))[_0xd409('0x23')](handleError(_0x396c69,null));};exports[_0xd409('0x62')]=function(_0x228245,_0x21c1e9){var _0x18f6cc;return db[_0xd409('0x24')][_0xd409('0x1f')]()['then'](function(_0x345093){return db[_0xd409('0x24')][_0xd409('0x25')]({'where':{'id':_0x228245[_0xd409('0x63')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd409('0x1c'),_0xd409('0x64')],'required':_0x228245[_0xd409('0x21')][_0xd409('0x65')]?!![]:![]},{'model':db[_0xd409('0x49')],'as':_0xd409('0x66'),'where':{'CmContactId':_0x228245[_0xd409('0x63')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xd409('0x67')}]}],'order':[db[_0xd409('0x68')][_0xd409('0x69')](_0xd409('0x6a'))],'attributes':_[_0xd409('0x27')](_0x345093)});})[_0xd409('0x16')](function(_0x1e7bcb){if(!_[_0xd409('0x55')](_0x1e7bcb)){_0x18f6cc=_0x1e7bcb['get']({'plain':!![]});var _0x2b4ce6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1e7bcb&&_0x1e7bcb[_0xd409('0x5f')]){if(_0x1e7bcb[_0xd409('0x5f')]){_0x2b4ce6[_0xd409('0x5d')][_0xd409('0x6b')][_0xd409('0x5e')]({'ListId':{'$ne':_0x1e7bcb[_0xd409('0x5f')]}});}}return db[_0xd409('0x2d')][_0xd409('0x2e')](_0x2b4ce6);}})[_0xd409('0x16')](function(_0x4fbc63){if(!_['isNil'](_0x4fbc63)){return _[_0xd409('0x6c')](_0x18f6cc,_[_0xd409('0x6d')](_0x4fbc63,function(_0xf2c266){return util[_0xd409('0x6e')]('cf_%d',_0xf2c266['id']);}));}})[_0xd409('0x16')](handleEntityNotFound(_0x21c1e9,null))[_0xd409('0x16')](respondWithResult(_0x21c1e9,null))['catch'](handleError(_0x21c1e9,null));};exports[_0xd409('0x15')]=function(_0x271ba6,_0x2b3ea1){var _0x218637;if(_0x271ba6[_0xd409('0x35')]['id']){delete _0x271ba6[_0xd409('0x35')]['id'];}if(!_[_0xd409('0x55')](_0x271ba6[_0xd409('0x35')]['dialTimezone'])){var _0x58a45b=_0x271ba6[_0xd409('0x35')]['dialTimezone'];if(!_[_0xd409('0x55')](shared['timezones'][_0x58a45b]))_0x271ba6[_0xd409('0x35')][_0xd409('0x58')]=shared[_0xd409('0x57')][_0x58a45b][_0xd409('0x58')];}return db[_0xd409('0x24')][_0xd409('0x25')]({'where':{'id':_0x271ba6['params']['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x2b3ea1,null))['then'](saveUpdates(_0x271ba6['body'],null))[_0xd409('0x16')](function(_0x4c51b4){_0x218637=_0x4c51b4;var _0x6c42d9={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4c51b4&&_0x4c51b4[_0xd409('0x5f')]){if(_0x4c51b4['ListId']){_0x6c42d9['where']['$and'][_0xd409('0x5e')]({'ListId':{'$ne':_0x4c51b4['ListId']}});}}return db[_0xd409('0x2d')][_0xd409('0x2e')](_0x6c42d9);})[_0xd409('0x16')](function(_0x15edbc){if(_0x15edbc){return _[_0xd409('0x6c')](_[_0xd409('0x6f')](_0x271ba6[_0xd409('0x35')],function(_0x10d161,_0x5005b1){return _['startsWith'](_0x5005b1,'cf_');}),_['map'](_0x15edbc,function(_0x4458b2){return util['format'](_0xd409('0x70'),_0x4458b2['id']);}));}})[_0xd409('0x16')](function(_0x46e09a){if(_0x46e09a&&!_[_0xd409('0x71')](_0x46e09a)){var _0x4e3be4=squel[_0xd409('0x15')]()['table']('cm_contacts')[_0xd409('0x72')](_0x46e09a)[_0xd409('0x5d')](_0xd409('0x73'),_0x271ba6[_0xd409('0x63')]['id'])[_0xd409('0x74')]();return db[_0xd409('0x68')][_0xd409('0x21')](_0x4e3be4[_0xd409('0x75')],{'replacements':_0x4e3be4['values']});}})[_0xd409('0x16')](function(){if(_0x271ba6[_0xd409('0x35')][_0xd409('0x76')]&&_0x218637){return db[_0xd409('0x3a')][_0xd409('0x15')]({'phone':_0x271ba6[_0xd409('0x35')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x218637['id']}});}})[_0xd409('0x16')](function(){return _0x218637;})[_0xd409('0x16')](respondWithResult(_0x2b3ea1,null))['catch'](handleError(_0x2b3ea1,null));};exports['getTags']=function(_0x33a4d1,_0x180dfd){var _0x2bbe7f={};var _0x38d59e={};var _0x78274a;var _0x3a6729;return db[_0xd409('0x24')][_0xd409('0x77')]({'where':{'id':_0x33a4d1['params']['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x180dfd,null))[_0xd409('0x16')](function(_0x5d4e1e){if(_0x5d4e1e){_0x78274a=_0x5d4e1e;_0x38d59e[_0xd409('0x78')]=_[_0xd409('0x27')](db['Tag'][_0xd409('0x79')]);_0x38d59e[_0xd409('0x21')]=_[_0xd409('0x27')](_0x33a4d1[_0xd409('0x21')]);_0x38d59e[_0xd409('0x7a')]=_['intersection'](_0x38d59e[_0xd409('0x78')],_0x38d59e['query']);_0x2bbe7f[_0xd409('0x7b')]=_[_0xd409('0x7c')](_0x38d59e[_0xd409('0x78')],qs[_0xd409('0x7d')](_0x33a4d1['query'][_0xd409('0x7d')]));_0x2bbe7f[_0xd409('0x7b')]=_0x2bbe7f[_0xd409('0x7b')][_0xd409('0x28')]?_0x2bbe7f[_0xd409('0x7b')]:_0x38d59e[_0xd409('0x78')];_0x2bbe7f[_0xd409('0x7e')]=qs[_0xd409('0x7f')](_0x33a4d1[_0xd409('0x21')]['sort']);_0x2bbe7f['where']=qs[_0xd409('0x7a')](_[_0xd409('0x80')](_0x33a4d1['query'],_0x38d59e['filters']));if(_0x33a4d1[_0xd409('0x21')][_0xd409('0x81')]){_0x2bbe7f[_0xd409('0x5d')]=_[_0xd409('0x34')](_0x2bbe7f['where'],{'$or':_[_0xd409('0x6d')](_0x2bbe7f[_0xd409('0x7b')],function(_0x2086e6){var _0x2965aa={};_0x2965aa[_0x2086e6]={'$like':'%'+_0x33a4d1[_0xd409('0x21')]['filter']+'%'};return _0x2965aa;})});}_0x2bbe7f=_[_0xd409('0x34')]({},_0x2bbe7f,_0x33a4d1['options']);return _0x78274a['getTags'](_0x2bbe7f);}})[_0xd409('0x16')](function(_0x1d8ac3){if(_0x1d8ac3){_0x3a6729=_0x1d8ac3[_0xd409('0x28')];if(!_0x33a4d1['query'][_0xd409('0x33')]('nolimit')){_0x2bbe7f[_0xd409('0x11')]=qs[_0xd409('0x11')](_0x33a4d1[_0xd409('0x21')][_0xd409('0x11')]);_0x2bbe7f[_0xd409('0xf')]=qs[_0xd409('0xf')](_0x33a4d1[_0xd409('0x21')][_0xd409('0xf')]);}return _0x78274a['getTags'](_0x2bbe7f);}})['then'](function(_0x5c7c11){if(_0x5c7c11){return _0x5c7c11?{'count':_0x3a6729,'rows':_0x5c7c11}:null;}})[_0xd409('0x16')](respondWithResult(_0x180dfd,null))[_0xd409('0x23')](handleError(_0x180dfd,null));};exports['setTags']=function(_0x569606,_0x4abb86){if(_0x569606[_0xd409('0x35')]['id']){delete _0x569606['body']['id'];}return db[_0xd409('0x24')][_0xd409('0x77')]({'where':{'id':_0x569606[_0xd409('0x63')]['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x4abb86,null))['then'](function(_0x377915){if(_0x377915){return _0x377915[_0xd409('0x82')](_0x569606[_0xd409('0x35')][_0xd409('0x83')]||[]);}return null;})[_0xd409('0x16')](respondWithResult(_0x4abb86,null))[_0xd409('0x23')](handleError(_0x4abb86,null));};exports[_0xd409('0x84')]=function(_0x33e89a,_0xcf07cd){var _0x19c94e=[];_0x19c94e[_0xd409('0x5e')](addAdditionalPhones(_0x33e89a['body']));Promise[_0xd409('0x61')](_0x19c94e)[_0xd409('0x16')](function(){_0x19c94e=[];_0x19c94e['push'](deleteCmHopperPhones(_0x33e89a[_0xd409('0x35')]['id']));_0x19c94e[_0xd409('0x5e')](addCmHopperPhones(_0x33e89a[_0xd409('0x35')]['id']));Promise[_0xd409('0x61')](_0x19c94e)[_0xd409('0x16')](function(){return[0x1];})[_0xd409('0x16')](respondWithResult(_0xcf07cd,null));});};function addAdditionalPhones(_0x6d266a){var _0x4c260a;return new Promise(function(_0x11282e){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x6d266a['id']}})['then'](function(){db[_0xd409('0x85')][_0xd409('0x2e')]({'raw':!![],'attributes':['id',_0xd409('0x86')]})[_0xd409('0x16')](function(_0x5ac90c){var _0x58d217=[];for(var _0xf62468=0x0;_0xf62468<_0x6d266a[_0xd409('0x87')][_0xd409('0x28')];_0xf62468++){var _0x44c0dd=_0x6d266a[_0xd409('0x88')]?_[_0xd409('0x55')](_0x6d266a[_0xd409('0x88')][_0xf62468])?'':_0x6d266a[_0xd409('0x88')][_0xf62468]:_0x6d266a['items'][_0xf62468][_0xd409('0x89')]?_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x89')]:'';var _0x52f04f=_[_0xd409('0x55')](_0x6d266a['items'][_0xf62468][_0xd409('0x8a')])?'':_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x8a')];var _0x4e647d=_0x44c0dd+':'+_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x76')]+'§'+_0x52f04f;if(_[_0xd409('0x55')](_0x4c260a))_0x4c260a=_0x4e647d;else _0x4c260a+=';'+_0x4e647d;var _0x48966a=null;var _0x19a61b=null;if(_0x6d266a[_0xd409('0x88')]){if(!_[_0xd409('0x55')](_0x6d266a[_0xd409('0x88')][_0xf62468])){_0x19a61b=_[_0xd409('0x25')](_0x5ac90c,function(_0x3d8033){return _0x3d8033['id']===_0x6d266a[_0xd409('0x88')][_0xf62468];});if(!_[_0xd409('0x55')](_0x19a61b)){_0x48966a=_0x19a61b['OrderBy'];}}}else{if(!_[_0xd409('0x55')](_0x6d266a['items'][_0xf62468])){_0x19a61b=_[_0xd409('0x25')](_0x5ac90c,function(_0x31743a){return _0x31743a['id']===_0x6d266a['items'][_0xf62468]['ItemTypeId'];});if(!_[_0xd409('0x55')](_0x19a61b)){_0x48966a=_0xf62468;}}}if(_[_0xd409('0x55')](_0x48966a)){_0x48966a=0x64;}_0x58d217['push'](addAdditionalPhone(_0x6d266a['id'],_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x76')],_0x6d266a[_0xd409('0x88')]?_[_0xd409('0x55')](_0x6d266a[_0xd409('0x88')][_0xf62468])?null:_0x6d266a[_0xd409('0x88')][_0xf62468]:_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x89')]?_0x6d266a[_0xd409('0x87')][_0xf62468][_0xd409('0x89')]:null,_0x48966a,_0x52f04f));}Promise[_0xd409('0x61')](_0x58d217)[_0xd409('0x16')](function(){db[_0xd409('0x24')]['update']({'AdditionalPhones':_0x4c260a},{'where':{'id':_0x6d266a['id']}})[_0xd409('0x16')](function(){_0x11282e(0x1);});});});});});}function addAdditionalPhone(_0x2c2034,_0x3961a2,_0xb2553f,_0x129901,_0xfdf524){return db[_0xd409('0x49')][_0xd409('0x25')]({'where':{'CmContactId':_0x2c2034,'item':_0x3961a2}})['then'](function(_0x1eb0a4){if(_0x1eb0a4)logger[_0xd409('0x3b')](_0xd409('0x8b'),_0x1eb0a4);else{db[_0xd409('0x49')][_0xd409('0x3e')]({'CmContactId':_0x2c2034,'item':_0x3961a2,'ItemTypeId':_0xb2553f,'OrderBy':_0x129901,'ItemClass':_0xd409('0x8c'),'description':_0xfdf524});}});}function deleteCmHopperPhones(_0xd0a0b9){return new Promise(function(_0x32419a){return db[_0xd409('0x3a')][_0xd409('0x2e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xd0a0b9}})['then'](function(_0xe80f2f){db[_0xd409('0x8d')][_0xd409('0x17')]({'where':{'CmHopperId':{'$in':_[_0xd409('0x6d')](_0xe80f2f,'id')}}});})[_0xd409('0x16')](function(){_0x32419a(0x1);});});}function addCmHopperPhones(_0x159045){return new Promise(function(_0xee1e4f){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x159045}})[_0xd409('0x16')](function(_0x1f0315){var _0x3ad4ed=[];_['map'](_0x1f0315,function(_0xaebbd0){_0x3ad4ed[_0xd409('0x5e')](createCmHopperPhone(_0x159045,_0xaebbd0['id']));});Promise[_0xd409('0x61')](_0x3ad4ed)['then'](function(){_0xee1e4f(0x1);});});});}function createCmHopperPhone(_0xe9a6ec,_0x1050d1){return new Promise(function(_0x30868a){db[_0xd409('0x49')][_0xd409('0x2e')]({'raw':!![],'attributes':['item',_0xd409('0x86')],'where':{'CmContactId':_0xe9a6ec,'ItemClass':'PHONE'},'include':[{'model':db[_0xd409('0x85')],'attributes':[_0xd409('0x86')],'as':'ItemType'}],'order':[_0xd409('0x86'),db[_0xd409('0x68')][_0xd409('0x69')](_0xd409('0x8e'))]})[_0xd409('0x16')](function(_0x1b99cf){var _0x223d63=0x1;var _0x16bf5b=_[_0xd409('0x6d')](_0x1b99cf,function(_0x439e42){_0x439e42[_0xd409('0x8f')]=_0x1050d1;_0x439e42[_0xd409('0x76')]=_0x439e42[_0xd409('0x90')];_0x439e42[_0xd409('0x86')]=_0x223d63;delete _0x439e42[_0xd409('0x91')];_0x223d63=_0x223d63+0x1;return _0x439e42;});return db[_0xd409('0x8d')]['bulkCreate'](_0x16bf5b,{});})[_0xd409('0x16')](function(){_0x30868a(0x1);});});}function insertAdditionalPhones(_0x2eb258,_0x3cc2c1){return new Promise(function(_0x95bea0){var _0x4e03a4=[];for(var _0x3b52e3=0x0;_0x3b52e3<_0x3cc2c1['length'];_0x3b52e3++){var _0x494f47=_0x3cc2c1[_0x3b52e3];_0x4e03a4[_0xd409('0x5e')](parseContactItemType(_0x494f47));}Promise[_0xd409('0x61')](_0x4e03a4)[_0xd409('0x16')](function(){var _0x5d66dc={'id':_0x2eb258['id'],'items':_0x3cc2c1};return addAdditionalPhones(_0x5d66dc)[_0xd409('0x16')](function(){return addCmHopperPhones(_0x2eb258['id']);});})[_0xd409('0x16')](function(){_0x95bea0(_0x2eb258);});});}function parseContactItemType(_0x52a4ab){return new Promise(function(_0x264c86){if(_0x52a4ab[_0xd409('0x33')](_0xd409('0x89'))){_0x264c86(_0x52a4ab);}else{return db['ContactItemType']['find']({'where':{'name':_0x52a4ab[_0xd409('0x67')]}})['then'](function(_0x351b12){if(_[_0xd409('0x55')](_0x351b12))_0x52a4ab[_0xd409('0x89')]=null;else _0x52a4ab['ItemTypeId']=_0x351b12['id'];_0x264c86(_0x52a4ab);});}});}exports[_0xd409('0x92')]=function(_0x45af9f,_0xc4f1a){return db[_0xd409('0x49')]['findAll']({'raw':!![],'where':{'CmContactId':_0x45af9f['params']['id'],'ItemClass':_0xd409('0x8c')},'include':[{'model':db[_0xd409('0x85')],'as':_0xd409('0x67')}],'order':[[_0xd409('0x86')],[db['sequelize'][_0xd409('0x69')]('`ItemType`.OrderBy')]]})[_0xd409('0x16')](function(_0x6cde4e){return _0x6cde4e;})[_0xd409('0x16')](respondWithResult(_0xc4f1a,null))[_0xd409('0x23')](handleError(_0xc4f1a,null));};exports['duplicateAdditionalPhones']=function(_0x35f862,_0x370801){return db[_0xd409('0x49')][_0xd409('0x2e')]({'raw':!![],'where':{'CmContactId':_0x35f862['body'][_0xd409('0x93')]}})[_0xd409('0x16')](function(_0x10ebf0){var _0x2a3a1d=_[_0xd409('0x6d')](_0x10ebf0,function(_0xe0482f){_0xe0482f[_0xd409('0x94')]=_0x35f862[_0xd409('0x35')][_0xd409('0x95')];return _0xe0482f;});return db[_0xd409('0x49')][_0xd409('0x5a')](_0x2a3a1d,{});})['then'](function(){return addCmHopperPhones(_0x35f862[_0xd409('0x35')][_0xd409('0x95')]);})['then'](function(){return['ok'];})['then'](respondWithResult(_0x370801,null))[_0xd409('0x23')](handleError(_0x370801,null));};exports[_0xd409('0x96')]=function(_0x1680d1,_0x5afc2b){var _0x4d37d5=[];_0x4d37d5['push'](createCmHopperPhone(_0x1680d1[_0xd409('0x35')]['id'],_0x1680d1[_0xd409('0x35')][_0xd409('0x97')]));Promise['all'](_0x4d37d5)[_0xd409('0x16')](function(){return[0x1];})[_0xd409('0x16')](respondWithResult(_0x5afc2b,null));};exports[_0xd409('0x98')]=function(_0x1ef43a,_0x5b3832){var _0x1fb0bc={'raw':![],'where':{}};var _0x5110ef={};var _0x455db1={'count':0x0,'rows':[]};return db[_0xd409('0x24')]['findOne']({'where':{'id':_0x1ef43a[_0xd409('0x63')]['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x5b3832,null))[_0xd409('0x16')](function(_0x3e87b1){if(_0x3e87b1){_0x5110ef[_0xd409('0x78')]=_[_0xd409('0x27')](db['CmHopper'][_0xd409('0x79')]);_0x5110ef[_0xd409('0x21')]=_[_0xd409('0x27')](_0x1ef43a[_0xd409('0x21')]);_0x5110ef['filters']=_[_0xd409('0x7c')](_0x5110ef['model'],_0x5110ef[_0xd409('0x21')]);_0x1fb0bc[_0xd409('0x7b')]=_[_0xd409('0x7c')](_0x5110ef[_0xd409('0x78')],qs[_0xd409('0x7d')](_0x1ef43a[_0xd409('0x21')][_0xd409('0x7d')]));_0x1fb0bc[_0xd409('0x7b')]=_0x1fb0bc[_0xd409('0x7b')][_0xd409('0x28')]?_0x1fb0bc[_0xd409('0x7b')]:_0x5110ef[_0xd409('0x78')];if(!_0x1ef43a[_0xd409('0x21')]['hasOwnProperty']('nolimit')){_0x1fb0bc[_0xd409('0x11')]=qs[_0xd409('0x11')](_0x1ef43a[_0xd409('0x21')]['limit']);_0x1fb0bc[_0xd409('0xf')]=qs['offset'](_0x1ef43a[_0xd409('0x21')][_0xd409('0xf')]);}_0x1fb0bc[_0xd409('0x7e')]=qs[_0xd409('0x7f')](_0x1ef43a[_0xd409('0x21')][_0xd409('0x7f')]);_0x1fb0bc[_0xd409('0x5d')]=qs[_0xd409('0x7a')](_[_0xd409('0x80')](_0x1ef43a[_0xd409('0x21')],_0x5110ef['filters']));_0x1fb0bc[_0xd409('0x5d')][_0xd409('0x99')]=_0x3e87b1['id'];if(_0x1ef43a[_0xd409('0x21')][_0xd409('0x81')]){_0x1fb0bc[_0xd409('0x5d')]=_[_0xd409('0x34')](_0x1fb0bc[_0xd409('0x5d')],{'$or':_['map'](_0x1fb0bc[_0xd409('0x7b')],function(_0x52922a){var _0x191bee={};_0x191bee[_0x52922a]={'$like':'%'+_0x1ef43a[_0xd409('0x21')]['filter']+'%'};return _0x191bee;})});}_0x1fb0bc=_[_0xd409('0x34')]({},_0x1fb0bc,_0x1ef43a[_0xd409('0x9a')]);return db[_0xd409('0x3a')][_0xd409('0x9b')]({'where':_0x1fb0bc[_0xd409('0x5d')]})[_0xd409('0x16')](function(_0x46f515){_0x455db1[_0xd409('0x9b')]=_0x46f515;if(_0x1ef43a[_0xd409('0x21')][_0xd409('0x9c')]){_0x1fb0bc[_0xd409('0x9d')]=[{'all':!![]}];}return db[_0xd409('0x3a')][_0xd409('0x2e')](_0x1fb0bc);})[_0xd409('0x16')](function(_0x42db8e){_0x455db1[_0xd409('0x9e')]=_0x42db8e;return _0x455db1;});}})[_0xd409('0x16')](respondWithFilteredResult(_0x5b3832,_0x1fb0bc))[_0xd409('0x23')](handleError(_0x5b3832,null));};exports[_0xd409('0x9f')]=function(_0x23114f,_0x2757ad){var _0x188654={'raw':!![],'where':{}};var _0x527d67={};var _0x597286={'count':0x0,'rows':[]};return db[_0xd409('0x24')][_0xd409('0x77')]({'where':{'id':_0x23114f[_0xd409('0x63')]['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x2757ad,null))[_0xd409('0x16')](function(_0xee18b6){if(_0xee18b6){_0x527d67['model']=_[_0xd409('0x27')](db[_0xd409('0x4a')]['rawAttributes']);_0x527d67[_0xd409('0x21')]=_[_0xd409('0x27')](_0x23114f[_0xd409('0x21')]);_0x527d67[_0xd409('0x7a')]=_['intersection'](_0x527d67[_0xd409('0x78')],_0x527d67['query']);_0x188654[_0xd409('0x7b')]=_[_0xd409('0x7c')](_0x527d67[_0xd409('0x78')],qs[_0xd409('0x7d')](_0x23114f[_0xd409('0x21')][_0xd409('0x7d')]));_0x188654[_0xd409('0x7b')]=_0x188654['attributes'][_0xd409('0x28')]?_0x188654[_0xd409('0x7b')]:_0x527d67[_0xd409('0x78')];if(!_0x23114f[_0xd409('0x21')][_0xd409('0x33')]('nolimit')){_0x188654['limit']=qs[_0xd409('0x11')](_0x23114f[_0xd409('0x21')][_0xd409('0x11')]);_0x188654[_0xd409('0xf')]=qs[_0xd409('0xf')](_0x23114f[_0xd409('0x21')][_0xd409('0xf')]);}_0x188654[_0xd409('0x7e')]=qs[_0xd409('0x7f')](_0x23114f['query'][_0xd409('0x7f')]);_0x188654['where']=qs[_0xd409('0x7a')](_[_0xd409('0x80')](_0x23114f[_0xd409('0x21')],_0x527d67[_0xd409('0x7a')]));_0x188654['where'][_0xd409('0x99')]=_0xee18b6['id'];if(_0x23114f[_0xd409('0x21')]['filter']){_0x188654[_0xd409('0x5d')]=_[_0xd409('0x34')](_0x188654[_0xd409('0x5d')],{'$or':_[_0xd409('0x6d')](_0x188654[_0xd409('0x7b')],function(_0xb3d634){var _0x12d343={};_0x12d343[_0xb3d634]={'$like':'%'+_0x23114f[_0xd409('0x21')][_0xd409('0x81')]+'%'};return _0x12d343;})});}_0x188654=_[_0xd409('0x34')]({},_0x188654,_0x23114f[_0xd409('0x9a')]);return db['CmHopperHistory']['count']({'where':_0x188654[_0xd409('0x5d')]})[_0xd409('0x16')](function(_0x517df1){_0x597286[_0xd409('0x9b')]=_0x517df1;if(_0x23114f[_0xd409('0x21')][_0xd409('0x9c')]){_0x188654[_0xd409('0x9d')]=[{'all':!![]}];}return db[_0xd409('0x4a')][_0xd409('0x2e')](_0x188654);})[_0xd409('0x16')](function(_0x5ea89d){_0x597286['rows']=_0x5ea89d;return _0x597286;});}})[_0xd409('0x16')](respondWithFilteredResult(_0x2757ad,_0x188654))[_0xd409('0x23')](handleError(_0x2757ad,null));};exports[_0xd409('0xa0')]=function(_0x4e4a54,_0x585bdf){var _0x32ab7d={'raw':!![],'where':{}};var _0x598187={};var _0x54e73e={'count':0x0,'rows':[]};return db[_0xd409('0x24')][_0xd409('0x77')]({'where':{'id':_0x4e4a54[_0xd409('0x63')]['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x585bdf,null))['then'](function(_0x1db4a4){if(_0x1db4a4){_0x598187[_0xd409('0x78')]=_[_0xd409('0x27')](db[_0xd409('0xa1')][_0xd409('0x79')]);_0x598187[_0xd409('0x21')]=_['keys'](_0x4e4a54[_0xd409('0x21')]);_0x598187[_0xd409('0x7a')]=_['intersection'](_0x598187[_0xd409('0x78')],_0x598187[_0xd409('0x21')]);_0x32ab7d[_0xd409('0x7b')]=_[_0xd409('0x7c')](_0x598187[_0xd409('0x78')],qs[_0xd409('0x7d')](_0x4e4a54[_0xd409('0x21')]['fields']));_0x32ab7d[_0xd409('0x7b')]=_0x32ab7d['attributes'][_0xd409('0x28')]?_0x32ab7d[_0xd409('0x7b')]:_0x598187[_0xd409('0x78')];if(!_0x4e4a54['query'][_0xd409('0x33')]('nolimit')){_0x32ab7d['limit']=qs['limit'](_0x4e4a54[_0xd409('0x21')]['limit']);_0x32ab7d[_0xd409('0xf')]=qs[_0xd409('0xf')](_0x4e4a54[_0xd409('0x21')][_0xd409('0xf')]);}_0x32ab7d['order']=qs[_0xd409('0x7f')](_0x4e4a54['query'][_0xd409('0x7f')]);_0x32ab7d['where']=qs['filters'](_[_0xd409('0x80')](_0x4e4a54[_0xd409('0x21')],_0x598187[_0xd409('0x7a')]));_0x32ab7d[_0xd409('0x5d')][_0xd409('0x99')]=_0x1db4a4['id'];if(_0x4e4a54[_0xd409('0x21')][_0xd409('0x81')]){_0x32ab7d[_0xd409('0x5d')]=_[_0xd409('0x34')](_0x32ab7d[_0xd409('0x5d')],{'$or':_[_0xd409('0x6d')](_0x32ab7d[_0xd409('0x7b')],function(_0x378546){var _0x70c6ad={};_0x70c6ad[_0x378546]={'$like':'%'+_0x4e4a54[_0xd409('0x21')][_0xd409('0x81')]+'%'};return _0x70c6ad;})});}_0x32ab7d=_[_0xd409('0x34')]({},_0x32ab7d,_0x4e4a54[_0xd409('0x9a')]);return db[_0xd409('0xa1')][_0xd409('0x9b')]({'where':_0x32ab7d['where']})['then'](function(_0x3086cb){_0x54e73e['count']=_0x3086cb;if(_0x4e4a54[_0xd409('0x21')][_0xd409('0x9c')]){_0x32ab7d[_0xd409('0x9d')]=[{'all':!![]}];}return db[_0xd409('0xa1')][_0xd409('0x2e')](_0x32ab7d);})['then'](function(_0x54d25d){_0x54e73e[_0xd409('0x9e')]=_0x54d25d;return _0x54e73e;});}})[_0xd409('0x16')](respondWithFilteredResult(_0x585bdf,_0x32ab7d))[_0xd409('0x23')](handleError(_0x585bdf,null));};exports[_0xd409('0xa2')]=function(_0x14711a,_0x3f5931){var _0x5e59a9={'raw':!![],'where':{}};var _0x11bb8e={};var _0xd6fe0a={'count':0x0,'rows':[]};return db['CmContact'][_0xd409('0x77')]({'where':{'id':_0x14711a['params']['id']}})[_0xd409('0x16')](handleEntityNotFound(_0x3f5931,null))['then'](function(_0x585ae5){if(_0x585ae5){_0x11bb8e[_0xd409('0x78')]=_[_0xd409('0x27')](db[_0xd409('0x50')][_0xd409('0x79')]);_0x11bb8e['query']=_[_0xd409('0x27')](_0x14711a[_0xd409('0x21')]);_0x11bb8e[_0xd409('0x7a')]=_['intersection'](_0x11bb8e['model'],_0x11bb8e[_0xd409('0x21')]);_0x5e59a9['attributes']=_['intersection'](_0x11bb8e[_0xd409('0x78')],qs[_0xd409('0x7d')](_0x14711a[_0xd409('0x21')][_0xd409('0x7d')]));_0x5e59a9['attributes']=_0x5e59a9['attributes'][_0xd409('0x28')]?_0x5e59a9[_0xd409('0x7b')]:_0x11bb8e[_0xd409('0x78')];if(!_0x14711a['query'][_0xd409('0x33')](_0xd409('0xa3'))){_0x5e59a9[_0xd409('0x11')]=qs[_0xd409('0x11')](_0x14711a[_0xd409('0x21')]['limit']);_0x5e59a9[_0xd409('0xf')]=qs[_0xd409('0xf')](_0x14711a[_0xd409('0x21')][_0xd409('0xf')]);}_0x5e59a9[_0xd409('0x7e')]=qs[_0xd409('0x7f')](_0x14711a[_0xd409('0x21')][_0xd409('0x7f')]);_0x5e59a9[_0xd409('0x5d')]=qs[_0xd409('0x7a')](_['pick'](_0x14711a[_0xd409('0x21')],_0x11bb8e['filters']));_0x5e59a9['where'][_0xd409('0x99')]=_0x585ae5['id'];if(_0x14711a[_0xd409('0x21')][_0xd409('0x81')]){_0x5e59a9[_0xd409('0x5d')]=_[_0xd409('0x34')](_0x5e59a9[_0xd409('0x5d')],{'$or':_[_0xd409('0x6d')](_0x5e59a9[_0xd409('0x7b')],function(_0x1464a4){var _0x25bf73={};_0x25bf73[_0x1464a4]={'$like':'%'+_0x14711a[_0xd409('0x21')]['filter']+'%'};return _0x25bf73;})});}_0x5e59a9=_['merge']({},_0x5e59a9,_0x14711a['options']);return db[_0xd409('0x50')][_0xd409('0x9b')]({'where':_0x5e59a9['where']})[_0xd409('0x16')](function(_0x507586){_0xd6fe0a[_0xd409('0x9b')]=_0x507586;if(_0x14711a['query'][_0xd409('0x9c')]){_0x5e59a9['include']=[{'all':!![]}];}return db[_0xd409('0x50')][_0xd409('0x2e')](_0x5e59a9);})['then'](function(_0x2802e5){_0xd6fe0a[_0xd409('0x9e')]=_0x2802e5;return _0xd6fe0a;});}})['then'](respondWithFilteredResult(_0x3f5931,_0x5e59a9))[_0xd409('0x23')](handleError(_0x3f5931,null));};exports[_0xd409('0xa4')]=function(_0x1ceeee,_0xb1ecf7){try{if(!_0x1ceeee[_0xd409('0x35')]['ListId']){throw new Error(_0xd409('0xa5'));}if(!_0x1ceeee[_0xd409('0x35')][_0xd409('0xa6')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x1ceeee[_0xd409('0x35')]['binding_values']){throw new Error(_0xd409('0xa7'));}if(!_0x1ceeee[_0xd409('0x35')][_0xd409('0xa8')]){throw new Error(_0xd409('0xa9'));}var _0x33ace5=_0x1ceeee[_0xd409('0x35')][_0xd409('0xa6')][_0xd409('0xaa')](',');var _0x27379f=_0x1ceeee[_0xd409('0x35')][_0xd409('0xab')]['split'](',');if(!_0x33ace5['length']||!_0x27379f[_0xd409('0x28')]||_0x33ace5[_0xd409('0x28')]!==_0x27379f[_0xd409('0x28')]){throw new Error(_0xd409('0xac'));}_0x1ceeee[_0xd409('0x35')][_0xd409('0x7d')]=_[_0xd409('0xad')](_0x33ace5,_0x27379f);if(!_0x1ceeee[_0xd409('0x35')][_0xd409('0x7d')][_0xd409('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1ceeee['body']['fields'][_0xd409('0xae')]){throw new Error(_0xd409('0xaf'));}var _0x1a2ea0=path[_0xd409('0x54')](config['root'],'server/files/tmp',_0x1ceeee['file'][_0xd409('0xb0')]);fs[_0xd409('0xb1')](_0x1a2ea0,parseInt('0777',0x8));var _0x406866=require('child_process')['fork'](path[_0xd409('0x54')](__dirname,_0xd409('0xb2')),[_0x1a2ea0,_0x1ceeee[_0xd409('0x35')][_0xd409('0xa6')],_0x1ceeee[_0xd409('0x35')]['binding_values'],_0x1ceeee[_0xd409('0x35')][_0xd409('0x5f')],_0x1ceeee[_0xd409('0x35')][_0xd409('0xb3')],_0x1ceeee[_0xd409('0x35')]['duplicates'],_0x1ceeee[_0xd409('0x35')][_0xd409('0xa8')]]);return _0xb1ecf7[_0xd409('0x12')](0xc8)[_0xd409('0xe')]({'message':_0xd409('0xb4'),'pid':_0x406866[_0xd409('0xb5')]});}catch(_0x443fa3){return _0xb1ecf7['status'](0x1f4)[_0xd409('0x1d')](_0x443fa3);}};exports[_0xd409('0xb6')]=function(_0x5e6c8e,_0x1dac9a){var _0x373aa8=fs[_0xd409('0xb7')](_0x5e6c8e[_0xd409('0xb8')][_0xd409('0x1')]);Papa[_0xd409('0xb9')](_0x373aa8,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x9756e1){return _0x1dac9a[_0xd409('0x12')](0xc8)[_0xd409('0xe')]({'file':_0x5e6c8e[_0xd409('0xb8')],'fields':_0x9756e1[_0xd409('0xba')][_0xd409('0x7d')]});}});};exports['import']=function(_0x320e62,_0x52eaaa){return db['User'][_0xd409('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd409('0xbb')}})['then'](function(_0x231b67){var _0x3b510d=![];if(!_0x320e62[_0xd409('0x35')][_0xd409('0x5f')]){throw new Error(_0xd409('0xa5'));}if(!_0x320e62[_0xd409('0x35')][_0xd409('0xbc')][_0xd409('0x76')]){throw new Error(_0xd409('0xbd'));}if(!_0x320e62['body']['binding'][_0xd409('0xae')]){throw new Error(_0xd409('0xaf'));}if(!_0x320e62[_0xd409('0x35')][_0xd409('0xa8')]){throw new Error(_0xd409('0xa9'));}var _0x2cb23a=require('child_process')[_0xd409('0xbe')](path['join'](__dirname,_0xd409('0xbf')),[_0x320e62[_0xd409('0x63')]['id'],JSON[_0xd409('0xc0')](_0x320e62[_0xd409('0x35')]),JSON['stringify'](_0x231b67)]);_0x2cb23a['on'](_0xd409('0xc1'),function(){_0x3b510d=!![];return _0x52eaaa[_0xd409('0x12')](0xc8)[_0xd409('0xe')]({'message':_0xd409('0xc2'),'pid':_0x2cb23a[_0xd409('0xb5')]});});_0x2cb23a['on'](_0xd409('0xc3'),function(_0x1d9997){if(_0x1d9997&&!_0x3b510d){return _0x52eaaa['status'](0x1f4)[_0xd409('0xe')]({'message':_0xd409('0xc4'),'pid':_0x2cb23a['pid']});}});})[_0xd409('0x23')](handleError(_0x52eaaa,null));};exports[_0xd409('0xc5')]=function(_0x55ab61,_0x324e78){return db[_0xd409('0xc6')][_0xd409('0x2e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd409('0xbb')}})[_0xd409('0x16')](function(_0x4c75a2){var _0x16a78e=![];if(!_0x55ab61[_0xd409('0x35')][_0xd409('0x5f')]){throw new Error('No\x20ListId\x20specified');}if(!_0x55ab61[_0xd409('0x35')]['binding'][_0xd409('0x76')]){throw new Error(_0xd409('0xbd'));}if(!_0x55ab61[_0xd409('0x35')][_0xd409('0xbc')][_0xd409('0xae')]){throw new Error(_0xd409('0xaf'));}if(!_0x55ab61[_0xd409('0x35')][_0xd409('0xa8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x732dbb=require(_0xd409('0xc7'))['fork'](path[_0xd409('0x54')](__dirname,_0xd409('0xc8')),[_0x55ab61[_0xd409('0x63')]['id'],JSON['stringify'](_0x55ab61['body']),JSON[_0xd409('0xc0')](_0x4c75a2)]);_0x732dbb['on'](_0xd409('0xc1'),function(){_0x16a78e=!![];return _0x324e78[_0xd409('0x12')](0xc8)[_0xd409('0xe')]({'message':_0xd409('0xc2'),'pid':_0x732dbb[_0xd409('0xb5')]});});_0x732dbb['on'](_0xd409('0xc3'),function(_0x4cd7ad){if(_0x4cd7ad&&!_0x16a78e){return _0x324e78[_0xd409('0x12')](0x1f4)[_0xd409('0xe')]({'message':_0xd409('0xc4'),'pid':_0x732dbb['pid']});}});})[_0xd409('0x23')](handleError(_0x324e78,null));};exports[_0xd409('0xc9')]=function(_0x455e9d,_0x3daa09){var _0x457acc=[_0xd409('0xca'),_0xd409('0xcb'),_0xd409('0xcc'),_0xd409('0xcd'),'fax',_0xd409('0xce'),_0xd409('0xcf')];var _0x3a9c13={'offset':0x0,'order':qs[_0xd409('0x7f')](_0xd409('0xd0'))},_0x496e9b={'count':0x0,'rows':[]};Promise[_0xd409('0xd1')]()[_0xd409('0x16')](function(){if(_0x455e9d[_0xd409('0x21')][_0xd409('0xd2')]){if(!_[_0xd409('0xd3')](_0x457acc,_0x455e9d[_0xd409('0x21')][_0xd409('0xd2')][_0xd409('0xd4')]())){throw new Error(_0xd409('0xd5'));}_0x457acc=[_0x455e9d[_0xd409('0x21')]['channel'][_0xd409('0xd4')]()];}if(_0x455e9d[_0xd409('0x21')][_0xd409('0xd6')]){try{var _0x57456a=JSON['parse'](_0x455e9d[_0xd409('0x21')][_0xd409('0xd6')]);if(!moment(_0x57456a['from'])[_0xd409('0xd7')]()){throw new Error(_0xd409('0xd8'));}if(!moment(_0x57456a['to'])[_0xd409('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0xf19c0d){throw new Error(_0xd409('0xd9'));}}if(!_0x455e9d['query'][_0xd409('0x33')](_0xd409('0xa3'))){_0x3a9c13[_0xd409('0x11')]=qs[_0xd409('0x11')](_0x455e9d[_0xd409('0x21')][_0xd409('0x11')]||0xa);_0x3a9c13[_0xd409('0xf')]=qs[_0xd409('0xf')](_0x455e9d[_0xd409('0x21')][_0xd409('0xf')]);}var _0x1cd671=_0x457acc[_0xd409('0x6d')](function(_0x360f2a){if(_0x360f2a===_0xd409('0xcf')){var _0x3f1b12={'attributes':['id',_0xd409('0xda'),_0xd409('0x31'),_0xd409('0xdb'),_0xd409('0xdc'),_0xd409('0xdd'),_0xd409('0xde'),_0xd409('0xdf'),'duration',_0xd409('0xe0'),_0xd409('0xe1'),_0xd409('0xe2'),'userSecondDisposition','userThirdDisposition',_0xd409('0xe3')],'where':{'ContactId':_0x455e9d[_0xd409('0x63')]['id']},'include':[{'model':db[_0xd409('0xc6')],'as':_0xd409('0xc6'),'attributes':['id',_0xd409('0x1c'),_0xd409('0xe4'),_0xd409('0xe5')]}],'order':[['createdAt',_0xd409('0xe6')]]};if(_0x455e9d[_0xd409('0x21')][_0xd409('0xd6')]){_0x3f1b12[_0xd409('0x5d')][_0xd409('0xe1')]={'$gte':_0x57456a['from'],'$lte':_0x57456a['to']};}return db['VoiceCallReport'][_0xd409('0xe7')](_0x3f1b12)[_0xd409('0x16')](function(_0x5a3e7c){_0x496e9b[_0xd409('0x9b')]+=_0x5a3e7c[_0xd409('0x9b')];return _[_0xd409('0x6d')](_0x5a3e7c['rows'],function(_0x23d267){var _0xbef62f=_0x23d267[_0xd409('0x37')]({'plain':!![]});_0xbef62f['channel']=_0x360f2a;if(_0xbef62f[_0xd409('0xc6')]){_0xbef62f['User']={'id':_0xbef62f[_0xd409('0xc6')]['id'],'name':_0xbef62f[_0xd409('0xc6')][_0xd409('0x1c')],'fullname':_0xbef62f[_0xd409('0xc6')][_0xd409('0xe4')],'alias':_0xbef62f[_0xd409('0xc6')][_0xd409('0xe5')]};}return _0xbef62f;});});}else{var _0x20130a=_[_0xd409('0xe8')](_0x360f2a)+(_0x360f2a===_0xd409('0xcb')?_0xd409('0xe9'):_0xd409('0xea'));var _0x542470={'attributes':['id','closed','closedAt',_0xd409('0xe1'),_0xd409('0xe0'),_0xd409('0xeb'),_0xd409('0xec'),_0xd409('0xed'),_0xd409('0xe3'),_0x20130a+'Id'],'where':{'ContactId':_0x455e9d[_0xd409('0x63')]['id']},'include':[{'model':db[_0x20130a],'as':_0xd409('0xea'),'attributes':['id',_0xd409('0x1c'),_0xd409('0xee')]},{'model':db['User'],'as':_0xd409('0xef'),'attributes':['id',_0xd409('0x1c'),_0xd409('0xe4')]},{'model':db[_0xd409('0xf0')],'as':_0xd409('0xf1'),'attributes':['id',_0xd409('0x1c'),_0xd409('0x64')],'through':{'attributes':[]}}],'order':[[_0xd409('0xe1'),_0xd409('0xe6')]]};if(_0x455e9d['query']['range']){_0x542470[_0xd409('0x5d')][_0xd409('0xe1')]={'$gte':_0x57456a[_0xd409('0x36')],'$lte':_0x57456a['to']};}switch(_0x360f2a){case _0xd409('0xcb'):_0x542470[_0xd409('0x7b')][_0xd409('0x5e')](_0xd409('0xf2'),_0xd409('0xf3'),_0xd409('0xf4'),_0xd409('0xf5'),'osName','ratingMessage','ratingType',_0xd409('0xf6'),_0xd409('0xf7'));break;case _0xd409('0xca'):_0x542470[_0xd409('0x7b')][_0xd409('0x5e')]('subject',_0xd409('0xf8'));break;case'openchannel':_0x542470[_0xd409('0x7b')][_0xd409('0x5e')]('externalUrl','threadId');break;}return db[_[_0xd409('0xe8')](_0x360f2a)+_0xd409('0xf9')]['findAndCountAll'](_0x542470)[_0xd409('0x16')](function(_0x3baebb){_0x496e9b[_0xd409('0x9b')]+=_0x3baebb['count'];return _[_0xd409('0x6d')](_0x3baebb[_0xd409('0x9e')],function(_0x2ba40a){var _0x46eb06=_0x2ba40a[_0xd409('0x37')]({'plain':!![]});_0x46eb06['channel']=_0x360f2a;if(_0x46eb06['Owner']){_0x46eb06[_0xd409('0xef')]={'id':_0x46eb06[_0xd409('0xef')]['id'],'name':_0x46eb06['Owner'][_0xd409('0x1c')],'fullname':_0x46eb06['Owner'][_0xd409('0xe4')]};}return _0x46eb06;});});}});return Promise[_0xd409('0x61')](_0x1cd671);})[_0xd409('0x16')](function(_0x44bf85){return _(_0x44bf85)[_0xd409('0xfa')]()[_0xd409('0xfb')]('createdAt')[_0xd409('0xfc')]()[_0xd409('0xfd')]();})[_0xd409('0x16')](function(_0x14d80d){_0x496e9b[_0xd409('0x9e')]=_0x3a9c13['limit']?_0x14d80d[_0xd409('0xfe')](_0x3a9c13[_0xd409('0xf')],_0x3a9c13[_0xd409('0xf')]+_0x3a9c13[_0xd409('0x11')]):_0x14d80d;return _0x496e9b;})[_0xd409('0x16')](respondWithFilteredResult(_0x3daa09,_0x3a9c13))[_0xd409('0x23')](handleError(_0x3daa09,null));}; \ No newline at end of file +var _0xcaaf=['Phones.OrderBy','omit','map','format','cf_%d','$and','pickBy','isEmpty','table','cm_contacts','setFields','toParam','text','getTags','findOne','model','Tag','rawAttributes','filters','intersection','attributes','fields','sort','filter','options','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','phone','contact\x20phone\x20exists','PHONE','item','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','order','pick','ContactId','includeAll','include','rows','nolimit','getHopperFinals','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','binding_values','split','zipObject','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','createReadStream','file','parse','meta','import','User','agent','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','fax','whatsapp','voice','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','endtime','duration','createdAt','userDisposition','userSecondDisposition','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','browserName','customerPort','ratingMessage','ratingValue','referer','subject','openchannel','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','getOptions','findAll','query','CmContact','find','catch','describe','tags','keys','startsWith','cf_','columnName','analytics','CmCustomField','length','displayName','alias','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','where','ListId','findOrCreate','spread','hasOwnProperty','push','contact','all','show','params','Tags','color','tag','ContactItemType','ItemType','sequelize','literal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaaf,0x199));var _0xfcaa=function(_0x51c703,_0x48d443){_0x51c703=_0x51c703-0x0;var _0x39cd28=_0xcaaf[_0x51c703];return _0x39cd28;};'use strict';var moment=require(_0xfcaa('0x0'));var BPromise=require(_0xfcaa('0x1'));var util=require(_0xfcaa('0x2'));var path=require(_0xfcaa('0x3'));var fs=require('fs');var _=require(_0xfcaa('0x4'));var squel=require(_0xfcaa('0x5'));var Papa=require(_0xfcaa('0x6'));var Redis=require(_0xfcaa('0x7'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0xfcaa('0x8'))('api');var config=require(_0xfcaa('0x9'));var shared=require(_0xfcaa('0xa'));var db=require(_0xfcaa('0xb'))['db'];config[_0xfcaa('0xc')]=_[_0xfcaa('0xd')](config[_0xfcaa('0xc')],{'host':_0xfcaa('0xe'),'port':0x18eb});var socket=require(_0xfcaa('0xf'))(new Redis(config[_0xfcaa('0xc')]));require(_0xfcaa('0x10'))[_0xfcaa('0x11')](socket);function respondWithResult(_0x15ede1,_0x13d854){_0x13d854=_0x13d854||0xc8;return function(_0x4e8cda){if(_0x4e8cda){return _0x15ede1[_0xfcaa('0x12')](_0x13d854)[_0xfcaa('0x13')](_0x4e8cda);}};}function respondWithFilteredResult(_0x562b17,_0x305331){return function(_0xcb7b1f){if(_0xcb7b1f){var _0x3f6b29=typeof _0x305331[_0xfcaa('0x14')]===_0xfcaa('0x15')&&typeof _0x305331[_0xfcaa('0x16')]===_0xfcaa('0x15');var _0x2cabfa=_0xcb7b1f[_0xfcaa('0x17')];var _0x4331d6=_0x3f6b29?0x0:_0x305331['offset'];var _0x12ad7f=_0x3f6b29?_0xcb7b1f[_0xfcaa('0x17')]:_0x305331[_0xfcaa('0x14')]+_0x305331['limit'];var _0x5252d8;if(_0x12ad7f>=_0x2cabfa){_0x12ad7f=_0x2cabfa;_0x5252d8=0xc8;}else{_0x5252d8=0xce;}_0x562b17[_0xfcaa('0x12')](_0x5252d8);return _0x562b17[_0xfcaa('0x18')](_0xfcaa('0x19'),_0x4331d6+'-'+_0x12ad7f+'/'+_0x2cabfa)[_0xfcaa('0x13')](_0xcb7b1f);}return null;};}function saveUpdates(_0x475509){return function(_0x180029){if(_0x180029){return _0x180029[_0xfcaa('0x1a')](_0x475509)[_0xfcaa('0x1b')](function(_0x3447b1){return _0x3447b1;});}return null;};}function removeEntity(_0xc247fe){return function(_0x7094c5){if(_0x7094c5){return _0x7094c5[_0xfcaa('0x1c')]()[_0xfcaa('0x1b')](function(){_0xc247fe[_0xfcaa('0x12')](0xcc)[_0xfcaa('0x1d')]();});}};}function handleEntityNotFound(_0x195afd){return function(_0x14a905){if(!_0x14a905){_0x195afd[_0xfcaa('0x1e')](0x194);}return _0x14a905;};}function handleError(_0xdc6895,_0x3b3ca4){_0x3b3ca4=_0x3b3ca4||0x1f4;return function(_0x2dafbc){logger[_0xfcaa('0x1f')](_0x2dafbc[_0xfcaa('0x20')]);if(_0x2dafbc[_0xfcaa('0x21')]){delete _0x2dafbc[_0xfcaa('0x21')];}_0xdc6895['status'](_0x3b3ca4)['send'](_0x2dafbc);};}exports[_0xfcaa('0x22')]=function(_0x567485,_0x23963d){var _0xe02044={};return contacts['describe']()[_0xfcaa('0x1b')](function(_0x1655a8){_0xe02044=qs[_0xfcaa('0x23')](_0x1655a8,_0x567485);return contacts[_0xfcaa('0x24')](_0x567485[_0xfcaa('0x25')],_0x567485['user'],_0xe02044,_0x1655a8);})['then'](respondWithFilteredResult(_0x23963d,_0xe02044))['catch'](handleError(_0x23963d,null));};exports[_0xfcaa('0x1c')]=function(_0x127052,_0x5931ae){return db[_0xfcaa('0x26')][_0xfcaa('0x27')]({'where':{'id':_0x127052['params']['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x5931ae,null))[_0xfcaa('0x1b')](removeEntity(_0x5931ae,null))[_0xfcaa('0x28')](handleError(_0x5931ae,null));};exports[_0xfcaa('0x29')]=function(_0x59bbf1,_0x4b582e){return db[_0xfcaa('0x26')]['describe']()['then'](function(_0x49df45){delete _0x49df45[_0xfcaa('0x2a')];for(var _0x52a375=0x0;_0x52a3750x0){return new Promise(function(_0x746be){var _0x450692=[];for(var _0x47ea2e=0x0;_0x47ea2e<_0x248107[_0xfcaa('0x31')];_0x47ea2e++){_0x450692[_0xfcaa('0x69')](insertAdditionalPhones(_0x248107[_0x47ea2e][_0xfcaa('0x6a')],_0x248107[_0x47ea2e][_0xfcaa('0x5f')]));}Promise[_0xfcaa('0x6b')](_0x450692)['then'](function(){_0x746be(0x1);});})[_0xfcaa('0x1b')](function(){return{'success':_0x5a6853,'failure':_0x2d0c15,'duplicates':_0xf446bc};});}else{return{'success':_0x5a6853,'failure':_0x2d0c15,'duplicates':_0xf446bc};}}})['then'](respondWithResult(_0x21ca96,0xc9))[_0xfcaa('0x28')](handleError(_0x21ca96,null));};exports[_0xfcaa('0x6c')]=function(_0x2a7c50,_0x22182d){var _0x1634d1;return db[_0xfcaa('0x26')][_0xfcaa('0x29')]()[_0xfcaa('0x1b')](function(_0xe4ca96){return db['CmContact'][_0xfcaa('0x27')]({'where':{'id':_0x2a7c50[_0xfcaa('0x6d')]['id']},'include':[{'model':db['Tag'],'as':_0xfcaa('0x6e'),'attributes':['id',_0xfcaa('0x21'),_0xfcaa('0x6f')],'required':_0x2a7c50['query'][_0xfcaa('0x70')]?!![]:![]},{'model':db[_0xfcaa('0x4e')],'as':'Phones','where':{'CmContactId':_0x2a7c50['params']['id']},'required':![],'include':[{'model':db[_0xfcaa('0x71')],'as':_0xfcaa('0x72')}]}],'order':[db[_0xfcaa('0x73')][_0xfcaa('0x74')](_0xfcaa('0x75'))],'attributes':_['keys'](_0xe4ca96)});})[_0xfcaa('0x1b')](function(_0x5093ab){if(!_[_0xfcaa('0x5c')](_0x5093ab)){_0x1634d1=_0x5093ab[_0xfcaa('0x3c')]({'plain':!![]});var _0x25ca33={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5093ab&&_0x5093ab['ListId']){if(_0x5093ab[_0xfcaa('0x65')]){_0x25ca33[_0xfcaa('0x64')]['$and'][_0xfcaa('0x69')]({'ListId':{'$ne':_0x5093ab[_0xfcaa('0x65')]}});}}return db[_0xfcaa('0x30')][_0xfcaa('0x24')](_0x25ca33);}})['then'](function(_0x3d7c9b){if(!_[_0xfcaa('0x5c')](_0x3d7c9b)){return _[_0xfcaa('0x76')](_0x1634d1,_[_0xfcaa('0x77')](_0x3d7c9b,function(_0x7edfff){return util[_0xfcaa('0x78')](_0xfcaa('0x79'),_0x7edfff['id']);}));}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x22182d,null))[_0xfcaa('0x1b')](respondWithResult(_0x22182d,null))['catch'](handleError(_0x22182d,null));};exports['update']=function(_0x3d103a,_0x498bb7){var _0x41d1f3;if(_0x3d103a[_0xfcaa('0x3a')]['id']){delete _0x3d103a['body']['id'];}if(!_[_0xfcaa('0x5c')](_0x3d103a[_0xfcaa('0x3a')][_0xfcaa('0x5b')])){var _0x149b7c=_0x3d103a[_0xfcaa('0x3a')]['dialTimezone'];if(!_['isNil'](shared['timezones'][_0x149b7c]))_0x3d103a[_0xfcaa('0x3a')][_0xfcaa('0x5e')]=shared['timezones'][_0x149b7c][_0xfcaa('0x5e')];}return db[_0xfcaa('0x26')][_0xfcaa('0x27')]({'where':{'id':_0x3d103a[_0xfcaa('0x6d')]['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x498bb7,null))[_0xfcaa('0x1b')](saveUpdates(_0x3d103a[_0xfcaa('0x3a')],null))[_0xfcaa('0x1b')](function(_0x20c31e){_0x41d1f3=_0x20c31e;var _0x5e81c4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x20c31e&&_0x20c31e[_0xfcaa('0x65')]){if(_0x20c31e[_0xfcaa('0x65')]){_0x5e81c4['where'][_0xfcaa('0x7a')][_0xfcaa('0x69')]({'ListId':{'$ne':_0x20c31e[_0xfcaa('0x65')]}});}}return db['CmCustomField'][_0xfcaa('0x24')](_0x5e81c4);})[_0xfcaa('0x1b')](function(_0x5a244c){if(_0x5a244c){return _[_0xfcaa('0x76')](_[_0xfcaa('0x7b')](_0x3d103a[_0xfcaa('0x3a')],function(_0x51ff19,_0x4e0c1e){return _[_0xfcaa('0x2c')](_0x4e0c1e,'cf_');}),_['map'](_0x5a244c,function(_0x38cf96){return util['format'](_0xfcaa('0x79'),_0x38cf96['id']);}));}})['then'](function(_0x4a74f3){if(_0x4a74f3&&!_[_0xfcaa('0x7c')](_0x4a74f3)){var _0x4d6da8=squel[_0xfcaa('0x1a')]()[_0xfcaa('0x7d')](_0xfcaa('0x7e'))[_0xfcaa('0x7f')](_0x4a74f3)[_0xfcaa('0x64')]('id\x20=\x20?',_0x3d103a[_0xfcaa('0x6d')]['id'])[_0xfcaa('0x80')]();return db[_0xfcaa('0x73')]['query'](_0x4d6da8[_0xfcaa('0x81')],{'replacements':_0x4d6da8['values']});}})[_0xfcaa('0x1b')](function(){if(_0x3d103a[_0xfcaa('0x3a')]['phone']&&_0x41d1f3){return db['CmHopper'][_0xfcaa('0x1a')]({'phone':_0x3d103a[_0xfcaa('0x3a')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x41d1f3['id']}});}})[_0xfcaa('0x1b')](function(){return _0x41d1f3;})[_0xfcaa('0x1b')](respondWithResult(_0x498bb7,null))[_0xfcaa('0x28')](handleError(_0x498bb7,null));};exports[_0xfcaa('0x82')]=function(_0x29b090,_0x13b5e3){var _0xec3e6b={};var _0x4802da={};var _0x44335e;var _0x105a14;return db[_0xfcaa('0x26')][_0xfcaa('0x83')]({'where':{'id':_0x29b090[_0xfcaa('0x6d')]['id']}})['then'](handleEntityNotFound(_0x13b5e3,null))[_0xfcaa('0x1b')](function(_0x9e8d3d){if(_0x9e8d3d){_0x44335e=_0x9e8d3d;_0x4802da[_0xfcaa('0x84')]=_[_0xfcaa('0x2b')](db[_0xfcaa('0x85')][_0xfcaa('0x86')]);_0x4802da[_0xfcaa('0x25')]=_['keys'](_0x29b090['query']);_0x4802da[_0xfcaa('0x87')]=_[_0xfcaa('0x88')](_0x4802da['model'],_0x4802da['query']);_0xec3e6b[_0xfcaa('0x89')]=_[_0xfcaa('0x88')](_0x4802da['model'],qs[_0xfcaa('0x8a')](_0x29b090[_0xfcaa('0x25')]['fields']));_0xec3e6b[_0xfcaa('0x89')]=_0xec3e6b[_0xfcaa('0x89')]['length']?_0xec3e6b[_0xfcaa('0x89')]:_0x4802da['model'];_0xec3e6b['order']=qs[_0xfcaa('0x8b')](_0x29b090[_0xfcaa('0x25')][_0xfcaa('0x8b')]);_0xec3e6b[_0xfcaa('0x64')]=qs[_0xfcaa('0x87')](_['pick'](_0x29b090[_0xfcaa('0x25')],_0x4802da[_0xfcaa('0x87')]));if(_0x29b090[_0xfcaa('0x25')][_0xfcaa('0x8c')]){_0xec3e6b[_0xfcaa('0x64')]=_['merge'](_0xec3e6b['where'],{'$or':_[_0xfcaa('0x77')](_0xec3e6b[_0xfcaa('0x89')],function(_0x6ce376){var _0x48aa9a={};_0x48aa9a[_0x6ce376]={'$like':'%'+_0x29b090[_0xfcaa('0x25')][_0xfcaa('0x8c')]+'%'};return _0x48aa9a;})});}_0xec3e6b=_[_0xfcaa('0x39')]({},_0xec3e6b,_0x29b090[_0xfcaa('0x8d')]);return _0x44335e[_0xfcaa('0x82')](_0xec3e6b);}})[_0xfcaa('0x1b')](function(_0x576fcf){if(_0x576fcf){_0x105a14=_0x576fcf[_0xfcaa('0x31')];if(!_0x29b090[_0xfcaa('0x25')][_0xfcaa('0x68')]('nolimit')){_0xec3e6b[_0xfcaa('0x16')]=qs['limit'](_0x29b090['query'][_0xfcaa('0x16')]);_0xec3e6b[_0xfcaa('0x14')]=qs[_0xfcaa('0x14')](_0x29b090['query']['offset']);}return _0x44335e[_0xfcaa('0x82')](_0xec3e6b);}})[_0xfcaa('0x1b')](function(_0x1bd5c2){if(_0x1bd5c2){return _0x1bd5c2?{'count':_0x105a14,'rows':_0x1bd5c2}:null;}})[_0xfcaa('0x1b')](respondWithResult(_0x13b5e3,null))['catch'](handleError(_0x13b5e3,null));};exports[_0xfcaa('0x8e')]=function(_0x424b13,_0x4d5db5){if(_0x424b13[_0xfcaa('0x3a')]['id']){delete _0x424b13['body']['id'];}return db[_0xfcaa('0x26')][_0xfcaa('0x83')]({'where':{'id':_0x424b13[_0xfcaa('0x6d')]['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x4d5db5,null))[_0xfcaa('0x1b')](function(_0x1294aa){if(_0x1294aa){return _0x1294aa['setTags'](_0x424b13[_0xfcaa('0x3a')][_0xfcaa('0x8f')]||[]);}return null;})['then'](respondWithResult(_0x4d5db5,null))['catch'](handleError(_0x4d5db5,null));};exports['setAdditionalPhones']=function(_0x40422c,_0x4380f8){var _0x2d5320=[];_0x2d5320['push'](addAdditionalPhones(_0x40422c[_0xfcaa('0x3a')]));Promise[_0xfcaa('0x6b')](_0x2d5320)['then'](function(){_0x2d5320=[];_0x2d5320[_0xfcaa('0x69')](deleteCmHopperPhones(_0x40422c[_0xfcaa('0x3a')]['id']));_0x2d5320['push'](addCmHopperPhones(_0x40422c[_0xfcaa('0x3a')]['id']));Promise[_0xfcaa('0x6b')](_0x2d5320)['then'](function(){return[0x1];})[_0xfcaa('0x1b')](respondWithResult(_0x4380f8,null));});};function addAdditionalPhones(_0x3f791c){var _0x97e625;return new Promise(function(_0x1b6d5b){return db[_0xfcaa('0x4e')][_0xfcaa('0x1c')]({'where':{'CmContactId':_0x3f791c['id']}})[_0xfcaa('0x1b')](function(){db['ContactItemType'][_0xfcaa('0x24')]({'raw':!![],'attributes':['id',_0xfcaa('0x90')]})['then'](function(_0x139cff){var _0x5f1878=[];for(var _0x38056c=0x0;_0x38056c<_0x3f791c[_0xfcaa('0x91')][_0xfcaa('0x31')];_0x38056c++){var _0x2a369d=_0x3f791c[_0xfcaa('0x92')]?_[_0xfcaa('0x5c')](_0x3f791c['item_types'][_0x38056c])?'':_0x3f791c[_0xfcaa('0x92')][_0x38056c]:_0x3f791c[_0xfcaa('0x91')][_0x38056c]['ItemTypeId']?_0x3f791c[_0xfcaa('0x91')][_0x38056c][_0xfcaa('0x93')]:'';var _0x48aeac=_[_0xfcaa('0x5c')](_0x3f791c[_0xfcaa('0x91')][_0x38056c][_0xfcaa('0x94')])?'':_0x3f791c['items'][_0x38056c][_0xfcaa('0x94')];var _0x1c9664=_0x2a369d+':'+_0x3f791c[_0xfcaa('0x91')][_0x38056c][_0xfcaa('0x95')]+'§'+_0x48aeac;if(_[_0xfcaa('0x5c')](_0x97e625))_0x97e625=_0x1c9664;else _0x97e625+=';'+_0x1c9664;var _0x5a7311=null;var _0x182804=null;if(_0x3f791c['item_types']){if(!_['isNil'](_0x3f791c[_0xfcaa('0x92')][_0x38056c])){_0x182804=_[_0xfcaa('0x27')](_0x139cff,function(_0x2ecafc){return _0x2ecafc['id']===_0x3f791c[_0xfcaa('0x92')][_0x38056c];});if(!_[_0xfcaa('0x5c')](_0x182804)){_0x5a7311=_0x182804[_0xfcaa('0x90')];}}}else{if(!_['isNil'](_0x3f791c['items'][_0x38056c])){_0x182804=_[_0xfcaa('0x27')](_0x139cff,function(_0xb055de){return _0xb055de['id']===_0x3f791c[_0xfcaa('0x91')][_0x38056c][_0xfcaa('0x93')];});if(!_['isNil'](_0x182804)){_0x5a7311=_0x38056c;}}}if(_['isNil'](_0x5a7311)){_0x5a7311=0x64;}_0x5f1878[_0xfcaa('0x69')](addAdditionalPhone(_0x3f791c['id'],_0x3f791c['items'][_0x38056c]['phone'],_0x3f791c[_0xfcaa('0x92')]?_[_0xfcaa('0x5c')](_0x3f791c['item_types'][_0x38056c])?null:_0x3f791c[_0xfcaa('0x92')][_0x38056c]:_0x3f791c['items'][_0x38056c][_0xfcaa('0x93')]?_0x3f791c['items'][_0x38056c][_0xfcaa('0x93')]:null,_0x5a7311,_0x48aeac));}Promise[_0xfcaa('0x6b')](_0x5f1878)[_0xfcaa('0x1b')](function(){db[_0xfcaa('0x26')][_0xfcaa('0x1a')]({'AdditionalPhones':_0x97e625},{'where':{'id':_0x3f791c['id']}})[_0xfcaa('0x1b')](function(){_0x1b6d5b(0x1);});});});});});}function addAdditionalPhone(_0x50b518,_0x3a4533,_0x3a06fb,_0x58fb63,_0xdc60d9){return db[_0xfcaa('0x4e')][_0xfcaa('0x27')]({'where':{'CmContactId':_0x50b518,'item':_0x3a4533}})[_0xfcaa('0x1b')](function(_0xa8ee10){if(_0xa8ee10)logger['info'](_0xfcaa('0x96'),_0xa8ee10);else{db[_0xfcaa('0x4e')]['create']({'CmContactId':_0x50b518,'item':_0x3a4533,'ItemTypeId':_0x3a06fb,'OrderBy':_0x58fb63,'ItemClass':_0xfcaa('0x97'),'description':_0xdc60d9});}});}function deleteCmHopperPhones(_0x4a77db){return new Promise(function(_0x1bb01a){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4a77db}})['then'](function(_0x1efcd8){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x1efcd8,'id')}}});})['then'](function(){_0x1bb01a(0x1);});});}function addCmHopperPhones(_0x1066a8){return new Promise(function(_0x1be4a9){return db['CmHopper'][_0xfcaa('0x24')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1066a8}})[_0xfcaa('0x1b')](function(_0x7f1839){var _0x29d05d=[];_[_0xfcaa('0x77')](_0x7f1839,function(_0x219808){_0x29d05d[_0xfcaa('0x69')](createCmHopperPhone(_0x1066a8,_0x219808['id']));});Promise[_0xfcaa('0x6b')](_0x29d05d)['then'](function(){_0x1be4a9(0x1);});});});}function createCmHopperPhone(_0x38cb03,_0x3657bf){return new Promise(function(_0xb15fd1){db['CmContactHasItem'][_0xfcaa('0x24')]({'raw':!![],'attributes':[_0xfcaa('0x98'),_0xfcaa('0x90')],'where':{'CmContactId':_0x38cb03,'ItemClass':_0xfcaa('0x97')},'include':[{'model':db[_0xfcaa('0x71')],'attributes':[_0xfcaa('0x90')],'as':_0xfcaa('0x72')}],'order':[_0xfcaa('0x90'),db[_0xfcaa('0x73')][_0xfcaa('0x74')]('`ItemType`.OrderBy')]})['then'](function(_0x1457b7){var _0x4de4f6=0x1;var _0x361d2e=_[_0xfcaa('0x77')](_0x1457b7,function(_0x574f30){_0x574f30[_0xfcaa('0x99')]=_0x3657bf;_0x574f30[_0xfcaa('0x95')]=_0x574f30['item'];_0x574f30['OrderBy']=_0x4de4f6;delete _0x574f30[_0xfcaa('0x9a')];_0x4de4f6=_0x4de4f6+0x1;return _0x574f30;});return db[_0xfcaa('0x9b')][_0xfcaa('0x60')](_0x361d2e,{});})[_0xfcaa('0x1b')](function(){_0xb15fd1(0x1);});});}function insertAdditionalPhones(_0x51febb,_0x3260a8){return new Promise(function(_0x3d74e6){var _0x20ec34=[];for(var _0x576c0b=0x0;_0x576c0b<_0x3260a8[_0xfcaa('0x31')];_0x576c0b++){var _0x117c0d=_0x3260a8[_0x576c0b];_0x20ec34[_0xfcaa('0x69')](parseContactItemType(_0x117c0d));}Promise[_0xfcaa('0x6b')](_0x20ec34)[_0xfcaa('0x1b')](function(){var _0x100339={'id':_0x51febb['id'],'items':_0x3260a8};return addAdditionalPhones(_0x100339)[_0xfcaa('0x1b')](function(){return addCmHopperPhones(_0x51febb['id']);});})[_0xfcaa('0x1b')](function(){_0x3d74e6(_0x51febb);});});}function parseContactItemType(_0x555754){return new Promise(function(_0x37b8c5){if(_0x555754[_0xfcaa('0x68')]('ItemTypeId')){_0x37b8c5(_0x555754);}else{return db['ContactItemType'][_0xfcaa('0x27')]({'where':{'name':_0x555754[_0xfcaa('0x72')]}})[_0xfcaa('0x1b')](function(_0x8ac373){if(_[_0xfcaa('0x5c')](_0x8ac373))_0x555754[_0xfcaa('0x93')]=null;else _0x555754[_0xfcaa('0x93')]=_0x8ac373['id'];_0x37b8c5(_0x555754);});}});}exports[_0xfcaa('0x9c')]=function(_0x43a427,_0x469fbd){return db['CmContactHasItem'][_0xfcaa('0x24')]({'raw':!![],'where':{'CmContactId':_0x43a427[_0xfcaa('0x6d')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xfcaa('0x71')],'as':_0xfcaa('0x72')}],'order':[[_0xfcaa('0x90')],[db['sequelize']['literal'](_0xfcaa('0x9d'))]]})[_0xfcaa('0x1b')](function(_0x2386e6){return _0x2386e6;})['then'](respondWithResult(_0x469fbd,null))[_0xfcaa('0x28')](handleError(_0x469fbd,null));};exports[_0xfcaa('0x9e')]=function(_0x4eccec,_0x4f3a9f){return db[_0xfcaa('0x4e')][_0xfcaa('0x24')]({'raw':!![],'where':{'CmContactId':_0x4eccec[_0xfcaa('0x3a')][_0xfcaa('0x9f')]}})['then'](function(_0x97c05b){var _0x1b4ee5=_[_0xfcaa('0x77')](_0x97c05b,function(_0x4313d6){_0x4313d6[_0xfcaa('0xa0')]=_0x4eccec['body'][_0xfcaa('0xa1')];return _0x4313d6;});return db[_0xfcaa('0x4e')][_0xfcaa('0x60')](_0x1b4ee5,{});})[_0xfcaa('0x1b')](function(){return addCmHopperPhones(_0x4eccec['body'][_0xfcaa('0xa1')]);})[_0xfcaa('0x1b')](function(){return['ok'];})[_0xfcaa('0x1b')](respondWithResult(_0x4f3a9f,null))[_0xfcaa('0x28')](handleError(_0x4f3a9f,null));};exports[_0xfcaa('0xa2')]=function(_0x147f5e,_0xcc3100){var _0x2cdaac=[];_0x2cdaac[_0xfcaa('0x69')](createCmHopperPhone(_0x147f5e[_0xfcaa('0x3a')]['id'],_0x147f5e[_0xfcaa('0x3a')][_0xfcaa('0xa3')]));Promise[_0xfcaa('0x6b')](_0x2cdaac)['then'](function(){return[0x1];})[_0xfcaa('0x1b')](respondWithResult(_0xcc3100,null));};exports[_0xfcaa('0xa4')]=function(_0x5b9f21,_0x16252f){var _0x220928={'raw':![],'where':{}};var _0x280814={};var _0x5aa3ba={'count':0x0,'rows':[]};return db['CmContact'][_0xfcaa('0x83')]({'where':{'id':_0x5b9f21['params']['id']}})['then'](handleEntityNotFound(_0x16252f,null))[_0xfcaa('0x1b')](function(_0x5cf352){if(_0x5cf352){_0x280814['model']=_[_0xfcaa('0x2b')](db[_0xfcaa('0x41')][_0xfcaa('0x86')]);_0x280814[_0xfcaa('0x25')]=_[_0xfcaa('0x2b')](_0x5b9f21[_0xfcaa('0x25')]);_0x280814[_0xfcaa('0x87')]=_[_0xfcaa('0x88')](_0x280814[_0xfcaa('0x84')],_0x280814[_0xfcaa('0x25')]);_0x220928[_0xfcaa('0x89')]=_[_0xfcaa('0x88')](_0x280814[_0xfcaa('0x84')],qs[_0xfcaa('0x8a')](_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0x8a')]));_0x220928['attributes']=_0x220928['attributes']['length']?_0x220928[_0xfcaa('0x89')]:_0x280814[_0xfcaa('0x84')];if(!_0x5b9f21[_0xfcaa('0x25')]['hasOwnProperty']('nolimit')){_0x220928[_0xfcaa('0x16')]=qs[_0xfcaa('0x16')](_0x5b9f21[_0xfcaa('0x25')]['limit']);_0x220928[_0xfcaa('0x14')]=qs[_0xfcaa('0x14')](_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0x14')]);}_0x220928[_0xfcaa('0xa5')]=qs['sort'](_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0x8b')]);_0x220928['where']=qs['filters'](_[_0xfcaa('0xa6')](_0x5b9f21[_0xfcaa('0x25')],_0x280814[_0xfcaa('0x87')]));_0x220928[_0xfcaa('0x64')][_0xfcaa('0xa7')]=_0x5cf352['id'];if(_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0x8c')]){_0x220928['where']=_[_0xfcaa('0x39')](_0x220928[_0xfcaa('0x64')],{'$or':_[_0xfcaa('0x77')](_0x220928[_0xfcaa('0x89')],function(_0x306427){var _0x5b126d={};_0x5b126d[_0x306427]={'$like':'%'+_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0x8c')]+'%'};return _0x5b126d;})});}_0x220928=_[_0xfcaa('0x39')]({},_0x220928,_0x5b9f21[_0xfcaa('0x8d')]);return db[_0xfcaa('0x41')]['count']({'where':_0x220928[_0xfcaa('0x64')]})[_0xfcaa('0x1b')](function(_0x54cf6e){_0x5aa3ba['count']=_0x54cf6e;if(_0x5b9f21[_0xfcaa('0x25')][_0xfcaa('0xa8')]){_0x220928[_0xfcaa('0xa9')]=[{'all':!![]}];}return db[_0xfcaa('0x41')][_0xfcaa('0x24')](_0x220928);})[_0xfcaa('0x1b')](function(_0x435e9a){_0x5aa3ba[_0xfcaa('0xaa')]=_0x435e9a;return _0x5aa3ba;});}})[_0xfcaa('0x1b')](respondWithFilteredResult(_0x16252f,_0x220928))[_0xfcaa('0x28')](handleError(_0x16252f,null));};exports['getHopperHistories']=function(_0x496d87,_0x1ffdae){var _0x6a4ca={'raw':!![],'where':{}};var _0x502598={};var _0xd668a4={'count':0x0,'rows':[]};return db[_0xfcaa('0x26')]['findOne']({'where':{'id':_0x496d87[_0xfcaa('0x6d')]['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x1ffdae,null))['then'](function(_0x50d518){if(_0x50d518){_0x502598['model']=_[_0xfcaa('0x2b')](db[_0xfcaa('0x50')][_0xfcaa('0x86')]);_0x502598[_0xfcaa('0x25')]=_[_0xfcaa('0x2b')](_0x496d87[_0xfcaa('0x25')]);_0x502598[_0xfcaa('0x87')]=_[_0xfcaa('0x88')](_0x502598['model'],_0x502598[_0xfcaa('0x25')]);_0x6a4ca[_0xfcaa('0x89')]=_['intersection'](_0x502598['model'],qs['fields'](_0x496d87[_0xfcaa('0x25')][_0xfcaa('0x8a')]));_0x6a4ca[_0xfcaa('0x89')]=_0x6a4ca[_0xfcaa('0x89')][_0xfcaa('0x31')]?_0x6a4ca[_0xfcaa('0x89')]:_0x502598[_0xfcaa('0x84')];if(!_0x496d87[_0xfcaa('0x25')][_0xfcaa('0x68')](_0xfcaa('0xab'))){_0x6a4ca[_0xfcaa('0x16')]=qs[_0xfcaa('0x16')](_0x496d87[_0xfcaa('0x25')][_0xfcaa('0x16')]);_0x6a4ca[_0xfcaa('0x14')]=qs[_0xfcaa('0x14')](_0x496d87[_0xfcaa('0x25')][_0xfcaa('0x14')]);}_0x6a4ca['order']=qs[_0xfcaa('0x8b')](_0x496d87[_0xfcaa('0x25')][_0xfcaa('0x8b')]);_0x6a4ca[_0xfcaa('0x64')]=qs[_0xfcaa('0x87')](_[_0xfcaa('0xa6')](_0x496d87['query'],_0x502598['filters']));_0x6a4ca[_0xfcaa('0x64')][_0xfcaa('0xa7')]=_0x50d518['id'];if(_0x496d87['query'][_0xfcaa('0x8c')]){_0x6a4ca['where']=_[_0xfcaa('0x39')](_0x6a4ca[_0xfcaa('0x64')],{'$or':_[_0xfcaa('0x77')](_0x6a4ca['attributes'],function(_0x3627fd){var _0x187b55={};_0x187b55[_0x3627fd]={'$like':'%'+_0x496d87['query'][_0xfcaa('0x8c')]+'%'};return _0x187b55;})});}_0x6a4ca=_[_0xfcaa('0x39')]({},_0x6a4ca,_0x496d87['options']);return db[_0xfcaa('0x50')][_0xfcaa('0x17')]({'where':_0x6a4ca['where']})[_0xfcaa('0x1b')](function(_0x321eb6){_0xd668a4[_0xfcaa('0x17')]=_0x321eb6;if(_0x496d87[_0xfcaa('0x25')][_0xfcaa('0xa8')]){_0x6a4ca[_0xfcaa('0xa9')]=[{'all':!![]}];}return db[_0xfcaa('0x50')][_0xfcaa('0x24')](_0x6a4ca);})[_0xfcaa('0x1b')](function(_0x5e960f){_0xd668a4[_0xfcaa('0xaa')]=_0x5e960f;return _0xd668a4;});}})[_0xfcaa('0x1b')](respondWithFilteredResult(_0x1ffdae,_0x6a4ca))[_0xfcaa('0x28')](handleError(_0x1ffdae,null));};exports[_0xfcaa('0xac')]=function(_0x1fec72,_0x584392){var _0x3aee67={'raw':!![],'where':{}};var _0x56c74c={};var _0x4fe08b={'count':0x0,'rows':[]};return db['CmContact'][_0xfcaa('0x83')]({'where':{'id':_0x1fec72[_0xfcaa('0x6d')]['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x584392,null))['then'](function(_0x3bdcc3){if(_0x3bdcc3){_0x56c74c[_0xfcaa('0x84')]=_[_0xfcaa('0x2b')](db[_0xfcaa('0x4f')][_0xfcaa('0x86')]);_0x56c74c[_0xfcaa('0x25')]=_['keys'](_0x1fec72['query']);_0x56c74c['filters']=_['intersection'](_0x56c74c[_0xfcaa('0x84')],_0x56c74c['query']);_0x3aee67['attributes']=_['intersection'](_0x56c74c[_0xfcaa('0x84')],qs[_0xfcaa('0x8a')](_0x1fec72['query'][_0xfcaa('0x8a')]));_0x3aee67[_0xfcaa('0x89')]=_0x3aee67[_0xfcaa('0x89')][_0xfcaa('0x31')]?_0x3aee67['attributes']:_0x56c74c[_0xfcaa('0x84')];if(!_0x1fec72[_0xfcaa('0x25')][_0xfcaa('0x68')]('nolimit')){_0x3aee67['limit']=qs[_0xfcaa('0x16')](_0x1fec72['query'][_0xfcaa('0x16')]);_0x3aee67[_0xfcaa('0x14')]=qs[_0xfcaa('0x14')](_0x1fec72['query'][_0xfcaa('0x14')]);}_0x3aee67['order']=qs['sort'](_0x1fec72[_0xfcaa('0x25')]['sort']);_0x3aee67[_0xfcaa('0x64')]=qs[_0xfcaa('0x87')](_[_0xfcaa('0xa6')](_0x1fec72[_0xfcaa('0x25')],_0x56c74c[_0xfcaa('0x87')]));_0x3aee67['where'][_0xfcaa('0xa7')]=_0x3bdcc3['id'];if(_0x1fec72['query']['filter']){_0x3aee67[_0xfcaa('0x64')]=_[_0xfcaa('0x39')](_0x3aee67[_0xfcaa('0x64')],{'$or':_[_0xfcaa('0x77')](_0x3aee67[_0xfcaa('0x89')],function(_0x2063f7){var _0x50d700={};_0x50d700[_0x2063f7]={'$like':'%'+_0x1fec72['query'][_0xfcaa('0x8c')]+'%'};return _0x50d700;})});}_0x3aee67=_[_0xfcaa('0x39')]({},_0x3aee67,_0x1fec72[_0xfcaa('0x8d')]);return db[_0xfcaa('0x4f')][_0xfcaa('0x17')]({'where':_0x3aee67['where']})['then'](function(_0x193256){_0x4fe08b['count']=_0x193256;if(_0x1fec72['query'][_0xfcaa('0xa8')]){_0x3aee67[_0xfcaa('0xa9')]=[{'all':!![]}];}return db[_0xfcaa('0x4f')]['findAll'](_0x3aee67);})[_0xfcaa('0x1b')](function(_0x4175e6){_0x4fe08b['rows']=_0x4175e6;return _0x4fe08b;});}})[_0xfcaa('0x1b')](respondWithFilteredResult(_0x584392,_0x3aee67))['catch'](handleError(_0x584392,null));};exports[_0xfcaa('0xad')]=function(_0x583428,_0x2dec18){var _0x3f99fb={'raw':!![],'where':{}};var _0x207cff={};var _0x19a971={'count':0x0,'rows':[]};return db['CmContact'][_0xfcaa('0x83')]({'where':{'id':_0x583428['params']['id']}})[_0xfcaa('0x1b')](handleEntityNotFound(_0x2dec18,null))[_0xfcaa('0x1b')](function(_0x3b598a){if(_0x3b598a){_0x207cff[_0xfcaa('0x84')]=_['keys'](db[_0xfcaa('0x57')][_0xfcaa('0x86')]);_0x207cff[_0xfcaa('0x25')]=_[_0xfcaa('0x2b')](_0x583428['query']);_0x207cff[_0xfcaa('0x87')]=_['intersection'](_0x207cff['model'],_0x207cff[_0xfcaa('0x25')]);_0x3f99fb[_0xfcaa('0x89')]=_[_0xfcaa('0x88')](_0x207cff[_0xfcaa('0x84')],qs[_0xfcaa('0x8a')](_0x583428[_0xfcaa('0x25')][_0xfcaa('0x8a')]));_0x3f99fb[_0xfcaa('0x89')]=_0x3f99fb['attributes'][_0xfcaa('0x31')]?_0x3f99fb[_0xfcaa('0x89')]:_0x207cff[_0xfcaa('0x84')];if(!_0x583428[_0xfcaa('0x25')][_0xfcaa('0x68')](_0xfcaa('0xab'))){_0x3f99fb['limit']=qs['limit'](_0x583428[_0xfcaa('0x25')]['limit']);_0x3f99fb[_0xfcaa('0x14')]=qs['offset'](_0x583428[_0xfcaa('0x25')]['offset']);}_0x3f99fb['order']=qs[_0xfcaa('0x8b')](_0x583428[_0xfcaa('0x25')]['sort']);_0x3f99fb[_0xfcaa('0x64')]=qs[_0xfcaa('0x87')](_['pick'](_0x583428[_0xfcaa('0x25')],_0x207cff[_0xfcaa('0x87')]));_0x3f99fb[_0xfcaa('0x64')]['ContactId']=_0x3b598a['id'];if(_0x583428[_0xfcaa('0x25')][_0xfcaa('0x8c')]){_0x3f99fb[_0xfcaa('0x64')]=_[_0xfcaa('0x39')](_0x3f99fb['where'],{'$or':_[_0xfcaa('0x77')](_0x3f99fb[_0xfcaa('0x89')],function(_0x27fb61){var _0x1bffcd={};_0x1bffcd[_0x27fb61]={'$like':'%'+_0x583428[_0xfcaa('0x25')][_0xfcaa('0x8c')]+'%'};return _0x1bffcd;})});}_0x3f99fb=_['merge']({},_0x3f99fb,_0x583428[_0xfcaa('0x8d')]);return db['JscriptySessionReport']['count']({'where':_0x3f99fb['where']})[_0xfcaa('0x1b')](function(_0x1f65fa){_0x19a971[_0xfcaa('0x17')]=_0x1f65fa;if(_0x583428[_0xfcaa('0x25')][_0xfcaa('0xa8')]){_0x3f99fb['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xfcaa('0x24')](_0x3f99fb);})[_0xfcaa('0x1b')](function(_0x12976a){_0x19a971[_0xfcaa('0xaa')]=_0x12976a;return _0x19a971;});}})[_0xfcaa('0x1b')](respondWithFilteredResult(_0x2dec18,_0x3f99fb))[_0xfcaa('0x28')](handleError(_0x2dec18,null));};exports[_0xfcaa('0xae')]=function(_0x12b531,_0x4842e5){try{if(!_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0x65')]){throw new Error('No\x20ListId\x20specified');}if(!_0x12b531[_0xfcaa('0x3a')]['binding_keys']){throw new Error(_0xfcaa('0xaf'));}if(!_0x12b531[_0xfcaa('0x3a')]['binding_values']){throw new Error(_0xfcaa('0xb0'));}if(!_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0xb1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3570dc=_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0xb2')]['split'](',');var _0x18fc66=_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0xb3')][_0xfcaa('0xb4')](',');if(!_0x3570dc[_0xfcaa('0x31')]||!_0x18fc66[_0xfcaa('0x31')]||_0x3570dc[_0xfcaa('0x31')]!==_0x18fc66[_0xfcaa('0x31')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x12b531['body'][_0xfcaa('0x8a')]=_[_0xfcaa('0xb5')](_0x3570dc,_0x18fc66);if(!_0x12b531[_0xfcaa('0x3a')]['fields'][_0xfcaa('0x95')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x12b531[_0xfcaa('0x3a')]['fields'][_0xfcaa('0xb6')]){throw new Error(_0xfcaa('0xb7'));}var _0x3a420e=path[_0xfcaa('0x3f')](config['root'],_0xfcaa('0xb8'),_0x12b531['file'][_0xfcaa('0xb9')]);fs['chmodSync'](_0x3a420e,parseInt(_0xfcaa('0xba'),0x8));var _0x394f8d=require(_0xfcaa('0xbb'))[_0xfcaa('0xbc')](path['join'](__dirname,_0xfcaa('0xbd')),[_0x3a420e,_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0xb2')],_0x12b531[_0xfcaa('0x3a')][_0xfcaa('0xb3')],_0x12b531[_0xfcaa('0x3a')]['ListId'],_0x12b531[_0xfcaa('0x3a')]['CompanyId'],_0x12b531['body'][_0xfcaa('0x62')],_0x12b531['body'][_0xfcaa('0xb1')]]);return _0x4842e5[_0xfcaa('0x12')](0xc8)[_0xfcaa('0x13')]({'message':_0xfcaa('0xbe'),'pid':_0x394f8d[_0xfcaa('0xbf')]});}catch(_0x3b8621){return _0x4842e5[_0xfcaa('0x12')](0x1f4)[_0xfcaa('0xc0')](_0x3b8621);}};exports['upload']=function(_0x3ea31c,_0x4a9a43){var _0x417618=fs[_0xfcaa('0xc1')](_0x3ea31c[_0xfcaa('0xc2')]['path']);Papa[_0xfcaa('0xc3')](_0x417618,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x300355){return _0x4a9a43['status'](0xc8)[_0xfcaa('0x13')]({'file':_0x3ea31c[_0xfcaa('0xc2')],'fields':_0x300355[_0xfcaa('0xc4')][_0xfcaa('0x8a')]});}});};exports[_0xfcaa('0xc5')]=function(_0x4d36fd,_0xec1eea){return db[_0xfcaa('0xc6')][_0xfcaa('0x24')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfcaa('0xc7')}})[_0xfcaa('0x1b')](function(_0x21bd65){var _0x2349e3=![];if(!_0x4d36fd[_0xfcaa('0x3a')]['ListId']){throw new Error(_0xfcaa('0xc8'));}if(!_0x4d36fd['body'][_0xfcaa('0xc9')][_0xfcaa('0x95')]){throw new Error(_0xfcaa('0xca'));}if(!_0x4d36fd[_0xfcaa('0x3a')][_0xfcaa('0xc9')]['firstName']){throw new Error(_0xfcaa('0xb7'));}if(!_0x4d36fd[_0xfcaa('0x3a')][_0xfcaa('0xb1')]){throw new Error(_0xfcaa('0xcb'));}var _0xfb5a78=require('child_process')['fork'](path[_0xfcaa('0x3f')](__dirname,_0xfcaa('0xcc')),[_0x4d36fd['params']['id'],JSON[_0xfcaa('0xcd')](_0x4d36fd[_0xfcaa('0x3a')]),JSON[_0xfcaa('0xcd')](_0x21bd65)]);_0xfb5a78['on'](_0xfcaa('0xce'),function(){_0x2349e3=!![];return _0xec1eea[_0xfcaa('0x12')](0xc8)[_0xfcaa('0x13')]({'message':_0xfcaa('0xcf'),'pid':_0xfb5a78['pid']});});_0xfb5a78['on'](_0xfcaa('0xd0'),function(_0x3f248a){if(_0x3f248a&&!_0x2349e3){return _0xec1eea[_0xfcaa('0x12')](0x1f4)[_0xfcaa('0x13')]({'message':_0xfcaa('0xd1'),'pid':_0xfb5a78[_0xfcaa('0xbf')]});}});})[_0xfcaa('0x28')](handleError(_0xec1eea,null));};exports[_0xfcaa('0xd2')]=function(_0x37becd,_0x4c5acc){return db['User'][_0xfcaa('0x24')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfcaa('0xc7')}})[_0xfcaa('0x1b')](function(_0x1ec2f3){var _0x1276e8=![];if(!_0x37becd['body'][_0xfcaa('0x65')]){throw new Error(_0xfcaa('0xc8'));}if(!_0x37becd[_0xfcaa('0x3a')][_0xfcaa('0xc9')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x37becd[_0xfcaa('0x3a')][_0xfcaa('0xc9')][_0xfcaa('0xb6')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x37becd['body']['socket_timestamp']){throw new Error(_0xfcaa('0xcb'));}var _0x16ef47=require('child_process')[_0xfcaa('0xbc')](path['join'](__dirname,_0xfcaa('0xd3')),[_0x37becd['params']['id'],JSON[_0xfcaa('0xcd')](_0x37becd[_0xfcaa('0x3a')]),JSON[_0xfcaa('0xcd')](_0x1ec2f3)]);_0x16ef47['on']('message',function(){_0x1276e8=!![];return _0x4c5acc['status'](0xc8)[_0xfcaa('0x13')]({'message':_0xfcaa('0xcf'),'pid':_0x16ef47[_0xfcaa('0xbf')]});});_0x16ef47['on'](_0xfcaa('0xd0'),function(_0x19d2e0){if(_0x19d2e0&&!_0x1276e8){return _0x4c5acc[_0xfcaa('0x12')](0x1f4)[_0xfcaa('0x13')]({'message':_0xfcaa('0xd1'),'pid':_0x16ef47[_0xfcaa('0xbf')]});}});})[_0xfcaa('0x28')](handleError(_0x4c5acc,null));};exports[_0xfcaa('0xd4')]=function(_0x5032f8,_0x70a5e0){var _0x3872d8=[_0xfcaa('0xd5'),_0xfcaa('0xd6'),'sms','openchannel',_0xfcaa('0xd7'),_0xfcaa('0xd8'),_0xfcaa('0xd9')];var _0x1bf4e1={'offset':0x0,'order':qs[_0xfcaa('0x8b')]('-createdAt')},_0x8c9431={'count':0x0,'rows':[]};Promise[_0xfcaa('0xda')]()[_0xfcaa('0x1b')](function(){if(_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0xdb')]){if(!_['includes'](_0x3872d8,_0x5032f8['query'][_0xfcaa('0xdb')][_0xfcaa('0xdc')]())){throw new Error(_0xfcaa('0xdd'));}_0x3872d8=[_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0xdb')][_0xfcaa('0xdc')]()];}if(_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0xde')]){try{var _0x25604e=JSON['parse'](_0x5032f8[_0xfcaa('0x25')]['range']);if(!moment(_0x25604e[_0xfcaa('0x3b')])[_0xfcaa('0xdf')]()){throw new Error(_0xfcaa('0xe0'));}if(!moment(_0x25604e['to'])[_0xfcaa('0xdf')]()){throw new Error(_0xfcaa('0xe1'));}}catch(_0x3ed517){throw new Error(_0xfcaa('0xe2'));}}if(!_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0x68')](_0xfcaa('0xab'))){_0x1bf4e1[_0xfcaa('0x16')]=qs[_0xfcaa('0x16')](_0x5032f8['query'][_0xfcaa('0x16')]||0xa);_0x1bf4e1[_0xfcaa('0x14')]=qs[_0xfcaa('0x14')](_0x5032f8['query'][_0xfcaa('0x14')]);}var _0x1469db=_0x3872d8['map'](function(_0x3962d3){if(_0x3962d3===_0xfcaa('0xd9')){var _0x546cbb={'attributes':['id',_0xfcaa('0xe3'),_0xfcaa('0xe4'),_0xfcaa('0xe5'),_0xfcaa('0xe6'),'callerid','starttime',_0xfcaa('0xe7'),_0xfcaa('0xe8'),'note',_0xfcaa('0xe9'),_0xfcaa('0xea'),_0xfcaa('0xeb'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x5032f8['params']['id']},'include':[{'model':db[_0xfcaa('0xc6')],'as':_0xfcaa('0xc6'),'attributes':['id','name',_0xfcaa('0xec'),_0xfcaa('0x33')]}],'order':[[_0xfcaa('0xe9'),_0xfcaa('0xed')]]};if(_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0xde')]){_0x546cbb[_0xfcaa('0x64')][_0xfcaa('0xe9')]={'$gte':_0x25604e['from'],'$lte':_0x25604e['to']};}return db[_0xfcaa('0xee')][_0xfcaa('0xef')](_0x546cbb)[_0xfcaa('0x1b')](function(_0x80f604){_0x8c9431[_0xfcaa('0x17')]+=_0x80f604[_0xfcaa('0x17')];return _['map'](_0x80f604[_0xfcaa('0xaa')],function(_0x117e68){var _0x1e6e8c=_0x117e68['get']({'plain':!![]});_0x1e6e8c[_0xfcaa('0xdb')]=_0x3962d3;if(_0x1e6e8c[_0xfcaa('0xc6')]){_0x1e6e8c[_0xfcaa('0xc6')]={'id':_0x1e6e8c[_0xfcaa('0xc6')]['id'],'name':_0x1e6e8c['User'][_0xfcaa('0x21')],'fullname':_0x1e6e8c[_0xfcaa('0xc6')][_0xfcaa('0xec')],'alias':_0x1e6e8c[_0xfcaa('0xc6')][_0xfcaa('0x33')]};}return _0x1e6e8c;});});}else{var _0x4cc126=_[_0xfcaa('0xf0')](_0x3962d3)+(_0x3962d3===_0xfcaa('0xd6')?_0xfcaa('0xf1'):_0xfcaa('0xf2'));var _0x3ed0f4={'attributes':['id',_0xfcaa('0xf3'),_0xfcaa('0xf4'),_0xfcaa('0xe9'),_0xfcaa('0xf5'),_0xfcaa('0xf6'),_0xfcaa('0xf7'),_0xfcaa('0xf8'),_0xfcaa('0xf9'),_0x4cc126+'Id'],'where':{'ContactId':_0x5032f8[_0xfcaa('0x6d')]['id']},'include':[{'model':db[_0x4cc126],'as':_0xfcaa('0xf2'),'attributes':['id',_0xfcaa('0x21'),_0xfcaa('0xfa')]},{'model':db[_0xfcaa('0xc6')],'as':_0xfcaa('0xfb'),'attributes':['id',_0xfcaa('0x21'),_0xfcaa('0xec')]},{'model':db['Tag'],'as':_0xfcaa('0x6e'),'attributes':['id',_0xfcaa('0x21'),'color'],'through':{'attributes':[]}}],'order':[['createdAt',_0xfcaa('0xed')]]};if(_0x5032f8[_0xfcaa('0x25')][_0xfcaa('0xde')]){_0x3ed0f4['where'][_0xfcaa('0xe9')]={'$gte':_0x25604e[_0xfcaa('0x3b')],'$lte':_0x25604e['to']};}switch(_0x3962d3){case _0xfcaa('0xd6'):_0x3ed0f4['attributes'][_0xfcaa('0x69')](_0xfcaa('0xfc'),'customerIp',_0xfcaa('0xfd'),'deviceModel','osName',_0xfcaa('0xfe'),'ratingType',_0xfcaa('0xff'),_0xfcaa('0x100'));break;case _0xfcaa('0xd5'):_0x3ed0f4['attributes']['push'](_0xfcaa('0x101'),'substatus');break;case _0xfcaa('0x102'):_0x3ed0f4['attributes'][_0xfcaa('0x69')]('externalUrl','threadId');break;}return db[_[_0xfcaa('0xf0')](_0x3962d3)+'Interaction'][_0xfcaa('0xef')](_0x3ed0f4)['then'](function(_0x1741a5){_0x8c9431[_0xfcaa('0x17')]+=_0x1741a5[_0xfcaa('0x17')];return _[_0xfcaa('0x77')](_0x1741a5[_0xfcaa('0xaa')],function(_0x1a0e1c){var _0x3a7e5a=_0x1a0e1c['get']({'plain':!![]});_0x3a7e5a[_0xfcaa('0xdb')]=_0x3962d3;if(_0x3a7e5a['Owner']){_0x3a7e5a[_0xfcaa('0xfb')]={'id':_0x3a7e5a[_0xfcaa('0xfb')]['id'],'name':_0x3a7e5a['Owner'][_0xfcaa('0x21')],'fullname':_0x3a7e5a['Owner'][_0xfcaa('0xec')]};}return _0x3a7e5a;});});}});return Promise['all'](_0x1469db);})[_0xfcaa('0x1b')](function(_0xf99837){return _(_0xf99837)['flatten']()[_0xfcaa('0x103')]('createdAt')[_0xfcaa('0x104')]()[_0xfcaa('0x105')]();})[_0xfcaa('0x1b')](function(_0x2dd35d){_0x8c9431[_0xfcaa('0xaa')]=_0x1bf4e1['limit']?_0x2dd35d[_0xfcaa('0x106')](_0x1bf4e1[_0xfcaa('0x14')],_0x1bf4e1[_0xfcaa('0x14')]+_0x1bf4e1['limit']):_0x2dd35d;return _0x8c9431;})['then'](respondWithFilteredResult(_0x70a5e0,_0x1bf4e1))[_0xfcaa('0x28')](handleError(_0x70a5e0,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 764f43c..3d5bb9b 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b74=['hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x9b74,0x1ec));var _0x49b7=function(_0x184646,_0x3358d5){_0x184646=_0x184646-0x0;var _0x5b7134=_0x9b74[_0x184646];return _0x5b7134;};'use strict';var EventEmitter=require(_0x49b7('0x0'));var CmContact=require(_0x49b7('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x49b7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x49b7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1a75c5){return function(_0x46c876,_0x23eaef,_0x5990d7){CmContactEvents[_0x49b7('0x4')](_0x1a75c5+':'+_0x46c876['id'],_0x46c876);CmContactEvents[_0x49b7('0x4')](_0x1a75c5,_0x46c876);_0x5990d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x49b7('0x5')](e,emitEvent(event));}}module[_0x49b7('0x6')]=CmContactEvents; \ No newline at end of file +var _0x4123=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4123,0x142));var _0x3412=function(_0x50b651,_0x2ce0c5){_0x50b651=_0x50b651-0x0;var _0x1ec2b0=_0x4123[_0x50b651];return _0x1ec2b0;};'use strict';var EventEmitter=require(_0x3412('0x0'));var CmContact=require(_0x3412('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3412('0x2')](0x0);var events={'afterCreate':_0x3412('0x3'),'afterUpdate':_0x3412('0x4'),'afterDestroy':_0x3412('0x5')};function emitEvent(_0x5c7766){return function(_0xb8e5f9,_0x3cdc43,_0x3b3201){CmContactEvents[_0x3412('0x6')](_0x5c7766+':'+_0xb8e5f9['id'],_0xb8e5f9);CmContactEvents[_0x3412('0x6')](_0x5c7766,_0xb8e5f9);_0x3b3201(null);};}for(var e in events){if(events[_0x3412('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x3412('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 2e54f1e..5ff56a1 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b12=['scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','then','timezones','dialTimezone','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','cmContact','Campaign','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','CmList','length','get','dialCheckDuplicateType','always','onlyIfOpen','findAll','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','Lists','message','List\x20not\x20found','CampaignId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','afterCreate','inspect'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x1b12,0x103));var _0x21b1=function(_0x57e712,_0x72dd0a){_0x57e712=_0x57e712-0x0;var _0x5262a3=_0x1b12[_0x57e712];return _0x5262a3;};'use strict';var _=require(_0x21b1('0x0'));var util=require(_0x21b1('0x1'));var logger=require(_0x21b1('0x2'))(_0x21b1('0x3'));var moment=require('moment');var BPromise=require(_0x21b1('0x4'));var rp=require(_0x21b1('0x5'));var fs=require('fs');var path=require(_0x21b1('0x6'));var rimraf=require(_0x21b1('0x7'));var config=require(_0x21b1('0x8'));var shared=require(_0x21b1('0x9'));var attributes=require(_0x21b1('0xa'));module[_0x21b1('0xb')]=function(_0x1e6a84,_0x64ba99){return _0x1e6a84[_0x21b1('0xc')]('CmContact',attributes,{'tableName':_0x21b1('0xd'),'paranoid':!![],'indexes':[{'name':_0x21b1('0xe'),'fields':[_0x21b1('0xe')]},{'name':_0x21b1('0xf'),'fields':[_0x21b1('0x10'),'lastName',_0x21b1('0xe'),'mobile',_0x21b1('0x11'),'email'],'type':_0x21b1('0x12')}],'timestamps':!![],'charset':_0x21b1('0x13'),'collate':_0x21b1('0x14'),'hooks':{'afterCreate':function(_0x444260,_0x82dd6c,_0x503ae2){var _0x33f7de=_0x1e6a84[_0x21b1('0x15')];var _0x425a09=_0x444260['get']({'plain':!![]});function _0x24ff95(){return function(_0x38cddb){logger[_0x21b1('0x16')]('cmContact',_0x21b1('0x17'),util[_0x21b1('0x18')](_0x38cddb,{'showHidden':![],'depth':null}));};}function _0x530811(_0x288486,_0x3fafbe){var _0x5c7aa9=_0x3fafbe[_0x21b1('0x19')]?_0x3fafbe[_0x21b1('0x19')]:moment()[_0x21b1('0x1a')](_0x21b1('0x1b'));return new BPromise(function(_0x4d8491,_0x555e2f){if(_[_0x21b1('0x1c')](_0x3fafbe['dialTimezone'])){_0x4d8491({'ret':_0x5c7aa9});}else{_0x33f7de[_0x21b1('0x1d')][_0x21b1('0x1e')]({'where':{'id':_0x288486['id']}})[_0x21b1('0x1f')](function(_0x35aee3){if(!_['isNil'](_0x35aee3)){var _0x373369=_0x35aee3['dialTimezone'];if(!_[_0x21b1('0x1c')](_0x373369)){var _0x2c1068=shared[_0x21b1('0x20')];var _0x49e281=_0x2c1068[_0x373369];var _0x2dd58c=_0x2c1068[_0x3fafbe[_0x21b1('0x21')]];if(!_[_0x21b1('0x1c')](_0x49e281)&&!_[_0x21b1('0x1c')](_0x2dd58c)){var _0x5d2bde=_0x49e281['utcOffset']-_0x2dd58c['utcOffset'];_0x5c7aa9=_0x3fafbe[_0x21b1('0x19')]?_0x3fafbe[_0x21b1('0x19')]:moment();var _0xb21c7d=moment(_0x5c7aa9)[_0x21b1('0x22')](_0x5d2bde,_0x21b1('0x23'));_0x4d8491({'ret':_0xb21c7d[_0x21b1('0x1a')](_0x21b1('0x1b'))});}else _0x4d8491({'ret':_0x5c7aa9});}else _0x4d8491({'ret':_0x5c7aa9});}else{_0x4d8491({'ret':_0x5c7aa9});}});}});return 0xa;}var _0x580956=function(_0x5a1740){return new BPromise(function(_0x53374a,_0xb5a45c){_0x530811(_0x5a1740,_0x425a09)['then'](function(_0x587cbb){_0x425a09[_0x21b1('0x19')]=_0x587cbb[_0x21b1('0x24')];_0x33f7de[_0x21b1('0x25')][_0x21b1('0x1e')]({'where':{'phone':_0x425a09[_0x21b1('0xe')],'VoiceQueueId':_0x5a1740['id']}})[_0x21b1('0x1f')](function(_0x147e99){if(!_[_0x21b1('0x1c')](_0x147e99)){throw new Error(_0x21b1('0x26')+_0x425a09['phone']+_0x21b1('0x27')+_0x5a1740['id']);}return _0x33f7de[_0x21b1('0x25')]['create']({'phone':_0x425a09['phone'],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'priority':_0x425a09[_0x21b1('0x29')]?_0x425a09[_0x21b1('0x29')]:0x2,'scheduledat':_0x425a09[_0x21b1('0x19')]?_0x425a09[_0x21b1('0x19')]:moment()[_0x21b1('0x1a')](_0x21b1('0x1b')),'callback':_0x425a09[_0x21b1('0x2a')]?!![]:![],'callbackuniqueid':_0x425a09[_0x21b1('0x2a')]?_0x425a09[_0x21b1('0x2a')]:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')](_0x21b1('0x1b')):undefined,'VoiceQueueId':_0x5a1740['id']});})[_0x21b1('0x2b')](function(_0x4b62cf){_0xb5a45c(_0x4b62cf);});});});};var _0x29baa8=function(_0x21e83f){return new BPromise(function(_0x1de6de,_0x4fe17b){_0x530811(_0x21e83f,_0x425a09)[_0x21b1('0x1f')](function(_0x299ed4){_0x425a09[_0x21b1('0x19')]=_0x299ed4[_0x21b1('0x24')];_0x33f7de['CmHopper']['findOne']({'where':{'phone':_0x425a09[_0x21b1('0xe')],'VoiceQueueId':_0x21e83f['id']}})[_0x21b1('0x1f')](function(_0x530e58){if(!_[_0x21b1('0x1c')](_0x530e58)){throw new Error(_0x21b1('0x26')+_0x425a09[_0x21b1('0xe')]+_0x21b1('0x2c')+_0x21e83f['id']);}return _0x33f7de['CmHopperFinal'][_0x21b1('0x1e')]({'where':{'calleridnum':_0x425a09['phone'],'VoiceQueueId':_0x21e83f['id']}});})[_0x21b1('0x1f')](function(_0x49c494){if(!_[_0x21b1('0x1c')](_0x49c494)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x425a09[_0x21b1('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x21e83f['id']);}return _0x33f7de[_0x21b1('0x25')][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'priority':_0x425a09[_0x21b1('0x29')]?_0x425a09[_0x21b1('0x29')]:0x2,'scheduledat':_0x425a09[_0x21b1('0x19')]?_0x425a09['scheduledat']:moment()[_0x21b1('0x1a')](_0x21b1('0x1b')),'callback':_0x425a09[_0x21b1('0x2a')]?!![]:![],'callbackuniqueid':_0x425a09['callbackUniqueid']?_0x425a09[_0x21b1('0x2a')]:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')](_0x21b1('0x1b')):undefined,'VoiceQueueId':_0x21e83f['id']});})[_0x21b1('0x2b')](function(_0x37c105){_0x4fe17b(_0x37c105);});});});};function _0x18fc0b(){return function(_0x55900e){logger[_0x21b1('0x16')](_0x21b1('0x2e'),'afterCreate',util['inspect'](_0x55900e,{'showHidden':![],'depth':null}));};}function _0x1326c1(_0x4469b2,_0x50c556){var _0x341903=_0x50c556[_0x21b1('0x19')]?_0x50c556[_0x21b1('0x19')]:moment()[_0x21b1('0x1a')](_0x21b1('0x1b'));return new BPromise(function(_0x57d5da,_0x20dd3f){if(_['isNil'](_0x50c556['dialTimezone'])){_0x57d5da({'ret':_0x341903});}else{_0x33f7de[_0x21b1('0x2f')][_0x21b1('0x1e')]({'where':{'id':_0x4469b2['id']}})[_0x21b1('0x1f')](function(_0x29dc98){if(!_[_0x21b1('0x1c')](_0x29dc98)){var _0x479921=_0x29dc98[_0x21b1('0x21')];if(!_[_0x21b1('0x1c')](_0x479921)){var _0x66f733=shared[_0x21b1('0x20')];var _0x3ab8fe=_0x66f733[_0x479921];var _0x1b5590=_0x66f733[_0x50c556[_0x21b1('0x21')]];if(!_['isNil'](_0x3ab8fe)&&!_[_0x21b1('0x1c')](_0x1b5590)){var _0xe4818f=_0x3ab8fe['utcOffset']-_0x1b5590[_0x21b1('0x30')];_0x341903=_0x50c556[_0x21b1('0x19')]?_0x50c556[_0x21b1('0x19')]:moment();var _0x2ac2ce=moment(_0x341903)[_0x21b1('0x22')](_0xe4818f,_0x21b1('0x23'));_0x57d5da({'ret':_0x2ac2ce[_0x21b1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x57d5da({'ret':_0x341903});}else _0x57d5da({'ret':_0x341903});}else{_0x57d5da({'ret':_0x341903});}});}});return 0xa;}var _0x5b1f5d=function(_0x212d46){return new BPromise(function(_0x52415b,_0x4df70a){_0x1326c1(_0x212d46,_0x425a09)['then'](function(_0x1c5ad9){_0x425a09[_0x21b1('0x19')]=_0x1c5ad9[_0x21b1('0x24')];_0x33f7de[_0x21b1('0x25')][_0x21b1('0x1e')]({'where':{'phone':_0x425a09['phone'],'CampaignId':_0x212d46['id']}})[_0x21b1('0x1f')](function(_0x1988cc){if(!_['isNil'](_0x1988cc)){throw new Error(_0x21b1('0x26')+_0x425a09[_0x21b1('0xe')]+_0x21b1('0x31')+_0x212d46['id']);}return _0x33f7de[_0x21b1('0x25')][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09['ListId'],'priority':_0x425a09['priority']?_0x425a09[_0x21b1('0x29')]:0x2,'scheduledat':_0x425a09['scheduledat']?_0x425a09[_0x21b1('0x19')]:moment()[_0x21b1('0x1a')](_0x21b1('0x1b')),'callback':_0x425a09['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x425a09['callbackUniqueid']?_0x425a09[_0x21b1('0x2a')]:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x212d46['id']});})['catch'](function(_0x160381){_0x4df70a(_0x160381);});});});};var _0x4f3ff8=function(_0x3f9128){return new BPromise(function(_0x2a7a24,_0x587d9d){_0x1326c1(_0x3f9128,_0x425a09)['then'](function(_0xec72e6){_0x425a09[_0x21b1('0x19')]=_0xec72e6['ret'];_0x33f7de[_0x21b1('0x25')]['findOne']({'where':{'phone':_0x425a09[_0x21b1('0xe')],'CampaignId':_0x3f9128['id']}})[_0x21b1('0x1f')](function(_0x1e4cc1){if(!_[_0x21b1('0x1c')](_0x1e4cc1)){throw new Error('cmContact,\x20afterCreate\x20'+_0x425a09['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3f9128['id']);}return _0x33f7de[_0x21b1('0x32')][_0x21b1('0x1e')]({'where':{'calleridnum':_0x425a09[_0x21b1('0xe')],'CampaignId':_0x3f9128['id']}});})[_0x21b1('0x1f')](function(_0xe36f7a){if(!_['isNil'](_0xe36f7a)){throw new Error(_0x21b1('0x33')+_0x425a09[_0x21b1('0xe')]+_0x21b1('0x34')+_0x3f9128['id']);}return _0x33f7de['CmHopper'][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'priority':_0x425a09[_0x21b1('0x29')]?_0x425a09[_0x21b1('0x29')]:0x2,'scheduledat':_0x425a09[_0x21b1('0x19')]?_0x425a09['scheduledat']:moment()[_0x21b1('0x1a')](_0x21b1('0x1b')),'callback':_0x425a09[_0x21b1('0x2a')]?!![]:![],'callbackuniqueid':_0x425a09[_0x21b1('0x2a')]?_0x425a09['callbackUniqueid']:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')](_0x21b1('0x1b')):undefined,'CampaignId':_0x3f9128['id']});})['catch'](function(_0x3e2177){_0x587d9d(_0x3e2177);});});});};if(_0x425a09[_0x21b1('0x28')]){_0x33f7de['VoiceQueue']['findAll']({'where':{'type':_0x21b1('0x35')},'attributes':['id','dialCheckDuplicateType',_0x21b1('0x21')],'include':[{'model':_0x33f7de[_0x21b1('0x36')],'as':'Lists','where':{'id':_0x425a09[_0x21b1('0x28')]}}]})[_0x21b1('0x1f')](function(_0x34068a){if(_0x34068a){var _0x5cc0ee=[];for(var _0x37cbd0=0x0,_0x1240ce;_0x37cbd0<_0x34068a[_0x21b1('0x37')];_0x37cbd0+=0x1){_0x1240ce=_0x34068a[_0x37cbd0][_0x21b1('0x38')]({'plain':!![]});switch(_0x1240ce[_0x21b1('0x39')]){case _0x21b1('0x3a'):_0x29baa8(_0x1240ce)[_0x21b1('0x2b')](_0x24ff95());break;case _0x21b1('0x3b'):_0x580956(_0x1240ce)[_0x21b1('0x2b')](_0x24ff95());break;default:_0x1326c1(_0x1240ce,_0x425a09)['then'](function(_0x3ecad7){_0x425a09[_0x21b1('0x19')]=_0x3ecad7[_0x21b1('0x24')];_0x33f7de[_0x21b1('0x25')][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'scheduledat':_0x425a09[_0x21b1('0x19')]?_0x425a09[_0x21b1('0x19')]:moment()[_0x21b1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x425a09['priority']?_0x425a09[_0x21b1('0x29')]:0x2,'callback':_0x425a09[_0x21b1('0x2a')]?!![]:![],'callbackuniqueid':_0x425a09[_0x21b1('0x2a')]?_0x425a09[_0x21b1('0x2a')]:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')](_0x21b1('0x1b')):undefined,'VoiceQueueId':_0x1240ce['id']})['catch'](_0x24ff95());});}}}})[_0x21b1('0x1f')](function(){return _0x33f7de[_0x21b1('0x1d')][_0x21b1('0x3c')]({'where':{'type':_0x21b1('0x35')},'attributes':['id'],'include':[{'model':_0x33f7de['CmList'],'as':_0x21b1('0x3d'),'where':{'id':_0x425a09[_0x21b1('0x28')]}}]})[_0x21b1('0x1f')](function(_0x2c65ef){if(_0x2c65ef){var _0x5c28bc=[];for(var _0x467b21=0x0,_0x4db297;_0x467b21<_0x2c65ef[_0x21b1('0x37')];_0x467b21+=0x1){_0x4db297=_0x2c65ef[_0x467b21][_0x21b1('0x38')]({'plain':!![]});_0x33f7de[_0x21b1('0x3e')][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'VoiceQueueId':_0x4db297['id']})[_0x21b1('0x2b')](function(_0x35247a){logger[_0x21b1('0x16')](_0x21b1('0x3f'),'afterCreate',_0x35247a['message']);});}}});})[_0x21b1('0x1f')](function(){return _0x33f7de[_0x21b1('0x2f')]['findAll']({'attributes':['id',_0x21b1('0x39'),_0x21b1('0x21')],'include':[{'model':_0x33f7de['CmList'],'as':_0x21b1('0x40'),'where':{'id':_0x425a09[_0x21b1('0x28')]}}]})[_0x21b1('0x1f')](function(_0x52ad06){if(_0x52ad06){var _0x492a2d=[];for(var _0x44f824=0x0,_0x309465;_0x44f824<_0x52ad06[_0x21b1('0x37')];_0x44f824+=0x1){_0x309465=_0x52ad06[_0x44f824][_0x21b1('0x38')]({'plain':!![]});switch(_0x309465['dialCheckDuplicateType']){case _0x21b1('0x3a'):_0x4f3ff8(_0x309465)['catch'](_0x18fc0b());break;case _0x21b1('0x3b'):_0x5b1f5d(_0x309465)[_0x21b1('0x2b')](_0x18fc0b());break;default:_0x33f7de[_0x21b1('0x25')][_0x21b1('0x2d')]({'phone':_0x425a09[_0x21b1('0xe')],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'scheduledat':_0x425a09[_0x21b1('0x19')]?_0x425a09[_0x21b1('0x19')]:moment()['format'](_0x21b1('0x1b')),'priority':_0x425a09['priority']?_0x425a09[_0x21b1('0x29')]:0x2,'callback':_0x425a09['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x425a09[_0x21b1('0x2a')]?_0x425a09[_0x21b1('0x2a')]:undefined,'callbackat':_0x425a09[_0x21b1('0x2a')]?moment()[_0x21b1('0x1a')](_0x21b1('0x1b')):undefined,'CampaignId':_0x309465['id']})['catch'](_0x18fc0b());}}}});})[_0x21b1('0x1f')](function(){return _0x33f7de['Campaign'][_0x21b1('0x3c')]({'attributes':['id'],'include':[{'model':_0x33f7de[_0x21b1('0x36')],'as':_0x21b1('0x3d'),'where':{'id':_0x425a09[_0x21b1('0x28')]}}]})['then'](function(_0x2263fa){if(_0x2263fa){var _0x1ce004=[];for(var _0x40152a=0x0,_0x58cb04;_0x40152a<_0x2263fa[_0x21b1('0x37')];_0x40152a+=0x1){_0x58cb04=_0x2263fa[_0x40152a][_0x21b1('0x38')]({'plain':!![]});_0x33f7de[_0x21b1('0x3e')][_0x21b1('0x2d')]({'phone':_0x425a09['phone'],'ContactId':_0x425a09['id'],'ListId':_0x425a09[_0x21b1('0x28')],'CampaignId':_0x58cb04['id']})[_0x21b1('0x2b')](function(_0x49eb66){logger[_0x21b1('0x16')](_0x21b1('0x3f'),_0x21b1('0x17'),_0x49eb66[_0x21b1('0x41')]);});}}});})['then'](function(){_0x503ae2();})[_0x21b1('0x2b')](function(_0x1f5273){logger['error'](_0x21b1('0x3f'),_0x21b1('0x17'),_0x1f5273[_0x21b1('0x41')]);_0x503ae2(_0x1f5273);});}else{_0x503ae2(new Error(_0x21b1('0x42')));}},'afterDestroy':function(_0x3fe8b6,_0x22d2bf,_0x493339){var _0x9505d0=_0x1e6a84[_0x21b1('0x15')];var _0x488c6b=_0x3fe8b6['get']({'plain':!![]});return _0x9505d0[_0x21b1('0x25')][_0x21b1('0x3c')]({'raw':!![],'where':{'ListId':_0x488c6b[_0x21b1('0x28')],'ContactId':_0x488c6b['id']}})['then'](function(_0x4666b7){if(!_['isEmpty'](_0x4666b7)){var _0x47d296=[];for(var _0x1b06e0=0x0;_0x1b06e0<_0x4666b7[_0x21b1('0x37')];_0x1b06e0+=0x1){var _0x318c35=_0x9505d0[_0x21b1('0x25')]['destroy']({'where':{'ListId':_0x4666b7[_0x1b06e0][_0x21b1('0x28')],'ContactId':_0x4666b7[_0x1b06e0]['ContactId'],'VoiceQueueId':_0x4666b7[_0x1b06e0]['VoiceQueueId'],'CampaignId':_0x4666b7[_0x1b06e0][_0x21b1('0x43')]}});_0x47d296['push'](_0x318c35);}return BPromise['all'](_0x47d296);}})[_0x21b1('0x1f')](function(_0xcbc64f){logger[_0x21b1('0x44')](_0x21b1('0x45'),util[_0x21b1('0x18')](_0xcbc64f,{'showHidden':![],'depth':null}));_0x493339();})[_0x21b1('0x2b')](function(_0x84c7ce){logger['error'](_0x21b1('0x46'),util[_0x21b1('0x18')](_0x84c7ce,{'showHidden':![],'depth':null}));_0x493339(_0x84c7ce);});}}});}; \ No newline at end of file +var _0x21d7=['afterCreate','inspect','scheduledat','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','format','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','get','always','onlyIfOpen','CmHopperBlack','CmList','BlackLists','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','fax','FULLTEXT','utf8mb4_unicode_ci','models','error'];(function(_0x28dbf4,_0x57cd92){var _0x389ac1=function(_0x28ad1d){while(--_0x28ad1d){_0x28dbf4['push'](_0x28dbf4['shift']());}};_0x389ac1(++_0x57cd92);}(_0x21d7,0x1ac));var _0x721d=function(_0x4dc035,_0x3f320d){_0x4dc035=_0x4dc035-0x0;var _0x459127=_0x21d7[_0x4dc035];return _0x459127;};'use strict';var _=require(_0x721d('0x0'));var util=require(_0x721d('0x1'));var logger=require(_0x721d('0x2'))(_0x721d('0x3'));var moment=require(_0x721d('0x4'));var BPromise=require(_0x721d('0x5'));var rp=require(_0x721d('0x6'));var fs=require('fs');var path=require(_0x721d('0x7'));var rimraf=require('rimraf');var config=require(_0x721d('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x721d('0x9'));module[_0x721d('0xa')]=function(_0x3e7309,_0x4c7d94){return _0x3e7309[_0x721d('0xb')](_0x721d('0xc'),attributes,{'tableName':_0x721d('0xd'),'paranoid':!![],'indexes':[{'name':_0x721d('0xe'),'fields':[_0x721d('0xe')]},{'name':_0x721d('0xf'),'fields':[_0x721d('0x10'),'lastName','phone','mobile',_0x721d('0x11'),'email'],'type':_0x721d('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x721d('0x13'),'hooks':{'afterCreate':function(_0x3ec9f2,_0x25567c,_0x13da3c){var _0x2d3d7b=_0x3e7309[_0x721d('0x14')];var _0x1fbfc2=_0x3ec9f2['get']({'plain':!![]});function _0x2da0a8(){return function(_0x21dbfe){logger[_0x721d('0x15')]('cmContact',_0x721d('0x16'),util[_0x721d('0x17')](_0x21dbfe,{'showHidden':![],'depth':null}));};}function _0x4e87df(_0x12548c,_0x126bbe){var _0x350386=_0x126bbe[_0x721d('0x18')]?_0x126bbe[_0x721d('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1a2898,_0x386584){if(_[_0x721d('0x19')](_0x126bbe['dialTimezone'])){_0x1a2898({'ret':_0x350386});}else{_0x2d3d7b[_0x721d('0x1a')][_0x721d('0x1b')]({'where':{'id':_0x12548c['id']}})[_0x721d('0x1c')](function(_0x48bc80){if(!_[_0x721d('0x19')](_0x48bc80)){var _0x202efa=_0x48bc80[_0x721d('0x1d')];if(!_['isNil'](_0x202efa)){var _0x32a6a9=shared[_0x721d('0x1e')];var _0x8cb3ac=_0x32a6a9[_0x202efa];var _0x2d09c7=_0x32a6a9[_0x126bbe[_0x721d('0x1d')]];if(!_[_0x721d('0x19')](_0x8cb3ac)&&!_[_0x721d('0x19')](_0x2d09c7)){var _0x5f099a=_0x8cb3ac[_0x721d('0x1f')]-_0x2d09c7[_0x721d('0x1f')];_0x350386=_0x126bbe[_0x721d('0x18')]?_0x126bbe['scheduledat']:moment();var _0x228ef0=moment(_0x350386)[_0x721d('0x20')](_0x5f099a,'minutes');_0x1a2898({'ret':_0x228ef0[_0x721d('0x21')](_0x721d('0x22'))});}else _0x1a2898({'ret':_0x350386});}else _0x1a2898({'ret':_0x350386});}else{_0x1a2898({'ret':_0x350386});}});}});return 0xa;}var _0xcd058=function(_0x3bd0bf){return new BPromise(function(_0x2b93ee,_0x536c31){_0x4e87df(_0x3bd0bf,_0x1fbfc2)[_0x721d('0x1c')](function(_0x2c9143){_0x1fbfc2[_0x721d('0x18')]=_0x2c9143[_0x721d('0x23')];_0x2d3d7b[_0x721d('0x24')]['findOne']({'where':{'phone':_0x1fbfc2[_0x721d('0xe')],'VoiceQueueId':_0x3bd0bf['id']}})[_0x721d('0x1c')](function(_0x1c87c3){if(!_['isNil'](_0x1c87c3)){throw new Error(_0x721d('0x25')+_0x1fbfc2[_0x721d('0xe')]+_0x721d('0x26')+_0x3bd0bf['id']);}return _0x2d3d7b[_0x721d('0x24')][_0x721d('0x27')]({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'priority':_0x1fbfc2[_0x721d('0x29')]?_0x1fbfc2['priority']:0x2,'scheduledat':_0x1fbfc2[_0x721d('0x18')]?_0x1fbfc2['scheduledat']:moment()[_0x721d('0x21')](_0x721d('0x22')),'callback':_0x1fbfc2[_0x721d('0x2a')]?!![]:![],'callbackuniqueid':_0x1fbfc2[_0x721d('0x2a')]?_0x1fbfc2[_0x721d('0x2a')]:undefined,'callbackat':_0x1fbfc2[_0x721d('0x2a')]?moment()[_0x721d('0x21')](_0x721d('0x22')):undefined,'VoiceQueueId':_0x3bd0bf['id']});})[_0x721d('0x2b')](function(_0x253b74){_0x536c31(_0x253b74);});});});};var _0x597c97=function(_0x101617){return new BPromise(function(_0x1d77de,_0x16a778){_0x4e87df(_0x101617,_0x1fbfc2)[_0x721d('0x1c')](function(_0x54f4ac){_0x1fbfc2[_0x721d('0x18')]=_0x54f4ac['ret'];_0x2d3d7b['CmHopper'][_0x721d('0x1b')]({'where':{'phone':_0x1fbfc2[_0x721d('0xe')],'VoiceQueueId':_0x101617['id']}})[_0x721d('0x1c')](function(_0x240580){if(!_['isNil'](_0x240580)){throw new Error(_0x721d('0x25')+_0x1fbfc2['phone']+_0x721d('0x2c')+_0x101617['id']);}return _0x2d3d7b[_0x721d('0x2d')][_0x721d('0x1b')]({'where':{'calleridnum':_0x1fbfc2[_0x721d('0xe')],'VoiceQueueId':_0x101617['id']}});})['then'](function(_0x101b91){if(!_[_0x721d('0x19')](_0x101b91)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1fbfc2[_0x721d('0xe')]+_0x721d('0x2e')+_0x101617['id']);}return _0x2d3d7b[_0x721d('0x24')]['create']({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'priority':_0x1fbfc2[_0x721d('0x29')]?_0x1fbfc2[_0x721d('0x29')]:0x2,'scheduledat':_0x1fbfc2[_0x721d('0x18')]?_0x1fbfc2[_0x721d('0x18')]:moment()[_0x721d('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1fbfc2[_0x721d('0x2a')]?!![]:![],'callbackuniqueid':_0x1fbfc2[_0x721d('0x2a')]?_0x1fbfc2[_0x721d('0x2a')]:undefined,'callbackat':_0x1fbfc2[_0x721d('0x2a')]?moment()[_0x721d('0x21')](_0x721d('0x22')):undefined,'VoiceQueueId':_0x101617['id']});})[_0x721d('0x2b')](function(_0x264234){_0x16a778(_0x264234);});});});};function _0x198fa5(){return function(_0x3425d8){logger[_0x721d('0x15')](_0x721d('0x2f'),'afterCreate',util['inspect'](_0x3425d8,{'showHidden':![],'depth':null}));};}function _0x76c175(_0x2f46b7,_0x3f3d4b){var _0x2d5273=_0x3f3d4b[_0x721d('0x18')]?_0x3f3d4b['scheduledat']:moment()[_0x721d('0x21')](_0x721d('0x22'));return new BPromise(function(_0x33a1c5,_0x4380e2){if(_[_0x721d('0x19')](_0x3f3d4b[_0x721d('0x1d')])){_0x33a1c5({'ret':_0x2d5273});}else{_0x2d3d7b[_0x721d('0x30')][_0x721d('0x1b')]({'where':{'id':_0x2f46b7['id']}})[_0x721d('0x1c')](function(_0x27a765){if(!_[_0x721d('0x19')](_0x27a765)){var _0x19036c=_0x27a765[_0x721d('0x1d')];if(!_['isNil'](_0x19036c)){var _0x368ebd=shared[_0x721d('0x1e')];var _0x403d74=_0x368ebd[_0x19036c];var _0x37ee6b=_0x368ebd[_0x3f3d4b['dialTimezone']];if(!_[_0x721d('0x19')](_0x403d74)&&!_[_0x721d('0x19')](_0x37ee6b)){var _0x45aa74=_0x403d74[_0x721d('0x1f')]-_0x37ee6b[_0x721d('0x1f')];_0x2d5273=_0x3f3d4b['scheduledat']?_0x3f3d4b[_0x721d('0x18')]:moment();var _0x47059d=moment(_0x2d5273)[_0x721d('0x20')](_0x45aa74,_0x721d('0x31'));_0x33a1c5({'ret':_0x47059d[_0x721d('0x21')](_0x721d('0x22'))});}else _0x33a1c5({'ret':_0x2d5273});}else _0x33a1c5({'ret':_0x2d5273});}else{_0x33a1c5({'ret':_0x2d5273});}});}});return 0xa;}var _0x2c201a=function(_0x44a880){return new BPromise(function(_0x2931aa,_0xa5b072){_0x76c175(_0x44a880,_0x1fbfc2)[_0x721d('0x1c')](function(_0x48f5ee){_0x1fbfc2[_0x721d('0x18')]=_0x48f5ee[_0x721d('0x23')];_0x2d3d7b[_0x721d('0x24')][_0x721d('0x1b')]({'where':{'phone':_0x1fbfc2[_0x721d('0xe')],'CampaignId':_0x44a880['id']}})[_0x721d('0x1c')](function(_0x4ebdfa){if(!_[_0x721d('0x19')](_0x4ebdfa)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1fbfc2['phone']+_0x721d('0x32')+_0x44a880['id']);}return _0x2d3d7b[_0x721d('0x24')][_0x721d('0x27')]({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'priority':_0x1fbfc2[_0x721d('0x29')]?_0x1fbfc2[_0x721d('0x29')]:0x2,'scheduledat':_0x1fbfc2['scheduledat']?_0x1fbfc2[_0x721d('0x18')]:moment()['format'](_0x721d('0x22')),'callback':_0x1fbfc2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1fbfc2['callbackUniqueid']?_0x1fbfc2['callbackUniqueid']:undefined,'callbackat':_0x1fbfc2[_0x721d('0x2a')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x44a880['id']});})[_0x721d('0x2b')](function(_0x518740){_0xa5b072(_0x518740);});});});};var _0x20f2a4=function(_0x148b27){return new BPromise(function(_0x3e36d2,_0x16faba){_0x76c175(_0x148b27,_0x1fbfc2)[_0x721d('0x1c')](function(_0x21c7b8){_0x1fbfc2['scheduledat']=_0x21c7b8['ret'];_0x2d3d7b['CmHopper'][_0x721d('0x1b')]({'where':{'phone':_0x1fbfc2[_0x721d('0xe')],'CampaignId':_0x148b27['id']}})[_0x721d('0x1c')](function(_0x38a4b4){if(!_['isNil'](_0x38a4b4)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1fbfc2['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x148b27['id']);}return _0x2d3d7b[_0x721d('0x2d')][_0x721d('0x1b')]({'where':{'calleridnum':_0x1fbfc2[_0x721d('0xe')],'CampaignId':_0x148b27['id']}});})[_0x721d('0x1c')](function(_0x23d3bd){if(!_[_0x721d('0x19')](_0x23d3bd)){throw new Error(_0x721d('0x33')+_0x1fbfc2[_0x721d('0xe')]+_0x721d('0x34')+_0x148b27['id']);}return _0x2d3d7b[_0x721d('0x24')]['create']({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'priority':_0x1fbfc2[_0x721d('0x29')]?_0x1fbfc2[_0x721d('0x29')]:0x2,'scheduledat':_0x1fbfc2[_0x721d('0x18')]?_0x1fbfc2[_0x721d('0x18')]:moment()['format'](_0x721d('0x22')),'callback':_0x1fbfc2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1fbfc2[_0x721d('0x2a')]?_0x1fbfc2[_0x721d('0x2a')]:undefined,'callbackat':_0x1fbfc2[_0x721d('0x2a')]?moment()[_0x721d('0x21')](_0x721d('0x22')):undefined,'CampaignId':_0x148b27['id']});})[_0x721d('0x2b')](function(_0xaf79e1){_0x16faba(_0xaf79e1);});});});};if(_0x1fbfc2['ListId']){_0x2d3d7b[_0x721d('0x1a')][_0x721d('0x35')]({'where':{'type':_0x721d('0x36')},'attributes':['id',_0x721d('0x37'),_0x721d('0x1d')],'include':[{'model':_0x2d3d7b['CmList'],'as':_0x721d('0x38'),'where':{'id':_0x1fbfc2[_0x721d('0x28')]}}]})[_0x721d('0x1c')](function(_0x580b4a){if(_0x580b4a){var _0x4a8d2f=[];for(var _0x2d6019=0x0,_0x2593c9;_0x2d6019<_0x580b4a[_0x721d('0x39')];_0x2d6019+=0x1){_0x2593c9=_0x580b4a[_0x2d6019][_0x721d('0x3a')]({'plain':!![]});switch(_0x2593c9[_0x721d('0x37')]){case _0x721d('0x3b'):_0x597c97(_0x2593c9)['catch'](_0x2da0a8());break;case _0x721d('0x3c'):_0xcd058(_0x2593c9)[_0x721d('0x2b')](_0x2da0a8());break;default:_0x76c175(_0x2593c9,_0x1fbfc2)[_0x721d('0x1c')](function(_0x1a3195){_0x1fbfc2[_0x721d('0x18')]=_0x1a3195[_0x721d('0x23')];_0x2d3d7b[_0x721d('0x24')][_0x721d('0x27')]({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'scheduledat':_0x1fbfc2[_0x721d('0x18')]?_0x1fbfc2[_0x721d('0x18')]:moment()['format'](_0x721d('0x22')),'priority':_0x1fbfc2[_0x721d('0x29')]?_0x1fbfc2[_0x721d('0x29')]:0x2,'callback':_0x1fbfc2[_0x721d('0x2a')]?!![]:![],'callbackuniqueid':_0x1fbfc2['callbackUniqueid']?_0x1fbfc2[_0x721d('0x2a')]:undefined,'callbackat':_0x1fbfc2['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2593c9['id']})[_0x721d('0x2b')](_0x2da0a8());});}}}})[_0x721d('0x1c')](function(){return _0x2d3d7b[_0x721d('0x1a')]['findAll']({'where':{'type':_0x721d('0x36')},'attributes':['id'],'include':[{'model':_0x2d3d7b['CmList'],'as':'BlackLists','where':{'id':_0x1fbfc2[_0x721d('0x28')]}}]})[_0x721d('0x1c')](function(_0x3aa8b5){if(_0x3aa8b5){var _0xe4127c=[];for(var _0x285151=0x0,_0x4db47c;_0x285151<_0x3aa8b5[_0x721d('0x39')];_0x285151+=0x1){_0x4db47c=_0x3aa8b5[_0x285151][_0x721d('0x3a')]({'plain':!![]});_0x2d3d7b[_0x721d('0x3d')][_0x721d('0x27')]({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2[_0x721d('0x28')],'VoiceQueueId':_0x4db47c['id']})[_0x721d('0x2b')](function(_0x3e6230){logger['error']('cmContact,\x20%s,\x20%s',_0x721d('0x16'),_0x3e6230['message']);});}}});})[_0x721d('0x1c')](function(){return _0x2d3d7b[_0x721d('0x30')]['findAll']({'attributes':['id',_0x721d('0x37'),_0x721d('0x1d')],'include':[{'model':_0x2d3d7b['CmList'],'as':'Lists','where':{'id':_0x1fbfc2[_0x721d('0x28')]}}]})[_0x721d('0x1c')](function(_0x57c715){if(_0x57c715){var _0x1a02d5=[];for(var _0x4f8399=0x0,_0x65ceaf;_0x4f8399<_0x57c715[_0x721d('0x39')];_0x4f8399+=0x1){_0x65ceaf=_0x57c715[_0x4f8399][_0x721d('0x3a')]({'plain':!![]});switch(_0x65ceaf[_0x721d('0x37')]){case _0x721d('0x3b'):_0x20f2a4(_0x65ceaf)[_0x721d('0x2b')](_0x198fa5());break;case _0x721d('0x3c'):_0x2c201a(_0x65ceaf)[_0x721d('0x2b')](_0x198fa5());break;default:_0x2d3d7b['CmHopper'][_0x721d('0x27')]({'phone':_0x1fbfc2[_0x721d('0xe')],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2['ListId'],'scheduledat':_0x1fbfc2['scheduledat']?_0x1fbfc2[_0x721d('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x1fbfc2['priority']?_0x1fbfc2[_0x721d('0x29')]:0x2,'callback':_0x1fbfc2[_0x721d('0x2a')]?!![]:![],'callbackuniqueid':_0x1fbfc2['callbackUniqueid']?_0x1fbfc2['callbackUniqueid']:undefined,'callbackat':_0x1fbfc2[_0x721d('0x2a')]?moment()[_0x721d('0x21')](_0x721d('0x22')):undefined,'CampaignId':_0x65ceaf['id']})[_0x721d('0x2b')](_0x198fa5());}}}});})[_0x721d('0x1c')](function(){return _0x2d3d7b['Campaign'][_0x721d('0x35')]({'attributes':['id'],'include':[{'model':_0x2d3d7b[_0x721d('0x3e')],'as':_0x721d('0x3f'),'where':{'id':_0x1fbfc2[_0x721d('0x28')]}}]})[_0x721d('0x1c')](function(_0x4ee763){if(_0x4ee763){var _0x561805=[];for(var _0x447348=0x0,_0x590ec1;_0x447348<_0x4ee763[_0x721d('0x39')];_0x447348+=0x1){_0x590ec1=_0x4ee763[_0x447348][_0x721d('0x3a')]({'plain':!![]});_0x2d3d7b[_0x721d('0x3d')][_0x721d('0x27')]({'phone':_0x1fbfc2['phone'],'ContactId':_0x1fbfc2['id'],'ListId':_0x1fbfc2['ListId'],'CampaignId':_0x590ec1['id']})[_0x721d('0x2b')](function(_0x524761){logger[_0x721d('0x15')](_0x721d('0x40'),_0x721d('0x16'),_0x524761[_0x721d('0x41')]);});}}});})[_0x721d('0x1c')](function(){_0x13da3c();})[_0x721d('0x2b')](function(_0x342817){logger[_0x721d('0x15')](_0x721d('0x40'),_0x721d('0x16'),_0x342817[_0x721d('0x41')]);_0x13da3c(_0x342817);});}else{_0x13da3c(new Error(_0x721d('0x42')));}},'afterDestroy':function(_0x2b3855,_0x2a9fd8,_0x5d1457){var _0x4da58f=_0x3e7309[_0x721d('0x14')];var _0x1fd305=_0x2b3855['get']({'plain':!![]});return _0x4da58f[_0x721d('0x24')]['findAll']({'raw':!![],'where':{'ListId':_0x1fd305[_0x721d('0x28')],'ContactId':_0x1fd305['id']}})[_0x721d('0x1c')](function(_0xfa2272){if(!_[_0x721d('0x43')](_0xfa2272)){var _0x423f67=[];for(var _0x41b039=0x0;_0x41b039<_0xfa2272['length'];_0x41b039+=0x1){var _0x49472e=_0x4da58f[_0x721d('0x24')][_0x721d('0x44')]({'where':{'ListId':_0xfa2272[_0x41b039][_0x721d('0x28')],'ContactId':_0xfa2272[_0x41b039][_0x721d('0x45')],'VoiceQueueId':_0xfa2272[_0x41b039]['VoiceQueueId'],'CampaignId':_0xfa2272[_0x41b039][_0x721d('0x46')]}});_0x423f67[_0x721d('0x47')](_0x49472e);}return BPromise['all'](_0x423f67);}})[_0x721d('0x1c')](function(_0x33764f){logger[_0x721d('0x48')](_0x721d('0x49'),util[_0x721d('0x17')](_0x33764f,{'showHidden':![],'depth':null}));_0x5d1457();})[_0x721d('0x2b')](function(_0x4ab7ac){logger[_0x721d('0x15')](_0x721d('0x4a'),util[_0x721d('0x17')](_0x4ab7ac,{'showHidden':![],'depth':null}));_0x5d1457(_0x4ab7ac);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 2463161..0f4de93 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x213c19,_0x4f1ad8){var _0x53e5b6=function(_0xe6ee97){while(--_0xe6ee97){_0x213c19['push'](_0x213c19['shift']());}};_0x53e5b6(++_0x4f1ad8);}(_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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 84623d4..a7132e9 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa7c=['INTEGER','STRING','PHONE','sequelize'];(function(_0x1bb441,_0x3e1d64){var _0x1fad48=function(_0x520d71){while(--_0x520d71){_0x1bb441['push'](_0x1bb441['shift']());}};_0x1fad48(++_0x3e1d64);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x6d4ca0,_0x2d7a84){_0x6d4ca0=_0x6d4ca0-0x0;var _0x439913=_0xfa7c[_0x6d4ca0];return _0x439913;};'use strict';var Sequelize=require(_0xcfa7('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xcfa7('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xcfa7('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xcfa7('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xcfa7('0x2')],'defaultValue':_0xcfa7('0x3')},'OrderBy':{'type':Sequelize[_0xcfa7('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xcfa7('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xe0b2=['exports','INTEGER','STRING','PHONE'];(function(_0x10bc52,_0x81c478){var _0x1b7021=function(_0xb25d2){while(--_0xb25d2){_0x10bc52['push'](_0x10bc52['shift']());}};_0x1b7021(++_0x81c478);}(_0xe0b2,0xec));var _0x2e0b=function(_0x5445f5,_0x46fffb){_0x5445f5=_0x5445f5-0x0;var _0x20dcdf=_0xe0b2[_0x5445f5];return _0x20dcdf;};'use strict';var Sequelize=require('sequelize');module[_0x2e0b('0x0')]={'CmContactId':{'type':Sequelize[_0x2e0b('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x2e0b('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x2e0b('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x2e0b('0x2')],'defaultValue':_0x2e0b('0x3')},'OrderBy':{'type':Sequelize[_0x2e0b('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index e17a345..a128bf2 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x477a=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','end','status','limit','undefined','offset','count','Content-Range','reject','update','then','destroy','CmContactHasItems','sendStatus','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','role','UserProfileSection','find'];(function(_0x3b5085,_0x4e7a4d){var _0x2e0639=function(_0x44bdd9){while(--_0x44bdd9){_0x3b5085['push'](_0x3b5085['shift']());}};_0x2e0639(++_0x4e7a4d);}(_0x477a,0x100));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa477('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa477('0x1'));var jsonpatch=require(_0xa477('0x2'));var rp=require(_0xa477('0x3'));var moment=require(_0xa477('0x4'));var BPromise=require(_0xa477('0x5'));var Mustache=require(_0xa477('0x6'));var util=require(_0xa477('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa477('0x8'));var ejs=require(_0xa477('0x9'));var fs=require('fs');var fs_extra=require(_0xa477('0xa'));var _=require('lodash');var squel=require(_0xa477('0xb'));var crypto=require(_0xa477('0xc'));var jsforce=require(_0xa477('0xd'));var deskjs=require(_0xa477('0xe'));var toCsv=require(_0xa477('0x8'));var querystring=require('querystring');var Papa=require(_0xa477('0xf'));var Redis=require(_0xa477('0x10'));var authService=require(_0xa477('0x11'));var qs=require(_0xa477('0x12'));var as=require(_0xa477('0x13'));var hardwareService=require(_0xa477('0x14'));var logger=require(_0xa477('0x15'))(_0xa477('0x16'));var utils=require(_0xa477('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa477('0x18'));var db=require(_0xa477('0x19'))['db'];function respondWithStatusCode(_0x109809,_0x3fff65){_0x3fff65=_0x3fff65||0xcc;return function(_0x5a5372){if(_0x5a5372){return _0x109809['sendStatus'](_0x3fff65);}return _0x109809['status'](_0x3fff65)[_0xa477('0x1a')]();};}function respondWithResult(_0x12564f,_0x3c3d1d){_0x3c3d1d=_0x3c3d1d||0xc8;return function(_0x3445a1){if(_0x3445a1){return _0x12564f[_0xa477('0x1b')](_0x3c3d1d)['json'](_0x3445a1);}};}function respondWithFilteredResult(_0x40fe97,_0x2ab0d1){return function(_0x50bd8d){if(_0x50bd8d){var _0x1ce740=typeof _0x2ab0d1['offset']==='undefined'&&typeof _0x2ab0d1[_0xa477('0x1c')]===_0xa477('0x1d');var _0x5de28c=_0x50bd8d['count'];var _0x59e8e9=_0x1ce740?0x0:_0x2ab0d1[_0xa477('0x1e')];var _0x51be87=_0x1ce740?_0x50bd8d[_0xa477('0x1f')]:_0x2ab0d1[_0xa477('0x1e')]+_0x2ab0d1[_0xa477('0x1c')];var _0x38d624;if(_0x51be87>=_0x5de28c){_0x51be87=_0x5de28c;_0x38d624=0xc8;}else{_0x38d624=0xce;}_0x40fe97[_0xa477('0x1b')](_0x38d624);return _0x40fe97['set'](_0xa477('0x20'),_0x59e8e9+'-'+_0x51be87+'/'+_0x5de28c)['json'](_0x50bd8d);}return null;};}function patchUpdates(_0x5c4ef1){return function(_0x480051){try{jsonpatch['apply'](_0x480051,_0x5c4ef1,!![]);}catch(_0x2e2b13){return BPromise[_0xa477('0x21')](_0x2e2b13);}return _0x480051['save']();};}function saveUpdates(_0x19c1ed,_0x330399){return function(_0x4e5017){if(_0x4e5017){return _0x4e5017[_0xa477('0x22')](_0x19c1ed)[_0xa477('0x23')](function(_0x23efba){return _0x23efba;});}return null;};}function removeEntity(_0x2c41f5,_0x310e8d){return function(_0x1c09e5){if(_0x1c09e5){return _0x1c09e5[_0xa477('0x24')]()[_0xa477('0x23')](function(){var _0x5418b4=_0x1c09e5['get']({'plain':!![]});var _0x13345b=_0xa477('0x25');return db['UserProfileResource'][_0xa477('0x24')]({'where':{'type':_0x13345b,'resourceId':_0x5418b4['id']}})[_0xa477('0x23')](function(){return _0x1c09e5;});})[_0xa477('0x23')](function(){_0x2c41f5[_0xa477('0x1b')](0xcc)[_0xa477('0x1a')]();});}};}function handleEntityNotFound(_0x25b9f0,_0x4d1eba){return function(_0x93b7d0){if(!_0x93b7d0){_0x25b9f0[_0xa477('0x26')](0x194);}return _0x93b7d0;};}function handleError(_0x42de62,_0x150950){_0x150950=_0x150950||0x1f4;return function(_0x4cef36){logger[_0xa477('0x27')](_0x4cef36[_0xa477('0x28')]);if(_0x4cef36[_0xa477('0x29')]){delete _0x4cef36['name'];}_0x42de62['status'](_0x150950)[_0xa477('0x2a')](_0x4cef36);};}exports[_0xa477('0x2b')]=function(_0x7bd78f,_0x1686d4){var _0x486dbf={},_0xbc17db={},_0x11a3f1={'count':0x0,'rows':[]};var _0x19d235=_[_0xa477('0x2c')](db[_0xa477('0x2d')][_0xa477('0x2e')],function(_0x3e8bea){return{'name':_0x3e8bea['fieldName'],'type':_0x3e8bea[_0xa477('0x2f')][_0xa477('0x30')]};});_0xbc17db[_0xa477('0x31')]=_[_0xa477('0x2c')](_0x19d235,_0xa477('0x29'));_0xbc17db[_0xa477('0x32')]=_[_0xa477('0x33')](_0x7bd78f['query']);_0xbc17db[_0xa477('0x34')]=_[_0xa477('0x35')](_0xbc17db['model'],_0xbc17db['query']);_0x486dbf['attributes']=_[_0xa477('0x35')](_0xbc17db['model'],qs[_0xa477('0x36')](_0x7bd78f[_0xa477('0x32')][_0xa477('0x36')]));_0x486dbf[_0xa477('0x37')]=_0x486dbf[_0xa477('0x37')][_0xa477('0x38')]?_0x486dbf[_0xa477('0x37')]:_0xbc17db[_0xa477('0x31')];if(!_0x7bd78f[_0xa477('0x32')][_0xa477('0x39')](_0xa477('0x3a'))){_0x486dbf[_0xa477('0x1c')]=qs[_0xa477('0x1c')](_0x7bd78f[_0xa477('0x32')][_0xa477('0x1c')]);_0x486dbf[_0xa477('0x1e')]=qs[_0xa477('0x1e')](_0x7bd78f[_0xa477('0x32')]['offset']);}_0x486dbf[_0xa477('0x3b')]=qs[_0xa477('0x3c')](_0x7bd78f[_0xa477('0x32')][_0xa477('0x3c')]);_0x486dbf[_0xa477('0x3d')]=qs[_0xa477('0x34')](_['pick'](_0x7bd78f['query'],_0xbc17db['filters']),_0x19d235);if(_0x7bd78f['query'][_0xa477('0x3e')]){_0x486dbf[_0xa477('0x3d')]=_[_0xa477('0x3f')](_0x486dbf[_0xa477('0x3d')],{'$or':_[_0xa477('0x2c')](_0x19d235,function(_0x4d544b){if(_0x4d544b[_0xa477('0x2f')]!==_0xa477('0x40')){var _0x5992ec={};_0x5992ec[_0x4d544b[_0xa477('0x29')]]={'$like':'%'+_0x7bd78f['query']['filter']+'%'};return _0x5992ec;}})});}_0x486dbf=_['merge']({},_0x486dbf,_0x7bd78f[_0xa477('0x41')]);var _0x39316d={'where':_0x486dbf[_0xa477('0x3d')]};return db[_0xa477('0x2d')][_0xa477('0x1f')](_0x39316d)['then'](function(_0x313d98){_0x11a3f1['count']=_0x313d98;if(_0x7bd78f[_0xa477('0x32')][_0xa477('0x42')]){_0x486dbf[_0xa477('0x43')]=[{'all':!![]}];}return db[_0xa477('0x2d')][_0xa477('0x44')](_0x486dbf);})['then'](function(_0x136714){_0x11a3f1[_0xa477('0x45')]=_0x136714;return _0x11a3f1;})[_0xa477('0x23')](respondWithFilteredResult(_0x1686d4,_0x486dbf))[_0xa477('0x46')](handleError(_0x1686d4,null));};exports[_0xa477('0x47')]=function(_0x4dad3e,_0x1c40eb){var _0x50f277={'raw':!![],'where':{'id':_0x4dad3e[_0xa477('0x48')]['id']}},_0x2915cb={};_0x2915cb[_0xa477('0x31')]=_[_0xa477('0x33')](db[_0xa477('0x2d')][_0xa477('0x2e')]);_0x2915cb[_0xa477('0x32')]=_['keys'](_0x4dad3e[_0xa477('0x32')]);_0x2915cb['filters']=_[_0xa477('0x35')](_0x2915cb[_0xa477('0x31')],_0x2915cb['query']);_0x50f277[_0xa477('0x37')]=_[_0xa477('0x35')](_0x2915cb[_0xa477('0x31')],qs['fields'](_0x4dad3e[_0xa477('0x32')]['fields']));_0x50f277[_0xa477('0x37')]=_0x50f277[_0xa477('0x37')]['length']?_0x50f277[_0xa477('0x37')]:_0x2915cb[_0xa477('0x31')];if(_0x4dad3e['query'][_0xa477('0x42')]){_0x50f277[_0xa477('0x43')]=[{'all':!![]}];}_0x50f277=_[_0xa477('0x3f')]({},_0x50f277,_0x4dad3e[_0xa477('0x41')]);return db[_0xa477('0x2d')]['find'](_0x50f277)[_0xa477('0x23')](handleEntityNotFound(_0x1c40eb,null))[_0xa477('0x23')](respondWithResult(_0x1c40eb,null))['catch'](handleError(_0x1c40eb,null));};exports[_0xa477('0x49')]=function(_0x3344cd,_0x2e0cd7){return db[_0xa477('0x2d')][_0xa477('0x49')](_0x3344cd[_0xa477('0x4a')],{})[_0xa477('0x23')](function(_0x23b780){var _0x3b4bed=_0x3344cd[_0xa477('0x4b')][_0xa477('0x4c')]({'plain':!![]});if(!_0x3b4bed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b4bed[_0xa477('0x4d')]===_0xa477('0x4b')){var _0x403d82=_0x23b780['get']({'plain':!![]});var _0x55c4b0=_0xa477('0x25');return db[_0xa477('0x4e')][_0xa477('0x4f')]({'where':{'name':_0x55c4b0,'userProfileId':_0x3b4bed[_0xa477('0x50')]},'raw':!![]})[_0xa477('0x23')](function(_0xd7c104){if(_0xd7c104&&_0xd7c104[_0xa477('0x51')]===0x0){return db[_0xa477('0x52')][_0xa477('0x49')]({'name':_0x403d82[_0xa477('0x29')],'resourceId':_0x403d82['id'],'type':_0xd7c104[_0xa477('0x29')],'sectionId':_0xd7c104['id']},{})[_0xa477('0x23')](function(){return _0x23b780;});}else{return _0x23b780;}})['catch'](function(_0x41de11){logger['error'](_0xa477('0x53'),_0x41de11);throw _0x41de11;});}return _0x23b780;})['then'](respondWithResult(_0x2e0cd7,0xc9))[_0xa477('0x46')](handleError(_0x2e0cd7,null));};exports[_0xa477('0x22')]=function(_0x1d3faf,_0x232aa0){if(_0x1d3faf[_0xa477('0x4a')]['id']){delete _0x1d3faf[_0xa477('0x4a')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x1d3faf[_0xa477('0x48')]['id']}})[_0xa477('0x23')](handleEntityNotFound(_0x232aa0,null))['then'](saveUpdates(_0x1d3faf[_0xa477('0x4a')],null))['then'](respondWithResult(_0x232aa0,null))[_0xa477('0x46')](handleError(_0x232aa0,null));};exports[_0xa477('0x24')]=function(_0x4abbfc,_0x24a60b){return db['CmContactHasItem']['find']({'where':{'id':_0x4abbfc[_0xa477('0x48')]['id']}})[_0xa477('0x23')](handleEntityNotFound(_0x24a60b,null))[_0xa477('0x23')](removeEntity(_0x24a60b,null))[_0xa477('0x46')](handleError(_0x24a60b,null));}; \ No newline at end of file +var _0x7591=['Content-Range','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','error','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','pick','filter','merge','map','VIRTUAL','options','where','includeAll','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x7591,0x83));var _0x1759=function(_0x42a3bd,_0x297428){_0x42a3bd=_0x42a3bd-0x0;var _0x2d45fc=_0x7591[_0x42a3bd];return _0x2d45fc;};'use strict';var emlformat=require(_0x1759('0x0'));var rimraf=require(_0x1759('0x1'));var zipdir=require(_0x1759('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1759('0x3'));var moment=require(_0x1759('0x4'));var BPromise=require(_0x1759('0x5'));var Mustache=require(_0x1759('0x6'));var util=require(_0x1759('0x7'));var path=require(_0x1759('0x8'));var sox=require(_0x1759('0x9'));var csv=require(_0x1759('0xa'));var ejs=require(_0x1759('0xb'));var fs=require('fs');var fs_extra=require(_0x1759('0xc'));var _=require(_0x1759('0xd'));var squel=require('squel');var crypto=require(_0x1759('0xe'));var jsforce=require(_0x1759('0xf'));var deskjs=require(_0x1759('0x10'));var toCsv=require(_0x1759('0xa'));var querystring=require(_0x1759('0x11'));var Papa=require(_0x1759('0x12'));var Redis=require(_0x1759('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1759('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1759('0x15'));var logger=require(_0x1759('0x16'))(_0x1759('0x17'));var utils=require(_0x1759('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1759('0x19'));var db=require(_0x1759('0x1a'))['db'];function respondWithStatusCode(_0x468efb,_0x3ed9c1){_0x3ed9c1=_0x3ed9c1||0xcc;return function(_0x2554ce){if(_0x2554ce){return _0x468efb[_0x1759('0x1b')](_0x3ed9c1);}return _0x468efb['status'](_0x3ed9c1)[_0x1759('0x1c')]();};}function respondWithResult(_0x3fa25d,_0x318845){_0x318845=_0x318845||0xc8;return function(_0x1813e9){if(_0x1813e9){return _0x3fa25d[_0x1759('0x1d')](_0x318845)[_0x1759('0x1e')](_0x1813e9);}};}function respondWithFilteredResult(_0x472bd5,_0x3463de){return function(_0x484729){if(_0x484729){var _0xa3dcf6=typeof _0x3463de[_0x1759('0x1f')]==='undefined'&&typeof _0x3463de['limit']===_0x1759('0x20');var _0x2cd8bb=_0x484729[_0x1759('0x21')];var _0xc12f6e=_0xa3dcf6?0x0:_0x3463de[_0x1759('0x1f')];var _0x455793=_0xa3dcf6?_0x484729[_0x1759('0x21')]:_0x3463de[_0x1759('0x1f')]+_0x3463de[_0x1759('0x22')];var _0x39b862;if(_0x455793>=_0x2cd8bb){_0x455793=_0x2cd8bb;_0x39b862=0xc8;}else{_0x39b862=0xce;}_0x472bd5[_0x1759('0x1d')](_0x39b862);return _0x472bd5['set'](_0x1759('0x23'),_0xc12f6e+'-'+_0x455793+'/'+_0x2cd8bb)[_0x1759('0x1e')](_0x484729);}return null;};}function patchUpdates(_0x15ffbf){return function(_0x24776d){try{jsonpatch[_0x1759('0x24')](_0x24776d,_0x15ffbf,!![]);}catch(_0x5782d0){return BPromise[_0x1759('0x25')](_0x5782d0);}return _0x24776d[_0x1759('0x26')]();};}function saveUpdates(_0x513e9b,_0xd004f2){return function(_0x3b9d8e){if(_0x3b9d8e){return _0x3b9d8e[_0x1759('0x27')](_0x513e9b)[_0x1759('0x28')](function(_0x5e3cc1){return _0x5e3cc1;});}return null;};}function removeEntity(_0x61f776,_0x2269fa){return function(_0x6cc525){if(_0x6cc525){return _0x6cc525['destroy']()['then'](function(){var _0x43f855=_0x6cc525[_0x1759('0x29')]({'plain':!![]});var _0x4f1733=_0x1759('0x2a');return db[_0x1759('0x2b')]['destroy']({'where':{'type':_0x4f1733,'resourceId':_0x43f855['id']}})[_0x1759('0x28')](function(){return _0x6cc525;});})[_0x1759('0x28')](function(){_0x61f776['status'](0xcc)[_0x1759('0x1c')]();});}};}function handleEntityNotFound(_0x35642f,_0xf20618){return function(_0x1cb55b){if(!_0x1cb55b){_0x35642f[_0x1759('0x1b')](0x194);}return _0x1cb55b;};}function handleError(_0x32c356,_0x53c161){_0x53c161=_0x53c161||0x1f4;return function(_0x3b554b){logger[_0x1759('0x2c')](_0x3b554b['stack']);if(_0x3b554b[_0x1759('0x2d')]){delete _0x3b554b[_0x1759('0x2d')];}_0x32c356[_0x1759('0x1d')](_0x53c161)[_0x1759('0x2e')](_0x3b554b);};}exports[_0x1759('0x2f')]=function(_0x176632,_0xa252b9){var _0x599fad={},_0x298aeb={},_0x4c2ad4={'count':0x0,'rows':[]};var _0x22ec7a=_['map'](db[_0x1759('0x30')][_0x1759('0x31')],function(_0x5ee746){return{'name':_0x5ee746[_0x1759('0x32')],'type':_0x5ee746[_0x1759('0x33')]['key']};});_0x298aeb[_0x1759('0x34')]=_['map'](_0x22ec7a,_0x1759('0x2d'));_0x298aeb[_0x1759('0x35')]=_[_0x1759('0x36')](_0x176632['query']);_0x298aeb[_0x1759('0x37')]=_[_0x1759('0x38')](_0x298aeb[_0x1759('0x34')],_0x298aeb['query']);_0x599fad[_0x1759('0x39')]=_['intersection'](_0x298aeb['model'],qs[_0x1759('0x3a')](_0x176632[_0x1759('0x35')][_0x1759('0x3a')]));_0x599fad[_0x1759('0x39')]=_0x599fad[_0x1759('0x39')]['length']?_0x599fad[_0x1759('0x39')]:_0x298aeb['model'];if(!_0x176632[_0x1759('0x35')][_0x1759('0x3b')]('nolimit')){_0x599fad[_0x1759('0x22')]=qs[_0x1759('0x22')](_0x176632[_0x1759('0x35')][_0x1759('0x22')]);_0x599fad[_0x1759('0x1f')]=qs[_0x1759('0x1f')](_0x176632[_0x1759('0x35')][_0x1759('0x1f')]);}_0x599fad[_0x1759('0x3c')]=qs['sort'](_0x176632[_0x1759('0x35')]['sort']);_0x599fad['where']=qs['filters'](_[_0x1759('0x3d')](_0x176632[_0x1759('0x35')],_0x298aeb[_0x1759('0x37')]),_0x22ec7a);if(_0x176632[_0x1759('0x35')][_0x1759('0x3e')]){_0x599fad['where']=_[_0x1759('0x3f')](_0x599fad['where'],{'$or':_[_0x1759('0x40')](_0x22ec7a,function(_0x42bdc7){if(_0x42bdc7['type']!==_0x1759('0x41')){var _0x3fd081={};_0x3fd081[_0x42bdc7[_0x1759('0x2d')]]={'$like':'%'+_0x176632[_0x1759('0x35')][_0x1759('0x3e')]+'%'};return _0x3fd081;}})});}_0x599fad=_[_0x1759('0x3f')]({},_0x599fad,_0x176632[_0x1759('0x42')]);var _0x3673ee={'where':_0x599fad[_0x1759('0x43')]};return db[_0x1759('0x30')]['count'](_0x3673ee)[_0x1759('0x28')](function(_0x192810){_0x4c2ad4['count']=_0x192810;if(_0x176632[_0x1759('0x35')][_0x1759('0x44')]){_0x599fad['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x1759('0x45')](_0x599fad);})[_0x1759('0x28')](function(_0x563e4d){_0x4c2ad4['rows']=_0x563e4d;return _0x4c2ad4;})[_0x1759('0x28')](respondWithFilteredResult(_0xa252b9,_0x599fad))[_0x1759('0x46')](handleError(_0xa252b9,null));};exports[_0x1759('0x47')]=function(_0x272d32,_0x5c033f){var _0x1c350f={'raw':!![],'where':{'id':_0x272d32[_0x1759('0x48')]['id']}},_0x3619e2={};_0x3619e2[_0x1759('0x34')]=_['keys'](db[_0x1759('0x30')][_0x1759('0x31')]);_0x3619e2[_0x1759('0x35')]=_['keys'](_0x272d32[_0x1759('0x35')]);_0x3619e2[_0x1759('0x37')]=_[_0x1759('0x38')](_0x3619e2[_0x1759('0x34')],_0x3619e2['query']);_0x1c350f[_0x1759('0x39')]=_['intersection'](_0x3619e2[_0x1759('0x34')],qs[_0x1759('0x3a')](_0x272d32[_0x1759('0x35')]['fields']));_0x1c350f[_0x1759('0x39')]=_0x1c350f[_0x1759('0x39')][_0x1759('0x49')]?_0x1c350f[_0x1759('0x39')]:_0x3619e2[_0x1759('0x34')];if(_0x272d32[_0x1759('0x35')][_0x1759('0x44')]){_0x1c350f['include']=[{'all':!![]}];}_0x1c350f=_[_0x1759('0x3f')]({},_0x1c350f,_0x272d32['options']);return db[_0x1759('0x30')][_0x1759('0x4a')](_0x1c350f)[_0x1759('0x28')](handleEntityNotFound(_0x5c033f,null))['then'](respondWithResult(_0x5c033f,null))['catch'](handleError(_0x5c033f,null));};exports[_0x1759('0x4b')]=function(_0x5700b6,_0x148b32){return db['CmContactHasItem']['create'](_0x5700b6[_0x1759('0x4c')],{})['then'](function(_0x553ccb){var _0x9a61ed=_0x5700b6[_0x1759('0x4d')][_0x1759('0x29')]({'plain':!![]});if(!_0x9a61ed)throw new Error(_0x1759('0x4e'));if(_0x9a61ed[_0x1759('0x4f')]===_0x1759('0x4d')){var _0x30392c=_0x553ccb[_0x1759('0x29')]({'plain':!![]});var _0x2a9ae2='CmContactHasItems';return db['UserProfileSection'][_0x1759('0x4a')]({'where':{'name':_0x2a9ae2,'userProfileId':_0x9a61ed[_0x1759('0x50')]},'raw':!![]})['then'](function(_0x147e95){if(_0x147e95&&_0x147e95['autoAssociation']===0x0){return db[_0x1759('0x2b')][_0x1759('0x4b')]({'name':_0x30392c[_0x1759('0x2d')],'resourceId':_0x30392c['id'],'type':_0x147e95[_0x1759('0x2d')],'sectionId':_0x147e95['id']},{})['then'](function(){return _0x553ccb;});}else{return _0x553ccb;}})['catch'](function(_0x3cb7a9){logger[_0x1759('0x2c')](_0x1759('0x51'),_0x3cb7a9);throw _0x3cb7a9;});}return _0x553ccb;})[_0x1759('0x28')](respondWithResult(_0x148b32,0xc9))[_0x1759('0x46')](handleError(_0x148b32,null));};exports[_0x1759('0x27')]=function(_0x1969a6,_0xa552e8){if(_0x1969a6[_0x1759('0x4c')]['id']){delete _0x1969a6[_0x1759('0x4c')]['id'];}return db[_0x1759('0x30')][_0x1759('0x4a')]({'where':{'id':_0x1969a6[_0x1759('0x48')]['id']}})[_0x1759('0x28')](handleEntityNotFound(_0xa552e8,null))[_0x1759('0x28')](saveUpdates(_0x1969a6[_0x1759('0x4c')],null))[_0x1759('0x28')](respondWithResult(_0xa552e8,null))[_0x1759('0x46')](handleError(_0xa552e8,null));};exports[_0x1759('0x52')]=function(_0x472bba,_0x205683){return db['CmContactHasItem'][_0x1759('0x4a')]({'where':{'id':_0x472bba[_0x1759('0x48')]['id']}})[_0x1759('0x28')](handleEntityNotFound(_0x205683,null))[_0x1759('0x28')](removeEntity(_0x205683,null))[_0x1759('0x46')](handleError(_0x205683,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 039a006..80c3077 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6646=['CmContactHasItem','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x3d1d2e,_0x295d13){var _0x35ac48=function(_0x12e1f4){while(--_0x12e1f4){_0x3d1d2e['push'](_0x3d1d2e['shift']());}};_0x35ac48(++_0x295d13);}(_0x6646,0x133));var _0x6664=function(_0x4c567a,_0x35b0f6){_0x4c567a=_0x4c567a-0x0;var _0x5d0f69=_0x6646[_0x4c567a];return _0x5d0f69;};'use strict';var _=require(_0x6664('0x0'));var util=require(_0x6664('0x1'));var logger=require('../../config/logger')(_0x6664('0x2'));var moment=require(_0x6664('0x3'));var BPromise=require(_0x6664('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6664('0x5'));var config=require(_0x6664('0x6'));var attributes=require(_0x6664('0x7'));module['exports']=function(_0x369d0c,_0x111816){return _0x369d0c['define'](_0x6664('0x8'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52f2=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','lodash','util'];(function(_0x296bfb,_0x1a5cdd){var _0x29f45d=function(_0x20e9da){while(--_0x20e9da){_0x296bfb['push'](_0x296bfb['shift']());}};_0x29f45d(++_0x1a5cdd);}(_0x52f2,0x11c));var _0x252f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x52f2[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x252f('0x0'));var util=require(_0x252f('0x1'));var logger=require(_0x252f('0x2'))(_0x252f('0x3'));var moment=require(_0x252f('0x4'));var BPromise=require(_0x252f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x252f('0x6'));var rimraf=require(_0x252f('0x7'));var config=require(_0x252f('0x8'));var attributes=require(_0x252f('0x9'));module['exports']=function(_0x5419eb,_0x2f7fde){return _0x5419eb[_0x252f('0xa')](_0x252f('0xb'),attributes,{'tableName':_0x252f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 764087a..a3822d0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d55=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','error','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x4d55,0xfa));var _0x54d5=function(_0x72193d,_0x330a80){_0x72193d=_0x72193d-0x0;var _0x455d4f=_0x4d55[_0x72193d];return _0x455d4f;};'use strict';var _=require(_0x54d5('0x0'));var util=require(_0x54d5('0x1'));var moment=require(_0x54d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x54d5('0x3'));var fs=require('fs');var Redis=require(_0x54d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x54d5('0x5'))(_0x54d5('0x6'));var config=require(_0x54d5('0x7'));var jayson=require(_0x54d5('0x8'));var client=jayson[_0x54d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f31f,_0x39e986,_0x3a0e36){return new BPromise(function(_0x54eb23,_0x39595d){return client[_0x54d5('0xa')](_0x35f31f,_0x3a0e36)[_0x54d5('0xb')](function(_0x2a1b38){logger[_0x54d5('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x39e986,_0x54d5('0xd'));logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x39e986,'request\x20sent',JSON['stringify'](_0x2a1b38));if(_0x2a1b38['error']){if(_0x2a1b38[_0x54d5('0xe')]['code']===0x1f4){logger['error'](_0x54d5('0xf'),_0x39e986,_0x2a1b38[_0x54d5('0xe')][_0x54d5('0x10')]);return _0x39595d(_0x2a1b38[_0x54d5('0xe')][_0x54d5('0x10')]);}logger[_0x54d5('0xe')](_0x54d5('0xf'),_0x39e986,_0x2a1b38[_0x54d5('0xe')][_0x54d5('0x10')]);return _0x54eb23(_0x2a1b38[_0x54d5('0xe')][_0x54d5('0x10')]);}else{logger['info'](_0x54d5('0xf'),_0x39e986,_0x54d5('0xd'));_0x54eb23(_0x2a1b38[_0x54d5('0x11')]['message']);}})['catch'](function(_0x195239){logger[_0x54d5('0xe')](_0x54d5('0xf'),_0x39e986,_0x195239);_0x39595d(_0x195239);});});} \ No newline at end of file +var _0xd80a=['randomstring','../../mysqldb','rpc','../../config/environment','client','request','then','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x2f3a5c,_0x5bb18e){var _0x266768=function(_0x23d056){while(--_0x23d056){_0x2f3a5c['push'](_0x2f3a5c['shift']());}};_0x266768(++_0x5bb18e);}(_0xd80a,0xd8));var _0xad80=function(_0x5e5937,_0x302d4b){_0x5e5937=_0x5e5937-0x0;var _0x13f53f=_0xd80a[_0x5e5937];return _0x13f53f;};'use strict';var _=require(_0xad80('0x0'));var util=require(_0xad80('0x1'));var moment=require(_0xad80('0x2'));var BPromise=require(_0xad80('0x3'));var rs=require(_0xad80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad80('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad80('0x6'));var config=require(_0xad80('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xad80('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b319c,_0x1ecbe8,_0x32c2ae){return new BPromise(function(_0x5668d4,_0x153a15){return client[_0xad80('0x9')](_0x4b319c,_0x32c2ae)[_0xad80('0xa')](function(_0x1f75d4){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x1ecbe8,_0xad80('0xb'));logger[_0xad80('0xc')](_0xad80('0xd'),_0x1ecbe8,_0xad80('0xb'),JSON[_0xad80('0xe')](_0x1f75d4));if(_0x1f75d4[_0xad80('0xf')]){if(_0x1f75d4[_0xad80('0xf')][_0xad80('0x10')]===0x1f4){logger[_0xad80('0xf')](_0xad80('0x11'),_0x1ecbe8,_0x1f75d4[_0xad80('0xf')][_0xad80('0x12')]);return _0x153a15(_0x1f75d4['error'][_0xad80('0x12')]);}logger['error'](_0xad80('0x11'),_0x1ecbe8,_0x1f75d4[_0xad80('0xf')][_0xad80('0x12')]);return _0x5668d4(_0x1f75d4['error'][_0xad80('0x12')]);}else{logger[_0xad80('0x13')](_0xad80('0x11'),_0x1ecbe8,_0xad80('0xb'));_0x5668d4(_0x1f75d4[_0xad80('0x14')]['message']);}})[_0xad80('0x15')](function(_0x23702e){logger[_0xad80('0xf')](_0xad80('0x11'),_0x1ecbe8,_0x23702e);_0x153a15(_0x23702e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e249780..ef78632 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fee=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','show','post','isAuthenticated','create','put','/:id','update'];(function(_0x465a0c,_0x5d84e0){var _0x1f92c5=function(_0x168248){while(--_0x168248){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1f92c5(++_0x5d84e0);}(_0x0fee,0x1c4));var _0xe0fe=function(_0xb9da3c,_0x4264a4){_0xb9da3c=_0xb9da3c-0x0;var _0x1e2d30=_0x0fee[_0xb9da3c];return _0x1e2d30;};'use strict';var multer=require(_0xe0fe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe0fe('0x1'));var express=require(_0xe0fe('0x2'));var router=express[_0xe0fe('0x3')]();var fs_extra=require(_0xe0fe('0x4'));var auth=require(_0xe0fe('0x5'));var interaction=require(_0xe0fe('0x6'));var config=require('../../config/environment');var controller=require(_0xe0fe('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe0fe('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe0fe('0x9')]);router[_0xe0fe('0xa')]('/',auth[_0xe0fe('0xb')](),controller[_0xe0fe('0xc')]);router[_0xe0fe('0xd')](_0xe0fe('0xe'),auth[_0xe0fe('0xb')](),controller[_0xe0fe('0xf')]);router['delete']('/:id',auth[_0xe0fe('0xb')](),controller[_0xe0fe('0x10')]);module[_0xe0fe('0x11')]=router; \ No newline at end of file +var _0xa883=['fs-extra','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xd4132,_0x52d7d7){var _0x53e796=function(_0x12756c){while(--_0x12756c){_0xd4132['push'](_0xd4132['shift']());}};_0x53e796(++_0x52d7d7);}(_0xa883,0x1f2));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3a88('0x0'));var util=require(_0x3a88('0x1'));var path=require(_0x3a88('0x2'));var timeout=require(_0x3a88('0x3'));var express=require(_0x3a88('0x4'));var router=express[_0x3a88('0x5')]();var fs_extra=require(_0x3a88('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a88('0x7'));var controller=require(_0x3a88('0x8'));router['get']('/',auth[_0x3a88('0x9')](),controller[_0x3a88('0xa')]);router[_0x3a88('0xb')](_0x3a88('0xc'),auth[_0x3a88('0x9')](),controller[_0x3a88('0xd')]);router['post']('/',auth[_0x3a88('0x9')](),controller[_0x3a88('0xe')]);router[_0x3a88('0xf')](_0x3a88('0xc'),auth[_0x3a88('0x9')](),controller['update']);router[_0x3a88('0x10')](_0x3a88('0xc'),auth[_0x3a88('0x9')](),controller[_0x3a88('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 3bcdd2a..e508d40 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 _0x16e7=['sequelize','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','BOOLEAN','ENUM','voice'];(function(_0x597258,_0x293d8b){var _0x1f1142=function(_0x300a61){while(--_0x300a61){_0x597258['push'](_0x597258['shift']());}};_0x1f1142(++_0x293d8b);}(_0x16e7,0x1b3));var _0x716e=function(_0xefd992,_0x3aa307){_0xefd992=_0xefd992-0x0;var _0x3b11d6=_0x16e7[_0xefd992];return _0x3b11d6;};'use strict';var Sequelize=require(_0x716e('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x15393b){return this[_0x716e('0x1')](_0x716e('0x2'));}},'alias':{'type':Sequelize[_0x716e('0x3')],'allowNull':![],'set':function(_0x1cd808){this[_0x716e('0x4')](_0x716e('0x2'),_0x1cd808?_0x1cd808:this[_0x716e('0x1')](_0x716e('0x5')));}},'type':{'type':Sequelize[_0x716e('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x716e('0x6')](_0x716e('0x7')),'get':function(){if(this[_0x716e('0x1')](_0x716e('0x8'))===_0x716e('0x9')){return JSON[_0x716e('0xa')](this['getDataValue'](_0x716e('0xb')));}else{return this[_0x716e('0x1')](_0x716e('0xb'));}},'set':function(_0x4e4495){if(Array['isArray'](_0x4e4495)){this[_0x716e('0x4')](_0x716e('0xb'),JSON['stringify'](_0x4e4495));}else{this['setDataValue'](_0x716e('0xb'),_0x4e4495);}}},'required':{'type':Sequelize[_0x716e('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x716e('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x716e('0xd')](_0x716e('0xe'))}}; \ No newline at end of file +var _0x7b1b=['VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','select','values','isArray','stringify','setDataValue','BOOLEAN','lodash','exports'];(function(_0x2b5520,_0x1ca914){var _0x3049c6=function(_0x396f53){while(--_0x396f53){_0x2b5520['push'](_0x2b5520['shift']());}};_0x3049c6(++_0x1ca914);}(_0x7b1b,0x166));var _0xb7b1=function(_0xbdfc2f,_0x15e1be){_0xbdfc2f=_0xbdfc2f-0x0;var _0x42f80b=_0x7b1b[_0xbdfc2f];return _0x42f80b;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb7b1('0x0'));module[_0xb7b1('0x1')]={'name':{'type':Sequelize[_0xb7b1('0x2')],'get':function(_0x2e78b6){return this[_0xb7b1('0x3')](_0xb7b1('0x4'));}},'alias':{'type':Sequelize[_0xb7b1('0x5')],'allowNull':![],'set':function(_0xc278d0){this['setDataValue'](_0xb7b1('0x4'),_0xc278d0?_0xc278d0:this[_0xb7b1('0x3')](_0xb7b1('0x6')));}},'type':{'type':Sequelize[_0xb7b1('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb7b1('0x7')](_0xb7b1('0x8')),'get':function(){if(this[_0xb7b1('0x3')]('type')===_0xb7b1('0x9')){return JSON['parse'](this['getDataValue']('values'));}else{return this['getDataValue'](_0xb7b1('0xa'));}},'set':function(_0x20b03b){if(Array[_0xb7b1('0xb')](_0x20b03b)){this['setDataValue'](_0xb7b1('0xa'),JSON[_0xb7b1('0xc')](_0x20b03b));}else{this[_0xb7b1('0xd')](_0xb7b1('0xa'),_0x20b03b);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb7b1('0xe')],'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 6175b63..fceeca0 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 _0x0560=['options','includeAll','include','catch','show','body','find','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x0560,0x120));var _0x0056=function(_0xad6236,_0x489ebc){_0xad6236=_0xad6236-0x0;var _0x47cdcd=_0x0560[_0xad6236];return _0x47cdcd;};'use strict';var emlformat=require(_0x0056('0x0'));var rimraf=require(_0x0056('0x1'));var zipdir=require(_0x0056('0x2'));var jsonpatch=require(_0x0056('0x3'));var rp=require(_0x0056('0x4'));var moment=require(_0x0056('0x5'));var BPromise=require(_0x0056('0x6'));var Mustache=require('mustache');var util=require(_0x0056('0x7'));var path=require('path');var sox=require(_0x0056('0x8'));var csv=require(_0x0056('0x9'));var ejs=require(_0x0056('0xa'));var fs=require('fs');var fs_extra=require(_0x0056('0xb'));var _=require(_0x0056('0xc'));var squel=require(_0x0056('0xd'));var crypto=require('crypto');var jsforce=require(_0x0056('0xe'));var deskjs=require(_0x0056('0xf'));var toCsv=require(_0x0056('0x9'));var querystring=require(_0x0056('0x10'));var Papa=require(_0x0056('0x11'));var Redis=require(_0x0056('0x12'));var authService=require(_0x0056('0x13'));var qs=require(_0x0056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0056('0x15'));var logger=require('../../config/logger')(_0x0056('0x16'));var utils=require(_0x0056('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x575d23,_0x5b753b){_0x5b753b=_0x5b753b||0xcc;return function(_0x460226){if(_0x460226){return _0x575d23['sendStatus'](_0x5b753b);}return _0x575d23[_0x0056('0x19')](_0x5b753b)[_0x0056('0x1a')]();};}function respondWithResult(_0x5860ee,_0x152c5a){_0x152c5a=_0x152c5a||0xc8;return function(_0x59a743){if(_0x59a743){return _0x5860ee[_0x0056('0x19')](_0x152c5a)[_0x0056('0x1b')](_0x59a743);}};}function respondWithFilteredResult(_0x2ca2ee,_0x10cc92){return function(_0x5a87f3){if(_0x5a87f3){var _0x5dbd28=typeof _0x10cc92[_0x0056('0x1c')]==='undefined'&&typeof _0x10cc92['limit']===_0x0056('0x1d');var _0x29af51=_0x5a87f3[_0x0056('0x1e')];var _0x8ce165=_0x5dbd28?0x0:_0x10cc92[_0x0056('0x1c')];var _0x42a2b7=_0x5dbd28?_0x5a87f3['count']:_0x10cc92[_0x0056('0x1c')]+_0x10cc92[_0x0056('0x1f')];var _0x2ad318;if(_0x42a2b7>=_0x29af51){_0x42a2b7=_0x29af51;_0x2ad318=0xc8;}else{_0x2ad318=0xce;}_0x2ca2ee['status'](_0x2ad318);return _0x2ca2ee[_0x0056('0x20')](_0x0056('0x21'),_0x8ce165+'-'+_0x42a2b7+'/'+_0x29af51)[_0x0056('0x1b')](_0x5a87f3);}return null;};}function patchUpdates(_0x2b9423){return function(_0x1b66ed){try{jsonpatch[_0x0056('0x22')](_0x1b66ed,_0x2b9423,!![]);}catch(_0x532663){return BPromise[_0x0056('0x23')](_0x532663);}return _0x1b66ed['save']();};}function saveUpdates(_0x199ace,_0x1523a0){return function(_0x37848a){if(_0x37848a){return _0x37848a[_0x0056('0x24')](_0x199ace)[_0x0056('0x25')](function(_0x581f3c){return _0x581f3c;});}return null;};}function removeEntity(_0x433739,_0x3259cf){return function(_0x2f35a){if(_0x2f35a){return _0x2f35a[_0x0056('0x26')]()[_0x0056('0x25')](function(){_0x433739[_0x0056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107c10,_0x2e84da){return function(_0x51eefd){if(!_0x51eefd){_0x107c10[_0x0056('0x27')](0x194);}return _0x51eefd;};}function handleError(_0x481ea4,_0x13d94b){_0x13d94b=_0x13d94b||0x1f4;return function(_0xa7da86){logger[_0x0056('0x28')](_0xa7da86[_0x0056('0x29')]);if(_0xa7da86[_0x0056('0x2a')]){delete _0xa7da86[_0x0056('0x2a')];}_0x481ea4[_0x0056('0x19')](_0x13d94b)[_0x0056('0x2b')](_0xa7da86);};}exports['index']=function(_0x523266,_0x514ef7){var _0x3702a4={},_0x5cd7ab={},_0x5b27a0={'count':0x0,'rows':[]};var _0x4861a9=_[_0x0056('0x2c')](db[_0x0056('0x2d')][_0x0056('0x2e')],function(_0x497d73){return{'name':_0x497d73[_0x0056('0x2f')],'type':_0x497d73[_0x0056('0x30')][_0x0056('0x31')]};});_0x5cd7ab[_0x0056('0x32')]=_['differenceBy'](_['map'](_0x4861a9,'name'),[_0x0056('0x2a')]);_0x5cd7ab[_0x0056('0x33')]=_[_0x0056('0x34')](_0x523266[_0x0056('0x33')]);_0x5cd7ab[_0x0056('0x35')]=_['intersection'](_0x5cd7ab['model'],_0x5cd7ab['query']);_0x3702a4[_0x0056('0x36')]=_[_0x0056('0x37')](_0x5cd7ab[_0x0056('0x32')],qs[_0x0056('0x38')](_0x523266[_0x0056('0x33')][_0x0056('0x38')]));_0x3702a4[_0x0056('0x36')]=_0x3702a4['attributes']['length']?_0x3702a4[_0x0056('0x36')]:_0x5cd7ab[_0x0056('0x32')];if(!_0x523266[_0x0056('0x33')][_0x0056('0x39')]('nolimit')){_0x3702a4[_0x0056('0x1f')]=qs[_0x0056('0x1f')](_0x523266[_0x0056('0x33')][_0x0056('0x1f')]);_0x3702a4[_0x0056('0x1c')]=qs[_0x0056('0x1c')](_0x523266[_0x0056('0x33')][_0x0056('0x1c')]);}_0x3702a4[_0x0056('0x3a')]=qs[_0x0056('0x3b')](_0x523266['query'][_0x0056('0x3b')]);_0x3702a4[_0x0056('0x3c')]=qs[_0x0056('0x35')](_['pick'](_0x523266['query'],_0x5cd7ab[_0x0056('0x35')]),_0x4861a9);if(_0x523266[_0x0056('0x33')][_0x0056('0x3d')]){_0x3702a4[_0x0056('0x3c')]=_[_0x0056('0x3e')](_0x3702a4['where'],{'$or':_[_0x0056('0x2c')](_0x4861a9,function(_0x221f02){if(_0x221f02[_0x0056('0x30')]!==_0x0056('0x3f')){var _0x47dac2={};_0x47dac2[_0x221f02[_0x0056('0x2a')]]={'$like':'%'+_0x523266['query'][_0x0056('0x3d')]+'%'};return _0x47dac2;}})});}_0x3702a4=_[_0x0056('0x3e')]({},_0x3702a4,_0x523266[_0x0056('0x40')]);var _0xfd07e6={'where':_0x3702a4[_0x0056('0x3c')]};return db[_0x0056('0x2d')][_0x0056('0x1e')](_0xfd07e6)[_0x0056('0x25')](function(_0x2d5524){_0x5b27a0['count']=_0x2d5524;if(_0x523266[_0x0056('0x33')][_0x0056('0x41')]){_0x3702a4[_0x0056('0x42')]=[{'all':!![]}];}return db[_0x0056('0x2d')]['findAll'](_0x3702a4);})['then'](function(_0x459136){_0x5b27a0['rows']=_0x459136;return _0x5b27a0;})[_0x0056('0x25')](respondWithFilteredResult(_0x514ef7,_0x3702a4))[_0x0056('0x43')](handleError(_0x514ef7,null));};exports[_0x0056('0x44')]=function(_0x289fcd,_0xd0fbc5){var _0x32d012={'raw':!![],'where':{'id':_0x289fcd['params']['id']}},_0x340a91={};_0x340a91['model']=_[_0x0056('0x34')](db[_0x0056('0x2d')][_0x0056('0x2e')]);_0x340a91['query']=_[_0x0056('0x34')](_0x289fcd[_0x0056('0x33')]);_0x340a91[_0x0056('0x35')]=_[_0x0056('0x37')](_0x340a91[_0x0056('0x32')],_0x340a91['query']);_0x32d012[_0x0056('0x36')]=_[_0x0056('0x37')](_0x340a91[_0x0056('0x32')],qs[_0x0056('0x38')](_0x289fcd['query'][_0x0056('0x38')]));_0x32d012[_0x0056('0x36')]=_0x32d012[_0x0056('0x36')]['length']?_0x32d012[_0x0056('0x36')]:_0x340a91['model'];if(_0x289fcd[_0x0056('0x33')]['includeAll']){_0x32d012[_0x0056('0x42')]=[{'all':!![]}];}_0x32d012=_[_0x0056('0x3e')]({},_0x32d012,_0x289fcd[_0x0056('0x40')]);return db['CmCustomField']['find'](_0x32d012)[_0x0056('0x25')](handleEntityNotFound(_0xd0fbc5,null))[_0x0056('0x25')](respondWithResult(_0xd0fbc5,null))['catch'](handleError(_0xd0fbc5,null));};exports[_0x0056('0x24')]=function(_0x5116e1,_0xb94015){if(_0x5116e1[_0x0056('0x45')]['id']){delete _0x5116e1[_0x0056('0x45')]['id'];}return db[_0x0056('0x2d')][_0x0056('0x46')]({'where':{'id':_0x5116e1[_0x0056('0x47')]['id']}})[_0x0056('0x25')](handleEntityNotFound(_0xb94015,null))[_0x0056('0x25')](saveUpdates(_0x5116e1[_0x0056('0x45')],null))[_0x0056('0x25')](respondWithResult(_0xb94015,null))[_0x0056('0x43')](handleError(_0xb94015,null));};exports[_0x0056('0x26')]=function(_0x21ec17,_0x508fac){return db[_0x0056('0x2d')][_0x0056('0x46')]({'where':{'id':_0x21ec17[_0x0056('0x47')]['id']}})[_0x0056('0x25')](handleEntityNotFound(_0x508fac,null))[_0x0056('0x25')](removeEntity(_0x508fac,null))[_0x0056('0x43')](handleError(_0x508fac,null));};exports[_0x0056('0x48')]=function(_0x26324c,_0x48519b){var _0x2ef6ac;return db[_0x0056('0x49')][_0x0056('0x4a')](function(_0x3bd31e){return db[_0x0056('0x2d')]['create'](_0x26324c[_0x0056('0x45')],{'transaction':_0x3bd31e})[_0x0056('0x25')](function(_0x1ec54a){_0x2ef6ac=_0x1ec54a;var _0x2f5562={'type':db[_0x0056('0x4b')][_0x0056('0x4c')],'transaction':_0x3bd31e};switch(_0x26324c[_0x0056('0x45')][_0x0056('0x30')]){case _0x0056('0x4d'):_0x2f5562[_0x0056('0x30')]=db[_0x0056('0x4b')]['TEXT'];break;case _0x0056('0x4e'):_0x2f5562[_0x0056('0x30')]=db[_0x0056('0x4b')][_0x0056('0x4f')];break;case _0x0056('0x50'):_0x2f5562[_0x0056('0x30')]=db['Sequelize'][_0x0056('0x51')];_0x2f5562[_0x0056('0x52')]=![];break;default:}return db[_0x0056('0x49')][_0x0056('0x53')][_0x0056('0x54')](_0x0056('0x55'),util[_0x0056('0x56')](_0x0056('0x57'),_0x2ef6ac['id']),_0x2f5562);})['then'](function(){return _0x2ef6ac;});})['then'](respondWithResult(_0x48519b,0xc9))['catch'](handleError(_0x48519b,null));}; \ No newline at end of file +var _0x4bd5=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','params','length','includeAll','find','body','catch','create','sequelize','transaction','TEXT','text','Sequelize','number','switch','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key'];(function(_0x1f2847,_0x4d21da){var _0x157ba6=function(_0x5d823b){while(--_0x5d823b){_0x1f2847['push'](_0x1f2847['shift']());}};_0x157ba6(++_0x4d21da);}(_0x4bd5,0x77));var _0x54bd=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x4bd5[_0x17c8cc];return _0x3db4eb;};'use strict';var emlformat=require(_0x54bd('0x0'));var rimraf=require(_0x54bd('0x1'));var zipdir=require(_0x54bd('0x2'));var jsonpatch=require(_0x54bd('0x3'));var rp=require(_0x54bd('0x4'));var moment=require('moment');var BPromise=require(_0x54bd('0x5'));var Mustache=require(_0x54bd('0x6'));var util=require('util');var path=require(_0x54bd('0x7'));var sox=require('sox');var csv=require(_0x54bd('0x8'));var ejs=require(_0x54bd('0x9'));var fs=require('fs');var fs_extra=require(_0x54bd('0xa'));var _=require(_0x54bd('0xb'));var squel=require('squel');var crypto=require(_0x54bd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x54bd('0xd'));var authService=require(_0x54bd('0xe'));var qs=require(_0x54bd('0xf'));var as=require(_0x54bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54bd('0x11'))(_0x54bd('0x12'));var utils=require(_0x54bd('0x13'));var config=require(_0x54bd('0x14'));var licenseUtil=require(_0x54bd('0x15'));var db=require(_0x54bd('0x16'))['db'];function respondWithStatusCode(_0x89928f,_0x1d1bdf){_0x1d1bdf=_0x1d1bdf||0xcc;return function(_0x1ab622){if(_0x1ab622){return _0x89928f[_0x54bd('0x17')](_0x1d1bdf);}return _0x89928f[_0x54bd('0x18')](_0x1d1bdf)[_0x54bd('0x19')]();};}function respondWithResult(_0x7047af,_0x553428){_0x553428=_0x553428||0xc8;return function(_0x33bd1c){if(_0x33bd1c){return _0x7047af['status'](_0x553428)[_0x54bd('0x1a')](_0x33bd1c);}};}function respondWithFilteredResult(_0x13d11d,_0x33f16a){return function(_0x5d38bd){if(_0x5d38bd){var _0x2a845e=typeof _0x33f16a[_0x54bd('0x1b')]===_0x54bd('0x1c')&&typeof _0x33f16a[_0x54bd('0x1d')]===_0x54bd('0x1c');var _0x4eeada=_0x5d38bd[_0x54bd('0x1e')];var _0x571d72=_0x2a845e?0x0:_0x33f16a[_0x54bd('0x1b')];var _0x4c982d=_0x2a845e?_0x5d38bd[_0x54bd('0x1e')]:_0x33f16a[_0x54bd('0x1b')]+_0x33f16a[_0x54bd('0x1d')];var _0x43784f;if(_0x4c982d>=_0x4eeada){_0x4c982d=_0x4eeada;_0x43784f=0xc8;}else{_0x43784f=0xce;}_0x13d11d[_0x54bd('0x18')](_0x43784f);return _0x13d11d[_0x54bd('0x1f')](_0x54bd('0x20'),_0x571d72+'-'+_0x4c982d+'/'+_0x4eeada)[_0x54bd('0x1a')](_0x5d38bd);}return null;};}function patchUpdates(_0xe756b){return function(_0x2e60c7){try{jsonpatch['apply'](_0x2e60c7,_0xe756b,!![]);}catch(_0x38d3e3){return BPromise[_0x54bd('0x21')](_0x38d3e3);}return _0x2e60c7[_0x54bd('0x22')]();};}function saveUpdates(_0xee0d0c,_0x291925){return function(_0xddab90){if(_0xddab90){return _0xddab90[_0x54bd('0x23')](_0xee0d0c)[_0x54bd('0x24')](function(_0x2f1b3f){return _0x2f1b3f;});}return null;};}function removeEntity(_0x593a21,_0x4b7bdb){return function(_0x35a98b){if(_0x35a98b){return _0x35a98b[_0x54bd('0x25')]()[_0x54bd('0x24')](function(){_0x593a21[_0x54bd('0x18')](0xcc)[_0x54bd('0x19')]();});}};}function handleEntityNotFound(_0x401db5,_0x2a5918){return function(_0x423d03){if(!_0x423d03){_0x401db5['sendStatus'](0x194);}return _0x423d03;};}function handleError(_0x4cd554,_0x4c8430){_0x4c8430=_0x4c8430||0x1f4;return function(_0x18c8d0){logger[_0x54bd('0x26')](_0x18c8d0[_0x54bd('0x27')]);if(_0x18c8d0[_0x54bd('0x28')]){delete _0x18c8d0[_0x54bd('0x28')];}_0x4cd554[_0x54bd('0x18')](_0x4c8430)[_0x54bd('0x29')](_0x18c8d0);};}exports[_0x54bd('0x2a')]=function(_0x236ac2,_0x2e95e1){var _0x1ca3f8={},_0x3be22a={},_0x3b78b8={'count':0x0,'rows':[]};var _0x5834e8=_[_0x54bd('0x2b')](db[_0x54bd('0x2c')][_0x54bd('0x2d')],function(_0xbb865a){return{'name':_0xbb865a[_0x54bd('0x2e')],'type':_0xbb865a[_0x54bd('0x2f')][_0x54bd('0x30')]};});_0x3be22a[_0x54bd('0x31')]=_['differenceBy'](_[_0x54bd('0x2b')](_0x5834e8,_0x54bd('0x28')),['name']);_0x3be22a[_0x54bd('0x32')]=_[_0x54bd('0x33')](_0x236ac2[_0x54bd('0x32')]);_0x3be22a[_0x54bd('0x34')]=_[_0x54bd('0x35')](_0x3be22a[_0x54bd('0x31')],_0x3be22a[_0x54bd('0x32')]);_0x1ca3f8[_0x54bd('0x36')]=_[_0x54bd('0x35')](_0x3be22a[_0x54bd('0x31')],qs[_0x54bd('0x37')](_0x236ac2['query'][_0x54bd('0x37')]));_0x1ca3f8[_0x54bd('0x36')]=_0x1ca3f8[_0x54bd('0x36')]['length']?_0x1ca3f8['attributes']:_0x3be22a[_0x54bd('0x31')];if(!_0x236ac2[_0x54bd('0x32')][_0x54bd('0x38')]('nolimit')){_0x1ca3f8[_0x54bd('0x1d')]=qs[_0x54bd('0x1d')](_0x236ac2[_0x54bd('0x32')]['limit']);_0x1ca3f8[_0x54bd('0x1b')]=qs[_0x54bd('0x1b')](_0x236ac2['query'][_0x54bd('0x1b')]);}_0x1ca3f8[_0x54bd('0x39')]=qs['sort'](_0x236ac2[_0x54bd('0x32')][_0x54bd('0x3a')]);_0x1ca3f8[_0x54bd('0x3b')]=qs[_0x54bd('0x34')](_[_0x54bd('0x3c')](_0x236ac2[_0x54bd('0x32')],_0x3be22a[_0x54bd('0x34')]),_0x5834e8);if(_0x236ac2['query'][_0x54bd('0x3d')]){_0x1ca3f8[_0x54bd('0x3b')]=_[_0x54bd('0x3e')](_0x1ca3f8['where'],{'$or':_[_0x54bd('0x2b')](_0x5834e8,function(_0x5b916b){if(_0x5b916b[_0x54bd('0x2f')]!==_0x54bd('0x3f')){var _0x3efa33={};_0x3efa33[_0x5b916b[_0x54bd('0x28')]]={'$like':'%'+_0x236ac2[_0x54bd('0x32')]['filter']+'%'};return _0x3efa33;}})});}_0x1ca3f8=_[_0x54bd('0x3e')]({},_0x1ca3f8,_0x236ac2[_0x54bd('0x40')]);var _0x478d53={'where':_0x1ca3f8['where']};return db[_0x54bd('0x2c')][_0x54bd('0x1e')](_0x478d53)['then'](function(_0x4a3c2d){_0x3b78b8[_0x54bd('0x1e')]=_0x4a3c2d;if(_0x236ac2['query']['includeAll']){_0x1ca3f8[_0x54bd('0x41')]=[{'all':!![]}];}return db[_0x54bd('0x2c')]['findAll'](_0x1ca3f8);})[_0x54bd('0x24')](function(_0x3eb0c3){_0x3b78b8['rows']=_0x3eb0c3;return _0x3b78b8;})[_0x54bd('0x24')](respondWithFilteredResult(_0x2e95e1,_0x1ca3f8))['catch'](handleError(_0x2e95e1,null));};exports['show']=function(_0x1810be,_0x279c2f){var _0x3d89bf={'raw':!![],'where':{'id':_0x1810be[_0x54bd('0x42')]['id']}},_0x15b351={};_0x15b351['model']=_[_0x54bd('0x33')](db[_0x54bd('0x2c')][_0x54bd('0x2d')]);_0x15b351[_0x54bd('0x32')]=_['keys'](_0x1810be[_0x54bd('0x32')]);_0x15b351[_0x54bd('0x34')]=_[_0x54bd('0x35')](_0x15b351[_0x54bd('0x31')],_0x15b351[_0x54bd('0x32')]);_0x3d89bf['attributes']=_[_0x54bd('0x35')](_0x15b351['model'],qs[_0x54bd('0x37')](_0x1810be['query'][_0x54bd('0x37')]));_0x3d89bf['attributes']=_0x3d89bf[_0x54bd('0x36')][_0x54bd('0x43')]?_0x3d89bf['attributes']:_0x15b351['model'];if(_0x1810be[_0x54bd('0x32')][_0x54bd('0x44')]){_0x3d89bf[_0x54bd('0x41')]=[{'all':!![]}];}_0x3d89bf=_[_0x54bd('0x3e')]({},_0x3d89bf,_0x1810be['options']);return db[_0x54bd('0x2c')][_0x54bd('0x45')](_0x3d89bf)[_0x54bd('0x24')](handleEntityNotFound(_0x279c2f,null))[_0x54bd('0x24')](respondWithResult(_0x279c2f,null))['catch'](handleError(_0x279c2f,null));};exports[_0x54bd('0x23')]=function(_0x312373,_0x338eb6){if(_0x312373['body']['id']){delete _0x312373['body']['id'];}return db[_0x54bd('0x2c')][_0x54bd('0x45')]({'where':{'id':_0x312373[_0x54bd('0x42')]['id']}})[_0x54bd('0x24')](handleEntityNotFound(_0x338eb6,null))[_0x54bd('0x24')](saveUpdates(_0x312373[_0x54bd('0x46')],null))[_0x54bd('0x24')](respondWithResult(_0x338eb6,null))[_0x54bd('0x47')](handleError(_0x338eb6,null));};exports[_0x54bd('0x25')]=function(_0x130831,_0x158d6b){return db[_0x54bd('0x2c')]['find']({'where':{'id':_0x130831[_0x54bd('0x42')]['id']}})[_0x54bd('0x24')](handleEntityNotFound(_0x158d6b,null))[_0x54bd('0x24')](removeEntity(_0x158d6b,null))[_0x54bd('0x47')](handleError(_0x158d6b,null));};exports[_0x54bd('0x48')]=function(_0x4808da,_0x211610){var _0x25b450;return db[_0x54bd('0x49')][_0x54bd('0x4a')](function(_0x49c813){return db['CmCustomField'][_0x54bd('0x48')](_0x4808da[_0x54bd('0x46')],{'transaction':_0x49c813})[_0x54bd('0x24')](function(_0x46dda8){_0x25b450=_0x46dda8;var _0x259259={'type':db['Sequelize'][_0x54bd('0x4b')],'transaction':_0x49c813};switch(_0x4808da[_0x54bd('0x46')][_0x54bd('0x2f')]){case _0x54bd('0x4c'):_0x259259['type']=db[_0x54bd('0x4d')][_0x54bd('0x4b')];break;case _0x54bd('0x4e'):_0x259259[_0x54bd('0x2f')]=db['Sequelize']['INTEGER'];break;case _0x54bd('0x4f'):_0x259259['type']=db[_0x54bd('0x4d')]['BOOLEAN'];_0x259259['defaultValue']=![];break;default:}return db[_0x54bd('0x49')]['queryInterface'][_0x54bd('0x50')](_0x54bd('0x51'),util[_0x54bd('0x52')](_0x54bd('0x53'),_0x25b450['id']),_0x259259);})['then'](function(){return _0x25b450;});})[_0x54bd('0x24')](respondWithResult(_0x211610,0xc9))[_0x54bd('0x47')](handleError(_0x211610,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c88ef37..fd45e76 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 _0xf48b=['rimraf','./cmCustomField.attributes','define','cm_custom_fields','util','api','bluebird','request-promise','path'];(function(_0x72da61,_0x4d30b5){var _0x2cc185=function(_0x26e383){while(--_0x26e383){_0x72da61['push'](_0x72da61['shift']());}};_0x2cc185(++_0x4d30b5);}(_0xf48b,0x1ab));var _0xbf48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf48b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xbf48('0x0'));var logger=require('../../config/logger')(_0xbf48('0x1'));var moment=require('moment');var BPromise=require(_0xbf48('0x2'));var rp=require(_0xbf48('0x3'));var fs=require('fs');var path=require(_0xbf48('0x4'));var rimraf=require(_0xbf48('0x5'));var config=require('../../config/environment');var attributes=require(_0xbf48('0x6'));module['exports']=function(_0x2408af,_0x5f1796){return _0x2408af[_0xbf48('0x7')]('CmCustomField',attributes,{'tableName':_0xbf48('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x428d=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x4fa921,_0x42266c){var _0x3b65b6=function(_0x213d7e){while(--_0x213d7e){_0x4fa921['push'](_0x4fa921['shift']());}};_0x3b65b6(++_0x42266c);}(_0x428d,0x18b));var _0xd428=function(_0x45cfac,_0x13cc84){_0x45cfac=_0x45cfac-0x0;var _0x42f70b=_0x428d[_0x45cfac];return _0x42f70b;};'use strict';var _=require(_0xd428('0x0'));var util=require(_0xd428('0x1'));var logger=require('../../config/logger')(_0xd428('0x2'));var moment=require(_0xd428('0x3'));var BPromise=require(_0xd428('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd428('0x5'));var rimraf=require(_0xd428('0x6'));var config=require(_0xd428('0x7'));var attributes=require(_0xd428('0x8'));module['exports']=function(_0x2ea1b5,_0x4b2eb1){return _0x2ea1b5[_0xd428('0x9')](_0xd428('0xa'),attributes,{'tableName':_0xd428('0xb'),'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 d09fbc8..3b6d72f 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 _0x106e=['request','then','info','request\x20sent','debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x106e,0x182));var _0xe106=function(_0x2016ff,_0x364a39){_0x2016ff=_0x2016ff-0x0;var _0x1d3f02=_0x106e[_0x2016ff];return _0x1d3f02;};'use strict';var _=require(_0xe106('0x0'));var util=require(_0xe106('0x1'));var moment=require(_0xe106('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe106('0x3'));var db=require(_0xe106('0x4'))['db'];var utils=require(_0xe106('0x5'));var logger=require(_0xe106('0x6'))('rpc');var config=require(_0xe106('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe106('0x8')][_0xe106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x118699,_0x26a846,_0xb32567){return new BPromise(function(_0xa614b5,_0x5475e0){return client[_0xe106('0xa')](_0x118699,_0xb32567)[_0xe106('0xb')](function(_0xe54c88){logger[_0xe106('0xc')]('CmCustomField,\x20%s,\x20%s',_0x26a846,_0xe106('0xd'));logger[_0xe106('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x26a846,_0xe106('0xd'),JSON[_0xe106('0xf')](_0xe54c88));if(_0xe54c88[_0xe106('0x10')]){if(_0xe54c88['error'][_0xe106('0x11')]===0x1f4){logger['error'](_0xe106('0x12'),_0x26a846,_0xe54c88['error'][_0xe106('0x13')]);return _0x5475e0(_0xe54c88[_0xe106('0x10')]['message']);}logger[_0xe106('0x10')]('CmCustomField,\x20%s,\x20%s',_0x26a846,_0xe54c88[_0xe106('0x10')]['message']);return _0xa614b5(_0xe54c88['error'][_0xe106('0x13')]);}else{logger[_0xe106('0xc')](_0xe106('0x12'),_0x26a846,_0xe106('0xd'));_0xa614b5(_0xe54c88[_0xe106('0x14')][_0xe106('0x13')]);}})[_0xe106('0x15')](function(_0x126a4b){logger[_0xe106('0x10')]('CmCustomField,\x20%s,\x20%s',_0x26a846,_0x126a4b);_0x5475e0(_0x126a4b);});});} \ No newline at end of file +var _0xace3=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x1899a2,_0x1552e4){var _0x2a69b9=function(_0x17c1ec){while(--_0x17c1ec){_0x1899a2['push'](_0x1899a2['shift']());}};_0x2a69b9(++_0x1552e4);}(_0xace3,0x146));var _0x3ace=function(_0x396997,_0x1b3d6e){_0x396997=_0x396997-0x0;var _0x2b2cfb=_0xace3[_0x396997];return _0x2b2cfb;};'use strict';var _=require(_0x3ace('0x0'));var util=require('util');var moment=require(_0x3ace('0x1'));var BPromise=require(_0x3ace('0x2'));var rs=require(_0x3ace('0x3'));var fs=require('fs');var Redis=require(_0x3ace('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ace('0x5'));var logger=require(_0x3ace('0x6'))(_0x3ace('0x7'));var config=require(_0x3ace('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ace('0x9')][_0x3ace('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d864e,_0xa8afc1,_0x38b80f){return new BPromise(function(_0x4aad00,_0x109eed){return client[_0x3ace('0xb')](_0x3d864e,_0x38b80f)[_0x3ace('0xc')](function(_0x4012ed){logger[_0x3ace('0xd')](_0x3ace('0xe'),_0xa8afc1,_0x3ace('0xf'));logger['debug'](_0x3ace('0x10'),_0xa8afc1,_0x3ace('0xf'),JSON[_0x3ace('0x11')](_0x4012ed));if(_0x4012ed['error']){if(_0x4012ed['error'][_0x3ace('0x12')]===0x1f4){logger[_0x3ace('0x13')]('CmCustomField,\x20%s,\x20%s',_0xa8afc1,_0x4012ed[_0x3ace('0x13')]['message']);return _0x109eed(_0x4012ed[_0x3ace('0x13')]['message']);}logger[_0x3ace('0x13')](_0x3ace('0xe'),_0xa8afc1,_0x4012ed[_0x3ace('0x13')][_0x3ace('0x14')]);return _0x4aad00(_0x4012ed[_0x3ace('0x13')][_0x3ace('0x14')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0xa8afc1,'request\x20sent');_0x4aad00(_0x4012ed[_0x3ace('0x15')]['message']);}})[_0x3ace('0x16')](function(_0x353caf){logger['error'](_0x3ace('0xe'),_0xa8afc1,_0x353caf);_0x109eed(_0x353caf);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 9a71e19..3da3c07 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 _0x5379=['../../config/environment','isAuthenticated','get','/:id','show','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1263cc,_0x34b0a6){var _0x4132a0=function(_0x5ddd32){while(--_0x5ddd32){_0x1263cc['push'](_0x1263cc['shift']());}};_0x4132a0(++_0x34b0a6);}(_0x5379,0x1a2));var _0x9537=function(_0x5c4ab0,_0x548cac){_0x5c4ab0=_0x5c4ab0-0x0;var _0x435151=_0x5379[_0x5c4ab0];return _0x435151;};'use strict';var multer=require(_0x9537('0x0'));var util=require(_0x9537('0x1'));var path=require(_0x9537('0x2'));var timeout=require('connect-timeout');var express=require(_0x9537('0x3'));var router=express['Router']();var fs_extra=require(_0x9537('0x4'));var auth=require(_0x9537('0x5'));var interaction=require(_0x9537('0x6'));var config=require(_0x9537('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x9537('0x8')](),controller['index']);router[_0x9537('0x9')](_0x9537('0xa'),auth[_0x9537('0x8')](),controller[_0x9537('0xb')]);router['post']('/',auth[_0x9537('0x8')](),controller[_0x9537('0xc')]);router[_0x9537('0xd')](_0x9537('0xa'),auth['isAuthenticated'](),controller[_0x9537('0xe')]);router['delete']('/:id',auth[_0x9537('0x8')](),controller[_0x9537('0xf')]);module[_0x9537('0x10')]=router; \ No newline at end of file +var _0xa976=['post','create','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','isAuthenticated','index','get','show'];(function(_0x307467,_0x72e72){var _0x40280c=function(_0x5beb34){while(--_0x5beb34){_0x307467['push'](_0x307467['shift']());}};_0x40280c(++_0x72e72);}(_0xa976,0xd7));var _0x6a97=function(_0xe0095c,_0x17bff5){_0xe0095c=_0xe0095c-0x0;var _0x580e8=_0xa976[_0xe0095c];return _0x580e8;};'use strict';var multer=require(_0x6a97('0x0'));var util=require(_0x6a97('0x1'));var path=require('path');var timeout=require(_0x6a97('0x2'));var express=require(_0x6a97('0x3'));var router=express[_0x6a97('0x4')]();var fs_extra=require(_0x6a97('0x5'));var auth=require(_0x6a97('0x6'));var interaction=require(_0x6a97('0x7'));var config=require('../../config/environment');var controller=require(_0x6a97('0x8'));router['get']('/',auth[_0x6a97('0x9')](),controller[_0x6a97('0xa')]);router[_0x6a97('0xb')]('/:id',auth[_0x6a97('0x9')](),controller[_0x6a97('0xc')]);router[_0x6a97('0xd')]('/',auth[_0x6a97('0x9')](),controller[_0x6a97('0xe')]);router[_0x6a97('0xf')](_0x6a97('0x10'),auth[_0x6a97('0x9')](),controller['update']);router[_0x6a97('0x11')](_0x6a97('0x10'),auth['isAuthenticated'](),controller[_0x6a97('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e8e7df9..f1d03a7 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 _0x7b61=['exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue','sequelize'];(function(_0x1581f5,_0x235d79){var _0x2b26f0=function(_0x51bc79){while(--_0x51bc79){_0x1581f5['push'](_0x1581f5['shift']());}};_0x2b26f0(++_0x235d79);}(_0x7b61,0x131));var _0x17b6=function(_0x19bb5c,_0xcc7eaa){_0x19bb5c=_0x19bb5c-0x0;var _0x2efbaa=_0x7b61[_0x19bb5c];return _0x2efbaa;};'use strict';var moment=require('moment');var Sequelize=require(_0x17b6('0x0'));module[_0x17b6('0x1')]={'phone':{'type':Sequelize[_0x17b6('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x17b6('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x17b6('0x4')](_0x17b6('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x17b6('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x17b6('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17b6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x17b6('0x7')]},'priority':{'type':Sequelize[_0x17b6('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x17b6('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x17b6('0x6')],'unique':_0x17b6('0x8')},'ListId':{'type':Sequelize[_0x17b6('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x17b6('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x17b6('0x8')},'CampaignId':{'type':Sequelize[_0x17b6('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x17b6('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x17b6('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x17b6('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x17b6('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x17b6('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x41e7=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','exports','STRING'];(function(_0x174a2d,_0x44cf92){var _0x3a58c3=function(_0x43afaf){while(--_0x43afaf){_0x174a2d['push'](_0x174a2d['shift']());}};_0x3a58c3(++_0x44cf92);}(_0x41e7,0x165));var _0x741e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x41e7[_0x3947c9];return _0x2e7871;};'use strict';var moment=require('moment');var Sequelize=require(_0x741e('0x0'));module[_0x741e('0x1')]={'phone':{'type':Sequelize[_0x741e('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x741e('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x741e('0x4')],'defaultValue':moment()[_0x741e('0x5')](_0x741e('0x6'))},'countbusyretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x741e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x741e('0x7')](0x2)[_0x741e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x741e('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x741e('0x7')],'unique':_0x741e('0x9')},'UserId':{'type':Sequelize[_0x741e('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x741e('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x741e('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x741e('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x741e('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x741e('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 cd1de6e..bfaafd4 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 _0xf006=['where','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','CmHopperAdditionalPhone','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','hopperIds','priority','ASC','scheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','scheduledat','preview','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','../../components/parsers/qs','../../config/logger','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$gt','$gte','$lt','$ne','$not','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','sort'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0xf006,0x146));var _0x6f00=function(_0x47811d,_0x943776){_0x47811d=_0x47811d-0x0;var _0x5750df=_0xf006[_0x47811d];return _0x5750df;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x6f00('0x0'));var logger=require(_0x6f00('0x1'))('api');var shared=require(_0x6f00('0x2'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1c7a9e,_0x4f4466){_0x4f4466=_0x4f4466||0xc8;return function(_0x5039fb){if(_0x5039fb){return _0x1c7a9e[_0x6f00('0x3')](_0x4f4466)[_0x6f00('0x4')](_0x5039fb);}};}function respondWithFilteredResult(_0x141e71,_0x52c9a2){return function(_0x3c29ff){if(_0x3c29ff){var _0x4f918f=typeof _0x52c9a2[_0x6f00('0x5')]===_0x6f00('0x6')&&typeof _0x52c9a2[_0x6f00('0x7')]===_0x6f00('0x6');var _0x286d32=_0x3c29ff[_0x6f00('0x8')];var _0x44b63c=_0x4f918f?0x0:_0x52c9a2[_0x6f00('0x5')];var _0x2aa181=_0x4f918f?_0x3c29ff[_0x6f00('0x8')]:_0x52c9a2[_0x6f00('0x5')]+_0x52c9a2[_0x6f00('0x7')];var _0x723e6e;if(_0x2aa181>=_0x286d32){_0x2aa181=_0x286d32;_0x723e6e=0xc8;}else{_0x723e6e=0xce;}_0x141e71['status'](_0x723e6e);return _0x141e71[_0x6f00('0x9')](_0x6f00('0xa'),_0x44b63c+'-'+_0x2aa181+'/'+_0x286d32)[_0x6f00('0x4')](_0x3c29ff);}return null;};}function saveUpdates(_0x36a2ec,_0x289fe9){return function(_0x5e3264){if(_0x5e3264){return _0x5e3264[_0x6f00('0xb')](_0x36a2ec)['then'](function(_0x30b10e){return _0x30b10e;});}return null;};}function handleEntityNotFound(_0x5047f5,_0x324e67){return function(_0x220e68){if(!_0x220e68){_0x5047f5[_0x6f00('0xc')](0x194);}return _0x220e68;};}function handleError(_0x33f3a2,_0xa6e7a1){_0xa6e7a1=_0xa6e7a1||0x1f4;return function(_0x411203){logger[_0x6f00('0xd')](_0x411203[_0x6f00('0xe')]);if(_0x411203[_0x6f00('0xf')]){delete _0x411203['name'];}_0x33f3a2[_0x6f00('0x3')](_0xa6e7a1)['send'](_0x411203);};}exports['index']=function(_0x7c047e,_0x6cf83f){var _0x466c7c={},_0x340f78={},_0x13f09f={'count':0x0,'rows':[]};var _0x27e466=_[_0x6f00('0x10')](db[_0x6f00('0x11')][_0x6f00('0x12')],function(_0x198cc7){return{'name':_0x198cc7[_0x6f00('0x13')],'type':_0x198cc7[_0x6f00('0x14')]['key']};});_0x340f78['model']=_['map'](_0x27e466,_0x6f00('0xf'));_0x340f78[_0x6f00('0x15')]=_[_0x6f00('0x16')](_0x7c047e['query']);_0x340f78[_0x6f00('0x17')]=_[_0x6f00('0x18')](_0x340f78[_0x6f00('0x19')],_0x340f78[_0x6f00('0x15')]);_0x340f78[_0x6f00('0x17')]=_[_0x6f00('0x1a')](_0x340f78[_0x6f00('0x17')],[_0x6f00('0x1b'),'$or',_0x6f00('0x1c'),_0x6f00('0x1d'),_0x6f00('0x1e'),'$lte',_0x6f00('0x1f'),'$eq',_0x6f00('0x20'),'$between',_0x6f00('0x21'),_0x6f00('0x22'),_0x6f00('0x23'),_0x6f00('0x24'),_0x6f00('0x25'),'$iLike',_0x6f00('0x26'),_0x6f00('0x24'),_0x6f00('0x27'),_0x6f00('0x28'),_0x6f00('0x29'),_0x6f00('0x2a')]);_0x466c7c[_0x6f00('0x2b')]=_[_0x6f00('0x18')](_0x340f78[_0x6f00('0x19')],qs[_0x6f00('0x2c')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2c')]));_0x466c7c[_0x6f00('0x2b')]=_0x466c7c[_0x6f00('0x2b')]['length']?_0x466c7c['attributes']:_0x340f78['model'];if(!_0x7c047e['query']['hasOwnProperty']('nolimit')){_0x466c7c[_0x6f00('0x7')]=qs['limit'](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x7')]);_0x466c7c[_0x6f00('0x5')]=qs[_0x6f00('0x5')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x5')]);}_0x466c7c['order']=qs[_0x6f00('0x2d')](_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2d')]);_0x466c7c[_0x6f00('0x2e')]=qs[_0x6f00('0x17')](_['pick'](_0x7c047e['query'],_0x340f78['filters']),_0x27e466);if(_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2f')]){_0x466c7c[_0x6f00('0x2e')]=_[_0x6f00('0x30')](_0x466c7c[_0x6f00('0x2e')],{'$or':_['map'](_0x27e466,function(_0xf6f5e9){if(_0xf6f5e9[_0x6f00('0x14')]!==_0x6f00('0x31')){var _0x4646dc={};_0x4646dc[_0xf6f5e9[_0x6f00('0xf')]]={'$like':'%'+_0x7c047e[_0x6f00('0x15')][_0x6f00('0x2f')]+'%'};return _0x4646dc;}})});}_0x466c7c=_['merge']({},_0x466c7c,_0x7c047e[_0x6f00('0x32')]);var _0x1dee52={'where':_0x466c7c[_0x6f00('0x2e')]};return db['CmHopper'][_0x6f00('0x8')](_0x1dee52)[_0x6f00('0x33')](function(_0x2da2e7){_0x13f09f['count']=_0x2da2e7;if(_0x7c047e[_0x6f00('0x15')]['includeAll']){_0x466c7c[_0x6f00('0x34')]=[{'all':!![]}];}return db['CmHopper'][_0x6f00('0x35')](_0x466c7c);})[_0x6f00('0x33')](function(_0x37c791){_0x13f09f[_0x6f00('0x36')]=_0x37c791;return _0x13f09f;})['then'](respondWithFilteredResult(_0x6cf83f,_0x466c7c))[_0x6f00('0x37')](handleError(_0x6cf83f,null));};exports['show']=function(_0x231bd6,_0x5bc755){var _0x7785e1={'raw':!![],'where':{'id':_0x231bd6[_0x6f00('0x38')]['id']}},_0x2f1ef1={};_0x2f1ef1[_0x6f00('0x19')]=_['keys'](db['CmHopper'][_0x6f00('0x12')]);_0x2f1ef1['query']=_[_0x6f00('0x16')](_0x231bd6[_0x6f00('0x15')]);_0x2f1ef1['filters']=_[_0x6f00('0x18')](_0x2f1ef1['model'],_0x2f1ef1['query']);_0x7785e1[_0x6f00('0x2b')]=_[_0x6f00('0x18')](_0x2f1ef1[_0x6f00('0x19')],qs[_0x6f00('0x2c')](_0x231bd6['query'][_0x6f00('0x2c')]));_0x7785e1[_0x6f00('0x2b')]=_0x7785e1[_0x6f00('0x2b')][_0x6f00('0x39')]?_0x7785e1[_0x6f00('0x2b')]:_0x2f1ef1[_0x6f00('0x19')];if(_0x231bd6['query'][_0x6f00('0x3a')]){_0x7785e1[_0x6f00('0x34')]=[{'all':!![]}];}_0x7785e1=_[_0x6f00('0x30')]({},_0x7785e1,_0x231bd6[_0x6f00('0x32')]);return db[_0x6f00('0x11')][_0x6f00('0x3b')](_0x7785e1)['then'](handleEntityNotFound(_0x5bc755,null))[_0x6f00('0x33')](respondWithResult(_0x5bc755,null))[_0x6f00('0x37')](handleError(_0x5bc755,null));};exports[_0x6f00('0x3c')]=function(_0x56b7e6,_0x2e6cc6){return db['CmHopper'][_0x6f00('0x3c')](_0x56b7e6[_0x6f00('0x3d')],{})['then'](respondWithResult(_0x2e6cc6,0xc9))[_0x6f00('0x37')](handleError(_0x2e6cc6,null));};exports['update']=function(_0xadd6d8,_0x3d4158){if(_0xadd6d8[_0x6f00('0x3d')]['id']){delete _0xadd6d8[_0x6f00('0x3d')]['id'];}return db['CmHopper'][_0x6f00('0x3b')]({'where':{'id':_0xadd6d8['params']['id']}})[_0x6f00('0x33')](handleEntityNotFound(_0x3d4158,null))['then'](saveUpdates(_0xadd6d8[_0x6f00('0x3d')],null))[_0x6f00('0x33')](respondWithResult(_0x3d4158,null))[_0x6f00('0x37')](handleError(_0x3d4158,null));};exports[_0x6f00('0x3e')]=function(_0x470ff3,_0x3472f0){return db[_0x6f00('0x11')][_0x6f00('0x3e')]()['then'](respondWithResult(_0x3472f0,null))[_0x6f00('0x37')](handleError(_0x3472f0,null));};exports['destroy']=function(_0x265666,_0x31fb17){var _0x27f38b;var _0x5eec08=_0x265666['params']['id'];return db[_0x6f00('0x11')][_0x6f00('0x3b')]({'where':{'id':_0x265666['params']['id']}})[_0x6f00('0x33')](handleEntityNotFound(_0x31fb17,null))['then'](function(_0x28130d){if(_0x28130d){return _0x28130d['destroy']()[_0x6f00('0x33')](function(_0x222b4c){return _0x222b4c;});}})['then'](function(_0x52ee5a){_0x27f38b=_0x52ee5a;if(_0x52ee5a){if(_0x52ee5a[_0x6f00('0x3f')]||_0x52ee5a[_0x6f00('0x40')]){return db[_0x52ee5a['VoiceQueueId']?_0x6f00('0x41'):'Campaign'][_0x6f00('0x3b')]({'where':{'id':_0x52ee5a[_0x6f00('0x3f')]?_0x52ee5a[_0x6f00('0x3f')]:_0x52ee5a[_0x6f00('0x40')]},'attributes':['id',_0x6f00('0xf')],'raw':!![]});}}})[_0x6f00('0x33')](function(_0x25b284){var _0x9933be={};if(_0x25b284){_[_0x6f00('0x30')](_0x9933be,_[_0x6f00('0x42')](_0x27f38b[_0x6f00('0x43')],[_0x6f00('0x44'),_0x6f00('0x45'),'id']));_0x9933be[_0x6f00('0x46')]=0x15;_0x9933be[_0x6f00('0x47')]=_0x6f00('0x48');_0x9933be[_0x6f00('0x49')]=_0x25b284[_0x6f00('0xf')];_0x9933be[_0x6f00('0x4a')]=_0x265666[_0x6f00('0x4b')]['name'];_0x9933be['UserId']=_0x265666[_0x6f00('0x4b')]['id'];_0x9933be['deleted']=!![];_0x9933be[_0x6f00('0x4c')]=moment()[_0x6f00('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x9933be[_0x6f00('0x4e')]=_0x27f38b[_0x6f00('0x4f')];_0x9933be[_0x6f00('0x50')]=_0x27f38b['VoiceQueueId']?_0x6f00('0x51'):'ivr';return db[_0x6f00('0x52')][_0x6f00('0x3b')]({'where':{'id':_0x9933be['ContactId']},'attributes':[_0x6f00('0x53'),_0x6f00('0x54')]})[_0x6f00('0x33')](function(_0x111fd4){if(!_[_0x6f00('0x55')](_0x31fb17)&&!_[_0x6f00('0x55')](_0x111fd4[_0x6f00('0x53')])){_0x9933be['calleridname']=_0x111fd4['firstName'];if(!_['isNil'](_0x111fd4['lastName'])){_0x9933be[_0x6f00('0x56')]+='\x20'+_0x111fd4[_0x6f00('0x54')];}}})['finally'](function(){return db['CmHopperFinal'][_0x6f00('0x3c')](_0x9933be);});}})[_0x6f00('0x33')](function(_0x33bee1){return db[_0x6f00('0x57')]['destroy']({'where':{'CmHopperId':_0x5eec08}});})[_0x6f00('0x33')](function(){return _0x31fb17['status'](0xcc)['end']();})[_0x6f00('0x37')](handleError(_0x31fb17,null));};exports[_0x6f00('0x58')]=function(_0x754f94,_0x11082f){var _0x24c6c4=[];return db['CmContact'][_0x6f00('0x3e')]()[_0x6f00('0x33')](function(_0x41a9b9){_0x24c6c4=_[_0x6f00('0x16')](_0x41a9b9);return _0x754f94['user']['getVoiceQueues']({'where':{'type':_0x6f00('0x59'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x6f00('0x5a'),_0x6f00('0x5b')],'raw':!![]});})[_0x6f00('0x33')](function(_0x13de6a){if(_0x13de6a&&_0x13de6a['length']){return db['sequelize'][_0x6f00('0x5c')](function(_0x2fcee0){var _0x4ff6dc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6f00('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6f00('0x10')](_0x13de6a,'id')},'$or':[{'UserId':null},{'UserId':_0x754f94[_0x6f00('0x4b')]['id']}]};var _0x2b2334={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x13de6a)[_0x6f00('0x2f')]([_0x6f00('0x5b'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x754f94['user']['id']}]};var _0x1e4ae3={'$or':[_0x4ff6dc,_0x2b2334]};var _0x3ca0af=[];if(_0x754f94['body']['direction']&&_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5d')]==='prev'){if(!_['isEmpty'](_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')])){_0x1e4ae3['id']={'$in':_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')]};}_0x3ca0af=[[_0x6f00('0x5f'),_0x6f00('0x60')],[_0x6f00('0x61'),_0x13de6a[0x0][_0x6f00('0x5a')]==='ASC'?'DESC':_0x6f00('0x60')],db[_0x6f00('0x62')][_0x6f00('0x63')](_0x6f00('0x64')),['id',_0x6f00('0x65')]];}else{if(!_[_0x6f00('0x66')](_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')])){_0x1e4ae3['id']={'$notIn':_0x754f94[_0x6f00('0x3d')][_0x6f00('0x5e')]};}_0x3ca0af=[[_0x6f00('0x5f'),_0x6f00('0x65')],[_0x6f00('0x61'),_0x13de6a[0x0][_0x6f00('0x5a')]],db[_0x6f00('0x62')][_0x6f00('0x63')](_0x6f00('0x67')),['id','ASC']];}return db['CmHopper'][_0x6f00('0x68')]({'attributes':['id','scheduledat',_0x6f00('0x4f'),_0x6f00('0x69')],'where':_0x1e4ae3,'order':_0x3ca0af,'transaction':_0x2fcee0,'lock':_0x2fcee0[_0x6f00('0x6a')][_0x6f00('0x6b')],'include':[{'model':db[_0x6f00('0x52')],'as':'Contact','attributes':_0x24c6c4,'include':[{'model':db[_0x6f00('0x6c')],'as':_0x6f00('0x6d'),'attributes':['id',_0x6f00('0xf')]}]},{'model':db[_0x6f00('0x6e')],'as':_0x6f00('0x6f'),'attributes':['id',_0x6f00('0xf')]},{'model':db[_0x6f00('0x41')],'as':_0x6f00('0x70'),'attributes':['id',_0x6f00('0xf'),_0x6f00('0x71')]}]})[_0x6f00('0x33')](function(_0x58a7b8){if(_0x58a7b8){return _0x58a7b8[_0x6f00('0xb')]({'UserId':_0x754f94[_0x6f00('0x4b')]['id']},{'transaction':_0x2fcee0});}});});}})[_0x6f00('0x33')](handleEntityNotFound(_0x11082f,null))['then'](respondWithResult(_0x11082f,null))['catch'](handleError(_0x11082f,null));};exports[_0x6f00('0x72')]=function(_0x23c20f,_0x1e5182,_0x1d24d0){var _0x5a9b42=[];var _0x564625=_0x23c20f['params']['id'];var _0x5089a5=_0x23c20f[_0x6f00('0x4b')]['id'];return db[_0x6f00('0x52')][_0x6f00('0x3e')]()[_0x6f00('0x33')](function(_0x3ba557){_0x5a9b42=_['keys'](_0x3ba557);return db[_0x6f00('0x62')][_0x6f00('0x5c')](function(_0x538143){const _0xf8a1b6={'id':_0x564625};return db[_0x6f00('0x11')][_0x6f00('0x68')]({'attributes':['id',_0x6f00('0x73'),_0x6f00('0x69')],'where':_0xf8a1b6,'transaction':_0x538143,'lock':_0x538143[_0x6f00('0x6a')][_0x6f00('0x6b')],'include':[{'model':db[_0x6f00('0x52')],'as':'Contact','attributes':_0x5a9b42,'include':[{'model':db[_0x6f00('0x6c')],'as':'Company','attributes':['id',_0x6f00('0xf')]}]},{'model':db[_0x6f00('0x6e')],'as':_0x6f00('0x6f'),'attributes':['id',_0x6f00('0xf')]},{'model':db[_0x6f00('0x41')],'as':_0x6f00('0x70'),'attributes':['id',_0x6f00('0xf'),_0x6f00('0x71')]}]})[_0x6f00('0x33')](function(_0x1c2685){if(_0x1c2685){return _0x1c2685[_0x6f00('0xb')]({'UserId':_0x5089a5},{'transaction':_0x538143});}});});})[_0x6f00('0x33')](handleEntityNotFound(_0x1e5182,null))[_0x6f00('0x33')](respondWithResult(_0x1e5182,null))[_0x6f00('0x37')](handleError(_0x1e5182,null));};exports['getOpenContacts']=function(_0x3ba021,_0xdfa8ff){return _0x3ba021[_0x6f00('0x4b')]['getVoiceQueues']({'where':{'type':_0x6f00('0x59'),'dialActive':!![],'dialMethod':_0x6f00('0x74')},'attributes':['id'],'raw':!![]})['then'](function(_0x30f620){if(_0x30f620&&_0x30f620[_0x6f00('0x39')]){return db[_0x6f00('0x11')][_0x6f00('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x30f620,'id')},'$or':[{'UserId':null},{'UserId':_0x3ba021[_0x6f00('0x4b')]['id']}]}});}return 0x0;})[_0x6f00('0x33')](function(_0x26fd77){if(!_[_0x6f00('0x55')](_0x26fd77)&&_['isNumber'](_0x26fd77)){return _0xdfa8ff[_0x6f00('0x3')](0xc8)[_0x6f00('0x4')]({'contacts':_0x26fd77});}else{logger[_0x6f00('0xd')](_0x6f00('0x75'),_0x6f00('0x76'),0x194,_0x6f00('0x77'));_0xdfa8ff['sendStatus'](0x194);}})['catch'](handleError(_0xdfa8ff,null));};exports[_0x6f00('0x78')]=function(_0x179fb7,_0x2f97cd){var _0x1abd35=shared[_0x6f00('0x79')];var _0x4c9db7=[];_[_0x6f00('0x10')](_0x1abd35,function(_0x5e4928){_0x4c9db7[_0x6f00('0x7a')]({'id':_0x5e4928[_0x6f00('0xf')],'name':_0x5e4928['name'],'utcOffset':_0x5e4928[_0x6f00('0x7b')]});});return _0x2f97cd[_0x6f00('0x3')](0xc8)['json']({'tz':_0x4c9db7});};exports['getTimezone']=function(_0x340f76,_0x422649){var _0x25d7da=shared[_0x6f00('0x79')];var _0x1fb213={};if(!_[_0x6f00('0x55')](_0x25d7da[_0x340f76[_0x6f00('0x3d')]['id']]))_0x1fb213=_0x25d7da[_0x340f76['body']['id']];return _0x422649[_0x6f00('0x3')](0xc8)[_0x6f00('0x4')](_0x1fb213);}; \ No newline at end of file +var _0x4c4e=['options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','scheduledAt','sequelize','findOne','scheduledat','phone','LOCK','UPDATE','Company','CmList','List','Queue','dialActive','recallme','Contact','getOpenContacts','getVoiceQueues','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','then','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$gt','$lt','$ne','$not','$notBetween','$iLike','$overlap','$contains','attributes','fields','length','sort','where','pick','filter','merge'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0x4c4e,0x152));var _0xe4c4=function(_0x9a2a4e,_0x17df82){_0x9a2a4e=_0x9a2a4e-0x0;var _0x3b998b=_0x4c4e[_0x9a2a4e];return _0x3b998b;};'use strict';var moment=require(_0xe4c4('0x0'));var _=require('lodash');var qs=require(_0xe4c4('0x1'));var logger=require(_0xe4c4('0x2'))(_0xe4c4('0x3'));var shared=require('../../config/environment');var db=require(_0xe4c4('0x4'))['db'];function respondWithResult(_0x7d7655,_0x1a4483){_0x1a4483=_0x1a4483||0xc8;return function(_0x4cd652){if(_0x4cd652){return _0x7d7655[_0xe4c4('0x5')](_0x1a4483)['json'](_0x4cd652);}};}function respondWithFilteredResult(_0x177732,_0x1a12a6){return function(_0x262b64){if(_0x262b64){var _0xad105=typeof _0x1a12a6[_0xe4c4('0x6')]===_0xe4c4('0x7')&&typeof _0x1a12a6[_0xe4c4('0x8')]===_0xe4c4('0x7');var _0x4c953c=_0x262b64['count'];var _0x31f879=_0xad105?0x0:_0x1a12a6[_0xe4c4('0x6')];var _0x27ad42=_0xad105?_0x262b64[_0xe4c4('0x9')]:_0x1a12a6[_0xe4c4('0x6')]+_0x1a12a6[_0xe4c4('0x8')];var _0x50264f;if(_0x27ad42>=_0x4c953c){_0x27ad42=_0x4c953c;_0x50264f=0xc8;}else{_0x50264f=0xce;}_0x177732[_0xe4c4('0x5')](_0x50264f);return _0x177732[_0xe4c4('0xa')](_0xe4c4('0xb'),_0x31f879+'-'+_0x27ad42+'/'+_0x4c953c)[_0xe4c4('0xc')](_0x262b64);}return null;};}function saveUpdates(_0x50bfab,_0x262083){return function(_0x115802){if(_0x115802){return _0x115802['update'](_0x50bfab)[_0xe4c4('0xd')](function(_0x1a44e5){return _0x1a44e5;});}return null;};}function handleEntityNotFound(_0x5aa89b,_0x42ce9e){return function(_0x29766a){if(!_0x29766a){_0x5aa89b['sendStatus'](0x194);}return _0x29766a;};}function handleError(_0x307aa8,_0x465c9b){_0x465c9b=_0x465c9b||0x1f4;return function(_0x26ea05){logger[_0xe4c4('0xe')](_0x26ea05[_0xe4c4('0xf')]);if(_0x26ea05[_0xe4c4('0x10')]){delete _0x26ea05[_0xe4c4('0x10')];}_0x307aa8[_0xe4c4('0x5')](_0x465c9b)[_0xe4c4('0x11')](_0x26ea05);};}exports[_0xe4c4('0x12')]=function(_0x23b7e6,_0x42242c){var _0x3820c7={},_0x43a9ce={},_0x376585={'count':0x0,'rows':[]};var _0x5a32b5=_[_0xe4c4('0x13')](db[_0xe4c4('0x14')][_0xe4c4('0x15')],function(_0x317cc8){return{'name':_0x317cc8['fieldName'],'type':_0x317cc8[_0xe4c4('0x16')][_0xe4c4('0x17')]};});_0x43a9ce[_0xe4c4('0x18')]=_[_0xe4c4('0x13')](_0x5a32b5,_0xe4c4('0x10'));_0x43a9ce[_0xe4c4('0x19')]=_[_0xe4c4('0x1a')](_0x23b7e6[_0xe4c4('0x19')]);_0x43a9ce[_0xe4c4('0x1b')]=_[_0xe4c4('0x1c')](_0x43a9ce[_0xe4c4('0x18')],_0x43a9ce[_0xe4c4('0x19')]);_0x43a9ce[_0xe4c4('0x1b')]=_[_0xe4c4('0x1d')](_0x43a9ce[_0xe4c4('0x1b')],['$and','$or',_0xe4c4('0x1e'),'$gte',_0xe4c4('0x1f'),'$lte',_0xe4c4('0x20'),'$eq',_0xe4c4('0x21'),'$between',_0xe4c4('0x22'),'$in','$notIn','$like','$notLike',_0xe4c4('0x23'),'$notILike','$like',_0xe4c4('0x24'),_0xe4c4('0x25'),'$contained','$any']);_0x3820c7[_0xe4c4('0x26')]=_[_0xe4c4('0x1c')](_0x43a9ce['model'],qs[_0xe4c4('0x27')](_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x27')]));_0x3820c7['attributes']=_0x3820c7['attributes'][_0xe4c4('0x28')]?_0x3820c7[_0xe4c4('0x26')]:_0x43a9ce[_0xe4c4('0x18')];if(!_0x23b7e6[_0xe4c4('0x19')]['hasOwnProperty']('nolimit')){_0x3820c7[_0xe4c4('0x8')]=qs[_0xe4c4('0x8')](_0x23b7e6['query'][_0xe4c4('0x8')]);_0x3820c7[_0xe4c4('0x6')]=qs[_0xe4c4('0x6')](_0x23b7e6['query'][_0xe4c4('0x6')]);}_0x3820c7['order']=qs[_0xe4c4('0x29')](_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x29')]);_0x3820c7[_0xe4c4('0x2a')]=qs[_0xe4c4('0x1b')](_[_0xe4c4('0x2b')](_0x23b7e6[_0xe4c4('0x19')],_0x43a9ce[_0xe4c4('0x1b')]),_0x5a32b5);if(_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x2c')]){_0x3820c7[_0xe4c4('0x2a')]=_[_0xe4c4('0x2d')](_0x3820c7['where'],{'$or':_[_0xe4c4('0x13')](_0x5a32b5,function(_0x25eb81){if(_0x25eb81[_0xe4c4('0x16')]!=='VIRTUAL'){var _0xac6cb4={};_0xac6cb4[_0x25eb81[_0xe4c4('0x10')]]={'$like':'%'+_0x23b7e6[_0xe4c4('0x19')]['filter']+'%'};return _0xac6cb4;}})});}_0x3820c7=_[_0xe4c4('0x2d')]({},_0x3820c7,_0x23b7e6[_0xe4c4('0x2e')]);var _0x4a3644={'where':_0x3820c7[_0xe4c4('0x2a')]};return db[_0xe4c4('0x14')][_0xe4c4('0x9')](_0x4a3644)[_0xe4c4('0xd')](function(_0x44f4eb){_0x376585[_0xe4c4('0x9')]=_0x44f4eb;if(_0x23b7e6[_0xe4c4('0x19')]['includeAll']){_0x3820c7[_0xe4c4('0x2f')]=[{'all':!![]}];}return db[_0xe4c4('0x14')][_0xe4c4('0x30')](_0x3820c7);})[_0xe4c4('0xd')](function(_0x4c5551){_0x376585[_0xe4c4('0x31')]=_0x4c5551;return _0x376585;})[_0xe4c4('0xd')](respondWithFilteredResult(_0x42242c,_0x3820c7))['catch'](handleError(_0x42242c,null));};exports[_0xe4c4('0x32')]=function(_0x185959,_0x4db15d){var _0x433f0c={'raw':!![],'where':{'id':_0x185959[_0xe4c4('0x33')]['id']}},_0x3cd4d3={};_0x3cd4d3[_0xe4c4('0x18')]=_[_0xe4c4('0x1a')](db[_0xe4c4('0x14')][_0xe4c4('0x15')]);_0x3cd4d3[_0xe4c4('0x19')]=_[_0xe4c4('0x1a')](_0x185959[_0xe4c4('0x19')]);_0x3cd4d3[_0xe4c4('0x1b')]=_[_0xe4c4('0x1c')](_0x3cd4d3['model'],_0x3cd4d3[_0xe4c4('0x19')]);_0x433f0c[_0xe4c4('0x26')]=_[_0xe4c4('0x1c')](_0x3cd4d3[_0xe4c4('0x18')],qs[_0xe4c4('0x27')](_0x185959[_0xe4c4('0x19')]['fields']));_0x433f0c[_0xe4c4('0x26')]=_0x433f0c['attributes'][_0xe4c4('0x28')]?_0x433f0c[_0xe4c4('0x26')]:_0x3cd4d3[_0xe4c4('0x18')];if(_0x185959[_0xe4c4('0x19')][_0xe4c4('0x34')]){_0x433f0c['include']=[{'all':!![]}];}_0x433f0c=_['merge']({},_0x433f0c,_0x185959[_0xe4c4('0x2e')]);return db[_0xe4c4('0x14')][_0xe4c4('0x35')](_0x433f0c)['then'](handleEntityNotFound(_0x4db15d,null))[_0xe4c4('0xd')](respondWithResult(_0x4db15d,null))[_0xe4c4('0x36')](handleError(_0x4db15d,null));};exports[_0xe4c4('0x37')]=function(_0x36e7b1,_0x54e073){return db[_0xe4c4('0x14')][_0xe4c4('0x37')](_0x36e7b1[_0xe4c4('0x38')],{})[_0xe4c4('0xd')](respondWithResult(_0x54e073,0xc9))[_0xe4c4('0x36')](handleError(_0x54e073,null));};exports[_0xe4c4('0x39')]=function(_0x1eda5e,_0x176712){if(_0x1eda5e[_0xe4c4('0x38')]['id']){delete _0x1eda5e['body']['id'];}return db[_0xe4c4('0x14')]['find']({'where':{'id':_0x1eda5e[_0xe4c4('0x33')]['id']}})[_0xe4c4('0xd')](handleEntityNotFound(_0x176712,null))[_0xe4c4('0xd')](saveUpdates(_0x1eda5e[_0xe4c4('0x38')],null))[_0xe4c4('0xd')](respondWithResult(_0x176712,null))[_0xe4c4('0x36')](handleError(_0x176712,null));};exports[_0xe4c4('0x3a')]=function(_0xeb6432,_0x36f8ad){return db[_0xe4c4('0x14')][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](respondWithResult(_0x36f8ad,null))[_0xe4c4('0x36')](handleError(_0x36f8ad,null));};exports[_0xe4c4('0x3b')]=function(_0x535bcc,_0x4922f5){var _0xe0e351;var _0x198961=_0x535bcc['params']['id'];return db[_0xe4c4('0x14')][_0xe4c4('0x35')]({'where':{'id':_0x535bcc[_0xe4c4('0x33')]['id']}})[_0xe4c4('0xd')](handleEntityNotFound(_0x4922f5,null))[_0xe4c4('0xd')](function(_0x5587b2){if(_0x5587b2){return _0x5587b2[_0xe4c4('0x3b')]()[_0xe4c4('0xd')](function(_0x4f6e03){return _0x4f6e03;});}})[_0xe4c4('0xd')](function(_0x24b0e7){_0xe0e351=_0x24b0e7;if(_0x24b0e7){if(_0x24b0e7['VoiceQueueId']||_0x24b0e7[_0xe4c4('0x3c')]){return db[_0x24b0e7['VoiceQueueId']?_0xe4c4('0x3d'):_0xe4c4('0x3e')][_0xe4c4('0x35')]({'where':{'id':_0x24b0e7[_0xe4c4('0x3f')]?_0x24b0e7[_0xe4c4('0x3f')]:_0x24b0e7['CampaignId']},'attributes':['id',_0xe4c4('0x10')],'raw':!![]});}}})[_0xe4c4('0xd')](function(_0x33bcec){var _0x2350d7={};if(_0x33bcec){_[_0xe4c4('0x2d')](_0x2350d7,_[_0xe4c4('0x40')](_0xe0e351[_0xe4c4('0x41')],[_0xe4c4('0x42'),_0xe4c4('0x43'),'id']));_0x2350d7[_0xe4c4('0x44')]=0x15;_0x2350d7[_0xe4c4('0x45')]=_0xe4c4('0x46');_0x2350d7[_0xe4c4('0x47')]=_0x33bcec[_0xe4c4('0x10')];_0x2350d7[_0xe4c4('0x48')]=_0x535bcc[_0xe4c4('0x49')]['name'];_0x2350d7[_0xe4c4('0x4a')]=_0x535bcc[_0xe4c4('0x49')]['id'];_0x2350d7[_0xe4c4('0x46')]=!![];_0x2350d7['deletedat']=moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'));_0x2350d7[_0xe4c4('0x4d')]=_0xe0e351['phone'];_0x2350d7[_0xe4c4('0x4e')]=_0xe0e351['VoiceQueueId']?_0xe4c4('0x4f'):_0xe4c4('0x50');return db[_0xe4c4('0x51')]['find']({'where':{'id':_0x2350d7['ContactId']},'attributes':[_0xe4c4('0x52'),_0xe4c4('0x53')]})[_0xe4c4('0xd')](function(_0x5edcae){if(!_[_0xe4c4('0x54')](_0x4922f5)&&!_['isNil'](_0x5edcae['firstName'])){_0x2350d7['calleridname']=_0x5edcae['firstName'];if(!_[_0xe4c4('0x54')](_0x5edcae[_0xe4c4('0x53')])){_0x2350d7[_0xe4c4('0x55')]+='\x20'+_0x5edcae[_0xe4c4('0x53')];}}})[_0xe4c4('0x56')](function(){return db[_0xe4c4('0x57')]['create'](_0x2350d7);});}})[_0xe4c4('0xd')](function(_0x44eb3b){return db[_0xe4c4('0x58')][_0xe4c4('0x3b')]({'where':{'CmHopperId':_0x198961}});})[_0xe4c4('0xd')](function(){return _0x4922f5[_0xe4c4('0x5')](0xcc)['end']();})['catch'](handleError(_0x4922f5,null));};exports[_0xe4c4('0x59')]=function(_0x6f374e,_0x1986ab){var _0x3c8e44=[];return db[_0xe4c4('0x51')][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](function(_0x24e1a2){_0x3c8e44=_[_0xe4c4('0x1a')](_0x24e1a2);return _0x6f374e['user']['getVoiceQueues']({'where':{'type':_0xe4c4('0x5a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xe4c4('0x5b'),_0xe4c4('0x5c')],'raw':!![]});})[_0xe4c4('0xd')](function(_0x58f2dd){if(_0x58f2dd&&_0x58f2dd[_0xe4c4('0x28')]){return db['sequelize'][_0xe4c4('0x5d')](function(_0x56ead3){var _0x5d6c0a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'))},'VoiceQueueId':{'$in':_[_0xe4c4('0x13')](_0x58f2dd,'id')},'$or':[{'UserId':null},{'UserId':_0x6f374e['user']['id']}]};var _0x57e38e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x58f2dd)['filter']([_0xe4c4('0x5c'),0x0])[_0xe4c4('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x6f374e[_0xe4c4('0x49')]['id']}]};var _0x3850da={'$or':[_0x5d6c0a,_0x57e38e]};var _0x11115a=[];if(_0x6f374e['body']['direction']&&_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x5e')]===_0xe4c4('0x5f')){if(!_[_0xe4c4('0x60')](_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')])){_0x3850da['id']={'$in':_0x6f374e['body'][_0xe4c4('0x61')]};}_0x11115a=[[_0xe4c4('0x62'),_0xe4c4('0x63')],['scheduledAt',_0x58f2dd[0x0][_0xe4c4('0x5b')]===_0xe4c4('0x63')?_0xe4c4('0x64'):'ASC'],db['sequelize'][_0xe4c4('0x65')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0xe4c4('0x60')](_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')])){_0x3850da['id']={'$notIn':_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')]};}_0x11115a=[[_0xe4c4('0x62'),_0xe4c4('0x64')],[_0xe4c4('0x66'),_0x58f2dd[0x0]['dialOrderByScheduledAt']],db[_0xe4c4('0x67')][_0xe4c4('0x65')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe4c4('0x14')][_0xe4c4('0x68')]({'attributes':['id',_0xe4c4('0x69'),_0xe4c4('0x6a'),'recallme'],'where':_0x3850da,'order':_0x11115a,'transaction':_0x56ead3,'lock':_0x56ead3[_0xe4c4('0x6b')][_0xe4c4('0x6c')],'include':[{'model':db[_0xe4c4('0x51')],'as':'Contact','attributes':_0x3c8e44,'include':[{'model':db['CmCompany'],'as':_0xe4c4('0x6d'),'attributes':['id',_0xe4c4('0x10')]}]},{'model':db[_0xe4c4('0x6e')],'as':_0xe4c4('0x6f'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xe4c4('0x70'),'attributes':['id',_0xe4c4('0x10'),_0xe4c4('0x71')]}]})[_0xe4c4('0xd')](function(_0x1c9f4b){if(_0x1c9f4b){return _0x1c9f4b['update']({'UserId':_0x6f374e[_0xe4c4('0x49')]['id']},{'transaction':_0x56ead3});}});});}})['then'](handleEntityNotFound(_0x1986ab,null))[_0xe4c4('0xd')](respondWithResult(_0x1986ab,null))[_0xe4c4('0x36')](handleError(_0x1986ab,null));};exports['getPreviewRecall']=function(_0x570f1f,_0x4eddfd,_0x279075){var _0x250bb8=[];var _0x1f880f=_0x570f1f[_0xe4c4('0x33')]['id'];var _0x5b41e6=_0x570f1f['user']['id'];return db['CmContact'][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](function(_0x4c10ef){_0x250bb8=_[_0xe4c4('0x1a')](_0x4c10ef);return db[_0xe4c4('0x67')][_0xe4c4('0x5d')](function(_0xb0a006){const _0x5cbc28={'id':_0x1f880f};return db['CmHopper'][_0xe4c4('0x68')]({'attributes':['id',_0xe4c4('0x69'),_0xe4c4('0x72')],'where':_0x5cbc28,'transaction':_0xb0a006,'lock':_0xb0a006[_0xe4c4('0x6b')][_0xe4c4('0x6c')],'include':[{'model':db[_0xe4c4('0x51')],'as':_0xe4c4('0x73'),'attributes':_0x250bb8,'include':[{'model':db['CmCompany'],'as':_0xe4c4('0x6d'),'attributes':['id',_0xe4c4('0x10')]}]},{'model':db[_0xe4c4('0x6e')],'as':_0xe4c4('0x6f'),'attributes':['id','name']},{'model':db[_0xe4c4('0x3d')],'as':_0xe4c4('0x70'),'attributes':['id',_0xe4c4('0x10'),_0xe4c4('0x71')]}]})['then'](function(_0x209602){if(_0x209602){return _0x209602[_0xe4c4('0x39')]({'UserId':_0x5b41e6},{'transaction':_0xb0a006});}});});})['then'](handleEntityNotFound(_0x4eddfd,null))['then'](respondWithResult(_0x4eddfd,null))[_0xe4c4('0x36')](handleError(_0x4eddfd,null));};exports[_0xe4c4('0x74')]=function(_0x3314d6,_0xe30faf){return _0x3314d6[_0xe4c4('0x49')][_0xe4c4('0x75')]({'where':{'type':_0xe4c4('0x5a'),'dialActive':!![],'dialMethod':_0xe4c4('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x5ae9f0){if(_0x5ae9f0&&_0x5ae9f0[_0xe4c4('0x28')]){return db[_0xe4c4('0x14')][_0xe4c4('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'))},'VoiceQueueId':{'$in':_['map'](_0x5ae9f0,'id')},'$or':[{'UserId':null},{'UserId':_0x3314d6[_0xe4c4('0x49')]['id']}]}});}return 0x0;})[_0xe4c4('0xd')](function(_0x425f38){if(!_[_0xe4c4('0x54')](_0x425f38)&&_[_0xe4c4('0x77')](_0x425f38)){return _0xe30faf[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')]({'contacts':_0x425f38});}else{logger[_0xe4c4('0xe')](_0xe4c4('0x78'),_0xe4c4('0x74'),0x194,_0xe4c4('0x79'));_0xe30faf[_0xe4c4('0x7a')](0x194);}})[_0xe4c4('0x36')](handleError(_0xe30faf,null));};exports[_0xe4c4('0x7b')]=function(_0x1ccdb2,_0x1295a4){var _0x52c3e0=shared['timezones'];var _0x340983=[];_['map'](_0x52c3e0,function(_0x46de38){_0x340983[_0xe4c4('0x7c')]({'id':_0x46de38[_0xe4c4('0x10')],'name':_0x46de38[_0xe4c4('0x10')],'utcOffset':_0x46de38[_0xe4c4('0x7d')]});});return _0x1295a4[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')]({'tz':_0x340983});};exports[_0xe4c4('0x7e')]=function(_0x371947,_0x1579fe){var _0x37bf48=shared[_0xe4c4('0x7f')];var _0x3030f6={};if(!_['isNil'](_0x37bf48[_0x371947[_0xe4c4('0x38')]['id']]))_0x3030f6=_0x37bf48[_0x371947[_0xe4c4('0x38')]['id']];return _0x1579fe[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')](_0x3030f6);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 9832322..092f863 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 _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x1bc6a3,_0x471120){var _0x4484e0=function(_0x4b5e36){while(--_0x4b5e36){_0x1bc6a3['push'](_0x1bc6a3['shift']());}};_0x4484e0(++_0x471120);}(_0x2eb2,0x19f));var _0x22eb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x2eb2[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5e09c4,_0x4a5a51){var _0x2cd5a6=function(_0x4d480b){while(--_0x4d480b){_0x5e09c4['push'](_0x5e09c4['shift']());}};_0x2cd5a6(++_0x4a5a51);}(_0x524e,0x15e));var _0xe524=function(_0x2106db,_0x430906){_0x2106db=_0x2106db-0x0;var _0x40ace6=_0x524e[_0x2106db];return _0x40ace6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index dfaa33a..df0eb40 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 _0x1b1d=['ContactId','GetContactDialer','MoveContactManagedDialer','sequelize','CmHopperFinal','create','CountReScheduled','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','describe','order','LOCK','length','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','literal','\x20MINUTE','voicePause','CmList','List','NOW()','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','attributes','limit','map','include','model','then','info','debug','stringify','catch','error','ShowCmHopper','find','raw','where','message','CreateCmHopper','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','CmContact','transaction','UPDATE','Contact','User','Agent','name','includes','push','all','dataValues'];(function(_0x493ce8,_0xac6510){var _0x5d7cb7=function(_0x10b3a8){while(--_0x10b3a8){_0x493ce8['push'](_0x493ce8['shift']());}};_0x5d7cb7(++_0xac6510);}(_0x1b1d,0x19c));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1b1('0x0'));var util=require(_0xd1b1('0x1'));var moment=require(_0xd1b1('0x2'));var BPromise=require(_0xd1b1('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xd1b1('0x4'))(_0xd1b1('0x5'));exports[_0xd1b1('0x6')]=function(_0x98c138){var _0xf717a1=this;return new Promise(function(_0x246c9c,_0x546d7e){return db[_0xd1b1('0x7')][_0xd1b1('0x8')]({'raw':_0x98c138[_0xd1b1('0x9')]?_0x98c138['options']['raw']===undefined?!![]:![]:!![],'where':_0x98c138['options']?_0x98c138[_0xd1b1('0x9')]['where']||null:null,'attributes':_0x98c138[_0xd1b1('0x9')]?_0x98c138['options'][_0xd1b1('0xa')]||null:null,'limit':_0x98c138[_0xd1b1('0x9')]?_0x98c138['options'][_0xd1b1('0xb')]||null:null,'include':_0x98c138['options']?_0x98c138[_0xd1b1('0x9')]['include']?_[_0xd1b1('0xc')](_0x98c138[_0xd1b1('0x9')][_0xd1b1('0xd')],function(_0x488af8){return{'model':db[_0x488af8[_0xd1b1('0xe')]],'as':_0x488af8['as'],'attributes':_0x488af8[_0xd1b1('0xa')],'include':_0x488af8['include']?_['map'](_0x488af8[_0xd1b1('0xd')],function(_0x744b9f){return{'model':db[_0x744b9f['model']],'as':_0x744b9f['as'],'attributes':_0x744b9f[_0xd1b1('0xa')],'include':_0x744b9f[_0xd1b1('0xd')]?_[_0xd1b1('0xc')](_0x744b9f[_0xd1b1('0xd')],function(_0x4a4455){return{'model':db[_0x4a4455[_0xd1b1('0xe')]],'as':_0x4a4455['as'],'attributes':_0x4a4455[_0xd1b1('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1b1('0xf')](function(_0x1f366a){logger[_0xd1b1('0x10')](_0xd1b1('0x6'),_0x98c138);logger[_0xd1b1('0x11')](_0xd1b1('0x6'),_0x98c138,JSON[_0xd1b1('0x12')](_0x1f366a));_0x246c9c(_0x1f366a);})[_0xd1b1('0x13')](function(_0x171b1f){logger[_0xd1b1('0x14')](_0xd1b1('0x6'),_0x171b1f['message'],_0x98c138);_0x546d7e(_0xf717a1['error'](0x1f4,_0x171b1f['message']));});});};exports[_0xd1b1('0x15')]=function(_0x1ba1e7){var _0x3b4704=this;return new Promise(function(_0x54517f,_0x3e2d95){return db[_0xd1b1('0x7')][_0xd1b1('0x16')]({'raw':_0x1ba1e7['options']?_0x1ba1e7[_0xd1b1('0x9')][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'where':_0x1ba1e7['options']?_0x1ba1e7[_0xd1b1('0x9')][_0xd1b1('0x18')]||null:null,'attributes':_0x1ba1e7[_0xd1b1('0x9')]?_0x1ba1e7[_0xd1b1('0x9')]['attributes']||null:null,'include':_0x1ba1e7[_0xd1b1('0x9')]?_0x1ba1e7[_0xd1b1('0x9')][_0xd1b1('0xd')]?_[_0xd1b1('0xc')](_0x1ba1e7[_0xd1b1('0x9')]['include'],function(_0x5990be){return{'model':db[_0x5990be[_0xd1b1('0xe')]],'as':_0x5990be['as'],'attributes':_0x5990be[_0xd1b1('0xa')],'include':_0x5990be[_0xd1b1('0xd')]?_[_0xd1b1('0xc')](_0x5990be[_0xd1b1('0xd')],function(_0x339a8e){return{'model':db[_0x339a8e[_0xd1b1('0xe')]],'as':_0x339a8e['as'],'attributes':_0x339a8e[_0xd1b1('0xa')],'include':_0x339a8e['include']?_['map'](_0x339a8e[_0xd1b1('0xd')],function(_0x213225){return{'model':db[_0x213225[_0xd1b1('0xe')]],'as':_0x213225['as'],'attributes':_0x213225[_0xd1b1('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1b1('0xf')](function(_0x5e64d8){logger['info'](_0xd1b1('0x15'),_0x1ba1e7);logger[_0xd1b1('0x11')](_0xd1b1('0x15'),_0x1ba1e7,JSON[_0xd1b1('0x12')](_0x5e64d8));_0x54517f(_0x5e64d8);})['catch'](function(_0x4a4f4b){logger[_0xd1b1('0x14')](_0xd1b1('0x15'),_0x4a4f4b[_0xd1b1('0x19')],_0x1ba1e7);_0x3e2d95(_0x3b4704[_0xd1b1('0x14')](0x1f4,_0x4a4f4b[_0xd1b1('0x19')]));});});};exports[_0xd1b1('0x1a')]=function(_0x1caeb2){var _0x9ccc59=this;return new Promise(function(_0x2eaab6,_0x35815d){return db['CmHopper']['create'](_0x1caeb2[_0xd1b1('0x1b')],{'raw':_0x1caeb2[_0xd1b1('0x9')]?_0x1caeb2['options'][_0xd1b1('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1c06df){logger[_0xd1b1('0x10')]('CreateCmHopper',_0x1caeb2);logger[_0xd1b1('0x11')](_0xd1b1('0x1a'),_0x1caeb2,JSON['stringify'](_0x1c06df));_0x2eaab6(_0x1c06df);})[_0xd1b1('0x13')](function(_0x3b98c4){logger[_0xd1b1('0x14')](_0xd1b1('0x1a'),_0x3b98c4[_0xd1b1('0x19')],_0x1caeb2);_0x35815d(_0x9ccc59[_0xd1b1('0x14')](0x1f4,_0x3b98c4['message']));});});};exports[_0xd1b1('0x1c')]=function(_0x319325){var _0x9f53c4=this;return new Promise(function(_0x19a99e,_0x5d314e){return db[_0xd1b1('0x7')][_0xd1b1('0x1d')](_0x319325[_0xd1b1('0x1b')],{'raw':_0x319325[_0xd1b1('0x9')]?_0x319325[_0xd1b1('0x9')][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319325['options']?_0x319325[_0xd1b1('0x9')][_0xd1b1('0x18')]||null:null,'attributes':_0x319325[_0xd1b1('0x9')]?_0x319325[_0xd1b1('0x9')][_0xd1b1('0xa')]||null:null,'limit':_0x319325[_0xd1b1('0x9')]?_0x319325[_0xd1b1('0x9')][_0xd1b1('0xb')]||null:null})[_0xd1b1('0xf')](function(_0x5e21a7){logger[_0xd1b1('0x10')](_0xd1b1('0x1c'),_0x319325);logger['info'](_0xd1b1('0x1e'),JSON[_0xd1b1('0x12')](_0x319325['options'][_0xd1b1('0x18')]),_0x319325[_0xd1b1('0x1b')][_0xd1b1('0x1f')]);logger[_0xd1b1('0x11')](_0xd1b1('0x1c'),_0x319325,JSON[_0xd1b1('0x12')](_0x5e21a7));_0x19a99e(_0x5e21a7);})['catch'](function(_0x34b873){logger[_0xd1b1('0x14')](_0xd1b1('0x1c'),_0x34b873['message'],_0x319325);_0x5d314e(_0x9f53c4[_0xd1b1('0x14')](0x1f4,_0x34b873[_0xd1b1('0x19')]));});});};exports[_0xd1b1('0x20')]=function(_0x740022){var _0x4e067b=this;return new Promise(function(_0x341073,_0x40602a){return db['CmHopper']['destroy']({'where':_0x740022[_0xd1b1('0x9')]?_0x740022[_0xd1b1('0x9')][_0xd1b1('0x18')]||null:null})[_0xd1b1('0xf')](function(_0x575f25){logger[_0xd1b1('0x10')]('DestroyCmHopper',_0x740022);logger['debug'](_0xd1b1('0x20'),_0x740022,JSON[_0xd1b1('0x12')](_0x575f25));_0x341073(_0x575f25);})[_0xd1b1('0x13')](function(_0x319020){logger[_0xd1b1('0x14')]('DestroyCmHopper',_0x319020[_0xd1b1('0x19')],_0x740022);_0x40602a(_0x4e067b[_0xd1b1('0x14')](0x1f4,_0x319020[_0xd1b1('0x19')]));});});};exports['GetContactDialer']=function(_0x32e95f){var _0x7338bc=this;return new Promise(function(_0x7e86a5,_0x2ab772){return db[_0xd1b1('0x21')]['describe']()[_0xd1b1('0xf')](function(_0x41eeb7){return db['sequelize'][_0xd1b1('0x22')](function(_0x12fbd0){return db[_0xd1b1('0x7')][_0xd1b1('0x8')]({'where':_0x32e95f[_0xd1b1('0x9')]?_0x32e95f[_0xd1b1('0x9')]['where']||null:null,'attributes':_0x32e95f[_0xd1b1('0x9')]?_0x32e95f[_0xd1b1('0x9')][_0xd1b1('0xa')]||null:null,'limit':_0x32e95f[_0xd1b1('0x9')]?_0x32e95f[_0xd1b1('0x9')][_0xd1b1('0xb')]||null:null,'order':_0x32e95f[_0xd1b1('0x9')]?_0x32e95f['options']['order']||null:null,'transaction':_0x12fbd0,'lock':_0x12fbd0['LOCK'][_0xd1b1('0x23')],'include':[{'model':db[_0xd1b1('0x21')],'as':_0xd1b1('0x24'),'attributes':_['keys'](_0x41eeb7)},{'model':db[_0xd1b1('0x25')],'as':_0xd1b1('0x26'),'attributes':['id',_0xd1b1('0x27'),'voicePause']}]})[_0xd1b1('0xf')](function(_0x3b404c){var _0x2e16d6=[];var _0xb21b04=[];for(var _0x2473ad=0x0;_0x2473ad<_0x3b404c['length'];_0x2473ad+=0x1){var _0xdb1bc8=_0x3b404c[_0x2473ad]['UserId'];if(_0xdb1bc8===null){_0x2e16d6['push'](_0x3b404c[_0x2473ad][_0xd1b1('0x1d')](_0x32e95f[_0xd1b1('0x1b')],{'transaction':_0x12fbd0}));}else if(!_0xb21b04[_0xd1b1('0x28')](_0xdb1bc8)){_0xb21b04[_0xd1b1('0x29')](_0xdb1bc8);_0x2e16d6[_0xd1b1('0x29')](_0x3b404c[_0x2473ad]['update'](_0x32e95f[_0xd1b1('0x1b')],{'transaction':_0x12fbd0}));}}return BPromise[_0xd1b1('0x2a')](_0x2e16d6);});})[_0xd1b1('0xf')](function(_0x21f2dc){logger['info']('GetContactDialer',_0x32e95f);if(_0x21f2dc['length']>0x0){logger[_0xd1b1('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x21f2dc[0x0][_0xd1b1('0x2b')]['id'],_0x21f2dc[0x0]['dataValues'][_0xd1b1('0x2c')],_0x21f2dc[0x0][_0xd1b1('0x2b')][_0xd1b1('0x1f')]);}logger['debug'](_0xd1b1('0x2d'),_0x32e95f,JSON[_0xd1b1('0x12')](_0x21f2dc));_0x7e86a5(_0x21f2dc);})[_0xd1b1('0x13')](function(_0x17c614){logger[_0xd1b1('0x14')](_0xd1b1('0x2d'),_0x17c614[_0xd1b1('0x19')],_0x32e95f);_0x2ab772(_0x7338bc['error'](0x1f4,_0x17c614[_0xd1b1('0x19')]));});});});};exports[_0xd1b1('0x2e')]=function(_0x1f1b8d){var _0x306ea2=this;return new Promise(function(_0x5e8a66,_0xc76a1d){return db[_0xd1b1('0x2f')][_0xd1b1('0x22')](function(_0x2e4845){return db[_0xd1b1('0x30')][_0xd1b1('0x31')](_0x1f1b8d[_0xd1b1('0x1b')],{'raw':_0x1f1b8d['options']?_0x1f1b8d['options'][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'transaction':_0x2e4845})[_0xd1b1('0xf')](function(){logger[_0xd1b1('0x10')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xd1b1('0x12')](_0x1f1b8d['options']['where']),_0x1f1b8d[_0xd1b1('0x9')][_0xd1b1('0x18')][_0xd1b1('0x1f')]);return db[_0xd1b1('0x7')]['destroy']({'where':_0x1f1b8d[_0xd1b1('0x9')]?_0x1f1b8d[_0xd1b1('0x9')][_0xd1b1('0x18')]||null:null,'transaction':_0x2e4845});});})[_0xd1b1('0xf')](function(_0x3bfbd1){logger[_0xd1b1('0x10')](_0xd1b1('0x2e'),_0x1f1b8d);logger[_0xd1b1('0x11')]('MoveContactManagedDialer',_0x1f1b8d,JSON[_0xd1b1('0x12')](_0x3bfbd1));_0x5e8a66(_0x3bfbd1);})[_0xd1b1('0x13')](function(_0x1d7bcc){logger[_0xd1b1('0x14')](_0xd1b1('0x2e'),_0x1d7bcc[_0xd1b1('0x19')],_0x1f1b8d);_0xc76a1d(_0x306ea2[_0xd1b1('0x14')](0x1f4,_0x1d7bcc[_0xd1b1('0x19')]));});});};exports[_0xd1b1('0x32')]=function(_0x3000c0){var _0x5e0a82=this;return new Promise(function(_0x5f1841,_0x470203){return db[_0xd1b1('0x7')][_0xd1b1('0x8')]({'raw':_0x3000c0[_0xd1b1('0x9')]?_0x3000c0[_0xd1b1('0x9')][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'where':_0x3000c0[_0xd1b1('0x9')]?_0x3000c0['options'][_0xd1b1('0x18')]||null:null,'attributes':[[db[_0xd1b1('0x2f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd1b1('0x2f')]['literal']('`scheduledat`\x20>=\x20'+util[_0xd1b1('0x33')](_0xd1b1('0x34'),moment()[_0xd1b1('0x33')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xd1b1('0x35')]]})[_0xd1b1('0xf')](function(_0x572d35){logger[_0xd1b1('0x10')](_0xd1b1('0x32'),_0x3000c0);logger[_0xd1b1('0x11')](_0xd1b1('0x32'),_0x3000c0,JSON[_0xd1b1('0x12')](_0x572d35));_0x5f1841(_0x572d35);})[_0xd1b1('0x13')](function(_0x275e1a){logger[_0xd1b1('0x14')](_0xd1b1('0x32'),_0x275e1a[_0xd1b1('0x19')],_0x3000c0);_0x470203(_0x5e0a82['error'](0x1f4,_0x275e1a['message']));});});};exports[_0xd1b1('0x36')]=function(_0x1d92ab){var _0x3623d1=this;return new Promise(function(_0x4a83c4,_0x2bd3f4){return db[_0xd1b1('0x21')][_0xd1b1('0x37')]()['then'](function(){return db[_0xd1b1('0x2f')][_0xd1b1('0x22')](function(_0x3866f2){return db[_0xd1b1('0x7')][_0xd1b1('0x8')]({'where':_0x1d92ab[_0xd1b1('0x9')]?_0x1d92ab['options'][_0xd1b1('0x18')]||null:null,'attributes':_0x1d92ab[_0xd1b1('0x9')]?_0x1d92ab['options'][_0xd1b1('0xa')]||null:null,'limit':0x1,'order':_0x1d92ab[_0xd1b1('0x9')]?_0x1d92ab[_0xd1b1('0x9')][_0xd1b1('0x38')]||null:null,'group':db[_0xd1b1('0x7')]['UserId'],'transaction':_0x3866f2,'lock':_0x3866f2[_0xd1b1('0x39')]['UPDATE'],'include':_0x1d92ab[_0xd1b1('0x9')]?_0x1d92ab['options'][_0xd1b1('0xd')]?_['map'](_0x1d92ab['options'][_0xd1b1('0xd')],function(_0x106bfd){return{'model':db[_0x106bfd['model']],'as':_0x106bfd['as'],'attributes':_0x106bfd['attributes'],'include':_0x106bfd['include']?_[_0xd1b1('0xc')](_0x106bfd[_0xd1b1('0xd')],function(_0x1fbafb){return{'model':db[_0x1fbafb[_0xd1b1('0xe')]],'as':_0x1fbafb['as'],'attributes':_0x1fbafb[_0xd1b1('0xa')],'include':_0x1fbafb['include']?_[_0xd1b1('0xc')](_0x1fbafb[_0xd1b1('0xd')],function(_0x3bfe94){return{'model':db[_0x3bfe94[_0xd1b1('0xe')]],'as':_0x3bfe94['as'],'attributes':_0x3bfe94[_0xd1b1('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1b1('0xf')](function(_0x36da23){var _0x1b0338=[];for(var _0x295851=0x0;_0x295851<_0x36da23[_0xd1b1('0x3a')];_0x295851+=0x1){_0x1b0338[_0xd1b1('0x29')](_0x36da23[_0x295851][_0xd1b1('0x1d')](_0x1d92ab[_0xd1b1('0x1b')],{'transaction':_0x3866f2}));}return BPromise[_0xd1b1('0x2a')](_0x1b0338);});})[_0xd1b1('0xf')](function(_0x504124){logger[_0xd1b1('0x10')](_0xd1b1('0x36'),_0x1d92ab);logger[_0xd1b1('0x11')]('GetContactRecallMe',_0x1d92ab,JSON[_0xd1b1('0x12')](_0x504124));_0x4a83c4(_0x504124);})['catch'](function(_0x301f0d){logger['error'](_0xd1b1('0x36'),_0x301f0d['message'],_0x1d92ab);_0x2bd3f4(_0x3623d1[_0xd1b1('0x14')](0x1f4,_0x301f0d[_0xd1b1('0x19')]));});});});};exports[_0xd1b1('0x3b')]=function(_0x12df81){var _0x483a7a=this;return new Promise(function(_0x2cfc9f,_0x56c63c){db[_0xd1b1('0x21')][_0xd1b1('0x37')]()['then'](function(_0x2a304b){return db['CmHopper'][_0xd1b1('0x8')]({'raw':_0x12df81[_0xd1b1('0x9')]?_0x12df81[_0xd1b1('0x9')][_0xd1b1('0x17')]===undefined?!![]:![]:!![],'where':_0x12df81['options']?_0x12df81[_0xd1b1('0x9')]['where']||null:null,'attributes':_0x12df81[_0xd1b1('0x9')]?_0x12df81[_0xd1b1('0x9')][_0xd1b1('0xa')]||null:null,'limit':_0x12df81[_0xd1b1('0x9')]?_0x12df81[_0xd1b1('0x9')]['limit']||null:null,'include':_0x12df81['options']?_0x12df81[_0xd1b1('0x9')][_0xd1b1('0xd')]?_['map'](_0x12df81['options'][_0xd1b1('0xd')],function(_0x567877){return{'model':db[_0x567877['model']],'as':_0x567877['as'],'attributes':_0x567877['as']===_0xd1b1('0x24')?_[_0xd1b1('0x3c')](_0x2a304b):_0x567877['attributes'],'include':_0x567877['include']?_[_0xd1b1('0xc')](_0x567877['include'],function(_0x3d968d){return{'model':db[_0x3d968d[_0xd1b1('0xe')]],'as':_0x3d968d['as'],'attributes':_0x3d968d[_0xd1b1('0xa')],'include':_0x3d968d[_0xd1b1('0xd')]?_[_0xd1b1('0xc')](_0x3d968d[_0xd1b1('0xd')],function(_0x2f1823){return{'model':db[_0x2f1823['model']],'as':_0x2f1823['as'],'attributes':_0x2f1823[_0xd1b1('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1b1('0xf')](function(_0x27694f){logger[_0xd1b1('0x10')]('GetCmHopper',_0x12df81);logger[_0xd1b1('0x11')](_0xd1b1('0x6'),_0x12df81,JSON['stringify'](_0x27694f));_0x2cfc9f(_0x27694f);})[_0xd1b1('0x13')](function(_0x2f908d){logger[_0xd1b1('0x14')](_0xd1b1('0x6'),_0x2f908d['message'],_0x12df81);_0x56c63c(_0x483a7a[_0xd1b1('0x14')](0x1f4,_0x2f908d[_0xd1b1('0x19')]));});});});};exports[_0xd1b1('0x3d')]=function(_0x53e314){var _0x5873d4=this;return new Promise(function(_0x230990,_0x125b66){return db[_0xd1b1('0x21')][_0xd1b1('0x3e')]({'raw':!![],'where':{'phone':_0x53e314['options'][_0xd1b1('0x18')]['phone']},'attributes':['id',_0xd1b1('0x3f')],'order':[['id',_0xd1b1('0x40')]]})['then'](function(_0x3454cd){logger[_0xd1b1('0x10')]('getContactByPhone',_0x53e314);logger[_0xd1b1('0x11')](_0xd1b1('0x41'),_0x53e314,JSON['stringify'](_0x3454cd));_0x230990(_0x3454cd);})[_0xd1b1('0x13')](function(_0x3b119f){logger['error']('getContactByPhone',_0x3b119f[_0xd1b1('0x19')],_0x53e314);_0x125b66(_0x5873d4[_0xd1b1('0x14')](0x1f4,_0x3b119f['message']));});});};exports[_0xd1b1('0x42')]=function(_0x35f008){var _0x165a5c=this;return new Promise(function(_0x5bc477,_0x236e33){return db[_0xd1b1('0x2f')][_0xd1b1('0x22')](function(_0x2d9dd5){var _0x3f6ae4=_0x35f008['options']&&_0x35f008[_0xd1b1('0x9')][_0xd1b1('0x18')]?_0x35f008[_0xd1b1('0x9')][_0xd1b1('0x18')]:{};return db[_0xd1b1('0x7')][_0xd1b1('0x1d')](_0x35f008[_0xd1b1('0x1b')],{'where':_0x3f6ae4,'transaction':_0x2d9dd5})['then'](function(_0xec0821){logger[_0xd1b1('0x10')]('ResetActiveCalls',_0x35f008);logger[_0xd1b1('0x11')](_0xd1b1('0x42'),_0x35f008,JSON[_0xd1b1('0x12')](_0xec0821));_0x5bc477(_0xec0821);})['catch'](function(_0x599286){logger[_0xd1b1('0x14')](_0xd1b1('0x42'),_0x599286[_0xd1b1('0x19')],_0x35f008);_0x236e33(_0x165a5c['error'](0x1f4,_0x599286[_0xd1b1('0x19')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1e0287){var _0x203c3=this;var _0x1d50dd=_0x1e0287['body'][_0xd1b1('0x18')][_0xd1b1('0x43')];var _0x1c9b62=_0x1e0287[_0xd1b1('0x1b')]['where']['interval'];var _0x845121=_0x1e0287[_0xd1b1('0x1b')][_0xd1b1('0x18')][_0xd1b1('0x44')];return new Promise(function(_0x57264d,_0x28477c){return db[_0xd1b1('0x7')][_0xd1b1('0x8')]({'where':{'voiceQueueId':{'$in':_0x1d50dd},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd1b1('0x2f')][_0xd1b1('0x45')]('NOW()\x20+\x20INTERVAL\x20'+_0x1c9b62+_0xd1b1('0x46')),'$gt':db['sequelize'][_0xd1b1('0x45')]('NOW()')}},'UserId':{'$in':_0x845121}},'include':[{'model':db[_0xd1b1('0x21')],'as':'Contact'},{'model':db[_0xd1b1('0x25')],'as':_0xd1b1('0x26'),'attributes':['id',_0xd1b1('0x27'),_0xd1b1('0x47')]},{'model':db[_0xd1b1('0x48')],'as':_0xd1b1('0x49')}]})[_0xd1b1('0xf')](function(_0x425723){if(_0x425723[_0xd1b1('0x3a')]>0x0){return db[_0xd1b1('0x2f')][_0xd1b1('0x22')](function(_0x556de5){return db[_0xd1b1('0x7')]['update']({'recallmeNotifiedDate':db[_0xd1b1('0x2f')][_0xd1b1('0x45')](_0xd1b1('0x4a'))},{'where':{'id':{'$in':_[_0xd1b1('0xc')](_0x425723,'id')}},'transaction':_0x556de5})[_0xd1b1('0xf')](function(){_0x57264d(_0x425723);})[_0xd1b1('0x13')](function(_0x23a688){logger[_0xd1b1('0x14')](_0xd1b1('0x4b'),_0x23a688[_0xd1b1('0x19')],_0x1e0287);_0x28477c(_0x203c3[_0xd1b1('0x14')](0x1f4,_0x23a688[_0xd1b1('0x19')]));});})[_0xd1b1('0x13')](function(_0x3318e6){logger[_0xd1b1('0x14')](_0xd1b1('0x4b'),_0x3318e6[_0xd1b1('0x19')],_0x1e0287);_0x28477c(_0x203c3['error'](0x1f4,_0x3318e6[_0xd1b1('0x19')]));});}else{_0x57264d(_0x425723);}});});}; \ No newline at end of file +var _0x536d=['transaction','LOCK','Contact','keys','Agent','name','voicePause','length','includes','push','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','CmContact','order','UserId','all','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()','CmList','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x536d,0x192));var _0xd536=function(_0x2f4258,_0x4fae6c){_0x2f4258=_0x2f4258-0x0;var _0x3a98ce=_0x536d[_0x2f4258];return _0x3a98ce;};'use strict';var _=require('lodash');var util=require(_0xd536('0x0'));var moment=require(_0xd536('0x1'));var BPromise=require('bluebird');var db=require(_0xd536('0x2'))['db'];var logger=require(_0xd536('0x3'))(_0xd536('0x4'));exports[_0xd536('0x5')]=function(_0x45dafc){var _0x3eb12e=this;return new Promise(function(_0x422ed0,_0x201606){return db[_0xd536('0x6')][_0xd536('0x7')]({'raw':_0x45dafc[_0xd536('0x8')]?_0x45dafc['options'][_0xd536('0x9')]===undefined?!![]:![]:!![],'where':_0x45dafc[_0xd536('0x8')]?_0x45dafc[_0xd536('0x8')][_0xd536('0xa')]||null:null,'attributes':_0x45dafc[_0xd536('0x8')]?_0x45dafc[_0xd536('0x8')]['attributes']||null:null,'limit':_0x45dafc['options']?_0x45dafc[_0xd536('0x8')]['limit']||null:null,'include':_0x45dafc['options']?_0x45dafc[_0xd536('0x8')][_0xd536('0xb')]?_[_0xd536('0xc')](_0x45dafc[_0xd536('0x8')]['include'],function(_0x5a43d0){return{'model':db[_0x5a43d0[_0xd536('0xd')]],'as':_0x5a43d0['as'],'attributes':_0x5a43d0['attributes'],'include':_0x5a43d0[_0xd536('0xb')]?_['map'](_0x5a43d0[_0xd536('0xb')],function(_0x51beba){return{'model':db[_0x51beba[_0xd536('0xd')]],'as':_0x51beba['as'],'attributes':_0x51beba[_0xd536('0xe')],'include':_0x51beba[_0xd536('0xb')]?_[_0xd536('0xc')](_0x51beba[_0xd536('0xb')],function(_0x18babb){return{'model':db[_0x18babb['model']],'as':_0x18babb['as'],'attributes':_0x18babb[_0xd536('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd536('0xf')](function(_0x51856d){logger[_0xd536('0x10')](_0xd536('0x5'),_0x45dafc);logger[_0xd536('0x11')]('GetCmHopper',_0x45dafc,JSON[_0xd536('0x12')](_0x51856d));_0x422ed0(_0x51856d);})[_0xd536('0x13')](function(_0x453010){logger[_0xd536('0x14')](_0xd536('0x5'),_0x453010[_0xd536('0x15')],_0x45dafc);_0x201606(_0x3eb12e['error'](0x1f4,_0x453010[_0xd536('0x15')]));});});};exports[_0xd536('0x16')]=function(_0x262e33){var _0x1d8f61=this;return new Promise(function(_0xc4d4a9,_0x34a89f){return db[_0xd536('0x6')]['find']({'raw':_0x262e33['options']?_0x262e33[_0xd536('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x262e33['options']?_0x262e33[_0xd536('0x8')][_0xd536('0xa')]||null:null,'attributes':_0x262e33['options']?_0x262e33['options'][_0xd536('0xe')]||null:null,'include':_0x262e33['options']?_0x262e33[_0xd536('0x8')]['include']?_['map'](_0x262e33[_0xd536('0x8')][_0xd536('0xb')],function(_0x1ba712){return{'model':db[_0x1ba712['model']],'as':_0x1ba712['as'],'attributes':_0x1ba712['attributes'],'include':_0x1ba712[_0xd536('0xb')]?_['map'](_0x1ba712[_0xd536('0xb')],function(_0x35aad2){return{'model':db[_0x35aad2['model']],'as':_0x35aad2['as'],'attributes':_0x35aad2[_0xd536('0xe')],'include':_0x35aad2[_0xd536('0xb')]?_[_0xd536('0xc')](_0x35aad2[_0xd536('0xb')],function(_0x3f11a1){return{'model':db[_0x3f11a1['model']],'as':_0x3f11a1['as'],'attributes':_0x3f11a1[_0xd536('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd536('0xf')](function(_0x1a0ec5){logger[_0xd536('0x10')](_0xd536('0x16'),_0x262e33);logger[_0xd536('0x11')](_0xd536('0x16'),_0x262e33,JSON[_0xd536('0x12')](_0x1a0ec5));_0xc4d4a9(_0x1a0ec5);})['catch'](function(_0x22e414){logger[_0xd536('0x14')](_0xd536('0x16'),_0x22e414['message'],_0x262e33);_0x34a89f(_0x1d8f61[_0xd536('0x14')](0x1f4,_0x22e414[_0xd536('0x15')]));});});};exports[_0xd536('0x17')]=function(_0x819250){var _0x179446=this;return new Promise(function(_0x45b4ab,_0x3c56ad){return db['CmHopper'][_0xd536('0x18')](_0x819250[_0xd536('0x19')],{'raw':_0x819250[_0xd536('0x8')]?_0x819250[_0xd536('0x8')][_0xd536('0x9')]===undefined?!![]:![]:!![]})['then'](function(_0x163f30){logger[_0xd536('0x10')](_0xd536('0x17'),_0x819250);logger['debug'](_0xd536('0x17'),_0x819250,JSON['stringify'](_0x163f30));_0x45b4ab(_0x163f30);})['catch'](function(_0x298713){logger[_0xd536('0x14')](_0xd536('0x17'),_0x298713[_0xd536('0x15')],_0x819250);_0x3c56ad(_0x179446['error'](0x1f4,_0x298713[_0xd536('0x15')]));});});};exports[_0xd536('0x1a')]=function(_0x203e4a){var _0x702798=this;return new Promise(function(_0x1270d4,_0xbefe07){return db[_0xd536('0x6')][_0xd536('0x1b')](_0x203e4a[_0xd536('0x19')],{'raw':_0x203e4a[_0xd536('0x8')]?_0x203e4a[_0xd536('0x8')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203e4a[_0xd536('0x8')]?_0x203e4a[_0xd536('0x8')][_0xd536('0xa')]||null:null,'attributes':_0x203e4a[_0xd536('0x8')]?_0x203e4a[_0xd536('0x8')][_0xd536('0xe')]||null:null,'limit':_0x203e4a[_0xd536('0x8')]?_0x203e4a[_0xd536('0x8')][_0xd536('0x1c')]||null:null})[_0xd536('0xf')](function(_0x1e213b){logger[_0xd536('0x10')](_0xd536('0x1a'),_0x203e4a);logger[_0xd536('0x10')](_0xd536('0x1d'),JSON[_0xd536('0x12')](_0x203e4a[_0xd536('0x8')][_0xd536('0xa')]),_0x203e4a[_0xd536('0x19')][_0xd536('0x1e')]);logger[_0xd536('0x11')](_0xd536('0x1a'),_0x203e4a,JSON[_0xd536('0x12')](_0x1e213b));_0x1270d4(_0x1e213b);})[_0xd536('0x13')](function(_0x47756d){logger[_0xd536('0x14')](_0xd536('0x1a'),_0x47756d['message'],_0x203e4a);_0xbefe07(_0x702798[_0xd536('0x14')](0x1f4,_0x47756d[_0xd536('0x15')]));});});};exports[_0xd536('0x1f')]=function(_0x420120){var _0xd61b89=this;return new Promise(function(_0x1775e5,_0x344b54){return db[_0xd536('0x6')][_0xd536('0x20')]({'where':_0x420120[_0xd536('0x8')]?_0x420120[_0xd536('0x8')][_0xd536('0xa')]||null:null})[_0xd536('0xf')](function(_0x3378f8){logger[_0xd536('0x10')]('DestroyCmHopper',_0x420120);logger['debug'](_0xd536('0x1f'),_0x420120,JSON[_0xd536('0x12')](_0x3378f8));_0x1775e5(_0x3378f8);})['catch'](function(_0x56ca20){logger['error'](_0xd536('0x1f'),_0x56ca20['message'],_0x420120);_0x344b54(_0xd61b89[_0xd536('0x14')](0x1f4,_0x56ca20[_0xd536('0x15')]));});});};exports[_0xd536('0x21')]=function(_0x475ea6){var _0x23f1cf=this;return new Promise(function(_0x20d16c,_0x241761){return db['CmContact'][_0xd536('0x22')]()[_0xd536('0xf')](function(_0x3e956d){return db[_0xd536('0x23')][_0xd536('0x24')](function(_0x4d2ed9){return db['CmHopper'][_0xd536('0x7')]({'where':_0x475ea6[_0xd536('0x8')]?_0x475ea6['options'][_0xd536('0xa')]||null:null,'attributes':_0x475ea6[_0xd536('0x8')]?_0x475ea6['options'][_0xd536('0xe')]||null:null,'limit':_0x475ea6[_0xd536('0x8')]?_0x475ea6[_0xd536('0x8')][_0xd536('0x1c')]||null:null,'order':_0x475ea6[_0xd536('0x8')]?_0x475ea6[_0xd536('0x8')]['order']||null:null,'transaction':_0x4d2ed9,'lock':_0x4d2ed9[_0xd536('0x25')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xd536('0x26'),'attributes':_[_0xd536('0x27')](_0x3e956d)},{'model':db['User'],'as':_0xd536('0x28'),'attributes':['id',_0xd536('0x29'),_0xd536('0x2a')]}]})[_0xd536('0xf')](function(_0x295c1b){var _0x1e4250=[];var _0x1ccccb=[];for(var _0xba8fe6=0x0;_0xba8fe6<_0x295c1b[_0xd536('0x2b')];_0xba8fe6+=0x1){var _0x3871c5=_0x295c1b[_0xba8fe6]['UserId'];if(_0x3871c5===null){_0x1e4250['push'](_0x295c1b[_0xba8fe6][_0xd536('0x1b')](_0x475ea6[_0xd536('0x19')],{'transaction':_0x4d2ed9}));}else if(!_0x1ccccb[_0xd536('0x2c')](_0x3871c5)){_0x1ccccb[_0xd536('0x2d')](_0x3871c5);_0x1e4250['push'](_0x295c1b[_0xba8fe6][_0xd536('0x1b')](_0x475ea6['body'],{'transaction':_0x4d2ed9}));}}return BPromise['all'](_0x1e4250);});})[_0xd536('0xf')](function(_0x3ffc23){logger[_0xd536('0x10')]('GetContactDialer',_0x475ea6);if(_0x3ffc23[_0xd536('0x2b')]>0x0){logger[_0xd536('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x3ffc23[0x0][_0xd536('0x2e')]['id'],_0x3ffc23[0x0]['dataValues'][_0xd536('0x2f')],_0x3ffc23[0x0][_0xd536('0x2e')][_0xd536('0x1e')]);}logger[_0xd536('0x11')](_0xd536('0x21'),_0x475ea6,JSON[_0xd536('0x12')](_0x3ffc23));_0x20d16c(_0x3ffc23);})[_0xd536('0x13')](function(_0x1524cc){logger['error'](_0xd536('0x21'),_0x1524cc[_0xd536('0x15')],_0x475ea6);_0x241761(_0x23f1cf[_0xd536('0x14')](0x1f4,_0x1524cc[_0xd536('0x15')]));});});});};exports[_0xd536('0x30')]=function(_0x5ef8db){var _0x25763a=this;return new Promise(function(_0x174655,_0x225884){return db['sequelize'][_0xd536('0x24')](function(_0x5e8c46){return db['CmHopperFinal']['create'](_0x5ef8db[_0xd536('0x19')],{'raw':_0x5ef8db['options']?_0x5ef8db[_0xd536('0x8')][_0xd536('0x9')]===undefined?!![]:![]:!![],'transaction':_0x5e8c46})[_0xd536('0xf')](function(){logger[_0xd536('0x10')](_0xd536('0x31'),JSON['stringify'](_0x5ef8db['options']['where']),_0x5ef8db[_0xd536('0x8')]['where'][_0xd536('0x1e')]);return db[_0xd536('0x6')][_0xd536('0x20')]({'where':_0x5ef8db['options']?_0x5ef8db[_0xd536('0x8')][_0xd536('0xa')]||null:null,'transaction':_0x5e8c46});});})['then'](function(_0x17a410){logger[_0xd536('0x10')](_0xd536('0x30'),_0x5ef8db);logger[_0xd536('0x11')](_0xd536('0x30'),_0x5ef8db,JSON['stringify'](_0x17a410));_0x174655(_0x17a410);})[_0xd536('0x13')](function(_0xb524ad){logger[_0xd536('0x14')](_0xd536('0x30'),_0xb524ad['message'],_0x5ef8db);_0x225884(_0x25763a[_0xd536('0x14')](0x1f4,_0xb524ad['message']));});});};exports['CountReScheduled']=function(_0x2bc0b6){var _0x414a8d=this;return new Promise(function(_0x20a188,_0x4de847){return db[_0xd536('0x6')]['findAll']({'raw':_0x2bc0b6['options']?_0x2bc0b6[_0xd536('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc0b6['options']?_0x2bc0b6[_0xd536('0x8')][_0xd536('0xa')]||null:null,'attributes':[[db[_0xd536('0x23')]['fn']('COUNT',db[_0xd536('0x23')]['fn']('IF',db[_0xd536('0x23')][_0xd536('0x32')](_0xd536('0x33')+util[_0xd536('0x34')](_0xd536('0x35'),moment()[_0xd536('0x34')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd536('0x36')))),_0xd536('0x37')]]})['then'](function(_0x2ef277){logger[_0xd536('0x10')]('CountReScheduled',_0x2bc0b6);logger[_0xd536('0x11')](_0xd536('0x38'),_0x2bc0b6,JSON[_0xd536('0x12')](_0x2ef277));_0x20a188(_0x2ef277);})[_0xd536('0x13')](function(_0x12f81a){logger[_0xd536('0x14')]('CountReScheduled',_0x12f81a[_0xd536('0x15')],_0x2bc0b6);_0x4de847(_0x414a8d[_0xd536('0x14')](0x1f4,_0x12f81a[_0xd536('0x15')]));});});};exports[_0xd536('0x39')]=function(_0x2c6350){var _0x338ff6=this;return new Promise(function(_0x3742f6,_0x10cef1){return db[_0xd536('0x3a')][_0xd536('0x22')]()[_0xd536('0xf')](function(){return db['sequelize'][_0xd536('0x24')](function(_0x152cfd){return db[_0xd536('0x6')][_0xd536('0x7')]({'where':_0x2c6350[_0xd536('0x8')]?_0x2c6350[_0xd536('0x8')][_0xd536('0xa')]||null:null,'attributes':_0x2c6350[_0xd536('0x8')]?_0x2c6350[_0xd536('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x2c6350[_0xd536('0x8')]?_0x2c6350[_0xd536('0x8')][_0xd536('0x3b')]||null:null,'group':db[_0xd536('0x6')][_0xd536('0x3c')],'transaction':_0x152cfd,'lock':_0x152cfd['LOCK']['UPDATE'],'include':_0x2c6350[_0xd536('0x8')]?_0x2c6350['options'][_0xd536('0xb')]?_[_0xd536('0xc')](_0x2c6350[_0xd536('0x8')][_0xd536('0xb')],function(_0x3c79b1){return{'model':db[_0x3c79b1[_0xd536('0xd')]],'as':_0x3c79b1['as'],'attributes':_0x3c79b1[_0xd536('0xe')],'include':_0x3c79b1[_0xd536('0xb')]?_[_0xd536('0xc')](_0x3c79b1['include'],function(_0x67c270){return{'model':db[_0x67c270[_0xd536('0xd')]],'as':_0x67c270['as'],'attributes':_0x67c270[_0xd536('0xe')],'include':_0x67c270['include']?_[_0xd536('0xc')](_0x67c270[_0xd536('0xb')],function(_0x142ac9){return{'model':db[_0x142ac9[_0xd536('0xd')]],'as':_0x142ac9['as'],'attributes':_0x142ac9[_0xd536('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd536('0xf')](function(_0x305107){var _0x4af742=[];for(var _0x1aef67=0x0;_0x1aef67<_0x305107[_0xd536('0x2b')];_0x1aef67+=0x1){_0x4af742[_0xd536('0x2d')](_0x305107[_0x1aef67]['update'](_0x2c6350[_0xd536('0x19')],{'transaction':_0x152cfd}));}return BPromise[_0xd536('0x3d')](_0x4af742);});})[_0xd536('0xf')](function(_0x503c45){logger[_0xd536('0x10')](_0xd536('0x39'),_0x2c6350);logger[_0xd536('0x11')]('GetContactRecallMe',_0x2c6350,JSON[_0xd536('0x12')](_0x503c45));_0x3742f6(_0x503c45);})[_0xd536('0x13')](function(_0x920ae3){logger[_0xd536('0x14')](_0xd536('0x39'),_0x920ae3[_0xd536('0x15')],_0x2c6350);_0x10cef1(_0x338ff6[_0xd536('0x14')](0x1f4,_0x920ae3[_0xd536('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0xeaa2ec){var _0xa5e293=this;return new Promise(function(_0x31c461,_0x54369a){db[_0xd536('0x3a')][_0xd536('0x22')]()[_0xd536('0xf')](function(_0x80c8bb){return db[_0xd536('0x6')][_0xd536('0x7')]({'raw':_0xeaa2ec[_0xd536('0x8')]?_0xeaa2ec['options']['raw']===undefined?!![]:![]:!![],'where':_0xeaa2ec['options']?_0xeaa2ec[_0xd536('0x8')]['where']||null:null,'attributes':_0xeaa2ec['options']?_0xeaa2ec[_0xd536('0x8')][_0xd536('0xe')]||null:null,'limit':_0xeaa2ec[_0xd536('0x8')]?_0xeaa2ec['options'][_0xd536('0x1c')]||null:null,'include':_0xeaa2ec['options']?_0xeaa2ec[_0xd536('0x8')][_0xd536('0xb')]?_[_0xd536('0xc')](_0xeaa2ec['options'][_0xd536('0xb')],function(_0x33d788){return{'model':db[_0x33d788['model']],'as':_0x33d788['as'],'attributes':_0x33d788['as']===_0xd536('0x26')?_[_0xd536('0x27')](_0x80c8bb):_0x33d788['attributes'],'include':_0x33d788[_0xd536('0xb')]?_[_0xd536('0xc')](_0x33d788[_0xd536('0xb')],function(_0x4bba7d){return{'model':db[_0x4bba7d[_0xd536('0xd')]],'as':_0x4bba7d['as'],'attributes':_0x4bba7d['attributes'],'include':_0x4bba7d['include']?_['map'](_0x4bba7d[_0xd536('0xb')],function(_0x12a9c2){return{'model':db[_0x12a9c2[_0xd536('0xd')]],'as':_0x12a9c2['as'],'attributes':_0x12a9c2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd536('0xf')](function(_0x1dbdb9){logger[_0xd536('0x10')](_0xd536('0x5'),_0xeaa2ec);logger[_0xd536('0x11')](_0xd536('0x5'),_0xeaa2ec,JSON[_0xd536('0x12')](_0x1dbdb9));_0x31c461(_0x1dbdb9);})[_0xd536('0x13')](function(_0x479a9e){logger[_0xd536('0x14')](_0xd536('0x5'),_0x479a9e[_0xd536('0x15')],_0xeaa2ec);_0x54369a(_0xa5e293['error'](0x1f4,_0x479a9e['message']));});});});};exports['GetContactByPhone']=function(_0x73bc86){var _0x54e9fb=this;return new Promise(function(_0x2a0ab6,_0x34838d){return db[_0xd536('0x3a')][_0xd536('0x3e')]({'raw':!![],'where':{'phone':_0x73bc86['options'][_0xd536('0xa')][_0xd536('0x3f')]},'attributes':['id',_0xd536('0x40')],'order':[['id',_0xd536('0x41')]]})[_0xd536('0xf')](function(_0x46cc71){logger['info']('getContactByPhone',_0x73bc86);logger[_0xd536('0x11')](_0xd536('0x42'),_0x73bc86,JSON[_0xd536('0x12')](_0x46cc71));_0x2a0ab6(_0x46cc71);})['catch'](function(_0x194d8d){logger['error'](_0xd536('0x42'),_0x194d8d['message'],_0x73bc86);_0x34838d(_0x54e9fb[_0xd536('0x14')](0x1f4,_0x194d8d['message']));});});};exports[_0xd536('0x43')]=function(_0x510a0b){var _0x451cfa=this;return new Promise(function(_0x78a65e,_0x42ff98){return db[_0xd536('0x23')]['transaction'](function(_0x42d709){var _0x3240ac=_0x510a0b[_0xd536('0x8')]&&_0x510a0b[_0xd536('0x8')][_0xd536('0xa')]?_0x510a0b[_0xd536('0x8')][_0xd536('0xa')]:{};return db[_0xd536('0x6')][_0xd536('0x1b')](_0x510a0b[_0xd536('0x19')],{'where':_0x3240ac,'transaction':_0x42d709})[_0xd536('0xf')](function(_0x469fa6){logger[_0xd536('0x10')](_0xd536('0x43'),_0x510a0b);logger[_0xd536('0x11')](_0xd536('0x43'),_0x510a0b,JSON['stringify'](_0x469fa6));_0x78a65e(_0x469fa6);})[_0xd536('0x13')](function(_0x3ecee2){logger[_0xd536('0x14')](_0xd536('0x43'),_0x3ecee2[_0xd536('0x15')],_0x510a0b);_0x42ff98(_0x451cfa[_0xd536('0x14')](0x1f4,_0x3ecee2[_0xd536('0x15')]));});});});};exports[_0xd536('0x44')]=function(_0x15d21f){var _0x1be92c=this;var _0x4e18a4=_0x15d21f['body'][_0xd536('0xa')][_0xd536('0x45')];var _0xeaca55=_0x15d21f[_0xd536('0x19')][_0xd536('0xa')]['interval'];var _0x4ef3bc=_0x15d21f[_0xd536('0x19')]['where'][_0xd536('0x46')];return new Promise(function(_0x38e00e,_0x31c558){return db[_0xd536('0x6')][_0xd536('0x7')]({'where':{'voiceQueueId':{'$in':_0x4e18a4},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd536('0x23')][_0xd536('0x32')]('NOW()\x20+\x20INTERVAL\x20'+_0xeaca55+'\x20MINUTE'),'$gt':db[_0xd536('0x23')][_0xd536('0x32')](_0xd536('0x47'))}},'UserId':{'$in':_0x4ef3bc}},'include':[{'model':db[_0xd536('0x3a')],'as':'Contact'},{'model':db['User'],'as':_0xd536('0x28'),'attributes':['id',_0xd536('0x29'),_0xd536('0x2a')]},{'model':db[_0xd536('0x48')],'as':'List'}]})['then'](function(_0x43207c){if(_0x43207c[_0xd536('0x2b')]>0x0){return db['sequelize'][_0xd536('0x24')](function(_0x2d000a){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xd536('0x23')][_0xd536('0x32')](_0xd536('0x47'))},{'where':{'id':{'$in':_[_0xd536('0xc')](_0x43207c,'id')}},'transaction':_0x2d000a})[_0xd536('0xf')](function(){_0x38e00e(_0x43207c);})['catch'](function(_0x2308d8){logger['error'](_0xd536('0x44'),_0x2308d8[_0xd536('0x15')],_0x15d21f);_0x31c558(_0x1be92c[_0xd536('0x14')](0x1f4,_0x2308d8[_0xd536('0x15')]));});})[_0xd536('0x13')](function(_0x4789c3){logger[_0xd536('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x4789c3['message'],_0x15d21f);_0x31c558(_0x1be92c[_0xd536('0x14')](0x1f4,_0x4789c3[_0xd536('0x15')]));});}else{_0x38e00e(_0x43207c);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b5dc919..c68c4e1 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 _0x6374=['/:id','show','/:id/previewrecall','getPreviewRecall','create','/preview','getPreview','post','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','getOpenContacts'];(function(_0x2e771f,_0x20438f){var _0x2b3a90=function(_0x58658e){while(--_0x58658e){_0x2e771f['push'](_0x2e771f['shift']());}};_0x2b3a90(++_0x20438f);}(_0x6374,0xdc));var _0x4637=function(_0x4574e9,_0x307978){_0x4574e9=_0x4574e9-0x0;var _0x42533c=_0x6374[_0x4574e9];return _0x42533c;};'use strict';var express=require(_0x4637('0x0'));var router=express[_0x4637('0x1')]();var auth=require(_0x4637('0x2'));var controller=require(_0x4637('0x3'));router['get']('/',auth[_0x4637('0x4')](),controller[_0x4637('0x5')]);router[_0x4637('0x6')](_0x4637('0x7'),auth[_0x4637('0x4')](),controller[_0x4637('0x8')]);router[_0x4637('0x6')]('/opencontacts',auth[_0x4637('0x4')](),controller[_0x4637('0x9')]);router['get']('/timezones',auth['isAuthenticated'](),controller['getTimezones']);router[_0x4637('0x6')](_0x4637('0xa'),auth[_0x4637('0x4')](),controller[_0x4637('0xb')]);router[_0x4637('0x6')](_0x4637('0xc'),auth['isAuthenticated'](),controller[_0x4637('0xd')]);router['post']('/',auth[_0x4637('0x4')](),controller[_0x4637('0xe')]);router['post'](_0x4637('0xf'),auth[_0x4637('0x4')](),controller[_0x4637('0x10')]);router[_0x4637('0x11')]('/timezone',auth[_0x4637('0x4')](),controller['getTimezone']);router[_0x4637('0x12')](_0x4637('0xa'),auth[_0x4637('0x4')](),controller[_0x4637('0x13')]);router[_0x4637('0x14')](_0x4637('0xa'),auth['isAuthenticated'](),controller[_0x4637('0x15')]);module[_0x4637('0x16')]=router; \ No newline at end of file +var _0x54ed=['/:id','/:id/previewrecall','post','/preview','getPreview','/timezone','getTimezone','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones'];(function(_0x46404e,_0x5a4df2){var _0x1a6e05=function(_0x349105){while(--_0x349105){_0x46404e['push'](_0x46404e['shift']());}};_0x1a6e05(++_0x5a4df2);}(_0x54ed,0x1ad));var _0xd54e=function(_0x15f80e,_0x28a721){_0x15f80e=_0x15f80e-0x0;var _0x4c8a21=_0x54ed[_0x15f80e];return _0x4c8a21;};'use strict';var express=require(_0xd54e('0x0'));var router=express[_0xd54e('0x1')]();var auth=require(_0xd54e('0x2'));var controller=require('./cmHopper.controller');router[_0xd54e('0x3')]('/',auth[_0xd54e('0x4')](),controller['index']);router[_0xd54e('0x3')](_0xd54e('0x5'),auth[_0xd54e('0x4')](),controller[_0xd54e('0x6')]);router[_0xd54e('0x3')](_0xd54e('0x7'),auth['isAuthenticated'](),controller[_0xd54e('0x8')]);router[_0xd54e('0x3')](_0xd54e('0x9'),auth[_0xd54e('0x4')](),controller[_0xd54e('0xa')]);router[_0xd54e('0x3')](_0xd54e('0xb'),auth[_0xd54e('0x4')](),controller['show']);router['get'](_0xd54e('0xc'),auth[_0xd54e('0x4')](),controller['getPreviewRecall']);router[_0xd54e('0xd')]('/',auth[_0xd54e('0x4')](),controller['create']);router['post'](_0xd54e('0xe'),auth[_0xd54e('0x4')](),controller[_0xd54e('0xf')]);router['post'](_0xd54e('0x10'),auth[_0xd54e('0x4')](),controller[_0xd54e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd54e('0xb'),auth[_0xd54e('0x4')](),controller[_0xd54e('0x12')]);module[_0xd54e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 7140a4c..912f636 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c7e=['moment','sequelize','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xeb80e,_0x337608){var _0x68e9d7=function(_0x50c896){while(--_0x50c896){_0xeb80e['push'](_0xeb80e['shift']());}};_0x68e9d7(++_0x337608);}(_0x1c7e,0x69));var _0xe1c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1c7e[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xe1c7('0x0'));var Sequelize=require(_0xe1c7('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xe1c7('0x2')]},'phone':{'type':Sequelize[_0xe1c7('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xe1c7('0x4')],'defaultValue':moment()[_0xe1c7('0x5')](_0xe1c7('0x6'))},'countbusyretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe1c7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2742=['INTEGER','STRING','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x300f4f,_0x55693a){var _0x5bc82c=function(_0x2e343c){while(--_0x2e343c){_0x300f4f['push'](_0x300f4f['shift']());}};_0x5bc82c(++_0x55693a);}(_0x2742,0x81));var _0x2274=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2742[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x2274('0x0'));var Sequelize=require(_0x2274('0x1'));module[_0x2274('0x2')]={'CmHopperId':{'type':Sequelize[_0x2274('0x3')]},'phone':{'type':Sequelize[_0x2274('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x2274('0x5'))},'countbusyretry':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2274('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 15f7872..ad2cd2d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e5a=['fields','length','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','error','send','index','map','CmHopperAdditionalPhone','fieldName','type','model','name','query','intersection'];(function(_0x32d4b3,_0xcb2a1c){var _0x2fc502=function(_0x2c2eb4){while(--_0x2c2eb4){_0x32d4b3['push'](_0x32d4b3['shift']());}};_0x2fc502(++_0xcb2a1c);}(_0x0e5a,0x110));var _0xa0e5=function(_0x522660,_0x2d2b72){_0x522660=_0x522660-0x0;var _0x5e47dd=_0x0e5a[_0x522660];return _0x5e47dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa0e5('0x0'));var rp=require('request-promise');var moment=require(_0xa0e5('0x1'));var BPromise=require(_0xa0e5('0x2'));var Mustache=require(_0xa0e5('0x3'));var util=require('util');var path=require(_0xa0e5('0x4'));var sox=require(_0xa0e5('0x5'));var csv=require('to-csv');var ejs=require(_0xa0e5('0x6'));var fs=require('fs');var fs_extra=require(_0xa0e5('0x7'));var _=require(_0xa0e5('0x8'));var squel=require('squel');var crypto=require(_0xa0e5('0x9'));var jsforce=require(_0xa0e5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa0e5('0xb'));var querystring=require(_0xa0e5('0xc'));var Papa=require(_0xa0e5('0xd'));var Redis=require('ioredis');var authService=require(_0xa0e5('0xe'));var qs=require(_0xa0e5('0xf'));var as=require(_0xa0e5('0x10'));var hardwareService=require(_0xa0e5('0x11'));var logger=require(_0xa0e5('0x12'))(_0xa0e5('0x13'));var utils=require(_0xa0e5('0x14'));var config=require(_0xa0e5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0e5('0x16'))['db'];function respondWithStatusCode(_0x8acb5c,_0x22d1be){_0x22d1be=_0x22d1be||0xcc;return function(_0x4f20d0){if(_0x4f20d0){return _0x8acb5c[_0xa0e5('0x17')](_0x22d1be);}return _0x8acb5c[_0xa0e5('0x18')](_0x22d1be)[_0xa0e5('0x19')]();};}function respondWithResult(_0x17b197,_0x14f287){_0x14f287=_0x14f287||0xc8;return function(_0x187169){if(_0x187169){return _0x17b197[_0xa0e5('0x18')](_0x14f287)[_0xa0e5('0x1a')](_0x187169);}};}function respondWithFilteredResult(_0x70c3ad,_0x2276ba){return function(_0x503b9c){if(_0x503b9c){var _0x11cbe0=typeof _0x2276ba['offset']===_0xa0e5('0x1b')&&typeof _0x2276ba[_0xa0e5('0x1c')]==='undefined';var _0x932bbc=_0x503b9c[_0xa0e5('0x1d')];var _0x5ed593=_0x11cbe0?0x0:_0x2276ba['offset'];var _0x4a6103=_0x11cbe0?_0x503b9c[_0xa0e5('0x1d')]:_0x2276ba[_0xa0e5('0x1e')]+_0x2276ba[_0xa0e5('0x1c')];var _0x33c7d4;if(_0x4a6103>=_0x932bbc){_0x4a6103=_0x932bbc;_0x33c7d4=0xc8;}else{_0x33c7d4=0xce;}_0x70c3ad[_0xa0e5('0x18')](_0x33c7d4);return _0x70c3ad[_0xa0e5('0x1f')]('Content-Range',_0x5ed593+'-'+_0x4a6103+'/'+_0x932bbc)[_0xa0e5('0x1a')](_0x503b9c);}return null;};}function patchUpdates(_0x396ccf){return function(_0x2a6cde){try{jsonpatch[_0xa0e5('0x20')](_0x2a6cde,_0x396ccf,!![]);}catch(_0x2c4c21){return BPromise[_0xa0e5('0x21')](_0x2c4c21);}return _0x2a6cde[_0xa0e5('0x22')]();};}function saveUpdates(_0x2c41e1,_0x1002b3){return function(_0x2524c9){if(_0x2524c9){return _0x2524c9[_0xa0e5('0x23')](_0x2c41e1)[_0xa0e5('0x24')](function(_0x1d5c77){return _0x1d5c77;});}return null;};}function removeEntity(_0x232903,_0x284549){return function(_0x391736){if(_0x391736){return _0x391736['destroy']()[_0xa0e5('0x24')](function(){var _0x6a08d5=_0x391736[_0xa0e5('0x25')]({'plain':!![]});var _0x3f704b=_0xa0e5('0x26');return db[_0xa0e5('0x27')][_0xa0e5('0x28')]({'where':{'type':_0x3f704b,'resourceId':_0x6a08d5['id']}})[_0xa0e5('0x24')](function(){return _0x391736;});})[_0xa0e5('0x24')](function(){_0x232903[_0xa0e5('0x18')](0xcc)[_0xa0e5('0x19')]();});}};}function handleEntityNotFound(_0x55fa33,_0x26aca0){return function(_0x1a370b){if(!_0x1a370b){_0x55fa33['sendStatus'](0x194);}return _0x1a370b;};}function handleError(_0x4748e3,_0x57623e){_0x57623e=_0x57623e||0x1f4;return function(_0x2ea545){logger[_0xa0e5('0x29')](_0x2ea545['stack']);if(_0x2ea545['name']){delete _0x2ea545['name'];}_0x4748e3[_0xa0e5('0x18')](_0x57623e)[_0xa0e5('0x2a')](_0x2ea545);};}exports[_0xa0e5('0x2b')]=function(_0x170121,_0x56bb92){var _0x26b316={},_0x5d9f7={},_0x93c0ac={'count':0x0,'rows':[]};var _0x46cf77=_[_0xa0e5('0x2c')](db[_0xa0e5('0x2d')]['rawAttributes'],function(_0x57c34f){return{'name':_0x57c34f[_0xa0e5('0x2e')],'type':_0x57c34f[_0xa0e5('0x2f')]['key']};});_0x5d9f7[_0xa0e5('0x30')]=_[_0xa0e5('0x2c')](_0x46cf77,_0xa0e5('0x31'));_0x5d9f7[_0xa0e5('0x32')]=_['keys'](_0x170121[_0xa0e5('0x32')]);_0x5d9f7['filters']=_[_0xa0e5('0x33')](_0x5d9f7[_0xa0e5('0x30')],_0x5d9f7['query']);_0x26b316['attributes']=_[_0xa0e5('0x33')](_0x5d9f7['model'],qs[_0xa0e5('0x34')](_0x170121[_0xa0e5('0x32')][_0xa0e5('0x34')]));_0x26b316['attributes']=_0x26b316['attributes'][_0xa0e5('0x35')]?_0x26b316[_0xa0e5('0x36')]:_0x5d9f7['model'];if(!_0x170121[_0xa0e5('0x32')][_0xa0e5('0x37')](_0xa0e5('0x38'))){_0x26b316['limit']=qs[_0xa0e5('0x1c')](_0x170121[_0xa0e5('0x32')][_0xa0e5('0x1c')]);_0x26b316[_0xa0e5('0x1e')]=qs[_0xa0e5('0x1e')](_0x170121[_0xa0e5('0x32')][_0xa0e5('0x1e')]);}_0x26b316['order']=qs[_0xa0e5('0x39')](_0x170121[_0xa0e5('0x32')][_0xa0e5('0x39')]);_0x26b316['where']=qs[_0xa0e5('0x3a')](_[_0xa0e5('0x3b')](_0x170121[_0xa0e5('0x32')],_0x5d9f7['filters']),_0x46cf77);if(_0x170121[_0xa0e5('0x32')][_0xa0e5('0x3c')]){_0x26b316['where']=_[_0xa0e5('0x3d')](_0x26b316['where'],{'$or':_['map'](_0x46cf77,function(_0x4de955){if(_0x4de955[_0xa0e5('0x2f')]!==_0xa0e5('0x3e')){var _0x1c448a={};_0x1c448a[_0x4de955[_0xa0e5('0x31')]]={'$like':'%'+_0x170121[_0xa0e5('0x32')]['filter']+'%'};return _0x1c448a;}})});}_0x26b316=_[_0xa0e5('0x3d')]({},_0x26b316,_0x170121[_0xa0e5('0x3f')]);var _0x216b95={'where':_0x26b316['where']};return db[_0xa0e5('0x2d')][_0xa0e5('0x1d')](_0x216b95)[_0xa0e5('0x24')](function(_0x38dc94){_0x93c0ac[_0xa0e5('0x1d')]=_0x38dc94;if(_0x170121['query'][_0xa0e5('0x40')]){_0x26b316[_0xa0e5('0x41')]=[{'all':!![]}];}return db[_0xa0e5('0x2d')][_0xa0e5('0x42')](_0x26b316);})[_0xa0e5('0x24')](function(_0x44321b){_0x93c0ac[_0xa0e5('0x43')]=_0x44321b;return _0x93c0ac;})['then'](respondWithFilteredResult(_0x56bb92,_0x26b316))[_0xa0e5('0x44')](handleError(_0x56bb92,null));};exports[_0xa0e5('0x45')]=function(_0x8472cc,_0x35d4d6){var _0x2749e6={'raw':!![],'where':{'id':_0x8472cc[_0xa0e5('0x46')]['id']}},_0x199e96={};_0x199e96[_0xa0e5('0x30')]=_[_0xa0e5('0x47')](db[_0xa0e5('0x2d')][_0xa0e5('0x48')]);_0x199e96[_0xa0e5('0x32')]=_['keys'](_0x8472cc['query']);_0x199e96['filters']=_[_0xa0e5('0x33')](_0x199e96['model'],_0x199e96[_0xa0e5('0x32')]);_0x2749e6[_0xa0e5('0x36')]=_[_0xa0e5('0x33')](_0x199e96[_0xa0e5('0x30')],qs['fields'](_0x8472cc['query'][_0xa0e5('0x34')]));_0x2749e6[_0xa0e5('0x36')]=_0x2749e6[_0xa0e5('0x36')][_0xa0e5('0x35')]?_0x2749e6[_0xa0e5('0x36')]:_0x199e96[_0xa0e5('0x30')];if(_0x8472cc[_0xa0e5('0x32')][_0xa0e5('0x40')]){_0x2749e6[_0xa0e5('0x41')]=[{'all':!![]}];}_0x2749e6=_['merge']({},_0x2749e6,_0x8472cc[_0xa0e5('0x3f')]);return db['CmHopperAdditionalPhone'][_0xa0e5('0x49')](_0x2749e6)[_0xa0e5('0x24')](handleEntityNotFound(_0x35d4d6,null))[_0xa0e5('0x24')](respondWithResult(_0x35d4d6,null))[_0xa0e5('0x44')](handleError(_0x35d4d6,null));};exports[_0xa0e5('0x4a')]=function(_0x1710d2,_0x2b543e){return db[_0xa0e5('0x2d')][_0xa0e5('0x4a')](_0x1710d2[_0xa0e5('0x4b')],{})[_0xa0e5('0x24')](function(_0x55d3aa){var _0xa3c3a=_0x1710d2[_0xa0e5('0x4c')][_0xa0e5('0x25')]({'plain':!![]});if(!_0xa3c3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3c3a[_0xa0e5('0x4d')]===_0xa0e5('0x4c')){var _0x572f97=_0x55d3aa[_0xa0e5('0x25')]({'plain':!![]});var _0x25bc68='CmHopperAdditionalPhones';return db[_0xa0e5('0x4e')][_0xa0e5('0x49')]({'where':{'name':_0x25bc68,'userProfileId':_0xa3c3a[_0xa0e5('0x4f')]},'raw':!![]})[_0xa0e5('0x24')](function(_0x582e2e){if(_0x582e2e&&_0x582e2e[_0xa0e5('0x50')]===0x0){return db[_0xa0e5('0x27')]['create']({'name':_0x572f97['name'],'resourceId':_0x572f97['id'],'type':_0x582e2e[_0xa0e5('0x31')],'sectionId':_0x582e2e['id']},{})[_0xa0e5('0x24')](function(){return _0x55d3aa;});}else{return _0x55d3aa;}})[_0xa0e5('0x44')](function(_0x4577ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4577ef);throw _0x4577ef;});}return _0x55d3aa;})[_0xa0e5('0x24')](respondWithResult(_0x2b543e,0xc9))[_0xa0e5('0x44')](handleError(_0x2b543e,null));};exports[_0xa0e5('0x23')]=function(_0x2b3db9,_0x3678f9){if(_0x2b3db9[_0xa0e5('0x4b')]['id']){delete _0x2b3db9[_0xa0e5('0x4b')]['id'];}return db['CmHopperAdditionalPhone'][_0xa0e5('0x49')]({'where':{'id':_0x2b3db9[_0xa0e5('0x46')]['id']}})[_0xa0e5('0x24')](handleEntityNotFound(_0x3678f9,null))[_0xa0e5('0x24')](saveUpdates(_0x2b3db9[_0xa0e5('0x4b')],null))[_0xa0e5('0x24')](respondWithResult(_0x3678f9,null))[_0xa0e5('0x44')](handleError(_0x3678f9,null));};exports[_0xa0e5('0x28')]=function(_0x197861,_0x13cdf0){return db[_0xa0e5('0x2d')][_0xa0e5('0x49')]({'where':{'id':_0x197861['params']['id']}})[_0xa0e5('0x24')](handleEntityNotFound(_0x13cdf0,null))['then'](removeEntity(_0x13cdf0,null))[_0xa0e5('0x44')](handleError(_0x13cdf0,null));}; \ No newline at end of file +var _0xd2af=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','role','CmHopperAdditionalPhones','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xd2af,0x6b));var _0xfd2a=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0xd2af[_0x266ddc];return _0x39c1d7;};'use strict';var emlformat=require(_0xfd2a('0x0'));var rimraf=require(_0xfd2a('0x1'));var zipdir=require(_0xfd2a('0x2'));var jsonpatch=require(_0xfd2a('0x3'));var rp=require(_0xfd2a('0x4'));var moment=require(_0xfd2a('0x5'));var BPromise=require(_0xfd2a('0x6'));var Mustache=require(_0xfd2a('0x7'));var util=require(_0xfd2a('0x8'));var path=require(_0xfd2a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfd2a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd2a('0xb'));var squel=require(_0xfd2a('0xc'));var crypto=require(_0xfd2a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfd2a('0xe'));var toCsv=require(_0xfd2a('0xf'));var querystring=require(_0xfd2a('0x10'));var Papa=require(_0xfd2a('0x11'));var Redis=require(_0xfd2a('0x12'));var authService=require(_0xfd2a('0x13'));var qs=require(_0xfd2a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd2a('0x15'));var logger=require(_0xfd2a('0x16'))('api');var utils=require(_0xfd2a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfd2a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2f28,_0xaa202f){_0xaa202f=_0xaa202f||0xcc;return function(_0x2c7357){if(_0x2c7357){return _0x4c2f28[_0xfd2a('0x19')](_0xaa202f);}return _0x4c2f28[_0xfd2a('0x1a')](_0xaa202f)[_0xfd2a('0x1b')]();};}function respondWithResult(_0x3ac67f,_0x347ba1){_0x347ba1=_0x347ba1||0xc8;return function(_0x14f2e7){if(_0x14f2e7){return _0x3ac67f[_0xfd2a('0x1a')](_0x347ba1)['json'](_0x14f2e7);}};}function respondWithFilteredResult(_0x2de96e,_0x5b938a){return function(_0x26f04d){if(_0x26f04d){var _0x2311df=typeof _0x5b938a['offset']===_0xfd2a('0x1c')&&typeof _0x5b938a['limit']===_0xfd2a('0x1c');var _0x4ced5b=_0x26f04d[_0xfd2a('0x1d')];var _0x31e4b5=_0x2311df?0x0:_0x5b938a['offset'];var _0x5be102=_0x2311df?_0x26f04d[_0xfd2a('0x1d')]:_0x5b938a[_0xfd2a('0x1e')]+_0x5b938a[_0xfd2a('0x1f')];var _0x19acd0;if(_0x5be102>=_0x4ced5b){_0x5be102=_0x4ced5b;_0x19acd0=0xc8;}else{_0x19acd0=0xce;}_0x2de96e[_0xfd2a('0x1a')](_0x19acd0);return _0x2de96e['set'](_0xfd2a('0x20'),_0x31e4b5+'-'+_0x5be102+'/'+_0x4ced5b)[_0xfd2a('0x21')](_0x26f04d);}return null;};}function patchUpdates(_0x5b2c1f){return function(_0x3dad41){try{jsonpatch[_0xfd2a('0x22')](_0x3dad41,_0x5b2c1f,!![]);}catch(_0x511749){return BPromise[_0xfd2a('0x23')](_0x511749);}return _0x3dad41[_0xfd2a('0x24')]();};}function saveUpdates(_0x5df606,_0x70a901){return function(_0x22d622){if(_0x22d622){return _0x22d622['update'](_0x5df606)[_0xfd2a('0x25')](function(_0x34ab2e){return _0x34ab2e;});}return null;};}function removeEntity(_0x175f82,_0x57dc33){return function(_0x2b1b17){if(_0x2b1b17){return _0x2b1b17['destroy']()[_0xfd2a('0x25')](function(){var _0x326989=_0x2b1b17[_0xfd2a('0x26')]({'plain':!![]});var _0xc8d3c1='CmHopperAdditionalPhones';return db[_0xfd2a('0x27')][_0xfd2a('0x28')]({'where':{'type':_0xc8d3c1,'resourceId':_0x326989['id']}})[_0xfd2a('0x25')](function(){return _0x2b1b17;});})['then'](function(){_0x175f82[_0xfd2a('0x1a')](0xcc)[_0xfd2a('0x1b')]();});}};}function handleEntityNotFound(_0x4ecc56,_0x3d2053){return function(_0x267464){if(!_0x267464){_0x4ecc56['sendStatus'](0x194);}return _0x267464;};}function handleError(_0x2c922d,_0x242114){_0x242114=_0x242114||0x1f4;return function(_0x1c6ccc){logger[_0xfd2a('0x29')](_0x1c6ccc[_0xfd2a('0x2a')]);if(_0x1c6ccc[_0xfd2a('0x2b')]){delete _0x1c6ccc[_0xfd2a('0x2b')];}_0x2c922d[_0xfd2a('0x1a')](_0x242114)[_0xfd2a('0x2c')](_0x1c6ccc);};}exports[_0xfd2a('0x2d')]=function(_0x3489db,_0x3dc7f0){var _0x56cf42={},_0x1a0010={},_0x365fdb={'count':0x0,'rows':[]};var _0x24a71c=_[_0xfd2a('0x2e')](db[_0xfd2a('0x2f')][_0xfd2a('0x30')],function(_0x4bd7ae){return{'name':_0x4bd7ae[_0xfd2a('0x31')],'type':_0x4bd7ae[_0xfd2a('0x32')][_0xfd2a('0x33')]};});_0x1a0010['model']=_[_0xfd2a('0x2e')](_0x24a71c,'name');_0x1a0010[_0xfd2a('0x34')]=_['keys'](_0x3489db[_0xfd2a('0x34')]);_0x1a0010['filters']=_[_0xfd2a('0x35')](_0x1a0010[_0xfd2a('0x36')],_0x1a0010[_0xfd2a('0x34')]);_0x56cf42[_0xfd2a('0x37')]=_['intersection'](_0x1a0010[_0xfd2a('0x36')],qs[_0xfd2a('0x38')](_0x3489db[_0xfd2a('0x34')]['fields']));_0x56cf42['attributes']=_0x56cf42[_0xfd2a('0x37')][_0xfd2a('0x39')]?_0x56cf42[_0xfd2a('0x37')]:_0x1a0010[_0xfd2a('0x36')];if(!_0x3489db[_0xfd2a('0x34')][_0xfd2a('0x3a')](_0xfd2a('0x3b'))){_0x56cf42[_0xfd2a('0x1f')]=qs[_0xfd2a('0x1f')](_0x3489db[_0xfd2a('0x34')][_0xfd2a('0x1f')]);_0x56cf42[_0xfd2a('0x1e')]=qs[_0xfd2a('0x1e')](_0x3489db[_0xfd2a('0x34')][_0xfd2a('0x1e')]);}_0x56cf42[_0xfd2a('0x3c')]=qs[_0xfd2a('0x3d')](_0x3489db['query'][_0xfd2a('0x3d')]);_0x56cf42[_0xfd2a('0x3e')]=qs[_0xfd2a('0x3f')](_[_0xfd2a('0x40')](_0x3489db[_0xfd2a('0x34')],_0x1a0010['filters']),_0x24a71c);if(_0x3489db['query'][_0xfd2a('0x41')]){_0x56cf42[_0xfd2a('0x3e')]=_[_0xfd2a('0x42')](_0x56cf42[_0xfd2a('0x3e')],{'$or':_[_0xfd2a('0x2e')](_0x24a71c,function(_0x5aede6){if(_0x5aede6['type']!=='VIRTUAL'){var _0x2278d1={};_0x2278d1[_0x5aede6['name']]={'$like':'%'+_0x3489db['query'][_0xfd2a('0x41')]+'%'};return _0x2278d1;}})});}_0x56cf42=_[_0xfd2a('0x42')]({},_0x56cf42,_0x3489db[_0xfd2a('0x43')]);var _0xfd42be={'where':_0x56cf42['where']};return db[_0xfd2a('0x2f')][_0xfd2a('0x1d')](_0xfd42be)[_0xfd2a('0x25')](function(_0x20d19a){_0x365fdb[_0xfd2a('0x1d')]=_0x20d19a;if(_0x3489db['query'][_0xfd2a('0x44')]){_0x56cf42[_0xfd2a('0x45')]=[{'all':!![]}];}return db[_0xfd2a('0x2f')][_0xfd2a('0x46')](_0x56cf42);})['then'](function(_0xdcf69e){_0x365fdb[_0xfd2a('0x47')]=_0xdcf69e;return _0x365fdb;})[_0xfd2a('0x25')](respondWithFilteredResult(_0x3dc7f0,_0x56cf42))[_0xfd2a('0x48')](handleError(_0x3dc7f0,null));};exports[_0xfd2a('0x49')]=function(_0x48efba,_0x5b2b5a){var _0x558bcc={'raw':!![],'where':{'id':_0x48efba[_0xfd2a('0x4a')]['id']}},_0x1931a0={};_0x1931a0['model']=_['keys'](db[_0xfd2a('0x2f')][_0xfd2a('0x30')]);_0x1931a0[_0xfd2a('0x34')]=_[_0xfd2a('0x4b')](_0x48efba[_0xfd2a('0x34')]);_0x1931a0[_0xfd2a('0x3f')]=_[_0xfd2a('0x35')](_0x1931a0['model'],_0x1931a0[_0xfd2a('0x34')]);_0x558bcc[_0xfd2a('0x37')]=_[_0xfd2a('0x35')](_0x1931a0[_0xfd2a('0x36')],qs[_0xfd2a('0x38')](_0x48efba[_0xfd2a('0x34')][_0xfd2a('0x38')]));_0x558bcc[_0xfd2a('0x37')]=_0x558bcc[_0xfd2a('0x37')][_0xfd2a('0x39')]?_0x558bcc[_0xfd2a('0x37')]:_0x1931a0['model'];if(_0x48efba['query']['includeAll']){_0x558bcc['include']=[{'all':!![]}];}_0x558bcc=_[_0xfd2a('0x42')]({},_0x558bcc,_0x48efba[_0xfd2a('0x43')]);return db[_0xfd2a('0x2f')][_0xfd2a('0x4c')](_0x558bcc)[_0xfd2a('0x25')](handleEntityNotFound(_0x5b2b5a,null))[_0xfd2a('0x25')](respondWithResult(_0x5b2b5a,null))[_0xfd2a('0x48')](handleError(_0x5b2b5a,null));};exports[_0xfd2a('0x4d')]=function(_0x36aea6,_0x1f1b39){return db[_0xfd2a('0x2f')]['create'](_0x36aea6[_0xfd2a('0x4e')],{})[_0xfd2a('0x25')](function(_0x2d6ce7){var _0x2f8ae4=_0x36aea6[_0xfd2a('0x4f')][_0xfd2a('0x26')]({'plain':!![]});if(!_0x2f8ae4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8ae4[_0xfd2a('0x50')]===_0xfd2a('0x4f')){var _0x14b019=_0x2d6ce7[_0xfd2a('0x26')]({'plain':!![]});var _0x4d73d9=_0xfd2a('0x51');return db['UserProfileSection'][_0xfd2a('0x4c')]({'where':{'name':_0x4d73d9,'userProfileId':_0x2f8ae4[_0xfd2a('0x52')]},'raw':!![]})['then'](function(_0x441d2f){if(_0x441d2f&&_0x441d2f[_0xfd2a('0x53')]===0x0){return db[_0xfd2a('0x27')][_0xfd2a('0x4d')]({'name':_0x14b019['name'],'resourceId':_0x14b019['id'],'type':_0x441d2f[_0xfd2a('0x2b')],'sectionId':_0x441d2f['id']},{})[_0xfd2a('0x25')](function(){return _0x2d6ce7;});}else{return _0x2d6ce7;}})[_0xfd2a('0x48')](function(_0x14186d){logger[_0xfd2a('0x29')](_0xfd2a('0x54'),_0x14186d);throw _0x14186d;});}return _0x2d6ce7;})['then'](respondWithResult(_0x1f1b39,0xc9))[_0xfd2a('0x48')](handleError(_0x1f1b39,null));};exports[_0xfd2a('0x55')]=function(_0x2ddb03,_0x258023){if(_0x2ddb03[_0xfd2a('0x4e')]['id']){delete _0x2ddb03[_0xfd2a('0x4e')]['id'];}return db[_0xfd2a('0x2f')][_0xfd2a('0x4c')]({'where':{'id':_0x2ddb03[_0xfd2a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x258023,null))['then'](saveUpdates(_0x2ddb03[_0xfd2a('0x4e')],null))['then'](respondWithResult(_0x258023,null))[_0xfd2a('0x48')](handleError(_0x258023,null));};exports[_0xfd2a('0x28')]=function(_0x4bd527,_0x5389d9){return db[_0xfd2a('0x2f')]['find']({'where':{'id':_0x4bd527['params']['id']}})[_0xfd2a('0x25')](handleEntityNotFound(_0x5389d9,null))[_0xfd2a('0x25')](removeEntity(_0x5389d9,null))[_0xfd2a('0x48')](handleError(_0x5389d9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index b2470ff..ec3a159 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4e3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util'];(function(_0x1dcb61,_0x533143){var _0x275729=function(_0x1987eb){while(--_0x1987eb){_0x1dcb61['push'](_0x1dcb61['shift']());}};_0x275729(++_0x533143);}(_0xe4e3,0x196));var _0x3e4e=function(_0x3f45b6,_0x4acdc3){_0x3f45b6=_0x3f45b6-0x0;var _0x1cacec=_0xe4e3[_0x3f45b6];return _0x1cacec;};'use strict';var _=require(_0x3e4e('0x0'));var util=require(_0x3e4e('0x1'));var logger=require(_0x3e4e('0x2'))(_0x3e4e('0x3'));var moment=require(_0x3e4e('0x4'));var BPromise=require(_0x3e4e('0x5'));var rp=require(_0x3e4e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e4e('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x3e4e('0x8')]=function(_0x256c33,_0x1bd467){return _0x256c33[_0x3e4e('0x9')](_0x3e4e('0xa'),attributes,{'tableName':_0x3e4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb73=['cm_hopper_additional_phones','lodash','moment','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define'];(function(_0x466bfd,_0x56f4bb){var _0x29293d=function(_0x47298b){while(--_0x47298b){_0x466bfd['push'](_0x466bfd['shift']());}};_0x29293d(++_0x56f4bb);}(_0xcb73,0xf9));var _0x3cb7=function(_0x344b54,_0x4c8fb5){_0x344b54=_0x344b54-0x0;var _0x1d9812=_0xcb73[_0x344b54];return _0x1d9812;};'use strict';var _=require(_0x3cb7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3cb7('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cb7('0x2'));var rimraf=require('rimraf');var config=require(_0x3cb7('0x3'));var attributes=require(_0x3cb7('0x4'));module[_0x3cb7('0x5')]=function(_0x3510af,_0x2dcf1c){return _0x3510af[_0x3cb7('0x6')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x3cb7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 3a35a35..be32a44 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2dc=['randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countbusyretry','ContactId','ListId','duration','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','countagentrejectretry','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','bluebird'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc2dc,0x106));var _0xcc2d=function(_0x4df17c,_0x2d2b61){_0x4df17c=_0x4df17c-0x0;var _0x4e79b5=_0xc2dc[_0x4df17c];return _0x4e79b5;};'use strict';var _=require(_0xcc2d('0x0'));var util=require(_0xcc2d('0x1'));var moment=require('moment');var BPromise=require(_0xcc2d('0x2'));var rs=require(_0xcc2d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc2d('0x4'));var logger=require(_0xcc2d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcc2d('0x6'));var client=jayson[_0xcc2d('0x7')][_0xcc2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x564a61,_0x5473b0,_0x85f68a){return new BPromise(function(_0x4263f8,_0x592631){return client[_0xcc2d('0x9')](_0x564a61,_0x85f68a)[_0xcc2d('0xa')](function(_0x86b31e){logger['info'](_0xcc2d('0xb'),_0x5473b0,_0xcc2d('0xc'));logger[_0xcc2d('0xd')](_0xcc2d('0xe'),_0x5473b0,'request\x20sent',JSON[_0xcc2d('0xf')](_0x86b31e));if(_0x86b31e[_0xcc2d('0x10')]){if(_0x86b31e[_0xcc2d('0x10')]['code']===0x1f4){logger[_0xcc2d('0x10')](_0xcc2d('0xb'),_0x5473b0,_0x86b31e[_0xcc2d('0x10')]['message']);return _0x592631(_0x86b31e['error']['message']);}logger[_0xcc2d('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5473b0,_0x86b31e[_0xcc2d('0x10')]['message']);return _0x4263f8(_0x86b31e[_0xcc2d('0x10')][_0xcc2d('0x11')]);}else{logger['info'](_0xcc2d('0xb'),_0x5473b0,_0xcc2d('0xc'));_0x4263f8(_0x86b31e['result']['message']);}})[_0xcc2d('0x12')](function(_0x2511b3){logger['error'](_0xcc2d('0xb'),_0x5473b0,_0x2511b3);_0x592631(_0x2511b3);});});}exports[_0xcc2d('0x13')]=function(_0x24a1d7){var _0x2e9bb1=this;return new Promise(function(_0x19b156,_0xb3e88){return db[_0xcc2d('0x14')][_0xcc2d('0x15')]({'raw':!![],'where':{'ContactId':_0x24a1d7[_0xcc2d('0x16')]['ContactId'],'ListId':_0x24a1d7[_0xcc2d('0x16')]['ListId'],'VoiceQueueId':_0x24a1d7['body'][_0xcc2d('0x17')]===undefined?null:_0x24a1d7[_0xcc2d('0x16')][_0xcc2d('0x17')],'CampaignId':_0x24a1d7['body']['CampaignId']===undefined?null:_0x24a1d7[_0xcc2d('0x16')][_0xcc2d('0x18')]}})[_0xcc2d('0xa')](function(_0x5ef3c0){if(_0x5ef3c0!=null){return db[_0xcc2d('0x19')][_0xcc2d('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5ef3c0['id'],'OrderBy':{'$gt':_0x5ef3c0[_0xcc2d('0x1a')]}},'order':[[_0xcc2d('0x1a'),_0xcc2d('0x1b')]]})['then'](function(_0xdcf904){var _0xe84c06=0x0;if(_0xdcf904){if(_0xdcf904['countbusyretry']+_0xdcf904[_0xcc2d('0x1c')]+_0xdcf904[_0xcc2d('0x1d')]+_0xdcf904[_0xcc2d('0x1e')]+_0xdcf904[_0xcc2d('0x1f')]+_0xdcf904[_0xcc2d('0x20')]+_0xdcf904[_0xcc2d('0x21')]+_0xdcf904['countagentrejectretry']<_0x24a1d7[_0xcc2d('0x22')][_0xcc2d('0x23')])_0xe84c06=0x1;_0x19b156({'additional':_0xe84c06});}else{return db[_0xcc2d('0x19')][_0xcc2d('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5ef3c0['id']},'order':[['OrderBy','ASC']]})[_0xcc2d('0xa')](function(_0x1d826d){var _0x52ac51=0x0;if(_0x1d826d){if(_0x1d826d[_0xcc2d('0x24')]+_0x1d826d[_0xcc2d('0x1c')]+_0x1d826d['countnoanswerretry']+_0x1d826d[_0xcc2d('0x1e')]+_0x1d826d[_0xcc2d('0x1f')]+_0x1d826d[_0xcc2d('0x20')]+_0x1d826d[_0xcc2d('0x21')]+_0x1d826d['countagentrejectretry']<_0x24a1d7['entity'][_0xcc2d('0x23')])_0x52ac51=0x1;_0x19b156({'additional':_0x52ac51});}else{_0x19b156({'additional':0x0});}})['catch'](function(_0x38713f){logger[_0xcc2d('0x10')](_0xcc2d('0x13'),_0x38713f['message']);_0xb3e88(_0x2e9bb1[_0xcc2d('0x10')](0x1f4,_0x38713f['message']));});}})['catch'](function(_0x25e24a){logger[_0xcc2d('0x10')](_0xcc2d('0x13'),_0x25e24a[_0xcc2d('0x11')]);_0xb3e88(_0x2e9bb1['error'](0x1f4,_0x25e24a['message']));});}else _0x19b156({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x438e0d){var _0x164f20=this;return new Promise(function(_0x2588c7,_0x4485b1){return db[_0xcc2d('0x14')]['findOne']({'raw':!![],'where':{'ContactId':_0x438e0d['body'][_0xcc2d('0x25')],'ListId':_0x438e0d[_0xcc2d('0x16')][_0xcc2d('0x26')],'VoiceQueueId':_0x438e0d['body'][_0xcc2d('0x17')]===undefined?null:_0x438e0d[_0xcc2d('0x16')][_0xcc2d('0x17')],'CampaignId':_0x438e0d[_0xcc2d('0x16')][_0xcc2d('0x18')]===undefined?null:_0x438e0d[_0xcc2d('0x16')][_0xcc2d('0x18')]}})[_0xcc2d('0xa')](function(_0x3252b1){if(_0x3252b1!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3252b1['id'],'OrderBy':{'$gte':_0x3252b1['OrderBy']}},'order':[['OrderBy',_0xcc2d('0x1b')]]})[_0xcc2d('0xa')](function(_0x4221f1){if(_0x4221f1)return activateAdditionalPhone(_0x3252b1,_0x438e0d[_0xcc2d('0x16')],_0x4221f1,_0x438e0d[_0xcc2d('0x27')],_0x438e0d['waitTime'])['then'](function(_0x1c364e){_0x2588c7(_0x1c364e);});else{return db[_0xcc2d('0x19')][_0xcc2d('0x15')]({'raw':!![],'where':{'CmHopperId':_0x3252b1['id']},'order':[[_0xcc2d('0x1a'),'ASC']]})[_0xcc2d('0xa')](function(_0x12b2fa){if(_0x12b2fa)return activateAdditionalPhone(_0x3252b1,_0x438e0d['body'],_0x12b2fa,_0x438e0d[_0xcc2d('0x27')],_0x438e0d['waitTime'])[_0xcc2d('0xa')](function(_0x1679d0){_0x2588c7(_0x1679d0);});else{_0x2588c7({'id':_0x3252b1['id'],'phone':''});}})[_0xcc2d('0x12')](function(_0x5246c2){logger[_0xcc2d('0x10')]('VerifyAdditionalPhones',_0x5246c2[_0xcc2d('0x11')]);_0x4485b1(_0x164f20[_0xcc2d('0x10')](0x1f4,_0x5246c2['message']));});}})[_0xcc2d('0x12')](function(_0x1dfb26){logger['error'](_0xcc2d('0x13'),_0x1dfb26[_0xcc2d('0x11')]);_0x4485b1(_0x164f20[_0xcc2d('0x10')](0x1f4,_0x1dfb26[_0xcc2d('0x11')]));});}else _0x2588c7(0x1);});});};function activateAdditionalPhone(_0x113d1b,_0x109d8d,_0x4a92b8,_0x103629,_0x3bc492){return new Promise(function(_0x5da8c0,_0x38819b){var _0x393929;if(_[_0xcc2d('0x28')](_0x4a92b8[_0xcc2d('0x29')])){_0x4a92b8[_0xcc2d('0x29')]=moment();}if(moment()>moment(_0x4a92b8['scheduledat'])){_0x393929=moment()[_0xcc2d('0x2a')](_0x3bc492||0x3,_0xcc2d('0x2b'));}else{if(_0x4a92b8[_0xcc2d('0x1a')]==0x0){_0x393929=moment(_0x4a92b8[_0xcc2d('0x29')]);}else{_0x393929=moment()[_0xcc2d('0x2a')](_0x3bc492||0x3,_0xcc2d('0x2b'));}}if(_[_0xcc2d('0x28')](_0x393929)){_0x393929=moment()['add'](_0x3bc492||0x3,'minutes');}var _0x432aaa={'phone':_0x113d1b['phone'],'active':0x0,'OrderBy':_[_0xcc2d('0x28')](_0x113d1b['OrderBy'])?0x0:_0x113d1b['OrderBy'],'scheduledat':moment()[_0xcc2d('0x2a')](_0x103629||0x1,'minutes'),'countbusyretry':_0x109d8d['countbusyretry'],'countcongestionretry':_0x109d8d['countcongestionretry'],'countnoanswerretry':_0x109d8d[_0xcc2d('0x1d')],'countnosuchnumberretry':_0x109d8d[_0xcc2d('0x1e')],'countdropretry':_0x109d8d[_0xcc2d('0x1f')],'countabandonedretry':_0x109d8d['countabandonedretry'],'countmachineretry':_0x109d8d[_0xcc2d('0x21')],'countagentrejectretry':_0x109d8d['countagentrejectretry'],'createdAt':_0x109d8d[_0xcc2d('0x2c')],'updatedAt':_0x109d8d[_0xcc2d('0x2d')]};var _0x1eb8d7={'CmHopperId':_0x113d1b['id'],'phone':_0x4a92b8[_0xcc2d('0x2e')],'active':0x0,'OrderBy':_[_0xcc2d('0x28')](_0x4a92b8[_0xcc2d('0x1a')])?0x0:_0x4a92b8[_0xcc2d('0x1a')],'scheduledat':_0x393929,'countbusyretry':_0x4a92b8['countbusyretry'],'countcongestionretry':_0x4a92b8[_0xcc2d('0x1c')],'countnoanswerretry':_0x4a92b8[_0xcc2d('0x1d')],'countnosuchnumberretry':_0x4a92b8[_0xcc2d('0x1e')],'countdropretry':_0x4a92b8[_0xcc2d('0x1f')],'countabandonedretry':_0x4a92b8['countabandonedretry'],'countmachineretry':_0x4a92b8[_0xcc2d('0x21')],'countagentrejectretry':_0x4a92b8[_0xcc2d('0x2f')],'createdAt':_0x4a92b8[_0xcc2d('0x2c')],'updatedAt':_0x4a92b8[_0xcc2d('0x2d')]};return db[_0xcc2d('0x30')][_0xcc2d('0x31')](function(_0x493072){return db[_0xcc2d('0x19')][_0xcc2d('0x32')](_0x432aaa,{'where':{'id':_0x4a92b8['id']}},{'transaction':_0x493072})[_0xcc2d('0xa')](function(){return db['CmHopper'][_0xcc2d('0x32')](_0x1eb8d7,{'where':{'id':_0x113d1b['id']}},{'transaction':_0x493072});});})[_0xcc2d('0xa')](function(_0x1e6c8e){_0x5da8c0({'id':_0x113d1b['id'],'phone':_0x4a92b8[_0xcc2d('0x2e')]});})[_0xcc2d('0x12')](function(_0x101b83){logger[_0xcc2d('0x10')]('activateAdditionalPhone',_0x101b83[_0xcc2d('0x11')]);_0x38819b({'error':_0x101b83[_0xcc2d('0x11')]});});});}exports[_0xcc2d('0x33')]=function(_0x529913){var _0x4bffa0=this;return new Promise(function(_0x17de67,_0x50f728){return db[_0xcc2d('0x14')][_0xcc2d('0x32')](_0x529913[_0xcc2d('0x16')][_0xcc2d('0x34')],{'where':{'id':_0x529913[_0xcc2d('0x16')]['id']}})[_0xcc2d('0xa')](function(_0x4a7350){_0x17de67(_0x4a7350);})[_0xcc2d('0x12')](function(_0x1324cf){logger['error'](_0xcc2d('0x33'),_0x1324cf[_0xcc2d('0x11')]);_0x50f728(_0x4bffa0[_0xcc2d('0x10')](0x1f4,_0x1324cf[_0xcc2d('0x11')]));});});}; \ No newline at end of file +var _0xf2c2=['countnosuchnumberretry','countmachineretry','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','createdAt','updatedAt','phone','sequelize','transaction','update','IncrementPreviewCounters','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone'];(function(_0x326aa7,_0x12dceb){var _0x3955b2=function(_0x1fc290){while(--_0x1fc290){_0x326aa7['push'](_0x326aa7['shift']());}};_0x3955b2(++_0x12dceb);}(_0xf2c2,0x132));var _0x2f2c=function(_0x57913b,_0x41bb78){_0x57913b=_0x57913b-0x0;var _0x5ce491=_0xf2c2[_0x57913b];return _0x5ce491;};'use strict';var _=require(_0x2f2c('0x0'));var util=require(_0x2f2c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f2c('0x2'));var fs=require('fs');var Redis=require(_0x2f2c('0x3'));var db=require(_0x2f2c('0x4'))['db'];var utils=require(_0x2f2c('0x5'));var logger=require(_0x2f2c('0x6'))(_0x2f2c('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f2c('0x8'));var client=jayson[_0x2f2c('0x9')][_0x2f2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x485bfd,_0x1d2092,_0x5134e8){return new BPromise(function(_0x47c357,_0x19c5ce){return client[_0x2f2c('0xb')](_0x485bfd,_0x5134e8)[_0x2f2c('0xc')](function(_0x519cfe){logger[_0x2f2c('0xd')](_0x2f2c('0xe'),_0x1d2092,_0x2f2c('0xf'));logger[_0x2f2c('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x1d2092,'request\x20sent',JSON[_0x2f2c('0x11')](_0x519cfe));if(_0x519cfe[_0x2f2c('0x12')]){if(_0x519cfe[_0x2f2c('0x12')][_0x2f2c('0x13')]===0x1f4){logger[_0x2f2c('0x12')](_0x2f2c('0xe'),_0x1d2092,_0x519cfe['error']['message']);return _0x19c5ce(_0x519cfe[_0x2f2c('0x12')][_0x2f2c('0x14')]);}logger[_0x2f2c('0x12')](_0x2f2c('0xe'),_0x1d2092,_0x519cfe[_0x2f2c('0x12')][_0x2f2c('0x14')]);return _0x47c357(_0x519cfe[_0x2f2c('0x12')][_0x2f2c('0x14')]);}else{logger[_0x2f2c('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1d2092,_0x2f2c('0xf'));_0x47c357(_0x519cfe[_0x2f2c('0x15')][_0x2f2c('0x14')]);}})[_0x2f2c('0x16')](function(_0x3f36c6){logger[_0x2f2c('0x12')](_0x2f2c('0xe'),_0x1d2092,_0x3f36c6);_0x19c5ce(_0x3f36c6);});});}exports[_0x2f2c('0x17')]=function(_0x4e1350){var _0x52c187=this;return new Promise(function(_0x235cbf,_0x930f8e){return db[_0x2f2c('0x18')][_0x2f2c('0x19')]({'raw':!![],'where':{'ContactId':_0x4e1350[_0x2f2c('0x1a')][_0x2f2c('0x1b')],'ListId':_0x4e1350['body'][_0x2f2c('0x1c')],'VoiceQueueId':_0x4e1350[_0x2f2c('0x1a')][_0x2f2c('0x1d')]===undefined?null:_0x4e1350[_0x2f2c('0x1a')]['VoiceQueueId'],'CampaignId':_0x4e1350[_0x2f2c('0x1a')]['CampaignId']===undefined?null:_0x4e1350[_0x2f2c('0x1a')][_0x2f2c('0x1e')]}})[_0x2f2c('0xc')](function(_0x4ce150){if(_0x4ce150!=null){return db['CmHopperAdditionalPhone'][_0x2f2c('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4ce150['id'],'OrderBy':{'$gt':_0x4ce150[_0x2f2c('0x1f')]}},'order':[[_0x2f2c('0x1f'),_0x2f2c('0x20')]]})[_0x2f2c('0xc')](function(_0x74d3ef){var _0x584d48=0x0;if(_0x74d3ef){if(_0x74d3ef[_0x2f2c('0x21')]+_0x74d3ef[_0x2f2c('0x22')]+_0x74d3ef[_0x2f2c('0x23')]+_0x74d3ef['countnosuchnumberretry']+_0x74d3ef[_0x2f2c('0x24')]+_0x74d3ef[_0x2f2c('0x25')]+_0x74d3ef['countmachineretry']+_0x74d3ef[_0x2f2c('0x26')]<_0x4e1350[_0x2f2c('0x27')][_0x2f2c('0x28')])_0x584d48=0x1;_0x235cbf({'additional':_0x584d48});}else{return db[_0x2f2c('0x29')][_0x2f2c('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4ce150['id']},'order':[[_0x2f2c('0x1f'),'ASC']]})[_0x2f2c('0xc')](function(_0x458050){var _0x16ee0a=0x0;if(_0x458050){if(_0x458050[_0x2f2c('0x21')]+_0x458050[_0x2f2c('0x22')]+_0x458050[_0x2f2c('0x23')]+_0x458050[_0x2f2c('0x2a')]+_0x458050[_0x2f2c('0x24')]+_0x458050[_0x2f2c('0x25')]+_0x458050[_0x2f2c('0x2b')]+_0x458050[_0x2f2c('0x26')]<_0x4e1350[_0x2f2c('0x27')][_0x2f2c('0x28')])_0x16ee0a=0x1;_0x235cbf({'additional':_0x16ee0a});}else{_0x235cbf({'additional':0x0});}})[_0x2f2c('0x16')](function(_0x2fb406){logger['error'](_0x2f2c('0x17'),_0x2fb406[_0x2f2c('0x14')]);_0x930f8e(_0x52c187[_0x2f2c('0x12')](0x1f4,_0x2fb406[_0x2f2c('0x14')]));});}})[_0x2f2c('0x16')](function(_0x3bcb5f){logger[_0x2f2c('0x12')](_0x2f2c('0x17'),_0x3bcb5f[_0x2f2c('0x14')]);_0x930f8e(_0x52c187['error'](0x1f4,_0x3bcb5f[_0x2f2c('0x14')]));});}else _0x235cbf({'additional':0x0});});});};exports[_0x2f2c('0x2c')]=function(_0x493168){var _0x493e31=this;return new Promise(function(_0x3ab714,_0x3e4568){return db[_0x2f2c('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x493168['body'][_0x2f2c('0x1b')],'ListId':_0x493168[_0x2f2c('0x1a')][_0x2f2c('0x1c')],'VoiceQueueId':_0x493168[_0x2f2c('0x1a')][_0x2f2c('0x1d')]===undefined?null:_0x493168[_0x2f2c('0x1a')][_0x2f2c('0x1d')],'CampaignId':_0x493168[_0x2f2c('0x1a')]['CampaignId']===undefined?null:_0x493168[_0x2f2c('0x1a')][_0x2f2c('0x1e')]}})[_0x2f2c('0xc')](function(_0x2c4f6f){if(_0x2c4f6f!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2c4f6f['id'],'OrderBy':{'$gte':_0x2c4f6f[_0x2f2c('0x1f')]}},'order':[[_0x2f2c('0x1f'),_0x2f2c('0x20')]]})[_0x2f2c('0xc')](function(_0x464c05){if(_0x464c05)return activateAdditionalPhone(_0x2c4f6f,_0x493168[_0x2f2c('0x1a')],_0x464c05,_0x493168[_0x2f2c('0x2d')],_0x493168[_0x2f2c('0x2e')])[_0x2f2c('0xc')](function(_0x4f977c){_0x3ab714(_0x4f977c);});else{return db['CmHopperAdditionalPhone'][_0x2f2c('0x19')]({'raw':!![],'where':{'CmHopperId':_0x2c4f6f['id']},'order':[['OrderBy',_0x2f2c('0x20')]]})[_0x2f2c('0xc')](function(_0x4071a3){if(_0x4071a3)return activateAdditionalPhone(_0x2c4f6f,_0x493168[_0x2f2c('0x1a')],_0x4071a3,_0x493168[_0x2f2c('0x2d')],_0x493168[_0x2f2c('0x2e')])['then'](function(_0x5da4f9){_0x3ab714(_0x5da4f9);});else{_0x3ab714({'id':_0x2c4f6f['id'],'phone':''});}})[_0x2f2c('0x16')](function(_0x2945de){logger['error'](_0x2f2c('0x17'),_0x2945de[_0x2f2c('0x14')]);_0x3e4568(_0x493e31['error'](0x1f4,_0x2945de[_0x2f2c('0x14')]));});}})[_0x2f2c('0x16')](function(_0x362774){logger[_0x2f2c('0x12')](_0x2f2c('0x17'),_0x362774['message']);_0x3e4568(_0x493e31[_0x2f2c('0x12')](0x1f4,_0x362774[_0x2f2c('0x14')]));});}else _0x3ab714(0x1);});});};function activateAdditionalPhone(_0xa32d96,_0x2000d9,_0x13ff1f,_0x127364,_0x960840){return new Promise(function(_0x2406d5,_0x33d225){var _0x342dd8;if(_['isNil'](_0x13ff1f['scheduledat'])){_0x13ff1f[_0x2f2c('0x2f')]=moment();}if(moment()>moment(_0x13ff1f[_0x2f2c('0x2f')])){_0x342dd8=moment()[_0x2f2c('0x30')](_0x960840||0x3,_0x2f2c('0x31'));}else{if(_0x13ff1f[_0x2f2c('0x1f')]==0x0){_0x342dd8=moment(_0x13ff1f['scheduledat']);}else{_0x342dd8=moment()[_0x2f2c('0x30')](_0x960840||0x3,'minutes');}}if(_[_0x2f2c('0x32')](_0x342dd8)){_0x342dd8=moment()['add'](_0x960840||0x3,_0x2f2c('0x31'));}var _0xeb88a8={'phone':_0xa32d96['phone'],'active':0x0,'OrderBy':_['isNil'](_0xa32d96['OrderBy'])?0x0:_0xa32d96[_0x2f2c('0x1f')],'scheduledat':moment()[_0x2f2c('0x30')](_0x127364||0x1,_0x2f2c('0x31')),'countbusyretry':_0x2000d9[_0x2f2c('0x21')],'countcongestionretry':_0x2000d9[_0x2f2c('0x22')],'countnoanswerretry':_0x2000d9['countnoanswerretry'],'countnosuchnumberretry':_0x2000d9[_0x2f2c('0x2a')],'countdropretry':_0x2000d9[_0x2f2c('0x24')],'countabandonedretry':_0x2000d9['countabandonedretry'],'countmachineretry':_0x2000d9[_0x2f2c('0x2b')],'countagentrejectretry':_0x2000d9[_0x2f2c('0x26')],'createdAt':_0x2000d9[_0x2f2c('0x33')],'updatedAt':_0x2000d9[_0x2f2c('0x34')]};var _0x5a942d={'CmHopperId':_0xa32d96['id'],'phone':_0x13ff1f[_0x2f2c('0x35')],'active':0x0,'OrderBy':_[_0x2f2c('0x32')](_0x13ff1f['OrderBy'])?0x0:_0x13ff1f['OrderBy'],'scheduledat':_0x342dd8,'countbusyretry':_0x13ff1f[_0x2f2c('0x21')],'countcongestionretry':_0x13ff1f[_0x2f2c('0x22')],'countnoanswerretry':_0x13ff1f[_0x2f2c('0x23')],'countnosuchnumberretry':_0x13ff1f[_0x2f2c('0x2a')],'countdropretry':_0x13ff1f[_0x2f2c('0x24')],'countabandonedretry':_0x13ff1f['countabandonedretry'],'countmachineretry':_0x13ff1f[_0x2f2c('0x2b')],'countagentrejectretry':_0x13ff1f[_0x2f2c('0x26')],'createdAt':_0x13ff1f[_0x2f2c('0x33')],'updatedAt':_0x13ff1f[_0x2f2c('0x34')]};return db[_0x2f2c('0x36')][_0x2f2c('0x37')](function(_0x5665ab){return db['CmHopperAdditionalPhone']['update'](_0xeb88a8,{'where':{'id':_0x13ff1f['id']}},{'transaction':_0x5665ab})[_0x2f2c('0xc')](function(){return db['CmHopper'][_0x2f2c('0x38')](_0x5a942d,{'where':{'id':_0xa32d96['id']}},{'transaction':_0x5665ab});});})[_0x2f2c('0xc')](function(_0x1a87c2){_0x2406d5({'id':_0xa32d96['id'],'phone':_0x13ff1f[_0x2f2c('0x35')]});})[_0x2f2c('0x16')](function(_0x28ac2f){logger['error']('activateAdditionalPhone',_0x28ac2f[_0x2f2c('0x14')]);_0x33d225({'error':_0x28ac2f[_0x2f2c('0x14')]});});});}exports[_0x2f2c('0x39')]=function(_0xa31455){var _0x5a46ba=this;return new Promise(function(_0x18157d,_0x903e85){return db[_0x2f2c('0x18')][_0x2f2c('0x38')](_0xa31455[_0x2f2c('0x1a')]['field'],{'where':{'id':_0xa31455['body']['id']}})['then'](function(_0x2b60ea){_0x18157d(_0x2b60ea);})[_0x2f2c('0x16')](function(_0x3b3846){logger[_0x2f2c('0x12')]('IncrementPreviewCounters',_0x3b3846[_0x2f2c('0x14')]);_0x903e85(_0x5a46ba[_0x2f2c('0x12')](0x1f4,_0x3b3846['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c1edc2d..2356849 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42cd=['post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id'];(function(_0x79a20c,_0x3172c5){var _0xc50dc1=function(_0x36280f){while(--_0x36280f){_0x79a20c['push'](_0x79a20c['shift']());}};_0xc50dc1(++_0x3172c5);}(_0x42cd,0x17f));var _0xd42c=function(_0x5b3c90,_0x45b28c){_0x5b3c90=_0x5b3c90-0x0;var _0xd1ae5e=_0x42cd[_0x5b3c90];return _0xd1ae5e;};'use strict';var multer=require(_0xd42c('0x0'));var util=require('util');var path=require(_0xd42c('0x1'));var timeout=require(_0xd42c('0x2'));var express=require(_0xd42c('0x3'));var router=express[_0xd42c('0x4')]();var fs_extra=require(_0xd42c('0x5'));var auth=require(_0xd42c('0x6'));var interaction=require(_0xd42c('0x7'));var config=require(_0xd42c('0x8'));var controller=require(_0xd42c('0x9'));router[_0xd42c('0xa')]('/',auth[_0xd42c('0xb')](),controller['index']);router[_0xd42c('0xa')](_0xd42c('0xc'),auth[_0xd42c('0xb')](),controller['show']);router[_0xd42c('0xd')]('/',auth[_0xd42c('0xb')](),controller['create']);router['put'](_0xd42c('0xc'),auth[_0xd42c('0xb')](),controller[_0xd42c('0xe')]);router[_0xd42c('0xf')](_0xd42c('0xc'),auth[_0xd42c('0xb')](),controller[_0xd42c('0x10')]);module[_0xd42c('0x11')]=router; \ No newline at end of file +var _0x5523=['update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','post','create'];(function(_0x594a7c,_0x168001){var _0x392474=function(_0x56a6b9){while(--_0x56a6b9){_0x594a7c['push'](_0x594a7c['shift']());}};_0x392474(++_0x168001);}(_0x5523,0x137));var _0x3552=function(_0x76cc41,_0x1e38c6){_0x76cc41=_0x76cc41-0x0;var _0x5750e5=_0x5523[_0x76cc41];return _0x5750e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3552('0x0'));var timeout=require(_0x3552('0x1'));var express=require(_0x3552('0x2'));var router=express[_0x3552('0x3')]();var fs_extra=require(_0x3552('0x4'));var auth=require(_0x3552('0x5'));var interaction=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var controller=require(_0x3552('0x8'));router[_0x3552('0x9')]('/',auth[_0x3552('0xa')](),controller['index']);router['get']('/:id',auth[_0x3552('0xa')](),controller['show']);router[_0x3552('0xb')]('/',auth[_0x3552('0xa')](),controller[_0x3552('0xc')]);router['put']('/:id',auth[_0x3552('0xa')](),controller[_0x3552('0xd')]);router[_0x3552('0xe')](_0x3552('0xf'),auth[_0x3552('0xa')](),controller[_0x3552('0x10')]);module[_0x3552('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 666edf6..c1ad835 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 _0x746f=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x398ce1,_0x5caa9f){var _0x56ba21=function(_0x23cea0){while(--_0x23cea0){_0x398ce1['push'](_0x398ce1['shift']());}};_0x56ba21(++_0x5caa9f);}(_0x746f,0x9c));var _0xf746=function(_0x58342f,_0x1b929f){_0x58342f=_0x58342f-0x0;var _0x4656ee=_0x746f[_0x58342f];return _0x4656ee;};'use strict';var moment=require(_0xf746('0x0'));var Sequelize=require(_0xf746('0x1'));module[_0xf746('0x2')]={'phone':{'type':Sequelize[_0xf746('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf746('0x4')],'unique':_0xf746('0x5')},'ListId':{'type':Sequelize[_0xf746('0x4')],'unique':_0xf746('0x5')},'VoiceQueueId':{'type':Sequelize[_0xf746('0x4')],'unique':_0xf746('0x5')}}; \ No newline at end of file +var _0xc962=['contactListQueue','moment','INTEGER'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xc962,0x6d));var _0x2c96=function(_0x18605c,_0x4ea07d){_0x18605c=_0x18605c-0x0;var _0x311817=_0xc962[_0x18605c];return _0x311817;};'use strict';var moment=require(_0x2c96('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2c96('0x1')],'unique':_0x2c96('0x2')},'ListId':{'type':Sequelize[_0x2c96('0x1')],'unique':_0x2c96('0x2')},'VoiceQueueId':{'type':Sequelize[_0x2c96('0x1')],'unique':_0x2c96('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index aa277f5..de34791 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 _0xf033=['json','offset','limit','undefined','count','reject','update','destroy','then','end','stack','name','send','map','CmHopperBlack','fieldName','type','model','query','filters','intersection','attributes','length','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','fields','options','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf033,0x6e));var _0x3f03=function(_0x35c86f,_0x399bc4){_0x35c86f=_0x35c86f-0x0;var _0x28c841=_0xf033[_0x35c86f];return _0x28c841;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f03('0x0'));var zipdir=require(_0x3f03('0x1'));var jsonpatch=require(_0x3f03('0x2'));var rp=require(_0x3f03('0x3'));var moment=require(_0x3f03('0x4'));var BPromise=require(_0x3f03('0x5'));var Mustache=require(_0x3f03('0x6'));var util=require(_0x3f03('0x7'));var path=require('path');var sox=require(_0x3f03('0x8'));var csv=require(_0x3f03('0x9'));var ejs=require(_0x3f03('0xa'));var fs=require('fs');var fs_extra=require(_0x3f03('0xb'));var _=require(_0x3f03('0xc'));var squel=require(_0x3f03('0xd'));var crypto=require(_0x3f03('0xe'));var jsforce=require(_0x3f03('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3f03('0x9'));var querystring=require(_0x3f03('0x10'));var Papa=require(_0x3f03('0x11'));var Redis=require(_0x3f03('0x12'));var authService=require(_0x3f03('0x13'));var qs=require(_0x3f03('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f03('0x15'));var logger=require(_0x3f03('0x16'))(_0x3f03('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f03('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd2b580,_0x13935d){_0x13935d=_0x13935d||0xcc;return function(_0x27b9ff){if(_0x27b9ff){return _0xd2b580['sendStatus'](_0x13935d);}return _0xd2b580[_0x3f03('0x19')](_0x13935d)['end']();};}function respondWithResult(_0x2333dc,_0x3f9297){_0x3f9297=_0x3f9297||0xc8;return function(_0x2675ab){if(_0x2675ab){return _0x2333dc[_0x3f03('0x19')](_0x3f9297)[_0x3f03('0x1a')](_0x2675ab);}};}function respondWithFilteredResult(_0x447586,_0x28a073){return function(_0x19e916){if(_0x19e916){var _0x561850=typeof _0x28a073[_0x3f03('0x1b')]==='undefined'&&typeof _0x28a073[_0x3f03('0x1c')]===_0x3f03('0x1d');var _0x4c6739=_0x19e916[_0x3f03('0x1e')];var _0x2b14fc=_0x561850?0x0:_0x28a073[_0x3f03('0x1b')];var _0x47ae5b=_0x561850?_0x19e916[_0x3f03('0x1e')]:_0x28a073[_0x3f03('0x1b')]+_0x28a073[_0x3f03('0x1c')];var _0x2a0ab7;if(_0x47ae5b>=_0x4c6739){_0x47ae5b=_0x4c6739;_0x2a0ab7=0xc8;}else{_0x2a0ab7=0xce;}_0x447586['status'](_0x2a0ab7);return _0x447586['set']('Content-Range',_0x2b14fc+'-'+_0x47ae5b+'/'+_0x4c6739)['json'](_0x19e916);}return null;};}function patchUpdates(_0x123635){return function(_0x52e243){try{jsonpatch['apply'](_0x52e243,_0x123635,!![]);}catch(_0x17b310){return BPromise[_0x3f03('0x1f')](_0x17b310);}return _0x52e243['save']();};}function saveUpdates(_0x55a761,_0x5b051b){return function(_0x583f6b){if(_0x583f6b){return _0x583f6b[_0x3f03('0x20')](_0x55a761)['then'](function(_0x58c382){return _0x58c382;});}return null;};}function removeEntity(_0x2563ae,_0x53b864){return function(_0xd39319){if(_0xd39319){return _0xd39319[_0x3f03('0x21')]()[_0x3f03('0x22')](function(){_0x2563ae[_0x3f03('0x19')](0xcc)[_0x3f03('0x23')]();});}};}function handleEntityNotFound(_0x2d6c20,_0x1e0395){return function(_0x2a966d){if(!_0x2a966d){_0x2d6c20['sendStatus'](0x194);}return _0x2a966d;};}function handleError(_0xf4ee6b,_0xb8b2da){_0xb8b2da=_0xb8b2da||0x1f4;return function(_0x4a2135){logger['error'](_0x4a2135[_0x3f03('0x24')]);if(_0x4a2135[_0x3f03('0x25')]){delete _0x4a2135[_0x3f03('0x25')];}_0xf4ee6b['status'](_0xb8b2da)[_0x3f03('0x26')](_0x4a2135);};}exports['index']=function(_0x564d11,_0x1bd7dd){var _0x5022a4={},_0x43c793={},_0x3fd57c={'count':0x0,'rows':[]};var _0x2f59ee=_[_0x3f03('0x27')](db[_0x3f03('0x28')]['rawAttributes'],function(_0x369223){return{'name':_0x369223[_0x3f03('0x29')],'type':_0x369223[_0x3f03('0x2a')]['key']};});_0x43c793[_0x3f03('0x2b')]=_[_0x3f03('0x27')](_0x2f59ee,_0x3f03('0x25'));_0x43c793['query']=_['keys'](_0x564d11[_0x3f03('0x2c')]);_0x43c793[_0x3f03('0x2d')]=_[_0x3f03('0x2e')](_0x43c793['model'],_0x43c793[_0x3f03('0x2c')]);_0x5022a4[_0x3f03('0x2f')]=_['intersection'](_0x43c793[_0x3f03('0x2b')],qs['fields'](_0x564d11[_0x3f03('0x2c')]['fields']));_0x5022a4['attributes']=_0x5022a4[_0x3f03('0x2f')][_0x3f03('0x30')]?_0x5022a4[_0x3f03('0x2f')]:_0x43c793[_0x3f03('0x2b')];if(!_0x564d11[_0x3f03('0x2c')]['hasOwnProperty']('nolimit')){_0x5022a4[_0x3f03('0x1c')]=qs[_0x3f03('0x1c')](_0x564d11[_0x3f03('0x2c')][_0x3f03('0x1c')]);_0x5022a4['offset']=qs[_0x3f03('0x1b')](_0x564d11[_0x3f03('0x2c')][_0x3f03('0x1b')]);}_0x5022a4['order']=qs[_0x3f03('0x31')](_0x564d11[_0x3f03('0x2c')][_0x3f03('0x31')]);_0x5022a4[_0x3f03('0x32')]=qs[_0x3f03('0x2d')](_[_0x3f03('0x33')](_0x564d11[_0x3f03('0x2c')],_0x43c793[_0x3f03('0x2d')]),_0x2f59ee);if(_0x564d11[_0x3f03('0x2c')][_0x3f03('0x34')]){_0x5022a4['where']=_['merge'](_0x5022a4[_0x3f03('0x32')],{'$or':_[_0x3f03('0x27')](_0x2f59ee,function(_0x20e275){if(_0x20e275[_0x3f03('0x2a')]!==_0x3f03('0x35')){var _0x4d2609={};_0x4d2609[_0x20e275[_0x3f03('0x25')]]={'$like':'%'+_0x564d11[_0x3f03('0x2c')][_0x3f03('0x34')]+'%'};return _0x4d2609;}})});}_0x5022a4=_[_0x3f03('0x36')]({},_0x5022a4,_0x564d11['options']);var _0x1a1d8d={'where':_0x5022a4[_0x3f03('0x32')]};return db[_0x3f03('0x28')][_0x3f03('0x1e')](_0x1a1d8d)[_0x3f03('0x22')](function(_0x34bf57){_0x3fd57c[_0x3f03('0x1e')]=_0x34bf57;if(_0x564d11[_0x3f03('0x2c')][_0x3f03('0x37')]){_0x5022a4[_0x3f03('0x38')]=[{'all':!![]}];}return db[_0x3f03('0x28')][_0x3f03('0x39')](_0x5022a4);})[_0x3f03('0x22')](function(_0xbcc9a5){_0x3fd57c[_0x3f03('0x3a')]=_0xbcc9a5;return _0x3fd57c;})['then'](respondWithFilteredResult(_0x1bd7dd,_0x5022a4))[_0x3f03('0x3b')](handleError(_0x1bd7dd,null));};exports['show']=function(_0x526899,_0x948301){var _0x69de84={'raw':!![],'where':{'id':_0x526899[_0x3f03('0x3c')]['id']}},_0x35b6a4={};_0x35b6a4[_0x3f03('0x2b')]=_[_0x3f03('0x3d')](db[_0x3f03('0x28')][_0x3f03('0x3e')]);_0x35b6a4[_0x3f03('0x2c')]=_[_0x3f03('0x3d')](_0x526899[_0x3f03('0x2c')]);_0x35b6a4[_0x3f03('0x2d')]=_[_0x3f03('0x2e')](_0x35b6a4['model'],_0x35b6a4[_0x3f03('0x2c')]);_0x69de84[_0x3f03('0x2f')]=_[_0x3f03('0x2e')](_0x35b6a4[_0x3f03('0x2b')],qs['fields'](_0x526899[_0x3f03('0x2c')][_0x3f03('0x3f')]));_0x69de84[_0x3f03('0x2f')]=_0x69de84[_0x3f03('0x2f')][_0x3f03('0x30')]?_0x69de84[_0x3f03('0x2f')]:_0x35b6a4[_0x3f03('0x2b')];if(_0x526899[_0x3f03('0x2c')][_0x3f03('0x37')]){_0x69de84[_0x3f03('0x38')]=[{'all':!![]}];}_0x69de84=_[_0x3f03('0x36')]({},_0x69de84,_0x526899[_0x3f03('0x40')]);return db[_0x3f03('0x28')]['find'](_0x69de84)[_0x3f03('0x22')](handleEntityNotFound(_0x948301,null))[_0x3f03('0x22')](respondWithResult(_0x948301,null))['catch'](handleError(_0x948301,null));};exports[_0x3f03('0x20')]=function(_0x4a42a0,_0x110188){if(_0x4a42a0[_0x3f03('0x41')]['id']){delete _0x4a42a0[_0x3f03('0x41')]['id'];}return db[_0x3f03('0x28')][_0x3f03('0x42')]({'where':{'id':_0x4a42a0[_0x3f03('0x3c')]['id']}})[_0x3f03('0x22')](handleEntityNotFound(_0x110188,null))['then'](saveUpdates(_0x4a42a0[_0x3f03('0x41')],null))[_0x3f03('0x22')](respondWithResult(_0x110188,null))['catch'](handleError(_0x110188,null));};exports['destroy']=function(_0x38ef61,_0x29ecde){return db['CmHopperBlack'][_0x3f03('0x42')]({'where':{'id':_0x38ef61[_0x3f03('0x3c')]['id']}})[_0x3f03('0x22')](handleEntityNotFound(_0x29ecde,null))[_0x3f03('0x22')](removeEntity(_0x29ecde,null))['catch'](handleError(_0x29ecde,null));};exports[_0x3f03('0x43')]=function(_0x269814,_0xf2b002){return db[_0x3f03('0x28')]['describe']()['then'](respondWithResult(_0xf2b002,null))[_0x3f03('0x3b')](handleError(_0xf2b002,null));}; \ No newline at end of file +var _0x5fad=['fields','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','body','find','catch','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','CmHopperBlack','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x5fad,0x12f));var _0xd5fa=function(_0x4acf20,_0x3f4636){_0x4acf20=_0x4acf20-0x0;var _0x50eabc=_0x5fad[_0x4acf20];return _0x50eabc;};'use strict';var emlformat=require(_0xd5fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd5fa('0x1'));var rp=require(_0xd5fa('0x2'));var moment=require('moment');var BPromise=require(_0xd5fa('0x3'));var Mustache=require(_0xd5fa('0x4'));var util=require(_0xd5fa('0x5'));var path=require(_0xd5fa('0x6'));var sox=require(_0xd5fa('0x7'));var csv=require(_0xd5fa('0x8'));var ejs=require(_0xd5fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd5fa('0xa'));var crypto=require(_0xd5fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd5fa('0xc'));var toCsv=require(_0xd5fa('0x8'));var querystring=require(_0xd5fa('0xd'));var Papa=require(_0xd5fa('0xe'));var Redis=require(_0xd5fa('0xf'));var authService=require(_0xd5fa('0x10'));var qs=require(_0xd5fa('0x11'));var as=require(_0xd5fa('0x12'));var hardwareService=require(_0xd5fa('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd5fa('0x14'));var licenseUtil=require(_0xd5fa('0x15'));var db=require(_0xd5fa('0x16'))['db'];function respondWithStatusCode(_0x7d5656,_0x27b953){_0x27b953=_0x27b953||0xcc;return function(_0x360386){if(_0x360386){return _0x7d5656[_0xd5fa('0x17')](_0x27b953);}return _0x7d5656[_0xd5fa('0x18')](_0x27b953)['end']();};}function respondWithResult(_0x1742ae,_0x4dae08){_0x4dae08=_0x4dae08||0xc8;return function(_0xa4a966){if(_0xa4a966){return _0x1742ae[_0xd5fa('0x18')](_0x4dae08)['json'](_0xa4a966);}};}function respondWithFilteredResult(_0x223424,_0x5f1bc0){return function(_0x17b02e){if(_0x17b02e){var _0x429458=typeof _0x5f1bc0['offset']===_0xd5fa('0x19')&&typeof _0x5f1bc0[_0xd5fa('0x1a')]===_0xd5fa('0x19');var _0x67e820=_0x17b02e[_0xd5fa('0x1b')];var _0x1c7b33=_0x429458?0x0:_0x5f1bc0[_0xd5fa('0x1c')];var _0x47839e=_0x429458?_0x17b02e['count']:_0x5f1bc0[_0xd5fa('0x1c')]+_0x5f1bc0[_0xd5fa('0x1a')];var _0x1a08db;if(_0x47839e>=_0x67e820){_0x47839e=_0x67e820;_0x1a08db=0xc8;}else{_0x1a08db=0xce;}_0x223424[_0xd5fa('0x18')](_0x1a08db);return _0x223424[_0xd5fa('0x1d')](_0xd5fa('0x1e'),_0x1c7b33+'-'+_0x47839e+'/'+_0x67e820)[_0xd5fa('0x1f')](_0x17b02e);}return null;};}function patchUpdates(_0x2c03b7){return function(_0x59d180){try{jsonpatch['apply'](_0x59d180,_0x2c03b7,!![]);}catch(_0x42fc35){return BPromise[_0xd5fa('0x20')](_0x42fc35);}return _0x59d180[_0xd5fa('0x21')]();};}function saveUpdates(_0x53e60d,_0x3d2035){return function(_0x202715){if(_0x202715){return _0x202715[_0xd5fa('0x22')](_0x53e60d)[_0xd5fa('0x23')](function(_0x27d914){return _0x27d914;});}return null;};}function removeEntity(_0x39172f,_0x43f41f){return function(_0x4988ce){if(_0x4988ce){return _0x4988ce[_0xd5fa('0x24')]()[_0xd5fa('0x23')](function(){_0x39172f[_0xd5fa('0x18')](0xcc)[_0xd5fa('0x25')]();});}};}function handleEntityNotFound(_0x5c906f,_0xbb9aff){return function(_0xf3e81d){if(!_0xf3e81d){_0x5c906f[_0xd5fa('0x17')](0x194);}return _0xf3e81d;};}function handleError(_0x281b7a,_0x1d7dff){_0x1d7dff=_0x1d7dff||0x1f4;return function(_0x30afa1){logger['error'](_0x30afa1[_0xd5fa('0x26')]);if(_0x30afa1[_0xd5fa('0x27')]){delete _0x30afa1[_0xd5fa('0x27')];}_0x281b7a['status'](_0x1d7dff)['send'](_0x30afa1);};}exports[_0xd5fa('0x28')]=function(_0x1e544c,_0x2a3de7){var _0x6e40e2={},_0x5868c5={},_0x161880={'count':0x0,'rows':[]};var _0x20caeb=_['map'](db[_0xd5fa('0x29')][_0xd5fa('0x2a')],function(_0x2b0391){return{'name':_0x2b0391['fieldName'],'type':_0x2b0391[_0xd5fa('0x2b')][_0xd5fa('0x2c')]};});_0x5868c5[_0xd5fa('0x2d')]=_[_0xd5fa('0x2e')](_0x20caeb,_0xd5fa('0x27'));_0x5868c5[_0xd5fa('0x2f')]=_[_0xd5fa('0x30')](_0x1e544c['query']);_0x5868c5[_0xd5fa('0x31')]=_[_0xd5fa('0x32')](_0x5868c5[_0xd5fa('0x2d')],_0x5868c5['query']);_0x6e40e2[_0xd5fa('0x33')]=_[_0xd5fa('0x32')](_0x5868c5[_0xd5fa('0x2d')],qs[_0xd5fa('0x34')](_0x1e544c[_0xd5fa('0x2f')][_0xd5fa('0x34')]));_0x6e40e2[_0xd5fa('0x33')]=_0x6e40e2['attributes']['length']?_0x6e40e2[_0xd5fa('0x33')]:_0x5868c5['model'];if(!_0x1e544c['query']['hasOwnProperty'](_0xd5fa('0x35'))){_0x6e40e2['limit']=qs['limit'](_0x1e544c[_0xd5fa('0x2f')][_0xd5fa('0x1a')]);_0x6e40e2[_0xd5fa('0x1c')]=qs[_0xd5fa('0x1c')](_0x1e544c[_0xd5fa('0x2f')][_0xd5fa('0x1c')]);}_0x6e40e2['order']=qs[_0xd5fa('0x36')](_0x1e544c[_0xd5fa('0x2f')]['sort']);_0x6e40e2[_0xd5fa('0x37')]=qs[_0xd5fa('0x31')](_[_0xd5fa('0x38')](_0x1e544c['query'],_0x5868c5[_0xd5fa('0x31')]),_0x20caeb);if(_0x1e544c[_0xd5fa('0x2f')]['filter']){_0x6e40e2[_0xd5fa('0x37')]=_[_0xd5fa('0x39')](_0x6e40e2[_0xd5fa('0x37')],{'$or':_[_0xd5fa('0x2e')](_0x20caeb,function(_0x586eba){if(_0x586eba['type']!==_0xd5fa('0x3a')){var _0xeb5aaf={};_0xeb5aaf[_0x586eba[_0xd5fa('0x27')]]={'$like':'%'+_0x1e544c[_0xd5fa('0x2f')]['filter']+'%'};return _0xeb5aaf;}})});}_0x6e40e2=_[_0xd5fa('0x39')]({},_0x6e40e2,_0x1e544c[_0xd5fa('0x3b')]);var _0x572431={'where':_0x6e40e2[_0xd5fa('0x37')]};return db[_0xd5fa('0x29')][_0xd5fa('0x1b')](_0x572431)[_0xd5fa('0x23')](function(_0x35bb72){_0x161880['count']=_0x35bb72;if(_0x1e544c['query'][_0xd5fa('0x3c')]){_0x6e40e2[_0xd5fa('0x3d')]=[{'all':!![]}];}return db[_0xd5fa('0x29')][_0xd5fa('0x3e')](_0x6e40e2);})[_0xd5fa('0x23')](function(_0xf4bf31){_0x161880[_0xd5fa('0x3f')]=_0xf4bf31;return _0x161880;})[_0xd5fa('0x23')](respondWithFilteredResult(_0x2a3de7,_0x6e40e2))['catch'](handleError(_0x2a3de7,null));};exports[_0xd5fa('0x40')]=function(_0x3bd75f,_0x1d5dcf){var _0x3fb1f3={'raw':!![],'where':{'id':_0x3bd75f[_0xd5fa('0x41')]['id']}},_0x570b23={};_0x570b23[_0xd5fa('0x2d')]=_['keys'](db['CmHopperBlack'][_0xd5fa('0x2a')]);_0x570b23[_0xd5fa('0x2f')]=_[_0xd5fa('0x30')](_0x3bd75f[_0xd5fa('0x2f')]);_0x570b23[_0xd5fa('0x31')]=_[_0xd5fa('0x32')](_0x570b23[_0xd5fa('0x2d')],_0x570b23[_0xd5fa('0x2f')]);_0x3fb1f3['attributes']=_[_0xd5fa('0x32')](_0x570b23[_0xd5fa('0x2d')],qs[_0xd5fa('0x34')](_0x3bd75f[_0xd5fa('0x2f')][_0xd5fa('0x34')]));_0x3fb1f3[_0xd5fa('0x33')]=_0x3fb1f3['attributes'][_0xd5fa('0x42')]?_0x3fb1f3[_0xd5fa('0x33')]:_0x570b23[_0xd5fa('0x2d')];if(_0x3bd75f[_0xd5fa('0x2f')][_0xd5fa('0x3c')]){_0x3fb1f3[_0xd5fa('0x3d')]=[{'all':!![]}];}_0x3fb1f3=_[_0xd5fa('0x39')]({},_0x3fb1f3,_0x3bd75f[_0xd5fa('0x3b')]);return db[_0xd5fa('0x29')]['find'](_0x3fb1f3)[_0xd5fa('0x23')](handleEntityNotFound(_0x1d5dcf,null))['then'](respondWithResult(_0x1d5dcf,null))['catch'](handleError(_0x1d5dcf,null));};exports[_0xd5fa('0x22')]=function(_0x445c71,_0x966b1e){if(_0x445c71[_0xd5fa('0x43')]['id']){delete _0x445c71[_0xd5fa('0x43')]['id'];}return db[_0xd5fa('0x29')][_0xd5fa('0x44')]({'where':{'id':_0x445c71[_0xd5fa('0x41')]['id']}})['then'](handleEntityNotFound(_0x966b1e,null))[_0xd5fa('0x23')](saveUpdates(_0x445c71[_0xd5fa('0x43')],null))[_0xd5fa('0x23')](respondWithResult(_0x966b1e,null))['catch'](handleError(_0x966b1e,null));};exports[_0xd5fa('0x24')]=function(_0x4e5026,_0x2caf94){return db[_0xd5fa('0x29')][_0xd5fa('0x44')]({'where':{'id':_0x4e5026[_0xd5fa('0x41')]['id']}})[_0xd5fa('0x23')](handleEntityNotFound(_0x2caf94,null))[_0xd5fa('0x23')](removeEntity(_0x2caf94,null))[_0xd5fa('0x45')](handleError(_0x2caf94,null));};exports[_0xd5fa('0x46')]=function(_0x5ab6b7,_0x2716aa){return db[_0xd5fa('0x29')][_0xd5fa('0x46')]()[_0xd5fa('0x23')](respondWithResult(_0x2716aa,null))[_0xd5fa('0x45')](handleError(_0x2716aa,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index cc07fc2..5ece8f8 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 _0x71dd=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','../../config/logger','moment','bluebird'];(function(_0x540511,_0x201e3b){var _0x5c1ac6=function(_0xdacf37){while(--_0xdacf37){_0x540511['push'](_0x540511['shift']());}};_0x5c1ac6(++_0x201e3b);}(_0x71dd,0x130));var _0xd71d=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x71dd[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xd71d('0x0'));var util=require('util');var logger=require(_0xd71d('0x1'))('api');var moment=require(_0xd71d('0x2'));var BPromise=require(_0xd71d('0x3'));var rp=require(_0xd71d('0x4'));var fs=require('fs');var path=require(_0xd71d('0x5'));var rimraf=require(_0xd71d('0x6'));var config=require(_0xd71d('0x7'));var attributes=require(_0xd71d('0x8'));module[_0xd71d('0x9')]=function(_0x590080,_0x3eea45){return _0x590080['define'](_0xd71d('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d80=['moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x109073,_0x429082){var _0x116a96=function(_0x143825){while(--_0x143825){_0x109073['push'](_0x109073['shift']());}};_0x116a96(++_0x429082);}(_0x3d80,0x76));var _0x03d8=function(_0x30805d,_0x3b9978){_0x30805d=_0x30805d-0x0;var _0x27e3b7=_0x3d80[_0x30805d];return _0x27e3b7;};'use strict';var _=require(_0x03d8('0x0'));var util=require(_0x03d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x03d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x03d8('0x3'));var fs=require('fs');var path=require(_0x03d8('0x4'));var rimraf=require(_0x03d8('0x5'));var config=require(_0x03d8('0x6'));var attributes=require(_0x03d8('0x7'));module[_0x03d8('0x8')]=function(_0x31a44b,_0x47f4f9){return _0x31a44b[_0x03d8('0x9')](_0x03d8('0xa'),attributes,{'tableName':_0x03d8('0xb'),'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 4a23d63..cd342d1 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 _0x2cc1=['update','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','info','catch','UpdateCmHopperBlack'];(function(_0x29bc4c,_0x5b943d){var _0x4e74bc=function(_0x3050aa){while(--_0x3050aa){_0x29bc4c['push'](_0x29bc4c['shift']());}};_0x4e74bc(++_0x5b943d);}(_0x2cc1,0x75));var _0x12cc=function(_0x57120e,_0x427d2d){_0x57120e=_0x57120e-0x0;var _0x1539f5=_0x2cc1[_0x57120e];return _0x1539f5;};'use strict';var _=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var moment=require(_0x12cc('0x2'));var BPromise=require(_0x12cc('0x3'));var rs=require(_0x12cc('0x4'));var fs=require('fs');var Redis=require(_0x12cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12cc('0x6'))(_0x12cc('0x7'));var config=require(_0x12cc('0x8'));var jayson=require(_0x12cc('0x9'));var client=jayson[_0x12cc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48360f,_0x3c102f,_0x163363){return new BPromise(function(_0x11e5b7,_0x1f8b99){return client[_0x12cc('0xb')](_0x48360f,_0x163363)[_0x12cc('0xc')](function(_0x249dd7){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x3c102f,_0x12cc('0xd'));logger[_0x12cc('0xe')](_0x12cc('0xf'),_0x3c102f,'request\x20sent',JSON[_0x12cc('0x10')](_0x249dd7));if(_0x249dd7['error']){if(_0x249dd7[_0x12cc('0x11')][_0x12cc('0x12')]===0x1f4){logger[_0x12cc('0x11')](_0x12cc('0x13'),_0x3c102f,_0x249dd7[_0x12cc('0x11')][_0x12cc('0x14')]);return _0x1f8b99(_0x249dd7['error'][_0x12cc('0x14')]);}logger[_0x12cc('0x11')](_0x12cc('0x13'),_0x3c102f,_0x249dd7['error'][_0x12cc('0x14')]);return _0x11e5b7(_0x249dd7[_0x12cc('0x11')][_0x12cc('0x14')]);}else{logger['info'](_0x12cc('0x13'),_0x3c102f,'request\x20sent');_0x11e5b7(_0x249dd7[_0x12cc('0x15')]['message']);}})['catch'](function(_0x38f340){logger[_0x12cc('0x11')](_0x12cc('0x13'),_0x3c102f,_0x38f340);_0x1f8b99(_0x38f340);});});}exports[_0x12cc('0x16')]=function(_0x35bb23){var _0x29ba06=this;return new Promise(function(_0x4c5205,_0x58a926){return db[_0x12cc('0x17')]['findAll']({'raw':_0x35bb23[_0x12cc('0x18')]?_0x35bb23[_0x12cc('0x18')][_0x12cc('0x19')]===undefined?!![]:![]:!![],'where':_0x35bb23[_0x12cc('0x18')]?_0x35bb23['options'][_0x12cc('0x1a')]||null:null,'attributes':_0x35bb23['options']?_0x35bb23[_0x12cc('0x18')][_0x12cc('0x1b')]||null:null,'limit':_0x35bb23[_0x12cc('0x18')]?_0x35bb23[_0x12cc('0x18')][_0x12cc('0x1c')]||null:null,'include':_0x35bb23[_0x12cc('0x18')]?_0x35bb23[_0x12cc('0x18')][_0x12cc('0x1d')]?_[_0x12cc('0x1e')](_0x35bb23['options'][_0x12cc('0x1d')],function(_0x29c75e){return{'model':db[_0x29c75e[_0x12cc('0x1f')]],'as':_0x29c75e['as'],'attributes':_0x29c75e[_0x12cc('0x1b')],'include':_0x29c75e['include']?_[_0x12cc('0x1e')](_0x29c75e[_0x12cc('0x1d')],function(_0x1eb81b){return{'model':db[_0x1eb81b[_0x12cc('0x1f')]],'as':_0x1eb81b['as'],'attributes':_0x1eb81b[_0x12cc('0x1b')],'include':_0x1eb81b[_0x12cc('0x1d')]?_[_0x12cc('0x1e')](_0x1eb81b[_0x12cc('0x1d')],function(_0x28228f){return{'model':db[_0x28228f['model']],'as':_0x28228f['as'],'attributes':_0x28228f[_0x12cc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12cc('0xc')](function(_0x1cb95a){logger[_0x12cc('0x20')](_0x12cc('0x16'),_0x35bb23);logger['debug']('GetCmHopperBlack',_0x35bb23,JSON[_0x12cc('0x10')](_0x1cb95a));_0x4c5205(_0x1cb95a);})[_0x12cc('0x21')](function(_0x1c13b2){logger[_0x12cc('0x11')](_0x12cc('0x16'),_0x1c13b2[_0x12cc('0x14')],_0x35bb23);_0x58a926(_0x29ba06[_0x12cc('0x11')](0x1f4,_0x1c13b2[_0x12cc('0x14')]));});});};exports[_0x12cc('0x22')]=function(_0x4fe744){var _0x507099=this;return new Promise(function(_0x168358,_0xee8a05){return db[_0x12cc('0x17')][_0x12cc('0x23')](_0x4fe744['body'],{'raw':_0x4fe744[_0x12cc('0x18')]?_0x4fe744['options'][_0x12cc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe744[_0x12cc('0x18')]?_0x4fe744['options'][_0x12cc('0x1a')]||null:null,'attributes':_0x4fe744[_0x12cc('0x18')]?_0x4fe744[_0x12cc('0x18')][_0x12cc('0x1b')]||null:null,'limit':_0x4fe744['options']?_0x4fe744[_0x12cc('0x18')][_0x12cc('0x1c')]||null:null})[_0x12cc('0xc')](function(_0x48597a){logger[_0x12cc('0x20')](_0x12cc('0x22'),_0x4fe744);logger[_0x12cc('0xe')](_0x12cc('0x22'),_0x4fe744,JSON['stringify'](_0x48597a));_0x168358(_0x48597a);})['catch'](function(_0x125885){logger[_0x12cc('0x11')]('UpdateCmHopperBlack',_0x125885[_0x12cc('0x14')],_0x4fe744);_0xee8a05(_0x507099[_0x12cc('0x11')](0x1f4,_0x125885['message']));});});};exports[_0x12cc('0x24')]=function(_0x55086d){var _0xadec51=this;return new Promise(function(_0x2ade3b,_0x3505fa){return db['CmHopperBlack'][_0x12cc('0x25')]({'where':_0x55086d[_0x12cc('0x18')]?_0x55086d[_0x12cc('0x18')][_0x12cc('0x1a')]||null:null})[_0x12cc('0xc')](function(_0x2a07df){logger['info'](_0x12cc('0x24'),_0x55086d);logger[_0x12cc('0xe')](_0x12cc('0x24'),_0x55086d,JSON[_0x12cc('0x10')](_0x2a07df));_0x2ade3b(_0x2a07df);})['catch'](function(_0x122846){logger[_0x12cc('0x11')]('DestroyCmHopperBlack',_0x122846[_0x12cc('0x14')],_0x55086d);_0x3505fa(_0xadec51[_0x12cc('0x11')](0x1f4,_0x122846[_0x12cc('0x14')]));});});}; \ No newline at end of file +var _0x3107=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x3107,0xbb));var _0x7310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3107[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7310('0x0'));var util=require('util');var moment=require(_0x7310('0x1'));var BPromise=require(_0x7310('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7310('0x3'));var db=require(_0x7310('0x4'))['db'];var utils=require(_0x7310('0x5'));var logger=require(_0x7310('0x6'))(_0x7310('0x7'));var config=require(_0x7310('0x8'));var jayson=require(_0x7310('0x9'));var client=jayson[_0x7310('0xa')][_0x7310('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x212655,_0x355a9c,_0x2672d4){return new BPromise(function(_0xfead82,_0x5d8f1d){return client[_0x7310('0xc')](_0x212655,_0x2672d4)['then'](function(_0x3e8629){logger['info'](_0x7310('0xd'),_0x355a9c,'request\x20sent');logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x355a9c,_0x7310('0xe'),JSON[_0x7310('0xf')](_0x3e8629));if(_0x3e8629['error']){if(_0x3e8629[_0x7310('0x10')][_0x7310('0x11')]===0x1f4){logger[_0x7310('0x10')](_0x7310('0xd'),_0x355a9c,_0x3e8629[_0x7310('0x10')][_0x7310('0x12')]);return _0x5d8f1d(_0x3e8629[_0x7310('0x10')][_0x7310('0x12')]);}logger[_0x7310('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x355a9c,_0x3e8629[_0x7310('0x10')][_0x7310('0x12')]);return _0xfead82(_0x3e8629[_0x7310('0x10')]['message']);}else{logger[_0x7310('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x355a9c,_0x7310('0xe'));_0xfead82(_0x3e8629['result'][_0x7310('0x12')]);}})[_0x7310('0x14')](function(_0x24fa0c){logger[_0x7310('0x10')](_0x7310('0xd'),_0x355a9c,_0x24fa0c);_0x5d8f1d(_0x24fa0c);});});}exports[_0x7310('0x15')]=function(_0xffcaef){var _0x218f60=this;return new Promise(function(_0x164682,_0x50e39b){return db['CmHopperBlack'][_0x7310('0x16')]({'raw':_0xffcaef[_0x7310('0x17')]?_0xffcaef[_0x7310('0x17')][_0x7310('0x18')]===undefined?!![]:![]:!![],'where':_0xffcaef['options']?_0xffcaef['options'][_0x7310('0x19')]||null:null,'attributes':_0xffcaef[_0x7310('0x17')]?_0xffcaef[_0x7310('0x17')][_0x7310('0x1a')]||null:null,'limit':_0xffcaef[_0x7310('0x17')]?_0xffcaef[_0x7310('0x17')][_0x7310('0x1b')]||null:null,'include':_0xffcaef[_0x7310('0x17')]?_0xffcaef[_0x7310('0x17')][_0x7310('0x1c')]?_[_0x7310('0x1d')](_0xffcaef[_0x7310('0x17')][_0x7310('0x1c')],function(_0x1f35f9){return{'model':db[_0x1f35f9[_0x7310('0x1e')]],'as':_0x1f35f9['as'],'attributes':_0x1f35f9[_0x7310('0x1a')],'include':_0x1f35f9[_0x7310('0x1c')]?_['map'](_0x1f35f9[_0x7310('0x1c')],function(_0xbf4b5a){return{'model':db[_0xbf4b5a[_0x7310('0x1e')]],'as':_0xbf4b5a['as'],'attributes':_0xbf4b5a[_0x7310('0x1a')],'include':_0xbf4b5a[_0x7310('0x1c')]?_[_0x7310('0x1d')](_0xbf4b5a[_0x7310('0x1c')],function(_0x447007){return{'model':db[_0x447007['model']],'as':_0x447007['as'],'attributes':_0x447007[_0x7310('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7310('0x1f')](function(_0x40e057){logger[_0x7310('0x13')]('GetCmHopperBlack',_0xffcaef);logger[_0x7310('0x20')](_0x7310('0x15'),_0xffcaef,JSON[_0x7310('0xf')](_0x40e057));_0x164682(_0x40e057);})[_0x7310('0x14')](function(_0x2bbda2){logger[_0x7310('0x10')](_0x7310('0x15'),_0x2bbda2[_0x7310('0x12')],_0xffcaef);_0x50e39b(_0x218f60[_0x7310('0x10')](0x1f4,_0x2bbda2['message']));});});};exports[_0x7310('0x21')]=function(_0xf3bb8c){var _0x9f7d8a=this;return new Promise(function(_0x598376,_0x175311){return db[_0x7310('0x22')]['update'](_0xf3bb8c[_0x7310('0x23')],{'raw':_0xf3bb8c['options']?_0xf3bb8c[_0x7310('0x17')][_0x7310('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf3bb8c[_0x7310('0x17')]?_0xf3bb8c[_0x7310('0x17')]['where']||null:null,'attributes':_0xf3bb8c['options']?_0xf3bb8c['options'][_0x7310('0x1a')]||null:null,'limit':_0xf3bb8c['options']?_0xf3bb8c[_0x7310('0x17')][_0x7310('0x1b')]||null:null})[_0x7310('0x1f')](function(_0x10a713){logger[_0x7310('0x13')](_0x7310('0x21'),_0xf3bb8c);logger[_0x7310('0x20')]('UpdateCmHopperBlack',_0xf3bb8c,JSON['stringify'](_0x10a713));_0x598376(_0x10a713);})[_0x7310('0x14')](function(_0x1ccae4){logger['error'](_0x7310('0x21'),_0x1ccae4['message'],_0xf3bb8c);_0x175311(_0x9f7d8a[_0x7310('0x10')](0x1f4,_0x1ccae4[_0x7310('0x12')]));});});};exports[_0x7310('0x24')]=function(_0x1b05c3){var _0x57241a=this;return new Promise(function(_0x2b248c,_0x1765f8){return db['CmHopperBlack'][_0x7310('0x25')]({'where':_0x1b05c3['options']?_0x1b05c3[_0x7310('0x17')][_0x7310('0x19')]||null:null})['then'](function(_0x1968e2){logger['info']('DestroyCmHopperBlack',_0x1b05c3);logger[_0x7310('0x20')](_0x7310('0x24'),_0x1b05c3,JSON[_0x7310('0xf')](_0x1968e2));_0x2b248c(_0x1968e2);})[_0x7310('0x14')](function(_0x477bb0){logger[_0x7310('0x10')](_0x7310('0x24'),_0x477bb0[_0x7310('0x12')],_0x1b05c3);_0x1765f8(_0x57241a[_0x7310('0x10')](0x1f4,_0x477bb0['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 55e2c4d..6f9c850 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 _0xf61e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','describe','show','put'];(function(_0x21bd8b,_0x541616){var _0x5a0eae=function(_0x279e37){while(--_0x279e37){_0x21bd8b['push'](_0x21bd8b['shift']());}};_0x5a0eae(++_0x541616);}(_0xf61e,0x191));var _0xef61=function(_0x3ebec9,_0x5594dc){_0x3ebec9=_0x3ebec9-0x0;var _0x202a9c=_0xf61e[_0x3ebec9];return _0x202a9c;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0x10')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x12')]);router[_0xef61('0x13')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);module[_0xef61('0x15')]=router; \ No newline at end of file +var _0xa6b0=['update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x426711,_0x12264c){var _0x592991=function(_0x564614){while(--_0x564614){_0x426711['push'](_0x426711['shift']());}};_0x592991(++_0x12264c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x6b71d7,_0x266a51){_0x6b71d7=_0x6b71d7-0x0;var _0x15f2f9=_0xa6b0[_0x6b71d7];return _0x15f2f9;};'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['show']);router[_0x0a6b('0xe')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);module[_0x0a6b('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 105ca9c..e46cd95 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 _0x99d0=['DATE','INTEGER','endtime','followuptime','diff','seconds','BOOLEAN','moment','exports','STRING'];(function(_0x19576f,_0x169212){var _0x4041bf=function(_0x1eb1b7){while(--_0x1eb1b7){_0x19576f['push'](_0x19576f['shift']());}};_0x4041bf(++_0x169212);}(_0x99d0,0x13d));var _0x099d=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x99d0[_0x5a6de2];return _0x2c0525;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x099d('0x0'));module[_0x099d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x099d('0x2')]},'scheduledat':{'type':Sequelize[_0x099d('0x3')]},'countbusyretry':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x099d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x099d('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x099d('0x2')]},'calleridname':{'type':Sequelize[_0x099d('0x2')]},'starttime':{'type':Sequelize[_0x099d('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x099d('0x3')]},'droptime':{'type':Sequelize[_0x099d('0x3')]},'endtime':{'type':Sequelize[_0x099d('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x099d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x099d('0x2')]},'reason':{'type':Sequelize[_0x099d('0x2')]},'disposition':{'type':Sequelize[_0x099d('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x099d('0x2')]},'dispositionat':{'type':Sequelize[_0x099d('0x3')],'set':function(_0x4ea29e){var _0x508574=this['getDataValue'](_0x099d('0x5'));if(_0x508574&&_0x4ea29e){this['setDataValue'](_0x099d('0x6'),moment(_0x4ea29e)[_0x099d('0x7')](moment(_0x508574),_0x099d('0x8')));}}},'amd':{'type':Sequelize[_0x099d('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x099d('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x099d('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x099d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x099d('0x3')]},'deleted':{'type':Sequelize[_0x099d('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x099d('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x099d('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x099d('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d65=['seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','setDataValue','followuptime'];(function(_0x5d92ce,_0x5c4f15){var _0x2e1cf5=function(_0x44c83a){while(--_0x44c83a){_0x5d92ce['push'](_0x5d92ce['shift']());}};_0x2e1cf5(++_0x5c4f15);}(_0x2d65,0x18e));var _0x52d6=function(_0x266411,_0x2615a8){_0x266411=_0x266411-0x0;var _0x14d2ea=_0x2d65[_0x266411];return _0x14d2ea;};'use strict';var Sequelize=require(_0x52d6('0x0'));var moment=require(_0x52d6('0x1'));module[_0x52d6('0x2')]={'state':{'type':Sequelize[_0x52d6('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x52d6('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x52d6('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x52d6('0x5')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x52d6('0x5')]},'calleridname':{'type':Sequelize[_0x52d6('0x5')]},'starttime':{'type':Sequelize[_0x52d6('0x4')]},'responsetime':{'type':Sequelize[_0x52d6('0x4')]},'answertime':{'type':Sequelize[_0x52d6('0x4')]},'droptime':{'type':Sequelize[_0x52d6('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x52d6('0x5')]},'campaign':{'type':Sequelize[_0x52d6('0x5')]},'campaigntype':{'type':Sequelize[_0x52d6('0x5')]},'membername':{'type':Sequelize[_0x52d6('0x5')]},'reason':{'type':Sequelize[_0x52d6('0x5')]},'disposition':{'type':Sequelize[_0x52d6('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x52d6('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3ef41b){var _0x365c22=this[_0x52d6('0x6')]('endtime');if(_0x365c22&&_0x3ef41b){this[_0x52d6('0x7')](_0x52d6('0x8'),moment(_0x3ef41b)['diff'](moment(_0x365c22),_0x52d6('0x9')));}}},'amd':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x52d6('0x4')]},'callback':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x52d6('0x4')]},'deleted':{'type':Sequelize[_0x52d6('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x52d6('0x4')]},'recallme':{'type':Sequelize[_0x52d6('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x52d6('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x52d6('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 9324ff3..6347b77 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3672a1,_0x271af9){var _0x4024a9=function(_0x44501b){while(--_0x44501b){_0x3672a1['push'](_0x3672a1['shift']());}};_0x4024a9(++_0x271af9);}(_0x0295,0x1f0));var _0x5029=function(_0x533676,_0x2be01c){_0x533676=_0x533676-0x0;var _0x32f7bd=_0x0295[_0x533676];return _0x32f7bd;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file +var _0x9536=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','CmHopperFinal','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ListId)','CampaignId\x20=\x20?','cm_hopper_final','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x4d43b8,_0x5a083f){var _0x1b4851=function(_0x2d3dc1){while(--_0x2d3dc1){_0x4d43b8['push'](_0x4d43b8['shift']());}};_0x1b4851(++_0x5a083f);}(_0x9536,0x179));var _0x6953=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9536[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':!![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['describe']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['describe']()[_0x6953('0x3c')](respondWithResult(_0x1d5979,null))[_0x6953('0x41')](handleError(_0x1d5979,null));};exports['update']=function(_0x525145,_0xbf5b61){if(_0x525145[_0x6953('0x48')][_0x6953('0x49')]){delete _0x525145[_0x6953('0x48')][_0x6953('0x49')];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'uniqueid':_0x525145[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xbf5b61,null))[_0x6953('0x3c')](saveUpdates(_0x525145[_0x6953('0x48')],null))['then'](respondWithResult(_0xbf5b61,null))['catch'](handleError(_0xbf5b61,null));};exports[_0x6953('0x4a')]=function(_0x38e3e8,_0x68ab5d,_0x7bcd92){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x38e3e8[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db['sequelize']['fn']('COUNT',db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db['sequelize']['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db['sequelize']['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x57')))),'reCallContacts'],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x58')))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x68ab5d,null))['then'](respondWithResult(_0x68ab5d,null))[_0x6953('0x41')](handleError(_0x68ab5d,null));};exports[_0x6953('0x5a')]=function(_0x35ac0e,_0x57ffab,_0x479ab4){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'CampaignId':_0x35ac0e[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5b')))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5c')))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5d')))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x57')))),_0x6953('0x5e')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x57ffab,null))['then'](respondWithResult(_0x57ffab,null))[_0x6953('0x41')](handleError(_0x57ffab,null));};exports[_0x6953('0x5f')]=function(_0x41d74d,_0x5063ac,_0x4cb8a4){return db[_0x6953('0x60')][_0x6953('0x47')]({'where':{'id':_0x41d74d[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x5063ac,null))[_0x6953('0x3c')](function(_0x43a39f){var _0x3cf1c0;if(_0x43a39f){_0x3cf1c0=squel[_0x6953('0x61')]()[_0x6953('0x62')]('cm_hopper')[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),_0x6953('0x66'),'ListId',_0x6953('0x67'),_0x6953('0x68'),_0x6953('0x69')],squel['select']()[_0x6953('0x6a')](_0x6953('0x6b'),_0x6953('0x64'))[_0x6953('0x6a')]('NOW()',_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field']('ANY_VALUE(ListId)',_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x68'))[_0x6953('0x6a')]('NOW()',_0x6953('0x69'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id']['toString']())['where'](_0x6953('0x71'),_0x41d74d[_0x6953('0x48')][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x64'))[_0x6953('0x6f')](_0x6953('0x76'))[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id'][_0x6953('0x73')]()))['where'](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x77'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))['group'](_0x6953('0x66')))[_0x6953('0x73')]();return db[_0x6953('0x4b')][_0x6953('0x2e')](_0x3cf1c0);}return[];})[_0x6953('0x3c')](respondWithResult(_0x5063ac,null))[_0x6953('0x41')](handleError(_0x5063ac,null));};exports[_0x6953('0x79')]=function(_0xa26241,_0xefb593,_0x216b92){return db[_0x6953('0x7a')]['find']({'where':{'id':_0xa26241[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xefb593,null))[_0x6953('0x3c')](function(_0x396a9f){var _0x92c0bc;if(_0x396a9f){_0x92c0bc=squel[_0x6953('0x61')]()[_0x6953('0x62')](_0x6953('0x76'))[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),'ContactId',_0x6953('0x6d'),_0x6953('0x7b'),_0x6953('0x68'),'updatedAt'],squel[_0x6953('0x7c')]()['field']('ANY_VALUE(calleridnum)',_0x6953('0x64'))[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field'](_0x6953('0x7d'),_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(CampaignId)',_0x6953('0x7b'))[_0x6953('0x6a')]('NOW()',_0x6953('0x68'))['field']('NOW()',_0x6953('0x69'))['from']('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id']['toString']())[_0x6953('0x39')](_0x6953('0x71'),_0xa26241['body'][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x64'))['from'](_0x6953('0x76'))[_0x6953('0x39')]('CampaignId\x20=\x20?',_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]()))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x77'))['from'](_0x6953('0x7f'))[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))[_0x6953('0x80')](_0x6953('0x66')))['toString']();return db[_0x6953('0x4b')]['query'](_0x92c0bc);}return[];})[_0x6953('0x3c')](respondWithResult(_0xefb593,null))['catch'](handleError(_0xefb593,null));};exports[_0x6953('0x81')]=function(_0x7215ed,_0x3cb96a,_0x46bcec){return db[_0x6953('0x82')]['findOne']({'where':{'VoiceQueueId':_0x7215ed[_0x6953('0x48')]['VoiceQueueId'],'CampaignId':_0x7215ed[_0x6953('0x48')][_0x6953('0x7b')],'ContactId':_0x7215ed[_0x6953('0x48')][_0x6953('0x66')]}})['then'](handleEntityNotFound(_0x3cb96a,null))[_0x6953('0x3c')](function(_0x50f019){if(_0x50f019){return _0x50f019;}return null;})[_0x6953('0x3c')](respondWithResult(_0x3cb96a,null))[_0x6953('0x41')](handleError(_0x3cb96a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9f0ad23..0e64415 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 _0x2d57=['../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2f87c2,_0x5b1e5c){var _0x2aaa28=function(_0x56c151){while(--_0x56c151){_0x2f87c2['push'](_0x2f87c2['shift']());}};_0x2aaa28(++_0x5b1e5c);}(_0x2d57,0x77));var _0x72d5=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x2d57[_0x55cc58];return _0x26062e;};'use strict';var _=require(_0x72d5('0x0'));var util=require(_0x72d5('0x1'));var logger=require('../../config/logger')(_0x72d5('0x2'));var moment=require('moment');var BPromise=require(_0x72d5('0x3'));var rp=require(_0x72d5('0x4'));var fs=require('fs');var path=require(_0x72d5('0x5'));var rimraf=require(_0x72d5('0x6'));var config=require(_0x72d5('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x72d5('0x8')]=function(_0x52fae2,_0x28bf56){return _0x52fae2[_0x72d5('0x9')](_0x72d5('0xa'),attributes,{'tableName':_0x72d5('0xb'),'paranoid':![],'indexes':[{'name':_0x72d5('0xc'),'fields':[_0x72d5('0xc')]},{'name':'uniqueid','fields':[_0x72d5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8884=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x12d163,_0x2d9f8b){var _0x3d5a69=function(_0x39aa69){while(--_0x39aa69){_0x12d163['push'](_0x12d163['shift']());}};_0x3d5a69(++_0x2d9f8b);}(_0x8884,0x85));var _0x4888=function(_0x5833ae,_0x342389){_0x5833ae=_0x5833ae-0x0;var _0x1e66e0=_0x8884[_0x5833ae];return _0x1e66e0;};'use strict';var _=require(_0x4888('0x0'));var util=require(_0x4888('0x1'));var logger=require('../../config/logger')(_0x4888('0x2'));var moment=require(_0x4888('0x3'));var BPromise=require(_0x4888('0x4'));var rp=require(_0x4888('0x5'));var fs=require('fs');var path=require(_0x4888('0x6'));var rimraf=require(_0x4888('0x7'));var config=require(_0x4888('0x8'));var attributes=require(_0x4888('0x9'));module[_0x4888('0xa')]=function(_0x9d5954,_0x2c360a){return _0x9d5954[_0x4888('0xb')](_0x4888('0xc'),attributes,{'tableName':_0x4888('0xd'),'paranoid':![],'indexes':[{'name':_0x4888('0xe'),'fields':[_0x4888('0xe')]},{'name':_0x4888('0xf'),'fields':[_0x4888('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 52f224c..d519288 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(_0x59a8e8,_0x9399a6){var _0x33936b=function(_0x4ff75b){while(--_0x4ff75b){_0x59a8e8['push'](_0x59a8e8['shift']());}};_0x33936b(++_0x9399a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xb10b[_0x4f431d];return _0x4f31e1;};'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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x19c024,_0xfc1946){var _0x535b2a=function(_0x496c86){while(--_0x496c86){_0x19c024['push'](_0x19c024['shift']());}};_0x535b2a(++_0xfc1946);}(_0x7a54,0x106));var _0x47a5=function(_0x12be88,_0x454487){_0x12be88=_0x12be88-0x0;var _0x60b27c=_0x7a54[_0x12be88];return _0x60b27c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d888777..900b0f0 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 _0xb749=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0xb749,0xac));var _0x9b74=function(_0x3e8c4d,_0x18d01a){_0x3e8c4d=_0x3e8c4d-0x0;var _0x205fb5=_0xb749[_0x3e8c4d];return _0x205fb5;};'use strict';var multer=require(_0x9b74('0x0'));var util=require('util');var path=require(_0x9b74('0x1'));var timeout=require(_0x9b74('0x2'));var express=require('express');var router=express[_0x9b74('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b74('0x4'));var interaction=require(_0x9b74('0x5'));var config=require(_0x9b74('0x6'));var controller=require(_0x9b74('0x7'));router[_0x9b74('0x8')]('/',auth[_0x9b74('0x9')](),controller['index']);router[_0x9b74('0x8')]('/describe',auth[_0x9b74('0x9')](),controller[_0x9b74('0xa')]);router[_0x9b74('0x8')](_0x9b74('0xb'),auth[_0x9b74('0x9')](),controller['show']);router[_0x9b74('0x8')](_0x9b74('0xc'),auth['isAuthenticated'](),controller[_0x9b74('0xd')]);router[_0x9b74('0x8')](_0x9b74('0xe'),auth['isAuthenticated'](),controller[_0x9b74('0xf')]);router[_0x9b74('0x10')](_0x9b74('0x11'),auth[_0x9b74('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x9b74('0x12'),auth[_0x9b74('0x9')](),controller[_0x9b74('0x13')]);router[_0x9b74('0x10')]('/checkContactHopper',auth[_0x9b74('0x9')](),controller[_0x9b74('0x14')]);router[_0x9b74('0x15')](_0x9b74('0xb'),auth[_0x9b74('0x9')](),controller[_0x9b74('0x16')]);module['exports']=router; \ No newline at end of file +var _0x67d5=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','/voice/queue/countAttributes/:id'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x67d5,0x18a));var _0x567d=function(_0x4ed51c,_0x24d55c){_0x4ed51c=_0x4ed51c-0x0;var _0x1fb265=_0x67d5[_0x4ed51c];return _0x1fb265;};'use strict';var multer=require('multer');var util=require(_0x567d('0x0'));var path=require(_0x567d('0x1'));var timeout=require('connect-timeout');var express=require(_0x567d('0x2'));var router=express['Router']();var fs_extra=require(_0x567d('0x3'));var auth=require(_0x567d('0x4'));var interaction=require(_0x567d('0x5'));var config=require(_0x567d('0x6'));var controller=require(_0x567d('0x7'));router[_0x567d('0x8')]('/',auth[_0x567d('0x9')](),controller['index']);router[_0x567d('0x8')](_0x567d('0xa'),auth[_0x567d('0x9')](),controller[_0x567d('0xb')]);router[_0x567d('0x8')](_0x567d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x567d('0x8')](_0x567d('0xd'),auth[_0x567d('0x9')](),controller[_0x567d('0xe')]);router[_0x567d('0x8')](_0x567d('0xf'),auth[_0x567d('0x9')](),controller[_0x567d('0x10')]);router['post'](_0x567d('0x11'),auth[_0x567d('0x9')](),controller[_0x567d('0x12')]);router[_0x567d('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x567d('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x567d('0x13')](_0x567d('0x14'),auth['isAuthenticated'](),controller[_0x567d('0x15')]);router['put'](_0x567d('0xc'),auth[_0x567d('0x9')](),controller[_0x567d('0x16')]);module[_0x567d('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7a93a8c..1604eec 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 _0x56c0=['STRING','INTEGER','DATE','BOOLEAN','exports'];(function(_0x2cffa7,_0x27c829){var _0x37634f=function(_0x240f68){while(--_0x240f68){_0x2cffa7['push'](_0x2cffa7['shift']());}};_0x37634f(++_0x27c829);}(_0x56c0,0x68));var _0x056c=function(_0x19b6f5,_0x367239){_0x19b6f5=_0x19b6f5-0x0;var _0x5f429f=_0x56c0[_0x19b6f5];return _0x5f429f;};'use strict';var Sequelize=require('sequelize');module[_0x056c('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x056c('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x056c('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x056c('0x1')]},'calleridname':{'type':Sequelize[_0x056c('0x1')]},'starttime':{'type':Sequelize[_0x056c('0x3')]},'responsetime':{'type':Sequelize[_0x056c('0x3')]},'answertime':{'type':Sequelize[_0x056c('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x056c('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x056c('0x1')]},'reason':{'type':Sequelize[_0x056c('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x056c('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x056c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x056c('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x056c('0x3')]},'recallme':{'type':Sequelize[_0x056c('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x056c('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x056c('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x056c('0x1')]}}; \ No newline at end of file +var _0x5a72=['DATE','STRING','BOOLEAN','sequelize','INTEGER'];(function(_0x4d515d,_0x108c96){var _0x58fe07=function(_0x2e18bf){while(--_0x2e18bf){_0x4d515d['push'](_0x4d515d['shift']());}};_0x58fe07(++_0x108c96);}(_0x5a72,0x1c5));var _0x25a7=function(_0x35de64,_0x6ff220){_0x35de64=_0x35de64-0x0;var _0x1c75b8=_0x5a72[_0x35de64];return _0x1c75b8;};'use strict';var Sequelize=require(_0x25a7('0x0'));module['exports']={'state':{'type':Sequelize[_0x25a7('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x25a7('0x2')]},'countbusyretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x25a7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x25a7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x25a7('0x3')]},'calleridnum':{'type':Sequelize[_0x25a7('0x3')]},'calleridname':{'type':Sequelize[_0x25a7('0x3')]},'starttime':{'type':Sequelize[_0x25a7('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x25a7('0x2')]},'droptime':{'type':Sequelize[_0x25a7('0x2')]},'endtime':{'type':Sequelize[_0x25a7('0x2')]},'ringtime':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x25a7('0x3')]},'campaign':{'type':Sequelize[_0x25a7('0x3')]},'campaigntype':{'type':Sequelize[_0x25a7('0x3')]},'membername':{'type':Sequelize[_0x25a7('0x3')]},'reason':{'type':Sequelize[_0x25a7('0x3')]},'amd':{'type':Sequelize[_0x25a7('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x25a7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x25a7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x25a7('0x2')]},'recallme':{'type':Sequelize[_0x25a7('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x25a7('0x2')]},'edited':{'type':Sequelize[_0x25a7('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x25a7('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x25a7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5d6cb00..9787b1f 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 _0x0f21=['where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','length','find','create','body','describe','catch','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filters'];(function(_0xc76644,_0x2c0f9a){var _0x366481=function(_0x1800b7){while(--_0x1800b7){_0xc76644['push'](_0xc76644['shift']());}};_0x366481(++_0x2c0f9a);}(_0x0f21,0xa5));var _0x10f2=function(_0xbafa32,_0x2c216b){_0xbafa32=_0xbafa32-0x0;var _0x16bb35=_0x0f21[_0xbafa32];return _0x16bb35;};'use strict';var emlformat=require(_0x10f2('0x0'));var rimraf=require(_0x10f2('0x1'));var zipdir=require(_0x10f2('0x2'));var jsonpatch=require(_0x10f2('0x3'));var rp=require('request-promise');var moment=require(_0x10f2('0x4'));var BPromise=require(_0x10f2('0x5'));var Mustache=require(_0x10f2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x10f2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10f2('0x8'));var _=require(_0x10f2('0x9'));var squel=require(_0x10f2('0xa'));var crypto=require('crypto');var jsforce=require(_0x10f2('0xb'));var deskjs=require(_0x10f2('0xc'));var toCsv=require(_0x10f2('0x7'));var querystring=require(_0x10f2('0xd'));var Papa=require('papaparse');var Redis=require(_0x10f2('0xe'));var authService=require(_0x10f2('0xf'));var qs=require(_0x10f2('0x10'));var as=require(_0x10f2('0x11'));var hardwareService=require(_0x10f2('0x12'));var logger=require(_0x10f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x10f2('0x14'))['db'];function respondWithStatusCode(_0x22ace0,_0x427598){_0x427598=_0x427598||0xcc;return function(_0x2200f9){if(_0x2200f9){return _0x22ace0[_0x10f2('0x15')](_0x427598);}return _0x22ace0[_0x10f2('0x16')](_0x427598)[_0x10f2('0x17')]();};}function respondWithResult(_0x55770c,_0x22ce03){_0x22ce03=_0x22ce03||0xc8;return function(_0x3f84f7){if(_0x3f84f7){return _0x55770c[_0x10f2('0x16')](_0x22ce03)[_0x10f2('0x18')](_0x3f84f7);}};}function respondWithFilteredResult(_0x427797,_0x2ed001){return function(_0x4115d4){if(_0x4115d4){var _0x47ea42=typeof _0x2ed001[_0x10f2('0x19')]===_0x10f2('0x1a')&&typeof _0x2ed001['limit']==='undefined';var _0x271461=_0x4115d4[_0x10f2('0x1b')];var _0x5bb4ec=_0x47ea42?0x0:_0x2ed001[_0x10f2('0x19')];var _0x51692c=_0x47ea42?_0x4115d4[_0x10f2('0x1b')]:_0x2ed001[_0x10f2('0x19')]+_0x2ed001['limit'];var _0x119f29;if(_0x51692c>=_0x271461){_0x51692c=_0x271461;_0x119f29=0xc8;}else{_0x119f29=0xce;}_0x427797[_0x10f2('0x16')](_0x119f29);return _0x427797[_0x10f2('0x1c')](_0x10f2('0x1d'),_0x5bb4ec+'-'+_0x51692c+'/'+_0x271461)[_0x10f2('0x18')](_0x4115d4);}return null;};}function patchUpdates(_0x38d96e){return function(_0x4f57d5){try{jsonpatch[_0x10f2('0x1e')](_0x4f57d5,_0x38d96e,!![]);}catch(_0x59f0d8){return BPromise[_0x10f2('0x1f')](_0x59f0d8);}return _0x4f57d5['save']();};}function saveUpdates(_0x3d3b54,_0x11eb67){return function(_0x21d71b){if(_0x21d71b){return _0x21d71b[_0x10f2('0x20')](_0x3d3b54)['then'](function(_0x4d5452){return _0x4d5452;});}return null;};}function removeEntity(_0x297c13,_0xf34a85){return function(_0x38b335){if(_0x38b335){return _0x38b335['destroy']()[_0x10f2('0x21')](function(){_0x297c13['status'](0xcc)[_0x10f2('0x17')]();});}};}function handleEntityNotFound(_0x55c8d1,_0x4189d3){return function(_0x38f451){if(!_0x38f451){_0x55c8d1[_0x10f2('0x15')](0x194);}return _0x38f451;};}function handleError(_0x451cb0,_0x447bbf){_0x447bbf=_0x447bbf||0x1f4;return function(_0x176f0b){logger['error'](_0x176f0b[_0x10f2('0x22')]);if(_0x176f0b['name']){delete _0x176f0b[_0x10f2('0x23')];}_0x451cb0[_0x10f2('0x16')](_0x447bbf)[_0x10f2('0x24')](_0x176f0b);};}exports[_0x10f2('0x25')]=function(_0x21a7d2,_0x4f3d67){var _0x1e7c52={},_0xbe6943={},_0x267be7={'count':0x0,'rows':[]};var _0x136aa9=_[_0x10f2('0x26')](db[_0x10f2('0x27')][_0x10f2('0x28')],function(_0x3e1276){return{'name':_0x3e1276[_0x10f2('0x29')],'type':_0x3e1276['type'][_0x10f2('0x2a')]};});_0xbe6943[_0x10f2('0x2b')]=_['map'](_0x136aa9,_0x10f2('0x23'));_0xbe6943[_0x10f2('0x2c')]=_['keys'](_0x21a7d2[_0x10f2('0x2c')]);_0xbe6943['filters']=_['intersection'](_0xbe6943[_0x10f2('0x2b')],_0xbe6943[_0x10f2('0x2c')]);_0x1e7c52[_0x10f2('0x2d')]=_[_0x10f2('0x2e')](_0xbe6943[_0x10f2('0x2b')],qs['fields'](_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x2f')]));_0x1e7c52[_0x10f2('0x2d')]=_0x1e7c52['attributes']['length']?_0x1e7c52['attributes']:_0xbe6943[_0x10f2('0x2b')];if(!_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x30')](_0x10f2('0x31'))){_0x1e7c52[_0x10f2('0x32')]=qs['limit'](_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x32')]);_0x1e7c52[_0x10f2('0x19')]=qs[_0x10f2('0x19')](_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x19')]);}_0x1e7c52[_0x10f2('0x33')]=qs['sort'](_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x34')]);_0x1e7c52['where']=qs[_0x10f2('0x35')](_['pick'](_0x21a7d2['query'],_0xbe6943[_0x10f2('0x35')]),_0x136aa9);if(_0x21a7d2[_0x10f2('0x2c')]['filter']){_0x1e7c52[_0x10f2('0x36')]=_[_0x10f2('0x37')](_0x1e7c52[_0x10f2('0x36')],{'$or':_[_0x10f2('0x26')](_0x136aa9,function(_0xbe26e4){if(_0xbe26e4[_0x10f2('0x38')]!==_0x10f2('0x39')){var _0x487be4={};_0x487be4[_0xbe26e4[_0x10f2('0x23')]]={'$like':'%'+_0x21a7d2[_0x10f2('0x2c')][_0x10f2('0x3a')]+'%'};return _0x487be4;}})});}_0x1e7c52=_[_0x10f2('0x37')]({},_0x1e7c52,_0x21a7d2[_0x10f2('0x3b')]);var _0x147a15={'where':_0x1e7c52[_0x10f2('0x36')]};return db[_0x10f2('0x27')][_0x10f2('0x1b')](_0x147a15)['then'](function(_0x2a2e6a){_0x267be7[_0x10f2('0x1b')]=_0x2a2e6a;if(_0x21a7d2['query'][_0x10f2('0x3c')]){_0x1e7c52[_0x10f2('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1e7c52);})[_0x10f2('0x21')](function(_0x65afbc){_0x267be7[_0x10f2('0x3e')]=_0x65afbc;return _0x267be7;})[_0x10f2('0x21')](respondWithFilteredResult(_0x4f3d67,_0x1e7c52))['catch'](handleError(_0x4f3d67,null));};exports[_0x10f2('0x3f')]=function(_0x138277,_0x33e415){var _0x3d0df0={'raw':!![],'where':{'id':_0x138277[_0x10f2('0x40')]['id']}},_0x4d74f9={};_0x4d74f9['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x4d74f9[_0x10f2('0x2c')]=_[_0x10f2('0x41')](_0x138277['query']);_0x4d74f9[_0x10f2('0x35')]=_['intersection'](_0x4d74f9[_0x10f2('0x2b')],_0x4d74f9[_0x10f2('0x2c')]);_0x3d0df0[_0x10f2('0x2d')]=_[_0x10f2('0x2e')](_0x4d74f9[_0x10f2('0x2b')],qs['fields'](_0x138277[_0x10f2('0x2c')]['fields']));_0x3d0df0[_0x10f2('0x2d')]=_0x3d0df0[_0x10f2('0x2d')][_0x10f2('0x42')]?_0x3d0df0['attributes']:_0x4d74f9['model'];if(_0x138277['query'][_0x10f2('0x3c')]){_0x3d0df0[_0x10f2('0x3d')]=[{'all':!![]}];}_0x3d0df0=_[_0x10f2('0x37')]({},_0x3d0df0,_0x138277[_0x10f2('0x3b')]);return db[_0x10f2('0x27')][_0x10f2('0x43')](_0x3d0df0)['then'](handleEntityNotFound(_0x33e415,null))[_0x10f2('0x21')](respondWithResult(_0x33e415,null))['catch'](handleError(_0x33e415,null));};exports[_0x10f2('0x44')]=function(_0x154e99,_0x13d86c){return db[_0x10f2('0x27')]['create'](_0x154e99[_0x10f2('0x45')],{})[_0x10f2('0x21')](respondWithResult(_0x13d86c,0xc9))['catch'](handleError(_0x13d86c,null));};exports[_0x10f2('0x46')]=function(_0xe51d1c,_0x56050a){return db[_0x10f2('0x27')][_0x10f2('0x46')]()[_0x10f2('0x21')](respondWithResult(_0x56050a,null))[_0x10f2('0x47')](handleError(_0x56050a,null));};exports[_0x10f2('0x20')]=function(_0x5cc503,_0x1aa463){if(_0x5cc503['body'][_0x10f2('0x48')]){delete _0x5cc503[_0x10f2('0x45')][_0x10f2('0x48')];}return db[_0x10f2('0x27')][_0x10f2('0x43')]({'where':{'uniqueid':_0x5cc503['params']['id']}})[_0x10f2('0x21')](handleEntityNotFound(_0x1aa463,null))[_0x10f2('0x21')](saveUpdates(_0x5cc503[_0x10f2('0x45')],null))[_0x10f2('0x21')](respondWithResult(_0x1aa463,null))['catch'](handleError(_0x1aa463,null));}; \ No newline at end of file +var _0x4217=['includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options'];(function(_0x2053a9,_0x4397d4){var _0x4ac51a=function(_0x46d085){while(--_0x46d085){_0x2053a9['push'](_0x2053a9['shift']());}};_0x4ac51a(++_0x4397d4);}(_0x4217,0x1e6));var _0x7421=function(_0x825eb1,_0x49a452){_0x825eb1=_0x825eb1-0x0;var _0x104d4d=_0x4217[_0x825eb1];return _0x104d4d;};'use strict';var emlformat=require(_0x7421('0x0'));var rimraf=require(_0x7421('0x1'));var zipdir=require(_0x7421('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7421('0x3'));var moment=require(_0x7421('0x4'));var BPromise=require(_0x7421('0x5'));var Mustache=require('mustache');var util=require(_0x7421('0x6'));var path=require(_0x7421('0x7'));var sox=require(_0x7421('0x8'));var csv=require(_0x7421('0x9'));var ejs=require(_0x7421('0xa'));var fs=require('fs');var fs_extra=require(_0x7421('0xb'));var _=require(_0x7421('0xc'));var squel=require('squel');var crypto=require(_0x7421('0xd'));var jsforce=require(_0x7421('0xe'));var deskjs=require(_0x7421('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7421('0x10'));var Papa=require(_0x7421('0x11'));var Redis=require(_0x7421('0x12'));var authService=require(_0x7421('0x13'));var qs=require(_0x7421('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7421('0x15'))('api');var utils=require(_0x7421('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7421('0x17'))['db'];function respondWithStatusCode(_0x39d629,_0x4b074d){_0x4b074d=_0x4b074d||0xcc;return function(_0x188f49){if(_0x188f49){return _0x39d629[_0x7421('0x18')](_0x4b074d);}return _0x39d629[_0x7421('0x19')](_0x4b074d)[_0x7421('0x1a')]();};}function respondWithResult(_0x57a0bd,_0xe4170e){_0xe4170e=_0xe4170e||0xc8;return function(_0xeef40d){if(_0xeef40d){return _0x57a0bd[_0x7421('0x19')](_0xe4170e)[_0x7421('0x1b')](_0xeef40d);}};}function respondWithFilteredResult(_0x43d7a4,_0x13ec4f){return function(_0x1c2841){if(_0x1c2841){var _0x46be41=typeof _0x13ec4f[_0x7421('0x1c')]===_0x7421('0x1d')&&typeof _0x13ec4f[_0x7421('0x1e')]===_0x7421('0x1d');var _0xbe9dee=_0x1c2841['count'];var _0x5777cb=_0x46be41?0x0:_0x13ec4f['offset'];var _0x3626f7=_0x46be41?_0x1c2841[_0x7421('0x1f')]:_0x13ec4f[_0x7421('0x1c')]+_0x13ec4f['limit'];var _0x9eaa88;if(_0x3626f7>=_0xbe9dee){_0x3626f7=_0xbe9dee;_0x9eaa88=0xc8;}else{_0x9eaa88=0xce;}_0x43d7a4[_0x7421('0x19')](_0x9eaa88);return _0x43d7a4[_0x7421('0x20')]('Content-Range',_0x5777cb+'-'+_0x3626f7+'/'+_0xbe9dee)[_0x7421('0x1b')](_0x1c2841);}return null;};}function patchUpdates(_0x20a4cb){return function(_0x4abc9a){try{jsonpatch[_0x7421('0x21')](_0x4abc9a,_0x20a4cb,!![]);}catch(_0xa4b78b){return BPromise[_0x7421('0x22')](_0xa4b78b);}return _0x4abc9a[_0x7421('0x23')]();};}function saveUpdates(_0x5c772f,_0xf162d8){return function(_0x27a148){if(_0x27a148){return _0x27a148[_0x7421('0x24')](_0x5c772f)[_0x7421('0x25')](function(_0x659f6e){return _0x659f6e;});}return null;};}function removeEntity(_0x3d0a56,_0x370009){return function(_0x578813){if(_0x578813){return _0x578813['destroy']()[_0x7421('0x25')](function(){_0x3d0a56[_0x7421('0x19')](0xcc)[_0x7421('0x1a')]();});}};}function handleEntityNotFound(_0x2a4d3d,_0x444e22){return function(_0x17923c){if(!_0x17923c){_0x2a4d3d[_0x7421('0x18')](0x194);}return _0x17923c;};}function handleError(_0x2ab76e,_0x5efb5a){_0x5efb5a=_0x5efb5a||0x1f4;return function(_0x46103d){logger[_0x7421('0x26')](_0x46103d[_0x7421('0x27')]);if(_0x46103d[_0x7421('0x28')]){delete _0x46103d[_0x7421('0x28')];}_0x2ab76e[_0x7421('0x19')](_0x5efb5a)[_0x7421('0x29')](_0x46103d);};}exports[_0x7421('0x2a')]=function(_0xa3d58e,_0x369528){var _0x894987={},_0x2a404a={},_0x258ea2={'count':0x0,'rows':[]};var _0x3ccac5=_[_0x7421('0x2b')](db[_0x7421('0x2c')][_0x7421('0x2d')],function(_0x13c3ee){return{'name':_0x13c3ee[_0x7421('0x2e')],'type':_0x13c3ee[_0x7421('0x2f')][_0x7421('0x30')]};});_0x2a404a[_0x7421('0x31')]=_['map'](_0x3ccac5,_0x7421('0x28'));_0x2a404a[_0x7421('0x32')]=_[_0x7421('0x33')](_0xa3d58e[_0x7421('0x32')]);_0x2a404a['filters']=_['intersection'](_0x2a404a[_0x7421('0x31')],_0x2a404a['query']);_0x894987[_0x7421('0x34')]=_[_0x7421('0x35')](_0x2a404a[_0x7421('0x31')],qs[_0x7421('0x36')](_0xa3d58e['query'][_0x7421('0x36')]));_0x894987['attributes']=_0x894987[_0x7421('0x34')][_0x7421('0x37')]?_0x894987[_0x7421('0x34')]:_0x2a404a['model'];if(!_0xa3d58e['query'][_0x7421('0x38')](_0x7421('0x39'))){_0x894987[_0x7421('0x1e')]=qs[_0x7421('0x1e')](_0xa3d58e['query'][_0x7421('0x1e')]);_0x894987[_0x7421('0x1c')]=qs[_0x7421('0x1c')](_0xa3d58e['query'][_0x7421('0x1c')]);}_0x894987[_0x7421('0x3a')]=qs['sort'](_0xa3d58e[_0x7421('0x32')][_0x7421('0x3b')]);_0x894987[_0x7421('0x3c')]=qs['filters'](_[_0x7421('0x3d')](_0xa3d58e[_0x7421('0x32')],_0x2a404a[_0x7421('0x3e')]),_0x3ccac5);if(_0xa3d58e['query']['filter']){_0x894987[_0x7421('0x3c')]=_[_0x7421('0x3f')](_0x894987[_0x7421('0x3c')],{'$or':_[_0x7421('0x2b')](_0x3ccac5,function(_0x2b46da){if(_0x2b46da['type']!==_0x7421('0x40')){var _0x46dcb5={};_0x46dcb5[_0x2b46da[_0x7421('0x28')]]={'$like':'%'+_0xa3d58e['query'][_0x7421('0x41')]+'%'};return _0x46dcb5;}})});}_0x894987=_[_0x7421('0x3f')]({},_0x894987,_0xa3d58e[_0x7421('0x42')]);var _0x1aa241={'where':_0x894987[_0x7421('0x3c')]};return db[_0x7421('0x2c')][_0x7421('0x1f')](_0x1aa241)[_0x7421('0x25')](function(_0x1c19ce){_0x258ea2[_0x7421('0x1f')]=_0x1c19ce;if(_0xa3d58e[_0x7421('0x32')][_0x7421('0x43')]){_0x894987[_0x7421('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7421('0x45')](_0x894987);})[_0x7421('0x25')](function(_0x4f06ac){_0x258ea2[_0x7421('0x46')]=_0x4f06ac;return _0x258ea2;})['then'](respondWithFilteredResult(_0x369528,_0x894987))[_0x7421('0x47')](handleError(_0x369528,null));};exports[_0x7421('0x48')]=function(_0x13716e,_0x1de3d5){var _0x5b8055={'raw':!![],'where':{'id':_0x13716e[_0x7421('0x49')]['id']}},_0x519ea2={};_0x519ea2[_0x7421('0x31')]=_[_0x7421('0x33')](db[_0x7421('0x2c')][_0x7421('0x2d')]);_0x519ea2[_0x7421('0x32')]=_['keys'](_0x13716e[_0x7421('0x32')]);_0x519ea2[_0x7421('0x3e')]=_[_0x7421('0x35')](_0x519ea2[_0x7421('0x31')],_0x519ea2[_0x7421('0x32')]);_0x5b8055['attributes']=_[_0x7421('0x35')](_0x519ea2['model'],qs['fields'](_0x13716e['query'][_0x7421('0x36')]));_0x5b8055[_0x7421('0x34')]=_0x5b8055['attributes'][_0x7421('0x37')]?_0x5b8055[_0x7421('0x34')]:_0x519ea2[_0x7421('0x31')];if(_0x13716e[_0x7421('0x32')]['includeAll']){_0x5b8055[_0x7421('0x44')]=[{'all':!![]}];}_0x5b8055=_[_0x7421('0x3f')]({},_0x5b8055,_0x13716e[_0x7421('0x42')]);return db[_0x7421('0x2c')][_0x7421('0x4a')](_0x5b8055)['then'](handleEntityNotFound(_0x1de3d5,null))[_0x7421('0x25')](respondWithResult(_0x1de3d5,null))[_0x7421('0x47')](handleError(_0x1de3d5,null));};exports[_0x7421('0x4b')]=function(_0x26f83a,_0x246f3b){return db['CmHopperHistory'][_0x7421('0x4b')](_0x26f83a[_0x7421('0x4c')],{})[_0x7421('0x25')](respondWithResult(_0x246f3b,0xc9))['catch'](handleError(_0x246f3b,null));};exports[_0x7421('0x4d')]=function(_0x55da50,_0x365a78){return db['CmHopperHistory'][_0x7421('0x4d')]()[_0x7421('0x25')](respondWithResult(_0x365a78,null))[_0x7421('0x47')](handleError(_0x365a78,null));};exports['update']=function(_0x408758,_0x24397c){if(_0x408758[_0x7421('0x4c')][_0x7421('0x4e')]){delete _0x408758['body'][_0x7421('0x4e')];}return db[_0x7421('0x2c')][_0x7421('0x4a')]({'where':{'uniqueid':_0x408758[_0x7421('0x49')]['id']}})[_0x7421('0x25')](handleEntityNotFound(_0x24397c,null))[_0x7421('0x25')](saveUpdates(_0x408758['body'],null))[_0x7421('0x25')](respondWithResult(_0x24397c,null))['catch'](handleError(_0x24397c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index da4080f..597612b 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 _0x6343=['../../config/logger','api','rimraf','../../config/environment','exports','define','CmHopperHistory','endtime','uniqueid'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x6343,0x168));var _0x3634=function(_0x5ec1ed,_0x97292c){_0x5ec1ed=_0x5ec1ed-0x0;var _0x471c1a=_0x6343[_0x5ec1ed];return _0x471c1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3634('0x0'))(_0x3634('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var attributes=require('./cmHopperHistory.attributes');module[_0x3634('0x4')]=function(_0x388c18,_0x4bb496){return _0x388c18[_0x3634('0x5')](_0x3634('0x6'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x3634('0x7')]},{'name':_0x3634('0x8'),'fields':[_0x3634('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3b3=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x37ff5f,_0x543aa6){var _0x2bb1b0=function(_0x5cc1ff){while(--_0x5cc1ff){_0x37ff5f['push'](_0x37ff5f['shift']());}};_0x2bb1b0(++_0x543aa6);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x23b7b1,_0x4215ae){_0x23b7b1=_0x23b7b1-0x0;var _0x16f057=_0xe3b3[_0x23b7b1];return _0x16f057;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'paranoid':![],'indexes':[{'name':_0x3e3b('0xd'),'fields':[_0x3e3b('0xd')]},{'name':_0x3e3b('0xe'),'fields':[_0x3e3b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 3f79da3..b1251e5 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 _0xcc19=['AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','debug'];(function(_0x21aa5b,_0x2c808f){var _0x2ca4c8=function(_0x5819e5){while(--_0x5819e5){_0x21aa5b['push'](_0x21aa5b['shift']());}};_0x2ca4c8(++_0x2c808f);}(_0xcc19,0xbd));var _0x9cc1=function(_0x32a2cf,_0x20b153){_0x32a2cf=_0x32a2cf-0x0;var _0x250e9d=_0xcc19[_0x32a2cf];return _0x250e9d;};'use strict';var _=require(_0x9cc1('0x0'));var util=require(_0x9cc1('0x1'));var moment=require('moment');var BPromise=require(_0x9cc1('0x2'));var rs=require(_0x9cc1('0x3'));var fs=require('fs');var Redis=require(_0x9cc1('0x4'));var db=require(_0x9cc1('0x5'))['db'];var utils=require(_0x9cc1('0x6'));var logger=require(_0x9cc1('0x7'))(_0x9cc1('0x8'));var config=require(_0x9cc1('0x9'));var jayson=require(_0x9cc1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29eebc,_0x1b6b0f,_0x3b8efc){return new BPromise(function(_0x3050ca,_0x17d405){return client[_0x9cc1('0xb')](_0x29eebc,_0x3b8efc)['then'](function(_0xc994dd){logger[_0x9cc1('0xc')](_0x9cc1('0xd'),_0x1b6b0f,_0x9cc1('0xe'));logger['debug'](_0x9cc1('0xf'),_0x1b6b0f,_0x9cc1('0xe'),JSON[_0x9cc1('0x10')](_0xc994dd));if(_0xc994dd[_0x9cc1('0x11')]){if(_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x12')]===0x1f4){logger[_0x9cc1('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x1b6b0f,_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);return _0x17d405(_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);}logger[_0x9cc1('0x11')](_0x9cc1('0xd'),_0x1b6b0f,_0xc994dd[_0x9cc1('0x11')][_0x9cc1('0x13')]);return _0x3050ca(_0xc994dd[_0x9cc1('0x11')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x1b6b0f,'request\x20sent');_0x3050ca(_0xc994dd[_0x9cc1('0x14')][_0x9cc1('0x13')]);}})[_0x9cc1('0x15')](function(_0x6ae4e3){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1b6b0f,_0x6ae4e3);_0x17d405(_0x6ae4e3);});});}exports[_0x9cc1('0x16')]=function(_0x3ca08d){var _0x32b27b=this;return new Promise(function(_0x31e625,_0x5908cd){return db[_0x9cc1('0x17')][_0x9cc1('0x18')](_0x3ca08d[_0x9cc1('0x19')],{'raw':_0x3ca08d[_0x9cc1('0x1a')]?_0x3ca08d['options'][_0x9cc1('0x1b')]===undefined?!![]:![]:!![]})[_0x9cc1('0x1c')](function(_0x358d26){logger[_0x9cc1('0xc')](_0x9cc1('0x16'),_0x3ca08d);logger[_0x9cc1('0x1d')](_0x9cc1('0x16'),_0x3ca08d,JSON['stringify'](_0x358d26));_0x31e625(_0x358d26);})[_0x9cc1('0x15')](function(_0x7dec83){logger['error']('CreateCmHopperHistory',_0x7dec83[_0x9cc1('0x13')],_0x3ca08d);_0x5908cd(_0x32b27b[_0x9cc1('0x11')](0x1f4,_0x7dec83['message']));});});};exports[_0x9cc1('0x1e')]=function(_0x1ef313){var _0x59bf61=this;return new Promise(function(_0x340527,_0x560198){return db[_0x9cc1('0x17')]['findAll']({'raw':_0x1ef313['options']?_0x1ef313[_0x9cc1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1ef313['options']?_0x1ef313[_0x9cc1('0x1a')][_0x9cc1('0x1f')]||null:null,'attributes':[[db[_0x9cc1('0x20')]['fn']('COUNT',db[_0x9cc1('0x20')][_0x9cc1('0x21')]('id')),_0x9cc1('0x22')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db['sequelize']['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9cc1('0x25')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x26')))),_0x9cc1('0x27')],[db[_0x9cc1('0x20')]['fn']('COUNT',db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x28')))),_0x9cc1('0x29')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x2a'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9cc1('0x2b')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x2a'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x2c')))),_0x9cc1('0x2d')]]})['then'](function(_0xb5def6){logger[_0x9cc1('0xc')]('AvgHandleTime',_0x1ef313);logger[_0x9cc1('0x1d')]('AvgHandleTime',_0x1ef313,JSON[_0x9cc1('0x10')](_0xb5def6));_0x340527(_0xb5def6);})['catch'](function(_0x4ae6ec){logger[_0x9cc1('0x11')](_0x9cc1('0x1e'),_0x4ae6ec['message'],_0x1ef313);_0x560198(_0x59bf61[_0x9cc1('0x11')](0x1f4,_0x4ae6ec['message']));});});};exports[_0x9cc1('0x2e')]=function(_0x5bb65f){var _0x446bfe=this;return new Promise(function(_0x55a085,_0xe4d126){return db['CmHopperHistory'][_0x9cc1('0x2f')]({'raw':_0x5bb65f[_0x9cc1('0x1a')]?_0x5bb65f[_0x9cc1('0x1a')][_0x9cc1('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bb65f['options']?_0x5bb65f[_0x9cc1('0x1a')]['where']||null:null,'attributes':[[_0x9cc1('0x30'),_0x9cc1('0x31')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db['sequelize']['literal'](_0x9cc1('0x32')))),_0x9cc1('0x33')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x34')))),_0x9cc1('0x35')],[db['sequelize']['fn']('COUNT',db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9cc1('0x36')],[db['sequelize']['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x37')))),'outboundBusyCallsDay'],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x38')))),_0x9cc1('0x39')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x3a')))),_0x9cc1('0x3b')],[db['sequelize']['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x3c')))),_0x9cc1('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x3e')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9cc1('0x3f')))),_0x9cc1('0x40')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x41')))),'outboundOriginateFailureCallsDay'],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db['sequelize']['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x42')))),_0x9cc1('0x43')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x9cc1('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9cc1('0x44')],[db[_0x9cc1('0x20')]['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db[_0x9cc1('0x20')][_0x9cc1('0x24')](_0x9cc1('0x45')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x9cc1('0x23'),db[_0x9cc1('0x20')]['fn']('IF',db['sequelize'][_0x9cc1('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x9cc1('0x46')]],'group':['campaign']})['then'](function(_0x5121d3){logger[_0x9cc1('0xc')](_0x9cc1('0x2e'),_0x5bb65f);logger[_0x9cc1('0x1d')](_0x9cc1('0x2e'),_0x5bb65f,JSON['stringify'](_0x5121d3));_0x55a085(_0x5121d3);})[_0x9cc1('0x15')](function(_0x1863c2){logger[_0x9cc1('0x11')]('GetVoiceQueueHopperHistory',_0x1863c2[_0x9cc1('0x13')],_0x5bb65f);_0xe4d126(_0x446bfe[_0x9cc1('0x11')](0x1f4,_0x1863c2[_0x9cc1('0x13')]));});});};exports[_0x9cc1('0x47')]=function(_0xcfb12e){var _0x1fed55=this;return new Promise(function(_0x38b125,_0x451df6){return db[_0x9cc1('0x17')][_0x9cc1('0x2f')]({'raw':_0xcfb12e['options']?_0xcfb12e[_0x9cc1('0x1a')][_0x9cc1('0x1b')]===undefined?!![]:![]:!![],'where':_0xcfb12e[_0x9cc1('0x1a')]?_0xcfb12e[_0x9cc1('0x1a')][_0x9cc1('0x1f')]||null:null,'attributes':[['campaign','name'],[db[_0x9cc1('0x20')]['fn']('COUNT',db['sequelize'][_0x9cc1('0x21')]('id')),'ivrTotalCallsDays'],[db[_0x9cc1('0x20')]['fn']('COUNT',db[_0x9cc1('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x9cc1('0x48')]],'group':['campaign']})[_0x9cc1('0x1c')](function(_0x230ccb){logger[_0x9cc1('0xc')](_0x9cc1('0x47'),_0xcfb12e);logger[_0x9cc1('0x1d')](_0x9cc1('0x47'),_0xcfb12e,JSON[_0x9cc1('0x10')](_0x230ccb));_0x38b125(_0x230ccb);})[_0x9cc1('0x15')](function(_0x32b614){logger['error'](_0x9cc1('0x47'),_0x32b614[_0x9cc1('0x13')],_0xcfb12e);_0x451df6(_0x1fed55[_0x9cc1('0x11')](0x1f4,_0x32b614[_0x9cc1('0x13')]));});});}; \ No newline at end of file +var _0xd84c=['AvgHandleTime','findAll','raw','where','col','predictiveIntervalTotalCalls','COUNT','sequelize','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`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=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options'];(function(_0x1a2f9e,_0x54e904){var _0x42544e=function(_0x349190){while(--_0x349190){_0x1a2f9e['push'](_0x1a2f9e['shift']());}};_0x42544e(++_0x54e904);}(_0xd84c,0x102));var _0xcd84=function(_0x2d2f41,_0x11913a){_0x2d2f41=_0x2d2f41-0x0;var _0x292497=_0xd84c[_0x2d2f41];return _0x292497;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520d49,_0x2b5383,_0x22c811){return new BPromise(function(_0x3f3617,_0x5408e2){return client[_0xcd84('0xd')](_0x520d49,_0x22c811)[_0xcd84('0xe')](function(_0xec34a2){logger[_0xcd84('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'));logger[_0xcd84('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'),JSON[_0xcd84('0x12')](_0xec34a2));if(_0xec34a2[_0xcd84('0x13')]){if(_0xec34a2['error'][_0xcd84('0x14')]===0x1f4){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')]['message']);return _0x5408e2(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);return _0x3f3617(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}else{logger[_0xcd84('0xf')](_0xcd84('0x15'),_0x2b5383,_0xcd84('0x10'));_0x3f3617(_0xec34a2[_0xcd84('0x17')][_0xcd84('0x16')]);}})[_0xcd84('0x18')](function(_0xfc4ec7){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xfc4ec7);_0x5408e2(_0xfc4ec7);});});}exports[_0xcd84('0x19')]=function(_0x4ff790){var _0x3c2d33=this;return new Promise(function(_0x15099f,_0x4c9509){return db[_0xcd84('0x1a')][_0xcd84('0x1b')](_0x4ff790[_0xcd84('0x1c')],{'raw':_0x4ff790[_0xcd84('0x1d')]?_0x4ff790[_0xcd84('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xcd84('0xe')](function(_0x171813){logger[_0xcd84('0xf')]('CreateCmHopperHistory',_0x4ff790);logger['debug'](_0xcd84('0x19'),_0x4ff790,JSON['stringify'](_0x171813));_0x15099f(_0x171813);})[_0xcd84('0x18')](function(_0x20b0ce){logger['error'](_0xcd84('0x19'),_0x20b0ce[_0xcd84('0x16')],_0x4ff790);_0x4c9509(_0x3c2d33[_0xcd84('0x13')](0x1f4,_0x20b0ce[_0xcd84('0x16')]));});});};exports[_0xcd84('0x1e')]=function(_0xfc2a17){var _0x49f7e8=this;return new Promise(function(_0x41d6c2,_0x113711){return db[_0xcd84('0x1a')][_0xcd84('0x1f')]({'raw':_0xfc2a17[_0xcd84('0x1d')]?_0xfc2a17[_0xcd84('0x1d')][_0xcd84('0x20')]===undefined?!![]:![]:!![],'where':_0xfc2a17['options']?_0xfc2a17['options'][_0xcd84('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0xcd84('0x22')]('id')),_0xcd84('0x23')],[db['sequelize']['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')]['literal'](_0xcd84('0x26')))),'predictiveIntervalAnsweredCalls'],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x28')))),_0xcd84('0x29')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')]('`state`\x20=\x2011,\x201,\x20null'))),_0xcd84('0x2a')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x2b'),db[_0xcd84('0x25')]['fn']('IF',db['sequelize'][_0xcd84('0x27')](_0xcd84('0x2c')))),_0xcd84('0x2d')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x2b'),db['sequelize']['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x2e')))),_0xcd84('0x2f')]]})[_0xcd84('0xe')](function(_0x15a7ac){logger[_0xcd84('0xf')]('AvgHandleTime',_0xfc2a17);logger[_0xcd84('0x11')](_0xcd84('0x1e'),_0xfc2a17,JSON['stringify'](_0x15a7ac));_0x41d6c2(_0x15a7ac);})[_0xcd84('0x18')](function(_0x59af28){logger[_0xcd84('0x13')](_0xcd84('0x1e'),_0x59af28[_0xcd84('0x16')],_0xfc2a17);_0x113711(_0x49f7e8[_0xcd84('0x13')](0x1f4,_0x59af28[_0xcd84('0x16')]));});});};exports[_0xcd84('0x30')]=function(_0x27d0ac){var _0x83f5f4=this;return new Promise(function(_0xd0fa6a,_0x2dd941){return db[_0xcd84('0x1a')][_0xcd84('0x1f')]({'raw':_0x27d0ac[_0xcd84('0x1d')]?_0x27d0ac[_0xcd84('0x1d')][_0xcd84('0x20')]===undefined?!![]:![]:!![],'where':_0x27d0ac['options']?_0x27d0ac[_0xcd84('0x1d')]['where']||null:null,'attributes':[['campaign',_0xcd84('0x31')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db['sequelize']['literal'](_0xcd84('0x32')))),'outboundNoSuchCallsDay'],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db['sequelize']['fn']('IF',db[_0xcd84('0x25')]['literal'](_0xcd84('0x33')))),_0xcd84('0x34')],[db[_0xcd84('0x25')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x26')))),_0xcd84('0x35')],[db['sequelize']['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x36')))),_0xcd84('0x37')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db['sequelize'][_0xcd84('0x27')]('`state`\x20=\x208,\x201,\x20null'))),_0xcd84('0x38')],[db['sequelize']['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db['sequelize']['literal'](_0xcd84('0x39')))),_0xcd84('0x3a')],[db[_0xcd84('0x25')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcd84('0x25')]['literal'](_0xcd84('0x3b')))),_0xcd84('0x3c')],[db['sequelize']['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db['sequelize'][_0xcd84('0x27')](_0xcd84('0x3d')))),_0xcd84('0x3e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x3f')))),_0xcd84('0x40')],[db[_0xcd84('0x25')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')](_0xcd84('0x41')))),_0xcd84('0x42')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')]['literal'](_0xcd84('0x43')))),'outboundAnswerAgiCallsDay'],[db[_0xcd84('0x25')]['fn']('COUNT',db[_0xcd84('0x25')]['fn']('IF',db['sequelize'][_0xcd84('0x27')]('`state`\x20=\x2020,\x201,\x20null'))),_0xcd84('0x42')],[db[_0xcd84('0x25')]['fn']('COUNT',db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')][_0xcd84('0x27')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xcd84('0x44')]})[_0xcd84('0xe')](function(_0x4f8e02){logger['info']('GetVoiceQueueHopperHistory',_0x27d0ac);logger['debug'](_0xcd84('0x30'),_0x27d0ac,JSON[_0xcd84('0x12')](_0x4f8e02));_0xd0fa6a(_0x4f8e02);})[_0xcd84('0x18')](function(_0x52e473){logger[_0xcd84('0x13')](_0xcd84('0x30'),_0x52e473[_0xcd84('0x16')],_0x27d0ac);_0x2dd941(_0x83f5f4[_0xcd84('0x13')](0x1f4,_0x52e473[_0xcd84('0x16')]));});});};exports[_0xcd84('0x45')]=function(_0x1b453c){var _0x43e03e=this;return new Promise(function(_0x42e536,_0x2cbf2d){return db[_0xcd84('0x1a')][_0xcd84('0x1f')]({'raw':_0x1b453c[_0xcd84('0x1d')]?_0x1b453c[_0xcd84('0x1d')][_0xcd84('0x20')]===undefined?!![]:![]:!![],'where':_0x1b453c[_0xcd84('0x1d')]?_0x1b453c[_0xcd84('0x1d')][_0xcd84('0x21')]||null:null,'attributes':[[_0xcd84('0x44'),'name'],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['col']('id')),_0xcd84('0x46')],[db[_0xcd84('0x25')]['fn'](_0xcd84('0x24'),db[_0xcd84('0x25')]['fn']('IF',db[_0xcd84('0x25')]['literal'](_0xcd84('0x26')))),_0xcd84('0x47')]],'group':[_0xcd84('0x44')]})[_0xcd84('0xe')](function(_0x2906f3){logger['info'](_0xcd84('0x45'),_0x1b453c);logger[_0xcd84('0x11')](_0xcd84('0x45'),_0x1b453c,JSON['stringify'](_0x2906f3));_0x42e536(_0x2906f3);})[_0xcd84('0x18')](function(_0x6a7605){logger[_0xcd84('0x13')]('GetCampaignHopperHistory',_0x6a7605[_0xcd84('0x16')],_0x1b453c);_0x2cbf2d(_0x43e03e['error'](0x1f4,_0x6a7605[_0xcd84('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8b1a494..824dc8a 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 _0xe083=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe083,0xdc));var _0x3e08=function(_0xb2ec74,_0x1934f8){_0xb2ec74=_0xb2ec74-0x0;var _0x2a74e6=_0xe083[_0xb2ec74];return _0x2a74e6;};'use strict';var multer=require(_0x3e08('0x0'));var util=require(_0x3e08('0x1'));var path=require(_0x3e08('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e08('0x3'));var router=express[_0x3e08('0x4')]();var fs_extra=require(_0x3e08('0x5'));var auth=require(_0x3e08('0x6'));var interaction=require(_0x3e08('0x7'));var config=require(_0x3e08('0x8'));var controller=require(_0x3e08('0x9'));router['get']('/',auth[_0x3e08('0xa')](),controller[_0x3e08('0xb')]);router[_0x3e08('0xc')](_0x3e08('0xd'),auth[_0x3e08('0xa')](),controller[_0x3e08('0xe')]);router[_0x3e08('0xc')](_0x3e08('0xf'),auth[_0x3e08('0xa')](),controller[_0x3e08('0x10')]);router[_0x3e08('0x11')]('/',auth['isAuthenticated'](),controller[_0x3e08('0x12')]);router['put'](_0x3e08('0xf'),auth[_0x3e08('0xa')](),controller['update']);module[_0x3e08('0x13')]=router; \ No newline at end of file +var _0x9a69=['../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x522054,_0x3ce23c){var _0x28e8b9=function(_0x23d31b){while(--_0x23d31b){_0x522054['push'](_0x522054['shift']());}};_0x28e8b9(++_0x3ce23c);}(_0x9a69,0x182));var _0x99a6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9a69[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x99a6('0x0'));var path=require(_0x99a6('0x1'));var timeout=require(_0x99a6('0x2'));var express=require('express');var router=express[_0x99a6('0x3')]();var fs_extra=require(_0x99a6('0x4'));var auth=require(_0x99a6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x99a6('0x6'));router[_0x99a6('0x7')]('/',auth[_0x99a6('0x8')](),controller[_0x99a6('0x9')]);router[_0x99a6('0x7')](_0x99a6('0xa'),auth['isAuthenticated'](),controller[_0x99a6('0xb')]);router[_0x99a6('0x7')](_0x99a6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x99a6('0xd')]('/',auth[_0x99a6('0x8')](),controller['create']);router[_0x99a6('0xe')](_0x99a6('0xc'),auth[_0x99a6('0x8')](),controller[_0x99a6('0xf')]);module[_0x99a6('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 ef08903..405375b 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 _0x6347=['STRING','sequelize','exports','name'];(function(_0x35c98d,_0x1ef0ea){var _0xd9cd77=function(_0xd94da1){while(--_0xd94da1){_0x35c98d['push'](_0x35c98d['shift']());}};_0xd9cd77(++_0x1ef0ea);}(_0x6347,0x1c9));var _0x7634=function(_0x1a0052,_0x554647){_0x1a0052=_0x1a0052-0x0;var _0x15fe78=_0x6347[_0x1a0052];return _0x15fe78;};'use strict';var Sequelize=require(_0x7634('0x0'));module[_0x7634('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7634('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7634('0x3')]},'dialPrefix':{'type':Sequelize[_0x7634('0x3')]}}; \ No newline at end of file +var _0x4ce6=['sequelize','STRING','name'];(function(_0x5261bb,_0x4081a5){var _0x53e0a6=function(_0x5c5ede){while(--_0x5c5ede){_0x5261bb['push'](_0x5261bb['shift']());}};_0x53e0a6(++_0x4081a5);}(_0x4ce6,0x108));var _0x64ce=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x4ce6[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0x64ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x64ce('0x1')],'unique':_0x64ce('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x64ce('0x1')]},'dialPrefix':{'type':Sequelize[_0x64ce('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a3f8cdb..8ae0e93 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 _0xf066=['cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','switch','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','error','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Lists','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','hasOwnProperty','order','ListId','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','item'];(function(_0x24f08a,_0x4d5b51){var _0x405dcf=function(_0x7918cc){while(--_0x7918cc){_0x24f08a['push'](_0x24f08a['shift']());}};_0x405dcf(++_0x4d5b51);}(_0xf066,0x17c));var _0x6f06=function(_0x59cdd0,_0x56af37){_0x59cdd0=_0x59cdd0-0x0;var _0x41bf3d=_0xf066[_0x59cdd0];return _0x41bf3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f06('0x0'));var zipdir=require(_0x6f06('0x1'));var jsonpatch=require(_0x6f06('0x2'));var rp=require('request-promise');var moment=require(_0x6f06('0x3'));var BPromise=require(_0x6f06('0x4'));var Mustache=require(_0x6f06('0x5'));var util=require(_0x6f06('0x6'));var path=require(_0x6f06('0x7'));var sox=require(_0x6f06('0x8'));var csv=require(_0x6f06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f06('0xa'));var _=require('lodash');var squel=require(_0x6f06('0xb'));var crypto=require(_0x6f06('0xc'));var jsforce=require(_0x6f06('0xd'));var deskjs=require(_0x6f06('0xe'));var toCsv=require(_0x6f06('0x9'));var querystring=require(_0x6f06('0xf'));var Papa=require(_0x6f06('0x10'));var Redis=require(_0x6f06('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f06('0x12'));var as=require(_0x6f06('0x13'));var hardwareService=require(_0x6f06('0x14'));var logger=require(_0x6f06('0x15'))(_0x6f06('0x16'));var utils=require(_0x6f06('0x17'));var config=require(_0x6f06('0x18'));var licenseUtil=require(_0x6f06('0x19'));var db=require(_0x6f06('0x1a'))['db'];var csv_results;config[_0x6f06('0x1b')]=_[_0x6f06('0x1c')](config[_0x6f06('0x1b')],{'host':_0x6f06('0x1d'),'port':0x18eb});var socket=require(_0x6f06('0x1e'))(new Redis(config[_0x6f06('0x1b')]));require(_0x6f06('0x1f'))[_0x6f06('0x20')](socket);function respondWithStatusCode(_0x145035,_0x4bd99c){_0x4bd99c=_0x4bd99c||0xcc;return function(_0x4d1a3b){if(_0x4d1a3b){return _0x145035[_0x6f06('0x21')](_0x4bd99c);}return _0x145035[_0x6f06('0x22')](_0x4bd99c)[_0x6f06('0x23')]();};}function respondWithResult(_0x5df4b1,_0x11db86){_0x11db86=_0x11db86||0xc8;return function(_0x51471f){if(_0x51471f){return _0x5df4b1[_0x6f06('0x22')](_0x11db86)[_0x6f06('0x24')](_0x51471f);}};}function respondWithFilteredResult(_0x9b8b0a,_0x1fef88){return function(_0x47da06){if(_0x47da06){var _0x15dcec=typeof _0x1fef88[_0x6f06('0x25')]===_0x6f06('0x26')&&typeof _0x1fef88[_0x6f06('0x27')]===_0x6f06('0x26');var _0x26b959=_0x47da06[_0x6f06('0x28')];var _0x475d9f=_0x15dcec?0x0:_0x1fef88['offset'];var _0x409dbd=_0x15dcec?_0x47da06[_0x6f06('0x28')]:_0x1fef88[_0x6f06('0x25')]+_0x1fef88[_0x6f06('0x27')];var _0x2ba4eb;if(_0x409dbd>=_0x26b959){_0x409dbd=_0x26b959;_0x2ba4eb=0xc8;}else{_0x2ba4eb=0xce;}_0x9b8b0a['status'](_0x2ba4eb);return _0x9b8b0a[_0x6f06('0x29')]('Content-Range',_0x475d9f+'-'+_0x409dbd+'/'+_0x26b959)[_0x6f06('0x24')](_0x47da06);}return null;};}function patchUpdates(_0x5aa867){return function(_0x5271c2){try{jsonpatch['apply'](_0x5271c2,_0x5aa867,!![]);}catch(_0x5a7f6c){return BPromise[_0x6f06('0x2a')](_0x5a7f6c);}return _0x5271c2[_0x6f06('0x2b')]();};}function saveUpdates(_0x38b02c,_0x47e524){return function(_0x3be45f){if(_0x3be45f){return _0x3be45f[_0x6f06('0x2c')](_0x38b02c)[_0x6f06('0x2d')](function(_0x4fc4de){return _0x4fc4de;});}return null;};}function removeEntity(_0x56ad70,_0x2af76e){return function(_0x5a5f52){if(_0x5a5f52){return _0x5a5f52[_0x6f06('0x2e')]()[_0x6f06('0x2d')](function(){var _0x46dd4c=_0x5a5f52[_0x6f06('0x2f')]({'plain':!![]});var _0x4ba778=_0x6f06('0x30');return db[_0x6f06('0x31')][_0x6f06('0x2e')]({'where':{'type':_0x4ba778,'resourceId':_0x46dd4c['id']}})[_0x6f06('0x2d')](function(){return _0x5a5f52;});})['then'](function(){_0x56ad70[_0x6f06('0x22')](0xcc)[_0x6f06('0x23')]();});}};}function handleEntityNotFound(_0x5b4b94,_0x53337e){return function(_0x4c903b){if(!_0x4c903b){_0x5b4b94[_0x6f06('0x21')](0x194);}return _0x4c903b;};}function handleError(_0x48a376,_0x1e3598){_0x1e3598=_0x1e3598||0x1f4;return function(_0x31e4e0){logger['error'](_0x31e4e0[_0x6f06('0x32')]);if(_0x31e4e0[_0x6f06('0x33')]){delete _0x31e4e0[_0x6f06('0x33')];}_0x48a376['status'](_0x1e3598)[_0x6f06('0x34')](_0x31e4e0);};}exports['index']=function(_0x5494b1,_0x5f3bf4){var _0x1465c6={},_0x28597c={},_0x5eb0ae={'count':0x0,'rows':[]};var _0x806c63=_['map'](db['CmList'][_0x6f06('0x35')],function(_0x4e0bd5){return{'name':_0x4e0bd5[_0x6f06('0x36')],'type':_0x4e0bd5[_0x6f06('0x37')][_0x6f06('0x38')]};});_0x28597c[_0x6f06('0x39')]=_['map'](_0x806c63,'name');_0x28597c['query']=_[_0x6f06('0x3a')](_0x5494b1[_0x6f06('0x3b')]);_0x28597c['filters']=_[_0x6f06('0x3c')](_0x28597c[_0x6f06('0x39')],_0x28597c['query']);_0x1465c6[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x28597c[_0x6f06('0x39')],qs['fields'](_0x5494b1['query']['fields']));_0x1465c6[_0x6f06('0x3d')]=_0x1465c6[_0x6f06('0x3d')][_0x6f06('0x3e')]?_0x1465c6[_0x6f06('0x3d')]:_0x28597c['model'];if(!_0x5494b1[_0x6f06('0x3b')]['hasOwnProperty'](_0x6f06('0x3f'))){_0x1465c6['limit']=qs[_0x6f06('0x27')](_0x5494b1[_0x6f06('0x3b')][_0x6f06('0x27')]);_0x1465c6['offset']=qs[_0x6f06('0x25')](_0x5494b1['query']['offset']);}_0x1465c6['order']=qs[_0x6f06('0x40')](_0x5494b1[_0x6f06('0x3b')][_0x6f06('0x40')]);_0x1465c6[_0x6f06('0x41')]=qs[_0x6f06('0x42')](_[_0x6f06('0x43')](_0x5494b1['query'],_0x28597c['filters']),_0x806c63);if(_0x5494b1[_0x6f06('0x3b')][_0x6f06('0x44')]){_0x1465c6['where']=_[_0x6f06('0x45')](_0x1465c6['where'],{'$or':_[_0x6f06('0x46')](_0x806c63,function(_0x9c523f){if(_0x9c523f[_0x6f06('0x37')]!==_0x6f06('0x47')){var _0x275e3d={};_0x275e3d[_0x9c523f['name']]={'$like':'%'+_0x5494b1[_0x6f06('0x3b')][_0x6f06('0x44')]+'%'};return _0x275e3d;}})});}_0x1465c6=_[_0x6f06('0x45')]({},_0x1465c6,_0x5494b1[_0x6f06('0x48')]);var _0x29c596={'where':_0x1465c6[_0x6f06('0x41')]};return db[_0x6f06('0x49')][_0x6f06('0x28')](_0x29c596)['then'](function(_0x50c455){_0x5eb0ae[_0x6f06('0x28')]=_0x50c455;if(_0x5494b1[_0x6f06('0x3b')][_0x6f06('0x4a')]){_0x1465c6[_0x6f06('0x4b')]=[{'all':!![]}];}return db[_0x6f06('0x49')][_0x6f06('0x4c')](_0x1465c6);})[_0x6f06('0x2d')](function(_0x12141c){_0x5eb0ae[_0x6f06('0x4d')]=_0x12141c;return _0x5eb0ae;})[_0x6f06('0x2d')](respondWithFilteredResult(_0x5f3bf4,_0x1465c6))[_0x6f06('0x4e')](handleError(_0x5f3bf4,null));};exports['show']=function(_0x106451,_0x1c735a){var _0x1949e6={'raw':![],'where':{'id':_0x106451[_0x6f06('0x4f')]['id']}},_0x5cd7ee={};_0x5cd7ee[_0x6f06('0x39')]=_[_0x6f06('0x3a')](db['CmList']['rawAttributes']);_0x5cd7ee[_0x6f06('0x3b')]=_[_0x6f06('0x3a')](_0x106451['query']);_0x5cd7ee['filters']=_[_0x6f06('0x3c')](_0x5cd7ee[_0x6f06('0x39')],_0x5cd7ee['query']);_0x1949e6[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x5cd7ee[_0x6f06('0x39')],qs[_0x6f06('0x50')](_0x106451[_0x6f06('0x3b')][_0x6f06('0x50')]));_0x1949e6[_0x6f06('0x3d')]=_0x1949e6['attributes']['length']?_0x1949e6[_0x6f06('0x3d')]:_0x5cd7ee[_0x6f06('0x39')];if(_0x106451['query'][_0x6f06('0x4a')]){_0x1949e6[_0x6f06('0x4b')]=[{'all':!![]}];}_0x1949e6=_[_0x6f06('0x45')]({},_0x1949e6,_0x106451[_0x6f06('0x48')]);return db[_0x6f06('0x49')][_0x6f06('0x51')](_0x1949e6)[_0x6f06('0x2d')](handleEntityNotFound(_0x1c735a,null))[_0x6f06('0x2d')](respondWithResult(_0x1c735a,null))[_0x6f06('0x4e')](handleError(_0x1c735a,null));};exports[_0x6f06('0x52')]=function(_0xc5843d,_0x1126a7){return db[_0x6f06('0x49')][_0x6f06('0x52')](_0xc5843d['body'],{})['then'](function(_0x36f0d6){var _0x1498ce=_0xc5843d['user']['get']({'plain':!![]});if(!_0x1498ce)throw new Error(_0x6f06('0x53'));if(_0x1498ce[_0x6f06('0x54')]===_0x6f06('0x55')){var _0x1a6000=_0x36f0d6[_0x6f06('0x2f')]({'plain':!![]});var _0x83d821=_0x6f06('0x30');return db['UserProfileSection'][_0x6f06('0x51')]({'where':{'name':_0x83d821,'userProfileId':_0x1498ce[_0x6f06('0x56')]},'raw':!![]})['then'](function(_0x5c7073){if(_0x5c7073&&_0x5c7073['autoAssociation']===0x0){return db[_0x6f06('0x31')]['create']({'name':_0x1a6000[_0x6f06('0x33')],'resourceId':_0x1a6000['id'],'type':_0x5c7073['name'],'sectionId':_0x5c7073['id']},{})[_0x6f06('0x2d')](function(){return _0x36f0d6;});}else{return _0x36f0d6;}})[_0x6f06('0x4e')](function(_0x43170a){logger['error'](_0x6f06('0x57'),_0x43170a);throw _0x43170a;});}return _0x36f0d6;})[_0x6f06('0x2d')](respondWithResult(_0x1126a7,0xc9))[_0x6f06('0x4e')](handleError(_0x1126a7,null));};exports['update']=function(_0x2ed2d5,_0x4c7193){if(_0x2ed2d5['body']['id']){delete _0x2ed2d5[_0x6f06('0x58')]['id'];}return db[_0x6f06('0x49')][_0x6f06('0x51')]({'where':{'id':_0x2ed2d5[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x4c7193,null))[_0x6f06('0x2d')](saveUpdates(_0x2ed2d5[_0x6f06('0x58')],null))[_0x6f06('0x2d')](respondWithResult(_0x4c7193,null))['catch'](handleError(_0x4c7193,null));};exports['destroy']=function(_0x54d7e1,_0x233653){return db['CmList'][_0x6f06('0x51')]({'where':{'id':_0x54d7e1['params']['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x233653,null))[_0x6f06('0x2d')](removeEntity(_0x233653,null))[_0x6f06('0x4e')](handleError(_0x233653,null));};exports[_0x6f06('0x59')]=function(_0x25f116,_0x302e73){return db[_0x6f06('0x49')][_0x6f06('0x59')]()[_0x6f06('0x2d')](respondWithResult(_0x302e73,null))[_0x6f06('0x4e')](handleError(_0x302e73,null));};exports[_0x6f06('0x5a')]=function(_0x159831,_0x3c6a2c,_0x4426e2){if(_0x159831['body']['id']){delete _0x159831[_0x6f06('0x58')]['id'];}return db[_0x6f06('0x49')][_0x6f06('0x51')]({'where':{'id':_0x159831[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x3c6a2c,null))[_0x6f06('0x2d')](function(_0x5080a2){if(_0x5080a2){_0x159831['body']['ListId']=_0x5080a2['id'];return db[_0x6f06('0x5b')][_0x6f06('0x52')](_0x159831[_0x6f06('0x58')]);}})[_0x6f06('0x2d')](respondWithResult(_0x3c6a2c,null))[_0x6f06('0x4e')](handleError(_0x3c6a2c,null));};exports[_0x6f06('0x5c')]=function(_0x5724e6,_0x18d66f,_0x202de1){var _0x449a67={'raw':![],'where':{}};var _0x13af35={};var _0x639e83={'count':0x0,'rows':[]};return db[_0x6f06('0x49')]['findOne']({'where':{'id':_0x5724e6[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x18d66f,null))[_0x6f06('0x2d')](function(_0x20e0b8){if(_0x20e0b8){_0x13af35['model']=_['keys'](db[_0x6f06('0x5b')][_0x6f06('0x35')]);_0x13af35[_0x6f06('0x3b')]=_[_0x6f06('0x3a')](_0x5724e6[_0x6f06('0x3b')]);_0x13af35[_0x6f06('0x42')]=_[_0x6f06('0x3c')](_0x13af35[_0x6f06('0x39')],_0x13af35[_0x6f06('0x3b')]);_0x449a67[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x13af35['model'],qs['fields'](_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x50')]));_0x449a67[_0x6f06('0x3d')]=_0x449a67[_0x6f06('0x3d')]['length']?_0x449a67[_0x6f06('0x3d')]:_0x13af35[_0x6f06('0x39')];if(!_0x5724e6['query'][_0x6f06('0x5d')](_0x6f06('0x3f'))){_0x449a67[_0x6f06('0x27')]=qs['limit'](_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x27')]);_0x449a67['offset']=qs[_0x6f06('0x25')](_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x25')]);}_0x449a67[_0x6f06('0x5e')]=qs['sort'](_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x40')]);_0x449a67[_0x6f06('0x41')]=qs[_0x6f06('0x42')](_[_0x6f06('0x43')](_0x5724e6['query'],_0x13af35[_0x6f06('0x42')]));_0x449a67['where'][_0x6f06('0x5f')]=_0x20e0b8['id'];if(_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x44')]){_0x449a67[_0x6f06('0x41')]=_[_0x6f06('0x45')](_0x449a67[_0x6f06('0x41')],{'$or':_['map'](_0x449a67[_0x6f06('0x3d')],function(_0x33f1f5){var _0x503a57={};_0x503a57[_0x33f1f5]={'$like':'%'+_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x44')]+'%'};return _0x503a57;})});}_0x449a67=_[_0x6f06('0x45')]({},_0x449a67,_0x5724e6[_0x6f06('0x48')]);return db[_0x6f06('0x5b')]['count']({'where':_0x449a67[_0x6f06('0x41')]})[_0x6f06('0x2d')](function(_0x332b0e){_0x639e83[_0x6f06('0x28')]=_0x332b0e;if(_0x5724e6[_0x6f06('0x3b')][_0x6f06('0x4a')]){_0x449a67[_0x6f06('0x4b')]=[{'all':!![]}];}return db[_0x6f06('0x5b')]['findAll'](_0x449a67);})[_0x6f06('0x2d')](function(_0x165cd5){_0x639e83[_0x6f06('0x4d')]=_0x165cd5;return _0x639e83;});}})[_0x6f06('0x2d')](respondWithFilteredResult(_0x18d66f,_0x449a67))[_0x6f06('0x4e')](handleError(_0x18d66f,null));};exports[_0x6f06('0x60')]=function(_0x3ff0f6,_0x344f0e,_0x1191c0){return db[_0x6f06('0x49')][_0x6f06('0x51')]({'where':{'id':_0x3ff0f6['params']['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x344f0e,null))[_0x6f06('0x2d')](function(_0x32a54f){if(_0x32a54f){return _0x32a54f['removeDispositions'](_0x3ff0f6[_0x6f06('0x3b')][_0x6f06('0x61')]);}})[_0x6f06('0x2d')](respondWithStatusCode(_0x344f0e,null))[_0x6f06('0x4e')](handleError(_0x344f0e,null));};exports['addContacts']=function(_0x566027,_0x14b161,_0x41a750){return db[_0x6f06('0x49')]['find']({'where':{'id':_0x566027[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x14b161,null))[_0x6f06('0x2d')](function(_0x42cbe8){if(_0x42cbe8){var _0x10bbaa=[];var _0x13fa39={'success':[],'errors':[]};return db[_0x6f06('0x62')][_0x6f06('0x59')]()['then'](function(_0x29a4ec){if(_0x566027[_0x6f06('0x58')][_0x6f06('0x63')]&&_[_0x6f06('0x64')](_0x566027['body'][_0x6f06('0x63')])){if(_0x566027[_0x6f06('0x58')][_0x6f06('0x63')][_0x6f06('0x3e')]){_0x566027[_0x6f06('0x58')]['tags']=_0x566027[_0x6f06('0x58')][_0x6f06('0x63')][_0x6f06('0x65')](';')+';';}else{_0x566027['body'][_0x6f06('0x63')]=null;}}else{_0x566027['body'][_0x6f06('0x63')]=null;}if(_0x566027[_0x6f06('0x58')]&&_[_0x6f06('0x64')](_0x566027[_0x6f06('0x58')])){for(var _0x77ba37=0x0;_0x77ba37<_0x566027[_0x6f06('0x58')]['length'];_0x77ba37+=0x1){_0x566027[_0x6f06('0x58')][_0x77ba37][_0x6f06('0x5f')]=_0x566027['params']['id'];_0x10bbaa[_0x6f06('0x66')](_0x566027[_0x6f06('0x58')][_0x77ba37]);}return BPromise[_0x6f06('0x67')](_0x10bbaa,function(_0x25c3af){return db[_0x6f06('0x62')]['create'](_[_0x6f06('0x68')](_0x25c3af,[_0x6f06('0x61'),'id'])||{},{'fields':_['keys'](_0x29a4ec),'raw':!![]})['then'](function(_0x3369c7){_0x13fa39[_0x6f06('0x69')][_0x6f06('0x66')](_0x3369c7['dataValues']);})[_0x6f06('0x4e')](function(_0x996d4e){_0x13fa39[_0x6f06('0x6a')][_0x6f06('0x66')]({'data':_0x25c3af,'error':_0x996d4e[_0x6f06('0x6b')]});});})['then'](function(_0xcef0cc){return _0x13fa39;})[_0x6f06('0x4e')](function(_0x303f7c){return _0x303f7c;});}else{_0x14b161[_0x6f06('0x22')](0x190)[_0x6f06('0x24')]({'message':_0x6f06('0x6c')});}});}})['then'](respondWithResult(_0x14b161,null))[_0x6f06('0x4e')](handleError(_0x14b161,null));};exports[_0x6f06('0x6d')]=function(_0x5179f3,_0x13e72a,_0x8d614f){var _0x900410;return db[_0x6f06('0x49')][_0x6f06('0x51')]({'where':{'id':_0x5179f3[_0x6f06('0x4f')]['id']},'include':[{'model':db[_0x6f06('0x6e')],'as':'CustomFields'}]})[_0x6f06('0x2d')](handleEntityNotFound(_0x13e72a,null))[_0x6f06('0x2d')](function(_0x599818){if(_0x599818){_0x900410=_0x599818;return db[_0x6f06('0x62')][_0x6f06('0x35')];}})['then'](function(_0x339c60){if(_0x339c60){var _0x239a4a={};var _0x1bba8d={};_0x1bba8d[_0x6f06('0x39')]=_[_0x6f06('0x6f')](_['keys'](_0x339c60),_[_0x6f06('0x46')](_0x900410[_0x6f06('0x70')],function(_0xe3ab21){return util['format'](_0x6f06('0x71'),_0xe3ab21['id']);}));_0x1bba8d[_0x6f06('0x3b')]=_[_0x6f06('0x3a')](_0x5179f3[_0x6f06('0x3b')]);_0x1bba8d[_0x6f06('0x42')]=_['intersection'](_0x1bba8d['model'],_0x1bba8d['query']);_0x239a4a[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x1bba8d[_0x6f06('0x39')],qs[_0x6f06('0x50')](_0x5179f3[_0x6f06('0x3b')]['fields']));_0x239a4a[_0x6f06('0x3d')]=_0x239a4a[_0x6f06('0x3d')][_0x6f06('0x3e')]?_0x239a4a[_0x6f06('0x3d')]:_0x1bba8d[_0x6f06('0x39')];if(!_0x5179f3[_0x6f06('0x3b')][_0x6f06('0x5d')](_0x6f06('0x3f'))){_0x239a4a[_0x6f06('0x27')]=qs['limit'](_0x5179f3[_0x6f06('0x3b')][_0x6f06('0x27')]);_0x239a4a[_0x6f06('0x25')]=qs['offset'](_0x5179f3[_0x6f06('0x3b')][_0x6f06('0x25')]);}_0x239a4a[_0x6f06('0x5e')]=qs[_0x6f06('0x40')](_0x5179f3[_0x6f06('0x3b')]['sort']);_0x239a4a['where']=qs['filters'](_['pick'](_0x5179f3[_0x6f06('0x3b')],_0x1bba8d[_0x6f06('0x42')]));_0x239a4a[_0x6f06('0x72')]=!![];if(_0x5179f3[_0x6f06('0x3b')][_0x6f06('0x44')]){_0x239a4a[_0x6f06('0x41')]=_[_0x6f06('0x45')](_0x239a4a[_0x6f06('0x41')],{'$or':_[_0x6f06('0x46')](_0x239a4a[_0x6f06('0x3d')],function(_0x202e05){var _0x3b0851={};_0x3b0851[_0x202e05]={'$like':'%'+_0x5179f3[_0x6f06('0x3b')][_0x6f06('0x44')]+'%'};return _0x3b0851;})});}_0x239a4a=_['merge']({},_0x239a4a,_0x5179f3[_0x6f06('0x48')]);return _0x900410[_0x6f06('0x6d')](_0x239a4a);}})['then'](respondWithResult(_0x13e72a,null))[_0x6f06('0x4e')](handleError(_0x13e72a,null));};exports[_0x6f06('0x73')]=function(_0x4c95f4,_0x3b5319,_0x315cb3){var _0x5a13c8;var _0x192514;var _0x3f7150;var _0x68909=_0x4c95f4[_0x6f06('0x4f')]['id'];csv_results=[];return db[_0x6f06('0x74')][_0x6f06('0x4c')]({'attributes':['id','name'],'raw':!![],'order':[_0x6f06('0x75')]})[_0x6f06('0x2d')](function(_0xa8db06){_0x5a13c8=_0xa8db06;var _0x4c44d8=_[_0x6f06('0x3a')](db['CmContact'][_0x6f06('0x35')]);return db[_0x6f06('0x6e')][_0x6f06('0x4c')]({'raw':!![],'attributes':['id',_0x6f06('0x76')]})[_0x6f06('0x2d')](function(_0x462a78){_0x192514=_0x462a78;var _0x5e1474=squel[_0x6f06('0x77')]()[_0x6f06('0x50')](_0x4c44d8)[_0x6f06('0x78')]('cm_contacts','c')[_0x6f06('0x41')](_0x6f06('0x79'),_0x68909)[_0x6f06('0x41')](_0x6f06('0x7a'))[_0x6f06('0x7b')]();for(var _0xa98456=0x0;_0xa98456<_0x192514[_0x6f06('0x3e')];_0xa98456++){_0x5e1474[_0x6f06('0x7c')]('c.cf_'+_0x192514[_0xa98456]['id'],_0x6f06('0x7d')+_0x192514[_0xa98456][_0x6f06('0x76')]);}for(var _0xa98456=0x0;_0xa98456<_0x5a13c8['length'];_0xa98456++){_0x5e1474[_0x6f06('0x7c')](squel['select']()[_0x6f06('0x7c')](_0x6f06('0x7e'))['from'](_0x6f06('0x7f'))[_0x6f06('0x41')](_0x6f06('0x80'),_0x5a13c8[_0xa98456]['id'])[_0x6f06('0x41')]('CmContactId\x20=\x20c.id'),_0x6f06('0x81')+_0x5a13c8[_0xa98456][_0x6f06('0x33')]);_0x5e1474['field'](squel[_0x6f06('0x77')]()[_0x6f06('0x7c')](_0x6f06('0x82'))[_0x6f06('0x78')](_0x6f06('0x7f'))[_0x6f06('0x41')](_0x6f06('0x80'),_0x5a13c8[_0xa98456]['id'])[_0x6f06('0x41')](_0x6f06('0x83')),'description_additionalPhone_'+_0x5a13c8[_0xa98456]['name']);}var _0xe70e9f=[];_0xe70e9f[_0x6f06('0x66')](_0x5e1474[_0x6f06('0x84')]());BPromise[_0x6f06('0x67')](_0xe70e9f,handleQuery)['then'](function(_0x3ff025){handleQuery(_0x5e1474['toString']());var _0x2e82fb=csv_results[0x0];if(!_[_0x6f06('0x85')](_0x2e82fb)){var _0x5246a4=toCsv(_0x2e82fb);var _0x27e3ba=Date[_0x6f06('0x86')]();fs[_0x6f06('0x87')](util['format'](_0x6f06('0x88'),_0x68909,_0x27e3ba),_0x5246a4);_0x3b5319[_0x6f06('0x89')](_0x6f06('0x8a'),_0x6f06('0x8b')+util[_0x6f06('0x8c')](_0x6f06('0x8d'),_0x68909,_0x27e3ba));_0x3b5319[_0x6f06('0x89')](_0x6f06('0x8e'),_0x6f06('0x8f'));return _0x3b5319['download'](util['format'](_0x6f06('0x88'),_0x68909,_0x27e3ba));}else{return _0x3b5319[_0x6f06('0x21')](0xcc);}});});});};exports[_0x6f06('0x90')]=function(_0x456794,_0x490c2c,_0x291ffb){var _0x575267;delete _0x456794['body']['id'];return db[_0x6f06('0x49')][_0x6f06('0x91')]({'where':{'id':_0x456794[_0x6f06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x490c2c,null))[_0x6f06('0x2d')](function(_0x4aa001){if(_0x4aa001){return db[_0x6f06('0x92')][_0x6f06('0x93')](function(_0x134e65){return db['CmCustomField'][_0x6f06('0x52')](_0x456794[_0x6f06('0x58')],{'transaction':_0x134e65})[_0x6f06('0x2d')](function(_0x418059){_0x575267=_0x418059;return _0x4aa001[_0x6f06('0x94')](_0x418059,{'transaction':_0x134e65});})[_0x6f06('0x2d')](function(){var _0x45b729={'type':db[_0x6f06('0x95')][_0x6f06('0x96')],'transaction':_0x134e65};switch(_0x456794[_0x6f06('0x58')][_0x6f06('0x37')]){case _0x6f06('0x97'):_0x45b729[_0x6f06('0x37')]=db[_0x6f06('0x95')]['TEXT'];break;case'number':_0x45b729['type']=db[_0x6f06('0x95')]['INTEGER'];break;case _0x6f06('0x98'):_0x45b729['type']=db[_0x6f06('0x95')]['BOOLEAN'];_0x45b729['defaultValue']=![];break;default:}return db[_0x6f06('0x92')][_0x6f06('0x99')][_0x6f06('0x9a')](_0x6f06('0x9b'),util['format'](_0x6f06('0x9c'),_0x575267['id']),_0x45b729);})[_0x6f06('0x2d')](function(){return _0x575267;});});}})[_0x6f06('0x2d')](respondWithResult(_0x490c2c,null))[_0x6f06('0x4e')](handleError(_0x490c2c,null));};exports[_0x6f06('0x9d')]=function(_0x5f246b,_0x1d4bb2,_0x3af8b0){var _0x3d02f5={};var _0x18c680={};var _0x1b9ac3;var _0x536866;return db[_0x6f06('0x49')]['findOne']({'where':{'id':_0x5f246b[_0x6f06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d4bb2,null))[_0x6f06('0x2d')](function(_0x1c330f){if(_0x1c330f){_0x1b9ac3=_0x1c330f;_0x18c680[_0x6f06('0x39')]=_[_0x6f06('0x3a')](db['CmCustomField'][_0x6f06('0x35')]);_0x18c680[_0x6f06('0x3b')]=_[_0x6f06('0x3a')](_0x5f246b[_0x6f06('0x3b')]);_0x18c680[_0x6f06('0x42')]=_[_0x6f06('0x3c')](_0x18c680['model'],_0x18c680[_0x6f06('0x3b')]);_0x3d02f5[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x18c680[_0x6f06('0x39')],qs[_0x6f06('0x50')](_0x5f246b['query']['fields']));_0x3d02f5[_0x6f06('0x3d')]=_0x3d02f5[_0x6f06('0x3d')][_0x6f06('0x3e')]?_0x3d02f5[_0x6f06('0x3d')]:_0x18c680['model'];_0x3d02f5[_0x6f06('0x5e')]=qs[_0x6f06('0x40')](_0x5f246b[_0x6f06('0x3b')][_0x6f06('0x40')]);_0x3d02f5[_0x6f06('0x41')]=qs['filters'](_['pick'](_0x5f246b[_0x6f06('0x3b')],_0x18c680['filters']));_0x3d02f5['where']=_['merge'](_0x3d02f5[_0x6f06('0x41')],{'$or':[{'ListId':_0x1c330f['id']},{'ListId':null}]});if(_0x5f246b[_0x6f06('0x3b')][_0x6f06('0x44')]){_0x3d02f5[_0x6f06('0x41')]=_[_0x6f06('0x45')](_0x3d02f5[_0x6f06('0x41')],{'$or':_['map'](_0x3d02f5[_0x6f06('0x3d')],function(_0x1af313){var _0x9d389c={};_0x9d389c[_0x1af313]={'$like':'%'+_0x5f246b['query'][_0x6f06('0x44')]+'%'};return _0x9d389c;})});}_0x3d02f5=_['merge']({},_0x3d02f5,_0x5f246b[_0x6f06('0x48')]);return db[_0x6f06('0x6e')][_0x6f06('0x9e')](_0x3d02f5);}})['then'](respondWithResult(_0x1d4bb2,null))[_0x6f06('0x4e')](handleError(_0x1d4bb2,null));};exports[_0x6f06('0x9f')]=function(_0x312221,_0x2a1984){return db[_0x6f06('0x6e')][_0x6f06('0x9e')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x2a1984,null))[_0x6f06('0x2d')](function(_0x476346){return _0x476346;})['then'](respondWithResult(_0x2a1984,null))['catch'](handleError(_0x2a1984,null));};exports['addAgents']=function(_0xf0b554,_0x182e34,_0x578797){return db[_0x6f06('0x49')]['find']({'where':{'id':_0xf0b554[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x182e34,null))[_0x6f06('0x2d')](function(_0x61731a){if(_0x61731a){return _0x61731a[_0x6f06('0xa0')](_0xf0b554[_0x6f06('0x58')][_0x6f06('0x61')],_[_0x6f06('0x68')](_0xf0b554['body'],['ids','id'])||{})[_0x6f06('0xa1')](function(_0x26435c){for(var _0x20ad79=0x0;_0x20ad79<_0xf0b554[_0x6f06('0x58')][_0x6f06('0x61')][_0x6f06('0x3e')];_0x20ad79+=0x1){socket[_0x6f06('0xa2')](_0x6f06('0xa3'),{'UserId':Number(_0xf0b554[_0x6f06('0x58')][_0x6f06('0x61')][_0x20ad79]),'CmListId':Number(_0xf0b554['params']['id'])});}return _0x26435c;});}})[_0x6f06('0x2d')](respondWithResult(_0x182e34,null))['catch'](handleError(_0x182e34,null));};exports[_0x6f06('0xa4')]=function(_0x31c157,_0x4e2380,_0x463632){return db[_0x6f06('0x49')][_0x6f06('0x51')]({'where':{'id':_0x31c157[_0x6f06('0x4f')]['id']}})[_0x6f06('0x2d')](handleEntityNotFound(_0x4e2380,null))[_0x6f06('0x2d')](function(_0x434268){if(_0x434268){return _0x434268[_0x6f06('0xa4')](_0x31c157[_0x6f06('0x3b')][_0x6f06('0x61')])[_0x6f06('0x2d')](function(){if(_[_0x6f06('0x64')](_0x31c157['query'][_0x6f06('0x61')])){for(var _0x112966=0x0;_0x112966<_0x31c157[_0x6f06('0x3b')][_0x6f06('0x61')][_0x6f06('0x3e')];_0x112966+=0x1){socket[_0x6f06('0xa2')](_0x6f06('0xa5'),{'UserId':Number(_0x31c157[_0x6f06('0x3b')][_0x6f06('0x61')][_0x112966]),'CmListId':Number(_0x31c157[_0x6f06('0x4f')]['id'])});}}else{socket['emit'](_0x6f06('0xa5'),{'UserId':Number(_0x31c157['query'][_0x6f06('0x61')]),'CmListId':Number(_0x31c157['params']['id'])});}});}})[_0x6f06('0x2d')](respondWithStatusCode(_0x4e2380,null))[_0x6f06('0x4e')](handleError(_0x4e2380,null));};exports[_0x6f06('0xa6')]=function(_0x25b996,_0x2395b9,_0x1c56ad){var _0x30d62f={};var _0x39c396={};var _0x3b3a12;var _0x45ead6;return db['CmList'][_0x6f06('0x91')]({'where':{'id':_0x25b996[_0x6f06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2395b9,null))['then'](function(_0x513bf4){if(_0x513bf4){_0x3b3a12=_0x513bf4;_0x39c396['model']=_[_0x6f06('0x3a')](db[_0x6f06('0xa7')]['rawAttributes']);_0x39c396[_0x6f06('0x3b')]=_[_0x6f06('0x3a')](_0x25b996['query']);_0x39c396[_0x6f06('0x42')]=_[_0x6f06('0x3c')](_0x39c396[_0x6f06('0x39')],_0x39c396['query']);_0x30d62f[_0x6f06('0x3d')]=_[_0x6f06('0x3c')](_0x39c396[_0x6f06('0x39')],qs[_0x6f06('0x50')](_0x25b996[_0x6f06('0x3b')]['fields']));_0x30d62f[_0x6f06('0x3d')]=_0x30d62f[_0x6f06('0x3d')][_0x6f06('0x3e')]?_0x30d62f[_0x6f06('0x3d')]:_0x39c396[_0x6f06('0x39')];_0x30d62f[_0x6f06('0x5e')]=qs[_0x6f06('0x40')](_0x25b996[_0x6f06('0x3b')][_0x6f06('0x40')]);_0x30d62f[_0x6f06('0x41')]=qs[_0x6f06('0x42')](_['pick'](_0x25b996[_0x6f06('0x3b')],_0x39c396['filters']));if(_0x25b996[_0x6f06('0x3b')]['filter']){_0x30d62f[_0x6f06('0x41')]=_['merge'](_0x30d62f['where'],{'$or':_[_0x6f06('0x46')](_0x30d62f[_0x6f06('0x3d')],function(_0x4230d3){var _0x7956bf={};_0x7956bf[_0x4230d3]={'$like':'%'+_0x25b996[_0x6f06('0x3b')][_0x6f06('0x44')]+'%'};return _0x7956bf;})});}_0x30d62f=_[_0x6f06('0x45')]({},_0x30d62f,_0x25b996[_0x6f06('0x48')]);return _0x3b3a12[_0x6f06('0xa6')](_0x30d62f);}})['then'](function(_0x180e0f){if(_0x180e0f){_0x45ead6=_0x180e0f[_0x6f06('0x3e')];if(!_0x25b996[_0x6f06('0x3b')][_0x6f06('0x5d')](_0x6f06('0x3f'))){_0x30d62f[_0x6f06('0x27')]=qs[_0x6f06('0x27')](_0x25b996[_0x6f06('0x3b')][_0x6f06('0x27')]);_0x30d62f[_0x6f06('0x25')]=qs[_0x6f06('0x25')](_0x25b996['query']['offset']);}return _0x3b3a12['getAgents'](_0x30d62f);}})['then'](function(_0x11e4a7){if(_0x11e4a7){return _0x11e4a7?{'count':_0x45ead6,'rows':_0x11e4a7}:null;}})[_0x6f06('0x2d')](respondWithResult(_0x2395b9,null))[_0x6f06('0x4e')](handleError(_0x2395b9,null));};function handleQuery(_0x430f71){logger['info'](_0x430f71);return db[_0x6f06('0x92')][_0x6f06('0x3b')](_0x430f71)[_0x6f06('0xa1')](function(_0x10b92c){csv_results[_0x6f06('0x66')](_0x10b92c);})[_0x6f06('0x4e')](function(_0x10febf){logger[_0x6f06('0xa8')](_0x10febf[_0x6f06('0x6b')]);});} \ No newline at end of file +var _0x4e96=['mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','CmList','rawAttributes','key','model','map','query','keys','intersection','attributes','hasOwnProperty','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','filters','fields','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ListId','Disposition','nolimit','order','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','message','Malformed\x20request\x20syntax','format','cf_%d','raw','getContacts','CmCustomField','alias','select','from','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x5189ca,_0x40d55f){var _0x5a8918=function(_0x17589){while(--_0x17589){_0x5189ca['push'](_0x5189ca['shift']());}};_0x5a8918(++_0x40d55f);}(_0x4e96,0x13d));var _0x64e9=function(_0x22bff1,_0x1d964a){_0x22bff1=_0x22bff1-0x0;var _0x279396=_0x4e96[_0x22bff1];return _0x279396;};'use strict';var emlformat=require(_0x64e9('0x0'));var rimraf=require(_0x64e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64e9('0x2'));var rp=require(_0x64e9('0x3'));var moment=require(_0x64e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x64e9('0x5'));var util=require(_0x64e9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x64e9('0x7'));var ejs=require(_0x64e9('0x8'));var fs=require('fs');var fs_extra=require(_0x64e9('0x9'));var _=require(_0x64e9('0xa'));var squel=require(_0x64e9('0xb'));var crypto=require(_0x64e9('0xc'));var jsforce=require(_0x64e9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x64e9('0x7'));var querystring=require(_0x64e9('0xe'));var Papa=require(_0x64e9('0xf'));var Redis=require('ioredis');var authService=require(_0x64e9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x64e9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64e9('0x12'))(_0x64e9('0x13'));var utils=require(_0x64e9('0x14'));var config=require(_0x64e9('0x15'));var licenseUtil=require(_0x64e9('0x16'));var db=require(_0x64e9('0x17'))['db'];var csv_results;config[_0x64e9('0x18')]=_[_0x64e9('0x19')](config[_0x64e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x64e9('0x1a'))(new Redis(config[_0x64e9('0x18')]));require(_0x64e9('0x1b'))[_0x64e9('0x1c')](socket);function respondWithStatusCode(_0x3a9dec,_0x16d281){_0x16d281=_0x16d281||0xcc;return function(_0x520772){if(_0x520772){return _0x3a9dec[_0x64e9('0x1d')](_0x16d281);}return _0x3a9dec[_0x64e9('0x1e')](_0x16d281)[_0x64e9('0x1f')]();};}function respondWithResult(_0x437f4d,_0x5e4dc5){_0x5e4dc5=_0x5e4dc5||0xc8;return function(_0x2b2581){if(_0x2b2581){return _0x437f4d[_0x64e9('0x1e')](_0x5e4dc5)[_0x64e9('0x20')](_0x2b2581);}};}function respondWithFilteredResult(_0x473626,_0x2675a3){return function(_0x273fb8){if(_0x273fb8){var _0x127f8f=typeof _0x2675a3[_0x64e9('0x21')]===_0x64e9('0x22')&&typeof _0x2675a3['limit']===_0x64e9('0x22');var _0x18e421=_0x273fb8[_0x64e9('0x23')];var _0x1c1da9=_0x127f8f?0x0:_0x2675a3[_0x64e9('0x21')];var _0x4d6497=_0x127f8f?_0x273fb8[_0x64e9('0x23')]:_0x2675a3[_0x64e9('0x21')]+_0x2675a3[_0x64e9('0x24')];var _0xde378d;if(_0x4d6497>=_0x18e421){_0x4d6497=_0x18e421;_0xde378d=0xc8;}else{_0xde378d=0xce;}_0x473626[_0x64e9('0x1e')](_0xde378d);return _0x473626[_0x64e9('0x25')](_0x64e9('0x26'),_0x1c1da9+'-'+_0x4d6497+'/'+_0x18e421)[_0x64e9('0x20')](_0x273fb8);}return null;};}function patchUpdates(_0x2978db){return function(_0x294525){try{jsonpatch[_0x64e9('0x27')](_0x294525,_0x2978db,!![]);}catch(_0x231c33){return BPromise[_0x64e9('0x28')](_0x231c33);}return _0x294525['save']();};}function saveUpdates(_0x21f90c,_0x3095fe){return function(_0x3aa10a){if(_0x3aa10a){return _0x3aa10a[_0x64e9('0x29')](_0x21f90c)[_0x64e9('0x2a')](function(_0x28509e){return _0x28509e;});}return null;};}function removeEntity(_0x199ac3,_0x388f1a){return function(_0x2f8d49){if(_0x2f8d49){return _0x2f8d49[_0x64e9('0x2b')]()[_0x64e9('0x2a')](function(){var _0x547136=_0x2f8d49[_0x64e9('0x2c')]({'plain':!![]});var _0x456c13='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x456c13,'resourceId':_0x547136['id']}})[_0x64e9('0x2a')](function(){return _0x2f8d49;});})[_0x64e9('0x2a')](function(){_0x199ac3['status'](0xcc)[_0x64e9('0x1f')]();});}};}function handleEntityNotFound(_0x1b1e99,_0x3fec13){return function(_0x32a899){if(!_0x32a899){_0x1b1e99[_0x64e9('0x1d')](0x194);}return _0x32a899;};}function handleError(_0x191019,_0x46ca16){_0x46ca16=_0x46ca16||0x1f4;return function(_0x44538b){logger[_0x64e9('0x2d')](_0x44538b[_0x64e9('0x2e')]);if(_0x44538b[_0x64e9('0x2f')]){delete _0x44538b[_0x64e9('0x2f')];}_0x191019[_0x64e9('0x1e')](_0x46ca16)['send'](_0x44538b);};}exports['index']=function(_0x4be3e3,_0x4d081b){var _0x3f0c21={},_0x4bdbe8={},_0x433621={'count':0x0,'rows':[]};var _0x3a19c5=_['map'](db[_0x64e9('0x30')][_0x64e9('0x31')],function(_0x4fd996){return{'name':_0x4fd996['fieldName'],'type':_0x4fd996['type'][_0x64e9('0x32')]};});_0x4bdbe8[_0x64e9('0x33')]=_[_0x64e9('0x34')](_0x3a19c5,'name');_0x4bdbe8[_0x64e9('0x35')]=_[_0x64e9('0x36')](_0x4be3e3['query']);_0x4bdbe8['filters']=_[_0x64e9('0x37')](_0x4bdbe8['model'],_0x4bdbe8[_0x64e9('0x35')]);_0x3f0c21[_0x64e9('0x38')]=_['intersection'](_0x4bdbe8['model'],qs['fields'](_0x4be3e3['query']['fields']));_0x3f0c21[_0x64e9('0x38')]=_0x3f0c21[_0x64e9('0x38')]['length']?_0x3f0c21[_0x64e9('0x38')]:_0x4bdbe8['model'];if(!_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x39')]('nolimit')){_0x3f0c21[_0x64e9('0x24')]=qs['limit'](_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x24')]);_0x3f0c21['offset']=qs['offset'](_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x21')]);}_0x3f0c21['order']=qs[_0x64e9('0x3a')](_0x4be3e3[_0x64e9('0x35')]['sort']);_0x3f0c21[_0x64e9('0x3b')]=qs['filters'](_[_0x64e9('0x3c')](_0x4be3e3[_0x64e9('0x35')],_0x4bdbe8['filters']),_0x3a19c5);if(_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x3d')]){_0x3f0c21[_0x64e9('0x3b')]=_['merge'](_0x3f0c21['where'],{'$or':_[_0x64e9('0x34')](_0x3a19c5,function(_0x2dad83){if(_0x2dad83[_0x64e9('0x3e')]!=='VIRTUAL'){var _0x3bee8f={};_0x3bee8f[_0x2dad83['name']]={'$like':'%'+_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x3d')]+'%'};return _0x3bee8f;}})});}_0x3f0c21=_[_0x64e9('0x3f')]({},_0x3f0c21,_0x4be3e3[_0x64e9('0x40')]);var _0x52445f={'where':_0x3f0c21[_0x64e9('0x3b')]};return db[_0x64e9('0x30')][_0x64e9('0x23')](_0x52445f)['then'](function(_0x517a7f){_0x433621[_0x64e9('0x23')]=_0x517a7f;if(_0x4be3e3[_0x64e9('0x35')][_0x64e9('0x41')]){_0x3f0c21[_0x64e9('0x42')]=[{'all':!![]}];}return db['CmList'][_0x64e9('0x43')](_0x3f0c21);})[_0x64e9('0x2a')](function(_0x5d5fec){_0x433621[_0x64e9('0x44')]=_0x5d5fec;return _0x433621;})[_0x64e9('0x2a')](respondWithFilteredResult(_0x4d081b,_0x3f0c21))[_0x64e9('0x45')](handleError(_0x4d081b,null));};exports['show']=function(_0x51daf5,_0x3f8237){var _0xd67164={'raw':![],'where':{'id':_0x51daf5['params']['id']}},_0x4dc0df={};_0x4dc0df[_0x64e9('0x33')]=_[_0x64e9('0x36')](db[_0x64e9('0x30')]['rawAttributes']);_0x4dc0df['query']=_['keys'](_0x51daf5[_0x64e9('0x35')]);_0x4dc0df[_0x64e9('0x46')]=_['intersection'](_0x4dc0df[_0x64e9('0x33')],_0x4dc0df['query']);_0xd67164[_0x64e9('0x38')]=_[_0x64e9('0x37')](_0x4dc0df[_0x64e9('0x33')],qs[_0x64e9('0x47')](_0x51daf5[_0x64e9('0x35')][_0x64e9('0x47')]));_0xd67164[_0x64e9('0x38')]=_0xd67164['attributes'][_0x64e9('0x48')]?_0xd67164[_0x64e9('0x38')]:_0x4dc0df[_0x64e9('0x33')];if(_0x51daf5['query'][_0x64e9('0x41')]){_0xd67164['include']=[{'all':!![]}];}_0xd67164=_[_0x64e9('0x3f')]({},_0xd67164,_0x51daf5[_0x64e9('0x40')]);return db[_0x64e9('0x30')][_0x64e9('0x49')](_0xd67164)['then'](handleEntityNotFound(_0x3f8237,null))['then'](respondWithResult(_0x3f8237,null))[_0x64e9('0x45')](handleError(_0x3f8237,null));};exports['create']=function(_0x29c786,_0x4efe2e){return db[_0x64e9('0x30')][_0x64e9('0x4a')](_0x29c786['body'],{})[_0x64e9('0x2a')](function(_0x73b070){var _0x5e2edd=_0x29c786[_0x64e9('0x4b')]['get']({'plain':!![]});if(!_0x5e2edd)throw new Error(_0x64e9('0x4c'));if(_0x5e2edd[_0x64e9('0x4d')]===_0x64e9('0x4b')){var _0x1791a1=_0x73b070[_0x64e9('0x2c')]({'plain':!![]});var _0x14434a=_0x64e9('0x4e');return db[_0x64e9('0x4f')]['find']({'where':{'name':_0x14434a,'userProfileId':_0x5e2edd[_0x64e9('0x50')]},'raw':!![]})[_0x64e9('0x2a')](function(_0x15a0b2){if(_0x15a0b2&&_0x15a0b2['autoAssociation']===0x0){return db[_0x64e9('0x51')][_0x64e9('0x4a')]({'name':_0x1791a1[_0x64e9('0x2f')],'resourceId':_0x1791a1['id'],'type':_0x15a0b2[_0x64e9('0x2f')],'sectionId':_0x15a0b2['id']},{})[_0x64e9('0x2a')](function(){return _0x73b070;});}else{return _0x73b070;}})['catch'](function(_0x544fe3){logger[_0x64e9('0x2d')](_0x64e9('0x52'),_0x544fe3);throw _0x544fe3;});}return _0x73b070;})[_0x64e9('0x2a')](respondWithResult(_0x4efe2e,0xc9))['catch'](handleError(_0x4efe2e,null));};exports[_0x64e9('0x29')]=function(_0x3356ac,_0x311218){if(_0x3356ac['body']['id']){delete _0x3356ac[_0x64e9('0x53')]['id'];}return db[_0x64e9('0x30')][_0x64e9('0x49')]({'where':{'id':_0x3356ac[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x311218,null))[_0x64e9('0x2a')](saveUpdates(_0x3356ac['body'],null))[_0x64e9('0x2a')](respondWithResult(_0x311218,null))[_0x64e9('0x45')](handleError(_0x311218,null));};exports[_0x64e9('0x2b')]=function(_0x14135b,_0x581459){return db['CmList']['find']({'where':{'id':_0x14135b[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x581459,null))[_0x64e9('0x2a')](removeEntity(_0x581459,null))[_0x64e9('0x45')](handleError(_0x581459,null));};exports[_0x64e9('0x55')]=function(_0xebe6dc,_0x1f04cc){return db['CmList'][_0x64e9('0x55')]()[_0x64e9('0x2a')](respondWithResult(_0x1f04cc,null))[_0x64e9('0x45')](handleError(_0x1f04cc,null));};exports[_0x64e9('0x56')]=function(_0x4495ba,_0x2e2314,_0xfa7f2d){if(_0x4495ba[_0x64e9('0x53')]['id']){delete _0x4495ba['body']['id'];}return db[_0x64e9('0x30')][_0x64e9('0x49')]({'where':{'id':_0x4495ba[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x2e2314,null))['then'](function(_0x36e7eb){if(_0x36e7eb){_0x4495ba[_0x64e9('0x53')][_0x64e9('0x57')]=_0x36e7eb['id'];return db[_0x64e9('0x58')][_0x64e9('0x4a')](_0x4495ba[_0x64e9('0x53')]);}})[_0x64e9('0x2a')](respondWithResult(_0x2e2314,null))[_0x64e9('0x45')](handleError(_0x2e2314,null));};exports['getDispositions']=function(_0x59fe04,_0xa6a4fd,_0x2e290f){var _0x5abc19={'raw':![],'where':{}};var _0x5c64b8={};var _0x488c0a={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x59fe04[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0xa6a4fd,null))[_0x64e9('0x2a')](function(_0x507945){if(_0x507945){_0x5c64b8[_0x64e9('0x33')]=_['keys'](db[_0x64e9('0x58')][_0x64e9('0x31')]);_0x5c64b8[_0x64e9('0x35')]=_[_0x64e9('0x36')](_0x59fe04[_0x64e9('0x35')]);_0x5c64b8[_0x64e9('0x46')]=_[_0x64e9('0x37')](_0x5c64b8[_0x64e9('0x33')],_0x5c64b8[_0x64e9('0x35')]);_0x5abc19['attributes']=_[_0x64e9('0x37')](_0x5c64b8['model'],qs[_0x64e9('0x47')](_0x59fe04[_0x64e9('0x35')][_0x64e9('0x47')]));_0x5abc19[_0x64e9('0x38')]=_0x5abc19[_0x64e9('0x38')][_0x64e9('0x48')]?_0x5abc19[_0x64e9('0x38')]:_0x5c64b8[_0x64e9('0x33')];if(!_0x59fe04[_0x64e9('0x35')][_0x64e9('0x39')](_0x64e9('0x59'))){_0x5abc19['limit']=qs[_0x64e9('0x24')](_0x59fe04[_0x64e9('0x35')][_0x64e9('0x24')]);_0x5abc19[_0x64e9('0x21')]=qs[_0x64e9('0x21')](_0x59fe04[_0x64e9('0x35')]['offset']);}_0x5abc19[_0x64e9('0x5a')]=qs[_0x64e9('0x3a')](_0x59fe04[_0x64e9('0x35')][_0x64e9('0x3a')]);_0x5abc19[_0x64e9('0x3b')]=qs[_0x64e9('0x46')](_[_0x64e9('0x3c')](_0x59fe04['query'],_0x5c64b8['filters']));_0x5abc19[_0x64e9('0x3b')][_0x64e9('0x57')]=_0x507945['id'];if(_0x59fe04[_0x64e9('0x35')]['filter']){_0x5abc19[_0x64e9('0x3b')]=_[_0x64e9('0x3f')](_0x5abc19[_0x64e9('0x3b')],{'$or':_[_0x64e9('0x34')](_0x5abc19[_0x64e9('0x38')],function(_0x4a2e42){var _0x75053d={};_0x75053d[_0x4a2e42]={'$like':'%'+_0x59fe04[_0x64e9('0x35')][_0x64e9('0x3d')]+'%'};return _0x75053d;})});}_0x5abc19=_[_0x64e9('0x3f')]({},_0x5abc19,_0x59fe04['options']);return db[_0x64e9('0x58')]['count']({'where':_0x5abc19[_0x64e9('0x3b')]})['then'](function(_0x3c23f8){_0x488c0a['count']=_0x3c23f8;if(_0x59fe04[_0x64e9('0x35')][_0x64e9('0x41')]){_0x5abc19[_0x64e9('0x42')]=[{'all':!![]}];}return db[_0x64e9('0x58')]['findAll'](_0x5abc19);})[_0x64e9('0x2a')](function(_0x1d545a){_0x488c0a[_0x64e9('0x44')]=_0x1d545a;return _0x488c0a;});}})[_0x64e9('0x2a')](respondWithFilteredResult(_0xa6a4fd,_0x5abc19))['catch'](handleError(_0xa6a4fd,null));};exports[_0x64e9('0x5b')]=function(_0x2efae1,_0x3727bf,_0xafc70f){return db['CmList'][_0x64e9('0x49')]({'where':{'id':_0x2efae1[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x3727bf,null))[_0x64e9('0x2a')](function(_0x5534dd){if(_0x5534dd){return _0x5534dd['removeDispositions'](_0x2efae1['query'][_0x64e9('0x5c')]);}})[_0x64e9('0x2a')](respondWithStatusCode(_0x3727bf,null))['catch'](handleError(_0x3727bf,null));};exports['addContacts']=function(_0x5bdc78,_0xaab61b,_0x5720bc){return db[_0x64e9('0x30')][_0x64e9('0x49')]({'where':{'id':_0x5bdc78[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0xaab61b,null))['then'](function(_0x4b8f25){if(_0x4b8f25){var _0x3ebf6a=[];var _0x5b32af={'success':[],'errors':[]};return db[_0x64e9('0x5d')]['describe']()['then'](function(_0x31fae3){if(_0x5bdc78[_0x64e9('0x53')][_0x64e9('0x5e')]&&_[_0x64e9('0x5f')](_0x5bdc78['body'][_0x64e9('0x5e')])){if(_0x5bdc78['body'][_0x64e9('0x5e')][_0x64e9('0x48')]){_0x5bdc78[_0x64e9('0x53')]['tags']=_0x5bdc78[_0x64e9('0x53')]['tags'][_0x64e9('0x60')](';')+';';}else{_0x5bdc78[_0x64e9('0x53')][_0x64e9('0x5e')]=null;}}else{_0x5bdc78['body']['tags']=null;}if(_0x5bdc78[_0x64e9('0x53')]&&_[_0x64e9('0x5f')](_0x5bdc78[_0x64e9('0x53')])){for(var _0x5d6b78=0x0;_0x5d6b78<_0x5bdc78['body']['length'];_0x5d6b78+=0x1){_0x5bdc78[_0x64e9('0x53')][_0x5d6b78]['ListId']=_0x5bdc78[_0x64e9('0x54')]['id'];_0x3ebf6a[_0x64e9('0x61')](_0x5bdc78[_0x64e9('0x53')][_0x5d6b78]);}return BPromise[_0x64e9('0x62')](_0x3ebf6a,function(_0x18445a){return db[_0x64e9('0x5d')]['create'](_[_0x64e9('0x63')](_0x18445a,[_0x64e9('0x5c'),'id'])||{},{'fields':_[_0x64e9('0x36')](_0x31fae3),'raw':!![]})[_0x64e9('0x2a')](function(_0x319379){_0x5b32af[_0x64e9('0x64')][_0x64e9('0x61')](_0x319379[_0x64e9('0x65')]);})[_0x64e9('0x45')](function(_0x15a813){_0x5b32af['errors'][_0x64e9('0x61')]({'data':_0x18445a,'error':_0x15a813[_0x64e9('0x66')]});});})[_0x64e9('0x2a')](function(_0x2f6156){return _0x5b32af;})[_0x64e9('0x45')](function(_0x180b6b){return _0x180b6b;});}else{_0xaab61b[_0x64e9('0x1e')](0x190)[_0x64e9('0x20')]({'message':_0x64e9('0x67')});}});}})[_0x64e9('0x2a')](respondWithResult(_0xaab61b,null))[_0x64e9('0x45')](handleError(_0xaab61b,null));};exports['getContacts']=function(_0x2bc549,_0x203f89,_0x46044b){var _0x1e03ea;return db[_0x64e9('0x30')][_0x64e9('0x49')]({'where':{'id':_0x2bc549['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x64e9('0x2a')](handleEntityNotFound(_0x203f89,null))['then'](function(_0x72475b){if(_0x72475b){_0x1e03ea=_0x72475b;return db['CmContact'][_0x64e9('0x31')];}})[_0x64e9('0x2a')](function(_0x46171b){if(_0x46171b){var _0xda795d={};var _0x36afe0={};_0x36afe0[_0x64e9('0x33')]=_['concat'](_['keys'](_0x46171b),_[_0x64e9('0x34')](_0x1e03ea['CustomFields'],function(_0x581b73){return util[_0x64e9('0x68')](_0x64e9('0x69'),_0x581b73['id']);}));_0x36afe0[_0x64e9('0x35')]=_[_0x64e9('0x36')](_0x2bc549[_0x64e9('0x35')]);_0x36afe0[_0x64e9('0x46')]=_[_0x64e9('0x37')](_0x36afe0[_0x64e9('0x33')],_0x36afe0['query']);_0xda795d[_0x64e9('0x38')]=_['intersection'](_0x36afe0[_0x64e9('0x33')],qs['fields'](_0x2bc549['query']['fields']));_0xda795d[_0x64e9('0x38')]=_0xda795d[_0x64e9('0x38')][_0x64e9('0x48')]?_0xda795d[_0x64e9('0x38')]:_0x36afe0[_0x64e9('0x33')];if(!_0x2bc549[_0x64e9('0x35')][_0x64e9('0x39')](_0x64e9('0x59'))){_0xda795d['limit']=qs[_0x64e9('0x24')](_0x2bc549[_0x64e9('0x35')]['limit']);_0xda795d[_0x64e9('0x21')]=qs[_0x64e9('0x21')](_0x2bc549['query'][_0x64e9('0x21')]);}_0xda795d[_0x64e9('0x5a')]=qs['sort'](_0x2bc549[_0x64e9('0x35')][_0x64e9('0x3a')]);_0xda795d[_0x64e9('0x3b')]=qs[_0x64e9('0x46')](_[_0x64e9('0x3c')](_0x2bc549[_0x64e9('0x35')],_0x36afe0[_0x64e9('0x46')]));_0xda795d[_0x64e9('0x6a')]=!![];if(_0x2bc549[_0x64e9('0x35')][_0x64e9('0x3d')]){_0xda795d[_0x64e9('0x3b')]=_['merge'](_0xda795d[_0x64e9('0x3b')],{'$or':_[_0x64e9('0x34')](_0xda795d[_0x64e9('0x38')],function(_0x3a1d26){var _0x3cd028={};_0x3cd028[_0x3a1d26]={'$like':'%'+_0x2bc549['query'][_0x64e9('0x3d')]+'%'};return _0x3cd028;})});}_0xda795d=_[_0x64e9('0x3f')]({},_0xda795d,_0x2bc549['options']);return _0x1e03ea[_0x64e9('0x6b')](_0xda795d);}})['then'](respondWithResult(_0x203f89,null))[_0x64e9('0x45')](handleError(_0x203f89,null));};exports['getContactsCsv']=function(_0x3aac6e,_0x4377f5,_0xf41a15){var _0x384f5c;var _0x49c132;var _0x1f8a97;var _0x392f4c=_0x3aac6e['params']['id'];csv_results=[];return db['ContactItemType'][_0x64e9('0x43')]({'attributes':['id',_0x64e9('0x2f')],'raw':!![],'order':['OrderBy']})['then'](function(_0x3dc441){_0x384f5c=_0x3dc441;var _0x3fb4d8=_[_0x64e9('0x36')](db[_0x64e9('0x5d')][_0x64e9('0x31')]);return db[_0x64e9('0x6c')][_0x64e9('0x43')]({'raw':!![],'attributes':['id',_0x64e9('0x6d')]})[_0x64e9('0x2a')](function(_0x2fca9b){_0x49c132=_0x2fca9b;var _0x3bc72a=squel[_0x64e9('0x6e')]()[_0x64e9('0x47')](_0x3fb4d8)[_0x64e9('0x6f')]('cm_contacts','c')[_0x64e9('0x3b')](_0x64e9('0x70'),_0x392f4c)['where']('c.deletedAt\x20is\x20null')[_0x64e9('0x71')]();for(var _0x1daff0=0x0;_0x1daff0<_0x49c132[_0x64e9('0x48')];_0x1daff0++){_0x3bc72a[_0x64e9('0x72')](_0x64e9('0x73')+_0x49c132[_0x1daff0]['id'],_0x64e9('0x74')+_0x49c132[_0x1daff0]['alias']);}for(var _0x1daff0=0x0;_0x1daff0<_0x384f5c[_0x64e9('0x48')];_0x1daff0++){_0x3bc72a['field'](squel[_0x64e9('0x6e')]()[_0x64e9('0x72')](_0x64e9('0x75'))[_0x64e9('0x6f')](_0x64e9('0x76'))[_0x64e9('0x3b')]('ItemTypeId\x20=\x20?',_0x384f5c[_0x1daff0]['id'])[_0x64e9('0x3b')](_0x64e9('0x77')),_0x64e9('0x78')+_0x384f5c[_0x1daff0][_0x64e9('0x2f')]);_0x3bc72a[_0x64e9('0x72')](squel['select']()[_0x64e9('0x72')](_0x64e9('0x79'))[_0x64e9('0x6f')](_0x64e9('0x76'))['where'](_0x64e9('0x7a'),_0x384f5c[_0x1daff0]['id'])['where']('CmContactId\x20=\x20c.id'),_0x64e9('0x7b')+_0x384f5c[_0x1daff0][_0x64e9('0x2f')]);}var _0x2a64fb=[];_0x2a64fb['push'](_0x3bc72a['toString']());BPromise[_0x64e9('0x62')](_0x2a64fb,handleQuery)[_0x64e9('0x2a')](function(_0x3cfd56){handleQuery(_0x3bc72a[_0x64e9('0x7c')]());var _0x34d589=csv_results[0x0];if(!_[_0x64e9('0x7d')](_0x34d589)){var _0x211dda=toCsv(_0x34d589);var _0x508384=Date['now']();fs[_0x64e9('0x7e')](util[_0x64e9('0x68')](_0x64e9('0x7f'),_0x392f4c,_0x508384),_0x211dda);_0x4377f5[_0x64e9('0x80')](_0x64e9('0x81'),_0x64e9('0x82')+util['format'](_0x64e9('0x83'),_0x392f4c,_0x508384));_0x4377f5[_0x64e9('0x80')](_0x64e9('0x84'),_0x64e9('0x85'));return _0x4377f5['download'](util[_0x64e9('0x68')]('/tmp/list_%d_%s.csv',_0x392f4c,_0x508384));}else{return _0x4377f5[_0x64e9('0x1d')](0xcc);}});});});};exports[_0x64e9('0x86')]=function(_0x59db56,_0x13ca62,_0x45b9bf){var _0x49528b;delete _0x59db56['body']['id'];return db[_0x64e9('0x30')]['findOne']({'where':{'id':_0x59db56[_0x64e9('0x54')]['id']}})['then'](handleEntityNotFound(_0x13ca62,null))[_0x64e9('0x2a')](function(_0x406a16){if(_0x406a16){return db['sequelize'][_0x64e9('0x87')](function(_0x359911){return db[_0x64e9('0x6c')][_0x64e9('0x4a')](_0x59db56['body'],{'transaction':_0x359911})[_0x64e9('0x2a')](function(_0x5dc005){_0x49528b=_0x5dc005;return _0x406a16[_0x64e9('0x88')](_0x5dc005,{'transaction':_0x359911});})[_0x64e9('0x2a')](function(){var _0x1dcc80={'type':db[_0x64e9('0x89')][_0x64e9('0x8a')],'transaction':_0x359911};switch(_0x59db56[_0x64e9('0x53')]['type']){case _0x64e9('0x8b'):_0x1dcc80['type']=db['Sequelize']['TEXT'];break;case _0x64e9('0x8c'):_0x1dcc80[_0x64e9('0x3e')]=db['Sequelize'][_0x64e9('0x8d')];break;case _0x64e9('0x8e'):_0x1dcc80[_0x64e9('0x3e')]=db[_0x64e9('0x89')][_0x64e9('0x8f')];_0x1dcc80['defaultValue']=![];break;default:}return db[_0x64e9('0x90')][_0x64e9('0x91')][_0x64e9('0x92')](_0x64e9('0x93'),util['format'](_0x64e9('0x94'),_0x49528b['id']),_0x1dcc80);})[_0x64e9('0x2a')](function(){return _0x49528b;});});}})[_0x64e9('0x2a')](respondWithResult(_0x13ca62,null))[_0x64e9('0x45')](handleError(_0x13ca62,null));};exports[_0x64e9('0x95')]=function(_0x597a1c,_0x2ccdbd,_0x4a98a1){var _0x3bec1c={};var _0x46d58a={};var _0x5d78e1;var _0x3e5a9b;return db[_0x64e9('0x30')][_0x64e9('0x96')]({'where':{'id':_0x597a1c[_0x64e9('0x54')]['id']}})['then'](handleEntityNotFound(_0x2ccdbd,null))[_0x64e9('0x2a')](function(_0x4ef350){if(_0x4ef350){_0x5d78e1=_0x4ef350;_0x46d58a[_0x64e9('0x33')]=_[_0x64e9('0x36')](db['CmCustomField'][_0x64e9('0x31')]);_0x46d58a[_0x64e9('0x35')]=_['keys'](_0x597a1c[_0x64e9('0x35')]);_0x46d58a[_0x64e9('0x46')]=_[_0x64e9('0x37')](_0x46d58a['model'],_0x46d58a[_0x64e9('0x35')]);_0x3bec1c[_0x64e9('0x38')]=_[_0x64e9('0x37')](_0x46d58a[_0x64e9('0x33')],qs[_0x64e9('0x47')](_0x597a1c['query'][_0x64e9('0x47')]));_0x3bec1c[_0x64e9('0x38')]=_0x3bec1c[_0x64e9('0x38')]['length']?_0x3bec1c[_0x64e9('0x38')]:_0x46d58a[_0x64e9('0x33')];_0x3bec1c[_0x64e9('0x5a')]=qs[_0x64e9('0x3a')](_0x597a1c[_0x64e9('0x35')][_0x64e9('0x3a')]);_0x3bec1c['where']=qs[_0x64e9('0x46')](_[_0x64e9('0x3c')](_0x597a1c['query'],_0x46d58a[_0x64e9('0x46')]));_0x3bec1c[_0x64e9('0x3b')]=_[_0x64e9('0x3f')](_0x3bec1c[_0x64e9('0x3b')],{'$or':[{'ListId':_0x4ef350['id']},{'ListId':null}]});if(_0x597a1c[_0x64e9('0x35')][_0x64e9('0x3d')]){_0x3bec1c[_0x64e9('0x3b')]=_[_0x64e9('0x3f')](_0x3bec1c['where'],{'$or':_['map'](_0x3bec1c[_0x64e9('0x38')],function(_0x2efc81){var _0xeec1de={};_0xeec1de[_0x2efc81]={'$like':'%'+_0x597a1c['query'][_0x64e9('0x3d')]+'%'};return _0xeec1de;})});}_0x3bec1c=_['merge']({},_0x3bec1c,_0x597a1c[_0x64e9('0x40')]);return db[_0x64e9('0x6c')][_0x64e9('0x97')](_0x3bec1c);}})[_0x64e9('0x2a')](respondWithResult(_0x2ccdbd,null))['catch'](handleError(_0x2ccdbd,null));};exports[_0x64e9('0x98')]=function(_0x1f155e,_0x5ba49b){return db[_0x64e9('0x6c')][_0x64e9('0x97')]({'where':{'ListId':null}})[_0x64e9('0x2a')](handleEntityNotFound(_0x5ba49b,null))[_0x64e9('0x2a')](function(_0x454c04){return _0x454c04;})['then'](respondWithResult(_0x5ba49b,null))[_0x64e9('0x45')](handleError(_0x5ba49b,null));};exports[_0x64e9('0x99')]=function(_0x1f87b0,_0x1b5d2a,_0x5019ec){return db['CmList'][_0x64e9('0x49')]({'where':{'id':_0x1f87b0['params']['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x1b5d2a,null))[_0x64e9('0x2a')](function(_0x4b5e25){if(_0x4b5e25){return _0x4b5e25['addAgents'](_0x1f87b0[_0x64e9('0x53')][_0x64e9('0x5c')],_['omit'](_0x1f87b0[_0x64e9('0x53')],[_0x64e9('0x5c'),'id'])||{})[_0x64e9('0x9a')](function(_0x634da){for(var _0x418756=0x0;_0x418756<_0x1f87b0[_0x64e9('0x53')][_0x64e9('0x5c')][_0x64e9('0x48')];_0x418756+=0x1){socket[_0x64e9('0x9b')](_0x64e9('0x9c'),{'UserId':Number(_0x1f87b0[_0x64e9('0x53')][_0x64e9('0x5c')][_0x418756]),'CmListId':Number(_0x1f87b0['params']['id'])});}return _0x634da;});}})[_0x64e9('0x2a')](respondWithResult(_0x1b5d2a,null))[_0x64e9('0x45')](handleError(_0x1b5d2a,null));};exports['removeAgents']=function(_0x3c2723,_0x4cad57,_0x503ce2){return db[_0x64e9('0x30')][_0x64e9('0x49')]({'where':{'id':_0x3c2723[_0x64e9('0x54')]['id']}})[_0x64e9('0x2a')](handleEntityNotFound(_0x4cad57,null))[_0x64e9('0x2a')](function(_0x2f3b8f){if(_0x2f3b8f){return _0x2f3b8f[_0x64e9('0x9d')](_0x3c2723['query']['ids'])[_0x64e9('0x2a')](function(){if(_[_0x64e9('0x5f')](_0x3c2723[_0x64e9('0x35')][_0x64e9('0x5c')])){for(var _0x161e3e=0x0;_0x161e3e<_0x3c2723[_0x64e9('0x35')][_0x64e9('0x5c')][_0x64e9('0x48')];_0x161e3e+=0x1){socket[_0x64e9('0x9b')](_0x64e9('0x9e'),{'UserId':Number(_0x3c2723[_0x64e9('0x35')][_0x64e9('0x5c')][_0x161e3e]),'CmListId':Number(_0x3c2723['params']['id'])});}}else{socket[_0x64e9('0x9b')](_0x64e9('0x9e'),{'UserId':Number(_0x3c2723[_0x64e9('0x35')]['ids']),'CmListId':Number(_0x3c2723['params']['id'])});}});}})[_0x64e9('0x2a')](respondWithStatusCode(_0x4cad57,null))[_0x64e9('0x45')](handleError(_0x4cad57,null));};exports['getAgents']=function(_0x68f661,_0x1e6a89,_0x41c227){var _0x10b462={};var _0xb167a7={};var _0x263278;var _0x5aa8cb;return db[_0x64e9('0x30')][_0x64e9('0x96')]({'where':{'id':_0x68f661['params']['id']}})['then'](handleEntityNotFound(_0x1e6a89,null))[_0x64e9('0x2a')](function(_0x2db49e){if(_0x2db49e){_0x263278=_0x2db49e;_0xb167a7[_0x64e9('0x33')]=_[_0x64e9('0x36')](db['User'][_0x64e9('0x31')]);_0xb167a7[_0x64e9('0x35')]=_[_0x64e9('0x36')](_0x68f661[_0x64e9('0x35')]);_0xb167a7['filters']=_[_0x64e9('0x37')](_0xb167a7['model'],_0xb167a7[_0x64e9('0x35')]);_0x10b462[_0x64e9('0x38')]=_[_0x64e9('0x37')](_0xb167a7[_0x64e9('0x33')],qs[_0x64e9('0x47')](_0x68f661[_0x64e9('0x35')]['fields']));_0x10b462[_0x64e9('0x38')]=_0x10b462[_0x64e9('0x38')][_0x64e9('0x48')]?_0x10b462[_0x64e9('0x38')]:_0xb167a7[_0x64e9('0x33')];_0x10b462[_0x64e9('0x5a')]=qs[_0x64e9('0x3a')](_0x68f661['query'][_0x64e9('0x3a')]);_0x10b462[_0x64e9('0x3b')]=qs['filters'](_[_0x64e9('0x3c')](_0x68f661[_0x64e9('0x35')],_0xb167a7[_0x64e9('0x46')]));if(_0x68f661['query'][_0x64e9('0x3d')]){_0x10b462[_0x64e9('0x3b')]=_[_0x64e9('0x3f')](_0x10b462[_0x64e9('0x3b')],{'$or':_[_0x64e9('0x34')](_0x10b462[_0x64e9('0x38')],function(_0x3aad82){var _0x3ed309={};_0x3ed309[_0x3aad82]={'$like':'%'+_0x68f661['query'][_0x64e9('0x3d')]+'%'};return _0x3ed309;})});}_0x10b462=_[_0x64e9('0x3f')]({},_0x10b462,_0x68f661[_0x64e9('0x40')]);return _0x263278[_0x64e9('0x9f')](_0x10b462);}})[_0x64e9('0x2a')](function(_0x1db55e){if(_0x1db55e){_0x5aa8cb=_0x1db55e[_0x64e9('0x48')];if(!_0x68f661[_0x64e9('0x35')][_0x64e9('0x39')]('nolimit')){_0x10b462[_0x64e9('0x24')]=qs['limit'](_0x68f661[_0x64e9('0x35')][_0x64e9('0x24')]);_0x10b462[_0x64e9('0x21')]=qs[_0x64e9('0x21')](_0x68f661['query'][_0x64e9('0x21')]);}return _0x263278[_0x64e9('0x9f')](_0x10b462);}})['then'](function(_0x240104){if(_0x240104){return _0x240104?{'count':_0x5aa8cb,'rows':_0x240104}:null;}})[_0x64e9('0x2a')](respondWithResult(_0x1e6a89,null))[_0x64e9('0x45')](handleError(_0x1e6a89,null));};function handleQuery(_0x3e2beb){logger[_0x64e9('0xa0')](_0x3e2beb);return db[_0x64e9('0x90')][_0x64e9('0x35')](_0x3e2beb)['spread'](function(_0x29e2d4){csv_results['push'](_0x29e2d4);})[_0x64e9('0x45')](function(_0x341973){logger[_0x64e9('0x2d')](_0x341973[_0x64e9('0x66')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 205f8d5..9a0bc4b 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x1cc04f,_0x2e0725){var _0x37a36a=function(_0xc74d33){while(--_0xc74d33){_0x1cc04f['push'](_0x1cc04f['shift']());}};_0x37a36a(++_0x2e0725);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x55a67f,_0x2fe3aa){var _0x197c8c=function(_0x1f0c9f){while(--_0x1f0c9f){_0x55a67f['push'](_0x55a67f['shift']());}};_0x197c8c(++_0x2fe3aa);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 380a037..1ec69ca 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x48588e,_0x523e4f){var _0x1285f7=function(_0x32c01e){while(--_0x32c01e){_0x48588e['push'](_0x48588e['shift']());}};_0x1285f7(++_0x523e4f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xb903,0x185));var _0x3b90=function(_0x2940a4,_0x25041f){_0x2940a4=_0x2940a4-0x0;var _0x2724c7=_0xb903[_0x2940a4];return _0x2724c7;};'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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index bdbb516..a949e6e 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 _0xa8b4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x1461f8,_0x338d0f){var _0x47d1eb=function(_0x4e5d2d){while(--_0x4e5d2d){_0x1461f8['push'](_0x1461f8['shift']());}};_0x47d1eb(++_0x338d0f);}(_0xa8b4,0x17b));var _0x4a8b=function(_0xec10c5,_0x131431){_0xec10c5=_0xec10c5-0x0;var _0x51bbb5=_0xa8b4[_0xec10c5];return _0x51bbb5;};'use strict';var _=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a8b('0x2'));var fs=require('fs');var Redis=require(_0x4a8b('0x3'));var db=require(_0x4a8b('0x4'))['db'];var utils=require(_0x4a8b('0x5'));var logger=require(_0x4a8b('0x6'))(_0x4a8b('0x7'));var config=require(_0x4a8b('0x8'));var jayson=require(_0x4a8b('0x9'));var client=jayson[_0x4a8b('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4a8b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a8b('0xc')]));require(_0x4a8b('0xd'))[_0x4a8b('0xe')](socket);function respondWithRpcPromise(_0x5c0bcf,_0xe9825b,_0x2c219c){return new BPromise(function(_0x2ca31f,_0x5a43dd){return client[_0x4a8b('0xf')](_0x5c0bcf,_0x2c219c)['then'](function(_0x59322b){logger[_0x4a8b('0x10')](_0x4a8b('0x11'),_0xe9825b,_0x4a8b('0x12'));logger[_0x4a8b('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0xe9825b,_0x4a8b('0x12'),JSON[_0x4a8b('0x14')](_0x59322b));if(_0x59322b[_0x4a8b('0x15')]){if(_0x59322b[_0x4a8b('0x15')][_0x4a8b('0x16')]===0x1f4){logger[_0x4a8b('0x15')]('CmList,\x20%s,\x20%s',_0xe9825b,_0x59322b['error'][_0x4a8b('0x17')]);return _0x5a43dd(_0x59322b[_0x4a8b('0x15')]['message']);}logger[_0x4a8b('0x15')](_0x4a8b('0x11'),_0xe9825b,_0x59322b[_0x4a8b('0x15')][_0x4a8b('0x17')]);return _0x2ca31f(_0x59322b['error']['message']);}else{logger[_0x4a8b('0x10')](_0x4a8b('0x11'),_0xe9825b,_0x4a8b('0x12'));_0x2ca31f(_0x59322b['result'][_0x4a8b('0x17')]);}})['catch'](function(_0x5c8a20){logger[_0x4a8b('0x15')](_0x4a8b('0x11'),_0xe9825b,_0x5c8a20);_0x5a43dd(_0x5c8a20);});});} \ No newline at end of file +var _0x2238=['message','info','result','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x15c4d9,_0x4c38ff){var _0x18f0f2=function(_0xa14932){while(--_0xa14932){_0x15c4d9['push'](_0x15c4d9['shift']());}};_0x18f0f2(++_0x4c38ff);}(_0x2238,0xd5));var _0x8223=function(_0x4a18e9,_0xd5f3aa){_0x4a18e9=_0x4a18e9-0x0;var _0x4b92be=_0x2238[_0x4a18e9];return _0x4b92be;};'use strict';var _=require('lodash');var util=require(_0x8223('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8223('0x1'));var fs=require('fs');var Redis=require(_0x8223('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8223('0x3'));var logger=require('../../config/logger')(_0x8223('0x4'));var config=require(_0x8223('0x5'));var jayson=require(_0x8223('0x6'));var client=jayson['client'][_0x8223('0x7')]({'port':0x232a});config[_0x8223('0x8')]=_[_0x8223('0x9')](config['redis'],{'host':_0x8223('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8223('0x8')]));require(_0x8223('0xb'))[_0x8223('0xc')](socket);function respondWithRpcPromise(_0x38f299,_0x761859,_0x3b7aff){return new BPromise(function(_0x1d455a,_0x4f6abe){return client['request'](_0x38f299,_0x3b7aff)[_0x8223('0xd')](function(_0x5c42f1){logger['info'](_0x8223('0xe'),_0x761859,_0x8223('0xf'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x761859,_0x8223('0xf'),JSON[_0x8223('0x10')](_0x5c42f1));if(_0x5c42f1[_0x8223('0x11')]){if(_0x5c42f1[_0x8223('0x11')]['code']===0x1f4){logger[_0x8223('0x11')](_0x8223('0xe'),_0x761859,_0x5c42f1[_0x8223('0x11')]['message']);return _0x4f6abe(_0x5c42f1[_0x8223('0x11')][_0x8223('0x12')]);}logger[_0x8223('0x11')](_0x8223('0xe'),_0x761859,_0x5c42f1['error'][_0x8223('0x12')]);return _0x1d455a(_0x5c42f1[_0x8223('0x11')]['message']);}else{logger[_0x8223('0x13')](_0x8223('0xe'),_0x761859,_0x8223('0xf'));_0x1d455a(_0x5c42f1[_0x8223('0x14')][_0x8223('0x12')]);}})['catch'](function(_0x2a6bb6){logger[_0x8223('0x11')](_0x8223('0xe'),_0x761859,_0x2a6bb6);_0x4f6abe(_0x2a6bb6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index bbb2912..903dee3 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 _0x0891=['./cmList.events','save','remove','update','emit','removeListener','register','cmList:'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x0891,0x78));var _0x1089=function(_0x3ded1b,_0x56de41){_0x3ded1b=_0x3ded1b-0x0;var _0x2fb179=_0x0891[_0x3ded1b];return _0x2fb179;};'use strict';var CmListEvents=require(_0x1089('0x0'));var events=[_0x1089('0x1'),_0x1089('0x2'),_0x1089('0x3')];function createListener(_0x2c7133,_0x193adf){return function(_0x5d9935){_0x193adf[_0x1089('0x4')](_0x2c7133,_0x5d9935);};}function removeListener(_0x487f28,_0x425512){return function(){CmListEvents[_0x1089('0x5')](_0x487f28,_0x425512);};}exports[_0x1089('0x6')]=function(_0x35e965){for(var _0x3e6823=0x0,_0x338add=events['length'];_0x3e6823<_0x338add;_0x3e6823++){var _0x50fa84=events[_0x3e6823];var _0x11148b=createListener(_0x1089('0x7')+_0x50fa84,_0x35e965);CmListEvents['on'](_0x50fa84,_0x11148b);}}; \ No newline at end of file +var _0xb40c=['register','cmList:','./cmList.events','save','remove','emit','removeListener'];(function(_0x5cdde3,_0x9789ce){var _0x53619d=function(_0x418e43){while(--_0x418e43){_0x5cdde3['push'](_0x5cdde3['shift']());}};_0x53619d(++_0x9789ce);}(_0xb40c,0x79));var _0xcb40=function(_0x59fb58,_0x5b6971){_0x59fb58=_0x59fb58-0x0;var _0x2e0dfd=_0xb40c[_0x59fb58];return _0x2e0dfd;};'use strict';var CmListEvents=require(_0xcb40('0x0'));var events=[_0xcb40('0x1'),_0xcb40('0x2'),'update'];function createListener(_0x1349f3,_0x5cf787){return function(_0x20d461){_0x5cf787[_0xcb40('0x3')](_0x1349f3,_0x20d461);};}function removeListener(_0x5a3fdb,_0x261700){return function(){CmListEvents[_0xcb40('0x4')](_0x5a3fdb,_0x261700);};}exports[_0xcb40('0x5')]=function(_0x1d5ad5){for(var _0x474ead=0x0,_0x3549f7=events['length'];_0x474ead<_0x3549f7;_0x474ead++){var _0x51fdd8=events[_0x474ead];var _0x21658c=createListener(_0xcb40('0x6')+_0x51fdd8,_0x1d5ad5);CmListEvents['on'](_0x51fdd8,_0x21658c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 405fd66..534e7f2 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 _0x7429=['create','addDisposition','/:id/fields','addCustomField','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','describe','isAuthenticated','getGlobalCustomFields','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post'];(function(_0x51aae9,_0x4095fc){var _0x28a5a9=function(_0x26f05c){while(--_0x26f05c){_0x51aae9['push'](_0x51aae9['shift']());}};_0x28a5a9(++_0x4095fc);}(_0x7429,0x6f));var _0x9742=function(_0x30699a,_0x422940){_0x30699a=_0x30699a-0x0;var _0x107091=_0x7429[_0x30699a];return _0x107091;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/global_fields',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id',auth[_0x9742('0xa')](),controller['show']);router[_0x9742('0x7')](_0x9742('0xc'),auth['isAuthenticated'](),controller[_0x9742('0xd')]);router[_0x9742('0x7')](_0x9742('0xe'),auth['isAuthenticated'](),controller[_0x9742('0xf')]);router[_0x9742('0x7')](_0x9742('0x10'),auth['isAuthenticated'](),controller[_0x9742('0x11')]);router[_0x9742('0x7')]('/:id/fields',auth[_0x9742('0xa')](),controller[_0x9742('0x12')]);router[_0x9742('0x7')](_0x9742('0x13'),auth[_0x9742('0xa')](),controller['getAgents']);router[_0x9742('0x14')]('/',auth['isAuthenticated'](),controller[_0x9742('0x15')]);router[_0x9742('0x14')](_0x9742('0xc'),auth[_0x9742('0xa')](),controller[_0x9742('0x16')]);router['post']('/:id/contacts',auth[_0x9742('0xa')](),controller['addContacts']);router[_0x9742('0x14')](_0x9742('0x17'),auth[_0x9742('0xa')](),controller[_0x9742('0x18')]);router[_0x9742('0x14')](_0x9742('0x13'),auth[_0x9742('0xa')](),controller[_0x9742('0x19')]);router['put'](_0x9742('0x1a'),auth[_0x9742('0xa')](),controller[_0x9742('0x1b')]);router[_0x9742('0x1c')]('/:id',auth[_0x9742('0xa')](),controller[_0x9742('0x1d')]);router['delete'](_0x9742('0xc'),auth[_0x9742('0xa')](),controller[_0x9742('0x1e')]);router['delete'](_0x9742('0x13'),auth['isAuthenticated'](),controller[_0x9742('0x1f')]);module[_0x9742('0x20')]=router; \ No newline at end of file +var _0x6475=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','describe','get','/global_fields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','update','delete','removeDispositions'];(function(_0x3d962f,_0x518679){var _0x11c5cf=function(_0x13d0ca){while(--_0x13d0ca){_0x3d962f['push'](_0x3d962f['shift']());}};_0x11c5cf(++_0x518679);}(_0x6475,0x133));var _0x5647=function(_0x4b0342,_0x5b071c){_0x4b0342=_0x4b0342-0x0;var _0xc62aa3=_0x6475[_0x4b0342];return _0xc62aa3;};'use strict';var multer=require(_0x5647('0x0'));var util=require(_0x5647('0x1'));var path=require(_0x5647('0x2'));var timeout=require('connect-timeout');var express=require(_0x5647('0x3'));var router=express[_0x5647('0x4')]();var fs_extra=require(_0x5647('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5647('0x6'));var config=require(_0x5647('0x7'));var controller=require(_0x5647('0x8'));router['get']('/',auth[_0x5647('0x9')](),controller[_0x5647('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5647('0xb')]);router[_0x5647('0xc')](_0x5647('0xd'),auth['isAuthenticated'](),controller['getGlobalCustomFields']);router[_0x5647('0xc')](_0x5647('0xe'),auth[_0x5647('0x9')](),controller[_0x5647('0xf')]);router[_0x5647('0xc')](_0x5647('0x10'),auth['isAuthenticated'](),controller[_0x5647('0x11')]);router['get']('/:id/contacts',auth[_0x5647('0x9')](),controller[_0x5647('0x12')]);router['get'](_0x5647('0x13'),auth[_0x5647('0x9')](),controller[_0x5647('0x14')]);router[_0x5647('0xc')](_0x5647('0x15'),auth['isAuthenticated'](),controller[_0x5647('0x16')]);router[_0x5647('0xc')](_0x5647('0x17'),auth[_0x5647('0x9')](),controller[_0x5647('0x18')]);router[_0x5647('0x19')]('/',auth[_0x5647('0x9')](),controller[_0x5647('0x1a')]);router['post'](_0x5647('0x10'),auth['isAuthenticated'](),controller[_0x5647('0x1b')]);router[_0x5647('0x19')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x5647('0x19')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5647('0x1c')]);router['post']('/:id/users',auth[_0x5647('0x9')](),controller[_0x5647('0x1d')]);router['put']('/:id',auth[_0x5647('0x9')](),controller[_0x5647('0x1e')]);router[_0x5647('0x1f')](_0x5647('0xe'),auth[_0x5647('0x9')](),controller['destroy']);router[_0x5647('0x1f')](_0x5647('0x10'),auth[_0x5647('0x9')](),controller[_0x5647('0x20')]);router[_0x5647('0x1f')](_0x5647('0x17'),auth[_0x5647('0x9')](),controller['removeAgents']);module[_0x5647('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 9a70aac..6614e51 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 _0x4653=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4653,0xc6));var _0x3465=function(_0x44ec71,_0x302bf5){_0x44ec71=_0x44ec71-0x0;var _0x288903=_0x4653[_0x44ec71];return _0x288903;};'use strict';var Sequelize=require(_0x3465('0x0'));module[_0x3465('0x1')]={'name':{'type':Sequelize[_0x3465('0x2')],'get':function(_0x22c04f){return this['getDataValue'](_0x3465('0x3'));}},'field':{'type':Sequelize[_0x3465('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x3465('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa73e=['sequelize','exports','VIRTUAL','field','STRING'];(function(_0x30a2d2,_0x18b37b){var _0x4fe43a=function(_0x7338bd){while(--_0x7338bd){_0x30a2d2['push'](_0x30a2d2['shift']());}};_0x4fe43a(++_0x18b37b);}(_0xa73e,0x131));var _0xea73=function(_0x3ce609,_0x56fdf7){_0x3ce609=_0x3ce609-0x0;var _0x4c7860=_0xa73e[_0x3ce609];return _0x4c7860;};'use strict';var Sequelize=require(_0xea73('0x0'));module[_0xea73('0x1')]={'name':{'type':Sequelize[_0xea73('0x2')],'get':function(_0xca9616){return this['getDataValue'](_0xea73('0x3'));}},'field':{'type':Sequelize[_0xea73('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xea73('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d8d2c9b..c4dccaf 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xda5dc6,_0x365b1e){var _0x2a6a96=function(_0x13a79e){while(--_0x13a79e){_0xda5dc6['push'](_0xda5dc6['shift']());}};_0x2a6a96(++_0x365b1e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x186293,_0x4aef61){var _0xfebaac=function(_0x28132e){while(--_0x28132e){_0x186293['push'](_0x186293['shift']());}};_0xfebaac(++_0x4aef61);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index d884a09..cc149ca 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 _0x68f0=['request-promise','rimraf','./condition.attributes','Condition','lodash','../../config/logger','api','bluebird'];(function(_0x54a229,_0x479dd1){var _0x36232e=function(_0x48a4d3){while(--_0x48a4d3){_0x54a229['push'](_0x54a229['shift']());}};_0x36232e(++_0x479dd1);}(_0x68f0,0x15c));var _0x068f=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x68f0[_0x3e182f];return _0x23edc9;};'use strict';var _=require(_0x068f('0x0'));var util=require('util');var logger=require(_0x068f('0x1'))(_0x068f('0x2'));var moment=require('moment');var BPromise=require(_0x068f('0x3'));var rp=require(_0x068f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x068f('0x5'));var config=require('../../config/environment');var attributes=require(_0x068f('0x6'));module['exports']=function(_0x2ea592,_0x206f42){return _0x2ea592['define'](_0x068f('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa015=['path','../../config/environment','exports','define','Condition','tools_conditions','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x349420,_0x4813cc){var _0x22111e=function(_0x18096e){while(--_0x18096e){_0x349420['push'](_0x349420['shift']());}};_0x22111e(++_0x4813cc);}(_0xa015,0x103));var _0x5a01=function(_0x4a522f,_0x90a85f){_0x4a522f=_0x4a522f-0x0;var _0x25d72=_0xa015[_0x4a522f];return _0x25d72;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a01('0x0'))(_0x5a01('0x1'));var moment=require(_0x5a01('0x2'));var BPromise=require(_0x5a01('0x3'));var rp=require(_0x5a01('0x4'));var fs=require('fs');var path=require(_0x5a01('0x5'));var rimraf=require('rimraf');var config=require(_0x5a01('0x6'));var attributes=require('./condition.attributes');module[_0x5a01('0x7')]=function(_0xa9cc02,_0x4407c5){return _0xa9cc02[_0x5a01('0x8')](_0x5a01('0x9'),attributes,{'tableName':_0x5a01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index df08dd0..1a54f18 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 _0xe270=['catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent'];(function(_0x12be2a,_0x61e503){var _0x23841f=function(_0x76a277){while(--_0x76a277){_0x12be2a['push'](_0x12be2a['shift']());}};_0x23841f(++_0x61e503);}(_0xe270,0x1cc));var _0x0e27=function(_0x4b8d4f,_0x36e5f6){_0x4b8d4f=_0x4b8d4f-0x0;var _0x59979e=_0xe270[_0x4b8d4f];return _0x59979e;};'use strict';var _=require(_0x0e27('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0e27('0x1'));var rs=require(_0x0e27('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e27('0x3'))['db'];var utils=require(_0x0e27('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0e27('0x5'));var client=jayson[_0x0e27('0x6')][_0x0e27('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x293315,_0x34d4ac,_0x294708){return new BPromise(function(_0x3b6493,_0x3f9a49){return client[_0x0e27('0x8')](_0x293315,_0x294708)['then'](function(_0x18ec9e){logger[_0x0e27('0x9')](_0x0e27('0xa'),_0x34d4ac,'request\x20sent');logger['debug'](_0x0e27('0xb'),_0x34d4ac,'request\x20sent',JSON[_0x0e27('0xc')](_0x18ec9e));if(_0x18ec9e[_0x0e27('0xd')]){if(_0x18ec9e[_0x0e27('0xd')]['code']===0x1f4){logger[_0x0e27('0xd')](_0x0e27('0xa'),_0x34d4ac,_0x18ec9e[_0x0e27('0xd')][_0x0e27('0xe')]);return _0x3f9a49(_0x18ec9e[_0x0e27('0xd')][_0x0e27('0xe')]);}logger[_0x0e27('0xd')]('Condition,\x20%s,\x20%s',_0x34d4ac,_0x18ec9e[_0x0e27('0xd')][_0x0e27('0xe')]);return _0x3b6493(_0x18ec9e['error'][_0x0e27('0xe')]);}else{logger[_0x0e27('0x9')]('Condition,\x20%s,\x20%s',_0x34d4ac,_0x0e27('0xf'));_0x3b6493(_0x18ec9e['result'][_0x0e27('0xe')]);}})[_0x0e27('0x10')](function(_0x385c4f){logger['error'](_0x0e27('0xa'),_0x34d4ac,_0x385c4f);_0x3f9a49(_0x385c4f);});});} \ No newline at end of file +var _0xae6e=['jayson/promise','http','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b7442,_0x561591){var _0x56e035=function(_0x42e09d){while(--_0x42e09d){_0x2b7442['push'](_0x2b7442['shift']());}};_0x56e035(++_0x561591);}(_0xae6e,0x1a6));var _0xeae6=function(_0x3bc29c,_0x2d517a){_0x3bc29c=_0x3bc29c-0x0;var _0xf1548c=_0xae6e[_0x3bc29c];return _0xf1548c;};'use strict';var _=require(_0xeae6('0x0'));var util=require(_0xeae6('0x1'));var moment=require(_0xeae6('0x2'));var BPromise=require(_0xeae6('0x3'));var rs=require(_0xeae6('0x4'));var fs=require('fs');var Redis=require(_0xeae6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeae6('0x6'));var logger=require(_0xeae6('0x7'))(_0xeae6('0x8'));var config=require(_0xeae6('0x9'));var jayson=require(_0xeae6('0xa'));var client=jayson['client'][_0xeae6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45abea,_0x4acf4c,_0xd4ae4){return new BPromise(function(_0x2fe262,_0x5705ba){return client[_0xeae6('0xc')](_0x45abea,_0xd4ae4)[_0xeae6('0xd')](function(_0x5bed38){logger[_0xeae6('0xe')]('Condition,\x20%s,\x20%s',_0x4acf4c,'request\x20sent');logger[_0xeae6('0xf')](_0xeae6('0x10'),_0x4acf4c,_0xeae6('0x11'),JSON['stringify'](_0x5bed38));if(_0x5bed38[_0xeae6('0x12')]){if(_0x5bed38[_0xeae6('0x12')][_0xeae6('0x13')]===0x1f4){logger['error'](_0xeae6('0x14'),_0x4acf4c,_0x5bed38['error']['message']);return _0x5705ba(_0x5bed38['error']['message']);}logger[_0xeae6('0x12')](_0xeae6('0x14'),_0x4acf4c,_0x5bed38['error']['message']);return _0x2fe262(_0x5bed38['error'][_0xeae6('0x15')]);}else{logger['info'](_0xeae6('0x14'),_0x4acf4c,'request\x20sent');_0x2fe262(_0x5bed38[_0xeae6('0x16')][_0xeae6('0x15')]);}})[_0xeae6('0x17')](function(_0x518b2a){logger['error']('Condition,\x20%s,\x20%s',_0x4acf4c,_0x518b2a);_0x5705ba(_0x518b2a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 485c66a..7a1b5b4 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 _0x5f05=['isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete'];(function(_0x52c76f,_0x4da30d){var _0x4d1483=function(_0x8426e7){while(--_0x8426e7){_0x52c76f['push'](_0x52c76f['shift']());}};_0x4d1483(++_0x4da30d);}(_0x5f05,0x1bc));var _0x55f0=function(_0x5097f5,_0x377cd6){_0x5097f5=_0x5097f5-0x0;var _0x3bb333=_0x5f05[_0x5097f5];return _0x3bb333;};'use strict';var multer=require(_0x55f0('0x0'));var util=require(_0x55f0('0x1'));var path=require(_0x55f0('0x2'));var timeout=require(_0x55f0('0x3'));var express=require(_0x55f0('0x4'));var router=express[_0x55f0('0x5')]();var fs_extra=require(_0x55f0('0x6'));var auth=require(_0x55f0('0x7'));var interaction=require(_0x55f0('0x8'));var config=require(_0x55f0('0x9'));var controller=require(_0x55f0('0xa'));router[_0x55f0('0xb')](_0x55f0('0xc'),auth['isAuthenticated'](),controller[_0x55f0('0xd')]);router[_0x55f0('0xe')]('/:id',auth[_0x55f0('0xf')](),controller['destroy']);module[_0x55f0('0x10')]=router; \ No newline at end of file +var _0x682a=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','util','path'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x682a,0x148));var _0xa682=function(_0x57a7ce,_0x27e3fc){_0x57a7ce=_0x57a7ce-0x0;var _0x24810f=_0x682a[_0x57a7ce];return _0x24810f;};'use strict';var multer=require('multer');var util=require(_0xa682('0x0'));var path=require(_0xa682('0x1'));var timeout=require(_0xa682('0x2'));var express=require(_0xa682('0x3'));var router=express[_0xa682('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa682('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa682('0x6'));var controller=require(_0xa682('0x7'));router[_0xa682('0x8')](_0xa682('0x9'),auth['isAuthenticated'](),controller[_0xa682('0xa')]);router[_0xa682('0xb')](_0xa682('0x9'),auth[_0xa682('0xc')](),controller[_0xa682('0xd')]);module[_0xa682('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5b78545..dc2cbb2 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16f2=['INTEGER','sequelize','exports','STRING','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16f2,0x150));var _0x216f=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0x16f2[_0x1c6efd];return _0x53a918;};'use strict';var Sequelize=require(_0x216f('0x0'));module[_0x216f('0x1')]={'name':{'type':Sequelize[_0x216f('0x2')],'allowNull':![],'unique':_0x216f('0x3')},'OrderBy':{'type':Sequelize[_0x216f('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x216f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc2d0=['exports','STRING','name','INTEGER','sequelize'];(function(_0x21d532,_0x4552a4){var _0x37bda1=function(_0x134a6f){while(--_0x134a6f){_0x21d532['push'](_0x21d532['shift']());}};_0x37bda1(++_0x4552a4);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x419fa1,_0x580e54){_0x419fa1=_0x419fa1-0x0;var _0x3f5ebf=_0xc2d0[_0x419fa1];return _0x3f5ebf;};'use strict';var Sequelize=require(_0x0c2d('0x0'));module[_0x0c2d('0x1')]={'name':{'type':Sequelize[_0x0c2d('0x2')],'allowNull':![],'unique':_0x0c2d('0x3')},'OrderBy':{'type':Sequelize[_0x0c2d('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0c2d('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 677ff72..9bd732f 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63a5=['end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x63a5,0x18e));var _0x563a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x63a5[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){var _0x1250e6=_0x44e2c1[_0x563a('0x28')]({'plain':!![]});var _0x1682ee=_0x563a('0x29');return db[_0x563a('0x2a')]['destroy']({'where':{'type':_0x1682ee,'resourceId':_0x1250e6['id']}})[_0x563a('0x26')](function(){return _0x44e2c1;});})[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0xce8165,_0x1898f9){return function(_0x1afdff){if(!_0x1afdff){_0xce8165[_0x563a('0x19')](0x194);}return _0x1afdff;};}function handleError(_0x249db8,_0x8f3429){_0x8f3429=_0x8f3429||0x1f4;return function(_0x1a69d5){logger[_0x563a('0x2b')](_0x1a69d5[_0x563a('0x2c')]);if(_0x1a69d5[_0x563a('0x2d')]){delete _0x1a69d5['name'];}_0x249db8[_0x563a('0x1a')](_0x8f3429)[_0x563a('0x2e')](_0x1a69d5);};}exports[_0x563a('0x2f')]=function(_0x4aaa3d,_0x1e8d43){var _0x2e5c4b={},_0x3a59cb={},_0x28a8f6={'count':0x0,'rows':[]};var _0x166f89=_[_0x563a('0x30')](db[_0x563a('0x31')]['rawAttributes'],function(_0x2418ae){return{'name':_0x2418ae[_0x563a('0x32')],'type':_0x2418ae[_0x563a('0x33')][_0x563a('0x34')]};});_0x3a59cb[_0x563a('0x35')]=_['map'](_0x166f89,'name');_0x3a59cb['query']=_['keys'](_0x4aaa3d[_0x563a('0x36')]);_0x3a59cb[_0x563a('0x37')]=_[_0x563a('0x38')](_0x3a59cb[_0x563a('0x35')],_0x3a59cb[_0x563a('0x36')]);_0x2e5c4b[_0x563a('0x39')]=_['intersection'](_0x3a59cb['model'],qs[_0x563a('0x3a')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3a')]));_0x2e5c4b[_0x563a('0x39')]=_0x2e5c4b[_0x563a('0x39')][_0x563a('0x3b')]?_0x2e5c4b[_0x563a('0x39')]:_0x3a59cb[_0x563a('0x35')];if(!_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3c')](_0x563a('0x3d'))){_0x2e5c4b[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1e')]);_0x2e5c4b[_0x563a('0x1f')]=qs['offset'](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1f')]);}_0x2e5c4b[_0x563a('0x3e')]=qs['sort'](_0x4aaa3d[_0x563a('0x36')]['sort']);_0x2e5c4b[_0x563a('0x3f')]=qs[_0x563a('0x37')](_['pick'](_0x4aaa3d['query'],_0x3a59cb[_0x563a('0x37')]),_0x166f89);if(_0x4aaa3d['query'][_0x563a('0x40')]){_0x2e5c4b[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x2e5c4b[_0x563a('0x3f')],{'$or':_['map'](_0x166f89,function(_0x47d37a){if(_0x47d37a[_0x563a('0x33')]!=='VIRTUAL'){var _0x46d471={};_0x46d471[_0x47d37a[_0x563a('0x2d')]]={'$like':'%'+_0x4aaa3d[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x46d471;}})});}_0x2e5c4b=_[_0x563a('0x41')]({},_0x2e5c4b,_0x4aaa3d[_0x563a('0x42')]);var _0x4bf555={'where':_0x2e5c4b[_0x563a('0x3f')]};return db['ContactItemType'][_0x563a('0x20')](_0x4bf555)['then'](function(_0x20c142){_0x28a8f6[_0x563a('0x20')]=_0x20c142;if(_0x4aaa3d[_0x563a('0x36')][_0x563a('0x43')]){_0x2e5c4b['include']=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x2e5c4b);})[_0x563a('0x26')](function(_0x1255da){_0x28a8f6[_0x563a('0x44')]=_0x1255da;return _0x28a8f6;})[_0x563a('0x26')](respondWithFilteredResult(_0x1e8d43,_0x2e5c4b))[_0x563a('0x45')](handleError(_0x1e8d43,null));};exports[_0x563a('0x46')]=function(_0x29a1c0,_0x2ca0f4){var _0x19c2cc={'raw':!![],'where':{'id':_0x29a1c0[_0x563a('0x47')]['id']}},_0x433353={};_0x433353[_0x563a('0x35')]=_[_0x563a('0x48')](db[_0x563a('0x31')][_0x563a('0x49')]);_0x433353[_0x563a('0x36')]=_[_0x563a('0x48')](_0x29a1c0[_0x563a('0x36')]);_0x433353[_0x563a('0x37')]=_['intersection'](_0x433353['model'],_0x433353[_0x563a('0x36')]);_0x19c2cc[_0x563a('0x39')]=_[_0x563a('0x38')](_0x433353[_0x563a('0x35')],qs[_0x563a('0x3a')](_0x29a1c0[_0x563a('0x36')][_0x563a('0x3a')]));_0x19c2cc[_0x563a('0x39')]=_0x19c2cc['attributes']['length']?_0x19c2cc[_0x563a('0x39')]:_0x433353[_0x563a('0x35')];if(_0x29a1c0[_0x563a('0x36')][_0x563a('0x43')]){_0x19c2cc[_0x563a('0x4a')]=[{'all':!![]}];}_0x19c2cc=_[_0x563a('0x41')]({},_0x19c2cc,_0x29a1c0[_0x563a('0x42')]);return db[_0x563a('0x31')]['find'](_0x19c2cc)[_0x563a('0x26')](handleEntityNotFound(_0x2ca0f4,null))[_0x563a('0x26')](respondWithResult(_0x2ca0f4,null))['catch'](handleError(_0x2ca0f4,null));};exports[_0x563a('0x4b')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x31')][_0x563a('0x4b')](_0x5a063a['body'],{})[_0x563a('0x26')](function(_0x23efcf){var _0xb1dbc8=_0x5a063a[_0x563a('0x4c')][_0x563a('0x28')]({'plain':!![]});if(!_0xb1dbc8)throw new Error(_0x563a('0x4d'));if(_0xb1dbc8[_0x563a('0x4e')]===_0x563a('0x4c')){var _0x277d54=_0x23efcf[_0x563a('0x28')]({'plain':!![]});var _0x3c98d5=_0x563a('0x29');return db[_0x563a('0x4f')]['find']({'where':{'name':_0x3c98d5,'userProfileId':_0xb1dbc8['userProfileId']},'raw':!![]})[_0x563a('0x26')](function(_0xaae9fd){if(_0xaae9fd&&_0xaae9fd[_0x563a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x277d54[_0x563a('0x2d')],'resourceId':_0x277d54['id'],'type':_0xaae9fd[_0x563a('0x2d')],'sectionId':_0xaae9fd['id']},{})['then'](function(){return _0x23efcf;});}else{return _0x23efcf;}})['catch'](function(_0x51e142){logger[_0x563a('0x2b')](_0x563a('0x51'),_0x51e142);throw _0x51e142;});}return _0x23efcf;})[_0x563a('0x26')](respondWithResult(_0x3ea787,0xc9))[_0x563a('0x45')](handleError(_0x3ea787,null));};exports[_0x563a('0x25')]=function(_0x2805eb,_0x4dd257){if(_0x2805eb['body']['id']){delete _0x2805eb[_0x563a('0x52')]['id'];}return db['ContactItemType'][_0x563a('0x53')]({'where':{'id':_0x2805eb[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x4dd257,null))[_0x563a('0x26')](saveUpdates(_0x2805eb[_0x563a('0x52')],null))[_0x563a('0x26')](respondWithResult(_0x4dd257,null))[_0x563a('0x45')](handleError(_0x4dd257,null));};exports['destroy']=function(_0x22cc91,_0x227372){return db['ContactItemType'][_0x563a('0x53')]({'where':{'id':_0x22cc91[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x227372,null))[_0x563a('0x26')](db[_0x563a('0x54')][_0x563a('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x22cc91[_0x563a('0x47')]['id']}}))[_0x563a('0x26')](removeEntity(_0x227372,null))[_0x563a('0x45')](handleError(_0x227372,null));}; \ No newline at end of file +var _0x757a=['sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','get','ContactItemTypes','UserProfileResource','destroy','end','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','rimraf','zip-dir','bluebird','mustache','util','path'];(function(_0xabb8a1,_0x5ed479){var _0x9a4673=function(_0x44ed09){while(--_0x44ed09){_0xabb8a1['push'](_0xabb8a1['shift']());}};_0x9a4673(++_0x5ed479);}(_0x757a,0xde));var _0xa757=function(_0x179661,_0x43c1b2){_0x179661=_0x179661-0x0;var _0x436a11=_0x757a[_0x179661];return _0x436a11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){var _0x59e9d4=_0x2bf276[_0xa757('0x1f')]({'plain':!![]});var _0x47903b=_0xa757('0x20');return db[_0xa757('0x21')][_0xa757('0x22')]({'where':{'type':_0x47903b,'resourceId':_0x59e9d4['id']}})['then'](function(){return _0x2bf276;});})[_0xa757('0x1e')](function(){_0x2ca10d[_0xa757('0x15')](0xcc)[_0xa757('0x23')]();});}};}function handleEntityNotFound(_0x3bf7f3,_0x5b4779){return function(_0x449a7d){if(!_0x449a7d){_0x3bf7f3['sendStatus'](0x194);}return _0x449a7d;};}function handleError(_0x5a5664,_0x54b75e){_0x54b75e=_0x54b75e||0x1f4;return function(_0x4f8de2){logger[_0xa757('0x24')](_0x4f8de2['stack']);if(_0x4f8de2[_0xa757('0x25')]){delete _0x4f8de2[_0xa757('0x25')];}_0x5a5664['status'](_0x54b75e)[_0xa757('0x26')](_0x4f8de2);};}exports['index']=function(_0x2c4823,_0xa6d0f6){var _0x5307c3={},_0x235e54={},_0x5ade7b={'count':0x0,'rows':[]};var _0x3a4a66=_[_0xa757('0x27')](db[_0xa757('0x28')][_0xa757('0x29')],function(_0xcc87c0){return{'name':_0xcc87c0[_0xa757('0x2a')],'type':_0xcc87c0[_0xa757('0x2b')][_0xa757('0x2c')]};});_0x235e54[_0xa757('0x2d')]=_[_0xa757('0x27')](_0x3a4a66,_0xa757('0x25'));_0x235e54[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x2c4823[_0xa757('0x2e')]);_0x235e54[_0xa757('0x30')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],_0x235e54[_0xa757('0x2e')]);_0x5307c3[_0xa757('0x32')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],qs[_0xa757('0x33')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x33')]));_0x5307c3['attributes']=_0x5307c3[_0xa757('0x32')][_0xa757('0x34')]?_0x5307c3[_0xa757('0x32')]:_0x235e54[_0xa757('0x2d')];if(!_0x2c4823[_0xa757('0x2e')]['hasOwnProperty'](_0xa757('0x35'))){_0x5307c3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x1a')]);_0x5307c3[_0xa757('0x17')]=qs['offset'](_0x2c4823[_0xa757('0x2e')][_0xa757('0x17')]);}_0x5307c3[_0xa757('0x36')]=qs[_0xa757('0x37')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x37')]);_0x5307c3[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x2c4823['query'],_0x235e54[_0xa757('0x30')]),_0x3a4a66);if(_0x2c4823[_0xa757('0x2e')][_0xa757('0x3a')]){_0x5307c3[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x5307c3[_0xa757('0x38')],{'$or':_['map'](_0x3a4a66,function(_0x10d3fd){if(_0x10d3fd[_0xa757('0x2b')]!=='VIRTUAL'){var _0x5eae0b={};_0x5eae0b[_0x10d3fd[_0xa757('0x25')]]={'$like':'%'+_0x2c4823[_0xa757('0x2e')]['filter']+'%'};return _0x5eae0b;}})});}_0x5307c3=_['merge']({},_0x5307c3,_0x2c4823[_0xa757('0x3c')]);var _0x1725a2={'where':_0x5307c3[_0xa757('0x38')]};return db['ContactItemType'][_0xa757('0x19')](_0x1725a2)[_0xa757('0x1e')](function(_0x26802c){_0x5ade7b[_0xa757('0x19')]=_0x26802c;if(_0x2c4823[_0xa757('0x2e')]['includeAll']){_0x5307c3[_0xa757('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x5307c3);})[_0xa757('0x1e')](function(_0x57298b){_0x5ade7b[_0xa757('0x3e')]=_0x57298b;return _0x5ade7b;})[_0xa757('0x1e')](respondWithFilteredResult(_0xa6d0f6,_0x5307c3))[_0xa757('0x3f')](handleError(_0xa6d0f6,null));};exports['show']=function(_0x5d25bb,_0x11e141){var _0x129d77={'raw':!![],'where':{'id':_0x5d25bb[_0xa757('0x40')]['id']}},_0x2b171c={};_0x2b171c[_0xa757('0x2d')]=_[_0xa757('0x2f')](db['ContactItemType'][_0xa757('0x29')]);_0x2b171c[_0xa757('0x2e')]=_['keys'](_0x5d25bb[_0xa757('0x2e')]);_0x2b171c['filters']=_[_0xa757('0x31')](_0x2b171c[_0xa757('0x2d')],_0x2b171c['query']);_0x129d77[_0xa757('0x32')]=_[_0xa757('0x31')](_0x2b171c['model'],qs[_0xa757('0x33')](_0x5d25bb[_0xa757('0x2e')][_0xa757('0x33')]));_0x129d77[_0xa757('0x32')]=_0x129d77['attributes'][_0xa757('0x34')]?_0x129d77[_0xa757('0x32')]:_0x2b171c[_0xa757('0x2d')];if(_0x5d25bb[_0xa757('0x2e')]['includeAll']){_0x129d77[_0xa757('0x3d')]=[{'all':!![]}];}_0x129d77=_['merge']({},_0x129d77,_0x5d25bb['options']);return db[_0xa757('0x28')][_0xa757('0x41')](_0x129d77)[_0xa757('0x1e')](handleEntityNotFound(_0x11e141,null))['then'](respondWithResult(_0x11e141,null))[_0xa757('0x3f')](handleError(_0x11e141,null));};exports['create']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x28')][_0xa757('0x42')](_0x2ed63f[_0xa757('0x43')],{})[_0xa757('0x1e')](function(_0x57bf73){var _0x505cd=_0x2ed63f['user'][_0xa757('0x1f')]({'plain':!![]});if(!_0x505cd)throw new Error(_0xa757('0x44'));if(_0x505cd[_0xa757('0x45')]===_0xa757('0x46')){var _0x319988=_0x57bf73[_0xa757('0x1f')]({'plain':!![]});var _0x15bad7=_0xa757('0x20');return db[_0xa757('0x47')][_0xa757('0x41')]({'where':{'name':_0x15bad7,'userProfileId':_0x505cd[_0xa757('0x48')]},'raw':!![]})[_0xa757('0x1e')](function(_0x2367c7){if(_0x2367c7&&_0x2367c7[_0xa757('0x49')]===0x0){return db[_0xa757('0x21')][_0xa757('0x42')]({'name':_0x319988['name'],'resourceId':_0x319988['id'],'type':_0x2367c7[_0xa757('0x25')],'sectionId':_0x2367c7['id']},{})['then'](function(){return _0x57bf73;});}else{return _0x57bf73;}})[_0xa757('0x3f')](function(_0x311c25){logger[_0xa757('0x24')](_0xa757('0x4a'),_0x311c25);throw _0x311c25;});}return _0x57bf73;})['then'](respondWithResult(_0x151cc3,0xc9))[_0xa757('0x3f')](handleError(_0x151cc3,null));};exports[_0xa757('0x1d')]=function(_0x8614f9,_0x980e1){if(_0x8614f9['body']['id']){delete _0x8614f9[_0xa757('0x43')]['id'];}return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x8614f9[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x980e1,null))[_0xa757('0x1e')](saveUpdates(_0x8614f9['body'],null))['then'](respondWithResult(_0x980e1,null))['catch'](handleError(_0x980e1,null));};exports['destroy']=function(_0x1d8742,_0x9b3779){return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x1d8742[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x9b3779,null))['then'](db[_0xa757('0x4b')][_0xa757('0x1d')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d8742[_0xa757('0x40')]['id']}}))[_0xa757('0x1e')](removeEntity(_0x9b3779,null))['catch'](handleError(_0x9b3779,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 4434719..24d0ee3 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba77=['define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports'];(function(_0x59819e,_0x1b3f74){var _0x4f1ab2=function(_0x1c479f){while(--_0x1c479f){_0x59819e['push'](_0x59819e['shift']());}};_0x4f1ab2(++_0x1b3f74);}(_0xba77,0x121));var _0x7ba7=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xba77[_0x284807];return _0x50c774;};'use strict';var _=require(_0x7ba7('0x0'));var util=require(_0x7ba7('0x1'));var logger=require(_0x7ba7('0x2'))(_0x7ba7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7ba7('0x4'));var fs=require('fs');var path=require(_0x7ba7('0x5'));var rimraf=require(_0x7ba7('0x6'));var config=require(_0x7ba7('0x7'));var attributes=require(_0x7ba7('0x8'));module[_0x7ba7('0x9')]=function(_0x24fdde,_0x5eecfb){return _0x24fdde[_0x7ba7('0xa')](_0x7ba7('0xb'),attributes,{'tableName':_0x7ba7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27ed=['request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x27ed,0xa3));var _0xd27e=function(_0x5a9af1,_0x2e97de){_0x5a9af1=_0x5a9af1-0x0;var _0x3840ff=_0x27ed[_0x5a9af1];return _0x3840ff;};'use strict';var _=require(_0xd27e('0x0'));var util=require(_0xd27e('0x1'));var logger=require(_0xd27e('0x2'))(_0xd27e('0x3'));var moment=require(_0xd27e('0x4'));var BPromise=require(_0xd27e('0x5'));var rp=require(_0xd27e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd27e('0x7'));var config=require(_0xd27e('0x8'));var attributes=require(_0xd27e('0x9'));module[_0xd27e('0xa')]=function(_0x58d22a,_0x38bb02){return _0x58d22a[_0xd27e('0xb')](_0xd27e('0xc'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 6f2fb6f..07a5635 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebd3=['code','message','result','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4076bf,_0x104e12){var _0x5390ef=function(_0x5aa3c7){while(--_0x5aa3c7){_0x4076bf['push'](_0x4076bf['shift']());}};_0x5390ef(++_0x104e12);}(_0xebd3,0x194));var _0x3ebd=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0xebd3[_0x49aa7d];return _0xdd0d26;};'use strict';var _=require(_0x3ebd('0x0'));var util=require('util');var moment=require(_0x3ebd('0x1'));var BPromise=require('bluebird');var rs=require(_0x3ebd('0x2'));var fs=require('fs');var Redis=require(_0x3ebd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ebd('0x4'));var config=require(_0x3ebd('0x5'));var jayson=require(_0x3ebd('0x6'));var client=jayson[_0x3ebd('0x7')][_0x3ebd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaf0f66,_0x3c1c3f,_0x163009){return new BPromise(function(_0x3981ab,_0x11034e){return client['request'](_0xaf0f66,_0x163009)[_0x3ebd('0x9')](function(_0x527525){logger[_0x3ebd('0xa')](_0x3ebd('0xb'),_0x3c1c3f,_0x3ebd('0xc'));logger['debug'](_0x3ebd('0xd'),_0x3c1c3f,'request\x20sent',JSON[_0x3ebd('0xe')](_0x527525));if(_0x527525['error']){if(_0x527525[_0x3ebd('0xf')][_0x3ebd('0x10')]===0x1f4){logger[_0x3ebd('0xf')](_0x3ebd('0xb'),_0x3c1c3f,_0x527525[_0x3ebd('0xf')]['message']);return _0x11034e(_0x527525[_0x3ebd('0xf')][_0x3ebd('0x11')]);}logger['error'](_0x3ebd('0xb'),_0x3c1c3f,_0x527525[_0x3ebd('0xf')][_0x3ebd('0x11')]);return _0x3981ab(_0x527525['error']['message']);}else{logger[_0x3ebd('0xa')]('ContactItemType,\x20%s,\x20%s',_0x3c1c3f,_0x3ebd('0xc'));_0x3981ab(_0x527525[_0x3ebd('0x12')][_0x3ebd('0x11')]);}})[_0x3ebd('0x13')](function(_0x3f6278){logger[_0x3ebd('0xf')](_0x3ebd('0xb'),_0x3c1c3f,_0x3f6278);_0x11034e(_0x3f6278);});});} \ No newline at end of file +var _0x173d=['../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x173d,0x108));var _0xd173=function(_0x1f0ae4,_0x4f57a8){_0x1f0ae4=_0x1f0ae4-0x0;var _0x22acf5=_0x173d[_0x1f0ae4];return _0x22acf5;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd173('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd173('0x2'))['db'];var utils=require(_0xd173('0x3'));var logger=require(_0xd173('0x4'))(_0xd173('0x5'));var config=require(_0xd173('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd173('0x7')][_0xd173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454bfa,_0x5dc244,_0x239a90){return new BPromise(function(_0x5229ad,_0x3a1529){return client['request'](_0x454bfa,_0x239a90)['then'](function(_0x2e5ecc){logger[_0xd173('0x9')]('ContactItemType,\x20%s,\x20%s',_0x5dc244,_0xd173('0xa'));logger[_0xd173('0xb')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x5dc244,_0xd173('0xa'),JSON[_0xd173('0xc')](_0x2e5ecc));if(_0x2e5ecc[_0xd173('0xd')]){if(_0x2e5ecc[_0xd173('0xd')][_0xd173('0xe')]===0x1f4){logger[_0xd173('0xd')](_0xd173('0xf'),_0x5dc244,_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);return _0x3a1529(_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);}logger[_0xd173('0xd')]('ContactItemType,\x20%s,\x20%s',_0x5dc244,_0x2e5ecc[_0xd173('0xd')]['message']);return _0x5229ad(_0x2e5ecc[_0xd173('0xd')][_0xd173('0x10')]);}else{logger['info'](_0xd173('0xf'),_0x5dc244,_0xd173('0xa'));_0x5229ad(_0x2e5ecc[_0xd173('0x11')][_0xd173('0x10')]);}})['catch'](function(_0x5b96e1){logger[_0xd173('0xd')](_0xd173('0xf'),_0x5dc244,_0x5b96e1);_0x3a1529(_0x5b96e1);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index f2ae4a5..d007df2 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe39b=['put','update','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','isAuthenticated','get','/:id','create'];(function(_0x563505,_0x188901){var _0x19d7c1=function(_0x472aa0){while(--_0x472aa0){_0x563505['push'](_0x563505['shift']());}};_0x19d7c1(++_0x188901);}(_0xe39b,0xe5));var _0xbe39=function(_0x1bb100,_0x561aa7){_0x1bb100=_0x1bb100-0x0;var _0x52860d=_0xe39b[_0x1bb100];return _0x52860d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbe39('0x0')]();var fs_extra=require(_0xbe39('0x1'));var auth=require(_0xbe39('0x2'));var interaction=require(_0xbe39('0x3'));var config=require('../../config/environment');var controller=require(_0xbe39('0x4'));router['get']('/',auth[_0xbe39('0x5')](),controller['index']);router[_0xbe39('0x6')](_0xbe39('0x7'),auth[_0xbe39('0x5')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe39('0x8')]);router[_0xbe39('0x9')]('/:id',auth[_0xbe39('0x5')](),controller[_0xbe39('0xa')]);router[_0xbe39('0xb')](_0xbe39('0x7'),auth[_0xbe39('0x5')](),controller[_0xbe39('0xc')]);module[_0xbe39('0xd')]=router; \ No newline at end of file +var _0xa184=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','index','/:id','isAuthenticated','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x5e9dac,_0x57a29c){var _0x5ab15d=function(_0x230174){while(--_0x230174){_0x5e9dac['push'](_0x5e9dac['shift']());}};_0x5ab15d(++_0x57a29c);}(_0xa184,0x7a));var _0x4a18=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xa184[_0x9cfe28];return _0x54a1d0;};'use strict';var multer=require(_0x4a18('0x0'));var util=require(_0x4a18('0x1'));var path=require(_0x4a18('0x2'));var timeout=require(_0x4a18('0x3'));var express=require(_0x4a18('0x4'));var router=express[_0x4a18('0x5')]();var fs_extra=require(_0x4a18('0x6'));var auth=require(_0x4a18('0x7'));var interaction=require(_0x4a18('0x8'));var config=require('../../config/environment');var controller=require(_0x4a18('0x9'));router[_0x4a18('0xa')]('/',auth['isAuthenticated'](),controller[_0x4a18('0xb')]);router[_0x4a18('0xa')](_0x4a18('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4a18('0xd')](),controller[_0x4a18('0xe')]);router[_0x4a18('0xf')]('/:id',auth[_0x4a18('0xd')](),controller[_0x4a18('0x10')]);router[_0x4a18('0x11')](_0x4a18('0xc'),auth[_0x4a18('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e7d91a1..62e83aa 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 _0x0713=['STRING','name'];(function(_0x42692b,_0x1bfaa8){var _0x431fbc=function(_0xc7436a){while(--_0xc7436a){_0x42692b['push'](_0x42692b['shift']());}};_0x431fbc(++_0x1bfaa8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x1b9b59,_0x5a6c8c){var _0x3309f3=function(_0x4bf738){while(--_0x4bf738){_0x1b9b59['push'](_0x1b9b59['shift']());}};_0x3309f3(++_0x5a6c8c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 70e7e3a..53bea6e 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 _0x41e4=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Dashboard','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','user','role','CustomDashboards','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','update','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','limit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x41e4,0x6d));var _0x441e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x41e4[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x441e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x441e('0x1'));var jsonpatch=require(_0x441e('0x2'));var rp=require(_0x441e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x441e('0x4'));var util=require(_0x441e('0x5'));var path=require('path');var sox=require(_0x441e('0x6'));var csv=require(_0x441e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x441e('0x8'));var _=require(_0x441e('0x9'));var squel=require(_0x441e('0xa'));var crypto=require(_0x441e('0xb'));var jsforce=require(_0x441e('0xc'));var deskjs=require(_0x441e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x441e('0xe'));var Papa=require(_0x441e('0xf'));var Redis=require(_0x441e('0x10'));var authService=require(_0x441e('0x11'));var qs=require(_0x441e('0x12'));var as=require(_0x441e('0x13'));var hardwareService=require(_0x441e('0x14'));var logger=require('../../config/logger')(_0x441e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x441e('0x16'))['db'];config[_0x441e('0x17')]=_[_0x441e('0x18')](config[_0x441e('0x17')],{'host':_0x441e('0x19'),'port':0x18eb});var socket=require(_0x441e('0x1a'))(new Redis(config['redis']));require('./dashboard.socket')[_0x441e('0x1b')](socket);function respondWithStatusCode(_0x2d06a3,_0x1ab430){_0x1ab430=_0x1ab430||0xcc;return function(_0x430005){if(_0x430005){return _0x2d06a3[_0x441e('0x1c')](_0x1ab430);}return _0x2d06a3[_0x441e('0x1d')](_0x1ab430)[_0x441e('0x1e')]();};}function respondWithResult(_0x558481,_0x447848){_0x447848=_0x447848||0xc8;return function(_0x319a71){if(_0x319a71){return _0x558481[_0x441e('0x1d')](_0x447848)[_0x441e('0x1f')](_0x319a71);}};}function respondWithFilteredResult(_0x3e7671,_0x5196bd){return function(_0x4cc3ee){if(_0x4cc3ee){var _0x11e31c=typeof _0x5196bd[_0x441e('0x20')]===_0x441e('0x21')&&typeof _0x5196bd['limit']===_0x441e('0x21');var _0xf978dd=_0x4cc3ee[_0x441e('0x22')];var _0xe1fac8=_0x11e31c?0x0:_0x5196bd[_0x441e('0x20')];var _0x436659=_0x11e31c?_0x4cc3ee[_0x441e('0x22')]:_0x5196bd[_0x441e('0x20')]+_0x5196bd['limit'];var _0x5e875c;if(_0x436659>=_0xf978dd){_0x436659=_0xf978dd;_0x5e875c=0xc8;}else{_0x5e875c=0xce;}_0x3e7671[_0x441e('0x1d')](_0x5e875c);return _0x3e7671[_0x441e('0x23')](_0x441e('0x24'),_0xe1fac8+'-'+_0x436659+'/'+_0xf978dd)['json'](_0x4cc3ee);}return null;};}function patchUpdates(_0x26b77a){return function(_0xc7e021){try{jsonpatch[_0x441e('0x25')](_0xc7e021,_0x26b77a,!![]);}catch(_0x2d8127){return BPromise[_0x441e('0x26')](_0x2d8127);}return _0xc7e021['save']();};}function saveUpdates(_0x4df6d5,_0x3a133a){return function(_0x45ee57){if(_0x45ee57){return _0x45ee57['update'](_0x4df6d5)[_0x441e('0x27')](function(_0x189926){return _0x189926;});}return null;};}function removeEntity(_0x206789,_0xc74c8){return function(_0x54c838){if(_0x54c838){return _0x54c838['destroy']()[_0x441e('0x27')](function(){var _0x38021f=_0x54c838[_0x441e('0x28')]({'plain':!![]});var _0x20739b='CustomDashboards';return db[_0x441e('0x29')][_0x441e('0x2a')]({'where':{'type':_0x20739b,'resourceId':_0x38021f['id']}})['then'](function(){return _0x54c838;});})[_0x441e('0x27')](function(){_0x206789[_0x441e('0x1d')](0xcc)[_0x441e('0x1e')]();});}};}function handleEntityNotFound(_0x51726d,_0x4ce6cf){return function(_0x44af82){if(!_0x44af82){_0x51726d[_0x441e('0x1c')](0x194);}return _0x44af82;};}function handleError(_0x53e9ea,_0x19ad8c){_0x19ad8c=_0x19ad8c||0x1f4;return function(_0x21ea5a){logger[_0x441e('0x2b')](_0x21ea5a['stack']);if(_0x21ea5a[_0x441e('0x2c')]){delete _0x21ea5a[_0x441e('0x2c')];}_0x53e9ea[_0x441e('0x1d')](_0x19ad8c)['send'](_0x21ea5a);};}exports['index']=function(_0x3fa884,_0x3ee7d3){var _0x3f0ee3={},_0xfc9b75={},_0x5df72c={'count':0x0,'rows':[]};var _0x4149af=_[_0x441e('0x2d')](db['Dashboard'][_0x441e('0x2e')],function(_0x42155c){return{'name':_0x42155c[_0x441e('0x2f')],'type':_0x42155c[_0x441e('0x30')][_0x441e('0x31')]};});_0xfc9b75[_0x441e('0x32')]=_['map'](_0x4149af,'name');_0xfc9b75[_0x441e('0x33')]=_['keys'](_0x3fa884['query']);_0xfc9b75[_0x441e('0x34')]=_['intersection'](_0xfc9b75['model'],_0xfc9b75[_0x441e('0x33')]);_0x3f0ee3[_0x441e('0x35')]=_[_0x441e('0x36')](_0xfc9b75[_0x441e('0x32')],qs[_0x441e('0x37')](_0x3fa884[_0x441e('0x33')][_0x441e('0x37')]));_0x3f0ee3[_0x441e('0x35')]=_0x3f0ee3[_0x441e('0x35')]['length']?_0x3f0ee3[_0x441e('0x35')]:_0xfc9b75['model'];if(!_0x3fa884['query'][_0x441e('0x38')](_0x441e('0x39'))){_0x3f0ee3['limit']=qs['limit'](_0x3fa884['query']['limit']);_0x3f0ee3[_0x441e('0x20')]=qs[_0x441e('0x20')](_0x3fa884[_0x441e('0x33')]['offset']);}_0x3f0ee3[_0x441e('0x3a')]=qs['sort'](_0x3fa884['query'][_0x441e('0x3b')]);_0x3f0ee3[_0x441e('0x3c')]=qs[_0x441e('0x34')](_[_0x441e('0x3d')](_0x3fa884[_0x441e('0x33')],_0xfc9b75[_0x441e('0x34')]),_0x4149af);if(_0x3fa884['query']['filter']){_0x3f0ee3[_0x441e('0x3c')]=_['merge'](_0x3f0ee3['where'],{'$or':_[_0x441e('0x2d')](_0x4149af,function(_0x154303){if(_0x154303[_0x441e('0x30')]!==_0x441e('0x3e')){var _0x4ab2ba={};_0x4ab2ba[_0x154303[_0x441e('0x2c')]]={'$like':'%'+_0x3fa884[_0x441e('0x33')][_0x441e('0x3f')]+'%'};return _0x4ab2ba;}})});}_0x3f0ee3=_[_0x441e('0x40')]({},_0x3f0ee3,_0x3fa884[_0x441e('0x41')]);var _0x2f18b0={'where':_0x3f0ee3[_0x441e('0x3c')]};return db[_0x441e('0x42')][_0x441e('0x22')](_0x2f18b0)[_0x441e('0x27')](function(_0x1d6b86){_0x5df72c[_0x441e('0x22')]=_0x1d6b86;if(_0x3fa884[_0x441e('0x33')][_0x441e('0x43')]){_0x3f0ee3[_0x441e('0x44')]=[{'all':!![]}];}return db[_0x441e('0x42')][_0x441e('0x45')](_0x3f0ee3);})[_0x441e('0x27')](function(_0x2e73fa){_0x5df72c[_0x441e('0x46')]=_0x2e73fa;return _0x5df72c;})[_0x441e('0x27')](respondWithFilteredResult(_0x3ee7d3,_0x3f0ee3))[_0x441e('0x47')](handleError(_0x3ee7d3,null));};exports[_0x441e('0x48')]=function(_0x24641e,_0x2a6d2a){var _0x294578={'raw':![],'where':{'id':_0x24641e[_0x441e('0x49')]['id']}},_0x10cd03={};_0x10cd03[_0x441e('0x32')]=_[_0x441e('0x4a')](db['Dashboard'][_0x441e('0x2e')]);_0x10cd03[_0x441e('0x33')]=_[_0x441e('0x4a')](_0x24641e[_0x441e('0x33')]);_0x10cd03[_0x441e('0x34')]=_[_0x441e('0x36')](_0x10cd03[_0x441e('0x32')],_0x10cd03['query']);_0x294578['attributes']=_[_0x441e('0x36')](_0x10cd03['model'],qs[_0x441e('0x37')](_0x24641e[_0x441e('0x33')][_0x441e('0x37')]));_0x294578[_0x441e('0x35')]=_0x294578[_0x441e('0x35')][_0x441e('0x4b')]?_0x294578[_0x441e('0x35')]:_0x10cd03[_0x441e('0x32')];if(_0x24641e['query'][_0x441e('0x43')]){_0x294578['include']=[{'all':!![]}];}_0x294578=_['merge']({},_0x294578,_0x24641e[_0x441e('0x41')]);return db['Dashboard'][_0x441e('0x4c')](_0x294578)[_0x441e('0x27')](handleEntityNotFound(_0x2a6d2a,null))[_0x441e('0x27')](respondWithResult(_0x2a6d2a,null))[_0x441e('0x47')](handleError(_0x2a6d2a,null));};exports['create']=function(_0x23eb8f,_0x4adb4a){return db[_0x441e('0x42')]['create'](_0x23eb8f[_0x441e('0x4d')],{})[_0x441e('0x27')](function(_0x416d57){var _0x3f650d=_0x23eb8f[_0x441e('0x4e')][_0x441e('0x28')]({'plain':!![]});if(!_0x3f650d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f650d[_0x441e('0x4f')]===_0x441e('0x4e')){var _0x3873f6=_0x416d57[_0x441e('0x28')]({'plain':!![]});var _0x300b4e=_0x441e('0x50');return db[_0x441e('0x51')][_0x441e('0x4c')]({'where':{'name':_0x300b4e,'userProfileId':_0x3f650d[_0x441e('0x52')]},'raw':!![]})[_0x441e('0x27')](function(_0x1f16a6){if(_0x1f16a6&&_0x1f16a6['autoAssociation']===0x0){return db[_0x441e('0x29')]['create']({'name':_0x3873f6[_0x441e('0x2c')],'resourceId':_0x3873f6['id'],'type':_0x1f16a6['name'],'sectionId':_0x1f16a6['id']},{})[_0x441e('0x27')](function(){return _0x416d57;});}else{return _0x416d57;}})['catch'](function(_0x471280){logger[_0x441e('0x2b')](_0x441e('0x53'),_0x471280);throw _0x471280;});}return _0x416d57;})[_0x441e('0x27')](respondWithResult(_0x4adb4a,0xc9))['catch'](handleError(_0x4adb4a,null));};exports['clone']=function(_0x187221,_0x5d194a){var _0x5c8d11={'where':{'id':_0x187221[_0x441e('0x49')]['id']}},_0x5bb384={};_0x5bb384[_0x441e('0x32')]=_[_0x441e('0x4a')](db[_0x441e('0x42')][_0x441e('0x2e')]);_0x5c8d11[_0x441e('0x35')]=_[_0x441e('0x36')](_0x5bb384[_0x441e('0x32')],qs[_0x441e('0x37')](_0x187221['query'][_0x441e('0x37')]));_0x5c8d11[_0x441e('0x35')]=_0x5c8d11[_0x441e('0x35')][_0x441e('0x4b')]?_0x5c8d11[_0x441e('0x35')]:_0x5bb384[_0x441e('0x32')];if(_0x187221[_0x441e('0x33')]['includeAll']){_0x5c8d11[_0x441e('0x44')]=[{'all':!![]}];}_0x5c8d11=_[_0x441e('0x40')]({},_0x5c8d11,_0x187221[_0x441e('0x41')]);return db[_0x441e('0x42')][_0x441e('0x4c')](_0x5c8d11)[_0x441e('0x27')](handleEntityNotFound(_0x5d194a,null))[_0x441e('0x27')](function(_0x26892c){if(_0x26892c){var _0x52f90f=_0x26892c[_0x441e('0x28')]({'plain':!![]});_0x52f90f=qs['omit'](_0x52f90f,['id','createdAt','updatedAt']);_0x187221[_0x441e('0x4d')]=_['omit'](_0x187221[_0x441e('0x4d')],['id',_0x441e('0x54'),'updatedAt']);return db[_0x441e('0x42')][_0x441e('0x55')](_[_0x441e('0x40')](_0x52f90f,_0x187221[_0x441e('0x4d')]),{'include':_0x187221[_0x441e('0x33')][_0x441e('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x574824){var _0xee6d9f=_0x187221['user']['get']({'plain':!![]});if(!_0xee6d9f)throw new Error(_0x441e('0x56'));if(_0xee6d9f[_0x441e('0x4f')]==='user'){var _0x4547f2=_0x574824[_0x441e('0x28')]({'plain':!![]});var _0x46072e=_0x441e('0x50');return db[_0x441e('0x51')][_0x441e('0x4c')]({'where':{'name':_0x46072e,'userProfileId':_0xee6d9f[_0x441e('0x52')]},'raw':!![]})[_0x441e('0x27')](function(_0x5d5652){if(_0x5d5652&&_0x5d5652[_0x441e('0x57')]===0x0){return db[_0x441e('0x29')]['create']({'name':_0x4547f2[_0x441e('0x2c')],'resourceId':_0x4547f2['id'],'type':_0x5d5652['name'],'sectionId':_0x5d5652['id']},{})[_0x441e('0x27')](function(){return _0x574824;});}else{return _0x574824;}})['catch'](function(_0x213775){logger[_0x441e('0x2b')](_0x441e('0x53'),_0x213775);throw _0x213775;});}return _0x574824;});}})['then'](respondWithResult(_0x5d194a,0xc9))['catch'](handleError(_0x5d194a,null));};exports[_0x441e('0x58')]=function(_0x3ba8eb,_0x5c4ba1){if(_0x3ba8eb[_0x441e('0x4d')]['id']){delete _0x3ba8eb[_0x441e('0x4d')]['id'];}return db['Dashboard'][_0x441e('0x4c')]({'where':{'id':_0x3ba8eb['params']['id']}})['then'](handleEntityNotFound(_0x5c4ba1,null))[_0x441e('0x27')](saveUpdates(_0x3ba8eb[_0x441e('0x4d')],null))[_0x441e('0x27')](respondWithResult(_0x5c4ba1,null))[_0x441e('0x47')](handleError(_0x5c4ba1,null));};exports[_0x441e('0x2a')]=function(_0x24ab87,_0x40ebe1){return db[_0x441e('0x42')][_0x441e('0x4c')]({'where':{'id':_0x24ab87[_0x441e('0x49')]['id']}})[_0x441e('0x27')](handleEntityNotFound(_0x40ebe1,null))['then'](removeEntity(_0x40ebe1,null))[_0x441e('0x47')](handleError(_0x40ebe1,null));};function widgetAttributes(_0x44ec0d){try{switch(_0x44ec0d[_0x441e('0x30')]){case'iframe':return[{'name':_0x441e('0x59'),'value':_0x44ec0d[_0x441e('0x59')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||_0x441e('0x5c')}];case'custom':return[{'name':'attrPath','value':_0x44ec0d[_0x441e('0x5d')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||''}];case'clock':return[{'name':_0x441e('0x5e'),'value':_0x44ec0d[_0x441e('0x5e')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||'HH:mm:ss'},{'name':_0x441e('0x5f'),'value':_0x44ec0d[_0x441e('0x5f')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x1]?_0x44ec0d[_0x441e('0x5a')][0x1][_0x441e('0x5b')]:undefined)||_0x441e('0x60')},{'name':_0x441e('0x61'),'value':_0x44ec0d[_0x441e('0x61')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x2]?_0x44ec0d['attrs'][0x2][_0x441e('0x5b')]:undefined)||0xc}];case _0x441e('0x62'):return[{'name':_0x441e('0x63'),'value':_0x44ec0d[_0x441e('0x63')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||_0x441e('0x64')},{'name':_0x441e('0x65'),'value':_0x44ec0d[_0x441e('0x65')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x1]?_0x44ec0d['attrs'][0x1][_0x441e('0x5b')]:undefined)||[]},{'name':_0x441e('0x61'),'value':_0x44ec0d['attrFontSize']||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x2]?_0x44ec0d[_0x441e('0x5a')][0x2][_0x441e('0x5b')]:undefined)||0x14},{'name':_0x441e('0x66'),'value':_0x44ec0d['attrChannel']||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x3]?_0x44ec0d['attrs'][0x3][_0x441e('0x5b')]:undefined)||_0x441e('0x67')},{'name':'attrEmailAccounts','value':_0x44ec0d[_0x441e('0x68')]||(_0x44ec0d['attrs']&&_0x44ec0d[_0x441e('0x5a')][0x4]?_0x44ec0d[_0x441e('0x5a')][0x4][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x69'),'value':_0x44ec0d[_0x441e('0x69')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x5]?_0x44ec0d[_0x441e('0x5a')][0x5][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x6a'),'value':_0x44ec0d[_0x441e('0x6a')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x6]?_0x44ec0d[_0x441e('0x5a')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x44ec0d['attrOpenchannelAccounts']||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x7]?_0x44ec0d[_0x441e('0x5a')][0x7][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x6b'),'value':_0x44ec0d[_0x441e('0x6b')]||(_0x44ec0d['attrs']&&_0x44ec0d[_0x441e('0x5a')][0x8]?_0x44ec0d[_0x441e('0x5a')][0x8][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x6c'),'value':_0x44ec0d['attrChatWebsites']||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x9]?_0x44ec0d['attrs'][0x9][_0x441e('0x5b')]:undefined)||''}];case _0x441e('0x6d'):case _0x441e('0x6e'):return[{'name':'attrSerie1','value':_0x44ec0d[_0x441e('0x6f')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||_0x441e('0x64')},{'name':_0x441e('0x70'),'value':_0x44ec0d[_0x441e('0x70')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x1]?_0x44ec0d[_0x441e('0x5a')][0x1]['value']:undefined)||null},{'name':_0x441e('0x71'),'value':_0x44ec0d[_0x441e('0x71')]||(_0x44ec0d['attrs']&&_0x44ec0d['attrs'][0x2]?_0x44ec0d[_0x441e('0x5a')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x44ec0d['attrVoiceQueues']||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x3]?_0x44ec0d[_0x441e('0x5a')][0x3]['value']:undefined)||[]},{'name':_0x441e('0x66'),'value':_0x44ec0d[_0x441e('0x66')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x4]?_0x44ec0d[_0x441e('0x5a')][0x4][_0x441e('0x5b')]:undefined)||_0x441e('0x67')},{'name':_0x441e('0x68'),'value':_0x44ec0d[_0x441e('0x68')]||(_0x44ec0d['attrs']&&_0x44ec0d['attrs'][0x5]?_0x44ec0d[_0x441e('0x5a')][0x5][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x69'),'value':_0x44ec0d[_0x441e('0x69')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d['attrs'][0x6]?_0x44ec0d[_0x441e('0x5a')][0x6]['value']:undefined)||''},{'name':_0x441e('0x6a'),'value':_0x44ec0d[_0x441e('0x6a')]||(_0x44ec0d['attrs']&&_0x44ec0d[_0x441e('0x5a')][0x7]?_0x44ec0d[_0x441e('0x5a')][0x7][_0x441e('0x5b')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x44ec0d[_0x441e('0x72')]||(_0x44ec0d['attrs']&&_0x44ec0d[_0x441e('0x5a')][0x8]?_0x44ec0d[_0x441e('0x5a')][0x8][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x6b'),'value':_0x44ec0d[_0x441e('0x6b')]||(_0x44ec0d['attrs']&&_0x44ec0d[_0x441e('0x5a')][0x9]?_0x44ec0d[_0x441e('0x5a')][0x9][_0x441e('0x5b')]:undefined)||''},{'name':_0x441e('0x6c'),'value':_0x44ec0d['attrChatWebsites']||(_0x44ec0d['attrs']&&_0x44ec0d['attrs'][0xa]?_0x44ec0d['attrs'][0xa]['value']:undefined)||''}];case _0x441e('0x73'):return[{'name':'attrReport','type':_0x44ec0d[_0x441e('0x74')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x30')]:undefined)||null,'value':_0x44ec0d[_0x441e('0x75')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x0]?_0x44ec0d[_0x441e('0x5a')][0x0][_0x441e('0x5b')]:undefined)||null},{'name':_0x441e('0x76'),'value':_0x44ec0d[_0x441e('0x76')]||(_0x44ec0d[_0x441e('0x5a')]&&_0x44ec0d[_0x441e('0x5a')][0x1]?_0x44ec0d['attrs'][0x1][_0x441e('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x712ae6){logger[_0x441e('0x2b')](_0x441e('0x77'),JSON[_0x441e('0x78')](_0x712ae6));return[];}}exports[_0x441e('0x79')]=function(_0x2ace89,_0x4c28c4,_0x2feeba){if(_0x2ace89[_0x441e('0x4d')]['id']){delete _0x2ace89[_0x441e('0x4d')]['id'];}return db[_0x441e('0x42')][_0x441e('0x4c')]({'where':{'id':_0x2ace89['params']['id']}})[_0x441e('0x27')](handleEntityNotFound(_0x4c28c4,null))['then'](function(_0x8f07c2){if(_0x8f07c2){_0x2ace89[_0x441e('0x4d')][_0x441e('0x7a')]=_0x8f07c2['id'];_0x2ace89['body'][_0x441e('0x5a')]=widgetAttributes(_0x2ace89[_0x441e('0x4d')]);return db[_0x441e('0x7b')][_0x441e('0x55')](_0x2ace89[_0x441e('0x4d')]);}})['then'](respondWithResult(_0x4c28c4,null))['catch'](handleError(_0x4c28c4,null));};exports[_0x441e('0x7c')]=function(_0x28064c,_0x3e83db,_0x1a030e){var _0x1d3df8={};var _0x33ead3={};var _0xdfc888;var _0x3fd2cb;return db[_0x441e('0x42')]['findOne']({'where':{'id':_0x28064c[_0x441e('0x49')]['id']}})[_0x441e('0x27')](handleEntityNotFound(_0x3e83db,null))[_0x441e('0x27')](function(_0x2e6ba1){if(_0x2e6ba1){_0xdfc888=_0x2e6ba1;_0x33ead3[_0x441e('0x32')]=_[_0x441e('0x4a')](db[_0x441e('0x7b')][_0x441e('0x2e')]);_0x33ead3[_0x441e('0x33')]=_[_0x441e('0x4a')](_0x28064c[_0x441e('0x33')]);_0x33ead3['filters']=_[_0x441e('0x36')](_0x33ead3['model'],_0x33ead3[_0x441e('0x33')]);_0x1d3df8[_0x441e('0x35')]=_[_0x441e('0x36')](_0x33ead3['model'],qs[_0x441e('0x37')](_0x28064c['query'][_0x441e('0x37')]));_0x1d3df8[_0x441e('0x35')]=_0x1d3df8[_0x441e('0x35')]['length']?_0x1d3df8[_0x441e('0x35')]:_0x33ead3[_0x441e('0x32')];_0x1d3df8[_0x441e('0x3a')]=qs['sort'](_0x28064c[_0x441e('0x33')][_0x441e('0x3b')]);_0x1d3df8['where']=qs[_0x441e('0x34')](_[_0x441e('0x3d')](_0x28064c[_0x441e('0x33')],_0x33ead3['filters']));if(_0x28064c[_0x441e('0x33')][_0x441e('0x3f')]){_0x1d3df8[_0x441e('0x3c')]=_[_0x441e('0x40')](_0x1d3df8['where'],{'$or':_[_0x441e('0x2d')](_0x1d3df8[_0x441e('0x35')],function(_0x7fb813){var _0xd0606e={};_0xd0606e[_0x7fb813]={'$like':'%'+_0x28064c['query'][_0x441e('0x3f')]+'%'};return _0xd0606e;})});}_0x1d3df8=_[_0x441e('0x40')]({},_0x1d3df8,_0x28064c['options']);return _0xdfc888[_0x441e('0x7c')](_0x1d3df8);}})[_0x441e('0x27')](function(_0x241faf){if(_0x241faf){_0x3fd2cb=_0x241faf[_0x441e('0x4b')];if(!_0x28064c[_0x441e('0x33')]['hasOwnProperty']('nolimit')){_0x1d3df8[_0x441e('0x7d')]=qs['limit'](_0x28064c[_0x441e('0x33')][_0x441e('0x7d')]);_0x1d3df8[_0x441e('0x20')]=qs[_0x441e('0x20')](_0x28064c[_0x441e('0x33')]['offset']);}return _0xdfc888[_0x441e('0x7c')](_0x1d3df8);}})[_0x441e('0x27')](function(_0x486a8f){if(_0x486a8f){return _0x486a8f?{'count':_0x3fd2cb,'rows':_0x486a8f}:null;}})[_0x441e('0x27')](respondWithResult(_0x3e83db,null))['catch'](handleError(_0x3e83db,null));}; \ No newline at end of file +var _0xab54=['params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xab54,0xbd));var _0x4ab5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab54[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4ab5('0x0'));var rimraf=require(_0x4ab5('0x1'));var zipdir=require(_0x4ab5('0x2'));var jsonpatch=require(_0x4ab5('0x3'));var rp=require(_0x4ab5('0x4'));var moment=require(_0x4ab5('0x5'));var BPromise=require(_0x4ab5('0x6'));var Mustache=require(_0x4ab5('0x7'));var util=require(_0x4ab5('0x8'));var path=require(_0x4ab5('0x9'));var sox=require(_0x4ab5('0xa'));var csv=require(_0x4ab5('0xb'));var ejs=require(_0x4ab5('0xc'));var fs=require('fs');var fs_extra=require(_0x4ab5('0xd'));var _=require(_0x4ab5('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ab5('0xf'));var deskjs=require(_0x4ab5('0x10'));var toCsv=require(_0x4ab5('0xb'));var querystring=require(_0x4ab5('0x11'));var Papa=require(_0x4ab5('0x12'));var Redis=require('ioredis');var authService=require(_0x4ab5('0x13'));var qs=require(_0x4ab5('0x14'));var as=require(_0x4ab5('0x15'));var hardwareService=require(_0x4ab5('0x16'));var logger=require(_0x4ab5('0x17'))(_0x4ab5('0x18'));var utils=require(_0x4ab5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4ab5('0x1a'))['db'];config[_0x4ab5('0x1b')]=_['defaults'](config[_0x4ab5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ab5('0x1c'))(new Redis(config[_0x4ab5('0x1b')]));require(_0x4ab5('0x1d'))[_0x4ab5('0x1e')](socket);function respondWithStatusCode(_0x39eddb,_0x4d618f){_0x4d618f=_0x4d618f||0xcc;return function(_0x3338de){if(_0x3338de){return _0x39eddb[_0x4ab5('0x1f')](_0x4d618f);}return _0x39eddb[_0x4ab5('0x20')](_0x4d618f)[_0x4ab5('0x21')]();};}function respondWithResult(_0x4e2ff2,_0x249f78){_0x249f78=_0x249f78||0xc8;return function(_0x342595){if(_0x342595){return _0x4e2ff2[_0x4ab5('0x20')](_0x249f78)[_0x4ab5('0x22')](_0x342595);}};}function respondWithFilteredResult(_0x161f54,_0x4349ea){return function(_0x102cf8){if(_0x102cf8){var _0x1982b4=typeof _0x4349ea[_0x4ab5('0x23')]==='undefined'&&typeof _0x4349ea[_0x4ab5('0x24')]===_0x4ab5('0x25');var _0x3fd633=_0x102cf8['count'];var _0x32f55d=_0x1982b4?0x0:_0x4349ea[_0x4ab5('0x23')];var _0x3f33c9=_0x1982b4?_0x102cf8[_0x4ab5('0x26')]:_0x4349ea[_0x4ab5('0x23')]+_0x4349ea[_0x4ab5('0x24')];var _0x52a35d;if(_0x3f33c9>=_0x3fd633){_0x3f33c9=_0x3fd633;_0x52a35d=0xc8;}else{_0x52a35d=0xce;}_0x161f54[_0x4ab5('0x20')](_0x52a35d);return _0x161f54[_0x4ab5('0x27')](_0x4ab5('0x28'),_0x32f55d+'-'+_0x3f33c9+'/'+_0x3fd633)['json'](_0x102cf8);}return null;};}function patchUpdates(_0x2c46dc){return function(_0x3e7ab3){try{jsonpatch[_0x4ab5('0x29')](_0x3e7ab3,_0x2c46dc,!![]);}catch(_0x201353){return BPromise[_0x4ab5('0x2a')](_0x201353);}return _0x3e7ab3[_0x4ab5('0x2b')]();};}function saveUpdates(_0x292096,_0x3ac8f8){return function(_0x45565f){if(_0x45565f){return _0x45565f[_0x4ab5('0x2c')](_0x292096)[_0x4ab5('0x2d')](function(_0xa1066f){return _0xa1066f;});}return null;};}function removeEntity(_0x1a6d90,_0x427b8a){return function(_0x38c5c1){if(_0x38c5c1){return _0x38c5c1[_0x4ab5('0x2e')]()[_0x4ab5('0x2d')](function(){var _0x114b3c=_0x38c5c1[_0x4ab5('0x2f')]({'plain':!![]});var _0x1a086f=_0x4ab5('0x30');return db[_0x4ab5('0x31')]['destroy']({'where':{'type':_0x1a086f,'resourceId':_0x114b3c['id']}})['then'](function(){return _0x38c5c1;});})[_0x4ab5('0x2d')](function(){_0x1a6d90[_0x4ab5('0x20')](0xcc)[_0x4ab5('0x21')]();});}};}function handleEntityNotFound(_0x2754ad,_0xb40647){return function(_0x5885f5){if(!_0x5885f5){_0x2754ad['sendStatus'](0x194);}return _0x5885f5;};}function handleError(_0x5cba60,_0x393780){_0x393780=_0x393780||0x1f4;return function(_0x59f19b){logger[_0x4ab5('0x32')](_0x59f19b[_0x4ab5('0x33')]);if(_0x59f19b[_0x4ab5('0x34')]){delete _0x59f19b[_0x4ab5('0x34')];}_0x5cba60[_0x4ab5('0x20')](_0x393780)['send'](_0x59f19b);};}exports[_0x4ab5('0x35')]=function(_0x35fe1d,_0x283b83){var _0x11afd7={},_0x52349e={},_0x4c2fbe={'count':0x0,'rows':[]};var _0x566766=_[_0x4ab5('0x36')](db[_0x4ab5('0x37')][_0x4ab5('0x38')],function(_0x371dc5){return{'name':_0x371dc5[_0x4ab5('0x39')],'type':_0x371dc5[_0x4ab5('0x3a')]['key']};});_0x52349e[_0x4ab5('0x3b')]=_[_0x4ab5('0x36')](_0x566766,_0x4ab5('0x34'));_0x52349e[_0x4ab5('0x3c')]=_['keys'](_0x35fe1d[_0x4ab5('0x3c')]);_0x52349e[_0x4ab5('0x3d')]=_[_0x4ab5('0x3e')](_0x52349e[_0x4ab5('0x3b')],_0x52349e[_0x4ab5('0x3c')]);_0x11afd7[_0x4ab5('0x3f')]=_['intersection'](_0x52349e[_0x4ab5('0x3b')],qs['fields'](_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x40')]));_0x11afd7['attributes']=_0x11afd7[_0x4ab5('0x3f')][_0x4ab5('0x41')]?_0x11afd7[_0x4ab5('0x3f')]:_0x52349e[_0x4ab5('0x3b')];if(!_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x42')](_0x4ab5('0x43'))){_0x11afd7[_0x4ab5('0x24')]=qs['limit'](_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x24')]);_0x11afd7[_0x4ab5('0x23')]=qs[_0x4ab5('0x23')](_0x35fe1d[_0x4ab5('0x3c')]['offset']);}_0x11afd7['order']=qs[_0x4ab5('0x44')](_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x44')]);_0x11afd7['where']=qs[_0x4ab5('0x3d')](_[_0x4ab5('0x45')](_0x35fe1d['query'],_0x52349e[_0x4ab5('0x3d')]),_0x566766);if(_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x46')]){_0x11afd7['where']=_[_0x4ab5('0x47')](_0x11afd7[_0x4ab5('0x48')],{'$or':_['map'](_0x566766,function(_0x4419fd){if(_0x4419fd[_0x4ab5('0x3a')]!==_0x4ab5('0x49')){var _0x54d007={};_0x54d007[_0x4419fd[_0x4ab5('0x34')]]={'$like':'%'+_0x35fe1d['query']['filter']+'%'};return _0x54d007;}})});}_0x11afd7=_[_0x4ab5('0x47')]({},_0x11afd7,_0x35fe1d[_0x4ab5('0x4a')]);var _0x5c064b={'where':_0x11afd7[_0x4ab5('0x48')]};return db['Dashboard'][_0x4ab5('0x26')](_0x5c064b)[_0x4ab5('0x2d')](function(_0x2b187a){_0x4c2fbe['count']=_0x2b187a;if(_0x35fe1d[_0x4ab5('0x3c')][_0x4ab5('0x4b')]){_0x11afd7[_0x4ab5('0x4c')]=[{'all':!![]}];}return db[_0x4ab5('0x37')][_0x4ab5('0x4d')](_0x11afd7);})[_0x4ab5('0x2d')](function(_0x4d92c1){_0x4c2fbe[_0x4ab5('0x4e')]=_0x4d92c1;return _0x4c2fbe;})['then'](respondWithFilteredResult(_0x283b83,_0x11afd7))[_0x4ab5('0x4f')](handleError(_0x283b83,null));};exports[_0x4ab5('0x50')]=function(_0x51dd69,_0x2eb4a3){var _0x51679b={'raw':![],'where':{'id':_0x51dd69[_0x4ab5('0x51')]['id']}},_0x1697ac={};_0x1697ac['model']=_[_0x4ab5('0x52')](db[_0x4ab5('0x37')][_0x4ab5('0x38')]);_0x1697ac[_0x4ab5('0x3c')]=_[_0x4ab5('0x52')](_0x51dd69[_0x4ab5('0x3c')]);_0x1697ac[_0x4ab5('0x3d')]=_['intersection'](_0x1697ac['model'],_0x1697ac[_0x4ab5('0x3c')]);_0x51679b[_0x4ab5('0x3f')]=_[_0x4ab5('0x3e')](_0x1697ac[_0x4ab5('0x3b')],qs[_0x4ab5('0x40')](_0x51dd69[_0x4ab5('0x3c')][_0x4ab5('0x40')]));_0x51679b['attributes']=_0x51679b[_0x4ab5('0x3f')]['length']?_0x51679b['attributes']:_0x1697ac[_0x4ab5('0x3b')];if(_0x51dd69[_0x4ab5('0x3c')][_0x4ab5('0x4b')]){_0x51679b[_0x4ab5('0x4c')]=[{'all':!![]}];}_0x51679b=_[_0x4ab5('0x47')]({},_0x51679b,_0x51dd69[_0x4ab5('0x4a')]);return db[_0x4ab5('0x37')][_0x4ab5('0x53')](_0x51679b)[_0x4ab5('0x2d')](handleEntityNotFound(_0x2eb4a3,null))['then'](respondWithResult(_0x2eb4a3,null))[_0x4ab5('0x4f')](handleError(_0x2eb4a3,null));};exports[_0x4ab5('0x54')]=function(_0x7bd989,_0xb78a5e){return db[_0x4ab5('0x37')][_0x4ab5('0x54')](_0x7bd989['body'],{})[_0x4ab5('0x2d')](function(_0x2ba320){var _0x249475=_0x7bd989[_0x4ab5('0x55')]['get']({'plain':!![]});if(!_0x249475)throw new Error(_0x4ab5('0x56'));if(_0x249475[_0x4ab5('0x57')]===_0x4ab5('0x55')){var _0x56c56b=_0x2ba320[_0x4ab5('0x2f')]({'plain':!![]});var _0x517ae1=_0x4ab5('0x30');return db[_0x4ab5('0x58')][_0x4ab5('0x53')]({'where':{'name':_0x517ae1,'userProfileId':_0x249475[_0x4ab5('0x59')]},'raw':!![]})[_0x4ab5('0x2d')](function(_0x5ba99a){if(_0x5ba99a&&_0x5ba99a[_0x4ab5('0x5a')]===0x0){return db[_0x4ab5('0x31')][_0x4ab5('0x54')]({'name':_0x56c56b[_0x4ab5('0x34')],'resourceId':_0x56c56b['id'],'type':_0x5ba99a[_0x4ab5('0x34')],'sectionId':_0x5ba99a['id']},{})[_0x4ab5('0x2d')](function(){return _0x2ba320;});}else{return _0x2ba320;}})[_0x4ab5('0x4f')](function(_0x5bd469){logger[_0x4ab5('0x32')](_0x4ab5('0x5b'),_0x5bd469);throw _0x5bd469;});}return _0x2ba320;})[_0x4ab5('0x2d')](respondWithResult(_0xb78a5e,0xc9))[_0x4ab5('0x4f')](handleError(_0xb78a5e,null));};exports[_0x4ab5('0x5c')]=function(_0x5528a6,_0x46b597){var _0x157917={'where':{'id':_0x5528a6[_0x4ab5('0x51')]['id']}},_0x276bc7={};_0x276bc7[_0x4ab5('0x3b')]=_[_0x4ab5('0x52')](db[_0x4ab5('0x37')][_0x4ab5('0x38')]);_0x157917[_0x4ab5('0x3f')]=_[_0x4ab5('0x3e')](_0x276bc7[_0x4ab5('0x3b')],qs[_0x4ab5('0x40')](_0x5528a6[_0x4ab5('0x3c')]['fields']));_0x157917[_0x4ab5('0x3f')]=_0x157917['attributes'][_0x4ab5('0x41')]?_0x157917[_0x4ab5('0x3f')]:_0x276bc7[_0x4ab5('0x3b')];if(_0x5528a6[_0x4ab5('0x3c')][_0x4ab5('0x4b')]){_0x157917[_0x4ab5('0x4c')]=[{'all':!![]}];}_0x157917=_[_0x4ab5('0x47')]({},_0x157917,_0x5528a6['options']);return db[_0x4ab5('0x37')]['find'](_0x157917)['then'](handleEntityNotFound(_0x46b597,null))['then'](function(_0xd7c044){if(_0xd7c044){var _0x2ca804=_0xd7c044['get']({'plain':!![]});_0x2ca804=qs[_0x4ab5('0x5d')](_0x2ca804,['id',_0x4ab5('0x5e'),_0x4ab5('0x5f')]);_0x5528a6['body']=_[_0x4ab5('0x5d')](_0x5528a6[_0x4ab5('0x60')],['id',_0x4ab5('0x5e'),_0x4ab5('0x5f')]);return db[_0x4ab5('0x37')][_0x4ab5('0x54')](_[_0x4ab5('0x47')](_0x2ca804,_0x5528a6[_0x4ab5('0x60')]),{'include':_0x5528a6[_0x4ab5('0x3c')][_0x4ab5('0x4b')]?[{'all':!![]}]:undefined})[_0x4ab5('0x2d')](function(_0x315878){var _0x1f5364=_0x5528a6[_0x4ab5('0x55')][_0x4ab5('0x2f')]({'plain':!![]});if(!_0x1f5364)throw new Error(_0x4ab5('0x56'));if(_0x1f5364[_0x4ab5('0x57')]==='user'){var _0x5d00be=_0x315878[_0x4ab5('0x2f')]({'plain':!![]});var _0x465fc1=_0x4ab5('0x30');return db[_0x4ab5('0x58')][_0x4ab5('0x53')]({'where':{'name':_0x465fc1,'userProfileId':_0x1f5364[_0x4ab5('0x59')]},'raw':!![]})[_0x4ab5('0x2d')](function(_0x19807b){if(_0x19807b&&_0x19807b[_0x4ab5('0x5a')]===0x0){return db[_0x4ab5('0x31')][_0x4ab5('0x54')]({'name':_0x5d00be[_0x4ab5('0x34')],'resourceId':_0x5d00be['id'],'type':_0x19807b['name'],'sectionId':_0x19807b['id']},{})['then'](function(){return _0x315878;});}else{return _0x315878;}})['catch'](function(_0x1cbe2e){logger[_0x4ab5('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cbe2e);throw _0x1cbe2e;});}return _0x315878;});}})[_0x4ab5('0x2d')](respondWithResult(_0x46b597,0xc9))[_0x4ab5('0x4f')](handleError(_0x46b597,null));};exports[_0x4ab5('0x2c')]=function(_0x1985e9,_0x439b6a){if(_0x1985e9['body']['id']){delete _0x1985e9['body']['id'];}return db['Dashboard'][_0x4ab5('0x53')]({'where':{'id':_0x1985e9[_0x4ab5('0x51')]['id']}})[_0x4ab5('0x2d')](handleEntityNotFound(_0x439b6a,null))[_0x4ab5('0x2d')](saveUpdates(_0x1985e9[_0x4ab5('0x60')],null))['then'](respondWithResult(_0x439b6a,null))[_0x4ab5('0x4f')](handleError(_0x439b6a,null));};exports['destroy']=function(_0x3c5000,_0xc3519b){return db[_0x4ab5('0x37')][_0x4ab5('0x53')]({'where':{'id':_0x3c5000[_0x4ab5('0x51')]['id']}})[_0x4ab5('0x2d')](handleEntityNotFound(_0xc3519b,null))['then'](removeEntity(_0xc3519b,null))[_0x4ab5('0x4f')](handleError(_0xc3519b,null));};function widgetAttributes(_0x3520fe){try{switch(_0x3520fe[_0x4ab5('0x3a')]){case _0x4ab5('0x61'):return[{'name':_0x4ab5('0x62'),'value':_0x3520fe[_0x4ab5('0x62')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x0]?_0x3520fe['attrs'][0x0]['value']:undefined)||_0x4ab5('0x64')}];case _0x4ab5('0x65'):return[{'name':_0x4ab5('0x66'),'value':_0x3520fe[_0x4ab5('0x66')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe['attrs'][0x0]?_0x3520fe[_0x4ab5('0x63')][0x0][_0x4ab5('0x67')]:undefined)||''}];case _0x4ab5('0x68'):return[{'name':_0x4ab5('0x69'),'value':_0x3520fe[_0x4ab5('0x69')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x0]?_0x3520fe[_0x4ab5('0x63')][0x0][_0x4ab5('0x67')]:undefined)||_0x4ab5('0x6a')},{'name':_0x4ab5('0x6b'),'value':_0x3520fe[_0x4ab5('0x6b')]||(_0x3520fe['attrs']&&_0x3520fe['attrs'][0x1]?_0x3520fe['attrs'][0x1]['value']:undefined)||_0x4ab5('0x6c')},{'name':_0x4ab5('0x6d'),'value':_0x3520fe[_0x4ab5('0x6d')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe['attrs'][0x2]?_0x3520fe[_0x4ab5('0x63')][0x2][_0x4ab5('0x67')]:undefined)||0xc}];case'counter':return[{'name':_0x4ab5('0x6e'),'value':_0x3520fe[_0x4ab5('0x6e')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x0]?_0x3520fe['attrs'][0x0]['value']:undefined)||_0x4ab5('0x6f')},{'name':'attrVoiceQueues','value':_0x3520fe[_0x4ab5('0x70')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x1]?_0x3520fe['attrs'][0x1][_0x4ab5('0x67')]:undefined)||[]},{'name':_0x4ab5('0x6d'),'value':_0x3520fe[_0x4ab5('0x6d')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe['attrs'][0x2]?_0x3520fe[_0x4ab5('0x63')][0x2][_0x4ab5('0x67')]:undefined)||0x14},{'name':_0x4ab5('0x71'),'value':_0x3520fe[_0x4ab5('0x71')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe['attrs'][0x3]?_0x3520fe['attrs'][0x3][_0x4ab5('0x67')]:undefined)||_0x4ab5('0x72')},{'name':_0x4ab5('0x73'),'value':_0x3520fe[_0x4ab5('0x73')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x4]?_0x3520fe['attrs'][0x4]['value']:undefined)||''},{'name':_0x4ab5('0x74'),'value':_0x3520fe[_0x4ab5('0x74')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x5]?_0x3520fe[_0x4ab5('0x63')][0x5]['value']:undefined)||''},{'name':_0x4ab5('0x75'),'value':_0x3520fe[_0x4ab5('0x75')]||(_0x3520fe['attrs']&&_0x3520fe[_0x4ab5('0x63')][0x6]?_0x3520fe[_0x4ab5('0x63')][0x6][_0x4ab5('0x67')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3520fe[_0x4ab5('0x76')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x7]?_0x3520fe['attrs'][0x7][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x77'),'value':_0x3520fe['attrWhatsappAccounts']||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x8]?_0x3520fe['attrs'][0x8][_0x4ab5('0x67')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3520fe[_0x4ab5('0x78')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x9]?_0x3520fe[_0x4ab5('0x63')][0x9][_0x4ab5('0x67')]:undefined)||''}];case'multibar-chart':case _0x4ab5('0x79'):return[{'name':_0x4ab5('0x7a'),'value':_0x3520fe['attrSerie1']||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x0]?_0x3520fe[_0x4ab5('0x63')][0x0][_0x4ab5('0x67')]:undefined)||_0x4ab5('0x6f')},{'name':_0x4ab5('0x7b'),'value':_0x3520fe[_0x4ab5('0x7b')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x1]?_0x3520fe[_0x4ab5('0x63')][0x1][_0x4ab5('0x67')]:undefined)||null},{'name':'attrSerie3','value':_0x3520fe[_0x4ab5('0x7c')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x2]?_0x3520fe[_0x4ab5('0x63')][0x2][_0x4ab5('0x67')]:undefined)||null},{'name':_0x4ab5('0x70'),'value':_0x3520fe[_0x4ab5('0x70')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x3]?_0x3520fe[_0x4ab5('0x63')][0x3][_0x4ab5('0x67')]:undefined)||[]},{'name':_0x4ab5('0x71'),'value':_0x3520fe[_0x4ab5('0x71')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x4]?_0x3520fe[_0x4ab5('0x63')][0x4][_0x4ab5('0x67')]:undefined)||_0x4ab5('0x72')},{'name':'attrEmailAccounts','value':_0x3520fe[_0x4ab5('0x73')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x5]?_0x3520fe[_0x4ab5('0x63')][0x5][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x74'),'value':_0x3520fe['attrFaxAccounts']||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x6]?_0x3520fe[_0x4ab5('0x63')][0x6][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x75'),'value':_0x3520fe[_0x4ab5('0x75')]||(_0x3520fe['attrs']&&_0x3520fe[_0x4ab5('0x63')][0x7]?_0x3520fe[_0x4ab5('0x63')][0x7][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x76'),'value':_0x3520fe[_0x4ab5('0x76')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x8]?_0x3520fe['attrs'][0x8][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x77'),'value':_0x3520fe[_0x4ab5('0x77')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x9]?_0x3520fe['attrs'][0x9][_0x4ab5('0x67')]:undefined)||''},{'name':_0x4ab5('0x78'),'value':_0x3520fe[_0x4ab5('0x78')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0xa]?_0x3520fe[_0x4ab5('0x63')][0xa][_0x4ab5('0x67')]:undefined)||''}];case _0x4ab5('0x7d'):return[{'name':_0x4ab5('0x7e'),'type':_0x3520fe[_0x4ab5('0x7f')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe['attrs'][0x0]?_0x3520fe['attrs'][0x0][_0x4ab5('0x3a')]:undefined)||null,'value':_0x3520fe[_0x4ab5('0x7e')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x0]?_0x3520fe['attrs'][0x0][_0x4ab5('0x67')]:undefined)||null},{'name':_0x4ab5('0x80'),'value':_0x3520fe[_0x4ab5('0x80')]||(_0x3520fe[_0x4ab5('0x63')]&&_0x3520fe[_0x4ab5('0x63')][0x1]?_0x3520fe[_0x4ab5('0x63')][0x1][_0x4ab5('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x207c95){logger['error'](_0x4ab5('0x81'),JSON[_0x4ab5('0x82')](_0x207c95));return[];}}exports['addItem']=function(_0x9d3549,_0x1b4916,_0x37e5a0){if(_0x9d3549[_0x4ab5('0x60')]['id']){delete _0x9d3549[_0x4ab5('0x60')]['id'];}return db[_0x4ab5('0x37')][_0x4ab5('0x53')]({'where':{'id':_0x9d3549[_0x4ab5('0x51')]['id']}})[_0x4ab5('0x2d')](handleEntityNotFound(_0x1b4916,null))['then'](function(_0x37c479){if(_0x37c479){_0x9d3549['body'][_0x4ab5('0x83')]=_0x37c479['id'];_0x9d3549[_0x4ab5('0x60')][_0x4ab5('0x63')]=widgetAttributes(_0x9d3549['body']);return db[_0x4ab5('0x84')]['create'](_0x9d3549[_0x4ab5('0x60')]);}})[_0x4ab5('0x2d')](respondWithResult(_0x1b4916,null))[_0x4ab5('0x4f')](handleError(_0x1b4916,null));};exports[_0x4ab5('0x85')]=function(_0x3a0c30,_0x40e83e,_0x467c55){var _0x1e147c={};var _0x151c6d={};var _0x2981ed;var _0x4b0d49;return db[_0x4ab5('0x37')]['findOne']({'where':{'id':_0x3a0c30['params']['id']}})[_0x4ab5('0x2d')](handleEntityNotFound(_0x40e83e,null))[_0x4ab5('0x2d')](function(_0x42a349){if(_0x42a349){_0x2981ed=_0x42a349;_0x151c6d[_0x4ab5('0x3b')]=_[_0x4ab5('0x52')](db[_0x4ab5('0x84')]['rawAttributes']);_0x151c6d[_0x4ab5('0x3c')]=_[_0x4ab5('0x52')](_0x3a0c30[_0x4ab5('0x3c')]);_0x151c6d['filters']=_['intersection'](_0x151c6d[_0x4ab5('0x3b')],_0x151c6d[_0x4ab5('0x3c')]);_0x1e147c[_0x4ab5('0x3f')]=_[_0x4ab5('0x3e')](_0x151c6d[_0x4ab5('0x3b')],qs[_0x4ab5('0x40')](_0x3a0c30['query'][_0x4ab5('0x40')]));_0x1e147c['attributes']=_0x1e147c['attributes'][_0x4ab5('0x41')]?_0x1e147c[_0x4ab5('0x3f')]:_0x151c6d[_0x4ab5('0x3b')];_0x1e147c[_0x4ab5('0x86')]=qs[_0x4ab5('0x44')](_0x3a0c30[_0x4ab5('0x3c')][_0x4ab5('0x44')]);_0x1e147c[_0x4ab5('0x48')]=qs[_0x4ab5('0x3d')](_[_0x4ab5('0x45')](_0x3a0c30[_0x4ab5('0x3c')],_0x151c6d[_0x4ab5('0x3d')]));if(_0x3a0c30[_0x4ab5('0x3c')][_0x4ab5('0x46')]){_0x1e147c[_0x4ab5('0x48')]=_[_0x4ab5('0x47')](_0x1e147c[_0x4ab5('0x48')],{'$or':_[_0x4ab5('0x36')](_0x1e147c[_0x4ab5('0x3f')],function(_0x513e3e){var _0x54d0b3={};_0x54d0b3[_0x513e3e]={'$like':'%'+_0x3a0c30[_0x4ab5('0x3c')][_0x4ab5('0x46')]+'%'};return _0x54d0b3;})});}_0x1e147c=_['merge']({},_0x1e147c,_0x3a0c30[_0x4ab5('0x4a')]);return _0x2981ed[_0x4ab5('0x85')](_0x1e147c);}})['then'](function(_0x13e931){if(_0x13e931){_0x4b0d49=_0x13e931['length'];if(!_0x3a0c30[_0x4ab5('0x3c')][_0x4ab5('0x42')](_0x4ab5('0x43'))){_0x1e147c['limit']=qs[_0x4ab5('0x24')](_0x3a0c30[_0x4ab5('0x3c')][_0x4ab5('0x24')]);_0x1e147c['offset']=qs[_0x4ab5('0x23')](_0x3a0c30[_0x4ab5('0x3c')]['offset']);}return _0x2981ed[_0x4ab5('0x85')](_0x1e147c);}})['then'](function(_0x151be0){if(_0x151be0){return _0x151be0?{'count':_0x4b0d49,'rows':_0x151be0}:null;}})['then'](respondWithResult(_0x40e83e,null))[_0x4ab5('0x4f')](handleError(_0x40e83e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 5bc9597..cc06ed8 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 _0xe1fc=['exports','events','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1be7b7,_0x182b3e){var _0x1aed09=function(_0x46e1d7){while(--_0x46e1d7){_0x1be7b7['push'](_0x1be7b7['shift']());}};_0x1aed09(++_0x182b3e);}(_0xe1fc,0x155));var _0xce1f=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xe1fc[_0x4b03c9];return _0x161ba2;};'use strict';var EventEmitter=require(_0xce1f('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xce1f('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xce1f('0x2')](0x0);var events={'afterCreate':_0xce1f('0x3'),'afterUpdate':_0xce1f('0x4'),'afterDestroy':_0xce1f('0x5')};function emitEvent(_0x41450f){return function(_0x2e242d,_0x5dbdd0,_0x1422c0){DashboardEvents[_0xce1f('0x6')](_0x41450f+':'+_0x2e242d['id'],_0x2e242d);DashboardEvents[_0xce1f('0x6')](_0x41450f,_0x2e242d);_0x1422c0(null);};}for(var e in events){if(events[_0xce1f('0x7')](e)){var event=events[e];Dashboard[_0xce1f('0x8')](e,emitEvent(event));}}module[_0xce1f('0x9')]=DashboardEvents; \ No newline at end of file +var _0x339d=['Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xb1c7f2,_0x4528a2){var _0x3fc9b2=function(_0x58aa8d){while(--_0x58aa8d){_0xb1c7f2['push'](_0xb1c7f2['shift']());}};_0x3fc9b2(++_0x4528a2);}(_0x339d,0x14c));var _0xd339=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x339d[_0x1a0daa];return _0x1dbe15;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xd339('0x0'))['db'][_0xd339('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd339('0x2')](0x0);var events={'afterCreate':_0xd339('0x3'),'afterUpdate':'update','afterDestroy':_0xd339('0x4')};function emitEvent(_0xf4d9bd){return function(_0xd0c398,_0x4202b6,_0x3a4180){DashboardEvents[_0xd339('0x5')](_0xf4d9bd+':'+_0xd0c398['id'],_0xd0c398);DashboardEvents[_0xd339('0x5')](_0xf4d9bd,_0xd0c398);_0x3a4180(null);};}for(var e in events){if(events[_0xd339('0x6')](e)){var event=events[e];Dashboard[_0xd339('0x7')](e,emitEvent(event));}}module[_0xd339('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 077eea5..9d90969 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 _0x8f7c=['request-promise','path','rimraf','exports','define','Dashboard','dashboards','lodash','util','moment'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x8f7c,0x133));var _0xc8f7=function(_0x382dcc,_0x3eba4d){_0x382dcc=_0x382dcc-0x0;var _0x744637=_0x8f7c[_0x382dcc];return _0x744637;};'use strict';var _=require(_0xc8f7('0x0'));var util=require(_0xc8f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc8f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xc8f7('0x3'));var fs=require('fs');var path=require(_0xc8f7('0x4'));var rimraf=require(_0xc8f7('0x5'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xc8f7('0x6')]=function(_0x5359e2,_0x208459){return _0x5359e2[_0xc8f7('0x7')](_0xc8f7('0x8'),attributes,{'tableName':_0xc8f7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x940d=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','api','moment','bluebird'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x940d,0x181));var _0xd940=function(_0x2e93bd,_0x472c56){_0x2e93bd=_0x2e93bd-0x0;var _0x5414ce=_0x940d[_0x2e93bd];return _0x5414ce;};'use strict';var _=require(_0xd940('0x0'));var util=require(_0xd940('0x1'));var logger=require('../../config/logger')(_0xd940('0x2'));var moment=require(_0xd940('0x3'));var BPromise=require(_0xd940('0x4'));var rp=require(_0xd940('0x5'));var fs=require('fs');var path=require(_0xd940('0x6'));var rimraf=require(_0xd940('0x7'));var config=require(_0xd940('0x8'));var attributes=require(_0xd940('0x9'));module['exports']=function(_0x66d36b,_0x435036){return _0x66d36b[_0xd940('0xa')](_0xd940('0xb'),attributes,{'tableName':_0xd940('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f936f0b..9563525 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 _0xaa3e=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x122b3d,_0x4b12e8){var _0x2c7c43=function(_0x2e7662){while(--_0x2e7662){_0x122b3d['push'](_0x122b3d['shift']());}};_0x2c7c43(++_0x4b12e8);}(_0xaa3e,0x1b4));var _0xeaa3=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xaa3e[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xeaa3('0x0'));var util=require(_0xeaa3('0x1'));var moment=require(_0xeaa3('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaa3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaa3('0x4'))['db'];var utils=require(_0xeaa3('0x5'));var logger=require(_0xeaa3('0x6'))(_0xeaa3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xeaa3('0x8')]=_[_0xeaa3('0x9')](config[_0xeaa3('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xeaa3('0xa'))(new Redis(config[_0xeaa3('0x8')]));require(_0xeaa3('0xb'))[_0xeaa3('0xc')](socket);function respondWithRpcPromise(_0x4a7a8d,_0x580f3b,_0x42a1cb){return new BPromise(function(_0x18ca69,_0x5d1df4){return client['request'](_0x4a7a8d,_0x42a1cb)[_0xeaa3('0xd')](function(_0x5b6ad6){logger[_0xeaa3('0xe')](_0xeaa3('0xf'),_0x580f3b,_0xeaa3('0x10'));logger['debug'](_0xeaa3('0x11'),_0x580f3b,'request\x20sent',JSON[_0xeaa3('0x12')](_0x5b6ad6));if(_0x5b6ad6[_0xeaa3('0x13')]){if(_0x5b6ad6[_0xeaa3('0x13')][_0xeaa3('0x14')]===0x1f4){logger['error'](_0xeaa3('0xf'),_0x580f3b,_0x5b6ad6['error'][_0xeaa3('0x15')]);return _0x5d1df4(_0x5b6ad6[_0xeaa3('0x13')][_0xeaa3('0x15')]);}logger['error'](_0xeaa3('0xf'),_0x580f3b,_0x5b6ad6['error'][_0xeaa3('0x15')]);return _0x18ca69(_0x5b6ad6['error'][_0xeaa3('0x15')]);}else{logger[_0xeaa3('0xe')](_0xeaa3('0xf'),_0x580f3b,_0xeaa3('0x10'));_0x18ca69(_0x5b6ad6[_0xeaa3('0x16')]['message']);}})['catch'](function(_0x1d55d1){logger[_0xeaa3('0x13')](_0xeaa3('0xf'),_0x580f3b,_0x1d55d1);_0x5d1df4(_0x1d55d1);});});} \ No newline at end of file +var _0x15c4=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3eaacf,_0x5f2511){var _0x74ce8=function(_0x40a490){while(--_0x40a490){_0x3eaacf['push'](_0x3eaacf['shift']());}};_0x74ce8(++_0x5f2511);}(_0x15c4,0x16e));var _0x415c=function(_0x8b3a2c,_0x58ed0b){_0x8b3a2c=_0x8b3a2c-0x0;var _0x40b721=_0x15c4[_0x8b3a2c];return _0x40b721;};'use strict';var _=require('lodash');var util=require(_0x415c('0x0'));var moment=require(_0x415c('0x1'));var BPromise=require('bluebird');var rs=require(_0x415c('0x2'));var fs=require('fs');var Redis=require(_0x415c('0x3'));var db=require(_0x415c('0x4'))['db'];var utils=require(_0x415c('0x5'));var logger=require(_0x415c('0x6'))('rpc');var config=require(_0x415c('0x7'));var jayson=require(_0x415c('0x8'));var client=jayson['client'][_0x415c('0x9')]({'port':0x232a});config['redis']=_[_0x415c('0xa')](config[_0x415c('0xb')],{'host':_0x415c('0xc'),'port':0x18eb});var socket=require(_0x415c('0xd'))(new Redis(config[_0x415c('0xb')]));require(_0x415c('0xe'))[_0x415c('0xf')](socket);function respondWithRpcPromise(_0x40e223,_0x6d2fb4,_0x19093a){return new BPromise(function(_0x9a72c0,_0x149ad8){return client['request'](_0x40e223,_0x19093a)[_0x415c('0x10')](function(_0x19883a){logger[_0x415c('0x11')](_0x415c('0x12'),_0x6d2fb4,_0x415c('0x13'));logger['debug'](_0x415c('0x14'),_0x6d2fb4,_0x415c('0x13'),JSON[_0x415c('0x15')](_0x19883a));if(_0x19883a[_0x415c('0x16')]){if(_0x19883a[_0x415c('0x16')]['code']===0x1f4){logger[_0x415c('0x16')](_0x415c('0x12'),_0x6d2fb4,_0x19883a[_0x415c('0x16')][_0x415c('0x17')]);return _0x149ad8(_0x19883a['error'][_0x415c('0x17')]);}logger[_0x415c('0x16')](_0x415c('0x12'),_0x6d2fb4,_0x19883a['error'][_0x415c('0x17')]);return _0x9a72c0(_0x19883a[_0x415c('0x16')][_0x415c('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x6d2fb4,_0x415c('0x13'));_0x9a72c0(_0x19883a[_0x415c('0x18')][_0x415c('0x17')]);}})[_0x415c('0x19')](function(_0x34b710){logger[_0x415c('0x16')]('Dashboard,\x20%s,\x20%s',_0x6d2fb4,_0x34b710);_0x149ad8(_0x34b710);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4c8e1b3..423dc81 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 _0x4887=['./dashboard.events','save','remove','update','emit','register'];(function(_0x287f0d,_0x5670e9){var _0x1e3b79=function(_0x56f14a){while(--_0x56f14a){_0x287f0d['push'](_0x287f0d['shift']());}};_0x1e3b79(++_0x5670e9);}(_0x4887,0x120));var _0x7488=function(_0x33812b,_0x500033){_0x33812b=_0x33812b-0x0;var _0x3531df=_0x4887[_0x33812b];return _0x3531df;};'use strict';var DashboardEvents=require(_0x7488('0x0'));var events=[_0x7488('0x1'),_0x7488('0x2'),_0x7488('0x3')];function createListener(_0x3d8a6b,_0x48eaaf){return function(_0x521cdb){_0x48eaaf[_0x7488('0x4')](_0x3d8a6b,_0x521cdb);};}function removeListener(_0x576ae7,_0x46b94f){return function(){DashboardEvents['removeListener'](_0x576ae7,_0x46b94f);};}exports[_0x7488('0x5')]=function(_0x556100){for(var _0x4ffa6c=0x0,_0x1a5b84=events['length'];_0x4ffa6c<_0x1a5b84;_0x4ffa6c++){var _0x373ce2=events[_0x4ffa6c];var _0xfec8c8=createListener('dashboard:'+_0x373ce2,_0x556100);DashboardEvents['on'](_0x373ce2,_0xfec8c8);}}; \ No newline at end of file +var _0xe3b7=['register','length','save','remove','update','emit','removeListener'];(function(_0x1bb691,_0x8b7003){var _0x571e3b=function(_0x35bc89){while(--_0x35bc89){_0x1bb691['push'](_0x1bb691['shift']());}};_0x571e3b(++_0x8b7003);}(_0xe3b7,0x19f));var _0x7e3b=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe3b7[_0x5608a3];return _0x1ed50a;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x7e3b('0x0'),_0x7e3b('0x1'),_0x7e3b('0x2')];function createListener(_0x246e8f,_0x585a9b){return function(_0x5d0ba5){_0x585a9b[_0x7e3b('0x3')](_0x246e8f,_0x5d0ba5);};}function removeListener(_0x51e69d,_0x3549a2){return function(){DashboardEvents[_0x7e3b('0x4')](_0x51e69d,_0x3549a2);};}exports[_0x7e3b('0x5')]=function(_0x567586){for(var _0x3ad216=0x0,_0x3fea9f=events[_0x7e3b('0x6')];_0x3ad216<_0x3fea9f;_0x3ad216++){var _0x4df5ee=events[_0x3ad216];var _0x159bae=createListener('dashboard:'+_0x4df5ee,_0x567586);DashboardEvents['on'](_0x4df5ee,_0x159bae);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 15e266f..ef5f0be 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 _0x0155=['../../config/environment','isAuthenticated','/:id','get','/:id/items','getItems','post','create','/:id/clone','clone','put','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x0155,0x175));var _0x5015=function(_0x4747e4,_0x2276b7){_0x4747e4=_0x4747e4-0x0;var _0x5cb40f=_0x0155[_0x4747e4];return _0x5cb40f;};'use strict';var multer=require('multer');var util=require(_0x5015('0x0'));var path=require(_0x5015('0x1'));var timeout=require('connect-timeout');var express=require(_0x5015('0x2'));var router=express[_0x5015('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5015('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5015('0x5'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x5015('0x6')](),controller['index']);router['get'](_0x5015('0x7'),auth[_0x5015('0x6')](),controller['show']);router[_0x5015('0x8')](_0x5015('0x9'),auth[_0x5015('0x6')](),controller[_0x5015('0xa')]);router[_0x5015('0xb')]('/',auth[_0x5015('0x6')](),controller[_0x5015('0xc')]);router[_0x5015('0xb')](_0x5015('0xd'),auth[_0x5015('0x6')](),controller[_0x5015('0xe')]);router['post'](_0x5015('0x9'),auth['isAuthenticated'](),controller['addItem']);router[_0x5015('0xf')]('/:id',auth[_0x5015('0x6')](),controller['update']);router['delete']('/:id',auth[_0x5015('0x6')](),controller[_0x5015('0x10')]);module[_0x5015('0x11')]=router; \ No newline at end of file +var _0x711a=['addItem','put','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone'];(function(_0x2992fc,_0x149db9){var _0x2f3183=function(_0x58f3e6){while(--_0x58f3e6){_0x2992fc['push'](_0x2992fc['shift']());}};_0x2f3183(++_0x149db9);}(_0x711a,0xf3));var _0xa711=function(_0x4f2d0b,_0x4f1701){_0x4f2d0b=_0x4f2d0b-0x0;var _0x4bb805=_0x711a[_0x4f2d0b];return _0x4bb805;};'use strict';var multer=require(_0xa711('0x0'));var util=require(_0xa711('0x1'));var path=require(_0xa711('0x2'));var timeout=require(_0xa711('0x3'));var express=require('express');var router=express[_0xa711('0x4')]();var fs_extra=require(_0xa711('0x5'));var auth=require(_0xa711('0x6'));var interaction=require(_0xa711('0x7'));var config=require(_0xa711('0x8'));var controller=require(_0xa711('0x9'));router[_0xa711('0xa')]('/',auth[_0xa711('0xb')](),controller[_0xa711('0xc')]);router[_0xa711('0xa')](_0xa711('0xd'),auth[_0xa711('0xb')](),controller[_0xa711('0xe')]);router[_0xa711('0xa')](_0xa711('0xf'),auth[_0xa711('0xb')](),controller[_0xa711('0x10')]);router['post']('/',auth[_0xa711('0xb')](),controller[_0xa711('0x11')]);router[_0xa711('0x12')](_0xa711('0x13'),auth['isAuthenticated'](),controller[_0xa711('0x14')]);router[_0xa711('0x12')](_0xa711('0xf'),auth[_0xa711('0xb')](),controller[_0xa711('0x15')]);router[_0xa711('0x16')](_0xa711('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa711('0xd'),auth[_0xa711('0xb')](),controller['destroy']);module[_0xa711('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 05ed76e..86c09b5 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 _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x54408c,_0x50f71a){var _0x5acf60=function(_0x5b03de){while(--_0x5b03de){_0x54408c['push'](_0x54408c['shift']());}};_0x5acf60(++_0x50f71a);}(_0x2ef3,0xba));var _0x32ef=function(_0x3261a3,_0x49e883){_0x3261a3=_0x3261a3-0x0;var _0x34142f=_0x2ef3[_0x3261a3];return _0x34142f;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x2a6f09,_0x3a2e71){var _0x19be70=function(_0x1de29a){while(--_0x1de29a){_0x2a6f09['push'](_0x2a6f09['shift']());}};_0x19be70(++_0x3a2e71);}(_0x2ef3,0xba));var _0x32ef=function(_0x463bf3,_0x8854d3){_0x463bf3=_0x463bf3-0x0;var _0x23a434=_0x2ef3[_0x463bf3];return _0x23a434;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'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 26df110..1fb045d 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 _0x9485=['catch','type','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','keys','DashboardItem','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','merge','find','destroy','params'];(function(_0x787d44,_0x36fea9){var _0x1c1430=function(_0x18bcd6){while(--_0x18bcd6){_0x787d44['push'](_0x787d44['shift']());}};_0x1c1430(++_0x36fea9);}(_0x9485,0x8b));var _0x5948=function(_0x13fbd6,_0x33957e){_0x13fbd6=_0x13fbd6-0x0;var _0x5a9d7d=_0x9485[_0x13fbd6];return _0x5a9d7d;};'use strict';var emlformat=require(_0x5948('0x0'));var rimraf=require(_0x5948('0x1'));var zipdir=require(_0x5948('0x2'));var jsonpatch=require(_0x5948('0x3'));var rp=require('request-promise');var moment=require(_0x5948('0x4'));var BPromise=require(_0x5948('0x5'));var Mustache=require(_0x5948('0x6'));var util=require('util');var path=require(_0x5948('0x7'));var sox=require(_0x5948('0x8'));var csv=require(_0x5948('0x9'));var ejs=require(_0x5948('0xa'));var fs=require('fs');var fs_extra=require(_0x5948('0xb'));var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0x9'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var hardwareService=require(_0x5948('0x13'));var logger=require(_0x5948('0x14'))(_0x5948('0x15'));var utils=require(_0x5948('0x16'));var config=require(_0x5948('0x17'));var licenseUtil=require(_0x5948('0x18'));var db=require(_0x5948('0x19'))['db'];config[_0x5948('0x1a')]=_[_0x5948('0x1b')](config['redis'],{'host':_0x5948('0x1c'),'port':0x18eb});var socket=require(_0x5948('0x1d'))(new Redis(config[_0x5948('0x1a')]));require(_0x5948('0x1e'))[_0x5948('0x1f')](socket);function respondWithStatusCode(_0x2fdc7d,_0x28b4f3){_0x28b4f3=_0x28b4f3||0xcc;return function(_0x36fd89){if(_0x36fd89){return _0x2fdc7d[_0x5948('0x20')](_0x28b4f3);}return _0x2fdc7d[_0x5948('0x21')](_0x28b4f3)[_0x5948('0x22')]();};}function respondWithResult(_0x203968,_0x1cc566){_0x1cc566=_0x1cc566||0xc8;return function(_0xf46ff8){if(_0xf46ff8){return _0x203968[_0x5948('0x21')](_0x1cc566)['json'](_0xf46ff8);}};}function respondWithFilteredResult(_0x4d711a,_0x5f42db){return function(_0xbdd336){if(_0xbdd336){var _0x284c1a=typeof _0x5f42db[_0x5948('0x23')]===_0x5948('0x24')&&typeof _0x5f42db[_0x5948('0x25')]===_0x5948('0x24');var _0x4d64ea=_0xbdd336[_0x5948('0x26')];var _0x1c7419=_0x284c1a?0x0:_0x5f42db[_0x5948('0x23')];var _0x392397=_0x284c1a?_0xbdd336['count']:_0x5f42db[_0x5948('0x23')]+_0x5f42db[_0x5948('0x25')];var _0xfd26da;if(_0x392397>=_0x4d64ea){_0x392397=_0x4d64ea;_0xfd26da=0xc8;}else{_0xfd26da=0xce;}_0x4d711a[_0x5948('0x21')](_0xfd26da);return _0x4d711a[_0x5948('0x27')](_0x5948('0x28'),_0x1c7419+'-'+_0x392397+'/'+_0x4d64ea)[_0x5948('0x29')](_0xbdd336);}return null;};}function patchUpdates(_0x319876){return function(_0x2cb132){try{jsonpatch[_0x5948('0x2a')](_0x2cb132,_0x319876,!![]);}catch(_0x5b5061){return BPromise[_0x5948('0x2b')](_0x5b5061);}return _0x2cb132['save']();};}function saveUpdates(_0x255228,_0x15b8da){return function(_0x47374f){if(_0x47374f){return _0x47374f[_0x5948('0x2c')](_0x255228)[_0x5948('0x2d')](function(_0x4164bf){return _0x4164bf;});}return null;};}function removeEntity(_0x1db063,_0xcfc1d7){return function(_0x5a3a68){if(_0x5a3a68){return _0x5a3a68['destroy']()['then'](function(){_0x1db063[_0x5948('0x21')](0xcc)[_0x5948('0x22')]();});}};}function handleEntityNotFound(_0xe4629a,_0x499c35){return function(_0x4a9630){if(!_0x4a9630){_0xe4629a[_0x5948('0x20')](0x194);}return _0x4a9630;};}function handleError(_0x47b55e,_0xc03d2c){_0xc03d2c=_0xc03d2c||0x1f4;return function(_0x5e5ef3){logger[_0x5948('0x2e')](_0x5e5ef3[_0x5948('0x2f')]);if(_0x5e5ef3[_0x5948('0x30')]){delete _0x5e5ef3[_0x5948('0x30')];}_0x47b55e[_0x5948('0x21')](_0xc03d2c)[_0x5948('0x31')](_0x5e5ef3);};}exports['show']=function(_0x47e0b6,_0x2c9219){var _0x67d341={'raw':![],'where':{'id':_0x47e0b6['params']['id']}},_0x4a6740={};_0x4a6740['model']=_[_0x5948('0x32')](db[_0x5948('0x33')][_0x5948('0x34')]);_0x4a6740[_0x5948('0x35')]=_['keys'](_0x47e0b6['query']);_0x4a6740[_0x5948('0x36')]=_['intersection'](_0x4a6740[_0x5948('0x37')],_0x4a6740['query']);_0x67d341[_0x5948('0x38')]=_[_0x5948('0x39')](_0x4a6740[_0x5948('0x37')],qs[_0x5948('0x3a')](_0x47e0b6[_0x5948('0x35')][_0x5948('0x3a')]));_0x67d341[_0x5948('0x38')]=_0x67d341[_0x5948('0x38')][_0x5948('0x3b')]?_0x67d341[_0x5948('0x38')]:_0x4a6740['model'];if(_0x47e0b6[_0x5948('0x35')][_0x5948('0x3c')]){_0x67d341['include']=[{'all':!![]}];}_0x67d341=_[_0x5948('0x3d')]({},_0x67d341,_0x47e0b6['options']);return db[_0x5948('0x33')][_0x5948('0x3e')](_0x67d341)['then'](handleEntityNotFound(_0x2c9219,null))[_0x5948('0x2d')](respondWithResult(_0x2c9219,null))['catch'](handleError(_0x2c9219,null));};exports[_0x5948('0x3f')]=function(_0x4293dc,_0x112a03){return db[_0x5948('0x33')][_0x5948('0x3e')]({'where':{'id':_0x4293dc[_0x5948('0x40')]['id']}})[_0x5948('0x2d')](handleEntityNotFound(_0x112a03,null))[_0x5948('0x2d')](removeEntity(_0x112a03,null))[_0x5948('0x41')](handleError(_0x112a03,null));};function widgetAttributes(_0x85f427){try{switch(_0x85f427[_0x5948('0x42')]){case'iframe':return[{'name':'attrUrl','value':_0x85f427['attrUrl']||(_0x85f427['attrs']&&_0x85f427['attrs'][0x0]?_0x85f427[_0x5948('0x43')][0x0][_0x5948('0x44')]:undefined)||_0x5948('0x45')}];case'custom':return[{'name':_0x5948('0x46'),'value':_0x85f427[_0x5948('0x46')]||(_0x85f427['attrs']&&_0x85f427[_0x5948('0x43')][0x0]?_0x85f427['attrs'][0x0][_0x5948('0x44')]:undefined)||''}];case _0x5948('0x47'):return[{'name':_0x5948('0x48'),'value':_0x85f427[_0x5948('0x48')]||(_0x85f427['attrs']&&_0x85f427[_0x5948('0x43')][0x0]?_0x85f427['attrs'][0x0][_0x5948('0x44')]:undefined)||_0x5948('0x49')},{'name':_0x5948('0x4a'),'value':_0x85f427[_0x5948('0x4a')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x1]?_0x85f427[_0x5948('0x43')][0x1][_0x5948('0x44')]:undefined)||_0x5948('0x4b')},{'name':_0x5948('0x4c'),'value':_0x85f427[_0x5948('0x4c')]||(_0x85f427['attrs']&&_0x85f427[_0x5948('0x43')][0x2]?_0x85f427[_0x5948('0x43')][0x2][_0x5948('0x44')]:undefined)||0xc}];case _0x5948('0x4d'):return[{'name':_0x5948('0x4e'),'value':_0x85f427[_0x5948('0x4e')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x0]?_0x85f427[_0x5948('0x43')][0x0][_0x5948('0x44')]:undefined)||_0x5948('0x4f')},{'name':'attrVoiceQueues','value':_0x85f427[_0x5948('0x50')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x1]?_0x85f427[_0x5948('0x43')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x85f427[_0x5948('0x4c')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0x2]?_0x85f427[_0x5948('0x43')][0x2]['value']:undefined)||0x14},{'name':_0x5948('0x51'),'value':_0x85f427[_0x5948('0x51')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x3]?_0x85f427['attrs'][0x3][_0x5948('0x44')]:undefined)||_0x5948('0x52')},{'name':_0x5948('0x53'),'value':_0x85f427['attrEmailAccounts']||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x4]?_0x85f427['attrs'][0x4][_0x5948('0x44')]:undefined)||''},{'name':_0x5948('0x54'),'value':_0x85f427[_0x5948('0x54')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x5]?_0x85f427['attrs'][0x5][_0x5948('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x85f427[_0x5948('0x55')]||(_0x85f427['attrs']&&_0x85f427[_0x5948('0x43')][0x6]?_0x85f427[_0x5948('0x43')][0x6][_0x5948('0x44')]:undefined)||''},{'name':_0x5948('0x56'),'value':_0x85f427[_0x5948('0x56')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x7]?_0x85f427[_0x5948('0x43')][0x7][_0x5948('0x44')]:undefined)||''},{'name':_0x5948('0x57'),'value':_0x85f427[_0x5948('0x57')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x8]?_0x85f427[_0x5948('0x43')][0x8][_0x5948('0x44')]:undefined)||''},{'name':_0x5948('0x58'),'value':_0x85f427[_0x5948('0x58')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x9]?_0x85f427[_0x5948('0x43')][0x9][_0x5948('0x44')]:undefined)||''}];case _0x5948('0x59'):case _0x5948('0x5a'):return[{'name':_0x5948('0x5b'),'value':_0x85f427['attrSerie1']||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x0]?_0x85f427['attrs'][0x0][_0x5948('0x44')]:undefined)||'total'},{'name':_0x5948('0x5c'),'value':_0x85f427[_0x5948('0x5c')]||(_0x85f427['attrs']&&_0x85f427[_0x5948('0x43')][0x1]?_0x85f427[_0x5948('0x43')][0x1]['value']:undefined)||null},{'name':_0x5948('0x5d'),'value':_0x85f427[_0x5948('0x5d')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x2]?_0x85f427[_0x5948('0x43')][0x2][_0x5948('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x85f427['attrVoiceQueues']||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x3]?_0x85f427['attrs'][0x3][_0x5948('0x44')]:undefined)||[]},{'name':_0x5948('0x51'),'value':_0x85f427['attrChannel']||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x4]?_0x85f427[_0x5948('0x43')][0x4][_0x5948('0x44')]:undefined)||'voice'},{'name':_0x5948('0x53'),'value':_0x85f427[_0x5948('0x53')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x5]?_0x85f427[_0x5948('0x43')][0x5]['value']:undefined)||''},{'name':_0x5948('0x54'),'value':_0x85f427[_0x5948('0x54')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x6]?_0x85f427[_0x5948('0x43')][0x6][_0x5948('0x44')]:undefined)||''},{'name':_0x5948('0x55'),'value':_0x85f427[_0x5948('0x55')]||(_0x85f427['attrs']&&_0x85f427['attrs'][0x7]?_0x85f427[_0x5948('0x43')][0x7]['value']:undefined)||''},{'name':_0x5948('0x56'),'value':_0x85f427['attrOpenchannelAccounts']||(_0x85f427[_0x5948('0x43')]&&_0x85f427[_0x5948('0x43')][0x8]?_0x85f427[_0x5948('0x43')][0x8]['value']:undefined)||''},{'name':_0x5948('0x57'),'value':_0x85f427[_0x5948('0x57')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0x9]?_0x85f427[_0x5948('0x43')][0x9][_0x5948('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x85f427[_0x5948('0x58')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0xa]?_0x85f427[_0x5948('0x43')][0xa][_0x5948('0x44')]:undefined)||''}];case _0x5948('0x5e'):return[{'name':_0x5948('0x5f'),'type':_0x85f427[_0x5948('0x60')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0x0]?_0x85f427[_0x5948('0x43')][0x0]['type']:undefined)||null,'value':_0x85f427[_0x5948('0x5f')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0x0]?_0x85f427['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x85f427[_0x5948('0x61')]||(_0x85f427[_0x5948('0x43')]&&_0x85f427['attrs'][0x1]?_0x85f427[_0x5948('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x47a5de){logger[_0x5948('0x2e')](_0x5948('0x62'),JSON[_0x5948('0x63')](_0x47a5de));return[];}}exports[_0x5948('0x64')]=function(_0x34bc6a,_0x3910b6){if(_0x34bc6a[_0x5948('0x65')]){_0x34bc6a[_0x5948('0x65')]['attrs']=widgetAttributes(_0x34bc6a[_0x5948('0x65')]);}return db[_0x5948('0x33')]['create'](_0x34bc6a['body'],{})[_0x5948('0x2d')](respondWithResult(_0x3910b6,0xc9))['catch'](handleError(_0x3910b6,null));};exports[_0x5948('0x2c')]=function(_0x585989,_0x18ac87){if(_0x585989[_0x5948('0x65')]['id']){delete _0x585989['body']['id'];}_0x585989['body']['attrs']=widgetAttributes(_0x585989[_0x5948('0x65')]);return db[_0x5948('0x33')][_0x5948('0x3e')]({'where':{'id':_0x585989[_0x5948('0x40')]['id']}})[_0x5948('0x2d')](handleEntityNotFound(_0x18ac87,null))[_0x5948('0x2d')](saveUpdates(_0x585989[_0x5948('0x65')],null))[_0x5948('0x2d')](respondWithResult(_0x18ac87,null))[_0x5948('0x41')](handleError(_0x18ac87,null));}; \ No newline at end of file +var _0xaafc=['crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','params','model','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','find','destroy','catch','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','attrFaxAccounts','web-report','attrReport','type','attrRefresh','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0xaafc,0x176));var _0xcaaf=function(_0x4188af,_0x35a3a4){_0x4188af=_0x4188af-0x0;var _0xe25423=_0xaafc[_0x4188af];return _0xe25423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaaf('0x0'));var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require(_0xcaaf('0x2'));var rp=require(_0xcaaf('0x3'));var moment=require('moment');var BPromise=require(_0xcaaf('0x4'));var Mustache=require(_0xcaaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcaaf('0x6'));var csv=require('to-csv');var ejs=require(_0xcaaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaaf('0x8'));var squel=require(_0xcaaf('0x9'));var crypto=require(_0xcaaf('0xa'));var jsforce=require(_0xcaaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcaaf('0xc'));var querystring=require('querystring');var Papa=require(_0xcaaf('0xd'));var Redis=require('ioredis');var authService=require(_0xcaaf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaaf('0xf'));var hardwareService=require(_0xcaaf('0x10'));var logger=require(_0xcaaf('0x11'))(_0xcaaf('0x12'));var utils=require(_0xcaaf('0x13'));var config=require(_0xcaaf('0x14'));var licenseUtil=require(_0xcaaf('0x15'));var db=require(_0xcaaf('0x16'))['db'];config[_0xcaaf('0x17')]=_['defaults'](config[_0xcaaf('0x17')],{'host':_0xcaaf('0x18'),'port':0x18eb});var socket=require(_0xcaaf('0x19'))(new Redis(config[_0xcaaf('0x17')]));require(_0xcaaf('0x1a'))[_0xcaaf('0x1b')](socket);function respondWithStatusCode(_0x6afc3,_0x439c40){_0x439c40=_0x439c40||0xcc;return function(_0x42861d){if(_0x42861d){return _0x6afc3[_0xcaaf('0x1c')](_0x439c40);}return _0x6afc3[_0xcaaf('0x1d')](_0x439c40)['end']();};}function respondWithResult(_0x301344,_0xb8532b){_0xb8532b=_0xb8532b||0xc8;return function(_0x7f23fb){if(_0x7f23fb){return _0x301344[_0xcaaf('0x1d')](_0xb8532b)[_0xcaaf('0x1e')](_0x7f23fb);}};}function respondWithFilteredResult(_0x360078,_0x4b55e3){return function(_0xf8e303){if(_0xf8e303){var _0x10ad54=typeof _0x4b55e3['offset']===_0xcaaf('0x1f')&&typeof _0x4b55e3[_0xcaaf('0x20')]===_0xcaaf('0x1f');var _0x43631b=_0xf8e303[_0xcaaf('0x21')];var _0x535eb8=_0x10ad54?0x0:_0x4b55e3[_0xcaaf('0x22')];var _0x731e33=_0x10ad54?_0xf8e303[_0xcaaf('0x21')]:_0x4b55e3[_0xcaaf('0x22')]+_0x4b55e3[_0xcaaf('0x20')];var _0x5bdc7a;if(_0x731e33>=_0x43631b){_0x731e33=_0x43631b;_0x5bdc7a=0xc8;}else{_0x5bdc7a=0xce;}_0x360078[_0xcaaf('0x1d')](_0x5bdc7a);return _0x360078[_0xcaaf('0x23')](_0xcaaf('0x24'),_0x535eb8+'-'+_0x731e33+'/'+_0x43631b)[_0xcaaf('0x1e')](_0xf8e303);}return null;};}function patchUpdates(_0x359339){return function(_0x16f83d){try{jsonpatch[_0xcaaf('0x25')](_0x16f83d,_0x359339,!![]);}catch(_0x5e0463){return BPromise[_0xcaaf('0x26')](_0x5e0463);}return _0x16f83d[_0xcaaf('0x27')]();};}function saveUpdates(_0x3f62c8,_0x4c1dcd){return function(_0x34f878){if(_0x34f878){return _0x34f878[_0xcaaf('0x28')](_0x3f62c8)[_0xcaaf('0x29')](function(_0x3dac7d){return _0x3dac7d;});}return null;};}function removeEntity(_0x2a6d15,_0x4346e2){return function(_0x1cc1fb){if(_0x1cc1fb){return _0x1cc1fb['destroy']()[_0xcaaf('0x29')](function(){_0x2a6d15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x548b1d,_0x30d68a){return function(_0x85b4a){if(!_0x85b4a){_0x548b1d[_0xcaaf('0x1c')](0x194);}return _0x85b4a;};}function handleError(_0x84f284,_0xc98ce4){_0xc98ce4=_0xc98ce4||0x1f4;return function(_0x35e500){logger[_0xcaaf('0x2a')](_0x35e500[_0xcaaf('0x2b')]);if(_0x35e500[_0xcaaf('0x2c')]){delete _0x35e500['name'];}_0x84f284['status'](_0xc98ce4)[_0xcaaf('0x2d')](_0x35e500);};}exports['show']=function(_0x4429e3,_0x58c170){var _0x343cd5={'raw':![],'where':{'id':_0x4429e3[_0xcaaf('0x2e')]['id']}},_0x10fec3={};_0x10fec3[_0xcaaf('0x2f')]=_['keys'](db[_0xcaaf('0x30')][_0xcaaf('0x31')]);_0x10fec3[_0xcaaf('0x32')]=_['keys'](_0x4429e3['query']);_0x10fec3[_0xcaaf('0x33')]=_[_0xcaaf('0x34')](_0x10fec3['model'],_0x10fec3[_0xcaaf('0x32')]);_0x343cd5[_0xcaaf('0x35')]=_[_0xcaaf('0x34')](_0x10fec3[_0xcaaf('0x2f')],qs[_0xcaaf('0x36')](_0x4429e3[_0xcaaf('0x32')][_0xcaaf('0x36')]));_0x343cd5[_0xcaaf('0x35')]=_0x343cd5[_0xcaaf('0x35')]['length']?_0x343cd5['attributes']:_0x10fec3[_0xcaaf('0x2f')];if(_0x4429e3['query'][_0xcaaf('0x37')]){_0x343cd5[_0xcaaf('0x38')]=[{'all':!![]}];}_0x343cd5=_[_0xcaaf('0x39')]({},_0x343cd5,_0x4429e3['options']);return db['DashboardItem'][_0xcaaf('0x3a')](_0x343cd5)[_0xcaaf('0x29')](handleEntityNotFound(_0x58c170,null))['then'](respondWithResult(_0x58c170,null))['catch'](handleError(_0x58c170,null));};exports[_0xcaaf('0x3b')]=function(_0x12a4fc,_0x3573b3){return db['DashboardItem'][_0xcaaf('0x3a')]({'where':{'id':_0x12a4fc['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3573b3,null))['then'](removeEntity(_0x3573b3,null))[_0xcaaf('0x3c')](handleError(_0x3573b3,null));};function widgetAttributes(_0x44abfd){try{switch(_0x44abfd['type']){case'iframe':return[{'name':_0xcaaf('0x3d'),'value':_0x44abfd[_0xcaaf('0x3d')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x3f')}];case'custom':return[{'name':_0xcaaf('0x40'),'value':_0x44abfd[_0xcaaf('0x40')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||''}];case _0xcaaf('0x42'):return[{'name':_0xcaaf('0x43'),'value':_0x44abfd[_0xcaaf('0x43')]||(_0x44abfd['attrs']&&_0x44abfd['attrs'][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x44')},{'name':'attrTimezone','value':_0x44abfd[_0xcaaf('0x45')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd[_0xcaaf('0x3e')][0x1]['value']:undefined)||_0xcaaf('0x46')},{'name':_0xcaaf('0x47'),'value':_0x44abfd['attrFontSize']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd[_0xcaaf('0x3e')][0x2][_0xcaaf('0x41')]:undefined)||0xc}];case _0xcaaf('0x48'):return[{'name':_0xcaaf('0x49'),'value':_0x44abfd[_0xcaaf('0x49')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4a')},{'name':_0xcaaf('0x4b'),'value':_0x44abfd[_0xcaaf('0x4b')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x44abfd['attrFontSize']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd[_0xcaaf('0x3e')][0x2][_0xcaaf('0x41')]:undefined)||0x14},{'name':'attrChannel','value':_0x44abfd['attrChannel']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x3]?_0x44abfd[_0xcaaf('0x3e')][0x3][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4c')},{'name':_0xcaaf('0x4d'),'value':_0x44abfd[_0xcaaf('0x4d')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x4]?_0x44abfd[_0xcaaf('0x3e')][0x4][_0xcaaf('0x41')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x44abfd['attrFaxAccounts']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x5]?_0x44abfd[_0xcaaf('0x3e')][0x5]['value']:undefined)||''},{'name':_0xcaaf('0x4e'),'value':_0x44abfd['attrSmsAccounts']||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x6]?_0x44abfd[_0xcaaf('0x3e')][0x6][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x4f'),'value':_0x44abfd[_0xcaaf('0x4f')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x7]?_0x44abfd['attrs'][0x7][_0xcaaf('0x41')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x44abfd[_0xcaaf('0x50')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x8]?_0x44abfd[_0xcaaf('0x3e')][0x8]['value']:undefined)||''},{'name':_0xcaaf('0x51'),'value':_0x44abfd['attrChatWebsites']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x9]?_0x44abfd[_0xcaaf('0x3e')][0x9][_0xcaaf('0x41')]:undefined)||''}];case _0xcaaf('0x52'):case _0xcaaf('0x53'):return[{'name':_0xcaaf('0x54'),'value':_0x44abfd[_0xcaaf('0x54')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0]['value']:undefined)||_0xcaaf('0x4a')},{'name':'attrSerie2','value':_0x44abfd[_0xcaaf('0x55')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x1]?_0x44abfd[_0xcaaf('0x3e')][0x1][_0xcaaf('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x44abfd[_0xcaaf('0x56')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x2]?_0x44abfd['attrs'][0x2][_0xcaaf('0x41')]:undefined)||null},{'name':_0xcaaf('0x4b'),'value':_0x44abfd[_0xcaaf('0x4b')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x3]?_0x44abfd[_0xcaaf('0x3e')][0x3][_0xcaaf('0x41')]:undefined)||[]},{'name':_0xcaaf('0x57'),'value':_0x44abfd[_0xcaaf('0x57')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x4]?_0x44abfd['attrs'][0x4][_0xcaaf('0x41')]:undefined)||_0xcaaf('0x4c')},{'name':_0xcaaf('0x4d'),'value':_0x44abfd[_0xcaaf('0x4d')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x5]?_0x44abfd[_0xcaaf('0x3e')][0x5][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x58'),'value':_0x44abfd[_0xcaaf('0x58')]||(_0x44abfd['attrs']&&_0x44abfd['attrs'][0x6]?_0x44abfd[_0xcaaf('0x3e')][0x6][_0xcaaf('0x41')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x44abfd[_0xcaaf('0x4e')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd['attrs'][0x7]?_0x44abfd[_0xcaaf('0x3e')][0x7][_0xcaaf('0x41')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x44abfd[_0xcaaf('0x4f')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x8]?_0x44abfd['attrs'][0x8][_0xcaaf('0x41')]:undefined)||''},{'name':_0xcaaf('0x50'),'value':_0x44abfd[_0xcaaf('0x50')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x9]?_0x44abfd[_0xcaaf('0x3e')][0x9][_0xcaaf('0x41')]:undefined)||''},{'name':'attrChatWebsites','value':_0x44abfd['attrChatWebsites']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0xa]?_0x44abfd[_0xcaaf('0x3e')][0xa]['value']:undefined)||''}];case _0xcaaf('0x59'):return[{'name':_0xcaaf('0x5a'),'type':_0x44abfd['reportType']||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x5b')]:undefined)||null,'value':_0x44abfd[_0xcaaf('0x5a')]||(_0x44abfd['attrs']&&_0x44abfd[_0xcaaf('0x3e')][0x0]?_0x44abfd[_0xcaaf('0x3e')][0x0][_0xcaaf('0x41')]:undefined)||null},{'name':_0xcaaf('0x5c'),'value':_0x44abfd[_0xcaaf('0x5c')]||(_0x44abfd[_0xcaaf('0x3e')]&&_0x44abfd[_0xcaaf('0x3e')][0x1]?_0x44abfd['attrs'][0x1][_0xcaaf('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x50ddfc){logger[_0xcaaf('0x2a')]('widgetAttributes:\x20%s',JSON[_0xcaaf('0x5d')](_0x50ddfc));return[];}}exports[_0xcaaf('0x5e')]=function(_0x21b3bc,_0x28c1b8){if(_0x21b3bc[_0xcaaf('0x5f')]){_0x21b3bc[_0xcaaf('0x5f')]['attrs']=widgetAttributes(_0x21b3bc[_0xcaaf('0x5f')]);}return db[_0xcaaf('0x30')][_0xcaaf('0x5e')](_0x21b3bc[_0xcaaf('0x5f')],{})[_0xcaaf('0x29')](respondWithResult(_0x28c1b8,0xc9))[_0xcaaf('0x3c')](handleError(_0x28c1b8,null));};exports[_0xcaaf('0x28')]=function(_0xc56e47,_0x3ff275){if(_0xc56e47[_0xcaaf('0x5f')]['id']){delete _0xc56e47['body']['id'];}_0xc56e47[_0xcaaf('0x5f')]['attrs']=widgetAttributes(_0xc56e47[_0xcaaf('0x5f')]);return db[_0xcaaf('0x30')][_0xcaaf('0x3a')]({'where':{'id':_0xc56e47[_0xcaaf('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3ff275,null))[_0xcaaf('0x29')](saveUpdates(_0xc56e47[_0xcaaf('0x5f')],null))[_0xcaaf('0x29')](respondWithResult(_0x3ff275,null))[_0xcaaf('0x3c')](handleError(_0x3ff275,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index d03f550..1445328 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 _0x45a4=['remove','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x45a4,0xf3));var _0x445a=function(_0x15b2ff,_0x530d13){_0x15b2ff=_0x15b2ff-0x0;var _0x20b32a=_0x45a4[_0x15b2ff];return _0x20b32a;};'use strict';var EventEmitter=require(_0x445a('0x0'));var DashboardItem=require(_0x445a('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x445a('0x2')](0x0);var events={'afterCreate':_0x445a('0x3'),'afterUpdate':_0x445a('0x4'),'afterDestroy':_0x445a('0x5')};function emitEvent(_0x8956e2){return function(_0x4c8b6c,_0x29892d,_0x5dcce2){DashboardItemEvents['emit'](_0x8956e2+':'+_0x4c8b6c['id'],_0x4c8b6c);DashboardItemEvents['emit'](_0x8956e2,_0x4c8b6c);_0x5dcce2(null);};}for(var e in events){if(events[_0x445a('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x445a('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xd30f=['emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners','update','remove'];(function(_0xaa3856,_0x24fbc9){var _0x3a0f88=function(_0x8f773e){while(--_0x8f773e){_0xaa3856['push'](_0xaa3856['shift']());}};_0x3a0f88(++_0x24fbc9);}(_0xd30f,0x1bc));var _0xfd30=function(_0x47058d,_0x334adb){_0x47058d=_0x47058d-0x0;var _0x3720e6=_0xd30f[_0x47058d];return _0x3720e6;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xfd30('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xfd30('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfd30('0x2'),'afterDestroy':_0xfd30('0x3')};function emitEvent(_0x249f2e){return function(_0x29c02b,_0x3f13a2,_0x143a7c){DashboardItemEvents[_0xfd30('0x4')](_0x249f2e+':'+_0x29c02b['id'],_0x29c02b);DashboardItemEvents[_0xfd30('0x4')](_0x249f2e,_0x29c02b);_0x143a7c(null);};}for(var e in events){if(events[_0xfd30('0x5')](e)){var event=events[e];DashboardItem[_0xfd30('0x6')](e,emitEvent(event));}}module[_0xfd30('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 34469dc..c5fc098 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 _0x4703=['api','moment','bluebird','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger'];(function(_0x75076e,_0x336899){var _0xd90ee4=function(_0x1b58f8){while(--_0x1b58f8){_0x75076e['push'](_0x75076e['shift']());}};_0xd90ee4(++_0x336899);}(_0x4703,0xda));var _0x3470=function(_0x16f73d,_0x574564){_0x16f73d=_0x16f73d-0x0;var _0x39bbcf=_0x4703[_0x16f73d];return _0x39bbcf;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var logger=require(_0x3470('0x2'))(_0x3470('0x3'));var moment=require(_0x3470('0x4'));var BPromise=require(_0x3470('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3470('0x6'));var config=require(_0x3470('0x7'));var attributes=require(_0x3470('0x8'));module[_0x3470('0x9')]=function(_0x184fac,_0x55a269){return _0x184fac[_0x3470('0xa')](_0x3470('0xb'),attributes,{'tableName':_0x3470('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fa8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util'];(function(_0x17eaf7,_0x193666){var _0x58372c=function(_0x66cc4e){while(--_0x66cc4e){_0x17eaf7['push'](_0x17eaf7['shift']());}};_0x58372c(++_0x193666);}(_0x1fa8,0x1cc));var _0x81fa=function(_0x1560d9,_0x4736ed){_0x1560d9=_0x1560d9-0x0;var _0x2161ab=_0x1fa8[_0x1560d9];return _0x2161ab;};'use strict';var _=require(_0x81fa('0x0'));var util=require(_0x81fa('0x1'));var logger=require(_0x81fa('0x2'))('api');var moment=require(_0x81fa('0x3'));var BPromise=require(_0x81fa('0x4'));var rp=require(_0x81fa('0x5'));var fs=require('fs');var path=require(_0x81fa('0x6'));var rimraf=require(_0x81fa('0x7'));var config=require(_0x81fa('0x8'));var attributes=require(_0x81fa('0x9'));module[_0x81fa('0xa')]=function(_0x194cc6,_0x3acb95){return _0x194cc6[_0x81fa('0xb')](_0x81fa('0xc'),attributes,{'tableName':_0x81fa('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 2c29668..31ad5e1 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 _0x8392=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent'];(function(_0x10fc46,_0x3f47f1){var _0x4abc85=function(_0x189883){while(--_0x189883){_0x10fc46['push'](_0x10fc46['shift']());}};_0x4abc85(++_0x3f47f1);}(_0x8392,0xe9));var _0x2839=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8392[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2839('0x0'));var util=require(_0x2839('0x1'));var moment=require(_0x2839('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2839('0x3'));var db=require(_0x2839('0x4'))['db'];var utils=require(_0x2839('0x5'));var logger=require('../../config/logger')(_0x2839('0x6'));var config=require('../../config/environment');var jayson=require(_0x2839('0x7'));var client=jayson[_0x2839('0x8')][_0x2839('0x9')]({'port':0x232a});config[_0x2839('0xa')]=_[_0x2839('0xb')](config['redis'],{'host':_0x2839('0xc'),'port':0x18eb});var socket=require(_0x2839('0xd'))(new Redis(config[_0x2839('0xa')]));require(_0x2839('0xe'))[_0x2839('0xf')](socket);function respondWithRpcPromise(_0x511482,_0x19196d,_0xb658e5){return new BPromise(function(_0x4d1c32,_0x471975){return client['request'](_0x511482,_0xb658e5)[_0x2839('0x10')](function(_0x148638){logger[_0x2839('0x11')]('DashboardItem,\x20%s,\x20%s',_0x19196d,_0x2839('0x12'));logger[_0x2839('0x13')](_0x2839('0x14'),_0x19196d,_0x2839('0x12'),JSON[_0x2839('0x15')](_0x148638));if(_0x148638[_0x2839('0x16')]){if(_0x148638[_0x2839('0x16')][_0x2839('0x17')]===0x1f4){logger[_0x2839('0x16')](_0x2839('0x18'),_0x19196d,_0x148638[_0x2839('0x16')][_0x2839('0x19')]);return _0x471975(_0x148638[_0x2839('0x16')][_0x2839('0x19')]);}logger['error'](_0x2839('0x18'),_0x19196d,_0x148638['error'][_0x2839('0x19')]);return _0x4d1c32(_0x148638[_0x2839('0x16')]['message']);}else{logger[_0x2839('0x11')](_0x2839('0x18'),_0x19196d,'request\x20sent');_0x4d1c32(_0x148638[_0x2839('0x1a')][_0x2839('0x19')]);}})[_0x2839('0x1b')](function(_0x377e0d){logger['error']('DashboardItem,\x20%s,\x20%s',_0x19196d,_0x377e0d);_0x471975(_0x377e0d);});});} \ No newline at end of file +var _0xf625=['then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','register'];(function(_0xcf8f87,_0x5f5772){var _0x485b48=function(_0x621938){while(--_0x621938){_0xcf8f87['push'](_0xcf8f87['shift']());}};_0x485b48(++_0x5f5772);}(_0xf625,0x9a));var _0x5f62=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0xf625[_0x3feec6];return _0x56d5e2;};'use strict';var _=require(_0x5f62('0x0'));var util=require('util');var moment=require(_0x5f62('0x1'));var BPromise=require(_0x5f62('0x2'));var rs=require(_0x5f62('0x3'));var fs=require('fs');var Redis=require(_0x5f62('0x4'));var db=require(_0x5f62('0x5'))['db'];var utils=require(_0x5f62('0x6'));var logger=require(_0x5f62('0x7'))(_0x5f62('0x8'));var config=require(_0x5f62('0x9'));var jayson=require(_0x5f62('0xa'));var client=jayson[_0x5f62('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f62('0xc'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x5f62('0xd')](socket);function respondWithRpcPromise(_0xd8bcc5,_0x3a3ffe,_0x370b30){return new BPromise(function(_0x4d8ecb,_0x475818){return client['request'](_0xd8bcc5,_0x370b30)[_0x5f62('0xe')](function(_0x419159){logger['info'](_0x5f62('0xf'),_0x3a3ffe,_0x5f62('0x10'));logger[_0x5f62('0x11')](_0x5f62('0x12'),_0x3a3ffe,_0x5f62('0x10'),JSON['stringify'](_0x419159));if(_0x419159[_0x5f62('0x13')]){if(_0x419159['error'][_0x5f62('0x14')]===0x1f4){logger[_0x5f62('0x13')](_0x5f62('0xf'),_0x3a3ffe,_0x419159[_0x5f62('0x13')][_0x5f62('0x15')]);return _0x475818(_0x419159[_0x5f62('0x13')][_0x5f62('0x15')]);}logger['error'](_0x5f62('0xf'),_0x3a3ffe,_0x419159[_0x5f62('0x13')][_0x5f62('0x15')]);return _0x4d8ecb(_0x419159[_0x5f62('0x13')][_0x5f62('0x15')]);}else{logger['info'](_0x5f62('0xf'),_0x3a3ffe,'request\x20sent');_0x4d8ecb(_0x419159[_0x5f62('0x16')][_0x5f62('0x15')]);}})[_0x5f62('0x17')](function(_0x2f98d4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x3a3ffe,_0x2f98d4);_0x475818(_0x2f98d4);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4cf0258..2633f65 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 _0x767b=['remove','removeListener','register','length','./dashboardItem.events','save'];(function(_0x175efd,_0x15bc06){var _0x3dd106=function(_0x1ca800){while(--_0x1ca800){_0x175efd['push'](_0x175efd['shift']());}};_0x3dd106(++_0x15bc06);}(_0x767b,0x136));var _0xb767=function(_0x1c1fda,_0x1b076d){_0x1c1fda=_0x1c1fda-0x0;var _0xd76da7=_0x767b[_0x1c1fda];return _0xd76da7;};'use strict';var DashboardItemEvents=require(_0xb767('0x0'));var events=[_0xb767('0x1'),_0xb767('0x2'),'update'];function createListener(_0x376c72,_0x34a815){return function(_0x2c8fee){_0x34a815['emit'](_0x376c72,_0x2c8fee);};}function removeListener(_0x1676ac,_0x35c336){return function(){DashboardItemEvents[_0xb767('0x3')](_0x1676ac,_0x35c336);};}exports[_0xb767('0x4')]=function(_0x2840a4){for(var _0x2161e2=0x0,_0x12efd7=events[_0xb767('0x5')];_0x2161e2<_0x12efd7;_0x2161e2++){var _0x3af8cc=events[_0x2161e2];var _0xdb6bcb=createListener('dashboardItem:'+_0x3af8cc,_0x2840a4);DashboardItemEvents['on'](_0x3af8cc,_0xdb6bcb);}}; \ No newline at end of file +var _0x27b7=['register','length','dashboardItem:','./dashboardItem.events','update','removeListener'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0x27b7,0xc9));var _0x727b=function(_0x503e40,_0xe68845){_0x503e40=_0x503e40-0x0;var _0x59ee2b=_0x27b7[_0x503e40];return _0x59ee2b;};'use strict';var DashboardItemEvents=require(_0x727b('0x0'));var events=['save','remove',_0x727b('0x1')];function createListener(_0x2ac287,_0x3bafee){return function(_0x297e3f){_0x3bafee['emit'](_0x2ac287,_0x297e3f);};}function removeListener(_0x26b4d5,_0x220977){return function(){DashboardItemEvents[_0x727b('0x2')](_0x26b4d5,_0x220977);};}exports[_0x727b('0x3')]=function(_0x42b14e){for(var _0x4a6bf3=0x0,_0x5ee979=events[_0x727b('0x4')];_0x4a6bf3<_0x5ee979;_0x4a6bf3++){var _0x535cdd=events[_0x4a6bf3];var _0x19f3c2=createListener(_0x727b('0x5')+_0x535cdd,_0x42b14e);DashboardItemEvents['on'](_0x535cdd,_0x19f3c2);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index e990e1f..4a63c0a 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 _0xea41=['/:id','post','isAuthenticated','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x4ad849,_0x57716e){var _0x3fba93=function(_0x499c5d){while(--_0x499c5d){_0x4ad849['push'](_0x4ad849['shift']());}};_0x3fba93(++_0x57716e);}(_0xea41,0x112));var _0x1ea4=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xea41[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0x1ea4('0x0'));var util=require('util');var path=require(_0x1ea4('0x1'));var timeout=require(_0x1ea4('0x2'));var express=require(_0x1ea4('0x3'));var router=express[_0x1ea4('0x4')]();var fs_extra=require(_0x1ea4('0x5'));var auth=require(_0x1ea4('0x6'));var interaction=require(_0x1ea4('0x7'));var config=require(_0x1ea4('0x8'));var controller=require(_0x1ea4('0x9'));router[_0x1ea4('0xa')](_0x1ea4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1ea4('0xc')]('/',auth[_0x1ea4('0xd')](),controller[_0x1ea4('0xe')]);router[_0x1ea4('0xf')](_0x1ea4('0xb'),auth[_0x1ea4('0xd')](),controller[_0x1ea4('0x10')]);router[_0x1ea4('0x11')](_0x1ea4('0xb'),auth[_0x1ea4('0xd')](),controller[_0x1ea4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x27fe=['./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1d0304,_0x315c51){var _0x2ef571=function(_0x37f359){while(--_0x37f359){_0x1d0304['push'](_0x1d0304['shift']());}};_0x2ef571(++_0x315c51);}(_0x27fe,0x7e));var _0xe27f=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x27fe[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xe27f('0x0'));var util=require(_0xe27f('0x1'));var path=require(_0xe27f('0x2'));var timeout=require(_0xe27f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe27f('0x4'));var interaction=require(_0xe27f('0x5'));var config=require(_0xe27f('0x6'));var controller=require(_0xe27f('0x7'));router[_0xe27f('0x8')](_0xe27f('0x9'),auth[_0xe27f('0xa')](),controller[_0xe27f('0xb')]);router[_0xe27f('0xc')]('/',auth[_0xe27f('0xa')](),controller[_0xe27f('0xd')]);router[_0xe27f('0xe')](_0xe27f('0x9'),auth['isAuthenticated'](),controller[_0xe27f('0xf')]);router[_0xe27f('0x10')](_0xe27f('0x9'),auth['isAuthenticated'](),controller[_0xe27f('0x11')]);module[_0xe27f('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index fc631b0..9f6677d 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 _0xae9b=['third','exports','ENUM','second'];(function(_0x48bfcd,_0x270283){var _0xa9c013=function(_0x53ba70){while(--_0x53ba70){_0x48bfcd['push'](_0x48bfcd['shift']());}};_0xa9c013(++_0x270283);}(_0xae9b,0x69));var _0xbae9=function(_0x4ee193,_0x9751ac){_0x4ee193=_0x4ee193-0x0;var _0x40fce1=_0xae9b[_0x4ee193];return _0x40fce1;};'use strict';var Sequelize=require('sequelize');module[_0xbae9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xbae9('0x1')]('first',_0xbae9('0x2'),_0xbae9('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x74e7=['first','sequelize','exports','STRING'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x74e7,0x141));var _0x774e=function(_0x45fd9d,_0xdb5fe1){_0x45fd9d=_0x45fd9d-0x0;var _0x541ea0=_0x74e7[_0x45fd9d];return _0x541ea0;};'use strict';var Sequelize=require(_0x774e('0x0'));module[_0x774e('0x1')]={'name':{'type':Sequelize[_0x774e('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x774e('0x3'),'second','third'),'allowNull':![],'defaultValue':_0x774e('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c262720..3c6abd5 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 _0x9a8b=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x31ae86,_0x5ecc15){var _0x193c45=function(_0x455fb1){while(--_0x455fb1){_0x31ae86['push'](_0x31ae86['shift']());}};_0x193c45(++_0x5ecc15);}(_0x9a8b,0x1ba));var _0xb9a8=function(_0x5d492b,_0x208784){_0x5d492b=_0x5d492b-0x0;var _0x323012=_0x9a8b[_0x5d492b];return _0x323012;};'use strict';var emlformat=require(_0xb9a8('0x0'));var rimraf=require(_0xb9a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9a8('0x2'));var rp=require(_0xb9a8('0x3'));var moment=require(_0xb9a8('0x4'));var BPromise=require(_0xb9a8('0x5'));var Mustache=require(_0xb9a8('0x6'));var util=require(_0xb9a8('0x7'));var path=require(_0xb9a8('0x8'));var sox=require(_0xb9a8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9a8('0xa'));var _=require(_0xb9a8('0xb'));var squel=require(_0xb9a8('0xc'));var crypto=require(_0xb9a8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9a8('0xe'));var Papa=require(_0xb9a8('0xf'));var Redis=require(_0xb9a8('0x10'));var authService=require(_0xb9a8('0x11'));var qs=require(_0xb9a8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9a8('0x13'));var logger=require(_0xb9a8('0x14'))(_0xb9a8('0x15'));var utils=require(_0xb9a8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb9a8('0x17'));var db=require(_0xb9a8('0x18'))['db'];function respondWithStatusCode(_0x12e9bb,_0xd32cb){_0xd32cb=_0xd32cb||0xcc;return function(_0x62dbfb){if(_0x62dbfb){return _0x12e9bb[_0xb9a8('0x19')](_0xd32cb);}return _0x12e9bb[_0xb9a8('0x1a')](_0xd32cb)[_0xb9a8('0x1b')]();};}function respondWithResult(_0x1c882a,_0x3ad966){_0x3ad966=_0x3ad966||0xc8;return function(_0x3459bb){if(_0x3459bb){return _0x1c882a[_0xb9a8('0x1a')](_0x3ad966)[_0xb9a8('0x1c')](_0x3459bb);}};}function respondWithFilteredResult(_0x93f5a2,_0x51558b){return function(_0x290eb8){if(_0x290eb8){var _0x478395=typeof _0x51558b[_0xb9a8('0x1d')]===_0xb9a8('0x1e')&&typeof _0x51558b[_0xb9a8('0x1f')]==='undefined';var _0x5d6efe=_0x290eb8[_0xb9a8('0x20')];var _0x5c38ea=_0x478395?0x0:_0x51558b[_0xb9a8('0x1d')];var _0x4bf1a8=_0x478395?_0x290eb8[_0xb9a8('0x20')]:_0x51558b['offset']+_0x51558b[_0xb9a8('0x1f')];var _0x2b9cfd;if(_0x4bf1a8>=_0x5d6efe){_0x4bf1a8=_0x5d6efe;_0x2b9cfd=0xc8;}else{_0x2b9cfd=0xce;}_0x93f5a2[_0xb9a8('0x1a')](_0x2b9cfd);return _0x93f5a2[_0xb9a8('0x21')]('Content-Range',_0x5c38ea+'-'+_0x4bf1a8+'/'+_0x5d6efe)[_0xb9a8('0x1c')](_0x290eb8);}return null;};}function patchUpdates(_0x4a5365){return function(_0x1856ed){try{jsonpatch['apply'](_0x1856ed,_0x4a5365,!![]);}catch(_0x433db4){return BPromise[_0xb9a8('0x22')](_0x433db4);}return _0x1856ed[_0xb9a8('0x23')]();};}function saveUpdates(_0x44e8d8,_0x4da881){return function(_0x296210){if(_0x296210){return _0x296210[_0xb9a8('0x24')](_0x44e8d8)['then'](function(_0x5f4388){return _0x5f4388;});}return null;};}function removeEntity(_0x261cac,_0x3fab8d){return function(_0x5ae6a5){if(_0x5ae6a5){return _0x5ae6a5[_0xb9a8('0x25')]()[_0xb9a8('0x26')](function(){var _0xbc1134=_0x5ae6a5[_0xb9a8('0x27')]({'plain':!![]});var _0x11c390=_0xb9a8('0x28');return db[_0xb9a8('0x29')][_0xb9a8('0x25')]({'where':{'type':_0x11c390,'resourceId':_0xbc1134['id']}})[_0xb9a8('0x26')](function(){return _0x5ae6a5;});})[_0xb9a8('0x26')](function(){_0x261cac[_0xb9a8('0x1a')](0xcc)[_0xb9a8('0x1b')]();});}};}function handleEntityNotFound(_0xffac1b,_0x58c25e){return function(_0x42352b){if(!_0x42352b){_0xffac1b[_0xb9a8('0x19')](0x194);}return _0x42352b;};}function handleError(_0x30f001,_0xf303ae){_0xf303ae=_0xf303ae||0x1f4;return function(_0x1adabb){logger[_0xb9a8('0x2a')](_0x1adabb['stack']);if(_0x1adabb[_0xb9a8('0x2b')]){delete _0x1adabb[_0xb9a8('0x2b')];}_0x30f001[_0xb9a8('0x1a')](_0xf303ae)[_0xb9a8('0x2c')](_0x1adabb);};}exports[_0xb9a8('0x2d')]=function(_0x33744b,_0x53f9ad){var _0x566912={},_0x174e2a={},_0x2b5201={'count':0x0,'rows':[]};var _0x166d69=_[_0xb9a8('0x2e')](db[_0xb9a8('0x2f')][_0xb9a8('0x30')],function(_0x2708d0){return{'name':_0x2708d0[_0xb9a8('0x31')],'type':_0x2708d0[_0xb9a8('0x32')][_0xb9a8('0x33')]};});_0x174e2a[_0xb9a8('0x34')]=_[_0xb9a8('0x2e')](_0x166d69,'name');_0x174e2a[_0xb9a8('0x35')]=_[_0xb9a8('0x36')](_0x33744b[_0xb9a8('0x35')]);_0x174e2a[_0xb9a8('0x37')]=_[_0xb9a8('0x38')](_0x174e2a[_0xb9a8('0x34')],_0x174e2a['query']);_0x566912[_0xb9a8('0x39')]=_['intersection'](_0x174e2a[_0xb9a8('0x34')],qs[_0xb9a8('0x3a')](_0x33744b['query']['fields']));_0x566912['attributes']=_0x566912['attributes'][_0xb9a8('0x3b')]?_0x566912[_0xb9a8('0x39')]:_0x174e2a[_0xb9a8('0x34')];if(!_0x33744b[_0xb9a8('0x35')][_0xb9a8('0x3c')](_0xb9a8('0x3d'))){_0x566912[_0xb9a8('0x1f')]=qs['limit'](_0x33744b[_0xb9a8('0x35')][_0xb9a8('0x1f')]);_0x566912[_0xb9a8('0x1d')]=qs['offset'](_0x33744b[_0xb9a8('0x35')][_0xb9a8('0x1d')]);}_0x566912[_0xb9a8('0x3e')]=qs['sort'](_0x33744b[_0xb9a8('0x35')][_0xb9a8('0x3f')]);_0x566912[_0xb9a8('0x40')]=qs[_0xb9a8('0x37')](_[_0xb9a8('0x41')](_0x33744b[_0xb9a8('0x35')],_0x174e2a['filters']),_0x166d69);if(_0x33744b[_0xb9a8('0x35')]['filter']){_0x566912['where']=_['merge'](_0x566912[_0xb9a8('0x40')],{'$or':_[_0xb9a8('0x2e')](_0x166d69,function(_0x5c5925){if(_0x5c5925[_0xb9a8('0x32')]!==_0xb9a8('0x42')){var _0x4d4401={};_0x4d4401[_0x5c5925[_0xb9a8('0x2b')]]={'$like':'%'+_0x33744b['query'][_0xb9a8('0x43')]+'%'};return _0x4d4401;}})});}_0x566912=_[_0xb9a8('0x44')]({},_0x566912,_0x33744b[_0xb9a8('0x45')]);var _0x5d2304={'where':_0x566912['where']};return db[_0xb9a8('0x2f')][_0xb9a8('0x20')](_0x5d2304)[_0xb9a8('0x26')](function(_0x18d3be){_0x2b5201['count']=_0x18d3be;if(_0x33744b['query']['includeAll']){_0x566912[_0xb9a8('0x46')]=[{'all':!![]}];}return db[_0xb9a8('0x2f')][_0xb9a8('0x47')](_0x566912);})[_0xb9a8('0x26')](function(_0x5e7427){_0x2b5201[_0xb9a8('0x48')]=_0x5e7427;return _0x2b5201;})[_0xb9a8('0x26')](respondWithFilteredResult(_0x53f9ad,_0x566912))[_0xb9a8('0x49')](handleError(_0x53f9ad,null));};exports[_0xb9a8('0x4a')]=function(_0x52dd7a,_0x424882){var _0xde376d={'raw':!![],'where':{'id':_0x52dd7a['params']['id']}},_0x55431e={};_0x55431e[_0xb9a8('0x34')]=_[_0xb9a8('0x36')](db[_0xb9a8('0x2f')]['rawAttributes']);_0x55431e['query']=_[_0xb9a8('0x36')](_0x52dd7a[_0xb9a8('0x35')]);_0x55431e[_0xb9a8('0x37')]=_[_0xb9a8('0x38')](_0x55431e['model'],_0x55431e['query']);_0xde376d[_0xb9a8('0x39')]=_[_0xb9a8('0x38')](_0x55431e['model'],qs['fields'](_0x52dd7a[_0xb9a8('0x35')]['fields']));_0xde376d['attributes']=_0xde376d[_0xb9a8('0x39')][_0xb9a8('0x3b')]?_0xde376d[_0xb9a8('0x39')]:_0x55431e['model'];if(_0x52dd7a[_0xb9a8('0x35')]['includeAll']){_0xde376d[_0xb9a8('0x46')]=[{'all':!![]}];}_0xde376d=_[_0xb9a8('0x44')]({},_0xde376d,_0x52dd7a[_0xb9a8('0x45')]);return db[_0xb9a8('0x2f')][_0xb9a8('0x4b')](_0xde376d)['then'](handleEntityNotFound(_0x424882,null))['then'](respondWithResult(_0x424882,null))[_0xb9a8('0x49')](handleError(_0x424882,null));};exports['create']=function(_0x38a619,_0x25b298){return db[_0xb9a8('0x2f')]['create'](_0x38a619['body'],{})[_0xb9a8('0x26')](function(_0x427923){var _0x1180e7=_0x38a619[_0xb9a8('0x4c')][_0xb9a8('0x27')]({'plain':!![]});if(!_0x1180e7)throw new Error(_0xb9a8('0x4d'));if(_0x1180e7['role']===_0xb9a8('0x4c')){var _0x59e766=_0x427923[_0xb9a8('0x27')]({'plain':!![]});var _0x4be882=_0xb9a8('0x28');return db[_0xb9a8('0x4e')][_0xb9a8('0x4b')]({'where':{'name':_0x4be882,'userProfileId':_0x1180e7['userProfileId']},'raw':!![]})[_0xb9a8('0x26')](function(_0x22a930){if(_0x22a930&&_0x22a930[_0xb9a8('0x4f')]===0x0){return db[_0xb9a8('0x29')]['create']({'name':_0x59e766['name'],'resourceId':_0x59e766['id'],'type':_0x22a930[_0xb9a8('0x2b')],'sectionId':_0x22a930['id']},{})['then'](function(){return _0x427923;});}else{return _0x427923;}})[_0xb9a8('0x49')](function(_0x578cd5){logger[_0xb9a8('0x2a')](_0xb9a8('0x50'),_0x578cd5);throw _0x578cd5;});}return _0x427923;})['then'](respondWithResult(_0x25b298,0xc9))['catch'](handleError(_0x25b298,null));};exports[_0xb9a8('0x24')]=function(_0x43b08a,_0x21bece){if(_0x43b08a[_0xb9a8('0x51')]['id']){delete _0x43b08a['body']['id'];}return db[_0xb9a8('0x2f')]['find']({'where':{'id':_0x43b08a[_0xb9a8('0x52')]['id']}})['then'](handleEntityNotFound(_0x21bece,null))['then'](saveUpdates(_0x43b08a[_0xb9a8('0x51')],null))[_0xb9a8('0x26')](respondWithResult(_0x21bece,null))[_0xb9a8('0x49')](handleError(_0x21bece,null));};exports['destroy']=function(_0xd14782,_0xc17bf4){return db[_0xb9a8('0x2f')][_0xb9a8('0x4b')]({'where':{'id':_0xd14782[_0xb9a8('0x52')]['id']}})['then'](handleEntityNotFound(_0xc17bf4,null))['then'](removeEntity(_0xc17bf4,null))[_0xb9a8('0x49')](handleError(_0xc17bf4,null));}; \ No newline at end of file +var _0x19d1=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','name','index','Disposition','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','findAll','catch','show','rawAttributes','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0x19d1,0xd6));var _0x119d=function(_0x417423,_0x3b478f){_0x417423=_0x417423-0x0;var _0x41ed07=_0x19d1[_0x417423];return _0x41ed07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x119d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x119d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x119d('0x2'));var util=require(_0x119d('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x119d('0x4'));var fs=require('fs');var fs_extra=require(_0x119d('0x5'));var _=require(_0x119d('0x6'));var squel=require(_0x119d('0x7'));var crypto=require(_0x119d('0x8'));var jsforce=require(_0x119d('0x9'));var deskjs=require(_0x119d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x119d('0xb'));var Papa=require(_0x119d('0xc'));var Redis=require(_0x119d('0xd'));var authService=require(_0x119d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x119d('0xf'));var logger=require(_0x119d('0x10'))(_0x119d('0x11'));var utils=require(_0x119d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x119d('0x13'));var db=require(_0x119d('0x14'))['db'];function respondWithStatusCode(_0x44e281,_0x5e1e6c){_0x5e1e6c=_0x5e1e6c||0xcc;return function(_0x4efaf6){if(_0x4efaf6){return _0x44e281[_0x119d('0x15')](_0x5e1e6c);}return _0x44e281[_0x119d('0x16')](_0x5e1e6c)[_0x119d('0x17')]();};}function respondWithResult(_0x1b8683,_0x29e9fa){_0x29e9fa=_0x29e9fa||0xc8;return function(_0x3d00c3){if(_0x3d00c3){return _0x1b8683['status'](_0x29e9fa)[_0x119d('0x18')](_0x3d00c3);}};}function respondWithFilteredResult(_0x5022c2,_0x55257d){return function(_0x3e1b07){if(_0x3e1b07){var _0x317573=typeof _0x55257d[_0x119d('0x19')]===_0x119d('0x1a')&&typeof _0x55257d[_0x119d('0x1b')]===_0x119d('0x1a');var _0x15791b=_0x3e1b07['count'];var _0x465cb2=_0x317573?0x0:_0x55257d['offset'];var _0x1dc80b=_0x317573?_0x3e1b07['count']:_0x55257d[_0x119d('0x19')]+_0x55257d[_0x119d('0x1b')];var _0x41e5e6;if(_0x1dc80b>=_0x15791b){_0x1dc80b=_0x15791b;_0x41e5e6=0xc8;}else{_0x41e5e6=0xce;}_0x5022c2[_0x119d('0x16')](_0x41e5e6);return _0x5022c2[_0x119d('0x1c')]('Content-Range',_0x465cb2+'-'+_0x1dc80b+'/'+_0x15791b)['json'](_0x3e1b07);}return null;};}function patchUpdates(_0x30346d){return function(_0x3423be){try{jsonpatch[_0x119d('0x1d')](_0x3423be,_0x30346d,!![]);}catch(_0x5020bf){return BPromise[_0x119d('0x1e')](_0x5020bf);}return _0x3423be[_0x119d('0x1f')]();};}function saveUpdates(_0xfd56f6,_0x58245b){return function(_0x532283){if(_0x532283){return _0x532283[_0x119d('0x20')](_0xfd56f6)[_0x119d('0x21')](function(_0x53919f){return _0x53919f;});}return null;};}function removeEntity(_0x3d8df0,_0x5e07aa){return function(_0x281d48){if(_0x281d48){return _0x281d48[_0x119d('0x22')]()[_0x119d('0x21')](function(){var _0x4ddacb=_0x281d48[_0x119d('0x23')]({'plain':!![]});var _0x4fd794=_0x119d('0x24');return db[_0x119d('0x25')][_0x119d('0x22')]({'where':{'type':_0x4fd794,'resourceId':_0x4ddacb['id']}})[_0x119d('0x21')](function(){return _0x281d48;});})[_0x119d('0x21')](function(){_0x3d8df0[_0x119d('0x16')](0xcc)[_0x119d('0x17')]();});}};}function handleEntityNotFound(_0x58e30e,_0x11bcb2){return function(_0xd48c9a){if(!_0xd48c9a){_0x58e30e['sendStatus'](0x194);}return _0xd48c9a;};}function handleError(_0x3c1d67,_0x3d059e){_0x3d059e=_0x3d059e||0x1f4;return function(_0xbf08bc){logger['error'](_0xbf08bc['stack']);if(_0xbf08bc[_0x119d('0x26')]){delete _0xbf08bc[_0x119d('0x26')];}_0x3c1d67[_0x119d('0x16')](_0x3d059e)['send'](_0xbf08bc);};}exports[_0x119d('0x27')]=function(_0x1766f3,_0x20ac23){var _0x29cab8={},_0x1ef0e0={},_0x4da8a4={'count':0x0,'rows':[]};var _0x3b8b14=_['map'](db[_0x119d('0x28')]['rawAttributes'],function(_0x3d7b1e){return{'name':_0x3d7b1e[_0x119d('0x29')],'type':_0x3d7b1e[_0x119d('0x2a')][_0x119d('0x2b')]};});_0x1ef0e0[_0x119d('0x2c')]=_[_0x119d('0x2d')](_0x3b8b14,_0x119d('0x26'));_0x1ef0e0[_0x119d('0x2e')]=_[_0x119d('0x2f')](_0x1766f3['query']);_0x1ef0e0[_0x119d('0x30')]=_[_0x119d('0x31')](_0x1ef0e0[_0x119d('0x2c')],_0x1ef0e0[_0x119d('0x2e')]);_0x29cab8[_0x119d('0x32')]=_['intersection'](_0x1ef0e0[_0x119d('0x2c')],qs[_0x119d('0x33')](_0x1766f3[_0x119d('0x2e')][_0x119d('0x33')]));_0x29cab8[_0x119d('0x32')]=_0x29cab8[_0x119d('0x32')][_0x119d('0x34')]?_0x29cab8[_0x119d('0x32')]:_0x1ef0e0[_0x119d('0x2c')];if(!_0x1766f3['query']['hasOwnProperty'](_0x119d('0x35'))){_0x29cab8[_0x119d('0x1b')]=qs['limit'](_0x1766f3[_0x119d('0x2e')]['limit']);_0x29cab8[_0x119d('0x19')]=qs[_0x119d('0x19')](_0x1766f3['query'][_0x119d('0x19')]);}_0x29cab8[_0x119d('0x36')]=qs[_0x119d('0x37')](_0x1766f3[_0x119d('0x2e')][_0x119d('0x37')]);_0x29cab8[_0x119d('0x38')]=qs[_0x119d('0x30')](_[_0x119d('0x39')](_0x1766f3['query'],_0x1ef0e0[_0x119d('0x30')]),_0x3b8b14);if(_0x1766f3[_0x119d('0x2e')][_0x119d('0x3a')]){_0x29cab8[_0x119d('0x38')]=_[_0x119d('0x3b')](_0x29cab8[_0x119d('0x38')],{'$or':_[_0x119d('0x2d')](_0x3b8b14,function(_0x36cd56){if(_0x36cd56[_0x119d('0x2a')]!=='VIRTUAL'){var _0x316542={};_0x316542[_0x36cd56[_0x119d('0x26')]]={'$like':'%'+_0x1766f3['query'][_0x119d('0x3a')]+'%'};return _0x316542;}})});}_0x29cab8=_[_0x119d('0x3b')]({},_0x29cab8,_0x1766f3[_0x119d('0x3c')]);var _0x5e09e3={'where':_0x29cab8[_0x119d('0x38')]};return db[_0x119d('0x28')][_0x119d('0x3d')](_0x5e09e3)['then'](function(_0x4f6df1){_0x4da8a4[_0x119d('0x3d')]=_0x4f6df1;if(_0x1766f3[_0x119d('0x2e')]['includeAll']){_0x29cab8['include']=[{'all':!![]}];}return db[_0x119d('0x28')][_0x119d('0x3e')](_0x29cab8);})[_0x119d('0x21')](function(_0x2c67b2){_0x4da8a4['rows']=_0x2c67b2;return _0x4da8a4;})['then'](respondWithFilteredResult(_0x20ac23,_0x29cab8))[_0x119d('0x3f')](handleError(_0x20ac23,null));};exports[_0x119d('0x40')]=function(_0x340665,_0x44c1cd){var _0x5e0953={'raw':!![],'where':{'id':_0x340665['params']['id']}},_0x528e53={};_0x528e53[_0x119d('0x2c')]=_[_0x119d('0x2f')](db['Disposition'][_0x119d('0x41')]);_0x528e53[_0x119d('0x2e')]=_[_0x119d('0x2f')](_0x340665[_0x119d('0x2e')]);_0x528e53['filters']=_[_0x119d('0x31')](_0x528e53[_0x119d('0x2c')],_0x528e53[_0x119d('0x2e')]);_0x5e0953[_0x119d('0x32')]=_[_0x119d('0x31')](_0x528e53[_0x119d('0x2c')],qs['fields'](_0x340665['query'][_0x119d('0x33')]));_0x5e0953[_0x119d('0x32')]=_0x5e0953[_0x119d('0x32')]['length']?_0x5e0953[_0x119d('0x32')]:_0x528e53[_0x119d('0x2c')];if(_0x340665[_0x119d('0x2e')][_0x119d('0x42')]){_0x5e0953[_0x119d('0x43')]=[{'all':!![]}];}_0x5e0953=_[_0x119d('0x3b')]({},_0x5e0953,_0x340665[_0x119d('0x3c')]);return db[_0x119d('0x28')]['find'](_0x5e0953)['then'](handleEntityNotFound(_0x44c1cd,null))[_0x119d('0x21')](respondWithResult(_0x44c1cd,null))[_0x119d('0x3f')](handleError(_0x44c1cd,null));};exports[_0x119d('0x44')]=function(_0x4603c1,_0x36c11a){return db[_0x119d('0x28')][_0x119d('0x44')](_0x4603c1['body'],{})[_0x119d('0x21')](function(_0x1e0f0a){var _0x3f2789=_0x4603c1[_0x119d('0x45')][_0x119d('0x23')]({'plain':!![]});if(!_0x3f2789)throw new Error(_0x119d('0x46'));if(_0x3f2789['role']==='user'){var _0x37ff29=_0x1e0f0a[_0x119d('0x23')]({'plain':!![]});var _0xcbc0bf=_0x119d('0x24');return db[_0x119d('0x47')][_0x119d('0x48')]({'where':{'name':_0xcbc0bf,'userProfileId':_0x3f2789['userProfileId']},'raw':!![]})[_0x119d('0x21')](function(_0x4da73e){if(_0x4da73e&&_0x4da73e[_0x119d('0x49')]===0x0){return db[_0x119d('0x25')]['create']({'name':_0x37ff29[_0x119d('0x26')],'resourceId':_0x37ff29['id'],'type':_0x4da73e[_0x119d('0x26')],'sectionId':_0x4da73e['id']},{})[_0x119d('0x21')](function(){return _0x1e0f0a;});}else{return _0x1e0f0a;}})['catch'](function(_0x2f3bf7){logger[_0x119d('0x4a')](_0x119d('0x4b'),_0x2f3bf7);throw _0x2f3bf7;});}return _0x1e0f0a;})[_0x119d('0x21')](respondWithResult(_0x36c11a,0xc9))['catch'](handleError(_0x36c11a,null));};exports[_0x119d('0x20')]=function(_0x46916b,_0x45f877){if(_0x46916b[_0x119d('0x4c')]['id']){delete _0x46916b['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x46916b[_0x119d('0x4d')]['id']}})[_0x119d('0x21')](handleEntityNotFound(_0x45f877,null))[_0x119d('0x21')](saveUpdates(_0x46916b[_0x119d('0x4c')],null))[_0x119d('0x21')](respondWithResult(_0x45f877,null))['catch'](handleError(_0x45f877,null));};exports[_0x119d('0x22')]=function(_0x2bcc4e,_0x546eee){return db[_0x119d('0x28')]['find']({'where':{'id':_0x2bcc4e[_0x119d('0x4d')]['id']}})[_0x119d('0x21')](handleEntityNotFound(_0x546eee,null))[_0x119d('0x21')](removeEntity(_0x546eee,null))[_0x119d('0x3f')](handleError(_0x546eee,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3c57bab..f586d63 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 _0x8bc9=['api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','ListId','name_chat','ChatWebsiteId','name_mail','name','SmsAccountId','name_fax','FaxAccountId','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8bc9,0x189));var _0x98bc=function(_0x239fde,_0x23afac){_0x239fde=_0x239fde-0x0;var _0x48d053=_0x8bc9[_0x239fde];return _0x48d053;};'use strict';var _=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var logger=require(_0x98bc('0x2'))(_0x98bc('0x3'));var moment=require(_0x98bc('0x4'));var BPromise=require(_0x98bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98bc('0x6'));var rimraf=require(_0x98bc('0x7'));var config=require(_0x98bc('0x8'));var attributes=require(_0x98bc('0x9'));module[_0x98bc('0xa')]=function(_0x2c83dc,_0x127016){return _0x2c83dc[_0x98bc('0xb')](_0x98bc('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x98bc('0xd')]},{'unique':!![],'name':_0x98bc('0xe'),'fields':['name',_0x98bc('0xf')]},{'unique':!![],'name':_0x98bc('0x10'),'fields':[_0x98bc('0x11'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x98bc('0x11'),_0x98bc('0x12')]},{'unique':!![],'name':_0x98bc('0x13'),'fields':[_0x98bc('0x11'),_0x98bc('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x98bc('0x11'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x98bc('0x11'),_0x98bc('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6c8=['api','moment','request-promise','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','util'];(function(_0x44e9b2,_0x156f15){var _0x1f0665=function(_0x2fc179){while(--_0x2fc179){_0x44e9b2['push'](_0x44e9b2['shift']());}};_0x1f0665(++_0x156f15);}(_0xa6c8,0xcb));var _0x8a6c=function(_0x2882c2,_0x539cf1){_0x2882c2=_0x2882c2-0x0;var _0x46e1ab=_0xa6c8[_0x2882c2];return _0x46e1ab;};'use strict';var _=require('lodash');var util=require(_0x8a6c('0x0'));var logger=require('../../config/logger')(_0x8a6c('0x1'));var moment=require(_0x8a6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x8a6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a6c('0x4'));module['exports']=function(_0x1233de,_0x22186c){return _0x1233de[_0x8a6c('0x5')](_0x8a6c('0x6'),attributes,{'tableName':_0x8a6c('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8a6c('0x8'),'fields':[_0x8a6c('0x9'),_0x8a6c('0xa')]},{'unique':!![],'name':_0x8a6c('0xb'),'fields':[_0x8a6c('0x9'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x8a6c('0x9'),'MailAccountId']},{'unique':!![],'name':_0x8a6c('0xc'),'fields':['name',_0x8a6c('0xd')]},{'unique':!![],'name':'name_fax','fields':[_0x8a6c('0x9'),_0x8a6c('0xe')]},{'unique':!![],'name':_0x8a6c('0xf'),'fields':[_0x8a6c('0x9'),'OpenchannelAccountId']},{'unique':!![],'name':_0x8a6c('0x10'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5be9a87..6b1e0ac 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(_0x33a300,_0x243ba8){var _0x4e8427=function(_0x3c2f37){while(--_0x3c2f37){_0x33a300['push'](_0x33a300['shift']());}};_0x4e8427(++_0x243ba8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x3a69ea,_0x441df2){var _0x414f8c=function(_0x167b77){while(--_0x167b77){_0x3a69ea['push'](_0x3a69ea['shift']());}};_0x414f8c(++_0x441df2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 2f77220..956edee 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 _0x37a2=['/:id','show','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index'];(function(_0x45f224,_0x36c582){var _0x76b7c5=function(_0x15732e){while(--_0x15732e){_0x45f224['push'](_0x45f224['shift']());}};_0x76b7c5(++_0x36c582);}(_0x37a2,0xe3));var _0x237a=function(_0x401db7,_0x130dc2){_0x401db7=_0x401db7-0x0;var _0x33d498=_0x37a2[_0x401db7];return _0x33d498;};'use strict';var multer=require(_0x237a('0x0'));var util=require(_0x237a('0x1'));var path=require('path');var timeout=require(_0x237a('0x2'));var express=require(_0x237a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x237a('0x4'));var interaction=require(_0x237a('0x5'));var config=require(_0x237a('0x6'));var controller=require(_0x237a('0x7'));router[_0x237a('0x8')]('/',auth[_0x237a('0x9')](),controller[_0x237a('0xa')]);router[_0x237a('0x8')](_0x237a('0xb'),auth[_0x237a('0x9')](),controller[_0x237a('0xc')]);router['post']('/',auth[_0x237a('0x9')](),controller['create']);router[_0x237a('0xd')](_0x237a('0xb'),auth['isAuthenticated'](),controller[_0x237a('0xe')]);router[_0x237a('0xf')](_0x237a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x237a('0x10')]=router; \ No newline at end of file +var _0x958d=['post','create','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x1f5d02,_0x1e5616){var _0x49675e=function(_0x4ad950){while(--_0x4ad950){_0x1f5d02['push'](_0x1f5d02['shift']());}};_0x49675e(++_0x1e5616);}(_0x958d,0x15b));var _0xd958=function(_0x55292a,_0x406c28){_0x55292a=_0x55292a-0x0;var _0x2c77ae=_0x958d[_0x55292a];return _0x2c77ae;};'use strict';var multer=require(_0xd958('0x0'));var util=require(_0xd958('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd958('0x2'));var router=express[_0xd958('0x3')]();var fs_extra=require(_0xd958('0x4'));var auth=require(_0xd958('0x5'));var interaction=require(_0xd958('0x6'));var config=require(_0xd958('0x7'));var controller=require('./disposition.controller');router[_0xd958('0x8')]('/',auth[_0xd958('0x9')](),controller[_0xd958('0xa')]);router[_0xd958('0x8')](_0xd958('0xb'),auth[_0xd958('0x9')](),controller[_0xd958('0xc')]);router[_0xd958('0xd')]('/',auth[_0xd958('0x9')](),controller[_0xd958('0xe')]);router['put'](_0xd958('0xb'),auth[_0xd958('0x9')](),controller['update']);router[_0xd958('0xf')](_0xd958('0xb'),auth['isAuthenticated'](),controller[_0xd958('0x10')]);module[_0xd958('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9d6aabe..c257064 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 _0x5fc3=['sequelize','exports','STRING','ENUM','yes','localstationid','7200','12000','14400','4800','2400','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x5fc3[_0x1a8f86];return _0x20d876;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x35fc('0x2')]},'ecm':{'type':Sequelize[_0x35fc('0x3')](_0x35fc('0x4'),'no'),'defaultValue':_0x35fc('0x4')},'headerinfo':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x35fc('0x2')],'unique':_0x35fc('0x5')},'minrate':{'type':Sequelize[_0x35fc('0x3')]('2400','4800',_0x35fc('0x6'),'9600',_0x35fc('0x7'),_0x35fc('0x8')),'defaultValue':_0x35fc('0x9')},'maxrate':{'type':Sequelize[_0x35fc('0x3')](_0x35fc('0xa'),_0x35fc('0x9'),_0x35fc('0x6'),'9600',_0x35fc('0x7'),_0x35fc('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':_0x35fc('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x35fc('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x35fc('0xd'),'DADHI',_0x35fc('0xe')),'defaultValue':_0x35fc('0xf')},'key':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x35fc('0x10')],'defaultValue':function(){return _0x35fc('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x35fc('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x35fc('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x35fc('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x35fc('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x35fc('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x35fc('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x35fc('0x14'),'set':function(_0x45c8b7){if(!_0x45c8b7)this['setDataValue'](_0x35fc('0x15'),null);this[_0x35fc('0x16')](_0x35fc('0x17'),_0x45c8b7);}}}; \ No newline at end of file +var _0xa6b0=['2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid'];(function(_0x4f785a,_0x5c39ba){var _0x2d29bb=function(_0x45ac01){while(--_0x45ac01){_0x4f785a['push'](_0x4f785a['shift']());}};_0x2d29bb(++_0x5c39ba);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x30f2bc,_0x52ede1){_0x30f2bc=_0x30f2bc-0x0;var _0x40a772=_0xa6b0[_0x30f2bc];return _0x40a772;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0x3'),'no'),'defaultValue':_0x0a6b('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x0a6b('0x4')},'localstationid':{'type':Sequelize[_0x0a6b('0x5')],'unique':_0x0a6b('0x6')},'minrate':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0x7'),_0x0a6b('0x8'),_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb'),_0x0a6b('0xc')),'defaultValue':_0x0a6b('0x8')},'maxrate':{'type':Sequelize[_0x0a6b('0x2')]('2400','4800',_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb'),_0x0a6b('0xc')),'defaultValue':_0x0a6b('0xc')},'modem':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':_0x0a6b('0xd')},'gateway':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0a6b('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0xf'),_0x0a6b('0x10'),_0x0a6b('0x11'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x0a6b('0x5')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0a6b('0x12')],'defaultValue':function(){return _0x0a6b('0x13');}},'notificationSound':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a6b('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x0a6b('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0a6b('0x16'),'set':function(_0x4d0e3b){if(!_0x4d0e3b)this[_0x0a6b('0x17')](_0x0a6b('0x18'),null);this[_0x0a6b('0x17')](_0x0a6b('0x19'),_0x4d0e3b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d081793..4a3a4b5 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 _0xddb1=['Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','FaxApplication','context','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','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','addAccountApplications','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','map','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','FaxAccountId','getDispositions','Disposition','order','pick','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addInteraction','omit','FaxInteraction','CmContact','Contact','fullname','internal'];(function(_0x135ad6,_0x55a72c){var _0x210f5a=function(_0x3b08e6){while(--_0x3b08e6){_0x135ad6['push'](_0x135ad6['shift']());}};_0x210f5a(++_0x55a72c);}(_0xddb1,0x119));var _0x1ddb=function(_0x221122,_0x33548a){_0x221122=_0x221122-0x0;var _0x17d260=_0xddb1[_0x221122];return _0x17d260;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ddb('0x0'));var zipdir=require(_0x1ddb('0x1'));var jsonpatch=require(_0x1ddb('0x2'));var rp=require(_0x1ddb('0x3'));var moment=require(_0x1ddb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ddb('0x5'));var path=require(_0x1ddb('0x6'));var sox=require(_0x1ddb('0x7'));var csv=require(_0x1ddb('0x8'));var ejs=require(_0x1ddb('0x9'));var fs=require('fs');var fs_extra=require(_0x1ddb('0xa'));var _=require(_0x1ddb('0xb'));var squel=require(_0x1ddb('0xc'));var crypto=require(_0x1ddb('0xd'));var jsforce=require(_0x1ddb('0xe'));var deskjs=require(_0x1ddb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1ddb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ddb('0x11'));var qs=require(_0x1ddb('0x12'));var as=require(_0x1ddb('0x13'));var hardwareService=require(_0x1ddb('0x14'));var logger=require('../../config/logger')(_0x1ddb('0x15'));var utils=require(_0x1ddb('0x16'));var config=require(_0x1ddb('0x17'));var licenseUtil=require(_0x1ddb('0x18'));var db=require(_0x1ddb('0x19'))['db'];config[_0x1ddb('0x1a')]=_[_0x1ddb('0x1b')](config[_0x1ddb('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ddb('0x1c'))(new Redis(config[_0x1ddb('0x1a')]));require(_0x1ddb('0x1d'))[_0x1ddb('0x1e')](socket);var jayson=require(_0x1ddb('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x1ddb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x583e8a,_0x5d1191,_0x118a7b,_0x231fc0){return new BPromise(function(_0x2d5433,_0x27f218){var _0x28f9e1=_0x231fc0||client;return _0x28f9e1[_0x1ddb('0x21')](_0x583e8a,_0x118a7b)[_0x1ddb('0x22')](function(_0x256bc5){logger[_0x1ddb('0x23')](_0x1ddb('0x24'),_0x5d1191,_0x1ddb('0x25'));logger[_0x1ddb('0x26')](_0x1ddb('0x27'),_0x5d1191,'request\x20sent',JSON[_0x1ddb('0x28')](_0x256bc5));if(_0x256bc5[_0x1ddb('0x29')]){if(_0x256bc5[_0x1ddb('0x29')][_0x1ddb('0x2a')]===0x1f4){logger[_0x1ddb('0x29')](_0x1ddb('0x24'),_0x5d1191,_0x256bc5[_0x1ddb('0x29')]['message']);return _0x27f218(_0x256bc5[_0x1ddb('0x29')][_0x1ddb('0x2b')]);}logger['error'](_0x1ddb('0x24'),_0x5d1191,_0x256bc5[_0x1ddb('0x29')][_0x1ddb('0x2b')]);return _0x2d5433(_0x256bc5['error'][_0x1ddb('0x2b')]);}else{logger['info'](_0x1ddb('0x24'),_0x5d1191,_0x1ddb('0x25'));_0x2d5433(_0x256bc5[_0x1ddb('0x2c')]['message']);}})[_0x1ddb('0x2d')](function(_0xf70536){logger[_0x1ddb('0x29')](_0x1ddb('0x24'),_0x5d1191,_0xf70536);_0x27f218(_0xf70536);});});}function respondWithStatusCode(_0x1d8080,_0x20fc18){_0x20fc18=_0x20fc18||0xcc;return function(_0x1bf153){if(_0x1bf153){return _0x1d8080[_0x1ddb('0x2e')](_0x20fc18);}return _0x1d8080['status'](_0x20fc18)[_0x1ddb('0x2f')]();};}function respondWithResult(_0x17ab58,_0x5dd3cd){_0x5dd3cd=_0x5dd3cd||0xc8;return function(_0x21e323){if(_0x21e323){return _0x17ab58[_0x1ddb('0x30')](_0x5dd3cd)[_0x1ddb('0x31')](_0x21e323);}};}function respondWithFilteredResult(_0x3b17f2,_0x42d800){return function(_0x43a2b6){if(_0x43a2b6){var _0x27f494=typeof _0x42d800[_0x1ddb('0x32')]===_0x1ddb('0x33')&&typeof _0x42d800[_0x1ddb('0x34')]===_0x1ddb('0x33');var _0x4e352d=_0x43a2b6[_0x1ddb('0x35')];var _0x1aa5a4=_0x27f494?0x0:_0x42d800[_0x1ddb('0x32')];var _0x2f3b76=_0x27f494?_0x43a2b6[_0x1ddb('0x35')]:_0x42d800[_0x1ddb('0x32')]+_0x42d800[_0x1ddb('0x34')];var _0x48f393;if(_0x2f3b76>=_0x4e352d){_0x2f3b76=_0x4e352d;_0x48f393=0xc8;}else{_0x48f393=0xce;}_0x3b17f2[_0x1ddb('0x30')](_0x48f393);return _0x3b17f2[_0x1ddb('0x36')]('Content-Range',_0x1aa5a4+'-'+_0x2f3b76+'/'+_0x4e352d)['json'](_0x43a2b6);}return null;};}function patchUpdates(_0x19849f){return function(_0x5afa71){try{jsonpatch[_0x1ddb('0x37')](_0x5afa71,_0x19849f,!![]);}catch(_0xccbd24){return BPromise[_0x1ddb('0x38')](_0xccbd24);}return _0x5afa71[_0x1ddb('0x39')]();};}function saveUpdates(_0xf23fbf,_0x426f56){return function(_0x3a6fa1){if(_0x3a6fa1){return _0x3a6fa1['update'](_0xf23fbf)['then'](function(_0x584d08){return _0x584d08;});}return null;};}function removeEntity(_0x733a36,_0x270778){return function(_0x4ff908){if(_0x4ff908){return _0x4ff908[_0x1ddb('0x3a')]()['then'](function(){var _0x23740f=_0x4ff908[_0x1ddb('0x3b')]({'plain':!![]});var _0x30c2d7='FaxAccounts';return db[_0x1ddb('0x3c')]['destroy']({'where':{'type':_0x30c2d7,'resourceId':_0x23740f['id']}})[_0x1ddb('0x22')](function(){return _0x4ff908;});})[_0x1ddb('0x22')](function(){_0x733a36['status'](0xcc)[_0x1ddb('0x2f')]();});}};}function handleEntityNotFound(_0x52921b,_0xbfbd58){return function(_0x4a58e7){if(!_0x4a58e7){_0x52921b[_0x1ddb('0x2e')](0x194);}return _0x4a58e7;};}function handleError(_0x11fe5b,_0x34cb4d){_0x34cb4d=_0x34cb4d||0x1f4;return function(_0x461ee1){logger[_0x1ddb('0x29')](_0x461ee1[_0x1ddb('0x3d')]);if(_0x461ee1[_0x1ddb('0x3e')]){delete _0x461ee1[_0x1ddb('0x3e')];}_0x11fe5b[_0x1ddb('0x30')](_0x34cb4d)[_0x1ddb('0x3f')](_0x461ee1);};}exports[_0x1ddb('0x40')]=function(_0x3e2322,_0x1afc01){var _0x37f30c={'include':[{'model':db[_0x1ddb('0x41')],'as':_0x1ddb('0x42')}]},_0x50f589={},_0xb352e5={'count':0x0,'rows':[]};var _0x5e23d8=_['map'](db[_0x1ddb('0x43')][_0x1ddb('0x44')],function(_0x36cd36){return{'name':_0x36cd36[_0x1ddb('0x45')],'type':_0x36cd36[_0x1ddb('0x46')]['key']};});_0x50f589[_0x1ddb('0x47')]=_['map'](_0x5e23d8,'name');_0x50f589[_0x1ddb('0x48')]=_[_0x1ddb('0x49')](_0x3e2322[_0x1ddb('0x48')]);_0x50f589['filters']=_['intersection'](_0x50f589[_0x1ddb('0x47')],_0x50f589[_0x1ddb('0x48')]);_0x37f30c[_0x1ddb('0x4a')]=_[_0x1ddb('0x4b')](_0x50f589[_0x1ddb('0x47')],qs[_0x1ddb('0x4c')](_0x3e2322['query']['fields']));_0x37f30c[_0x1ddb('0x4a')]=_0x37f30c[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x37f30c[_0x1ddb('0x4a')]:_0x50f589[_0x1ddb('0x47')];if(!_0x3e2322['query'][_0x1ddb('0x4e')](_0x1ddb('0x4f'))){_0x37f30c[_0x1ddb('0x34')]=qs[_0x1ddb('0x34')](_0x3e2322[_0x1ddb('0x48')]['limit']);_0x37f30c[_0x1ddb('0x32')]=qs['offset'](_0x3e2322[_0x1ddb('0x48')][_0x1ddb('0x32')]);}_0x37f30c['order']=qs[_0x1ddb('0x50')](_0x3e2322['query']['sort']);_0x37f30c[_0x1ddb('0x51')]=qs[_0x1ddb('0x52')](_['pick'](_0x3e2322['query'],_0x50f589[_0x1ddb('0x52')]),_0x5e23d8);if(_0x3e2322['query'][_0x1ddb('0x53')]){_0x37f30c['where']=_['merge'](_0x37f30c[_0x1ddb('0x51')],{'$or':_[_0x1ddb('0x54')](_0x5e23d8,function(_0x42d0b1){if(_0x42d0b1[_0x1ddb('0x46')]!=='VIRTUAL'){var _0x5eb9c0={};_0x5eb9c0[_0x42d0b1[_0x1ddb('0x3e')]]={'$like':'%'+_0x3e2322[_0x1ddb('0x48')]['filter']+'%'};return _0x5eb9c0;}})});}_0x37f30c=_[_0x1ddb('0x55')]({},_0x37f30c,_0x3e2322[_0x1ddb('0x56')]);var _0x51bb50={'where':_0x37f30c['where']};return db[_0x1ddb('0x43')][_0x1ddb('0x35')](_0x51bb50)[_0x1ddb('0x22')](function(_0x12fa01){_0xb352e5[_0x1ddb('0x35')]=_0x12fa01;if(_0x3e2322['query'][_0x1ddb('0x57')]){_0x37f30c[_0x1ddb('0x58')]=[{'all':!![]}];}return db[_0x1ddb('0x43')][_0x1ddb('0x59')](_0x37f30c);})[_0x1ddb('0x22')](function(_0x11240b){_0xb352e5[_0x1ddb('0x5a')]=_0x11240b;return _0xb352e5;})[_0x1ddb('0x22')](respondWithFilteredResult(_0x1afc01,_0x37f30c))[_0x1ddb('0x2d')](handleError(_0x1afc01,null));};exports[_0x1ddb('0x5b')]=function(_0x2f1abd,_0x12e2de){var _0x16ae18={'raw':![],'where':{'id':_0x2f1abd[_0x1ddb('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x1ddb('0x42')}]},_0x4635bf={};_0x4635bf[_0x1ddb('0x47')]=_[_0x1ddb('0x49')](db[_0x1ddb('0x43')]['rawAttributes']);_0x4635bf[_0x1ddb('0x48')]=_[_0x1ddb('0x49')](_0x2f1abd[_0x1ddb('0x48')]);_0x4635bf[_0x1ddb('0x52')]=_['intersection'](_0x4635bf[_0x1ddb('0x47')],_0x4635bf['query']);_0x16ae18[_0x1ddb('0x4a')]=_[_0x1ddb('0x4b')](_0x4635bf[_0x1ddb('0x47')],qs['fields'](_0x2f1abd[_0x1ddb('0x48')][_0x1ddb('0x4c')]));_0x16ae18['attributes']=_0x16ae18['attributes'][_0x1ddb('0x4d')]?_0x16ae18[_0x1ddb('0x4a')]:_0x4635bf['model'];if(_0x2f1abd[_0x1ddb('0x48')][_0x1ddb('0x57')]){_0x16ae18[_0x1ddb('0x58')]=[{'all':!![]}];}_0x16ae18=_[_0x1ddb('0x55')]({},_0x16ae18,_0x2f1abd[_0x1ddb('0x56')]);return db['FaxAccount'][_0x1ddb('0x5d')](_0x16ae18)[_0x1ddb('0x22')](handleEntityNotFound(_0x12e2de,null))['then'](respondWithResult(_0x12e2de,null))[_0x1ddb('0x2d')](handleError(_0x12e2de,null));};exports[_0x1ddb('0x5e')]=function(_0x16361d,_0x2b015e){return db['FaxAccount'][_0x1ddb('0x5e')](_0x16361d[_0x1ddb('0x5f')],{})['then'](function(_0x121b4a){var _0x3f071b=_0x16361d[_0x1ddb('0x60')][_0x1ddb('0x3b')]({'plain':!![]});if(!_0x3f071b)throw new Error(_0x1ddb('0x61'));if(_0x3f071b[_0x1ddb('0x62')]===_0x1ddb('0x60')){var _0x128d12=_0x121b4a[_0x1ddb('0x3b')]({'plain':!![]});var _0x1c96a4=_0x1ddb('0x63');return db[_0x1ddb('0x64')][_0x1ddb('0x5d')]({'where':{'name':_0x1c96a4,'userProfileId':_0x3f071b['userProfileId']},'raw':!![]})[_0x1ddb('0x22')](function(_0x29c2de){if(_0x29c2de&&_0x29c2de[_0x1ddb('0x65')]===0x0){return db[_0x1ddb('0x3c')][_0x1ddb('0x5e')]({'name':_0x128d12[_0x1ddb('0x3e')],'resourceId':_0x128d12['id'],'type':_0x29c2de[_0x1ddb('0x3e')],'sectionId':_0x29c2de['id']},{})[_0x1ddb('0x22')](function(){return _0x121b4a;});}else{return _0x121b4a;}})[_0x1ddb('0x2d')](function(_0xc63ff){logger['error'](_0x1ddb('0x66'),_0xc63ff);throw _0xc63ff;});}return _0x121b4a;})[_0x1ddb('0x22')](respondWithResult(_0x2b015e,0xc9))[_0x1ddb('0x2d')](handleError(_0x2b015e,null));};exports[_0x1ddb('0x67')]=function(_0x51e0b1,_0x4f3626){if(_0x51e0b1[_0x1ddb('0x5f')]['id']){delete _0x51e0b1[_0x1ddb('0x5f')]['id'];}return db['FaxAccount'][_0x1ddb('0x5d')]({'where':{'id':_0x51e0b1['params']['id']},'include':[{'model':db[_0x1ddb('0x41')],'as':_0x1ddb('0x42')}]})['then'](handleEntityNotFound(_0x4f3626,null))['then'](saveUpdates(_0x51e0b1[_0x1ddb('0x5f')],null))[_0x1ddb('0x22')](respondWithResult(_0x4f3626,null))['catch'](handleError(_0x4f3626,null));};exports[_0x1ddb('0x3a')]=function(_0x3c221a,_0x1641ba){return db[_0x1ddb('0x43')][_0x1ddb('0x5d')]({'where':{'id':_0x3c221a[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1641ba,null))[_0x1ddb('0x22')](removeEntity(_0x1641ba,null))[_0x1ddb('0x2d')](handleError(_0x1641ba,null));};exports[_0x1ddb('0x68')]=function(_0x1064f1,_0x230136){return db[_0x1ddb('0x43')]['describe']()[_0x1ddb('0x22')](respondWithResult(_0x230136,null))['catch'](handleError(_0x230136,null));};exports['addDisposition']=function(_0x3ac892,_0x33bc08,_0x1deac2){if(_0x3ac892['body']['id']){delete _0x3ac892['body']['id'];}return db[_0x1ddb('0x43')]['find']({'where':{'id':_0x3ac892[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x33bc08,null))['then'](function(_0x5cd86f){if(_0x5cd86f){_0x3ac892['body'][_0x1ddb('0x69')]=_0x5cd86f['id'];return db['Disposition']['create'](_0x3ac892[_0x1ddb('0x5f')]);}})['then'](respondWithResult(_0x33bc08,null))[_0x1ddb('0x2d')](handleError(_0x33bc08,null));};exports[_0x1ddb('0x6a')]=function(_0x2fb8f4,_0x31ed29,_0x22a7d1){var _0x5f3f52={'raw':![],'where':{}};var _0x2eaf21={};var _0x374bba={'count':0x0,'rows':[]};return db[_0x1ddb('0x43')]['findOne']({'where':{'id':_0x2fb8f4[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x31ed29,null))['then'](function(_0x29b2b2){if(_0x29b2b2){_0x2eaf21[_0x1ddb('0x47')]=_[_0x1ddb('0x49')](db[_0x1ddb('0x6b')][_0x1ddb('0x44')]);_0x2eaf21['query']=_[_0x1ddb('0x49')](_0x2fb8f4[_0x1ddb('0x48')]);_0x2eaf21[_0x1ddb('0x52')]=_['intersection'](_0x2eaf21[_0x1ddb('0x47')],_0x2eaf21[_0x1ddb('0x48')]);_0x5f3f52[_0x1ddb('0x4a')]=_[_0x1ddb('0x4b')](_0x2eaf21[_0x1ddb('0x47')],qs[_0x1ddb('0x4c')](_0x2fb8f4[_0x1ddb('0x48')]['fields']));_0x5f3f52[_0x1ddb('0x4a')]=_0x5f3f52[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x5f3f52[_0x1ddb('0x4a')]:_0x2eaf21[_0x1ddb('0x47')];if(!_0x2fb8f4['query'][_0x1ddb('0x4e')]('nolimit')){_0x5f3f52[_0x1ddb('0x34')]=qs[_0x1ddb('0x34')](_0x2fb8f4[_0x1ddb('0x48')]['limit']);_0x5f3f52[_0x1ddb('0x32')]=qs['offset'](_0x2fb8f4[_0x1ddb('0x48')][_0x1ddb('0x32')]);}_0x5f3f52[_0x1ddb('0x6c')]=qs[_0x1ddb('0x50')](_0x2fb8f4[_0x1ddb('0x48')][_0x1ddb('0x50')]);_0x5f3f52[_0x1ddb('0x51')]=qs['filters'](_[_0x1ddb('0x6d')](_0x2fb8f4['query'],_0x2eaf21[_0x1ddb('0x52')]));_0x5f3f52[_0x1ddb('0x51')][_0x1ddb('0x69')]=_0x29b2b2['id'];if(_0x2fb8f4[_0x1ddb('0x48')][_0x1ddb('0x53')]){_0x5f3f52[_0x1ddb('0x51')]=_[_0x1ddb('0x55')](_0x5f3f52['where'],{'$or':_[_0x1ddb('0x54')](_0x5f3f52[_0x1ddb('0x4a')],function(_0x16143d){var _0x3aad32={};_0x3aad32[_0x16143d]={'$like':'%'+_0x2fb8f4[_0x1ddb('0x48')][_0x1ddb('0x53')]+'%'};return _0x3aad32;})});}_0x5f3f52=_['merge']({},_0x5f3f52,_0x2fb8f4[_0x1ddb('0x56')]);return db[_0x1ddb('0x6b')][_0x1ddb('0x35')]({'where':_0x5f3f52[_0x1ddb('0x51')]})[_0x1ddb('0x22')](function(_0x106ae3){_0x374bba[_0x1ddb('0x35')]=_0x106ae3;if(_0x2fb8f4[_0x1ddb('0x48')]['includeAll']){_0x5f3f52[_0x1ddb('0x58')]=[{'all':!![]}];}return db[_0x1ddb('0x6b')][_0x1ddb('0x59')](_0x5f3f52);})[_0x1ddb('0x22')](function(_0x2a31ef){_0x374bba[_0x1ddb('0x5a')]=_0x2a31ef;return _0x374bba;});}})[_0x1ddb('0x22')](respondWithFilteredResult(_0x31ed29,_0x5f3f52))[_0x1ddb('0x2d')](handleError(_0x31ed29,null));};exports[_0x1ddb('0x6e')]=function(_0x1935f5,_0x17f65d,_0x553f67){return db[_0x1ddb('0x43')][_0x1ddb('0x5d')]({'where':{'id':_0x1935f5['params']['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x17f65d,null))[_0x1ddb('0x22')](function(_0x235f10){if(_0x235f10){return _0x235f10[_0x1ddb('0x6e')](_0x1935f5[_0x1ddb('0x48')][_0x1ddb('0x6f')]);}})['then'](respondWithStatusCode(_0x17f65d,null))['catch'](handleError(_0x17f65d,null));};exports[_0x1ddb('0x70')]=function(_0x11c082,_0x424a35,_0x3a4e32){if(_0x11c082[_0x1ddb('0x5f')]['id']){delete _0x11c082[_0x1ddb('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x11c082[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x424a35,null))[_0x1ddb('0x22')](function(_0x132be7){if(_0x132be7){_0x11c082[_0x1ddb('0x5f')][_0x1ddb('0x69')]=_0x132be7['id'];return db['CannedAnswer'][_0x1ddb('0x5e')](_0x11c082[_0x1ddb('0x5f')]);}})[_0x1ddb('0x22')](respondWithResult(_0x424a35,null))[_0x1ddb('0x2d')](handleError(_0x424a35,null));};exports['getAnswers']=function(_0x4c4fb3,_0x4a46ee,_0x5ea06e){var _0x3b1783={'raw':![],'where':{}};var _0xaaf759={};var _0x430a93={'count':0x0,'rows':[]};return db[_0x1ddb('0x43')][_0x1ddb('0x71')]({'where':{'id':_0x4c4fb3[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x4a46ee,null))['then'](function(_0x4ebb0f){if(_0x4ebb0f){_0xaaf759[_0x1ddb('0x47')]=_[_0x1ddb('0x49')](db[_0x1ddb('0x72')][_0x1ddb('0x44')]);_0xaaf759['query']=_[_0x1ddb('0x49')](_0x4c4fb3['query']);_0xaaf759['filters']=_[_0x1ddb('0x4b')](_0xaaf759[_0x1ddb('0x47')],_0xaaf759[_0x1ddb('0x48')]);_0x3b1783['attributes']=_[_0x1ddb('0x4b')](_0xaaf759[_0x1ddb('0x47')],qs[_0x1ddb('0x4c')](_0x4c4fb3[_0x1ddb('0x48')][_0x1ddb('0x4c')]));_0x3b1783[_0x1ddb('0x4a')]=_0x3b1783[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x3b1783['attributes']:_0xaaf759[_0x1ddb('0x47')];if(!_0x4c4fb3[_0x1ddb('0x48')]['hasOwnProperty'](_0x1ddb('0x4f'))){_0x3b1783[_0x1ddb('0x34')]=qs[_0x1ddb('0x34')](_0x4c4fb3[_0x1ddb('0x48')][_0x1ddb('0x34')]);_0x3b1783[_0x1ddb('0x32')]=qs[_0x1ddb('0x32')](_0x4c4fb3['query'][_0x1ddb('0x32')]);}_0x3b1783[_0x1ddb('0x6c')]=qs[_0x1ddb('0x50')](_0x4c4fb3['query'][_0x1ddb('0x50')]);_0x3b1783[_0x1ddb('0x51')]=qs['filters'](_[_0x1ddb('0x6d')](_0x4c4fb3[_0x1ddb('0x48')],_0xaaf759[_0x1ddb('0x52')]));_0x3b1783[_0x1ddb('0x51')]['FaxAccountId']=_0x4ebb0f['id'];if(_0x4c4fb3[_0x1ddb('0x48')][_0x1ddb('0x53')]){_0x3b1783['where']=_['merge'](_0x3b1783[_0x1ddb('0x51')],{'$or':_[_0x1ddb('0x54')](_0x3b1783['attributes'],function(_0x16f431){var _0x17f238={};_0x17f238[_0x16f431]={'$like':'%'+_0x4c4fb3['query'][_0x1ddb('0x53')]+'%'};return _0x17f238;})});}_0x3b1783=_[_0x1ddb('0x55')]({},_0x3b1783,_0x4c4fb3[_0x1ddb('0x56')]);return db[_0x1ddb('0x72')]['count']({'where':_0x3b1783[_0x1ddb('0x51')]})[_0x1ddb('0x22')](function(_0xf73385){_0x430a93[_0x1ddb('0x35')]=_0xf73385;if(_0x4c4fb3[_0x1ddb('0x48')][_0x1ddb('0x57')]){_0x3b1783['include']=[{'all':!![]}];}return db[_0x1ddb('0x72')][_0x1ddb('0x59')](_0x3b1783);})[_0x1ddb('0x22')](function(_0x15aef0){_0x430a93[_0x1ddb('0x5a')]=_0x15aef0;return _0x430a93;});}})[_0x1ddb('0x22')](respondWithFilteredResult(_0x4a46ee,_0x3b1783))[_0x1ddb('0x2d')](handleError(_0x4a46ee,null));};exports[_0x1ddb('0x73')]=function(_0x21c9df,_0x48794c,_0x84de8){return db['FaxAccount'][_0x1ddb('0x5d')]({'where':{'id':_0x21c9df['params']['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x48794c,null))['then'](function(_0x1326ac){if(_0x1326ac){return _0x1326ac[_0x1ddb('0x73')](_0x21c9df[_0x1ddb('0x48')][_0x1ddb('0x6f')]);}})[_0x1ddb('0x22')](respondWithStatusCode(_0x48794c,null))[_0x1ddb('0x2d')](handleError(_0x48794c,null));};exports[_0x1ddb('0x74')]=function(_0x47e60c,_0x534e14,_0x4824fb){return db['FaxInteraction']['find']({'where':{'id':_0x47e60c[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x534e14,null))['then'](function(_0xc427b1){if(_0xc427b1){return _0xc427b1['addInteraction'](_0x47e60c[_0x1ddb('0x5f')][_0x1ddb('0x6f')],_[_0x1ddb('0x75')](_0x47e60c[_0x1ddb('0x5f')],[_0x1ddb('0x6f'),'id'])||{});}})[_0x1ddb('0x22')](respondWithResult(_0x534e14,null))[_0x1ddb('0x2d')](handleError(_0x534e14,null));};exports['getInteractions']=function(_0x5213ce,_0x5d6457,_0x49c92d){var _0x2be54e={'raw':![],'where':{}};var _0x1ff977={};var _0x1b8eaf={'count':0x0,'rows':[]};return db[_0x1ddb('0x43')][_0x1ddb('0x71')]({'where':{'id':_0x5213ce[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d6457,null))['then'](function(_0x32d4f3){if(_0x32d4f3){_0x1ff977[_0x1ddb('0x47')]=_[_0x1ddb('0x49')](db[_0x1ddb('0x76')][_0x1ddb('0x44')]);_0x1ff977[_0x1ddb('0x48')]=_[_0x1ddb('0x49')](_0x5213ce[_0x1ddb('0x48')]);_0x1ff977[_0x1ddb('0x52')]=_[_0x1ddb('0x4b')](_0x1ff977[_0x1ddb('0x47')],_0x1ff977[_0x1ddb('0x48')]);_0x2be54e['attributes']=_[_0x1ddb('0x4b')](_0x1ff977[_0x1ddb('0x47')],qs[_0x1ddb('0x4c')](_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x4c')]));_0x2be54e[_0x1ddb('0x4a')]=_0x2be54e[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x2be54e['attributes']:_0x1ff977['model'];if(!_0x5213ce[_0x1ddb('0x48')]['hasOwnProperty'](_0x1ddb('0x4f'))){_0x2be54e[_0x1ddb('0x34')]=qs[_0x1ddb('0x34')](_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x34')]);_0x2be54e[_0x1ddb('0x32')]=qs[_0x1ddb('0x32')](_0x5213ce['query'][_0x1ddb('0x32')]);}_0x2be54e[_0x1ddb('0x6c')]=qs['sort'](_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x50')]);_0x2be54e[_0x1ddb('0x51')]=qs['filters'](_[_0x1ddb('0x6d')](_0x5213ce[_0x1ddb('0x48')],_0x1ff977[_0x1ddb('0x52')]));_0x2be54e[_0x1ddb('0x51')][_0x1ddb('0x69')]=_0x32d4f3['id'];if(_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x53')]){_0x2be54e['where']=_[_0x1ddb('0x55')](_0x2be54e[_0x1ddb('0x51')],{'$or':_[_0x1ddb('0x54')](_0x2be54e[_0x1ddb('0x4a')],function(_0x4d0fbd){var _0x2e220c={};_0x2e220c[_0x4d0fbd]={'$like':'%'+_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x53')]+'%'};return _0x2e220c;})});}_0x2be54e=_[_0x1ddb('0x55')]({},_0x2be54e,_0x5213ce['options']);return db[_0x1ddb('0x76')]['count']({'where':_0x2be54e[_0x1ddb('0x51')]})['then'](function(_0x418efe){_0x1b8eaf[_0x1ddb('0x35')]=_0x418efe;if(_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x57')]){_0x2be54e['include']=[{'model':db[_0x1ddb('0x77')],'as':_0x1ddb('0x78'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x1ddb('0x79'),_0x1ddb('0x7a')],'required':![]},{'model':db[_0x1ddb('0x7b')],'as':_0x1ddb('0x7c'),'attributes':['id','name',_0x1ddb('0x7d')],'where':_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x7e')]?{'id':_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x7e')]}:undefined,'required':_0x5213ce[_0x1ddb('0x48')][_0x1ddb('0x7e')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x2be54e);})['then'](function(_0x44cd04){_0x1b8eaf[_0x1ddb('0x5a')]=_0x44cd04;return _0x1b8eaf;});}})[_0x1ddb('0x22')](respondWithFilteredResult(_0x5d6457,_0x2be54e))[_0x1ddb('0x2d')](handleError(_0x5d6457,null));};exports[_0x1ddb('0x7f')]=function(_0x2d3e86,_0x4845f3){var _0x457081=_0x2d3e86[_0x1ddb('0x5c')]['id'];var _0x477fcc=_0x2d3e86[_0x1ddb('0x5f')];var _0x4a0190=0xc8;var _0x2651a4=null;return db[_0x1ddb('0x80')][_0x1ddb('0x81')]({'isolationLevel':db[_0x1ddb('0x80')][_0x1ddb('0x82')][_0x1ddb('0x83')][_0x1ddb('0x84')]},function(_0x5c737f){return db[_0x1ddb('0x43')]['findOne']({'where':{'id':_0x457081},'transaction':_0x5c737f})[_0x1ddb('0x22')](function(_0x31b7bc){if(_0x31b7bc){return db['FaxApplication'][_0x1ddb('0x3a')]({'where':{'FaxAccountId':_0x457081},'transaction':_0x5c737f})[_0x1ddb('0x22')](function(){var _0x5cf8a8=_[_0x1ddb('0x54')](_0x477fcc,function(_0x26b8e9){_0x26b8e9['FaxAccountId']=_0x457081;return _0x26b8e9;});return db['FaxApplication'][_0x1ddb('0x85')](_0x5cf8a8,{'transaction':_0x5c737f});});}else{_0x4a0190=0x194;_0x2651a4=[];}});})['then'](function(){if(_0x4a0190!==0x194){return db['FaxApplication'][_0x1ddb('0x86')]({'where':{'FaxAccountId':_0x457081},'order':_0x1ddb('0x87')})[_0x1ddb('0x22')](function(_0x4482d8){_0x2651a4=_0x4482d8;});}})[_0x1ddb('0x2d')](function(_0x3d03a7){_0x4a0190=0x1f4;logger[_0x1ddb('0x29')](_0x3d03a7['stack']);if(_0x3d03a7['name']){delete _0x3d03a7[_0x1ddb('0x3e')];}_0x2651a4=_0x3d03a7;})[_0x1ddb('0x88')](function(){if(_0x2651a4===null){_0x4845f3[_0x1ddb('0x2e')](_0x4a0190);}else{if(_0x4a0190===0x1f4){_0x4845f3[_0x1ddb('0x30')](_0x4a0190)[_0x1ddb('0x3f')](_0x2651a4);}else{_0x4845f3[_0x1ddb('0x30')](_0x4a0190)[_0x1ddb('0x31')](_0x2651a4);}}});};exports[_0x1ddb('0x89')]=function(_0x24c9c3,_0x4ca6df,_0x4fdf5a){var _0x10ae72={};var _0x2a39ea={};var _0x39ce82;var _0x311116;return db[_0x1ddb('0x43')][_0x1ddb('0x71')]({'where':{'id':_0x24c9c3[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ca6df,null))[_0x1ddb('0x22')](function(_0x516c99){if(_0x516c99){_0x39ce82=_0x516c99;_0x2a39ea['model']=_[_0x1ddb('0x49')](db[_0x1ddb('0x8a')]['rawAttributes']);_0x2a39ea[_0x1ddb('0x48')]=_[_0x1ddb('0x49')](_0x24c9c3['query']);_0x2a39ea[_0x1ddb('0x52')]=_[_0x1ddb('0x4b')](_0x2a39ea[_0x1ddb('0x47')],_0x2a39ea[_0x1ddb('0x48')]);_0x10ae72[_0x1ddb('0x4a')]=_[_0x1ddb('0x4b')](_0x2a39ea['model'],qs[_0x1ddb('0x4c')](_0x24c9c3[_0x1ddb('0x48')][_0x1ddb('0x4c')]));_0x10ae72['attributes']=_0x10ae72[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x10ae72[_0x1ddb('0x4a')]:_0x2a39ea[_0x1ddb('0x47')];_0x10ae72[_0x1ddb('0x6c')]=qs['sort'](_0x24c9c3['query'][_0x1ddb('0x50')]);_0x10ae72[_0x1ddb('0x51')]=qs[_0x1ddb('0x52')](_[_0x1ddb('0x6d')](_0x24c9c3[_0x1ddb('0x48')],_0x2a39ea[_0x1ddb('0x52')]));if(_0x24c9c3[_0x1ddb('0x48')]['filter']){_0x10ae72[_0x1ddb('0x51')]=_[_0x1ddb('0x55')](_0x10ae72[_0x1ddb('0x51')],{'$or':_[_0x1ddb('0x54')](_0x10ae72[_0x1ddb('0x4a')],function(_0x5bb9ca){var _0x53c2e7={};_0x53c2e7[_0x5bb9ca]={'$like':'%'+_0x24c9c3[_0x1ddb('0x48')][_0x1ddb('0x53')]+'%'};return _0x53c2e7;})});}_0x10ae72=_[_0x1ddb('0x55')]({},_0x10ae72,_0x24c9c3['options']);return _0x39ce82[_0x1ddb('0x89')](_0x10ae72);}})[_0x1ddb('0x22')](function(_0x4ba2c9){if(_0x4ba2c9){_0x311116=_0x4ba2c9[_0x1ddb('0x4d')];if(!_0x24c9c3[_0x1ddb('0x48')]['hasOwnProperty']('nolimit')){_0x10ae72[_0x1ddb('0x34')]=qs['limit'](_0x24c9c3[_0x1ddb('0x48')][_0x1ddb('0x34')]);_0x10ae72[_0x1ddb('0x32')]=qs[_0x1ddb('0x32')](_0x24c9c3['query'][_0x1ddb('0x32')]);}return _0x39ce82[_0x1ddb('0x89')](_0x10ae72);}})['then'](function(_0x4052ac){if(_0x4052ac){return _0x4052ac?{'count':_0x311116,'rows':_0x4052ac}:null;}})['then'](respondWithResult(_0x4ca6df,null))[_0x1ddb('0x2d')](handleError(_0x4ca6df,null));};function Extension(_0x25320e,_0x2ffeb5,_0x3416e7,_0x10f70f){this[_0x1ddb('0x8b')]='from-voip-provider';this['exten']=_0x25320e[_0x1ddb('0x8c')];this[_0x1ddb('0x8d')]=_0x10f70f;this[_0x1ddb('0x46')]='system';this[_0x1ddb('0x8e')]=_0x1ddb('0x8f');this[_0x1ddb('0x69')]=_0x25320e['id'];this[_0x1ddb('0x87')]=_0x2ffeb5;this[_0x1ddb('0x90')]=_0x3416e7;}function createExtensionsReciveFax(_0x16dc16){var _0x55b417=0x1;var _0x24ff83=[];_0x24ff83[_0x1ddb('0x91')](new Extension(_0x16dc16,_0x55b417,'',_0x1ddb('0x92')));_0x55b417+=0x1;_0x24ff83['push'](new Extension(_0x16dc16,_0x55b417,_0x1ddb('0x93'),_0x1ddb('0x94')));_0x55b417+=0x1;for(var _0x324dab in _0x16dc16){if(_0x16dc16[_0x1ddb('0x4e')](_0x324dab)&&(_0x324dab===_0x1ddb('0x95')||_0x324dab===_0x1ddb('0x8c')||_0x324dab===_0x1ddb('0x96')||_0x324dab==='faxdetect'||_0x324dab===_0x1ddb('0x97')||_0x324dab==='maxrate'||_0x324dab===_0x1ddb('0x98')||_0x324dab===_0x1ddb('0x99')||_0x324dab===_0x1ddb('0x9a'))){_0x24ff83['push'](new Extension(_0x16dc16,_0x55b417,_0x1ddb('0x9b')+_0x324dab+')='+_0x16dc16[_0x324dab],_0x1ddb('0x94')));_0x55b417+=0x1;}}_0x24ff83['push'](new Extension(_0x16dc16,_0x55b417,'6',_0x1ddb('0x9c')));_0x55b417+=0x1;_0x24ff83[_0x1ddb('0x91')](new Extension(_0x16dc16,_0x55b417,_0x1ddb('0x9d'),_0x1ddb('0x9e')));_0x55b417=0x0;return _0x24ff83;}exports[_0x1ddb('0x9f')]=function(_0x49aaef,_0x2e786b,_0x2469af){var _0x359e35;return db['sequelize'][_0x1ddb('0x81')](function(_0x21bbf7){return db['FaxAccount'][_0x1ddb('0x5e')](_0x49aaef['body'],{'transaction':_0x21bbf7})['then'](function(_0x11e75f){_0x359e35=_0x11e75f[_0x1ddb('0x3b')]({'plain':!![]});return db['VoiceExtension'][_0x1ddb('0x85')](createExtensionsReciveFax(_0x359e35),{'transaction':_0x21bbf7});});})[_0x1ddb('0x22')](function(){return _0x359e35;})[_0x1ddb('0x22')](respondWithResult(_0x2e786b,null))[_0x1ddb('0x2d')](handleError(_0x2e786b,null));};exports[_0x1ddb('0xa0')]=function(_0x4277f7,_0x2fc527,_0xbb6943){var _0x42ba0c;return db[_0x1ddb('0x80')][_0x1ddb('0x81')](function(_0x5f1fd8){return db[_0x1ddb('0x43')][_0x1ddb('0x67')](_0x4277f7[_0x1ddb('0x5f')],{'where':{'id':_0x4277f7['body']['id']},'transaction':_0x5f1fd8})[_0x1ddb('0x22')](function(_0xc85ef8){return db[_0x1ddb('0xa1')][_0x1ddb('0x3a')]({'where':{'FaxAccountId':_0x4277f7[_0x1ddb('0x5f')]['id']},'transaction':_0x5f1fd8})[_0x1ddb('0x22')](function(_0x24155b){return db[_0x1ddb('0xa1')][_0x1ddb('0x85')](createExtensionsReciveFax(_['omit'](_0x4277f7[_0x1ddb('0x5f')],[_0x1ddb('0xa2'),_0x1ddb('0xa3'),_0x1ddb('0xa4'),_0x1ddb('0xa5'),_0x1ddb('0xa6'),_0x1ddb('0xa7')])),{'transaction':_0x5f1fd8});});});})['then'](function(){return db['FaxAccount']['findById'](_0x4277f7[_0x1ddb('0x5f')]['id']);})[_0x1ddb('0x22')](respondWithResult(_0x2fc527,null))[_0x1ddb('0x2d')](handleError(_0x2fc527,null));};exports['getMessages']=function(_0x5e4f41,_0x585711,_0x12aea3){var _0x4373ae={'raw':!![],'where':{}};var _0x3ca871={};var _0x4a9225={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5e4f41[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x585711,null))[_0x1ddb('0x22')](function(_0x265c29){if(_0x265c29){_0x3ca871['model']=_[_0x1ddb('0x49')](db[_0x1ddb('0xa8')][_0x1ddb('0x44')]);_0x3ca871[_0x1ddb('0x48')]=_[_0x1ddb('0x49')](_0x5e4f41[_0x1ddb('0x48')]);_0x3ca871[_0x1ddb('0x52')]=_['intersection'](_0x3ca871[_0x1ddb('0x47')],_0x3ca871[_0x1ddb('0x48')]);_0x4373ae[_0x1ddb('0x4a')]=_[_0x1ddb('0x4b')](_0x3ca871[_0x1ddb('0x47')],qs[_0x1ddb('0x4c')](_0x5e4f41['query'][_0x1ddb('0x4c')]));_0x4373ae[_0x1ddb('0x4a')]=_0x4373ae[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x4373ae['attributes']:_0x3ca871[_0x1ddb('0x47')];if(!_0x5e4f41[_0x1ddb('0x48')]['hasOwnProperty']('nolimit')){_0x4373ae[_0x1ddb('0x34')]=qs['limit'](_0x5e4f41[_0x1ddb('0x48')]['limit']);_0x4373ae['offset']=qs[_0x1ddb('0x32')](_0x5e4f41[_0x1ddb('0x48')][_0x1ddb('0x32')]);}_0x4373ae[_0x1ddb('0x6c')]=qs[_0x1ddb('0x50')](_0x5e4f41['query']['sort']);_0x4373ae[_0x1ddb('0x51')]=qs[_0x1ddb('0x52')](_[_0x1ddb('0x6d')](_0x5e4f41[_0x1ddb('0x48')],_0x3ca871['filters']));_0x4373ae[_0x1ddb('0x51')][_0x1ddb('0x69')]=_0x265c29['id'];if(_0x5e4f41['query'][_0x1ddb('0x53')]){_0x4373ae['where']=_[_0x1ddb('0x55')](_0x4373ae['where'],{'$or':_[_0x1ddb('0x54')](_0x4373ae[_0x1ddb('0x4a')],function(_0x857e3f){var _0x3f7001={};_0x3f7001[_0x857e3f]={'$like':'%'+_0x5e4f41['query']['filter']+'%'};return _0x3f7001;})});}if(_0x5e4f41['query'][_0x1ddb('0xa9')]){var _0x17795a=_0x5e4f41['query']['$gte'][_0x1ddb('0xaa')](',');var _0x4febbf={};_0x4febbf[_0x17795a[0x0]]={'$gte':moment(_0x17795a[0x1])['format'](_0x1ddb('0xab'))};_0x4373ae[_0x1ddb('0x51')]=_[_0x1ddb('0x55')](_0x4373ae[_0x1ddb('0x51')],_0x4febbf);}_0x4373ae=_[_0x1ddb('0x55')]({},_0x4373ae,_0x5e4f41[_0x1ddb('0x56')]);return db['FaxMessage'][_0x1ddb('0x35')]({'where':_0x4373ae[_0x1ddb('0x51')]})[_0x1ddb('0x22')](function(_0x3c133b){_0x4a9225[_0x1ddb('0x35')]=_0x3c133b;if(_0x5e4f41[_0x1ddb('0x48')][_0x1ddb('0x57')]){_0x4373ae[_0x1ddb('0x58')]=[{'all':!![]}];}return db['FaxMessage'][_0x1ddb('0x59')](_0x4373ae);})[_0x1ddb('0x22')](function(_0x1f8029){_0x4a9225[_0x1ddb('0x5a')]=_0x1f8029;return _0x4a9225;});}})[_0x1ddb('0x22')](respondWithFilteredResult(_0x585711,_0x4373ae))['catch'](handleError(_0x585711,null));};exports[_0x1ddb('0x3f')]=function(_0x18eedb,_0x380914,_0x56a8f2){var _0x42aeca,_0x481b9a={},_0x1b1936;if(_0x18eedb[_0x1ddb('0x5f')]['to']){_0x1b1936=_0x18eedb[_0x1ddb('0x5f')]['to'][0x0];}return db[_0x1ddb('0x43')][_0x1ddb('0x5d')]({'where':{'id':_0x18eedb[_0x1ddb('0x5c')]['id']},'include':[{'model':db[_0x1ddb('0xac')],'as':_0x1ddb('0xad'),'include':[{'model':db[_0x1ddb('0x77')],'as':_0x1ddb('0xae'),'where':{'fax':_0x1b1936},'limit':0x1,'order':[['updatedAt',_0x1ddb('0xaf')]]}]}]})[_0x1ddb('0x22')](handleEntityNotFound(_0x380914,null))[_0x1ddb('0x22')](function(_0x568bf9){_0x42aeca=_0x568bf9;if(_0x18eedb[_0x1ddb('0x5f')]['attachments']&&_0x18eedb['body']['attachments'][_0x1ddb('0x4d')]){for(var _0x562bdc=0x0;_0x562bdc<_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][_0x1ddb('0x4d')];_0x562bdc+=0x1){_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][_0x562bdc]={'filename':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][_0x562bdc]['name'],'id':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][_0x562bdc]['id'],'path':path[_0x1ddb('0xb1')](config[_0x1ddb('0xb2')],_0x1ddb('0xb3'),_0x18eedb['body'][_0x1ddb('0xb0')][_0x562bdc][_0x1ddb('0xb4')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1ddb('0xb5'),{'FaxAccountId':_[_0x1ddb('0xb6')](_0x18eedb[_0x1ddb('0x5c')]['id'])?undefined:_0x18eedb[_0x1ddb('0x5c')]['id'],'path':_['isNil'](_0x18eedb['body'][_0x1ddb('0xb0')][0x0][_0x1ddb('0x6')])?undefined:_0x18eedb[_0x1ddb('0x5f')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x18eedb[_0x1ddb('0x5f')]['to'][0x0])?undefined:_0x18eedb[_0x1ddb('0x5f')]['to'][0x0]},client9002);})[_0x1ddb('0x22')](function(){if(_0x42aeca){if(_[_0x1ddb('0xb6')](_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb7')])){_0x18eedb['body'][_0x1ddb('0xb7')]=util['format'](_0x1ddb('0xb8'),_0x42aeca[_0x1ddb('0x3e')],_0x42aeca['fax']);}if(_0x42aeca[_0x1ddb('0xad')]){if(_0x42aeca[_0x1ddb('0xad')]['Contacts'][_0x1ddb('0x4d')]){return _0x42aeca['List'][_0x1ddb('0xae')][0x0];}else{return db[_0x1ddb('0x77')][_0x1ddb('0x5e')](_[_0x1ddb('0x1b')](_0x18eedb[_0x1ddb('0x5f')],{'firstName':_0x18eedb[_0x1ddb('0x5f')]['to'][0x0],'phone':_0x18eedb['body']['to'][0x0],'fax':_0x18eedb['body']['to'][0x0],'ListId':_0x42aeca[_0x1ddb('0xa7')]}));}}else{throw new Error(_0x1ddb('0xb9'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x2c64a5){if(_0x2c64a5){return db[_0x1ddb('0x76')][_0x1ddb('0x5d')]({'where':{'ContactId':_0x2c64a5['id'],'closed':![],'FaxAccountId':_0x42aeca['id']}})['then'](function(_0x6cd43c){if(_0x6cd43c){return[_0x6cd43c,![]];}return db[_0x1ddb('0x76')][_0x1ddb('0x5e')]({'UserId':_0x18eedb[_0x1ddb('0x60')]['id'],'ContactId':_0x2c64a5['id'],'FaxAccountId':_0x42aeca['id'],'fax':_0x18eedb['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1ddb('0x55')](_0x18eedb[_0x1ddb('0x5f')],{'read':![],'body':_0x18eedb[_0x1ddb('0x5f')]['attachments'][0x0][_0x1ddb('0xba')],'FaxAccountId':_0x42aeca['id'],'UserId':_0x18eedb[_0x1ddb('0x60')]['id'],'ContactId':_0x2c64a5['id'],'AttachmentId':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1ddb('0xbb')}]})['then'](function(_0x4a98b2){return[_0x4a98b2,!![]];});});}else{throw new Error(_0x1ddb('0xbc'));}})['spread'](function(_0x3d358a,_0x8bb6e1){if(_0x8bb6e1){return _0x3d358a;}return db[_0x1ddb('0xa8')][_0x1ddb('0x5e')]({'direction':_0x1ddb('0xbd'),'read':![],'body':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0][_0x1ddb('0xba')],'FaxAccountId':_0x42aeca['id'],'FaxInteractionId':_0x3d358a['id'],'UserId':_0x18eedb[_0x1ddb('0x60')]['id'],'ContactId':_0x3d358a[_0x1ddb('0xbe')],'AttachmentId':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0]['id']})[_0x1ddb('0x22')](function(_0x1b6755){_0x3d358a[_0x1ddb('0xbf')][_0x1ddb('0xbb')]=[];_0x3d358a[_0x1ddb('0xbf')]['Messages'][_0x1ddb('0x91')](_0x1b6755[_0x1ddb('0xbf')]);return _0x3d358a;});})[_0x1ddb('0x22')](function(_0x41cc20){respondWithRpcPromise(_0x1ddb('0xc0'),_0x1ddb('0xc0'),{'FaxAccountId':_[_0x1ddb('0xb6')](_0x18eedb['params']['id'])?undefined:_0x18eedb['params']['id'],'path':_[_0x1ddb('0xb6')](_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0][_0x1ddb('0x6')])?undefined:_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0][_0x1ddb('0x6')],'fax':_['isNil'](_0x18eedb[_0x1ddb('0x5f')]['to'][0x0])?undefined:_0x18eedb[_0x1ddb('0x5f')]['to'][0x0],'AttachmentId':_0x18eedb[_0x1ddb('0x5f')][_0x1ddb('0xb0')][0x0]['id']},client9002)[_0x1ddb('0x22')](function(_0x212eb7){logger[_0x1ddb('0x23')](_0x1ddb('0xc1'),_0x212eb7);})[_0x1ddb('0x2d')](function(_0x241295){logger['info'](_0x1ddb('0xc1'),_0x241295);});return _0x41cc20;})[_0x1ddb('0x22')](respondWithResult(_0x380914,null))['catch'](handleError(_0x380914,null));};exports[_0x1ddb('0xc2')]=function(_0x487b06,_0x5574e0,_0x575842){return db['FaxAccount'][_0x1ddb('0x5d')]({'where':{'id':_0x487b06[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x5574e0,null))[_0x1ddb('0x22')](function(_0x17291f){if(_0x17291f){return _0x17291f['addAgents'](_0x487b06[_0x1ddb('0x5f')][_0x1ddb('0x6f')],_[_0x1ddb('0x75')](_0x487b06['body'],[_0x1ddb('0x6f'),'id'])||{})[_0x1ddb('0xc3')](function(_0xfe000b){for(var _0x3466b3=0x0;_0x3466b3<_0x487b06['body'][_0x1ddb('0x6f')]['length'];_0x3466b3+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x487b06['body']['ids'][_0x3466b3]),'FaxAccountId':Number(_0x487b06[_0x1ddb('0x5c')]['id'])});}return _0xfe000b;});}})[_0x1ddb('0x22')](respondWithResult(_0x5574e0,null))[_0x1ddb('0x2d')](handleError(_0x5574e0,null));};exports[_0x1ddb('0xc4')]=function(_0x357faf,_0x107ca4,_0x58d749){return db[_0x1ddb('0x43')][_0x1ddb('0x5d')]({'where':{'id':_0x357faf[_0x1ddb('0x5c')]['id']}})[_0x1ddb('0x22')](handleEntityNotFound(_0x107ca4,null))[_0x1ddb('0x22')](function(_0x90a629){if(_0x90a629){return _0x90a629['removeAgents'](_0x357faf['query'][_0x1ddb('0x6f')])['then'](function(){if(_[_0x1ddb('0xc5')](_0x357faf[_0x1ddb('0x48')][_0x1ddb('0x6f')])){for(var _0x5b9e2b=0x0;_0x5b9e2b<_0x357faf[_0x1ddb('0x48')][_0x1ddb('0x6f')][_0x1ddb('0x4d')];_0x5b9e2b+=0x1){socket[_0x1ddb('0xc6')](_0x1ddb('0xc7'),{'UserId':Number(_0x357faf['query'][_0x1ddb('0x6f')][_0x5b9e2b]),'FaxAccountId':Number(_0x357faf[_0x1ddb('0x5c')]['id'])});}}else{socket[_0x1ddb('0xc6')](_0x1ddb('0xc7'),{'UserId':Number(_0x357faf['query'][_0x1ddb('0x6f')]),'FaxAccountId':Number(_0x357faf[_0x1ddb('0x5c')]['id'])});}});}})[_0x1ddb('0x22')](respondWithStatusCode(_0x107ca4,null))[_0x1ddb('0x2d')](handleError(_0x107ca4,null));};exports[_0x1ddb('0xc8')]=function(_0x4c6d0c,_0x264c11,_0x5c2438){var _0x5dba97={};var _0x2cfdae={};var _0x4066d1;var _0x3b5d11;return db[_0x1ddb('0x43')][_0x1ddb('0x71')]({'where':{'id':_0x4c6d0c[_0x1ddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x264c11,null))[_0x1ddb('0x22')](function(_0x3f1f10){if(_0x3f1f10){_0x4066d1=_0x3f1f10;_0x2cfdae[_0x1ddb('0x47')]=_[_0x1ddb('0x49')](db[_0x1ddb('0xc9')][_0x1ddb('0x44')]);_0x2cfdae['query']=_[_0x1ddb('0x49')](_0x4c6d0c[_0x1ddb('0x48')]);_0x2cfdae['filters']=_[_0x1ddb('0x4b')](_0x2cfdae['model'],_0x2cfdae[_0x1ddb('0x48')]);_0x5dba97[_0x1ddb('0x4a')]=_['intersection'](_0x2cfdae['model'],qs[_0x1ddb('0x4c')](_0x4c6d0c['query'][_0x1ddb('0x4c')]));_0x5dba97[_0x1ddb('0x4a')]=_0x5dba97[_0x1ddb('0x4a')][_0x1ddb('0x4d')]?_0x5dba97[_0x1ddb('0x4a')]:_0x2cfdae[_0x1ddb('0x47')];_0x5dba97[_0x1ddb('0x6c')]=qs[_0x1ddb('0x50')](_0x4c6d0c[_0x1ddb('0x48')][_0x1ddb('0x50')]);_0x5dba97[_0x1ddb('0x51')]=qs[_0x1ddb('0x52')](_[_0x1ddb('0x6d')](_0x4c6d0c[_0x1ddb('0x48')],_0x2cfdae[_0x1ddb('0x52')]));if(_0x4c6d0c[_0x1ddb('0x48')][_0x1ddb('0x53')]){_0x5dba97[_0x1ddb('0x51')]=_[_0x1ddb('0x55')](_0x5dba97[_0x1ddb('0x51')],{'$or':_[_0x1ddb('0x54')](_0x5dba97['attributes'],function(_0x5e29c4){var _0x15a125={};_0x15a125[_0x5e29c4]={'$like':'%'+_0x4c6d0c[_0x1ddb('0x48')]['filter']+'%'};return _0x15a125;})});}_0x5dba97=_[_0x1ddb('0x55')]({},_0x5dba97,_0x4c6d0c[_0x1ddb('0x56')]);return _0x4066d1['getAgents'](_0x5dba97);}})['then'](function(_0x23cccf){if(_0x23cccf){_0x3b5d11=_0x23cccf[_0x1ddb('0x4d')];if(!_0x4c6d0c[_0x1ddb('0x48')][_0x1ddb('0x4e')](_0x1ddb('0x4f'))){_0x5dba97[_0x1ddb('0x34')]=qs['limit'](_0x4c6d0c['query'][_0x1ddb('0x34')]);_0x5dba97[_0x1ddb('0x32')]=qs[_0x1ddb('0x32')](_0x4c6d0c[_0x1ddb('0x48')][_0x1ddb('0x32')]);}return _0x4066d1[_0x1ddb('0xc8')](_0x5dba97);}})['then'](function(_0x19ad26){if(_0x19ad26){return _0x19ad26?{'count':_0x3b5d11,'rows':_0x19ad26}:null;}})[_0x1ddb('0x22')](respondWithResult(_0x264c11,null))[_0x1ddb('0x2d')](handleError(_0x264c11,null));}; \ No newline at end of file +var _0xfa30=['message','result','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','FaxAccounts','UserProfileResource','destroy','name','index','Pause','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','FaxAccount','include','findAll','rows','show','params','mandatoryDispositionPause','length','options','find','catch','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','create','findOne','hasOwnProperty','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','send','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','updateAccountApplications','transaction','VoiceExtension','tech','createdAt','updatedAt','TrunkId','findById','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','DESC','attachments','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','omit','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','redis','defaults','localhost','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x203296,_0x2906cb){var _0x57df2c=function(_0x5160ee){while(--_0x5160ee){_0x203296['push'](_0x203296['shift']());}};_0x57df2c(++_0x2906cb);}(_0xfa30,0x164));var _0x0fa3=function(_0x38b59d,_0x32e8f9){_0x38b59d=_0x38b59d-0x0;var _0x45d027=_0xfa30[_0x38b59d];return _0x45d027;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fa3('0x0'));var zipdir=require(_0x0fa3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fa3('0x2'));var moment=require(_0x0fa3('0x3'));var BPromise=require(_0x0fa3('0x4'));var Mustache=require(_0x0fa3('0x5'));var util=require(_0x0fa3('0x6'));var path=require(_0x0fa3('0x7'));var sox=require(_0x0fa3('0x8'));var csv=require(_0x0fa3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0fa3('0xa'));var _=require(_0x0fa3('0xb'));var squel=require('squel');var crypto=require(_0x0fa3('0xc'));var jsforce=require(_0x0fa3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0fa3('0x9'));var querystring=require(_0x0fa3('0xe'));var Papa=require(_0x0fa3('0xf'));var Redis=require(_0x0fa3('0x10'));var authService=require(_0x0fa3('0x11'));var qs=require(_0x0fa3('0x12'));var as=require(_0x0fa3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fa3('0x14'))(_0x0fa3('0x15'));var utils=require(_0x0fa3('0x16'));var config=require(_0x0fa3('0x17'));var licenseUtil=require(_0x0fa3('0x18'));var db=require(_0x0fa3('0x19'))['db'];config[_0x0fa3('0x1a')]=_[_0x0fa3('0x1b')](config['redis'],{'host':_0x0fa3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fa3('0x1a')]));require('./faxAccount.socket')[_0x0fa3('0x1d')](socket);var jayson=require(_0x0fa3('0x1e'));var client=jayson['client'][_0x0fa3('0x1f')]({'port':0x232c});var client9002=jayson[_0x0fa3('0x20')][_0x0fa3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x7126fc,_0x514c77,_0x3c5104,_0xb8c3bc){return new BPromise(function(_0x2cb23c,_0x4f00a8){var _0x494a77=_0xb8c3bc||client;return _0x494a77[_0x0fa3('0x21')](_0x7126fc,_0x3c5104)['then'](function(_0x47adcf){logger[_0x0fa3('0x22')](_0x0fa3('0x23'),_0x514c77,'request\x20sent');logger[_0x0fa3('0x24')](_0x0fa3('0x25'),_0x514c77,_0x0fa3('0x26'),JSON[_0x0fa3('0x27')](_0x47adcf));if(_0x47adcf[_0x0fa3('0x28')]){if(_0x47adcf[_0x0fa3('0x28')][_0x0fa3('0x29')]===0x1f4){logger[_0x0fa3('0x28')](_0x0fa3('0x23'),_0x514c77,_0x47adcf[_0x0fa3('0x28')][_0x0fa3('0x2a')]);return _0x4f00a8(_0x47adcf[_0x0fa3('0x28')][_0x0fa3('0x2a')]);}logger['error'](_0x0fa3('0x23'),_0x514c77,_0x47adcf[_0x0fa3('0x28')][_0x0fa3('0x2a')]);return _0x2cb23c(_0x47adcf[_0x0fa3('0x28')]['message']);}else{logger[_0x0fa3('0x22')](_0x0fa3('0x23'),_0x514c77,_0x0fa3('0x26'));_0x2cb23c(_0x47adcf[_0x0fa3('0x2b')]['message']);}})['catch'](function(_0x1def18){logger[_0x0fa3('0x28')](_0x0fa3('0x23'),_0x514c77,_0x1def18);_0x4f00a8(_0x1def18);});});}function respondWithStatusCode(_0x48149b,_0x504a3a){_0x504a3a=_0x504a3a||0xcc;return function(_0x2eb15d){if(_0x2eb15d){return _0x48149b[_0x0fa3('0x2c')](_0x504a3a);}return _0x48149b[_0x0fa3('0x2d')](_0x504a3a)[_0x0fa3('0x2e')]();};}function respondWithResult(_0x5e47fb,_0x57d877){_0x57d877=_0x57d877||0xc8;return function(_0x1796f4){if(_0x1796f4){return _0x5e47fb[_0x0fa3('0x2d')](_0x57d877)['json'](_0x1796f4);}};}function respondWithFilteredResult(_0x3a8bab,_0x3d1e67){return function(_0x180543){if(_0x180543){var _0x1193ec=typeof _0x3d1e67['offset']===_0x0fa3('0x2f')&&typeof _0x3d1e67[_0x0fa3('0x30')]===_0x0fa3('0x2f');var _0xefe58d=_0x180543[_0x0fa3('0x31')];var _0x1285da=_0x1193ec?0x0:_0x3d1e67['offset'];var _0x22906d=_0x1193ec?_0x180543[_0x0fa3('0x31')]:_0x3d1e67[_0x0fa3('0x32')]+_0x3d1e67[_0x0fa3('0x30')];var _0x1da132;if(_0x22906d>=_0xefe58d){_0x22906d=_0xefe58d;_0x1da132=0xc8;}else{_0x1da132=0xce;}_0x3a8bab[_0x0fa3('0x2d')](_0x1da132);return _0x3a8bab[_0x0fa3('0x33')](_0x0fa3('0x34'),_0x1285da+'-'+_0x22906d+'/'+_0xefe58d)[_0x0fa3('0x35')](_0x180543);}return null;};}function patchUpdates(_0x3450f8){return function(_0x4c0427){try{jsonpatch['apply'](_0x4c0427,_0x3450f8,!![]);}catch(_0xb89a17){return BPromise[_0x0fa3('0x36')](_0xb89a17);}return _0x4c0427[_0x0fa3('0x37')]();};}function saveUpdates(_0x5327a5,_0x5627a9){return function(_0xec5402){if(_0xec5402){return _0xec5402[_0x0fa3('0x38')](_0x5327a5)['then'](function(_0x27218c){return _0x27218c;});}return null;};}function removeEntity(_0x404d8a,_0x49a327){return function(_0x561435){if(_0x561435){return _0x561435['destroy']()[_0x0fa3('0x39')](function(){var _0x33ad57=_0x561435[_0x0fa3('0x3a')]({'plain':!![]});var _0x449102=_0x0fa3('0x3b');return db[_0x0fa3('0x3c')][_0x0fa3('0x3d')]({'where':{'type':_0x449102,'resourceId':_0x33ad57['id']}})[_0x0fa3('0x39')](function(){return _0x561435;});})[_0x0fa3('0x39')](function(){_0x404d8a[_0x0fa3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x181e63,_0x4ca569){return function(_0x5d2619){if(!_0x5d2619){_0x181e63['sendStatus'](0x194);}return _0x5d2619;};}function handleError(_0x5a763e,_0x12c203){_0x12c203=_0x12c203||0x1f4;return function(_0x2f5b6e){logger[_0x0fa3('0x28')](_0x2f5b6e['stack']);if(_0x2f5b6e[_0x0fa3('0x3e')]){delete _0x2f5b6e[_0x0fa3('0x3e')];}_0x5a763e[_0x0fa3('0x2d')](_0x12c203)['send'](_0x2f5b6e);};}exports[_0x0fa3('0x3f')]=function(_0x1bfca5,_0x53c26a){var _0x4cd607={'include':[{'model':db[_0x0fa3('0x40')],'as':'mandatoryDispositionPause'}]},_0x4575b0={},_0x4b0aed={'count':0x0,'rows':[]};var _0x4ce892=_[_0x0fa3('0x41')](db['FaxAccount'][_0x0fa3('0x42')],function(_0x2d37d1){return{'name':_0x2d37d1[_0x0fa3('0x43')],'type':_0x2d37d1['type'][_0x0fa3('0x44')]};});_0x4575b0[_0x0fa3('0x45')]=_[_0x0fa3('0x41')](_0x4ce892,_0x0fa3('0x3e'));_0x4575b0['query']=_[_0x0fa3('0x46')](_0x1bfca5[_0x0fa3('0x47')]);_0x4575b0['filters']=_[_0x0fa3('0x48')](_0x4575b0['model'],_0x4575b0['query']);_0x4cd607[_0x0fa3('0x49')]=_[_0x0fa3('0x48')](_0x4575b0[_0x0fa3('0x45')],qs[_0x0fa3('0x4a')](_0x1bfca5[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0x4cd607[_0x0fa3('0x49')]=_0x4cd607[_0x0fa3('0x49')]['length']?_0x4cd607[_0x0fa3('0x49')]:_0x4575b0[_0x0fa3('0x45')];if(!_0x1bfca5['query']['hasOwnProperty'](_0x0fa3('0x4b'))){_0x4cd607['limit']=qs['limit'](_0x1bfca5['query']['limit']);_0x4cd607['offset']=qs[_0x0fa3('0x32')](_0x1bfca5['query'][_0x0fa3('0x32')]);}_0x4cd607[_0x0fa3('0x4c')]=qs[_0x0fa3('0x4d')](_0x1bfca5[_0x0fa3('0x47')][_0x0fa3('0x4d')]);_0x4cd607[_0x0fa3('0x4e')]=qs[_0x0fa3('0x4f')](_[_0x0fa3('0x50')](_0x1bfca5[_0x0fa3('0x47')],_0x4575b0['filters']),_0x4ce892);if(_0x1bfca5[_0x0fa3('0x47')][_0x0fa3('0x51')]){_0x4cd607['where']=_['merge'](_0x4cd607[_0x0fa3('0x4e')],{'$or':_[_0x0fa3('0x41')](_0x4ce892,function(_0x6c78ae){if(_0x6c78ae[_0x0fa3('0x52')]!==_0x0fa3('0x53')){var _0x1d92d8={};_0x1d92d8[_0x6c78ae[_0x0fa3('0x3e')]]={'$like':'%'+_0x1bfca5[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0x1d92d8;}})});}_0x4cd607=_[_0x0fa3('0x54')]({},_0x4cd607,_0x1bfca5['options']);var _0x55216b={'where':_0x4cd607[_0x0fa3('0x4e')]};return db[_0x0fa3('0x55')][_0x0fa3('0x31')](_0x55216b)[_0x0fa3('0x39')](function(_0x4f831f){_0x4b0aed[_0x0fa3('0x31')]=_0x4f831f;if(_0x1bfca5['query']['includeAll']){_0x4cd607[_0x0fa3('0x56')]=[{'all':!![]}];}return db[_0x0fa3('0x55')][_0x0fa3('0x57')](_0x4cd607);})['then'](function(_0x81e4f7){_0x4b0aed[_0x0fa3('0x58')]=_0x81e4f7;return _0x4b0aed;})['then'](respondWithFilteredResult(_0x53c26a,_0x4cd607))['catch'](handleError(_0x53c26a,null));};exports[_0x0fa3('0x59')]=function(_0x3bf3d5,_0x46c5eb){var _0x2455a4={'raw':![],'where':{'id':_0x3bf3d5[_0x0fa3('0x5a')]['id']},'include':[{'model':db[_0x0fa3('0x40')],'as':_0x0fa3('0x5b')}]},_0x375a07={};_0x375a07[_0x0fa3('0x45')]=_[_0x0fa3('0x46')](db['FaxAccount'][_0x0fa3('0x42')]);_0x375a07['query']=_['keys'](_0x3bf3d5[_0x0fa3('0x47')]);_0x375a07[_0x0fa3('0x4f')]=_['intersection'](_0x375a07['model'],_0x375a07['query']);_0x2455a4[_0x0fa3('0x49')]=_[_0x0fa3('0x48')](_0x375a07['model'],qs[_0x0fa3('0x4a')](_0x3bf3d5[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0x2455a4[_0x0fa3('0x49')]=_0x2455a4[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0x2455a4['attributes']:_0x375a07['model'];if(_0x3bf3d5[_0x0fa3('0x47')]['includeAll']){_0x2455a4[_0x0fa3('0x56')]=[{'all':!![]}];}_0x2455a4=_[_0x0fa3('0x54')]({},_0x2455a4,_0x3bf3d5[_0x0fa3('0x5d')]);return db[_0x0fa3('0x55')][_0x0fa3('0x5e')](_0x2455a4)[_0x0fa3('0x39')](handleEntityNotFound(_0x46c5eb,null))['then'](respondWithResult(_0x46c5eb,null))[_0x0fa3('0x5f')](handleError(_0x46c5eb,null));};exports['create']=function(_0x4d3e5d,_0x4699bd){return db[_0x0fa3('0x55')]['create'](_0x4d3e5d['body'],{})[_0x0fa3('0x39')](function(_0x81e308){var _0x6b1730=_0x4d3e5d[_0x0fa3('0x60')][_0x0fa3('0x3a')]({'plain':!![]});if(!_0x6b1730)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b1730['role']===_0x0fa3('0x60')){var _0x170cca=_0x81e308[_0x0fa3('0x3a')]({'plain':!![]});var _0x179e66=_0x0fa3('0x3b');return db[_0x0fa3('0x61')][_0x0fa3('0x5e')]({'where':{'name':_0x179e66,'userProfileId':_0x6b1730[_0x0fa3('0x62')]},'raw':!![]})[_0x0fa3('0x39')](function(_0x426f91){if(_0x426f91&&_0x426f91['autoAssociation']===0x0){return db[_0x0fa3('0x3c')]['create']({'name':_0x170cca['name'],'resourceId':_0x170cca['id'],'type':_0x426f91['name'],'sectionId':_0x426f91['id']},{})[_0x0fa3('0x39')](function(){return _0x81e308;});}else{return _0x81e308;}})[_0x0fa3('0x5f')](function(_0x496a43){logger[_0x0fa3('0x28')](_0x0fa3('0x63'),_0x496a43);throw _0x496a43;});}return _0x81e308;})['then'](respondWithResult(_0x4699bd,0xc9))[_0x0fa3('0x5f')](handleError(_0x4699bd,null));};exports[_0x0fa3('0x38')]=function(_0x4f2a07,_0x19d950){if(_0x4f2a07['body']['id']){delete _0x4f2a07[_0x0fa3('0x64')]['id'];}return db[_0x0fa3('0x55')]['find']({'where':{'id':_0x4f2a07[_0x0fa3('0x5a')]['id']},'include':[{'model':db[_0x0fa3('0x40')],'as':_0x0fa3('0x5b')}]})['then'](handleEntityNotFound(_0x19d950,null))[_0x0fa3('0x39')](saveUpdates(_0x4f2a07[_0x0fa3('0x64')],null))[_0x0fa3('0x39')](respondWithResult(_0x19d950,null))[_0x0fa3('0x5f')](handleError(_0x19d950,null));};exports['destroy']=function(_0x10f634,_0x228b49){return db['FaxAccount']['find']({'where':{'id':_0x10f634[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x228b49,null))['then'](removeEntity(_0x228b49,null))['catch'](handleError(_0x228b49,null));};exports[_0x0fa3('0x65')]=function(_0x818684,_0x38b7a5){return db[_0x0fa3('0x55')]['describe']()['then'](respondWithResult(_0x38b7a5,null))[_0x0fa3('0x5f')](handleError(_0x38b7a5,null));};exports[_0x0fa3('0x66')]=function(_0x586521,_0x88a2bf,_0x4397e6){if(_0x586521[_0x0fa3('0x64')]['id']){delete _0x586521['body']['id'];}return db[_0x0fa3('0x55')][_0x0fa3('0x5e')]({'where':{'id':_0x586521[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x88a2bf,null))[_0x0fa3('0x39')](function(_0x44b6f9){if(_0x44b6f9){_0x586521[_0x0fa3('0x64')][_0x0fa3('0x67')]=_0x44b6f9['id'];return db[_0x0fa3('0x68')][_0x0fa3('0x69')](_0x586521[_0x0fa3('0x64')]);}})['then'](respondWithResult(_0x88a2bf,null))[_0x0fa3('0x5f')](handleError(_0x88a2bf,null));};exports['getDispositions']=function(_0x565b04,_0x43cd40,_0x3262c1){var _0xd6f8f0={'raw':![],'where':{}};var _0xbe6118={};var _0x3a4adb={'count':0x0,'rows':[]};return db[_0x0fa3('0x55')][_0x0fa3('0x6a')]({'where':{'id':_0x565b04[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x43cd40,null))[_0x0fa3('0x39')](function(_0x2eeb00){if(_0x2eeb00){_0xbe6118[_0x0fa3('0x45')]=_['keys'](db[_0x0fa3('0x68')][_0x0fa3('0x42')]);_0xbe6118['query']=_[_0x0fa3('0x46')](_0x565b04[_0x0fa3('0x47')]);_0xbe6118[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0xbe6118[_0x0fa3('0x45')],_0xbe6118[_0x0fa3('0x47')]);_0xd6f8f0[_0x0fa3('0x49')]=_[_0x0fa3('0x48')](_0xbe6118[_0x0fa3('0x45')],qs['fields'](_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0xd6f8f0[_0x0fa3('0x49')]=_0xd6f8f0[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0xd6f8f0['attributes']:_0xbe6118[_0x0fa3('0x45')];if(!_0x565b04['query'][_0x0fa3('0x6b')](_0x0fa3('0x4b'))){_0xd6f8f0[_0x0fa3('0x30')]=qs['limit'](_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x30')]);_0xd6f8f0[_0x0fa3('0x32')]=qs[_0x0fa3('0x32')](_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x32')]);}_0xd6f8f0['order']=qs[_0x0fa3('0x4d')](_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x4d')]);_0xd6f8f0[_0x0fa3('0x4e')]=qs['filters'](_['pick'](_0x565b04[_0x0fa3('0x47')],_0xbe6118[_0x0fa3('0x4f')]));_0xd6f8f0[_0x0fa3('0x4e')][_0x0fa3('0x67')]=_0x2eeb00['id'];if(_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x51')]){_0xd6f8f0['where']=_[_0x0fa3('0x54')](_0xd6f8f0['where'],{'$or':_[_0x0fa3('0x41')](_0xd6f8f0[_0x0fa3('0x49')],function(_0x4d1bbc){var _0x272d3d={};_0x272d3d[_0x4d1bbc]={'$like':'%'+_0x565b04[_0x0fa3('0x47')]['filter']+'%'};return _0x272d3d;})});}_0xd6f8f0=_[_0x0fa3('0x54')]({},_0xd6f8f0,_0x565b04[_0x0fa3('0x5d')]);return db[_0x0fa3('0x68')][_0x0fa3('0x31')]({'where':_0xd6f8f0[_0x0fa3('0x4e')]})[_0x0fa3('0x39')](function(_0x59d95a){_0x3a4adb[_0x0fa3('0x31')]=_0x59d95a;if(_0x565b04[_0x0fa3('0x47')][_0x0fa3('0x6c')]){_0xd6f8f0['include']=[{'all':!![]}];}return db['Disposition'][_0x0fa3('0x57')](_0xd6f8f0);})['then'](function(_0x2a2d57){_0x3a4adb[_0x0fa3('0x58')]=_0x2a2d57;return _0x3a4adb;});}})[_0x0fa3('0x39')](respondWithFilteredResult(_0x43cd40,_0xd6f8f0))[_0x0fa3('0x5f')](handleError(_0x43cd40,null));};exports[_0x0fa3('0x6d')]=function(_0x539228,_0x501aed,_0x55de6f){return db[_0x0fa3('0x55')][_0x0fa3('0x5e')]({'where':{'id':_0x539228[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x501aed,null))['then'](function(_0x4b431d){if(_0x4b431d){return _0x4b431d['removeDispositions'](_0x539228[_0x0fa3('0x47')]['ids']);}})[_0x0fa3('0x39')](respondWithStatusCode(_0x501aed,null))[_0x0fa3('0x5f')](handleError(_0x501aed,null));};exports[_0x0fa3('0x6e')]=function(_0x30e383,_0x53febb,_0x57fb78){if(_0x30e383[_0x0fa3('0x64')]['id']){delete _0x30e383[_0x0fa3('0x64')]['id'];}return db[_0x0fa3('0x55')][_0x0fa3('0x5e')]({'where':{'id':_0x30e383[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x53febb,null))[_0x0fa3('0x39')](function(_0x280fd8){if(_0x280fd8){_0x30e383[_0x0fa3('0x64')][_0x0fa3('0x67')]=_0x280fd8['id'];return db[_0x0fa3('0x6f')]['create'](_0x30e383[_0x0fa3('0x64')]);}})[_0x0fa3('0x39')](respondWithResult(_0x53febb,null))[_0x0fa3('0x5f')](handleError(_0x53febb,null));};exports[_0x0fa3('0x70')]=function(_0x27567,_0x153618,_0x8f5a9d){var _0x110e93={'raw':![],'where':{}};var _0x55acc0={};var _0x283041={'count':0x0,'rows':[]};return db[_0x0fa3('0x55')][_0x0fa3('0x6a')]({'where':{'id':_0x27567['params']['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x153618,null))['then'](function(_0x3de1bc){if(_0x3de1bc){_0x55acc0[_0x0fa3('0x45')]=_['keys'](db[_0x0fa3('0x6f')][_0x0fa3('0x42')]);_0x55acc0[_0x0fa3('0x47')]=_[_0x0fa3('0x46')](_0x27567['query']);_0x55acc0[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0x55acc0[_0x0fa3('0x45')],_0x55acc0[_0x0fa3('0x47')]);_0x110e93[_0x0fa3('0x49')]=_[_0x0fa3('0x48')](_0x55acc0[_0x0fa3('0x45')],qs[_0x0fa3('0x4a')](_0x27567[_0x0fa3('0x47')]['fields']));_0x110e93['attributes']=_0x110e93[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0x110e93[_0x0fa3('0x49')]:_0x55acc0[_0x0fa3('0x45')];if(!_0x27567[_0x0fa3('0x47')][_0x0fa3('0x6b')](_0x0fa3('0x4b'))){_0x110e93[_0x0fa3('0x30')]=qs[_0x0fa3('0x30')](_0x27567[_0x0fa3('0x47')]['limit']);_0x110e93[_0x0fa3('0x32')]=qs['offset'](_0x27567['query'][_0x0fa3('0x32')]);}_0x110e93[_0x0fa3('0x4c')]=qs[_0x0fa3('0x4d')](_0x27567['query'][_0x0fa3('0x4d')]);_0x110e93[_0x0fa3('0x4e')]=qs[_0x0fa3('0x4f')](_['pick'](_0x27567[_0x0fa3('0x47')],_0x55acc0['filters']));_0x110e93[_0x0fa3('0x4e')][_0x0fa3('0x67')]=_0x3de1bc['id'];if(_0x27567[_0x0fa3('0x47')]['filter']){_0x110e93[_0x0fa3('0x4e')]=_[_0x0fa3('0x54')](_0x110e93[_0x0fa3('0x4e')],{'$or':_[_0x0fa3('0x41')](_0x110e93[_0x0fa3('0x49')],function(_0x2d6792){var _0x4da8e2={};_0x4da8e2[_0x2d6792]={'$like':'%'+_0x27567[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0x4da8e2;})});}_0x110e93=_[_0x0fa3('0x54')]({},_0x110e93,_0x27567[_0x0fa3('0x5d')]);return db[_0x0fa3('0x6f')][_0x0fa3('0x31')]({'where':_0x110e93[_0x0fa3('0x4e')]})[_0x0fa3('0x39')](function(_0x30826e){_0x283041[_0x0fa3('0x31')]=_0x30826e;if(_0x27567[_0x0fa3('0x47')][_0x0fa3('0x6c')]){_0x110e93['include']=[{'all':!![]}];}return db[_0x0fa3('0x6f')]['findAll'](_0x110e93);})[_0x0fa3('0x39')](function(_0x594a99){_0x283041['rows']=_0x594a99;return _0x283041;});}})[_0x0fa3('0x39')](respondWithFilteredResult(_0x153618,_0x110e93))['catch'](handleError(_0x153618,null));};exports['removeAnswers']=function(_0x596afb,_0x31eb20,_0x4929af){return db['FaxAccount']['find']({'where':{'id':_0x596afb[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x31eb20,null))['then'](function(_0x3bb848){if(_0x3bb848){return _0x3bb848[_0x0fa3('0x71')](_0x596afb['query'][_0x0fa3('0x72')]);}})[_0x0fa3('0x39')](respondWithStatusCode(_0x31eb20,null))[_0x0fa3('0x5f')](handleError(_0x31eb20,null));};exports[_0x0fa3('0x73')]=function(_0x1555cb,_0x41ba4e,_0x30cb12){return db[_0x0fa3('0x74')][_0x0fa3('0x5e')]({'where':{'id':_0x1555cb[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x41ba4e,null))['then'](function(_0x459a4c){if(_0x459a4c){return _0x459a4c[_0x0fa3('0x73')](_0x1555cb['body'][_0x0fa3('0x72')],_['omit'](_0x1555cb[_0x0fa3('0x64')],[_0x0fa3('0x72'),'id'])||{});}})[_0x0fa3('0x39')](respondWithResult(_0x41ba4e,null))['catch'](handleError(_0x41ba4e,null));};exports['getInteractions']=function(_0x68d23f,_0x26b13c,_0x76f6f7){var _0x1c4587={'raw':![],'where':{}};var _0x45b7a2={};var _0x26b1d3={'count':0x0,'rows':[]};return db[_0x0fa3('0x55')][_0x0fa3('0x6a')]({'where':{'id':_0x68d23f[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x26b13c,null))[_0x0fa3('0x39')](function(_0xfdc441){if(_0xfdc441){_0x45b7a2['model']=_[_0x0fa3('0x46')](db[_0x0fa3('0x74')]['rawAttributes']);_0x45b7a2[_0x0fa3('0x47')]=_[_0x0fa3('0x46')](_0x68d23f[_0x0fa3('0x47')]);_0x45b7a2[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0x45b7a2[_0x0fa3('0x45')],_0x45b7a2[_0x0fa3('0x47')]);_0x1c4587['attributes']=_[_0x0fa3('0x48')](_0x45b7a2[_0x0fa3('0x45')],qs['fields'](_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0x1c4587['attributes']=_0x1c4587[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0x1c4587[_0x0fa3('0x49')]:_0x45b7a2[_0x0fa3('0x45')];if(!_0x68d23f[_0x0fa3('0x47')]['hasOwnProperty'](_0x0fa3('0x4b'))){_0x1c4587[_0x0fa3('0x30')]=qs[_0x0fa3('0x30')](_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x30')]);_0x1c4587[_0x0fa3('0x32')]=qs[_0x0fa3('0x32')](_0x68d23f['query']['offset']);}_0x1c4587[_0x0fa3('0x4c')]=qs[_0x0fa3('0x4d')](_0x68d23f['query']['sort']);_0x1c4587['where']=qs[_0x0fa3('0x4f')](_[_0x0fa3('0x50')](_0x68d23f[_0x0fa3('0x47')],_0x45b7a2[_0x0fa3('0x4f')]));_0x1c4587[_0x0fa3('0x4e')][_0x0fa3('0x67')]=_0xfdc441['id'];if(_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x51')]){_0x1c4587['where']=_['merge'](_0x1c4587['where'],{'$or':_[_0x0fa3('0x41')](_0x1c4587[_0x0fa3('0x49')],function(_0x25d18f){var _0x437077={};_0x437077[_0x25d18f]={'$like':'%'+_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0x437077;})});}_0x1c4587=_[_0x0fa3('0x54')]({},_0x1c4587,_0x68d23f['options']);return db['FaxInteraction'][_0x0fa3('0x31')]({'where':_0x1c4587[_0x0fa3('0x4e')]})['then'](function(_0x479e2c){_0x26b1d3['count']=_0x479e2c;if(_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x6c')]){_0x1c4587['include']=[{'model':db[_0x0fa3('0x75')],'as':'Contact','required':![]},{'model':db[_0x0fa3('0x76')],'as':_0x0fa3('0x77'),'attributes':[_0x0fa3('0x3e'),'fullname',_0x0fa3('0x78')],'required':![]},{'model':db[_0x0fa3('0x79')],'as':_0x0fa3('0x7a'),'attributes':['id','name',_0x0fa3('0x7b')],'where':_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x7c')]?{'id':_0x68d23f[_0x0fa3('0x47')][_0x0fa3('0x7c')]}:undefined,'required':_0x68d23f[_0x0fa3('0x47')]['tag']?!![]:![]}];}return db[_0x0fa3('0x74')][_0x0fa3('0x57')](_0x1c4587);})[_0x0fa3('0x39')](function(_0x4ef82a){_0x26b1d3[_0x0fa3('0x58')]=_0x4ef82a;return _0x26b1d3;});}})[_0x0fa3('0x39')](respondWithFilteredResult(_0x26b13c,_0x1c4587))[_0x0fa3('0x5f')](handleError(_0x26b13c,null));};exports[_0x0fa3('0x7d')]=function(_0x591b80,_0x1b4087){var _0x21b529=_0x591b80[_0x0fa3('0x5a')]['id'];var _0x201ee9=_0x591b80[_0x0fa3('0x64')];var _0x1606a4=0xc8;var _0x20d48e=null;return db[_0x0fa3('0x7e')]['transaction']({'isolationLevel':db[_0x0fa3('0x7e')][_0x0fa3('0x7f')][_0x0fa3('0x80')][_0x0fa3('0x81')]},function(_0x3ff85c){return db[_0x0fa3('0x55')][_0x0fa3('0x6a')]({'where':{'id':_0x21b529},'transaction':_0x3ff85c})[_0x0fa3('0x39')](function(_0x363215){if(_0x363215){return db[_0x0fa3('0x82')]['destroy']({'where':{'FaxAccountId':_0x21b529},'transaction':_0x3ff85c})[_0x0fa3('0x39')](function(){var _0x1a786=_[_0x0fa3('0x41')](_0x201ee9,function(_0x321e97){_0x321e97[_0x0fa3('0x67')]=_0x21b529;return _0x321e97;});return db[_0x0fa3('0x82')][_0x0fa3('0x83')](_0x1a786,{'transaction':_0x3ff85c});});}else{_0x1606a4=0x194;_0x20d48e=[];}});})[_0x0fa3('0x39')](function(){if(_0x1606a4!==0x194){return db[_0x0fa3('0x82')][_0x0fa3('0x84')]({'where':{'FaxAccountId':_0x21b529},'order':_0x0fa3('0x85')})[_0x0fa3('0x39')](function(_0x2f24eb){_0x20d48e=_0x2f24eb;});}})['catch'](function(_0x18ce09){_0x1606a4=0x1f4;logger[_0x0fa3('0x28')](_0x18ce09[_0x0fa3('0x86')]);if(_0x18ce09['name']){delete _0x18ce09[_0x0fa3('0x3e')];}_0x20d48e=_0x18ce09;})['finally'](function(){if(_0x20d48e===null){_0x1b4087[_0x0fa3('0x2c')](_0x1606a4);}else{if(_0x1606a4===0x1f4){_0x1b4087[_0x0fa3('0x2d')](_0x1606a4)[_0x0fa3('0x87')](_0x20d48e);}else{_0x1b4087[_0x0fa3('0x2d')](_0x1606a4)['json'](_0x20d48e);}}});};exports['getApplications']=function(_0x5be673,_0x4273a7,_0xbb1ad2){var _0x223e34={};var _0x31e438={};var _0xf5753d;var _0xded7e6;return db['FaxAccount'][_0x0fa3('0x6a')]({'where':{'id':_0x5be673[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x4273a7,null))[_0x0fa3('0x39')](function(_0x219b3c){if(_0x219b3c){_0xf5753d=_0x219b3c;_0x31e438[_0x0fa3('0x45')]=_[_0x0fa3('0x46')](db['FaxApplication'][_0x0fa3('0x42')]);_0x31e438[_0x0fa3('0x47')]=_[_0x0fa3('0x46')](_0x5be673[_0x0fa3('0x47')]);_0x31e438[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0x31e438[_0x0fa3('0x45')],_0x31e438[_0x0fa3('0x47')]);_0x223e34[_0x0fa3('0x49')]=_['intersection'](_0x31e438['model'],qs[_0x0fa3('0x4a')](_0x5be673[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0x223e34[_0x0fa3('0x49')]=_0x223e34[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0x223e34[_0x0fa3('0x49')]:_0x31e438[_0x0fa3('0x45')];_0x223e34[_0x0fa3('0x4c')]=qs['sort'](_0x5be673['query'][_0x0fa3('0x4d')]);_0x223e34['where']=qs[_0x0fa3('0x4f')](_['pick'](_0x5be673[_0x0fa3('0x47')],_0x31e438[_0x0fa3('0x4f')]));if(_0x5be673['query'][_0x0fa3('0x51')]){_0x223e34[_0x0fa3('0x4e')]=_[_0x0fa3('0x54')](_0x223e34[_0x0fa3('0x4e')],{'$or':_[_0x0fa3('0x41')](_0x223e34['attributes'],function(_0x30d623){var _0x33e24d={};_0x33e24d[_0x30d623]={'$like':'%'+_0x5be673[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0x33e24d;})});}_0x223e34=_[_0x0fa3('0x54')]({},_0x223e34,_0x5be673[_0x0fa3('0x5d')]);return _0xf5753d[_0x0fa3('0x88')](_0x223e34);}})[_0x0fa3('0x39')](function(_0x42951b){if(_0x42951b){_0xded7e6=_0x42951b[_0x0fa3('0x5c')];if(!_0x5be673[_0x0fa3('0x47')][_0x0fa3('0x6b')](_0x0fa3('0x4b'))){_0x223e34['limit']=qs[_0x0fa3('0x30')](_0x5be673[_0x0fa3('0x47')][_0x0fa3('0x30')]);_0x223e34[_0x0fa3('0x32')]=qs[_0x0fa3('0x32')](_0x5be673[_0x0fa3('0x47')][_0x0fa3('0x32')]);}return _0xf5753d[_0x0fa3('0x88')](_0x223e34);}})['then'](function(_0x55dba5){if(_0x55dba5){return _0x55dba5?{'count':_0xded7e6,'rows':_0x55dba5}:null;}})[_0x0fa3('0x39')](respondWithResult(_0x4273a7,null))[_0x0fa3('0x5f')](handleError(_0x4273a7,null));};function Extension(_0x13430d,_0x6b0927,_0x1dffae,_0x5cb986){this[_0x0fa3('0x89')]=_0x0fa3('0x8a');this[_0x0fa3('0x8b')]=_0x13430d[_0x0fa3('0x8c')];this[_0x0fa3('0x8d')]=_0x5cb986;this[_0x0fa3('0x52')]=_0x0fa3('0x8e');this[_0x0fa3('0x8f')]=_0x0fa3('0x90');this[_0x0fa3('0x67')]=_0x13430d['id'];this[_0x0fa3('0x85')]=_0x6b0927;this[_0x0fa3('0x91')]=_0x1dffae;}function createExtensionsReciveFax(_0x43e556){var _0x47021f=0x1;var _0x3fc82b=[];_0x3fc82b[_0x0fa3('0x92')](new Extension(_0x43e556,_0x47021f,'',_0x0fa3('0x93')));_0x47021f+=0x1;_0x3fc82b['push'](new Extension(_0x43e556,_0x47021f,_0x0fa3('0x94'),_0x0fa3('0x95')));_0x47021f+=0x1;for(var _0x165ca9 in _0x43e556){if(_0x43e556[_0x0fa3('0x6b')](_0x165ca9)&&(_0x165ca9==='ecm'||_0x165ca9===_0x0fa3('0x8c')||_0x165ca9===_0x0fa3('0x96')||_0x165ca9==='faxdetect'||_0x165ca9===_0x0fa3('0x97')||_0x165ca9===_0x0fa3('0x98')||_0x165ca9===_0x0fa3('0x99')||_0x165ca9==='modem'||_0x165ca9===_0x0fa3('0x9a'))){_0x3fc82b[_0x0fa3('0x92')](new Extension(_0x43e556,_0x47021f,_0x0fa3('0x9b')+_0x165ca9+')='+_0x43e556[_0x165ca9],_0x0fa3('0x95')));_0x47021f+=0x1;}}_0x3fc82b['push'](new Extension(_0x43e556,_0x47021f,'6',_0x0fa3('0x9c')));_0x47021f+=0x1;_0x3fc82b['push'](new Extension(_0x43e556,_0x47021f,'/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',_0x0fa3('0x9d')));_0x47021f=0x0;return _0x3fc82b;}exports['addAccountApplications']=function(_0xeb9d56,_0x304f9e,_0x29ffcb){var _0x25413c;return db[_0x0fa3('0x7e')]['transaction'](function(_0x4e29b0){return db[_0x0fa3('0x55')]['create'](_0xeb9d56[_0x0fa3('0x64')],{'transaction':_0x4e29b0})['then'](function(_0x3aa9ec){_0x25413c=_0x3aa9ec[_0x0fa3('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0x0fa3('0x83')](createExtensionsReciveFax(_0x25413c),{'transaction':_0x4e29b0});});})[_0x0fa3('0x39')](function(){return _0x25413c;})[_0x0fa3('0x39')](respondWithResult(_0x304f9e,null))[_0x0fa3('0x5f')](handleError(_0x304f9e,null));};exports[_0x0fa3('0x9e')]=function(_0x1871bc,_0x295704,_0xa3978f){var _0x23e0ff;return db[_0x0fa3('0x7e')][_0x0fa3('0x9f')](function(_0x223947){return db['FaxAccount']['update'](_0x1871bc[_0x0fa3('0x64')],{'where':{'id':_0x1871bc[_0x0fa3('0x64')]['id']},'transaction':_0x223947})['then'](function(_0x58c29b){return db[_0x0fa3('0xa0')][_0x0fa3('0x3d')]({'where':{'FaxAccountId':_0x1871bc[_0x0fa3('0x64')]['id']},'transaction':_0x223947})[_0x0fa3('0x39')](function(_0xdeb8f2){return db['VoiceExtension'][_0x0fa3('0x83')](createExtensionsReciveFax(_['omit'](_0x1871bc[_0x0fa3('0x64')],[_0x0fa3('0xa1'),_0x0fa3('0x44'),_0x0fa3('0xa2'),_0x0fa3('0xa3'),_0x0fa3('0xa4'),'ListId'])),{'transaction':_0x223947});});});})[_0x0fa3('0x39')](function(){return db[_0x0fa3('0x55')][_0x0fa3('0xa5')](_0x1871bc[_0x0fa3('0x64')]['id']);})['then'](respondWithResult(_0x295704,null))[_0x0fa3('0x5f')](handleError(_0x295704,null));};exports['getMessages']=function(_0x4a60e7,_0x4316ab,_0x17caf6){var _0x54bd72={'raw':!![],'where':{}};var _0x3b8971={};var _0x387601={'count':0x0,'rows':[]};return db[_0x0fa3('0x55')][_0x0fa3('0x6a')]({'where':{'id':_0x4a60e7[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x4316ab,null))[_0x0fa3('0x39')](function(_0x2330e6){if(_0x2330e6){_0x3b8971[_0x0fa3('0x45')]=_[_0x0fa3('0x46')](db['FaxMessage'][_0x0fa3('0x42')]);_0x3b8971[_0x0fa3('0x47')]=_[_0x0fa3('0x46')](_0x4a60e7['query']);_0x3b8971[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0x3b8971[_0x0fa3('0x45')],_0x3b8971['query']);_0x54bd72['attributes']=_[_0x0fa3('0x48')](_0x3b8971['model'],qs['fields'](_0x4a60e7['query'][_0x0fa3('0x4a')]));_0x54bd72[_0x0fa3('0x49')]=_0x54bd72[_0x0fa3('0x49')][_0x0fa3('0x5c')]?_0x54bd72[_0x0fa3('0x49')]:_0x3b8971[_0x0fa3('0x45')];if(!_0x4a60e7['query'][_0x0fa3('0x6b')](_0x0fa3('0x4b'))){_0x54bd72['limit']=qs[_0x0fa3('0x30')](_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0x30')]);_0x54bd72[_0x0fa3('0x32')]=qs[_0x0fa3('0x32')](_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0x32')]);}_0x54bd72[_0x0fa3('0x4c')]=qs[_0x0fa3('0x4d')](_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0x4d')]);_0x54bd72[_0x0fa3('0x4e')]=qs[_0x0fa3('0x4f')](_[_0x0fa3('0x50')](_0x4a60e7[_0x0fa3('0x47')],_0x3b8971[_0x0fa3('0x4f')]));_0x54bd72[_0x0fa3('0x4e')][_0x0fa3('0x67')]=_0x2330e6['id'];if(_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0x51')]){_0x54bd72[_0x0fa3('0x4e')]=_[_0x0fa3('0x54')](_0x54bd72[_0x0fa3('0x4e')],{'$or':_['map'](_0x54bd72['attributes'],function(_0x4deac5){var _0x5f967={};_0x5f967[_0x4deac5]={'$like':'%'+_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0x5f967;})});}if(_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0xa6')]){var _0x528ac0=_0x4a60e7[_0x0fa3('0x47')][_0x0fa3('0xa6')]['split'](',');var _0x1aaf70={};_0x1aaf70[_0x528ac0[0x0]]={'$gte':moment(_0x528ac0[0x1])[_0x0fa3('0xa7')](_0x0fa3('0xa8'))};_0x54bd72[_0x0fa3('0x4e')]=_[_0x0fa3('0x54')](_0x54bd72[_0x0fa3('0x4e')],_0x1aaf70);}_0x54bd72=_[_0x0fa3('0x54')]({},_0x54bd72,_0x4a60e7[_0x0fa3('0x5d')]);return db['FaxMessage'][_0x0fa3('0x31')]({'where':_0x54bd72['where']})[_0x0fa3('0x39')](function(_0x20b798){_0x387601[_0x0fa3('0x31')]=_0x20b798;if(_0x4a60e7['query'][_0x0fa3('0x6c')]){_0x54bd72[_0x0fa3('0x56')]=[{'all':!![]}];}return db[_0x0fa3('0xa9')]['findAll'](_0x54bd72);})[_0x0fa3('0x39')](function(_0x16d210){_0x387601[_0x0fa3('0x58')]=_0x16d210;return _0x387601;});}})[_0x0fa3('0x39')](respondWithFilteredResult(_0x4316ab,_0x54bd72))['catch'](handleError(_0x4316ab,null));};exports[_0x0fa3('0x87')]=function(_0x5e264b,_0x2a6c6e,_0x2f2525){var _0x4a56cd,_0x36ddf2={},_0x550f15;if(_0x5e264b[_0x0fa3('0x64')]['to']){_0x550f15=_0x5e264b[_0x0fa3('0x64')]['to'][0x0];}return db[_0x0fa3('0x55')]['find']({'where':{'id':_0x5e264b[_0x0fa3('0x5a')]['id']},'include':[{'model':db[_0x0fa3('0xaa')],'as':'List','include':[{'model':db[_0x0fa3('0x75')],'as':'Contacts','where':{'fax':_0x550f15},'limit':0x1,'order':[[_0x0fa3('0xa3'),_0x0fa3('0xab')]]}]}]})[_0x0fa3('0x39')](handleEntityNotFound(_0x2a6c6e,null))[_0x0fa3('0x39')](function(_0x50cced){_0x4a56cd=_0x50cced;if(_0x5e264b['body'][_0x0fa3('0xac')]&&_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')]['length']){for(var _0x3c479a=0x0;_0x3c479a<_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')]['length'];_0x3c479a+=0x1){_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][_0x3c479a]={'filename':_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][_0x3c479a][_0x0fa3('0x3e')],'id':_0x5e264b['body'][_0x0fa3('0xac')][_0x3c479a]['id'],'path':path['join'](config[_0x0fa3('0xad')],'server/files/attachments',_0x5e264b[_0x0fa3('0x64')]['attachments'][_0x3c479a][_0x0fa3('0xae')])};}}return respondWithRpcPromise(_0x0fa3('0xaf'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x5e264b[_0x0fa3('0x5a')]['id'])?undefined:_0x5e264b['params']['id'],'path':_[_0x0fa3('0xb0')](_0x5e264b[_0x0fa3('0x64')]['attachments'][0x0][_0x0fa3('0x7')])?undefined:_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0][_0x0fa3('0x7')],'fax':_[_0x0fa3('0xb0')](_0x5e264b[_0x0fa3('0x64')]['to'][0x0])?undefined:_0x5e264b['body']['to'][0x0]},client9002);})[_0x0fa3('0x39')](function(){if(_0x4a56cd){if(_[_0x0fa3('0xb0')](_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xb1')])){_0x5e264b['body'][_0x0fa3('0xb1')]=util['format'](_0x0fa3('0xb2'),_0x4a56cd[_0x0fa3('0x3e')],_0x4a56cd[_0x0fa3('0xb3')]);}if(_0x4a56cd['List']){if(_0x4a56cd[_0x0fa3('0xb4')][_0x0fa3('0xb5')][_0x0fa3('0x5c')]){return _0x4a56cd['List'][_0x0fa3('0xb5')][0x0];}else{return db[_0x0fa3('0x75')][_0x0fa3('0x69')](_['defaults'](_0x5e264b[_0x0fa3('0x64')],{'firstName':_0x5e264b['body']['to'][0x0],'phone':_0x5e264b['body']['to'][0x0],'fax':_0x5e264b[_0x0fa3('0x64')]['to'][0x0],'ListId':_0x4a56cd[_0x0fa3('0xb6')]}));}}else{throw new Error(_0x0fa3('0xb7'));}}else{throw new Error(_0x0fa3('0xb8'));}})['then'](function(_0x2b3d97){if(_0x2b3d97){return db[_0x0fa3('0x74')]['find']({'where':{'ContactId':_0x2b3d97['id'],'closed':![],'FaxAccountId':_0x4a56cd['id']}})[_0x0fa3('0x39')](function(_0x2a9e0d){if(_0x2a9e0d){return[_0x2a9e0d,![]];}return db[_0x0fa3('0x74')]['create']({'UserId':_0x5e264b['user']['id'],'ContactId':_0x2b3d97['id'],'FaxAccountId':_0x4a56cd['id'],'fax':_0x5e264b[_0x0fa3('0x64')]['to'][0x0],'firstMsgDirection':_0x0fa3('0xb9'),'Messages':[_[_0x0fa3('0x54')](_0x5e264b['body'],{'read':![],'body':_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0][_0x0fa3('0xba')],'FaxAccountId':_0x4a56cd['id'],'UserId':_0x5e264b[_0x0fa3('0x60')]['id'],'ContactId':_0x2b3d97['id'],'AttachmentId':_0x5e264b['body'][_0x0fa3('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x0fa3('0xa9')],'as':_0x0fa3('0xbb')}]})[_0x0fa3('0x39')](function(_0x5240dd){return[_0x5240dd,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0fa3('0xbc')](function(_0x4736b0,_0x4049a7){if(_0x4049a7){return _0x4736b0;}return db[_0x0fa3('0xa9')][_0x0fa3('0x69')]({'direction':_0x0fa3('0xb9'),'read':![],'body':_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0][_0x0fa3('0xba')],'FaxAccountId':_0x4a56cd['id'],'FaxInteractionId':_0x4736b0['id'],'UserId':_0x5e264b[_0x0fa3('0x60')]['id'],'ContactId':_0x4736b0[_0x0fa3('0xbd')],'AttachmentId':_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0]['id']})[_0x0fa3('0x39')](function(_0x3e89d1){_0x4736b0['dataValues'][_0x0fa3('0xbb')]=[];_0x4736b0[_0x0fa3('0xbe')][_0x0fa3('0xbb')][_0x0fa3('0x92')](_0x3e89d1[_0x0fa3('0xbe')]);return _0x4736b0;});})[_0x0fa3('0x39')](function(_0x4b1e44){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x0fa3('0xb0')](_0x5e264b[_0x0fa3('0x5a')]['id'])?undefined:_0x5e264b[_0x0fa3('0x5a')]['id'],'path':_[_0x0fa3('0xb0')](_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0][_0x0fa3('0x7')])?undefined:_0x5e264b[_0x0fa3('0x64')]['attachments'][0x0]['path'],'fax':_[_0x0fa3('0xb0')](_0x5e264b['body']['to'][0x0])?undefined:_0x5e264b[_0x0fa3('0x64')]['to'][0x0],'AttachmentId':_0x5e264b[_0x0fa3('0x64')][_0x0fa3('0xac')][0x0]['id']},client9002)[_0x0fa3('0x39')](function(_0x36b630){logger['info'](_0x0fa3('0xbf'),_0x36b630);})[_0x0fa3('0x5f')](function(_0x413c63){logger['info'](_0x0fa3('0xbf'),_0x413c63);});return _0x4b1e44;})[_0x0fa3('0x39')](respondWithResult(_0x2a6c6e,null))[_0x0fa3('0x5f')](handleError(_0x2a6c6e,null));};exports[_0x0fa3('0xc0')]=function(_0x1610c5,_0x37a842,_0x36601d){return db['FaxAccount'][_0x0fa3('0x5e')]({'where':{'id':_0x1610c5[_0x0fa3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x37a842,null))['then'](function(_0x3b6143){if(_0x3b6143){return _0x3b6143['addAgents'](_0x1610c5['body'][_0x0fa3('0x72')],_[_0x0fa3('0xc1')](_0x1610c5['body'],[_0x0fa3('0x72'),'id'])||{})['spread'](function(_0x24f2cd){for(var _0x4e62dd=0x0;_0x4e62dd<_0x1610c5[_0x0fa3('0x64')][_0x0fa3('0x72')][_0x0fa3('0x5c')];_0x4e62dd+=0x1){socket[_0x0fa3('0xc2')](_0x0fa3('0xc3'),{'UserId':Number(_0x1610c5[_0x0fa3('0x64')][_0x0fa3('0x72')][_0x4e62dd]),'FaxAccountId':Number(_0x1610c5[_0x0fa3('0x5a')]['id'])});}return _0x24f2cd;});}})['then'](respondWithResult(_0x37a842,null))[_0x0fa3('0x5f')](handleError(_0x37a842,null));};exports[_0x0fa3('0xc4')]=function(_0x4c420c,_0x1eb067,_0x53fb88){return db[_0x0fa3('0x55')][_0x0fa3('0x5e')]({'where':{'id':_0x4c420c[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x1eb067,null))[_0x0fa3('0x39')](function(_0x959072){if(_0x959072){return _0x959072[_0x0fa3('0xc4')](_0x4c420c['query']['ids'])[_0x0fa3('0x39')](function(){if(_['isArray'](_0x4c420c[_0x0fa3('0x47')][_0x0fa3('0x72')])){for(var _0x2f7aa3=0x0;_0x2f7aa3<_0x4c420c['query'][_0x0fa3('0x72')][_0x0fa3('0x5c')];_0x2f7aa3+=0x1){socket['emit'](_0x0fa3('0xc5'),{'UserId':Number(_0x4c420c['query'][_0x0fa3('0x72')][_0x2f7aa3]),'FaxAccountId':Number(_0x4c420c[_0x0fa3('0x5a')]['id'])});}}else{socket[_0x0fa3('0xc2')](_0x0fa3('0xc5'),{'UserId':Number(_0x4c420c['query'][_0x0fa3('0x72')]),'FaxAccountId':Number(_0x4c420c[_0x0fa3('0x5a')]['id'])});}});}})[_0x0fa3('0x39')](respondWithStatusCode(_0x1eb067,null))['catch'](handleError(_0x1eb067,null));};exports['getAgents']=function(_0x47dec4,_0x363255,_0x2ce3bb){var _0x5c2c0d={};var _0x2a1db0={};var _0x2972ad;var _0x368e1c;return db['FaxAccount'][_0x0fa3('0x6a')]({'where':{'id':_0x47dec4[_0x0fa3('0x5a')]['id']}})[_0x0fa3('0x39')](handleEntityNotFound(_0x363255,null))['then'](function(_0x1f3ae9){if(_0x1f3ae9){_0x2972ad=_0x1f3ae9;_0x2a1db0[_0x0fa3('0x45')]=_[_0x0fa3('0x46')](db[_0x0fa3('0x76')][_0x0fa3('0x42')]);_0x2a1db0[_0x0fa3('0x47')]=_[_0x0fa3('0x46')](_0x47dec4[_0x0fa3('0x47')]);_0x2a1db0[_0x0fa3('0x4f')]=_[_0x0fa3('0x48')](_0x2a1db0[_0x0fa3('0x45')],_0x2a1db0[_0x0fa3('0x47')]);_0x5c2c0d[_0x0fa3('0x49')]=_['intersection'](_0x2a1db0[_0x0fa3('0x45')],qs[_0x0fa3('0x4a')](_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x4a')]));_0x5c2c0d[_0x0fa3('0x49')]=_0x5c2c0d[_0x0fa3('0x49')]['length']?_0x5c2c0d[_0x0fa3('0x49')]:_0x2a1db0[_0x0fa3('0x45')];_0x5c2c0d[_0x0fa3('0x4c')]=qs[_0x0fa3('0x4d')](_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x4d')]);_0x5c2c0d[_0x0fa3('0x4e')]=qs[_0x0fa3('0x4f')](_[_0x0fa3('0x50')](_0x47dec4[_0x0fa3('0x47')],_0x2a1db0[_0x0fa3('0x4f')]));if(_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x51')]){_0x5c2c0d[_0x0fa3('0x4e')]=_[_0x0fa3('0x54')](_0x5c2c0d[_0x0fa3('0x4e')],{'$or':_[_0x0fa3('0x41')](_0x5c2c0d[_0x0fa3('0x49')],function(_0x6dcb77){var _0xcfb7fb={};_0xcfb7fb[_0x6dcb77]={'$like':'%'+_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x51')]+'%'};return _0xcfb7fb;})});}_0x5c2c0d=_['merge']({},_0x5c2c0d,_0x47dec4[_0x0fa3('0x5d')]);return _0x2972ad[_0x0fa3('0xc6')](_0x5c2c0d);}})[_0x0fa3('0x39')](function(_0x237729){if(_0x237729){_0x368e1c=_0x237729[_0x0fa3('0x5c')];if(!_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x6b')](_0x0fa3('0x4b'))){_0x5c2c0d[_0x0fa3('0x30')]=qs[_0x0fa3('0x30')](_0x47dec4[_0x0fa3('0x47')][_0x0fa3('0x30')]);_0x5c2c0d['offset']=qs[_0x0fa3('0x32')](_0x47dec4['query'][_0x0fa3('0x32')]);}return _0x2972ad[_0x0fa3('0xc6')](_0x5c2c0d);}})[_0x0fa3('0x39')](function(_0x297ff9){if(_0x297ff9){return _0x297ff9?{'count':_0x368e1c,'rows':_0x297ff9}:null;}})[_0x0fa3('0x39')](respondWithResult(_0x363255,null))[_0x0fa3('0x5f')](handleError(_0x363255,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 3481020..3417d87 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 _0x8f41=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x280acf,_0x4e4830){var _0x2bbcaa=function(_0x485ec0){while(--_0x485ec0){_0x280acf['push'](_0x280acf['shift']());}};_0x2bbcaa(++_0x4e4830);}(_0x8f41,0x1c3));var _0x18f4=function(_0x1c6dcf,_0x2018b2){_0x1c6dcf=_0x1c6dcf-0x0;var _0x4990ae=_0x8f41[_0x1c6dcf];return _0x4990ae;};'use strict';var EventEmitter=require(_0x18f4('0x0'));var FaxAccount=require(_0x18f4('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x18f4('0x2')](0x0);var events={'afterCreate':_0x18f4('0x3'),'afterUpdate':_0x18f4('0x4'),'afterDestroy':_0x18f4('0x5')};function emitEvent(_0x1e5fac){return function(_0x4c1260,_0x2b1e57,_0x23faaa){FaxAccountEvents[_0x18f4('0x6')](_0x1e5fac+':'+_0x4c1260['id'],_0x4c1260);FaxAccountEvents[_0x18f4('0x6')](_0x1e5fac,_0x4c1260);_0x23faaa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x18f4('0x7')](e,emitEvent(event));}}module[_0x18f4('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xaf33=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xaf33,0x12c));var _0x3af3=function(_0xd147d8,_0x481a41){_0xd147d8=_0xd147d8-0x0;var _0x3fcaba=_0xaf33[_0xd147d8];return _0x3fcaba;};'use strict';var EventEmitter=require(_0x3af3('0x0'));var FaxAccount=require(_0x3af3('0x1'))['db'][_0x3af3('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3af3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3af3('0x4'),'afterDestroy':_0x3af3('0x5')};function emitEvent(_0x457486){return function(_0x2ef234,_0x1158d3,_0x285f25){FaxAccountEvents[_0x3af3('0x6')](_0x457486+':'+_0x2ef234['id'],_0x2ef234);FaxAccountEvents[_0x3af3('0x6')](_0x457486,_0x2ef234);_0x285f25(null);};}for(var e in events){if(events[_0x3af3('0x7')](e)){var event=events[e];FaxAccount[_0x3af3('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 6581118..0047f41 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 _0x02ca=['FaxAccount','fax_accounts','moment','bluebird','rimraf','./faxAccount.attributes','define'];(function(_0x2412b4,_0xbcd013){var _0x3a08dd=function(_0xa342a6){while(--_0xa342a6){_0x2412b4['push'](_0x2412b4['shift']());}};_0x3a08dd(++_0xbcd013);}(_0x02ca,0x1ec));var _0xa02c=function(_0x4ccd64,_0x470788){_0x4ccd64=_0x4ccd64-0x0;var _0x3fd69e=_0x02ca[_0x4ccd64];return _0x3fd69e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa02c('0x0'));var BPromise=require(_0xa02c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa02c('0x2'));var config=require('../../config/environment');var attributes=require(_0xa02c('0x3'));module['exports']=function(_0x4610a8,_0x597f40){return _0x4610a8[_0xa02c('0x4')](_0xa02c('0x5'),attributes,{'tableName':_0xa02c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84d7=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x10ab62,_0x21d1da){var _0x3b325b=function(_0x4aae9d){while(--_0x4aae9d){_0x10ab62['push'](_0x10ab62['shift']());}};_0x3b325b(++_0x21d1da);}(_0x84d7,0x75));var _0x784d=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x84d7[_0x576170];return _0x397c70;};'use strict';var _=require(_0x784d('0x0'));var util=require('util');var logger=require(_0x784d('0x1'))(_0x784d('0x2'));var moment=require(_0x784d('0x3'));var BPromise=require(_0x784d('0x4'));var rp=require(_0x784d('0x5'));var fs=require('fs');var path=require(_0x784d('0x6'));var rimraf=require(_0x784d('0x7'));var config=require(_0x784d('0x8'));var attributes=require(_0x784d('0x9'));module[_0x784d('0xa')]=function(_0x2d0d20,_0x10a5b2){return _0x2d0d20[_0x784d('0xb')](_0x784d('0xc'),attributes,{'tableName':'fax_accounts','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 8d83efa..b9ba24f 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 _0x4e8e=['spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','name','unshift','waitForTheAssignedAgent','FaxQueue','queueId','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','CmContact','Contacts','FaxApplication','Applications','List','account','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found'];(function(_0x461ea3,_0x5bcc4b){var _0x3c7b09=function(_0x5c9cc4){while(--_0x5c9cc4){_0x461ea3['push'](_0x461ea3['shift']());}};_0x3c7b09(++_0x5bcc4b);}(_0x4e8e,0xc6));var _0xe4e8=function(_0x4e9280,_0x3d8cf9){_0x4e9280=_0x4e9280-0x0;var _0x12ae48=_0x4e8e[_0x4e9280];return _0x12ae48;};'use strict';var _=require(_0xe4e8('0x0'));var util=require('util');var moment=require(_0xe4e8('0x1'));var BPromise=require(_0xe4e8('0x2'));var rs=require(_0xe4e8('0x3'));var fs=require('fs');var Redis=require(_0xe4e8('0x4'));var db=require(_0xe4e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e8('0x6'))('rpc');var config=require(_0xe4e8('0x7'));var jayson=require(_0xe4e8('0x8'));var client=jayson[_0xe4e8('0x9')][_0xe4e8('0xa')]({'port':0x232c});config[_0xe4e8('0xb')]=_[_0xe4e8('0xc')](config['redis'],{'host':_0xe4e8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4e8('0xb')]));require(_0xe4e8('0xe'))['register'](socket);function respondWithRpcPromise(_0x36840a,_0x3f2e25,_0x42e60a){return new BPromise(function(_0x13558e,_0x703edf){return client[_0xe4e8('0xf')](_0x36840a,_0x42e60a)[_0xe4e8('0x10')](function(_0xca451b){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3f2e25,'request\x20sent');logger[_0xe4e8('0x11')](_0xe4e8('0x12'),_0x3f2e25,_0xe4e8('0x13'),JSON['stringify'](_0xca451b));if(_0xca451b[_0xe4e8('0x14')]){if(_0xca451b[_0xe4e8('0x14')][_0xe4e8('0x15')]===0x1f4){logger['error'](_0xe4e8('0x16'),_0x3f2e25,_0xca451b[_0xe4e8('0x14')][_0xe4e8('0x17')]);return _0x703edf(_0xca451b[_0xe4e8('0x14')][_0xe4e8('0x17')]);}logger['error'](_0xe4e8('0x16'),_0x3f2e25,_0xca451b[_0xe4e8('0x14')]['message']);return _0x13558e(_0xca451b[_0xe4e8('0x14')][_0xe4e8('0x17')]);}else{logger[_0xe4e8('0x18')](_0xe4e8('0x16'),_0x3f2e25,_0xe4e8('0x13'));_0x13558e(_0xca451b[_0xe4e8('0x19')][_0xe4e8('0x17')]);}})[_0xe4e8('0x1a')](function(_0x10fff2){logger[_0xe4e8('0x14')](_0xe4e8('0x16'),_0x3f2e25,_0x10fff2);_0x703edf(_0x10fff2);});});}exports[_0xe4e8('0x1b')]=function(_0x432f3f){var _0x5239be=this;return new Promise(function(_0x3aa17a,_0x1024f8){return db[_0xe4e8('0x1c')][_0xe4e8('0x1d')]({'raw':_0x432f3f[_0xe4e8('0x1e')]?_0x432f3f[_0xe4e8('0x1e')][_0xe4e8('0x1f')]===undefined?!![]:![]:!![],'where':_0x432f3f['options']?_0x432f3f[_0xe4e8('0x1e')]['where']||null:null,'attributes':_0x432f3f[_0xe4e8('0x1e')]?_0x432f3f['options'][_0xe4e8('0x20')]||null:null,'limit':_0x432f3f[_0xe4e8('0x1e')]?_0x432f3f[_0xe4e8('0x1e')][_0xe4e8('0x21')]||null:null,'include':_0x432f3f['options']?_0x432f3f[_0xe4e8('0x1e')][_0xe4e8('0x22')]?_[_0xe4e8('0x23')](_0x432f3f[_0xe4e8('0x1e')]['include'],function(_0x1654c4){return{'model':db[_0x1654c4['model']],'as':_0x1654c4['as'],'attributes':_0x1654c4['attributes'],'include':_0x1654c4['include']?_[_0xe4e8('0x23')](_0x1654c4[_0xe4e8('0x22')],function(_0xd83f60){return{'model':db[_0xd83f60['model']],'as':_0xd83f60['as'],'attributes':_0xd83f60[_0xe4e8('0x20')],'include':_0xd83f60[_0xe4e8('0x22')]?_[_0xe4e8('0x23')](_0xd83f60['include'],function(_0x1803ad){return{'model':db[_0x1803ad['model']],'as':_0x1803ad['as'],'attributes':_0x1803ad['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21c910){logger['info'](_0xe4e8('0x1b'),_0x432f3f);logger[_0xe4e8('0x11')]('GetFaxAccount',_0x432f3f,JSON['stringify'](_0x21c910));_0x3aa17a(_0x21c910);})['catch'](function(_0x1333c4){logger[_0xe4e8('0x14')]('GetFaxAccount',_0x1333c4[_0xe4e8('0x17')],_0x432f3f);_0x1024f8(_0x5239be['error'](0x1f4,_0x1333c4[_0xe4e8('0x17')]));});});};exports[_0xe4e8('0x24')]=function(_0x320450,_0x10c405,_0x253dce){var _0x38dcfe=this;return new Promise(function(_0x247f1d,_0x4d1144){var _0x1685e0={'body':_0x320450[_0xe4e8('0x25')],'channel':_0xe4e8('0x26')};var _0x2d0265=[];var _0x17c62d=[];var _0x37c617={};return db['CmContact'][_0xe4e8('0x27')]()[_0xe4e8('0x10')](function(_0x1b1187){if(!_0x1b1187){throw new db[(_0xe4e8('0x28'))][(_0xe4e8('0x29'))](_0xe4e8('0x2a'));}_0x2d0265=_[_0xe4e8('0x2b')](_[_0xe4e8('0x2c')](_0x1b1187),['createdAt','updatedAt']);_0x17c62d=_[_0xe4e8('0x2b')](_[_0xe4e8('0x2c')](_0x1b1187),[_0xe4e8('0x2d'),_0xe4e8('0x2e'),_0xe4e8('0x2f'),_0xe4e8('0x30')]);if(_0x320450['body']['id']){delete _0x320450[_0xe4e8('0x25')]['id'];}if(_[_0xe4e8('0x31')](_0x320450[_0xe4e8('0x25')][_0xe4e8('0x32')])){throw new db[(_0xe4e8('0x28'))]['ValidationError'](_0xe4e8('0x33'));}if(_['isNil'](_0x320450[_0xe4e8('0x25')][_0xe4e8('0x25')])||_0x320450['body'][_0xe4e8('0x25')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe4e8('0x31')](_0x320450[_0xe4e8('0x25')]['mapKey'])){throw new db[(_0xe4e8('0x28'))][(_0xe4e8('0x29'))](_0xe4e8('0x34')+_0x17c62d);}if(!_['includes'](_0x17c62d,_0x320450[_0xe4e8('0x25')][_0xe4e8('0x35')])){throw new db['Sequelize'][(_0xe4e8('0x29'))](_0xe4e8('0x36')+_0x17c62d);}_0x37c617[_0x320450['body'][_0xe4e8('0x35')]]=_0x320450[_0xe4e8('0x25')]['from'];})[_0xe4e8('0x10')](function(){return db[_0xe4e8('0x1c')][_0xe4e8('0x37')]({'where':{'id':_0x320450['account']['id']},'include':[{'model':db[_0xe4e8('0x38')],'as':'List','include':[{'model':db[_0xe4e8('0x39')],'as':_0xe4e8('0x3a'),'where':_0x37c617,'limit':0x1,'order':[[_0xe4e8('0x2e'),'DESC']]}]},{'model':db[_0xe4e8('0x3b')],'as':_0xe4e8('0x3c')}]});})[_0xe4e8('0x10')](function(_0x5ad0df){if(_0x5ad0df&&_0x5ad0df[_0xe4e8('0x3d')]){var _0xdaef81=_0x5ad0df['get']({'plain':!![]});_0x1685e0[_0xe4e8('0x3e')]=_0xdaef81;_0x1685e0[_0xe4e8('0x3f')]=_0xdaef81[_0xe4e8('0x3c')];_0x1685e0['list']=_0xdaef81['List'];_0x1685e0['applications']=_[_0xe4e8('0x40')](_0x1685e0[_0xe4e8('0x3f')],[_0xe4e8('0x41')],[_0xe4e8('0x42')]);if(_0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x3c')]){delete _0x1685e0[_0xe4e8('0x3e')]['Applications'];}if(_0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x3d')]&&_0x1685e0['account'][_0xe4e8('0x3d')][_0xe4e8('0x3a')][_0xe4e8('0x43')]){return _0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x3d')][_0xe4e8('0x3a')][0x0];}var _0x1a99a8=_[_0xe4e8('0xc')](_0x320450[_0xe4e8('0x25')],{'firstName':_0x320450[_0xe4e8('0x25')][_0xe4e8('0x32')],'ListId':_0xdaef81[_0xe4e8('0x30')]});_0x1a99a8[_0x320450[_0xe4e8('0x25')][_0xe4e8('0x35')]]=_0x320450[_0xe4e8('0x25')][_0xe4e8('0x32')];return db[_0xe4e8('0x39')][_0xe4e8('0x44')](_0x1a99a8,{'fields':_0x2d0265,'raw':!![]});}})['then'](function(_0x4d8797){_0x1685e0[_0xe4e8('0x45')]=_0x4d8797;if(_0x4d8797){var _0x13a6bb={'ContactId':_0x4d8797['id'],'FaxAccountId':_0x320450[_0xe4e8('0x3e')]['id'],'fax':_0x4d8797[_0xe4e8('0x26')]};return db[_0xe4e8('0x46')][_0xe4e8('0x37')]({'where':{'ContactId':_0x4d8797['id'],'closed':![],'FaxAccountId':_0x320450[_0xe4e8('0x3e')]['id']}})[_0xe4e8('0x10')](function(_0x5235f7){if(_0x5235f7){return[_0x5235f7,![]];}return db[_0xe4e8('0x46')]['create'](_0x13a6bb)[_0xe4e8('0x10')](function(_0x5f356a){return[_0x5f356a,!![]];});});}else{throw new Error(_0xe4e8('0x47'));}})[_0xe4e8('0x48')](function(_0x5121d4,_0x253f65){var _0x5439dc=_0x5121d4['get']({'plain':!![]});if(_0x253f65){if(_0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x49')]){_0x1685e0['applications'][_0xe4e8('0x4a')]({'id':0x0,'priority':_0x1685e0[_0xe4e8('0x3f')][_0xe4e8('0x43')]+0x1,'app':_0xe4e8('0x4b'),'appdata':'unmanaged','interval':_0xe4e8('0x4c')});}_0x5439dc[_0xe4e8('0x4d')]=!![];}else{_0x5439dc['created']=![];}_0x1685e0[_0xe4e8('0x4e')]=_0x5439dc;return db[_0xe4e8('0x4f')]['create']({'body':_0x320450[_0xe4e8('0x25')][_0xe4e8('0x25')],'FaxAccountId':_0x320450[_0xe4e8('0x3e')]['id'],'FaxInteractionId':_0x5121d4['id'],'direction':'in','ContactId':_0x5121d4[_0xe4e8('0x50')],'AttachmentId':_0x320450['body']['AttachmentId']});})[_0xe4e8('0x10')](function(_0x21a1c7){_0x1685e0[_0xe4e8('0x17')]=_0x21a1c7;if(!_0x1685e0[_0xe4e8('0x4e')][_0xe4e8('0x51')])return;return db['User'][_0xe4e8('0x37')]({'attributes':['id',_0xe4e8('0x52')],'where':{'id':_0x1685e0[_0xe4e8('0x4e')][_0xe4e8('0x51')]}});})[_0xe4e8('0x10')](function(_0x25b0a9){if(_0x25b0a9){_0x1685e0[_0xe4e8('0x3f')][_0xe4e8('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x25b0a9['name']+','+(_0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x54')]||0xa),'interval':_0xe4e8('0x4c')});}if(!_0x1685e0['interaction']['queueId'])return;return db[_0xe4e8('0x55')][_0xe4e8('0x37')]({'attributes':['id','name'],'where':{'id':_0x1685e0['interaction'][_0xe4e8('0x56')]}});})[_0xe4e8('0x10')](function(_0x374ce7){if(_0x374ce7){_0x1685e0[_0xe4e8('0x3f')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x374ce7[_0xe4e8('0x52')]+','+(_0x1685e0[_0xe4e8('0x3e')][_0xe4e8('0x57')]||0x12c),'interval':_0xe4e8('0x4c')});}return respondWithRpcPromise(_0xe4e8('0x58'),_0xe4e8('0x59'),_0x1685e0);})[_0xe4e8('0x10')](function(_0x841476){_0x247f1d(_0x841476);})['catch'](function(_0x29b132){_0x4d1144(_0x38dcfe[_0xe4e8('0x14')](0x1f4,_0x29b132['message']));});});}; \ No newline at end of file +var _0x5b60=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFaxAccount','FaxAccount','options','raw','limit','include','model','attributes','map','debug','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','name','unshift','queueId','queue','waitForTheAssignedQueue','lodash','util','moment'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x5b60,0x1b5));var _0x05b6=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x5b60[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x05b6('0x0'));var util=require(_0x05b6('0x1'));var moment=require(_0x05b6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05b6('0x3'));var db=require(_0x05b6('0x4'))['db'];var utils=require(_0x05b6('0x5'));var logger=require(_0x05b6('0x6'))(_0x05b6('0x7'));var config=require('../../config/environment');var jayson=require(_0x05b6('0x8'));var client=jayson[_0x05b6('0x9')]['http']({'port':0x232c});config[_0x05b6('0xa')]=_[_0x05b6('0xb')](config['redis'],{'host':_0x05b6('0xc'),'port':0x18eb});var socket=require(_0x05b6('0xd'))(new Redis(config[_0x05b6('0xa')]));require(_0x05b6('0xe'))['register'](socket);function respondWithRpcPromise(_0xb00988,_0x4367b0,_0x5a1c31){return new BPromise(function(_0x5a983c,_0x9c14ca){return client[_0x05b6('0xf')](_0xb00988,_0x5a1c31)[_0x05b6('0x10')](function(_0x2d61c3){logger[_0x05b6('0x11')](_0x05b6('0x12'),_0x4367b0,'request\x20sent');logger['debug'](_0x05b6('0x13'),_0x4367b0,'request\x20sent',JSON[_0x05b6('0x14')](_0x2d61c3));if(_0x2d61c3['error']){if(_0x2d61c3[_0x05b6('0x15')][_0x05b6('0x16')]===0x1f4){logger[_0x05b6('0x15')](_0x05b6('0x12'),_0x4367b0,_0x2d61c3[_0x05b6('0x15')][_0x05b6('0x17')]);return _0x9c14ca(_0x2d61c3[_0x05b6('0x15')]['message']);}logger[_0x05b6('0x15')](_0x05b6('0x12'),_0x4367b0,_0x2d61c3['error'][_0x05b6('0x17')]);return _0x5a983c(_0x2d61c3[_0x05b6('0x15')][_0x05b6('0x17')]);}else{logger[_0x05b6('0x11')](_0x05b6('0x12'),_0x4367b0,_0x05b6('0x18'));_0x5a983c(_0x2d61c3['result'][_0x05b6('0x17')]);}})[_0x05b6('0x19')](function(_0x2fc427){logger['error'](_0x05b6('0x12'),_0x4367b0,_0x2fc427);_0x9c14ca(_0x2fc427);});});}exports[_0x05b6('0x1a')]=function(_0x31d6cd){var _0x2b5871=this;return new Promise(function(_0x2320ff,_0x5b93a5){return db[_0x05b6('0x1b')]['findAll']({'raw':_0x31d6cd[_0x05b6('0x1c')]?_0x31d6cd['options'][_0x05b6('0x1d')]===undefined?!![]:![]:!![],'where':_0x31d6cd[_0x05b6('0x1c')]?_0x31d6cd[_0x05b6('0x1c')]['where']||null:null,'attributes':_0x31d6cd['options']?_0x31d6cd[_0x05b6('0x1c')]['attributes']||null:null,'limit':_0x31d6cd['options']?_0x31d6cd['options'][_0x05b6('0x1e')]||null:null,'include':_0x31d6cd[_0x05b6('0x1c')]?_0x31d6cd[_0x05b6('0x1c')][_0x05b6('0x1f')]?_['map'](_0x31d6cd[_0x05b6('0x1c')][_0x05b6('0x1f')],function(_0x295c18){return{'model':db[_0x295c18[_0x05b6('0x20')]],'as':_0x295c18['as'],'attributes':_0x295c18[_0x05b6('0x21')],'include':_0x295c18['include']?_['map'](_0x295c18[_0x05b6('0x1f')],function(_0x59df10){return{'model':db[_0x59df10['model']],'as':_0x59df10['as'],'attributes':_0x59df10[_0x05b6('0x21')],'include':_0x59df10[_0x05b6('0x1f')]?_[_0x05b6('0x22')](_0x59df10[_0x05b6('0x1f')],function(_0x3a68c0){return{'model':db[_0x3a68c0[_0x05b6('0x20')]],'as':_0x3a68c0['as'],'attributes':_0x3a68c0[_0x05b6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x05b6('0x10')](function(_0x1603a1){logger[_0x05b6('0x11')](_0x05b6('0x1a'),_0x31d6cd);logger[_0x05b6('0x23')](_0x05b6('0x1a'),_0x31d6cd,JSON[_0x05b6('0x14')](_0x1603a1));_0x2320ff(_0x1603a1);})[_0x05b6('0x19')](function(_0xaafcd6){logger[_0x05b6('0x15')](_0x05b6('0x1a'),_0xaafcd6['message'],_0x31d6cd);_0x5b93a5(_0x2b5871[_0x05b6('0x15')](0x1f4,_0xaafcd6[_0x05b6('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x233736,_0x3aedfa,_0x59653e){var _0x24751c=this;return new Promise(function(_0x5cd85c,_0x54bc5b){var _0x23c818={'body':_0x233736[_0x05b6('0x24')],'channel':_0x05b6('0x25')};var _0x3d5218=[];var _0x2a5f42=[];var _0x587158={};return db[_0x05b6('0x26')][_0x05b6('0x27')]()[_0x05b6('0x10')](function(_0x28c1ef){if(!_0x28c1ef){throw new db[(_0x05b6('0x28'))]['ValidationError'](_0x05b6('0x29'));}_0x3d5218=_[_0x05b6('0x2a')](_[_0x05b6('0x2b')](_0x28c1ef),[_0x05b6('0x2c'),_0x05b6('0x2d')]);_0x2a5f42=_[_0x05b6('0x2a')](_[_0x05b6('0x2b')](_0x28c1ef),[_0x05b6('0x2c'),_0x05b6('0x2d'),_0x05b6('0x2e'),'ListId']);if(_0x233736[_0x05b6('0x24')]['id']){delete _0x233736['body']['id'];}if(_['isNil'](_0x233736[_0x05b6('0x24')][_0x05b6('0x2f')])){throw new db[(_0x05b6('0x28'))][(_0x05b6('0x30'))](_0x05b6('0x31'));}if(_['isNil'](_0x233736[_0x05b6('0x24')][_0x05b6('0x24')])||_0x233736[_0x05b6('0x24')][_0x05b6('0x24')]===''){throw new db[(_0x05b6('0x28'))][(_0x05b6('0x30'))](_0x05b6('0x32'));}if(_[_0x05b6('0x33')](_0x233736[_0x05b6('0x24')][_0x05b6('0x34')])){throw new db[(_0x05b6('0x28'))]['ValidationError'](_0x05b6('0x35')+_0x2a5f42);}if(!_['includes'](_0x2a5f42,_0x233736[_0x05b6('0x24')]['mapKey'])){throw new db['Sequelize'][(_0x05b6('0x30'))](_0x05b6('0x36')+_0x2a5f42);}_0x587158[_0x233736[_0x05b6('0x24')][_0x05b6('0x34')]]=_0x233736[_0x05b6('0x24')]['from'];})[_0x05b6('0x10')](function(){return db[_0x05b6('0x1b')][_0x05b6('0x37')]({'where':{'id':_0x233736[_0x05b6('0x38')]['id']},'include':[{'model':db[_0x05b6('0x39')],'as':_0x05b6('0x3a'),'include':[{'model':db[_0x05b6('0x26')],'as':_0x05b6('0x3b'),'where':_0x587158,'limit':0x1,'order':[[_0x05b6('0x2d'),_0x05b6('0x3c')]]}]},{'model':db[_0x05b6('0x3d')],'as':_0x05b6('0x3e')}]});})[_0x05b6('0x10')](function(_0x5d1f13){if(_0x5d1f13&&_0x5d1f13['List']){var _0x59fdea=_0x5d1f13[_0x05b6('0x3f')]({'plain':!![]});_0x23c818['account']=_0x59fdea;_0x23c818['applications']=_0x59fdea[_0x05b6('0x3e')];_0x23c818['list']=_0x59fdea['List'];_0x23c818[_0x05b6('0x40')]=_[_0x05b6('0x41')](_0x23c818['applications'],['priority'],[_0x05b6('0x42')]);if(_0x23c818[_0x05b6('0x38')][_0x05b6('0x3e')]){delete _0x23c818[_0x05b6('0x38')][_0x05b6('0x3e')];}if(_0x23c818[_0x05b6('0x38')][_0x05b6('0x3a')]&&_0x23c818[_0x05b6('0x38')][_0x05b6('0x3a')][_0x05b6('0x3b')][_0x05b6('0x43')]){return _0x23c818['account'][_0x05b6('0x3a')][_0x05b6('0x3b')][0x0];}var _0x35309a=_[_0x05b6('0xb')](_0x233736[_0x05b6('0x24')],{'firstName':_0x233736[_0x05b6('0x24')]['from'],'ListId':_0x59fdea[_0x05b6('0x44')]});_0x35309a[_0x233736[_0x05b6('0x24')][_0x05b6('0x34')]]=_0x233736[_0x05b6('0x24')]['from'];return db['CmContact'][_0x05b6('0x45')](_0x35309a,{'fields':_0x3d5218,'raw':!![]});}})[_0x05b6('0x10')](function(_0x1e1785){_0x23c818[_0x05b6('0x46')]=_0x1e1785;if(_0x1e1785){var _0x43fdf2={'ContactId':_0x1e1785['id'],'FaxAccountId':_0x233736[_0x05b6('0x38')]['id'],'fax':_0x1e1785[_0x05b6('0x25')]};return db[_0x05b6('0x47')][_0x05b6('0x37')]({'where':{'ContactId':_0x1e1785['id'],'closed':![],'FaxAccountId':_0x233736[_0x05b6('0x38')]['id']}})[_0x05b6('0x10')](function(_0xac75a2){if(_0xac75a2){return[_0xac75a2,![]];}return db[_0x05b6('0x47')][_0x05b6('0x45')](_0x43fdf2)[_0x05b6('0x10')](function(_0x2acc11){return[_0x2acc11,!![]];});});}else{throw new Error(_0x05b6('0x48'));}})[_0x05b6('0x49')](function(_0x1fdfba,_0x6a654){var _0x2616b8=_0x1fdfba[_0x05b6('0x3f')]({'plain':!![]});if(_0x6a654){if(_0x23c818['account'][_0x05b6('0x4a')]){_0x23c818['applications'][_0x05b6('0x4b')]({'id':0x0,'priority':_0x23c818[_0x05b6('0x40')][_0x05b6('0x43')]+0x1,'app':_0x05b6('0x4c'),'appdata':'unmanaged','interval':_0x05b6('0x4d')});}_0x2616b8[_0x05b6('0x4e')]=!![];}else{_0x2616b8[_0x05b6('0x4e')]=![];}_0x23c818[_0x05b6('0x4f')]=_0x2616b8;return db[_0x05b6('0x50')][_0x05b6('0x45')]({'body':_0x233736[_0x05b6('0x24')][_0x05b6('0x24')],'FaxAccountId':_0x233736[_0x05b6('0x38')]['id'],'FaxInteractionId':_0x1fdfba['id'],'direction':'in','ContactId':_0x1fdfba[_0x05b6('0x51')],'AttachmentId':_0x233736[_0x05b6('0x24')]['AttachmentId']});})[_0x05b6('0x10')](function(_0x17728e){_0x23c818[_0x05b6('0x17')]=_0x17728e;if(!_0x23c818['interaction'][_0x05b6('0x52')])return;return db['User'][_0x05b6('0x37')]({'attributes':['id',_0x05b6('0x53')],'where':{'id':_0x23c818[_0x05b6('0x4f')][_0x05b6('0x52')]}});})[_0x05b6('0x10')](function(_0x457091){if(_0x457091){_0x23c818[_0x05b6('0x40')][_0x05b6('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x457091['name']+','+(_0x23c818[_0x05b6('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x05b6('0x4d')});}if(!_0x23c818['interaction'][_0x05b6('0x55')])return;return db['FaxQueue'][_0x05b6('0x37')]({'attributes':['id',_0x05b6('0x53')],'where':{'id':_0x23c818['interaction'][_0x05b6('0x55')]}});})[_0x05b6('0x10')](function(_0x3841be){if(_0x3841be){_0x23c818[_0x05b6('0x40')][_0x05b6('0x54')]({'id':0x0,'priority':0x1,'app':_0x05b6('0x56'),'appdata':_0x3841be[_0x05b6('0x53')]+','+(_0x23c818[_0x05b6('0x38')][_0x05b6('0x57')]||0x12c),'interval':_0x05b6('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x23c818);})[_0x05b6('0x10')](function(_0x1bca89){_0x5cd85c(_0x1bca89);})[_0x05b6('0x19')](function(_0x5c0abf){_0x54bc5b(_0x24751c[_0x05b6('0x15')](0x1f4,_0x5c0abf[_0x05b6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 879b4a0..9d01c84 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 _0x7267=['register','length','faxAccount:','./faxAccount.events','save','removeListener'];(function(_0x489078,_0x32b836){var _0x3910cc=function(_0x178e3b){while(--_0x178e3b){_0x489078['push'](_0x489078['shift']());}};_0x3910cc(++_0x32b836);}(_0x7267,0x6f));var _0x7726=function(_0x1a62de,_0x28259a){_0x1a62de=_0x1a62de-0x0;var _0x48fcfe=_0x7267[_0x1a62de];return _0x48fcfe;};'use strict';var FaxAccountEvents=require(_0x7726('0x0'));var events=[_0x7726('0x1'),'remove','update'];function createListener(_0x10b3f9,_0x2a3c6e){return function(_0x21b2bc){_0x2a3c6e['emit'](_0x10b3f9,_0x21b2bc);};}function removeListener(_0x2d97ce,_0x2f93c4){return function(){FaxAccountEvents[_0x7726('0x2')](_0x2d97ce,_0x2f93c4);};}exports[_0x7726('0x3')]=function(_0x1acebb){for(var _0xba524=0x0,_0xd2f035=events[_0x7726('0x4')];_0xba524<_0xd2f035;_0xba524++){var _0x3b2b06=events[_0xba524];var _0x2c032a=createListener(_0x7726('0x5')+_0x3b2b06,_0x1acebb);FaxAccountEvents['on'](_0x3b2b06,_0x2c032a);}}; \ No newline at end of file +var _0x0f5c=['save','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x0f5c,0x18f));var _0xc0f5=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x0f5c[_0x53c256];return _0x25feb6;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xc0f5('0x0'),_0xc0f5('0x1'),_0xc0f5('0x2')];function createListener(_0x233454,_0x2bd087){return function(_0x3657f5){_0x2bd087[_0xc0f5('0x3')](_0x233454,_0x3657f5);};}function removeListener(_0x382b22,_0x4e4c0b){return function(){FaxAccountEvents[_0xc0f5('0x4')](_0x382b22,_0x4e4c0b);};}exports[_0xc0f5('0x5')]=function(_0x2d421c){for(var _0x2a7172=0x0,_0x5180a6=events['length'];_0x2a7172<_0x5180a6;_0x2a7172++){var _0x1ae9ba=events[_0x2a7172];var _0x15d20b=createListener(_0xc0f5('0x6')+_0x1ae9ba,_0x2d421c);FaxAccountEvents['on'](_0x1ae9ba,_0x15d20b);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 16a4d9b..01f9291 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 _0xd6eb=['updateAccountApplications','send','addAgents','/:id','update','delete','removeAnswers','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd6eb,0x83));var _0xbd6e=function(_0x1332bc,_0x63af04){_0x1332bc=_0x1332bc-0x0;var _0x427301=_0xd6eb[_0x1332bc];return _0x427301;};'use strict';var multer=require('multer');var util=require(_0xbd6e('0x0'));var path=require(_0xbd6e('0x1'));var timeout=require(_0xbd6e('0x2'));var express=require('express');var router=express[_0xbd6e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd6e('0x4'));var interaction=require(_0xbd6e('0x5'));var config=require(_0xbd6e('0x6'));var controller=require(_0xbd6e('0x7'));router[_0xbd6e('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd6e('0x9')]);router['get'](_0xbd6e('0xa'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0xc')]);router[_0xbd6e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbd6e('0xd')]);router['get'](_0xbd6e('0xe'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0xf')]);router[_0xbd6e('0x8')](_0xbd6e('0x10'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x11')]);router[_0xbd6e('0x8')](_0xbd6e('0x12'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x13')]);router['get'](_0xbd6e('0x14'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x15')]);router['get'](_0xbd6e('0x16'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x17')]);router[_0xbd6e('0x8')](_0xbd6e('0x18'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x19')]);router[_0xbd6e('0x1a')]('/',auth['isAuthenticated'](),controller[_0xbd6e('0x1b')]);router[_0xbd6e('0x1a')](_0xbd6e('0xe'),auth[_0xbd6e('0xb')](),controller['addDisposition']);router[_0xbd6e('0x1a')](_0xbd6e('0x10'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x1c')]);router[_0xbd6e('0x1a')](_0xbd6e('0x12'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x1d')]);router[_0xbd6e('0x1a')](_0xbd6e('0x14'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xbd6e('0x1e'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x1f')]);router['post'](_0xbd6e('0x20'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x21')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xbd6e('0x22')]);router[_0xbd6e('0x1a')](_0xbd6e('0x18'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x23')]);router['put'](_0xbd6e('0x24'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x25')]);router['delete'](_0xbd6e('0x24'),auth[_0xbd6e('0xb')](),controller['destroy']);router['delete'](_0xbd6e('0xe'),auth[_0xbd6e('0xb')](),controller['removeDispositions']);router[_0xbd6e('0x26')](_0xbd6e('0x10'),auth['isAuthenticated'](),controller[_0xbd6e('0x27')]);router[_0xbd6e('0x26')](_0xbd6e('0x18'),auth[_0xbd6e('0xb')](),controller[_0xbd6e('0x28')]);module['exports']=router; \ No newline at end of file +var _0xc093=['/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','addApplications'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc093,0x1ba));var _0x3c09=function(_0x6f1f57,_0x6510a4){_0x6f1f57=_0x6f1f57-0x0;var _0x51dcf9=_0xc093[_0x6f1f57];return _0x51dcf9;};'use strict';var multer=require(_0x3c09('0x0'));var util=require(_0x3c09('0x1'));var path=require(_0x3c09('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c09('0x3'));var router=express['Router']();var fs_extra=require(_0x3c09('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3c09('0x5'));var config=require(_0x3c09('0x6'));var controller=require(_0x3c09('0x7'));router[_0x3c09('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c09('0x9')]);router[_0x3c09('0x8')](_0x3c09('0xa'),auth[_0x3c09('0xb')](),controller[_0x3c09('0xc')]);router[_0x3c09('0x8')](_0x3c09('0xd'),auth[_0x3c09('0xb')](),controller[_0x3c09('0xe')]);router[_0x3c09('0x8')](_0x3c09('0xf'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x10')]);router[_0x3c09('0x8')](_0x3c09('0x11'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x12')]);router[_0x3c09('0x8')](_0x3c09('0x13'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x14')]);router[_0x3c09('0x8')]('/:id/applications',auth[_0x3c09('0xb')](),controller[_0x3c09('0x15')]);router[_0x3c09('0x8')](_0x3c09('0x16'),auth[_0x3c09('0xb')](),controller['getMessages']);router['get'](_0x3c09('0x17'),auth['isAuthenticated'](),controller[_0x3c09('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c09('0x19')]);router[_0x3c09('0x1a')](_0x3c09('0xf'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x1b')]);router['post'](_0x3c09('0x11'),auth['isAuthenticated'](),controller[_0x3c09('0x1c')]);router[_0x3c09('0x1a')](_0x3c09('0x13'),auth['isAuthenticated'](),controller[_0x3c09('0x1d')]);router[_0x3c09('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3c09('0x1e')]);router[_0x3c09('0x1a')](_0x3c09('0x1f'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x20')]);router['post'](_0x3c09('0x21'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x22')]);router[_0x3c09('0x1a')](_0x3c09('0x23'),auth['isAuthenticated'](),controller['send']);router[_0x3c09('0x1a')](_0x3c09('0x17'),auth[_0x3c09('0xb')](),controller['addAgents']);router[_0x3c09('0x24')](_0x3c09('0xd'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x25')]);router['delete'](_0x3c09('0xd'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x26')]);router[_0x3c09('0x27')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3c09('0x28')]);router[_0x3c09('0x27')](_0x3c09('0x11'),auth[_0x3c09('0xb')](),controller[_0x3c09('0x29')]);router[_0x3c09('0x27')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3c09('0x2a')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6b95edb..9a767ef 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 _0x0b1e=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x24267b,_0x3bed91){var _0x19824a=function(_0x5d6c6f){while(--_0x5d6c6f){_0x24267b['push'](_0x24267b['shift']());}};_0x19824a(++_0x3bed91);}(_0x0b1e,0x132));var _0xe0b1=function(_0xf858e,_0x51b0f1){_0xf858e=_0xf858e-0x0;var _0x5344d8=_0x0b1e[_0xf858e];return _0x5344d8;};'use strict';var Sequelize=require(_0xe0b1('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe0b1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe0b1('0x2')],'allowNull':![],'defaultValue':_0xe0b1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe0b1('0x2')]},'interval':{'type':Sequelize[_0xe0b1('0x2')],'defaultValue':_0xe0b1('0x4')}}; \ No newline at end of file +var _0xd205=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x5642bd,_0x5dbcc2){var _0x366ca1=function(_0x15bfdb){while(--_0x15bfdb){_0x5642bd['push'](_0x5642bd['shift']());}};_0x366ca1(++_0x5dbcc2);}(_0xd205,0xa0));var _0x5d20=function(_0x1279eb,_0x3d03ab){_0x1279eb=_0x1279eb-0x0;var _0x31a914=_0xd205[_0x1279eb];return _0x31a914;};'use strict';var Sequelize=require('sequelize');module[_0x5d20('0x0')]={'priority':{'type':Sequelize[_0x5d20('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5d20('0x2')],'allowNull':![],'defaultValue':_0x5d20('0x3')},'appdata':{'type':Sequelize[_0x5d20('0x4')]()},'description':{'type':Sequelize[_0x5d20('0x2')]},'interval':{'type':Sequelize[_0x5d20('0x2')],'defaultValue':_0x5d20('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6d825a4..c05bd29 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 _0x2333=['path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','name','send','index','FaxApplication','fieldName','key','map','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','keys','length','includeAll','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x216c84,_0x2842b7){var _0x48e85d=function(_0x17ba2f){while(--_0x17ba2f){_0x216c84['push'](_0x216c84['shift']());}};_0x48e85d(++_0x2842b7);}(_0x2333,0x1cd));var _0x3233=function(_0x167427,_0x2b3af5){_0x167427=_0x167427-0x0;var _0x140569=_0x2333[_0x167427];return _0x140569;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3233('0x0'));var zipdir=require(_0x3233('0x1'));var jsonpatch=require(_0x3233('0x2'));var rp=require(_0x3233('0x3'));var moment=require('moment');var BPromise=require(_0x3233('0x4'));var Mustache=require(_0x3233('0x5'));var util=require(_0x3233('0x6'));var path=require(_0x3233('0x7'));var sox=require(_0x3233('0x8'));var csv=require('to-csv');var ejs=require(_0x3233('0x9'));var fs=require('fs');var fs_extra=require(_0x3233('0xa'));var _=require('lodash');var squel=require(_0x3233('0xb'));var crypto=require(_0x3233('0xc'));var jsforce=require(_0x3233('0xd'));var deskjs=require(_0x3233('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3233('0xf'));var Papa=require(_0x3233('0x10'));var Redis=require(_0x3233('0x11'));var authService=require(_0x3233('0x12'));var qs=require(_0x3233('0x13'));var as=require(_0x3233('0x14'));var hardwareService=require(_0x3233('0x15'));var logger=require(_0x3233('0x16'))(_0x3233('0x17'));var utils=require(_0x3233('0x18'));var config=require(_0x3233('0x19'));var licenseUtil=require(_0x3233('0x1a'));var db=require(_0x3233('0x1b'))['db'];function respondWithStatusCode(_0x5c0be5,_0x1e1f22){_0x1e1f22=_0x1e1f22||0xcc;return function(_0x522be9){if(_0x522be9){return _0x5c0be5[_0x3233('0x1c')](_0x1e1f22);}return _0x5c0be5[_0x3233('0x1d')](_0x1e1f22)[_0x3233('0x1e')]();};}function respondWithResult(_0x632fbe,_0x164c49){_0x164c49=_0x164c49||0xc8;return function(_0x6c231f){if(_0x6c231f){return _0x632fbe['status'](_0x164c49)[_0x3233('0x1f')](_0x6c231f);}};}function respondWithFilteredResult(_0xf79f3b,_0x80a42b){return function(_0x412fb7){if(_0x412fb7){var _0x2eaa05=typeof _0x80a42b[_0x3233('0x20')]===_0x3233('0x21')&&typeof _0x80a42b[_0x3233('0x22')]===_0x3233('0x21');var _0x3f736f=_0x412fb7[_0x3233('0x23')];var _0x2e8cd1=_0x2eaa05?0x0:_0x80a42b['offset'];var _0x212c74=_0x2eaa05?_0x412fb7['count']:_0x80a42b[_0x3233('0x20')]+_0x80a42b[_0x3233('0x22')];var _0x159b74;if(_0x212c74>=_0x3f736f){_0x212c74=_0x3f736f;_0x159b74=0xc8;}else{_0x159b74=0xce;}_0xf79f3b[_0x3233('0x1d')](_0x159b74);return _0xf79f3b[_0x3233('0x24')]('Content-Range',_0x2e8cd1+'-'+_0x212c74+'/'+_0x3f736f)[_0x3233('0x1f')](_0x412fb7);}return null;};}function patchUpdates(_0x43bfd8){return function(_0x5b718f){try{jsonpatch[_0x3233('0x25')](_0x5b718f,_0x43bfd8,!![]);}catch(_0x464b99){return BPromise[_0x3233('0x26')](_0x464b99);}return _0x5b718f[_0x3233('0x27')]();};}function saveUpdates(_0x5a9b81,_0x3ac9c9){return function(_0x504916){if(_0x504916){return _0x504916['update'](_0x5a9b81)[_0x3233('0x28')](function(_0x3d1bf7){return _0x3d1bf7;});}return null;};}function removeEntity(_0x48535e,_0x1288ec){return function(_0x36b8cc){if(_0x36b8cc){return _0x36b8cc[_0x3233('0x29')]()[_0x3233('0x28')](function(){_0x48535e[_0x3233('0x1d')](0xcc)[_0x3233('0x1e')]();});}};}function handleEntityNotFound(_0x3795a8,_0x2681bd){return function(_0x293069){if(!_0x293069){_0x3795a8['sendStatus'](0x194);}return _0x293069;};}function handleError(_0x418bdc,_0x37ec1c){_0x37ec1c=_0x37ec1c||0x1f4;return function(_0x186b29){logger[_0x3233('0x2a')](_0x186b29['stack']);if(_0x186b29['name']){delete _0x186b29[_0x3233('0x2b')];}_0x418bdc[_0x3233('0x1d')](_0x37ec1c)[_0x3233('0x2c')](_0x186b29);};}exports[_0x3233('0x2d')]=function(_0x5bf321,_0x32ff01){var _0x2c69e4={},_0x4395ac={},_0x4c80ca={'count':0x0,'rows':[]};var _0x24d8e7=_['map'](db[_0x3233('0x2e')]['rawAttributes'],function(_0x5540f0){return{'name':_0x5540f0[_0x3233('0x2f')],'type':_0x5540f0['type'][_0x3233('0x30')]};});_0x4395ac['model']=_[_0x3233('0x31')](_0x24d8e7,_0x3233('0x2b'));_0x4395ac[_0x3233('0x32')]=_['keys'](_0x5bf321[_0x3233('0x32')]);_0x4395ac['filters']=_[_0x3233('0x33')](_0x4395ac[_0x3233('0x34')],_0x4395ac[_0x3233('0x32')]);_0x2c69e4[_0x3233('0x35')]=_[_0x3233('0x33')](_0x4395ac[_0x3233('0x34')],qs[_0x3233('0x36')](_0x5bf321[_0x3233('0x32')][_0x3233('0x36')]));_0x2c69e4[_0x3233('0x35')]=_0x2c69e4[_0x3233('0x35')]['length']?_0x2c69e4[_0x3233('0x35')]:_0x4395ac['model'];if(!_0x5bf321[_0x3233('0x32')][_0x3233('0x37')]('nolimit')){_0x2c69e4['limit']=qs[_0x3233('0x22')](_0x5bf321[_0x3233('0x32')]['limit']);_0x2c69e4['offset']=qs[_0x3233('0x20')](_0x5bf321[_0x3233('0x32')][_0x3233('0x20')]);}_0x2c69e4[_0x3233('0x38')]=qs[_0x3233('0x39')](_0x5bf321[_0x3233('0x32')][_0x3233('0x39')]);_0x2c69e4['where']=qs[_0x3233('0x3a')](_[_0x3233('0x3b')](_0x5bf321['query'],_0x4395ac[_0x3233('0x3a')]),_0x24d8e7);if(_0x5bf321[_0x3233('0x32')][_0x3233('0x3c')]){_0x2c69e4['where']=_[_0x3233('0x3d')](_0x2c69e4['where'],{'$or':_[_0x3233('0x31')](_0x24d8e7,function(_0x1a1f1b){if(_0x1a1f1b[_0x3233('0x3e')]!==_0x3233('0x3f')){var _0x3c7fee={};_0x3c7fee[_0x1a1f1b[_0x3233('0x2b')]]={'$like':'%'+_0x5bf321[_0x3233('0x32')][_0x3233('0x3c')]+'%'};return _0x3c7fee;}})});}_0x2c69e4=_[_0x3233('0x3d')]({},_0x2c69e4,_0x5bf321['options']);var _0x5c0086={'where':_0x2c69e4['where']};return db[_0x3233('0x2e')][_0x3233('0x23')](_0x5c0086)[_0x3233('0x28')](function(_0x2a228b){_0x4c80ca['count']=_0x2a228b;if(_0x5bf321[_0x3233('0x32')]['includeAll']){_0x2c69e4[_0x3233('0x40')]=[{'all':!![]}];}return db[_0x3233('0x2e')][_0x3233('0x41')](_0x2c69e4);})[_0x3233('0x28')](function(_0x109883){_0x4c80ca[_0x3233('0x42')]=_0x109883;return _0x4c80ca;})[_0x3233('0x28')](respondWithFilteredResult(_0x32ff01,_0x2c69e4))[_0x3233('0x43')](handleError(_0x32ff01,null));};exports[_0x3233('0x44')]=function(_0x4d8790,_0x9b5dae){var _0x327f3c={'raw':!![],'where':{'id':_0x4d8790[_0x3233('0x45')]['id']}},_0x3e9d58={};_0x3e9d58[_0x3233('0x34')]=_['keys'](db[_0x3233('0x2e')][_0x3233('0x46')]);_0x3e9d58[_0x3233('0x32')]=_[_0x3233('0x47')](_0x4d8790[_0x3233('0x32')]);_0x3e9d58[_0x3233('0x3a')]=_[_0x3233('0x33')](_0x3e9d58[_0x3233('0x34')],_0x3e9d58[_0x3233('0x32')]);_0x327f3c[_0x3233('0x35')]=_[_0x3233('0x33')](_0x3e9d58[_0x3233('0x34')],qs[_0x3233('0x36')](_0x4d8790[_0x3233('0x32')][_0x3233('0x36')]));_0x327f3c[_0x3233('0x35')]=_0x327f3c[_0x3233('0x35')][_0x3233('0x48')]?_0x327f3c[_0x3233('0x35')]:_0x3e9d58[_0x3233('0x34')];if(_0x4d8790['query'][_0x3233('0x49')]){_0x327f3c[_0x3233('0x40')]=[{'all':!![]}];}_0x327f3c=_['merge']({},_0x327f3c,_0x4d8790['options']);return db[_0x3233('0x2e')][_0x3233('0x4a')](_0x327f3c)['then'](handleEntityNotFound(_0x9b5dae,null))['then'](respondWithResult(_0x9b5dae,null))['catch'](handleError(_0x9b5dae,null));};exports[_0x3233('0x4b')]=function(_0x14b0a7,_0x2d8f22){return db[_0x3233('0x2e')][_0x3233('0x4b')](_0x14b0a7[_0x3233('0x4c')],{})[_0x3233('0x28')](respondWithResult(_0x2d8f22,0xc9))[_0x3233('0x43')](handleError(_0x2d8f22,null));};exports[_0x3233('0x4d')]=function(_0x4c79ed,_0x15bb74){if(_0x4c79ed[_0x3233('0x4c')]['id']){delete _0x4c79ed[_0x3233('0x4c')]['id'];}return db[_0x3233('0x2e')][_0x3233('0x4a')]({'where':{'id':_0x4c79ed[_0x3233('0x45')]['id']}})[_0x3233('0x28')](handleEntityNotFound(_0x15bb74,null))[_0x3233('0x28')](saveUpdates(_0x4c79ed[_0x3233('0x4c')],null))[_0x3233('0x28')](respondWithResult(_0x15bb74,null))[_0x3233('0x43')](handleError(_0x15bb74,null));};exports[_0x3233('0x29')]=function(_0x210a4a,_0x5e8dba){return db[_0x3233('0x2e')][_0x3233('0x4a')]({'where':{'id':_0x210a4a[_0x3233('0x45')]['id']}})[_0x3233('0x28')](handleEntityNotFound(_0x5e8dba,null))[_0x3233('0x28')](removeEntity(_0x5e8dba,null))[_0x3233('0x43')](handleError(_0x5e8dba,null));}; \ No newline at end of file +var _0x1303=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','then','error','name','send','map','FaxApplication','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x211118,_0x47e095){var _0x517edf=function(_0x39ffee){while(--_0x39ffee){_0x211118['push'](_0x211118['shift']());}};_0x517edf(++_0x47e095);}(_0x1303,0x1ba));var _0x3130=function(_0x5173b3,_0x26273d){_0x5173b3=_0x5173b3-0x0;var _0x16d4d7=_0x1303[_0x5173b3];return _0x16d4d7;};'use strict';var emlformat=require(_0x3130('0x0'));var rimraf=require(_0x3130('0x1'));var zipdir=require(_0x3130('0x2'));var jsonpatch=require(_0x3130('0x3'));var rp=require(_0x3130('0x4'));var moment=require(_0x3130('0x5'));var BPromise=require(_0x3130('0x6'));var Mustache=require(_0x3130('0x7'));var util=require(_0x3130('0x8'));var path=require(_0x3130('0x9'));var sox=require(_0x3130('0xa'));var csv=require(_0x3130('0xb'));var ejs=require(_0x3130('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3130('0xd'));var squel=require(_0x3130('0xe'));var crypto=require(_0x3130('0xf'));var jsforce=require(_0x3130('0x10'));var deskjs=require(_0x3130('0x11'));var toCsv=require(_0x3130('0xb'));var querystring=require(_0x3130('0x12'));var Papa=require('papaparse');var Redis=require(_0x3130('0x13'));var authService=require(_0x3130('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3130('0x15'));var hardwareService=require(_0x3130('0x16'));var logger=require(_0x3130('0x17'))(_0x3130('0x18'));var utils=require(_0x3130('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3130('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb461,_0x1da6bc){_0x1da6bc=_0x1da6bc||0xcc;return function(_0x5597b3){if(_0x5597b3){return _0x2eb461['sendStatus'](_0x1da6bc);}return _0x2eb461[_0x3130('0x1b')](_0x1da6bc)[_0x3130('0x1c')]();};}function respondWithResult(_0x577769,_0x544298){_0x544298=_0x544298||0xc8;return function(_0x1e9bb9){if(_0x1e9bb9){return _0x577769[_0x3130('0x1b')](_0x544298)[_0x3130('0x1d')](_0x1e9bb9);}};}function respondWithFilteredResult(_0x2d0a3a,_0xdcf621){return function(_0x543f43){if(_0x543f43){var _0x41b1d5=typeof _0xdcf621[_0x3130('0x1e')]===_0x3130('0x1f')&&typeof _0xdcf621[_0x3130('0x20')]==='undefined';var _0x5095cb=_0x543f43['count'];var _0x10f021=_0x41b1d5?0x0:_0xdcf621[_0x3130('0x1e')];var _0x2f6da1=_0x41b1d5?_0x543f43['count']:_0xdcf621[_0x3130('0x1e')]+_0xdcf621[_0x3130('0x20')];var _0x393acb;if(_0x2f6da1>=_0x5095cb){_0x2f6da1=_0x5095cb;_0x393acb=0xc8;}else{_0x393acb=0xce;}_0x2d0a3a[_0x3130('0x1b')](_0x393acb);return _0x2d0a3a[_0x3130('0x21')](_0x3130('0x22'),_0x10f021+'-'+_0x2f6da1+'/'+_0x5095cb)[_0x3130('0x1d')](_0x543f43);}return null;};}function patchUpdates(_0x38c911){return function(_0x283a99){try{jsonpatch['apply'](_0x283a99,_0x38c911,!![]);}catch(_0x398ef3){return BPromise[_0x3130('0x23')](_0x398ef3);}return _0x283a99[_0x3130('0x24')]();};}function saveUpdates(_0x5ac7ce,_0x147d40){return function(_0x46993c){if(_0x46993c){return _0x46993c[_0x3130('0x25')](_0x5ac7ce)['then'](function(_0x4ac020){return _0x4ac020;});}return null;};}function removeEntity(_0x25cb16,_0x2fbcce){return function(_0x25dd32){if(_0x25dd32){return _0x25dd32[_0x3130('0x26')]()[_0x3130('0x27')](function(){_0x25cb16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1770f6,_0x2e08ff){return function(_0x117f95){if(!_0x117f95){_0x1770f6['sendStatus'](0x194);}return _0x117f95;};}function handleError(_0x473cec,_0x3a905c){_0x3a905c=_0x3a905c||0x1f4;return function(_0x2b5b2d){logger[_0x3130('0x28')](_0x2b5b2d['stack']);if(_0x2b5b2d[_0x3130('0x29')]){delete _0x2b5b2d[_0x3130('0x29')];}_0x473cec[_0x3130('0x1b')](_0x3a905c)[_0x3130('0x2a')](_0x2b5b2d);};}exports['index']=function(_0x115762,_0x2b0b58){var _0xf9165d={},_0xc46b57={},_0x3e0f7d={'count':0x0,'rows':[]};var _0x5d305d=_[_0x3130('0x2b')](db[_0x3130('0x2c')][_0x3130('0x2d')],function(_0x2cc5f3){return{'name':_0x2cc5f3[_0x3130('0x2e')],'type':_0x2cc5f3[_0x3130('0x2f')]['key']};});_0xc46b57[_0x3130('0x30')]=_[_0x3130('0x2b')](_0x5d305d,'name');_0xc46b57['query']=_[_0x3130('0x31')](_0x115762[_0x3130('0x32')]);_0xc46b57[_0x3130('0x33')]=_[_0x3130('0x34')](_0xc46b57[_0x3130('0x30')],_0xc46b57['query']);_0xf9165d['attributes']=_[_0x3130('0x34')](_0xc46b57[_0x3130('0x30')],qs[_0x3130('0x35')](_0x115762[_0x3130('0x32')][_0x3130('0x35')]));_0xf9165d[_0x3130('0x36')]=_0xf9165d[_0x3130('0x36')][_0x3130('0x37')]?_0xf9165d['attributes']:_0xc46b57[_0x3130('0x30')];if(!_0x115762[_0x3130('0x32')][_0x3130('0x38')](_0x3130('0x39'))){_0xf9165d['limit']=qs[_0x3130('0x20')](_0x115762[_0x3130('0x32')]['limit']);_0xf9165d[_0x3130('0x1e')]=qs[_0x3130('0x1e')](_0x115762[_0x3130('0x32')][_0x3130('0x1e')]);}_0xf9165d[_0x3130('0x3a')]=qs[_0x3130('0x3b')](_0x115762[_0x3130('0x32')][_0x3130('0x3b')]);_0xf9165d[_0x3130('0x3c')]=qs[_0x3130('0x33')](_['pick'](_0x115762[_0x3130('0x32')],_0xc46b57[_0x3130('0x33')]),_0x5d305d);if(_0x115762['query'][_0x3130('0x3d')]){_0xf9165d[_0x3130('0x3c')]=_[_0x3130('0x3e')](_0xf9165d['where'],{'$or':_['map'](_0x5d305d,function(_0xc5764a){if(_0xc5764a[_0x3130('0x2f')]!==_0x3130('0x3f')){var _0xf7bd7a={};_0xf7bd7a[_0xc5764a[_0x3130('0x29')]]={'$like':'%'+_0x115762[_0x3130('0x32')][_0x3130('0x3d')]+'%'};return _0xf7bd7a;}})});}_0xf9165d=_['merge']({},_0xf9165d,_0x115762[_0x3130('0x40')]);var _0x2fb512={'where':_0xf9165d[_0x3130('0x3c')]};return db[_0x3130('0x2c')][_0x3130('0x41')](_0x2fb512)[_0x3130('0x27')](function(_0x38a289){_0x3e0f7d[_0x3130('0x41')]=_0x38a289;if(_0x115762[_0x3130('0x32')][_0x3130('0x42')]){_0xf9165d['include']=[{'all':!![]}];}return db[_0x3130('0x2c')][_0x3130('0x43')](_0xf9165d);})[_0x3130('0x27')](function(_0x4318c8){_0x3e0f7d[_0x3130('0x44')]=_0x4318c8;return _0x3e0f7d;})[_0x3130('0x27')](respondWithFilteredResult(_0x2b0b58,_0xf9165d))['catch'](handleError(_0x2b0b58,null));};exports[_0x3130('0x45')]=function(_0x222efd,_0x4391b4){var _0x48c70b={'raw':!![],'where':{'id':_0x222efd['params']['id']}},_0x201eb4={};_0x201eb4[_0x3130('0x30')]=_[_0x3130('0x31')](db[_0x3130('0x2c')][_0x3130('0x2d')]);_0x201eb4[_0x3130('0x32')]=_[_0x3130('0x31')](_0x222efd[_0x3130('0x32')]);_0x201eb4[_0x3130('0x33')]=_[_0x3130('0x34')](_0x201eb4[_0x3130('0x30')],_0x201eb4[_0x3130('0x32')]);_0x48c70b['attributes']=_[_0x3130('0x34')](_0x201eb4['model'],qs[_0x3130('0x35')](_0x222efd['query']['fields']));_0x48c70b[_0x3130('0x36')]=_0x48c70b[_0x3130('0x36')][_0x3130('0x37')]?_0x48c70b[_0x3130('0x36')]:_0x201eb4['model'];if(_0x222efd['query'][_0x3130('0x42')]){_0x48c70b[_0x3130('0x46')]=[{'all':!![]}];}_0x48c70b=_[_0x3130('0x3e')]({},_0x48c70b,_0x222efd[_0x3130('0x40')]);return db[_0x3130('0x2c')][_0x3130('0x47')](_0x48c70b)['then'](handleEntityNotFound(_0x4391b4,null))[_0x3130('0x27')](respondWithResult(_0x4391b4,null))[_0x3130('0x48')](handleError(_0x4391b4,null));};exports['create']=function(_0x38b514,_0x4cd129){return db[_0x3130('0x2c')][_0x3130('0x49')](_0x38b514['body'],{})[_0x3130('0x27')](respondWithResult(_0x4cd129,0xc9))[_0x3130('0x48')](handleError(_0x4cd129,null));};exports[_0x3130('0x25')]=function(_0x26e863,_0x33337e){if(_0x26e863[_0x3130('0x4a')]['id']){delete _0x26e863[_0x3130('0x4a')]['id'];}return db[_0x3130('0x2c')]['find']({'where':{'id':_0x26e863[_0x3130('0x4b')]['id']}})[_0x3130('0x27')](handleEntityNotFound(_0x33337e,null))[_0x3130('0x27')](saveUpdates(_0x26e863[_0x3130('0x4a')],null))[_0x3130('0x27')](respondWithResult(_0x33337e,null))[_0x3130('0x48')](handleError(_0x33337e,null));};exports['destroy']=function(_0x3f7300,_0x8ca803){return db[_0x3130('0x2c')]['find']({'where':{'id':_0x3f7300[_0x3130('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8ca803,null))[_0x3130('0x27')](removeEntity(_0x8ca803,null))['catch'](handleError(_0x8ca803,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 89b9208..873b426 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 _0x0cb7=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x28a7a9,_0xf7681d){var _0x5d77ed=function(_0x2d3913){while(--_0x2d3913){_0x28a7a9['push'](_0x28a7a9['shift']());}};_0x5d77ed(++_0xf7681d);}(_0x0cb7,0x1dd));var _0x70cb=function(_0x5c1c99,_0x47c1a5){_0x5c1c99=_0x5c1c99-0x0;var _0x5fa09f=_0x0cb7[_0x5c1c99];return _0x5fa09f;};'use strict';var _=require(_0x70cb('0x0'));var util=require(_0x70cb('0x1'));var logger=require(_0x70cb('0x2'))(_0x70cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x70cb('0x4'));var fs=require('fs');var path=require(_0x70cb('0x5'));var rimraf=require('rimraf');var config=require(_0x70cb('0x6'));var attributes=require(_0x70cb('0x7'));module[_0x70cb('0x8')]=function(_0x1d3b71,_0x5a4a74){return _0x1d3b71[_0x70cb('0x9')](_0x70cb('0xa'),attributes,{'tableName':_0x70cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x70cb('0xc'),'collate':_0x70cb('0xd')});}; \ No newline at end of file +var _0x087c=['../../config/environment','exports','fax_applications','utf8mb4','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1d41ae,_0x4f5543){var _0x3a040c=function(_0x2b9657){while(--_0x2b9657){_0x1d41ae['push'](_0x1d41ae['shift']());}};_0x3a040c(++_0x4f5543);}(_0x087c,0xd6));var _0xc087=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x087c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc087('0x0'))(_0xc087('0x1'));var moment=require('moment');var BPromise=require(_0xc087('0x2'));var rp=require(_0xc087('0x3'));var fs=require('fs');var path=require(_0xc087('0x4'));var rimraf=require(_0xc087('0x5'));var config=require(_0xc087('0x6'));var attributes=require('./faxApplication.attributes');module[_0xc087('0x7')]=function(_0x3351bb,_0x38472a){return _0x3351bb['define']('FaxApplication',attributes,{'tableName':_0xc087('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc087('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ac87e3a..8b73c09 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 _0xd3f1=['body','options','where','attributes','limit','UpdateFaxApplication','stringify','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','FaxApplication','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd3f1,0x1ba));var _0x1d3f=function(_0x5ba273,_0x5227e2){_0x5ba273=_0x5ba273-0x0;var _0x237f6c=_0xd3f1[_0x5ba273];return _0x237f6c;};'use strict';var _=require('lodash');var util=require(_0x1d3f('0x0'));var moment=require(_0x1d3f('0x1'));var BPromise=require(_0x1d3f('0x2'));var rs=require(_0x1d3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d3f('0x4'));var logger=require('../../config/logger')(_0x1d3f('0x5'));var config=require(_0x1d3f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1d3f('0x7')][_0x1d3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3391bf,_0x13bd67,_0x4803e4){return new BPromise(function(_0xcc5ec0,_0x16f792){return client[_0x1d3f('0x9')](_0x3391bf,_0x4803e4)[_0x1d3f('0xa')](function(_0x3fea13){logger['info'](_0x1d3f('0xb'),_0x13bd67,_0x1d3f('0xc'));logger[_0x1d3f('0xd')](_0x1d3f('0xe'),_0x13bd67,_0x1d3f('0xc'),JSON['stringify'](_0x3fea13));if(_0x3fea13[_0x1d3f('0xf')]){if(_0x3fea13[_0x1d3f('0xf')]['code']===0x1f4){logger['error'](_0x1d3f('0xb'),_0x13bd67,_0x3fea13['error'][_0x1d3f('0x10')]);return _0x16f792(_0x3fea13[_0x1d3f('0xf')]['message']);}logger[_0x1d3f('0xf')](_0x1d3f('0xb'),_0x13bd67,_0x3fea13[_0x1d3f('0xf')][_0x1d3f('0x10')]);return _0xcc5ec0(_0x3fea13[_0x1d3f('0xf')][_0x1d3f('0x10')]);}else{logger[_0x1d3f('0x11')](_0x1d3f('0xb'),_0x13bd67,_0x1d3f('0xc'));_0xcc5ec0(_0x3fea13[_0x1d3f('0x12')]['message']);}})[_0x1d3f('0x13')](function(_0x105000){logger[_0x1d3f('0xf')](_0x1d3f('0xb'),_0x13bd67,_0x105000);_0x16f792(_0x105000);});});}exports['UpdateFaxApplication']=function(_0x63e609){var _0x4a3179=this;return new Promise(function(_0xd0b2ab,_0x17d706){return db[_0x1d3f('0x14')][_0x1d3f('0x15')](_0x63e609[_0x1d3f('0x16')],{'raw':_0x63e609[_0x1d3f('0x17')]?_0x63e609[_0x1d3f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63e609[_0x1d3f('0x17')]?_0x63e609['options'][_0x1d3f('0x18')]||null:null,'attributes':_0x63e609[_0x1d3f('0x17')]?_0x63e609['options'][_0x1d3f('0x19')]||null:null,'limit':_0x63e609[_0x1d3f('0x17')]?_0x63e609[_0x1d3f('0x17')][_0x1d3f('0x1a')]||null:null})[_0x1d3f('0xa')](function(_0x2dce2d){logger[_0x1d3f('0x11')]('UpdateFaxApplication',_0x63e609);logger[_0x1d3f('0xd')](_0x1d3f('0x1b'),_0x63e609,JSON[_0x1d3f('0x1c')](_0x2dce2d));_0xd0b2ab(_0x2dce2d);})[_0x1d3f('0x13')](function(_0x3cf2ff){logger[_0x1d3f('0xf')](_0x1d3f('0x1b'),_0x3cf2ff[_0x1d3f('0x10')],_0x63e609);_0x17d706(_0x4a3179['error'](0x1f4,_0x3cf2ff[_0x1d3f('0x10')]));});});}; \ No newline at end of file +var _0x074b=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','FaxApplication','update','body','options','raw','where','limit','UpdateFaxApplication','lodash'];(function(_0x7d093e,_0xf569ea){var _0x34432d=function(_0x3996f9){while(--_0x3996f9){_0x7d093e['push'](_0x7d093e['shift']());}};_0x34432d(++_0xf569ea);}(_0x074b,0x195));var _0xb074=function(_0x14c14f,_0x580094){_0x14c14f=_0x14c14f-0x0;var _0x7be2b6=_0x074b[_0x14c14f];return _0x7be2b6;};'use strict';var _=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var moment=require(_0xb074('0x2'));var BPromise=require(_0xb074('0x3'));var rs=require(_0xb074('0x4'));var fs=require('fs');var Redis=require(_0xb074('0x5'));var db=require(_0xb074('0x6'))['db'];var utils=require(_0xb074('0x7'));var logger=require(_0xb074('0x8'))(_0xb074('0x9'));var config=require('../../config/environment');var jayson=require(_0xb074('0xa'));var client=jayson[_0xb074('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8d92,_0x330d20,_0x24515c){return new BPromise(function(_0x542721,_0x16e8ff){return client['request'](_0x1f8d92,_0x24515c)[_0xb074('0xc')](function(_0x27ff21){logger[_0xb074('0xd')](_0xb074('0xe'),_0x330d20,_0xb074('0xf'));logger[_0xb074('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x330d20,_0xb074('0xf'),JSON['stringify'](_0x27ff21));if(_0x27ff21[_0xb074('0x11')]){if(_0x27ff21[_0xb074('0x11')][_0xb074('0x12')]===0x1f4){logger[_0xb074('0x11')](_0xb074('0xe'),_0x330d20,_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);return _0x16e8ff(_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);}logger[_0xb074('0x11')]('FaxApplication,\x20%s,\x20%s',_0x330d20,_0x27ff21[_0xb074('0x11')][_0xb074('0x13')]);return _0x542721(_0x27ff21['error'][_0xb074('0x13')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x330d20,_0xb074('0xf'));_0x542721(_0x27ff21['result'][_0xb074('0x13')]);}})[_0xb074('0x14')](function(_0xa9af0a){logger[_0xb074('0x11')](_0xb074('0xe'),_0x330d20,_0xa9af0a);_0x16e8ff(_0xa9af0a);});});}exports['UpdateFaxApplication']=function(_0x3222ce){var _0x259843=this;return new Promise(function(_0x221fd1,_0x4a2a31){return db[_0xb074('0x15')][_0xb074('0x16')](_0x3222ce[_0xb074('0x17')],{'raw':_0x3222ce['options']?_0x3222ce[_0xb074('0x18')][_0xb074('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3222ce[_0xb074('0x18')]?_0x3222ce[_0xb074('0x18')][_0xb074('0x1a')]||null:null,'attributes':_0x3222ce['options']?_0x3222ce['options']['attributes']||null:null,'limit':_0x3222ce['options']?_0x3222ce['options'][_0xb074('0x1b')]||null:null})['then'](function(_0x370e6b){logger['info']('UpdateFaxApplication',_0x3222ce);logger[_0xb074('0x10')]('UpdateFaxApplication',_0x3222ce,JSON['stringify'](_0x370e6b));_0x221fd1(_0x370e6b);})[_0xb074('0x14')](function(_0x2d7944){logger[_0xb074('0x11')](_0xb074('0x1c'),_0x2d7944[_0xb074('0x13')],_0x3222ce);_0x4a2a31(_0x259843[_0xb074('0x11')](0x1f4,_0x2d7944['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4b29106..2c2fdd4 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 _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0x8603,0x190));var _0x3860=function(_0x20c942,_0x1d2f4d){_0x20c942=_0x20c942-0x0;var _0x49b605=_0x8603[_0x20c942];return _0x49b605;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x23427e,_0x8ef89d){var _0x25a9c7=function(_0xa25e1b){while(--_0xa25e1b){_0x23427e['push'](_0x23427e['shift']());}};_0x25a9c7(++_0x8ef89d);}(_0x4213,0x77));var _0x3421=function(_0x5b40f6,_0x35c981){_0x5b40f6=_0x5b40f6-0x0;var _0x50fd3d=_0x4213[_0x5b40f6];return _0x50fd3d;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d8c179b..384ab05 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 _0x5c3c=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x83d08e,_0x228942){var _0x404d4f=function(_0x161ce){while(--_0x161ce){_0x83d08e['push'](_0x83d08e['shift']());}};_0x404d4f(++_0x228942);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5c3c[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'closed':{'type':Sequelize[_0xc5c3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc5c3('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc5c3('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc5c3('0x4')]},'note':{'type':Sequelize[_0xc5c3('0x4')]},'read1stAt':{'type':Sequelize[_0xc5c3('0x3')]},'fax':{'type':Sequelize[_0xc5c3('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc5c3('0x5')]('in',_0xc5c3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc5c3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc5c3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdf55=['DATE','STRING','ENUM','out','INTEGER','sequelize','exports'];(function(_0x3cfa46,_0x941198){var _0x4b92a9=function(_0x383f97){while(--_0x383f97){_0x3cfa46['push'](_0x3cfa46['shift']());}};_0x4b92a9(++_0x941198);}(_0xdf55,0x83));var _0x5df5=function(_0x14b239,_0x3fda4e){_0x14b239=_0x14b239-0x0;var _0x3443eb=_0xdf55[_0x14b239];return _0x3443eb;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5df5('0x2')]},'disposition':{'type':Sequelize[_0x5df5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5df5('0x3')]},'note':{'type':Sequelize[_0x5df5('0x3')]},'read1stAt':{'type':Sequelize[_0x5df5('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x5df5('0x4')]('in',_0x5df5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5df5('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5df5('0x4')]('in',_0x5df5('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x5df5('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 580507c..c657677 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 _0x681c=['catch','params','model','keys','rawAttributes','filters','attributes','intersection','fields','include','merge','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','spread','color','emit','removeTags','unix','toString','root','server','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createWriteStream','err','rimraf','zip-dir','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','index','map','FaxInteraction','fieldName','key','findAll','fax','query','user'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x681c,0x9c));var _0xc681=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x681c[_0xd1d19a];return _0x52a79d;};'use strict';var rimraf=require(_0xc681('0x0'));var zipdir=require(_0xc681('0x1'));var moment=require('moment');var BPromise=require(_0xc681('0x2'));var util=require(_0xc681('0x3'));var path=require(_0xc681('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc681('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xc681('0x6'));var logger=require(_0xc681('0x7'))(_0xc681('0x8'));var config=require(_0xc681('0x9'));var db=require(_0xc681('0xa'))['db'];config[_0xc681('0xb')]=_[_0xc681('0xc')](config[_0xc681('0xb')],{'host':_0xc681('0xd'),'port':0x18eb});var socket=require(_0xc681('0xe'))(new Redis(config[_0xc681('0xb')]));require(_0xc681('0xf'))[_0xc681('0x10')](socket);function respondWithStatusCode(_0x3eb01a,_0x2b4df2){_0x2b4df2=_0x2b4df2||0xcc;return function(_0xfd6387){if(_0xfd6387){return _0x3eb01a[_0xc681('0x11')](_0x2b4df2);}return _0x3eb01a[_0xc681('0x12')](_0x2b4df2)[_0xc681('0x13')]();};}function respondWithResult(_0x1c5929,_0xb74c03){_0xb74c03=_0xb74c03||0xc8;return function(_0x1922d4){if(_0x1922d4){return _0x1c5929[_0xc681('0x12')](_0xb74c03)[_0xc681('0x14')](_0x1922d4);}};}function respondWithFilteredResult(_0x49bd9c,_0x4ae3e8){return function(_0x52f418){if(_0x52f418){var _0x24d12e=typeof _0x4ae3e8['offset']===_0xc681('0x15')&&typeof _0x4ae3e8[_0xc681('0x16')]==='undefined';var _0xfd8237=_0x52f418[_0xc681('0x17')];var _0x25b549=_0x24d12e?0x0:_0x4ae3e8['offset'];var _0x65dfc8=_0x24d12e?_0x52f418['count']:_0x4ae3e8[_0xc681('0x18')]+_0x4ae3e8[_0xc681('0x16')];var _0x1d72a9;if(_0x65dfc8>=_0xfd8237){_0x65dfc8=_0xfd8237;_0x1d72a9=0xc8;}else{_0x1d72a9=0xce;}_0x49bd9c[_0xc681('0x12')](_0x1d72a9);return _0x49bd9c[_0xc681('0x19')](_0xc681('0x1a'),_0x25b549+'-'+_0x65dfc8+'/'+_0xfd8237)[_0xc681('0x14')](_0x52f418);}return null;};}function saveUpdates(_0x57e42b){return function(_0x39a9eb){if(_0x39a9eb){return _0x39a9eb[_0xc681('0x1b')](_0x57e42b)[_0xc681('0x1c')](function(_0x242dc9){return _0x242dc9;});}return null;};}function removeEntity(_0x606d24){return function(_0x51f6f7){if(_0x51f6f7){return _0x51f6f7[_0xc681('0x1d')]()[_0xc681('0x1c')](function(){_0x606d24['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b31b){return function(_0x35fbe2){if(!_0x35fbe2){_0x48b31b[_0xc681('0x11')](0x194);}return _0x35fbe2;};}function handleError(_0x3d4e4d,_0x493892){_0x493892=_0x493892||0x1f4;return function(_0x526a3d){logger[_0xc681('0x1e')](_0x526a3d[_0xc681('0x1f')]);if(_0x526a3d['name']){delete _0x526a3d[_0xc681('0x20')];}_0x3d4e4d[_0xc681('0x12')](_0x493892)['send'](_0x526a3d);};}exports[_0xc681('0x21')]=function(_0x55997d,_0x50ae52){var _0x178269={};var _0x4dae98=_[_0xc681('0x22')](db[_0xc681('0x23')]['rawAttributes'],function(_0x253604){return{'name':_0x253604[_0xc681('0x24')],'type':_0x253604['type'][_0xc681('0x25')]};});_0x178269=qs['getOptions'](_0x4dae98,_0x55997d);return interaction[_0xc681('0x26')](_0xc681('0x27'),_0x55997d[_0xc681('0x28')],_0x55997d[_0xc681('0x29')],_0x178269,_0x4dae98)['then'](respondWithFilteredResult(_0x50ae52,_0x178269))[_0xc681('0x2a')](handleError(_0x50ae52,null));};exports['show']=function(_0xd0795c,_0x1893b1){var _0x451cf7={'raw':![],'where':{'id':_0xd0795c[_0xc681('0x2b')]['id']}},_0x3b7989={};_0x3b7989[_0xc681('0x2c')]=_[_0xc681('0x2d')](db[_0xc681('0x23')][_0xc681('0x2e')]);_0x3b7989[_0xc681('0x28')]=_[_0xc681('0x2d')](_0xd0795c[_0xc681('0x28')]);_0x3b7989[_0xc681('0x2f')]=_['intersection'](_0x3b7989['model'],_0x3b7989[_0xc681('0x28')]);_0x451cf7[_0xc681('0x30')]=_[_0xc681('0x31')](_0x3b7989[_0xc681('0x2c')],qs[_0xc681('0x32')](_0xd0795c[_0xc681('0x28')]['fields']));_0x451cf7[_0xc681('0x30')]=_0x451cf7[_0xc681('0x30')]['length']?_0x451cf7[_0xc681('0x30')]:_0x3b7989[_0xc681('0x2c')];if(_0xd0795c[_0xc681('0x28')]['includeAll']){_0x451cf7[_0xc681('0x33')]=[{'all':!![]}];}_0x451cf7=_[_0xc681('0x34')]({},_0x451cf7,_0xd0795c['options']);return db['FaxInteraction'][_0xc681('0x35')](_0x451cf7)[_0xc681('0x1c')](handleEntityNotFound(_0x1893b1,null))['then'](respondWithResult(_0x1893b1,null))[_0xc681('0x2a')](handleError(_0x1893b1,null));};exports[_0xc681('0x36')]=function(_0x16f706,_0x51fa8e){return db[_0xc681('0x23')][_0xc681('0x36')](_0x16f706[_0xc681('0x37')],{})[_0xc681('0x1c')](respondWithResult(_0x51fa8e,0xc9))[_0xc681('0x2a')](handleError(_0x51fa8e,null));};exports[_0xc681('0x1b')]=function(_0x1992f5,_0x5ceac5){if(_0x1992f5[_0xc681('0x37')]['id']){delete _0x1992f5[_0xc681('0x37')]['id'];}return db['FaxInteraction'][_0xc681('0x35')]({'where':{'id':_0x1992f5['params']['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x5ceac5,null))[_0xc681('0x1c')](saveUpdates(_0x1992f5[_0xc681('0x37')],null))[_0xc681('0x1c')](respondWithResult(_0x5ceac5,null))['catch'](handleError(_0x5ceac5,null));};exports['destroy']=function(_0x3e7f17,_0x6454f1){return db[_0xc681('0x23')][_0xc681('0x35')]({'where':{'id':_0x3e7f17['params']['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x6454f1,null))[_0xc681('0x1c')](removeEntity(_0x6454f1,null))[_0xc681('0x2a')](handleError(_0x6454f1,null));};exports[_0xc681('0x38')]=function(_0x4a77da,_0x51612a){return db[_0xc681('0x23')][_0xc681('0x38')]()[_0xc681('0x1c')](respondWithResult(_0x51612a,null))[_0xc681('0x2a')](handleError(_0x51612a,null));};exports[_0xc681('0x39')]=function(_0x1cfd7b,_0x34010a){return db[_0xc681('0x3a')][_0xc681('0x35')]({'where':{'id':_0x1cfd7b[_0xc681('0x2b')]['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x34010a,null))[_0xc681('0x1c')](function(_0x5e1b7b){if(_0x5e1b7b){return _0x5e1b7b['addMessage'](_0x1cfd7b[_0xc681('0x37')][_0xc681('0x3b')],_[_0xc681('0x3c')](_0x1cfd7b[_0xc681('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x34010a,null))[_0xc681('0x2a')](handleError(_0x34010a,null));};exports[_0xc681('0x3d')]=function(_0x4fefee,_0x58973c){var _0x52a029={'raw':![],'where':{}};var _0x328b74={};var _0x5aad8e={'count':0x0,'rows':[]};return db[_0xc681('0x23')][_0xc681('0x3e')]({'where':{'id':_0x4fefee[_0xc681('0x2b')]['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x58973c,null))[_0xc681('0x1c')](function(_0x4b08c1){if(_0x4b08c1){_0x328b74[_0xc681('0x2c')]=_[_0xc681('0x2d')](db['FaxMessage'][_0xc681('0x2e')]);_0x328b74['query']=_[_0xc681('0x2d')](_0x4fefee[_0xc681('0x28')]);_0x328b74[_0xc681('0x2f')]=_[_0xc681('0x31')](_0x328b74[_0xc681('0x2c')],_0x328b74[_0xc681('0x28')]);_0x52a029[_0xc681('0x30')]=_[_0xc681('0x31')](_0x328b74[_0xc681('0x2c')],qs['fields'](_0x4fefee[_0xc681('0x28')][_0xc681('0x32')]));_0x52a029[_0xc681('0x30')]=_0x52a029['attributes'][_0xc681('0x3f')]?_0x52a029['attributes']:_0x328b74['model'];if(!_0x4fefee[_0xc681('0x28')][_0xc681('0x40')](_0xc681('0x41'))){_0x52a029[_0xc681('0x16')]=qs['limit'](_0x4fefee['query'][_0xc681('0x16')]);_0x52a029['offset']=qs[_0xc681('0x18')](_0x4fefee['query'][_0xc681('0x18')]);}_0x52a029['order']=qs['sort'](_0x4fefee[_0xc681('0x28')]['sort']);_0x52a029[_0xc681('0x42')]=qs[_0xc681('0x2f')](_[_0xc681('0x43')](_0x4fefee[_0xc681('0x28')],_0x328b74[_0xc681('0x2f')]));_0x52a029['where'][_0xc681('0x44')]=_0x4b08c1['id'];if(_0x4fefee[_0xc681('0x28')]['filter']){_0x52a029[_0xc681('0x42')]=_[_0xc681('0x34')](_0x52a029[_0xc681('0x42')],{'$or':_[_0xc681('0x22')](_0x52a029['attributes'],function(_0x43acaf){var _0x2d61bd={};_0x2d61bd[_0x43acaf]={'$like':'%'+_0x4fefee[_0xc681('0x28')][_0xc681('0x45')]+'%'};return _0x2d61bd;})});}if(_0x4fefee[_0xc681('0x28')][_0xc681('0x46')]){var _0x2cbe20=_0x4fefee[_0xc681('0x28')][_0xc681('0x46')][_0xc681('0x47')](',');var _0x4a3dc6={};_0x4a3dc6[_0x2cbe20[0x0]]={'$gte':moment(_0x2cbe20[0x1])[_0xc681('0x48')](_0xc681('0x49'))};_0x52a029[_0xc681('0x42')]=_[_0xc681('0x34')](_0x52a029[_0xc681('0x42')],_0x4a3dc6);}_0x52a029=_[_0xc681('0x34')]({},_0x52a029,_0x4fefee[_0xc681('0x4a')]);return db[_0xc681('0x3a')][_0xc681('0x17')]({'where':_0x52a029[_0xc681('0x42')]})[_0xc681('0x1c')](function(_0x1aeaef){_0x5aad8e[_0xc681('0x17')]=_0x1aeaef;if(_0x4fefee[_0xc681('0x28')][_0xc681('0x4b')]){_0x52a029['include']=[{'all':!![]}];}return db[_0xc681('0x3a')][_0xc681('0x26')](_0x52a029);})[_0xc681('0x1c')](function(_0x1efb34){_0x5aad8e['rows']=_0x1efb34;return _0x5aad8e;});}})[_0xc681('0x1c')](respondWithFilteredResult(_0x58973c,_0x52a029))[_0xc681('0x2a')](handleError(_0x58973c,null));};exports[_0xc681('0x4c')]=function(_0x324f85,_0x56b6cc){return db['FaxInteraction']['find']({'where':{'id':_0x324f85['params']['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x56b6cc,null))[_0xc681('0x1c')](function(_0x1711e0){if(_0x1711e0){return _0x1711e0[_0xc681('0x4d')](_0x324f85[_0xc681('0x37')][_0xc681('0x3b')],_[_0xc681('0x3c')](_0x324f85[_0xc681('0x37')],[_0xc681('0x3b'),'id'])||{})[_0xc681('0x4e')](function(){return db['Tag'][_0xc681('0x26')]({'attributes':['id',_0xc681('0x20'),_0xc681('0x4f')],'where':{'id':_0x324f85[_0xc681('0x37')]['ids']}});})['then'](function(_0x54ba0e){socket[_0xc681('0x50')]('faxInteractionTags:save',{'id':Number(_0x324f85[_0xc681('0x2b')]['id']),'tags':_0x54ba0e||[]});return{'id':Number(_0x324f85['params']['id']),'tags':_0x54ba0e||[]};});}})[_0xc681('0x1c')](respondWithResult(_0x56b6cc,null))[_0xc681('0x2a')](handleError(_0x56b6cc,null));};exports[_0xc681('0x51')]=function(_0x8985c2,_0x369be8){return db[_0xc681('0x23')][_0xc681('0x35')]({'where':{'id':_0x8985c2[_0xc681('0x2b')]['id']}})[_0xc681('0x1c')](handleEntityNotFound(_0x369be8,null))['then'](function(_0x15026d){if(_0x15026d){return _0x15026d['removeTags'](_0x8985c2[_0xc681('0x28')][_0xc681('0x3b')]);}})['then'](respondWithStatusCode(_0x369be8,null))['catch'](handleError(_0x369be8,null));};exports['download']=function(_0x133bd5,_0x4f7636){var _0x22568c=moment()[_0xc681('0x52')]()[_0xc681('0x53')]();var _0x1a3afc=path['join'](config[_0xc681('0x54')],_0xc681('0x55'),'files',_0xc681('0x56'));var _0x5694ed=path[_0xc681('0x57')](config[_0xc681('0x54')],_0xc681('0x55'),'files',_0xc681('0x58'));var _0x496599=path['join'](_0x1a3afc,_0x22568c);var _0x156b93=util['format'](_0xc681('0x59'),_0x133bd5[_0xc681('0x2b')]['id'],_0x22568c);var _0xdcf4a4=path[_0xc681('0x57')](_0x1a3afc,_0x156b93);var _0x4dd951=[];_0x4dd951[_0xc681('0x5a')]({'model':db[_0xc681('0x5b')],'as':_0xc681('0x5b'),'raw':!![]});var _0x1d203d=[{'model':db[_0xc681('0x3a')],'as':_0xc681('0x5c'),'attributes':['id',_0xc681('0x37'),'createdAt'],'include':_0x4dd951}];return db[_0xc681('0x23')]['find']({'where':{'id':_0x133bd5[_0xc681('0x2b')]['id']},'include':_0x1d203d})['then'](handleEntityNotFound(_0x4f7636,null))[_0xc681('0x1c')](function(_0x3e7140){if(_0x3e7140&&_0x3e7140[_0xc681('0x5c')]){var _0x1c4bc6=_0x3e7140[_0xc681('0x5d')]({'plain':!![]});fs[_0xc681('0x5e')](_0x496599);for(var _0x2c0a82=0x0;_0x2c0a82<_0x1c4bc6['Messages'][_0xc681('0x3f')];_0x2c0a82++){var _0x53b17a=_0x1c4bc6[_0xc681('0x5c')][_0x2c0a82][_0xc681('0x5b')];if(_0x53b17a){var _0x2df677=path[_0xc681('0x57')](_0x5694ed,_0x53b17a[_0xc681('0x5f')]);if(fs[_0xc681('0x60')](_0x2df677)){fs['createReadStream'](_0x2df677)['pipe'](fs[_0xc681('0x61')](path[_0xc681('0x57')](_0x496599,_0x53b17a[_0xc681('0x5f')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x4baa1a,_0x580c82){zipdir(_0x496599,{'saveTo':_0xdcf4a4},function(_0x3fcc65,_0x550415){if(_0x3fcc65)return _0x580c82(_0x3fcc65);return _0x4baa1a(_0x550415);});})[_0xc681('0x1c')](function(){return new BPromise(function(_0x8dc12,_0x318fb1){rimraf(_0x496599,function(_0x454c70){if(_0x454c70)_0x318fb1(_0x454c70);return _0x8dc12();});});})[_0xc681('0x1c')](function(){return _0x4f7636['download'](_0xdcf4a4,_0x156b93,function(_0x2516ec){if(_0x2516ec){console['log'](_0xc681('0x62'),_0x2516ec);}else{fs['unlinkSync'](_0xdcf4a4);}});});});}else{return _0x4f7636[_0xc681('0x11')](0xc8);}})[_0xc681('0x2a')](handleError(_0x4f7636,null));}; \ No newline at end of file +var _0xd428=['mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','status','end','json','offset','limit','undefined','count','set','update','then','destroy','sendStatus','error','name','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','model','keys','filters','intersection','fields','attributes','include','merge','options','create','body','find','params','describe','addMessage','FaxMessage','ids','omit','getMessages','length','order','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','download','unix','server','files','tmp','join','root','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get'];(function(_0x1a76b8,_0x4aebad){var _0x9de13f=function(_0x1acad0){while(--_0x1acad0){_0x1a76b8['push'](_0x1a76b8['shift']());}};_0x9de13f(++_0x4aebad);}(_0xd428,0x6c));var _0x8d42=function(_0x335647,_0x13f7a0){_0x335647=_0x335647-0x0;var _0x5dbf94=_0xd428[_0x335647];return _0x5dbf94;};'use strict';var rimraf=require(_0x8d42('0x0'));var zipdir=require(_0x8d42('0x1'));var moment=require('moment');var BPromise=require(_0x8d42('0x2'));var util=require(_0x8d42('0x3'));var path=require(_0x8d42('0x4'));var fs=require('fs');var _=require(_0x8d42('0x5'));var Redis=require(_0x8d42('0x6'));var interaction=require(_0x8d42('0x7'));var qs=require(_0x8d42('0x8'));var logger=require(_0x8d42('0x9'))('api');var config=require('../../config/environment');var db=require(_0x8d42('0xa'))['db'];config[_0x8d42('0xb')]=_['defaults'](config[_0x8d42('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d42('0xc'))(new Redis(config[_0x8d42('0xb')]));require(_0x8d42('0xd'))['register'](socket);function respondWithStatusCode(_0x3945ea,_0x7b1350){_0x7b1350=_0x7b1350||0xcc;return function(_0x5b30aa){if(_0x5b30aa){return _0x3945ea['sendStatus'](_0x7b1350);}return _0x3945ea[_0x8d42('0xe')](_0x7b1350)[_0x8d42('0xf')]();};}function respondWithResult(_0x1d6bc0,_0x3f6342){_0x3f6342=_0x3f6342||0xc8;return function(_0x8f81ce){if(_0x8f81ce){return _0x1d6bc0['status'](_0x3f6342)[_0x8d42('0x10')](_0x8f81ce);}};}function respondWithFilteredResult(_0x5d978b,_0x551dc1){return function(_0x37a153){if(_0x37a153){var _0x318adb=typeof _0x551dc1[_0x8d42('0x11')]==='undefined'&&typeof _0x551dc1[_0x8d42('0x12')]===_0x8d42('0x13');var _0x2d4653=_0x37a153['count'];var _0x17d6b7=_0x318adb?0x0:_0x551dc1[_0x8d42('0x11')];var _0x2bd177=_0x318adb?_0x37a153[_0x8d42('0x14')]:_0x551dc1['offset']+_0x551dc1['limit'];var _0x3d929d;if(_0x2bd177>=_0x2d4653){_0x2bd177=_0x2d4653;_0x3d929d=0xc8;}else{_0x3d929d=0xce;}_0x5d978b[_0x8d42('0xe')](_0x3d929d);return _0x5d978b[_0x8d42('0x15')]('Content-Range',_0x17d6b7+'-'+_0x2bd177+'/'+_0x2d4653)[_0x8d42('0x10')](_0x37a153);}return null;};}function saveUpdates(_0x4e5d25){return function(_0x1ce3e9){if(_0x1ce3e9){return _0x1ce3e9[_0x8d42('0x16')](_0x4e5d25)[_0x8d42('0x17')](function(_0x5b19ad){return _0x5b19ad;});}return null;};}function removeEntity(_0xe65359){return function(_0x5667b1){if(_0x5667b1){return _0x5667b1[_0x8d42('0x18')]()[_0x8d42('0x17')](function(){_0xe65359['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14a5bf){return function(_0x14c512){if(!_0x14c512){_0x14a5bf[_0x8d42('0x19')](0x194);}return _0x14c512;};}function handleError(_0x273d52,_0x4f2d37){_0x4f2d37=_0x4f2d37||0x1f4;return function(_0x463295){logger[_0x8d42('0x1a')](_0x463295['stack']);if(_0x463295[_0x8d42('0x1b')]){delete _0x463295[_0x8d42('0x1b')];}_0x273d52[_0x8d42('0xe')](_0x4f2d37)['send'](_0x463295);};}exports[_0x8d42('0x1c')]=function(_0x59fd63,_0x37e2c6){var _0x4b9a83={};var _0x87b8b5=_[_0x8d42('0x1d')](db[_0x8d42('0x1e')][_0x8d42('0x1f')],function(_0x6a1c41){return{'name':_0x6a1c41[_0x8d42('0x20')],'type':_0x6a1c41[_0x8d42('0x21')][_0x8d42('0x22')]};});_0x4b9a83=qs[_0x8d42('0x23')](_0x87b8b5,_0x59fd63);return interaction[_0x8d42('0x24')](_0x8d42('0x25'),_0x59fd63[_0x8d42('0x26')],_0x59fd63[_0x8d42('0x27')],_0x4b9a83,_0x87b8b5)[_0x8d42('0x17')](respondWithFilteredResult(_0x37e2c6,_0x4b9a83))[_0x8d42('0x28')](handleError(_0x37e2c6,null));};exports['show']=function(_0x2584db,_0x1d5219){var _0x3e3c63={'raw':![],'where':{'id':_0x2584db['params']['id']}},_0x47cadc={};_0x47cadc[_0x8d42('0x29')]=_[_0x8d42('0x2a')](db[_0x8d42('0x1e')][_0x8d42('0x1f')]);_0x47cadc[_0x8d42('0x26')]=_['keys'](_0x2584db[_0x8d42('0x26')]);_0x47cadc[_0x8d42('0x2b')]=_[_0x8d42('0x2c')](_0x47cadc[_0x8d42('0x29')],_0x47cadc[_0x8d42('0x26')]);_0x3e3c63['attributes']=_[_0x8d42('0x2c')](_0x47cadc[_0x8d42('0x29')],qs[_0x8d42('0x2d')](_0x2584db[_0x8d42('0x26')][_0x8d42('0x2d')]));_0x3e3c63['attributes']=_0x3e3c63[_0x8d42('0x2e')]['length']?_0x3e3c63[_0x8d42('0x2e')]:_0x47cadc[_0x8d42('0x29')];if(_0x2584db['query']['includeAll']){_0x3e3c63[_0x8d42('0x2f')]=[{'all':!![]}];}_0x3e3c63=_[_0x8d42('0x30')]({},_0x3e3c63,_0x2584db[_0x8d42('0x31')]);return db[_0x8d42('0x1e')]['find'](_0x3e3c63)[_0x8d42('0x17')](handleEntityNotFound(_0x1d5219,null))[_0x8d42('0x17')](respondWithResult(_0x1d5219,null))[_0x8d42('0x28')](handleError(_0x1d5219,null));};exports[_0x8d42('0x32')]=function(_0x149444,_0x34c204){return db[_0x8d42('0x1e')]['create'](_0x149444['body'],{})[_0x8d42('0x17')](respondWithResult(_0x34c204,0xc9))[_0x8d42('0x28')](handleError(_0x34c204,null));};exports['update']=function(_0x18272b,_0x5a389c){if(_0x18272b[_0x8d42('0x33')]['id']){delete _0x18272b[_0x8d42('0x33')]['id'];}return db['FaxInteraction'][_0x8d42('0x34')]({'where':{'id':_0x18272b[_0x8d42('0x35')]['id']}})[_0x8d42('0x17')](handleEntityNotFound(_0x5a389c,null))[_0x8d42('0x17')](saveUpdates(_0x18272b['body'],null))[_0x8d42('0x17')](respondWithResult(_0x5a389c,null))[_0x8d42('0x28')](handleError(_0x5a389c,null));};exports[_0x8d42('0x18')]=function(_0x414bd7,_0x47123b){return db['FaxInteraction'][_0x8d42('0x34')]({'where':{'id':_0x414bd7[_0x8d42('0x35')]['id']}})['then'](handleEntityNotFound(_0x47123b,null))[_0x8d42('0x17')](removeEntity(_0x47123b,null))['catch'](handleError(_0x47123b,null));};exports[_0x8d42('0x36')]=function(_0x289649,_0x196ac8){return db['FaxInteraction'][_0x8d42('0x36')]()[_0x8d42('0x17')](respondWithResult(_0x196ac8,null))[_0x8d42('0x28')](handleError(_0x196ac8,null));};exports[_0x8d42('0x37')]=function(_0xdb7400,_0x528033){return db[_0x8d42('0x38')][_0x8d42('0x34')]({'where':{'id':_0xdb7400['params']['id']}})['then'](handleEntityNotFound(_0x528033,null))['then'](function(_0x4be4eb){if(_0x4be4eb){return _0x4be4eb[_0x8d42('0x37')](_0xdb7400[_0x8d42('0x33')][_0x8d42('0x39')],_[_0x8d42('0x3a')](_0xdb7400[_0x8d42('0x33')],[_0x8d42('0x39'),'id'])||{});}})[_0x8d42('0x17')](respondWithResult(_0x528033,null))['catch'](handleError(_0x528033,null));};exports[_0x8d42('0x3b')]=function(_0x391c47,_0xc17c2f){var _0x1b1841={'raw':![],'where':{}};var _0x20cfa1={};var _0x227a1e={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x391c47[_0x8d42('0x35')]['id']}})[_0x8d42('0x17')](handleEntityNotFound(_0xc17c2f,null))[_0x8d42('0x17')](function(_0x8f26f0){if(_0x8f26f0){_0x20cfa1[_0x8d42('0x29')]=_[_0x8d42('0x2a')](db[_0x8d42('0x38')][_0x8d42('0x1f')]);_0x20cfa1['query']=_[_0x8d42('0x2a')](_0x391c47[_0x8d42('0x26')]);_0x20cfa1[_0x8d42('0x2b')]=_[_0x8d42('0x2c')](_0x20cfa1[_0x8d42('0x29')],_0x20cfa1[_0x8d42('0x26')]);_0x1b1841[_0x8d42('0x2e')]=_['intersection'](_0x20cfa1[_0x8d42('0x29')],qs[_0x8d42('0x2d')](_0x391c47[_0x8d42('0x26')][_0x8d42('0x2d')]));_0x1b1841[_0x8d42('0x2e')]=_0x1b1841['attributes'][_0x8d42('0x3c')]?_0x1b1841[_0x8d42('0x2e')]:_0x20cfa1[_0x8d42('0x29')];if(!_0x391c47[_0x8d42('0x26')]['hasOwnProperty']('nolimit')){_0x1b1841[_0x8d42('0x12')]=qs['limit'](_0x391c47[_0x8d42('0x26')][_0x8d42('0x12')]);_0x1b1841[_0x8d42('0x11')]=qs['offset'](_0x391c47['query'][_0x8d42('0x11')]);}_0x1b1841[_0x8d42('0x3d')]=qs['sort'](_0x391c47['query']['sort']);_0x1b1841[_0x8d42('0x3e')]=qs[_0x8d42('0x2b')](_['pick'](_0x391c47['query'],_0x20cfa1[_0x8d42('0x2b')]));_0x1b1841[_0x8d42('0x3e')][_0x8d42('0x3f')]=_0x8f26f0['id'];if(_0x391c47[_0x8d42('0x26')][_0x8d42('0x40')]){_0x1b1841[_0x8d42('0x3e')]=_['merge'](_0x1b1841['where'],{'$or':_[_0x8d42('0x1d')](_0x1b1841['attributes'],function(_0x5b8b45){var _0x5680c4={};_0x5680c4[_0x5b8b45]={'$like':'%'+_0x391c47[_0x8d42('0x26')][_0x8d42('0x40')]+'%'};return _0x5680c4;})});}if(_0x391c47[_0x8d42('0x26')][_0x8d42('0x41')]){var _0x5bc1ef=_0x391c47[_0x8d42('0x26')]['$gte'][_0x8d42('0x42')](',');var _0x594a94={};_0x594a94[_0x5bc1ef[0x0]]={'$gte':moment(_0x5bc1ef[0x1])[_0x8d42('0x43')](_0x8d42('0x44'))};_0x1b1841[_0x8d42('0x3e')]=_[_0x8d42('0x30')](_0x1b1841[_0x8d42('0x3e')],_0x594a94);}_0x1b1841=_[_0x8d42('0x30')]({},_0x1b1841,_0x391c47['options']);return db['FaxMessage'][_0x8d42('0x14')]({'where':_0x1b1841[_0x8d42('0x3e')]})[_0x8d42('0x17')](function(_0xc78705){_0x227a1e[_0x8d42('0x14')]=_0xc78705;if(_0x391c47[_0x8d42('0x26')][_0x8d42('0x45')]){_0x1b1841['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1b1841);})[_0x8d42('0x17')](function(_0x12e1ef){_0x227a1e[_0x8d42('0x46')]=_0x12e1ef;return _0x227a1e;});}})[_0x8d42('0x17')](respondWithFilteredResult(_0xc17c2f,_0x1b1841))[_0x8d42('0x28')](handleError(_0xc17c2f,null));};exports[_0x8d42('0x47')]=function(_0x184678,_0x5673a3){return db[_0x8d42('0x1e')][_0x8d42('0x34')]({'where':{'id':_0x184678['params']['id']}})[_0x8d42('0x17')](handleEntityNotFound(_0x5673a3,null))['then'](function(_0x22dbbc){if(_0x22dbbc){return _0x22dbbc[_0x8d42('0x48')](_0x184678[_0x8d42('0x33')]['ids'],_['omit'](_0x184678[_0x8d42('0x33')],['ids','id'])||{})[_0x8d42('0x49')](function(){return db[_0x8d42('0x4a')][_0x8d42('0x24')]({'attributes':['id','name',_0x8d42('0x4b')],'where':{'id':_0x184678[_0x8d42('0x33')][_0x8d42('0x39')]}});})['then'](function(_0x4c1572){socket[_0x8d42('0x4c')](_0x8d42('0x4d'),{'id':Number(_0x184678[_0x8d42('0x35')]['id']),'tags':_0x4c1572||[]});return{'id':Number(_0x184678[_0x8d42('0x35')]['id']),'tags':_0x4c1572||[]};});}})[_0x8d42('0x17')](respondWithResult(_0x5673a3,null))[_0x8d42('0x28')](handleError(_0x5673a3,null));};exports['removeTags']=function(_0x508e7b,_0x45da61){return db[_0x8d42('0x1e')][_0x8d42('0x34')]({'where':{'id':_0x508e7b[_0x8d42('0x35')]['id']}})[_0x8d42('0x17')](handleEntityNotFound(_0x45da61,null))[_0x8d42('0x17')](function(_0x2c77e0){if(_0x2c77e0){return _0x2c77e0['removeTags'](_0x508e7b['query'][_0x8d42('0x39')]);}})[_0x8d42('0x17')](respondWithStatusCode(_0x45da61,null))['catch'](handleError(_0x45da61,null));};exports[_0x8d42('0x4e')]=function(_0x4602e5,_0x5574d4){var _0x3d8ef3=moment()[_0x8d42('0x4f')]()['toString']();var _0x37b921=path['join'](config['root'],_0x8d42('0x50'),_0x8d42('0x51'),_0x8d42('0x52'));var _0x379a2b=path[_0x8d42('0x53')](config[_0x8d42('0x54')],_0x8d42('0x50'),_0x8d42('0x51'),_0x8d42('0x55'));var _0x40a267=path[_0x8d42('0x53')](_0x37b921,_0x3d8ef3);var _0x3d2a50=util[_0x8d42('0x43')](_0x8d42('0x56'),_0x4602e5[_0x8d42('0x35')]['id'],_0x3d8ef3);var _0x15b40a=path[_0x8d42('0x53')](_0x37b921,_0x3d2a50);var _0x45601f=[];_0x45601f[_0x8d42('0x57')]({'model':db[_0x8d42('0x58')],'as':'Attachment','raw':!![]});var _0x14130c=[{'model':db['FaxMessage'],'as':_0x8d42('0x59'),'attributes':['id',_0x8d42('0x33'),_0x8d42('0x5a')],'include':_0x45601f}];return db[_0x8d42('0x1e')]['find']({'where':{'id':_0x4602e5[_0x8d42('0x35')]['id']},'include':_0x14130c})[_0x8d42('0x17')](handleEntityNotFound(_0x5574d4,null))[_0x8d42('0x17')](function(_0x16a6bc){if(_0x16a6bc&&_0x16a6bc[_0x8d42('0x59')]){var _0x16fa18=_0x16a6bc[_0x8d42('0x5b')]({'plain':!![]});fs[_0x8d42('0x5c')](_0x40a267);for(var _0x4f8afe=0x0;_0x4f8afe<_0x16fa18[_0x8d42('0x59')][_0x8d42('0x3c')];_0x4f8afe++){var _0x382372=_0x16fa18[_0x8d42('0x59')][_0x4f8afe][_0x8d42('0x58')];if(_0x382372){var _0x4191e4=path[_0x8d42('0x53')](_0x379a2b,_0x382372['basename']);if(fs[_0x8d42('0x5d')](_0x4191e4)){fs[_0x8d42('0x5e')](_0x4191e4)[_0x8d42('0x5f')](fs[_0x8d42('0x60')](path['join'](_0x40a267,_0x382372[_0x8d42('0x61')])));}}}return BPromise['resolve']()[_0x8d42('0x17')](function(){return new BPromise(function(_0x3f4da0,_0xaa7607){zipdir(_0x40a267,{'saveTo':_0x15b40a},function(_0x31bc9,_0x4ff7c5){if(_0x31bc9)return _0xaa7607(_0x31bc9);return _0x3f4da0(_0x4ff7c5);});})[_0x8d42('0x17')](function(){return new BPromise(function(_0x2082e1,_0x13b0d1){rimraf(_0x40a267,function(_0x4796b8){if(_0x4796b8)_0x13b0d1(_0x4796b8);return _0x2082e1();});});})[_0x8d42('0x17')](function(){return _0x5574d4[_0x8d42('0x4e')](_0x15b40a,_0x3d2a50,function(_0x31b542){if(_0x31b542){console['log'](_0x8d42('0x62'),_0x31b542);}else{fs[_0x8d42('0x63')](_0x15b40a);}});});});}else{return _0x5574d4['sendStatus'](0xc8);}})[_0x8d42('0x28')](handleError(_0x5574d4,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1f99974..f2315d6 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 _0x4663=['catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','then','setDataValue','map','unreadMessages','length','emit'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x4663,0xe4));var _0x3466=function(_0x340638,_0x3ab432){_0x340638=_0x340638-0x0;var _0x5b4e39=_0x4663[_0x340638];return _0x5b4e39;};'use strict';var EventEmitter=require(_0x3466('0x0'));var FaxInteraction=require(_0x3466('0x1'))['db'][_0x3466('0x2')];var FaxMessage=require(_0x3466('0x1'))['db'][_0x3466('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3466('0x4')](0x0);var events={'afterCreate':_0x3466('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5136a4){return function(_0x136b47,_0x4b4b11,_0x108445){_0x136b47['getUsers']({'attributes':['id'],'raw':!![]})[_0x3466('0x6')](function(_0x1675e3){_0x136b47[_0x3466('0x7')]('Users',_0x1675e3[_0x3466('0x8')](function(_0xd4d306){return{'id':_0xd4d306['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x136b47['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3466('0x6')](function(_0xf01c55){_0x136b47[_0x3466('0x7')](_0x3466('0x9'),_0xf01c55[_0x3466('0xa')]);FaxInteractionEvents[_0x3466('0xb')](_0x5136a4+':'+_0x136b47['id'],_0x136b47);FaxInteractionEvents[_0x3466('0xb')](_0x5136a4,_0x136b47);_0x108445(null);})[_0x3466('0xc')](_0x108445(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3466('0xd')](e,emitEvent(event));}}module[_0x3466('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0xe110=['map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','then','setDataValue','Users'];(function(_0x4340e4,_0x6be7c9){var _0x3640e6=function(_0x3091bd){while(--_0x3091bd){_0x4340e4['push'](_0x4340e4['shift']());}};_0x3640e6(++_0x6be7c9);}(_0xe110,0x1c2));var _0x0e11=function(_0x595bae,_0x52f914){_0x595bae=_0x595bae-0x0;var _0x21b4f3=_0xe110[_0x595bae];return _0x21b4f3;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x0e11('0x0'))['db'][_0x0e11('0x1')];var FaxMessage=require(_0x0e11('0x0'))['db'][_0x0e11('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e11('0x3'),'afterUpdate':_0x0e11('0x4'),'afterDestroy':_0x0e11('0x5')};function emitEvent(_0x423bdc){return function(_0x649771,_0x5aab21,_0xd474f9){_0x649771['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e11('0x6')](function(_0x23b298){_0x649771[_0x0e11('0x7')](_0x0e11('0x8'),_0x23b298[_0x0e11('0x9')](function(_0xcaac30){return{'id':_0xcaac30['id']};}));return FaxMessage[_0x0e11('0xa')]({'where':{'FaxInteractionId':_0x649771['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e11('0x6')](function(_0x4aefa8){_0x649771[_0x0e11('0x7')](_0x0e11('0xb'),_0x4aefa8[_0x0e11('0xc')]);FaxInteractionEvents[_0x0e11('0xd')](_0x423bdc+':'+_0x649771['id'],_0x649771);FaxInteractionEvents[_0x0e11('0xd')](_0x423bdc,_0x649771);_0xd474f9(null);})['catch'](_0xd474f9(null));};}for(var e in events){if(events[_0x0e11('0xe')](e)){var event=events[e];FaxInteraction[_0x0e11('0xf')](e,emitEvent(event));}}module[_0x0e11('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a5b643c..46f23db 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 _0x6b21=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x73a3f0,_0x2cf8bd){var _0x3a2785=function(_0x4ccca2){while(--_0x4ccca2){_0x73a3f0['push'](_0x73a3f0['shift']());}};_0x3a2785(++_0x2cf8bd);}(_0x6b21,0x75));var _0x16b2=function(_0x22bcbd,_0x3c3399){_0x22bcbd=_0x22bcbd-0x0;var _0xed9e6f=_0x6b21[_0x22bcbd];return _0xed9e6f;};'use strict';var _=require(_0x16b2('0x0'));var util=require(_0x16b2('0x1'));var logger=require(_0x16b2('0x2'))(_0x16b2('0x3'));var moment=require('moment');var BPromise=require(_0x16b2('0x4'));var rp=require(_0x16b2('0x5'));var fs=require('fs');var path=require(_0x16b2('0x6'));var rimraf=require('rimraf');var config=require(_0x16b2('0x7'));var attributes=require(_0x16b2('0x8'));module[_0x16b2('0x9')]=function(_0x560d96,_0x5ac94b){return _0x560d96['define'](_0x16b2('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x403d5b,_0x500eaf,_0x4b4a72){if(_0x403d5b[_0x16b2('0xb')](_0x16b2('0xc'))){_0x403d5b[_0x16b2('0xd')]=moment()[_0x16b2('0xe')](_0x16b2('0xf'));}_0x4b4a72(null,_0x403d5b);}}});}; \ No newline at end of file +var _0x55c1=['rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path'];(function(_0x481bcd,_0x4e96d4){var _0x491491=function(_0x5b42b3){while(--_0x5b42b3){_0x481bcd['push'](_0x481bcd['shift']());}};_0x491491(++_0x4e96d4);}(_0x55c1,0x1e5));var _0x155c=function(_0x4a30b3,_0x3ddbdb){_0x4a30b3=_0x4a30b3-0x0;var _0x161079=_0x55c1[_0x4a30b3];return _0x161079;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x155c('0x2'));var rp=require(_0x155c('0x3'));var fs=require('fs');var path=require(_0x155c('0x4'));var rimraf=require(_0x155c('0x5'));var config=require(_0x155c('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x155c('0x7')]=function(_0x55a3ae,_0x1b30c6){return _0x55a3ae['define'](_0x155c('0x8'),attributes,{'tableName':_0x155c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22ed0d,_0x5f4274,_0x5ee4c7){if(_0x22ed0d['changed'](_0x155c('0xa'))){_0x22ed0d[_0x155c('0xb')]=moment()[_0x155c('0xc')](_0x155c('0xd'));}_0x5ee4c7(null,_0x22ed0d);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 1a6a5ff..bd82fb5 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 _0xe0c9=['catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','stringify','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction'];(function(_0x9496fd,_0x2d4539){var _0x28d8d6=function(_0x14539a){while(--_0x14539a){_0x9496fd['push'](_0x9496fd['shift']());}};_0x28d8d6(++_0x2d4539);}(_0xe0c9,0x105));var _0x9e0c=function(_0x58892d,_0x538a4c){_0x58892d=_0x58892d-0x0;var _0x52cc69=_0xe0c9[_0x58892d];return _0x52cc69;};'use strict';var _=require('lodash');var util=require(_0x9e0c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e0c('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e0c('0x2'));var logger=require(_0x9e0c('0x3'))(_0x9e0c('0x4'));var config=require(_0x9e0c('0x5'));var jayson=require(_0x9e0c('0x6'));var client=jayson[_0x9e0c('0x7')]['http']({'port':0x232a});config[_0x9e0c('0x8')]=_[_0x9e0c('0x9')](config[_0x9e0c('0x8')],{'host':_0x9e0c('0xa'),'port':0x18eb});var socket=require(_0x9e0c('0xb'))(new Redis(config[_0x9e0c('0x8')]));require(_0x9e0c('0xc'))[_0x9e0c('0xd')](socket);function respondWithRpcPromise(_0x391f79,_0x1606b4,_0x4c2e15){return new BPromise(function(_0xd0259d,_0x22537d){return client[_0x9e0c('0xe')](_0x391f79,_0x4c2e15)[_0x9e0c('0xf')](function(_0x19ef55){logger[_0x9e0c('0x10')](_0x9e0c('0x11'),_0x1606b4,_0x9e0c('0x12'));logger[_0x9e0c('0x13')](_0x9e0c('0x14'),_0x1606b4,_0x9e0c('0x12'),JSON['stringify'](_0x19ef55));if(_0x19ef55[_0x9e0c('0x15')]){if(_0x19ef55[_0x9e0c('0x15')]['code']===0x1f4){logger[_0x9e0c('0x15')](_0x9e0c('0x11'),_0x1606b4,_0x19ef55[_0x9e0c('0x15')][_0x9e0c('0x16')]);return _0x22537d(_0x19ef55[_0x9e0c('0x15')][_0x9e0c('0x16')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1606b4,_0x19ef55[_0x9e0c('0x15')][_0x9e0c('0x16')]);return _0xd0259d(_0x19ef55[_0x9e0c('0x15')]['message']);}else{logger[_0x9e0c('0x10')](_0x9e0c('0x11'),_0x1606b4,_0x9e0c('0x12'));_0xd0259d(_0x19ef55[_0x9e0c('0x17')][_0x9e0c('0x16')]);}})['catch'](function(_0x1bb8a2){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x1606b4,_0x1bb8a2);_0x22537d(_0x1bb8a2);});});}exports['UpdateFaxInteraction']=function(_0x571f16){var _0x20a2f7=this;return new Promise(function(_0x5624a5,_0x40a0a){return db[_0x9e0c('0x18')][_0x9e0c('0x19')](_0x571f16[_0x9e0c('0x1a')],{'raw':_0x571f16[_0x9e0c('0x1b')]?_0x571f16['options'][_0x9e0c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x571f16[_0x9e0c('0x1b')]?_0x571f16['options'][_0x9e0c('0x1d')]||null:null,'attributes':_0x571f16[_0x9e0c('0x1b')]?_0x571f16[_0x9e0c('0x1b')][_0x9e0c('0x1e')]||null:null,'limit':_0x571f16[_0x9e0c('0x1b')]?_0x571f16[_0x9e0c('0x1b')][_0x9e0c('0x1f')]||null:null})[_0x9e0c('0xf')](function(_0x10a8ba){logger['info']('UpdateFaxInteraction',_0x571f16);logger[_0x9e0c('0x13')](_0x9e0c('0x20'),_0x571f16,JSON['stringify'](_0x10a8ba));_0x5624a5(_0x10a8ba);})[_0x9e0c('0x21')](function(_0x3a79cf){logger[_0x9e0c('0x15')](_0x9e0c('0x20'),_0x3a79cf[_0x9e0c('0x16')],_0x571f16);_0x40a0a(_0x20a2f7[_0x9e0c('0x15')](0x1f4,_0x3a79cf[_0x9e0c('0x16')]));});});};exports[_0x9e0c('0x22')]=function(_0x5499a4){return new Promise(function(_0xedd14c,_0x28998c){return db[_0x9e0c('0x18')][_0x9e0c('0x23')]({'where':_0x5499a4['options']?_0x5499a4[_0x9e0c('0x1b')][_0x9e0c('0x1d')]||null:null})[_0x9e0c('0xf')](function(_0x57ef5b){if(_0x57ef5b){return _0x57ef5b[_0x9e0c('0x24')](_0x5499a4[_0x9e0c('0x1a')][_0x9e0c('0x25')],_[_0x9e0c('0x26')](_0x5499a4['body'],['ids','id'])||{});}})[_0x9e0c('0x27')](function(_0x28f9b5){logger[_0x9e0c('0x10')](_0x9e0c('0x28'),_0x5499a4);logger['debug'](_0x9e0c('0x28'),_0x5499a4,JSON[_0x9e0c('0x29')](_0x28f9b5));_0xedd14c(_0x28f9b5);})['catch'](function(_0x42f658){logger[_0x9e0c('0x15')]('AddTags',_0x42f658[_0x9e0c('0x16')],_0x5499a4);_0x28998c(_this[_0x9e0c('0x15')](0x1f4,_0x42f658[_0x9e0c('0x16')]));});});}; \ No newline at end of file +var _0xc7c2=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x4aac5a,_0x15b04c){var _0x42e7bc=function(_0x1da766){while(--_0x1da766){_0x4aac5a['push'](_0x4aac5a['shift']());}};_0x42e7bc(++_0x15b04c);}(_0xc7c2,0x121));var _0x2c7c=function(_0x147ceb,_0x26e073){_0x147ceb=_0x147ceb-0x0;var _0x32a839=_0xc7c2[_0x147ceb];return _0x32a839;};'use strict';var _=require(_0x2c7c('0x0'));var util=require(_0x2c7c('0x1'));var moment=require('moment');var BPromise=require(_0x2c7c('0x2'));var rs=require(_0x2c7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c7c('0x4'))['db'];var utils=require(_0x2c7c('0x5'));var logger=require('../../config/logger')(_0x2c7c('0x6'));var config=require(_0x2c7c('0x7'));var jayson=require(_0x2c7c('0x8'));var client=jayson[_0x2c7c('0x9')][_0x2c7c('0xa')]({'port':0x232a});config[_0x2c7c('0xb')]=_[_0x2c7c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c7c('0xb')]));require(_0x2c7c('0xd'))[_0x2c7c('0xe')](socket);function respondWithRpcPromise(_0x12e7c2,_0x2cab0a,_0x4e599e){return new BPromise(function(_0x31942f,_0x126614){return client[_0x2c7c('0xf')](_0x12e7c2,_0x4e599e)[_0x2c7c('0x10')](function(_0x183c3d){logger[_0x2c7c('0x11')](_0x2c7c('0x12'),_0x2cab0a,'request\x20sent');logger[_0x2c7c('0x13')](_0x2c7c('0x14'),_0x2cab0a,'request\x20sent',JSON[_0x2c7c('0x15')](_0x183c3d));if(_0x183c3d['error']){if(_0x183c3d[_0x2c7c('0x16')][_0x2c7c('0x17')]===0x1f4){logger[_0x2c7c('0x16')](_0x2c7c('0x12'),_0x2cab0a,_0x183c3d[_0x2c7c('0x16')][_0x2c7c('0x18')]);return _0x126614(_0x183c3d[_0x2c7c('0x16')]['message']);}logger[_0x2c7c('0x16')](_0x2c7c('0x12'),_0x2cab0a,_0x183c3d[_0x2c7c('0x16')][_0x2c7c('0x18')]);return _0x31942f(_0x183c3d[_0x2c7c('0x16')][_0x2c7c('0x18')]);}else{logger[_0x2c7c('0x11')](_0x2c7c('0x12'),_0x2cab0a,'request\x20sent');_0x31942f(_0x183c3d[_0x2c7c('0x19')][_0x2c7c('0x18')]);}})[_0x2c7c('0x1a')](function(_0x2e09aa){logger[_0x2c7c('0x16')](_0x2c7c('0x12'),_0x2cab0a,_0x2e09aa);_0x126614(_0x2e09aa);});});}exports[_0x2c7c('0x1b')]=function(_0xc51d3d){var _0xe4c6f5=this;return new Promise(function(_0x56252b,_0x54b589){return db[_0x2c7c('0x1c')][_0x2c7c('0x1d')](_0xc51d3d[_0x2c7c('0x1e')],{'raw':_0xc51d3d['options']?_0xc51d3d[_0x2c7c('0x1f')][_0x2c7c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc51d3d[_0x2c7c('0x1f')]?_0xc51d3d[_0x2c7c('0x1f')][_0x2c7c('0x21')]||null:null,'attributes':_0xc51d3d['options']?_0xc51d3d['options'][_0x2c7c('0x22')]||null:null,'limit':_0xc51d3d[_0x2c7c('0x1f')]?_0xc51d3d[_0x2c7c('0x1f')][_0x2c7c('0x23')]||null:null})[_0x2c7c('0x10')](function(_0x255be8){logger[_0x2c7c('0x11')](_0x2c7c('0x1b'),_0xc51d3d);logger['debug'](_0x2c7c('0x1b'),_0xc51d3d,JSON[_0x2c7c('0x15')](_0x255be8));_0x56252b(_0x255be8);})[_0x2c7c('0x1a')](function(_0x5873bd){logger[_0x2c7c('0x16')]('UpdateFaxInteraction',_0x5873bd[_0x2c7c('0x18')],_0xc51d3d);_0x54b589(_0xe4c6f5['error'](0x1f4,_0x5873bd['message']));});});};exports[_0x2c7c('0x24')]=function(_0x277f7d){return new Promise(function(_0x595eab,_0x3e3e0c){return db[_0x2c7c('0x1c')][_0x2c7c('0x25')]({'where':_0x277f7d[_0x2c7c('0x1f')]?_0x277f7d[_0x2c7c('0x1f')][_0x2c7c('0x21')]||null:null})[_0x2c7c('0x10')](function(_0xa93e76){if(_0xa93e76){return _0xa93e76['addTags'](_0x277f7d[_0x2c7c('0x1e')]['ids'],_[_0x2c7c('0x26')](_0x277f7d['body'],[_0x2c7c('0x27'),'id'])||{});}})[_0x2c7c('0x28')](function(_0x52b926){logger[_0x2c7c('0x11')](_0x2c7c('0x29'),_0x277f7d);logger['debug']('AddTags',_0x277f7d,JSON[_0x2c7c('0x15')](_0x52b926));_0x595eab(_0x52b926);})[_0x2c7c('0x1a')](function(_0x3f853e){logger[_0x2c7c('0x16')](_0x2c7c('0x29'),_0x3f853e[_0x2c7c('0x18')],_0x277f7d);_0x3e3e0c(_this[_0x2c7c('0x16')](0x1f4,_0x3f853e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 827b551..20b4bf0 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 _0x94a3=['register','length','./faxInteraction.events','update','emit','removeListener'];(function(_0x21595a,_0x155422){var _0x32d3ed=function(_0x1ee3df){while(--_0x1ee3df){_0x21595a['push'](_0x21595a['shift']());}};_0x32d3ed(++_0x155422);}(_0x94a3,0x92));var _0x394a=function(_0x2a0bf8,_0xb184c9){_0x2a0bf8=_0x2a0bf8-0x0;var _0x1556f4=_0x94a3[_0x2a0bf8];return _0x1556f4;};'use strict';var FaxInteractionEvents=require(_0x394a('0x0'));var events=['save','remove',_0x394a('0x1')];function createListener(_0x3d4984,_0x2db38b){return function(_0x3d1cf3){_0x2db38b[_0x394a('0x2')](_0x3d4984,_0x3d1cf3);};}function removeListener(_0x4b57c2,_0x27344a){return function(){FaxInteractionEvents[_0x394a('0x3')](_0x4b57c2,_0x27344a);};}exports[_0x394a('0x4')]=function(_0x5b898d){for(var _0x566ca5=0x0,_0xfa32f7=events[_0x394a('0x5')];_0x566ca5<_0xfa32f7;_0x566ca5++){var _0x42be01=events[_0x566ca5];var _0x281285=createListener('faxInteraction:'+_0x42be01,_0x5b898d);FaxInteractionEvents['on'](_0x42be01,_0x281285);}}; \ No newline at end of file +var _0x7b10=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x4c85c0,_0x225a67){var _0x59e164=function(_0x3583a0){while(--_0x3583a0){_0x4c85c0['push'](_0x4c85c0['shift']());}};_0x59e164(++_0x225a67);}(_0x7b10,0x65));var _0x07b1=function(_0x3a8ec7,_0x54d882){_0x3a8ec7=_0x3a8ec7-0x0;var _0x4ed690=_0x7b10[_0x3a8ec7];return _0x4ed690;};'use strict';var FaxInteractionEvents=require(_0x07b1('0x0'));var events=[_0x07b1('0x1'),_0x07b1('0x2'),_0x07b1('0x3')];function createListener(_0x107aa3,_0x3af919){return function(_0x1456e0){_0x3af919['emit'](_0x107aa3,_0x1456e0);};}function removeListener(_0x23f2f3,_0x42ddee){return function(){FaxInteractionEvents[_0x07b1('0x4')](_0x23f2f3,_0x42ddee);};}exports[_0x07b1('0x5')]=function(_0xd71b10){for(var _0x3e988b=0x0,_0x1a0f1b=events[_0x07b1('0x6')];_0x3e988b<_0x1a0f1b;_0x3e988b++){var _0x55bfbd=events[_0x3e988b];var _0x23427d=createListener(_0x07b1('0x7')+_0x55bfbd,_0xd71b10);FaxInteractionEvents['on'](_0x55bfbd,_0x23427d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 189ffb6..d48fdec 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 _0x7096=['index','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','fax','faxinteraction:addtags','put','tracked','update','faxinteraction:destroy','delete','removeTags','exports','multer','util','path','express','Router','../../config/environment','./faxInteraction.controller','get','isAuthenticated'];(function(_0x5e08e2,_0x4929a7){var _0x13db9f=function(_0x2ee068){while(--_0x2ee068){_0x5e08e2['push'](_0x5e08e2['shift']());}};_0x13db9f(++_0x4929a7);}(_0x7096,0x1c7));var _0x6709=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7096[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x6709('0x0'));var util=require(_0x6709('0x1'));var path=require(_0x6709('0x2'));var timeout=require('connect-timeout');var express=require(_0x6709('0x3'));var router=express[_0x6709('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6709('0x5'));var controller=require(_0x6709('0x6'));router[_0x6709('0x7')]('/',auth[_0x6709('0x8')](),controller[_0x6709('0x9')]);router[_0x6709('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6709('0xa')]);router[_0x6709('0x7')](_0x6709('0xb'),auth[_0x6709('0x8')](),controller[_0x6709('0xc')]);router['get']('/:id/messages',auth[_0x6709('0x8')](),controller[_0x6709('0xd')]);router['get'](_0x6709('0xe'),auth[_0x6709('0x8')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/',auth['isAuthenticated'](),controller[_0x6709('0x11')]);router[_0x6709('0x10')](_0x6709('0x12'),auth[_0x6709('0x8')](),controller['addMessage']);router[_0x6709('0x10')](_0x6709('0x13'),auth[_0x6709('0x8')](),interaction['tracked'](_0x6709('0x14'),_0x6709('0x15')),controller['addTags']);router[_0x6709('0x16')](_0x6709('0xb'),auth[_0x6709('0x8')](),interaction[_0x6709('0x17')](_0x6709('0x14'),'faxinteraction:update'),controller[_0x6709('0x18')]);router['delete'](_0x6709('0xb'),auth[_0x6709('0x8')](),interaction[_0x6709('0x17')](_0x6709('0x14'),_0x6709('0x19')),controller['destroy']);router[_0x6709('0x1a')](_0x6709('0x13'),auth[_0x6709('0x8')](),controller[_0x6709('0x1b')]);module[_0x6709('0x1c')]=router; \ No newline at end of file +var _0x21bb=['update','delete','faxinteraction:destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x21bb,0x131));var _0xb21b=function(_0x100f77,_0x1c6be6){_0x100f77=_0x100f77-0x0;var _0x370725=_0x21bb[_0x100f77];return _0x370725;};'use strict';var multer=require('multer');var util=require(_0xb21b('0x0'));var path=require(_0xb21b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb21b('0x2'));var router=express[_0xb21b('0x3')]();var fs_extra=require(_0xb21b('0x4'));var auth=require(_0xb21b('0x5'));var interaction=require(_0xb21b('0x6'));var config=require(_0xb21b('0x7'));var controller=require(_0xb21b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb21b('0x9')](_0xb21b('0xa'),auth[_0xb21b('0xb')](),controller[_0xb21b('0xc')]);router[_0xb21b('0x9')](_0xb21b('0xd'),auth[_0xb21b('0xb')](),controller[_0xb21b('0xe')]);router[_0xb21b('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xb21b('0x9')]('/:id/download',auth[_0xb21b('0xb')](),controller['download']);router[_0xb21b('0xf')]('/',auth[_0xb21b('0xb')](),controller[_0xb21b('0x10')]);router[_0xb21b('0xf')]('/:id/messages',auth[_0xb21b('0xb')](),controller[_0xb21b('0x11')]);router[_0xb21b('0xf')](_0xb21b('0x12'),auth['isAuthenticated'](),interaction[_0xb21b('0x13')](_0xb21b('0x14'),_0xb21b('0x15')),controller[_0xb21b('0x16')]);router[_0xb21b('0x17')](_0xb21b('0xd'),auth[_0xb21b('0xb')](),interaction[_0xb21b('0x13')](_0xb21b('0x14'),_0xb21b('0x18')),controller[_0xb21b('0x19')]);router[_0xb21b('0x1a')]('/:id',auth[_0xb21b('0xb')](),interaction[_0xb21b('0x13')](_0xb21b('0x14'),_0xb21b('0x1b')),controller['destroy']);router['delete'](_0xb21b('0x12'),auth[_0xb21b('0xb')](),controller[_0xb21b('0x1c')]);module[_0xb21b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0de5721..6d9d2cb 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 _0xcea2=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT'];(function(_0xf4b742,_0x1b62d6){var _0x53cba1=function(_0xc28d1b){while(--_0xc28d1b){_0xf4b742['push'](_0xf4b742['shift']());}};_0x53cba1(++_0x1b62d6);}(_0xcea2,0x15a));var _0x2cea=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xcea2[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x2cea('0x0'));module['exports']={'body':{'type':Sequelize[_0x2cea('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2cea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2cea('0x3')]('in',_0x2cea('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2cea('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2cea('0x5')]}}; \ No newline at end of file +var _0xca66=['DATE','sequelize','medium','BOOLEAN','ENUM','out'];(function(_0x68a63e,_0x2f087d){var _0xc23718=function(_0x14f41a){while(--_0x14f41a){_0x68a63e['push'](_0x68a63e['shift']());}};_0xc23718(++_0x2f087d);}(_0xca66,0x8b));var _0x6ca6=function(_0xf9ccb,_0x312a15){_0xf9ccb=_0xf9ccb-0x0;var _0x2e2d4b=_0xca66[_0xf9ccb];return _0x2e2d4b;};'use strict';var Sequelize=require(_0x6ca6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6ca6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6ca6('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6ca6('0x3')]('in','out'),'defaultValue':_0x6ca6('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6ca6('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index f312f7c..6b22f1b 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 _0x0558=['channel','motionChannel','event','accept','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','User','internal','interface','SIP/%s','create','findOne','fax','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./faxMessage.socket','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','show','keys','find','update','body','destroy','params','describe','fax-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0x0558,0x1c4));var _0x8055=function(_0x536068,_0x3de52c){_0x536068=_0x536068-0x0;var _0x4a5db2=_0x0558[_0x536068];return _0x4a5db2;};'use strict';var emlformat=require(_0x8055('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8055('0x1'));var jsonpatch=require(_0x8055('0x2'));var rp=require('request-promise');var moment=require(_0x8055('0x3'));var BPromise=require(_0x8055('0x4'));var Mustache=require(_0x8055('0x5'));var util=require(_0x8055('0x6'));var path=require(_0x8055('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8055('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8055('0x9'));var squel=require(_0x8055('0xa'));var crypto=require(_0x8055('0xb'));var jsforce=require(_0x8055('0xc'));var deskjs=require(_0x8055('0xd'));var toCsv=require(_0x8055('0xe'));var querystring=require('querystring');var Papa=require(_0x8055('0xf'));var Redis=require(_0x8055('0x10'));var authService=require(_0x8055('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8055('0x12'));var hardwareService=require(_0x8055('0x13'));var logger=require(_0x8055('0x14'))(_0x8055('0x15'));var utils=require(_0x8055('0x16'));var config=require(_0x8055('0x17'));var licenseUtil=require(_0x8055('0x18'));var db=require('../../mysqldb')['db'];config[_0x8055('0x19')]=_['defaults'](config[_0x8055('0x19')],{'host':_0x8055('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8055('0x19')]));require(_0x8055('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8055('0x1c')][_0x8055('0x1d')]({'port':0x232c});var client9002=jayson[_0x8055('0x1c')][_0x8055('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1cefc4,_0x492271,_0x1392f0,_0x1475c4){return new BPromise(function(_0x3e3072,_0x475d35){var _0x42c8bd=_0x1475c4||client;return _0x42c8bd[_0x8055('0x1e')](_0x1cefc4,_0x1392f0)[_0x8055('0x1f')](function(_0x788ae0){logger['info'](_0x8055('0x20'),_0x492271,_0x8055('0x21'));logger[_0x8055('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x492271,_0x8055('0x21'),JSON[_0x8055('0x23')](_0x788ae0));if(_0x788ae0['error']){if(_0x788ae0[_0x8055('0x24')][_0x8055('0x25')]===0x1f4){logger[_0x8055('0x24')]('FaxMessage,\x20%s,\x20%s',_0x492271,_0x788ae0[_0x8055('0x24')][_0x8055('0x26')]);return _0x475d35(_0x788ae0[_0x8055('0x24')][_0x8055('0x26')]);}logger['error'](_0x8055('0x20'),_0x492271,_0x788ae0[_0x8055('0x24')][_0x8055('0x26')]);return _0x3e3072(_0x788ae0['error'][_0x8055('0x26')]);}else{logger[_0x8055('0x27')](_0x8055('0x20'),_0x492271,_0x8055('0x21'));_0x3e3072(_0x788ae0[_0x8055('0x28')][_0x8055('0x26')]);}})[_0x8055('0x29')](function(_0x41f09d){logger[_0x8055('0x24')]('FaxMessage,\x20%s,\x20%s',_0x492271,_0x41f09d);_0x475d35(_0x41f09d);});});}function respondWithStatusCode(_0x112096,_0x17fb98){_0x17fb98=_0x17fb98||0xcc;return function(_0x12db51){if(_0x12db51){return _0x112096[_0x8055('0x2a')](_0x17fb98);}return _0x112096[_0x8055('0x2b')](_0x17fb98)[_0x8055('0x2c')]();};}function respondWithResult(_0x4e1abc,_0x2bdfab){_0x2bdfab=_0x2bdfab||0xc8;return function(_0x2f502c){if(_0x2f502c){return _0x4e1abc[_0x8055('0x2b')](_0x2bdfab)[_0x8055('0x2d')](_0x2f502c);}};}function respondWithFilteredResult(_0x53ccaf,_0x377de5){return function(_0x376f69){if(_0x376f69){var _0x58306c=typeof _0x377de5['offset']===_0x8055('0x2e')&&typeof _0x377de5[_0x8055('0x2f')]==='undefined';var _0x126ea1=_0x376f69[_0x8055('0x30')];var _0x46b871=_0x58306c?0x0:_0x377de5[_0x8055('0x31')];var _0x5176b7=_0x58306c?_0x376f69[_0x8055('0x30')]:_0x377de5[_0x8055('0x31')]+_0x377de5[_0x8055('0x2f')];var _0x319b32;if(_0x5176b7>=_0x126ea1){_0x5176b7=_0x126ea1;_0x319b32=0xc8;}else{_0x319b32=0xce;}_0x53ccaf[_0x8055('0x2b')](_0x319b32);return _0x53ccaf['set']('Content-Range',_0x46b871+'-'+_0x5176b7+'/'+_0x126ea1)[_0x8055('0x2d')](_0x376f69);}return null;};}function patchUpdates(_0x18fda0){return function(_0x21c347){try{jsonpatch[_0x8055('0x32')](_0x21c347,_0x18fda0,!![]);}catch(_0x4bc092){return BPromise[_0x8055('0x33')](_0x4bc092);}return _0x21c347[_0x8055('0x34')]();};}function saveUpdates(_0x2a4295,_0x484464){return function(_0x330ac4){if(_0x330ac4){return _0x330ac4['update'](_0x2a4295)[_0x8055('0x1f')](function(_0x5697e2){return _0x5697e2;});}return null;};}function removeEntity(_0x4b48f0,_0xb744fd){return function(_0x266cf8){if(_0x266cf8){return _0x266cf8['destroy']()['then'](function(){_0x4b48f0[_0x8055('0x2b')](0xcc)[_0x8055('0x2c')]();});}};}function handleEntityNotFound(_0x2920b7,_0x42f589){return function(_0x3ec7e8){if(!_0x3ec7e8){_0x2920b7['sendStatus'](0x194);}return _0x3ec7e8;};}function handleError(_0x197ab0,_0xa11ee8){_0xa11ee8=_0xa11ee8||0x1f4;return function(_0x25090b){logger['error'](_0x25090b['stack']);if(_0x25090b[_0x8055('0x35')]){delete _0x25090b[_0x8055('0x35')];}_0x197ab0['status'](_0xa11ee8)['send'](_0x25090b);};}exports[_0x8055('0x36')]=function(_0x3b0bb0,_0x4edda9){var _0x20a697={},_0x5a32c6={},_0x5bbd29={'count':0x0,'rows':[]};var _0x265629=_[_0x8055('0x37')](db[_0x8055('0x38')][_0x8055('0x39')],function(_0x222796){return{'name':_0x222796[_0x8055('0x3a')],'type':_0x222796['type'][_0x8055('0x3b')]};});_0x5a32c6[_0x8055('0x3c')]=_[_0x8055('0x37')](_0x265629,_0x8055('0x35'));_0x5a32c6[_0x8055('0x3d')]=_['keys'](_0x3b0bb0[_0x8055('0x3d')]);_0x5a32c6[_0x8055('0x3e')]=_[_0x8055('0x3f')](_0x5a32c6['model'],_0x5a32c6[_0x8055('0x3d')]);_0x20a697['attributes']=_['intersection'](_0x5a32c6['model'],qs[_0x8055('0x40')](_0x3b0bb0[_0x8055('0x3d')][_0x8055('0x40')]));_0x20a697['attributes']=_0x20a697[_0x8055('0x41')][_0x8055('0x42')]?_0x20a697[_0x8055('0x41')]:_0x5a32c6[_0x8055('0x3c')];if(!_0x3b0bb0['query'][_0x8055('0x43')](_0x8055('0x44'))){_0x20a697[_0x8055('0x2f')]=qs[_0x8055('0x2f')](_0x3b0bb0[_0x8055('0x3d')]['limit']);_0x20a697['offset']=qs[_0x8055('0x31')](_0x3b0bb0[_0x8055('0x3d')][_0x8055('0x31')]);}_0x20a697['order']=qs[_0x8055('0x45')](_0x3b0bb0['query'][_0x8055('0x45')]);_0x20a697[_0x8055('0x46')]=qs['filters'](_[_0x8055('0x47')](_0x3b0bb0[_0x8055('0x3d')],_0x5a32c6['filters']),_0x265629);if(_0x3b0bb0[_0x8055('0x3d')][_0x8055('0x48')]){_0x20a697['where']=_['merge'](_0x20a697['where'],{'$or':_[_0x8055('0x37')](_0x265629,function(_0x59e243){if(_0x59e243[_0x8055('0x49')]!==_0x8055('0x4a')){var _0x3b5c19={};_0x3b5c19[_0x59e243[_0x8055('0x35')]]={'$like':'%'+_0x3b0bb0['query']['filter']+'%'};return _0x3b5c19;}})});}_0x20a697=_[_0x8055('0x4b')]({},_0x20a697,_0x3b0bb0[_0x8055('0x4c')]);var _0x515895={'where':_0x20a697[_0x8055('0x46')]};return db['FaxMessage']['count'](_0x515895)[_0x8055('0x1f')](function(_0x380510){_0x5bbd29[_0x8055('0x30')]=_0x380510;if(_0x3b0bb0[_0x8055('0x3d')][_0x8055('0x4d')]){_0x20a697[_0x8055('0x4e')]=[{'all':!![]}];}return db[_0x8055('0x38')]['findAll'](_0x20a697);})[_0x8055('0x1f')](function(_0x53001b){_0x5bbd29[_0x8055('0x4f')]=_0x53001b;return _0x5bbd29;})[_0x8055('0x1f')](respondWithFilteredResult(_0x4edda9,_0x20a697))['catch'](handleError(_0x4edda9,null));};exports[_0x8055('0x50')]=function(_0x565a9c,_0x462a34){var _0x52d2e8={'raw':!![],'where':{'id':_0x565a9c['params']['id']}},_0x5cb3d2={};_0x5cb3d2[_0x8055('0x3c')]=_[_0x8055('0x51')](db[_0x8055('0x38')][_0x8055('0x39')]);_0x5cb3d2[_0x8055('0x3d')]=_[_0x8055('0x51')](_0x565a9c[_0x8055('0x3d')]);_0x5cb3d2[_0x8055('0x3e')]=_['intersection'](_0x5cb3d2['model'],_0x5cb3d2[_0x8055('0x3d')]);_0x52d2e8[_0x8055('0x41')]=_[_0x8055('0x3f')](_0x5cb3d2[_0x8055('0x3c')],qs[_0x8055('0x40')](_0x565a9c['query']['fields']));_0x52d2e8[_0x8055('0x41')]=_0x52d2e8['attributes']['length']?_0x52d2e8[_0x8055('0x41')]:_0x5cb3d2['model'];if(_0x565a9c[_0x8055('0x3d')][_0x8055('0x4d')]){_0x52d2e8[_0x8055('0x4e')]=[{'all':!![]}];}_0x52d2e8=_['merge']({},_0x52d2e8,_0x565a9c[_0x8055('0x4c')]);return db['FaxMessage'][_0x8055('0x52')](_0x52d2e8)['then'](handleEntityNotFound(_0x462a34,null))[_0x8055('0x1f')](respondWithResult(_0x462a34,null))[_0x8055('0x29')](handleError(_0x462a34,null));};exports[_0x8055('0x53')]=function(_0x180185,_0xf8c148){if(_0x180185[_0x8055('0x54')]['id']){delete _0x180185[_0x8055('0x54')]['id'];}return db['FaxMessage'][_0x8055('0x52')]({'where':{'id':_0x180185['params']['id']}})[_0x8055('0x1f')](handleEntityNotFound(_0xf8c148,null))[_0x8055('0x1f')](saveUpdates(_0x180185[_0x8055('0x54')],null))[_0x8055('0x1f')](respondWithResult(_0xf8c148,null))[_0x8055('0x29')](handleError(_0xf8c148,null));};exports[_0x8055('0x55')]=function(_0x46133b,_0x219c21){return db[_0x8055('0x38')][_0x8055('0x52')]({'where':{'id':_0x46133b[_0x8055('0x56')]['id']}})[_0x8055('0x1f')](handleEntityNotFound(_0x219c21,null))[_0x8055('0x1f')](removeEntity(_0x219c21,null))['catch'](handleError(_0x219c21,null));};exports[_0x8055('0x57')]=function(_0x56778a,_0x52f8bf){return db[_0x8055('0x38')][_0x8055('0x57')]()[_0x8055('0x1f')](respondWithResult(_0x52f8bf,null))[_0x8055('0x29')](handleError(_0x52f8bf,null));};var interaction_log=require(_0x8055('0x14'))(_0x8055('0x58'));exports['accept']=function(_0x3d43a1,_0x2c68f5,_0x439b5d){var _0x3e5dec={'agent':{},'channel':'fax'};if(_0x3d43a1['body']['id']){delete _0x3d43a1[_0x8055('0x54')]['id'];}_0x3d43a1[_0x8055('0x54')][_0x8055('0x59')]=!![];_0x3d43a1[_0x8055('0x54')]['readAt']=moment()['format'](_0x8055('0x5a'));_0x3d43a1[_0x8055('0x54')][_0x8055('0x5b')]=_0x3d43a1[_0x8055('0x54')][_0x8055('0x5b')]||_0x3d43a1[_0x8055('0x5c')]['id'];_0x3e5dec[_0x8055('0x5d')]['id']=_0x3d43a1[_0x8055('0x54')]['UserId'];return db[_0x8055('0x38')]['find']({'where':{'id':_0x3d43a1[_0x8055('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c68f5,null))['then'](saveUpdates(_0x3d43a1[_0x8055('0x54')],null))[_0x8055('0x1f')](function(_0x48998e){if(_0x48998e){_0x3e5dec['message']=_0x48998e[_0x8055('0x5e')]({'plain':!![]});return db[_0x8055('0x5f')]['find']({'where':{'id':_0x48998e[_0x8055('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x2c68f5,null))[_0x8055('0x1f')](function(_0x2636b7){if(_0x2636b7){return _0x2636b7[_0x8055('0x53')]({'UserId':_0x3d43a1[_0x8055('0x54')][_0x8055('0x5b')],'read1stAt':_[_0x8055('0x61')](_0x2636b7[_0x8055('0x62')])?moment()[_0x8055('0x63')](_0x8055('0x5a')):undefined});}return null;})[_0x8055('0x1f')](function(_0x1adaf2){if(_0x1adaf2){_0x3e5dec[_0x8055('0x64')]=_0x1adaf2[_0x8055('0x5e')]({'plain':!![]});interaction_log[_0x8055('0x27')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d43a1['user']['id'],_0x3d43a1[_0x8055('0x5c')]['name'],_0x3d43a1[_0x8055('0x5c')][_0x8055('0x65')],_0x3e5dec['interaction']['id'],_0x3d43a1[_0x8055('0x54')]?JSON[_0x8055('0x23')](_0x3d43a1[_0x8055('0x54')]):_0x8055('0x66'));return respondWithRpcPromise('AcceptMessage',_0x8055('0x67'),_0x3e5dec);}return null;})[_0x8055('0x1f')](function(_0x12fc2b){var _0x15b616=_0x8055('0x68')+_0x12fc2b['message']['ContactId'];return db['sequelize']['query'](_0x15b616,{'type':db[_0x8055('0x69')][_0x8055('0x6a')][_0x8055('0x6b')],'raw':!![]})[_0x8055('0x1f')](function(_0x3f67dc){return _0x3f67dc;});})[_0x8055('0x1f')](function(_0x5220fc){if(_0x5220fc){_0x3e5dec[_0x8055('0x26')][_0x8055('0x6c')]=_0x5220fc[0x0];if(!_0x3d43a1[_0x8055('0x54')]['UserId'])return;return db['User']['find']({'where':{'id':_0x3d43a1[_0x8055('0x54')][_0x8055('0x5b')],'role':_0x8055('0x5d')},'attributes':['id',_0x8055('0x35'),_0x8055('0x6d'),_0x8055('0x6e'),'internal'],'raw':!![]});}return null;})[_0x8055('0x1f')](function(_0x525bc7){if(!_0x525bc7)return null;_0x3e5dec[_0x8055('0x26')][_0x8055('0x5d')]=_0x525bc7;return _0x3e5dec;})[_0x8055('0x1f')](function(_0x381e68){if(_0x381e68){if(_0x3d43a1[_0x8055('0x54')][_0x8055('0x6f')]){_0x3e5dec[_0x8055('0x26')]['interface']=util[_0x8055('0x63')]('SIP/%s',_0x3d43a1[_0x8055('0x5c')][_0x8055('0x35')]);_0x3e5dec[_0x8055('0x26')]['channel']=_0x3e5dec[_0x8055('0x70')];_0x3e5dec['message'][_0x8055('0x71')]=_0x3e5dec[_0x8055('0x70')];_0x3e5dec[_0x8055('0x26')][_0x8055('0x72')]=_0x8055('0x73');return respondWithRpcPromise(_0x8055('0x74'),_0x8055('0x74'),{'event':'acceptmessage','message':_0x3e5dec['message']},client9002)[_0x8055('0x1f')](function(){return _0x3e5dec;});}return _0x3e5dec;}return null;})[_0x8055('0x1f')](respondWithResult(_0x2c68f5,null))[_0x8055('0x29')](handleError(_0x2c68f5,null));};var interaction_log=require(_0x8055('0x14'))(_0x8055('0x58'));exports[_0x8055('0x33')]=function(_0x531d4a,_0x40f03f,_0x33797f){var _0x1a749e={'agent':{},'channel':'fax'};if(_0x531d4a[_0x8055('0x54')]['id']){delete _0x531d4a[_0x8055('0x54')]['id'];}_0x531d4a[_0x8055('0x54')][_0x8055('0x5b')]=_0x531d4a['body'][_0x8055('0x5b')]||_0x531d4a[_0x8055('0x5c')]['id'];_0x1a749e[_0x8055('0x5d')]['id']=_0x531d4a[_0x8055('0x54')][_0x8055('0x5b')];return db['FaxMessage'][_0x8055('0x52')]({'where':{'id':_0x531d4a[_0x8055('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x40f03f,null))[_0x8055('0x1f')](function(_0x95b0c1){if(_0x95b0c1){_0x1a749e[_0x8055('0x26')]=_0x95b0c1[_0x8055('0x5e')]({'plain':!![]});return db[_0x8055('0x5f')][_0x8055('0x52')]({'where':{'id':_0x95b0c1[_0x8055('0x60')]}});}return null;})[_0x8055('0x1f')](handleEntityNotFound(_0x40f03f,null))['then'](function(_0x561bf7){if(_0x561bf7){_0x1a749e['interaction']=_0x561bf7[_0x8055('0x5e')]({'plain':!![]});interaction_log['info'](_0x8055('0x75'),_0x531d4a[_0x8055('0x5c')]['id'],_0x531d4a['user'][_0x8055('0x35')],_0x531d4a[_0x8055('0x5c')][_0x8055('0x65')],_0x1a749e['interaction']['id'],_0x531d4a[_0x8055('0x54')]?JSON[_0x8055('0x23')](_0x531d4a['body']):_0x8055('0x66'));return respondWithRpcPromise(_0x8055('0x76'),_0x8055('0x77'),_0x1a749e);}return null;})[_0x8055('0x1f')](function(_0x5b9791){var _0x60f196='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b9791[_0x8055('0x26')][_0x8055('0x78')];return db[_0x8055('0x79')][_0x8055('0x3d')](_0x60f196,{'type':db[_0x8055('0x69')][_0x8055('0x6a')][_0x8055('0x6b')],'raw':!![]})[_0x8055('0x1f')](function(_0x82d81a){return _0x82d81a;});})[_0x8055('0x1f')](function(_0x2f1df8){if(_0x2f1df8){_0x1a749e[_0x8055('0x26')][_0x8055('0x6c')]=_0x2f1df8[0x0];if(!_0x531d4a['body'][_0x8055('0x5b')])return;return db[_0x8055('0x7a')][_0x8055('0x52')]({'where':{'id':_0x531d4a['body'][_0x8055('0x5b')],'role':_0x8055('0x5d')},'attributes':['id',_0x8055('0x35'),_0x8055('0x6d'),_0x8055('0x6e'),_0x8055('0x7b')],'raw':!![]});}return null;})['then'](function(_0x5676e6){if(!_0x5676e6)return null;_0x1a749e['message'][_0x8055('0x5d')]=_0x5676e6;return _0x1a749e;})[_0x8055('0x1f')](function(_0x45df20){if(_0x45df20){_0x45df20[_0x8055('0x26')][_0x8055('0x7c')]=util[_0x8055('0x63')](_0x8055('0x7d'),_0x531d4a[_0x8055('0x5c')][_0x8055('0x35')]);_0x45df20[_0x8055('0x26')][_0x8055('0x70')]=_0x1a749e[_0x8055('0x70')];_0x45df20[_0x8055('0x26')][_0x8055('0x71')]=_0x1a749e[_0x8055('0x70')];_0x45df20[_0x8055('0x26')][_0x8055('0x72')]=_0x8055('0x33');respondWithRpcPromise(_0x8055('0x74'),_0x8055('0x74'),{'event':'rejectmessage','message':_0x45df20[_0x8055('0x26')]},client9002);return _0x1a749e;}return null;})[_0x8055('0x1f')](respondWithResult(_0x40f03f,null))[_0x8055('0x29')](handleError(_0x40f03f,null));};exports[_0x8055('0x7e')]=function(_0x1f3973,_0x4a020b){var _0xd68df9;return db['FaxMessage']['create'](_0x1f3973['body'],{})['then'](function(_0x1c7263){_0xd68df9=_0x1c7263;return db['CmContact'][_0x8055('0x7f')]({'where':{'id':_0xd68df9[_0x8055('0x78')]}});})[_0x8055('0x1f')](function(_0x47f2cc){if(_[_0x8055('0x61')](_0x47f2cc)){return;}else{_0xd68df9['fax']=_0x47f2cc[_0x8055('0x80')];return db[_0x8055('0x81')][_0x8055('0x7f')]({'where':{'id':_0xd68df9[_0x8055('0x82')]}});}})['then'](function(_0x54ef0b){return respondWithRpcPromise(_0x8055('0x83'),'SendFax',{'FaxAccountId':_['isNil'](_0x1f3973[_0x8055('0x54')])?undefined:_0x1f3973[_0x8055('0x54')][_0x8055('0x84')],'path':_['isNil'](_0x54ef0b)?undefined:util[_0x8055('0x63')](_0x8055('0x85'),_0x54ef0b[_0x8055('0x86')]),'fax':_[_0x8055('0x61')](_0xd68df9[_0x8055('0x80')])?undefined:_0xd68df9[_0x8055('0x80')],'AttachmentId':_0xd68df9['AttachmentId']},client9002);})[_0x8055('0x1f')](respondWithResult(_0x4a020b,0xc9))[_0x8055('0x29')](handleError(_0x4a020b,null));};exports[_0x8055('0x87')]=function(_0x3e0932,_0xca35a1){var _0x3b2c97=path[_0x8055('0x88')](config[_0x8055('0x89')],_0x8055('0x8a'),_0x8055('0x8b'),_0x8055('0x8c'));return db[_0x8055('0x38')][_0x8055('0x52')]({'where':{'id':_0x3e0932[_0x8055('0x56')]['id']},'include':[{'model':db[_0x8055('0x81')],'as':'Attachment'}]})[_0x8055('0x1f')](handleEntityNotFound(_0xca35a1,null))['then'](function(_0x666255){if(_0x666255){return _0xca35a1[_0x8055('0x87')](path[_0x8055('0x88')](_0x3b2c97,_0x666255[_0x8055('0x81')][_0x8055('0x86')]));}})[_0x8055('0x29')](handleError(_0xca35a1,null));}; \ No newline at end of file +var _0xd677=['SELECT','contact','User','agent','fullname','email','internal','interface','channel','accept','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','SIP/%s','event','EventManager','create','CmContact','findOne','Attachment','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','destroy','end','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','rows','fields','options','find','update','body','params','describe','../../config/logger','fax-interactions','fax','read','readAt','format','UserId','get','FaxInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes'];(function(_0x1c06c0,_0x1f9731){var _0x5857c0=function(_0xc8e0c7){while(--_0xc8e0c7){_0x1c06c0['push'](_0x1c06c0['shift']());}};_0x5857c0(++_0x1f9731);}(_0xd677,0x1cd));var _0x7d67=function(_0x5c3cfd,_0x491545){_0x5c3cfd=_0x5c3cfd-0x0;var _0x3488f1=_0xd677[_0x5c3cfd];return _0x3488f1;};'use strict';var emlformat=require(_0x7d67('0x0'));var rimraf=require(_0x7d67('0x1'));var zipdir=require(_0x7d67('0x2'));var jsonpatch=require(_0x7d67('0x3'));var rp=require(_0x7d67('0x4'));var moment=require(_0x7d67('0x5'));var BPromise=require(_0x7d67('0x6'));var Mustache=require(_0x7d67('0x7'));var util=require(_0x7d67('0x8'));var path=require(_0x7d67('0x9'));var sox=require(_0x7d67('0xa'));var csv=require(_0x7d67('0xb'));var ejs=require(_0x7d67('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d67('0xd'));var jsforce=require(_0x7d67('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d67('0xf'));var Papa=require(_0x7d67('0x10'));var Redis=require('ioredis');var authService=require(_0x7d67('0x11'));var qs=require(_0x7d67('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d67('0x13'));var logger=require('../../config/logger')(_0x7d67('0x14'));var utils=require(_0x7d67('0x15'));var config=require(_0x7d67('0x16'));var licenseUtil=require(_0x7d67('0x17'));var db=require(_0x7d67('0x18'))['db'];config['redis']=_['defaults'](config[_0x7d67('0x19')],{'host':_0x7d67('0x1a'),'port':0x18eb});var socket=require(_0x7d67('0x1b'))(new Redis(config[_0x7d67('0x19')]));require(_0x7d67('0x1c'))[_0x7d67('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7d67('0x1e')][_0x7d67('0x1f')]({'port':0x232c});var client9002=jayson[_0x7d67('0x1e')][_0x7d67('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3625ac,_0x1de9fa,_0x229471,_0x1550ec){return new BPromise(function(_0x12161a,_0x10316c){var _0x46b71f=_0x1550ec||client;return _0x46b71f[_0x7d67('0x20')](_0x3625ac,_0x229471)[_0x7d67('0x21')](function(_0x4f1895){logger[_0x7d67('0x22')](_0x7d67('0x23'),_0x1de9fa,_0x7d67('0x24'));logger['debug'](_0x7d67('0x25'),_0x1de9fa,_0x7d67('0x24'),JSON[_0x7d67('0x26')](_0x4f1895));if(_0x4f1895[_0x7d67('0x27')]){if(_0x4f1895[_0x7d67('0x27')][_0x7d67('0x28')]===0x1f4){logger['error'](_0x7d67('0x23'),_0x1de9fa,_0x4f1895[_0x7d67('0x27')][_0x7d67('0x29')]);return _0x10316c(_0x4f1895[_0x7d67('0x27')][_0x7d67('0x29')]);}logger[_0x7d67('0x27')](_0x7d67('0x23'),_0x1de9fa,_0x4f1895[_0x7d67('0x27')][_0x7d67('0x29')]);return _0x12161a(_0x4f1895[_0x7d67('0x27')][_0x7d67('0x29')]);}else{logger[_0x7d67('0x22')](_0x7d67('0x23'),_0x1de9fa,_0x7d67('0x24'));_0x12161a(_0x4f1895[_0x7d67('0x2a')][_0x7d67('0x29')]);}})[_0x7d67('0x2b')](function(_0x535e30){logger[_0x7d67('0x27')]('FaxMessage,\x20%s,\x20%s',_0x1de9fa,_0x535e30);_0x10316c(_0x535e30);});});}function respondWithStatusCode(_0x5dc363,_0x7b30c3){_0x7b30c3=_0x7b30c3||0xcc;return function(_0x2e5332){if(_0x2e5332){return _0x5dc363[_0x7d67('0x2c')](_0x7b30c3);}return _0x5dc363['status'](_0x7b30c3)['end']();};}function respondWithResult(_0x2d1fbf,_0x1219ff){_0x1219ff=_0x1219ff||0xc8;return function(_0x496693){if(_0x496693){return _0x2d1fbf['status'](_0x1219ff)[_0x7d67('0x2d')](_0x496693);}};}function respondWithFilteredResult(_0x2c1869,_0x2bd762){return function(_0x161a73){if(_0x161a73){var _0x794c28=typeof _0x2bd762[_0x7d67('0x2e')]===_0x7d67('0x2f')&&typeof _0x2bd762[_0x7d67('0x30')]===_0x7d67('0x2f');var _0x334db3=_0x161a73[_0x7d67('0x31')];var _0x1e5159=_0x794c28?0x0:_0x2bd762[_0x7d67('0x2e')];var _0x75e946=_0x794c28?_0x161a73[_0x7d67('0x31')]:_0x2bd762[_0x7d67('0x2e')]+_0x2bd762[_0x7d67('0x30')];var _0x39f786;if(_0x75e946>=_0x334db3){_0x75e946=_0x334db3;_0x39f786=0xc8;}else{_0x39f786=0xce;}_0x2c1869[_0x7d67('0x32')](_0x39f786);return _0x2c1869[_0x7d67('0x33')]('Content-Range',_0x1e5159+'-'+_0x75e946+'/'+_0x334db3)[_0x7d67('0x2d')](_0x161a73);}return null;};}function patchUpdates(_0x3a8584){return function(_0x4ceb06){try{jsonpatch[_0x7d67('0x34')](_0x4ceb06,_0x3a8584,!![]);}catch(_0x263491){return BPromise[_0x7d67('0x35')](_0x263491);}return _0x4ceb06[_0x7d67('0x36')]();};}function saveUpdates(_0x536561,_0x1715af){return function(_0x21877f){if(_0x21877f){return _0x21877f['update'](_0x536561)[_0x7d67('0x21')](function(_0x1fff8c){return _0x1fff8c;});}return null;};}function removeEntity(_0x4b7860,_0x482d3d){return function(_0x377b64){if(_0x377b64){return _0x377b64[_0x7d67('0x37')]()['then'](function(){_0x4b7860[_0x7d67('0x32')](0xcc)[_0x7d67('0x38')]();});}};}function handleEntityNotFound(_0xd1fcd9,_0x185e13){return function(_0xc791bd){if(!_0xc791bd){_0xd1fcd9[_0x7d67('0x2c')](0x194);}return _0xc791bd;};}function handleError(_0x4aa99b,_0x5b4e11){_0x5b4e11=_0x5b4e11||0x1f4;return function(_0x4b6861){logger['error'](_0x4b6861[_0x7d67('0x39')]);if(_0x4b6861[_0x7d67('0x3a')]){delete _0x4b6861[_0x7d67('0x3a')];}_0x4aa99b[_0x7d67('0x32')](_0x5b4e11)[_0x7d67('0x3b')](_0x4b6861);};}exports[_0x7d67('0x3c')]=function(_0x38b7f7,_0x365e23){var _0x2d43b4={},_0x33b765={},_0x1090c5={'count':0x0,'rows':[]};var _0x279fa1=_['map'](db[_0x7d67('0x3d')][_0x7d67('0x3e')],function(_0x19a23b){return{'name':_0x19a23b[_0x7d67('0x3f')],'type':_0x19a23b[_0x7d67('0x40')][_0x7d67('0x41')]};});_0x33b765[_0x7d67('0x42')]=_[_0x7d67('0x43')](_0x279fa1,_0x7d67('0x3a'));_0x33b765['query']=_[_0x7d67('0x44')](_0x38b7f7['query']);_0x33b765[_0x7d67('0x45')]=_[_0x7d67('0x46')](_0x33b765[_0x7d67('0x42')],_0x33b765[_0x7d67('0x47')]);_0x2d43b4[_0x7d67('0x48')]=_['intersection'](_0x33b765[_0x7d67('0x42')],qs['fields'](_0x38b7f7[_0x7d67('0x47')]['fields']));_0x2d43b4['attributes']=_0x2d43b4[_0x7d67('0x48')][_0x7d67('0x49')]?_0x2d43b4[_0x7d67('0x48')]:_0x33b765[_0x7d67('0x42')];if(!_0x38b7f7[_0x7d67('0x47')][_0x7d67('0x4a')](_0x7d67('0x4b'))){_0x2d43b4[_0x7d67('0x30')]=qs[_0x7d67('0x30')](_0x38b7f7[_0x7d67('0x47')][_0x7d67('0x30')]);_0x2d43b4[_0x7d67('0x2e')]=qs[_0x7d67('0x2e')](_0x38b7f7['query'][_0x7d67('0x2e')]);}_0x2d43b4[_0x7d67('0x4c')]=qs[_0x7d67('0x4d')](_0x38b7f7['query'][_0x7d67('0x4d')]);_0x2d43b4[_0x7d67('0x4e')]=qs[_0x7d67('0x45')](_['pick'](_0x38b7f7[_0x7d67('0x47')],_0x33b765[_0x7d67('0x45')]),_0x279fa1);if(_0x38b7f7[_0x7d67('0x47')][_0x7d67('0x4f')]){_0x2d43b4[_0x7d67('0x4e')]=_[_0x7d67('0x50')](_0x2d43b4[_0x7d67('0x4e')],{'$or':_[_0x7d67('0x43')](_0x279fa1,function(_0x48afc3){if(_0x48afc3[_0x7d67('0x40')]!=='VIRTUAL'){var _0x223477={};_0x223477[_0x48afc3['name']]={'$like':'%'+_0x38b7f7['query'][_0x7d67('0x4f')]+'%'};return _0x223477;}})});}_0x2d43b4=_[_0x7d67('0x50')]({},_0x2d43b4,_0x38b7f7['options']);var _0x423b6d={'where':_0x2d43b4[_0x7d67('0x4e')]};return db[_0x7d67('0x3d')][_0x7d67('0x31')](_0x423b6d)[_0x7d67('0x21')](function(_0x29f2dd){_0x1090c5[_0x7d67('0x31')]=_0x29f2dd;if(_0x38b7f7[_0x7d67('0x47')][_0x7d67('0x51')]){_0x2d43b4['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2d43b4);})[_0x7d67('0x21')](function(_0x5ba332){_0x1090c5[_0x7d67('0x52')]=_0x5ba332;return _0x1090c5;})[_0x7d67('0x21')](respondWithFilteredResult(_0x365e23,_0x2d43b4))[_0x7d67('0x2b')](handleError(_0x365e23,null));};exports['show']=function(_0xb1e2f7,_0x4c949a){var _0xde834e={'raw':!![],'where':{'id':_0xb1e2f7['params']['id']}},_0x16619c={};_0x16619c[_0x7d67('0x42')]=_[_0x7d67('0x44')](db[_0x7d67('0x3d')][_0x7d67('0x3e')]);_0x16619c[_0x7d67('0x47')]=_[_0x7d67('0x44')](_0xb1e2f7[_0x7d67('0x47')]);_0x16619c[_0x7d67('0x45')]=_[_0x7d67('0x46')](_0x16619c['model'],_0x16619c[_0x7d67('0x47')]);_0xde834e[_0x7d67('0x48')]=_[_0x7d67('0x46')](_0x16619c[_0x7d67('0x42')],qs[_0x7d67('0x53')](_0xb1e2f7['query'][_0x7d67('0x53')]));_0xde834e[_0x7d67('0x48')]=_0xde834e[_0x7d67('0x48')]['length']?_0xde834e[_0x7d67('0x48')]:_0x16619c[_0x7d67('0x42')];if(_0xb1e2f7[_0x7d67('0x47')][_0x7d67('0x51')]){_0xde834e['include']=[{'all':!![]}];}_0xde834e=_['merge']({},_0xde834e,_0xb1e2f7[_0x7d67('0x54')]);return db['FaxMessage'][_0x7d67('0x55')](_0xde834e)['then'](handleEntityNotFound(_0x4c949a,null))[_0x7d67('0x21')](respondWithResult(_0x4c949a,null))[_0x7d67('0x2b')](handleError(_0x4c949a,null));};exports[_0x7d67('0x56')]=function(_0x18f9a4,_0x5747a2){if(_0x18f9a4[_0x7d67('0x57')]['id']){delete _0x18f9a4[_0x7d67('0x57')]['id'];}return db[_0x7d67('0x3d')][_0x7d67('0x55')]({'where':{'id':_0x18f9a4[_0x7d67('0x58')]['id']}})['then'](handleEntityNotFound(_0x5747a2,null))['then'](saveUpdates(_0x18f9a4[_0x7d67('0x57')],null))['then'](respondWithResult(_0x5747a2,null))[_0x7d67('0x2b')](handleError(_0x5747a2,null));};exports[_0x7d67('0x37')]=function(_0x210854,_0x5a1a20){return db[_0x7d67('0x3d')][_0x7d67('0x55')]({'where':{'id':_0x210854[_0x7d67('0x58')]['id']}})[_0x7d67('0x21')](handleEntityNotFound(_0x5a1a20,null))[_0x7d67('0x21')](removeEntity(_0x5a1a20,null))['catch'](handleError(_0x5a1a20,null));};exports['describe']=function(_0x293b18,_0x2857e1){return db[_0x7d67('0x3d')][_0x7d67('0x59')]()['then'](respondWithResult(_0x2857e1,null))[_0x7d67('0x2b')](handleError(_0x2857e1,null));};var interaction_log=require(_0x7d67('0x5a'))(_0x7d67('0x5b'));exports['accept']=function(_0xe9453b,_0x26ae8c,_0x267275){var _0x3a1c52={'agent':{},'channel':_0x7d67('0x5c')};if(_0xe9453b[_0x7d67('0x57')]['id']){delete _0xe9453b['body']['id'];}_0xe9453b[_0x7d67('0x57')][_0x7d67('0x5d')]=!![];_0xe9453b[_0x7d67('0x57')][_0x7d67('0x5e')]=moment()[_0x7d67('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0xe9453b['body'][_0x7d67('0x60')]=_0xe9453b[_0x7d67('0x57')][_0x7d67('0x60')]||_0xe9453b['user']['id'];_0x3a1c52['agent']['id']=_0xe9453b[_0x7d67('0x57')]['UserId'];return db[_0x7d67('0x3d')][_0x7d67('0x55')]({'where':{'id':_0xe9453b[_0x7d67('0x58')]['id'],'UserId':null}})[_0x7d67('0x21')](handleEntityNotFound(_0x26ae8c,null))[_0x7d67('0x21')](saveUpdates(_0xe9453b[_0x7d67('0x57')],null))[_0x7d67('0x21')](function(_0x1a5a21){if(_0x1a5a21){_0x3a1c52[_0x7d67('0x29')]=_0x1a5a21[_0x7d67('0x61')]({'plain':!![]});return db[_0x7d67('0x62')][_0x7d67('0x55')]({'where':{'id':_0x1a5a21['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x26ae8c,null))['then'](function(_0x437853){if(_0x437853){return _0x437853[_0x7d67('0x56')]({'UserId':_0xe9453b[_0x7d67('0x57')][_0x7d67('0x60')],'read1stAt':_[_0x7d67('0x63')](_0x437853[_0x7d67('0x64')])?moment()[_0x7d67('0x5f')](_0x7d67('0x65')):undefined});}return null;})[_0x7d67('0x21')](function(_0x43c7f8){if(_0x43c7f8){_0x3a1c52[_0x7d67('0x66')]=_0x43c7f8[_0x7d67('0x61')]({'plain':!![]});interaction_log[_0x7d67('0x22')](_0x7d67('0x67'),_0xe9453b[_0x7d67('0x68')]['id'],_0xe9453b[_0x7d67('0x68')]['name'],_0xe9453b[_0x7d67('0x68')]['role'],_0x3a1c52[_0x7d67('0x66')]['id'],_0xe9453b[_0x7d67('0x57')]?JSON[_0x7d67('0x26')](_0xe9453b['body']):_0x7d67('0x69'));return respondWithRpcPromise(_0x7d67('0x6a'),'acceptMessage',_0x3a1c52);}return null;})[_0x7d67('0x21')](function(_0x90c446){var _0x4b1678=_0x7d67('0x6b')+_0x90c446['message']['ContactId'];return db[_0x7d67('0x6c')][_0x7d67('0x47')](_0x4b1678,{'type':db[_0x7d67('0x6d')][_0x7d67('0x6e')][_0x7d67('0x6f')],'raw':!![]})['then'](function(_0x30d324){return _0x30d324;});})[_0x7d67('0x21')](function(_0x25d14c){if(_0x25d14c){_0x3a1c52[_0x7d67('0x29')][_0x7d67('0x70')]=_0x25d14c[0x0];if(!_0xe9453b[_0x7d67('0x57')][_0x7d67('0x60')])return;return db[_0x7d67('0x71')][_0x7d67('0x55')]({'where':{'id':_0xe9453b[_0x7d67('0x57')][_0x7d67('0x60')],'role':_0x7d67('0x72')},'attributes':['id','name',_0x7d67('0x73'),_0x7d67('0x74'),_0x7d67('0x75')],'raw':!![]});}return null;})[_0x7d67('0x21')](function(_0x3858f0){if(!_0x3858f0)return null;_0x3a1c52[_0x7d67('0x29')][_0x7d67('0x72')]=_0x3858f0;return _0x3a1c52;})[_0x7d67('0x21')](function(_0x1b149f){if(_0x1b149f){if(_0xe9453b['body']['manual']){_0x3a1c52['message'][_0x7d67('0x76')]=util[_0x7d67('0x5f')]('SIP/%s',_0xe9453b[_0x7d67('0x68')][_0x7d67('0x3a')]);_0x3a1c52[_0x7d67('0x29')][_0x7d67('0x77')]=_0x3a1c52[_0x7d67('0x77')];_0x3a1c52['message']['motionChannel']=_0x3a1c52[_0x7d67('0x77')];_0x3a1c52[_0x7d67('0x29')]['event']=_0x7d67('0x78');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x7d67('0x79'),'message':_0x3a1c52['message']},client9002)[_0x7d67('0x21')](function(){return _0x3a1c52;});}return _0x3a1c52;}return null;})[_0x7d67('0x21')](respondWithResult(_0x26ae8c,null))[_0x7d67('0x2b')](handleError(_0x26ae8c,null));};var interaction_log=require(_0x7d67('0x5a'))(_0x7d67('0x5b'));exports['reject']=function(_0x4159a2,_0x17f29c,_0x662cb){var _0x3ef6ec={'agent':{},'channel':_0x7d67('0x5c')};if(_0x4159a2[_0x7d67('0x57')]['id']){delete _0x4159a2[_0x7d67('0x57')]['id'];}_0x4159a2[_0x7d67('0x57')][_0x7d67('0x60')]=_0x4159a2['body'][_0x7d67('0x60')]||_0x4159a2[_0x7d67('0x68')]['id'];_0x3ef6ec['agent']['id']=_0x4159a2[_0x7d67('0x57')][_0x7d67('0x60')];return db[_0x7d67('0x3d')][_0x7d67('0x55')]({'where':{'id':_0x4159a2[_0x7d67('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x17f29c,null))['then'](function(_0x4047ac){if(_0x4047ac){_0x3ef6ec[_0x7d67('0x29')]=_0x4047ac['get']({'plain':!![]});return db[_0x7d67('0x62')][_0x7d67('0x55')]({'where':{'id':_0x4047ac[_0x7d67('0x7a')]}});}return null;})[_0x7d67('0x21')](handleEntityNotFound(_0x17f29c,null))['then'](function(_0x4ec81a){if(_0x4ec81a){_0x3ef6ec[_0x7d67('0x66')]=_0x4ec81a[_0x7d67('0x61')]({'plain':!![]});interaction_log[_0x7d67('0x22')](_0x7d67('0x7b'),_0x4159a2[_0x7d67('0x68')]['id'],_0x4159a2[_0x7d67('0x68')]['name'],_0x4159a2[_0x7d67('0x68')][_0x7d67('0x7c')],_0x3ef6ec[_0x7d67('0x66')]['id'],_0x4159a2[_0x7d67('0x57')]?JSON[_0x7d67('0x26')](_0x4159a2[_0x7d67('0x57')]):_0x7d67('0x69'));return respondWithRpcPromise(_0x7d67('0x7d'),'rejectMessage',_0x3ef6ec);}return null;})[_0x7d67('0x21')](function(_0x498b6d){var _0x5d3a14=_0x7d67('0x6b')+_0x498b6d['message'][_0x7d67('0x7e')];return db[_0x7d67('0x6c')][_0x7d67('0x47')](_0x5d3a14,{'type':db['Sequelize'][_0x7d67('0x6e')]['SELECT'],'raw':!![]})[_0x7d67('0x21')](function(_0x5e5fbe){return _0x5e5fbe;});})[_0x7d67('0x21')](function(_0x453510){if(_0x453510){_0x3ef6ec[_0x7d67('0x29')][_0x7d67('0x70')]=_0x453510[0x0];if(!_0x4159a2[_0x7d67('0x57')][_0x7d67('0x60')])return;return db[_0x7d67('0x71')][_0x7d67('0x55')]({'where':{'id':_0x4159a2[_0x7d67('0x57')][_0x7d67('0x60')],'role':_0x7d67('0x72')},'attributes':['id',_0x7d67('0x3a'),'fullname','email',_0x7d67('0x75')],'raw':!![]});}return null;})[_0x7d67('0x21')](function(_0x242659){if(!_0x242659)return null;_0x3ef6ec[_0x7d67('0x29')][_0x7d67('0x72')]=_0x242659;return _0x3ef6ec;})[_0x7d67('0x21')](function(_0x1d3ae9){if(_0x1d3ae9){_0x1d3ae9[_0x7d67('0x29')][_0x7d67('0x76')]=util[_0x7d67('0x5f')](_0x7d67('0x7f'),_0x4159a2[_0x7d67('0x68')][_0x7d67('0x3a')]);_0x1d3ae9['message'][_0x7d67('0x77')]=_0x3ef6ec['channel'];_0x1d3ae9[_0x7d67('0x29')]['motionChannel']=_0x3ef6ec[_0x7d67('0x77')];_0x1d3ae9[_0x7d67('0x29')][_0x7d67('0x80')]=_0x7d67('0x35');respondWithRpcPromise(_0x7d67('0x81'),_0x7d67('0x81'),{'event':'rejectmessage','message':_0x1d3ae9['message']},client9002);return _0x3ef6ec;}return null;})['then'](respondWithResult(_0x17f29c,null))[_0x7d67('0x2b')](handleError(_0x17f29c,null));};exports[_0x7d67('0x82')]=function(_0x3754d6,_0x40b960){var _0x13b60f;return db['FaxMessage']['create'](_0x3754d6[_0x7d67('0x57')],{})[_0x7d67('0x21')](function(_0x2cf6d5){_0x13b60f=_0x2cf6d5;return db[_0x7d67('0x83')][_0x7d67('0x84')]({'where':{'id':_0x13b60f['ContactId']}});})[_0x7d67('0x21')](function(_0x38c2f5){if(_[_0x7d67('0x63')](_0x38c2f5)){return;}else{_0x13b60f[_0x7d67('0x5c')]=_0x38c2f5[_0x7d67('0x5c')];return db[_0x7d67('0x85')][_0x7d67('0x84')]({'where':{'id':_0x13b60f['AttachmentId']}});}})[_0x7d67('0x21')](function(_0x26623c){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x7d67('0x63')](_0x3754d6[_0x7d67('0x57')])?undefined:_0x3754d6['body']['FaxAccountId'],'path':_[_0x7d67('0x63')](_0x26623c)?undefined:util['format'](_0x7d67('0x86'),_0x26623c[_0x7d67('0x87')]),'fax':_[_0x7d67('0x63')](_0x13b60f[_0x7d67('0x5c')])?undefined:_0x13b60f[_0x7d67('0x5c')],'AttachmentId':_0x13b60f[_0x7d67('0x88')]},client9002);})['then'](respondWithResult(_0x40b960,0xc9))[_0x7d67('0x2b')](handleError(_0x40b960,null));};exports[_0x7d67('0x89')]=function(_0x4400d6,_0x5adacc){var _0x1a5de1=path[_0x7d67('0x8a')](config[_0x7d67('0x8b')],_0x7d67('0x8c'),_0x7d67('0x8d'),_0x7d67('0x8e'));return db[_0x7d67('0x3d')][_0x7d67('0x55')]({'where':{'id':_0x4400d6[_0x7d67('0x58')]['id']},'include':[{'model':db['Attachment'],'as':_0x7d67('0x85')}]})[_0x7d67('0x21')](handleEntityNotFound(_0x5adacc,null))[_0x7d67('0x21')](function(_0x26b407){if(_0x26b407){return _0x5adacc[_0x7d67('0x89')](path[_0x7d67('0x8a')](_0x1a5de1,_0x26b407['Attachment'][_0x7d67('0x87')]));}})['catch'](handleError(_0x5adacc,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index c57d4dd..513f87f 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 _0x1410=['FaxMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1410,0x130));var _0x0141=function(_0x9472f6,_0x46fbaa){_0x9472f6=_0x9472f6-0x0;var _0x32802d=_0x1410[_0x9472f6];return _0x32802d;};'use strict';var EventEmitter=require(_0x0141('0x0'));var FaxMessage=require(_0x0141('0x1'))['db'][_0x0141('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0141('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0141('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3c3422){return function(_0x5d2855,_0x194c72,_0x454af1){FaxMessageEvents[_0x0141('0x5')](_0x3c3422+':'+_0x5d2855['id'],_0x5d2855);FaxMessageEvents[_0x0141('0x5')](_0x3c3422,_0x5d2855);_0x454af1(null);};}for(var e in events){if(events[_0x0141('0x6')](e)){var event=events[e];FaxMessage[_0x0141('0x7')](e,emitEvent(event));}}module[_0x0141('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xa7ee=['exports','events','FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xa7ee,0x159));var _0xea7e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa7ee[_0x4709c0];return _0x13348b;};'use strict';var EventEmitter=require(_0xea7e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xea7e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xea7e('0x2')](0x0);var events={'afterCreate':_0xea7e('0x3'),'afterUpdate':_0xea7e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x547937){return function(_0x1a88ef,_0x5ef5bd,_0x2439f9){FaxMessageEvents[_0xea7e('0x5')](_0x547937+':'+_0x1a88ef['id'],_0x1a88ef);FaxMessageEvents[_0xea7e('0x5')](_0x547937,_0x1a88ef);_0x2439f9(null);};}for(var e in events){if(events[_0xea7e('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xea7e('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 aa7f81c..019553a 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 _0x0a86=['out','isNil','UserId','findOne','then','update','createdAt','catch','error','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase'];(function(_0x425c80,_0x5399c4){var _0x33e9b3=function(_0x256ad5){while(--_0x256ad5){_0x425c80['push'](_0x425c80['shift']());}};_0x33e9b3(++_0x5399c4);}(_0x0a86,0x175));var _0x60a8=function(_0x2330c5,_0x5ddb84){_0x2330c5=_0x2330c5-0x0;var _0x48133d=_0x0a86[_0x2330c5];return _0x48133d;};'use strict';var _=require(_0x60a8('0x0'));var util=require('util');var logger=require(_0x60a8('0x1'))('api');var moment=require(_0x60a8('0x2'));var BPromise=require(_0x60a8('0x3'));var rp=require(_0x60a8('0x4'));var fs=require('fs');var path=require(_0x60a8('0x5'));var rimraf=require('rimraf');var config=require(_0x60a8('0x6'));var attributes=require(_0x60a8('0x7'));module['exports']=function(_0x5a512a,_0x90efaf){return _0x5a512a[_0x60a8('0x8')](_0x60a8('0x9'),attributes,{'tableName':_0x60a8('0xa'),'paranoid':![],'indexes':[{'name':_0x60a8('0xb'),'fields':[_0x60a8('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x387963,_0x40a4d9,_0x4b8f2a){var _0x10f345=_0x5a512a[_0x60a8('0xd')];var _0x48f986=_0x387963[_0x60a8('0xe')]({'plain':!![]});if(_0x48f986[_0x60a8('0xf')][_0x60a8('0x10')]()==='in'||_0x48f986['direction'][_0x60a8('0x10')]()===_0x60a8('0x11')&&!_0x48f986['secret']&&!_[_0x60a8('0x12')](_0x48f986[_0x60a8('0x13')])){_0x10f345['FaxInteraction'][_0x60a8('0x14')]({'where':{'id':_0x48f986['FaxInteractionId']}})[_0x60a8('0x15')](function(_0x2d4821){if(_0x2d4821){_0x2d4821[_0x60a8('0x16')]({'lastMsgAt':_0x48f986[_0x60a8('0x17')],'lastMsgDirection':_0x48f986[_0x60a8('0xf')][_0x60a8('0x10')]()});}})[_0x60a8('0x18')](function(_0x4ef1d){console[_0x60a8('0x19')](_0x4ef1d);});}_0x4b8f2a();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xafad=['fax_messages','fti_fax_messages','body','FULLTEXT','toLowerCase','direction','secret','UserId','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xafad,0x17b));var _0xdafa=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xafad[_0x231e16];return _0x570a7c;};'use strict';var _=require('lodash');var util=require(_0xdafa('0x0'));var logger=require(_0xdafa('0x1'))(_0xdafa('0x2'));var moment=require(_0xdafa('0x3'));var BPromise=require(_0xdafa('0x4'));var rp=require(_0xdafa('0x5'));var fs=require('fs');var path=require(_0xdafa('0x6'));var rimraf=require(_0xdafa('0x7'));var config=require(_0xdafa('0x8'));var attributes=require(_0xdafa('0x9'));module[_0xdafa('0xa')]=function(_0x29fef4,_0x586668){return _0x29fef4[_0xdafa('0xb')](_0xdafa('0xc'),attributes,{'tableName':_0xdafa('0xd'),'paranoid':![],'indexes':[{'name':_0xdafa('0xe'),'fields':[_0xdafa('0xf')],'type':_0xdafa('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a6be5,_0x3390e6,_0x71946){var _0x49642e=_0x29fef4['models'];var _0x2afb84=_0x1a6be5['get']({'plain':!![]});if(_0x2afb84['direction'][_0xdafa('0x11')]()==='in'||_0x2afb84[_0xdafa('0x12')][_0xdafa('0x11')]()==='out'&&!_0x2afb84[_0xdafa('0x13')]&&!_['isNil'](_0x2afb84[_0xdafa('0x14')])){_0x49642e['FaxInteraction'][_0xdafa('0x15')]({'where':{'id':_0x2afb84['FaxInteractionId']}})[_0xdafa('0x16')](function(_0x22d3ac){if(_0x22d3ac){_0x22d3ac['update']({'lastMsgAt':_0x2afb84[_0xdafa('0x17')],'lastMsgDirection':_0x2afb84[_0xdafa('0x12')][_0xdafa('0x11')]()});}})[_0xdafa('0x18')](function(_0x3fb3af){console[_0xdafa('0x19')](_0x3fb3af);});}_0x71946();}},'charset':_0xdafa('0x1a'),'collate':_0xdafa('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 3108a1e..0d68ae5 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 _0x5c12=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','then','stringify','UpdateFaxMessage','raw','attributes','limit','util','moment','randomstring','ioredis'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5c12,0x188));var _0x25c1=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x5c12[_0x4d40dd];return _0x1c51f2;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});config[_0x25c1('0xb')]=_['defaults'](config['redis'],{'host':_0x25c1('0xc'),'port':0x18eb});var socket=require(_0x25c1('0xd'))(new Redis(config[_0x25c1('0xb')]));require(_0x25c1('0xe'))[_0x25c1('0xf')](socket);function respondWithRpcPromise(_0x588f30,_0x3e062e,_0x41c89d){return new BPromise(function(_0x11a223,_0x81f0f4){return client[_0x25c1('0x10')](_0x588f30,_0x41c89d)['then'](function(_0x196e2f){logger[_0x25c1('0x11')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));logger[_0x25c1('0x13')](_0x25c1('0x14'),_0x3e062e,_0x25c1('0x12'),JSON['stringify'](_0x196e2f));if(_0x196e2f['error']){if(_0x196e2f['error']['code']===0x1f4){logger[_0x25c1('0x15')](_0x25c1('0x16'),_0x3e062e,_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);return _0x81f0f4(_0x196e2f[_0x25c1('0x15')]['message']);}logger[_0x25c1('0x15')]('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x196e2f['error']['message']);return _0x11a223(_0x196e2f[_0x25c1('0x15')][_0x25c1('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x25c1('0x12'));_0x11a223(_0x196e2f['result'][_0x25c1('0x17')]);}})[_0x25c1('0x18')](function(_0x5c3c5d){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3e062e,_0x5c3c5d);_0x81f0f4(_0x5c3c5d);});});}exports[_0x25c1('0x19')]=function(_0x3d3149){var _0x22a36e=this;return new Promise(function(_0x1bf95d,_0x481c12){return db[_0x25c1('0x1a')][_0x25c1('0x1b')](_0x3d3149[_0x25c1('0x1c')],{'raw':_0x3d3149[_0x25c1('0x1d')]?_0x3d3149['options']['raw']===undefined?!![]:![]:!![]})[_0x25c1('0x1e')](function(_0xac3335){logger[_0x25c1('0x11')](_0x25c1('0x19'),_0x3d3149);logger[_0x25c1('0x13')](_0x25c1('0x19'),_0x3d3149,JSON[_0x25c1('0x1f')](_0xac3335));_0x1bf95d(_0xac3335);})[_0x25c1('0x18')](function(_0x14ffd9){logger[_0x25c1('0x15')](_0x25c1('0x19'),_0x14ffd9[_0x25c1('0x17')],_0x3d3149);_0x481c12(_0x22a36e[_0x25c1('0x15')](0x1f4,_0x14ffd9['message']));});});};exports[_0x25c1('0x20')]=function(_0x20dbb9){var _0x1b1c96=this;return new Promise(function(_0x1fb59f,_0x21fdb8){return db[_0x25c1('0x1a')]['update'](_0x20dbb9[_0x25c1('0x1c')],{'raw':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')]['where']||null:null,'attributes':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9['options'][_0x25c1('0x22')]||null:null,'limit':_0x20dbb9[_0x25c1('0x1d')]?_0x20dbb9[_0x25c1('0x1d')][_0x25c1('0x23')]||null:null})[_0x25c1('0x1e')](function(_0x21069c){logger[_0x25c1('0x11')](_0x25c1('0x20'),_0x20dbb9);logger[_0x25c1('0x13')]('UpdateFaxMessage',_0x20dbb9,JSON[_0x25c1('0x1f')](_0x21069c));_0x1fb59f(_0x21069c);})['catch'](function(_0x492715){logger[_0x25c1('0x15')](_0x25c1('0x20'),_0x492715['message'],_0x20dbb9);_0x21fdb8(_0x1b1c96[_0x25c1('0x15')](0x1f4,_0x492715['message']));});});}; \ No newline at end of file +var _0xb821=['register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x5eafce,_0x3d62b6){var _0x414698=function(_0x58ff9a){while(--_0x58ff9a){_0x5eafce['push'](_0x5eafce['shift']());}};_0x414698(++_0x3d62b6);}(_0xb821,0xa7));var _0x1b82=function(_0x1214dd,_0x445b87){_0x1214dd=_0x1214dd-0x0;var _0x57bde6=_0xb821[_0x1214dd];return _0x57bde6;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});config[_0x1b82('0x8')]=_[_0x1b82('0x9')](config[_0x1b82('0x8')],{'host':_0x1b82('0xa'),'port':0x18eb});var socket=require(_0x1b82('0xb'))(new Redis(config[_0x1b82('0x8')]));require(_0x1b82('0xc'))[_0x1b82('0xd')](socket);function respondWithRpcPromise(_0x4955b5,_0x4011f2,_0x30c6ee){return new BPromise(function(_0x44dfd4,_0x14c57a){return client[_0x1b82('0xe')](_0x4955b5,_0x30c6ee)[_0x1b82('0xf')](function(_0x739f99){logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1b82('0x11'));logger[_0x1b82('0x12')](_0x1b82('0x13'),_0x4011f2,_0x1b82('0x11'),JSON['stringify'](_0x739f99));if(_0x739f99[_0x1b82('0x14')]){if(_0x739f99['error']['code']===0x1f4){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);return _0x14c57a(_0x739f99['error'][_0x1b82('0x15')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')]['message']);return _0x44dfd4(_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);}else{logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,'request\x20sent');_0x44dfd4(_0x739f99[_0x1b82('0x16')]['message']);}})[_0x1b82('0x17')](function(_0x1002a1){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1002a1);_0x14c57a(_0x1002a1);});});}exports[_0x1b82('0x18')]=function(_0x2b6ee8){var _0x11af50=this;return new Promise(function(_0x46e5e2,_0x10d45c){return db['FaxMessage'][_0x1b82('0x19')](_0x2b6ee8[_0x1b82('0x1a')],{'raw':_0x2b6ee8[_0x1b82('0x1b')]?_0x2b6ee8[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![]})[_0x1b82('0xf')](function(_0x2d07f4){logger['info'](_0x1b82('0x18'),_0x2b6ee8);logger[_0x1b82('0x12')]('CreateFaxMessage',_0x2b6ee8,JSON[_0x1b82('0x1d')](_0x2d07f4));_0x46e5e2(_0x2d07f4);})[_0x1b82('0x17')](function(_0x1ad9d6){logger['error'](_0x1b82('0x18'),_0x1ad9d6['message'],_0x2b6ee8);_0x10d45c(_0x11af50['error'](0x1f4,_0x1ad9d6['message']));});});};exports[_0x1b82('0x1e')]=function(_0x149d0f){var _0xfd00d1=this;return new Promise(function(_0x257b79,_0x548a3b){return db[_0x1b82('0x1f')][_0x1b82('0x20')](_0x149d0f[_0x1b82('0x1a')],{'raw':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x21')]||null:null,'attributes':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x22')]||null:null,'limit':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f['options'][_0x1b82('0x23')]||null:null})[_0x1b82('0xf')](function(_0x155a34){logger[_0x1b82('0x10')](_0x1b82('0x1e'),_0x149d0f);logger[_0x1b82('0x12')](_0x1b82('0x1e'),_0x149d0f,JSON[_0x1b82('0x1d')](_0x155a34));_0x257b79(_0x155a34);})[_0x1b82('0x17')](function(_0x362657){logger['error'](_0x1b82('0x1e'),_0x362657[_0x1b82('0x15')],_0x149d0f);_0x548a3b(_0xfd00d1[_0x1b82('0x14')](0x1f4,_0x362657[_0x1b82('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b846810..c1d2aaf 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 _0x37b0=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37b0,0x14a));var _0x037b=function(_0x11746d,_0x9e53a6){_0x11746d=_0x11746d-0x0;var _0xc0044c=_0x37b0[_0x11746d];return _0xc0044c;};'use strict';var FaxMessageEvents=require(_0x037b('0x0'));var events=[_0x037b('0x1'),_0x037b('0x2'),_0x037b('0x3')];function createListener(_0x3e7d34,_0x325a98){return function(_0x146465){_0x325a98[_0x037b('0x4')](_0x3e7d34,_0x146465);};}function removeListener(_0x2afd6a,_0x5d6878){return function(){FaxMessageEvents[_0x037b('0x5')](_0x2afd6a,_0x5d6878);};}exports[_0x037b('0x6')]=function(_0x2254d0){for(var _0x393e2d=0x0,_0x55a5d9=events[_0x037b('0x7')];_0x393e2d<_0x55a5d9;_0x393e2d++){var _0x565f6d=events[_0x393e2d];var _0x40c01b=createListener(_0x037b('0x8')+_0x565f6d,_0x2254d0);FaxMessageEvents['on'](_0x565f6d,_0x40c01b);}}; \ No newline at end of file +var _0x9fa6=['./faxMessage.events','save','remove','emit','removeListener','length','faxMessage:'];(function(_0x28fbe3,_0x4ac6f8){var _0x45db6a=function(_0x296ecb){while(--_0x296ecb){_0x28fbe3['push'](_0x28fbe3['shift']());}};_0x45db6a(++_0x4ac6f8);}(_0x9fa6,0xfc));var _0x69fa=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9fa6[_0x2be8c2];return _0x97f531;};'use strict';var FaxMessageEvents=require(_0x69fa('0x0'));var events=[_0x69fa('0x1'),_0x69fa('0x2'),'update'];function createListener(_0xc945a,_0x97f6dd){return function(_0x110025){_0x97f6dd[_0x69fa('0x3')](_0xc945a,_0x110025);};}function removeListener(_0x3e1fd5,_0x2db4fa){return function(){FaxMessageEvents[_0x69fa('0x4')](_0x3e1fd5,_0x2db4fa);};}exports['register']=function(_0xdd08a9){for(var _0x1eeea7=0x0,_0x5cc1da=events[_0x69fa('0x5')];_0x1eeea7<_0x5cc1da;_0x1eeea7++){var _0x550c13=events[_0x1eeea7];var _0x5efa20=createListener(_0x69fa('0x6')+_0x550c13,_0xdd08a9);FaxMessageEvents['on'](_0x550c13,_0x5efa20);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a77cec5..2a6d409 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 _0x5b02=['put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create'];(function(_0xd69f4e,_0x23cc9c){var _0xe0340b=function(_0xa2d58a){while(--_0xa2d58a){_0xd69f4e['push'](_0xd69f4e['shift']());}};_0xe0340b(++_0x23cc9c);}(_0x5b02,0xe9));var _0x25b0=function(_0x1378da,_0x1b3687){_0x1378da=_0x1378da-0x0;var _0x308112=_0x5b02[_0x1378da];return _0x308112;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x8')]('/:id/download',auth[_0x25b0('0x9')](),controller[_0x25b0('0xd')]);router[_0x25b0('0xe')]('/',auth[_0x25b0('0x9')](),interaction[_0x25b0('0xf')](_0x25b0('0x10'),_0x25b0('0x11')),controller[_0x25b0('0x12')]);router[_0x25b0('0x13')](_0x25b0('0x14'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x15')]);router[_0x25b0('0x13')](_0x25b0('0x16'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x17')]);router[_0x25b0('0x13')](_0x25b0('0x18'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x19')]);router[_0x25b0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x25b0('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xeb74=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x446d41,_0x7b235){var _0x214844=function(_0x4707b3){while(--_0x4707b3){_0x446d41['push'](_0x446d41['shift']());}};_0x214844(++_0x7b235);}(_0xeb74,0xe3));var _0x4eb7=function(_0xcb3df9,_0x256fb1){_0xcb3df9=_0xcb3df9-0x0;var _0x3c2156=_0xeb74[_0xcb3df9];return _0x3c2156;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/describe',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),interaction['tracked'](_0x4eb7('0x11'),_0x4eb7('0x12')),controller[_0x4eb7('0x13')]);router[_0x4eb7('0x14')](_0x4eb7('0x15'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x4eb7('0x17')]);router['put'](_0x4eb7('0x18'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x19')]);router[_0x4eb7('0x1a')](_0x4eb7('0x15'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x1b')]);module[_0x4eb7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9d60b09..55cf20c 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 _0xb8cb=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x2cb09e,_0x2d47f1){var _0x25dd7f=function(_0x7414a8){while(--_0x7414a8){_0x2cb09e['push'](_0x2cb09e['shift']());}};_0x25dd7f(++_0x2d47f1);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x4efaf9,_0x917df6){_0x4efaf9=_0x4efaf9-0x0;var _0x2fb2d1=_0xb8cb[_0x4efaf9];return _0x2fb2d1;};'use strict';var Sequelize=require(_0xbb8c('0x0'));module[_0xbb8c('0x1')]={'name':{'type':Sequelize[_0xbb8c('0x2')],'unique':_0xbb8c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb8c('0x2')]},'timeout':{'type':Sequelize[_0xbb8c('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb8c('0x5')]('rrmemory',_0xbb8c('0x6'),_0xbb8c('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d1b=['sequelize','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x1c1259,_0x2db8ee){var _0x1dab5c=function(_0x5d2670){while(--_0x5d2670){_0x1c1259['push'](_0x1c1259['shift']());}};_0x1dab5c(++_0x2db8ee);}(_0x4d1b,0x102));var _0xb4d1=function(_0xfed299,_0x21b8d0){_0xfed299=_0xfed299-0x0;var _0x4ef1f2=_0x4d1b[_0xfed299];return _0x4ef1f2;};'use strict';var Sequelize=require(_0xb4d1('0x0'));module['exports']={'name':{'type':Sequelize[_0xb4d1('0x1')],'unique':_0xb4d1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb4d1('0x1')]},'timeout':{'type':Sequelize[_0xb4d1('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb4d1('0x4'),'beepall',_0xb4d1('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb4d1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index c89f9ab..f583335 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 _0xa751=['SELECT','TeamId','includes','compact','value','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','where','include','findAll','rows','catch','show','params','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserFaxQueue','rawAttributes','filters','hasOwnProperty','order','sort','pick','FaxQueueId','filter','findAndCountAll','agent','faxPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','nolimit','addTeams','ids','User','Agents','interface','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push'];(function(_0xdca6d3,_0x1ce89a){var _0x2cfd0e=function(_0x5be7e1){while(--_0x5be7e1){_0xdca6d3['push'](_0xdca6d3['shift']());}};_0x2cfd0e(++_0x1ce89a);}(_0xa751,0x175));var _0x1a75=function(_0x3b544b,_0x337b61){_0x3b544b=_0x3b544b-0x0;var _0x2d3d2b=_0xa751[_0x3b544b];return _0x2d3d2b;};'use strict';var BPromise=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var _=require(_0x1a75('0x2'));var squel=require(_0x1a75('0x3'));var Redis=require('ioredis');var qs=require(_0x1a75('0x4'));var logger=require('../../config/logger')(_0x1a75('0x5'));var config=require(_0x1a75('0x6'));var db=require(_0x1a75('0x7'))['db'];config['redis']=_[_0x1a75('0x8')](config[_0x1a75('0x9')],{'host':_0x1a75('0xa'),'port':0x18eb});var socket=require(_0x1a75('0xb'))(new Redis(config[_0x1a75('0x9')]));require(_0x1a75('0xc'))[_0x1a75('0xd')](socket);function respondWithStatusCode(_0x5d6faa,_0x4c7f62){_0x4c7f62=_0x4c7f62||0xcc;return function(_0x4f77c2){if(_0x4f77c2){return _0x5d6faa[_0x1a75('0xe')](_0x4c7f62);}return _0x5d6faa[_0x1a75('0xf')](_0x4c7f62)[_0x1a75('0x10')]();};}function respondWithResult(_0x271286,_0x15b4cc){_0x15b4cc=_0x15b4cc||0xc8;return function(_0xd150fc){if(_0xd150fc){return _0x271286[_0x1a75('0xf')](_0x15b4cc)[_0x1a75('0x11')](_0xd150fc);}};}function respondWithFilteredResult(_0x5b615f,_0x5f1ff8){return function(_0x5a63c0){if(_0x5a63c0){var _0x6333ba=typeof _0x5f1ff8[_0x1a75('0x12')]===_0x1a75('0x13')&&typeof _0x5f1ff8[_0x1a75('0x14')]==='undefined';var _0x5ed24b=_0x5a63c0[_0x1a75('0x15')];var _0xf4a616=_0x6333ba?0x0:_0x5f1ff8['offset'];var _0x1c84d3=_0x6333ba?_0x5a63c0[_0x1a75('0x15')]:_0x5f1ff8['offset']+_0x5f1ff8[_0x1a75('0x14')];var _0xb4a245;if(_0x1c84d3>=_0x5ed24b){_0x1c84d3=_0x5ed24b;_0xb4a245=0xc8;}else{_0xb4a245=0xce;}_0x5b615f[_0x1a75('0xf')](_0xb4a245);return _0x5b615f['set']('Content-Range',_0xf4a616+'-'+_0x1c84d3+'/'+_0x5ed24b)['json'](_0x5a63c0);}return null;};}function saveUpdates(_0x471b90){return function(_0x41b894){if(_0x41b894){return _0x41b894[_0x1a75('0x16')](_0x471b90)[_0x1a75('0x17')](function(_0x1b1af2){return _0x1b1af2;});}return null;};}function removeEntity(_0x1d11dc){return function(_0x47f384){if(_0x47f384){return _0x47f384[_0x1a75('0x18')]()['then'](function(){var _0x486cd8=_0x47f384[_0x1a75('0x19')]({'plain':!![]});var _0x3928b7='FaxQueues';return db[_0x1a75('0x1a')]['destroy']({'where':{'type':_0x3928b7,'resourceId':_0x486cd8['id']}})[_0x1a75('0x17')](function(){return _0x47f384;});})[_0x1a75('0x17')](function(){_0x1d11dc[_0x1a75('0xf')](0xcc)[_0x1a75('0x10')]();});}};}function handleEntityNotFound(_0x1643ea){return function(_0x3f0bf4){if(!_0x3f0bf4){_0x1643ea['sendStatus'](0x194);}return _0x3f0bf4;};}function handleError(_0x3ed5e9,_0x4dc595){_0x4dc595=_0x4dc595||0x1f4;return function(_0x32edee){logger[_0x1a75('0x1b')](_0x32edee[_0x1a75('0x1c')]);if(_0x32edee['name']){delete _0x32edee[_0x1a75('0x1d')];}_0x3ed5e9['status'](_0x4dc595)[_0x1a75('0x1e')](_0x32edee);};}exports[_0x1a75('0x1f')]=function(_0x3dd52d,_0x4ed6f8){var _0x9fe9fe={};var _0x126f40={'count':0x0,'rows':[]};var _0x4dec82=_[_0x1a75('0x20')](db[_0x1a75('0x21')]['rawAttributes'],function(_0x168e06){return{'name':_0x168e06[_0x1a75('0x22')],'type':_0x168e06[_0x1a75('0x23')][_0x1a75('0x24')]};});_0x9fe9fe=qs['getOptions'](_0x4dec82,_0x3dd52d);var _0x2e16b7={'where':_0x9fe9fe[_0x1a75('0x25')]};return db[_0x1a75('0x21')][_0x1a75('0x15')](_0x2e16b7)[_0x1a75('0x17')](function(_0x9e66b9){_0x126f40[_0x1a75('0x15')]=_0x9e66b9;_0x9fe9fe[_0x1a75('0x26')]=qs['include'](_0x3dd52d['query']);return db[_0x1a75('0x21')][_0x1a75('0x27')](_0x9fe9fe);})[_0x1a75('0x17')](function(_0x11f25b){_0x126f40[_0x1a75('0x28')]=_0x11f25b;return _0x126f40;})[_0x1a75('0x17')](respondWithFilteredResult(_0x4ed6f8,_0x9fe9fe))[_0x1a75('0x29')](handleError(_0x4ed6f8,null));};exports[_0x1a75('0x2a')]=function(_0x531c2e,_0x4d6f8d){var _0x4c30d5={'raw':!![],'where':{'id':_0x531c2e[_0x1a75('0x2b')]['id']}},_0xdef8cb={};_0xdef8cb[_0x1a75('0x2c')]=_[_0x1a75('0x2d')](db['FaxQueue']['rawAttributes']);_0xdef8cb['query']=_[_0x1a75('0x2d')](_0x531c2e[_0x1a75('0x2e')]);_0xdef8cb['filters']=_['intersection'](_0xdef8cb[_0x1a75('0x2c')],_0xdef8cb['query']);_0x4c30d5[_0x1a75('0x2f')]=_[_0x1a75('0x30')](_0xdef8cb[_0x1a75('0x2c')],qs['fields'](_0x531c2e['query'][_0x1a75('0x31')]));_0x4c30d5[_0x1a75('0x2f')]=_0x4c30d5[_0x1a75('0x2f')][_0x1a75('0x32')]?_0x4c30d5[_0x1a75('0x2f')]:_0xdef8cb[_0x1a75('0x2c')];if(_0x531c2e[_0x1a75('0x2e')][_0x1a75('0x33')]){_0x4c30d5[_0x1a75('0x26')]=[{'all':!![]}];}_0x4c30d5=_[_0x1a75('0x34')]({},_0x4c30d5,_0x531c2e[_0x1a75('0x35')]);return db[_0x1a75('0x21')][_0x1a75('0x36')](_0x4c30d5)[_0x1a75('0x17')](handleEntityNotFound(_0x4d6f8d,null))[_0x1a75('0x17')](respondWithResult(_0x4d6f8d,null))[_0x1a75('0x29')](handleError(_0x4d6f8d,null));};exports['create']=function(_0xc203ad,_0x54bbce){return db['FaxQueue'][_0x1a75('0x37')](_0xc203ad[_0x1a75('0x38')],{})[_0x1a75('0x17')](function(_0x109140){var _0x2842d4=_0xc203ad['user'][_0x1a75('0x19')]({'plain':!![]});if(!_0x2842d4)throw new Error(_0x1a75('0x39'));if(_0x2842d4[_0x1a75('0x3a')]===_0x1a75('0x3b')){var _0x4372b5=_0x109140['get']({'plain':!![]});var _0x3cf3f2='FaxQueues';return db[_0x1a75('0x3c')][_0x1a75('0x36')]({'where':{'name':_0x3cf3f2,'userProfileId':_0x2842d4[_0x1a75('0x3d')]},'raw':!![]})[_0x1a75('0x17')](function(_0x269ed6){if(_0x269ed6&&_0x269ed6[_0x1a75('0x3e')]===0x0){return db[_0x1a75('0x1a')]['create']({'name':_0x4372b5['name'],'resourceId':_0x4372b5['id'],'type':_0x269ed6[_0x1a75('0x1d')],'sectionId':_0x269ed6['id']},{})['then'](function(){return _0x109140;});}else{return _0x109140;}})[_0x1a75('0x29')](function(_0x14abcf){logger[_0x1a75('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14abcf);throw _0x14abcf;});}return _0x109140;})[_0x1a75('0x17')](respondWithResult(_0x54bbce,0xc9))[_0x1a75('0x29')](handleError(_0x54bbce,null));};exports[_0x1a75('0x16')]=function(_0x5a2c51,_0x292cbc){if(_0x5a2c51[_0x1a75('0x38')]['id']){delete _0x5a2c51[_0x1a75('0x38')]['id'];}return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x5a2c51[_0x1a75('0x2b')]['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x292cbc,null))['then'](saveUpdates(_0x5a2c51[_0x1a75('0x38')],null))[_0x1a75('0x17')](respondWithResult(_0x292cbc,null))[_0x1a75('0x29')](handleError(_0x292cbc,null));};exports[_0x1a75('0x18')]=function(_0x40605a,_0x4d7072){return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x40605a['params']['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x4d7072,null))['then'](removeEntity(_0x4d7072,null))[_0x1a75('0x29')](handleError(_0x4d7072,null));};exports['describe']=function(_0x65f4ca,_0x39d0a9){return db[_0x1a75('0x21')][_0x1a75('0x3f')]()[_0x1a75('0x17')](respondWithResult(_0x39d0a9,null))[_0x1a75('0x29')](handleError(_0x39d0a9,null));};exports[_0x1a75('0x40')]=function(_0x496bc3,_0x40c02d){var _0x5e188b={'raw':!![],'where':{}},_0x2c2be0={},_0x36ec71;return db[_0x1a75('0x21')][_0x1a75('0x41')]({'where':{'id':_0x496bc3[_0x1a75('0x2b')]['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x40c02d,null))[_0x1a75('0x17')](function(_0xd0557f){if(_0xd0557f){_0x36ec71=_0xd0557f['get']({'plain':!![]});_0x2c2be0[_0x1a75('0x2c')]=_[_0x1a75('0x2d')](db[_0x1a75('0x42')][_0x1a75('0x43')]);_0x2c2be0[_0x1a75('0x2e')]=_[_0x1a75('0x2d')](_0x496bc3[_0x1a75('0x2e')]);_0x2c2be0[_0x1a75('0x44')]=_[_0x1a75('0x30')](_0x2c2be0[_0x1a75('0x2c')],_0x2c2be0[_0x1a75('0x2e')]);_0x5e188b[_0x1a75('0x2f')]=_[_0x1a75('0x30')](_0x2c2be0[_0x1a75('0x2c')],qs[_0x1a75('0x31')](_0x496bc3['query'][_0x1a75('0x31')]));_0x5e188b[_0x1a75('0x2f')]=_0x5e188b[_0x1a75('0x2f')][_0x1a75('0x32')]?_0x5e188b[_0x1a75('0x2f')]:_0x2c2be0[_0x1a75('0x2c')];if(!_0x496bc3[_0x1a75('0x2e')][_0x1a75('0x45')]('nolimit')){_0x5e188b[_0x1a75('0x14')]=qs['limit'](_0x496bc3[_0x1a75('0x2e')][_0x1a75('0x14')]);_0x5e188b[_0x1a75('0x12')]=qs['offset'](_0x496bc3['query']['offset']);}_0x5e188b[_0x1a75('0x46')]=qs[_0x1a75('0x47')](_0x496bc3[_0x1a75('0x2e')][_0x1a75('0x47')]);_0x5e188b[_0x1a75('0x25')]=qs['filters'](_[_0x1a75('0x48')](_0x496bc3[_0x1a75('0x2e')],_0x2c2be0[_0x1a75('0x44')]));_0x5e188b[_0x1a75('0x25')][_0x1a75('0x49')]=_0xd0557f['id'];if(_0x496bc3[_0x1a75('0x2e')]['filter']){_0x5e188b['where']=_['merge'](_0x5e188b[_0x1a75('0x25')],{'$or':_[_0x1a75('0x20')](_0x5e188b[_0x1a75('0x2f')],function(_0x5b067f){var _0x50982d={};_0x50982d[_0x5b067f]={'$like':'%'+_0x496bc3[_0x1a75('0x2e')][_0x1a75('0x4a')]+'%'};return _0x50982d;})});}_0x5e188b=_['merge']({},_0x5e188b,_0x496bc3[_0x1a75('0x35')]);return db['UserFaxQueue']['findAll'](_0x5e188b);}})[_0x1a75('0x17')](function(_0x5a4502){if(_0x5a4502){return db['User'][_0x1a75('0x4b')]({'where':{'id':_[_0x1a75('0x20')](_0x5a4502,'UserId'),'role':_0x1a75('0x4c')},'attributes':['id',_0x1a75('0x1d'),_0x1a75('0x4d'),'updatedAt',_0x1a75('0x4e')]});}})['then'](function(_0x336b34){if(_0x336b34){return{'count':_0x336b34[_0x1a75('0x15')],'rows':_['map'](_0x336b34[_0x1a75('0x28')],function(_0x66b16d){return{'membername':_0x66b16d[_0x1a75('0x1d')],'UserId':_0x66b16d['id'],'queue_name':_0x36ec71[_0x1a75('0x1d')],'FaxQueueId':_0x36ec71['id'],'interface':util['format'](_0x1a75('0x4f'),_0x1a75('0x50'),_0x66b16d['name']),'penalty':0x0,'paused':_0x66b16d[_0x1a75('0x4d')],'createdAt':_0x66b16d['createdAt'],'updatedAt':_0x66b16d[_0x1a75('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a75('0x17')](respondWithFilteredResult(_0x40c02d,_0x5e188b))['catch'](handleError(_0x40c02d,null));};exports[_0x1a75('0x52')]=function(_0x47674d,_0x33b59b){var _0x225609={};var _0x1060d1={};var _0x1ff8d0;var _0x5389f9;return db[_0x1a75('0x21')][_0x1a75('0x41')]({'where':{'id':_0x47674d[_0x1a75('0x2b')]['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x33b59b,null))[_0x1a75('0x17')](function(_0x338472){if(_0x338472){_0x1ff8d0=_0x338472;_0x1060d1[_0x1a75('0x2c')]=_['keys'](db[_0x1a75('0x53')]['rawAttributes']);_0x1060d1[_0x1a75('0x2e')]=_[_0x1a75('0x2d')](_0x47674d['query']);_0x1060d1['filters']=_['intersection'](_0x1060d1[_0x1a75('0x2c')],_0x1060d1[_0x1a75('0x2e')]);_0x225609[_0x1a75('0x2f')]=_[_0x1a75('0x30')](_0x1060d1[_0x1a75('0x2c')],qs[_0x1a75('0x31')](_0x47674d[_0x1a75('0x2e')][_0x1a75('0x31')]));_0x225609[_0x1a75('0x2f')]=_0x225609[_0x1a75('0x2f')]['length']?_0x225609[_0x1a75('0x2f')]:_0x1060d1[_0x1a75('0x2c')];_0x225609[_0x1a75('0x46')]=qs[_0x1a75('0x47')](_0x47674d[_0x1a75('0x2e')][_0x1a75('0x47')]);_0x225609[_0x1a75('0x25')]=qs[_0x1a75('0x44')](_[_0x1a75('0x48')](_0x47674d[_0x1a75('0x2e')],_0x1060d1[_0x1a75('0x44')]));if(_0x47674d['query']['filter']){_0x225609['where']=_['merge'](_0x225609[_0x1a75('0x25')],{'$or':_[_0x1a75('0x20')](_0x225609[_0x1a75('0x2f')],function(_0xd62f37){var _0x14b070={};_0x14b070[_0xd62f37]={'$like':'%'+_0x47674d[_0x1a75('0x2e')]['filter']+'%'};return _0x14b070;})});}_0x225609=_[_0x1a75('0x34')]({},_0x225609,_0x47674d[_0x1a75('0x35')]);return _0x1ff8d0[_0x1a75('0x52')](_0x225609);}})[_0x1a75('0x17')](function(_0x51639a){if(_0x51639a){_0x5389f9=_0x51639a[_0x1a75('0x32')];if(!_0x47674d[_0x1a75('0x2e')][_0x1a75('0x45')](_0x1a75('0x54'))){_0x225609[_0x1a75('0x14')]=qs[_0x1a75('0x14')](_0x47674d['query'][_0x1a75('0x14')]);_0x225609[_0x1a75('0x12')]=qs['offset'](_0x47674d[_0x1a75('0x2e')][_0x1a75('0x12')]);}return _0x1ff8d0['getTeams'](_0x225609);}})[_0x1a75('0x17')](function(_0x2bbe57){if(_0x2bbe57){return _0x2bbe57?{'count':_0x5389f9,'rows':_0x2bbe57}:null;}})[_0x1a75('0x17')](respondWithResult(_0x33b59b,null))[_0x1a75('0x29')](handleError(_0x33b59b,null));};exports[_0x1a75('0x55')]=function(_0x399f29,_0x27dd93){var _0x5eddef=_0x399f29[_0x1a75('0x38')][_0x1a75('0x56')];return db[_0x1a75('0x53')][_0x1a75('0x27')]({'where':{'id':_0x5eddef},'attributes':['id'],'include':[{'model':db[_0x1a75('0x57')],'as':_0x1a75('0x58'),'attributes':['id','name','online','voicePause',_0x1a75('0x59')],'raw':!![]}]})['then'](function(_0x3b27fc){if(_0x3b27fc){var _0x548cff=_[_0x1a75('0x5a')](_0x3b27fc,function(_0x493a26){var _0x456b7f=_0x493a26[_0x1a75('0x19')]({'plain':!![]});return _0x456b7f['Agents'];});return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x399f29[_0x1a75('0x2b')]['id']}})[_0x1a75('0x17')](function(_0xbccc48){return db[_0x1a75('0x5b')][_0x1a75('0x5c')](function(_0x10dbee){return _0xbccc48[_0x1a75('0x55')](_0x5eddef,{'transaction':_0x10dbee})[_0x1a75('0x17')](function(){return BPromise[_0x1a75('0x5d')](_0x548cff,function(_0x26c0fb){return db[_0x1a75('0x42')]['findOrCreate']({'where':{'UserId':_0x26c0fb['id'],'FaxQueueId':_0x399f29[_0x1a75('0x2b')]['id']},'transaction':_0x10dbee});});})['then'](function(){_0x548cff[_0x1a75('0x5e')](function(_0x1b784e){socket[_0x1a75('0x5f')](_0x1a75('0x60'),{'UserId':_0x1b784e['id'],'FaxQueueId':_0xbccc48['id']});});});});});}})[_0x1a75('0x17')](respondWithStatusCode(_0x27dd93,null))[_0x1a75('0x29')](handleError(_0x27dd93,null));};exports[_0x1a75('0x61')]=function(_0x2618a6,_0xca99ad){return db[_0x1a75('0x53')]['findAll']({'where':{'id':_0x2618a6[_0x1a75('0x2e')][_0x1a75('0x56')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1a75('0x58'),'attributes':['id'],'raw':!![]}]})[_0x1a75('0x17')](handleEntityNotFound(_0xca99ad,null))['then'](function(_0x262ece){var _0x28bf77=_[_0x1a75('0x20')](_0x262ece,'id');var _0x53c8eb=[];var _0x32cb9f=[];var _0xd063a8=squel[_0x1a75('0x62')]();_0xd063a8[_0x1a75('0x63')](_0x1a75('0x64'))[_0x1a75('0x65')]('team_has_fax_queues','tq')['join'](_0x1a75('0x66'),'ut',_0x1a75('0x67'))[_0x1a75('0x25')](_0x1a75('0x68'),_0x2618a6[_0x1a75('0x2b')]['id']);for(var _0x3bfabd=0x0;_0x3bfabd<_0x262ece[_0x1a75('0x32')];_0x3bfabd+=0x1){let _0x14ba03=_0x262ece[_0x3bfabd];for(var _0x2bbfb3=0x0;_0x2bbfb3<_0x14ba03[_0x1a75('0x58')][_0x1a75('0x32')];_0x2bbfb3+=0x1){let _0xb21db1=_0x14ba03[_0x1a75('0x58')][_0x2bbfb3];var _0x798e64=_0xd063a8['clone']();_0x798e64[_0x1a75('0x25')](_0x1a75('0x69'),_0xb21db1['id']);_0x32cb9f[_0x1a75('0x6a')](db[_0x1a75('0x5b')][_0x1a75('0x2e')](_0x798e64['toString'](),{'type':db['sequelize']['QueryTypes'][_0x1a75('0x6b')]})['then'](function(_0x16bf89){if(_0x16bf89[_0x1a75('0x32')]===0x1){return _0xb21db1['id'];}else{var _0x2d19cf=_['every'](_[_0x1a75('0x20')](_0x16bf89,_0x1a75('0x6c')),function(_0x59c148){return _[_0x1a75('0x6d')](_0x28bf77,_0x59c148);});if(_0x2d19cf){return _0xb21db1['id'];}}}));}}return BPromise['all'](_0x32cb9f)[_0x1a75('0x17')](function(_0x529e19){_0x53c8eb=_(_0x53c8eb)['union'](_0x529e19)[_0x1a75('0x6e')]()[_0x1a75('0x6f')]();return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x2618a6[_0x1a75('0x2b')]['id']}})['then'](function(_0x13413b){return db[_0x1a75('0x5b')][_0x1a75('0x5c')](function(_0x24bdc1){return _0x13413b[_0x1a75('0x61')](_0x2618a6[_0x1a75('0x2e')][_0x1a75('0x56')],{'transaction':_0x24bdc1})[_0x1a75('0x17')](function(){if(!_[_0x1a75('0x70')](_0x53c8eb)){return _0x13413b['removeAgents'](_0x53c8eb,{'transaction':_0x24bdc1});}})['then'](function(){_0x53c8eb['forEach'](function(_0x1cef54){socket[_0x1a75('0x5f')](_0x1a75('0x71'),{'UserId':_0x1cef54,'FaxQueueId':_0x13413b['id']});});});});});});})[_0x1a75('0x17')](respondWithStatusCode(_0xca99ad,null))['catch'](handleError(_0xca99ad,null));};exports[_0x1a75('0x72')]=function(_0x3f3142,_0x4e11a8){return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x3f3142[_0x1a75('0x2b')]['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x4e11a8,null))[_0x1a75('0x17')](function(_0x4d5753){if(_0x4d5753){return _0x4d5753[_0x1a75('0x72')](_0x3f3142[_0x1a75('0x38')]['ids'],_[_0x1a75('0x73')](_0x3f3142[_0x1a75('0x38')],[_0x1a75('0x56'),'id'])||{})[_0x1a75('0x74')](function(_0x103084){for(var _0x426735=0x0;_0x426735<_0x3f3142[_0x1a75('0x38')][_0x1a75('0x56')][_0x1a75('0x32')];_0x426735+=0x1){socket['emit'](_0x1a75('0x60'),{'UserId':Number(_0x3f3142[_0x1a75('0x38')][_0x1a75('0x56')][_0x426735]),'FaxQueueId':Number(_0x3f3142[_0x1a75('0x2b')]['id'])});}return _0x103084;});}})[_0x1a75('0x17')](respondWithResult(_0x4e11a8,null))[_0x1a75('0x29')](handleError(_0x4e11a8,null));};exports['removeAgents']=function(_0x16906d,_0x2f5468){return db[_0x1a75('0x21')][_0x1a75('0x36')]({'where':{'id':_0x16906d['params']['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x2f5468,null))[_0x1a75('0x17')](function(_0x34c7c4){if(_0x34c7c4){return _0x34c7c4[_0x1a75('0x75')](_0x16906d[_0x1a75('0x2e')][_0x1a75('0x56')])[_0x1a75('0x17')](function(){if(_[_0x1a75('0x76')](_0x16906d[_0x1a75('0x2e')]['ids'])){for(var _0x5e8518=0x0;_0x5e8518<_0x16906d[_0x1a75('0x2e')][_0x1a75('0x56')][_0x1a75('0x32')];_0x5e8518+=0x1){socket[_0x1a75('0x5f')]('userFaxQueue:remove',{'UserId':Number(_0x16906d[_0x1a75('0x2e')][_0x1a75('0x56')][_0x5e8518]),'FaxQueueId':Number(_0x16906d[_0x1a75('0x2b')]['id'])});}}else{socket[_0x1a75('0x5f')](_0x1a75('0x71'),{'UserId':Number(_0x16906d[_0x1a75('0x2e')][_0x1a75('0x56')]),'FaxQueueId':Number(_0x16906d[_0x1a75('0x2b')]['id'])});}});}})[_0x1a75('0x17')](respondWithStatusCode(_0x2f5468,null))[_0x1a75('0x29')](handleError(_0x2f5468,null));};exports[_0x1a75('0x77')]=function(_0x437baa,_0x103d85){var _0x39ddec={};var _0x34c8c8={};var _0x4dd4f4;var _0x55cce1;return db[_0x1a75('0x21')][_0x1a75('0x41')]({'where':{'id':_0x437baa['params']['id']}})[_0x1a75('0x17')](handleEntityNotFound(_0x103d85,null))[_0x1a75('0x17')](function(_0x4a9bf8){if(_0x4a9bf8){_0x4dd4f4=_0x4a9bf8;_0x34c8c8[_0x1a75('0x2c')]=_[_0x1a75('0x2d')](db[_0x1a75('0x57')]['rawAttributes']);_0x34c8c8[_0x1a75('0x2e')]=_['keys'](_0x437baa[_0x1a75('0x2e')]);_0x34c8c8[_0x1a75('0x44')]=_[_0x1a75('0x30')](_0x34c8c8[_0x1a75('0x2c')],_0x34c8c8[_0x1a75('0x2e')]);_0x39ddec[_0x1a75('0x2f')]=_[_0x1a75('0x30')](_0x34c8c8[_0x1a75('0x2c')],qs[_0x1a75('0x31')](_0x437baa[_0x1a75('0x2e')][_0x1a75('0x31')]));_0x39ddec[_0x1a75('0x2f')]=_0x39ddec[_0x1a75('0x2f')][_0x1a75('0x32')]?_0x39ddec[_0x1a75('0x2f')]:_0x34c8c8['model'];_0x39ddec[_0x1a75('0x46')]=qs[_0x1a75('0x47')](_0x437baa[_0x1a75('0x2e')]['sort']);_0x39ddec['where']=qs['filters'](_[_0x1a75('0x48')](_0x437baa[_0x1a75('0x2e')],_0x34c8c8[_0x1a75('0x44')]));if(_0x437baa[_0x1a75('0x2e')][_0x1a75('0x4a')]){_0x39ddec[_0x1a75('0x25')]=_['merge'](_0x39ddec['where'],{'$or':_[_0x1a75('0x20')](_0x39ddec[_0x1a75('0x2f')],function(_0x2e76a8){var _0xa03fc9={};_0xa03fc9[_0x2e76a8]={'$like':'%'+_0x437baa[_0x1a75('0x2e')][_0x1a75('0x4a')]+'%'};return _0xa03fc9;})});}_0x39ddec=_['merge']({},_0x39ddec,_0x437baa['options']);return _0x4dd4f4[_0x1a75('0x77')](_0x39ddec);}})[_0x1a75('0x17')](function(_0x56c2d8){if(_0x56c2d8){_0x55cce1=_0x56c2d8['length'];if(!_0x437baa['query'][_0x1a75('0x45')](_0x1a75('0x54'))){_0x39ddec['limit']=qs['limit'](_0x437baa[_0x1a75('0x2e')][_0x1a75('0x14')]);_0x39ddec[_0x1a75('0x12')]=qs['offset'](_0x437baa[_0x1a75('0x2e')]['offset']);}return _0x4dd4f4[_0x1a75('0x77')](_0x39ddec);}})[_0x1a75('0x17')](function(_0x446016){if(_0x446016){return _0x446016?{'count':_0x55cce1,'rows':_0x446016}:null;}})[_0x1a75('0x17')](respondWithResult(_0x103d85,null))['catch'](handleError(_0x103d85,null));}; \ No newline at end of file +var _0xacf4=['offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','map','FaxQueue','fieldName','type','key','getOptions','where','include','query','findAll','catch','show','params','keys','rawAttributes','filters','intersection','model','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserFaxQueue','attributes','fields','length','hasOwnProperty','nolimit','sort','FaxQueueId','filter','merge','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','pick','addTeams','ids','User','Agents','online','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','union','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xacf4,0xe7));var _0x4acf=function(_0x22a9b7,_0x58e5d4){_0x22a9b7=_0x22a9b7-0x0;var _0x8a8568=_0xacf4[_0x22a9b7];return _0x8a8568;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x4acf('0x0'));var squel=require(_0x4acf('0x1'));var Redis=require(_0x4acf('0x2'));var qs=require(_0x4acf('0x3'));var logger=require(_0x4acf('0x4'))(_0x4acf('0x5'));var config=require(_0x4acf('0x6'));var db=require('../../mysqldb')['db'];config[_0x4acf('0x7')]=_[_0x4acf('0x8')](config['redis'],{'host':_0x4acf('0x9'),'port':0x18eb});var socket=require(_0x4acf('0xa'))(new Redis(config[_0x4acf('0x7')]));require(_0x4acf('0xb'))[_0x4acf('0xc')](socket);function respondWithStatusCode(_0x50f5f4,_0x55f61d){_0x55f61d=_0x55f61d||0xcc;return function(_0x41970b){if(_0x41970b){return _0x50f5f4['sendStatus'](_0x55f61d);}return _0x50f5f4[_0x4acf('0xd')](_0x55f61d)[_0x4acf('0xe')]();};}function respondWithResult(_0x3e9ddd,_0x4ff233){_0x4ff233=_0x4ff233||0xc8;return function(_0x290ca7){if(_0x290ca7){return _0x3e9ddd[_0x4acf('0xd')](_0x4ff233)['json'](_0x290ca7);}};}function respondWithFilteredResult(_0x5f22d9,_0x1fe474){return function(_0x540c8f){if(_0x540c8f){var _0x5bca4e=typeof _0x1fe474[_0x4acf('0xf')]===_0x4acf('0x10')&&typeof _0x1fe474[_0x4acf('0x11')]===_0x4acf('0x10');var _0x18629e=_0x540c8f[_0x4acf('0x12')];var _0x7ab3ea=_0x5bca4e?0x0:_0x1fe474[_0x4acf('0xf')];var _0x2025ca=_0x5bca4e?_0x540c8f[_0x4acf('0x12')]:_0x1fe474[_0x4acf('0xf')]+_0x1fe474['limit'];var _0x1b584a;if(_0x2025ca>=_0x18629e){_0x2025ca=_0x18629e;_0x1b584a=0xc8;}else{_0x1b584a=0xce;}_0x5f22d9['status'](_0x1b584a);return _0x5f22d9[_0x4acf('0x13')](_0x4acf('0x14'),_0x7ab3ea+'-'+_0x2025ca+'/'+_0x18629e)[_0x4acf('0x15')](_0x540c8f);}return null;};}function saveUpdates(_0x5d934a){return function(_0x5207e7){if(_0x5207e7){return _0x5207e7[_0x4acf('0x16')](_0x5d934a)[_0x4acf('0x17')](function(_0x240c00){return _0x240c00;});}return null;};}function removeEntity(_0x4b1d93){return function(_0x2a678b){if(_0x2a678b){return _0x2a678b[_0x4acf('0x18')]()[_0x4acf('0x17')](function(){var _0x8b55f8=_0x2a678b[_0x4acf('0x19')]({'plain':!![]});var _0x21e385=_0x4acf('0x1a');return db[_0x4acf('0x1b')][_0x4acf('0x18')]({'where':{'type':_0x21e385,'resourceId':_0x8b55f8['id']}})[_0x4acf('0x17')](function(){return _0x2a678b;});})[_0x4acf('0x17')](function(){_0x4b1d93['status'](0xcc)[_0x4acf('0xe')]();});}};}function handleEntityNotFound(_0x6bd89){return function(_0x57ea46){if(!_0x57ea46){_0x6bd89[_0x4acf('0x1c')](0x194);}return _0x57ea46;};}function handleError(_0x17775f,_0x569d9e){_0x569d9e=_0x569d9e||0x1f4;return function(_0x3b26ac){logger[_0x4acf('0x1d')](_0x3b26ac[_0x4acf('0x1e')]);if(_0x3b26ac[_0x4acf('0x1f')]){delete _0x3b26ac['name'];}_0x17775f[_0x4acf('0xd')](_0x569d9e)[_0x4acf('0x20')](_0x3b26ac);};}exports['index']=function(_0x32771e,_0x1af4e9){var _0x52a84a={};var _0x126522={'count':0x0,'rows':[]};var _0x7ebb=_[_0x4acf('0x21')](db[_0x4acf('0x22')]['rawAttributes'],function(_0x50236d){return{'name':_0x50236d[_0x4acf('0x23')],'type':_0x50236d[_0x4acf('0x24')][_0x4acf('0x25')]};});_0x52a84a=qs[_0x4acf('0x26')](_0x7ebb,_0x32771e);var _0x14086c={'where':_0x52a84a[_0x4acf('0x27')]};return db[_0x4acf('0x22')][_0x4acf('0x12')](_0x14086c)[_0x4acf('0x17')](function(_0x2a3830){_0x126522['count']=_0x2a3830;_0x52a84a[_0x4acf('0x28')]=qs[_0x4acf('0x28')](_0x32771e[_0x4acf('0x29')]);return db[_0x4acf('0x22')][_0x4acf('0x2a')](_0x52a84a);})[_0x4acf('0x17')](function(_0x27384c){_0x126522['rows']=_0x27384c;return _0x126522;})[_0x4acf('0x17')](respondWithFilteredResult(_0x1af4e9,_0x52a84a))[_0x4acf('0x2b')](handleError(_0x1af4e9,null));};exports[_0x4acf('0x2c')]=function(_0x50dced,_0x387735){var _0x18d0bf={'raw':!![],'where':{'id':_0x50dced[_0x4acf('0x2d')]['id']}},_0x1fc815={};_0x1fc815['model']=_[_0x4acf('0x2e')](db[_0x4acf('0x22')][_0x4acf('0x2f')]);_0x1fc815['query']=_[_0x4acf('0x2e')](_0x50dced[_0x4acf('0x29')]);_0x1fc815[_0x4acf('0x30')]=_[_0x4acf('0x31')](_0x1fc815[_0x4acf('0x32')],_0x1fc815[_0x4acf('0x29')]);_0x18d0bf['attributes']=_[_0x4acf('0x31')](_0x1fc815[_0x4acf('0x32')],qs['fields'](_0x50dced[_0x4acf('0x29')]['fields']));_0x18d0bf['attributes']=_0x18d0bf['attributes']['length']?_0x18d0bf['attributes']:_0x1fc815['model'];if(_0x50dced['query'][_0x4acf('0x33')]){_0x18d0bf[_0x4acf('0x28')]=[{'all':!![]}];}_0x18d0bf=_['merge']({},_0x18d0bf,_0x50dced[_0x4acf('0x34')]);return db[_0x4acf('0x22')][_0x4acf('0x35')](_0x18d0bf)[_0x4acf('0x17')](handleEntityNotFound(_0x387735,null))[_0x4acf('0x17')](respondWithResult(_0x387735,null))[_0x4acf('0x2b')](handleError(_0x387735,null));};exports[_0x4acf('0x36')]=function(_0x29dc65,_0x24465b){return db[_0x4acf('0x22')]['create'](_0x29dc65['body'],{})[_0x4acf('0x17')](function(_0x2e984e){var _0x4859b6=_0x29dc65[_0x4acf('0x37')][_0x4acf('0x19')]({'plain':!![]});if(!_0x4859b6)throw new Error(_0x4acf('0x38'));if(_0x4859b6[_0x4acf('0x39')]==='user'){var _0x528550=_0x2e984e[_0x4acf('0x19')]({'plain':!![]});var _0x2bf803=_0x4acf('0x1a');return db[_0x4acf('0x3a')]['find']({'where':{'name':_0x2bf803,'userProfileId':_0x4859b6[_0x4acf('0x3b')]},'raw':!![]})[_0x4acf('0x17')](function(_0x4e9370){if(_0x4e9370&&_0x4e9370['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x528550[_0x4acf('0x1f')],'resourceId':_0x528550['id'],'type':_0x4e9370[_0x4acf('0x1f')],'sectionId':_0x4e9370['id']},{})[_0x4acf('0x17')](function(){return _0x2e984e;});}else{return _0x2e984e;}})['catch'](function(_0x1015e3){logger[_0x4acf('0x1d')](_0x4acf('0x3c'),_0x1015e3);throw _0x1015e3;});}return _0x2e984e;})[_0x4acf('0x17')](respondWithResult(_0x24465b,0xc9))[_0x4acf('0x2b')](handleError(_0x24465b,null));};exports[_0x4acf('0x16')]=function(_0x7cf2a,_0x17d5e9){if(_0x7cf2a[_0x4acf('0x3d')]['id']){delete _0x7cf2a[_0x4acf('0x3d')]['id'];}return db[_0x4acf('0x22')]['find']({'where':{'id':_0x7cf2a[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x17d5e9,null))[_0x4acf('0x17')](saveUpdates(_0x7cf2a[_0x4acf('0x3d')],null))[_0x4acf('0x17')](respondWithResult(_0x17d5e9,null))['catch'](handleError(_0x17d5e9,null));};exports['destroy']=function(_0x18b9d2,_0x2fc411){return db[_0x4acf('0x22')][_0x4acf('0x35')]({'where':{'id':_0x18b9d2[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x2fc411,null))['then'](removeEntity(_0x2fc411,null))[_0x4acf('0x2b')](handleError(_0x2fc411,null));};exports['describe']=function(_0xd6d197,_0x3c3e65){return db['FaxQueue']['describe']()[_0x4acf('0x17')](respondWithResult(_0x3c3e65,null))[_0x4acf('0x2b')](handleError(_0x3c3e65,null));};exports[_0x4acf('0x3e')]=function(_0x3e4a0e,_0x52584a){var _0x2f1d23={'raw':!![],'where':{}},_0x13fac4={},_0x2378c6;return db[_0x4acf('0x22')][_0x4acf('0x3f')]({'where':{'id':_0x3e4a0e[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x52584a,null))[_0x4acf('0x17')](function(_0x51e931){if(_0x51e931){_0x2378c6=_0x51e931['get']({'plain':!![]});_0x13fac4[_0x4acf('0x32')]=_[_0x4acf('0x2e')](db[_0x4acf('0x40')][_0x4acf('0x2f')]);_0x13fac4[_0x4acf('0x29')]=_[_0x4acf('0x2e')](_0x3e4a0e[_0x4acf('0x29')]);_0x13fac4[_0x4acf('0x30')]=_[_0x4acf('0x31')](_0x13fac4[_0x4acf('0x32')],_0x13fac4[_0x4acf('0x29')]);_0x2f1d23[_0x4acf('0x41')]=_['intersection'](_0x13fac4[_0x4acf('0x32')],qs[_0x4acf('0x42')](_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0x42')]));_0x2f1d23[_0x4acf('0x41')]=_0x2f1d23[_0x4acf('0x41')][_0x4acf('0x43')]?_0x2f1d23[_0x4acf('0x41')]:_0x13fac4[_0x4acf('0x32')];if(!_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0x44')](_0x4acf('0x45'))){_0x2f1d23[_0x4acf('0x11')]=qs[_0x4acf('0x11')](_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0x11')]);_0x2f1d23['offset']=qs[_0x4acf('0xf')](_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0xf')]);}_0x2f1d23['order']=qs[_0x4acf('0x46')](_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0x46')]);_0x2f1d23[_0x4acf('0x27')]=qs['filters'](_['pick'](_0x3e4a0e['query'],_0x13fac4[_0x4acf('0x30')]));_0x2f1d23[_0x4acf('0x27')][_0x4acf('0x47')]=_0x51e931['id'];if(_0x3e4a0e['query'][_0x4acf('0x48')]){_0x2f1d23[_0x4acf('0x27')]=_['merge'](_0x2f1d23[_0x4acf('0x27')],{'$or':_[_0x4acf('0x21')](_0x2f1d23[_0x4acf('0x41')],function(_0x141e04){var _0x5405d2={};_0x5405d2[_0x141e04]={'$like':'%'+_0x3e4a0e[_0x4acf('0x29')][_0x4acf('0x48')]+'%'};return _0x5405d2;})});}_0x2f1d23=_[_0x4acf('0x49')]({},_0x2f1d23,_0x3e4a0e[_0x4acf('0x34')]);return db['UserFaxQueue'][_0x4acf('0x2a')](_0x2f1d23);}})['then'](function(_0x137220){if(_0x137220){return db['User'][_0x4acf('0x4a')]({'where':{'id':_[_0x4acf('0x21')](_0x137220,_0x4acf('0x4b')),'role':_0x4acf('0x4c')},'attributes':['id','name','faxPause','updatedAt',_0x4acf('0x4d')]});}})[_0x4acf('0x17')](function(_0x4c8d4b){if(_0x4c8d4b){return{'count':_0x4c8d4b[_0x4acf('0x12')],'rows':_[_0x4acf('0x21')](_0x4c8d4b['rows'],function(_0xd6a3b2){return{'membername':_0xd6a3b2[_0x4acf('0x1f')],'UserId':_0xd6a3b2['id'],'queue_name':_0x2378c6['name'],'FaxQueueId':_0x2378c6['id'],'interface':util[_0x4acf('0x4e')](_0x4acf('0x4f'),_0x4acf('0x50'),_0xd6a3b2['name']),'penalty':0x0,'paused':_0xd6a3b2[_0x4acf('0x51')],'createdAt':_0xd6a3b2[_0x4acf('0x4d')],'updatedAt':_0xd6a3b2[_0x4acf('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4acf('0x17')](respondWithFilteredResult(_0x52584a,_0x2f1d23))['catch'](handleError(_0x52584a,null));};exports[_0x4acf('0x53')]=function(_0x8c1c3c,_0x2fde8f){var _0x52d92a={};var _0x482d02={};var _0x234a5c;var _0x395e0f;return db[_0x4acf('0x22')][_0x4acf('0x3f')]({'where':{'id':_0x8c1c3c[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x2fde8f,null))[_0x4acf('0x17')](function(_0x27e7f4){if(_0x27e7f4){_0x234a5c=_0x27e7f4;_0x482d02[_0x4acf('0x32')]=_[_0x4acf('0x2e')](db[_0x4acf('0x54')][_0x4acf('0x2f')]);_0x482d02[_0x4acf('0x29')]=_[_0x4acf('0x2e')](_0x8c1c3c['query']);_0x482d02[_0x4acf('0x30')]=_[_0x4acf('0x31')](_0x482d02[_0x4acf('0x32')],_0x482d02[_0x4acf('0x29')]);_0x52d92a[_0x4acf('0x41')]=_[_0x4acf('0x31')](_0x482d02[_0x4acf('0x32')],qs[_0x4acf('0x42')](_0x8c1c3c['query']['fields']));_0x52d92a[_0x4acf('0x41')]=_0x52d92a['attributes'][_0x4acf('0x43')]?_0x52d92a['attributes']:_0x482d02['model'];_0x52d92a['order']=qs[_0x4acf('0x46')](_0x8c1c3c[_0x4acf('0x29')][_0x4acf('0x46')]);_0x52d92a[_0x4acf('0x27')]=qs[_0x4acf('0x30')](_[_0x4acf('0x55')](_0x8c1c3c['query'],_0x482d02['filters']));if(_0x8c1c3c['query'][_0x4acf('0x48')]){_0x52d92a[_0x4acf('0x27')]=_[_0x4acf('0x49')](_0x52d92a['where'],{'$or':_[_0x4acf('0x21')](_0x52d92a[_0x4acf('0x41')],function(_0xd72e85){var _0x114198={};_0x114198[_0xd72e85]={'$like':'%'+_0x8c1c3c[_0x4acf('0x29')][_0x4acf('0x48')]+'%'};return _0x114198;})});}_0x52d92a=_['merge']({},_0x52d92a,_0x8c1c3c[_0x4acf('0x34')]);return _0x234a5c['getTeams'](_0x52d92a);}})[_0x4acf('0x17')](function(_0x1d22ba){if(_0x1d22ba){_0x395e0f=_0x1d22ba[_0x4acf('0x43')];if(!_0x8c1c3c[_0x4acf('0x29')][_0x4acf('0x44')](_0x4acf('0x45'))){_0x52d92a[_0x4acf('0x11')]=qs[_0x4acf('0x11')](_0x8c1c3c[_0x4acf('0x29')][_0x4acf('0x11')]);_0x52d92a[_0x4acf('0xf')]=qs[_0x4acf('0xf')](_0x8c1c3c['query'][_0x4acf('0xf')]);}return _0x234a5c[_0x4acf('0x53')](_0x52d92a);}})[_0x4acf('0x17')](function(_0x155456){if(_0x155456){return _0x155456?{'count':_0x395e0f,'rows':_0x155456}:null;}})[_0x4acf('0x17')](respondWithResult(_0x2fde8f,null))[_0x4acf('0x2b')](handleError(_0x2fde8f,null));};exports[_0x4acf('0x56')]=function(_0x46c924,_0x304754){var _0x80c575=_0x46c924['body'][_0x4acf('0x57')];return db[_0x4acf('0x54')]['findAll']({'where':{'id':_0x80c575},'attributes':['id'],'include':[{'model':db[_0x4acf('0x58')],'as':_0x4acf('0x59'),'attributes':['id','name',_0x4acf('0x5a'),'voicePause','interface'],'raw':!![]}]})[_0x4acf('0x17')](function(_0x50bc20){if(_0x50bc20){var _0x22729c=_[_0x4acf('0x5b')](_0x50bc20,function(_0x13f042){var _0x2034e4=_0x13f042['get']({'plain':!![]});return _0x2034e4[_0x4acf('0x59')];});return db[_0x4acf('0x22')]['find']({'where':{'id':_0x46c924['params']['id']}})['then'](function(_0x1dd32a){return db['sequelize'][_0x4acf('0x5c')](function(_0x34ad58){return _0x1dd32a[_0x4acf('0x56')](_0x80c575,{'transaction':_0x34ad58})['then'](function(){return BPromise[_0x4acf('0x5d')](_0x22729c,function(_0x30dfed){return db['UserFaxQueue'][_0x4acf('0x5e')]({'where':{'UserId':_0x30dfed['id'],'FaxQueueId':_0x46c924[_0x4acf('0x2d')]['id']},'transaction':_0x34ad58});});})['then'](function(){_0x22729c[_0x4acf('0x5f')](function(_0x2d7cdf){socket[_0x4acf('0x60')](_0x4acf('0x61'),{'UserId':_0x2d7cdf['id'],'FaxQueueId':_0x1dd32a['id']});});});});});}})[_0x4acf('0x17')](respondWithStatusCode(_0x304754,null))[_0x4acf('0x2b')](handleError(_0x304754,null));};exports['removeTeams']=function(_0x208157,_0x59a1e8){return db[_0x4acf('0x54')][_0x4acf('0x2a')]({'where':{'id':_0x208157['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4acf('0x59'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59a1e8,null))['then'](function(_0x51ddb0){var _0x25b078=_['map'](_0x51ddb0,'id');var _0x3b21ed=[];var _0x375be6=[];var _0x25ea71=squel[_0x4acf('0x62')]();_0x25ea71[_0x4acf('0x63')]('tq.TeamId')['from'](_0x4acf('0x64'),'tq')[_0x4acf('0x65')](_0x4acf('0x66'),'ut',_0x4acf('0x67'))[_0x4acf('0x27')]('FaxQueueId\x20=\x20?',_0x208157[_0x4acf('0x2d')]['id']);for(var _0x455887=0x0;_0x455887<_0x51ddb0[_0x4acf('0x43')];_0x455887+=0x1){let _0x453c6d=_0x51ddb0[_0x455887];for(var _0x1a82e7=0x0;_0x1a82e7<_0x453c6d[_0x4acf('0x59')][_0x4acf('0x43')];_0x1a82e7+=0x1){let _0x5b3925=_0x453c6d[_0x4acf('0x59')][_0x1a82e7];var _0x55b14d=_0x25ea71[_0x4acf('0x68')]();_0x55b14d[_0x4acf('0x27')](_0x4acf('0x69'),_0x5b3925['id']);_0x375be6[_0x4acf('0x6a')](db[_0x4acf('0x6b')]['query'](_0x55b14d[_0x4acf('0x6c')](),{'type':db['sequelize'][_0x4acf('0x6d')][_0x4acf('0x6e')]})['then'](function(_0x46a402){if(_0x46a402[_0x4acf('0x43')]===0x1){return _0x5b3925['id'];}else{var _0x2cddf3=_[_0x4acf('0x6f')](_[_0x4acf('0x21')](_0x46a402,'TeamId'),function(_0x203f59){return _['includes'](_0x25b078,_0x203f59);});if(_0x2cddf3){return _0x5b3925['id'];}}}));}}return BPromise['all'](_0x375be6)[_0x4acf('0x17')](function(_0x46f88f){_0x3b21ed=_(_0x3b21ed)[_0x4acf('0x70')](_0x46f88f)[_0x4acf('0x71')]()['value']();return db['FaxQueue'][_0x4acf('0x35')]({'where':{'id':_0x208157[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](function(_0xe86c1f){return db[_0x4acf('0x6b')][_0x4acf('0x5c')](function(_0x4446fe){return _0xe86c1f[_0x4acf('0x72')](_0x208157['query']['ids'],{'transaction':_0x4446fe})[_0x4acf('0x17')](function(){if(!_[_0x4acf('0x73')](_0x3b21ed)){return _0xe86c1f[_0x4acf('0x74')](_0x3b21ed,{'transaction':_0x4446fe});}})[_0x4acf('0x17')](function(){_0x3b21ed[_0x4acf('0x5f')](function(_0x40acb1){socket[_0x4acf('0x60')](_0x4acf('0x75'),{'UserId':_0x40acb1,'FaxQueueId':_0xe86c1f['id']});});});});});});})[_0x4acf('0x17')](respondWithStatusCode(_0x59a1e8,null))['catch'](handleError(_0x59a1e8,null));};exports[_0x4acf('0x76')]=function(_0x3b3fef,_0x179935){return db[_0x4acf('0x22')][_0x4acf('0x35')]({'where':{'id':_0x3b3fef[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x179935,null))[_0x4acf('0x17')](function(_0x37870c){if(_0x37870c){return _0x37870c[_0x4acf('0x76')](_0x3b3fef[_0x4acf('0x3d')][_0x4acf('0x57')],_[_0x4acf('0x77')](_0x3b3fef['body'],[_0x4acf('0x57'),'id'])||{})['spread'](function(_0x327a21){for(var _0x322e45=0x0;_0x322e45<_0x3b3fef['body'][_0x4acf('0x57')][_0x4acf('0x43')];_0x322e45+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x3b3fef[_0x4acf('0x3d')][_0x4acf('0x57')][_0x322e45]),'FaxQueueId':Number(_0x3b3fef['params']['id'])});}return _0x327a21;});}})['then'](respondWithResult(_0x179935,null))[_0x4acf('0x2b')](handleError(_0x179935,null));};exports[_0x4acf('0x74')]=function(_0x26fed7,_0x201bc9){return db['FaxQueue'][_0x4acf('0x35')]({'where':{'id':_0x26fed7[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x201bc9,null))[_0x4acf('0x17')](function(_0x43e9bf){if(_0x43e9bf){return _0x43e9bf[_0x4acf('0x74')](_0x26fed7[_0x4acf('0x29')]['ids'])[_0x4acf('0x17')](function(){if(_[_0x4acf('0x78')](_0x26fed7[_0x4acf('0x29')]['ids'])){for(var _0x40cccb=0x0;_0x40cccb<_0x26fed7[_0x4acf('0x29')][_0x4acf('0x57')][_0x4acf('0x43')];_0x40cccb+=0x1){socket[_0x4acf('0x60')](_0x4acf('0x75'),{'UserId':Number(_0x26fed7[_0x4acf('0x29')][_0x4acf('0x57')][_0x40cccb]),'FaxQueueId':Number(_0x26fed7['params']['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x26fed7['query']['ids']),'FaxQueueId':Number(_0x26fed7[_0x4acf('0x2d')]['id'])});}});}})['then'](respondWithStatusCode(_0x201bc9,null))[_0x4acf('0x2b')](handleError(_0x201bc9,null));};exports[_0x4acf('0x79')]=function(_0x59596e,_0x341f2c){var _0x14ef45={};var _0x1e08cf={};var _0x35ddbc;var _0x10df25;return db[_0x4acf('0x22')][_0x4acf('0x3f')]({'where':{'id':_0x59596e[_0x4acf('0x2d')]['id']}})[_0x4acf('0x17')](handleEntityNotFound(_0x341f2c,null))[_0x4acf('0x17')](function(_0x2d2240){if(_0x2d2240){_0x35ddbc=_0x2d2240;_0x1e08cf[_0x4acf('0x32')]=_[_0x4acf('0x2e')](db[_0x4acf('0x58')][_0x4acf('0x2f')]);_0x1e08cf[_0x4acf('0x29')]=_[_0x4acf('0x2e')](_0x59596e['query']);_0x1e08cf['filters']=_[_0x4acf('0x31')](_0x1e08cf[_0x4acf('0x32')],_0x1e08cf[_0x4acf('0x29')]);_0x14ef45[_0x4acf('0x41')]=_[_0x4acf('0x31')](_0x1e08cf[_0x4acf('0x32')],qs[_0x4acf('0x42')](_0x59596e[_0x4acf('0x29')][_0x4acf('0x42')]));_0x14ef45[_0x4acf('0x41')]=_0x14ef45[_0x4acf('0x41')][_0x4acf('0x43')]?_0x14ef45['attributes']:_0x1e08cf['model'];_0x14ef45[_0x4acf('0x7a')]=qs[_0x4acf('0x46')](_0x59596e[_0x4acf('0x29')][_0x4acf('0x46')]);_0x14ef45[_0x4acf('0x27')]=qs[_0x4acf('0x30')](_['pick'](_0x59596e[_0x4acf('0x29')],_0x1e08cf[_0x4acf('0x30')]));if(_0x59596e[_0x4acf('0x29')]['filter']){_0x14ef45[_0x4acf('0x27')]=_[_0x4acf('0x49')](_0x14ef45[_0x4acf('0x27')],{'$or':_[_0x4acf('0x21')](_0x14ef45[_0x4acf('0x41')],function(_0x20cdb4){var _0xfc9508={};_0xfc9508[_0x20cdb4]={'$like':'%'+_0x59596e[_0x4acf('0x29')][_0x4acf('0x48')]+'%'};return _0xfc9508;})});}_0x14ef45=_['merge']({},_0x14ef45,_0x59596e[_0x4acf('0x34')]);return _0x35ddbc['getAgents'](_0x14ef45);}})['then'](function(_0xfd74f){if(_0xfd74f){_0x10df25=_0xfd74f[_0x4acf('0x43')];if(!_0x59596e[_0x4acf('0x29')][_0x4acf('0x44')](_0x4acf('0x45'))){_0x14ef45[_0x4acf('0x11')]=qs[_0x4acf('0x11')](_0x59596e[_0x4acf('0x29')]['limit']);_0x14ef45[_0x4acf('0xf')]=qs[_0x4acf('0xf')](_0x59596e[_0x4acf('0x29')][_0x4acf('0xf')]);}return _0x35ddbc[_0x4acf('0x79')](_0x14ef45);}})[_0x4acf('0x17')](function(_0x499214){if(_0x499214){return _0x499214?{'count':_0x10df25,'rows':_0x499214}:null;}})[_0x4acf('0x17')](respondWithResult(_0x341f2c,null))[_0x4acf('0x2b')](handleError(_0x341f2c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index def0cc4..b9c5035 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 _0x2203=['emit','hasOwnProperty','exports','../../mysqldb','remove'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x2203,0x139));var _0x3220=function(_0x5bc95c,_0xfed759){_0x5bc95c=_0x5bc95c-0x0;var _0x3721fc=_0x2203[_0x5bc95c];return _0x3721fc;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3220('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3220('0x1')};function emitEvent(_0x350d9f){return function(_0xb083e5,_0x361174,_0x2adc7e){FaxQueueEvents['emit'](_0x350d9f+':'+_0xb083e5['id'],_0xb083e5);FaxQueueEvents[_0x3220('0x2')](_0x350d9f,_0xb083e5);_0x2adc7e(null);};}for(var e in events){if(events[_0x3220('0x3')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3220('0x4')]=FaxQueueEvents; \ No newline at end of file +var _0xe214=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0xc51cc6,_0x221ed5){var _0x30ed2c=function(_0x2ba766){while(--_0x2ba766){_0xc51cc6['push'](_0xc51cc6['shift']());}};_0x30ed2c(++_0x221ed5);}(_0xe214,0x9b));var _0x4e21=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe214[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x4e21('0x0'));var FaxQueue=require(_0x4e21('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4e21('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e21('0x3'),'afterDestroy':_0x4e21('0x4')};function emitEvent(_0x43333a){return function(_0x4a03e4,_0x52b9a0,_0x3490ab){FaxQueueEvents[_0x4e21('0x5')](_0x43333a+':'+_0x4a03e4['id'],_0x4a03e4);FaxQueueEvents[_0x4e21('0x5')](_0x43333a,_0x4a03e4);_0x3490ab(null);};}for(var e in events){if(events[_0x4e21('0x6')](e)){var event=events[e];FaxQueue[_0x4e21('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9ddc1d3..cb50c4e 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 _0x12c5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger'];(function(_0x24a03e,_0x69f19d){var _0x13f38f=function(_0x183407){while(--_0x183407){_0x24a03e['push'](_0x24a03e['shift']());}};_0x13f38f(++_0x69f19d);}(_0x12c5,0xc1));var _0x512c=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x12c5[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x512c('0x0'));var util=require(_0x512c('0x1'));var logger=require(_0x512c('0x2'))(_0x512c('0x3'));var moment=require(_0x512c('0x4'));var BPromise=require(_0x512c('0x5'));var rp=require(_0x512c('0x6'));var fs=require('fs');var path=require(_0x512c('0x7'));var rimraf=require(_0x512c('0x8'));var config=require(_0x512c('0x9'));var attributes=require(_0x512c('0xa'));module[_0x512c('0xb')]=function(_0x417eae,_0xcf9965){return _0x417eae[_0x512c('0xc')]('FaxQueue',attributes,{'tableName':_0x512c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e55=['bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','api','moment'];(function(_0x334c5e,_0x29d196){var _0x31035e=function(_0x135f9b){while(--_0x135f9b){_0x334c5e['push'](_0x334c5e['shift']());}};_0x31035e(++_0x29d196);}(_0x4e55,0x1b6));var _0x54e5=function(_0x1b8032,_0x283aae){_0x1b8032=_0x1b8032-0x0;var _0x1762a3=_0x4e55[_0x1b8032];return _0x1762a3;};'use strict';var _=require(_0x54e5('0x0'));var util=require('util');var logger=require(_0x54e5('0x1'))(_0x54e5('0x2'));var moment=require(_0x54e5('0x3'));var BPromise=require(_0x54e5('0x4'));var rp=require(_0x54e5('0x5'));var fs=require('fs');var path=require(_0x54e5('0x6'));var rimraf=require(_0x54e5('0x7'));var config=require('../../config/environment');var attributes=require(_0x54e5('0x8'));module[_0x54e5('0x9')]=function(_0xa30d1f,_0x38d0e0){return _0xa30d1f[_0x54e5('0xa')](_0x54e5('0xb'),attributes,{'tableName':_0x54e5('0xc'),'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 ff8024a..d0adf79 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 _0x7b51=['localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','include','model','attributes','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x317935,_0x2ce30c){var _0x297a24=function(_0x304a24){while(--_0x304a24){_0x317935['push'](_0x317935['shift']());}};_0x297a24(++_0x2ce30c);}(_0x7b51,0x196));var _0x17b5=function(_0x47f7f5,_0xa5caf){_0x47f7f5=_0x47f7f5-0x0;var _0x52fe6b=_0x7b51[_0x47f7f5];return _0x52fe6b;};'use strict';var _=require(_0x17b5('0x0'));var util=require(_0x17b5('0x1'));var moment=require(_0x17b5('0x2'));var BPromise=require(_0x17b5('0x3'));var rs=require(_0x17b5('0x4'));var fs=require('fs');var Redis=require(_0x17b5('0x5'));var db=require(_0x17b5('0x6'))['db'];var utils=require(_0x17b5('0x7'));var logger=require('../../config/logger')(_0x17b5('0x8'));var config=require(_0x17b5('0x9'));var jayson=require(_0x17b5('0xa'));var client=jayson['client'][_0x17b5('0xb')]({'port':0x232a});config[_0x17b5('0xc')]=_[_0x17b5('0xd')](config[_0x17b5('0xc')],{'host':_0x17b5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17b5('0xc')]));require(_0x17b5('0xf'))[_0x17b5('0x10')](socket);function respondWithRpcPromise(_0x227896,_0x375df5,_0x1c63da){return new BPromise(function(_0x141e02,_0x16a8c9){return client[_0x17b5('0x11')](_0x227896,_0x1c63da)[_0x17b5('0x12')](function(_0x54b9b3){logger[_0x17b5('0x13')](_0x17b5('0x14'),_0x375df5,'request\x20sent');logger['debug'](_0x17b5('0x15'),_0x375df5,_0x17b5('0x16'),JSON[_0x17b5('0x17')](_0x54b9b3));if(_0x54b9b3[_0x17b5('0x18')]){if(_0x54b9b3[_0x17b5('0x18')][_0x17b5('0x19')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x375df5,_0x54b9b3['error']['message']);return _0x16a8c9(_0x54b9b3['error'][_0x17b5('0x1a')]);}logger[_0x17b5('0x18')](_0x17b5('0x14'),_0x375df5,_0x54b9b3[_0x17b5('0x18')][_0x17b5('0x1a')]);return _0x141e02(_0x54b9b3['error'][_0x17b5('0x1a')]);}else{logger[_0x17b5('0x13')](_0x17b5('0x14'),_0x375df5,'request\x20sent');_0x141e02(_0x54b9b3[_0x17b5('0x1b')]['message']);}})[_0x17b5('0x1c')](function(_0x10e88c){logger['error'](_0x17b5('0x14'),_0x375df5,_0x10e88c);_0x16a8c9(_0x10e88c);});});}exports[_0x17b5('0x1d')]=function(_0x6e6ecf){var _0x5c454b=this;return new Promise(function(_0x4f69e9,_0x399825){return db[_0x17b5('0x1e')][_0x17b5('0x1f')]({'raw':_0x6e6ecf[_0x17b5('0x20')]?_0x6e6ecf['options'][_0x17b5('0x21')]===undefined?!![]:![]:!![],'where':_0x6e6ecf[_0x17b5('0x20')]?_0x6e6ecf[_0x17b5('0x20')][_0x17b5('0x22')]||null:null,'attributes':_0x6e6ecf['options']?_0x6e6ecf['options']['attributes']||null:null,'limit':_0x6e6ecf[_0x17b5('0x20')]?_0x6e6ecf[_0x17b5('0x20')][_0x17b5('0x23')]||null:null,'include':_0x6e6ecf[_0x17b5('0x20')]?_0x6e6ecf['options']['include']?_[_0x17b5('0x24')](_0x6e6ecf[_0x17b5('0x20')][_0x17b5('0x25')],function(_0x54405c){return{'model':db[_0x54405c[_0x17b5('0x26')]],'as':_0x54405c['as'],'attributes':_0x54405c[_0x17b5('0x27')],'include':_0x54405c[_0x17b5('0x25')]?_['map'](_0x54405c[_0x17b5('0x25')],function(_0x27f345){return{'model':db[_0x27f345['model']],'as':_0x27f345['as'],'attributes':_0x27f345[_0x17b5('0x27')],'include':_0x27f345['include']?_[_0x17b5('0x24')](_0x27f345['include'],function(_0x53c788){return{'model':db[_0x53c788[_0x17b5('0x26')]],'as':_0x53c788['as'],'attributes':_0x53c788['attributes']};}):[]};}):[]};}):[]:[]})[_0x17b5('0x12')](function(_0x414e52){logger[_0x17b5('0x13')](_0x17b5('0x1d'),_0x6e6ecf);logger['debug'](_0x17b5('0x1d'),_0x6e6ecf,JSON[_0x17b5('0x17')](_0x414e52));_0x4f69e9(_0x414e52);})['catch'](function(_0x3970d3){logger[_0x17b5('0x18')](_0x17b5('0x1d'),_0x3970d3['message'],_0x6e6ecf);_0x399825(_0x5c454b[_0x17b5('0x18')](0x1f4,_0x3970d3[_0x17b5('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x160286){var _0x3408bf=this;return new Promise(function(_0x5ef980,_0x34bffb){return db[_0x17b5('0x1e')][_0x17b5('0x28')]({'raw':_0x160286['options']?_0x160286[_0x17b5('0x20')][_0x17b5('0x21')]===undefined?!![]:![]:!![],'where':_0x160286[_0x17b5('0x20')]?_0x160286[_0x17b5('0x20')]['where']||null:null,'attributes':_0x160286[_0x17b5('0x20')]?_0x160286[_0x17b5('0x20')][_0x17b5('0x27')]||null:null,'include':_0x160286[_0x17b5('0x20')]?_0x160286['options'][_0x17b5('0x25')]?_[_0x17b5('0x24')](_0x160286[_0x17b5('0x20')]['include'],function(_0x4df6b2){return{'model':db[_0x4df6b2[_0x17b5('0x26')]],'as':_0x4df6b2['as'],'attributes':_0x4df6b2[_0x17b5('0x27')],'include':_0x4df6b2[_0x17b5('0x25')]?_['map'](_0x4df6b2[_0x17b5('0x25')],function(_0x49db73){return{'model':db[_0x49db73[_0x17b5('0x26')]],'as':_0x49db73['as'],'attributes':_0x49db73['attributes'],'include':_0x49db73[_0x17b5('0x25')]?_[_0x17b5('0x24')](_0x49db73['include'],function(_0x5549ee){return{'model':db[_0x5549ee['model']],'as':_0x5549ee['as'],'attributes':_0x5549ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x17b5('0x12')](function(_0x4bf40b){logger[_0x17b5('0x13')](_0x17b5('0x29'),_0x160286);logger['debug'](_0x17b5('0x29'),_0x160286,JSON[_0x17b5('0x17')](_0x4bf40b));_0x5ef980(_0x4bf40b);})[_0x17b5('0x1c')](function(_0x4c1d2e){logger['error']('ShowFaxQueue',_0x4c1d2e['message'],_0x160286);_0x34bffb(_0x3408bf[_0x17b5('0x18')](0x1f4,_0x4c1d2e[_0x17b5('0x1a')]));});});}; \ No newline at end of file +var _0xa6ae=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','GetFaxQueue','stringify','ShowFaxQueue','find','where'];(function(_0x2ea5d6,_0x2ef3e7){var _0x20dcb3=function(_0x22ed56){while(--_0x22ed56){_0x2ea5d6['push'](_0x2ea5d6['shift']());}};_0x20dcb3(++_0x2ef3e7);}(_0xa6ae,0x171));var _0xea6a=function(_0x2d959a,_0x4d8b26){_0x2d959a=_0x2d959a-0x0;var _0x2fa8d6=_0xa6ae[_0x2d959a];return _0x2fa8d6;};'use strict';var _=require(_0xea6a('0x0'));var util=require('util');var moment=require(_0xea6a('0x1'));var BPromise=require(_0xea6a('0x2'));var rs=require(_0xea6a('0x3'));var fs=require('fs');var Redis=require(_0xea6a('0x4'));var db=require(_0xea6a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea6a('0x6'))(_0xea6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xea6a('0x8'));var client=jayson[_0xea6a('0x9')][_0xea6a('0xa')]({'port':0x232a});config[_0xea6a('0xb')]=_[_0xea6a('0xc')](config[_0xea6a('0xb')],{'host':_0xea6a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea6a('0xb')]));require(_0xea6a('0xe'))['register'](socket);function respondWithRpcPromise(_0x2636df,_0x3490f4,_0x1cb670){return new BPromise(function(_0x224fdf,_0xd46685){return client[_0xea6a('0xf')](_0x2636df,_0x1cb670)[_0xea6a('0x10')](function(_0xf3d3b3){logger[_0xea6a('0x11')](_0xea6a('0x12'),_0x3490f4,_0xea6a('0x13'));logger[_0xea6a('0x14')](_0xea6a('0x15'),_0x3490f4,'request\x20sent',JSON['stringify'](_0xf3d3b3));if(_0xf3d3b3[_0xea6a('0x16')]){if(_0xf3d3b3[_0xea6a('0x16')][_0xea6a('0x17')]===0x1f4){logger[_0xea6a('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3490f4,_0xf3d3b3[_0xea6a('0x16')][_0xea6a('0x18')]);return _0xd46685(_0xf3d3b3[_0xea6a('0x16')]['message']);}logger[_0xea6a('0x16')](_0xea6a('0x12'),_0x3490f4,_0xf3d3b3[_0xea6a('0x16')][_0xea6a('0x18')]);return _0x224fdf(_0xf3d3b3['error']['message']);}else{logger[_0xea6a('0x11')](_0xea6a('0x12'),_0x3490f4,'request\x20sent');_0x224fdf(_0xf3d3b3[_0xea6a('0x19')][_0xea6a('0x18')]);}})[_0xea6a('0x1a')](function(_0x4b669e){logger[_0xea6a('0x16')](_0xea6a('0x12'),_0x3490f4,_0x4b669e);_0xd46685(_0x4b669e);});});}exports['GetFaxQueue']=function(_0xecee02){var _0x3095d3=this;return new Promise(function(_0x19f41e,_0x3ee252){return db[_0xea6a('0x1b')][_0xea6a('0x1c')]({'raw':_0xecee02[_0xea6a('0x1d')]?_0xecee02[_0xea6a('0x1d')][_0xea6a('0x1e')]===undefined?!![]:![]:!![],'where':_0xecee02[_0xea6a('0x1d')]?_0xecee02[_0xea6a('0x1d')]['where']||null:null,'attributes':_0xecee02['options']?_0xecee02[_0xea6a('0x1d')][_0xea6a('0x1f')]||null:null,'limit':_0xecee02[_0xea6a('0x1d')]?_0xecee02['options'][_0xea6a('0x20')]||null:null,'include':_0xecee02['options']?_0xecee02[_0xea6a('0x1d')][_0xea6a('0x21')]?_[_0xea6a('0x22')](_0xecee02[_0xea6a('0x1d')][_0xea6a('0x21')],function(_0x197677){return{'model':db[_0x197677[_0xea6a('0x23')]],'as':_0x197677['as'],'attributes':_0x197677['attributes'],'include':_0x197677[_0xea6a('0x21')]?_[_0xea6a('0x22')](_0x197677[_0xea6a('0x21')],function(_0x58cf3a){return{'model':db[_0x58cf3a[_0xea6a('0x23')]],'as':_0x58cf3a['as'],'attributes':_0x58cf3a[_0xea6a('0x1f')],'include':_0x58cf3a[_0xea6a('0x21')]?_[_0xea6a('0x22')](_0x58cf3a[_0xea6a('0x21')],function(_0x460653){return{'model':db[_0x460653[_0xea6a('0x23')]],'as':_0x460653['as'],'attributes':_0x460653[_0xea6a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xea6a('0x10')](function(_0x1b82fd){logger['info'](_0xea6a('0x24'),_0xecee02);logger[_0xea6a('0x14')](_0xea6a('0x24'),_0xecee02,JSON[_0xea6a('0x25')](_0x1b82fd));_0x19f41e(_0x1b82fd);})[_0xea6a('0x1a')](function(_0x4bd7c4){logger[_0xea6a('0x16')](_0xea6a('0x24'),_0x4bd7c4[_0xea6a('0x18')],_0xecee02);_0x3ee252(_0x3095d3[_0xea6a('0x16')](0x1f4,_0x4bd7c4[_0xea6a('0x18')]));});});};exports[_0xea6a('0x26')]=function(_0x12ec56){var _0xe81c05=this;return new Promise(function(_0x4cef51,_0x45b31d){return db[_0xea6a('0x1b')][_0xea6a('0x27')]({'raw':_0x12ec56[_0xea6a('0x1d')]?_0x12ec56[_0xea6a('0x1d')][_0xea6a('0x1e')]===undefined?!![]:![]:!![],'where':_0x12ec56[_0xea6a('0x1d')]?_0x12ec56[_0xea6a('0x1d')][_0xea6a('0x28')]||null:null,'attributes':_0x12ec56[_0xea6a('0x1d')]?_0x12ec56[_0xea6a('0x1d')][_0xea6a('0x1f')]||null:null,'include':_0x12ec56[_0xea6a('0x1d')]?_0x12ec56[_0xea6a('0x1d')][_0xea6a('0x21')]?_[_0xea6a('0x22')](_0x12ec56[_0xea6a('0x1d')]['include'],function(_0x4ee7f5){return{'model':db[_0x4ee7f5[_0xea6a('0x23')]],'as':_0x4ee7f5['as'],'attributes':_0x4ee7f5[_0xea6a('0x1f')],'include':_0x4ee7f5[_0xea6a('0x21')]?_[_0xea6a('0x22')](_0x4ee7f5[_0xea6a('0x21')],function(_0x3c54c4){return{'model':db[_0x3c54c4[_0xea6a('0x23')]],'as':_0x3c54c4['as'],'attributes':_0x3c54c4[_0xea6a('0x1f')],'include':_0x3c54c4[_0xea6a('0x21')]?_['map'](_0x3c54c4['include'],function(_0x3f74de){return{'model':db[_0x3f74de['model']],'as':_0x3f74de['as'],'attributes':_0x3f74de['attributes']};}):[]};}):[]};}):[]:[]})[_0xea6a('0x10')](function(_0x4d96e9){logger[_0xea6a('0x11')]('ShowFaxQueue',_0x12ec56);logger[_0xea6a('0x14')]('ShowFaxQueue',_0x12ec56,JSON[_0xea6a('0x25')](_0x4d96e9));_0x4cef51(_0x4d96e9);})[_0xea6a('0x1a')](function(_0x4441e6){logger[_0xea6a('0x16')](_0xea6a('0x26'),_0x4441e6[_0xea6a('0x18')],_0x12ec56);_0x45b31d(_0xe81c05[_0xea6a('0x16')](0x1f4,_0x4441e6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 069e169..6d4797a 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 _0x8d19=['./faxQueue.events','save','update','emit','removeListener','length','faxQueue:'];(function(_0x419061,_0x163dea){var _0x407329=function(_0x52f29d){while(--_0x52f29d){_0x419061['push'](_0x419061['shift']());}};_0x407329(++_0x163dea);}(_0x8d19,0x142));var _0x98d1=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x8d19[_0x210718];return _0x541bfc;};'use strict';var FaxQueueEvents=require(_0x98d1('0x0'));var events=[_0x98d1('0x1'),'remove',_0x98d1('0x2')];function createListener(_0x3e5d36,_0x1ff67a){return function(_0x428e7e){_0x1ff67a[_0x98d1('0x3')](_0x3e5d36,_0x428e7e);};}function removeListener(_0xfcfe7b,_0x1f0517){return function(){FaxQueueEvents[_0x98d1('0x4')](_0xfcfe7b,_0x1f0517);};}exports['register']=function(_0x5be1df){for(var _0x497392=0x0,_0x3acff4=events[_0x98d1('0x5')];_0x497392<_0x3acff4;_0x497392++){var _0x159547=events[_0x497392];var _0x462f5f=createListener(_0x98d1('0x6')+_0x159547,_0x5be1df);FaxQueueEvents['on'](_0x159547,_0x462f5f);}}; \ No newline at end of file +var _0xc741=['./faxQueue.events','save','remove','update','emit','removeListener','faxQueue:'];(function(_0x314c1d,_0x3fba0c){var _0x511529=function(_0xf49646){while(--_0xf49646){_0x314c1d['push'](_0x314c1d['shift']());}};_0x511529(++_0x3fba0c);}(_0xc741,0xe7));var _0x1c74=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xc741[_0x4ae6ef];return _0x3cbb4e;};'use strict';var FaxQueueEvents=require(_0x1c74('0x0'));var events=[_0x1c74('0x1'),_0x1c74('0x2'),_0x1c74('0x3')];function createListener(_0x405405,_0x29ebc0){return function(_0x3054bb){_0x29ebc0[_0x1c74('0x4')](_0x405405,_0x3054bb);};}function removeListener(_0x1785e3,_0x15193c){return function(){FaxQueueEvents[_0x1c74('0x5')](_0x1785e3,_0x15193c);};}exports['register']=function(_0x169fbc){for(var _0x1fb5f0=0x0,_0x3abc3d=events['length'];_0x1fb5f0<_0x3abc3d;_0x1fb5f0++){var _0x508c9d=events[_0x1fb5f0];var _0x56ef07=createListener(_0x1c74('0x6')+_0x508c9d,_0x169fbc);FaxQueueEvents['on'](_0x508c9d,_0x56ef07);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 04c84b5..3af65e2 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 _0x4745=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x35233f,_0x409b6b){var _0xc482ff=function(_0xc2e8e4){while(--_0xc2e8e4){_0x35233f['push'](_0x35233f['shift']());}};_0xc482ff(++_0x409b6b);}(_0x4745,0x1e7));var _0x5474=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x4745[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/describe',auth[_0x5474('0xd')](),controller['describe']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0xb')](_0x5474('0x10'),auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0xb')](_0x5474('0x12'),auth[_0x5474('0xd')](),controller['getTeams']);router[_0x5474('0xb')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller[_0x5474('0x14')]);router[_0x5474('0x15')]('/',auth[_0x5474('0xd')](),controller[_0x5474('0x16')]);router[_0x5474('0x15')](_0x5474('0x12'),auth['isAuthenticated'](),controller[_0x5474('0x17')]);router[_0x5474('0x15')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5474('0x18')]);router[_0x5474('0x19')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0x1a')]);router[_0x5474('0x19')]('/:id/teams',auth[_0x5474('0xd')](),controller[_0x5474('0x1b')]);router[_0x5474('0x19')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['removeAgents']);module[_0x5474('0x1c')]=router; \ No newline at end of file +var _0xd9fb=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd9fb,0x189));var _0xbd9f=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xd9fb[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var path=require(_0xbd9f('0x2'));var timeout=require(_0xbd9f('0x3'));var express=require(_0xbd9f('0x4'));var router=express[_0xbd9f('0x5')]();var fs_extra=require(_0xbd9f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var controller=require('./faxQueue.controller');router[_0xbd9f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd9f('0xa')]);router[_0xbd9f('0x9')]('/describe',auth[_0xbd9f('0xb')](),controller[_0xbd9f('0xc')]);router[_0xbd9f('0x9')](_0xbd9f('0xd'),auth['isAuthenticated'](),controller[_0xbd9f('0xe')]);router[_0xbd9f('0x9')](_0xbd9f('0xf'),auth[_0xbd9f('0xb')](),controller[_0xbd9f('0x10')]);router[_0xbd9f('0x9')](_0xbd9f('0x11'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0xbd9f('0xb')](),controller['getAgents']);router[_0xbd9f('0x12')]('/',auth[_0xbd9f('0xb')](),controller[_0xbd9f('0x13')]);router['post'](_0xbd9f('0x11'),auth['isAuthenticated'](),controller[_0xbd9f('0x14')]);router[_0xbd9f('0x12')](_0xbd9f('0x15'),auth[_0xbd9f('0xb')](),controller['addAgents']);router[_0xbd9f('0x16')](_0xbd9f('0xd'),auth[_0xbd9f('0xb')](),controller[_0xbd9f('0x17')]);router[_0xbd9f('0x18')](_0xbd9f('0xd'),auth[_0xbd9f('0xb')](),controller['destroy']);router['delete'](_0xbd9f('0x11'),auth['isAuthenticated'](),controller[_0xbd9f('0x19')]);router[_0xbd9f('0x18')](_0xbd9f('0x15'),auth[_0xbd9f('0xb')](),controller[_0xbd9f('0x1a')]);module[_0xbd9f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e80f61d..1d7a438 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 _0xbac0=['exports','STRING','DATE','moment'];(function(_0x108a83,_0x4bab1d){var _0x1c1785=function(_0x4c227e){while(--_0x4c227e){_0x108a83['push'](_0x108a83['shift']());}};_0x1c1785(++_0x4bab1d);}(_0xbac0,0x12b));var _0x0bac=function(_0xb1b616,_0x3b9023){_0xb1b616=_0xb1b616-0x0;var _0x1259b0=_0xbac0[_0xb1b616];return _0x1259b0;};'use strict';var moment=require(_0x0bac('0x0'));var Sequelize=require('sequelize');module[_0x0bac('0x1')]={'uniqueid':{'type':Sequelize[_0x0bac('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0bac('0x2')]},'joinAt':{'type':Sequelize[_0x0bac('0x3')]},'leaveAt':{'type':Sequelize[_0x0bac('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0bac('0x3')]},'reason':{'type':Sequelize[_0x0bac('0x2')]}}; \ No newline at end of file +var _0x9ea2=['moment','STRING','DATE'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x9ea2,0x147));var _0x29ea=function(_0x5938e6,_0x2c6dd0){_0x5938e6=_0x5938e6-0x0;var _0x4aae35=_0x9ea2[_0x5938e6];return _0x4aae35;};'use strict';var moment=require(_0x29ea('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x29ea('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x29ea('0x2')]},'leaveAt':{'type':Sequelize[_0x29ea('0x2')]},'acceptAt':{'type':Sequelize[_0x29ea('0x2')]},'exitAt':{'type':Sequelize[_0x29ea('0x2')]},'reason':{'type':Sequelize[_0x29ea('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 6dc960f..2adb68e 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 _0x4517=['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/license/util','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','filters','filter','where','merge','options','include','show','params','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x4517,0x112));var _0x7451=function(_0x2a2b03,_0x5f56cd){_0x2a2b03=_0x2a2b03-0x0;var _0x24a88e=_0x4517[_0x2a2b03];return _0x24a88e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7451('0x0'));var zipdir=require(_0x7451('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7451('0x2'));var moment=require(_0x7451('0x3'));var BPromise=require(_0x7451('0x4'));var Mustache=require(_0x7451('0x5'));var util=require(_0x7451('0x6'));var path=require(_0x7451('0x7'));var sox=require(_0x7451('0x8'));var csv=require(_0x7451('0x9'));var ejs=require(_0x7451('0xa'));var fs=require('fs');var fs_extra=require(_0x7451('0xb'));var _=require(_0x7451('0xc'));var squel=require(_0x7451('0xd'));var crypto=require(_0x7451('0xe'));var jsforce=require(_0x7451('0xf'));var deskjs=require(_0x7451('0x10'));var toCsv=require(_0x7451('0x9'));var querystring=require(_0x7451('0x11'));var Papa=require('papaparse');var Redis=require(_0x7451('0x12'));var authService=require(_0x7451('0x13'));var qs=require(_0x7451('0x14'));var as=require(_0x7451('0x15'));var hardwareService=require(_0x7451('0x16'));var logger=require(_0x7451('0x17'))(_0x7451('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7451('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450463,_0x2cb40b){_0x2cb40b=_0x2cb40b||0xcc;return function(_0x4a14dc){if(_0x4a14dc){return _0x450463[_0x7451('0x1a')](_0x2cb40b);}return _0x450463[_0x7451('0x1b')](_0x2cb40b)['end']();};}function respondWithResult(_0x46811e,_0x282128){_0x282128=_0x282128||0xc8;return function(_0x110ed6){if(_0x110ed6){return _0x46811e[_0x7451('0x1b')](_0x282128)['json'](_0x110ed6);}};}function respondWithFilteredResult(_0x357ea9,_0x313385){return function(_0x408336){if(_0x408336){var _0x58c0cd=typeof _0x313385['offset']===_0x7451('0x1c')&&typeof _0x313385[_0x7451('0x1d')]===_0x7451('0x1c');var _0xa8a121=_0x408336[_0x7451('0x1e')];var _0xd47ee4=_0x58c0cd?0x0:_0x313385[_0x7451('0x1f')];var _0x1120b1=_0x58c0cd?_0x408336[_0x7451('0x1e')]:_0x313385['offset']+_0x313385[_0x7451('0x1d')];var _0x32e250;if(_0x1120b1>=_0xa8a121){_0x1120b1=_0xa8a121;_0x32e250=0xc8;}else{_0x32e250=0xce;}_0x357ea9[_0x7451('0x1b')](_0x32e250);return _0x357ea9['set'](_0x7451('0x20'),_0xd47ee4+'-'+_0x1120b1+'/'+_0xa8a121)[_0x7451('0x21')](_0x408336);}return null;};}function patchUpdates(_0x3ffb08){return function(_0x3b5d59){try{jsonpatch[_0x7451('0x22')](_0x3b5d59,_0x3ffb08,!![]);}catch(_0x293e29){return BPromise[_0x7451('0x23')](_0x293e29);}return _0x3b5d59['save']();};}function saveUpdates(_0x3a0c1e,_0x309be0){return function(_0x561e12){if(_0x561e12){return _0x561e12[_0x7451('0x24')](_0x3a0c1e)[_0x7451('0x25')](function(_0x2962f8){return _0x2962f8;});}return null;};}function removeEntity(_0x57cc15,_0x19e33b){return function(_0x21dd67){if(_0x21dd67){return _0x21dd67[_0x7451('0x26')]()[_0x7451('0x25')](function(){_0x57cc15[_0x7451('0x1b')](0xcc)[_0x7451('0x27')]();});}};}function handleEntityNotFound(_0x3c56f1,_0xdfc7d1){return function(_0x3c4eae){if(!_0x3c4eae){_0x3c56f1['sendStatus'](0x194);}return _0x3c4eae;};}function handleError(_0x328d0b,_0x2b8a8b){_0x2b8a8b=_0x2b8a8b||0x1f4;return function(_0x5df311){logger['error'](_0x5df311[_0x7451('0x28')]);if(_0x5df311[_0x7451('0x29')]){delete _0x5df311[_0x7451('0x29')];}_0x328d0b[_0x7451('0x1b')](_0x2b8a8b)[_0x7451('0x2a')](_0x5df311);};}exports[_0x7451('0x2b')]=function(_0x4b5b26,_0x3827c9){var _0x4c3ac4={},_0x1b960f={},_0x6c10ee={'count':0x0,'rows':[]};var _0x4d99f3=_[_0x7451('0x2c')](db[_0x7451('0x2d')][_0x7451('0x2e')],function(_0x3a397e){return{'name':_0x3a397e[_0x7451('0x2f')],'type':_0x3a397e['type'][_0x7451('0x30')]};});_0x1b960f[_0x7451('0x31')]=_[_0x7451('0x2c')](_0x4d99f3,'name');_0x1b960f[_0x7451('0x32')]=_[_0x7451('0x33')](_0x4b5b26['query']);_0x1b960f['filters']=_[_0x7451('0x34')](_0x1b960f[_0x7451('0x31')],_0x1b960f['query']);_0x4c3ac4['attributes']=_[_0x7451('0x34')](_0x1b960f[_0x7451('0x31')],qs[_0x7451('0x35')](_0x4b5b26[_0x7451('0x32')][_0x7451('0x35')]));_0x4c3ac4[_0x7451('0x36')]=_0x4c3ac4[_0x7451('0x36')][_0x7451('0x37')]?_0x4c3ac4['attributes']:_0x1b960f[_0x7451('0x31')];if(!_0x4b5b26[_0x7451('0x32')]['hasOwnProperty'](_0x7451('0x38'))){_0x4c3ac4[_0x7451('0x1d')]=qs[_0x7451('0x1d')](_0x4b5b26[_0x7451('0x32')][_0x7451('0x1d')]);_0x4c3ac4[_0x7451('0x1f')]=qs['offset'](_0x4b5b26[_0x7451('0x32')][_0x7451('0x1f')]);}_0x4c3ac4['order']=qs[_0x7451('0x39')](_0x4b5b26[_0x7451('0x32')]['sort']);_0x4c3ac4['where']=qs['filters'](_['pick'](_0x4b5b26['query'],_0x1b960f[_0x7451('0x3a')]),_0x4d99f3);if(_0x4b5b26[_0x7451('0x32')][_0x7451('0x3b')]){_0x4c3ac4[_0x7451('0x3c')]=_[_0x7451('0x3d')](_0x4c3ac4['where'],{'$or':_['map'](_0x4d99f3,function(_0x597eb1){if(_0x597eb1['type']!=='VIRTUAL'){var _0x35b102={};_0x35b102[_0x597eb1[_0x7451('0x29')]]={'$like':'%'+_0x4b5b26[_0x7451('0x32')][_0x7451('0x3b')]+'%'};return _0x35b102;}})});}_0x4c3ac4=_[_0x7451('0x3d')]({},_0x4c3ac4,_0x4b5b26[_0x7451('0x3e')]);var _0xdbbc08={'where':_0x4c3ac4[_0x7451('0x3c')]};return db[_0x7451('0x2d')][_0x7451('0x1e')](_0xdbbc08)[_0x7451('0x25')](function(_0x52cd2d){_0x6c10ee['count']=_0x52cd2d;if(_0x4b5b26[_0x7451('0x32')]['includeAll']){_0x4c3ac4[_0x7451('0x3f')]=[{'all':!![]}];}return db[_0x7451('0x2d')]['findAll'](_0x4c3ac4);})['then'](function(_0x1f5bf3){_0x6c10ee['rows']=_0x1f5bf3;return _0x6c10ee;})[_0x7451('0x25')](respondWithFilteredResult(_0x3827c9,_0x4c3ac4))['catch'](handleError(_0x3827c9,null));};exports[_0x7451('0x40')]=function(_0x2042c5,_0x543d08){var _0x853e14={'raw':!![],'where':{'id':_0x2042c5[_0x7451('0x41')]['id']}},_0x4c326d={};_0x4c326d[_0x7451('0x31')]=_[_0x7451('0x33')](db[_0x7451('0x2d')][_0x7451('0x2e')]);_0x4c326d[_0x7451('0x32')]=_[_0x7451('0x33')](_0x2042c5[_0x7451('0x32')]);_0x4c326d[_0x7451('0x3a')]=_[_0x7451('0x34')](_0x4c326d[_0x7451('0x31')],_0x4c326d[_0x7451('0x32')]);_0x853e14[_0x7451('0x36')]=_[_0x7451('0x34')](_0x4c326d['model'],qs[_0x7451('0x35')](_0x2042c5[_0x7451('0x32')][_0x7451('0x35')]));_0x853e14[_0x7451('0x36')]=_0x853e14['attributes'][_0x7451('0x37')]?_0x853e14['attributes']:_0x4c326d['model'];if(_0x2042c5['query']['includeAll']){_0x853e14['include']=[{'all':!![]}];}_0x853e14=_[_0x7451('0x3d')]({},_0x853e14,_0x2042c5[_0x7451('0x3e')]);return db[_0x7451('0x2d')]['find'](_0x853e14)[_0x7451('0x25')](handleEntityNotFound(_0x543d08,null))[_0x7451('0x25')](respondWithResult(_0x543d08,null))[_0x7451('0x42')](handleError(_0x543d08,null));};exports[_0x7451('0x43')]=function(_0x32ce4a,_0x2441b5){return db[_0x7451('0x2d')][_0x7451('0x43')](_0x32ce4a[_0x7451('0x44')],{})['then'](respondWithResult(_0x2441b5,0xc9))['catch'](handleError(_0x2441b5,null));};exports['update']=function(_0xd26beb,_0x3acf1d){if(_0xd26beb[_0x7451('0x44')]['id']){delete _0xd26beb['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xd26beb[_0x7451('0x41')]['id']}})['then'](handleEntityNotFound(_0x3acf1d,null))['then'](saveUpdates(_0xd26beb[_0x7451('0x44')],null))[_0x7451('0x25')](respondWithResult(_0x3acf1d,null))[_0x7451('0x42')](handleError(_0x3acf1d,null));};exports[_0x7451('0x26')]=function(_0x24e028,_0x4a9690){return db[_0x7451('0x2d')]['find']({'where':{'id':_0x24e028[_0x7451('0x41')]['id']}})[_0x7451('0x25')](handleEntityNotFound(_0x4a9690,null))[_0x7451('0x25')](removeEntity(_0x4a9690,null))[_0x7451('0x42')](handleError(_0x4a9690,null));};exports[_0x7451('0x45')]=function(_0xcf0d2a,_0x42a8e1){return db[_0x7451('0x2d')][_0x7451('0x45')]()['then'](respondWithResult(_0x42a8e1,null))['catch'](handleError(_0x42a8e1,null));}; \ No newline at end of file +var _0x89c4=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','params','length','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2946d7,_0x4717e0){var _0x2ade89=function(_0x10f50e){while(--_0x10f50e){_0x2946d7['push'](_0x2946d7['shift']());}};_0x2ade89(++_0x4717e0);}(_0x89c4,0x82));var _0x489c=function(_0x49ca1a,_0x4934fa){_0x49ca1a=_0x49ca1a-0x0;var _0xea885=_0x89c4[_0x49ca1a];return _0xea885;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x489c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x489c('0x3'));var Mustache=require(_0x489c('0x4'));var util=require(_0x489c('0x5'));var path=require(_0x489c('0x6'));var sox=require(_0x489c('0x7'));var csv=require(_0x489c('0x8'));var ejs=require(_0x489c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x489c('0xa'));var squel=require(_0x489c('0xb'));var crypto=require(_0x489c('0xc'));var jsforce=require(_0x489c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x489c('0xe'));var Papa=require('papaparse');var Redis=require(_0x489c('0xf'));var authService=require(_0x489c('0x10'));var qs=require(_0x489c('0x11'));var as=require(_0x489c('0x12'));var hardwareService=require(_0x489c('0x13'));var logger=require(_0x489c('0x14'))(_0x489c('0x15'));var utils=require(_0x489c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x489c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfdfbcb,_0x4a9f45){_0x4a9f45=_0x4a9f45||0xcc;return function(_0x5340ce){if(_0x5340ce){return _0xfdfbcb[_0x489c('0x18')](_0x4a9f45);}return _0xfdfbcb['status'](_0x4a9f45)[_0x489c('0x19')]();};}function respondWithResult(_0x5d1b10,_0x305e40){_0x305e40=_0x305e40||0xc8;return function(_0x45983e){if(_0x45983e){return _0x5d1b10['status'](_0x305e40)[_0x489c('0x1a')](_0x45983e);}};}function respondWithFilteredResult(_0x39725a,_0x4861e2){return function(_0x4f37c3){if(_0x4f37c3){var _0x1bb98a=typeof _0x4861e2['offset']===_0x489c('0x1b')&&typeof _0x4861e2[_0x489c('0x1c')]===_0x489c('0x1b');var _0x39f9a9=_0x4f37c3[_0x489c('0x1d')];var _0x4519ce=_0x1bb98a?0x0:_0x4861e2[_0x489c('0x1e')];var _0x431782=_0x1bb98a?_0x4f37c3[_0x489c('0x1d')]:_0x4861e2[_0x489c('0x1e')]+_0x4861e2[_0x489c('0x1c')];var _0x19fb45;if(_0x431782>=_0x39f9a9){_0x431782=_0x39f9a9;_0x19fb45=0xc8;}else{_0x19fb45=0xce;}_0x39725a[_0x489c('0x1f')](_0x19fb45);return _0x39725a[_0x489c('0x20')](_0x489c('0x21'),_0x4519ce+'-'+_0x431782+'/'+_0x39f9a9)[_0x489c('0x1a')](_0x4f37c3);}return null;};}function patchUpdates(_0x14677b){return function(_0x381b56){try{jsonpatch['apply'](_0x381b56,_0x14677b,!![]);}catch(_0x4d0e03){return BPromise[_0x489c('0x22')](_0x4d0e03);}return _0x381b56[_0x489c('0x23')]();};}function saveUpdates(_0x1a1b68,_0x18cf8b){return function(_0x5b6ea3){if(_0x5b6ea3){return _0x5b6ea3[_0x489c('0x24')](_0x1a1b68)[_0x489c('0x25')](function(_0x37a59b){return _0x37a59b;});}return null;};}function removeEntity(_0x552384,_0x2a6d5c){return function(_0x1de4bf){if(_0x1de4bf){return _0x1de4bf['destroy']()[_0x489c('0x25')](function(){_0x552384[_0x489c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35db69,_0x4cb1ae){return function(_0x3aab5b){if(!_0x3aab5b){_0x35db69[_0x489c('0x18')](0x194);}return _0x3aab5b;};}function handleError(_0x57e82f,_0x20cf09){_0x20cf09=_0x20cf09||0x1f4;return function(_0x1119bd){logger[_0x489c('0x26')](_0x1119bd[_0x489c('0x27')]);if(_0x1119bd['name']){delete _0x1119bd[_0x489c('0x28')];}_0x57e82f['status'](_0x20cf09)[_0x489c('0x29')](_0x1119bd);};}exports[_0x489c('0x2a')]=function(_0x3b8f79,_0x2fdb69){var _0x36d812={},_0x31986e={},_0x521e31={'count':0x0,'rows':[]};var _0x79b260=_[_0x489c('0x2b')](db['FaxQueueReport'][_0x489c('0x2c')],function(_0x299fcf){return{'name':_0x299fcf['fieldName'],'type':_0x299fcf[_0x489c('0x2d')][_0x489c('0x2e')]};});_0x31986e[_0x489c('0x2f')]=_[_0x489c('0x2b')](_0x79b260,'name');_0x31986e[_0x489c('0x30')]=_[_0x489c('0x31')](_0x3b8f79['query']);_0x31986e[_0x489c('0x32')]=_[_0x489c('0x33')](_0x31986e[_0x489c('0x2f')],_0x31986e['query']);_0x36d812[_0x489c('0x34')]=_[_0x489c('0x33')](_0x31986e[_0x489c('0x2f')],qs[_0x489c('0x35')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x35')]));_0x36d812[_0x489c('0x34')]=_0x36d812[_0x489c('0x34')]['length']?_0x36d812[_0x489c('0x34')]:_0x31986e[_0x489c('0x2f')];if(!_0x3b8f79[_0x489c('0x30')][_0x489c('0x36')](_0x489c('0x37'))){_0x36d812[_0x489c('0x1c')]=qs[_0x489c('0x1c')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x1c')]);_0x36d812[_0x489c('0x1e')]=qs['offset'](_0x3b8f79[_0x489c('0x30')]['offset']);}_0x36d812[_0x489c('0x38')]=qs[_0x489c('0x39')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x39')]);_0x36d812['where']=qs[_0x489c('0x32')](_[_0x489c('0x3a')](_0x3b8f79[_0x489c('0x30')],_0x31986e[_0x489c('0x32')]),_0x79b260);if(_0x3b8f79[_0x489c('0x30')][_0x489c('0x3b')]){_0x36d812[_0x489c('0x3c')]=_['merge'](_0x36d812[_0x489c('0x3c')],{'$or':_[_0x489c('0x2b')](_0x79b260,function(_0x290043){if(_0x290043[_0x489c('0x2d')]!==_0x489c('0x3d')){var _0x5b508c={};_0x5b508c[_0x290043[_0x489c('0x28')]]={'$like':'%'+_0x3b8f79['query'][_0x489c('0x3b')]+'%'};return _0x5b508c;}})});}_0x36d812=_['merge']({},_0x36d812,_0x3b8f79[_0x489c('0x3e')]);var _0x22699d={'where':_0x36d812[_0x489c('0x3c')]};return db[_0x489c('0x3f')][_0x489c('0x1d')](_0x22699d)[_0x489c('0x25')](function(_0x4677b8){_0x521e31[_0x489c('0x1d')]=_0x4677b8;if(_0x3b8f79[_0x489c('0x30')][_0x489c('0x40')]){_0x36d812[_0x489c('0x41')]=[{'all':!![]}];}return db[_0x489c('0x3f')][_0x489c('0x42')](_0x36d812);})[_0x489c('0x25')](function(_0x3cccca){_0x521e31['rows']=_0x3cccca;return _0x521e31;})['then'](respondWithFilteredResult(_0x2fdb69,_0x36d812))[_0x489c('0x43')](handleError(_0x2fdb69,null));};exports[_0x489c('0x44')]=function(_0x31b58a,_0x2f879a){var _0x583c85={'raw':!![],'where':{'id':_0x31b58a[_0x489c('0x45')]['id']}},_0xea1236={};_0xea1236['model']=_[_0x489c('0x31')](db['FaxQueueReport'][_0x489c('0x2c')]);_0xea1236['query']=_[_0x489c('0x31')](_0x31b58a[_0x489c('0x30')]);_0xea1236[_0x489c('0x32')]=_[_0x489c('0x33')](_0xea1236[_0x489c('0x2f')],_0xea1236[_0x489c('0x30')]);_0x583c85[_0x489c('0x34')]=_[_0x489c('0x33')](_0xea1236[_0x489c('0x2f')],qs[_0x489c('0x35')](_0x31b58a[_0x489c('0x30')][_0x489c('0x35')]));_0x583c85[_0x489c('0x34')]=_0x583c85[_0x489c('0x34')][_0x489c('0x46')]?_0x583c85[_0x489c('0x34')]:_0xea1236[_0x489c('0x2f')];if(_0x31b58a[_0x489c('0x30')]['includeAll']){_0x583c85[_0x489c('0x41')]=[{'all':!![]}];}_0x583c85=_['merge']({},_0x583c85,_0x31b58a[_0x489c('0x3e')]);return db[_0x489c('0x3f')]['find'](_0x583c85)[_0x489c('0x25')](handleEntityNotFound(_0x2f879a,null))[_0x489c('0x25')](respondWithResult(_0x2f879a,null))[_0x489c('0x43')](handleError(_0x2f879a,null));};exports['create']=function(_0x58b3c1,_0x9adabe){return db[_0x489c('0x3f')]['create'](_0x58b3c1[_0x489c('0x47')],{})[_0x489c('0x25')](respondWithResult(_0x9adabe,0xc9))[_0x489c('0x43')](handleError(_0x9adabe,null));};exports[_0x489c('0x24')]=function(_0x1d4466,_0x81bc95){if(_0x1d4466[_0x489c('0x47')]['id']){delete _0x1d4466[_0x489c('0x47')]['id'];}return db[_0x489c('0x3f')][_0x489c('0x48')]({'where':{'id':_0x1d4466[_0x489c('0x45')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x81bc95,null))[_0x489c('0x25')](saveUpdates(_0x1d4466[_0x489c('0x47')],null))[_0x489c('0x25')](respondWithResult(_0x81bc95,null))[_0x489c('0x43')](handleError(_0x81bc95,null));};exports[_0x489c('0x49')]=function(_0x547926,_0x252bf7){return db[_0x489c('0x3f')][_0x489c('0x48')]({'where':{'id':_0x547926['params']['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x252bf7,null))[_0x489c('0x25')](removeEntity(_0x252bf7,null))[_0x489c('0x43')](handleError(_0x252bf7,null));};exports['describe']=function(_0x4d2351,_0x2327fb){return db[_0x489c('0x3f')][_0x489c('0x4a')]()[_0x489c('0x25')](respondWithResult(_0x2327fb,null))['catch'](handleError(_0x2327fb,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d7e08f1..472a52a 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(_0x47b337,_0xcca95b){var _0x2294e0=function(_0x25f8b0){while(--_0x25f8b0){_0x47b337['push'](_0x47b337['shift']());}};_0x2294e0(++_0xcca95b);}(_0x5fab,0x177));var _0xb5fa=function(_0x4c4664,_0x506a85){_0x4c4664=_0x4c4664-0x0;var _0x2920cf=_0x5fab[_0x4c4664];return _0x2920cf;};'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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x25a822,_0x5d2e4d){var _0x2b994f=function(_0x3338d8){while(--_0x3338d8){_0x25a822['push'](_0x25a822['shift']());}};_0x2b994f(++_0x5d2e4d);}(_0xe14b,0x93));var _0xbe14=function(_0x499655,_0x1511e2){_0x499655=_0x499655-0x0;var _0x45b7b1=_0xe14b[_0x499655];return _0x45b7b1;};'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':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 58b07e4..64be878 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 _0x5a83=['body','options','raw','info','UpdateFaxQueueReport','FaxQueueReport','update','attributes','limit','lodash','util','randomstring','ioredis','../../config/utils','rpc','client','request','then','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport'];(function(_0x59ba1e,_0xf5d9af){var _0x23a081=function(_0x5f33a5){while(--_0x5f33a5){_0x59ba1e['push'](_0x59ba1e['shift']());}};_0x23a081(++_0xf5d9af);}(_0x5a83,0x1d9));var _0x35a8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5a83[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x35a8('0x0'));var util=require(_0x35a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35a8('0x2'));var fs=require('fs');var Redis=require(_0x35a8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x35a8('0x4'));var logger=require('../../config/logger')(_0x35a8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x35a8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c828e,_0xdb745c,_0x5b54cc){return new BPromise(function(_0x4ddb92,_0x30b118){return client[_0x35a8('0x7')](_0x3c828e,_0x5b54cc)[_0x35a8('0x8')](function(_0xd93879){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0xdb745c,'request\x20sent');logger[_0x35a8('0x9')](_0x35a8('0xa'),_0xdb745c,_0x35a8('0xb'),JSON[_0x35a8('0xc')](_0xd93879));if(_0xd93879[_0x35a8('0xd')]){if(_0xd93879['error'][_0x35a8('0xe')]===0x1f4){logger[_0x35a8('0xd')](_0x35a8('0xf'),_0xdb745c,_0xd93879[_0x35a8('0xd')][_0x35a8('0x10')]);return _0x30b118(_0xd93879['error'][_0x35a8('0x10')]);}logger[_0x35a8('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0xdb745c,_0xd93879[_0x35a8('0xd')][_0x35a8('0x10')]);return _0x4ddb92(_0xd93879[_0x35a8('0xd')]['message']);}else{logger['info'](_0x35a8('0xf'),_0xdb745c,_0x35a8('0xb'));_0x4ddb92(_0xd93879[_0x35a8('0x11')][_0x35a8('0x10')]);}})[_0x35a8('0x12')](function(_0x579943){logger[_0x35a8('0xd')](_0x35a8('0xf'),_0xdb745c,_0x579943);_0x30b118(_0x579943);});});}exports[_0x35a8('0x13')]=function(_0x24e6a5){var _0x1ada8d=this;return new Promise(function(_0x22fbf0,_0x330be5){return db['FaxQueueReport']['create'](_0x24e6a5[_0x35a8('0x14')],{'raw':_0x24e6a5[_0x35a8('0x15')]?_0x24e6a5[_0x35a8('0x15')][_0x35a8('0x16')]===undefined?!![]:![]:!![]})[_0x35a8('0x8')](function(_0xb5d75c){logger[_0x35a8('0x17')](_0x35a8('0x13'),_0x24e6a5);logger[_0x35a8('0x9')]('CreateFaxQueueReport',_0x24e6a5,JSON[_0x35a8('0xc')](_0xb5d75c));_0x22fbf0(_0xb5d75c);})[_0x35a8('0x12')](function(_0xbe6953){logger[_0x35a8('0xd')](_0x35a8('0x13'),_0xbe6953[_0x35a8('0x10')],_0x24e6a5);_0x330be5(_0x1ada8d[_0x35a8('0xd')](0x1f4,_0xbe6953[_0x35a8('0x10')]));});});};exports[_0x35a8('0x18')]=function(_0x78fa4a){var _0x26ab9c=this;return new Promise(function(_0x17ffec,_0x29fbb4){return db[_0x35a8('0x19')][_0x35a8('0x1a')](_0x78fa4a[_0x35a8('0x14')],{'raw':_0x78fa4a[_0x35a8('0x15')]?_0x78fa4a[_0x35a8('0x15')][_0x35a8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x78fa4a['options']?_0x78fa4a['options']['where']||null:null,'attributes':_0x78fa4a['options']?_0x78fa4a['options'][_0x35a8('0x1b')]||null:null,'limit':_0x78fa4a[_0x35a8('0x15')]?_0x78fa4a['options'][_0x35a8('0x1c')]||null:null})[_0x35a8('0x8')](function(_0x2c6cc8){logger['info'](_0x35a8('0x18'),_0x78fa4a);logger[_0x35a8('0x9')](_0x35a8('0x18'),_0x78fa4a,JSON[_0x35a8('0xc')](_0x2c6cc8));_0x17ffec(_0x2c6cc8);})['catch'](function(_0x3e66e1){logger[_0x35a8('0xd')](_0x35a8('0x18'),_0x3e66e1[_0x35a8('0x10')],_0x78fa4a);_0x29fbb4(_0x26ab9c[_0x35a8('0xd')](0x1f4,_0x3e66e1[_0x35a8('0x10')]));});});}; \ No newline at end of file +var _0x7ad8=['then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','FaxQueueReport','create','debug','CreateFaxQueueReport','catch','UpdateFaxQueueReport','body','options','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x37c455,_0xbe5637){var _0x3ff4a0=function(_0xb3191b){while(--_0xb3191b){_0x37c455['push'](_0x37c455['shift']());}};_0x3ff4a0(++_0xbe5637);}(_0x7ad8,0x70));var _0x87ad=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x7ad8[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0x87ad('0x0'));var util=require(_0x87ad('0x1'));var moment=require(_0x87ad('0x2'));var BPromise=require(_0x87ad('0x3'));var rs=require(_0x87ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87ad('0x6'))(_0x87ad('0x7'));var config=require(_0x87ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x87ad('0x9')][_0x87ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x473ea7,_0x5afd92,_0x457fe3){return new BPromise(function(_0x38983d,_0x299e6d){return client[_0x87ad('0xb')](_0x473ea7,_0x457fe3)[_0x87ad('0xc')](function(_0x5d6c63){logger[_0x87ad('0xd')](_0x87ad('0xe'),_0x5afd92,'request\x20sent');logger['debug'](_0x87ad('0xf'),_0x5afd92,_0x87ad('0x10'),JSON['stringify'](_0x5d6c63));if(_0x5d6c63[_0x87ad('0x11')]){if(_0x5d6c63['error'][_0x87ad('0x12')]===0x1f4){logger[_0x87ad('0x11')](_0x87ad('0xe'),_0x5afd92,_0x5d6c63[_0x87ad('0x11')][_0x87ad('0x13')]);return _0x299e6d(_0x5d6c63[_0x87ad('0x11')][_0x87ad('0x13')]);}logger[_0x87ad('0x11')](_0x87ad('0xe'),_0x5afd92,_0x5d6c63['error']['message']);return _0x38983d(_0x5d6c63[_0x87ad('0x11')][_0x87ad('0x13')]);}else{logger['info'](_0x87ad('0xe'),_0x5afd92,'request\x20sent');_0x38983d(_0x5d6c63[_0x87ad('0x14')]['message']);}})['catch'](function(_0x2a7fbf){logger['error'](_0x87ad('0xe'),_0x5afd92,_0x2a7fbf);_0x299e6d(_0x2a7fbf);});});}exports['CreateFaxQueueReport']=function(_0xa1cd92){var _0x9eee37=this;return new Promise(function(_0x3174fe,_0x478cbd){return db[_0x87ad('0x15')][_0x87ad('0x16')](_0xa1cd92['body'],{'raw':_0xa1cd92['options']?_0xa1cd92['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x311d44){logger[_0x87ad('0xd')]('CreateFaxQueueReport',_0xa1cd92);logger[_0x87ad('0x17')](_0x87ad('0x18'),_0xa1cd92,JSON['stringify'](_0x311d44));_0x3174fe(_0x311d44);})[_0x87ad('0x19')](function(_0x47de99){logger[_0x87ad('0x11')]('CreateFaxQueueReport',_0x47de99['message'],_0xa1cd92);_0x478cbd(_0x9eee37[_0x87ad('0x11')](0x1f4,_0x47de99[_0x87ad('0x13')]));});});};exports[_0x87ad('0x1a')]=function(_0xcbec87){var _0xa4a934=this;return new Promise(function(_0x1f83fa,_0x474153){return db[_0x87ad('0x15')]['update'](_0xcbec87[_0x87ad('0x1b')],{'raw':_0xcbec87[_0x87ad('0x1c')]?_0xcbec87['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcbec87[_0x87ad('0x1c')]?_0xcbec87[_0x87ad('0x1c')]['where']||null:null,'attributes':_0xcbec87[_0x87ad('0x1c')]?_0xcbec87[_0x87ad('0x1c')][_0x87ad('0x1d')]||null:null,'limit':_0xcbec87[_0x87ad('0x1c')]?_0xcbec87['options']['limit']||null:null})[_0x87ad('0xc')](function(_0x234745){logger['info'](_0x87ad('0x1a'),_0xcbec87);logger[_0x87ad('0x17')](_0x87ad('0x1a'),_0xcbec87,JSON[_0x87ad('0x1e')](_0x234745));_0x1f83fa(_0x234745);})[_0x87ad('0x19')](function(_0x16c619){logger[_0x87ad('0x11')]('UpdateFaxQueueReport',_0x16c619[_0x87ad('0x13')],_0xcbec87);_0x474153(_0xa4a934[_0x87ad('0x11')](0x1f4,_0x16c619[_0x87ad('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 6acec65..cf04b59 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 _0x2146=['create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','post'];(function(_0x3db5e5,_0x37a48e){var _0x432a63=function(_0x134362){while(--_0x134362){_0x3db5e5['push'](_0x3db5e5['shift']());}};_0x432a63(++_0x37a48e);}(_0x2146,0x101));var _0x6214=function(_0x30cf82,_0x2bbc90){_0x30cf82=_0x30cf82-0x0;var _0x248b9d=_0x2146[_0x30cf82];return _0x248b9d;};'use strict';var multer=require(_0x6214('0x0'));var util=require(_0x6214('0x1'));var path=require(_0x6214('0x2'));var timeout=require(_0x6214('0x3'));var express=require(_0x6214('0x4'));var router=express[_0x6214('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6214('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6214('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x6214('0x8')](),controller[_0x6214('0x9')]);router[_0x6214('0xa')]('/describe',auth[_0x6214('0x8')](),controller['describe']);router[_0x6214('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6214('0xb')]);router[_0x6214('0xc')]('/',auth[_0x6214('0x8')](),controller[_0x6214('0xd')]);router['put'](_0x6214('0xe'),auth[_0x6214('0x8')](),controller[_0x6214('0xf')]);router[_0x6214('0x10')](_0x6214('0xe'),auth[_0x6214('0x8')](),controller[_0x6214('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc0f3=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x596a1b,_0x53ce62){var _0x43b5fc=function(_0x77c8bd){while(--_0x77c8bd){_0x596a1b['push'](_0x596a1b['shift']());}};_0x43b5fc(++_0x53ce62);}(_0xc0f3,0x1d3));var _0x3c0f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc0f3[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c0f('0x0'));var timeout=require(_0x3c0f('0x1'));var express=require(_0x3c0f('0x2'));var router=express[_0x3c0f('0x3')]();var fs_extra=require(_0x3c0f('0x4'));var auth=require(_0x3c0f('0x5'));var interaction=require(_0x3c0f('0x6'));var config=require('../../config/environment');var controller=require(_0x3c0f('0x7'));router[_0x3c0f('0x8')]('/',auth[_0x3c0f('0x9')](),controller['index']);router[_0x3c0f('0x8')](_0x3c0f('0xa'),auth[_0x3c0f('0x9')](),controller[_0x3c0f('0xb')]);router[_0x3c0f('0x8')](_0x3c0f('0xc'),auth[_0x3c0f('0x9')](),controller[_0x3c0f('0xd')]);router[_0x3c0f('0xe')]('/',auth[_0x3c0f('0x9')](),controller[_0x3c0f('0xf')]);router[_0x3c0f('0x10')](_0x3c0f('0xc'),auth[_0x3c0f('0x9')](),controller[_0x3c0f('0x11')]);router[_0x3c0f('0x12')](_0x3c0f('0xc'),auth[_0x3c0f('0x9')](),controller[_0x3c0f('0x13')]);module[_0x3c0f('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index dbba7e5..c44ff64 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(_0x4b5044,_0x2f4636){var _0x4f6d77=function(_0x290dd5){while(--_0x290dd5){_0x4b5044['push'](_0x4b5044['shift']());}};_0x4f6d77(++_0x2f4636);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xf3cd[_0x7185f7];return _0x182e45;};'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(_0x1ed314,_0x3b621d){var _0x33777c=function(_0x72690e){while(--_0x72690e){_0x1ed314['push'](_0x1ed314['shift']());}};_0x33777c(++_0x3b621d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x39c454,_0x4281c9){_0x39c454=_0x39c454-0x0;var _0x31ca89=_0xf4eb[_0x39c454];return _0x31ca89;};'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 2b0b401..0ad0b1b 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 _0xc3ec=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x52822f,_0x162c3f){var _0x37f3da=function(_0x490298){while(--_0x490298){_0x52822f['push'](_0x52822f['shift']());}};_0x37f3da(++_0x162c3f);}(_0xc3ec,0x1f0));var _0xcc3e=function(_0x90d71e,_0x214e52){_0x90d71e=_0x90d71e-0x0;var _0x34b6f6=_0xc3ec[_0x90d71e];return _0x34b6f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc3e('0x0'));var zipdir=require(_0xcc3e('0x1'));var jsonpatch=require(_0xcc3e('0x2'));var rp=require(_0xcc3e('0x3'));var moment=require(_0xcc3e('0x4'));var BPromise=require(_0xcc3e('0x5'));var Mustache=require(_0xcc3e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcc3e('0x7'));var csv=require(_0xcc3e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc3e('0x9'));var squel=require(_0xcc3e('0xa'));var crypto=require(_0xcc3e('0xb'));var jsforce=require(_0xcc3e('0xc'));var deskjs=require(_0xcc3e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc3e('0xe'));var Redis=require(_0xcc3e('0xf'));var authService=require(_0xcc3e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcc3e('0x11'));var hardwareService=require(_0xcc3e('0x12'));var logger=require(_0xcc3e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcc3e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc3e('0x15'))['db'];function respondWithStatusCode(_0x5507d4,_0x12f804){_0x12f804=_0x12f804||0xcc;return function(_0x183a5c){if(_0x183a5c){return _0x5507d4['sendStatus'](_0x12f804);}return _0x5507d4[_0xcc3e('0x16')](_0x12f804)[_0xcc3e('0x17')]();};}function respondWithResult(_0x41ea93,_0x289279){_0x289279=_0x289279||0xc8;return function(_0x397ea7){if(_0x397ea7){return _0x41ea93[_0xcc3e('0x16')](_0x289279)[_0xcc3e('0x18')](_0x397ea7);}};}function respondWithFilteredResult(_0x170b14,_0x205308){return function(_0x3ac40b){if(_0x3ac40b){var _0x558a8e=typeof _0x205308[_0xcc3e('0x19')]===_0xcc3e('0x1a')&&typeof _0x205308['limit']==='undefined';var _0x18f4a2=_0x3ac40b['count'];var _0x3f754a=_0x558a8e?0x0:_0x205308[_0xcc3e('0x19')];var _0x57e17a=_0x558a8e?_0x3ac40b[_0xcc3e('0x1b')]:_0x205308[_0xcc3e('0x19')]+_0x205308['limit'];var _0x34295d;if(_0x57e17a>=_0x18f4a2){_0x57e17a=_0x18f4a2;_0x34295d=0xc8;}else{_0x34295d=0xce;}_0x170b14[_0xcc3e('0x16')](_0x34295d);return _0x170b14[_0xcc3e('0x1c')]('Content-Range',_0x3f754a+'-'+_0x57e17a+'/'+_0x18f4a2)[_0xcc3e('0x18')](_0x3ac40b);}return null;};}function patchUpdates(_0x1d9e54){return function(_0x35520e){try{jsonpatch[_0xcc3e('0x1d')](_0x35520e,_0x1d9e54,!![]);}catch(_0x5a422a){return BPromise[_0xcc3e('0x1e')](_0x5a422a);}return _0x35520e[_0xcc3e('0x1f')]();};}function saveUpdates(_0x22fdc5,_0x579a81){return function(_0x1a3ec0){if(_0x1a3ec0){return _0x1a3ec0[_0xcc3e('0x20')](_0x22fdc5)['then'](function(_0x18604f){return _0x18604f;});}return null;};}function removeEntity(_0x49aa40,_0x4077bb){return function(_0x33242e){if(_0x33242e){return _0x33242e['destroy']()[_0xcc3e('0x21')](function(){_0x49aa40[_0xcc3e('0x16')](0xcc)[_0xcc3e('0x17')]();});}};}function handleEntityNotFound(_0x166c2f,_0x2f4fe0){return function(_0x57ed0d){if(!_0x57ed0d){_0x166c2f['sendStatus'](0x194);}return _0x57ed0d;};}function handleError(_0x445813,_0xf6c00e){_0xf6c00e=_0xf6c00e||0x1f4;return function(_0x4fa0b8){logger[_0xcc3e('0x22')](_0x4fa0b8[_0xcc3e('0x23')]);if(_0x4fa0b8['name']){delete _0x4fa0b8[_0xcc3e('0x24')];}_0x445813['status'](_0xf6c00e)[_0xcc3e('0x25')](_0x4fa0b8);};}exports[_0xcc3e('0x26')]=function(_0x50a010,_0x55ae65){var _0x591877={},_0xdfafb7={},_0x25ea8f={'count':0x0,'rows':[]};var _0x1f4c3e=_[_0xcc3e('0x27')](db[_0xcc3e('0x28')][_0xcc3e('0x29')],function(_0x29ae02){return{'name':_0x29ae02['fieldName'],'type':_0x29ae02[_0xcc3e('0x2a')][_0xcc3e('0x2b')]};});_0xdfafb7[_0xcc3e('0x2c')]=_[_0xcc3e('0x27')](_0x1f4c3e,_0xcc3e('0x24'));_0xdfafb7[_0xcc3e('0x2d')]=_[_0xcc3e('0x2e')](_0x50a010['query']);_0xdfafb7['filters']=_[_0xcc3e('0x2f')](_0xdfafb7['model'],_0xdfafb7[_0xcc3e('0x2d')]);_0x591877['attributes']=_['intersection'](_0xdfafb7[_0xcc3e('0x2c')],qs[_0xcc3e('0x30')](_0x50a010[_0xcc3e('0x2d')]['fields']));_0x591877[_0xcc3e('0x31')]=_0x591877[_0xcc3e('0x31')][_0xcc3e('0x32')]?_0x591877['attributes']:_0xdfafb7['model'];if(!_0x50a010['query'][_0xcc3e('0x33')](_0xcc3e('0x34'))){_0x591877['limit']=qs['limit'](_0x50a010[_0xcc3e('0x2d')][_0xcc3e('0x35')]);_0x591877[_0xcc3e('0x19')]=qs[_0xcc3e('0x19')](_0x50a010[_0xcc3e('0x2d')][_0xcc3e('0x19')]);}_0x591877[_0xcc3e('0x36')]=qs[_0xcc3e('0x37')](_0x50a010[_0xcc3e('0x2d')][_0xcc3e('0x37')]);_0x591877['where']=qs[_0xcc3e('0x38')](_[_0xcc3e('0x39')](_0x50a010[_0xcc3e('0x2d')],_0xdfafb7[_0xcc3e('0x38')]),_0x1f4c3e);if(_0x50a010[_0xcc3e('0x2d')][_0xcc3e('0x3a')]){_0x591877[_0xcc3e('0x3b')]=_[_0xcc3e('0x3c')](_0x591877[_0xcc3e('0x3b')],{'$or':_[_0xcc3e('0x27')](_0x1f4c3e,function(_0x44b7b1){if(_0x44b7b1[_0xcc3e('0x2a')]!==_0xcc3e('0x3d')){var _0x3384c7={};_0x3384c7[_0x44b7b1[_0xcc3e('0x24')]]={'$like':'%'+_0x50a010[_0xcc3e('0x2d')]['filter']+'%'};return _0x3384c7;}})});}_0x591877=_[_0xcc3e('0x3c')]({},_0x591877,_0x50a010[_0xcc3e('0x3e')]);var _0x3e32d9={'where':_0x591877[_0xcc3e('0x3b')]};return db[_0xcc3e('0x28')][_0xcc3e('0x1b')](_0x3e32d9)['then'](function(_0x46be88){_0x25ea8f['count']=_0x46be88;if(_0x50a010['query'][_0xcc3e('0x3f')]){_0x591877['include']=[{'all':!![]}];}return db[_0xcc3e('0x28')][_0xcc3e('0x40')](_0x591877);})[_0xcc3e('0x21')](function(_0x12524c){_0x25ea8f[_0xcc3e('0x41')]=_0x12524c;return _0x25ea8f;})['then'](respondWithFilteredResult(_0x55ae65,_0x591877))[_0xcc3e('0x42')](handleError(_0x55ae65,null));};exports['show']=function(_0x442efc,_0x5e5fec){var _0x24590d={'raw':!![],'where':{'id':_0x442efc[_0xcc3e('0x43')]['id']}},_0x28ed01={};_0x28ed01[_0xcc3e('0x2c')]=_[_0xcc3e('0x2e')](db['FaxTransferReport'][_0xcc3e('0x29')]);_0x28ed01[_0xcc3e('0x2d')]=_[_0xcc3e('0x2e')](_0x442efc[_0xcc3e('0x2d')]);_0x28ed01[_0xcc3e('0x38')]=_[_0xcc3e('0x2f')](_0x28ed01[_0xcc3e('0x2c')],_0x28ed01['query']);_0x24590d[_0xcc3e('0x31')]=_[_0xcc3e('0x2f')](_0x28ed01[_0xcc3e('0x2c')],qs[_0xcc3e('0x30')](_0x442efc[_0xcc3e('0x2d')][_0xcc3e('0x30')]));_0x24590d[_0xcc3e('0x31')]=_0x24590d[_0xcc3e('0x31')][_0xcc3e('0x32')]?_0x24590d[_0xcc3e('0x31')]:_0x28ed01['model'];if(_0x442efc['query'][_0xcc3e('0x3f')]){_0x24590d[_0xcc3e('0x44')]=[{'all':!![]}];}_0x24590d=_[_0xcc3e('0x3c')]({},_0x24590d,_0x442efc['options']);return db[_0xcc3e('0x28')][_0xcc3e('0x45')](_0x24590d)[_0xcc3e('0x21')](handleEntityNotFound(_0x5e5fec,null))[_0xcc3e('0x21')](respondWithResult(_0x5e5fec,null))[_0xcc3e('0x42')](handleError(_0x5e5fec,null));};exports['create']=function(_0x595979,_0x5b20a6){return db[_0xcc3e('0x28')][_0xcc3e('0x46')](_0x595979['body'],{})[_0xcc3e('0x21')](respondWithResult(_0x5b20a6,0xc9))[_0xcc3e('0x42')](handleError(_0x5b20a6,null));};exports['update']=function(_0x4bc6d0,_0x4cfca8){if(_0x4bc6d0['body']['id']){delete _0x4bc6d0[_0xcc3e('0x47')]['id'];}return db['FaxTransferReport'][_0xcc3e('0x45')]({'where':{'id':_0x4bc6d0[_0xcc3e('0x43')]['id']}})[_0xcc3e('0x21')](handleEntityNotFound(_0x4cfca8,null))[_0xcc3e('0x21')](saveUpdates(_0x4bc6d0['body'],null))[_0xcc3e('0x21')](respondWithResult(_0x4cfca8,null))[_0xcc3e('0x42')](handleError(_0x4cfca8,null));};exports['destroy']=function(_0x3794f1,_0x28ac7b){return db['FaxTransferReport'][_0xcc3e('0x45')]({'where':{'id':_0x3794f1[_0xcc3e('0x43')]['id']}})['then'](handleEntityNotFound(_0x28ac7b,null))[_0xcc3e('0x21')](removeEntity(_0x28ac7b,null))[_0xcc3e('0x42')](handleError(_0x28ac7b,null));};exports[_0xcc3e('0x48')]=function(_0x56d87a,_0x15dd1b){return db[_0xcc3e('0x28')][_0xcc3e('0x48')]()[_0xcc3e('0x21')](respondWithResult(_0x15dd1b,null))['catch'](handleError(_0x15dd1b,null));}; \ No newline at end of file +var _0x2e9d=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x2e9d,0xab));var _0xd2e9=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x2e9d[_0x23b655];return _0x364b32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd2e9('0x0'));var zipdir=require(_0xd2e9('0x1'));var jsonpatch=require(_0xd2e9('0x2'));var rp=require(_0xd2e9('0x3'));var moment=require(_0xd2e9('0x4'));var BPromise=require(_0xd2e9('0x5'));var Mustache=require('mustache');var util=require(_0xd2e9('0x6'));var path=require('path');var sox=require(_0xd2e9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2e9('0x8'));var _=require(_0xd2e9('0x9'));var squel=require(_0xd2e9('0xa'));var crypto=require(_0xd2e9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd2e9('0xc'));var toCsv=require(_0xd2e9('0xd'));var querystring=require('querystring');var Papa=require(_0xd2e9('0xe'));var Redis=require(_0xd2e9('0xf'));var authService=require(_0xd2e9('0x10'));var qs=require(_0xd2e9('0x11'));var as=require(_0xd2e9('0x12'));var hardwareService=require(_0xd2e9('0x13'));var logger=require(_0xd2e9('0x14'))(_0xd2e9('0x15'));var utils=require('../../config/utils');var config=require(_0xd2e9('0x16'));var licenseUtil=require(_0xd2e9('0x17'));var db=require(_0xd2e9('0x18'))['db'];function respondWithStatusCode(_0x1fdd41,_0x1be623){_0x1be623=_0x1be623||0xcc;return function(_0x9df118){if(_0x9df118){return _0x1fdd41[_0xd2e9('0x19')](_0x1be623);}return _0x1fdd41[_0xd2e9('0x1a')](_0x1be623)['end']();};}function respondWithResult(_0x549798,_0x10c40b){_0x10c40b=_0x10c40b||0xc8;return function(_0x2cc628){if(_0x2cc628){return _0x549798[_0xd2e9('0x1a')](_0x10c40b)[_0xd2e9('0x1b')](_0x2cc628);}};}function respondWithFilteredResult(_0xd22e63,_0x34b99c){return function(_0xa77cee){if(_0xa77cee){var _0x461068=typeof _0x34b99c[_0xd2e9('0x1c')]===_0xd2e9('0x1d')&&typeof _0x34b99c[_0xd2e9('0x1e')]===_0xd2e9('0x1d');var _0x4a46f4=_0xa77cee[_0xd2e9('0x1f')];var _0x27e36b=_0x461068?0x0:_0x34b99c[_0xd2e9('0x1c')];var _0x41191f=_0x461068?_0xa77cee[_0xd2e9('0x1f')]:_0x34b99c[_0xd2e9('0x1c')]+_0x34b99c[_0xd2e9('0x1e')];var _0x252da7;if(_0x41191f>=_0x4a46f4){_0x41191f=_0x4a46f4;_0x252da7=0xc8;}else{_0x252da7=0xce;}_0xd22e63[_0xd2e9('0x1a')](_0x252da7);return _0xd22e63[_0xd2e9('0x20')](_0xd2e9('0x21'),_0x27e36b+'-'+_0x41191f+'/'+_0x4a46f4)[_0xd2e9('0x1b')](_0xa77cee);}return null;};}function patchUpdates(_0x2aaa48){return function(_0x13ab44){try{jsonpatch['apply'](_0x13ab44,_0x2aaa48,!![]);}catch(_0x3b5be7){return BPromise[_0xd2e9('0x22')](_0x3b5be7);}return _0x13ab44[_0xd2e9('0x23')]();};}function saveUpdates(_0x3cfcc4,_0x12f219){return function(_0x3ef133){if(_0x3ef133){return _0x3ef133[_0xd2e9('0x24')](_0x3cfcc4)[_0xd2e9('0x25')](function(_0x242028){return _0x242028;});}return null;};}function removeEntity(_0x57fa22,_0x2073df){return function(_0x5ed761){if(_0x5ed761){return _0x5ed761[_0xd2e9('0x26')]()[_0xd2e9('0x25')](function(){_0x57fa22[_0xd2e9('0x1a')](0xcc)[_0xd2e9('0x27')]();});}};}function handleEntityNotFound(_0x480d31,_0x5f59b8){return function(_0x78d5d0){if(!_0x78d5d0){_0x480d31['sendStatus'](0x194);}return _0x78d5d0;};}function handleError(_0x35ef18,_0x40f2b2){_0x40f2b2=_0x40f2b2||0x1f4;return function(_0x15ad3d){logger[_0xd2e9('0x28')](_0x15ad3d[_0xd2e9('0x29')]);if(_0x15ad3d[_0xd2e9('0x2a')]){delete _0x15ad3d[_0xd2e9('0x2a')];}_0x35ef18['status'](_0x40f2b2)[_0xd2e9('0x2b')](_0x15ad3d);};}exports[_0xd2e9('0x2c')]=function(_0x284e69,_0x1ce933){var _0x2c91a4={},_0x289605={},_0x354562={'count':0x0,'rows':[]};var _0x5c985e=_[_0xd2e9('0x2d')](db[_0xd2e9('0x2e')][_0xd2e9('0x2f')],function(_0x352de0){return{'name':_0x352de0[_0xd2e9('0x30')],'type':_0x352de0[_0xd2e9('0x31')]['key']};});_0x289605[_0xd2e9('0x32')]=_[_0xd2e9('0x2d')](_0x5c985e,_0xd2e9('0x2a'));_0x289605[_0xd2e9('0x33')]=_['keys'](_0x284e69[_0xd2e9('0x33')]);_0x289605[_0xd2e9('0x34')]=_[_0xd2e9('0x35')](_0x289605[_0xd2e9('0x32')],_0x289605[_0xd2e9('0x33')]);_0x2c91a4[_0xd2e9('0x36')]=_[_0xd2e9('0x35')](_0x289605[_0xd2e9('0x32')],qs[_0xd2e9('0x37')](_0x284e69[_0xd2e9('0x33')][_0xd2e9('0x37')]));_0x2c91a4[_0xd2e9('0x36')]=_0x2c91a4[_0xd2e9('0x36')][_0xd2e9('0x38')]?_0x2c91a4[_0xd2e9('0x36')]:_0x289605[_0xd2e9('0x32')];if(!_0x284e69[_0xd2e9('0x33')]['hasOwnProperty'](_0xd2e9('0x39'))){_0x2c91a4[_0xd2e9('0x1e')]=qs[_0xd2e9('0x1e')](_0x284e69[_0xd2e9('0x33')][_0xd2e9('0x1e')]);_0x2c91a4[_0xd2e9('0x1c')]=qs[_0xd2e9('0x1c')](_0x284e69['query']['offset']);}_0x2c91a4[_0xd2e9('0x3a')]=qs[_0xd2e9('0x3b')](_0x284e69[_0xd2e9('0x33')]['sort']);_0x2c91a4[_0xd2e9('0x3c')]=qs[_0xd2e9('0x34')](_[_0xd2e9('0x3d')](_0x284e69[_0xd2e9('0x33')],_0x289605['filters']),_0x5c985e);if(_0x284e69['query'][_0xd2e9('0x3e')]){_0x2c91a4[_0xd2e9('0x3c')]=_[_0xd2e9('0x3f')](_0x2c91a4[_0xd2e9('0x3c')],{'$or':_[_0xd2e9('0x2d')](_0x5c985e,function(_0x4722b6){if(_0x4722b6[_0xd2e9('0x31')]!==_0xd2e9('0x40')){var _0x1151e1={};_0x1151e1[_0x4722b6[_0xd2e9('0x2a')]]={'$like':'%'+_0x284e69[_0xd2e9('0x33')][_0xd2e9('0x3e')]+'%'};return _0x1151e1;}})});}_0x2c91a4=_[_0xd2e9('0x3f')]({},_0x2c91a4,_0x284e69[_0xd2e9('0x41')]);var _0x3aacd3={'where':_0x2c91a4['where']};return db[_0xd2e9('0x2e')][_0xd2e9('0x1f')](_0x3aacd3)[_0xd2e9('0x25')](function(_0x31d940){_0x354562[_0xd2e9('0x1f')]=_0x31d940;if(_0x284e69[_0xd2e9('0x33')][_0xd2e9('0x42')]){_0x2c91a4[_0xd2e9('0x43')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xd2e9('0x44')](_0x2c91a4);})[_0xd2e9('0x25')](function(_0x4c4758){_0x354562[_0xd2e9('0x45')]=_0x4c4758;return _0x354562;})[_0xd2e9('0x25')](respondWithFilteredResult(_0x1ce933,_0x2c91a4))['catch'](handleError(_0x1ce933,null));};exports[_0xd2e9('0x46')]=function(_0x50aff9,_0x3c53a0){var _0x218175={'raw':!![],'where':{'id':_0x50aff9[_0xd2e9('0x47')]['id']}},_0x4eef51={};_0x4eef51[_0xd2e9('0x32')]=_[_0xd2e9('0x48')](db[_0xd2e9('0x2e')]['rawAttributes']);_0x4eef51[_0xd2e9('0x33')]=_['keys'](_0x50aff9['query']);_0x4eef51['filters']=_[_0xd2e9('0x35')](_0x4eef51[_0xd2e9('0x32')],_0x4eef51['query']);_0x218175['attributes']=_[_0xd2e9('0x35')](_0x4eef51['model'],qs[_0xd2e9('0x37')](_0x50aff9[_0xd2e9('0x33')][_0xd2e9('0x37')]));_0x218175['attributes']=_0x218175[_0xd2e9('0x36')][_0xd2e9('0x38')]?_0x218175[_0xd2e9('0x36')]:_0x4eef51[_0xd2e9('0x32')];if(_0x50aff9[_0xd2e9('0x33')][_0xd2e9('0x42')]){_0x218175['include']=[{'all':!![]}];}_0x218175=_[_0xd2e9('0x3f')]({},_0x218175,_0x50aff9[_0xd2e9('0x41')]);return db[_0xd2e9('0x2e')][_0xd2e9('0x49')](_0x218175)[_0xd2e9('0x25')](handleEntityNotFound(_0x3c53a0,null))[_0xd2e9('0x25')](respondWithResult(_0x3c53a0,null))[_0xd2e9('0x4a')](handleError(_0x3c53a0,null));};exports[_0xd2e9('0x4b')]=function(_0x30b1de,_0x38d35d){return db[_0xd2e9('0x2e')][_0xd2e9('0x4b')](_0x30b1de[_0xd2e9('0x4c')],{})[_0xd2e9('0x25')](respondWithResult(_0x38d35d,0xc9))[_0xd2e9('0x4a')](handleError(_0x38d35d,null));};exports[_0xd2e9('0x24')]=function(_0x406682,_0x558f2b){if(_0x406682[_0xd2e9('0x4c')]['id']){delete _0x406682[_0xd2e9('0x4c')]['id'];}return db[_0xd2e9('0x2e')]['find']({'where':{'id':_0x406682[_0xd2e9('0x47')]['id']}})[_0xd2e9('0x25')](handleEntityNotFound(_0x558f2b,null))[_0xd2e9('0x25')](saveUpdates(_0x406682[_0xd2e9('0x4c')],null))[_0xd2e9('0x25')](respondWithResult(_0x558f2b,null))[_0xd2e9('0x4a')](handleError(_0x558f2b,null));};exports[_0xd2e9('0x26')]=function(_0x5bbeb7,_0x374028){return db[_0xd2e9('0x2e')]['find']({'where':{'id':_0x5bbeb7['params']['id']}})[_0xd2e9('0x25')](handleEntityNotFound(_0x374028,null))['then'](removeEntity(_0x374028,null))[_0xd2e9('0x4a')](handleError(_0x374028,null));};exports[_0xd2e9('0x4d')]=function(_0x20037c,_0x5222e1){return db[_0xd2e9('0x2e')][_0xd2e9('0x4d')]()['then'](respondWithResult(_0x5222e1,null))[_0xd2e9('0x4a')](handleError(_0x5222e1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index add4e36..60e4f77 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 _0x23b6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','FaxTransferReport','uniqueid','lodash'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x23b6,0xd7));var _0x623b=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x23b6[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require(_0x623b('0x0'));var util=require(_0x623b('0x1'));var logger=require('../../config/logger')(_0x623b('0x2'));var moment=require(_0x623b('0x3'));var BPromise=require(_0x623b('0x4'));var rp=require(_0x623b('0x5'));var fs=require('fs');var path=require(_0x623b('0x6'));var rimraf=require(_0x623b('0x7'));var config=require(_0x623b('0x8'));var attributes=require(_0x623b('0x9'));module['exports']=function(_0x5d077b,_0x5cb588){return _0x5d077b['define'](_0x623b('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x623b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1707=['moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1707,0x1df));var _0x7170=function(_0x15ed32,_0x5ae1eb){_0x15ed32=_0x15ed32-0x0;var _0x483a05=_0x1707[_0x15ed32];return _0x483a05;};'use strict';var _=require(_0x7170('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7170('0x1'));var BPromise=require(_0x7170('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7170('0x3'));var rimraf=require(_0x7170('0x4'));var config=require(_0x7170('0x5'));var attributes=require(_0x7170('0x6'));module[_0x7170('0x7')]=function(_0x19d043,_0x215acb){return _0x19d043[_0x7170('0x8')](_0x7170('0x9'),attributes,{'tableName':_0x7170('0xa'),'paranoid':![],'indexes':[{'name':_0x7170('0xb'),'fields':[_0x7170('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index fb0ce13..6127599 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 _0xd92b=['then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xd92b,0x11a));var _0xbd92=function(_0x202bde,_0x2d4b47){_0x202bde=_0x202bde-0x0;var _0x3ef2b7=_0xd92b[_0x202bde];return _0x3ef2b7;};'use strict';var _=require(_0xbd92('0x0'));var util=require(_0xbd92('0x1'));var moment=require(_0xbd92('0x2'));var BPromise=require(_0xbd92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd92('0x5'));var logger=require(_0xbd92('0x6'))(_0xbd92('0x7'));var config=require(_0xbd92('0x8'));var jayson=require(_0xbd92('0x9'));var client=jayson['client'][_0xbd92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x476230,_0x2e173d,_0x4bd724){return new BPromise(function(_0x3897e0,_0x824c52){return client[_0xbd92('0xb')](_0x476230,_0x4bd724)[_0xbd92('0xc')](function(_0x5d7ee0){logger[_0xbd92('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x2e173d,'request\x20sent');logger[_0xbd92('0xe')](_0xbd92('0xf'),_0x2e173d,_0xbd92('0x10'),JSON['stringify'](_0x5d7ee0));if(_0x5d7ee0['error']){if(_0x5d7ee0[_0xbd92('0x11')]['code']===0x1f4){logger[_0xbd92('0x11')](_0xbd92('0x12'),_0x2e173d,_0x5d7ee0[_0xbd92('0x11')]['message']);return _0x824c52(_0x5d7ee0[_0xbd92('0x11')]['message']);}logger[_0xbd92('0x11')](_0xbd92('0x12'),_0x2e173d,_0x5d7ee0[_0xbd92('0x11')][_0xbd92('0x13')]);return _0x3897e0(_0x5d7ee0[_0xbd92('0x11')][_0xbd92('0x13')]);}else{logger[_0xbd92('0xd')](_0xbd92('0x12'),_0x2e173d,_0xbd92('0x10'));_0x3897e0(_0x5d7ee0['result'][_0xbd92('0x13')]);}})[_0xbd92('0x14')](function(_0x5f290e){logger[_0xbd92('0x11')](_0xbd92('0x12'),_0x2e173d,_0x5f290e);_0x824c52(_0x5f290e);});});} \ No newline at end of file +var _0xbab0=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxTransferReport,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x449e37,_0xc0a199){var _0x1fbe57=function(_0x2e9a1d){while(--_0x2e9a1d){_0x449e37['push'](_0x449e37['shift']());}};_0x1fbe57(++_0xc0a199);}(_0xbab0,0xb0));var _0x0bab=function(_0x109b8e,_0xde6fbc){_0x109b8e=_0x109b8e-0x0;var _0x46b673=_0xbab0[_0x109b8e];return _0x46b673;};'use strict';var _=require(_0x0bab('0x0'));var util=require(_0x0bab('0x1'));var moment=require(_0x0bab('0x2'));var BPromise=require(_0x0bab('0x3'));var rs=require(_0x0bab('0x4'));var fs=require('fs');var Redis=require(_0x0bab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bab('0x6'));var logger=require(_0x0bab('0x7'))('rpc');var config=require(_0x0bab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44a06b,_0x4665b9,_0x172a47){return new BPromise(function(_0x39bf33,_0x1069df){return client['request'](_0x44a06b,_0x172a47)['then'](function(_0x18d7aa){logger[_0x0bab('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x4665b9,_0x0bab('0xb'));logger[_0x0bab('0xc')](_0x0bab('0xd'),_0x4665b9,_0x0bab('0xb'),JSON[_0x0bab('0xe')](_0x18d7aa));if(_0x18d7aa[_0x0bab('0xf')]){if(_0x18d7aa[_0x0bab('0xf')]['code']===0x1f4){logger[_0x0bab('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x4665b9,_0x18d7aa[_0x0bab('0xf')][_0x0bab('0x10')]);return _0x1069df(_0x18d7aa[_0x0bab('0xf')][_0x0bab('0x10')]);}logger['error'](_0x0bab('0x11'),_0x4665b9,_0x18d7aa[_0x0bab('0xf')][_0x0bab('0x10')]);return _0x39bf33(_0x18d7aa[_0x0bab('0xf')][_0x0bab('0x10')]);}else{logger[_0x0bab('0xa')](_0x0bab('0x11'),_0x4665b9,'request\x20sent');_0x39bf33(_0x18d7aa['result'][_0x0bab('0x10')]);}})['catch'](function(_0x7e41c0){logger[_0x0bab('0xf')](_0x0bab('0x11'),_0x4665b9,_0x7e41c0);_0x1069df(_0x7e41c0);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 5e71270..fab97a6 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 _0xc4fd=['create','put','update','delete','exports','path','express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x5937eb,_0x3c35cf){var _0x535a99=function(_0x42a511){while(--_0x42a511){_0x5937eb['push'](_0x5937eb['shift']());}};_0x535a99(++_0x3c35cf);}(_0xc4fd,0x7c));var _0xdc4f=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xc4fd[_0x231dda];return _0x3f88cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc4f('0x0'));var timeout=require('connect-timeout');var express=require(_0xdc4f('0x1'));var router=express[_0xdc4f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdc4f('0x3'));var config=require(_0xdc4f('0x4'));var controller=require(_0xdc4f('0x5'));router['get']('/',auth[_0xdc4f('0x6')](),controller['index']);router[_0xdc4f('0x7')](_0xdc4f('0x8'),auth['isAuthenticated'](),controller[_0xdc4f('0x9')]);router[_0xdc4f('0x7')](_0xdc4f('0xa'),auth[_0xdc4f('0x6')](),controller[_0xdc4f('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdc4f('0xc')]);router[_0xdc4f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xdc4f('0xe')]);router[_0xdc4f('0xf')](_0xdc4f('0xa'),auth[_0xdc4f('0x6')](),controller['destroy']);module[_0xdc4f('0x10')]=router; \ No newline at end of file +var _0xf0a1=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0xf0a1,0x7d));var _0x1f0a=function(_0x1a14a0,_0x149757){_0x1a14a0=_0x1a14a0-0x0;var _0x4fe17c=_0xf0a1[_0x1a14a0];return _0x4fe17c;};'use strict';var multer=require(_0x1f0a('0x0'));var util=require(_0x1f0a('0x1'));var path=require('path');var timeout=require(_0x1f0a('0x2'));var express=require(_0x1f0a('0x3'));var router=express[_0x1f0a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1f0a('0x5'));var interaction=require(_0x1f0a('0x6'));var config=require(_0x1f0a('0x7'));var controller=require(_0x1f0a('0x8'));router[_0x1f0a('0x9')]('/',auth[_0x1f0a('0xa')](),controller[_0x1f0a('0xb')]);router[_0x1f0a('0x9')](_0x1f0a('0xc'),auth[_0x1f0a('0xa')](),controller[_0x1f0a('0xd')]);router[_0x1f0a('0x9')](_0x1f0a('0xe'),auth[_0x1f0a('0xa')](),controller[_0x1f0a('0xf')]);router[_0x1f0a('0x10')]('/',auth['isAuthenticated'](),controller[_0x1f0a('0x11')]);router[_0x1f0a('0x12')]('/:id',auth[_0x1f0a('0xa')](),controller[_0x1f0a('0x13')]);router[_0x1f0a('0x14')](_0x1f0a('0xe'),auth['isAuthenticated'](),controller[_0x1f0a('0x15')]);module[_0x1f0a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a6299cb..5465632 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 _0x73ea=['/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations'];(function(_0x4c3c7f,_0x5d6651){var _0x5f1d7b=function(_0x2c53b6){while(--_0x2c53b6){_0x4c3c7f['push'](_0x4c3c7f['shift']());}};_0x5f1d7b(++_0x5d6651);}(_0x73ea,0x110));var _0xa73e=function(_0x4b9f06,_0x770bcd){_0x4b9f06=_0x4b9f06-0x0;var _0xacc734=_0x73ea[_0x4b9f06];return _0xacc734;};'use strict';var multer=require(_0xa73e('0x0'));var util=require(_0xa73e('0x1'));var path=require('path');var timeout=require(_0xa73e('0x2'));var express=require(_0xa73e('0x3'));var router=express[_0xa73e('0x4')]();var fs_extra=require(_0xa73e('0x5'));var auth=require(_0xa73e('0x6'));var interaction=require(_0xa73e('0x7'));var config=require(_0xa73e('0x8'));var controller=require(_0xa73e('0x9'));router['get']('/',auth[_0xa73e('0xa')](),controller[_0xa73e('0xb')]);router['get'](_0xa73e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa73e('0xd')](_0xa73e('0xe'),auth[_0xa73e('0xa')](),controller[_0xa73e('0xf')]);router['get'](_0xa73e('0x10'),auth[_0xa73e('0xa')](),controller[_0xa73e('0x11')]);router[_0xa73e('0x12')]('/',auth['isAuthenticated'](),controller[_0xa73e('0x13')]);router[_0xa73e('0x12')]('/:id/configurations',auth[_0xa73e('0xa')](),controller['addConfiguration']);router[_0xa73e('0x14')](_0xa73e('0xc'),auth[_0xa73e('0xa')](),controller[_0xa73e('0x15')]);router[_0xa73e('0x16')](_0xa73e('0xc'),auth[_0xa73e('0xa')](),controller[_0xa73e('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6242=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x1ca66c,_0x3e3868){var _0x5a78ce=function(_0x5432ac){while(--_0x5432ac){_0x1ca66c['push'](_0x1ca66c['shift']());}};_0x5a78ce(++_0x3e3868);}(_0x6242,0x6e));var _0x2624=function(_0x356142,_0x6235dd){_0x356142=_0x356142-0x0;var _0x208234=_0x6242[_0x356142];return _0x208234;};'use strict';var multer=require(_0x2624('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2624('0x1'));var express=require(_0x2624('0x2'));var router=express[_0x2624('0x3')]();var fs_extra=require(_0x2624('0x4'));var auth=require(_0x2624('0x5'));var interaction=require(_0x2624('0x6'));var config=require(_0x2624('0x7'));var controller=require(_0x2624('0x8'));router['get']('/',auth[_0x2624('0x9')](),controller[_0x2624('0xa')]);router[_0x2624('0xb')](_0x2624('0xc'),auth[_0x2624('0x9')](),controller[_0x2624('0xd')]);router[_0x2624('0xb')]('/:id/configurations',auth[_0x2624('0x9')](),controller[_0x2624('0xe')]);router[_0x2624('0xb')](_0x2624('0xf'),auth[_0x2624('0x9')](),controller[_0x2624('0x10')]);router['post']('/',auth[_0x2624('0x9')](),controller['create']);router['post'](_0x2624('0x11'),auth[_0x2624('0x9')](),controller[_0x2624('0x12')]);router[_0x2624('0x13')](_0x2624('0xc'),auth[_0x2624('0x9')](),controller[_0x2624('0x14')]);router[_0x2624('0x15')]('/:id',auth[_0x2624('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f62276d..053de08 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 _0x89fb=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x5b2a15,_0xd200ec){var _0x33038d=function(_0x4150a2){while(--_0x4150a2){_0x5b2a15['push'](_0x5b2a15['shift']());}};_0x33038d(++_0xd200ec);}(_0x89fb,0xfc));var _0xb89f=function(_0x21f996,_0x37ef0e){_0x21f996=_0x21f996-0x0;var _0x2e3a1f=_0x89fb[_0x21f996];return _0x2e3a1f;};'use strict';var Sequelize=require(_0xb89f('0x0'));module[_0xb89f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb89f('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb89f('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xb89f('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xb89f('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xb89f('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb89f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb89f('0x4')](_0xb89f('0x5'),_0xb89f('0x6')),'defaultValue':_0xb89f('0x5')}}; \ No newline at end of file +var _0x11ba=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x3af2f4,_0xc2a094){var _0x5dd492=function(_0x478873){while(--_0x478873){_0x3af2f4['push'](_0x3af2f4['shift']());}};_0x5dd492(++_0xc2a094);}(_0x11ba,0x1d1));var _0xa11b=function(_0x1e9c9d,_0x32bdc3){_0x1e9c9d=_0x1e9c9d-0x0;var _0xd7635e=_0x11ba[_0x1e9c9d];return _0xd7635e;};'use strict';var Sequelize=require(_0xa11b('0x0'));module[_0xa11b('0x1')]={'name':{'type':Sequelize[_0xa11b('0x2')]},'description':{'type':Sequelize[_0xa11b('0x2')]},'username':{'type':Sequelize[_0xa11b('0x2')]},'remoteUri':{'type':Sequelize[_0xa11b('0x2')]},'authType':{'type':Sequelize[_0xa11b('0x3')](_0xa11b('0x4')),'defaultValue':_0xa11b('0x4')},'password':{'type':Sequelize[_0xa11b('0x2')]},'consumerKey':{'type':Sequelize[_0xa11b('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xa11b('0x2')]},'serverUrl':{'type':Sequelize[_0xa11b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa11b('0x5'),_0xa11b('0x6')),'defaultValue':_0xa11b('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index bacefcd..e593300 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 _0x9cc9=['findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','DeskConfiguration','order','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','application/json','Authorization','format','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskAccount','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0xca098c,_0x286c62){var _0x20bfe8=function(_0x147153){while(--_0x147153){_0xca098c['push'](_0xca098c['shift']());}};_0x20bfe8(++_0x286c62);}(_0x9cc9,0x1e7));var _0x99cc=function(_0xfb7b54,_0x1294f6){_0xfb7b54=_0xfb7b54-0x0;var _0x504458=_0x9cc9[_0xfb7b54];return _0x504458;};'use strict';var emlformat=require(_0x99cc('0x0'));var rimraf=require(_0x99cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99cc('0x2'));var rp=require(_0x99cc('0x3'));var moment=require('moment');var BPromise=require(_0x99cc('0x4'));var Mustache=require(_0x99cc('0x5'));var util=require(_0x99cc('0x6'));var path=require('path');var sox=require(_0x99cc('0x7'));var csv=require(_0x99cc('0x8'));var ejs=require(_0x99cc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99cc('0xa'));var squel=require(_0x99cc('0xb'));var crypto=require(_0x99cc('0xc'));var jsforce=require(_0x99cc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x99cc('0xf'));var qs=require(_0x99cc('0x10'));var as=require(_0x99cc('0x11'));var hardwareService=require(_0x99cc('0x12'));var logger=require(_0x99cc('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x99cc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42acff,_0x1703a0){_0x1703a0=_0x1703a0||0xcc;return function(_0x4f6f88){if(_0x4f6f88){return _0x42acff[_0x99cc('0x15')](_0x1703a0);}return _0x42acff[_0x99cc('0x16')](_0x1703a0)[_0x99cc('0x17')]();};}function respondWithResult(_0x751f24,_0x5d8fab){_0x5d8fab=_0x5d8fab||0xc8;return function(_0x271822){if(_0x271822){return _0x751f24['status'](_0x5d8fab)['json'](_0x271822);}};}function respondWithFilteredResult(_0x2ecbac,_0x33e74c){return function(_0x3c8b80){if(_0x3c8b80){var _0x294376=typeof _0x33e74c[_0x99cc('0x18')]===_0x99cc('0x19')&&typeof _0x33e74c[_0x99cc('0x1a')]===_0x99cc('0x19');var _0x5b7b88=_0x3c8b80[_0x99cc('0x1b')];var _0x189a6d=_0x294376?0x0:_0x33e74c[_0x99cc('0x18')];var _0x141bc8=_0x294376?_0x3c8b80[_0x99cc('0x1b')]:_0x33e74c[_0x99cc('0x18')]+_0x33e74c[_0x99cc('0x1a')];var _0x58e719;if(_0x141bc8>=_0x5b7b88){_0x141bc8=_0x5b7b88;_0x58e719=0xc8;}else{_0x58e719=0xce;}_0x2ecbac[_0x99cc('0x16')](_0x58e719);return _0x2ecbac['set'](_0x99cc('0x1c'),_0x189a6d+'-'+_0x141bc8+'/'+_0x5b7b88)['json'](_0x3c8b80);}return null;};}function patchUpdates(_0x2d5d52){return function(_0xffdccf){try{jsonpatch[_0x99cc('0x1d')](_0xffdccf,_0x2d5d52,!![]);}catch(_0x4b1853){return BPromise[_0x99cc('0x1e')](_0x4b1853);}return _0xffdccf['save']();};}function saveUpdates(_0x5185c7,_0x57ece0){return function(_0x4fbb53){if(_0x4fbb53){return _0x4fbb53[_0x99cc('0x1f')](_0x5185c7)[_0x99cc('0x20')](function(_0x17d5e0){return _0x17d5e0;});}return null;};}function removeEntity(_0x5e2ae8,_0x5acad0){return function(_0x41721f){if(_0x41721f){return _0x41721f[_0x99cc('0x21')]()[_0x99cc('0x20')](function(){_0x5e2ae8['status'](0xcc)[_0x99cc('0x17')]();});}};}function handleEntityNotFound(_0x5def3f,_0x5317af){return function(_0xbcadb3){if(!_0xbcadb3){_0x5def3f[_0x99cc('0x15')](0x194);}return _0xbcadb3;};}function handleError(_0x29e333,_0x8f1115){_0x8f1115=_0x8f1115||0x1f4;return function(_0x1fb550){logger[_0x99cc('0x22')](_0x1fb550[_0x99cc('0x23')]);if(_0x1fb550[_0x99cc('0x24')]){delete _0x1fb550[_0x99cc('0x24')];}_0x29e333[_0x99cc('0x16')](_0x8f1115)[_0x99cc('0x25')](_0x1fb550);};}exports[_0x99cc('0x26')]=function(_0x5e83f6,_0x344e70){var _0x41ec89={},_0x67650c={},_0x5bfcd3={'count':0x0,'rows':[]};var _0x5885f9=_[_0x99cc('0x27')](db[_0x99cc('0x28')]['rawAttributes'],function(_0x3e1cb1){return{'name':_0x3e1cb1['fieldName'],'type':_0x3e1cb1['type'][_0x99cc('0x29')]};});_0x67650c[_0x99cc('0x2a')]=_[_0x99cc('0x27')](_0x5885f9,_0x99cc('0x24'));_0x67650c[_0x99cc('0x2b')]=_[_0x99cc('0x2c')](_0x5e83f6[_0x99cc('0x2b')]);_0x67650c[_0x99cc('0x2d')]=_[_0x99cc('0x2e')](_0x67650c[_0x99cc('0x2a')],_0x67650c['query']);_0x41ec89[_0x99cc('0x2f')]=_[_0x99cc('0x2e')](_0x67650c['model'],qs[_0x99cc('0x30')](_0x5e83f6[_0x99cc('0x2b')][_0x99cc('0x30')]));_0x41ec89[_0x99cc('0x2f')]=_0x41ec89[_0x99cc('0x2f')][_0x99cc('0x31')]?_0x41ec89[_0x99cc('0x2f')]:_0x67650c[_0x99cc('0x2a')];if(!_0x5e83f6[_0x99cc('0x2b')]['hasOwnProperty'](_0x99cc('0x32'))){_0x41ec89['limit']=qs['limit'](_0x5e83f6['query'][_0x99cc('0x1a')]);_0x41ec89[_0x99cc('0x18')]=qs[_0x99cc('0x18')](_0x5e83f6[_0x99cc('0x2b')][_0x99cc('0x18')]);}_0x41ec89['order']=qs['sort'](_0x5e83f6['query'][_0x99cc('0x33')]);_0x41ec89[_0x99cc('0x34')]=qs[_0x99cc('0x2d')](_['pick'](_0x5e83f6[_0x99cc('0x2b')],_0x67650c['filters']),_0x5885f9);if(_0x5e83f6['query'][_0x99cc('0x35')]){_0x41ec89[_0x99cc('0x34')]=_[_0x99cc('0x36')](_0x41ec89[_0x99cc('0x34')],{'$or':_[_0x99cc('0x27')](_0x5885f9,function(_0x1ded35){if(_0x1ded35[_0x99cc('0x37')]!==_0x99cc('0x38')){var _0x3ee38b={};_0x3ee38b[_0x1ded35[_0x99cc('0x24')]]={'$like':'%'+_0x5e83f6[_0x99cc('0x2b')][_0x99cc('0x35')]+'%'};return _0x3ee38b;}})});}_0x41ec89=_[_0x99cc('0x36')]({},_0x41ec89,_0x5e83f6[_0x99cc('0x39')]);var _0x65e7b={'where':_0x41ec89['where']};return db['DeskAccount'][_0x99cc('0x1b')](_0x65e7b)[_0x99cc('0x20')](function(_0x2a4250){_0x5bfcd3[_0x99cc('0x1b')]=_0x2a4250;if(_0x5e83f6[_0x99cc('0x2b')]['includeAll']){_0x41ec89['include']=[{'all':!![]}];}return db['DeskAccount'][_0x99cc('0x3a')](_0x41ec89);})[_0x99cc('0x20')](function(_0x3f7273){_0x5bfcd3[_0x99cc('0x3b')]=_0x3f7273;return _0x5bfcd3;})[_0x99cc('0x20')](respondWithFilteredResult(_0x344e70,_0x41ec89))[_0x99cc('0x3c')](handleError(_0x344e70,null));};exports[_0x99cc('0x3d')]=function(_0x472bb9,_0x274825){var _0x24b512={'raw':![],'where':{'id':_0x472bb9[_0x99cc('0x3e')]['id']}},_0x2f2c61={};_0x2f2c61[_0x99cc('0x2a')]=_['keys'](db[_0x99cc('0x28')][_0x99cc('0x3f')]);_0x2f2c61[_0x99cc('0x2b')]=_[_0x99cc('0x2c')](_0x472bb9[_0x99cc('0x2b')]);_0x2f2c61['filters']=_[_0x99cc('0x2e')](_0x2f2c61['model'],_0x2f2c61[_0x99cc('0x2b')]);_0x24b512[_0x99cc('0x2f')]=_[_0x99cc('0x2e')](_0x2f2c61[_0x99cc('0x2a')],qs[_0x99cc('0x30')](_0x472bb9['query'][_0x99cc('0x30')]));_0x24b512[_0x99cc('0x2f')]=_0x24b512[_0x99cc('0x2f')][_0x99cc('0x31')]?_0x24b512[_0x99cc('0x2f')]:_0x2f2c61[_0x99cc('0x2a')];if(_0x472bb9[_0x99cc('0x2b')][_0x99cc('0x40')]){_0x24b512['include']=[{'all':!![]}];}_0x24b512=_[_0x99cc('0x36')]({},_0x24b512,_0x472bb9[_0x99cc('0x39')]);return db[_0x99cc('0x28')][_0x99cc('0x41')](_0x24b512)[_0x99cc('0x20')](handleEntityNotFound(_0x274825,null))[_0x99cc('0x20')](respondWithResult(_0x274825,null))[_0x99cc('0x3c')](handleError(_0x274825,null));};exports['create']=function(_0x309d95,_0x1e9962){return db[_0x99cc('0x28')][_0x99cc('0x42')](_0x309d95[_0x99cc('0x43')],{})[_0x99cc('0x20')](respondWithResult(_0x1e9962,0xc9))[_0x99cc('0x3c')](handleError(_0x1e9962,null));};exports[_0x99cc('0x1f')]=function(_0x3e8d38,_0x3d275d){if(_0x3e8d38[_0x99cc('0x43')]['id']){delete _0x3e8d38[_0x99cc('0x43')]['id'];}return db[_0x99cc('0x28')][_0x99cc('0x41')]({'where':{'id':_0x3e8d38[_0x99cc('0x3e')]['id']}})[_0x99cc('0x20')](handleEntityNotFound(_0x3d275d,null))[_0x99cc('0x20')](saveUpdates(_0x3e8d38[_0x99cc('0x43')],null))[_0x99cc('0x20')](respondWithResult(_0x3d275d,null))['catch'](handleError(_0x3d275d,null));};exports[_0x99cc('0x21')]=function(_0x5c632d,_0x42fe9a){return db[_0x99cc('0x28')][_0x99cc('0x41')]({'where':{'id':_0x5c632d[_0x99cc('0x3e')]['id']}})[_0x99cc('0x20')](handleEntityNotFound(_0x42fe9a,null))[_0x99cc('0x20')](removeEntity(_0x42fe9a,null))['catch'](handleError(_0x42fe9a,null));};exports[_0x99cc('0x44')]=function(_0x4076f9,_0x3eed23,_0xd117bf){var _0x5dade2={};var _0x360bee={};var _0xe19c7b;var _0x227881;return db[_0x99cc('0x28')][_0x99cc('0x45')]({'where':{'id':_0x4076f9[_0x99cc('0x3e')]['id']}})[_0x99cc('0x20')](handleEntityNotFound(_0x3eed23,null))[_0x99cc('0x20')](function(_0x224b58){if(_0x224b58){_0xe19c7b=_0x224b58;_0x360bee['model']=_[_0x99cc('0x2c')](db[_0x99cc('0x46')][_0x99cc('0x3f')]);_0x360bee[_0x99cc('0x2b')]=_['keys'](_0x4076f9[_0x99cc('0x2b')]);_0x360bee[_0x99cc('0x2d')]=_[_0x99cc('0x2e')](_0x360bee[_0x99cc('0x2a')],_0x360bee[_0x99cc('0x2b')]);_0x5dade2[_0x99cc('0x2f')]=_['intersection'](_0x360bee[_0x99cc('0x2a')],qs[_0x99cc('0x30')](_0x4076f9['query']['fields']));_0x5dade2[_0x99cc('0x2f')]=_0x5dade2[_0x99cc('0x2f')][_0x99cc('0x31')]?_0x5dade2[_0x99cc('0x2f')]:_0x360bee['model'];_0x5dade2[_0x99cc('0x47')]=qs['sort'](_0x4076f9['query'][_0x99cc('0x33')]);_0x5dade2['where']=qs[_0x99cc('0x2d')](_[_0x99cc('0x48')](_0x4076f9[_0x99cc('0x2b')],_0x360bee[_0x99cc('0x2d')]));if(_0x4076f9[_0x99cc('0x2b')]['filter']){_0x5dade2[_0x99cc('0x34')]=_[_0x99cc('0x36')](_0x5dade2[_0x99cc('0x34')],{'$or':_[_0x99cc('0x27')](_0x5dade2['attributes'],function(_0x4a5975){var _0x5782ca={};_0x5782ca[_0x4a5975]={'$like':'%'+_0x4076f9[_0x99cc('0x2b')][_0x99cc('0x35')]+'%'};return _0x5782ca;})});}_0x5dade2=_[_0x99cc('0x36')]({},_0x5dade2,_0x4076f9[_0x99cc('0x39')]);return _0xe19c7b['getConfigurations'](_0x5dade2);}})['then'](function(_0x4c28a2){if(_0x4c28a2){_0x227881=_0x4c28a2[_0x99cc('0x31')];if(!_0x4076f9[_0x99cc('0x2b')][_0x99cc('0x49')](_0x99cc('0x32'))){_0x5dade2['limit']=qs[_0x99cc('0x1a')](_0x4076f9[_0x99cc('0x2b')][_0x99cc('0x1a')]);_0x5dade2['offset']=qs[_0x99cc('0x18')](_0x4076f9[_0x99cc('0x2b')][_0x99cc('0x18')]);}return _0xe19c7b[_0x99cc('0x44')](_0x5dade2);}})['then'](function(_0x17f052){if(_0x17f052){return _0x17f052?{'count':_0x227881,'rows':_0x17f052}:null;}})[_0x99cc('0x20')](respondWithResult(_0x3eed23,null))[_0x99cc('0x3c')](handleError(_0x3eed23,null));};exports[_0x99cc('0x4a')]=function(_0x52f0a6,_0x2fe9c6,_0x489c1b){if(_0x52f0a6[_0x99cc('0x43')]['id']){delete _0x52f0a6[_0x99cc('0x43')]['id'];}return db[_0x99cc('0x28')][_0x99cc('0x45')]({'where':{'id':_0x52f0a6[_0x99cc('0x3e')]['id']}})[_0x99cc('0x20')](handleEntityNotFound(_0x2fe9c6,null))['then'](function(_0x16cbf7){if(_0x16cbf7){_0x52f0a6['body'][_0x99cc('0x4b')]=_0x16cbf7['id'];_0x52f0a6['body'][_0x99cc('0x4c')]=integrations['getSubjects'](_0x52f0a6[_0x99cc('0x43')]['channel'],_0x52f0a6[_0x99cc('0x43')][_0x99cc('0x37')]);_0x52f0a6['body'][_0x99cc('0x4d')]=integrations[_0x99cc('0x4e')](_0x52f0a6[_0x99cc('0x43')][_0x99cc('0x4f')],_0x52f0a6[_0x99cc('0x43')][_0x99cc('0x37')]);return db[_0x99cc('0x46')][_0x99cc('0x42')](_0x52f0a6['body'],{'include':[{'model':db[_0x99cc('0x50')],'as':'Subjects'},{'model':db[_0x99cc('0x50')],'as':_0x99cc('0x4d')}]});}return null;})[_0x99cc('0x20')](respondWithResult(_0x2fe9c6,null))['catch'](handleError(_0x2fe9c6,null));};exports[_0x99cc('0x51')]=function(_0x4cba63,_0x26e242,_0x21ab1e){var _0x1417ce=[{'name':_0x99cc('0x52'),'label':_0x99cc('0x52'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xd3ab34='';return db[_0x99cc('0x28')][_0x99cc('0x45')]({'where':{'id':_0x4cba63[_0x99cc('0x3e')]['id']},'attributes':['id',_0x99cc('0x53'),_0x99cc('0x54'),_0x99cc('0x55'),_0x99cc('0x56'),_0x99cc('0x57'),_0x99cc('0x58'),'token',_0x99cc('0x59')]})[_0x99cc('0x20')](handleEntityNotFound(_0x26e242,null))['then'](function(_0x22054f){if(_0x22054f){_0xd3ab34=_0x22054f[_0x99cc('0x53')];var _0x3f746d=_0xd3ab34['slice'](-0x1);if(_0x3f746d==='/'){_0xd3ab34=_0xd3ab34[_0x99cc('0x5a')](0x0,_0xd3ab34[_0x99cc('0x5b')](_0x3f746d));}var _0x5f05bc={'method':_0x99cc('0x5c'),'uri':util['format'](_0x99cc('0x5d'),_0xd3ab34),'headers':{'Content-Type':_0x99cc('0x5e'),'Accept':_0x99cc('0x5e')},'json':!![]};if(_0x22054f[_0x99cc('0x54')]==='basic'){_0x5f05bc['headers'][_0x99cc('0x5f')]=util[_0x99cc('0x60')](_0x99cc('0x61'),new Buffer(util[_0x99cc('0x60')](_0x99cc('0x62'),_0x22054f[_0x99cc('0x55')],_0x22054f[_0x99cc('0x56')]))[_0x99cc('0x63')](_0x99cc('0x64')));}return rp(_0x5f05bc)[_0x99cc('0x20')](function(_0x4c0259){return _0x1417ce[_0x99cc('0x65')](_[_0x99cc('0x27')](_0x4c0259['_embedded'][_0x99cc('0x66')],function(_0x54872b){return{'id':_0x54872b[_0x99cc('0x24')],'name':_0x54872b[_0x99cc('0x24')],'type':_0x54872b['type'],'active':_0x54872b[_0x99cc('0x67')],'label':_0x54872b[_0x99cc('0x68')],'custom':!![]};}));});}})['then'](function(_0x4fa0eb){return{'count':_0x4fa0eb[_0x99cc('0x31')],'rows':_0x4fa0eb};})[_0x99cc('0x20')](respondWithResult(_0x26e242,null))[_0x99cc('0x3c')](function(_0x34aded){var _0xbe562=_0x4cba63[_0x99cc('0x2b')][_0x99cc('0x69')]?0x1f4:_0x34aded[_0x99cc('0x6a')]||0x1f4;logger[_0x99cc('0x22')](_0x99cc('0x6b'),_0x99cc('0x51'),_0xbe562,JSON[_0x99cc('0x6c')](_0x34aded));delete _0x34aded[_0x99cc('0x24')];if(_0xbe562===0x191){_0xbe562=0x190;}_0x26e242[_0x99cc('0x16')](_0xbe562)[_0x99cc('0x25')](_0x4cba63['query'][_0x99cc('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x34aded['statusCode']}:_0x34aded);});}; \ No newline at end of file +var _0x5ee9=['type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','length','create','body','find','params','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','format','base64','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName'];(function(_0x12f9a5,_0x3b0c6d){var _0x240702=function(_0x15d813){while(--_0x15d813){_0x12f9a5['push'](_0x12f9a5['shift']());}};_0x240702(++_0x3b0c6d);}(_0x5ee9,0xb9));var _0x95ee=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x5ee9[_0x40220a];return _0x3903cc;};'use strict';var emlformat=require(_0x95ee('0x0'));var rimraf=require(_0x95ee('0x1'));var zipdir=require(_0x95ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x95ee('0x3'));var BPromise=require(_0x95ee('0x4'));var Mustache=require(_0x95ee('0x5'));var util=require(_0x95ee('0x6'));var path=require(_0x95ee('0x7'));var sox=require(_0x95ee('0x8'));var csv=require(_0x95ee('0x9'));var ejs=require(_0x95ee('0xa'));var fs=require('fs');var fs_extra=require(_0x95ee('0xb'));var _=require('lodash');var squel=require(_0x95ee('0xc'));var crypto=require(_0x95ee('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x95ee('0xe'));var Papa=require(_0x95ee('0xf'));var Redis=require(_0x95ee('0x10'));var authService=require(_0x95ee('0x11'));var qs=require(_0x95ee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ee('0x13'))(_0x95ee('0x14'));var utils=require(_0x95ee('0x15'));var config=require(_0x95ee('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x95ee('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44d8e4,_0x16d1b6){_0x16d1b6=_0x16d1b6||0xcc;return function(_0x2d3db0){if(_0x2d3db0){return _0x44d8e4[_0x95ee('0x18')](_0x16d1b6);}return _0x44d8e4[_0x95ee('0x19')](_0x16d1b6)['end']();};}function respondWithResult(_0x2cbe19,_0x6af3dd){_0x6af3dd=_0x6af3dd||0xc8;return function(_0x7d3939){if(_0x7d3939){return _0x2cbe19[_0x95ee('0x19')](_0x6af3dd)[_0x95ee('0x1a')](_0x7d3939);}};}function respondWithFilteredResult(_0x53a9c1,_0x537051){return function(_0x310266){if(_0x310266){var _0x16a1d6=typeof _0x537051['offset']===_0x95ee('0x1b')&&typeof _0x537051[_0x95ee('0x1c')]===_0x95ee('0x1b');var _0x2eb124=_0x310266['count'];var _0x39265e=_0x16a1d6?0x0:_0x537051[_0x95ee('0x1d')];var _0x38eb29=_0x16a1d6?_0x310266[_0x95ee('0x1e')]:_0x537051[_0x95ee('0x1d')]+_0x537051[_0x95ee('0x1c')];var _0x283235;if(_0x38eb29>=_0x2eb124){_0x38eb29=_0x2eb124;_0x283235=0xc8;}else{_0x283235=0xce;}_0x53a9c1[_0x95ee('0x19')](_0x283235);return _0x53a9c1['set'](_0x95ee('0x1f'),_0x39265e+'-'+_0x38eb29+'/'+_0x2eb124)[_0x95ee('0x1a')](_0x310266);}return null;};}function patchUpdates(_0x53fe3b){return function(_0x2f312e){try{jsonpatch[_0x95ee('0x20')](_0x2f312e,_0x53fe3b,!![]);}catch(_0x5e2719){return BPromise[_0x95ee('0x21')](_0x5e2719);}return _0x2f312e[_0x95ee('0x22')]();};}function saveUpdates(_0x2eecaf,_0x31f71d){return function(_0x6e0aed){if(_0x6e0aed){return _0x6e0aed[_0x95ee('0x23')](_0x2eecaf)[_0x95ee('0x24')](function(_0x46daee){return _0x46daee;});}return null;};}function removeEntity(_0x49822a,_0x3a2298){return function(_0x437d01){if(_0x437d01){return _0x437d01[_0x95ee('0x25')]()[_0x95ee('0x24')](function(){_0x49822a[_0x95ee('0x19')](0xcc)[_0x95ee('0x26')]();});}};}function handleEntityNotFound(_0x3f7d24,_0x4c4b65){return function(_0x300e2e){if(!_0x300e2e){_0x3f7d24[_0x95ee('0x18')](0x194);}return _0x300e2e;};}function handleError(_0x4c3cf3,_0x5002f7){_0x5002f7=_0x5002f7||0x1f4;return function(_0x4dfa84){logger[_0x95ee('0x27')](_0x4dfa84[_0x95ee('0x28')]);if(_0x4dfa84[_0x95ee('0x29')]){delete _0x4dfa84['name'];}_0x4c3cf3[_0x95ee('0x19')](_0x5002f7)['send'](_0x4dfa84);};}exports[_0x95ee('0x2a')]=function(_0x3cc8e7,_0x5b8bf4){var _0xd15dd6={},_0x255fdf={},_0x2ae79a={'count':0x0,'rows':[]};var _0x12168=_[_0x95ee('0x2b')](db[_0x95ee('0x2c')][_0x95ee('0x2d')],function(_0x3b8b16){return{'name':_0x3b8b16[_0x95ee('0x2e')],'type':_0x3b8b16[_0x95ee('0x2f')][_0x95ee('0x30')]};});_0x255fdf[_0x95ee('0x31')]=_[_0x95ee('0x2b')](_0x12168,_0x95ee('0x29'));_0x255fdf[_0x95ee('0x32')]=_['keys'](_0x3cc8e7[_0x95ee('0x32')]);_0x255fdf[_0x95ee('0x33')]=_[_0x95ee('0x34')](_0x255fdf['model'],_0x255fdf[_0x95ee('0x32')]);_0xd15dd6['attributes']=_['intersection'](_0x255fdf[_0x95ee('0x31')],qs['fields'](_0x3cc8e7[_0x95ee('0x32')][_0x95ee('0x35')]));_0xd15dd6[_0x95ee('0x36')]=_0xd15dd6[_0x95ee('0x36')]['length']?_0xd15dd6['attributes']:_0x255fdf[_0x95ee('0x31')];if(!_0x3cc8e7['query'][_0x95ee('0x37')]('nolimit')){_0xd15dd6['limit']=qs[_0x95ee('0x1c')](_0x3cc8e7[_0x95ee('0x32')][_0x95ee('0x1c')]);_0xd15dd6[_0x95ee('0x1d')]=qs[_0x95ee('0x1d')](_0x3cc8e7[_0x95ee('0x32')]['offset']);}_0xd15dd6[_0x95ee('0x38')]=qs['sort'](_0x3cc8e7[_0x95ee('0x32')][_0x95ee('0x39')]);_0xd15dd6[_0x95ee('0x3a')]=qs['filters'](_[_0x95ee('0x3b')](_0x3cc8e7[_0x95ee('0x32')],_0x255fdf['filters']),_0x12168);if(_0x3cc8e7[_0x95ee('0x32')][_0x95ee('0x3c')]){_0xd15dd6['where']=_['merge'](_0xd15dd6['where'],{'$or':_[_0x95ee('0x2b')](_0x12168,function(_0x45e442){if(_0x45e442[_0x95ee('0x2f')]!=='VIRTUAL'){var _0x7a575a={};_0x7a575a[_0x45e442[_0x95ee('0x29')]]={'$like':'%'+_0x3cc8e7['query']['filter']+'%'};return _0x7a575a;}})});}_0xd15dd6=_[_0x95ee('0x3d')]({},_0xd15dd6,_0x3cc8e7[_0x95ee('0x3e')]);var _0xe9ba44={'where':_0xd15dd6[_0x95ee('0x3a')]};return db['DeskAccount'][_0x95ee('0x1e')](_0xe9ba44)['then'](function(_0xf2f072){_0x2ae79a[_0x95ee('0x1e')]=_0xf2f072;if(_0x3cc8e7[_0x95ee('0x32')][_0x95ee('0x3f')]){_0xd15dd6[_0x95ee('0x40')]=[{'all':!![]}];}return db[_0x95ee('0x2c')]['findAll'](_0xd15dd6);})[_0x95ee('0x24')](function(_0x8de61c){_0x2ae79a[_0x95ee('0x41')]=_0x8de61c;return _0x2ae79a;})[_0x95ee('0x24')](respondWithFilteredResult(_0x5b8bf4,_0xd15dd6))[_0x95ee('0x42')](handleError(_0x5b8bf4,null));};exports[_0x95ee('0x43')]=function(_0x12f018,_0x4de204){var _0x32d0b6={'raw':![],'where':{'id':_0x12f018['params']['id']}},_0x39de6c={};_0x39de6c[_0x95ee('0x31')]=_[_0x95ee('0x44')](db[_0x95ee('0x2c')][_0x95ee('0x2d')]);_0x39de6c['query']=_[_0x95ee('0x44')](_0x12f018[_0x95ee('0x32')]);_0x39de6c[_0x95ee('0x33')]=_[_0x95ee('0x34')](_0x39de6c['model'],_0x39de6c['query']);_0x32d0b6[_0x95ee('0x36')]=_[_0x95ee('0x34')](_0x39de6c[_0x95ee('0x31')],qs['fields'](_0x12f018['query'][_0x95ee('0x35')]));_0x32d0b6[_0x95ee('0x36')]=_0x32d0b6[_0x95ee('0x36')][_0x95ee('0x45')]?_0x32d0b6['attributes']:_0x39de6c[_0x95ee('0x31')];if(_0x12f018['query'][_0x95ee('0x3f')]){_0x32d0b6[_0x95ee('0x40')]=[{'all':!![]}];}_0x32d0b6=_[_0x95ee('0x3d')]({},_0x32d0b6,_0x12f018[_0x95ee('0x3e')]);return db[_0x95ee('0x2c')]['find'](_0x32d0b6)[_0x95ee('0x24')](handleEntityNotFound(_0x4de204,null))['then'](respondWithResult(_0x4de204,null))[_0x95ee('0x42')](handleError(_0x4de204,null));};exports[_0x95ee('0x46')]=function(_0x54603,_0x1a9583){return db['DeskAccount'][_0x95ee('0x46')](_0x54603['body'],{})[_0x95ee('0x24')](respondWithResult(_0x1a9583,0xc9))[_0x95ee('0x42')](handleError(_0x1a9583,null));};exports['update']=function(_0x2419a6,_0xdf3b0b){if(_0x2419a6[_0x95ee('0x47')]['id']){delete _0x2419a6[_0x95ee('0x47')]['id'];}return db[_0x95ee('0x2c')][_0x95ee('0x48')]({'where':{'id':_0x2419a6[_0x95ee('0x49')]['id']}})[_0x95ee('0x24')](handleEntityNotFound(_0xdf3b0b,null))[_0x95ee('0x24')](saveUpdates(_0x2419a6[_0x95ee('0x47')],null))['then'](respondWithResult(_0xdf3b0b,null))[_0x95ee('0x42')](handleError(_0xdf3b0b,null));};exports['destroy']=function(_0x3197e8,_0x278005){return db[_0x95ee('0x2c')][_0x95ee('0x48')]({'where':{'id':_0x3197e8['params']['id']}})[_0x95ee('0x24')](handleEntityNotFound(_0x278005,null))[_0x95ee('0x24')](removeEntity(_0x278005,null))['catch'](handleError(_0x278005,null));};exports[_0x95ee('0x4a')]=function(_0x9b2388,_0x45d112,_0x35e699){var _0x15a491={};var _0x420d5f={};var _0x547936;var _0x16da2b;return db['DeskAccount'][_0x95ee('0x4b')]({'where':{'id':_0x9b2388['params']['id']}})[_0x95ee('0x24')](handleEntityNotFound(_0x45d112,null))[_0x95ee('0x24')](function(_0x478a28){if(_0x478a28){_0x547936=_0x478a28;_0x420d5f[_0x95ee('0x31')]=_[_0x95ee('0x44')](db['DeskConfiguration'][_0x95ee('0x2d')]);_0x420d5f[_0x95ee('0x32')]=_[_0x95ee('0x44')](_0x9b2388[_0x95ee('0x32')]);_0x420d5f[_0x95ee('0x33')]=_[_0x95ee('0x34')](_0x420d5f[_0x95ee('0x31')],_0x420d5f[_0x95ee('0x32')]);_0x15a491['attributes']=_[_0x95ee('0x34')](_0x420d5f[_0x95ee('0x31')],qs[_0x95ee('0x35')](_0x9b2388[_0x95ee('0x32')][_0x95ee('0x35')]));_0x15a491[_0x95ee('0x36')]=_0x15a491[_0x95ee('0x36')][_0x95ee('0x45')]?_0x15a491['attributes']:_0x420d5f[_0x95ee('0x31')];_0x15a491['order']=qs[_0x95ee('0x39')](_0x9b2388[_0x95ee('0x32')][_0x95ee('0x39')]);_0x15a491[_0x95ee('0x3a')]=qs[_0x95ee('0x33')](_[_0x95ee('0x3b')](_0x9b2388['query'],_0x420d5f[_0x95ee('0x33')]));if(_0x9b2388['query'][_0x95ee('0x3c')]){_0x15a491[_0x95ee('0x3a')]=_['merge'](_0x15a491[_0x95ee('0x3a')],{'$or':_['map'](_0x15a491['attributes'],function(_0x4af3ad){var _0x3581fc={};_0x3581fc[_0x4af3ad]={'$like':'%'+_0x9b2388['query'][_0x95ee('0x3c')]+'%'};return _0x3581fc;})});}_0x15a491=_['merge']({},_0x15a491,_0x9b2388[_0x95ee('0x3e')]);return _0x547936[_0x95ee('0x4a')](_0x15a491);}})['then'](function(_0x3c7406){if(_0x3c7406){_0x16da2b=_0x3c7406[_0x95ee('0x45')];if(!_0x9b2388[_0x95ee('0x32')][_0x95ee('0x37')](_0x95ee('0x4c'))){_0x15a491[_0x95ee('0x1c')]=qs[_0x95ee('0x1c')](_0x9b2388[_0x95ee('0x32')]['limit']);_0x15a491[_0x95ee('0x1d')]=qs[_0x95ee('0x1d')](_0x9b2388[_0x95ee('0x32')]['offset']);}return _0x547936[_0x95ee('0x4a')](_0x15a491);}})[_0x95ee('0x24')](function(_0x14e0b0){if(_0x14e0b0){return _0x14e0b0?{'count':_0x16da2b,'rows':_0x14e0b0}:null;}})[_0x95ee('0x24')](respondWithResult(_0x45d112,null))[_0x95ee('0x42')](handleError(_0x45d112,null));};exports[_0x95ee('0x4d')]=function(_0x703085,_0x8ba79d,_0x4ef4f6){if(_0x703085['body']['id']){delete _0x703085[_0x95ee('0x47')]['id'];}return db[_0x95ee('0x2c')][_0x95ee('0x4b')]({'where':{'id':_0x703085[_0x95ee('0x49')]['id']}})[_0x95ee('0x24')](handleEntityNotFound(_0x8ba79d,null))[_0x95ee('0x24')](function(_0x32174c){if(_0x32174c){_0x703085[_0x95ee('0x47')][_0x95ee('0x4e')]=_0x32174c['id'];_0x703085[_0x95ee('0x47')][_0x95ee('0x4f')]=integrations[_0x95ee('0x50')](_0x703085[_0x95ee('0x47')][_0x95ee('0x51')],_0x703085[_0x95ee('0x47')][_0x95ee('0x2f')]);_0x703085[_0x95ee('0x47')][_0x95ee('0x52')]=integrations[_0x95ee('0x53')](_0x703085[_0x95ee('0x47')][_0x95ee('0x51')],_0x703085[_0x95ee('0x47')][_0x95ee('0x2f')]);return db[_0x95ee('0x54')][_0x95ee('0x46')](_0x703085[_0x95ee('0x47')],{'include':[{'model':db[_0x95ee('0x55')],'as':_0x95ee('0x4f')},{'model':db[_0x95ee('0x55')],'as':'Descriptions'}]});}return null;})[_0x95ee('0x24')](respondWithResult(_0x8ba79d,null))[_0x95ee('0x42')](handleError(_0x8ba79d,null));};exports[_0x95ee('0x56')]=function(_0x57fc7a,_0x2bb6ef,_0x4f1088){var _0x4ed590=[{'name':_0x95ee('0x57'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xa27946='';return db['DeskAccount'][_0x95ee('0x4b')]({'where':{'id':_0x57fc7a[_0x95ee('0x49')]['id']},'attributes':['id',_0x95ee('0x58'),'authType',_0x95ee('0x59'),_0x95ee('0x5a'),_0x95ee('0x5b'),_0x95ee('0x5c'),_0x95ee('0x5d'),'tokenSecret']})[_0x95ee('0x24')](handleEntityNotFound(_0x2bb6ef,null))[_0x95ee('0x24')](function(_0x4cbe12){if(_0x4cbe12){_0xa27946=_0x4cbe12[_0x95ee('0x58')];var _0xb28c9=_0xa27946['slice'](-0x1);if(_0xb28c9==='/'){_0xa27946=_0xa27946[_0x95ee('0x5e')](0x0,_0xa27946[_0x95ee('0x5f')](_0xb28c9));}var _0x3b5974={'method':_0x95ee('0x60'),'uri':util['format'](_0x95ee('0x61'),_0xa27946),'headers':{'Content-Type':_0x95ee('0x62'),'Accept':_0x95ee('0x62')},'json':!![]};if(_0x4cbe12[_0x95ee('0x63')]===_0x95ee('0x64')){_0x3b5974[_0x95ee('0x65')][_0x95ee('0x66')]=util['format'](_0x95ee('0x67'),new Buffer(util[_0x95ee('0x68')]('%s:%s',_0x4cbe12[_0x95ee('0x59')],_0x4cbe12['password']))['toString'](_0x95ee('0x69')));}return rp(_0x3b5974)['then'](function(_0x12a972){return _0x4ed590[_0x95ee('0x6a')](_[_0x95ee('0x2b')](_0x12a972[_0x95ee('0x6b')][_0x95ee('0x6c')],function(_0x1d72ce){return{'id':_0x1d72ce[_0x95ee('0x29')],'name':_0x1d72ce[_0x95ee('0x29')],'type':_0x1d72ce[_0x95ee('0x2f')],'active':_0x1d72ce[_0x95ee('0x6d')],'label':_0x1d72ce[_0x95ee('0x6e')],'custom':!![]};}));});}})[_0x95ee('0x24')](function(_0x59a767){return{'count':_0x59a767[_0x95ee('0x45')],'rows':_0x59a767};})[_0x95ee('0x24')](respondWithResult(_0x2bb6ef,null))[_0x95ee('0x42')](function(_0xbad5af){var _0x21344c=_0x57fc7a[_0x95ee('0x32')]['test']?0x1f4:_0xbad5af[_0x95ee('0x6f')]||0x1f4;logger['error'](_0x95ee('0x70'),_0x95ee('0x56'),_0x21344c,JSON['stringify'](_0xbad5af));delete _0xbad5af[_0x95ee('0x29')];if(_0x21344c===0x191){_0x21344c=0x190;}_0x2bb6ef[_0x95ee('0x19')](_0x21344c)[_0x95ee('0x71')](_0x57fc7a[_0x95ee('0x32')][_0x95ee('0x72')]?{'message':_0x95ee('0x73'),'statusCode':_0xbad5af[_0x95ee('0x6f')]}:_0xbad5af);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d4e9289..6a958b2 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 _0xd458=['int_desk_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xd458,0x1bd));var _0x8d45=function(_0x1bbd8a,_0x2435ec){_0x1bbd8a=_0x1bbd8a-0x0;var _0x526447=_0xd458[_0x1bbd8a];return _0x526447;};'use strict';var _=require(_0x8d45('0x0'));var util=require(_0x8d45('0x1'));var logger=require(_0x8d45('0x2'))(_0x8d45('0x3'));var moment=require(_0x8d45('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d45('0x5'));var rimraf=require(_0x8d45('0x6'));var config=require(_0x8d45('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x8d45('0x8'));module[_0x8d45('0x9')]=function(_0xcc82b4,_0x20422a){return _0xcc82b4['define'](_0x8d45('0xa'),attributes,{'tableName':_0x8d45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3b0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','DeskAccount','int_desk_accounts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3b0,0x82));var _0x0a3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0a3b('0x0'))(_0x0a3b('0x1'));var moment=require('moment');var BPromise=require(_0x0a3b('0x2'));var rp=require(_0x0a3b('0x3'));var fs=require('fs');var path=require(_0x0a3b('0x4'));var rimraf=require(_0x0a3b('0x5'));var config=require(_0x0a3b('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0a3b('0x7')]=function(_0x464bc1,_0x5d677e){return _0x464bc1['define'](_0x0a3b('0x8'),attributes,{'tableName':_0x0a3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 94a35c9..187407d 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 _0x7393=['find','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','map','include','model','attributes','debug','ShowDeskAccount'];(function(_0x5185cf,_0x18e620){var _0x53a6b5=function(_0x414d58){while(--_0x414d58){_0x5185cf['push'](_0x5185cf['shift']());}};_0x53a6b5(++_0x18e620);}(_0x7393,0x194));var _0x3739=function(_0x2dd109,_0xc87d91){_0x2dd109=_0x2dd109-0x0;var _0x919b9=_0x7393[_0x2dd109];return _0x919b9;};'use strict';var _=require(_0x3739('0x0'));var util=require('util');var moment=require(_0x3739('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3739('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3739('0x3'))(_0x3739('0x4'));var config=require(_0x3739('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3739('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456341,_0x444e0b,_0x4dc42f){return new BPromise(function(_0x1d4148,_0x4cff08){return client['request'](_0x456341,_0x4dc42f)[_0x3739('0x7')](function(_0x30d17e){logger[_0x3739('0x8')](_0x3739('0x9'),_0x444e0b,_0x3739('0xa'));logger['debug'](_0x3739('0xb'),_0x444e0b,_0x3739('0xa'),JSON[_0x3739('0xc')](_0x30d17e));if(_0x30d17e['error']){if(_0x30d17e[_0x3739('0xd')][_0x3739('0xe')]===0x1f4){logger[_0x3739('0xd')](_0x3739('0x9'),_0x444e0b,_0x30d17e[_0x3739('0xd')]['message']);return _0x4cff08(_0x30d17e[_0x3739('0xd')][_0x3739('0xf')]);}logger[_0x3739('0xd')](_0x3739('0x9'),_0x444e0b,_0x30d17e['error'][_0x3739('0xf')]);return _0x1d4148(_0x30d17e['error'][_0x3739('0xf')]);}else{logger[_0x3739('0x8')](_0x3739('0x9'),_0x444e0b,'request\x20sent');_0x1d4148(_0x30d17e[_0x3739('0x10')][_0x3739('0xf')]);}})[_0x3739('0x11')](function(_0x14df88){logger[_0x3739('0xd')](_0x3739('0x9'),_0x444e0b,_0x14df88);_0x4cff08(_0x14df88);});});}exports[_0x3739('0x12')]=function(_0x4808f8){var _0x1a2ac=this;return new Promise(function(_0x8f098f,_0x502356){return db[_0x3739('0x13')][_0x3739('0x14')]({'raw':_0x4808f8[_0x3739('0x15')]?_0x4808f8[_0x3739('0x15')][_0x3739('0x16')]===undefined?!![]:![]:!![],'where':_0x4808f8[_0x3739('0x15')]?_0x4808f8['options'][_0x3739('0x17')]||null:null,'attributes':_0x4808f8[_0x3739('0x15')]?_0x4808f8['options']['attributes']||null:null,'limit':_0x4808f8[_0x3739('0x15')]?_0x4808f8[_0x3739('0x15')]['limit']||null:null,'include':_0x4808f8[_0x3739('0x15')]?_0x4808f8[_0x3739('0x15')]['include']?_[_0x3739('0x18')](_0x4808f8['options'][_0x3739('0x19')],function(_0x400576){return{'model':db[_0x400576[_0x3739('0x1a')]],'as':_0x400576['as'],'attributes':_0x400576['attributes'],'include':_0x400576[_0x3739('0x19')]?_[_0x3739('0x18')](_0x400576[_0x3739('0x19')],function(_0x2a127f){return{'model':db[_0x2a127f['model']],'as':_0x2a127f['as'],'attributes':_0x2a127f['attributes'],'include':_0x2a127f['include']?_[_0x3739('0x18')](_0x2a127f[_0x3739('0x19')],function(_0xb5c4cc){return{'model':db[_0xb5c4cc[_0x3739('0x1a')]],'as':_0xb5c4cc['as'],'attributes':_0xb5c4cc[_0x3739('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5f6d){logger[_0x3739('0x8')](_0x3739('0x12'),_0x4808f8);logger[_0x3739('0x1c')](_0x3739('0x12'),_0x4808f8,JSON[_0x3739('0xc')](_0x4e5f6d));_0x8f098f(_0x4e5f6d);})[_0x3739('0x11')](function(_0x20193e){logger[_0x3739('0xd')]('GetDeskAccount',_0x20193e[_0x3739('0xf')],_0x4808f8);_0x502356(_0x1a2ac[_0x3739('0xd')](0x1f4,_0x20193e[_0x3739('0xf')]));});});};exports[_0x3739('0x1d')]=function(_0x193c7d){var _0x5dcda0=this;return new Promise(function(_0x2952d1,_0xbfbdc2){return db[_0x3739('0x13')][_0x3739('0x1e')]({'raw':_0x193c7d[_0x3739('0x15')]?_0x193c7d[_0x3739('0x15')][_0x3739('0x16')]===undefined?!![]:![]:!![],'where':_0x193c7d['options']?_0x193c7d[_0x3739('0x15')][_0x3739('0x17')]||null:null,'attributes':_0x193c7d[_0x3739('0x15')]?_0x193c7d[_0x3739('0x15')][_0x3739('0x1b')]||null:null,'include':_0x193c7d[_0x3739('0x15')]?_0x193c7d[_0x3739('0x15')]['include']?_[_0x3739('0x18')](_0x193c7d[_0x3739('0x15')][_0x3739('0x19')],function(_0x25a1f3){return{'model':db[_0x25a1f3[_0x3739('0x1a')]],'as':_0x25a1f3['as'],'attributes':_0x25a1f3[_0x3739('0x1b')],'include':_0x25a1f3[_0x3739('0x19')]?_[_0x3739('0x18')](_0x25a1f3['include'],function(_0x2a8f51){return{'model':db[_0x2a8f51[_0x3739('0x1a')]],'as':_0x2a8f51['as'],'attributes':_0x2a8f51[_0x3739('0x1b')],'include':_0x2a8f51[_0x3739('0x19')]?_[_0x3739('0x18')](_0x2a8f51[_0x3739('0x19')],function(_0x89d343){return{'model':db[_0x89d343[_0x3739('0x1a')]],'as':_0x89d343['as'],'attributes':_0x89d343[_0x3739('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3739('0x7')](function(_0x522386){logger[_0x3739('0x8')](_0x3739('0x1d'),_0x193c7d);logger[_0x3739('0x1c')](_0x3739('0x1d'),_0x193c7d,JSON[_0x3739('0xc')](_0x522386));_0x2952d1(_0x522386);})[_0x3739('0x11')](function(_0x58b453){logger['error'](_0x3739('0x1d'),_0x58b453[_0x3739('0xf')],_0x193c7d);_0xbfbdc2(_0x5dcda0[_0x3739('0xd')](0x1f4,_0x58b453[_0x3739('0xf')]));});});}; \ No newline at end of file +var _0x3efe=['find','where','ShowDeskAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','GetDeskAccount','options','raw','attributes','limit','include','map','model','debug','stringify','catch'];(function(_0x1ebd19,_0x2ec7e2){var _0x50e867=function(_0x4c83f){while(--_0x4c83f){_0x1ebd19['push'](_0x1ebd19['shift']());}};_0x50e867(++_0x2ec7e2);}(_0x3efe,0xc9));var _0xe3ef=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3efe[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe3ef('0x0'));var util=require('util');var moment=require(_0xe3ef('0x1'));var BPromise=require(_0xe3ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3ef('0x3'));var db=require(_0xe3ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ef('0x5'))(_0xe3ef('0x6'));var config=require(_0xe3ef('0x7'));var jayson=require(_0xe3ef('0x8'));var client=jayson['client'][_0xe3ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e8b06,_0x1db930,_0x1ae8bf){return new BPromise(function(_0x5c710,_0x4bd61e){return client['request'](_0x2e8b06,_0x1ae8bf)[_0xe3ef('0xa')](function(_0x202028){logger['info']('DeskAccount,\x20%s,\x20%s',_0x1db930,_0xe3ef('0xb'));logger['debug'](_0xe3ef('0xc'),_0x1db930,_0xe3ef('0xb'),JSON['stringify'](_0x202028));if(_0x202028[_0xe3ef('0xd')]){if(_0x202028[_0xe3ef('0xd')][_0xe3ef('0xe')]===0x1f4){logger[_0xe3ef('0xd')](_0xe3ef('0xf'),_0x1db930,_0x202028[_0xe3ef('0xd')]['message']);return _0x4bd61e(_0x202028[_0xe3ef('0xd')][_0xe3ef('0x10')]);}logger[_0xe3ef('0xd')](_0xe3ef('0xf'),_0x1db930,_0x202028[_0xe3ef('0xd')][_0xe3ef('0x10')]);return _0x5c710(_0x202028[_0xe3ef('0xd')][_0xe3ef('0x10')]);}else{logger[_0xe3ef('0x11')](_0xe3ef('0xf'),_0x1db930,_0xe3ef('0xb'));_0x5c710(_0x202028[_0xe3ef('0x12')][_0xe3ef('0x10')]);}})['catch'](function(_0x2c301f){logger['error']('DeskAccount,\x20%s,\x20%s',_0x1db930,_0x2c301f);_0x4bd61e(_0x2c301f);});});}exports[_0xe3ef('0x13')]=function(_0x24eaed){var _0xd9686d=this;return new Promise(function(_0x5a6b6e,_0x4b23e3){return db['DeskAccount']['findAll']({'raw':_0x24eaed['options']?_0x24eaed[_0xe3ef('0x14')][_0xe3ef('0x15')]===undefined?!![]:![]:!![],'where':_0x24eaed[_0xe3ef('0x14')]?_0x24eaed[_0xe3ef('0x14')]['where']||null:null,'attributes':_0x24eaed[_0xe3ef('0x14')]?_0x24eaed['options'][_0xe3ef('0x16')]||null:null,'limit':_0x24eaed['options']?_0x24eaed[_0xe3ef('0x14')][_0xe3ef('0x17')]||null:null,'include':_0x24eaed[_0xe3ef('0x14')]?_0x24eaed[_0xe3ef('0x14')][_0xe3ef('0x18')]?_[_0xe3ef('0x19')](_0x24eaed['options'][_0xe3ef('0x18')],function(_0x1a4f62){return{'model':db[_0x1a4f62[_0xe3ef('0x1a')]],'as':_0x1a4f62['as'],'attributes':_0x1a4f62[_0xe3ef('0x16')],'include':_0x1a4f62['include']?_[_0xe3ef('0x19')](_0x1a4f62[_0xe3ef('0x18')],function(_0xbf6b){return{'model':db[_0xbf6b[_0xe3ef('0x1a')]],'as':_0xbf6b['as'],'attributes':_0xbf6b[_0xe3ef('0x16')],'include':_0xbf6b[_0xe3ef('0x18')]?_[_0xe3ef('0x19')](_0xbf6b[_0xe3ef('0x18')],function(_0x47279c){return{'model':db[_0x47279c[_0xe3ef('0x1a')]],'as':_0x47279c['as'],'attributes':_0x47279c[_0xe3ef('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe3ef('0xa')](function(_0x19c613){logger[_0xe3ef('0x11')](_0xe3ef('0x13'),_0x24eaed);logger[_0xe3ef('0x1b')]('GetDeskAccount',_0x24eaed,JSON[_0xe3ef('0x1c')](_0x19c613));_0x5a6b6e(_0x19c613);})[_0xe3ef('0x1d')](function(_0x8a8b96){logger['error'](_0xe3ef('0x13'),_0x8a8b96[_0xe3ef('0x10')],_0x24eaed);_0x4b23e3(_0xd9686d[_0xe3ef('0xd')](0x1f4,_0x8a8b96[_0xe3ef('0x10')]));});});};exports['ShowDeskAccount']=function(_0x5d35a6){var _0x1c1a72=this;return new Promise(function(_0x7a297e,_0x5db06d){return db['DeskAccount'][_0xe3ef('0x1e')]({'raw':_0x5d35a6[_0xe3ef('0x14')]?_0x5d35a6[_0xe3ef('0x14')][_0xe3ef('0x15')]===undefined?!![]:![]:!![],'where':_0x5d35a6[_0xe3ef('0x14')]?_0x5d35a6[_0xe3ef('0x14')][_0xe3ef('0x1f')]||null:null,'attributes':_0x5d35a6[_0xe3ef('0x14')]?_0x5d35a6[_0xe3ef('0x14')][_0xe3ef('0x16')]||null:null,'include':_0x5d35a6['options']?_0x5d35a6[_0xe3ef('0x14')][_0xe3ef('0x18')]?_[_0xe3ef('0x19')](_0x5d35a6[_0xe3ef('0x14')]['include'],function(_0x7f90db){return{'model':db[_0x7f90db[_0xe3ef('0x1a')]],'as':_0x7f90db['as'],'attributes':_0x7f90db[_0xe3ef('0x16')],'include':_0x7f90db[_0xe3ef('0x18')]?_['map'](_0x7f90db['include'],function(_0x18e991){return{'model':db[_0x18e991[_0xe3ef('0x1a')]],'as':_0x18e991['as'],'attributes':_0x18e991['attributes'],'include':_0x18e991[_0xe3ef('0x18')]?_[_0xe3ef('0x19')](_0x18e991['include'],function(_0x5a2114){return{'model':db[_0x5a2114[_0xe3ef('0x1a')]],'as':_0x5a2114['as'],'attributes':_0x5a2114['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c35c7){logger['info']('ShowDeskAccount',_0x5d35a6);logger[_0xe3ef('0x1b')](_0xe3ef('0x20'),_0x5d35a6,JSON['stringify'](_0x1c35c7));_0x7a297e(_0x1c35c7);})[_0xe3ef('0x1d')](function(_0x39b2c7){logger[_0xe3ef('0xd')]('ShowDeskAccount',_0x39b2c7[_0xe3ef('0x10')],_0x5d35a6);_0x5db06d(_0x1c1a72['error'](0x1f4,_0x39b2c7[_0xe3ef('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bd93a5a..af8265d 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(_0x2af506,_0x18ede1){var _0x43bcae=function(_0x16112c){while(--_0x16112c){_0x2af506['push'](_0x2af506['shift']());}};_0x43bcae(++_0x18ede1);}(_0x3e74,0x175));var _0x43e7=function(_0x307b3c,_0x110404){_0x307b3c=_0x307b3c-0x0;var _0x3bacc4=_0x3e74[_0x307b3c];return _0x3bacc4;};'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(_0x4750fb,_0x50d374){var _0x2539df=function(_0x1d7976){while(--_0x1d7976){_0x4750fb['push'](_0x4750fb['shift']());}};_0x2539df(++_0x50d374);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 08307c4..26886a7 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 _0xe75e=['STRING'];(function(_0x757fa,_0x4aa665){var _0x4028c2=function(_0x5d52e1){while(--_0x5d52e1){_0x757fa['push'](_0x757fa['shift']());}};_0x4028c2(++_0x4aa665);}(_0xe75e,0xb2));var _0xee75=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0xe75e[_0x30182f];return _0x5207db;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee75('0x0')]}}; \ No newline at end of file +var _0xcaf4=['sequelize','exports','STRING'];(function(_0x2b5573,_0x5712a4){var _0x2bf761=function(_0xd9f120){while(--_0xd9f120){_0x2b5573['push'](_0x2b5573['shift']());}};_0x2bf761(++_0x5712a4);}(_0xcaf4,0x8d));var _0x4caf=function(_0x51145a,_0x3feda0){_0x51145a=_0x51145a-0x0;var _0x30eb81=_0xcaf4[_0x51145a];return _0x30eb81;};'use strict';var Sequelize=require(_0x4caf('0x0'));module[_0x4caf('0x1')]={'name':{'type':Sequelize[_0x4caf('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1847ffe..0594412 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 _0x06cf=['to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','DeskField','getFields','nolimit','getSubjects','findOne','options','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0x06cf,0x1ef));var _0xf06c=function(_0x3c4bfc,_0x56a8be){_0x3c4bfc=_0x3c4bfc-0x0;var _0x10387f=_0x06cf[_0x3c4bfc];return _0x10387f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf06c('0x0'));var zipdir=require(_0xf06c('0x1'));var jsonpatch=require(_0xf06c('0x2'));var rp=require(_0xf06c('0x3'));var moment=require('moment');var BPromise=require(_0xf06c('0x4'));var Mustache=require(_0xf06c('0x5'));var util=require(_0xf06c('0x6'));var path=require(_0xf06c('0x7'));var sox=require(_0xf06c('0x8'));var csv=require(_0xf06c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf06c('0xa'));var squel=require(_0xf06c('0xb'));var crypto=require(_0xf06c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf06c('0xd'));var toCsv=require(_0xf06c('0x9'));var querystring=require('querystring');var Papa=require(_0xf06c('0xe'));var Redis=require(_0xf06c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf06c('0x10'));var hardwareService=require(_0xf06c('0x11'));var logger=require(_0xf06c('0x12'))(_0xf06c('0x13'));var utils=require(_0xf06c('0x14'));var config=require(_0xf06c('0x15'));var licenseUtil=require(_0xf06c('0x16'));var db=require(_0xf06c('0x17'))['db'];function respondWithStatusCode(_0x442681,_0x4b6530){_0x4b6530=_0x4b6530||0xcc;return function(_0x275829){if(_0x275829){return _0x442681[_0xf06c('0x18')](_0x4b6530);}return _0x442681[_0xf06c('0x19')](_0x4b6530)[_0xf06c('0x1a')]();};}function respondWithResult(_0x2bf3b0,_0x287da6){_0x287da6=_0x287da6||0xc8;return function(_0x4eb2c7){if(_0x4eb2c7){return _0x2bf3b0[_0xf06c('0x19')](_0x287da6)[_0xf06c('0x1b')](_0x4eb2c7);}};}function respondWithFilteredResult(_0x5550ab,_0x185a04){return function(_0x472c73){if(_0x472c73){var _0x2c12c0=typeof _0x185a04[_0xf06c('0x1c')]===_0xf06c('0x1d')&&typeof _0x185a04['limit']===_0xf06c('0x1d');var _0x2d5a5b=_0x472c73[_0xf06c('0x1e')];var _0x1061da=_0x2c12c0?0x0:_0x185a04[_0xf06c('0x1c')];var _0x5fbce2=_0x2c12c0?_0x472c73['count']:_0x185a04['offset']+_0x185a04[_0xf06c('0x1f')];var _0x310d82;if(_0x5fbce2>=_0x2d5a5b){_0x5fbce2=_0x2d5a5b;_0x310d82=0xc8;}else{_0x310d82=0xce;}_0x5550ab['status'](_0x310d82);return _0x5550ab[_0xf06c('0x20')](_0xf06c('0x21'),_0x1061da+'-'+_0x5fbce2+'/'+_0x2d5a5b)['json'](_0x472c73);}return null;};}function patchUpdates(_0x55dc30){return function(_0x5bdd21){try{jsonpatch['apply'](_0x5bdd21,_0x55dc30,!![]);}catch(_0x321286){return BPromise[_0xf06c('0x22')](_0x321286);}return _0x5bdd21[_0xf06c('0x23')]();};}function saveUpdates(_0x3e4add,_0x330923){return function(_0x520137){if(_0x520137){return _0x520137[_0xf06c('0x24')](_0x3e4add)[_0xf06c('0x25')](function(_0x1eb44e){return _0x1eb44e;});}return null;};}function removeEntity(_0xfd24de,_0x5d1f49){return function(_0x13e4e1){if(_0x13e4e1){return _0x13e4e1[_0xf06c('0x26')]()[_0xf06c('0x25')](function(){_0xfd24de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b37ca,_0x426dae){return function(_0x24177f){if(!_0x24177f){_0x5b37ca[_0xf06c('0x18')](0x194);}return _0x24177f;};}function handleError(_0x4a57fc,_0x2f8765){_0x2f8765=_0x2f8765||0x1f4;return function(_0x11f12c){logger[_0xf06c('0x27')](_0x11f12c['stack']);if(_0x11f12c[_0xf06c('0x28')]){delete _0x11f12c['name'];}_0x4a57fc[_0xf06c('0x19')](_0x2f8765)[_0xf06c('0x29')](_0x11f12c);};}exports['index']=function(_0x231f6c,_0x482c3e){var _0x20756d={},_0x3f56f9={},_0x5d2091={'count':0x0,'rows':[]};var _0x5d74d8=_[_0xf06c('0x2a')](db[_0xf06c('0x2b')][_0xf06c('0x2c')],function(_0x49fc41){return{'name':_0x49fc41[_0xf06c('0x2d')],'type':_0x49fc41[_0xf06c('0x2e')][_0xf06c('0x2f')]};});_0x3f56f9[_0xf06c('0x30')]=_['map'](_0x5d74d8,_0xf06c('0x28'));_0x3f56f9[_0xf06c('0x31')]=_[_0xf06c('0x32')](_0x231f6c[_0xf06c('0x31')]);_0x3f56f9[_0xf06c('0x33')]=_[_0xf06c('0x34')](_0x3f56f9[_0xf06c('0x30')],_0x3f56f9[_0xf06c('0x31')]);_0x20756d[_0xf06c('0x35')]=_[_0xf06c('0x34')](_0x3f56f9[_0xf06c('0x30')],qs[_0xf06c('0x36')](_0x231f6c[_0xf06c('0x31')][_0xf06c('0x36')]));_0x20756d[_0xf06c('0x35')]=_0x20756d[_0xf06c('0x35')][_0xf06c('0x37')]?_0x20756d['attributes']:_0x3f56f9['model'];if(!_0x231f6c[_0xf06c('0x31')][_0xf06c('0x38')]('nolimit')){_0x20756d[_0xf06c('0x1f')]=qs[_0xf06c('0x1f')](_0x231f6c['query'][_0xf06c('0x1f')]);_0x20756d['offset']=qs[_0xf06c('0x1c')](_0x231f6c[_0xf06c('0x31')][_0xf06c('0x1c')]);}_0x20756d[_0xf06c('0x39')]=qs[_0xf06c('0x3a')](_0x231f6c[_0xf06c('0x31')][_0xf06c('0x3a')]);_0x20756d[_0xf06c('0x3b')]=qs[_0xf06c('0x33')](_[_0xf06c('0x3c')](_0x231f6c[_0xf06c('0x31')],_0x3f56f9[_0xf06c('0x33')]),_0x5d74d8);if(_0x231f6c[_0xf06c('0x31')][_0xf06c('0x3d')]){_0x20756d[_0xf06c('0x3b')]=_[_0xf06c('0x3e')](_0x20756d[_0xf06c('0x3b')],{'$or':_['map'](_0x5d74d8,function(_0x149a5c){if(_0x149a5c['type']!==_0xf06c('0x3f')){var _0x19a2c9={};_0x19a2c9[_0x149a5c[_0xf06c('0x28')]]={'$like':'%'+_0x231f6c[_0xf06c('0x31')][_0xf06c('0x3d')]+'%'};return _0x19a2c9;}})});}_0x20756d=_['merge']({},_0x20756d,_0x231f6c['options']);var _0x5003db={'where':_0x20756d[_0xf06c('0x3b')]};return db[_0xf06c('0x2b')][_0xf06c('0x1e')](_0x5003db)[_0xf06c('0x25')](function(_0x2bb6e7){_0x5d2091[_0xf06c('0x1e')]=_0x2bb6e7;if(_0x231f6c[_0xf06c('0x31')][_0xf06c('0x40')]){_0x20756d[_0xf06c('0x41')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x20756d);})[_0xf06c('0x25')](function(_0x574bdf){_0x5d2091[_0xf06c('0x42')]=_0x574bdf;return _0x5d2091;})[_0xf06c('0x25')](respondWithFilteredResult(_0x482c3e,_0x20756d))[_0xf06c('0x43')](handleError(_0x482c3e,null));};exports[_0xf06c('0x44')]=function(_0x5e8c91,_0x567d30){var _0xc3ce45={'raw':![],'where':{'id':_0x5e8c91[_0xf06c('0x45')]['id']}},_0x18de8e={};_0x18de8e['model']=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x18de8e[_0xf06c('0x31')]=_[_0xf06c('0x32')](_0x5e8c91[_0xf06c('0x31')]);_0x18de8e[_0xf06c('0x33')]=_[_0xf06c('0x34')](_0x18de8e[_0xf06c('0x30')],_0x18de8e['query']);_0xc3ce45[_0xf06c('0x35')]=_[_0xf06c('0x34')](_0x18de8e[_0xf06c('0x30')],qs[_0xf06c('0x36')](_0x5e8c91[_0xf06c('0x31')][_0xf06c('0x36')]));_0xc3ce45['attributes']=_0xc3ce45[_0xf06c('0x35')][_0xf06c('0x37')]?_0xc3ce45['attributes']:_0x18de8e[_0xf06c('0x30')];if(_0x5e8c91[_0xf06c('0x31')][_0xf06c('0x40')]){_0xc3ce45[_0xf06c('0x41')]=[{'all':!![]}];}_0xc3ce45=_[_0xf06c('0x3e')]({},_0xc3ce45,_0x5e8c91['options']);return db[_0xf06c('0x2b')][_0xf06c('0x46')](_0xc3ce45)[_0xf06c('0x25')](handleEntityNotFound(_0x567d30,null))['then'](respondWithResult(_0x567d30,null))[_0xf06c('0x43')](handleError(_0x567d30,null));};exports[_0xf06c('0x47')]=function(_0x35087a,_0x1264a8){return db[_0xf06c('0x2b')]['create'](_0x35087a[_0xf06c('0x48')],{})[_0xf06c('0x25')](respondWithResult(_0x1264a8,0xc9))[_0xf06c('0x43')](handleError(_0x1264a8,null));};exports[_0xf06c('0x24')]=function(_0x5bb65e,_0x39caaf){if(_0x5bb65e[_0xf06c('0x48')]['id']){delete _0x5bb65e[_0xf06c('0x48')]['id'];}return db[_0xf06c('0x2b')]['find']({'where':{'id':_0x5bb65e[_0xf06c('0x45')]['id']}})[_0xf06c('0x25')](handleEntityNotFound(_0x39caaf,null))[_0xf06c('0x25')](saveUpdates(_0x5bb65e[_0xf06c('0x48')],null))['then'](respondWithResult(_0x39caaf,null))[_0xf06c('0x43')](handleError(_0x39caaf,null));};exports[_0xf06c('0x26')]=function(_0x36e38e,_0xe939a3){return db[_0xf06c('0x2b')][_0xf06c('0x46')]({'where':{'id':_0x36e38e['params']['id']}})[_0xf06c('0x25')](handleEntityNotFound(_0xe939a3,null))[_0xf06c('0x25')](removeEntity(_0xe939a3,null))[_0xf06c('0x43')](handleError(_0xe939a3,null));};exports['getFields']=function(_0x3c81e4,_0x242004,_0x1a91a8){var _0x5c9d56={};var _0x25a943={};var _0x542457;var _0x499fca;return db[_0xf06c('0x2b')]['findOne']({'where':{'id':_0x3c81e4[_0xf06c('0x45')]['id']}})[_0xf06c('0x25')](handleEntityNotFound(_0x242004,null))[_0xf06c('0x25')](function(_0x285855){if(_0x285855){_0x542457=_0x285855;_0x25a943[_0xf06c('0x30')]=_[_0xf06c('0x32')](db[_0xf06c('0x49')]['rawAttributes']);_0x25a943['query']=_[_0xf06c('0x32')](_0x3c81e4[_0xf06c('0x31')]);_0x25a943[_0xf06c('0x33')]=_[_0xf06c('0x34')](_0x25a943[_0xf06c('0x30')],_0x25a943[_0xf06c('0x31')]);_0x5c9d56[_0xf06c('0x35')]=_[_0xf06c('0x34')](_0x25a943['model'],qs['fields'](_0x3c81e4[_0xf06c('0x31')][_0xf06c('0x36')]));_0x5c9d56[_0xf06c('0x35')]=_0x5c9d56[_0xf06c('0x35')]['length']?_0x5c9d56[_0xf06c('0x35')]:_0x25a943[_0xf06c('0x30')];_0x5c9d56['order']=qs['sort'](_0x3c81e4[_0xf06c('0x31')][_0xf06c('0x3a')]);_0x5c9d56['where']=qs[_0xf06c('0x33')](_[_0xf06c('0x3c')](_0x3c81e4[_0xf06c('0x31')],_0x25a943[_0xf06c('0x33')]));if(_0x3c81e4[_0xf06c('0x31')][_0xf06c('0x3d')]){_0x5c9d56[_0xf06c('0x3b')]=_['merge'](_0x5c9d56[_0xf06c('0x3b')],{'$or':_[_0xf06c('0x2a')](_0x5c9d56[_0xf06c('0x35')],function(_0x39f372){var _0x1d2e3f={};_0x1d2e3f[_0x39f372]={'$like':'%'+_0x3c81e4[_0xf06c('0x31')]['filter']+'%'};return _0x1d2e3f;})});}_0x5c9d56=_['merge']({},_0x5c9d56,_0x3c81e4['options']);return _0x542457[_0xf06c('0x4a')](_0x5c9d56);}})[_0xf06c('0x25')](function(_0x3dd9fe){if(_0x3dd9fe){_0x499fca=_0x3dd9fe['length'];if(!_0x3c81e4[_0xf06c('0x31')][_0xf06c('0x38')](_0xf06c('0x4b'))){_0x5c9d56[_0xf06c('0x1f')]=qs[_0xf06c('0x1f')](_0x3c81e4['query']['limit']);_0x5c9d56['offset']=qs[_0xf06c('0x1c')](_0x3c81e4[_0xf06c('0x31')][_0xf06c('0x1c')]);}return _0x542457[_0xf06c('0x4a')](_0x5c9d56);}})[_0xf06c('0x25')](function(_0x3d07e1){if(_0x3d07e1){return _0x3d07e1?{'count':_0x499fca,'rows':_0x3d07e1}:null;}})[_0xf06c('0x25')](respondWithResult(_0x242004,null))['catch'](handleError(_0x242004,null));};exports[_0xf06c('0x4c')]=function(_0x13a74b,_0x2f2255,_0x59cc3d){var _0x15aef0={};var _0x4587d9={};var _0x196d97;var _0x530d03;return db['DeskConfiguration'][_0xf06c('0x4d')]({'where':{'id':_0x13a74b[_0xf06c('0x45')]['id']}})[_0xf06c('0x25')](handleEntityNotFound(_0x2f2255,null))[_0xf06c('0x25')](function(_0x32b654){if(_0x32b654){_0x196d97=_0x32b654;_0x4587d9['model']=_[_0xf06c('0x32')](db['DeskField'][_0xf06c('0x2c')]);_0x4587d9[_0xf06c('0x31')]=_[_0xf06c('0x32')](_0x13a74b['query']);_0x4587d9[_0xf06c('0x33')]=_['intersection'](_0x4587d9['model'],_0x4587d9[_0xf06c('0x31')]);_0x15aef0['attributes']=_[_0xf06c('0x34')](_0x4587d9[_0xf06c('0x30')],qs[_0xf06c('0x36')](_0x13a74b['query']['fields']));_0x15aef0['attributes']=_0x15aef0[_0xf06c('0x35')][_0xf06c('0x37')]?_0x15aef0[_0xf06c('0x35')]:_0x4587d9[_0xf06c('0x30')];_0x15aef0[_0xf06c('0x39')]=qs[_0xf06c('0x3a')](_0x13a74b['query'][_0xf06c('0x3a')]);_0x15aef0[_0xf06c('0x3b')]=qs[_0xf06c('0x33')](_['pick'](_0x13a74b['query'],_0x4587d9[_0xf06c('0x33')]));if(_0x13a74b[_0xf06c('0x31')][_0xf06c('0x3d')]){_0x15aef0[_0xf06c('0x3b')]=_[_0xf06c('0x3e')](_0x15aef0['where'],{'$or':_[_0xf06c('0x2a')](_0x15aef0['attributes'],function(_0x11b44e){var _0x24632f={};_0x24632f[_0x11b44e]={'$like':'%'+_0x13a74b[_0xf06c('0x31')][_0xf06c('0x3d')]+'%'};return _0x24632f;})});}_0x15aef0=_[_0xf06c('0x3e')]({},_0x15aef0,_0x13a74b[_0xf06c('0x4e')]);return _0x196d97[_0xf06c('0x4c')](_0x15aef0);}})[_0xf06c('0x25')](function(_0x4fb9a4){if(_0x4fb9a4){_0x530d03=_0x4fb9a4[_0xf06c('0x37')];if(!_0x13a74b[_0xf06c('0x31')][_0xf06c('0x38')](_0xf06c('0x4b'))){_0x15aef0[_0xf06c('0x1f')]=qs['limit'](_0x13a74b['query'][_0xf06c('0x1f')]);_0x15aef0[_0xf06c('0x1c')]=qs[_0xf06c('0x1c')](_0x13a74b[_0xf06c('0x31')][_0xf06c('0x1c')]);}return _0x196d97[_0xf06c('0x4c')](_0x15aef0);}})[_0xf06c('0x25')](function(_0x1db114){if(_0x1db114){return _0x1db114?{'count':_0x530d03,'rows':_0x1db114}:null;}})['then'](respondWithResult(_0x2f2255,null))[_0xf06c('0x43')](handleError(_0x2f2255,null));};exports['getDescriptions']=function(_0x493b36,_0x42b3ea,_0x59d60a){var _0x4f32dd={};var _0x366491={};var _0x41506e;var _0x588247;return db[_0xf06c('0x2b')][_0xf06c('0x4d')]({'where':{'id':_0x493b36['params']['id']}})['then'](handleEntityNotFound(_0x42b3ea,null))[_0xf06c('0x25')](function(_0x1bdd38){if(_0x1bdd38){_0x41506e=_0x1bdd38;_0x366491[_0xf06c('0x30')]=_[_0xf06c('0x32')](db[_0xf06c('0x49')]['rawAttributes']);_0x366491[_0xf06c('0x31')]=_[_0xf06c('0x32')](_0x493b36[_0xf06c('0x31')]);_0x366491[_0xf06c('0x33')]=_[_0xf06c('0x34')](_0x366491[_0xf06c('0x30')],_0x366491[_0xf06c('0x31')]);_0x4f32dd[_0xf06c('0x35')]=_[_0xf06c('0x34')](_0x366491[_0xf06c('0x30')],qs['fields'](_0x493b36[_0xf06c('0x31')]['fields']));_0x4f32dd[_0xf06c('0x35')]=_0x4f32dd[_0xf06c('0x35')][_0xf06c('0x37')]?_0x4f32dd['attributes']:_0x366491['model'];_0x4f32dd[_0xf06c('0x39')]=qs['sort'](_0x493b36[_0xf06c('0x31')][_0xf06c('0x3a')]);_0x4f32dd[_0xf06c('0x3b')]=qs[_0xf06c('0x33')](_[_0xf06c('0x3c')](_0x493b36[_0xf06c('0x31')],_0x366491[_0xf06c('0x33')]));if(_0x493b36[_0xf06c('0x31')][_0xf06c('0x3d')]){_0x4f32dd[_0xf06c('0x3b')]=_[_0xf06c('0x3e')](_0x4f32dd[_0xf06c('0x3b')],{'$or':_[_0xf06c('0x2a')](_0x4f32dd[_0xf06c('0x35')],function(_0x4c724e){var _0x43e588={};_0x43e588[_0x4c724e]={'$like':'%'+_0x493b36[_0xf06c('0x31')]['filter']+'%'};return _0x43e588;})});}_0x4f32dd=_[_0xf06c('0x3e')]({},_0x4f32dd,_0x493b36[_0xf06c('0x4e')]);return _0x41506e[_0xf06c('0x4f')](_0x4f32dd);}})['then'](function(_0x5063c3){if(_0x5063c3){_0x588247=_0x5063c3['length'];if(!_0x493b36['query'][_0xf06c('0x38')](_0xf06c('0x4b'))){_0x4f32dd['limit']=qs['limit'](_0x493b36['query']['limit']);_0x4f32dd['offset']=qs[_0xf06c('0x1c')](_0x493b36[_0xf06c('0x31')][_0xf06c('0x1c')]);}return _0x41506e[_0xf06c('0x4f')](_0x4f32dd);}})[_0xf06c('0x25')](function(_0x17a413){if(_0x17a413){return _0x17a413?{'count':_0x588247,'rows':_0x17a413}:null;}})[_0xf06c('0x25')](respondWithResult(_0x42b3ea,null))[_0xf06c('0x43')](handleError(_0x42b3ea,null));};exports[_0xf06c('0x50')]=function(_0x289d1d,_0x4ac33f,_0x1ef299){var _0x2b6541={};var _0x3d2642={};var _0xde04b8;var _0x13aca3;return db[_0xf06c('0x2b')]['findOne']({'where':{'id':_0x289d1d['params']['id']}})['then'](handleEntityNotFound(_0x4ac33f,null))[_0xf06c('0x25')](function(_0x82cc36){if(_0x82cc36){_0xde04b8=_0x82cc36;_0x3d2642[_0xf06c('0x30')]=_['keys'](db[_0xf06c('0x51')][_0xf06c('0x2c')]);_0x3d2642[_0xf06c('0x31')]=_[_0xf06c('0x32')](_0x289d1d['query']);_0x3d2642[_0xf06c('0x33')]=_[_0xf06c('0x34')](_0x3d2642[_0xf06c('0x30')],_0x3d2642[_0xf06c('0x31')]);_0x2b6541[_0xf06c('0x35')]=_[_0xf06c('0x34')](_0x3d2642[_0xf06c('0x30')],qs['fields'](_0x289d1d[_0xf06c('0x31')]['fields']));_0x2b6541[_0xf06c('0x35')]=_0x2b6541[_0xf06c('0x35')]['length']?_0x2b6541[_0xf06c('0x35')]:_0x3d2642[_0xf06c('0x30')];_0x2b6541[_0xf06c('0x39')]=qs[_0xf06c('0x3a')](_0x289d1d[_0xf06c('0x31')][_0xf06c('0x3a')]);_0x2b6541[_0xf06c('0x3b')]=qs[_0xf06c('0x33')](_['pick'](_0x289d1d[_0xf06c('0x31')],_0x3d2642[_0xf06c('0x33')]));if(_0x289d1d['query'][_0xf06c('0x3d')]){_0x2b6541['where']=_[_0xf06c('0x3e')](_0x2b6541['where'],{'$or':_[_0xf06c('0x2a')](_0x2b6541[_0xf06c('0x35')],function(_0x53b9c5){var _0x2ce377={};_0x2ce377[_0x53b9c5]={'$like':'%'+_0x289d1d[_0xf06c('0x31')][_0xf06c('0x3d')]+'%'};return _0x2ce377;})});}_0x2b6541=_[_0xf06c('0x3e')]({},_0x2b6541,_0x289d1d[_0xf06c('0x4e')]);return _0xde04b8[_0xf06c('0x50')](_0x2b6541);}})['then'](function(_0x1f3702){if(_0x1f3702){_0x13aca3=_0x1f3702[_0xf06c('0x37')];if(!_0x289d1d[_0xf06c('0x31')]['hasOwnProperty'](_0xf06c('0x4b'))){_0x2b6541[_0xf06c('0x1f')]=qs[_0xf06c('0x1f')](_0x289d1d[_0xf06c('0x31')][_0xf06c('0x1f')]);_0x2b6541[_0xf06c('0x1c')]=qs[_0xf06c('0x1c')](_0x289d1d[_0xf06c('0x31')]['offset']);}return _0xde04b8[_0xf06c('0x50')](_0x2b6541);}})[_0xf06c('0x25')](function(_0x271299){if(_0x271299){return _0x271299?{'count':_0x13aca3,'rows':_0x271299}:null;}})['then'](respondWithResult(_0x4ac33f,null))[_0xf06c('0x43')](handleError(_0x4ac33f,null));};exports['setTags']=function(_0x4dde8d,_0x20e4f3,_0x371a83){if(_0x4dde8d[_0xf06c('0x48')]['id']){delete _0x4dde8d[_0xf06c('0x48')]['id'];}return db['DeskConfiguration'][_0xf06c('0x4d')]({'where':{'id':_0x4dde8d[_0xf06c('0x45')]['id']}})[_0xf06c('0x25')](handleEntityNotFound(_0x20e4f3,null))[_0xf06c('0x25')](function(_0x28aeb1){if(_0x28aeb1){return _0x28aeb1[_0xf06c('0x52')](_0x4dde8d[_0xf06c('0x48')][_0xf06c('0x53')]||[]);}return null;})[_0xf06c('0x25')](respondWithResult(_0x20e4f3,null))[_0xf06c('0x43')](handleError(_0x20e4f3,null));}; \ No newline at end of file +var _0x3823=['intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','filter','includeAll','include','rows','catch','params','rawAttributes','options','create','body','find','destroy','getFields','findOne','DeskField','map','getSubjects','getDescriptions','nolimit','Tag','getTags','setTags','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','index','DeskConfiguration','fieldName','key','query','keys'];(function(_0x3d1d42,_0x28accd){var _0x3e9e29=function(_0x532ac6){while(--_0x532ac6){_0x3d1d42['push'](_0x3d1d42['shift']());}};_0x3e9e29(++_0x28accd);}(_0x3823,0x71));var _0x3382=function(_0x2de8ef,_0x4eb9d2){_0x2de8ef=_0x2de8ef-0x0;var _0x37b8e9=_0x3823[_0x2de8ef];return _0x37b8e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3382('0x0'));var zipdir=require(_0x3382('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3382('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3382('0x3'));var util=require(_0x3382('0x4'));var path=require(_0x3382('0x5'));var sox=require('sox');var csv=require(_0x3382('0x6'));var ejs=require(_0x3382('0x7'));var fs=require('fs');var fs_extra=require(_0x3382('0x8'));var _=require(_0x3382('0x9'));var squel=require(_0x3382('0xa'));var crypto=require('crypto');var jsforce=require(_0x3382('0xb'));var deskjs=require(_0x3382('0xc'));var toCsv=require(_0x3382('0x6'));var querystring=require(_0x3382('0xd'));var Papa=require(_0x3382('0xe'));var Redis=require(_0x3382('0xf'));var authService=require(_0x3382('0x10'));var qs=require(_0x3382('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3382('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3382('0x13'));var config=require(_0x3382('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3382('0x15'))['db'];function respondWithStatusCode(_0x2ca4eb,_0x5731ec){_0x5731ec=_0x5731ec||0xcc;return function(_0x285acf){if(_0x285acf){return _0x2ca4eb[_0x3382('0x16')](_0x5731ec);}return _0x2ca4eb[_0x3382('0x17')](_0x5731ec)[_0x3382('0x18')]();};}function respondWithResult(_0x4ec628,_0x152adb){_0x152adb=_0x152adb||0xc8;return function(_0x1143c3){if(_0x1143c3){return _0x4ec628[_0x3382('0x17')](_0x152adb)[_0x3382('0x19')](_0x1143c3);}};}function respondWithFilteredResult(_0x15660c,_0x3c344c){return function(_0x3648b4){if(_0x3648b4){var _0x4deaac=typeof _0x3c344c[_0x3382('0x1a')]===_0x3382('0x1b')&&typeof _0x3c344c[_0x3382('0x1c')]===_0x3382('0x1b');var _0x518e38=_0x3648b4[_0x3382('0x1d')];var _0x31eb83=_0x4deaac?0x0:_0x3c344c['offset'];var _0x85b501=_0x4deaac?_0x3648b4[_0x3382('0x1d')]:_0x3c344c[_0x3382('0x1a')]+_0x3c344c[_0x3382('0x1c')];var _0xf29c59;if(_0x85b501>=_0x518e38){_0x85b501=_0x518e38;_0xf29c59=0xc8;}else{_0xf29c59=0xce;}_0x15660c['status'](_0xf29c59);return _0x15660c[_0x3382('0x1e')]('Content-Range',_0x31eb83+'-'+_0x85b501+'/'+_0x518e38)[_0x3382('0x19')](_0x3648b4);}return null;};}function patchUpdates(_0x26a7d4){return function(_0x4fdc94){try{jsonpatch[_0x3382('0x1f')](_0x4fdc94,_0x26a7d4,!![]);}catch(_0x61d8bb){return BPromise['reject'](_0x61d8bb);}return _0x4fdc94[_0x3382('0x20')]();};}function saveUpdates(_0x17ac77,_0x16f9f6){return function(_0x5a67ba){if(_0x5a67ba){return _0x5a67ba[_0x3382('0x21')](_0x17ac77)[_0x3382('0x22')](function(_0x38cd2b){return _0x38cd2b;});}return null;};}function removeEntity(_0x498714,_0x73abfd){return function(_0x509843){if(_0x509843){return _0x509843['destroy']()['then'](function(){_0x498714[_0x3382('0x17')](0xcc)[_0x3382('0x18')]();});}};}function handleEntityNotFound(_0x2b952f,_0x28bd92){return function(_0x58de03){if(!_0x58de03){_0x2b952f[_0x3382('0x16')](0x194);}return _0x58de03;};}function handleError(_0x47762f,_0x22dd9c){_0x22dd9c=_0x22dd9c||0x1f4;return function(_0x55d42e){logger[_0x3382('0x23')](_0x55d42e['stack']);if(_0x55d42e[_0x3382('0x24')]){delete _0x55d42e['name'];}_0x47762f[_0x3382('0x17')](_0x22dd9c)['send'](_0x55d42e);};}exports[_0x3382('0x25')]=function(_0x37033e,_0x4c5b64){var _0x311524={},_0x593087={},_0x40ae7a={'count':0x0,'rows':[]};var _0xc6fcde=_['map'](db[_0x3382('0x26')]['rawAttributes'],function(_0x4f32dc){return{'name':_0x4f32dc[_0x3382('0x27')],'type':_0x4f32dc['type'][_0x3382('0x28')]};});_0x593087['model']=_['map'](_0xc6fcde,_0x3382('0x24'));_0x593087[_0x3382('0x29')]=_[_0x3382('0x2a')](_0x37033e[_0x3382('0x29')]);_0x593087['filters']=_[_0x3382('0x2b')](_0x593087[_0x3382('0x2c')],_0x593087[_0x3382('0x29')]);_0x311524['attributes']=_[_0x3382('0x2b')](_0x593087['model'],qs['fields'](_0x37033e[_0x3382('0x29')][_0x3382('0x2d')]));_0x311524['attributes']=_0x311524[_0x3382('0x2e')][_0x3382('0x2f')]?_0x311524[_0x3382('0x2e')]:_0x593087['model'];if(!_0x37033e['query'][_0x3382('0x30')]('nolimit')){_0x311524[_0x3382('0x1c')]=qs[_0x3382('0x1c')](_0x37033e[_0x3382('0x29')][_0x3382('0x1c')]);_0x311524[_0x3382('0x1a')]=qs[_0x3382('0x1a')](_0x37033e[_0x3382('0x29')][_0x3382('0x1a')]);}_0x311524[_0x3382('0x31')]=qs[_0x3382('0x32')](_0x37033e[_0x3382('0x29')][_0x3382('0x32')]);_0x311524[_0x3382('0x33')]=qs[_0x3382('0x34')](_[_0x3382('0x35')](_0x37033e[_0x3382('0x29')],_0x593087[_0x3382('0x34')]),_0xc6fcde);if(_0x37033e[_0x3382('0x29')]['filter']){_0x311524[_0x3382('0x33')]=_[_0x3382('0x36')](_0x311524[_0x3382('0x33')],{'$or':_['map'](_0xc6fcde,function(_0x50e3c6){if(_0x50e3c6[_0x3382('0x37')]!=='VIRTUAL'){var _0x3971bf={};_0x3971bf[_0x50e3c6[_0x3382('0x24')]]={'$like':'%'+_0x37033e[_0x3382('0x29')][_0x3382('0x38')]+'%'};return _0x3971bf;}})});}_0x311524=_[_0x3382('0x36')]({},_0x311524,_0x37033e['options']);var _0xdc1c62={'where':_0x311524[_0x3382('0x33')]};return db[_0x3382('0x26')]['count'](_0xdc1c62)['then'](function(_0x14c374){_0x40ae7a[_0x3382('0x1d')]=_0x14c374;if(_0x37033e[_0x3382('0x29')][_0x3382('0x39')]){_0x311524[_0x3382('0x3a')]=[{'all':!![]}];}return db[_0x3382('0x26')]['findAll'](_0x311524);})[_0x3382('0x22')](function(_0x12440e){_0x40ae7a[_0x3382('0x3b')]=_0x12440e;return _0x40ae7a;})[_0x3382('0x22')](respondWithFilteredResult(_0x4c5b64,_0x311524))[_0x3382('0x3c')](handleError(_0x4c5b64,null));};exports['show']=function(_0x4f4890,_0x5c19ea){var _0x3c2fd9={'raw':![],'where':{'id':_0x4f4890[_0x3382('0x3d')]['id']}},_0x425e43={};_0x425e43[_0x3382('0x2c')]=_['keys'](db[_0x3382('0x26')][_0x3382('0x3e')]);_0x425e43['query']=_['keys'](_0x4f4890[_0x3382('0x29')]);_0x425e43[_0x3382('0x34')]=_['intersection'](_0x425e43[_0x3382('0x2c')],_0x425e43[_0x3382('0x29')]);_0x3c2fd9[_0x3382('0x2e')]=_[_0x3382('0x2b')](_0x425e43[_0x3382('0x2c')],qs['fields'](_0x4f4890[_0x3382('0x29')][_0x3382('0x2d')]));_0x3c2fd9['attributes']=_0x3c2fd9[_0x3382('0x2e')][_0x3382('0x2f')]?_0x3c2fd9[_0x3382('0x2e')]:_0x425e43[_0x3382('0x2c')];if(_0x4f4890[_0x3382('0x29')][_0x3382('0x39')]){_0x3c2fd9['include']=[{'all':!![]}];}_0x3c2fd9=_[_0x3382('0x36')]({},_0x3c2fd9,_0x4f4890[_0x3382('0x3f')]);return db[_0x3382('0x26')]['find'](_0x3c2fd9)['then'](handleEntityNotFound(_0x5c19ea,null))[_0x3382('0x22')](respondWithResult(_0x5c19ea,null))[_0x3382('0x3c')](handleError(_0x5c19ea,null));};exports[_0x3382('0x40')]=function(_0x4d1ba4,_0x4380b1){return db[_0x3382('0x26')][_0x3382('0x40')](_0x4d1ba4[_0x3382('0x41')],{})['then'](respondWithResult(_0x4380b1,0xc9))[_0x3382('0x3c')](handleError(_0x4380b1,null));};exports[_0x3382('0x21')]=function(_0x4f8b07,_0x2e2d85){if(_0x4f8b07[_0x3382('0x41')]['id']){delete _0x4f8b07['body']['id'];}return db[_0x3382('0x26')][_0x3382('0x42')]({'where':{'id':_0x4f8b07[_0x3382('0x3d')]['id']}})[_0x3382('0x22')](handleEntityNotFound(_0x2e2d85,null))['then'](saveUpdates(_0x4f8b07[_0x3382('0x41')],null))[_0x3382('0x22')](respondWithResult(_0x2e2d85,null))['catch'](handleError(_0x2e2d85,null));};exports[_0x3382('0x43')]=function(_0x1f8116,_0x3c4582){return db[_0x3382('0x26')][_0x3382('0x42')]({'where':{'id':_0x1f8116[_0x3382('0x3d')]['id']}})[_0x3382('0x22')](handleEntityNotFound(_0x3c4582,null))[_0x3382('0x22')](removeEntity(_0x3c4582,null))[_0x3382('0x3c')](handleError(_0x3c4582,null));};exports[_0x3382('0x44')]=function(_0x3ed697,_0x1e6414,_0x5db24b){var _0x4df639={};var _0x21ffde={};var _0x3d466d;var _0x215923;return db[_0x3382('0x26')][_0x3382('0x45')]({'where':{'id':_0x3ed697[_0x3382('0x3d')]['id']}})[_0x3382('0x22')](handleEntityNotFound(_0x1e6414,null))[_0x3382('0x22')](function(_0x2f3721){if(_0x2f3721){_0x3d466d=_0x2f3721;_0x21ffde[_0x3382('0x2c')]=_[_0x3382('0x2a')](db[_0x3382('0x46')]['rawAttributes']);_0x21ffde[_0x3382('0x29')]=_['keys'](_0x3ed697['query']);_0x21ffde['filters']=_[_0x3382('0x2b')](_0x21ffde[_0x3382('0x2c')],_0x21ffde[_0x3382('0x29')]);_0x4df639['attributes']=_['intersection'](_0x21ffde[_0x3382('0x2c')],qs[_0x3382('0x2d')](_0x3ed697['query']['fields']));_0x4df639[_0x3382('0x2e')]=_0x4df639[_0x3382('0x2e')][_0x3382('0x2f')]?_0x4df639[_0x3382('0x2e')]:_0x21ffde[_0x3382('0x2c')];_0x4df639[_0x3382('0x31')]=qs['sort'](_0x3ed697[_0x3382('0x29')][_0x3382('0x32')]);_0x4df639['where']=qs[_0x3382('0x34')](_['pick'](_0x3ed697[_0x3382('0x29')],_0x21ffde[_0x3382('0x34')]));if(_0x3ed697[_0x3382('0x29')][_0x3382('0x38')]){_0x4df639[_0x3382('0x33')]=_['merge'](_0x4df639[_0x3382('0x33')],{'$or':_[_0x3382('0x47')](_0x4df639['attributes'],function(_0x8737e1){var _0x399ff0={};_0x399ff0[_0x8737e1]={'$like':'%'+_0x3ed697['query'][_0x3382('0x38')]+'%'};return _0x399ff0;})});}_0x4df639=_[_0x3382('0x36')]({},_0x4df639,_0x3ed697[_0x3382('0x3f')]);return _0x3d466d[_0x3382('0x44')](_0x4df639);}})[_0x3382('0x22')](function(_0x29e2a6){if(_0x29e2a6){_0x215923=_0x29e2a6[_0x3382('0x2f')];if(!_0x3ed697[_0x3382('0x29')][_0x3382('0x30')]('nolimit')){_0x4df639[_0x3382('0x1c')]=qs[_0x3382('0x1c')](_0x3ed697[_0x3382('0x29')][_0x3382('0x1c')]);_0x4df639['offset']=qs[_0x3382('0x1a')](_0x3ed697[_0x3382('0x29')][_0x3382('0x1a')]);}return _0x3d466d['getFields'](_0x4df639);}})['then'](function(_0x174aef){if(_0x174aef){return _0x174aef?{'count':_0x215923,'rows':_0x174aef}:null;}})[_0x3382('0x22')](respondWithResult(_0x1e6414,null))[_0x3382('0x3c')](handleError(_0x1e6414,null));};exports[_0x3382('0x48')]=function(_0x5e3de7,_0x5a14e2,_0x63b0c9){var _0x5a2f9f={};var _0x2270ad={};var _0x3be27d;var _0x5f456b;return db[_0x3382('0x26')][_0x3382('0x45')]({'where':{'id':_0x5e3de7[_0x3382('0x3d')]['id']}})[_0x3382('0x22')](handleEntityNotFound(_0x5a14e2,null))[_0x3382('0x22')](function(_0x415562){if(_0x415562){_0x3be27d=_0x415562;_0x2270ad[_0x3382('0x2c')]=_[_0x3382('0x2a')](db[_0x3382('0x46')][_0x3382('0x3e')]);_0x2270ad['query']=_[_0x3382('0x2a')](_0x5e3de7[_0x3382('0x29')]);_0x2270ad[_0x3382('0x34')]=_[_0x3382('0x2b')](_0x2270ad[_0x3382('0x2c')],_0x2270ad[_0x3382('0x29')]);_0x5a2f9f[_0x3382('0x2e')]=_['intersection'](_0x2270ad[_0x3382('0x2c')],qs[_0x3382('0x2d')](_0x5e3de7[_0x3382('0x29')]['fields']));_0x5a2f9f[_0x3382('0x2e')]=_0x5a2f9f[_0x3382('0x2e')][_0x3382('0x2f')]?_0x5a2f9f[_0x3382('0x2e')]:_0x2270ad['model'];_0x5a2f9f[_0x3382('0x31')]=qs[_0x3382('0x32')](_0x5e3de7[_0x3382('0x29')][_0x3382('0x32')]);_0x5a2f9f[_0x3382('0x33')]=qs['filters'](_[_0x3382('0x35')](_0x5e3de7[_0x3382('0x29')],_0x2270ad[_0x3382('0x34')]));if(_0x5e3de7[_0x3382('0x29')][_0x3382('0x38')]){_0x5a2f9f['where']=_['merge'](_0x5a2f9f[_0x3382('0x33')],{'$or':_[_0x3382('0x47')](_0x5a2f9f[_0x3382('0x2e')],function(_0x82ae0f){var _0x4fba34={};_0x4fba34[_0x82ae0f]={'$like':'%'+_0x5e3de7[_0x3382('0x29')]['filter']+'%'};return _0x4fba34;})});}_0x5a2f9f=_[_0x3382('0x36')]({},_0x5a2f9f,_0x5e3de7['options']);return _0x3be27d['getSubjects'](_0x5a2f9f);}})['then'](function(_0x53516b){if(_0x53516b){_0x5f456b=_0x53516b['length'];if(!_0x5e3de7[_0x3382('0x29')][_0x3382('0x30')]('nolimit')){_0x5a2f9f[_0x3382('0x1c')]=qs[_0x3382('0x1c')](_0x5e3de7[_0x3382('0x29')][_0x3382('0x1c')]);_0x5a2f9f[_0x3382('0x1a')]=qs[_0x3382('0x1a')](_0x5e3de7['query'][_0x3382('0x1a')]);}return _0x3be27d[_0x3382('0x48')](_0x5a2f9f);}})[_0x3382('0x22')](function(_0x4b47ba){if(_0x4b47ba){return _0x4b47ba?{'count':_0x5f456b,'rows':_0x4b47ba}:null;}})['then'](respondWithResult(_0x5a14e2,null))[_0x3382('0x3c')](handleError(_0x5a14e2,null));};exports['getDescriptions']=function(_0x280a5d,_0xb3be09,_0x2e03ae){var _0x4fd790={};var _0x305e95={};var _0x8202b3;var _0x108daf;return db[_0x3382('0x26')][_0x3382('0x45')]({'where':{'id':_0x280a5d[_0x3382('0x3d')]['id']}})['then'](handleEntityNotFound(_0xb3be09,null))[_0x3382('0x22')](function(_0x3228fe){if(_0x3228fe){_0x8202b3=_0x3228fe;_0x305e95[_0x3382('0x2c')]=_[_0x3382('0x2a')](db[_0x3382('0x46')][_0x3382('0x3e')]);_0x305e95[_0x3382('0x29')]=_['keys'](_0x280a5d[_0x3382('0x29')]);_0x305e95['filters']=_[_0x3382('0x2b')](_0x305e95['model'],_0x305e95[_0x3382('0x29')]);_0x4fd790[_0x3382('0x2e')]=_['intersection'](_0x305e95['model'],qs['fields'](_0x280a5d[_0x3382('0x29')][_0x3382('0x2d')]));_0x4fd790['attributes']=_0x4fd790[_0x3382('0x2e')]['length']?_0x4fd790['attributes']:_0x305e95['model'];_0x4fd790['order']=qs['sort'](_0x280a5d[_0x3382('0x29')][_0x3382('0x32')]);_0x4fd790[_0x3382('0x33')]=qs['filters'](_[_0x3382('0x35')](_0x280a5d[_0x3382('0x29')],_0x305e95[_0x3382('0x34')]));if(_0x280a5d[_0x3382('0x29')]['filter']){_0x4fd790[_0x3382('0x33')]=_[_0x3382('0x36')](_0x4fd790['where'],{'$or':_[_0x3382('0x47')](_0x4fd790['attributes'],function(_0x2c2432){var _0x4340a9={};_0x4340a9[_0x2c2432]={'$like':'%'+_0x280a5d[_0x3382('0x29')][_0x3382('0x38')]+'%'};return _0x4340a9;})});}_0x4fd790=_[_0x3382('0x36')]({},_0x4fd790,_0x280a5d[_0x3382('0x3f')]);return _0x8202b3[_0x3382('0x49')](_0x4fd790);}})[_0x3382('0x22')](function(_0x4102d4){if(_0x4102d4){_0x108daf=_0x4102d4[_0x3382('0x2f')];if(!_0x280a5d[_0x3382('0x29')][_0x3382('0x30')](_0x3382('0x4a'))){_0x4fd790[_0x3382('0x1c')]=qs[_0x3382('0x1c')](_0x280a5d[_0x3382('0x29')][_0x3382('0x1c')]);_0x4fd790[_0x3382('0x1a')]=qs[_0x3382('0x1a')](_0x280a5d[_0x3382('0x29')]['offset']);}return _0x8202b3[_0x3382('0x49')](_0x4fd790);}})[_0x3382('0x22')](function(_0x47b7dd){if(_0x47b7dd){return _0x47b7dd?{'count':_0x108daf,'rows':_0x47b7dd}:null;}})[_0x3382('0x22')](respondWithResult(_0xb3be09,null))[_0x3382('0x3c')](handleError(_0xb3be09,null));};exports['getTags']=function(_0x5de1be,_0x4cd2dc,_0x58f0d3){var _0x38ce34={};var _0x1b8ed0={};var _0x3ccaeb;var _0x2e626e;return db[_0x3382('0x26')][_0x3382('0x45')]({'where':{'id':_0x5de1be[_0x3382('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4cd2dc,null))[_0x3382('0x22')](function(_0x183a14){if(_0x183a14){_0x3ccaeb=_0x183a14;_0x1b8ed0['model']=_[_0x3382('0x2a')](db[_0x3382('0x4b')][_0x3382('0x3e')]);_0x1b8ed0[_0x3382('0x29')]=_[_0x3382('0x2a')](_0x5de1be[_0x3382('0x29')]);_0x1b8ed0[_0x3382('0x34')]=_[_0x3382('0x2b')](_0x1b8ed0['model'],_0x1b8ed0[_0x3382('0x29')]);_0x38ce34['attributes']=_[_0x3382('0x2b')](_0x1b8ed0[_0x3382('0x2c')],qs['fields'](_0x5de1be['query'][_0x3382('0x2d')]));_0x38ce34[_0x3382('0x2e')]=_0x38ce34[_0x3382('0x2e')]['length']?_0x38ce34[_0x3382('0x2e')]:_0x1b8ed0[_0x3382('0x2c')];_0x38ce34[_0x3382('0x31')]=qs[_0x3382('0x32')](_0x5de1be[_0x3382('0x29')][_0x3382('0x32')]);_0x38ce34[_0x3382('0x33')]=qs[_0x3382('0x34')](_[_0x3382('0x35')](_0x5de1be[_0x3382('0x29')],_0x1b8ed0[_0x3382('0x34')]));if(_0x5de1be[_0x3382('0x29')][_0x3382('0x38')]){_0x38ce34[_0x3382('0x33')]=_['merge'](_0x38ce34[_0x3382('0x33')],{'$or':_[_0x3382('0x47')](_0x38ce34[_0x3382('0x2e')],function(_0x5eb32d){var _0x4e9441={};_0x4e9441[_0x5eb32d]={'$like':'%'+_0x5de1be['query'][_0x3382('0x38')]+'%'};return _0x4e9441;})});}_0x38ce34=_['merge']({},_0x38ce34,_0x5de1be[_0x3382('0x3f')]);return _0x3ccaeb[_0x3382('0x4c')](_0x38ce34);}})[_0x3382('0x22')](function(_0x604559){if(_0x604559){_0x2e626e=_0x604559[_0x3382('0x2f')];if(!_0x5de1be[_0x3382('0x29')][_0x3382('0x30')](_0x3382('0x4a'))){_0x38ce34[_0x3382('0x1c')]=qs['limit'](_0x5de1be['query']['limit']);_0x38ce34['offset']=qs[_0x3382('0x1a')](_0x5de1be[_0x3382('0x29')]['offset']);}return _0x3ccaeb[_0x3382('0x4c')](_0x38ce34);}})[_0x3382('0x22')](function(_0x46381f){if(_0x46381f){return _0x46381f?{'count':_0x2e626e,'rows':_0x46381f}:null;}})[_0x3382('0x22')](respondWithResult(_0x4cd2dc,null))[_0x3382('0x3c')](handleError(_0x4cd2dc,null));};exports['setTags']=function(_0x2c7c58,_0x573864,_0x37d333){if(_0x2c7c58[_0x3382('0x41')]['id']){delete _0x2c7c58['body']['id'];}return db[_0x3382('0x26')][_0x3382('0x45')]({'where':{'id':_0x2c7c58['params']['id']}})[_0x3382('0x22')](handleEntityNotFound(_0x573864,null))[_0x3382('0x22')](function(_0x17ee82){if(_0x17ee82){return _0x17ee82[_0x3382('0x4d')](_0x2c7c58[_0x3382('0x41')]['ids']||[]);}return null;})['then'](respondWithResult(_0x573864,null))[_0x3382('0x3c')](handleError(_0x573864,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 84352c4..b8c4845 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 _0x94f9=['define','DeskConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5d506b,_0x41b1ca){var _0x2a8f24=function(_0x12821c){while(--_0x12821c){_0x5d506b['push'](_0x5d506b['shift']());}};_0x2a8f24(++_0x41b1ca);}(_0x94f9,0x19a));var _0x994f=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x94f9[_0x74895e];return _0x40bc2a;};'use strict';var _=require(_0x994f('0x0'));var util=require(_0x994f('0x1'));var logger=require('../../config/logger')(_0x994f('0x2'));var moment=require(_0x994f('0x3'));var BPromise=require(_0x994f('0x4'));var rp=require(_0x994f('0x5'));var fs=require('fs');var path=require(_0x994f('0x6'));var rimraf=require(_0x994f('0x7'));var config=require(_0x994f('0x8'));var attributes=require('./intDeskConfiguration.attributes');module[_0x994f('0x9')]=function(_0x4b50a3,_0x577d78){return _0x4b50a3[_0x994f('0xa')](_0x994f('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45d3=['exports','define','DeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x25f6d5,_0x2ae5ef){var _0x330bbd=function(_0x7c98b9){while(--_0x7c98b9){_0x25f6d5['push'](_0x25f6d5['shift']());}};_0x330bbd(++_0x2ae5ef);}(_0x45d3,0x148));var _0x345d=function(_0x3c607f,_0x2d4ff2){_0x3c607f=_0x3c607f-0x0;var _0x1b4e2a=_0x45d3[_0x3c607f];return _0x1b4e2a;};'use strict';var _=require('lodash');var util=require(_0x345d('0x0'));var logger=require(_0x345d('0x1'))(_0x345d('0x2'));var moment=require(_0x345d('0x3'));var BPromise=require(_0x345d('0x4'));var rp=require(_0x345d('0x5'));var fs=require('fs');var path=require(_0x345d('0x6'));var rimraf=require(_0x345d('0x7'));var config=require(_0x345d('0x8'));var attributes=require(_0x345d('0x9'));module[_0x345d('0xa')]=function(_0x40f2ab,_0x459be2){return _0x40f2ab[_0x345d('0xb')](_0x345d('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index ad5d412..2ad66df 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 _0xb16f=['http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client'];(function(_0x2caf63,_0x220384){var _0x87f3b4=function(_0x542396){while(--_0x542396){_0x2caf63['push'](_0x2caf63['shift']());}};_0x87f3b4(++_0x220384);}(_0xb16f,0x1c4));var _0xfb16=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0xb16f[_0x53f3ad];return _0x48b203;};'use strict';var _=require('lodash');var util=require(_0xfb16('0x0'));var moment=require(_0xfb16('0x1'));var BPromise=require(_0xfb16('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb16('0x3'));var db=require(_0xfb16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb16('0x5'))('rpc');var config=require(_0xfb16('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfb16('0x7')][_0xfb16('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x423ffd,_0x30ac0e,_0x496033){return new BPromise(function(_0x362b89,_0x375f48){return client[_0xfb16('0x9')](_0x423ffd,_0x496033)['then'](function(_0x1d7dcc){logger[_0xfb16('0xa')](_0xfb16('0xb'),_0x30ac0e,_0xfb16('0xc'));logger[_0xfb16('0xd')](_0xfb16('0xe'),_0x30ac0e,_0xfb16('0xc'),JSON[_0xfb16('0xf')](_0x1d7dcc));if(_0x1d7dcc[_0xfb16('0x10')]){if(_0x1d7dcc[_0xfb16('0x10')][_0xfb16('0x11')]===0x1f4){logger[_0xfb16('0x10')](_0xfb16('0xb'),_0x30ac0e,_0x1d7dcc[_0xfb16('0x10')][_0xfb16('0x12')]);return _0x375f48(_0x1d7dcc[_0xfb16('0x10')]['message']);}logger[_0xfb16('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x30ac0e,_0x1d7dcc[_0xfb16('0x10')]['message']);return _0x362b89(_0x1d7dcc[_0xfb16('0x10')][_0xfb16('0x12')]);}else{logger[_0xfb16('0xa')](_0xfb16('0xb'),_0x30ac0e,_0xfb16('0xc'));_0x362b89(_0x1d7dcc[_0xfb16('0x13')][_0xfb16('0x12')]);}})['catch'](function(_0x4e2371){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x30ac0e,_0x4e2371);_0x375f48(_0x4e2371);});});} \ No newline at end of file +var _0xf567=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x31b1e8,_0x218128){var _0x2203ae=function(_0x142bd9){while(--_0x142bd9){_0x31b1e8['push'](_0x31b1e8['shift']());}};_0x2203ae(++_0x218128);}(_0xf567,0x118));var _0x7f56=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf567[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var moment=require(_0x7f56('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f56('0x3'));var fs=require('fs');var Redis=require(_0x7f56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f56('0x5'));var logger=require(_0x7f56('0x6'))(_0x7f56('0x7'));var config=require(_0x7f56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f56('0x9')][_0x7f56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1215e3,_0x52959a,_0x3f7ad5){return new BPromise(function(_0x2eaed8,_0x22d94e){return client[_0x7f56('0xb')](_0x1215e3,_0x3f7ad5)[_0x7f56('0xc')](function(_0x3ad7d5){logger[_0x7f56('0xd')](_0x7f56('0xe'),_0x52959a,_0x7f56('0xf'));logger[_0x7f56('0x10')](_0x7f56('0x11'),_0x52959a,_0x7f56('0xf'),JSON[_0x7f56('0x12')](_0x3ad7d5));if(_0x3ad7d5[_0x7f56('0x13')]){if(_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x14')]===0x1f4){logger[_0x7f56('0x13')](_0x7f56('0xe'),_0x52959a,_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);return _0x22d94e(_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);}logger['error'](_0x7f56('0xe'),_0x52959a,_0x3ad7d5[_0x7f56('0x13')][_0x7f56('0x15')]);return _0x2eaed8(_0x3ad7d5['error'][_0x7f56('0x15')]);}else{logger[_0x7f56('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x52959a,_0x7f56('0xf'));_0x2eaed8(_0x3ad7d5[_0x7f56('0x16')]['message']);}})['catch'](function(_0x1dee75){logger['error'](_0x7f56('0xe'),_0x52959a,_0x1dee75);_0x22d94e(_0x1dee75);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 95e317a..14a7130 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 _0x9ad9=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','path'];(function(_0x31edc1,_0x2bab06){var _0x5c7ca9=function(_0x4b530c){while(--_0x4b530c){_0x31edc1['push'](_0x31edc1['shift']());}};_0x5c7ca9(++_0x2bab06);}(_0x9ad9,0xbc));var _0x99ad=function(_0x1d2c4a,_0x54c283){_0x1d2c4a=_0x1d2c4a-0x0;var _0x23e15d=_0x9ad9[_0x1d2c4a];return _0x23e15d;};'use strict';var multer=require(_0x99ad('0x0'));var util=require('util');var path=require(_0x99ad('0x1'));var timeout=require(_0x99ad('0x2'));var express=require(_0x99ad('0x3'));var router=express[_0x99ad('0x4')]();var fs_extra=require(_0x99ad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x99ad('0x6'));var config=require(_0x99ad('0x7'));var controller=require(_0x99ad('0x8'));router[_0x99ad('0x9')]('/',auth['isAuthenticated'](),controller[_0x99ad('0xa')]);router[_0x99ad('0x9')](_0x99ad('0xb'),auth[_0x99ad('0xc')](),controller[_0x99ad('0xd')]);router[_0x99ad('0xe')]('/',auth[_0x99ad('0xc')](),controller[_0x99ad('0xf')]);router[_0x99ad('0x10')](_0x99ad('0xb'),auth[_0x99ad('0xc')](),controller['update']);router['delete'](_0x99ad('0xb'),auth['isAuthenticated'](),controller[_0x99ad('0x11')]);module[_0x99ad('0x12')]=router; \ No newline at end of file +var _0xbd19=['../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb6bd60,_0x48e4a3){var _0x36d0dd=function(_0xc1356a){while(--_0xc1356a){_0xb6bd60['push'](_0xb6bd60['shift']());}};_0x36d0dd(++_0x48e4a3);}(_0xbd19,0x111));var _0x9bd1=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xbd19[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var path=require(_0x9bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x9bd1('0x3'));var router=express[_0x9bd1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9bd1('0x5'));var interaction=require(_0x9bd1('0x6'));var config=require(_0x9bd1('0x7'));var controller=require(_0x9bd1('0x8'));router[_0x9bd1('0x9')]('/',auth[_0x9bd1('0xa')](),controller[_0x9bd1('0xb')]);router[_0x9bd1('0x9')](_0x9bd1('0xc'),auth[_0x9bd1('0xa')](),controller[_0x9bd1('0xd')]);router[_0x9bd1('0xe')]('/',auth[_0x9bd1('0xa')](),controller[_0x9bd1('0xf')]);router[_0x9bd1('0x10')]('/:id',auth[_0x9bd1('0xa')](),controller[_0x9bd1('0x11')]);router[_0x9bd1('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9bd1('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 9581e6c..d5545df 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 _0x9422=['sequelize','exports','string','variable','keyValue','ENUM','customVariable','STRING'];(function(_0xeb80e,_0x337608){var _0x68e9d7=function(_0x50c896){while(--_0x50c896){_0xeb80e['push'](_0xeb80e['shift']());}};_0x68e9d7(++_0x337608);}(_0x9422,0x160));var _0x2942=function(_0x59c472,_0x82b732){_0x59c472=_0x59c472-0x0;var _0x1c782c=_0x9422[_0x59c472];return _0x1c782c;};'use strict';var Sequelize=require(_0x2942('0x0'));module[_0x2942('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2942('0x2'),_0x2942('0x3'),'customVariable',_0x2942('0x4'),'picklist'),'defaultValue':_0x2942('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2942('0x5')](_0x2942('0x2'),_0x2942('0x3'),_0x2942('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2942('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4ea8=['sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ea8,0xa0));var _0x84ea=function(_0x4e00f9,_0x5d0bbb){_0x4e00f9=_0x4e00f9-0x0;var _0x58c89e=_0x4ea8[_0x4e00f9];return _0x58c89e;};'use strict';var Sequelize=require(_0x84ea('0x0'));module[_0x84ea('0x1')]={'type':{'type':Sequelize[_0x84ea('0x2')]('string','variable',_0x84ea('0x3'),_0x84ea('0x4'),_0x84ea('0x5')),'defaultValue':_0x84ea('0x6')},'content':{'type':Sequelize[_0x84ea('0x7')]},'key':{'type':Sequelize[_0x84ea('0x7')]},'keyType':{'type':Sequelize[_0x84ea('0x2')]('string',_0x84ea('0x8'),_0x84ea('0x3'))},'keyContent':{'type':Sequelize[_0x84ea('0x7')]},'idField':{'type':Sequelize[_0x84ea('0x7')]},'nameField':{'type':Sequelize[_0x84ea('0x7')]},'customField':{'type':Sequelize[_0x84ea('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x84ea('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9112691..ce6708b 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 _0xb7ae=['include','find','create','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show'];(function(_0x2ed730,_0x1f47bc){var _0x500490=function(_0x379a26){while(--_0x379a26){_0x2ed730['push'](_0x2ed730['shift']());}};_0x500490(++_0x1f47bc);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x52e759,_0x3ec44e){_0x52e759=_0x52e759-0x0;var _0x25b646=_0xb7ae[_0x52e759];return _0x25b646;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var hardwareService=require(_0xeb7a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xeb7a('0x17'));var config=require(_0xeb7a('0x18'));var licenseUtil=require(_0xeb7a('0x19'));var db=require(_0xeb7a('0x1a'))['db'];function respondWithStatusCode(_0x13bcf4,_0x203723){_0x203723=_0x203723||0xcc;return function(_0x166e4d){if(_0x166e4d){return _0x13bcf4['sendStatus'](_0x203723);}return _0x13bcf4[_0xeb7a('0x1b')](_0x203723)[_0xeb7a('0x1c')]();};}function respondWithResult(_0x4e86a7,_0x110acb){_0x110acb=_0x110acb||0xc8;return function(_0x186ea3){if(_0x186ea3){return _0x4e86a7['status'](_0x110acb)[_0xeb7a('0x1d')](_0x186ea3);}};}function respondWithFilteredResult(_0x5db84f,_0x5d953f){return function(_0x388666){if(_0x388666){var _0x5e6256=typeof _0x5d953f['offset']===_0xeb7a('0x1e')&&typeof _0x5d953f[_0xeb7a('0x1f')]===_0xeb7a('0x1e');var _0x2d92c7=_0x388666['count'];var _0x4be13e=_0x5e6256?0x0:_0x5d953f[_0xeb7a('0x20')];var _0x26bd85=_0x5e6256?_0x388666['count']:_0x5d953f['offset']+_0x5d953f[_0xeb7a('0x1f')];var _0x25a399;if(_0x26bd85>=_0x2d92c7){_0x26bd85=_0x2d92c7;_0x25a399=0xc8;}else{_0x25a399=0xce;}_0x5db84f[_0xeb7a('0x1b')](_0x25a399);return _0x5db84f[_0xeb7a('0x21')](_0xeb7a('0x22'),_0x4be13e+'-'+_0x26bd85+'/'+_0x2d92c7)[_0xeb7a('0x1d')](_0x388666);}return null;};}function patchUpdates(_0x29fa3f){return function(_0x120128){try{jsonpatch['apply'](_0x120128,_0x29fa3f,!![]);}catch(_0x431d4a){return BPromise[_0xeb7a('0x23')](_0x431d4a);}return _0x120128['save']();};}function saveUpdates(_0x5af915,_0xeab362){return function(_0x434aac){if(_0x434aac){return _0x434aac[_0xeb7a('0x24')](_0x5af915)[_0xeb7a('0x25')](function(_0x29db91){return _0x29db91;});}return null;};}function removeEntity(_0x44cefc,_0xfb62a5){return function(_0x4c4816){if(_0x4c4816){return _0x4c4816[_0xeb7a('0x26')]()[_0xeb7a('0x25')](function(){_0x44cefc[_0xeb7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b7d3,_0x1cf8f6){return function(_0x182335){if(!_0x182335){_0x10b7d3[_0xeb7a('0x27')](0x194);}return _0x182335;};}function handleError(_0x53ade4,_0x15199a){_0x15199a=_0x15199a||0x1f4;return function(_0x52e882){logger[_0xeb7a('0x28')](_0x52e882[_0xeb7a('0x29')]);if(_0x52e882[_0xeb7a('0x2a')]){delete _0x52e882[_0xeb7a('0x2a')];}_0x53ade4[_0xeb7a('0x1b')](_0x15199a)[_0xeb7a('0x2b')](_0x52e882);};}exports[_0xeb7a('0x2c')]=function(_0x3917eb,_0x2a492f){var _0x20a197={},_0x2d2f9f={},_0x567bbe={'count':0x0,'rows':[]};var _0x34b88b=_[_0xeb7a('0x2d')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')],function(_0x14e2e1){return{'name':_0x14e2e1[_0xeb7a('0x30')],'type':_0x14e2e1[_0xeb7a('0x31')][_0xeb7a('0x32')]};});_0x2d2f9f[_0xeb7a('0x33')]=_[_0xeb7a('0x2d')](_0x34b88b,_0xeb7a('0x2a'));_0x2d2f9f['query']=_[_0xeb7a('0x34')](_0x3917eb[_0xeb7a('0x35')]);_0x2d2f9f[_0xeb7a('0x36')]=_[_0xeb7a('0x37')](_0x2d2f9f['model'],_0x2d2f9f[_0xeb7a('0x35')]);_0x20a197[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x2d2f9f[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x3917eb[_0xeb7a('0x35')]['fields']));_0x20a197[_0xeb7a('0x38')]=_0x20a197[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x20a197[_0xeb7a('0x38')]:_0x2d2f9f[_0xeb7a('0x33')];if(!_0x3917eb[_0xeb7a('0x35')]['hasOwnProperty'](_0xeb7a('0x3b'))){_0x20a197['limit']=qs[_0xeb7a('0x1f')](_0x3917eb[_0xeb7a('0x35')]['limit']);_0x20a197[_0xeb7a('0x20')]=qs[_0xeb7a('0x20')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x20')]);}_0x20a197[_0xeb7a('0x3c')]=qs[_0xeb7a('0x3d')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3d')]);_0x20a197['where']=qs[_0xeb7a('0x36')](_[_0xeb7a('0x3e')](_0x3917eb['query'],_0x2d2f9f[_0xeb7a('0x36')]),_0x34b88b);if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]){_0x20a197[_0xeb7a('0x40')]=_[_0xeb7a('0x41')](_0x20a197[_0xeb7a('0x40')],{'$or':_[_0xeb7a('0x2d')](_0x34b88b,function(_0x573e30){if(_0x573e30[_0xeb7a('0x31')]!==_0xeb7a('0x42')){var _0x308a2e={};_0x308a2e[_0x573e30[_0xeb7a('0x2a')]]={'$like':'%'+_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]+'%'};return _0x308a2e;}})});}_0x20a197=_[_0xeb7a('0x41')]({},_0x20a197,_0x3917eb[_0xeb7a('0x43')]);var _0x414580={'where':_0x20a197[_0xeb7a('0x40')]};return db[_0xeb7a('0x2e')][_0xeb7a('0x44')](_0x414580)['then'](function(_0x2d3d4d){_0x567bbe[_0xeb7a('0x44')]=_0x2d3d4d;if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x45')]){_0x20a197['include']=[{'all':!![]}];}return db[_0xeb7a('0x2e')][_0xeb7a('0x46')](_0x20a197);})[_0xeb7a('0x25')](function(_0x1803d6){_0x567bbe[_0xeb7a('0x47')]=_0x1803d6;return _0x567bbe;})[_0xeb7a('0x25')](respondWithFilteredResult(_0x2a492f,_0x20a197))['catch'](handleError(_0x2a492f,null));};exports[_0xeb7a('0x48')]=function(_0x1b1575,_0x48d620){var _0x436346={'raw':!![],'where':{'id':_0x1b1575['params']['id']}},_0x58c004={};_0x58c004['model']=_[_0xeb7a('0x34')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')]);_0x58c004[_0xeb7a('0x35')]=_[_0xeb7a('0x34')](_0x1b1575[_0xeb7a('0x35')]);_0x58c004['filters']=_['intersection'](_0x58c004[_0xeb7a('0x33')],_0x58c004['query']);_0x436346[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x58c004[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x1b1575['query'][_0xeb7a('0x39')]));_0x436346[_0xeb7a('0x38')]=_0x436346[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x436346['attributes']:_0x58c004[_0xeb7a('0x33')];if(_0x1b1575['query'][_0xeb7a('0x45')]){_0x436346[_0xeb7a('0x49')]=[{'all':!![]}];}_0x436346=_[_0xeb7a('0x41')]({},_0x436346,_0x1b1575[_0xeb7a('0x43')]);return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')](_0x436346)[_0xeb7a('0x25')](handleEntityNotFound(_0x48d620,null))['then'](respondWithResult(_0x48d620,null))['catch'](handleError(_0x48d620,null));};exports[_0xeb7a('0x4b')]=function(_0x3d48c8,_0x18c60f){return db[_0xeb7a('0x2e')][_0xeb7a('0x4b')](_0x3d48c8['body'],{})['then'](respondWithResult(_0x18c60f,0xc9))[_0xeb7a('0x4c')](handleError(_0x18c60f,null));};exports['update']=function(_0x202753,_0x5846bc){if(_0x202753[_0xeb7a('0x4d')]['id']){delete _0x202753[_0xeb7a('0x4d')]['id'];}return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')]({'where':{'id':_0x202753[_0xeb7a('0x4e')]['id']}})[_0xeb7a('0x25')](handleEntityNotFound(_0x5846bc,null))[_0xeb7a('0x25')](saveUpdates(_0x202753[_0xeb7a('0x4d')],null))[_0xeb7a('0x25')](respondWithResult(_0x5846bc,null))[_0xeb7a('0x4c')](handleError(_0x5846bc,null));};exports[_0xeb7a('0x26')]=function(_0x466a2f,_0x55eb50){return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')]({'where':{'id':_0x466a2f[_0xeb7a('0x4e')]['id']}})[_0xeb7a('0x25')](handleEntityNotFound(_0x55eb50,null))[_0xeb7a('0x25')](removeEntity(_0x55eb50,null))[_0xeb7a('0x4c')](handleError(_0x55eb50,null));}; \ No newline at end of file +var _0x8658=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','keys','filters','query','intersection','model','fields','attributes','order','sort','pick','filter','where','merge','options','DeskField','includeAll','include','rows','catch','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a2057,_0x44c5ec){var _0xd72118=function(_0x5ce644){while(--_0x5ce644){_0x1a2057['push'](_0x1a2057['shift']());}};_0xd72118(++_0x44c5ec);}(_0x8658,0x1d3));var _0x8865=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8658[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x8865('0x0'));var rimraf=require(_0x8865('0x1'));var zipdir=require(_0x8865('0x2'));var jsonpatch=require(_0x8865('0x3'));var rp=require(_0x8865('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8865('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8865('0x6'));var csv=require(_0x8865('0x7'));var ejs=require(_0x8865('0x8'));var fs=require('fs');var fs_extra=require(_0x8865('0x9'));var _=require(_0x8865('0xa'));var squel=require(_0x8865('0xb'));var crypto=require(_0x8865('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8865('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8865('0xe'));var Papa=require('papaparse');var Redis=require(_0x8865('0xf'));var authService=require(_0x8865('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8865('0x11'));var hardwareService=require(_0x8865('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8865('0x13'));var config=require(_0x8865('0x14'));var licenseUtil=require(_0x8865('0x15'));var db=require(_0x8865('0x16'))['db'];function respondWithStatusCode(_0x5858ce,_0x363729){_0x363729=_0x363729||0xcc;return function(_0x132386){if(_0x132386){return _0x5858ce[_0x8865('0x17')](_0x363729);}return _0x5858ce[_0x8865('0x18')](_0x363729)[_0x8865('0x19')]();};}function respondWithResult(_0x5aacac,_0x2c3502){_0x2c3502=_0x2c3502||0xc8;return function(_0x50e5e8){if(_0x50e5e8){return _0x5aacac[_0x8865('0x18')](_0x2c3502)[_0x8865('0x1a')](_0x50e5e8);}};}function respondWithFilteredResult(_0x1a2dee,_0x5367a6){return function(_0x3eb5f9){if(_0x3eb5f9){var _0x55edca=typeof _0x5367a6[_0x8865('0x1b')]===_0x8865('0x1c')&&typeof _0x5367a6['limit']===_0x8865('0x1c');var _0x9f4f33=_0x3eb5f9[_0x8865('0x1d')];var _0x4f6310=_0x55edca?0x0:_0x5367a6[_0x8865('0x1b')];var _0x1409c0=_0x55edca?_0x3eb5f9[_0x8865('0x1d')]:_0x5367a6[_0x8865('0x1b')]+_0x5367a6[_0x8865('0x1e')];var _0x24b431;if(_0x1409c0>=_0x9f4f33){_0x1409c0=_0x9f4f33;_0x24b431=0xc8;}else{_0x24b431=0xce;}_0x1a2dee[_0x8865('0x18')](_0x24b431);return _0x1a2dee[_0x8865('0x1f')](_0x8865('0x20'),_0x4f6310+'-'+_0x1409c0+'/'+_0x9f4f33)[_0x8865('0x1a')](_0x3eb5f9);}return null;};}function patchUpdates(_0x199ca7){return function(_0x4f9773){try{jsonpatch[_0x8865('0x21')](_0x4f9773,_0x199ca7,!![]);}catch(_0x232e21){return BPromise['reject'](_0x232e21);}return _0x4f9773[_0x8865('0x22')]();};}function saveUpdates(_0x19594f,_0x5d2f14){return function(_0x31b1b1){if(_0x31b1b1){return _0x31b1b1['update'](_0x19594f)[_0x8865('0x23')](function(_0x1601e0){return _0x1601e0;});}return null;};}function removeEntity(_0x6927b,_0x304a23){return function(_0x3b39fa){if(_0x3b39fa){return _0x3b39fa[_0x8865('0x24')]()[_0x8865('0x23')](function(){_0x6927b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4153ca,_0x461392){return function(_0x1f4b4e){if(!_0x1f4b4e){_0x4153ca['sendStatus'](0x194);}return _0x1f4b4e;};}function handleError(_0x4ee787,_0x4df452){_0x4df452=_0x4df452||0x1f4;return function(_0x40d674){logger[_0x8865('0x25')](_0x40d674[_0x8865('0x26')]);if(_0x40d674['name']){delete _0x40d674[_0x8865('0x27')];}_0x4ee787[_0x8865('0x18')](_0x4df452)[_0x8865('0x28')](_0x40d674);};}exports[_0x8865('0x29')]=function(_0x131fe6,_0x258d98){var _0x112e3c={},_0x143bc3={},_0x3c5d62={'count':0x0,'rows':[]};var _0x5cac52=_[_0x8865('0x2a')](db['DeskField'][_0x8865('0x2b')],function(_0x1e4998){return{'name':_0x1e4998['fieldName'],'type':_0x1e4998[_0x8865('0x2c')][_0x8865('0x2d')]};});_0x143bc3['model']=_['map'](_0x5cac52,'name');_0x143bc3['query']=_[_0x8865('0x2e')](_0x131fe6['query']);_0x143bc3[_0x8865('0x2f')]=_['intersection'](_0x143bc3['model'],_0x143bc3[_0x8865('0x30')]);_0x112e3c['attributes']=_[_0x8865('0x31')](_0x143bc3[_0x8865('0x32')],qs[_0x8865('0x33')](_0x131fe6[_0x8865('0x30')][_0x8865('0x33')]));_0x112e3c['attributes']=_0x112e3c[_0x8865('0x34')]['length']?_0x112e3c[_0x8865('0x34')]:_0x143bc3[_0x8865('0x32')];if(!_0x131fe6[_0x8865('0x30')]['hasOwnProperty']('nolimit')){_0x112e3c[_0x8865('0x1e')]=qs[_0x8865('0x1e')](_0x131fe6['query'][_0x8865('0x1e')]);_0x112e3c[_0x8865('0x1b')]=qs[_0x8865('0x1b')](_0x131fe6['query'][_0x8865('0x1b')]);}_0x112e3c[_0x8865('0x35')]=qs[_0x8865('0x36')](_0x131fe6['query']['sort']);_0x112e3c['where']=qs[_0x8865('0x2f')](_[_0x8865('0x37')](_0x131fe6[_0x8865('0x30')],_0x143bc3[_0x8865('0x2f')]),_0x5cac52);if(_0x131fe6['query'][_0x8865('0x38')]){_0x112e3c[_0x8865('0x39')]=_[_0x8865('0x3a')](_0x112e3c[_0x8865('0x39')],{'$or':_['map'](_0x5cac52,function(_0x58fa4a){if(_0x58fa4a['type']!=='VIRTUAL'){var _0x3a8057={};_0x3a8057[_0x58fa4a['name']]={'$like':'%'+_0x131fe6[_0x8865('0x30')][_0x8865('0x38')]+'%'};return _0x3a8057;}})});}_0x112e3c=_[_0x8865('0x3a')]({},_0x112e3c,_0x131fe6[_0x8865('0x3b')]);var _0x12f465={'where':_0x112e3c[_0x8865('0x39')]};return db[_0x8865('0x3c')][_0x8865('0x1d')](_0x12f465)[_0x8865('0x23')](function(_0x1bbf8d){_0x3c5d62['count']=_0x1bbf8d;if(_0x131fe6[_0x8865('0x30')][_0x8865('0x3d')]){_0x112e3c[_0x8865('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x112e3c);})[_0x8865('0x23')](function(_0x5d8c7b){_0x3c5d62[_0x8865('0x3f')]=_0x5d8c7b;return _0x3c5d62;})[_0x8865('0x23')](respondWithFilteredResult(_0x258d98,_0x112e3c))[_0x8865('0x40')](handleError(_0x258d98,null));};exports['show']=function(_0x86b557,_0x90749c){var _0x9fd95={'raw':!![],'where':{'id':_0x86b557[_0x8865('0x41')]['id']}},_0x186948={};_0x186948[_0x8865('0x32')]=_['keys'](db[_0x8865('0x3c')][_0x8865('0x2b')]);_0x186948[_0x8865('0x30')]=_['keys'](_0x86b557['query']);_0x186948[_0x8865('0x2f')]=_['intersection'](_0x186948['model'],_0x186948['query']);_0x9fd95[_0x8865('0x34')]=_[_0x8865('0x31')](_0x186948[_0x8865('0x32')],qs[_0x8865('0x33')](_0x86b557[_0x8865('0x30')][_0x8865('0x33')]));_0x9fd95[_0x8865('0x34')]=_0x9fd95['attributes'][_0x8865('0x42')]?_0x9fd95[_0x8865('0x34')]:_0x186948[_0x8865('0x32')];if(_0x86b557[_0x8865('0x30')][_0x8865('0x3d')]){_0x9fd95[_0x8865('0x3e')]=[{'all':!![]}];}_0x9fd95=_[_0x8865('0x3a')]({},_0x9fd95,_0x86b557[_0x8865('0x3b')]);return db[_0x8865('0x3c')]['find'](_0x9fd95)[_0x8865('0x23')](handleEntityNotFound(_0x90749c,null))[_0x8865('0x23')](respondWithResult(_0x90749c,null))['catch'](handleError(_0x90749c,null));};exports[_0x8865('0x43')]=function(_0x47540c,_0x18aa59){return db['DeskField']['create'](_0x47540c[_0x8865('0x44')],{})[_0x8865('0x23')](respondWithResult(_0x18aa59,0xc9))[_0x8865('0x40')](handleError(_0x18aa59,null));};exports['update']=function(_0x276c51,_0x1053a5){if(_0x276c51[_0x8865('0x44')]['id']){delete _0x276c51[_0x8865('0x44')]['id'];}return db['DeskField'][_0x8865('0x45')]({'where':{'id':_0x276c51[_0x8865('0x41')]['id']}})[_0x8865('0x23')](handleEntityNotFound(_0x1053a5,null))[_0x8865('0x23')](saveUpdates(_0x276c51[_0x8865('0x44')],null))['then'](respondWithResult(_0x1053a5,null))[_0x8865('0x40')](handleError(_0x1053a5,null));};exports['destroy']=function(_0x3cb558,_0x1b1800){return db[_0x8865('0x3c')][_0x8865('0x45')]({'where':{'id':_0x3cb558['params']['id']}})[_0x8865('0x23')](handleEntityNotFound(_0x1b1800,null))['then'](removeEntity(_0x1b1800,null))[_0x8865('0x40')](handleError(_0x1b1800,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 93e7b20..4e0dc3c 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 _0x2b24=['path','../../config/environment','exports','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2b24,0x1c9));var _0x42b2=function(_0x3c8fa5,_0x1ac10f){_0x3c8fa5=_0x3c8fa5-0x0;var _0x3fa63a=_0x2b24[_0x3c8fa5];return _0x3fa63a;};'use strict';var _=require(_0x42b2('0x0'));var util=require(_0x42b2('0x1'));var logger=require(_0x42b2('0x2'))('api');var moment=require(_0x42b2('0x3'));var BPromise=require(_0x42b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b2('0x5'));var rimraf=require('rimraf');var config=require(_0x42b2('0x6'));var attributes=require('./intDeskField.attributes');module[_0x42b2('0x7')]=function(_0x1e952a,_0x332087){return _0x1e952a['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x42b2('0x8'),'fields':[_0x42b2('0x9'),_0x42b2('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb591=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField'];(function(_0x539e78,_0x47d3a4){var _0x79f6ff=function(_0x9523b2){while(--_0x9523b2){_0x539e78['push'](_0x539e78['shift']());}};_0x79f6ff(++_0x47d3a4);}(_0xb591,0xef));var _0x1b59=function(_0x23183c,_0x46de69){_0x23183c=_0x23183c-0x0;var _0x231ba2=_0xb591[_0x23183c];return _0x231ba2;};'use strict';var _=require(_0x1b59('0x0'));var util=require(_0x1b59('0x1'));var logger=require(_0x1b59('0x2'))(_0x1b59('0x3'));var moment=require(_0x1b59('0x4'));var BPromise=require(_0x1b59('0x5'));var rp=require(_0x1b59('0x6'));var fs=require('fs');var path=require(_0x1b59('0x7'));var rimraf=require(_0x1b59('0x8'));var config=require(_0x1b59('0x9'));var attributes=require(_0x1b59('0xa'));module[_0x1b59('0xb')]=function(_0x3467bc,_0x2f25be){return _0x3467bc[_0x1b59('0xc')]('DeskField',attributes,{'tableName':_0x1b59('0xd'),'paranoid':![],'indexes':[{'name':_0x1b59('0xe'),'fields':[_0x1b59('0xf'),_0x1b59('0x10')],'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 09af354..27c88a4 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 _0xe1ac=['info','DeskField,\x20%s,\x20%s','DeskField,\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','http','request','then'];(function(_0x2efb82,_0x433a08){var _0x6e953e=function(_0x10f039){while(--_0x10f039){_0x2efb82['push'](_0x2efb82['shift']());}};_0x6e953e(++_0x433a08);}(_0xe1ac,0x1c2));var _0xce1a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe1ac[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xce1a('0x0'));var util=require(_0xce1a('0x1'));var moment=require(_0xce1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xce1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce1a('0x4'))['db'];var utils=require(_0xce1a('0x5'));var logger=require(_0xce1a('0x6'))(_0xce1a('0x7'));var config=require(_0xce1a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xce1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a8ed5,_0x40beca,_0x5a7141){return new BPromise(function(_0x861c45,_0xe60ad2){return client[_0xce1a('0xa')](_0x3a8ed5,_0x5a7141)[_0xce1a('0xb')](function(_0x48f41d){logger[_0xce1a('0xc')](_0xce1a('0xd'),_0x40beca,'request\x20sent');logger['debug'](_0xce1a('0xe'),_0x40beca,_0xce1a('0xf'),JSON[_0xce1a('0x10')](_0x48f41d));if(_0x48f41d[_0xce1a('0x11')]){if(_0x48f41d[_0xce1a('0x11')][_0xce1a('0x12')]===0x1f4){logger[_0xce1a('0x11')](_0xce1a('0xd'),_0x40beca,_0x48f41d['error'][_0xce1a('0x13')]);return _0xe60ad2(_0x48f41d[_0xce1a('0x11')][_0xce1a('0x13')]);}logger[_0xce1a('0x11')](_0xce1a('0xd'),_0x40beca,_0x48f41d['error'][_0xce1a('0x13')]);return _0x861c45(_0x48f41d[_0xce1a('0x11')][_0xce1a('0x13')]);}else{logger[_0xce1a('0xc')](_0xce1a('0xd'),_0x40beca,_0xce1a('0xf'));_0x861c45(_0x48f41d[_0xce1a('0x14')]['message']);}})[_0xce1a('0x15')](function(_0x142cd9){logger['error'](_0xce1a('0xd'),_0x40beca,_0x142cd9);_0xe60ad2(_0x142cd9);});});} \ No newline at end of file +var _0x7860=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2ffb97,_0x5446e6){var _0x333148=function(_0x47478f){while(--_0x47478f){_0x2ffb97['push'](_0x2ffb97['shift']());}};_0x333148(++_0x5446e6);}(_0x7860,0xe9));var _0x0786=function(_0x4b7256,_0x26852f){_0x4b7256=_0x4b7256-0x0;var _0x16c392=_0x7860[_0x4b7256];return _0x16c392;};'use strict';var _=require(_0x0786('0x0'));var util=require(_0x0786('0x1'));var moment=require(_0x0786('0x2'));var BPromise=require('bluebird');var rs=require(_0x0786('0x3'));var fs=require('fs');var Redis=require(_0x0786('0x4'));var db=require(_0x0786('0x5'))['db'];var utils=require(_0x0786('0x6'));var logger=require(_0x0786('0x7'))(_0x0786('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0786('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x385ffe,_0xc25e02,_0x226341){return new BPromise(function(_0x25c13a,_0x199d48){return client[_0x0786('0xa')](_0x385ffe,_0x226341)[_0x0786('0xb')](function(_0x2ff191){logger[_0x0786('0xc')](_0x0786('0xd'),_0xc25e02,_0x0786('0xe'));logger[_0x0786('0xf')](_0x0786('0x10'),_0xc25e02,'request\x20sent',JSON['stringify'](_0x2ff191));if(_0x2ff191[_0x0786('0x11')]){if(_0x2ff191['error'][_0x0786('0x12')]===0x1f4){logger[_0x0786('0x11')](_0x0786('0xd'),_0xc25e02,_0x2ff191[_0x0786('0x11')][_0x0786('0x13')]);return _0x199d48(_0x2ff191['error'][_0x0786('0x13')]);}logger[_0x0786('0x11')](_0x0786('0xd'),_0xc25e02,_0x2ff191['error'][_0x0786('0x13')]);return _0x25c13a(_0x2ff191[_0x0786('0x11')][_0x0786('0x13')]);}else{logger[_0x0786('0xc')](_0x0786('0xd'),_0xc25e02,'request\x20sent');_0x25c13a(_0x2ff191['result'][_0x0786('0x13')]);}})[_0x0786('0x14')](function(_0x230262){logger['error'](_0x0786('0xd'),_0xc25e02,_0x230262);_0x199d48(_0x230262);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 0352458..19be204 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 _0xe007=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','util','path','connect-timeout','express','fs-extra'];(function(_0x7457ce,_0x211dc0){var _0x3dd385=function(_0x160387){while(--_0x160387){_0x7457ce['push'](_0x7457ce['shift']());}};_0x3dd385(++_0x211dc0);}(_0xe007,0x199));var _0x7e00=function(_0x18436e,_0x126461){_0x18436e=_0x18436e-0x0;var _0x4cfba1=_0xe007[_0x18436e];return _0x4cfba1;};'use strict';var multer=require('multer');var util=require(_0x7e00('0x0'));var path=require(_0x7e00('0x1'));var timeout=require(_0x7e00('0x2'));var express=require(_0x7e00('0x3'));var router=express['Router']();var fs_extra=require(_0x7e00('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e00('0x5'));var config=require(_0x7e00('0x6'));var controller=require(_0x7e00('0x7'));router[_0x7e00('0x8')]('/',auth[_0x7e00('0x9')](),controller[_0x7e00('0xa')]);router[_0x7e00('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7e00('0xb')]);router[_0x7e00('0x8')](_0x7e00('0xc'),auth[_0x7e00('0x9')](),controller[_0x7e00('0xd')]);router[_0x7e00('0x8')](_0x7e00('0xe'),auth[_0x7e00('0x9')](),controller[_0x7e00('0xf')]);router[_0x7e00('0x10')]('/',auth[_0x7e00('0x9')](),controller[_0x7e00('0x11')]);router[_0x7e00('0x10')](_0x7e00('0xc'),auth['isAuthenticated'](),controller[_0x7e00('0x12')]);router[_0x7e00('0x13')](_0x7e00('0x14'),auth[_0x7e00('0x9')](),controller[_0x7e00('0x15')]);router[_0x7e00('0x16')]('/:id',auth[_0x7e00('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf5a8=['index','get','/:id/configurations','getConfigurations','create','post','addConfiguration','update','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated'];(function(_0x30045f,_0x20d426){var _0x2ff4b2=function(_0x62e8c5){while(--_0x62e8c5){_0x30045f['push'](_0x30045f['shift']());}};_0x2ff4b2(++_0x20d426);}(_0xf5a8,0xb2));var _0x8f5a=function(_0x253b13,_0x247a2f){_0x253b13=_0x253b13-0x0;var _0x396bcc=_0xf5a8[_0x253b13];return _0x396bcc;};'use strict';var multer=require(_0x8f5a('0x0'));var util=require(_0x8f5a('0x1'));var path=require(_0x8f5a('0x2'));var timeout=require(_0x8f5a('0x3'));var express=require(_0x8f5a('0x4'));var router=express['Router']();var fs_extra=require(_0x8f5a('0x5'));var auth=require(_0x8f5a('0x6'));var interaction=require(_0x8f5a('0x7'));var config=require(_0x8f5a('0x8'));var controller=require(_0x8f5a('0x9'));router['get']('/',auth[_0x8f5a('0xa')](),controller[_0x8f5a('0xb')]);router[_0x8f5a('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8f5a('0xc')](_0x8f5a('0xd'),auth[_0x8f5a('0xa')](),controller[_0x8f5a('0xe')]);router[_0x8f5a('0xc')]('/:id/fields',auth[_0x8f5a('0xa')](),controller['getFields']);router['post']('/',auth[_0x8f5a('0xa')](),controller[_0x8f5a('0xf')]);router[_0x8f5a('0x10')](_0x8f5a('0xd'),auth[_0x8f5a('0xa')](),controller[_0x8f5a('0x11')]);router['put']('/:id',auth[_0x8f5a('0xa')](),controller[_0x8f5a('0x12')]);router['delete'](_0x8f5a('0x13'),auth['isAuthenticated'](),controller[_0x8f5a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 00af071..eeb8e37 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 _0x2cd0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x496c30,_0x32d7e2){var _0x2abdfc=function(_0xd132e1){while(--_0xd132e1){_0x496c30['push'](_0x496c30['shift']());}};_0x2abdfc(++_0x32d7e2);}(_0x2cd0,0x8a));var _0x02cd=function(_0x3e0a0e,_0x1ecf6d){_0x3e0a0e=_0x3e0a0e-0x0;var _0x8e0d0a=_0x2cd0[_0x3e0a0e];return _0x8e0d0a;};'use strict';var Sequelize=require(_0x02cd('0x0'));module[_0x02cd('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x02cd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x02cd('0x2')]},'clientSecret':{'type':Sequelize[_0x02cd('0x2')]},'serverUrl':{'type':Sequelize[_0x02cd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x02cd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x02cd('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdbd0=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1a8bd1,_0xa5f879){var _0x5b757f=function(_0x1f3955){while(--_0x1f3955){_0x1a8bd1['push'](_0x1a8bd1['shift']());}};_0x5b757f(++_0xa5f879);}(_0xdbd0,0x88));var _0x0dbd=function(_0x58d16c,_0x5e08a9){_0x58d16c=_0x58d16c-0x0;var _0x549c8b=_0xdbd0[_0x58d16c];return _0x549c8b;};'use strict';var Sequelize=require(_0x0dbd('0x0'));module[_0x0dbd('0x1')]={'name':{'type':Sequelize[_0x0dbd('0x2')]},'username':{'type':Sequelize[_0x0dbd('0x2')]},'password':{'type':Sequelize[_0x0dbd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0dbd('0x2')]},'clientId':{'type':Sequelize[_0x0dbd('0x2')]},'clientSecret':{'type':Sequelize[_0x0dbd('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0dbd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0dbd('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c3ccb49..1c64256 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 _0x4a83=['actualserviceunits','contactidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responsiblecontactidyominame','sentimentvalue','slaname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','clientId','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','tenantId','username','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','isNil','BooleanAttributeMetadata','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','DisplayName','util','lodash','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','intersection','find','create','body','params','findOne','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname'];(function(_0x38d499,_0x1cbb6b){var _0x274b18=function(_0x488d64){while(--_0x488d64){_0x38d499['push'](_0x38d499['shift']());}};_0x274b18(++_0x1cbb6b);}(_0x4a83,0x125));var _0x34a8=function(_0x25834f,_0x2dac58){_0x25834f=_0x25834f-0x0;var _0x3af0dd=_0x4a83[_0x25834f];return _0x3af0dd;};'use strict';var rp=require('request-promise');var util=require(_0x34a8('0x0'));var _=require(_0x34a8('0x1'));var qs=require(_0x34a8('0x2'));var logger=require(_0x34a8('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x34a8('0x4'));function respondWithResult(_0xb811f8,_0xb6b7cc){_0xb6b7cc=_0xb6b7cc||0xc8;return function(_0x502858){if(_0x502858){return _0xb811f8[_0x34a8('0x5')](_0xb6b7cc)[_0x34a8('0x6')](_0x502858);}};}function respondWithFilteredResult(_0xa51ac4,_0x2405a6){return function(_0x54950c){if(_0x54950c){var _0x47b304=typeof _0x2405a6['offset']===_0x34a8('0x7')&&typeof _0x2405a6[_0x34a8('0x8')]===_0x34a8('0x7');var _0x124c2b=_0x54950c[_0x34a8('0x9')];var _0x3e446b=_0x47b304?0x0:_0x2405a6[_0x34a8('0xa')];var _0x5dc41b=_0x47b304?_0x54950c[_0x34a8('0x9')]:_0x2405a6[_0x34a8('0xa')]+_0x2405a6[_0x34a8('0x8')];var _0xf22231;if(_0x5dc41b>=_0x124c2b){_0x5dc41b=_0x124c2b;_0xf22231=0xc8;}else{_0xf22231=0xce;}_0xa51ac4['status'](_0xf22231);return _0xa51ac4[_0x34a8('0xb')](_0x34a8('0xc'),_0x3e446b+'-'+_0x5dc41b+'/'+_0x124c2b)['json'](_0x54950c);}return null;};}function saveUpdates(_0x315c8a){return function(_0x2ffaba){if(_0x2ffaba){return _0x2ffaba[_0x34a8('0xd')](_0x315c8a)['then'](function(_0x15bf27){return _0x15bf27;});}return null;};}function removeEntity(_0x128594){return function(_0x5b5e2e){if(_0x5b5e2e){return _0x5b5e2e[_0x34a8('0xe')]()[_0x34a8('0xf')](function(){_0x128594[_0x34a8('0x5')](0xcc)[_0x34a8('0x10')]();});}};}function handleEntityNotFound(_0x4c4bed){return function(_0x148ae5){if(!_0x148ae5){_0x4c4bed[_0x34a8('0x11')](0x194);}return _0x148ae5;};}function handleError(_0x1ac52c,_0x1830ca){_0x1830ca=_0x1830ca||0x1f4;return function(_0x4b0113){logger[_0x34a8('0x12')](_0x4b0113[_0x34a8('0x13')]);if(_0x4b0113[_0x34a8('0x14')]){delete _0x4b0113['name'];}_0x1ac52c['status'](_0x1830ca)[_0x34a8('0x15')](_0x4b0113);};}exports['index']=function(_0x3e32c5,_0x1cf245){var _0x6cd129={},_0x4849cd={},_0x520713={'count':0x0,'rows':[]};var _0x3d8d20=_[_0x34a8('0x16')](db[_0x34a8('0x17')][_0x34a8('0x18')],function(_0x53915b){return{'name':_0x53915b[_0x34a8('0x19')],'type':_0x53915b[_0x34a8('0x1a')][_0x34a8('0x1b')]};});_0x4849cd[_0x34a8('0x1c')]=_[_0x34a8('0x16')](_0x3d8d20,_0x34a8('0x14'));_0x4849cd[_0x34a8('0x1d')]=_[_0x34a8('0x1e')](_0x3e32c5[_0x34a8('0x1d')]);_0x4849cd[_0x34a8('0x1f')]=_['intersection'](_0x4849cd[_0x34a8('0x1c')],_0x4849cd['query']);_0x6cd129[_0x34a8('0x20')]=_['intersection'](_0x4849cd[_0x34a8('0x1c')],qs[_0x34a8('0x21')](_0x3e32c5[_0x34a8('0x1d')][_0x34a8('0x21')]));_0x6cd129['attributes']=_0x6cd129['attributes'][_0x34a8('0x22')]?_0x6cd129['attributes']:_0x4849cd[_0x34a8('0x1c')];if(!_0x3e32c5[_0x34a8('0x1d')][_0x34a8('0x23')](_0x34a8('0x24'))){_0x6cd129[_0x34a8('0x8')]=qs[_0x34a8('0x8')](_0x3e32c5[_0x34a8('0x1d')]['limit']);_0x6cd129[_0x34a8('0xa')]=qs[_0x34a8('0xa')](_0x3e32c5['query'][_0x34a8('0xa')]);}_0x6cd129[_0x34a8('0x25')]=qs[_0x34a8('0x26')](_0x3e32c5[_0x34a8('0x1d')][_0x34a8('0x26')]);_0x6cd129[_0x34a8('0x27')]=qs[_0x34a8('0x1f')](_[_0x34a8('0x28')](_0x3e32c5['query'],_0x4849cd['filters']),_0x3d8d20);if(_0x3e32c5[_0x34a8('0x1d')][_0x34a8('0x29')]){_0x6cd129['where']=_['merge'](_0x6cd129[_0x34a8('0x27')],{'$or':_[_0x34a8('0x16')](_0x3d8d20,function(_0x18a20a){if(_0x18a20a[_0x34a8('0x1a')]!==_0x34a8('0x2a')){var _0x53dba2={};_0x53dba2[_0x18a20a[_0x34a8('0x14')]]={'$like':'%'+_0x3e32c5['query'][_0x34a8('0x29')]+'%'};return _0x53dba2;}})});}_0x6cd129=_[_0x34a8('0x2b')]({},_0x6cd129,_0x3e32c5['options']);var _0xa9aa50={'where':_0x6cd129[_0x34a8('0x27')]};return db['Dynamics365Account'][_0x34a8('0x9')](_0xa9aa50)[_0x34a8('0xf')](function(_0x30e281){_0x520713[_0x34a8('0x9')]=_0x30e281;if(_0x3e32c5[_0x34a8('0x1d')][_0x34a8('0x2c')]){_0x6cd129[_0x34a8('0x2d')]=[{'all':!![]}];}return db[_0x34a8('0x17')]['findAll'](_0x6cd129);})[_0x34a8('0xf')](function(_0xaeb827){_0x520713[_0x34a8('0x2e')]=_0xaeb827;return _0x520713;})['then'](respondWithFilteredResult(_0x1cf245,_0x6cd129))[_0x34a8('0x2f')](handleError(_0x1cf245,null));};exports[_0x34a8('0x30')]=function(_0x9baa96,_0x47de83){var _0x497e7b={'raw':![],'where':{'id':_0x9baa96['params']['id']}},_0xd028a6={};_0xd028a6[_0x34a8('0x1c')]=_[_0x34a8('0x1e')](db['Dynamics365Account'][_0x34a8('0x18')]);_0xd028a6[_0x34a8('0x1d')]=_[_0x34a8('0x1e')](_0x9baa96['query']);_0xd028a6[_0x34a8('0x1f')]=_[_0x34a8('0x31')](_0xd028a6[_0x34a8('0x1c')],_0xd028a6['query']);_0x497e7b[_0x34a8('0x20')]=_[_0x34a8('0x31')](_0xd028a6[_0x34a8('0x1c')],qs[_0x34a8('0x21')](_0x9baa96[_0x34a8('0x1d')][_0x34a8('0x21')]));_0x497e7b['attributes']=_0x497e7b['attributes']['length']?_0x497e7b[_0x34a8('0x20')]:_0xd028a6[_0x34a8('0x1c')];if(_0x9baa96[_0x34a8('0x1d')]['includeAll']){_0x497e7b[_0x34a8('0x2d')]=[{'all':!![]}];}_0x497e7b=_[_0x34a8('0x2b')]({},_0x497e7b,_0x9baa96['options']);return db[_0x34a8('0x17')][_0x34a8('0x32')](_0x497e7b)[_0x34a8('0xf')](handleEntityNotFound(_0x47de83,null))[_0x34a8('0xf')](respondWithResult(_0x47de83,null))[_0x34a8('0x2f')](handleError(_0x47de83,null));};exports[_0x34a8('0x33')]=function(_0x40333b,_0x5b132b){return db[_0x34a8('0x17')]['create'](_0x40333b[_0x34a8('0x34')],{})['then'](respondWithResult(_0x5b132b,0xc9))[_0x34a8('0x2f')](handleError(_0x5b132b,null));};exports[_0x34a8('0xd')]=function(_0x25a89b,_0x27208e){if(_0x25a89b[_0x34a8('0x34')]['id']){delete _0x25a89b['body']['id'];}return db[_0x34a8('0x17')][_0x34a8('0x32')]({'where':{'id':_0x25a89b[_0x34a8('0x35')]['id']}})[_0x34a8('0xf')](handleEntityNotFound(_0x27208e,null))[_0x34a8('0xf')](saveUpdates(_0x25a89b['body'],null))[_0x34a8('0xf')](respondWithResult(_0x27208e,null))['catch'](handleError(_0x27208e,null));};exports[_0x34a8('0xe')]=function(_0x20f5f7,_0x122f50){return db[_0x34a8('0x17')][_0x34a8('0x32')]({'where':{'id':_0x20f5f7[_0x34a8('0x35')]['id']}})[_0x34a8('0xf')](handleEntityNotFound(_0x122f50,null))[_0x34a8('0xf')](removeEntity(_0x122f50,null))[_0x34a8('0x2f')](handleError(_0x122f50,null));};exports['getConfigurations']=function(_0x4e3228,_0x308cdc){var _0xbcef93={};var _0x8fef24={};var _0x290ae6;var _0x260105;return db[_0x34a8('0x17')][_0x34a8('0x36')]({'where':{'id':_0x4e3228['params']['id']}})['then'](handleEntityNotFound(_0x308cdc,null))[_0x34a8('0xf')](function(_0x58ade2){if(_0x58ade2){_0x290ae6=_0x58ade2;_0x8fef24[_0x34a8('0x1c')]=_['keys'](db['Dynamics365Configuration'][_0x34a8('0x18')]);_0x8fef24['query']=_[_0x34a8('0x1e')](_0x4e3228[_0x34a8('0x1d')]);_0x8fef24[_0x34a8('0x1f')]=_[_0x34a8('0x31')](_0x8fef24[_0x34a8('0x1c')],_0x8fef24[_0x34a8('0x1d')]);_0xbcef93[_0x34a8('0x20')]=_[_0x34a8('0x31')](_0x8fef24[_0x34a8('0x1c')],qs[_0x34a8('0x21')](_0x4e3228['query'][_0x34a8('0x21')]));_0xbcef93['attributes']=_0xbcef93[_0x34a8('0x20')]['length']?_0xbcef93[_0x34a8('0x20')]:_0x8fef24[_0x34a8('0x1c')];_0xbcef93[_0x34a8('0x25')]=qs[_0x34a8('0x26')](_0x4e3228[_0x34a8('0x1d')][_0x34a8('0x26')]);_0xbcef93[_0x34a8('0x27')]=qs[_0x34a8('0x1f')](_[_0x34a8('0x28')](_0x4e3228[_0x34a8('0x1d')],_0x8fef24[_0x34a8('0x1f')]));if(_0x4e3228[_0x34a8('0x1d')]['filter']){_0xbcef93['where']=_[_0x34a8('0x2b')](_0xbcef93[_0x34a8('0x27')],{'$or':_[_0x34a8('0x16')](_0xbcef93['attributes'],function(_0x19bed6){var _0x384525={};_0x384525[_0x19bed6]={'$like':'%'+_0x4e3228[_0x34a8('0x1d')][_0x34a8('0x29')]+'%'};return _0x384525;})});}_0xbcef93=_['merge']({},_0xbcef93,_0x4e3228[_0x34a8('0x37')]);return _0x290ae6[_0x34a8('0x38')](_0xbcef93);}})[_0x34a8('0xf')](function(_0x15e9e5){if(_0x15e9e5){_0x260105=_0x15e9e5[_0x34a8('0x22')];if(!_0x4e3228['query']['hasOwnProperty'](_0x34a8('0x24'))){_0xbcef93[_0x34a8('0x8')]=qs[_0x34a8('0x8')](_0x4e3228[_0x34a8('0x1d')][_0x34a8('0x8')]);_0xbcef93['offset']=qs[_0x34a8('0xa')](_0x4e3228[_0x34a8('0x1d')][_0x34a8('0xa')]);}return _0x290ae6[_0x34a8('0x38')](_0xbcef93);}})[_0x34a8('0xf')](function(_0x5a0fba){if(_0x5a0fba){return _0x5a0fba?{'count':_0x260105,'rows':_0x5a0fba}:null;}})[_0x34a8('0xf')](respondWithResult(_0x308cdc,null))['catch'](handleError(_0x308cdc,null));};exports[_0x34a8('0x39')]=function(_0x44b1f1,_0xe5dadd){if(_0x44b1f1[_0x34a8('0x34')]['id']){delete _0x44b1f1[_0x34a8('0x34')]['id'];}return db[_0x34a8('0x17')]['findOne']({'where':{'id':_0x44b1f1['params']['id']}})['then'](handleEntityNotFound(_0xe5dadd,null))[_0x34a8('0xf')](function(_0xe42465){if(_0xe42465){_0x44b1f1[_0x34a8('0x34')][_0x34a8('0x3a')]=_0xe42465['id'];_0x44b1f1['body'][_0x34a8('0x3b')]=integrations[_0x34a8('0x3c')](_0x44b1f1[_0x34a8('0x34')][_0x34a8('0x3d')],_0x44b1f1['body']['type']);_0x44b1f1[_0x34a8('0x34')][_0x34a8('0x3e')]=integrations[_0x34a8('0x3f')](_0x44b1f1[_0x34a8('0x34')]['channel'],_0x44b1f1[_0x34a8('0x34')][_0x34a8('0x1a')]);return db['Dynamics365Configuration']['create'](_0x44b1f1['body'],{'include':[{'model':db[_0x34a8('0x40')],'as':_0x34a8('0x3b')},{'model':db[_0x34a8('0x40')],'as':_0x34a8('0x3e')}]});}return null;})['then'](respondWithResult(_0xe5dadd,null))[_0x34a8('0x2f')](handleError(_0xe5dadd,null));};function sanitizeRemoteUri(_0x4e3c33){var _0x174dad=_0x4e3c33[_0x34a8('0x41')](-0x1);if(_0x174dad==='/')return _0x4e3c33[_0x34a8('0x42')](0x0,_0x4e3c33[_0x34a8('0x43')](_0x174dad));return _0x4e3c33;}function getWebApiUrl(_0x46ebe0){return util['format'](_0x34a8('0x44'),_0x46ebe0);}exports[_0x34a8('0x45')]=function(_0x5a6655,_0x51dc5c){var _0x561365=_0x5a6655[_0x34a8('0x1d')][_0x34a8('0x46')];var _0x383c83=_0x561365===_0x34a8('0x47')?_0x34a8('0x48'):_0x34a8('0x49');var _0x21ca6d='';var _0x1f8c9e='';var _0x27b5b8='';var _0x585eb2='';var _0x30c295='';var _0x2dc7ff='';var _0x1da3f1='';var _0xbda619='';var _0x11009c=[_0x34a8('0x4a'),_0x34a8('0x4b'),'customerid','ownerid',_0x34a8('0x4c'),_0x34a8('0x4d'),_0x34a8('0x4e'),_0x34a8('0x4f'),_0x34a8('0x50'),_0x34a8('0x51')];var _0x3f9f3c=[_0x34a8('0x52'),'accountidyominame',_0x34a8('0x53'),'billedserviceunits',_0x34a8('0x54'),'contactidyominame','contractdetailidname','contractidname',_0x34a8('0x55'),_0x34a8('0x56'),_0x34a8('0x57'),_0x34a8('0x58'),_0x34a8('0x59'),_0x34a8('0x5a'),_0x34a8('0x5b'),_0x34a8('0x5c'),'customeridtype','customeridyominame',_0x34a8('0x5d'),'entitlementidname',_0x34a8('0x5e'),_0x34a8('0x5f'),_0x34a8('0x60'),_0x34a8('0x61'),_0x34a8('0x62'),'followupby',_0x34a8('0x63'),_0x34a8('0x64'),_0x34a8('0x65'),_0x34a8('0x66'),_0x34a8('0x67'),_0x34a8('0x68'),_0x34a8('0x69'),_0x34a8('0x6a'),'modifiedbyyominame','modifiedon',_0x34a8('0x6b'),_0x34a8('0x6c'),_0x34a8('0x6d'),_0x34a8('0x6e'),_0x34a8('0x6f'),_0x34a8('0x70'),_0x34a8('0x71'),_0x34a8('0x72'),'owneridtype',_0x34a8('0x73'),_0x34a8('0x74'),_0x34a8('0x75'),_0x34a8('0x76'),'prioritycodename',_0x34a8('0x77'),_0x34a8('0x78'),_0x34a8('0x79'),'resolvebykpiidname','responseby','responsiblecontactidname',_0x34a8('0x7a'),_0x34a8('0x7b'),'slainvokedidname',_0x34a8('0x7c'),'socialprofileidname',_0x34a8('0x7d'),'statuscode','subjectidname',_0x34a8('0x7e'),_0x34a8('0x7f'),_0x34a8('0x80'),'traversedpath',_0x34a8('0x81'),_0x34a8('0x82')];var _0x5be400=_0x11009c[_0x34a8('0x83')](_0x3f9f3c);return db[_0x34a8('0x17')][_0x34a8('0x36')]({'where':{'id':_0x5a6655['params']['id']},'attributes':['id','username',_0x34a8('0x84'),_0x34a8('0x85'),'tenantId',_0x34a8('0x86'),'clientSecret',_0x34a8('0x87')],'include':[{'model':db[_0x34a8('0x88')],'as':_0x34a8('0x88'),'attributes':['id','data5',_0x34a8('0x89')]}]})[_0x34a8('0xf')](handleEntityNotFound(_0x51dc5c,null))['then'](function(_0x1ab01b){if(_0x1ab01b){if(_0x1ab01b[_0x34a8('0x87')]){_0x1ab01b[_0x34a8('0x8a')]=_0x1ab01b[_0x34a8('0x88')][_0x34a8('0x8b')];_0xbda619=sanitizeRemoteUri(_0x1ab01b[_0x34a8('0x88')][_0x34a8('0x89')]);_0x1da3f1=getWebApiUrl(_0xbda619);return _0x1ab01b;}_0xbda619=sanitizeRemoteUri(_0x1ab01b[_0x34a8('0x85')]);_0x1da3f1=getWebApiUrl(_0xbda619);var _0x327402={'method':_0x34a8('0x8c'),'uri':_0x34a8('0x8d')+_0x1ab01b[_0x34a8('0x8e')]+'/oauth2/token','form':{'client_id':_0x1ab01b[_0x34a8('0x86')],'resource':_0xbda619,'username':_0x1ab01b[_0x34a8('0x8f')],'password':_0x1ab01b[_0x34a8('0x84')],'grant_type':_0x34a8('0x84'),'client_secret':_0x1ab01b[_0x34a8('0x90')]},'json':!![]};return rp(_0x327402);}})[_0x34a8('0xf')](function(_0x3b10e3){_0x2dc7ff=_0x3b10e3[_0x34a8('0x8a')];var _0x4b0deb={'method':_0x34a8('0x91'),'uri':encodeURI(_0x1da3f1+_0x34a8('0x92')+_0x383c83+'\x27'),'headers':{'Authorization':_0x34a8('0x93')+_0x2dc7ff,'If-None-Match':null,'OData-Version':_0x34a8('0x94')},'json':!![]};return rp(_0x4b0deb);})[_0x34a8('0xf')](function(_0x8d7a9a){var _0x143f63=_0x8d7a9a[_0x34a8('0x95')][0x0];var _0x5bde82=_0x143f63[_0x34a8('0x96')];var _0x28f478={'method':_0x34a8('0x91'),'uri':_0x1da3f1+'EntityDefinitions('+_0x5bde82+_0x34a8('0x97'),'headers':{'Authorization':'Bearer\x20'+_0x2dc7ff,'If-None-Match':null,'OData-Version':_0x34a8('0x94')},'json':!![]};return rp(_0x28f478);})[_0x34a8('0xf')](function(_0x1f79d9){_0x21ca6d=_0x1f79d9;_0x1f8c9e=_0x21ca6d[_0x34a8('0x98')];_0x1f8c9e=_[_0x34a8('0x99')](_0x1f8c9e,function(_0xc4d8ed){return!_0x5be400[_0x34a8('0x9a')](_0xc4d8ed[_0x34a8('0x9b')]);});var _0x79ca37=[];var _0x4d8512=[];_0x1f8c9e[_0x34a8('0x9c')](function(_0x3afd9a){if(_0x3afd9a[_0x34a8('0x9d')]){var _0x1b7383=_0x3afd9a[_0x34a8('0x9d')][_0x34a8('0x42')](_0x3afd9a[_0x34a8('0x9d')][_0x34a8('0x43')]('.')+0x1);if(_0x1b7383===_0x34a8('0x9e')){_0x79ca37['push'](getSelectList(_0x1da3f1,_0x561365,_0x4d8512,_0x21ca6d[_0x34a8('0x96')],_0x3afd9a[_0x34a8('0x96')],_0x2dc7ff));}}});return Promise['all'](_0x79ca37);})['then'](function(_0x493309){_0x27b5b8=_0x493309[0x0];var _0x3a71d4=[];var _0x3f3e4d=[];_0x1f8c9e[_0x34a8('0x9c')](function(_0x26cdb5){if(!_[_0x34a8('0x9f')](_0x26cdb5[_0x34a8('0x9d')])){var _0x42b194=_0x26cdb5['@odata.type'][_0x34a8('0x42')](_0x26cdb5[_0x34a8('0x9d')][_0x34a8('0x43')]('.')+0x1);if(_0x42b194===_0x34a8('0xa0')){_0x3a71d4[_0x34a8('0xa1')](getBooleanList(_0x1da3f1,_0x561365,_0x3f3e4d,_0x21ca6d['MetadataId'],_0x26cdb5[_0x34a8('0x96')],_0x2dc7ff));}}});return Promise[_0x34a8('0xa2')](_0x3a71d4);})[_0x34a8('0xf')](function(_0x2ebb94){_0x585eb2=_0x2ebb94[0x0];var _0x3bb814=[];var _0x19fc6d=[];_0x1f8c9e[_0x34a8('0x9c')](function(_0x24e3dd){if(_0x24e3dd[_0x34a8('0x9d')]){var _0x4ceac9=_0x24e3dd[_0x34a8('0x9d')]['substring'](_0x24e3dd[_0x34a8('0x9d')]['lastIndexOf']('.')+0x1);if(_0x4ceac9==='StringAttributeMetadata'||_0x4ceac9===_0x34a8('0xa3')||_0x4ceac9===_0x34a8('0xa4')||_0x4ceac9===_0x34a8('0xa5')||_0x4ceac9===_0x34a8('0xa6')||_0x4ceac9===_0x34a8('0xa7')||_0x4ceac9==='StatusAttributeMetadata'||_0x4ceac9===_0x34a8('0xa8')||_0x4ceac9===_0x34a8('0xa9')||_0x4ceac9===_0x34a8('0xaa')){_0x3bb814[_0x34a8('0xa1')](getInputList(_0x1da3f1,_0x561365,_0x4ceac9,_0x19fc6d,_0x21ca6d['MetadataId'],_0x24e3dd['MetadataId'],_0x2dc7ff));}}});return Promise['all'](_0x3bb814);})[_0x34a8('0xf')](function(_0x42499f){_0x30c295=_0x42499f[0x0];var _0x55ef62=_0x27b5b8[_0x34a8('0x83')](_0x585eb2)[_0x34a8('0x83')](_0x30c295);var _0x4f9310={'count':_0x55ef62['length'],'rows':_0x55ef62};return _0x4f9310;})[_0x34a8('0xf')](respondWithResult(_0x51dc5c,null))['catch'](function(_0x53d562){var _0x5c954e=_0x5a6655[_0x34a8('0x1d')][_0x34a8('0xab')]?0x1f4:_0x53d562[_0x34a8('0xac')]||0x1f4;logger[_0x34a8('0x12')](_0x53d562[_0x34a8('0x13')]);delete _0x53d562[_0x34a8('0x14')];if(_0x5c954e===0x191){_0x5c954e=0x190;}_0x51dc5c['status'](_0x5c954e)[_0x34a8('0x15')](_0x5a6655['query'][_0x34a8('0xab')]?{'message':_0x34a8('0xad'),'statusCode':_0x53d562[_0x34a8('0xac')]}:_0x53d562);});};function getSelectList(_0x2a4621,_0x1f0189,_0x1ca96a,_0xd32af0,_0x3d8db2,_0x1a2e1b){var _0xa74f2={'method':_0x34a8('0x91'),'uri':_0x2a4621+_0x34a8('0xae')+_0xd32af0+_0x34a8('0xaf')+_0x3d8db2+_0x34a8('0xb0')+_0x34a8('0xb1'),'headers':{'Authorization':_0x34a8('0x93')+_0x1a2e1b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa74f2)[_0x34a8('0xf')](function(_0x5e9132){var _0x5c5a8c=[];var _0x3166d1=_0x5e9132['OptionSet'][_0x34a8('0xb2')];_0x3166d1[_0x34a8('0x9c')](function(_0x12808c){_0x5c5a8c[_0x34a8('0xa1')]({'name':_0x12808c[_0x34a8('0xb3')][_0x34a8('0xb4')]['Label'],'value':String(_0x12808c['Value'])});});var _0x3a2102={'id':_0x1f0189+'_'+_0x5e9132[_0x34a8('0x9b')],'name':_0x5e9132['DisplayName'][_0x34a8('0xb4')][_0x34a8('0xb3')],'custom':![],'options':_0x5c5a8c};_0x1ca96a[_0x34a8('0xa1')](_0x3a2102);return _0x1ca96a;});}function getBooleanList(_0x1057bf,_0x32e8ef,_0x5a3d15,_0x2924d3,_0x3f0084,_0x2d2ee8){var _0x5288c0={'method':_0x34a8('0x91'),'uri':_0x1057bf+'EntityDefinitions('+_0x2924d3+_0x34a8('0xaf')+_0x3f0084+_0x34a8('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x2d2ee8,'If-None-Match':null,'OData-Version':_0x34a8('0x94')},'json':!![]};return rp(_0x5288c0)[_0x34a8('0xf')](function(_0x4db6ff){var _0x856b5d=[];_0x856b5d[_0x34a8('0xa1')]({'name':_0x4db6ff[_0x34a8('0xb6')][_0x34a8('0xb7')]['Label'][_0x34a8('0xb4')]['Label'],'value':_0x34a8('0xb8')},{'name':_0x4db6ff[_0x34a8('0xb6')][_0x34a8('0xb9')]['Label'][_0x34a8('0xb4')]['Label'],'value':_0x34a8('0xba')});var _0xf7e71e={'id':_0x32e8ef+'_'+_0x4db6ff[_0x34a8('0x9b')],'name':_0x4db6ff['DisplayName']['UserLocalizedLabel'][_0x34a8('0xb3')],'custom':![],'options':_0x856b5d};_0x5a3d15[_0x34a8('0xa1')](_0xf7e71e);return _0x5a3d15;});}function getInputList(_0x234f49,_0x4df97c,_0x5a8e39,_0x215cd3,_0x325c54,_0x2d0682,_0x32117f){var _0x62c467={'method':'GET','uri':_0x234f49+'EntityDefinitions('+_0x325c54+_0x34a8('0xaf')+_0x2d0682+')/Microsoft.Dynamics.CRM.'+_0x5a8e39+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x34a8('0x93')+_0x32117f,'If-None-Match':null,'OData-Version':_0x34a8('0x94')},'json':!![]};return rp(_0x62c467)[_0x34a8('0xf')](function(_0x5e6120){var _0x2970ab={'id':_0x4df97c+'_'+_0x5e6120['LogicalName'],'name':_0x5e6120['DisplayName'][_0x34a8('0xb4')]?_0x5e6120[_0x34a8('0xbb')][_0x34a8('0xb4')]['Label']:_0x5e6120[_0x34a8('0x9b')],'custom':![],'options':[]};_0x215cd3[_0x34a8('0xa1')](_0x2970ab);return _0x215cd3;});} \ No newline at end of file +var _0x828b=['remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','push','IntegerAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','update','then','end','name','send','index','Dynamics365Account','rawAttributes','fieldName','key','map','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','query','order','sort','where','filter','merge','type','VIRTUAL','options','rows','show','params','includeAll','include','find','create','body','destroy','catch','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','title','customerid','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','clientId','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x828b,0x182));var _0xb828=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x828b[_0x4fbb86];return _0xb141fe;};'use strict';var rp=require(_0xb828('0x0'));var util=require('util');var _=require('lodash');var qs=require(_0xb828('0x1'));var logger=require(_0xb828('0x2'))(_0xb828('0x3'));var db=require(_0xb828('0x4'))['db'];var integrations=require(_0xb828('0x5'));function respondWithResult(_0x2db7a2,_0x42e085){_0x42e085=_0x42e085||0xc8;return function(_0x1db075){if(_0x1db075){return _0x2db7a2['status'](_0x42e085)[_0xb828('0x6')](_0x1db075);}};}function respondWithFilteredResult(_0x15cd75,_0x482e34){return function(_0x216d9b){if(_0x216d9b){var _0x508743=typeof _0x482e34[_0xb828('0x7')]===_0xb828('0x8')&&typeof _0x482e34[_0xb828('0x9')]==='undefined';var _0x12f481=_0x216d9b[_0xb828('0xa')];var _0x2f0df3=_0x508743?0x0:_0x482e34['offset'];var _0x33ff96=_0x508743?_0x216d9b[_0xb828('0xa')]:_0x482e34[_0xb828('0x7')]+_0x482e34[_0xb828('0x9')];var _0x50135e;if(_0x33ff96>=_0x12f481){_0x33ff96=_0x12f481;_0x50135e=0xc8;}else{_0x50135e=0xce;}_0x15cd75[_0xb828('0xb')](_0x50135e);return _0x15cd75['set']('Content-Range',_0x2f0df3+'-'+_0x33ff96+'/'+_0x12f481)[_0xb828('0x6')](_0x216d9b);}return null;};}function saveUpdates(_0x5892e7){return function(_0x2ba758){if(_0x2ba758){return _0x2ba758[_0xb828('0xc')](_0x5892e7)['then'](function(_0x46e217){return _0x46e217;});}return null;};}function removeEntity(_0x4ddddb){return function(_0x1db00b){if(_0x1db00b){return _0x1db00b['destroy']()[_0xb828('0xd')](function(){_0x4ddddb[_0xb828('0xb')](0xcc)[_0xb828('0xe')]();});}};}function handleEntityNotFound(_0x1d8233){return function(_0x43fd39){if(!_0x43fd39){_0x1d8233['sendStatus'](0x194);}return _0x43fd39;};}function handleError(_0x1c1ecc,_0x24137f){_0x24137f=_0x24137f||0x1f4;return function(_0x3eeed0){logger['error'](_0x3eeed0['stack']);if(_0x3eeed0[_0xb828('0xf')]){delete _0x3eeed0[_0xb828('0xf')];}_0x1c1ecc['status'](_0x24137f)[_0xb828('0x10')](_0x3eeed0);};}exports[_0xb828('0x11')]=function(_0x52909f,_0x103f3a){var _0x19019e={},_0x45bb24={},_0x4275cd={'count':0x0,'rows':[]};var _0x805ed8=_['map'](db[_0xb828('0x12')][_0xb828('0x13')],function(_0x55bf80){return{'name':_0x55bf80[_0xb828('0x14')],'type':_0x55bf80['type'][_0xb828('0x15')]};});_0x45bb24['model']=_[_0xb828('0x16')](_0x805ed8,'name');_0x45bb24['query']=_[_0xb828('0x17')](_0x52909f['query']);_0x45bb24[_0xb828('0x18')]=_[_0xb828('0x19')](_0x45bb24['model'],_0x45bb24['query']);_0x19019e[_0xb828('0x1a')]=_['intersection'](_0x45bb24[_0xb828('0x1b')],qs[_0xb828('0x1c')](_0x52909f['query'][_0xb828('0x1c')]));_0x19019e[_0xb828('0x1a')]=_0x19019e['attributes'][_0xb828('0x1d')]?_0x19019e[_0xb828('0x1a')]:_0x45bb24[_0xb828('0x1b')];if(!_0x52909f['query'][_0xb828('0x1e')](_0xb828('0x1f'))){_0x19019e['limit']=qs['limit'](_0x52909f[_0xb828('0x20')]['limit']);_0x19019e[_0xb828('0x7')]=qs['offset'](_0x52909f[_0xb828('0x20')][_0xb828('0x7')]);}_0x19019e[_0xb828('0x21')]=qs['sort'](_0x52909f[_0xb828('0x20')][_0xb828('0x22')]);_0x19019e[_0xb828('0x23')]=qs[_0xb828('0x18')](_['pick'](_0x52909f['query'],_0x45bb24[_0xb828('0x18')]),_0x805ed8);if(_0x52909f[_0xb828('0x20')][_0xb828('0x24')]){_0x19019e['where']=_[_0xb828('0x25')](_0x19019e[_0xb828('0x23')],{'$or':_[_0xb828('0x16')](_0x805ed8,function(_0x9957f0){if(_0x9957f0[_0xb828('0x26')]!==_0xb828('0x27')){var _0x4d2399={};_0x4d2399[_0x9957f0[_0xb828('0xf')]]={'$like':'%'+_0x52909f[_0xb828('0x20')][_0xb828('0x24')]+'%'};return _0x4d2399;}})});}_0x19019e=_[_0xb828('0x25')]({},_0x19019e,_0x52909f[_0xb828('0x28')]);var _0x316b4b={'where':_0x19019e[_0xb828('0x23')]};return db[_0xb828('0x12')][_0xb828('0xa')](_0x316b4b)[_0xb828('0xd')](function(_0x3333cf){_0x4275cd['count']=_0x3333cf;if(_0x52909f[_0xb828('0x20')]['includeAll']){_0x19019e['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x19019e);})[_0xb828('0xd')](function(_0x3605d6){_0x4275cd[_0xb828('0x29')]=_0x3605d6;return _0x4275cd;})['then'](respondWithFilteredResult(_0x103f3a,_0x19019e))['catch'](handleError(_0x103f3a,null));};exports[_0xb828('0x2a')]=function(_0x1c21c8,_0x1b2e49){var _0x1b2777={'raw':![],'where':{'id':_0x1c21c8[_0xb828('0x2b')]['id']}},_0x4f626f={};_0x4f626f[_0xb828('0x1b')]=_['keys'](db['Dynamics365Account'][_0xb828('0x13')]);_0x4f626f[_0xb828('0x20')]=_['keys'](_0x1c21c8[_0xb828('0x20')]);_0x4f626f['filters']=_[_0xb828('0x19')](_0x4f626f['model'],_0x4f626f[_0xb828('0x20')]);_0x1b2777[_0xb828('0x1a')]=_[_0xb828('0x19')](_0x4f626f[_0xb828('0x1b')],qs[_0xb828('0x1c')](_0x1c21c8[_0xb828('0x20')][_0xb828('0x1c')]));_0x1b2777['attributes']=_0x1b2777[_0xb828('0x1a')][_0xb828('0x1d')]?_0x1b2777[_0xb828('0x1a')]:_0x4f626f[_0xb828('0x1b')];if(_0x1c21c8[_0xb828('0x20')][_0xb828('0x2c')]){_0x1b2777[_0xb828('0x2d')]=[{'all':!![]}];}_0x1b2777=_[_0xb828('0x25')]({},_0x1b2777,_0x1c21c8['options']);return db[_0xb828('0x12')][_0xb828('0x2e')](_0x1b2777)[_0xb828('0xd')](handleEntityNotFound(_0x1b2e49,null))[_0xb828('0xd')](respondWithResult(_0x1b2e49,null))['catch'](handleError(_0x1b2e49,null));};exports['create']=function(_0x19ef64,_0x25fc89){return db[_0xb828('0x12')][_0xb828('0x2f')](_0x19ef64[_0xb828('0x30')],{})[_0xb828('0xd')](respondWithResult(_0x25fc89,0xc9))['catch'](handleError(_0x25fc89,null));};exports['update']=function(_0x26f135,_0x1dda63){if(_0x26f135[_0xb828('0x30')]['id']){delete _0x26f135['body']['id'];}return db[_0xb828('0x12')][_0xb828('0x2e')]({'where':{'id':_0x26f135['params']['id']}})[_0xb828('0xd')](handleEntityNotFound(_0x1dda63,null))[_0xb828('0xd')](saveUpdates(_0x26f135[_0xb828('0x30')],null))[_0xb828('0xd')](respondWithResult(_0x1dda63,null))['catch'](handleError(_0x1dda63,null));};exports[_0xb828('0x31')]=function(_0x48766e,_0x247be5){return db[_0xb828('0x12')][_0xb828('0x2e')]({'where':{'id':_0x48766e[_0xb828('0x2b')]['id']}})[_0xb828('0xd')](handleEntityNotFound(_0x247be5,null))['then'](removeEntity(_0x247be5,null))[_0xb828('0x32')](handleError(_0x247be5,null));};exports[_0xb828('0x33')]=function(_0x1bdcf5,_0xc690fb){var _0x3e8e2c={};var _0x5b08e1={};var _0x15c9fc;var _0x3c5577;return db[_0xb828('0x12')][_0xb828('0x34')]({'where':{'id':_0x1bdcf5['params']['id']}})[_0xb828('0xd')](handleEntityNotFound(_0xc690fb,null))[_0xb828('0xd')](function(_0x5a82d9){if(_0x5a82d9){_0x15c9fc=_0x5a82d9;_0x5b08e1[_0xb828('0x1b')]=_[_0xb828('0x17')](db['Dynamics365Configuration'][_0xb828('0x13')]);_0x5b08e1[_0xb828('0x20')]=_[_0xb828('0x17')](_0x1bdcf5['query']);_0x5b08e1['filters']=_[_0xb828('0x19')](_0x5b08e1[_0xb828('0x1b')],_0x5b08e1['query']);_0x3e8e2c[_0xb828('0x1a')]=_[_0xb828('0x19')](_0x5b08e1[_0xb828('0x1b')],qs[_0xb828('0x1c')](_0x1bdcf5['query'][_0xb828('0x1c')]));_0x3e8e2c['attributes']=_0x3e8e2c[_0xb828('0x1a')][_0xb828('0x1d')]?_0x3e8e2c[_0xb828('0x1a')]:_0x5b08e1[_0xb828('0x1b')];_0x3e8e2c[_0xb828('0x21')]=qs[_0xb828('0x22')](_0x1bdcf5[_0xb828('0x20')]['sort']);_0x3e8e2c[_0xb828('0x23')]=qs[_0xb828('0x18')](_['pick'](_0x1bdcf5['query'],_0x5b08e1['filters']));if(_0x1bdcf5[_0xb828('0x20')][_0xb828('0x24')]){_0x3e8e2c['where']=_[_0xb828('0x25')](_0x3e8e2c[_0xb828('0x23')],{'$or':_[_0xb828('0x16')](_0x3e8e2c[_0xb828('0x1a')],function(_0xfe4189){var _0x270e25={};_0x270e25[_0xfe4189]={'$like':'%'+_0x1bdcf5[_0xb828('0x20')]['filter']+'%'};return _0x270e25;})});}_0x3e8e2c=_[_0xb828('0x25')]({},_0x3e8e2c,_0x1bdcf5[_0xb828('0x28')]);return _0x15c9fc[_0xb828('0x33')](_0x3e8e2c);}})['then'](function(_0x4382f3){if(_0x4382f3){_0x3c5577=_0x4382f3['length'];if(!_0x1bdcf5['query'][_0xb828('0x1e')]('nolimit')){_0x3e8e2c[_0xb828('0x9')]=qs[_0xb828('0x9')](_0x1bdcf5[_0xb828('0x20')][_0xb828('0x9')]);_0x3e8e2c[_0xb828('0x7')]=qs[_0xb828('0x7')](_0x1bdcf5[_0xb828('0x20')][_0xb828('0x7')]);}return _0x15c9fc[_0xb828('0x33')](_0x3e8e2c);}})['then'](function(_0x3c37e2){if(_0x3c37e2){return _0x3c37e2?{'count':_0x3c5577,'rows':_0x3c37e2}:null;}})['then'](respondWithResult(_0xc690fb,null))[_0xb828('0x32')](handleError(_0xc690fb,null));};exports[_0xb828('0x35')]=function(_0x50a6d8,_0x255777){if(_0x50a6d8['body']['id']){delete _0x50a6d8[_0xb828('0x30')]['id'];}return db[_0xb828('0x12')][_0xb828('0x34')]({'where':{'id':_0x50a6d8[_0xb828('0x2b')]['id']}})['then'](handleEntityNotFound(_0x255777,null))['then'](function(_0xd26ecf){if(_0xd26ecf){_0x50a6d8[_0xb828('0x30')][_0xb828('0x36')]=_0xd26ecf['id'];_0x50a6d8['body'][_0xb828('0x37')]=integrations['getSubjects'](_0x50a6d8['body'][_0xb828('0x38')],_0x50a6d8[_0xb828('0x30')][_0xb828('0x26')]);_0x50a6d8[_0xb828('0x30')][_0xb828('0x39')]=integrations[_0xb828('0x3a')](_0x50a6d8[_0xb828('0x30')][_0xb828('0x38')],_0x50a6d8[_0xb828('0x30')][_0xb828('0x26')]);return db[_0xb828('0x3b')][_0xb828('0x2f')](_0x50a6d8[_0xb828('0x30')],{'include':[{'model':db[_0xb828('0x3c')],'as':_0xb828('0x37')},{'model':db[_0xb828('0x3c')],'as':_0xb828('0x39')}]});}return null;})['then'](respondWithResult(_0x255777,null))['catch'](handleError(_0x255777,null));};function sanitizeRemoteUri(_0x1e5a2d){var _0x3128bb=_0x1e5a2d[_0xb828('0x3d')](-0x1);if(_0x3128bb==='/')return _0x1e5a2d['substring'](0x0,_0x1e5a2d[_0xb828('0x3e')](_0x3128bb));return _0x1e5a2d;}function getWebApiUrl(_0x259942){return util[_0xb828('0x3f')](_0xb828('0x40'),_0x259942);}exports[_0xb828('0x41')]=function(_0x2dbb3e,_0x3eadbf){var _0x4954b3=_0x2dbb3e[_0xb828('0x20')][_0xb828('0x42')];var _0x10cf1d=_0x4954b3==='incident'?_0xb828('0x43'):'PhoneCall';var _0x31d466='';var _0x202b29='';var _0x415dd9='';var _0x14d3e7='';var _0x493626='';var _0x47586f='';var _0x1a46dc='';var _0x2b4fbb='';var _0x3ab88f=[_0xb828('0x44'),'description',_0xb828('0x45'),'ownerid','caseorigincode','subject',_0xb828('0x46'),'regardingobjectid','directioncode',_0xb828('0x47')];var _0x177468=[_0xb828('0x48'),_0xb828('0x49'),'actualserviceunits',_0xb828('0x4a'),_0xb828('0x4b'),'contactidyominame',_0xb828('0x4c'),_0xb828('0x4d'),'createdbyexternalpartyname',_0xb828('0x4e'),_0xb828('0x4f'),'createdbyyominame',_0xb828('0x50'),_0xb828('0x51'),_0xb828('0x52'),_0xb828('0x53'),_0xb828('0x54'),'customeridyominame',_0xb828('0x55'),_0xb828('0x56'),_0xb828('0x57'),_0xb828('0x58'),_0xb828('0x59'),'exchangerate','firstresponsebykpiidname',_0xb828('0x5a'),_0xb828('0x5b'),'influencescore',_0xb828('0x5c'),_0xb828('0x5d'),'masteridname',_0xb828('0x5e'),_0xb828('0x5f'),'modifiedbyname',_0xb828('0x60'),'modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xb828('0x61'),'msdyn_iotalertname',_0xb828('0x62'),_0xb828('0x63'),_0xb828('0x64'),_0xb828('0x65'),'owneridtype','owneridyominame',_0xb828('0x66'),_0xb828('0x67'),_0xb828('0x68'),_0xb828('0x69'),'productidname',_0xb828('0x6a'),_0xb828('0x6b'),'resolvebykpiidname',_0xb828('0x6c'),_0xb828('0x6d'),_0xb828('0x6e'),_0xb828('0x6f'),'slainvokedidname',_0xb828('0x70'),_0xb828('0x71'),_0xb828('0x72'),_0xb828('0x73'),'subjectidname',_0xb828('0x74'),_0xb828('0x75'),_0xb828('0x76'),_0xb828('0x77'),'utcconversiontimezonecode',_0xb828('0x78')];var _0x5f433c=_0x3ab88f[_0xb828('0x79')](_0x177468);return db[_0xb828('0x12')][_0xb828('0x34')]({'where':{'id':_0x2dbb3e[_0xb828('0x2b')]['id']},'attributes':['id','username',_0xb828('0x7a'),_0xb828('0x7b'),_0xb828('0x7c'),'clientId',_0xb828('0x7d'),_0xb828('0x7e')],'include':[{'model':db[_0xb828('0x7f')],'as':_0xb828('0x7f'),'attributes':['id',_0xb828('0x80'),_0xb828('0x81')]}]})[_0xb828('0xd')](handleEntityNotFound(_0x3eadbf,null))[_0xb828('0xd')](function(_0x4f7da0){if(_0x4f7da0){if(_0x4f7da0[_0xb828('0x7e')]){_0x4f7da0[_0xb828('0x82')]=_0x4f7da0[_0xb828('0x7f')]['data5'];_0x2b4fbb=sanitizeRemoteUri(_0x4f7da0['CloudProvider'][_0xb828('0x81')]);_0x1a46dc=getWebApiUrl(_0x2b4fbb);return _0x4f7da0;}_0x2b4fbb=sanitizeRemoteUri(_0x4f7da0[_0xb828('0x7b')]);_0x1a46dc=getWebApiUrl(_0x2b4fbb);var _0x5a38be={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x4f7da0[_0xb828('0x7c')]+'/oauth2/token','form':{'client_id':_0x4f7da0[_0xb828('0x83')],'resource':_0x2b4fbb,'username':_0x4f7da0[_0xb828('0x84')],'password':_0x4f7da0['password'],'grant_type':_0xb828('0x7a'),'client_secret':_0x4f7da0[_0xb828('0x7d')]},'json':!![]};return rp(_0x5a38be);}})[_0xb828('0xd')](function(_0x166746){_0x47586f=_0x166746[_0xb828('0x82')];var _0x2ec79c={'method':_0xb828('0x85'),'uri':encodeURI(_0x1a46dc+_0xb828('0x86')+_0x10cf1d+'\x27'),'headers':{'Authorization':_0xb828('0x87')+_0x47586f,'If-None-Match':null,'OData-Version':_0xb828('0x88')},'json':!![]};return rp(_0x2ec79c);})[_0xb828('0xd')](function(_0x5aaa27){var _0x532c75=_0x5aaa27[_0xb828('0x89')][0x0];var _0x283bff=_0x532c75['MetadataId'];var _0x277794={'method':_0xb828('0x85'),'uri':_0x1a46dc+'EntityDefinitions('+_0x283bff+_0xb828('0x8a'),'headers':{'Authorization':_0xb828('0x87')+_0x47586f,'If-None-Match':null,'OData-Version':_0xb828('0x88')},'json':!![]};return rp(_0x277794);})[_0xb828('0xd')](function(_0x5a0b53){_0x31d466=_0x5a0b53;_0x202b29=_0x31d466['Attributes'];_0x202b29=_[_0xb828('0x8b')](_0x202b29,function(_0x343302){return!_0x5f433c[_0xb828('0x8c')](_0x343302[_0xb828('0x8d')]);});var _0x5cd60d=[];var _0x3523a9=[];_0x202b29[_0xb828('0x8e')](function(_0x4951c6){if(_0x4951c6['@odata.type']){var _0x3a49be=_0x4951c6[_0xb828('0x8f')][_0xb828('0x90')](_0x4951c6['@odata.type'][_0xb828('0x3e')]('.')+0x1);if(_0x3a49be===_0xb828('0x91')){_0x5cd60d['push'](getSelectList(_0x1a46dc,_0x4954b3,_0x3523a9,_0x31d466['MetadataId'],_0x4951c6[_0xb828('0x92')],_0x47586f));}}});return Promise[_0xb828('0x93')](_0x5cd60d);})['then'](function(_0x45ef04){_0x415dd9=_0x45ef04[0x0];var _0x5acbbe=[];var _0x3f9ba6=[];_0x202b29['forEach'](function(_0x268607){if(!_[_0xb828('0x94')](_0x268607[_0xb828('0x8f')])){var _0x5ca5e6=_0x268607[_0xb828('0x8f')][_0xb828('0x90')](_0x268607['@odata.type']['lastIndexOf']('.')+0x1);if(_0x5ca5e6===_0xb828('0x95')){_0x5acbbe[_0xb828('0x96')](getBooleanList(_0x1a46dc,_0x4954b3,_0x3f9ba6,_0x31d466[_0xb828('0x92')],_0x268607[_0xb828('0x92')],_0x47586f));}}});return Promise[_0xb828('0x93')](_0x5acbbe);})[_0xb828('0xd')](function(_0x2da7e1){_0x14d3e7=_0x2da7e1[0x0];var _0x335a7c=[];var _0x30d988=[];_0x202b29[_0xb828('0x8e')](function(_0x190f0a){if(_0x190f0a[_0xb828('0x8f')]){var _0x95e5cd=_0x190f0a[_0xb828('0x8f')]['substring'](_0x190f0a['@odata.type'][_0xb828('0x3e')]('.')+0x1);if(_0x95e5cd==='StringAttributeMetadata'||_0x95e5cd==='DoubleAttributeMetadata'||_0x95e5cd==='BigIntAttributeMetadata'||_0x95e5cd===_0xb828('0x97')||_0x95e5cd==='MemoAttributeMetadata'||_0x95e5cd==='DateTimeAttributeMetadata'||_0x95e5cd==='StatusAttributeMetadata'||_0x95e5cd===_0xb828('0x98')||_0x95e5cd===_0xb828('0x99')||_0x95e5cd===_0xb828('0x9a')){_0x335a7c[_0xb828('0x96')](getInputList(_0x1a46dc,_0x4954b3,_0x95e5cd,_0x30d988,_0x31d466[_0xb828('0x92')],_0x190f0a[_0xb828('0x92')],_0x47586f));}}});return Promise[_0xb828('0x93')](_0x335a7c);})[_0xb828('0xd')](function(_0x3eea26){_0x493626=_0x3eea26[0x0];var _0x3ea444=_0x415dd9[_0xb828('0x79')](_0x14d3e7)[_0xb828('0x79')](_0x493626);var _0x39b171={'count':_0x3ea444[_0xb828('0x1d')],'rows':_0x3ea444};return _0x39b171;})['then'](respondWithResult(_0x3eadbf,null))[_0xb828('0x32')](function(_0x3adf16){var _0x42e505=_0x2dbb3e[_0xb828('0x20')][_0xb828('0x9b')]?0x1f4:_0x3adf16[_0xb828('0x9c')]||0x1f4;logger[_0xb828('0x9d')](_0x3adf16['stack']);delete _0x3adf16[_0xb828('0xf')];if(_0x42e505===0x191){_0x42e505=0x190;}_0x3eadbf[_0xb828('0xb')](_0x42e505)[_0xb828('0x10')](_0x2dbb3e['query'][_0xb828('0x9b')]?{'message':_0xb828('0x9e'),'statusCode':_0x3adf16['statusCode']}:_0x3adf16);});};function getSelectList(_0x25a9c4,_0x5e0c7e,_0x1873c5,_0x64bc31,_0xa0acbd,_0x386f13){var _0x59d598={'method':_0xb828('0x85'),'uri':_0x25a9c4+_0xb828('0x9f')+_0x64bc31+_0xb828('0xa0')+_0xa0acbd+_0xb828('0xa1')+_0xb828('0xa2'),'headers':{'Authorization':'Bearer\x20'+_0x386f13,'If-None-Match':null,'OData-Version':_0xb828('0x88')},'json':!![]};return rp(_0x59d598)[_0xb828('0xd')](function(_0x2bf731){var _0xf51ac2=[];var _0x5cd475=_0x2bf731['OptionSet'][_0xb828('0xa3')];_0x5cd475['forEach'](function(_0x57ecdf){_0xf51ac2[_0xb828('0x96')]({'name':_0x57ecdf['Label'][_0xb828('0xa4')][_0xb828('0xa5')],'value':String(_0x57ecdf[_0xb828('0xa6')])});});var _0x3d9764={'id':_0x5e0c7e+'_'+_0x2bf731[_0xb828('0x8d')],'name':_0x2bf731[_0xb828('0xa7')][_0xb828('0xa4')][_0xb828('0xa5')],'custom':![],'options':_0xf51ac2};_0x1873c5[_0xb828('0x96')](_0x3d9764);return _0x1873c5;});}function getBooleanList(_0x366828,_0x434617,_0x2d5f04,_0x223406,_0x45a61a,_0x31e758){var _0x83c775={'method':_0xb828('0x85'),'uri':_0x366828+_0xb828('0x9f')+_0x223406+_0xb828('0xa0')+_0x45a61a+_0xb828('0xa8'),'headers':{'Authorization':_0xb828('0x87')+_0x31e758,'If-None-Match':null,'OData-Version':_0xb828('0x88')},'json':!![]};return rp(_0x83c775)[_0xb828('0xd')](function(_0x3abd54){var _0x18b482=[];_0x18b482[_0xb828('0x96')]({'name':_0x3abd54[_0xb828('0xa9')][_0xb828('0xaa')][_0xb828('0xa5')][_0xb828('0xa4')][_0xb828('0xa5')],'value':_0xb828('0xab')},{'name':_0x3abd54[_0xb828('0xa9')][_0xb828('0xac')][_0xb828('0xa5')]['UserLocalizedLabel']['Label'],'value':_0xb828('0xad')});var _0x3be7b4={'id':_0x434617+'_'+_0x3abd54[_0xb828('0x8d')],'name':_0x3abd54[_0xb828('0xa7')][_0xb828('0xa4')][_0xb828('0xa5')],'custom':![],'options':_0x18b482};_0x2d5f04[_0xb828('0x96')](_0x3be7b4);return _0x2d5f04;});}function getInputList(_0x3c0543,_0x1484bc,_0x21268e,_0x2209db,_0x5763df,_0x208281,_0x52bef0){var _0x3a1616={'method':_0xb828('0x85'),'uri':_0x3c0543+_0xb828('0x9f')+_0x5763df+_0xb828('0xa0')+_0x208281+')/Microsoft.Dynamics.CRM.'+_0x21268e+_0xb828('0xae'),'headers':{'Authorization':_0xb828('0x87')+_0x52bef0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3a1616)[_0xb828('0xd')](function(_0x3a93c8){var _0x463e48={'id':_0x1484bc+'_'+_0x3a93c8[_0xb828('0x8d')],'name':_0x3a93c8[_0xb828('0xa7')]['UserLocalizedLabel']?_0x3a93c8[_0xb828('0xa7')][_0xb828('0xa4')]['Label']:_0x3a93c8['LogicalName'],'custom':![],'options':[]};_0x2209db[_0xb828('0x96')](_0x463e48);return _0x2209db;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 745f53e..008575b 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x28ec9a,_0x556c05){var _0x454b7c=function(_0x5b5bb7){while(--_0x5b5bb7){_0x28ec9a['push'](_0x28ec9a['shift']());}};_0x454b7c(++_0x556c05);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x64c529,_0x537ef6){var _0x569b31=function(_0x5bfc7c){while(--_0x5bfc7c){_0x64c529['push'](_0x64c529['shift']());}};_0x569b31(++_0x537ef6);}(_0x757a,0xde));var _0xa757=function(_0x4dac66,_0x50dcdb){_0x4dac66=_0x4dac66-0x0;var _0x281eec=_0x757a[_0x4dac66];return _0x281eec;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3063eb5..3881eaa 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 _0x587f=['attributes','map','info','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x587f,0xca));var _0xf587=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x587f[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xf587('0x0'));var util=require(_0xf587('0x1'));var moment=require(_0xf587('0x2'));var BPromise=require(_0xf587('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf587('0x4'));var db=require(_0xf587('0x5'))['db'];var utils=require(_0xf587('0x6'));var logger=require('../../config/logger')(_0xf587('0x7'));var config=require(_0xf587('0x8'));var jayson=require(_0xf587('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25799c,_0x4984ba,_0x1c0f9f){return new BPromise(function(_0x59344b,_0x295211){return client[_0xf587('0xa')](_0x25799c,_0x1c0f9f)[_0xf587('0xb')](function(_0x13dfd1){logger['info'](_0xf587('0xc'),_0x4984ba,_0xf587('0xd'));logger[_0xf587('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4984ba,_0xf587('0xd'),JSON[_0xf587('0xf')](_0x13dfd1));if(_0x13dfd1[_0xf587('0x10')]){if(_0x13dfd1[_0xf587('0x10')][_0xf587('0x11')]===0x1f4){logger['error'](_0xf587('0xc'),_0x4984ba,_0x13dfd1[_0xf587('0x10')][_0xf587('0x12')]);return _0x295211(_0x13dfd1[_0xf587('0x10')][_0xf587('0x12')]);}logger[_0xf587('0x10')](_0xf587('0xc'),_0x4984ba,_0x13dfd1[_0xf587('0x10')][_0xf587('0x12')]);return _0x59344b(_0x13dfd1['error'][_0xf587('0x12')]);}else{logger['info'](_0xf587('0xc'),_0x4984ba,_0xf587('0xd'));_0x59344b(_0x13dfd1['result'][_0xf587('0x12')]);}})[_0xf587('0x13')](function(_0x336010){logger[_0xf587('0x10')](_0xf587('0xc'),_0x4984ba,_0x336010);_0x295211(_0x336010);});});}exports[_0xf587('0x14')]=function(_0x3d87b5){var _0x51475a=this;return new Promise(function(_0x15b0dc,_0x2879b6){return db[_0xf587('0x15')][_0xf587('0x16')]({'raw':_0x3d87b5[_0xf587('0x17')]?_0x3d87b5[_0xf587('0x17')][_0xf587('0x18')]===undefined?!![]:![]:!![],'where':_0x3d87b5[_0xf587('0x17')]?_0x3d87b5[_0xf587('0x17')][_0xf587('0x19')]||null:null,'attributes':_0x3d87b5[_0xf587('0x17')]?_0x3d87b5['options']['attributes']||null:null,'limit':_0x3d87b5['options']?_0x3d87b5['options'][_0xf587('0x1a')]||null:null,'include':_0x3d87b5['options']?_0x3d87b5[_0xf587('0x17')][_0xf587('0x1b')]?_['map'](_0x3d87b5[_0xf587('0x17')][_0xf587('0x1b')],function(_0x2c296f){return{'model':db[_0x2c296f[_0xf587('0x1c')]],'as':_0x2c296f['as'],'attributes':_0x2c296f[_0xf587('0x1d')],'include':_0x2c296f[_0xf587('0x1b')]?_[_0xf587('0x1e')](_0x2c296f['include'],function(_0x1023a6){return{'model':db[_0x1023a6[_0xf587('0x1c')]],'as':_0x1023a6['as'],'attributes':_0x1023a6['attributes'],'include':_0x1023a6[_0xf587('0x1b')]?_[_0xf587('0x1e')](_0x1023a6['include'],function(_0x67cb5d){return{'model':db[_0x67cb5d[_0xf587('0x1c')]],'as':_0x67cb5d['as'],'attributes':_0x67cb5d[_0xf587('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf587('0xb')](function(_0x21e151){logger[_0xf587('0x1f')]('GetDynamics365Account',_0x3d87b5);logger[_0xf587('0xe')]('GetDynamics365Account',_0x3d87b5,JSON['stringify'](_0x21e151));_0x15b0dc(_0x21e151);})[_0xf587('0x13')](function(_0x469328){logger['error'](_0xf587('0x14'),_0x469328['message'],_0x3d87b5);_0x2879b6(_0x51475a[_0xf587('0x10')](0x1f4,_0x469328[_0xf587('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x5196c1){var _0x606935=this;return new Promise(function(_0x93ca06,_0xec762c){return db[_0xf587('0x15')]['find']({'raw':_0x5196c1['options']?_0x5196c1[_0xf587('0x17')][_0xf587('0x18')]===undefined?!![]:![]:!![],'where':_0x5196c1[_0xf587('0x17')]?_0x5196c1[_0xf587('0x17')][_0xf587('0x19')]||null:null,'attributes':_0x5196c1[_0xf587('0x17')]?_0x5196c1['options'][_0xf587('0x1d')]||null:null,'include':_0x5196c1[_0xf587('0x17')]?_0x5196c1[_0xf587('0x17')][_0xf587('0x1b')]?_[_0xf587('0x1e')](_0x5196c1[_0xf587('0x17')]['include'],function(_0x223c65){return{'model':db[_0x223c65[_0xf587('0x1c')]],'as':_0x223c65['as'],'attributes':_0x223c65[_0xf587('0x1d')],'include':_0x223c65['include']?_[_0xf587('0x1e')](_0x223c65[_0xf587('0x1b')],function(_0x263212){return{'model':db[_0x263212['model']],'as':_0x263212['as'],'attributes':_0x263212[_0xf587('0x1d')],'include':_0x263212[_0xf587('0x1b')]?_['map'](_0x263212[_0xf587('0x1b')],function(_0x564d83){return{'model':db[_0x564d83[_0xf587('0x1c')]],'as':_0x564d83['as'],'attributes':_0x564d83['attributes']};}):[]};}):[]};}):[]:[]})[_0xf587('0xb')](function(_0x5c96a3){logger['info']('ShowDynamics365Account',_0x5196c1);logger[_0xf587('0xe')](_0xf587('0x20'),_0x5196c1,JSON[_0xf587('0xf')](_0x5c96a3));_0x93ca06(_0x5c96a3);})[_0xf587('0x13')](function(_0x6d5014){logger[_0xf587('0x10')](_0xf587('0x20'),_0x6d5014['message'],_0x5196c1);_0xec762c(_0x606935['error'](0x1f4,_0x6d5014[_0xf587('0x12')]));});});}; \ No newline at end of file +var _0xdace=['jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x23e5f1,_0x37cff7){var _0x395f97=function(_0x512f96){while(--_0x512f96){_0x23e5f1['push'](_0x23e5f1['shift']());}};_0x395f97(++_0x37cff7);}(_0xdace,0xc1));var _0xedac=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xdace[_0x3e32a8];return _0x2997b0;};'use strict';var _=require('lodash');var util=require(_0xedac('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x1'))['db'];var utils=require(_0xedac('0x2'));var logger=require(_0xedac('0x3'))('rpc');var config=require(_0xedac('0x4'));var jayson=require(_0xedac('0x5'));var client=jayson[_0xedac('0x6')][_0xedac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x205d95,_0x118484,_0x2ac06c){return new BPromise(function(_0x4fcba9,_0x46e299){return client[_0xedac('0x8')](_0x205d95,_0x2ac06c)[_0xedac('0x9')](function(_0x210166){logger[_0xedac('0xa')](_0xedac('0xb'),_0x118484,_0xedac('0xc'));logger[_0xedac('0xd')](_0xedac('0xe'),_0x118484,_0xedac('0xc'),JSON[_0xedac('0xf')](_0x210166));if(_0x210166[_0xedac('0x10')]){if(_0x210166[_0xedac('0x10')][_0xedac('0x11')]===0x1f4){logger[_0xedac('0x10')](_0xedac('0xb'),_0x118484,_0x210166[_0xedac('0x10')][_0xedac('0x12')]);return _0x46e299(_0x210166['error']['message']);}logger[_0xedac('0x10')](_0xedac('0xb'),_0x118484,_0x210166[_0xedac('0x10')]['message']);return _0x4fcba9(_0x210166[_0xedac('0x10')][_0xedac('0x12')]);}else{logger[_0xedac('0xa')](_0xedac('0xb'),_0x118484,_0xedac('0xc'));_0x4fcba9(_0x210166['result'][_0xedac('0x12')]);}})[_0xedac('0x13')](function(_0x55fa2f){logger[_0xedac('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x118484,_0x55fa2f);_0x46e299(_0x55fa2f);});});}exports[_0xedac('0x14')]=function(_0x14350e){var _0xe24512=this;return new Promise(function(_0x5a6d9b,_0x29d770){return db[_0xedac('0x15')][_0xedac('0x16')]({'raw':_0x14350e[_0xedac('0x17')]?_0x14350e[_0xedac('0x17')][_0xedac('0x18')]===undefined?!![]:![]:!![],'where':_0x14350e['options']?_0x14350e[_0xedac('0x17')][_0xedac('0x19')]||null:null,'attributes':_0x14350e['options']?_0x14350e[_0xedac('0x17')][_0xedac('0x1a')]||null:null,'limit':_0x14350e['options']?_0x14350e[_0xedac('0x17')][_0xedac('0x1b')]||null:null,'include':_0x14350e[_0xedac('0x17')]?_0x14350e[_0xedac('0x17')][_0xedac('0x1c')]?_[_0xedac('0x1d')](_0x14350e[_0xedac('0x17')]['include'],function(_0x1479a4){return{'model':db[_0x1479a4[_0xedac('0x1e')]],'as':_0x1479a4['as'],'attributes':_0x1479a4[_0xedac('0x1a')],'include':_0x1479a4[_0xedac('0x1c')]?_[_0xedac('0x1d')](_0x1479a4[_0xedac('0x1c')],function(_0x5eb3e0){return{'model':db[_0x5eb3e0[_0xedac('0x1e')]],'as':_0x5eb3e0['as'],'attributes':_0x5eb3e0[_0xedac('0x1a')],'include':_0x5eb3e0[_0xedac('0x1c')]?_[_0xedac('0x1d')](_0x5eb3e0['include'],function(_0x5148af){return{'model':db[_0x5148af['model']],'as':_0x5148af['as'],'attributes':_0x5148af[_0xedac('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xedac('0x9')](function(_0x3c6f7b){logger[_0xedac('0xa')]('GetDynamics365Account',_0x14350e);logger['debug']('GetDynamics365Account',_0x14350e,JSON[_0xedac('0xf')](_0x3c6f7b));_0x5a6d9b(_0x3c6f7b);})['catch'](function(_0x49ca91){logger[_0xedac('0x10')](_0xedac('0x14'),_0x49ca91[_0xedac('0x12')],_0x14350e);_0x29d770(_0xe24512[_0xedac('0x10')](0x1f4,_0x49ca91[_0xedac('0x12')]));});});};exports[_0xedac('0x1f')]=function(_0x4f7985){var _0x181402=this;return new Promise(function(_0xb6854a,_0x13ee48){return db[_0xedac('0x15')][_0xedac('0x20')]({'raw':_0x4f7985['options']?_0x4f7985[_0xedac('0x17')][_0xedac('0x18')]===undefined?!![]:![]:!![],'where':_0x4f7985[_0xedac('0x17')]?_0x4f7985['options']['where']||null:null,'attributes':_0x4f7985[_0xedac('0x17')]?_0x4f7985[_0xedac('0x17')][_0xedac('0x1a')]||null:null,'include':_0x4f7985[_0xedac('0x17')]?_0x4f7985[_0xedac('0x17')][_0xedac('0x1c')]?_['map'](_0x4f7985['options']['include'],function(_0x1ee88b){return{'model':db[_0x1ee88b['model']],'as':_0x1ee88b['as'],'attributes':_0x1ee88b['attributes'],'include':_0x1ee88b[_0xedac('0x1c')]?_['map'](_0x1ee88b['include'],function(_0x84584c){return{'model':db[_0x84584c[_0xedac('0x1e')]],'as':_0x84584c['as'],'attributes':_0x84584c['attributes'],'include':_0x84584c[_0xedac('0x1c')]?_[_0xedac('0x1d')](_0x84584c[_0xedac('0x1c')],function(_0x181a5f){return{'model':db[_0x181a5f[_0xedac('0x1e')]],'as':_0x181a5f['as'],'attributes':_0x181a5f[_0xedac('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xedac('0x9')](function(_0x44cfed){logger[_0xedac('0xa')](_0xedac('0x1f'),_0x4f7985);logger[_0xedac('0xd')](_0xedac('0x1f'),_0x4f7985,JSON[_0xedac('0xf')](_0x44cfed));_0xb6854a(_0x44cfed);})['catch'](function(_0x4d853c){logger[_0xedac('0x10')](_0xedac('0x1f'),_0x4d853c[_0xedac('0x12')],_0x4f7985);_0x13ee48(_0x181402['error'](0x1f4,_0x4d853c[_0xedac('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 64555d0..1b40193 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 _0x33b4=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x4b01de,_0x58cd37){var _0x35b191=function(_0x5046ae){while(--_0x5046ae){_0x4b01de['push'](_0x4b01de['shift']());}};_0x35b191(++_0x58cd37);}(_0x33b4,0x160));var _0x433b=function(_0x46a137,_0x3be24d){_0x46a137=_0x46a137-0x0;var _0xbcba75=_0x33b4[_0x46a137];return _0xbcba75;};'use strict';var multer=require('multer');var util=require(_0x433b('0x0'));var path=require('path');var timeout=require(_0x433b('0x1'));var express=require(_0x433b('0x2'));var router=express[_0x433b('0x3')]();var fs_extra=require(_0x433b('0x4'));var auth=require(_0x433b('0x5'));var interaction=require(_0x433b('0x6'));var config=require(_0x433b('0x7'));var controller=require(_0x433b('0x8'));router[_0x433b('0x9')]('/',auth[_0x433b('0xa')](),controller[_0x433b('0xb')]);router[_0x433b('0x9')]('/:id',auth[_0x433b('0xa')](),controller[_0x433b('0xc')]);router['get'](_0x433b('0xd'),auth['isAuthenticated'](),controller[_0x433b('0xe')]);router[_0x433b('0x9')](_0x433b('0xf'),auth[_0x433b('0xa')](),controller[_0x433b('0x10')]);router[_0x433b('0x9')](_0x433b('0x11'),auth[_0x433b('0xa')](),controller[_0x433b('0x12')]);router[_0x433b('0x13')]('/',auth[_0x433b('0xa')](),controller['create']);router[_0x433b('0x14')](_0x433b('0x15'),auth['isAuthenticated'](),controller[_0x433b('0x16')]);router[_0x433b('0x17')](_0x433b('0x15'),auth[_0x433b('0xa')](),controller[_0x433b('0x18')]);module[_0x433b('0x19')]=router; \ No newline at end of file +var _0x6888=['../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4cf5f7,_0x1d67c5){var _0x930797=function(_0x31dcf0){while(--_0x31dcf0){_0x4cf5f7['push'](_0x4cf5f7['shift']());}};_0x930797(++_0x1d67c5);}(_0x6888,0xd2));var _0x8688=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6888[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x8688('0x0'));var util=require('util');var path=require(_0x8688('0x1'));var timeout=require(_0x8688('0x2'));var express=require(_0x8688('0x3'));var router=express[_0x8688('0x4')]();var fs_extra=require(_0x8688('0x5'));var auth=require(_0x8688('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8688('0x7'));router[_0x8688('0x8')]('/',auth[_0x8688('0x9')](),controller[_0x8688('0xa')]);router[_0x8688('0x8')](_0x8688('0xb'),auth['isAuthenticated'](),controller[_0x8688('0xc')]);router[_0x8688('0x8')](_0x8688('0xd'),auth[_0x8688('0x9')](),controller[_0x8688('0xe')]);router['get']('/:id/subjects',auth[_0x8688('0x9')](),controller[_0x8688('0xf')]);router[_0x8688('0x8')](_0x8688('0x10'),auth[_0x8688('0x9')](),controller[_0x8688('0x11')]);router[_0x8688('0x12')]('/',auth[_0x8688('0x9')](),controller[_0x8688('0x13')]);router['put'](_0x8688('0xb'),auth[_0x8688('0x9')](),controller[_0x8688('0x14')]);router[_0x8688('0x15')](_0x8688('0xb'),auth[_0x8688('0x9')](),controller[_0x8688('0x16')]);module[_0x8688('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cc3dc18..b7f9ca6 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 _0x6792=['BOOLEAN','STRING','phonecall','ENUM','contact'];(function(_0x4c65d4,_0x5cc7ae){var _0x5341b9=function(_0x2c5e18){while(--_0x2c5e18){_0x4c65d4['push'](_0x4c65d4['shift']());}};_0x5341b9(++_0x5cc7ae);}(_0x6792,0x1a0));var _0x2679=function(_0x5e37f5,_0xf1f51f){_0x5e37f5=_0x5e37f5-0x0;var _0x14d059=_0x6792[_0x5e37f5];return _0x14d059;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2679('0x0')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x2679('0x1')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x2679('0x2')](_0x2679('0x3'),'nothing'),'defaultValue':_0x2679('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x2679('0x0')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x2679('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3fcf=['ENUM','incident','contact','nothing','BOOLEAN','sequelize','exports','STRING'];(function(_0x1b21be,_0x133419){var _0x299c07=function(_0x53daf6){while(--_0x53daf6){_0x1b21be['push'](_0x1b21be['shift']());}};_0x299c07(++_0x133419);}(_0x3fcf,0x115));var _0xf3fc=function(_0x3b9cb2,_0x4f7a3b){_0x3b9cb2=_0x3b9cb2-0x0;var _0x32ec0a=_0x3fcf[_0x3b9cb2];return _0x32ec0a;};'use strict';var Sequelize=require(_0xf3fc('0x0'));module[_0xf3fc('0x1')]={'name':{'type':Sequelize[_0xf3fc('0x2')]},'description':{'type':Sequelize[_0xf3fc('0x2')]},'ticketType':{'type':Sequelize[_0xf3fc('0x3')](_0xf3fc('0x4'),'phonecall'),'defaultValue':_0xf3fc('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xf3fc('0x5'),_0xf3fc('0x6')),'defaultValue':_0xf3fc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xf3fc('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index dee5318..3d45fff 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 _0xbd3d=['fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','sendStatus','error','name','send','index','map','Dynamics365Configuration','fieldName','key','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','show','keys','rawAttributes','length','find','catch','create','body','params','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x48e185,_0x231e34){var _0x9888fb=function(_0x294ceb){while(--_0x294ceb){_0x48e185['push'](_0x48e185['shift']());}};_0x9888fb(++_0x231e34);}(_0xbd3d,0x18d));var _0xdbd3=function(_0x46db8f,_0x16f8a4){_0x46db8f=_0x46db8f-0x0;var _0x2e5bde=_0xbd3d[_0x46db8f];return _0x2e5bde;};'use strict';var emlformat=require(_0xdbd3('0x0'));var rimraf=require(_0xdbd3('0x1'));var zipdir=require(_0xdbd3('0x2'));var jsonpatch=require(_0xdbd3('0x3'));var rp=require('request-promise');var moment=require(_0xdbd3('0x4'));var BPromise=require(_0xdbd3('0x5'));var Mustache=require(_0xdbd3('0x6'));var util=require('util');var path=require(_0xdbd3('0x7'));var sox=require(_0xdbd3('0x8'));var csv=require(_0xdbd3('0x9'));var ejs=require(_0xdbd3('0xa'));var fs=require('fs');var fs_extra=require(_0xdbd3('0xb'));var _=require(_0xdbd3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdbd3('0xd'));var deskjs=require(_0xdbd3('0xe'));var toCsv=require(_0xdbd3('0x9'));var querystring=require(_0xdbd3('0xf'));var Papa=require(_0xdbd3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbd3('0x11'));var as=require(_0xdbd3('0x12'));var hardwareService=require(_0xdbd3('0x13'));var logger=require('../../config/logger')(_0xdbd3('0x14'));var utils=require('../../config/utils');var config=require(_0xdbd3('0x15'));var licenseUtil=require(_0xdbd3('0x16'));var db=require(_0xdbd3('0x17'))['db'];function respondWithStatusCode(_0x43ea07,_0x53c6e4){_0x53c6e4=_0x53c6e4||0xcc;return function(_0x3eed79){if(_0x3eed79){return _0x43ea07['sendStatus'](_0x53c6e4);}return _0x43ea07['status'](_0x53c6e4)[_0xdbd3('0x18')]();};}function respondWithResult(_0x3fb422,_0x5f5dd9){_0x5f5dd9=_0x5f5dd9||0xc8;return function(_0x2d1d2c){if(_0x2d1d2c){return _0x3fb422[_0xdbd3('0x19')](_0x5f5dd9)[_0xdbd3('0x1a')](_0x2d1d2c);}};}function respondWithFilteredResult(_0x11e5b2,_0x4d9bab){return function(_0x30ffd6){if(_0x30ffd6){var _0x2ceca5=typeof _0x4d9bab[_0xdbd3('0x1b')]===_0xdbd3('0x1c')&&typeof _0x4d9bab[_0xdbd3('0x1d')]===_0xdbd3('0x1c');var _0x1aa988=_0x30ffd6[_0xdbd3('0x1e')];var _0x39d164=_0x2ceca5?0x0:_0x4d9bab['offset'];var _0x1ac9ac=_0x2ceca5?_0x30ffd6['count']:_0x4d9bab['offset']+_0x4d9bab[_0xdbd3('0x1d')];var _0x203ee9;if(_0x1ac9ac>=_0x1aa988){_0x1ac9ac=_0x1aa988;_0x203ee9=0xc8;}else{_0x203ee9=0xce;}_0x11e5b2[_0xdbd3('0x19')](_0x203ee9);return _0x11e5b2[_0xdbd3('0x1f')]('Content-Range',_0x39d164+'-'+_0x1ac9ac+'/'+_0x1aa988)[_0xdbd3('0x1a')](_0x30ffd6);}return null;};}function patchUpdates(_0x3b0711){return function(_0xda0e30){try{jsonpatch[_0xdbd3('0x20')](_0xda0e30,_0x3b0711,!![]);}catch(_0x7a6e59){return BPromise[_0xdbd3('0x21')](_0x7a6e59);}return _0xda0e30['save']();};}function saveUpdates(_0x38d86f,_0x375adc){return function(_0x1a9acb){if(_0x1a9acb){return _0x1a9acb[_0xdbd3('0x22')](_0x38d86f)['then'](function(_0x23b6d3){return _0x23b6d3;});}return null;};}function removeEntity(_0x5d56d8,_0x596c38){return function(_0x56b662){if(_0x56b662){return _0x56b662['destroy']()[_0xdbd3('0x23')](function(){_0x5d56d8[_0xdbd3('0x19')](0xcc)[_0xdbd3('0x18')]();});}};}function handleEntityNotFound(_0xb2692b,_0x518bad){return function(_0x27a515){if(!_0x27a515){_0xb2692b[_0xdbd3('0x24')](0x194);}return _0x27a515;};}function handleError(_0x458e3a,_0x1079a8){_0x1079a8=_0x1079a8||0x1f4;return function(_0xf650f7){logger[_0xdbd3('0x25')](_0xf650f7['stack']);if(_0xf650f7[_0xdbd3('0x26')]){delete _0xf650f7[_0xdbd3('0x26')];}_0x458e3a[_0xdbd3('0x19')](_0x1079a8)[_0xdbd3('0x27')](_0xf650f7);};}exports[_0xdbd3('0x28')]=function(_0x1a4449,_0x34d244){var _0x47cbf8={},_0x5a4915={},_0x34ae6a={'count':0x0,'rows':[]};var _0x150bf4=_[_0xdbd3('0x29')](db[_0xdbd3('0x2a')]['rawAttributes'],function(_0x78c717){return{'name':_0x78c717[_0xdbd3('0x2b')],'type':_0x78c717['type'][_0xdbd3('0x2c')]};});_0x5a4915['model']=_[_0xdbd3('0x29')](_0x150bf4,_0xdbd3('0x26'));_0x5a4915['query']=_['keys'](_0x1a4449['query']);_0x5a4915[_0xdbd3('0x2d')]=_['intersection'](_0x5a4915[_0xdbd3('0x2e')],_0x5a4915[_0xdbd3('0x2f')]);_0x47cbf8[_0xdbd3('0x30')]=_[_0xdbd3('0x31')](_0x5a4915['model'],qs[_0xdbd3('0x32')](_0x1a4449[_0xdbd3('0x2f')][_0xdbd3('0x32')]));_0x47cbf8[_0xdbd3('0x30')]=_0x47cbf8[_0xdbd3('0x30')]['length']?_0x47cbf8[_0xdbd3('0x30')]:_0x5a4915[_0xdbd3('0x2e')];if(!_0x1a4449[_0xdbd3('0x2f')][_0xdbd3('0x33')](_0xdbd3('0x34'))){_0x47cbf8[_0xdbd3('0x1d')]=qs[_0xdbd3('0x1d')](_0x1a4449['query'][_0xdbd3('0x1d')]);_0x47cbf8[_0xdbd3('0x1b')]=qs['offset'](_0x1a4449[_0xdbd3('0x2f')]['offset']);}_0x47cbf8[_0xdbd3('0x35')]=qs[_0xdbd3('0x36')](_0x1a4449[_0xdbd3('0x2f')]['sort']);_0x47cbf8['where']=qs[_0xdbd3('0x2d')](_[_0xdbd3('0x37')](_0x1a4449['query'],_0x5a4915[_0xdbd3('0x2d')]),_0x150bf4);if(_0x1a4449[_0xdbd3('0x2f')][_0xdbd3('0x38')]){_0x47cbf8['where']=_['merge'](_0x47cbf8[_0xdbd3('0x39')],{'$or':_[_0xdbd3('0x29')](_0x150bf4,function(_0x2b809f){if(_0x2b809f[_0xdbd3('0x3a')]!==_0xdbd3('0x3b')){var _0x544532={};_0x544532[_0x2b809f[_0xdbd3('0x26')]]={'$like':'%'+_0x1a4449['query'][_0xdbd3('0x38')]+'%'};return _0x544532;}})});}_0x47cbf8=_[_0xdbd3('0x3c')]({},_0x47cbf8,_0x1a4449[_0xdbd3('0x3d')]);var _0x33d409={'where':_0x47cbf8[_0xdbd3('0x39')]};return db['Dynamics365Configuration'][_0xdbd3('0x1e')](_0x33d409)[_0xdbd3('0x23')](function(_0x105f0d){_0x34ae6a[_0xdbd3('0x1e')]=_0x105f0d;if(_0x1a4449[_0xdbd3('0x2f')][_0xdbd3('0x3e')]){_0x47cbf8[_0xdbd3('0x3f')]=[{'all':!![]}];}return db[_0xdbd3('0x2a')]['findAll'](_0x47cbf8);})[_0xdbd3('0x23')](function(_0x4f2dca){_0x34ae6a[_0xdbd3('0x40')]=_0x4f2dca;return _0x34ae6a;})[_0xdbd3('0x23')](respondWithFilteredResult(_0x34d244,_0x47cbf8))['catch'](handleError(_0x34d244,null));};exports[_0xdbd3('0x41')]=function(_0x4c1ede,_0x585ab9){var _0x40176e={'raw':![],'where':{'id':_0x4c1ede['params']['id']}},_0x224c8d={};_0x224c8d['model']=_[_0xdbd3('0x42')](db['Dynamics365Configuration'][_0xdbd3('0x43')]);_0x224c8d[_0xdbd3('0x2f')]=_[_0xdbd3('0x42')](_0x4c1ede[_0xdbd3('0x2f')]);_0x224c8d[_0xdbd3('0x2d')]=_[_0xdbd3('0x31')](_0x224c8d[_0xdbd3('0x2e')],_0x224c8d[_0xdbd3('0x2f')]);_0x40176e[_0xdbd3('0x30')]=_['intersection'](_0x224c8d[_0xdbd3('0x2e')],qs[_0xdbd3('0x32')](_0x4c1ede[_0xdbd3('0x2f')][_0xdbd3('0x32')]));_0x40176e[_0xdbd3('0x30')]=_0x40176e[_0xdbd3('0x30')][_0xdbd3('0x44')]?_0x40176e[_0xdbd3('0x30')]:_0x224c8d[_0xdbd3('0x2e')];if(_0x4c1ede[_0xdbd3('0x2f')][_0xdbd3('0x3e')]){_0x40176e[_0xdbd3('0x3f')]=[{'all':!![]}];}_0x40176e=_[_0xdbd3('0x3c')]({},_0x40176e,_0x4c1ede['options']);return db['Dynamics365Configuration'][_0xdbd3('0x45')](_0x40176e)['then'](handleEntityNotFound(_0x585ab9,null))[_0xdbd3('0x23')](respondWithResult(_0x585ab9,null))[_0xdbd3('0x46')](handleError(_0x585ab9,null));};exports[_0xdbd3('0x47')]=function(_0x5c239c,_0x44215){return db[_0xdbd3('0x2a')]['create'](_0x5c239c[_0xdbd3('0x48')],{})['then'](respondWithResult(_0x44215,0xc9))['catch'](handleError(_0x44215,null));};exports['update']=function(_0x2b2fb5,_0x1b42d7){if(_0x2b2fb5[_0xdbd3('0x48')]['id']){delete _0x2b2fb5[_0xdbd3('0x48')]['id'];}return db[_0xdbd3('0x2a')][_0xdbd3('0x45')]({'where':{'id':_0x2b2fb5[_0xdbd3('0x49')]['id']}})[_0xdbd3('0x23')](handleEntityNotFound(_0x1b42d7,null))[_0xdbd3('0x23')](saveUpdates(_0x2b2fb5['body'],null))[_0xdbd3('0x23')](respondWithResult(_0x1b42d7,null))['catch'](handleError(_0x1b42d7,null));};exports[_0xdbd3('0x4a')]=function(_0x4d5117,_0x1b8e49){return db[_0xdbd3('0x2a')][_0xdbd3('0x45')]({'where':{'id':_0x4d5117[_0xdbd3('0x49')]['id']}})[_0xdbd3('0x23')](handleEntityNotFound(_0x1b8e49,null))[_0xdbd3('0x23')](removeEntity(_0x1b8e49,null))[_0xdbd3('0x46')](handleError(_0x1b8e49,null));};exports[_0xdbd3('0x4b')]=function(_0x4cc38e,_0x2cc92d,_0x2ded5f){var _0x4746e9={};var _0x4dab78={};var _0x5cc46a;var _0x448523;return db[_0xdbd3('0x2a')]['findOne']({'where':{'id':_0x4cc38e[_0xdbd3('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cc92d,null))[_0xdbd3('0x23')](function(_0x5436d9){if(_0x5436d9){_0x5cc46a=_0x5436d9;_0x4dab78[_0xdbd3('0x2e')]=_[_0xdbd3('0x42')](db['Dynamics365Field']['rawAttributes']);_0x4dab78['query']=_['keys'](_0x4cc38e[_0xdbd3('0x2f')]);_0x4dab78[_0xdbd3('0x2d')]=_[_0xdbd3('0x31')](_0x4dab78['model'],_0x4dab78['query']);_0x4746e9[_0xdbd3('0x30')]=_['intersection'](_0x4dab78[_0xdbd3('0x2e')],qs[_0xdbd3('0x32')](_0x4cc38e[_0xdbd3('0x2f')][_0xdbd3('0x32')]));_0x4746e9[_0xdbd3('0x30')]=_0x4746e9[_0xdbd3('0x30')]['length']?_0x4746e9[_0xdbd3('0x30')]:_0x4dab78[_0xdbd3('0x2e')];_0x4746e9['order']=qs[_0xdbd3('0x36')](_0x4cc38e[_0xdbd3('0x2f')][_0xdbd3('0x36')]);_0x4746e9[_0xdbd3('0x39')]=qs[_0xdbd3('0x2d')](_[_0xdbd3('0x37')](_0x4cc38e[_0xdbd3('0x2f')],_0x4dab78[_0xdbd3('0x2d')]));if(_0x4cc38e[_0xdbd3('0x2f')][_0xdbd3('0x38')]){_0x4746e9[_0xdbd3('0x39')]=_[_0xdbd3('0x3c')](_0x4746e9[_0xdbd3('0x39')],{'$or':_[_0xdbd3('0x29')](_0x4746e9[_0xdbd3('0x30')],function(_0xccd4c3){var _0x1dfc95={};_0x1dfc95[_0xccd4c3]={'$like':'%'+_0x4cc38e[_0xdbd3('0x2f')]['filter']+'%'};return _0x1dfc95;})});}_0x4746e9=_[_0xdbd3('0x3c')]({},_0x4746e9,_0x4cc38e[_0xdbd3('0x3d')]);return _0x5cc46a[_0xdbd3('0x4b')](_0x4746e9);}})[_0xdbd3('0x23')](function(_0x20dfe5){if(_0x20dfe5){_0x448523=_0x20dfe5['length'];if(!_0x4cc38e['query'][_0xdbd3('0x33')](_0xdbd3('0x34'))){_0x4746e9[_0xdbd3('0x1d')]=qs[_0xdbd3('0x1d')](_0x4cc38e[_0xdbd3('0x2f')][_0xdbd3('0x1d')]);_0x4746e9['offset']=qs[_0xdbd3('0x1b')](_0x4cc38e[_0xdbd3('0x2f')][_0xdbd3('0x1b')]);}return _0x5cc46a[_0xdbd3('0x4b')](_0x4746e9);}})[_0xdbd3('0x23')](function(_0x2bacb0){if(_0x2bacb0){return _0x2bacb0?{'count':_0x448523,'rows':_0x2bacb0}:null;}})[_0xdbd3('0x23')](respondWithResult(_0x2cc92d,null))[_0xdbd3('0x46')](handleError(_0x2cc92d,null));};exports['getSubjects']=function(_0x20e255,_0x4c2394,_0x3fd7ca){var _0x434fbc={};var _0x2e1dd2={};var _0x389de5;var _0x59c841;return db['Dynamics365Configuration'][_0xdbd3('0x4c')]({'where':{'id':_0x20e255[_0xdbd3('0x49')]['id']}})[_0xdbd3('0x23')](handleEntityNotFound(_0x4c2394,null))[_0xdbd3('0x23')](function(_0x14e219){if(_0x14e219){_0x389de5=_0x14e219;_0x2e1dd2[_0xdbd3('0x2e')]=_[_0xdbd3('0x42')](db[_0xdbd3('0x4d')][_0xdbd3('0x43')]);_0x2e1dd2[_0xdbd3('0x2f')]=_['keys'](_0x20e255[_0xdbd3('0x2f')]);_0x2e1dd2['filters']=_[_0xdbd3('0x31')](_0x2e1dd2[_0xdbd3('0x2e')],_0x2e1dd2['query']);_0x434fbc['attributes']=_['intersection'](_0x2e1dd2[_0xdbd3('0x2e')],qs[_0xdbd3('0x32')](_0x20e255[_0xdbd3('0x2f')][_0xdbd3('0x32')]));_0x434fbc['attributes']=_0x434fbc[_0xdbd3('0x30')]['length']?_0x434fbc[_0xdbd3('0x30')]:_0x2e1dd2['model'];_0x434fbc['order']=qs[_0xdbd3('0x36')](_0x20e255[_0xdbd3('0x2f')][_0xdbd3('0x36')]);_0x434fbc[_0xdbd3('0x39')]=qs['filters'](_['pick'](_0x20e255[_0xdbd3('0x2f')],_0x2e1dd2[_0xdbd3('0x2d')]));if(_0x20e255[_0xdbd3('0x2f')][_0xdbd3('0x38')]){_0x434fbc[_0xdbd3('0x39')]=_[_0xdbd3('0x3c')](_0x434fbc[_0xdbd3('0x39')],{'$or':_[_0xdbd3('0x29')](_0x434fbc[_0xdbd3('0x30')],function(_0x254e08){var _0x3d2a0f={};_0x3d2a0f[_0x254e08]={'$like':'%'+_0x20e255['query'][_0xdbd3('0x38')]+'%'};return _0x3d2a0f;})});}_0x434fbc=_['merge']({},_0x434fbc,_0x20e255[_0xdbd3('0x3d')]);return _0x389de5[_0xdbd3('0x4e')](_0x434fbc);}})['then'](function(_0x4cbc87){if(_0x4cbc87){_0x59c841=_0x4cbc87[_0xdbd3('0x44')];if(!_0x20e255[_0xdbd3('0x2f')][_0xdbd3('0x33')](_0xdbd3('0x34'))){_0x434fbc['limit']=qs['limit'](_0x20e255[_0xdbd3('0x2f')][_0xdbd3('0x1d')]);_0x434fbc[_0xdbd3('0x1b')]=qs['offset'](_0x20e255[_0xdbd3('0x2f')]['offset']);}return _0x389de5['getSubjects'](_0x434fbc);}})['then'](function(_0xf6b73b){if(_0xf6b73b){return _0xf6b73b?{'count':_0x59c841,'rows':_0xf6b73b}:null;}})[_0xdbd3('0x23')](respondWithResult(_0x4c2394,null))[_0xdbd3('0x46')](handleError(_0x4c2394,null));};exports[_0xdbd3('0x4f')]=function(_0x4d4d87,_0x304fd3,_0x36f1f8){var _0x21c01b={};var _0x42ae5b={};var _0x3b067b;var _0x515e66;return db[_0xdbd3('0x2a')][_0xdbd3('0x4c')]({'where':{'id':_0x4d4d87[_0xdbd3('0x49')]['id']}})['then'](handleEntityNotFound(_0x304fd3,null))[_0xdbd3('0x23')](function(_0x39d66b){if(_0x39d66b){_0x3b067b=_0x39d66b;_0x42ae5b[_0xdbd3('0x2e')]=_[_0xdbd3('0x42')](db[_0xdbd3('0x4d')][_0xdbd3('0x43')]);_0x42ae5b[_0xdbd3('0x2f')]=_['keys'](_0x4d4d87[_0xdbd3('0x2f')]);_0x42ae5b[_0xdbd3('0x2d')]=_[_0xdbd3('0x31')](_0x42ae5b[_0xdbd3('0x2e')],_0x42ae5b['query']);_0x21c01b['attributes']=_[_0xdbd3('0x31')](_0x42ae5b[_0xdbd3('0x2e')],qs[_0xdbd3('0x32')](_0x4d4d87[_0xdbd3('0x2f')][_0xdbd3('0x32')]));_0x21c01b['attributes']=_0x21c01b['attributes'][_0xdbd3('0x44')]?_0x21c01b[_0xdbd3('0x30')]:_0x42ae5b[_0xdbd3('0x2e')];_0x21c01b['order']=qs[_0xdbd3('0x36')](_0x4d4d87['query'][_0xdbd3('0x36')]);_0x21c01b[_0xdbd3('0x39')]=qs[_0xdbd3('0x2d')](_[_0xdbd3('0x37')](_0x4d4d87[_0xdbd3('0x2f')],_0x42ae5b[_0xdbd3('0x2d')]));if(_0x4d4d87[_0xdbd3('0x2f')][_0xdbd3('0x38')]){_0x21c01b[_0xdbd3('0x39')]=_[_0xdbd3('0x3c')](_0x21c01b[_0xdbd3('0x39')],{'$or':_['map'](_0x21c01b[_0xdbd3('0x30')],function(_0x2ac03d){var _0x216db6={};_0x216db6[_0x2ac03d]={'$like':'%'+_0x4d4d87['query'][_0xdbd3('0x38')]+'%'};return _0x216db6;})});}_0x21c01b=_[_0xdbd3('0x3c')]({},_0x21c01b,_0x4d4d87[_0xdbd3('0x3d')]);return _0x3b067b['getDescriptions'](_0x21c01b);}})[_0xdbd3('0x23')](function(_0x169a5f){if(_0x169a5f){_0x515e66=_0x169a5f[_0xdbd3('0x44')];if(!_0x4d4d87['query'][_0xdbd3('0x33')](_0xdbd3('0x34'))){_0x21c01b[_0xdbd3('0x1d')]=qs[_0xdbd3('0x1d')](_0x4d4d87[_0xdbd3('0x2f')][_0xdbd3('0x1d')]);_0x21c01b[_0xdbd3('0x1b')]=qs[_0xdbd3('0x1b')](_0x4d4d87[_0xdbd3('0x2f')][_0xdbd3('0x1b')]);}return _0x3b067b[_0xdbd3('0x4f')](_0x21c01b);}})[_0xdbd3('0x23')](function(_0xd237cd){if(_0xd237cd){return _0xd237cd?{'count':_0x515e66,'rows':_0xd237cd}:null;}})[_0xdbd3('0x23')](respondWithResult(_0x304fd3,null))[_0xdbd3('0x46')](handleError(_0x304fd3,null));}; \ No newline at end of file +var _0x963b=['key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','getFields','findOne','getSubjects','Dynamics365Field','order','getDescriptions','pick','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x963b,0x105));var _0xb963=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x963b[_0x16eb11];return _0x3ae7ef;};'use strict';var emlformat=require(_0xb963('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb963('0x1'));var jsonpatch=require(_0xb963('0x2'));var rp=require('request-promise');var moment=require(_0xb963('0x3'));var BPromise=require(_0xb963('0x4'));var Mustache=require(_0xb963('0x5'));var util=require(_0xb963('0x6'));var path=require(_0xb963('0x7'));var sox=require(_0xb963('0x8'));var csv=require('to-csv');var ejs=require(_0xb963('0x9'));var fs=require('fs');var fs_extra=require(_0xb963('0xa'));var _=require(_0xb963('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb963('0xc'));var deskjs=require(_0xb963('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb963('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb963('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb963('0x10'));var utils=require(_0xb963('0x11'));var config=require(_0xb963('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xb963('0x13'))['db'];function respondWithStatusCode(_0x128117,_0x3b7266){_0x3b7266=_0x3b7266||0xcc;return function(_0x27cbb5){if(_0x27cbb5){return _0x128117['sendStatus'](_0x3b7266);}return _0x128117[_0xb963('0x14')](_0x3b7266)[_0xb963('0x15')]();};}function respondWithResult(_0x1472d8,_0x23704e){_0x23704e=_0x23704e||0xc8;return function(_0x4686e8){if(_0x4686e8){return _0x1472d8[_0xb963('0x14')](_0x23704e)[_0xb963('0x16')](_0x4686e8);}};}function respondWithFilteredResult(_0x2d91ea,_0x5cb426){return function(_0x357825){if(_0x357825){var _0x4376f9=typeof _0x5cb426['offset']===_0xb963('0x17')&&typeof _0x5cb426[_0xb963('0x18')]===_0xb963('0x17');var _0x4049cb=_0x357825[_0xb963('0x19')];var _0x212b8e=_0x4376f9?0x0:_0x5cb426['offset'];var _0x32bdb0=_0x4376f9?_0x357825[_0xb963('0x19')]:_0x5cb426[_0xb963('0x1a')]+_0x5cb426[_0xb963('0x18')];var _0x9658ad;if(_0x32bdb0>=_0x4049cb){_0x32bdb0=_0x4049cb;_0x9658ad=0xc8;}else{_0x9658ad=0xce;}_0x2d91ea[_0xb963('0x14')](_0x9658ad);return _0x2d91ea[_0xb963('0x1b')](_0xb963('0x1c'),_0x212b8e+'-'+_0x32bdb0+'/'+_0x4049cb)[_0xb963('0x16')](_0x357825);}return null;};}function patchUpdates(_0x41c0b4){return function(_0x4318ae){try{jsonpatch[_0xb963('0x1d')](_0x4318ae,_0x41c0b4,!![]);}catch(_0x268584){return BPromise['reject'](_0x268584);}return _0x4318ae['save']();};}function saveUpdates(_0xbe0d0b,_0x297a5c){return function(_0x1f0a12){if(_0x1f0a12){return _0x1f0a12[_0xb963('0x1e')](_0xbe0d0b)[_0xb963('0x1f')](function(_0x3aa4ef){return _0x3aa4ef;});}return null;};}function removeEntity(_0x44de8c,_0xa872b5){return function(_0x272e37){if(_0x272e37){return _0x272e37[_0xb963('0x20')]()[_0xb963('0x1f')](function(){_0x44de8c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec4f6,_0x48e938){return function(_0x580030){if(!_0x580030){_0x5ec4f6[_0xb963('0x21')](0x194);}return _0x580030;};}function handleError(_0x44be76,_0x12beaf){_0x12beaf=_0x12beaf||0x1f4;return function(_0x3738a1){logger[_0xb963('0x22')](_0x3738a1[_0xb963('0x23')]);if(_0x3738a1[_0xb963('0x24')]){delete _0x3738a1[_0xb963('0x24')];}_0x44be76[_0xb963('0x14')](_0x12beaf)[_0xb963('0x25')](_0x3738a1);};}exports['index']=function(_0x5826c1,_0x202b57){var _0x18f9f6={},_0x4cbf85={},_0x47b17c={'count':0x0,'rows':[]};var _0x534ad4=_[_0xb963('0x26')](db[_0xb963('0x27')][_0xb963('0x28')],function(_0x13d52b){return{'name':_0x13d52b[_0xb963('0x29')],'type':_0x13d52b[_0xb963('0x2a')][_0xb963('0x2b')]};});_0x4cbf85[_0xb963('0x2c')]=_['map'](_0x534ad4,'name');_0x4cbf85[_0xb963('0x2d')]=_['keys'](_0x5826c1[_0xb963('0x2d')]);_0x4cbf85['filters']=_[_0xb963('0x2e')](_0x4cbf85['model'],_0x4cbf85['query']);_0x18f9f6['attributes']=_[_0xb963('0x2e')](_0x4cbf85[_0xb963('0x2c')],qs[_0xb963('0x2f')](_0x5826c1[_0xb963('0x2d')][_0xb963('0x2f')]));_0x18f9f6['attributes']=_0x18f9f6[_0xb963('0x30')][_0xb963('0x31')]?_0x18f9f6[_0xb963('0x30')]:_0x4cbf85[_0xb963('0x2c')];if(!_0x5826c1['query'][_0xb963('0x32')](_0xb963('0x33'))){_0x18f9f6[_0xb963('0x18')]=qs[_0xb963('0x18')](_0x5826c1['query'][_0xb963('0x18')]);_0x18f9f6[_0xb963('0x1a')]=qs[_0xb963('0x1a')](_0x5826c1['query'][_0xb963('0x1a')]);}_0x18f9f6['order']=qs[_0xb963('0x34')](_0x5826c1[_0xb963('0x2d')]['sort']);_0x18f9f6[_0xb963('0x35')]=qs[_0xb963('0x36')](_['pick'](_0x5826c1[_0xb963('0x2d')],_0x4cbf85['filters']),_0x534ad4);if(_0x5826c1[_0xb963('0x2d')]['filter']){_0x18f9f6['where']=_[_0xb963('0x37')](_0x18f9f6[_0xb963('0x35')],{'$or':_[_0xb963('0x26')](_0x534ad4,function(_0x38b8c7){if(_0x38b8c7['type']!==_0xb963('0x38')){var _0x576cbf={};_0x576cbf[_0x38b8c7[_0xb963('0x24')]]={'$like':'%'+_0x5826c1['query'][_0xb963('0x39')]+'%'};return _0x576cbf;}})});}_0x18f9f6=_[_0xb963('0x37')]({},_0x18f9f6,_0x5826c1['options']);var _0x3b2da4={'where':_0x18f9f6[_0xb963('0x35')]};return db[_0xb963('0x27')][_0xb963('0x19')](_0x3b2da4)[_0xb963('0x1f')](function(_0x271f6f){_0x47b17c[_0xb963('0x19')]=_0x271f6f;if(_0x5826c1[_0xb963('0x2d')][_0xb963('0x3a')]){_0x18f9f6[_0xb963('0x3b')]=[{'all':!![]}];}return db[_0xb963('0x27')][_0xb963('0x3c')](_0x18f9f6);})[_0xb963('0x1f')](function(_0x5bcefb){_0x47b17c[_0xb963('0x3d')]=_0x5bcefb;return _0x47b17c;})[_0xb963('0x1f')](respondWithFilteredResult(_0x202b57,_0x18f9f6))[_0xb963('0x3e')](handleError(_0x202b57,null));};exports['show']=function(_0x24b110,_0x3a2d6f){var _0x13b312={'raw':![],'where':{'id':_0x24b110[_0xb963('0x3f')]['id']}},_0x18e48a={};_0x18e48a[_0xb963('0x2c')]=_[_0xb963('0x40')](db[_0xb963('0x27')][_0xb963('0x28')]);_0x18e48a['query']=_[_0xb963('0x40')](_0x24b110[_0xb963('0x2d')]);_0x18e48a[_0xb963('0x36')]=_['intersection'](_0x18e48a['model'],_0x18e48a['query']);_0x13b312['attributes']=_[_0xb963('0x2e')](_0x18e48a['model'],qs[_0xb963('0x2f')](_0x24b110[_0xb963('0x2d')]['fields']));_0x13b312[_0xb963('0x30')]=_0x13b312[_0xb963('0x30')][_0xb963('0x31')]?_0x13b312[_0xb963('0x30')]:_0x18e48a[_0xb963('0x2c')];if(_0x24b110[_0xb963('0x2d')][_0xb963('0x3a')]){_0x13b312[_0xb963('0x3b')]=[{'all':!![]}];}_0x13b312=_[_0xb963('0x37')]({},_0x13b312,_0x24b110[_0xb963('0x41')]);return db[_0xb963('0x27')][_0xb963('0x42')](_0x13b312)[_0xb963('0x1f')](handleEntityNotFound(_0x3a2d6f,null))[_0xb963('0x1f')](respondWithResult(_0x3a2d6f,null))['catch'](handleError(_0x3a2d6f,null));};exports[_0xb963('0x43')]=function(_0x52b33a,_0x4c08a8){return db[_0xb963('0x27')][_0xb963('0x43')](_0x52b33a[_0xb963('0x44')],{})[_0xb963('0x1f')](respondWithResult(_0x4c08a8,0xc9))[_0xb963('0x3e')](handleError(_0x4c08a8,null));};exports[_0xb963('0x1e')]=function(_0xd6054a,_0x288314){if(_0xd6054a[_0xb963('0x44')]['id']){delete _0xd6054a['body']['id'];}return db[_0xb963('0x27')][_0xb963('0x42')]({'where':{'id':_0xd6054a[_0xb963('0x3f')]['id']}})[_0xb963('0x1f')](handleEntityNotFound(_0x288314,null))['then'](saveUpdates(_0xd6054a[_0xb963('0x44')],null))['then'](respondWithResult(_0x288314,null))[_0xb963('0x3e')](handleError(_0x288314,null));};exports[_0xb963('0x20')]=function(_0x3385ba,_0x3dfc01){return db[_0xb963('0x27')]['find']({'where':{'id':_0x3385ba[_0xb963('0x3f')]['id']}})[_0xb963('0x1f')](handleEntityNotFound(_0x3dfc01,null))['then'](removeEntity(_0x3dfc01,null))[_0xb963('0x3e')](handleError(_0x3dfc01,null));};exports[_0xb963('0x45')]=function(_0x1bf52e,_0x53b626,_0x4a8120){var _0x1280c9={};var _0x2142b3={};var _0x4b4954;var _0x466aa8;return db[_0xb963('0x27')][_0xb963('0x46')]({'where':{'id':_0x1bf52e[_0xb963('0x3f')]['id']}})[_0xb963('0x1f')](handleEntityNotFound(_0x53b626,null))[_0xb963('0x1f')](function(_0x1c24f7){if(_0x1c24f7){_0x4b4954=_0x1c24f7;_0x2142b3[_0xb963('0x2c')]=_[_0xb963('0x40')](db['Dynamics365Field']['rawAttributes']);_0x2142b3[_0xb963('0x2d')]=_[_0xb963('0x40')](_0x1bf52e[_0xb963('0x2d')]);_0x2142b3['filters']=_[_0xb963('0x2e')](_0x2142b3[_0xb963('0x2c')],_0x2142b3[_0xb963('0x2d')]);_0x1280c9[_0xb963('0x30')]=_[_0xb963('0x2e')](_0x2142b3['model'],qs[_0xb963('0x2f')](_0x1bf52e[_0xb963('0x2d')][_0xb963('0x2f')]));_0x1280c9[_0xb963('0x30')]=_0x1280c9['attributes']['length']?_0x1280c9[_0xb963('0x30')]:_0x2142b3[_0xb963('0x2c')];_0x1280c9['order']=qs[_0xb963('0x34')](_0x1bf52e[_0xb963('0x2d')][_0xb963('0x34')]);_0x1280c9['where']=qs[_0xb963('0x36')](_['pick'](_0x1bf52e['query'],_0x2142b3[_0xb963('0x36')]));if(_0x1bf52e['query'][_0xb963('0x39')]){_0x1280c9[_0xb963('0x35')]=_[_0xb963('0x37')](_0x1280c9[_0xb963('0x35')],{'$or':_[_0xb963('0x26')](_0x1280c9[_0xb963('0x30')],function(_0x6934eb){var _0x37125e={};_0x37125e[_0x6934eb]={'$like':'%'+_0x1bf52e[_0xb963('0x2d')][_0xb963('0x39')]+'%'};return _0x37125e;})});}_0x1280c9=_[_0xb963('0x37')]({},_0x1280c9,_0x1bf52e[_0xb963('0x41')]);return _0x4b4954['getFields'](_0x1280c9);}})[_0xb963('0x1f')](function(_0x23cc01){if(_0x23cc01){_0x466aa8=_0x23cc01['length'];if(!_0x1bf52e[_0xb963('0x2d')]['hasOwnProperty']('nolimit')){_0x1280c9[_0xb963('0x18')]=qs[_0xb963('0x18')](_0x1bf52e['query'][_0xb963('0x18')]);_0x1280c9['offset']=qs[_0xb963('0x1a')](_0x1bf52e['query']['offset']);}return _0x4b4954[_0xb963('0x45')](_0x1280c9);}})[_0xb963('0x1f')](function(_0x3523bb){if(_0x3523bb){return _0x3523bb?{'count':_0x466aa8,'rows':_0x3523bb}:null;}})[_0xb963('0x1f')](respondWithResult(_0x53b626,null))['catch'](handleError(_0x53b626,null));};exports[_0xb963('0x47')]=function(_0x14206d,_0x5525d0,_0x4f94bb){var _0xbe84d1={};var _0x3a28af={};var _0x392573;var _0x1e9658;return db['Dynamics365Configuration'][_0xb963('0x46')]({'where':{'id':_0x14206d[_0xb963('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5525d0,null))[_0xb963('0x1f')](function(_0x4cb0ef){if(_0x4cb0ef){_0x392573=_0x4cb0ef;_0x3a28af[_0xb963('0x2c')]=_['keys'](db[_0xb963('0x48')][_0xb963('0x28')]);_0x3a28af['query']=_['keys'](_0x14206d['query']);_0x3a28af[_0xb963('0x36')]=_[_0xb963('0x2e')](_0x3a28af[_0xb963('0x2c')],_0x3a28af['query']);_0xbe84d1[_0xb963('0x30')]=_[_0xb963('0x2e')](_0x3a28af[_0xb963('0x2c')],qs[_0xb963('0x2f')](_0x14206d[_0xb963('0x2d')]['fields']));_0xbe84d1[_0xb963('0x30')]=_0xbe84d1[_0xb963('0x30')][_0xb963('0x31')]?_0xbe84d1[_0xb963('0x30')]:_0x3a28af['model'];_0xbe84d1[_0xb963('0x49')]=qs['sort'](_0x14206d['query'][_0xb963('0x34')]);_0xbe84d1['where']=qs[_0xb963('0x36')](_['pick'](_0x14206d['query'],_0x3a28af[_0xb963('0x36')]));if(_0x14206d[_0xb963('0x2d')]['filter']){_0xbe84d1[_0xb963('0x35')]=_[_0xb963('0x37')](_0xbe84d1[_0xb963('0x35')],{'$or':_[_0xb963('0x26')](_0xbe84d1['attributes'],function(_0x919287){var _0x42598d={};_0x42598d[_0x919287]={'$like':'%'+_0x14206d[_0xb963('0x2d')][_0xb963('0x39')]+'%'};return _0x42598d;})});}_0xbe84d1=_[_0xb963('0x37')]({},_0xbe84d1,_0x14206d['options']);return _0x392573[_0xb963('0x47')](_0xbe84d1);}})[_0xb963('0x1f')](function(_0x14902e){if(_0x14902e){_0x1e9658=_0x14902e[_0xb963('0x31')];if(!_0x14206d['query'][_0xb963('0x32')]('nolimit')){_0xbe84d1[_0xb963('0x18')]=qs[_0xb963('0x18')](_0x14206d[_0xb963('0x2d')][_0xb963('0x18')]);_0xbe84d1[_0xb963('0x1a')]=qs['offset'](_0x14206d[_0xb963('0x2d')]['offset']);}return _0x392573[_0xb963('0x47')](_0xbe84d1);}})[_0xb963('0x1f')](function(_0x52c36f){if(_0x52c36f){return _0x52c36f?{'count':_0x1e9658,'rows':_0x52c36f}:null;}})[_0xb963('0x1f')](respondWithResult(_0x5525d0,null))[_0xb963('0x3e')](handleError(_0x5525d0,null));};exports[_0xb963('0x4a')]=function(_0x126c01,_0x399fd9,_0x55c476){var _0x58999b={};var _0x2f2f26={};var _0x260287;var _0xbcd1f6;return db[_0xb963('0x27')][_0xb963('0x46')]({'where':{'id':_0x126c01[_0xb963('0x3f')]['id']}})[_0xb963('0x1f')](handleEntityNotFound(_0x399fd9,null))[_0xb963('0x1f')](function(_0x4d51a4){if(_0x4d51a4){_0x260287=_0x4d51a4;_0x2f2f26[_0xb963('0x2c')]=_[_0xb963('0x40')](db[_0xb963('0x48')][_0xb963('0x28')]);_0x2f2f26[_0xb963('0x2d')]=_[_0xb963('0x40')](_0x126c01[_0xb963('0x2d')]);_0x2f2f26[_0xb963('0x36')]=_[_0xb963('0x2e')](_0x2f2f26[_0xb963('0x2c')],_0x2f2f26[_0xb963('0x2d')]);_0x58999b[_0xb963('0x30')]=_[_0xb963('0x2e')](_0x2f2f26[_0xb963('0x2c')],qs[_0xb963('0x2f')](_0x126c01[_0xb963('0x2d')][_0xb963('0x2f')]));_0x58999b['attributes']=_0x58999b[_0xb963('0x30')]['length']?_0x58999b[_0xb963('0x30')]:_0x2f2f26[_0xb963('0x2c')];_0x58999b[_0xb963('0x49')]=qs[_0xb963('0x34')](_0x126c01[_0xb963('0x2d')][_0xb963('0x34')]);_0x58999b['where']=qs[_0xb963('0x36')](_[_0xb963('0x4b')](_0x126c01[_0xb963('0x2d')],_0x2f2f26['filters']));if(_0x126c01[_0xb963('0x2d')]['filter']){_0x58999b[_0xb963('0x35')]=_[_0xb963('0x37')](_0x58999b['where'],{'$or':_[_0xb963('0x26')](_0x58999b[_0xb963('0x30')],function(_0x5222d0){var _0x7d6aec={};_0x7d6aec[_0x5222d0]={'$like':'%'+_0x126c01[_0xb963('0x2d')][_0xb963('0x39')]+'%'};return _0x7d6aec;})});}_0x58999b=_[_0xb963('0x37')]({},_0x58999b,_0x126c01[_0xb963('0x41')]);return _0x260287[_0xb963('0x4a')](_0x58999b);}})[_0xb963('0x1f')](function(_0x4eb682){if(_0x4eb682){_0xbcd1f6=_0x4eb682['length'];if(!_0x126c01[_0xb963('0x2d')][_0xb963('0x32')](_0xb963('0x33'))){_0x58999b['limit']=qs[_0xb963('0x18')](_0x126c01[_0xb963('0x2d')]['limit']);_0x58999b[_0xb963('0x1a')]=qs['offset'](_0x126c01[_0xb963('0x2d')][_0xb963('0x1a')]);}return _0x260287[_0xb963('0x4a')](_0x58999b);}})[_0xb963('0x1f')](function(_0x106537){if(_0x106537){return _0x106537?{'count':_0xbcd1f6,'rows':_0x106537}:null;}})[_0xb963('0x1f')](respondWithResult(_0x399fd9,null))[_0xb963('0x3e')](handleError(_0x399fd9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ccd5ff8..a1839be 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x485d05,_0x3c1118){var _0x32685b=function(_0x54a4f3){while(--_0x54a4f3){_0x485d05['push'](_0x485d05['shift']());}};_0x32685b(++_0x3c1118);}(_0xdace,0xc5));var _0xedac=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xdace[_0x34a8c8];return _0x1fe6e5;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4e1831,_0x1c8184){var _0x32734a=function(_0x5686dd){while(--_0x5686dd){_0x4e1831['push'](_0x4e1831['shift']());}};_0x32734a(++_0x1c8184);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xf3cd[_0x216428];return _0x313dd4;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1fe078a..26163bc 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 _0x2f79=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29e857,_0x21d294){var _0x4e6b23=function(_0x4995e0){while(--_0x4995e0){_0x29e857['push'](_0x29e857['shift']());}};_0x4e6b23(++_0x21d294);}(_0x2f79,0x1c2));var _0x92f7=function(_0xa15bd9,_0x17b25c){_0xa15bd9=_0xa15bd9-0x0;var _0x5d17eb=_0x2f79[_0xa15bd9];return _0x5d17eb;};'use strict';var _=require(_0x92f7('0x0'));var util=require(_0x92f7('0x1'));var moment=require(_0x92f7('0x2'));var BPromise=require('bluebird');var rs=require(_0x92f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x92f7('0x5'));var config=require(_0x92f7('0x6'));var jayson=require(_0x92f7('0x7'));var client=jayson[_0x92f7('0x8')][_0x92f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x485ba7,_0xfe86c4,_0x3ac7dc){return new BPromise(function(_0x3e927e,_0x54f69c){return client[_0x92f7('0xa')](_0x485ba7,_0x3ac7dc)[_0x92f7('0xb')](function(_0x3555a3){logger[_0x92f7('0xc')](_0x92f7('0xd'),_0xfe86c4,_0x92f7('0xe'));logger[_0x92f7('0xf')](_0x92f7('0x10'),_0xfe86c4,'request\x20sent',JSON['stringify'](_0x3555a3));if(_0x3555a3[_0x92f7('0x11')]){if(_0x3555a3[_0x92f7('0x11')][_0x92f7('0x12')]===0x1f4){logger['error'](_0x92f7('0xd'),_0xfe86c4,_0x3555a3['error'][_0x92f7('0x13')]);return _0x54f69c(_0x3555a3[_0x92f7('0x11')][_0x92f7('0x13')]);}logger[_0x92f7('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0xfe86c4,_0x3555a3[_0x92f7('0x11')]['message']);return _0x3e927e(_0x3555a3[_0x92f7('0x11')][_0x92f7('0x13')]);}else{logger['info'](_0x92f7('0xd'),_0xfe86c4,_0x92f7('0xe'));_0x3e927e(_0x3555a3['result']['message']);}})[_0x92f7('0x14')](function(_0x1ca4d5){logger[_0x92f7('0x11')](_0x92f7('0xd'),_0xfe86c4,_0x1ca4d5);_0x54f69c(_0x1ca4d5);});});} \ No newline at end of file +var _0x04a8=['../../config/logger','rpc','jayson/promise','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0x04a8,0x7f));var _0x804a=function(_0x3e4712,_0x4b6097){_0x3e4712=_0x3e4712-0x0;var _0x34fc16=_0x04a8[_0x3e4712];return _0x34fc16;};'use strict';var _=require('lodash');var util=require(_0x804a('0x0'));var moment=require(_0x804a('0x1'));var BPromise=require('bluebird');var rs=require(_0x804a('0x2'));var fs=require('fs');var Redis=require(_0x804a('0x3'));var db=require(_0x804a('0x4'))['db'];var utils=require(_0x804a('0x5'));var logger=require(_0x804a('0x6'))(_0x804a('0x7'));var config=require('../../config/environment');var jayson=require(_0x804a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd9ae25,_0x27e93a,_0x1f1dfb){return new BPromise(function(_0x5cc38c,_0x336d21){return client['request'](_0xd9ae25,_0x1f1dfb)['then'](function(_0x33ef17){logger[_0x804a('0x9')](_0x804a('0xa'),_0x27e93a,_0x804a('0xb'));logger[_0x804a('0xc')](_0x804a('0xd'),_0x27e93a,_0x804a('0xb'),JSON[_0x804a('0xe')](_0x33ef17));if(_0x33ef17[_0x804a('0xf')]){if(_0x33ef17['error'][_0x804a('0x10')]===0x1f4){logger['error'](_0x804a('0xa'),_0x27e93a,_0x33ef17[_0x804a('0xf')][_0x804a('0x11')]);return _0x336d21(_0x33ef17[_0x804a('0xf')]['message']);}logger[_0x804a('0xf')](_0x804a('0xa'),_0x27e93a,_0x33ef17[_0x804a('0xf')][_0x804a('0x11')]);return _0x5cc38c(_0x33ef17[_0x804a('0xf')][_0x804a('0x11')]);}else{logger[_0x804a('0x9')](_0x804a('0xa'),_0x27e93a,_0x804a('0xb'));_0x5cc38c(_0x33ef17[_0x804a('0x12')][_0x804a('0x11')]);}})['catch'](function(_0x34f026){logger['error'](_0x804a('0xa'),_0x27e93a,_0x34f026);_0x336d21(_0x34f026);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index a23763e..92a45be 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 _0x03b3=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy'];(function(_0x15d3e8,_0x4fe61d){var _0x414ed0=function(_0x472dd4){while(--_0x472dd4){_0x15d3e8['push'](_0x15d3e8['shift']());}};_0x414ed0(++_0x4fe61d);}(_0x03b3,0x17d));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x303b('0x0'));var util=require(_0x303b('0x1'));var path=require(_0x303b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x303b('0x3'));var auth=require(_0x303b('0x4'));var interaction=require(_0x303b('0x5'));var config=require(_0x303b('0x6'));var controller=require(_0x303b('0x7'));router['get']('/',auth[_0x303b('0x8')](),controller[_0x303b('0x9')]);router[_0x303b('0xa')]('/:id',auth[_0x303b('0x8')](),controller[_0x303b('0xb')]);router[_0x303b('0xc')]('/',auth[_0x303b('0x8')](),controller['create']);router[_0x303b('0xd')](_0x303b('0xe'),auth[_0x303b('0x8')](),controller[_0x303b('0xf')]);router[_0x303b('0x10')](_0x303b('0xe'),auth[_0x303b('0x8')](),controller[_0x303b('0x11')]);module[_0x303b('0x12')]=router; \ No newline at end of file +var _0x1811=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32dcf9,_0x87c30b){var _0x216bb5=function(_0x1e60b3){while(--_0x1e60b3){_0x32dcf9['push'](_0x32dcf9['shift']());}};_0x216bb5(++_0x87c30b);}(_0x1811,0x77));var _0x1181=function(_0xc8a598,_0x8ffd7c){_0xc8a598=_0xc8a598-0x0;var _0x2a6225=_0x1811[_0xc8a598];return _0x2a6225;};'use strict';var multer=require(_0x1181('0x0'));var util=require(_0x1181('0x1'));var path=require(_0x1181('0x2'));var timeout=require('connect-timeout');var express=require(_0x1181('0x3'));var router=express['Router']();var fs_extra=require(_0x1181('0x4'));var auth=require(_0x1181('0x5'));var interaction=require(_0x1181('0x6'));var config=require(_0x1181('0x7'));var controller=require(_0x1181('0x8'));router[_0x1181('0x9')]('/',auth[_0x1181('0xa')](),controller['index']);router[_0x1181('0x9')](_0x1181('0xb'),auth[_0x1181('0xa')](),controller[_0x1181('0xc')]);router['post']('/',auth[_0x1181('0xa')](),controller[_0x1181('0xd')]);router[_0x1181('0xe')](_0x1181('0xb'),auth['isAuthenticated'](),controller[_0x1181('0xf')]);router[_0x1181('0x10')](_0x1181('0xb'),auth[_0x1181('0xa')](),controller[_0x1181('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 769be2a..bb30229 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 _0xb640=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x26dafd,_0x51f371){var _0x1e251d=function(_0x419c7c){while(--_0x419c7c){_0x26dafd['push'](_0x26dafd['shift']());}};_0x1e251d(++_0x51f371);}(_0xb640,0x10f));var _0x0b64=function(_0x1597b7,_0x167e43){_0x1597b7=_0x1597b7-0x0;var _0x56c0ed=_0xb640[_0x1597b7];return _0x56c0ed;};'use strict';var Sequelize=require(_0x0b64('0x0'));module[_0x0b64('0x1')]={'type':{'type':Sequelize[_0x0b64('0x2')](_0x0b64('0x3'),'variable',_0x0b64('0x4'),_0x0b64('0x5'),_0x0b64('0x6')),'defaultValue':_0x0b64('0x3')},'content':{'type':Sequelize[_0x0b64('0x7')]},'key':{'type':Sequelize[_0x0b64('0x7')]},'keyType':{'type':Sequelize[_0x0b64('0x2')](_0x0b64('0x3'),'variable',_0x0b64('0x4'))},'keyContent':{'type':Sequelize[_0x0b64('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0b64('0x7')]},'customField':{'type':Sequelize[_0x0b64('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0b64('0x7')]}}; \ No newline at end of file +var _0x9edc=['exports','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0x5284b8,_0x166d3f){var _0x143ab6=function(_0x40f296){while(--_0x40f296){_0x5284b8['push'](_0x5284b8['shift']());}};_0x143ab6(++_0x166d3f);}(_0x9edc,0x70));var _0xc9ed=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0x9edc[_0x22663b];return _0x310d0a;};'use strict';var Sequelize=require('sequelize');module[_0xc9ed('0x0')]={'type':{'type':Sequelize[_0xc9ed('0x1')](_0xc9ed('0x2'),_0xc9ed('0x3'),'customVariable','keyValue',_0xc9ed('0x4')),'defaultValue':_0xc9ed('0x2')},'content':{'type':Sequelize[_0xc9ed('0x5')]},'key':{'type':Sequelize[_0xc9ed('0x5')]},'keyType':{'type':Sequelize[_0xc9ed('0x1')](_0xc9ed('0x2'),'variable',_0xc9ed('0x6'))},'keyContent':{'type':Sequelize[_0xc9ed('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc9ed('0x5')]},'customField':{'type':Sequelize[_0xc9ed('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9ed('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 78b5cc3..9fd5e35 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 _0xa79b=['offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json'];(function(_0x136cbb,_0x2a97f9){var _0x333a69=function(_0x5dc5bb){while(--_0x5dc5bb){_0x136cbb['push'](_0x136cbb['shift']());}};_0x333a69(++_0x2a97f9);}(_0xa79b,0x1e5));var _0xba79=function(_0x4983ce,_0x13f756){_0x4983ce=_0x4983ce-0x0;var _0x2ad4c4=_0xa79b[_0x4983ce];return _0x2ad4c4;};'use strict';var emlformat=require(_0xba79('0x0'));var rimraf=require(_0xba79('0x1'));var zipdir=require(_0xba79('0x2'));var jsonpatch=require(_0xba79('0x3'));var rp=require(_0xba79('0x4'));var moment=require(_0xba79('0x5'));var BPromise=require(_0xba79('0x6'));var Mustache=require('mustache');var util=require(_0xba79('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xba79('0x8'));var ejs=require(_0xba79('0x9'));var fs=require('fs');var fs_extra=require(_0xba79('0xa'));var _=require(_0xba79('0xb'));var squel=require(_0xba79('0xc'));var crypto=require(_0xba79('0xd'));var jsforce=require(_0xba79('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xba79('0xf'));var Papa=require('papaparse');var Redis=require(_0xba79('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba79('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba79('0x12'));var logger=require(_0xba79('0x13'))(_0xba79('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba79('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cd2e1,_0x294b29){_0x294b29=_0x294b29||0xcc;return function(_0x190498){if(_0x190498){return _0x5cd2e1[_0xba79('0x16')](_0x294b29);}return _0x5cd2e1[_0xba79('0x17')](_0x294b29)[_0xba79('0x18')]();};}function respondWithResult(_0x14293f,_0x2f48a4){_0x2f48a4=_0x2f48a4||0xc8;return function(_0x4e97c5){if(_0x4e97c5){return _0x14293f[_0xba79('0x17')](_0x2f48a4)[_0xba79('0x19')](_0x4e97c5);}};}function respondWithFilteredResult(_0x553e4c,_0x212f3d){return function(_0xa8cf8b){if(_0xa8cf8b){var _0x20f9d8=typeof _0x212f3d[_0xba79('0x1a')]===_0xba79('0x1b')&&typeof _0x212f3d[_0xba79('0x1c')]===_0xba79('0x1b');var _0x20ec70=_0xa8cf8b[_0xba79('0x1d')];var _0x16c97a=_0x20f9d8?0x0:_0x212f3d[_0xba79('0x1a')];var _0x1f328d=_0x20f9d8?_0xa8cf8b[_0xba79('0x1d')]:_0x212f3d[_0xba79('0x1a')]+_0x212f3d[_0xba79('0x1c')];var _0x54bba3;if(_0x1f328d>=_0x20ec70){_0x1f328d=_0x20ec70;_0x54bba3=0xc8;}else{_0x54bba3=0xce;}_0x553e4c[_0xba79('0x17')](_0x54bba3);return _0x553e4c[_0xba79('0x1e')](_0xba79('0x1f'),_0x16c97a+'-'+_0x1f328d+'/'+_0x20ec70)[_0xba79('0x19')](_0xa8cf8b);}return null;};}function patchUpdates(_0x1e20db){return function(_0x506821){try{jsonpatch['apply'](_0x506821,_0x1e20db,!![]);}catch(_0x3c73a2){return BPromise[_0xba79('0x20')](_0x3c73a2);}return _0x506821[_0xba79('0x21')]();};}function saveUpdates(_0x23ab10,_0x315fdf){return function(_0x3391a9){if(_0x3391a9){return _0x3391a9[_0xba79('0x22')](_0x23ab10)['then'](function(_0x5e3977){return _0x5e3977;});}return null;};}function removeEntity(_0x3cad89,_0x509d2f){return function(_0x316292){if(_0x316292){return _0x316292[_0xba79('0x23')]()[_0xba79('0x24')](function(){_0x3cad89[_0xba79('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477757,_0x34d2fa){return function(_0x47dab7){if(!_0x47dab7){_0x477757[_0xba79('0x16')](0x194);}return _0x47dab7;};}function handleError(_0x25102d,_0xfd758b){_0xfd758b=_0xfd758b||0x1f4;return function(_0x4fc0c4){logger[_0xba79('0x25')](_0x4fc0c4[_0xba79('0x26')]);if(_0x4fc0c4[_0xba79('0x27')]){delete _0x4fc0c4[_0xba79('0x27')];}_0x25102d[_0xba79('0x17')](_0xfd758b)[_0xba79('0x28')](_0x4fc0c4);};}exports[_0xba79('0x29')]=function(_0x38d643,_0x13936d){var _0x4c3bec={},_0x23d068={},_0x45a3d8={'count':0x0,'rows':[]};var _0xc80e28=_[_0xba79('0x2a')](db[_0xba79('0x2b')][_0xba79('0x2c')],function(_0x594f93){return{'name':_0x594f93[_0xba79('0x2d')],'type':_0x594f93[_0xba79('0x2e')][_0xba79('0x2f')]};});_0x23d068['model']=_['map'](_0xc80e28,_0xba79('0x27'));_0x23d068[_0xba79('0x30')]=_['keys'](_0x38d643[_0xba79('0x30')]);_0x23d068[_0xba79('0x31')]=_[_0xba79('0x32')](_0x23d068[_0xba79('0x33')],_0x23d068[_0xba79('0x30')]);_0x4c3bec[_0xba79('0x34')]=_['intersection'](_0x23d068['model'],qs[_0xba79('0x35')](_0x38d643['query'][_0xba79('0x35')]));_0x4c3bec['attributes']=_0x4c3bec[_0xba79('0x34')][_0xba79('0x36')]?_0x4c3bec[_0xba79('0x34')]:_0x23d068[_0xba79('0x33')];if(!_0x38d643[_0xba79('0x30')][_0xba79('0x37')](_0xba79('0x38'))){_0x4c3bec['limit']=qs['limit'](_0x38d643['query']['limit']);_0x4c3bec[_0xba79('0x1a')]=qs[_0xba79('0x1a')](_0x38d643[_0xba79('0x30')]['offset']);}_0x4c3bec[_0xba79('0x39')]=qs[_0xba79('0x3a')](_0x38d643[_0xba79('0x30')][_0xba79('0x3a')]);_0x4c3bec[_0xba79('0x3b')]=qs['filters'](_['pick'](_0x38d643[_0xba79('0x30')],_0x23d068[_0xba79('0x31')]),_0xc80e28);if(_0x38d643['query'][_0xba79('0x3c')]){_0x4c3bec[_0xba79('0x3b')]=_[_0xba79('0x3d')](_0x4c3bec[_0xba79('0x3b')],{'$or':_[_0xba79('0x2a')](_0xc80e28,function(_0x4534bc){if(_0x4534bc[_0xba79('0x2e')]!==_0xba79('0x3e')){var _0x5b4d28={};_0x5b4d28[_0x4534bc['name']]={'$like':'%'+_0x38d643[_0xba79('0x30')][_0xba79('0x3c')]+'%'};return _0x5b4d28;}})});}_0x4c3bec=_[_0xba79('0x3d')]({},_0x4c3bec,_0x38d643[_0xba79('0x3f')]);var _0x2afb7f={'where':_0x4c3bec[_0xba79('0x3b')]};return db['Dynamics365Field'][_0xba79('0x1d')](_0x2afb7f)['then'](function(_0x4eff0a){_0x45a3d8[_0xba79('0x1d')]=_0x4eff0a;if(_0x38d643[_0xba79('0x30')][_0xba79('0x40')]){_0x4c3bec[_0xba79('0x41')]=[{'all':!![]}];}return db[_0xba79('0x2b')]['findAll'](_0x4c3bec);})[_0xba79('0x24')](function(_0xb5265c){_0x45a3d8[_0xba79('0x42')]=_0xb5265c;return _0x45a3d8;})[_0xba79('0x24')](respondWithFilteredResult(_0x13936d,_0x4c3bec))[_0xba79('0x43')](handleError(_0x13936d,null));};exports[_0xba79('0x44')]=function(_0x45ecdd,_0xd6109c){var _0x45350a={'raw':!![],'where':{'id':_0x45ecdd[_0xba79('0x45')]['id']}},_0x1678de={};_0x1678de['model']=_[_0xba79('0x46')](db[_0xba79('0x2b')][_0xba79('0x2c')]);_0x1678de['query']=_[_0xba79('0x46')](_0x45ecdd[_0xba79('0x30')]);_0x1678de[_0xba79('0x31')]=_['intersection'](_0x1678de[_0xba79('0x33')],_0x1678de['query']);_0x45350a[_0xba79('0x34')]=_['intersection'](_0x1678de['model'],qs[_0xba79('0x35')](_0x45ecdd[_0xba79('0x30')][_0xba79('0x35')]));_0x45350a[_0xba79('0x34')]=_0x45350a[_0xba79('0x34')]['length']?_0x45350a[_0xba79('0x34')]:_0x1678de['model'];if(_0x45ecdd[_0xba79('0x30')]['includeAll']){_0x45350a[_0xba79('0x41')]=[{'all':!![]}];}_0x45350a=_['merge']({},_0x45350a,_0x45ecdd[_0xba79('0x3f')]);return db['Dynamics365Field'][_0xba79('0x47')](_0x45350a)['then'](handleEntityNotFound(_0xd6109c,null))[_0xba79('0x24')](respondWithResult(_0xd6109c,null))[_0xba79('0x43')](handleError(_0xd6109c,null));};exports['create']=function(_0x4e70d7,_0x358b0d){return db[_0xba79('0x2b')][_0xba79('0x48')](_0x4e70d7['body'],{})[_0xba79('0x24')](respondWithResult(_0x358b0d,0xc9))[_0xba79('0x43')](handleError(_0x358b0d,null));};exports[_0xba79('0x22')]=function(_0x2fcf58,_0xb26337){if(_0x2fcf58['body']['id']){delete _0x2fcf58['body']['id'];}return db['Dynamics365Field'][_0xba79('0x47')]({'where':{'id':_0x2fcf58[_0xba79('0x45')]['id']}})[_0xba79('0x24')](handleEntityNotFound(_0xb26337,null))[_0xba79('0x24')](saveUpdates(_0x2fcf58['body'],null))['then'](respondWithResult(_0xb26337,null))['catch'](handleError(_0xb26337,null));};exports[_0xba79('0x23')]=function(_0x5f52b6,_0x11e3b7){return db[_0xba79('0x2b')][_0xba79('0x47')]({'where':{'id':_0x5f52b6[_0xba79('0x45')]['id']}})[_0xba79('0x24')](handleEntityNotFound(_0x11e3b7,null))['then'](removeEntity(_0x11e3b7,null))[_0xba79('0x43')](handleError(_0x11e3b7,null));}; \ No newline at end of file +var _0xa0fb=['limit','status','Content-Range','reject','save','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count'];(function(_0x5a57a2,_0x1a801b){var _0x1986c7=function(_0x1d7720){while(--_0x1d7720){_0x5a57a2['push'](_0x5a57a2['shift']());}};_0x1986c7(++_0x1a801b);}(_0xa0fb,0xbe));var _0xba0f=function(_0x5e16ae,_0x1e8fcd){_0x5e16ae=_0x5e16ae-0x0;var _0x9e651c=_0xa0fb[_0x5e16ae];return _0x9e651c;};'use strict';var emlformat=require(_0xba0f('0x0'));var rimraf=require(_0xba0f('0x1'));var zipdir=require(_0xba0f('0x2'));var jsonpatch=require(_0xba0f('0x3'));var rp=require(_0xba0f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba0f('0x5'));var path=require(_0xba0f('0x6'));var sox=require('sox');var csv=require(_0xba0f('0x7'));var ejs=require(_0xba0f('0x8'));var fs=require('fs');var fs_extra=require(_0xba0f('0x9'));var _=require(_0xba0f('0xa'));var squel=require(_0xba0f('0xb'));var crypto=require(_0xba0f('0xc'));var jsforce=require(_0xba0f('0xd'));var deskjs=require(_0xba0f('0xe'));var toCsv=require(_0xba0f('0x7'));var querystring=require(_0xba0f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xba0f('0x10'));var hardwareService=require(_0xba0f('0x11'));var logger=require(_0xba0f('0x12'))('api');var utils=require(_0xba0f('0x13'));var config=require(_0xba0f('0x14'));var licenseUtil=require(_0xba0f('0x15'));var db=require(_0xba0f('0x16'))['db'];function respondWithStatusCode(_0x15eecf,_0x2efec6){_0x2efec6=_0x2efec6||0xcc;return function(_0x587f12){if(_0x587f12){return _0x15eecf[_0xba0f('0x17')](_0x2efec6);}return _0x15eecf['status'](_0x2efec6)[_0xba0f('0x18')]();};}function respondWithResult(_0x31eeda,_0x566502){_0x566502=_0x566502||0xc8;return function(_0x59a32c){if(_0x59a32c){return _0x31eeda['status'](_0x566502)[_0xba0f('0x19')](_0x59a32c);}};}function respondWithFilteredResult(_0x4352c4,_0x28331a){return function(_0x3cfc24){if(_0x3cfc24){var _0x547e6f=typeof _0x28331a[_0xba0f('0x1a')]==='undefined'&&typeof _0x28331a['limit']===_0xba0f('0x1b');var _0x312db6=_0x3cfc24[_0xba0f('0x1c')];var _0x59d122=_0x547e6f?0x0:_0x28331a[_0xba0f('0x1a')];var _0xa79781=_0x547e6f?_0x3cfc24['count']:_0x28331a[_0xba0f('0x1a')]+_0x28331a[_0xba0f('0x1d')];var _0x30bf49;if(_0xa79781>=_0x312db6){_0xa79781=_0x312db6;_0x30bf49=0xc8;}else{_0x30bf49=0xce;}_0x4352c4[_0xba0f('0x1e')](_0x30bf49);return _0x4352c4['set'](_0xba0f('0x1f'),_0x59d122+'-'+_0xa79781+'/'+_0x312db6)[_0xba0f('0x19')](_0x3cfc24);}return null;};}function patchUpdates(_0x24a6cc){return function(_0x1de958){try{jsonpatch['apply'](_0x1de958,_0x24a6cc,!![]);}catch(_0x2030b1){return BPromise[_0xba0f('0x20')](_0x2030b1);}return _0x1de958[_0xba0f('0x21')]();};}function saveUpdates(_0x1e5364,_0x2618c6){return function(_0x2ec51e){if(_0x2ec51e){return _0x2ec51e['update'](_0x1e5364)[_0xba0f('0x22')](function(_0x150800){return _0x150800;});}return null;};}function removeEntity(_0x4d6f09,_0x10db55){return function(_0x4b3a22){if(_0x4b3a22){return _0x4b3a22[_0xba0f('0x23')]()[_0xba0f('0x22')](function(){_0x4d6f09[_0xba0f('0x1e')](0xcc)[_0xba0f('0x18')]();});}};}function handleEntityNotFound(_0x4f1371,_0x4bf65a){return function(_0x358249){if(!_0x358249){_0x4f1371[_0xba0f('0x17')](0x194);}return _0x358249;};}function handleError(_0x171b8a,_0x5af648){_0x5af648=_0x5af648||0x1f4;return function(_0x54d498){logger[_0xba0f('0x24')](_0x54d498[_0xba0f('0x25')]);if(_0x54d498['name']){delete _0x54d498[_0xba0f('0x26')];}_0x171b8a[_0xba0f('0x1e')](_0x5af648)['send'](_0x54d498);};}exports[_0xba0f('0x27')]=function(_0x5ee2e5,_0x2ac2d7){var _0x441f93={},_0x53cd4f={},_0x3a0df1={'count':0x0,'rows':[]};var _0x2d7186=_['map'](db['Dynamics365Field'][_0xba0f('0x28')],function(_0x1f3a38){return{'name':_0x1f3a38[_0xba0f('0x29')],'type':_0x1f3a38['type'][_0xba0f('0x2a')]};});_0x53cd4f['model']=_['map'](_0x2d7186,_0xba0f('0x26'));_0x53cd4f[_0xba0f('0x2b')]=_['keys'](_0x5ee2e5[_0xba0f('0x2b')]);_0x53cd4f[_0xba0f('0x2c')]=_[_0xba0f('0x2d')](_0x53cd4f[_0xba0f('0x2e')],_0x53cd4f[_0xba0f('0x2b')]);_0x441f93[_0xba0f('0x2f')]=_[_0xba0f('0x2d')](_0x53cd4f['model'],qs[_0xba0f('0x30')](_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x30')]));_0x441f93['attributes']=_0x441f93[_0xba0f('0x2f')][_0xba0f('0x31')]?_0x441f93['attributes']:_0x53cd4f[_0xba0f('0x2e')];if(!_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x32')]('nolimit')){_0x441f93[_0xba0f('0x1d')]=qs['limit'](_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x1d')]);_0x441f93[_0xba0f('0x1a')]=qs[_0xba0f('0x1a')](_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x1a')]);}_0x441f93[_0xba0f('0x33')]=qs[_0xba0f('0x34')](_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x34')]);_0x441f93[_0xba0f('0x35')]=qs[_0xba0f('0x2c')](_[_0xba0f('0x36')](_0x5ee2e5['query'],_0x53cd4f[_0xba0f('0x2c')]),_0x2d7186);if(_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x37')]){_0x441f93['where']=_[_0xba0f('0x38')](_0x441f93[_0xba0f('0x35')],{'$or':_[_0xba0f('0x39')](_0x2d7186,function(_0x246a2c){if(_0x246a2c[_0xba0f('0x3a')]!==_0xba0f('0x3b')){var _0xf9c9a9={};_0xf9c9a9[_0x246a2c[_0xba0f('0x26')]]={'$like':'%'+_0x5ee2e5[_0xba0f('0x2b')][_0xba0f('0x37')]+'%'};return _0xf9c9a9;}})});}_0x441f93=_['merge']({},_0x441f93,_0x5ee2e5[_0xba0f('0x3c')]);var _0x53424f={'where':_0x441f93['where']};return db[_0xba0f('0x3d')][_0xba0f('0x1c')](_0x53424f)[_0xba0f('0x22')](function(_0x596a5b){_0x3a0df1['count']=_0x596a5b;if(_0x5ee2e5['query'][_0xba0f('0x3e')]){_0x441f93['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xba0f('0x3f')](_0x441f93);})[_0xba0f('0x22')](function(_0x170f1f){_0x3a0df1[_0xba0f('0x40')]=_0x170f1f;return _0x3a0df1;})[_0xba0f('0x22')](respondWithFilteredResult(_0x2ac2d7,_0x441f93))[_0xba0f('0x41')](handleError(_0x2ac2d7,null));};exports[_0xba0f('0x42')]=function(_0x4bfdcf,_0xd17383){var _0x32f0c9={'raw':!![],'where':{'id':_0x4bfdcf[_0xba0f('0x43')]['id']}},_0x45884e={};_0x45884e['model']=_[_0xba0f('0x44')](db['Dynamics365Field']['rawAttributes']);_0x45884e[_0xba0f('0x2b')]=_[_0xba0f('0x44')](_0x4bfdcf[_0xba0f('0x2b')]);_0x45884e[_0xba0f('0x2c')]=_[_0xba0f('0x2d')](_0x45884e['model'],_0x45884e[_0xba0f('0x2b')]);_0x32f0c9[_0xba0f('0x2f')]=_[_0xba0f('0x2d')](_0x45884e[_0xba0f('0x2e')],qs['fields'](_0x4bfdcf[_0xba0f('0x2b')]['fields']));_0x32f0c9[_0xba0f('0x2f')]=_0x32f0c9[_0xba0f('0x2f')][_0xba0f('0x31')]?_0x32f0c9['attributes']:_0x45884e[_0xba0f('0x2e')];if(_0x4bfdcf[_0xba0f('0x2b')][_0xba0f('0x3e')]){_0x32f0c9['include']=[{'all':!![]}];}_0x32f0c9=_[_0xba0f('0x38')]({},_0x32f0c9,_0x4bfdcf['options']);return db[_0xba0f('0x3d')][_0xba0f('0x45')](_0x32f0c9)[_0xba0f('0x22')](handleEntityNotFound(_0xd17383,null))[_0xba0f('0x22')](respondWithResult(_0xd17383,null))[_0xba0f('0x41')](handleError(_0xd17383,null));};exports[_0xba0f('0x46')]=function(_0xa3756f,_0x2a8672){return db[_0xba0f('0x3d')]['create'](_0xa3756f[_0xba0f('0x47')],{})[_0xba0f('0x22')](respondWithResult(_0x2a8672,0xc9))[_0xba0f('0x41')](handleError(_0x2a8672,null));};exports[_0xba0f('0x48')]=function(_0x6f14c9,_0x457f26){if(_0x6f14c9[_0xba0f('0x47')]['id']){delete _0x6f14c9[_0xba0f('0x47')]['id'];}return db[_0xba0f('0x3d')][_0xba0f('0x45')]({'where':{'id':_0x6f14c9['params']['id']}})[_0xba0f('0x22')](handleEntityNotFound(_0x457f26,null))[_0xba0f('0x22')](saveUpdates(_0x6f14c9[_0xba0f('0x47')],null))['then'](respondWithResult(_0x457f26,null))['catch'](handleError(_0x457f26,null));};exports[_0xba0f('0x23')]=function(_0x549e64,_0x22eee9){return db[_0xba0f('0x3d')][_0xba0f('0x45')]({'where':{'id':_0x549e64[_0xba0f('0x43')]['id']}})[_0xba0f('0x22')](handleEntityNotFound(_0x22eee9,null))['then'](removeEntity(_0x22eee9,null))[_0xba0f('0x41')](handleError(_0x22eee9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 41bfea9..a740f32 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 _0x83fe=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x53c552,_0x129587){var _0x599000=function(_0x519b95){while(--_0x519b95){_0x53c552['push'](_0x53c552['shift']());}};_0x599000(++_0x129587);}(_0x83fe,0x1c2));var _0xe83f=function(_0x1a910b,_0x1d0c67){_0x1a910b=_0x1a910b-0x0;var _0x58b72b=_0x83fe[_0x1a910b];return _0x58b72b;};'use strict';var _=require(_0xe83f('0x0'));var util=require(_0xe83f('0x1'));var logger=require(_0xe83f('0x2'))(_0xe83f('0x3'));var moment=require('moment');var BPromise=require(_0xe83f('0x4'));var rp=require(_0xe83f('0x5'));var fs=require('fs');var path=require(_0xe83f('0x6'));var rimraf=require(_0xe83f('0x7'));var config=require(_0xe83f('0x8'));var attributes=require(_0xe83f('0x9'));module[_0xe83f('0xa')]=function(_0xc6bfb2,_0x26071a){return _0xc6bfb2['define']('Dynamics365Field',attributes,{'tableName':_0xe83f('0xb'),'paranoid':![],'indexes':[{'name':_0xe83f('0xc'),'fields':[_0xe83f('0xd'),_0xe83f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8477=['./intDynamics365Field.attributes','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x94b09c,_0x56dfe3){var _0x4fa56e=function(_0x1c325f){while(--_0x1c325f){_0x94b09c['push'](_0x94b09c['shift']());}};_0x4fa56e(++_0x56dfe3);}(_0x8477,0x101));var _0x7847=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x8477[_0x44afa4];return _0xcad289;};'use strict';var _=require(_0x7847('0x0'));var util=require(_0x7847('0x1'));var logger=require(_0x7847('0x2'))(_0x7847('0x3'));var moment=require(_0x7847('0x4'));var BPromise=require(_0x7847('0x5'));var rp=require(_0x7847('0x6'));var fs=require('fs');var path=require(_0x7847('0x7'));var rimraf=require('rimraf');var config=require(_0x7847('0x8'));var attributes=require(_0x7847('0x9'));module['exports']=function(_0x4de12f,_0x4e27bc){return _0x4de12f['define'](_0x7847('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7847('0xb'),'fields':[_0x7847('0xc'),_0x7847('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index a262997..04b0197 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 _0x29d6=['request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x29d6,0x10b));var _0x629d=function(_0x325eab,_0x20ea37){_0x325eab=_0x325eab-0x0;var _0x2c46dd=_0x29d6[_0x325eab];return _0x2c46dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x629d('0x0'));var BPromise=require(_0x629d('0x1'));var rs=require(_0x629d('0x2'));var fs=require('fs');var Redis=require(_0x629d('0x3'));var db=require(_0x629d('0x4'))['db'];var utils=require(_0x629d('0x5'));var logger=require(_0x629d('0x6'))('rpc');var config=require(_0x629d('0x7'));var jayson=require(_0x629d('0x8'));var client=jayson[_0x629d('0x9')][_0x629d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bc542,_0x5a4eb8,_0x39ff4b){return new BPromise(function(_0x42e0c5,_0x467459){return client[_0x629d('0xb')](_0x4bc542,_0x39ff4b)[_0x629d('0xc')](function(_0x36c34a){logger[_0x629d('0xd')](_0x629d('0xe'),_0x5a4eb8,'request\x20sent');logger[_0x629d('0xf')](_0x629d('0x10'),_0x5a4eb8,'request\x20sent',JSON[_0x629d('0x11')](_0x36c34a));if(_0x36c34a[_0x629d('0x12')]){if(_0x36c34a[_0x629d('0x12')][_0x629d('0x13')]===0x1f4){logger[_0x629d('0x12')](_0x629d('0xe'),_0x5a4eb8,_0x36c34a[_0x629d('0x12')]['message']);return _0x467459(_0x36c34a[_0x629d('0x12')][_0x629d('0x14')]);}logger[_0x629d('0x12')](_0x629d('0xe'),_0x5a4eb8,_0x36c34a['error'][_0x629d('0x14')]);return _0x42e0c5(_0x36c34a[_0x629d('0x12')][_0x629d('0x14')]);}else{logger[_0x629d('0xd')](_0x629d('0xe'),_0x5a4eb8,_0x629d('0x15'));_0x42e0c5(_0x36c34a[_0x629d('0x16')][_0x629d('0x14')]);}})[_0x629d('0x17')](function(_0x78dc24){logger[_0x629d('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5a4eb8,_0x78dc24);_0x467459(_0x78dc24);});});} \ No newline at end of file +var _0x150c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1a654e,_0x28fbaf){var _0x31f4df=function(_0x494e3f){while(--_0x494e3f){_0x1a654e['push'](_0x1a654e['shift']());}};_0x31f4df(++_0x28fbaf);}(_0x150c,0x187));var _0xc150=function(_0x455953,_0x2ee57d){_0x455953=_0x455953-0x0;var _0x2d7d6b=_0x150c[_0x455953];return _0x2d7d6b;};'use strict';var _=require(_0xc150('0x0'));var util=require(_0xc150('0x1'));var moment=require(_0xc150('0x2'));var BPromise=require(_0xc150('0x3'));var rs=require(_0xc150('0x4'));var fs=require('fs');var Redis=require(_0xc150('0x5'));var db=require(_0xc150('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc150('0x7'))(_0xc150('0x8'));var config=require(_0xc150('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc150('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x295098,_0x4c0858,_0x1a4842){return new BPromise(function(_0x5e6e8e,_0x130c29){return client[_0xc150('0xb')](_0x295098,_0x1a4842)[_0xc150('0xc')](function(_0x58414e){logger[_0xc150('0xd')](_0xc150('0xe'),_0x4c0858,_0xc150('0xf'));logger[_0xc150('0x10')](_0xc150('0x11'),_0x4c0858,'request\x20sent',JSON[_0xc150('0x12')](_0x58414e));if(_0x58414e[_0xc150('0x13')]){if(_0x58414e[_0xc150('0x13')]['code']===0x1f4){logger[_0xc150('0x13')](_0xc150('0xe'),_0x4c0858,_0x58414e[_0xc150('0x13')]['message']);return _0x130c29(_0x58414e[_0xc150('0x13')][_0xc150('0x14')]);}logger['error'](_0xc150('0xe'),_0x4c0858,_0x58414e[_0xc150('0x13')][_0xc150('0x14')]);return _0x5e6e8e(_0x58414e['error'][_0xc150('0x14')]);}else{logger[_0xc150('0xd')](_0xc150('0xe'),_0x4c0858,'request\x20sent');_0x5e6e8e(_0x58414e[_0xc150('0x15')][_0xc150('0x14')]);}})[_0xc150('0x16')](function(_0x53b1a2){logger[_0xc150('0x13')](_0xc150('0xe'),_0x4c0858,_0x53b1a2);_0x130c29(_0x53b1a2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index a7aa3d4..e2da351 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 _0x6c3a=['../../config/environment','get','index','/:id','isAuthenticated','show','getConfigurations','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','../../components/interaction/service'];(function(_0x675708,_0x2a9a4e){var _0x1ac7e5=function(_0x15ce7f){while(--_0x15ce7f){_0x675708['push'](_0x675708['shift']());}};_0x1ac7e5(++_0x2a9a4e);}(_0x6c3a,0x1f4));var _0xa6c3=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x6c3a[_0x5a27e8];return _0x4e38f7;};'use strict';var multer=require(_0xa6c3('0x0'));var util=require(_0xa6c3('0x1'));var path=require(_0xa6c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa6c3('0x3'));var config=require(_0xa6c3('0x4'));var controller=require('./intFreshdeskAccount.controller');router[_0xa6c3('0x5')]('/',auth['isAuthenticated'](),controller[_0xa6c3('0x6')]);router[_0xa6c3('0x5')](_0xa6c3('0x7'),auth[_0xa6c3('0x8')](),controller[_0xa6c3('0x9')]);router[_0xa6c3('0x5')]('/:id/configurations',auth[_0xa6c3('0x8')](),controller[_0xa6c3('0xa')]);router[_0xa6c3('0x5')]('/:id/fields',auth[_0xa6c3('0x8')](),controller['getFields']);router[_0xa6c3('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0xa6c3('0x8')](),controller[_0xa6c3('0xc')]);router[_0xa6c3('0xd')]('/:id',auth[_0xa6c3('0x8')](),controller[_0xa6c3('0xe')]);router[_0xa6c3('0xf')](_0xa6c3('0x7'),auth[_0xa6c3('0x8')](),controller[_0xa6c3('0x10')]);module[_0xa6c3('0x11')]=router; \ No newline at end of file +var _0xd9ba=['index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','path','connect-timeout','express','./intFreshdeskAccount.controller','isAuthenticated'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0xd9ba,0x1b3));var _0xad9b=function(_0x52b304,_0x494fd8){_0x52b304=_0x52b304-0x0;var _0x546aba=_0xd9ba[_0x52b304];return _0x546aba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad9b('0x0'));var timeout=require(_0xad9b('0x1'));var express=require(_0xad9b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad9b('0x3'));router['get']('/',auth[_0xad9b('0x4')](),controller[_0xad9b('0x5')]);router['get'](_0xad9b('0x6'),auth[_0xad9b('0x4')](),controller[_0xad9b('0x7')]);router[_0xad9b('0x8')](_0xad9b('0x9'),auth[_0xad9b('0x4')](),controller[_0xad9b('0xa')]);router['get'](_0xad9b('0xb'),auth[_0xad9b('0x4')](),controller[_0xad9b('0xc')]);router[_0xad9b('0xd')]('/',auth[_0xad9b('0x4')](),controller[_0xad9b('0xe')]);router[_0xad9b('0xd')](_0xad9b('0x9'),auth[_0xad9b('0x4')](),controller[_0xad9b('0xf')]);router[_0xad9b('0x10')](_0xad9b('0x6'),auth[_0xad9b('0x4')](),controller[_0xad9b('0x11')]);router[_0xad9b('0x12')](_0xad9b('0x6'),auth[_0xad9b('0x4')](),controller['destroy']);module[_0xad9b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0537a3c..1881410 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 _0xda2d=['exports','STRING','username'];(function(_0x53597f,_0x3156fd){var _0x535f67=function(_0x3df7ce){while(--_0x3df7ce){_0x53597f['push'](_0x53597f['shift']());}};_0x535f67(++_0x3156fd);}(_0xda2d,0x102));var _0xdda2=function(_0x10622e,_0x50121c){_0x10622e=_0x10622e-0x0;var _0x10840=_0xda2d[_0x10622e];return _0x10840;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['username','remoteUri','sequelize','exports','STRING'];(function(_0x5a4c20,_0x5e1714){var _0x17bce2=function(_0x2a79fb){while(--_0x2a79fb){_0x5a4c20['push'](_0x5a4c20['shift']());}};_0x17bce2(++_0x5e1714);}(_0xdb28,0x106));var _0x8db2=function(_0x15eed1,_0x498339){_0x15eed1=_0x15eed1-0x0;var _0x4f2798=_0xdb28[_0x15eed1];return _0x4f2798;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'name':{'type':Sequelize[_0x8db2('0x2')]},'description':{'type':Sequelize[_0x8db2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8db2('0x3')},'apiKey':{'type':Sequelize[_0x8db2('0x2')]},'remoteUri':{'type':Sequelize[_0x8db2('0x2')],'unique':_0x8db2('0x4')},'serverUrl':{'type':Sequelize[_0x8db2('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 a7b1a01..52f8f6b 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 _0x5668=['%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','priority','source','group','company','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','include','FreshdeskAccount','findAll','rows','show','params','includeAll','options','catch','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format'];(function(_0xf88e85,_0x1b3355){var _0x5b6d3c=function(_0x1242f1){while(--_0x1242f1){_0xf88e85['push'](_0xf88e85['shift']());}};_0x5b6d3c(++_0x1b3355);}(_0x5668,0x8b));var _0x8566=function(_0x1c35f0,_0x1e3177){_0x1c35f0=_0x1c35f0-0x0;var _0x3b71e1=_0x5668[_0x1c35f0];return _0x3b71e1;};'use strict';var emlformat=require(_0x8566('0x0'));var rimraf=require(_0x8566('0x1'));var zipdir=require(_0x8566('0x2'));var jsonpatch=require(_0x8566('0x3'));var rp=require(_0x8566('0x4'));var moment=require(_0x8566('0x5'));var BPromise=require(_0x8566('0x6'));var Mustache=require(_0x8566('0x7'));var util=require(_0x8566('0x8'));var path=require(_0x8566('0x9'));var sox=require(_0x8566('0xa'));var csv=require(_0x8566('0xb'));var ejs=require(_0x8566('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8566('0xd'));var squel=require(_0x8566('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8566('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8566('0x10'));var Redis=require('ioredis');var authService=require(_0x8566('0x11'));var qs=require(_0x8566('0x12'));var as=require(_0x8566('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8566('0x14'))(_0x8566('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x8566('0x16'));function respondWithStatusCode(_0x3318a3,_0x2025a2){_0x2025a2=_0x2025a2||0xcc;return function(_0x2cb841){if(_0x2cb841){return _0x3318a3[_0x8566('0x17')](_0x2025a2);}return _0x3318a3['status'](_0x2025a2)['end']();};}function respondWithResult(_0x47bef1,_0x489470){_0x489470=_0x489470||0xc8;return function(_0x56ebd9){if(_0x56ebd9){return _0x47bef1[_0x8566('0x18')](_0x489470)[_0x8566('0x19')](_0x56ebd9);}};}function respondWithFilteredResult(_0x3076df,_0x396f1b){return function(_0x39faee){if(_0x39faee){var _0x4b777d=typeof _0x396f1b[_0x8566('0x1a')]===_0x8566('0x1b')&&typeof _0x396f1b[_0x8566('0x1c')]==='undefined';var _0xba1367=_0x39faee[_0x8566('0x1d')];var _0x2eed85=_0x4b777d?0x0:_0x396f1b['offset'];var _0x41cb27=_0x4b777d?_0x39faee['count']:_0x396f1b['offset']+_0x396f1b[_0x8566('0x1c')];var _0x5e9ca7;if(_0x41cb27>=_0xba1367){_0x41cb27=_0xba1367;_0x5e9ca7=0xc8;}else{_0x5e9ca7=0xce;}_0x3076df[_0x8566('0x18')](_0x5e9ca7);return _0x3076df['set'](_0x8566('0x1e'),_0x2eed85+'-'+_0x41cb27+'/'+_0xba1367)[_0x8566('0x19')](_0x39faee);}return null;};}function patchUpdates(_0x43fc7c){return function(_0x17fdb4){try{jsonpatch[_0x8566('0x1f')](_0x17fdb4,_0x43fc7c,!![]);}catch(_0x440d2d){return BPromise[_0x8566('0x20')](_0x440d2d);}return _0x17fdb4['save']();};}function saveUpdates(_0x5b06e6,_0x3d2cf8){return function(_0x1ccc60){if(_0x1ccc60){return _0x1ccc60[_0x8566('0x21')](_0x5b06e6)[_0x8566('0x22')](function(_0x4e19cf){return _0x4e19cf;});}return null;};}function removeEntity(_0x183435,_0x64127b){return function(_0x57cc9d){if(_0x57cc9d){return _0x57cc9d[_0x8566('0x23')]()[_0x8566('0x22')](function(){_0x183435['status'](0xcc)[_0x8566('0x24')]();});}};}function handleEntityNotFound(_0xf4a090,_0x18ee17){return function(_0x4d0e60){if(!_0x4d0e60){_0xf4a090[_0x8566('0x17')](0x194);}return _0x4d0e60;};}function handleError(_0x451bbf,_0x327f7d){_0x327f7d=_0x327f7d||0x1f4;return function(_0x3e90af){logger[_0x8566('0x25')](_0x3e90af[_0x8566('0x26')]);if(_0x3e90af[_0x8566('0x27')]){delete _0x3e90af['name'];}_0x451bbf[_0x8566('0x18')](_0x327f7d)[_0x8566('0x28')](_0x3e90af);};}exports[_0x8566('0x29')]=function(_0x8a1dff,_0xea61c9){var _0x3a3106={},_0x1e4e05={},_0x8637b3={'count':0x0,'rows':[]};var _0x504722=_[_0x8566('0x2a')](db['FreshdeskAccount']['rawAttributes'],function(_0xae691c){return{'name':_0xae691c[_0x8566('0x2b')],'type':_0xae691c['type'][_0x8566('0x2c')]};});_0x1e4e05[_0x8566('0x2d')]=_[_0x8566('0x2a')](_0x504722,_0x8566('0x27'));_0x1e4e05[_0x8566('0x2e')]=_[_0x8566('0x2f')](_0x8a1dff['query']);_0x1e4e05['filters']=_[_0x8566('0x30')](_0x1e4e05[_0x8566('0x2d')],_0x1e4e05['query']);_0x3a3106[_0x8566('0x31')]=_['intersection'](_0x1e4e05[_0x8566('0x2d')],qs['fields'](_0x8a1dff[_0x8566('0x2e')][_0x8566('0x32')]));_0x3a3106['attributes']=_0x3a3106[_0x8566('0x31')][_0x8566('0x33')]?_0x3a3106[_0x8566('0x31')]:_0x1e4e05[_0x8566('0x2d')];if(!_0x8a1dff[_0x8566('0x2e')][_0x8566('0x34')](_0x8566('0x35'))){_0x3a3106[_0x8566('0x1c')]=qs['limit'](_0x8a1dff[_0x8566('0x2e')][_0x8566('0x1c')]);_0x3a3106[_0x8566('0x1a')]=qs['offset'](_0x8a1dff[_0x8566('0x2e')]['offset']);}_0x3a3106[_0x8566('0x36')]=qs[_0x8566('0x37')](_0x8a1dff[_0x8566('0x2e')][_0x8566('0x37')]);_0x3a3106[_0x8566('0x38')]=qs[_0x8566('0x39')](_[_0x8566('0x3a')](_0x8a1dff['query'],_0x1e4e05['filters']),_0x504722);if(_0x8a1dff[_0x8566('0x2e')]['filter']){_0x3a3106[_0x8566('0x38')]=_[_0x8566('0x3b')](_0x3a3106['where'],{'$or':_[_0x8566('0x2a')](_0x504722,function(_0x5a77b9){if(_0x5a77b9[_0x8566('0x3c')]!=='VIRTUAL'){var _0x2eb047={};_0x2eb047[_0x5a77b9[_0x8566('0x27')]]={'$like':'%'+_0x8a1dff['query'][_0x8566('0x3d')]+'%'};return _0x2eb047;}})});}_0x3a3106=_['merge']({},_0x3a3106,_0x8a1dff['options']);var _0x5a11d0={'where':_0x3a3106[_0x8566('0x38')]};return db['FreshdeskAccount'][_0x8566('0x1d')](_0x5a11d0)[_0x8566('0x22')](function(_0x2d84fa){_0x8637b3[_0x8566('0x1d')]=_0x2d84fa;if(_0x8a1dff[_0x8566('0x2e')]['includeAll']){_0x3a3106[_0x8566('0x3e')]=[{'all':!![]}];}return db[_0x8566('0x3f')][_0x8566('0x40')](_0x3a3106);})[_0x8566('0x22')](function(_0x10c77d){_0x8637b3[_0x8566('0x41')]=_0x10c77d;return _0x8637b3;})[_0x8566('0x22')](respondWithFilteredResult(_0xea61c9,_0x3a3106))['catch'](handleError(_0xea61c9,null));};exports[_0x8566('0x42')]=function(_0x1eb745,_0xd6e7fc){var _0x34336b={'raw':![],'where':{'id':_0x1eb745[_0x8566('0x43')]['id']}},_0x518c66={};_0x518c66['model']=_[_0x8566('0x2f')](db[_0x8566('0x3f')]['rawAttributes']);_0x518c66[_0x8566('0x2e')]=_['keys'](_0x1eb745[_0x8566('0x2e')]);_0x518c66['filters']=_[_0x8566('0x30')](_0x518c66[_0x8566('0x2d')],_0x518c66[_0x8566('0x2e')]);_0x34336b[_0x8566('0x31')]=_['intersection'](_0x518c66['model'],qs[_0x8566('0x32')](_0x1eb745[_0x8566('0x2e')][_0x8566('0x32')]));_0x34336b['attributes']=_0x34336b[_0x8566('0x31')][_0x8566('0x33')]?_0x34336b['attributes']:_0x518c66[_0x8566('0x2d')];if(_0x1eb745[_0x8566('0x2e')][_0x8566('0x44')]){_0x34336b[_0x8566('0x3e')]=[{'all':!![]}];}_0x34336b=_[_0x8566('0x3b')]({},_0x34336b,_0x1eb745[_0x8566('0x45')]);return db[_0x8566('0x3f')]['find'](_0x34336b)[_0x8566('0x22')](handleEntityNotFound(_0xd6e7fc,null))[_0x8566('0x22')](respondWithResult(_0xd6e7fc,null))[_0x8566('0x46')](handleError(_0xd6e7fc,null));};exports[_0x8566('0x47')]=function(_0x4a1ea1,_0x2bb7db){return db['FreshdeskAccount'][_0x8566('0x47')](_0x4a1ea1[_0x8566('0x48')],{})[_0x8566('0x22')](respondWithResult(_0x2bb7db,0xc9))[_0x8566('0x46')](handleError(_0x2bb7db,null));};exports[_0x8566('0x21')]=function(_0x58e580,_0x208a65){if(_0x58e580['body']['id']){delete _0x58e580['body']['id'];}return db[_0x8566('0x3f')][_0x8566('0x49')]({'where':{'id':_0x58e580[_0x8566('0x43')]['id']}})[_0x8566('0x22')](handleEntityNotFound(_0x208a65,null))[_0x8566('0x22')](saveUpdates(_0x58e580[_0x8566('0x48')],null))['then'](respondWithResult(_0x208a65,null))[_0x8566('0x46')](handleError(_0x208a65,null));};exports[_0x8566('0x23')]=function(_0x19b679,_0x3e53b4){return db[_0x8566('0x3f')][_0x8566('0x49')]({'where':{'id':_0x19b679[_0x8566('0x43')]['id']}})[_0x8566('0x22')](handleEntityNotFound(_0x3e53b4,null))[_0x8566('0x22')](removeEntity(_0x3e53b4,null))[_0x8566('0x46')](handleError(_0x3e53b4,null));};exports[_0x8566('0x4a')]=function(_0x4eb953,_0x3ed73e,_0x13ce7d){var _0x1f5f34={};var _0x707c01={};var _0x2e380a;var _0x4e771c;return db[_0x8566('0x3f')][_0x8566('0x4b')]({'where':{'id':_0x4eb953['params']['id']}})[_0x8566('0x22')](handleEntityNotFound(_0x3ed73e,null))[_0x8566('0x22')](function(_0x21ca63){if(_0x21ca63){_0x2e380a=_0x21ca63;_0x707c01[_0x8566('0x2d')]=_[_0x8566('0x2f')](db[_0x8566('0x4c')]['rawAttributes']);_0x707c01[_0x8566('0x2e')]=_[_0x8566('0x2f')](_0x4eb953[_0x8566('0x2e')]);_0x707c01['filters']=_[_0x8566('0x30')](_0x707c01[_0x8566('0x2d')],_0x707c01[_0x8566('0x2e')]);_0x1f5f34['attributes']=_['intersection'](_0x707c01[_0x8566('0x2d')],qs[_0x8566('0x32')](_0x4eb953[_0x8566('0x2e')][_0x8566('0x32')]));_0x1f5f34['attributes']=_0x1f5f34[_0x8566('0x31')][_0x8566('0x33')]?_0x1f5f34['attributes']:_0x707c01['model'];_0x1f5f34[_0x8566('0x36')]=qs[_0x8566('0x37')](_0x4eb953[_0x8566('0x2e')][_0x8566('0x37')]);_0x1f5f34[_0x8566('0x38')]=qs[_0x8566('0x39')](_[_0x8566('0x3a')](_0x4eb953[_0x8566('0x2e')],_0x707c01[_0x8566('0x39')]));if(_0x4eb953[_0x8566('0x2e')][_0x8566('0x3d')]){_0x1f5f34[_0x8566('0x38')]=_['merge'](_0x1f5f34[_0x8566('0x38')],{'$or':_[_0x8566('0x2a')](_0x1f5f34['attributes'],function(_0x3f9bf2){var _0x240665={};_0x240665[_0x3f9bf2]={'$like':'%'+_0x4eb953[_0x8566('0x2e')][_0x8566('0x3d')]+'%'};return _0x240665;})});}_0x1f5f34=_['merge']({},_0x1f5f34,_0x4eb953[_0x8566('0x45')]);return _0x2e380a['getConfigurations'](_0x1f5f34);}})['then'](function(_0x3f75f3){if(_0x3f75f3){_0x4e771c=_0x3f75f3['length'];if(!_0x4eb953['query'][_0x8566('0x34')]('nolimit')){_0x1f5f34[_0x8566('0x1c')]=qs[_0x8566('0x1c')](_0x4eb953[_0x8566('0x2e')]['limit']);_0x1f5f34[_0x8566('0x1a')]=qs[_0x8566('0x1a')](_0x4eb953[_0x8566('0x2e')][_0x8566('0x1a')]);}return _0x2e380a[_0x8566('0x4a')](_0x1f5f34);}})[_0x8566('0x22')](function(_0x52bbf9){if(_0x52bbf9){return _0x52bbf9?{'count':_0x4e771c,'rows':_0x52bbf9}:null;}})[_0x8566('0x22')](respondWithResult(_0x3ed73e,null))['catch'](handleError(_0x3ed73e,null));};exports[_0x8566('0x4d')]=function(_0x5405b3,_0x3c5bfc,_0x41a453){if(_0x5405b3['body']['id']){delete _0x5405b3[_0x8566('0x48')]['id'];}return db[_0x8566('0x3f')][_0x8566('0x4b')]({'where':{'id':_0x5405b3[_0x8566('0x43')]['id']}})[_0x8566('0x22')](handleEntityNotFound(_0x3c5bfc,null))['then'](function(_0x1f373b){if(_0x1f373b){_0x5405b3['body'][_0x8566('0x4e')]=_0x1f373b['id'];_0x5405b3['body'][_0x8566('0x4f')]=integrations[_0x8566('0x50')](_0x5405b3[_0x8566('0x48')][_0x8566('0x51')],_0x5405b3[_0x8566('0x48')][_0x8566('0x3c')]);_0x5405b3[_0x8566('0x48')][_0x8566('0x52')]=integrations[_0x8566('0x53')](_0x5405b3['body'][_0x8566('0x51')],_0x5405b3[_0x8566('0x48')][_0x8566('0x3c')]);return db[_0x8566('0x4c')]['create'](_0x5405b3[_0x8566('0x48')],{'include':[{'model':db[_0x8566('0x54')],'as':_0x8566('0x4f')},{'model':db[_0x8566('0x54')],'as':'Descriptions'}]});}return null;})[_0x8566('0x22')](respondWithResult(_0x3c5bfc,null))[_0x8566('0x46')](handleError(_0x3c5bfc,null));};exports[_0x8566('0x55')]=function(_0x310955,_0x3a4821,_0x3775db){var _0x32c5b7='';return db[_0x8566('0x3f')][_0x8566('0x4b')]({'where':{'id':_0x310955[_0x8566('0x43')]['id']},'attributes':['id',_0x8566('0x56'),_0x8566('0x57')]})[_0x8566('0x22')](handleEntityNotFound(_0x3a4821,null))[_0x8566('0x22')](function(_0x495bb8){if(_0x495bb8){_0x32c5b7=_0x495bb8[_0x8566('0x56')];var _0x3e538c=_0x32c5b7[_0x8566('0x58')](-0x1);if(_0x3e538c==='/'){_0x32c5b7=_0x32c5b7[_0x8566('0x59')](0x0,_0x32c5b7[_0x8566('0x5a')](_0x3e538c));}return rp({'method':_0x8566('0x5b'),'uri':util[_0x8566('0x5c')](_0x8566('0x5d'),_0x32c5b7,_0x8566('0x5e')),'headers':{'Authorization':util[_0x8566('0x5c')](_0x8566('0x5f'),new Buffer(util[_0x8566('0x5c')](_0x8566('0x60'),_0x495bb8[_0x8566('0x57')]))[_0x8566('0x61')]('base64'))},'json':!![]});}})['then'](function(_0x1e8773){if(_0x1e8773){var _0x1d4a3f=[_0x8566('0x62'),_0x8566('0x63'),_0x8566('0x64'),'description',_0x8566('0x18'),_0x8566('0x65'),'group',_0x8566('0x66'),'ticket_type',_0x8566('0x67'),_0x8566('0x68')];_[_0x8566('0x69')](_0x1e8773,function(_0x996cdd){return _0x1d4a3f[_0x8566('0x6a')](_0x996cdd['name'])||!_0x996cdd[_0x8566('0x6b')]&&_0x996cdd[_0x8566('0x3c')]!==_0x8566('0x6c')&&_0x996cdd[_0x8566('0x3c')]!=='custom_dropdown';});return{'count':_0x1e8773['length'],'rows':_[_0x8566('0x2a')](_0x1e8773,function(_0x5c0d16){return{'id':_0x5c0d16['name'],'name':_0x5c0d16[_0x8566('0x6d')],'custom':!_0x5c0d16['default'],'options':_0x5c0d16[_0x8566('0x6e')]?_[_0x8566('0x2a')](_0x5c0d16[_0x8566('0x6e')],function(_0x4f6ef4){return{'name':_[_0x8566('0x6f')](_0x4f6ef4),'value':_0x4f6ef4};}):[]};})};}})['then'](respondWithResult(_0x3a4821,null))['catch'](function(_0x594a83){var _0x7558db=_0x310955[_0x8566('0x2e')][_0x8566('0x70')]?0x1f4:_0x594a83[_0x8566('0x71')]||0x1f4;logger[_0x8566('0x25')](_0x8566('0x72'),_0x8566('0x55'),_0x7558db,JSON[_0x8566('0x73')](_0x594a83));delete _0x594a83['name'];if(_0x7558db===0x191){_0x7558db=0x190;}_0x3a4821[_0x8566('0x18')](_0x7558db)['send'](_0x310955[_0x8566('0x2e')][_0x8566('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x594a83[_0x8566('0x71')]}:_0x594a83);});}; \ No newline at end of file +var _0xc6fe=['map','FreshdeskAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','group','source','ticket_type','includes','default','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','sendStatus','stack','name','send','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6fe,0xbc));var _0xec6f=function(_0x1d3dd0,_0x3a757b){_0x1d3dd0=_0x1d3dd0-0x0;var _0x2c5c56=_0xc6fe[_0x1d3dd0];return _0x2c5c56;};'use strict';var emlformat=require(_0xec6f('0x0'));var rimraf=require(_0xec6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec6f('0x2'));var rp=require(_0xec6f('0x3'));var moment=require(_0xec6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec6f('0x5'));var util=require('util');var path=require(_0xec6f('0x6'));var sox=require(_0xec6f('0x7'));var csv=require(_0xec6f('0x8'));var ejs=require(_0xec6f('0x9'));var fs=require('fs');var fs_extra=require(_0xec6f('0xa'));var _=require(_0xec6f('0xb'));var squel=require(_0xec6f('0xc'));var crypto=require(_0xec6f('0xd'));var jsforce=require(_0xec6f('0xe'));var deskjs=require(_0xec6f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xec6f('0x10'));var Papa=require(_0xec6f('0x11'));var Redis=require(_0xec6f('0x12'));var authService=require(_0xec6f('0x13'));var qs=require(_0xec6f('0x14'));var as=require(_0xec6f('0x15'));var hardwareService=require(_0xec6f('0x16'));var logger=require(_0xec6f('0x17'))(_0xec6f('0x18'));var utils=require(_0xec6f('0x19'));var config=require(_0xec6f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xec6f('0x1b'))['db'];var integrations=require(_0xec6f('0x1c'));function respondWithStatusCode(_0x398960,_0x39243d){_0x39243d=_0x39243d||0xcc;return function(_0x2af5a7){if(_0x2af5a7){return _0x398960['sendStatus'](_0x39243d);}return _0x398960['status'](_0x39243d)[_0xec6f('0x1d')]();};}function respondWithResult(_0x3a1fd4,_0x5b8f52){_0x5b8f52=_0x5b8f52||0xc8;return function(_0x4e166c){if(_0x4e166c){return _0x3a1fd4[_0xec6f('0x1e')](_0x5b8f52)[_0xec6f('0x1f')](_0x4e166c);}};}function respondWithFilteredResult(_0x4f5247,_0x5b6769){return function(_0x2424c6){if(_0x2424c6){var _0xf75616=typeof _0x5b6769[_0xec6f('0x20')]===_0xec6f('0x21')&&typeof _0x5b6769['limit']==='undefined';var _0x1630df=_0x2424c6[_0xec6f('0x22')];var _0x3f73c7=_0xf75616?0x0:_0x5b6769[_0xec6f('0x20')];var _0x2ae881=_0xf75616?_0x2424c6[_0xec6f('0x22')]:_0x5b6769[_0xec6f('0x20')]+_0x5b6769[_0xec6f('0x23')];var _0x5debba;if(_0x2ae881>=_0x1630df){_0x2ae881=_0x1630df;_0x5debba=0xc8;}else{_0x5debba=0xce;}_0x4f5247[_0xec6f('0x1e')](_0x5debba);return _0x4f5247[_0xec6f('0x24')](_0xec6f('0x25'),_0x3f73c7+'-'+_0x2ae881+'/'+_0x1630df)[_0xec6f('0x1f')](_0x2424c6);}return null;};}function patchUpdates(_0xb0f815){return function(_0x30214d){try{jsonpatch['apply'](_0x30214d,_0xb0f815,!![]);}catch(_0x3b403b){return BPromise['reject'](_0x3b403b);}return _0x30214d[_0xec6f('0x26')]();};}function saveUpdates(_0x32336b,_0xc9ee08){return function(_0x24b3f9){if(_0x24b3f9){return _0x24b3f9['update'](_0x32336b)[_0xec6f('0x27')](function(_0x57523c){return _0x57523c;});}return null;};}function removeEntity(_0x309d33,_0x412981){return function(_0xcf978){if(_0xcf978){return _0xcf978[_0xec6f('0x28')]()[_0xec6f('0x27')](function(){_0x309d33[_0xec6f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1eb4b,_0x2251fe){return function(_0xae0323){if(!_0xae0323){_0xd1eb4b[_0xec6f('0x29')](0x194);}return _0xae0323;};}function handleError(_0x1953cb,_0x30ae02){_0x30ae02=_0x30ae02||0x1f4;return function(_0x19e542){logger['error'](_0x19e542[_0xec6f('0x2a')]);if(_0x19e542[_0xec6f('0x2b')]){delete _0x19e542[_0xec6f('0x2b')];}_0x1953cb[_0xec6f('0x1e')](_0x30ae02)[_0xec6f('0x2c')](_0x19e542);};}exports[_0xec6f('0x2d')]=function(_0x5d539f,_0x5aff82){var _0xe2bb69={},_0x47eccb={},_0x156498={'count':0x0,'rows':[]};var _0x5f075f=_[_0xec6f('0x2e')](db[_0xec6f('0x2f')][_0xec6f('0x30')],function(_0x51a70b){return{'name':_0x51a70b[_0xec6f('0x31')],'type':_0x51a70b['type'][_0xec6f('0x32')]};});_0x47eccb[_0xec6f('0x33')]=_[_0xec6f('0x2e')](_0x5f075f,_0xec6f('0x2b'));_0x47eccb['query']=_[_0xec6f('0x34')](_0x5d539f[_0xec6f('0x35')]);_0x47eccb[_0xec6f('0x36')]=_[_0xec6f('0x37')](_0x47eccb[_0xec6f('0x33')],_0x47eccb[_0xec6f('0x35')]);_0xe2bb69[_0xec6f('0x38')]=_[_0xec6f('0x37')](_0x47eccb['model'],qs[_0xec6f('0x39')](_0x5d539f[_0xec6f('0x35')][_0xec6f('0x39')]));_0xe2bb69[_0xec6f('0x38')]=_0xe2bb69['attributes']['length']?_0xe2bb69[_0xec6f('0x38')]:_0x47eccb[_0xec6f('0x33')];if(!_0x5d539f[_0xec6f('0x35')]['hasOwnProperty'](_0xec6f('0x3a'))){_0xe2bb69[_0xec6f('0x23')]=qs['limit'](_0x5d539f[_0xec6f('0x35')]['limit']);_0xe2bb69['offset']=qs[_0xec6f('0x20')](_0x5d539f[_0xec6f('0x35')]['offset']);}_0xe2bb69[_0xec6f('0x3b')]=qs[_0xec6f('0x3c')](_0x5d539f[_0xec6f('0x35')][_0xec6f('0x3c')]);_0xe2bb69['where']=qs[_0xec6f('0x36')](_[_0xec6f('0x3d')](_0x5d539f['query'],_0x47eccb['filters']),_0x5f075f);if(_0x5d539f[_0xec6f('0x35')][_0xec6f('0x3e')]){_0xe2bb69[_0xec6f('0x3f')]=_[_0xec6f('0x40')](_0xe2bb69[_0xec6f('0x3f')],{'$or':_[_0xec6f('0x2e')](_0x5f075f,function(_0x19d166){if(_0x19d166[_0xec6f('0x41')]!==_0xec6f('0x42')){var _0x381dd8={};_0x381dd8[_0x19d166[_0xec6f('0x2b')]]={'$like':'%'+_0x5d539f[_0xec6f('0x35')]['filter']+'%'};return _0x381dd8;}})});}_0xe2bb69=_[_0xec6f('0x40')]({},_0xe2bb69,_0x5d539f[_0xec6f('0x43')]);var _0x18551b={'where':_0xe2bb69['where']};return db[_0xec6f('0x2f')][_0xec6f('0x22')](_0x18551b)['then'](function(_0x31c7be){_0x156498['count']=_0x31c7be;if(_0x5d539f[_0xec6f('0x35')][_0xec6f('0x44')]){_0xe2bb69[_0xec6f('0x45')]=[{'all':!![]}];}return db[_0xec6f('0x2f')][_0xec6f('0x46')](_0xe2bb69);})['then'](function(_0x5ad55f){_0x156498[_0xec6f('0x47')]=_0x5ad55f;return _0x156498;})[_0xec6f('0x27')](respondWithFilteredResult(_0x5aff82,_0xe2bb69))[_0xec6f('0x48')](handleError(_0x5aff82,null));};exports[_0xec6f('0x49')]=function(_0x50e94b,_0x538818){var _0x586a66={'raw':![],'where':{'id':_0x50e94b['params']['id']}},_0x539507={};_0x539507[_0xec6f('0x33')]=_[_0xec6f('0x34')](db['FreshdeskAccount'][_0xec6f('0x30')]);_0x539507[_0xec6f('0x35')]=_[_0xec6f('0x34')](_0x50e94b['query']);_0x539507[_0xec6f('0x36')]=_[_0xec6f('0x37')](_0x539507[_0xec6f('0x33')],_0x539507[_0xec6f('0x35')]);_0x586a66[_0xec6f('0x38')]=_[_0xec6f('0x37')](_0x539507['model'],qs[_0xec6f('0x39')](_0x50e94b[_0xec6f('0x35')][_0xec6f('0x39')]));_0x586a66[_0xec6f('0x38')]=_0x586a66[_0xec6f('0x38')][_0xec6f('0x4a')]?_0x586a66[_0xec6f('0x38')]:_0x539507[_0xec6f('0x33')];if(_0x50e94b[_0xec6f('0x35')][_0xec6f('0x44')]){_0x586a66[_0xec6f('0x45')]=[{'all':!![]}];}_0x586a66=_[_0xec6f('0x40')]({},_0x586a66,_0x50e94b[_0xec6f('0x43')]);return db[_0xec6f('0x2f')]['find'](_0x586a66)[_0xec6f('0x27')](handleEntityNotFound(_0x538818,null))[_0xec6f('0x27')](respondWithResult(_0x538818,null))['catch'](handleError(_0x538818,null));};exports[_0xec6f('0x4b')]=function(_0x2472bf,_0x3dd808){return db[_0xec6f('0x2f')][_0xec6f('0x4b')](_0x2472bf['body'],{})['then'](respondWithResult(_0x3dd808,0xc9))[_0xec6f('0x48')](handleError(_0x3dd808,null));};exports['update']=function(_0x3f738f,_0x45e8ca){if(_0x3f738f[_0xec6f('0x4c')]['id']){delete _0x3f738f[_0xec6f('0x4c')]['id'];}return db[_0xec6f('0x2f')][_0xec6f('0x4d')]({'where':{'id':_0x3f738f[_0xec6f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45e8ca,null))[_0xec6f('0x27')](saveUpdates(_0x3f738f['body'],null))[_0xec6f('0x27')](respondWithResult(_0x45e8ca,null))['catch'](handleError(_0x45e8ca,null));};exports[_0xec6f('0x28')]=function(_0x4acaa3,_0x5592da){return db[_0xec6f('0x2f')][_0xec6f('0x4d')]({'where':{'id':_0x4acaa3[_0xec6f('0x4e')]['id']}})[_0xec6f('0x27')](handleEntityNotFound(_0x5592da,null))[_0xec6f('0x27')](removeEntity(_0x5592da,null))[_0xec6f('0x48')](handleError(_0x5592da,null));};exports['getConfigurations']=function(_0xe8a040,_0x198197,_0x2f1738){var _0x4ca47b={};var _0xa2310c={};var _0x297ea4;var _0x326788;return db[_0xec6f('0x2f')][_0xec6f('0x4f')]({'where':{'id':_0xe8a040['params']['id']}})['then'](handleEntityNotFound(_0x198197,null))['then'](function(_0x5d061a){if(_0x5d061a){_0x297ea4=_0x5d061a;_0xa2310c[_0xec6f('0x33')]=_[_0xec6f('0x34')](db[_0xec6f('0x50')][_0xec6f('0x30')]);_0xa2310c[_0xec6f('0x35')]=_[_0xec6f('0x34')](_0xe8a040[_0xec6f('0x35')]);_0xa2310c[_0xec6f('0x36')]=_[_0xec6f('0x37')](_0xa2310c['model'],_0xa2310c[_0xec6f('0x35')]);_0x4ca47b[_0xec6f('0x38')]=_[_0xec6f('0x37')](_0xa2310c[_0xec6f('0x33')],qs[_0xec6f('0x39')](_0xe8a040[_0xec6f('0x35')][_0xec6f('0x39')]));_0x4ca47b[_0xec6f('0x38')]=_0x4ca47b[_0xec6f('0x38')][_0xec6f('0x4a')]?_0x4ca47b[_0xec6f('0x38')]:_0xa2310c[_0xec6f('0x33')];_0x4ca47b[_0xec6f('0x3b')]=qs[_0xec6f('0x3c')](_0xe8a040['query']['sort']);_0x4ca47b[_0xec6f('0x3f')]=qs['filters'](_['pick'](_0xe8a040['query'],_0xa2310c[_0xec6f('0x36')]));if(_0xe8a040['query'][_0xec6f('0x3e')]){_0x4ca47b[_0xec6f('0x3f')]=_[_0xec6f('0x40')](_0x4ca47b[_0xec6f('0x3f')],{'$or':_[_0xec6f('0x2e')](_0x4ca47b[_0xec6f('0x38')],function(_0x3f6500){var _0x42b269={};_0x42b269[_0x3f6500]={'$like':'%'+_0xe8a040[_0xec6f('0x35')]['filter']+'%'};return _0x42b269;})});}_0x4ca47b=_[_0xec6f('0x40')]({},_0x4ca47b,_0xe8a040['options']);return _0x297ea4[_0xec6f('0x51')](_0x4ca47b);}})['then'](function(_0x43abfe){if(_0x43abfe){_0x326788=_0x43abfe[_0xec6f('0x4a')];if(!_0xe8a040[_0xec6f('0x35')]['hasOwnProperty']('nolimit')){_0x4ca47b['limit']=qs['limit'](_0xe8a040[_0xec6f('0x35')][_0xec6f('0x23')]);_0x4ca47b[_0xec6f('0x20')]=qs[_0xec6f('0x20')](_0xe8a040[_0xec6f('0x35')]['offset']);}return _0x297ea4[_0xec6f('0x51')](_0x4ca47b);}})[_0xec6f('0x27')](function(_0x13ed22){if(_0x13ed22){return _0x13ed22?{'count':_0x326788,'rows':_0x13ed22}:null;}})['then'](respondWithResult(_0x198197,null))[_0xec6f('0x48')](handleError(_0x198197,null));};exports[_0xec6f('0x52')]=function(_0x1c58b5,_0x5cffc1,_0x2e5e0f){if(_0x1c58b5[_0xec6f('0x4c')]['id']){delete _0x1c58b5[_0xec6f('0x4c')]['id'];}return db[_0xec6f('0x2f')][_0xec6f('0x4f')]({'where':{'id':_0x1c58b5[_0xec6f('0x4e')]['id']}})[_0xec6f('0x27')](handleEntityNotFound(_0x5cffc1,null))[_0xec6f('0x27')](function(_0x7f0c30){if(_0x7f0c30){_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x53')]=_0x7f0c30['id'];_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x54')]=integrations['getSubjects'](_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x55')],_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x41')]);_0x1c58b5[_0xec6f('0x4c')]['Descriptions']=integrations[_0xec6f('0x56')](_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x55')],_0x1c58b5[_0xec6f('0x4c')][_0xec6f('0x41')]);return db[_0xec6f('0x50')]['create'](_0x1c58b5['body'],{'include':[{'model':db[_0xec6f('0x57')],'as':_0xec6f('0x54')},{'model':db[_0xec6f('0x57')],'as':'Descriptions'}]});}return null;})[_0xec6f('0x27')](respondWithResult(_0x5cffc1,null))[_0xec6f('0x48')](handleError(_0x5cffc1,null));};exports[_0xec6f('0x58')]=function(_0x396ca2,_0x124ca1,_0x36987b){var _0x128d6f='';return db['FreshdeskAccount'][_0xec6f('0x4f')]({'where':{'id':_0x396ca2[_0xec6f('0x4e')]['id']},'attributes':['id','remoteUri',_0xec6f('0x59')]})[_0xec6f('0x27')](handleEntityNotFound(_0x124ca1,null))[_0xec6f('0x27')](function(_0x4dc816){if(_0x4dc816){_0x128d6f=_0x4dc816[_0xec6f('0x5a')];var _0x3bcc3f=_0x128d6f[_0xec6f('0x5b')](-0x1);if(_0x3bcc3f==='/'){_0x128d6f=_0x128d6f['substring'](0x0,_0x128d6f[_0xec6f('0x5c')](_0x3bcc3f));}return rp({'method':_0xec6f('0x5d'),'uri':util[_0xec6f('0x5e')](_0xec6f('0x5f'),_0x128d6f,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xec6f('0x5e')](_0xec6f('0x60'),new Buffer(util['format'](_0xec6f('0x61'),_0x4dc816[_0xec6f('0x59')]))[_0xec6f('0x62')](_0xec6f('0x63')))},'json':!![]});}})['then'](function(_0x3e7ecc){if(_0x3e7ecc){var _0x3245c6=[_0xec6f('0x64'),_0xec6f('0x65'),_0xec6f('0x66'),'description',_0xec6f('0x1e'),'priority',_0xec6f('0x67'),_0xec6f('0x68'),_0xec6f('0x69'),_0xec6f('0x67'),'company'];_['remove'](_0x3e7ecc,function(_0x19c16b){return _0x3245c6[_0xec6f('0x6a')](_0x19c16b[_0xec6f('0x2b')])||!_0x19c16b[_0xec6f('0x6b')]&&_0x19c16b[_0xec6f('0x41')]!==_0xec6f('0x6c')&&_0x19c16b['type']!==_0xec6f('0x6d');});return{'count':_0x3e7ecc[_0xec6f('0x4a')],'rows':_[_0xec6f('0x2e')](_0x3e7ecc,function(_0x5bd8ab){return{'id':_0x5bd8ab[_0xec6f('0x2b')],'name':_0x5bd8ab[_0xec6f('0x6e')],'custom':!_0x5bd8ab[_0xec6f('0x6b')],'options':_0x5bd8ab[_0xec6f('0x6f')]?_['map'](_0x5bd8ab[_0xec6f('0x6f')],function(_0x519435){return{'name':_['capitalize'](_0x519435),'value':_0x519435};}):[]};})};}})[_0xec6f('0x27')](respondWithResult(_0x124ca1,null))['catch'](function(_0x3f9f69){var _0x902516=_0x396ca2[_0xec6f('0x35')]['test']?0x1f4:_0x3f9f69[_0xec6f('0x70')]||0x1f4;logger['error'](_0xec6f('0x71'),'getFields',_0x902516,JSON[_0xec6f('0x72')](_0x3f9f69));delete _0x3f9f69[_0xec6f('0x2b')];if(_0x902516===0x191){_0x902516=0x190;}_0x124ca1[_0xec6f('0x1e')](_0x902516)[_0xec6f('0x2c')](_0x396ca2['query'][_0xec6f('0x73')]?{'message':_0xec6f('0x74'),'statusCode':_0x3f9f69[_0xec6f('0x70')]}:_0x3f9f69);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9fa777b..f822157 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 _0xef1f=['./intFreshdeskAccount.attributes','exports','define','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1790b1,_0xad90b9){var _0x5f3de5=function(_0x303011){while(--_0x303011){_0x1790b1['push'](_0x1790b1['shift']());}};_0x5f3de5(++_0xad90b9);}(_0xef1f,0xfb));var _0xfef1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xef1f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xfef1('0x0'));var util=require('util');var logger=require(_0xfef1('0x1'))(_0xfef1('0x2'));var moment=require(_0xfef1('0x3'));var BPromise=require(_0xfef1('0x4'));var rp=require(_0xfef1('0x5'));var fs=require('fs');var path=require(_0xfef1('0x6'));var rimraf=require(_0xfef1('0x7'));var config=require(_0xfef1('0x8'));var attributes=require(_0xfef1('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xfef1('0xa')]=function(_0x20d8ec,_0x11ba6d){return _0x20d8ec[_0xfef1('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xfef1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2154=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','bluebird','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2154,0x151));var _0x4215=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x2154[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x4215('0x0'));var util=require('util');var logger=require(_0x4215('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4215('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4215('0x3'));var rimraf=require(_0x4215('0x4'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4215('0x5')]=function(_0x40c8f4,_0x2375e6){return _0x40c8f4[_0x4215('0x6')](_0x4215('0x7'),attributes,{'tableName':_0x4215('0x8'),'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 ef1f7ee..ffff379 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 _0xe5c9=['http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','attributes','include','model','map','stringify','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1b49fa,_0x1de635){var _0xac5745=function(_0x1d8d06){while(--_0x1d8d06){_0x1b49fa['push'](_0x1b49fa['shift']());}};_0xac5745(++_0x1de635);}(_0xe5c9,0x139));var _0x9e5c=function(_0x14fd11,_0x10b282){_0x14fd11=_0x14fd11-0x0;var _0x18fc60=_0xe5c9[_0x14fd11];return _0x18fc60;};'use strict';var _=require(_0x9e5c('0x0'));var util=require(_0x9e5c('0x1'));var moment=require(_0x9e5c('0x2'));var BPromise=require(_0x9e5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e5c('0x4'));var db=require(_0x9e5c('0x5'))['db'];var utils=require(_0x9e5c('0x6'));var logger=require(_0x9e5c('0x7'))('rpc');var config=require(_0x9e5c('0x8'));var jayson=require(_0x9e5c('0x9'));var client=jayson[_0x9e5c('0xa')][_0x9e5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ffaed,_0x592269,_0x193a03){return new BPromise(function(_0x4154cc,_0x442762){return client[_0x9e5c('0xc')](_0x4ffaed,_0x193a03)[_0x9e5c('0xd')](function(_0xde3c34){logger[_0x9e5c('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x592269,'request\x20sent');logger[_0x9e5c('0xf')](_0x9e5c('0x10'),_0x592269,_0x9e5c('0x11'),JSON['stringify'](_0xde3c34));if(_0xde3c34[_0x9e5c('0x12')]){if(_0xde3c34[_0x9e5c('0x12')][_0x9e5c('0x13')]===0x1f4){logger[_0x9e5c('0x12')](_0x9e5c('0x14'),_0x592269,_0xde3c34[_0x9e5c('0x12')][_0x9e5c('0x15')]);return _0x442762(_0xde3c34['error'][_0x9e5c('0x15')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x592269,_0xde3c34[_0x9e5c('0x12')][_0x9e5c('0x15')]);return _0x4154cc(_0xde3c34['error']['message']);}else{logger[_0x9e5c('0xe')](_0x9e5c('0x14'),_0x592269,_0x9e5c('0x11'));_0x4154cc(_0xde3c34[_0x9e5c('0x16')][_0x9e5c('0x15')]);}})[_0x9e5c('0x17')](function(_0x133018){logger[_0x9e5c('0x12')](_0x9e5c('0x14'),_0x592269,_0x133018);_0x442762(_0x133018);});});}exports[_0x9e5c('0x18')]=function(_0x3331b9){var _0x113edc=this;return new Promise(function(_0xa545f0,_0x3aa31a){return db[_0x9e5c('0x19')][_0x9e5c('0x1a')]({'raw':_0x3331b9[_0x9e5c('0x1b')]?_0x3331b9[_0x9e5c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3331b9[_0x9e5c('0x1b')]?_0x3331b9[_0x9e5c('0x1b')]['where']||null:null,'attributes':_0x3331b9['options']?_0x3331b9['options'][_0x9e5c('0x1c')]||null:null,'limit':_0x3331b9[_0x9e5c('0x1b')]?_0x3331b9[_0x9e5c('0x1b')]['limit']||null:null,'include':_0x3331b9[_0x9e5c('0x1b')]?_0x3331b9['options'][_0x9e5c('0x1d')]?_['map'](_0x3331b9[_0x9e5c('0x1b')][_0x9e5c('0x1d')],function(_0x42938e){return{'model':db[_0x42938e[_0x9e5c('0x1e')]],'as':_0x42938e['as'],'attributes':_0x42938e['attributes'],'include':_0x42938e[_0x9e5c('0x1d')]?_['map'](_0x42938e[_0x9e5c('0x1d')],function(_0x25280c){return{'model':db[_0x25280c[_0x9e5c('0x1e')]],'as':_0x25280c['as'],'attributes':_0x25280c[_0x9e5c('0x1c')],'include':_0x25280c[_0x9e5c('0x1d')]?_[_0x9e5c('0x1f')](_0x25280c['include'],function(_0x26d703){return{'model':db[_0x26d703[_0x9e5c('0x1e')]],'as':_0x26d703['as'],'attributes':_0x26d703[_0x9e5c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9e5c('0xd')](function(_0x905ceb){logger['info'](_0x9e5c('0x18'),_0x3331b9);logger['debug'](_0x9e5c('0x18'),_0x3331b9,JSON[_0x9e5c('0x20')](_0x905ceb));_0xa545f0(_0x905ceb);})[_0x9e5c('0x17')](function(_0x558257){logger['error'](_0x9e5c('0x18'),_0x558257[_0x9e5c('0x15')],_0x3331b9);_0x3aa31a(_0x113edc['error'](0x1f4,_0x558257[_0x9e5c('0x15')]));});});};exports[_0x9e5c('0x21')]=function(_0x3149f4){var _0x416ec7=this;return new Promise(function(_0xb7717c,_0x1e14fd){return db[_0x9e5c('0x19')][_0x9e5c('0x22')]({'raw':_0x3149f4['options']?_0x3149f4[_0x9e5c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3149f4[_0x9e5c('0x1b')]?_0x3149f4[_0x9e5c('0x1b')][_0x9e5c('0x23')]||null:null,'attributes':_0x3149f4[_0x9e5c('0x1b')]?_0x3149f4[_0x9e5c('0x1b')]['attributes']||null:null,'include':_0x3149f4[_0x9e5c('0x1b')]?_0x3149f4[_0x9e5c('0x1b')][_0x9e5c('0x1d')]?_[_0x9e5c('0x1f')](_0x3149f4[_0x9e5c('0x1b')][_0x9e5c('0x1d')],function(_0xcbc4d7){return{'model':db[_0xcbc4d7[_0x9e5c('0x1e')]],'as':_0xcbc4d7['as'],'attributes':_0xcbc4d7[_0x9e5c('0x1c')],'include':_0xcbc4d7[_0x9e5c('0x1d')]?_['map'](_0xcbc4d7[_0x9e5c('0x1d')],function(_0x47efdf){return{'model':db[_0x47efdf[_0x9e5c('0x1e')]],'as':_0x47efdf['as'],'attributes':_0x47efdf[_0x9e5c('0x1c')],'include':_0x47efdf[_0x9e5c('0x1d')]?_['map'](_0x47efdf[_0x9e5c('0x1d')],function(_0x9feb96){return{'model':db[_0x9feb96[_0x9e5c('0x1e')]],'as':_0x9feb96['as'],'attributes':_0x9feb96[_0x9e5c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9e5c('0xd')](function(_0x830ecf){logger[_0x9e5c('0xe')]('ShowFreshdeskAccount',_0x3149f4);logger['debug'](_0x9e5c('0x21'),_0x3149f4,JSON['stringify'](_0x830ecf));_0xb7717c(_0x830ecf);})['catch'](function(_0x3a905c){logger[_0x9e5c('0x12')](_0x9e5c('0x21'),_0x3a905c[_0x9e5c('0x15')],_0x3149f4);_0x1e14fd(_0x416ec7[_0x9e5c('0x12')](0x1f4,_0x3a905c[_0x9e5c('0x15')]));});});}; \ No newline at end of file +var _0xaf5d=['FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','error','code'];(function(_0x31c6a2,_0x88b9b7){var _0x156017=function(_0x424ccb){while(--_0x424ccb){_0x31c6a2['push'](_0x31c6a2['shift']());}};_0x156017(++_0x88b9b7);}(_0xaf5d,0xf8));var _0xdaf5=function(_0x50c760,_0x249107){_0x50c760=_0x50c760-0x0;var _0x5cafff=_0xaf5d[_0x50c760];return _0x5cafff;};'use strict';var _=require(_0xdaf5('0x0'));var util=require(_0xdaf5('0x1'));var moment=require(_0xdaf5('0x2'));var BPromise=require(_0xdaf5('0x3'));var rs=require(_0xdaf5('0x4'));var fs=require('fs');var Redis=require(_0xdaf5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdaf5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdaf5('0x7'));var jayson=require(_0xdaf5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x336c61,_0x325b4a,_0x3f6fc4){return new BPromise(function(_0x1661da,_0xc0672a){return client[_0xdaf5('0x9')](_0x336c61,_0x3f6fc4)[_0xdaf5('0xa')](function(_0x73be7e){logger[_0xdaf5('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x325b4a,_0xdaf5('0xc'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x325b4a,_0xdaf5('0xc'),JSON[_0xdaf5('0xd')](_0x73be7e));if(_0x73be7e[_0xdaf5('0xe')]){if(_0x73be7e['error'][_0xdaf5('0xf')]===0x1f4){logger[_0xdaf5('0xe')](_0xdaf5('0x10'),_0x325b4a,_0x73be7e['error'][_0xdaf5('0x11')]);return _0xc0672a(_0x73be7e[_0xdaf5('0xe')][_0xdaf5('0x11')]);}logger[_0xdaf5('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x325b4a,_0x73be7e[_0xdaf5('0xe')][_0xdaf5('0x11')]);return _0x1661da(_0x73be7e['error'][_0xdaf5('0x11')]);}else{logger[_0xdaf5('0xb')](_0xdaf5('0x10'),_0x325b4a,'request\x20sent');_0x1661da(_0x73be7e['result'][_0xdaf5('0x11')]);}})[_0xdaf5('0x12')](function(_0x365892){logger[_0xdaf5('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x325b4a,_0x365892);_0xc0672a(_0x365892);});});}exports[_0xdaf5('0x13')]=function(_0x278fef){var _0x5a45c2=this;return new Promise(function(_0x41a5dd,_0x25f952){return db[_0xdaf5('0x14')][_0xdaf5('0x15')]({'raw':_0x278fef[_0xdaf5('0x16')]?_0x278fef[_0xdaf5('0x16')][_0xdaf5('0x17')]===undefined?!![]:![]:!![],'where':_0x278fef['options']?_0x278fef[_0xdaf5('0x16')][_0xdaf5('0x18')]||null:null,'attributes':_0x278fef[_0xdaf5('0x16')]?_0x278fef[_0xdaf5('0x16')][_0xdaf5('0x19')]||null:null,'limit':_0x278fef['options']?_0x278fef['options'][_0xdaf5('0x1a')]||null:null,'include':_0x278fef[_0xdaf5('0x16')]?_0x278fef[_0xdaf5('0x16')][_0xdaf5('0x1b')]?_[_0xdaf5('0x1c')](_0x278fef[_0xdaf5('0x16')][_0xdaf5('0x1b')],function(_0x17dfd4){return{'model':db[_0x17dfd4['model']],'as':_0x17dfd4['as'],'attributes':_0x17dfd4[_0xdaf5('0x19')],'include':_0x17dfd4[_0xdaf5('0x1b')]?_['map'](_0x17dfd4[_0xdaf5('0x1b')],function(_0x89c6e2){return{'model':db[_0x89c6e2[_0xdaf5('0x1d')]],'as':_0x89c6e2['as'],'attributes':_0x89c6e2[_0xdaf5('0x19')],'include':_0x89c6e2[_0xdaf5('0x1b')]?_[_0xdaf5('0x1c')](_0x89c6e2['include'],function(_0x268df0){return{'model':db[_0x268df0[_0xdaf5('0x1d')]],'as':_0x268df0['as'],'attributes':_0x268df0[_0xdaf5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e3e35){logger[_0xdaf5('0xb')](_0xdaf5('0x13'),_0x278fef);logger[_0xdaf5('0x1e')]('GetFreshdeskAccount',_0x278fef,JSON[_0xdaf5('0xd')](_0x1e3e35));_0x41a5dd(_0x1e3e35);})['catch'](function(_0x2d4e3b){logger[_0xdaf5('0xe')]('GetFreshdeskAccount',_0x2d4e3b['message'],_0x278fef);_0x25f952(_0x5a45c2['error'](0x1f4,_0x2d4e3b['message']));});});};exports['ShowFreshdeskAccount']=function(_0x45f809){var _0x77321=this;return new Promise(function(_0x15f7ab,_0xb3be51){return db[_0xdaf5('0x14')][_0xdaf5('0x1f')]({'raw':_0x45f809[_0xdaf5('0x16')]?_0x45f809[_0xdaf5('0x16')][_0xdaf5('0x17')]===undefined?!![]:![]:!![],'where':_0x45f809[_0xdaf5('0x16')]?_0x45f809[_0xdaf5('0x16')][_0xdaf5('0x18')]||null:null,'attributes':_0x45f809[_0xdaf5('0x16')]?_0x45f809[_0xdaf5('0x16')]['attributes']||null:null,'include':_0x45f809[_0xdaf5('0x16')]?_0x45f809[_0xdaf5('0x16')]['include']?_['map'](_0x45f809[_0xdaf5('0x16')]['include'],function(_0x27495e){return{'model':db[_0x27495e[_0xdaf5('0x1d')]],'as':_0x27495e['as'],'attributes':_0x27495e[_0xdaf5('0x19')],'include':_0x27495e[_0xdaf5('0x1b')]?_[_0xdaf5('0x1c')](_0x27495e[_0xdaf5('0x1b')],function(_0x4890da){return{'model':db[_0x4890da[_0xdaf5('0x1d')]],'as':_0x4890da['as'],'attributes':_0x4890da['attributes'],'include':_0x4890da[_0xdaf5('0x1b')]?_[_0xdaf5('0x1c')](_0x4890da['include'],function(_0x583b03){return{'model':db[_0x583b03[_0xdaf5('0x1d')]],'as':_0x583b03['as'],'attributes':_0x583b03[_0xdaf5('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdaf5('0xa')](function(_0x35c746){logger['info'](_0xdaf5('0x20'),_0x45f809);logger[_0xdaf5('0x1e')](_0xdaf5('0x20'),_0x45f809,JSON[_0xdaf5('0xd')](_0x35c746));_0x15f7ab(_0x35c746);})[_0xdaf5('0x12')](function(_0xe19230){logger[_0xdaf5('0xe')](_0xdaf5('0x20'),_0xe19230[_0xdaf5('0x11')],_0x45f809);_0xb3be51(_0x77321['error'](0x1f4,_0xe19230['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 02b2436..7fbb2ba 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 _0x378d=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x378d,0xd9));var _0xd378=function(_0x7c93da,_0x27ae80){_0x7c93da=_0x7c93da-0x0;var _0x48508e=_0x378d[_0x7c93da];return _0x48508e;};'use strict';var multer=require(_0xd378('0x0'));var util=require(_0xd378('0x1'));var path=require(_0xd378('0x2'));var timeout=require('connect-timeout');var express=require(_0xd378('0x3'));var router=express[_0xd378('0x4')]();var fs_extra=require(_0xd378('0x5'));var auth=require(_0xd378('0x6'));var interaction=require(_0xd378('0x7'));var config=require('../../config/environment');var controller=require(_0xd378('0x8'));router[_0xd378('0x9')]('/',auth[_0xd378('0xa')](),controller[_0xd378('0xb')]);router['get'](_0xd378('0xc'),auth[_0xd378('0xa')](),controller[_0xd378('0xd')]);router[_0xd378('0x9')]('/:id/fields',auth[_0xd378('0xa')](),controller[_0xd378('0xe')]);router[_0xd378('0x9')](_0xd378('0xf'),auth['isAuthenticated'](),controller[_0xd378('0x10')]);router[_0xd378('0x9')](_0xd378('0x11'),auth[_0xd378('0xa')](),controller[_0xd378('0x12')]);router[_0xd378('0x9')]('/:id/tags',auth[_0xd378('0xa')](),controller[_0xd378('0x13')]);router[_0xd378('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd378('0x14')](_0xd378('0x15'),auth[_0xd378('0xa')](),controller[_0xd378('0x16')]);router['put'](_0xd378('0xc'),auth[_0xd378('0xa')](),controller['update']);router[_0xd378('0x17')](_0xd378('0xc'),auth[_0xd378('0xa')](),controller[_0xd378('0x18')]);module['exports']=router; \ No newline at end of file +var _0x08a1=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','/:id/tags','getTags','post','create','setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x08a1,0x17d));var _0x108a=function(_0x4f62c9,_0x5e5b63){_0x4f62c9=_0x4f62c9-0x0;var _0x4dca96=_0x08a1[_0x4f62c9];return _0x4dca96;};'use strict';var multer=require(_0x108a('0x0'));var util=require(_0x108a('0x1'));var path=require(_0x108a('0x2'));var timeout=require(_0x108a('0x3'));var express=require(_0x108a('0x4'));var router=express[_0x108a('0x5')]();var fs_extra=require(_0x108a('0x6'));var auth=require(_0x108a('0x7'));var interaction=require(_0x108a('0x8'));var config=require(_0x108a('0x9'));var controller=require(_0x108a('0xa'));router[_0x108a('0xb')]('/',auth[_0x108a('0xc')](),controller['index']);router['get'](_0x108a('0xd'),auth[_0x108a('0xc')](),controller[_0x108a('0xe')]);router[_0x108a('0xb')](_0x108a('0xf'),auth[_0x108a('0xc')](),controller['getFields']);router[_0x108a('0xb')](_0x108a('0x10'),auth[_0x108a('0xc')](),controller['getSubjects']);router[_0x108a('0xb')]('/:id/descriptions',auth[_0x108a('0xc')](),controller['getDescriptions']);router[_0x108a('0xb')](_0x108a('0x11'),auth['isAuthenticated'](),controller[_0x108a('0x12')]);router[_0x108a('0x13')]('/',auth[_0x108a('0xc')](),controller[_0x108a('0x14')]);router['post']('/:id/tags',auth[_0x108a('0xc')](),controller[_0x108a('0x15')]);router['put'](_0x108a('0xd'),auth[_0x108a('0xc')](),controller[_0x108a('0x16')]);router[_0x108a('0x17')](_0x108a('0xd'),auth['isAuthenticated'](),controller[_0x108a('0x18')]);module[_0x108a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 1a699e8..3f07aba 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 _0x4368=['exports','STRING'];(function(_0x2e6c17,_0x3a850f){var _0x18d1f6=function(_0x5eb2ae){while(--_0x5eb2ae){_0x2e6c17['push'](_0x2e6c17['shift']());}};_0x18d1f6(++_0x3a850f);}(_0x4368,0x126));var _0x8436=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x4368[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require('sequelize');module[_0x8436('0x0')]={'name':{'type':Sequelize[_0x8436('0x1')]},'description':{'type':Sequelize[_0x8436('0x1')]}}; \ No newline at end of file +var _0x2d79=['exports'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0x2d79,0x69));var _0x92d7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2d79[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x92d7('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 43e0b74..7c12a73 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 _0xcefc=['count','status','set','Content-Range','json','save','update','then','end','error','name','send','index','map','FreshdeskConfiguration','fieldName','type','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','fields','includeAll','create','body','catch','find','findOne','FreshdeskField','pick','filter','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','offset','limit','undefined'];(function(_0xaa5e2b,_0x4213ec){var _0x5758d2=function(_0x1a1d1f){while(--_0x1a1d1f){_0xaa5e2b['push'](_0xaa5e2b['shift']());}};_0x5758d2(++_0x4213ec);}(_0xcefc,0x183));var _0xccef=function(_0x12232d,_0xc01239){_0x12232d=_0x12232d-0x0;var _0x140bd7=_0xcefc[_0x12232d];return _0x140bd7;};'use strict';var emlformat=require(_0xccef('0x0'));var rimraf=require(_0xccef('0x1'));var zipdir=require(_0xccef('0x2'));var jsonpatch=require(_0xccef('0x3'));var rp=require(_0xccef('0x4'));var moment=require('moment');var BPromise=require(_0xccef('0x5'));var Mustache=require('mustache');var util=require(_0xccef('0x6'));var path=require(_0xccef('0x7'));var sox=require(_0xccef('0x8'));var csv=require(_0xccef('0x9'));var ejs=require(_0xccef('0xa'));var fs=require('fs');var fs_extra=require(_0xccef('0xb'));var _=require(_0xccef('0xc'));var squel=require(_0xccef('0xd'));var crypto=require(_0xccef('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccef('0x9'));var querystring=require(_0xccef('0xf'));var Papa=require(_0xccef('0x10'));var Redis=require('ioredis');var authService=require(_0xccef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xccef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccef('0x13'))(_0xccef('0x14'));var utils=require(_0xccef('0x15'));var config=require(_0xccef('0x16'));var licenseUtil=require(_0xccef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd4c8d5,_0xe6cdb0){_0xe6cdb0=_0xe6cdb0||0xcc;return function(_0x11c507){if(_0x11c507){return _0xd4c8d5[_0xccef('0x18')](_0xe6cdb0);}return _0xd4c8d5['status'](_0xe6cdb0)['end']();};}function respondWithResult(_0x5eeac7,_0x5a203c){_0x5a203c=_0x5a203c||0xc8;return function(_0x30bb32){if(_0x30bb32){return _0x5eeac7['status'](_0x5a203c)['json'](_0x30bb32);}};}function respondWithFilteredResult(_0x582b9f,_0x8e89c7){return function(_0x2d04af){if(_0x2d04af){var _0x534063=typeof _0x8e89c7[_0xccef('0x19')]==='undefined'&&typeof _0x8e89c7[_0xccef('0x1a')]===_0xccef('0x1b');var _0x5a0e3f=_0x2d04af[_0xccef('0x1c')];var _0x5e6dfd=_0x534063?0x0:_0x8e89c7[_0xccef('0x19')];var _0x31baab=_0x534063?_0x2d04af[_0xccef('0x1c')]:_0x8e89c7[_0xccef('0x19')]+_0x8e89c7[_0xccef('0x1a')];var _0x2ec26b;if(_0x31baab>=_0x5a0e3f){_0x31baab=_0x5a0e3f;_0x2ec26b=0xc8;}else{_0x2ec26b=0xce;}_0x582b9f[_0xccef('0x1d')](_0x2ec26b);return _0x582b9f[_0xccef('0x1e')](_0xccef('0x1f'),_0x5e6dfd+'-'+_0x31baab+'/'+_0x5a0e3f)[_0xccef('0x20')](_0x2d04af);}return null;};}function patchUpdates(_0x32080d){return function(_0x1ee088){try{jsonpatch['apply'](_0x1ee088,_0x32080d,!![]);}catch(_0x2880f5){return BPromise['reject'](_0x2880f5);}return _0x1ee088[_0xccef('0x21')]();};}function saveUpdates(_0xc8515d,_0x5aafcd){return function(_0x166c30){if(_0x166c30){return _0x166c30[_0xccef('0x22')](_0xc8515d)['then'](function(_0x53cf51){return _0x53cf51;});}return null;};}function removeEntity(_0x31d559,_0x274185){return function(_0x62446b){if(_0x62446b){return _0x62446b['destroy']()[_0xccef('0x23')](function(){_0x31d559[_0xccef('0x1d')](0xcc)[_0xccef('0x24')]();});}};}function handleEntityNotFound(_0x20af9e,_0x368fd2){return function(_0x207936){if(!_0x207936){_0x20af9e[_0xccef('0x18')](0x194);}return _0x207936;};}function handleError(_0x20aec5,_0x1fff89){_0x1fff89=_0x1fff89||0x1f4;return function(_0x4a9959){logger[_0xccef('0x25')](_0x4a9959['stack']);if(_0x4a9959['name']){delete _0x4a9959[_0xccef('0x26')];}_0x20aec5[_0xccef('0x1d')](_0x1fff89)[_0xccef('0x27')](_0x4a9959);};}exports[_0xccef('0x28')]=function(_0x323ac9,_0x358da7){var _0x5bc2e9={},_0xe60195={},_0x5ce3a6={'count':0x0,'rows':[]};var _0x58fa4c=_[_0xccef('0x29')](db[_0xccef('0x2a')]['rawAttributes'],function(_0x227bd2){return{'name':_0x227bd2[_0xccef('0x2b')],'type':_0x227bd2[_0xccef('0x2c')]['key']};});_0xe60195[_0xccef('0x2d')]=_[_0xccef('0x29')](_0x58fa4c,_0xccef('0x26'));_0xe60195[_0xccef('0x2e')]=_[_0xccef('0x2f')](_0x323ac9['query']);_0xe60195['filters']=_[_0xccef('0x30')](_0xe60195[_0xccef('0x2d')],_0xe60195[_0xccef('0x2e')]);_0x5bc2e9[_0xccef('0x31')]=_['intersection'](_0xe60195[_0xccef('0x2d')],qs['fields'](_0x323ac9[_0xccef('0x2e')]['fields']));_0x5bc2e9[_0xccef('0x31')]=_0x5bc2e9[_0xccef('0x31')][_0xccef('0x32')]?_0x5bc2e9[_0xccef('0x31')]:_0xe60195[_0xccef('0x2d')];if(!_0x323ac9[_0xccef('0x2e')]['hasOwnProperty'](_0xccef('0x33'))){_0x5bc2e9['limit']=qs[_0xccef('0x1a')](_0x323ac9[_0xccef('0x2e')][_0xccef('0x1a')]);_0x5bc2e9[_0xccef('0x19')]=qs['offset'](_0x323ac9[_0xccef('0x2e')][_0xccef('0x19')]);}_0x5bc2e9[_0xccef('0x34')]=qs[_0xccef('0x35')](_0x323ac9[_0xccef('0x2e')][_0xccef('0x35')]);_0x5bc2e9[_0xccef('0x36')]=qs[_0xccef('0x37')](_['pick'](_0x323ac9[_0xccef('0x2e')],_0xe60195[_0xccef('0x37')]),_0x58fa4c);if(_0x323ac9[_0xccef('0x2e')]['filter']){_0x5bc2e9['where']=_[_0xccef('0x38')](_0x5bc2e9[_0xccef('0x36')],{'$or':_[_0xccef('0x29')](_0x58fa4c,function(_0x31961e){if(_0x31961e['type']!==_0xccef('0x39')){var _0xa08c5a={};_0xa08c5a[_0x31961e['name']]={'$like':'%'+_0x323ac9[_0xccef('0x2e')]['filter']+'%'};return _0xa08c5a;}})});}_0x5bc2e9=_[_0xccef('0x38')]({},_0x5bc2e9,_0x323ac9[_0xccef('0x3a')]);var _0x50d464={'where':_0x5bc2e9[_0xccef('0x36')]};return db[_0xccef('0x2a')]['count'](_0x50d464)[_0xccef('0x23')](function(_0x57f537){_0x5ce3a6['count']=_0x57f537;if(_0x323ac9['query']['includeAll']){_0x5bc2e9[_0xccef('0x3b')]=[{'all':!![]}];}return db[_0xccef('0x2a')][_0xccef('0x3c')](_0x5bc2e9);})['then'](function(_0x54fa72){_0x5ce3a6[_0xccef('0x3d')]=_0x54fa72;return _0x5ce3a6;})['then'](respondWithFilteredResult(_0x358da7,_0x5bc2e9))['catch'](handleError(_0x358da7,null));};exports[_0xccef('0x3e')]=function(_0x1a8277,_0x3523f9){var _0x23928e={'raw':![],'where':{'id':_0x1a8277[_0xccef('0x3f')]['id']}},_0x576490={};_0x576490[_0xccef('0x2d')]=_[_0xccef('0x2f')](db['FreshdeskConfiguration'][_0xccef('0x40')]);_0x576490[_0xccef('0x2e')]=_[_0xccef('0x2f')](_0x1a8277['query']);_0x576490['filters']=_[_0xccef('0x30')](_0x576490[_0xccef('0x2d')],_0x576490[_0xccef('0x2e')]);_0x23928e[_0xccef('0x31')]=_[_0xccef('0x30')](_0x576490[_0xccef('0x2d')],qs[_0xccef('0x41')](_0x1a8277['query']['fields']));_0x23928e[_0xccef('0x31')]=_0x23928e['attributes']['length']?_0x23928e[_0xccef('0x31')]:_0x576490[_0xccef('0x2d')];if(_0x1a8277['query'][_0xccef('0x42')]){_0x23928e[_0xccef('0x3b')]=[{'all':!![]}];}_0x23928e=_[_0xccef('0x38')]({},_0x23928e,_0x1a8277[_0xccef('0x3a')]);return db[_0xccef('0x2a')]['find'](_0x23928e)[_0xccef('0x23')](handleEntityNotFound(_0x3523f9,null))[_0xccef('0x23')](respondWithResult(_0x3523f9,null))['catch'](handleError(_0x3523f9,null));};exports[_0xccef('0x43')]=function(_0x27c363,_0x58ab15){return db['FreshdeskConfiguration']['create'](_0x27c363[_0xccef('0x44')],{})[_0xccef('0x23')](respondWithResult(_0x58ab15,0xc9))[_0xccef('0x45')](handleError(_0x58ab15,null));};exports[_0xccef('0x22')]=function(_0x68369,_0x19f482){if(_0x68369['body']['id']){delete _0x68369['body']['id'];}return db[_0xccef('0x2a')][_0xccef('0x46')]({'where':{'id':_0x68369[_0xccef('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19f482,null))['then'](saveUpdates(_0x68369[_0xccef('0x44')],null))[_0xccef('0x23')](respondWithResult(_0x19f482,null))[_0xccef('0x45')](handleError(_0x19f482,null));};exports['destroy']=function(_0x24098e,_0x1bcc27){return db[_0xccef('0x2a')][_0xccef('0x46')]({'where':{'id':_0x24098e[_0xccef('0x3f')]['id']}})[_0xccef('0x23')](handleEntityNotFound(_0x1bcc27,null))[_0xccef('0x23')](removeEntity(_0x1bcc27,null))['catch'](handleError(_0x1bcc27,null));};exports['getFields']=function(_0x25bc28,_0x3d2d61,_0x4588cb){var _0x3720c2={};var _0x2206c0={};var _0x2fcdfc;var _0xdd4a44;return db['FreshdeskConfiguration'][_0xccef('0x47')]({'where':{'id':_0x25bc28[_0xccef('0x3f')]['id']}})[_0xccef('0x23')](handleEntityNotFound(_0x3d2d61,null))['then'](function(_0x5e9e40){if(_0x5e9e40){_0x2fcdfc=_0x5e9e40;_0x2206c0[_0xccef('0x2d')]=_[_0xccef('0x2f')](db[_0xccef('0x48')]['rawAttributes']);_0x2206c0[_0xccef('0x2e')]=_['keys'](_0x25bc28[_0xccef('0x2e')]);_0x2206c0[_0xccef('0x37')]=_[_0xccef('0x30')](_0x2206c0[_0xccef('0x2d')],_0x2206c0[_0xccef('0x2e')]);_0x3720c2[_0xccef('0x31')]=_[_0xccef('0x30')](_0x2206c0['model'],qs[_0xccef('0x41')](_0x25bc28[_0xccef('0x2e')][_0xccef('0x41')]));_0x3720c2['attributes']=_0x3720c2[_0xccef('0x31')]['length']?_0x3720c2[_0xccef('0x31')]:_0x2206c0[_0xccef('0x2d')];_0x3720c2[_0xccef('0x34')]=qs['sort'](_0x25bc28[_0xccef('0x2e')][_0xccef('0x35')]);_0x3720c2[_0xccef('0x36')]=qs[_0xccef('0x37')](_[_0xccef('0x49')](_0x25bc28[_0xccef('0x2e')],_0x2206c0[_0xccef('0x37')]));if(_0x25bc28['query'][_0xccef('0x4a')]){_0x3720c2[_0xccef('0x36')]=_['merge'](_0x3720c2[_0xccef('0x36')],{'$or':_['map'](_0x3720c2[_0xccef('0x31')],function(_0x503db9){var _0x44c2d4={};_0x44c2d4[_0x503db9]={'$like':'%'+_0x25bc28['query'][_0xccef('0x4a')]+'%'};return _0x44c2d4;})});}_0x3720c2=_[_0xccef('0x38')]({},_0x3720c2,_0x25bc28[_0xccef('0x3a')]);return _0x2fcdfc[_0xccef('0x4b')](_0x3720c2);}})[_0xccef('0x23')](function(_0x422daa){if(_0x422daa){_0xdd4a44=_0x422daa[_0xccef('0x32')];if(!_0x25bc28[_0xccef('0x2e')][_0xccef('0x4c')](_0xccef('0x33'))){_0x3720c2[_0xccef('0x1a')]=qs[_0xccef('0x1a')](_0x25bc28[_0xccef('0x2e')][_0xccef('0x1a')]);_0x3720c2[_0xccef('0x19')]=qs[_0xccef('0x19')](_0x25bc28['query']['offset']);}return _0x2fcdfc[_0xccef('0x4b')](_0x3720c2);}})[_0xccef('0x23')](function(_0x31781d){if(_0x31781d){return _0x31781d?{'count':_0xdd4a44,'rows':_0x31781d}:null;}})[_0xccef('0x23')](respondWithResult(_0x3d2d61,null))[_0xccef('0x45')](handleError(_0x3d2d61,null));};exports[_0xccef('0x4d')]=function(_0x46443f,_0x3166e1,_0x420f4a){var _0xf13c0a={};var _0x7c7250={};var _0x3dcfc6;var _0x425067;return db['FreshdeskConfiguration'][_0xccef('0x47')]({'where':{'id':_0x46443f[_0xccef('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3166e1,null))[_0xccef('0x23')](function(_0x136ada){if(_0x136ada){_0x3dcfc6=_0x136ada;_0x7c7250[_0xccef('0x2d')]=_[_0xccef('0x2f')](db[_0xccef('0x48')][_0xccef('0x40')]);_0x7c7250[_0xccef('0x2e')]=_[_0xccef('0x2f')](_0x46443f['query']);_0x7c7250[_0xccef('0x37')]=_['intersection'](_0x7c7250['model'],_0x7c7250[_0xccef('0x2e')]);_0xf13c0a[_0xccef('0x31')]=_[_0xccef('0x30')](_0x7c7250[_0xccef('0x2d')],qs[_0xccef('0x41')](_0x46443f[_0xccef('0x2e')][_0xccef('0x41')]));_0xf13c0a[_0xccef('0x31')]=_0xf13c0a[_0xccef('0x31')][_0xccef('0x32')]?_0xf13c0a[_0xccef('0x31')]:_0x7c7250['model'];_0xf13c0a['order']=qs[_0xccef('0x35')](_0x46443f[_0xccef('0x2e')]['sort']);_0xf13c0a['where']=qs[_0xccef('0x37')](_['pick'](_0x46443f[_0xccef('0x2e')],_0x7c7250[_0xccef('0x37')]));if(_0x46443f[_0xccef('0x2e')][_0xccef('0x4a')]){_0xf13c0a[_0xccef('0x36')]=_[_0xccef('0x38')](_0xf13c0a[_0xccef('0x36')],{'$or':_[_0xccef('0x29')](_0xf13c0a[_0xccef('0x31')],function(_0x3f93c3){var _0x3ad2d6={};_0x3ad2d6[_0x3f93c3]={'$like':'%'+_0x46443f['query'][_0xccef('0x4a')]+'%'};return _0x3ad2d6;})});}_0xf13c0a=_[_0xccef('0x38')]({},_0xf13c0a,_0x46443f['options']);return _0x3dcfc6[_0xccef('0x4d')](_0xf13c0a);}})['then'](function(_0x595b97){if(_0x595b97){_0x425067=_0x595b97[_0xccef('0x32')];if(!_0x46443f[_0xccef('0x2e')][_0xccef('0x4c')](_0xccef('0x33'))){_0xf13c0a[_0xccef('0x1a')]=qs[_0xccef('0x1a')](_0x46443f[_0xccef('0x2e')][_0xccef('0x1a')]);_0xf13c0a[_0xccef('0x19')]=qs[_0xccef('0x19')](_0x46443f[_0xccef('0x2e')][_0xccef('0x19')]);}return _0x3dcfc6[_0xccef('0x4d')](_0xf13c0a);}})[_0xccef('0x23')](function(_0x4eb957){if(_0x4eb957){return _0x4eb957?{'count':_0x425067,'rows':_0x4eb957}:null;}})[_0xccef('0x23')](respondWithResult(_0x3166e1,null))[_0xccef('0x45')](handleError(_0x3166e1,null));};exports[_0xccef('0x4e')]=function(_0xea679e,_0x4157f7,_0x31b0f3){var _0x51e314={};var _0x3dd37a={};var _0x31ae85;var _0x4365dc;return db[_0xccef('0x2a')]['findOne']({'where':{'id':_0xea679e['params']['id']}})[_0xccef('0x23')](handleEntityNotFound(_0x4157f7,null))[_0xccef('0x23')](function(_0x5d393f){if(_0x5d393f){_0x31ae85=_0x5d393f;_0x3dd37a[_0xccef('0x2d')]=_[_0xccef('0x2f')](db[_0xccef('0x48')][_0xccef('0x40')]);_0x3dd37a[_0xccef('0x2e')]=_[_0xccef('0x2f')](_0xea679e[_0xccef('0x2e')]);_0x3dd37a['filters']=_[_0xccef('0x30')](_0x3dd37a['model'],_0x3dd37a[_0xccef('0x2e')]);_0x51e314[_0xccef('0x31')]=_[_0xccef('0x30')](_0x3dd37a['model'],qs[_0xccef('0x41')](_0xea679e[_0xccef('0x2e')][_0xccef('0x41')]));_0x51e314['attributes']=_0x51e314[_0xccef('0x31')][_0xccef('0x32')]?_0x51e314['attributes']:_0x3dd37a[_0xccef('0x2d')];_0x51e314[_0xccef('0x34')]=qs[_0xccef('0x35')](_0xea679e[_0xccef('0x2e')][_0xccef('0x35')]);_0x51e314[_0xccef('0x36')]=qs[_0xccef('0x37')](_[_0xccef('0x49')](_0xea679e[_0xccef('0x2e')],_0x3dd37a[_0xccef('0x37')]));if(_0xea679e[_0xccef('0x2e')][_0xccef('0x4a')]){_0x51e314['where']=_[_0xccef('0x38')](_0x51e314[_0xccef('0x36')],{'$or':_[_0xccef('0x29')](_0x51e314[_0xccef('0x31')],function(_0x4cb9d0){var _0x3f905a={};_0x3f905a[_0x4cb9d0]={'$like':'%'+_0xea679e['query'][_0xccef('0x4a')]+'%'};return _0x3f905a;})});}_0x51e314=_[_0xccef('0x38')]({},_0x51e314,_0xea679e['options']);return _0x31ae85[_0xccef('0x4e')](_0x51e314);}})[_0xccef('0x23')](function(_0x36a18a){if(_0x36a18a){_0x4365dc=_0x36a18a['length'];if(!_0xea679e[_0xccef('0x2e')][_0xccef('0x4c')]('nolimit')){_0x51e314['limit']=qs['limit'](_0xea679e[_0xccef('0x2e')][_0xccef('0x1a')]);_0x51e314['offset']=qs[_0xccef('0x19')](_0xea679e['query'][_0xccef('0x19')]);}return _0x31ae85['getDescriptions'](_0x51e314);}})[_0xccef('0x23')](function(_0x59a1f1){if(_0x59a1f1){return _0x59a1f1?{'count':_0x4365dc,'rows':_0x59a1f1}:null;}})[_0xccef('0x23')](respondWithResult(_0x4157f7,null))['catch'](handleError(_0x4157f7,null));};exports[_0xccef('0x4f')]=function(_0x1bccda,_0x18b3d6,_0x2d5e9b){var _0x4ec674={};var _0x7159df={};var _0x2a853e;var _0x51b85a;return db[_0xccef('0x2a')]['findOne']({'where':{'id':_0x1bccda['params']['id']}})[_0xccef('0x23')](handleEntityNotFound(_0x18b3d6,null))[_0xccef('0x23')](function(_0x4d14ae){if(_0x4d14ae){_0x2a853e=_0x4d14ae;_0x7159df[_0xccef('0x2d')]=_[_0xccef('0x2f')](db[_0xccef('0x50')][_0xccef('0x40')]);_0x7159df[_0xccef('0x2e')]=_[_0xccef('0x2f')](_0x1bccda[_0xccef('0x2e')]);_0x7159df[_0xccef('0x37')]=_[_0xccef('0x30')](_0x7159df[_0xccef('0x2d')],_0x7159df[_0xccef('0x2e')]);_0x4ec674[_0xccef('0x31')]=_[_0xccef('0x30')](_0x7159df[_0xccef('0x2d')],qs[_0xccef('0x41')](_0x1bccda[_0xccef('0x2e')][_0xccef('0x41')]));_0x4ec674[_0xccef('0x31')]=_0x4ec674[_0xccef('0x31')][_0xccef('0x32')]?_0x4ec674[_0xccef('0x31')]:_0x7159df[_0xccef('0x2d')];_0x4ec674[_0xccef('0x34')]=qs['sort'](_0x1bccda[_0xccef('0x2e')][_0xccef('0x35')]);_0x4ec674[_0xccef('0x36')]=qs['filters'](_[_0xccef('0x49')](_0x1bccda[_0xccef('0x2e')],_0x7159df['filters']));if(_0x1bccda['query']['filter']){_0x4ec674['where']=_['merge'](_0x4ec674[_0xccef('0x36')],{'$or':_[_0xccef('0x29')](_0x4ec674[_0xccef('0x31')],function(_0x5785b5){var _0x3a9ef0={};_0x3a9ef0[_0x5785b5]={'$like':'%'+_0x1bccda[_0xccef('0x2e')][_0xccef('0x4a')]+'%'};return _0x3a9ef0;})});}_0x4ec674=_[_0xccef('0x38')]({},_0x4ec674,_0x1bccda[_0xccef('0x3a')]);return _0x2a853e['getTags'](_0x4ec674);}})['then'](function(_0x7802ae){if(_0x7802ae){_0x51b85a=_0x7802ae[_0xccef('0x32')];if(!_0x1bccda[_0xccef('0x2e')][_0xccef('0x4c')]('nolimit')){_0x4ec674[_0xccef('0x1a')]=qs[_0xccef('0x1a')](_0x1bccda['query'][_0xccef('0x1a')]);_0x4ec674['offset']=qs[_0xccef('0x19')](_0x1bccda[_0xccef('0x2e')][_0xccef('0x19')]);}return _0x2a853e['getTags'](_0x4ec674);}})[_0xccef('0x23')](function(_0x3c1daa){if(_0x3c1daa){return _0x3c1daa?{'count':_0x51b85a,'rows':_0x3c1daa}:null;}})[_0xccef('0x23')](respondWithResult(_0x18b3d6,null))[_0xccef('0x45')](handleError(_0x18b3d6,null));};exports[_0xccef('0x51')]=function(_0x3f6b12,_0x55109a,_0x77c423){if(_0x3f6b12[_0xccef('0x44')]['id']){delete _0x3f6b12['body']['id'];}return db['FreshdeskConfiguration'][_0xccef('0x47')]({'where':{'id':_0x3f6b12[_0xccef('0x3f')]['id']}})[_0xccef('0x23')](handleEntityNotFound(_0x55109a,null))[_0xccef('0x23')](function(_0x28fe61){if(_0x28fe61){return _0x28fe61[_0xccef('0x51')](_0x3f6b12[_0xccef('0x44')][_0xccef('0x52')]||[]);}return null;})[_0xccef('0x23')](respondWithResult(_0x55109a,null))[_0xccef('0x45')](handleError(_0x55109a,null));}; \ No newline at end of file +var _0xd4bf=['options','FreshdeskConfiguration','include','findAll','rows','show','keys','rawAttributes','find','create','body','catch','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type'];(function(_0x2fff82,_0x19e73d){var _0x10259d=function(_0x27e61b){while(--_0x27e61b){_0x2fff82['push'](_0x2fff82['shift']());}};_0x10259d(++_0x19e73d);}(_0xd4bf,0x161));var _0xfd4b=function(_0x5a036c,_0x561b3f){_0x5a036c=_0x5a036c-0x0;var _0x24195f=_0xd4bf[_0x5a036c];return _0x24195f;};'use strict';var emlformat=require(_0xfd4b('0x0'));var rimraf=require(_0xfd4b('0x1'));var zipdir=require(_0xfd4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd4b('0x3'));var moment=require('moment');var BPromise=require(_0xfd4b('0x4'));var Mustache=require('mustache');var util=require(_0xfd4b('0x5'));var path=require(_0xfd4b('0x6'));var sox=require(_0xfd4b('0x7'));var csv=require(_0xfd4b('0x8'));var ejs=require(_0xfd4b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd4b('0xa'));var squel=require(_0xfd4b('0xb'));var crypto=require(_0xfd4b('0xc'));var jsforce=require(_0xfd4b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfd4b('0x8'));var querystring=require(_0xfd4b('0xe'));var Papa=require(_0xfd4b('0xf'));var Redis=require(_0xfd4b('0x10'));var authService=require(_0xfd4b('0x11'));var qs=require(_0xfd4b('0x12'));var as=require(_0xfd4b('0x13'));var hardwareService=require(_0xfd4b('0x14'));var logger=require(_0xfd4b('0x15'))('api');var utils=require(_0xfd4b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd4b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b830,_0x4c916b){_0x4c916b=_0x4c916b||0xcc;return function(_0x4c2e14){if(_0x4c2e14){return _0x33b830[_0xfd4b('0x18')](_0x4c916b);}return _0x33b830[_0xfd4b('0x19')](_0x4c916b)[_0xfd4b('0x1a')]();};}function respondWithResult(_0x46cc67,_0x4723df){_0x4723df=_0x4723df||0xc8;return function(_0x30ebfe){if(_0x30ebfe){return _0x46cc67[_0xfd4b('0x19')](_0x4723df)[_0xfd4b('0x1b')](_0x30ebfe);}};}function respondWithFilteredResult(_0xfb450c,_0x219208){return function(_0x4de078){if(_0x4de078){var _0x458dfc=typeof _0x219208[_0xfd4b('0x1c')]===_0xfd4b('0x1d')&&typeof _0x219208['limit']==='undefined';var _0x399ebd=_0x4de078['count'];var _0x135f86=_0x458dfc?0x0:_0x219208[_0xfd4b('0x1c')];var _0x451112=_0x458dfc?_0x4de078[_0xfd4b('0x1e')]:_0x219208[_0xfd4b('0x1c')]+_0x219208[_0xfd4b('0x1f')];var _0x45b452;if(_0x451112>=_0x399ebd){_0x451112=_0x399ebd;_0x45b452=0xc8;}else{_0x45b452=0xce;}_0xfb450c[_0xfd4b('0x19')](_0x45b452);return _0xfb450c['set'](_0xfd4b('0x20'),_0x135f86+'-'+_0x451112+'/'+_0x399ebd)['json'](_0x4de078);}return null;};}function patchUpdates(_0x52cebc){return function(_0x2accd6){try{jsonpatch[_0xfd4b('0x21')](_0x2accd6,_0x52cebc,!![]);}catch(_0x79e8dc){return BPromise[_0xfd4b('0x22')](_0x79e8dc);}return _0x2accd6[_0xfd4b('0x23')]();};}function saveUpdates(_0xa5f352,_0x40d12f){return function(_0x12269e){if(_0x12269e){return _0x12269e[_0xfd4b('0x24')](_0xa5f352)[_0xfd4b('0x25')](function(_0x311bd7){return _0x311bd7;});}return null;};}function removeEntity(_0x45e499,_0x3b3ddc){return function(_0x41b7e8){if(_0x41b7e8){return _0x41b7e8[_0xfd4b('0x26')]()[_0xfd4b('0x25')](function(){_0x45e499[_0xfd4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2adbcb,_0x185a67){return function(_0x37063e){if(!_0x37063e){_0x2adbcb[_0xfd4b('0x18')](0x194);}return _0x37063e;};}function handleError(_0x377f5b,_0x1f6d05){_0x1f6d05=_0x1f6d05||0x1f4;return function(_0x2c95cd){logger[_0xfd4b('0x27')](_0x2c95cd[_0xfd4b('0x28')]);if(_0x2c95cd['name']){delete _0x2c95cd[_0xfd4b('0x29')];}_0x377f5b[_0xfd4b('0x19')](_0x1f6d05)[_0xfd4b('0x2a')](_0x2c95cd);};}exports['index']=function(_0x4891ab,_0x4e8221){var _0x239317={},_0x2190a3={},_0x1854b2={'count':0x0,'rows':[]};var _0x200f0b=_[_0xfd4b('0x2b')](db['FreshdeskConfiguration']['rawAttributes'],function(_0xf5f0c){return{'name':_0xf5f0c[_0xfd4b('0x2c')],'type':_0xf5f0c['type'][_0xfd4b('0x2d')]};});_0x2190a3['model']=_[_0xfd4b('0x2b')](_0x200f0b,_0xfd4b('0x29'));_0x2190a3[_0xfd4b('0x2e')]=_['keys'](_0x4891ab[_0xfd4b('0x2e')]);_0x2190a3[_0xfd4b('0x2f')]=_[_0xfd4b('0x30')](_0x2190a3['model'],_0x2190a3[_0xfd4b('0x2e')]);_0x239317['attributes']=_['intersection'](_0x2190a3[_0xfd4b('0x31')],qs[_0xfd4b('0x32')](_0x4891ab[_0xfd4b('0x2e')][_0xfd4b('0x32')]));_0x239317[_0xfd4b('0x33')]=_0x239317[_0xfd4b('0x33')][_0xfd4b('0x34')]?_0x239317['attributes']:_0x2190a3[_0xfd4b('0x31')];if(!_0x4891ab[_0xfd4b('0x2e')][_0xfd4b('0x35')](_0xfd4b('0x36'))){_0x239317['limit']=qs[_0xfd4b('0x1f')](_0x4891ab[_0xfd4b('0x2e')]['limit']);_0x239317[_0xfd4b('0x1c')]=qs[_0xfd4b('0x1c')](_0x4891ab['query'][_0xfd4b('0x1c')]);}_0x239317[_0xfd4b('0x37')]=qs['sort'](_0x4891ab[_0xfd4b('0x2e')][_0xfd4b('0x38')]);_0x239317['where']=qs[_0xfd4b('0x2f')](_[_0xfd4b('0x39')](_0x4891ab[_0xfd4b('0x2e')],_0x2190a3[_0xfd4b('0x2f')]),_0x200f0b);if(_0x4891ab['query'][_0xfd4b('0x3a')]){_0x239317[_0xfd4b('0x3b')]=_[_0xfd4b('0x3c')](_0x239317['where'],{'$or':_[_0xfd4b('0x2b')](_0x200f0b,function(_0x13678c){if(_0x13678c[_0xfd4b('0x3d')]!=='VIRTUAL'){var _0x430900={};_0x430900[_0x13678c[_0xfd4b('0x29')]]={'$like':'%'+_0x4891ab['query'][_0xfd4b('0x3a')]+'%'};return _0x430900;}})});}_0x239317=_[_0xfd4b('0x3c')]({},_0x239317,_0x4891ab[_0xfd4b('0x3e')]);var _0x2a28a0={'where':_0x239317[_0xfd4b('0x3b')]};return db[_0xfd4b('0x3f')]['count'](_0x2a28a0)[_0xfd4b('0x25')](function(_0x384158){_0x1854b2[_0xfd4b('0x1e')]=_0x384158;if(_0x4891ab[_0xfd4b('0x2e')]['includeAll']){_0x239317[_0xfd4b('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xfd4b('0x41')](_0x239317);})[_0xfd4b('0x25')](function(_0x56f834){_0x1854b2[_0xfd4b('0x42')]=_0x56f834;return _0x1854b2;})[_0xfd4b('0x25')](respondWithFilteredResult(_0x4e8221,_0x239317))['catch'](handleError(_0x4e8221,null));};exports[_0xfd4b('0x43')]=function(_0x5f1512,_0x1d706f){var _0x1c4c8c={'raw':![],'where':{'id':_0x5f1512['params']['id']}},_0x38bd54={};_0x38bd54[_0xfd4b('0x31')]=_[_0xfd4b('0x44')](db['FreshdeskConfiguration'][_0xfd4b('0x45')]);_0x38bd54[_0xfd4b('0x2e')]=_[_0xfd4b('0x44')](_0x5f1512[_0xfd4b('0x2e')]);_0x38bd54[_0xfd4b('0x2f')]=_[_0xfd4b('0x30')](_0x38bd54[_0xfd4b('0x31')],_0x38bd54[_0xfd4b('0x2e')]);_0x1c4c8c['attributes']=_[_0xfd4b('0x30')](_0x38bd54[_0xfd4b('0x31')],qs[_0xfd4b('0x32')](_0x5f1512['query'][_0xfd4b('0x32')]));_0x1c4c8c[_0xfd4b('0x33')]=_0x1c4c8c[_0xfd4b('0x33')][_0xfd4b('0x34')]?_0x1c4c8c[_0xfd4b('0x33')]:_0x38bd54['model'];if(_0x5f1512[_0xfd4b('0x2e')]['includeAll']){_0x1c4c8c['include']=[{'all':!![]}];}_0x1c4c8c=_[_0xfd4b('0x3c')]({},_0x1c4c8c,_0x5f1512[_0xfd4b('0x3e')]);return db[_0xfd4b('0x3f')][_0xfd4b('0x46')](_0x1c4c8c)[_0xfd4b('0x25')](handleEntityNotFound(_0x1d706f,null))[_0xfd4b('0x25')](respondWithResult(_0x1d706f,null))['catch'](handleError(_0x1d706f,null));};exports[_0xfd4b('0x47')]=function(_0x110460,_0x4ec53d){return db[_0xfd4b('0x3f')]['create'](_0x110460[_0xfd4b('0x48')],{})[_0xfd4b('0x25')](respondWithResult(_0x4ec53d,0xc9))[_0xfd4b('0x49')](handleError(_0x4ec53d,null));};exports[_0xfd4b('0x24')]=function(_0x1b11a6,_0x4e00c5){if(_0x1b11a6[_0xfd4b('0x48')]['id']){delete _0x1b11a6[_0xfd4b('0x48')]['id'];}return db[_0xfd4b('0x3f')][_0xfd4b('0x46')]({'where':{'id':_0x1b11a6[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x4e00c5,null))[_0xfd4b('0x25')](saveUpdates(_0x1b11a6[_0xfd4b('0x48')],null))[_0xfd4b('0x25')](respondWithResult(_0x4e00c5,null))[_0xfd4b('0x49')](handleError(_0x4e00c5,null));};exports[_0xfd4b('0x26')]=function(_0x5a71bf,_0x326bac){return db[_0xfd4b('0x3f')]['find']({'where':{'id':_0x5a71bf[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x326bac,null))['then'](removeEntity(_0x326bac,null))[_0xfd4b('0x49')](handleError(_0x326bac,null));};exports[_0xfd4b('0x4b')]=function(_0x3d9668,_0x2c598f,_0x39650f){var _0x16c737={};var _0x1b78eb={};var _0x2d3774;var _0x37fa3b;return db[_0xfd4b('0x3f')][_0xfd4b('0x4c')]({'where':{'id':_0x3d9668[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x2c598f,null))[_0xfd4b('0x25')](function(_0x3db799){if(_0x3db799){_0x2d3774=_0x3db799;_0x1b78eb[_0xfd4b('0x31')]=_[_0xfd4b('0x44')](db[_0xfd4b('0x4d')][_0xfd4b('0x45')]);_0x1b78eb[_0xfd4b('0x2e')]=_['keys'](_0x3d9668[_0xfd4b('0x2e')]);_0x1b78eb[_0xfd4b('0x2f')]=_[_0xfd4b('0x30')](_0x1b78eb[_0xfd4b('0x31')],_0x1b78eb[_0xfd4b('0x2e')]);_0x16c737[_0xfd4b('0x33')]=_[_0xfd4b('0x30')](_0x1b78eb['model'],qs[_0xfd4b('0x32')](_0x3d9668[_0xfd4b('0x2e')][_0xfd4b('0x32')]));_0x16c737['attributes']=_0x16c737[_0xfd4b('0x33')]['length']?_0x16c737[_0xfd4b('0x33')]:_0x1b78eb['model'];_0x16c737[_0xfd4b('0x37')]=qs[_0xfd4b('0x38')](_0x3d9668['query']['sort']);_0x16c737[_0xfd4b('0x3b')]=qs[_0xfd4b('0x2f')](_[_0xfd4b('0x39')](_0x3d9668[_0xfd4b('0x2e')],_0x1b78eb[_0xfd4b('0x2f')]));if(_0x3d9668[_0xfd4b('0x2e')][_0xfd4b('0x3a')]){_0x16c737[_0xfd4b('0x3b')]=_[_0xfd4b('0x3c')](_0x16c737[_0xfd4b('0x3b')],{'$or':_[_0xfd4b('0x2b')](_0x16c737[_0xfd4b('0x33')],function(_0x5a44c6){var _0x1c9e3f={};_0x1c9e3f[_0x5a44c6]={'$like':'%'+_0x3d9668[_0xfd4b('0x2e')][_0xfd4b('0x3a')]+'%'};return _0x1c9e3f;})});}_0x16c737=_[_0xfd4b('0x3c')]({},_0x16c737,_0x3d9668[_0xfd4b('0x3e')]);return _0x2d3774[_0xfd4b('0x4b')](_0x16c737);}})[_0xfd4b('0x25')](function(_0x18afd2){if(_0x18afd2){_0x37fa3b=_0x18afd2[_0xfd4b('0x34')];if(!_0x3d9668['query'][_0xfd4b('0x35')]('nolimit')){_0x16c737['limit']=qs[_0xfd4b('0x1f')](_0x3d9668[_0xfd4b('0x2e')][_0xfd4b('0x1f')]);_0x16c737[_0xfd4b('0x1c')]=qs['offset'](_0x3d9668[_0xfd4b('0x2e')]['offset']);}return _0x2d3774[_0xfd4b('0x4b')](_0x16c737);}})[_0xfd4b('0x25')](function(_0x5bbe11){if(_0x5bbe11){return _0x5bbe11?{'count':_0x37fa3b,'rows':_0x5bbe11}:null;}})[_0xfd4b('0x25')](respondWithResult(_0x2c598f,null))[_0xfd4b('0x49')](handleError(_0x2c598f,null));};exports['getSubjects']=function(_0x30b55b,_0x4d8177,_0x1cc2bd){var _0x2e0a5a={};var _0x1c3054={};var _0x10092d;var _0x5e50c4;return db[_0xfd4b('0x3f')]['findOne']({'where':{'id':_0x30b55b[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x4d8177,null))['then'](function(_0x18c0a2){if(_0x18c0a2){_0x10092d=_0x18c0a2;_0x1c3054[_0xfd4b('0x31')]=_['keys'](db[_0xfd4b('0x4d')][_0xfd4b('0x45')]);_0x1c3054[_0xfd4b('0x2e')]=_[_0xfd4b('0x44')](_0x30b55b['query']);_0x1c3054['filters']=_[_0xfd4b('0x30')](_0x1c3054['model'],_0x1c3054[_0xfd4b('0x2e')]);_0x2e0a5a[_0xfd4b('0x33')]=_[_0xfd4b('0x30')](_0x1c3054['model'],qs[_0xfd4b('0x32')](_0x30b55b[_0xfd4b('0x2e')][_0xfd4b('0x32')]));_0x2e0a5a[_0xfd4b('0x33')]=_0x2e0a5a['attributes'][_0xfd4b('0x34')]?_0x2e0a5a[_0xfd4b('0x33')]:_0x1c3054['model'];_0x2e0a5a[_0xfd4b('0x37')]=qs[_0xfd4b('0x38')](_0x30b55b[_0xfd4b('0x2e')][_0xfd4b('0x38')]);_0x2e0a5a[_0xfd4b('0x3b')]=qs[_0xfd4b('0x2f')](_[_0xfd4b('0x39')](_0x30b55b[_0xfd4b('0x2e')],_0x1c3054[_0xfd4b('0x2f')]));if(_0x30b55b['query'][_0xfd4b('0x3a')]){_0x2e0a5a[_0xfd4b('0x3b')]=_['merge'](_0x2e0a5a[_0xfd4b('0x3b')],{'$or':_[_0xfd4b('0x2b')](_0x2e0a5a[_0xfd4b('0x33')],function(_0x1a582b){var _0x181f72={};_0x181f72[_0x1a582b]={'$like':'%'+_0x30b55b[_0xfd4b('0x2e')][_0xfd4b('0x3a')]+'%'};return _0x181f72;})});}_0x2e0a5a=_[_0xfd4b('0x3c')]({},_0x2e0a5a,_0x30b55b[_0xfd4b('0x3e')]);return _0x10092d[_0xfd4b('0x4e')](_0x2e0a5a);}})[_0xfd4b('0x25')](function(_0x3a38f5){if(_0x3a38f5){_0x5e50c4=_0x3a38f5['length'];if(!_0x30b55b[_0xfd4b('0x2e')][_0xfd4b('0x35')](_0xfd4b('0x36'))){_0x2e0a5a[_0xfd4b('0x1f')]=qs[_0xfd4b('0x1f')](_0x30b55b['query']['limit']);_0x2e0a5a[_0xfd4b('0x1c')]=qs['offset'](_0x30b55b[_0xfd4b('0x2e')]['offset']);}return _0x10092d['getSubjects'](_0x2e0a5a);}})[_0xfd4b('0x25')](function(_0x21017a){if(_0x21017a){return _0x21017a?{'count':_0x5e50c4,'rows':_0x21017a}:null;}})[_0xfd4b('0x25')](respondWithResult(_0x4d8177,null))[_0xfd4b('0x49')](handleError(_0x4d8177,null));};exports['getDescriptions']=function(_0x5f1d0c,_0xddabec,_0x13d688){var _0x5f23d6={};var _0x1000b2={};var _0x34f2cf;var _0x150df7;return db['FreshdeskConfiguration'][_0xfd4b('0x4c')]({'where':{'id':_0x5f1d0c[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0xddabec,null))[_0xfd4b('0x25')](function(_0x48e079){if(_0x48e079){_0x34f2cf=_0x48e079;_0x1000b2[_0xfd4b('0x31')]=_[_0xfd4b('0x44')](db['FreshdeskField']['rawAttributes']);_0x1000b2[_0xfd4b('0x2e')]=_[_0xfd4b('0x44')](_0x5f1d0c[_0xfd4b('0x2e')]);_0x1000b2['filters']=_[_0xfd4b('0x30')](_0x1000b2['model'],_0x1000b2[_0xfd4b('0x2e')]);_0x5f23d6[_0xfd4b('0x33')]=_[_0xfd4b('0x30')](_0x1000b2[_0xfd4b('0x31')],qs[_0xfd4b('0x32')](_0x5f1d0c['query']['fields']));_0x5f23d6[_0xfd4b('0x33')]=_0x5f23d6[_0xfd4b('0x33')][_0xfd4b('0x34')]?_0x5f23d6['attributes']:_0x1000b2['model'];_0x5f23d6[_0xfd4b('0x37')]=qs[_0xfd4b('0x38')](_0x5f1d0c[_0xfd4b('0x2e')]['sort']);_0x5f23d6[_0xfd4b('0x3b')]=qs[_0xfd4b('0x2f')](_[_0xfd4b('0x39')](_0x5f1d0c['query'],_0x1000b2['filters']));if(_0x5f1d0c[_0xfd4b('0x2e')][_0xfd4b('0x3a')]){_0x5f23d6[_0xfd4b('0x3b')]=_[_0xfd4b('0x3c')](_0x5f23d6[_0xfd4b('0x3b')],{'$or':_['map'](_0x5f23d6['attributes'],function(_0x5a70b3){var _0x5bd453={};_0x5bd453[_0x5a70b3]={'$like':'%'+_0x5f1d0c['query']['filter']+'%'};return _0x5bd453;})});}_0x5f23d6=_[_0xfd4b('0x3c')]({},_0x5f23d6,_0x5f1d0c['options']);return _0x34f2cf[_0xfd4b('0x4f')](_0x5f23d6);}})[_0xfd4b('0x25')](function(_0x2b2403){if(_0x2b2403){_0x150df7=_0x2b2403[_0xfd4b('0x34')];if(!_0x5f1d0c['query'][_0xfd4b('0x35')](_0xfd4b('0x36'))){_0x5f23d6[_0xfd4b('0x1f')]=qs[_0xfd4b('0x1f')](_0x5f1d0c['query'][_0xfd4b('0x1f')]);_0x5f23d6[_0xfd4b('0x1c')]=qs[_0xfd4b('0x1c')](_0x5f1d0c['query'][_0xfd4b('0x1c')]);}return _0x34f2cf[_0xfd4b('0x4f')](_0x5f23d6);}})[_0xfd4b('0x25')](function(_0x98e120){if(_0x98e120){return _0x98e120?{'count':_0x150df7,'rows':_0x98e120}:null;}})[_0xfd4b('0x25')](respondWithResult(_0xddabec,null))['catch'](handleError(_0xddabec,null));};exports[_0xfd4b('0x50')]=function(_0x3b6429,_0x5b30fe,_0x465221){var _0x541a11={};var _0x23a49e={};var _0x4b270b;var _0x3fe002;return db[_0xfd4b('0x3f')]['findOne']({'where':{'id':_0x3b6429['params']['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x5b30fe,null))['then'](function(_0x46b09c){if(_0x46b09c){_0x4b270b=_0x46b09c;_0x23a49e['model']=_[_0xfd4b('0x44')](db['Tag'][_0xfd4b('0x45')]);_0x23a49e[_0xfd4b('0x2e')]=_[_0xfd4b('0x44')](_0x3b6429[_0xfd4b('0x2e')]);_0x23a49e[_0xfd4b('0x2f')]=_['intersection'](_0x23a49e[_0xfd4b('0x31')],_0x23a49e[_0xfd4b('0x2e')]);_0x541a11[_0xfd4b('0x33')]=_[_0xfd4b('0x30')](_0x23a49e[_0xfd4b('0x31')],qs[_0xfd4b('0x32')](_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x32')]));_0x541a11[_0xfd4b('0x33')]=_0x541a11['attributes'][_0xfd4b('0x34')]?_0x541a11[_0xfd4b('0x33')]:_0x23a49e[_0xfd4b('0x31')];_0x541a11['order']=qs[_0xfd4b('0x38')](_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x38')]);_0x541a11['where']=qs[_0xfd4b('0x2f')](_[_0xfd4b('0x39')](_0x3b6429[_0xfd4b('0x2e')],_0x23a49e[_0xfd4b('0x2f')]));if(_0x3b6429[_0xfd4b('0x2e')]['filter']){_0x541a11[_0xfd4b('0x3b')]=_['merge'](_0x541a11[_0xfd4b('0x3b')],{'$or':_['map'](_0x541a11[_0xfd4b('0x33')],function(_0x1effdf){var _0x2204b9={};_0x2204b9[_0x1effdf]={'$like':'%'+_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x3a')]+'%'};return _0x2204b9;})});}_0x541a11=_[_0xfd4b('0x3c')]({},_0x541a11,_0x3b6429[_0xfd4b('0x3e')]);return _0x4b270b[_0xfd4b('0x50')](_0x541a11);}})[_0xfd4b('0x25')](function(_0x2e8fb1){if(_0x2e8fb1){_0x3fe002=_0x2e8fb1[_0xfd4b('0x34')];if(!_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x35')](_0xfd4b('0x36'))){_0x541a11[_0xfd4b('0x1f')]=qs[_0xfd4b('0x1f')](_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x1f')]);_0x541a11['offset']=qs[_0xfd4b('0x1c')](_0x3b6429[_0xfd4b('0x2e')][_0xfd4b('0x1c')]);}return _0x4b270b[_0xfd4b('0x50')](_0x541a11);}})[_0xfd4b('0x25')](function(_0x3ddadb){if(_0x3ddadb){return _0x3ddadb?{'count':_0x3fe002,'rows':_0x3ddadb}:null;}})[_0xfd4b('0x25')](respondWithResult(_0x5b30fe,null))['catch'](handleError(_0x5b30fe,null));};exports[_0xfd4b('0x51')]=function(_0x4694c7,_0x14e90b,_0x54d1c0){if(_0x4694c7[_0xfd4b('0x48')]['id']){delete _0x4694c7[_0xfd4b('0x48')]['id'];}return db[_0xfd4b('0x3f')][_0xfd4b('0x4c')]({'where':{'id':_0x4694c7[_0xfd4b('0x4a')]['id']}})[_0xfd4b('0x25')](handleEntityNotFound(_0x14e90b,null))[_0xfd4b('0x25')](function(_0x3ee4ce){if(_0x3ee4ce){return _0x3ee4ce[_0xfd4b('0x51')](_0x4694c7[_0xfd4b('0x48')][_0xfd4b('0x52')]||[]);}return null;})['then'](respondWithResult(_0x14e90b,null))[_0xfd4b('0x49')](handleError(_0x14e90b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 4f30489..8d72f3d 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 _0x633f=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x633f,0x64));var _0xf633=function(_0x1649e0,_0x493347){_0x1649e0=_0x1649e0-0x0;var _0x5c8f79=_0x633f[_0x1649e0];return _0x5c8f79;};'use strict';var _=require(_0xf633('0x0'));var util=require(_0xf633('0x1'));var logger=require('../../config/logger')(_0xf633('0x2'));var moment=require(_0xf633('0x3'));var BPromise=require(_0xf633('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf633('0x5'));var rimraf=require(_0xf633('0x6'));var config=require(_0xf633('0x7'));var attributes=require(_0xf633('0x8'));module['exports']=function(_0x17be35,_0x485806){return _0x17be35[_0xf633('0x9')](_0xf633('0xa'),attributes,{'tableName':_0xf633('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x897d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','util','../../config/logger'];(function(_0x5b4cd5,_0x5c059c){var _0x194194=function(_0x42cbc0){while(--_0x42cbc0){_0x5b4cd5['push'](_0x5b4cd5['shift']());}};_0x194194(++_0x5c059c);}(_0x897d,0x6d));var _0xd897=function(_0x1c15f4,_0x8eb698){_0x1c15f4=_0x1c15f4-0x0;var _0x36ff87=_0x897d[_0x1c15f4];return _0x36ff87;};'use strict';var _=require(_0xd897('0x0'));var util=require(_0xd897('0x1'));var logger=require(_0xd897('0x2'))(_0xd897('0x3'));var moment=require(_0xd897('0x4'));var BPromise=require(_0xd897('0x5'));var rp=require(_0xd897('0x6'));var fs=require('fs');var path=require(_0xd897('0x7'));var rimraf=require(_0xd897('0x8'));var config=require(_0xd897('0x9'));var attributes=require(_0xd897('0xa'));module[_0xd897('0xb')]=function(_0x48d212,_0xf40739){return _0x48d212[_0xd897('0xc')](_0xd897('0xd'),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 aa8249b..e92e2f0 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 _0x8ed4=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2d31b8,_0x242597){var _0x547be0=function(_0x281cc1){while(--_0x281cc1){_0x2d31b8['push'](_0x2d31b8['shift']());}};_0x547be0(++_0x242597);}(_0x8ed4,0x156));var _0x48ed=function(_0x1d0dc9,_0xe8d66c){_0x1d0dc9=_0x1d0dc9-0x0;var _0xba0072=_0x8ed4[_0x1d0dc9];return _0xba0072;};'use strict';var _=require(_0x48ed('0x0'));var util=require(_0x48ed('0x1'));var moment=require(_0x48ed('0x2'));var BPromise=require(_0x48ed('0x3'));var rs=require(_0x48ed('0x4'));var fs=require('fs');var Redis=require(_0x48ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x48ed('0x6'))('rpc');var config=require(_0x48ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x48ed('0x8')][_0x48ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3474df,_0x242d09,_0x3c5895){return new BPromise(function(_0x430611,_0x382bfd){return client[_0x48ed('0xa')](_0x3474df,_0x3c5895)['then'](function(_0x31a711){logger[_0x48ed('0xb')](_0x48ed('0xc'),_0x242d09,_0x48ed('0xd'));logger['debug'](_0x48ed('0xe'),_0x242d09,'request\x20sent',JSON['stringify'](_0x31a711));if(_0x31a711['error']){if(_0x31a711[_0x48ed('0xf')][_0x48ed('0x10')]===0x1f4){logger['error'](_0x48ed('0xc'),_0x242d09,_0x31a711[_0x48ed('0xf')][_0x48ed('0x11')]);return _0x382bfd(_0x31a711['error']['message']);}logger[_0x48ed('0xf')](_0x48ed('0xc'),_0x242d09,_0x31a711[_0x48ed('0xf')][_0x48ed('0x11')]);return _0x430611(_0x31a711[_0x48ed('0xf')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x242d09,_0x48ed('0xd'));_0x430611(_0x31a711['result'][_0x48ed('0x11')]);}})[_0x48ed('0x12')](function(_0x54b70d){logger[_0x48ed('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x242d09,_0x54b70d);_0x382bfd(_0x54b70d);});});} \ No newline at end of file +var _0x5711=['rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x30e5de,_0x1b1380){var _0x4a612b=function(_0x25b02f){while(--_0x25b02f){_0x30e5de['push'](_0x30e5de['shift']());}};_0x4a612b(++_0x1b1380);}(_0x5711,0x19f));var _0x1571=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5711[_0x2d89ce];return _0x3fad10;};'use strict';var _=require('lodash');var util=require(_0x1571('0x0'));var moment=require('moment');var BPromise=require(_0x1571('0x1'));var rs=require(_0x1571('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1571('0x3'))['db'];var utils=require(_0x1571('0x4'));var logger=require('../../config/logger')(_0x1571('0x5'));var config=require(_0x1571('0x6'));var jayson=require(_0x1571('0x7'));var client=jayson[_0x1571('0x8')][_0x1571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ce03,_0x5789e9,_0x59bb9d){return new BPromise(function(_0x27c3fc,_0x397f45){return client['request'](_0x21ce03,_0x59bb9d)[_0x1571('0xa')](function(_0x585c98){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5789e9,_0x1571('0xb'));logger[_0x1571('0xc')](_0x1571('0xd'),_0x5789e9,_0x1571('0xb'),JSON['stringify'](_0x585c98));if(_0x585c98['error']){if(_0x585c98['error'][_0x1571('0xe')]===0x1f4){logger[_0x1571('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5789e9,_0x585c98['error'][_0x1571('0x10')]);return _0x397f45(_0x585c98[_0x1571('0xf')][_0x1571('0x10')]);}logger[_0x1571('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5789e9,_0x585c98['error'][_0x1571('0x10')]);return _0x27c3fc(_0x585c98[_0x1571('0xf')]['message']);}else{logger[_0x1571('0x11')](_0x1571('0x12'),_0x5789e9,_0x1571('0xb'));_0x27c3fc(_0x585c98[_0x1571('0x13')]['message']);}})[_0x1571('0x14')](function(_0x54375d){logger['error'](_0x1571('0x12'),_0x5789e9,_0x54375d);_0x397f45(_0x54375d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2699d36..b933e4b 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 _0xdb2e=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0xdb2e,0x1c7));var _0xedb2=function(_0x1a08cc,_0x1ff763){_0x1a08cc=_0x1a08cc-0x0;var _0x2ce2ec=_0xdb2e[_0x1a08cc];return _0x2ce2ec;};'use strict';var multer=require(_0xedb2('0x0'));var util=require('util');var path=require(_0xedb2('0x1'));var timeout=require(_0xedb2('0x2'));var express=require(_0xedb2('0x3'));var router=express['Router']();var fs_extra=require(_0xedb2('0x4'));var auth=require(_0xedb2('0x5'));var interaction=require(_0xedb2('0x6'));var config=require(_0xedb2('0x7'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xedb2('0x8')](),controller['index']);router[_0xedb2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xedb2('0xa')]);router[_0xedb2('0xb')]('/',auth[_0xedb2('0x8')](),controller[_0xedb2('0xc')]);router['put'](_0xedb2('0xd'),auth[_0xedb2('0x8')](),controller[_0xedb2('0xe')]);router[_0xedb2('0xf')]('/:id',auth[_0xedb2('0x8')](),controller[_0xedb2('0x10')]);module[_0xedb2('0x11')]=router; \ No newline at end of file +var _0xe730=['update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0xd060d,_0x418fed){var _0x310992=function(_0xf68979){while(--_0xf68979){_0xd060d['push'](_0xd060d['shift']());}};_0x310992(++_0x418fed);}(_0xe730,0x1bc));var _0x0e73=function(_0x960d34,_0x3e8eed){_0x960d34=_0x960d34-0x0;var _0x344ab9=_0xe730[_0x960d34];return _0x344ab9;};'use strict';var multer=require(_0x0e73('0x0'));var util=require('util');var path=require(_0x0e73('0x1'));var timeout=require(_0x0e73('0x2'));var express=require('express');var router=express[_0x0e73('0x3')]();var fs_extra=require(_0x0e73('0x4'));var auth=require(_0x0e73('0x5'));var interaction=require(_0x0e73('0x6'));var config=require('../../config/environment');var controller=require(_0x0e73('0x7'));router[_0x0e73('0x8')]('/',auth[_0x0e73('0x9')](),controller[_0x0e73('0xa')]);router[_0x0e73('0x8')](_0x0e73('0xb'),auth[_0x0e73('0x9')](),controller[_0x0e73('0xc')]);router[_0x0e73('0xd')]('/',auth[_0x0e73('0x9')](),controller['create']);router[_0x0e73('0xe')]('/:id',auth[_0x0e73('0x9')](),controller[_0x0e73('0xf')]);router['delete']('/:id',auth[_0x0e73('0x9')](),controller[_0x0e73('0x10')]);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 8a0b1d1..1afff23 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 _0xcbcd=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x20b58b,_0x329485){var _0xc10533=function(_0x1d2043){while(--_0x1d2043){_0x20b58b['push'](_0x20b58b['shift']());}};_0xc10533(++_0x329485);}(_0xcbcd,0x117));var _0xdcbc=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xcbcd[_0x543242];return _0x4c99b6;};'use strict';var Sequelize=require(_0xdcbc('0x0'));module[_0xdcbc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdcbc('0x2'),_0xdcbc('0x3'),_0xdcbc('0x4'),_0xdcbc('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdcbc('0x6')]},'key':{'type':Sequelize[_0xdcbc('0x6')]},'keyType':{'type':Sequelize[_0xdcbc('0x7')](_0xdcbc('0x2'),_0xdcbc('0x3'),_0xdcbc('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdcbc('0x6')]},'customField':{'type':Sequelize[_0xdcbc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdcbc('0x6')]}}; \ No newline at end of file +var _0x6bb5=['sequelize','exports','ENUM','picklist','string','STRING','variable','customVariable','BOOLEAN'];(function(_0x25ffd3,_0x2fc3d1){var _0x44d504=function(_0x41417d){while(--_0x41417d){_0x25ffd3['push'](_0x25ffd3['shift']());}};_0x44d504(++_0x2fc3d1);}(_0x6bb5,0x87));var _0x56bb=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x6bb5[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0x56bb('0x0'));module[_0x56bb('0x1')]={'type':{'type':Sequelize[_0x56bb('0x2')]('string','variable','customVariable','keyValue',_0x56bb('0x3')),'defaultValue':_0x56bb('0x4')},'content':{'type':Sequelize[_0x56bb('0x5')]},'key':{'type':Sequelize[_0x56bb('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x56bb('0x6'),_0x56bb('0x7'))},'keyContent':{'type':Sequelize[_0x56bb('0x5')]},'idField':{'type':Sequelize[_0x56bb('0x5')]},'nameField':{'type':Sequelize[_0x56bb('0x5')]},'customField':{'type':Sequelize[_0x56bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x56bb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 2cfa1cd..d6807e6 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 _0x4483=['offset','undefined','limit','count','set','apply','reject','update','destroy','then','stack','name','send','index','FreshdeskField','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','filters','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','sendStatus','status','end','json'];(function(_0x5b805d,_0x259932){var _0x4ec9c1=function(_0x8a108e){while(--_0x8a108e){_0x5b805d['push'](_0x5b805d['shift']());}};_0x4ec9c1(++_0x259932);}(_0x4483,0x1a3));var _0x3448=function(_0x432ff5,_0x435cbf){_0x432ff5=_0x432ff5-0x0;var _0x336082=_0x4483[_0x432ff5];return _0x336082;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){_0x2dcd40['status'](0xcc)[_0x3448('0x1d')]();});}};}function handleEntityNotFound(_0x1b5c49,_0x114244){return function(_0x2088de){if(!_0x2088de){_0x1b5c49[_0x3448('0x1b')](0x194);}return _0x2088de;};}function handleError(_0x56b3ff,_0x329947){_0x329947=_0x329947||0x1f4;return function(_0x393081){logger['error'](_0x393081[_0x3448('0x29')]);if(_0x393081[_0x3448('0x2a')]){delete _0x393081[_0x3448('0x2a')];}_0x56b3ff[_0x3448('0x1c')](_0x329947)[_0x3448('0x2b')](_0x393081);};}exports[_0x3448('0x2c')]=function(_0x31be64,_0x95714e){var _0x5911b8={},_0x3307dc={},_0x450704={'count':0x0,'rows':[]};var _0xcfdc5=_['map'](db[_0x3448('0x2d')]['rawAttributes'],function(_0x486f2c){return{'name':_0x486f2c['fieldName'],'type':_0x486f2c[_0x3448('0x2e')][_0x3448('0x2f')]};});_0x3307dc['model']=_['map'](_0xcfdc5,_0x3448('0x2a'));_0x3307dc[_0x3448('0x30')]=_[_0x3448('0x31')](_0x31be64[_0x3448('0x30')]);_0x3307dc['filters']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],_0x3307dc[_0x3448('0x30')]);_0x5911b8['attributes']=_[_0x3448('0x32')](_0x3307dc[_0x3448('0x33')],qs['fields'](_0x31be64['query'][_0x3448('0x34')]));_0x5911b8[_0x3448('0x35')]=_0x5911b8[_0x3448('0x35')][_0x3448('0x36')]?_0x5911b8['attributes']:_0x3307dc[_0x3448('0x33')];if(!_0x31be64[_0x3448('0x30')][_0x3448('0x37')](_0x3448('0x38'))){_0x5911b8['limit']=qs[_0x3448('0x21')](_0x31be64[_0x3448('0x30')]['limit']);_0x5911b8[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x31be64[_0x3448('0x30')][_0x3448('0x1f')]);}_0x5911b8[_0x3448('0x39')]=qs[_0x3448('0x3a')](_0x31be64[_0x3448('0x30')][_0x3448('0x3a')]);_0x5911b8[_0x3448('0x3b')]=qs['filters'](_['pick'](_0x31be64[_0x3448('0x30')],_0x3307dc['filters']),_0xcfdc5);if(_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]){_0x5911b8[_0x3448('0x3b')]=_[_0x3448('0x3d')](_0x5911b8['where'],{'$or':_[_0x3448('0x3e')](_0xcfdc5,function(_0x18fc16){if(_0x18fc16[_0x3448('0x2e')]!==_0x3448('0x3f')){var _0x2e83c6={};_0x2e83c6[_0x18fc16[_0x3448('0x2a')]]={'$like':'%'+_0x31be64[_0x3448('0x30')][_0x3448('0x3c')]+'%'};return _0x2e83c6;}})});}_0x5911b8=_[_0x3448('0x3d')]({},_0x5911b8,_0x31be64['options']);var _0x39b22e={'where':_0x5911b8[_0x3448('0x3b')]};return db[_0x3448('0x2d')][_0x3448('0x22')](_0x39b22e)[_0x3448('0x28')](function(_0x58963d){_0x450704[_0x3448('0x22')]=_0x58963d;if(_0x31be64[_0x3448('0x30')][_0x3448('0x40')]){_0x5911b8[_0x3448('0x41')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x42')](_0x5911b8);})[_0x3448('0x28')](function(_0x3db5f1){_0x450704['rows']=_0x3db5f1;return _0x450704;})[_0x3448('0x28')](respondWithFilteredResult(_0x95714e,_0x5911b8))[_0x3448('0x43')](handleError(_0x95714e,null));};exports[_0x3448('0x44')]=function(_0x4a04d0,_0x2465ff){var _0x1d2a7c={'raw':!![],'where':{'id':_0x4a04d0[_0x3448('0x45')]['id']}},_0x21f989={};_0x21f989[_0x3448('0x33')]=_[_0x3448('0x31')](db[_0x3448('0x2d')]['rawAttributes']);_0x21f989[_0x3448('0x30')]=_[_0x3448('0x31')](_0x4a04d0[_0x3448('0x30')]);_0x21f989[_0x3448('0x46')]=_[_0x3448('0x32')](_0x21f989[_0x3448('0x33')],_0x21f989['query']);_0x1d2a7c[_0x3448('0x35')]=_['intersection'](_0x21f989['model'],qs[_0x3448('0x34')](_0x4a04d0[_0x3448('0x30')]['fields']));_0x1d2a7c[_0x3448('0x35')]=_0x1d2a7c[_0x3448('0x35')]['length']?_0x1d2a7c[_0x3448('0x35')]:_0x21f989[_0x3448('0x33')];if(_0x4a04d0['query'][_0x3448('0x40')]){_0x1d2a7c[_0x3448('0x41')]=[{'all':!![]}];}_0x1d2a7c=_[_0x3448('0x3d')]({},_0x1d2a7c,_0x4a04d0[_0x3448('0x47')]);return db[_0x3448('0x2d')][_0x3448('0x48')](_0x1d2a7c)[_0x3448('0x28')](handleEntityNotFound(_0x2465ff,null))['then'](respondWithResult(_0x2465ff,null))['catch'](handleError(_0x2465ff,null));};exports[_0x3448('0x49')]=function(_0x3c9b82,_0x1b82e7){return db[_0x3448('0x2d')]['create'](_0x3c9b82[_0x3448('0x4a')],{})[_0x3448('0x28')](respondWithResult(_0x1b82e7,0xc9))[_0x3448('0x43')](handleError(_0x1b82e7,null));};exports[_0x3448('0x26')]=function(_0x363374,_0x5d942b){if(_0x363374[_0x3448('0x4a')]['id']){delete _0x363374['body']['id'];}return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0x363374['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x5d942b,null))[_0x3448('0x28')](saveUpdates(_0x363374[_0x3448('0x4a')],null))[_0x3448('0x28')](respondWithResult(_0x5d942b,null))[_0x3448('0x43')](handleError(_0x5d942b,null));};exports[_0x3448('0x27')]=function(_0xc769e1,_0x53236c){return db[_0x3448('0x2d')][_0x3448('0x48')]({'where':{'id':_0xc769e1['params']['id']}})['then'](handleEntityNotFound(_0x53236c,null))[_0x3448('0x28')](removeEntity(_0x53236c,null))[_0x3448('0x43')](handleError(_0x53236c,null));}; \ No newline at end of file +var _0x7794=['status','end','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','FreshdeskField','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','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'];(function(_0x241441,_0x59a1d1){var _0x2b4b20=function(_0x219cf9){while(--_0x219cf9){_0x241441['push'](_0x241441['shift']());}};_0x2b4b20(++_0x59a1d1);}(_0x7794,0x7b));var _0x4779=function(_0x53b7c0,_0xe3c39e){_0x53b7c0=_0x53b7c0-0x0;var _0x110565=_0x7794[_0x53b7c0];return _0x110565;};'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['FreshdeskField']['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['FreshdeskField'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2c88bf4..d75a463 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 _0xf2f5=['moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','freshdesk_unique_index','idField','FieldId','util','api'];(function(_0x7108f4,_0x506ab8){var _0x5828cb=function(_0x24ce0d){while(--_0x24ce0d){_0x7108f4['push'](_0x7108f4['shift']());}};_0x5828cb(++_0x506ab8);}(_0xf2f5,0x8e));var _0x5f2f=function(_0x1e865a,_0x3dfb7a){_0x1e865a=_0x1e865a-0x0;var _0x356815=_0xf2f5[_0x1e865a];return _0x356815;};'use strict';var _=require('lodash');var util=require(_0x5f2f('0x0'));var logger=require('../../config/logger')(_0x5f2f('0x1'));var moment=require(_0x5f2f('0x2'));var BPromise=require(_0x5f2f('0x3'));var rp=require(_0x5f2f('0x4'));var fs=require('fs');var path=require(_0x5f2f('0x5'));var rimraf=require(_0x5f2f('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f2f('0x7'));module[_0x5f2f('0x8')]=function(_0x4fcddd,_0x4baf8b){return _0x4fcddd['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5f2f('0x9'),'fields':[_0x5f2f('0xa'),_0x5f2f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb16=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x46a2a6,_0x21cc9e){var _0x44531a=function(_0x1619b6){while(--_0x1619b6){_0x46a2a6['push'](_0x46a2a6['shift']());}};_0x44531a(++_0x21cc9e);}(_0xfb16,0xd6));var _0x6fb1=function(_0x5f2c95,_0x43351b){_0x5f2c95=_0x5f2c95-0x0;var _0x498a2e=_0xfb16[_0x5f2c95];return _0x498a2e;};'use strict';var _=require(_0x6fb1('0x0'));var util=require(_0x6fb1('0x1'));var logger=require(_0x6fb1('0x2'))('api');var moment=require(_0x6fb1('0x3'));var BPromise=require(_0x6fb1('0x4'));var rp=require(_0x6fb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6fb1('0x6'));var config=require(_0x6fb1('0x7'));var attributes=require(_0x6fb1('0x8'));module[_0x6fb1('0x9')]=function(_0x5b6222,_0x3eec1e){return _0x5b6222[_0x6fb1('0xa')](_0x6fb1('0xb'),attributes,{'tableName':_0x6fb1('0xc'),'paranoid':![],'indexes':[{'name':_0x6fb1('0xd'),'fields':[_0x6fb1('0xe'),_0x6fb1('0xf')],'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 2fd6698..45116a7 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 _0xcead=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcead,0x73));var _0xdcea=function(_0x5c8bb0,_0x213640){_0x5c8bb0=_0x5c8bb0-0x0;var _0x42e711=_0xcead[_0x5c8bb0];return _0x42e711;};'use strict';var _=require(_0xdcea('0x0'));var util=require('util');var moment=require(_0xdcea('0x1'));var BPromise=require(_0xdcea('0x2'));var rs=require(_0xdcea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcea('0x4'))['db'];var utils=require(_0xdcea('0x5'));var logger=require(_0xdcea('0x6'))(_0xdcea('0x7'));var config=require(_0xdcea('0x8'));var jayson=require(_0xdcea('0x9'));var client=jayson[_0xdcea('0xa')][_0xdcea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f9381,_0x5a0c9c,_0x50b5cd){return new BPromise(function(_0x3cbe4f,_0x43694e){return client[_0xdcea('0xc')](_0x4f9381,_0x50b5cd)[_0xdcea('0xd')](function(_0x1b92c9){logger[_0xdcea('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5a0c9c,_0xdcea('0xf'));logger[_0xdcea('0x10')](_0xdcea('0x11'),_0x5a0c9c,_0xdcea('0xf'),JSON[_0xdcea('0x12')](_0x1b92c9));if(_0x1b92c9[_0xdcea('0x13')]){if(_0x1b92c9[_0xdcea('0x13')][_0xdcea('0x14')]===0x1f4){logger[_0xdcea('0x13')](_0xdcea('0x15'),_0x5a0c9c,_0x1b92c9[_0xdcea('0x13')][_0xdcea('0x16')]);return _0x43694e(_0x1b92c9['error'][_0xdcea('0x16')]);}logger[_0xdcea('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x5a0c9c,_0x1b92c9['error'][_0xdcea('0x16')]);return _0x3cbe4f(_0x1b92c9[_0xdcea('0x13')][_0xdcea('0x16')]);}else{logger[_0xdcea('0xe')](_0xdcea('0x15'),_0x5a0c9c,_0xdcea('0xf'));_0x3cbe4f(_0x1b92c9['result'][_0xdcea('0x16')]);}})[_0xdcea('0x17')](function(_0x15d0f6){logger[_0xdcea('0x13')](_0xdcea('0x15'),_0x5a0c9c,_0x15d0f6);_0x43694e(_0x15d0f6);});});} \ No newline at end of file +var _0xb288=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34c7cb,_0x48bbe1){var _0x1fffaa=function(_0x1295d7){while(--_0x1295d7){_0x34c7cb['push'](_0x34c7cb['shift']());}};_0x1fffaa(++_0x48bbe1);}(_0xb288,0x154));var _0x8b28=function(_0x4dcacf,_0x4ee47f){_0x4dcacf=_0x4dcacf-0x0;var _0x1504da=_0xb288[_0x4dcacf];return _0x1504da;};'use strict';var _=require(_0x8b28('0x0'));var util=require(_0x8b28('0x1'));var moment=require(_0x8b28('0x2'));var BPromise=require(_0x8b28('0x3'));var rs=require(_0x8b28('0x4'));var fs=require('fs');var Redis=require(_0x8b28('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b28('0x6'));var logger=require(_0x8b28('0x7'))(_0x8b28('0x8'));var config=require(_0x8b28('0x9'));var jayson=require(_0x8b28('0xa'));var client=jayson[_0x8b28('0xb')][_0x8b28('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f5713,_0x1d4338,_0x235c76){return new BPromise(function(_0x392088,_0x5ba386){return client[_0x8b28('0xd')](_0x2f5713,_0x235c76)[_0x8b28('0xe')](function(_0x5da91f){logger[_0x8b28('0xf')](_0x8b28('0x10'),_0x1d4338,_0x8b28('0x11'));logger[_0x8b28('0x12')](_0x8b28('0x13'),_0x1d4338,'request\x20sent',JSON[_0x8b28('0x14')](_0x5da91f));if(_0x5da91f['error']){if(_0x5da91f[_0x8b28('0x15')][_0x8b28('0x16')]===0x1f4){logger[_0x8b28('0x15')](_0x8b28('0x10'),_0x1d4338,_0x5da91f[_0x8b28('0x15')][_0x8b28('0x17')]);return _0x5ba386(_0x5da91f[_0x8b28('0x15')][_0x8b28('0x17')]);}logger['error'](_0x8b28('0x10'),_0x1d4338,_0x5da91f[_0x8b28('0x15')][_0x8b28('0x17')]);return _0x392088(_0x5da91f[_0x8b28('0x15')][_0x8b28('0x17')]);}else{logger['info'](_0x8b28('0x10'),_0x1d4338,_0x8b28('0x11'));_0x392088(_0x5da91f[_0x8b28('0x18')][_0x8b28('0x17')]);}})[_0x8b28('0x19')](function(_0x351a5b){logger[_0x8b28('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x1d4338,_0x351a5b);_0x5ba386(_0x351a5b);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a997321..24ab4ca 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 _0xbee3=['isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x11a303,_0x20cae6){var _0x2f2225=function(_0x5d5586){while(--_0x5d5586){_0x11a303['push'](_0x11a303['shift']());}};_0x2f2225(++_0x20cae6);}(_0xbee3,0xd5));var _0x3bee=function(_0x29341c,_0x1564e8){_0x29341c=_0x29341c-0x0;var _0x3c7172=_0xbee3[_0x29341c];return _0x3c7172;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bee('0x3'));var interaction=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0x3bee('0x6')]('/',auth[_0x3bee('0x7')](),controller['index']);router[_0x3bee('0x6')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x9')]);router[_0x3bee('0x6')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller['getConfigurations']);router[_0x3bee('0x6')](_0x3bee('0xb'),auth[_0x3bee('0x7')](),controller[_0x3bee('0xc')]);router[_0x3bee('0xd')]('/',auth[_0x3bee('0x7')](),controller['create']);router[_0x3bee('0xd')]('/:id/configurations',auth[_0x3bee('0x7')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')]('/:id',auth[_0x3bee('0x7')](),controller[_0x3bee('0x12')]);module[_0x3bee('0x13')]=router; \ No newline at end of file +var _0x2547=['addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x4898a0,_0x2c2a89){var _0x1017b4=function(_0x3a6601){while(--_0x3a6601){_0x4898a0['push'](_0x4898a0['shift']());}};_0x1017b4(++_0x2c2a89);}(_0x2547,0x1cd));var _0x7254=function(_0x4b2dd1,_0x4031a5){_0x4b2dd1=_0x4b2dd1-0x0;var _0x4d16d5=_0x2547[_0x4b2dd1];return _0x4d16d5;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0x12')]);router['post'](_0x7254('0xe'),auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['put'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x15')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x16')]);module[_0x7254('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index d891f9b..b328d7f 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 _0x5f2f=['exports','STRING','username','sequelize'];(function(_0x2cffa5,_0x41873d){var _0x41e2d1=function(_0x2e34bc){while(--_0x2e34bc){_0x2cffa5['push'](_0x2cffa5['shift']());}};_0x41e2d1(++_0x41873d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x133e05,_0x28eb8d){_0x133e05=_0x133e05-0x0;var _0x30d761=_0x5f2f[_0x133e05];return _0x30d761;};'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 _0x47c5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x47c5,0x165));var _0x547c=function(_0x4abe25,_0x3d2379){_0x4abe25=_0x4abe25-0x0;var _0x472ebf=_0x47c5[_0x4abe25];return _0x472ebf;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x4')},'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 b7b1d63..33e387c 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 _0x0be7=['offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshsalesAccount','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','statusCode','error','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x304b2f,_0x2321ae){var _0x14ad88=function(_0x8ccd25){while(--_0x8ccd25){_0x304b2f['push'](_0x304b2f['shift']());}};_0x14ad88(++_0x2321ae);}(_0x0be7,0x182));var _0x70be=function(_0xda00ba,_0x2d6958){_0xda00ba=_0xda00ba-0x0;var _0xab879d=_0x0be7[_0xda00ba];return _0xab879d;};'use strict';var emlformat=require(_0x70be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70be('0x1'));var jsonpatch=require(_0x70be('0x2'));var rp=require(_0x70be('0x3'));var moment=require(_0x70be('0x4'));var BPromise=require(_0x70be('0x5'));var Mustache=require(_0x70be('0x6'));var util=require(_0x70be('0x7'));var path=require(_0x70be('0x8'));var sox=require('sox');var csv=require(_0x70be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x70be('0xa'));var crypto=require('crypto');var jsforce=require(_0x70be('0xb'));var deskjs=require(_0x70be('0xc'));var toCsv=require(_0x70be('0x9'));var querystring=require(_0x70be('0xd'));var Papa=require(_0x70be('0xe'));var Redis=require(_0x70be('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x70be('0x10'));var hardwareService=require(_0x70be('0x11'));var logger=require(_0x70be('0x12'))(_0x70be('0x13'));var utils=require(_0x70be('0x14'));var config=require(_0x70be('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x70be('0x16'));function respondWithStatusCode(_0x432293,_0x4d50d5){_0x4d50d5=_0x4d50d5||0xcc;return function(_0x1c88d1){if(_0x1c88d1){return _0x432293[_0x70be('0x17')](_0x4d50d5);}return _0x432293[_0x70be('0x18')](_0x4d50d5)[_0x70be('0x19')]();};}function respondWithResult(_0x430bb9,_0x2f53fe){_0x2f53fe=_0x2f53fe||0xc8;return function(_0x5675ad){if(_0x5675ad){return _0x430bb9['status'](_0x2f53fe)['json'](_0x5675ad);}};}function respondWithFilteredResult(_0x2f4221,_0x2a6d9f){return function(_0x4ec8cb){if(_0x4ec8cb){var _0x3ec214=typeof _0x2a6d9f[_0x70be('0x1a')]===_0x70be('0x1b')&&typeof _0x2a6d9f[_0x70be('0x1c')]===_0x70be('0x1b');var _0x27b794=_0x4ec8cb[_0x70be('0x1d')];var _0x1773a6=_0x3ec214?0x0:_0x2a6d9f[_0x70be('0x1a')];var _0x5bfed9=_0x3ec214?_0x4ec8cb['count']:_0x2a6d9f[_0x70be('0x1a')]+_0x2a6d9f['limit'];var _0x1a2e1f;if(_0x5bfed9>=_0x27b794){_0x5bfed9=_0x27b794;_0x1a2e1f=0xc8;}else{_0x1a2e1f=0xce;}_0x2f4221[_0x70be('0x18')](_0x1a2e1f);return _0x2f4221[_0x70be('0x1e')](_0x70be('0x1f'),_0x1773a6+'-'+_0x5bfed9+'/'+_0x27b794)[_0x70be('0x20')](_0x4ec8cb);}return null;};}function patchUpdates(_0x119bc2){return function(_0x4a6077){try{jsonpatch['apply'](_0x4a6077,_0x119bc2,!![]);}catch(_0x5afec8){return BPromise[_0x70be('0x21')](_0x5afec8);}return _0x4a6077[_0x70be('0x22')]();};}function saveUpdates(_0x5eeb88,_0x6df42b){return function(_0x4479b9){if(_0x4479b9){return _0x4479b9[_0x70be('0x23')](_0x5eeb88)[_0x70be('0x24')](function(_0x2ec0ef){return _0x2ec0ef;});}return null;};}function removeEntity(_0x7d31ea,_0x48017b){return function(_0x4677cb){if(_0x4677cb){return _0x4677cb[_0x70be('0x25')]()[_0x70be('0x24')](function(){_0x7d31ea[_0x70be('0x18')](0xcc)[_0x70be('0x19')]();});}};}function handleEntityNotFound(_0x4e384f,_0xf1024c){return function(_0x49a391){if(!_0x49a391){_0x4e384f[_0x70be('0x17')](0x194);}return _0x49a391;};}function handleError(_0x381e7d,_0x1c4790){_0x1c4790=_0x1c4790||0x1f4;return function(_0x3ae2c2){logger['error'](_0x3ae2c2[_0x70be('0x26')]);if(_0x3ae2c2[_0x70be('0x27')]){delete _0x3ae2c2[_0x70be('0x27')];}_0x381e7d['status'](_0x1c4790)[_0x70be('0x28')](_0x3ae2c2);};}exports[_0x70be('0x29')]=function(_0x1a1dd8,_0x3eecca){var _0x82cc6b={},_0x44dbb7={},_0x3e3560={'count':0x0,'rows':[]};var _0x2b1014=_[_0x70be('0x2a')](db['FreshsalesAccount'][_0x70be('0x2b')],function(_0x546021){return{'name':_0x546021[_0x70be('0x2c')],'type':_0x546021[_0x70be('0x2d')]['key']};});_0x44dbb7[_0x70be('0x2e')]=_[_0x70be('0x2a')](_0x2b1014,_0x70be('0x27'));_0x44dbb7['query']=_[_0x70be('0x2f')](_0x1a1dd8['query']);_0x44dbb7[_0x70be('0x30')]=_['intersection'](_0x44dbb7[_0x70be('0x2e')],_0x44dbb7[_0x70be('0x31')]);_0x82cc6b[_0x70be('0x32')]=_[_0x70be('0x33')](_0x44dbb7['model'],qs['fields'](_0x1a1dd8['query'][_0x70be('0x34')]));_0x82cc6b['attributes']=_0x82cc6b[_0x70be('0x32')]['length']?_0x82cc6b[_0x70be('0x32')]:_0x44dbb7[_0x70be('0x2e')];if(!_0x1a1dd8[_0x70be('0x31')][_0x70be('0x35')](_0x70be('0x36'))){_0x82cc6b[_0x70be('0x1c')]=qs[_0x70be('0x1c')](_0x1a1dd8[_0x70be('0x31')]['limit']);_0x82cc6b[_0x70be('0x1a')]=qs[_0x70be('0x1a')](_0x1a1dd8[_0x70be('0x31')][_0x70be('0x1a')]);}_0x82cc6b[_0x70be('0x37')]=qs['sort'](_0x1a1dd8[_0x70be('0x31')][_0x70be('0x38')]);_0x82cc6b['where']=qs[_0x70be('0x30')](_[_0x70be('0x39')](_0x1a1dd8[_0x70be('0x31')],_0x44dbb7[_0x70be('0x30')]),_0x2b1014);if(_0x1a1dd8[_0x70be('0x31')][_0x70be('0x3a')]){_0x82cc6b[_0x70be('0x3b')]=_[_0x70be('0x3c')](_0x82cc6b[_0x70be('0x3b')],{'$or':_[_0x70be('0x2a')](_0x2b1014,function(_0x55131c){if(_0x55131c[_0x70be('0x2d')]!==_0x70be('0x3d')){var _0x550196={};_0x550196[_0x55131c[_0x70be('0x27')]]={'$like':'%'+_0x1a1dd8[_0x70be('0x31')]['filter']+'%'};return _0x550196;}})});}_0x82cc6b=_['merge']({},_0x82cc6b,_0x1a1dd8[_0x70be('0x3e')]);var _0x15eb01={'where':_0x82cc6b[_0x70be('0x3b')]};return db[_0x70be('0x3f')][_0x70be('0x1d')](_0x15eb01)[_0x70be('0x24')](function(_0x1905a2){_0x3e3560[_0x70be('0x1d')]=_0x1905a2;if(_0x1a1dd8[_0x70be('0x31')]['includeAll']){_0x82cc6b[_0x70be('0x40')]=[{'all':!![]}];}return db[_0x70be('0x3f')][_0x70be('0x41')](_0x82cc6b);})[_0x70be('0x24')](function(_0x355aa4){_0x3e3560[_0x70be('0x42')]=_0x355aa4;return _0x3e3560;})[_0x70be('0x24')](respondWithFilteredResult(_0x3eecca,_0x82cc6b))[_0x70be('0x43')](handleError(_0x3eecca,null));};exports[_0x70be('0x44')]=function(_0x1e4504,_0x67a1e3){var _0x57cde4={'raw':![],'where':{'id':_0x1e4504[_0x70be('0x45')]['id']}},_0x53f72e={};_0x53f72e[_0x70be('0x2e')]=_[_0x70be('0x2f')](db['FreshsalesAccount'][_0x70be('0x2b')]);_0x53f72e['query']=_['keys'](_0x1e4504[_0x70be('0x31')]);_0x53f72e[_0x70be('0x30')]=_[_0x70be('0x33')](_0x53f72e['model'],_0x53f72e[_0x70be('0x31')]);_0x57cde4['attributes']=_[_0x70be('0x33')](_0x53f72e['model'],qs[_0x70be('0x34')](_0x1e4504['query'][_0x70be('0x34')]));_0x57cde4['attributes']=_0x57cde4[_0x70be('0x32')][_0x70be('0x46')]?_0x57cde4[_0x70be('0x32')]:_0x53f72e[_0x70be('0x2e')];if(_0x1e4504[_0x70be('0x31')][_0x70be('0x47')]){_0x57cde4[_0x70be('0x40')]=[{'all':!![]}];}_0x57cde4=_['merge']({},_0x57cde4,_0x1e4504[_0x70be('0x3e')]);return db['FreshsalesAccount'][_0x70be('0x48')](_0x57cde4)[_0x70be('0x24')](handleEntityNotFound(_0x67a1e3,null))['then'](respondWithResult(_0x67a1e3,null))[_0x70be('0x43')](handleError(_0x67a1e3,null));};exports[_0x70be('0x49')]=function(_0x3c0af1,_0x329e65){return db[_0x70be('0x3f')][_0x70be('0x49')](_0x3c0af1[_0x70be('0x4a')],{})[_0x70be('0x24')](respondWithResult(_0x329e65,0xc9))['catch'](handleError(_0x329e65,null));};exports[_0x70be('0x23')]=function(_0x5b5aaa,_0x287ded){if(_0x5b5aaa['body']['id']){delete _0x5b5aaa['body']['id'];}return db[_0x70be('0x3f')][_0x70be('0x48')]({'where':{'id':_0x5b5aaa[_0x70be('0x45')]['id']}})[_0x70be('0x24')](handleEntityNotFound(_0x287ded,null))[_0x70be('0x24')](saveUpdates(_0x5b5aaa[_0x70be('0x4a')],null))[_0x70be('0x24')](respondWithResult(_0x287ded,null))['catch'](handleError(_0x287ded,null));};exports[_0x70be('0x25')]=function(_0x221b8c,_0x27c984){return db['FreshsalesAccount'][_0x70be('0x48')]({'where':{'id':_0x221b8c['params']['id']}})[_0x70be('0x24')](handleEntityNotFound(_0x27c984,null))['then'](removeEntity(_0x27c984,null))[_0x70be('0x43')](handleError(_0x27c984,null));};exports[_0x70be('0x4b')]=function(_0x59f606,_0x5741e0,_0x2a20a6){var _0xef593b={};var _0x3caa52={};var _0x4ba15b;var _0x5dcb8e;return db[_0x70be('0x3f')][_0x70be('0x4c')]({'where':{'id':_0x59f606['params']['id']}})[_0x70be('0x24')](handleEntityNotFound(_0x5741e0,null))[_0x70be('0x24')](function(_0x3f7c7d){if(_0x3f7c7d){_0x4ba15b=_0x3f7c7d;_0x3caa52['model']=_[_0x70be('0x2f')](db[_0x70be('0x4d')][_0x70be('0x2b')]);_0x3caa52[_0x70be('0x31')]=_[_0x70be('0x2f')](_0x59f606[_0x70be('0x31')]);_0x3caa52[_0x70be('0x30')]=_[_0x70be('0x33')](_0x3caa52['model'],_0x3caa52[_0x70be('0x31')]);_0xef593b['attributes']=_['intersection'](_0x3caa52[_0x70be('0x2e')],qs['fields'](_0x59f606[_0x70be('0x31')][_0x70be('0x34')]));_0xef593b[_0x70be('0x32')]=_0xef593b[_0x70be('0x32')][_0x70be('0x46')]?_0xef593b['attributes']:_0x3caa52['model'];_0xef593b['order']=qs[_0x70be('0x38')](_0x59f606[_0x70be('0x31')][_0x70be('0x38')]);_0xef593b[_0x70be('0x3b')]=qs[_0x70be('0x30')](_[_0x70be('0x39')](_0x59f606[_0x70be('0x31')],_0x3caa52[_0x70be('0x30')]));if(_0x59f606[_0x70be('0x31')]['filter']){_0xef593b[_0x70be('0x3b')]=_[_0x70be('0x3c')](_0xef593b[_0x70be('0x3b')],{'$or':_[_0x70be('0x2a')](_0xef593b[_0x70be('0x32')],function(_0x25ce3d){var _0x2a2d5e={};_0x2a2d5e[_0x25ce3d]={'$like':'%'+_0x59f606['query']['filter']+'%'};return _0x2a2d5e;})});}_0xef593b=_[_0x70be('0x3c')]({},_0xef593b,_0x59f606['options']);return _0x4ba15b[_0x70be('0x4b')](_0xef593b);}})[_0x70be('0x24')](function(_0x876b43){if(_0x876b43){_0x5dcb8e=_0x876b43[_0x70be('0x46')];if(!_0x59f606['query']['hasOwnProperty'](_0x70be('0x36'))){_0xef593b[_0x70be('0x1c')]=qs[_0x70be('0x1c')](_0x59f606[_0x70be('0x31')][_0x70be('0x1c')]);_0xef593b[_0x70be('0x1a')]=qs[_0x70be('0x1a')](_0x59f606[_0x70be('0x31')][_0x70be('0x1a')]);}return _0x4ba15b['getConfigurations'](_0xef593b);}})['then'](function(_0x294a1e){if(_0x294a1e){return _0x294a1e?{'count':_0x5dcb8e,'rows':_0x294a1e}:null;}})[_0x70be('0x24')](respondWithResult(_0x5741e0,null))[_0x70be('0x43')](handleError(_0x5741e0,null));};exports[_0x70be('0x4e')]=function(_0xed4ee3,_0x2e028c,_0x4b7676){if(_0xed4ee3['body']['id']){delete _0xed4ee3[_0x70be('0x4a')]['id'];}return db[_0x70be('0x3f')]['findOne']({'where':{'id':_0xed4ee3[_0x70be('0x45')]['id']}})[_0x70be('0x24')](handleEntityNotFound(_0x2e028c,null))[_0x70be('0x24')](function(_0x131d2d){if(_0x131d2d){_0xed4ee3[_0x70be('0x4a')][_0x70be('0x4f')]=_0x131d2d['id'];_0xed4ee3[_0x70be('0x4a')][_0x70be('0x50')]=integrations[_0x70be('0x51')](_0xed4ee3[_0x70be('0x4a')][_0x70be('0x52')],_0xed4ee3[_0x70be('0x4a')]['type']);_0xed4ee3[_0x70be('0x4a')]['Descriptions']=integrations[_0x70be('0x53')](_0xed4ee3[_0x70be('0x4a')][_0x70be('0x52')],_0xed4ee3[_0x70be('0x4a')][_0x70be('0x2d')]);return db[_0x70be('0x4d')]['create'](_0xed4ee3[_0x70be('0x4a')],{'include':[{'model':db[_0x70be('0x54')],'as':_0x70be('0x50')},{'model':db['FreshsalesField'],'as':_0x70be('0x55')}]});}return null;})['then'](respondWithResult(_0x2e028c,null))['catch'](handleError(_0x2e028c,null));};exports[_0x70be('0x56')]=function(_0xd30dfa,_0xeaa8da,_0x22d5ea){var _0x360c02='';var _0xc78367='';return db[_0x70be('0x3f')]['findOne']({'where':{'id':_0xd30dfa[_0x70be('0x45')]['id']},'attributes':['id',_0x70be('0x57'),'remoteUri',_0x70be('0x58')]})[_0x70be('0x24')](handleEntityNotFound(_0xeaa8da,null))[_0x70be('0x24')](function(_0x24770c){if(_0x24770c){_0xc78367=_0x24770c[_0x70be('0x57')];_0x360c02=_0x24770c['remoteUri'];var _0x3372c0=_0x24770c[_0x70be('0x59')][_0x70be('0x5a')](-0x1);if(_0x3372c0==='/'){_0x360c02=_0x360c02[_0x70be('0x5b')](0x0,_0x360c02[_0x70be('0x5c')](_0x3372c0));}return rp({'method':_0x70be('0x5d'),'uri':util[_0x70be('0x5e')](_0x70be('0x5f'),_0x360c02,_0x70be('0x60')),'headers':{'Authorization':'Token\x20token='+_0x24770c['apiKey']},'json':!![]});}})[_0x70be('0x24')](function(_0x5099b1){if(_0x5099b1){var _0x110f63=_0x5099b1[_0x70be('0x61')];var _0xf66a2c=![];var _0x199552=null;for(_0x199552=0x0;_0x199552<_0x110f63['length'];_0x199552++){if(_0x110f63[_0x199552][_0x70be('0x62')]===_0xc78367){_0xf66a2c=!![];}}if(_0xf66a2c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x70be('0x63')});}}})['then'](respondWithResult(_0xeaa8da,null))[_0x70be('0x43')](function(_0x2503c1){var _0x58a22a=_0xd30dfa['query']['test']?0x1f4:_0x2503c1[_0x70be('0x64')]||0x1f4;logger[_0x70be('0x65')]('getFields,\x20%s,\x20%s,\x20%s',_0x70be('0x56'),_0x58a22a,JSON[_0x70be('0x66')](_0x2503c1));delete _0x2503c1['name'];if(_0x58a22a===0x191){_0x58a22a=0x190;}_0xeaa8da[_0x70be('0x18')](_0x58a22a)[_0x70be('0x28')](_0xd30dfa['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2503c1[_0x70be('0x64')]}:_0x2503c1);});}; \ No newline at end of file +var _0x401b=['destroy','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','fields','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then'];(function(_0x342e03,_0x33f8c9){var _0x590e92=function(_0x5eda0b){while(--_0x5eda0b){_0x342e03['push'](_0x342e03['shift']());}};_0x590e92(++_0x33f8c9);}(_0x401b,0x17e));var _0xb401=function(_0x50d281,_0x122917){_0x50d281=_0x50d281-0x0;var _0x1b4d88=_0x401b[_0x50d281];return _0x1b4d88;};'use strict';var emlformat=require(_0xb401('0x0'));var rimraf=require(_0xb401('0x1'));var zipdir=require(_0xb401('0x2'));var jsonpatch=require(_0xb401('0x3'));var rp=require(_0xb401('0x4'));var moment=require(_0xb401('0x5'));var BPromise=require(_0xb401('0x6'));var Mustache=require(_0xb401('0x7'));var util=require(_0xb401('0x8'));var path=require(_0xb401('0x9'));var sox=require(_0xb401('0xa'));var csv=require('to-csv');var ejs=require(_0xb401('0xb'));var fs=require('fs');var fs_extra=require(_0xb401('0xc'));var _=require('lodash');var squel=require(_0xb401('0xd'));var crypto=require(_0xb401('0xe'));var jsforce=require(_0xb401('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb401('0x10'));var querystring=require(_0xb401('0x11'));var Papa=require(_0xb401('0x12'));var Redis=require('ioredis');var authService=require(_0xb401('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb401('0x14'));var hardwareService=require(_0xb401('0x15'));var logger=require(_0xb401('0x16'))(_0xb401('0x17'));var utils=require(_0xb401('0x18'));var config=require(_0xb401('0x19'));var licenseUtil=require(_0xb401('0x1a'));var db=require(_0xb401('0x1b'))['db'];var integrations=require(_0xb401('0x1c'));function respondWithStatusCode(_0x294233,_0x3e98e0){_0x3e98e0=_0x3e98e0||0xcc;return function(_0x1614d7){if(_0x1614d7){return _0x294233[_0xb401('0x1d')](_0x3e98e0);}return _0x294233[_0xb401('0x1e')](_0x3e98e0)[_0xb401('0x1f')]();};}function respondWithResult(_0x479a6c,_0xa876de){_0xa876de=_0xa876de||0xc8;return function(_0x4e0265){if(_0x4e0265){return _0x479a6c[_0xb401('0x1e')](_0xa876de)['json'](_0x4e0265);}};}function respondWithFilteredResult(_0x3ae455,_0x324a03){return function(_0x5c0081){if(_0x5c0081){var _0x1cbce3=typeof _0x324a03[_0xb401('0x20')]===_0xb401('0x21')&&typeof _0x324a03['limit']===_0xb401('0x21');var _0x4dd069=_0x5c0081['count'];var _0x15a4d0=_0x1cbce3?0x0:_0x324a03[_0xb401('0x20')];var _0x105e4e=_0x1cbce3?_0x5c0081[_0xb401('0x22')]:_0x324a03[_0xb401('0x20')]+_0x324a03[_0xb401('0x23')];var _0x3de466;if(_0x105e4e>=_0x4dd069){_0x105e4e=_0x4dd069;_0x3de466=0xc8;}else{_0x3de466=0xce;}_0x3ae455['status'](_0x3de466);return _0x3ae455['set'](_0xb401('0x24'),_0x15a4d0+'-'+_0x105e4e+'/'+_0x4dd069)[_0xb401('0x25')](_0x5c0081);}return null;};}function patchUpdates(_0x30267b){return function(_0xad9301){try{jsonpatch['apply'](_0xad9301,_0x30267b,!![]);}catch(_0x5d538e){return BPromise[_0xb401('0x26')](_0x5d538e);}return _0xad9301[_0xb401('0x27')]();};}function saveUpdates(_0xc50790,_0x39f3e1){return function(_0x13dfa6){if(_0x13dfa6){return _0x13dfa6[_0xb401('0x28')](_0xc50790)[_0xb401('0x29')](function(_0x5502d4){return _0x5502d4;});}return null;};}function removeEntity(_0x1f38be,_0x3bcd89){return function(_0x4dfa64){if(_0x4dfa64){return _0x4dfa64[_0xb401('0x2a')]()['then'](function(){_0x1f38be[_0xb401('0x1e')](0xcc)[_0xb401('0x1f')]();});}};}function handleEntityNotFound(_0x307619,_0x380000){return function(_0x470d05){if(!_0x470d05){_0x307619['sendStatus'](0x194);}return _0x470d05;};}function handleError(_0x3d5d44,_0xe120d3){_0xe120d3=_0xe120d3||0x1f4;return function(_0x214498){logger['error'](_0x214498['stack']);if(_0x214498[_0xb401('0x2b')]){delete _0x214498[_0xb401('0x2b')];}_0x3d5d44[_0xb401('0x1e')](_0xe120d3)['send'](_0x214498);};}exports[_0xb401('0x2c')]=function(_0x20d048,_0x89ce57){var _0x38fe2b={},_0x2f0c4b={},_0x3c0921={'count':0x0,'rows':[]};var _0x5599f2=_[_0xb401('0x2d')](db[_0xb401('0x2e')][_0xb401('0x2f')],function(_0x7c0257){return{'name':_0x7c0257[_0xb401('0x30')],'type':_0x7c0257[_0xb401('0x31')][_0xb401('0x32')]};});_0x2f0c4b[_0xb401('0x33')]=_['map'](_0x5599f2,_0xb401('0x2b'));_0x2f0c4b[_0xb401('0x34')]=_[_0xb401('0x35')](_0x20d048['query']);_0x2f0c4b[_0xb401('0x36')]=_[_0xb401('0x37')](_0x2f0c4b[_0xb401('0x33')],_0x2f0c4b[_0xb401('0x34')]);_0x38fe2b[_0xb401('0x38')]=_[_0xb401('0x37')](_0x2f0c4b[_0xb401('0x33')],qs['fields'](_0x20d048[_0xb401('0x34')]['fields']));_0x38fe2b[_0xb401('0x38')]=_0x38fe2b[_0xb401('0x38')][_0xb401('0x39')]?_0x38fe2b[_0xb401('0x38')]:_0x2f0c4b[_0xb401('0x33')];if(!_0x20d048[_0xb401('0x34')]['hasOwnProperty'](_0xb401('0x3a'))){_0x38fe2b[_0xb401('0x23')]=qs[_0xb401('0x23')](_0x20d048['query'][_0xb401('0x23')]);_0x38fe2b['offset']=qs[_0xb401('0x20')](_0x20d048[_0xb401('0x34')]['offset']);}_0x38fe2b[_0xb401('0x3b')]=qs['sort'](_0x20d048[_0xb401('0x34')][_0xb401('0x3c')]);_0x38fe2b[_0xb401('0x3d')]=qs['filters'](_[_0xb401('0x3e')](_0x20d048[_0xb401('0x34')],_0x2f0c4b[_0xb401('0x36')]),_0x5599f2);if(_0x20d048[_0xb401('0x34')][_0xb401('0x3f')]){_0x38fe2b[_0xb401('0x3d')]=_[_0xb401('0x40')](_0x38fe2b['where'],{'$or':_['map'](_0x5599f2,function(_0x318b4c){if(_0x318b4c[_0xb401('0x31')]!==_0xb401('0x41')){var _0x5ecd40={};_0x5ecd40[_0x318b4c[_0xb401('0x2b')]]={'$like':'%'+_0x20d048[_0xb401('0x34')][_0xb401('0x3f')]+'%'};return _0x5ecd40;}})});}_0x38fe2b=_[_0xb401('0x40')]({},_0x38fe2b,_0x20d048[_0xb401('0x42')]);var _0x53447e={'where':_0x38fe2b[_0xb401('0x3d')]};return db[_0xb401('0x2e')][_0xb401('0x22')](_0x53447e)['then'](function(_0x587bb6){_0x3c0921[_0xb401('0x22')]=_0x587bb6;if(_0x20d048['query']['includeAll']){_0x38fe2b[_0xb401('0x43')]=[{'all':!![]}];}return db[_0xb401('0x2e')]['findAll'](_0x38fe2b);})[_0xb401('0x29')](function(_0x317e8c){_0x3c0921['rows']=_0x317e8c;return _0x3c0921;})[_0xb401('0x29')](respondWithFilteredResult(_0x89ce57,_0x38fe2b))[_0xb401('0x44')](handleError(_0x89ce57,null));};exports[_0xb401('0x45')]=function(_0x2e71f2,_0x41b828){var _0x59dd25={'raw':![],'where':{'id':_0x2e71f2[_0xb401('0x46')]['id']}},_0x2d72c6={};_0x2d72c6[_0xb401('0x33')]=_[_0xb401('0x35')](db[_0xb401('0x2e')][_0xb401('0x2f')]);_0x2d72c6['query']=_[_0xb401('0x35')](_0x2e71f2[_0xb401('0x34')]);_0x2d72c6[_0xb401('0x36')]=_[_0xb401('0x37')](_0x2d72c6[_0xb401('0x33')],_0x2d72c6[_0xb401('0x34')]);_0x59dd25[_0xb401('0x38')]=_[_0xb401('0x37')](_0x2d72c6[_0xb401('0x33')],qs[_0xb401('0x47')](_0x2e71f2[_0xb401('0x34')]['fields']));_0x59dd25['attributes']=_0x59dd25[_0xb401('0x38')][_0xb401('0x39')]?_0x59dd25[_0xb401('0x38')]:_0x2d72c6[_0xb401('0x33')];if(_0x2e71f2['query'][_0xb401('0x48')]){_0x59dd25[_0xb401('0x43')]=[{'all':!![]}];}_0x59dd25=_['merge']({},_0x59dd25,_0x2e71f2[_0xb401('0x42')]);return db[_0xb401('0x2e')][_0xb401('0x49')](_0x59dd25)[_0xb401('0x29')](handleEntityNotFound(_0x41b828,null))[_0xb401('0x29')](respondWithResult(_0x41b828,null))['catch'](handleError(_0x41b828,null));};exports[_0xb401('0x4a')]=function(_0x1c3fb0,_0x2e23f6){return db['FreshsalesAccount'][_0xb401('0x4a')](_0x1c3fb0[_0xb401('0x4b')],{})['then'](respondWithResult(_0x2e23f6,0xc9))[_0xb401('0x44')](handleError(_0x2e23f6,null));};exports[_0xb401('0x28')]=function(_0x452adb,_0x2a8b57){if(_0x452adb[_0xb401('0x4b')]['id']){delete _0x452adb[_0xb401('0x4b')]['id'];}return db[_0xb401('0x2e')][_0xb401('0x49')]({'where':{'id':_0x452adb['params']['id']}})[_0xb401('0x29')](handleEntityNotFound(_0x2a8b57,null))[_0xb401('0x29')](saveUpdates(_0x452adb['body'],null))['then'](respondWithResult(_0x2a8b57,null))[_0xb401('0x44')](handleError(_0x2a8b57,null));};exports[_0xb401('0x2a')]=function(_0x485f5c,_0x29d845){return db[_0xb401('0x2e')][_0xb401('0x49')]({'where':{'id':_0x485f5c[_0xb401('0x46')]['id']}})['then'](handleEntityNotFound(_0x29d845,null))[_0xb401('0x29')](removeEntity(_0x29d845,null))[_0xb401('0x44')](handleError(_0x29d845,null));};exports[_0xb401('0x4c')]=function(_0x271647,_0x18d8e9,_0x4109a6){var _0x7f0a0e={};var _0x22d2dd={};var _0x4c656e;var _0x10a095;return db['FreshsalesAccount'][_0xb401('0x4d')]({'where':{'id':_0x271647[_0xb401('0x46')]['id']}})[_0xb401('0x29')](handleEntityNotFound(_0x18d8e9,null))[_0xb401('0x29')](function(_0x5a3cf4){if(_0x5a3cf4){_0x4c656e=_0x5a3cf4;_0x22d2dd[_0xb401('0x33')]=_[_0xb401('0x35')](db[_0xb401('0x4e')][_0xb401('0x2f')]);_0x22d2dd[_0xb401('0x34')]=_['keys'](_0x271647[_0xb401('0x34')]);_0x22d2dd[_0xb401('0x36')]=_['intersection'](_0x22d2dd[_0xb401('0x33')],_0x22d2dd[_0xb401('0x34')]);_0x7f0a0e[_0xb401('0x38')]=_['intersection'](_0x22d2dd[_0xb401('0x33')],qs[_0xb401('0x47')](_0x271647[_0xb401('0x34')][_0xb401('0x47')]));_0x7f0a0e[_0xb401('0x38')]=_0x7f0a0e[_0xb401('0x38')]['length']?_0x7f0a0e[_0xb401('0x38')]:_0x22d2dd[_0xb401('0x33')];_0x7f0a0e[_0xb401('0x3b')]=qs[_0xb401('0x3c')](_0x271647[_0xb401('0x34')][_0xb401('0x3c')]);_0x7f0a0e[_0xb401('0x3d')]=qs[_0xb401('0x36')](_[_0xb401('0x3e')](_0x271647[_0xb401('0x34')],_0x22d2dd[_0xb401('0x36')]));if(_0x271647[_0xb401('0x34')]['filter']){_0x7f0a0e[_0xb401('0x3d')]=_['merge'](_0x7f0a0e['where'],{'$or':_[_0xb401('0x2d')](_0x7f0a0e[_0xb401('0x38')],function(_0x58d211){var _0x2c152d={};_0x2c152d[_0x58d211]={'$like':'%'+_0x271647[_0xb401('0x34')][_0xb401('0x3f')]+'%'};return _0x2c152d;})});}_0x7f0a0e=_[_0xb401('0x40')]({},_0x7f0a0e,_0x271647[_0xb401('0x42')]);return _0x4c656e[_0xb401('0x4c')](_0x7f0a0e);}})[_0xb401('0x29')](function(_0x16e72){if(_0x16e72){_0x10a095=_0x16e72['length'];if(!_0x271647['query'][_0xb401('0x4f')](_0xb401('0x3a'))){_0x7f0a0e[_0xb401('0x23')]=qs[_0xb401('0x23')](_0x271647[_0xb401('0x34')][_0xb401('0x23')]);_0x7f0a0e[_0xb401('0x20')]=qs[_0xb401('0x20')](_0x271647[_0xb401('0x34')][_0xb401('0x20')]);}return _0x4c656e[_0xb401('0x4c')](_0x7f0a0e);}})[_0xb401('0x29')](function(_0x1b07b9){if(_0x1b07b9){return _0x1b07b9?{'count':_0x10a095,'rows':_0x1b07b9}:null;}})[_0xb401('0x29')](respondWithResult(_0x18d8e9,null))[_0xb401('0x44')](handleError(_0x18d8e9,null));};exports[_0xb401('0x50')]=function(_0x430d2b,_0x3e031c,_0x4f3549){if(_0x430d2b[_0xb401('0x4b')]['id']){delete _0x430d2b['body']['id'];}return db[_0xb401('0x2e')][_0xb401('0x4d')]({'where':{'id':_0x430d2b[_0xb401('0x46')]['id']}})[_0xb401('0x29')](handleEntityNotFound(_0x3e031c,null))[_0xb401('0x29')](function(_0x1a1d8e){if(_0x1a1d8e){_0x430d2b[_0xb401('0x4b')]['AccountId']=_0x1a1d8e['id'];_0x430d2b[_0xb401('0x4b')][_0xb401('0x51')]=integrations[_0xb401('0x52')](_0x430d2b[_0xb401('0x4b')]['channel'],_0x430d2b[_0xb401('0x4b')]['type']);_0x430d2b[_0xb401('0x4b')][_0xb401('0x53')]=integrations[_0xb401('0x54')](_0x430d2b[_0xb401('0x4b')][_0xb401('0x55')],_0x430d2b[_0xb401('0x4b')][_0xb401('0x31')]);return db[_0xb401('0x4e')]['create'](_0x430d2b[_0xb401('0x4b')],{'include':[{'model':db[_0xb401('0x56')],'as':'Subjects'},{'model':db[_0xb401('0x56')],'as':_0xb401('0x53')}]});}return null;})[_0xb401('0x29')](respondWithResult(_0x3e031c,null))[_0xb401('0x44')](handleError(_0x3e031c,null));};exports[_0xb401('0x57')]=function(_0x177cf9,_0x483206,_0x11911a){var _0x48e08='';var _0x31748e='';return db[_0xb401('0x2e')]['findOne']({'where':{'id':_0x177cf9['params']['id']},'attributes':['id',_0xb401('0x58'),_0xb401('0x59'),_0xb401('0x5a')]})['then'](handleEntityNotFound(_0x483206,null))[_0xb401('0x29')](function(_0xbdef0c){if(_0xbdef0c){_0x31748e=_0xbdef0c[_0xb401('0x58')];_0x48e08=_0xbdef0c['remoteUri'];var _0x4835c1=_0xbdef0c[_0xb401('0x59')][_0xb401('0x5b')](-0x1);if(_0x4835c1==='/'){_0x48e08=_0x48e08['substring'](0x0,_0x48e08['lastIndexOf'](_0x4835c1));}return rp({'method':_0xb401('0x5c'),'uri':util[_0xb401('0x5d')](_0xb401('0x5e'),_0x48e08,_0xb401('0x5f')),'headers':{'Authorization':_0xb401('0x60')+_0xbdef0c[_0xb401('0x5a')]},'json':!![]});}})['then'](function(_0xc97643){if(_0xc97643){var _0x41cfaa=_0xc97643[_0xb401('0x61')];var _0x1c247d=![];var _0x470a92=null;for(_0x470a92=0x0;_0x470a92<_0x41cfaa['length'];_0x470a92++){if(_0x41cfaa[_0x470a92][_0xb401('0x62')]===_0x31748e){_0x1c247d=!![];}}if(_0x1c247d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb401('0x63')});}}})[_0xb401('0x29')](respondWithResult(_0x483206,null))['catch'](function(_0x1b67ac){var _0x52e992=_0x177cf9[_0xb401('0x34')][_0xb401('0x64')]?0x1f4:_0x1b67ac['statusCode']||0x1f4;logger[_0xb401('0x65')](_0xb401('0x66'),_0xb401('0x57'),_0x52e992,JSON[_0xb401('0x67')](_0x1b67ac));delete _0x1b67ac[_0xb401('0x2b')];if(_0x52e992===0x191){_0x52e992=0x190;}_0x483206['status'](_0x52e992)[_0xb401('0x68')](_0x177cf9[_0xb401('0x34')][_0xb401('0x64')]?{'message':_0xb401('0x69'),'statusCode':_0x1b67ac['statusCode']}:_0x1b67ac);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 11f651c..ccb61ee 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 _0x0120=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e9985,_0x1d4975){var _0xcb2ae3=function(_0x4c6cc8){while(--_0x4c6cc8){_0x5e9985['push'](_0x5e9985['shift']());}};_0xcb2ae3(++_0x1d4975);}(_0x0120,0x6f));var _0x0012=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0120[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));var integrations=require(_0x0012('0xb'));module['exports']=function(_0x4b396c,_0x59980a){return _0x4b396c[_0x0012('0xc')](_0x0012('0xd'),attributes,{'tableName':_0x0012('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x16994d,_0x211f64){var _0x219195=function(_0x1df596){while(--_0x1df596){_0x16994d['push'](_0x16994d['shift']());}};_0x219195(++_0x211f64);}(_0x323f,0x1ee));var _0xf323=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x323f[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));var integrations=require(_0xf323('0x9'));module[_0xf323('0xa')]=function(_0x5d7d60,_0xb9a667){return _0x5d7d60[_0xf323('0xb')](_0xf323('0xc'),attributes,{'tableName':_0xf323('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 16f474e..453b3bc 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 _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4de2c5,_0x21aeb7){_0x4de2c5=_0x4de2c5-0x0;var _0x4ef52b=_0x0a6b[_0x4de2c5];return _0x4ef52b;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file +var _0x5464=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowFreshsalesAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug'];(function(_0x6b5c4c,_0xaa642){var _0x548990=function(_0x285a42){while(--_0x285a42){_0x6b5c4c['push'](_0x6b5c4c['shift']());}};_0x548990(++_0xaa642);}(_0x5464,0x15d));var _0x4546=function(_0xee28aa,_0x11f43e){_0xee28aa=_0xee28aa-0x0;var _0x3dc535=_0x5464[_0xee28aa];return _0x3dc535;};'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});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});}exports[_0x4546('0x14')]=function(_0x57d8de){var _0x4ffd6b=this;return new Promise(function(_0x5780a7,_0x330235){return db[_0x4546('0x15')][_0x4546('0x16')]({'raw':_0x57d8de[_0x4546('0x17')]?_0x57d8de[_0x4546('0x17')][_0x4546('0x18')]===undefined?!![]:![]:!![],'where':_0x57d8de[_0x4546('0x17')]?_0x57d8de[_0x4546('0x17')][_0x4546('0x19')]||null:null,'attributes':_0x57d8de[_0x4546('0x17')]?_0x57d8de['options'][_0x4546('0x1a')]||null:null,'limit':_0x57d8de[_0x4546('0x17')]?_0x57d8de['options'][_0x4546('0x1b')]||null:null,'include':_0x57d8de[_0x4546('0x17')]?_0x57d8de[_0x4546('0x17')][_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x57d8de[_0x4546('0x17')]['include'],function(_0x3dab5c){return{'model':db[_0x3dab5c[_0x4546('0x1e')]],'as':_0x3dab5c['as'],'attributes':_0x3dab5c['attributes'],'include':_0x3dab5c[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x3dab5c[_0x4546('0x1c')],function(_0x4467ee){return{'model':db[_0x4467ee[_0x4546('0x1e')]],'as':_0x4467ee['as'],'attributes':_0x4467ee['attributes'],'include':_0x4467ee[_0x4546('0x1c')]?_[_0x4546('0x1d')](_0x4467ee[_0x4546('0x1c')],function(_0x48fc36){return{'model':db[_0x48fc36['model']],'as':_0x48fc36['as'],'attributes':_0x48fc36[_0x4546('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4546('0xa')](function(_0x15611c){logger[_0x4546('0xb')](_0x4546('0x14'),_0x57d8de);logger[_0x4546('0xd')](_0x4546('0x14'),_0x57d8de,JSON['stringify'](_0x15611c));_0x5780a7(_0x15611c);})[_0x4546('0x13')](function(_0x52c546){logger[_0x4546('0x10')](_0x4546('0x14'),_0x52c546['message'],_0x57d8de);_0x330235(_0x4ffd6b['error'](0x1f4,_0x52c546[_0x4546('0x12')]));});});};exports['ShowFreshsalesAccount']=function(_0x3c7c7d){var _0x58b69=this;return new Promise(function(_0x480d8e,_0x5f0226){return db[_0x4546('0x15')][_0x4546('0x1f')]({'raw':_0x3c7c7d[_0x4546('0x17')]?_0x3c7c7d['options'][_0x4546('0x18')]===undefined?!![]:![]:!![],'where':_0x3c7c7d[_0x4546('0x17')]?_0x3c7c7d['options'][_0x4546('0x19')]||null:null,'attributes':_0x3c7c7d['options']?_0x3c7c7d[_0x4546('0x17')][_0x4546('0x1a')]||null:null,'include':_0x3c7c7d[_0x4546('0x17')]?_0x3c7c7d[_0x4546('0x17')]['include']?_[_0x4546('0x1d')](_0x3c7c7d[_0x4546('0x17')][_0x4546('0x1c')],function(_0x298bef){return{'model':db[_0x298bef[_0x4546('0x1e')]],'as':_0x298bef['as'],'attributes':_0x298bef[_0x4546('0x1a')],'include':_0x298bef['include']?_[_0x4546('0x1d')](_0x298bef[_0x4546('0x1c')],function(_0x549f48){return{'model':db[_0x549f48['model']],'as':_0x549f48['as'],'attributes':_0x549f48[_0x4546('0x1a')],'include':_0x549f48[_0x4546('0x1c')]?_['map'](_0x549f48[_0x4546('0x1c')],function(_0x25066c){return{'model':db[_0x25066c['model']],'as':_0x25066c['as'],'attributes':_0x25066c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4546('0xa')](function(_0x141fe8){logger[_0x4546('0xb')](_0x4546('0x20'),_0x3c7c7d);logger[_0x4546('0xd')](_0x4546('0x20'),_0x3c7c7d,JSON['stringify'](_0x141fe8));_0x480d8e(_0x141fe8);})[_0x4546('0x13')](function(_0x33307f){logger['error'](_0x4546('0x20'),_0x33307f['message'],_0x3c7c7d);_0x5f0226(_0x58b69[_0x4546('0x10')](0x1f4,_0x33307f[_0x4546('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0b0b34d..d8117bc 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 _0xfad6=['isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get'];(function(_0xe41f7b,_0x47c135){var _0x58bd2b=function(_0x4b08f7){while(--_0x4b08f7){_0xe41f7b['push'](_0xe41f7b['shift']());}};_0x58bd2b(++_0x47c135);}(_0xfad6,0xd6));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6fad('0x0'));var util=require(_0x6fad('0x1'));var path=require(_0x6fad('0x2'));var timeout=require(_0x6fad('0x3'));var express=require(_0x6fad('0x4'));var router=express[_0x6fad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6fad('0x6'));var interaction=require(_0x6fad('0x7'));var config=require(_0x6fad('0x8'));var controller=require(_0x6fad('0x9'));router[_0x6fad('0xa')]('/',auth[_0x6fad('0xb')](),controller[_0x6fad('0xc')]);router[_0x6fad('0xa')](_0x6fad('0xd'),auth[_0x6fad('0xb')](),controller['show']);router[_0x6fad('0xa')](_0x6fad('0xe'),auth[_0x6fad('0xb')](),controller[_0x6fad('0xf')]);router['get'](_0x6fad('0x10'),auth[_0x6fad('0xb')](),controller[_0x6fad('0x11')]);router[_0x6fad('0xa')](_0x6fad('0x12'),auth[_0x6fad('0xb')](),controller['getFields']);router[_0x6fad('0x13')]('/',auth[_0x6fad('0xb')](),controller[_0x6fad('0x14')]);router[_0x6fad('0x15')](_0x6fad('0xd'),auth[_0x6fad('0xb')](),controller[_0x6fad('0x16')]);router[_0x6fad('0x17')](_0x6fad('0xd'),auth['isAuthenticated'](),controller[_0x6fad('0x18')]);module['exports']=router; \ No newline at end of file +var _0x227d=['get','/:id','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0x227d,0xbc));var _0xd227=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x227d[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xd227('0x0'));var util=require(_0xd227('0x1'));var path=require('path');var timeout=require(_0xd227('0x2'));var express=require(_0xd227('0x3'));var router=express[_0xd227('0x4')]();var fs_extra=require(_0xd227('0x5'));var auth=require(_0xd227('0x6'));var interaction=require(_0xd227('0x7'));var config=require(_0xd227('0x8'));var controller=require(_0xd227('0x9'));router[_0xd227('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd227('0xa')](_0xd227('0xb'),auth[_0xd227('0xc')](),controller['show']);router['get'](_0xd227('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xd227('0xa')](_0xd227('0xe'),auth[_0xd227('0xc')](),controller[_0xd227('0xf')]);router[_0xd227('0xa')](_0xd227('0x10'),auth[_0xd227('0xc')](),controller['getFields']);router[_0xd227('0x11')]('/',auth['isAuthenticated'](),controller[_0xd227('0x12')]);router['put'](_0xd227('0xb'),auth[_0xd227('0xc')](),controller['update']);router[_0xd227('0x13')](_0xd227('0xb'),auth[_0xd227('0xc')](),controller[_0xd227('0x14')]);module[_0xd227('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 969369b..b8a4f92 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 _0xaf5b=['exports','STRING','sequelize'];(function(_0x3aa957,_0x5bf646){var _0x49aedb=function(_0x3e1cb0){while(--_0x3e1cb0){_0x3aa957['push'](_0x3aa957['shift']());}};_0x49aedb(++_0x5bf646);}(_0xaf5b,0xbf));var _0xbaf5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaf5b[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xbaf5('0x0'));module[_0xbaf5('0x1')]={'name':{'type':Sequelize[_0xbaf5('0x2')]},'description':{'type':Sequelize[_0xbaf5('0x2')]}}; \ No newline at end of file +var _0x618f=['exports','STRING','sequelize'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x618f,0x188));var _0xf618=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x618f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf618('0x0'));module[_0xf618('0x1')]={'name':{'type':Sequelize[_0xf618('0x2')]},'description':{'type':Sequelize[_0xf618('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e558b02..560c9c7 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 _0x3b0e=['VIRTUAL','FreshsalesConfiguration','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','findOne','order','filter','getSubjects','nolimit','getDescriptions','FreshsalesField','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','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','end','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','sort','where','filters','pick','merge'];(function(_0x1bb3ee,_0x32ec65){var _0x3b2838=function(_0x487983){while(--_0x487983){_0x1bb3ee['push'](_0x1bb3ee['shift']());}};_0x3b2838(++_0x32ec65);}(_0x3b0e,0x67));var _0xe3b0=function(_0x264957,_0x5d5b0a){_0x264957=_0x264957-0x0;var _0x17dfde=_0x3b0e[_0x264957];return _0x17dfde;};'use strict';var emlformat=require(_0xe3b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3b0('0x1'));var jsonpatch=require(_0xe3b0('0x2'));var rp=require(_0xe3b0('0x3'));var moment=require(_0xe3b0('0x4'));var BPromise=require(_0xe3b0('0x5'));var Mustache=require(_0xe3b0('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe3b0('0x7'));var csv=require('to-csv');var ejs=require(_0xe3b0('0x8'));var fs=require('fs');var fs_extra=require(_0xe3b0('0x9'));var _=require('lodash');var squel=require(_0xe3b0('0xa'));var crypto=require(_0xe3b0('0xb'));var jsforce=require(_0xe3b0('0xc'));var deskjs=require(_0xe3b0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe3b0('0xe'));var Redis=require(_0xe3b0('0xf'));var authService=require(_0xe3b0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe3b0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe3b0('0x12'))(_0xe3b0('0x13'));var utils=require(_0xe3b0('0x14'));var config=require(_0xe3b0('0x15'));var licenseUtil=require(_0xe3b0('0x16'));var db=require(_0xe3b0('0x17'))['db'];function respondWithStatusCode(_0x4b01f3,_0x3be40a){_0x3be40a=_0x3be40a||0xcc;return function(_0x55a1ba){if(_0x55a1ba){return _0x4b01f3[_0xe3b0('0x18')](_0x3be40a);}return _0x4b01f3[_0xe3b0('0x19')](_0x3be40a)[_0xe3b0('0x1a')]();};}function respondWithResult(_0x791d,_0x1d8167){_0x1d8167=_0x1d8167||0xc8;return function(_0x308468){if(_0x308468){return _0x791d[_0xe3b0('0x19')](_0x1d8167)[_0xe3b0('0x1b')](_0x308468);}};}function respondWithFilteredResult(_0x3bfab6,_0x3b16e0){return function(_0x45a1d4){if(_0x45a1d4){var _0x318f7a=typeof _0x3b16e0[_0xe3b0('0x1c')]==='undefined'&&typeof _0x3b16e0[_0xe3b0('0x1d')]===_0xe3b0('0x1e');var _0x3d70b7=_0x45a1d4['count'];var _0x24efe6=_0x318f7a?0x0:_0x3b16e0[_0xe3b0('0x1c')];var _0x44feee=_0x318f7a?_0x45a1d4['count']:_0x3b16e0[_0xe3b0('0x1c')]+_0x3b16e0[_0xe3b0('0x1d')];var _0x315f42;if(_0x44feee>=_0x3d70b7){_0x44feee=_0x3d70b7;_0x315f42=0xc8;}else{_0x315f42=0xce;}_0x3bfab6['status'](_0x315f42);return _0x3bfab6[_0xe3b0('0x1f')](_0xe3b0('0x20'),_0x24efe6+'-'+_0x44feee+'/'+_0x3d70b7)[_0xe3b0('0x1b')](_0x45a1d4);}return null;};}function patchUpdates(_0x1bc8aa){return function(_0x5043b1){try{jsonpatch[_0xe3b0('0x21')](_0x5043b1,_0x1bc8aa,!![]);}catch(_0x3eacbe){return BPromise[_0xe3b0('0x22')](_0x3eacbe);}return _0x5043b1['save']();};}function saveUpdates(_0xed8547,_0x25fbb2){return function(_0x445d98){if(_0x445d98){return _0x445d98[_0xe3b0('0x23')](_0xed8547)[_0xe3b0('0x24')](function(_0x5abcfd){return _0x5abcfd;});}return null;};}function removeEntity(_0x4f72ff,_0xdf6f9){return function(_0x51b1bd){if(_0x51b1bd){return _0x51b1bd[_0xe3b0('0x25')]()[_0xe3b0('0x24')](function(){_0x4f72ff[_0xe3b0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ffc4,_0x2ce3ee){return function(_0x3c8183){if(!_0x3c8183){_0x43ffc4[_0xe3b0('0x18')](0x194);}return _0x3c8183;};}function handleError(_0x181b56,_0x532267){_0x532267=_0x532267||0x1f4;return function(_0x548d86){logger[_0xe3b0('0x26')](_0x548d86[_0xe3b0('0x27')]);if(_0x548d86[_0xe3b0('0x28')]){delete _0x548d86['name'];}_0x181b56['status'](_0x532267)[_0xe3b0('0x29')](_0x548d86);};}exports[_0xe3b0('0x2a')]=function(_0x32f19e,_0x176a91){var _0x12e22b={},_0x123c04={},_0x40f002={'count':0x0,'rows':[]};var _0x4d4c4f=_['map'](db['FreshsalesConfiguration'][_0xe3b0('0x2b')],function(_0x193395){return{'name':_0x193395['fieldName'],'type':_0x193395[_0xe3b0('0x2c')][_0xe3b0('0x2d')]};});_0x123c04['model']=_[_0xe3b0('0x2e')](_0x4d4c4f,_0xe3b0('0x28'));_0x123c04[_0xe3b0('0x2f')]=_[_0xe3b0('0x30')](_0x32f19e[_0xe3b0('0x2f')]);_0x123c04['filters']=_[_0xe3b0('0x31')](_0x123c04[_0xe3b0('0x32')],_0x123c04[_0xe3b0('0x2f')]);_0x12e22b['attributes']=_[_0xe3b0('0x31')](_0x123c04[_0xe3b0('0x32')],qs['fields'](_0x32f19e[_0xe3b0('0x2f')]['fields']));_0x12e22b[_0xe3b0('0x33')]=_0x12e22b[_0xe3b0('0x33')][_0xe3b0('0x34')]?_0x12e22b[_0xe3b0('0x33')]:_0x123c04[_0xe3b0('0x32')];if(!_0x32f19e[_0xe3b0('0x2f')][_0xe3b0('0x35')]('nolimit')){_0x12e22b[_0xe3b0('0x1d')]=qs[_0xe3b0('0x1d')](_0x32f19e[_0xe3b0('0x2f')][_0xe3b0('0x1d')]);_0x12e22b['offset']=qs[_0xe3b0('0x1c')](_0x32f19e[_0xe3b0('0x2f')][_0xe3b0('0x1c')]);}_0x12e22b['order']=qs['sort'](_0x32f19e[_0xe3b0('0x2f')][_0xe3b0('0x36')]);_0x12e22b[_0xe3b0('0x37')]=qs[_0xe3b0('0x38')](_[_0xe3b0('0x39')](_0x32f19e['query'],_0x123c04[_0xe3b0('0x38')]),_0x4d4c4f);if(_0x32f19e[_0xe3b0('0x2f')]['filter']){_0x12e22b[_0xe3b0('0x37')]=_[_0xe3b0('0x3a')](_0x12e22b[_0xe3b0('0x37')],{'$or':_[_0xe3b0('0x2e')](_0x4d4c4f,function(_0x44e126){if(_0x44e126[_0xe3b0('0x2c')]!==_0xe3b0('0x3b')){var _0x598b9d={};_0x598b9d[_0x44e126[_0xe3b0('0x28')]]={'$like':'%'+_0x32f19e[_0xe3b0('0x2f')]['filter']+'%'};return _0x598b9d;}})});}_0x12e22b=_[_0xe3b0('0x3a')]({},_0x12e22b,_0x32f19e['options']);var _0x429afa={'where':_0x12e22b[_0xe3b0('0x37')]};return db[_0xe3b0('0x3c')]['count'](_0x429afa)[_0xe3b0('0x24')](function(_0x2fe321){_0x40f002['count']=_0x2fe321;if(_0x32f19e[_0xe3b0('0x2f')]['includeAll']){_0x12e22b[_0xe3b0('0x3d')]=[{'all':!![]}];}return db[_0xe3b0('0x3c')][_0xe3b0('0x3e')](_0x12e22b);})[_0xe3b0('0x24')](function(_0x38b224){_0x40f002[_0xe3b0('0x3f')]=_0x38b224;return _0x40f002;})[_0xe3b0('0x24')](respondWithFilteredResult(_0x176a91,_0x12e22b))[_0xe3b0('0x40')](handleError(_0x176a91,null));};exports[_0xe3b0('0x41')]=function(_0x4f45c4,_0x573c36){var _0x4b969a={'raw':![],'where':{'id':_0x4f45c4[_0xe3b0('0x42')]['id']}},_0x24edfc={};_0x24edfc[_0xe3b0('0x32')]=_['keys'](db[_0xe3b0('0x3c')]['rawAttributes']);_0x24edfc[_0xe3b0('0x2f')]=_[_0xe3b0('0x30')](_0x4f45c4[_0xe3b0('0x2f')]);_0x24edfc[_0xe3b0('0x38')]=_[_0xe3b0('0x31')](_0x24edfc[_0xe3b0('0x32')],_0x24edfc['query']);_0x4b969a[_0xe3b0('0x33')]=_['intersection'](_0x24edfc['model'],qs[_0xe3b0('0x43')](_0x4f45c4['query'][_0xe3b0('0x43')]));_0x4b969a[_0xe3b0('0x33')]=_0x4b969a[_0xe3b0('0x33')][_0xe3b0('0x34')]?_0x4b969a[_0xe3b0('0x33')]:_0x24edfc[_0xe3b0('0x32')];if(_0x4f45c4[_0xe3b0('0x2f')][_0xe3b0('0x44')]){_0x4b969a['include']=[{'all':!![]}];}_0x4b969a=_['merge']({},_0x4b969a,_0x4f45c4[_0xe3b0('0x45')]);return db[_0xe3b0('0x3c')][_0xe3b0('0x46')](_0x4b969a)[_0xe3b0('0x24')](handleEntityNotFound(_0x573c36,null))[_0xe3b0('0x24')](respondWithResult(_0x573c36,null))['catch'](handleError(_0x573c36,null));};exports[_0xe3b0('0x47')]=function(_0x17433a,_0x527f04){return db[_0xe3b0('0x3c')][_0xe3b0('0x47')](_0x17433a['body'],{})[_0xe3b0('0x24')](respondWithResult(_0x527f04,0xc9))[_0xe3b0('0x40')](handleError(_0x527f04,null));};exports[_0xe3b0('0x23')]=function(_0x46e917,_0x47f38f){if(_0x46e917[_0xe3b0('0x48')]['id']){delete _0x46e917['body']['id'];}return db[_0xe3b0('0x3c')][_0xe3b0('0x46')]({'where':{'id':_0x46e917[_0xe3b0('0x42')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x47f38f,null))[_0xe3b0('0x24')](saveUpdates(_0x46e917[_0xe3b0('0x48')],null))[_0xe3b0('0x24')](respondWithResult(_0x47f38f,null))[_0xe3b0('0x40')](handleError(_0x47f38f,null));};exports[_0xe3b0('0x25')]=function(_0x338717,_0xbbf986){return db[_0xe3b0('0x3c')]['find']({'where':{'id':_0x338717[_0xe3b0('0x42')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0xbbf986,null))[_0xe3b0('0x24')](removeEntity(_0xbbf986,null))['catch'](handleError(_0xbbf986,null));};exports['getSubjects']=function(_0x1fe8bd,_0xb75260,_0x5f0ce5){var _0x177053={};var _0x29353d={};var _0x48a1b4;var _0x524b1f;return db[_0xe3b0('0x3c')][_0xe3b0('0x49')]({'where':{'id':_0x1fe8bd['params']['id']}})['then'](handleEntityNotFound(_0xb75260,null))[_0xe3b0('0x24')](function(_0x525fa0){if(_0x525fa0){_0x48a1b4=_0x525fa0;_0x29353d[_0xe3b0('0x32')]=_[_0xe3b0('0x30')](db['FreshsalesField'][_0xe3b0('0x2b')]);_0x29353d[_0xe3b0('0x2f')]=_[_0xe3b0('0x30')](_0x1fe8bd[_0xe3b0('0x2f')]);_0x29353d[_0xe3b0('0x38')]=_[_0xe3b0('0x31')](_0x29353d[_0xe3b0('0x32')],_0x29353d['query']);_0x177053[_0xe3b0('0x33')]=_['intersection'](_0x29353d[_0xe3b0('0x32')],qs[_0xe3b0('0x43')](_0x1fe8bd[_0xe3b0('0x2f')][_0xe3b0('0x43')]));_0x177053[_0xe3b0('0x33')]=_0x177053[_0xe3b0('0x33')][_0xe3b0('0x34')]?_0x177053['attributes']:_0x29353d[_0xe3b0('0x32')];_0x177053[_0xe3b0('0x4a')]=qs[_0xe3b0('0x36')](_0x1fe8bd[_0xe3b0('0x2f')][_0xe3b0('0x36')]);_0x177053[_0xe3b0('0x37')]=qs[_0xe3b0('0x38')](_[_0xe3b0('0x39')](_0x1fe8bd[_0xe3b0('0x2f')],_0x29353d[_0xe3b0('0x38')]));if(_0x1fe8bd[_0xe3b0('0x2f')][_0xe3b0('0x4b')]){_0x177053[_0xe3b0('0x37')]=_[_0xe3b0('0x3a')](_0x177053[_0xe3b0('0x37')],{'$or':_[_0xe3b0('0x2e')](_0x177053[_0xe3b0('0x33')],function(_0x45b549){var _0x33e05c={};_0x33e05c[_0x45b549]={'$like':'%'+_0x1fe8bd['query'][_0xe3b0('0x4b')]+'%'};return _0x33e05c;})});}_0x177053=_[_0xe3b0('0x3a')]({},_0x177053,_0x1fe8bd[_0xe3b0('0x45')]);return _0x48a1b4[_0xe3b0('0x4c')](_0x177053);}})[_0xe3b0('0x24')](function(_0x931883){if(_0x931883){_0x524b1f=_0x931883[_0xe3b0('0x34')];if(!_0x1fe8bd['query'][_0xe3b0('0x35')](_0xe3b0('0x4d'))){_0x177053[_0xe3b0('0x1d')]=qs[_0xe3b0('0x1d')](_0x1fe8bd[_0xe3b0('0x2f')][_0xe3b0('0x1d')]);_0x177053[_0xe3b0('0x1c')]=qs[_0xe3b0('0x1c')](_0x1fe8bd[_0xe3b0('0x2f')][_0xe3b0('0x1c')]);}return _0x48a1b4[_0xe3b0('0x4c')](_0x177053);}})['then'](function(_0x18f28f){if(_0x18f28f){return _0x18f28f?{'count':_0x524b1f,'rows':_0x18f28f}:null;}})[_0xe3b0('0x24')](respondWithResult(_0xb75260,null))[_0xe3b0('0x40')](handleError(_0xb75260,null));};exports[_0xe3b0('0x4e')]=function(_0x3df3cd,_0x309206,_0x1c82ec){var _0x569465={};var _0x2753ff={};var _0x193351;var _0x3bcc9e;return db[_0xe3b0('0x3c')][_0xe3b0('0x49')]({'where':{'id':_0x3df3cd[_0xe3b0('0x42')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x309206,null))[_0xe3b0('0x24')](function(_0xb00c39){if(_0xb00c39){_0x193351=_0xb00c39;_0x2753ff[_0xe3b0('0x32')]=_[_0xe3b0('0x30')](db[_0xe3b0('0x4f')]['rawAttributes']);_0x2753ff['query']=_[_0xe3b0('0x30')](_0x3df3cd[_0xe3b0('0x2f')]);_0x2753ff[_0xe3b0('0x38')]=_[_0xe3b0('0x31')](_0x2753ff['model'],_0x2753ff[_0xe3b0('0x2f')]);_0x569465[_0xe3b0('0x33')]=_[_0xe3b0('0x31')](_0x2753ff[_0xe3b0('0x32')],qs['fields'](_0x3df3cd[_0xe3b0('0x2f')]['fields']));_0x569465[_0xe3b0('0x33')]=_0x569465[_0xe3b0('0x33')][_0xe3b0('0x34')]?_0x569465['attributes']:_0x2753ff[_0xe3b0('0x32')];_0x569465[_0xe3b0('0x4a')]=qs[_0xe3b0('0x36')](_0x3df3cd[_0xe3b0('0x2f')][_0xe3b0('0x36')]);_0x569465[_0xe3b0('0x37')]=qs['filters'](_[_0xe3b0('0x39')](_0x3df3cd[_0xe3b0('0x2f')],_0x2753ff[_0xe3b0('0x38')]));if(_0x3df3cd[_0xe3b0('0x2f')][_0xe3b0('0x4b')]){_0x569465[_0xe3b0('0x37')]=_[_0xe3b0('0x3a')](_0x569465[_0xe3b0('0x37')],{'$or':_[_0xe3b0('0x2e')](_0x569465['attributes'],function(_0x13990b){var _0x1a4c13={};_0x1a4c13[_0x13990b]={'$like':'%'+_0x3df3cd[_0xe3b0('0x2f')]['filter']+'%'};return _0x1a4c13;})});}_0x569465=_[_0xe3b0('0x3a')]({},_0x569465,_0x3df3cd[_0xe3b0('0x45')]);return _0x193351[_0xe3b0('0x4e')](_0x569465);}})[_0xe3b0('0x24')](function(_0x45c380){if(_0x45c380){_0x3bcc9e=_0x45c380[_0xe3b0('0x34')];if(!_0x3df3cd[_0xe3b0('0x2f')][_0xe3b0('0x35')](_0xe3b0('0x4d'))){_0x569465[_0xe3b0('0x1d')]=qs[_0xe3b0('0x1d')](_0x3df3cd[_0xe3b0('0x2f')][_0xe3b0('0x1d')]);_0x569465[_0xe3b0('0x1c')]=qs[_0xe3b0('0x1c')](_0x3df3cd[_0xe3b0('0x2f')][_0xe3b0('0x1c')]);}return _0x193351[_0xe3b0('0x4e')](_0x569465);}})[_0xe3b0('0x24')](function(_0x3551c4){if(_0x3551c4){return _0x3551c4?{'count':_0x3bcc9e,'rows':_0x3551c4}:null;}})['then'](respondWithResult(_0x309206,null))[_0xe3b0('0x40')](handleError(_0x309206,null));};exports[_0xe3b0('0x50')]=function(_0x1f0729,_0x2b8174,_0x17f56b){var _0xabc107={};var _0x1b57bc={};var _0x139b44;var _0x30ee49;return db[_0xe3b0('0x3c')][_0xe3b0('0x49')]({'where':{'id':_0x1f0729[_0xe3b0('0x42')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x2b8174,null))[_0xe3b0('0x24')](function(_0x1b86c4){if(_0x1b86c4){_0x139b44=_0x1b86c4;_0x1b57bc[_0xe3b0('0x32')]=_[_0xe3b0('0x30')](db[_0xe3b0('0x4f')][_0xe3b0('0x2b')]);_0x1b57bc[_0xe3b0('0x2f')]=_[_0xe3b0('0x30')](_0x1f0729[_0xe3b0('0x2f')]);_0x1b57bc[_0xe3b0('0x38')]=_['intersection'](_0x1b57bc[_0xe3b0('0x32')],_0x1b57bc[_0xe3b0('0x2f')]);_0xabc107[_0xe3b0('0x33')]=_[_0xe3b0('0x31')](_0x1b57bc['model'],qs[_0xe3b0('0x43')](_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x43')]));_0xabc107[_0xe3b0('0x33')]=_0xabc107[_0xe3b0('0x33')][_0xe3b0('0x34')]?_0xabc107[_0xe3b0('0x33')]:_0x1b57bc['model'];_0xabc107[_0xe3b0('0x4a')]=qs[_0xe3b0('0x36')](_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x36')]);_0xabc107[_0xe3b0('0x37')]=qs[_0xe3b0('0x38')](_[_0xe3b0('0x39')](_0x1f0729['query'],_0x1b57bc['filters']));if(_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x4b')]){_0xabc107[_0xe3b0('0x37')]=_[_0xe3b0('0x3a')](_0xabc107[_0xe3b0('0x37')],{'$or':_['map'](_0xabc107[_0xe3b0('0x33')],function(_0x1894e3){var _0xfbc0d3={};_0xfbc0d3[_0x1894e3]={'$like':'%'+_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x4b')]+'%'};return _0xfbc0d3;})});}_0xabc107=_[_0xe3b0('0x3a')]({},_0xabc107,_0x1f0729[_0xe3b0('0x45')]);return _0x139b44[_0xe3b0('0x50')](_0xabc107);}})[_0xe3b0('0x24')](function(_0x22a71a){if(_0x22a71a){_0x30ee49=_0x22a71a[_0xe3b0('0x34')];if(!_0x1f0729[_0xe3b0('0x2f')]['hasOwnProperty'](_0xe3b0('0x4d'))){_0xabc107[_0xe3b0('0x1d')]=qs[_0xe3b0('0x1d')](_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x1d')]);_0xabc107[_0xe3b0('0x1c')]=qs[_0xe3b0('0x1c')](_0x1f0729[_0xe3b0('0x2f')][_0xe3b0('0x1c')]);}return _0x139b44['getFields'](_0xabc107);}})[_0xe3b0('0x24')](function(_0x111038){if(_0x111038){return _0x111038?{'count':_0x30ee49,'rows':_0x111038}:null;}})[_0xe3b0('0x24')](respondWithResult(_0x2b8174,null))[_0xe3b0('0x40')](handleError(_0x2b8174,null));}; \ No newline at end of file +var _0x5612=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','getSubjects','findOne','FreshsalesField','order','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs'];(function(_0x24696b,_0x12de19){var _0x3f86b0=function(_0x11f2eb){while(--_0x11f2eb){_0x24696b['push'](_0x24696b['shift']());}};_0x3f86b0(++_0x12de19);}(_0x5612,0x19a));var _0x2561=function(_0x5efd8f,_0xf1f28){_0x5efd8f=_0x5efd8f-0x0;var _0x3a669f=_0x5612[_0x5efd8f];return _0x3a669f;};'use strict';var emlformat=require(_0x2561('0x0'));var rimraf=require(_0x2561('0x1'));var zipdir=require(_0x2561('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2561('0x3'));var moment=require(_0x2561('0x4'));var BPromise=require(_0x2561('0x5'));var Mustache=require('mustache');var util=require(_0x2561('0x6'));var path=require('path');var sox=require(_0x2561('0x7'));var csv=require(_0x2561('0x8'));var ejs=require(_0x2561('0x9'));var fs=require('fs');var fs_extra=require(_0x2561('0xa'));var _=require(_0x2561('0xb'));var squel=require(_0x2561('0xc'));var crypto=require(_0x2561('0xd'));var jsforce=require(_0x2561('0xe'));var deskjs=require(_0x2561('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2561('0x10'));var Papa=require(_0x2561('0x11'));var Redis=require(_0x2561('0x12'));var authService=require(_0x2561('0x13'));var qs=require(_0x2561('0x14'));var as=require(_0x2561('0x15'));var hardwareService=require(_0x2561('0x16'));var logger=require(_0x2561('0x17'))('api');var utils=require(_0x2561('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2561('0x19'));var db=require(_0x2561('0x1a'))['db'];function respondWithStatusCode(_0xb95054,_0x81fa5c){_0x81fa5c=_0x81fa5c||0xcc;return function(_0x967ba9){if(_0x967ba9){return _0xb95054[_0x2561('0x1b')](_0x81fa5c);}return _0xb95054[_0x2561('0x1c')](_0x81fa5c)[_0x2561('0x1d')]();};}function respondWithResult(_0x554dd3,_0x3ad253){_0x3ad253=_0x3ad253||0xc8;return function(_0x566c61){if(_0x566c61){return _0x554dd3[_0x2561('0x1c')](_0x3ad253)[_0x2561('0x1e')](_0x566c61);}};}function respondWithFilteredResult(_0x488e9a,_0x420346){return function(_0x19cbb1){if(_0x19cbb1){var _0x31b2a4=typeof _0x420346[_0x2561('0x1f')]==='undefined'&&typeof _0x420346[_0x2561('0x20')]===_0x2561('0x21');var _0x5daa7d=_0x19cbb1[_0x2561('0x22')];var _0x54d389=_0x31b2a4?0x0:_0x420346[_0x2561('0x1f')];var _0x59a81b=_0x31b2a4?_0x19cbb1[_0x2561('0x22')]:_0x420346['offset']+_0x420346[_0x2561('0x20')];var _0x32a253;if(_0x59a81b>=_0x5daa7d){_0x59a81b=_0x5daa7d;_0x32a253=0xc8;}else{_0x32a253=0xce;}_0x488e9a[_0x2561('0x1c')](_0x32a253);return _0x488e9a[_0x2561('0x23')]('Content-Range',_0x54d389+'-'+_0x59a81b+'/'+_0x5daa7d)[_0x2561('0x1e')](_0x19cbb1);}return null;};}function patchUpdates(_0x3c959a){return function(_0x3ecb92){try{jsonpatch[_0x2561('0x24')](_0x3ecb92,_0x3c959a,!![]);}catch(_0x31f202){return BPromise[_0x2561('0x25')](_0x31f202);}return _0x3ecb92[_0x2561('0x26')]();};}function saveUpdates(_0x1fac55,_0x5d6111){return function(_0x361620){if(_0x361620){return _0x361620[_0x2561('0x27')](_0x1fac55)[_0x2561('0x28')](function(_0x19492b){return _0x19492b;});}return null;};}function removeEntity(_0x540c4b,_0x47a653){return function(_0x2582cd){if(_0x2582cd){return _0x2582cd[_0x2561('0x29')]()[_0x2561('0x28')](function(){_0x540c4b[_0x2561('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590449,_0x2cb80a){return function(_0x21d0cf){if(!_0x21d0cf){_0x590449[_0x2561('0x1b')](0x194);}return _0x21d0cf;};}function handleError(_0x4915a9,_0x12ba46){_0x12ba46=_0x12ba46||0x1f4;return function(_0x2e7a41){logger[_0x2561('0x2a')](_0x2e7a41[_0x2561('0x2b')]);if(_0x2e7a41[_0x2561('0x2c')]){delete _0x2e7a41[_0x2561('0x2c')];}_0x4915a9[_0x2561('0x1c')](_0x12ba46)[_0x2561('0x2d')](_0x2e7a41);};}exports['index']=function(_0x3ac584,_0x2709b5){var _0x31304a={},_0x77d66f={},_0x47c3cb={'count':0x0,'rows':[]};var _0x5e0b75=_[_0x2561('0x2e')](db[_0x2561('0x2f')][_0x2561('0x30')],function(_0x401b3a){return{'name':_0x401b3a[_0x2561('0x31')],'type':_0x401b3a['type'][_0x2561('0x32')]};});_0x77d66f[_0x2561('0x33')]=_[_0x2561('0x2e')](_0x5e0b75,_0x2561('0x2c'));_0x77d66f[_0x2561('0x34')]=_['keys'](_0x3ac584[_0x2561('0x34')]);_0x77d66f[_0x2561('0x35')]=_['intersection'](_0x77d66f[_0x2561('0x33')],_0x77d66f[_0x2561('0x34')]);_0x31304a[_0x2561('0x36')]=_[_0x2561('0x37')](_0x77d66f[_0x2561('0x33')],qs[_0x2561('0x38')](_0x3ac584[_0x2561('0x34')]['fields']));_0x31304a[_0x2561('0x36')]=_0x31304a[_0x2561('0x36')]['length']?_0x31304a[_0x2561('0x36')]:_0x77d66f[_0x2561('0x33')];if(!_0x3ac584[_0x2561('0x34')][_0x2561('0x39')](_0x2561('0x3a'))){_0x31304a[_0x2561('0x20')]=qs['limit'](_0x3ac584[_0x2561('0x34')]['limit']);_0x31304a[_0x2561('0x1f')]=qs[_0x2561('0x1f')](_0x3ac584[_0x2561('0x34')][_0x2561('0x1f')]);}_0x31304a['order']=qs['sort'](_0x3ac584[_0x2561('0x34')][_0x2561('0x3b')]);_0x31304a[_0x2561('0x3c')]=qs[_0x2561('0x35')](_[_0x2561('0x3d')](_0x3ac584['query'],_0x77d66f[_0x2561('0x35')]),_0x5e0b75);if(_0x3ac584[_0x2561('0x34')][_0x2561('0x3e')]){_0x31304a[_0x2561('0x3c')]=_['merge'](_0x31304a['where'],{'$or':_[_0x2561('0x2e')](_0x5e0b75,function(_0x10e586){if(_0x10e586[_0x2561('0x3f')]!==_0x2561('0x40')){var _0x2773cb={};_0x2773cb[_0x10e586['name']]={'$like':'%'+_0x3ac584['query'][_0x2561('0x3e')]+'%'};return _0x2773cb;}})});}_0x31304a=_[_0x2561('0x41')]({},_0x31304a,_0x3ac584[_0x2561('0x42')]);var _0x6c581f={'where':_0x31304a[_0x2561('0x3c')]};return db['FreshsalesConfiguration'][_0x2561('0x22')](_0x6c581f)[_0x2561('0x28')](function(_0x331437){_0x47c3cb[_0x2561('0x22')]=_0x331437;if(_0x3ac584['query']['includeAll']){_0x31304a[_0x2561('0x43')]=[{'all':!![]}];}return db[_0x2561('0x2f')][_0x2561('0x44')](_0x31304a);})[_0x2561('0x28')](function(_0x36ba7d){_0x47c3cb[_0x2561('0x45')]=_0x36ba7d;return _0x47c3cb;})[_0x2561('0x28')](respondWithFilteredResult(_0x2709b5,_0x31304a))[_0x2561('0x46')](handleError(_0x2709b5,null));};exports['show']=function(_0x4a98ed,_0x55a252){var _0xe5ae1c={'raw':![],'where':{'id':_0x4a98ed[_0x2561('0x47')]['id']}},_0x143d67={};_0x143d67[_0x2561('0x33')]=_[_0x2561('0x48')](db['FreshsalesConfiguration']['rawAttributes']);_0x143d67[_0x2561('0x34')]=_[_0x2561('0x48')](_0x4a98ed[_0x2561('0x34')]);_0x143d67[_0x2561('0x35')]=_[_0x2561('0x37')](_0x143d67[_0x2561('0x33')],_0x143d67['query']);_0xe5ae1c[_0x2561('0x36')]=_[_0x2561('0x37')](_0x143d67[_0x2561('0x33')],qs[_0x2561('0x38')](_0x4a98ed[_0x2561('0x34')][_0x2561('0x38')]));_0xe5ae1c[_0x2561('0x36')]=_0xe5ae1c[_0x2561('0x36')][_0x2561('0x49')]?_0xe5ae1c[_0x2561('0x36')]:_0x143d67[_0x2561('0x33')];if(_0x4a98ed[_0x2561('0x34')][_0x2561('0x4a')]){_0xe5ae1c[_0x2561('0x43')]=[{'all':!![]}];}_0xe5ae1c=_['merge']({},_0xe5ae1c,_0x4a98ed[_0x2561('0x42')]);return db[_0x2561('0x2f')][_0x2561('0x4b')](_0xe5ae1c)[_0x2561('0x28')](handleEntityNotFound(_0x55a252,null))[_0x2561('0x28')](respondWithResult(_0x55a252,null))[_0x2561('0x46')](handleError(_0x55a252,null));};exports[_0x2561('0x4c')]=function(_0x3338c7,_0x43efaf){return db[_0x2561('0x2f')]['create'](_0x3338c7[_0x2561('0x4d')],{})[_0x2561('0x28')](respondWithResult(_0x43efaf,0xc9))[_0x2561('0x46')](handleError(_0x43efaf,null));};exports[_0x2561('0x27')]=function(_0x2f4dd4,_0x27cf7b){if(_0x2f4dd4[_0x2561('0x4d')]['id']){delete _0x2f4dd4[_0x2561('0x4d')]['id'];}return db[_0x2561('0x2f')]['find']({'where':{'id':_0x2f4dd4['params']['id']}})['then'](handleEntityNotFound(_0x27cf7b,null))[_0x2561('0x28')](saveUpdates(_0x2f4dd4[_0x2561('0x4d')],null))[_0x2561('0x28')](respondWithResult(_0x27cf7b,null))[_0x2561('0x46')](handleError(_0x27cf7b,null));};exports['destroy']=function(_0xea70bf,_0x106923){return db[_0x2561('0x2f')][_0x2561('0x4b')]({'where':{'id':_0xea70bf[_0x2561('0x47')]['id']}})[_0x2561('0x28')](handleEntityNotFound(_0x106923,null))[_0x2561('0x28')](removeEntity(_0x106923,null))[_0x2561('0x46')](handleError(_0x106923,null));};exports[_0x2561('0x4e')]=function(_0xf76094,_0x6465b5,_0x4b1605){var _0x3a259c={};var _0x4dd907={};var _0x3ad1f2;var _0x39e5c8;return db[_0x2561('0x2f')][_0x2561('0x4f')]({'where':{'id':_0xf76094[_0x2561('0x47')]['id']}})[_0x2561('0x28')](handleEntityNotFound(_0x6465b5,null))[_0x2561('0x28')](function(_0x1cb562){if(_0x1cb562){_0x3ad1f2=_0x1cb562;_0x4dd907[_0x2561('0x33')]=_[_0x2561('0x48')](db[_0x2561('0x50')][_0x2561('0x30')]);_0x4dd907[_0x2561('0x34')]=_[_0x2561('0x48')](_0xf76094[_0x2561('0x34')]);_0x4dd907['filters']=_[_0x2561('0x37')](_0x4dd907[_0x2561('0x33')],_0x4dd907[_0x2561('0x34')]);_0x3a259c[_0x2561('0x36')]=_[_0x2561('0x37')](_0x4dd907[_0x2561('0x33')],qs[_0x2561('0x38')](_0xf76094[_0x2561('0x34')][_0x2561('0x38')]));_0x3a259c[_0x2561('0x36')]=_0x3a259c[_0x2561('0x36')][_0x2561('0x49')]?_0x3a259c[_0x2561('0x36')]:_0x4dd907['model'];_0x3a259c[_0x2561('0x51')]=qs[_0x2561('0x3b')](_0xf76094[_0x2561('0x34')][_0x2561('0x3b')]);_0x3a259c[_0x2561('0x3c')]=qs['filters'](_[_0x2561('0x3d')](_0xf76094[_0x2561('0x34')],_0x4dd907['filters']));if(_0xf76094[_0x2561('0x34')]['filter']){_0x3a259c[_0x2561('0x3c')]=_[_0x2561('0x41')](_0x3a259c[_0x2561('0x3c')],{'$or':_['map'](_0x3a259c[_0x2561('0x36')],function(_0x1f2bfb){var _0x47b965={};_0x47b965[_0x1f2bfb]={'$like':'%'+_0xf76094[_0x2561('0x34')][_0x2561('0x3e')]+'%'};return _0x47b965;})});}_0x3a259c=_[_0x2561('0x41')]({},_0x3a259c,_0xf76094[_0x2561('0x42')]);return _0x3ad1f2[_0x2561('0x4e')](_0x3a259c);}})[_0x2561('0x28')](function(_0x4e427e){if(_0x4e427e){_0x39e5c8=_0x4e427e[_0x2561('0x49')];if(!_0xf76094[_0x2561('0x34')][_0x2561('0x39')](_0x2561('0x3a'))){_0x3a259c[_0x2561('0x20')]=qs[_0x2561('0x20')](_0xf76094[_0x2561('0x34')][_0x2561('0x20')]);_0x3a259c[_0x2561('0x1f')]=qs[_0x2561('0x1f')](_0xf76094['query'][_0x2561('0x1f')]);}return _0x3ad1f2[_0x2561('0x4e')](_0x3a259c);}})['then'](function(_0x3756da){if(_0x3756da){return _0x3756da?{'count':_0x39e5c8,'rows':_0x3756da}:null;}})[_0x2561('0x28')](respondWithResult(_0x6465b5,null))[_0x2561('0x46')](handleError(_0x6465b5,null));};exports['getDescriptions']=function(_0x53c8ec,_0x1f5fc3,_0x4ac570){var _0x5f23f7={};var _0x32d087={};var _0xed7de4;var _0x12c5be;return db[_0x2561('0x2f')][_0x2561('0x4f')]({'where':{'id':_0x53c8ec[_0x2561('0x47')]['id']}})[_0x2561('0x28')](handleEntityNotFound(_0x1f5fc3,null))[_0x2561('0x28')](function(_0x4a59ad){if(_0x4a59ad){_0xed7de4=_0x4a59ad;_0x32d087[_0x2561('0x33')]=_[_0x2561('0x48')](db[_0x2561('0x50')]['rawAttributes']);_0x32d087['query']=_['keys'](_0x53c8ec[_0x2561('0x34')]);_0x32d087[_0x2561('0x35')]=_[_0x2561('0x37')](_0x32d087[_0x2561('0x33')],_0x32d087[_0x2561('0x34')]);_0x5f23f7['attributes']=_['intersection'](_0x32d087[_0x2561('0x33')],qs[_0x2561('0x38')](_0x53c8ec[_0x2561('0x34')][_0x2561('0x38')]));_0x5f23f7['attributes']=_0x5f23f7[_0x2561('0x36')][_0x2561('0x49')]?_0x5f23f7['attributes']:_0x32d087[_0x2561('0x33')];_0x5f23f7[_0x2561('0x51')]=qs['sort'](_0x53c8ec[_0x2561('0x34')][_0x2561('0x3b')]);_0x5f23f7[_0x2561('0x3c')]=qs['filters'](_['pick'](_0x53c8ec['query'],_0x32d087[_0x2561('0x35')]));if(_0x53c8ec[_0x2561('0x34')][_0x2561('0x3e')]){_0x5f23f7[_0x2561('0x3c')]=_['merge'](_0x5f23f7[_0x2561('0x3c')],{'$or':_[_0x2561('0x2e')](_0x5f23f7[_0x2561('0x36')],function(_0x559a38){var _0x8f9095={};_0x8f9095[_0x559a38]={'$like':'%'+_0x53c8ec[_0x2561('0x34')]['filter']+'%'};return _0x8f9095;})});}_0x5f23f7=_[_0x2561('0x41')]({},_0x5f23f7,_0x53c8ec[_0x2561('0x42')]);return _0xed7de4[_0x2561('0x52')](_0x5f23f7);}})['then'](function(_0x3e48e8){if(_0x3e48e8){_0x12c5be=_0x3e48e8[_0x2561('0x49')];if(!_0x53c8ec[_0x2561('0x34')]['hasOwnProperty'](_0x2561('0x3a'))){_0x5f23f7[_0x2561('0x20')]=qs[_0x2561('0x20')](_0x53c8ec[_0x2561('0x34')][_0x2561('0x20')]);_0x5f23f7[_0x2561('0x1f')]=qs[_0x2561('0x1f')](_0x53c8ec[_0x2561('0x34')][_0x2561('0x1f')]);}return _0xed7de4['getDescriptions'](_0x5f23f7);}})[_0x2561('0x28')](function(_0x973042){if(_0x973042){return _0x973042?{'count':_0x12c5be,'rows':_0x973042}:null;}})[_0x2561('0x28')](respondWithResult(_0x1f5fc3,null))['catch'](handleError(_0x1f5fc3,null));};exports[_0x2561('0x53')]=function(_0x54aeef,_0x2dad2f,_0x3b27bb){var _0x323afd={};var _0x1ff049={};var _0xd9242e;var _0x4f2f85;return db['FreshsalesConfiguration'][_0x2561('0x4f')]({'where':{'id':_0x54aeef['params']['id']}})['then'](handleEntityNotFound(_0x2dad2f,null))[_0x2561('0x28')](function(_0x4c9b1b){if(_0x4c9b1b){_0xd9242e=_0x4c9b1b;_0x1ff049[_0x2561('0x33')]=_[_0x2561('0x48')](db['FreshsalesField'][_0x2561('0x30')]);_0x1ff049['query']=_[_0x2561('0x48')](_0x54aeef[_0x2561('0x34')]);_0x1ff049[_0x2561('0x35')]=_[_0x2561('0x37')](_0x1ff049[_0x2561('0x33')],_0x1ff049[_0x2561('0x34')]);_0x323afd[_0x2561('0x36')]=_[_0x2561('0x37')](_0x1ff049[_0x2561('0x33')],qs[_0x2561('0x38')](_0x54aeef[_0x2561('0x34')][_0x2561('0x38')]));_0x323afd[_0x2561('0x36')]=_0x323afd[_0x2561('0x36')][_0x2561('0x49')]?_0x323afd[_0x2561('0x36')]:_0x1ff049[_0x2561('0x33')];_0x323afd[_0x2561('0x51')]=qs[_0x2561('0x3b')](_0x54aeef[_0x2561('0x34')][_0x2561('0x3b')]);_0x323afd['where']=qs['filters'](_['pick'](_0x54aeef[_0x2561('0x34')],_0x1ff049['filters']));if(_0x54aeef[_0x2561('0x34')]['filter']){_0x323afd[_0x2561('0x3c')]=_[_0x2561('0x41')](_0x323afd[_0x2561('0x3c')],{'$or':_[_0x2561('0x2e')](_0x323afd[_0x2561('0x36')],function(_0x2fd8b5){var _0x1fce11={};_0x1fce11[_0x2fd8b5]={'$like':'%'+_0x54aeef[_0x2561('0x34')]['filter']+'%'};return _0x1fce11;})});}_0x323afd=_[_0x2561('0x41')]({},_0x323afd,_0x54aeef[_0x2561('0x42')]);return _0xd9242e[_0x2561('0x53')](_0x323afd);}})['then'](function(_0x4ab981){if(_0x4ab981){_0x4f2f85=_0x4ab981[_0x2561('0x49')];if(!_0x54aeef[_0x2561('0x34')][_0x2561('0x39')](_0x2561('0x3a'))){_0x323afd['limit']=qs[_0x2561('0x20')](_0x54aeef[_0x2561('0x34')][_0x2561('0x20')]);_0x323afd[_0x2561('0x1f')]=qs['offset'](_0x54aeef[_0x2561('0x34')][_0x2561('0x1f')]);}return _0xd9242e[_0x2561('0x53')](_0x323afd);}})[_0x2561('0x28')](function(_0xd67959){if(_0xd67959){return _0xd67959?{'count':_0x4f2f85,'rows':_0xd67959}:null;}})[_0x2561('0x28')](respondWithResult(_0x2dad2f,null))[_0x2561('0x46')](handleError(_0x2dad2f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8f9e1ec..545e69f 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 _0x807c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x2e133f,_0x53cd82){var _0x17e85a=function(_0x181bf4){while(--_0x181bf4){_0x2e133f['push'](_0x2e133f['shift']());}};_0x17e85a(++_0x53cd82);}(_0x807c,0x10a));var _0xc807=function(_0x3c8a4b,_0x23fc4f){_0x3c8a4b=_0x3c8a4b-0x0;var _0x143e30=_0x807c[_0x3c8a4b];return _0x143e30;};'use strict';var _=require(_0xc807('0x0'));var util=require(_0xc807('0x1'));var logger=require(_0xc807('0x2'))(_0xc807('0x3'));var moment=require(_0xc807('0x4'));var BPromise=require(_0xc807('0x5'));var rp=require(_0xc807('0x6'));var fs=require('fs');var path=require(_0xc807('0x7'));var rimraf=require('rimraf');var config=require(_0xc807('0x8'));var attributes=require(_0xc807('0x9'));module[_0xc807('0xa')]=function(_0x5477e1,_0x42d3a5){return _0x5477e1[_0xc807('0xb')](_0xc807('0xc'),attributes,{'tableName':_0xc807('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d8=['moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util'];(function(_0xb856a4,_0x1e3dc7){var _0x2ce5e2=function(_0x240f8f){while(--_0x240f8f){_0xb856a4['push'](_0xb856a4['shift']());}};_0x2ce5e2(++_0x1e3dc7);}(_0xd5d8,0xda));var _0x8d5d=function(_0x1e77ba,_0x19f4cc){_0x1e77ba=_0x1e77ba-0x0;var _0xb7d6f7=_0xd5d8[_0x1e77ba];return _0xb7d6f7;};'use strict';var _=require(_0x8d5d('0x0'));var util=require(_0x8d5d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8d5d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8d5d('0x3'));var fs=require('fs');var path=require(_0x8d5d('0x4'));var rimraf=require(_0x8d5d('0x5'));var config=require(_0x8d5d('0x6'));var attributes=require(_0x8d5d('0x7'));module[_0x8d5d('0x8')]=function(_0x1368c3,_0x2e0ad8){return _0x1368c3[_0x8d5d('0x9')](_0x8d5d('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 5addfc9..4e6a802 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 _0x78db=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x78db,0xaf));var _0xb78d=function(_0x3632fa,_0x30c819){_0x3632fa=_0x3632fa-0x0;var _0x35c4cf=_0x78db[_0x3632fa];return _0x35c4cf;};'use strict';var _=require(_0xb78d('0x0'));var util=require(_0xb78d('0x1'));var moment=require(_0xb78d('0x2'));var BPromise=require(_0xb78d('0x3'));var rs=require(_0xb78d('0x4'));var fs=require('fs');var Redis=require(_0xb78d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb78d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb78d('0x7'));var jayson=require(_0xb78d('0x8'));var client=jayson[_0xb78d('0x9')][_0xb78d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58fb0d,_0x1125f9,_0x1da6dd){return new BPromise(function(_0x59b29d,_0x940c81){return client[_0xb78d('0xb')](_0x58fb0d,_0x1da6dd)[_0xb78d('0xc')](function(_0x11b6cd){logger[_0xb78d('0xd')](_0xb78d('0xe'),_0x1125f9,_0xb78d('0xf'));logger['debug'](_0xb78d('0x10'),_0x1125f9,'request\x20sent',JSON[_0xb78d('0x11')](_0x11b6cd));if(_0x11b6cd[_0xb78d('0x12')]){if(_0x11b6cd[_0xb78d('0x12')][_0xb78d('0x13')]===0x1f4){logger[_0xb78d('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1125f9,_0x11b6cd[_0xb78d('0x12')][_0xb78d('0x14')]);return _0x940c81(_0x11b6cd[_0xb78d('0x12')][_0xb78d('0x14')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1125f9,_0x11b6cd[_0xb78d('0x12')]['message']);return _0x59b29d(_0x11b6cd[_0xb78d('0x12')][_0xb78d('0x14')]);}else{logger['info'](_0xb78d('0xe'),_0x1125f9,'request\x20sent');_0x59b29d(_0x11b6cd[_0xb78d('0x15')]['message']);}})[_0xb78d('0x16')](function(_0x385127){logger[_0xb78d('0x12')](_0xb78d('0xe'),_0x1125f9,_0x385127);_0x940c81(_0x385127);});});} \ No newline at end of file +var _0x9a7b=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x4889b6,_0x3e2c35){var _0x461518=function(_0x2aa734){while(--_0x2aa734){_0x4889b6['push'](_0x4889b6['shift']());}};_0x461518(++_0x3e2c35);}(_0x9a7b,0x118));var _0xb9a7=function(_0x64dbe7,_0x4e7c8f){_0x64dbe7=_0x64dbe7-0x0;var _0xed3ec9=_0x9a7b[_0x64dbe7];return _0xed3ec9;};'use strict';var _=require(_0xb9a7('0x0'));var util=require(_0xb9a7('0x1'));var moment=require(_0xb9a7('0x2'));var BPromise=require(_0xb9a7('0x3'));var rs=require(_0xb9a7('0x4'));var fs=require('fs');var Redis=require(_0xb9a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb9a7('0x6'))(_0xb9a7('0x7'));var config=require(_0xb9a7('0x8'));var jayson=require(_0xb9a7('0x9'));var client=jayson[_0xb9a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a85ca,_0x8f3ecd,_0x59aa3c){return new BPromise(function(_0x12f515,_0x5d1e2b){return client['request'](_0x2a85ca,_0x59aa3c)[_0xb9a7('0xb')](function(_0x56a16a){logger[_0xb9a7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x8f3ecd,'request\x20sent');logger[_0xb9a7('0xd')](_0xb9a7('0xe'),_0x8f3ecd,'request\x20sent',JSON[_0xb9a7('0xf')](_0x56a16a));if(_0x56a16a['error']){if(_0x56a16a['error'][_0xb9a7('0x10')]===0x1f4){logger[_0xb9a7('0x11')](_0xb9a7('0x12'),_0x8f3ecd,_0x56a16a[_0xb9a7('0x11')][_0xb9a7('0x13')]);return _0x5d1e2b(_0x56a16a[_0xb9a7('0x11')][_0xb9a7('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x8f3ecd,_0x56a16a[_0xb9a7('0x11')][_0xb9a7('0x13')]);return _0x12f515(_0x56a16a[_0xb9a7('0x11')][_0xb9a7('0x13')]);}else{logger[_0xb9a7('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x8f3ecd,_0xb9a7('0x14'));_0x12f515(_0x56a16a[_0xb9a7('0x15')][_0xb9a7('0x13')]);}})[_0xb9a7('0x16')](function(_0xd070e6){logger[_0xb9a7('0x11')](_0xb9a7('0x12'),_0x8f3ecd,_0xd070e6);_0x5d1e2b(_0xd070e6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 73de154..9dcaa0d 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 _0xb469=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x559854,_0x2056e1){var _0x5bf2b9=function(_0x5ed1a1){while(--_0x5ed1a1){_0x559854['push'](_0x559854['shift']());}};_0x5bf2b9(++_0x2056e1);}(_0xb469,0x13b));var _0x9b46=function(_0x108ac7,_0x4e4d){_0x108ac7=_0x108ac7-0x0;var _0x458059=_0xb469[_0x108ac7];return _0x458059;};'use strict';var multer=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require(_0x9b46('0x2'));var timeout=require(_0x9b46('0x3'));var express=require(_0x9b46('0x4'));var router=express[_0x9b46('0x5')]();var fs_extra=require(_0x9b46('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b46('0x7'));var config=require(_0x9b46('0x8'));var controller=require('./intFreshsalesField.controller');router[_0x9b46('0x9')]('/',auth[_0x9b46('0xa')](),controller['index']);router[_0x9b46('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9b46('0xb')]);router['post']('/',auth[_0x9b46('0xa')](),controller[_0x9b46('0xc')]);router[_0x9b46('0xd')]('/:id',auth[_0x9b46('0xa')](),controller['update']);router[_0x9b46('0xe')]('/:id',auth[_0x9b46('0xa')](),controller['destroy']);module[_0x9b46('0xf')]=router; \ No newline at end of file +var _0x581a=['fs-extra','../../components/auth/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1930c6,_0x49ed64){var _0x536d7c=function(_0xfaae8d){while(--_0xfaae8d){_0x1930c6['push'](_0x1930c6['shift']());}};_0x536d7c(++_0x49ed64);}(_0x581a,0x127));var _0xa581=function(_0x17df31,_0x368f8d){_0x17df31=_0x17df31-0x0;var _0x5dcbb1=_0x581a[_0x17df31];return _0x5dcbb1;};'use strict';var multer=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var path=require('path');var timeout=require(_0xa581('0x2'));var express=require(_0xa581('0x3'));var router=express[_0xa581('0x4')]();var fs_extra=require(_0xa581('0x5'));var auth=require(_0xa581('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa581('0x7'));router['get']('/',auth[_0xa581('0x8')](),controller[_0xa581('0x9')]);router[_0xa581('0xa')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0xc')]);router[_0xa581('0xd')]('/',auth[_0xa581('0x8')](),controller[_0xa581('0xe')]);router[_0xa581('0xf')](_0xa581('0xb'),auth['isAuthenticated'](),controller[_0xa581('0x10')]);router[_0xa581('0x11')](_0xa581('0xb'),auth[_0xa581('0x8')](),controller[_0xa581('0x12')]);module[_0xa581('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ae0a8ce..073b3b3 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 _0x9bca=['customVariable','keyValue','picklist','string','STRING','variable','sequelize','exports','ENUM'];(function(_0x455580,_0x5cd4dd){var _0x7aabc2=function(_0x10bf94){while(--_0x10bf94){_0x455580['push'](_0x455580['shift']());}};_0x7aabc2(++_0x5cd4dd);}(_0x9bca,0x72));var _0xa9bc=function(_0x42fe35,_0x2493f6){_0x42fe35=_0x42fe35-0x0;var _0x303e83=_0x9bca[_0x42fe35];return _0x303e83;};'use strict';var Sequelize=require(_0xa9bc('0x0'));module[_0xa9bc('0x1')]={'type':{'type':Sequelize[_0xa9bc('0x2')]('string','variable',_0xa9bc('0x3'),_0xa9bc('0x4'),_0xa9bc('0x5')),'defaultValue':_0xa9bc('0x6')},'content':{'type':Sequelize[_0xa9bc('0x7')]},'key':{'type':Sequelize[_0xa9bc('0x7')]},'keyType':{'type':Sequelize[_0xa9bc('0x2')](_0xa9bc('0x6'),_0xa9bc('0x8'),_0xa9bc('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa9bc('0x7')]},'nameField':{'type':Sequelize[_0xa9bc('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa9bc('0x7')]}}; \ No newline at end of file +var _0x100c=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x100c,0x104));var _0xc100=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x100c[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0xc100('0x0')]={'type':{'type':Sequelize[_0xc100('0x1')](_0xc100('0x2'),_0xc100('0x3'),'customVariable',_0xc100('0x4'),_0xc100('0x5')),'defaultValue':_0xc100('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc100('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xc100('0x3'),_0xc100('0x7'))},'keyContent':{'type':Sequelize[_0xc100('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc100('0x6')]},'customField':{'type':Sequelize[_0xc100('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc100('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 2d15706..442e6c9 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 _0x80a4=['length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','include','findAll','show','params','rawAttributes','includeAll','options','create','catch','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','update','then','destroy','error','name','send','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2ddd5d,_0x35f964){var _0x24af97=function(_0x333e20){while(--_0x333e20){_0x2ddd5d['push'](_0x2ddd5d['shift']());}};_0x24af97(++_0x35f964);}(_0x80a4,0x177));var _0x480a=function(_0x451402,_0x561cb8){_0x451402=_0x451402-0x0;var _0x4ffb7f=_0x80a4[_0x451402];return _0x4ffb7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x480a('0x0'));var zipdir=require(_0x480a('0x1'));var jsonpatch=require(_0x480a('0x2'));var rp=require(_0x480a('0x3'));var moment=require('moment');var BPromise=require(_0x480a('0x4'));var Mustache=require(_0x480a('0x5'));var util=require(_0x480a('0x6'));var path=require(_0x480a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x480a('0x8'));var fs=require('fs');var fs_extra=require(_0x480a('0x9'));var _=require(_0x480a('0xa'));var squel=require(_0x480a('0xb'));var crypto=require(_0x480a('0xc'));var jsforce=require(_0x480a('0xd'));var deskjs=require(_0x480a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x480a('0xf'));var Papa=require(_0x480a('0x10'));var Redis=require(_0x480a('0x11'));var authService=require(_0x480a('0x12'));var qs=require(_0x480a('0x13'));var as=require(_0x480a('0x14'));var hardwareService=require(_0x480a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x480a('0x16'));var config=require(_0x480a('0x17'));var licenseUtil=require(_0x480a('0x18'));var db=require(_0x480a('0x19'))['db'];function respondWithStatusCode(_0x2ba6f1,_0xc9f82a){_0xc9f82a=_0xc9f82a||0xcc;return function(_0x3dc609){if(_0x3dc609){return _0x2ba6f1['sendStatus'](_0xc9f82a);}return _0x2ba6f1[_0x480a('0x1a')](_0xc9f82a)[_0x480a('0x1b')]();};}function respondWithResult(_0x53b6d8,_0x29b518){_0x29b518=_0x29b518||0xc8;return function(_0x597645){if(_0x597645){return _0x53b6d8[_0x480a('0x1a')](_0x29b518)[_0x480a('0x1c')](_0x597645);}};}function respondWithFilteredResult(_0x107940,_0x43fa52){return function(_0x2cebb7){if(_0x2cebb7){var _0x4cf169=typeof _0x43fa52['offset']==='undefined'&&typeof _0x43fa52['limit']===_0x480a('0x1d');var _0x14723c=_0x2cebb7[_0x480a('0x1e')];var _0x13a7d6=_0x4cf169?0x0:_0x43fa52[_0x480a('0x1f')];var _0x30cae5=_0x4cf169?_0x2cebb7[_0x480a('0x1e')]:_0x43fa52[_0x480a('0x1f')]+_0x43fa52['limit'];var _0x34ba20;if(_0x30cae5>=_0x14723c){_0x30cae5=_0x14723c;_0x34ba20=0xc8;}else{_0x34ba20=0xce;}_0x107940[_0x480a('0x1a')](_0x34ba20);return _0x107940[_0x480a('0x20')]('Content-Range',_0x13a7d6+'-'+_0x30cae5+'/'+_0x14723c)[_0x480a('0x1c')](_0x2cebb7);}return null;};}function patchUpdates(_0x59a63e){return function(_0x50b7f2){try{jsonpatch['apply'](_0x50b7f2,_0x59a63e,!![]);}catch(_0x5670df){return BPromise['reject'](_0x5670df);}return _0x50b7f2['save']();};}function saveUpdates(_0x10edf3,_0x4fde04){return function(_0x46df4f){if(_0x46df4f){return _0x46df4f[_0x480a('0x21')](_0x10edf3)[_0x480a('0x22')](function(_0x4d4256){return _0x4d4256;});}return null;};}function removeEntity(_0xa383ef,_0x2598de){return function(_0x315c3c){if(_0x315c3c){return _0x315c3c[_0x480a('0x23')]()[_0x480a('0x22')](function(){_0xa383ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53e395,_0x17d3b4){return function(_0x4f169b){if(!_0x4f169b){_0x53e395['sendStatus'](0x194);}return _0x4f169b;};}function handleError(_0x3fab95,_0x512737){_0x512737=_0x512737||0x1f4;return function(_0x5327a2){logger[_0x480a('0x24')](_0x5327a2['stack']);if(_0x5327a2[_0x480a('0x25')]){delete _0x5327a2['name'];}_0x3fab95[_0x480a('0x1a')](_0x512737)[_0x480a('0x26')](_0x5327a2);};}exports['index']=function(_0x1cfcbe,_0x2ffca8){var _0x5d5b90={},_0x2524b7={},_0x4501a8={'count':0x0,'rows':[]};var _0x3f9c96=_[_0x480a('0x27')](db[_0x480a('0x28')]['rawAttributes'],function(_0xdb17e7){return{'name':_0xdb17e7[_0x480a('0x29')],'type':_0xdb17e7[_0x480a('0x2a')][_0x480a('0x2b')]};});_0x2524b7[_0x480a('0x2c')]=_[_0x480a('0x27')](_0x3f9c96,'name');_0x2524b7[_0x480a('0x2d')]=_[_0x480a('0x2e')](_0x1cfcbe['query']);_0x2524b7[_0x480a('0x2f')]=_[_0x480a('0x30')](_0x2524b7[_0x480a('0x2c')],_0x2524b7[_0x480a('0x2d')]);_0x5d5b90[_0x480a('0x31')]=_['intersection'](_0x2524b7[_0x480a('0x2c')],qs[_0x480a('0x32')](_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x32')]));_0x5d5b90[_0x480a('0x31')]=_0x5d5b90[_0x480a('0x31')][_0x480a('0x33')]?_0x5d5b90['attributes']:_0x2524b7[_0x480a('0x2c')];if(!_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x34')](_0x480a('0x35'))){_0x5d5b90[_0x480a('0x36')]=qs[_0x480a('0x36')](_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x36')]);_0x5d5b90[_0x480a('0x1f')]=qs[_0x480a('0x1f')](_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x1f')]);}_0x5d5b90['order']=qs['sort'](_0x1cfcbe['query'][_0x480a('0x37')]);_0x5d5b90[_0x480a('0x38')]=qs[_0x480a('0x2f')](_['pick'](_0x1cfcbe[_0x480a('0x2d')],_0x2524b7[_0x480a('0x2f')]),_0x3f9c96);if(_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x39')]){_0x5d5b90[_0x480a('0x38')]=_[_0x480a('0x3a')](_0x5d5b90[_0x480a('0x38')],{'$or':_['map'](_0x3f9c96,function(_0x26304c){if(_0x26304c[_0x480a('0x2a')]!==_0x480a('0x3b')){var _0x5acc91={};_0x5acc91[_0x26304c[_0x480a('0x25')]]={'$like':'%'+_0x1cfcbe[_0x480a('0x2d')][_0x480a('0x39')]+'%'};return _0x5acc91;}})});}_0x5d5b90=_[_0x480a('0x3a')]({},_0x5d5b90,_0x1cfcbe['options']);var _0x54a9f3={'where':_0x5d5b90[_0x480a('0x38')]};return db[_0x480a('0x28')][_0x480a('0x1e')](_0x54a9f3)[_0x480a('0x22')](function(_0x2fa5f4){_0x4501a8[_0x480a('0x1e')]=_0x2fa5f4;if(_0x1cfcbe[_0x480a('0x2d')]['includeAll']){_0x5d5b90[_0x480a('0x3c')]=[{'all':!![]}];}return db[_0x480a('0x28')][_0x480a('0x3d')](_0x5d5b90);})['then'](function(_0x19c59b){_0x4501a8['rows']=_0x19c59b;return _0x4501a8;})[_0x480a('0x22')](respondWithFilteredResult(_0x2ffca8,_0x5d5b90))['catch'](handleError(_0x2ffca8,null));};exports[_0x480a('0x3e')]=function(_0x892c37,_0x869e6a){var _0x15854f={'raw':!![],'where':{'id':_0x892c37[_0x480a('0x3f')]['id']}},_0x5ed97c={};_0x5ed97c['model']=_['keys'](db['FreshsalesField'][_0x480a('0x40')]);_0x5ed97c[_0x480a('0x2d')]=_[_0x480a('0x2e')](_0x892c37['query']);_0x5ed97c[_0x480a('0x2f')]=_[_0x480a('0x30')](_0x5ed97c[_0x480a('0x2c')],_0x5ed97c[_0x480a('0x2d')]);_0x15854f[_0x480a('0x31')]=_[_0x480a('0x30')](_0x5ed97c[_0x480a('0x2c')],qs[_0x480a('0x32')](_0x892c37[_0x480a('0x2d')]['fields']));_0x15854f[_0x480a('0x31')]=_0x15854f['attributes'][_0x480a('0x33')]?_0x15854f[_0x480a('0x31')]:_0x5ed97c[_0x480a('0x2c')];if(_0x892c37['query'][_0x480a('0x41')]){_0x15854f[_0x480a('0x3c')]=[{'all':!![]}];}_0x15854f=_[_0x480a('0x3a')]({},_0x15854f,_0x892c37[_0x480a('0x42')]);return db[_0x480a('0x28')]['find'](_0x15854f)['then'](handleEntityNotFound(_0x869e6a,null))[_0x480a('0x22')](respondWithResult(_0x869e6a,null))['catch'](handleError(_0x869e6a,null));};exports[_0x480a('0x43')]=function(_0x22c710,_0x20fd6d){return db['FreshsalesField'][_0x480a('0x43')](_0x22c710['body'],{})['then'](respondWithResult(_0x20fd6d,0xc9))[_0x480a('0x44')](handleError(_0x20fd6d,null));};exports[_0x480a('0x21')]=function(_0x21e9ce,_0x2efb0a){if(_0x21e9ce[_0x480a('0x45')]['id']){delete _0x21e9ce[_0x480a('0x45')]['id'];}return db[_0x480a('0x28')][_0x480a('0x46')]({'where':{'id':_0x21e9ce['params']['id']}})['then'](handleEntityNotFound(_0x2efb0a,null))[_0x480a('0x22')](saveUpdates(_0x21e9ce[_0x480a('0x45')],null))['then'](respondWithResult(_0x2efb0a,null))[_0x480a('0x44')](handleError(_0x2efb0a,null));};exports['destroy']=function(_0xe3567d,_0x30e374){return db['FreshsalesField'][_0x480a('0x46')]({'where':{'id':_0xe3567d[_0x480a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x30e374,null))[_0x480a('0x22')](removeEntity(_0x30e374,null))[_0x480a('0x44')](handleError(_0x30e374,null));}; \ No newline at end of file +var _0x8ed2=['save','update','destroy','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x10f97c,_0x2a98a5){var _0x14279e=function(_0x18b01f){while(--_0x18b01f){_0x10f97c['push'](_0x10f97c['shift']());}};_0x14279e(++_0x2a98a5);}(_0x8ed2,0xbb));var _0x28ed=function(_0x46b489,_0x16e6e9){_0x46b489=_0x46b489-0x0;var _0x462e81=_0x8ed2[_0x46b489];return _0x462e81;};'use strict';var emlformat=require(_0x28ed('0x0'));var rimraf=require(_0x28ed('0x1'));var zipdir=require(_0x28ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ed('0x3'));var moment=require(_0x28ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28ed('0x5'));var util=require('util');var path=require(_0x28ed('0x6'));var sox=require(_0x28ed('0x7'));var csv=require(_0x28ed('0x8'));var ejs=require(_0x28ed('0x9'));var fs=require('fs');var fs_extra=require(_0x28ed('0xa'));var _=require(_0x28ed('0xb'));var squel=require(_0x28ed('0xc'));var crypto=require(_0x28ed('0xd'));var jsforce=require(_0x28ed('0xe'));var deskjs=require(_0x28ed('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28ed('0x10'));var Papa=require(_0x28ed('0x11'));var Redis=require(_0x28ed('0x12'));var authService=require(_0x28ed('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28ed('0x14'));var logger=require(_0x28ed('0x15'))(_0x28ed('0x16'));var utils=require(_0x28ed('0x17'));var config=require(_0x28ed('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ed('0x19'))['db'];function respondWithStatusCode(_0x1f6c37,_0x37d012){_0x37d012=_0x37d012||0xcc;return function(_0x553704){if(_0x553704){return _0x1f6c37[_0x28ed('0x1a')](_0x37d012);}return _0x1f6c37[_0x28ed('0x1b')](_0x37d012)[_0x28ed('0x1c')]();};}function respondWithResult(_0x42081d,_0x268275){_0x268275=_0x268275||0xc8;return function(_0xa2ef0e){if(_0xa2ef0e){return _0x42081d[_0x28ed('0x1b')](_0x268275)[_0x28ed('0x1d')](_0xa2ef0e);}};}function respondWithFilteredResult(_0x3dd4ba,_0xaed98a){return function(_0x4d71c2){if(_0x4d71c2){var _0x3db87a=typeof _0xaed98a[_0x28ed('0x1e')]===_0x28ed('0x1f')&&typeof _0xaed98a[_0x28ed('0x20')]===_0x28ed('0x1f');var _0x1f9d6d=_0x4d71c2['count'];var _0x313841=_0x3db87a?0x0:_0xaed98a['offset'];var _0x4c4e38=_0x3db87a?_0x4d71c2[_0x28ed('0x21')]:_0xaed98a[_0x28ed('0x1e')]+_0xaed98a[_0x28ed('0x20')];var _0x402738;if(_0x4c4e38>=_0x1f9d6d){_0x4c4e38=_0x1f9d6d;_0x402738=0xc8;}else{_0x402738=0xce;}_0x3dd4ba[_0x28ed('0x1b')](_0x402738);return _0x3dd4ba[_0x28ed('0x22')](_0x28ed('0x23'),_0x313841+'-'+_0x4c4e38+'/'+_0x1f9d6d)[_0x28ed('0x1d')](_0x4d71c2);}return null;};}function patchUpdates(_0x33ff75){return function(_0x390b1f){try{jsonpatch[_0x28ed('0x24')](_0x390b1f,_0x33ff75,!![]);}catch(_0x93aa46){return BPromise[_0x28ed('0x25')](_0x93aa46);}return _0x390b1f[_0x28ed('0x26')]();};}function saveUpdates(_0x3285de,_0x1e3d1e){return function(_0xbd62d5){if(_0xbd62d5){return _0xbd62d5[_0x28ed('0x27')](_0x3285de)['then'](function(_0x4fd343){return _0x4fd343;});}return null;};}function removeEntity(_0x1201c5,_0x29ae98){return function(_0x32f256){if(_0x32f256){return _0x32f256[_0x28ed('0x28')]()[_0x28ed('0x29')](function(){_0x1201c5[_0x28ed('0x1b')](0xcc)[_0x28ed('0x1c')]();});}};}function handleEntityNotFound(_0x19e80c,_0x521e3e){return function(_0x1c8fae){if(!_0x1c8fae){_0x19e80c['sendStatus'](0x194);}return _0x1c8fae;};}function handleError(_0xe456af,_0x16da59){_0x16da59=_0x16da59||0x1f4;return function(_0x8dd066){logger[_0x28ed('0x2a')](_0x8dd066['stack']);if(_0x8dd066[_0x28ed('0x2b')]){delete _0x8dd066[_0x28ed('0x2b')];}_0xe456af[_0x28ed('0x1b')](_0x16da59)['send'](_0x8dd066);};}exports[_0x28ed('0x2c')]=function(_0x668a08,_0x29f2c8){var _0x755980={},_0x2376e1={},_0x541eb9={'count':0x0,'rows':[]};var _0x47fbd0=_[_0x28ed('0x2d')](db['FreshsalesField'][_0x28ed('0x2e')],function(_0x5ded5b){return{'name':_0x5ded5b[_0x28ed('0x2f')],'type':_0x5ded5b[_0x28ed('0x30')][_0x28ed('0x31')]};});_0x2376e1[_0x28ed('0x32')]=_[_0x28ed('0x2d')](_0x47fbd0,_0x28ed('0x2b'));_0x2376e1[_0x28ed('0x33')]=_[_0x28ed('0x34')](_0x668a08[_0x28ed('0x33')]);_0x2376e1['filters']=_[_0x28ed('0x35')](_0x2376e1[_0x28ed('0x32')],_0x2376e1[_0x28ed('0x33')]);_0x755980[_0x28ed('0x36')]=_[_0x28ed('0x35')](_0x2376e1[_0x28ed('0x32')],qs[_0x28ed('0x37')](_0x668a08[_0x28ed('0x33')][_0x28ed('0x37')]));_0x755980[_0x28ed('0x36')]=_0x755980[_0x28ed('0x36')][_0x28ed('0x38')]?_0x755980[_0x28ed('0x36')]:_0x2376e1[_0x28ed('0x32')];if(!_0x668a08[_0x28ed('0x33')]['hasOwnProperty']('nolimit')){_0x755980[_0x28ed('0x20')]=qs[_0x28ed('0x20')](_0x668a08[_0x28ed('0x33')]['limit']);_0x755980[_0x28ed('0x1e')]=qs[_0x28ed('0x1e')](_0x668a08[_0x28ed('0x33')]['offset']);}_0x755980[_0x28ed('0x39')]=qs['sort'](_0x668a08['query'][_0x28ed('0x3a')]);_0x755980[_0x28ed('0x3b')]=qs['filters'](_[_0x28ed('0x3c')](_0x668a08[_0x28ed('0x33')],_0x2376e1[_0x28ed('0x3d')]),_0x47fbd0);if(_0x668a08[_0x28ed('0x33')][_0x28ed('0x3e')]){_0x755980[_0x28ed('0x3b')]=_[_0x28ed('0x3f')](_0x755980[_0x28ed('0x3b')],{'$or':_[_0x28ed('0x2d')](_0x47fbd0,function(_0x3277ed){if(_0x3277ed[_0x28ed('0x30')]!==_0x28ed('0x40')){var _0x43a77d={};_0x43a77d[_0x3277ed[_0x28ed('0x2b')]]={'$like':'%'+_0x668a08[_0x28ed('0x33')][_0x28ed('0x3e')]+'%'};return _0x43a77d;}})});}_0x755980=_[_0x28ed('0x3f')]({},_0x755980,_0x668a08[_0x28ed('0x41')]);var _0x19f3af={'where':_0x755980[_0x28ed('0x3b')]};return db[_0x28ed('0x42')][_0x28ed('0x21')](_0x19f3af)[_0x28ed('0x29')](function(_0x499cfb){_0x541eb9[_0x28ed('0x21')]=_0x499cfb;if(_0x668a08[_0x28ed('0x33')][_0x28ed('0x43')]){_0x755980[_0x28ed('0x44')]=[{'all':!![]}];}return db[_0x28ed('0x42')]['findAll'](_0x755980);})[_0x28ed('0x29')](function(_0x41d734){_0x541eb9[_0x28ed('0x45')]=_0x41d734;return _0x541eb9;})['then'](respondWithFilteredResult(_0x29f2c8,_0x755980))[_0x28ed('0x46')](handleError(_0x29f2c8,null));};exports['show']=function(_0x2d84c5,_0x16bfbc){var _0x45855a={'raw':!![],'where':{'id':_0x2d84c5[_0x28ed('0x47')]['id']}},_0x3bbe07={};_0x3bbe07[_0x28ed('0x32')]=_[_0x28ed('0x34')](db['FreshsalesField'][_0x28ed('0x2e')]);_0x3bbe07['query']=_[_0x28ed('0x34')](_0x2d84c5[_0x28ed('0x33')]);_0x3bbe07[_0x28ed('0x3d')]=_['intersection'](_0x3bbe07[_0x28ed('0x32')],_0x3bbe07[_0x28ed('0x33')]);_0x45855a['attributes']=_[_0x28ed('0x35')](_0x3bbe07[_0x28ed('0x32')],qs['fields'](_0x2d84c5[_0x28ed('0x33')][_0x28ed('0x37')]));_0x45855a[_0x28ed('0x36')]=_0x45855a[_0x28ed('0x36')][_0x28ed('0x38')]?_0x45855a['attributes']:_0x3bbe07[_0x28ed('0x32')];if(_0x2d84c5[_0x28ed('0x33')][_0x28ed('0x43')]){_0x45855a[_0x28ed('0x44')]=[{'all':!![]}];}_0x45855a=_['merge']({},_0x45855a,_0x2d84c5['options']);return db[_0x28ed('0x42')][_0x28ed('0x48')](_0x45855a)[_0x28ed('0x29')](handleEntityNotFound(_0x16bfbc,null))[_0x28ed('0x29')](respondWithResult(_0x16bfbc,null))[_0x28ed('0x46')](handleError(_0x16bfbc,null));};exports[_0x28ed('0x49')]=function(_0x2f975c,_0x10e82e){return db[_0x28ed('0x42')][_0x28ed('0x49')](_0x2f975c[_0x28ed('0x4a')],{})['then'](respondWithResult(_0x10e82e,0xc9))[_0x28ed('0x46')](handleError(_0x10e82e,null));};exports[_0x28ed('0x27')]=function(_0x5753db,_0xc9abe2){if(_0x5753db[_0x28ed('0x4a')]['id']){delete _0x5753db[_0x28ed('0x4a')]['id'];}return db[_0x28ed('0x42')][_0x28ed('0x48')]({'where':{'id':_0x5753db[_0x28ed('0x47')]['id']}})['then'](handleEntityNotFound(_0xc9abe2,null))[_0x28ed('0x29')](saveUpdates(_0x5753db[_0x28ed('0x4a')],null))[_0x28ed('0x29')](respondWithResult(_0xc9abe2,null))[_0x28ed('0x46')](handleError(_0xc9abe2,null));};exports[_0x28ed('0x28')]=function(_0x4414f0,_0x56fdfe){return db[_0x28ed('0x42')]['find']({'where':{'id':_0x4414f0[_0x28ed('0x47')]['id']}})[_0x28ed('0x29')](handleEntityNotFound(_0x56fdfe,null))[_0x28ed('0x29')](removeEntity(_0x56fdfe,null))[_0x28ed('0x46')](handleError(_0x56fdfe,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b0eae9f..e8ef161 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 _0xd1d3=['define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports'];(function(_0x451812,_0x1b5ad0){var _0x2c530c=function(_0x5e00b5){while(--_0x5e00b5){_0x451812['push'](_0x451812['shift']());}};_0x2c530c(++_0x1b5ad0);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x202ad6,_0x780e10){_0x202ad6=_0x202ad6-0x0;var _0x462eef=_0xd1d3[_0x202ad6];return _0x462eef;};'use strict';var _=require(_0x3d1d('0x0'));var util=require('util');var logger=require(_0x3d1d('0x1'))('api');var moment=require(_0x3d1d('0x2'));var BPromise=require(_0x3d1d('0x3'));var rp=require(_0x3d1d('0x4'));var fs=require('fs');var path=require(_0x3d1d('0x5'));var rimraf=require(_0x3d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d1d('0x7'));module[_0x3d1d('0x8')]=function(_0x55c165,_0x2d3a52){return _0x55c165[_0x3d1d('0x9')]('FreshsalesField',attributes,{'tableName':_0x3d1d('0xa'),'paranoid':![],'indexes':[{'name':_0x3d1d('0xb'),'fields':[_0x3d1d('0xc'),_0x3d1d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','int_freshsales_fields','freshsales_unique_index','lodash','util','../../config/logger'];(function(_0x516fa8,_0x1ac2ba){var _0xe1dac5=function(_0x3fb2e6){while(--_0x3fb2e6){_0x516fa8['push'](_0x516fa8['shift']());}};_0xe1dac5(++_0x1ac2ba);}(_0xd943,0x15d));var _0x3d94=function(_0xceca68,_0x3ae11f){_0xceca68=_0xceca68-0x0;var _0x33ab4c=_0xd943[_0xceca68];return _0x33ab4c;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('FreshsalesField',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['idField','FieldId'],'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 938c4ca..c85c5b4 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 _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x33dfcb,_0x268c02){var _0x2c6da2=function(_0x4c211d){while(--_0x4c211d){_0x33dfcb['push'](_0x33dfcb['shift']());}};_0x2c6da2(++_0x268c02);}(_0xafc4,0x69));var _0x4afc=function(_0x65bed5,_0xb6bf6a){_0x65bed5=_0x65bed5-0x0;var _0x3fb9d0=_0xafc4[_0x65bed5];return _0x3fb9d0;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});} \ No newline at end of file +var _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x20807c,_0x6751c4){var _0x514de5=function(_0x3a3a31){while(--_0x3a3a31){_0x20807c['push'](_0x20807c['shift']());}};_0x514de5(++_0x6751c4);}(_0x2a07,0x74));var _0x72a0=function(_0x94030f,_0x476ed2){_0x94030f=_0x94030f-0x0;var _0x9f7747=_0x2a07[_0x94030f];return _0x9f7747;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 84ad3ee..45077e1 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(_0x27084a,_0x305325){var _0x52a8c2=function(_0x464bef){while(--_0x464bef){_0x27084a['push'](_0x27084a['shift']());}};_0x52a8c2(++_0x305325);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x356259,_0x772558){var _0x37d369=function(_0x11803f){while(--_0x11803f){_0x356259['push'](_0x356259['shift']());}};_0x37d369(++_0x772558);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 86da82c..713a730 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 _0x8163=['exports','STRING','integrationTab','sequelize'];(function(_0x5d61e8,_0x3ac08f){var _0x144c95=function(_0x424f1c){while(--_0x424f1c){_0x5d61e8['push'](_0x5d61e8['shift']());}};_0x144c95(++_0x3ac08f);}(_0x8163,0x11b));var _0x3816=function(_0x524244,_0x43dd56){_0x524244=_0x524244-0x0;var _0x5cfe13=_0x8163[_0x524244];return _0x5cfe13;};'use strict';var Sequelize=require(_0x3816('0x0'));module[_0x3816('0x1')]={'name':{'type':Sequelize[_0x3816('0x2')]},'description':{'type':Sequelize[_0x3816('0x2')]},'username':{'type':Sequelize[_0x3816('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3816('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x3816('0x2')]},'securityToken':{'type':Sequelize[_0x3816('0x2')]},'serverUrl':{'type':Sequelize[_0x3816('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3816('0x3'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xb4f8=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x177f21,_0x2ee985){var _0x17bc6c=function(_0x2899a0){while(--_0x2899a0){_0x177f21['push'](_0x177f21['shift']());}};_0x17bc6c(++_0x2ee985);}(_0xb4f8,0x83));var _0x8b4f=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0xb4f8[_0x557fd2];return _0x1b54a2;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'name':{'type':Sequelize[_0x8b4f('0x1')]},'description':{'type':Sequelize[_0x8b4f('0x1')]},'username':{'type':Sequelize[_0x8b4f('0x1')],'unique':_0x8b4f('0x2')},'remoteUri':{'type':Sequelize[_0x8b4f('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8b4f('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x8b4f('0x1')]},'serverUrl':{'type':Sequelize[_0x8b4f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8b4f('0x3')](_0x8b4f('0x4'),_0x8b4f('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 45470eb..4ac004c 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 _0xaaa0=['false','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','stack','name','index','map','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','SalesforceAccount','include','findAll','rows','show','params','includeAll','find','catch','create','body','getConfigurations','findOne','order','filter','options','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','password','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsRecurrence','Subject','string','int','picklist','email','phone','remove','includes','label','custom','picklistValues','value','True','true','False'];(function(_0x172153,_0xa788dc){var _0x3bede0=function(_0x3028e6){while(--_0x3028e6){_0x172153['push'](_0x172153['shift']());}};_0x3bede0(++_0xa788dc);}(_0xaaa0,0x7f));var _0x0aaa=function(_0x1c6b18,_0x233b7c){_0x1c6b18=_0x1c6b18-0x0;var _0xbb8a48=_0xaaa0[_0x1c6b18];return _0xbb8a48;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0aaa('0x0'));var jsonpatch=require(_0x0aaa('0x1'));var rp=require(_0x0aaa('0x2'));var moment=require(_0x0aaa('0x3'));var BPromise=require(_0x0aaa('0x4'));var Mustache=require(_0x0aaa('0x5'));var util=require(_0x0aaa('0x6'));var path=require(_0x0aaa('0x7'));var sox=require(_0x0aaa('0x8'));var csv=require(_0x0aaa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0aaa('0xa'));var squel=require('squel');var crypto=require(_0x0aaa('0xb'));var jsforce=require(_0x0aaa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0aaa('0x9'));var querystring=require('querystring');var Papa=require(_0x0aaa('0xd'));var Redis=require(_0x0aaa('0xe'));var authService=require(_0x0aaa('0xf'));var qs=require(_0x0aaa('0x10'));var as=require(_0x0aaa('0x11'));var hardwareService=require(_0x0aaa('0x12'));var logger=require(_0x0aaa('0x13'))('api');var utils=require(_0x0aaa('0x14'));var config=require(_0x0aaa('0x15'));var licenseUtil=require(_0x0aaa('0x16'));var db=require(_0x0aaa('0x17'))['db'];var integrations=require(_0x0aaa('0x18'));function respondWithStatusCode(_0x4a6f7c,_0x4256c2){_0x4256c2=_0x4256c2||0xcc;return function(_0x22944d){if(_0x22944d){return _0x4a6f7c[_0x0aaa('0x19')](_0x4256c2);}return _0x4a6f7c[_0x0aaa('0x1a')](_0x4256c2)[_0x0aaa('0x1b')]();};}function respondWithResult(_0x503f09,_0x5b8eea){_0x5b8eea=_0x5b8eea||0xc8;return function(_0x222e72){if(_0x222e72){return _0x503f09['status'](_0x5b8eea)[_0x0aaa('0x1c')](_0x222e72);}};}function respondWithFilteredResult(_0x8ae6c9,_0x786b78){return function(_0x39c4fa){if(_0x39c4fa){var _0x1d1de3=typeof _0x786b78[_0x0aaa('0x1d')]==='undefined'&&typeof _0x786b78[_0x0aaa('0x1e')]===_0x0aaa('0x1f');var _0x124ac7=_0x39c4fa['count'];var _0x11a1f3=_0x1d1de3?0x0:_0x786b78[_0x0aaa('0x1d')];var _0x24c7dd=_0x1d1de3?_0x39c4fa[_0x0aaa('0x20')]:_0x786b78[_0x0aaa('0x1d')]+_0x786b78[_0x0aaa('0x1e')];var _0x2e03a0;if(_0x24c7dd>=_0x124ac7){_0x24c7dd=_0x124ac7;_0x2e03a0=0xc8;}else{_0x2e03a0=0xce;}_0x8ae6c9[_0x0aaa('0x1a')](_0x2e03a0);return _0x8ae6c9['set'](_0x0aaa('0x21'),_0x11a1f3+'-'+_0x24c7dd+'/'+_0x124ac7)[_0x0aaa('0x1c')](_0x39c4fa);}return null;};}function patchUpdates(_0x3256bc){return function(_0x4a200e){try{jsonpatch['apply'](_0x4a200e,_0x3256bc,!![]);}catch(_0x3da500){return BPromise[_0x0aaa('0x22')](_0x3da500);}return _0x4a200e['save']();};}function saveUpdates(_0x5257d0,_0x585d52){return function(_0x222605){if(_0x222605){return _0x222605[_0x0aaa('0x23')](_0x5257d0)[_0x0aaa('0x24')](function(_0x20051b){return _0x20051b;});}return null;};}function removeEntity(_0x5ec700,_0x23b047){return function(_0x35b094){if(_0x35b094){return _0x35b094[_0x0aaa('0x25')]()[_0x0aaa('0x24')](function(){_0x5ec700['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37dfe0,_0x41ba44){return function(_0x11b196){if(!_0x11b196){_0x37dfe0[_0x0aaa('0x19')](0x194);}return _0x11b196;};}function handleError(_0x4f95ad,_0xfdee2c){_0xfdee2c=_0xfdee2c||0x1f4;return function(_0x56f5c2){logger['error'](_0x56f5c2[_0x0aaa('0x26')]);if(_0x56f5c2['name']){delete _0x56f5c2[_0x0aaa('0x27')];}_0x4f95ad['status'](_0xfdee2c)['send'](_0x56f5c2);};}exports[_0x0aaa('0x28')]=function(_0x31df1b,_0x1cc205){var _0x30a99f={},_0x30e169={},_0x2b8271={'count':0x0,'rows':[]};var _0x288d53=_[_0x0aaa('0x29')](db['SalesforceAccount'][_0x0aaa('0x2a')],function(_0x29399e){return{'name':_0x29399e['fieldName'],'type':_0x29399e[_0x0aaa('0x2b')]['key']};});_0x30e169['model']=_['map'](_0x288d53,_0x0aaa('0x27'));_0x30e169['query']=_[_0x0aaa('0x2c')](_0x31df1b[_0x0aaa('0x2d')]);_0x30e169[_0x0aaa('0x2e')]=_[_0x0aaa('0x2f')](_0x30e169[_0x0aaa('0x30')],_0x30e169[_0x0aaa('0x2d')]);_0x30a99f[_0x0aaa('0x31')]=_[_0x0aaa('0x2f')](_0x30e169[_0x0aaa('0x30')],qs[_0x0aaa('0x32')](_0x31df1b[_0x0aaa('0x2d')]['fields']));_0x30a99f['attributes']=_0x30a99f['attributes'][_0x0aaa('0x33')]?_0x30a99f['attributes']:_0x30e169[_0x0aaa('0x30')];if(!_0x31df1b[_0x0aaa('0x2d')]['hasOwnProperty'](_0x0aaa('0x34'))){_0x30a99f[_0x0aaa('0x1e')]=qs['limit'](_0x31df1b['query'][_0x0aaa('0x1e')]);_0x30a99f[_0x0aaa('0x1d')]=qs['offset'](_0x31df1b[_0x0aaa('0x2d')][_0x0aaa('0x1d')]);}_0x30a99f['order']=qs[_0x0aaa('0x35')](_0x31df1b[_0x0aaa('0x2d')][_0x0aaa('0x35')]);_0x30a99f[_0x0aaa('0x36')]=qs[_0x0aaa('0x2e')](_['pick'](_0x31df1b['query'],_0x30e169['filters']),_0x288d53);if(_0x31df1b['query']['filter']){_0x30a99f[_0x0aaa('0x36')]=_[_0x0aaa('0x37')](_0x30a99f[_0x0aaa('0x36')],{'$or':_[_0x0aaa('0x29')](_0x288d53,function(_0x189f9b){if(_0x189f9b['type']!==_0x0aaa('0x38')){var _0x8a031a={};_0x8a031a[_0x189f9b[_0x0aaa('0x27')]]={'$like':'%'+_0x31df1b['query']['filter']+'%'};return _0x8a031a;}})});}_0x30a99f=_['merge']({},_0x30a99f,_0x31df1b['options']);var _0x37bc40={'where':_0x30a99f[_0x0aaa('0x36')]};return db[_0x0aaa('0x39')]['count'](_0x37bc40)[_0x0aaa('0x24')](function(_0x86635f){_0x2b8271[_0x0aaa('0x20')]=_0x86635f;if(_0x31df1b['query']['includeAll']){_0x30a99f[_0x0aaa('0x3a')]=[{'all':!![]}];}return db[_0x0aaa('0x39')][_0x0aaa('0x3b')](_0x30a99f);})['then'](function(_0x37cac8){_0x2b8271[_0x0aaa('0x3c')]=_0x37cac8;return _0x2b8271;})[_0x0aaa('0x24')](respondWithFilteredResult(_0x1cc205,_0x30a99f))['catch'](handleError(_0x1cc205,null));};exports[_0x0aaa('0x3d')]=function(_0x359955,_0x12156f){var _0x1423bb={'raw':![],'where':{'id':_0x359955[_0x0aaa('0x3e')]['id']}},_0x18bd06={};_0x18bd06[_0x0aaa('0x30')]=_[_0x0aaa('0x2c')](db['SalesforceAccount'][_0x0aaa('0x2a')]);_0x18bd06[_0x0aaa('0x2d')]=_[_0x0aaa('0x2c')](_0x359955[_0x0aaa('0x2d')]);_0x18bd06[_0x0aaa('0x2e')]=_['intersection'](_0x18bd06[_0x0aaa('0x30')],_0x18bd06[_0x0aaa('0x2d')]);_0x1423bb[_0x0aaa('0x31')]=_[_0x0aaa('0x2f')](_0x18bd06[_0x0aaa('0x30')],qs[_0x0aaa('0x32')](_0x359955[_0x0aaa('0x2d')][_0x0aaa('0x32')]));_0x1423bb['attributes']=_0x1423bb['attributes'][_0x0aaa('0x33')]?_0x1423bb[_0x0aaa('0x31')]:_0x18bd06[_0x0aaa('0x30')];if(_0x359955['query'][_0x0aaa('0x3f')]){_0x1423bb[_0x0aaa('0x3a')]=[{'all':!![]}];}_0x1423bb=_[_0x0aaa('0x37')]({},_0x1423bb,_0x359955['options']);return db[_0x0aaa('0x39')][_0x0aaa('0x40')](_0x1423bb)[_0x0aaa('0x24')](handleEntityNotFound(_0x12156f,null))['then'](respondWithResult(_0x12156f,null))[_0x0aaa('0x41')](handleError(_0x12156f,null));};exports[_0x0aaa('0x42')]=function(_0x4ac54e,_0x4406ea){return db[_0x0aaa('0x39')]['create'](_0x4ac54e['body'],{})[_0x0aaa('0x24')](respondWithResult(_0x4406ea,0xc9))[_0x0aaa('0x41')](handleError(_0x4406ea,null));};exports['update']=function(_0x4ea6d5,_0x10782a){if(_0x4ea6d5[_0x0aaa('0x43')]['id']){delete _0x4ea6d5[_0x0aaa('0x43')]['id'];}return db[_0x0aaa('0x39')][_0x0aaa('0x40')]({'where':{'id':_0x4ea6d5['params']['id']}})[_0x0aaa('0x24')](handleEntityNotFound(_0x10782a,null))['then'](saveUpdates(_0x4ea6d5['body'],null))[_0x0aaa('0x24')](respondWithResult(_0x10782a,null))[_0x0aaa('0x41')](handleError(_0x10782a,null));};exports['destroy']=function(_0x33902b,_0x4335d8){return db[_0x0aaa('0x39')][_0x0aaa('0x40')]({'where':{'id':_0x33902b['params']['id']}})[_0x0aaa('0x24')](handleEntityNotFound(_0x4335d8,null))[_0x0aaa('0x24')](removeEntity(_0x4335d8,null))['catch'](handleError(_0x4335d8,null));};exports[_0x0aaa('0x44')]=function(_0x40c50d,_0x846d8f,_0x2dae0b){var _0x4e8b32={};var _0x58134f={};var _0x865985;var _0x3f6833;return db[_0x0aaa('0x39')][_0x0aaa('0x45')]({'where':{'id':_0x40c50d['params']['id']}})['then'](handleEntityNotFound(_0x846d8f,null))[_0x0aaa('0x24')](function(_0x175a51){if(_0x175a51){_0x865985=_0x175a51;_0x58134f['model']=_['keys'](db['SalesforceConfiguration'][_0x0aaa('0x2a')]);_0x58134f[_0x0aaa('0x2d')]=_[_0x0aaa('0x2c')](_0x40c50d['query']);_0x58134f[_0x0aaa('0x2e')]=_[_0x0aaa('0x2f')](_0x58134f[_0x0aaa('0x30')],_0x58134f[_0x0aaa('0x2d')]);_0x4e8b32[_0x0aaa('0x31')]=_[_0x0aaa('0x2f')](_0x58134f[_0x0aaa('0x30')],qs[_0x0aaa('0x32')](_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x32')]));_0x4e8b32['attributes']=_0x4e8b32[_0x0aaa('0x31')][_0x0aaa('0x33')]?_0x4e8b32[_0x0aaa('0x31')]:_0x58134f[_0x0aaa('0x30')];_0x4e8b32[_0x0aaa('0x46')]=qs[_0x0aaa('0x35')](_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x35')]);_0x4e8b32[_0x0aaa('0x36')]=qs[_0x0aaa('0x2e')](_['pick'](_0x40c50d['query'],_0x58134f[_0x0aaa('0x2e')]));if(_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x47')]){_0x4e8b32[_0x0aaa('0x36')]=_[_0x0aaa('0x37')](_0x4e8b32[_0x0aaa('0x36')],{'$or':_[_0x0aaa('0x29')](_0x4e8b32['attributes'],function(_0x4e18be){var _0x3bf496={};_0x3bf496[_0x4e18be]={'$like':'%'+_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x47')]+'%'};return _0x3bf496;})});}_0x4e8b32=_[_0x0aaa('0x37')]({},_0x4e8b32,_0x40c50d[_0x0aaa('0x48')]);return _0x865985[_0x0aaa('0x44')](_0x4e8b32);}})[_0x0aaa('0x24')](function(_0xb4d302){if(_0xb4d302){_0x3f6833=_0xb4d302['length'];if(!_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x49')](_0x0aaa('0x34'))){_0x4e8b32[_0x0aaa('0x1e')]=qs['limit'](_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x1e')]);_0x4e8b32[_0x0aaa('0x1d')]=qs['offset'](_0x40c50d[_0x0aaa('0x2d')][_0x0aaa('0x1d')]);}return _0x865985['getConfigurations'](_0x4e8b32);}})['then'](function(_0x369413){if(_0x369413){return _0x369413?{'count':_0x3f6833,'rows':_0x369413}:null;}})[_0x0aaa('0x24')](respondWithResult(_0x846d8f,null))[_0x0aaa('0x41')](handleError(_0x846d8f,null));};exports['addConfiguration']=function(_0x2be0d1,_0x4e0e12,_0x201271){if(_0x2be0d1[_0x0aaa('0x43')]['id']){delete _0x2be0d1[_0x0aaa('0x43')]['id'];}return db[_0x0aaa('0x39')][_0x0aaa('0x45')]({'where':{'id':_0x2be0d1[_0x0aaa('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4e0e12,null))[_0x0aaa('0x24')](function(_0x5ce61d){if(_0x5ce61d){_0x2be0d1[_0x0aaa('0x43')][_0x0aaa('0x4a')]=_0x5ce61d['id'];_0x2be0d1[_0x0aaa('0x43')]['Subjects']=integrations[_0x0aaa('0x4b')](_0x2be0d1[_0x0aaa('0x43')][_0x0aaa('0x4c')],_0x2be0d1[_0x0aaa('0x43')][_0x0aaa('0x2b')]);_0x2be0d1[_0x0aaa('0x43')][_0x0aaa('0x4d')]=integrations[_0x0aaa('0x4e')](_0x2be0d1['body']['channel'],_0x2be0d1[_0x0aaa('0x43')][_0x0aaa('0x2b')]);return db['SalesforceConfiguration']['create'](_0x2be0d1['body'],{'include':[{'model':db[_0x0aaa('0x4f')],'as':_0x0aaa('0x50')},{'model':db[_0x0aaa('0x4f')],'as':_0x0aaa('0x4d')}]});}return null;})['then'](respondWithResult(_0x4e0e12,null))[_0x0aaa('0x41')](handleError(_0x4e0e12,null));};exports[_0x0aaa('0x51')]=function(_0x14af94,_0x3511df,_0x3e847e){var _0x546e94;var _0x179dbd='';var _0x2c5c13=_0x0aaa('0x52');return db['SalesforceAccount'][_0x0aaa('0x45')]({'where':{'id':_0x14af94[_0x0aaa('0x3e')]['id']},'attributes':['id',_0x0aaa('0x53'),_0x0aaa('0x54'),_0x0aaa('0x55'),_0x0aaa('0x56'),'password',_0x0aaa('0x57')]})['then'](handleEntityNotFound(_0x3511df,null))['then'](function(_0x3ca954){if(_0x3ca954){_0x179dbd=_0x3ca954[_0x0aaa('0x53')];var _0x79021=_0x179dbd[_0x0aaa('0x58')](-0x1);if(_0x79021==='/'){_0x179dbd=_0x179dbd[_0x0aaa('0x59')](0x0,_0x179dbd[_0x0aaa('0x5a')](_0x79021));}_0x546e94=new jsforce[(_0x0aaa('0x5b'))]({'oauth2':{'loginUrl':_0x179dbd,'clientId':_0x3ca954[_0x0aaa('0x54')],'clientSecret':_0x3ca954[_0x0aaa('0x55')]}});return _0x546e94['login'](_0x3ca954['username'],_0x3ca954[_0x0aaa('0x5c')][_0x0aaa('0x5d')](_0x3ca954[_0x0aaa('0x57')]));}})[_0x0aaa('0x24')](function(_0xee6c3a){if(_0xee6c3a){if(!_[_0x0aaa('0x5e')](_0x14af94[_0x0aaa('0x2d')]['ticketType'])){_0x2c5c13=_0x14af94[_0x0aaa('0x2d')][_0x0aaa('0x5f')];}return _0x546e94['sobject'](_0x2c5c13)[_0x0aaa('0x60')]();}})[_0x0aaa('0x24')](function(_0x131db3){var _0x362083=[_0x0aaa('0x61'),_0x0aaa('0x62'),'IsReminderSet',_0x0aaa('0x63'),_0x0aaa('0x64'),'Description'];var _0x367a3b=[_0x0aaa('0x65'),_0x0aaa('0x66'),_0x0aaa('0x67'),'boolean',_0x0aaa('0x68'),'textarea',_0x0aaa('0x69')];if(_0x131db3){_[_0x0aaa('0x6a')](_0x131db3[_0x0aaa('0x32')],function(_0x5ab346){return _0x362083[_0x0aaa('0x6b')](_0x5ab346[_0x0aaa('0x27')])||!_0x367a3b['includes'](_0x5ab346['type']);});return{'count':_0x131db3[_0x0aaa('0x32')][_0x0aaa('0x33')],'rows':_[_0x0aaa('0x29')](_0x131db3[_0x0aaa('0x32')],function(_0xd1f4a9){return{'id':_0xd1f4a9['name'],'name':_0xd1f4a9[_0x0aaa('0x6c')],'custom':_0xd1f4a9[_0x0aaa('0x6d')],'options':_0xd1f4a9[_0x0aaa('0x6e')]['length']>0x0?_[_0x0aaa('0x29')](_0xd1f4a9[_0x0aaa('0x6e')],function(_0x521300){return{'name':_0x521300[_0x0aaa('0x6c')],'value':_0x521300[_0x0aaa('0x6f')]};}):_0xd1f4a9['type']=='boolean'?[{'name':_0x0aaa('0x70'),'value':_0x0aaa('0x71')},{'name':_0x0aaa('0x72'),'value':_0x0aaa('0x73')}]:[]};})};}})[_0x0aaa('0x24')](respondWithResult(_0x3511df,null))[_0x0aaa('0x41')](function(_0x5e86de){var _0x49dfca=_0x14af94[_0x0aaa('0x2d')]['test']?0x1f4:_0x5e86de[_0x0aaa('0x74')]||0x1f4;logger[_0x0aaa('0x75')](_0x0aaa('0x76'),_0x0aaa('0x51'),_0x49dfca,JSON['stringify'](_0x5e86de));delete _0x5e86de[_0x0aaa('0x27')];if(_0x49dfca===0x191){_0x49dfca=0x190;}_0x3511df[_0x0aaa('0x1a')](_0x49dfca)['send'](_0x14af94[_0x0aaa('0x2d')][_0x0aaa('0x77')]?{'message':_0x0aaa('0x78'),'statusCode':_0x5e86de[_0x0aaa('0x74')]}:_0x5e86de);});}; \ No newline at end of file +var _0xd4f1=['rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','Task','remoteUri','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','clientId','username','password','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','phone','remove','includes','label','custom','value','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','test','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','SalesforceAccount'];(function(_0x3948ec,_0x3dfb10){var _0x2ad8f4=function(_0x4282fb){while(--_0x4282fb){_0x3948ec['push'](_0x3948ec['shift']());}};_0x2ad8f4(++_0x3dfb10);}(_0xd4f1,0xcb));var _0x1d4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd4f1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d4f('0x0'));var jsonpatch=require(_0x1d4f('0x1'));var rp=require(_0x1d4f('0x2'));var moment=require(_0x1d4f('0x3'));var BPromise=require(_0x1d4f('0x4'));var Mustache=require('mustache');var util=require(_0x1d4f('0x5'));var path=require('path');var sox=require(_0x1d4f('0x6'));var csv=require(_0x1d4f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d4f('0x8'));var _=require(_0x1d4f('0x9'));var squel=require(_0x1d4f('0xa'));var crypto=require(_0x1d4f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d4f('0x7'));var querystring=require(_0x1d4f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d4f('0xd'));var logger=require(_0x1d4f('0xe'))(_0x1d4f('0xf'));var utils=require(_0x1d4f('0x10'));var config=require(_0x1d4f('0x11'));var licenseUtil=require(_0x1d4f('0x12'));var db=require(_0x1d4f('0x13'))['db'];var integrations=require(_0x1d4f('0x14'));function respondWithStatusCode(_0x2ec57b,_0x473228){_0x473228=_0x473228||0xcc;return function(_0x42e1f9){if(_0x42e1f9){return _0x2ec57b[_0x1d4f('0x15')](_0x473228);}return _0x2ec57b['status'](_0x473228)[_0x1d4f('0x16')]();};}function respondWithResult(_0x18674b,_0x25d713){_0x25d713=_0x25d713||0xc8;return function(_0x5ce670){if(_0x5ce670){return _0x18674b[_0x1d4f('0x17')](_0x25d713)[_0x1d4f('0x18')](_0x5ce670);}};}function respondWithFilteredResult(_0x2cc656,_0x272bf5){return function(_0x3684e3){if(_0x3684e3){var _0x20533d=typeof _0x272bf5[_0x1d4f('0x19')]===_0x1d4f('0x1a')&&typeof _0x272bf5[_0x1d4f('0x1b')]==='undefined';var _0x59773b=_0x3684e3['count'];var _0x16eb11=_0x20533d?0x0:_0x272bf5[_0x1d4f('0x19')];var _0x191077=_0x20533d?_0x3684e3[_0x1d4f('0x1c')]:_0x272bf5['offset']+_0x272bf5[_0x1d4f('0x1b')];var _0x1caa42;if(_0x191077>=_0x59773b){_0x191077=_0x59773b;_0x1caa42=0xc8;}else{_0x1caa42=0xce;}_0x2cc656[_0x1d4f('0x17')](_0x1caa42);return _0x2cc656[_0x1d4f('0x1d')](_0x1d4f('0x1e'),_0x16eb11+'-'+_0x191077+'/'+_0x59773b)[_0x1d4f('0x18')](_0x3684e3);}return null;};}function patchUpdates(_0x171d4e){return function(_0x3c0900){try{jsonpatch['apply'](_0x3c0900,_0x171d4e,!![]);}catch(_0x2ba709){return BPromise[_0x1d4f('0x1f')](_0x2ba709);}return _0x3c0900[_0x1d4f('0x20')]();};}function saveUpdates(_0x513a06,_0x7387d7){return function(_0x1ca0d4){if(_0x1ca0d4){return _0x1ca0d4[_0x1d4f('0x21')](_0x513a06)[_0x1d4f('0x22')](function(_0x3aa0ca){return _0x3aa0ca;});}return null;};}function removeEntity(_0x1093ae,_0x25ac7e){return function(_0x5066c5){if(_0x5066c5){return _0x5066c5[_0x1d4f('0x23')]()['then'](function(){_0x1093ae[_0x1d4f('0x17')](0xcc)[_0x1d4f('0x16')]();});}};}function handleEntityNotFound(_0x45d9e6,_0x3ccd23){return function(_0x41459b){if(!_0x41459b){_0x45d9e6['sendStatus'](0x194);}return _0x41459b;};}function handleError(_0x7a9c51,_0x324366){_0x324366=_0x324366||0x1f4;return function(_0x2ffc29){logger[_0x1d4f('0x24')](_0x2ffc29[_0x1d4f('0x25')]);if(_0x2ffc29['name']){delete _0x2ffc29[_0x1d4f('0x26')];}_0x7a9c51[_0x1d4f('0x17')](_0x324366)['send'](_0x2ffc29);};}exports['index']=function(_0xe55534,_0x391ac5){var _0x562e64={},_0x1ddbc4={},_0x5808c7={'count':0x0,'rows':[]};var _0x37d460=_[_0x1d4f('0x27')](db[_0x1d4f('0x28')][_0x1d4f('0x29')],function(_0x3b96e0){return{'name':_0x3b96e0[_0x1d4f('0x2a')],'type':_0x3b96e0['type'][_0x1d4f('0x2b')]};});_0x1ddbc4[_0x1d4f('0x2c')]=_[_0x1d4f('0x27')](_0x37d460,_0x1d4f('0x26'));_0x1ddbc4['query']=_[_0x1d4f('0x2d')](_0xe55534[_0x1d4f('0x2e')]);_0x1ddbc4[_0x1d4f('0x2f')]=_['intersection'](_0x1ddbc4[_0x1d4f('0x2c')],_0x1ddbc4[_0x1d4f('0x2e')]);_0x562e64[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x1ddbc4['model'],qs[_0x1d4f('0x32')](_0xe55534[_0x1d4f('0x2e')]['fields']));_0x562e64[_0x1d4f('0x30')]=_0x562e64[_0x1d4f('0x30')][_0x1d4f('0x33')]?_0x562e64['attributes']:_0x1ddbc4[_0x1d4f('0x2c')];if(!_0xe55534['query'][_0x1d4f('0x34')](_0x1d4f('0x35'))){_0x562e64['limit']=qs[_0x1d4f('0x1b')](_0xe55534[_0x1d4f('0x2e')]['limit']);_0x562e64[_0x1d4f('0x19')]=qs[_0x1d4f('0x19')](_0xe55534['query']['offset']);}_0x562e64[_0x1d4f('0x36')]=qs[_0x1d4f('0x37')](_0xe55534[_0x1d4f('0x2e')]['sort']);_0x562e64['where']=qs[_0x1d4f('0x2f')](_[_0x1d4f('0x38')](_0xe55534['query'],_0x1ddbc4[_0x1d4f('0x2f')]),_0x37d460);if(_0xe55534[_0x1d4f('0x2e')]['filter']){_0x562e64[_0x1d4f('0x39')]=_[_0x1d4f('0x3a')](_0x562e64[_0x1d4f('0x39')],{'$or':_[_0x1d4f('0x27')](_0x37d460,function(_0x3741c4){if(_0x3741c4[_0x1d4f('0x3b')]!==_0x1d4f('0x3c')){var _0x251ba4={};_0x251ba4[_0x3741c4['name']]={'$like':'%'+_0xe55534[_0x1d4f('0x2e')][_0x1d4f('0x3d')]+'%'};return _0x251ba4;}})});}_0x562e64=_[_0x1d4f('0x3a')]({},_0x562e64,_0xe55534[_0x1d4f('0x3e')]);var _0x163c8a={'where':_0x562e64[_0x1d4f('0x39')]};return db['SalesforceAccount'][_0x1d4f('0x1c')](_0x163c8a)['then'](function(_0x57e3ca){_0x5808c7['count']=_0x57e3ca;if(_0xe55534[_0x1d4f('0x2e')]['includeAll']){_0x562e64[_0x1d4f('0x3f')]=[{'all':!![]}];}return db[_0x1d4f('0x28')][_0x1d4f('0x40')](_0x562e64);})['then'](function(_0x166c5b){_0x5808c7[_0x1d4f('0x41')]=_0x166c5b;return _0x5808c7;})[_0x1d4f('0x22')](respondWithFilteredResult(_0x391ac5,_0x562e64))['catch'](handleError(_0x391ac5,null));};exports[_0x1d4f('0x42')]=function(_0x29ce3a,_0x31cd82){var _0x8c9c11={'raw':![],'where':{'id':_0x29ce3a[_0x1d4f('0x43')]['id']}},_0x11f1a6={};_0x11f1a6[_0x1d4f('0x2c')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x11f1a6[_0x1d4f('0x2e')]=_[_0x1d4f('0x2d')](_0x29ce3a[_0x1d4f('0x2e')]);_0x11f1a6['filters']=_[_0x1d4f('0x31')](_0x11f1a6[_0x1d4f('0x2c')],_0x11f1a6[_0x1d4f('0x2e')]);_0x8c9c11[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x11f1a6[_0x1d4f('0x2c')],qs['fields'](_0x29ce3a[_0x1d4f('0x2e')][_0x1d4f('0x32')]));_0x8c9c11[_0x1d4f('0x30')]=_0x8c9c11['attributes'][_0x1d4f('0x33')]?_0x8c9c11[_0x1d4f('0x30')]:_0x11f1a6[_0x1d4f('0x2c')];if(_0x29ce3a[_0x1d4f('0x2e')][_0x1d4f('0x44')]){_0x8c9c11[_0x1d4f('0x3f')]=[{'all':!![]}];}_0x8c9c11=_['merge']({},_0x8c9c11,_0x29ce3a[_0x1d4f('0x3e')]);return db[_0x1d4f('0x28')]['find'](_0x8c9c11)[_0x1d4f('0x22')](handleEntityNotFound(_0x31cd82,null))['then'](respondWithResult(_0x31cd82,null))[_0x1d4f('0x45')](handleError(_0x31cd82,null));};exports[_0x1d4f('0x46')]=function(_0x5b5b65,_0x4f9781){return db['SalesforceAccount'][_0x1d4f('0x46')](_0x5b5b65['body'],{})[_0x1d4f('0x22')](respondWithResult(_0x4f9781,0xc9))[_0x1d4f('0x45')](handleError(_0x4f9781,null));};exports['update']=function(_0x387d9c,_0x3426e8){if(_0x387d9c[_0x1d4f('0x47')]['id']){delete _0x387d9c[_0x1d4f('0x47')]['id'];}return db[_0x1d4f('0x28')][_0x1d4f('0x48')]({'where':{'id':_0x387d9c[_0x1d4f('0x43')]['id']}})[_0x1d4f('0x22')](handleEntityNotFound(_0x3426e8,null))[_0x1d4f('0x22')](saveUpdates(_0x387d9c['body'],null))[_0x1d4f('0x22')](respondWithResult(_0x3426e8,null))[_0x1d4f('0x45')](handleError(_0x3426e8,null));};exports[_0x1d4f('0x23')]=function(_0xc659bf,_0x22a0f1){return db[_0x1d4f('0x28')]['find']({'where':{'id':_0xc659bf[_0x1d4f('0x43')]['id']}})[_0x1d4f('0x22')](handleEntityNotFound(_0x22a0f1,null))[_0x1d4f('0x22')](removeEntity(_0x22a0f1,null))[_0x1d4f('0x45')](handleError(_0x22a0f1,null));};exports[_0x1d4f('0x49')]=function(_0x279e4c,_0x2d98f7,_0xf17ff4){var _0x44c2a3={};var _0x50861b={};var _0x54f42a;var _0x1cdf1d;return db['SalesforceAccount']['findOne']({'where':{'id':_0x279e4c[_0x1d4f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d98f7,null))[_0x1d4f('0x22')](function(_0xa53fdd){if(_0xa53fdd){_0x54f42a=_0xa53fdd;_0x50861b[_0x1d4f('0x2c')]=_['keys'](db[_0x1d4f('0x4a')][_0x1d4f('0x29')]);_0x50861b['query']=_[_0x1d4f('0x2d')](_0x279e4c[_0x1d4f('0x2e')]);_0x50861b[_0x1d4f('0x2f')]=_['intersection'](_0x50861b[_0x1d4f('0x2c')],_0x50861b[_0x1d4f('0x2e')]);_0x44c2a3[_0x1d4f('0x30')]=_[_0x1d4f('0x31')](_0x50861b[_0x1d4f('0x2c')],qs['fields'](_0x279e4c['query'][_0x1d4f('0x32')]));_0x44c2a3[_0x1d4f('0x30')]=_0x44c2a3[_0x1d4f('0x30')][_0x1d4f('0x33')]?_0x44c2a3[_0x1d4f('0x30')]:_0x50861b['model'];_0x44c2a3['order']=qs[_0x1d4f('0x37')](_0x279e4c[_0x1d4f('0x2e')][_0x1d4f('0x37')]);_0x44c2a3[_0x1d4f('0x39')]=qs['filters'](_[_0x1d4f('0x38')](_0x279e4c['query'],_0x50861b[_0x1d4f('0x2f')]));if(_0x279e4c[_0x1d4f('0x2e')]['filter']){_0x44c2a3['where']=_[_0x1d4f('0x3a')](_0x44c2a3[_0x1d4f('0x39')],{'$or':_['map'](_0x44c2a3[_0x1d4f('0x30')],function(_0x54d03a){var _0x3c4be6={};_0x3c4be6[_0x54d03a]={'$like':'%'+_0x279e4c[_0x1d4f('0x2e')]['filter']+'%'};return _0x3c4be6;})});}_0x44c2a3=_[_0x1d4f('0x3a')]({},_0x44c2a3,_0x279e4c[_0x1d4f('0x3e')]);return _0x54f42a['getConfigurations'](_0x44c2a3);}})[_0x1d4f('0x22')](function(_0x597a6a){if(_0x597a6a){_0x1cdf1d=_0x597a6a['length'];if(!_0x279e4c[_0x1d4f('0x2e')]['hasOwnProperty'](_0x1d4f('0x35'))){_0x44c2a3[_0x1d4f('0x1b')]=qs['limit'](_0x279e4c[_0x1d4f('0x2e')][_0x1d4f('0x1b')]);_0x44c2a3[_0x1d4f('0x19')]=qs[_0x1d4f('0x19')](_0x279e4c[_0x1d4f('0x2e')][_0x1d4f('0x19')]);}return _0x54f42a[_0x1d4f('0x49')](_0x44c2a3);}})[_0x1d4f('0x22')](function(_0x57df68){if(_0x57df68){return _0x57df68?{'count':_0x1cdf1d,'rows':_0x57df68}:null;}})['then'](respondWithResult(_0x2d98f7,null))[_0x1d4f('0x45')](handleError(_0x2d98f7,null));};exports[_0x1d4f('0x4b')]=function(_0x484142,_0x5c0688,_0x3438e3){if(_0x484142[_0x1d4f('0x47')]['id']){delete _0x484142[_0x1d4f('0x47')]['id'];}return db[_0x1d4f('0x28')][_0x1d4f('0x4c')]({'where':{'id':_0x484142[_0x1d4f('0x43')]['id']}})[_0x1d4f('0x22')](handleEntityNotFound(_0x5c0688,null))[_0x1d4f('0x22')](function(_0x3fa376){if(_0x3fa376){_0x484142[_0x1d4f('0x47')][_0x1d4f('0x4d')]=_0x3fa376['id'];_0x484142[_0x1d4f('0x47')]['Subjects']=integrations[_0x1d4f('0x4e')](_0x484142[_0x1d4f('0x47')][_0x1d4f('0x4f')],_0x484142[_0x1d4f('0x47')][_0x1d4f('0x3b')]);_0x484142[_0x1d4f('0x47')][_0x1d4f('0x50')]=integrations[_0x1d4f('0x51')](_0x484142[_0x1d4f('0x47')]['channel'],_0x484142[_0x1d4f('0x47')]['type']);return db[_0x1d4f('0x4a')][_0x1d4f('0x46')](_0x484142[_0x1d4f('0x47')],{'include':[{'model':db[_0x1d4f('0x52')],'as':_0x1d4f('0x53')},{'model':db[_0x1d4f('0x52')],'as':_0x1d4f('0x50')}]});}return null;})[_0x1d4f('0x22')](respondWithResult(_0x5c0688,null))['catch'](handleError(_0x5c0688,null));};exports['getFields']=function(_0x38e8fd,_0x59da95,_0x433b9f){var _0xe1dc1c;var _0x551cfa='';var _0x476b03=_0x1d4f('0x54');return db['SalesforceAccount']['findOne']({'where':{'id':_0x38e8fd[_0x1d4f('0x43')]['id']},'attributes':['id',_0x1d4f('0x55'),'clientId',_0x1d4f('0x56'),'username','password',_0x1d4f('0x57')]})['then'](handleEntityNotFound(_0x59da95,null))[_0x1d4f('0x22')](function(_0x5a8bbb){if(_0x5a8bbb){_0x551cfa=_0x5a8bbb[_0x1d4f('0x55')];var _0x1b1e7f=_0x551cfa[_0x1d4f('0x58')](-0x1);if(_0x1b1e7f==='/'){_0x551cfa=_0x551cfa[_0x1d4f('0x59')](0x0,_0x551cfa[_0x1d4f('0x5a')](_0x1b1e7f));}_0xe1dc1c=new jsforce[(_0x1d4f('0x5b'))]({'oauth2':{'loginUrl':_0x551cfa,'clientId':_0x5a8bbb[_0x1d4f('0x5c')],'clientSecret':_0x5a8bbb['clientSecret']}});return _0xe1dc1c['login'](_0x5a8bbb[_0x1d4f('0x5d')],_0x5a8bbb[_0x1d4f('0x5e')]['concat'](_0x5a8bbb[_0x1d4f('0x57')]));}})[_0x1d4f('0x22')](function(_0x468f78){if(_0x468f78){if(!_['isNil'](_0x38e8fd[_0x1d4f('0x2e')][_0x1d4f('0x5f')])){_0x476b03=_0x38e8fd[_0x1d4f('0x2e')][_0x1d4f('0x5f')];}return _0xe1dc1c[_0x1d4f('0x60')](_0x476b03)[_0x1d4f('0x61')]();}})['then'](function(_0x32ace0){var _0x1642d7=[_0x1d4f('0x62'),_0x1d4f('0x63'),_0x1d4f('0x64'),_0x1d4f('0x65'),_0x1d4f('0x66'),_0x1d4f('0x67')];var _0x107add=[_0x1d4f('0x68'),_0x1d4f('0x69'),_0x1d4f('0x6a'),'boolean','email','textarea',_0x1d4f('0x6b')];if(_0x32ace0){_[_0x1d4f('0x6c')](_0x32ace0[_0x1d4f('0x32')],function(_0x285d9a){return _0x1642d7[_0x1d4f('0x6d')](_0x285d9a[_0x1d4f('0x26')])||!_0x107add['includes'](_0x285d9a[_0x1d4f('0x3b')]);});return{'count':_0x32ace0['fields'][_0x1d4f('0x33')],'rows':_[_0x1d4f('0x27')](_0x32ace0[_0x1d4f('0x32')],function(_0x59ed8e){return{'id':_0x59ed8e[_0x1d4f('0x26')],'name':_0x59ed8e[_0x1d4f('0x6e')],'custom':_0x59ed8e[_0x1d4f('0x6f')],'options':_0x59ed8e['picklistValues'][_0x1d4f('0x33')]>0x0?_['map'](_0x59ed8e['picklistValues'],function(_0x27cd14){return{'name':_0x27cd14[_0x1d4f('0x6e')],'value':_0x27cd14[_0x1d4f('0x70')]};}):_0x59ed8e[_0x1d4f('0x3b')]==_0x1d4f('0x71')?[{'name':'True','value':_0x1d4f('0x72')},{'name':_0x1d4f('0x73'),'value':_0x1d4f('0x74')}]:[]};})};}})[_0x1d4f('0x22')](respondWithResult(_0x59da95,null))['catch'](function(_0x1364dc){var _0x4cee71=_0x38e8fd[_0x1d4f('0x2e')]['test']?0x1f4:_0x1364dc[_0x1d4f('0x75')]||0x1f4;logger[_0x1d4f('0x24')](_0x1d4f('0x76'),_0x1d4f('0x77'),_0x4cee71,JSON['stringify'](_0x1364dc));delete _0x1364dc[_0x1d4f('0x26')];if(_0x4cee71===0x191){_0x4cee71=0x190;}_0x59da95[_0x1d4f('0x17')](_0x4cee71)[_0x1d4f('0x78')](_0x38e8fd[_0x1d4f('0x2e')][_0x1d4f('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x1364dc[_0x1d4f('0x75')]}:_0x1364dc);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 3f8d7b0..6c4da7a 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 _0xba76=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xdefd11,_0x54f0b5){var _0x354389=function(_0x295f2f){while(--_0x295f2f){_0xdefd11['push'](_0xdefd11['shift']());}};_0x354389(++_0x54f0b5);}(_0xba76,0x17e));var _0x6ba7=function(_0x1cc372,_0x205ee3){_0x1cc372=_0x1cc372-0x0;var _0x48081d=_0xba76[_0x1cc372];return _0x48081d;};'use strict';var _=require(_0x6ba7('0x0'));var util=require(_0x6ba7('0x1'));var logger=require(_0x6ba7('0x2'))(_0x6ba7('0x3'));var moment=require(_0x6ba7('0x4'));var BPromise=require(_0x6ba7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ba7('0x6'));var rimraf=require(_0x6ba7('0x7'));var config=require(_0x6ba7('0x8'));var attributes=require(_0x6ba7('0x9'));var integrations=require(_0x6ba7('0xa'));module[_0x6ba7('0xb')]=function(_0x3aa8c9,_0x3ab302){return _0x3aa8c9[_0x6ba7('0xc')](_0x6ba7('0xd'),attributes,{'tableName':_0x6ba7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d88=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2d88,0x110));var _0x82d8=function(_0x59a68b,_0x316362){_0x59a68b=_0x59a68b-0x0;var _0x165097=_0x2d88[_0x59a68b];return _0x165097;};'use strict';var _=require(_0x82d8('0x0'));var util=require(_0x82d8('0x1'));var logger=require(_0x82d8('0x2'))(_0x82d8('0x3'));var moment=require(_0x82d8('0x4'));var BPromise=require(_0x82d8('0x5'));var rp=require(_0x82d8('0x6'));var fs=require('fs');var path=require(_0x82d8('0x7'));var rimraf=require(_0x82d8('0x8'));var config=require('../../config/environment');var attributes=require(_0x82d8('0x9'));var integrations=require(_0x82d8('0xa'));module['exports']=function(_0x2c89a2,_0x25a091){return _0x2c89a2[_0x82d8('0xb')](_0x82d8('0xc'),attributes,{'tableName':_0x82d8('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 0bf6e58..663bfc3 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 _0x4377=['GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowSalesforceAccount','SalesforceAccount','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x4377,0xf5));var _0x7437=function(_0x244453,_0x3b736b){_0x244453=_0x244453-0x0;var _0xbb315f=_0x4377[_0x244453];return _0xbb315f;};'use strict';var _=require(_0x7437('0x0'));var util=require('util');var moment=require(_0x7437('0x1'));var BPromise=require(_0x7437('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7437('0x3'))['db'];var utils=require(_0x7437('0x4'));var logger=require(_0x7437('0x5'))(_0x7437('0x6'));var config=require('../../config/environment');var jayson=require(_0x7437('0x7'));var client=jayson['client'][_0x7437('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b3277,_0x208398,_0x46789){return new BPromise(function(_0x1714a4,_0x911f7a){return client['request'](_0x1b3277,_0x46789)[_0x7437('0x9')](function(_0x3cf8bd){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x208398,_0x7437('0xa'));logger['debug'](_0x7437('0xb'),_0x208398,_0x7437('0xa'),JSON['stringify'](_0x3cf8bd));if(_0x3cf8bd[_0x7437('0xc')]){if(_0x3cf8bd[_0x7437('0xc')][_0x7437('0xd')]===0x1f4){logger['error'](_0x7437('0xe'),_0x208398,_0x3cf8bd[_0x7437('0xc')][_0x7437('0xf')]);return _0x911f7a(_0x3cf8bd['error'][_0x7437('0xf')]);}logger[_0x7437('0xc')](_0x7437('0xe'),_0x208398,_0x3cf8bd[_0x7437('0xc')][_0x7437('0xf')]);return _0x1714a4(_0x3cf8bd['error'][_0x7437('0xf')]);}else{logger[_0x7437('0x10')](_0x7437('0xe'),_0x208398,_0x7437('0xa'));_0x1714a4(_0x3cf8bd[_0x7437('0x11')]['message']);}})[_0x7437('0x12')](function(_0x4ad9a2){logger[_0x7437('0xc')](_0x7437('0xe'),_0x208398,_0x4ad9a2);_0x911f7a(_0x4ad9a2);});});}exports[_0x7437('0x13')]=function(_0x1d0621){var _0x479feb=this;return new Promise(function(_0x35900c,_0x1a0cc4){return db['SalesforceAccount'][_0x7437('0x14')]({'raw':_0x1d0621[_0x7437('0x15')]?_0x1d0621[_0x7437('0x15')][_0x7437('0x16')]===undefined?!![]:![]:!![],'where':_0x1d0621['options']?_0x1d0621[_0x7437('0x15')][_0x7437('0x17')]||null:null,'attributes':_0x1d0621[_0x7437('0x15')]?_0x1d0621['options'][_0x7437('0x18')]||null:null,'limit':_0x1d0621[_0x7437('0x15')]?_0x1d0621['options'][_0x7437('0x19')]||null:null,'include':_0x1d0621[_0x7437('0x15')]?_0x1d0621[_0x7437('0x15')]['include']?_['map'](_0x1d0621[_0x7437('0x15')][_0x7437('0x1a')],function(_0x402f66){return{'model':db[_0x402f66[_0x7437('0x1b')]],'as':_0x402f66['as'],'attributes':_0x402f66[_0x7437('0x18')],'include':_0x402f66[_0x7437('0x1a')]?_[_0x7437('0x1c')](_0x402f66[_0x7437('0x1a')],function(_0x4cc825){return{'model':db[_0x4cc825[_0x7437('0x1b')]],'as':_0x4cc825['as'],'attributes':_0x4cc825[_0x7437('0x18')],'include':_0x4cc825[_0x7437('0x1a')]?_[_0x7437('0x1c')](_0x4cc825[_0x7437('0x1a')],function(_0x140d39){return{'model':db[_0x140d39[_0x7437('0x1b')]],'as':_0x140d39['as'],'attributes':_0x140d39['attributes']};}):[]};}):[]};}):[]:[]})[_0x7437('0x9')](function(_0xe70ba7){logger['info'](_0x7437('0x13'),_0x1d0621);logger['debug']('GetSalesforceAccount',_0x1d0621,JSON[_0x7437('0x1d')](_0xe70ba7));_0x35900c(_0xe70ba7);})[_0x7437('0x12')](function(_0x574b7e){logger[_0x7437('0xc')](_0x7437('0x13'),_0x574b7e['message'],_0x1d0621);_0x1a0cc4(_0x479feb[_0x7437('0xc')](0x1f4,_0x574b7e[_0x7437('0xf')]));});});};exports[_0x7437('0x1e')]=function(_0x2c04ed){var _0x2feeb3=this;return new Promise(function(_0x2071d5,_0x4cb3d1){return db[_0x7437('0x1f')]['find']({'raw':_0x2c04ed[_0x7437('0x15')]?_0x2c04ed[_0x7437('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2c04ed[_0x7437('0x15')]?_0x2c04ed[_0x7437('0x15')][_0x7437('0x17')]||null:null,'attributes':_0x2c04ed['options']?_0x2c04ed['options'][_0x7437('0x18')]||null:null,'include':_0x2c04ed[_0x7437('0x15')]?_0x2c04ed[_0x7437('0x15')][_0x7437('0x1a')]?_[_0x7437('0x1c')](_0x2c04ed[_0x7437('0x15')]['include'],function(_0x25d12f){return{'model':db[_0x25d12f[_0x7437('0x1b')]],'as':_0x25d12f['as'],'attributes':_0x25d12f[_0x7437('0x18')],'include':_0x25d12f[_0x7437('0x1a')]?_['map'](_0x25d12f[_0x7437('0x1a')],function(_0xc7b2bd){return{'model':db[_0xc7b2bd['model']],'as':_0xc7b2bd['as'],'attributes':_0xc7b2bd[_0x7437('0x18')],'include':_0xc7b2bd[_0x7437('0x1a')]?_['map'](_0xc7b2bd['include'],function(_0x1c5298){return{'model':db[_0x1c5298[_0x7437('0x1b')]],'as':_0x1c5298['as'],'attributes':_0x1c5298['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3db0c3){logger[_0x7437('0x10')]('ShowSalesforceAccount',_0x2c04ed);logger[_0x7437('0x20')](_0x7437('0x1e'),_0x2c04ed,JSON[_0x7437('0x1d')](_0x3db0c3));_0x2071d5(_0x3db0c3);})[_0x7437('0x12')](function(_0x55fdfa){logger['error'](_0x7437('0x1e'),_0x55fdfa[_0x7437('0xf')],_0x2c04ed);_0x4cb3d1(_0x2feeb3[_0x7437('0xc')](0x1f4,_0x55fdfa[_0x7437('0xf')]));});});}; \ No newline at end of file +var _0xccc1=['result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x248fd7,_0x2a33e5){var _0x42d417=function(_0x182287){while(--_0x182287){_0x248fd7['push'](_0x248fd7['shift']());}};_0x42d417(++_0x2a33e5);}(_0xccc1,0x73));var _0x1ccc=function(_0x449158,_0x44e1b0){_0x449158=_0x449158-0x0;var _0x1f3c3a=_0xccc1[_0x449158];return _0x1f3c3a;};'use strict';var _=require(_0x1ccc('0x0'));var util=require(_0x1ccc('0x1'));var moment=require(_0x1ccc('0x2'));var BPromise=require(_0x1ccc('0x3'));var rs=require(_0x1ccc('0x4'));var fs=require('fs');var Redis=require(_0x1ccc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ccc('0x6'));var logger=require(_0x1ccc('0x7'))(_0x1ccc('0x8'));var config=require('../../config/environment');var jayson=require(_0x1ccc('0x9'));var client=jayson[_0x1ccc('0xa')][_0x1ccc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31ce2f,_0x30af5d,_0x1312a2){return new BPromise(function(_0x3fe328,_0x23ba3f){return client[_0x1ccc('0xc')](_0x31ce2f,_0x1312a2)[_0x1ccc('0xd')](function(_0x5f58ce){logger[_0x1ccc('0xe')](_0x1ccc('0xf'),_0x30af5d,_0x1ccc('0x10'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x30af5d,'request\x20sent',JSON[_0x1ccc('0x11')](_0x5f58ce));if(_0x5f58ce[_0x1ccc('0x12')]){if(_0x5f58ce[_0x1ccc('0x12')][_0x1ccc('0x13')]===0x1f4){logger[_0x1ccc('0x12')](_0x1ccc('0xf'),_0x30af5d,_0x5f58ce[_0x1ccc('0x12')]['message']);return _0x23ba3f(_0x5f58ce[_0x1ccc('0x12')][_0x1ccc('0x14')]);}logger[_0x1ccc('0x12')](_0x1ccc('0xf'),_0x30af5d,_0x5f58ce[_0x1ccc('0x12')]['message']);return _0x3fe328(_0x5f58ce['error'][_0x1ccc('0x14')]);}else{logger[_0x1ccc('0xe')](_0x1ccc('0xf'),_0x30af5d,'request\x20sent');_0x3fe328(_0x5f58ce[_0x1ccc('0x15')][_0x1ccc('0x14')]);}})[_0x1ccc('0x16')](function(_0x5d0d9c){logger[_0x1ccc('0x12')](_0x1ccc('0xf'),_0x30af5d,_0x5d0d9c);_0x23ba3f(_0x5d0d9c);});});}exports[_0x1ccc('0x17')]=function(_0x3d14c8){var _0x16833e=this;return new Promise(function(_0x7f4201,_0x5ac66a){return db[_0x1ccc('0x18')][_0x1ccc('0x19')]({'raw':_0x3d14c8[_0x1ccc('0x1a')]?_0x3d14c8['options'][_0x1ccc('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d14c8[_0x1ccc('0x1a')]?_0x3d14c8[_0x1ccc('0x1a')]['where']||null:null,'attributes':_0x3d14c8[_0x1ccc('0x1a')]?_0x3d14c8[_0x1ccc('0x1a')][_0x1ccc('0x1c')]||null:null,'limit':_0x3d14c8[_0x1ccc('0x1a')]?_0x3d14c8[_0x1ccc('0x1a')][_0x1ccc('0x1d')]||null:null,'include':_0x3d14c8[_0x1ccc('0x1a')]?_0x3d14c8[_0x1ccc('0x1a')][_0x1ccc('0x1e')]?_['map'](_0x3d14c8['options'][_0x1ccc('0x1e')],function(_0x2a5b34){return{'model':db[_0x2a5b34[_0x1ccc('0x1f')]],'as':_0x2a5b34['as'],'attributes':_0x2a5b34[_0x1ccc('0x1c')],'include':_0x2a5b34[_0x1ccc('0x1e')]?_[_0x1ccc('0x20')](_0x2a5b34[_0x1ccc('0x1e')],function(_0x51103d){return{'model':db[_0x51103d['model']],'as':_0x51103d['as'],'attributes':_0x51103d[_0x1ccc('0x1c')],'include':_0x51103d[_0x1ccc('0x1e')]?_[_0x1ccc('0x20')](_0x51103d[_0x1ccc('0x1e')],function(_0x27659a){return{'model':db[_0x27659a[_0x1ccc('0x1f')]],'as':_0x27659a['as'],'attributes':_0x27659a[_0x1ccc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38369d){logger[_0x1ccc('0xe')](_0x1ccc('0x17'),_0x3d14c8);logger[_0x1ccc('0x21')](_0x1ccc('0x17'),_0x3d14c8,JSON['stringify'](_0x38369d));_0x7f4201(_0x38369d);})['catch'](function(_0x40eb07){logger['error'](_0x1ccc('0x17'),_0x40eb07['message'],_0x3d14c8);_0x5ac66a(_0x16833e[_0x1ccc('0x12')](0x1f4,_0x40eb07['message']));});});};exports['ShowSalesforceAccount']=function(_0x11469f){var _0x8a31bb=this;return new Promise(function(_0x4b4ddd,_0x3f22f2){return db[_0x1ccc('0x18')]['find']({'raw':_0x11469f['options']?_0x11469f[_0x1ccc('0x1a')][_0x1ccc('0x1b')]===undefined?!![]:![]:!![],'where':_0x11469f['options']?_0x11469f[_0x1ccc('0x1a')]['where']||null:null,'attributes':_0x11469f[_0x1ccc('0x1a')]?_0x11469f[_0x1ccc('0x1a')]['attributes']||null:null,'include':_0x11469f[_0x1ccc('0x1a')]?_0x11469f[_0x1ccc('0x1a')]['include']?_[_0x1ccc('0x20')](_0x11469f[_0x1ccc('0x1a')][_0x1ccc('0x1e')],function(_0x54750f){return{'model':db[_0x54750f[_0x1ccc('0x1f')]],'as':_0x54750f['as'],'attributes':_0x54750f[_0x1ccc('0x1c')],'include':_0x54750f[_0x1ccc('0x1e')]?_[_0x1ccc('0x20')](_0x54750f[_0x1ccc('0x1e')],function(_0x22e7d8){return{'model':db[_0x22e7d8[_0x1ccc('0x1f')]],'as':_0x22e7d8['as'],'attributes':_0x22e7d8[_0x1ccc('0x1c')],'include':_0x22e7d8['include']?_['map'](_0x22e7d8[_0x1ccc('0x1e')],function(_0x538f96){return{'model':db[_0x538f96[_0x1ccc('0x1f')]],'as':_0x538f96['as'],'attributes':_0x538f96[_0x1ccc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f0b55){logger[_0x1ccc('0xe')]('ShowSalesforceAccount',_0x11469f);logger[_0x1ccc('0x21')]('ShowSalesforceAccount',_0x11469f,JSON[_0x1ccc('0x11')](_0x1f0b55));_0x4b4ddd(_0x1f0b55);})[_0x1ccc('0x16')](function(_0x20c7b5){logger[_0x1ccc('0x12')]('ShowSalesforceAccount',_0x20c7b5[_0x1ccc('0x14')],_0x11469f);_0x3f22f2(_0x8a31bb[_0x1ccc('0x12')](0x1f4,_0x20c7b5[_0x1ccc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index b58b337..4908ab5 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x0b0e[_0x5e6ea3];return _0x4048b5;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _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(_0x1ecac6,_0x1d0b9f){var _0x5918d1=function(_0x5a9594){while(--_0x5a9594){_0x1ecac6['push'](_0x1ecac6['shift']());}};_0x5918d1(++_0x1d0b9f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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 27f8677..269cc32 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 _0xa6ea=['account_contact_lead','ENUM','lead','sequelize','STRING','Task','Case','contact_lead','contact'];(function(_0xc440aa,_0x3fc1af){var _0xf69ee9=function(_0x4db640){while(--_0x4db640){_0xc440aa['push'](_0xc440aa['shift']());}};_0xf69ee9(++_0x3fc1af);}(_0xa6ea,0x1ce));var _0xaa6e=function(_0x306698,_0x3920d0){_0x306698=_0x306698-0x0;var _0x113a2a=_0xa6ea[_0x306698];return _0x113a2a;};'use strict';var Sequelize=require(_0xaa6e('0x0'));module['exports']={'name':{'type':Sequelize[_0xaa6e('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xaa6e('0x2'),_0xaa6e('0x3')),'defaultValue':_0xaa6e('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xaa6e('0x4'),_0xaa6e('0x5'),'lead',_0xaa6e('0x6'),'account'),'defaultValue':_0xaa6e('0x4')},'moduleCreate':{'type':Sequelize[_0xaa6e('0x7')]('nothing',_0xaa6e('0x5'),_0xaa6e('0x8'),'account'),'defaultValue':_0xaa6e('0x8')},'leadId':{'type':Sequelize[_0xaa6e('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xaa6e('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x76fe=['Task','contact','account_contact_lead','account','contact_lead','nothing','lead','sequelize','STRING','ENUM'];(function(_0x30217f,_0x551950){var _0x5736c0=function(_0x48775e){while(--_0x48775e){_0x30217f['push'](_0x30217f['shift']());}};_0x5736c0(++_0x551950);}(_0x76fe,0x179));var _0xe76f=function(_0x5c6403,_0xb08818){_0x5c6403=_0x5c6403-0x0;var _0x523367=_0x76fe[_0x5c6403];return _0x523367;};'use strict';var Sequelize=require(_0xe76f('0x0'));module['exports']={'name':{'type':Sequelize[_0xe76f('0x1')]},'description':{'type':Sequelize[_0xe76f('0x1')]},'ticketType':{'type':Sequelize[_0xe76f('0x2')](_0xe76f('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xe76f('0x4'),'lead',_0xe76f('0x5'),_0xe76f('0x6')),'defaultValue':_0xe76f('0x7')},'moduleCreate':{'type':Sequelize[_0xe76f('0x2')](_0xe76f('0x8'),_0xe76f('0x4'),_0xe76f('0x9'),'account'),'defaultValue':_0xe76f('0x9')},'leadId':{'type':Sequelize[_0xe76f('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xe76f('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xe76f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 54e957c..80f4c65 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 _0x32ef=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','length','filter','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x441fa9,_0x4ee1f7){var _0x4ad04a=function(_0x4c6bd2){while(--_0x4c6bd2){_0x441fa9['push'](_0x441fa9['shift']());}};_0x4ad04a(++_0x4ee1f7);}(_0x32ef,0xf9));var _0xf32e=function(_0x508a6c,_0x2e41e8){_0x508a6c=_0x508a6c-0x0;var _0xa9214a=_0x32ef[_0x508a6c];return _0xa9214a;};'use strict';var emlformat=require(_0xf32e('0x0'));var rimraf=require(_0xf32e('0x1'));var zipdir=require(_0xf32e('0x2'));var jsonpatch=require(_0xf32e('0x3'));var rp=require(_0xf32e('0x4'));var moment=require(_0xf32e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf32e('0x6'));var util=require(_0xf32e('0x7'));var path=require('path');var sox=require(_0xf32e('0x8'));var csv=require(_0xf32e('0x9'));var ejs=require(_0xf32e('0xa'));var fs=require('fs');var fs_extra=require(_0xf32e('0xb'));var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0x9'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf32e('0x13'));var hardwareService=require(_0xf32e('0x14'));var logger=require(_0xf32e('0x15'))(_0xf32e('0x16'));var utils=require(_0xf32e('0x17'));var config=require(_0xf32e('0x18'));var licenseUtil=require(_0xf32e('0x19'));var db=require(_0xf32e('0x1a'))['db'];function respondWithStatusCode(_0x319616,_0x1c1f52){_0x1c1f52=_0x1c1f52||0xcc;return function(_0xf7dc32){if(_0xf7dc32){return _0x319616['sendStatus'](_0x1c1f52);}return _0x319616[_0xf32e('0x1b')](_0x1c1f52)[_0xf32e('0x1c')]();};}function respondWithResult(_0x543072,_0x336e26){_0x336e26=_0x336e26||0xc8;return function(_0x35988d){if(_0x35988d){return _0x543072[_0xf32e('0x1b')](_0x336e26)['json'](_0x35988d);}};}function respondWithFilteredResult(_0xe324ad,_0x299efa){return function(_0x1dd008){if(_0x1dd008){var _0x400d25=typeof _0x299efa[_0xf32e('0x1d')]===_0xf32e('0x1e')&&typeof _0x299efa[_0xf32e('0x1f')]===_0xf32e('0x1e');var _0x21aa73=_0x1dd008['count'];var _0x3510ec=_0x400d25?0x0:_0x299efa[_0xf32e('0x1d')];var _0xb828b8=_0x400d25?_0x1dd008[_0xf32e('0x20')]:_0x299efa[_0xf32e('0x1d')]+_0x299efa[_0xf32e('0x1f')];var _0x2f909b;if(_0xb828b8>=_0x21aa73){_0xb828b8=_0x21aa73;_0x2f909b=0xc8;}else{_0x2f909b=0xce;}_0xe324ad[_0xf32e('0x1b')](_0x2f909b);return _0xe324ad[_0xf32e('0x21')](_0xf32e('0x22'),_0x3510ec+'-'+_0xb828b8+'/'+_0x21aa73)[_0xf32e('0x23')](_0x1dd008);}return null;};}function patchUpdates(_0x1b169e){return function(_0x3202e1){try{jsonpatch[_0xf32e('0x24')](_0x3202e1,_0x1b169e,!![]);}catch(_0x5f2e99){return BPromise['reject'](_0x5f2e99);}return _0x3202e1[_0xf32e('0x25')]();};}function saveUpdates(_0x57a8cb,_0x27b92c){return function(_0x2aaabf){if(_0x2aaabf){return _0x2aaabf[_0xf32e('0x26')](_0x57a8cb)[_0xf32e('0x27')](function(_0x35e34c){return _0x35e34c;});}return null;};}function removeEntity(_0x5409b4,_0x227405){return function(_0x4407f8){if(_0x4407f8){return _0x4407f8[_0xf32e('0x28')]()[_0xf32e('0x27')](function(){_0x5409b4['status'](0xcc)[_0xf32e('0x1c')]();});}};}function handleEntityNotFound(_0x1eb413,_0x2e8c34){return function(_0xe0a285){if(!_0xe0a285){_0x1eb413[_0xf32e('0x29')](0x194);}return _0xe0a285;};}function handleError(_0x15103f,_0x2f925b){_0x2f925b=_0x2f925b||0x1f4;return function(_0x1eb42e){logger[_0xf32e('0x2a')](_0x1eb42e[_0xf32e('0x2b')]);if(_0x1eb42e['name']){delete _0x1eb42e[_0xf32e('0x2c')];}_0x15103f[_0xf32e('0x1b')](_0x2f925b)[_0xf32e('0x2d')](_0x1eb42e);};}exports['index']=function(_0x419d13,_0x5bc6f2){var _0x1586d9={},_0x5c8779={},_0x439143={'count':0x0,'rows':[]};var _0x39965e=_[_0xf32e('0x2e')](db[_0xf32e('0x2f')][_0xf32e('0x30')],function(_0x4e64d4){return{'name':_0x4e64d4[_0xf32e('0x31')],'type':_0x4e64d4[_0xf32e('0x32')][_0xf32e('0x33')]};});_0x5c8779['model']=_[_0xf32e('0x2e')](_0x39965e,_0xf32e('0x2c'));_0x5c8779[_0xf32e('0x34')]=_[_0xf32e('0x35')](_0x419d13[_0xf32e('0x34')]);_0x5c8779[_0xf32e('0x36')]=_[_0xf32e('0x37')](_0x5c8779[_0xf32e('0x38')],_0x5c8779[_0xf32e('0x34')]);_0x1586d9[_0xf32e('0x39')]=_[_0xf32e('0x37')](_0x5c8779[_0xf32e('0x38')],qs[_0xf32e('0x3a')](_0x419d13['query'][_0xf32e('0x3a')]));_0x1586d9['attributes']=_0x1586d9[_0xf32e('0x39')]['length']?_0x1586d9['attributes']:_0x5c8779[_0xf32e('0x38')];if(!_0x419d13[_0xf32e('0x34')][_0xf32e('0x3b')](_0xf32e('0x3c'))){_0x1586d9[_0xf32e('0x1f')]=qs['limit'](_0x419d13[_0xf32e('0x34')][_0xf32e('0x1f')]);_0x1586d9[_0xf32e('0x1d')]=qs[_0xf32e('0x1d')](_0x419d13['query'][_0xf32e('0x1d')]);}_0x1586d9[_0xf32e('0x3d')]=qs[_0xf32e('0x3e')](_0x419d13[_0xf32e('0x34')][_0xf32e('0x3e')]);_0x1586d9['where']=qs[_0xf32e('0x36')](_[_0xf32e('0x3f')](_0x419d13[_0xf32e('0x34')],_0x5c8779['filters']),_0x39965e);if(_0x419d13[_0xf32e('0x34')]['filter']){_0x1586d9[_0xf32e('0x40')]=_[_0xf32e('0x41')](_0x1586d9[_0xf32e('0x40')],{'$or':_['map'](_0x39965e,function(_0x409701){if(_0x409701[_0xf32e('0x32')]!==_0xf32e('0x42')){var _0x4a623={};_0x4a623[_0x409701[_0xf32e('0x2c')]]={'$like':'%'+_0x419d13[_0xf32e('0x34')]['filter']+'%'};return _0x4a623;}})});}_0x1586d9=_[_0xf32e('0x41')]({},_0x1586d9,_0x419d13[_0xf32e('0x43')]);var _0x477a98={'where':_0x1586d9[_0xf32e('0x40')]};return db[_0xf32e('0x2f')][_0xf32e('0x20')](_0x477a98)[_0xf32e('0x27')](function(_0x56bf88){_0x439143[_0xf32e('0x20')]=_0x56bf88;if(_0x419d13[_0xf32e('0x34')][_0xf32e('0x44')]){_0x1586d9[_0xf32e('0x45')]=[{'all':!![]}];}return db[_0xf32e('0x2f')][_0xf32e('0x46')](_0x1586d9);})[_0xf32e('0x27')](function(_0x546b80){_0x439143[_0xf32e('0x47')]=_0x546b80;return _0x439143;})[_0xf32e('0x27')](respondWithFilteredResult(_0x5bc6f2,_0x1586d9))[_0xf32e('0x48')](handleError(_0x5bc6f2,null));};exports[_0xf32e('0x49')]=function(_0x417a90,_0x453e24){var _0x1bff7b={'raw':![],'where':{'id':_0x417a90[_0xf32e('0x4a')]['id']}},_0x3ce422={};_0x3ce422[_0xf32e('0x38')]=_['keys'](db[_0xf32e('0x2f')][_0xf32e('0x30')]);_0x3ce422[_0xf32e('0x34')]=_[_0xf32e('0x35')](_0x417a90[_0xf32e('0x34')]);_0x3ce422[_0xf32e('0x36')]=_['intersection'](_0x3ce422[_0xf32e('0x38')],_0x3ce422[_0xf32e('0x34')]);_0x1bff7b[_0xf32e('0x39')]=_[_0xf32e('0x37')](_0x3ce422[_0xf32e('0x38')],qs['fields'](_0x417a90[_0xf32e('0x34')]['fields']));_0x1bff7b[_0xf32e('0x39')]=_0x1bff7b[_0xf32e('0x39')]['length']?_0x1bff7b[_0xf32e('0x39')]:_0x3ce422['model'];if(_0x417a90['query']['includeAll']){_0x1bff7b[_0xf32e('0x45')]=[{'all':!![]}];}_0x1bff7b=_[_0xf32e('0x41')]({},_0x1bff7b,_0x417a90[_0xf32e('0x43')]);return db[_0xf32e('0x2f')][_0xf32e('0x4b')](_0x1bff7b)[_0xf32e('0x27')](handleEntityNotFound(_0x453e24,null))[_0xf32e('0x27')](respondWithResult(_0x453e24,null))[_0xf32e('0x48')](handleError(_0x453e24,null));};exports[_0xf32e('0x4c')]=function(_0x3c952c,_0x40f168){return db[_0xf32e('0x2f')][_0xf32e('0x4c')](_0x3c952c[_0xf32e('0x4d')],{})['then'](respondWithResult(_0x40f168,0xc9))[_0xf32e('0x48')](handleError(_0x40f168,null));};exports[_0xf32e('0x26')]=function(_0xc83c9f,_0x4b15be){if(_0xc83c9f['body']['id']){delete _0xc83c9f['body']['id'];}return db[_0xf32e('0x2f')][_0xf32e('0x4b')]({'where':{'id':_0xc83c9f['params']['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x4b15be,null))[_0xf32e('0x27')](saveUpdates(_0xc83c9f['body'],null))[_0xf32e('0x27')](respondWithResult(_0x4b15be,null))[_0xf32e('0x48')](handleError(_0x4b15be,null));};exports[_0xf32e('0x28')]=function(_0x36015b,_0x2db8bc){return db[_0xf32e('0x2f')]['find']({'where':{'id':_0x36015b[_0xf32e('0x4a')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x2db8bc,null))[_0xf32e('0x27')](removeEntity(_0x2db8bc,null))['catch'](handleError(_0x2db8bc,null));};exports[_0xf32e('0x4e')]=function(_0xfd3f05,_0x2dda15,_0x5a5347){var _0x5c022d={};var _0x4e8220={};var _0x3cb16b;var _0xb49f79;return db[_0xf32e('0x2f')][_0xf32e('0x4f')]({'where':{'id':_0xfd3f05['params']['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x2dda15,null))[_0xf32e('0x27')](function(_0x3312ae){if(_0x3312ae){_0x3cb16b=_0x3312ae;_0x4e8220[_0xf32e('0x38')]=_[_0xf32e('0x35')](db['SalesforceField'][_0xf32e('0x30')]);_0x4e8220[_0xf32e('0x34')]=_[_0xf32e('0x35')](_0xfd3f05[_0xf32e('0x34')]);_0x4e8220['filters']=_[_0xf32e('0x37')](_0x4e8220['model'],_0x4e8220['query']);_0x5c022d[_0xf32e('0x39')]=_[_0xf32e('0x37')](_0x4e8220[_0xf32e('0x38')],qs[_0xf32e('0x3a')](_0xfd3f05[_0xf32e('0x34')][_0xf32e('0x3a')]));_0x5c022d[_0xf32e('0x39')]=_0x5c022d[_0xf32e('0x39')][_0xf32e('0x50')]?_0x5c022d[_0xf32e('0x39')]:_0x4e8220[_0xf32e('0x38')];_0x5c022d[_0xf32e('0x3d')]=qs['sort'](_0xfd3f05[_0xf32e('0x34')]['sort']);_0x5c022d[_0xf32e('0x40')]=qs['filters'](_[_0xf32e('0x3f')](_0xfd3f05[_0xf32e('0x34')],_0x4e8220[_0xf32e('0x36')]));if(_0xfd3f05['query'][_0xf32e('0x51')]){_0x5c022d[_0xf32e('0x40')]=_['merge'](_0x5c022d['where'],{'$or':_['map'](_0x5c022d[_0xf32e('0x39')],function(_0x3666b8){var _0x3bfacd={};_0x3bfacd[_0x3666b8]={'$like':'%'+_0xfd3f05[_0xf32e('0x34')][_0xf32e('0x51')]+'%'};return _0x3bfacd;})});}_0x5c022d=_[_0xf32e('0x41')]({},_0x5c022d,_0xfd3f05['options']);return _0x3cb16b[_0xf32e('0x4e')](_0x5c022d);}})['then'](function(_0x58a332){if(_0x58a332){_0xb49f79=_0x58a332[_0xf32e('0x50')];if(!_0xfd3f05[_0xf32e('0x34')][_0xf32e('0x3b')]('nolimit')){_0x5c022d[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0xfd3f05['query'][_0xf32e('0x1f')]);_0x5c022d['offset']=qs[_0xf32e('0x1d')](_0xfd3f05[_0xf32e('0x34')][_0xf32e('0x1d')]);}return _0x3cb16b[_0xf32e('0x4e')](_0x5c022d);}})[_0xf32e('0x27')](function(_0x57bf56){if(_0x57bf56){return _0x57bf56?{'count':_0xb49f79,'rows':_0x57bf56}:null;}})[_0xf32e('0x27')](respondWithResult(_0x2dda15,null))[_0xf32e('0x48')](handleError(_0x2dda15,null));};exports[_0xf32e('0x52')]=function(_0x30bdbe,_0x4c035a,_0x41f247){var _0x20de62={};var _0x1eb100={};var _0x5daa21;var _0x1d6b59;return db['SalesforceConfiguration'][_0xf32e('0x4f')]({'where':{'id':_0x30bdbe[_0xf32e('0x4a')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x4c035a,null))[_0xf32e('0x27')](function(_0x22809c){if(_0x22809c){_0x5daa21=_0x22809c;_0x1eb100[_0xf32e('0x38')]=_[_0xf32e('0x35')](db[_0xf32e('0x53')][_0xf32e('0x30')]);_0x1eb100[_0xf32e('0x34')]=_[_0xf32e('0x35')](_0x30bdbe['query']);_0x1eb100[_0xf32e('0x36')]=_[_0xf32e('0x37')](_0x1eb100[_0xf32e('0x38')],_0x1eb100[_0xf32e('0x34')]);_0x20de62['attributes']=_['intersection'](_0x1eb100['model'],qs['fields'](_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x3a')]));_0x20de62[_0xf32e('0x39')]=_0x20de62[_0xf32e('0x39')][_0xf32e('0x50')]?_0x20de62[_0xf32e('0x39')]:_0x1eb100['model'];_0x20de62[_0xf32e('0x3d')]=qs[_0xf32e('0x3e')](_0x30bdbe[_0xf32e('0x34')]['sort']);_0x20de62['where']=qs['filters'](_['pick'](_0x30bdbe[_0xf32e('0x34')],_0x1eb100[_0xf32e('0x36')]));if(_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x51')]){_0x20de62['where']=_[_0xf32e('0x41')](_0x20de62[_0xf32e('0x40')],{'$or':_[_0xf32e('0x2e')](_0x20de62[_0xf32e('0x39')],function(_0x5b7e6f){var _0x1b1101={};_0x1b1101[_0x5b7e6f]={'$like':'%'+_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x51')]+'%'};return _0x1b1101;})});}_0x20de62=_[_0xf32e('0x41')]({},_0x20de62,_0x30bdbe[_0xf32e('0x43')]);return _0x5daa21[_0xf32e('0x52')](_0x20de62);}})[_0xf32e('0x27')](function(_0x486424){if(_0x486424){_0x1d6b59=_0x486424['length'];if(!_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x3b')](_0xf32e('0x3c'))){_0x20de62[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x1f')]);_0x20de62['offset']=qs[_0xf32e('0x1d')](_0x30bdbe[_0xf32e('0x34')][_0xf32e('0x1d')]);}return _0x5daa21[_0xf32e('0x52')](_0x20de62);}})['then'](function(_0x188df4){if(_0x188df4){return _0x188df4?{'count':_0x1d6b59,'rows':_0x188df4}:null;}})[_0xf32e('0x27')](respondWithResult(_0x4c035a,null))[_0xf32e('0x48')](handleError(_0x4c035a,null));};exports[_0xf32e('0x54')]=function(_0x5b1423,_0x39bed2,_0x37b93b){var _0x3bb3e8={};var _0xe67bf1={};var _0x417113;var _0x46786e;return db[_0xf32e('0x2f')]['findOne']({'where':{'id':_0x5b1423[_0xf32e('0x4a')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x39bed2,null))[_0xf32e('0x27')](function(_0x6176e9){if(_0x6176e9){_0x417113=_0x6176e9;_0xe67bf1['model']=_[_0xf32e('0x35')](db['SalesforceField'][_0xf32e('0x30')]);_0xe67bf1[_0xf32e('0x34')]=_[_0xf32e('0x35')](_0x5b1423[_0xf32e('0x34')]);_0xe67bf1[_0xf32e('0x36')]=_[_0xf32e('0x37')](_0xe67bf1[_0xf32e('0x38')],_0xe67bf1['query']);_0x3bb3e8[_0xf32e('0x39')]=_['intersection'](_0xe67bf1[_0xf32e('0x38')],qs[_0xf32e('0x3a')](_0x5b1423[_0xf32e('0x34')][_0xf32e('0x3a')]));_0x3bb3e8[_0xf32e('0x39')]=_0x3bb3e8[_0xf32e('0x39')][_0xf32e('0x50')]?_0x3bb3e8[_0xf32e('0x39')]:_0xe67bf1[_0xf32e('0x38')];_0x3bb3e8['order']=qs['sort'](_0x5b1423['query']['sort']);_0x3bb3e8[_0xf32e('0x40')]=qs[_0xf32e('0x36')](_[_0xf32e('0x3f')](_0x5b1423['query'],_0xe67bf1[_0xf32e('0x36')]));if(_0x5b1423[_0xf32e('0x34')][_0xf32e('0x51')]){_0x3bb3e8[_0xf32e('0x40')]=_[_0xf32e('0x41')](_0x3bb3e8['where'],{'$or':_['map'](_0x3bb3e8[_0xf32e('0x39')],function(_0xee8286){var _0x21455d={};_0x21455d[_0xee8286]={'$like':'%'+_0x5b1423[_0xf32e('0x34')]['filter']+'%'};return _0x21455d;})});}_0x3bb3e8=_[_0xf32e('0x41')]({},_0x3bb3e8,_0x5b1423['options']);return _0x417113[_0xf32e('0x54')](_0x3bb3e8);}})['then'](function(_0x38f77c){if(_0x38f77c){_0x46786e=_0x38f77c[_0xf32e('0x50')];if(!_0x5b1423[_0xf32e('0x34')][_0xf32e('0x3b')](_0xf32e('0x3c'))){_0x3bb3e8[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0x5b1423['query'][_0xf32e('0x1f')]);_0x3bb3e8[_0xf32e('0x1d')]=qs['offset'](_0x5b1423[_0xf32e('0x34')][_0xf32e('0x1d')]);}return _0x417113[_0xf32e('0x54')](_0x3bb3e8);}})[_0xf32e('0x27')](function(_0x5766ff){if(_0x5766ff){return _0x5766ff?{'count':_0x46786e,'rows':_0x5766ff}:null;}})['then'](respondWithResult(_0x39bed2,null))[_0xf32e('0x48')](handleError(_0x39bed2,null));}; \ No newline at end of file +var _0xda49=['then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','findOne','SalesforceField','pick','getFields','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update'];(function(_0x436620,_0x45928e){var _0x6fd3ac=function(_0x4b1847){while(--_0x4b1847){_0x436620['push'](_0x436620['shift']());}};_0x6fd3ac(++_0x45928e);}(_0xda49,0x1b3));var _0x9da4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xda49[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require(_0x9da4('0x0'));var rimraf=require(_0x9da4('0x1'));var zipdir=require(_0x9da4('0x2'));var jsonpatch=require(_0x9da4('0x3'));var rp=require(_0x9da4('0x4'));var moment=require('moment');var BPromise=require(_0x9da4('0x5'));var Mustache=require('mustache');var util=require(_0x9da4('0x6'));var path=require(_0x9da4('0x7'));var sox=require(_0x9da4('0x8'));var csv=require('to-csv');var ejs=require(_0x9da4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9da4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9da4('0xb'));var querystring=require(_0x9da4('0xc'));var Papa=require(_0x9da4('0xd'));var Redis=require(_0x9da4('0xe'));var authService=require(_0x9da4('0xf'));var qs=require(_0x9da4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9da4('0x11'));var logger=require(_0x9da4('0x12'))(_0x9da4('0x13'));var utils=require(_0x9da4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9da4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7faae,_0xb2c76a){_0xb2c76a=_0xb2c76a||0xcc;return function(_0x2ad892){if(_0x2ad892){return _0xf7faae[_0x9da4('0x16')](_0xb2c76a);}return _0xf7faae[_0x9da4('0x17')](_0xb2c76a)[_0x9da4('0x18')]();};}function respondWithResult(_0x5bbcd8,_0x253af1){_0x253af1=_0x253af1||0xc8;return function(_0x2cd74b){if(_0x2cd74b){return _0x5bbcd8[_0x9da4('0x17')](_0x253af1)[_0x9da4('0x19')](_0x2cd74b);}};}function respondWithFilteredResult(_0x473927,_0x2675d1){return function(_0x1685c4){if(_0x1685c4){var _0x72909c=typeof _0x2675d1[_0x9da4('0x1a')]===_0x9da4('0x1b')&&typeof _0x2675d1[_0x9da4('0x1c')]===_0x9da4('0x1b');var _0x11a5ec=_0x1685c4[_0x9da4('0x1d')];var _0x28189d=_0x72909c?0x0:_0x2675d1[_0x9da4('0x1a')];var _0x1d86e7=_0x72909c?_0x1685c4[_0x9da4('0x1d')]:_0x2675d1[_0x9da4('0x1a')]+_0x2675d1[_0x9da4('0x1c')];var _0x3b5cb0;if(_0x1d86e7>=_0x11a5ec){_0x1d86e7=_0x11a5ec;_0x3b5cb0=0xc8;}else{_0x3b5cb0=0xce;}_0x473927[_0x9da4('0x17')](_0x3b5cb0);return _0x473927['set'](_0x9da4('0x1e'),_0x28189d+'-'+_0x1d86e7+'/'+_0x11a5ec)[_0x9da4('0x19')](_0x1685c4);}return null;};}function patchUpdates(_0x4a1753){return function(_0x5a4f92){try{jsonpatch['apply'](_0x5a4f92,_0x4a1753,!![]);}catch(_0x31edd0){return BPromise[_0x9da4('0x1f')](_0x31edd0);}return _0x5a4f92['save']();};}function saveUpdates(_0x2b561c,_0x1658e0){return function(_0x2335c4){if(_0x2335c4){return _0x2335c4[_0x9da4('0x20')](_0x2b561c)[_0x9da4('0x21')](function(_0x51af87){return _0x51af87;});}return null;};}function removeEntity(_0xee6081,_0x401ec2){return function(_0x33fed8){if(_0x33fed8){return _0x33fed8[_0x9da4('0x22')]()[_0x9da4('0x21')](function(){_0xee6081['status'](0xcc)[_0x9da4('0x18')]();});}};}function handleEntityNotFound(_0x2a538d,_0x3df186){return function(_0x32314f){if(!_0x32314f){_0x2a538d[_0x9da4('0x16')](0x194);}return _0x32314f;};}function handleError(_0xb5069b,_0x32952f){_0x32952f=_0x32952f||0x1f4;return function(_0x2a466f){logger[_0x9da4('0x23')](_0x2a466f[_0x9da4('0x24')]);if(_0x2a466f[_0x9da4('0x25')]){delete _0x2a466f['name'];}_0xb5069b['status'](_0x32952f)[_0x9da4('0x26')](_0x2a466f);};}exports[_0x9da4('0x27')]=function(_0x13e4ab,_0x23db90){var _0x498fe8={},_0x4dc189={},_0x26a643={'count':0x0,'rows':[]};var _0x599a55=_[_0x9da4('0x28')](db[_0x9da4('0x29')][_0x9da4('0x2a')],function(_0x57b476){return{'name':_0x57b476[_0x9da4('0x2b')],'type':_0x57b476[_0x9da4('0x2c')][_0x9da4('0x2d')]};});_0x4dc189[_0x9da4('0x2e')]=_[_0x9da4('0x28')](_0x599a55,_0x9da4('0x25'));_0x4dc189[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x13e4ab[_0x9da4('0x2f')]);_0x4dc189[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0x4dc189[_0x9da4('0x2e')],_0x4dc189[_0x9da4('0x2f')]);_0x498fe8[_0x9da4('0x33')]=_[_0x9da4('0x32')](_0x4dc189[_0x9da4('0x2e')],qs[_0x9da4('0x34')](_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x34')]));_0x498fe8['attributes']=_0x498fe8[_0x9da4('0x33')][_0x9da4('0x35')]?_0x498fe8[_0x9da4('0x33')]:_0x4dc189[_0x9da4('0x2e')];if(!_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x36')]('nolimit')){_0x498fe8[_0x9da4('0x1c')]=qs[_0x9da4('0x1c')](_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x1c')]);_0x498fe8['offset']=qs[_0x9da4('0x1a')](_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x1a')]);}_0x498fe8[_0x9da4('0x37')]=qs['sort'](_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x38')]);_0x498fe8['where']=qs[_0x9da4('0x31')](_['pick'](_0x13e4ab[_0x9da4('0x2f')],_0x4dc189[_0x9da4('0x31')]),_0x599a55);if(_0x13e4ab['query'][_0x9da4('0x39')]){_0x498fe8['where']=_[_0x9da4('0x3a')](_0x498fe8[_0x9da4('0x3b')],{'$or':_[_0x9da4('0x28')](_0x599a55,function(_0x1d4c75){if(_0x1d4c75['type']!==_0x9da4('0x3c')){var _0x319dac={};_0x319dac[_0x1d4c75['name']]={'$like':'%'+_0x13e4ab[_0x9da4('0x2f')][_0x9da4('0x39')]+'%'};return _0x319dac;}})});}_0x498fe8=_[_0x9da4('0x3a')]({},_0x498fe8,_0x13e4ab[_0x9da4('0x3d')]);var _0x43d0d3={'where':_0x498fe8[_0x9da4('0x3b')]};return db[_0x9da4('0x29')][_0x9da4('0x1d')](_0x43d0d3)[_0x9da4('0x21')](function(_0x9b958b){_0x26a643[_0x9da4('0x1d')]=_0x9b958b;if(_0x13e4ab[_0x9da4('0x2f')]['includeAll']){_0x498fe8[_0x9da4('0x3e')]=[{'all':!![]}];}return db[_0x9da4('0x29')][_0x9da4('0x3f')](_0x498fe8);})[_0x9da4('0x21')](function(_0x595fc4){_0x26a643[_0x9da4('0x40')]=_0x595fc4;return _0x26a643;})[_0x9da4('0x21')](respondWithFilteredResult(_0x23db90,_0x498fe8))[_0x9da4('0x41')](handleError(_0x23db90,null));};exports[_0x9da4('0x42')]=function(_0x557f39,_0x114daa){var _0x4a0c8d={'raw':![],'where':{'id':_0x557f39[_0x9da4('0x43')]['id']}},_0x455211={};_0x455211[_0x9da4('0x2e')]=_[_0x9da4('0x30')](db[_0x9da4('0x29')][_0x9da4('0x2a')]);_0x455211[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x557f39[_0x9da4('0x2f')]);_0x455211[_0x9da4('0x31')]=_['intersection'](_0x455211[_0x9da4('0x2e')],_0x455211[_0x9da4('0x2f')]);_0x4a0c8d['attributes']=_[_0x9da4('0x32')](_0x455211[_0x9da4('0x2e')],qs[_0x9da4('0x34')](_0x557f39[_0x9da4('0x2f')][_0x9da4('0x34')]));_0x4a0c8d[_0x9da4('0x33')]=_0x4a0c8d[_0x9da4('0x33')][_0x9da4('0x35')]?_0x4a0c8d['attributes']:_0x455211[_0x9da4('0x2e')];if(_0x557f39[_0x9da4('0x2f')]['includeAll']){_0x4a0c8d[_0x9da4('0x3e')]=[{'all':!![]}];}_0x4a0c8d=_['merge']({},_0x4a0c8d,_0x557f39['options']);return db[_0x9da4('0x29')][_0x9da4('0x44')](_0x4a0c8d)['then'](handleEntityNotFound(_0x114daa,null))['then'](respondWithResult(_0x114daa,null))[_0x9da4('0x41')](handleError(_0x114daa,null));};exports[_0x9da4('0x45')]=function(_0x862716,_0x2b2b14){return db[_0x9da4('0x29')][_0x9da4('0x45')](_0x862716['body'],{})['then'](respondWithResult(_0x2b2b14,0xc9))[_0x9da4('0x41')](handleError(_0x2b2b14,null));};exports[_0x9da4('0x20')]=function(_0x15ea69,_0x4fe4f9){if(_0x15ea69[_0x9da4('0x46')]['id']){delete _0x15ea69[_0x9da4('0x46')]['id'];}return db['SalesforceConfiguration'][_0x9da4('0x44')]({'where':{'id':_0x15ea69[_0x9da4('0x43')]['id']}})[_0x9da4('0x21')](handleEntityNotFound(_0x4fe4f9,null))[_0x9da4('0x21')](saveUpdates(_0x15ea69[_0x9da4('0x46')],null))[_0x9da4('0x21')](respondWithResult(_0x4fe4f9,null))['catch'](handleError(_0x4fe4f9,null));};exports[_0x9da4('0x22')]=function(_0x599233,_0x3fb4b0){return db[_0x9da4('0x29')]['find']({'where':{'id':_0x599233[_0x9da4('0x43')]['id']}})['then'](handleEntityNotFound(_0x3fb4b0,null))[_0x9da4('0x21')](removeEntity(_0x3fb4b0,null))[_0x9da4('0x41')](handleError(_0x3fb4b0,null));};exports['getFields']=function(_0x47eec0,_0x28217f,_0x5eb498){var _0x301eac={};var _0x40eba7={};var _0x9b9327;var _0x517cda;return db[_0x9da4('0x29')][_0x9da4('0x47')]({'where':{'id':_0x47eec0[_0x9da4('0x43')]['id']}})[_0x9da4('0x21')](handleEntityNotFound(_0x28217f,null))['then'](function(_0x394eae){if(_0x394eae){_0x9b9327=_0x394eae;_0x40eba7['model']=_[_0x9da4('0x30')](db[_0x9da4('0x48')][_0x9da4('0x2a')]);_0x40eba7[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x47eec0[_0x9da4('0x2f')]);_0x40eba7[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0x40eba7['model'],_0x40eba7[_0x9da4('0x2f')]);_0x301eac[_0x9da4('0x33')]=_[_0x9da4('0x32')](_0x40eba7['model'],qs[_0x9da4('0x34')](_0x47eec0[_0x9da4('0x2f')][_0x9da4('0x34')]));_0x301eac[_0x9da4('0x33')]=_0x301eac[_0x9da4('0x33')]['length']?_0x301eac['attributes']:_0x40eba7['model'];_0x301eac[_0x9da4('0x37')]=qs['sort'](_0x47eec0[_0x9da4('0x2f')][_0x9da4('0x38')]);_0x301eac[_0x9da4('0x3b')]=qs[_0x9da4('0x31')](_[_0x9da4('0x49')](_0x47eec0[_0x9da4('0x2f')],_0x40eba7[_0x9da4('0x31')]));if(_0x47eec0[_0x9da4('0x2f')][_0x9da4('0x39')]){_0x301eac[_0x9da4('0x3b')]=_[_0x9da4('0x3a')](_0x301eac[_0x9da4('0x3b')],{'$or':_[_0x9da4('0x28')](_0x301eac[_0x9da4('0x33')],function(_0x3fd379){var _0x163014={};_0x163014[_0x3fd379]={'$like':'%'+_0x47eec0['query'][_0x9da4('0x39')]+'%'};return _0x163014;})});}_0x301eac=_[_0x9da4('0x3a')]({},_0x301eac,_0x47eec0[_0x9da4('0x3d')]);return _0x9b9327['getFields'](_0x301eac);}})['then'](function(_0x4477bb){if(_0x4477bb){_0x517cda=_0x4477bb[_0x9da4('0x35')];if(!_0x47eec0[_0x9da4('0x2f')][_0x9da4('0x36')]('nolimit')){_0x301eac['limit']=qs[_0x9da4('0x1c')](_0x47eec0[_0x9da4('0x2f')][_0x9da4('0x1c')]);_0x301eac[_0x9da4('0x1a')]=qs[_0x9da4('0x1a')](_0x47eec0['query'][_0x9da4('0x1a')]);}return _0x9b9327[_0x9da4('0x4a')](_0x301eac);}})[_0x9da4('0x21')](function(_0x1c4350){if(_0x1c4350){return _0x1c4350?{'count':_0x517cda,'rows':_0x1c4350}:null;}})['then'](respondWithResult(_0x28217f,null))['catch'](handleError(_0x28217f,null));};exports[_0x9da4('0x4b')]=function(_0x478a26,_0xd67d91,_0x254da3){var _0x33c723={};var _0x4d8d76={};var _0x5bf0ff;var _0xf4bb00;return db[_0x9da4('0x29')][_0x9da4('0x47')]({'where':{'id':_0x478a26[_0x9da4('0x43')]['id']}})[_0x9da4('0x21')](handleEntityNotFound(_0xd67d91,null))[_0x9da4('0x21')](function(_0x323e71){if(_0x323e71){_0x5bf0ff=_0x323e71;_0x4d8d76['model']=_[_0x9da4('0x30')](db[_0x9da4('0x48')]['rawAttributes']);_0x4d8d76[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x478a26['query']);_0x4d8d76['filters']=_[_0x9da4('0x32')](_0x4d8d76[_0x9da4('0x2e')],_0x4d8d76['query']);_0x33c723[_0x9da4('0x33')]=_[_0x9da4('0x32')](_0x4d8d76[_0x9da4('0x2e')],qs['fields'](_0x478a26[_0x9da4('0x2f')]['fields']));_0x33c723['attributes']=_0x33c723[_0x9da4('0x33')][_0x9da4('0x35')]?_0x33c723[_0x9da4('0x33')]:_0x4d8d76[_0x9da4('0x2e')];_0x33c723['order']=qs[_0x9da4('0x38')](_0x478a26[_0x9da4('0x2f')]['sort']);_0x33c723['where']=qs[_0x9da4('0x31')](_[_0x9da4('0x49')](_0x478a26['query'],_0x4d8d76[_0x9da4('0x31')]));if(_0x478a26[_0x9da4('0x2f')][_0x9da4('0x39')]){_0x33c723[_0x9da4('0x3b')]=_['merge'](_0x33c723[_0x9da4('0x3b')],{'$or':_[_0x9da4('0x28')](_0x33c723['attributes'],function(_0x581985){var _0x3017de={};_0x3017de[_0x581985]={'$like':'%'+_0x478a26[_0x9da4('0x2f')][_0x9da4('0x39')]+'%'};return _0x3017de;})});}_0x33c723=_[_0x9da4('0x3a')]({},_0x33c723,_0x478a26[_0x9da4('0x3d')]);return _0x5bf0ff[_0x9da4('0x4b')](_0x33c723);}})['then'](function(_0x2f672c){if(_0x2f672c){_0xf4bb00=_0x2f672c['length'];if(!_0x478a26[_0x9da4('0x2f')][_0x9da4('0x36')](_0x9da4('0x4c'))){_0x33c723[_0x9da4('0x1c')]=qs[_0x9da4('0x1c')](_0x478a26[_0x9da4('0x2f')][_0x9da4('0x1c')]);_0x33c723[_0x9da4('0x1a')]=qs['offset'](_0x478a26[_0x9da4('0x2f')][_0x9da4('0x1a')]);}return _0x5bf0ff[_0x9da4('0x4b')](_0x33c723);}})['then'](function(_0x45480e){if(_0x45480e){return _0x45480e?{'count':_0xf4bb00,'rows':_0x45480e}:null;}})['then'](respondWithResult(_0xd67d91,null))[_0x9da4('0x41')](handleError(_0xd67d91,null));};exports[_0x9da4('0x4d')]=function(_0x1fde9d,_0x1d1e62,_0x88c3a0){var _0x58fa51={};var _0x29602a={};var _0x17a209;var _0x6cf8cd;return db[_0x9da4('0x29')]['findOne']({'where':{'id':_0x1fde9d['params']['id']}})[_0x9da4('0x21')](handleEntityNotFound(_0x1d1e62,null))[_0x9da4('0x21')](function(_0x209fad){if(_0x209fad){_0x17a209=_0x209fad;_0x29602a['model']=_[_0x9da4('0x30')](db[_0x9da4('0x48')][_0x9da4('0x2a')]);_0x29602a[_0x9da4('0x2f')]=_['keys'](_0x1fde9d[_0x9da4('0x2f')]);_0x29602a['filters']=_[_0x9da4('0x32')](_0x29602a[_0x9da4('0x2e')],_0x29602a['query']);_0x58fa51[_0x9da4('0x33')]=_['intersection'](_0x29602a[_0x9da4('0x2e')],qs[_0x9da4('0x34')](_0x1fde9d[_0x9da4('0x2f')][_0x9da4('0x34')]));_0x58fa51[_0x9da4('0x33')]=_0x58fa51[_0x9da4('0x33')][_0x9da4('0x35')]?_0x58fa51['attributes']:_0x29602a[_0x9da4('0x2e')];_0x58fa51[_0x9da4('0x37')]=qs['sort'](_0x1fde9d['query'][_0x9da4('0x38')]);_0x58fa51['where']=qs[_0x9da4('0x31')](_[_0x9da4('0x49')](_0x1fde9d[_0x9da4('0x2f')],_0x29602a['filters']));if(_0x1fde9d[_0x9da4('0x2f')][_0x9da4('0x39')]){_0x58fa51[_0x9da4('0x3b')]=_['merge'](_0x58fa51[_0x9da4('0x3b')],{'$or':_[_0x9da4('0x28')](_0x58fa51[_0x9da4('0x33')],function(_0x52d432){var _0xbcb23a={};_0xbcb23a[_0x52d432]={'$like':'%'+_0x1fde9d['query']['filter']+'%'};return _0xbcb23a;})});}_0x58fa51=_[_0x9da4('0x3a')]({},_0x58fa51,_0x1fde9d[_0x9da4('0x3d')]);return _0x17a209[_0x9da4('0x4d')](_0x58fa51);}})[_0x9da4('0x21')](function(_0x505924){if(_0x505924){_0x6cf8cd=_0x505924[_0x9da4('0x35')];if(!_0x1fde9d[_0x9da4('0x2f')][_0x9da4('0x36')]('nolimit')){_0x58fa51[_0x9da4('0x1c')]=qs[_0x9da4('0x1c')](_0x1fde9d[_0x9da4('0x2f')][_0x9da4('0x1c')]);_0x58fa51[_0x9da4('0x1a')]=qs[_0x9da4('0x1a')](_0x1fde9d[_0x9da4('0x2f')][_0x9da4('0x1a')]);}return _0x17a209[_0x9da4('0x4d')](_0x58fa51);}})['then'](function(_0x3163fc){if(_0x3163fc){return _0x3163fc?{'count':_0x6cf8cd,'rows':_0x3163fc}:null;}})[_0x9da4('0x21')](respondWithResult(_0x1d1e62,null))[_0x9da4('0x41')](handleError(_0x1d1e62,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 607555b..4da3e8a 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 _0x7f3f=['request-promise','path','rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10a3b1,_0x4c87f1){var _0x5547a0=function(_0x4bc478){while(--_0x4bc478){_0x10a3b1['push'](_0x10a3b1['shift']());}};_0x5547a0(++_0x4c87f1);}(_0x7f3f,0xa3));var _0xf7f3=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x7f3f[_0x56c70f];return _0x3812ed;};'use strict';var _=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var logger=require(_0xf7f3('0x2'))(_0xf7f3('0x3'));var moment=require(_0xf7f3('0x4'));var BPromise=require(_0xf7f3('0x5'));var rp=require(_0xf7f3('0x6'));var fs=require('fs');var path=require(_0xf7f3('0x7'));var rimraf=require(_0xf7f3('0x8'));var config=require(_0xf7f3('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x3721e3,_0xcc6e77){return _0x3721e3[_0xf7f3('0xa')](_0xf7f3('0xb'),attributes,{'tableName':_0xf7f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0928=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x2c5718,_0x47c690){var _0x4f984b=function(_0x2c18b2){while(--_0x2c18b2){_0x2c5718['push'](_0x2c5718['shift']());}};_0x4f984b(++_0x47c690);}(_0x0928,0x1b9));var _0x8092=function(_0x4982e8,_0x4b8c22){_0x4982e8=_0x4982e8-0x0;var _0x15913b=_0x0928[_0x4982e8];return _0x15913b;};'use strict';var _=require(_0x8092('0x0'));var util=require(_0x8092('0x1'));var logger=require(_0x8092('0x2'))(_0x8092('0x3'));var moment=require(_0x8092('0x4'));var BPromise=require(_0x8092('0x5'));var rp=require(_0x8092('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8092('0x7'));var config=require(_0x8092('0x8'));var attributes=require(_0x8092('0x9'));module['exports']=function(_0x59c773,_0x19bb4d){return _0x59c773['define'](_0x8092('0xa'),attributes,{'tableName':_0x8092('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 0007ea4..75672e7 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 _0xc67a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird'];(function(_0x3c2863,_0x112b6f){var _0x136ab8=function(_0x1cfdf9){while(--_0x1cfdf9){_0x3c2863['push'](_0x3c2863['shift']());}};_0x136ab8(++_0x112b6f);}(_0xc67a,0x1cc));var _0xac67=function(_0x126a16,_0x545657){_0x126a16=_0x126a16-0x0;var _0x15ef5b=_0xc67a[_0x126a16];return _0x15ef5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac67('0x0'));var BPromise=require(_0xac67('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac67('0x2'));var db=require(_0xac67('0x3'))['db'];var utils=require(_0xac67('0x4'));var logger=require('../../config/logger')(_0xac67('0x5'));var config=require(_0xac67('0x6'));var jayson=require(_0xac67('0x7'));var client=jayson[_0xac67('0x8')][_0xac67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2798,_0xdf1d47,_0xa91f23){return new BPromise(function(_0xe5f4df,_0x4d3711){return client[_0xac67('0xa')](_0x5d2798,_0xa91f23)[_0xac67('0xb')](function(_0x540a40){logger[_0xac67('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0xdf1d47,_0xac67('0xd'));logger[_0xac67('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xdf1d47,_0xac67('0xd'),JSON[_0xac67('0xf')](_0x540a40));if(_0x540a40['error']){if(_0x540a40[_0xac67('0x10')][_0xac67('0x11')]===0x1f4){logger[_0xac67('0x10')](_0xac67('0x12'),_0xdf1d47,_0x540a40[_0xac67('0x10')]['message']);return _0x4d3711(_0x540a40[_0xac67('0x10')][_0xac67('0x13')]);}logger[_0xac67('0x10')](_0xac67('0x12'),_0xdf1d47,_0x540a40['error'][_0xac67('0x13')]);return _0xe5f4df(_0x540a40[_0xac67('0x10')][_0xac67('0x13')]);}else{logger[_0xac67('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0xdf1d47,_0xac67('0xd'));_0xe5f4df(_0x540a40['result'][_0xac67('0x13')]);}})[_0xac67('0x14')](function(_0x2f8409){logger[_0xac67('0x10')](_0xac67('0x12'),_0xdf1d47,_0x2f8409);_0x4d3711(_0x2f8409);});});} \ No newline at end of file +var _0x9d72=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','SalesforceConfiguration,\x20%s,\x20%s','error'];(function(_0x501e0d,_0x1e0007){var _0x3b4977=function(_0x4183bd){while(--_0x4183bd){_0x501e0d['push'](_0x501e0d['shift']());}};_0x3b4977(++_0x1e0007);}(_0x9d72,0xe0));var _0x29d7=function(_0x3539c0,_0x228e11){_0x3539c0=_0x3539c0-0x0;var _0x344ba8=_0x9d72[_0x3539c0];return _0x344ba8;};'use strict';var _=require('lodash');var util=require(_0x29d7('0x0'));var moment=require(_0x29d7('0x1'));var BPromise=require(_0x29d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29d7('0x3'));var db=require(_0x29d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x29d7('0x5'))(_0x29d7('0x6'));var config=require(_0x29d7('0x7'));var jayson=require(_0x29d7('0x8'));var client=jayson['client'][_0x29d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe4506f,_0x55aceb,_0x416122){return new BPromise(function(_0x211ce0,_0xc53c60){return client['request'](_0xe4506f,_0x416122)[_0x29d7('0xa')](function(_0x4e2c66){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x55aceb,_0x29d7('0xb'));logger[_0x29d7('0xc')](_0x29d7('0xd'),_0x55aceb,'request\x20sent',JSON[_0x29d7('0xe')](_0x4e2c66));if(_0x4e2c66['error']){if(_0x4e2c66['error'][_0x29d7('0xf')]===0x1f4){logger['error'](_0x29d7('0x10'),_0x55aceb,_0x4e2c66[_0x29d7('0x11')]['message']);return _0xc53c60(_0x4e2c66[_0x29d7('0x11')][_0x29d7('0x12')]);}logger[_0x29d7('0x11')](_0x29d7('0x10'),_0x55aceb,_0x4e2c66[_0x29d7('0x11')][_0x29d7('0x12')]);return _0x211ce0(_0x4e2c66['error'][_0x29d7('0x12')]);}else{logger[_0x29d7('0x13')](_0x29d7('0x10'),_0x55aceb,_0x29d7('0xb'));_0x211ce0(_0x4e2c66[_0x29d7('0x14')][_0x29d7('0x12')]);}})[_0x29d7('0x15')](function(_0x1f8d26){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x55aceb,_0x1f8d26);_0xc53c60(_0x1f8d26);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index adcf9df..6efcfe5 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 _0xeacc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5e4760,_0x16db56){var _0x3b1515=function(_0x493dab){while(--_0x493dab){_0x5e4760['push'](_0x5e4760['shift']());}};_0x3b1515(++_0x16db56);}(_0xeacc,0xe4));var _0xceac=function(_0x17a39b,_0x255da4){_0x17a39b=_0x17a39b-0x0;var _0x4e6603=_0xeacc[_0x17a39b];return _0x4e6603;};'use strict';var multer=require('multer');var util=require(_0xceac('0x0'));var path=require(_0xceac('0x1'));var timeout=require(_0xceac('0x2'));var express=require('express');var router=express[_0xceac('0x3')]();var fs_extra=require(_0xceac('0x4'));var auth=require(_0xceac('0x5'));var interaction=require(_0xceac('0x6'));var config=require(_0xceac('0x7'));var controller=require(_0xceac('0x8'));router['get']('/',auth[_0xceac('0x9')](),controller[_0xceac('0xa')]);router[_0xceac('0xb')]('/:id',auth[_0xceac('0x9')](),controller[_0xceac('0xc')]);router[_0xceac('0xd')]('/',auth['isAuthenticated'](),controller[_0xceac('0xe')]);router[_0xceac('0xf')](_0xceac('0x10'),auth[_0xceac('0x9')](),controller[_0xceac('0x11')]);router[_0xceac('0x12')](_0xceac('0x10'),auth[_0xceac('0x9')](),controller[_0xceac('0x13')]);module[_0xceac('0x14')]=router; \ No newline at end of file +var _0x7fc2=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index'];(function(_0x18face,_0x20ac2e){var _0x427892=function(_0x29ba1a){while(--_0x29ba1a){_0x18face['push'](_0x18face['shift']());}};_0x427892(++_0x20ac2e);}(_0x7fc2,0x11b));var _0x27fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7fc2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x27fc('0x0'));var util=require(_0x27fc('0x1'));var path=require(_0x27fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x27fc('0x3'));var router=express[_0x27fc('0x4')]();var fs_extra=require(_0x27fc('0x5'));var auth=require(_0x27fc('0x6'));var interaction=require(_0x27fc('0x7'));var config=require('../../config/environment');var controller=require(_0x27fc('0x8'));router[_0x27fc('0x9')]('/',auth['isAuthenticated'](),controller[_0x27fc('0xa')]);router[_0x27fc('0x9')](_0x27fc('0xb'),auth[_0x27fc('0xc')](),controller[_0x27fc('0xd')]);router[_0x27fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x27fc('0xf')]);router[_0x27fc('0x10')](_0x27fc('0xb'),auth['isAuthenticated'](),controller[_0x27fc('0x11')]);router[_0x27fc('0x12')](_0x27fc('0xb'),auth['isAuthenticated'](),controller[_0x27fc('0x13')]);module[_0x27fc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 7458e41..670332d 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 _0x773e=['STRING','ENUM','string','variable','keyValue','picklist'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x773e,0x16f));var _0xe773=function(_0x5e64f9,_0x13c61d){_0x5e64f9=_0x5e64f9-0x0;var _0x3e9b8a=_0x773e[_0x5e64f9];return _0x3e9b8a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe773('0x0')](_0xe773('0x1'),_0xe773('0x2'),'customVariable',_0xe773('0x3'),_0xe773('0x4')),'defaultValue':_0xe773('0x1')},'content':{'type':Sequelize[_0xe773('0x5')]},'key':{'type':Sequelize[_0xe773('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xe773('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xe773('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xe773('0x5')]}}; \ No newline at end of file +var _0x9dce=['customVariable','picklist','STRING','ENUM','variable','sequelize','exports','string'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x9dce,0x15d));var _0xe9dc=function(_0x149207,_0x5b17b2){_0x149207=_0x149207-0x0;var _0xd9d694=_0x9dce[_0x149207];return _0xd9d694;};'use strict';var Sequelize=require(_0xe9dc('0x0'));module[_0xe9dc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe9dc('0x2'),'variable',_0xe9dc('0x3'),'keyValue',_0xe9dc('0x4')),'defaultValue':_0xe9dc('0x2')},'content':{'type':Sequelize[_0xe9dc('0x5')]},'key':{'type':Sequelize[_0xe9dc('0x5')]},'keyType':{'type':Sequelize[_0xe9dc('0x6')](_0xe9dc('0x2'),_0xe9dc('0x7'),_0xe9dc('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe9dc('0x5')]},'variableName':{'type':Sequelize[_0xe9dc('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f35575d..8374006 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 _0xe4f9=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty'];(function(_0x56e647,_0x167df8){var _0x54d7c9=function(_0x2d8a33){while(--_0x2d8a33){_0x56e647['push'](_0x56e647['shift']());}};_0x54d7c9(++_0x167df8);}(_0xe4f9,0x131));var _0x9e4f=function(_0x2187bb,_0x2c2e6c){_0x2187bb=_0x2187bb-0x0;var _0x9121bb=_0xe4f9[_0x2187bb];return _0x9121bb;};'use strict';var emlformat=require(_0x9e4f('0x0'));var rimraf=require(_0x9e4f('0x1'));var zipdir=require(_0x9e4f('0x2'));var jsonpatch=require(_0x9e4f('0x3'));var rp=require(_0x9e4f('0x4'));var moment=require('moment');var BPromise=require(_0x9e4f('0x5'));var Mustache=require('mustache');var util=require(_0x9e4f('0x6'));var path=require(_0x9e4f('0x7'));var sox=require(_0x9e4f('0x8'));var csv=require(_0x9e4f('0x9'));var ejs=require(_0x9e4f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9e4f('0xb'));var crypto=require(_0x9e4f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9e4f('0xd'));var toCsv=require(_0x9e4f('0x9'));var querystring=require('querystring');var Papa=require(_0x9e4f('0xe'));var Redis=require('ioredis');var authService=require(_0x9e4f('0xf'));var qs=require(_0x9e4f('0x10'));var as=require(_0x9e4f('0x11'));var hardwareService=require(_0x9e4f('0x12'));var logger=require(_0x9e4f('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9e4f('0x14'));var db=require(_0x9e4f('0x15'))['db'];function respondWithStatusCode(_0xcba209,_0x52172a){_0x52172a=_0x52172a||0xcc;return function(_0x420e6e){if(_0x420e6e){return _0xcba209['sendStatus'](_0x52172a);}return _0xcba209[_0x9e4f('0x16')](_0x52172a)['end']();};}function respondWithResult(_0x493d20,_0x4a9266){_0x4a9266=_0x4a9266||0xc8;return function(_0x17db5e){if(_0x17db5e){return _0x493d20[_0x9e4f('0x16')](_0x4a9266)[_0x9e4f('0x17')](_0x17db5e);}};}function respondWithFilteredResult(_0x3a37ea,_0x4a2b7c){return function(_0x5ee907){if(_0x5ee907){var _0x19f428=typeof _0x4a2b7c[_0x9e4f('0x18')]==='undefined'&&typeof _0x4a2b7c[_0x9e4f('0x19')]==='undefined';var _0x277e8e=_0x5ee907[_0x9e4f('0x1a')];var _0x570fee=_0x19f428?0x0:_0x4a2b7c[_0x9e4f('0x18')];var _0x10abff=_0x19f428?_0x5ee907['count']:_0x4a2b7c['offset']+_0x4a2b7c[_0x9e4f('0x19')];var _0x51a724;if(_0x10abff>=_0x277e8e){_0x10abff=_0x277e8e;_0x51a724=0xc8;}else{_0x51a724=0xce;}_0x3a37ea['status'](_0x51a724);return _0x3a37ea[_0x9e4f('0x1b')](_0x9e4f('0x1c'),_0x570fee+'-'+_0x10abff+'/'+_0x277e8e)[_0x9e4f('0x17')](_0x5ee907);}return null;};}function patchUpdates(_0x4ca767){return function(_0x54cfdc){try{jsonpatch[_0x9e4f('0x1d')](_0x54cfdc,_0x4ca767,!![]);}catch(_0x172603){return BPromise['reject'](_0x172603);}return _0x54cfdc[_0x9e4f('0x1e')]();};}function saveUpdates(_0x219402,_0x34c9d8){return function(_0x5a3335){if(_0x5a3335){return _0x5a3335[_0x9e4f('0x1f')](_0x219402)['then'](function(_0x1e3f05){return _0x1e3f05;});}return null;};}function removeEntity(_0x569902,_0x1c4b21){return function(_0x4acada){if(_0x4acada){return _0x4acada[_0x9e4f('0x20')]()[_0x9e4f('0x21')](function(){_0x569902['status'](0xcc)[_0x9e4f('0x22')]();});}};}function handleEntityNotFound(_0x39694c,_0xf5b373){return function(_0x28872d){if(!_0x28872d){_0x39694c['sendStatus'](0x194);}return _0x28872d;};}function handleError(_0x508405,_0x1fb884){_0x1fb884=_0x1fb884||0x1f4;return function(_0x20bd65){logger[_0x9e4f('0x23')](_0x20bd65[_0x9e4f('0x24')]);if(_0x20bd65[_0x9e4f('0x25')]){delete _0x20bd65[_0x9e4f('0x25')];}_0x508405[_0x9e4f('0x16')](_0x1fb884)[_0x9e4f('0x26')](_0x20bd65);};}exports[_0x9e4f('0x27')]=function(_0x5bbdd5,_0x2848c2){var _0x3bbb3b={},_0x50b44c={},_0x59fc53={'count':0x0,'rows':[]};var _0x2fcfb3=_['map'](db[_0x9e4f('0x28')][_0x9e4f('0x29')],function(_0x51401e){return{'name':_0x51401e[_0x9e4f('0x2a')],'type':_0x51401e[_0x9e4f('0x2b')][_0x9e4f('0x2c')]};});_0x50b44c['model']=_[_0x9e4f('0x2d')](_0x2fcfb3,'name');_0x50b44c[_0x9e4f('0x2e')]=_[_0x9e4f('0x2f')](_0x5bbdd5[_0x9e4f('0x2e')]);_0x50b44c[_0x9e4f('0x30')]=_[_0x9e4f('0x31')](_0x50b44c['model'],_0x50b44c[_0x9e4f('0x2e')]);_0x3bbb3b[_0x9e4f('0x32')]=_[_0x9e4f('0x31')](_0x50b44c[_0x9e4f('0x33')],qs['fields'](_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x34')]));_0x3bbb3b[_0x9e4f('0x32')]=_0x3bbb3b[_0x9e4f('0x32')][_0x9e4f('0x35')]?_0x3bbb3b[_0x9e4f('0x32')]:_0x50b44c[_0x9e4f('0x33')];if(!_0x5bbdd5['query'][_0x9e4f('0x36')]('nolimit')){_0x3bbb3b[_0x9e4f('0x19')]=qs[_0x9e4f('0x19')](_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x19')]);_0x3bbb3b[_0x9e4f('0x18')]=qs['offset'](_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x18')]);}_0x3bbb3b[_0x9e4f('0x37')]=qs[_0x9e4f('0x38')](_0x5bbdd5[_0x9e4f('0x2e')]['sort']);_0x3bbb3b[_0x9e4f('0x39')]=qs[_0x9e4f('0x30')](_[_0x9e4f('0x3a')](_0x5bbdd5[_0x9e4f('0x2e')],_0x50b44c[_0x9e4f('0x30')]),_0x2fcfb3);if(_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x3b')]){_0x3bbb3b[_0x9e4f('0x39')]=_['merge'](_0x3bbb3b[_0x9e4f('0x39')],{'$or':_[_0x9e4f('0x2d')](_0x2fcfb3,function(_0x3a16d6){if(_0x3a16d6['type']!==_0x9e4f('0x3c')){var _0x674b51={};_0x674b51[_0x3a16d6['name']]={'$like':'%'+_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x3b')]+'%'};return _0x674b51;}})});}_0x3bbb3b=_[_0x9e4f('0x3d')]({},_0x3bbb3b,_0x5bbdd5[_0x9e4f('0x3e')]);var _0xd893a2={'where':_0x3bbb3b[_0x9e4f('0x39')]};return db['SalesforceField'][_0x9e4f('0x1a')](_0xd893a2)[_0x9e4f('0x21')](function(_0x2d6d32){_0x59fc53['count']=_0x2d6d32;if(_0x5bbdd5[_0x9e4f('0x2e')][_0x9e4f('0x3f')]){_0x3bbb3b['include']=[{'all':!![]}];}return db[_0x9e4f('0x28')][_0x9e4f('0x40')](_0x3bbb3b);})[_0x9e4f('0x21')](function(_0x3e26ed){_0x59fc53[_0x9e4f('0x41')]=_0x3e26ed;return _0x59fc53;})[_0x9e4f('0x21')](respondWithFilteredResult(_0x2848c2,_0x3bbb3b))['catch'](handleError(_0x2848c2,null));};exports[_0x9e4f('0x42')]=function(_0x55f0c4,_0x322232){var _0x4be6de={'raw':!![],'where':{'id':_0x55f0c4[_0x9e4f('0x43')]['id']}},_0x1a763f={};_0x1a763f[_0x9e4f('0x33')]=_[_0x9e4f('0x2f')](db['SalesforceField'][_0x9e4f('0x29')]);_0x1a763f[_0x9e4f('0x2e')]=_['keys'](_0x55f0c4[_0x9e4f('0x2e')]);_0x1a763f[_0x9e4f('0x30')]=_[_0x9e4f('0x31')](_0x1a763f[_0x9e4f('0x33')],_0x1a763f[_0x9e4f('0x2e')]);_0x4be6de[_0x9e4f('0x32')]=_[_0x9e4f('0x31')](_0x1a763f['model'],qs[_0x9e4f('0x34')](_0x55f0c4[_0x9e4f('0x2e')][_0x9e4f('0x34')]));_0x4be6de['attributes']=_0x4be6de[_0x9e4f('0x32')][_0x9e4f('0x35')]?_0x4be6de['attributes']:_0x1a763f[_0x9e4f('0x33')];if(_0x55f0c4['query']['includeAll']){_0x4be6de['include']=[{'all':!![]}];}_0x4be6de=_[_0x9e4f('0x3d')]({},_0x4be6de,_0x55f0c4['options']);return db['SalesforceField'][_0x9e4f('0x44')](_0x4be6de)[_0x9e4f('0x21')](handleEntityNotFound(_0x322232,null))['then'](respondWithResult(_0x322232,null))['catch'](handleError(_0x322232,null));};exports[_0x9e4f('0x45')]=function(_0x4924ad,_0x1499d8){return db[_0x9e4f('0x28')][_0x9e4f('0x45')](_0x4924ad[_0x9e4f('0x46')],{})[_0x9e4f('0x21')](respondWithResult(_0x1499d8,0xc9))['catch'](handleError(_0x1499d8,null));};exports[_0x9e4f('0x1f')]=function(_0x1788b1,_0x2d026a){if(_0x1788b1[_0x9e4f('0x46')]['id']){delete _0x1788b1[_0x9e4f('0x46')]['id'];}return db[_0x9e4f('0x28')][_0x9e4f('0x44')]({'where':{'id':_0x1788b1[_0x9e4f('0x43')]['id']}})[_0x9e4f('0x21')](handleEntityNotFound(_0x2d026a,null))[_0x9e4f('0x21')](saveUpdates(_0x1788b1[_0x9e4f('0x46')],null))[_0x9e4f('0x21')](respondWithResult(_0x2d026a,null))[_0x9e4f('0x47')](handleError(_0x2d026a,null));};exports[_0x9e4f('0x20')]=function(_0x4412e3,_0xbe3db9){return db[_0x9e4f('0x28')][_0x9e4f('0x44')]({'where':{'id':_0x4412e3[_0x9e4f('0x43')]['id']}})[_0x9e4f('0x21')](handleEntityNotFound(_0xbe3db9,null))[_0x9e4f('0x21')](removeEntity(_0xbe3db9,null))[_0x9e4f('0x47')](handleError(_0xbe3db9,null));}; \ No newline at end of file +var _0xc4ee=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','map','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x375ac9,_0x262210){var _0x421ea2=function(_0x10e6ba){while(--_0x10e6ba){_0x375ac9['push'](_0x375ac9['shift']());}};_0x421ea2(++_0x262210);}(_0xc4ee,0x160));var _0xec4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ee[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec4e('0x0'));var zipdir=require(_0xec4e('0x1'));var jsonpatch=require(_0xec4e('0x2'));var rp=require('request-promise');var moment=require(_0xec4e('0x3'));var BPromise=require(_0xec4e('0x4'));var Mustache=require(_0xec4e('0x5'));var util=require(_0xec4e('0x6'));var path=require('path');var sox=require(_0xec4e('0x7'));var csv=require(_0xec4e('0x8'));var ejs=require(_0xec4e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec4e('0xa'));var squel=require(_0xec4e('0xb'));var crypto=require(_0xec4e('0xc'));var jsforce=require(_0xec4e('0xd'));var deskjs=require(_0xec4e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xec4e('0xf'));var Papa=require('papaparse');var Redis=require(_0xec4e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xec4e('0x11'));var as=require(_0xec4e('0x12'));var hardwareService=require(_0xec4e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xec4e('0x14'));var config=require(_0xec4e('0x15'));var licenseUtil=require(_0xec4e('0x16'));var db=require(_0xec4e('0x17'))['db'];function respondWithStatusCode(_0x51d200,_0x15b1f0){_0x15b1f0=_0x15b1f0||0xcc;return function(_0x23fb6b){if(_0x23fb6b){return _0x51d200[_0xec4e('0x18')](_0x15b1f0);}return _0x51d200[_0xec4e('0x19')](_0x15b1f0)['end']();};}function respondWithResult(_0x3b9280,_0x20b386){_0x20b386=_0x20b386||0xc8;return function(_0x362fe8){if(_0x362fe8){return _0x3b9280[_0xec4e('0x19')](_0x20b386)[_0xec4e('0x1a')](_0x362fe8);}};}function respondWithFilteredResult(_0x128e87,_0x973c8b){return function(_0x3945ef){if(_0x3945ef){var _0xbdd2ef=typeof _0x973c8b[_0xec4e('0x1b')]===_0xec4e('0x1c')&&typeof _0x973c8b['limit']===_0xec4e('0x1c');var _0x8fb46f=_0x3945ef[_0xec4e('0x1d')];var _0xafefa3=_0xbdd2ef?0x0:_0x973c8b[_0xec4e('0x1b')];var _0x3971db=_0xbdd2ef?_0x3945ef['count']:_0x973c8b[_0xec4e('0x1b')]+_0x973c8b[_0xec4e('0x1e')];var _0x2a331b;if(_0x3971db>=_0x8fb46f){_0x3971db=_0x8fb46f;_0x2a331b=0xc8;}else{_0x2a331b=0xce;}_0x128e87['status'](_0x2a331b);return _0x128e87[_0xec4e('0x1f')](_0xec4e('0x20'),_0xafefa3+'-'+_0x3971db+'/'+_0x8fb46f)['json'](_0x3945ef);}return null;};}function patchUpdates(_0x58d5fd){return function(_0x3ea846){try{jsonpatch[_0xec4e('0x21')](_0x3ea846,_0x58d5fd,!![]);}catch(_0xe26476){return BPromise[_0xec4e('0x22')](_0xe26476);}return _0x3ea846[_0xec4e('0x23')]();};}function saveUpdates(_0x48ef7c,_0x243d1f){return function(_0x5a3b12){if(_0x5a3b12){return _0x5a3b12[_0xec4e('0x24')](_0x48ef7c)[_0xec4e('0x25')](function(_0x397c75){return _0x397c75;});}return null;};}function removeEntity(_0x2a1c78,_0x5ce30c){return function(_0x2fcf9c){if(_0x2fcf9c){return _0x2fcf9c[_0xec4e('0x26')]()[_0xec4e('0x25')](function(){_0x2a1c78[_0xec4e('0x19')](0xcc)[_0xec4e('0x27')]();});}};}function handleEntityNotFound(_0x5540a4,_0x19cde9){return function(_0x3d7838){if(!_0x3d7838){_0x5540a4[_0xec4e('0x18')](0x194);}return _0x3d7838;};}function handleError(_0x3993f8,_0x2a406e){_0x2a406e=_0x2a406e||0x1f4;return function(_0x4fbd88){logger[_0xec4e('0x28')](_0x4fbd88[_0xec4e('0x29')]);if(_0x4fbd88[_0xec4e('0x2a')]){delete _0x4fbd88['name'];}_0x3993f8[_0xec4e('0x19')](_0x2a406e)[_0xec4e('0x2b')](_0x4fbd88);};}exports[_0xec4e('0x2c')]=function(_0x428ccd,_0x2c0b5a){var _0x31a43e={},_0x135f9e={},_0x3f7a47={'count':0x0,'rows':[]};var _0x2439c6=_['map'](db[_0xec4e('0x2d')][_0xec4e('0x2e')],function(_0x1db02a){return{'name':_0x1db02a[_0xec4e('0x2f')],'type':_0x1db02a[_0xec4e('0x30')]['key']};});_0x135f9e['model']=_[_0xec4e('0x31')](_0x2439c6,_0xec4e('0x2a'));_0x135f9e['query']=_['keys'](_0x428ccd['query']);_0x135f9e[_0xec4e('0x32')]=_[_0xec4e('0x33')](_0x135f9e[_0xec4e('0x34')],_0x135f9e[_0xec4e('0x35')]);_0x31a43e['attributes']=_[_0xec4e('0x33')](_0x135f9e[_0xec4e('0x34')],qs[_0xec4e('0x36')](_0x428ccd[_0xec4e('0x35')][_0xec4e('0x36')]));_0x31a43e[_0xec4e('0x37')]=_0x31a43e[_0xec4e('0x37')][_0xec4e('0x38')]?_0x31a43e[_0xec4e('0x37')]:_0x135f9e[_0xec4e('0x34')];if(!_0x428ccd['query'][_0xec4e('0x39')](_0xec4e('0x3a'))){_0x31a43e[_0xec4e('0x1e')]=qs[_0xec4e('0x1e')](_0x428ccd[_0xec4e('0x35')][_0xec4e('0x1e')]);_0x31a43e[_0xec4e('0x1b')]=qs['offset'](_0x428ccd[_0xec4e('0x35')][_0xec4e('0x1b')]);}_0x31a43e[_0xec4e('0x3b')]=qs[_0xec4e('0x3c')](_0x428ccd[_0xec4e('0x35')][_0xec4e('0x3c')]);_0x31a43e[_0xec4e('0x3d')]=qs['filters'](_[_0xec4e('0x3e')](_0x428ccd[_0xec4e('0x35')],_0x135f9e[_0xec4e('0x32')]),_0x2439c6);if(_0x428ccd[_0xec4e('0x35')][_0xec4e('0x3f')]){_0x31a43e[_0xec4e('0x3d')]=_[_0xec4e('0x40')](_0x31a43e[_0xec4e('0x3d')],{'$or':_['map'](_0x2439c6,function(_0xe2a3db){if(_0xe2a3db[_0xec4e('0x30')]!=='VIRTUAL'){var _0x385067={};_0x385067[_0xe2a3db[_0xec4e('0x2a')]]={'$like':'%'+_0x428ccd[_0xec4e('0x35')][_0xec4e('0x3f')]+'%'};return _0x385067;}})});}_0x31a43e=_['merge']({},_0x31a43e,_0x428ccd[_0xec4e('0x41')]);var _0x36bfd6={'where':_0x31a43e['where']};return db[_0xec4e('0x2d')][_0xec4e('0x1d')](_0x36bfd6)[_0xec4e('0x25')](function(_0x55eda5){_0x3f7a47['count']=_0x55eda5;if(_0x428ccd['query'][_0xec4e('0x42')]){_0x31a43e[_0xec4e('0x43')]=[{'all':!![]}];}return db[_0xec4e('0x2d')][_0xec4e('0x44')](_0x31a43e);})[_0xec4e('0x25')](function(_0x5bdd28){_0x3f7a47[_0xec4e('0x45')]=_0x5bdd28;return _0x3f7a47;})[_0xec4e('0x25')](respondWithFilteredResult(_0x2c0b5a,_0x31a43e))[_0xec4e('0x46')](handleError(_0x2c0b5a,null));};exports[_0xec4e('0x47')]=function(_0x15c78d,_0x3683af){var _0x5788fc={'raw':!![],'where':{'id':_0x15c78d['params']['id']}},_0x132398={};_0x132398[_0xec4e('0x34')]=_[_0xec4e('0x48')](db[_0xec4e('0x2d')][_0xec4e('0x2e')]);_0x132398['query']=_[_0xec4e('0x48')](_0x15c78d['query']);_0x132398[_0xec4e('0x32')]=_[_0xec4e('0x33')](_0x132398['model'],_0x132398[_0xec4e('0x35')]);_0x5788fc[_0xec4e('0x37')]=_[_0xec4e('0x33')](_0x132398[_0xec4e('0x34')],qs[_0xec4e('0x36')](_0x15c78d[_0xec4e('0x35')][_0xec4e('0x36')]));_0x5788fc[_0xec4e('0x37')]=_0x5788fc[_0xec4e('0x37')][_0xec4e('0x38')]?_0x5788fc[_0xec4e('0x37')]:_0x132398[_0xec4e('0x34')];if(_0x15c78d[_0xec4e('0x35')][_0xec4e('0x42')]){_0x5788fc[_0xec4e('0x43')]=[{'all':!![]}];}_0x5788fc=_[_0xec4e('0x40')]({},_0x5788fc,_0x15c78d[_0xec4e('0x41')]);return db[_0xec4e('0x2d')][_0xec4e('0x49')](_0x5788fc)['then'](handleEntityNotFound(_0x3683af,null))['then'](respondWithResult(_0x3683af,null))[_0xec4e('0x46')](handleError(_0x3683af,null));};exports[_0xec4e('0x4a')]=function(_0x54916a,_0x19124e){return db[_0xec4e('0x2d')]['create'](_0x54916a[_0xec4e('0x4b')],{})[_0xec4e('0x25')](respondWithResult(_0x19124e,0xc9))[_0xec4e('0x46')](handleError(_0x19124e,null));};exports[_0xec4e('0x24')]=function(_0x34ebbb,_0x4d85a6){if(_0x34ebbb[_0xec4e('0x4b')]['id']){delete _0x34ebbb['body']['id'];}return db['SalesforceField'][_0xec4e('0x49')]({'where':{'id':_0x34ebbb['params']['id']}})['then'](handleEntityNotFound(_0x4d85a6,null))[_0xec4e('0x25')](saveUpdates(_0x34ebbb[_0xec4e('0x4b')],null))[_0xec4e('0x25')](respondWithResult(_0x4d85a6,null))[_0xec4e('0x46')](handleError(_0x4d85a6,null));};exports[_0xec4e('0x26')]=function(_0x372873,_0x59111d){return db[_0xec4e('0x2d')][_0xec4e('0x49')]({'where':{'id':_0x372873['params']['id']}})['then'](handleEntityNotFound(_0x59111d,null))[_0xec4e('0x25')](removeEntity(_0x59111d,null))[_0xec4e('0x46')](handleError(_0x59111d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index d8fdef5..fb20c1e 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 _0x9f6e=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1f10b4,_0x127b87){var _0x5c2375=function(_0x24f2c4){while(--_0x24f2c4){_0x1f10b4['push'](_0x1f10b4['shift']());}};_0x5c2375(++_0x127b87);}(_0x9f6e,0x94));var _0xe9f6=function(_0xfc75e4,_0x47f5f1){_0xfc75e4=_0xfc75e4-0x0;var _0x17f284=_0x9f6e[_0xfc75e4];return _0x17f284;};'use strict';var _=require(_0xe9f6('0x0'));var util=require(_0xe9f6('0x1'));var logger=require('../../config/logger')(_0xe9f6('0x2'));var moment=require(_0xe9f6('0x3'));var BPromise=require(_0xe9f6('0x4'));var rp=require(_0xe9f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe9f6('0x6'));var attributes=require(_0xe9f6('0x7'));module[_0xe9f6('0x8')]=function(_0x31cf98,_0x2cfa88){return _0x31cf98[_0xe9f6('0x9')](_0xe9f6('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xe9f6('0xb'),'fields':[_0xe9f6('0xc'),_0xe9f6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e06=['path','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','moment','bluebird','request-promise'];(function(_0x1d606d,_0x376e51){var _0x3c38bd=function(_0x2ea4e2){while(--_0x2ea4e2){_0x1d606d['push'](_0x1d606d['shift']());}};_0x3c38bd(++_0x376e51);}(_0x8e06,0x164));var _0x68e0=function(_0x4661dc,_0xa5d4d8){_0x4661dc=_0x4661dc-0x0;var _0x153e92=_0x8e06[_0x4661dc];return _0x153e92;};'use strict';var _=require('lodash');var util=require(_0x68e0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x68e0('0x1'));var BPromise=require(_0x68e0('0x2'));var rp=require(_0x68e0('0x3'));var fs=require('fs');var path=require(_0x68e0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x68e0('0x5'));module[_0x68e0('0x6')]=function(_0x3e5e41,_0x6011da){return _0x3e5e41['define'](_0x68e0('0x7'),attributes,{'tableName':_0x68e0('0x8'),'paranoid':![],'indexes':[{'name':_0x68e0('0x9'),'fields':[_0x68e0('0xa'),_0x68e0('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 3eb8d3c..517622c 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 _0x64b9=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x587922,_0x3f7b6d){var _0x23bc80=function(_0x5eabaf){while(--_0x5eabaf){_0x587922['push'](_0x587922['shift']());}};_0x23bc80(++_0x3f7b6d);}(_0x64b9,0x1f4));var _0x964b=function(_0x15f9e9,_0x5e8ff2){_0x15f9e9=_0x15f9e9-0x0;var _0x344f65=_0x64b9[_0x15f9e9];return _0x344f65;};'use strict';var _=require(_0x964b('0x0'));var util=require(_0x964b('0x1'));var moment=require(_0x964b('0x2'));var BPromise=require('bluebird');var rs=require(_0x964b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x964b('0x4'))['db'];var utils=require(_0x964b('0x5'));var logger=require(_0x964b('0x6'))('rpc');var config=require(_0x964b('0x7'));var jayson=require(_0x964b('0x8'));var client=jayson[_0x964b('0x9')][_0x964b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x352d81,_0x689209,_0x2cbfca){return new BPromise(function(_0x285f48,_0x11368e){return client[_0x964b('0xb')](_0x352d81,_0x2cbfca)[_0x964b('0xc')](function(_0x3e04d4){logger['info'](_0x964b('0xd'),_0x689209,_0x964b('0xe'));logger[_0x964b('0xf')](_0x964b('0x10'),_0x689209,_0x964b('0xe'),JSON['stringify'](_0x3e04d4));if(_0x3e04d4[_0x964b('0x11')]){if(_0x3e04d4[_0x964b('0x11')][_0x964b('0x12')]===0x1f4){logger[_0x964b('0x11')](_0x964b('0xd'),_0x689209,_0x3e04d4[_0x964b('0x11')][_0x964b('0x13')]);return _0x11368e(_0x3e04d4[_0x964b('0x11')][_0x964b('0x13')]);}logger['error'](_0x964b('0xd'),_0x689209,_0x3e04d4['error']['message']);return _0x285f48(_0x3e04d4[_0x964b('0x11')][_0x964b('0x13')]);}else{logger[_0x964b('0x14')](_0x964b('0xd'),_0x689209,_0x964b('0xe'));_0x285f48(_0x3e04d4[_0x964b('0x15')][_0x964b('0x13')]);}})[_0x964b('0x16')](function(_0x37ffad){logger[_0x964b('0x11')](_0x964b('0xd'),_0x689209,_0x37ffad);_0x11368e(_0x37ffad);});});} \ No newline at end of file +var _0xbf25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','SalesforceField,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','util','moment'];(function(_0x134dbc,_0x40a60f){var _0x103f4a=function(_0x1d7b7a){while(--_0x1d7b7a){_0x134dbc['push'](_0x134dbc['shift']());}};_0x103f4a(++_0x40a60f);}(_0xbf25,0xb2));var _0x5bf2=function(_0x30f196,_0xba388){_0x30f196=_0x30f196-0x0;var _0x23052f=_0xbf25[_0x30f196];return _0x23052f;};'use strict';var _=require('lodash');var util=require(_0x5bf2('0x0'));var moment=require(_0x5bf2('0x1'));var BPromise=require(_0x5bf2('0x2'));var rs=require(_0x5bf2('0x3'));var fs=require('fs');var Redis=require(_0x5bf2('0x4'));var db=require(_0x5bf2('0x5'))['db'];var utils=require(_0x5bf2('0x6'));var logger=require(_0x5bf2('0x7'))(_0x5bf2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5bf2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16c002,_0x507a1b,_0x40249b){return new BPromise(function(_0x5d5783,_0x5d4ba0){return client['request'](_0x16c002,_0x40249b)[_0x5bf2('0xa')](function(_0x3944a6){logger[_0x5bf2('0xb')](_0x5bf2('0xc'),_0x507a1b,'request\x20sent');logger[_0x5bf2('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x507a1b,'request\x20sent',JSON[_0x5bf2('0xe')](_0x3944a6));if(_0x3944a6[_0x5bf2('0xf')]){if(_0x3944a6[_0x5bf2('0xf')]['code']===0x1f4){logger[_0x5bf2('0xf')]('SalesforceField,\x20%s,\x20%s',_0x507a1b,_0x3944a6['error'][_0x5bf2('0x10')]);return _0x5d4ba0(_0x3944a6['error'][_0x5bf2('0x10')]);}logger[_0x5bf2('0xf')](_0x5bf2('0xc'),_0x507a1b,_0x3944a6[_0x5bf2('0xf')][_0x5bf2('0x10')]);return _0x5d5783(_0x3944a6[_0x5bf2('0xf')]['message']);}else{logger['info'](_0x5bf2('0xc'),_0x507a1b,_0x5bf2('0x11'));_0x5d5783(_0x3944a6[_0x5bf2('0x12')][_0x5bf2('0x10')]);}})[_0x5bf2('0x13')](function(_0x41efad){logger[_0x5bf2('0xf')](_0x5bf2('0xc'),_0x507a1b,_0x41efad);_0x5d4ba0(_0x41efad);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 085544d..e02a4e6 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 _0x86f5=['post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x86f5,0x178));var _0x586f=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x86f5[_0x5c468f];return _0x2136b0;};'use strict';var multer=require(_0x586f('0x0'));var util=require('util');var path=require(_0x586f('0x1'));var timeout=require(_0x586f('0x2'));var express=require('express');var router=express[_0x586f('0x3')]();var fs_extra=require(_0x586f('0x4'));var auth=require(_0x586f('0x5'));var interaction=require(_0x586f('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x586f('0x7')]('/',auth[_0x586f('0x8')](),controller[_0x586f('0x9')]);router['get'](_0x586f('0xa'),auth[_0x586f('0x8')](),controller[_0x586f('0xb')]);router['get']('/:id/configurations',auth[_0x586f('0x8')](),controller[_0x586f('0xc')]);router[_0x586f('0x7')](_0x586f('0xd'),auth[_0x586f('0x8')](),controller[_0x586f('0xe')]);router[_0x586f('0xf')]('/',auth['isAuthenticated'](),controller[_0x586f('0x10')]);router['post'](_0x586f('0x11'),auth['isAuthenticated'](),controller[_0x586f('0x12')]);router['put'](_0x586f('0xa'),auth['isAuthenticated'](),controller[_0x586f('0x13')]);router[_0x586f('0x14')](_0x586f('0xa'),auth[_0x586f('0x8')](),controller[_0x586f('0x15')]);module[_0x586f('0x16')]=router; \ No newline at end of file +var _0x3cb9=['index','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2ccc71,_0x1c458a){var _0x20fa15=function(_0x320e61){while(--_0x320e61){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0x20fa15(++_0x1c458a);}(_0x3cb9,0x187));var _0x93cb=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x3cb9[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x93cb('0x0'));var timeout=require(_0x93cb('0x1'));var express=require(_0x93cb('0x2'));var router=express[_0x93cb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x93cb('0x4'));var config=require(_0x93cb('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x93cb('0x6')]('/',auth[_0x93cb('0x7')](),controller[_0x93cb('0x8')]);router[_0x93cb('0x6')](_0x93cb('0x9'),auth[_0x93cb('0x7')](),controller[_0x93cb('0xa')]);router[_0x93cb('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x93cb('0x6')](_0x93cb('0xb'),auth[_0x93cb('0x7')](),controller[_0x93cb('0xc')]);router['post']('/',auth[_0x93cb('0x7')](),controller[_0x93cb('0xd')]);router[_0x93cb('0xe')](_0x93cb('0xf'),auth[_0x93cb('0x7')](),controller[_0x93cb('0x10')]);router[_0x93cb('0x11')](_0x93cb('0x9'),auth[_0x93cb('0x7')](),controller[_0x93cb('0x12')]);router[_0x93cb('0x13')](_0x93cb('0x9'),auth[_0x93cb('0x7')](),controller['destroy']);module[_0x93cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ea2a32c..bdcba83 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 _0x0dfb=['STRING','remoteUri','sequelize','exports'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x0dfb,0x92));var _0xb0df=function(_0x49cfdb,_0x429954){_0x49cfdb=_0x49cfdb-0x0;var _0x28b31e=_0x0dfb[_0x49cfdb];return _0x28b31e;};'use strict';var Sequelize=require(_0xb0df('0x0'));module[_0xb0df('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb0df('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb0df('0x2')]},'email':{'type':Sequelize[_0xb0df('0x2')]},'remoteUri':{'type':Sequelize[_0xb0df('0x2')],'unique':_0xb0df('0x3')},'serverUrl':{'type':Sequelize[_0xb0df('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdedc=['username','sequelize','exports','STRING'];(function(_0x4dbc5d,_0x2d0a51){var _0x45b461=function(_0x3e73ab){while(--_0x3e73ab){_0x4dbc5d['push'](_0x4dbc5d['shift']());}};_0x45b461(++_0x2d0a51);}(_0xdedc,0xdd));var _0xcded=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xdedc[_0x2a9f4];return _0x3c39e0;};'use strict';var Sequelize=require(_0xcded('0x0'));module[_0xcded('0x1')]={'name':{'type':Sequelize[_0xcded('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xcded('0x3')},'password':{'type':Sequelize[_0xcded('0x2')]},'email':{'type':Sequelize[_0xcded('0x2')]},'remoteUri':{'type':Sequelize[_0xcded('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcded('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 302fe0d..48cd74a 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 _0xec48=['status','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','params','ServicenowAccount','merge','find','body','destroy','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','knowledge','closed_at','cmdb_ci','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','description','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','company','reassignment_count','activity_due','sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x1e0e40,_0x29528e){var _0x6b882a=function(_0x5cb1ab){while(--_0x5cb1ab){_0x1e0e40['push'](_0x1e0e40['shift']());}};_0x6b882a(++_0x29528e);}(_0xec48,0x99));var _0x8ec4=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xec48[_0x3a0ebd];return _0x51a660;};'use strict';var emlformat=require(_0x8ec4('0x0'));var rimraf=require(_0x8ec4('0x1'));var zipdir=require(_0x8ec4('0x2'));var jsonpatch=require(_0x8ec4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8ec4('0x4'));var Mustache=require(_0x8ec4('0x5'));var util=require('util');var path=require(_0x8ec4('0x6'));var sox=require(_0x8ec4('0x7'));var csv=require(_0x8ec4('0x8'));var ejs=require(_0x8ec4('0x9'));var fs=require('fs');var fs_extra=require(_0x8ec4('0xa'));var _=require(_0x8ec4('0xb'));var squel=require('squel');var crypto=require(_0x8ec4('0xc'));var jsforce=require(_0x8ec4('0xd'));var deskjs=require(_0x8ec4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8ec4('0xf'));var Papa=require('papaparse');var Redis=require(_0x8ec4('0x10'));var authService=require(_0x8ec4('0x11'));var qs=require(_0x8ec4('0x12'));var as=require(_0x8ec4('0x13'));var hardwareService=require(_0x8ec4('0x14'));var logger=require('../../config/logger')(_0x8ec4('0x15'));var utils=require(_0x8ec4('0x16'));var config=require(_0x8ec4('0x17'));var licenseUtil=require(_0x8ec4('0x18'));var db=require(_0x8ec4('0x19'))['db'];var integrations=require(_0x8ec4('0x1a'));function respondWithStatusCode(_0x46eb36,_0x4ebc51){_0x4ebc51=_0x4ebc51||0xcc;return function(_0x4ffaa3){if(_0x4ffaa3){return _0x46eb36[_0x8ec4('0x1b')](_0x4ebc51);}return _0x46eb36['status'](_0x4ebc51)['end']();};}function respondWithResult(_0x3368bd,_0x51d988){_0x51d988=_0x51d988||0xc8;return function(_0x1d0567){if(_0x1d0567){return _0x3368bd[_0x8ec4('0x1c')](_0x51d988)[_0x8ec4('0x1d')](_0x1d0567);}};}function respondWithFilteredResult(_0x7a6f58,_0x15502a){return function(_0xb1e862){if(_0xb1e862){var _0x14464e=typeof _0x15502a[_0x8ec4('0x1e')]===_0x8ec4('0x1f')&&typeof _0x15502a[_0x8ec4('0x20')]===_0x8ec4('0x1f');var _0x3aa3e1=_0xb1e862['count'];var _0x135341=_0x14464e?0x0:_0x15502a[_0x8ec4('0x1e')];var _0x42a207=_0x14464e?_0xb1e862[_0x8ec4('0x21')]:_0x15502a[_0x8ec4('0x1e')]+_0x15502a[_0x8ec4('0x20')];var _0x845bfc;if(_0x42a207>=_0x3aa3e1){_0x42a207=_0x3aa3e1;_0x845bfc=0xc8;}else{_0x845bfc=0xce;}_0x7a6f58[_0x8ec4('0x1c')](_0x845bfc);return _0x7a6f58[_0x8ec4('0x22')]('Content-Range',_0x135341+'-'+_0x42a207+'/'+_0x3aa3e1)[_0x8ec4('0x1d')](_0xb1e862);}return null;};}function patchUpdates(_0x4f98e6){return function(_0x4adc58){try{jsonpatch[_0x8ec4('0x23')](_0x4adc58,_0x4f98e6,!![]);}catch(_0x31d7d0){return BPromise[_0x8ec4('0x24')](_0x31d7d0);}return _0x4adc58['save']();};}function saveUpdates(_0x11c7e3,_0x4fb324){return function(_0x347046){if(_0x347046){return _0x347046['update'](_0x11c7e3)['then'](function(_0x187c81){return _0x187c81;});}return null;};}function removeEntity(_0x410f1b,_0x2e2372){return function(_0x5a4ca3){if(_0x5a4ca3){return _0x5a4ca3['destroy']()[_0x8ec4('0x25')](function(){_0x410f1b[_0x8ec4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31efbc,_0x3b59c9){return function(_0x3b4929){if(!_0x3b4929){_0x31efbc[_0x8ec4('0x1b')](0x194);}return _0x3b4929;};}function handleError(_0x37509b,_0xbfd908){_0xbfd908=_0xbfd908||0x1f4;return function(_0x9d27d5){logger[_0x8ec4('0x26')](_0x9d27d5[_0x8ec4('0x27')]);if(_0x9d27d5[_0x8ec4('0x28')]){delete _0x9d27d5[_0x8ec4('0x28')];}_0x37509b[_0x8ec4('0x1c')](_0xbfd908)[_0x8ec4('0x29')](_0x9d27d5);};}exports[_0x8ec4('0x2a')]=function(_0x135b65,_0x2b6437){var _0x50a03b={},_0x2b70dd={},_0x470800={'count':0x0,'rows':[]};var _0xd2cefb=_[_0x8ec4('0x2b')](db['ServicenowAccount'][_0x8ec4('0x2c')],function(_0x305929){return{'name':_0x305929['fieldName'],'type':_0x305929[_0x8ec4('0x2d')][_0x8ec4('0x2e')]};});_0x2b70dd[_0x8ec4('0x2f')]=_[_0x8ec4('0x2b')](_0xd2cefb,'name');_0x2b70dd[_0x8ec4('0x30')]=_[_0x8ec4('0x31')](_0x135b65['query']);_0x2b70dd[_0x8ec4('0x32')]=_[_0x8ec4('0x33')](_0x2b70dd[_0x8ec4('0x2f')],_0x2b70dd[_0x8ec4('0x30')]);_0x50a03b[_0x8ec4('0x34')]=_['intersection'](_0x2b70dd[_0x8ec4('0x2f')],qs[_0x8ec4('0x35')](_0x135b65['query'][_0x8ec4('0x35')]));_0x50a03b[_0x8ec4('0x34')]=_0x50a03b['attributes'][_0x8ec4('0x36')]?_0x50a03b['attributes']:_0x2b70dd[_0x8ec4('0x2f')];if(!_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x37')](_0x8ec4('0x38'))){_0x50a03b['limit']=qs[_0x8ec4('0x20')](_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x20')]);_0x50a03b[_0x8ec4('0x1e')]=qs[_0x8ec4('0x1e')](_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x1e')]);}_0x50a03b[_0x8ec4('0x39')]=qs['sort'](_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x3a')]);_0x50a03b[_0x8ec4('0x3b')]=qs['filters'](_[_0x8ec4('0x3c')](_0x135b65['query'],_0x2b70dd[_0x8ec4('0x32')]),_0xd2cefb);if(_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x3d')]){_0x50a03b[_0x8ec4('0x3b')]=_['merge'](_0x50a03b[_0x8ec4('0x3b')],{'$or':_[_0x8ec4('0x2b')](_0xd2cefb,function(_0x386449){if(_0x386449[_0x8ec4('0x2d')]!=='VIRTUAL'){var _0x3699c3={};_0x3699c3[_0x386449[_0x8ec4('0x28')]]={'$like':'%'+_0x135b65[_0x8ec4('0x30')][_0x8ec4('0x3d')]+'%'};return _0x3699c3;}})});}_0x50a03b=_['merge']({},_0x50a03b,_0x135b65[_0x8ec4('0x3e')]);var _0x4c7b87={'where':_0x50a03b[_0x8ec4('0x3b')]};return db['ServicenowAccount']['count'](_0x4c7b87)[_0x8ec4('0x25')](function(_0x5d33ed){_0x470800[_0x8ec4('0x21')]=_0x5d33ed;if(_0x135b65['query'][_0x8ec4('0x3f')]){_0x50a03b[_0x8ec4('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x8ec4('0x41')](_0x50a03b);})[_0x8ec4('0x25')](function(_0x7ea59f){_0x470800[_0x8ec4('0x42')]=_0x7ea59f;return _0x470800;})[_0x8ec4('0x25')](respondWithFilteredResult(_0x2b6437,_0x50a03b))[_0x8ec4('0x43')](handleError(_0x2b6437,null));};exports['show']=function(_0x514cc2,_0x411b02){var _0x1057ed={'raw':![],'where':{'id':_0x514cc2[_0x8ec4('0x44')]['id']}},_0x47db6e={};_0x47db6e[_0x8ec4('0x2f')]=_[_0x8ec4('0x31')](db[_0x8ec4('0x45')][_0x8ec4('0x2c')]);_0x47db6e[_0x8ec4('0x30')]=_['keys'](_0x514cc2['query']);_0x47db6e[_0x8ec4('0x32')]=_[_0x8ec4('0x33')](_0x47db6e[_0x8ec4('0x2f')],_0x47db6e['query']);_0x1057ed[_0x8ec4('0x34')]=_[_0x8ec4('0x33')](_0x47db6e[_0x8ec4('0x2f')],qs['fields'](_0x514cc2[_0x8ec4('0x30')][_0x8ec4('0x35')]));_0x1057ed[_0x8ec4('0x34')]=_0x1057ed[_0x8ec4('0x34')][_0x8ec4('0x36')]?_0x1057ed[_0x8ec4('0x34')]:_0x47db6e[_0x8ec4('0x2f')];if(_0x514cc2['query'][_0x8ec4('0x3f')]){_0x1057ed[_0x8ec4('0x40')]=[{'all':!![]}];}_0x1057ed=_[_0x8ec4('0x46')]({},_0x1057ed,_0x514cc2[_0x8ec4('0x3e')]);return db[_0x8ec4('0x45')][_0x8ec4('0x47')](_0x1057ed)['then'](handleEntityNotFound(_0x411b02,null))['then'](respondWithResult(_0x411b02,null))[_0x8ec4('0x43')](handleError(_0x411b02,null));};exports['create']=function(_0x28af5b,_0x2b37ce){return db[_0x8ec4('0x45')]['create'](_0x28af5b[_0x8ec4('0x48')],{})[_0x8ec4('0x25')](respondWithResult(_0x2b37ce,0xc9))[_0x8ec4('0x43')](handleError(_0x2b37ce,null));};exports['update']=function(_0x1fc9f0,_0x136d0c){if(_0x1fc9f0[_0x8ec4('0x48')]['id']){delete _0x1fc9f0[_0x8ec4('0x48')]['id'];}return db[_0x8ec4('0x45')][_0x8ec4('0x47')]({'where':{'id':_0x1fc9f0['params']['id']}})[_0x8ec4('0x25')](handleEntityNotFound(_0x136d0c,null))[_0x8ec4('0x25')](saveUpdates(_0x1fc9f0['body'],null))[_0x8ec4('0x25')](respondWithResult(_0x136d0c,null))[_0x8ec4('0x43')](handleError(_0x136d0c,null));};exports[_0x8ec4('0x49')]=function(_0x59a057,_0xd3202d){return db['ServicenowAccount'][_0x8ec4('0x47')]({'where':{'id':_0x59a057[_0x8ec4('0x44')]['id']}})['then'](handleEntityNotFound(_0xd3202d,null))[_0x8ec4('0x25')](removeEntity(_0xd3202d,null))[_0x8ec4('0x43')](handleError(_0xd3202d,null));};exports['getConfigurations']=function(_0xd13e1a,_0xf08556,_0x5b9373){var _0x491f30={};var _0x26c0b5={};var _0x5518e9;var _0x286fa8;return db['ServicenowAccount'][_0x8ec4('0x4a')]({'where':{'id':_0xd13e1a[_0x8ec4('0x44')]['id']}})[_0x8ec4('0x25')](handleEntityNotFound(_0xf08556,null))['then'](function(_0x3705a3){if(_0x3705a3){_0x5518e9=_0x3705a3;_0x26c0b5['model']=_[_0x8ec4('0x31')](db[_0x8ec4('0x4b')][_0x8ec4('0x2c')]);_0x26c0b5[_0x8ec4('0x30')]=_[_0x8ec4('0x31')](_0xd13e1a[_0x8ec4('0x30')]);_0x26c0b5[_0x8ec4('0x32')]=_['intersection'](_0x26c0b5[_0x8ec4('0x2f')],_0x26c0b5[_0x8ec4('0x30')]);_0x491f30[_0x8ec4('0x34')]=_['intersection'](_0x26c0b5[_0x8ec4('0x2f')],qs['fields'](_0xd13e1a[_0x8ec4('0x30')][_0x8ec4('0x35')]));_0x491f30[_0x8ec4('0x34')]=_0x491f30['attributes'][_0x8ec4('0x36')]?_0x491f30[_0x8ec4('0x34')]:_0x26c0b5['model'];_0x491f30['order']=qs[_0x8ec4('0x3a')](_0xd13e1a[_0x8ec4('0x30')]['sort']);_0x491f30['where']=qs[_0x8ec4('0x32')](_[_0x8ec4('0x3c')](_0xd13e1a['query'],_0x26c0b5['filters']));if(_0xd13e1a[_0x8ec4('0x30')]['filter']){_0x491f30['where']=_[_0x8ec4('0x46')](_0x491f30[_0x8ec4('0x3b')],{'$or':_[_0x8ec4('0x2b')](_0x491f30['attributes'],function(_0x2c0c66){var _0x46d695={};_0x46d695[_0x2c0c66]={'$like':'%'+_0xd13e1a['query'][_0x8ec4('0x3d')]+'%'};return _0x46d695;})});}_0x491f30=_[_0x8ec4('0x46')]({},_0x491f30,_0xd13e1a[_0x8ec4('0x3e')]);return _0x5518e9['getConfigurations'](_0x491f30);}})[_0x8ec4('0x25')](function(_0x551a11){if(_0x551a11){_0x286fa8=_0x551a11[_0x8ec4('0x36')];if(!_0xd13e1a[_0x8ec4('0x30')]['hasOwnProperty'](_0x8ec4('0x38'))){_0x491f30[_0x8ec4('0x20')]=qs[_0x8ec4('0x20')](_0xd13e1a[_0x8ec4('0x30')][_0x8ec4('0x20')]);_0x491f30[_0x8ec4('0x1e')]=qs[_0x8ec4('0x1e')](_0xd13e1a[_0x8ec4('0x30')]['offset']);}return _0x5518e9[_0x8ec4('0x4c')](_0x491f30);}})[_0x8ec4('0x25')](function(_0x13ce50){if(_0x13ce50){return _0x13ce50?{'count':_0x286fa8,'rows':_0x13ce50}:null;}})[_0x8ec4('0x25')](respondWithResult(_0xf08556,null))['catch'](handleError(_0xf08556,null));};exports[_0x8ec4('0x4d')]=function(_0x3761ce,_0x4066ab,_0x2e5c3d){if(_0x3761ce[_0x8ec4('0x48')]['id']){delete _0x3761ce[_0x8ec4('0x48')]['id'];}return db[_0x8ec4('0x45')]['findOne']({'where':{'id':_0x3761ce['params']['id']}})[_0x8ec4('0x25')](handleEntityNotFound(_0x4066ab,null))[_0x8ec4('0x25')](function(_0x1a6c0a){if(_0x1a6c0a){_0x3761ce[_0x8ec4('0x48')][_0x8ec4('0x4e')]=_0x1a6c0a['id'];_0x3761ce[_0x8ec4('0x48')][_0x8ec4('0x4f')]=integrations[_0x8ec4('0x50')](_0x3761ce['body'][_0x8ec4('0x51')],_0x3761ce[_0x8ec4('0x48')]['type']);_0x3761ce[_0x8ec4('0x48')][_0x8ec4('0x52')]=integrations[_0x8ec4('0x53')](_0x3761ce['body'][_0x8ec4('0x51')],_0x3761ce['body'][_0x8ec4('0x2d')]);return db['ServicenowConfiguration'][_0x8ec4('0x54')](_0x3761ce[_0x8ec4('0x48')],{'include':[{'model':db[_0x8ec4('0x55')],'as':_0x8ec4('0x4f')},{'model':db['ServicenowField'],'as':_0x8ec4('0x52')}]});}return null;})[_0x8ec4('0x25')](respondWithResult(_0x4066ab,null))[_0x8ec4('0x43')](handleError(_0x4066ab,null));};exports[_0x8ec4('0x56')]=function(_0x503dbb,_0x36cb36,_0x4f4b88){var _0x588d44=[_0x8ec4('0x57'),_0x8ec4('0x58'),'knowledge',_0x8ec4('0x59'),_0x8ec4('0x5a'),_0x8ec4('0x5b'),_0x8ec4('0x5c'),_0x8ec4('0x5d'),_0x8ec4('0x5e')];var _0x1ce665=['parent',_0x8ec4('0x57'),_0x8ec4('0x5f'),_0x8ec4('0x60'),_0x8ec4('0x61'),_0x8ec4('0x62'),_0x8ec4('0x63'),_0x8ec4('0x58'),_0x8ec4('0x64'),_0x8ec4('0x65'),_0x8ec4('0x66'),_0x8ec4('0x67'),_0x8ec4('0x68'),_0x8ec4('0x69'),_0x8ec4('0x6a'),_0x8ec4('0x6b'),'state','sys_created_by',_0x8ec4('0x6c'),_0x8ec4('0x39'),'calendar_stc',_0x8ec4('0x6d'),_0x8ec4('0x6e'),'delivery_plan','impact','active',_0x8ec4('0x6f'),_0x8ec4('0x70'),_0x8ec4('0x71'),_0x8ec4('0x72'),_0x8ec4('0x73'),_0x8ec4('0x74'),'expected_start',_0x8ec4('0x75'),'business_duration',_0x8ec4('0x76'),_0x8ec4('0x77'),_0x8ec4('0x78'),_0x8ec4('0x79'),_0x8ec4('0x7a'),_0x8ec4('0x7b'),_0x8ec4('0x59'),_0x8ec4('0x7c'),_0x8ec4('0x7d'),'close_code',_0x8ec4('0x7e'),_0x8ec4('0x7f'),'work_start',_0x8ec4('0x80'),'business_stc','additional_assignee_list',_0x8ec4('0x81'),'calendar_duration',_0x8ec4('0x5b'),'sys_class_name',_0x8ec4('0x82'),'closed_by',_0x8ec4('0x83'),_0x8ec4('0x84'),_0x8ec4('0x85'),_0x8ec4('0x86'),_0x8ec4('0x87'),_0x8ec4('0x5c'),'urgency','problem_id',_0x8ec4('0x88'),_0x8ec4('0x89'),_0x8ec4('0x8a'),'assigned_to','severity','comments',_0x8ec4('0x8b'),_0x8ec4('0x8c'),'comments_and_work_notes','due_date',_0x8ec4('0x8d'),'reopen_count',_0x8ec4('0x8e'),_0x8ec4('0x8f'),_0x8ec4('0x90'),_0x8ec4('0x91'),_0x8ec4('0x92'),'category'];var _0x1b0ad0='';var _0x201b0f='';var _0xfc029d=[];var _0x559255='';var _0xc555a2='';var _0x44299e=[];var _0x3018ba='';var _0x1b5b4e='';var _0x54e16d={};var _0x30e6f0='';return db[_0x8ec4('0x45')][_0x8ec4('0x4a')]({'where':{'id':_0x503dbb[_0x8ec4('0x44')]['id']},'attributes':['id',_0x8ec4('0x93'),_0x8ec4('0x94'),'email',_0x8ec4('0x95'),_0x8ec4('0x96')]})[_0x8ec4('0x25')](handleEntityNotFound(_0x36cb36,null))[_0x8ec4('0x25')](function(_0x5249ca){if(_0x5249ca){_0x30e6f0=_0x5249ca['remoteUri'];var _0x1985e2=_0x30e6f0[_0x8ec4('0x97')](-0x1);if(_0x1985e2==='/'){_0x30e6f0=_0x30e6f0['substring'](0x0,_0x30e6f0[_0x8ec4('0x98')](_0x1985e2));}_0x1b5b4e=util[_0x8ec4('0x99')](_0x8ec4('0x9a'),_0x30e6f0);_0x3018ba=util['format'](_0x8ec4('0x9b'),_0x30e6f0);_0x54e16d={'user':_0x5249ca['username'],'pass':_0x5249ca[_0x8ec4('0x94')]};var _0xff9029={'method':_0x8ec4('0x9c'),'uri':_0x1b5b4e+_0x8ec4('0x9d'),'auth':_0x54e16d,'json':!![]};return rp(_0xff9029);}})[_0x8ec4('0x25')](function(_0x42083e){if(_0x42083e[_0x8ec4('0x9e')]['length']>0x0){_0x1b0ad0=_0x42083e['result'];}console[_0x8ec4('0x9f')](_0x8ec4('0xa0'),_0x1b0ad0);_0x44299e=[];_0x201b0f=Object[_0x8ec4('0xa1')]([],_0x1b0ad0);_[_0x8ec4('0xa2')](_0x201b0f,function(_0x3bc1bb){return!_0x588d44['includes'](_0x3bc1bb[_0x8ec4('0x28')]);});_0x201b0f[_0x8ec4('0xa3')](function(_0x3efc94){var _0x56923c=createFieldObject(_0x3018ba,_0x54e16d,_0x3efc94[_0x8ec4('0xa4')],_0x3efc94[_0x8ec4('0x28')],_0x3efc94[_0x8ec4('0xa5')],![]);_0x44299e[_0x8ec4('0xa6')](_0x56923c);});return Promise['all'](_0x44299e);})['then'](function(_0x59155e){_0xfc029d=_0x59155e;_0x559255=Object['assign']([],_0x1b0ad0);console[_0x8ec4('0x9f')](_0x8ec4('0xa7'),_0x1b0ad0);_[_0x8ec4('0xa2')](_0x559255,function(_0x42893e){return _0x1ce665['includes'](_0x42893e[_0x8ec4('0x28')]);});console[_0x8ec4('0x9f')](_0x8ec4('0xa8'),_0x559255);_0x44299e=[];_0x559255[_0x8ec4('0xa3')](function(_0x3ef3f4){var _0x5e4e5e=createFieldObject(_0x3018ba,_0x54e16d,_0x3ef3f4[_0x8ec4('0xa4')],_0x3ef3f4['name'],_0x3ef3f4[_0x8ec4('0xa5')],!![]);_0x44299e[_0x8ec4('0xa6')](_0x5e4e5e);});return Promise[_0x8ec4('0xa9')](_0x44299e);})[_0x8ec4('0x25')](function(_0x2b0cd9){_0xc555a2=_0x2b0cd9;var _0x2aeb69=_0xfc029d[_0x8ec4('0xaa')](_0xc555a2);return{'count':_0x2aeb69[_0x8ec4('0x36')],'rows':_0x2aeb69};})[_0x8ec4('0x25')](respondWithResult(_0x36cb36,null))['catch'](function(_0x5c1df5){console[_0x8ec4('0x9f')](_0x8ec4('0xab')+_0x5c1df5);var _0x2eddf5=_0x503dbb[_0x8ec4('0x30')][_0x8ec4('0xac')]?0x1f4:_0x5c1df5[_0x8ec4('0xad')]||0x1f4;logger[_0x8ec4('0x26')](_0x5c1df5[_0x8ec4('0x27')]);delete _0x5c1df5[_0x8ec4('0x28')];if(_0x2eddf5===0x191){_0x2eddf5=0x190;}_0x36cb36['status'](_0x2eddf5)[_0x8ec4('0x29')](_0x503dbb[_0x8ec4('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5c1df5[_0x8ec4('0xad')]}:_0x5c1df5);});};function createFieldObject(_0x50dc24,_0x3c4cdf,_0x5617b1,_0x20f2ae,_0x2df8f6,_0xb49a61){return new Promise(function(_0x36d4a2,_0x367f66){var _0x224a49={'id':_0x20f2ae,'name':_0x2df8f6,'custom':_0xb49a61};if(_0x5617b1===_0x8ec4('0xae')){_0x224a49['options']=[{'name':_0x8ec4('0xaf'),'value':_0x8ec4('0xb0')},{'name':_0x8ec4('0xb1'),'value':_0x8ec4('0xb2')}];_0x36d4a2(_0x224a49);}else{var _0x2f37e8={'method':_0x8ec4('0x9c'),'uri':_0x50dc24+_0x8ec4('0xb3')+_0x20f2ae,'auth':_0x3c4cdf,'json':!![]};return rp(_0x2f37e8)['then'](function(_0x52c3ed){var _0x85ad6=[];if(_0x52c3ed['result'][_0x8ec4('0x36')]>0x0){_0x52c3ed[_0x8ec4('0x9e')][_0x8ec4('0xa3')](function(_0xd2c835){if(_0xd2c835[_0x8ec4('0xb4')]===_0x8ec4('0xb2')){var _0x4851a2={'name':_0xd2c835[_0x8ec4('0xa5')],'value':_0xd2c835['value']};_0x85ad6[_0x8ec4('0xa6')](_0x4851a2);}});}_0x224a49[_0x8ec4('0x3e')]=_0x85ad6;if(_0x224a49[_0x8ec4('0x3e')][_0x8ec4('0x36')]>0x0){_0x36d4a2(_0x224a49);}else{if(_0xb49a61==![]){_0x36d4a2();}else{_0x36d4a2(_0x224a49);}}});}});} \ No newline at end of file +var _0xa224=['sys_choice?sysparm_query=name=incident^element=','result','inactive','value','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','map','ServicenowAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','include','findAll','show','includeAll','find','catch','create','body','params','getConfigurations','ServicenowConfiguration','length','addConfiguration','AccountId','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','knowledge','subcategory','notify','severity','category','parent','watch_list','upon_reject','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','calendar_stc','closed_at','cmdb_ci','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','log','incident\x20table\x20objects','remove','includes','forEach','label','TCL:\x20_object','internalType','push','all','concat','ServiceNow\x20error:\x20','test','error','Wrong\x20credentials','true','False','false'];(function(_0x12f9a7,_0x1b2f68){var _0xa89a94=function(_0xbca23b){while(--_0xbca23b){_0x12f9a7['push'](_0x12f9a7['shift']());}};_0xa89a94(++_0x1b2f68);}(_0xa224,0xb0));var _0x4a22=function(_0x38e275,_0x418a59){_0x38e275=_0x38e275-0x0;var _0x14ee01=_0xa224[_0x38e275];return _0x14ee01;};'use strict';var emlformat=require(_0x4a22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a22('0x1'));var jsonpatch=require(_0x4a22('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a22('0x3'));var Mustache=require(_0x4a22('0x4'));var util=require(_0x4a22('0x5'));var path=require('path');var sox=require(_0x4a22('0x6'));var csv=require(_0x4a22('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a22('0x8'));var _=require(_0x4a22('0x9'));var squel=require(_0x4a22('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a22('0xb'));var toCsv=require(_0x4a22('0x7'));var querystring=require(_0x4a22('0xc'));var Papa=require(_0x4a22('0xd'));var Redis=require(_0x4a22('0xe'));var authService=require(_0x4a22('0xf'));var qs=require(_0x4a22('0x10'));var as=require(_0x4a22('0x11'));var hardwareService=require(_0x4a22('0x12'));var logger=require(_0x4a22('0x13'))('api');var utils=require(_0x4a22('0x14'));var config=require(_0x4a22('0x15'));var licenseUtil=require(_0x4a22('0x16'));var db=require(_0x4a22('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2427ed,_0x3961d7){_0x3961d7=_0x3961d7||0xcc;return function(_0x25d162){if(_0x25d162){return _0x2427ed['sendStatus'](_0x3961d7);}return _0x2427ed[_0x4a22('0x18')](_0x3961d7)[_0x4a22('0x19')]();};}function respondWithResult(_0x47a70a,_0x12e634){_0x12e634=_0x12e634||0xc8;return function(_0x53d6bb){if(_0x53d6bb){return _0x47a70a[_0x4a22('0x18')](_0x12e634)[_0x4a22('0x1a')](_0x53d6bb);}};}function respondWithFilteredResult(_0x3be4d5,_0x3f07ae){return function(_0x51ce90){if(_0x51ce90){var _0x5752ad=typeof _0x3f07ae[_0x4a22('0x1b')]===_0x4a22('0x1c')&&typeof _0x3f07ae[_0x4a22('0x1d')]===_0x4a22('0x1c');var _0x19edc7=_0x51ce90['count'];var _0x2e13ef=_0x5752ad?0x0:_0x3f07ae[_0x4a22('0x1b')];var _0x415dcf=_0x5752ad?_0x51ce90[_0x4a22('0x1e')]:_0x3f07ae[_0x4a22('0x1b')]+_0x3f07ae['limit'];var _0x4015bb;if(_0x415dcf>=_0x19edc7){_0x415dcf=_0x19edc7;_0x4015bb=0xc8;}else{_0x4015bb=0xce;}_0x3be4d5[_0x4a22('0x18')](_0x4015bb);return _0x3be4d5[_0x4a22('0x1f')](_0x4a22('0x20'),_0x2e13ef+'-'+_0x415dcf+'/'+_0x19edc7)[_0x4a22('0x1a')](_0x51ce90);}return null;};}function patchUpdates(_0x1c27b1){return function(_0x26a4fa){try{jsonpatch[_0x4a22('0x21')](_0x26a4fa,_0x1c27b1,!![]);}catch(_0x5b0e0b){return BPromise['reject'](_0x5b0e0b);}return _0x26a4fa[_0x4a22('0x22')]();};}function saveUpdates(_0x4979f3,_0x4acbca){return function(_0x4eee9a){if(_0x4eee9a){return _0x4eee9a[_0x4a22('0x23')](_0x4979f3)['then'](function(_0x16bffc){return _0x16bffc;});}return null;};}function removeEntity(_0x35fbc0,_0x5a7492){return function(_0x963f40){if(_0x963f40){return _0x963f40[_0x4a22('0x24')]()['then'](function(){_0x35fbc0[_0x4a22('0x18')](0xcc)[_0x4a22('0x19')]();});}};}function handleEntityNotFound(_0x1062c2,_0x578320){return function(_0x379751){if(!_0x379751){_0x1062c2['sendStatus'](0x194);}return _0x379751;};}function handleError(_0x54d6b4,_0x4ce047){_0x4ce047=_0x4ce047||0x1f4;return function(_0x2f9fc){logger['error'](_0x2f9fc[_0x4a22('0x25')]);if(_0x2f9fc[_0x4a22('0x26')]){delete _0x2f9fc[_0x4a22('0x26')];}_0x54d6b4[_0x4a22('0x18')](_0x4ce047)['send'](_0x2f9fc);};}exports['index']=function(_0x1dee59,_0x53d206){var _0x2432c9={},_0x4e3c04={},_0x3dc839={'count':0x0,'rows':[]};var _0x48975c=_[_0x4a22('0x27')](db[_0x4a22('0x28')][_0x4a22('0x29')],function(_0x3d3315){return{'name':_0x3d3315['fieldName'],'type':_0x3d3315[_0x4a22('0x2a')]['key']};});_0x4e3c04[_0x4a22('0x2b')]=_[_0x4a22('0x27')](_0x48975c,'name');_0x4e3c04[_0x4a22('0x2c')]=_[_0x4a22('0x2d')](_0x1dee59['query']);_0x4e3c04[_0x4a22('0x2e')]=_[_0x4a22('0x2f')](_0x4e3c04[_0x4a22('0x2b')],_0x4e3c04[_0x4a22('0x2c')]);_0x2432c9[_0x4a22('0x30')]=_[_0x4a22('0x2f')](_0x4e3c04[_0x4a22('0x2b')],qs[_0x4a22('0x31')](_0x1dee59['query'][_0x4a22('0x31')]));_0x2432c9[_0x4a22('0x30')]=_0x2432c9[_0x4a22('0x30')]['length']?_0x2432c9[_0x4a22('0x30')]:_0x4e3c04[_0x4a22('0x2b')];if(!_0x1dee59[_0x4a22('0x2c')][_0x4a22('0x32')](_0x4a22('0x33'))){_0x2432c9['limit']=qs[_0x4a22('0x1d')](_0x1dee59[_0x4a22('0x2c')]['limit']);_0x2432c9[_0x4a22('0x1b')]=qs[_0x4a22('0x1b')](_0x1dee59['query'][_0x4a22('0x1b')]);}_0x2432c9[_0x4a22('0x34')]=qs['sort'](_0x1dee59['query'][_0x4a22('0x35')]);_0x2432c9[_0x4a22('0x36')]=qs['filters'](_[_0x4a22('0x37')](_0x1dee59['query'],_0x4e3c04[_0x4a22('0x2e')]),_0x48975c);if(_0x1dee59[_0x4a22('0x2c')][_0x4a22('0x38')]){_0x2432c9[_0x4a22('0x36')]=_[_0x4a22('0x39')](_0x2432c9[_0x4a22('0x36')],{'$or':_[_0x4a22('0x27')](_0x48975c,function(_0x59d3f5){if(_0x59d3f5[_0x4a22('0x2a')]!=='VIRTUAL'){var _0x19a0de={};_0x19a0de[_0x59d3f5[_0x4a22('0x26')]]={'$like':'%'+_0x1dee59['query'][_0x4a22('0x38')]+'%'};return _0x19a0de;}})});}_0x2432c9=_[_0x4a22('0x39')]({},_0x2432c9,_0x1dee59[_0x4a22('0x3a')]);var _0x149699={'where':_0x2432c9[_0x4a22('0x36')]};return db[_0x4a22('0x28')]['count'](_0x149699)[_0x4a22('0x3b')](function(_0x35928b){_0x3dc839[_0x4a22('0x1e')]=_0x35928b;if(_0x1dee59[_0x4a22('0x2c')]['includeAll']){_0x2432c9[_0x4a22('0x3c')]=[{'all':!![]}];}return db[_0x4a22('0x28')][_0x4a22('0x3d')](_0x2432c9);})[_0x4a22('0x3b')](function(_0xf3ebf1){_0x3dc839['rows']=_0xf3ebf1;return _0x3dc839;})[_0x4a22('0x3b')](respondWithFilteredResult(_0x53d206,_0x2432c9))['catch'](handleError(_0x53d206,null));};exports[_0x4a22('0x3e')]=function(_0x24dcad,_0x292762){var _0x4acf3a={'raw':![],'where':{'id':_0x24dcad['params']['id']}},_0x33d602={};_0x33d602[_0x4a22('0x2b')]=_['keys'](db[_0x4a22('0x28')][_0x4a22('0x29')]);_0x33d602[_0x4a22('0x2c')]=_[_0x4a22('0x2d')](_0x24dcad['query']);_0x33d602[_0x4a22('0x2e')]=_['intersection'](_0x33d602[_0x4a22('0x2b')],_0x33d602[_0x4a22('0x2c')]);_0x4acf3a['attributes']=_[_0x4a22('0x2f')](_0x33d602['model'],qs['fields'](_0x24dcad[_0x4a22('0x2c')][_0x4a22('0x31')]));_0x4acf3a['attributes']=_0x4acf3a[_0x4a22('0x30')]['length']?_0x4acf3a['attributes']:_0x33d602[_0x4a22('0x2b')];if(_0x24dcad[_0x4a22('0x2c')][_0x4a22('0x3f')]){_0x4acf3a[_0x4a22('0x3c')]=[{'all':!![]}];}_0x4acf3a=_[_0x4a22('0x39')]({},_0x4acf3a,_0x24dcad[_0x4a22('0x3a')]);return db[_0x4a22('0x28')][_0x4a22('0x40')](_0x4acf3a)[_0x4a22('0x3b')](handleEntityNotFound(_0x292762,null))[_0x4a22('0x3b')](respondWithResult(_0x292762,null))[_0x4a22('0x41')](handleError(_0x292762,null));};exports[_0x4a22('0x42')]=function(_0x4b831f,_0x47d4a9){return db[_0x4a22('0x28')]['create'](_0x4b831f[_0x4a22('0x43')],{})[_0x4a22('0x3b')](respondWithResult(_0x47d4a9,0xc9))[_0x4a22('0x41')](handleError(_0x47d4a9,null));};exports[_0x4a22('0x23')]=function(_0x46fef4,_0x5d91e0){if(_0x46fef4[_0x4a22('0x43')]['id']){delete _0x46fef4[_0x4a22('0x43')]['id'];}return db[_0x4a22('0x28')]['find']({'where':{'id':_0x46fef4[_0x4a22('0x44')]['id']}})[_0x4a22('0x3b')](handleEntityNotFound(_0x5d91e0,null))[_0x4a22('0x3b')](saveUpdates(_0x46fef4['body'],null))[_0x4a22('0x3b')](respondWithResult(_0x5d91e0,null))['catch'](handleError(_0x5d91e0,null));};exports[_0x4a22('0x24')]=function(_0x49d476,_0xc1b44c){return db[_0x4a22('0x28')][_0x4a22('0x40')]({'where':{'id':_0x49d476['params']['id']}})[_0x4a22('0x3b')](handleEntityNotFound(_0xc1b44c,null))['then'](removeEntity(_0xc1b44c,null))['catch'](handleError(_0xc1b44c,null));};exports[_0x4a22('0x45')]=function(_0x41bd8c,_0x449afe,_0x2517c0){var _0x45b1bf={};var _0x44f35e={};var _0x4008e7;var _0x31bea5;return db['ServicenowAccount']['findOne']({'where':{'id':_0x41bd8c['params']['id']}})['then'](handleEntityNotFound(_0x449afe,null))[_0x4a22('0x3b')](function(_0x4ee144){if(_0x4ee144){_0x4008e7=_0x4ee144;_0x44f35e[_0x4a22('0x2b')]=_['keys'](db[_0x4a22('0x46')]['rawAttributes']);_0x44f35e['query']=_['keys'](_0x41bd8c[_0x4a22('0x2c')]);_0x44f35e[_0x4a22('0x2e')]=_[_0x4a22('0x2f')](_0x44f35e[_0x4a22('0x2b')],_0x44f35e[_0x4a22('0x2c')]);_0x45b1bf[_0x4a22('0x30')]=_[_0x4a22('0x2f')](_0x44f35e[_0x4a22('0x2b')],qs[_0x4a22('0x31')](_0x41bd8c[_0x4a22('0x2c')]['fields']));_0x45b1bf[_0x4a22('0x30')]=_0x45b1bf[_0x4a22('0x30')][_0x4a22('0x47')]?_0x45b1bf['attributes']:_0x44f35e['model'];_0x45b1bf[_0x4a22('0x34')]=qs[_0x4a22('0x35')](_0x41bd8c['query'][_0x4a22('0x35')]);_0x45b1bf[_0x4a22('0x36')]=qs[_0x4a22('0x2e')](_[_0x4a22('0x37')](_0x41bd8c[_0x4a22('0x2c')],_0x44f35e['filters']));if(_0x41bd8c[_0x4a22('0x2c')][_0x4a22('0x38')]){_0x45b1bf[_0x4a22('0x36')]=_[_0x4a22('0x39')](_0x45b1bf[_0x4a22('0x36')],{'$or':_[_0x4a22('0x27')](_0x45b1bf[_0x4a22('0x30')],function(_0x57c922){var _0x391f4a={};_0x391f4a[_0x57c922]={'$like':'%'+_0x41bd8c['query'][_0x4a22('0x38')]+'%'};return _0x391f4a;})});}_0x45b1bf=_[_0x4a22('0x39')]({},_0x45b1bf,_0x41bd8c[_0x4a22('0x3a')]);return _0x4008e7[_0x4a22('0x45')](_0x45b1bf);}})[_0x4a22('0x3b')](function(_0xf4899a){if(_0xf4899a){_0x31bea5=_0xf4899a[_0x4a22('0x47')];if(!_0x41bd8c[_0x4a22('0x2c')]['hasOwnProperty'](_0x4a22('0x33'))){_0x45b1bf[_0x4a22('0x1d')]=qs[_0x4a22('0x1d')](_0x41bd8c[_0x4a22('0x2c')][_0x4a22('0x1d')]);_0x45b1bf[_0x4a22('0x1b')]=qs['offset'](_0x41bd8c[_0x4a22('0x2c')][_0x4a22('0x1b')]);}return _0x4008e7[_0x4a22('0x45')](_0x45b1bf);}})[_0x4a22('0x3b')](function(_0x3c37dd){if(_0x3c37dd){return _0x3c37dd?{'count':_0x31bea5,'rows':_0x3c37dd}:null;}})['then'](respondWithResult(_0x449afe,null))[_0x4a22('0x41')](handleError(_0x449afe,null));};exports[_0x4a22('0x48')]=function(_0x32871e,_0x233aa2,_0x1054f0){if(_0x32871e[_0x4a22('0x43')]['id']){delete _0x32871e[_0x4a22('0x43')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x32871e['params']['id']}})[_0x4a22('0x3b')](handleEntityNotFound(_0x233aa2,null))[_0x4a22('0x3b')](function(_0x51e551){if(_0x51e551){_0x32871e[_0x4a22('0x43')][_0x4a22('0x49')]=_0x51e551['id'];_0x32871e[_0x4a22('0x43')]['Subjects']=integrations['getSubjects'](_0x32871e[_0x4a22('0x43')][_0x4a22('0x4a')],_0x32871e['body'][_0x4a22('0x2a')]);_0x32871e[_0x4a22('0x43')]['Descriptions']=integrations[_0x4a22('0x4b')](_0x32871e[_0x4a22('0x43')][_0x4a22('0x4a')],_0x32871e[_0x4a22('0x43')][_0x4a22('0x2a')]);return db[_0x4a22('0x46')][_0x4a22('0x42')](_0x32871e['body'],{'include':[{'model':db[_0x4a22('0x4c')],'as':'Subjects'},{'model':db[_0x4a22('0x4c')],'as':_0x4a22('0x4d')}]});}return null;})['then'](respondWithResult(_0x233aa2,null))[_0x4a22('0x41')](handleError(_0x233aa2,null));};exports[_0x4a22('0x4e')]=function(_0x16445a,_0x693142,_0x1e486a){var _0x499950=[_0x4a22('0x4f'),'hold_reason',_0x4a22('0x50'),_0x4a22('0x51'),'close_code',_0x4a22('0x52'),'incident_state',_0x4a22('0x53'),_0x4a22('0x54')];var _0x1a1264=[_0x4a22('0x55'),_0x4a22('0x4f'),'caused_by',_0x4a22('0x56'),_0x4a22('0x57'),'sys_updated_on',_0x4a22('0x58'),'hold_reason',_0x4a22('0x59'),'number',_0x4a22('0x5a'),_0x4a22('0x5b'),_0x4a22('0x5c'),_0x4a22('0x5d'),_0x4a22('0x5e'),'sys_domain',_0x4a22('0x5f'),'sys_created_by',_0x4a22('0x50'),_0x4a22('0x34'),_0x4a22('0x60'),_0x4a22('0x61'),_0x4a22('0x62'),'delivery_plan','impact','active',_0x4a22('0x63'),_0x4a22('0x64'),_0x4a22('0x65'),_0x4a22('0x66'),'rfc',_0x4a22('0x67'),_0x4a22('0x68'),'opened_at',_0x4a22('0x69'),'group_list','work_end',_0x4a22('0x6a'),_0x4a22('0x6b'),_0x4a22('0x6c'),_0x4a22('0x6d'),_0x4a22('0x51'),_0x4a22('0x6e'),_0x4a22('0x6f'),_0x4a22('0x70'),_0x4a22('0x71'),_0x4a22('0x72'),_0x4a22('0x73'),'assignment_group','business_stc',_0x4a22('0x74'),_0x4a22('0x75'),_0x4a22('0x76'),_0x4a22('0x52'),_0x4a22('0x77'),_0x4a22('0x78'),'closed_by',_0x4a22('0x79'),'parent_incident',_0x4a22('0x7a'),'contact_type',_0x4a22('0x7b'),_0x4a22('0x7c'),_0x4a22('0x7d'),_0x4a22('0x7e'),_0x4a22('0x7f'),_0x4a22('0x80'),_0x4a22('0x81'),_0x4a22('0x82'),_0x4a22('0x53'),_0x4a22('0x83'),_0x4a22('0x84'),_0x4a22('0x85'),'comments_and_work_notes',_0x4a22('0x86'),_0x4a22('0x87'),_0x4a22('0x88'),_0x4a22('0x89'),_0x4a22('0x8a'),_0x4a22('0x8b'),_0x4a22('0x8c'),_0x4a22('0x8d'),'category'];var _0x3cfbab='';var _0x4aa2e9='';var _0x49eae8=[];var _0x28c7c7='';var _0x2e8342='';var _0x497e8e=[];var _0x2bba45='';var _0x5bea2a='';var _0x4aba5c={};var _0x25d573='';return db[_0x4a22('0x28')]['findOne']({'where':{'id':_0x16445a[_0x4a22('0x44')]['id']},'attributes':['id','username','password','email',_0x4a22('0x8e'),'serverUrl']})[_0x4a22('0x3b')](handleEntityNotFound(_0x693142,null))['then'](function(_0x555293){if(_0x555293){_0x25d573=_0x555293[_0x4a22('0x8e')];var _0x4c0d89=_0x25d573[_0x4a22('0x8f')](-0x1);if(_0x4c0d89==='/'){_0x25d573=_0x25d573[_0x4a22('0x90')](0x0,_0x25d573[_0x4a22('0x91')](_0x4c0d89));}_0x5bea2a=util['format']('%s/api/now/doc/table/schema/',_0x25d573);_0x2bba45=util[_0x4a22('0x92')](_0x4a22('0x93'),_0x25d573);_0x4aba5c={'user':_0x555293['username'],'pass':_0x555293[_0x4a22('0x94')]};var _0x14783c={'method':_0x4a22('0x95'),'uri':_0x5bea2a+'incident?sysparm_display_value=all','auth':_0x4aba5c,'json':!![]};return rp(_0x14783c);}})['then'](function(_0x3f327d){if(_0x3f327d['result']['length']>0x0){_0x3cfbab=_0x3f327d['result'];}console[_0x4a22('0x96')](_0x4a22('0x97'),_0x3cfbab);_0x497e8e=[];_0x4aa2e9=Object['assign']([],_0x3cfbab);_[_0x4a22('0x98')](_0x4aa2e9,function(_0x4447fc){return!_0x499950[_0x4a22('0x99')](_0x4447fc[_0x4a22('0x26')]);});_0x4aa2e9[_0x4a22('0x9a')](function(_0x3d4253){var _0x593252=createFieldObject(_0x2bba45,_0x4aba5c,_0x3d4253['internalType'],_0x3d4253[_0x4a22('0x26')],_0x3d4253[_0x4a22('0x9b')],![]);_0x497e8e['push'](_0x593252);});return Promise['all'](_0x497e8e);})[_0x4a22('0x3b')](function(_0x55a460){_0x49eae8=_0x55a460;_0x28c7c7=Object['assign']([],_0x3cfbab);console[_0x4a22('0x96')](_0x4a22('0x9c'),_0x3cfbab);_['remove'](_0x28c7c7,function(_0x1ea4e8){return _0x1a1264[_0x4a22('0x99')](_0x1ea4e8[_0x4a22('0x26')]);});console[_0x4a22('0x96')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x28c7c7);_0x497e8e=[];_0x28c7c7[_0x4a22('0x9a')](function(_0xbd4bda){var _0x105ad9=createFieldObject(_0x2bba45,_0x4aba5c,_0xbd4bda[_0x4a22('0x9d')],_0xbd4bda[_0x4a22('0x26')],_0xbd4bda[_0x4a22('0x9b')],!![]);_0x497e8e[_0x4a22('0x9e')](_0x105ad9);});return Promise[_0x4a22('0x9f')](_0x497e8e);})[_0x4a22('0x3b')](function(_0x335bd8){_0x2e8342=_0x335bd8;var _0x230a6c=_0x49eae8[_0x4a22('0xa0')](_0x2e8342);return{'count':_0x230a6c['length'],'rows':_0x230a6c};})[_0x4a22('0x3b')](respondWithResult(_0x693142,null))[_0x4a22('0x41')](function(_0x10f3bc){console['log'](_0x4a22('0xa1')+_0x10f3bc);var _0x1ee79b=_0x16445a['query'][_0x4a22('0xa2')]?0x1f4:_0x10f3bc['statusCode']||0x1f4;logger[_0x4a22('0xa3')](_0x10f3bc[_0x4a22('0x25')]);delete _0x10f3bc[_0x4a22('0x26')];if(_0x1ee79b===0x191){_0x1ee79b=0x190;}_0x693142['status'](_0x1ee79b)['send'](_0x16445a[_0x4a22('0x2c')]['test']?{'message':_0x4a22('0xa4'),'statusCode':_0x10f3bc['statusCode']}:_0x10f3bc);});};function createFieldObject(_0x1cd8f4,_0x473b2c,_0x53863b,_0x47de45,_0x3f099,_0x524adc){return new Promise(function(_0xce4dc7,_0x577a9f){var _0x311363={'id':_0x47de45,'name':_0x3f099,'custom':_0x524adc};if(_0x53863b==='boolean'){_0x311363[_0x4a22('0x3a')]=[{'name':'True','value':_0x4a22('0xa5')},{'name':_0x4a22('0xa6'),'value':_0x4a22('0xa7')}];_0xce4dc7(_0x311363);}else{var _0x1ba5b4={'method':'GET','uri':_0x1cd8f4+_0x4a22('0xa8')+_0x47de45,'auth':_0x473b2c,'json':!![]};return rp(_0x1ba5b4)[_0x4a22('0x3b')](function(_0x5ce47d){var _0x43ac55=[];if(_0x5ce47d[_0x4a22('0xa9')][_0x4a22('0x47')]>0x0){_0x5ce47d['result'][_0x4a22('0x9a')](function(_0x140b03){if(_0x140b03[_0x4a22('0xaa')]===_0x4a22('0xa7')){var _0x569cc4={'name':_0x140b03[_0x4a22('0x9b')],'value':_0x140b03[_0x4a22('0xab')]};_0x43ac55[_0x4a22('0x9e')](_0x569cc4);}});}_0x311363[_0x4a22('0x3a')]=_0x43ac55;if(_0x311363[_0x4a22('0x3a')][_0x4a22('0x47')]>0x0){_0xce4dc7(_0x311363);}else{if(_0x524adc==![]){_0xce4dc7();}else{_0xce4dc7(_0x311363);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 973f02a..0ea1889 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x39e845,_0x1ed12a){var _0x5ee79e=function(_0x2237b6){while(--_0x2237b6){_0x39e845['push'](_0x39e845['shift']());}};_0x5ee79e(++_0x1ed12a);}(_0x4819,0xcd));var _0x9481=function(_0x54bb04,_0x3aaec2){_0x54bb04=_0x54bb04-0x0;var _0xf7a4f4=_0x4819[_0x54bb04];return _0xf7a4f4;};'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'));var integrations=require('../../components/integrations/configuration');module[_0x9481('0xa')]=function(_0x5def07,_0x54cc78){return _0x5def07[_0x9481('0xb')](_0x9481('0xc'),attributes,{'tableName':_0x9481('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x362fdf,_0x1d7d2e){var _0x449827=function(_0x4914e2){while(--_0x4914e2){_0x362fdf['push'](_0x362fdf['shift']());}};_0x449827(++_0x1d7d2e);}(_0xda19,0xd5));var _0x9da1=function(_0x306d3c,_0x47cee1){_0x306d3c=_0x306d3c-0x0;var _0x3ed04b=_0xda19[_0x306d3c];return _0x3ed04b;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'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 fe15737..c83b9c8 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 _0xc236=['attributes','include','map','model','then','GetServicenowAccount','ShowServicenowAccount','stringify','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ServicenowAccount','findAll','options','where'];(function(_0x58f270,_0x218704){var _0x43d46f=function(_0x2a43f1){while(--_0x2a43f1){_0x58f270['push'](_0x58f270['shift']());}};_0x43d46f(++_0x218704);}(_0xc236,0x148));var _0x6c23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc236[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c23('0x0'));var util=require(_0x6c23('0x1'));var moment=require(_0x6c23('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c23('0x3'));var fs=require('fs');var Redis=require(_0x6c23('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6c23('0x5'))('rpc');var config=require(_0x6c23('0x6'));var jayson=require(_0x6c23('0x7'));var client=jayson[_0x6c23('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e815d,_0x139ec4,_0x4108d6){return new BPromise(function(_0x4bedee,_0x761aba){return client[_0x6c23('0x9')](_0x1e815d,_0x4108d6)['then'](function(_0x2797eb){logger['info'](_0x6c23('0xa'),_0x139ec4,_0x6c23('0xb'));logger[_0x6c23('0xc')](_0x6c23('0xd'),_0x139ec4,_0x6c23('0xb'),JSON['stringify'](_0x2797eb));if(_0x2797eb[_0x6c23('0xe')]){if(_0x2797eb[_0x6c23('0xe')][_0x6c23('0xf')]===0x1f4){logger[_0x6c23('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x139ec4,_0x2797eb[_0x6c23('0xe')]['message']);return _0x761aba(_0x2797eb[_0x6c23('0xe')][_0x6c23('0x10')]);}logger[_0x6c23('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x139ec4,_0x2797eb['error'][_0x6c23('0x10')]);return _0x4bedee(_0x2797eb[_0x6c23('0xe')][_0x6c23('0x10')]);}else{logger[_0x6c23('0x11')](_0x6c23('0xa'),_0x139ec4,'request\x20sent');_0x4bedee(_0x2797eb[_0x6c23('0x12')][_0x6c23('0x10')]);}})[_0x6c23('0x13')](function(_0xac093d){logger[_0x6c23('0xe')](_0x6c23('0xa'),_0x139ec4,_0xac093d);_0x761aba(_0xac093d);});});}exports['GetServicenowAccount']=function(_0x2fb10d){var _0x84f181=this;return new Promise(function(_0xfa477,_0x2469c0){return db[_0x6c23('0x14')][_0x6c23('0x15')]({'raw':_0x2fb10d[_0x6c23('0x16')]?_0x2fb10d[_0x6c23('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2fb10d[_0x6c23('0x16')]?_0x2fb10d[_0x6c23('0x16')][_0x6c23('0x17')]||null:null,'attributes':_0x2fb10d['options']?_0x2fb10d['options'][_0x6c23('0x18')]||null:null,'limit':_0x2fb10d['options']?_0x2fb10d[_0x6c23('0x16')]['limit']||null:null,'include':_0x2fb10d[_0x6c23('0x16')]?_0x2fb10d[_0x6c23('0x16')][_0x6c23('0x19')]?_[_0x6c23('0x1a')](_0x2fb10d['options'][_0x6c23('0x19')],function(_0x435a35){return{'model':db[_0x435a35['model']],'as':_0x435a35['as'],'attributes':_0x435a35[_0x6c23('0x18')],'include':_0x435a35[_0x6c23('0x19')]?_[_0x6c23('0x1a')](_0x435a35[_0x6c23('0x19')],function(_0x24cb2c){return{'model':db[_0x24cb2c[_0x6c23('0x1b')]],'as':_0x24cb2c['as'],'attributes':_0x24cb2c[_0x6c23('0x18')],'include':_0x24cb2c['include']?_['map'](_0x24cb2c[_0x6c23('0x19')],function(_0x5b59cd){return{'model':db[_0x5b59cd[_0x6c23('0x1b')]],'as':_0x5b59cd['as'],'attributes':_0x5b59cd[_0x6c23('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6c23('0x1c')](function(_0x46356f){logger['info'](_0x6c23('0x1d'),_0x2fb10d);logger['debug'](_0x6c23('0x1d'),_0x2fb10d,JSON['stringify'](_0x46356f));_0xfa477(_0x46356f);})[_0x6c23('0x13')](function(_0x395936){logger[_0x6c23('0xe')](_0x6c23('0x1d'),_0x395936[_0x6c23('0x10')],_0x2fb10d);_0x2469c0(_0x84f181[_0x6c23('0xe')](0x1f4,_0x395936['message']));});});};exports[_0x6c23('0x1e')]=function(_0x522edc){var _0x12bf9a=this;return new Promise(function(_0x4080fc,_0x539379){return db[_0x6c23('0x14')]['find']({'raw':_0x522edc[_0x6c23('0x16')]?_0x522edc[_0x6c23('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x522edc[_0x6c23('0x16')]?_0x522edc[_0x6c23('0x16')][_0x6c23('0x17')]||null:null,'attributes':_0x522edc[_0x6c23('0x16')]?_0x522edc[_0x6c23('0x16')][_0x6c23('0x18')]||null:null,'include':_0x522edc[_0x6c23('0x16')]?_0x522edc[_0x6c23('0x16')][_0x6c23('0x19')]?_[_0x6c23('0x1a')](_0x522edc[_0x6c23('0x16')][_0x6c23('0x19')],function(_0x45d46f){return{'model':db[_0x45d46f[_0x6c23('0x1b')]],'as':_0x45d46f['as'],'attributes':_0x45d46f[_0x6c23('0x18')],'include':_0x45d46f['include']?_[_0x6c23('0x1a')](_0x45d46f['include'],function(_0x152069){return{'model':db[_0x152069['model']],'as':_0x152069['as'],'attributes':_0x152069[_0x6c23('0x18')],'include':_0x152069['include']?_[_0x6c23('0x1a')](_0x152069[_0x6c23('0x19')],function(_0x33d5e6){return{'model':db[_0x33d5e6['model']],'as':_0x33d5e6['as'],'attributes':_0x33d5e6[_0x6c23('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6c23('0x1c')](function(_0x493f4e){logger['info'](_0x6c23('0x1e'),_0x522edc);logger['debug']('ShowServicenowAccount',_0x522edc,JSON[_0x6c23('0x1f')](_0x493f4e));_0x4080fc(_0x493f4e);})[_0x6c23('0x13')](function(_0x387bf0){logger[_0x6c23('0xe')](_0x6c23('0x1e'),_0x387bf0[_0x6c23('0x10')],_0x522edc);_0x539379(_0x12bf9a['error'](0x1f4,_0x387bf0[_0x6c23('0x10')]));});});}; \ No newline at end of file +var _0x3c8d=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','ShowServicenowAccount','then','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x1b3317,_0x59e3d6){var _0xc890a9=function(_0x5bbd8b){while(--_0x5bbd8b){_0x1b3317['push'](_0x1b3317['shift']());}};_0xc890a9(++_0x59e3d6);}(_0x3c8d,0x1c1));var _0xd3c8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3c8d[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd3c8('0x0'));var util=require(_0xd3c8('0x1'));var moment=require(_0xd3c8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3c8('0x3'));var fs=require('fs');var Redis=require(_0xd3c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c8('0x5'));var logger=require('../../config/logger')(_0xd3c8('0x6'));var config=require(_0xd3c8('0x7'));var jayson=require(_0xd3c8('0x8'));var client=jayson['client'][_0xd3c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa4b33d,_0x7edf5e,_0x4503ca){return new BPromise(function(_0x229372,_0x517276){return client[_0xd3c8('0xa')](_0xa4b33d,_0x4503ca)['then'](function(_0x455e23){logger[_0xd3c8('0xb')](_0xd3c8('0xc'),_0x7edf5e,_0xd3c8('0xd'));logger[_0xd3c8('0xe')](_0xd3c8('0xf'),_0x7edf5e,_0xd3c8('0xd'),JSON[_0xd3c8('0x10')](_0x455e23));if(_0x455e23[_0xd3c8('0x11')]){if(_0x455e23[_0xd3c8('0x11')][_0xd3c8('0x12')]===0x1f4){logger[_0xd3c8('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x7edf5e,_0x455e23['error'][_0xd3c8('0x13')]);return _0x517276(_0x455e23[_0xd3c8('0x11')]['message']);}logger[_0xd3c8('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x7edf5e,_0x455e23[_0xd3c8('0x11')]['message']);return _0x229372(_0x455e23['error'][_0xd3c8('0x13')]);}else{logger[_0xd3c8('0xb')](_0xd3c8('0xc'),_0x7edf5e,_0xd3c8('0xd'));_0x229372(_0x455e23['result'][_0xd3c8('0x13')]);}})[_0xd3c8('0x14')](function(_0x28ac86){logger['error'](_0xd3c8('0xc'),_0x7edf5e,_0x28ac86);_0x517276(_0x28ac86);});});}exports['GetServicenowAccount']=function(_0x597a47){var _0x318404=this;return new Promise(function(_0x5e9df9,_0x309866){return db[_0xd3c8('0x15')]['findAll']({'raw':_0x597a47[_0xd3c8('0x16')]?_0x597a47[_0xd3c8('0x16')][_0xd3c8('0x17')]===undefined?!![]:![]:!![],'where':_0x597a47[_0xd3c8('0x16')]?_0x597a47[_0xd3c8('0x16')][_0xd3c8('0x18')]||null:null,'attributes':_0x597a47[_0xd3c8('0x16')]?_0x597a47[_0xd3c8('0x16')][_0xd3c8('0x19')]||null:null,'limit':_0x597a47[_0xd3c8('0x16')]?_0x597a47[_0xd3c8('0x16')][_0xd3c8('0x1a')]||null:null,'include':_0x597a47[_0xd3c8('0x16')]?_0x597a47['options'][_0xd3c8('0x1b')]?_['map'](_0x597a47[_0xd3c8('0x16')][_0xd3c8('0x1b')],function(_0x5d150c){return{'model':db[_0x5d150c[_0xd3c8('0x1c')]],'as':_0x5d150c['as'],'attributes':_0x5d150c[_0xd3c8('0x19')],'include':_0x5d150c[_0xd3c8('0x1b')]?_[_0xd3c8('0x1d')](_0x5d150c['include'],function(_0x40d51e){return{'model':db[_0x40d51e[_0xd3c8('0x1c')]],'as':_0x40d51e['as'],'attributes':_0x40d51e[_0xd3c8('0x19')],'include':_0x40d51e[_0xd3c8('0x1b')]?_['map'](_0x40d51e[_0xd3c8('0x1b')],function(_0x97a33c){return{'model':db[_0x97a33c[_0xd3c8('0x1c')]],'as':_0x97a33c['as'],'attributes':_0x97a33c[_0xd3c8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21b9fb){logger[_0xd3c8('0xb')](_0xd3c8('0x1e'),_0x597a47);logger[_0xd3c8('0xe')](_0xd3c8('0x1e'),_0x597a47,JSON[_0xd3c8('0x10')](_0x21b9fb));_0x5e9df9(_0x21b9fb);})[_0xd3c8('0x14')](function(_0x35ad57){logger['error'](_0xd3c8('0x1e'),_0x35ad57[_0xd3c8('0x13')],_0x597a47);_0x309866(_0x318404['error'](0x1f4,_0x35ad57[_0xd3c8('0x13')]));});});};exports[_0xd3c8('0x1f')]=function(_0x5d761b){var _0x593d70=this;return new Promise(function(_0x396587,_0x5b8a9e){return db[_0xd3c8('0x15')]['find']({'raw':_0x5d761b['options']?_0x5d761b[_0xd3c8('0x16')][_0xd3c8('0x17')]===undefined?!![]:![]:!![],'where':_0x5d761b[_0xd3c8('0x16')]?_0x5d761b['options'][_0xd3c8('0x18')]||null:null,'attributes':_0x5d761b[_0xd3c8('0x16')]?_0x5d761b[_0xd3c8('0x16')][_0xd3c8('0x19')]||null:null,'include':_0x5d761b[_0xd3c8('0x16')]?_0x5d761b[_0xd3c8('0x16')][_0xd3c8('0x1b')]?_[_0xd3c8('0x1d')](_0x5d761b['options'][_0xd3c8('0x1b')],function(_0x81b71){return{'model':db[_0x81b71['model']],'as':_0x81b71['as'],'attributes':_0x81b71['attributes'],'include':_0x81b71['include']?_[_0xd3c8('0x1d')](_0x81b71['include'],function(_0x3a3654){return{'model':db[_0x3a3654[_0xd3c8('0x1c')]],'as':_0x3a3654['as'],'attributes':_0x3a3654[_0xd3c8('0x19')],'include':_0x3a3654[_0xd3c8('0x1b')]?_[_0xd3c8('0x1d')](_0x3a3654['include'],function(_0x248561){return{'model':db[_0x248561['model']],'as':_0x248561['as'],'attributes':_0x248561[_0xd3c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd3c8('0x20')](function(_0x486f67){logger[_0xd3c8('0xb')]('ShowServicenowAccount',_0x5d761b);logger[_0xd3c8('0xe')](_0xd3c8('0x1f'),_0x5d761b,JSON[_0xd3c8('0x10')](_0x486f67));_0x396587(_0x486f67);})[_0xd3c8('0x14')](function(_0xfbb88e){logger['error']('ShowServicenowAccount',_0xfbb88e['message'],_0x5d761b);_0x5b8a9e(_0x593d70[_0xd3c8('0x11')](0x1f4,_0xfbb88e[_0xd3c8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index cec5473..d3ae8db 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 _0xe176=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','getDescriptions','post','put','update','delete','destroy','exports'];(function(_0x461fb2,_0x3d547f){var _0xce8b31=function(_0x35bc05){while(--_0x35bc05){_0x461fb2['push'](_0x461fb2['shift']());}};_0xce8b31(++_0x3d547f);}(_0xe176,0x93));var _0x6e17=function(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0xe176[_0x5ea60d];return _0x1d14eb;};'use strict';var multer=require(_0x6e17('0x0'));var util=require(_0x6e17('0x1'));var path=require('path');var timeout=require(_0x6e17('0x2'));var express=require(_0x6e17('0x3'));var router=express[_0x6e17('0x4')]();var fs_extra=require(_0x6e17('0x5'));var auth=require(_0x6e17('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e17('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x6e17('0x8')]('/',auth[_0x6e17('0x9')](),controller[_0x6e17('0xa')]);router['get'](_0x6e17('0xb'),auth['isAuthenticated'](),controller[_0x6e17('0xc')]);router[_0x6e17('0x8')]('/:id/fields',auth[_0x6e17('0x9')](),controller['getFields']);router[_0x6e17('0x8')]('/:id/subjects',auth[_0x6e17('0x9')](),controller[_0x6e17('0xd')]);router[_0x6e17('0x8')]('/:id/descriptions',auth[_0x6e17('0x9')](),controller[_0x6e17('0xe')]);router[_0x6e17('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e17('0x10')](_0x6e17('0xb'),auth[_0x6e17('0x9')](),controller[_0x6e17('0x11')]);router[_0x6e17('0x12')](_0x6e17('0xb'),auth[_0x6e17('0x9')](),controller[_0x6e17('0x13')]);module[_0x6e17('0x14')]=router; \ No newline at end of file +var _0x4f84=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x4f84,0x140));var _0x44f8=function(_0x4cc95a,_0x15c4c7){_0x4cc95a=_0x4cc95a-0x0;var _0x4abee3=_0x4f84[_0x4cc95a];return _0x4abee3;};'use strict';var multer=require(_0x44f8('0x0'));var util=require(_0x44f8('0x1'));var path=require(_0x44f8('0x2'));var timeout=require(_0x44f8('0x3'));var express=require(_0x44f8('0x4'));var router=express[_0x44f8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x44f8('0x6'));var interaction=require(_0x44f8('0x7'));var config=require(_0x44f8('0x8'));var controller=require(_0x44f8('0x9'));router[_0x44f8('0xa')]('/',auth['isAuthenticated'](),controller[_0x44f8('0xb')]);router[_0x44f8('0xa')](_0x44f8('0xc'),auth[_0x44f8('0xd')](),controller['show']);router[_0x44f8('0xa')](_0x44f8('0xe'),auth[_0x44f8('0xd')](),controller['getFields']);router[_0x44f8('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x44f8('0xf')]);router['get']('/:id/descriptions',auth[_0x44f8('0xd')](),controller[_0x44f8('0x10')]);router['post']('/',auth[_0x44f8('0xd')](),controller[_0x44f8('0x11')]);router[_0x44f8('0x12')](_0x44f8('0xc'),auth[_0x44f8('0xd')](),controller[_0x44f8('0x13')]);router[_0x44f8('0x14')]('/:id',auth[_0x44f8('0xd')](),controller[_0x44f8('0x15')]);module[_0x44f8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d12dfa6..f0623e1 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 _0x5b73=['sequelize','exports','STRING'];(function(_0x4af85d,_0x165292){var _0x11a1ac=function(_0x3bf951){while(--_0x3bf951){_0x4af85d['push'](_0x4af85d['shift']());}};_0x11a1ac(++_0x165292);}(_0x5b73,0x16b));var _0x35b7=function(_0x183b97,_0x2d297c){_0x183b97=_0x183b97-0x0;var _0x629cf7=_0x5b73[_0x183b97];return _0x629cf7;};'use strict';var Sequelize=require(_0x35b7('0x0'));module[_0x35b7('0x1')]={'name':{'type':Sequelize[_0x35b7('0x2')]},'description':{'type':Sequelize[_0x35b7('0x2')]}}; \ No newline at end of file +var _0x9fa8=['STRING','exports'];(function(_0x5eab61,_0x241619){var _0x5cde9b=function(_0x47acc4){while(--_0x47acc4){_0x5eab61['push'](_0x5eab61['shift']());}};_0x5cde9b(++_0x241619);}(_0x9fa8,0x81));var _0x89fa=function(_0x170adf,_0x5a611c){_0x170adf=_0x170adf-0x0;var _0x3145bc=_0x9fa8[_0x170adf];return _0x3145bc;};'use strict';var Sequelize=require('sequelize');module[_0x89fa('0x0')]={'name':{'type':Sequelize[_0x89fa('0x1')]},'description':{'type':Sequelize[_0x89fa('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5166f4d..7f51543 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 _0x9646=['moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','name','send','index','ServicenowConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','findOne','ServicenowField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5948c6,_0x4de8ac){var _0x30059e=function(_0x33a25d){while(--_0x33a25d){_0x5948c6['push'](_0x5948c6['shift']());}};_0x30059e(++_0x4de8ac);}(_0x9646,0x13c));var _0x6964=function(_0x549928,_0x363b7a){_0x549928=_0x549928-0x0;var _0x941e27=_0x9646[_0x549928];return _0x941e27;};'use strict';var emlformat=require(_0x6964('0x0'));var rimraf=require(_0x6964('0x1'));var zipdir=require(_0x6964('0x2'));var jsonpatch=require(_0x6964('0x3'));var rp=require('request-promise');var moment=require(_0x6964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6964('0x5'));var util=require(_0x6964('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6964('0x7'));var ejs=require(_0x6964('0x8'));var fs=require('fs');var fs_extra=require(_0x6964('0x9'));var _=require(_0x6964('0xa'));var squel=require(_0x6964('0xb'));var crypto=require('crypto');var jsforce=require(_0x6964('0xc'));var deskjs=require(_0x6964('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6964('0xe'));var Papa=require(_0x6964('0xf'));var Redis=require(_0x6964('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6964('0x11'));var as=require(_0x6964('0x12'));var hardwareService=require(_0x6964('0x13'));var logger=require('../../config/logger')(_0x6964('0x14'));var utils=require(_0x6964('0x15'));var config=require(_0x6964('0x16'));var licenseUtil=require(_0x6964('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4d23,_0x1c1242){_0x1c1242=_0x1c1242||0xcc;return function(_0x2521f3){if(_0x2521f3){return _0x5e4d23['sendStatus'](_0x1c1242);}return _0x5e4d23[_0x6964('0x18')](_0x1c1242)[_0x6964('0x19')]();};}function respondWithResult(_0x19a0a7,_0x4c5516){_0x4c5516=_0x4c5516||0xc8;return function(_0x195a0d){if(_0x195a0d){return _0x19a0a7[_0x6964('0x18')](_0x4c5516)[_0x6964('0x1a')](_0x195a0d);}};}function respondWithFilteredResult(_0x231d88,_0x1b20c5){return function(_0x348eab){if(_0x348eab){var _0x8a60a4=typeof _0x1b20c5[_0x6964('0x1b')]===_0x6964('0x1c')&&typeof _0x1b20c5[_0x6964('0x1d')]==='undefined';var _0x517c58=_0x348eab[_0x6964('0x1e')];var _0x22d52a=_0x8a60a4?0x0:_0x1b20c5[_0x6964('0x1b')];var _0xe7e146=_0x8a60a4?_0x348eab['count']:_0x1b20c5[_0x6964('0x1b')]+_0x1b20c5[_0x6964('0x1d')];var _0x5c3ce6;if(_0xe7e146>=_0x517c58){_0xe7e146=_0x517c58;_0x5c3ce6=0xc8;}else{_0x5c3ce6=0xce;}_0x231d88[_0x6964('0x18')](_0x5c3ce6);return _0x231d88[_0x6964('0x1f')]('Content-Range',_0x22d52a+'-'+_0xe7e146+'/'+_0x517c58)['json'](_0x348eab);}return null;};}function patchUpdates(_0x5b0dcb){return function(_0x454f60){try{jsonpatch[_0x6964('0x20')](_0x454f60,_0x5b0dcb,!![]);}catch(_0x1f5d7b){return BPromise[_0x6964('0x21')](_0x1f5d7b);}return _0x454f60[_0x6964('0x22')]();};}function saveUpdates(_0x333f63,_0x4cd8e1){return function(_0x11c945){if(_0x11c945){return _0x11c945[_0x6964('0x23')](_0x333f63)[_0x6964('0x24')](function(_0x6a9133){return _0x6a9133;});}return null;};}function removeEntity(_0x39d910,_0x4e7815){return function(_0x358958){if(_0x358958){return _0x358958[_0x6964('0x25')]()[_0x6964('0x24')](function(){_0x39d910[_0x6964('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9209f8,_0x2e41d5){return function(_0x2811a2){if(!_0x2811a2){_0x9209f8[_0x6964('0x26')](0x194);}return _0x2811a2;};}function handleError(_0x555e36,_0x2b501b){_0x2b501b=_0x2b501b||0x1f4;return function(_0xa4853d){logger['error'](_0xa4853d['stack']);if(_0xa4853d[_0x6964('0x27')]){delete _0xa4853d['name'];}_0x555e36['status'](_0x2b501b)[_0x6964('0x28')](_0xa4853d);};}exports[_0x6964('0x29')]=function(_0x530ec5,_0x20a84f){var _0x53cfc4={},_0x331e6c={},_0x10ec6d={'count':0x0,'rows':[]};var _0x1f7d83=_['map'](db[_0x6964('0x2a')]['rawAttributes'],function(_0x5cfccf){return{'name':_0x5cfccf[_0x6964('0x2b')],'type':_0x5cfccf[_0x6964('0x2c')][_0x6964('0x2d')]};});_0x331e6c[_0x6964('0x2e')]=_[_0x6964('0x2f')](_0x1f7d83,_0x6964('0x27'));_0x331e6c[_0x6964('0x30')]=_['keys'](_0x530ec5[_0x6964('0x30')]);_0x331e6c[_0x6964('0x31')]=_[_0x6964('0x32')](_0x331e6c[_0x6964('0x2e')],_0x331e6c[_0x6964('0x30')]);_0x53cfc4[_0x6964('0x33')]=_[_0x6964('0x32')](_0x331e6c[_0x6964('0x2e')],qs[_0x6964('0x34')](_0x530ec5[_0x6964('0x30')][_0x6964('0x34')]));_0x53cfc4['attributes']=_0x53cfc4['attributes']['length']?_0x53cfc4['attributes']:_0x331e6c[_0x6964('0x2e')];if(!_0x530ec5['query'][_0x6964('0x35')]('nolimit')){_0x53cfc4['limit']=qs['limit'](_0x530ec5[_0x6964('0x30')]['limit']);_0x53cfc4[_0x6964('0x1b')]=qs[_0x6964('0x1b')](_0x530ec5[_0x6964('0x30')][_0x6964('0x1b')]);}_0x53cfc4[_0x6964('0x36')]=qs['sort'](_0x530ec5['query'][_0x6964('0x37')]);_0x53cfc4[_0x6964('0x38')]=qs[_0x6964('0x31')](_[_0x6964('0x39')](_0x530ec5[_0x6964('0x30')],_0x331e6c[_0x6964('0x31')]),_0x1f7d83);if(_0x530ec5['query'][_0x6964('0x3a')]){_0x53cfc4[_0x6964('0x38')]=_[_0x6964('0x3b')](_0x53cfc4[_0x6964('0x38')],{'$or':_[_0x6964('0x2f')](_0x1f7d83,function(_0x4bfca9){if(_0x4bfca9[_0x6964('0x2c')]!=='VIRTUAL'){var _0x4c0bfc={};_0x4c0bfc[_0x4bfca9[_0x6964('0x27')]]={'$like':'%'+_0x530ec5['query'][_0x6964('0x3a')]+'%'};return _0x4c0bfc;}})});}_0x53cfc4=_[_0x6964('0x3b')]({},_0x53cfc4,_0x530ec5[_0x6964('0x3c')]);var _0x4efb47={'where':_0x53cfc4[_0x6964('0x38')]};return db[_0x6964('0x2a')][_0x6964('0x1e')](_0x4efb47)['then'](function(_0xe4a160){_0x10ec6d[_0x6964('0x1e')]=_0xe4a160;if(_0x530ec5[_0x6964('0x30')][_0x6964('0x3d')]){_0x53cfc4['include']=[{'all':!![]}];}return db[_0x6964('0x2a')][_0x6964('0x3e')](_0x53cfc4);})[_0x6964('0x24')](function(_0x37c1b){_0x10ec6d[_0x6964('0x3f')]=_0x37c1b;return _0x10ec6d;})['then'](respondWithFilteredResult(_0x20a84f,_0x53cfc4))[_0x6964('0x40')](handleError(_0x20a84f,null));};exports[_0x6964('0x41')]=function(_0x238649,_0x70090e){var _0xf15c66={'raw':![],'where':{'id':_0x238649[_0x6964('0x42')]['id']}},_0x2d6271={};_0x2d6271[_0x6964('0x2e')]=_[_0x6964('0x43')](db[_0x6964('0x2a')][_0x6964('0x44')]);_0x2d6271['query']=_[_0x6964('0x43')](_0x238649[_0x6964('0x30')]);_0x2d6271['filters']=_[_0x6964('0x32')](_0x2d6271[_0x6964('0x2e')],_0x2d6271[_0x6964('0x30')]);_0xf15c66[_0x6964('0x33')]=_['intersection'](_0x2d6271[_0x6964('0x2e')],qs[_0x6964('0x34')](_0x238649[_0x6964('0x30')][_0x6964('0x34')]));_0xf15c66[_0x6964('0x33')]=_0xf15c66[_0x6964('0x33')][_0x6964('0x45')]?_0xf15c66[_0x6964('0x33')]:_0x2d6271[_0x6964('0x2e')];if(_0x238649[_0x6964('0x30')][_0x6964('0x3d')]){_0xf15c66[_0x6964('0x46')]=[{'all':!![]}];}_0xf15c66=_[_0x6964('0x3b')]({},_0xf15c66,_0x238649[_0x6964('0x3c')]);return db['ServicenowConfiguration'][_0x6964('0x47')](_0xf15c66)[_0x6964('0x24')](handleEntityNotFound(_0x70090e,null))[_0x6964('0x24')](respondWithResult(_0x70090e,null))['catch'](handleError(_0x70090e,null));};exports['create']=function(_0x5e93c1,_0xae90ec){return db[_0x6964('0x2a')][_0x6964('0x48')](_0x5e93c1[_0x6964('0x49')],{})['then'](respondWithResult(_0xae90ec,0xc9))[_0x6964('0x40')](handleError(_0xae90ec,null));};exports[_0x6964('0x23')]=function(_0x18f7ec,_0x4de55f){if(_0x18f7ec[_0x6964('0x49')]['id']){delete _0x18f7ec[_0x6964('0x49')]['id'];}return db[_0x6964('0x2a')]['find']({'where':{'id':_0x18f7ec[_0x6964('0x42')]['id']}})[_0x6964('0x24')](handleEntityNotFound(_0x4de55f,null))['then'](saveUpdates(_0x18f7ec['body'],null))[_0x6964('0x24')](respondWithResult(_0x4de55f,null))[_0x6964('0x40')](handleError(_0x4de55f,null));};exports['destroy']=function(_0x44ec2c,_0x510253){return db['ServicenowConfiguration'][_0x6964('0x47')]({'where':{'id':_0x44ec2c[_0x6964('0x42')]['id']}})[_0x6964('0x24')](handleEntityNotFound(_0x510253,null))[_0x6964('0x24')](removeEntity(_0x510253,null))[_0x6964('0x40')](handleError(_0x510253,null));};exports['getFields']=function(_0x3c6087,_0xe95d59,_0x2ada86){var _0x5127b1={};var _0x46a3b5={};var _0x35267f;var _0x4e35bb;return db['ServicenowConfiguration'][_0x6964('0x4a')]({'where':{'id':_0x3c6087['params']['id']}})['then'](handleEntityNotFound(_0xe95d59,null))[_0x6964('0x24')](function(_0xcfe149){if(_0xcfe149){_0x35267f=_0xcfe149;_0x46a3b5['model']=_[_0x6964('0x43')](db[_0x6964('0x4b')][_0x6964('0x44')]);_0x46a3b5[_0x6964('0x30')]=_[_0x6964('0x43')](_0x3c6087[_0x6964('0x30')]);_0x46a3b5['filters']=_['intersection'](_0x46a3b5[_0x6964('0x2e')],_0x46a3b5[_0x6964('0x30')]);_0x5127b1[_0x6964('0x33')]=_[_0x6964('0x32')](_0x46a3b5[_0x6964('0x2e')],qs[_0x6964('0x34')](_0x3c6087[_0x6964('0x30')][_0x6964('0x34')]));_0x5127b1[_0x6964('0x33')]=_0x5127b1['attributes'][_0x6964('0x45')]?_0x5127b1[_0x6964('0x33')]:_0x46a3b5['model'];_0x5127b1[_0x6964('0x36')]=qs['sort'](_0x3c6087[_0x6964('0x30')]['sort']);_0x5127b1['where']=qs[_0x6964('0x31')](_[_0x6964('0x39')](_0x3c6087['query'],_0x46a3b5[_0x6964('0x31')]));if(_0x3c6087[_0x6964('0x30')][_0x6964('0x3a')]){_0x5127b1['where']=_[_0x6964('0x3b')](_0x5127b1[_0x6964('0x38')],{'$or':_[_0x6964('0x2f')](_0x5127b1[_0x6964('0x33')],function(_0x17d158){var _0x701ffc={};_0x701ffc[_0x17d158]={'$like':'%'+_0x3c6087[_0x6964('0x30')]['filter']+'%'};return _0x701ffc;})});}_0x5127b1=_[_0x6964('0x3b')]({},_0x5127b1,_0x3c6087['options']);return _0x35267f[_0x6964('0x4c')](_0x5127b1);}})['then'](function(_0x296bb1){if(_0x296bb1){_0x4e35bb=_0x296bb1['length'];if(!_0x3c6087[_0x6964('0x30')]['hasOwnProperty'](_0x6964('0x4d'))){_0x5127b1['limit']=qs['limit'](_0x3c6087[_0x6964('0x30')][_0x6964('0x1d')]);_0x5127b1[_0x6964('0x1b')]=qs[_0x6964('0x1b')](_0x3c6087['query'][_0x6964('0x1b')]);}return _0x35267f['getFields'](_0x5127b1);}})[_0x6964('0x24')](function(_0x38adfd){if(_0x38adfd){return _0x38adfd?{'count':_0x4e35bb,'rows':_0x38adfd}:null;}})['then'](respondWithResult(_0xe95d59,null))[_0x6964('0x40')](handleError(_0xe95d59,null));};exports[_0x6964('0x4e')]=function(_0x2341b6,_0x4ee1f2,_0x1fc855){var _0x5f07bc={};var _0x25a389={};var _0x480dca;var _0x2eb3d4;return db['ServicenowConfiguration'][_0x6964('0x4a')]({'where':{'id':_0x2341b6['params']['id']}})[_0x6964('0x24')](handleEntityNotFound(_0x4ee1f2,null))[_0x6964('0x24')](function(_0x5783ba){if(_0x5783ba){_0x480dca=_0x5783ba;_0x25a389[_0x6964('0x2e')]=_['keys'](db[_0x6964('0x4b')][_0x6964('0x44')]);_0x25a389[_0x6964('0x30')]=_[_0x6964('0x43')](_0x2341b6[_0x6964('0x30')]);_0x25a389[_0x6964('0x31')]=_['intersection'](_0x25a389[_0x6964('0x2e')],_0x25a389[_0x6964('0x30')]);_0x5f07bc[_0x6964('0x33')]=_[_0x6964('0x32')](_0x25a389[_0x6964('0x2e')],qs[_0x6964('0x34')](_0x2341b6[_0x6964('0x30')]['fields']));_0x5f07bc[_0x6964('0x33')]=_0x5f07bc[_0x6964('0x33')]['length']?_0x5f07bc[_0x6964('0x33')]:_0x25a389[_0x6964('0x2e')];_0x5f07bc[_0x6964('0x36')]=qs[_0x6964('0x37')](_0x2341b6['query']['sort']);_0x5f07bc['where']=qs[_0x6964('0x31')](_[_0x6964('0x39')](_0x2341b6[_0x6964('0x30')],_0x25a389[_0x6964('0x31')]));if(_0x2341b6[_0x6964('0x30')][_0x6964('0x3a')]){_0x5f07bc[_0x6964('0x38')]=_[_0x6964('0x3b')](_0x5f07bc[_0x6964('0x38')],{'$or':_[_0x6964('0x2f')](_0x5f07bc[_0x6964('0x33')],function(_0x434ce9){var _0x186d21={};_0x186d21[_0x434ce9]={'$like':'%'+_0x2341b6[_0x6964('0x30')]['filter']+'%'};return _0x186d21;})});}_0x5f07bc=_[_0x6964('0x3b')]({},_0x5f07bc,_0x2341b6[_0x6964('0x3c')]);return _0x480dca[_0x6964('0x4e')](_0x5f07bc);}})[_0x6964('0x24')](function(_0x255036){if(_0x255036){_0x2eb3d4=_0x255036['length'];if(!_0x2341b6[_0x6964('0x30')][_0x6964('0x35')]('nolimit')){_0x5f07bc[_0x6964('0x1d')]=qs[_0x6964('0x1d')](_0x2341b6['query'][_0x6964('0x1d')]);_0x5f07bc[_0x6964('0x1b')]=qs[_0x6964('0x1b')](_0x2341b6[_0x6964('0x30')]['offset']);}return _0x480dca[_0x6964('0x4e')](_0x5f07bc);}})['then'](function(_0x36e416){if(_0x36e416){return _0x36e416?{'count':_0x2eb3d4,'rows':_0x36e416}:null;}})[_0x6964('0x24')](respondWithResult(_0x4ee1f2,null))[_0x6964('0x40')](handleError(_0x4ee1f2,null));};exports[_0x6964('0x4f')]=function(_0x8af531,_0x165761,_0x5b782f){var _0x489604={};var _0x27e1fb={};var _0x15f288;var _0x413a51;return db[_0x6964('0x2a')]['findOne']({'where':{'id':_0x8af531[_0x6964('0x42')]['id']}})[_0x6964('0x24')](handleEntityNotFound(_0x165761,null))['then'](function(_0x498db9){if(_0x498db9){_0x15f288=_0x498db9;_0x27e1fb['model']=_[_0x6964('0x43')](db[_0x6964('0x4b')]['rawAttributes']);_0x27e1fb['query']=_[_0x6964('0x43')](_0x8af531[_0x6964('0x30')]);_0x27e1fb[_0x6964('0x31')]=_[_0x6964('0x32')](_0x27e1fb[_0x6964('0x2e')],_0x27e1fb['query']);_0x489604[_0x6964('0x33')]=_['intersection'](_0x27e1fb[_0x6964('0x2e')],qs['fields'](_0x8af531['query'][_0x6964('0x34')]));_0x489604[_0x6964('0x33')]=_0x489604[_0x6964('0x33')]['length']?_0x489604[_0x6964('0x33')]:_0x27e1fb['model'];_0x489604[_0x6964('0x36')]=qs[_0x6964('0x37')](_0x8af531['query'][_0x6964('0x37')]);_0x489604[_0x6964('0x38')]=qs[_0x6964('0x31')](_[_0x6964('0x39')](_0x8af531[_0x6964('0x30')],_0x27e1fb[_0x6964('0x31')]));if(_0x8af531['query'][_0x6964('0x3a')]){_0x489604['where']=_[_0x6964('0x3b')](_0x489604[_0x6964('0x38')],{'$or':_[_0x6964('0x2f')](_0x489604[_0x6964('0x33')],function(_0xd441f6){var _0x125e82={};_0x125e82[_0xd441f6]={'$like':'%'+_0x8af531[_0x6964('0x30')][_0x6964('0x3a')]+'%'};return _0x125e82;})});}_0x489604=_[_0x6964('0x3b')]({},_0x489604,_0x8af531[_0x6964('0x3c')]);return _0x15f288['getDescriptions'](_0x489604);}})[_0x6964('0x24')](function(_0x24e39f){if(_0x24e39f){_0x413a51=_0x24e39f[_0x6964('0x45')];if(!_0x8af531[_0x6964('0x30')][_0x6964('0x35')]('nolimit')){_0x489604['limit']=qs[_0x6964('0x1d')](_0x8af531['query']['limit']);_0x489604[_0x6964('0x1b')]=qs[_0x6964('0x1b')](_0x8af531[_0x6964('0x30')]['offset']);}return _0x15f288['getDescriptions'](_0x489604);}})[_0x6964('0x24')](function(_0x48f781){if(_0x48f781){return _0x48f781?{'count':_0x413a51,'rows':_0x48f781}:null;}})['then'](respondWithResult(_0x165761,null))[_0x6964('0x40')](handleError(_0x165761,null));}; \ No newline at end of file +var _0x856b=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','update','body','destroy','findOne','ServicenowField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0x856b,0x194));var _0xb856=function(_0x4eb269,_0x3cd1b6){_0x4eb269=_0x4eb269-0x0;var _0x1597b8=_0x856b[_0x4eb269];return _0x1597b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb856('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb856('0x1'));var rp=require(_0xb856('0x2'));var moment=require('moment');var BPromise=require(_0xb856('0x3'));var Mustache=require(_0xb856('0x4'));var util=require(_0xb856('0x5'));var path=require(_0xb856('0x6'));var sox=require(_0xb856('0x7'));var csv=require('to-csv');var ejs=require(_0xb856('0x8'));var fs=require('fs');var fs_extra=require(_0xb856('0x9'));var _=require('lodash');var squel=require(_0xb856('0xa'));var crypto=require(_0xb856('0xb'));var jsforce=require(_0xb856('0xc'));var deskjs=require(_0xb856('0xd'));var toCsv=require(_0xb856('0xe'));var querystring=require(_0xb856('0xf'));var Papa=require(_0xb856('0x10'));var Redis=require(_0xb856('0x11'));var authService=require(_0xb856('0x12'));var qs=require(_0xb856('0x13'));var as=require(_0xb856('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb856('0x15'))(_0xb856('0x16'));var utils=require(_0xb856('0x17'));var config=require(_0xb856('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb856('0x19'))['db'];function respondWithStatusCode(_0x411e9d,_0x4e7476){_0x4e7476=_0x4e7476||0xcc;return function(_0x45bc0f){if(_0x45bc0f){return _0x411e9d[_0xb856('0x1a')](_0x4e7476);}return _0x411e9d[_0xb856('0x1b')](_0x4e7476)[_0xb856('0x1c')]();};}function respondWithResult(_0x540af2,_0x29c675){_0x29c675=_0x29c675||0xc8;return function(_0x5db228){if(_0x5db228){return _0x540af2[_0xb856('0x1b')](_0x29c675)[_0xb856('0x1d')](_0x5db228);}};}function respondWithFilteredResult(_0x376c0e,_0x565bb1){return function(_0x5c204b){if(_0x5c204b){var _0xa1fd81=typeof _0x565bb1['offset']==='undefined'&&typeof _0x565bb1[_0xb856('0x1e')]===_0xb856('0x1f');var _0x43dbb0=_0x5c204b[_0xb856('0x20')];var _0x183e39=_0xa1fd81?0x0:_0x565bb1[_0xb856('0x21')];var _0x5493f4=_0xa1fd81?_0x5c204b['count']:_0x565bb1['offset']+_0x565bb1[_0xb856('0x1e')];var _0x2e99d2;if(_0x5493f4>=_0x43dbb0){_0x5493f4=_0x43dbb0;_0x2e99d2=0xc8;}else{_0x2e99d2=0xce;}_0x376c0e['status'](_0x2e99d2);return _0x376c0e[_0xb856('0x22')](_0xb856('0x23'),_0x183e39+'-'+_0x5493f4+'/'+_0x43dbb0)[_0xb856('0x1d')](_0x5c204b);}return null;};}function patchUpdates(_0x8f48b4){return function(_0x3329e1){try{jsonpatch[_0xb856('0x24')](_0x3329e1,_0x8f48b4,!![]);}catch(_0x22b9c0){return BPromise[_0xb856('0x25')](_0x22b9c0);}return _0x3329e1[_0xb856('0x26')]();};}function saveUpdates(_0x21120e,_0x35e24f){return function(_0x21eeee){if(_0x21eeee){return _0x21eeee['update'](_0x21120e)[_0xb856('0x27')](function(_0x29ad21){return _0x29ad21;});}return null;};}function removeEntity(_0x16a40f,_0x43b787){return function(_0x2135ad){if(_0x2135ad){return _0x2135ad['destroy']()[_0xb856('0x27')](function(){_0x16a40f[_0xb856('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfeef97,_0x2ff00b){return function(_0x169c20){if(!_0x169c20){_0xfeef97[_0xb856('0x1a')](0x194);}return _0x169c20;};}function handleError(_0x942076,_0x28f9e0){_0x28f9e0=_0x28f9e0||0x1f4;return function(_0x5de8ca){logger['error'](_0x5de8ca['stack']);if(_0x5de8ca[_0xb856('0x28')]){delete _0x5de8ca[_0xb856('0x28')];}_0x942076[_0xb856('0x1b')](_0x28f9e0)[_0xb856('0x29')](_0x5de8ca);};}exports[_0xb856('0x2a')]=function(_0x5085ea,_0x3b0cab){var _0x3b7a34={},_0x3b5628={},_0x5ba4fa={'count':0x0,'rows':[]};var _0x294c2b=_[_0xb856('0x2b')](db[_0xb856('0x2c')][_0xb856('0x2d')],function(_0x375ee7){return{'name':_0x375ee7[_0xb856('0x2e')],'type':_0x375ee7[_0xb856('0x2f')][_0xb856('0x30')]};});_0x3b5628[_0xb856('0x31')]=_[_0xb856('0x2b')](_0x294c2b,_0xb856('0x28'));_0x3b5628[_0xb856('0x32')]=_[_0xb856('0x33')](_0x5085ea[_0xb856('0x32')]);_0x3b5628[_0xb856('0x34')]=_[_0xb856('0x35')](_0x3b5628[_0xb856('0x31')],_0x3b5628[_0xb856('0x32')]);_0x3b7a34['attributes']=_[_0xb856('0x35')](_0x3b5628['model'],qs['fields'](_0x5085ea['query'][_0xb856('0x36')]));_0x3b7a34[_0xb856('0x37')]=_0x3b7a34['attributes'][_0xb856('0x38')]?_0x3b7a34['attributes']:_0x3b5628[_0xb856('0x31')];if(!_0x5085ea[_0xb856('0x32')]['hasOwnProperty'](_0xb856('0x39'))){_0x3b7a34[_0xb856('0x1e')]=qs[_0xb856('0x1e')](_0x5085ea[_0xb856('0x32')][_0xb856('0x1e')]);_0x3b7a34[_0xb856('0x21')]=qs['offset'](_0x5085ea[_0xb856('0x32')][_0xb856('0x21')]);}_0x3b7a34['order']=qs[_0xb856('0x3a')](_0x5085ea['query'][_0xb856('0x3a')]);_0x3b7a34[_0xb856('0x3b')]=qs[_0xb856('0x34')](_[_0xb856('0x3c')](_0x5085ea[_0xb856('0x32')],_0x3b5628[_0xb856('0x34')]),_0x294c2b);if(_0x5085ea[_0xb856('0x32')][_0xb856('0x3d')]){_0x3b7a34[_0xb856('0x3b')]=_[_0xb856('0x3e')](_0x3b7a34[_0xb856('0x3b')],{'$or':_[_0xb856('0x2b')](_0x294c2b,function(_0x19fe82){if(_0x19fe82[_0xb856('0x2f')]!==_0xb856('0x3f')){var _0x47e5ad={};_0x47e5ad[_0x19fe82[_0xb856('0x28')]]={'$like':'%'+_0x5085ea[_0xb856('0x32')]['filter']+'%'};return _0x47e5ad;}})});}_0x3b7a34=_[_0xb856('0x3e')]({},_0x3b7a34,_0x5085ea[_0xb856('0x40')]);var _0xc0b49e={'where':_0x3b7a34['where']};return db[_0xb856('0x2c')][_0xb856('0x20')](_0xc0b49e)[_0xb856('0x27')](function(_0x4becc1){_0x5ba4fa[_0xb856('0x20')]=_0x4becc1;if(_0x5085ea['query']['includeAll']){_0x3b7a34['include']=[{'all':!![]}];}return db[_0xb856('0x2c')][_0xb856('0x41')](_0x3b7a34);})[_0xb856('0x27')](function(_0x3f7852){_0x5ba4fa[_0xb856('0x42')]=_0x3f7852;return _0x5ba4fa;})['then'](respondWithFilteredResult(_0x3b0cab,_0x3b7a34))[_0xb856('0x43')](handleError(_0x3b0cab,null));};exports[_0xb856('0x44')]=function(_0x4756e8,_0x2de822){var _0x357ac0={'raw':![],'where':{'id':_0x4756e8[_0xb856('0x45')]['id']}},_0x23251e={};_0x23251e['model']=_[_0xb856('0x33')](db['ServicenowConfiguration'][_0xb856('0x2d')]);_0x23251e['query']=_[_0xb856('0x33')](_0x4756e8['query']);_0x23251e[_0xb856('0x34')]=_[_0xb856('0x35')](_0x23251e[_0xb856('0x31')],_0x23251e[_0xb856('0x32')]);_0x357ac0[_0xb856('0x37')]=_[_0xb856('0x35')](_0x23251e[_0xb856('0x31')],qs[_0xb856('0x36')](_0x4756e8[_0xb856('0x32')][_0xb856('0x36')]));_0x357ac0['attributes']=_0x357ac0['attributes'][_0xb856('0x38')]?_0x357ac0[_0xb856('0x37')]:_0x23251e[_0xb856('0x31')];if(_0x4756e8[_0xb856('0x32')][_0xb856('0x46')]){_0x357ac0['include']=[{'all':!![]}];}_0x357ac0=_['merge']({},_0x357ac0,_0x4756e8[_0xb856('0x40')]);return db[_0xb856('0x2c')][_0xb856('0x47')](_0x357ac0)[_0xb856('0x27')](handleEntityNotFound(_0x2de822,null))[_0xb856('0x27')](respondWithResult(_0x2de822,null))[_0xb856('0x43')](handleError(_0x2de822,null));};exports[_0xb856('0x48')]=function(_0x5b1933,_0x4998d0){return db[_0xb856('0x2c')][_0xb856('0x48')](_0x5b1933['body'],{})[_0xb856('0x27')](respondWithResult(_0x4998d0,0xc9))[_0xb856('0x43')](handleError(_0x4998d0,null));};exports[_0xb856('0x49')]=function(_0x160c3c,_0x23b663){if(_0x160c3c[_0xb856('0x4a')]['id']){delete _0x160c3c[_0xb856('0x4a')]['id'];}return db['ServicenowConfiguration'][_0xb856('0x47')]({'where':{'id':_0x160c3c['params']['id']}})[_0xb856('0x27')](handleEntityNotFound(_0x23b663,null))['then'](saveUpdates(_0x160c3c[_0xb856('0x4a')],null))[_0xb856('0x27')](respondWithResult(_0x23b663,null))[_0xb856('0x43')](handleError(_0x23b663,null));};exports[_0xb856('0x4b')]=function(_0xb41226,_0x4fd4d2){return db['ServicenowConfiguration'][_0xb856('0x47')]({'where':{'id':_0xb41226[_0xb856('0x45')]['id']}})[_0xb856('0x27')](handleEntityNotFound(_0x4fd4d2,null))[_0xb856('0x27')](removeEntity(_0x4fd4d2,null))[_0xb856('0x43')](handleError(_0x4fd4d2,null));};exports['getFields']=function(_0x41ff12,_0x4cae9d,_0x254790){var _0x37b4bf={};var _0x37449f={};var _0x58dd99;var _0x1c3eba;return db[_0xb856('0x2c')][_0xb856('0x4c')]({'where':{'id':_0x41ff12[_0xb856('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cae9d,null))[_0xb856('0x27')](function(_0x316bc8){if(_0x316bc8){_0x58dd99=_0x316bc8;_0x37449f[_0xb856('0x31')]=_[_0xb856('0x33')](db[_0xb856('0x4d')][_0xb856('0x2d')]);_0x37449f[_0xb856('0x32')]=_[_0xb856('0x33')](_0x41ff12[_0xb856('0x32')]);_0x37449f[_0xb856('0x34')]=_['intersection'](_0x37449f[_0xb856('0x31')],_0x37449f[_0xb856('0x32')]);_0x37b4bf[_0xb856('0x37')]=_['intersection'](_0x37449f[_0xb856('0x31')],qs['fields'](_0x41ff12[_0xb856('0x32')]['fields']));_0x37b4bf[_0xb856('0x37')]=_0x37b4bf[_0xb856('0x37')]['length']?_0x37b4bf[_0xb856('0x37')]:_0x37449f[_0xb856('0x31')];_0x37b4bf[_0xb856('0x4e')]=qs[_0xb856('0x3a')](_0x41ff12[_0xb856('0x32')]['sort']);_0x37b4bf[_0xb856('0x3b')]=qs[_0xb856('0x34')](_[_0xb856('0x3c')](_0x41ff12[_0xb856('0x32')],_0x37449f[_0xb856('0x34')]));if(_0x41ff12[_0xb856('0x32')][_0xb856('0x3d')]){_0x37b4bf[_0xb856('0x3b')]=_[_0xb856('0x3e')](_0x37b4bf[_0xb856('0x3b')],{'$or':_[_0xb856('0x2b')](_0x37b4bf['attributes'],function(_0x37831b){var _0x799239={};_0x799239[_0x37831b]={'$like':'%'+_0x41ff12[_0xb856('0x32')]['filter']+'%'};return _0x799239;})});}_0x37b4bf=_[_0xb856('0x3e')]({},_0x37b4bf,_0x41ff12[_0xb856('0x40')]);return _0x58dd99[_0xb856('0x4f')](_0x37b4bf);}})[_0xb856('0x27')](function(_0x324892){if(_0x324892){_0x1c3eba=_0x324892[_0xb856('0x38')];if(!_0x41ff12[_0xb856('0x32')][_0xb856('0x50')](_0xb856('0x39'))){_0x37b4bf[_0xb856('0x1e')]=qs['limit'](_0x41ff12[_0xb856('0x32')][_0xb856('0x1e')]);_0x37b4bf[_0xb856('0x21')]=qs[_0xb856('0x21')](_0x41ff12[_0xb856('0x32')]['offset']);}return _0x58dd99[_0xb856('0x4f')](_0x37b4bf);}})['then'](function(_0x48920e){if(_0x48920e){return _0x48920e?{'count':_0x1c3eba,'rows':_0x48920e}:null;}})[_0xb856('0x27')](respondWithResult(_0x4cae9d,null))[_0xb856('0x43')](handleError(_0x4cae9d,null));};exports['getSubjects']=function(_0xdf0467,_0x475258,_0x3e8884){var _0x504a4e={};var _0x27dd20={};var _0x61f322;var _0x51adf3;return db[_0xb856('0x2c')][_0xb856('0x4c')]({'where':{'id':_0xdf0467[_0xb856('0x45')]['id']}})[_0xb856('0x27')](handleEntityNotFound(_0x475258,null))[_0xb856('0x27')](function(_0x4b4d07){if(_0x4b4d07){_0x61f322=_0x4b4d07;_0x27dd20['model']=_[_0xb856('0x33')](db[_0xb856('0x4d')]['rawAttributes']);_0x27dd20['query']=_['keys'](_0xdf0467[_0xb856('0x32')]);_0x27dd20['filters']=_[_0xb856('0x35')](_0x27dd20[_0xb856('0x31')],_0x27dd20[_0xb856('0x32')]);_0x504a4e[_0xb856('0x37')]=_[_0xb856('0x35')](_0x27dd20[_0xb856('0x31')],qs[_0xb856('0x36')](_0xdf0467[_0xb856('0x32')][_0xb856('0x36')]));_0x504a4e[_0xb856('0x37')]=_0x504a4e['attributes']['length']?_0x504a4e[_0xb856('0x37')]:_0x27dd20['model'];_0x504a4e[_0xb856('0x4e')]=qs['sort'](_0xdf0467[_0xb856('0x32')][_0xb856('0x3a')]);_0x504a4e['where']=qs[_0xb856('0x34')](_[_0xb856('0x3c')](_0xdf0467[_0xb856('0x32')],_0x27dd20[_0xb856('0x34')]));if(_0xdf0467['query'][_0xb856('0x3d')]){_0x504a4e[_0xb856('0x3b')]=_[_0xb856('0x3e')](_0x504a4e['where'],{'$or':_['map'](_0x504a4e['attributes'],function(_0x4eab03){var _0x59cbab={};_0x59cbab[_0x4eab03]={'$like':'%'+_0xdf0467['query'][_0xb856('0x3d')]+'%'};return _0x59cbab;})});}_0x504a4e=_[_0xb856('0x3e')]({},_0x504a4e,_0xdf0467[_0xb856('0x40')]);return _0x61f322[_0xb856('0x51')](_0x504a4e);}})[_0xb856('0x27')](function(_0x5e1574){if(_0x5e1574){_0x51adf3=_0x5e1574['length'];if(!_0xdf0467['query'][_0xb856('0x50')](_0xb856('0x39'))){_0x504a4e[_0xb856('0x1e')]=qs[_0xb856('0x1e')](_0xdf0467['query'][_0xb856('0x1e')]);_0x504a4e[_0xb856('0x21')]=qs['offset'](_0xdf0467['query'][_0xb856('0x21')]);}return _0x61f322[_0xb856('0x51')](_0x504a4e);}})[_0xb856('0x27')](function(_0x1ae66c){if(_0x1ae66c){return _0x1ae66c?{'count':_0x51adf3,'rows':_0x1ae66c}:null;}})[_0xb856('0x27')](respondWithResult(_0x475258,null))[_0xb856('0x43')](handleError(_0x475258,null));};exports[_0xb856('0x52')]=function(_0x497ad4,_0x56bcf2,_0x356473){var _0x90a847={};var _0xded50e={};var _0x54c265;var _0x39ec3b;return db[_0xb856('0x2c')][_0xb856('0x4c')]({'where':{'id':_0x497ad4[_0xb856('0x45')]['id']}})[_0xb856('0x27')](handleEntityNotFound(_0x56bcf2,null))['then'](function(_0x3d3ed6){if(_0x3d3ed6){_0x54c265=_0x3d3ed6;_0xded50e[_0xb856('0x31')]=_[_0xb856('0x33')](db['ServicenowField']['rawAttributes']);_0xded50e[_0xb856('0x32')]=_[_0xb856('0x33')](_0x497ad4[_0xb856('0x32')]);_0xded50e['filters']=_[_0xb856('0x35')](_0xded50e[_0xb856('0x31')],_0xded50e[_0xb856('0x32')]);_0x90a847[_0xb856('0x37')]=_[_0xb856('0x35')](_0xded50e[_0xb856('0x31')],qs[_0xb856('0x36')](_0x497ad4[_0xb856('0x32')][_0xb856('0x36')]));_0x90a847[_0xb856('0x37')]=_0x90a847['attributes'][_0xb856('0x38')]?_0x90a847['attributes']:_0xded50e['model'];_0x90a847[_0xb856('0x4e')]=qs[_0xb856('0x3a')](_0x497ad4['query']['sort']);_0x90a847['where']=qs['filters'](_[_0xb856('0x3c')](_0x497ad4[_0xb856('0x32')],_0xded50e['filters']));if(_0x497ad4[_0xb856('0x32')][_0xb856('0x3d')]){_0x90a847[_0xb856('0x3b')]=_[_0xb856('0x3e')](_0x90a847['where'],{'$or':_[_0xb856('0x2b')](_0x90a847[_0xb856('0x37')],function(_0x37373f){var _0x32da3a={};_0x32da3a[_0x37373f]={'$like':'%'+_0x497ad4[_0xb856('0x32')][_0xb856('0x3d')]+'%'};return _0x32da3a;})});}_0x90a847=_[_0xb856('0x3e')]({},_0x90a847,_0x497ad4[_0xb856('0x40')]);return _0x54c265[_0xb856('0x52')](_0x90a847);}})[_0xb856('0x27')](function(_0x5de8b9){if(_0x5de8b9){_0x39ec3b=_0x5de8b9['length'];if(!_0x497ad4[_0xb856('0x32')][_0xb856('0x50')](_0xb856('0x39'))){_0x90a847[_0xb856('0x1e')]=qs['limit'](_0x497ad4[_0xb856('0x32')][_0xb856('0x1e')]);_0x90a847[_0xb856('0x21')]=qs[_0xb856('0x21')](_0x497ad4[_0xb856('0x32')][_0xb856('0x21')]);}return _0x54c265['getDescriptions'](_0x90a847);}})['then'](function(_0x1e6d48){if(_0x1e6d48){return _0x1e6d48?{'count':_0x39ec3b,'rows':_0x1e6d48}:null;}})[_0xb856('0x27')](respondWithResult(_0x56bcf2,null))[_0xb856('0x43')](handleError(_0x56bcf2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 9f2531a..59c746f 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 _0x8d37=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0x51630e,_0x50ff64){var _0xce886=function(_0x41b3f2){while(--_0x41b3f2){_0x51630e['push'](_0x51630e['shift']());}};_0xce886(++_0x50ff64);}(_0x8d37,0x1d5));var _0x78d3=function(_0x3015ae,_0x4340c2){_0x3015ae=_0x3015ae-0x0;var _0x217f9e=_0x8d37[_0x3015ae];return _0x217f9e;};'use strict';var _=require(_0x78d3('0x0'));var util=require(_0x78d3('0x1'));var logger=require(_0x78d3('0x2'))(_0x78d3('0x3'));var moment=require(_0x78d3('0x4'));var BPromise=require('bluebird');var rp=require(_0x78d3('0x5'));var fs=require('fs');var path=require(_0x78d3('0x6'));var rimraf=require(_0x78d3('0x7'));var config=require(_0x78d3('0x8'));var attributes=require(_0x78d3('0x9'));module[_0x78d3('0xa')]=function(_0xe9d481,_0x24f7b9){return _0xe9d481['define'](_0x78d3('0xb'),attributes,{'tableName':_0x78d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1123=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x162a28,_0x48cc31){var _0x50e0db=function(_0x111a28){while(--_0x111a28){_0x162a28['push'](_0x162a28['shift']());}};_0x50e0db(++_0x48cc31);}(_0x1123,0x118));var _0x3112=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1123[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3112('0x0'))('api');var moment=require(_0x3112('0x1'));var BPromise=require(_0x3112('0x2'));var rp=require(_0x3112('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3112('0x4'));var attributes=require(_0x3112('0x5'));module[_0x3112('0x6')]=function(_0x34ad01,_0xc4b189){return _0x34ad01[_0x3112('0x7')](_0x3112('0x8'),attributes,{'tableName':_0x3112('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 9783ca5..86cd4cc 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 _0xdf98=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x466acd,_0x5921fa){var _0x3ddb83=function(_0x32a40f){while(--_0x32a40f){_0x466acd['push'](_0x466acd['shift']());}};_0x3ddb83(++_0x5921fa);}(_0xdf98,0xcf));var _0x8df9=function(_0x509b2a,_0xf91802){_0x509b2a=_0x509b2a-0x0;var _0x59ff9e=_0xdf98[_0x509b2a];return _0x59ff9e;};'use strict';var _=require(_0x8df9('0x0'));var util=require('util');var moment=require(_0x8df9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df9('0x2'));var db=require(_0x8df9('0x3'))['db'];var utils=require(_0x8df9('0x4'));var logger=require(_0x8df9('0x5'))(_0x8df9('0x6'));var config=require(_0x8df9('0x7'));var jayson=require(_0x8df9('0x8'));var client=jayson[_0x8df9('0x9')][_0x8df9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e79af,_0x1ffe3b,_0x393533){return new BPromise(function(_0x410568,_0x48bc8e){return client['request'](_0x5e79af,_0x393533)[_0x8df9('0xb')](function(_0x513b37){logger[_0x8df9('0xc')](_0x8df9('0xd'),_0x1ffe3b,_0x8df9('0xe'));logger[_0x8df9('0xf')](_0x8df9('0x10'),_0x1ffe3b,_0x8df9('0xe'),JSON[_0x8df9('0x11')](_0x513b37));if(_0x513b37[_0x8df9('0x12')]){if(_0x513b37['error'][_0x8df9('0x13')]===0x1f4){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x48bc8e(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}logger[_0x8df9('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x410568(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}else{logger['info'](_0x8df9('0xd'),_0x1ffe3b,'request\x20sent');_0x410568(_0x513b37[_0x8df9('0x15')]['message']);}})[_0x8df9('0x16')](function(_0x8e547d){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x8e547d);_0x48bc8e(_0x8e547d);});});} \ No newline at end of file +var _0x3e51=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4b5c68,_0x73a64d){var _0xb1a8ce=function(_0x35706c){while(--_0x35706c){_0x4b5c68['push'](_0x4b5c68['shift']());}};_0xb1a8ce(++_0x73a64d);}(_0x3e51,0x74));var _0x13e5=function(_0x421592,_0x615ee8){_0x421592=_0x421592-0x0;var _0x31efaf=_0x3e51[_0x421592];return _0x31efaf;};'use strict';var _=require(_0x13e5('0x0'));var util=require(_0x13e5('0x1'));var moment=require(_0x13e5('0x2'));var BPromise=require(_0x13e5('0x3'));var rs=require(_0x13e5('0x4'));var fs=require('fs');var Redis=require(_0x13e5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x13e5('0x6'));var logger=require(_0x13e5('0x7'))(_0x13e5('0x8'));var config=require(_0x13e5('0x9'));var jayson=require(_0x13e5('0xa'));var client=jayson[_0x13e5('0xb')][_0x13e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe63da4,_0x4c459b,_0x39e201){return new BPromise(function(_0x2abea3,_0xcf8d6b){return client[_0x13e5('0xd')](_0xe63da4,_0x39e201)[_0x13e5('0xe')](function(_0x59ed31){logger[_0x13e5('0xf')](_0x13e5('0x10'),_0x4c459b,_0x13e5('0x11'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4c459b,_0x13e5('0x11'),JSON[_0x13e5('0x12')](_0x59ed31));if(_0x59ed31['error']){if(_0x59ed31[_0x13e5('0x13')][_0x13e5('0x14')]===0x1f4){logger[_0x13e5('0x13')](_0x13e5('0x10'),_0x4c459b,_0x59ed31[_0x13e5('0x13')]['message']);return _0xcf8d6b(_0x59ed31['error'][_0x13e5('0x15')]);}logger[_0x13e5('0x13')](_0x13e5('0x10'),_0x4c459b,_0x59ed31[_0x13e5('0x13')][_0x13e5('0x15')]);return _0x2abea3(_0x59ed31[_0x13e5('0x13')][_0x13e5('0x15')]);}else{logger[_0x13e5('0xf')](_0x13e5('0x10'),_0x4c459b,'request\x20sent');_0x2abea3(_0x59ed31[_0x13e5('0x16')][_0x13e5('0x15')]);}})[_0x13e5('0x17')](function(_0x42d4d1){logger[_0x13e5('0x13')](_0x13e5('0x10'),_0x4c459b,_0x42d4d1);_0xcf8d6b(_0x42d4d1);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4fb98d5..5316b62 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 _0x659b=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x41f47f,_0x2f0746){var _0x3f801d=function(_0x4d6ea0){while(--_0x4d6ea0){_0x41f47f['push'](_0x41f47f['shift']());}};_0x3f801d(++_0x2f0746);}(_0x659b,0x10b));var _0xb659=function(_0x2c6cff,_0x49fba7){_0x2c6cff=_0x2c6cff-0x0;var _0x1acfc5=_0x659b[_0x2c6cff];return _0x1acfc5;};'use strict';var multer=require(_0xb659('0x0'));var util=require('util');var path=require(_0xb659('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb659('0x2')]();var fs_extra=require(_0xb659('0x3'));var auth=require(_0xb659('0x4'));var interaction=require(_0xb659('0x5'));var config=require(_0xb659('0x6'));var controller=require('./intServicenowField.controller');router[_0xb659('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb659('0x8'),auth[_0xb659('0x9')](),controller[_0xb659('0xa')]);router[_0xb659('0xb')]('/',auth[_0xb659('0x9')](),controller[_0xb659('0xc')]);router[_0xb659('0xd')](_0xb659('0x8'),auth['isAuthenticated'](),controller[_0xb659('0xe')]);router['delete'](_0xb659('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xb659('0xf')]=router; \ No newline at end of file +var _0x507a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','multer','connect-timeout'];(function(_0xf78b28,_0x1bb637){var _0x5c8e0b=function(_0xdf4c86){while(--_0xdf4c86){_0xf78b28['push'](_0xf78b28['shift']());}};_0x5c8e0b(++_0x1bb637);}(_0x507a,0x18e));var _0xa507=function(_0x18bffc,_0x84da7f){_0x18bffc=_0x18bffc-0x0;var _0x1ef27a=_0x507a[_0x18bffc];return _0x1ef27a;};'use strict';var multer=require(_0xa507('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa507('0x1'));var express=require(_0xa507('0x2'));var router=express[_0xa507('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa507('0x4'));var interaction=require(_0xa507('0x5'));var config=require(_0xa507('0x6'));var controller=require(_0xa507('0x7'));router[_0xa507('0x8')]('/',auth[_0xa507('0x9')](),controller[_0xa507('0xa')]);router[_0xa507('0x8')](_0xa507('0xb'),auth[_0xa507('0x9')](),controller['show']);router[_0xa507('0xc')]('/',auth[_0xa507('0x9')](),controller[_0xa507('0xd')]);router[_0xa507('0xe')](_0xa507('0xb'),auth[_0xa507('0x9')](),controller['update']);router[_0xa507('0xf')](_0xa507('0xb'),auth[_0xa507('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 9bd4d82..30399d8 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 _0x5bee=['keyValue','picklist','STRING','BOOLEAN','exports','string','variable','customVariable'];(function(_0x362d3d,_0x214629){var _0x5514fa=function(_0x1e88f0){while(--_0x1e88f0){_0x362d3d['push'](_0x362d3d['shift']());}};_0x5514fa(++_0x214629);}(_0x5bee,0x11c));var _0xe5be=function(_0x5f259a,_0x17d242){_0x5f259a=_0x5f259a-0x0;var _0x272c43=_0x5bee[_0x5f259a];return _0x272c43;};'use strict';var Sequelize=require('sequelize');module[_0xe5be('0x0')]={'type':{'type':Sequelize['ENUM'](_0xe5be('0x1'),_0xe5be('0x2'),_0xe5be('0x3'),_0xe5be('0x4'),_0xe5be('0x5')),'defaultValue':_0xe5be('0x1')},'content':{'type':Sequelize[_0xe5be('0x6')]},'key':{'type':Sequelize[_0xe5be('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe5be('0x1'),_0xe5be('0x2'),_0xe5be('0x3'))},'keyContent':{'type':Sequelize[_0xe5be('0x6')]},'idField':{'type':Sequelize[_0xe5be('0x6')]},'nameField':{'type':Sequelize[_0xe5be('0x6')]},'customField':{'type':Sequelize[_0xe5be('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe5be('0x6')]}}; \ No newline at end of file +var _0xde02=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x1f2a18,_0x3cdef4){var _0x29f95e=function(_0x4b653b){while(--_0x4b653b){_0x1f2a18['push'](_0x1f2a18['shift']());}};_0x29f95e(++_0x3cdef4);}(_0xde02,0x69));var _0x2de0=function(_0x5868d0,_0x575917){_0x5868d0=_0x5868d0-0x0;var _0x3f2567=_0xde02[_0x5868d0];return _0x3f2567;};'use strict';var Sequelize=require(_0x2de0('0x0'));module['exports']={'type':{'type':Sequelize[_0x2de0('0x1')](_0x2de0('0x2'),_0x2de0('0x3'),'customVariable',_0x2de0('0x4'),_0x2de0('0x5')),'defaultValue':_0x2de0('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2de0('0x6')]},'keyType':{'type':Sequelize[_0x2de0('0x1')](_0x2de0('0x2'),_0x2de0('0x3'),_0x2de0('0x7'))},'keyContent':{'type':Sequelize[_0x2de0('0x6')]},'idField':{'type':Sequelize[_0x2de0('0x6')]},'nameField':{'type':Sequelize[_0x2de0('0x6')]},'customField':{'type':Sequelize[_0x2de0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2de0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 076f5e1..a2d50be 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 _0x6a98=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','error','name','status','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','ServicenowField','then','includeAll','include','findAll','rows','catch','show','params','options','create','body','find'];(function(_0x33dfa7,_0x428ce6){var _0xc51144=function(_0x2f258a){while(--_0x2f258a){_0x33dfa7['push'](_0x33dfa7['shift']());}};_0xc51144(++_0x428ce6);}(_0x6a98,0x98));var _0x86a9=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x6a98[_0x3042c5];return _0x7cd140;};'use strict';var emlformat=require(_0x86a9('0x0'));var rimraf=require(_0x86a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x86a9('0x2'));var moment=require(_0x86a9('0x3'));var BPromise=require(_0x86a9('0x4'));var Mustache=require(_0x86a9('0x5'));var util=require(_0x86a9('0x6'));var path=require(_0x86a9('0x7'));var sox=require('sox');var csv=require(_0x86a9('0x8'));var ejs=require(_0x86a9('0x9'));var fs=require('fs');var fs_extra=require(_0x86a9('0xa'));var _=require(_0x86a9('0xb'));var squel=require(_0x86a9('0xc'));var crypto=require(_0x86a9('0xd'));var jsforce=require(_0x86a9('0xe'));var deskjs=require(_0x86a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x86a9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a9('0x11'));var as=require(_0x86a9('0x12'));var hardwareService=require(_0x86a9('0x13'));var logger=require(_0x86a9('0x14'))(_0x86a9('0x15'));var utils=require(_0x86a9('0x16'));var config=require(_0x86a9('0x17'));var licenseUtil=require(_0x86a9('0x18'));var db=require(_0x86a9('0x19'))['db'];function respondWithStatusCode(_0x4196f9,_0x18e5a1){_0x18e5a1=_0x18e5a1||0xcc;return function(_0x5e0b6e){if(_0x5e0b6e){return _0x4196f9[_0x86a9('0x1a')](_0x18e5a1);}return _0x4196f9['status'](_0x18e5a1)['end']();};}function respondWithResult(_0xa091aa,_0x1a2ad9){_0x1a2ad9=_0x1a2ad9||0xc8;return function(_0x1993b9){if(_0x1993b9){return _0xa091aa['status'](_0x1a2ad9)[_0x86a9('0x1b')](_0x1993b9);}};}function respondWithFilteredResult(_0x2035b5,_0x27dc5e){return function(_0x1ec0fc){if(_0x1ec0fc){var _0x27c015=typeof _0x27dc5e['offset']===_0x86a9('0x1c')&&typeof _0x27dc5e[_0x86a9('0x1d')]===_0x86a9('0x1c');var _0x260d09=_0x1ec0fc[_0x86a9('0x1e')];var _0x441202=_0x27c015?0x0:_0x27dc5e['offset'];var _0x172ee0=_0x27c015?_0x1ec0fc[_0x86a9('0x1e')]:_0x27dc5e[_0x86a9('0x1f')]+_0x27dc5e[_0x86a9('0x1d')];var _0x131c55;if(_0x172ee0>=_0x260d09){_0x172ee0=_0x260d09;_0x131c55=0xc8;}else{_0x131c55=0xce;}_0x2035b5['status'](_0x131c55);return _0x2035b5['set'](_0x86a9('0x20'),_0x441202+'-'+_0x172ee0+'/'+_0x260d09)['json'](_0x1ec0fc);}return null;};}function patchUpdates(_0x350fb7){return function(_0xa78cf5){try{jsonpatch[_0x86a9('0x21')](_0xa78cf5,_0x350fb7,!![]);}catch(_0x1e169f){return BPromise[_0x86a9('0x22')](_0x1e169f);}return _0xa78cf5[_0x86a9('0x23')]();};}function saveUpdates(_0x4ffd28,_0x5d43f1){return function(_0x10ea2d){if(_0x10ea2d){return _0x10ea2d[_0x86a9('0x24')](_0x4ffd28)['then'](function(_0x3446a4){return _0x3446a4;});}return null;};}function removeEntity(_0x4f4d9a,_0x257b76){return function(_0x3fbbfd){if(_0x3fbbfd){return _0x3fbbfd[_0x86a9('0x25')]()['then'](function(){_0x4f4d9a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ade66,_0x40167b){return function(_0xefc4bf){if(!_0xefc4bf){_0x3ade66[_0x86a9('0x1a')](0x194);}return _0xefc4bf;};}function handleError(_0x5ec81f,_0x458e54){_0x458e54=_0x458e54||0x1f4;return function(_0x413177){logger[_0x86a9('0x26')](_0x413177['stack']);if(_0x413177[_0x86a9('0x27')]){delete _0x413177[_0x86a9('0x27')];}_0x5ec81f[_0x86a9('0x28')](_0x458e54)[_0x86a9('0x29')](_0x413177);};}exports[_0x86a9('0x2a')]=function(_0x56c1be,_0x5dd4cc){var _0x315e29={},_0x6b648d={},_0x57af3a={'count':0x0,'rows':[]};var _0x1dcf2a=_[_0x86a9('0x2b')](db['ServicenowField']['rawAttributes'],function(_0x27b8b9){return{'name':_0x27b8b9[_0x86a9('0x2c')],'type':_0x27b8b9['type']['key']};});_0x6b648d[_0x86a9('0x2d')]=_[_0x86a9('0x2b')](_0x1dcf2a,_0x86a9('0x27'));_0x6b648d[_0x86a9('0x2e')]=_[_0x86a9('0x2f')](_0x56c1be[_0x86a9('0x2e')]);_0x6b648d[_0x86a9('0x30')]=_['intersection'](_0x6b648d[_0x86a9('0x2d')],_0x6b648d['query']);_0x315e29['attributes']=_[_0x86a9('0x31')](_0x6b648d[_0x86a9('0x2d')],qs[_0x86a9('0x32')](_0x56c1be['query'][_0x86a9('0x32')]));_0x315e29['attributes']=_0x315e29[_0x86a9('0x33')][_0x86a9('0x34')]?_0x315e29[_0x86a9('0x33')]:_0x6b648d['model'];if(!_0x56c1be['query'][_0x86a9('0x35')](_0x86a9('0x36'))){_0x315e29[_0x86a9('0x1d')]=qs['limit'](_0x56c1be[_0x86a9('0x2e')][_0x86a9('0x1d')]);_0x315e29['offset']=qs[_0x86a9('0x1f')](_0x56c1be[_0x86a9('0x2e')][_0x86a9('0x1f')]);}_0x315e29[_0x86a9('0x37')]=qs[_0x86a9('0x38')](_0x56c1be[_0x86a9('0x2e')]['sort']);_0x315e29[_0x86a9('0x39')]=qs[_0x86a9('0x30')](_[_0x86a9('0x3a')](_0x56c1be['query'],_0x6b648d[_0x86a9('0x30')]),_0x1dcf2a);if(_0x56c1be[_0x86a9('0x2e')][_0x86a9('0x3b')]){_0x315e29['where']=_['merge'](_0x315e29[_0x86a9('0x39')],{'$or':_[_0x86a9('0x2b')](_0x1dcf2a,function(_0x4f7f74){if(_0x4f7f74[_0x86a9('0x3c')]!==_0x86a9('0x3d')){var _0x1a1584={};_0x1a1584[_0x4f7f74['name']]={'$like':'%'+_0x56c1be['query'][_0x86a9('0x3b')]+'%'};return _0x1a1584;}})});}_0x315e29=_[_0x86a9('0x3e')]({},_0x315e29,_0x56c1be['options']);var _0x1df0b1={'where':_0x315e29[_0x86a9('0x39')]};return db[_0x86a9('0x3f')]['count'](_0x1df0b1)[_0x86a9('0x40')](function(_0x17215a){_0x57af3a['count']=_0x17215a;if(_0x56c1be[_0x86a9('0x2e')][_0x86a9('0x41')]){_0x315e29[_0x86a9('0x42')]=[{'all':!![]}];}return db[_0x86a9('0x3f')][_0x86a9('0x43')](_0x315e29);})[_0x86a9('0x40')](function(_0x173137){_0x57af3a[_0x86a9('0x44')]=_0x173137;return _0x57af3a;})['then'](respondWithFilteredResult(_0x5dd4cc,_0x315e29))[_0x86a9('0x45')](handleError(_0x5dd4cc,null));};exports[_0x86a9('0x46')]=function(_0x10e3f6,_0xb0762d){var _0x1657e2={'raw':!![],'where':{'id':_0x10e3f6[_0x86a9('0x47')]['id']}},_0x512368={};_0x512368[_0x86a9('0x2d')]=_[_0x86a9('0x2f')](db[_0x86a9('0x3f')]['rawAttributes']);_0x512368[_0x86a9('0x2e')]=_[_0x86a9('0x2f')](_0x10e3f6['query']);_0x512368['filters']=_[_0x86a9('0x31')](_0x512368[_0x86a9('0x2d')],_0x512368[_0x86a9('0x2e')]);_0x1657e2['attributes']=_['intersection'](_0x512368[_0x86a9('0x2d')],qs[_0x86a9('0x32')](_0x10e3f6[_0x86a9('0x2e')][_0x86a9('0x32')]));_0x1657e2['attributes']=_0x1657e2['attributes'][_0x86a9('0x34')]?_0x1657e2[_0x86a9('0x33')]:_0x512368[_0x86a9('0x2d')];if(_0x10e3f6[_0x86a9('0x2e')][_0x86a9('0x41')]){_0x1657e2[_0x86a9('0x42')]=[{'all':!![]}];}_0x1657e2=_['merge']({},_0x1657e2,_0x10e3f6[_0x86a9('0x48')]);return db[_0x86a9('0x3f')]['find'](_0x1657e2)[_0x86a9('0x40')](handleEntityNotFound(_0xb0762d,null))[_0x86a9('0x40')](respondWithResult(_0xb0762d,null))[_0x86a9('0x45')](handleError(_0xb0762d,null));};exports['create']=function(_0x13f64e,_0x1e2891){return db[_0x86a9('0x3f')][_0x86a9('0x49')](_0x13f64e[_0x86a9('0x4a')],{})['then'](respondWithResult(_0x1e2891,0xc9))[_0x86a9('0x45')](handleError(_0x1e2891,null));};exports[_0x86a9('0x24')]=function(_0x3684eb,_0x548f7e){if(_0x3684eb[_0x86a9('0x4a')]['id']){delete _0x3684eb[_0x86a9('0x4a')]['id'];}return db['ServicenowField'][_0x86a9('0x4b')]({'where':{'id':_0x3684eb[_0x86a9('0x47')]['id']}})[_0x86a9('0x40')](handleEntityNotFound(_0x548f7e,null))['then'](saveUpdates(_0x3684eb[_0x86a9('0x4a')],null))[_0x86a9('0x40')](respondWithResult(_0x548f7e,null))[_0x86a9('0x45')](handleError(_0x548f7e,null));};exports[_0x86a9('0x25')]=function(_0x492d52,_0x568af2){return db['ServicenowField'][_0x86a9('0x4b')]({'where':{'id':_0x492d52['params']['id']}})[_0x86a9('0x40')](handleEntityNotFound(_0x568af2,null))[_0x86a9('0x40')](removeEntity(_0x568af2,null))['catch'](handleError(_0x568af2,null));}; \ No newline at end of file +var _0xc4d2=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','stack','name','send','map','ServicenowField','type','key','model','query','keys'];(function(_0x20a1db,_0xef0484){var _0x3652ea=function(_0x1768eb){while(--_0x1768eb){_0x20a1db['push'](_0x20a1db['shift']());}};_0x3652ea(++_0xef0484);}(_0xc4d2,0xf4));var _0x2c4d=function(_0x4377f9,_0xbadcd8){_0x4377f9=_0x4377f9-0x0;var _0x571e62=_0xc4d2[_0x4377f9];return _0x571e62;};'use strict';var emlformat=require(_0x2c4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2c4d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c4d('0x2'));var moment=require(_0x2c4d('0x3'));var BPromise=require(_0x2c4d('0x4'));var Mustache=require(_0x2c4d('0x5'));var util=require(_0x2c4d('0x6'));var path=require('path');var sox=require(_0x2c4d('0x7'));var csv=require(_0x2c4d('0x8'));var ejs=require(_0x2c4d('0x9'));var fs=require('fs');var fs_extra=require(_0x2c4d('0xa'));var _=require(_0x2c4d('0xb'));var squel=require('squel');var crypto=require(_0x2c4d('0xc'));var jsforce=require(_0x2c4d('0xd'));var deskjs=require(_0x2c4d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2c4d('0xf'));var Papa=require('papaparse');var Redis=require(_0x2c4d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2c4d('0x11'));var as=require(_0x2c4d('0x12'));var hardwareService=require(_0x2c4d('0x13'));var logger=require(_0x2c4d('0x14'))(_0x2c4d('0x15'));var utils=require(_0x2c4d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2c4d('0x17'));var db=require(_0x2c4d('0x18'))['db'];function respondWithStatusCode(_0x39a645,_0x37b715){_0x37b715=_0x37b715||0xcc;return function(_0x2695e4){if(_0x2695e4){return _0x39a645[_0x2c4d('0x19')](_0x37b715);}return _0x39a645[_0x2c4d('0x1a')](_0x37b715)[_0x2c4d('0x1b')]();};}function respondWithResult(_0x40232a,_0x5df2e1){_0x5df2e1=_0x5df2e1||0xc8;return function(_0x3afa1c){if(_0x3afa1c){return _0x40232a[_0x2c4d('0x1a')](_0x5df2e1)[_0x2c4d('0x1c')](_0x3afa1c);}};}function respondWithFilteredResult(_0x4aeb5c,_0x9c287f){return function(_0x454e47){if(_0x454e47){var _0x34c060=typeof _0x9c287f[_0x2c4d('0x1d')]===_0x2c4d('0x1e')&&typeof _0x9c287f['limit']===_0x2c4d('0x1e');var _0x21bb6c=_0x454e47[_0x2c4d('0x1f')];var _0xc14607=_0x34c060?0x0:_0x9c287f[_0x2c4d('0x1d')];var _0x3108ec=_0x34c060?_0x454e47[_0x2c4d('0x1f')]:_0x9c287f[_0x2c4d('0x1d')]+_0x9c287f[_0x2c4d('0x20')];var _0x340649;if(_0x3108ec>=_0x21bb6c){_0x3108ec=_0x21bb6c;_0x340649=0xc8;}else{_0x340649=0xce;}_0x4aeb5c[_0x2c4d('0x1a')](_0x340649);return _0x4aeb5c[_0x2c4d('0x21')]('Content-Range',_0xc14607+'-'+_0x3108ec+'/'+_0x21bb6c)[_0x2c4d('0x1c')](_0x454e47);}return null;};}function patchUpdates(_0x11d72c){return function(_0x4f798d){try{jsonpatch['apply'](_0x4f798d,_0x11d72c,!![]);}catch(_0x3fa219){return BPromise[_0x2c4d('0x22')](_0x3fa219);}return _0x4f798d['save']();};}function saveUpdates(_0x4d40cb,_0x598d29){return function(_0x20725b){if(_0x20725b){return _0x20725b[_0x2c4d('0x23')](_0x4d40cb)[_0x2c4d('0x24')](function(_0x59b764){return _0x59b764;});}return null;};}function removeEntity(_0x13dd8c,_0x33cf79){return function(_0x49e74a){if(_0x49e74a){return _0x49e74a[_0x2c4d('0x25')]()[_0x2c4d('0x24')](function(){_0x13dd8c[_0x2c4d('0x1a')](0xcc)[_0x2c4d('0x1b')]();});}};}function handleEntityNotFound(_0x51c422,_0x291323){return function(_0x548b00){if(!_0x548b00){_0x51c422['sendStatus'](0x194);}return _0x548b00;};}function handleError(_0x8f64b1,_0x34e9bd){_0x34e9bd=_0x34e9bd||0x1f4;return function(_0x177edd){logger['error'](_0x177edd[_0x2c4d('0x26')]);if(_0x177edd[_0x2c4d('0x27')]){delete _0x177edd[_0x2c4d('0x27')];}_0x8f64b1[_0x2c4d('0x1a')](_0x34e9bd)[_0x2c4d('0x28')](_0x177edd);};}exports['index']=function(_0x39d3b9,_0x5c047a){var _0x2c898c={},_0x16cc6a={},_0x3ee950={'count':0x0,'rows':[]};var _0x4078a4=_[_0x2c4d('0x29')](db[_0x2c4d('0x2a')]['rawAttributes'],function(_0x338264){return{'name':_0x338264['fieldName'],'type':_0x338264[_0x2c4d('0x2b')][_0x2c4d('0x2c')]};});_0x16cc6a[_0x2c4d('0x2d')]=_[_0x2c4d('0x29')](_0x4078a4,_0x2c4d('0x27'));_0x16cc6a[_0x2c4d('0x2e')]=_[_0x2c4d('0x2f')](_0x39d3b9[_0x2c4d('0x2e')]);_0x16cc6a[_0x2c4d('0x30')]=_[_0x2c4d('0x31')](_0x16cc6a['model'],_0x16cc6a[_0x2c4d('0x2e')]);_0x2c898c[_0x2c4d('0x32')]=_[_0x2c4d('0x31')](_0x16cc6a['model'],qs[_0x2c4d('0x33')](_0x39d3b9['query'][_0x2c4d('0x33')]));_0x2c898c[_0x2c4d('0x32')]=_0x2c898c[_0x2c4d('0x32')][_0x2c4d('0x34')]?_0x2c898c[_0x2c4d('0x32')]:_0x16cc6a['model'];if(!_0x39d3b9['query'][_0x2c4d('0x35')](_0x2c4d('0x36'))){_0x2c898c['limit']=qs[_0x2c4d('0x20')](_0x39d3b9[_0x2c4d('0x2e')]['limit']);_0x2c898c[_0x2c4d('0x1d')]=qs[_0x2c4d('0x1d')](_0x39d3b9[_0x2c4d('0x2e')][_0x2c4d('0x1d')]);}_0x2c898c[_0x2c4d('0x37')]=qs[_0x2c4d('0x38')](_0x39d3b9['query'][_0x2c4d('0x38')]);_0x2c898c[_0x2c4d('0x39')]=qs[_0x2c4d('0x30')](_[_0x2c4d('0x3a')](_0x39d3b9[_0x2c4d('0x2e')],_0x16cc6a['filters']),_0x4078a4);if(_0x39d3b9[_0x2c4d('0x2e')][_0x2c4d('0x3b')]){_0x2c898c[_0x2c4d('0x39')]=_['merge'](_0x2c898c['where'],{'$or':_['map'](_0x4078a4,function(_0x379071){if(_0x379071[_0x2c4d('0x2b')]!==_0x2c4d('0x3c')){var _0x4164be={};_0x4164be[_0x379071['name']]={'$like':'%'+_0x39d3b9[_0x2c4d('0x2e')][_0x2c4d('0x3b')]+'%'};return _0x4164be;}})});}_0x2c898c=_['merge']({},_0x2c898c,_0x39d3b9[_0x2c4d('0x3d')]);var _0x412895={'where':_0x2c898c['where']};return db['ServicenowField'][_0x2c4d('0x1f')](_0x412895)[_0x2c4d('0x24')](function(_0x183819){_0x3ee950[_0x2c4d('0x1f')]=_0x183819;if(_0x39d3b9[_0x2c4d('0x2e')][_0x2c4d('0x3e')]){_0x2c898c['include']=[{'all':!![]}];}return db['ServicenowField'][_0x2c4d('0x3f')](_0x2c898c);})[_0x2c4d('0x24')](function(_0x47ced2){_0x3ee950[_0x2c4d('0x40')]=_0x47ced2;return _0x3ee950;})[_0x2c4d('0x24')](respondWithFilteredResult(_0x5c047a,_0x2c898c))[_0x2c4d('0x41')](handleError(_0x5c047a,null));};exports[_0x2c4d('0x42')]=function(_0x434ea4,_0xce5f56){var _0x4d545a={'raw':!![],'where':{'id':_0x434ea4[_0x2c4d('0x43')]['id']}},_0x5d6d63={};_0x5d6d63[_0x2c4d('0x2d')]=_[_0x2c4d('0x2f')](db[_0x2c4d('0x2a')][_0x2c4d('0x44')]);_0x5d6d63[_0x2c4d('0x2e')]=_[_0x2c4d('0x2f')](_0x434ea4[_0x2c4d('0x2e')]);_0x5d6d63[_0x2c4d('0x30')]=_['intersection'](_0x5d6d63['model'],_0x5d6d63['query']);_0x4d545a[_0x2c4d('0x32')]=_['intersection'](_0x5d6d63[_0x2c4d('0x2d')],qs[_0x2c4d('0x33')](_0x434ea4[_0x2c4d('0x2e')][_0x2c4d('0x33')]));_0x4d545a[_0x2c4d('0x32')]=_0x4d545a[_0x2c4d('0x32')][_0x2c4d('0x34')]?_0x4d545a[_0x2c4d('0x32')]:_0x5d6d63[_0x2c4d('0x2d')];if(_0x434ea4[_0x2c4d('0x2e')][_0x2c4d('0x3e')]){_0x4d545a[_0x2c4d('0x45')]=[{'all':!![]}];}_0x4d545a=_['merge']({},_0x4d545a,_0x434ea4[_0x2c4d('0x3d')]);return db[_0x2c4d('0x2a')][_0x2c4d('0x46')](_0x4d545a)[_0x2c4d('0x24')](handleEntityNotFound(_0xce5f56,null))[_0x2c4d('0x24')](respondWithResult(_0xce5f56,null))[_0x2c4d('0x41')](handleError(_0xce5f56,null));};exports['create']=function(_0x4d2c12,_0x3d4323){return db[_0x2c4d('0x2a')][_0x2c4d('0x47')](_0x4d2c12[_0x2c4d('0x48')],{})[_0x2c4d('0x24')](respondWithResult(_0x3d4323,0xc9))[_0x2c4d('0x41')](handleError(_0x3d4323,null));};exports[_0x2c4d('0x23')]=function(_0x2c9546,_0x348a63){if(_0x2c9546['body']['id']){delete _0x2c9546['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x2c9546[_0x2c4d('0x43')]['id']}})[_0x2c4d('0x24')](handleEntityNotFound(_0x348a63,null))[_0x2c4d('0x24')](saveUpdates(_0x2c9546[_0x2c4d('0x48')],null))['then'](respondWithResult(_0x348a63,null))['catch'](handleError(_0x348a63,null));};exports[_0x2c4d('0x25')]=function(_0x434d68,_0xd14145){return db[_0x2c4d('0x2a')][_0x2c4d('0x46')]({'where':{'id':_0x434d68[_0x2c4d('0x43')]['id']}})[_0x2c4d('0x24')](handleEntityNotFound(_0xd14145,null))[_0x2c4d('0x24')](removeEntity(_0xd14145,null))[_0x2c4d('0x41')](handleError(_0xd14145,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 98ebb30..2557d26 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 _0x1e6a=['rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e6a,0xe9));var _0xa1e6=function(_0x1f1827,_0x400a73){_0x1f1827=_0x1f1827-0x0;var _0x292e2b=_0x1e6a[_0x1f1827];return _0x292e2b;};'use strict';var _=require(_0xa1e6('0x0'));var util=require(_0xa1e6('0x1'));var logger=require(_0xa1e6('0x2'))(_0xa1e6('0x3'));var moment=require(_0xa1e6('0x4'));var BPromise=require(_0xa1e6('0x5'));var rp=require(_0xa1e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1e6('0x7'));var config=require(_0xa1e6('0x8'));var attributes=require(_0xa1e6('0x9'));module['exports']=function(_0x40a3ca,_0x22ddcd){return _0x40a3ca[_0xa1e6('0xa')](_0xa1e6('0xb'),attributes,{'tableName':_0xa1e6('0xc'),'paranoid':![],'indexes':[{'name':_0xa1e6('0xd'),'fields':[_0xa1e6('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0644=['../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x0644,0x1c6));var _0x4064=function(_0xc745ce,_0x2eb9a8){_0xc745ce=_0xc745ce-0x0;var _0x36fa8c=_0x0644[_0xc745ce];return _0x36fa8c;};'use strict';var _=require(_0x4064('0x0'));var util=require(_0x4064('0x1'));var logger=require(_0x4064('0x2'))(_0x4064('0x3'));var moment=require('moment');var BPromise=require(_0x4064('0x4'));var rp=require(_0x4064('0x5'));var fs=require('fs');var path=require(_0x4064('0x6'));var rimraf=require(_0x4064('0x7'));var config=require(_0x4064('0x8'));var attributes=require(_0x4064('0x9'));module['exports']=function(_0x55c1b3,_0x4ac019){return _0x55c1b3[_0x4064('0xa')](_0x4064('0xb'),attributes,{'tableName':_0x4064('0xc'),'paranoid':![],'indexes':[{'name':_0x4064('0xd'),'fields':['idField','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 0610883..2314601 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x504513,_0xcf4f09){var _0x2f5703=function(_0x575b34){while(--_0x575b34){_0x504513['push'](_0x504513['shift']());}};_0x2f5703(++_0xcf4f09);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb7e7[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xda3f,0xec));var _0xfda3=function(_0x3a66fe,_0x485c1e){_0x3a66fe=_0x3a66fe-0x0;var _0x3c813b=_0xda3f[_0x3a66fe];return _0x3c813b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 3fdc0a3..e54327f 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2978fc,_0x4d6f05){var _0x985231=function(_0x3160f7){while(--_0x3160f7){_0x2978fc['push'](_0x2978fc['shift']());}};_0x985231(++_0x4d6f05);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _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(_0x4c8836,_0x18a813){var _0x2b6689=function(_0x3831e3){while(--_0x3831e3){_0x4c8836['push'](_0x4c8836['shift']());}};_0x2b6689(++_0x18a813);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 885a48c..2571f4f 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(_0x4a1f69,_0x40c388){var _0x449108=function(_0xf66fa3){while(--_0xf66fa3){_0x4a1f69['push'](_0x4a1f69['shift']());}};_0x449108(++_0x40c388);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x33b3ff,_0x2f9cd8){var _0x40e451=function(_0x2ddbc9){while(--_0x2ddbc9){_0x33b3ff['push'](_0x33b3ff['shift']());}};_0x40e451(++_0x2f9cd8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index b819a53..3e3c5ed 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 _0xfe3f=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','options','find','catch','create','update','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','Invalid\x20Login','get_module_fields','Calls','values','includes','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key'];(function(_0x59f93a,_0x2fe0fd){var _0x46e587=function(_0x494ff4){while(--_0x494ff4){_0x59f93a['push'](_0x59f93a['shift']());}};_0x46e587(++_0x2fe0fd);}(_0xfe3f,0x193));var _0xffe3=function(_0x45a16d,_0x150593){_0x45a16d=_0x45a16d-0x0;var _0x30212a=_0xfe3f[_0x45a16d];return _0x30212a;};'use strict';var emlformat=require(_0xffe3('0x0'));var rimraf=require(_0xffe3('0x1'));var zipdir=require(_0xffe3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffe3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xffe3('0x4'));var util=require(_0xffe3('0x5'));var path=require(_0xffe3('0x6'));var sox=require(_0xffe3('0x7'));var csv=require(_0xffe3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffe3('0x9'));var squel=require('squel');var crypto=require(_0xffe3('0xa'));var jsforce=require(_0xffe3('0xb'));var deskjs=require(_0xffe3('0xc'));var toCsv=require(_0xffe3('0x8'));var querystring=require(_0xffe3('0xd'));var Papa=require(_0xffe3('0xe'));var Redis=require(_0xffe3('0xf'));var authService=require(_0xffe3('0x10'));var qs=require(_0xffe3('0x11'));var as=require(_0xffe3('0x12'));var hardwareService=require(_0xffe3('0x13'));var logger=require('../../config/logger')(_0xffe3('0x14'));var utils=require(_0xffe3('0x15'));var config=require(_0xffe3('0x16'));var licenseUtil=require(_0xffe3('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44a503,_0x2473b3){_0x2473b3=_0x2473b3||0xcc;return function(_0x438ced){if(_0x438ced){return _0x44a503['sendStatus'](_0x2473b3);}return _0x44a503[_0xffe3('0x18')](_0x2473b3)[_0xffe3('0x19')]();};}function respondWithResult(_0x25d472,_0x18c555){_0x18c555=_0x18c555||0xc8;return function(_0x8756a9){if(_0x8756a9){return _0x25d472[_0xffe3('0x18')](_0x18c555)[_0xffe3('0x1a')](_0x8756a9);}};}function respondWithFilteredResult(_0x155f3a,_0x4d865b){return function(_0x2d1b2f){if(_0x2d1b2f){var _0x2734de=typeof _0x4d865b[_0xffe3('0x1b')]===_0xffe3('0x1c')&&typeof _0x4d865b[_0xffe3('0x1d')]==='undefined';var _0x5bcfb8=_0x2d1b2f[_0xffe3('0x1e')];var _0x15cb32=_0x2734de?0x0:_0x4d865b['offset'];var _0x4fb43a=_0x2734de?_0x2d1b2f[_0xffe3('0x1e')]:_0x4d865b['offset']+_0x4d865b['limit'];var _0x4e1084;if(_0x4fb43a>=_0x5bcfb8){_0x4fb43a=_0x5bcfb8;_0x4e1084=0xc8;}else{_0x4e1084=0xce;}_0x155f3a['status'](_0x4e1084);return _0x155f3a['set'](_0xffe3('0x1f'),_0x15cb32+'-'+_0x4fb43a+'/'+_0x5bcfb8)['json'](_0x2d1b2f);}return null;};}function patchUpdates(_0x212826){return function(_0x1d1a86){try{jsonpatch['apply'](_0x1d1a86,_0x212826,!![]);}catch(_0x1ee4e8){return BPromise['reject'](_0x1ee4e8);}return _0x1d1a86[_0xffe3('0x20')]();};}function saveUpdates(_0x3c85f7,_0x1e4750){return function(_0x285661){if(_0x285661){return _0x285661['update'](_0x3c85f7)[_0xffe3('0x21')](function(_0x19e2e7){return _0x19e2e7;});}return null;};}function removeEntity(_0x490687,_0x3536b7){return function(_0x1b04c7){if(_0x1b04c7){return _0x1b04c7[_0xffe3('0x22')]()['then'](function(){_0x490687[_0xffe3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5ebc,_0xe27ec5){return function(_0x469d12){if(!_0x469d12){_0x2c5ebc['sendStatus'](0x194);}return _0x469d12;};}function handleError(_0x54b402,_0x570675){_0x570675=_0x570675||0x1f4;return function(_0x5f19c4){logger[_0xffe3('0x23')](_0x5f19c4[_0xffe3('0x24')]);if(_0x5f19c4[_0xffe3('0x25')]){delete _0x5f19c4[_0xffe3('0x25')];}_0x54b402[_0xffe3('0x18')](_0x570675)['send'](_0x5f19c4);};}exports[_0xffe3('0x26')]=function(_0x29851f,_0x22f5ed){var _0x13d1d9={},_0x2851d0={},_0x565d47={'count':0x0,'rows':[]};var _0x45a5f3=_[_0xffe3('0x27')](db[_0xffe3('0x28')][_0xffe3('0x29')],function(_0x297530){return{'name':_0x297530[_0xffe3('0x2a')],'type':_0x297530[_0xffe3('0x2b')][_0xffe3('0x2c')]};});_0x2851d0[_0xffe3('0x2d')]=_['map'](_0x45a5f3,_0xffe3('0x25'));_0x2851d0[_0xffe3('0x2e')]=_[_0xffe3('0x2f')](_0x29851f[_0xffe3('0x2e')]);_0x2851d0['filters']=_[_0xffe3('0x30')](_0x2851d0['model'],_0x2851d0[_0xffe3('0x2e')]);_0x13d1d9[_0xffe3('0x31')]=_['intersection'](_0x2851d0['model'],qs['fields'](_0x29851f['query'][_0xffe3('0x32')]));_0x13d1d9[_0xffe3('0x31')]=_0x13d1d9[_0xffe3('0x31')][_0xffe3('0x33')]?_0x13d1d9[_0xffe3('0x31')]:_0x2851d0[_0xffe3('0x2d')];if(!_0x29851f['query'][_0xffe3('0x34')](_0xffe3('0x35'))){_0x13d1d9[_0xffe3('0x1d')]=qs[_0xffe3('0x1d')](_0x29851f[_0xffe3('0x2e')]['limit']);_0x13d1d9['offset']=qs[_0xffe3('0x1b')](_0x29851f['query']['offset']);}_0x13d1d9[_0xffe3('0x36')]=qs[_0xffe3('0x37')](_0x29851f['query']['sort']);_0x13d1d9['where']=qs[_0xffe3('0x38')](_['pick'](_0x29851f['query'],_0x2851d0['filters']),_0x45a5f3);if(_0x29851f[_0xffe3('0x2e')][_0xffe3('0x39')]){_0x13d1d9[_0xffe3('0x3a')]=_[_0xffe3('0x3b')](_0x13d1d9[_0xffe3('0x3a')],{'$or':_[_0xffe3('0x27')](_0x45a5f3,function(_0x35b7d2){if(_0x35b7d2[_0xffe3('0x2b')]!==_0xffe3('0x3c')){var _0x1a3612={};_0x1a3612[_0x35b7d2[_0xffe3('0x25')]]={'$like':'%'+_0x29851f[_0xffe3('0x2e')][_0xffe3('0x39')]+'%'};return _0x1a3612;}})});}_0x13d1d9=_[_0xffe3('0x3b')]({},_0x13d1d9,_0x29851f['options']);var _0xecca2d={'where':_0x13d1d9[_0xffe3('0x3a')]};return db[_0xffe3('0x28')][_0xffe3('0x1e')](_0xecca2d)[_0xffe3('0x21')](function(_0x2428ec){_0x565d47[_0xffe3('0x1e')]=_0x2428ec;if(_0x29851f[_0xffe3('0x2e')]['includeAll']){_0x13d1d9['include']=[{'all':!![]}];}return db[_0xffe3('0x28')][_0xffe3('0x3d')](_0x13d1d9);})['then'](function(_0x1b5514){_0x565d47[_0xffe3('0x3e')]=_0x1b5514;return _0x565d47;})[_0xffe3('0x21')](respondWithFilteredResult(_0x22f5ed,_0x13d1d9))['catch'](handleError(_0x22f5ed,null));};exports[_0xffe3('0x3f')]=function(_0x45c956,_0x227633){var _0x95e2={'raw':![],'where':{'id':_0x45c956[_0xffe3('0x40')]['id']}},_0x18de62={};_0x18de62[_0xffe3('0x2d')]=_[_0xffe3('0x2f')](db[_0xffe3('0x28')]['rawAttributes']);_0x18de62[_0xffe3('0x2e')]=_[_0xffe3('0x2f')](_0x45c956['query']);_0x18de62['filters']=_[_0xffe3('0x30')](_0x18de62[_0xffe3('0x2d')],_0x18de62[_0xffe3('0x2e')]);_0x95e2[_0xffe3('0x31')]=_['intersection'](_0x18de62[_0xffe3('0x2d')],qs[_0xffe3('0x32')](_0x45c956[_0xffe3('0x2e')][_0xffe3('0x32')]));_0x95e2[_0xffe3('0x31')]=_0x95e2[_0xffe3('0x31')][_0xffe3('0x33')]?_0x95e2[_0xffe3('0x31')]:_0x18de62['model'];if(_0x45c956[_0xffe3('0x2e')][_0xffe3('0x41')]){_0x95e2[_0xffe3('0x42')]=[{'all':!![]}];}_0x95e2=_[_0xffe3('0x3b')]({},_0x95e2,_0x45c956[_0xffe3('0x43')]);return db[_0xffe3('0x28')][_0xffe3('0x44')](_0x95e2)[_0xffe3('0x21')](handleEntityNotFound(_0x227633,null))['then'](respondWithResult(_0x227633,null))[_0xffe3('0x45')](handleError(_0x227633,null));};exports[_0xffe3('0x46')]=function(_0x364924,_0x3c4910){return db[_0xffe3('0x28')][_0xffe3('0x46')](_0x364924['body'],{})[_0xffe3('0x21')](respondWithResult(_0x3c4910,0xc9))[_0xffe3('0x45')](handleError(_0x3c4910,null));};exports[_0xffe3('0x47')]=function(_0x335305,_0x488ab7){if(_0x335305[_0xffe3('0x48')]['id']){delete _0x335305[_0xffe3('0x48')]['id'];}return db[_0xffe3('0x28')][_0xffe3('0x44')]({'where':{'id':_0x335305['params']['id']}})[_0xffe3('0x21')](handleEntityNotFound(_0x488ab7,null))[_0xffe3('0x21')](saveUpdates(_0x335305[_0xffe3('0x48')],null))[_0xffe3('0x21')](respondWithResult(_0x488ab7,null))[_0xffe3('0x45')](handleError(_0x488ab7,null));};exports[_0xffe3('0x22')]=function(_0x2ef59f,_0x19a1fb){return db['SugarcrmAccount']['find']({'where':{'id':_0x2ef59f[_0xffe3('0x40')]['id']}})['then'](handleEntityNotFound(_0x19a1fb,null))[_0xffe3('0x21')](removeEntity(_0x19a1fb,null))['catch'](handleError(_0x19a1fb,null));};exports[_0xffe3('0x49')]=function(_0x5ae65e,_0x333393,_0x209d2f){var _0x1d506d={};var _0x27d85c={};var _0x3ea1a1;var _0x349dfe;return db[_0xffe3('0x28')][_0xffe3('0x4a')]({'where':{'id':_0x5ae65e['params']['id']}})['then'](handleEntityNotFound(_0x333393,null))[_0xffe3('0x21')](function(_0x29dfb6){if(_0x29dfb6){_0x3ea1a1=_0x29dfb6;_0x27d85c[_0xffe3('0x2d')]=_[_0xffe3('0x2f')](db[_0xffe3('0x4b')][_0xffe3('0x29')]);_0x27d85c[_0xffe3('0x2e')]=_[_0xffe3('0x2f')](_0x5ae65e['query']);_0x27d85c[_0xffe3('0x38')]=_[_0xffe3('0x30')](_0x27d85c['model'],_0x27d85c[_0xffe3('0x2e')]);_0x1d506d[_0xffe3('0x31')]=_['intersection'](_0x27d85c['model'],qs[_0xffe3('0x32')](_0x5ae65e[_0xffe3('0x2e')]['fields']));_0x1d506d[_0xffe3('0x31')]=_0x1d506d['attributes'][_0xffe3('0x33')]?_0x1d506d['attributes']:_0x27d85c[_0xffe3('0x2d')];_0x1d506d[_0xffe3('0x36')]=qs[_0xffe3('0x37')](_0x5ae65e[_0xffe3('0x2e')][_0xffe3('0x37')]);_0x1d506d[_0xffe3('0x3a')]=qs[_0xffe3('0x38')](_['pick'](_0x5ae65e[_0xffe3('0x2e')],_0x27d85c[_0xffe3('0x38')]));if(_0x5ae65e[_0xffe3('0x2e')]['filter']){_0x1d506d[_0xffe3('0x3a')]=_[_0xffe3('0x3b')](_0x1d506d[_0xffe3('0x3a')],{'$or':_[_0xffe3('0x27')](_0x1d506d['attributes'],function(_0x42219e){var _0x30e461={};_0x30e461[_0x42219e]={'$like':'%'+_0x5ae65e[_0xffe3('0x2e')][_0xffe3('0x39')]+'%'};return _0x30e461;})});}_0x1d506d=_['merge']({},_0x1d506d,_0x5ae65e['options']);return _0x3ea1a1[_0xffe3('0x49')](_0x1d506d);}})[_0xffe3('0x21')](function(_0x2a7a6e){if(_0x2a7a6e){_0x349dfe=_0x2a7a6e[_0xffe3('0x33')];if(!_0x5ae65e[_0xffe3('0x2e')][_0xffe3('0x34')](_0xffe3('0x35'))){_0x1d506d[_0xffe3('0x1d')]=qs['limit'](_0x5ae65e[_0xffe3('0x2e')]['limit']);_0x1d506d[_0xffe3('0x1b')]=qs['offset'](_0x5ae65e[_0xffe3('0x2e')]['offset']);}return _0x3ea1a1[_0xffe3('0x49')](_0x1d506d);}})['then'](function(_0x5abf58){if(_0x5abf58){return _0x5abf58?{'count':_0x349dfe,'rows':_0x5abf58}:null;}})[_0xffe3('0x21')](respondWithResult(_0x333393,null))['catch'](handleError(_0x333393,null));};exports[_0xffe3('0x4c')]=function(_0x47ef66,_0xe0b45c,_0x2644d1){if(_0x47ef66['body']['id']){delete _0x47ef66[_0xffe3('0x48')]['id'];}return db[_0xffe3('0x28')][_0xffe3('0x4a')]({'where':{'id':_0x47ef66[_0xffe3('0x40')]['id']}})['then'](handleEntityNotFound(_0xe0b45c,null))[_0xffe3('0x21')](function(_0x323029){if(_0x323029){_0x47ef66[_0xffe3('0x48')]['AccountId']=_0x323029['id'];_0x47ef66[_0xffe3('0x48')][_0xffe3('0x4d')]=integrations[_0xffe3('0x4e')](_0x47ef66[_0xffe3('0x48')][_0xffe3('0x4f')],_0x47ef66[_0xffe3('0x48')][_0xffe3('0x2b')]);_0x47ef66[_0xffe3('0x48')][_0xffe3('0x50')]=integrations[_0xffe3('0x51')](_0x47ef66[_0xffe3('0x48')]['channel'],_0x47ef66['body']['type']);return db[_0xffe3('0x4b')][_0xffe3('0x46')](_0x47ef66[_0xffe3('0x48')],{'include':[{'model':db[_0xffe3('0x52')],'as':_0xffe3('0x4d')},{'model':db[_0xffe3('0x52')],'as':_0xffe3('0x50')}]});}return null;})[_0xffe3('0x21')](respondWithResult(_0xe0b45c,null))[_0xffe3('0x45')](handleError(_0xe0b45c,null));};exports[_0xffe3('0x53')]=function(_0x42d743,_0x4a7c6f,_0x7cf6c){var _0x18b05f='';var _0x32040d=['id','name',_0xffe3('0x54'),'created_by',_0xffe3('0x55'),_0xffe3('0x56'),_0xffe3('0x57'),'duration_minutes','parent_id','parent_type',_0xffe3('0x58'),_0xffe3('0x59')];return db[_0xffe3('0x28')][_0xffe3('0x4a')]({'where':{'id':_0x42d743[_0xffe3('0x40')]['id']},'attributes':['id',_0xffe3('0x5a'),_0xffe3('0x5b'),_0xffe3('0x5c')]})['then'](handleEntityNotFound(_0x4a7c6f,null))[_0xffe3('0x21')](function(_0x3734eb){if(_0x3734eb){_0x18b05f=_0x3734eb['remoteUri'];var _0x4700a2=_0x18b05f[_0xffe3('0x5d')](-0x1);if(_0x4700a2==='/'){_0x18b05f=_0x18b05f[_0xffe3('0x5e')](0x0,_0x18b05f['lastIndexOf'](_0x4700a2));}return rp({'method':_0xffe3('0x5f'),'uri':util['format'](_0xffe3('0x60'),_0x18b05f,_0xffe3('0x61')),'json':!![],'form':{'method':_0xffe3('0x62'),'input_type':'JSON','response_type':_0xffe3('0x63'),'rest_data':JSON[_0xffe3('0x64')]({'user_auth':{'user_name':_0x3734eb[_0xffe3('0x5a')],'password':_0x3734eb[_0xffe3('0x5b')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xffe3('0x21')](function(_0x30f9d7){if(_0x30f9d7&&_0x30f9d7[_0xffe3('0x25')]!==_0xffe3('0x65')&&_0x30f9d7[_0xffe3('0x25')]!=='Password\x20Expired'){return rp({'method':_0xffe3('0x5f'),'uri':util['format'](_0xffe3('0x60'),_0x18b05f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xffe3('0x66'),'input_type':_0xffe3('0x63'),'response_type':_0xffe3('0x63'),'rest_data':JSON[_0xffe3('0x64')]({'session':_0x30f9d7['id'],'module_name':_0xffe3('0x67')})}})['then'](function(_0x539ae4){if(_0x539ae4){var _0x5d3732=_[_0xffe3('0x68')](_0x539ae4['module_fields']);_['remove'](_0x5d3732,function(_0x51f79b){return _0x32040d[_0xffe3('0x69')](_0x51f79b['name']);});return{'count':_0x5d3732['length'],'rows':_['map'](_0x5d3732,function(_0x226d48){return{'id':_0x226d48[_0xffe3('0x25')],'name':_0x226d48[_0xffe3('0x6a')],'custom':_['endsWith'](_0x226d48[_0xffe3('0x25')],'_c')?!![]:![],'options':_0x226d48[_0xffe3('0x43')]?_[_0xffe3('0x27')](_[_0xffe3('0x68')](_0x226d48['options']),function(_0x54ec4e){return{'name':_0x54ec4e['value'],'value':_0x54ec4e[_0xffe3('0x25')]};}):[]};})};}})[_0xffe3('0x21')](respondWithResult(_0x4a7c6f,null))[_0xffe3('0x45')](function(_0x294aca){var _0xdeaf1d=_0x42d743[_0xffe3('0x2e')]['test']?0x1f4:_0x294aca[_0xffe3('0x6b')]||0x1f4;logger['error'](_0xffe3('0x6c'),_0xffe3('0x53'),_0xdeaf1d,JSON[_0xffe3('0x64')](_0x294aca));delete _0x294aca['name'];if(_0xdeaf1d===0x191){_0xdeaf1d=0x190;}_0x4a7c6f[_0xffe3('0x18')](_0xdeaf1d)[_0xffe3('0x6d')](_0x42d743[_0xffe3('0x2e')][_0xffe3('0x6e')]?{'message':_0xffe3('0x6f'),'statusCode':_0x294aca[_0xffe3('0x6b')]}:_0x294aca);});}else{var _0x1e933c=0x1f4;_0x4a7c6f[_0xffe3('0x18')](_0x1e933c)[_0xffe3('0x6d')]({'message':_0xffe3('0x6f'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x07af=['lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','error','stack','name','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','SugarcrmConfiguration','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','login','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','POST','/service/v4_1/rest.php','get_module_fields','JSON','Calls','values','remove','includes','label','endsWith','test','statusCode','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0xe5acd3,_0xa15c46){var _0x47a60d=function(_0x73c5ee){while(--_0x73c5ee){_0xe5acd3['push'](_0xe5acd3['shift']());}};_0x47a60d(++_0xa15c46);}(_0x07af,0x1ba));var _0xf07a=function(_0x476533,_0x111950){_0x476533=_0x476533-0x0;var _0x35f782=_0x07af[_0x476533];return _0x35f782;};'use strict';var emlformat=require(_0xf07a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf07a('0x1'));var jsonpatch=require(_0xf07a('0x2'));var rp=require(_0xf07a('0x3'));var moment=require(_0xf07a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf07a('0x5'));var path=require(_0xf07a('0x6'));var sox=require(_0xf07a('0x7'));var csv=require(_0xf07a('0x8'));var ejs=require(_0xf07a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf07a('0xa'));var squel=require('squel');var crypto=require(_0xf07a('0xb'));var jsforce=require(_0xf07a('0xc'));var deskjs=require(_0xf07a('0xd'));var toCsv=require(_0xf07a('0x8'));var querystring=require(_0xf07a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf07a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf07a('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf07a('0x11'));var licenseUtil=require(_0xf07a('0x12'));var db=require(_0xf07a('0x13'))['db'];var integrations=require(_0xf07a('0x14'));function respondWithStatusCode(_0x2e5c1f,_0x3ca3e6){_0x3ca3e6=_0x3ca3e6||0xcc;return function(_0x4b57a8){if(_0x4b57a8){return _0x2e5c1f[_0xf07a('0x15')](_0x3ca3e6);}return _0x2e5c1f[_0xf07a('0x16')](_0x3ca3e6)[_0xf07a('0x17')]();};}function respondWithResult(_0x213f81,_0x5e7686){_0x5e7686=_0x5e7686||0xc8;return function(_0x337c71){if(_0x337c71){return _0x213f81[_0xf07a('0x16')](_0x5e7686)[_0xf07a('0x18')](_0x337c71);}};}function respondWithFilteredResult(_0x5910e2,_0x4c7342){return function(_0xd89ace){if(_0xd89ace){var _0x4ad26d=typeof _0x4c7342[_0xf07a('0x19')]===_0xf07a('0x1a')&&typeof _0x4c7342[_0xf07a('0x1b')]===_0xf07a('0x1a');var _0x5bb03c=_0xd89ace['count'];var _0x42f08=_0x4ad26d?0x0:_0x4c7342[_0xf07a('0x19')];var _0x9e1e6b=_0x4ad26d?_0xd89ace[_0xf07a('0x1c')]:_0x4c7342[_0xf07a('0x19')]+_0x4c7342[_0xf07a('0x1b')];var _0x7a791;if(_0x9e1e6b>=_0x5bb03c){_0x9e1e6b=_0x5bb03c;_0x7a791=0xc8;}else{_0x7a791=0xce;}_0x5910e2[_0xf07a('0x16')](_0x7a791);return _0x5910e2[_0xf07a('0x1d')](_0xf07a('0x1e'),_0x42f08+'-'+_0x9e1e6b+'/'+_0x5bb03c)[_0xf07a('0x18')](_0xd89ace);}return null;};}function patchUpdates(_0x8aa408){return function(_0x48d1ce){try{jsonpatch['apply'](_0x48d1ce,_0x8aa408,!![]);}catch(_0x4f1284){return BPromise[_0xf07a('0x1f')](_0x4f1284);}return _0x48d1ce['save']();};}function saveUpdates(_0x41ecce,_0x2029c0){return function(_0x34f7da){if(_0x34f7da){return _0x34f7da['update'](_0x41ecce)['then'](function(_0x122f45){return _0x122f45;});}return null;};}function removeEntity(_0x5729dd,_0x598567){return function(_0x107db0){if(_0x107db0){return _0x107db0[_0xf07a('0x20')]()[_0xf07a('0x21')](function(){_0x5729dd[_0xf07a('0x16')](0xcc)[_0xf07a('0x17')]();});}};}function handleEntityNotFound(_0x4332d6,_0x345cb7){return function(_0x2ad6dc){if(!_0x2ad6dc){_0x4332d6['sendStatus'](0x194);}return _0x2ad6dc;};}function handleError(_0x547dba,_0x1af516){_0x1af516=_0x1af516||0x1f4;return function(_0x13d4f0){logger[_0xf07a('0x22')](_0x13d4f0[_0xf07a('0x23')]);if(_0x13d4f0[_0xf07a('0x24')]){delete _0x13d4f0[_0xf07a('0x24')];}_0x547dba[_0xf07a('0x16')](_0x1af516)['send'](_0x13d4f0);};}exports[_0xf07a('0x25')]=function(_0x5af4d3,_0x2c2609){var _0x18e3fc={},_0x41ba2a={},_0x121049={'count':0x0,'rows':[]};var _0x1ec43f=_[_0xf07a('0x26')](db[_0xf07a('0x27')][_0xf07a('0x28')],function(_0x18d081){return{'name':_0x18d081['fieldName'],'type':_0x18d081[_0xf07a('0x29')][_0xf07a('0x2a')]};});_0x41ba2a[_0xf07a('0x2b')]=_[_0xf07a('0x26')](_0x1ec43f,'name');_0x41ba2a[_0xf07a('0x2c')]=_['keys'](_0x5af4d3[_0xf07a('0x2c')]);_0x41ba2a[_0xf07a('0x2d')]=_['intersection'](_0x41ba2a['model'],_0x41ba2a[_0xf07a('0x2c')]);_0x18e3fc[_0xf07a('0x2e')]=_['intersection'](_0x41ba2a['model'],qs[_0xf07a('0x2f')](_0x5af4d3['query']['fields']));_0x18e3fc[_0xf07a('0x2e')]=_0x18e3fc[_0xf07a('0x2e')][_0xf07a('0x30')]?_0x18e3fc[_0xf07a('0x2e')]:_0x41ba2a[_0xf07a('0x2b')];if(!_0x5af4d3[_0xf07a('0x2c')]['hasOwnProperty'](_0xf07a('0x31'))){_0x18e3fc[_0xf07a('0x1b')]=qs[_0xf07a('0x1b')](_0x5af4d3[_0xf07a('0x2c')][_0xf07a('0x1b')]);_0x18e3fc[_0xf07a('0x19')]=qs[_0xf07a('0x19')](_0x5af4d3[_0xf07a('0x2c')]['offset']);}_0x18e3fc[_0xf07a('0x32')]=qs[_0xf07a('0x33')](_0x5af4d3[_0xf07a('0x2c')][_0xf07a('0x33')]);_0x18e3fc[_0xf07a('0x34')]=qs[_0xf07a('0x2d')](_[_0xf07a('0x35')](_0x5af4d3[_0xf07a('0x2c')],_0x41ba2a['filters']),_0x1ec43f);if(_0x5af4d3[_0xf07a('0x2c')][_0xf07a('0x36')]){_0x18e3fc[_0xf07a('0x34')]=_[_0xf07a('0x37')](_0x18e3fc[_0xf07a('0x34')],{'$or':_['map'](_0x1ec43f,function(_0x2702a7){if(_0x2702a7[_0xf07a('0x29')]!==_0xf07a('0x38')){var _0x54bd0f={};_0x54bd0f[_0x2702a7['name']]={'$like':'%'+_0x5af4d3[_0xf07a('0x2c')]['filter']+'%'};return _0x54bd0f;}})});}_0x18e3fc=_[_0xf07a('0x37')]({},_0x18e3fc,_0x5af4d3[_0xf07a('0x39')]);var _0x12d7fb={'where':_0x18e3fc[_0xf07a('0x34')]};return db[_0xf07a('0x27')][_0xf07a('0x1c')](_0x12d7fb)[_0xf07a('0x21')](function(_0x4ca85b){_0x121049['count']=_0x4ca85b;if(_0x5af4d3[_0xf07a('0x2c')][_0xf07a('0x3a')]){_0x18e3fc[_0xf07a('0x3b')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf07a('0x3c')](_0x18e3fc);})[_0xf07a('0x21')](function(_0x3420d1){_0x121049['rows']=_0x3420d1;return _0x121049;})[_0xf07a('0x21')](respondWithFilteredResult(_0x2c2609,_0x18e3fc))[_0xf07a('0x3d')](handleError(_0x2c2609,null));};exports[_0xf07a('0x3e')]=function(_0x47afbe,_0x225123){var _0x379176={'raw':![],'where':{'id':_0x47afbe[_0xf07a('0x3f')]['id']}},_0x5f5637={};_0x5f5637[_0xf07a('0x2b')]=_[_0xf07a('0x40')](db[_0xf07a('0x27')][_0xf07a('0x28')]);_0x5f5637['query']=_[_0xf07a('0x40')](_0x47afbe[_0xf07a('0x2c')]);_0x5f5637[_0xf07a('0x2d')]=_[_0xf07a('0x41')](_0x5f5637['model'],_0x5f5637[_0xf07a('0x2c')]);_0x379176[_0xf07a('0x2e')]=_[_0xf07a('0x41')](_0x5f5637[_0xf07a('0x2b')],qs[_0xf07a('0x2f')](_0x47afbe['query'][_0xf07a('0x2f')]));_0x379176[_0xf07a('0x2e')]=_0x379176[_0xf07a('0x2e')][_0xf07a('0x30')]?_0x379176[_0xf07a('0x2e')]:_0x5f5637[_0xf07a('0x2b')];if(_0x47afbe[_0xf07a('0x2c')]['includeAll']){_0x379176[_0xf07a('0x3b')]=[{'all':!![]}];}_0x379176=_['merge']({},_0x379176,_0x47afbe['options']);return db['SugarcrmAccount'][_0xf07a('0x42')](_0x379176)[_0xf07a('0x21')](handleEntityNotFound(_0x225123,null))['then'](respondWithResult(_0x225123,null))[_0xf07a('0x3d')](handleError(_0x225123,null));};exports['create']=function(_0x5e17fb,_0x2bc328){return db[_0xf07a('0x27')][_0xf07a('0x43')](_0x5e17fb[_0xf07a('0x44')],{})[_0xf07a('0x21')](respondWithResult(_0x2bc328,0xc9))['catch'](handleError(_0x2bc328,null));};exports['update']=function(_0x537dd1,_0x5bb36b){if(_0x537dd1[_0xf07a('0x44')]['id']){delete _0x537dd1[_0xf07a('0x44')]['id'];}return db[_0xf07a('0x27')][_0xf07a('0x42')]({'where':{'id':_0x537dd1[_0xf07a('0x3f')]['id']}})[_0xf07a('0x21')](handleEntityNotFound(_0x5bb36b,null))[_0xf07a('0x21')](saveUpdates(_0x537dd1[_0xf07a('0x44')],null))[_0xf07a('0x21')](respondWithResult(_0x5bb36b,null))[_0xf07a('0x3d')](handleError(_0x5bb36b,null));};exports['destroy']=function(_0x3ab1bb,_0xed0659){return db[_0xf07a('0x27')]['find']({'where':{'id':_0x3ab1bb[_0xf07a('0x3f')]['id']}})[_0xf07a('0x21')](handleEntityNotFound(_0xed0659,null))[_0xf07a('0x21')](removeEntity(_0xed0659,null))[_0xf07a('0x3d')](handleError(_0xed0659,null));};exports['getConfigurations']=function(_0x43fa43,_0x534cc6,_0x3e556a){var _0x3b4cba={};var _0x392b79={};var _0x20b385;var _0x919798;return db[_0xf07a('0x27')]['findOne']({'where':{'id':_0x43fa43['params']['id']}})[_0xf07a('0x21')](handleEntityNotFound(_0x534cc6,null))[_0xf07a('0x21')](function(_0x2350a5){if(_0x2350a5){_0x20b385=_0x2350a5;_0x392b79[_0xf07a('0x2b')]=_[_0xf07a('0x40')](db[_0xf07a('0x45')][_0xf07a('0x28')]);_0x392b79[_0xf07a('0x2c')]=_[_0xf07a('0x40')](_0x43fa43[_0xf07a('0x2c')]);_0x392b79[_0xf07a('0x2d')]=_['intersection'](_0x392b79['model'],_0x392b79[_0xf07a('0x2c')]);_0x3b4cba[_0xf07a('0x2e')]=_[_0xf07a('0x41')](_0x392b79[_0xf07a('0x2b')],qs[_0xf07a('0x2f')](_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x2f')]));_0x3b4cba[_0xf07a('0x2e')]=_0x3b4cba[_0xf07a('0x2e')][_0xf07a('0x30')]?_0x3b4cba[_0xf07a('0x2e')]:_0x392b79[_0xf07a('0x2b')];_0x3b4cba['order']=qs['sort'](_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x33')]);_0x3b4cba[_0xf07a('0x34')]=qs[_0xf07a('0x2d')](_['pick'](_0x43fa43[_0xf07a('0x2c')],_0x392b79[_0xf07a('0x2d')]));if(_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x36')]){_0x3b4cba[_0xf07a('0x34')]=_['merge'](_0x3b4cba[_0xf07a('0x34')],{'$or':_['map'](_0x3b4cba['attributes'],function(_0x12c2db){var _0x40edb0={};_0x40edb0[_0x12c2db]={'$like':'%'+_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x36')]+'%'};return _0x40edb0;})});}_0x3b4cba=_[_0xf07a('0x37')]({},_0x3b4cba,_0x43fa43[_0xf07a('0x39')]);return _0x20b385[_0xf07a('0x46')](_0x3b4cba);}})[_0xf07a('0x21')](function(_0x17c6e7){if(_0x17c6e7){_0x919798=_0x17c6e7['length'];if(!_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x47')]('nolimit')){_0x3b4cba[_0xf07a('0x1b')]=qs[_0xf07a('0x1b')](_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x1b')]);_0x3b4cba[_0xf07a('0x19')]=qs[_0xf07a('0x19')](_0x43fa43[_0xf07a('0x2c')][_0xf07a('0x19')]);}return _0x20b385[_0xf07a('0x46')](_0x3b4cba);}})[_0xf07a('0x21')](function(_0x44e42e){if(_0x44e42e){return _0x44e42e?{'count':_0x919798,'rows':_0x44e42e}:null;}})[_0xf07a('0x21')](respondWithResult(_0x534cc6,null))[_0xf07a('0x3d')](handleError(_0x534cc6,null));};exports['addConfiguration']=function(_0x58bd59,_0x4a2eff,_0x3ca20f){if(_0x58bd59[_0xf07a('0x44')]['id']){delete _0x58bd59['body']['id'];}return db[_0xf07a('0x27')][_0xf07a('0x48')]({'where':{'id':_0x58bd59[_0xf07a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a2eff,null))['then'](function(_0x2b2078){if(_0x2b2078){_0x58bd59[_0xf07a('0x44')][_0xf07a('0x49')]=_0x2b2078['id'];_0x58bd59[_0xf07a('0x44')][_0xf07a('0x4a')]=integrations[_0xf07a('0x4b')](_0x58bd59[_0xf07a('0x44')]['channel'],_0x58bd59['body'][_0xf07a('0x29')]);_0x58bd59['body'][_0xf07a('0x4c')]=integrations['getDescriptions'](_0x58bd59[_0xf07a('0x44')][_0xf07a('0x4d')],_0x58bd59[_0xf07a('0x44')][_0xf07a('0x29')]);return db[_0xf07a('0x45')]['create'](_0x58bd59[_0xf07a('0x44')],{'include':[{'model':db['SugarcrmField'],'as':_0xf07a('0x4a')},{'model':db[_0xf07a('0x4e')],'as':_0xf07a('0x4c')}]});}return null;})[_0xf07a('0x21')](respondWithResult(_0x4a2eff,null))['catch'](handleError(_0x4a2eff,null));};exports['getFields']=function(_0x34f39d,_0x4886fc,_0x3b472){var _0x310a13='';var _0xaf4677=['id','name',_0xf07a('0x4f'),_0xf07a('0x50'),'description',_0xf07a('0x51'),_0xf07a('0x52'),_0xf07a('0x53'),_0xf07a('0x54'),_0xf07a('0x55'),'parent_name','direction'];return db[_0xf07a('0x27')][_0xf07a('0x48')]({'where':{'id':_0x34f39d[_0xf07a('0x3f')]['id']},'attributes':['id',_0xf07a('0x56'),_0xf07a('0x57'),_0xf07a('0x58')]})[_0xf07a('0x21')](handleEntityNotFound(_0x4886fc,null))[_0xf07a('0x21')](function(_0x5c107d){if(_0x5c107d){_0x310a13=_0x5c107d[_0xf07a('0x58')];var _0x52d4a2=_0x310a13[_0xf07a('0x59')](-0x1);if(_0x52d4a2==='/'){_0x310a13=_0x310a13[_0xf07a('0x5a')](0x0,_0x310a13[_0xf07a('0x5b')](_0x52d4a2));}return rp({'method':'POST','uri':util[_0xf07a('0x5c')](_0xf07a('0x5d'),_0x310a13,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf07a('0x5e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf07a('0x5f')]({'user_auth':{'user_name':_0x5c107d[_0xf07a('0x56')],'password':_0x5c107d[_0xf07a('0x57')],'encryption':_0xf07a('0x60')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x238fa5){if(_0x238fa5&&_0x238fa5[_0xf07a('0x24')]!==_0xf07a('0x61')&&_0x238fa5['name']!==_0xf07a('0x62')){return rp({'method':_0xf07a('0x63'),'uri':util[_0xf07a('0x5c')](_0xf07a('0x5d'),_0x310a13,_0xf07a('0x64')),'json':!![],'form':{'method':_0xf07a('0x65'),'input_type':_0xf07a('0x66'),'response_type':_0xf07a('0x66'),'rest_data':JSON[_0xf07a('0x5f')]({'session':_0x238fa5['id'],'module_name':_0xf07a('0x67')})}})['then'](function(_0x2a5942){if(_0x2a5942){var _0x195cb5=_[_0xf07a('0x68')](_0x2a5942['module_fields']);_[_0xf07a('0x69')](_0x195cb5,function(_0x3129c7){return _0xaf4677[_0xf07a('0x6a')](_0x3129c7[_0xf07a('0x24')]);});return{'count':_0x195cb5['length'],'rows':_[_0xf07a('0x26')](_0x195cb5,function(_0x2cac2e){return{'id':_0x2cac2e[_0xf07a('0x24')],'name':_0x2cac2e[_0xf07a('0x6b')],'custom':_[_0xf07a('0x6c')](_0x2cac2e[_0xf07a('0x24')],'_c')?!![]:![],'options':_0x2cac2e[_0xf07a('0x39')]?_[_0xf07a('0x26')](_[_0xf07a('0x68')](_0x2cac2e[_0xf07a('0x39')]),function(_0x102c0e){return{'name':_0x102c0e['value'],'value':_0x102c0e[_0xf07a('0x24')]};}):[]};})};}})[_0xf07a('0x21')](respondWithResult(_0x4886fc,null))['catch'](function(_0x39ea9e){var _0x4189de=_0x34f39d[_0xf07a('0x2c')][_0xf07a('0x6d')]?0x1f4:_0x39ea9e[_0xf07a('0x6e')]||0x1f4;logger[_0xf07a('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4189de,JSON[_0xf07a('0x5f')](_0x39ea9e));delete _0x39ea9e[_0xf07a('0x24')];if(_0x4189de===0x191){_0x4189de=0x190;}_0x4886fc[_0xf07a('0x16')](_0x4189de)[_0xf07a('0x6f')](_0x34f39d['query'][_0xf07a('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x39ea9e['statusCode']}:_0x39ea9e);});}else{var _0x1e92eb=0x1f4;_0x4886fc[_0xf07a('0x16')](_0x1e92eb)[_0xf07a('0x6f')]({'message':_0xf07a('0x70'),'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 69ce6f1..ff74689 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 _0xdd04=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x5b4f16,_0x1a77e5){var _0x529d5b=function(_0xfac834){while(--_0xfac834){_0x5b4f16['push'](_0x5b4f16['shift']());}};_0x529d5b(++_0x1a77e5);}(_0xdd04,0x15f));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4dd0('0x0'));var util=require(_0x4dd0('0x1'));var logger=require('../../config/logger')(_0x4dd0('0x2'));var moment=require(_0x4dd0('0x3'));var BPromise=require(_0x4dd0('0x4'));var rp=require(_0x4dd0('0x5'));var fs=require('fs');var path=require(_0x4dd0('0x6'));var rimraf=require(_0x4dd0('0x7'));var config=require(_0x4dd0('0x8'));var attributes=require(_0x4dd0('0x9'));var integrations=require(_0x4dd0('0xa'));module['exports']=function(_0x215d82,_0x4fbeda){return _0x215d82[_0x4dd0('0xb')](_0x4dd0('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde4d=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x3b8f84,_0x1d4dfc){var _0xe79b5d=function(_0x10b389){while(--_0x10b389){_0x3b8f84['push'](_0x3b8f84['shift']());}};_0xe79b5d(++_0x1d4dfc);}(_0xde4d,0xf1));var _0xdde4=function(_0x3cb555,_0x19e0aa){_0x3cb555=_0x3cb555-0x0;var _0x26083f=_0xde4d[_0x3cb555];return _0x26083f;};'use strict';var _=require(_0xdde4('0x0'));var util=require(_0xdde4('0x1'));var logger=require(_0xdde4('0x2'))(_0xdde4('0x3'));var moment=require(_0xdde4('0x4'));var BPromise=require(_0xdde4('0x5'));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('./intSugarcrmAccount.attributes');var integrations=require(_0xdde4('0x6'));module['exports']=function(_0x3d7216,_0x4aaec3){return _0x3d7216[_0xdde4('0x7')](_0xdde4('0x8'),attributes,{'tableName':_0xdde4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 8abdb68..2558acd 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 _0x79af=['then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','options','where','attributes','limit','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x29efed,_0x4ef8d0){var _0x155f12=function(_0x542216){while(--_0x542216){_0x29efed['push'](_0x29efed['shift']());}};_0x155f12(++_0x4ef8d0);}(_0x79af,0x1a2));var _0xf79a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x79af[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xf79a('0x0'));var moment=require(_0xf79a('0x1'));var BPromise=require(_0xf79a('0x2'));var rs=require(_0xf79a('0x3'));var fs=require('fs');var Redis=require(_0xf79a('0x4'));var db=require(_0xf79a('0x5'))['db'];var utils=require(_0xf79a('0x6'));var logger=require(_0xf79a('0x7'))(_0xf79a('0x8'));var config=require(_0xf79a('0x9'));var jayson=require(_0xf79a('0xa'));var client=jayson[_0xf79a('0xb')][_0xf79a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4502f3,_0x25e403,_0x43832e){return new BPromise(function(_0x22dba3,_0xe0b4be){return client[_0xf79a('0xd')](_0x4502f3,_0x43832e)[_0xf79a('0xe')](function(_0x197ca9){logger[_0xf79a('0xf')](_0xf79a('0x10'),_0x25e403,_0xf79a('0x11'));logger[_0xf79a('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x25e403,'request\x20sent',JSON[_0xf79a('0x13')](_0x197ca9));if(_0x197ca9[_0xf79a('0x14')]){if(_0x197ca9['error'][_0xf79a('0x15')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x25e403,_0x197ca9['error']['message']);return _0xe0b4be(_0x197ca9[_0xf79a('0x14')][_0xf79a('0x16')]);}logger[_0xf79a('0x14')](_0xf79a('0x10'),_0x25e403,_0x197ca9[_0xf79a('0x14')][_0xf79a('0x16')]);return _0x22dba3(_0x197ca9[_0xf79a('0x14')][_0xf79a('0x16')]);}else{logger['info'](_0xf79a('0x10'),_0x25e403,_0xf79a('0x11'));_0x22dba3(_0x197ca9[_0xf79a('0x17')][_0xf79a('0x16')]);}})[_0xf79a('0x18')](function(_0x9c0de5){logger[_0xf79a('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x25e403,_0x9c0de5);_0xe0b4be(_0x9c0de5);});});}exports[_0xf79a('0x19')]=function(_0x3b8c25){var _0x32c936=this;return new Promise(function(_0x3b687e,_0x3fee65){return db['SugarcrmAccount']['findAll']({'raw':_0x3b8c25[_0xf79a('0x1a')]?_0x3b8c25['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b8c25[_0xf79a('0x1a')]?_0x3b8c25[_0xf79a('0x1a')][_0xf79a('0x1b')]||null:null,'attributes':_0x3b8c25['options']?_0x3b8c25['options'][_0xf79a('0x1c')]||null:null,'limit':_0x3b8c25[_0xf79a('0x1a')]?_0x3b8c25[_0xf79a('0x1a')][_0xf79a('0x1d')]||null:null,'include':_0x3b8c25['options']?_0x3b8c25[_0xf79a('0x1a')][_0xf79a('0x1e')]?_[_0xf79a('0x1f')](_0x3b8c25['options'][_0xf79a('0x1e')],function(_0xe30052){return{'model':db[_0xe30052['model']],'as':_0xe30052['as'],'attributes':_0xe30052['attributes'],'include':_0xe30052[_0xf79a('0x1e')]?_[_0xf79a('0x1f')](_0xe30052[_0xf79a('0x1e')],function(_0x29ea84){return{'model':db[_0x29ea84[_0xf79a('0x20')]],'as':_0x29ea84['as'],'attributes':_0x29ea84['attributes'],'include':_0x29ea84[_0xf79a('0x1e')]?_[_0xf79a('0x1f')](_0x29ea84[_0xf79a('0x1e')],function(_0xdc4eab){return{'model':db[_0xdc4eab[_0xf79a('0x20')]],'as':_0xdc4eab['as'],'attributes':_0xdc4eab[_0xf79a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49ccab){logger[_0xf79a('0xf')](_0xf79a('0x19'),_0x3b8c25);logger[_0xf79a('0x12')](_0xf79a('0x19'),_0x3b8c25,JSON[_0xf79a('0x13')](_0x49ccab));_0x3b687e(_0x49ccab);})[_0xf79a('0x18')](function(_0x2b33ab){logger[_0xf79a('0x14')]('GetSugarcrmAccount',_0x2b33ab[_0xf79a('0x16')],_0x3b8c25);_0x3fee65(_0x32c936['error'](0x1f4,_0x2b33ab[_0xf79a('0x16')]));});});};exports[_0xf79a('0x21')]=function(_0x83f535){var _0x15545f=this;return new Promise(function(_0x472ac6,_0x5706e1){return db[_0xf79a('0x22')]['find']({'raw':_0x83f535['options']?_0x83f535[_0xf79a('0x1a')][_0xf79a('0x23')]===undefined?!![]:![]:!![],'where':_0x83f535[_0xf79a('0x1a')]?_0x83f535[_0xf79a('0x1a')]['where']||null:null,'attributes':_0x83f535[_0xf79a('0x1a')]?_0x83f535['options'][_0xf79a('0x1c')]||null:null,'include':_0x83f535[_0xf79a('0x1a')]?_0x83f535[_0xf79a('0x1a')][_0xf79a('0x1e')]?_['map'](_0x83f535[_0xf79a('0x1a')]['include'],function(_0x51e02a){return{'model':db[_0x51e02a[_0xf79a('0x20')]],'as':_0x51e02a['as'],'attributes':_0x51e02a['attributes'],'include':_0x51e02a['include']?_[_0xf79a('0x1f')](_0x51e02a['include'],function(_0x2863a6){return{'model':db[_0x2863a6[_0xf79a('0x20')]],'as':_0x2863a6['as'],'attributes':_0x2863a6[_0xf79a('0x1c')],'include':_0x2863a6[_0xf79a('0x1e')]?_[_0xf79a('0x1f')](_0x2863a6[_0xf79a('0x1e')],function(_0x54a808){return{'model':db[_0x54a808[_0xf79a('0x20')]],'as':_0x54a808['as'],'attributes':_0x54a808[_0xf79a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf79a('0xe')](function(_0x186c31){logger[_0xf79a('0xf')](_0xf79a('0x21'),_0x83f535);logger[_0xf79a('0x12')](_0xf79a('0x21'),_0x83f535,JSON['stringify'](_0x186c31));_0x472ac6(_0x186c31);})['catch'](function(_0x531945){logger[_0xf79a('0x14')](_0xf79a('0x21'),_0x531945[_0xf79a('0x16')],_0x83f535);_0x5706e1(_0x15545f['error'](0x1f4,_0x531945[_0xf79a('0x16')]));});});}; \ No newline at end of file +var _0x2c1f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowSugarcrmAccount','find','raw'];(function(_0xd6a5d0,_0xce67f2){var _0x27789f=function(_0x38fe7b){while(--_0x38fe7b){_0xd6a5d0['push'](_0xd6a5d0['shift']());}};_0x27789f(++_0xce67f2);}(_0x2c1f,0x1b0));var _0xf2c1=function(_0x177467,_0x3c160d){_0x177467=_0x177467-0x0;var _0x4a3a8f=_0x2c1f[_0x177467];return _0x4a3a8f;};'use strict';var _=require(_0xf2c1('0x0'));var util=require(_0xf2c1('0x1'));var moment=require(_0xf2c1('0x2'));var BPromise=require(_0xf2c1('0x3'));var rs=require(_0xf2c1('0x4'));var fs=require('fs');var Redis=require(_0xf2c1('0x5'));var db=require(_0xf2c1('0x6'))['db'];var utils=require(_0xf2c1('0x7'));var logger=require(_0xf2c1('0x8'))(_0xf2c1('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55ef28,_0x1e70d6,_0x22487e){return new BPromise(function(_0x4213f5,_0x4f6c22){return client[_0xf2c1('0xb')](_0x55ef28,_0x22487e)['then'](function(_0x558b20){logger[_0xf2c1('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e70d6,_0xf2c1('0xd'));logger[_0xf2c1('0xe')](_0xf2c1('0xf'),_0x1e70d6,_0xf2c1('0xd'),JSON[_0xf2c1('0x10')](_0x558b20));if(_0x558b20[_0xf2c1('0x11')]){if(_0x558b20[_0xf2c1('0x11')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1e70d6,_0x558b20[_0xf2c1('0x11')][_0xf2c1('0x12')]);return _0x4f6c22(_0x558b20['error'][_0xf2c1('0x12')]);}logger[_0xf2c1('0x11')](_0xf2c1('0x13'),_0x1e70d6,_0x558b20['error'][_0xf2c1('0x12')]);return _0x4213f5(_0x558b20[_0xf2c1('0x11')][_0xf2c1('0x12')]);}else{logger[_0xf2c1('0xc')](_0xf2c1('0x13'),_0x1e70d6,_0xf2c1('0xd'));_0x4213f5(_0x558b20[_0xf2c1('0x14')][_0xf2c1('0x12')]);}})['catch'](function(_0xd34c9c){logger['error'](_0xf2c1('0x13'),_0x1e70d6,_0xd34c9c);_0x4f6c22(_0xd34c9c);});});}exports[_0xf2c1('0x15')]=function(_0x9d4db7){var _0x5c4c6c=this;return new Promise(function(_0x236908,_0x10f610){return db[_0xf2c1('0x16')][_0xf2c1('0x17')]({'raw':_0x9d4db7[_0xf2c1('0x18')]?_0x9d4db7['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d4db7[_0xf2c1('0x18')]?_0x9d4db7[_0xf2c1('0x18')][_0xf2c1('0x19')]||null:null,'attributes':_0x9d4db7['options']?_0x9d4db7['options'][_0xf2c1('0x1a')]||null:null,'limit':_0x9d4db7[_0xf2c1('0x18')]?_0x9d4db7[_0xf2c1('0x18')][_0xf2c1('0x1b')]||null:null,'include':_0x9d4db7['options']?_0x9d4db7['options'][_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x9d4db7[_0xf2c1('0x18')][_0xf2c1('0x1c')],function(_0x225e44){return{'model':db[_0x225e44[_0xf2c1('0x1e')]],'as':_0x225e44['as'],'attributes':_0x225e44[_0xf2c1('0x1a')],'include':_0x225e44[_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x225e44[_0xf2c1('0x1c')],function(_0x1ec316){return{'model':db[_0x1ec316[_0xf2c1('0x1e')]],'as':_0x1ec316['as'],'attributes':_0x1ec316[_0xf2c1('0x1a')],'include':_0x1ec316[_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x1ec316[_0xf2c1('0x1c')],function(_0x8ddd97){return{'model':db[_0x8ddd97[_0xf2c1('0x1e')]],'as':_0x8ddd97['as'],'attributes':_0x8ddd97[_0xf2c1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf2c1('0x1f')](function(_0x11c4f4){logger[_0xf2c1('0xc')](_0xf2c1('0x15'),_0x9d4db7);logger['debug'](_0xf2c1('0x15'),_0x9d4db7,JSON['stringify'](_0x11c4f4));_0x236908(_0x11c4f4);})[_0xf2c1('0x20')](function(_0x6e9170){logger[_0xf2c1('0x11')](_0xf2c1('0x15'),_0x6e9170[_0xf2c1('0x12')],_0x9d4db7);_0x10f610(_0x5c4c6c[_0xf2c1('0x11')](0x1f4,_0x6e9170['message']));});});};exports[_0xf2c1('0x21')]=function(_0x101972){var _0x2d7bb7=this;return new Promise(function(_0x5d2931,_0x53912f){return db[_0xf2c1('0x16')][_0xf2c1('0x22')]({'raw':_0x101972[_0xf2c1('0x18')]?_0x101972[_0xf2c1('0x18')][_0xf2c1('0x23')]===undefined?!![]:![]:!![],'where':_0x101972['options']?_0x101972[_0xf2c1('0x18')]['where']||null:null,'attributes':_0x101972['options']?_0x101972[_0xf2c1('0x18')][_0xf2c1('0x1a')]||null:null,'include':_0x101972[_0xf2c1('0x18')]?_0x101972[_0xf2c1('0x18')][_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x101972[_0xf2c1('0x18')][_0xf2c1('0x1c')],function(_0x569bcd){return{'model':db[_0x569bcd['model']],'as':_0x569bcd['as'],'attributes':_0x569bcd[_0xf2c1('0x1a')],'include':_0x569bcd[_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x569bcd['include'],function(_0x347164){return{'model':db[_0x347164[_0xf2c1('0x1e')]],'as':_0x347164['as'],'attributes':_0x347164[_0xf2c1('0x1a')],'include':_0x347164[_0xf2c1('0x1c')]?_[_0xf2c1('0x1d')](_0x347164[_0xf2c1('0x1c')],function(_0x1f3f5d){return{'model':db[_0x1f3f5d[_0xf2c1('0x1e')]],'as':_0x1f3f5d['as'],'attributes':_0x1f3f5d[_0xf2c1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf2c1('0x1f')](function(_0x3c27c7){logger['info']('ShowSugarcrmAccount',_0x101972);logger[_0xf2c1('0xe')]('ShowSugarcrmAccount',_0x101972,JSON[_0xf2c1('0x10')](_0x3c27c7));_0x5d2931(_0x3c27c7);})['catch'](function(_0x3e3525){logger[_0xf2c1('0x11')](_0xf2c1('0x21'),_0x3e3525[_0xf2c1('0x12')],_0x101972);_0x53912f(_0x2d7bb7[_0xf2c1('0x11')](0x1f4,_0x3e3525[_0xf2c1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 93aba82..6b0e4c8 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 _0x7fac=['post','put','/:id','update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0xb375b0,_0x2f64bb){var _0x5ac0b8=function(_0x577655){while(--_0x577655){_0xb375b0['push'](_0xb375b0['shift']());}};_0x5ac0b8(++_0x2f64bb);}(_0x7fac,0xbd));var _0xc7fa=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x7fac[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0xc7fa('0x0'));var util=require(_0xc7fa('0x1'));var path=require('path');var timeout=require(_0xc7fa('0x2'));var express=require('express');var router=express[_0xc7fa('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc7fa('0x4'));var interaction=require(_0xc7fa('0x5'));var config=require(_0xc7fa('0x6'));var controller=require(_0xc7fa('0x7'));router[_0xc7fa('0x8')]('/',auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xa')]);router[_0xc7fa('0x8')]('/:id',auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xb')]);router['get'](_0xc7fa('0xc'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xd')]);router['get'](_0xc7fa('0xe'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0xf')]);router['get'](_0xc7fa('0x10'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0x11')]);router[_0xc7fa('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc7fa('0x13')](_0xc7fa('0x14'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0x15')]);router['delete'](_0xc7fa('0x14'),auth[_0xc7fa('0x9')](),controller[_0xc7fa('0x16')]);module['exports']=router; \ No newline at end of file +var _0x05c2=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects'];(function(_0x4e9a52,_0x25b20d){var _0x2d425f=function(_0x4f2157){while(--_0x4f2157){_0x4e9a52['push'](_0x4e9a52['shift']());}};_0x2d425f(++_0x25b20d);}(_0x05c2,0x171));var _0x205c=function(_0x4558c2,_0x5598c9){_0x4558c2=_0x4558c2-0x0;var _0x2f0866=_0x05c2[_0x4558c2];return _0x2f0866;};'use strict';var multer=require('multer');var util=require(_0x205c('0x0'));var path=require(_0x205c('0x1'));var timeout=require(_0x205c('0x2'));var express=require(_0x205c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x205c('0x4'));var interaction=require(_0x205c('0x5'));var config=require(_0x205c('0x6'));var controller=require(_0x205c('0x7'));router['get']('/',auth[_0x205c('0x8')](),controller[_0x205c('0x9')]);router[_0x205c('0xa')](_0x205c('0xb'),auth[_0x205c('0x8')](),controller[_0x205c('0xc')]);router['get'](_0x205c('0xd'),auth[_0x205c('0x8')](),controller['getFields']);router[_0x205c('0xa')](_0x205c('0xe'),auth[_0x205c('0x8')](),controller[_0x205c('0xf')]);router['get'](_0x205c('0x10'),auth[_0x205c('0x8')](),controller[_0x205c('0x11')]);router[_0x205c('0x12')]('/',auth[_0x205c('0x8')](),controller['create']);router[_0x205c('0x13')](_0x205c('0xb'),auth[_0x205c('0x8')](),controller[_0x205c('0x14')]);router[_0x205c('0x15')](_0x205c('0xb'),auth[_0x205c('0x8')](),controller[_0x205c('0x16')]);module[_0x205c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 87378f4..e64dbe0 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 _0x76bd=['sequelize','exports','STRING'];(function(_0x2b2ef9,_0x3c2fe3){var _0x5062b5=function(_0x31d9aa){while(--_0x31d9aa){_0x2b2ef9['push'](_0x2b2ef9['shift']());}};_0x5062b5(++_0x3c2fe3);}(_0x76bd,0x1dd));var _0xd76b=function(_0x880cec,_0x493e9e){_0x880cec=_0x880cec-0x0;var _0x2aa5a7=_0x76bd[_0x880cec];return _0x2aa5a7;};'use strict';var Sequelize=require(_0xd76b('0x0'));module[_0xd76b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd76b('0x2')]}}; \ No newline at end of file +var _0xced6=['sequelize','exports','STRING'];(function(_0x3bf6da,_0x59679f){var _0xd5372f=function(_0x296b72){while(--_0x296b72){_0x3bf6da['push'](_0x3bf6da['shift']());}};_0xd5372f(++_0x59679f);}(_0xced6,0xae));var _0x6ced=function(_0x5af384,_0x1341d4){_0x5af384=_0x5af384-0x0;var _0x4fc569=_0xced6[_0x5af384];return _0x4fc569;};'use strict';var Sequelize=require(_0x6ced('0x0'));module[_0x6ced('0x1')]={'name':{'type':Sequelize[_0x6ced('0x2')]},'description':{'type':Sequelize[_0x6ced('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9245e73..cdb281c 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 _0x3ded=['../../components/auth/service','../../components/parsers/advancedSearch','api','status','end','json','offset','undefined','limit','count','apply','reject','save','then','error','stack','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','options','SugarcrmConfiguration','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','update','destroy','getFields','findOne','SugarcrmField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x2f3c6f,_0x4e7956){var _0x50e217=function(_0x5ecb51){while(--_0x5ecb51){_0x2f3c6f['push'](_0x2f3c6f['shift']());}};_0x50e217(++_0x4e7956);}(_0x3ded,0x113));var _0xd3de=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x3ded[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0xd3de('0x0'));var rimraf=require(_0xd3de('0x1'));var zipdir=require(_0xd3de('0x2'));var jsonpatch=require(_0xd3de('0x3'));var rp=require('request-promise');var moment=require(_0xd3de('0x4'));var BPromise=require(_0xd3de('0x5'));var Mustache=require(_0xd3de('0x6'));var util=require(_0xd3de('0x7'));var path=require('path');var sox=require(_0xd3de('0x8'));var csv=require('to-csv');var ejs=require(_0xd3de('0x9'));var fs=require('fs');var fs_extra=require(_0xd3de('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd3de('0xb'));var jsforce=require(_0xd3de('0xc'));var deskjs=require(_0xd3de('0xd'));var toCsv=require(_0xd3de('0xe'));var querystring=require(_0xd3de('0xf'));var Papa=require(_0xd3de('0x10'));var Redis=require('ioredis');var authService=require(_0xd3de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd3de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd3de('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e0b03,_0x34b42a){_0x34b42a=_0x34b42a||0xcc;return function(_0x22cefc){if(_0x22cefc){return _0x1e0b03['sendStatus'](_0x34b42a);}return _0x1e0b03[_0xd3de('0x14')](_0x34b42a)[_0xd3de('0x15')]();};}function respondWithResult(_0x265e6a,_0x14099c){_0x14099c=_0x14099c||0xc8;return function(_0x1a4b02){if(_0x1a4b02){return _0x265e6a['status'](_0x14099c)[_0xd3de('0x16')](_0x1a4b02);}};}function respondWithFilteredResult(_0x2c0c24,_0x17d193){return function(_0x2f557e){if(_0x2f557e){var _0xaa4a8=typeof _0x17d193[_0xd3de('0x17')]===_0xd3de('0x18')&&typeof _0x17d193[_0xd3de('0x19')]===_0xd3de('0x18');var _0x3c4341=_0x2f557e['count'];var _0x179b93=_0xaa4a8?0x0:_0x17d193[_0xd3de('0x17')];var _0x45e9eb=_0xaa4a8?_0x2f557e[_0xd3de('0x1a')]:_0x17d193['offset']+_0x17d193[_0xd3de('0x19')];var _0x425668;if(_0x45e9eb>=_0x3c4341){_0x45e9eb=_0x3c4341;_0x425668=0xc8;}else{_0x425668=0xce;}_0x2c0c24[_0xd3de('0x14')](_0x425668);return _0x2c0c24['set']('Content-Range',_0x179b93+'-'+_0x45e9eb+'/'+_0x3c4341)[_0xd3de('0x16')](_0x2f557e);}return null;};}function patchUpdates(_0x5a8e10){return function(_0x8a94ce){try{jsonpatch[_0xd3de('0x1b')](_0x8a94ce,_0x5a8e10,!![]);}catch(_0x3c2a74){return BPromise[_0xd3de('0x1c')](_0x3c2a74);}return _0x8a94ce[_0xd3de('0x1d')]();};}function saveUpdates(_0x48a82f,_0x276956){return function(_0x3f0dc6){if(_0x3f0dc6){return _0x3f0dc6['update'](_0x48a82f)[_0xd3de('0x1e')](function(_0x41e9c0){return _0x41e9c0;});}return null;};}function removeEntity(_0x4f3e2a,_0x519458){return function(_0x20c9ea){if(_0x20c9ea){return _0x20c9ea['destroy']()[_0xd3de('0x1e')](function(){_0x4f3e2a[_0xd3de('0x14')](0xcc)[_0xd3de('0x15')]();});}};}function handleEntityNotFound(_0x5a5718,_0x218ca8){return function(_0x12e95a){if(!_0x12e95a){_0x5a5718['sendStatus'](0x194);}return _0x12e95a;};}function handleError(_0x57ea3c,_0xb68e9f){_0xb68e9f=_0xb68e9f||0x1f4;return function(_0x56858c){logger[_0xd3de('0x1f')](_0x56858c[_0xd3de('0x20')]);if(_0x56858c['name']){delete _0x56858c['name'];}_0x57ea3c[_0xd3de('0x14')](_0xb68e9f)['send'](_0x56858c);};}exports['index']=function(_0x13add8,_0x3e6465){var _0x56311f={},_0x3c8d41={},_0x558a13={'count':0x0,'rows':[]};var _0xf194d9=_['map'](db['SugarcrmConfiguration'][_0xd3de('0x21')],function(_0x734e49){return{'name':_0x734e49[_0xd3de('0x22')],'type':_0x734e49[_0xd3de('0x23')][_0xd3de('0x24')]};});_0x3c8d41[_0xd3de('0x25')]=_['map'](_0xf194d9,_0xd3de('0x26'));_0x3c8d41[_0xd3de('0x27')]=_['keys'](_0x13add8[_0xd3de('0x27')]);_0x3c8d41[_0xd3de('0x28')]=_['intersection'](_0x3c8d41[_0xd3de('0x25')],_0x3c8d41[_0xd3de('0x27')]);_0x56311f[_0xd3de('0x29')]=_['intersection'](_0x3c8d41['model'],qs[_0xd3de('0x2a')](_0x13add8['query'][_0xd3de('0x2a')]));_0x56311f['attributes']=_0x56311f[_0xd3de('0x29')][_0xd3de('0x2b')]?_0x56311f[_0xd3de('0x29')]:_0x3c8d41[_0xd3de('0x25')];if(!_0x13add8[_0xd3de('0x27')]['hasOwnProperty'](_0xd3de('0x2c'))){_0x56311f[_0xd3de('0x19')]=qs[_0xd3de('0x19')](_0x13add8['query'][_0xd3de('0x19')]);_0x56311f['offset']=qs['offset'](_0x13add8[_0xd3de('0x27')][_0xd3de('0x17')]);}_0x56311f[_0xd3de('0x2d')]=qs[_0xd3de('0x2e')](_0x13add8['query']['sort']);_0x56311f[_0xd3de('0x2f')]=qs['filters'](_['pick'](_0x13add8[_0xd3de('0x27')],_0x3c8d41[_0xd3de('0x28')]),_0xf194d9);if(_0x13add8[_0xd3de('0x27')][_0xd3de('0x30')]){_0x56311f[_0xd3de('0x2f')]=_[_0xd3de('0x31')](_0x56311f[_0xd3de('0x2f')],{'$or':_[_0xd3de('0x32')](_0xf194d9,function(_0x5dbe6e){if(_0x5dbe6e[_0xd3de('0x23')]!=='VIRTUAL'){var _0x3aa28f={};_0x3aa28f[_0x5dbe6e[_0xd3de('0x26')]]={'$like':'%'+_0x13add8['query']['filter']+'%'};return _0x3aa28f;}})});}_0x56311f=_[_0xd3de('0x31')]({},_0x56311f,_0x13add8[_0xd3de('0x33')]);var _0x145658={'where':_0x56311f[_0xd3de('0x2f')]};return db[_0xd3de('0x34')][_0xd3de('0x1a')](_0x145658)[_0xd3de('0x1e')](function(_0x33afcb){_0x558a13[_0xd3de('0x1a')]=_0x33afcb;if(_0x13add8[_0xd3de('0x27')][_0xd3de('0x35')]){_0x56311f[_0xd3de('0x36')]=[{'all':!![]}];}return db[_0xd3de('0x34')][_0xd3de('0x37')](_0x56311f);})['then'](function(_0x5c0105){_0x558a13['rows']=_0x5c0105;return _0x558a13;})['then'](respondWithFilteredResult(_0x3e6465,_0x56311f))[_0xd3de('0x38')](handleError(_0x3e6465,null));};exports[_0xd3de('0x39')]=function(_0x46ce8e,_0x1188c7){var _0x237c4b={'raw':![],'where':{'id':_0x46ce8e[_0xd3de('0x3a')]['id']}},_0x2c9cac={};_0x2c9cac['model']=_[_0xd3de('0x3b')](db[_0xd3de('0x34')]['rawAttributes']);_0x2c9cac[_0xd3de('0x27')]=_[_0xd3de('0x3b')](_0x46ce8e['query']);_0x2c9cac[_0xd3de('0x28')]=_[_0xd3de('0x3c')](_0x2c9cac['model'],_0x2c9cac[_0xd3de('0x27')]);_0x237c4b[_0xd3de('0x29')]=_[_0xd3de('0x3c')](_0x2c9cac[_0xd3de('0x25')],qs['fields'](_0x46ce8e[_0xd3de('0x27')][_0xd3de('0x2a')]));_0x237c4b[_0xd3de('0x29')]=_0x237c4b[_0xd3de('0x29')]['length']?_0x237c4b['attributes']:_0x2c9cac['model'];if(_0x46ce8e[_0xd3de('0x27')]['includeAll']){_0x237c4b[_0xd3de('0x36')]=[{'all':!![]}];}_0x237c4b=_[_0xd3de('0x31')]({},_0x237c4b,_0x46ce8e[_0xd3de('0x33')]);return db[_0xd3de('0x34')][_0xd3de('0x3d')](_0x237c4b)['then'](handleEntityNotFound(_0x1188c7,null))[_0xd3de('0x1e')](respondWithResult(_0x1188c7,null))[_0xd3de('0x38')](handleError(_0x1188c7,null));};exports[_0xd3de('0x3e')]=function(_0x37db93,_0x450a29){return db[_0xd3de('0x34')][_0xd3de('0x3e')](_0x37db93[_0xd3de('0x3f')],{})[_0xd3de('0x1e')](respondWithResult(_0x450a29,0xc9))[_0xd3de('0x38')](handleError(_0x450a29,null));};exports[_0xd3de('0x40')]=function(_0x2f5c6b,_0x34cd3e){if(_0x2f5c6b[_0xd3de('0x3f')]['id']){delete _0x2f5c6b['body']['id'];}return db['SugarcrmConfiguration'][_0xd3de('0x3d')]({'where':{'id':_0x2f5c6b[_0xd3de('0x3a')]['id']}})[_0xd3de('0x1e')](handleEntityNotFound(_0x34cd3e,null))[_0xd3de('0x1e')](saveUpdates(_0x2f5c6b[_0xd3de('0x3f')],null))[_0xd3de('0x1e')](respondWithResult(_0x34cd3e,null))[_0xd3de('0x38')](handleError(_0x34cd3e,null));};exports[_0xd3de('0x41')]=function(_0x5f560c,_0x4bdbf5){return db[_0xd3de('0x34')][_0xd3de('0x3d')]({'where':{'id':_0x5f560c[_0xd3de('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4bdbf5,null))[_0xd3de('0x1e')](removeEntity(_0x4bdbf5,null))[_0xd3de('0x38')](handleError(_0x4bdbf5,null));};exports[_0xd3de('0x42')]=function(_0x56d41,_0x21a458,_0x51cf81){var _0x5526d8={};var _0x35c66d={};var _0x19728f;var _0x58fee4;return db[_0xd3de('0x34')][_0xd3de('0x43')]({'where':{'id':_0x56d41[_0xd3de('0x3a')]['id']}})[_0xd3de('0x1e')](handleEntityNotFound(_0x21a458,null))[_0xd3de('0x1e')](function(_0x4f7c83){if(_0x4f7c83){_0x19728f=_0x4f7c83;_0x35c66d[_0xd3de('0x25')]=_[_0xd3de('0x3b')](db[_0xd3de('0x44')][_0xd3de('0x21')]);_0x35c66d['query']=_[_0xd3de('0x3b')](_0x56d41[_0xd3de('0x27')]);_0x35c66d['filters']=_[_0xd3de('0x3c')](_0x35c66d[_0xd3de('0x25')],_0x35c66d['query']);_0x5526d8[_0xd3de('0x29')]=_[_0xd3de('0x3c')](_0x35c66d[_0xd3de('0x25')],qs[_0xd3de('0x2a')](_0x56d41['query']['fields']));_0x5526d8[_0xd3de('0x29')]=_0x5526d8['attributes'][_0xd3de('0x2b')]?_0x5526d8[_0xd3de('0x29')]:_0x35c66d[_0xd3de('0x25')];_0x5526d8['order']=qs[_0xd3de('0x2e')](_0x56d41['query'][_0xd3de('0x2e')]);_0x5526d8[_0xd3de('0x2f')]=qs[_0xd3de('0x28')](_[_0xd3de('0x45')](_0x56d41['query'],_0x35c66d[_0xd3de('0x28')]));if(_0x56d41[_0xd3de('0x27')]['filter']){_0x5526d8[_0xd3de('0x2f')]=_[_0xd3de('0x31')](_0x5526d8[_0xd3de('0x2f')],{'$or':_[_0xd3de('0x32')](_0x5526d8[_0xd3de('0x29')],function(_0x3b43e5){var _0x7aff04={};_0x7aff04[_0x3b43e5]={'$like':'%'+_0x56d41['query'][_0xd3de('0x30')]+'%'};return _0x7aff04;})});}_0x5526d8=_[_0xd3de('0x31')]({},_0x5526d8,_0x56d41[_0xd3de('0x33')]);return _0x19728f[_0xd3de('0x42')](_0x5526d8);}})[_0xd3de('0x1e')](function(_0x220817){if(_0x220817){_0x58fee4=_0x220817[_0xd3de('0x2b')];if(!_0x56d41[_0xd3de('0x27')][_0xd3de('0x46')](_0xd3de('0x2c'))){_0x5526d8[_0xd3de('0x19')]=qs[_0xd3de('0x19')](_0x56d41['query'][_0xd3de('0x19')]);_0x5526d8[_0xd3de('0x17')]=qs['offset'](_0x56d41['query'][_0xd3de('0x17')]);}return _0x19728f[_0xd3de('0x42')](_0x5526d8);}})[_0xd3de('0x1e')](function(_0x2ece5b){if(_0x2ece5b){return _0x2ece5b?{'count':_0x58fee4,'rows':_0x2ece5b}:null;}})[_0xd3de('0x1e')](respondWithResult(_0x21a458,null))[_0xd3de('0x38')](handleError(_0x21a458,null));};exports[_0xd3de('0x47')]=function(_0x568ccd,_0xd05051,_0x4b0377){var _0x4c20d4={};var _0x22d24b={};var _0x4b4fa2;var _0xec47eb;return db['SugarcrmConfiguration'][_0xd3de('0x43')]({'where':{'id':_0x568ccd[_0xd3de('0x3a')]['id']}})[_0xd3de('0x1e')](handleEntityNotFound(_0xd05051,null))[_0xd3de('0x1e')](function(_0x22d9d3){if(_0x22d9d3){_0x4b4fa2=_0x22d9d3;_0x22d24b[_0xd3de('0x25')]=_['keys'](db[_0xd3de('0x44')]['rawAttributes']);_0x22d24b[_0xd3de('0x27')]=_[_0xd3de('0x3b')](_0x568ccd[_0xd3de('0x27')]);_0x22d24b[_0xd3de('0x28')]=_[_0xd3de('0x3c')](_0x22d24b[_0xd3de('0x25')],_0x22d24b[_0xd3de('0x27')]);_0x4c20d4[_0xd3de('0x29')]=_['intersection'](_0x22d24b[_0xd3de('0x25')],qs[_0xd3de('0x2a')](_0x568ccd['query'][_0xd3de('0x2a')]));_0x4c20d4['attributes']=_0x4c20d4[_0xd3de('0x29')][_0xd3de('0x2b')]?_0x4c20d4[_0xd3de('0x29')]:_0x22d24b[_0xd3de('0x25')];_0x4c20d4[_0xd3de('0x2d')]=qs['sort'](_0x568ccd[_0xd3de('0x27')][_0xd3de('0x2e')]);_0x4c20d4['where']=qs['filters'](_['pick'](_0x568ccd[_0xd3de('0x27')],_0x22d24b[_0xd3de('0x28')]));if(_0x568ccd[_0xd3de('0x27')][_0xd3de('0x30')]){_0x4c20d4[_0xd3de('0x2f')]=_[_0xd3de('0x31')](_0x4c20d4[_0xd3de('0x2f')],{'$or':_[_0xd3de('0x32')](_0x4c20d4[_0xd3de('0x29')],function(_0x9cffb0){var _0x56a766={};_0x56a766[_0x9cffb0]={'$like':'%'+_0x568ccd['query'][_0xd3de('0x30')]+'%'};return _0x56a766;})});}_0x4c20d4=_['merge']({},_0x4c20d4,_0x568ccd[_0xd3de('0x33')]);return _0x4b4fa2[_0xd3de('0x47')](_0x4c20d4);}})['then'](function(_0x32be00){if(_0x32be00){_0xec47eb=_0x32be00[_0xd3de('0x2b')];if(!_0x568ccd[_0xd3de('0x27')]['hasOwnProperty'](_0xd3de('0x2c'))){_0x4c20d4[_0xd3de('0x19')]=qs[_0xd3de('0x19')](_0x568ccd[_0xd3de('0x27')][_0xd3de('0x19')]);_0x4c20d4[_0xd3de('0x17')]=qs[_0xd3de('0x17')](_0x568ccd[_0xd3de('0x27')][_0xd3de('0x17')]);}return _0x4b4fa2[_0xd3de('0x47')](_0x4c20d4);}})[_0xd3de('0x1e')](function(_0x354ad3){if(_0x354ad3){return _0x354ad3?{'count':_0xec47eb,'rows':_0x354ad3}:null;}})[_0xd3de('0x1e')](respondWithResult(_0xd05051,null))[_0xd3de('0x38')](handleError(_0xd05051,null));};exports['getDescriptions']=function(_0xaa5bd,_0x562585,_0x33fd44){var _0x1b7ebc={};var _0x9645a0={};var _0x21c5e9;var _0x48d81f;return db['SugarcrmConfiguration'][_0xd3de('0x43')]({'where':{'id':_0xaa5bd['params']['id']}})[_0xd3de('0x1e')](handleEntityNotFound(_0x562585,null))['then'](function(_0x2a5f8d){if(_0x2a5f8d){_0x21c5e9=_0x2a5f8d;_0x9645a0[_0xd3de('0x25')]=_['keys'](db[_0xd3de('0x44')][_0xd3de('0x21')]);_0x9645a0[_0xd3de('0x27')]=_['keys'](_0xaa5bd['query']);_0x9645a0[_0xd3de('0x28')]=_[_0xd3de('0x3c')](_0x9645a0[_0xd3de('0x25')],_0x9645a0[_0xd3de('0x27')]);_0x1b7ebc[_0xd3de('0x29')]=_['intersection'](_0x9645a0[_0xd3de('0x25')],qs[_0xd3de('0x2a')](_0xaa5bd['query'][_0xd3de('0x2a')]));_0x1b7ebc[_0xd3de('0x29')]=_0x1b7ebc[_0xd3de('0x29')]['length']?_0x1b7ebc[_0xd3de('0x29')]:_0x9645a0[_0xd3de('0x25')];_0x1b7ebc[_0xd3de('0x2d')]=qs[_0xd3de('0x2e')](_0xaa5bd[_0xd3de('0x27')][_0xd3de('0x2e')]);_0x1b7ebc[_0xd3de('0x2f')]=qs[_0xd3de('0x28')](_[_0xd3de('0x45')](_0xaa5bd[_0xd3de('0x27')],_0x9645a0[_0xd3de('0x28')]));if(_0xaa5bd['query'][_0xd3de('0x30')]){_0x1b7ebc[_0xd3de('0x2f')]=_[_0xd3de('0x31')](_0x1b7ebc[_0xd3de('0x2f')],{'$or':_[_0xd3de('0x32')](_0x1b7ebc['attributes'],function(_0x17e2a8){var _0x49c36e={};_0x49c36e[_0x17e2a8]={'$like':'%'+_0xaa5bd[_0xd3de('0x27')][_0xd3de('0x30')]+'%'};return _0x49c36e;})});}_0x1b7ebc=_[_0xd3de('0x31')]({},_0x1b7ebc,_0xaa5bd[_0xd3de('0x33')]);return _0x21c5e9[_0xd3de('0x48')](_0x1b7ebc);}})[_0xd3de('0x1e')](function(_0x42413f){if(_0x42413f){_0x48d81f=_0x42413f[_0xd3de('0x2b')];if(!_0xaa5bd[_0xd3de('0x27')][_0xd3de('0x46')](_0xd3de('0x2c'))){_0x1b7ebc[_0xd3de('0x19')]=qs[_0xd3de('0x19')](_0xaa5bd[_0xd3de('0x27')][_0xd3de('0x19')]);_0x1b7ebc[_0xd3de('0x17')]=qs[_0xd3de('0x17')](_0xaa5bd['query'][_0xd3de('0x17')]);}return _0x21c5e9['getDescriptions'](_0x1b7ebc);}})[_0xd3de('0x1e')](function(_0x3de560){if(_0x3de560){return _0x3de560?{'count':_0x48d81f,'rows':_0x3de560}:null;}})[_0xd3de('0x1e')](respondWithResult(_0x562585,null))[_0xd3de('0x38')](handleError(_0x562585,null));}; \ No newline at end of file +var _0xc57a=['to-csv','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','find','catch','create','body','getFields','findOne','length','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox'];(function(_0x3cd218,_0x12bed8){var _0x26a894=function(_0x28eaf9){while(--_0x28eaf9){_0x3cd218['push'](_0x3cd218['shift']());}};_0x26a894(++_0x12bed8);}(_0xc57a,0x8d));var _0xac57=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xc57a[_0x239dba];return _0x1ceb11;};'use strict';var emlformat=require(_0xac57('0x0'));var rimraf=require(_0xac57('0x1'));var zipdir=require(_0xac57('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac57('0x3'));var moment=require(_0xac57('0x4'));var BPromise=require(_0xac57('0x5'));var Mustache=require('mustache');var util=require(_0xac57('0x6'));var path=require(_0xac57('0x7'));var sox=require(_0xac57('0x8'));var csv=require(_0xac57('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac57('0xa'));var squel=require('squel');var crypto=require(_0xac57('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xac57('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac57('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xac57('0xe'));var hardwareService=require(_0xac57('0xf'));var logger=require(_0xac57('0x10'))(_0xac57('0x11'));var utils=require('../../config/utils');var config=require(_0xac57('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xac57('0x13'))['db'];function respondWithStatusCode(_0x288515,_0x59eb68){_0x59eb68=_0x59eb68||0xcc;return function(_0x45c438){if(_0x45c438){return _0x288515[_0xac57('0x14')](_0x59eb68);}return _0x288515[_0xac57('0x15')](_0x59eb68)[_0xac57('0x16')]();};}function respondWithResult(_0x9224e5,_0x42f21c){_0x42f21c=_0x42f21c||0xc8;return function(_0x3bb1b3){if(_0x3bb1b3){return _0x9224e5[_0xac57('0x15')](_0x42f21c)['json'](_0x3bb1b3);}};}function respondWithFilteredResult(_0x540b05,_0x2c3480){return function(_0x35b94e){if(_0x35b94e){var _0x31ac7b=typeof _0x2c3480[_0xac57('0x17')]===_0xac57('0x18')&&typeof _0x2c3480[_0xac57('0x19')]===_0xac57('0x18');var _0x154482=_0x35b94e[_0xac57('0x1a')];var _0x3bfa8f=_0x31ac7b?0x0:_0x2c3480[_0xac57('0x17')];var _0x45ecd5=_0x31ac7b?_0x35b94e[_0xac57('0x1a')]:_0x2c3480[_0xac57('0x17')]+_0x2c3480[_0xac57('0x19')];var _0x487cd7;if(_0x45ecd5>=_0x154482){_0x45ecd5=_0x154482;_0x487cd7=0xc8;}else{_0x487cd7=0xce;}_0x540b05[_0xac57('0x15')](_0x487cd7);return _0x540b05[_0xac57('0x1b')](_0xac57('0x1c'),_0x3bfa8f+'-'+_0x45ecd5+'/'+_0x154482)['json'](_0x35b94e);}return null;};}function patchUpdates(_0xfa27e3){return function(_0x24a334){try{jsonpatch['apply'](_0x24a334,_0xfa27e3,!![]);}catch(_0x19f879){return BPromise[_0xac57('0x1d')](_0x19f879);}return _0x24a334[_0xac57('0x1e')]();};}function saveUpdates(_0x2bc879,_0xb05dff){return function(_0x4d363a){if(_0x4d363a){return _0x4d363a[_0xac57('0x1f')](_0x2bc879)[_0xac57('0x20')](function(_0xd82ee7){return _0xd82ee7;});}return null;};}function removeEntity(_0x43be8b,_0x22e597){return function(_0x1234ae){if(_0x1234ae){return _0x1234ae[_0xac57('0x21')]()[_0xac57('0x20')](function(){_0x43be8b[_0xac57('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x738218,_0x4a8330){return function(_0x1d1082){if(!_0x1d1082){_0x738218['sendStatus'](0x194);}return _0x1d1082;};}function handleError(_0x42ac21,_0x1c7245){_0x1c7245=_0x1c7245||0x1f4;return function(_0x207643){logger[_0xac57('0x22')](_0x207643[_0xac57('0x23')]);if(_0x207643[_0xac57('0x24')]){delete _0x207643[_0xac57('0x24')];}_0x42ac21['status'](_0x1c7245)['send'](_0x207643);};}exports[_0xac57('0x25')]=function(_0x4b47a5,_0x3b8240){var _0x206373={},_0x5e1c13={},_0xe7a559={'count':0x0,'rows':[]};var _0x1f4beb=_[_0xac57('0x26')](db[_0xac57('0x27')][_0xac57('0x28')],function(_0x5d80b8){return{'name':_0x5d80b8[_0xac57('0x29')],'type':_0x5d80b8[_0xac57('0x2a')]['key']};});_0x5e1c13[_0xac57('0x2b')]=_['map'](_0x1f4beb,'name');_0x5e1c13[_0xac57('0x2c')]=_['keys'](_0x4b47a5[_0xac57('0x2c')]);_0x5e1c13[_0xac57('0x2d')]=_[_0xac57('0x2e')](_0x5e1c13[_0xac57('0x2b')],_0x5e1c13[_0xac57('0x2c')]);_0x206373['attributes']=_[_0xac57('0x2e')](_0x5e1c13['model'],qs[_0xac57('0x2f')](_0x4b47a5[_0xac57('0x2c')][_0xac57('0x2f')]));_0x206373[_0xac57('0x30')]=_0x206373['attributes']['length']?_0x206373[_0xac57('0x30')]:_0x5e1c13[_0xac57('0x2b')];if(!_0x4b47a5[_0xac57('0x2c')][_0xac57('0x31')](_0xac57('0x32'))){_0x206373[_0xac57('0x19')]=qs[_0xac57('0x19')](_0x4b47a5[_0xac57('0x2c')][_0xac57('0x19')]);_0x206373[_0xac57('0x17')]=qs[_0xac57('0x17')](_0x4b47a5[_0xac57('0x2c')][_0xac57('0x17')]);}_0x206373[_0xac57('0x33')]=qs[_0xac57('0x34')](_0x4b47a5[_0xac57('0x2c')][_0xac57('0x34')]);_0x206373[_0xac57('0x35')]=qs[_0xac57('0x2d')](_[_0xac57('0x36')](_0x4b47a5[_0xac57('0x2c')],_0x5e1c13[_0xac57('0x2d')]),_0x1f4beb);if(_0x4b47a5[_0xac57('0x2c')][_0xac57('0x37')]){_0x206373[_0xac57('0x35')]=_[_0xac57('0x38')](_0x206373[_0xac57('0x35')],{'$or':_[_0xac57('0x26')](_0x1f4beb,function(_0x29d42b){if(_0x29d42b['type']!==_0xac57('0x39')){var _0x5016b3={};_0x5016b3[_0x29d42b['name']]={'$like':'%'+_0x4b47a5[_0xac57('0x2c')]['filter']+'%'};return _0x5016b3;}})});}_0x206373=_['merge']({},_0x206373,_0x4b47a5[_0xac57('0x3a')]);var _0x2a14b4={'where':_0x206373[_0xac57('0x35')]};return db['SugarcrmConfiguration'][_0xac57('0x1a')](_0x2a14b4)['then'](function(_0x1245c0){_0xe7a559[_0xac57('0x1a')]=_0x1245c0;if(_0x4b47a5[_0xac57('0x2c')]['includeAll']){_0x206373[_0xac57('0x3b')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xac57('0x3c')](_0x206373);})[_0xac57('0x20')](function(_0x6357bf){_0xe7a559[_0xac57('0x3d')]=_0x6357bf;return _0xe7a559;})[_0xac57('0x20')](respondWithFilteredResult(_0x3b8240,_0x206373))['catch'](handleError(_0x3b8240,null));};exports[_0xac57('0x3e')]=function(_0x38e89d,_0x44db4e){var _0x82b97b={'raw':![],'where':{'id':_0x38e89d[_0xac57('0x3f')]['id']}},_0x2768a3={};_0x2768a3['model']=_['keys'](db['SugarcrmConfiguration'][_0xac57('0x28')]);_0x2768a3[_0xac57('0x2c')]=_[_0xac57('0x40')](_0x38e89d[_0xac57('0x2c')]);_0x2768a3['filters']=_['intersection'](_0x2768a3[_0xac57('0x2b')],_0x2768a3[_0xac57('0x2c')]);_0x82b97b[_0xac57('0x30')]=_[_0xac57('0x2e')](_0x2768a3[_0xac57('0x2b')],qs['fields'](_0x38e89d['query'][_0xac57('0x2f')]));_0x82b97b[_0xac57('0x30')]=_0x82b97b[_0xac57('0x30')]['length']?_0x82b97b[_0xac57('0x30')]:_0x2768a3[_0xac57('0x2b')];if(_0x38e89d[_0xac57('0x2c')]['includeAll']){_0x82b97b['include']=[{'all':!![]}];}_0x82b97b=_['merge']({},_0x82b97b,_0x38e89d[_0xac57('0x3a')]);return db[_0xac57('0x27')][_0xac57('0x41')](_0x82b97b)[_0xac57('0x20')](handleEntityNotFound(_0x44db4e,null))['then'](respondWithResult(_0x44db4e,null))[_0xac57('0x42')](handleError(_0x44db4e,null));};exports[_0xac57('0x43')]=function(_0x526671,_0x4cafca){return db['SugarcrmConfiguration'][_0xac57('0x43')](_0x526671[_0xac57('0x44')],{})['then'](respondWithResult(_0x4cafca,0xc9))['catch'](handleError(_0x4cafca,null));};exports[_0xac57('0x1f')]=function(_0x33302d,_0x4043e1){if(_0x33302d['body']['id']){delete _0x33302d[_0xac57('0x44')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x33302d[_0xac57('0x3f')]['id']}})[_0xac57('0x20')](handleEntityNotFound(_0x4043e1,null))[_0xac57('0x20')](saveUpdates(_0x33302d[_0xac57('0x44')],null))[_0xac57('0x20')](respondWithResult(_0x4043e1,null))['catch'](handleError(_0x4043e1,null));};exports[_0xac57('0x21')]=function(_0x5bc7a1,_0x345b81){return db[_0xac57('0x27')][_0xac57('0x41')]({'where':{'id':_0x5bc7a1[_0xac57('0x3f')]['id']}})[_0xac57('0x20')](handleEntityNotFound(_0x345b81,null))['then'](removeEntity(_0x345b81,null))['catch'](handleError(_0x345b81,null));};exports[_0xac57('0x45')]=function(_0x1ab067,_0x28bd57,_0x5c2183){var _0x15ab5c={};var _0x37f172={};var _0x3671ed;var _0x51e3de;return db['SugarcrmConfiguration'][_0xac57('0x46')]({'where':{'id':_0x1ab067['params']['id']}})[_0xac57('0x20')](handleEntityNotFound(_0x28bd57,null))[_0xac57('0x20')](function(_0x52058b){if(_0x52058b){_0x3671ed=_0x52058b;_0x37f172[_0xac57('0x2b')]=_[_0xac57('0x40')](db['SugarcrmField'][_0xac57('0x28')]);_0x37f172[_0xac57('0x2c')]=_[_0xac57('0x40')](_0x1ab067[_0xac57('0x2c')]);_0x37f172['filters']=_[_0xac57('0x2e')](_0x37f172[_0xac57('0x2b')],_0x37f172[_0xac57('0x2c')]);_0x15ab5c[_0xac57('0x30')]=_[_0xac57('0x2e')](_0x37f172['model'],qs['fields'](_0x1ab067[_0xac57('0x2c')][_0xac57('0x2f')]));_0x15ab5c[_0xac57('0x30')]=_0x15ab5c['attributes'][_0xac57('0x47')]?_0x15ab5c[_0xac57('0x30')]:_0x37f172[_0xac57('0x2b')];_0x15ab5c[_0xac57('0x33')]=qs[_0xac57('0x34')](_0x1ab067[_0xac57('0x2c')]['sort']);_0x15ab5c[_0xac57('0x35')]=qs[_0xac57('0x2d')](_[_0xac57('0x36')](_0x1ab067[_0xac57('0x2c')],_0x37f172[_0xac57('0x2d')]));if(_0x1ab067['query'][_0xac57('0x37')]){_0x15ab5c[_0xac57('0x35')]=_[_0xac57('0x38')](_0x15ab5c[_0xac57('0x35')],{'$or':_[_0xac57('0x26')](_0x15ab5c[_0xac57('0x30')],function(_0x214185){var _0x427d9d={};_0x427d9d[_0x214185]={'$like':'%'+_0x1ab067[_0xac57('0x2c')]['filter']+'%'};return _0x427d9d;})});}_0x15ab5c=_['merge']({},_0x15ab5c,_0x1ab067[_0xac57('0x3a')]);return _0x3671ed['getFields'](_0x15ab5c);}})[_0xac57('0x20')](function(_0x12f805){if(_0x12f805){_0x51e3de=_0x12f805[_0xac57('0x47')];if(!_0x1ab067[_0xac57('0x2c')][_0xac57('0x31')]('nolimit')){_0x15ab5c[_0xac57('0x19')]=qs[_0xac57('0x19')](_0x1ab067[_0xac57('0x2c')][_0xac57('0x19')]);_0x15ab5c[_0xac57('0x17')]=qs[_0xac57('0x17')](_0x1ab067[_0xac57('0x2c')]['offset']);}return _0x3671ed['getFields'](_0x15ab5c);}})[_0xac57('0x20')](function(_0x4f9d38){if(_0x4f9d38){return _0x4f9d38?{'count':_0x51e3de,'rows':_0x4f9d38}:null;}})[_0xac57('0x20')](respondWithResult(_0x28bd57,null))[_0xac57('0x42')](handleError(_0x28bd57,null));};exports[_0xac57('0x48')]=function(_0x5cdb3c,_0xb3afd4,_0x1d839e){var _0x3fc34a={};var _0x4afb65={};var _0x2c48df;var _0x211f0a;return db[_0xac57('0x27')][_0xac57('0x46')]({'where':{'id':_0x5cdb3c['params']['id']}})['then'](handleEntityNotFound(_0xb3afd4,null))[_0xac57('0x20')](function(_0x6535d5){if(_0x6535d5){_0x2c48df=_0x6535d5;_0x4afb65[_0xac57('0x2b')]=_[_0xac57('0x40')](db[_0xac57('0x49')]['rawAttributes']);_0x4afb65['query']=_[_0xac57('0x40')](_0x5cdb3c[_0xac57('0x2c')]);_0x4afb65['filters']=_[_0xac57('0x2e')](_0x4afb65[_0xac57('0x2b')],_0x4afb65['query']);_0x3fc34a[_0xac57('0x30')]=_[_0xac57('0x2e')](_0x4afb65[_0xac57('0x2b')],qs[_0xac57('0x2f')](_0x5cdb3c[_0xac57('0x2c')]['fields']));_0x3fc34a[_0xac57('0x30')]=_0x3fc34a[_0xac57('0x30')][_0xac57('0x47')]?_0x3fc34a[_0xac57('0x30')]:_0x4afb65[_0xac57('0x2b')];_0x3fc34a[_0xac57('0x33')]=qs[_0xac57('0x34')](_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x34')]);_0x3fc34a['where']=qs[_0xac57('0x2d')](_['pick'](_0x5cdb3c['query'],_0x4afb65['filters']));if(_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x37')]){_0x3fc34a['where']=_[_0xac57('0x38')](_0x3fc34a[_0xac57('0x35')],{'$or':_[_0xac57('0x26')](_0x3fc34a[_0xac57('0x30')],function(_0x1623a3){var _0x2b0051={};_0x2b0051[_0x1623a3]={'$like':'%'+_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x37')]+'%'};return _0x2b0051;})});}_0x3fc34a=_[_0xac57('0x38')]({},_0x3fc34a,_0x5cdb3c[_0xac57('0x3a')]);return _0x2c48df[_0xac57('0x48')](_0x3fc34a);}})[_0xac57('0x20')](function(_0x583ffe){if(_0x583ffe){_0x211f0a=_0x583ffe[_0xac57('0x47')];if(!_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x31')](_0xac57('0x32'))){_0x3fc34a[_0xac57('0x19')]=qs[_0xac57('0x19')](_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x19')]);_0x3fc34a[_0xac57('0x17')]=qs[_0xac57('0x17')](_0x5cdb3c[_0xac57('0x2c')][_0xac57('0x17')]);}return _0x2c48df['getSubjects'](_0x3fc34a);}})['then'](function(_0x2c829a){if(_0x2c829a){return _0x2c829a?{'count':_0x211f0a,'rows':_0x2c829a}:null;}})[_0xac57('0x20')](respondWithResult(_0xb3afd4,null))[_0xac57('0x42')](handleError(_0xb3afd4,null));};exports['getDescriptions']=function(_0x93d3c2,_0x4433fc,_0x193385){var _0xb12af5={};var _0x2ec2c6={};var _0x1a0e8a;var _0xcc1bbd;return db[_0xac57('0x27')]['findOne']({'where':{'id':_0x93d3c2[_0xac57('0x3f')]['id']}})[_0xac57('0x20')](handleEntityNotFound(_0x4433fc,null))['then'](function(_0xd97536){if(_0xd97536){_0x1a0e8a=_0xd97536;_0x2ec2c6[_0xac57('0x2b')]=_[_0xac57('0x40')](db['SugarcrmField'][_0xac57('0x28')]);_0x2ec2c6[_0xac57('0x2c')]=_[_0xac57('0x40')](_0x93d3c2[_0xac57('0x2c')]);_0x2ec2c6[_0xac57('0x2d')]=_[_0xac57('0x2e')](_0x2ec2c6['model'],_0x2ec2c6[_0xac57('0x2c')]);_0xb12af5[_0xac57('0x30')]=_[_0xac57('0x2e')](_0x2ec2c6[_0xac57('0x2b')],qs[_0xac57('0x2f')](_0x93d3c2['query'][_0xac57('0x2f')]));_0xb12af5[_0xac57('0x30')]=_0xb12af5[_0xac57('0x30')][_0xac57('0x47')]?_0xb12af5[_0xac57('0x30')]:_0x2ec2c6[_0xac57('0x2b')];_0xb12af5[_0xac57('0x33')]=qs[_0xac57('0x34')](_0x93d3c2[_0xac57('0x2c')][_0xac57('0x34')]);_0xb12af5[_0xac57('0x35')]=qs[_0xac57('0x2d')](_[_0xac57('0x36')](_0x93d3c2[_0xac57('0x2c')],_0x2ec2c6[_0xac57('0x2d')]));if(_0x93d3c2[_0xac57('0x2c')][_0xac57('0x37')]){_0xb12af5['where']=_[_0xac57('0x38')](_0xb12af5[_0xac57('0x35')],{'$or':_[_0xac57('0x26')](_0xb12af5['attributes'],function(_0x16edb2){var _0x332ddc={};_0x332ddc[_0x16edb2]={'$like':'%'+_0x93d3c2['query']['filter']+'%'};return _0x332ddc;})});}_0xb12af5=_[_0xac57('0x38')]({},_0xb12af5,_0x93d3c2['options']);return _0x1a0e8a[_0xac57('0x4a')](_0xb12af5);}})[_0xac57('0x20')](function(_0x5ebf14){if(_0x5ebf14){_0xcc1bbd=_0x5ebf14[_0xac57('0x47')];if(!_0x93d3c2['query'][_0xac57('0x31')](_0xac57('0x32'))){_0xb12af5[_0xac57('0x19')]=qs[_0xac57('0x19')](_0x93d3c2[_0xac57('0x2c')][_0xac57('0x19')]);_0xb12af5[_0xac57('0x17')]=qs[_0xac57('0x17')](_0x93d3c2[_0xac57('0x2c')][_0xac57('0x17')]);}return _0x1a0e8a[_0xac57('0x4a')](_0xb12af5);}})['then'](function(_0x1cd08b){if(_0x1cd08b){return _0x1cd08b?{'count':_0xcc1bbd,'rows':_0x1cd08b}:null;}})[_0xac57('0x20')](respondWithResult(_0x4433fc,null))[_0xac57('0x42')](handleError(_0x4433fc,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9acfb1d..82c7efe 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 _0x54cc=['lodash','util','api','moment','request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration'];(function(_0x1329e5,_0x13f0e7){var _0xdcfa40=function(_0x4d06c4){while(--_0x4d06c4){_0x1329e5['push'](_0x1329e5['shift']());}};_0xdcfa40(++_0x13f0e7);}(_0x54cc,0x1ef));var _0xc54c=function(_0x19e961,_0x48c161){_0x19e961=_0x19e961-0x0;var _0x556df3=_0x54cc[_0x19e961];return _0x556df3;};'use strict';var _=require(_0xc54c('0x0'));var util=require(_0xc54c('0x1'));var logger=require('../../config/logger')(_0xc54c('0x2'));var moment=require(_0xc54c('0x3'));var BPromise=require('bluebird');var rp=require(_0xc54c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc54c('0x5'));var config=require('../../config/environment');var attributes=require(_0xc54c('0x6'));module[_0xc54c('0x7')]=function(_0x1bf4ef,_0x1e795d){return _0x1bf4ef['define'](_0xc54c('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3244=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x3244,0x9c));var _0x4324=function(_0x1ef0e8,_0x2bc4b9){_0x1ef0e8=_0x1ef0e8-0x0;var _0x4e4333=_0x3244[_0x1ef0e8];return _0x4e4333;};'use strict';var _=require(_0x4324('0x0'));var util=require(_0x4324('0x1'));var logger=require(_0x4324('0x2'))(_0x4324('0x3'));var moment=require(_0x4324('0x4'));var BPromise=require(_0x4324('0x5'));var rp=require(_0x4324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4324('0x7'));var config=require(_0x4324('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x5db900,_0x226c1e){return _0x5db900[_0x4324('0x9')](_0x4324('0xa'),attributes,{'tableName':_0x4324('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 0f487dd..60314bf 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 _0x6178=['../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xb94089,_0x47608e){var _0x303a65=function(_0x2e9dbf){while(--_0x2e9dbf){_0xb94089['push'](_0xb94089['shift']());}};_0x303a65(++_0x47608e);}(_0x6178,0xa1));var _0x8617=function(_0x12171a,_0x3ace15){_0x12171a=_0x12171a-0x0;var _0x5a3f25=_0x6178[_0x12171a];return _0x5a3f25;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var moment=require(_0x8617('0x2'));var BPromise=require(_0x8617('0x3'));var rs=require(_0x8617('0x4'));var fs=require('fs');var Redis=require(_0x8617('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8617('0x6'));var logger=require(_0x8617('0x7'))(_0x8617('0x8'));var config=require('../../config/environment');var jayson=require(_0x8617('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x220232,_0x3dfb2d,_0x5b69ba){return new BPromise(function(_0x3011cf,_0x33fd0d){return client[_0x8617('0xa')](_0x220232,_0x5b69ba)[_0x8617('0xb')](function(_0x4c99e7){logger[_0x8617('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3dfb2d,_0x8617('0xd'));logger[_0x8617('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3dfb2d,_0x8617('0xd'),JSON['stringify'](_0x4c99e7));if(_0x4c99e7[_0x8617('0xf')]){if(_0x4c99e7[_0x8617('0xf')][_0x8617('0x10')]===0x1f4){logger[_0x8617('0xf')](_0x8617('0x11'),_0x3dfb2d,_0x4c99e7[_0x8617('0xf')][_0x8617('0x12')]);return _0x33fd0d(_0x4c99e7[_0x8617('0xf')][_0x8617('0x12')]);}logger[_0x8617('0xf')](_0x8617('0x11'),_0x3dfb2d,_0x4c99e7['error'][_0x8617('0x12')]);return _0x3011cf(_0x4c99e7[_0x8617('0xf')][_0x8617('0x12')]);}else{logger[_0x8617('0xc')](_0x8617('0x11'),_0x3dfb2d,_0x8617('0xd'));_0x3011cf(_0x4c99e7[_0x8617('0x13')]['message']);}})[_0x8617('0x14')](function(_0x2db3b6){logger[_0x8617('0xf')](_0x8617('0x11'),_0x3dfb2d,_0x2db3b6);_0x33fd0d(_0x2db3b6);});});} \ No newline at end of file +var _0x2894=['jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x457e16,_0x47dc45){var _0x534ddb=function(_0x3e06ce){while(--_0x3e06ce){_0x457e16['push'](_0x457e16['shift']());}};_0x534ddb(++_0x47dc45);}(_0x2894,0x19a));var _0x4289=function(_0x463183,_0x56bd4e){_0x463183=_0x463183-0x0;var _0xd5fe56=_0x2894[_0x463183];return _0xd5fe56;};'use strict';var _=require(_0x4289('0x0'));var util=require(_0x4289('0x1'));var moment=require(_0x4289('0x2'));var BPromise=require('bluebird');var rs=require(_0x4289('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4289('0x4'))['db'];var utils=require(_0x4289('0x5'));var logger=require('../../config/logger')(_0x4289('0x6'));var config=require(_0x4289('0x7'));var jayson=require(_0x4289('0x8'));var client=jayson['client'][_0x4289('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ed228,_0x5f3848,_0x420aab){return new BPromise(function(_0xb402a4,_0x1c7ef2){return client[_0x4289('0xa')](_0x4ed228,_0x420aab)[_0x4289('0xb')](function(_0x6ddbce){logger[_0x4289('0xc')](_0x4289('0xd'),_0x5f3848,_0x4289('0xe'));logger[_0x4289('0xf')](_0x4289('0x10'),_0x5f3848,_0x4289('0xe'),JSON[_0x4289('0x11')](_0x6ddbce));if(_0x6ddbce[_0x4289('0x12')]){if(_0x6ddbce['error']['code']===0x1f4){logger[_0x4289('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5f3848,_0x6ddbce[_0x4289('0x12')][_0x4289('0x13')]);return _0x1c7ef2(_0x6ddbce[_0x4289('0x12')][_0x4289('0x13')]);}logger[_0x4289('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5f3848,_0x6ddbce['error']['message']);return _0xb402a4(_0x6ddbce[_0x4289('0x12')][_0x4289('0x13')]);}else{logger[_0x4289('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5f3848,'request\x20sent');_0xb402a4(_0x6ddbce[_0x4289('0x14')]['message']);}})[_0x4289('0x15')](function(_0x3ea0ff){logger[_0x4289('0x12')](_0x4289('0xd'),_0x5f3848,_0x3ea0ff);_0x1c7ef2(_0x3ea0ff);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 2513b3b..a437a39 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 _0x712d=['get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x3fd4b3,_0x17d3ef){var _0x2979a3=function(_0x4fa13c){while(--_0x4fa13c){_0x3fd4b3['push'](_0x3fd4b3['shift']());}};_0x2979a3(++_0x17d3ef);}(_0x712d,0x123));var _0xd712=function(_0x1aed89,_0x379525){_0x1aed89=_0x1aed89-0x0;var _0x42ce23=_0x712d[_0x1aed89];return _0x42ce23;};'use strict';var multer=require('multer');var util=require(_0xd712('0x0'));var path=require('path');var timeout=require(_0xd712('0x1'));var express=require(_0xd712('0x2'));var router=express[_0xd712('0x3')]();var fs_extra=require(_0xd712('0x4'));var auth=require(_0xd712('0x5'));var interaction=require(_0xd712('0x6'));var config=require(_0xd712('0x7'));var controller=require(_0xd712('0x8'));router[_0xd712('0x9')]('/',auth[_0xd712('0xa')](),controller['index']);router[_0xd712('0x9')]('/:id',auth[_0xd712('0xa')](),controller[_0xd712('0xb')]);router[_0xd712('0xc')]('/',auth[_0xd712('0xa')](),controller[_0xd712('0xd')]);router[_0xd712('0xe')](_0xd712('0xf'),auth[_0xd712('0xa')](),controller[_0xd712('0x10')]);router[_0xd712('0x11')](_0xd712('0xf'),auth[_0xd712('0xa')](),controller[_0xd712('0x12')]);module[_0xd712('0x13')]=router; \ No newline at end of file +var _0x8bd5=['delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','show','post','create','put'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8bd5,0x107));var _0x58bd=function(_0x5854b8,_0x54265c){_0x5854b8=_0x5854b8-0x0;var _0x48ca8c=_0x8bd5[_0x5854b8];return _0x48ca8c;};'use strict';var multer=require('multer');var util=require(_0x58bd('0x0'));var path=require(_0x58bd('0x1'));var timeout=require(_0x58bd('0x2'));var express=require(_0x58bd('0x3'));var router=express[_0x58bd('0x4')]();var fs_extra=require(_0x58bd('0x5'));var auth=require(_0x58bd('0x6'));var interaction=require(_0x58bd('0x7'));var config=require(_0x58bd('0x8'));var controller=require(_0x58bd('0x9'));router['get']('/',auth[_0x58bd('0xa')](),controller[_0x58bd('0xb')]);router[_0x58bd('0xc')]('/:id',auth[_0x58bd('0xa')](),controller[_0x58bd('0xd')]);router[_0x58bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x58bd('0xf')]);router[_0x58bd('0x10')]('/:id',auth[_0x58bd('0xa')](),controller['update']);router[_0x58bd('0x11')](_0x58bd('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x58bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 575f4a1..a899e5f 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 _0xa55f=['sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa55f,0x158));var _0xfa55=function(_0x37b3ef,_0x49ccd8){_0x37b3ef=_0x37b3ef-0x0;var _0x200dbe=_0xa55f[_0x37b3ef];return _0x200dbe;};'use strict';var Sequelize=require(_0xfa55('0x0'));module['exports']={'type':{'type':Sequelize[_0xfa55('0x1')]('string',_0xfa55('0x2'),_0xfa55('0x3'),_0xfa55('0x4'),_0xfa55('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa55('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfa55('0x1')]('string','variable',_0xfa55('0x3'))},'keyContent':{'type':Sequelize[_0xfa55('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfa55('0x6')]},'customField':{'type':Sequelize[_0xfa55('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa55('0x6')]}}; \ No newline at end of file +var _0xa1e9=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa1e9,0x6d));var _0x9a1e=function(_0x2c1fc6,_0x292eab){_0x2c1fc6=_0x2c1fc6-0x0;var _0x59335b=_0xa1e9[_0x2c1fc6];return _0x59335b;};'use strict';var Sequelize=require('sequelize');module[_0x9a1e('0x0')]={'type':{'type':Sequelize[_0x9a1e('0x1')](_0x9a1e('0x2'),_0x9a1e('0x3'),_0x9a1e('0x4'),_0x9a1e('0x5'),_0x9a1e('0x6')),'defaultValue':_0x9a1e('0x2')},'content':{'type':Sequelize[_0x9a1e('0x7')]},'key':{'type':Sequelize[_0x9a1e('0x7')]},'keyType':{'type':Sequelize[_0x9a1e('0x1')](_0x9a1e('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x9a1e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9a1e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a1e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 933e114..ffd64b3 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 _0xa59c=['stack','name','send','index','map','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','SugarcrmField','rows','show','params','rawAttributes','includeAll','include','find','create','catch','destroy','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error'];(function(_0x3419e9,_0x44890c){var _0x409edd=function(_0xb15b6e){while(--_0xb15b6e){_0x3419e9['push'](_0x3419e9['shift']());}};_0x409edd(++_0x44890c);}(_0xa59c,0x17e));var _0xca59=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0xa59c[_0x35ebae];return _0x1924cf;};'use strict';var emlformat=require(_0xca59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca59('0x2'));var moment=require(_0xca59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xca59('0x4'));var util=require('util');var path=require(_0xca59('0x5'));var sox=require(_0xca59('0x6'));var csv=require(_0xca59('0x7'));var ejs=require(_0xca59('0x8'));var fs=require('fs');var fs_extra=require(_0xca59('0x9'));var _=require('lodash');var squel=require(_0xca59('0xa'));var crypto=require(_0xca59('0xb'));var jsforce=require(_0xca59('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xca59('0x7'));var querystring=require(_0xca59('0xd'));var Papa=require(_0xca59('0xe'));var Redis=require(_0xca59('0xf'));var authService=require(_0xca59('0x10'));var qs=require(_0xca59('0x11'));var as=require(_0xca59('0x12'));var hardwareService=require(_0xca59('0x13'));var logger=require('../../config/logger')(_0xca59('0x14'));var utils=require(_0xca59('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xca59('0x16'));var db=require(_0xca59('0x17'))['db'];function respondWithStatusCode(_0x5bb62b,_0x461136){_0x461136=_0x461136||0xcc;return function(_0x14292d){if(_0x14292d){return _0x5bb62b['sendStatus'](_0x461136);}return _0x5bb62b[_0xca59('0x18')](_0x461136)[_0xca59('0x19')]();};}function respondWithResult(_0x5324ed,_0x4b9c00){_0x4b9c00=_0x4b9c00||0xc8;return function(_0x597a1c){if(_0x597a1c){return _0x5324ed[_0xca59('0x18')](_0x4b9c00)[_0xca59('0x1a')](_0x597a1c);}};}function respondWithFilteredResult(_0x5476b8,_0x355dcd){return function(_0x3f2eb9){if(_0x3f2eb9){var _0x9b0155=typeof _0x355dcd[_0xca59('0x1b')]===_0xca59('0x1c')&&typeof _0x355dcd['limit']==='undefined';var _0x4fab2a=_0x3f2eb9[_0xca59('0x1d')];var _0x2b31e0=_0x9b0155?0x0:_0x355dcd[_0xca59('0x1b')];var _0x3ab1d6=_0x9b0155?_0x3f2eb9[_0xca59('0x1d')]:_0x355dcd['offset']+_0x355dcd[_0xca59('0x1e')];var _0xee7cff;if(_0x3ab1d6>=_0x4fab2a){_0x3ab1d6=_0x4fab2a;_0xee7cff=0xc8;}else{_0xee7cff=0xce;}_0x5476b8[_0xca59('0x18')](_0xee7cff);return _0x5476b8[_0xca59('0x1f')](_0xca59('0x20'),_0x2b31e0+'-'+_0x3ab1d6+'/'+_0x4fab2a)['json'](_0x3f2eb9);}return null;};}function patchUpdates(_0x20accd){return function(_0x1fbbd1){try{jsonpatch['apply'](_0x1fbbd1,_0x20accd,!![]);}catch(_0x1da745){return BPromise[_0xca59('0x21')](_0x1da745);}return _0x1fbbd1[_0xca59('0x22')]();};}function saveUpdates(_0x49a15a,_0x4e81af){return function(_0x2f653b){if(_0x2f653b){return _0x2f653b[_0xca59('0x23')](_0x49a15a)['then'](function(_0x534ccb){return _0x534ccb;});}return null;};}function removeEntity(_0x2dd6c2,_0x511158){return function(_0xaf90dd){if(_0xaf90dd){return _0xaf90dd['destroy']()[_0xca59('0x24')](function(){_0x2dd6c2[_0xca59('0x18')](0xcc)[_0xca59('0x19')]();});}};}function handleEntityNotFound(_0x4b2759,_0x492242){return function(_0x53310a){if(!_0x53310a){_0x4b2759['sendStatus'](0x194);}return _0x53310a;};}function handleError(_0x11205a,_0x2f541b){_0x2f541b=_0x2f541b||0x1f4;return function(_0x58cff2){logger[_0xca59('0x25')](_0x58cff2[_0xca59('0x26')]);if(_0x58cff2[_0xca59('0x27')]){delete _0x58cff2[_0xca59('0x27')];}_0x11205a[_0xca59('0x18')](_0x2f541b)[_0xca59('0x28')](_0x58cff2);};}exports[_0xca59('0x29')]=function(_0x4a355c,_0x5983f8){var _0x5a486b={},_0xb6256c={},_0x34fd54={'count':0x0,'rows':[]};var _0x51ec7b=_[_0xca59('0x2a')](db['SugarcrmField']['rawAttributes'],function(_0x4efcbf){return{'name':_0x4efcbf['fieldName'],'type':_0x4efcbf['type'][_0xca59('0x2b')]};});_0xb6256c['model']=_['map'](_0x51ec7b,'name');_0xb6256c[_0xca59('0x2c')]=_[_0xca59('0x2d')](_0x4a355c[_0xca59('0x2c')]);_0xb6256c[_0xca59('0x2e')]=_[_0xca59('0x2f')](_0xb6256c[_0xca59('0x30')],_0xb6256c[_0xca59('0x2c')]);_0x5a486b['attributes']=_[_0xca59('0x2f')](_0xb6256c['model'],qs[_0xca59('0x31')](_0x4a355c[_0xca59('0x2c')]['fields']));_0x5a486b['attributes']=_0x5a486b[_0xca59('0x32')][_0xca59('0x33')]?_0x5a486b[_0xca59('0x32')]:_0xb6256c[_0xca59('0x30')];if(!_0x4a355c[_0xca59('0x2c')]['hasOwnProperty'](_0xca59('0x34'))){_0x5a486b[_0xca59('0x1e')]=qs[_0xca59('0x1e')](_0x4a355c[_0xca59('0x2c')][_0xca59('0x1e')]);_0x5a486b[_0xca59('0x1b')]=qs[_0xca59('0x1b')](_0x4a355c['query'][_0xca59('0x1b')]);}_0x5a486b['order']=qs[_0xca59('0x35')](_0x4a355c[_0xca59('0x2c')][_0xca59('0x35')]);_0x5a486b[_0xca59('0x36')]=qs[_0xca59('0x2e')](_[_0xca59('0x37')](_0x4a355c[_0xca59('0x2c')],_0xb6256c[_0xca59('0x2e')]),_0x51ec7b);if(_0x4a355c[_0xca59('0x2c')][_0xca59('0x38')]){_0x5a486b[_0xca59('0x36')]=_[_0xca59('0x39')](_0x5a486b[_0xca59('0x36')],{'$or':_[_0xca59('0x2a')](_0x51ec7b,function(_0x9c67d3){if(_0x9c67d3['type']!=='VIRTUAL'){var _0x45e20f={};_0x45e20f[_0x9c67d3[_0xca59('0x27')]]={'$like':'%'+_0x4a355c[_0xca59('0x2c')][_0xca59('0x38')]+'%'};return _0x45e20f;}})});}_0x5a486b=_[_0xca59('0x39')]({},_0x5a486b,_0x4a355c[_0xca59('0x3a')]);var _0x379057={'where':_0x5a486b['where']};return db[_0xca59('0x3b')][_0xca59('0x1d')](_0x379057)[_0xca59('0x24')](function(_0x13c579){_0x34fd54[_0xca59('0x1d')]=_0x13c579;if(_0x4a355c[_0xca59('0x2c')]['includeAll']){_0x5a486b['include']=[{'all':!![]}];}return db[_0xca59('0x3b')]['findAll'](_0x5a486b);})[_0xca59('0x24')](function(_0x56cbb3){_0x34fd54[_0xca59('0x3c')]=_0x56cbb3;return _0x34fd54;})[_0xca59('0x24')](respondWithFilteredResult(_0x5983f8,_0x5a486b))['catch'](handleError(_0x5983f8,null));};exports[_0xca59('0x3d')]=function(_0x36d8ab,_0x4d1f59){var _0x15dc7c={'raw':!![],'where':{'id':_0x36d8ab[_0xca59('0x3e')]['id']}},_0x62683b={};_0x62683b['model']=_[_0xca59('0x2d')](db[_0xca59('0x3b')][_0xca59('0x3f')]);_0x62683b[_0xca59('0x2c')]=_[_0xca59('0x2d')](_0x36d8ab[_0xca59('0x2c')]);_0x62683b[_0xca59('0x2e')]=_[_0xca59('0x2f')](_0x62683b[_0xca59('0x30')],_0x62683b[_0xca59('0x2c')]);_0x15dc7c[_0xca59('0x32')]=_['intersection'](_0x62683b[_0xca59('0x30')],qs[_0xca59('0x31')](_0x36d8ab[_0xca59('0x2c')]['fields']));_0x15dc7c[_0xca59('0x32')]=_0x15dc7c['attributes'][_0xca59('0x33')]?_0x15dc7c[_0xca59('0x32')]:_0x62683b[_0xca59('0x30')];if(_0x36d8ab['query'][_0xca59('0x40')]){_0x15dc7c[_0xca59('0x41')]=[{'all':!![]}];}_0x15dc7c=_[_0xca59('0x39')]({},_0x15dc7c,_0x36d8ab[_0xca59('0x3a')]);return db[_0xca59('0x3b')][_0xca59('0x42')](_0x15dc7c)[_0xca59('0x24')](handleEntityNotFound(_0x4d1f59,null))['then'](respondWithResult(_0x4d1f59,null))['catch'](handleError(_0x4d1f59,null));};exports[_0xca59('0x43')]=function(_0xc6bb1b,_0x51fac7){return db[_0xca59('0x3b')][_0xca59('0x43')](_0xc6bb1b['body'],{})[_0xca59('0x24')](respondWithResult(_0x51fac7,0xc9))['catch'](handleError(_0x51fac7,null));};exports['update']=function(_0x3ded83,_0x57f217){if(_0x3ded83['body']['id']){delete _0x3ded83['body']['id'];}return db[_0xca59('0x3b')][_0xca59('0x42')]({'where':{'id':_0x3ded83[_0xca59('0x3e')]['id']}})[_0xca59('0x24')](handleEntityNotFound(_0x57f217,null))['then'](saveUpdates(_0x3ded83['body'],null))[_0xca59('0x24')](respondWithResult(_0x57f217,null))[_0xca59('0x44')](handleError(_0x57f217,null));};exports[_0xca59('0x45')]=function(_0x42680d,_0x5a4c65){return db[_0xca59('0x3b')][_0xca59('0x42')]({'where':{'id':_0x42680d['params']['id']}})[_0xca59('0x24')](handleEntityNotFound(_0x5a4c65,null))[_0xca59('0x24')](removeEntity(_0x5a4c65,null))[_0xca59('0x44')](handleError(_0x5a4c65,null));}; \ No newline at end of file +var _0x879b=['Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','SugarcrmField','includeAll','include','findAll','rows','show','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset'];(function(_0x591f27,_0x36a050){var _0x464a4a=function(_0x5026a3){while(--_0x5026a3){_0x591f27['push'](_0x591f27['shift']());}};_0x464a4a(++_0x36a050);}(_0x879b,0xf4));var _0xb879=function(_0x22665a,_0x1668e5){_0x22665a=_0x22665a-0x0;var _0xa1acb3=_0x879b[_0x22665a];return _0xa1acb3;};'use strict';var emlformat=require(_0xb879('0x0'));var rimraf=require(_0xb879('0x1'));var zipdir=require(_0xb879('0x2'));var jsonpatch=require(_0xb879('0x3'));var rp=require('request-promise');var moment=require(_0xb879('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb879('0x5'));var util=require(_0xb879('0x6'));var path=require('path');var sox=require(_0xb879('0x7'));var csv=require(_0xb879('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb879('0x9'));var _=require(_0xb879('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb879('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb879('0xc'));var Redis=require(_0xb879('0xd'));var authService=require(_0xb879('0xe'));var qs=require(_0xb879('0xf'));var as=require(_0xb879('0x10'));var hardwareService=require(_0xb879('0x11'));var logger=require('../../config/logger')(_0xb879('0x12'));var utils=require(_0xb879('0x13'));var config=require(_0xb879('0x14'));var licenseUtil=require(_0xb879('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x144f39,_0x5a8485){_0x5a8485=_0x5a8485||0xcc;return function(_0x49e7e5){if(_0x49e7e5){return _0x144f39['sendStatus'](_0x5a8485);}return _0x144f39[_0xb879('0x16')](_0x5a8485)[_0xb879('0x17')]();};}function respondWithResult(_0x3bdfba,_0x503831){_0x503831=_0x503831||0xc8;return function(_0x500111){if(_0x500111){return _0x3bdfba[_0xb879('0x16')](_0x503831)['json'](_0x500111);}};}function respondWithFilteredResult(_0x147144,_0x13fd42){return function(_0x508aa7){if(_0x508aa7){var _0x13b129=typeof _0x13fd42['offset']===_0xb879('0x18')&&typeof _0x13fd42[_0xb879('0x19')]==='undefined';var _0x526e5b=_0x508aa7[_0xb879('0x1a')];var _0x588260=_0x13b129?0x0:_0x13fd42[_0xb879('0x1b')];var _0x277d82=_0x13b129?_0x508aa7[_0xb879('0x1a')]:_0x13fd42['offset']+_0x13fd42[_0xb879('0x19')];var _0x20f475;if(_0x277d82>=_0x526e5b){_0x277d82=_0x526e5b;_0x20f475=0xc8;}else{_0x20f475=0xce;}_0x147144[_0xb879('0x16')](_0x20f475);return _0x147144['set'](_0xb879('0x1c'),_0x588260+'-'+_0x277d82+'/'+_0x526e5b)['json'](_0x508aa7);}return null;};}function patchUpdates(_0x19bccd){return function(_0x54e17c){try{jsonpatch[_0xb879('0x1d')](_0x54e17c,_0x19bccd,!![]);}catch(_0x4b896d){return BPromise[_0xb879('0x1e')](_0x4b896d);}return _0x54e17c[_0xb879('0x1f')]();};}function saveUpdates(_0x1169f0,_0x29ffc9){return function(_0x38af0e){if(_0x38af0e){return _0x38af0e['update'](_0x1169f0)['then'](function(_0xf12221){return _0xf12221;});}return null;};}function removeEntity(_0x177ce6,_0x177679){return function(_0x4c409a){if(_0x4c409a){return _0x4c409a[_0xb879('0x20')]()[_0xb879('0x21')](function(){_0x177ce6[_0xb879('0x16')](0xcc)[_0xb879('0x17')]();});}};}function handleEntityNotFound(_0x5b62c5,_0x37d9b9){return function(_0xfd1bf9){if(!_0xfd1bf9){_0x5b62c5['sendStatus'](0x194);}return _0xfd1bf9;};}function handleError(_0xabc9d0,_0x200d19){_0x200d19=_0x200d19||0x1f4;return function(_0x33366f){logger[_0xb879('0x22')](_0x33366f[_0xb879('0x23')]);if(_0x33366f[_0xb879('0x24')]){delete _0x33366f[_0xb879('0x24')];}_0xabc9d0[_0xb879('0x16')](_0x200d19)[_0xb879('0x25')](_0x33366f);};}exports[_0xb879('0x26')]=function(_0x360fb2,_0x32306f){var _0x5ce102={},_0x52da81={},_0x208058={'count':0x0,'rows':[]};var _0x19c5e9=_[_0xb879('0x27')](db['SugarcrmField'][_0xb879('0x28')],function(_0x167e4c){return{'name':_0x167e4c[_0xb879('0x29')],'type':_0x167e4c[_0xb879('0x2a')][_0xb879('0x2b')]};});_0x52da81[_0xb879('0x2c')]=_[_0xb879('0x27')](_0x19c5e9,_0xb879('0x24'));_0x52da81[_0xb879('0x2d')]=_['keys'](_0x360fb2[_0xb879('0x2d')]);_0x52da81[_0xb879('0x2e')]=_[_0xb879('0x2f')](_0x52da81[_0xb879('0x2c')],_0x52da81[_0xb879('0x2d')]);_0x5ce102[_0xb879('0x30')]=_[_0xb879('0x2f')](_0x52da81['model'],qs['fields'](_0x360fb2[_0xb879('0x2d')][_0xb879('0x31')]));_0x5ce102[_0xb879('0x30')]=_0x5ce102[_0xb879('0x30')][_0xb879('0x32')]?_0x5ce102[_0xb879('0x30')]:_0x52da81['model'];if(!_0x360fb2[_0xb879('0x2d')][_0xb879('0x33')]('nolimit')){_0x5ce102[_0xb879('0x19')]=qs[_0xb879('0x19')](_0x360fb2[_0xb879('0x2d')][_0xb879('0x19')]);_0x5ce102[_0xb879('0x1b')]=qs['offset'](_0x360fb2[_0xb879('0x2d')][_0xb879('0x1b')]);}_0x5ce102[_0xb879('0x34')]=qs[_0xb879('0x35')](_0x360fb2[_0xb879('0x2d')]['sort']);_0x5ce102[_0xb879('0x36')]=qs[_0xb879('0x2e')](_['pick'](_0x360fb2[_0xb879('0x2d')],_0x52da81[_0xb879('0x2e')]),_0x19c5e9);if(_0x360fb2[_0xb879('0x2d')][_0xb879('0x37')]){_0x5ce102['where']=_[_0xb879('0x38')](_0x5ce102[_0xb879('0x36')],{'$or':_[_0xb879('0x27')](_0x19c5e9,function(_0x1cee37){if(_0x1cee37[_0xb879('0x2a')]!=='VIRTUAL'){var _0x238522={};_0x238522[_0x1cee37[_0xb879('0x24')]]={'$like':'%'+_0x360fb2['query']['filter']+'%'};return _0x238522;}})});}_0x5ce102=_['merge']({},_0x5ce102,_0x360fb2['options']);var _0x91deec={'where':_0x5ce102[_0xb879('0x36')]};return db[_0xb879('0x39')][_0xb879('0x1a')](_0x91deec)[_0xb879('0x21')](function(_0x4c97d5){_0x208058[_0xb879('0x1a')]=_0x4c97d5;if(_0x360fb2[_0xb879('0x2d')][_0xb879('0x3a')]){_0x5ce102[_0xb879('0x3b')]=[{'all':!![]}];}return db[_0xb879('0x39')][_0xb879('0x3c')](_0x5ce102);})[_0xb879('0x21')](function(_0x1b391f){_0x208058[_0xb879('0x3d')]=_0x1b391f;return _0x208058;})[_0xb879('0x21')](respondWithFilteredResult(_0x32306f,_0x5ce102))['catch'](handleError(_0x32306f,null));};exports[_0xb879('0x3e')]=function(_0x21c153,_0x33bc83){var _0x20f0e2={'raw':!![],'where':{'id':_0x21c153['params']['id']}},_0x2567e7={};_0x2567e7[_0xb879('0x2c')]=_[_0xb879('0x3f')](db[_0xb879('0x39')][_0xb879('0x28')]);_0x2567e7[_0xb879('0x2d')]=_[_0xb879('0x3f')](_0x21c153[_0xb879('0x2d')]);_0x2567e7[_0xb879('0x2e')]=_['intersection'](_0x2567e7['model'],_0x2567e7['query']);_0x20f0e2[_0xb879('0x30')]=_[_0xb879('0x2f')](_0x2567e7['model'],qs['fields'](_0x21c153[_0xb879('0x2d')][_0xb879('0x31')]));_0x20f0e2[_0xb879('0x30')]=_0x20f0e2[_0xb879('0x30')][_0xb879('0x32')]?_0x20f0e2[_0xb879('0x30')]:_0x2567e7[_0xb879('0x2c')];if(_0x21c153[_0xb879('0x2d')][_0xb879('0x3a')]){_0x20f0e2['include']=[{'all':!![]}];}_0x20f0e2=_[_0xb879('0x38')]({},_0x20f0e2,_0x21c153['options']);return db[_0xb879('0x39')][_0xb879('0x40')](_0x20f0e2)[_0xb879('0x21')](handleEntityNotFound(_0x33bc83,null))[_0xb879('0x21')](respondWithResult(_0x33bc83,null))[_0xb879('0x41')](handleError(_0x33bc83,null));};exports['create']=function(_0x47621b,_0x1e72e0){return db['SugarcrmField'][_0xb879('0x42')](_0x47621b['body'],{})['then'](respondWithResult(_0x1e72e0,0xc9))['catch'](handleError(_0x1e72e0,null));};exports['update']=function(_0x3c648e,_0x2dfb8a){if(_0x3c648e['body']['id']){delete _0x3c648e[_0xb879('0x43')]['id'];}return db['SugarcrmField'][_0xb879('0x40')]({'where':{'id':_0x3c648e['params']['id']}})[_0xb879('0x21')](handleEntityNotFound(_0x2dfb8a,null))['then'](saveUpdates(_0x3c648e[_0xb879('0x43')],null))[_0xb879('0x21')](respondWithResult(_0x2dfb8a,null))[_0xb879('0x41')](handleError(_0x2dfb8a,null));};exports[_0xb879('0x20')]=function(_0x29323f,_0x3a2f16){return db[_0xb879('0x39')][_0xb879('0x40')]({'where':{'id':_0x29323f['params']['id']}})[_0xb879('0x21')](handleEntityNotFound(_0x3a2f16,null))[_0xb879('0x21')](removeEntity(_0x3a2f16,null))[_0xb879('0x41')](handleError(_0x3a2f16,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4404533..19b799b 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 _0xbd2a=['../../config/logger','api','moment','bluebird','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util'];(function(_0x4ce7f2,_0x809306){var _0x5be312=function(_0x45183d){while(--_0x45183d){_0x4ce7f2['push'](_0x4ce7f2['shift']());}};_0x5be312(++_0x809306);}(_0xbd2a,0x8a));var _0xabd2=function(_0x13e45b,_0x46fe75){_0x13e45b=_0x13e45b-0x0;var _0x540b11=_0xbd2a[_0x13e45b];return _0x540b11;};'use strict';var _=require(_0xabd2('0x0'));var util=require(_0xabd2('0x1'));var logger=require(_0xabd2('0x2'))(_0xabd2('0x3'));var moment=require(_0xabd2('0x4'));var BPromise=require(_0xabd2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xabd2('0x6'));var attributes=require(_0xabd2('0x7'));module[_0xabd2('0x8')]=function(_0x117d1b,_0x2c8c68){return _0x117d1b[_0xabd2('0x9')](_0xabd2('0xa'),attributes,{'tableName':_0xabd2('0xb'),'paranoid':![],'indexes':[{'name':_0xabd2('0xc'),'fields':[_0xabd2('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3c7=['moment','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api'];(function(_0x3b9b2e,_0x1d3afe){var _0x3e1a74=function(_0x1d5439){while(--_0x1d5439){_0x3b9b2e['push'](_0x3b9b2e['shift']());}};_0x3e1a74(++_0x1d3afe);}(_0xe3c7,0x129));var _0x7e3c=function(_0x14d992,_0xa6ea84){_0x14d992=_0x14d992-0x0;var _0x10a29f=_0xe3c7[_0x14d992];return _0x10a29f;};'use strict';var _=require(_0x7e3c('0x0'));var util=require(_0x7e3c('0x1'));var logger=require('../../config/logger')(_0x7e3c('0x2'));var moment=require(_0x7e3c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e3c('0x4'));var rimraf=require(_0x7e3c('0x5'));var config=require(_0x7e3c('0x6'));var attributes=require(_0x7e3c('0x7'));module[_0x7e3c('0x8')]=function(_0x20b5cf,_0x2e0c28){return _0x20b5cf[_0x7e3c('0x9')](_0x7e3c('0xa'),attributes,{'tableName':_0x7e3c('0xb'),'paranoid':![],'indexes':[{'name':_0x7e3c('0xc'),'fields':[_0x7e3c('0xd'),_0x7e3c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 55113ac..a234c1d 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 _0xcde5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util'];(function(_0x3b5141,_0x3ae9aa){var _0x2aeb4b=function(_0x3d9324){while(--_0x3d9324){_0x3b5141['push'](_0x3b5141['shift']());}};_0x2aeb4b(++_0x3ae9aa);}(_0xcde5,0x7c));var _0x5cde=function(_0x712cad,_0x37fe35){_0x712cad=_0x712cad-0x0;var _0x60d202=_0xcde5[_0x712cad];return _0x60d202;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var moment=require(_0x5cde('0x2'));var BPromise=require(_0x5cde('0x3'));var rs=require(_0x5cde('0x4'));var fs=require('fs');var Redis=require(_0x5cde('0x5'));var db=require(_0x5cde('0x6'))['db'];var utils=require(_0x5cde('0x7'));var logger=require(_0x5cde('0x8'))(_0x5cde('0x9'));var config=require(_0x5cde('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5cde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x113a61,_0x345903,_0x478250){return new BPromise(function(_0x284995,_0x44919b){return client[_0x5cde('0xc')](_0x113a61,_0x478250)[_0x5cde('0xd')](function(_0xb9cfb4){logger[_0x5cde('0xe')](_0x5cde('0xf'),_0x345903,_0x5cde('0x10'));logger[_0x5cde('0x11')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x345903,'request\x20sent',JSON['stringify'](_0xb9cfb4));if(_0xb9cfb4['error']){if(_0xb9cfb4[_0x5cde('0x12')]['code']===0x1f4){logger[_0x5cde('0x12')](_0x5cde('0xf'),_0x345903,_0xb9cfb4[_0x5cde('0x12')][_0x5cde('0x13')]);return _0x44919b(_0xb9cfb4['error']['message']);}logger[_0x5cde('0x12')](_0x5cde('0xf'),_0x345903,_0xb9cfb4[_0x5cde('0x12')][_0x5cde('0x13')]);return _0x284995(_0xb9cfb4[_0x5cde('0x12')][_0x5cde('0x13')]);}else{logger[_0x5cde('0xe')](_0x5cde('0xf'),_0x345903,'request\x20sent');_0x284995(_0xb9cfb4[_0x5cde('0x14')][_0x5cde('0x13')]);}})['catch'](function(_0x5c4404){logger[_0x5cde('0x12')](_0x5cde('0xf'),_0x345903,_0x5c4404);_0x44919b(_0x5c4404);});});} \ No newline at end of file +var _0xa9ba=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client'];(function(_0x112b9a,_0x16137e){var _0x499107=function(_0x32e9cc){while(--_0x32e9cc){_0x112b9a['push'](_0x112b9a['shift']());}};_0x499107(++_0x16137e);}(_0xa9ba,0x1d3));var _0xaa9b=function(_0x1f93a3,_0x29e848){_0x1f93a3=_0x1f93a3-0x0;var _0x489264=_0xa9ba[_0x1f93a3];return _0x489264;};'use strict';var _=require(_0xaa9b('0x0'));var util=require(_0xaa9b('0x1'));var moment=require(_0xaa9b('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa9b('0x3'));var fs=require('fs');var Redis=require(_0xaa9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa9b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xaa9b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaa9b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd1f3,_0x5a0ea9,_0x53d4c2){return new BPromise(function(_0x171735,_0x2fb9d5){return client[_0xaa9b('0x8')](_0x3cd1f3,_0x53d4c2)[_0xaa9b('0x9')](function(_0x225454){logger[_0xaa9b('0xa')](_0xaa9b('0xb'),_0x5a0ea9,_0xaa9b('0xc'));logger[_0xaa9b('0xd')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x5a0ea9,_0xaa9b('0xc'),JSON[_0xaa9b('0xe')](_0x225454));if(_0x225454[_0xaa9b('0xf')]){if(_0x225454[_0xaa9b('0xf')]['code']===0x1f4){logger[_0xaa9b('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x5a0ea9,_0x225454['error'][_0xaa9b('0x10')]);return _0x2fb9d5(_0x225454['error'][_0xaa9b('0x10')]);}logger['error'](_0xaa9b('0xb'),_0x5a0ea9,_0x225454[_0xaa9b('0xf')][_0xaa9b('0x10')]);return _0x171735(_0x225454[_0xaa9b('0xf')][_0xaa9b('0x10')]);}else{logger[_0xaa9b('0xa')](_0xaa9b('0xb'),_0x5a0ea9,_0xaa9b('0xc'));_0x171735(_0x225454[_0xaa9b('0x11')][_0xaa9b('0x10')]);}})[_0xaa9b('0x12')](function(_0x7f63c8){logger[_0xaa9b('0xf')](_0xaa9b('0xb'),_0x5a0ea9,_0x7f63c8);_0x2fb9d5(_0x7f63c8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 719ad74..0af8451 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 _0xa37e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','show','/:id/configurations','isAuthenticated','/:id/fields','create','post','addConfiguration','put','update','/:id','destroy','path'];(function(_0xf1226a,_0x29a250){var _0x1b8fe7=function(_0x7178a5){while(--_0x7178a5){_0xf1226a['push'](_0xf1226a['shift']());}};_0x1b8fe7(++_0x29a250);}(_0xa37e,0x97));var _0xea37=function(_0x2f6f71,_0x303573){_0x2f6f71=_0x2f6f71-0x0;var _0x55bf4a=_0xa37e[_0x2f6f71];return _0x55bf4a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea37('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xea37('0x5'));var controller=require(_0xea37('0x6'));router[_0xea37('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xea37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xea37('0x8')]);router[_0xea37('0x7')](_0xea37('0x9'),auth[_0xea37('0xa')](),controller['getConfigurations']);router[_0xea37('0x7')](_0xea37('0xb'),auth[_0xea37('0xa')](),controller['getFields']);router['post']('/',auth[_0xea37('0xa')](),controller[_0xea37('0xc')]);router[_0xea37('0xd')]('/:id/configurations',auth[_0xea37('0xa')](),controller[_0xea37('0xe')]);router[_0xea37('0xf')]('/:id',auth[_0xea37('0xa')](),controller[_0xea37('0x10')]);router['delete'](_0xea37('0x11'),auth['isAuthenticated'](),controller[_0xea37('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3098=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x3098,0x86));var _0x8309=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x3098[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var path=require(_0x8309('0x2'));var timeout=require(_0x8309('0x3'));var express=require('express');var router=express[_0x8309('0x4')]();var fs_extra=require(_0x8309('0x5'));var auth=require(_0x8309('0x6'));var interaction=require(_0x8309('0x7'));var config=require(_0x8309('0x8'));var controller=require(_0x8309('0x9'));router[_0x8309('0xa')]('/',auth[_0x8309('0xb')](),controller[_0x8309('0xc')]);router[_0x8309('0xa')]('/:id',auth[_0x8309('0xb')](),controller['show']);router[_0x8309('0xa')](_0x8309('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x8309('0xa')](_0x8309('0xe'),auth[_0x8309('0xb')](),controller[_0x8309('0xf')]);router[_0x8309('0x10')]('/',auth['isAuthenticated'](),controller[_0x8309('0x11')]);router[_0x8309('0x10')](_0x8309('0xd'),auth[_0x8309('0xb')](),controller[_0x8309('0x12')]);router['put'](_0x8309('0x13'),auth['isAuthenticated'](),controller[_0x8309('0x14')]);router['delete'](_0x8309('0x13'),auth[_0x8309('0xb')](),controller[_0x8309('0x15')]);module[_0x8309('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index bfddc3d..4f8ebe2 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 _0x657f=['STRING','sequelize','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x657f,0xb8));var _0xf657=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x657f[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xf657('0x0'));module[_0xf657('0x1')]={'name':{'type':Sequelize[_0xf657('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf657('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf657('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x951b=['STRING','sequelize'];(function(_0x552c27,_0x478dc2){var _0x2a0922=function(_0x22617c){while(--_0x22617c){_0x552c27['push'](_0x552c27['shift']());}};_0x2a0922(++_0x478dc2);}(_0x951b,0x187));var _0xb951=function(_0x5c035e,_0x3f08ff){_0x5c035e=_0x5c035e-0x0;var _0x34fedc=_0x951b[_0x5c035e];return _0x34fedc;};'use strict';var Sequelize=require(_0xb951('0x0'));module['exports']={'name':{'type':Sequelize[_0xb951('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb951('0x1')]},'username':{'type':Sequelize[_0xb951('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb951('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb951('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xb951('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 0304572..46589ee 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 _0x33f5=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','catch','show','params','merge','options','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','success','token','describe','result','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','statusCode','stringify','test','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName'];(function(_0x53fd32,_0x3ad1de){var _0x20514b=function(_0x333efe){while(--_0x333efe){_0x53fd32['push'](_0x53fd32['shift']());}};_0x20514b(++_0x3ad1de);}(_0x33f5,0x1b8));var _0x533f=function(_0x3684bd,_0x9f1f47){_0x3684bd=_0x3684bd-0x0;var _0x23b4de=_0x33f5[_0x3684bd];return _0x23b4de;};'use strict';var emlformat=require(_0x533f('0x0'));var rimraf=require(_0x533f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x533f('0x2'));var rp=require(_0x533f('0x3'));var moment=require(_0x533f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x533f('0x5'));var util=require(_0x533f('0x6'));var path=require(_0x533f('0x7'));var sox=require(_0x533f('0x8'));var csv=require(_0x533f('0x9'));var ejs=require(_0x533f('0xa'));var fs=require('fs');var fs_extra=require(_0x533f('0xb'));var _=require(_0x533f('0xc'));var squel=require(_0x533f('0xd'));var crypto=require(_0x533f('0xe'));var jsforce=require(_0x533f('0xf'));var deskjs=require(_0x533f('0x10'));var toCsv=require(_0x533f('0x9'));var querystring=require(_0x533f('0x11'));var Papa=require(_0x533f('0x12'));var Redis=require('ioredis');var authService=require(_0x533f('0x13'));var qs=require(_0x533f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x533f('0x15'));var utils=require(_0x533f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x533f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x533f('0x18'));function respondWithStatusCode(_0x203f96,_0x1eb97f){_0x1eb97f=_0x1eb97f||0xcc;return function(_0x261d99){if(_0x261d99){return _0x203f96[_0x533f('0x19')](_0x1eb97f);}return _0x203f96[_0x533f('0x1a')](_0x1eb97f)[_0x533f('0x1b')]();};}function respondWithResult(_0x4eee23,_0x4f2c34){_0x4f2c34=_0x4f2c34||0xc8;return function(_0x525e6b){if(_0x525e6b){return _0x4eee23[_0x533f('0x1a')](_0x4f2c34)[_0x533f('0x1c')](_0x525e6b);}};}function respondWithFilteredResult(_0x1b9dde,_0x4dfecd){return function(_0x2e5cff){if(_0x2e5cff){var _0x3fb71e=typeof _0x4dfecd[_0x533f('0x1d')]==='undefined'&&typeof _0x4dfecd[_0x533f('0x1e')]===_0x533f('0x1f');var _0x1b2d99=_0x2e5cff[_0x533f('0x20')];var _0x8ca430=_0x3fb71e?0x0:_0x4dfecd['offset'];var _0x49ade9=_0x3fb71e?_0x2e5cff['count']:_0x4dfecd[_0x533f('0x1d')]+_0x4dfecd['limit'];var _0x38f0a9;if(_0x49ade9>=_0x1b2d99){_0x49ade9=_0x1b2d99;_0x38f0a9=0xc8;}else{_0x38f0a9=0xce;}_0x1b9dde['status'](_0x38f0a9);return _0x1b9dde['set'](_0x533f('0x21'),_0x8ca430+'-'+_0x49ade9+'/'+_0x1b2d99)[_0x533f('0x1c')](_0x2e5cff);}return null;};}function patchUpdates(_0x1aee7d){return function(_0x45b1a7){try{jsonpatch[_0x533f('0x22')](_0x45b1a7,_0x1aee7d,!![]);}catch(_0x156de1){return BPromise[_0x533f('0x23')](_0x156de1);}return _0x45b1a7['save']();};}function saveUpdates(_0x2de428,_0x2dc653){return function(_0x258ca7){if(_0x258ca7){return _0x258ca7[_0x533f('0x24')](_0x2de428)[_0x533f('0x25')](function(_0x1d4b42){return _0x1d4b42;});}return null;};}function removeEntity(_0x362f17,_0x13ae58){return function(_0x24dbfb){if(_0x24dbfb){return _0x24dbfb[_0x533f('0x26')]()[_0x533f('0x25')](function(){_0x362f17[_0x533f('0x1a')](0xcc)[_0x533f('0x1b')]();});}};}function handleEntityNotFound(_0x2b5355,_0x3491b0){return function(_0x1b2b8f){if(!_0x1b2b8f){_0x2b5355[_0x533f('0x19')](0x194);}return _0x1b2b8f;};}function handleError(_0x50f8b2,_0xa262db){_0xa262db=_0xa262db||0x1f4;return function(_0x5a0bc5){logger[_0x533f('0x27')](_0x5a0bc5[_0x533f('0x28')]);if(_0x5a0bc5[_0x533f('0x29')]){delete _0x5a0bc5['name'];}_0x50f8b2[_0x533f('0x1a')](_0xa262db)[_0x533f('0x2a')](_0x5a0bc5);};}exports[_0x533f('0x2b')]=function(_0x296c6b,_0x5cc325){var _0x2bb7e4={},_0x1456b3={},_0x80c414={'count':0x0,'rows':[]};var _0x529177=_[_0x533f('0x2c')](db[_0x533f('0x2d')][_0x533f('0x2e')],function(_0x2ed15c){return{'name':_0x2ed15c[_0x533f('0x2f')],'type':_0x2ed15c['type'][_0x533f('0x30')]};});_0x1456b3[_0x533f('0x31')]=_['map'](_0x529177,_0x533f('0x29'));_0x1456b3['query']=_[_0x533f('0x32')](_0x296c6b[_0x533f('0x33')]);_0x1456b3[_0x533f('0x34')]=_[_0x533f('0x35')](_0x1456b3[_0x533f('0x31')],_0x1456b3[_0x533f('0x33')]);_0x2bb7e4[_0x533f('0x36')]=_[_0x533f('0x35')](_0x1456b3['model'],qs[_0x533f('0x37')](_0x296c6b[_0x533f('0x33')]['fields']));_0x2bb7e4['attributes']=_0x2bb7e4[_0x533f('0x36')][_0x533f('0x38')]?_0x2bb7e4[_0x533f('0x36')]:_0x1456b3[_0x533f('0x31')];if(!_0x296c6b[_0x533f('0x33')][_0x533f('0x39')](_0x533f('0x3a'))){_0x2bb7e4[_0x533f('0x1e')]=qs[_0x533f('0x1e')](_0x296c6b[_0x533f('0x33')]['limit']);_0x2bb7e4[_0x533f('0x1d')]=qs[_0x533f('0x1d')](_0x296c6b[_0x533f('0x33')][_0x533f('0x1d')]);}_0x2bb7e4[_0x533f('0x3b')]=qs[_0x533f('0x3c')](_0x296c6b[_0x533f('0x33')][_0x533f('0x3c')]);_0x2bb7e4[_0x533f('0x3d')]=qs['filters'](_[_0x533f('0x3e')](_0x296c6b[_0x533f('0x33')],_0x1456b3[_0x533f('0x34')]),_0x529177);if(_0x296c6b[_0x533f('0x33')]['filter']){_0x2bb7e4[_0x533f('0x3d')]=_['merge'](_0x2bb7e4[_0x533f('0x3d')],{'$or':_[_0x533f('0x2c')](_0x529177,function(_0x5ad575){if(_0x5ad575['type']!==_0x533f('0x3f')){var _0xd4c760={};_0xd4c760[_0x5ad575[_0x533f('0x29')]]={'$like':'%'+_0x296c6b[_0x533f('0x33')][_0x533f('0x40')]+'%'};return _0xd4c760;}})});}_0x2bb7e4=_['merge']({},_0x2bb7e4,_0x296c6b['options']);var _0x9f4c4a={'where':_0x2bb7e4[_0x533f('0x3d')]};return db[_0x533f('0x2d')][_0x533f('0x20')](_0x9f4c4a)[_0x533f('0x25')](function(_0x5ace43){_0x80c414[_0x533f('0x20')]=_0x5ace43;if(_0x296c6b[_0x533f('0x33')][_0x533f('0x41')]){_0x2bb7e4[_0x533f('0x42')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x2bb7e4);})[_0x533f('0x25')](function(_0x311d1c){_0x80c414['rows']=_0x311d1c;return _0x80c414;})[_0x533f('0x25')](respondWithFilteredResult(_0x5cc325,_0x2bb7e4))[_0x533f('0x43')](handleError(_0x5cc325,null));};exports[_0x533f('0x44')]=function(_0x1fa800,_0x2ca6fa){var _0x5a3883={'raw':![],'where':{'id':_0x1fa800[_0x533f('0x45')]['id']}},_0x2c2ec3={};_0x2c2ec3[_0x533f('0x31')]=_[_0x533f('0x32')](db['VtigerAccount']['rawAttributes']);_0x2c2ec3[_0x533f('0x33')]=_[_0x533f('0x32')](_0x1fa800['query']);_0x2c2ec3['filters']=_[_0x533f('0x35')](_0x2c2ec3[_0x533f('0x31')],_0x2c2ec3['query']);_0x5a3883[_0x533f('0x36')]=_[_0x533f('0x35')](_0x2c2ec3['model'],qs[_0x533f('0x37')](_0x1fa800[_0x533f('0x33')][_0x533f('0x37')]));_0x5a3883[_0x533f('0x36')]=_0x5a3883[_0x533f('0x36')][_0x533f('0x38')]?_0x5a3883[_0x533f('0x36')]:_0x2c2ec3[_0x533f('0x31')];if(_0x1fa800[_0x533f('0x33')][_0x533f('0x41')]){_0x5a3883['include']=[{'all':!![]}];}_0x5a3883=_[_0x533f('0x46')]({},_0x5a3883,_0x1fa800[_0x533f('0x47')]);return db[_0x533f('0x2d')][_0x533f('0x48')](_0x5a3883)[_0x533f('0x25')](handleEntityNotFound(_0x2ca6fa,null))[_0x533f('0x25')](respondWithResult(_0x2ca6fa,null))['catch'](handleError(_0x2ca6fa,null));};exports[_0x533f('0x49')]=function(_0x23b6cf,_0x840aaa){return db['VtigerAccount'][_0x533f('0x49')](_0x23b6cf[_0x533f('0x4a')],{})['then'](respondWithResult(_0x840aaa,0xc9))[_0x533f('0x43')](handleError(_0x840aaa,null));};exports[_0x533f('0x24')]=function(_0x3b7575,_0xa8671e){if(_0x3b7575[_0x533f('0x4a')]['id']){delete _0x3b7575[_0x533f('0x4a')]['id'];}return db['VtigerAccount'][_0x533f('0x48')]({'where':{'id':_0x3b7575[_0x533f('0x45')]['id']}})[_0x533f('0x25')](handleEntityNotFound(_0xa8671e,null))[_0x533f('0x25')](saveUpdates(_0x3b7575[_0x533f('0x4a')],null))[_0x533f('0x25')](respondWithResult(_0xa8671e,null))[_0x533f('0x43')](handleError(_0xa8671e,null));};exports[_0x533f('0x26')]=function(_0x58b163,_0x3d3a24){return db['VtigerAccount'][_0x533f('0x48')]({'where':{'id':_0x58b163[_0x533f('0x45')]['id']}})[_0x533f('0x25')](handleEntityNotFound(_0x3d3a24,null))[_0x533f('0x25')](removeEntity(_0x3d3a24,null))[_0x533f('0x43')](handleError(_0x3d3a24,null));};exports['getConfigurations']=function(_0x3bc0be,_0x356a06,_0x317fa2){var _0x25cd95={};var _0x1ce9cd={};var _0x5284e9;var _0x2f5817;return db[_0x533f('0x2d')]['findOne']({'where':{'id':_0x3bc0be[_0x533f('0x45')]['id']}})[_0x533f('0x25')](handleEntityNotFound(_0x356a06,null))[_0x533f('0x25')](function(_0x59f628){if(_0x59f628){_0x5284e9=_0x59f628;_0x1ce9cd[_0x533f('0x31')]=_[_0x533f('0x32')](db['VtigerConfiguration'][_0x533f('0x2e')]);_0x1ce9cd[_0x533f('0x33')]=_[_0x533f('0x32')](_0x3bc0be[_0x533f('0x33')]);_0x1ce9cd[_0x533f('0x34')]=_[_0x533f('0x35')](_0x1ce9cd[_0x533f('0x31')],_0x1ce9cd[_0x533f('0x33')]);_0x25cd95[_0x533f('0x36')]=_[_0x533f('0x35')](_0x1ce9cd[_0x533f('0x31')],qs[_0x533f('0x37')](_0x3bc0be[_0x533f('0x33')]['fields']));_0x25cd95['attributes']=_0x25cd95[_0x533f('0x36')][_0x533f('0x38')]?_0x25cd95[_0x533f('0x36')]:_0x1ce9cd[_0x533f('0x31')];_0x25cd95[_0x533f('0x3b')]=qs['sort'](_0x3bc0be[_0x533f('0x33')][_0x533f('0x3c')]);_0x25cd95['where']=qs[_0x533f('0x34')](_[_0x533f('0x3e')](_0x3bc0be[_0x533f('0x33')],_0x1ce9cd[_0x533f('0x34')]));if(_0x3bc0be[_0x533f('0x33')][_0x533f('0x40')]){_0x25cd95[_0x533f('0x3d')]=_[_0x533f('0x46')](_0x25cd95[_0x533f('0x3d')],{'$or':_['map'](_0x25cd95[_0x533f('0x36')],function(_0x2ea4a5){var _0x1eb4b8={};_0x1eb4b8[_0x2ea4a5]={'$like':'%'+_0x3bc0be['query'][_0x533f('0x40')]+'%'};return _0x1eb4b8;})});}_0x25cd95=_[_0x533f('0x46')]({},_0x25cd95,_0x3bc0be[_0x533f('0x47')]);return _0x5284e9['getConfigurations'](_0x25cd95);}})['then'](function(_0x12a091){if(_0x12a091){_0x2f5817=_0x12a091[_0x533f('0x38')];if(!_0x3bc0be[_0x533f('0x33')]['hasOwnProperty']('nolimit')){_0x25cd95['limit']=qs[_0x533f('0x1e')](_0x3bc0be[_0x533f('0x33')][_0x533f('0x1e')]);_0x25cd95['offset']=qs['offset'](_0x3bc0be[_0x533f('0x33')]['offset']);}return _0x5284e9[_0x533f('0x4b')](_0x25cd95);}})[_0x533f('0x25')](function(_0x3a934c){if(_0x3a934c){return _0x3a934c?{'count':_0x2f5817,'rows':_0x3a934c}:null;}})[_0x533f('0x25')](respondWithResult(_0x356a06,null))[_0x533f('0x43')](handleError(_0x356a06,null));};exports[_0x533f('0x4c')]=function(_0x3106cb,_0x5df70d,_0x8250a0){if(_0x3106cb[_0x533f('0x4a')]['id']){delete _0x3106cb[_0x533f('0x4a')]['id'];}return db[_0x533f('0x2d')][_0x533f('0x4d')]({'where':{'id':_0x3106cb[_0x533f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5df70d,null))[_0x533f('0x25')](function(_0x320fd4){if(_0x320fd4){_0x3106cb[_0x533f('0x4a')][_0x533f('0x4e')]=_0x320fd4['id'];_0x3106cb[_0x533f('0x4a')]['Subjects']=integrations[_0x533f('0x4f')](_0x3106cb[_0x533f('0x4a')][_0x533f('0x50')],_0x3106cb[_0x533f('0x4a')][_0x533f('0x51')]);_0x3106cb[_0x533f('0x4a')][_0x533f('0x52')]=integrations[_0x533f('0x53')](_0x3106cb['body'][_0x533f('0x50')],_0x3106cb[_0x533f('0x4a')]['type']);return db[_0x533f('0x54')][_0x533f('0x49')](_0x3106cb['body'],{'include':[{'model':db[_0x533f('0x55')],'as':_0x533f('0x56')},{'model':db[_0x533f('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5df70d,null))[_0x533f('0x43')](handleError(_0x5df70d,null));};var md5=require(_0x533f('0x57'));exports[_0x533f('0x58')]=function(_0x36dfb1,_0x15c60c,_0x524727){var _0xd3b5db=null;var _0xc37763=null;var _0x37e7bc=null;var _0x15c16e=null;var _0x2765c1='';return db[_0x533f('0x2d')]['findOne']({'where':{'id':_0x36dfb1[_0x533f('0x45')]['id']},'attributes':['id',_0x533f('0x29'),_0x533f('0x59'),_0x533f('0x5a'),_0x533f('0x5b'),_0x533f('0x5c'),_0x533f('0x5d'),_0x533f('0x5e')]})[_0x533f('0x25')](handleEntityNotFound(_0x15c60c,null))['then'](function(_0x35485f){if(_0x35485f){_0xd3b5db=_0x35485f['username'];_0xc37763=_0x35485f[_0x533f('0x5e')];_0x37e7bc=_0x35485f[_0x533f('0x5b')];_0x2765c1=_0x35485f[_0x533f('0x5c')];var _0x356d90=_0x2765c1[_0x533f('0x5f')](-0x1);if(_0x356d90==='/'){_0x2765c1=_0x2765c1[_0x533f('0x60')](0x0,_0x2765c1[_0x533f('0x61')](_0x356d90));}_0x15c16e=util[_0x533f('0x62')]('%s/webservice.php',_0x2765c1);var _0x406f87={'method':_0x533f('0x63'),'uri':_0x15c16e,'qs':{'operation':_0x533f('0x64'),'username':_0x35485f['username']},'json':!![]};return rp(_0x406f87);}})[_0x533f('0x25')](function(_0x27fb7c){if(_0x27fb7c[_0x533f('0x65')]){var _0x1a43b4={'method':'POST','uri':_0x15c16e,'form':{'operation':'login','username':_0xd3b5db,'accessKey':md5(_0x27fb7c['result'][_0x533f('0x66')]+_0xc37763)},'json':!![]};return rp(_0x1a43b4);}})[_0x533f('0x25')](function(_0x1a5489){if(_0x1a5489['success']){var _0x19de03={'method':_0x533f('0x63'),'uri':_0x15c16e,'qs':{'operation':_0x533f('0x67'),'username':_0xd3b5db,'sessionName':_0x1a5489[_0x533f('0x68')][_0x533f('0x69')],'elementType':_0x37e7bc},'json':!![]};return rp(_0x19de03);}})['then'](function(_0x138e6b){if(_0x138e6b['success']){var _0x5f0a15=[_0x533f('0x6a'),_0x533f('0x6b'),_0x533f('0x6c')];_[_0x533f('0x6d')](_0x138e6b['result'][_0x533f('0x37')],function(_0x239c8c){return _0x5f0a15[_0x533f('0x6e')](_0x239c8c['type'][_0x533f('0x29')]);});_[_0x533f('0x6d')](_0x138e6b[_0x533f('0x68')][_0x533f('0x37')],function(_0x32577d){return _0x32577d['editable']===_0x533f('0x6f');});return{'count':_0x138e6b[_0x533f('0x68')]['fields']['length'],'rows':_[_0x533f('0x2c')](_0x138e6b['result'][_0x533f('0x37')],function(_0x40daca){return{'id':_0x40daca[_0x533f('0x29')],'name':_0x40daca[_0x533f('0x70')],'custom':_[_0x533f('0x71')](_0x40daca['name'],_0x533f('0x72'))?!![]:![],'options':_0x40daca[_0x533f('0x51')][_0x533f('0x29')]===_0x533f('0x73')&&_0x40daca['type'][_0x533f('0x74')][_0x533f('0x38')]>0x0?_[_0x533f('0x2c')](_0x40daca['type'][_0x533f('0x74')],function(_0x1e1692){return{'name':_0x1e1692[_0x533f('0x70')],'value':_0x1e1692['value']};}):[]};})};}})[_0x533f('0x25')](respondWithResult(_0x15c60c,null))[_0x533f('0x43')](function(_0x5bd8ed){console[_0x533f('0x75')](_0x533f('0x76')+_0x5bd8ed);var _0x293196=_0x36dfb1['query']['test']?0x1f4:_0x5bd8ed[_0x533f('0x77')]||0x1f4;logger[_0x533f('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x533f('0x58'),_0x293196,JSON[_0x533f('0x78')](_0x5bd8ed));delete _0x5bd8ed[_0x533f('0x29')];if(_0x293196===0x191){_0x293196=0x190;}_0x15c60c[_0x533f('0x1a')](_0x293196)[_0x533f('0x2a')](_0x36dfb1['query'][_0x533f('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x5bd8ed[_0x533f('0x77')]}:_0x5bd8ed);});}; \ No newline at end of file +var _0x9a03=['VtigerConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','getchallenge','success','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','log','vTiger\x20error:\x20','statusCode','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','include','rows','params','length','includeAll','catch','create','body','find','getConfigurations','findOne'];(function(_0x3764a8,_0x118f65){var _0xfd5cd7=function(_0x556579){while(--_0x556579){_0x3764a8['push'](_0x3764a8['shift']());}};_0xfd5cd7(++_0x118f65);}(_0x9a03,0x10e));var _0x39a0=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x9a03[_0xd0a847];return _0x2536ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39a0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39a0('0x1'));var rp=require(_0x39a0('0x2'));var moment=require('moment');var BPromise=require(_0x39a0('0x3'));var Mustache=require(_0x39a0('0x4'));var util=require('util');var path=require(_0x39a0('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x39a0('0x6'));var fs=require('fs');var fs_extra=require(_0x39a0('0x7'));var _=require('lodash');var squel=require(_0x39a0('0x8'));var crypto=require(_0x39a0('0x9'));var jsforce=require(_0x39a0('0xa'));var deskjs=require(_0x39a0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x39a0('0xc'));var Papa=require(_0x39a0('0xd'));var Redis=require(_0x39a0('0xe'));var authService=require(_0x39a0('0xf'));var qs=require(_0x39a0('0x10'));var as=require(_0x39a0('0x11'));var hardwareService=require(_0x39a0('0x12'));var logger=require(_0x39a0('0x13'))(_0x39a0('0x14'));var utils=require(_0x39a0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x39a0('0x16'));var db=require(_0x39a0('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3de52b,_0x112d77){_0x112d77=_0x112d77||0xcc;return function(_0xaef97){if(_0xaef97){return _0x3de52b['sendStatus'](_0x112d77);}return _0x3de52b[_0x39a0('0x18')](_0x112d77)['end']();};}function respondWithResult(_0x2c35c3,_0x304b37){_0x304b37=_0x304b37||0xc8;return function(_0x383507){if(_0x383507){return _0x2c35c3[_0x39a0('0x18')](_0x304b37)['json'](_0x383507);}};}function respondWithFilteredResult(_0x35e766,_0x403814){return function(_0x49bdd3){if(_0x49bdd3){var _0x590ec2=typeof _0x403814[_0x39a0('0x19')]===_0x39a0('0x1a')&&typeof _0x403814[_0x39a0('0x1b')]==='undefined';var _0x137d60=_0x49bdd3['count'];var _0x3f9cf0=_0x590ec2?0x0:_0x403814[_0x39a0('0x19')];var _0x3ae079=_0x590ec2?_0x49bdd3[_0x39a0('0x1c')]:_0x403814[_0x39a0('0x19')]+_0x403814[_0x39a0('0x1b')];var _0x5cca01;if(_0x3ae079>=_0x137d60){_0x3ae079=_0x137d60;_0x5cca01=0xc8;}else{_0x5cca01=0xce;}_0x35e766[_0x39a0('0x18')](_0x5cca01);return _0x35e766[_0x39a0('0x1d')](_0x39a0('0x1e'),_0x3f9cf0+'-'+_0x3ae079+'/'+_0x137d60)[_0x39a0('0x1f')](_0x49bdd3);}return null;};}function patchUpdates(_0xaccd4f){return function(_0x27fb3b){try{jsonpatch[_0x39a0('0x20')](_0x27fb3b,_0xaccd4f,!![]);}catch(_0x3eddd2){return BPromise[_0x39a0('0x21')](_0x3eddd2);}return _0x27fb3b[_0x39a0('0x22')]();};}function saveUpdates(_0x2cec6f,_0xf60369){return function(_0xfa5809){if(_0xfa5809){return _0xfa5809[_0x39a0('0x23')](_0x2cec6f)['then'](function(_0x5dc9f6){return _0x5dc9f6;});}return null;};}function removeEntity(_0x5141e4,_0x27a239){return function(_0x2f6b51){if(_0x2f6b51){return _0x2f6b51[_0x39a0('0x24')]()[_0x39a0('0x25')](function(){_0x5141e4[_0x39a0('0x18')](0xcc)[_0x39a0('0x26')]();});}};}function handleEntityNotFound(_0x4d449a,_0x4f1344){return function(_0x5e0466){if(!_0x5e0466){_0x4d449a[_0x39a0('0x27')](0x194);}return _0x5e0466;};}function handleError(_0x44de2c,_0x169d32){_0x169d32=_0x169d32||0x1f4;return function(_0x5c5a4f){logger[_0x39a0('0x28')](_0x5c5a4f[_0x39a0('0x29')]);if(_0x5c5a4f['name']){delete _0x5c5a4f[_0x39a0('0x2a')];}_0x44de2c['status'](_0x169d32)[_0x39a0('0x2b')](_0x5c5a4f);};}exports[_0x39a0('0x2c')]=function(_0x1d80ea,_0x23028c){var _0x3211f7={},_0x30718e={},_0x4a613c={'count':0x0,'rows':[]};var _0xcdfd5d=_[_0x39a0('0x2d')](db[_0x39a0('0x2e')][_0x39a0('0x2f')],function(_0x4cb0d1){return{'name':_0x4cb0d1[_0x39a0('0x30')],'type':_0x4cb0d1[_0x39a0('0x31')][_0x39a0('0x32')]};});_0x30718e[_0x39a0('0x33')]=_[_0x39a0('0x2d')](_0xcdfd5d,_0x39a0('0x2a'));_0x30718e[_0x39a0('0x34')]=_[_0x39a0('0x35')](_0x1d80ea['query']);_0x30718e['filters']=_[_0x39a0('0x36')](_0x30718e[_0x39a0('0x33')],_0x30718e[_0x39a0('0x34')]);_0x3211f7['attributes']=_['intersection'](_0x30718e['model'],qs[_0x39a0('0x37')](_0x1d80ea['query'][_0x39a0('0x37')]));_0x3211f7[_0x39a0('0x38')]=_0x3211f7[_0x39a0('0x38')]['length']?_0x3211f7['attributes']:_0x30718e[_0x39a0('0x33')];if(!_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x39')](_0x39a0('0x3a'))){_0x3211f7['limit']=qs[_0x39a0('0x1b')](_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x1b')]);_0x3211f7[_0x39a0('0x19')]=qs[_0x39a0('0x19')](_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x19')]);}_0x3211f7[_0x39a0('0x3b')]=qs[_0x39a0('0x3c')](_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x3c')]);_0x3211f7['where']=qs[_0x39a0('0x3d')](_[_0x39a0('0x3e')](_0x1d80ea[_0x39a0('0x34')],_0x30718e[_0x39a0('0x3d')]),_0xcdfd5d);if(_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x3f')]){_0x3211f7[_0x39a0('0x40')]=_[_0x39a0('0x41')](_0x3211f7[_0x39a0('0x40')],{'$or':_[_0x39a0('0x2d')](_0xcdfd5d,function(_0x5894bf){if(_0x5894bf[_0x39a0('0x31')]!=='VIRTUAL'){var _0x5d350f={};_0x5d350f[_0x5894bf[_0x39a0('0x2a')]]={'$like':'%'+_0x1d80ea[_0x39a0('0x34')][_0x39a0('0x3f')]+'%'};return _0x5d350f;}})});}_0x3211f7=_[_0x39a0('0x41')]({},_0x3211f7,_0x1d80ea[_0x39a0('0x42')]);var _0x4ac4ed={'where':_0x3211f7['where']};return db[_0x39a0('0x2e')][_0x39a0('0x1c')](_0x4ac4ed)['then'](function(_0x53c813){_0x4a613c[_0x39a0('0x1c')]=_0x53c813;if(_0x1d80ea[_0x39a0('0x34')]['includeAll']){_0x3211f7[_0x39a0('0x43')]=[{'all':!![]}];}return db[_0x39a0('0x2e')]['findAll'](_0x3211f7);})['then'](function(_0xaac3d9){_0x4a613c[_0x39a0('0x44')]=_0xaac3d9;return _0x4a613c;})['then'](respondWithFilteredResult(_0x23028c,_0x3211f7))['catch'](handleError(_0x23028c,null));};exports['show']=function(_0x174fd0,_0x47930c){var _0x7814fb={'raw':![],'where':{'id':_0x174fd0[_0x39a0('0x45')]['id']}},_0x583e88={};_0x583e88['model']=_[_0x39a0('0x35')](db['VtigerAccount']['rawAttributes']);_0x583e88[_0x39a0('0x34')]=_['keys'](_0x174fd0['query']);_0x583e88['filters']=_[_0x39a0('0x36')](_0x583e88[_0x39a0('0x33')],_0x583e88[_0x39a0('0x34')]);_0x7814fb[_0x39a0('0x38')]=_[_0x39a0('0x36')](_0x583e88[_0x39a0('0x33')],qs[_0x39a0('0x37')](_0x174fd0[_0x39a0('0x34')][_0x39a0('0x37')]));_0x7814fb['attributes']=_0x7814fb[_0x39a0('0x38')][_0x39a0('0x46')]?_0x7814fb[_0x39a0('0x38')]:_0x583e88[_0x39a0('0x33')];if(_0x174fd0[_0x39a0('0x34')][_0x39a0('0x47')]){_0x7814fb[_0x39a0('0x43')]=[{'all':!![]}];}_0x7814fb=_[_0x39a0('0x41')]({},_0x7814fb,_0x174fd0[_0x39a0('0x42')]);return db['VtigerAccount']['find'](_0x7814fb)[_0x39a0('0x25')](handleEntityNotFound(_0x47930c,null))[_0x39a0('0x25')](respondWithResult(_0x47930c,null))[_0x39a0('0x48')](handleError(_0x47930c,null));};exports[_0x39a0('0x49')]=function(_0x3fb933,_0x34ddc5){return db[_0x39a0('0x2e')][_0x39a0('0x49')](_0x3fb933[_0x39a0('0x4a')],{})['then'](respondWithResult(_0x34ddc5,0xc9))[_0x39a0('0x48')](handleError(_0x34ddc5,null));};exports[_0x39a0('0x23')]=function(_0x2e26bf,_0x146142){if(_0x2e26bf[_0x39a0('0x4a')]['id']){delete _0x2e26bf[_0x39a0('0x4a')]['id'];}return db[_0x39a0('0x2e')][_0x39a0('0x4b')]({'where':{'id':_0x2e26bf['params']['id']}})[_0x39a0('0x25')](handleEntityNotFound(_0x146142,null))['then'](saveUpdates(_0x2e26bf['body'],null))[_0x39a0('0x25')](respondWithResult(_0x146142,null))[_0x39a0('0x48')](handleError(_0x146142,null));};exports['destroy']=function(_0x52ce04,_0x5cb581){return db[_0x39a0('0x2e')][_0x39a0('0x4b')]({'where':{'id':_0x52ce04[_0x39a0('0x45')]['id']}})[_0x39a0('0x25')](handleEntityNotFound(_0x5cb581,null))[_0x39a0('0x25')](removeEntity(_0x5cb581,null))[_0x39a0('0x48')](handleError(_0x5cb581,null));};exports[_0x39a0('0x4c')]=function(_0x4cb218,_0x55d5e2,_0x5e4c34){var _0x1e55d8={};var _0x70db59={};var _0x360a06;var _0x138f31;return db[_0x39a0('0x2e')][_0x39a0('0x4d')]({'where':{'id':_0x4cb218['params']['id']}})[_0x39a0('0x25')](handleEntityNotFound(_0x55d5e2,null))['then'](function(_0x562f41){if(_0x562f41){_0x360a06=_0x562f41;_0x70db59[_0x39a0('0x33')]=_[_0x39a0('0x35')](db[_0x39a0('0x4e')][_0x39a0('0x2f')]);_0x70db59['query']=_[_0x39a0('0x35')](_0x4cb218[_0x39a0('0x34')]);_0x70db59[_0x39a0('0x3d')]=_[_0x39a0('0x36')](_0x70db59[_0x39a0('0x33')],_0x70db59['query']);_0x1e55d8[_0x39a0('0x38')]=_['intersection'](_0x70db59[_0x39a0('0x33')],qs[_0x39a0('0x37')](_0x4cb218[_0x39a0('0x34')][_0x39a0('0x37')]));_0x1e55d8[_0x39a0('0x38')]=_0x1e55d8[_0x39a0('0x38')][_0x39a0('0x46')]?_0x1e55d8[_0x39a0('0x38')]:_0x70db59[_0x39a0('0x33')];_0x1e55d8['order']=qs['sort'](_0x4cb218[_0x39a0('0x34')][_0x39a0('0x3c')]);_0x1e55d8[_0x39a0('0x40')]=qs['filters'](_[_0x39a0('0x3e')](_0x4cb218[_0x39a0('0x34')],_0x70db59[_0x39a0('0x3d')]));if(_0x4cb218[_0x39a0('0x34')]['filter']){_0x1e55d8[_0x39a0('0x40')]=_[_0x39a0('0x41')](_0x1e55d8[_0x39a0('0x40')],{'$or':_['map'](_0x1e55d8[_0x39a0('0x38')],function(_0x48809d){var _0x49fe8c={};_0x49fe8c[_0x48809d]={'$like':'%'+_0x4cb218[_0x39a0('0x34')][_0x39a0('0x3f')]+'%'};return _0x49fe8c;})});}_0x1e55d8=_['merge']({},_0x1e55d8,_0x4cb218[_0x39a0('0x42')]);return _0x360a06[_0x39a0('0x4c')](_0x1e55d8);}})[_0x39a0('0x25')](function(_0x456389){if(_0x456389){_0x138f31=_0x456389[_0x39a0('0x46')];if(!_0x4cb218[_0x39a0('0x34')][_0x39a0('0x39')](_0x39a0('0x3a'))){_0x1e55d8[_0x39a0('0x1b')]=qs[_0x39a0('0x1b')](_0x4cb218[_0x39a0('0x34')][_0x39a0('0x1b')]);_0x1e55d8[_0x39a0('0x19')]=qs[_0x39a0('0x19')](_0x4cb218[_0x39a0('0x34')][_0x39a0('0x19')]);}return _0x360a06[_0x39a0('0x4c')](_0x1e55d8);}})[_0x39a0('0x25')](function(_0x4120ec){if(_0x4120ec){return _0x4120ec?{'count':_0x138f31,'rows':_0x4120ec}:null;}})[_0x39a0('0x25')](respondWithResult(_0x55d5e2,null))[_0x39a0('0x48')](handleError(_0x55d5e2,null));};exports[_0x39a0('0x4f')]=function(_0x22babc,_0x1ae64e,_0x2337be){if(_0x22babc['body']['id']){delete _0x22babc[_0x39a0('0x4a')]['id'];}return db[_0x39a0('0x2e')][_0x39a0('0x4d')]({'where':{'id':_0x22babc[_0x39a0('0x45')]['id']}})[_0x39a0('0x25')](handleEntityNotFound(_0x1ae64e,null))[_0x39a0('0x25')](function(_0x68a95c){if(_0x68a95c){_0x22babc['body'][_0x39a0('0x50')]=_0x68a95c['id'];_0x22babc['body']['Subjects']=integrations[_0x39a0('0x51')](_0x22babc['body'][_0x39a0('0x52')],_0x22babc[_0x39a0('0x4a')][_0x39a0('0x31')]);_0x22babc[_0x39a0('0x4a')][_0x39a0('0x53')]=integrations[_0x39a0('0x54')](_0x22babc[_0x39a0('0x4a')][_0x39a0('0x52')],_0x22babc['body'][_0x39a0('0x31')]);return db[_0x39a0('0x4e')][_0x39a0('0x49')](_0x22babc[_0x39a0('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x39a0('0x55')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x39a0('0x25')](respondWithResult(_0x1ae64e,null))[_0x39a0('0x48')](handleError(_0x1ae64e,null));};var md5=require('md5');exports[_0x39a0('0x56')]=function(_0x5c12ab,_0x4e8212,_0x4dc1d9){var _0x3611dd=null;var _0x54b390=null;var _0x53f4c9=null;var _0x1a670d=null;var _0xff0361='';return db['VtigerAccount']['findOne']({'where':{'id':_0x5c12ab[_0x39a0('0x45')]['id']},'attributes':['id',_0x39a0('0x2a'),_0x39a0('0x57'),_0x39a0('0x58'),_0x39a0('0x59'),_0x39a0('0x5a'),_0x39a0('0x5b'),_0x39a0('0x5c')]})[_0x39a0('0x25')](handleEntityNotFound(_0x4e8212,null))[_0x39a0('0x25')](function(_0x1126c1){if(_0x1126c1){_0x3611dd=_0x1126c1[_0x39a0('0x57')];_0x54b390=_0x1126c1[_0x39a0('0x5c')];_0x53f4c9=_0x1126c1[_0x39a0('0x59')];_0xff0361=_0x1126c1['remoteUri'];var _0x473cd3=_0xff0361[_0x39a0('0x5d')](-0x1);if(_0x473cd3==='/'){_0xff0361=_0xff0361['substring'](0x0,_0xff0361[_0x39a0('0x5e')](_0x473cd3));}_0x1a670d=util[_0x39a0('0x5f')](_0x39a0('0x60'),_0xff0361);var _0x4f1d20={'method':'GET','uri':_0x1a670d,'qs':{'operation':_0x39a0('0x61'),'username':_0x1126c1[_0x39a0('0x57')]},'json':!![]};return rp(_0x4f1d20);}})[_0x39a0('0x25')](function(_0x1f2060){if(_0x1f2060[_0x39a0('0x62')]){var _0x3c9664={'method':'POST','uri':_0x1a670d,'form':{'operation':'login','username':_0x3611dd,'accessKey':md5(_0x1f2060[_0x39a0('0x63')][_0x39a0('0x64')]+_0x54b390)},'json':!![]};return rp(_0x3c9664);}})['then'](function(_0x5f3646){if(_0x5f3646[_0x39a0('0x62')]){var _0x555f0c={'method':'GET','uri':_0x1a670d,'qs':{'operation':_0x39a0('0x65'),'username':_0x3611dd,'sessionName':_0x5f3646[_0x39a0('0x63')][_0x39a0('0x66')],'elementType':_0x53f4c9},'json':!![]};return rp(_0x555f0c);}})[_0x39a0('0x25')](function(_0x517f09){if(_0x517f09[_0x39a0('0x62')]){var _0x17af19=[_0x39a0('0x67'),_0x39a0('0x68'),_0x39a0('0x69')];_[_0x39a0('0x6a')](_0x517f09[_0x39a0('0x63')][_0x39a0('0x37')],function(_0x3252d0){return _0x17af19[_0x39a0('0x6b')](_0x3252d0[_0x39a0('0x31')][_0x39a0('0x2a')]);});_[_0x39a0('0x6a')](_0x517f09[_0x39a0('0x63')][_0x39a0('0x37')],function(_0x3a3803){return _0x3a3803['editable']===_0x39a0('0x6c');});return{'count':_0x517f09[_0x39a0('0x63')]['fields'][_0x39a0('0x46')],'rows':_['map'](_0x517f09[_0x39a0('0x63')][_0x39a0('0x37')],function(_0x43cdfe){return{'id':_0x43cdfe['name'],'name':_0x43cdfe[_0x39a0('0x6d')],'custom':_[_0x39a0('0x6e')](_0x43cdfe['name'],_0x39a0('0x6f'))?!![]:![],'options':_0x43cdfe[_0x39a0('0x31')][_0x39a0('0x2a')]===_0x39a0('0x70')&&_0x43cdfe['type']['picklistValues'][_0x39a0('0x46')]>0x0?_[_0x39a0('0x2d')](_0x43cdfe[_0x39a0('0x31')]['picklistValues'],function(_0x469c1c){return{'name':_0x469c1c[_0x39a0('0x6d')],'value':_0x469c1c['value']};}):[]};})};}})[_0x39a0('0x25')](respondWithResult(_0x4e8212,null))[_0x39a0('0x48')](function(_0x2dae05){console[_0x39a0('0x71')](_0x39a0('0x72')+_0x2dae05);var _0x3efe0f=_0x5c12ab['query']['test']?0x1f4:_0x2dae05[_0x39a0('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x39a0('0x56'),_0x3efe0f,JSON['stringify'](_0x2dae05));delete _0x2dae05[_0x39a0('0x2a')];if(_0x3efe0f===0x191){_0x3efe0f=0x190;}_0x4e8212['status'](_0x3efe0f)[_0x39a0('0x2b')](_0x5c12ab[_0x39a0('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2dae05['statusCode']}:_0x2dae05);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index cd882c9..fa2e182 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 _0x8514=['moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x5d69e1,_0x745b0){var _0x57839c=function(_0x89ac42){while(--_0x89ac42){_0x5d69e1['push'](_0x5d69e1['shift']());}};_0x57839c(++_0x745b0);}(_0x8514,0x1b5));var _0x4851=function(_0x41d831,_0x1b0b64){_0x41d831=_0x41d831-0x0;var _0x121e51=_0x8514[_0x41d831];return _0x121e51;};'use strict';var _=require(_0x4851('0x0'));var util=require(_0x4851('0x1'));var logger=require(_0x4851('0x2'))('api');var moment=require(_0x4851('0x3'));var BPromise=require(_0x4851('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4851('0x5'));var rimraf=require('rimraf');var config=require(_0x4851('0x6'));var attributes=require(_0x4851('0x7'));var integrations=require(_0x4851('0x8'));module['exports']=function(_0x1a50b6,_0x4f7642){return _0x1a50b6[_0x4851('0x9')]('VtigerAccount',attributes,{'tableName':_0x4851('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69d9=['exports','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration'];(function(_0x46cfec,_0x4dcfb5){var _0xe67f0f=function(_0x39be6b){while(--_0x39be6b){_0x46cfec['push'](_0x46cfec['shift']());}};_0xe67f0f(++_0x4dcfb5);}(_0x69d9,0x120));var _0x969d=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x69d9[_0xe8129c];return _0x709fc5;};'use strict';var _=require(_0x969d('0x0'));var util=require(_0x969d('0x1'));var logger=require(_0x969d('0x2'))(_0x969d('0x3'));var moment=require(_0x969d('0x4'));var BPromise=require('bluebird');var rp=require(_0x969d('0x5'));var fs=require('fs');var path=require(_0x969d('0x6'));var rimraf=require(_0x969d('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x969d('0x8'));module[_0x969d('0x9')]=function(_0x292648,_0xf87886){return _0x292648['define']('VtigerAccount',attributes,{'tableName':_0x969d('0xa'),'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 ce59511..4539a2d 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 _0x153f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2e650a,_0x43c477){var _0xab7c2d=function(_0x4cc07d){while(--_0x4cc07d){_0x2e650a['push'](_0x2e650a['shift']());}};_0xab7c2d(++_0x43c477);}(_0x153f,0x15b));var _0xf153=function(_0x33b0c6,_0x5e14a7){_0x33b0c6=_0x33b0c6-0x0;var _0x2d39f3=_0x153f[_0x33b0c6];return _0x2d39f3;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}exports[_0xf153('0x17')]=function(_0x138dbe){var _0x44272e=this;return new Promise(function(_0x4e790d,_0x357d57){return db[_0xf153('0x18')][_0xf153('0x19')]({'raw':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1c')]||null:null,'attributes':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1d')]||null:null,'limit':_0x138dbe['options']?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1e')]||null:null,'include':_0x138dbe[_0xf153('0x1a')]?_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')]?_[_0xf153('0x20')](_0x138dbe[_0xf153('0x1a')][_0xf153('0x1f')],function(_0xf67cde){return{'model':db[_0xf67cde[_0xf153('0x21')]],'as':_0xf67cde['as'],'attributes':_0xf67cde[_0xf153('0x1d')],'include':_0xf67cde[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xf67cde[_0xf153('0x1f')],function(_0xe490f8){return{'model':db[_0xe490f8[_0xf153('0x21')]],'as':_0xe490f8['as'],'attributes':_0xe490f8[_0xf153('0x1d')],'include':_0xe490f8[_0xf153('0x1f')]?_[_0xf153('0x20')](_0xe490f8[_0xf153('0x1f')],function(_0x48ebdc){return{'model':db[_0x48ebdc[_0xf153('0x21')]],'as':_0x48ebdc['as'],'attributes':_0x48ebdc[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cdcd){logger[_0xf153('0xe')]('GetVtigerAccount',_0x138dbe);logger[_0xf153('0x11')](_0xf153('0x17'),_0x138dbe,JSON[_0xf153('0x12')](_0x16cdcd));_0x4e790d(_0x16cdcd);})[_0xf153('0x22')](function(_0x339e96){logger[_0xf153('0x13')](_0xf153('0x17'),_0x339e96[_0xf153('0x15')],_0x138dbe);_0x357d57(_0x44272e[_0xf153('0x13')](0x1f4,_0x339e96[_0xf153('0x15')]));});});};exports[_0xf153('0x23')]=function(_0x415a5f){var _0x5b5237=this;return new Promise(function(_0x258fb0,_0xbb3619){return db[_0xf153('0x18')][_0xf153('0x24')]({'raw':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1b')]===undefined?!![]:![]:!![],'where':_0x415a5f['options']?_0x415a5f['options'][_0xf153('0x1c')]||null:null,'attributes':_0x415a5f['options']?_0x415a5f[_0xf153('0x1a')]['attributes']||null:null,'include':_0x415a5f[_0xf153('0x1a')]?_0x415a5f[_0xf153('0x1a')]['include']?_[_0xf153('0x20')](_0x415a5f[_0xf153('0x1a')][_0xf153('0x1f')],function(_0x40be52){return{'model':db[_0x40be52[_0xf153('0x21')]],'as':_0x40be52['as'],'attributes':_0x40be52[_0xf153('0x1d')],'include':_0x40be52['include']?_[_0xf153('0x20')](_0x40be52['include'],function(_0x40834b){return{'model':db[_0x40834b[_0xf153('0x21')]],'as':_0x40834b['as'],'attributes':_0x40834b[_0xf153('0x1d')],'include':_0x40834b[_0xf153('0x1f')]?_[_0xf153('0x20')](_0x40834b[_0xf153('0x1f')],function(_0x4becf3){return{'model':db[_0x4becf3[_0xf153('0x21')]],'as':_0x4becf3['as'],'attributes':_0x4becf3[_0xf153('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf153('0xd')](function(_0x4e0634){logger[_0xf153('0xe')](_0xf153('0x23'),_0x415a5f);logger[_0xf153('0x11')](_0xf153('0x23'),_0x415a5f,JSON[_0xf153('0x12')](_0x4e0634));_0x258fb0(_0x4e0634);})[_0xf153('0x22')](function(_0x4cc481){logger[_0xf153('0x13')](_0xf153('0x23'),_0x4cc481['message'],_0x415a5f);_0xbb3619(_0x5b5237[_0xf153('0x13')](0x1f4,_0x4cc481[_0xf153('0x15')]));});});}; \ No newline at end of file +var _0x1775=['stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','limit','map','include','model','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3aace5,_0x280454){var _0x3d10d3=function(_0x3ab26d){while(--_0x3ab26d){_0x3aace5['push'](_0x3aace5['shift']());}};_0x3d10d3(++_0x280454);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['findAll']({'raw':_0x1b4102[_0x5177('0x1c')]?_0x1b4102['options'][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1e')]||null:null,'attributes':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'limit':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x20')]||null:null,'include':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')]['include']?_[_0x5177('0x21')](_0x1b4102['options'][_0x5177('0x22')],function(_0x2c68d8){return{'model':db[_0x2c68d8[_0x5177('0x23')]],'as':_0x2c68d8['as'],'attributes':_0x2c68d8[_0x5177('0x1f')],'include':_0x2c68d8['include']?_[_0x5177('0x21')](_0x2c68d8['include'],function(_0x564139){return{'model':db[_0x564139[_0x5177('0x23')]],'as':_0x564139['as'],'attributes':_0x564139[_0x5177('0x1f')],'include':_0x564139['include']?_[_0x5177('0x21')](_0x564139['include'],function(_0x231d35){return{'model':db[_0x231d35[_0x5177('0x23')]],'as':_0x231d35['as'],'attributes':_0x231d35['attributes']};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x2554ec){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON['stringify'](_0x2554ec));_0x3e6944(_0x2554ec);})['catch'](function(_0x45cf20){logger[_0x5177('0x14')](_0x5177('0x1a'),_0x45cf20[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4[_0x5177('0x14')](0x1f4,_0x45cf20[_0x5177('0x17')]));});});};exports[_0x5177('0x24')]=function(_0x72dced){var _0x49f6f1=this;return new Promise(function(_0x42e1db,_0x2233a2){return db['VtigerAccount'][_0x5177('0x25')]({'raw':_0x72dced['options']?_0x72dced[_0x5177('0x1c')][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x72dced[_0x5177('0x1c')]?_0x72dced['options']['where']||null:null,'attributes':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'include':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x22')]?_[_0x5177('0x21')](_0x72dced[_0x5177('0x1c')]['include'],function(_0x459ac6){return{'model':db[_0x459ac6[_0x5177('0x23')]],'as':_0x459ac6['as'],'attributes':_0x459ac6['attributes'],'include':_0x459ac6[_0x5177('0x22')]?_[_0x5177('0x21')](_0x459ac6[_0x5177('0x22')],function(_0x8727c6){return{'model':db[_0x8727c6[_0x5177('0x23')]],'as':_0x8727c6['as'],'attributes':_0x8727c6[_0x5177('0x1f')],'include':_0x8727c6['include']?_[_0x5177('0x21')](_0x8727c6[_0x5177('0x22')],function(_0x28b1d5){return{'model':db[_0x28b1d5[_0x5177('0x23')]],'as':_0x28b1d5['as'],'attributes':_0x28b1d5[_0x5177('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x1bb1e3){logger['info'](_0x5177('0x24'),_0x72dced);logger[_0x5177('0x10')]('ShowVtigerAccount',_0x72dced,JSON['stringify'](_0x1bb1e3));_0x42e1db(_0x1bb1e3);})[_0x5177('0x19')](function(_0x188cec){logger[_0x5177('0x14')](_0x5177('0x24'),_0x188cec[_0x5177('0x17')],_0x72dced);_0x2233a2(_0x49f6f1[_0x5177('0x14')](0x1f4,_0x188cec[_0x5177('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d485b92..109178e 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 _0x54e9=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x7af3a5,_0x23a349){var _0x3c1458=function(_0x39c153){while(--_0x39c153){_0x7af3a5['push'](_0x7af3a5['shift']());}};_0x3c1458(++_0x23a349);}(_0x54e9,0xb9));var _0x954e=function(_0x1ec12f,_0x38a321){_0x1ec12f=_0x1ec12f-0x0;var _0xa3c073=_0x54e9[_0x1ec12f];return _0xa3c073;};'use strict';var multer=require(_0x954e('0x0'));var util=require(_0x954e('0x1'));var path=require(_0x954e('0x2'));var timeout=require(_0x954e('0x3'));var express=require(_0x954e('0x4'));var router=express[_0x954e('0x5')]();var fs_extra=require(_0x954e('0x6'));var auth=require(_0x954e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x954e('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x954e('0x9')]('/',auth[_0x954e('0xa')](),controller[_0x954e('0xb')]);router[_0x954e('0x9')](_0x954e('0xc'),auth[_0x954e('0xa')](),controller[_0x954e('0xd')]);router['get'](_0x954e('0xe'),auth[_0x954e('0xa')](),controller[_0x954e('0xf')]);router['get'](_0x954e('0x10'),auth[_0x954e('0xa')](),controller['getSubjects']);router[_0x954e('0x9')](_0x954e('0x11'),auth['isAuthenticated'](),controller[_0x954e('0x12')]);router[_0x954e('0x13')]('/',auth[_0x954e('0xa')](),controller[_0x954e('0x14')]);router[_0x954e('0x15')](_0x954e('0xc'),auth[_0x954e('0xa')](),controller[_0x954e('0x16')]);router[_0x954e('0x17')]('/:id',auth[_0x954e('0xa')](),controller[_0x954e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x75f5=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x5cbf36,_0x4cd0ab){var _0x31392a=function(_0x3c5774){while(--_0x3c5774){_0x5cbf36['push'](_0x5cbf36['shift']());}};_0x31392a(++_0x4cd0ab);}(_0x75f5,0x98));var _0x575f=function(_0x47761d,_0x3f8494){_0x47761d=_0x47761d-0x0;var _0x3d1c05=_0x75f5[_0x47761d];return _0x3d1c05;};'use strict';var multer=require(_0x575f('0x0'));var util=require(_0x575f('0x1'));var path=require('path');var timeout=require(_0x575f('0x2'));var express=require(_0x575f('0x3'));var router=express[_0x575f('0x4')]();var fs_extra=require(_0x575f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x575f('0x6'));var config=require(_0x575f('0x7'));var controller=require(_0x575f('0x8'));router[_0x575f('0x9')]('/',auth[_0x575f('0xa')](),controller[_0x575f('0xb')]);router['get'](_0x575f('0xc'),auth[_0x575f('0xa')](),controller[_0x575f('0xd')]);router[_0x575f('0x9')](_0x575f('0xe'),auth[_0x575f('0xa')](),controller['getFields']);router['get'](_0x575f('0xf'),auth[_0x575f('0xa')](),controller[_0x575f('0x10')]);router[_0x575f('0x9')]('/:id/descriptions',auth[_0x575f('0xa')](),controller[_0x575f('0x11')]);router[_0x575f('0x12')]('/',auth['isAuthenticated'](),controller[_0x575f('0x13')]);router[_0x575f('0x14')]('/:id',auth[_0x575f('0xa')](),controller[_0x575f('0x15')]);router[_0x575f('0x16')](_0x575f('0xc'),auth[_0x575f('0xa')](),controller[_0x575f('0x17')]);module[_0x575f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a47781c..82fb586 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 _0xb7f8=['sequelize','exports','STRING'];(function(_0x2ad941,_0xd0ce1f){var _0x34fbcb=function(_0x378669){while(--_0x378669){_0x2ad941['push'](_0x2ad941['shift']());}};_0x34fbcb(++_0xd0ce1f);}(_0xb7f8,0x189));var _0x8b7f=function(_0x335ed9,_0x36192c){_0x335ed9=_0x335ed9-0x0;var _0x5e400e=_0xb7f8[_0x335ed9];return _0x5e400e;};'use strict';var Sequelize=require(_0x8b7f('0x0'));module[_0x8b7f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b7f('0x2')]}}; \ No newline at end of file +var _0x63dc=['sequelize','exports','STRING'];(function(_0x365212,_0x1f1a36){var _0x55dcb6=function(_0x1d3d78){while(--_0x1d3d78){_0x365212['push'](_0x365212['shift']());}};_0x55dcb6(++_0x1f1a36);}(_0x63dc,0x126));var _0xc63d=function(_0x17ea5d,_0x51d3d6){_0x17ea5d=_0x17ea5d-0x0;var _0x39f0c4=_0x63dc[_0x17ea5d];return _0x39f0c4;};'use strict';var Sequelize=require(_0xc63d('0x0'));module[_0xc63d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc63d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7e12bea..27e1ea1 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 _0x9e6f=['stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','body','findOne','order','pick','hasOwnProperty','getFields','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error'];(function(_0x246426,_0x505c21){var _0x320fcf=function(_0x5f50dc){while(--_0x5f50dc){_0x246426['push'](_0x246426['shift']());}};_0x320fcf(++_0x505c21);}(_0x9e6f,0x76));var _0xf9e6=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x9e6f[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xf9e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9e6('0x1'));var jsonpatch=require(_0xf9e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9e6('0x3'));var Mustache=require(_0xf9e6('0x4'));var util=require(_0xf9e6('0x5'));var path=require(_0xf9e6('0x6'));var sox=require(_0xf9e6('0x7'));var csv=require(_0xf9e6('0x8'));var ejs=require(_0xf9e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf9e6('0xa'));var _=require('lodash');var squel=require(_0xf9e6('0xb'));var crypto=require(_0xf9e6('0xc'));var jsforce=require(_0xf9e6('0xd'));var deskjs=require(_0xf9e6('0xe'));var toCsv=require(_0xf9e6('0x8'));var querystring=require(_0xf9e6('0xf'));var Papa=require(_0xf9e6('0x10'));var Redis=require('ioredis');var authService=require(_0xf9e6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9e6('0x12'));var logger=require(_0xf9e6('0x13'))(_0xf9e6('0x14'));var utils=require(_0xf9e6('0x15'));var config=require(_0xf9e6('0x16'));var licenseUtil=require(_0xf9e6('0x17'));var db=require(_0xf9e6('0x18'))['db'];function respondWithStatusCode(_0x3632d4,_0x46ff63){_0x46ff63=_0x46ff63||0xcc;return function(_0x376f66){if(_0x376f66){return _0x3632d4['sendStatus'](_0x46ff63);}return _0x3632d4[_0xf9e6('0x19')](_0x46ff63)[_0xf9e6('0x1a')]();};}function respondWithResult(_0x5625b1,_0x151040){_0x151040=_0x151040||0xc8;return function(_0xc375cf){if(_0xc375cf){return _0x5625b1['status'](_0x151040)[_0xf9e6('0x1b')](_0xc375cf);}};}function respondWithFilteredResult(_0x4cb5a5,_0x277843){return function(_0x5a7090){if(_0x5a7090){var _0x28721c=typeof _0x277843[_0xf9e6('0x1c')]===_0xf9e6('0x1d')&&typeof _0x277843[_0xf9e6('0x1e')]==='undefined';var _0x3a683f=_0x5a7090[_0xf9e6('0x1f')];var _0x466631=_0x28721c?0x0:_0x277843[_0xf9e6('0x1c')];var _0xb13e62=_0x28721c?_0x5a7090[_0xf9e6('0x1f')]:_0x277843['offset']+_0x277843[_0xf9e6('0x1e')];var _0x53c89e;if(_0xb13e62>=_0x3a683f){_0xb13e62=_0x3a683f;_0x53c89e=0xc8;}else{_0x53c89e=0xce;}_0x4cb5a5[_0xf9e6('0x19')](_0x53c89e);return _0x4cb5a5[_0xf9e6('0x20')]('Content-Range',_0x466631+'-'+_0xb13e62+'/'+_0x3a683f)['json'](_0x5a7090);}return null;};}function patchUpdates(_0x63439){return function(_0x1beb37){try{jsonpatch[_0xf9e6('0x21')](_0x1beb37,_0x63439,!![]);}catch(_0x25b935){return BPromise[_0xf9e6('0x22')](_0x25b935);}return _0x1beb37[_0xf9e6('0x23')]();};}function saveUpdates(_0x31065b,_0x414215){return function(_0xb37f5f){if(_0xb37f5f){return _0xb37f5f[_0xf9e6('0x24')](_0x31065b)['then'](function(_0x51ec80){return _0x51ec80;});}return null;};}function removeEntity(_0x16ab76,_0x22bc83){return function(_0x1db708){if(_0x1db708){return _0x1db708[_0xf9e6('0x25')]()[_0xf9e6('0x26')](function(){_0x16ab76[_0xf9e6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3186,_0x2f02f8){return function(_0x144575){if(!_0x144575){_0x2d3186['sendStatus'](0x194);}return _0x144575;};}function handleError(_0x4d02c6,_0x7b83d7){_0x7b83d7=_0x7b83d7||0x1f4;return function(_0x3e43d5){logger[_0xf9e6('0x27')](_0x3e43d5[_0xf9e6('0x28')]);if(_0x3e43d5[_0xf9e6('0x29')]){delete _0x3e43d5['name'];}_0x4d02c6['status'](_0x7b83d7)[_0xf9e6('0x2a')](_0x3e43d5);};}exports['index']=function(_0x5a07c1,_0x1569c0){var _0xbf62bf={},_0x2fd16e={},_0x1d247d={'count':0x0,'rows':[]};var _0x45ea31=_[_0xf9e6('0x2b')](db[_0xf9e6('0x2c')][_0xf9e6('0x2d')],function(_0x3432e7){return{'name':_0x3432e7[_0xf9e6('0x2e')],'type':_0x3432e7['type'][_0xf9e6('0x2f')]};});_0x2fd16e[_0xf9e6('0x30')]=_[_0xf9e6('0x2b')](_0x45ea31,_0xf9e6('0x29'));_0x2fd16e[_0xf9e6('0x31')]=_['keys'](_0x5a07c1[_0xf9e6('0x31')]);_0x2fd16e[_0xf9e6('0x32')]=_['intersection'](_0x2fd16e[_0xf9e6('0x30')],_0x2fd16e[_0xf9e6('0x31')]);_0xbf62bf[_0xf9e6('0x33')]=_[_0xf9e6('0x34')](_0x2fd16e[_0xf9e6('0x30')],qs[_0xf9e6('0x35')](_0x5a07c1[_0xf9e6('0x31')][_0xf9e6('0x35')]));_0xbf62bf[_0xf9e6('0x33')]=_0xbf62bf['attributes'][_0xf9e6('0x36')]?_0xbf62bf[_0xf9e6('0x33')]:_0x2fd16e[_0xf9e6('0x30')];if(!_0x5a07c1[_0xf9e6('0x31')]['hasOwnProperty'](_0xf9e6('0x37'))){_0xbf62bf[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x5a07c1['query'][_0xf9e6('0x1e')]);_0xbf62bf['offset']=qs[_0xf9e6('0x1c')](_0x5a07c1[_0xf9e6('0x31')]['offset']);}_0xbf62bf['order']=qs[_0xf9e6('0x38')](_0x5a07c1[_0xf9e6('0x31')][_0xf9e6('0x38')]);_0xbf62bf[_0xf9e6('0x39')]=qs['filters'](_['pick'](_0x5a07c1['query'],_0x2fd16e[_0xf9e6('0x32')]),_0x45ea31);if(_0x5a07c1[_0xf9e6('0x31')][_0xf9e6('0x3a')]){_0xbf62bf[_0xf9e6('0x39')]=_[_0xf9e6('0x3b')](_0xbf62bf[_0xf9e6('0x39')],{'$or':_['map'](_0x45ea31,function(_0x326e2b){if(_0x326e2b['type']!==_0xf9e6('0x3c')){var _0x387e8b={};_0x387e8b[_0x326e2b[_0xf9e6('0x29')]]={'$like':'%'+_0x5a07c1[_0xf9e6('0x31')][_0xf9e6('0x3a')]+'%'};return _0x387e8b;}})});}_0xbf62bf=_[_0xf9e6('0x3b')]({},_0xbf62bf,_0x5a07c1[_0xf9e6('0x3d')]);var _0x4e1310={'where':_0xbf62bf[_0xf9e6('0x39')]};return db[_0xf9e6('0x2c')][_0xf9e6('0x1f')](_0x4e1310)[_0xf9e6('0x26')](function(_0x190bae){_0x1d247d[_0xf9e6('0x1f')]=_0x190bae;if(_0x5a07c1[_0xf9e6('0x31')][_0xf9e6('0x3e')]){_0xbf62bf[_0xf9e6('0x3f')]=[{'all':!![]}];}return db[_0xf9e6('0x2c')]['findAll'](_0xbf62bf);})[_0xf9e6('0x26')](function(_0xcc6c00){_0x1d247d[_0xf9e6('0x40')]=_0xcc6c00;return _0x1d247d;})['then'](respondWithFilteredResult(_0x1569c0,_0xbf62bf))[_0xf9e6('0x41')](handleError(_0x1569c0,null));};exports[_0xf9e6('0x42')]=function(_0xa56189,_0x5ac137){var _0x52d049={'raw':![],'where':{'id':_0xa56189[_0xf9e6('0x43')]['id']}},_0x3ee6ca={};_0x3ee6ca['model']=_[_0xf9e6('0x44')](db[_0xf9e6('0x2c')][_0xf9e6('0x2d')]);_0x3ee6ca[_0xf9e6('0x31')]=_['keys'](_0xa56189[_0xf9e6('0x31')]);_0x3ee6ca[_0xf9e6('0x32')]=_['intersection'](_0x3ee6ca[_0xf9e6('0x30')],_0x3ee6ca[_0xf9e6('0x31')]);_0x52d049[_0xf9e6('0x33')]=_['intersection'](_0x3ee6ca[_0xf9e6('0x30')],qs[_0xf9e6('0x35')](_0xa56189[_0xf9e6('0x31')]['fields']));_0x52d049['attributes']=_0x52d049[_0xf9e6('0x33')][_0xf9e6('0x36')]?_0x52d049[_0xf9e6('0x33')]:_0x3ee6ca[_0xf9e6('0x30')];if(_0xa56189[_0xf9e6('0x31')][_0xf9e6('0x3e')]){_0x52d049[_0xf9e6('0x3f')]=[{'all':!![]}];}_0x52d049=_[_0xf9e6('0x3b')]({},_0x52d049,_0xa56189[_0xf9e6('0x3d')]);return db['VtigerConfiguration'][_0xf9e6('0x45')](_0x52d049)['then'](handleEntityNotFound(_0x5ac137,null))[_0xf9e6('0x26')](respondWithResult(_0x5ac137,null))['catch'](handleError(_0x5ac137,null));};exports['create']=function(_0x3d30b1,_0x1e2c64){return db['VtigerConfiguration']['create'](_0x3d30b1['body'],{})[_0xf9e6('0x26')](respondWithResult(_0x1e2c64,0xc9))[_0xf9e6('0x41')](handleError(_0x1e2c64,null));};exports['update']=function(_0x352ba5,_0x47f0d9){if(_0x352ba5[_0xf9e6('0x46')]['id']){delete _0x352ba5[_0xf9e6('0x46')]['id'];}return db[_0xf9e6('0x2c')][_0xf9e6('0x45')]({'where':{'id':_0x352ba5[_0xf9e6('0x43')]['id']}})[_0xf9e6('0x26')](handleEntityNotFound(_0x47f0d9,null))[_0xf9e6('0x26')](saveUpdates(_0x352ba5[_0xf9e6('0x46')],null))[_0xf9e6('0x26')](respondWithResult(_0x47f0d9,null))[_0xf9e6('0x41')](handleError(_0x47f0d9,null));};exports['destroy']=function(_0x242fe4,_0xa62ed5){return db[_0xf9e6('0x2c')]['find']({'where':{'id':_0x242fe4[_0xf9e6('0x43')]['id']}})[_0xf9e6('0x26')](handleEntityNotFound(_0xa62ed5,null))[_0xf9e6('0x26')](removeEntity(_0xa62ed5,null))['catch'](handleError(_0xa62ed5,null));};exports['getFields']=function(_0x2e8c08,_0x9fdcad,_0x22663e){var _0x254809={};var _0x3db882={};var _0x9fbbf;var _0x15fe8b;return db[_0xf9e6('0x2c')][_0xf9e6('0x47')]({'where':{'id':_0x2e8c08[_0xf9e6('0x43')]['id']}})[_0xf9e6('0x26')](handleEntityNotFound(_0x9fdcad,null))[_0xf9e6('0x26')](function(_0x2f72b4){if(_0x2f72b4){_0x9fbbf=_0x2f72b4;_0x3db882[_0xf9e6('0x30')]=_[_0xf9e6('0x44')](db['VtigerField'][_0xf9e6('0x2d')]);_0x3db882[_0xf9e6('0x31')]=_[_0xf9e6('0x44')](_0x2e8c08[_0xf9e6('0x31')]);_0x3db882[_0xf9e6('0x32')]=_['intersection'](_0x3db882['model'],_0x3db882[_0xf9e6('0x31')]);_0x254809[_0xf9e6('0x33')]=_[_0xf9e6('0x34')](_0x3db882[_0xf9e6('0x30')],qs[_0xf9e6('0x35')](_0x2e8c08[_0xf9e6('0x31')][_0xf9e6('0x35')]));_0x254809[_0xf9e6('0x33')]=_0x254809[_0xf9e6('0x33')][_0xf9e6('0x36')]?_0x254809[_0xf9e6('0x33')]:_0x3db882[_0xf9e6('0x30')];_0x254809[_0xf9e6('0x48')]=qs['sort'](_0x2e8c08[_0xf9e6('0x31')][_0xf9e6('0x38')]);_0x254809[_0xf9e6('0x39')]=qs[_0xf9e6('0x32')](_[_0xf9e6('0x49')](_0x2e8c08['query'],_0x3db882[_0xf9e6('0x32')]));if(_0x2e8c08[_0xf9e6('0x31')][_0xf9e6('0x3a')]){_0x254809[_0xf9e6('0x39')]=_[_0xf9e6('0x3b')](_0x254809[_0xf9e6('0x39')],{'$or':_['map'](_0x254809[_0xf9e6('0x33')],function(_0x5f0c7e){var _0x5a17e7={};_0x5a17e7[_0x5f0c7e]={'$like':'%'+_0x2e8c08[_0xf9e6('0x31')][_0xf9e6('0x3a')]+'%'};return _0x5a17e7;})});}_0x254809=_[_0xf9e6('0x3b')]({},_0x254809,_0x2e8c08[_0xf9e6('0x3d')]);return _0x9fbbf['getFields'](_0x254809);}})['then'](function(_0x425ef1){if(_0x425ef1){_0x15fe8b=_0x425ef1[_0xf9e6('0x36')];if(!_0x2e8c08['query'][_0xf9e6('0x4a')]('nolimit')){_0x254809[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x2e8c08[_0xf9e6('0x31')]['limit']);_0x254809[_0xf9e6('0x1c')]=qs[_0xf9e6('0x1c')](_0x2e8c08[_0xf9e6('0x31')][_0xf9e6('0x1c')]);}return _0x9fbbf[_0xf9e6('0x4b')](_0x254809);}})['then'](function(_0x2dd135){if(_0x2dd135){return _0x2dd135?{'count':_0x15fe8b,'rows':_0x2dd135}:null;}})['then'](respondWithResult(_0x9fdcad,null))[_0xf9e6('0x41')](handleError(_0x9fdcad,null));};exports['getSubjects']=function(_0x3088c1,_0x46a6c2,_0x131df7){var _0x3dd673={};var _0xc2f718={};var _0x355298;var _0xbf4311;return db[_0xf9e6('0x2c')][_0xf9e6('0x47')]({'where':{'id':_0x3088c1[_0xf9e6('0x43')]['id']}})[_0xf9e6('0x26')](handleEntityNotFound(_0x46a6c2,null))[_0xf9e6('0x26')](function(_0x113874){if(_0x113874){_0x355298=_0x113874;_0xc2f718[_0xf9e6('0x30')]=_[_0xf9e6('0x44')](db[_0xf9e6('0x4c')][_0xf9e6('0x2d')]);_0xc2f718['query']=_[_0xf9e6('0x44')](_0x3088c1['query']);_0xc2f718[_0xf9e6('0x32')]=_[_0xf9e6('0x34')](_0xc2f718[_0xf9e6('0x30')],_0xc2f718[_0xf9e6('0x31')]);_0x3dd673['attributes']=_[_0xf9e6('0x34')](_0xc2f718[_0xf9e6('0x30')],qs['fields'](_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x35')]));_0x3dd673[_0xf9e6('0x33')]=_0x3dd673[_0xf9e6('0x33')][_0xf9e6('0x36')]?_0x3dd673[_0xf9e6('0x33')]:_0xc2f718[_0xf9e6('0x30')];_0x3dd673['order']=qs[_0xf9e6('0x38')](_0x3088c1[_0xf9e6('0x31')]['sort']);_0x3dd673[_0xf9e6('0x39')]=qs[_0xf9e6('0x32')](_[_0xf9e6('0x49')](_0x3088c1[_0xf9e6('0x31')],_0xc2f718[_0xf9e6('0x32')]));if(_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x3a')]){_0x3dd673['where']=_[_0xf9e6('0x3b')](_0x3dd673[_0xf9e6('0x39')],{'$or':_[_0xf9e6('0x2b')](_0x3dd673['attributes'],function(_0x2e2692){var _0x15d2ef={};_0x15d2ef[_0x2e2692]={'$like':'%'+_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x3a')]+'%'};return _0x15d2ef;})});}_0x3dd673=_[_0xf9e6('0x3b')]({},_0x3dd673,_0x3088c1['options']);return _0x355298[_0xf9e6('0x4d')](_0x3dd673);}})['then'](function(_0x5e5863){if(_0x5e5863){_0xbf4311=_0x5e5863[_0xf9e6('0x36')];if(!_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x4a')](_0xf9e6('0x37'))){_0x3dd673[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x1e')]);_0x3dd673['offset']=qs[_0xf9e6('0x1c')](_0x3088c1[_0xf9e6('0x31')][_0xf9e6('0x1c')]);}return _0x355298[_0xf9e6('0x4d')](_0x3dd673);}})[_0xf9e6('0x26')](function(_0x5c6ff7){if(_0x5c6ff7){return _0x5c6ff7?{'count':_0xbf4311,'rows':_0x5c6ff7}:null;}})['then'](respondWithResult(_0x46a6c2,null))[_0xf9e6('0x41')](handleError(_0x46a6c2,null));};exports[_0xf9e6('0x4e')]=function(_0x1586c7,_0x3894a4,_0xccdf8a){var _0x3c0fe2={};var _0x5e6794={};var _0x3cde8e;var _0x5af7a6;return db[_0xf9e6('0x2c')][_0xf9e6('0x47')]({'where':{'id':_0x1586c7[_0xf9e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x3894a4,null))[_0xf9e6('0x26')](function(_0x413af3){if(_0x413af3){_0x3cde8e=_0x413af3;_0x5e6794[_0xf9e6('0x30')]=_[_0xf9e6('0x44')](db[_0xf9e6('0x4c')]['rawAttributes']);_0x5e6794[_0xf9e6('0x31')]=_[_0xf9e6('0x44')](_0x1586c7[_0xf9e6('0x31')]);_0x5e6794[_0xf9e6('0x32')]=_[_0xf9e6('0x34')](_0x5e6794[_0xf9e6('0x30')],_0x5e6794[_0xf9e6('0x31')]);_0x3c0fe2['attributes']=_[_0xf9e6('0x34')](_0x5e6794[_0xf9e6('0x30')],qs[_0xf9e6('0x35')](_0x1586c7[_0xf9e6('0x31')]['fields']));_0x3c0fe2[_0xf9e6('0x33')]=_0x3c0fe2[_0xf9e6('0x33')][_0xf9e6('0x36')]?_0x3c0fe2[_0xf9e6('0x33')]:_0x5e6794[_0xf9e6('0x30')];_0x3c0fe2[_0xf9e6('0x48')]=qs[_0xf9e6('0x38')](_0x1586c7[_0xf9e6('0x31')][_0xf9e6('0x38')]);_0x3c0fe2['where']=qs['filters'](_[_0xf9e6('0x49')](_0x1586c7[_0xf9e6('0x31')],_0x5e6794[_0xf9e6('0x32')]));if(_0x1586c7[_0xf9e6('0x31')][_0xf9e6('0x3a')]){_0x3c0fe2[_0xf9e6('0x39')]=_[_0xf9e6('0x3b')](_0x3c0fe2['where'],{'$or':_['map'](_0x3c0fe2[_0xf9e6('0x33')],function(_0x2d6919){var _0x1cb1c9={};_0x1cb1c9[_0x2d6919]={'$like':'%'+_0x1586c7[_0xf9e6('0x31')]['filter']+'%'};return _0x1cb1c9;})});}_0x3c0fe2=_['merge']({},_0x3c0fe2,_0x1586c7[_0xf9e6('0x3d')]);return _0x3cde8e[_0xf9e6('0x4e')](_0x3c0fe2);}})['then'](function(_0x15f4f3){if(_0x15f4f3){_0x5af7a6=_0x15f4f3['length'];if(!_0x1586c7[_0xf9e6('0x31')][_0xf9e6('0x4a')]('nolimit')){_0x3c0fe2[_0xf9e6('0x1e')]=qs[_0xf9e6('0x1e')](_0x1586c7[_0xf9e6('0x31')][_0xf9e6('0x1e')]);_0x3c0fe2[_0xf9e6('0x1c')]=qs[_0xf9e6('0x1c')](_0x1586c7[_0xf9e6('0x31')]['offset']);}return _0x3cde8e[_0xf9e6('0x4e')](_0x3c0fe2);}})[_0xf9e6('0x26')](function(_0x7c44eb){if(_0x7c44eb){return _0x7c44eb?{'count':_0x5af7a6,'rows':_0x7c44eb}:null;}})[_0xf9e6('0x26')](respondWithResult(_0x3894a4,null))[_0xf9e6('0x41')](handleError(_0x3894a4,null));}; \ No newline at end of file +var _0x99e9=['create','update','body','getFields','findOne','VtigerField','order','sort','pick','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','model','fields','attributes','length','nolimit','where','VIRTUAL','filter','merge','includeAll','include','rows','show','params','keys','filters','intersection','options','catch'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0x99e9,0xb4));var _0x999e=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0x99e9[_0x33dcf7];return _0x542d4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999e('0x0'));var zipdir=require(_0x999e('0x1'));var jsonpatch=require(_0x999e('0x2'));var rp=require(_0x999e('0x3'));var moment=require('moment');var BPromise=require(_0x999e('0x4'));var Mustache=require(_0x999e('0x5'));var util=require(_0x999e('0x6'));var path=require('path');var sox=require(_0x999e('0x7'));var csv=require('to-csv');var ejs=require(_0x999e('0x8'));var fs=require('fs');var fs_extra=require(_0x999e('0x9'));var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0xe'));var querystring=require(_0x999e('0xf'));var Papa=require(_0x999e('0x10'));var Redis=require(_0x999e('0x11'));var authService=require(_0x999e('0x12'));var qs=require(_0x999e('0x13'));var as=require(_0x999e('0x14'));var hardwareService=require(_0x999e('0x15'));var logger=require(_0x999e('0x16'))(_0x999e('0x17'));var utils=require(_0x999e('0x18'));var config=require(_0x999e('0x19'));var licenseUtil=require(_0x999e('0x1a'));var db=require(_0x999e('0x1b'))['db'];function respondWithStatusCode(_0x26b55a,_0x47a3c1){_0x47a3c1=_0x47a3c1||0xcc;return function(_0x15f771){if(_0x15f771){return _0x26b55a['sendStatus'](_0x47a3c1);}return _0x26b55a[_0x999e('0x1c')](_0x47a3c1)[_0x999e('0x1d')]();};}function respondWithResult(_0x2fbc3e,_0x538a92){_0x538a92=_0x538a92||0xc8;return function(_0x28bdd1){if(_0x28bdd1){return _0x2fbc3e['status'](_0x538a92)[_0x999e('0x1e')](_0x28bdd1);}};}function respondWithFilteredResult(_0x539598,_0x549ad4){return function(_0x1eee64){if(_0x1eee64){var _0x22feac=typeof _0x549ad4[_0x999e('0x1f')]===_0x999e('0x20')&&typeof _0x549ad4[_0x999e('0x21')]===_0x999e('0x20');var _0x4aac66=_0x1eee64['count'];var _0x4fcdfb=_0x22feac?0x0:_0x549ad4[_0x999e('0x1f')];var _0x43b09e=_0x22feac?_0x1eee64[_0x999e('0x22')]:_0x549ad4[_0x999e('0x1f')]+_0x549ad4[_0x999e('0x21')];var _0x3ece5e;if(_0x43b09e>=_0x4aac66){_0x43b09e=_0x4aac66;_0x3ece5e=0xc8;}else{_0x3ece5e=0xce;}_0x539598['status'](_0x3ece5e);return _0x539598['set'](_0x999e('0x23'),_0x4fcdfb+'-'+_0x43b09e+'/'+_0x4aac66)[_0x999e('0x1e')](_0x1eee64);}return null;};}function patchUpdates(_0x3b3642){return function(_0x510fa2){try{jsonpatch[_0x999e('0x24')](_0x510fa2,_0x3b3642,!![]);}catch(_0x42e167){return BPromise[_0x999e('0x25')](_0x42e167);}return _0x510fa2[_0x999e('0x26')]();};}function saveUpdates(_0x373b80,_0x3750a0){return function(_0x427bcf){if(_0x427bcf){return _0x427bcf['update'](_0x373b80)['then'](function(_0x11a6bf){return _0x11a6bf;});}return null;};}function removeEntity(_0x4f0091,_0x4c5491){return function(_0x452acd){if(_0x452acd){return _0x452acd[_0x999e('0x27')]()[_0x999e('0x28')](function(){_0x4f0091[_0x999e('0x1c')](0xcc)[_0x999e('0x1d')]();});}};}function handleEntityNotFound(_0x320634,_0x4f8406){return function(_0x2e1cc5){if(!_0x2e1cc5){_0x320634[_0x999e('0x29')](0x194);}return _0x2e1cc5;};}function handleError(_0x11068e,_0x12b9ad){_0x12b9ad=_0x12b9ad||0x1f4;return function(_0x1b7adb){logger[_0x999e('0x2a')](_0x1b7adb[_0x999e('0x2b')]);if(_0x1b7adb['name']){delete _0x1b7adb[_0x999e('0x2c')];}_0x11068e['status'](_0x12b9ad)['send'](_0x1b7adb);};}exports[_0x999e('0x2d')]=function(_0x1059bd,_0x1f89f2){var _0x555ca0={},_0x1ea0e4={},_0x28f7ba={'count':0x0,'rows':[]};var _0x22cd81=_[_0x999e('0x2e')](db[_0x999e('0x2f')][_0x999e('0x30')],function(_0x82e067){return{'name':_0x82e067[_0x999e('0x31')],'type':_0x82e067[_0x999e('0x32')][_0x999e('0x33')]};});_0x1ea0e4['model']=_[_0x999e('0x2e')](_0x22cd81,_0x999e('0x2c'));_0x1ea0e4[_0x999e('0x34')]=_['keys'](_0x1059bd[_0x999e('0x34')]);_0x1ea0e4['filters']=_['intersection'](_0x1ea0e4[_0x999e('0x35')],_0x1ea0e4[_0x999e('0x34')]);_0x555ca0['attributes']=_['intersection'](_0x1ea0e4[_0x999e('0x35')],qs[_0x999e('0x36')](_0x1059bd[_0x999e('0x34')][_0x999e('0x36')]));_0x555ca0['attributes']=_0x555ca0[_0x999e('0x37')][_0x999e('0x38')]?_0x555ca0[_0x999e('0x37')]:_0x1ea0e4[_0x999e('0x35')];if(!_0x1059bd['query']['hasOwnProperty'](_0x999e('0x39'))){_0x555ca0['limit']=qs[_0x999e('0x21')](_0x1059bd[_0x999e('0x34')][_0x999e('0x21')]);_0x555ca0[_0x999e('0x1f')]=qs['offset'](_0x1059bd[_0x999e('0x34')][_0x999e('0x1f')]);}_0x555ca0['order']=qs['sort'](_0x1059bd[_0x999e('0x34')]['sort']);_0x555ca0[_0x999e('0x3a')]=qs['filters'](_['pick'](_0x1059bd['query'],_0x1ea0e4['filters']),_0x22cd81);if(_0x1059bd[_0x999e('0x34')]['filter']){_0x555ca0[_0x999e('0x3a')]=_['merge'](_0x555ca0['where'],{'$or':_['map'](_0x22cd81,function(_0x2f7d79){if(_0x2f7d79[_0x999e('0x32')]!==_0x999e('0x3b')){var _0xe3c089={};_0xe3c089[_0x2f7d79[_0x999e('0x2c')]]={'$like':'%'+_0x1059bd[_0x999e('0x34')][_0x999e('0x3c')]+'%'};return _0xe3c089;}})});}_0x555ca0=_[_0x999e('0x3d')]({},_0x555ca0,_0x1059bd['options']);var _0x3ff20a={'where':_0x555ca0[_0x999e('0x3a')]};return db[_0x999e('0x2f')][_0x999e('0x22')](_0x3ff20a)['then'](function(_0x141358){_0x28f7ba['count']=_0x141358;if(_0x1059bd[_0x999e('0x34')][_0x999e('0x3e')]){_0x555ca0[_0x999e('0x3f')]=[{'all':!![]}];}return db[_0x999e('0x2f')]['findAll'](_0x555ca0);})[_0x999e('0x28')](function(_0x108c96){_0x28f7ba[_0x999e('0x40')]=_0x108c96;return _0x28f7ba;})['then'](respondWithFilteredResult(_0x1f89f2,_0x555ca0))['catch'](handleError(_0x1f89f2,null));};exports[_0x999e('0x41')]=function(_0x30d943,_0x4098ad){var _0x42a3a0={'raw':![],'where':{'id':_0x30d943[_0x999e('0x42')]['id']}},_0x1009a0={};_0x1009a0[_0x999e('0x35')]=_[_0x999e('0x43')](db[_0x999e('0x2f')][_0x999e('0x30')]);_0x1009a0['query']=_['keys'](_0x30d943[_0x999e('0x34')]);_0x1009a0[_0x999e('0x44')]=_[_0x999e('0x45')](_0x1009a0[_0x999e('0x35')],_0x1009a0[_0x999e('0x34')]);_0x42a3a0[_0x999e('0x37')]=_['intersection'](_0x1009a0[_0x999e('0x35')],qs['fields'](_0x30d943['query'][_0x999e('0x36')]));_0x42a3a0['attributes']=_0x42a3a0['attributes']['length']?_0x42a3a0['attributes']:_0x1009a0[_0x999e('0x35')];if(_0x30d943[_0x999e('0x34')]['includeAll']){_0x42a3a0[_0x999e('0x3f')]=[{'all':!![]}];}_0x42a3a0=_[_0x999e('0x3d')]({},_0x42a3a0,_0x30d943[_0x999e('0x46')]);return db['VtigerConfiguration']['find'](_0x42a3a0)[_0x999e('0x28')](handleEntityNotFound(_0x4098ad,null))[_0x999e('0x28')](respondWithResult(_0x4098ad,null))[_0x999e('0x47')](handleError(_0x4098ad,null));};exports['create']=function(_0x4b43dd,_0x4d0358){return db['VtigerConfiguration'][_0x999e('0x48')](_0x4b43dd['body'],{})['then'](respondWithResult(_0x4d0358,0xc9))[_0x999e('0x47')](handleError(_0x4d0358,null));};exports[_0x999e('0x49')]=function(_0x5843f1,_0xa50dc6){if(_0x5843f1[_0x999e('0x4a')]['id']){delete _0x5843f1['body']['id'];}return db[_0x999e('0x2f')]['find']({'where':{'id':_0x5843f1[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0xa50dc6,null))['then'](saveUpdates(_0x5843f1[_0x999e('0x4a')],null))[_0x999e('0x28')](respondWithResult(_0xa50dc6,null))['catch'](handleError(_0xa50dc6,null));};exports['destroy']=function(_0x254292,_0x561fb4){return db['VtigerConfiguration']['find']({'where':{'id':_0x254292[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x561fb4,null))[_0x999e('0x28')](removeEntity(_0x561fb4,null))[_0x999e('0x47')](handleError(_0x561fb4,null));};exports[_0x999e('0x4b')]=function(_0x14c01c,_0x5b2645,_0x14f8de){var _0x2317c5={};var _0x4f1347={};var _0x1e506f;var _0x384893;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x14c01c[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x5b2645,null))[_0x999e('0x28')](function(_0x4636fa){if(_0x4636fa){_0x1e506f=_0x4636fa;_0x4f1347[_0x999e('0x35')]=_['keys'](db[_0x999e('0x4d')][_0x999e('0x30')]);_0x4f1347[_0x999e('0x34')]=_[_0x999e('0x43')](_0x14c01c['query']);_0x4f1347[_0x999e('0x44')]=_[_0x999e('0x45')](_0x4f1347[_0x999e('0x35')],_0x4f1347[_0x999e('0x34')]);_0x2317c5[_0x999e('0x37')]=_[_0x999e('0x45')](_0x4f1347[_0x999e('0x35')],qs[_0x999e('0x36')](_0x14c01c['query']['fields']));_0x2317c5[_0x999e('0x37')]=_0x2317c5[_0x999e('0x37')][_0x999e('0x38')]?_0x2317c5[_0x999e('0x37')]:_0x4f1347[_0x999e('0x35')];_0x2317c5[_0x999e('0x4e')]=qs[_0x999e('0x4f')](_0x14c01c['query']['sort']);_0x2317c5[_0x999e('0x3a')]=qs[_0x999e('0x44')](_[_0x999e('0x50')](_0x14c01c[_0x999e('0x34')],_0x4f1347[_0x999e('0x44')]));if(_0x14c01c['query'][_0x999e('0x3c')]){_0x2317c5[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x2317c5[_0x999e('0x3a')],{'$or':_[_0x999e('0x2e')](_0x2317c5[_0x999e('0x37')],function(_0x2b4bbe){var _0x53734c={};_0x53734c[_0x2b4bbe]={'$like':'%'+_0x14c01c[_0x999e('0x34')]['filter']+'%'};return _0x53734c;})});}_0x2317c5=_[_0x999e('0x3d')]({},_0x2317c5,_0x14c01c[_0x999e('0x46')]);return _0x1e506f[_0x999e('0x4b')](_0x2317c5);}})[_0x999e('0x28')](function(_0x440a3c){if(_0x440a3c){_0x384893=_0x440a3c[_0x999e('0x38')];if(!_0x14c01c['query'][_0x999e('0x51')](_0x999e('0x39'))){_0x2317c5[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x14c01c[_0x999e('0x34')][_0x999e('0x21')]);_0x2317c5[_0x999e('0x1f')]=qs[_0x999e('0x1f')](_0x14c01c[_0x999e('0x34')][_0x999e('0x1f')]);}return _0x1e506f[_0x999e('0x4b')](_0x2317c5);}})[_0x999e('0x28')](function(_0x77a387){if(_0x77a387){return _0x77a387?{'count':_0x384893,'rows':_0x77a387}:null;}})[_0x999e('0x28')](respondWithResult(_0x5b2645,null))[_0x999e('0x47')](handleError(_0x5b2645,null));};exports['getSubjects']=function(_0x425639,_0x157c1f,_0x296d59){var _0x3f18fb={};var _0x4e5e6e={};var _0x4871c9;var _0x21c8be;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x425639[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x157c1f,null))[_0x999e('0x28')](function(_0x1596bb){if(_0x1596bb){_0x4871c9=_0x1596bb;_0x4e5e6e[_0x999e('0x35')]=_[_0x999e('0x43')](db['VtigerField'][_0x999e('0x30')]);_0x4e5e6e['query']=_[_0x999e('0x43')](_0x425639[_0x999e('0x34')]);_0x4e5e6e['filters']=_[_0x999e('0x45')](_0x4e5e6e[_0x999e('0x35')],_0x4e5e6e[_0x999e('0x34')]);_0x3f18fb[_0x999e('0x37')]=_[_0x999e('0x45')](_0x4e5e6e['model'],qs[_0x999e('0x36')](_0x425639[_0x999e('0x34')]['fields']));_0x3f18fb['attributes']=_0x3f18fb['attributes'][_0x999e('0x38')]?_0x3f18fb[_0x999e('0x37')]:_0x4e5e6e[_0x999e('0x35')];_0x3f18fb[_0x999e('0x4e')]=qs[_0x999e('0x4f')](_0x425639['query']['sort']);_0x3f18fb['where']=qs[_0x999e('0x44')](_['pick'](_0x425639['query'],_0x4e5e6e[_0x999e('0x44')]));if(_0x425639['query'][_0x999e('0x3c')]){_0x3f18fb[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x3f18fb['where'],{'$or':_[_0x999e('0x2e')](_0x3f18fb[_0x999e('0x37')],function(_0x2ddf00){var _0x61f168={};_0x61f168[_0x2ddf00]={'$like':'%'+_0x425639[_0x999e('0x34')][_0x999e('0x3c')]+'%'};return _0x61f168;})});}_0x3f18fb=_[_0x999e('0x3d')]({},_0x3f18fb,_0x425639['options']);return _0x4871c9[_0x999e('0x52')](_0x3f18fb);}})[_0x999e('0x28')](function(_0x193c80){if(_0x193c80){_0x21c8be=_0x193c80['length'];if(!_0x425639[_0x999e('0x34')][_0x999e('0x51')]('nolimit')){_0x3f18fb[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x425639[_0x999e('0x34')][_0x999e('0x21')]);_0x3f18fb[_0x999e('0x1f')]=qs[_0x999e('0x1f')](_0x425639[_0x999e('0x34')][_0x999e('0x1f')]);}return _0x4871c9[_0x999e('0x52')](_0x3f18fb);}})['then'](function(_0xe27738){if(_0xe27738){return _0xe27738?{'count':_0x21c8be,'rows':_0xe27738}:null;}})[_0x999e('0x28')](respondWithResult(_0x157c1f,null))[_0x999e('0x47')](handleError(_0x157c1f,null));};exports['getDescriptions']=function(_0x46365a,_0x48e0ca,_0x14f13a){var _0x115be6={};var _0x3a7596={};var _0x4e6c30;var _0x43377d;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x46365a[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x48e0ca,null))[_0x999e('0x28')](function(_0x5c4a50){if(_0x5c4a50){_0x4e6c30=_0x5c4a50;_0x3a7596[_0x999e('0x35')]=_['keys'](db[_0x999e('0x4d')]['rawAttributes']);_0x3a7596['query']=_[_0x999e('0x43')](_0x46365a['query']);_0x3a7596[_0x999e('0x44')]=_[_0x999e('0x45')](_0x3a7596['model'],_0x3a7596[_0x999e('0x34')]);_0x115be6[_0x999e('0x37')]=_['intersection'](_0x3a7596[_0x999e('0x35')],qs[_0x999e('0x36')](_0x46365a[_0x999e('0x34')][_0x999e('0x36')]));_0x115be6[_0x999e('0x37')]=_0x115be6[_0x999e('0x37')][_0x999e('0x38')]?_0x115be6[_0x999e('0x37')]:_0x3a7596['model'];_0x115be6['order']=qs[_0x999e('0x4f')](_0x46365a[_0x999e('0x34')][_0x999e('0x4f')]);_0x115be6[_0x999e('0x3a')]=qs[_0x999e('0x44')](_[_0x999e('0x50')](_0x46365a['query'],_0x3a7596[_0x999e('0x44')]));if(_0x46365a[_0x999e('0x34')]['filter']){_0x115be6[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x115be6[_0x999e('0x3a')],{'$or':_['map'](_0x115be6[_0x999e('0x37')],function(_0x1a53c9){var _0x328c2d={};_0x328c2d[_0x1a53c9]={'$like':'%'+_0x46365a['query'][_0x999e('0x3c')]+'%'};return _0x328c2d;})});}_0x115be6=_[_0x999e('0x3d')]({},_0x115be6,_0x46365a[_0x999e('0x46')]);return _0x4e6c30['getDescriptions'](_0x115be6);}})['then'](function(_0x10a6f1){if(_0x10a6f1){_0x43377d=_0x10a6f1['length'];if(!_0x46365a[_0x999e('0x34')][_0x999e('0x51')](_0x999e('0x39'))){_0x115be6[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x46365a[_0x999e('0x34')][_0x999e('0x21')]);_0x115be6['offset']=qs[_0x999e('0x1f')](_0x46365a['query']['offset']);}return _0x4e6c30[_0x999e('0x53')](_0x115be6);}})[_0x999e('0x28')](function(_0xa0a5de){if(_0xa0a5de){return _0xa0a5de?{'count':_0x43377d,'rows':_0xa0a5de}:null;}})[_0x999e('0x28')](respondWithResult(_0x48e0ca,null))[_0x999e('0x47')](handleError(_0x48e0ca,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 65669a8..c6c9986 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 _0xef7d=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x3f4048,_0x17c163){var _0x150861=function(_0x5d0f44){while(--_0x5d0f44){_0x3f4048['push'](_0x3f4048['shift']());}};_0x150861(++_0x17c163);}(_0xef7d,0x12b));var _0xdef7=function(_0x236c67,_0x28b77e){_0x236c67=_0x236c67-0x0;var _0x19e4fb=_0xef7d[_0x236c67];return _0x19e4fb;};'use strict';var _=require(_0xdef7('0x0'));var util=require(_0xdef7('0x1'));var logger=require(_0xdef7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdef7('0x3'));var fs=require('fs');var path=require(_0xdef7('0x4'));var rimraf=require(_0xdef7('0x5'));var config=require(_0xdef7('0x6'));var attributes=require(_0xdef7('0x7'));module[_0xdef7('0x8')]=function(_0x3601cb,_0x327dc4){return _0x3601cb[_0xdef7('0x9')](_0xdef7('0xa'),attributes,{'tableName':_0xdef7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddd9=['moment','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xddd9,0xb1));var _0x9ddd=function(_0x4b4f8e,_0x49ec38){_0x4b4f8e=_0x4b4f8e-0x0;var _0x471341=_0xddd9[_0x4b4f8e];return _0x471341;};'use strict';var _=require(_0x9ddd('0x0'));var util=require('util');var logger=require(_0x9ddd('0x1'))(_0x9ddd('0x2'));var moment=require(_0x9ddd('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ddd('0x4'));var fs=require('fs');var path=require(_0x9ddd('0x5'));var rimraf=require(_0x9ddd('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ddd('0x7'));module[_0x9ddd('0x8')]=function(_0x23ffb5,_0x3e45e9){return _0x23ffb5[_0x9ddd('0x9')](_0x9ddd('0xa'),attributes,{'tableName':_0x9ddd('0xb'),'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 40e9651..65c7c83 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 _0x8678=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x263b7d,_0x5c1008){var _0x21c2eb=function(_0x1fa4f3){while(--_0x1fa4f3){_0x263b7d['push'](_0x263b7d['shift']());}};_0x21c2eb(++_0x5c1008);}(_0x8678,0xf0));var _0x8867=function(_0x320c0f,_0x352f1c){_0x320c0f=_0x320c0f-0x0;var _0x266ff4=_0x8678[_0x320c0f];return _0x266ff4;};'use strict';var _=require(_0x8867('0x0'));var util=require(_0x8867('0x1'));var moment=require(_0x8867('0x2'));var BPromise=require('bluebird');var rs=require(_0x8867('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8867('0x4'))['db'];var utils=require(_0x8867('0x5'));var logger=require(_0x8867('0x6'))(_0x8867('0x7'));var config=require(_0x8867('0x8'));var jayson=require(_0x8867('0x9'));var client=jayson[_0x8867('0xa')][_0x8867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47626e,_0x36085e,_0x2afc27){return new BPromise(function(_0x5b050c,_0x3a49ea){return client[_0x8867('0xc')](_0x47626e,_0x2afc27)[_0x8867('0xd')](function(_0xf1749d){logger[_0x8867('0xe')](_0x8867('0xf'),_0x36085e,_0x8867('0x10'));logger[_0x8867('0x11')](_0x8867('0x12'),_0x36085e,_0x8867('0x10'),JSON[_0x8867('0x13')](_0xf1749d));if(_0xf1749d[_0x8867('0x14')]){if(_0xf1749d[_0x8867('0x14')][_0x8867('0x15')]===0x1f4){logger[_0x8867('0x14')](_0x8867('0xf'),_0x36085e,_0xf1749d[_0x8867('0x14')]['message']);return _0x3a49ea(_0xf1749d[_0x8867('0x14')][_0x8867('0x16')]);}logger[_0x8867('0x14')](_0x8867('0xf'),_0x36085e,_0xf1749d['error'][_0x8867('0x16')]);return _0x5b050c(_0xf1749d['error'][_0x8867('0x16')]);}else{logger[_0x8867('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x36085e,_0x8867('0x10'));_0x5b050c(_0xf1749d['result']['message']);}})[_0x8867('0x17')](function(_0xd718c8){logger[_0x8867('0x14')](_0x8867('0xf'),_0x36085e,_0xd718c8);_0x3a49ea(_0xd718c8);});});} \ No newline at end of file +var _0x7cd3=['ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x7cd3,0x119));var _0x37cd=function(_0x1ad5db,_0x4d9f97){_0x1ad5db=_0x1ad5db-0x0;var _0x4bd112=_0x7cd3[_0x1ad5db];return _0x4bd112;};'use strict';var _=require(_0x37cd('0x0'));var util=require(_0x37cd('0x1'));var moment=require(_0x37cd('0x2'));var BPromise=require(_0x37cd('0x3'));var rs=require(_0x37cd('0x4'));var fs=require('fs');var Redis=require(_0x37cd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37cd('0x6'))(_0x37cd('0x7'));var config=require('../../config/environment');var jayson=require(_0x37cd('0x8'));var client=jayson[_0x37cd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x106ad9,_0x28234b,_0x51abde){return new BPromise(function(_0x46a254,_0x1fe8ae){return client[_0x37cd('0xa')](_0x106ad9,_0x51abde)[_0x37cd('0xb')](function(_0xcb8f66){logger[_0x37cd('0xc')](_0x37cd('0xd'),_0x28234b,_0x37cd('0xe'));logger['debug'](_0x37cd('0xf'),_0x28234b,'request\x20sent',JSON[_0x37cd('0x10')](_0xcb8f66));if(_0xcb8f66[_0x37cd('0x11')]){if(_0xcb8f66[_0x37cd('0x11')][_0x37cd('0x12')]===0x1f4){logger['error'](_0x37cd('0xd'),_0x28234b,_0xcb8f66['error']['message']);return _0x1fe8ae(_0xcb8f66[_0x37cd('0x11')]['message']);}logger[_0x37cd('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x28234b,_0xcb8f66['error'][_0x37cd('0x13')]);return _0x46a254(_0xcb8f66[_0x37cd('0x11')][_0x37cd('0x13')]);}else{logger[_0x37cd('0xc')](_0x37cd('0xd'),_0x28234b,_0x37cd('0xe'));_0x46a254(_0xcb8f66[_0x37cd('0x14')][_0x37cd('0x13')]);}})[_0x37cd('0x15')](function(_0x46bca7){logger[_0x37cd('0x11')](_0x37cd('0xd'),_0x28234b,_0x46bca7);_0x1fe8ae(_0x46bca7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a69ea0b..5369af8 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 _0xaa4d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0xaa4d,0x14e));var _0xdaa4=function(_0x8f10f9,_0x44280b){_0x8f10f9=_0x8f10f9-0x0;var _0x32b6c1=_0xaa4d[_0x8f10f9];return _0x32b6c1;};'use strict';var multer=require(_0xdaa4('0x0'));var util=require(_0xdaa4('0x1'));var path=require(_0xdaa4('0x2'));var timeout=require(_0xdaa4('0x3'));var express=require(_0xdaa4('0x4'));var router=express['Router']();var fs_extra=require(_0xdaa4('0x5'));var auth=require(_0xdaa4('0x6'));var interaction=require(_0xdaa4('0x7'));var config=require(_0xdaa4('0x8'));var controller=require(_0xdaa4('0x9'));router[_0xdaa4('0xa')]('/',auth[_0xdaa4('0xb')](),controller['index']);router[_0xdaa4('0xa')](_0xdaa4('0xc'),auth[_0xdaa4('0xb')](),controller[_0xdaa4('0xd')]);router[_0xdaa4('0xe')]('/',auth[_0xdaa4('0xb')](),controller[_0xdaa4('0xf')]);router[_0xdaa4('0x10')](_0xdaa4('0xc'),auth[_0xdaa4('0xb')](),controller[_0xdaa4('0x11')]);router[_0xdaa4('0x12')](_0xdaa4('0xc'),auth[_0xdaa4('0xb')](),controller[_0xdaa4('0x13')]);module[_0xdaa4('0x14')]=router; \ No newline at end of file +var _0x7d5f=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x7d5f,0x1dc));var _0xf7d5=function(_0x206daa,_0x24748d){_0x206daa=_0x206daa-0x0;var _0x393686=_0x7d5f[_0x206daa];return _0x393686;};'use strict';var multer=require(_0xf7d5('0x0'));var util=require('util');var path=require(_0xf7d5('0x1'));var timeout=require(_0xf7d5('0x2'));var express=require('express');var router=express[_0xf7d5('0x3')]();var fs_extra=require(_0xf7d5('0x4'));var auth=require(_0xf7d5('0x5'));var interaction=require(_0xf7d5('0x6'));var config=require(_0xf7d5('0x7'));var controller=require(_0xf7d5('0x8'));router[_0xf7d5('0x9')]('/',auth[_0xf7d5('0xa')](),controller[_0xf7d5('0xb')]);router[_0xf7d5('0x9')](_0xf7d5('0xc'),auth[_0xf7d5('0xa')](),controller[_0xf7d5('0xd')]);router[_0xf7d5('0xe')]('/',auth[_0xf7d5('0xa')](),controller[_0xf7d5('0xf')]);router[_0xf7d5('0x10')](_0xf7d5('0xc'),auth[_0xf7d5('0xa')](),controller['update']);router['delete'](_0xf7d5('0xc'),auth['isAuthenticated'](),controller[_0xf7d5('0x11')]);module[_0xf7d5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index cc7fa94..00a8cab 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 _0xdd5c=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x426f87,_0x459ff1){var _0xf2a7c9=function(_0x27c069){while(--_0x27c069){_0x426f87['push'](_0x426f87['shift']());}};_0xf2a7c9(++_0x459ff1);}(_0xdd5c,0xea));var _0xcdd5=function(_0x44b3f6,_0x2f0b79){_0x44b3f6=_0x44b3f6-0x0;var _0x4a6207=_0xdd5c[_0x44b3f6];return _0x4a6207;};'use strict';var Sequelize=require(_0xcdd5('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xcdd5('0x1'),_0xcdd5('0x2'),_0xcdd5('0x3'),_0xcdd5('0x4'),_0xcdd5('0x5')),'defaultValue':_0xcdd5('0x1')},'content':{'type':Sequelize[_0xcdd5('0x6')]},'key':{'type':Sequelize[_0xcdd5('0x6')]},'keyType':{'type':Sequelize[_0xcdd5('0x7')](_0xcdd5('0x1'),_0xcdd5('0x2'),_0xcdd5('0x3'))},'keyContent':{'type':Sequelize[_0xcdd5('0x6')]},'idField':{'type':Sequelize[_0xcdd5('0x6')]},'nameField':{'type':Sequelize[_0xcdd5('0x6')]},'customField':{'type':Sequelize[_0xcdd5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdd5('0x6')]}}; \ No newline at end of file +var _0x4fc7=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1d4929,_0x6f0475){var _0x161ace=function(_0x157c42){while(--_0x157c42){_0x1d4929['push'](_0x1d4929['shift']());}};_0x161ace(++_0x6f0475);}(_0x4fc7,0x1bf));var _0x74fc=function(_0x236886,_0x1084b9){_0x236886=_0x236886-0x0;var _0x5ad312=_0x4fc7[_0x236886];return _0x5ad312;};'use strict';var Sequelize=require(_0x74fc('0x0'));module['exports']={'type':{'type':Sequelize[_0x74fc('0x1')](_0x74fc('0x2'),_0x74fc('0x3'),_0x74fc('0x4'),_0x74fc('0x5'),_0x74fc('0x6')),'defaultValue':_0x74fc('0x2')},'content':{'type':Sequelize[_0x74fc('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x74fc('0x1')]('string','variable',_0x74fc('0x4'))},'keyContent':{'type':Sequelize[_0x74fc('0x7')]},'idField':{'type':Sequelize[_0x74fc('0x7')]},'nameField':{'type':Sequelize[_0x74fc('0x7')]},'customField':{'type':Sequelize[_0x74fc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x74fc('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0ac3c32..82a23ae 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 _0xbd90=['error','stack','name','send','index','map','VtigerField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','json','apply','reject','save','update','then','end'];(function(_0x1135b1,_0x644ab2){var _0x387f6b=function(_0x515757){while(--_0x515757){_0x1135b1['push'](_0x1135b1['shift']());}};_0x387f6b(++_0x644ab2);}(_0xbd90,0x113));var _0x0bd9=function(_0x351ac1,_0x3b532c){_0x351ac1=_0x351ac1-0x0;var _0x5a1015=_0xbd90[_0x351ac1];return _0x5a1015;};'use strict';var emlformat=require(_0x0bd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bd9('0x1'));var jsonpatch=require(_0x0bd9('0x2'));var rp=require(_0x0bd9('0x3'));var moment=require(_0x0bd9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0bd9('0x5'));var util=require(_0x0bd9('0x6'));var path=require(_0x0bd9('0x7'));var sox=require(_0x0bd9('0x8'));var csv=require(_0x0bd9('0x9'));var ejs=require(_0x0bd9('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd9('0xb'));var _=require(_0x0bd9('0xc'));var squel=require(_0x0bd9('0xd'));var crypto=require(_0x0bd9('0xe'));var jsforce=require(_0x0bd9('0xf'));var deskjs=require(_0x0bd9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0bd9('0x11'));var Papa=require(_0x0bd9('0x12'));var Redis=require(_0x0bd9('0x13'));var authService=require(_0x0bd9('0x14'));var qs=require(_0x0bd9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd9('0x16'));var logger=require(_0x0bd9('0x17'))(_0x0bd9('0x18'));var utils=require('../../config/utils');var config=require(_0x0bd9('0x19'));var licenseUtil=require(_0x0bd9('0x1a'));var db=require(_0x0bd9('0x1b'))['db'];function respondWithStatusCode(_0x49d9aa,_0x3ff2d8){_0x3ff2d8=_0x3ff2d8||0xcc;return function(_0x105ae1){if(_0x105ae1){return _0x49d9aa[_0x0bd9('0x1c')](_0x3ff2d8);}return _0x49d9aa[_0x0bd9('0x1d')](_0x3ff2d8)['end']();};}function respondWithResult(_0x29f04a,_0x354240){_0x354240=_0x354240||0xc8;return function(_0x382781){if(_0x382781){return _0x29f04a[_0x0bd9('0x1d')](_0x354240)['json'](_0x382781);}};}function respondWithFilteredResult(_0x27f377,_0x2953fe){return function(_0x30157c){if(_0x30157c){var _0x412ee1=typeof _0x2953fe['offset']===_0x0bd9('0x1e')&&typeof _0x2953fe['limit']===_0x0bd9('0x1e');var _0x2d656f=_0x30157c[_0x0bd9('0x1f')];var _0x2ecd4f=_0x412ee1?0x0:_0x2953fe[_0x0bd9('0x20')];var _0x4b168f=_0x412ee1?_0x30157c['count']:_0x2953fe[_0x0bd9('0x20')]+_0x2953fe['limit'];var _0x35d8e7;if(_0x4b168f>=_0x2d656f){_0x4b168f=_0x2d656f;_0x35d8e7=0xc8;}else{_0x35d8e7=0xce;}_0x27f377['status'](_0x35d8e7);return _0x27f377[_0x0bd9('0x21')]('Content-Range',_0x2ecd4f+'-'+_0x4b168f+'/'+_0x2d656f)[_0x0bd9('0x22')](_0x30157c);}return null;};}function patchUpdates(_0x547e6e){return function(_0x21a200){try{jsonpatch[_0x0bd9('0x23')](_0x21a200,_0x547e6e,!![]);}catch(_0x5a2b57){return BPromise[_0x0bd9('0x24')](_0x5a2b57);}return _0x21a200[_0x0bd9('0x25')]();};}function saveUpdates(_0x30c715,_0x1bf9a5){return function(_0xc005c4){if(_0xc005c4){return _0xc005c4[_0x0bd9('0x26')](_0x30c715)['then'](function(_0x1b0522){return _0x1b0522;});}return null;};}function removeEntity(_0x375659,_0x178702){return function(_0xbdac14){if(_0xbdac14){return _0xbdac14['destroy']()[_0x0bd9('0x27')](function(){_0x375659[_0x0bd9('0x1d')](0xcc)[_0x0bd9('0x28')]();});}};}function handleEntityNotFound(_0x591fa3,_0x11ff09){return function(_0x57a7db){if(!_0x57a7db){_0x591fa3['sendStatus'](0x194);}return _0x57a7db;};}function handleError(_0x4950d6,_0x4c9895){_0x4c9895=_0x4c9895||0x1f4;return function(_0x86688c){logger[_0x0bd9('0x29')](_0x86688c[_0x0bd9('0x2a')]);if(_0x86688c[_0x0bd9('0x2b')]){delete _0x86688c['name'];}_0x4950d6[_0x0bd9('0x1d')](_0x4c9895)[_0x0bd9('0x2c')](_0x86688c);};}exports[_0x0bd9('0x2d')]=function(_0x4fd4a2,_0xde757d){var _0x2bc725={},_0x3e3115={},_0x3086c7={'count':0x0,'rows':[]};var _0x216844=_[_0x0bd9('0x2e')](db[_0x0bd9('0x2f')][_0x0bd9('0x30')],function(_0x5bb0d4){return{'name':_0x5bb0d4['fieldName'],'type':_0x5bb0d4[_0x0bd9('0x31')][_0x0bd9('0x32')]};});_0x3e3115[_0x0bd9('0x33')]=_['map'](_0x216844,_0x0bd9('0x2b'));_0x3e3115[_0x0bd9('0x34')]=_['keys'](_0x4fd4a2[_0x0bd9('0x34')]);_0x3e3115[_0x0bd9('0x35')]=_[_0x0bd9('0x36')](_0x3e3115['model'],_0x3e3115[_0x0bd9('0x34')]);_0x2bc725['attributes']=_[_0x0bd9('0x36')](_0x3e3115[_0x0bd9('0x33')],qs[_0x0bd9('0x37')](_0x4fd4a2[_0x0bd9('0x34')][_0x0bd9('0x37')]));_0x2bc725[_0x0bd9('0x38')]=_0x2bc725['attributes']['length']?_0x2bc725[_0x0bd9('0x38')]:_0x3e3115['model'];if(!_0x4fd4a2['query'][_0x0bd9('0x39')](_0x0bd9('0x3a'))){_0x2bc725['limit']=qs[_0x0bd9('0x3b')](_0x4fd4a2['query'][_0x0bd9('0x3b')]);_0x2bc725[_0x0bd9('0x20')]=qs[_0x0bd9('0x20')](_0x4fd4a2[_0x0bd9('0x34')]['offset']);}_0x2bc725['order']=qs[_0x0bd9('0x3c')](_0x4fd4a2[_0x0bd9('0x34')][_0x0bd9('0x3c')]);_0x2bc725[_0x0bd9('0x3d')]=qs['filters'](_[_0x0bd9('0x3e')](_0x4fd4a2[_0x0bd9('0x34')],_0x3e3115[_0x0bd9('0x35')]),_0x216844);if(_0x4fd4a2[_0x0bd9('0x34')][_0x0bd9('0x3f')]){_0x2bc725[_0x0bd9('0x3d')]=_['merge'](_0x2bc725['where'],{'$or':_[_0x0bd9('0x2e')](_0x216844,function(_0x432ca4){if(_0x432ca4[_0x0bd9('0x31')]!==_0x0bd9('0x40')){var _0x282175={};_0x282175[_0x432ca4[_0x0bd9('0x2b')]]={'$like':'%'+_0x4fd4a2[_0x0bd9('0x34')][_0x0bd9('0x3f')]+'%'};return _0x282175;}})});}_0x2bc725=_[_0x0bd9('0x41')]({},_0x2bc725,_0x4fd4a2[_0x0bd9('0x42')]);var _0x4a2ec3={'where':_0x2bc725['where']};return db['VtigerField']['count'](_0x4a2ec3)[_0x0bd9('0x27')](function(_0x3e35c1){_0x3086c7[_0x0bd9('0x1f')]=_0x3e35c1;if(_0x4fd4a2[_0x0bd9('0x34')][_0x0bd9('0x43')]){_0x2bc725[_0x0bd9('0x44')]=[{'all':!![]}];}return db[_0x0bd9('0x2f')][_0x0bd9('0x45')](_0x2bc725);})[_0x0bd9('0x27')](function(_0x2138cd){_0x3086c7[_0x0bd9('0x46')]=_0x2138cd;return _0x3086c7;})[_0x0bd9('0x27')](respondWithFilteredResult(_0xde757d,_0x2bc725))[_0x0bd9('0x47')](handleError(_0xde757d,null));};exports['show']=function(_0x44201f,_0x15caa2){var _0x11b8ca={'raw':!![],'where':{'id':_0x44201f[_0x0bd9('0x48')]['id']}},_0x4efb64={};_0x4efb64['model']=_['keys'](db[_0x0bd9('0x2f')][_0x0bd9('0x30')]);_0x4efb64[_0x0bd9('0x34')]=_[_0x0bd9('0x49')](_0x44201f[_0x0bd9('0x34')]);_0x4efb64[_0x0bd9('0x35')]=_[_0x0bd9('0x36')](_0x4efb64[_0x0bd9('0x33')],_0x4efb64[_0x0bd9('0x34')]);_0x11b8ca[_0x0bd9('0x38')]=_[_0x0bd9('0x36')](_0x4efb64['model'],qs[_0x0bd9('0x37')](_0x44201f[_0x0bd9('0x34')][_0x0bd9('0x37')]));_0x11b8ca[_0x0bd9('0x38')]=_0x11b8ca[_0x0bd9('0x38')][_0x0bd9('0x4a')]?_0x11b8ca[_0x0bd9('0x38')]:_0x4efb64[_0x0bd9('0x33')];if(_0x44201f[_0x0bd9('0x34')][_0x0bd9('0x43')]){_0x11b8ca[_0x0bd9('0x44')]=[{'all':!![]}];}_0x11b8ca=_[_0x0bd9('0x41')]({},_0x11b8ca,_0x44201f[_0x0bd9('0x42')]);return db[_0x0bd9('0x2f')][_0x0bd9('0x4b')](_0x11b8ca)[_0x0bd9('0x27')](handleEntityNotFound(_0x15caa2,null))[_0x0bd9('0x27')](respondWithResult(_0x15caa2,null))[_0x0bd9('0x47')](handleError(_0x15caa2,null));};exports[_0x0bd9('0x4c')]=function(_0x41bffd,_0x2ec3af){return db[_0x0bd9('0x2f')][_0x0bd9('0x4c')](_0x41bffd[_0x0bd9('0x4d')],{})[_0x0bd9('0x27')](respondWithResult(_0x2ec3af,0xc9))[_0x0bd9('0x47')](handleError(_0x2ec3af,null));};exports[_0x0bd9('0x26')]=function(_0x5b3661,_0x428af7){if(_0x5b3661[_0x0bd9('0x4d')]['id']){delete _0x5b3661[_0x0bd9('0x4d')]['id'];}return db[_0x0bd9('0x2f')]['find']({'where':{'id':_0x5b3661[_0x0bd9('0x48')]['id']}})[_0x0bd9('0x27')](handleEntityNotFound(_0x428af7,null))[_0x0bd9('0x27')](saveUpdates(_0x5b3661[_0x0bd9('0x4d')],null))['then'](respondWithResult(_0x428af7,null))[_0x0bd9('0x47')](handleError(_0x428af7,null));};exports[_0x0bd9('0x4e')]=function(_0x45ebd6,_0x511caa){return db['VtigerField'][_0x0bd9('0x4b')]({'where':{'id':_0x45ebd6[_0x0bd9('0x48')]['id']}})[_0x0bd9('0x27')](handleEntityNotFound(_0x511caa,null))[_0x0bd9('0x27')](removeEntity(_0x511caa,null))['catch'](handleError(_0x511caa,null));}; \ No newline at end of file +var _0x06ab=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','VtigerField','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end'];(function(_0x35658a,_0x2cc9d8){var _0x1c23df=function(_0x10f363){while(--_0x10f363){_0x35658a['push'](_0x35658a['shift']());}};_0x1c23df(++_0x2cc9d8);}(_0x06ab,0x148));var _0xb06a=function(_0x385477,_0x47f754){_0x385477=_0x385477-0x0;var _0x1dc9cf=_0x06ab[_0x385477];return _0x1dc9cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb06a('0x0'));var jsonpatch=require(_0xb06a('0x1'));var rp=require(_0xb06a('0x2'));var moment=require(_0xb06a('0x3'));var BPromise=require(_0xb06a('0x4'));var Mustache=require('mustache');var util=require(_0xb06a('0x5'));var path=require(_0xb06a('0x6'));var sox=require(_0xb06a('0x7'));var csv=require(_0xb06a('0x8'));var ejs=require(_0xb06a('0x9'));var fs=require('fs');var fs_extra=require(_0xb06a('0xa'));var _=require(_0xb06a('0xb'));var squel=require(_0xb06a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb06a('0xd'));var deskjs=require(_0xb06a('0xe'));var toCsv=require(_0xb06a('0x8'));var querystring=require(_0xb06a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb06a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb06a('0x11'));var logger=require('../../config/logger')(_0xb06a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb06a('0x13'))['db'];function respondWithStatusCode(_0x29c98c,_0x8f7ff4){_0x8f7ff4=_0x8f7ff4||0xcc;return function(_0x43ff4f){if(_0x43ff4f){return _0x29c98c['sendStatus'](_0x8f7ff4);}return _0x29c98c[_0xb06a('0x14')](_0x8f7ff4)[_0xb06a('0x15')]();};}function respondWithResult(_0x1937e2,_0x418266){_0x418266=_0x418266||0xc8;return function(_0x3a5b08){if(_0x3a5b08){return _0x1937e2[_0xb06a('0x14')](_0x418266)[_0xb06a('0x16')](_0x3a5b08);}};}function respondWithFilteredResult(_0x1a8d72,_0x1b162d){return function(_0x20f6b2){if(_0x20f6b2){var _0x519c22=typeof _0x1b162d[_0xb06a('0x17')]===_0xb06a('0x18')&&typeof _0x1b162d[_0xb06a('0x19')]===_0xb06a('0x18');var _0x4e3a70=_0x20f6b2[_0xb06a('0x1a')];var _0x200e7a=_0x519c22?0x0:_0x1b162d['offset'];var _0x128f30=_0x519c22?_0x20f6b2[_0xb06a('0x1a')]:_0x1b162d[_0xb06a('0x17')]+_0x1b162d[_0xb06a('0x19')];var _0x3a0623;if(_0x128f30>=_0x4e3a70){_0x128f30=_0x4e3a70;_0x3a0623=0xc8;}else{_0x3a0623=0xce;}_0x1a8d72[_0xb06a('0x14')](_0x3a0623);return _0x1a8d72['set'](_0xb06a('0x1b'),_0x200e7a+'-'+_0x128f30+'/'+_0x4e3a70)[_0xb06a('0x16')](_0x20f6b2);}return null;};}function patchUpdates(_0x4dff95){return function(_0x11468e){try{jsonpatch[_0xb06a('0x1c')](_0x11468e,_0x4dff95,!![]);}catch(_0x5ab3c7){return BPromise[_0xb06a('0x1d')](_0x5ab3c7);}return _0x11468e[_0xb06a('0x1e')]();};}function saveUpdates(_0x1643f1,_0x358873){return function(_0x4574ea){if(_0x4574ea){return _0x4574ea[_0xb06a('0x1f')](_0x1643f1)[_0xb06a('0x20')](function(_0x20575f){return _0x20575f;});}return null;};}function removeEntity(_0xdb64b2,_0x41abbd){return function(_0x52760a){if(_0x52760a){return _0x52760a[_0xb06a('0x21')]()[_0xb06a('0x20')](function(){_0xdb64b2[_0xb06a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x342a32,_0xecf57f){return function(_0x23c948){if(!_0x23c948){_0x342a32[_0xb06a('0x22')](0x194);}return _0x23c948;};}function handleError(_0x4c566c,_0x2d04a4){_0x2d04a4=_0x2d04a4||0x1f4;return function(_0x99bd){logger[_0xb06a('0x23')](_0x99bd[_0xb06a('0x24')]);if(_0x99bd[_0xb06a('0x25')]){delete _0x99bd['name'];}_0x4c566c[_0xb06a('0x14')](_0x2d04a4)['send'](_0x99bd);};}exports[_0xb06a('0x26')]=function(_0x1f7a77,_0x576ae8){var _0x465263={},_0x415cdf={},_0x2fa5ba={'count':0x0,'rows':[]};var _0x23a4a1=_[_0xb06a('0x27')](db['VtigerField'][_0xb06a('0x28')],function(_0x4d0dfb){return{'name':_0x4d0dfb[_0xb06a('0x29')],'type':_0x4d0dfb[_0xb06a('0x2a')][_0xb06a('0x2b')]};});_0x415cdf[_0xb06a('0x2c')]=_['map'](_0x23a4a1,_0xb06a('0x25'));_0x415cdf['query']=_[_0xb06a('0x2d')](_0x1f7a77[_0xb06a('0x2e')]);_0x415cdf[_0xb06a('0x2f')]=_[_0xb06a('0x30')](_0x415cdf[_0xb06a('0x2c')],_0x415cdf[_0xb06a('0x2e')]);_0x465263[_0xb06a('0x31')]=_['intersection'](_0x415cdf['model'],qs[_0xb06a('0x32')](_0x1f7a77[_0xb06a('0x2e')][_0xb06a('0x32')]));_0x465263[_0xb06a('0x31')]=_0x465263[_0xb06a('0x31')][_0xb06a('0x33')]?_0x465263[_0xb06a('0x31')]:_0x415cdf[_0xb06a('0x2c')];if(!_0x1f7a77['query'][_0xb06a('0x34')](_0xb06a('0x35'))){_0x465263[_0xb06a('0x19')]=qs[_0xb06a('0x19')](_0x1f7a77['query'][_0xb06a('0x19')]);_0x465263['offset']=qs[_0xb06a('0x17')](_0x1f7a77[_0xb06a('0x2e')][_0xb06a('0x17')]);}_0x465263['order']=qs[_0xb06a('0x36')](_0x1f7a77['query'][_0xb06a('0x36')]);_0x465263[_0xb06a('0x37')]=qs[_0xb06a('0x2f')](_[_0xb06a('0x38')](_0x1f7a77[_0xb06a('0x2e')],_0x415cdf['filters']),_0x23a4a1);if(_0x1f7a77['query'][_0xb06a('0x39')]){_0x465263[_0xb06a('0x37')]=_[_0xb06a('0x3a')](_0x465263['where'],{'$or':_[_0xb06a('0x27')](_0x23a4a1,function(_0xafd21b){if(_0xafd21b[_0xb06a('0x2a')]!==_0xb06a('0x3b')){var _0x44413e={};_0x44413e[_0xafd21b[_0xb06a('0x25')]]={'$like':'%'+_0x1f7a77[_0xb06a('0x2e')][_0xb06a('0x39')]+'%'};return _0x44413e;}})});}_0x465263=_[_0xb06a('0x3a')]({},_0x465263,_0x1f7a77['options']);var _0x486482={'where':_0x465263['where']};return db['VtigerField']['count'](_0x486482)[_0xb06a('0x20')](function(_0x294abc){_0x2fa5ba[_0xb06a('0x1a')]=_0x294abc;if(_0x1f7a77[_0xb06a('0x2e')][_0xb06a('0x3c')]){_0x465263[_0xb06a('0x3d')]=[{'all':!![]}];}return db[_0xb06a('0x3e')]['findAll'](_0x465263);})['then'](function(_0x3c43cb){_0x2fa5ba[_0xb06a('0x3f')]=_0x3c43cb;return _0x2fa5ba;})[_0xb06a('0x20')](respondWithFilteredResult(_0x576ae8,_0x465263))[_0xb06a('0x40')](handleError(_0x576ae8,null));};exports[_0xb06a('0x41')]=function(_0x6fda0b,_0x25711f){var _0x30a17e={'raw':!![],'where':{'id':_0x6fda0b[_0xb06a('0x42')]['id']}},_0x4c3ed0={};_0x4c3ed0['model']=_[_0xb06a('0x2d')](db[_0xb06a('0x3e')][_0xb06a('0x28')]);_0x4c3ed0[_0xb06a('0x2e')]=_[_0xb06a('0x2d')](_0x6fda0b[_0xb06a('0x2e')]);_0x4c3ed0[_0xb06a('0x2f')]=_[_0xb06a('0x30')](_0x4c3ed0[_0xb06a('0x2c')],_0x4c3ed0[_0xb06a('0x2e')]);_0x30a17e[_0xb06a('0x31')]=_[_0xb06a('0x30')](_0x4c3ed0[_0xb06a('0x2c')],qs['fields'](_0x6fda0b[_0xb06a('0x2e')]['fields']));_0x30a17e['attributes']=_0x30a17e[_0xb06a('0x31')]['length']?_0x30a17e[_0xb06a('0x31')]:_0x4c3ed0[_0xb06a('0x2c')];if(_0x6fda0b[_0xb06a('0x2e')][_0xb06a('0x3c')]){_0x30a17e[_0xb06a('0x3d')]=[{'all':!![]}];}_0x30a17e=_[_0xb06a('0x3a')]({},_0x30a17e,_0x6fda0b['options']);return db[_0xb06a('0x3e')][_0xb06a('0x43')](_0x30a17e)['then'](handleEntityNotFound(_0x25711f,null))[_0xb06a('0x20')](respondWithResult(_0x25711f,null))[_0xb06a('0x40')](handleError(_0x25711f,null));};exports[_0xb06a('0x44')]=function(_0x42d220,_0x2d596c){return db[_0xb06a('0x3e')][_0xb06a('0x44')](_0x42d220[_0xb06a('0x45')],{})[_0xb06a('0x20')](respondWithResult(_0x2d596c,0xc9))[_0xb06a('0x40')](handleError(_0x2d596c,null));};exports[_0xb06a('0x1f')]=function(_0x601933,_0xe4e0f1){if(_0x601933['body']['id']){delete _0x601933['body']['id'];}return db['VtigerField'][_0xb06a('0x43')]({'where':{'id':_0x601933[_0xb06a('0x42')]['id']}})[_0xb06a('0x20')](handleEntityNotFound(_0xe4e0f1,null))[_0xb06a('0x20')](saveUpdates(_0x601933['body'],null))[_0xb06a('0x20')](respondWithResult(_0xe4e0f1,null))['catch'](handleError(_0xe4e0f1,null));};exports[_0xb06a('0x21')]=function(_0x4610ec,_0x3f8570){return db[_0xb06a('0x3e')][_0xb06a('0x43')]({'where':{'id':_0x4610ec[_0xb06a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f8570,null))[_0xb06a('0x20')](removeEntity(_0x3f8570,null))[_0xb06a('0x40')](handleError(_0x3f8570,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5649da2..fb69e95 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 _0x1e73=['vtiger_unique_index','idField','FieldId','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields'];(function(_0x1a8c0b,_0x5a30fd){var _0x555ea5=function(_0x4d43eb){while(--_0x4d43eb){_0x1a8c0b['push'](_0x1a8c0b['shift']());}};_0x555ea5(++_0x5a30fd);}(_0x1e73,0x183));var _0x31e7=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x1e73[_0x38fb8b];return _0x1ec681;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x31e7('0x0'));var BPromise=require(_0x31e7('0x1'));var rp=require(_0x31e7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31e7('0x3'));var config=require(_0x31e7('0x4'));var attributes=require('./intVtigerField.attributes');module[_0x31e7('0x5')]=function(_0x1a3b82,_0xcf1599){return _0x1a3b82[_0x31e7('0x6')](_0x31e7('0x7'),attributes,{'tableName':_0x31e7('0x8'),'paranoid':![],'indexes':[{'name':_0x31e7('0x9'),'fields':[_0x31e7('0xa'),_0x31e7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0259=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','idField','FieldId','lodash'];(function(_0x1deecb,_0x535405){var _0x1a6903=function(_0x1a2e6f){while(--_0x1a2e6f){_0x1deecb['push'](_0x1deecb['shift']());}};_0x1a6903(++_0x535405);}(_0x0259,0xe9));var _0x9025=function(_0x538c83,_0x5b2b93){_0x538c83=_0x538c83-0x0;var _0xc7734e=_0x0259[_0x538c83];return _0xc7734e;};'use strict';var _=require(_0x9025('0x0'));var util=require(_0x9025('0x1'));var logger=require(_0x9025('0x2'))(_0x9025('0x3'));var moment=require('moment');var BPromise=require(_0x9025('0x4'));var rp=require(_0x9025('0x5'));var fs=require('fs');var path=require(_0x9025('0x6'));var rimraf=require(_0x9025('0x7'));var config=require('../../config/environment');var attributes=require(_0x9025('0x8'));module[_0x9025('0x9')]=function(_0x2ce830,_0x5aabd9){return _0x2ce830[_0x9025('0xa')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x9025('0xb'),_0x9025('0xc')],'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 a2ba9df..1ac61b9 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 _0xf023=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xf023,0x90));var _0x3f02=function(_0x34941d,_0x18776e){_0x34941d=_0x34941d-0x0;var _0x592e6b=_0xf023[_0x34941d];return _0x592e6b;};'use strict';var _=require(_0x3f02('0x0'));var util=require('util');var moment=require(_0x3f02('0x1'));var BPromise=require(_0x3f02('0x2'));var rs=require(_0x3f02('0x3'));var fs=require('fs');var Redis=require(_0x3f02('0x4'));var db=require(_0x3f02('0x5'))['db'];var utils=require(_0x3f02('0x6'));var logger=require(_0x3f02('0x7'))(_0x3f02('0x8'));var config=require(_0x3f02('0x9'));var jayson=require(_0x3f02('0xa'));var client=jayson['client'][_0x3f02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39bc43,_0x597354,_0x50e3d9){return new BPromise(function(_0x450337,_0x505dbd){return client[_0x3f02('0xc')](_0x39bc43,_0x50e3d9)[_0x3f02('0xd')](function(_0x2425bf){logger[_0x3f02('0xe')](_0x3f02('0xf'),_0x597354,_0x3f02('0x10'));logger[_0x3f02('0x11')](_0x3f02('0x12'),_0x597354,_0x3f02('0x10'),JSON[_0x3f02('0x13')](_0x2425bf));if(_0x2425bf['error']){if(_0x2425bf['error'][_0x3f02('0x14')]===0x1f4){logger[_0x3f02('0x15')](_0x3f02('0xf'),_0x597354,_0x2425bf[_0x3f02('0x15')]['message']);return _0x505dbd(_0x2425bf[_0x3f02('0x15')]['message']);}logger['error'](_0x3f02('0xf'),_0x597354,_0x2425bf[_0x3f02('0x15')]['message']);return _0x450337(_0x2425bf['error'][_0x3f02('0x16')]);}else{logger[_0x3f02('0xe')]('VtigerField,\x20%s,\x20%s',_0x597354,_0x3f02('0x10'));_0x450337(_0x2425bf[_0x3f02('0x17')][_0x3f02('0x16')]);}})[_0x3f02('0x18')](function(_0x1c0d6f){logger[_0x3f02('0x15')](_0x3f02('0xf'),_0x597354,_0x1c0d6f);_0x505dbd(_0x1c0d6f);});});} \ No newline at end of file +var _0x09b1=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1c6eb1,_0x5d90b4){var _0x6cae93=function(_0x26f2da){while(--_0x26f2da){_0x1c6eb1['push'](_0x1c6eb1['shift']());}};_0x6cae93(++_0x5d90b4);}(_0x09b1,0x9b));var _0x109b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x09b1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x109b('0x0'));var util=require('util');var moment=require(_0x109b('0x1'));var BPromise=require(_0x109b('0x2'));var rs=require(_0x109b('0x3'));var fs=require('fs');var Redis=require(_0x109b('0x4'));var db=require(_0x109b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x109b('0x6'))(_0x109b('0x7'));var config=require(_0x109b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x109b('0x9')][_0x109b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41c3a7,_0x33a535,_0x226522){return new BPromise(function(_0x1a2f46,_0x40d452){return client[_0x109b('0xb')](_0x41c3a7,_0x226522)[_0x109b('0xc')](function(_0x3dc8e6){logger[_0x109b('0xd')](_0x109b('0xe'),_0x33a535,_0x109b('0xf'));logger[_0x109b('0x10')](_0x109b('0x11'),_0x33a535,_0x109b('0xf'),JSON[_0x109b('0x12')](_0x3dc8e6));if(_0x3dc8e6[_0x109b('0x13')]){if(_0x3dc8e6[_0x109b('0x13')][_0x109b('0x14')]===0x1f4){logger[_0x109b('0x13')](_0x109b('0xe'),_0x33a535,_0x3dc8e6[_0x109b('0x13')][_0x109b('0x15')]);return _0x40d452(_0x3dc8e6[_0x109b('0x13')][_0x109b('0x15')]);}logger[_0x109b('0x13')](_0x109b('0xe'),_0x33a535,_0x3dc8e6[_0x109b('0x13')][_0x109b('0x15')]);return _0x1a2f46(_0x3dc8e6['error']['message']);}else{logger['info'](_0x109b('0xe'),_0x33a535,_0x109b('0xf'));_0x1a2f46(_0x3dc8e6[_0x109b('0x16')][_0x109b('0x15')]);}})[_0x109b('0x17')](function(_0x3d6136){logger[_0x109b('0x13')]('VtigerField,\x20%s,\x20%s',_0x33a535,_0x3d6136);_0x40d452(_0x3d6136);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d773ee1..6148955 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 _0x9199=['addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','post'];(function(_0x41ac49,_0x4c53df){var _0x278f7c=function(_0x282bbe){while(--_0x282bbe){_0x41ac49['push'](_0x41ac49['shift']());}};_0x278f7c(++_0x4c53df);}(_0x9199,0x1e9));var _0x9919=function(_0x784d87,_0x4f0284){_0x784d87=_0x784d87-0x0;var _0x22e453=_0x9199[_0x784d87];return _0x22e453;};'use strict';var multer=require(_0x9919('0x0'));var util=require(_0x9919('0x1'));var path=require('path');var timeout=require(_0x9919('0x2'));var express=require('express');var router=express[_0x9919('0x3')]();var fs_extra=require(_0x9919('0x4'));var auth=require(_0x9919('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9919('0x6'));var controller=require(_0x9919('0x7'));router[_0x9919('0x8')]('/',auth['isAuthenticated'](),controller[_0x9919('0x9')]);router[_0x9919('0x8')](_0x9919('0xa'),auth['isAuthenticated'](),controller[_0x9919('0xb')]);router['get'](_0x9919('0xc'),auth['isAuthenticated'](),controller[_0x9919('0xd')]);router['get'](_0x9919('0xe'),auth[_0x9919('0xf')](),controller['getFields']);router[_0x9919('0x10')]('/',auth[_0x9919('0xf')](),controller['create']);router[_0x9919('0x10')](_0x9919('0xc'),auth['isAuthenticated'](),controller[_0x9919('0x11')]);router[_0x9919('0x12')]('/:id',auth[_0x9919('0xf')](),controller[_0x9919('0x13')]);router[_0x9919('0x14')](_0x9919('0xa'),auth[_0x9919('0xf')](),controller[_0x9919('0x15')]);module[_0x9919('0x16')]=router; \ No newline at end of file +var _0x567f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x567f,0x1d9));var _0xf567=function(_0x4b25e3,_0x33a600){_0x4b25e3=_0x4b25e3-0x0;var _0x1596c6=_0x567f[_0x4b25e3];return _0x1596c6;};'use strict';var multer=require(_0xf567('0x0'));var util=require('util');var path=require(_0xf567('0x1'));var timeout=require(_0xf567('0x2'));var express=require(_0xf567('0x3'));var router=express[_0xf567('0x4')]();var fs_extra=require(_0xf567('0x5'));var auth=require(_0xf567('0x6'));var interaction=require(_0xf567('0x7'));var config=require(_0xf567('0x8'));var controller=require('./intZendeskAccount.controller');router[_0xf567('0x9')]('/',auth[_0xf567('0xa')](),controller['index']);router['get'](_0xf567('0xb'),auth[_0xf567('0xa')](),controller[_0xf567('0xc')]);router[_0xf567('0x9')]('/:id/configurations',auth[_0xf567('0xa')](),controller[_0xf567('0xd')]);router['get']('/:id/fields',auth[_0xf567('0xa')](),controller[_0xf567('0xe')]);router[_0xf567('0xf')]('/',auth[_0xf567('0xa')](),controller['create']);router[_0xf567('0xf')](_0xf567('0x10'),auth[_0xf567('0xa')](),controller[_0xf567('0x11')]);router[_0xf567('0x12')](_0xf567('0xb'),auth[_0xf567('0xa')](),controller['update']);router['delete'](_0xf567('0xb'),auth[_0xf567('0xa')](),controller[_0xf567('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index d7a31b2..70c0e3a 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 _0xcd05=['username','remoteUri','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x163417,_0x396d13){var _0x4eedd8=function(_0x468edc){while(--_0x468edc){_0x163417['push'](_0x163417['shift']());}};_0x4eedd8(++_0x396d13);}(_0xcd05,0x163));var _0x5cd0=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xcd05[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x5cd0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5cd0('0x1')],'unique':_0x5cd0('0x2')},'password':{'type':Sequelize[_0x5cd0('0x1')]},'token':{'type':Sequelize[_0x5cd0('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5cd0('0x3')},'authType':{'type':Sequelize[_0x5cd0('0x4')]('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x5cd0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5cd0('0x4')](_0x5cd0('0x5'),_0x5cd0('0x6')),'defaultValue':_0x5cd0('0x5')}}; \ No newline at end of file +var _0xcf98=['remoteUri','ENUM','password','token','integrationTab','newTab','exports','STRING','username'];(function(_0x4b6be3,_0x53b2a1){var _0x100c41=function(_0x5d6557){while(--_0x5d6557){_0x4b6be3['push'](_0x4b6be3['shift']());}};_0x100c41(++_0x53b2a1);}(_0xcf98,0x8d));var _0x8cf9=function(_0xe41f02,_0x500ff1){_0xe41f02=_0xe41f02-0x0;var _0x1cd0fc=_0xcf98[_0xe41f02];return _0x1cd0fc;};'use strict';var Sequelize=require('sequelize');module[_0x8cf9('0x0')]={'name':{'type':Sequelize[_0x8cf9('0x1')]},'description':{'type':Sequelize[_0x8cf9('0x1')]},'username':{'type':Sequelize[_0x8cf9('0x1')],'unique':_0x8cf9('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8cf9('0x1')],'unique':_0x8cf9('0x3')},'authType':{'type':Sequelize[_0x8cf9('0x4')](_0x8cf9('0x5'),_0x8cf9('0x6')),'defaultValue':_0x8cf9('0x5')},'serverUrl':{'type':Sequelize[_0x8cf9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8cf9('0x4')](_0x8cf9('0x7'),_0x8cf9('0x8')),'defaultValue':_0x8cf9('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 387fd32..1adcc30 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 _0x04b8=['lodash','squel','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','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0xe95d0f,_0x4d126c){var _0x5eaf6f=function(_0x4e0f2d){while(--_0x4e0f2d){_0xe95d0f['push'](_0xe95d0f['shift']());}};_0x5eaf6f(++_0x4d126c);}(_0x04b8,0x159));var _0x804b=function(_0x276cf2,_0x55f712){_0x276cf2=_0x276cf2-0x0;var _0xbc2037=_0x04b8[_0x276cf2];return _0xbc2037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['ZendeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['ZendeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['ZendeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['ZendeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['ZendeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['ZendeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['ZendeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58'),_0x804b('0x59'),'authType',_0x804b('0x5a')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x2541cd){if(_0x2541cd){_0x39ed3c=_0x2541cd[_0x804b('0x5a')];var _0x549504=_0x39ed3c[_0x804b('0x5b')](-0x1);if(_0x549504==='/'){_0x39ed3c=_0x39ed3c['substring'](0x0,_0x39ed3c[_0x804b('0x5c')](_0x549504));}var _0x3e2813={'method':_0x804b('0x5d'),'uri':util[_0x804b('0x5e')](_0x804b('0x5f'),_0x39ed3c,_0x804b('0x60')),'json':!![]};switch(_0x2541cd[_0x804b('0x61')]){case'password':_0x3e2813[_0x804b('0x62')]={'Authorization':util['format'](_0x804b('0x63'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x64'),_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x58')]))[_0x804b('0x65')](_0x804b('0x66')))};break;case _0x804b('0x59'):_0x3e2813[_0x804b('0x62')]={'Authorization':util[_0x804b('0x5e')](_0x804b('0x63'),new Buffer(util['format']('%s/token:%s',_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x59')]))[_0x804b('0x65')](_0x804b('0x66')))};break;default:throw new db['Sequelize'][(_0x804b('0x67'))](_0x804b('0x68'));}return rp(_0x3e2813);}})[_0x804b('0x26')](function(_0x3dda89){if(_0x3dda89){var _0x260419=[_0x804b('0x69'),_0x804b('0x6a'),_0x804b('0x6b'),_0x804b('0x6c')];_[_0x804b('0x6d')](_0x3dda89['ticket_fields'],function(_0x5a6661){return _0x260419[_0x804b('0x6e')](_0x5a6661[_0x804b('0x2e')]);});return{'count':_0x3dda89['ticket_fields'][_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x3dda89['ticket_fields'],function(_0x345bf7){return{'id':_0x345bf7['id'],'name':_0x345bf7['position']>0x7?_0x345bf7['title']:_0x345bf7[_0x804b('0x2e')],'custom':_0x345bf7[_0x804b('0x6f')]>0x7?!![]:![],'options':_0x345bf7['system_field_options']?_0x345bf7['system_field_options']:_0x345bf7[_0x804b('0x70')]?_0x345bf7[_0x804b('0x70')]:[]};})};}})['then'](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x5e2756){var _0x42dfc3=_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?0x1f4:_0x5e2756['statusCode']||0x1f4;logger[_0x804b('0x72')](_0x804b('0x73'),_0x804b('0x56'),_0x42dfc3,JSON[_0x804b('0x74')](_0x5e2756));delete _0x5e2756[_0x804b('0x2a')];if(_0x42dfc3===0x191){_0x42dfc3=0x190;}_0x1bb4ec[_0x804b('0x1a')](_0x42dfc3)[_0x804b('0x2b')](_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?{'message':_0x804b('0x75'),'statusCode':_0x5e2756['statusCode']}:_0x5e2756);});}; \ No newline at end of file +var _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x4442cc,_0x4b8f77){var _0x5efbbe=function(_0x12de1a){while(--_0x12de1a){_0x4442cc['push'](_0x4442cc['shift']());}};_0x5efbbe(++_0x4b8f77);}(_0x351d,0x90));var _0xd351=function(_0x528f56,_0x5ce18c){_0x528f56=_0x528f56-0x0;var _0x36cd0e=_0x351d[_0x528f56];return _0x36cd0e;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7509dad..335244f 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 _0xbc51=['rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x541b6b,_0xe0402b){var _0x2cde60=function(_0x372e29){while(--_0x372e29){_0x541b6b['push'](_0x541b6b['shift']());}};_0x2cde60(++_0xe0402b);}(_0xbc51,0x13b));var _0x1bc5=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xbc51[_0x10dfdf];return _0x4d857d;};'use strict';var _=require(_0x1bc5('0x0'));var util=require(_0x1bc5('0x1'));var logger=require(_0x1bc5('0x2'))(_0x1bc5('0x3'));var moment=require(_0x1bc5('0x4'));var BPromise=require('bluebird');var rp=require(_0x1bc5('0x5'));var fs=require('fs');var path=require(_0x1bc5('0x6'));var rimraf=require(_0x1bc5('0x7'));var config=require(_0x1bc5('0x8'));var attributes=require(_0x1bc5('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x1bc5('0xa')]=function(_0x434150,_0x510d47){return _0x434150[_0x1bc5('0xb')](_0x1bc5('0xc'),attributes,{'tableName':_0x1bc5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2099=['path','rimraf','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','util','api','moment','bluebird'];(function(_0x2e9ba3,_0x3efbcb){var _0x24cbfe=function(_0x3270f2){while(--_0x3270f2){_0x2e9ba3['push'](_0x2e9ba3['shift']());}};_0x24cbfe(++_0x3efbcb);}(_0x2099,0x172));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x9209('0x0'));var logger=require('../../config/logger')(_0x9209('0x1'));var moment=require(_0x9209('0x2'));var BPromise=require(_0x9209('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9209('0x4'));var rimraf=require(_0x9209('0x5'));var config=require('../../config/environment');var attributes=require(_0x9209('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x9209('0x7')]=function(_0x2f1dfa,_0x51b9c3){return _0x2f1dfa[_0x9209('0x8')](_0x9209('0x9'),attributes,{'tableName':_0x9209('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index dd4d047..e2483b3 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 _0xf794=['../../config/environment','jayson/promise','client','request','info','ZendeskAccount,\x20%s,\x20%s','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','include','model','map','then','ShowZendeskAccount','find','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x28e714,_0x1ca825){var _0x2c3bf2=function(_0x2e0af6){while(--_0x2e0af6){_0x28e714['push'](_0x28e714['shift']());}};_0x2c3bf2(++_0x1ca825);}(_0xf794,0x129));var _0x4f79=function(_0x3df46e,_0x329d78){_0x3df46e=_0x3df46e-0x0;var _0x45d47a=_0xf794[_0x3df46e];return _0x45d47a;};'use strict';var _=require(_0x4f79('0x0'));var util=require(_0x4f79('0x1'));var moment=require(_0x4f79('0x2'));var BPromise=require(_0x4f79('0x3'));var rs=require(_0x4f79('0x4'));var fs=require('fs');var Redis=require(_0x4f79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f79('0x6'));var logger=require(_0x4f79('0x7'))(_0x4f79('0x8'));var config=require(_0x4f79('0x9'));var jayson=require(_0x4f79('0xa'));var client=jayson[_0x4f79('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0dce,_0x31873b,_0x2a0fa8){return new BPromise(function(_0xdebb54,_0x48b369){return client[_0x4f79('0xc')](_0x4b0dce,_0x2a0fa8)['then'](function(_0x912d17){logger[_0x4f79('0xd')](_0x4f79('0xe'),_0x31873b,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x31873b,'request\x20sent',JSON['stringify'](_0x912d17));if(_0x912d17['error']){if(_0x912d17[_0x4f79('0xf')][_0x4f79('0x10')]===0x1f4){logger['error'](_0x4f79('0xe'),_0x31873b,_0x912d17[_0x4f79('0xf')]['message']);return _0x48b369(_0x912d17[_0x4f79('0xf')][_0x4f79('0x11')]);}logger[_0x4f79('0xf')](_0x4f79('0xe'),_0x31873b,_0x912d17[_0x4f79('0xf')][_0x4f79('0x11')]);return _0xdebb54(_0x912d17[_0x4f79('0xf')][_0x4f79('0x11')]);}else{logger['info'](_0x4f79('0xe'),_0x31873b,'request\x20sent');_0xdebb54(_0x912d17['result']['message']);}})[_0x4f79('0x12')](function(_0x5beae3){logger[_0x4f79('0xf')](_0x4f79('0xe'),_0x31873b,_0x5beae3);_0x48b369(_0x5beae3);});});}exports[_0x4f79('0x13')]=function(_0x29a84d){var _0x20666e=this;return new Promise(function(_0x2de3a2,_0x358a53){return db[_0x4f79('0x14')][_0x4f79('0x15')]({'raw':_0x29a84d['options']?_0x29a84d[_0x4f79('0x16')][_0x4f79('0x17')]===undefined?!![]:![]:!![],'where':_0x29a84d[_0x4f79('0x16')]?_0x29a84d[_0x4f79('0x16')][_0x4f79('0x18')]||null:null,'attributes':_0x29a84d[_0x4f79('0x16')]?_0x29a84d[_0x4f79('0x16')][_0x4f79('0x19')]||null:null,'limit':_0x29a84d['options']?_0x29a84d['options']['limit']||null:null,'include':_0x29a84d['options']?_0x29a84d[_0x4f79('0x16')][_0x4f79('0x1a')]?_['map'](_0x29a84d[_0x4f79('0x16')][_0x4f79('0x1a')],function(_0x12952e){return{'model':db[_0x12952e[_0x4f79('0x1b')]],'as':_0x12952e['as'],'attributes':_0x12952e[_0x4f79('0x19')],'include':_0x12952e['include']?_[_0x4f79('0x1c')](_0x12952e[_0x4f79('0x1a')],function(_0x5d6a3d){return{'model':db[_0x5d6a3d[_0x4f79('0x1b')]],'as':_0x5d6a3d['as'],'attributes':_0x5d6a3d[_0x4f79('0x19')],'include':_0x5d6a3d['include']?_[_0x4f79('0x1c')](_0x5d6a3d[_0x4f79('0x1a')],function(_0x21c1c3){return{'model':db[_0x21c1c3[_0x4f79('0x1b')]],'as':_0x21c1c3['as'],'attributes':_0x21c1c3[_0x4f79('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4f79('0x1d')](function(_0x29475e){logger['info'](_0x4f79('0x13'),_0x29a84d);logger['debug'](_0x4f79('0x13'),_0x29a84d,JSON['stringify'](_0x29475e));_0x2de3a2(_0x29475e);})[_0x4f79('0x12')](function(_0x134f57){logger[_0x4f79('0xf')](_0x4f79('0x13'),_0x134f57['message'],_0x29a84d);_0x358a53(_0x20666e[_0x4f79('0xf')](0x1f4,_0x134f57[_0x4f79('0x11')]));});});};exports[_0x4f79('0x1e')]=function(_0x5a6ecb){var _0x24e527=this;return new Promise(function(_0x2608bb,_0x406206){return db['ZendeskAccount'][_0x4f79('0x1f')]({'raw':_0x5a6ecb[_0x4f79('0x16')]?_0x5a6ecb[_0x4f79('0x16')][_0x4f79('0x17')]===undefined?!![]:![]:!![],'where':_0x5a6ecb[_0x4f79('0x16')]?_0x5a6ecb[_0x4f79('0x16')][_0x4f79('0x18')]||null:null,'attributes':_0x5a6ecb['options']?_0x5a6ecb[_0x4f79('0x16')][_0x4f79('0x19')]||null:null,'include':_0x5a6ecb[_0x4f79('0x16')]?_0x5a6ecb[_0x4f79('0x16')][_0x4f79('0x1a')]?_[_0x4f79('0x1c')](_0x5a6ecb[_0x4f79('0x16')]['include'],function(_0x2fcfd0){return{'model':db[_0x2fcfd0[_0x4f79('0x1b')]],'as':_0x2fcfd0['as'],'attributes':_0x2fcfd0['attributes'],'include':_0x2fcfd0['include']?_[_0x4f79('0x1c')](_0x2fcfd0[_0x4f79('0x1a')],function(_0xdf59b0){return{'model':db[_0xdf59b0[_0x4f79('0x1b')]],'as':_0xdf59b0['as'],'attributes':_0xdf59b0[_0x4f79('0x19')],'include':_0xdf59b0[_0x4f79('0x1a')]?_[_0x4f79('0x1c')](_0xdf59b0[_0x4f79('0x1a')],function(_0xc1d986){return{'model':db[_0xc1d986[_0x4f79('0x1b')]],'as':_0xc1d986['as'],'attributes':_0xc1d986[_0x4f79('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4f79('0x1d')](function(_0x1a51ac){logger[_0x4f79('0xd')](_0x4f79('0x1e'),_0x5a6ecb);logger[_0x4f79('0x20')]('ShowZendeskAccount',_0x5a6ecb,JSON[_0x4f79('0x21')](_0x1a51ac));_0x2608bb(_0x1a51ac);})[_0x4f79('0x12')](function(_0x55814d){logger[_0x4f79('0xf')](_0x4f79('0x1e'),_0x55814d[_0x4f79('0x11')],_0x5a6ecb);_0x406206(_0x24e527[_0x4f79('0xf')](0x1f4,_0x55814d[_0x4f79('0x11')]));});});}; \ No newline at end of file +var _0x4eac=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','GetZendeskAccount','debug','catch','raw','then','ShowZendeskAccount','util','bluebird','randomstring','../../mysqldb'];(function(_0x5a0086,_0x590f24){var _0x5135a7=function(_0x504ec8){while(--_0x504ec8){_0x5a0086['push'](_0x5a0086['shift']());}};_0x5135a7(++_0x590f24);}(_0x4eac,0xf1));var _0xc4ea=function(_0x3fa833,_0x2df7e4){_0x3fa833=_0x3fa833-0x0;var _0x5c4361=_0x4eac[_0x3fa833];return _0x5c4361;};'use strict';var _=require('lodash');var util=require(_0xc4ea('0x0'));var moment=require('moment');var BPromise=require(_0xc4ea('0x1'));var rs=require(_0xc4ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4ea('0x3'))['db'];var utils=require(_0xc4ea('0x4'));var logger=require(_0xc4ea('0x5'))(_0xc4ea('0x6'));var config=require(_0xc4ea('0x7'));var jayson=require(_0xc4ea('0x8'));var client=jayson[_0xc4ea('0x9')][_0xc4ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23b5d2,_0x48d2f0,_0x270fec){return new BPromise(function(_0x277b27,_0x497752){return client[_0xc4ea('0xb')](_0x23b5d2,_0x270fec)['then'](function(_0x4b9489){logger[_0xc4ea('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x48d2f0,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x48d2f0,_0xc4ea('0xd'),JSON[_0xc4ea('0xe')](_0x4b9489));if(_0x4b9489[_0xc4ea('0xf')]){if(_0x4b9489['error'][_0xc4ea('0x10')]===0x1f4){logger[_0xc4ea('0xf')](_0xc4ea('0x11'),_0x48d2f0,_0x4b9489[_0xc4ea('0xf')][_0xc4ea('0x12')]);return _0x497752(_0x4b9489[_0xc4ea('0xf')][_0xc4ea('0x12')]);}logger[_0xc4ea('0xf')](_0xc4ea('0x11'),_0x48d2f0,_0x4b9489[_0xc4ea('0xf')][_0xc4ea('0x12')]);return _0x277b27(_0x4b9489['error'][_0xc4ea('0x12')]);}else{logger[_0xc4ea('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x48d2f0,_0xc4ea('0xd'));_0x277b27(_0x4b9489[_0xc4ea('0x13')][_0xc4ea('0x12')]);}})['catch'](function(_0x79d8ad){logger['error'](_0xc4ea('0x11'),_0x48d2f0,_0x79d8ad);_0x497752(_0x79d8ad);});});}exports['GetZendeskAccount']=function(_0x24f925){var _0x49031e=this;return new Promise(function(_0x3d4953,_0x586398){return db[_0xc4ea('0x14')][_0xc4ea('0x15')]({'raw':_0x24f925[_0xc4ea('0x16')]?_0x24f925[_0xc4ea('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x24f925['options']?_0x24f925['options'][_0xc4ea('0x17')]||null:null,'attributes':_0x24f925[_0xc4ea('0x16')]?_0x24f925[_0xc4ea('0x16')][_0xc4ea('0x18')]||null:null,'limit':_0x24f925[_0xc4ea('0x16')]?_0x24f925['options'][_0xc4ea('0x19')]||null:null,'include':_0x24f925[_0xc4ea('0x16')]?_0x24f925[_0xc4ea('0x16')][_0xc4ea('0x1a')]?_[_0xc4ea('0x1b')](_0x24f925[_0xc4ea('0x16')]['include'],function(_0x1eebbd){return{'model':db[_0x1eebbd[_0xc4ea('0x1c')]],'as':_0x1eebbd['as'],'attributes':_0x1eebbd['attributes'],'include':_0x1eebbd[_0xc4ea('0x1a')]?_['map'](_0x1eebbd['include'],function(_0x45822a){return{'model':db[_0x45822a[_0xc4ea('0x1c')]],'as':_0x45822a['as'],'attributes':_0x45822a[_0xc4ea('0x18')],'include':_0x45822a[_0xc4ea('0x1a')]?_[_0xc4ea('0x1b')](_0x45822a[_0xc4ea('0x1a')],function(_0x22a6a4){return{'model':db[_0x22a6a4[_0xc4ea('0x1c')]],'as':_0x22a6a4['as'],'attributes':_0x22a6a4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d1fee){logger[_0xc4ea('0xc')](_0xc4ea('0x1d'),_0x24f925);logger[_0xc4ea('0x1e')](_0xc4ea('0x1d'),_0x24f925,JSON[_0xc4ea('0xe')](_0x4d1fee));_0x3d4953(_0x4d1fee);})[_0xc4ea('0x1f')](function(_0x3f9b8b){logger[_0xc4ea('0xf')](_0xc4ea('0x1d'),_0x3f9b8b[_0xc4ea('0x12')],_0x24f925);_0x586398(_0x49031e['error'](0x1f4,_0x3f9b8b[_0xc4ea('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x311d44){var _0x23add8=this;return new Promise(function(_0x554c05,_0x930d6b){return db[_0xc4ea('0x14')]['find']({'raw':_0x311d44['options']?_0x311d44[_0xc4ea('0x16')][_0xc4ea('0x20')]===undefined?!![]:![]:!![],'where':_0x311d44[_0xc4ea('0x16')]?_0x311d44[_0xc4ea('0x16')][_0xc4ea('0x17')]||null:null,'attributes':_0x311d44[_0xc4ea('0x16')]?_0x311d44['options'][_0xc4ea('0x18')]||null:null,'include':_0x311d44[_0xc4ea('0x16')]?_0x311d44[_0xc4ea('0x16')]['include']?_[_0xc4ea('0x1b')](_0x311d44[_0xc4ea('0x16')][_0xc4ea('0x1a')],function(_0x5f3b57){return{'model':db[_0x5f3b57[_0xc4ea('0x1c')]],'as':_0x5f3b57['as'],'attributes':_0x5f3b57[_0xc4ea('0x18')],'include':_0x5f3b57[_0xc4ea('0x1a')]?_[_0xc4ea('0x1b')](_0x5f3b57[_0xc4ea('0x1a')],function(_0x43673d){return{'model':db[_0x43673d[_0xc4ea('0x1c')]],'as':_0x43673d['as'],'attributes':_0x43673d['attributes'],'include':_0x43673d[_0xc4ea('0x1a')]?_[_0xc4ea('0x1b')](_0x43673d[_0xc4ea('0x1a')],function(_0x4060f6){return{'model':db[_0x4060f6['model']],'as':_0x4060f6['as'],'attributes':_0x4060f6[_0xc4ea('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc4ea('0x21')](function(_0x6b5ece){logger[_0xc4ea('0xc')](_0xc4ea('0x22'),_0x311d44);logger[_0xc4ea('0x1e')](_0xc4ea('0x22'),_0x311d44,JSON[_0xc4ea('0xe')](_0x6b5ece));_0x554c05(_0x6b5ece);})[_0xc4ea('0x1f')](function(_0x5cebb3){logger[_0xc4ea('0xf')](_0xc4ea('0x22'),_0x5cebb3['message'],_0x311d44);_0x930d6b(_0x23add8[_0xc4ea('0xf')](0x1f4,_0x5cebb3[_0xc4ea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index aa82f48..5664bed 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 _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0xee9f81,_0x4b61f7){var _0x2c83f6=function(_0x5c6b56){while(--_0x5c6b56){_0xee9f81['push'](_0xee9f81['shift']());}};_0x2c83f6(++_0x4b61f7);}(_0x087b,0x11a));var _0xb087=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x087b[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x217b0b,_0x252484){var _0x5d570f=function(_0x389b43){while(--_0x389b43){_0x217b0b['push'](_0x217b0b['shift']());}};_0x5d570f(++_0x252484);}(_0x0bb5,0x148));var _0x50bb=function(_0x1398be,_0x30fe4e){_0x1398be=_0x1398be-0x0;var _0xe18123=_0x0bb5[_0x1398be];return _0xe18123;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index c6b366b..e36e752 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 _0x0f94=['exports','STRING','sequelize'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x0f94,0x1cd));var _0x40f9=function(_0x35922a,_0x3fa047){_0x35922a=_0x35922a-0x0;var _0x55aa1a=_0x0f94[_0x35922a];return _0x55aa1a;};'use strict';var Sequelize=require(_0x40f9('0x0'));module[_0x40f9('0x1')]={'name':{'type':Sequelize[_0x40f9('0x2')]},'description':{'type':Sequelize[_0x40f9('0x2')]}}; \ No newline at end of file +var _0xbed3=['STRING','exports'];(function(_0x35a3e9,_0x3aa4a4){var _0x181d62=function(_0x21c7f4){while(--_0x21c7f4){_0x35a3e9['push'](_0x35a3e9['shift']());}};_0x181d62(++_0x3aa4a4);}(_0xbed3,0xef));var _0x3bed=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbed3[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x3bed('0x0')]={'name':{'type':Sequelize[_0x3bed('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e47d358..d23ebba 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 _0xff9a=['where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter'];(function(_0x49fac0,_0x1c6c82){var _0x59b597=function(_0x4ac46c){while(--_0x4ac46c){_0x49fac0['push'](_0x49fac0['shift']());}};_0x59b597(++_0x1c6c82);}(_0xff9a,0x6a));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xaff9('0x0'));var rimraf=require(_0xaff9('0x1'));var zipdir=require(_0xaff9('0x2'));var jsonpatch=require(_0xaff9('0x3'));var rp=require('request-promise');var moment=require(_0xaff9('0x4'));var BPromise=require(_0xaff9('0x5'));var Mustache=require(_0xaff9('0x6'));var util=require(_0xaff9('0x7'));var path=require(_0xaff9('0x8'));var sox=require(_0xaff9('0x9'));var csv=require(_0xaff9('0xa'));var ejs=require(_0xaff9('0xb'));var fs=require('fs');var fs_extra=require(_0xaff9('0xc'));var _=require(_0xaff9('0xd'));var squel=require(_0xaff9('0xe'));var crypto=require(_0xaff9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xaff9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaff9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaff9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaff9('0x12'))(_0xaff9('0x13'));var utils=require(_0xaff9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xaff9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5983a3,_0x1b11f6){_0x1b11f6=_0x1b11f6||0xcc;return function(_0x319215){if(_0x319215){return _0x5983a3[_0xaff9('0x16')](_0x1b11f6);}return _0x5983a3[_0xaff9('0x17')](_0x1b11f6)[_0xaff9('0x18')]();};}function respondWithResult(_0x2984c7,_0x31225f){_0x31225f=_0x31225f||0xc8;return function(_0x2a5e12){if(_0x2a5e12){return _0x2984c7[_0xaff9('0x17')](_0x31225f)[_0xaff9('0x19')](_0x2a5e12);}};}function respondWithFilteredResult(_0x444254,_0x469c72){return function(_0x72e925){if(_0x72e925){var _0xc8a7d0=typeof _0x469c72[_0xaff9('0x1a')]===_0xaff9('0x1b')&&typeof _0x469c72['limit']===_0xaff9('0x1b');var _0xb932cf=_0x72e925[_0xaff9('0x1c')];var _0x10e22e=_0xc8a7d0?0x0:_0x469c72[_0xaff9('0x1a')];var _0x447121=_0xc8a7d0?_0x72e925[_0xaff9('0x1c')]:_0x469c72[_0xaff9('0x1a')]+_0x469c72['limit'];var _0x32b0e1;if(_0x447121>=_0xb932cf){_0x447121=_0xb932cf;_0x32b0e1=0xc8;}else{_0x32b0e1=0xce;}_0x444254[_0xaff9('0x17')](_0x32b0e1);return _0x444254[_0xaff9('0x1d')](_0xaff9('0x1e'),_0x10e22e+'-'+_0x447121+'/'+_0xb932cf)['json'](_0x72e925);}return null;};}function patchUpdates(_0x57c357){return function(_0x1ea654){try{jsonpatch[_0xaff9('0x1f')](_0x1ea654,_0x57c357,!![]);}catch(_0x47a95d){return BPromise[_0xaff9('0x20')](_0x47a95d);}return _0x1ea654[_0xaff9('0x21')]();};}function saveUpdates(_0x10a651,_0x33b337){return function(_0x395abf){if(_0x395abf){return _0x395abf[_0xaff9('0x22')](_0x10a651)[_0xaff9('0x23')](function(_0x57f7e9){return _0x57f7e9;});}return null;};}function removeEntity(_0x2fa5,_0x38df32){return function(_0x1f9187){if(_0x1f9187){return _0x1f9187['destroy']()[_0xaff9('0x23')](function(){_0x2fa5[_0xaff9('0x17')](0xcc)[_0xaff9('0x18')]();});}};}function handleEntityNotFound(_0x5e3b94,_0x2e22ae){return function(_0x405e80){if(!_0x405e80){_0x5e3b94[_0xaff9('0x16')](0x194);}return _0x405e80;};}function handleError(_0x40a7f6,_0x34fc13){_0x34fc13=_0x34fc13||0x1f4;return function(_0x2dff13){logger[_0xaff9('0x24')](_0x2dff13[_0xaff9('0x25')]);if(_0x2dff13[_0xaff9('0x26')]){delete _0x2dff13[_0xaff9('0x26')];}_0x40a7f6[_0xaff9('0x17')](_0x34fc13)[_0xaff9('0x27')](_0x2dff13);};}exports[_0xaff9('0x28')]=function(_0x100465,_0x4457e1){var _0x11c3e9={},_0x5b81ea={},_0x5fe8b0={'count':0x0,'rows':[]};var _0x403f32=_[_0xaff9('0x29')](db[_0xaff9('0x2a')][_0xaff9('0x2b')],function(_0x1ae9fc){return{'name':_0x1ae9fc[_0xaff9('0x2c')],'type':_0x1ae9fc[_0xaff9('0x2d')][_0xaff9('0x2e')]};});_0x5b81ea[_0xaff9('0x2f')]=_[_0xaff9('0x29')](_0x403f32,_0xaff9('0x26'));_0x5b81ea['query']=_[_0xaff9('0x30')](_0x100465[_0xaff9('0x31')]);_0x5b81ea['filters']=_['intersection'](_0x5b81ea[_0xaff9('0x2f')],_0x5b81ea[_0xaff9('0x31')]);_0x11c3e9[_0xaff9('0x32')]=_[_0xaff9('0x33')](_0x5b81ea[_0xaff9('0x2f')],qs['fields'](_0x100465[_0xaff9('0x31')][_0xaff9('0x34')]));_0x11c3e9[_0xaff9('0x32')]=_0x11c3e9['attributes'][_0xaff9('0x35')]?_0x11c3e9[_0xaff9('0x32')]:_0x5b81ea['model'];if(!_0x100465[_0xaff9('0x31')][_0xaff9('0x36')](_0xaff9('0x37'))){_0x11c3e9[_0xaff9('0x38')]=qs['limit'](_0x100465['query']['limit']);_0x11c3e9[_0xaff9('0x1a')]=qs['offset'](_0x100465[_0xaff9('0x31')]['offset']);}_0x11c3e9[_0xaff9('0x39')]=qs[_0xaff9('0x3a')](_0x100465['query'][_0xaff9('0x3a')]);_0x11c3e9['where']=qs['filters'](_[_0xaff9('0x3b')](_0x100465[_0xaff9('0x31')],_0x5b81ea[_0xaff9('0x3c')]),_0x403f32);if(_0x100465['query'][_0xaff9('0x3d')]){_0x11c3e9[_0xaff9('0x3e')]=_['merge'](_0x11c3e9[_0xaff9('0x3e')],{'$or':_[_0xaff9('0x29')](_0x403f32,function(_0x230c58){if(_0x230c58[_0xaff9('0x2d')]!==_0xaff9('0x3f')){var _0x46bc15={};_0x46bc15[_0x230c58[_0xaff9('0x26')]]={'$like':'%'+_0x100465[_0xaff9('0x31')]['filter']+'%'};return _0x46bc15;}})});}_0x11c3e9=_[_0xaff9('0x40')]({},_0x11c3e9,_0x100465['options']);var _0x1ef38d={'where':_0x11c3e9[_0xaff9('0x3e')]};return db[_0xaff9('0x2a')][_0xaff9('0x1c')](_0x1ef38d)[_0xaff9('0x23')](function(_0xb9d58b){_0x5fe8b0[_0xaff9('0x1c')]=_0xb9d58b;if(_0x100465[_0xaff9('0x31')][_0xaff9('0x41')]){_0x11c3e9[_0xaff9('0x42')]=[{'all':!![]}];}return db[_0xaff9('0x2a')][_0xaff9('0x43')](_0x11c3e9);})[_0xaff9('0x23')](function(_0x2b00f4){_0x5fe8b0[_0xaff9('0x44')]=_0x2b00f4;return _0x5fe8b0;})[_0xaff9('0x23')](respondWithFilteredResult(_0x4457e1,_0x11c3e9))[_0xaff9('0x45')](handleError(_0x4457e1,null));};exports[_0xaff9('0x46')]=function(_0x56faed,_0x32b966){var _0x185e8d={'raw':![],'where':{'id':_0x56faed[_0xaff9('0x47')]['id']}},_0x35498e={};_0x35498e[_0xaff9('0x2f')]=_['keys'](db['ZendeskConfiguration'][_0xaff9('0x2b')]);_0x35498e['query']=_[_0xaff9('0x30')](_0x56faed[_0xaff9('0x31')]);_0x35498e[_0xaff9('0x3c')]=_['intersection'](_0x35498e[_0xaff9('0x2f')],_0x35498e['query']);_0x185e8d[_0xaff9('0x32')]=_[_0xaff9('0x33')](_0x35498e[_0xaff9('0x2f')],qs[_0xaff9('0x34')](_0x56faed[_0xaff9('0x31')]['fields']));_0x185e8d[_0xaff9('0x32')]=_0x185e8d[_0xaff9('0x32')][_0xaff9('0x35')]?_0x185e8d[_0xaff9('0x32')]:_0x35498e[_0xaff9('0x2f')];if(_0x56faed[_0xaff9('0x31')][_0xaff9('0x41')]){_0x185e8d[_0xaff9('0x42')]=[{'all':!![]}];}_0x185e8d=_['merge']({},_0x185e8d,_0x56faed[_0xaff9('0x48')]);return db[_0xaff9('0x2a')][_0xaff9('0x49')](_0x185e8d)[_0xaff9('0x23')](handleEntityNotFound(_0x32b966,null))['then'](respondWithResult(_0x32b966,null))[_0xaff9('0x45')](handleError(_0x32b966,null));};exports['create']=function(_0x1812c6,_0xf57278){return db['ZendeskConfiguration'][_0xaff9('0x4a')](_0x1812c6['body'],{})[_0xaff9('0x23')](respondWithResult(_0xf57278,0xc9))[_0xaff9('0x45')](handleError(_0xf57278,null));};exports[_0xaff9('0x22')]=function(_0x39c131,_0x5bcbe3){if(_0x39c131[_0xaff9('0x4b')]['id']){delete _0x39c131['body']['id'];}return db[_0xaff9('0x2a')]['find']({'where':{'id':_0x39c131[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x5bcbe3,null))[_0xaff9('0x23')](saveUpdates(_0x39c131[_0xaff9('0x4b')],null))[_0xaff9('0x23')](respondWithResult(_0x5bcbe3,null))[_0xaff9('0x45')](handleError(_0x5bcbe3,null));};exports[_0xaff9('0x4c')]=function(_0x48e1bd,_0x5eb2b8){return db['ZendeskConfiguration'][_0xaff9('0x49')]({'where':{'id':_0x48e1bd[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x5eb2b8,null))['then'](removeEntity(_0x5eb2b8,null))[_0xaff9('0x45')](handleError(_0x5eb2b8,null));};exports[_0xaff9('0x4d')]=function(_0x525281,_0x4e5afa,_0x38a96a){var _0x57c387={};var _0xf18bda={};var _0xf54f37;var _0x2ec789;return db[_0xaff9('0x2a')][_0xaff9('0x4e')]({'where':{'id':_0x525281[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x4e5afa,null))[_0xaff9('0x23')](function(_0xcf8297){if(_0xcf8297){_0xf54f37=_0xcf8297;_0xf18bda[_0xaff9('0x2f')]=_[_0xaff9('0x30')](db[_0xaff9('0x4f')][_0xaff9('0x2b')]);_0xf18bda['query']=_[_0xaff9('0x30')](_0x525281[_0xaff9('0x31')]);_0xf18bda[_0xaff9('0x3c')]=_['intersection'](_0xf18bda[_0xaff9('0x2f')],_0xf18bda[_0xaff9('0x31')]);_0x57c387[_0xaff9('0x32')]=_['intersection'](_0xf18bda['model'],qs[_0xaff9('0x34')](_0x525281[_0xaff9('0x31')][_0xaff9('0x34')]));_0x57c387['attributes']=_0x57c387['attributes'][_0xaff9('0x35')]?_0x57c387[_0xaff9('0x32')]:_0xf18bda[_0xaff9('0x2f')];_0x57c387[_0xaff9('0x39')]=qs[_0xaff9('0x3a')](_0x525281[_0xaff9('0x31')][_0xaff9('0x3a')]);_0x57c387[_0xaff9('0x3e')]=qs[_0xaff9('0x3c')](_[_0xaff9('0x3b')](_0x525281[_0xaff9('0x31')],_0xf18bda[_0xaff9('0x3c')]));if(_0x525281[_0xaff9('0x31')][_0xaff9('0x3d')]){_0x57c387[_0xaff9('0x3e')]=_[_0xaff9('0x40')](_0x57c387[_0xaff9('0x3e')],{'$or':_[_0xaff9('0x29')](_0x57c387[_0xaff9('0x32')],function(_0x54c5fa){var _0x24b307={};_0x24b307[_0x54c5fa]={'$like':'%'+_0x525281[_0xaff9('0x31')][_0xaff9('0x3d')]+'%'};return _0x24b307;})});}_0x57c387=_[_0xaff9('0x40')]({},_0x57c387,_0x525281[_0xaff9('0x48')]);return _0xf54f37[_0xaff9('0x4d')](_0x57c387);}})[_0xaff9('0x23')](function(_0x202143){if(_0x202143){_0x2ec789=_0x202143['length'];if(!_0x525281[_0xaff9('0x31')][_0xaff9('0x36')]('nolimit')){_0x57c387[_0xaff9('0x38')]=qs['limit'](_0x525281[_0xaff9('0x31')][_0xaff9('0x38')]);_0x57c387[_0xaff9('0x1a')]=qs['offset'](_0x525281['query'][_0xaff9('0x1a')]);}return _0xf54f37[_0xaff9('0x4d')](_0x57c387);}})[_0xaff9('0x23')](function(_0x584087){if(_0x584087){return _0x584087?{'count':_0x2ec789,'rows':_0x584087}:null;}})[_0xaff9('0x23')](respondWithResult(_0x4e5afa,null))[_0xaff9('0x45')](handleError(_0x4e5afa,null));};exports[_0xaff9('0x50')]=function(_0xac3aca,_0x1788a6,_0x41b86f){var _0x29f472={};var _0x29c05f={};var _0x7dfb31;var _0x19d529;return db[_0xaff9('0x2a')][_0xaff9('0x4e')]({'where':{'id':_0xac3aca[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x1788a6,null))[_0xaff9('0x23')](function(_0x5111ae){if(_0x5111ae){_0x7dfb31=_0x5111ae;_0x29c05f[_0xaff9('0x2f')]=_[_0xaff9('0x30')](db['ZendeskField'][_0xaff9('0x2b')]);_0x29c05f[_0xaff9('0x31')]=_['keys'](_0xac3aca['query']);_0x29c05f[_0xaff9('0x3c')]=_[_0xaff9('0x33')](_0x29c05f['model'],_0x29c05f[_0xaff9('0x31')]);_0x29f472[_0xaff9('0x32')]=_[_0xaff9('0x33')](_0x29c05f[_0xaff9('0x2f')],qs[_0xaff9('0x34')](_0xac3aca[_0xaff9('0x31')][_0xaff9('0x34')]));_0x29f472['attributes']=_0x29f472[_0xaff9('0x32')][_0xaff9('0x35')]?_0x29f472[_0xaff9('0x32')]:_0x29c05f[_0xaff9('0x2f')];_0x29f472[_0xaff9('0x39')]=qs[_0xaff9('0x3a')](_0xac3aca[_0xaff9('0x31')][_0xaff9('0x3a')]);_0x29f472[_0xaff9('0x3e')]=qs[_0xaff9('0x3c')](_[_0xaff9('0x3b')](_0xac3aca['query'],_0x29c05f['filters']));if(_0xac3aca[_0xaff9('0x31')][_0xaff9('0x3d')]){_0x29f472[_0xaff9('0x3e')]=_[_0xaff9('0x40')](_0x29f472[_0xaff9('0x3e')],{'$or':_[_0xaff9('0x29')](_0x29f472[_0xaff9('0x32')],function(_0x34e3de){var _0x45c141={};_0x45c141[_0x34e3de]={'$like':'%'+_0xac3aca['query'][_0xaff9('0x3d')]+'%'};return _0x45c141;})});}_0x29f472=_[_0xaff9('0x40')]({},_0x29f472,_0xac3aca[_0xaff9('0x48')]);return _0x7dfb31[_0xaff9('0x50')](_0x29f472);}})[_0xaff9('0x23')](function(_0x1734f0){if(_0x1734f0){_0x19d529=_0x1734f0[_0xaff9('0x35')];if(!_0xac3aca['query'][_0xaff9('0x36')](_0xaff9('0x37'))){_0x29f472[_0xaff9('0x38')]=qs[_0xaff9('0x38')](_0xac3aca[_0xaff9('0x31')][_0xaff9('0x38')]);_0x29f472[_0xaff9('0x1a')]=qs[_0xaff9('0x1a')](_0xac3aca['query']['offset']);}return _0x7dfb31[_0xaff9('0x50')](_0x29f472);}})[_0xaff9('0x23')](function(_0x2a315e){if(_0x2a315e){return _0x2a315e?{'count':_0x19d529,'rows':_0x2a315e}:null;}})['then'](respondWithResult(_0x1788a6,null))['catch'](handleError(_0x1788a6,null));};exports['getDescriptions']=function(_0x7e834b,_0x1bc62e,_0x3c7770){var _0xa48d19={};var _0xa57f10={};var _0xd3cca;var _0x5e11e6;return db[_0xaff9('0x2a')][_0xaff9('0x4e')]({'where':{'id':_0x7e834b[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x1bc62e,null))[_0xaff9('0x23')](function(_0x3af016){if(_0x3af016){_0xd3cca=_0x3af016;_0xa57f10['model']=_['keys'](db['ZendeskField'][_0xaff9('0x2b')]);_0xa57f10['query']=_[_0xaff9('0x30')](_0x7e834b[_0xaff9('0x31')]);_0xa57f10[_0xaff9('0x3c')]=_[_0xaff9('0x33')](_0xa57f10[_0xaff9('0x2f')],_0xa57f10[_0xaff9('0x31')]);_0xa48d19[_0xaff9('0x32')]=_['intersection'](_0xa57f10[_0xaff9('0x2f')],qs[_0xaff9('0x34')](_0x7e834b['query'][_0xaff9('0x34')]));_0xa48d19[_0xaff9('0x32')]=_0xa48d19['attributes'][_0xaff9('0x35')]?_0xa48d19[_0xaff9('0x32')]:_0xa57f10[_0xaff9('0x2f')];_0xa48d19[_0xaff9('0x39')]=qs[_0xaff9('0x3a')](_0x7e834b[_0xaff9('0x31')]['sort']);_0xa48d19['where']=qs[_0xaff9('0x3c')](_[_0xaff9('0x3b')](_0x7e834b['query'],_0xa57f10[_0xaff9('0x3c')]));if(_0x7e834b['query'][_0xaff9('0x3d')]){_0xa48d19[_0xaff9('0x3e')]=_[_0xaff9('0x40')](_0xa48d19[_0xaff9('0x3e')],{'$or':_[_0xaff9('0x29')](_0xa48d19[_0xaff9('0x32')],function(_0x32e398){var _0x179062={};_0x179062[_0x32e398]={'$like':'%'+_0x7e834b[_0xaff9('0x31')][_0xaff9('0x3d')]+'%'};return _0x179062;})});}_0xa48d19=_[_0xaff9('0x40')]({},_0xa48d19,_0x7e834b[_0xaff9('0x48')]);return _0xd3cca['getDescriptions'](_0xa48d19);}})[_0xaff9('0x23')](function(_0x1c9d1d){if(_0x1c9d1d){_0x5e11e6=_0x1c9d1d[_0xaff9('0x35')];if(!_0x7e834b[_0xaff9('0x31')][_0xaff9('0x36')](_0xaff9('0x37'))){_0xa48d19[_0xaff9('0x38')]=qs[_0xaff9('0x38')](_0x7e834b[_0xaff9('0x31')]['limit']);_0xa48d19[_0xaff9('0x1a')]=qs[_0xaff9('0x1a')](_0x7e834b['query'][_0xaff9('0x1a')]);}return _0xd3cca['getDescriptions'](_0xa48d19);}})['then'](function(_0x2f9e7e){if(_0x2f9e7e){return _0x2f9e7e?{'count':_0x5e11e6,'rows':_0x2f9e7e}:null;}})[_0xaff9('0x23')](respondWithResult(_0x1bc62e,null))[_0xaff9('0x45')](handleError(_0x1bc62e,null));};exports[_0xaff9('0x51')]=function(_0x29f8ad,_0x875fe8,_0x3ba7a3){var _0x3f5612={};var _0x28759a={};var _0x20618c;var _0xe918f2;return db[_0xaff9('0x2a')][_0xaff9('0x4e')]({'where':{'id':_0x29f8ad[_0xaff9('0x47')]['id']}})[_0xaff9('0x23')](handleEntityNotFound(_0x875fe8,null))[_0xaff9('0x23')](function(_0x2b0258){if(_0x2b0258){_0x20618c=_0x2b0258;_0x28759a[_0xaff9('0x2f')]=_[_0xaff9('0x30')](db[_0xaff9('0x52')]['rawAttributes']);_0x28759a[_0xaff9('0x31')]=_[_0xaff9('0x30')](_0x29f8ad[_0xaff9('0x31')]);_0x28759a['filters']=_[_0xaff9('0x33')](_0x28759a[_0xaff9('0x2f')],_0x28759a[_0xaff9('0x31')]);_0x3f5612[_0xaff9('0x32')]=_[_0xaff9('0x33')](_0x28759a[_0xaff9('0x2f')],qs['fields'](_0x29f8ad['query']['fields']));_0x3f5612['attributes']=_0x3f5612[_0xaff9('0x32')]['length']?_0x3f5612[_0xaff9('0x32')]:_0x28759a[_0xaff9('0x2f')];_0x3f5612[_0xaff9('0x39')]=qs[_0xaff9('0x3a')](_0x29f8ad[_0xaff9('0x31')][_0xaff9('0x3a')]);_0x3f5612['where']=qs[_0xaff9('0x3c')](_[_0xaff9('0x3b')](_0x29f8ad[_0xaff9('0x31')],_0x28759a[_0xaff9('0x3c')]));if(_0x29f8ad['query'][_0xaff9('0x3d')]){_0x3f5612[_0xaff9('0x3e')]=_['merge'](_0x3f5612[_0xaff9('0x3e')],{'$or':_[_0xaff9('0x29')](_0x3f5612[_0xaff9('0x32')],function(_0x12361f){var _0x5ddcd7={};_0x5ddcd7[_0x12361f]={'$like':'%'+_0x29f8ad['query'][_0xaff9('0x3d')]+'%'};return _0x5ddcd7;})});}_0x3f5612=_['merge']({},_0x3f5612,_0x29f8ad['options']);return _0x20618c[_0xaff9('0x51')](_0x3f5612);}})[_0xaff9('0x23')](function(_0x2d31c7){if(_0x2d31c7){_0xe918f2=_0x2d31c7['length'];if(!_0x29f8ad[_0xaff9('0x31')][_0xaff9('0x36')]('nolimit')){_0x3f5612['limit']=qs[_0xaff9('0x38')](_0x29f8ad[_0xaff9('0x31')][_0xaff9('0x38')]);_0x3f5612[_0xaff9('0x1a')]=qs[_0xaff9('0x1a')](_0x29f8ad[_0xaff9('0x31')]['offset']);}return _0x20618c[_0xaff9('0x51')](_0x3f5612);}})[_0xaff9('0x23')](function(_0x45c3ea){if(_0x45c3ea){return _0x45c3ea?{'count':_0xe918f2,'rows':_0x45c3ea}:null;}})[_0xaff9('0x23')](respondWithResult(_0x875fe8,null))['catch'](handleError(_0x875fe8,null));};exports[_0xaff9('0x53')]=function(_0xce8b8e,_0x58d41a,_0x40fbde){if(_0xce8b8e['body']['id']){delete _0xce8b8e[_0xaff9('0x4b')]['id'];}return db[_0xaff9('0x2a')][_0xaff9('0x4e')]({'where':{'id':_0xce8b8e[_0xaff9('0x47')]['id']}})['then'](handleEntityNotFound(_0x58d41a,null))[_0xaff9('0x23')](function(_0x135ee2){if(_0x135ee2){return _0x135ee2[_0xaff9('0x53')](_0xce8b8e[_0xaff9('0x4b')]['ids']||[]);}return null;})[_0xaff9('0x23')](respondWithResult(_0x58d41a,null))[_0xaff9('0x45')](handleError(_0x58d41a,null));}; \ No newline at end of file +var _0x5979=['name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','findAll','rows','catch','params','include','create','body','update','find','getFields','ZendeskField','findOne','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack'];(function(_0x3a622f,_0x5a4759){var _0x257f54=function(_0x39c879){while(--_0x39c879){_0x3a622f['push'](_0x3a622f['shift']());}};_0x257f54(++_0x5a4759);}(_0x5979,0xd2));var _0x9597=function(_0x5570ef,_0x25b17b){_0x5570ef=_0x5570ef-0x0;var _0x1bd7e6=_0x5979[_0x5570ef];return _0x1bd7e6;};'use strict';var emlformat=require(_0x9597('0x0'));var rimraf=require(_0x9597('0x1'));var zipdir=require(_0x9597('0x2'));var jsonpatch=require(_0x9597('0x3'));var rp=require(_0x9597('0x4'));var moment=require('moment');var BPromise=require(_0x9597('0x5'));var Mustache=require(_0x9597('0x6'));var util=require(_0x9597('0x7'));var path=require('path');var sox=require(_0x9597('0x8'));var csv=require(_0x9597('0x9'));var ejs=require(_0x9597('0xa'));var fs=require('fs');var fs_extra=require(_0x9597('0xb'));var _=require(_0x9597('0xc'));var squel=require('squel');var crypto=require(_0x9597('0xd'));var jsforce=require(_0x9597('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9597('0xf'));var Papa=require('papaparse');var Redis=require(_0x9597('0x10'));var authService=require(_0x9597('0x11'));var qs=require(_0x9597('0x12'));var as=require(_0x9597('0x13'));var hardwareService=require(_0x9597('0x14'));var logger=require(_0x9597('0x15'))('api');var utils=require(_0x9597('0x16'));var config=require(_0x9597('0x17'));var licenseUtil=require(_0x9597('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b55a7,_0x2e7237){_0x2e7237=_0x2e7237||0xcc;return function(_0x485ef7){if(_0x485ef7){return _0x1b55a7[_0x9597('0x19')](_0x2e7237);}return _0x1b55a7[_0x9597('0x1a')](_0x2e7237)[_0x9597('0x1b')]();};}function respondWithResult(_0x595ebc,_0x165375){_0x165375=_0x165375||0xc8;return function(_0x2584cd){if(_0x2584cd){return _0x595ebc['status'](_0x165375)[_0x9597('0x1c')](_0x2584cd);}};}function respondWithFilteredResult(_0x4e5b14,_0x4bcefc){return function(_0x213b46){if(_0x213b46){var _0x17254f=typeof _0x4bcefc['offset']==='undefined'&&typeof _0x4bcefc[_0x9597('0x1d')]===_0x9597('0x1e');var _0x7849a6=_0x213b46[_0x9597('0x1f')];var _0x3ed0b1=_0x17254f?0x0:_0x4bcefc[_0x9597('0x20')];var _0x14d419=_0x17254f?_0x213b46[_0x9597('0x1f')]:_0x4bcefc[_0x9597('0x20')]+_0x4bcefc[_0x9597('0x1d')];var _0x1fe27e;if(_0x14d419>=_0x7849a6){_0x14d419=_0x7849a6;_0x1fe27e=0xc8;}else{_0x1fe27e=0xce;}_0x4e5b14[_0x9597('0x1a')](_0x1fe27e);return _0x4e5b14[_0x9597('0x21')](_0x9597('0x22'),_0x3ed0b1+'-'+_0x14d419+'/'+_0x7849a6)[_0x9597('0x1c')](_0x213b46);}return null;};}function patchUpdates(_0x19be5c){return function(_0x48684d){try{jsonpatch[_0x9597('0x23')](_0x48684d,_0x19be5c,!![]);}catch(_0x1e4bc6){return BPromise[_0x9597('0x24')](_0x1e4bc6);}return _0x48684d[_0x9597('0x25')]();};}function saveUpdates(_0x213553,_0x4c5db2){return function(_0x4ad23b){if(_0x4ad23b){return _0x4ad23b['update'](_0x213553)['then'](function(_0x2954df){return _0x2954df;});}return null;};}function removeEntity(_0x55e15b,_0x5f51b3){return function(_0x318d38){if(_0x318d38){return _0x318d38[_0x9597('0x26')]()[_0x9597('0x27')](function(){_0x55e15b[_0x9597('0x1a')](0xcc)[_0x9597('0x1b')]();});}};}function handleEntityNotFound(_0x5ed658,_0x180a77){return function(_0x1f7611){if(!_0x1f7611){_0x5ed658['sendStatus'](0x194);}return _0x1f7611;};}function handleError(_0x2361f4,_0x223bc8){_0x223bc8=_0x223bc8||0x1f4;return function(_0x58d37a){logger[_0x9597('0x28')](_0x58d37a[_0x9597('0x29')]);if(_0x58d37a[_0x9597('0x2a')]){delete _0x58d37a['name'];}_0x2361f4['status'](_0x223bc8)[_0x9597('0x2b')](_0x58d37a);};}exports['index']=function(_0x330da8,_0x2cd643){var _0x4d822a={},_0x4958c6={},_0x32b571={'count':0x0,'rows':[]};var _0x561137=_['map'](db['ZendeskConfiguration'][_0x9597('0x2c')],function(_0x5f3d66){return{'name':_0x5f3d66['fieldName'],'type':_0x5f3d66[_0x9597('0x2d')][_0x9597('0x2e')]};});_0x4958c6[_0x9597('0x2f')]=_[_0x9597('0x30')](_0x561137,'name');_0x4958c6[_0x9597('0x31')]=_[_0x9597('0x32')](_0x330da8['query']);_0x4958c6[_0x9597('0x33')]=_[_0x9597('0x34')](_0x4958c6[_0x9597('0x2f')],_0x4958c6[_0x9597('0x31')]);_0x4d822a[_0x9597('0x35')]=_[_0x9597('0x34')](_0x4958c6[_0x9597('0x2f')],qs[_0x9597('0x36')](_0x330da8[_0x9597('0x31')][_0x9597('0x36')]));_0x4d822a[_0x9597('0x35')]=_0x4d822a[_0x9597('0x35')][_0x9597('0x37')]?_0x4d822a['attributes']:_0x4958c6[_0x9597('0x2f')];if(!_0x330da8[_0x9597('0x31')][_0x9597('0x38')](_0x9597('0x39'))){_0x4d822a[_0x9597('0x1d')]=qs['limit'](_0x330da8[_0x9597('0x31')][_0x9597('0x1d')]);_0x4d822a[_0x9597('0x20')]=qs[_0x9597('0x20')](_0x330da8['query'][_0x9597('0x20')]);}_0x4d822a[_0x9597('0x3a')]=qs[_0x9597('0x3b')](_0x330da8['query']['sort']);_0x4d822a[_0x9597('0x3c')]=qs[_0x9597('0x33')](_[_0x9597('0x3d')](_0x330da8[_0x9597('0x31')],_0x4958c6[_0x9597('0x33')]),_0x561137);if(_0x330da8[_0x9597('0x31')][_0x9597('0x3e')]){_0x4d822a[_0x9597('0x3c')]=_[_0x9597('0x3f')](_0x4d822a[_0x9597('0x3c')],{'$or':_[_0x9597('0x30')](_0x561137,function(_0x1b6640){if(_0x1b6640['type']!==_0x9597('0x40')){var _0x27a991={};_0x27a991[_0x1b6640[_0x9597('0x2a')]]={'$like':'%'+_0x330da8[_0x9597('0x31')][_0x9597('0x3e')]+'%'};return _0x27a991;}})});}_0x4d822a=_['merge']({},_0x4d822a,_0x330da8[_0x9597('0x41')]);var _0x79e89b={'where':_0x4d822a[_0x9597('0x3c')]};return db[_0x9597('0x42')]['count'](_0x79e89b)[_0x9597('0x27')](function(_0x4020eb){_0x32b571['count']=_0x4020eb;if(_0x330da8[_0x9597('0x31')][_0x9597('0x43')]){_0x4d822a['include']=[{'all':!![]}];}return db[_0x9597('0x42')][_0x9597('0x44')](_0x4d822a);})['then'](function(_0x4d274d){_0x32b571[_0x9597('0x45')]=_0x4d274d;return _0x32b571;})['then'](respondWithFilteredResult(_0x2cd643,_0x4d822a))[_0x9597('0x46')](handleError(_0x2cd643,null));};exports['show']=function(_0x6d14be,_0x4bf133){var _0xdc9c42={'raw':![],'where':{'id':_0x6d14be[_0x9597('0x47')]['id']}},_0x49e270={};_0x49e270['model']=_[_0x9597('0x32')](db[_0x9597('0x42')]['rawAttributes']);_0x49e270[_0x9597('0x31')]=_[_0x9597('0x32')](_0x6d14be[_0x9597('0x31')]);_0x49e270[_0x9597('0x33')]=_['intersection'](_0x49e270['model'],_0x49e270[_0x9597('0x31')]);_0xdc9c42[_0x9597('0x35')]=_[_0x9597('0x34')](_0x49e270[_0x9597('0x2f')],qs[_0x9597('0x36')](_0x6d14be[_0x9597('0x31')][_0x9597('0x36')]));_0xdc9c42[_0x9597('0x35')]=_0xdc9c42[_0x9597('0x35')][_0x9597('0x37')]?_0xdc9c42[_0x9597('0x35')]:_0x49e270[_0x9597('0x2f')];if(_0x6d14be['query'][_0x9597('0x43')]){_0xdc9c42[_0x9597('0x48')]=[{'all':!![]}];}_0xdc9c42=_[_0x9597('0x3f')]({},_0xdc9c42,_0x6d14be[_0x9597('0x41')]);return db[_0x9597('0x42')]['find'](_0xdc9c42)['then'](handleEntityNotFound(_0x4bf133,null))[_0x9597('0x27')](respondWithResult(_0x4bf133,null))[_0x9597('0x46')](handleError(_0x4bf133,null));};exports[_0x9597('0x49')]=function(_0x50d624,_0x2f9bca){return db['ZendeskConfiguration'][_0x9597('0x49')](_0x50d624[_0x9597('0x4a')],{})['then'](respondWithResult(_0x2f9bca,0xc9))[_0x9597('0x46')](handleError(_0x2f9bca,null));};exports[_0x9597('0x4b')]=function(_0x4feb33,_0x3bad34){if(_0x4feb33[_0x9597('0x4a')]['id']){delete _0x4feb33['body']['id'];}return db[_0x9597('0x42')][_0x9597('0x4c')]({'where':{'id':_0x4feb33[_0x9597('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bad34,null))[_0x9597('0x27')](saveUpdates(_0x4feb33['body'],null))['then'](respondWithResult(_0x3bad34,null))[_0x9597('0x46')](handleError(_0x3bad34,null));};exports['destroy']=function(_0x4edbea,_0x470765){return db[_0x9597('0x42')][_0x9597('0x4c')]({'where':{'id':_0x4edbea[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x470765,null))['then'](removeEntity(_0x470765,null))[_0x9597('0x46')](handleError(_0x470765,null));};exports[_0x9597('0x4d')]=function(_0x47f9a6,_0x308a31,_0x35110e){var _0x317328={};var _0x43151a={};var _0x2434ed;var _0x4ec2e3;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x47f9a6[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x308a31,null))[_0x9597('0x27')](function(_0x3cd01d){if(_0x3cd01d){_0x2434ed=_0x3cd01d;_0x43151a['model']=_[_0x9597('0x32')](db[_0x9597('0x4e')][_0x9597('0x2c')]);_0x43151a[_0x9597('0x31')]=_['keys'](_0x47f9a6[_0x9597('0x31')]);_0x43151a['filters']=_['intersection'](_0x43151a[_0x9597('0x2f')],_0x43151a['query']);_0x317328[_0x9597('0x35')]=_[_0x9597('0x34')](_0x43151a[_0x9597('0x2f')],qs['fields'](_0x47f9a6[_0x9597('0x31')][_0x9597('0x36')]));_0x317328[_0x9597('0x35')]=_0x317328[_0x9597('0x35')][_0x9597('0x37')]?_0x317328[_0x9597('0x35')]:_0x43151a[_0x9597('0x2f')];_0x317328['order']=qs[_0x9597('0x3b')](_0x47f9a6[_0x9597('0x31')]['sort']);_0x317328['where']=qs[_0x9597('0x33')](_[_0x9597('0x3d')](_0x47f9a6[_0x9597('0x31')],_0x43151a[_0x9597('0x33')]));if(_0x47f9a6[_0x9597('0x31')][_0x9597('0x3e')]){_0x317328['where']=_['merge'](_0x317328[_0x9597('0x3c')],{'$or':_[_0x9597('0x30')](_0x317328[_0x9597('0x35')],function(_0x39c012){var _0xa46f31={};_0xa46f31[_0x39c012]={'$like':'%'+_0x47f9a6[_0x9597('0x31')]['filter']+'%'};return _0xa46f31;})});}_0x317328=_['merge']({},_0x317328,_0x47f9a6[_0x9597('0x41')]);return _0x2434ed[_0x9597('0x4d')](_0x317328);}})['then'](function(_0x392c61){if(_0x392c61){_0x4ec2e3=_0x392c61['length'];if(!_0x47f9a6[_0x9597('0x31')]['hasOwnProperty'](_0x9597('0x39'))){_0x317328[_0x9597('0x1d')]=qs[_0x9597('0x1d')](_0x47f9a6['query'][_0x9597('0x1d')]);_0x317328[_0x9597('0x20')]=qs[_0x9597('0x20')](_0x47f9a6['query']['offset']);}return _0x2434ed[_0x9597('0x4d')](_0x317328);}})[_0x9597('0x27')](function(_0x2f77f6){if(_0x2f77f6){return _0x2f77f6?{'count':_0x4ec2e3,'rows':_0x2f77f6}:null;}})[_0x9597('0x27')](respondWithResult(_0x308a31,null))['catch'](handleError(_0x308a31,null));};exports['getSubjects']=function(_0x48f27b,_0x2140f5,_0x31d980){var _0x28face={};var _0x5bb9be={};var _0x4b07ed;var _0x16d4ad;return db[_0x9597('0x42')][_0x9597('0x4f')]({'where':{'id':_0x48f27b[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x2140f5,null))[_0x9597('0x27')](function(_0x1dd3ce){if(_0x1dd3ce){_0x4b07ed=_0x1dd3ce;_0x5bb9be[_0x9597('0x2f')]=_[_0x9597('0x32')](db[_0x9597('0x4e')]['rawAttributes']);_0x5bb9be['query']=_[_0x9597('0x32')](_0x48f27b['query']);_0x5bb9be['filters']=_[_0x9597('0x34')](_0x5bb9be[_0x9597('0x2f')],_0x5bb9be[_0x9597('0x31')]);_0x28face[_0x9597('0x35')]=_[_0x9597('0x34')](_0x5bb9be['model'],qs['fields'](_0x48f27b['query']['fields']));_0x28face['attributes']=_0x28face[_0x9597('0x35')]['length']?_0x28face[_0x9597('0x35')]:_0x5bb9be[_0x9597('0x2f')];_0x28face[_0x9597('0x3a')]=qs['sort'](_0x48f27b[_0x9597('0x31')][_0x9597('0x3b')]);_0x28face['where']=qs['filters'](_['pick'](_0x48f27b[_0x9597('0x31')],_0x5bb9be[_0x9597('0x33')]));if(_0x48f27b[_0x9597('0x31')][_0x9597('0x3e')]){_0x28face[_0x9597('0x3c')]=_[_0x9597('0x3f')](_0x28face['where'],{'$or':_[_0x9597('0x30')](_0x28face[_0x9597('0x35')],function(_0x2caf14){var _0x2fa591={};_0x2fa591[_0x2caf14]={'$like':'%'+_0x48f27b[_0x9597('0x31')]['filter']+'%'};return _0x2fa591;})});}_0x28face=_['merge']({},_0x28face,_0x48f27b[_0x9597('0x41')]);return _0x4b07ed[_0x9597('0x50')](_0x28face);}})[_0x9597('0x27')](function(_0x426afa){if(_0x426afa){_0x16d4ad=_0x426afa[_0x9597('0x37')];if(!_0x48f27b['query'][_0x9597('0x38')]('nolimit')){_0x28face['limit']=qs['limit'](_0x48f27b[_0x9597('0x31')][_0x9597('0x1d')]);_0x28face['offset']=qs[_0x9597('0x20')](_0x48f27b['query'][_0x9597('0x20')]);}return _0x4b07ed[_0x9597('0x50')](_0x28face);}})[_0x9597('0x27')](function(_0x518617){if(_0x518617){return _0x518617?{'count':_0x16d4ad,'rows':_0x518617}:null;}})['then'](respondWithResult(_0x2140f5,null))['catch'](handleError(_0x2140f5,null));};exports[_0x9597('0x51')]=function(_0x2b5df7,_0x3cd755,_0x309f2c){var _0x1d2ad5={};var _0x16385b={};var _0x540d17;var _0x2f6443;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2b5df7[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x3cd755,null))[_0x9597('0x27')](function(_0xa4089a){if(_0xa4089a){_0x540d17=_0xa4089a;_0x16385b['model']=_[_0x9597('0x32')](db[_0x9597('0x4e')][_0x9597('0x2c')]);_0x16385b[_0x9597('0x31')]=_[_0x9597('0x32')](_0x2b5df7[_0x9597('0x31')]);_0x16385b[_0x9597('0x33')]=_['intersection'](_0x16385b[_0x9597('0x2f')],_0x16385b[_0x9597('0x31')]);_0x1d2ad5[_0x9597('0x35')]=_[_0x9597('0x34')](_0x16385b[_0x9597('0x2f')],qs[_0x9597('0x36')](_0x2b5df7[_0x9597('0x31')]['fields']));_0x1d2ad5[_0x9597('0x35')]=_0x1d2ad5[_0x9597('0x35')][_0x9597('0x37')]?_0x1d2ad5[_0x9597('0x35')]:_0x16385b[_0x9597('0x2f')];_0x1d2ad5['order']=qs['sort'](_0x2b5df7[_0x9597('0x31')][_0x9597('0x3b')]);_0x1d2ad5[_0x9597('0x3c')]=qs[_0x9597('0x33')](_[_0x9597('0x3d')](_0x2b5df7['query'],_0x16385b[_0x9597('0x33')]));if(_0x2b5df7[_0x9597('0x31')][_0x9597('0x3e')]){_0x1d2ad5[_0x9597('0x3c')]=_[_0x9597('0x3f')](_0x1d2ad5[_0x9597('0x3c')],{'$or':_[_0x9597('0x30')](_0x1d2ad5[_0x9597('0x35')],function(_0x26081a){var _0x3f5208={};_0x3f5208[_0x26081a]={'$like':'%'+_0x2b5df7[_0x9597('0x31')][_0x9597('0x3e')]+'%'};return _0x3f5208;})});}_0x1d2ad5=_[_0x9597('0x3f')]({},_0x1d2ad5,_0x2b5df7['options']);return _0x540d17[_0x9597('0x51')](_0x1d2ad5);}})[_0x9597('0x27')](function(_0xd925ac){if(_0xd925ac){_0x2f6443=_0xd925ac[_0x9597('0x37')];if(!_0x2b5df7[_0x9597('0x31')][_0x9597('0x38')](_0x9597('0x39'))){_0x1d2ad5['limit']=qs['limit'](_0x2b5df7[_0x9597('0x31')]['limit']);_0x1d2ad5[_0x9597('0x20')]=qs['offset'](_0x2b5df7[_0x9597('0x31')][_0x9597('0x20')]);}return _0x540d17['getDescriptions'](_0x1d2ad5);}})[_0x9597('0x27')](function(_0x105e91){if(_0x105e91){return _0x105e91?{'count':_0x2f6443,'rows':_0x105e91}:null;}})['then'](respondWithResult(_0x3cd755,null))[_0x9597('0x46')](handleError(_0x3cd755,null));};exports['getTags']=function(_0x624fba,_0x1592da,_0x5c061e){var _0x1be122={};var _0x392a17={};var _0x88e2b3;var _0x384668;return db[_0x9597('0x42')][_0x9597('0x4f')]({'where':{'id':_0x624fba[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x1592da,null))[_0x9597('0x27')](function(_0x19e930){if(_0x19e930){_0x88e2b3=_0x19e930;_0x392a17[_0x9597('0x2f')]=_[_0x9597('0x32')](db['Tag'][_0x9597('0x2c')]);_0x392a17['query']=_[_0x9597('0x32')](_0x624fba[_0x9597('0x31')]);_0x392a17[_0x9597('0x33')]=_[_0x9597('0x34')](_0x392a17[_0x9597('0x2f')],_0x392a17['query']);_0x1be122[_0x9597('0x35')]=_['intersection'](_0x392a17[_0x9597('0x2f')],qs[_0x9597('0x36')](_0x624fba[_0x9597('0x31')][_0x9597('0x36')]));_0x1be122[_0x9597('0x35')]=_0x1be122[_0x9597('0x35')][_0x9597('0x37')]?_0x1be122['attributes']:_0x392a17[_0x9597('0x2f')];_0x1be122[_0x9597('0x3a')]=qs[_0x9597('0x3b')](_0x624fba[_0x9597('0x31')][_0x9597('0x3b')]);_0x1be122['where']=qs[_0x9597('0x33')](_[_0x9597('0x3d')](_0x624fba[_0x9597('0x31')],_0x392a17[_0x9597('0x33')]));if(_0x624fba[_0x9597('0x31')][_0x9597('0x3e')]){_0x1be122[_0x9597('0x3c')]=_['merge'](_0x1be122[_0x9597('0x3c')],{'$or':_[_0x9597('0x30')](_0x1be122[_0x9597('0x35')],function(_0x32df31){var _0x284ae1={};_0x284ae1[_0x32df31]={'$like':'%'+_0x624fba[_0x9597('0x31')][_0x9597('0x3e')]+'%'};return _0x284ae1;})});}_0x1be122=_[_0x9597('0x3f')]({},_0x1be122,_0x624fba[_0x9597('0x41')]);return _0x88e2b3['getTags'](_0x1be122);}})[_0x9597('0x27')](function(_0x1cb155){if(_0x1cb155){_0x384668=_0x1cb155['length'];if(!_0x624fba[_0x9597('0x31')][_0x9597('0x38')](_0x9597('0x39'))){_0x1be122[_0x9597('0x1d')]=qs[_0x9597('0x1d')](_0x624fba['query'][_0x9597('0x1d')]);_0x1be122[_0x9597('0x20')]=qs[_0x9597('0x20')](_0x624fba['query'][_0x9597('0x20')]);}return _0x88e2b3[_0x9597('0x52')](_0x1be122);}})[_0x9597('0x27')](function(_0x5e53fa){if(_0x5e53fa){return _0x5e53fa?{'count':_0x384668,'rows':_0x5e53fa}:null;}})[_0x9597('0x27')](respondWithResult(_0x1592da,null))[_0x9597('0x46')](handleError(_0x1592da,null));};exports[_0x9597('0x53')]=function(_0x472eff,_0x4c4dff,_0x15e2fd){if(_0x472eff['body']['id']){delete _0x472eff[_0x9597('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x9597('0x4f')]({'where':{'id':_0x472eff[_0x9597('0x47')]['id']}})[_0x9597('0x27')](handleEntityNotFound(_0x4c4dff,null))['then'](function(_0x971da4){if(_0x971da4){return _0x971da4[_0x9597('0x53')](_0x472eff[_0x9597('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4c4dff,null))[_0x9597('0x46')](handleError(_0x4c4dff,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 53166ba..2d38235 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 _0x1c7c=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x1c7c,0x164));var _0xc1c7=function(_0x53d025,_0x19cef4){_0x53d025=_0x53d025-0x0;var _0x4198a9=_0x1c7c[_0x53d025];return _0x4198a9;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var logger=require(_0xc1c7('0x2'))(_0xc1c7('0x3'));var moment=require('moment');var BPromise=require(_0xc1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c7('0x5'));var rimraf=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var attributes=require(_0xc1c7('0x8'));module[_0xc1c7('0x9')]=function(_0x364dde,_0x1f3e21){return _0x364dde[_0xc1c7('0xa')](_0xc1c7('0xb'),attributes,{'tableName':_0xc1c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x2db78f,_0x7f0cab){var _0x334d6e=function(_0x5c1a00){while(--_0x5c1a00){_0x2db78f['push'](_0x2db78f['shift']());}};_0x334d6e(++_0x7f0cab);}(_0x14a0,0x8e));var _0x014a=function(_0x2e65ed,_0x58d9f5){_0x2e65ed=_0x2e65ed-0x0;var _0x2d07e7=_0x14a0[_0x2e65ed];return _0x2d07e7;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'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 e56c736..59d1be5 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 _0x85b2=['client','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x85b2,0xf3));var _0x285b=function(_0x55e4e2,_0x425598){_0x55e4e2=_0x55e4e2-0x0;var _0x576f02=_0x85b2[_0x55e4e2];return _0x576f02;};'use strict';var _=require(_0x285b('0x0'));var util=require(_0x285b('0x1'));var moment=require(_0x285b('0x2'));var BPromise=require(_0x285b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x285b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x285b('0x5'));var logger=require(_0x285b('0x6'))(_0x285b('0x7'));var config=require(_0x285b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x285b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b6a3,_0x5bb7e1,_0x256673){return new BPromise(function(_0x1c80af,_0x49cbf1){return client[_0x285b('0xa')](_0x10b6a3,_0x256673)['then'](function(_0x562402){logger[_0x285b('0xb')](_0x285b('0xc'),_0x5bb7e1,_0x285b('0xd'));logger[_0x285b('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5bb7e1,_0x285b('0xd'),JSON[_0x285b('0xf')](_0x562402));if(_0x562402[_0x285b('0x10')]){if(_0x562402[_0x285b('0x10')][_0x285b('0x11')]===0x1f4){logger[_0x285b('0x10')](_0x285b('0xc'),_0x5bb7e1,_0x562402[_0x285b('0x10')][_0x285b('0x12')]);return _0x49cbf1(_0x562402[_0x285b('0x10')][_0x285b('0x12')]);}logger[_0x285b('0x10')](_0x285b('0xc'),_0x5bb7e1,_0x562402[_0x285b('0x10')][_0x285b('0x12')]);return _0x1c80af(_0x562402['error']['message']);}else{logger[_0x285b('0xb')](_0x285b('0xc'),_0x5bb7e1,_0x285b('0xd'));_0x1c80af(_0x562402[_0x285b('0x13')][_0x285b('0x12')]);}})[_0x285b('0x14')](function(_0x22b26a){logger[_0x285b('0x10')](_0x285b('0xc'),_0x5bb7e1,_0x22b26a);_0x49cbf1(_0x22b26a);});});} \ No newline at end of file +var _0x0077=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5a936c,_0x2baf2c){var _0xa25306=function(_0x3c4676){while(--_0x3c4676){_0x5a936c['push'](_0x5a936c['shift']());}};_0xa25306(++_0x2baf2c);}(_0x0077,0x75));var _0x7007=function(_0x1ea9d9,_0x133ab2){_0x1ea9d9=_0x1ea9d9-0x0;var _0x3766bd=_0x0077[_0x1ea9d9];return _0x3766bd;};'use strict';var _=require('lodash');var util=require(_0x7007('0x0'));var moment=require(_0x7007('0x1'));var BPromise=require('bluebird');var rs=require(_0x7007('0x2'));var fs=require('fs');var Redis=require(_0x7007('0x3'));var db=require(_0x7007('0x4'))['db'];var utils=require(_0x7007('0x5'));var logger=require(_0x7007('0x6'))('rpc');var config=require(_0x7007('0x7'));var jayson=require(_0x7007('0x8'));var client=jayson[_0x7007('0x9')][_0x7007('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x551a43,_0x212a91,_0x21a23f){return new BPromise(function(_0x449204,_0x2c9111){return client[_0x7007('0xb')](_0x551a43,_0x21a23f)[_0x7007('0xc')](function(_0x18e5e4){logger[_0x7007('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x212a91,_0x7007('0xe'));logger['debug'](_0x7007('0xf'),_0x212a91,_0x7007('0xe'),JSON['stringify'](_0x18e5e4));if(_0x18e5e4[_0x7007('0x10')]){if(_0x18e5e4[_0x7007('0x10')][_0x7007('0x11')]===0x1f4){logger[_0x7007('0x10')](_0x7007('0x12'),_0x212a91,_0x18e5e4[_0x7007('0x10')][_0x7007('0x13')]);return _0x2c9111(_0x18e5e4[_0x7007('0x10')][_0x7007('0x13')]);}logger[_0x7007('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x212a91,_0x18e5e4['error'][_0x7007('0x13')]);return _0x449204(_0x18e5e4[_0x7007('0x10')][_0x7007('0x13')]);}else{logger[_0x7007('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x212a91,_0x7007('0xe'));_0x449204(_0x18e5e4[_0x7007('0x14')][_0x7007('0x13')]);}})[_0x7007('0x15')](function(_0x37f388){logger[_0x7007('0x10')](_0x7007('0x12'),_0x212a91,_0x37f388);_0x2c9111(_0x37f388);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 4b31f8f..9a2d95b 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 _0x57dd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','util'];(function(_0x4570d5,_0x90c6e0){var _0x29557e=function(_0x390f7a){while(--_0x390f7a){_0x4570d5['push'](_0x4570d5['shift']());}};_0x29557e(++_0x90c6e0);}(_0x57dd,0x8a));var _0xd57d=function(_0x36a8dd,_0x18263b){_0x36a8dd=_0x36a8dd-0x0;var _0x306e43=_0x57dd[_0x36a8dd];return _0x306e43;};'use strict';var multer=require(_0xd57d('0x0'));var util=require(_0xd57d('0x1'));var path=require(_0xd57d('0x2'));var timeout=require(_0xd57d('0x3'));var express=require(_0xd57d('0x4'));var router=express[_0xd57d('0x5')]();var fs_extra=require(_0xd57d('0x6'));var auth=require(_0xd57d('0x7'));var interaction=require(_0xd57d('0x8'));var config=require('../../config/environment');var controller=require(_0xd57d('0x9'));router[_0xd57d('0xa')]('/',auth[_0xd57d('0xb')](),controller[_0xd57d('0xc')]);router[_0xd57d('0xa')]('/:id',auth[_0xd57d('0xb')](),controller[_0xd57d('0xd')]);router[_0xd57d('0xe')]('/',auth[_0xd57d('0xb')](),controller[_0xd57d('0xf')]);router['put'](_0xd57d('0x10'),auth[_0xd57d('0xb')](),controller['update']);router[_0xd57d('0x11')](_0xd57d('0x10'),auth[_0xd57d('0xb')](),controller[_0xd57d('0x12')]);module[_0xd57d('0x13')]=router; \ No newline at end of file +var _0x015c=['/:id','show','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x470f4b,_0x563ba2){var _0x359ae6=function(_0x4bb442){while(--_0x4bb442){_0x470f4b['push'](_0x470f4b['shift']());}};_0x359ae6(++_0x563ba2);}(_0x015c,0x149));var _0xc015=function(_0x12c3c6,_0x800a8b){_0x12c3c6=_0x12c3c6-0x0;var _0x2383ac=_0x015c[_0x12c3c6];return _0x2383ac;};'use strict';var multer=require(_0xc015('0x0'));var util=require(_0xc015('0x1'));var path=require(_0xc015('0x2'));var timeout=require(_0xc015('0x3'));var express=require(_0xc015('0x4'));var router=express[_0xc015('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc015('0x6'));var interaction=require(_0xc015('0x7'));var config=require(_0xc015('0x8'));var controller=require(_0xc015('0x9'));router[_0xc015('0xa')]('/',auth[_0xc015('0xb')](),controller[_0xc015('0xc')]);router['get'](_0xc015('0xd'),auth[_0xc015('0xb')](),controller[_0xc015('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc015('0xf')]);router['put'](_0xc015('0xd'),auth[_0xc015('0xb')](),controller[_0xc015('0x10')]);router['delete'](_0xc015('0xd'),auth[_0xc015('0xb')](),controller['destroy']);module[_0xc015('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index cea5cc8..c3a1797 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 _0x7406=['STRING','sequelize','ENUM','string','customVariable','keyValue','picklist'];(function(_0x5a0bab,_0x168def){var _0x32b15a=function(_0x52f391){while(--_0x52f391){_0x5a0bab['push'](_0x5a0bab['shift']());}};_0x32b15a(++_0x168def);}(_0x7406,0xfd));var _0x6740=function(_0x3ab54a,_0xf327f1){_0x3ab54a=_0x3ab54a-0x0;var _0x2b8fcd=_0x7406[_0x3ab54a];return _0x2b8fcd;};'use strict';var Sequelize=require(_0x6740('0x0'));module['exports']={'type':{'type':Sequelize[_0x6740('0x1')](_0x6740('0x2'),'variable',_0x6740('0x3'),_0x6740('0x4'),_0x6740('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6740('0x6')]},'key':{'type':Sequelize[_0x6740('0x6')]},'keyType':{'type':Sequelize[_0x6740('0x1')]('string','variable',_0x6740('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6740('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x263f=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x12ca91,_0x46f60a){var _0x39902e=function(_0x5ccc92){while(--_0x5ccc92){_0x12ca91['push'](_0x12ca91['shift']());}};_0x39902e(++_0x46f60a);}(_0x263f,0x147));var _0xf263=function(_0x5c1a2a,_0x416c3c){_0x5c1a2a=_0x5c1a2a-0x0;var _0x14cc1d=_0x263f[_0x5c1a2a];return _0x14cc1d;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf263('0x2'),_0xf263('0x3'),_0xf263('0x4'),_0xf263('0x5'),_0xf263('0x6')),'defaultValue':_0xf263('0x2')},'content':{'type':Sequelize[_0xf263('0x7')]},'key':{'type':Sequelize[_0xf263('0x7')]},'keyType':{'type':Sequelize[_0xf263('0x8')](_0xf263('0x2'),_0xf263('0x3'),_0xf263('0x4'))},'keyContent':{'type':Sequelize[_0xf263('0x7')]},'idField':{'type':Sequelize[_0xf263('0x7')]},'nameField':{'type':Sequelize[_0xf263('0x7')]},'customField':{'type':Sequelize[_0xf263('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf263('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index aef4d31..556c9b7 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 _0x5f3a=['offset','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','rows','params','intersection','find','create','body','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','set','reject','then','destroy','send','index','ZendeskField','rawAttributes','type','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f3a,0x16d));var _0xa5f3=function(_0x5eff69,_0x53808d){_0x5eff69=_0x5eff69-0x0;var _0x1307ea=_0x5f3a[_0x5eff69];return _0x1307ea;};'use strict';var emlformat=require(_0xa5f3('0x0'));var rimraf=require(_0xa5f3('0x1'));var zipdir=require(_0xa5f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5f3('0x3'));var BPromise=require(_0xa5f3('0x4'));var Mustache=require(_0xa5f3('0x5'));var util=require(_0xa5f3('0x6'));var path=require(_0xa5f3('0x7'));var sox=require(_0xa5f3('0x8'));var csv=require(_0xa5f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5f3('0xa'));var _=require(_0xa5f3('0xb'));var squel=require(_0xa5f3('0xc'));var crypto=require(_0xa5f3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa5f3('0x9'));var querystring=require(_0xa5f3('0xe'));var Papa=require(_0xa5f3('0xf'));var Redis=require(_0xa5f3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa5f3('0x11'));var hardwareService=require(_0xa5f3('0x12'));var logger=require(_0xa5f3('0x13'))(_0xa5f3('0x14'));var utils=require(_0xa5f3('0x15'));var config=require(_0xa5f3('0x16'));var licenseUtil=require(_0xa5f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d4c37,_0x59eb97){_0x59eb97=_0x59eb97||0xcc;return function(_0x2c8f0f){if(_0x2c8f0f){return _0x4d4c37[_0xa5f3('0x18')](_0x59eb97);}return _0x4d4c37[_0xa5f3('0x19')](_0x59eb97)[_0xa5f3('0x1a')]();};}function respondWithResult(_0x51bd94,_0x97b3f3){_0x97b3f3=_0x97b3f3||0xc8;return function(_0x3fb7c9){if(_0x3fb7c9){return _0x51bd94[_0xa5f3('0x19')](_0x97b3f3)[_0xa5f3('0x1b')](_0x3fb7c9);}};}function respondWithFilteredResult(_0x276c5b,_0x220abb){return function(_0x5c2437){if(_0x5c2437){var _0x27b521=typeof _0x220abb['offset']===_0xa5f3('0x1c')&&typeof _0x220abb['limit']===_0xa5f3('0x1c');var _0x39e822=_0x5c2437['count'];var _0x147cdd=_0x27b521?0x0:_0x220abb['offset'];var _0x24da0f=_0x27b521?_0x5c2437['count']:_0x220abb['offset']+_0x220abb[_0xa5f3('0x1d')];var _0x3320ca;if(_0x24da0f>=_0x39e822){_0x24da0f=_0x39e822;_0x3320ca=0xc8;}else{_0x3320ca=0xce;}_0x276c5b[_0xa5f3('0x19')](_0x3320ca);return _0x276c5b[_0xa5f3('0x1e')]('Content-Range',_0x147cdd+'-'+_0x24da0f+'/'+_0x39e822)['json'](_0x5c2437);}return null;};}function patchUpdates(_0x4664a7){return function(_0x11c96a){try{jsonpatch['apply'](_0x11c96a,_0x4664a7,!![]);}catch(_0x45611f){return BPromise[_0xa5f3('0x1f')](_0x45611f);}return _0x11c96a['save']();};}function saveUpdates(_0x4763e2,_0x59e32a){return function(_0x58c8e3){if(_0x58c8e3){return _0x58c8e3['update'](_0x4763e2)[_0xa5f3('0x20')](function(_0x2a0d19){return _0x2a0d19;});}return null;};}function removeEntity(_0x7af819,_0x59f805){return function(_0x555363){if(_0x555363){return _0x555363[_0xa5f3('0x21')]()[_0xa5f3('0x20')](function(){_0x7af819['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5d8f,_0x5add9f){return function(_0x284c38){if(!_0x284c38){_0x4d5d8f[_0xa5f3('0x18')](0x194);}return _0x284c38;};}function handleError(_0x3da27d,_0x6ded35){_0x6ded35=_0x6ded35||0x1f4;return function(_0x386ccd){logger['error'](_0x386ccd['stack']);if(_0x386ccd['name']){delete _0x386ccd['name'];}_0x3da27d['status'](_0x6ded35)[_0xa5f3('0x22')](_0x386ccd);};}exports[_0xa5f3('0x23')]=function(_0x1fb7c5,_0x5baa5d){var _0x417a3a={},_0x54bae1={},_0x10e9ff={'count':0x0,'rows':[]};var _0x273049=_['map'](db[_0xa5f3('0x24')][_0xa5f3('0x25')],function(_0x38de6){return{'name':_0x38de6['fieldName'],'type':_0x38de6[_0xa5f3('0x26')]['key']};});_0x54bae1[_0xa5f3('0x27')]=_['map'](_0x273049,_0xa5f3('0x28'));_0x54bae1[_0xa5f3('0x29')]=_[_0xa5f3('0x2a')](_0x1fb7c5[_0xa5f3('0x29')]);_0x54bae1[_0xa5f3('0x2b')]=_['intersection'](_0x54bae1['model'],_0x54bae1[_0xa5f3('0x29')]);_0x417a3a[_0xa5f3('0x2c')]=_['intersection'](_0x54bae1[_0xa5f3('0x27')],qs[_0xa5f3('0x2d')](_0x1fb7c5[_0xa5f3('0x29')]['fields']));_0x417a3a[_0xa5f3('0x2c')]=_0x417a3a[_0xa5f3('0x2c')][_0xa5f3('0x2e')]?_0x417a3a[_0xa5f3('0x2c')]:_0x54bae1[_0xa5f3('0x27')];if(!_0x1fb7c5['query'][_0xa5f3('0x2f')](_0xa5f3('0x30'))){_0x417a3a[_0xa5f3('0x1d')]=qs[_0xa5f3('0x1d')](_0x1fb7c5[_0xa5f3('0x29')]['limit']);_0x417a3a[_0xa5f3('0x31')]=qs[_0xa5f3('0x31')](_0x1fb7c5[_0xa5f3('0x29')][_0xa5f3('0x31')]);}_0x417a3a[_0xa5f3('0x32')]=qs[_0xa5f3('0x33')](_0x1fb7c5[_0xa5f3('0x29')][_0xa5f3('0x33')]);_0x417a3a[_0xa5f3('0x34')]=qs[_0xa5f3('0x2b')](_[_0xa5f3('0x35')](_0x1fb7c5[_0xa5f3('0x29')],_0x54bae1[_0xa5f3('0x2b')]),_0x273049);if(_0x1fb7c5['query'][_0xa5f3('0x36')]){_0x417a3a[_0xa5f3('0x34')]=_[_0xa5f3('0x37')](_0x417a3a[_0xa5f3('0x34')],{'$or':_[_0xa5f3('0x38')](_0x273049,function(_0x1af838){if(_0x1af838['type']!==_0xa5f3('0x39')){var _0x1a6118={};_0x1a6118[_0x1af838[_0xa5f3('0x28')]]={'$like':'%'+_0x1fb7c5[_0xa5f3('0x29')][_0xa5f3('0x36')]+'%'};return _0x1a6118;}})});}_0x417a3a=_[_0xa5f3('0x37')]({},_0x417a3a,_0x1fb7c5[_0xa5f3('0x3a')]);var _0x232499={'where':_0x417a3a[_0xa5f3('0x34')]};return db['ZendeskField']['count'](_0x232499)[_0xa5f3('0x20')](function(_0x54024f){_0x10e9ff[_0xa5f3('0x3b')]=_0x54024f;if(_0x1fb7c5[_0xa5f3('0x29')][_0xa5f3('0x3c')]){_0x417a3a[_0xa5f3('0x3d')]=[{'all':!![]}];}return db[_0xa5f3('0x24')]['findAll'](_0x417a3a);})[_0xa5f3('0x20')](function(_0x103075){_0x10e9ff[_0xa5f3('0x3e')]=_0x103075;return _0x10e9ff;})[_0xa5f3('0x20')](respondWithFilteredResult(_0x5baa5d,_0x417a3a))['catch'](handleError(_0x5baa5d,null));};exports['show']=function(_0x4a723e,_0x15c17f){var _0x61a352={'raw':!![],'where':{'id':_0x4a723e[_0xa5f3('0x3f')]['id']}},_0x3fb904={};_0x3fb904[_0xa5f3('0x27')]=_[_0xa5f3('0x2a')](db[_0xa5f3('0x24')][_0xa5f3('0x25')]);_0x3fb904[_0xa5f3('0x29')]=_[_0xa5f3('0x2a')](_0x4a723e[_0xa5f3('0x29')]);_0x3fb904['filters']=_[_0xa5f3('0x40')](_0x3fb904[_0xa5f3('0x27')],_0x3fb904[_0xa5f3('0x29')]);_0x61a352[_0xa5f3('0x2c')]=_[_0xa5f3('0x40')](_0x3fb904[_0xa5f3('0x27')],qs[_0xa5f3('0x2d')](_0x4a723e[_0xa5f3('0x29')][_0xa5f3('0x2d')]));_0x61a352[_0xa5f3('0x2c')]=_0x61a352[_0xa5f3('0x2c')][_0xa5f3('0x2e')]?_0x61a352['attributes']:_0x3fb904[_0xa5f3('0x27')];if(_0x4a723e[_0xa5f3('0x29')][_0xa5f3('0x3c')]){_0x61a352[_0xa5f3('0x3d')]=[{'all':!![]}];}_0x61a352=_[_0xa5f3('0x37')]({},_0x61a352,_0x4a723e['options']);return db[_0xa5f3('0x24')][_0xa5f3('0x41')](_0x61a352)[_0xa5f3('0x20')](handleEntityNotFound(_0x15c17f,null))[_0xa5f3('0x20')](respondWithResult(_0x15c17f,null))['catch'](handleError(_0x15c17f,null));};exports['create']=function(_0x5bd45d,_0x45631b){return db[_0xa5f3('0x24')][_0xa5f3('0x42')](_0x5bd45d[_0xa5f3('0x43')],{})[_0xa5f3('0x20')](respondWithResult(_0x45631b,0xc9))[_0xa5f3('0x44')](handleError(_0x45631b,null));};exports['update']=function(_0x312f24,_0x41d376){if(_0x312f24[_0xa5f3('0x43')]['id']){delete _0x312f24[_0xa5f3('0x43')]['id'];}return db['ZendeskField'][_0xa5f3('0x41')]({'where':{'id':_0x312f24['params']['id']}})[_0xa5f3('0x20')](handleEntityNotFound(_0x41d376,null))[_0xa5f3('0x20')](saveUpdates(_0x312f24['body'],null))['then'](respondWithResult(_0x41d376,null))['catch'](handleError(_0x41d376,null));};exports['destroy']=function(_0x3fcd2e,_0x3b291b){return db[_0xa5f3('0x24')][_0xa5f3('0x41')]({'where':{'id':_0x3fcd2e[_0xa5f3('0x3f')]['id']}})[_0xa5f3('0x20')](handleEntityNotFound(_0x3b291b,null))[_0xa5f3('0x20')](removeEntity(_0x3b291b,null))['catch'](handleError(_0x3b291b,null));}; \ No newline at end of file +var _0x25a3=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ZendeskField','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x2bcb1e,_0x42d916){var _0x33d6fb=function(_0x3e6645){while(--_0x3e6645){_0x2bcb1e['push'](_0x2bcb1e['shift']());}};_0x33d6fb(++_0x42d916);}(_0x25a3,0x121));var _0x325a=function(_0x45e5f0,_0x50420c){_0x45e5f0=_0x45e5f0-0x0;var _0x596a58=_0x25a3[_0x45e5f0];return _0x596a58;};'use strict';var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x325a('0x3'));var moment=require('moment');var BPromise=require(_0x325a('0x4'));var Mustache=require(_0x325a('0x5'));var util=require(_0x325a('0x6'));var path=require('path');var sox=require(_0x325a('0x7'));var csv=require(_0x325a('0x8'));var ejs=require(_0x325a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x325a('0xa'));var crypto=require(_0x325a('0xb'));var jsforce=require(_0x325a('0xc'));var deskjs=require(_0x325a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325a('0xe'));var Redis=require(_0x325a('0xf'));var authService=require(_0x325a('0x10'));var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require('../../config/logger')(_0x325a('0x14'));var utils=require(_0x325a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x325a('0x16'));var db=require(_0x325a('0x17'))['db'];function respondWithStatusCode(_0x2a8750,_0x3e90fe){_0x3e90fe=_0x3e90fe||0xcc;return function(_0x4e3b88){if(_0x4e3b88){return _0x2a8750['sendStatus'](_0x3e90fe);}return _0x2a8750[_0x325a('0x18')](_0x3e90fe)['end']();};}function respondWithResult(_0x3d12d5,_0xa8dc3a){_0xa8dc3a=_0xa8dc3a||0xc8;return function(_0x3db556){if(_0x3db556){return _0x3d12d5[_0x325a('0x18')](_0xa8dc3a)[_0x325a('0x19')](_0x3db556);}};}function respondWithFilteredResult(_0x3d198c,_0x1d7efc){return function(_0x4412ba){if(_0x4412ba){var _0x1fd4ec=typeof _0x1d7efc[_0x325a('0x1a')]===_0x325a('0x1b')&&typeof _0x1d7efc[_0x325a('0x1c')]===_0x325a('0x1b');var _0x1dcafe=_0x4412ba['count'];var _0x4cba7=_0x1fd4ec?0x0:_0x1d7efc[_0x325a('0x1a')];var _0x4a1f9f=_0x1fd4ec?_0x4412ba[_0x325a('0x1d')]:_0x1d7efc[_0x325a('0x1a')]+_0x1d7efc[_0x325a('0x1c')];var _0x297599;if(_0x4a1f9f>=_0x1dcafe){_0x4a1f9f=_0x1dcafe;_0x297599=0xc8;}else{_0x297599=0xce;}_0x3d198c[_0x325a('0x18')](_0x297599);return _0x3d198c[_0x325a('0x1e')](_0x325a('0x1f'),_0x4cba7+'-'+_0x4a1f9f+'/'+_0x1dcafe)[_0x325a('0x19')](_0x4412ba);}return null;};}function patchUpdates(_0x347f2d){return function(_0x1d76b7){try{jsonpatch[_0x325a('0x20')](_0x1d76b7,_0x347f2d,!![]);}catch(_0x11f0cb){return BPromise['reject'](_0x11f0cb);}return _0x1d76b7[_0x325a('0x21')]();};}function saveUpdates(_0x32a2f5,_0x18e29f){return function(_0x192e83){if(_0x192e83){return _0x192e83[_0x325a('0x22')](_0x32a2f5)[_0x325a('0x23')](function(_0x4c21bf){return _0x4c21bf;});}return null;};}function removeEntity(_0x36b2ac,_0x4c403d){return function(_0x15b5a6){if(_0x15b5a6){return _0x15b5a6[_0x325a('0x24')]()[_0x325a('0x23')](function(){_0x36b2ac[_0x325a('0x18')](0xcc)[_0x325a('0x25')]();});}};}function handleEntityNotFound(_0x4b3d65,_0x29543e){return function(_0x4b4155){if(!_0x4b4155){_0x4b3d65[_0x325a('0x26')](0x194);}return _0x4b4155;};}function handleError(_0x26c001,_0x41d0d2){_0x41d0d2=_0x41d0d2||0x1f4;return function(_0x5ad31d){logger[_0x325a('0x27')](_0x5ad31d[_0x325a('0x28')]);if(_0x5ad31d[_0x325a('0x29')]){delete _0x5ad31d[_0x325a('0x29')];}_0x26c001[_0x325a('0x18')](_0x41d0d2)[_0x325a('0x2a')](_0x5ad31d);};}exports[_0x325a('0x2b')]=function(_0x49d93b,_0x44468d){var _0x5cdfd1={},_0x201e01={},_0x3fa4f6={'count':0x0,'rows':[]};var _0xb10b39=_[_0x325a('0x2c')](db[_0x325a('0x2d')]['rawAttributes'],function(_0x27b3f7){return{'name':_0x27b3f7['fieldName'],'type':_0x27b3f7[_0x325a('0x2e')][_0x325a('0x2f')]};});_0x201e01['model']=_[_0x325a('0x2c')](_0xb10b39,_0x325a('0x29'));_0x201e01[_0x325a('0x30')]=_[_0x325a('0x31')](_0x49d93b['query']);_0x201e01[_0x325a('0x32')]=_[_0x325a('0x33')](_0x201e01[_0x325a('0x34')],_0x201e01[_0x325a('0x30')]);_0x5cdfd1['attributes']=_[_0x325a('0x33')](_0x201e01[_0x325a('0x34')],qs[_0x325a('0x35')](_0x49d93b[_0x325a('0x30')][_0x325a('0x35')]));_0x5cdfd1[_0x325a('0x36')]=_0x5cdfd1['attributes'][_0x325a('0x37')]?_0x5cdfd1[_0x325a('0x36')]:_0x201e01['model'];if(!_0x49d93b[_0x325a('0x30')][_0x325a('0x38')]('nolimit')){_0x5cdfd1[_0x325a('0x1c')]=qs['limit'](_0x49d93b[_0x325a('0x30')][_0x325a('0x1c')]);_0x5cdfd1[_0x325a('0x1a')]=qs[_0x325a('0x1a')](_0x49d93b['query'][_0x325a('0x1a')]);}_0x5cdfd1['order']=qs[_0x325a('0x39')](_0x49d93b['query']['sort']);_0x5cdfd1[_0x325a('0x3a')]=qs[_0x325a('0x32')](_[_0x325a('0x3b')](_0x49d93b['query'],_0x201e01[_0x325a('0x32')]),_0xb10b39);if(_0x49d93b['query'][_0x325a('0x3c')]){_0x5cdfd1[_0x325a('0x3a')]=_[_0x325a('0x3d')](_0x5cdfd1[_0x325a('0x3a')],{'$or':_[_0x325a('0x2c')](_0xb10b39,function(_0x1caa7f){if(_0x1caa7f[_0x325a('0x2e')]!==_0x325a('0x3e')){var _0x4db749={};_0x4db749[_0x1caa7f[_0x325a('0x29')]]={'$like':'%'+_0x49d93b[_0x325a('0x30')][_0x325a('0x3c')]+'%'};return _0x4db749;}})});}_0x5cdfd1=_[_0x325a('0x3d')]({},_0x5cdfd1,_0x49d93b[_0x325a('0x3f')]);var _0x206fa2={'where':_0x5cdfd1[_0x325a('0x3a')]};return db[_0x325a('0x2d')][_0x325a('0x1d')](_0x206fa2)['then'](function(_0x2997a0){_0x3fa4f6[_0x325a('0x1d')]=_0x2997a0;if(_0x49d93b[_0x325a('0x30')][_0x325a('0x40')]){_0x5cdfd1[_0x325a('0x41')]=[{'all':!![]}];}return db[_0x325a('0x2d')][_0x325a('0x42')](_0x5cdfd1);})[_0x325a('0x23')](function(_0x384e62){_0x3fa4f6[_0x325a('0x43')]=_0x384e62;return _0x3fa4f6;})[_0x325a('0x23')](respondWithFilteredResult(_0x44468d,_0x5cdfd1))['catch'](handleError(_0x44468d,null));};exports[_0x325a('0x44')]=function(_0x301f6c,_0x415825){var _0x128d53={'raw':!![],'where':{'id':_0x301f6c[_0x325a('0x45')]['id']}},_0x2750dd={};_0x2750dd['model']=_[_0x325a('0x31')](db[_0x325a('0x2d')][_0x325a('0x46')]);_0x2750dd[_0x325a('0x30')]=_[_0x325a('0x31')](_0x301f6c['query']);_0x2750dd[_0x325a('0x32')]=_[_0x325a('0x33')](_0x2750dd[_0x325a('0x34')],_0x2750dd['query']);_0x128d53[_0x325a('0x36')]=_[_0x325a('0x33')](_0x2750dd[_0x325a('0x34')],qs['fields'](_0x301f6c['query'][_0x325a('0x35')]));_0x128d53[_0x325a('0x36')]=_0x128d53[_0x325a('0x36')][_0x325a('0x37')]?_0x128d53['attributes']:_0x2750dd[_0x325a('0x34')];if(_0x301f6c[_0x325a('0x30')]['includeAll']){_0x128d53[_0x325a('0x41')]=[{'all':!![]}];}_0x128d53=_[_0x325a('0x3d')]({},_0x128d53,_0x301f6c['options']);return db[_0x325a('0x2d')][_0x325a('0x47')](_0x128d53)['then'](handleEntityNotFound(_0x415825,null))[_0x325a('0x23')](respondWithResult(_0x415825,null))['catch'](handleError(_0x415825,null));};exports['create']=function(_0x2fadf4,_0x26721a){return db[_0x325a('0x2d')]['create'](_0x2fadf4[_0x325a('0x48')],{})[_0x325a('0x23')](respondWithResult(_0x26721a,0xc9))['catch'](handleError(_0x26721a,null));};exports['update']=function(_0x1009dc,_0x2002c4){if(_0x1009dc['body']['id']){delete _0x1009dc[_0x325a('0x48')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x1009dc['params']['id']}})[_0x325a('0x23')](handleEntityNotFound(_0x2002c4,null))[_0x325a('0x23')](saveUpdates(_0x1009dc['body'],null))[_0x325a('0x23')](respondWithResult(_0x2002c4,null))[_0x325a('0x49')](handleError(_0x2002c4,null));};exports['destroy']=function(_0x37b66f,_0x2d00c4){return db[_0x325a('0x2d')][_0x325a('0x47')]({'where':{'id':_0x37b66f[_0x325a('0x45')]['id']}})[_0x325a('0x23')](handleEntityNotFound(_0x2d00c4,null))['then'](removeEntity(_0x2d00c4,null))[_0x325a('0x49')](handleError(_0x2d00c4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 82a2d73..0ab1087 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 _0xc3ec=['FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields'];(function(_0x5a997d,_0x530d0e){var _0x286394=function(_0x4a17cb){while(--_0x4a17cb){_0x5a997d['push'](_0x5a997d['shift']());}};_0x286394(++_0x530d0e);}(_0xc3ec,0x146));var _0xcc3e=function(_0x4dd4aa,_0x464b15){_0x4dd4aa=_0x4dd4aa-0x0;var _0x1ed429=_0xc3ec[_0x4dd4aa];return _0x1ed429;};'use strict';var _=require(_0xcc3e('0x0'));var util=require(_0xcc3e('0x1'));var logger=require(_0xcc3e('0x2'))('api');var moment=require(_0xcc3e('0x3'));var BPromise=require(_0xcc3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc3e('0x5'));var rimraf=require(_0xcc3e('0x6'));var config=require(_0xcc3e('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xcc3e('0x8')]=function(_0x4a47a8,_0x3732b7){return _0x4a47a8[_0xcc3e('0x9')](_0xcc3e('0xa'),attributes,{'tableName':_0xcc3e('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xcc3e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5642=['bluebird','request-promise','path','./intZendeskField.attributes','define','ZendeskField','idField','lodash','api','moment'];(function(_0x2feffc,_0x411517){var _0x3aab9a=function(_0x46603a){while(--_0x46603a){_0x2feffc['push'](_0x2feffc['shift']());}};_0x3aab9a(++_0x411517);}(_0x5642,0x7f));var _0x2564=function(_0x341829,_0x544c30){_0x341829=_0x341829-0x0;var _0x44bb2a=_0x5642[_0x341829];return _0x44bb2a;};'use strict';var _=require(_0x2564('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2564('0x1'));var moment=require(_0x2564('0x2'));var BPromise=require(_0x2564('0x3'));var rp=require(_0x2564('0x4'));var fs=require('fs');var path=require(_0x2564('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2564('0x6'));module['exports']=function(_0x21f037,_0x3a7352){return _0x21f037[_0x2564('0x7')](_0x2564('0x8'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x2564('0x9'),'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 18dfc0d..d544796 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 _0xb795=['ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x499f33,_0xc8c3d1){var _0x3c283a=function(_0x41c9e0){while(--_0x41c9e0){_0x499f33['push'](_0x499f33['shift']());}};_0x3c283a(++_0xc8c3d1);}(_0xb795,0x1e8));var _0x5b79=function(_0xc9e0a6,_0x5bfcd7){_0xc9e0a6=_0xc9e0a6-0x0;var _0x290884=_0xb795[_0xc9e0a6];return _0x290884;};'use strict';var _=require(_0x5b79('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b79('0x1'));var rs=require(_0x5b79('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b79('0x3'))['db'];var utils=require(_0x5b79('0x4'));var logger=require('../../config/logger')(_0x5b79('0x5'));var config=require(_0x5b79('0x6'));var jayson=require(_0x5b79('0x7'));var client=jayson[_0x5b79('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x257c63,_0x40cf13,_0x5d3d18){return new BPromise(function(_0x1a86ff,_0x1fd7ad){return client[_0x5b79('0x9')](_0x257c63,_0x5d3d18)[_0x5b79('0xa')](function(_0x5b6483){logger[_0x5b79('0xb')](_0x5b79('0xc'),_0x40cf13,_0x5b79('0xd'));logger['debug'](_0x5b79('0xe'),_0x40cf13,_0x5b79('0xd'),JSON['stringify'](_0x5b6483));if(_0x5b6483[_0x5b79('0xf')]){if(_0x5b6483[_0x5b79('0xf')][_0x5b79('0x10')]===0x1f4){logger[_0x5b79('0xf')](_0x5b79('0xc'),_0x40cf13,_0x5b6483['error'][_0x5b79('0x11')]);return _0x1fd7ad(_0x5b6483[_0x5b79('0xf')][_0x5b79('0x11')]);}logger[_0x5b79('0xf')](_0x5b79('0xc'),_0x40cf13,_0x5b6483[_0x5b79('0xf')][_0x5b79('0x11')]);return _0x1a86ff(_0x5b6483['error'][_0x5b79('0x11')]);}else{logger[_0x5b79('0xb')]('ZendeskField,\x20%s,\x20%s',_0x40cf13,_0x5b79('0xd'));_0x1a86ff(_0x5b6483[_0x5b79('0x12')][_0x5b79('0x11')]);}})[_0x5b79('0x13')](function(_0x335fd2){logger['error'](_0x5b79('0xc'),_0x40cf13,_0x335fd2);_0x1fd7ad(_0x335fd2);});});} \ No newline at end of file +var _0x8e3d=['result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','error','message','info'];(function(_0x5ec334,_0x20923c){var _0x311347=function(_0x327185){while(--_0x327185){_0x5ec334['push'](_0x5ec334['shift']());}};_0x311347(++_0x20923c);}(_0x8e3d,0x9a));var _0xd8e3=function(_0x50245d,_0x520a37){_0x50245d=_0x50245d-0x0;var _0x9db1ea=_0x8e3d[_0x50245d];return _0x9db1ea;};'use strict';var _=require(_0xd8e3('0x0'));var util=require(_0xd8e3('0x1'));var moment=require(_0xd8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd8e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd8e3('0x4'));var logger=require('../../config/logger')(_0xd8e3('0x5'));var config=require(_0xd8e3('0x6'));var jayson=require(_0xd8e3('0x7'));var client=jayson[_0xd8e3('0x8')][_0xd8e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dbdc0,_0xe037a4,_0x25c578){return new BPromise(function(_0x59cb40,_0x55e559){return client[_0xd8e3('0xa')](_0x1dbdc0,_0x25c578)[_0xd8e3('0xb')](function(_0x4efd3c){logger['info'](_0xd8e3('0xc'),_0xe037a4,_0xd8e3('0xd'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0xe037a4,_0xd8e3('0xd'),JSON['stringify'](_0x4efd3c));if(_0x4efd3c[_0xd8e3('0xe')]){if(_0x4efd3c['error']['code']===0x1f4){logger[_0xd8e3('0xe')](_0xd8e3('0xc'),_0xe037a4,_0x4efd3c[_0xd8e3('0xe')][_0xd8e3('0xf')]);return _0x55e559(_0x4efd3c['error'][_0xd8e3('0xf')]);}logger[_0xd8e3('0xe')](_0xd8e3('0xc'),_0xe037a4,_0x4efd3c[_0xd8e3('0xe')][_0xd8e3('0xf')]);return _0x59cb40(_0x4efd3c[_0xd8e3('0xe')][_0xd8e3('0xf')]);}else{logger[_0xd8e3('0x10')](_0xd8e3('0xc'),_0xe037a4,_0xd8e3('0xd'));_0x59cb40(_0x4efd3c[_0xd8e3('0x11')][_0xd8e3('0xf')]);}})[_0xd8e3('0x12')](function(_0x5dae15){logger[_0xd8e3('0xe')]('ZendeskField,\x20%s,\x20%s',_0xe037a4,_0x5dae15);_0x55e559(_0x5dae15);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 22a1830..09d3b0d 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 _0x4e53=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','index','get','isAuthenticated','show','/:id/configurations','getConfigurations','post','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x36ec7b,_0x24d7f2){var _0x26d823=function(_0x2a411b){while(--_0x2a411b){_0x36ec7b['push'](_0x36ec7b['shift']());}};_0x26d823(++_0x24d7f2);}(_0x4e53,0x9b));var _0x34e5=function(_0x59f7b8,_0xb2ac21){_0x59f7b8=_0x59f7b8-0x0;var _0x7b28c5=_0x4e53[_0x59f7b8];return _0x7b28c5;};'use strict';var multer=require('multer');var util=require(_0x34e5('0x0'));var path=require(_0x34e5('0x1'));var timeout=require('connect-timeout');var express=require(_0x34e5('0x2'));var router=express[_0x34e5('0x3')]();var fs_extra=require(_0x34e5('0x4'));var auth=require(_0x34e5('0x5'));var interaction=require(_0x34e5('0x6'));var config=require(_0x34e5('0x7'));var controller=require(_0x34e5('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x34e5('0x9')]);router[_0x34e5('0xa')]('/:id',auth[_0x34e5('0xb')](),controller[_0x34e5('0xc')]);router[_0x34e5('0xa')](_0x34e5('0xd'),auth[_0x34e5('0xb')](),controller[_0x34e5('0xe')]);router[_0x34e5('0xa')]('/:id/fields',auth[_0x34e5('0xb')](),controller['getFields']);router[_0x34e5('0xf')]('/',auth[_0x34e5('0xb')](),controller['create']);router[_0x34e5('0xf')](_0x34e5('0xd'),auth[_0x34e5('0xb')](),controller[_0x34e5('0x10')]);router[_0x34e5('0x11')](_0x34e5('0x12'),auth[_0x34e5('0xb')](),controller[_0x34e5('0x13')]);router[_0x34e5('0x14')](_0x34e5('0x12'),auth[_0x34e5('0xb')](),controller[_0x34e5('0x15')]);module[_0x34e5('0x16')]=router; \ No newline at end of file +var _0x6bdb=['./intZohoAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5682e3,_0x4f4b1e){var _0x2328b2=function(_0x5961ca){while(--_0x5961ca){_0x5682e3['push'](_0x5682e3['shift']());}};_0x2328b2(++_0x4f4b1e);}(_0x6bdb,0xa5));var _0xb6bd=function(_0x5dcb65,_0x60a863){_0x5dcb65=_0x5dcb65-0x0;var _0x3ae627=_0x6bdb[_0x5dcb65];return _0x3ae627;};'use strict';var multer=require(_0xb6bd('0x0'));var util=require('util');var path=require(_0xb6bd('0x1'));var timeout=require(_0xb6bd('0x2'));var express=require('express');var router=express[_0xb6bd('0x3')]();var fs_extra=require(_0xb6bd('0x4'));var auth=require(_0xb6bd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb6bd('0x6'));router[_0xb6bd('0x7')]('/',auth['isAuthenticated'](),controller[_0xb6bd('0x8')]);router['get'](_0xb6bd('0x9'),auth[_0xb6bd('0xa')](),controller['show']);router[_0xb6bd('0x7')](_0xb6bd('0xb'),auth[_0xb6bd('0xa')](),controller[_0xb6bd('0xc')]);router[_0xb6bd('0x7')]('/:id/fields',auth[_0xb6bd('0xa')](),controller['getFields']);router[_0xb6bd('0xd')]('/',auth[_0xb6bd('0xa')](),controller['create']);router[_0xb6bd('0xd')]('/:id/configurations',auth[_0xb6bd('0xa')](),controller[_0xb6bd('0xe')]);router['put']('/:id',auth[_0xb6bd('0xa')](),controller[_0xb6bd('0xf')]);router[_0xb6bd('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb6bd('0x11')]);module[_0xb6bd('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e0d103d..9a4d8ea 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 _0xf109=['exports','STRING','sequelize'];(function(_0x4ea2c7,_0x160b9d){var _0x44a24f=function(_0x19686e){while(--_0x19686e){_0x4ea2c7['push'](_0x4ea2c7['shift']());}};_0x44a24f(++_0x160b9d);}(_0xf109,0xce));var _0x9f10=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xf109[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file +var _0xda55=['STRING','sequelize','exports'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xda55,0x6d));var _0x5da5=function(_0x2479f7,_0x126ecc){_0x2479f7=_0x2479f7-0x0;var _0x420f4b=_0xda55[_0x2479f7];return _0x420f4b;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5da5('0x2')]},'zone':{'type':Sequelize[_0x5da5('0x2')]},'clientId':{'type':Sequelize[_0x5da5('0x2')]},'clientSecret':{'type':Sequelize[_0x5da5('0x2')]},'serverUrl':{'type':Sequelize[_0x5da5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x5da5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index debaa49..a4f092c 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 _0xca62=['Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','fieldName','type','key','map','query','keys','filters','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoAccount','count','includeAll','include','findAll','catch','show','rawAttributes','intersection','length','find','create','body','params','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','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','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject'];(function(_0x39214a,_0x9f2e45){var _0x50a460=function(_0x3b02cf){while(--_0x3b02cf){_0x39214a['push'](_0x39214a['shift']());}};_0x50a460(++_0x9f2e45);}(_0xca62,0x11e));var _0x2ca6=function(_0x3865c7,_0x27a236){_0x3865c7=_0x3865c7-0x0;var _0x140e62=_0xca62[_0x3865c7];return _0x140e62;};'use strict';var emlformat=require(_0x2ca6('0x0'));var rimraf=require(_0x2ca6('0x1'));var zipdir=require(_0x2ca6('0x2'));var jsonpatch=require(_0x2ca6('0x3'));var rp=require(_0x2ca6('0x4'));var moment=require('moment');var BPromise=require(_0x2ca6('0x5'));var Mustache=require('mustache');var util=require(_0x2ca6('0x6'));var path=require(_0x2ca6('0x7'));var sox=require(_0x2ca6('0x8'));var csv=require(_0x2ca6('0x9'));var ejs=require(_0x2ca6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ca6('0xb'));var crypto=require(_0x2ca6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca6('0x9'));var querystring=require(_0x2ca6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ca6('0xe'));var qs=require(_0x2ca6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ca6('0x10'));var logger=require(_0x2ca6('0x11'))(_0x2ca6('0x12'));var utils=require(_0x2ca6('0x13'));var config=require(_0x2ca6('0x14'));var licenseUtil=require(_0x2ca6('0x15'));var db=require(_0x2ca6('0x16'))['db'];var integrations=require(_0x2ca6('0x17'));function respondWithStatusCode(_0x19df2d,_0x4825b6){_0x4825b6=_0x4825b6||0xcc;return function(_0x35c284){if(_0x35c284){return _0x19df2d[_0x2ca6('0x18')](_0x4825b6);}return _0x19df2d[_0x2ca6('0x19')](_0x4825b6)[_0x2ca6('0x1a')]();};}function respondWithResult(_0x208e07,_0x15184b){_0x15184b=_0x15184b||0xc8;return function(_0x3bdc84){if(_0x3bdc84){return _0x208e07[_0x2ca6('0x19')](_0x15184b)[_0x2ca6('0x1b')](_0x3bdc84);}};}function respondWithFilteredResult(_0xef7e04,_0x359ed2){return function(_0x125c29){if(_0x125c29){var _0x2cd206=typeof _0x359ed2['offset']==='undefined'&&typeof _0x359ed2[_0x2ca6('0x1c')]===_0x2ca6('0x1d');var _0x1d8a7d=_0x125c29['count'];var _0x502d99=_0x2cd206?0x0:_0x359ed2['offset'];var _0x3fadd7=_0x2cd206?_0x125c29['count']:_0x359ed2[_0x2ca6('0x1e')]+_0x359ed2[_0x2ca6('0x1c')];var _0x251a9e;if(_0x3fadd7>=_0x1d8a7d){_0x3fadd7=_0x1d8a7d;_0x251a9e=0xc8;}else{_0x251a9e=0xce;}_0xef7e04[_0x2ca6('0x19')](_0x251a9e);return _0xef7e04[_0x2ca6('0x1f')](_0x2ca6('0x20'),_0x502d99+'-'+_0x3fadd7+'/'+_0x1d8a7d)['json'](_0x125c29);}return null;};}function patchUpdates(_0x4ed5c4){return function(_0xc4da34){try{jsonpatch[_0x2ca6('0x21')](_0xc4da34,_0x4ed5c4,!![]);}catch(_0xdaee0d){return BPromise[_0x2ca6('0x22')](_0xdaee0d);}return _0xc4da34[_0x2ca6('0x23')]();};}function saveUpdates(_0x213801,_0x4e9268){return function(_0x72b65f){if(_0x72b65f){return _0x72b65f['update'](_0x213801)[_0x2ca6('0x24')](function(_0x381fea){return _0x381fea;});}return null;};}function removeEntity(_0x4dab1b,_0x488891){return function(_0x36600c){if(_0x36600c){return _0x36600c[_0x2ca6('0x25')]()[_0x2ca6('0x24')](function(){_0x4dab1b[_0x2ca6('0x19')](0xcc)[_0x2ca6('0x1a')]();});}};}function handleEntityNotFound(_0x4fae40,_0x46b0ab){return function(_0x2a1a44){if(!_0x2a1a44){_0x4fae40['sendStatus'](0x194);}return _0x2a1a44;};}function handleError(_0x8123f6,_0x2c2917){_0x2c2917=_0x2c2917||0x1f4;return function(_0x10748e){logger[_0x2ca6('0x26')](_0x10748e['stack']);if(_0x10748e[_0x2ca6('0x27')]){delete _0x10748e[_0x2ca6('0x27')];}_0x8123f6[_0x2ca6('0x19')](_0x2c2917)[_0x2ca6('0x28')](_0x10748e);};}exports[_0x2ca6('0x29')]=function(_0x576369,_0x13298d){var _0x26f206={},_0xc0131a={},_0x36ae13={'count':0x0,'rows':[]};var _0x591075=_['map'](db['ZohoAccount']['rawAttributes'],function(_0x1b1f5b){return{'name':_0x1b1f5b[_0x2ca6('0x2a')],'type':_0x1b1f5b[_0x2ca6('0x2b')][_0x2ca6('0x2c')]};});_0xc0131a['model']=_[_0x2ca6('0x2d')](_0x591075,_0x2ca6('0x27'));_0xc0131a[_0x2ca6('0x2e')]=_[_0x2ca6('0x2f')](_0x576369['query']);_0xc0131a[_0x2ca6('0x30')]=_['intersection'](_0xc0131a['model'],_0xc0131a['query']);_0x26f206[_0x2ca6('0x31')]=_['intersection'](_0xc0131a[_0x2ca6('0x32')],qs[_0x2ca6('0x33')](_0x576369[_0x2ca6('0x2e')][_0x2ca6('0x33')]));_0x26f206[_0x2ca6('0x31')]=_0x26f206[_0x2ca6('0x31')]['length']?_0x26f206[_0x2ca6('0x31')]:_0xc0131a[_0x2ca6('0x32')];if(!_0x576369[_0x2ca6('0x2e')][_0x2ca6('0x34')](_0x2ca6('0x35'))){_0x26f206[_0x2ca6('0x1c')]=qs[_0x2ca6('0x1c')](_0x576369[_0x2ca6('0x2e')]['limit']);_0x26f206[_0x2ca6('0x1e')]=qs[_0x2ca6('0x1e')](_0x576369[_0x2ca6('0x2e')][_0x2ca6('0x1e')]);}_0x26f206[_0x2ca6('0x36')]=qs[_0x2ca6('0x37')](_0x576369[_0x2ca6('0x2e')][_0x2ca6('0x37')]);_0x26f206['where']=qs[_0x2ca6('0x30')](_[_0x2ca6('0x38')](_0x576369['query'],_0xc0131a[_0x2ca6('0x30')]),_0x591075);if(_0x576369[_0x2ca6('0x2e')][_0x2ca6('0x39')]){_0x26f206[_0x2ca6('0x3a')]=_[_0x2ca6('0x3b')](_0x26f206[_0x2ca6('0x3a')],{'$or':_['map'](_0x591075,function(_0x5b39db){if(_0x5b39db[_0x2ca6('0x2b')]!==_0x2ca6('0x3c')){var _0x356fd2={};_0x356fd2[_0x5b39db[_0x2ca6('0x27')]]={'$like':'%'+_0x576369['query'][_0x2ca6('0x39')]+'%'};return _0x356fd2;}})});}_0x26f206=_['merge']({},_0x26f206,_0x576369[_0x2ca6('0x3d')]);var _0x197b6={'where':_0x26f206[_0x2ca6('0x3a')]};return db[_0x2ca6('0x3e')][_0x2ca6('0x3f')](_0x197b6)[_0x2ca6('0x24')](function(_0x44dbc0){_0x36ae13[_0x2ca6('0x3f')]=_0x44dbc0;if(_0x576369['query'][_0x2ca6('0x40')]){_0x26f206[_0x2ca6('0x41')]=[{'all':!![]}];}return db[_0x2ca6('0x3e')][_0x2ca6('0x42')](_0x26f206);})[_0x2ca6('0x24')](function(_0x285b0e){_0x36ae13['rows']=_0x285b0e;return _0x36ae13;})[_0x2ca6('0x24')](respondWithFilteredResult(_0x13298d,_0x26f206))[_0x2ca6('0x43')](handleError(_0x13298d,null));};exports[_0x2ca6('0x44')]=function(_0x289a23,_0x29ec06){var _0x4291cc={'raw':![],'where':{'id':_0x289a23['params']['id']}},_0xaaf3ab={};_0xaaf3ab[_0x2ca6('0x32')]=_[_0x2ca6('0x2f')](db[_0x2ca6('0x3e')][_0x2ca6('0x45')]);_0xaaf3ab[_0x2ca6('0x2e')]=_[_0x2ca6('0x2f')](_0x289a23[_0x2ca6('0x2e')]);_0xaaf3ab[_0x2ca6('0x30')]=_[_0x2ca6('0x46')](_0xaaf3ab[_0x2ca6('0x32')],_0xaaf3ab[_0x2ca6('0x2e')]);_0x4291cc[_0x2ca6('0x31')]=_[_0x2ca6('0x46')](_0xaaf3ab['model'],qs['fields'](_0x289a23['query'][_0x2ca6('0x33')]));_0x4291cc['attributes']=_0x4291cc[_0x2ca6('0x31')][_0x2ca6('0x47')]?_0x4291cc[_0x2ca6('0x31')]:_0xaaf3ab[_0x2ca6('0x32')];if(_0x289a23['query'][_0x2ca6('0x40')]){_0x4291cc[_0x2ca6('0x41')]=[{'all':!![]}];}_0x4291cc=_['merge']({},_0x4291cc,_0x289a23[_0x2ca6('0x3d')]);return db[_0x2ca6('0x3e')][_0x2ca6('0x48')](_0x4291cc)[_0x2ca6('0x24')](handleEntityNotFound(_0x29ec06,null))[_0x2ca6('0x24')](respondWithResult(_0x29ec06,null))[_0x2ca6('0x43')](handleError(_0x29ec06,null));};exports[_0x2ca6('0x49')]=function(_0x2051b2,_0x587477){return db['ZohoAccount'][_0x2ca6('0x49')](_0x2051b2['body'],{})[_0x2ca6('0x24')](respondWithResult(_0x587477,0xc9))[_0x2ca6('0x43')](handleError(_0x587477,null));};exports['update']=function(_0x31c44d,_0x18c0ee){if(_0x31c44d[_0x2ca6('0x4a')]['id']){delete _0x31c44d[_0x2ca6('0x4a')]['id'];}return db['ZohoAccount'][_0x2ca6('0x48')]({'where':{'id':_0x31c44d[_0x2ca6('0x4b')]['id']}})[_0x2ca6('0x24')](handleEntityNotFound(_0x18c0ee,null))['then'](saveUpdates(_0x31c44d['body'],null))['then'](respondWithResult(_0x18c0ee,null))[_0x2ca6('0x43')](handleError(_0x18c0ee,null));};exports[_0x2ca6('0x25')]=function(_0x11bfd7,_0x583188){return db[_0x2ca6('0x3e')]['find']({'where':{'id':_0x11bfd7[_0x2ca6('0x4b')]['id']}})[_0x2ca6('0x24')](handleEntityNotFound(_0x583188,null))['then'](removeEntity(_0x583188,null))[_0x2ca6('0x43')](handleError(_0x583188,null));};exports[_0x2ca6('0x4c')]=function(_0x4a7094,_0xaba4e4,_0xf34970){var _0x12a412={};var _0x705811={};var _0x1a1c01;var _0x2edb69;return db[_0x2ca6('0x3e')]['findOne']({'where':{'id':_0x4a7094[_0x2ca6('0x4b')]['id']}})['then'](handleEntityNotFound(_0xaba4e4,null))[_0x2ca6('0x24')](function(_0x5c811a){if(_0x5c811a){_0x1a1c01=_0x5c811a;_0x705811['model']=_['keys'](db[_0x2ca6('0x4d')][_0x2ca6('0x45')]);_0x705811[_0x2ca6('0x2e')]=_[_0x2ca6('0x2f')](_0x4a7094[_0x2ca6('0x2e')]);_0x705811['filters']=_[_0x2ca6('0x46')](_0x705811['model'],_0x705811[_0x2ca6('0x2e')]);_0x12a412[_0x2ca6('0x31')]=_[_0x2ca6('0x46')](_0x705811['model'],qs[_0x2ca6('0x33')](_0x4a7094[_0x2ca6('0x2e')]['fields']));_0x12a412[_0x2ca6('0x31')]=_0x12a412['attributes']['length']?_0x12a412['attributes']:_0x705811[_0x2ca6('0x32')];_0x12a412['order']=qs['sort'](_0x4a7094['query']['sort']);_0x12a412[_0x2ca6('0x3a')]=qs[_0x2ca6('0x30')](_[_0x2ca6('0x38')](_0x4a7094[_0x2ca6('0x2e')],_0x705811[_0x2ca6('0x30')]));if(_0x4a7094['query'][_0x2ca6('0x39')]){_0x12a412[_0x2ca6('0x3a')]=_[_0x2ca6('0x3b')](_0x12a412[_0x2ca6('0x3a')],{'$or':_[_0x2ca6('0x2d')](_0x12a412['attributes'],function(_0x26016f){var _0x455639={};_0x455639[_0x26016f]={'$like':'%'+_0x4a7094[_0x2ca6('0x2e')][_0x2ca6('0x39')]+'%'};return _0x455639;})});}_0x12a412=_[_0x2ca6('0x3b')]({},_0x12a412,_0x4a7094[_0x2ca6('0x3d')]);return _0x1a1c01['getConfigurations'](_0x12a412);}})[_0x2ca6('0x24')](function(_0x5cd536){if(_0x5cd536){_0x2edb69=_0x5cd536[_0x2ca6('0x47')];if(!_0x4a7094[_0x2ca6('0x2e')][_0x2ca6('0x34')](_0x2ca6('0x35'))){_0x12a412['limit']=qs['limit'](_0x4a7094[_0x2ca6('0x2e')][_0x2ca6('0x1c')]);_0x12a412[_0x2ca6('0x1e')]=qs[_0x2ca6('0x1e')](_0x4a7094[_0x2ca6('0x2e')][_0x2ca6('0x1e')]);}return _0x1a1c01[_0x2ca6('0x4c')](_0x12a412);}})[_0x2ca6('0x24')](function(_0x115fdc){if(_0x115fdc){return _0x115fdc?{'count':_0x2edb69,'rows':_0x115fdc}:null;}})['then'](respondWithResult(_0xaba4e4,null))[_0x2ca6('0x43')](handleError(_0xaba4e4,null));};exports[_0x2ca6('0x4e')]=function(_0x1dfc69,_0x3edde0,_0x34feee){if(_0x1dfc69[_0x2ca6('0x4a')]['id']){delete _0x1dfc69[_0x2ca6('0x4a')]['id'];}return db['ZohoAccount'][_0x2ca6('0x4f')]({'where':{'id':_0x1dfc69['params']['id']}})['then'](handleEntityNotFound(_0x3edde0,null))[_0x2ca6('0x24')](function(_0x5ef823){if(_0x5ef823){_0x1dfc69[_0x2ca6('0x4a')][_0x2ca6('0x50')]=_0x5ef823['id'];_0x1dfc69[_0x2ca6('0x4a')][_0x2ca6('0x51')]=integrations[_0x2ca6('0x52')](_0x1dfc69['body'][_0x2ca6('0x53')],_0x1dfc69[_0x2ca6('0x4a')][_0x2ca6('0x2b')]);_0x1dfc69[_0x2ca6('0x4a')][_0x2ca6('0x54')]=integrations[_0x2ca6('0x55')](_0x1dfc69[_0x2ca6('0x4a')]['channel'],_0x1dfc69[_0x2ca6('0x4a')]['type']);return db[_0x2ca6('0x4d')][_0x2ca6('0x49')](_0x1dfc69[_0x2ca6('0x4a')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x2ca6('0x54')}]});}return null;})['then'](respondWithResult(_0x3edde0,null))[_0x2ca6('0x43')](handleError(_0x3edde0,null));};function getAccessToken(_0x45a5c2){return new Promise(function(_0x3aa8a4,_0x4483e0){var _0x3742b7;switch(_0x45a5c2['zone']){case'US':_0x3742b7='https://accounts.zoho.com';break;case'AU':_0x3742b7=_0x2ca6('0x56');break;case'EU':_0x3742b7=_0x2ca6('0x57');break;case'IN':_0x3742b7=_0x2ca6('0x58');break;case'CN':_0x3742b7=_0x2ca6('0x59');break;default:_0x3742b7=_0x2ca6('0x57');break;}var _0x37acad={'method':_0x2ca6('0x5a'),'uri':_0x3742b7+_0x2ca6('0x5b'),'qs':{'refresh_token':_0x45a5c2[_0x2ca6('0x5c')],'client_id':_0x45a5c2[_0x2ca6('0x5d')],'client_secret':_0x45a5c2[_0x2ca6('0x5e')],'grant_type':_0x2ca6('0x5f')},'json':!![]};return rp(_0x37acad)[_0x2ca6('0x24')](function(_0x413ce2){if(_0x413ce2[_0x2ca6('0x60')]){_0x3aa8a4(_0x413ce2[_0x2ca6('0x60')]);}else{_0x4483e0(_0x2ca6('0x61'));}})['catch'](function(_0x1704d8){_0x4483e0(_0x1704d8);});});}exports[_0x2ca6('0x62')]=function(_0x3d2f3e,_0x2f1cd2,_0x211b36){var _0x56dd1e,_0x5f0ccc,_0x20a49e,_0x36c629,_0x15ebdd;return db[_0x2ca6('0x3e')]['findOne']({'where':{'id':_0x3d2f3e['params']['id']},'attributes':['id',_0x2ca6('0x63'),_0x2ca6('0x64'),_0x2ca6('0x5d'),_0x2ca6('0x5e'),_0x2ca6('0x65'),_0x2ca6('0x66'),_0x2ca6('0x5c')]})[_0x2ca6('0x24')](handleEntityNotFound(_0x2f1cd2,null))[_0x2ca6('0x24')](function(_0x260de0){_0x15ebdd=_0x260de0;_0x56dd1e=_0x15ebdd[_0x2ca6('0x63')];_0x5f0ccc=_0x56dd1e===_0x2ca6('0x67')?'eu':_0x2ca6('0x68');_0x20a49e=_0x15ebdd[_0x2ca6('0x65')];var _0x413466=_0x20a49e[_0x2ca6('0x69')](-0x1);if(_0x413466==='/'||_0x413466==='\x5c'||_0x413466===':'){_0x20a49e=_0x20a49e['substring'](0x0,_0x20a49e[_0x2ca6('0x6a')](_0x413466));}if(!_0x15ebdd[_0x2ca6('0x5c')]){throw new Error(_0x2ca6('0x6b'));}return getAccessToken(_0x15ebdd);})[_0x2ca6('0x24')](function(_0x481238){if(_0x481238){return rp({'method':'GET','uri':util[_0x2ca6('0x6c')](_0x2ca6('0x6d'),_0x5f0ccc),'qs':{'module':_0x2ca6('0x6e')},'headers':{'Authorization':_0x2ca6('0x6f')+_0x481238},'json':!![]});}})[_0x2ca6('0x24')](function(_0x2af511){if(_0x2af511){if(_0x2af511[_0x2ca6('0x70')]&&_0x2af511['response'][_0x2ca6('0x26')]){throw new Error(_0x2af511[_0x2ca6('0x70')][_0x2ca6('0x26')][_0x2ca6('0x71')]);}var _0x1e976e=[];var _0x3a6147=[];var _0x28f6ff=[_0x2ca6('0x72'),_0x2ca6('0x73'),_0x2ca6('0x74'),_0x2ca6('0x75'),_0x2ca6('0x76'),_0x2ca6('0x77'),_0x2ca6('0x78'),_0x2ca6('0x79')];_0x3a6147=_[_0x2ca6('0x7a')](_0x2af511[_0x2ca6('0x33')],function(_0x57722e){return _0x28f6ff[_0x2ca6('0x7b')](_0x57722e[_0x2ca6('0x7c')]);});for(var _0x1f2ed0=0x0;_0x1f2ed0<_0x3a6147[_0x2ca6('0x47')];_0x1f2ed0++){if(_0x3a6147[_0x1f2ed0]['system_mandatory']===![]){_0x1e976e['push']({'id':_0x3a6147[_0x1f2ed0]['id'],'name':_0x3a6147[_0x1f2ed0][_0x2ca6('0x7d')],'custom':_0x3a6147[_0x1f2ed0][_0x2ca6('0x7e')],'options':_0x3a6147[_0x1f2ed0][_0x2ca6('0x7f')]===_0x2ca6('0x80')&&_0x3a6147[_0x1f2ed0]['pick_list_values'][_0x2ca6('0x47')]>-0x1?_['map'](_0x3a6147[_0x1f2ed0][_0x2ca6('0x81')],function(_0x20637d){return{'name':_0x20637d,'value':_0x20637d};}):[]});}}return{'count':_0x1e976e[_0x2ca6('0x47')],'rows':_0x1e976e};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2f1cd2,null))[_0x2ca6('0x43')](function(_0x19fd3e){var _0x3525bb=_0x3d2f3e['query'][_0x2ca6('0x82')]?0x1f4:_0x19fd3e[_0x2ca6('0x83')]||0x1f4;logger[_0x2ca6('0x26')](_0x2ca6('0x84'),'getFields',_0x3525bb,JSON[_0x2ca6('0x85')](_0x19fd3e));delete _0x19fd3e[_0x2ca6('0x27')];if(_0x3525bb===0x191){_0x3525bb=0x190;}_0x2f1cd2[_0x2ca6('0x19')](_0x3525bb)[_0x2ca6('0x28')](_0x3d2f3e['query'][_0x2ca6('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x19fd3e[_0x2ca6('0x83')]}:_0x19fd3e);});}; \ No newline at end of file +var _0x7c41=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','getSubjects','channel','getDescriptions','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Description','WhoId','Call_Duration','Call_Start_Time','includes','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order'];(function(_0xd9a7b1,_0x3b9a21){var _0x12c70a=function(_0x484c6e){while(--_0x484c6e){_0xd9a7b1['push'](_0xd9a7b1['shift']());}};_0x12c70a(++_0x3b9a21);}(_0x7c41,0xc8));var _0x17c4=function(_0x4aeede,_0x1415b5){_0x4aeede=_0x4aeede-0x0;var _0x395439=_0x7c41[_0x4aeede];return _0x395439;};'use strict';var emlformat=require(_0x17c4('0x0'));var rimraf=require(_0x17c4('0x1'));var zipdir=require(_0x17c4('0x2'));var jsonpatch=require(_0x17c4('0x3'));var rp=require(_0x17c4('0x4'));var moment=require(_0x17c4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17c4('0x6'));var util=require('util');var path=require(_0x17c4('0x7'));var sox=require(_0x17c4('0x8'));var csv=require(_0x17c4('0x9'));var ejs=require(_0x17c4('0xa'));var fs=require('fs');var fs_extra=require(_0x17c4('0xb'));var _=require(_0x17c4('0xc'));var squel=require(_0x17c4('0xd'));var crypto=require(_0x17c4('0xe'));var jsforce=require(_0x17c4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x17c4('0x9'));var querystring=require(_0x17c4('0x10'));var Papa=require(_0x17c4('0x11'));var Redis=require(_0x17c4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x17c4('0x13'));var as=require(_0x17c4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17c4('0x15'))(_0x17c4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x17c4('0x17'))['db'];var integrations=require(_0x17c4('0x18'));function respondWithStatusCode(_0x1de1fa,_0x3bd08e){_0x3bd08e=_0x3bd08e||0xcc;return function(_0x48c2ff){if(_0x48c2ff){return _0x1de1fa[_0x17c4('0x19')](_0x3bd08e);}return _0x1de1fa[_0x17c4('0x1a')](_0x3bd08e)[_0x17c4('0x1b')]();};}function respondWithResult(_0x58efc9,_0x534917){_0x534917=_0x534917||0xc8;return function(_0x7f6d2d){if(_0x7f6d2d){return _0x58efc9[_0x17c4('0x1a')](_0x534917)[_0x17c4('0x1c')](_0x7f6d2d);}};}function respondWithFilteredResult(_0x3209bc,_0x2023fd){return function(_0xf66c0a){if(_0xf66c0a){var _0x462cc7=typeof _0x2023fd[_0x17c4('0x1d')]==='undefined'&&typeof _0x2023fd[_0x17c4('0x1e')]==='undefined';var _0x2e832b=_0xf66c0a['count'];var _0x42f354=_0x462cc7?0x0:_0x2023fd[_0x17c4('0x1d')];var _0x12e57e=_0x462cc7?_0xf66c0a[_0x17c4('0x1f')]:_0x2023fd[_0x17c4('0x1d')]+_0x2023fd[_0x17c4('0x1e')];var _0x120b46;if(_0x12e57e>=_0x2e832b){_0x12e57e=_0x2e832b;_0x120b46=0xc8;}else{_0x120b46=0xce;}_0x3209bc['status'](_0x120b46);return _0x3209bc[_0x17c4('0x20')]('Content-Range',_0x42f354+'-'+_0x12e57e+'/'+_0x2e832b)[_0x17c4('0x1c')](_0xf66c0a);}return null;};}function patchUpdates(_0x45c709){return function(_0x4e55a1){try{jsonpatch[_0x17c4('0x21')](_0x4e55a1,_0x45c709,!![]);}catch(_0x254c44){return BPromise[_0x17c4('0x22')](_0x254c44);}return _0x4e55a1[_0x17c4('0x23')]();};}function saveUpdates(_0x41af65,_0x5f2c0e){return function(_0x2da7b6){if(_0x2da7b6){return _0x2da7b6[_0x17c4('0x24')](_0x41af65)[_0x17c4('0x25')](function(_0x42f2d8){return _0x42f2d8;});}return null;};}function removeEntity(_0x32020a,_0x496bc6){return function(_0x578837){if(_0x578837){return _0x578837[_0x17c4('0x26')]()[_0x17c4('0x25')](function(){_0x32020a[_0x17c4('0x1a')](0xcc)[_0x17c4('0x1b')]();});}};}function handleEntityNotFound(_0x3fd896,_0x5032d5){return function(_0x441c0e){if(!_0x441c0e){_0x3fd896[_0x17c4('0x19')](0x194);}return _0x441c0e;};}function handleError(_0xfa9dde,_0x303968){_0x303968=_0x303968||0x1f4;return function(_0x2d39e1){logger['error'](_0x2d39e1[_0x17c4('0x27')]);if(_0x2d39e1[_0x17c4('0x28')]){delete _0x2d39e1[_0x17c4('0x28')];}_0xfa9dde[_0x17c4('0x1a')](_0x303968)[_0x17c4('0x29')](_0x2d39e1);};}exports[_0x17c4('0x2a')]=function(_0x19920e,_0x2166f4){var _0x16d6c2={},_0x3510b1={},_0x57608e={'count':0x0,'rows':[]};var _0x3eb9ac=_['map'](db[_0x17c4('0x2b')][_0x17c4('0x2c')],function(_0x46afdb){return{'name':_0x46afdb[_0x17c4('0x2d')],'type':_0x46afdb[_0x17c4('0x2e')][_0x17c4('0x2f')]};});_0x3510b1['model']=_[_0x17c4('0x30')](_0x3eb9ac,'name');_0x3510b1[_0x17c4('0x31')]=_[_0x17c4('0x32')](_0x19920e[_0x17c4('0x31')]);_0x3510b1[_0x17c4('0x33')]=_[_0x17c4('0x34')](_0x3510b1['model'],_0x3510b1[_0x17c4('0x31')]);_0x16d6c2[_0x17c4('0x35')]=_[_0x17c4('0x34')](_0x3510b1[_0x17c4('0x36')],qs['fields'](_0x19920e[_0x17c4('0x31')][_0x17c4('0x37')]));_0x16d6c2['attributes']=_0x16d6c2[_0x17c4('0x35')][_0x17c4('0x38')]?_0x16d6c2[_0x17c4('0x35')]:_0x3510b1[_0x17c4('0x36')];if(!_0x19920e[_0x17c4('0x31')][_0x17c4('0x39')](_0x17c4('0x3a'))){_0x16d6c2[_0x17c4('0x1e')]=qs[_0x17c4('0x1e')](_0x19920e[_0x17c4('0x31')][_0x17c4('0x1e')]);_0x16d6c2[_0x17c4('0x1d')]=qs[_0x17c4('0x1d')](_0x19920e['query']['offset']);}_0x16d6c2[_0x17c4('0x3b')]=qs[_0x17c4('0x3c')](_0x19920e[_0x17c4('0x31')][_0x17c4('0x3c')]);_0x16d6c2[_0x17c4('0x3d')]=qs[_0x17c4('0x33')](_[_0x17c4('0x3e')](_0x19920e[_0x17c4('0x31')],_0x3510b1[_0x17c4('0x33')]),_0x3eb9ac);if(_0x19920e[_0x17c4('0x31')][_0x17c4('0x3f')]){_0x16d6c2[_0x17c4('0x3d')]=_[_0x17c4('0x40')](_0x16d6c2['where'],{'$or':_[_0x17c4('0x30')](_0x3eb9ac,function(_0x3d1d12){if(_0x3d1d12[_0x17c4('0x2e')]!==_0x17c4('0x41')){var _0x46d005={};_0x46d005[_0x3d1d12[_0x17c4('0x28')]]={'$like':'%'+_0x19920e[_0x17c4('0x31')]['filter']+'%'};return _0x46d005;}})});}_0x16d6c2=_[_0x17c4('0x40')]({},_0x16d6c2,_0x19920e[_0x17c4('0x42')]);var _0x18b945={'where':_0x16d6c2[_0x17c4('0x3d')]};return db['ZohoAccount'][_0x17c4('0x1f')](_0x18b945)[_0x17c4('0x25')](function(_0x2b014d){_0x57608e[_0x17c4('0x1f')]=_0x2b014d;if(_0x19920e[_0x17c4('0x31')][_0x17c4('0x43')]){_0x16d6c2['include']=[{'all':!![]}];}return db[_0x17c4('0x2b')][_0x17c4('0x44')](_0x16d6c2);})[_0x17c4('0x25')](function(_0x3b7c4c){_0x57608e[_0x17c4('0x45')]=_0x3b7c4c;return _0x57608e;})[_0x17c4('0x25')](respondWithFilteredResult(_0x2166f4,_0x16d6c2))[_0x17c4('0x46')](handleError(_0x2166f4,null));};exports[_0x17c4('0x47')]=function(_0x2e2766,_0x174014){var _0xbda00f={'raw':![],'where':{'id':_0x2e2766[_0x17c4('0x48')]['id']}},_0x41c519={};_0x41c519['model']=_[_0x17c4('0x32')](db[_0x17c4('0x2b')][_0x17c4('0x2c')]);_0x41c519['query']=_[_0x17c4('0x32')](_0x2e2766[_0x17c4('0x31')]);_0x41c519[_0x17c4('0x33')]=_[_0x17c4('0x34')](_0x41c519[_0x17c4('0x36')],_0x41c519[_0x17c4('0x31')]);_0xbda00f[_0x17c4('0x35')]=_[_0x17c4('0x34')](_0x41c519[_0x17c4('0x36')],qs[_0x17c4('0x37')](_0x2e2766['query']['fields']));_0xbda00f[_0x17c4('0x35')]=_0xbda00f[_0x17c4('0x35')][_0x17c4('0x38')]?_0xbda00f[_0x17c4('0x35')]:_0x41c519[_0x17c4('0x36')];if(_0x2e2766[_0x17c4('0x31')][_0x17c4('0x43')]){_0xbda00f['include']=[{'all':!![]}];}_0xbda00f=_[_0x17c4('0x40')]({},_0xbda00f,_0x2e2766[_0x17c4('0x42')]);return db[_0x17c4('0x2b')][_0x17c4('0x49')](_0xbda00f)[_0x17c4('0x25')](handleEntityNotFound(_0x174014,null))[_0x17c4('0x25')](respondWithResult(_0x174014,null))[_0x17c4('0x46')](handleError(_0x174014,null));};exports[_0x17c4('0x4a')]=function(_0x27a0b0,_0x109db3){return db[_0x17c4('0x2b')][_0x17c4('0x4a')](_0x27a0b0[_0x17c4('0x4b')],{})[_0x17c4('0x25')](respondWithResult(_0x109db3,0xc9))[_0x17c4('0x46')](handleError(_0x109db3,null));};exports[_0x17c4('0x24')]=function(_0x57ad92,_0x46c166){if(_0x57ad92['body']['id']){delete _0x57ad92['body']['id'];}return db[_0x17c4('0x2b')][_0x17c4('0x49')]({'where':{'id':_0x57ad92[_0x17c4('0x48')]['id']}})['then'](handleEntityNotFound(_0x46c166,null))[_0x17c4('0x25')](saveUpdates(_0x57ad92[_0x17c4('0x4b')],null))[_0x17c4('0x25')](respondWithResult(_0x46c166,null))[_0x17c4('0x46')](handleError(_0x46c166,null));};exports[_0x17c4('0x26')]=function(_0x21f89e,_0x453bd3){return db[_0x17c4('0x2b')][_0x17c4('0x49')]({'where':{'id':_0x21f89e[_0x17c4('0x48')]['id']}})[_0x17c4('0x25')](handleEntityNotFound(_0x453bd3,null))[_0x17c4('0x25')](removeEntity(_0x453bd3,null))['catch'](handleError(_0x453bd3,null));};exports['getConfigurations']=function(_0x1a319c,_0x55e0c5,_0x4bd41a){var _0x408139={};var _0x4e3e12={};var _0x5c6ec6;var _0x2ea285;return db['ZohoAccount'][_0x17c4('0x4c')]({'where':{'id':_0x1a319c['params']['id']}})[_0x17c4('0x25')](handleEntityNotFound(_0x55e0c5,null))['then'](function(_0x53377e){if(_0x53377e){_0x5c6ec6=_0x53377e;_0x4e3e12['model']=_[_0x17c4('0x32')](db[_0x17c4('0x4d')][_0x17c4('0x2c')]);_0x4e3e12['query']=_[_0x17c4('0x32')](_0x1a319c[_0x17c4('0x31')]);_0x4e3e12[_0x17c4('0x33')]=_[_0x17c4('0x34')](_0x4e3e12['model'],_0x4e3e12[_0x17c4('0x31')]);_0x408139[_0x17c4('0x35')]=_[_0x17c4('0x34')](_0x4e3e12[_0x17c4('0x36')],qs[_0x17c4('0x37')](_0x1a319c['query']['fields']));_0x408139[_0x17c4('0x35')]=_0x408139[_0x17c4('0x35')][_0x17c4('0x38')]?_0x408139['attributes']:_0x4e3e12[_0x17c4('0x36')];_0x408139['order']=qs['sort'](_0x1a319c[_0x17c4('0x31')][_0x17c4('0x3c')]);_0x408139['where']=qs['filters'](_[_0x17c4('0x3e')](_0x1a319c[_0x17c4('0x31')],_0x4e3e12[_0x17c4('0x33')]));if(_0x1a319c[_0x17c4('0x31')][_0x17c4('0x3f')]){_0x408139[_0x17c4('0x3d')]=_['merge'](_0x408139[_0x17c4('0x3d')],{'$or':_[_0x17c4('0x30')](_0x408139['attributes'],function(_0x2b222b){var _0x18cc01={};_0x18cc01[_0x2b222b]={'$like':'%'+_0x1a319c[_0x17c4('0x31')]['filter']+'%'};return _0x18cc01;})});}_0x408139=_[_0x17c4('0x40')]({},_0x408139,_0x1a319c[_0x17c4('0x42')]);return _0x5c6ec6[_0x17c4('0x4e')](_0x408139);}})[_0x17c4('0x25')](function(_0x194a13){if(_0x194a13){_0x2ea285=_0x194a13['length'];if(!_0x1a319c[_0x17c4('0x31')][_0x17c4('0x39')](_0x17c4('0x3a'))){_0x408139['limit']=qs['limit'](_0x1a319c[_0x17c4('0x31')][_0x17c4('0x1e')]);_0x408139[_0x17c4('0x1d')]=qs[_0x17c4('0x1d')](_0x1a319c[_0x17c4('0x31')][_0x17c4('0x1d')]);}return _0x5c6ec6['getConfigurations'](_0x408139);}})[_0x17c4('0x25')](function(_0x456953){if(_0x456953){return _0x456953?{'count':_0x2ea285,'rows':_0x456953}:null;}})[_0x17c4('0x25')](respondWithResult(_0x55e0c5,null))['catch'](handleError(_0x55e0c5,null));};exports[_0x17c4('0x4f')]=function(_0xc28405,_0x20fb20,_0x262c77){if(_0xc28405[_0x17c4('0x4b')]['id']){delete _0xc28405['body']['id'];}return db[_0x17c4('0x2b')]['findOne']({'where':{'id':_0xc28405[_0x17c4('0x48')]['id']}})[_0x17c4('0x25')](handleEntityNotFound(_0x20fb20,null))[_0x17c4('0x25')](function(_0x3c0e2b){if(_0x3c0e2b){_0xc28405['body']['AccountId']=_0x3c0e2b['id'];_0xc28405[_0x17c4('0x4b')]['Subjects']=integrations[_0x17c4('0x50')](_0xc28405[_0x17c4('0x4b')][_0x17c4('0x51')],_0xc28405['body'][_0x17c4('0x2e')]);_0xc28405['body']['Descriptions']=integrations[_0x17c4('0x52')](_0xc28405['body']['channel'],_0xc28405['body'][_0x17c4('0x2e')]);return db[_0x17c4('0x4d')][_0x17c4('0x4a')](_0xc28405[_0x17c4('0x4b')],{'include':[{'model':db[_0x17c4('0x53')],'as':_0x17c4('0x54')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x17c4('0x25')](respondWithResult(_0x20fb20,null))[_0x17c4('0x46')](handleError(_0x20fb20,null));};function getAccessToken(_0x4891fe){return new Promise(function(_0x5f07bb,_0x31148a){var _0x626734;switch(_0x4891fe['zone']){case'US':_0x626734=_0x17c4('0x55');break;case'AU':_0x626734=_0x17c4('0x56');break;case'EU':_0x626734=_0x17c4('0x57');break;case'IN':_0x626734='https://accounts.zoho.in';break;case'CN':_0x626734=_0x17c4('0x58');break;default:_0x626734='https://accounts.zoho.eu';break;}var _0x196182={'method':_0x17c4('0x59'),'uri':_0x626734+_0x17c4('0x5a'),'qs':{'refresh_token':_0x4891fe[_0x17c4('0x5b')],'client_id':_0x4891fe[_0x17c4('0x5c')],'client_secret':_0x4891fe[_0x17c4('0x5d')],'grant_type':_0x17c4('0x5e')},'json':!![]};return rp(_0x196182)[_0x17c4('0x25')](function(_0x3afd66){if(_0x3afd66[_0x17c4('0x5f')]){_0x5f07bb(_0x3afd66['access_token']);}else{_0x31148a(_0x17c4('0x60'));}})[_0x17c4('0x46')](function(_0x822d1b){_0x31148a(_0x822d1b);});});}exports[_0x17c4('0x61')]=function(_0x1395a0,_0xbee1e5,_0x27f21c){var _0x3bcc18,_0x143ca1,_0x231f0a,_0x253cb0,_0x1bbfda;return db[_0x17c4('0x2b')][_0x17c4('0x4c')]({'where':{'id':_0x1395a0[_0x17c4('0x48')]['id']},'attributes':['id',_0x17c4('0x62'),_0x17c4('0x63'),'clientId',_0x17c4('0x5d'),_0x17c4('0x64'),_0x17c4('0x65'),'refreshToken']})[_0x17c4('0x25')](handleEntityNotFound(_0xbee1e5,null))[_0x17c4('0x25')](function(_0x590ac7){_0x1bbfda=_0x590ac7;_0x3bcc18=_0x1bbfda[_0x17c4('0x62')];_0x143ca1=_0x3bcc18===_0x17c4('0x66')?'eu':_0x17c4('0x67');_0x231f0a=_0x1bbfda[_0x17c4('0x64')];var _0xcd5485=_0x231f0a[_0x17c4('0x68')](-0x1);if(_0xcd5485==='/'||_0xcd5485==='\x5c'||_0xcd5485===':'){_0x231f0a=_0x231f0a[_0x17c4('0x69')](0x0,_0x231f0a[_0x17c4('0x6a')](_0xcd5485));}if(!_0x1bbfda['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1bbfda);})[_0x17c4('0x25')](function(_0x3a4ae4){if(_0x3a4ae4){return rp({'method':_0x17c4('0x6b'),'uri':util[_0x17c4('0x6c')](_0x17c4('0x6d'),_0x143ca1),'qs':{'module':_0x17c4('0x6e')},'headers':{'Authorization':_0x17c4('0x6f')+_0x3a4ae4},'json':!![]});}})[_0x17c4('0x25')](function(_0x1ea905){if(_0x1ea905){if(_0x1ea905[_0x17c4('0x70')]&&_0x1ea905[_0x17c4('0x70')][_0x17c4('0x71')]){throw new Error(_0x1ea905['response'][_0x17c4('0x71')][_0x17c4('0x72')]);}var _0x19ecc1=[];var _0xd0de=[];var _0x551700=['Owner','Subject',_0x17c4('0x73'),_0x17c4('0x74'),_0x17c4('0x75'),'Call_Result',_0x17c4('0x76'),'Call_Type'];_0xd0de=_['remove'](_0x1ea905[_0x17c4('0x37')],function(_0x2be156){return _0x551700[_0x17c4('0x77')](_0x2be156[_0x17c4('0x78')]);});for(var _0x4e524c=0x0;_0x4e524c<_0xd0de['length'];_0x4e524c++){if(_0xd0de[_0x4e524c][_0x17c4('0x79')]===![]){_0x19ecc1['push']({'id':_0xd0de[_0x4e524c]['id'],'name':_0xd0de[_0x4e524c]['display_label'],'custom':_0xd0de[_0x4e524c][_0x17c4('0x7a')],'options':_0xd0de[_0x4e524c][_0x17c4('0x7b')]===_0x17c4('0x7c')&&_0xd0de[_0x4e524c][_0x17c4('0x7d')][_0x17c4('0x38')]>-0x1?_[_0x17c4('0x30')](_0xd0de[_0x4e524c]['pick_list_values'],function(_0x1ba4e4){return{'name':_0x1ba4e4,'value':_0x1ba4e4};}):[]});}}return{'count':_0x19ecc1[_0x17c4('0x38')],'rows':_0x19ecc1};}else{return{'count':0x0,'rows':[]};}})[_0x17c4('0x25')](respondWithResult(_0xbee1e5,null))[_0x17c4('0x46')](function(_0x563498){var _0x4960d4=_0x1395a0[_0x17c4('0x31')][_0x17c4('0x7e')]?0x1f4:_0x563498['statusCode']||0x1f4;logger[_0x17c4('0x71')](_0x17c4('0x7f'),_0x17c4('0x61'),_0x4960d4,JSON[_0x17c4('0x80')](_0x563498));delete _0x563498[_0x17c4('0x28')];if(_0x4960d4===0x191){_0x4960d4=0x190;}_0xbee1e5[_0x17c4('0x1a')](_0x4960d4)[_0x17c4('0x29')](_0x1395a0[_0x17c4('0x31')][_0x17c4('0x7e')]?{'message':'Wrong\x20credentials','statusCode':_0x563498[_0x17c4('0x81')]}:_0x563498);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5b88191..72f153c 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 _0x06a1=['host','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','slice','https://accounts.zoho.com','info','util','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x1c816e,_0xbd3af5){var _0x2e0234=function(_0x138c41){while(--_0x138c41){_0x1c816e['push'](_0x1c816e['shift']());}};_0x2e0234(++_0xbd3af5);}(_0x06a1,0x195));var _0x106a=function(_0x47428d,_0x15ae59){_0x47428d=_0x47428d-0x0;var _0x314fbc=_0x06a1[_0x47428d];return _0x314fbc;};'use strict';var _=require('lodash');var util=require(_0x106a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x106a('0x1'));var BPromise=require(_0x106a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x106a('0x3'));var rimraf=require('rimraf');var config=require(_0x106a('0x4'));var attributes=require(_0x106a('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x106a('0x6')]=function(_0x3da445,_0x1fae0f){return _0x3da445['define']('ZohoAccount',attributes,{'tableName':_0x106a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3cbe61,_0x490871,_0x307251){if(_0x3cbe61[_0x106a('0x8')](_0x106a('0x9'))||_0x3cbe61[_0x106a('0x8')](_0x106a('0xa'))||_0x3cbe61['changed'](_0x106a('0xb'))||_0x3cbe61['changed'](_0x106a('0xc'))||_0x3cbe61[_0x106a('0x8')]('code')||_0x3cbe61[_0x106a('0x8')](_0x106a('0xd'))){var _0x185f95,_0x32c1a1;_0x185f95=_0x3cbe61[_0x106a('0xa')];var _0xb84a3c=_0x185f95['slice'](-0x1);if(_0xb84a3c==='/'||_0xb84a3c==='\x5c'||_0xb84a3c===':'){_0x185f95=_0x185f95[_0x106a('0xe')](0x0,_0x185f95[_0x106a('0xf')](_0xb84a3c));}switch(_0x3cbe61[_0x106a('0x9')]){case'US':_0x32c1a1='https://accounts.zoho.com';break;case'AU':_0x32c1a1=_0x106a('0x10');break;case'IN':_0x32c1a1=_0x106a('0x11');break;case'CN':_0x32c1a1=_0x106a('0x12');break;default:_0x32c1a1=_0x106a('0x13');break;}var _0x58e4bc={'method':_0x106a('0x14'),'uri':_0x32c1a1+_0x106a('0x15'),'form':{'grant_type':_0x106a('0x16'),'client_id':_0x3cbe61[_0x106a('0xb')],'client_secret':_0x3cbe61[_0x106a('0xc')],'redirect_uri':_0x3cbe61['serverUrl'],'code':_0x3cbe61[_0x106a('0x17')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x58e4bc)[_0x106a('0x18')](function(_0x103294){var _0x1ed8ac=JSON[_0x106a('0x19')](_0x103294);if(_0x1ed8ac[_0x106a('0x1a')]){_0x3cbe61[_0x106a('0x1b')]=_0x1ed8ac[_0x106a('0x1a')];logger['info'](util[_0x106a('0x1c')](_0x106a('0x1d'),_0x3cbe61['name'],_0x3cbe61['id']));}else{logger[_0x106a('0x1e')](util['format'](_0x106a('0x1f'),_0x3cbe61['name'],_0x3cbe61['id']),util[_0x106a('0x20')](_0x1ed8ac,{'showHidden':![],'depth':null}));}return _0x307251(null,_0x490871);})[_0x106a('0x21')](function(_0x450ace){logger[_0x106a('0x1e')](util[_0x106a('0x1c')](_0x106a('0x1f'),_0x3cbe61[_0x106a('0x22')],_0x3cbe61['id']),util[_0x106a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x307251(_0x450ace);});}else{return _0x307251(null,_0x490871);}},'beforeUpdate':function(_0x7ebe22,_0x10e0d7,_0x3f162c){if(_0x7ebe22[_0x106a('0x8')](_0x106a('0x9'))||_0x7ebe22[_0x106a('0x8')](_0x106a('0xa'))||_0x7ebe22['changed'](_0x106a('0xb'))||_0x7ebe22[_0x106a('0x8')](_0x106a('0xc'))||_0x7ebe22['changed']('code')||_0x7ebe22[_0x106a('0x8')](_0x106a('0xd'))){var _0x297a0b,_0x26b04d;_0x297a0b=_0x7ebe22['serverUrl'];var _0x48df3b=_0x297a0b[_0x106a('0x23')](-0x1);if(_0x48df3b==='/'||_0x48df3b==='\x5c'||_0x48df3b===':'){_0x297a0b=_0x297a0b['substring'](0x0,_0x297a0b[_0x106a('0xf')](_0x48df3b));}switch(_0x7ebe22[_0x106a('0x9')]){case'US':_0x26b04d=_0x106a('0x24');break;case'AU':_0x26b04d=_0x106a('0x10');break;case'IN':_0x26b04d='https://accounts.zoho.in';break;case'CN':_0x26b04d=_0x106a('0x12');break;default:_0x26b04d=_0x106a('0x13');break;}var _0x42f698={'method':_0x106a('0x14'),'uri':_0x26b04d+_0x106a('0x15'),'form':{'grant_type':_0x106a('0x16'),'client_id':_0x7ebe22[_0x106a('0xb')],'client_secret':_0x7ebe22[_0x106a('0xc')],'redirect_uri':_0x7ebe22[_0x106a('0xa')],'code':_0x7ebe22[_0x106a('0x17')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x42f698)[_0x106a('0x18')](function(_0x4f871c){var _0xd5775a=JSON[_0x106a('0x19')](_0x4f871c);if(_0xd5775a[_0x106a('0x1a')]){_0x7ebe22[_0x106a('0x1b')]=_0xd5775a['refresh_token'];logger[_0x106a('0x25')](util['format'](_0x106a('0x1d'),_0x7ebe22[_0x106a('0x22')],_0x7ebe22['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x7ebe22[_0x106a('0x22')],_0x7ebe22['id']),util[_0x106a('0x20')](_0xd5775a,{'showHidden':![],'depth':null}));}return _0x3f162c(null,_0x10e0d7);})[_0x106a('0x21')](function(_0x4e624a){logger['error'](util[_0x106a('0x1c')](_0x106a('0x1f'),_0x7ebe22['name'],_0x7ebe22['id']),util[_0x106a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x3f162c(_0x4e624a);});}else{return _0x3f162c(null,_0x10e0d7);}}}});}; \ No newline at end of file +var _0xd6f3=['clientSecret','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','info','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId'];(function(_0xc10392,_0x293b31){var _0x3142b8=function(_0x135d17){while(--_0x135d17){_0xc10392['push'](_0xc10392['shift']());}};_0x3142b8(++_0x293b31);}(_0xd6f3,0x72));var _0x3d6f=function(_0x5cae16,_0x42f5e7){_0x5cae16=_0x5cae16-0x0;var _0x56e96e=_0xd6f3[_0x5cae16];return _0x56e96e;};'use strict';var _=require(_0x3d6f('0x0'));var util=require(_0x3d6f('0x1'));var logger=require(_0x3d6f('0x2'))(_0x3d6f('0x3'));var moment=require(_0x3d6f('0x4'));var BPromise=require(_0x3d6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d6f('0x6'));var rimraf=require(_0x3d6f('0x7'));var config=require(_0x3d6f('0x8'));var attributes=require(_0x3d6f('0x9'));var integrations=require(_0x3d6f('0xa'));module[_0x3d6f('0xb')]=function(_0x16d50c,_0x118add){return _0x16d50c['define'](_0x3d6f('0xc'),attributes,{'tableName':_0x3d6f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x11f9ea,_0x5c8705,_0x3bbc41){if(_0x11f9ea[_0x3d6f('0xe')](_0x3d6f('0xf'))||_0x11f9ea[_0x3d6f('0xe')](_0x3d6f('0x10'))||_0x11f9ea[_0x3d6f('0xe')](_0x3d6f('0x11'))||_0x11f9ea[_0x3d6f('0xe')](_0x3d6f('0x12'))||_0x11f9ea[_0x3d6f('0xe')]('code')||_0x11f9ea[_0x3d6f('0xe')](_0x3d6f('0x13'))){var _0xde6a37,_0x16ad2b;_0xde6a37=_0x11f9ea[_0x3d6f('0x10')];var _0x354544=_0xde6a37['slice'](-0x1);if(_0x354544==='/'||_0x354544==='\x5c'||_0x354544===':'){_0xde6a37=_0xde6a37[_0x3d6f('0x14')](0x0,_0xde6a37[_0x3d6f('0x15')](_0x354544));}switch(_0x11f9ea[_0x3d6f('0xf')]){case'US':_0x16ad2b=_0x3d6f('0x16');break;case'AU':_0x16ad2b='https://accounts.zoho.com.au';break;case'IN':_0x16ad2b=_0x3d6f('0x17');break;case'CN':_0x16ad2b=_0x3d6f('0x18');break;default:_0x16ad2b='https://accounts.zoho.eu';break;}var _0x1aa3cf={'method':'POST','uri':_0x16ad2b+_0x3d6f('0x19'),'form':{'grant_type':_0x3d6f('0x1a'),'client_id':_0x11f9ea[_0x3d6f('0x11')],'client_secret':_0x11f9ea[_0x3d6f('0x12')],'redirect_uri':_0x11f9ea[_0x3d6f('0x10')],'code':_0x11f9ea['code']},'headers':{'Content-Type':_0x3d6f('0x1b')}};return rp(_0x1aa3cf)[_0x3d6f('0x1c')](function(_0x55065c){var _0x152483=JSON[_0x3d6f('0x1d')](_0x55065c);if(_0x152483[_0x3d6f('0x1e')]){_0x11f9ea[_0x3d6f('0x1f')]=_0x152483[_0x3d6f('0x1e')];logger['info'](util[_0x3d6f('0x20')](_0x3d6f('0x21'),_0x11f9ea[_0x3d6f('0x22')],_0x11f9ea['id']));}else{logger[_0x3d6f('0x23')](util[_0x3d6f('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x11f9ea[_0x3d6f('0x22')],_0x11f9ea['id']),util[_0x3d6f('0x24')](_0x152483,{'showHidden':![],'depth':null}));}return _0x3bbc41(null,_0x5c8705);})[_0x3d6f('0x25')](function(_0x5b48eb){logger['error'](util[_0x3d6f('0x20')](_0x3d6f('0x26'),_0x11f9ea[_0x3d6f('0x22')],_0x11f9ea['id']),util[_0x3d6f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3bbc41(_0x5b48eb);});}else{return _0x3bbc41(null,_0x5c8705);}},'beforeUpdate':function(_0x3721f8,_0x5ee0bd,_0x42e267){if(_0x3721f8[_0x3d6f('0xe')](_0x3d6f('0xf'))||_0x3721f8[_0x3d6f('0xe')](_0x3d6f('0x10'))||_0x3721f8[_0x3d6f('0xe')](_0x3d6f('0x11'))||_0x3721f8['changed']('clientSecret')||_0x3721f8[_0x3d6f('0xe')]('code')||_0x3721f8[_0x3d6f('0xe')](_0x3d6f('0x13'))){var _0x31adec,_0x17827e;_0x31adec=_0x3721f8[_0x3d6f('0x10')];var _0x5752e8=_0x31adec[_0x3d6f('0x27')](-0x1);if(_0x5752e8==='/'||_0x5752e8==='\x5c'||_0x5752e8===':'){_0x31adec=_0x31adec[_0x3d6f('0x14')](0x0,_0x31adec['lastIndexOf'](_0x5752e8));}switch(_0x3721f8[_0x3d6f('0xf')]){case'US':_0x17827e='https://accounts.zoho.com';break;case'AU':_0x17827e=_0x3d6f('0x28');break;case'IN':_0x17827e=_0x3d6f('0x17');break;case'CN':_0x17827e=_0x3d6f('0x18');break;default:_0x17827e=_0x3d6f('0x29');break;}var _0x818001={'method':_0x3d6f('0x2a'),'uri':_0x17827e+_0x3d6f('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x3721f8['clientId'],'client_secret':_0x3721f8[_0x3d6f('0x12')],'redirect_uri':_0x3721f8[_0x3d6f('0x10')],'code':_0x3721f8['code']},'headers':{'Content-Type':_0x3d6f('0x1b')}};return rp(_0x818001)[_0x3d6f('0x1c')](function(_0x505139){var _0x480a03=JSON[_0x3d6f('0x1d')](_0x505139);if(_0x480a03[_0x3d6f('0x1e')]){_0x3721f8[_0x3d6f('0x1f')]=_0x480a03[_0x3d6f('0x1e')];logger[_0x3d6f('0x2b')](util['format'](_0x3d6f('0x21'),_0x3721f8[_0x3d6f('0x22')],_0x3721f8['id']));}else{logger[_0x3d6f('0x23')](util[_0x3d6f('0x20')](_0x3d6f('0x26'),_0x3721f8[_0x3d6f('0x22')],_0x3721f8['id']),util[_0x3d6f('0x24')](_0x480a03,{'showHidden':![],'depth':null}));}return _0x42e267(null,_0x5ee0bd);})[_0x3d6f('0x25')](function(_0x4dc838){logger[_0x3d6f('0x23')](util[_0x3d6f('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3721f8[_0x3d6f('0x22')],_0x3721f8['id']),util[_0x3d6f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x42e267(_0x4dc838);});}else{return _0x42e267(null,_0x5ee0bd);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index a58296a..b8878c4 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 _0xfe39=['GetZohoAccount','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ZohoAccount','find','raw','ShowZohoAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x30de61,_0x10a9b7){var _0x266cf5=function(_0x192d00){while(--_0x192d00){_0x30de61['push'](_0x30de61['shift']());}};_0x266cf5(++_0x10a9b7);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xfe39[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require('moment');var BPromise=require(_0x9fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe3('0x3'))['db'];var utils=require(_0x9fe3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fe3('0x5'));var jayson=require(_0x9fe3('0x6'));var client=jayson[_0x9fe3('0x7')][_0x9fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc469b7,_0x4183ce,_0x25868f){return new BPromise(function(_0x5a3bd6,_0x211eb2){return client[_0x9fe3('0x9')](_0xc469b7,_0x25868f)[_0x9fe3('0xa')](function(_0x35c391){logger[_0x9fe3('0xb')](_0x9fe3('0xc'),_0x4183ce,'request\x20sent');logger['debug'](_0x9fe3('0xd'),_0x4183ce,_0x9fe3('0xe'),JSON['stringify'](_0x35c391));if(_0x35c391[_0x9fe3('0xf')]){if(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x10')]===0x1f4){logger[_0x9fe3('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x211eb2(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x5a3bd6(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}else{logger[_0x9fe3('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x4183ce,'request\x20sent');_0x5a3bd6(_0x35c391[_0x9fe3('0x12')][_0x9fe3('0x11')]);}})[_0x9fe3('0x13')](function(_0x2d28d4){logger['error'](_0x9fe3('0xc'),_0x4183ce,_0x2d28d4);_0x211eb2(_0x2d28d4);});});}exports[_0x9fe3('0x14')]=function(_0x15fcaa){var _0x592b8b=this;return new Promise(function(_0x35bbaf,_0x43854c){return db['ZohoAccount'][_0x9fe3('0x15')]({'raw':_0x15fcaa['options']?_0x15fcaa[_0x9fe3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x15fcaa[_0x9fe3('0x16')]?_0x15fcaa[_0x9fe3('0x16')][_0x9fe3('0x17')]||null:null,'attributes':_0x15fcaa['options']?_0x15fcaa['options'][_0x9fe3('0x18')]||null:null,'limit':_0x15fcaa[_0x9fe3('0x16')]?_0x15fcaa['options'][_0x9fe3('0x19')]||null:null,'include':_0x15fcaa[_0x9fe3('0x16')]?_0x15fcaa['options'][_0x9fe3('0x1a')]?_[_0x9fe3('0x1b')](_0x15fcaa['options'][_0x9fe3('0x1a')],function(_0x2fb7a9){return{'model':db[_0x2fb7a9[_0x9fe3('0x1c')]],'as':_0x2fb7a9['as'],'attributes':_0x2fb7a9[_0x9fe3('0x18')],'include':_0x2fb7a9[_0x9fe3('0x1a')]?_[_0x9fe3('0x1b')](_0x2fb7a9[_0x9fe3('0x1a')],function(_0x4c1a30){return{'model':db[_0x4c1a30[_0x9fe3('0x1c')]],'as':_0x4c1a30['as'],'attributes':_0x4c1a30[_0x9fe3('0x18')],'include':_0x4c1a30[_0x9fe3('0x1a')]?_[_0x9fe3('0x1b')](_0x4c1a30['include'],function(_0x1a4a43){return{'model':db[_0x1a4a43[_0x9fe3('0x1c')]],'as':_0x1a4a43['as'],'attributes':_0x1a4a43[_0x9fe3('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14ee5b){logger[_0x9fe3('0xb')](_0x9fe3('0x14'),_0x15fcaa);logger[_0x9fe3('0x1d')](_0x9fe3('0x14'),_0x15fcaa,JSON[_0x9fe3('0x1e')](_0x14ee5b));_0x35bbaf(_0x14ee5b);})['catch'](function(_0xa4d56e){logger[_0x9fe3('0xf')](_0x9fe3('0x14'),_0xa4d56e[_0x9fe3('0x11')],_0x15fcaa);_0x43854c(_0x592b8b[_0x9fe3('0xf')](0x1f4,_0xa4d56e[_0x9fe3('0x11')]));});});};exports['ShowZohoAccount']=function(_0x40a778){var _0x298318=this;return new Promise(function(_0x5e1620,_0x2a388d){return db[_0x9fe3('0x1f')][_0x9fe3('0x20')]({'raw':_0x40a778[_0x9fe3('0x16')]?_0x40a778[_0x9fe3('0x16')][_0x9fe3('0x21')]===undefined?!![]:![]:!![],'where':_0x40a778['options']?_0x40a778[_0x9fe3('0x16')][_0x9fe3('0x17')]||null:null,'attributes':_0x40a778[_0x9fe3('0x16')]?_0x40a778['options']['attributes']||null:null,'include':_0x40a778['options']?_0x40a778[_0x9fe3('0x16')]['include']?_[_0x9fe3('0x1b')](_0x40a778[_0x9fe3('0x16')][_0x9fe3('0x1a')],function(_0xa3f363){return{'model':db[_0xa3f363[_0x9fe3('0x1c')]],'as':_0xa3f363['as'],'attributes':_0xa3f363[_0x9fe3('0x18')],'include':_0xa3f363[_0x9fe3('0x1a')]?_[_0x9fe3('0x1b')](_0xa3f363[_0x9fe3('0x1a')],function(_0x49f95f){return{'model':db[_0x49f95f[_0x9fe3('0x1c')]],'as':_0x49f95f['as'],'attributes':_0x49f95f['attributes'],'include':_0x49f95f['include']?_[_0x9fe3('0x1b')](_0x49f95f[_0x9fe3('0x1a')],function(_0x12ae18){return{'model':db[_0x12ae18[_0x9fe3('0x1c')]],'as':_0x12ae18['as'],'attributes':_0x12ae18['attributes']};}):[]};}):[]};}):[]:[]})[_0x9fe3('0xa')](function(_0xa7aaf5){logger[_0x9fe3('0xb')]('ShowZohoAccount',_0x40a778);logger[_0x9fe3('0x1d')](_0x9fe3('0x22'),_0x40a778,JSON[_0x9fe3('0x1e')](_0xa7aaf5));_0x5e1620(_0xa7aaf5);})[_0x9fe3('0x13')](function(_0x52b828){logger[_0x9fe3('0xf')](_0x9fe3('0x22'),_0x52b828['message'],_0x40a778);_0x2a388d(_0x298318['error'](0x1f4,_0x52b828[_0x9fe3('0x11')]));});});}; \ No newline at end of file +var _0x1e82=['include','model','then','debug','ShowZohoAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','map'];(function(_0x398462,_0x3ba88b){var _0x5f2aa2=function(_0x19b386){while(--_0x19b386){_0x398462['push'](_0x398462['shift']());}};_0x5f2aa2(++_0x3ba88b);}(_0x1e82,0x8b));var _0x21e8=function(_0xeb5abf,_0x453c53){_0xeb5abf=_0xeb5abf-0x0;var _0x4e65db=_0x1e82[_0xeb5abf];return _0x4e65db;};'use strict';var _=require(_0x21e8('0x0'));var util=require(_0x21e8('0x1'));var moment=require(_0x21e8('0x2'));var BPromise=require(_0x21e8('0x3'));var rs=require(_0x21e8('0x4'));var fs=require('fs');var Redis=require(_0x21e8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x21e8('0x6'));var logger=require(_0x21e8('0x7'))('rpc');var config=require(_0x21e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21e8('0x9')][_0x21e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38c3d0,_0x22cbd4,_0x47b3b3){return new BPromise(function(_0x45e5c1,_0x3754c9){return client[_0x21e8('0xb')](_0x38c3d0,_0x47b3b3)['then'](function(_0x31b6c2){logger[_0x21e8('0xc')](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x22cbd4,_0x21e8('0xe'),JSON['stringify'](_0x31b6c2));if(_0x31b6c2[_0x21e8('0xf')]){if(_0x31b6c2[_0x21e8('0xf')]['code']===0x1f4){logger[_0x21e8('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x3754c9(_0x31b6c2[_0x21e8('0xf')]['message']);}logger[_0x21e8('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x22cbd4,_0x31b6c2[_0x21e8('0xf')][_0x21e8('0x10')]);return _0x45e5c1(_0x31b6c2[_0x21e8('0xf')]['message']);}else{logger['info'](_0x21e8('0xd'),_0x22cbd4,_0x21e8('0xe'));_0x45e5c1(_0x31b6c2[_0x21e8('0x11')][_0x21e8('0x10')]);}})[_0x21e8('0x12')](function(_0x13da4f){logger[_0x21e8('0xf')](_0x21e8('0xd'),_0x22cbd4,_0x13da4f);_0x3754c9(_0x13da4f);});});}exports[_0x21e8('0x13')]=function(_0x552c6f){var _0x1c70cc=this;return new Promise(function(_0x4f76b8,_0x504522){return db[_0x21e8('0x14')][_0x21e8('0x15')]({'raw':_0x552c6f[_0x21e8('0x16')]?_0x552c6f[_0x21e8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x552c6f[_0x21e8('0x16')]?_0x552c6f[_0x21e8('0x16')][_0x21e8('0x17')]||null:null,'attributes':_0x552c6f[_0x21e8('0x16')]?_0x552c6f[_0x21e8('0x16')][_0x21e8('0x18')]||null:null,'limit':_0x552c6f[_0x21e8('0x16')]?_0x552c6f[_0x21e8('0x16')]['limit']||null:null,'include':_0x552c6f[_0x21e8('0x16')]?_0x552c6f[_0x21e8('0x16')]['include']?_[_0x21e8('0x19')](_0x552c6f[_0x21e8('0x16')][_0x21e8('0x1a')],function(_0x168f1){return{'model':db[_0x168f1[_0x21e8('0x1b')]],'as':_0x168f1['as'],'attributes':_0x168f1[_0x21e8('0x18')],'include':_0x168f1[_0x21e8('0x1a')]?_[_0x21e8('0x19')](_0x168f1['include'],function(_0x155d04){return{'model':db[_0x155d04['model']],'as':_0x155d04['as'],'attributes':_0x155d04[_0x21e8('0x18')],'include':_0x155d04[_0x21e8('0x1a')]?_[_0x21e8('0x19')](_0x155d04['include'],function(_0x1bdd15){return{'model':db[_0x1bdd15['model']],'as':_0x1bdd15['as'],'attributes':_0x1bdd15[_0x21e8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x21e8('0x1c')](function(_0x6de0b2){logger['info'](_0x21e8('0x13'),_0x552c6f);logger[_0x21e8('0x1d')](_0x21e8('0x13'),_0x552c6f,JSON['stringify'](_0x6de0b2));_0x4f76b8(_0x6de0b2);})[_0x21e8('0x12')](function(_0x3a5ff1){logger[_0x21e8('0xf')](_0x21e8('0x13'),_0x3a5ff1[_0x21e8('0x10')],_0x552c6f);_0x504522(_0x1c70cc[_0x21e8('0xf')](0x1f4,_0x3a5ff1[_0x21e8('0x10')]));});});};exports[_0x21e8('0x1e')]=function(_0x20d095){var _0xd4f119=this;return new Promise(function(_0x4711a4,_0x37d56c){return db['ZohoAccount'][_0x21e8('0x1f')]({'raw':_0x20d095[_0x21e8('0x16')]?_0x20d095['options']['raw']===undefined?!![]:![]:!![],'where':_0x20d095['options']?_0x20d095[_0x21e8('0x16')]['where']||null:null,'attributes':_0x20d095[_0x21e8('0x16')]?_0x20d095[_0x21e8('0x16')][_0x21e8('0x18')]||null:null,'include':_0x20d095[_0x21e8('0x16')]?_0x20d095['options']['include']?_[_0x21e8('0x19')](_0x20d095['options'][_0x21e8('0x1a')],function(_0x1cf161){return{'model':db[_0x1cf161[_0x21e8('0x1b')]],'as':_0x1cf161['as'],'attributes':_0x1cf161[_0x21e8('0x18')],'include':_0x1cf161['include']?_[_0x21e8('0x19')](_0x1cf161[_0x21e8('0x1a')],function(_0x27c8bd){return{'model':db[_0x27c8bd[_0x21e8('0x1b')]],'as':_0x27c8bd['as'],'attributes':_0x27c8bd[_0x21e8('0x18')],'include':_0x27c8bd['include']?_[_0x21e8('0x19')](_0x27c8bd[_0x21e8('0x1a')],function(_0x28ab9d){return{'model':db[_0x28ab9d[_0x21e8('0x1b')]],'as':_0x28ab9d['as'],'attributes':_0x28ab9d[_0x21e8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x21e8('0x1c')](function(_0x1abde0){logger[_0x21e8('0xc')](_0x21e8('0x1e'),_0x20d095);logger[_0x21e8('0x1d')](_0x21e8('0x1e'),_0x20d095,JSON[_0x21e8('0x20')](_0x1abde0));_0x4711a4(_0x1abde0);})[_0x21e8('0x12')](function(_0x3c83bb){logger[_0x21e8('0xf')]('ShowZohoAccount',_0x3c83bb[_0x21e8('0x10')],_0x20d095);_0x37d56c(_0xd4f119[_0x21e8('0xf')](0x1f4,_0x3c83bb[_0x21e8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 4bafcc9..af5c5ee 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 _0x938f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','show','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x938f,0xec));var _0xf938=function(_0x4b4844,_0x2f0dfb){_0x4b4844=_0x4b4844-0x0;var _0x575192=_0x938f[_0x4b4844];return _0x575192;};'use strict';var multer=require(_0xf938('0x0'));var util=require(_0xf938('0x1'));var path=require(_0xf938('0x2'));var timeout=require(_0xf938('0x3'));var express=require(_0xf938('0x4'));var router=express[_0xf938('0x5')]();var fs_extra=require(_0xf938('0x6'));var auth=require(_0xf938('0x7'));var interaction=require(_0xf938('0x8'));var config=require(_0xf938('0x9'));var controller=require(_0xf938('0xa'));router['get']('/',auth[_0xf938('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf938('0xc')]);router[_0xf938('0xd')](_0xf938('0xe'),auth['isAuthenticated'](),controller[_0xf938('0xf')]);router[_0xf938('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xf938('0x10')]);router[_0xf938('0xd')](_0xf938('0x11'),auth[_0xf938('0xb')](),controller[_0xf938('0x12')]);router[_0xf938('0x13')]('/',auth[_0xf938('0xb')](),controller[_0xf938('0x14')]);router[_0xf938('0x15')](_0xf938('0x16'),auth[_0xf938('0xb')](),controller[_0xf938('0x17')]);router[_0xf938('0x18')](_0xf938('0x16'),auth[_0xf938('0xb')](),controller[_0xf938('0x19')]);module[_0xf938('0x1a')]=router; \ No newline at end of file +var _0x4f13=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','connect-timeout','express'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x4f13,0x11d));var _0x34f1=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0x4f13[_0x499001];return _0x320c65;};'use strict';var multer=require(_0x34f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x34f1('0x1'));var express=require(_0x34f1('0x2'));var router=express[_0x34f1('0x3')]();var fs_extra=require(_0x34f1('0x4'));var auth=require(_0x34f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34f1('0x6'));var controller=require(_0x34f1('0x7'));router[_0x34f1('0x8')]('/',auth[_0x34f1('0x9')](),controller[_0x34f1('0xa')]);router['get']('/:id',auth[_0x34f1('0x9')](),controller['show']);router[_0x34f1('0x8')](_0x34f1('0xb'),auth[_0x34f1('0x9')](),controller[_0x34f1('0xc')]);router[_0x34f1('0x8')](_0x34f1('0xd'),auth['isAuthenticated'](),controller[_0x34f1('0xe')]);router['get'](_0x34f1('0xf'),auth[_0x34f1('0x9')](),controller[_0x34f1('0x10')]);router[_0x34f1('0x11')]('/',auth['isAuthenticated'](),controller[_0x34f1('0x12')]);router[_0x34f1('0x13')](_0x34f1('0x14'),auth[_0x34f1('0x9')](),controller[_0x34f1('0x15')]);router['delete'](_0x34f1('0x14'),auth[_0x34f1('0x9')](),controller[_0x34f1('0x16')]);module[_0x34f1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 604fd51..2655667 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 _0x5deb=['contact_lead','STRING','sequelize','exports','ENUM','contact','nothing','lead'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x5deb,0x82));var _0xb5de=function(_0x3ea61c,_0x42150f){_0x3ea61c=_0x3ea61c-0x0;var _0x5a9497=_0x5deb[_0x3ea61c];return _0x5a9497;};'use strict';var Sequelize=require(_0xb5de('0x0'));module[_0xb5de('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xb5de('0x2')]('lead',_0xb5de('0x3'),_0xb5de('0x4')),'defaultValue':_0xb5de('0x5')},'moduleSearch':{'type':Sequelize[_0xb5de('0x2')](_0xb5de('0x6'),'contact',_0xb5de('0x5')),'defaultValue':_0xb5de('0x6')},'description':{'type':Sequelize[_0xb5de('0x7')]}}; \ No newline at end of file +var _0x3a06=['lead','contact_lead','sequelize','exports','ENUM','contact'];(function(_0x4d986f,_0x18a777){var _0x31f005=function(_0x692827){while(--_0x692827){_0x4d986f['push'](_0x4d986f['shift']());}};_0x31f005(++_0x18a777);}(_0x3a06,0x1d0));var _0x63a0=function(_0x4612dd,_0x2dd79d){_0x4612dd=_0x4612dd-0x0;var _0x4b2ab9=_0x3a06[_0x4612dd];return _0x4b2ab9;};'use strict';var Sequelize=require(_0x63a0('0x0'));module[_0x63a0('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x63a0('0x2')]('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x63a0('0x2')]('contact_lead',_0x63a0('0x3'),_0x63a0('0x4')),'defaultValue':_0x63a0('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ba14881..141c5e4 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 _0x4223=['querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','end','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','fields','includeAll','options','find','catch','create','body','params','destroy','findOne','ZohoField','length','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4223,0x8b));var _0x3422=function(_0x4e1f8e,_0x4fd7a5){_0x4e1f8e=_0x4e1f8e-0x0;var _0x1e5417=_0x4223[_0x4e1f8e];return _0x1e5417;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3422('0x0'));var zipdir=require(_0x3422('0x1'));var jsonpatch=require(_0x3422('0x2'));var rp=require(_0x3422('0x3'));var moment=require(_0x3422('0x4'));var BPromise=require(_0x3422('0x5'));var Mustache=require('mustache');var util=require(_0x3422('0x6'));var path=require('path');var sox=require(_0x3422('0x7'));var csv=require('to-csv');var ejs=require(_0x3422('0x8'));var fs=require('fs');var fs_extra=require(_0x3422('0x9'));var _=require(_0x3422('0xa'));var squel=require('squel');var crypto=require(_0x3422('0xb'));var jsforce=require(_0x3422('0xc'));var deskjs=require(_0x3422('0xd'));var toCsv=require(_0x3422('0xe'));var querystring=require(_0x3422('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3422('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3422('0x11'));var logger=require(_0x3422('0x12'))('api');var utils=require(_0x3422('0x13'));var config=require(_0x3422('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x283a31,_0x2a5e56){_0x2a5e56=_0x2a5e56||0xcc;return function(_0x384f93){if(_0x384f93){return _0x283a31[_0x3422('0x15')](_0x2a5e56);}return _0x283a31[_0x3422('0x16')](_0x2a5e56)['end']();};}function respondWithResult(_0x31991f,_0x4bace2){_0x4bace2=_0x4bace2||0xc8;return function(_0x3aec0a){if(_0x3aec0a){return _0x31991f[_0x3422('0x16')](_0x4bace2)[_0x3422('0x17')](_0x3aec0a);}};}function respondWithFilteredResult(_0x4b2262,_0x3e2c75){return function(_0x253be5){if(_0x253be5){var _0x168fa5=typeof _0x3e2c75['offset']===_0x3422('0x18')&&typeof _0x3e2c75[_0x3422('0x19')]===_0x3422('0x18');var _0x161747=_0x253be5[_0x3422('0x1a')];var _0x31c846=_0x168fa5?0x0:_0x3e2c75[_0x3422('0x1b')];var _0x3c4a20=_0x168fa5?_0x253be5[_0x3422('0x1a')]:_0x3e2c75[_0x3422('0x1b')]+_0x3e2c75['limit'];var _0x142d47;if(_0x3c4a20>=_0x161747){_0x3c4a20=_0x161747;_0x142d47=0xc8;}else{_0x142d47=0xce;}_0x4b2262['status'](_0x142d47);return _0x4b2262[_0x3422('0x1c')](_0x3422('0x1d'),_0x31c846+'-'+_0x3c4a20+'/'+_0x161747)[_0x3422('0x17')](_0x253be5);}return null;};}function patchUpdates(_0xd22330){return function(_0x364d57){try{jsonpatch['apply'](_0x364d57,_0xd22330,!![]);}catch(_0x30bf49){return BPromise[_0x3422('0x1e')](_0x30bf49);}return _0x364d57['save']();};}function saveUpdates(_0x54e4a6,_0x37b0d5){return function(_0x1f9166){if(_0x1f9166){return _0x1f9166[_0x3422('0x1f')](_0x54e4a6)[_0x3422('0x20')](function(_0x373f9b){return _0x373f9b;});}return null;};}function removeEntity(_0x2d50bc,_0x3db023){return function(_0x366772){if(_0x366772){return _0x366772['destroy']()[_0x3422('0x20')](function(){_0x2d50bc['status'](0xcc)[_0x3422('0x21')]();});}};}function handleEntityNotFound(_0x3f78aa,_0x1f5fde){return function(_0x1081e2){if(!_0x1081e2){_0x3f78aa['sendStatus'](0x194);}return _0x1081e2;};}function handleError(_0x50135d,_0x302c34){_0x302c34=_0x302c34||0x1f4;return function(_0x283a77){logger[_0x3422('0x22')](_0x283a77['stack']);if(_0x283a77[_0x3422('0x23')]){delete _0x283a77[_0x3422('0x23')];}_0x50135d['status'](_0x302c34)[_0x3422('0x24')](_0x283a77);};}exports[_0x3422('0x25')]=function(_0x5ae385,_0x3f816c){var _0xb2e5ca={},_0xf9649b={},_0x52ebc9={'count':0x0,'rows':[]};var _0x26a5b3=_[_0x3422('0x26')](db[_0x3422('0x27')][_0x3422('0x28')],function(_0x10c022){return{'name':_0x10c022[_0x3422('0x29')],'type':_0x10c022[_0x3422('0x2a')]['key']};});_0xf9649b[_0x3422('0x2b')]=_[_0x3422('0x26')](_0x26a5b3,_0x3422('0x23'));_0xf9649b['query']=_[_0x3422('0x2c')](_0x5ae385[_0x3422('0x2d')]);_0xf9649b[_0x3422('0x2e')]=_[_0x3422('0x2f')](_0xf9649b['model'],_0xf9649b['query']);_0xb2e5ca['attributes']=_[_0x3422('0x2f')](_0xf9649b[_0x3422('0x2b')],qs['fields'](_0x5ae385[_0x3422('0x2d')]['fields']));_0xb2e5ca[_0x3422('0x30')]=_0xb2e5ca['attributes']['length']?_0xb2e5ca[_0x3422('0x30')]:_0xf9649b[_0x3422('0x2b')];if(!_0x5ae385[_0x3422('0x2d')][_0x3422('0x31')](_0x3422('0x32'))){_0xb2e5ca[_0x3422('0x19')]=qs[_0x3422('0x19')](_0x5ae385[_0x3422('0x2d')]['limit']);_0xb2e5ca[_0x3422('0x1b')]=qs[_0x3422('0x1b')](_0x5ae385[_0x3422('0x2d')][_0x3422('0x1b')]);}_0xb2e5ca[_0x3422('0x33')]=qs['sort'](_0x5ae385['query'][_0x3422('0x34')]);_0xb2e5ca[_0x3422('0x35')]=qs['filters'](_[_0x3422('0x36')](_0x5ae385[_0x3422('0x2d')],_0xf9649b['filters']),_0x26a5b3);if(_0x5ae385['query'][_0x3422('0x37')]){_0xb2e5ca[_0x3422('0x35')]=_[_0x3422('0x38')](_0xb2e5ca[_0x3422('0x35')],{'$or':_[_0x3422('0x26')](_0x26a5b3,function(_0x4c9f88){if(_0x4c9f88[_0x3422('0x2a')]!==_0x3422('0x39')){var _0x537588={};_0x537588[_0x4c9f88['name']]={'$like':'%'+_0x5ae385[_0x3422('0x2d')]['filter']+'%'};return _0x537588;}})});}_0xb2e5ca=_[_0x3422('0x38')]({},_0xb2e5ca,_0x5ae385['options']);var _0x27cf9c={'where':_0xb2e5ca['where']};return db[_0x3422('0x27')][_0x3422('0x1a')](_0x27cf9c)[_0x3422('0x20')](function(_0x15f99b){_0x52ebc9['count']=_0x15f99b;if(_0x5ae385['query']['includeAll']){_0xb2e5ca[_0x3422('0x3a')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x3422('0x3b')](_0xb2e5ca);})[_0x3422('0x20')](function(_0x53aff0){_0x52ebc9[_0x3422('0x3c')]=_0x53aff0;return _0x52ebc9;})[_0x3422('0x20')](respondWithFilteredResult(_0x3f816c,_0xb2e5ca))['catch'](handleError(_0x3f816c,null));};exports[_0x3422('0x3d')]=function(_0x33910e,_0x407064){var _0x13d54d={'raw':![],'where':{'id':_0x33910e['params']['id']}},_0x5f2417={};_0x5f2417[_0x3422('0x2b')]=_[_0x3422('0x2c')](db[_0x3422('0x27')][_0x3422('0x28')]);_0x5f2417['query']=_[_0x3422('0x2c')](_0x33910e['query']);_0x5f2417[_0x3422('0x2e')]=_[_0x3422('0x2f')](_0x5f2417[_0x3422('0x2b')],_0x5f2417['query']);_0x13d54d[_0x3422('0x30')]=_['intersection'](_0x5f2417[_0x3422('0x2b')],qs['fields'](_0x33910e['query'][_0x3422('0x3e')]));_0x13d54d['attributes']=_0x13d54d[_0x3422('0x30')]['length']?_0x13d54d[_0x3422('0x30')]:_0x5f2417['model'];if(_0x33910e[_0x3422('0x2d')][_0x3422('0x3f')]){_0x13d54d[_0x3422('0x3a')]=[{'all':!![]}];}_0x13d54d=_[_0x3422('0x38')]({},_0x13d54d,_0x33910e[_0x3422('0x40')]);return db['ZohoConfiguration'][_0x3422('0x41')](_0x13d54d)[_0x3422('0x20')](handleEntityNotFound(_0x407064,null))[_0x3422('0x20')](respondWithResult(_0x407064,null))[_0x3422('0x42')](handleError(_0x407064,null));};exports[_0x3422('0x43')]=function(_0x157996,_0x3f4e25){return db['ZohoConfiguration'][_0x3422('0x43')](_0x157996[_0x3422('0x44')],{})[_0x3422('0x20')](respondWithResult(_0x3f4e25,0xc9))[_0x3422('0x42')](handleError(_0x3f4e25,null));};exports['update']=function(_0x5f434a,_0x10a8e2){if(_0x5f434a[_0x3422('0x44')]['id']){delete _0x5f434a[_0x3422('0x44')]['id'];}return db[_0x3422('0x27')][_0x3422('0x41')]({'where':{'id':_0x5f434a[_0x3422('0x45')]['id']}})['then'](handleEntityNotFound(_0x10a8e2,null))[_0x3422('0x20')](saveUpdates(_0x5f434a[_0x3422('0x44')],null))[_0x3422('0x20')](respondWithResult(_0x10a8e2,null))[_0x3422('0x42')](handleError(_0x10a8e2,null));};exports[_0x3422('0x46')]=function(_0x1a440b,_0x5ead60){return db[_0x3422('0x27')]['find']({'where':{'id':_0x1a440b[_0x3422('0x45')]['id']}})[_0x3422('0x20')](handleEntityNotFound(_0x5ead60,null))['then'](removeEntity(_0x5ead60,null))[_0x3422('0x42')](handleError(_0x5ead60,null));};exports['getFields']=function(_0x45fa7d,_0x57f78a,_0x29b67d){var _0x4e8bf8={};var _0x5e09e2={};var _0x25389e;var _0x2c1bad;return db[_0x3422('0x27')][_0x3422('0x47')]({'where':{'id':_0x45fa7d[_0x3422('0x45')]['id']}})['then'](handleEntityNotFound(_0x57f78a,null))['then'](function(_0x2e60c0){if(_0x2e60c0){_0x25389e=_0x2e60c0;_0x5e09e2[_0x3422('0x2b')]=_[_0x3422('0x2c')](db[_0x3422('0x48')][_0x3422('0x28')]);_0x5e09e2[_0x3422('0x2d')]=_['keys'](_0x45fa7d[_0x3422('0x2d')]);_0x5e09e2[_0x3422('0x2e')]=_[_0x3422('0x2f')](_0x5e09e2[_0x3422('0x2b')],_0x5e09e2[_0x3422('0x2d')]);_0x4e8bf8[_0x3422('0x30')]=_[_0x3422('0x2f')](_0x5e09e2[_0x3422('0x2b')],qs['fields'](_0x45fa7d[_0x3422('0x2d')][_0x3422('0x3e')]));_0x4e8bf8['attributes']=_0x4e8bf8[_0x3422('0x30')][_0x3422('0x49')]?_0x4e8bf8['attributes']:_0x5e09e2[_0x3422('0x2b')];_0x4e8bf8[_0x3422('0x33')]=qs['sort'](_0x45fa7d[_0x3422('0x2d')][_0x3422('0x34')]);_0x4e8bf8[_0x3422('0x35')]=qs[_0x3422('0x2e')](_[_0x3422('0x36')](_0x45fa7d[_0x3422('0x2d')],_0x5e09e2['filters']));if(_0x45fa7d['query'][_0x3422('0x37')]){_0x4e8bf8['where']=_['merge'](_0x4e8bf8[_0x3422('0x35')],{'$or':_['map'](_0x4e8bf8['attributes'],function(_0x548a85){var _0x456a14={};_0x456a14[_0x548a85]={'$like':'%'+_0x45fa7d[_0x3422('0x2d')][_0x3422('0x37')]+'%'};return _0x456a14;})});}_0x4e8bf8=_[_0x3422('0x38')]({},_0x4e8bf8,_0x45fa7d[_0x3422('0x40')]);return _0x25389e[_0x3422('0x4a')](_0x4e8bf8);}})[_0x3422('0x20')](function(_0x5a2c11){if(_0x5a2c11){_0x2c1bad=_0x5a2c11[_0x3422('0x49')];if(!_0x45fa7d[_0x3422('0x2d')][_0x3422('0x31')](_0x3422('0x32'))){_0x4e8bf8[_0x3422('0x19')]=qs[_0x3422('0x19')](_0x45fa7d[_0x3422('0x2d')][_0x3422('0x19')]);_0x4e8bf8['offset']=qs[_0x3422('0x1b')](_0x45fa7d[_0x3422('0x2d')][_0x3422('0x1b')]);}return _0x25389e[_0x3422('0x4a')](_0x4e8bf8);}})[_0x3422('0x20')](function(_0x42916c){if(_0x42916c){return _0x42916c?{'count':_0x2c1bad,'rows':_0x42916c}:null;}})['then'](respondWithResult(_0x57f78a,null))[_0x3422('0x42')](handleError(_0x57f78a,null));};exports[_0x3422('0x4b')]=function(_0x2fe825,_0x403af7,_0x1fd3a2){var _0x2f614c={};var _0x46b9b5={};var _0x580ce4;var _0x518b06;return db[_0x3422('0x27')][_0x3422('0x47')]({'where':{'id':_0x2fe825['params']['id']}})[_0x3422('0x20')](handleEntityNotFound(_0x403af7,null))[_0x3422('0x20')](function(_0x33e926){if(_0x33e926){_0x580ce4=_0x33e926;_0x46b9b5[_0x3422('0x2b')]=_[_0x3422('0x2c')](db['ZohoField'][_0x3422('0x28')]);_0x46b9b5[_0x3422('0x2d')]=_[_0x3422('0x2c')](_0x2fe825[_0x3422('0x2d')]);_0x46b9b5[_0x3422('0x2e')]=_[_0x3422('0x2f')](_0x46b9b5[_0x3422('0x2b')],_0x46b9b5['query']);_0x2f614c[_0x3422('0x30')]=_['intersection'](_0x46b9b5[_0x3422('0x2b')],qs[_0x3422('0x3e')](_0x2fe825[_0x3422('0x2d')][_0x3422('0x3e')]));_0x2f614c['attributes']=_0x2f614c[_0x3422('0x30')][_0x3422('0x49')]?_0x2f614c[_0x3422('0x30')]:_0x46b9b5[_0x3422('0x2b')];_0x2f614c[_0x3422('0x33')]=qs['sort'](_0x2fe825[_0x3422('0x2d')][_0x3422('0x34')]);_0x2f614c[_0x3422('0x35')]=qs[_0x3422('0x2e')](_[_0x3422('0x36')](_0x2fe825[_0x3422('0x2d')],_0x46b9b5[_0x3422('0x2e')]));if(_0x2fe825[_0x3422('0x2d')][_0x3422('0x37')]){_0x2f614c[_0x3422('0x35')]=_[_0x3422('0x38')](_0x2f614c[_0x3422('0x35')],{'$or':_[_0x3422('0x26')](_0x2f614c['attributes'],function(_0x50049c){var _0x4cce17={};_0x4cce17[_0x50049c]={'$like':'%'+_0x2fe825['query'][_0x3422('0x37')]+'%'};return _0x4cce17;})});}_0x2f614c=_[_0x3422('0x38')]({},_0x2f614c,_0x2fe825[_0x3422('0x40')]);return _0x580ce4['getSubjects'](_0x2f614c);}})[_0x3422('0x20')](function(_0x4583ed){if(_0x4583ed){_0x518b06=_0x4583ed[_0x3422('0x49')];if(!_0x2fe825['query'][_0x3422('0x31')](_0x3422('0x32'))){_0x2f614c['limit']=qs[_0x3422('0x19')](_0x2fe825['query'][_0x3422('0x19')]);_0x2f614c[_0x3422('0x1b')]=qs[_0x3422('0x1b')](_0x2fe825[_0x3422('0x2d')][_0x3422('0x1b')]);}return _0x580ce4[_0x3422('0x4b')](_0x2f614c);}})['then'](function(_0x59b98c){if(_0x59b98c){return _0x59b98c?{'count':_0x518b06,'rows':_0x59b98c}:null;}})['then'](respondWithResult(_0x403af7,null))['catch'](handleError(_0x403af7,null));};exports[_0x3422('0x4c')]=function(_0x30aa2e,_0x57564b,_0x5982fc){var _0x219028={};var _0x3a093d={};var _0x197ee3;var _0xc5b467;return db['ZohoConfiguration'][_0x3422('0x47')]({'where':{'id':_0x30aa2e[_0x3422('0x45')]['id']}})[_0x3422('0x20')](handleEntityNotFound(_0x57564b,null))[_0x3422('0x20')](function(_0x5cf16b){if(_0x5cf16b){_0x197ee3=_0x5cf16b;_0x3a093d[_0x3422('0x2b')]=_[_0x3422('0x2c')](db['ZohoField'][_0x3422('0x28')]);_0x3a093d[_0x3422('0x2d')]=_['keys'](_0x30aa2e[_0x3422('0x2d')]);_0x3a093d[_0x3422('0x2e')]=_[_0x3422('0x2f')](_0x3a093d[_0x3422('0x2b')],_0x3a093d[_0x3422('0x2d')]);_0x219028[_0x3422('0x30')]=_['intersection'](_0x3a093d[_0x3422('0x2b')],qs[_0x3422('0x3e')](_0x30aa2e[_0x3422('0x2d')][_0x3422('0x3e')]));_0x219028[_0x3422('0x30')]=_0x219028['attributes'][_0x3422('0x49')]?_0x219028['attributes']:_0x3a093d[_0x3422('0x2b')];_0x219028[_0x3422('0x33')]=qs[_0x3422('0x34')](_0x30aa2e[_0x3422('0x2d')][_0x3422('0x34')]);_0x219028[_0x3422('0x35')]=qs['filters'](_[_0x3422('0x36')](_0x30aa2e[_0x3422('0x2d')],_0x3a093d[_0x3422('0x2e')]));if(_0x30aa2e[_0x3422('0x2d')][_0x3422('0x37')]){_0x219028['where']=_[_0x3422('0x38')](_0x219028[_0x3422('0x35')],{'$or':_[_0x3422('0x26')](_0x219028['attributes'],function(_0x21953a){var _0x4ce41c={};_0x4ce41c[_0x21953a]={'$like':'%'+_0x30aa2e[_0x3422('0x2d')]['filter']+'%'};return _0x4ce41c;})});}_0x219028=_[_0x3422('0x38')]({},_0x219028,_0x30aa2e['options']);return _0x197ee3[_0x3422('0x4c')](_0x219028);}})[_0x3422('0x20')](function(_0x38c91d){if(_0x38c91d){_0xc5b467=_0x38c91d[_0x3422('0x49')];if(!_0x30aa2e[_0x3422('0x2d')]['hasOwnProperty'](_0x3422('0x32'))){_0x219028['limit']=qs[_0x3422('0x19')](_0x30aa2e[_0x3422('0x2d')][_0x3422('0x19')]);_0x219028[_0x3422('0x1b')]=qs['offset'](_0x30aa2e[_0x3422('0x2d')][_0x3422('0x1b')]);}return _0x197ee3[_0x3422('0x4c')](_0x219028);}})[_0x3422('0x20')](function(_0x4451c0){if(_0x4451c0){return _0x4451c0?{'count':_0xc5b467,'rows':_0x4451c0}:null;}})[_0x3422('0x20')](respondWithResult(_0x57564b,null))[_0x3422('0x42')](handleError(_0x57564b,null));}; \ No newline at end of file +var _0x6a02=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','save','then','error','stack','name','send','map','ZohoConfiguration','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','rawAttributes','find','catch','create','body','destroy','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x6a02,0x169));var _0x26a0=function(_0x3a52ce,_0x428445){_0x3a52ce=_0x3a52ce-0x0;var _0x16754c=_0x6a02[_0x3a52ce];return _0x16754c;};'use strict';var emlformat=require(_0x26a0('0x0'));var rimraf=require(_0x26a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26a0('0x2'));var rp=require(_0x26a0('0x3'));var moment=require(_0x26a0('0x4'));var BPromise=require(_0x26a0('0x5'));var Mustache=require('mustache');var util=require(_0x26a0('0x6'));var path=require(_0x26a0('0x7'));var sox=require('sox');var csv=require(_0x26a0('0x8'));var ejs=require(_0x26a0('0x9'));var fs=require('fs');var fs_extra=require(_0x26a0('0xa'));var _=require(_0x26a0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x26a0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x26a0('0x8'));var querystring=require(_0x26a0('0xd'));var Papa=require(_0x26a0('0xe'));var Redis=require(_0x26a0('0xf'));var authService=require(_0x26a0('0x10'));var qs=require(_0x26a0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26a0('0x12'));var logger=require('../../config/logger')(_0x26a0('0x13'));var utils=require('../../config/utils');var config=require(_0x26a0('0x14'));var licenseUtil=require(_0x26a0('0x15'));var db=require(_0x26a0('0x16'))['db'];function respondWithStatusCode(_0x300db3,_0x46112a){_0x46112a=_0x46112a||0xcc;return function(_0x449c02){if(_0x449c02){return _0x300db3[_0x26a0('0x17')](_0x46112a);}return _0x300db3[_0x26a0('0x18')](_0x46112a)['end']();};}function respondWithResult(_0x2dc7e0,_0x62424c){_0x62424c=_0x62424c||0xc8;return function(_0x29475d){if(_0x29475d){return _0x2dc7e0['status'](_0x62424c)[_0x26a0('0x19')](_0x29475d);}};}function respondWithFilteredResult(_0x5b459e,_0x3c47b6){return function(_0x38b2ea){if(_0x38b2ea){var _0x2d2b2e=typeof _0x3c47b6[_0x26a0('0x1a')]==='undefined'&&typeof _0x3c47b6[_0x26a0('0x1b')]==='undefined';var _0x6548f8=_0x38b2ea['count'];var _0x8c7d8d=_0x2d2b2e?0x0:_0x3c47b6[_0x26a0('0x1a')];var _0x4b58b7=_0x2d2b2e?_0x38b2ea[_0x26a0('0x1c')]:_0x3c47b6[_0x26a0('0x1a')]+_0x3c47b6[_0x26a0('0x1b')];var _0x2f5f2c;if(_0x4b58b7>=_0x6548f8){_0x4b58b7=_0x6548f8;_0x2f5f2c=0xc8;}else{_0x2f5f2c=0xce;}_0x5b459e[_0x26a0('0x18')](_0x2f5f2c);return _0x5b459e[_0x26a0('0x1d')]('Content-Range',_0x8c7d8d+'-'+_0x4b58b7+'/'+_0x6548f8)[_0x26a0('0x19')](_0x38b2ea);}return null;};}function patchUpdates(_0x287aef){return function(_0x39883a){try{jsonpatch[_0x26a0('0x1e')](_0x39883a,_0x287aef,!![]);}catch(_0x1756e9){return BPromise[_0x26a0('0x1f')](_0x1756e9);}return _0x39883a[_0x26a0('0x20')]();};}function saveUpdates(_0x4db0c7,_0x2ea6a1){return function(_0x4cbbcc){if(_0x4cbbcc){return _0x4cbbcc['update'](_0x4db0c7)['then'](function(_0x1bfff6){return _0x1bfff6;});}return null;};}function removeEntity(_0x30106f,_0x604ab7){return function(_0x1747f1){if(_0x1747f1){return _0x1747f1['destroy']()[_0x26a0('0x21')](function(){_0x30106f[_0x26a0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe6c07e,_0x4bffcc){return function(_0x2e171a){if(!_0x2e171a){_0xe6c07e['sendStatus'](0x194);}return _0x2e171a;};}function handleError(_0x2e28b3,_0x3beefa){_0x3beefa=_0x3beefa||0x1f4;return function(_0xfab0ad){logger[_0x26a0('0x22')](_0xfab0ad[_0x26a0('0x23')]);if(_0xfab0ad[_0x26a0('0x24')]){delete _0xfab0ad[_0x26a0('0x24')];}_0x2e28b3['status'](_0x3beefa)[_0x26a0('0x25')](_0xfab0ad);};}exports['index']=function(_0x552d09,_0x249634){var _0x5ac4cf={},_0x10d508={},_0x3baa0d={'count':0x0,'rows':[]};var _0x590ebf=_[_0x26a0('0x26')](db[_0x26a0('0x27')]['rawAttributes'],function(_0x372fe3){return{'name':_0x372fe3['fieldName'],'type':_0x372fe3[_0x26a0('0x28')][_0x26a0('0x29')]};});_0x10d508[_0x26a0('0x2a')]=_[_0x26a0('0x26')](_0x590ebf,_0x26a0('0x24'));_0x10d508['query']=_['keys'](_0x552d09['query']);_0x10d508[_0x26a0('0x2b')]=_[_0x26a0('0x2c')](_0x10d508[_0x26a0('0x2a')],_0x10d508[_0x26a0('0x2d')]);_0x5ac4cf[_0x26a0('0x2e')]=_[_0x26a0('0x2c')](_0x10d508['model'],qs['fields'](_0x552d09[_0x26a0('0x2d')][_0x26a0('0x2f')]));_0x5ac4cf[_0x26a0('0x2e')]=_0x5ac4cf[_0x26a0('0x2e')][_0x26a0('0x30')]?_0x5ac4cf[_0x26a0('0x2e')]:_0x10d508[_0x26a0('0x2a')];if(!_0x552d09['query'][_0x26a0('0x31')](_0x26a0('0x32'))){_0x5ac4cf[_0x26a0('0x1b')]=qs[_0x26a0('0x1b')](_0x552d09[_0x26a0('0x2d')]['limit']);_0x5ac4cf[_0x26a0('0x1a')]=qs[_0x26a0('0x1a')](_0x552d09['query'][_0x26a0('0x1a')]);}_0x5ac4cf[_0x26a0('0x33')]=qs['sort'](_0x552d09[_0x26a0('0x2d')][_0x26a0('0x34')]);_0x5ac4cf[_0x26a0('0x35')]=qs[_0x26a0('0x2b')](_[_0x26a0('0x36')](_0x552d09[_0x26a0('0x2d')],_0x10d508[_0x26a0('0x2b')]),_0x590ebf);if(_0x552d09[_0x26a0('0x2d')][_0x26a0('0x37')]){_0x5ac4cf['where']=_[_0x26a0('0x38')](_0x5ac4cf[_0x26a0('0x35')],{'$or':_[_0x26a0('0x26')](_0x590ebf,function(_0x2803cd){if(_0x2803cd[_0x26a0('0x28')]!==_0x26a0('0x39')){var _0x32f8ed={};_0x32f8ed[_0x2803cd[_0x26a0('0x24')]]={'$like':'%'+_0x552d09['query']['filter']+'%'};return _0x32f8ed;}})});}_0x5ac4cf=_[_0x26a0('0x38')]({},_0x5ac4cf,_0x552d09[_0x26a0('0x3a')]);var _0x4ade29={'where':_0x5ac4cf[_0x26a0('0x35')]};return db[_0x26a0('0x27')][_0x26a0('0x1c')](_0x4ade29)['then'](function(_0x20e943){_0x3baa0d[_0x26a0('0x1c')]=_0x20e943;if(_0x552d09[_0x26a0('0x2d')]['includeAll']){_0x5ac4cf[_0x26a0('0x3b')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x5ac4cf);})[_0x26a0('0x21')](function(_0x50d8d0){_0x3baa0d[_0x26a0('0x3c')]=_0x50d8d0;return _0x3baa0d;})[_0x26a0('0x21')](respondWithFilteredResult(_0x249634,_0x5ac4cf))['catch'](handleError(_0x249634,null));};exports[_0x26a0('0x3d')]=function(_0xfe40a0,_0xf3741f){var _0x1f8787={'raw':![],'where':{'id':_0xfe40a0[_0x26a0('0x3e')]['id']}},_0x3305d3={};_0x3305d3['model']=_[_0x26a0('0x3f')](db[_0x26a0('0x27')][_0x26a0('0x40')]);_0x3305d3[_0x26a0('0x2d')]=_['keys'](_0xfe40a0[_0x26a0('0x2d')]);_0x3305d3[_0x26a0('0x2b')]=_[_0x26a0('0x2c')](_0x3305d3[_0x26a0('0x2a')],_0x3305d3[_0x26a0('0x2d')]);_0x1f8787[_0x26a0('0x2e')]=_['intersection'](_0x3305d3[_0x26a0('0x2a')],qs[_0x26a0('0x2f')](_0xfe40a0[_0x26a0('0x2d')]['fields']));_0x1f8787['attributes']=_0x1f8787['attributes'][_0x26a0('0x30')]?_0x1f8787[_0x26a0('0x2e')]:_0x3305d3['model'];if(_0xfe40a0[_0x26a0('0x2d')]['includeAll']){_0x1f8787[_0x26a0('0x3b')]=[{'all':!![]}];}_0x1f8787=_['merge']({},_0x1f8787,_0xfe40a0[_0x26a0('0x3a')]);return db[_0x26a0('0x27')][_0x26a0('0x41')](_0x1f8787)[_0x26a0('0x21')](handleEntityNotFound(_0xf3741f,null))[_0x26a0('0x21')](respondWithResult(_0xf3741f,null))[_0x26a0('0x42')](handleError(_0xf3741f,null));};exports[_0x26a0('0x43')]=function(_0x1de643,_0x1fec7f){return db[_0x26a0('0x27')][_0x26a0('0x43')](_0x1de643['body'],{})['then'](respondWithResult(_0x1fec7f,0xc9))[_0x26a0('0x42')](handleError(_0x1fec7f,null));};exports['update']=function(_0x2ab6a1,_0x2e754b){if(_0x2ab6a1[_0x26a0('0x44')]['id']){delete _0x2ab6a1[_0x26a0('0x44')]['id'];}return db[_0x26a0('0x27')]['find']({'where':{'id':_0x2ab6a1[_0x26a0('0x3e')]['id']}})[_0x26a0('0x21')](handleEntityNotFound(_0x2e754b,null))[_0x26a0('0x21')](saveUpdates(_0x2ab6a1[_0x26a0('0x44')],null))['then'](respondWithResult(_0x2e754b,null))[_0x26a0('0x42')](handleError(_0x2e754b,null));};exports[_0x26a0('0x45')]=function(_0x338c79,_0x38f405){return db['ZohoConfiguration'][_0x26a0('0x41')]({'where':{'id':_0x338c79[_0x26a0('0x3e')]['id']}})[_0x26a0('0x21')](handleEntityNotFound(_0x38f405,null))[_0x26a0('0x21')](removeEntity(_0x38f405,null))[_0x26a0('0x42')](handleError(_0x38f405,null));};exports['getFields']=function(_0x10e166,_0x50daac,_0x59f4af){var _0x1cb275={};var _0x1bfc64={};var _0x4dbccc;var _0x166085;return db['ZohoConfiguration'][_0x26a0('0x46')]({'where':{'id':_0x10e166[_0x26a0('0x3e')]['id']}})[_0x26a0('0x21')](handleEntityNotFound(_0x50daac,null))[_0x26a0('0x21')](function(_0x6ada8e){if(_0x6ada8e){_0x4dbccc=_0x6ada8e;_0x1bfc64[_0x26a0('0x2a')]=_[_0x26a0('0x3f')](db[_0x26a0('0x47')][_0x26a0('0x40')]);_0x1bfc64['query']=_[_0x26a0('0x3f')](_0x10e166['query']);_0x1bfc64[_0x26a0('0x2b')]=_['intersection'](_0x1bfc64['model'],_0x1bfc64[_0x26a0('0x2d')]);_0x1cb275['attributes']=_['intersection'](_0x1bfc64['model'],qs['fields'](_0x10e166['query']['fields']));_0x1cb275[_0x26a0('0x2e')]=_0x1cb275[_0x26a0('0x2e')][_0x26a0('0x30')]?_0x1cb275['attributes']:_0x1bfc64[_0x26a0('0x2a')];_0x1cb275[_0x26a0('0x33')]=qs[_0x26a0('0x34')](_0x10e166[_0x26a0('0x2d')]['sort']);_0x1cb275[_0x26a0('0x35')]=qs['filters'](_[_0x26a0('0x36')](_0x10e166['query'],_0x1bfc64['filters']));if(_0x10e166[_0x26a0('0x2d')][_0x26a0('0x37')]){_0x1cb275[_0x26a0('0x35')]=_[_0x26a0('0x38')](_0x1cb275[_0x26a0('0x35')],{'$or':_[_0x26a0('0x26')](_0x1cb275['attributes'],function(_0x24bedc){var _0x5ef32f={};_0x5ef32f[_0x24bedc]={'$like':'%'+_0x10e166[_0x26a0('0x2d')]['filter']+'%'};return _0x5ef32f;})});}_0x1cb275=_[_0x26a0('0x38')]({},_0x1cb275,_0x10e166['options']);return _0x4dbccc[_0x26a0('0x48')](_0x1cb275);}})[_0x26a0('0x21')](function(_0x20e793){if(_0x20e793){_0x166085=_0x20e793[_0x26a0('0x30')];if(!_0x10e166['query'][_0x26a0('0x31')](_0x26a0('0x32'))){_0x1cb275[_0x26a0('0x1b')]=qs['limit'](_0x10e166[_0x26a0('0x2d')]['limit']);_0x1cb275[_0x26a0('0x1a')]=qs[_0x26a0('0x1a')](_0x10e166[_0x26a0('0x2d')][_0x26a0('0x1a')]);}return _0x4dbccc[_0x26a0('0x48')](_0x1cb275);}})[_0x26a0('0x21')](function(_0x3f0364){if(_0x3f0364){return _0x3f0364?{'count':_0x166085,'rows':_0x3f0364}:null;}})[_0x26a0('0x21')](respondWithResult(_0x50daac,null))['catch'](handleError(_0x50daac,null));};exports[_0x26a0('0x49')]=function(_0x2eaf2c,_0x30fdab,_0x940cc3){var _0x1c55ee={};var _0x3318ad={};var _0x1355e8;var _0x1eefa7;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x2eaf2c[_0x26a0('0x3e')]['id']}})[_0x26a0('0x21')](handleEntityNotFound(_0x30fdab,null))[_0x26a0('0x21')](function(_0x509e89){if(_0x509e89){_0x1355e8=_0x509e89;_0x3318ad[_0x26a0('0x2a')]=_['keys'](db[_0x26a0('0x47')][_0x26a0('0x40')]);_0x3318ad[_0x26a0('0x2d')]=_[_0x26a0('0x3f')](_0x2eaf2c[_0x26a0('0x2d')]);_0x3318ad[_0x26a0('0x2b')]=_[_0x26a0('0x2c')](_0x3318ad['model'],_0x3318ad[_0x26a0('0x2d')]);_0x1c55ee[_0x26a0('0x2e')]=_[_0x26a0('0x2c')](_0x3318ad[_0x26a0('0x2a')],qs[_0x26a0('0x2f')](_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x2f')]));_0x1c55ee[_0x26a0('0x2e')]=_0x1c55ee[_0x26a0('0x2e')][_0x26a0('0x30')]?_0x1c55ee[_0x26a0('0x2e')]:_0x3318ad[_0x26a0('0x2a')];_0x1c55ee[_0x26a0('0x33')]=qs[_0x26a0('0x34')](_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x34')]);_0x1c55ee['where']=qs['filters'](_[_0x26a0('0x36')](_0x2eaf2c[_0x26a0('0x2d')],_0x3318ad['filters']));if(_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x37')]){_0x1c55ee[_0x26a0('0x35')]=_[_0x26a0('0x38')](_0x1c55ee['where'],{'$or':_['map'](_0x1c55ee['attributes'],function(_0x21bf11){var _0x1a19ae={};_0x1a19ae[_0x21bf11]={'$like':'%'+_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x37')]+'%'};return _0x1a19ae;})});}_0x1c55ee=_['merge']({},_0x1c55ee,_0x2eaf2c[_0x26a0('0x3a')]);return _0x1355e8['getSubjects'](_0x1c55ee);}})[_0x26a0('0x21')](function(_0x17c9db){if(_0x17c9db){_0x1eefa7=_0x17c9db['length'];if(!_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x31')](_0x26a0('0x32'))){_0x1c55ee[_0x26a0('0x1b')]=qs[_0x26a0('0x1b')](_0x2eaf2c['query'][_0x26a0('0x1b')]);_0x1c55ee[_0x26a0('0x1a')]=qs['offset'](_0x2eaf2c[_0x26a0('0x2d')][_0x26a0('0x1a')]);}return _0x1355e8[_0x26a0('0x49')](_0x1c55ee);}})[_0x26a0('0x21')](function(_0xce72d3){if(_0xce72d3){return _0xce72d3?{'count':_0x1eefa7,'rows':_0xce72d3}:null;}})['then'](respondWithResult(_0x30fdab,null))['catch'](handleError(_0x30fdab,null));};exports[_0x26a0('0x4a')]=function(_0x5b682b,_0x202e1b,_0x4768d4){var _0x1c2651={};var _0xe8a6a7={};var _0x2a7744;var _0x48f83f;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x5b682b[_0x26a0('0x3e')]['id']}})['then'](handleEntityNotFound(_0x202e1b,null))[_0x26a0('0x21')](function(_0x5ded98){if(_0x5ded98){_0x2a7744=_0x5ded98;_0xe8a6a7[_0x26a0('0x2a')]=_[_0x26a0('0x3f')](db[_0x26a0('0x47')][_0x26a0('0x40')]);_0xe8a6a7[_0x26a0('0x2d')]=_[_0x26a0('0x3f')](_0x5b682b['query']);_0xe8a6a7[_0x26a0('0x2b')]=_['intersection'](_0xe8a6a7[_0x26a0('0x2a')],_0xe8a6a7[_0x26a0('0x2d')]);_0x1c2651[_0x26a0('0x2e')]=_[_0x26a0('0x2c')](_0xe8a6a7[_0x26a0('0x2a')],qs[_0x26a0('0x2f')](_0x5b682b[_0x26a0('0x2d')]['fields']));_0x1c2651[_0x26a0('0x2e')]=_0x1c2651[_0x26a0('0x2e')][_0x26a0('0x30')]?_0x1c2651['attributes']:_0xe8a6a7[_0x26a0('0x2a')];_0x1c2651[_0x26a0('0x33')]=qs[_0x26a0('0x34')](_0x5b682b[_0x26a0('0x2d')][_0x26a0('0x34')]);_0x1c2651[_0x26a0('0x35')]=qs[_0x26a0('0x2b')](_[_0x26a0('0x36')](_0x5b682b[_0x26a0('0x2d')],_0xe8a6a7['filters']));if(_0x5b682b['query'][_0x26a0('0x37')]){_0x1c2651[_0x26a0('0x35')]=_[_0x26a0('0x38')](_0x1c2651[_0x26a0('0x35')],{'$or':_['map'](_0x1c2651[_0x26a0('0x2e')],function(_0xdd5808){var _0x37e238={};_0x37e238[_0xdd5808]={'$like':'%'+_0x5b682b['query'][_0x26a0('0x37')]+'%'};return _0x37e238;})});}_0x1c2651=_[_0x26a0('0x38')]({},_0x1c2651,_0x5b682b[_0x26a0('0x3a')]);return _0x2a7744[_0x26a0('0x4a')](_0x1c2651);}})[_0x26a0('0x21')](function(_0x26f854){if(_0x26f854){_0x48f83f=_0x26f854[_0x26a0('0x30')];if(!_0x5b682b[_0x26a0('0x2d')][_0x26a0('0x31')]('nolimit')){_0x1c2651[_0x26a0('0x1b')]=qs[_0x26a0('0x1b')](_0x5b682b[_0x26a0('0x2d')][_0x26a0('0x1b')]);_0x1c2651[_0x26a0('0x1a')]=qs[_0x26a0('0x1a')](_0x5b682b['query'][_0x26a0('0x1a')]);}return _0x2a7744[_0x26a0('0x4a')](_0x1c2651);}})[_0x26a0('0x21')](function(_0x4bd790){if(_0x4bd790){return _0x4bd790?{'count':_0x48f83f,'rows':_0x4bd790}:null;}})[_0x26a0('0x21')](respondWithResult(_0x202e1b,null))[_0x26a0('0x42')](handleError(_0x202e1b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c4eee30..8ef3c96 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 _0x7be1=['../../config/logger','api','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7be1,0x8e));var _0x17be=function(_0x58a0bb,_0x3464b8){_0x58a0bb=_0x58a0bb-0x0;var _0x1f1146=_0x7be1[_0x58a0bb];return _0x1f1146;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var logger=require(_0x17be('0x2'))(_0x17be('0x3'));var moment=require(_0x17be('0x4'));var BPromise=require(_0x17be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17be('0x6'));var rimraf=require(_0x17be('0x7'));var config=require('../../config/environment');var attributes=require(_0x17be('0x8'));module[_0x17be('0x9')]=function(_0xc0b2d7,_0x3ddc40){return _0xc0b2d7[_0x17be('0xa')](_0x17be('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc674=['exports','int_zoho_configurations','../../config/logger','moment','bluebird','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xc674,0xb2));var _0x4c67=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0xc674[_0x594e11];return _0x5418ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c67('0x0'))('api');var moment=require(_0x4c67('0x1'));var BPromise=require(_0x4c67('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c67('0x3'));var rimraf=require(_0x4c67('0x4'));var config=require('../../config/environment');var attributes=require(_0x4c67('0x5'));module[_0x4c67('0x6')]=function(_0x497b65,_0x266ff6){return _0x497b65['define']('ZohoConfiguration',attributes,{'tableName':_0x4c67('0x7'),'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 fdad27b..d709116 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 _0xfa31=['http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14bed3,_0xa2ff48){var _0x363a1d=function(_0x4c64ca){while(--_0x4c64ca){_0x14bed3['push'](_0x14bed3['shift']());}};_0x363a1d(++_0xa2ff48);}(_0xfa31,0x124));var _0x1fa3=function(_0x4c70a1,_0x38d5a0){_0x4c70a1=_0x4c70a1-0x0;var _0x58091d=_0xfa31[_0x4c70a1];return _0x58091d;};'use strict';var _=require(_0x1fa3('0x0'));var util=require(_0x1fa3('0x1'));var moment=require(_0x1fa3('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fa3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1fa3('0x4'));var logger=require(_0x1fa3('0x5'))('rpc');var config=require(_0x1fa3('0x6'));var jayson=require(_0x1fa3('0x7'));var client=jayson['client'][_0x1fa3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28e657,_0x5dadba,_0x501bca){return new BPromise(function(_0x24fdf9,_0x2cc5a1){return client[_0x1fa3('0x9')](_0x28e657,_0x501bca)[_0x1fa3('0xa')](function(_0x59c722){logger[_0x1fa3('0xb')](_0x1fa3('0xc'),_0x5dadba,_0x1fa3('0xd'));logger['debug'](_0x1fa3('0xe'),_0x5dadba,_0x1fa3('0xd'),JSON['stringify'](_0x59c722));if(_0x59c722[_0x1fa3('0xf')]){if(_0x59c722['error'][_0x1fa3('0x10')]===0x1f4){logger[_0x1fa3('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x5dadba,_0x59c722[_0x1fa3('0xf')][_0x1fa3('0x11')]);return _0x2cc5a1(_0x59c722['error'][_0x1fa3('0x11')]);}logger['error'](_0x1fa3('0xc'),_0x5dadba,_0x59c722[_0x1fa3('0xf')][_0x1fa3('0x11')]);return _0x24fdf9(_0x59c722[_0x1fa3('0xf')]['message']);}else{logger[_0x1fa3('0xb')](_0x1fa3('0xc'),_0x5dadba,_0x1fa3('0xd'));_0x24fdf9(_0x59c722[_0x1fa3('0x12')]['message']);}})[_0x1fa3('0x13')](function(_0x55a143){logger[_0x1fa3('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x5dadba,_0x55a143);_0x2cc5a1(_0x55a143);});});} \ No newline at end of file +var _0x3d7e=['jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x27e4ed,_0x3bd74f){var _0x444152=function(_0x50faf6){while(--_0x50faf6){_0x27e4ed['push'](_0x27e4ed['shift']());}};_0x444152(++_0x3bd74f);}(_0x3d7e,0x199));var _0xe3d7=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x3d7e[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0xe3d7('0x0'));var util=require('util');var moment=require(_0xe3d7('0x1'));var BPromise=require(_0xe3d7('0x2'));var rs=require(_0xe3d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3d7('0x4'))['db'];var utils=require(_0xe3d7('0x5'));var logger=require(_0xe3d7('0x6'))(_0xe3d7('0x7'));var config=require(_0xe3d7('0x8'));var jayson=require(_0xe3d7('0x9'));var client=jayson['client'][_0xe3d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51ee3b,_0xdb62a,_0x44ca45){return new BPromise(function(_0x2bd6e5,_0x3cb1c8){return client[_0xe3d7('0xb')](_0x51ee3b,_0x44ca45)[_0xe3d7('0xc')](function(_0x4bec60){logger[_0xe3d7('0xd')](_0xe3d7('0xe'),_0xdb62a,_0xe3d7('0xf'));logger[_0xe3d7('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0xdb62a,_0xe3d7('0xf'),JSON[_0xe3d7('0x11')](_0x4bec60));if(_0x4bec60[_0xe3d7('0x12')]){if(_0x4bec60['error']['code']===0x1f4){logger[_0xe3d7('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xdb62a,_0x4bec60[_0xe3d7('0x12')][_0xe3d7('0x13')]);return _0x3cb1c8(_0x4bec60[_0xe3d7('0x12')][_0xe3d7('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xdb62a,_0x4bec60[_0xe3d7('0x12')][_0xe3d7('0x13')]);return _0x2bd6e5(_0x4bec60[_0xe3d7('0x12')][_0xe3d7('0x13')]);}else{logger[_0xe3d7('0xd')](_0xe3d7('0xe'),_0xdb62a,_0xe3d7('0xf'));_0x2bd6e5(_0x4bec60[_0xe3d7('0x14')][_0xe3d7('0x13')]);}})[_0xe3d7('0x15')](function(_0x1c7386){logger[_0xe3d7('0x12')](_0xe3d7('0xe'),_0xdb62a,_0x1c7386);_0x3cb1c8(_0x1c7386);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 32d68c2..894ca0b 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 _0x997a=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x4af0af,_0x5e16ae){var _0x139516=function(_0x313f54){while(--_0x313f54){_0x4af0af['push'](_0x4af0af['shift']());}};_0x139516(++_0x5e16ae);}(_0x997a,0x1e8));var _0xa997=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x997a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xa997('0x0'));var path=require(_0xa997('0x1'));var timeout=require(_0xa997('0x2'));var express=require('express');var router=express[_0xa997('0x3')]();var fs_extra=require(_0xa997('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa997('0x5'));var config=require('../../config/environment');var controller=require(_0xa997('0x6'));router[_0xa997('0x7')]('/',auth[_0xa997('0x8')](),controller[_0xa997('0x9')]);router[_0xa997('0x7')]('/:id',auth[_0xa997('0x8')](),controller[_0xa997('0xa')]);router[_0xa997('0xb')]('/',auth[_0xa997('0x8')](),controller[_0xa997('0xc')]);router[_0xa997('0xd')](_0xa997('0xe'),auth[_0xa997('0x8')](),controller[_0xa997('0xf')]);router['delete'](_0xa997('0xe'),auth[_0xa997('0x8')](),controller[_0xa997('0x10')]);module[_0xa997('0x11')]=router; \ No newline at end of file +var _0xddec=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','exports'];(function(_0x2f76ae,_0x36b482){var _0xf0923f=function(_0x53fcea){while(--_0x53fcea){_0x2f76ae['push'](_0x2f76ae['shift']());}};_0xf0923f(++_0x36b482);}(_0xddec,0xbb));var _0xcdde=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xddec[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xcdde('0x0'));var util=require('util');var path=require(_0xcdde('0x1'));var timeout=require(_0xcdde('0x2'));var express=require('express');var router=express[_0xcdde('0x3')]();var fs_extra=require(_0xcdde('0x4'));var auth=require(_0xcdde('0x5'));var interaction=require(_0xcdde('0x6'));var config=require('../../config/environment');var controller=require(_0xcdde('0x7'));router[_0xcdde('0x8')]('/',auth[_0xcdde('0x9')](),controller['index']);router['get'](_0xcdde('0xa'),auth[_0xcdde('0x9')](),controller['show']);router[_0xcdde('0xb')]('/',auth[_0xcdde('0x9')](),controller[_0xcdde('0xc')]);router[_0xcdde('0xd')](_0xcdde('0xa'),auth['isAuthenticated'](),controller[_0xcdde('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xcdde('0xf')]);module[_0xcdde('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1bc4ecb..268076a 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 _0x313c=['keyValue','picklist','STRING','ENUM','BOOLEAN','exports','string','variable','customVariable'];(function(_0x2fd9a1,_0x38c5e8){var _0x44f219=function(_0x5acd77){while(--_0x5acd77){_0x2fd9a1['push'](_0x2fd9a1['shift']());}};_0x44f219(++_0x38c5e8);}(_0x313c,0x1b5));var _0xc313=function(_0x4f7b6a,_0x2d3458){_0x4f7b6a=_0x4f7b6a-0x0;var _0x17ee6b=_0x313c[_0x4f7b6a];return _0x17ee6b;};'use strict';var Sequelize=require('sequelize');module[_0xc313('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc313('0x1'),_0xc313('0x2'),_0xc313('0x3'),_0xc313('0x4'),_0xc313('0x5')),'defaultValue':_0xc313('0x1')},'content':{'type':Sequelize[_0xc313('0x6')]},'key':{'type':Sequelize[_0xc313('0x6')]},'keyType':{'type':Sequelize[_0xc313('0x7')](_0xc313('0x1'),_0xc313('0x2'),_0xc313('0x3'))},'keyContent':{'type':Sequelize[_0xc313('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc313('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4118=['picklist','STRING','ENUM','variable','sequelize','exports','string','customVariable','keyValue'];(function(_0x270c16,_0x4b0727){var _0x56ae39=function(_0x57cda8){while(--_0x57cda8){_0x270c16['push'](_0x270c16['shift']());}};_0x56ae39(++_0x4b0727);}(_0x4118,0x187));var _0x8411=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x4118[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0x8411('0x0'));module[_0x8411('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8411('0x2'),'variable',_0x8411('0x3'),_0x8411('0x4'),_0x8411('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8411('0x6')]},'key':{'type':Sequelize[_0x8411('0x6')]},'keyType':{'type':Sequelize[_0x8411('0x7')](_0x8411('0x2'),_0x8411('0x8'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8411('0x6')]},'nameField':{'type':Sequelize[_0x8411('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8411('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 2ca3c14..4df80d0 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 _0xe91c=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','ZohoField','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xe91c,0xe1));var _0xce91=function(_0x5b243e,_0xe2455d){_0x5b243e=_0x5b243e-0x0;var _0x3517ab=_0xe91c[_0x5b243e];return _0x3517ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce91('0x0'));var zipdir=require(_0xce91('0x1'));var jsonpatch=require(_0xce91('0x2'));var rp=require(_0xce91('0x3'));var moment=require(_0xce91('0x4'));var BPromise=require(_0xce91('0x5'));var Mustache=require(_0xce91('0x6'));var util=require('util');var path=require(_0xce91('0x7'));var sox=require(_0xce91('0x8'));var csv=require('to-csv');var ejs=require(_0xce91('0x9'));var fs=require('fs');var fs_extra=require(_0xce91('0xa'));var _=require(_0xce91('0xb'));var squel=require(_0xce91('0xc'));var crypto=require(_0xce91('0xd'));var jsforce=require(_0xce91('0xe'));var deskjs=require(_0xce91('0xf'));var toCsv=require(_0xce91('0x10'));var querystring=require(_0xce91('0x11'));var Papa=require(_0xce91('0x12'));var Redis=require(_0xce91('0x13'));var authService=require(_0xce91('0x14'));var qs=require(_0xce91('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce91('0x16'));var logger=require(_0xce91('0x17'))(_0xce91('0x18'));var utils=require(_0xce91('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xce91('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x64b18,_0x28ff2d){_0x28ff2d=_0x28ff2d||0xcc;return function(_0x405ed8){if(_0x405ed8){return _0x64b18[_0xce91('0x1b')](_0x28ff2d);}return _0x64b18[_0xce91('0x1c')](_0x28ff2d)[_0xce91('0x1d')]();};}function respondWithResult(_0x422fb2,_0x4a1923){_0x4a1923=_0x4a1923||0xc8;return function(_0x342458){if(_0x342458){return _0x422fb2[_0xce91('0x1c')](_0x4a1923)[_0xce91('0x1e')](_0x342458);}};}function respondWithFilteredResult(_0x5ad489,_0x5362bb){return function(_0x3cb095){if(_0x3cb095){var _0x308d51=typeof _0x5362bb[_0xce91('0x1f')]===_0xce91('0x20')&&typeof _0x5362bb[_0xce91('0x21')]===_0xce91('0x20');var _0x53f0d7=_0x3cb095['count'];var _0x51d179=_0x308d51?0x0:_0x5362bb[_0xce91('0x1f')];var _0x2f1449=_0x308d51?_0x3cb095[_0xce91('0x22')]:_0x5362bb[_0xce91('0x1f')]+_0x5362bb[_0xce91('0x21')];var _0x3e8355;if(_0x2f1449>=_0x53f0d7){_0x2f1449=_0x53f0d7;_0x3e8355=0xc8;}else{_0x3e8355=0xce;}_0x5ad489[_0xce91('0x1c')](_0x3e8355);return _0x5ad489[_0xce91('0x23')]('Content-Range',_0x51d179+'-'+_0x2f1449+'/'+_0x53f0d7)[_0xce91('0x1e')](_0x3cb095);}return null;};}function patchUpdates(_0x33fe5b){return function(_0x5ee791){try{jsonpatch[_0xce91('0x24')](_0x5ee791,_0x33fe5b,!![]);}catch(_0x567f55){return BPromise[_0xce91('0x25')](_0x567f55);}return _0x5ee791[_0xce91('0x26')]();};}function saveUpdates(_0x435f2f,_0x2848b1){return function(_0x580d73){if(_0x580d73){return _0x580d73[_0xce91('0x27')](_0x435f2f)['then'](function(_0x122dcd){return _0x122dcd;});}return null;};}function removeEntity(_0x3fed30,_0x440f97){return function(_0x717d9b){if(_0x717d9b){return _0x717d9b[_0xce91('0x28')]()[_0xce91('0x29')](function(){_0x3fed30[_0xce91('0x1c')](0xcc)[_0xce91('0x1d')]();});}};}function handleEntityNotFound(_0x515f1f,_0x97895d){return function(_0x25786b){if(!_0x25786b){_0x515f1f['sendStatus'](0x194);}return _0x25786b;};}function handleError(_0x9fbfbd,_0x47fbf8){_0x47fbf8=_0x47fbf8||0x1f4;return function(_0x175453){logger[_0xce91('0x2a')](_0x175453[_0xce91('0x2b')]);if(_0x175453['name']){delete _0x175453[_0xce91('0x2c')];}_0x9fbfbd[_0xce91('0x1c')](_0x47fbf8)['send'](_0x175453);};}exports[_0xce91('0x2d')]=function(_0x920beb,_0x410366){var _0x1a6e20={},_0x55a651={},_0x556e09={'count':0x0,'rows':[]};var _0x290059=_[_0xce91('0x2e')](db[_0xce91('0x2f')][_0xce91('0x30')],function(_0x1fb858){return{'name':_0x1fb858['fieldName'],'type':_0x1fb858[_0xce91('0x31')]['key']};});_0x55a651[_0xce91('0x32')]=_['map'](_0x290059,_0xce91('0x2c'));_0x55a651[_0xce91('0x33')]=_[_0xce91('0x34')](_0x920beb[_0xce91('0x33')]);_0x55a651['filters']=_[_0xce91('0x35')](_0x55a651[_0xce91('0x32')],_0x55a651['query']);_0x1a6e20[_0xce91('0x36')]=_['intersection'](_0x55a651['model'],qs[_0xce91('0x37')](_0x920beb[_0xce91('0x33')][_0xce91('0x37')]));_0x1a6e20['attributes']=_0x1a6e20[_0xce91('0x36')]['length']?_0x1a6e20['attributes']:_0x55a651['model'];if(!_0x920beb[_0xce91('0x33')][_0xce91('0x38')]('nolimit')){_0x1a6e20[_0xce91('0x21')]=qs[_0xce91('0x21')](_0x920beb['query']['limit']);_0x1a6e20['offset']=qs[_0xce91('0x1f')](_0x920beb[_0xce91('0x33')][_0xce91('0x1f')]);}_0x1a6e20['order']=qs[_0xce91('0x39')](_0x920beb['query'][_0xce91('0x39')]);_0x1a6e20['where']=qs[_0xce91('0x3a')](_['pick'](_0x920beb['query'],_0x55a651[_0xce91('0x3a')]),_0x290059);if(_0x920beb[_0xce91('0x33')]['filter']){_0x1a6e20[_0xce91('0x3b')]=_[_0xce91('0x3c')](_0x1a6e20[_0xce91('0x3b')],{'$or':_['map'](_0x290059,function(_0x579e84){if(_0x579e84[_0xce91('0x31')]!==_0xce91('0x3d')){var _0x1800de={};_0x1800de[_0x579e84[_0xce91('0x2c')]]={'$like':'%'+_0x920beb[_0xce91('0x33')][_0xce91('0x3e')]+'%'};return _0x1800de;}})});}_0x1a6e20=_['merge']({},_0x1a6e20,_0x920beb[_0xce91('0x3f')]);var _0x10973f={'where':_0x1a6e20['where']};return db['ZohoField'][_0xce91('0x22')](_0x10973f)['then'](function(_0x419a13){_0x556e09[_0xce91('0x22')]=_0x419a13;if(_0x920beb[_0xce91('0x33')][_0xce91('0x40')]){_0x1a6e20[_0xce91('0x41')]=[{'all':!![]}];}return db[_0xce91('0x2f')][_0xce91('0x42')](_0x1a6e20);})['then'](function(_0x2ad962){_0x556e09[_0xce91('0x43')]=_0x2ad962;return _0x556e09;})['then'](respondWithFilteredResult(_0x410366,_0x1a6e20))[_0xce91('0x44')](handleError(_0x410366,null));};exports[_0xce91('0x45')]=function(_0x5c376e,_0x1b81f9){var _0x33a841={'raw':!![],'where':{'id':_0x5c376e[_0xce91('0x46')]['id']}},_0x295e3a={};_0x295e3a[_0xce91('0x32')]=_[_0xce91('0x34')](db[_0xce91('0x2f')][_0xce91('0x30')]);_0x295e3a['query']=_[_0xce91('0x34')](_0x5c376e[_0xce91('0x33')]);_0x295e3a[_0xce91('0x3a')]=_['intersection'](_0x295e3a['model'],_0x295e3a[_0xce91('0x33')]);_0x33a841[_0xce91('0x36')]=_[_0xce91('0x35')](_0x295e3a[_0xce91('0x32')],qs[_0xce91('0x37')](_0x5c376e[_0xce91('0x33')][_0xce91('0x37')]));_0x33a841[_0xce91('0x36')]=_0x33a841[_0xce91('0x36')][_0xce91('0x47')]?_0x33a841[_0xce91('0x36')]:_0x295e3a[_0xce91('0x32')];if(_0x5c376e[_0xce91('0x33')]['includeAll']){_0x33a841['include']=[{'all':!![]}];}_0x33a841=_[_0xce91('0x3c')]({},_0x33a841,_0x5c376e[_0xce91('0x3f')]);return db[_0xce91('0x2f')][_0xce91('0x48')](_0x33a841)[_0xce91('0x29')](handleEntityNotFound(_0x1b81f9,null))['then'](respondWithResult(_0x1b81f9,null))[_0xce91('0x44')](handleError(_0x1b81f9,null));};exports[_0xce91('0x49')]=function(_0x62eb73,_0x335354){return db[_0xce91('0x2f')][_0xce91('0x49')](_0x62eb73[_0xce91('0x4a')],{})[_0xce91('0x29')](respondWithResult(_0x335354,0xc9))[_0xce91('0x44')](handleError(_0x335354,null));};exports[_0xce91('0x27')]=function(_0x2ce23a,_0x5d630c){if(_0x2ce23a[_0xce91('0x4a')]['id']){delete _0x2ce23a['body']['id'];}return db['ZohoField'][_0xce91('0x48')]({'where':{'id':_0x2ce23a['params']['id']}})['then'](handleEntityNotFound(_0x5d630c,null))[_0xce91('0x29')](saveUpdates(_0x2ce23a['body'],null))[_0xce91('0x29')](respondWithResult(_0x5d630c,null))[_0xce91('0x44')](handleError(_0x5d630c,null));};exports['destroy']=function(_0x35f84b,_0x2f23ef){return db[_0xce91('0x2f')]['find']({'where':{'id':_0x35f84b['params']['id']}})['then'](handleEntityNotFound(_0x2f23ef,null))[_0xce91('0x29')](removeEntity(_0x2f23ef,null))['catch'](handleError(_0x2f23ef,null));}; \ No newline at end of file +var _0x9dab=['rawAttributes','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','merge','where','type','VIRTUAL','count','includeAll','findAll','rows','params'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0x9dab,0x17e));var _0xb9da=function(_0x277b58,_0x4bdf34){_0x277b58=_0x277b58-0x0;var _0x499973=_0x9dab[_0x277b58];return _0x499973;};'use strict';var emlformat=require(_0xb9da('0x0'));var rimraf=require(_0xb9da('0x1'));var zipdir=require(_0xb9da('0x2'));var jsonpatch=require(_0xb9da('0x3'));var rp=require(_0xb9da('0x4'));var moment=require('moment');var BPromise=require(_0xb9da('0x5'));var Mustache=require(_0xb9da('0x6'));var util=require(_0xb9da('0x7'));var path=require('path');var sox=require(_0xb9da('0x8'));var csv=require(_0xb9da('0x9'));var ejs=require(_0xb9da('0xa'));var fs=require('fs');var fs_extra=require(_0xb9da('0xb'));var _=require('lodash');var squel=require(_0xb9da('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9da('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9da('0xe'));var Papa=require(_0xb9da('0xf'));var Redis=require('ioredis');var authService=require(_0xb9da('0x10'));var qs=require(_0xb9da('0x11'));var as=require(_0xb9da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9da('0x13'))(_0xb9da('0x14'));var utils=require(_0xb9da('0x15'));var config=require(_0xb9da('0x16'));var licenseUtil=require(_0xb9da('0x17'));var db=require(_0xb9da('0x18'))['db'];function respondWithStatusCode(_0x2a31b5,_0x2e00b8){_0x2e00b8=_0x2e00b8||0xcc;return function(_0x4c6588){if(_0x4c6588){return _0x2a31b5[_0xb9da('0x19')](_0x2e00b8);}return _0x2a31b5[_0xb9da('0x1a')](_0x2e00b8)[_0xb9da('0x1b')]();};}function respondWithResult(_0x369731,_0x375357){_0x375357=_0x375357||0xc8;return function(_0x3f520d){if(_0x3f520d){return _0x369731[_0xb9da('0x1a')](_0x375357)[_0xb9da('0x1c')](_0x3f520d);}};}function respondWithFilteredResult(_0x43db73,_0x4ec181){return function(_0x11718b){if(_0x11718b){var _0x3e51f1=typeof _0x4ec181[_0xb9da('0x1d')]===_0xb9da('0x1e')&&typeof _0x4ec181[_0xb9da('0x1f')]==='undefined';var _0x2fc2a0=_0x11718b['count'];var _0x3b2053=_0x3e51f1?0x0:_0x4ec181['offset'];var _0x41957d=_0x3e51f1?_0x11718b['count']:_0x4ec181['offset']+_0x4ec181[_0xb9da('0x1f')];var _0x3ff39a;if(_0x41957d>=_0x2fc2a0){_0x41957d=_0x2fc2a0;_0x3ff39a=0xc8;}else{_0x3ff39a=0xce;}_0x43db73[_0xb9da('0x1a')](_0x3ff39a);return _0x43db73[_0xb9da('0x20')](_0xb9da('0x21'),_0x3b2053+'-'+_0x41957d+'/'+_0x2fc2a0)[_0xb9da('0x1c')](_0x11718b);}return null;};}function patchUpdates(_0x1296c3){return function(_0xd519ab){try{jsonpatch[_0xb9da('0x22')](_0xd519ab,_0x1296c3,!![]);}catch(_0x3be8e8){return BPromise[_0xb9da('0x23')](_0x3be8e8);}return _0xd519ab[_0xb9da('0x24')]();};}function saveUpdates(_0x44799a,_0x5321db){return function(_0x375712){if(_0x375712){return _0x375712[_0xb9da('0x25')](_0x44799a)[_0xb9da('0x26')](function(_0x4b7669){return _0x4b7669;});}return null;};}function removeEntity(_0x5a7429,_0x2131d3){return function(_0x1121da){if(_0x1121da){return _0x1121da[_0xb9da('0x27')]()[_0xb9da('0x26')](function(){_0x5a7429[_0xb9da('0x1a')](0xcc)[_0xb9da('0x1b')]();});}};}function handleEntityNotFound(_0x3c2046,_0x452e3f){return function(_0x5bdfc5){if(!_0x5bdfc5){_0x3c2046['sendStatus'](0x194);}return _0x5bdfc5;};}function handleError(_0x5725c2,_0x48d961){_0x48d961=_0x48d961||0x1f4;return function(_0x9978e1){logger[_0xb9da('0x28')](_0x9978e1[_0xb9da('0x29')]);if(_0x9978e1[_0xb9da('0x2a')]){delete _0x9978e1['name'];}_0x5725c2[_0xb9da('0x1a')](_0x48d961)[_0xb9da('0x2b')](_0x9978e1);};}exports[_0xb9da('0x2c')]=function(_0x1e0f6a,_0x89cef0){var _0x4ef469={},_0x485b1d={},_0x49fcde={'count':0x0,'rows':[]};var _0xc163dc=_[_0xb9da('0x2d')](db[_0xb9da('0x2e')]['rawAttributes'],function(_0x414d20){return{'name':_0x414d20['fieldName'],'type':_0x414d20['type']['key']};});_0x485b1d['model']=_[_0xb9da('0x2d')](_0xc163dc,'name');_0x485b1d[_0xb9da('0x2f')]=_[_0xb9da('0x30')](_0x1e0f6a[_0xb9da('0x2f')]);_0x485b1d['filters']=_[_0xb9da('0x31')](_0x485b1d[_0xb9da('0x32')],_0x485b1d[_0xb9da('0x2f')]);_0x4ef469['attributes']=_[_0xb9da('0x31')](_0x485b1d[_0xb9da('0x32')],qs['fields'](_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x33')]));_0x4ef469[_0xb9da('0x34')]=_0x4ef469['attributes'][_0xb9da('0x35')]?_0x4ef469['attributes']:_0x485b1d[_0xb9da('0x32')];if(!_0x1e0f6a['query']['hasOwnProperty'](_0xb9da('0x36'))){_0x4ef469[_0xb9da('0x1f')]=qs['limit'](_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x1f')]);_0x4ef469[_0xb9da('0x1d')]=qs['offset'](_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x1d')]);}_0x4ef469[_0xb9da('0x37')]=qs[_0xb9da('0x38')](_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x38')]);_0x4ef469['where']=qs[_0xb9da('0x39')](_['pick'](_0x1e0f6a[_0xb9da('0x2f')],_0x485b1d[_0xb9da('0x39')]),_0xc163dc);if(_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x3a')]){_0x4ef469['where']=_[_0xb9da('0x3b')](_0x4ef469[_0xb9da('0x3c')],{'$or':_['map'](_0xc163dc,function(_0x5f2a81){if(_0x5f2a81[_0xb9da('0x3d')]!==_0xb9da('0x3e')){var _0x4e2751={};_0x4e2751[_0x5f2a81[_0xb9da('0x2a')]]={'$like':'%'+_0x1e0f6a[_0xb9da('0x2f')][_0xb9da('0x3a')]+'%'};return _0x4e2751;}})});}_0x4ef469=_[_0xb9da('0x3b')]({},_0x4ef469,_0x1e0f6a['options']);var _0xf05dd2={'where':_0x4ef469[_0xb9da('0x3c')]};return db['ZohoField'][_0xb9da('0x3f')](_0xf05dd2)['then'](function(_0x35e93d){_0x49fcde['count']=_0x35e93d;if(_0x1e0f6a['query'][_0xb9da('0x40')]){_0x4ef469['include']=[{'all':!![]}];}return db['ZohoField'][_0xb9da('0x41')](_0x4ef469);})['then'](function(_0x434fe6){_0x49fcde[_0xb9da('0x42')]=_0x434fe6;return _0x49fcde;})[_0xb9da('0x26')](respondWithFilteredResult(_0x89cef0,_0x4ef469))['catch'](handleError(_0x89cef0,null));};exports['show']=function(_0x378c50,_0x597562){var _0x16f317={'raw':!![],'where':{'id':_0x378c50[_0xb9da('0x43')]['id']}},_0x36a324={};_0x36a324[_0xb9da('0x32')]=_[_0xb9da('0x30')](db[_0xb9da('0x2e')][_0xb9da('0x44')]);_0x36a324[_0xb9da('0x2f')]=_[_0xb9da('0x30')](_0x378c50[_0xb9da('0x2f')]);_0x36a324[_0xb9da('0x39')]=_['intersection'](_0x36a324['model'],_0x36a324[_0xb9da('0x2f')]);_0x16f317[_0xb9da('0x34')]=_[_0xb9da('0x31')](_0x36a324[_0xb9da('0x32')],qs[_0xb9da('0x33')](_0x378c50['query']['fields']));_0x16f317[_0xb9da('0x34')]=_0x16f317[_0xb9da('0x34')][_0xb9da('0x35')]?_0x16f317[_0xb9da('0x34')]:_0x36a324[_0xb9da('0x32')];if(_0x378c50[_0xb9da('0x2f')][_0xb9da('0x40')]){_0x16f317[_0xb9da('0x45')]=[{'all':!![]}];}_0x16f317=_[_0xb9da('0x3b')]({},_0x16f317,_0x378c50[_0xb9da('0x46')]);return db[_0xb9da('0x2e')][_0xb9da('0x47')](_0x16f317)[_0xb9da('0x26')](handleEntityNotFound(_0x597562,null))[_0xb9da('0x26')](respondWithResult(_0x597562,null))[_0xb9da('0x48')](handleError(_0x597562,null));};exports[_0xb9da('0x49')]=function(_0x467e34,_0x381c4f){return db[_0xb9da('0x2e')][_0xb9da('0x49')](_0x467e34['body'],{})[_0xb9da('0x26')](respondWithResult(_0x381c4f,0xc9))['catch'](handleError(_0x381c4f,null));};exports['update']=function(_0x4d6b1e,_0x34e469){if(_0x4d6b1e[_0xb9da('0x4a')]['id']){delete _0x4d6b1e['body']['id'];}return db[_0xb9da('0x2e')][_0xb9da('0x47')]({'where':{'id':_0x4d6b1e[_0xb9da('0x43')]['id']}})[_0xb9da('0x26')](handleEntityNotFound(_0x34e469,null))[_0xb9da('0x26')](saveUpdates(_0x4d6b1e['body'],null))[_0xb9da('0x26')](respondWithResult(_0x34e469,null))[_0xb9da('0x48')](handleError(_0x34e469,null));};exports['destroy']=function(_0x2146aa,_0x5a055b){return db[_0xb9da('0x2e')][_0xb9da('0x47')]({'where':{'id':_0x2146aa[_0xb9da('0x43')]['id']}})[_0xb9da('0x26')](handleEntityNotFound(_0x5a055b,null))[_0xb9da('0x26')](removeEntity(_0x5a055b,null))[_0xb9da('0x48')](handleError(_0x5a055b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 25d8b8e..585f479 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 _0x33af=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','util','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33af,0xec));var _0xf33a=function(_0x818500,_0xe7620c){_0x818500=_0x818500-0x0;var _0x342023=_0x33af[_0x818500];return _0x342023;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require('../../config/logger')(_0xf33a('0x1'));var moment=require(_0xf33a('0x2'));var BPromise=require(_0xf33a('0x3'));var rp=require(_0xf33a('0x4'));var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf33a('0x7'));module[_0xf33a('0x8')]=function(_0x583e54,_0xc0dd13){return _0x583e54[_0xf33a('0x9')](_0xf33a('0xa'),attributes,{'tableName':_0xf33a('0xb'),'paranoid':![],'indexes':[{'name':_0xf33a('0xc'),'fields':[_0xf33a('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x12f42c,_0x415b84){var _0xbcf616=function(_0x242128){while(--_0x242128){_0x12f42c['push'](_0x12f42c['shift']());}};_0xbcf616(++_0x415b84);}(_0x2a07,0x74));var _0x72a0=function(_0x3b3dcb,_0x5c873f){_0x3b3dcb=_0x3b3dcb-0x0;var _0x4054b4=_0x2a07[_0x3b3dcb];return _0x4054b4;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xf'),_0x72a0('0x10')],'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 50984b8..3f35560 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 _0x96ee=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x279755,_0x42ad77){var _0x138178=function(_0x462033){while(--_0x462033){_0x279755['push'](_0x279755['shift']());}};_0x138178(++_0x42ad77);}(_0x96ee,0x1aa));var _0xe96e=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x96ee[_0x36940e];return _0x3283f2;};'use strict';var _=require('lodash');var util=require(_0xe96e('0x0'));var moment=require(_0xe96e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe96e('0x2'));var fs=require('fs');var Redis=require(_0xe96e('0x3'));var db=require(_0xe96e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe96e('0x5'))(_0xe96e('0x6'));var config=require(_0xe96e('0x7'));var jayson=require(_0xe96e('0x8'));var client=jayson['client'][_0xe96e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19af3d,_0x54a6fa,_0x33e532){return new BPromise(function(_0x13df48,_0x2bf912){return client[_0xe96e('0xa')](_0x19af3d,_0x33e532)[_0xe96e('0xb')](function(_0x1cf0f9){logger[_0xe96e('0xc')](_0xe96e('0xd'),_0x54a6fa,_0xe96e('0xe'));logger[_0xe96e('0xf')](_0xe96e('0x10'),_0x54a6fa,'request\x20sent',JSON[_0xe96e('0x11')](_0x1cf0f9));if(_0x1cf0f9[_0xe96e('0x12')]){if(_0x1cf0f9[_0xe96e('0x12')][_0xe96e('0x13')]===0x1f4){logger[_0xe96e('0x12')](_0xe96e('0xd'),_0x54a6fa,_0x1cf0f9[_0xe96e('0x12')][_0xe96e('0x14')]);return _0x2bf912(_0x1cf0f9['error'][_0xe96e('0x14')]);}logger[_0xe96e('0x12')](_0xe96e('0xd'),_0x54a6fa,_0x1cf0f9[_0xe96e('0x12')][_0xe96e('0x14')]);return _0x13df48(_0x1cf0f9[_0xe96e('0x12')]['message']);}else{logger[_0xe96e('0xc')](_0xe96e('0xd'),_0x54a6fa,_0xe96e('0xe'));_0x13df48(_0x1cf0f9[_0xe96e('0x15')]['message']);}})['catch'](function(_0x544ffb){logger['error'](_0xe96e('0xd'),_0x54a6fa,_0x544ffb);_0x2bf912(_0x544ffb);});});} \ No newline at end of file +var _0x870f=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x294f30,_0x4cdb4c){var _0x39cd8b=function(_0xd61d6){while(--_0xd61d6){_0x294f30['push'](_0x294f30['shift']());}};_0x39cd8b(++_0x4cdb4c);}(_0x870f,0x1dd));var _0xf870=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x870f[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf870('0x0'));var fs=require('fs');var Redis=require(_0xf870('0x1'));var db=require(_0xf870('0x2'))['db'];var utils=require(_0xf870('0x3'));var logger=require(_0xf870('0x4'))(_0xf870('0x5'));var config=require(_0xf870('0x6'));var jayson=require(_0xf870('0x7'));var client=jayson[_0xf870('0x8')][_0xf870('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105e8d,_0x366a7f,_0x2abb06){return new BPromise(function(_0x2c78e2,_0x3631c1){return client[_0xf870('0xa')](_0x105e8d,_0x2abb06)[_0xf870('0xb')](function(_0xa6b7f9){logger[_0xf870('0xc')]('ZohoField,\x20%s,\x20%s',_0x366a7f,_0xf870('0xd'));logger[_0xf870('0xe')](_0xf870('0xf'),_0x366a7f,'request\x20sent',JSON[_0xf870('0x10')](_0xa6b7f9));if(_0xa6b7f9[_0xf870('0x11')]){if(_0xa6b7f9[_0xf870('0x11')][_0xf870('0x12')]===0x1f4){logger['error'](_0xf870('0x13'),_0x366a7f,_0xa6b7f9[_0xf870('0x11')]['message']);return _0x3631c1(_0xa6b7f9['error'][_0xf870('0x14')]);}logger[_0xf870('0x11')](_0xf870('0x13'),_0x366a7f,_0xa6b7f9[_0xf870('0x11')][_0xf870('0x14')]);return _0x2c78e2(_0xa6b7f9['error']['message']);}else{logger[_0xf870('0xc')]('ZohoField,\x20%s,\x20%s',_0x366a7f,_0xf870('0xd'));_0x2c78e2(_0xa6b7f9['result'][_0xf870('0x14')]);}})[_0xf870('0x15')](function(_0x3f26ce){logger[_0xf870('0x11')]('ZohoField,\x20%s,\x20%s',_0x366a7f,_0x3f26ce);_0x3631c1(_0x3f26ce);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 650b086..d666b7e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x53c09a,_0x33c42f){var _0x571762=function(_0x210205){while(--_0x210205){_0x53c09a['push'](_0x53c09a['shift']());}};_0x571762(++_0x33c42f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x10ec5c,_0x43aaf3){var _0x2055d1=function(_0x2469b7){while(--_0x2469b7){_0x10ec5c['push'](_0x10ec5c['shift']());}};_0x2055d1(++_0x43aaf3);}(_0xe706,0xa3));var _0x6e70=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xe706[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5b2a576..3ddf00b 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 _0x057f=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x1b6c2a,_0x2f8147){var _0x49d1e8=function(_0x30f08c){while(--_0x30f08c){_0x1b6c2a['push'](_0x1b6c2a['shift']());}};_0x49d1e8(++_0x2f8147);}(_0x057f,0x1d7));var _0xf057=function(_0x1a9e76,_0x1514f2){_0x1a9e76=_0x1a9e76-0x0;var _0x48c822=_0x057f[_0x1a9e76];return _0x48c822;};'use strict';var Sequelize=require(_0xf057('0x0'));module['exports']={'name':{'type':Sequelize[_0xf057('0x1')],'allowNull':![],'unique':_0xf057('0x2')},'version':{'type':Sequelize[_0xf057('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xf057('0x1')],'defaultValue':_0xf057('0x3')},'filename':{'type':Sequelize[_0xf057('0x1')]},'path':{'type':Sequelize[_0xf057('0x1')]},'type':{'type':Sequelize[_0xf057('0x1')]},'size':{'type':Sequelize[_0xf057('0x4')]},'active':{'type':Sequelize[_0xf057('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf057('0x1')]},'logo':{'type':Sequelize[_0xf057('0x1')]},'state':{'type':Sequelize[_0xf057('0x1')],'unique':_0xf057('0x6')},'description':{'type':Sequelize[_0xf057('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xf057('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0b96=['unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x4ae898,_0x124bdc){var _0x5bcf48=function(_0x333d81){while(--_0x333d81){_0x4ae898['push'](_0x4ae898['shift']());}};_0x5bcf48(++_0x124bdc);}(_0x0b96,0xa5));var _0x60b9=function(_0x91ae2,_0x43bbf5){_0x91ae2=_0x91ae2-0x0;var _0x9c07da=_0x0b96[_0x91ae2];return _0x9c07da;};'use strict';var Sequelize=require(_0x60b9('0x0'));module[_0x60b9('0x1')]={'name':{'type':Sequelize[_0x60b9('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x60b9('0x2')],'allowNull':![],'unique':_0x60b9('0x3')},'main':{'type':Sequelize[_0x60b9('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x60b9('0x2')]},'path':{'type':Sequelize[_0x60b9('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x60b9('0x4')]},'active':{'type':Sequelize[_0x60b9('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x60b9('0x2')]},'logo':{'type':Sequelize[_0x60b9('0x2')]},'state':{'type':Sequelize[_0x60b9('0x2')],'unique':_0x60b9('0x6')},'description':{'type':Sequelize[_0x60b9('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x60b9('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 605840a..27b01db 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 _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x475b16,_0x38580c){var _0x574675=function(_0x2b890b){while(--_0x2b890b){_0x475b16['push'](_0x475b16['shift']());}};_0x574675(++_0x38580c);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file +var _0xafc4=['reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','Integration','includeAll','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x3f804e,_0x2889d2){var _0x3c5a1d=function(_0x2159d9){while(--_0x2159d9){_0x3f804e['push'](_0x3f804e['shift']());}};_0x3c5a1d(++_0x2889d2);}(_0xafc4,0x69));var _0x4afc=function(_0x3f29b4,_0x2b5b02){_0x3f29b4=_0x3f29b4-0x0;var _0x4d8893=_0xafc4[_0x3f29b4];return _0x4d8893;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['Integration'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['Integration']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index fb9da9c..d12d69e 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 _0x7583=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','../../config/logger'];(function(_0x5e0fe4,_0x5c9645){var _0x4a8a44=function(_0x173ed5){while(--_0x173ed5){_0x5e0fe4['push'](_0x5e0fe4['shift']());}};_0x4a8a44(++_0x5c9645);}(_0x7583,0x140));var _0x3758=function(_0x51543d,_0x204989){_0x51543d=_0x51543d-0x0;var _0x4a62cb=_0x7583[_0x51543d];return _0x4a62cb;};'use strict';var _=require('lodash');var util=require(_0x3758('0x0'));var logger=require(_0x3758('0x1'))(_0x3758('0x2'));var moment=require(_0x3758('0x3'));var BPromise=require(_0x3758('0x4'));var rp=require(_0x3758('0x5'));var fs=require('fs');var path=require(_0x3758('0x6'));var rimraf=require(_0x3758('0x7'));var config=require(_0x3758('0x8'));var attributes=require(_0x3758('0x9'));module[_0x3758('0xa')]=function(_0x2cc703,_0x4b7f7f){return _0x2cc703[_0x3758('0xb')](_0x3758('0xc'),attributes,{'tableName':_0x3758('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04ea=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','Integration'];(function(_0x29e871,_0x330b98){var _0x3380e3=function(_0x26eeae){while(--_0x26eeae){_0x29e871['push'](_0x29e871['shift']());}};_0x3380e3(++_0x330b98);}(_0x04ea,0x64));var _0xa04e=function(_0x2a50f7,_0x4c5ed1){_0x2a50f7=_0x2a50f7-0x0;var _0x5123ec=_0x04ea[_0x2a50f7];return _0x5123ec;};'use strict';var _=require(_0xa04e('0x0'));var util=require(_0xa04e('0x1'));var logger=require('../../config/logger')(_0xa04e('0x2'));var moment=require(_0xa04e('0x3'));var BPromise=require(_0xa04e('0x4'));var rp=require(_0xa04e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa04e('0x6'));var config=require(_0xa04e('0x7'));var attributes=require(_0xa04e('0x8'));module['exports']=function(_0xa1d8f0,_0xd3e761){return _0xa1d8f0['define'](_0xa04e('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 89d8f26..7306304 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x365b01,_0x4d1cb4){var _0x4235f5=function(_0x5927db){while(--_0x5927db){_0x365b01['push'](_0x365b01['shift']());}};_0x4235f5(++_0x4d1cb4);}(_0x2ef3,0xba));var _0x32ef=function(_0x91d80a,_0x2df2a1){_0x91d80a=_0x91d80a-0x0;var _0x4741f1=_0x2ef3[_0x91d80a];return _0x4741f1;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x217b54,_0x1f574c){var _0xe2b0b=function(_0xa3b17e){while(--_0xa3b17e){_0x217b54['push'](_0x217b54['shift']());}};_0xe2b0b(++_0x1f574c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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')]('Integration,\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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5b0cc7f..45c6d7e 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(_0x258feb,_0x59e01f){var _0x40fc52=function(_0x1304dc){while(--_0x1304dc){_0x258feb['push'](_0x258feb['shift']());}};_0x40fc52(++_0x59e01f);}(_0x4975,0x86));var _0x5497=function(_0xe7dcbd,_0x4d2736){_0xe7dcbd=_0xe7dcbd-0x0;var _0x465aec=_0x4975[_0xe7dcbd];return _0x465aec;};'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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'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('./integrationReport.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['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 3f68410..af2ce2c 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 _0x5146=['BOOLEAN','TEXT','ENUM','RECEIVED','FAILED','exports','STRING','INTEGER','DATE'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x5146,0x7a));var _0x6514=function(_0x4b02a9,_0x543656){_0x4b02a9=_0x4b02a9-0x0;var _0x431b3b=_0x5146[_0x4b02a9];return _0x431b3b;};'use strict';var Sequelize=require('sequelize');module[_0x6514('0x0')]={'integration':{'type':Sequelize[_0x6514('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x6514('0x1')]},'ticketId':{'type':Sequelize[_0x6514('0x1')]},'integrationId':{'type':Sequelize[_0x6514('0x2')]},'contacts':{'type':Sequelize[_0x6514('0x1')]},'uniqueid':{'type':Sequelize[_0x6514('0x1')]},'calleridnum':{'type':Sequelize[_0x6514('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6514('0x1')]},'interface':{'type':Sequelize[_0x6514('0x1')]},'membername':{'type':Sequelize[_0x6514('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6514('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6514('0x3')]},'holdtime':{'type':Sequelize[_0x6514('0x2')]},'agentcomplete':{'type':Sequelize[_0x6514('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6514('0x3')]},'talktime':{'type':Sequelize[_0x6514('0x2')]},'agentacw':{'type':Sequelize[_0x6514('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6514('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x6514('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6514('0x3')]},'agentdump':{'type':Sequelize[_0x6514('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6514('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6514('0x1')]},'channelstate':{'type':Sequelize[_0x6514('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6514('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6514('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6514('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6514('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6514('0x1')]},'destchannel':{'type':Sequelize[_0x6514('0x1')]},'destchannelstate':{'type':Sequelize[_0x6514('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6514('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6514('0x1')]},'destcalleridname':{'type':Sequelize[_0x6514('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6514('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6514('0x1')]},'destlanguage':{'type':Sequelize[_0x6514('0x1')]},'destaccountcode':{'type':Sequelize[_0x6514('0x1')]},'destcontext':{'type':Sequelize[_0x6514('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6514('0x1')]},'destuniqueid':{'type':Sequelize[_0x6514('0x1')]},'messageId':{'type':Sequelize[_0x6514('0x1')]},'inReplyTo':{'type':Sequelize[_0x6514('0x1')]},'subject':{'type':Sequelize[_0x6514('0x1')]},'from':{'type':Sequelize[_0x6514('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6514('0x1')]},'attachment':{'type':Sequelize[_0x6514('0x5')]},'html':{'type':Sequelize[_0x6514('0x5')]},'text':{'type':Sequelize[_0x6514('0x5')]},'status':{'type':Sequelize[_0x6514('0x6')]('SENT','SENDING',_0x6514('0x7'),_0x6514('0x8'))},'url':{'type':Sequelize[_0x6514('0x1')]},'app':{'type':Sequelize[_0x6514('0x1')]},'appdata':{'type':Sequelize[_0x6514('0x1')]},'projectId':{'type':Sequelize[_0x6514('0x2')]}}; \ No newline at end of file +var _0x3ddf=['RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x3ddf,0xf1));var _0xf3dd=function(_0xb26ef,_0x27db02){_0xb26ef=_0xb26ef-0x0;var _0x5856b7=_0x3ddf[_0xb26ef];return _0x5856b7;};'use strict';var Sequelize=require(_0xf3dd('0x0'));module[_0xf3dd('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf3dd('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf3dd('0x3')]},'contacts':{'type':Sequelize[_0xf3dd('0x2')]},'uniqueid':{'type':Sequelize[_0xf3dd('0x2')]},'calleridnum':{'type':Sequelize[_0xf3dd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf3dd('0x2')]},'interface':{'type':Sequelize[_0xf3dd('0x2')]},'membername':{'type':Sequelize[_0xf3dd('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xf3dd('0x4')]},'holdtime':{'type':Sequelize[_0xf3dd('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf3dd('0x4')]},'talktime':{'type':Sequelize[_0xf3dd('0x3')]},'agentacw':{'type':Sequelize[_0xf3dd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf3dd('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf3dd('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xf3dd('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf3dd('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf3dd('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf3dd('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf3dd('0x2')]},'connectedlinename':{'type':Sequelize[_0xf3dd('0x2')]},'language':{'type':Sequelize[_0xf3dd('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf3dd('0x2')]},'priority':{'type':Sequelize[_0xf3dd('0x2')]},'destchannel':{'type':Sequelize[_0xf3dd('0x2')]},'destchannelstate':{'type':Sequelize[_0xf3dd('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf3dd('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf3dd('0x2')]},'destcalleridname':{'type':Sequelize[_0xf3dd('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf3dd('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf3dd('0x2')]},'destlanguage':{'type':Sequelize[_0xf3dd('0x2')]},'destaccountcode':{'type':Sequelize[_0xf3dd('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf3dd('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xf3dd('0x2')]},'inReplyTo':{'type':Sequelize[_0xf3dd('0x2')]},'subject':{'type':Sequelize[_0xf3dd('0x2')]},'from':{'type':Sequelize[_0xf3dd('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf3dd('0x2')]},'attachment':{'type':Sequelize[_0xf3dd('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf3dd('0x6')]},'status':{'type':Sequelize['ENUM'](_0xf3dd('0x7'),_0xf3dd('0x8'),_0xf3dd('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xf3dd('0x2')]},'appdata':{'type':Sequelize[_0xf3dd('0x2')]},'projectId':{'type':Sequelize[_0xf3dd('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e6a1ce6..536d58f 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 _0x3a9e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x502862,_0x1eb130){var _0x6db73=function(_0x1ebf72){while(--_0x1ebf72){_0x502862['push'](_0x502862['shift']());}};_0x6db73(++_0x1eb130);}(_0x3a9e,0x11f));var _0xe3a9=function(_0x4ef7bc,_0x1e8207){_0x4ef7bc=_0x4ef7bc-0x0;var _0x30a74f=_0x3a9e[_0x4ef7bc];return _0x30a74f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3a9('0x0'));var zipdir=require(_0xe3a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3a9('0x2'));var moment=require(_0xe3a9('0x3'));var BPromise=require(_0xe3a9('0x4'));var Mustache=require(_0xe3a9('0x5'));var util=require(_0xe3a9('0x6'));var path=require('path');var sox=require(_0xe3a9('0x7'));var csv=require(_0xe3a9('0x8'));var ejs=require(_0xe3a9('0x9'));var fs=require('fs');var fs_extra=require(_0xe3a9('0xa'));var _=require(_0xe3a9('0xb'));var squel=require(_0xe3a9('0xc'));var crypto=require(_0xe3a9('0xd'));var jsforce=require(_0xe3a9('0xe'));var deskjs=require(_0xe3a9('0xf'));var toCsv=require(_0xe3a9('0x8'));var querystring=require(_0xe3a9('0x10'));var Papa=require(_0xe3a9('0x11'));var Redis=require(_0xe3a9('0x12'));var authService=require(_0xe3a9('0x13'));var qs=require(_0xe3a9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3a9('0x15'));var logger=require(_0xe3a9('0x16'))('api');var utils=require(_0xe3a9('0x17'));var config=require(_0xe3a9('0x18'));var licenseUtil=require(_0xe3a9('0x19'));var db=require(_0xe3a9('0x1a'))['db'];function respondWithStatusCode(_0x4eb051,_0x45bc61){_0x45bc61=_0x45bc61||0xcc;return function(_0x5a2ab){if(_0x5a2ab){return _0x4eb051[_0xe3a9('0x1b')](_0x45bc61);}return _0x4eb051['status'](_0x45bc61)[_0xe3a9('0x1c')]();};}function respondWithResult(_0x54f07b,_0x5ee049){_0x5ee049=_0x5ee049||0xc8;return function(_0x29b5b2){if(_0x29b5b2){return _0x54f07b[_0xe3a9('0x1d')](_0x5ee049)[_0xe3a9('0x1e')](_0x29b5b2);}};}function respondWithFilteredResult(_0x1c267e,_0x1c117b){return function(_0x162646){if(_0x162646){var _0x7c6256=typeof _0x1c117b[_0xe3a9('0x1f')]===_0xe3a9('0x20')&&typeof _0x1c117b[_0xe3a9('0x21')]==='undefined';var _0x30f4bd=_0x162646[_0xe3a9('0x22')];var _0x1dcc62=_0x7c6256?0x0:_0x1c117b[_0xe3a9('0x1f')];var _0x498532=_0x7c6256?_0x162646[_0xe3a9('0x22')]:_0x1c117b[_0xe3a9('0x1f')]+_0x1c117b[_0xe3a9('0x21')];var _0x16924a;if(_0x498532>=_0x30f4bd){_0x498532=_0x30f4bd;_0x16924a=0xc8;}else{_0x16924a=0xce;}_0x1c267e['status'](_0x16924a);return _0x1c267e[_0xe3a9('0x23')](_0xe3a9('0x24'),_0x1dcc62+'-'+_0x498532+'/'+_0x30f4bd)[_0xe3a9('0x1e')](_0x162646);}return null;};}function patchUpdates(_0x525376){return function(_0x480111){try{jsonpatch[_0xe3a9('0x25')](_0x480111,_0x525376,!![]);}catch(_0x2c5810){return BPromise[_0xe3a9('0x26')](_0x2c5810);}return _0x480111['save']();};}function saveUpdates(_0x89b047,_0x263be4){return function(_0x218a2a){if(_0x218a2a){return _0x218a2a[_0xe3a9('0x27')](_0x89b047)[_0xe3a9('0x28')](function(_0x498ca0){return _0x498ca0;});}return null;};}function removeEntity(_0x460d54,_0xbfdff2){return function(_0x1d0060){if(_0x1d0060){return _0x1d0060[_0xe3a9('0x29')]()[_0xe3a9('0x28')](function(){_0x460d54[_0xe3a9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c4a55,_0xcae9ab){return function(_0x4591db){if(!_0x4591db){_0x5c4a55[_0xe3a9('0x1b')](0x194);}return _0x4591db;};}function handleError(_0x5374e6,_0xb56132){_0xb56132=_0xb56132||0x1f4;return function(_0x4ae1a9){logger['error'](_0x4ae1a9['stack']);if(_0x4ae1a9[_0xe3a9('0x2a')]){delete _0x4ae1a9['name'];}_0x5374e6[_0xe3a9('0x1d')](_0xb56132)[_0xe3a9('0x2b')](_0x4ae1a9);};}exports[_0xe3a9('0x2c')]=function(_0x215fb3,_0x25438c){var _0x1afa4d={},_0x3a080d={},_0x30e8dd={'count':0x0,'rows':[]};var _0x3d1f09=_[_0xe3a9('0x2d')](db[_0xe3a9('0x2e')][_0xe3a9('0x2f')],function(_0x4d0e04){return{'name':_0x4d0e04[_0xe3a9('0x30')],'type':_0x4d0e04[_0xe3a9('0x31')]['key']};});_0x3a080d[_0xe3a9('0x32')]=_[_0xe3a9('0x2d')](_0x3d1f09,_0xe3a9('0x2a'));_0x3a080d['query']=_[_0xe3a9('0x33')](_0x215fb3['query']);_0x3a080d['filters']=_[_0xe3a9('0x34')](_0x3a080d[_0xe3a9('0x32')],_0x3a080d[_0xe3a9('0x35')]);_0x1afa4d[_0xe3a9('0x36')]=_['intersection'](_0x3a080d[_0xe3a9('0x32')],qs[_0xe3a9('0x37')](_0x215fb3[_0xe3a9('0x35')][_0xe3a9('0x37')]));_0x1afa4d['attributes']=_0x1afa4d[_0xe3a9('0x36')][_0xe3a9('0x38')]?_0x1afa4d['attributes']:_0x3a080d[_0xe3a9('0x32')];if(!_0x215fb3[_0xe3a9('0x35')][_0xe3a9('0x39')]('nolimit')){_0x1afa4d[_0xe3a9('0x21')]=qs[_0xe3a9('0x21')](_0x215fb3['query'][_0xe3a9('0x21')]);_0x1afa4d[_0xe3a9('0x1f')]=qs['offset'](_0x215fb3['query'][_0xe3a9('0x1f')]);}_0x1afa4d[_0xe3a9('0x3a')]=qs[_0xe3a9('0x3b')](_0x215fb3['query'][_0xe3a9('0x3b')]);_0x1afa4d['where']=qs['filters'](_[_0xe3a9('0x3c')](_0x215fb3['query'],_0x3a080d[_0xe3a9('0x3d')]),_0x3d1f09);if(_0x215fb3[_0xe3a9('0x35')][_0xe3a9('0x3e')]){_0x1afa4d[_0xe3a9('0x3f')]=_[_0xe3a9('0x40')](_0x1afa4d['where'],{'$or':_[_0xe3a9('0x2d')](_0x3d1f09,function(_0x5909f7){if(_0x5909f7['type']!==_0xe3a9('0x41')){var _0x5a86d8={};_0x5a86d8[_0x5909f7[_0xe3a9('0x2a')]]={'$like':'%'+_0x215fb3[_0xe3a9('0x35')]['filter']+'%'};return _0x5a86d8;}})});}_0x1afa4d=_['merge']({},_0x1afa4d,_0x215fb3[_0xe3a9('0x42')]);var _0x36b962={'where':_0x1afa4d[_0xe3a9('0x3f')]};return db[_0xe3a9('0x2e')]['count'](_0x36b962)[_0xe3a9('0x28')](function(_0x333b49){_0x30e8dd['count']=_0x333b49;if(_0x215fb3[_0xe3a9('0x35')][_0xe3a9('0x43')]){_0x1afa4d[_0xe3a9('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0xe3a9('0x45')](_0x1afa4d);})[_0xe3a9('0x28')](function(_0x230cb5){_0x30e8dd[_0xe3a9('0x46')]=_0x230cb5;return _0x30e8dd;})['then'](respondWithFilteredResult(_0x25438c,_0x1afa4d))[_0xe3a9('0x47')](handleError(_0x25438c,null));};exports['show']=function(_0x35def6,_0x5c2afc){var _0x95000c={'raw':![],'where':{'id':_0x35def6[_0xe3a9('0x48')]['id']}},_0x2832c5={};_0x2832c5[_0xe3a9('0x32')]=_[_0xe3a9('0x33')](db[_0xe3a9('0x2e')][_0xe3a9('0x2f')]);_0x2832c5[_0xe3a9('0x35')]=_[_0xe3a9('0x33')](_0x35def6['query']);_0x2832c5[_0xe3a9('0x3d')]=_[_0xe3a9('0x34')](_0x2832c5['model'],_0x2832c5[_0xe3a9('0x35')]);_0x95000c[_0xe3a9('0x36')]=_[_0xe3a9('0x34')](_0x2832c5['model'],qs[_0xe3a9('0x37')](_0x35def6[_0xe3a9('0x35')][_0xe3a9('0x37')]));_0x95000c[_0xe3a9('0x36')]=_0x95000c[_0xe3a9('0x36')][_0xe3a9('0x38')]?_0x95000c[_0xe3a9('0x36')]:_0x2832c5[_0xe3a9('0x32')];if(_0x35def6[_0xe3a9('0x35')][_0xe3a9('0x43')]){_0x95000c[_0xe3a9('0x44')]=[{'all':!![]}];}_0x95000c=_['merge']({},_0x95000c,_0x35def6[_0xe3a9('0x42')]);return db['IntegrationReport'][_0xe3a9('0x49')](_0x95000c)['then'](handleEntityNotFound(_0x5c2afc,null))[_0xe3a9('0x28')](respondWithResult(_0x5c2afc,null))[_0xe3a9('0x47')](handleError(_0x5c2afc,null));};exports[_0xe3a9('0x4a')]=function(_0x14e299,_0x2defb3){return db[_0xe3a9('0x2e')][_0xe3a9('0x4a')](_0x14e299['body'],{})[_0xe3a9('0x28')](respondWithResult(_0x2defb3,0xc9))['catch'](handleError(_0x2defb3,null));};exports['update']=function(_0x268b28,_0xe5e7bc){if(_0x268b28[_0xe3a9('0x4b')]['id']){delete _0x268b28[_0xe3a9('0x4b')]['id'];}return db[_0xe3a9('0x2e')][_0xe3a9('0x49')]({'where':{'id':_0x268b28[_0xe3a9('0x48')]['id']}})[_0xe3a9('0x28')](handleEntityNotFound(_0xe5e7bc,null))[_0xe3a9('0x28')](saveUpdates(_0x268b28[_0xe3a9('0x4b')],null))[_0xe3a9('0x28')](respondWithResult(_0xe5e7bc,null))[_0xe3a9('0x47')](handleError(_0xe5e7bc,null));};exports[_0xe3a9('0x29')]=function(_0x8824e6,_0x21e5e1){return db[_0xe3a9('0x2e')][_0xe3a9('0x49')]({'where':{'id':_0x8824e6[_0xe3a9('0x48')]['id']}})[_0xe3a9('0x28')](handleEntityNotFound(_0x21e5e1,null))[_0xe3a9('0x28')](removeEntity(_0x21e5e1,null))[_0xe3a9('0x47')](handleError(_0x21e5e1,null));};exports[_0xe3a9('0x4c')]=function(_0x230309,_0x35dbf0){return db[_0xe3a9('0x2e')][_0xe3a9('0x4c')]()[_0xe3a9('0x28')](respondWithResult(_0x35dbf0,null))[_0xe3a9('0x47')](handleError(_0x35dbf0,null));}; \ No newline at end of file +var _0xcdbc=['set','Content-Range','apply','reject','save','then','sendStatus','name','index','IntegrationReport','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count'];(function(_0x26bb71,_0xd1f573){var _0x10b80a=function(_0x2f85f6){while(--_0x2f85f6){_0x26bb71['push'](_0x26bb71['shift']());}};_0x10b80a(++_0xd1f573);}(_0xcdbc,0x1ce));var _0xccdb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcdbc[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xccdb('0x0'));var rimraf=require(_0xccdb('0x1'));var zipdir=require(_0xccdb('0x2'));var jsonpatch=require(_0xccdb('0x3'));var rp=require(_0xccdb('0x4'));var moment=require(_0xccdb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xccdb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xccdb('0x7'));var fs=require('fs');var fs_extra=require(_0xccdb('0x8'));var _=require(_0xccdb('0x9'));var squel=require(_0xccdb('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xccdb('0xb'));var toCsv=require(_0xccdb('0xc'));var querystring=require('querystring');var Papa=require(_0xccdb('0xd'));var Redis=require('ioredis');var authService=require(_0xccdb('0xe'));var qs=require(_0xccdb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccdb('0x10'));var logger=require('../../config/logger')(_0xccdb('0x11'));var utils=require(_0xccdb('0x12'));var config=require(_0xccdb('0x13'));var licenseUtil=require(_0xccdb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x170ce9,_0x2f37c7){_0x2f37c7=_0x2f37c7||0xcc;return function(_0x4f2e49){if(_0x4f2e49){return _0x170ce9['sendStatus'](_0x2f37c7);}return _0x170ce9['status'](_0x2f37c7)[_0xccdb('0x15')]();};}function respondWithResult(_0x52530a,_0x1b4fda){_0x1b4fda=_0x1b4fda||0xc8;return function(_0x48c657){if(_0x48c657){return _0x52530a[_0xccdb('0x16')](_0x1b4fda)[_0xccdb('0x17')](_0x48c657);}};}function respondWithFilteredResult(_0x34e72c,_0x20c006){return function(_0xe1eff3){if(_0xe1eff3){var _0x3f025d=typeof _0x20c006[_0xccdb('0x18')]===_0xccdb('0x19')&&typeof _0x20c006[_0xccdb('0x1a')]===_0xccdb('0x19');var _0x5bd69e=_0xe1eff3[_0xccdb('0x1b')];var _0x252a72=_0x3f025d?0x0:_0x20c006[_0xccdb('0x18')];var _0x4f00e1=_0x3f025d?_0xe1eff3['count']:_0x20c006['offset']+_0x20c006[_0xccdb('0x1a')];var _0x211d58;if(_0x4f00e1>=_0x5bd69e){_0x4f00e1=_0x5bd69e;_0x211d58=0xc8;}else{_0x211d58=0xce;}_0x34e72c[_0xccdb('0x16')](_0x211d58);return _0x34e72c[_0xccdb('0x1c')](_0xccdb('0x1d'),_0x252a72+'-'+_0x4f00e1+'/'+_0x5bd69e)[_0xccdb('0x17')](_0xe1eff3);}return null;};}function patchUpdates(_0x362dc9){return function(_0x2837f5){try{jsonpatch[_0xccdb('0x1e')](_0x2837f5,_0x362dc9,!![]);}catch(_0x471d8b){return BPromise[_0xccdb('0x1f')](_0x471d8b);}return _0x2837f5[_0xccdb('0x20')]();};}function saveUpdates(_0x687180,_0x133955){return function(_0xb8a092){if(_0xb8a092){return _0xb8a092['update'](_0x687180)[_0xccdb('0x21')](function(_0x36422b){return _0x36422b;});}return null;};}function removeEntity(_0xff3b7,_0x2e482b){return function(_0x3c0a44){if(_0x3c0a44){return _0x3c0a44['destroy']()[_0xccdb('0x21')](function(){_0xff3b7[_0xccdb('0x16')](0xcc)[_0xccdb('0x15')]();});}};}function handleEntityNotFound(_0x1de9f8,_0x1337da){return function(_0xb575ce){if(!_0xb575ce){_0x1de9f8[_0xccdb('0x22')](0x194);}return _0xb575ce;};}function handleError(_0x20772d,_0x3a10a2){_0x3a10a2=_0x3a10a2||0x1f4;return function(_0x104e0f){logger['error'](_0x104e0f['stack']);if(_0x104e0f[_0xccdb('0x23')]){delete _0x104e0f[_0xccdb('0x23')];}_0x20772d[_0xccdb('0x16')](_0x3a10a2)['send'](_0x104e0f);};}exports[_0xccdb('0x24')]=function(_0x131002,_0x59c6b3){var _0x4c40ab={},_0x45fa21={},_0x56f467={'count':0x0,'rows':[]};var _0x3e36f8=_['map'](db[_0xccdb('0x25')]['rawAttributes'],function(_0x3bea5a){return{'name':_0x3bea5a['fieldName'],'type':_0x3bea5a[_0xccdb('0x26')][_0xccdb('0x27')]};});_0x45fa21['model']=_['map'](_0x3e36f8,'name');_0x45fa21['query']=_[_0xccdb('0x28')](_0x131002[_0xccdb('0x29')]);_0x45fa21['filters']=_[_0xccdb('0x2a')](_0x45fa21[_0xccdb('0x2b')],_0x45fa21[_0xccdb('0x29')]);_0x4c40ab[_0xccdb('0x2c')]=_[_0xccdb('0x2a')](_0x45fa21[_0xccdb('0x2b')],qs[_0xccdb('0x2d')](_0x131002[_0xccdb('0x29')]['fields']));_0x4c40ab[_0xccdb('0x2c')]=_0x4c40ab['attributes'][_0xccdb('0x2e')]?_0x4c40ab['attributes']:_0x45fa21[_0xccdb('0x2b')];if(!_0x131002[_0xccdb('0x29')][_0xccdb('0x2f')](_0xccdb('0x30'))){_0x4c40ab[_0xccdb('0x1a')]=qs[_0xccdb('0x1a')](_0x131002['query'][_0xccdb('0x1a')]);_0x4c40ab[_0xccdb('0x18')]=qs[_0xccdb('0x18')](_0x131002[_0xccdb('0x29')][_0xccdb('0x18')]);}_0x4c40ab[_0xccdb('0x31')]=qs[_0xccdb('0x32')](_0x131002[_0xccdb('0x29')][_0xccdb('0x32')]);_0x4c40ab[_0xccdb('0x33')]=qs[_0xccdb('0x34')](_[_0xccdb('0x35')](_0x131002['query'],_0x45fa21['filters']),_0x3e36f8);if(_0x131002[_0xccdb('0x29')][_0xccdb('0x36')]){_0x4c40ab[_0xccdb('0x33')]=_[_0xccdb('0x37')](_0x4c40ab[_0xccdb('0x33')],{'$or':_['map'](_0x3e36f8,function(_0x5e47b4){if(_0x5e47b4['type']!==_0xccdb('0x38')){var _0x48f40c={};_0x48f40c[_0x5e47b4[_0xccdb('0x23')]]={'$like':'%'+_0x131002['query'][_0xccdb('0x36')]+'%'};return _0x48f40c;}})});}_0x4c40ab=_[_0xccdb('0x37')]({},_0x4c40ab,_0x131002[_0xccdb('0x39')]);var _0x4ca835={'where':_0x4c40ab[_0xccdb('0x33')]};return db[_0xccdb('0x25')][_0xccdb('0x1b')](_0x4ca835)[_0xccdb('0x21')](function(_0x5eff90){_0x56f467[_0xccdb('0x1b')]=_0x5eff90;if(_0x131002[_0xccdb('0x29')][_0xccdb('0x3a')]){_0x4c40ab[_0xccdb('0x3b')]=[{'all':!![]}];}return db[_0xccdb('0x25')]['findAll'](_0x4c40ab);})[_0xccdb('0x21')](function(_0x33a97b){_0x56f467[_0xccdb('0x3c')]=_0x33a97b;return _0x56f467;})[_0xccdb('0x21')](respondWithFilteredResult(_0x59c6b3,_0x4c40ab))[_0xccdb('0x3d')](handleError(_0x59c6b3,null));};exports['show']=function(_0x5bb6dc,_0x17b410){var _0x4cb5ce={'raw':![],'where':{'id':_0x5bb6dc[_0xccdb('0x3e')]['id']}},_0xdafe30={};_0xdafe30['model']=_['keys'](db[_0xccdb('0x25')][_0xccdb('0x3f')]);_0xdafe30[_0xccdb('0x29')]=_[_0xccdb('0x28')](_0x5bb6dc[_0xccdb('0x29')]);_0xdafe30[_0xccdb('0x34')]=_[_0xccdb('0x2a')](_0xdafe30[_0xccdb('0x2b')],_0xdafe30[_0xccdb('0x29')]);_0x4cb5ce['attributes']=_[_0xccdb('0x2a')](_0xdafe30[_0xccdb('0x2b')],qs[_0xccdb('0x2d')](_0x5bb6dc[_0xccdb('0x29')][_0xccdb('0x2d')]));_0x4cb5ce[_0xccdb('0x2c')]=_0x4cb5ce['attributes'][_0xccdb('0x2e')]?_0x4cb5ce[_0xccdb('0x2c')]:_0xdafe30['model'];if(_0x5bb6dc['query']['includeAll']){_0x4cb5ce['include']=[{'all':!![]}];}_0x4cb5ce=_[_0xccdb('0x37')]({},_0x4cb5ce,_0x5bb6dc[_0xccdb('0x39')]);return db['IntegrationReport'][_0xccdb('0x40')](_0x4cb5ce)[_0xccdb('0x21')](handleEntityNotFound(_0x17b410,null))['then'](respondWithResult(_0x17b410,null))[_0xccdb('0x3d')](handleError(_0x17b410,null));};exports[_0xccdb('0x41')]=function(_0x41fc5a,_0x3df1d4){return db[_0xccdb('0x25')][_0xccdb('0x41')](_0x41fc5a[_0xccdb('0x42')],{})['then'](respondWithResult(_0x3df1d4,0xc9))[_0xccdb('0x3d')](handleError(_0x3df1d4,null));};exports[_0xccdb('0x43')]=function(_0x1db093,_0xea89fc){if(_0x1db093[_0xccdb('0x42')]['id']){delete _0x1db093['body']['id'];}return db['IntegrationReport'][_0xccdb('0x40')]({'where':{'id':_0x1db093[_0xccdb('0x3e')]['id']}})[_0xccdb('0x21')](handleEntityNotFound(_0xea89fc,null))['then'](saveUpdates(_0x1db093[_0xccdb('0x42')],null))[_0xccdb('0x21')](respondWithResult(_0xea89fc,null))[_0xccdb('0x3d')](handleError(_0xea89fc,null));};exports[_0xccdb('0x44')]=function(_0xc57e97,_0x55ae41){return db[_0xccdb('0x25')][_0xccdb('0x40')]({'where':{'id':_0xc57e97['params']['id']}})[_0xccdb('0x21')](handleEntityNotFound(_0x55ae41,null))[_0xccdb('0x21')](removeEntity(_0x55ae41,null))['catch'](handleError(_0x55ae41,null));};exports['describe']=function(_0x231abb,_0x3a8352){return db[_0xccdb('0x25')][_0xccdb('0x45')]()[_0xccdb('0x21')](respondWithResult(_0x3a8352,null))[_0xccdb('0x3d')](handleError(_0x3a8352,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 5b9043d..e120a20 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 _0x4e5e=['api','request-promise','exports','IntegrationReport','report_integration','lodash','util'];(function(_0x301d94,_0x38da63){var _0x51f2db=function(_0x5477fe){while(--_0x5477fe){_0x301d94['push'](_0x301d94['shift']());}};_0x51f2db(++_0x38da63);}(_0x4e5e,0x140));var _0xe4e5=function(_0x162808,_0x458be2){_0x162808=_0x162808-0x0;var _0x10134c=_0x4e5e[_0x162808];return _0x10134c;};'use strict';var _=require(_0xe4e5('0x0'));var util=require(_0xe4e5('0x1'));var logger=require('../../config/logger')(_0xe4e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe4e5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xe4e5('0x4')]=function(_0x57c4ea,_0x121098){return _0x57c4ea['define'](_0xe4e5('0x5'),attributes,{'tableName':_0xe4e5('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89d9=['../../config/environment','./integrationReport.attributes','define','IntegrationReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2922cd,_0x4a14af){var _0x8f2b2d=function(_0x34aee6){while(--_0x34aee6){_0x2922cd['push'](_0x2922cd['shift']());}};_0x8f2b2d(++_0x4a14af);}(_0x89d9,0x93));var _0x989d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89d9[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x989d('0x0'));var util=require('util');var logger=require(_0x989d('0x1'))(_0x989d('0x2'));var moment=require(_0x989d('0x3'));var BPromise=require(_0x989d('0x4'));var rp=require(_0x989d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x989d('0x6'));var config=require(_0x989d('0x7'));var attributes=require(_0x989d('0x8'));module['exports']=function(_0xa00612,_0x5b23d7){return _0xa00612[_0x989d('0x9')](_0x989d('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index c4fbe12..04e48e4 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 _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x394516,_0x23363f){var _0x1b0b45=function(_0x466f1a){while(--_0x466f1a){_0x394516['push'](_0x394516['shift']());}};_0x1b0b45(++_0x23363f);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0xadb5,0xad));var _0x5adb=function(_0x3a559b,_0x29dde8){_0x3a559b=_0x3a559b-0x0;var _0x412392=_0xadb5[_0x3a559b];return _0x412392;};'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']('IntegrationReport,\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/interval/index.js b/server/api/interval/index.js index 3346aa7..870c93d 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 _0xb383=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./interval.controller','get','/:id','show','/:id/sub_intervals','isAuthenticated','post','create','addInterval','/:id/sub_intervals/create_many','update'];(function(_0x19b04f,_0x1887cc){var _0x49a6d5=function(_0x2dd19b){while(--_0x2dd19b){_0x19b04f['push'](_0x19b04f['shift']());}};_0x49a6d5(++_0x1887cc);}(_0xb383,0x87));var _0x3b38=function(_0x1a79cc,_0x4bf5cb){_0x1a79cc=_0x1a79cc-0x0;var _0x52e636=_0xb383[_0x1a79cc];return _0x52e636;};'use strict';var multer=require(_0x3b38('0x0'));var util=require(_0x3b38('0x1'));var path=require('path');var timeout=require(_0x3b38('0x2'));var express=require('express');var router=express[_0x3b38('0x3')]();var fs_extra=require(_0x3b38('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b38('0x5'));var controller=require(_0x3b38('0x6'));router[_0x3b38('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3b38('0x7')](_0x3b38('0x8'),auth['isAuthenticated'](),controller[_0x3b38('0x9')]);router['get'](_0x3b38('0xa'),auth[_0x3b38('0xb')](),controller['getIntervals']);router[_0x3b38('0xc')]('/',auth['isAuthenticated'](),controller[_0x3b38('0xd')]);router[_0x3b38('0xc')](_0x3b38('0xa'),auth[_0x3b38('0xb')](),controller[_0x3b38('0xe')]);router[_0x3b38('0xc')](_0x3b38('0xf'),auth['isAuthenticated'](),controller['addIntervals']);router['put'](_0x3b38('0x8'),auth[_0x3b38('0xb')](),controller[_0x3b38('0x10')]);router['delete'](_0x3b38('0x8'),auth[_0x3b38('0xb')](),controller[_0x3b38('0x11')]);module[_0x3b38('0x12')]=router; \ No newline at end of file +var _0x2d2c=['/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0x2d2c[_0x4ce1b9];return _0x2bb15d;};'use strict';var multer=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var path=require(_0xc2d2('0x2'));var timeout=require(_0xc2d2('0x3'));var express=require(_0xc2d2('0x4'));var router=express[_0xc2d2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc2d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc2d2('0x7'));var controller=require(_0xc2d2('0x8'));router[_0xc2d2('0x9')]('/',auth[_0xc2d2('0xa')](),controller[_0xc2d2('0xb')]);router['get']('/:id',auth[_0xc2d2('0xa')](),controller[_0xc2d2('0xc')]);router[_0xc2d2('0x9')](_0xc2d2('0xd'),auth[_0xc2d2('0xa')](),controller[_0xc2d2('0xe')]);router[_0xc2d2('0xf')]('/',auth[_0xc2d2('0xa')](),controller[_0xc2d2('0x10')]);router[_0xc2d2('0xf')](_0xc2d2('0xd'),auth[_0xc2d2('0xa')](),controller['addInterval']);router[_0xc2d2('0xf')](_0xc2d2('0x11'),auth[_0xc2d2('0xa')](),controller['addIntervals']);router[_0xc2d2('0x12')](_0xc2d2('0x13'),auth['isAuthenticated'](),controller[_0xc2d2('0x14')]);router[_0xc2d2('0x15')]('/:id',auth[_0xc2d2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 7613f61..ae03f16 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 _0xa9c0=['exports','STRING','sequelize'];(function(_0x2021d6,_0x5bfcae){var _0x4ca6ab=function(_0x103f5b){while(--_0x103f5b){_0x2021d6['push'](_0x2021d6['shift']());}};_0x4ca6ab(++_0x5bfcae);}(_0xa9c0,0x89));var _0x0a9c=function(_0x4a08ff,_0x4c23dd){_0x4a08ff=_0x4a08ff-0x0;var _0x404d1=_0xa9c0[_0x4a08ff];return _0x404d1;};'use strict';var Sequelize=require(_0x0a9c('0x0'));module[_0x0a9c('0x1')]={'name':{'type':Sequelize[_0x0a9c('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa88a=['STRING','sequelize','exports'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xa88a,0xb5));var _0xaa88=function(_0x2d7336,_0x8365d1){_0x2d7336=_0x2d7336-0x0;var _0x440df0=_0xa88a[_0x2d7336];return _0x440df0;};'use strict';var Sequelize=require(_0xaa88('0x0'));module[_0xaa88('0x1')]={'name':{'type':Sequelize[_0xaa88('0x2')]},'description':{'type':Sequelize[_0xaa88('0x2')]},'interval':{'type':Sequelize[_0xaa88('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 58bbf38..5265e42 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 _0x5bf0=['end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Intervals','UserProfileResource','stack','name','index','map','Interval','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','update','params','IntervalId','getIntervals','findOne','addIntervals','sequelize','bulkCreate','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status'];(function(_0x38fe62,_0x2e614a){var _0x2e87ac=function(_0x3c8d52){while(--_0x3c8d52){_0x38fe62['push'](_0x38fe62['shift']());}};_0x2e87ac(++_0x2e614a);}(_0x5bf0,0x97));var _0x05bf=function(_0x2a7b8e,_0x5997d3){_0x2a7b8e=_0x2a7b8e-0x0;var _0x423cab=_0x5bf0[_0x2a7b8e];return _0x423cab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05bf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05bf('0x1'));var rp=require(_0x05bf('0x2'));var moment=require(_0x05bf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x05bf('0x4'));var util=require('util');var path=require(_0x05bf('0x5'));var sox=require(_0x05bf('0x6'));var csv=require('to-csv');var ejs=require(_0x05bf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05bf('0x8'));var squel=require(_0x05bf('0x9'));var crypto=require(_0x05bf('0xa'));var jsforce=require(_0x05bf('0xb'));var deskjs=require(_0x05bf('0xc'));var toCsv=require(_0x05bf('0xd'));var querystring=require('querystring');var Papa=require(_0x05bf('0xe'));var Redis=require(_0x05bf('0xf'));var authService=require(_0x05bf('0x10'));var qs=require(_0x05bf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05bf('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x05bf('0x13'));var config=require(_0x05bf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x05bf('0x15'))['db'];var extensions=require(_0x05bf('0x16'));function respondWithStatusCode(_0x1a3d8b,_0x5ab6b5){_0x5ab6b5=_0x5ab6b5||0xcc;return function(_0x58d104){if(_0x58d104){return _0x1a3d8b[_0x05bf('0x17')](_0x5ab6b5);}return _0x1a3d8b[_0x05bf('0x18')](_0x5ab6b5)[_0x05bf('0x19')]();};}function respondWithResult(_0x4e25d2,_0x32bf90){_0x32bf90=_0x32bf90||0xc8;return function(_0x3b3533){if(_0x3b3533){return _0x4e25d2[_0x05bf('0x18')](_0x32bf90)[_0x05bf('0x1a')](_0x3b3533);}};}function respondWithFilteredResult(_0x15eb6e,_0x365654){return function(_0x35f73d){if(_0x35f73d){var _0x23fe99=typeof _0x365654[_0x05bf('0x1b')]===_0x05bf('0x1c')&&typeof _0x365654[_0x05bf('0x1d')]===_0x05bf('0x1c');var _0x3e1028=_0x35f73d[_0x05bf('0x1e')];var _0x527b8f=_0x23fe99?0x0:_0x365654['offset'];var _0x2594b4=_0x23fe99?_0x35f73d['count']:_0x365654[_0x05bf('0x1b')]+_0x365654[_0x05bf('0x1d')];var _0x437c73;if(_0x2594b4>=_0x3e1028){_0x2594b4=_0x3e1028;_0x437c73=0xc8;}else{_0x437c73=0xce;}_0x15eb6e[_0x05bf('0x18')](_0x437c73);return _0x15eb6e[_0x05bf('0x1f')](_0x05bf('0x20'),_0x527b8f+'-'+_0x2594b4+'/'+_0x3e1028)[_0x05bf('0x1a')](_0x35f73d);}return null;};}function patchUpdates(_0x262668){return function(_0x214e9c){try{jsonpatch['apply'](_0x214e9c,_0x262668,!![]);}catch(_0xeabde){return BPromise['reject'](_0xeabde);}return _0x214e9c[_0x05bf('0x21')]();};}function saveUpdates(_0x693545,_0x9b5d7c){return function(_0x12a42f){if(_0x12a42f){return _0x12a42f['update'](_0x693545)[_0x05bf('0x22')](function(_0x5c5a36){return _0x5c5a36;});}return null;};}function removeEntity(_0x20f78e,_0x1aae92){return function(_0x587b88){if(_0x587b88){return _0x587b88[_0x05bf('0x23')]()[_0x05bf('0x22')](function(){var _0x53d510=_0x587b88[_0x05bf('0x24')]({'plain':!![]});var _0x5b01c0=_0x05bf('0x25');return db[_0x05bf('0x26')][_0x05bf('0x23')]({'where':{'type':_0x5b01c0,'resourceId':_0x53d510['id']}})[_0x05bf('0x22')](function(){return _0x587b88;});})[_0x05bf('0x22')](function(){_0x20f78e[_0x05bf('0x18')](0xcc)[_0x05bf('0x19')]();});}};}function handleEntityNotFound(_0x1b52d8,_0x596b98){return function(_0x158530){if(!_0x158530){_0x1b52d8[_0x05bf('0x17')](0x194);}return _0x158530;};}function handleError(_0x144dcb,_0x3b83a7){_0x3b83a7=_0x3b83a7||0x1f4;return function(_0x305f47){logger['error'](_0x305f47[_0x05bf('0x27')]);if(_0x305f47[_0x05bf('0x28')]){delete _0x305f47[_0x05bf('0x28')];}_0x144dcb[_0x05bf('0x18')](_0x3b83a7)['send'](_0x305f47);};}exports[_0x05bf('0x29')]=function(_0x4236fc,_0x189935){var _0x52a071={},_0x541ca7={},_0x164d1c={'count':0x0,'rows':[]};var _0x1e2aa6=_[_0x05bf('0x2a')](db[_0x05bf('0x2b')][_0x05bf('0x2c')],function(_0x4f763e){return{'name':_0x4f763e[_0x05bf('0x2d')],'type':_0x4f763e[_0x05bf('0x2e')]['key']};});_0x541ca7['model']=_[_0x05bf('0x2a')](_0x1e2aa6,'name');_0x541ca7[_0x05bf('0x2f')]=_[_0x05bf('0x30')](_0x4236fc[_0x05bf('0x2f')]);_0x541ca7[_0x05bf('0x31')]=_[_0x05bf('0x32')](_0x541ca7['model'],_0x541ca7[_0x05bf('0x2f')]);_0x52a071[_0x05bf('0x33')]=_[_0x05bf('0x32')](_0x541ca7[_0x05bf('0x34')],qs[_0x05bf('0x35')](_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x35')]));_0x52a071['attributes']=_0x52a071[_0x05bf('0x33')][_0x05bf('0x36')]?_0x52a071['attributes']:_0x541ca7[_0x05bf('0x34')];if(!_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x37')]('nolimit')){_0x52a071[_0x05bf('0x1d')]=qs[_0x05bf('0x1d')](_0x4236fc[_0x05bf('0x2f')]['limit']);_0x52a071[_0x05bf('0x1b')]=qs['offset'](_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x1b')]);}_0x52a071[_0x05bf('0x38')]=qs[_0x05bf('0x39')](_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x39')]);_0x52a071[_0x05bf('0x3a')]=qs[_0x05bf('0x31')](_[_0x05bf('0x3b')](_0x4236fc[_0x05bf('0x2f')],_0x541ca7['filters']),_0x1e2aa6);if(_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x3c')]){_0x52a071['where']=_[_0x05bf('0x3d')](_0x52a071[_0x05bf('0x3a')],{'$or':_[_0x05bf('0x2a')](_0x1e2aa6,function(_0x53422d){if(_0x53422d[_0x05bf('0x2e')]!==_0x05bf('0x3e')){var _0x501d69={};_0x501d69[_0x53422d[_0x05bf('0x28')]]={'$like':'%'+_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x3c')]+'%'};return _0x501d69;}})});}_0x52a071=_[_0x05bf('0x3d')]({},_0x52a071,_0x4236fc['options']);var _0x1e1a40={'where':_0x52a071[_0x05bf('0x3a')]};return db[_0x05bf('0x2b')][_0x05bf('0x1e')](_0x1e1a40)[_0x05bf('0x22')](function(_0x7aefee){_0x164d1c['count']=_0x7aefee;if(_0x4236fc[_0x05bf('0x2f')][_0x05bf('0x3f')]){_0x52a071['include']=[{'all':!![]}];}return db[_0x05bf('0x2b')][_0x05bf('0x40')](_0x52a071);})[_0x05bf('0x22')](function(_0x534ddd){_0x164d1c[_0x05bf('0x41')]=_0x534ddd;return _0x164d1c;})['then'](respondWithFilteredResult(_0x189935,_0x52a071))[_0x05bf('0x42')](handleError(_0x189935,null));};exports[_0x05bf('0x43')]=function(_0x4a9bd3,_0x2d7c5e){var _0x40faa2={'raw':!![],'where':{'id':_0x4a9bd3['params']['id']}},_0x1a45c8={};_0x1a45c8['model']=_[_0x05bf('0x30')](db[_0x05bf('0x2b')][_0x05bf('0x2c')]);_0x1a45c8[_0x05bf('0x2f')]=_[_0x05bf('0x30')](_0x4a9bd3['query']);_0x1a45c8[_0x05bf('0x31')]=_[_0x05bf('0x32')](_0x1a45c8[_0x05bf('0x34')],_0x1a45c8['query']);_0x40faa2['attributes']=_['intersection'](_0x1a45c8[_0x05bf('0x34')],qs[_0x05bf('0x35')](_0x4a9bd3[_0x05bf('0x2f')][_0x05bf('0x35')]));_0x40faa2['attributes']=_0x40faa2[_0x05bf('0x33')][_0x05bf('0x36')]?_0x40faa2[_0x05bf('0x33')]:_0x1a45c8[_0x05bf('0x34')];if(_0x4a9bd3['query'][_0x05bf('0x3f')]){_0x40faa2[_0x05bf('0x44')]=[{'all':!![]}];}_0x40faa2=_[_0x05bf('0x3d')]({},_0x40faa2,_0x4a9bd3[_0x05bf('0x45')]);return db[_0x05bf('0x2b')][_0x05bf('0x46')](_0x40faa2)[_0x05bf('0x22')](handleEntityNotFound(_0x2d7c5e,null))[_0x05bf('0x22')](respondWithResult(_0x2d7c5e,null))[_0x05bf('0x42')](handleError(_0x2d7c5e,null));};exports[_0x05bf('0x47')]=function(_0x37adbe,_0x24e21a){return db[_0x05bf('0x2b')]['create'](_0x37adbe[_0x05bf('0x48')],{})['then'](function(_0x5bb5c1){var _0xc4fc8c=_0x37adbe['user']['get']({'plain':!![]});if(!_0xc4fc8c)throw new Error(_0x05bf('0x49'));if(_0xc4fc8c[_0x05bf('0x4a')]===_0x05bf('0x4b')){var _0x5bd113=_0x5bb5c1[_0x05bf('0x24')]({'plain':!![]});var _0x92c268='Intervals';return db[_0x05bf('0x4c')][_0x05bf('0x46')]({'where':{'name':_0x92c268,'userProfileId':_0xc4fc8c[_0x05bf('0x4d')]},'raw':!![]})[_0x05bf('0x22')](function(_0x3266d5){if(_0x3266d5&&_0x3266d5[_0x05bf('0x4e')]===0x0){return db[_0x05bf('0x26')][_0x05bf('0x47')]({'name':_0x5bd113[_0x05bf('0x28')],'resourceId':_0x5bd113['id'],'type':_0x3266d5[_0x05bf('0x28')],'sectionId':_0x3266d5['id']},{})[_0x05bf('0x22')](function(){return _0x5bb5c1;});}else{return _0x5bb5c1;}})[_0x05bf('0x42')](function(_0xf6c0f8){logger[_0x05bf('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf6c0f8);throw _0xf6c0f8;});}return _0x5bb5c1;})[_0x05bf('0x22')](respondWithResult(_0x24e21a,0xc9))[_0x05bf('0x42')](handleError(_0x24e21a,null));};exports[_0x05bf('0x50')]=function(_0x1a4ac1,_0x498a0d){if(_0x1a4ac1[_0x05bf('0x48')]['id']){delete _0x1a4ac1[_0x05bf('0x48')]['id'];}return db['Interval'][_0x05bf('0x46')]({'where':{'id':_0x1a4ac1[_0x05bf('0x51')]['id']}})[_0x05bf('0x22')](handleEntityNotFound(_0x498a0d,null))['then'](saveUpdates(_0x1a4ac1[_0x05bf('0x48')],null))[_0x05bf('0x22')](respondWithResult(_0x498a0d,null))[_0x05bf('0x42')](handleError(_0x498a0d,null));};exports['destroy']=function(_0x331c88,_0x5753c2){return db['Interval'][_0x05bf('0x46')]({'where':{'id':_0x331c88[_0x05bf('0x51')]['id']}})[_0x05bf('0x22')](handleEntityNotFound(_0x5753c2,null))[_0x05bf('0x22')](removeEntity(_0x5753c2,null))[_0x05bf('0x42')](handleError(_0x5753c2,null));};exports['addInterval']=function(_0x4048e0,_0x17dc59,_0x378932){if(_0x4048e0['body']['id']){delete _0x4048e0[_0x05bf('0x48')]['id'];}return db[_0x05bf('0x2b')][_0x05bf('0x46')]({'where':{'id':_0x4048e0['params']['id']}})[_0x05bf('0x22')](handleEntityNotFound(_0x17dc59,null))[_0x05bf('0x22')](function(_0x2dd43f){if(_0x2dd43f){_0x4048e0[_0x05bf('0x48')][_0x05bf('0x52')]=_0x2dd43f['id'];return db[_0x05bf('0x2b')][_0x05bf('0x47')](_0x4048e0['body']);}})[_0x05bf('0x22')](respondWithResult(_0x17dc59,null))[_0x05bf('0x42')](handleError(_0x17dc59,null));};exports[_0x05bf('0x53')]=function(_0x2ae2a3,_0x1641e5,_0x208759){var _0x578ebc={};var _0x37c8e4={};var _0x266164;var _0x4975d4;return db['Interval'][_0x05bf('0x54')]({'where':{'id':_0x2ae2a3[_0x05bf('0x51')]['id']}})[_0x05bf('0x22')](handleEntityNotFound(_0x1641e5,null))[_0x05bf('0x22')](function(_0x22690a){if(_0x22690a){_0x266164=_0x22690a;_0x37c8e4[_0x05bf('0x34')]=_[_0x05bf('0x30')](db['Interval'][_0x05bf('0x2c')]);_0x37c8e4[_0x05bf('0x2f')]=_[_0x05bf('0x30')](_0x2ae2a3[_0x05bf('0x2f')]);_0x37c8e4['filters']=_['intersection'](_0x37c8e4['model'],_0x37c8e4[_0x05bf('0x2f')]);_0x578ebc[_0x05bf('0x33')]=_[_0x05bf('0x32')](_0x37c8e4[_0x05bf('0x34')],qs[_0x05bf('0x35')](_0x2ae2a3['query']['fields']));_0x578ebc[_0x05bf('0x33')]=_0x578ebc['attributes'][_0x05bf('0x36')]?_0x578ebc[_0x05bf('0x33')]:_0x37c8e4[_0x05bf('0x34')];_0x578ebc['order']=qs['sort'](_0x2ae2a3[_0x05bf('0x2f')][_0x05bf('0x39')]);_0x578ebc[_0x05bf('0x3a')]=qs[_0x05bf('0x31')](_[_0x05bf('0x3b')](_0x2ae2a3[_0x05bf('0x2f')],_0x37c8e4[_0x05bf('0x31')]));if(_0x2ae2a3[_0x05bf('0x2f')][_0x05bf('0x3c')]){_0x578ebc['where']=_[_0x05bf('0x3d')](_0x578ebc['where'],{'$or':_[_0x05bf('0x2a')](_0x578ebc['attributes'],function(_0x421c45){var _0x53c89e={};_0x53c89e[_0x421c45]={'$like':'%'+_0x2ae2a3[_0x05bf('0x2f')][_0x05bf('0x3c')]+'%'};return _0x53c89e;})});}_0x578ebc=_[_0x05bf('0x3d')]({},_0x578ebc,_0x2ae2a3['options']);return _0x266164[_0x05bf('0x53')](_0x578ebc);}})[_0x05bf('0x22')](function(_0x55989d){if(_0x55989d){_0x4975d4=_0x55989d[_0x05bf('0x36')];if(!_0x2ae2a3[_0x05bf('0x2f')][_0x05bf('0x37')]('nolimit')){_0x578ebc['limit']=qs[_0x05bf('0x1d')](_0x2ae2a3[_0x05bf('0x2f')]['limit']);_0x578ebc[_0x05bf('0x1b')]=qs['offset'](_0x2ae2a3[_0x05bf('0x2f')][_0x05bf('0x1b')]);}return _0x266164['getIntervals'](_0x578ebc);}})[_0x05bf('0x22')](function(_0x3da5bb){if(_0x3da5bb){return _0x3da5bb?{'count':_0x4975d4,'rows':_0x3da5bb}:null;}})[_0x05bf('0x22')](respondWithResult(_0x1641e5,null))[_0x05bf('0x42')](handleError(_0x1641e5,null));};exports[_0x05bf('0x55')]=function(_0xb83ead,_0x1dd80c,_0x14cd3e){return db['Interval'][_0x05bf('0x54')]({'where':{'id':_0xb83ead[_0x05bf('0x51')]['id']}})['then'](handleEntityNotFound(_0x1dd80c,null))['then'](function(_0x1b8190){if(_0x1b8190){return db[_0x05bf('0x56')]['transaction'](function(_0x3fbd5b){return db[_0x05bf('0x2b')]['destroy']({'where':{'IntervalId':_0xb83ead[_0x05bf('0x51')]['id']},'transaction':_0x3fbd5b})[_0x05bf('0x22')](function(_0x5d3f81){var _0x1fc881=_[_0x05bf('0x2a')](_0xb83ead['body'],function(_0x98e135){delete _0x98e135['id'];_0x98e135['IntervalId']=_0xb83ead[_0x05bf('0x51')]['id'];return _0x98e135;});return db[_0x05bf('0x2b')][_0x05bf('0x57')](_0x1fc881,{'transaction':_0x3fbd5b});});})[_0x05bf('0x22')](function(){return db[_0x05bf('0x2b')][_0x05bf('0x40')]({'where':{'IntervalId':_0xb83ead[_0x05bf('0x51')]['id']}});});}})['then'](respondWithResult(_0x1dd80c,null))[_0x05bf('0x42')](handleError(_0x1dd80c,null));}; \ No newline at end of file +var _0x14c8=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Intervals','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x14c8,0x18d));var _0x814c=function(_0x43f614,_0x512207){_0x43f614=_0x43f614-0x0;var _0x172a12=_0x14c8[_0x43f614];return _0x172a12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x814c('0x0'));var zipdir=require(_0x814c('0x1'));var jsonpatch=require(_0x814c('0x2'));var rp=require(_0x814c('0x3'));var moment=require(_0x814c('0x4'));var BPromise=require(_0x814c('0x5'));var Mustache=require(_0x814c('0x6'));var util=require(_0x814c('0x7'));var path=require(_0x814c('0x8'));var sox=require(_0x814c('0x9'));var csv=require(_0x814c('0xa'));var ejs=require(_0x814c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x814c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x814c('0xd'));var Papa=require(_0x814c('0xe'));var Redis=require('ioredis');var authService=require(_0x814c('0xf'));var qs=require(_0x814c('0x10'));var as=require(_0x814c('0x11'));var hardwareService=require(_0x814c('0x12'));var logger=require('../../config/logger')(_0x814c('0x13'));var utils=require('../../config/utils');var config=require(_0x814c('0x14'));var licenseUtil=require(_0x814c('0x15'));var db=require('../../mysqldb')['db'];var extensions=require(_0x814c('0x16'));function respondWithStatusCode(_0x49d3c9,_0x5c1ddf){_0x5c1ddf=_0x5c1ddf||0xcc;return function(_0x3dbfb1){if(_0x3dbfb1){return _0x49d3c9['sendStatus'](_0x5c1ddf);}return _0x49d3c9[_0x814c('0x17')](_0x5c1ddf)[_0x814c('0x18')]();};}function respondWithResult(_0x460e2d,_0x31ef1c){_0x31ef1c=_0x31ef1c||0xc8;return function(_0x105429){if(_0x105429){return _0x460e2d[_0x814c('0x17')](_0x31ef1c)[_0x814c('0x19')](_0x105429);}};}function respondWithFilteredResult(_0x43bd4f,_0x19b57c){return function(_0x9a151c){if(_0x9a151c){var _0x4c2b9c=typeof _0x19b57c[_0x814c('0x1a')]===_0x814c('0x1b')&&typeof _0x19b57c[_0x814c('0x1c')]===_0x814c('0x1b');var _0x340dd2=_0x9a151c[_0x814c('0x1d')];var _0x53e143=_0x4c2b9c?0x0:_0x19b57c[_0x814c('0x1a')];var _0x2b312d=_0x4c2b9c?_0x9a151c[_0x814c('0x1d')]:_0x19b57c[_0x814c('0x1a')]+_0x19b57c[_0x814c('0x1c')];var _0x518bb5;if(_0x2b312d>=_0x340dd2){_0x2b312d=_0x340dd2;_0x518bb5=0xc8;}else{_0x518bb5=0xce;}_0x43bd4f[_0x814c('0x17')](_0x518bb5);return _0x43bd4f[_0x814c('0x1e')](_0x814c('0x1f'),_0x53e143+'-'+_0x2b312d+'/'+_0x340dd2)[_0x814c('0x19')](_0x9a151c);}return null;};}function patchUpdates(_0x26f94d){return function(_0x38b559){try{jsonpatch['apply'](_0x38b559,_0x26f94d,!![]);}catch(_0x5bad9a){return BPromise[_0x814c('0x20')](_0x5bad9a);}return _0x38b559[_0x814c('0x21')]();};}function saveUpdates(_0x235e16,_0x28f782){return function(_0x431908){if(_0x431908){return _0x431908[_0x814c('0x22')](_0x235e16)['then'](function(_0x47132d){return _0x47132d;});}return null;};}function removeEntity(_0x587219,_0x402bf8){return function(_0x24ce71){if(_0x24ce71){return _0x24ce71[_0x814c('0x23')]()[_0x814c('0x24')](function(){var _0x32a01c=_0x24ce71[_0x814c('0x25')]({'plain':!![]});var _0x2ba715=_0x814c('0x26');return db['UserProfileResource'][_0x814c('0x23')]({'where':{'type':_0x2ba715,'resourceId':_0x32a01c['id']}})[_0x814c('0x24')](function(){return _0x24ce71;});})[_0x814c('0x24')](function(){_0x587219[_0x814c('0x17')](0xcc)[_0x814c('0x18')]();});}};}function handleEntityNotFound(_0x5ca5b4,_0x13c8a9){return function(_0x1a4c76){if(!_0x1a4c76){_0x5ca5b4['sendStatus'](0x194);}return _0x1a4c76;};}function handleError(_0x5912cc,_0x37bc70){_0x37bc70=_0x37bc70||0x1f4;return function(_0x117384){logger[_0x814c('0x27')](_0x117384[_0x814c('0x28')]);if(_0x117384[_0x814c('0x29')]){delete _0x117384['name'];}_0x5912cc[_0x814c('0x17')](_0x37bc70)[_0x814c('0x2a')](_0x117384);};}exports[_0x814c('0x2b')]=function(_0x44fcf4,_0x1b333d){var _0x5c5d9d={},_0x1a7af0={},_0x2a3b66={'count':0x0,'rows':[]};var _0xdedcec=_[_0x814c('0x2c')](db[_0x814c('0x2d')][_0x814c('0x2e')],function(_0x2f1acb){return{'name':_0x2f1acb[_0x814c('0x2f')],'type':_0x2f1acb[_0x814c('0x30')][_0x814c('0x31')]};});_0x1a7af0[_0x814c('0x32')]=_[_0x814c('0x2c')](_0xdedcec,'name');_0x1a7af0['query']=_[_0x814c('0x33')](_0x44fcf4[_0x814c('0x34')]);_0x1a7af0[_0x814c('0x35')]=_[_0x814c('0x36')](_0x1a7af0[_0x814c('0x32')],_0x1a7af0['query']);_0x5c5d9d['attributes']=_[_0x814c('0x36')](_0x1a7af0['model'],qs[_0x814c('0x37')](_0x44fcf4['query'][_0x814c('0x37')]));_0x5c5d9d[_0x814c('0x38')]=_0x5c5d9d[_0x814c('0x38')][_0x814c('0x39')]?_0x5c5d9d[_0x814c('0x38')]:_0x1a7af0['model'];if(!_0x44fcf4[_0x814c('0x34')][_0x814c('0x3a')](_0x814c('0x3b'))){_0x5c5d9d[_0x814c('0x1c')]=qs[_0x814c('0x1c')](_0x44fcf4[_0x814c('0x34')]['limit']);_0x5c5d9d[_0x814c('0x1a')]=qs['offset'](_0x44fcf4['query'][_0x814c('0x1a')]);}_0x5c5d9d[_0x814c('0x3c')]=qs[_0x814c('0x3d')](_0x44fcf4[_0x814c('0x34')][_0x814c('0x3d')]);_0x5c5d9d[_0x814c('0x3e')]=qs['filters'](_[_0x814c('0x3f')](_0x44fcf4[_0x814c('0x34')],_0x1a7af0['filters']),_0xdedcec);if(_0x44fcf4['query'][_0x814c('0x40')]){_0x5c5d9d[_0x814c('0x3e')]=_[_0x814c('0x41')](_0x5c5d9d['where'],{'$or':_[_0x814c('0x2c')](_0xdedcec,function(_0x4aabca){if(_0x4aabca['type']!==_0x814c('0x42')){var _0x1b501b={};_0x1b501b[_0x4aabca[_0x814c('0x29')]]={'$like':'%'+_0x44fcf4[_0x814c('0x34')][_0x814c('0x40')]+'%'};return _0x1b501b;}})});}_0x5c5d9d=_['merge']({},_0x5c5d9d,_0x44fcf4[_0x814c('0x43')]);var _0x78b4ea={'where':_0x5c5d9d['where']};return db['Interval'][_0x814c('0x1d')](_0x78b4ea)[_0x814c('0x24')](function(_0x348404){_0x2a3b66[_0x814c('0x1d')]=_0x348404;if(_0x44fcf4['query'][_0x814c('0x44')]){_0x5c5d9d[_0x814c('0x45')]=[{'all':!![]}];}return db[_0x814c('0x2d')][_0x814c('0x46')](_0x5c5d9d);})['then'](function(_0x5e5236){_0x2a3b66[_0x814c('0x47')]=_0x5e5236;return _0x2a3b66;})[_0x814c('0x24')](respondWithFilteredResult(_0x1b333d,_0x5c5d9d))[_0x814c('0x48')](handleError(_0x1b333d,null));};exports[_0x814c('0x49')]=function(_0x532923,_0x334d74){var _0x543b3f={'raw':!![],'where':{'id':_0x532923[_0x814c('0x4a')]['id']}},_0x4e74bd={};_0x4e74bd[_0x814c('0x32')]=_[_0x814c('0x33')](db[_0x814c('0x2d')][_0x814c('0x2e')]);_0x4e74bd['query']=_[_0x814c('0x33')](_0x532923['query']);_0x4e74bd[_0x814c('0x35')]=_['intersection'](_0x4e74bd['model'],_0x4e74bd[_0x814c('0x34')]);_0x543b3f[_0x814c('0x38')]=_['intersection'](_0x4e74bd['model'],qs['fields'](_0x532923['query'][_0x814c('0x37')]));_0x543b3f['attributes']=_0x543b3f['attributes'][_0x814c('0x39')]?_0x543b3f[_0x814c('0x38')]:_0x4e74bd['model'];if(_0x532923['query'][_0x814c('0x44')]){_0x543b3f[_0x814c('0x45')]=[{'all':!![]}];}_0x543b3f=_['merge']({},_0x543b3f,_0x532923['options']);return db[_0x814c('0x2d')][_0x814c('0x4b')](_0x543b3f)['then'](handleEntityNotFound(_0x334d74,null))[_0x814c('0x24')](respondWithResult(_0x334d74,null))[_0x814c('0x48')](handleError(_0x334d74,null));};exports['create']=function(_0x39b0a0,_0x23922e){return db[_0x814c('0x2d')][_0x814c('0x4c')](_0x39b0a0[_0x814c('0x4d')],{})[_0x814c('0x24')](function(_0x4ac184){var _0x31b31b=_0x39b0a0[_0x814c('0x4e')][_0x814c('0x25')]({'plain':!![]});if(!_0x31b31b)throw new Error(_0x814c('0x4f'));if(_0x31b31b['role']==='user'){var _0x28e906=_0x4ac184[_0x814c('0x25')]({'plain':!![]});var _0x3ae313='Intervals';return db[_0x814c('0x50')][_0x814c('0x4b')]({'where':{'name':_0x3ae313,'userProfileId':_0x31b31b[_0x814c('0x51')]},'raw':!![]})[_0x814c('0x24')](function(_0x439f40){if(_0x439f40&&_0x439f40[_0x814c('0x52')]===0x0){return db['UserProfileResource'][_0x814c('0x4c')]({'name':_0x28e906[_0x814c('0x29')],'resourceId':_0x28e906['id'],'type':_0x439f40[_0x814c('0x29')],'sectionId':_0x439f40['id']},{})['then'](function(){return _0x4ac184;});}else{return _0x4ac184;}})[_0x814c('0x48')](function(_0x4240ac){logger[_0x814c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4240ac);throw _0x4240ac;});}return _0x4ac184;})[_0x814c('0x24')](respondWithResult(_0x23922e,0xc9))['catch'](handleError(_0x23922e,null));};exports['update']=function(_0x1e0383,_0x5313ac){if(_0x1e0383[_0x814c('0x4d')]['id']){delete _0x1e0383[_0x814c('0x4d')]['id'];}return db['Interval'][_0x814c('0x4b')]({'where':{'id':_0x1e0383['params']['id']}})['then'](handleEntityNotFound(_0x5313ac,null))[_0x814c('0x24')](saveUpdates(_0x1e0383[_0x814c('0x4d')],null))['then'](respondWithResult(_0x5313ac,null))['catch'](handleError(_0x5313ac,null));};exports[_0x814c('0x23')]=function(_0x132fc6,_0x2b7a54){return db[_0x814c('0x2d')][_0x814c('0x4b')]({'where':{'id':_0x132fc6[_0x814c('0x4a')]['id']}})[_0x814c('0x24')](handleEntityNotFound(_0x2b7a54,null))[_0x814c('0x24')](removeEntity(_0x2b7a54,null))['catch'](handleError(_0x2b7a54,null));};exports[_0x814c('0x53')]=function(_0xf9942e,_0x4fac85,_0x4d3259){if(_0xf9942e['body']['id']){delete _0xf9942e[_0x814c('0x4d')]['id'];}return db[_0x814c('0x2d')][_0x814c('0x4b')]({'where':{'id':_0xf9942e[_0x814c('0x4a')]['id']}})[_0x814c('0x24')](handleEntityNotFound(_0x4fac85,null))[_0x814c('0x24')](function(_0x144c95){if(_0x144c95){_0xf9942e[_0x814c('0x4d')][_0x814c('0x54')]=_0x144c95['id'];return db['Interval'][_0x814c('0x4c')](_0xf9942e['body']);}})['then'](respondWithResult(_0x4fac85,null))[_0x814c('0x48')](handleError(_0x4fac85,null));};exports['getIntervals']=function(_0xadb18e,_0x30f5bc,_0x53ded7){var _0x51da86={};var _0x5b2ba6={};var _0x1f4102;var _0x8d633a;return db[_0x814c('0x2d')][_0x814c('0x55')]({'where':{'id':_0xadb18e[_0x814c('0x4a')]['id']}})[_0x814c('0x24')](handleEntityNotFound(_0x30f5bc,null))[_0x814c('0x24')](function(_0x1967b2){if(_0x1967b2){_0x1f4102=_0x1967b2;_0x5b2ba6['model']=_['keys'](db['Interval'][_0x814c('0x2e')]);_0x5b2ba6[_0x814c('0x34')]=_[_0x814c('0x33')](_0xadb18e[_0x814c('0x34')]);_0x5b2ba6['filters']=_[_0x814c('0x36')](_0x5b2ba6[_0x814c('0x32')],_0x5b2ba6[_0x814c('0x34')]);_0x51da86['attributes']=_[_0x814c('0x36')](_0x5b2ba6[_0x814c('0x32')],qs[_0x814c('0x37')](_0xadb18e['query'][_0x814c('0x37')]));_0x51da86[_0x814c('0x38')]=_0x51da86[_0x814c('0x38')][_0x814c('0x39')]?_0x51da86[_0x814c('0x38')]:_0x5b2ba6[_0x814c('0x32')];_0x51da86['order']=qs[_0x814c('0x3d')](_0xadb18e[_0x814c('0x34')][_0x814c('0x3d')]);_0x51da86[_0x814c('0x3e')]=qs[_0x814c('0x35')](_[_0x814c('0x3f')](_0xadb18e[_0x814c('0x34')],_0x5b2ba6[_0x814c('0x35')]));if(_0xadb18e[_0x814c('0x34')][_0x814c('0x40')]){_0x51da86[_0x814c('0x3e')]=_[_0x814c('0x41')](_0x51da86[_0x814c('0x3e')],{'$or':_[_0x814c('0x2c')](_0x51da86[_0x814c('0x38')],function(_0x27679d){var _0x5348bc={};_0x5348bc[_0x27679d]={'$like':'%'+_0xadb18e['query'][_0x814c('0x40')]+'%'};return _0x5348bc;})});}_0x51da86=_[_0x814c('0x41')]({},_0x51da86,_0xadb18e[_0x814c('0x43')]);return _0x1f4102[_0x814c('0x56')](_0x51da86);}})[_0x814c('0x24')](function(_0x2edb1c){if(_0x2edb1c){_0x8d633a=_0x2edb1c[_0x814c('0x39')];if(!_0xadb18e[_0x814c('0x34')][_0x814c('0x3a')]('nolimit')){_0x51da86[_0x814c('0x1c')]=qs[_0x814c('0x1c')](_0xadb18e['query'][_0x814c('0x1c')]);_0x51da86[_0x814c('0x1a')]=qs[_0x814c('0x1a')](_0xadb18e[_0x814c('0x34')][_0x814c('0x1a')]);}return _0x1f4102[_0x814c('0x56')](_0x51da86);}})[_0x814c('0x24')](function(_0x55104f){if(_0x55104f){return _0x55104f?{'count':_0x8d633a,'rows':_0x55104f}:null;}})[_0x814c('0x24')](respondWithResult(_0x30f5bc,null))[_0x814c('0x48')](handleError(_0x30f5bc,null));};exports[_0x814c('0x57')]=function(_0x44c720,_0x57e551,_0x5ef560){return db[_0x814c('0x2d')][_0x814c('0x55')]({'where':{'id':_0x44c720[_0x814c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57e551,null))['then'](function(_0xe47e53){if(_0xe47e53){return db[_0x814c('0x58')][_0x814c('0x59')](function(_0x156e35){return db[_0x814c('0x2d')][_0x814c('0x23')]({'where':{'IntervalId':_0x44c720[_0x814c('0x4a')]['id']},'transaction':_0x156e35})[_0x814c('0x24')](function(_0x1e1550){var _0xc654b0=_['map'](_0x44c720['body'],function(_0x292c80){delete _0x292c80['id'];_0x292c80[_0x814c('0x54')]=_0x44c720[_0x814c('0x4a')]['id'];return _0x292c80;});return db[_0x814c('0x2d')][_0x814c('0x5a')](_0xc654b0,{'transaction':_0x156e35});});})['then'](function(){return db[_0x814c('0x2d')][_0x814c('0x46')]({'where':{'IntervalId':_0x44c720[_0x814c('0x4a')]['id']}});});}})['then'](respondWithResult(_0x57e551,null))['catch'](handleError(_0x57e551,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e72ddb1..34318f6 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 _0x8d99=['then','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','Interval','tools_intervals','rewrite','interval','string','getIntervals'];(function(_0x5a905e,_0x31aa4a){var _0x4124d6=function(_0x37c28a){while(--_0x37c28a){_0x5a905e['push'](_0x5a905e['shift']());}};_0x4124d6(++_0x31aa4a);}(_0x8d99,0x18a));var _0x98d9=function(_0x48097d,_0x284f8b){_0x48097d=_0x48097d-0x0;var _0x13ff23=_0x8d99[_0x48097d];return _0x13ff23;};'use strict';var attributes=require(_0x98d9('0x0'));var extensions=require(_0x98d9('0x1'));var iftime=require(_0x98d9('0x2'))['iftime'];module['exports']=function(_0x30e9de){return _0x30e9de['define'](_0x98d9('0x3'),attributes,{'tableName':_0x98d9('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x47333f){extensions['rewrite'](_0x30e9de,_0x47333f);},'afterBulkCreate':function(_0x420029,_0x2ff167,_0x16b3cb){_0x16b3cb();extensions[_0x98d9('0x5')](_0x30e9de,_0x420029[0x0]);},'afterUpdate':function(_0x231365){extensions[_0x98d9('0x5')](_0x30e9de,_0x231365);},'afterDestroy':function(_0xe8af4c){extensions[_0x98d9('0x5')](_0x30e9de,_0xe8af4c);}},'instanceMethods':{'ifTime':function(_0x4cb2a1=undefined,_0x43f3a1=new Date()){if(typeof this[_0x98d9('0x6')]===_0x98d9('0x7')){return iftime(this[_0x98d9('0x6')],_0x4cb2a1,_0x43f3a1);}else{return this[_0x98d9('0x8')]()[_0x98d9('0x9')](function(_0x49cd1e){return Promise['all'](_0x49cd1e[_0x98d9('0xa')](function(_0x5b1bd0){return _0x5b1bd0[_0x98d9('0xb')](_0x4cb2a1,_0x43f3a1);}));})[_0x98d9('0x9')](function(_0x55dc84){return _0x55dc84[_0x98d9('0xc')](function(_0x5343ac,_0x9f1843){return _0x5343ac||_0x9f1843;},![]);});}}}});}; \ No newline at end of file +var _0x7169=['reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','Interval','tools_intervals','rewrite','interval','then','map','ifTime'];(function(_0x58e08c,_0x4bf046){var _0x23be06=function(_0x5dccfb){while(--_0x5dccfb){_0x58e08c['push'](_0x58e08c['shift']());}};_0x23be06(++_0x4bf046);}(_0x7169,0x187));var _0x9716=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x7169[_0x20c9b2];return _0x2c6030;};'use strict';var attributes=require(_0x9716('0x0'));var extensions=require(_0x9716('0x1'));var iftime=require(_0x9716('0x2'))[_0x9716('0x3')];module[_0x9716('0x4')]=function(_0x5d12dd){return _0x5d12dd['define'](_0x9716('0x5'),attributes,{'tableName':_0x9716('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x43c671){extensions['rewrite'](_0x5d12dd,_0x43c671);},'afterBulkCreate':function(_0x391447,_0x5ed9cc,_0x5d5119){_0x5d5119();extensions[_0x9716('0x7')](_0x5d12dd,_0x391447[0x0]);},'afterUpdate':function(_0xaebee9){extensions[_0x9716('0x7')](_0x5d12dd,_0xaebee9);},'afterDestroy':function(_0x229e8e){extensions[_0x9716('0x7')](_0x5d12dd,_0x229e8e);}},'instanceMethods':{'ifTime':function(_0x3a9678=undefined,_0x5f3faa=new Date()){if(typeof this[_0x9716('0x8')]==='string'){return iftime(this[_0x9716('0x8')],_0x3a9678,_0x5f3faa);}else{return this['getIntervals']()[_0x9716('0x9')](function(_0x515024){return Promise['all'](_0x515024[_0x9716('0xa')](function(_0x405e42){return _0x405e42[_0x9716('0xb')](_0x3a9678,_0x5f3faa);}));})['then'](function(_0xefe639){return _0xefe639[_0x9716('0xc')](function(_0x2bb697,_0x19d0ad){return _0x2bb697||_0x19d0ad;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b40c615..c8e033d 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 _0xf931=['isArray','intervals','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','reduce','lodash','../../utils/iftime','iftime','../../config/logger','rpc','Interval','findAll','options','where','limit','include','map','model','attributes','then','info','GetInterval','stringify','catch','error','message','ShowInterval','raw','debug','all','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','ifTime','IntervalIftime','intervalIds'];(function(_0x4e4c11,_0x6f02ee){var _0x107766=function(_0x4928e1){while(--_0x4928e1){_0x4e4c11['push'](_0x4e4c11['shift']());}};_0x107766(++_0x6f02ee);}(_0xf931,0x1d7));var _0x1f93=function(_0x959591,_0x5aa72b){_0x959591=_0x959591-0x0;var _0xc85623=_0xf931[_0x959591];return _0xc85623;};'use strict';var _=require(_0x1f93('0x0'));var util=require('util');var db=require('../../mysqldb')['db'];var iftime=require(_0x1f93('0x1'))[_0x1f93('0x2')];var logger=require(_0x1f93('0x3'))(_0x1f93('0x4'));exports['GetInterval']=function(_0xf26902){var _0x5a2b28=this;return new Promise(function(_0x487735,_0x497113){return db[_0x1f93('0x5')][_0x1f93('0x6')]({'raw':_0xf26902[_0x1f93('0x7')]?_0xf26902[_0x1f93('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0xf26902[_0x1f93('0x7')]?_0xf26902[_0x1f93('0x7')][_0x1f93('0x8')]||null:null,'attributes':_0xf26902['options']?_0xf26902[_0x1f93('0x7')]['attributes']||null:null,'limit':_0xf26902['options']?_0xf26902['options'][_0x1f93('0x9')]||null:null,'include':_0xf26902[_0x1f93('0x7')]?_0xf26902[_0x1f93('0x7')][_0x1f93('0xa')]?_[_0x1f93('0xb')](_0xf26902[_0x1f93('0x7')]['include'],function(_0x5e9fe5){return{'model':db[_0x5e9fe5[_0x1f93('0xc')]],'as':_0x5e9fe5['as'],'attributes':_0x5e9fe5[_0x1f93('0xd')],'include':_0x5e9fe5[_0x1f93('0xa')]?_['map'](_0x5e9fe5[_0x1f93('0xa')],function(_0x958df5){return{'model':db[_0x958df5[_0x1f93('0xc')]],'as':_0x958df5['as'],'attributes':_0x958df5[_0x1f93('0xd')],'include':_0x958df5[_0x1f93('0xa')]?_[_0x1f93('0xb')](_0x958df5[_0x1f93('0xa')],function(_0x29b7e4){return{'model':db[_0x29b7e4['model']],'as':_0x29b7e4['as'],'attributes':_0x29b7e4[_0x1f93('0xd')]};}):[]};}):[]};}):[]:[]})[_0x1f93('0xe')](function(_0x148f39){logger[_0x1f93('0xf')](_0x1f93('0x10'),_0xf26902);logger['debug']('GetInterval',_0xf26902,JSON[_0x1f93('0x11')](_0x148f39));_0x487735(_0x148f39);})[_0x1f93('0x12')](function(_0x6d50c8){logger[_0x1f93('0x13')]('GetInterval',_0x6d50c8[_0x1f93('0x14')],_0xf26902);_0x497113(_0x5a2b28['error'](0x1f4,_0x6d50c8[_0x1f93('0x14')]));});});};exports[_0x1f93('0x15')]=function(_0x482a24){var _0x398352=this;return new Promise(function(_0x398902,_0x5dbbf2){return db['Interval']['find']({'raw':_0x482a24['options']?_0x482a24[_0x1f93('0x7')][_0x1f93('0x16')]===undefined?!![]:![]:!![],'where':_0x482a24[_0x1f93('0x7')]?_0x482a24[_0x1f93('0x7')][_0x1f93('0x8')]||null:null,'attributes':_0x482a24['options']?_0x482a24['options'][_0x1f93('0xd')]||null:null,'include':_0x482a24[_0x1f93('0x7')]?_0x482a24[_0x1f93('0x7')][_0x1f93('0xa')]?_[_0x1f93('0xb')](_0x482a24[_0x1f93('0x7')]['include'],function(_0x1f3a90){return{'model':db[_0x1f3a90[_0x1f93('0xc')]],'as':_0x1f3a90['as'],'attributes':_0x1f3a90[_0x1f93('0xd')],'include':_0x1f3a90['include']?_['map'](_0x1f3a90['include'],function(_0x2f5fe9){return{'model':db[_0x2f5fe9['model']],'as':_0x2f5fe9['as'],'attributes':_0x2f5fe9[_0x1f93('0xd')],'include':_0x2f5fe9['include']?_['map'](_0x2f5fe9[_0x1f93('0xa')],function(_0x5cd6e3){return{'model':db[_0x5cd6e3['model']],'as':_0x5cd6e3['as'],'attributes':_0x5cd6e3[_0x1f93('0xd')]};}):[]};}):[]};}):[]:[]})[_0x1f93('0xe')](function(_0x45c47a){logger[_0x1f93('0xf')]('ShowInterval',_0x482a24);logger[_0x1f93('0x17')]('ShowInterval',_0x482a24,JSON[_0x1f93('0x11')](_0x45c47a));_0x398902(_0x45c47a);})[_0x1f93('0x12')](function(_0x555206){logger[_0x1f93('0x13')]('ShowInterval',_0x555206[_0x1f93('0x14')],_0x482a24);_0x5dbbf2(_0x398352['error'](0x1f4,_0x555206['message']));});});};function checkArrayOfIntervals(_0x30da1e,_0x1096f3){var _0x25b03c=[];return db[_0x1f93('0x5')][_0x1f93('0x6')]({'where':{'id':_0x30da1e}})[_0x1f93('0xe')](function(_0x480452){_0x25b03c=_0x480452;return Promise[_0x1f93('0x18')](_0x25b03c[_0x1f93('0xb')](function(_0x52ee05){return _0x52ee05['ifTime'](_0x1096f3);}));})[_0x1f93('0xe')](function(_0x55cc97){var _0x42d42d=_0x55cc97['reduce'](function(_0x1f968c,_0x49d12c){return _0x1f968c||_0x49d12c;},![]);logger[_0x1f93('0xf')](util['format'](_0x1f93('0x19'),_0x25b03c['map'](function(_0x41602a){return _0x41602a[_0x1f93('0x1a')];})[_0x1f93('0x1b')](',\x20'),_0x25b03c[_0x1f93('0xb')](function(_0x41a831){return _0x41a831['id'];})[_0x1f93('0x1b')](',\x20')));return _0x42d42d;});}function checkSingleInterval(_0x23050d,_0x805968){return db['Interval'][_0x1f93('0x1c')](_0x23050d)[_0x1f93('0xe')](function(_0x3106a1){if(_0x3106a1){logger[_0x1f93('0xf')](util[_0x1f93('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x3106a1[_0x1f93('0x1a')],_0x3106a1['id']));return _0x3106a1[_0x1f93('0x1e')](_0x805968);}});}exports[_0x1f93('0x1f')]=function(_0x1842d8){var _0x6e8d25=_0x1842d8[_0x1f93('0x20')];var _0x392f15=Array[_0x1f93('0x21')](_0x1842d8[_0x1f93('0x22')])?_0x1842d8[_0x1f93('0x22')]:typeof _0x1842d8[_0x1f93('0x22')]==='string'?[_0x1842d8['intervals']]:[];var _0x186391=_0x1842d8[_0x1f93('0x23')]||undefined;var _0x1df4b7=![];if(_0x392f15['length']){logger[_0x1f93('0xf')](util[_0x1f93('0x1d')](_0x1f93('0x24'),_0x392f15[_0x1f93('0x1b')](';\x20')));}if(_0x186391){logger[_0x1f93('0xf')](util[_0x1f93('0x1d')](_0x1f93('0x25'),_0x186391));}logger[_0x1f93('0x17')](_0x1f93('0x26'),_0x1df4b7);logger[_0x1f93('0x27')](_0x1f93('0x1f'),_0x1842d8);return Promise[_0x1f93('0x28')]()[_0x1f93('0xe')](function(){if(Array[_0x1f93('0x21')](_0x6e8d25)){return checkArrayOfIntervals(_0x6e8d25,_0x186391);}else if(_0x6e8d25){return checkSingleInterval(_0x6e8d25,_0x186391);}})[_0x1f93('0xe')](function(_0x44001){var _0x177d8a=_0x392f15[_0x1f93('0x29')](function(_0x241f10,_0x250919){return _0x241f10||iftime(_0x250919,_0x186391);},![]);_0x1df4b7=_0x44001||_0x177d8a;return _0x1df4b7;})[_0x1f93('0x12')](function(_0x5e6023){logger[_0x1f93('0x13')](_0x1f93('0x1f'),_0x1842d8,_0x5e6023);throw this[_0x1f93('0x13')](0x1f4,_0x5e6023['message']);});}; \ No newline at end of file +var _0xb432=['GetInterval','Interval','options','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','ShowInterval','find','raw','findAll','ifTime','reduce','format','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','debug','Iftime','silly','IntervalIftime','resolve','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger'];(function(_0x10b441,_0x26e3ca){var _0x35f811=function(_0x3200a9){while(--_0x3200a9){_0x10b441['push'](_0x10b441['shift']());}};_0x35f811(++_0x26e3ca);}(_0xb432,0x128));var _0x2b43=function(_0x268afe,_0x50bb60){_0x268afe=_0x268afe-0x0;var _0x288d0b=_0xb432[_0x268afe];return _0x288d0b;};'use strict';var _=require('lodash');var util=require(_0x2b43('0x0'));var db=require(_0x2b43('0x1'))['db'];var iftime=require(_0x2b43('0x2'))[_0x2b43('0x3')];var logger=require(_0x2b43('0x4'))('rpc');exports[_0x2b43('0x5')]=function(_0x3b7540){var _0x352176=this;return new Promise(function(_0x23e716,_0x594bb4){return db[_0x2b43('0x6')]['findAll']({'raw':_0x3b7540[_0x2b43('0x7')]?_0x3b7540[_0x2b43('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x3b7540[_0x2b43('0x7')]?_0x3b7540['options'][_0x2b43('0x8')]||null:null,'attributes':_0x3b7540[_0x2b43('0x7')]?_0x3b7540['options'][_0x2b43('0x9')]||null:null,'limit':_0x3b7540[_0x2b43('0x7')]?_0x3b7540[_0x2b43('0x7')][_0x2b43('0xa')]||null:null,'include':_0x3b7540[_0x2b43('0x7')]?_0x3b7540[_0x2b43('0x7')][_0x2b43('0xb')]?_[_0x2b43('0xc')](_0x3b7540[_0x2b43('0x7')][_0x2b43('0xb')],function(_0x3db98f){return{'model':db[_0x3db98f[_0x2b43('0xd')]],'as':_0x3db98f['as'],'attributes':_0x3db98f[_0x2b43('0x9')],'include':_0x3db98f[_0x2b43('0xb')]?_['map'](_0x3db98f['include'],function(_0x2afae0){return{'model':db[_0x2afae0[_0x2b43('0xd')]],'as':_0x2afae0['as'],'attributes':_0x2afae0[_0x2b43('0x9')],'include':_0x2afae0[_0x2b43('0xb')]?_[_0x2b43('0xc')](_0x2afae0[_0x2b43('0xb')],function(_0x439ee4){return{'model':db[_0x439ee4[_0x2b43('0xd')]],'as':_0x439ee4['as'],'attributes':_0x439ee4[_0x2b43('0x9')]};}):[]};}):[]};}):[]:[]})[_0x2b43('0xe')](function(_0x3cc6a5){logger[_0x2b43('0xf')](_0x2b43('0x5'),_0x3b7540);logger['debug']('GetInterval',_0x3b7540,JSON[_0x2b43('0x10')](_0x3cc6a5));_0x23e716(_0x3cc6a5);})[_0x2b43('0x11')](function(_0x10e244){logger[_0x2b43('0x12')](_0x2b43('0x5'),_0x10e244['message'],_0x3b7540);_0x594bb4(_0x352176[_0x2b43('0x12')](0x1f4,_0x10e244[_0x2b43('0x13')]));});});};exports[_0x2b43('0x14')]=function(_0x47c815){var _0x203067=this;return new Promise(function(_0x127397,_0x5af17a){return db[_0x2b43('0x6')][_0x2b43('0x15')]({'raw':_0x47c815[_0x2b43('0x7')]?_0x47c815[_0x2b43('0x7')][_0x2b43('0x16')]===undefined?!![]:![]:!![],'where':_0x47c815[_0x2b43('0x7')]?_0x47c815[_0x2b43('0x7')][_0x2b43('0x8')]||null:null,'attributes':_0x47c815[_0x2b43('0x7')]?_0x47c815['options'][_0x2b43('0x9')]||null:null,'include':_0x47c815[_0x2b43('0x7')]?_0x47c815[_0x2b43('0x7')][_0x2b43('0xb')]?_[_0x2b43('0xc')](_0x47c815[_0x2b43('0x7')]['include'],function(_0x3c4d7b){return{'model':db[_0x3c4d7b['model']],'as':_0x3c4d7b['as'],'attributes':_0x3c4d7b[_0x2b43('0x9')],'include':_0x3c4d7b[_0x2b43('0xb')]?_[_0x2b43('0xc')](_0x3c4d7b[_0x2b43('0xb')],function(_0x5219de){return{'model':db[_0x5219de[_0x2b43('0xd')]],'as':_0x5219de['as'],'attributes':_0x5219de[_0x2b43('0x9')],'include':_0x5219de['include']?_[_0x2b43('0xc')](_0x5219de['include'],function(_0x548b7f){return{'model':db[_0x548b7f[_0x2b43('0xd')]],'as':_0x548b7f['as'],'attributes':_0x548b7f[_0x2b43('0x9')]};}):[]};}):[]};}):[]:[]})[_0x2b43('0xe')](function(_0x364ae5){logger[_0x2b43('0xf')](_0x2b43('0x14'),_0x47c815);logger['debug'](_0x2b43('0x14'),_0x47c815,JSON['stringify'](_0x364ae5));_0x127397(_0x364ae5);})[_0x2b43('0x11')](function(_0x1e12f5){logger[_0x2b43('0x12')](_0x2b43('0x14'),_0x1e12f5[_0x2b43('0x13')],_0x47c815);_0x5af17a(_0x203067[_0x2b43('0x12')](0x1f4,_0x1e12f5[_0x2b43('0x13')]));});});};function checkArrayOfIntervals(_0xc3d146,_0x4a867e){var _0x587729=[];return db['Interval'][_0x2b43('0x17')]({'where':{'id':_0xc3d146}})[_0x2b43('0xe')](function(_0x499be3){_0x587729=_0x499be3;return Promise['all'](_0x587729['map'](function(_0x507531){return _0x507531[_0x2b43('0x18')](_0x4a867e);}));})[_0x2b43('0xe')](function(_0x15b612){var _0x327357=_0x15b612[_0x2b43('0x19')](function(_0x3fad25,_0x53571e){return _0x3fad25||_0x53571e;},![]);logger[_0x2b43('0xf')](util[_0x2b43('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x587729[_0x2b43('0xc')](function(_0x2b60b7){return _0x2b60b7['name'];})['join'](',\x20'),_0x587729['map'](function(_0x2e807a){return _0x2e807a['id'];})[_0x2b43('0x1b')](',\x20')));return _0x327357;});}function checkSingleInterval(_0xb527de,_0x27841b){return db['Interval'][_0x2b43('0x1c')](_0xb527de)[_0x2b43('0xe')](function(_0x3d9444){if(_0x3d9444){logger[_0x2b43('0xf')](util[_0x2b43('0x1a')](_0x2b43('0x1d'),_0x3d9444[_0x2b43('0x1e')],_0x3d9444['id']));return _0x3d9444[_0x2b43('0x18')](_0x27841b);}});}exports['IntervalIftime']=function(_0x4acea7){var _0x2ffd04=_0x4acea7[_0x2b43('0x1f')];var _0x111f5c=Array[_0x2b43('0x20')](_0x4acea7[_0x2b43('0x21')])?_0x4acea7[_0x2b43('0x21')]:typeof _0x4acea7['intervals']===_0x2b43('0x22')?[_0x4acea7[_0x2b43('0x21')]]:[];var _0x20ffae=_0x4acea7[_0x2b43('0x23')]||undefined;var _0x2da67a=![];if(_0x111f5c['length']){logger[_0x2b43('0xf')](util[_0x2b43('0x1a')](_0x2b43('0x24'),_0x111f5c[_0x2b43('0x1b')](';\x20')));}if(_0x20ffae){logger['info'](util['format'](_0x2b43('0x25'),_0x20ffae));}logger[_0x2b43('0x26')](_0x2b43('0x27'),_0x2da67a);logger[_0x2b43('0x28')](_0x2b43('0x29'),_0x4acea7);return Promise[_0x2b43('0x2a')]()[_0x2b43('0xe')](function(){if(Array[_0x2b43('0x20')](_0x2ffd04)){return checkArrayOfIntervals(_0x2ffd04,_0x20ffae);}else if(_0x2ffd04){return checkSingleInterval(_0x2ffd04,_0x20ffae);}})['then'](function(_0x3d5c3d){var _0x1ab019=_0x111f5c[_0x2b43('0x19')](function(_0x1c6fc9,_0x63f3af){return _0x1c6fc9||iftime(_0x63f3af,_0x20ffae);},![]);_0x2da67a=_0x3d5c3d||_0x1ab019;return _0x2da67a;})[_0x2b43('0x11')](function(_0x10a65b){logger['error'](_0x2b43('0x29'),_0x4acea7,_0x10a65b);throw this[_0x2b43('0x12')](0x1f4,_0x10a65b[_0x2b43('0x13')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index c1af0a2..45abeaa 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x0b0e[_0x2d4421];return _0x2d3b01;};'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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x56ea53,_0x391cfc){var _0x5b5f5a=function(_0x37b9f0){while(--_0x37b9f0){_0x56ea53['push'](_0x56ea53['shift']());}};_0x5b5f5a(++_0x391cfc);}(_0x2ef3,0xba));var _0x32ef=function(_0x1d7e73,_0x2e6a99){_0x1d7e73=_0x1d7e73-0x0;var _0x181eaa=_0x2ef3[_0x1d7e73];return _0x181eaa;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 47a55ce..cd9fb26 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 _0xe039=['MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','track.xcallymotion.com','POST','Basic\x20','toString','base64','request','data','end','status','json','parse','error','write','send','body','headers','x-forwarded-for','socket','remoteAddress','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key'];(function(_0x42d41d,_0x17b8ea){var _0x2e6184=function(_0x3104f0){while(--_0x3104f0){_0x42d41d['push'](_0x42d41d['shift']());}};_0x2e6184(++_0x17b8ea);}(_0xe039,0x19d));var _0x9e03=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xe039[_0x2a6809];return _0x11c371;};'use strict';var BPromise=require(_0x9e03('0x0'));var https=require(_0x9e03('0x1'));var logger=require(_0x9e03('0x2'))(_0x9e03('0x3'));var USERNAME=_0x9e03('0x4');var PASSWORD=_0x9e03('0x5');function openIssue(_0x515bd9,_0x2cf7c2){var _0x39b39a={'fields':{'project':{'key':_0x515bd9[_0x9e03('0x6')]||_0x9e03('0x7')},'summary':(_0x515bd9[_0x9e03('0x8')]||'Report')+_0x9e03('0x9')+_0x515bd9['ip'],'description':_0x515bd9[_0x9e03('0xa')]||JSON[_0x9e03('0xb')](_0x515bd9),'issuetype':{'name':_0x515bd9[_0x9e03('0xc')]||_0x9e03('0xd')}}};_0x39b39a[_0x9e03('0xe')][_0x9e03('0xf')]=_0x515bd9['email'];_0x39b39a[_0x9e03('0xe')][_0x9e03('0x10')]=_0x515bd9[_0x9e03('0x11')];_0x39b39a['fields'][_0x9e03('0x12')]=_0x515bd9[_0x9e03('0x13')];_0x39b39a[_0x9e03('0xe')][_0x9e03('0x14')]=_0x515bd9['name'];_0x39b39a[_0x9e03('0xe')][_0x9e03('0x15')]=_0x515bd9['reason'];_0x39b39a[_0x9e03('0xe')]['customfield_10102']=_0x515bd9['ip'];var _0x40b4fd={'host':_0x9e03('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x9e03('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x9e03('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x9e03('0x19')](_0x9e03('0x1a'))}};var _0x194dfb=JSON[_0x9e03('0xb')](_0x39b39a);var _0x30df49=https[_0x9e03('0x1b')](_0x40b4fd,function(_0x1a556f){_0x1a556f['setEncoding']('utf8');var _0x1750f2='';_0x1a556f['on'](_0x9e03('0x1c'),function(_0x40d949){_0x1750f2+=_0x40d949;});_0x1a556f['on'](_0x9e03('0x1d'),function(){if(_0x2cf7c2){return _0x2cf7c2[_0x9e03('0x1e')](_0x1a556f['statusCode'])[_0x9e03('0x1f')](JSON[_0x9e03('0x20')](_0x1750f2));}});});_0x30df49['on'](_0x9e03('0x21'),function(_0x20bb6d){if(_0x2cf7c2){return _0x2cf7c2[_0x9e03('0x1e')](0x1f4)[_0x9e03('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x30df49[_0x9e03('0x22')](_0x194dfb);_0x30df49[_0x9e03('0x1d')]();}exports['openIssue']=openIssue;exports[_0x9e03('0x23')]=function(_0x2613ac,_0x4d0645){_0x2613ac[_0x9e03('0x24')]['ip']=_0x2613ac[_0x9e03('0x25')][_0x9e03('0x26')]||_0x2613ac['connection']['remoteAddress']||_0x2613ac[_0x9e03('0x27')][_0x9e03('0x28')]||_0x2613ac[_0x9e03('0x29')][_0x9e03('0x27')][_0x9e03('0x28')];return openIssue(_0x2613ac[_0x9e03('0x24')],_0x4d0645);}; \ No newline at end of file +var _0x5036=['Basic\x20','request','setEncoding','data','end','status','statusCode','json','api.jira','write','send','headers','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json'];(function(_0x36e776,_0x2b0bfc){var _0x2928cd=function(_0x45c30d){while(--_0x45c30d){_0x36e776['push'](_0x36e776['shift']());}};_0x2928cd(++_0x2b0bfc);}(_0x5036,0x1c8));var _0x6503=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0x5036[_0xae1a83];return _0xdb9da8;};'use strict';var BPromise=require(_0x6503('0x0'));var https=require(_0x6503('0x1'));var logger=require(_0x6503('0x2'))(_0x6503('0x3'));var USERNAME=_0x6503('0x4');var PASSWORD=_0x6503('0x5');function openIssue(_0x5a55d4,_0x38ea9c){var _0x2f0e2c={'fields':{'project':{'key':_0x5a55d4[_0x6503('0x6')]||_0x6503('0x7')},'summary':(_0x5a55d4[_0x6503('0x8')]||_0x6503('0x9'))+_0x6503('0xa')+_0x5a55d4['ip'],'description':_0x5a55d4[_0x6503('0xb')]||JSON[_0x6503('0xc')](_0x5a55d4),'issuetype':{'name':_0x5a55d4[_0x6503('0xd')]||_0x6503('0xe')}}};_0x2f0e2c[_0x6503('0xf')][_0x6503('0x10')]=_0x5a55d4[_0x6503('0x11')];_0x2f0e2c[_0x6503('0xf')]['customfield_11501']=_0x5a55d4[_0x6503('0x12')];_0x2f0e2c['fields']['customfield_11502']=_0x5a55d4[_0x6503('0x13')];_0x2f0e2c[_0x6503('0xf')]['customfield_11503']=_0x5a55d4[_0x6503('0x14')];_0x2f0e2c['fields'][_0x6503('0x15')]=_0x5a55d4[_0x6503('0x16')];_0x2f0e2c[_0x6503('0xf')][_0x6503('0x17')]=_0x5a55d4['ip'];var _0x35205d={'host':_0x6503('0x18'),'port':0x1bb,'path':_0x6503('0x19'),'method':_0x6503('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':_0x6503('0x1b'),'Authorization':_0x6503('0x1c')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x505f26=JSON[_0x6503('0xc')](_0x2f0e2c);var _0x5e299c=https[_0x6503('0x1d')](_0x35205d,function(_0x2ab9ac){_0x2ab9ac[_0x6503('0x1e')]('utf8');var _0x2b4102='';_0x2ab9ac['on'](_0x6503('0x1f'),function(_0x4703df){_0x2b4102+=_0x4703df;});_0x2ab9ac['on'](_0x6503('0x20'),function(){if(_0x38ea9c){return _0x38ea9c[_0x6503('0x21')](_0x2ab9ac[_0x6503('0x22')])[_0x6503('0x23')](JSON['parse'](_0x2b4102));}});});_0x5e299c['on']('error',function(_0x21ee3c){if(_0x38ea9c){return _0x38ea9c[_0x6503('0x21')](0x1f4)[_0x6503('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x6503('0x24')}]});}});_0x5e299c[_0x6503('0x25')](_0x505f26);_0x5e299c[_0x6503('0x20')]();}exports['openIssue']=openIssue;exports[_0x6503('0x26')]=function(_0x26da79,_0x3af97e){_0x26da79['body']['ip']=_0x26da79[_0x6503('0x27')]['x-forwarded-for']||_0x26da79[_0x6503('0x28')][_0x6503('0x29')]||_0x26da79['socket'][_0x6503('0x29')]||_0x26da79[_0x6503('0x28')][_0x6503('0x2a')][_0x6503('0x29')];return openIssue(_0x26da79[_0x6503('0x2b')],_0x3af97e);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8bfc881..c39539d 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 _0x5b02=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x30190c,_0xfe91e7){var _0x2d687e=function(_0x2d46b9){while(--_0x2d46b9){_0x30190c['push'](_0x30190c['shift']());}};_0x2d687e(++_0xfe91e7);}(_0x5b02,0xe9));var _0x25b0=function(_0x42c732,_0x3a18dc){_0x42c732=_0x42c732-0x0;var _0x356074=_0x5b02[_0x42c732];return _0x356074;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0xd')]('/',auth['isAuthenticated'](),controller[_0x25b0('0xe')]);router[_0x25b0('0xf')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x11')]);router[_0x25b0('0x12')](_0x25b0('0x10'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x13')]);module[_0x25b0('0x14')]=router; \ No newline at end of file +var _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x2750,0x13b));var _0x0275=function(_0x141251,_0x1a2611){_0x141251=_0x141251-0x0;var _0x3cfff8=_0x2750[_0x141251];return _0x3cfff8;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 6d873f0..10bee90 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x3c82c1,_0x13c81a){_0x3c82c1=_0x3c82c1-0x0;var _0xe01442=_0x7a54[_0x3c82c1];return _0xe01442;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x192b15,_0x6723ca){_0x192b15=_0x192b15-0x0;var _0x54963c=_0x7a54[_0x192b15];return _0x54963c;};'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 8031d22..587540d 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 _0x446c=['name','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x446c,0x156));var _0xc446=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x446c[_0x4bf96c];return _0x281d09;};'use strict';var emlformat=require(_0xc446('0x0'));var rimraf=require(_0xc446('0x1'));var zipdir=require(_0xc446('0x2'));var jsonpatch=require(_0xc446('0x3'));var rp=require('request-promise');var moment=require(_0xc446('0x4'));var BPromise=require(_0xc446('0x5'));var Mustache=require(_0xc446('0x6'));var util=require('util');var path=require(_0xc446('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc446('0x8'));var fs=require('fs');var fs_extra=require(_0xc446('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc446('0xa'));var jsforce=require(_0xc446('0xb'));var deskjs=require(_0xc446('0xc'));var toCsv=require(_0xc446('0xd'));var querystring=require(_0xc446('0xe'));var Papa=require('papaparse');var Redis=require(_0xc446('0xf'));var authService=require(_0xc446('0x10'));var qs=require(_0xc446('0x11'));var as=require(_0xc446('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc446('0x13'))(_0xc446('0x14'));var utils=require(_0xc446('0x15'));var config=require(_0xc446('0x16'));var licenseUtil=require(_0xc446('0x17'));var db=require(_0xc446('0x18'))['db'];function respondWithStatusCode(_0x1a2099,_0x19083f){_0x19083f=_0x19083f||0xcc;return function(_0x22a70e){if(_0x22a70e){return _0x1a2099[_0xc446('0x19')](_0x19083f);}return _0x1a2099[_0xc446('0x1a')](_0x19083f)[_0xc446('0x1b')]();};}function respondWithResult(_0x1cfc0a,_0x72faac){_0x72faac=_0x72faac||0xc8;return function(_0x21d8e4){if(_0x21d8e4){return _0x1cfc0a[_0xc446('0x1a')](_0x72faac)[_0xc446('0x1c')](_0x21d8e4);}};}function respondWithFilteredResult(_0x20e51b,_0x2b09db){return function(_0x5d2701){if(_0x5d2701){var _0x3ba115=typeof _0x2b09db[_0xc446('0x1d')]===_0xc446('0x1e')&&typeof _0x2b09db[_0xc446('0x1f')]===_0xc446('0x1e');var _0x274040=_0x5d2701[_0xc446('0x20')];var _0x30038f=_0x3ba115?0x0:_0x2b09db[_0xc446('0x1d')];var _0x606af1=_0x3ba115?_0x5d2701['count']:_0x2b09db[_0xc446('0x1d')]+_0x2b09db[_0xc446('0x1f')];var _0x5cd0c1;if(_0x606af1>=_0x274040){_0x606af1=_0x274040;_0x5cd0c1=0xc8;}else{_0x5cd0c1=0xce;}_0x20e51b[_0xc446('0x1a')](_0x5cd0c1);return _0x20e51b[_0xc446('0x21')](_0xc446('0x22'),_0x30038f+'-'+_0x606af1+'/'+_0x274040)[_0xc446('0x1c')](_0x5d2701);}return null;};}function patchUpdates(_0x409a8e){return function(_0x37108c){try{jsonpatch[_0xc446('0x23')](_0x37108c,_0x409a8e,!![]);}catch(_0xc18765){return BPromise[_0xc446('0x24')](_0xc18765);}return _0x37108c[_0xc446('0x25')]();};}function saveUpdates(_0x5ce5f7,_0x35aedc){return function(_0x1ea08b){if(_0x1ea08b){return _0x1ea08b[_0xc446('0x26')](_0x5ce5f7)[_0xc446('0x27')](function(_0x3596f4){return _0x3596f4;});}return null;};}function removeEntity(_0xb696e,_0x36a6f5){return function(_0x1b785a){if(_0x1b785a){return _0x1b785a[_0xc446('0x28')]()[_0xc446('0x27')](function(){_0xb696e[_0xc446('0x1a')](0xcc)[_0xc446('0x1b')]();});}};}function handleEntityNotFound(_0x25f58d,_0x438410){return function(_0x16133b){if(!_0x16133b){_0x25f58d[_0xc446('0x19')](0x194);}return _0x16133b;};}function handleError(_0x465e18,_0x51933d){_0x51933d=_0x51933d||0x1f4;return function(_0xb3ab06){logger[_0xc446('0x29')](_0xb3ab06[_0xc446('0x2a')]);if(_0xb3ab06[_0xc446('0x2b')]){delete _0xb3ab06[_0xc446('0x2b')];}_0x465e18[_0xc446('0x1a')](_0x51933d)['send'](_0xb3ab06);};}exports['index']=function(_0x37532c,_0x1b2dc8){var _0x19f57f={},_0x865c07={},_0x4ea05e={'count':0x0,'rows':[]};var _0x420fcb=_[_0xc446('0x2c')](db[_0xc446('0x2d')][_0xc446('0x2e')],function(_0x1bd4e6){return{'name':_0x1bd4e6[_0xc446('0x2f')],'type':_0x1bd4e6[_0xc446('0x30')][_0xc446('0x31')]};});_0x865c07[_0xc446('0x32')]=_[_0xc446('0x2c')](_0x420fcb,'name');_0x865c07['query']=_['keys'](_0x37532c[_0xc446('0x33')]);_0x865c07[_0xc446('0x34')]=_[_0xc446('0x35')](_0x865c07[_0xc446('0x32')],_0x865c07[_0xc446('0x33')]);_0x19f57f[_0xc446('0x36')]=_[_0xc446('0x35')](_0x865c07['model'],qs[_0xc446('0x37')](_0x37532c[_0xc446('0x33')][_0xc446('0x37')]));_0x19f57f[_0xc446('0x36')]=_0x19f57f[_0xc446('0x36')]['length']?_0x19f57f[_0xc446('0x36')]:_0x865c07[_0xc446('0x32')];if(!_0x37532c[_0xc446('0x33')][_0xc446('0x38')](_0xc446('0x39'))){_0x19f57f[_0xc446('0x1f')]=qs[_0xc446('0x1f')](_0x37532c[_0xc446('0x33')]['limit']);_0x19f57f['offset']=qs[_0xc446('0x1d')](_0x37532c[_0xc446('0x33')][_0xc446('0x1d')]);}_0x19f57f['order']=qs[_0xc446('0x3a')](_0x37532c[_0xc446('0x33')][_0xc446('0x3a')]);_0x19f57f['where']=qs['filters'](_['pick'](_0x37532c[_0xc446('0x33')],_0x865c07['filters']),_0x420fcb);if(_0x37532c[_0xc446('0x33')][_0xc446('0x3b')]){_0x19f57f['where']=_[_0xc446('0x3c')](_0x19f57f[_0xc446('0x3d')],{'$or':_[_0xc446('0x2c')](_0x420fcb,function(_0x2beba1){if(_0x2beba1['type']!==_0xc446('0x3e')){var _0xb9c7e6={};_0xb9c7e6[_0x2beba1['name']]={'$like':'%'+_0x37532c[_0xc446('0x33')][_0xc446('0x3b')]+'%'};return _0xb9c7e6;}})});}_0x19f57f=_[_0xc446('0x3c')]({},_0x19f57f,_0x37532c[_0xc446('0x3f')]);var _0xf3400e={'where':_0x19f57f['where']};return db[_0xc446('0x2d')][_0xc446('0x20')](_0xf3400e)[_0xc446('0x27')](function(_0xf8c80c){_0x4ea05e[_0xc446('0x20')]=_0xf8c80c;if(_0x37532c['query'][_0xc446('0x40')]){_0x19f57f[_0xc446('0x41')]=[{'all':!![]}];}return db[_0xc446('0x2d')][_0xc446('0x42')](_0x19f57f);})[_0xc446('0x27')](function(_0x5e65d5){_0x4ea05e[_0xc446('0x43')]=_0x5e65d5;return _0x4ea05e;})['then'](respondWithFilteredResult(_0x1b2dc8,_0x19f57f))[_0xc446('0x44')](handleError(_0x1b2dc8,null));};exports[_0xc446('0x45')]=function(_0x520ffd,_0x3287ce){var _0x5e250b={'raw':!![],'where':{'id':_0x520ffd[_0xc446('0x46')]['id']}},_0x29f36f={};_0x29f36f[_0xc446('0x32')]=_[_0xc446('0x47')](db['JscriptyAnswerReport'][_0xc446('0x2e')]);_0x29f36f[_0xc446('0x33')]=_[_0xc446('0x47')](_0x520ffd['query']);_0x29f36f[_0xc446('0x34')]=_[_0xc446('0x35')](_0x29f36f[_0xc446('0x32')],_0x29f36f[_0xc446('0x33')]);_0x5e250b[_0xc446('0x36')]=_[_0xc446('0x35')](_0x29f36f[_0xc446('0x32')],qs[_0xc446('0x37')](_0x520ffd[_0xc446('0x33')][_0xc446('0x37')]));_0x5e250b[_0xc446('0x36')]=_0x5e250b[_0xc446('0x36')][_0xc446('0x48')]?_0x5e250b[_0xc446('0x36')]:_0x29f36f[_0xc446('0x32')];if(_0x520ffd['query']['includeAll']){_0x5e250b[_0xc446('0x41')]=[{'all':!![]}];}_0x5e250b=_[_0xc446('0x3c')]({},_0x5e250b,_0x520ffd['options']);return db['JscriptyAnswerReport']['find'](_0x5e250b)['then'](handleEntityNotFound(_0x3287ce,null))[_0xc446('0x27')](respondWithResult(_0x3287ce,null))[_0xc446('0x44')](handleError(_0x3287ce,null));};exports[_0xc446('0x49')]=function(_0x2fc1bf,_0x19ca3d){return db[_0xc446('0x2d')][_0xc446('0x49')](_0x2fc1bf[_0xc446('0x4a')],{})[_0xc446('0x27')](respondWithResult(_0x19ca3d,0xc9))[_0xc446('0x44')](handleError(_0x19ca3d,null));};exports['update']=function(_0x40aa4f,_0x317559){if(_0x40aa4f[_0xc446('0x4a')]['id']){delete _0x40aa4f['body']['id'];}return db[_0xc446('0x2d')]['find']({'where':{'id':_0x40aa4f[_0xc446('0x46')]['id']}})[_0xc446('0x27')](handleEntityNotFound(_0x317559,null))[_0xc446('0x27')](saveUpdates(_0x40aa4f[_0xc446('0x4a')],null))[_0xc446('0x27')](respondWithResult(_0x317559,null))['catch'](handleError(_0x317559,null));};exports[_0xc446('0x28')]=function(_0x5415e5,_0x26ec5f){return db['JscriptyAnswerReport'][_0xc446('0x4b')]({'where':{'id':_0x5415e5['params']['id']}})[_0xc446('0x27')](handleEntityNotFound(_0x26ec5f,null))[_0xc446('0x27')](removeEntity(_0x26ec5f,null))['catch'](handleError(_0x26ec5f,null));};exports['describe']=function(_0x1a66fd,_0x5759af){return db[_0xc446('0x2d')][_0xc446('0x4c')]()[_0xc446('0x27')](respondWithResult(_0x5759af,null))[_0xc446('0x44')](handleError(_0x5759af,null));}; \ No newline at end of file +var _0x7e02=['destroy','end','error','stack','name','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','then'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7e02,0x71));var _0x27e0=function(_0x44bb01,_0x5757f4){_0x44bb01=_0x44bb01-0x0;var _0x30a1ad=_0x7e02[_0x44bb01];return _0x30a1ad;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require(_0x27e0('0x3'));var rp=require(_0x27e0('0x4'));var moment=require(_0x27e0('0x5'));var BPromise=require(_0x27e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x27e0('0x7'));var sox=require('sox');var csv=require(_0x27e0('0x8'));var ejs=require(_0x27e0('0x9'));var fs=require('fs');var fs_extra=require(_0x27e0('0xa'));var _=require(_0x27e0('0xb'));var squel=require(_0x27e0('0xc'));var crypto=require(_0x27e0('0xd'));var jsforce=require(_0x27e0('0xe'));var deskjs=require(_0x27e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27e0('0x11'));var authService=require(_0x27e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27e0('0x13'));var hardwareService=require(_0x27e0('0x14'));var logger=require(_0x27e0('0x15'))(_0x27e0('0x16'));var utils=require(_0x27e0('0x17'));var config=require(_0x27e0('0x18'));var licenseUtil=require(_0x27e0('0x19'));var db=require(_0x27e0('0x1a'))['db'];function respondWithStatusCode(_0x31ef33,_0x492c65){_0x492c65=_0x492c65||0xcc;return function(_0x156bea){if(_0x156bea){return _0x31ef33[_0x27e0('0x1b')](_0x492c65);}return _0x31ef33[_0x27e0('0x1c')](_0x492c65)['end']();};}function respondWithResult(_0x39fb61,_0x3a67ab){_0x3a67ab=_0x3a67ab||0xc8;return function(_0x473128){if(_0x473128){return _0x39fb61['status'](_0x3a67ab)[_0x27e0('0x1d')](_0x473128);}};}function respondWithFilteredResult(_0x220128,_0x1f7532){return function(_0xf326e2){if(_0xf326e2){var _0x5b1b6e=typeof _0x1f7532['offset']===_0x27e0('0x1e')&&typeof _0x1f7532[_0x27e0('0x1f')]===_0x27e0('0x1e');var _0x2111e=_0xf326e2['count'];var _0x32597b=_0x5b1b6e?0x0:_0x1f7532[_0x27e0('0x20')];var _0x12a91f=_0x5b1b6e?_0xf326e2[_0x27e0('0x21')]:_0x1f7532[_0x27e0('0x20')]+_0x1f7532[_0x27e0('0x1f')];var _0x4d9edc;if(_0x12a91f>=_0x2111e){_0x12a91f=_0x2111e;_0x4d9edc=0xc8;}else{_0x4d9edc=0xce;}_0x220128[_0x27e0('0x1c')](_0x4d9edc);return _0x220128[_0x27e0('0x22')]('Content-Range',_0x32597b+'-'+_0x12a91f+'/'+_0x2111e)[_0x27e0('0x1d')](_0xf326e2);}return null;};}function patchUpdates(_0x23df66){return function(_0x32c2ff){try{jsonpatch[_0x27e0('0x23')](_0x32c2ff,_0x23df66,!![]);}catch(_0x408d95){return BPromise['reject'](_0x408d95);}return _0x32c2ff['save']();};}function saveUpdates(_0x57897e,_0x1ef3aa){return function(_0x11f4ca){if(_0x11f4ca){return _0x11f4ca['update'](_0x57897e)[_0x27e0('0x24')](function(_0xee6318){return _0xee6318;});}return null;};}function removeEntity(_0x32503e,_0x6f83ee){return function(_0xd857c2){if(_0xd857c2){return _0xd857c2[_0x27e0('0x25')]()[_0x27e0('0x24')](function(){_0x32503e[_0x27e0('0x1c')](0xcc)[_0x27e0('0x26')]();});}};}function handleEntityNotFound(_0x3068c4,_0x1e5060){return function(_0x27dc43){if(!_0x27dc43){_0x3068c4[_0x27e0('0x1b')](0x194);}return _0x27dc43;};}function handleError(_0x3d4691,_0xab503d){_0xab503d=_0xab503d||0x1f4;return function(_0x581ec9){logger[_0x27e0('0x27')](_0x581ec9[_0x27e0('0x28')]);if(_0x581ec9[_0x27e0('0x29')]){delete _0x581ec9[_0x27e0('0x29')];}_0x3d4691[_0x27e0('0x1c')](_0xab503d)['send'](_0x581ec9);};}exports['index']=function(_0x29114d,_0x3e2c4b){var _0x141c40={},_0x304fe6={},_0x57bcc1={'count':0x0,'rows':[]};var _0x4f5ea2=_[_0x27e0('0x2a')](db[_0x27e0('0x2b')]['rawAttributes'],function(_0x55d752){return{'name':_0x55d752['fieldName'],'type':_0x55d752[_0x27e0('0x2c')][_0x27e0('0x2d')]};});_0x304fe6[_0x27e0('0x2e')]=_[_0x27e0('0x2a')](_0x4f5ea2,'name');_0x304fe6[_0x27e0('0x2f')]=_[_0x27e0('0x30')](_0x29114d[_0x27e0('0x2f')]);_0x304fe6[_0x27e0('0x31')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],_0x304fe6[_0x27e0('0x2f')]);_0x141c40[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],qs['fields'](_0x29114d[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x141c40['attributes']=_0x141c40['attributes'][_0x27e0('0x35')]?_0x141c40[_0x27e0('0x33')]:_0x304fe6[_0x27e0('0x2e')];if(!_0x29114d['query'][_0x27e0('0x36')](_0x27e0('0x37'))){_0x141c40['limit']=qs[_0x27e0('0x1f')](_0x29114d[_0x27e0('0x2f')]['limit']);_0x141c40[_0x27e0('0x20')]=qs[_0x27e0('0x20')](_0x29114d['query'][_0x27e0('0x20')]);}_0x141c40[_0x27e0('0x38')]=qs['sort'](_0x29114d['query'][_0x27e0('0x39')]);_0x141c40[_0x27e0('0x3a')]=qs[_0x27e0('0x31')](_[_0x27e0('0x3b')](_0x29114d['query'],_0x304fe6[_0x27e0('0x31')]),_0x4f5ea2);if(_0x29114d['query'][_0x27e0('0x3c')]){_0x141c40[_0x27e0('0x3a')]=_[_0x27e0('0x3d')](_0x141c40['where'],{'$or':_[_0x27e0('0x2a')](_0x4f5ea2,function(_0x213540){if(_0x213540['type']!=='VIRTUAL'){var _0x2763ec={};_0x2763ec[_0x213540[_0x27e0('0x29')]]={'$like':'%'+_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3c')]+'%'};return _0x2763ec;}})});}_0x141c40=_['merge']({},_0x141c40,_0x29114d['options']);var _0x5f5b65={'where':_0x141c40[_0x27e0('0x3a')]};return db[_0x27e0('0x2b')]['count'](_0x5f5b65)['then'](function(_0x4a6856){_0x57bcc1[_0x27e0('0x21')]=_0x4a6856;if(_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x141c40[_0x27e0('0x3f')]=[{'all':!![]}];}return db[_0x27e0('0x2b')][_0x27e0('0x40')](_0x141c40);})[_0x27e0('0x24')](function(_0x3f81ba){_0x57bcc1[_0x27e0('0x41')]=_0x3f81ba;return _0x57bcc1;})[_0x27e0('0x24')](respondWithFilteredResult(_0x3e2c4b,_0x141c40))[_0x27e0('0x42')](handleError(_0x3e2c4b,null));};exports[_0x27e0('0x43')]=function(_0x4227c0,_0x6c37db){var _0x2f6005={'raw':!![],'where':{'id':_0x4227c0['params']['id']}},_0x535260={};_0x535260[_0x27e0('0x2e')]=_[_0x27e0('0x30')](db['JscriptyAnswerReport']['rawAttributes']);_0x535260['query']=_[_0x27e0('0x30')](_0x4227c0[_0x27e0('0x2f')]);_0x535260['filters']=_['intersection'](_0x535260[_0x27e0('0x2e')],_0x535260[_0x27e0('0x2f')]);_0x2f6005[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x535260[_0x27e0('0x2e')],qs[_0x27e0('0x34')](_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x2f6005[_0x27e0('0x33')]=_0x2f6005[_0x27e0('0x33')][_0x27e0('0x35')]?_0x2f6005[_0x27e0('0x33')]:_0x535260[_0x27e0('0x2e')];if(_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x2f6005[_0x27e0('0x3f')]=[{'all':!![]}];}_0x2f6005=_[_0x27e0('0x3d')]({},_0x2f6005,_0x4227c0[_0x27e0('0x44')]);return db[_0x27e0('0x2b')][_0x27e0('0x45')](_0x2f6005)[_0x27e0('0x24')](handleEntityNotFound(_0x6c37db,null))[_0x27e0('0x24')](respondWithResult(_0x6c37db,null))[_0x27e0('0x42')](handleError(_0x6c37db,null));};exports[_0x27e0('0x46')]=function(_0x24058f,_0x22cd05){return db[_0x27e0('0x2b')][_0x27e0('0x46')](_0x24058f['body'],{})['then'](respondWithResult(_0x22cd05,0xc9))[_0x27e0('0x42')](handleError(_0x22cd05,null));};exports[_0x27e0('0x47')]=function(_0x5322c9,_0x58aef9){if(_0x5322c9[_0x27e0('0x48')]['id']){delete _0x5322c9[_0x27e0('0x48')]['id'];}return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0x5322c9[_0x27e0('0x49')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0x58aef9,null))[_0x27e0('0x24')](saveUpdates(_0x5322c9['body'],null))['then'](respondWithResult(_0x58aef9,null))[_0x27e0('0x42')](handleError(_0x58aef9,null));};exports[_0x27e0('0x25')]=function(_0xca08c,_0x29241d){return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0xca08c['params']['id']}})['then'](handleEntityNotFound(_0x29241d,null))[_0x27e0('0x24')](removeEntity(_0x29241d,null))[_0x27e0('0x42')](handleError(_0x29241d,null));};exports[_0x27e0('0x4a')]=function(_0x315f2f,_0x4d7f5a){return db['JscriptyAnswerReport'][_0x27e0('0x4a')]()[_0x27e0('0x24')](respondWithResult(_0x4d7f5a,null))['catch'](handleError(_0x4d7f5a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index dde12c1..84748b6 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 _0x0e0d=['../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0x0e0d,0x68));var _0xd0e0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0e0d[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0xd0e0('0x0'));var logger=require(_0xd0e0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd0e0('0x2'));var rp=require(_0xd0e0('0x3'));var fs=require('fs');var path=require(_0xd0e0('0x4'));var rimraf=require(_0xd0e0('0x5'));var config=require(_0xd0e0('0x6'));var attributes=require(_0xd0e0('0x7'));module[_0xd0e0('0x8')]=function(_0x3e507c,_0x204b65){return _0x3e507c['define'](_0xd0e0('0x9'),attributes,{'tableName':_0xd0e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e89=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x8e89,0x10e));var _0x98e8=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0x8e89[_0x58ee19];return _0x49af25;};'use strict';var _=require(_0x98e8('0x0'));var util=require('util');var logger=require(_0x98e8('0x1'))(_0x98e8('0x2'));var moment=require(_0x98e8('0x3'));var BPromise=require(_0x98e8('0x4'));var rp=require(_0x98e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x98e8('0x7'));module[_0x98e8('0x8')]=function(_0xe62424,_0x2aa8c9){return _0xe62424[_0x98e8('0x9')](_0x98e8('0xa'),attributes,{'tableName':_0x98e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b8db4b5..78f7ded 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 _0xe600=['stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x104884,_0x317705){var _0x1f6634=function(_0x4b2388){while(--_0x4b2388){_0x104884['push'](_0x104884['shift']());}};_0x1f6634(++_0x317705);}(_0xe600,0x116));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0e60('0x0'));var util=require(_0x0e60('0x1'));var moment=require(_0x0e60('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e60('0x8'));var client=jayson[_0x0e60('0x9')][_0x0e60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c5f4,_0x5e33d9,_0x48ff78){return new BPromise(function(_0x2c132a,_0x54e42e){return client[_0x0e60('0xb')](_0x36c5f4,_0x48ff78)[_0x0e60('0xc')](function(_0x5bb339){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x5e33d9,_0x0e60('0xf'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5e33d9,_0x0e60('0xf'),JSON[_0x0e60('0x10')](_0x5bb339));if(_0x5bb339[_0x0e60('0x11')]){if(_0x5bb339[_0x0e60('0x11')][_0x0e60('0x12')]===0x1f4){logger[_0x0e60('0x11')](_0x0e60('0xe'),_0x5e33d9,_0x5bb339['error'][_0x0e60('0x13')]);return _0x54e42e(_0x5bb339[_0x0e60('0x11')][_0x0e60('0x13')]);}logger['error'](_0x0e60('0xe'),_0x5e33d9,_0x5bb339['error'][_0x0e60('0x13')]);return _0x2c132a(_0x5bb339[_0x0e60('0x11')][_0x0e60('0x13')]);}else{logger[_0x0e60('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5e33d9,_0x0e60('0xf'));_0x2c132a(_0x5bb339['result'][_0x0e60('0x13')]);}})[_0x0e60('0x14')](function(_0x67a295){logger['error'](_0x0e60('0xe'),_0x5e33d9,_0x67a295);_0x54e42e(_0x67a295);});});} \ No newline at end of file +var _0x3b20=['request','then','info','request\x20sent','debug','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x3b20,0x17b));var _0x03b2=function(_0x4cd68e,_0x526991){_0x4cd68e=_0x4cd68e-0x0;var _0x300170=_0x3b20[_0x4cd68e];return _0x300170;};'use strict';var _=require(_0x03b2('0x0'));var util=require(_0x03b2('0x1'));var moment=require('moment');var BPromise=require(_0x03b2('0x2'));var rs=require(_0x03b2('0x3'));var fs=require('fs');var Redis=require(_0x03b2('0x4'));var db=require(_0x03b2('0x5'))['db'];var utils=require(_0x03b2('0x6'));var logger=require(_0x03b2('0x7'))('rpc');var config=require(_0x03b2('0x8'));var jayson=require(_0x03b2('0x9'));var client=jayson[_0x03b2('0xa')][_0x03b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6c7f,_0x3958e9,_0x575beb){return new BPromise(function(_0x538081,_0x4dadfc){return client[_0x03b2('0xc')](_0x2b6c7f,_0x575beb)[_0x03b2('0xd')](function(_0x4ff4f2){logger[_0x03b2('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3958e9,_0x03b2('0xf'));logger[_0x03b2('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3958e9,'request\x20sent',JSON[_0x03b2('0x11')](_0x4ff4f2));if(_0x4ff4f2[_0x03b2('0x12')]){if(_0x4ff4f2[_0x03b2('0x12')][_0x03b2('0x13')]===0x1f4){logger['error'](_0x03b2('0x14'),_0x3958e9,_0x4ff4f2[_0x03b2('0x12')][_0x03b2('0x15')]);return _0x4dadfc(_0x4ff4f2[_0x03b2('0x12')][_0x03b2('0x15')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3958e9,_0x4ff4f2['error'][_0x03b2('0x15')]);return _0x538081(_0x4ff4f2['error'][_0x03b2('0x15')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3958e9,_0x03b2('0xf'));_0x538081(_0x4ff4f2['result'][_0x03b2('0x15')]);}})[_0x03b2('0x16')](function(_0x434990){logger[_0x03b2('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3958e9,_0x434990);_0x4dadfc(_0x434990);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 39fa319..109a8ab 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 _0x5385=['./jscriptyProject.controller','get','isAuthenticated','index','/:id','getSessions','/:id/answers','getAnswers','30s','post','create','clone','put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5385,0x10a));var _0x5538=function(_0x229612,_0xf55e16){_0x229612=_0x229612-0x0;var _0x4fafc7=_0x5385[_0x229612];return _0x4fafc7;};'use strict';var multer=require('multer');var util=require(_0x5538('0x0'));var path=require(_0x5538('0x1'));var timeout=require(_0x5538('0x2'));var express=require(_0x5538('0x3'));var router=express[_0x5538('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5538('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5538('0x6'));var controller=require(_0x5538('0x7'));router[_0x5538('0x8')]('/',auth[_0x5538('0x9')](),controller[_0x5538('0xa')]);router[_0x5538('0x8')](_0x5538('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5538('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x5538('0xc')]);router[_0x5538('0x8')](_0x5538('0xd'),auth['isAuthenticated'](),controller[_0x5538('0xe')]);router[_0x5538('0x8')]('/:id/summary',auth[_0x5538('0x9')](),timeout(_0x5538('0xf')),controller['getSummary']);router[_0x5538('0x10')]('/',auth['isAuthenticated'](),controller[_0x5538('0x11')]);router[_0x5538('0x10')]('/:id/clone',auth[_0x5538('0x9')](),controller[_0x5538('0x12')]);router[_0x5538('0x13')](_0x5538('0xb'),auth['isAuthenticated'](),controller[_0x5538('0x14')]);router['delete'](_0x5538('0xb'),auth[_0x5538('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x090b=['index','/:id/sessions','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','clone','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x1378af,_0x548358){var _0x1d6dc7=function(_0x564d2a){while(--_0x564d2a){_0x1378af['push'](_0x1378af['shift']());}};_0x1d6dc7(++_0x548358);}(_0x090b,0x115));var _0xb090=function(_0x49a419,_0x4fb0cc){_0x49a419=_0x49a419-0x0;var _0x27a808=_0x090b[_0x49a419];return _0x27a808;};'use strict';var multer=require(_0xb090('0x0'));var util=require(_0xb090('0x1'));var path=require(_0xb090('0x2'));var timeout=require(_0xb090('0x3'));var express=require(_0xb090('0x4'));var router=express[_0xb090('0x5')]();var fs_extra=require(_0xb090('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb090('0x7'));var config=require('../../config/environment');var controller=require(_0xb090('0x8'));router[_0xb090('0x9')]('/',auth[_0xb090('0xa')](),controller[_0xb090('0xb')]);router[_0xb090('0x9')]('/:id',auth[_0xb090('0xa')](),controller['show']);router[_0xb090('0x9')](_0xb090('0xc'),auth['isAuthenticated'](),controller['getSessions']);router[_0xb090('0x9')]('/:id/answers',auth[_0xb090('0xa')](),controller[_0xb090('0xd')]);router['get'](_0xb090('0xe'),auth[_0xb090('0xa')](),timeout('30s'),controller[_0xb090('0xf')]);router['post']('/',auth[_0xb090('0xa')](),controller[_0xb090('0x10')]);router[_0xb090('0x11')](_0xb090('0x12'),auth[_0xb090('0xa')](),controller[_0xb090('0x13')]);router[_0xb090('0x14')](_0xb090('0x15'),auth[_0xb090('0xa')](),controller[_0xb090('0x16')]);router['delete'](_0xb090('0x15'),auth[_0xb090('0xa')](),controller[_0xb090('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index f26a854..c7294d4 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 _0x83e5=['setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString'];(function(_0x4c038e,_0x188229){var _0x237ec4=function(_0x56bf64){while(--_0x56bf64){_0x4c038e['push'](_0x4c038e['shift']());}};_0x237ec4(++_0x188229);}(_0x83e5,0x1e5));var _0x583e=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0x83e5[_0x36fbef];return _0x45e270;};'use strict';var Sequelize=require('sequelize');var _=require(_0x583e('0x0'));var util=require(_0x583e('0x1'));module['exports']={'name':{'type':Sequelize[_0x583e('0x2')],'unique':_0x583e('0x3')},'description':{'type':Sequelize[_0x583e('0x2')]},'formData':{'type':Sequelize[_0x583e('0x4')](_0x583e('0x5')),'set':function(_0x47746e){if(_[_0x583e('0x6')](_0x47746e)){this['setDataValue'](_0x583e('0x7'),JSON[_0x583e('0x8')](_0x47746e));}else if(_[_0x583e('0x9')](_0x47746e)){this[_0x583e('0xa')](_0x583e('0x7'),_0x47746e);}else{this[_0x583e('0xa')](_0x583e('0x7'),util['format'](_0x583e('0xb'),this['getDataValue'](_0x583e('0x3'))||'',this[_0x583e('0xc')](_0x583e('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x583e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x583e('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x6e27=['setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','formData','stringify','isString'];(function(_0x1e5725,_0x3f4e13){var _0x4b5cf8=function(_0x2e9a53){while(--_0x2e9a53){_0x1e5725['push'](_0x1e5725['shift']());}};_0x4b5cf8(++_0x3f4e13);}(_0x6e27,0x6d));var _0x76e2=function(_0x174ecd,_0x30cde6){_0x174ecd=_0x174ecd-0x0;var _0x316657=_0x6e27[_0x174ecd];return _0x316657;};'use strict';var Sequelize=require(_0x76e2('0x0'));var _=require(_0x76e2('0x1'));var util=require(_0x76e2('0x2'));module[_0x76e2('0x3')]={'name':{'type':Sequelize[_0x76e2('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x76e2('0x4')]},'formData':{'type':Sequelize[_0x76e2('0x5')](_0x76e2('0x6')),'set':function(_0xce7c24){if(_['isObjectLike'](_0xce7c24)){this['setDataValue'](_0x76e2('0x7'),JSON[_0x76e2('0x8')](_0xce7c24));}else if(_[_0x76e2('0x9')](_0xce7c24)){this[_0x76e2('0xa')]('formData',_0xce7c24);}else{this[_0x76e2('0xa')](_0x76e2('0x7'),util[_0x76e2('0xb')](_0x76e2('0xc'),this[_0x76e2('0xd')](_0x76e2('0xe'))||'',this['getDataValue'](_0x76e2('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x76e2('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e3b6e06..f7c510d 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 _0xc87b=['JscriptyProject','findAll','catch','params','rawAttributes','includeAll','include','options','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','error','stack','name','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc87b,0xb2));var _0xbc87=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xc87b[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0xbc87('0x0'));var rimraf=require(_0xbc87('0x1'));var zipdir=require(_0xbc87('0x2'));var jsonpatch=require(_0xbc87('0x3'));var rp=require('request-promise');var moment=require(_0xbc87('0x4'));var BPromise=require(_0xbc87('0x5'));var Mustache=require(_0xbc87('0x6'));var util=require('util');var path=require(_0xbc87('0x7'));var sox=require(_0xbc87('0x8'));var csv=require(_0xbc87('0x9'));var ejs=require(_0xbc87('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc87('0xb'));var squel=require(_0xbc87('0xc'));var crypto=require(_0xbc87('0xd'));var jsforce=require(_0xbc87('0xe'));var deskjs=require(_0xbc87('0xf'));var toCsv=require(_0xbc87('0x9'));var querystring=require(_0xbc87('0x10'));var Papa=require(_0xbc87('0x11'));var Redis=require(_0xbc87('0x12'));var authService=require(_0xbc87('0x13'));var qs=require(_0xbc87('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc87('0x15'));var logger=require('../../config/logger')(_0xbc87('0x16'));var utils=require(_0xbc87('0x17'));var config=require(_0xbc87('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc87('0x19'))['db'];function respondWithStatusCode(_0x3b1906,_0x51a0f0){_0x51a0f0=_0x51a0f0||0xcc;return function(_0x9d0643){if(_0x9d0643){return _0x3b1906[_0xbc87('0x1a')](_0x51a0f0);}return _0x3b1906['status'](_0x51a0f0)[_0xbc87('0x1b')]();};}function respondWithResult(_0x1a8760,_0x4feea6){_0x4feea6=_0x4feea6||0xc8;return function(_0x2b4778){if(_0x2b4778){return _0x1a8760[_0xbc87('0x1c')](_0x4feea6)[_0xbc87('0x1d')](_0x2b4778);}};}function respondWithFilteredResult(_0x472dab,_0x3afc9f){return function(_0x2c3488){if(_0x2c3488){var _0x56c22c=typeof _0x3afc9f['offset']===_0xbc87('0x1e')&&typeof _0x3afc9f[_0xbc87('0x1f')]===_0xbc87('0x1e');var _0x5e6700=_0x2c3488[_0xbc87('0x20')];var _0x461031=_0x56c22c?0x0:_0x3afc9f[_0xbc87('0x21')];var _0x5beeb1=_0x56c22c?_0x2c3488[_0xbc87('0x20')]:_0x3afc9f[_0xbc87('0x21')]+_0x3afc9f[_0xbc87('0x1f')];var _0x46068d;if(_0x5beeb1>=_0x5e6700){_0x5beeb1=_0x5e6700;_0x46068d=0xc8;}else{_0x46068d=0xce;}_0x472dab[_0xbc87('0x1c')](_0x46068d);return _0x472dab[_0xbc87('0x22')](_0xbc87('0x23'),_0x461031+'-'+_0x5beeb1+'/'+_0x5e6700)[_0xbc87('0x1d')](_0x2c3488);}return null;};}function patchUpdates(_0x51d0a4){return function(_0x52e885){try{jsonpatch[_0xbc87('0x24')](_0x52e885,_0x51d0a4,!![]);}catch(_0x22cbd9){return BPromise[_0xbc87('0x25')](_0x22cbd9);}return _0x52e885[_0xbc87('0x26')]();};}function saveUpdates(_0x320102,_0x1bc01e){return function(_0x3edfd5){if(_0x3edfd5){return _0x3edfd5[_0xbc87('0x27')](_0x320102)['then'](function(_0x54036c){return _0x54036c;});}return null;};}function removeEntity(_0x41d595,_0x5860e4){return function(_0x1c6ef8){if(_0x1c6ef8){return _0x1c6ef8[_0xbc87('0x28')]()[_0xbc87('0x29')](function(){var _0x5aee55=_0x1c6ef8[_0xbc87('0x2a')]({'plain':!![]});var _0x3bf85d=_0xbc87('0x2b');return db[_0xbc87('0x2c')][_0xbc87('0x28')]({'where':{'type':_0x3bf85d,'resourceId':_0x5aee55['id']}})['then'](function(){return _0x1c6ef8;});})[_0xbc87('0x29')](function(){_0x41d595['status'](0xcc)[_0xbc87('0x1b')]();});}};}function handleEntityNotFound(_0x3c36f7,_0x59dc4b){return function(_0x96be38){if(!_0x96be38){_0x3c36f7[_0xbc87('0x1a')](0x194);}return _0x96be38;};}function handleError(_0x474215,_0x3155a1){_0x3155a1=_0x3155a1||0x1f4;return function(_0x1b5fd6){logger[_0xbc87('0x2d')](_0x1b5fd6[_0xbc87('0x2e')]);if(_0x1b5fd6['name']){delete _0x1b5fd6[_0xbc87('0x2f')];}_0x474215[_0xbc87('0x1c')](_0x3155a1)[_0xbc87('0x30')](_0x1b5fd6);};}exports[_0xbc87('0x31')]=function(_0x480d2e,_0x1fe23a){var _0x404dfb={},_0xfb3168={},_0x400769={'count':0x0,'rows':[]};var _0x312ebd=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x5c6a0d){return{'name':_0x5c6a0d['fieldName'],'type':_0x5c6a0d['type'][_0xbc87('0x32')]};});_0xfb3168[_0xbc87('0x33')]=_[_0xbc87('0x34')](_0x312ebd,_0xbc87('0x2f'));_0xfb3168[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x480d2e['query']);_0xfb3168[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0xfb3168['model'],_0xfb3168[_0xbc87('0x35')]);_0x404dfb[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0xfb3168[_0xbc87('0x33')],qs[_0xbc87('0x3a')](_0x480d2e['query'][_0xbc87('0x3a')]));_0x404dfb[_0xbc87('0x39')]=_0x404dfb[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x404dfb[_0xbc87('0x39')]:_0xfb3168['model'];if(!_0x480d2e[_0xbc87('0x35')][_0xbc87('0x3c')](_0xbc87('0x3d'))){_0x404dfb[_0xbc87('0x1f')]=qs[_0xbc87('0x1f')](_0x480d2e[_0xbc87('0x35')][_0xbc87('0x1f')]);_0x404dfb[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0x480d2e['query'][_0xbc87('0x21')]);}_0x404dfb['order']=qs[_0xbc87('0x3e')](_0x480d2e[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x404dfb[_0xbc87('0x3f')]=qs[_0xbc87('0x37')](_[_0xbc87('0x40')](_0x480d2e[_0xbc87('0x35')],_0xfb3168[_0xbc87('0x37')]),_0x312ebd);if(_0x480d2e[_0xbc87('0x35')][_0xbc87('0x41')]){_0x404dfb[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x404dfb['where'],{'$or':_[_0xbc87('0x34')](_0x312ebd,function(_0x455537){if(_0x455537[_0xbc87('0x43')]!=='VIRTUAL'){var _0xdfec35={};_0xdfec35[_0x455537[_0xbc87('0x2f')]]={'$like':'%'+_0x480d2e[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0xdfec35;}})});}_0x404dfb=_[_0xbc87('0x42')]({},_0x404dfb,_0x480d2e['options']);var _0xfd7e4d={'where':_0x404dfb[_0xbc87('0x3f')]};return db[_0xbc87('0x44')][_0xbc87('0x20')](_0xfd7e4d)[_0xbc87('0x29')](function(_0x427a3b){_0x400769[_0xbc87('0x20')]=_0x427a3b;if(_0x480d2e['query']['includeAll']){_0x404dfb['include']=[{'all':!![]}];}return db[_0xbc87('0x44')][_0xbc87('0x45')](_0x404dfb);})['then'](function(_0x1d73b0){_0x400769['rows']=_0x1d73b0;return _0x400769;})[_0xbc87('0x29')](respondWithFilteredResult(_0x1fe23a,_0x404dfb))[_0xbc87('0x46')](handleError(_0x1fe23a,null));};exports['show']=function(_0x45a0cb,_0x2121b1){var _0x3ac1f5={'raw':![],'where':{'id':_0x45a0cb[_0xbc87('0x47')]['id']}},_0xe1870a={};_0xe1870a[_0xbc87('0x33')]=_['keys'](db[_0xbc87('0x44')][_0xbc87('0x48')]);_0xe1870a[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x45a0cb[_0xbc87('0x35')]);_0xe1870a['filters']=_[_0xbc87('0x38')](_0xe1870a[_0xbc87('0x33')],_0xe1870a['query']);_0x3ac1f5['attributes']=_[_0xbc87('0x38')](_0xe1870a['model'],qs[_0xbc87('0x3a')](_0x45a0cb[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x3ac1f5[_0xbc87('0x39')]=_0x3ac1f5[_0xbc87('0x39')]['length']?_0x3ac1f5[_0xbc87('0x39')]:_0xe1870a['model'];if(_0x45a0cb[_0xbc87('0x35')][_0xbc87('0x49')]){_0x3ac1f5[_0xbc87('0x4a')]=[{'all':!![]}];}_0x3ac1f5=_[_0xbc87('0x42')]({},_0x3ac1f5,_0x45a0cb[_0xbc87('0x4b')]);return db[_0xbc87('0x44')][_0xbc87('0x4c')](_0x3ac1f5)[_0xbc87('0x29')](handleEntityNotFound(_0x2121b1,null))[_0xbc87('0x29')](respondWithResult(_0x2121b1,null))[_0xbc87('0x46')](handleError(_0x2121b1,null));};exports[_0xbc87('0x4d')]=function(_0x2f66f1,_0x225fbe){return db[_0xbc87('0x44')][_0xbc87('0x4d')](_0x2f66f1[_0xbc87('0x4e')],{})[_0xbc87('0x29')](function(_0x530b9c){var _0x6497c1=_0x2f66f1['user'][_0xbc87('0x2a')]({'plain':!![]});if(!_0x6497c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6497c1[_0xbc87('0x4f')]===_0xbc87('0x50')){var _0x578d96=_0x530b9c[_0xbc87('0x2a')]({'plain':!![]});var _0x38ca58=_0xbc87('0x2b');return db[_0xbc87('0x51')][_0xbc87('0x4c')]({'where':{'name':_0x38ca58,'userProfileId':_0x6497c1['userProfileId']},'raw':!![]})[_0xbc87('0x29')](function(_0x40cdc1){if(_0x40cdc1&&_0x40cdc1[_0xbc87('0x52')]===0x0){return db[_0xbc87('0x2c')][_0xbc87('0x4d')]({'name':_0x578d96['name'],'resourceId':_0x578d96['id'],'type':_0x40cdc1[_0xbc87('0x2f')],'sectionId':_0x40cdc1['id']},{})['then'](function(){return _0x530b9c;});}else{return _0x530b9c;}})[_0xbc87('0x46')](function(_0x5f2a82){logger[_0xbc87('0x2d')](_0xbc87('0x53'),_0x5f2a82);throw _0x5f2a82;});}return _0x530b9c;})['then'](respondWithResult(_0x225fbe,0xc9))[_0xbc87('0x46')](handleError(_0x225fbe,null));};exports[_0xbc87('0x54')]=function(_0x112cc7,_0x12109e){var _0x12c4d1={'where':{'id':_0x112cc7['params']['id']}},_0x48294c={};_0x48294c[_0xbc87('0x33')]=_['keys'](db[_0xbc87('0x44')][_0xbc87('0x48')]);_0x12c4d1['attributes']=_[_0xbc87('0x38')](_0x48294c['model'],qs['fields'](_0x112cc7[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x12c4d1[_0xbc87('0x39')]=_0x12c4d1[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x12c4d1[_0xbc87('0x39')]:_0x48294c['model'];if(_0x112cc7['query'][_0xbc87('0x49')]){_0x12c4d1[_0xbc87('0x4a')]=[{'all':!![]}];}_0x12c4d1=_[_0xbc87('0x42')]({},_0x12c4d1,_0x112cc7[_0xbc87('0x4b')]);return db[_0xbc87('0x44')][_0xbc87('0x4c')](_0x12c4d1)[_0xbc87('0x29')](handleEntityNotFound(_0x12109e,null))[_0xbc87('0x29')](function(_0x397b93){if(_0x397b93){var _0x38e4c7=_0x397b93[_0xbc87('0x2a')]({'plain':!![]});_0x38e4c7=qs[_0xbc87('0x55')](_0x38e4c7,['id',_0xbc87('0x56'),_0xbc87('0x57')]);_0x112cc7[_0xbc87('0x4e')]=_[_0xbc87('0x55')](_0x112cc7[_0xbc87('0x4e')],['id',_0xbc87('0x56'),_0xbc87('0x57')]);return db[_0xbc87('0x44')][_0xbc87('0x4d')](_[_0xbc87('0x42')](_0x38e4c7,_0x112cc7[_0xbc87('0x4e')]),{'include':_0x112cc7[_0xbc87('0x35')][_0xbc87('0x49')]?[{'all':!![]}]:undefined})[_0xbc87('0x29')](function(_0x14b27c){var _0x289ad4=_0x112cc7[_0xbc87('0x50')][_0xbc87('0x2a')]({'plain':!![]});if(!_0x289ad4)throw new Error(_0xbc87('0x58'));if(_0x289ad4['role']==='user'){var _0x566414=_0x14b27c[_0xbc87('0x2a')]({'plain':!![]});var _0x257535=_0xbc87('0x2b');return db[_0xbc87('0x51')][_0xbc87('0x4c')]({'where':{'name':_0x257535,'userProfileId':_0x289ad4['userProfileId']},'raw':!![]})[_0xbc87('0x29')](function(_0x70600c){if(_0x70600c&&_0x70600c[_0xbc87('0x52')]===0x0){return db[_0xbc87('0x2c')][_0xbc87('0x4d')]({'name':_0x566414[_0xbc87('0x2f')],'resourceId':_0x566414['id'],'type':_0x70600c[_0xbc87('0x2f')],'sectionId':_0x70600c['id']},{})[_0xbc87('0x29')](function(){return _0x14b27c;});}else{return _0x14b27c;}})[_0xbc87('0x46')](function(_0x57e426){logger[_0xbc87('0x2d')](_0xbc87('0x53'),_0x57e426);throw _0x57e426;});}return _0x14b27c;});}})[_0xbc87('0x29')](respondWithResult(_0x12109e,0xc9))[_0xbc87('0x46')](handleError(_0x12109e,null));};exports[_0xbc87('0x27')]=function(_0xd8b455,_0x4c14cd){if(_0xd8b455['body']['id']){delete _0xd8b455['body']['id'];}return db[_0xbc87('0x44')]['find']({'where':{'id':_0xd8b455[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x4c14cd,null))['then'](saveUpdates(_0xd8b455[_0xbc87('0x4e')],null))[_0xbc87('0x29')](respondWithResult(_0x4c14cd,null))[_0xbc87('0x46')](handleError(_0x4c14cd,null));};exports['destroy']=function(_0x5e4885,_0x332bcb){return db['JscriptyProject'][_0xbc87('0x4c')]({'where':{'id':_0x5e4885[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x332bcb,null))[_0xbc87('0x29')](removeEntity(_0x332bcb,null))[_0xbc87('0x46')](handleError(_0x332bcb,null));};exports[_0xbc87('0x59')]=function(_0x2745c4,_0x3f666a,_0x421d1f){var _0x1659d7={'raw':!![],'where':{}};var _0x62bb40={};var _0x26e0f5={'count':0x0,'rows':[]};return db[_0xbc87('0x44')][_0xbc87('0x5a')]({'where':{'id':_0x2745c4[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x3f666a,null))[_0xbc87('0x29')](function(_0x295b5c){if(_0x295b5c){_0x62bb40[_0xbc87('0x33')]=_[_0xbc87('0x36')](db[_0xbc87('0x5b')][_0xbc87('0x48')]);_0x62bb40[_0xbc87('0x35')]=_[_0xbc87('0x36')](_0x2745c4['query']);_0x62bb40[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0x62bb40[_0xbc87('0x33')],_0x62bb40['query']);_0x1659d7[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0x62bb40[_0xbc87('0x33')],qs[_0xbc87('0x3a')](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3a')]));_0x1659d7[_0xbc87('0x39')]=_0x1659d7[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x1659d7[_0xbc87('0x39')]:_0x62bb40[_0xbc87('0x33')];if(!_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3c')]('nolimit')){_0x1659d7[_0xbc87('0x1f')]=qs['limit'](_0x2745c4['query'][_0xbc87('0x1f')]);_0x1659d7[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x21')]);}_0x1659d7[_0xbc87('0x5c')]=qs['sort'](_0x2745c4[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x1659d7[_0xbc87('0x3f')]=qs[_0xbc87('0x37')](_[_0xbc87('0x40')](_0x2745c4[_0xbc87('0x35')],_0x62bb40[_0xbc87('0x37')]));_0x1659d7[_0xbc87('0x3f')][_0xbc87('0x5d')]=_0x295b5c['id'];if(_0x2745c4['query'][_0xbc87('0x41')]){_0x1659d7[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x1659d7[_0xbc87('0x3f')],{'$or':_[_0xbc87('0x34')](_0x1659d7[_0xbc87('0x39')],function(_0x26891a){var _0x10d04a={};_0x10d04a[_0x26891a]={'$like':'%'+_0x2745c4[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0x10d04a;})});}_0x1659d7=_['merge']({},_0x1659d7,_0x2745c4[_0xbc87('0x4b')]);return db[_0xbc87('0x5b')][_0xbc87('0x20')]({'where':_0x1659d7[_0xbc87('0x3f')]})['then'](function(_0x3ebd6b){_0x26e0f5['count']=_0x3ebd6b;if(_0x2745c4[_0xbc87('0x35')][_0xbc87('0x49')]){_0x1659d7['include']=[{'all':!![]}];}return db[_0xbc87('0x5b')]['findAll'](_0x1659d7);})['then'](function(_0x4c912c){_0x26e0f5[_0xbc87('0x5e')]=_0x4c912c;return _0x26e0f5;});}})[_0xbc87('0x29')](respondWithFilteredResult(_0x3f666a,_0x1659d7))['catch'](handleError(_0x3f666a,null));};exports[_0xbc87('0x5f')]=function(_0xa2b9a4,_0x509623,_0x2a8171){var _0x40d9a8={'raw':!![],'where':{}};var _0xfdd155={};var _0x4a979e={'count':0x0,'rows':[]};return db[_0xbc87('0x44')][_0xbc87('0x5a')]({'where':{'id':_0xa2b9a4[_0xbc87('0x47')]['id']}})[_0xbc87('0x29')](handleEntityNotFound(_0x509623,null))['then'](function(_0x1d0d57){if(_0x1d0d57){_0xfdd155['model']=_[_0xbc87('0x36')](db[_0xbc87('0x60')][_0xbc87('0x48')]);_0xfdd155['query']=_[_0xbc87('0x36')](_0xa2b9a4['query']);_0xfdd155[_0xbc87('0x37')]=_[_0xbc87('0x38')](_0xfdd155[_0xbc87('0x33')],_0xfdd155[_0xbc87('0x35')]);_0x40d9a8[_0xbc87('0x39')]=_[_0xbc87('0x38')](_0xfdd155[_0xbc87('0x33')],qs['fields'](_0xa2b9a4['query'][_0xbc87('0x3a')]));_0x40d9a8[_0xbc87('0x39')]=_0x40d9a8[_0xbc87('0x39')][_0xbc87('0x3b')]?_0x40d9a8[_0xbc87('0x39')]:_0xfdd155[_0xbc87('0x33')];if(!_0xa2b9a4['query'][_0xbc87('0x3c')]('nolimit')){_0x40d9a8[_0xbc87('0x1f')]=qs[_0xbc87('0x1f')](_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x1f')]);_0x40d9a8[_0xbc87('0x21')]=qs[_0xbc87('0x21')](_0xa2b9a4[_0xbc87('0x35')]['offset']);}_0x40d9a8[_0xbc87('0x5c')]=qs['sort'](_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x3e')]);_0x40d9a8['where']=qs['filters'](_[_0xbc87('0x40')](_0xa2b9a4['query'],_0xfdd155[_0xbc87('0x37')]));_0x40d9a8['where']['ProjectId']=_0x1d0d57['id'];if(_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x41')]){_0x40d9a8[_0xbc87('0x3f')]=_[_0xbc87('0x42')](_0x40d9a8[_0xbc87('0x3f')],{'$or':_[_0xbc87('0x34')](_0x40d9a8[_0xbc87('0x39')],function(_0x8bce11){var _0xe8096d={};_0xe8096d[_0x8bce11]={'$like':'%'+_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x41')]+'%'};return _0xe8096d;})});}_0x40d9a8=_[_0xbc87('0x42')]({},_0x40d9a8,_0xa2b9a4[_0xbc87('0x4b')]);return db[_0xbc87('0x60')][_0xbc87('0x20')]({'where':_0x40d9a8['where']})['then'](function(_0x2c828f){_0x4a979e[_0xbc87('0x20')]=_0x2c828f;if(_0xa2b9a4[_0xbc87('0x35')][_0xbc87('0x49')]){_0x40d9a8['include']=[{'all':!![]}];}return db[_0xbc87('0x60')][_0xbc87('0x45')](_0x40d9a8);})[_0xbc87('0x29')](function(_0xb35e01){_0x4a979e[_0xbc87('0x5e')]=_0xb35e01;return _0x4a979e;});}})[_0xbc87('0x29')](respondWithFilteredResult(_0x509623,_0x40d9a8))['catch'](handleError(_0x509623,null));};function char(_0x37597f){return _0xbc87('0x61')===typeof _0x37597f?String[_0xbc87('0x62')]['apply'](null,arguments):_0x37597f;}function needsEncapsulation(_0x4e002e){return!!_0x4e002e&&(_0x4e002e['toString']()[_0xbc87('0x63')](char(0xd))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0xa))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0x2c))>=0x0||_0x4e002e[_0xbc87('0x64')]()[_0xbc87('0x63')](char(0x22))>=0x0);}function encapsulate(_0x15faf1){var _0x17043d=char(0x22),_0x30ae73='\x5c'+char(0x22),_0x4fd064=_0x15faf1[_0xbc87('0x64')]()[_0xbc87('0x65')](new RegExp(_0x17043d,'g'),_0x30ae73);return _0x17043d+_0x4fd064+_0x17043d;}exports[_0xbc87('0x66')]=function(_0x42f8c1,_0x48365f,_0x1313ff){var _0x40e4bc,_0x9c13dd;var _0x5e7a07={'where':{'ProjectId':_0x42f8c1[_0xbc87('0x47')]['id']}};if(_0x42f8c1[_0xbc87('0x35')]['startTime']){_0x5e7a07['where']['starttime']=JSON['parse'](_0x42f8c1[_0xbc87('0x35')][_0xbc87('0x67')]);}return db[_0xbc87('0x5b')][_0xbc87('0x45')](_0x5e7a07)['then'](handleEntityNotFound(_0x48365f,null))[_0xbc87('0x29')](function(_0x293421){if(_0x293421){_0x40e4bc=_0x293421;return db[_0xbc87('0x68')]['findAll']({'where':{'SessionId':{'$in':_[_0xbc87('0x34')](_0x40e4bc,'id')},'ProjectId':_0x42f8c1['params']['id']},'order':'-createdAt'});}})[_0xbc87('0x29')](handleEntityNotFound(_0x48365f,null))[_0xbc87('0x29')](function(_0x2517a4){if(_0x2517a4){_0x9c13dd=_0x2517a4;var _0x430eb4={};for(var _0x21dbb6=0x0,_0x424fbe=_0x9c13dd[_0xbc87('0x3b')];_0x21dbb6<_0x424fbe;_0x21dbb6++){if(!_0x430eb4[_0xbc87('0x3c')](_0x9c13dd[_0x21dbb6][_0xbc87('0x69')])){_0x430eb4[_0x9c13dd[_0x21dbb6][_0xbc87('0x69')]]=needsEncapsulation(_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')])?encapsulate(_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')]):_0x9c13dd[_0x21dbb6][_0xbc87('0x6a')];}}var _0x34fa7f=[],_0x275bb6={};for(var _0x3330f0=0x0,_0x106728=_0x40e4bc[_0xbc87('0x3b')];_0x3330f0<_0x106728;_0x3330f0++){_0x275bb6={'ProjectId':_0x42f8c1['params']['id'],'SessionId':_0x40e4bc[_0x3330f0]['id'],'StartTime':moment(_0x40e4bc[_0x3330f0][_0xbc87('0x6b')])['format'](_0xbc87('0x6c'))};for(var _0x4d6872=0x0,_0x496949=_0x9c13dd['length'];_0x4d6872<_0x496949;_0x4d6872++){if(_0x9c13dd[_0x4d6872][_0xbc87('0x6d')]==_0x40e4bc[_0x3330f0]['id']&&_0x430eb4[_0xbc87('0x3c')](_0x9c13dd[_0x4d6872][_0xbc87('0x69')])){_0x275bb6[_0x430eb4[_0x9c13dd[_0x4d6872][_0xbc87('0x69')]]]=_0x9c13dd[_0x4d6872]['answer'];}}for(var _0x3060e0 in _0x430eb4){if(!_0x275bb6[_0xbc87('0x3c')](_0x430eb4[_0x3060e0])){_0x275bb6[_0x430eb4[_0x3060e0]]=null;}}_0x34fa7f[_0xbc87('0x6e')](_0x275bb6);}return _0x34fa7f;}})['then'](function(_0x1ca4dc){if(!_[_0xbc87('0x6f')](_0x1ca4dc)){var _0x39feed=toCsv(_0x1ca4dc);var _0x347d85=Date[_0xbc87('0x70')]();fs[_0xbc87('0x71')](util['format'](_0xbc87('0x72'),_0x42f8c1[_0xbc87('0x47')]['id'],_0x347d85),_0x39feed);_0x48365f['setHeader'](_0xbc87('0x73'),_0xbc87('0x74')+util[_0xbc87('0x75')](_0xbc87('0x76'),_0x42f8c1[_0xbc87('0x47')]['id'],_0x347d85));_0x48365f[_0xbc87('0x77')](_0xbc87('0x78'),_0xbc87('0x79'));return _0x48365f[_0xbc87('0x7a')](util[_0xbc87('0x75')](_0xbc87('0x72'),_0x42f8c1['params']['id'],_0x347d85));}else{return _0x48365f[_0xbc87('0x1a')](0xcc);}})[_0xbc87('0x46')](handleError(_0x48365f,null));}; \ No newline at end of file +var _0x4dfc=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','Projects','UserProfileResource','stack','name','send','JscriptyProject','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','options','create','user','role','get','UserProfileSection','find','userProfileId','autoAssociation','error','clone','include','body','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','order','filter','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','ProjectId','map','rows','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x4cd832,_0x4d3ada){var _0x863d68=function(_0x3890e0){while(--_0x3890e0){_0x4cd832['push'](_0x4cd832['shift']());}};_0x863d68(++_0x4d3ada);}(_0x4dfc,0xda));var _0xc4df=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x4dfc[_0x67f95e];return _0x538f5a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc4df('0x0'));var rp=require(_0xc4df('0x1'));var moment=require(_0xc4df('0x2'));var BPromise=require(_0xc4df('0x3'));var Mustache=require(_0xc4df('0x4'));var util=require(_0xc4df('0x5'));var path=require(_0xc4df('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4df('0x7'));var _=require(_0xc4df('0x8'));var squel=require('squel');var crypto=require(_0xc4df('0x9'));var jsforce=require(_0xc4df('0xa'));var deskjs=require(_0xc4df('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc4df('0xc'));var Papa=require(_0xc4df('0xd'));var Redis=require(_0xc4df('0xe'));var authService=require(_0xc4df('0xf'));var qs=require(_0xc4df('0x10'));var as=require(_0xc4df('0x11'));var hardwareService=require(_0xc4df('0x12'));var logger=require(_0xc4df('0x13'))('api');var utils=require(_0xc4df('0x14'));var config=require(_0xc4df('0x15'));var licenseUtil=require(_0xc4df('0x16'));var db=require(_0xc4df('0x17'))['db'];function respondWithStatusCode(_0x863600,_0x665258){_0x665258=_0x665258||0xcc;return function(_0x3599c1){if(_0x3599c1){return _0x863600[_0xc4df('0x18')](_0x665258);}return _0x863600[_0xc4df('0x19')](_0x665258)[_0xc4df('0x1a')]();};}function respondWithResult(_0x70fae7,_0x157ea0){_0x157ea0=_0x157ea0||0xc8;return function(_0x2d1005){if(_0x2d1005){return _0x70fae7[_0xc4df('0x19')](_0x157ea0)[_0xc4df('0x1b')](_0x2d1005);}};}function respondWithFilteredResult(_0x8ac080,_0x5eeb1e){return function(_0xd72cc7){if(_0xd72cc7){var _0xc62bfa=typeof _0x5eeb1e['offset']==='undefined'&&typeof _0x5eeb1e[_0xc4df('0x1c')]===_0xc4df('0x1d');var _0x18d63=_0xd72cc7[_0xc4df('0x1e')];var _0x5e3e48=_0xc62bfa?0x0:_0x5eeb1e[_0xc4df('0x1f')];var _0x37e394=_0xc62bfa?_0xd72cc7[_0xc4df('0x1e')]:_0x5eeb1e[_0xc4df('0x1f')]+_0x5eeb1e['limit'];var _0x3c655c;if(_0x37e394>=_0x18d63){_0x37e394=_0x18d63;_0x3c655c=0xc8;}else{_0x3c655c=0xce;}_0x8ac080[_0xc4df('0x19')](_0x3c655c);return _0x8ac080[_0xc4df('0x20')](_0xc4df('0x21'),_0x5e3e48+'-'+_0x37e394+'/'+_0x18d63)[_0xc4df('0x1b')](_0xd72cc7);}return null;};}function patchUpdates(_0x4699ef){return function(_0x175d94){try{jsonpatch[_0xc4df('0x22')](_0x175d94,_0x4699ef,!![]);}catch(_0x179764){return BPromise[_0xc4df('0x23')](_0x179764);}return _0x175d94[_0xc4df('0x24')]();};}function saveUpdates(_0x156b52,_0x56bfa7){return function(_0x4fa99a){if(_0x4fa99a){return _0x4fa99a['update'](_0x156b52)[_0xc4df('0x25')](function(_0x5839fb){return _0x5839fb;});}return null;};}function removeEntity(_0x4bd822,_0x58bf45){return function(_0x547c5b){if(_0x547c5b){return _0x547c5b[_0xc4df('0x26')]()[_0xc4df('0x25')](function(){var _0x553345=_0x547c5b['get']({'plain':!![]});var _0x3ee721=_0xc4df('0x27');return db[_0xc4df('0x28')][_0xc4df('0x26')]({'where':{'type':_0x3ee721,'resourceId':_0x553345['id']}})['then'](function(){return _0x547c5b;});})[_0xc4df('0x25')](function(){_0x4bd822[_0xc4df('0x19')](0xcc)[_0xc4df('0x1a')]();});}};}function handleEntityNotFound(_0x1efdcf,_0x4c9f87){return function(_0x21eef3){if(!_0x21eef3){_0x1efdcf[_0xc4df('0x18')](0x194);}return _0x21eef3;};}function handleError(_0x308749,_0x43e84f){_0x43e84f=_0x43e84f||0x1f4;return function(_0x2ce795){logger['error'](_0x2ce795[_0xc4df('0x29')]);if(_0x2ce795[_0xc4df('0x2a')]){delete _0x2ce795[_0xc4df('0x2a')];}_0x308749['status'](_0x43e84f)[_0xc4df('0x2b')](_0x2ce795);};}exports['index']=function(_0x2d7dc0,_0x5ecfec){var _0x1cfbfb={},_0x309181={},_0x3e76b1={'count':0x0,'rows':[]};var _0x1f6b30=_['map'](db[_0xc4df('0x2c')]['rawAttributes'],function(_0x22e231){return{'name':_0x22e231[_0xc4df('0x2d')],'type':_0x22e231[_0xc4df('0x2e')][_0xc4df('0x2f')]};});_0x309181['model']=_['map'](_0x1f6b30,'name');_0x309181['query']=_[_0xc4df('0x30')](_0x2d7dc0[_0xc4df('0x31')]);_0x309181[_0xc4df('0x32')]=_['intersection'](_0x309181['model'],_0x309181[_0xc4df('0x31')]);_0x1cfbfb[_0xc4df('0x33')]=_[_0xc4df('0x34')](_0x309181[_0xc4df('0x35')],qs[_0xc4df('0x36')](_0x2d7dc0['query'][_0xc4df('0x36')]));_0x1cfbfb[_0xc4df('0x33')]=_0x1cfbfb[_0xc4df('0x33')][_0xc4df('0x37')]?_0x1cfbfb[_0xc4df('0x33')]:_0x309181[_0xc4df('0x35')];if(!_0x2d7dc0[_0xc4df('0x31')][_0xc4df('0x38')](_0xc4df('0x39'))){_0x1cfbfb[_0xc4df('0x1c')]=qs['limit'](_0x2d7dc0['query'][_0xc4df('0x1c')]);_0x1cfbfb[_0xc4df('0x1f')]=qs['offset'](_0x2d7dc0[_0xc4df('0x31')][_0xc4df('0x1f')]);}_0x1cfbfb['order']=qs['sort'](_0x2d7dc0[_0xc4df('0x31')][_0xc4df('0x3a')]);_0x1cfbfb[_0xc4df('0x3b')]=qs[_0xc4df('0x32')](_[_0xc4df('0x3c')](_0x2d7dc0['query'],_0x309181[_0xc4df('0x32')]),_0x1f6b30);if(_0x2d7dc0['query']['filter']){_0x1cfbfb[_0xc4df('0x3b')]=_[_0xc4df('0x3d')](_0x1cfbfb[_0xc4df('0x3b')],{'$or':_['map'](_0x1f6b30,function(_0x56c8f1){if(_0x56c8f1[_0xc4df('0x2e')]!==_0xc4df('0x3e')){var _0x44b707={};_0x44b707[_0x56c8f1[_0xc4df('0x2a')]]={'$like':'%'+_0x2d7dc0[_0xc4df('0x31')]['filter']+'%'};return _0x44b707;}})});}_0x1cfbfb=_[_0xc4df('0x3d')]({},_0x1cfbfb,_0x2d7dc0['options']);var _0xdd1fde={'where':_0x1cfbfb[_0xc4df('0x3b')]};return db['JscriptyProject'][_0xc4df('0x1e')](_0xdd1fde)['then'](function(_0xee7849){_0x3e76b1[_0xc4df('0x1e')]=_0xee7849;if(_0x2d7dc0[_0xc4df('0x31')][_0xc4df('0x3f')]){_0x1cfbfb['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xc4df('0x40')](_0x1cfbfb);})[_0xc4df('0x25')](function(_0x53345f){_0x3e76b1['rows']=_0x53345f;return _0x3e76b1;})[_0xc4df('0x25')](respondWithFilteredResult(_0x5ecfec,_0x1cfbfb))[_0xc4df('0x41')](handleError(_0x5ecfec,null));};exports[_0xc4df('0x42')]=function(_0x2f1d00,_0x536069){var _0x1118b4={'raw':![],'where':{'id':_0x2f1d00[_0xc4df('0x43')]['id']}},_0x52794c={};_0x52794c['model']=_['keys'](db['JscriptyProject'][_0xc4df('0x44')]);_0x52794c['query']=_[_0xc4df('0x30')](_0x2f1d00['query']);_0x52794c[_0xc4df('0x32')]=_[_0xc4df('0x34')](_0x52794c[_0xc4df('0x35')],_0x52794c['query']);_0x1118b4[_0xc4df('0x33')]=_[_0xc4df('0x34')](_0x52794c['model'],qs[_0xc4df('0x36')](_0x2f1d00[_0xc4df('0x31')]['fields']));_0x1118b4[_0xc4df('0x33')]=_0x1118b4['attributes']['length']?_0x1118b4[_0xc4df('0x33')]:_0x52794c[_0xc4df('0x35')];if(_0x2f1d00[_0xc4df('0x31')]['includeAll']){_0x1118b4['include']=[{'all':!![]}];}_0x1118b4=_['merge']({},_0x1118b4,_0x2f1d00[_0xc4df('0x45')]);return db[_0xc4df('0x2c')]['find'](_0x1118b4)['then'](handleEntityNotFound(_0x536069,null))[_0xc4df('0x25')](respondWithResult(_0x536069,null))[_0xc4df('0x41')](handleError(_0x536069,null));};exports[_0xc4df('0x46')]=function(_0x3bce96,_0x27b0d2){return db['JscriptyProject'][_0xc4df('0x46')](_0x3bce96['body'],{})[_0xc4df('0x25')](function(_0x6ae675){var _0x2dcabe=_0x3bce96[_0xc4df('0x47')]['get']({'plain':!![]});if(!_0x2dcabe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dcabe[_0xc4df('0x48')]===_0xc4df('0x47')){var _0x16ed42=_0x6ae675[_0xc4df('0x49')]({'plain':!![]});var _0x2dc0fc=_0xc4df('0x27');return db[_0xc4df('0x4a')][_0xc4df('0x4b')]({'where':{'name':_0x2dc0fc,'userProfileId':_0x2dcabe[_0xc4df('0x4c')]},'raw':!![]})['then'](function(_0x1509f3){if(_0x1509f3&&_0x1509f3[_0xc4df('0x4d')]===0x0){return db[_0xc4df('0x28')][_0xc4df('0x46')]({'name':_0x16ed42[_0xc4df('0x2a')],'resourceId':_0x16ed42['id'],'type':_0x1509f3[_0xc4df('0x2a')],'sectionId':_0x1509f3['id']},{})[_0xc4df('0x25')](function(){return _0x6ae675;});}else{return _0x6ae675;}})[_0xc4df('0x41')](function(_0x2c5d04){logger[_0xc4df('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c5d04);throw _0x2c5d04;});}return _0x6ae675;})[_0xc4df('0x25')](respondWithResult(_0x27b0d2,0xc9))[_0xc4df('0x41')](handleError(_0x27b0d2,null));};exports[_0xc4df('0x4f')]=function(_0x50ed27,_0x9f615){var _0xc42652={'where':{'id':_0x50ed27[_0xc4df('0x43')]['id']}},_0x42b2eb={};_0x42b2eb['model']=_['keys'](db[_0xc4df('0x2c')][_0xc4df('0x44')]);_0xc42652[_0xc4df('0x33')]=_['intersection'](_0x42b2eb[_0xc4df('0x35')],qs[_0xc4df('0x36')](_0x50ed27[_0xc4df('0x31')][_0xc4df('0x36')]));_0xc42652['attributes']=_0xc42652[_0xc4df('0x33')]['length']?_0xc42652[_0xc4df('0x33')]:_0x42b2eb[_0xc4df('0x35')];if(_0x50ed27[_0xc4df('0x31')][_0xc4df('0x3f')]){_0xc42652[_0xc4df('0x50')]=[{'all':!![]}];}_0xc42652=_[_0xc4df('0x3d')]({},_0xc42652,_0x50ed27[_0xc4df('0x45')]);return db['JscriptyProject']['find'](_0xc42652)[_0xc4df('0x25')](handleEntityNotFound(_0x9f615,null))[_0xc4df('0x25')](function(_0x546fd0){if(_0x546fd0){var _0x230b18=_0x546fd0['get']({'plain':!![]});_0x230b18=qs['omit'](_0x230b18,['id','createdAt','updatedAt']);_0x50ed27[_0xc4df('0x51')]=_[_0xc4df('0x52')](_0x50ed27[_0xc4df('0x51')],['id',_0xc4df('0x53'),_0xc4df('0x54')]);return db[_0xc4df('0x2c')][_0xc4df('0x46')](_[_0xc4df('0x3d')](_0x230b18,_0x50ed27[_0xc4df('0x51')]),{'include':_0x50ed27[_0xc4df('0x31')][_0xc4df('0x3f')]?[{'all':!![]}]:undefined})[_0xc4df('0x25')](function(_0x34283d){var _0x2e3553=_0x50ed27[_0xc4df('0x47')]['get']({'plain':!![]});if(!_0x2e3553)throw new Error(_0xc4df('0x55'));if(_0x2e3553[_0xc4df('0x48')]===_0xc4df('0x47')){var _0x1c06ea=_0x34283d[_0xc4df('0x49')]({'plain':!![]});var _0x430457=_0xc4df('0x27');return db['UserProfileSection'][_0xc4df('0x4b')]({'where':{'name':_0x430457,'userProfileId':_0x2e3553[_0xc4df('0x4c')]},'raw':!![]})[_0xc4df('0x25')](function(_0x1f97d9){if(_0x1f97d9&&_0x1f97d9[_0xc4df('0x4d')]===0x0){return db[_0xc4df('0x28')]['create']({'name':_0x1c06ea[_0xc4df('0x2a')],'resourceId':_0x1c06ea['id'],'type':_0x1f97d9[_0xc4df('0x2a')],'sectionId':_0x1f97d9['id']},{})[_0xc4df('0x25')](function(){return _0x34283d;});}else{return _0x34283d;}})[_0xc4df('0x41')](function(_0x37306d){logger[_0xc4df('0x4e')](_0xc4df('0x56'),_0x37306d);throw _0x37306d;});}return _0x34283d;});}})[_0xc4df('0x25')](respondWithResult(_0x9f615,0xc9))[_0xc4df('0x41')](handleError(_0x9f615,null));};exports['update']=function(_0x1cbbad,_0x10e847){if(_0x1cbbad[_0xc4df('0x51')]['id']){delete _0x1cbbad[_0xc4df('0x51')]['id'];}return db[_0xc4df('0x2c')]['find']({'where':{'id':_0x1cbbad[_0xc4df('0x43')]['id']}})[_0xc4df('0x25')](handleEntityNotFound(_0x10e847,null))[_0xc4df('0x25')](saveUpdates(_0x1cbbad[_0xc4df('0x51')],null))[_0xc4df('0x25')](respondWithResult(_0x10e847,null))[_0xc4df('0x41')](handleError(_0x10e847,null));};exports[_0xc4df('0x26')]=function(_0x47b5ae,_0x367813){return db[_0xc4df('0x2c')][_0xc4df('0x4b')]({'where':{'id':_0x47b5ae[_0xc4df('0x43')]['id']}})[_0xc4df('0x25')](handleEntityNotFound(_0x367813,null))['then'](removeEntity(_0x367813,null))[_0xc4df('0x41')](handleError(_0x367813,null));};exports[_0xc4df('0x57')]=function(_0x2ab565,_0x5d0350,_0x504f9a){var _0x1435d0={'raw':!![],'where':{}};var _0x5c755d={};var _0x3b22ff={'count':0x0,'rows':[]};return db[_0xc4df('0x2c')]['findOne']({'where':{'id':_0x2ab565[_0xc4df('0x43')]['id']}})[_0xc4df('0x25')](handleEntityNotFound(_0x5d0350,null))[_0xc4df('0x25')](function(_0x359ca9){if(_0x359ca9){_0x5c755d[_0xc4df('0x35')]=_[_0xc4df('0x30')](db['JscriptySessionReport'][_0xc4df('0x44')]);_0x5c755d[_0xc4df('0x31')]=_['keys'](_0x2ab565[_0xc4df('0x31')]);_0x5c755d[_0xc4df('0x32')]=_[_0xc4df('0x34')](_0x5c755d[_0xc4df('0x35')],_0x5c755d[_0xc4df('0x31')]);_0x1435d0[_0xc4df('0x33')]=_['intersection'](_0x5c755d[_0xc4df('0x35')],qs[_0xc4df('0x36')](_0x2ab565['query'][_0xc4df('0x36')]));_0x1435d0[_0xc4df('0x33')]=_0x1435d0['attributes'][_0xc4df('0x37')]?_0x1435d0[_0xc4df('0x33')]:_0x5c755d[_0xc4df('0x35')];if(!_0x2ab565[_0xc4df('0x31')]['hasOwnProperty'](_0xc4df('0x39'))){_0x1435d0['limit']=qs[_0xc4df('0x1c')](_0x2ab565[_0xc4df('0x31')]['limit']);_0x1435d0[_0xc4df('0x1f')]=qs[_0xc4df('0x1f')](_0x2ab565[_0xc4df('0x31')][_0xc4df('0x1f')]);}_0x1435d0[_0xc4df('0x58')]=qs['sort'](_0x2ab565['query'][_0xc4df('0x3a')]);_0x1435d0[_0xc4df('0x3b')]=qs[_0xc4df('0x32')](_[_0xc4df('0x3c')](_0x2ab565[_0xc4df('0x31')],_0x5c755d[_0xc4df('0x32')]));_0x1435d0[_0xc4df('0x3b')]['ProjectId']=_0x359ca9['id'];if(_0x2ab565[_0xc4df('0x31')][_0xc4df('0x59')]){_0x1435d0[_0xc4df('0x3b')]=_[_0xc4df('0x3d')](_0x1435d0['where'],{'$or':_['map'](_0x1435d0[_0xc4df('0x33')],function(_0x33bc56){var _0x86ae06={};_0x86ae06[_0x33bc56]={'$like':'%'+_0x2ab565['query'][_0xc4df('0x59')]+'%'};return _0x86ae06;})});}_0x1435d0=_[_0xc4df('0x3d')]({},_0x1435d0,_0x2ab565['options']);return db[_0xc4df('0x5a')][_0xc4df('0x1e')]({'where':_0x1435d0[_0xc4df('0x3b')]})['then'](function(_0x188889){_0x3b22ff[_0xc4df('0x1e')]=_0x188889;if(_0x2ab565['query'][_0xc4df('0x3f')]){_0x1435d0[_0xc4df('0x50')]=[{'all':!![]}];}return db[_0xc4df('0x5a')][_0xc4df('0x40')](_0x1435d0);})['then'](function(_0x1fb762){_0x3b22ff['rows']=_0x1fb762;return _0x3b22ff;});}})[_0xc4df('0x25')](respondWithFilteredResult(_0x5d0350,_0x1435d0))[_0xc4df('0x41')](handleError(_0x5d0350,null));};exports[_0xc4df('0x5b')]=function(_0x7e4fe2,_0x3eaf5f,_0x40cc92){var _0x4dcb4c={'raw':!![],'where':{}};var _0x263d85={};var _0x2bcbb2={'count':0x0,'rows':[]};return db[_0xc4df('0x2c')][_0xc4df('0x5c')]({'where':{'id':_0x7e4fe2[_0xc4df('0x43')]['id']}})[_0xc4df('0x25')](handleEntityNotFound(_0x3eaf5f,null))[_0xc4df('0x25')](function(_0x55e179){if(_0x55e179){_0x263d85[_0xc4df('0x35')]=_[_0xc4df('0x30')](db[_0xc4df('0x5d')][_0xc4df('0x44')]);_0x263d85[_0xc4df('0x31')]=_['keys'](_0x7e4fe2[_0xc4df('0x31')]);_0x263d85[_0xc4df('0x32')]=_[_0xc4df('0x34')](_0x263d85[_0xc4df('0x35')],_0x263d85['query']);_0x4dcb4c[_0xc4df('0x33')]=_[_0xc4df('0x34')](_0x263d85[_0xc4df('0x35')],qs['fields'](_0x7e4fe2[_0xc4df('0x31')][_0xc4df('0x36')]));_0x4dcb4c['attributes']=_0x4dcb4c[_0xc4df('0x33')][_0xc4df('0x37')]?_0x4dcb4c[_0xc4df('0x33')]:_0x263d85['model'];if(!_0x7e4fe2['query'][_0xc4df('0x38')](_0xc4df('0x39'))){_0x4dcb4c[_0xc4df('0x1c')]=qs['limit'](_0x7e4fe2['query'][_0xc4df('0x1c')]);_0x4dcb4c['offset']=qs['offset'](_0x7e4fe2[_0xc4df('0x31')][_0xc4df('0x1f')]);}_0x4dcb4c[_0xc4df('0x58')]=qs[_0xc4df('0x3a')](_0x7e4fe2[_0xc4df('0x31')][_0xc4df('0x3a')]);_0x4dcb4c['where']=qs[_0xc4df('0x32')](_['pick'](_0x7e4fe2[_0xc4df('0x31')],_0x263d85[_0xc4df('0x32')]));_0x4dcb4c[_0xc4df('0x3b')][_0xc4df('0x5e')]=_0x55e179['id'];if(_0x7e4fe2[_0xc4df('0x31')][_0xc4df('0x59')]){_0x4dcb4c[_0xc4df('0x3b')]=_[_0xc4df('0x3d')](_0x4dcb4c[_0xc4df('0x3b')],{'$or':_[_0xc4df('0x5f')](_0x4dcb4c[_0xc4df('0x33')],function(_0x5ae06d){var _0x2a0509={};_0x2a0509[_0x5ae06d]={'$like':'%'+_0x7e4fe2['query'][_0xc4df('0x59')]+'%'};return _0x2a0509;})});}_0x4dcb4c=_[_0xc4df('0x3d')]({},_0x4dcb4c,_0x7e4fe2['options']);return db['JscriptyAnswerReport'][_0xc4df('0x1e')]({'where':_0x4dcb4c['where']})['then'](function(_0x437c21){_0x2bcbb2[_0xc4df('0x1e')]=_0x437c21;if(_0x7e4fe2['query']['includeAll']){_0x4dcb4c['include']=[{'all':!![]}];}return db[_0xc4df('0x5d')]['findAll'](_0x4dcb4c);})[_0xc4df('0x25')](function(_0x408b0f){_0x2bcbb2[_0xc4df('0x60')]=_0x408b0f;return _0x2bcbb2;});}})[_0xc4df('0x25')](respondWithFilteredResult(_0x3eaf5f,_0x4dcb4c))[_0xc4df('0x41')](handleError(_0x3eaf5f,null));};function char(_0x1bda8b){return'number'===typeof _0x1bda8b?String['fromCharCode']['apply'](null,arguments):_0x1bda8b;}function needsEncapsulation(_0x335243){return!!_0x335243&&(_0x335243[_0xc4df('0x61')]()[_0xc4df('0x62')](char(0xd))>=0x0||_0x335243[_0xc4df('0x61')]()[_0xc4df('0x62')](char(0xa))>=0x0||_0x335243[_0xc4df('0x61')]()[_0xc4df('0x62')](char(0x2c))>=0x0||_0x335243[_0xc4df('0x61')]()[_0xc4df('0x62')](char(0x22))>=0x0);}function encapsulate(_0x45c703){var _0x5f0144=char(0x22),_0x5d4637='\x5c'+char(0x22),_0x50bddd=_0x45c703[_0xc4df('0x61')]()[_0xc4df('0x63')](new RegExp(_0x5f0144,'g'),_0x5d4637);return _0x5f0144+_0x50bddd+_0x5f0144;}exports[_0xc4df('0x64')]=function(_0x1bc29c,_0xcdcf79,_0x268bbb){var _0x18d3e2,_0x1f7cd4;var _0xc8bf43={'where':{'ProjectId':_0x1bc29c['params']['id']}};if(_0x1bc29c[_0xc4df('0x31')][_0xc4df('0x65')]){_0xc8bf43[_0xc4df('0x3b')][_0xc4df('0x66')]=JSON[_0xc4df('0x67')](_0x1bc29c['query'][_0xc4df('0x65')]);}return db[_0xc4df('0x5a')]['findAll'](_0xc8bf43)[_0xc4df('0x25')](handleEntityNotFound(_0xcdcf79,null))[_0xc4df('0x25')](function(_0x7998c1){if(_0x7998c1){_0x18d3e2=_0x7998c1;return db[_0xc4df('0x68')][_0xc4df('0x40')]({'where':{'SessionId':{'$in':_[_0xc4df('0x5f')](_0x18d3e2,'id')},'ProjectId':_0x1bc29c[_0xc4df('0x43')]['id']},'order':'-createdAt'});}})[_0xc4df('0x25')](handleEntityNotFound(_0xcdcf79,null))[_0xc4df('0x25')](function(_0x1e6dc8){if(_0x1e6dc8){_0x1f7cd4=_0x1e6dc8;var _0x58c0a9={};for(var _0x52bda4=0x0,_0x2af758=_0x1f7cd4[_0xc4df('0x37')];_0x52bda4<_0x2af758;_0x52bda4++){if(!_0x58c0a9['hasOwnProperty'](_0x1f7cd4[_0x52bda4][_0xc4df('0x69')])){_0x58c0a9[_0x1f7cd4[_0x52bda4]['questionId']]=needsEncapsulation(_0x1f7cd4[_0x52bda4][_0xc4df('0x6a')])?encapsulate(_0x1f7cd4[_0x52bda4]['question']):_0x1f7cd4[_0x52bda4][_0xc4df('0x6a')];}}var _0x121afa=[],_0x40e6cf={};for(var _0x307008=0x0,_0x204219=_0x18d3e2[_0xc4df('0x37')];_0x307008<_0x204219;_0x307008++){_0x40e6cf={'ProjectId':_0x1bc29c[_0xc4df('0x43')]['id'],'SessionId':_0x18d3e2[_0x307008]['id'],'StartTime':moment(_0x18d3e2[_0x307008]['starttime'])[_0xc4df('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x448ef4=0x0,_0x2d87ef=_0x1f7cd4[_0xc4df('0x37')];_0x448ef4<_0x2d87ef;_0x448ef4++){if(_0x1f7cd4[_0x448ef4][_0xc4df('0x6c')]==_0x18d3e2[_0x307008]['id']&&_0x58c0a9['hasOwnProperty'](_0x1f7cd4[_0x448ef4][_0xc4df('0x69')])){_0x40e6cf[_0x58c0a9[_0x1f7cd4[_0x448ef4][_0xc4df('0x69')]]]=_0x1f7cd4[_0x448ef4][_0xc4df('0x6d')];}}for(var _0x572a25 in _0x58c0a9){if(!_0x40e6cf[_0xc4df('0x38')](_0x58c0a9[_0x572a25])){_0x40e6cf[_0x58c0a9[_0x572a25]]=null;}}_0x121afa[_0xc4df('0x6e')](_0x40e6cf);}return _0x121afa;}})[_0xc4df('0x25')](function(_0x3b9345){if(!_[_0xc4df('0x6f')](_0x3b9345)){var _0x4e60cc=toCsv(_0x3b9345);var _0x48abdd=Date[_0xc4df('0x70')]();fs['writeFileSync'](util['format'](_0xc4df('0x71'),_0x1bc29c[_0xc4df('0x43')]['id'],_0x48abdd),_0x4e60cc);_0xcdcf79[_0xc4df('0x72')](_0xc4df('0x73'),_0xc4df('0x74')+util['format'](_0xc4df('0x75'),_0x1bc29c['params']['id'],_0x48abdd));_0xcdcf79['setHeader']('Content-type',_0xc4df('0x76'));return _0xcdcf79[_0xc4df('0x77')](util[_0xc4df('0x6b')](_0xc4df('0x71'),_0x1bc29c[_0xc4df('0x43')]['id'],_0x48abdd));}else{return _0xcdcf79[_0xc4df('0x18')](0xcc);}})[_0xc4df('0x41')](handleError(_0xcdcf79,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 068619e..25794b9 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 _0xe64a=['moment','bluebird','request-promise','path','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe64a,0x1e0));var _0xae64=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe64a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var logger=require(_0xae64('0x2'))(_0xae64('0x3'));var moment=require(_0xae64('0x4'));var BPromise=require(_0xae64('0x5'));var rp=require(_0xae64('0x6'));var fs=require('fs');var path=require(_0xae64('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x2b1046,_0x896007){return _0x2b1046[_0xae64('0x8')](_0xae64('0x9'),attributes,{'tableName':_0xae64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4986=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x16495f,_0x5c1d14){var _0x1d62b5=function(_0x4b33ad){while(--_0x4b33ad){_0x16495f['push'](_0x16495f['shift']());}};_0x1d62b5(++_0x5c1d14);}(_0x4986,0x6e));var _0x6498=function(_0x59a34b,_0x523d77){_0x59a34b=_0x59a34b-0x0;var _0x16d8bd=_0x4986[_0x59a34b];return _0x16d8bd;};'use strict';var _=require(_0x6498('0x0'));var util=require(_0x6498('0x1'));var logger=require(_0x6498('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6498('0x3'));var rp=require(_0x6498('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6498('0x5'));var config=require(_0x6498('0x6'));var attributes=require(_0x6498('0x7'));module[_0x6498('0x8')]=function(_0x117a31,_0x8d1853){return _0x117a31[_0x6498('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','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 38dd2d9..c766ed3 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x47b7c9,_0x3848b2){var _0x435aaf=function(_0x3befc4){while(--_0x3befc4){_0x47b7c9['push'](_0x47b7c9['shift']());}};_0x435aaf(++_0x3848b2);}(_0xaa88,0x137));var _0x8aa8=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xaa88[_0x15af0f];return _0x2bd1cb;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0xa935d9,_0x20596a){var _0x5af53f=function(_0x76b444){while(--_0x76b444){_0xa935d9['push'](_0xa935d9['shift']());}};_0x5af53f(++_0x20596a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xcb91[_0x2338fa];return _0x42df9b;};'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')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d7afbd0..ba036a5 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 _0x291f=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x21a1e5,_0x105f2e){var _0x522496=function(_0x4b5e2e){while(--_0x4b5e2e){_0x21a1e5['push'](_0x21a1e5['shift']());}};_0x522496(++_0x105f2e);}(_0x291f,0xdd));var _0xf291=function(_0x246648,_0x38670f){_0x246648=_0x246648-0x0;var _0x364fea=_0x291f[_0x246648];return _0x364fea;};'use strict';var multer=require(_0xf291('0x0'));var util=require('util');var path=require(_0xf291('0x1'));var timeout=require(_0xf291('0x2'));var express=require(_0xf291('0x3'));var router=express[_0xf291('0x4')]();var fs_extra=require(_0xf291('0x5'));var auth=require(_0xf291('0x6'));var interaction=require(_0xf291('0x7'));var config=require('../../config/environment');var controller=require(_0xf291('0x8'));router[_0xf291('0x9')]('/',auth[_0xf291('0xa')](),controller[_0xf291('0xb')]);router[_0xf291('0x9')](_0xf291('0xc'),auth[_0xf291('0xa')](),controller[_0xf291('0xd')]);router[_0xf291('0x9')](_0xf291('0xe'),auth[_0xf291('0xa')](),controller['show']);router[_0xf291('0xf')]('/',auth[_0xf291('0xa')](),controller[_0xf291('0x10')]);router[_0xf291('0x11')](_0xf291('0xe'),auth[_0xf291('0xa')](),controller[_0xf291('0x12')]);router[_0xf291('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xf291('0x14')]);module[_0xf291('0x15')]=router; \ No newline at end of file +var _0x1e99=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util'];(function(_0x54fe5d,_0xb659f0){var _0x54900d=function(_0x36232d){while(--_0x36232d){_0x54fe5d['push'](_0x54fe5d['shift']());}};_0x54900d(++_0xb659f0);}(_0x1e99,0x18e));var _0x91e9=function(_0x11fbc0,_0x55d9a6){_0x11fbc0=_0x11fbc0-0x0;var _0x5b265f=_0x1e99[_0x11fbc0];return _0x5b265f;};'use strict';var multer=require('multer');var util=require(_0x91e9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x91e9('0x1'));var router=express[_0x91e9('0x2')]();var fs_extra=require(_0x91e9('0x3'));var auth=require(_0x91e9('0x4'));var interaction=require(_0x91e9('0x5'));var config=require(_0x91e9('0x6'));var controller=require(_0x91e9('0x7'));router[_0x91e9('0x8')]('/',auth[_0x91e9('0x9')](),controller[_0x91e9('0xa')]);router[_0x91e9('0x8')](_0x91e9('0xb'),auth[_0x91e9('0x9')](),controller[_0x91e9('0xc')]);router['get']('/:id',auth[_0x91e9('0x9')](),controller[_0x91e9('0xd')]);router[_0x91e9('0xe')]('/',auth[_0x91e9('0x9')](),controller[_0x91e9('0xf')]);router[_0x91e9('0x10')](_0x91e9('0x11'),auth[_0x91e9('0x9')](),controller['update']);router[_0x91e9('0x12')](_0x91e9('0x11'),auth['isAuthenticated'](),controller[_0x91e9('0x13')]);module[_0x91e9('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 7eba134..235aa55 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7a54,0x106));var _0x47a5=function(_0x376bee,_0x39e52d){_0x376bee=_0x376bee-0x0;var _0x5e9cde=_0x7a54[_0x376bee];return _0x5e9cde;};'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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x1a7048,_0x1867a7){_0x1a7048=_0x1a7048-0x0;var _0x5ccb6f=_0x7a54[_0x1a7048];return _0x5ccb6f;};'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 7a9f154..85d7268 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 _0x1dc9=['limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x35ae12,_0x56ee1a){var _0x122a9d=function(_0x4e0bc8){while(--_0x4e0bc8){_0x35ae12['push'](_0x35ae12['shift']());}};_0x122a9d(++_0x56ee1a);}(_0x1dc9,0x7b));var _0x91dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1dc9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x91dc('0x0'));var rimraf=require(_0x91dc('0x1'));var zipdir=require(_0x91dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91dc('0x3'));var moment=require(_0x91dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91dc('0x5'));var util=require(_0x91dc('0x6'));var path=require(_0x91dc('0x7'));var sox=require(_0x91dc('0x8'));var csv=require(_0x91dc('0x9'));var ejs=require(_0x91dc('0xa'));var fs=require('fs');var fs_extra=require(_0x91dc('0xb'));var _=require('lodash');var squel=require(_0x91dc('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x91dc('0xd'));var toCsv=require(_0x91dc('0x9'));var querystring=require(_0x91dc('0xe'));var Papa=require(_0x91dc('0xf'));var Redis=require(_0x91dc('0x10'));var authService=require(_0x91dc('0x11'));var qs=require(_0x91dc('0x12'));var as=require(_0x91dc('0x13'));var hardwareService=require(_0x91dc('0x14'));var logger=require(_0x91dc('0x15'))(_0x91dc('0x16'));var utils=require(_0x91dc('0x17'));var config=require(_0x91dc('0x18'));var licenseUtil=require(_0x91dc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ba2a6,_0x23dd1d){_0x23dd1d=_0x23dd1d||0xcc;return function(_0x4f6989){if(_0x4f6989){return _0x1ba2a6[_0x91dc('0x1a')](_0x23dd1d);}return _0x1ba2a6[_0x91dc('0x1b')](_0x23dd1d)['end']();};}function respondWithResult(_0x2e6cde,_0x3c0811){_0x3c0811=_0x3c0811||0xc8;return function(_0x4343a8){if(_0x4343a8){return _0x2e6cde[_0x91dc('0x1b')](_0x3c0811)[_0x91dc('0x1c')](_0x4343a8);}};}function respondWithFilteredResult(_0x5cee61,_0xe40f45){return function(_0x1b6f3b){if(_0x1b6f3b){var _0x415509=typeof _0xe40f45[_0x91dc('0x1d')]===_0x91dc('0x1e')&&typeof _0xe40f45[_0x91dc('0x1f')]===_0x91dc('0x1e');var _0x311035=_0x1b6f3b[_0x91dc('0x20')];var _0x19e3de=_0x415509?0x0:_0xe40f45[_0x91dc('0x1d')];var _0x1efdc1=_0x415509?_0x1b6f3b[_0x91dc('0x20')]:_0xe40f45['offset']+_0xe40f45[_0x91dc('0x1f')];var _0x1e916a;if(_0x1efdc1>=_0x311035){_0x1efdc1=_0x311035;_0x1e916a=0xc8;}else{_0x1e916a=0xce;}_0x5cee61[_0x91dc('0x1b')](_0x1e916a);return _0x5cee61[_0x91dc('0x21')](_0x91dc('0x22'),_0x19e3de+'-'+_0x1efdc1+'/'+_0x311035)[_0x91dc('0x1c')](_0x1b6f3b);}return null;};}function patchUpdates(_0x1299fc){return function(_0x4372b2){try{jsonpatch[_0x91dc('0x23')](_0x4372b2,_0x1299fc,!![]);}catch(_0x99e9e8){return BPromise[_0x91dc('0x24')](_0x99e9e8);}return _0x4372b2[_0x91dc('0x25')]();};}function saveUpdates(_0x429dcb,_0x5a6c63){return function(_0xc8774e){if(_0xc8774e){return _0xc8774e[_0x91dc('0x26')](_0x429dcb)[_0x91dc('0x27')](function(_0x115422){return _0x115422;});}return null;};}function removeEntity(_0x496110,_0x529b2f){return function(_0x1d6474){if(_0x1d6474){return _0x1d6474['destroy']()[_0x91dc('0x27')](function(){_0x496110['status'](0xcc)[_0x91dc('0x28')]();});}};}function handleEntityNotFound(_0x4400b2,_0x4c89bf){return function(_0x19f2a2){if(!_0x19f2a2){_0x4400b2[_0x91dc('0x1a')](0x194);}return _0x19f2a2;};}function handleError(_0x50646a,_0x2cebae){_0x2cebae=_0x2cebae||0x1f4;return function(_0x3bf9d1){logger['error'](_0x3bf9d1[_0x91dc('0x29')]);if(_0x3bf9d1[_0x91dc('0x2a')]){delete _0x3bf9d1['name'];}_0x50646a[_0x91dc('0x1b')](_0x2cebae)[_0x91dc('0x2b')](_0x3bf9d1);};}exports[_0x91dc('0x2c')]=function(_0x5dd5d0,_0x3ae0ef){var _0x13e773={},_0x25806d={},_0x4ecfca={'count':0x0,'rows':[]};var _0xd2f0b7=_[_0x91dc('0x2d')](db[_0x91dc('0x2e')][_0x91dc('0x2f')],function(_0xe51e5d){return{'name':_0xe51e5d[_0x91dc('0x30')],'type':_0xe51e5d[_0x91dc('0x31')][_0x91dc('0x32')]};});_0x25806d['model']=_[_0x91dc('0x2d')](_0xd2f0b7,_0x91dc('0x2a'));_0x25806d[_0x91dc('0x33')]=_['keys'](_0x5dd5d0['query']);_0x25806d[_0x91dc('0x34')]=_[_0x91dc('0x35')](_0x25806d[_0x91dc('0x36')],_0x25806d['query']);_0x13e773['attributes']=_[_0x91dc('0x35')](_0x25806d[_0x91dc('0x36')],qs[_0x91dc('0x37')](_0x5dd5d0[_0x91dc('0x33')][_0x91dc('0x37')]));_0x13e773[_0x91dc('0x38')]=_0x13e773[_0x91dc('0x38')][_0x91dc('0x39')]?_0x13e773[_0x91dc('0x38')]:_0x25806d[_0x91dc('0x36')];if(!_0x5dd5d0[_0x91dc('0x33')]['hasOwnProperty']('nolimit')){_0x13e773[_0x91dc('0x1f')]=qs[_0x91dc('0x1f')](_0x5dd5d0[_0x91dc('0x33')][_0x91dc('0x1f')]);_0x13e773['offset']=qs[_0x91dc('0x1d')](_0x5dd5d0['query'][_0x91dc('0x1d')]);}_0x13e773[_0x91dc('0x3a')]=qs[_0x91dc('0x3b')](_0x5dd5d0[_0x91dc('0x33')]['sort']);_0x13e773[_0x91dc('0x3c')]=qs[_0x91dc('0x34')](_['pick'](_0x5dd5d0['query'],_0x25806d[_0x91dc('0x34')]),_0xd2f0b7);if(_0x5dd5d0[_0x91dc('0x33')][_0x91dc('0x3d')]){_0x13e773['where']=_[_0x91dc('0x3e')](_0x13e773[_0x91dc('0x3c')],{'$or':_[_0x91dc('0x2d')](_0xd2f0b7,function(_0x6d8e56){if(_0x6d8e56[_0x91dc('0x31')]!==_0x91dc('0x3f')){var _0x99e2c3={};_0x99e2c3[_0x6d8e56[_0x91dc('0x2a')]]={'$like':'%'+_0x5dd5d0[_0x91dc('0x33')][_0x91dc('0x3d')]+'%'};return _0x99e2c3;}})});}_0x13e773=_[_0x91dc('0x3e')]({},_0x13e773,_0x5dd5d0[_0x91dc('0x40')]);var _0x2666cb={'where':_0x13e773['where']};return db[_0x91dc('0x2e')]['count'](_0x2666cb)[_0x91dc('0x27')](function(_0x7e77a3){_0x4ecfca['count']=_0x7e77a3;if(_0x5dd5d0[_0x91dc('0x33')][_0x91dc('0x41')]){_0x13e773[_0x91dc('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x13e773);})[_0x91dc('0x27')](function(_0xa717b1){_0x4ecfca[_0x91dc('0x43')]=_0xa717b1;return _0x4ecfca;})[_0x91dc('0x27')](respondWithFilteredResult(_0x3ae0ef,_0x13e773))['catch'](handleError(_0x3ae0ef,null));};exports[_0x91dc('0x44')]=function(_0x42f1b7,_0x510aae){var _0x191496={'raw':!![],'where':{'id':_0x42f1b7[_0x91dc('0x45')]['id']}},_0x4cc004={};_0x4cc004[_0x91dc('0x36')]=_['keys'](db[_0x91dc('0x2e')][_0x91dc('0x2f')]);_0x4cc004['query']=_[_0x91dc('0x46')](_0x42f1b7[_0x91dc('0x33')]);_0x4cc004[_0x91dc('0x34')]=_[_0x91dc('0x35')](_0x4cc004[_0x91dc('0x36')],_0x4cc004[_0x91dc('0x33')]);_0x191496['attributes']=_[_0x91dc('0x35')](_0x4cc004[_0x91dc('0x36')],qs[_0x91dc('0x37')](_0x42f1b7[_0x91dc('0x33')][_0x91dc('0x37')]));_0x191496[_0x91dc('0x38')]=_0x191496['attributes']['length']?_0x191496['attributes']:_0x4cc004[_0x91dc('0x36')];if(_0x42f1b7[_0x91dc('0x33')][_0x91dc('0x41')]){_0x191496['include']=[{'all':!![]}];}_0x191496=_[_0x91dc('0x3e')]({},_0x191496,_0x42f1b7[_0x91dc('0x40')]);return db['JscriptyQuestionReport']['find'](_0x191496)[_0x91dc('0x27')](handleEntityNotFound(_0x510aae,null))[_0x91dc('0x27')](respondWithResult(_0x510aae,null))[_0x91dc('0x47')](handleError(_0x510aae,null));};exports[_0x91dc('0x48')]=function(_0x240670,_0x40f29a){return db[_0x91dc('0x2e')][_0x91dc('0x48')](_0x240670[_0x91dc('0x49')],{})[_0x91dc('0x27')](respondWithResult(_0x40f29a,0xc9))[_0x91dc('0x47')](handleError(_0x40f29a,null));};exports[_0x91dc('0x26')]=function(_0xa61a60,_0x2641d8){if(_0xa61a60[_0x91dc('0x49')]['id']){delete _0xa61a60[_0x91dc('0x49')]['id'];}return db[_0x91dc('0x2e')][_0x91dc('0x4a')]({'where':{'id':_0xa61a60['params']['id']}})[_0x91dc('0x27')](handleEntityNotFound(_0x2641d8,null))[_0x91dc('0x27')](saveUpdates(_0xa61a60[_0x91dc('0x49')],null))['then'](respondWithResult(_0x2641d8,null))[_0x91dc('0x47')](handleError(_0x2641d8,null));};exports[_0x91dc('0x4b')]=function(_0x2ab4cc,_0x5dceef){return db[_0x91dc('0x2e')][_0x91dc('0x4a')]({'where':{'id':_0x2ab4cc[_0x91dc('0x45')]['id']}})[_0x91dc('0x27')](handleEntityNotFound(_0x5dceef,null))[_0x91dc('0x27')](removeEntity(_0x5dceef,null))[_0x91dc('0x47')](handleError(_0x5dceef,null));};exports[_0x91dc('0x4c')]=function(_0x44ee6,_0xf8d341){return db[_0x91dc('0x2e')][_0x91dc('0x4c')]()[_0x91dc('0x27')](respondWithResult(_0xf8d341,null))[_0x91dc('0x47')](handleError(_0xf8d341,null));}; \ No newline at end of file +var _0x5f60=['params','intersection','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','name','send','JscriptyQuestionReport','rawAttributes','type','map','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','includeAll','rows'];(function(_0x25958f,_0x2b8099){var _0x38f75c=function(_0x5d5b47){while(--_0x5d5b47){_0x25958f['push'](_0x25958f['shift']());}};_0x38f75c(++_0x2b8099);}(_0x5f60,0x169));var _0x05f6=function(_0x27c3f0,_0x198aa2){_0x27c3f0=_0x27c3f0-0x0;var _0x11e51c=_0x5f60[_0x27c3f0];return _0x11e51c;};'use strict';var emlformat=require(_0x05f6('0x0'));var rimraf=require(_0x05f6('0x1'));var zipdir=require(_0x05f6('0x2'));var jsonpatch=require(_0x05f6('0x3'));var rp=require(_0x05f6('0x4'));var moment=require(_0x05f6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x05f6('0x6'));var util=require(_0x05f6('0x7'));var path=require(_0x05f6('0x8'));var sox=require(_0x05f6('0x9'));var csv=require(_0x05f6('0xa'));var ejs=require(_0x05f6('0xb'));var fs=require('fs');var fs_extra=require(_0x05f6('0xc'));var _=require(_0x05f6('0xd'));var squel=require(_0x05f6('0xe'));var crypto=require(_0x05f6('0xf'));var jsforce=require(_0x05f6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x05f6('0xa'));var querystring=require(_0x05f6('0x11'));var Papa=require('papaparse');var Redis=require(_0x05f6('0x12'));var authService=require(_0x05f6('0x13'));var qs=require(_0x05f6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05f6('0x15'));var logger=require(_0x05f6('0x16'))(_0x05f6('0x17'));var utils=require(_0x05f6('0x18'));var config=require(_0x05f6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x05f6('0x1a'))['db'];function respondWithStatusCode(_0x8f11b7,_0x4ab29d){_0x4ab29d=_0x4ab29d||0xcc;return function(_0x40609e){if(_0x40609e){return _0x8f11b7[_0x05f6('0x1b')](_0x4ab29d);}return _0x8f11b7['status'](_0x4ab29d)[_0x05f6('0x1c')]();};}function respondWithResult(_0x5786b5,_0x4dfbe4){_0x4dfbe4=_0x4dfbe4||0xc8;return function(_0x4ed790){if(_0x4ed790){return _0x5786b5[_0x05f6('0x1d')](_0x4dfbe4)['json'](_0x4ed790);}};}function respondWithFilteredResult(_0x2e467b,_0x3009f7){return function(_0x4c713d){if(_0x4c713d){var _0x3d65eb=typeof _0x3009f7[_0x05f6('0x1e')]==='undefined'&&typeof _0x3009f7['limit']===_0x05f6('0x1f');var _0x582fc4=_0x4c713d['count'];var _0x4e51b1=_0x3d65eb?0x0:_0x3009f7['offset'];var _0xf43f96=_0x3d65eb?_0x4c713d[_0x05f6('0x20')]:_0x3009f7[_0x05f6('0x1e')]+_0x3009f7[_0x05f6('0x21')];var _0x1b5682;if(_0xf43f96>=_0x582fc4){_0xf43f96=_0x582fc4;_0x1b5682=0xc8;}else{_0x1b5682=0xce;}_0x2e467b[_0x05f6('0x1d')](_0x1b5682);return _0x2e467b[_0x05f6('0x22')](_0x05f6('0x23'),_0x4e51b1+'-'+_0xf43f96+'/'+_0x582fc4)[_0x05f6('0x24')](_0x4c713d);}return null;};}function patchUpdates(_0x1d7c81){return function(_0x54572b){try{jsonpatch[_0x05f6('0x25')](_0x54572b,_0x1d7c81,!![]);}catch(_0x5d17fd){return BPromise[_0x05f6('0x26')](_0x5d17fd);}return _0x54572b['save']();};}function saveUpdates(_0x2c6e4f,_0x4803a8){return function(_0x77d6fd){if(_0x77d6fd){return _0x77d6fd[_0x05f6('0x27')](_0x2c6e4f)[_0x05f6('0x28')](function(_0x550a98){return _0x550a98;});}return null;};}function removeEntity(_0x1b415c,_0x284230){return function(_0x260fba){if(_0x260fba){return _0x260fba[_0x05f6('0x29')]()[_0x05f6('0x28')](function(){_0x1b415c[_0x05f6('0x1d')](0xcc)[_0x05f6('0x1c')]();});}};}function handleEntityNotFound(_0x548447,_0x2cb15d){return function(_0xa6c048){if(!_0xa6c048){_0x548447['sendStatus'](0x194);}return _0xa6c048;};}function handleError(_0x2f212d,_0x235379){_0x235379=_0x235379||0x1f4;return function(_0x1ce5d9){logger['error'](_0x1ce5d9['stack']);if(_0x1ce5d9[_0x05f6('0x2a')]){delete _0x1ce5d9['name'];}_0x2f212d[_0x05f6('0x1d')](_0x235379)[_0x05f6('0x2b')](_0x1ce5d9);};}exports['index']=function(_0x32930e,_0x2f2522){var _0x4b5cd4={},_0x58b628={},_0x3636a4={'count':0x0,'rows':[]};var _0x29e2f4=_['map'](db[_0x05f6('0x2c')][_0x05f6('0x2d')],function(_0x56ff8a){return{'name':_0x56ff8a['fieldName'],'type':_0x56ff8a[_0x05f6('0x2e')]['key']};});_0x58b628['model']=_[_0x05f6('0x2f')](_0x29e2f4,_0x05f6('0x2a'));_0x58b628[_0x05f6('0x30')]=_[_0x05f6('0x31')](_0x32930e[_0x05f6('0x30')]);_0x58b628['filters']=_['intersection'](_0x58b628[_0x05f6('0x32')],_0x58b628['query']);_0x4b5cd4[_0x05f6('0x33')]=_['intersection'](_0x58b628[_0x05f6('0x32')],qs[_0x05f6('0x34')](_0x32930e[_0x05f6('0x30')][_0x05f6('0x34')]));_0x4b5cd4['attributes']=_0x4b5cd4[_0x05f6('0x33')][_0x05f6('0x35')]?_0x4b5cd4[_0x05f6('0x33')]:_0x58b628[_0x05f6('0x32')];if(!_0x32930e[_0x05f6('0x30')][_0x05f6('0x36')](_0x05f6('0x37'))){_0x4b5cd4[_0x05f6('0x21')]=qs['limit'](_0x32930e['query'][_0x05f6('0x21')]);_0x4b5cd4[_0x05f6('0x1e')]=qs[_0x05f6('0x1e')](_0x32930e[_0x05f6('0x30')][_0x05f6('0x1e')]);}_0x4b5cd4[_0x05f6('0x38')]=qs[_0x05f6('0x39')](_0x32930e[_0x05f6('0x30')][_0x05f6('0x39')]);_0x4b5cd4['where']=qs[_0x05f6('0x3a')](_[_0x05f6('0x3b')](_0x32930e['query'],_0x58b628['filters']),_0x29e2f4);if(_0x32930e[_0x05f6('0x30')]['filter']){_0x4b5cd4[_0x05f6('0x3c')]=_[_0x05f6('0x3d')](_0x4b5cd4[_0x05f6('0x3c')],{'$or':_[_0x05f6('0x2f')](_0x29e2f4,function(_0x58162c){if(_0x58162c[_0x05f6('0x2e')]!=='VIRTUAL'){var _0x51a21b={};_0x51a21b[_0x58162c[_0x05f6('0x2a')]]={'$like':'%'+_0x32930e[_0x05f6('0x30')]['filter']+'%'};return _0x51a21b;}})});}_0x4b5cd4=_[_0x05f6('0x3d')]({},_0x4b5cd4,_0x32930e[_0x05f6('0x3e')]);var _0x5775b0={'where':_0x4b5cd4[_0x05f6('0x3c')]};return db[_0x05f6('0x2c')][_0x05f6('0x20')](_0x5775b0)[_0x05f6('0x28')](function(_0x2efca9){_0x3636a4[_0x05f6('0x20')]=_0x2efca9;if(_0x32930e[_0x05f6('0x30')][_0x05f6('0x3f')]){_0x4b5cd4['include']=[{'all':!![]}];}return db[_0x05f6('0x2c')]['findAll'](_0x4b5cd4);})[_0x05f6('0x28')](function(_0x14ddfe){_0x3636a4[_0x05f6('0x40')]=_0x14ddfe;return _0x3636a4;})[_0x05f6('0x28')](respondWithFilteredResult(_0x2f2522,_0x4b5cd4))['catch'](handleError(_0x2f2522,null));};exports['show']=function(_0x3e65c6,_0x1f0040){var _0x1b5620={'raw':!![],'where':{'id':_0x3e65c6[_0x05f6('0x41')]['id']}},_0x14120c={};_0x14120c[_0x05f6('0x32')]=_[_0x05f6('0x31')](db[_0x05f6('0x2c')]['rawAttributes']);_0x14120c[_0x05f6('0x30')]=_[_0x05f6('0x31')](_0x3e65c6[_0x05f6('0x30')]);_0x14120c[_0x05f6('0x3a')]=_[_0x05f6('0x42')](_0x14120c[_0x05f6('0x32')],_0x14120c[_0x05f6('0x30')]);_0x1b5620[_0x05f6('0x33')]=_[_0x05f6('0x42')](_0x14120c['model'],qs[_0x05f6('0x34')](_0x3e65c6['query'][_0x05f6('0x34')]));_0x1b5620['attributes']=_0x1b5620[_0x05f6('0x33')]['length']?_0x1b5620[_0x05f6('0x33')]:_0x14120c['model'];if(_0x3e65c6[_0x05f6('0x30')][_0x05f6('0x3f')]){_0x1b5620['include']=[{'all':!![]}];}_0x1b5620=_[_0x05f6('0x3d')]({},_0x1b5620,_0x3e65c6[_0x05f6('0x3e')]);return db[_0x05f6('0x2c')]['find'](_0x1b5620)[_0x05f6('0x28')](handleEntityNotFound(_0x1f0040,null))['then'](respondWithResult(_0x1f0040,null))['catch'](handleError(_0x1f0040,null));};exports['create']=function(_0x37a305,_0xcfc611){return db[_0x05f6('0x2c')]['create'](_0x37a305[_0x05f6('0x43')],{})['then'](respondWithResult(_0xcfc611,0xc9))[_0x05f6('0x44')](handleError(_0xcfc611,null));};exports[_0x05f6('0x27')]=function(_0x50c6c5,_0x2ee1ab){if(_0x50c6c5['body']['id']){delete _0x50c6c5[_0x05f6('0x43')]['id'];}return db[_0x05f6('0x2c')]['find']({'where':{'id':_0x50c6c5[_0x05f6('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ee1ab,null))['then'](saveUpdates(_0x50c6c5['body'],null))[_0x05f6('0x28')](respondWithResult(_0x2ee1ab,null))[_0x05f6('0x44')](handleError(_0x2ee1ab,null));};exports[_0x05f6('0x29')]=function(_0x2b41e6,_0x29cf8e){return db['JscriptyQuestionReport'][_0x05f6('0x45')]({'where':{'id':_0x2b41e6[_0x05f6('0x41')]['id']}})[_0x05f6('0x28')](handleEntityNotFound(_0x29cf8e,null))['then'](removeEntity(_0x29cf8e,null))[_0x05f6('0x44')](handleError(_0x29cf8e,null));};exports['describe']=function(_0x116dc1,_0x22b29c){return db[_0x05f6('0x2c')][_0x05f6('0x46')]()[_0x05f6('0x28')](respondWithResult(_0x22b29c,null))[_0x05f6('0x44')](handleError(_0x22b29c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cf3beb2..f8a0f74 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 _0x39b1=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x39b1,0x195));var _0x139b=function(_0x1bda53,_0xe18f3c){_0x1bda53=_0x1bda53-0x0;var _0x2a4536=_0x39b1[_0x1bda53];return _0x2a4536;};'use strict';var _=require(_0x139b('0x0'));var util=require('util');var logger=require(_0x139b('0x1'))(_0x139b('0x2'));var moment=require(_0x139b('0x3'));var BPromise=require(_0x139b('0x4'));var rp=require(_0x139b('0x5'));var fs=require('fs');var path=require(_0x139b('0x6'));var rimraf=require(_0x139b('0x7'));var config=require(_0x139b('0x8'));var attributes=require(_0x139b('0x9'));module['exports']=function(_0x54faa7,_0x49a3e0){return _0x54faa7[_0x139b('0xa')](_0x139b('0xb'),attributes,{'tableName':_0x139b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfff7=['lodash','api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xfff7,0x172));var _0x7fff=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfff7[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7fff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7fff('0x1'));var moment=require(_0x7fff('0x2'));var BPromise=require(_0x7fff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fff('0x4'));var rimraf=require('rimraf');var config=require(_0x7fff('0x5'));var attributes=require(_0x7fff('0x6'));module['exports']=function(_0x5c4878,_0x599fdb){return _0x5c4878[_0x7fff('0x7')](_0x7fff('0x8'),attributes,{'tableName':_0x7fff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index f33f2ee..22ab725 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 _0xd70e=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xd70e,0x15d));var _0xed70=function(_0x354151,_0x3f2fe1){_0x354151=_0x354151-0x0;var _0x2ecc93=_0xd70e[_0x354151];return _0x2ecc93;};'use strict';var _=require(_0xed70('0x0'));var util=require('util');var moment=require(_0xed70('0x1'));var BPromise=require('bluebird');var rs=require(_0xed70('0x2'));var fs=require('fs');var Redis=require(_0xed70('0x3'));var db=require(_0xed70('0x4'))['db'];var utils=require(_0xed70('0x5'));var logger=require('../../config/logger')(_0xed70('0x6'));var config=require(_0xed70('0x7'));var jayson=require(_0xed70('0x8'));var client=jayson[_0xed70('0x9')][_0xed70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfd7a,_0x501e31,_0x261c16){return new BPromise(function(_0xc99d72,_0x34a5eb){return client[_0xed70('0xb')](_0x5cfd7a,_0x261c16)[_0xed70('0xc')](function(_0x1d995c){logger[_0xed70('0xd')](_0xed70('0xe'),_0x501e31,'request\x20sent');logger['debug'](_0xed70('0xf'),_0x501e31,_0xed70('0x10'),JSON['stringify'](_0x1d995c));if(_0x1d995c[_0xed70('0x11')]){if(_0x1d995c[_0xed70('0x11')][_0xed70('0x12')]===0x1f4){logger[_0xed70('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x501e31,_0x1d995c['error'][_0xed70('0x13')]);return _0x34a5eb(_0x1d995c['error']['message']);}logger['error'](_0xed70('0xe'),_0x501e31,_0x1d995c[_0xed70('0x11')][_0xed70('0x13')]);return _0xc99d72(_0x1d995c[_0xed70('0x11')][_0xed70('0x13')]);}else{logger[_0xed70('0xd')](_0xed70('0xe'),_0x501e31,_0xed70('0x10'));_0xc99d72(_0x1d995c[_0xed70('0x14')][_0xed70('0x13')]);}})[_0xed70('0x15')](function(_0xdc419d){logger[_0xed70('0x11')](_0xed70('0xe'),_0x501e31,_0xdc419d);_0x34a5eb(_0xdc419d);});});} \ No newline at end of file +var _0xf923=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x34812a,_0xdc7fb4){var _0x100ff4=function(_0x1f09c1){while(--_0x1f09c1){_0x34812a['push'](_0x34812a['shift']());}};_0x100ff4(++_0xdc7fb4);}(_0xf923,0x18a));var _0x3f92=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0xf923[_0x470f63];return _0x4f09e2;};'use strict';var _=require('lodash');var util=require(_0x3f92('0x0'));var moment=require(_0x3f92('0x1'));var BPromise=require(_0x3f92('0x2'));var rs=require(_0x3f92('0x3'));var fs=require('fs');var Redis=require(_0x3f92('0x4'));var db=require(_0x3f92('0x5'))['db'];var utils=require(_0x3f92('0x6'));var logger=require(_0x3f92('0x7'))(_0x3f92('0x8'));var config=require(_0x3f92('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f92('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc0398,_0x2c5c38,_0x339623){return new BPromise(function(_0x49a264,_0x2aca38){return client[_0x3f92('0xb')](_0xc0398,_0x339623)[_0x3f92('0xc')](function(_0x55a1e0){logger[_0x3f92('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2c5c38,_0x3f92('0xe'));logger[_0x3f92('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2c5c38,_0x3f92('0xe'),JSON['stringify'](_0x55a1e0));if(_0x55a1e0[_0x3f92('0x10')]){if(_0x55a1e0[_0x3f92('0x10')][_0x3f92('0x11')]===0x1f4){logger[_0x3f92('0x10')](_0x3f92('0x12'),_0x2c5c38,_0x55a1e0[_0x3f92('0x10')][_0x3f92('0x13')]);return _0x2aca38(_0x55a1e0[_0x3f92('0x10')][_0x3f92('0x13')]);}logger[_0x3f92('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2c5c38,_0x55a1e0['error']['message']);return _0x49a264(_0x55a1e0[_0x3f92('0x10')][_0x3f92('0x13')]);}else{logger[_0x3f92('0xd')](_0x3f92('0x12'),_0x2c5c38,_0x3f92('0xe'));_0x49a264(_0x55a1e0[_0x3f92('0x14')][_0x3f92('0x13')]);}})[_0x3f92('0x15')](function(_0x2416cd){logger[_0x3f92('0x10')](_0x3f92('0x12'),_0x2c5c38,_0x2416cd);_0x2aca38(_0x2416cd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 1e4223b..14d78bd 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 _0xd48d=['update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xd48d,0xa3));var _0xdd48=function(_0x1d3671,_0x224f4f){_0x1d3671=_0x1d3671-0x0;var _0x42d63c=_0xd48d[_0x1d3671];return _0x42d63c;};'use strict';var multer=require(_0xdd48('0x0'));var util=require(_0xdd48('0x1'));var path=require(_0xdd48('0x2'));var timeout=require(_0xdd48('0x3'));var express=require(_0xdd48('0x4'));var router=express[_0xdd48('0x5')]();var fs_extra=require(_0xdd48('0x6'));var auth=require(_0xdd48('0x7'));var interaction=require(_0xdd48('0x8'));var config=require(_0xdd48('0x9'));var controller=require(_0xdd48('0xa'));router[_0xdd48('0xb')]('/',auth[_0xdd48('0xc')](),controller[_0xdd48('0xd')]);router[_0xdd48('0xb')](_0xdd48('0xe'),auth[_0xdd48('0xc')](),controller[_0xdd48('0xf')]);router[_0xdd48('0xb')](_0xdd48('0x10'),auth[_0xdd48('0xc')](),controller[_0xdd48('0x11')]);router[_0xdd48('0xb')](_0xdd48('0x12'),auth[_0xdd48('0xc')](),controller[_0xdd48('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd48('0x14')]);router['put'](_0xdd48('0x10'),auth[_0xdd48('0xc')](),controller[_0xdd48('0x15')]);router['delete'](_0xdd48('0x10'),auth[_0xdd48('0xc')](),controller['destroy']);module[_0xdd48('0x16')]=router; \ No newline at end of file +var _0xd8ec=['./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/questions','getQuestions','create','update','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x160cd2,_0x1aa35b){var _0x109508=function(_0x3415da){while(--_0x3415da){_0x160cd2['push'](_0x160cd2['shift']());}};_0x109508(++_0x1aa35b);}(_0xd8ec,0x1e7));var _0xcd8e=function(_0x1043ea,_0x22d2bb){_0x1043ea=_0x1043ea-0x0;var _0x3b9cf6=_0xd8ec[_0x1043ea];return _0x3b9cf6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd8e('0x0'));var timeout=require('connect-timeout');var express=require(_0xcd8e('0x1'));var router=express[_0xcd8e('0x2')]();var fs_extra=require(_0xcd8e('0x3'));var auth=require(_0xcd8e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcd8e('0x5'));var controller=require(_0xcd8e('0x6'));router[_0xcd8e('0x7')]('/',auth['isAuthenticated'](),controller[_0xcd8e('0x8')]);router['get'](_0xcd8e('0x9'),auth[_0xcd8e('0xa')](),controller['describe']);router[_0xcd8e('0x7')](_0xcd8e('0xb'),auth[_0xcd8e('0xa')](),controller[_0xcd8e('0xc')]);router[_0xcd8e('0x7')](_0xcd8e('0xd'),auth['isAuthenticated'](),controller[_0xcd8e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcd8e('0xf')]);router['put'](_0xcd8e('0xb'),auth[_0xcd8e('0xa')](),controller[_0xcd8e('0x10')]);router['delete'](_0xcd8e('0xb'),auth[_0xcd8e('0xa')](),controller['destroy']);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 8bb5181..9d5051d 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 _0xb331=['DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xb331,0xd9));var _0x1b33=function(_0x21734c,_0x40aadb){_0x21734c=_0x21734c-0x0;var _0x5e7da6=_0xb331[_0x21734c];return _0x5e7da6;};'use strict';var moment=require(_0x1b33('0x0'));var Sequelize=require(_0x1b33('0x1'));module[_0x1b33('0x2')]={'starttime':{'type':Sequelize[_0x1b33('0x3')],'set':function(_0x3e592c){this['setDataValue'](_0x1b33('0x4'),_0x3e592c);this[_0x1b33('0x5')](_0x1b33('0x6'),moment()[_0x1b33('0x7')](_0x1b33('0x8')));}},'endtime':{'type':Sequelize[_0x1b33('0x3')]},'membername':{'type':Sequelize[_0x1b33('0x9')]},'projectname':{'type':Sequelize[_0x1b33('0x9')]},'queue':{'type':Sequelize[_0x1b33('0x9')]},'uniqueid':{'type':Sequelize[_0x1b33('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1b33('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2000=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue'];(function(_0x18d50f,_0x124aff){var _0x8ce385=function(_0x321962){while(--_0x321962){_0x18d50f['push'](_0x18d50f['shift']());}};_0x8ce385(++_0x124aff);}(_0x2000,0x68));var _0x0200=function(_0x41dc2e,_0x44477a){_0x41dc2e=_0x41dc2e-0x0;var _0x5b6582=_0x2000[_0x41dc2e];return _0x5b6582;};'use strict';var moment=require(_0x0200('0x0'));var Sequelize=require(_0x0200('0x1'));module[_0x0200('0x2')]={'starttime':{'type':Sequelize[_0x0200('0x3')],'set':function(_0x3224b4){this['setDataValue'](_0x0200('0x4'),_0x3224b4);this[_0x0200('0x5')](_0x0200('0x6'),moment()['format'](_0x0200('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x0200('0x8')]},'queue':{'type':Sequelize[_0x0200('0x8')]},'uniqueid':{'type':Sequelize[_0x0200('0x8')]},'calleridname':{'type':Sequelize[_0x0200('0x8')]},'calleridnum':{'type':Sequelize[_0x0200('0x8')]},'completed':{'type':Sequelize[_0x0200('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8d58bd6..09daf0e 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 _0x9df8=['status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','describe','getQuestions','findOne','nolimit','SessionId','JscriptyQuestionReport','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb'];(function(_0x431cde,_0x819072){var _0x1ea03c=function(_0x190c20){while(--_0x190c20){_0x431cde['push'](_0x431cde['shift']());}};_0x1ea03c(++_0x819072);}(_0x9df8,0xd8));var _0x89df=function(_0x27a8fc,_0x15bd0d){_0x27a8fc=_0x27a8fc-0x0;var _0x3802dd=_0x9df8[_0x27a8fc];return _0x3802dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89df('0x0'));var zipdir=require(_0x89df('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89df('0x2'));var moment=require(_0x89df('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x89df('0x4'));var util=require(_0x89df('0x5'));var path=require(_0x89df('0x6'));var sox=require(_0x89df('0x7'));var csv=require(_0x89df('0x8'));var ejs=require(_0x89df('0x9'));var fs=require('fs');var fs_extra=require(_0x89df('0xa'));var _=require(_0x89df('0xb'));var squel=require(_0x89df('0xc'));var crypto=require(_0x89df('0xd'));var jsforce=require(_0x89df('0xe'));var deskjs=require(_0x89df('0xf'));var toCsv=require(_0x89df('0x8'));var querystring=require(_0x89df('0x10'));var Papa=require(_0x89df('0x11'));var Redis=require(_0x89df('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x89df('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x89df('0x14'))(_0x89df('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x89df('0x16'));var db=require(_0x89df('0x17'))['db'];function respondWithStatusCode(_0x419a42,_0x5a4723){_0x5a4723=_0x5a4723||0xcc;return function(_0x61a5fc){if(_0x61a5fc){return _0x419a42['sendStatus'](_0x5a4723);}return _0x419a42[_0x89df('0x18')](_0x5a4723)['end']();};}function respondWithResult(_0x1646c9,_0x39e0bd){_0x39e0bd=_0x39e0bd||0xc8;return function(_0x255e3d){if(_0x255e3d){return _0x1646c9[_0x89df('0x18')](_0x39e0bd)[_0x89df('0x19')](_0x255e3d);}};}function respondWithFilteredResult(_0x1a5d6e,_0x1fbac1){return function(_0x5e646c){if(_0x5e646c){var _0x5a104e=typeof _0x1fbac1[_0x89df('0x1a')]==='undefined'&&typeof _0x1fbac1[_0x89df('0x1b')]===_0x89df('0x1c');var _0x59e77a=_0x5e646c[_0x89df('0x1d')];var _0x5d1d6a=_0x5a104e?0x0:_0x1fbac1[_0x89df('0x1a')];var _0x58df79=_0x5a104e?_0x5e646c[_0x89df('0x1d')]:_0x1fbac1[_0x89df('0x1a')]+_0x1fbac1['limit'];var _0x372ae4;if(_0x58df79>=_0x59e77a){_0x58df79=_0x59e77a;_0x372ae4=0xc8;}else{_0x372ae4=0xce;}_0x1a5d6e[_0x89df('0x18')](_0x372ae4);return _0x1a5d6e[_0x89df('0x1e')]('Content-Range',_0x5d1d6a+'-'+_0x58df79+'/'+_0x59e77a)[_0x89df('0x19')](_0x5e646c);}return null;};}function patchUpdates(_0x253cb7){return function(_0x3aa603){try{jsonpatch[_0x89df('0x1f')](_0x3aa603,_0x253cb7,!![]);}catch(_0x466569){return BPromise[_0x89df('0x20')](_0x466569);}return _0x3aa603[_0x89df('0x21')]();};}function saveUpdates(_0x15b2a6,_0xb11c33){return function(_0x194c49){if(_0x194c49){return _0x194c49[_0x89df('0x22')](_0x15b2a6)['then'](function(_0x516bf9){return _0x516bf9;});}return null;};}function removeEntity(_0x43406b,_0x25a950){return function(_0x23c28d){if(_0x23c28d){return _0x23c28d[_0x89df('0x23')]()[_0x89df('0x24')](function(){_0x43406b[_0x89df('0x18')](0xcc)[_0x89df('0x25')]();});}};}function handleEntityNotFound(_0x11139f,_0x125880){return function(_0x5b1a4f){if(!_0x5b1a4f){_0x11139f[_0x89df('0x26')](0x194);}return _0x5b1a4f;};}function handleError(_0x387754,_0x1ca898){_0x1ca898=_0x1ca898||0x1f4;return function(_0x41f335){logger[_0x89df('0x27')](_0x41f335[_0x89df('0x28')]);if(_0x41f335[_0x89df('0x29')]){delete _0x41f335[_0x89df('0x29')];}_0x387754['status'](_0x1ca898)[_0x89df('0x2a')](_0x41f335);};}exports[_0x89df('0x2b')]=function(_0x386caf,_0x20a044){var _0x1ba85a={},_0x4b86aa={},_0x52b44d={'count':0x0,'rows':[]};var _0x2f34b1=_[_0x89df('0x2c')](db[_0x89df('0x2d')][_0x89df('0x2e')],function(_0xd1d540){return{'name':_0xd1d540['fieldName'],'type':_0xd1d540[_0x89df('0x2f')][_0x89df('0x30')]};});_0x4b86aa[_0x89df('0x31')]=_['map'](_0x2f34b1,_0x89df('0x29'));_0x4b86aa['query']=_['keys'](_0x386caf['query']);_0x4b86aa['filters']=_[_0x89df('0x32')](_0x4b86aa[_0x89df('0x31')],_0x4b86aa[_0x89df('0x33')]);_0x1ba85a['attributes']=_['intersection'](_0x4b86aa[_0x89df('0x31')],qs['fields'](_0x386caf['query'][_0x89df('0x34')]));_0x1ba85a['attributes']=_0x1ba85a[_0x89df('0x35')][_0x89df('0x36')]?_0x1ba85a[_0x89df('0x35')]:_0x4b86aa[_0x89df('0x31')];if(!_0x386caf['query'][_0x89df('0x37')]('nolimit')){_0x1ba85a['limit']=qs['limit'](_0x386caf[_0x89df('0x33')][_0x89df('0x1b')]);_0x1ba85a[_0x89df('0x1a')]=qs['offset'](_0x386caf[_0x89df('0x33')][_0x89df('0x1a')]);}_0x1ba85a[_0x89df('0x38')]=qs['sort'](_0x386caf[_0x89df('0x33')][_0x89df('0x39')]);_0x1ba85a[_0x89df('0x3a')]=qs[_0x89df('0x3b')](_[_0x89df('0x3c')](_0x386caf[_0x89df('0x33')],_0x4b86aa['filters']),_0x2f34b1);if(_0x386caf[_0x89df('0x33')]['filter']){_0x1ba85a[_0x89df('0x3a')]=_[_0x89df('0x3d')](_0x1ba85a[_0x89df('0x3a')],{'$or':_[_0x89df('0x2c')](_0x2f34b1,function(_0x2c1df5){if(_0x2c1df5[_0x89df('0x2f')]!=='VIRTUAL'){var _0x185e16={};_0x185e16[_0x2c1df5[_0x89df('0x29')]]={'$like':'%'+_0x386caf[_0x89df('0x33')][_0x89df('0x3e')]+'%'};return _0x185e16;}})});}_0x1ba85a=_['merge']({},_0x1ba85a,_0x386caf['options']);var _0x35061d={'where':_0x1ba85a[_0x89df('0x3a')]};return db[_0x89df('0x2d')][_0x89df('0x1d')](_0x35061d)[_0x89df('0x24')](function(_0x10523b){_0x52b44d[_0x89df('0x1d')]=_0x10523b;if(_0x386caf[_0x89df('0x33')][_0x89df('0x3f')]){_0x1ba85a[_0x89df('0x40')]=[{'all':!![]}];}return db[_0x89df('0x2d')][_0x89df('0x41')](_0x1ba85a);})['then'](function(_0x5e21da){_0x52b44d[_0x89df('0x42')]=_0x5e21da;return _0x52b44d;})[_0x89df('0x24')](respondWithFilteredResult(_0x20a044,_0x1ba85a))[_0x89df('0x43')](handleError(_0x20a044,null));};exports['show']=function(_0x523bf4,_0x479705){var _0x3a7f6b={'raw':!![],'where':{'id':_0x523bf4[_0x89df('0x44')]['id']}},_0x1a8736={};_0x1a8736[_0x89df('0x31')]=_['keys'](db[_0x89df('0x2d')][_0x89df('0x2e')]);_0x1a8736[_0x89df('0x33')]=_[_0x89df('0x45')](_0x523bf4[_0x89df('0x33')]);_0x1a8736['filters']=_[_0x89df('0x32')](_0x1a8736['model'],_0x1a8736['query']);_0x3a7f6b[_0x89df('0x35')]=_[_0x89df('0x32')](_0x1a8736[_0x89df('0x31')],qs[_0x89df('0x34')](_0x523bf4[_0x89df('0x33')][_0x89df('0x34')]));_0x3a7f6b[_0x89df('0x35')]=_0x3a7f6b['attributes'][_0x89df('0x36')]?_0x3a7f6b[_0x89df('0x35')]:_0x1a8736[_0x89df('0x31')];if(_0x523bf4[_0x89df('0x33')][_0x89df('0x3f')]){_0x3a7f6b[_0x89df('0x40')]=[{'all':!![]}];}_0x3a7f6b=_[_0x89df('0x3d')]({},_0x3a7f6b,_0x523bf4[_0x89df('0x46')]);return db[_0x89df('0x2d')][_0x89df('0x47')](_0x3a7f6b)[_0x89df('0x24')](handleEntityNotFound(_0x479705,null))[_0x89df('0x24')](respondWithResult(_0x479705,null))['catch'](handleError(_0x479705,null));};exports[_0x89df('0x48')]=function(_0x467370,_0x2988e5){return db[_0x89df('0x2d')]['create'](_0x467370[_0x89df('0x49')],{})[_0x89df('0x24')](respondWithResult(_0x2988e5,0xc9))[_0x89df('0x43')](handleError(_0x2988e5,null));};exports[_0x89df('0x22')]=function(_0x1cc36b,_0x5b3d01){if(_0x1cc36b['body']['id']){delete _0x1cc36b[_0x89df('0x49')]['id'];}return db[_0x89df('0x2d')]['find']({'where':{'id':_0x1cc36b[_0x89df('0x44')]['id']}})[_0x89df('0x24')](handleEntityNotFound(_0x5b3d01,null))[_0x89df('0x24')](saveUpdates(_0x1cc36b[_0x89df('0x49')],null))[_0x89df('0x24')](respondWithResult(_0x5b3d01,null))[_0x89df('0x43')](handleError(_0x5b3d01,null));};exports[_0x89df('0x23')]=function(_0xc35fc6,_0x4ce570){return db['JscriptySessionReport']['find']({'where':{'id':_0xc35fc6[_0x89df('0x44')]['id']}})[_0x89df('0x24')](handleEntityNotFound(_0x4ce570,null))[_0x89df('0x24')](removeEntity(_0x4ce570,null))[_0x89df('0x43')](handleError(_0x4ce570,null));};exports[_0x89df('0x4a')]=function(_0x379bac,_0x25741a){return db[_0x89df('0x2d')][_0x89df('0x4a')]()['then'](respondWithResult(_0x25741a,null))[_0x89df('0x43')](handleError(_0x25741a,null));};exports[_0x89df('0x4b')]=function(_0x14fe08,_0x1d4870,_0x1f6fff){var _0x4f5b80={'raw':!![],'where':{}};var _0x3dd3d3={};var _0x29433d={'count':0x0,'rows':[]};return db[_0x89df('0x2d')][_0x89df('0x4c')]({'where':{'id':_0x14fe08[_0x89df('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d4870,null))[_0x89df('0x24')](function(_0x53ea21){if(_0x53ea21){_0x3dd3d3[_0x89df('0x31')]=_[_0x89df('0x45')](db['JscriptyQuestionReport']['rawAttributes']);_0x3dd3d3[_0x89df('0x33')]=_[_0x89df('0x45')](_0x14fe08['query']);_0x3dd3d3[_0x89df('0x3b')]=_[_0x89df('0x32')](_0x3dd3d3[_0x89df('0x31')],_0x3dd3d3[_0x89df('0x33')]);_0x4f5b80[_0x89df('0x35')]=_['intersection'](_0x3dd3d3[_0x89df('0x31')],qs['fields'](_0x14fe08[_0x89df('0x33')][_0x89df('0x34')]));_0x4f5b80[_0x89df('0x35')]=_0x4f5b80[_0x89df('0x35')]['length']?_0x4f5b80[_0x89df('0x35')]:_0x3dd3d3['model'];if(!_0x14fe08['query'][_0x89df('0x37')](_0x89df('0x4d'))){_0x4f5b80[_0x89df('0x1b')]=qs[_0x89df('0x1b')](_0x14fe08[_0x89df('0x33')]['limit']);_0x4f5b80[_0x89df('0x1a')]=qs[_0x89df('0x1a')](_0x14fe08[_0x89df('0x33')][_0x89df('0x1a')]);}_0x4f5b80['order']=qs['sort'](_0x14fe08[_0x89df('0x33')][_0x89df('0x39')]);_0x4f5b80[_0x89df('0x3a')]=qs[_0x89df('0x3b')](_[_0x89df('0x3c')](_0x14fe08[_0x89df('0x33')],_0x3dd3d3['filters']));_0x4f5b80['where'][_0x89df('0x4e')]=_0x53ea21['id'];if(_0x14fe08['query'][_0x89df('0x3e')]){_0x4f5b80[_0x89df('0x3a')]=_[_0x89df('0x3d')](_0x4f5b80[_0x89df('0x3a')],{'$or':_[_0x89df('0x2c')](_0x4f5b80[_0x89df('0x35')],function(_0x38963a){var _0x29f704={};_0x29f704[_0x38963a]={'$like':'%'+_0x14fe08['query'][_0x89df('0x3e')]+'%'};return _0x29f704;})});}_0x4f5b80=_[_0x89df('0x3d')]({},_0x4f5b80,_0x14fe08[_0x89df('0x46')]);return db[_0x89df('0x4f')]['count']({'where':_0x4f5b80[_0x89df('0x3a')]})[_0x89df('0x24')](function(_0x34b350){_0x29433d['count']=_0x34b350;if(_0x14fe08[_0x89df('0x33')]['includeAll']){_0x4f5b80[_0x89df('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x89df('0x41')](_0x4f5b80);})[_0x89df('0x24')](function(_0x146736){_0x29433d[_0x89df('0x42')]=_0x146736;return _0x29433d;});}})[_0x89df('0x24')](respondWithFilteredResult(_0x1d4870,_0x4f5b80))['catch'](handleError(_0x1d4870,null));}; \ No newline at end of file +var _0x55e6=['destroy','then','error','stack','name','send','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','JscriptySessionReport','findAll','rows','show','params','include','create','body','catch','find','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','update'];(function(_0x349863,_0x101fb7){var _0x1d93f6=function(_0xb2a316){while(--_0xb2a316){_0x349863['push'](_0x349863['shift']());}};_0x1d93f6(++_0x101fb7);}(_0x55e6,0x163));var _0x655e=function(_0x34f3fe,_0x5312ab){_0x34f3fe=_0x34f3fe-0x0;var _0x25e034=_0x55e6[_0x34f3fe];return _0x25e034;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x655e('0x0'));var zipdir=require(_0x655e('0x1'));var jsonpatch=require(_0x655e('0x2'));var rp=require(_0x655e('0x3'));var moment=require(_0x655e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x655e('0x5'));var path=require(_0x655e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x655e('0x7'));var _=require('lodash');var squel=require(_0x655e('0x8'));var crypto=require(_0x655e('0x9'));var jsforce=require(_0x655e('0xa'));var deskjs=require(_0x655e('0xb'));var toCsv=require(_0x655e('0xc'));var querystring=require(_0x655e('0xd'));var Papa=require(_0x655e('0xe'));var Redis=require(_0x655e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x655e('0x10'));var as=require(_0x655e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x655e('0x12'));var utils=require(_0x655e('0x13'));var config=require(_0x655e('0x14'));var licenseUtil=require(_0x655e('0x15'));var db=require(_0x655e('0x16'))['db'];function respondWithStatusCode(_0x3f0f85,_0x4875ce){_0x4875ce=_0x4875ce||0xcc;return function(_0x5773be){if(_0x5773be){return _0x3f0f85[_0x655e('0x17')](_0x4875ce);}return _0x3f0f85['status'](_0x4875ce)[_0x655e('0x18')]();};}function respondWithResult(_0x4ea9c6,_0x3fdee3){_0x3fdee3=_0x3fdee3||0xc8;return function(_0x5ccc32){if(_0x5ccc32){return _0x4ea9c6[_0x655e('0x19')](_0x3fdee3)[_0x655e('0x1a')](_0x5ccc32);}};}function respondWithFilteredResult(_0x47260a,_0x28e29f){return function(_0x203100){if(_0x203100){var _0x1c3cec=typeof _0x28e29f['offset']===_0x655e('0x1b')&&typeof _0x28e29f['limit']===_0x655e('0x1b');var _0x1f3167=_0x203100[_0x655e('0x1c')];var _0x483526=_0x1c3cec?0x0:_0x28e29f[_0x655e('0x1d')];var _0x41a9b2=_0x1c3cec?_0x203100[_0x655e('0x1c')]:_0x28e29f[_0x655e('0x1d')]+_0x28e29f[_0x655e('0x1e')];var _0x12f0ca;if(_0x41a9b2>=_0x1f3167){_0x41a9b2=_0x1f3167;_0x12f0ca=0xc8;}else{_0x12f0ca=0xce;}_0x47260a[_0x655e('0x19')](_0x12f0ca);return _0x47260a[_0x655e('0x1f')]('Content-Range',_0x483526+'-'+_0x41a9b2+'/'+_0x1f3167)['json'](_0x203100);}return null;};}function patchUpdates(_0x551c47){return function(_0x4c4353){try{jsonpatch[_0x655e('0x20')](_0x4c4353,_0x551c47,!![]);}catch(_0x250e62){return BPromise[_0x655e('0x21')](_0x250e62);}return _0x4c4353['save']();};}function saveUpdates(_0x3f93f3,_0x1ddffd){return function(_0x389c2f){if(_0x389c2f){return _0x389c2f[_0x655e('0x22')](_0x3f93f3)['then'](function(_0x46e040){return _0x46e040;});}return null;};}function removeEntity(_0x207f0c,_0x166c45){return function(_0x54dd9c){if(_0x54dd9c){return _0x54dd9c[_0x655e('0x23')]()[_0x655e('0x24')](function(){_0x207f0c[_0x655e('0x19')](0xcc)[_0x655e('0x18')]();});}};}function handleEntityNotFound(_0xf528bc,_0x31e7e9){return function(_0x482bd6){if(!_0x482bd6){_0xf528bc[_0x655e('0x17')](0x194);}return _0x482bd6;};}function handleError(_0x2f4c7a,_0x25e48c){_0x25e48c=_0x25e48c||0x1f4;return function(_0x4501b7){logger[_0x655e('0x25')](_0x4501b7[_0x655e('0x26')]);if(_0x4501b7[_0x655e('0x27')]){delete _0x4501b7[_0x655e('0x27')];}_0x2f4c7a[_0x655e('0x19')](_0x25e48c)[_0x655e('0x28')](_0x4501b7);};}exports['index']=function(_0x3f6b68,_0x1204ab){var _0x2074a8={},_0x418e2b={},_0x4b3438={'count':0x0,'rows':[]};var _0x37d6ef=_['map'](db['JscriptySessionReport'][_0x655e('0x29')],function(_0x5b68a5){return{'name':_0x5b68a5[_0x655e('0x2a')],'type':_0x5b68a5[_0x655e('0x2b')]['key']};});_0x418e2b[_0x655e('0x2c')]=_['map'](_0x37d6ef,'name');_0x418e2b[_0x655e('0x2d')]=_[_0x655e('0x2e')](_0x3f6b68['query']);_0x418e2b['filters']=_[_0x655e('0x2f')](_0x418e2b[_0x655e('0x2c')],_0x418e2b[_0x655e('0x2d')]);_0x2074a8[_0x655e('0x30')]=_['intersection'](_0x418e2b['model'],qs[_0x655e('0x31')](_0x3f6b68[_0x655e('0x2d')][_0x655e('0x31')]));_0x2074a8['attributes']=_0x2074a8[_0x655e('0x30')][_0x655e('0x32')]?_0x2074a8['attributes']:_0x418e2b['model'];if(!_0x3f6b68[_0x655e('0x2d')]['hasOwnProperty'](_0x655e('0x33'))){_0x2074a8[_0x655e('0x1e')]=qs[_0x655e('0x1e')](_0x3f6b68['query'][_0x655e('0x1e')]);_0x2074a8['offset']=qs['offset'](_0x3f6b68[_0x655e('0x2d')][_0x655e('0x1d')]);}_0x2074a8[_0x655e('0x34')]=qs[_0x655e('0x35')](_0x3f6b68[_0x655e('0x2d')]['sort']);_0x2074a8[_0x655e('0x36')]=qs[_0x655e('0x37')](_[_0x655e('0x38')](_0x3f6b68[_0x655e('0x2d')],_0x418e2b[_0x655e('0x37')]),_0x37d6ef);if(_0x3f6b68['query'][_0x655e('0x39')]){_0x2074a8[_0x655e('0x36')]=_[_0x655e('0x3a')](_0x2074a8[_0x655e('0x36')],{'$or':_[_0x655e('0x3b')](_0x37d6ef,function(_0x962f2){if(_0x962f2[_0x655e('0x2b')]!==_0x655e('0x3c')){var _0x32a6be={};_0x32a6be[_0x962f2[_0x655e('0x27')]]={'$like':'%'+_0x3f6b68[_0x655e('0x2d')][_0x655e('0x39')]+'%'};return _0x32a6be;}})});}_0x2074a8=_[_0x655e('0x3a')]({},_0x2074a8,_0x3f6b68[_0x655e('0x3d')]);var _0x1f27de={'where':_0x2074a8[_0x655e('0x36')]};return db['JscriptySessionReport'][_0x655e('0x1c')](_0x1f27de)['then'](function(_0x19ceed){_0x4b3438[_0x655e('0x1c')]=_0x19ceed;if(_0x3f6b68[_0x655e('0x2d')][_0x655e('0x3e')]){_0x2074a8['include']=[{'all':!![]}];}return db[_0x655e('0x3f')][_0x655e('0x40')](_0x2074a8);})[_0x655e('0x24')](function(_0x12999a){_0x4b3438[_0x655e('0x41')]=_0x12999a;return _0x4b3438;})[_0x655e('0x24')](respondWithFilteredResult(_0x1204ab,_0x2074a8))['catch'](handleError(_0x1204ab,null));};exports[_0x655e('0x42')]=function(_0x299e75,_0x16fa0a){var _0x463220={'raw':!![],'where':{'id':_0x299e75[_0x655e('0x43')]['id']}},_0x2bcca0={};_0x2bcca0['model']=_['keys'](db['JscriptySessionReport'][_0x655e('0x29')]);_0x2bcca0['query']=_[_0x655e('0x2e')](_0x299e75['query']);_0x2bcca0['filters']=_['intersection'](_0x2bcca0['model'],_0x2bcca0[_0x655e('0x2d')]);_0x463220[_0x655e('0x30')]=_[_0x655e('0x2f')](_0x2bcca0[_0x655e('0x2c')],qs[_0x655e('0x31')](_0x299e75[_0x655e('0x2d')][_0x655e('0x31')]));_0x463220['attributes']=_0x463220[_0x655e('0x30')][_0x655e('0x32')]?_0x463220[_0x655e('0x30')]:_0x2bcca0[_0x655e('0x2c')];if(_0x299e75[_0x655e('0x2d')][_0x655e('0x3e')]){_0x463220[_0x655e('0x44')]=[{'all':!![]}];}_0x463220=_['merge']({},_0x463220,_0x299e75[_0x655e('0x3d')]);return db[_0x655e('0x3f')]['find'](_0x463220)[_0x655e('0x24')](handleEntityNotFound(_0x16fa0a,null))[_0x655e('0x24')](respondWithResult(_0x16fa0a,null))['catch'](handleError(_0x16fa0a,null));};exports['create']=function(_0x2ec5e8,_0x268534){return db[_0x655e('0x3f')][_0x655e('0x45')](_0x2ec5e8[_0x655e('0x46')],{})['then'](respondWithResult(_0x268534,0xc9))[_0x655e('0x47')](handleError(_0x268534,null));};exports['update']=function(_0x506eac,_0x50f2fd){if(_0x506eac[_0x655e('0x46')]['id']){delete _0x506eac[_0x655e('0x46')]['id'];}return db[_0x655e('0x3f')]['find']({'where':{'id':_0x506eac['params']['id']}})[_0x655e('0x24')](handleEntityNotFound(_0x50f2fd,null))[_0x655e('0x24')](saveUpdates(_0x506eac['body'],null))['then'](respondWithResult(_0x50f2fd,null))[_0x655e('0x47')](handleError(_0x50f2fd,null));};exports[_0x655e('0x23')]=function(_0x46f034,_0x3d3e06){return db['JscriptySessionReport'][_0x655e('0x48')]({'where':{'id':_0x46f034[_0x655e('0x43')]['id']}})[_0x655e('0x24')](handleEntityNotFound(_0x3d3e06,null))[_0x655e('0x24')](removeEntity(_0x3d3e06,null))[_0x655e('0x47')](handleError(_0x3d3e06,null));};exports[_0x655e('0x49')]=function(_0x28bb3a,_0x5662f1){return db[_0x655e('0x3f')][_0x655e('0x49')]()['then'](respondWithResult(_0x5662f1,null))[_0x655e('0x47')](handleError(_0x5662f1,null));};exports[_0x655e('0x4a')]=function(_0x2cb039,_0x562ba2,_0x4f8ed8){var _0xb8fb48={'raw':!![],'where':{}};var _0x55ceb6={};var _0x50023b={'count':0x0,'rows':[]};return db[_0x655e('0x3f')][_0x655e('0x4b')]({'where':{'id':_0x2cb039[_0x655e('0x43')]['id']}})[_0x655e('0x24')](handleEntityNotFound(_0x562ba2,null))['then'](function(_0x55a6de){if(_0x55a6de){_0x55ceb6['model']=_[_0x655e('0x2e')](db[_0x655e('0x4c')]['rawAttributes']);_0x55ceb6[_0x655e('0x2d')]=_[_0x655e('0x2e')](_0x2cb039[_0x655e('0x2d')]);_0x55ceb6[_0x655e('0x37')]=_[_0x655e('0x2f')](_0x55ceb6[_0x655e('0x2c')],_0x55ceb6[_0x655e('0x2d')]);_0xb8fb48['attributes']=_['intersection'](_0x55ceb6[_0x655e('0x2c')],qs[_0x655e('0x31')](_0x2cb039[_0x655e('0x2d')]['fields']));_0xb8fb48[_0x655e('0x30')]=_0xb8fb48[_0x655e('0x30')][_0x655e('0x32')]?_0xb8fb48['attributes']:_0x55ceb6['model'];if(!_0x2cb039['query'][_0x655e('0x4d')](_0x655e('0x33'))){_0xb8fb48[_0x655e('0x1e')]=qs[_0x655e('0x1e')](_0x2cb039[_0x655e('0x2d')][_0x655e('0x1e')]);_0xb8fb48[_0x655e('0x1d')]=qs[_0x655e('0x1d')](_0x2cb039[_0x655e('0x2d')][_0x655e('0x1d')]);}_0xb8fb48[_0x655e('0x34')]=qs['sort'](_0x2cb039[_0x655e('0x2d')][_0x655e('0x35')]);_0xb8fb48[_0x655e('0x36')]=qs['filters'](_[_0x655e('0x38')](_0x2cb039[_0x655e('0x2d')],_0x55ceb6[_0x655e('0x37')]));_0xb8fb48['where']['SessionId']=_0x55a6de['id'];if(_0x2cb039[_0x655e('0x2d')][_0x655e('0x39')]){_0xb8fb48['where']=_[_0x655e('0x3a')](_0xb8fb48[_0x655e('0x36')],{'$or':_['map'](_0xb8fb48[_0x655e('0x30')],function(_0x19d131){var _0x3872dc={};_0x3872dc[_0x19d131]={'$like':'%'+_0x2cb039[_0x655e('0x2d')]['filter']+'%'};return _0x3872dc;})});}_0xb8fb48=_[_0x655e('0x3a')]({},_0xb8fb48,_0x2cb039['options']);return db[_0x655e('0x4c')]['count']({'where':_0xb8fb48[_0x655e('0x36')]})[_0x655e('0x24')](function(_0x48aa9f){_0x50023b[_0x655e('0x1c')]=_0x48aa9f;if(_0x2cb039[_0x655e('0x2d')]['includeAll']){_0xb8fb48['include']=[{'all':!![]}];}return db[_0x655e('0x4c')][_0x655e('0x40')](_0xb8fb48);})[_0x655e('0x24')](function(_0x1feca3){_0x50023b[_0x655e('0x41')]=_0x1feca3;return _0x50023b;});}})[_0x655e('0x24')](respondWithFilteredResult(_0x562ba2,_0xb8fb48))[_0x655e('0x47')](handleError(_0x562ba2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index b8933b5..2662baa 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 _0x4c60=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','bluebird','./jscriptySessionReport.attributes','exports'];(function(_0xaa93c3,_0x831515){var _0x3ef263=function(_0x38702c){while(--_0x38702c){_0xaa93c3['push'](_0xaa93c3['shift']());}};_0x3ef263(++_0x831515);}(_0x4c60,0xc1));var _0x04c6=function(_0x66d089,_0x454d29){_0x66d089=_0x66d089-0x0;var _0x38caec=_0x4c60[_0x66d089];return _0x38caec;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash'];(function(_0x527c5f,_0x593d0d){var _0x38ae95=function(_0x32585b){while(--_0x32585b){_0x527c5f['push'](_0x527c5f['shift']());}};_0x38ae95(++_0x593d0d);}(_0x5496,0x175));var _0x6549=function(_0x4c2f0a,_0x2c3bf6){_0x4c2f0a=_0x4c2f0a-0x0;var _0x1deb1e=_0x5496[_0x4c2f0a];return _0x1deb1e;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x6549('0xa'),'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 23f043c..3c9ddbe 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 _0x8aad=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x10350e,_0x3b15c8){var _0x234946=function(_0x3d15a9){while(--_0x3d15a9){_0x10350e['push'](_0x10350e['shift']());}};_0x234946(++_0x3b15c8);}(_0x8aad,0x146));var _0xd8aa=function(_0x824451,_0x488ad0){_0x824451=_0x824451-0x0;var _0xdd7625=_0x8aad[_0x824451];return _0xdd7625;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});} \ No newline at end of file +var _0xf2e3=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x37cede,_0x4cb133){var _0x5a3bb4=function(_0x365517){while(--_0x365517){_0x37cede['push'](_0x37cede['shift']());}};_0x5a3bb4(++_0x4cb133);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xf2e3[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var moment=require(_0x3f2e('0x1'));var BPromise=require(_0x3f2e('0x2'));var rs=require(_0x3f2e('0x3'));var fs=require('fs');var Redis=require(_0x3f2e('0x4'));var db=require(_0x3f2e('0x5'))['db'];var utils=require(_0x3f2e('0x6'));var logger=require(_0x3f2e('0x7'))(_0x3f2e('0x8'));var config=require(_0x3f2e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f2e('0xa')][_0x3f2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c0864,_0xdf499f,_0x12c6e7){return new BPromise(function(_0x11067d,_0x3636f6){return client[_0x3f2e('0xc')](_0x3c0864,_0x12c6e7)[_0x3f2e('0xd')](function(_0x29a6cc){logger[_0x3f2e('0xe')](_0x3f2e('0xf'),_0xdf499f,_0x3f2e('0x10'));logger[_0x3f2e('0x11')](_0x3f2e('0x12'),_0xdf499f,_0x3f2e('0x10'),JSON[_0x3f2e('0x13')](_0x29a6cc));if(_0x29a6cc[_0x3f2e('0x14')]){if(_0x29a6cc[_0x3f2e('0x14')]['code']===0x1f4){logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x29a6cc['error'][_0x3f2e('0x15')]);return _0x3636f6(_0x29a6cc[_0x3f2e('0x14')][_0x3f2e('0x15')]);}logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x29a6cc['error'][_0x3f2e('0x15')]);return _0x11067d(_0x29a6cc[_0x3f2e('0x14')][_0x3f2e('0x15')]);}else{logger['info'](_0x3f2e('0xf'),_0xdf499f,_0x3f2e('0x10'));_0x11067d(_0x29a6cc[_0x3f2e('0x16')][_0x3f2e('0x15')]);}})[_0x3f2e('0x17')](function(_0x2fef73){logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x2fef73);_0x3636f6(_0x2fef73);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 84063e7..1e41e34 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 _0x6fd3=['/:id','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put'];(function(_0x57a4ba,_0x46f3c4){var _0x294cae=function(_0x11fa5a){while(--_0x11fa5a){_0x57a4ba['push'](_0x57a4ba['shift']());}};_0x294cae(++_0x46f3c4);}(_0x6fd3,0x104));var _0x36fd=function(_0x2e91cd,_0x40146a){_0x2e91cd=_0x2e91cd-0x0;var _0x2c6dbb=_0x6fd3[_0x2e91cd];return _0x2c6dbb;};'use strict';var multer=require(_0x36fd('0x0'));var util=require(_0x36fd('0x1'));var path=require(_0x36fd('0x2'));var timeout=require(_0x36fd('0x3'));var express=require(_0x36fd('0x4'));var router=express[_0x36fd('0x5')]();var fs_extra=require(_0x36fd('0x6'));var auth=require(_0x36fd('0x7'));var interaction=require(_0x36fd('0x8'));var config=require(_0x36fd('0x9'));var controller=require(_0x36fd('0xa'));router['get']('/',controller['index']);router[_0x36fd('0xb')](_0x36fd('0xc'),auth['isAuthenticated'](),controller[_0x36fd('0xd')]);router['get'](_0x36fd('0xe'),auth['isAuthenticated'](),controller[_0x36fd('0xf')]);module[_0x36fd('0x10')]=router; \ No newline at end of file +var _0xd6b5=['downloadLogFile','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','put','isAuthenticated','update'];(function(_0x19616a,_0x545c46){var _0x57bfb4=function(_0x9ab37b){while(--_0x9ab37b){_0x19616a['push'](_0x19616a['shift']());}};_0x57bfb4(++_0x545c46);}(_0xd6b5,0xfd));var _0x5d6b=function(_0x139f7a,_0x248510){_0x139f7a=_0x139f7a-0x0;var _0x1c76f4=_0xd6b5[_0x139f7a];return _0x1c76f4;};'use strict';var multer=require(_0x5d6b('0x0'));var util=require('util');var path=require(_0x5d6b('0x1'));var timeout=require(_0x5d6b('0x2'));var express=require(_0x5d6b('0x3'));var router=express['Router']();var fs_extra=require(_0x5d6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5d6b('0x5'));var config=require(_0x5d6b('0x6'));var controller=require('./license.controller');router['get']('/',controller[_0x5d6b('0x7')]);router[_0x5d6b('0x8')]('/:id',auth[_0x5d6b('0x9')](),controller[_0x5d6b('0xa')]);router['get']('/download_log_file',auth[_0x5d6b('0x9')](),controller[_0x5d6b('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f70c013..aa3a224 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 _0xeb86=['exports','TEXT','STRING','sequelize'];(function(_0x3cf053,_0x7a9947){var _0x3b55a0=function(_0x2a99cc){while(--_0x2a99cc){_0x3cf053['push'](_0x3cf053['shift']());}};_0x3b55a0(++_0x7a9947);}(_0xeb86,0x173));var _0x6eb8=function(_0x153e7e,_0x50ab0f){_0x153e7e=_0x153e7e-0x0;var _0x5d3b20=_0xeb86[_0x153e7e];return _0x5d3b20;};'use strict';var Sequelize=require(_0x6eb8('0x0'));module[_0x6eb8('0x1')]={'license':{'type':Sequelize[_0x6eb8('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6eb8('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xca9e=['INTEGER','sequelize','exports','STRING'];(function(_0x70c97a,_0xd4d263){var _0x5cb362=function(_0x163f30){while(--_0x163f30){_0x70c97a['push'](_0x70c97a['shift']());}};_0x5cb362(++_0xd4d263);}(_0xca9e,0x19d));var _0xeca9=function(_0x1950e1,_0x25e7b3){_0x1950e1=_0x1950e1-0x0;var _0x4b443d=_0xca9e[_0x1950e1];return _0x4b443d;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xeca9('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xeca9('0x3')],'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 96519bf..065da69 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 _0x845a=['join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','fields','attributes','merge','options','catch','body','get','demo','downloadLogFile','license-info.log'];(function(_0x4dc5de,_0x2ae308){var _0x30a07f=function(_0x32a54f){while(--_0x32a54f){_0x4dc5de['push'](_0x4dc5de['shift']());}};_0x30a07f(++_0x2ae308);}(_0x845a,0x115));var _0xa845=function(_0x4d93f4,_0x542242){_0x4d93f4=_0x4d93f4-0x0;var _0x48545d=_0x845a[_0x4d93f4];return _0x48545d;};'use strict';var emlformat=require(_0xa845('0x0'));var rimraf=require(_0xa845('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa845('0x2'));var rp=require('request-promise');var moment=require(_0xa845('0x3'));var BPromise=require(_0xa845('0x4'));var Mustache=require(_0xa845('0x5'));var util=require('util');var path=require(_0xa845('0x6'));var sox=require(_0xa845('0x7'));var csv=require(_0xa845('0x8'));var ejs=require(_0xa845('0x9'));var fs=require('fs');var fs_extra=require(_0xa845('0xa'));var _=require(_0xa845('0xb'));var squel=require(_0xa845('0xc'));var crypto=require(_0xa845('0xd'));var jsforce=require(_0xa845('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa845('0x8'));var querystring=require('querystring');var Papa=require(_0xa845('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa845('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa845('0x11'));var logger=require(_0xa845('0x12'))('api');var utils=require(_0xa845('0x13'));var config=require(_0xa845('0x14'));var licenseUtil=require(_0xa845('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59946c,_0x3dd3d4){_0x3dd3d4=_0x3dd3d4||0xcc;return function(_0x3bd051){if(_0x3bd051){return _0x59946c[_0xa845('0x16')](_0x3dd3d4);}return _0x59946c[_0xa845('0x17')](_0x3dd3d4)[_0xa845('0x18')]();};}function respondWithResult(_0x56ad02,_0x25a2cd){_0x25a2cd=_0x25a2cd||0xc8;return function(_0x232c16){if(_0x232c16){return _0x56ad02[_0xa845('0x17')](_0x25a2cd)['json'](_0x232c16);}};}function respondWithFilteredResult(_0x4fa8b0,_0x20e7d4){return function(_0x3ef403){if(_0x3ef403){var _0x4e31c4=typeof _0x20e7d4[_0xa845('0x19')]===_0xa845('0x1a')&&typeof _0x20e7d4[_0xa845('0x1b')]==='undefined';var _0x4a4a1f=_0x3ef403[_0xa845('0x1c')];var _0xb611f5=_0x4e31c4?0x0:_0x20e7d4['offset'];var _0x28b6b5=_0x4e31c4?_0x3ef403['count']:_0x20e7d4[_0xa845('0x19')]+_0x20e7d4[_0xa845('0x1b')];var _0x4ca180;if(_0x28b6b5>=_0x4a4a1f){_0x28b6b5=_0x4a4a1f;_0x4ca180=0xc8;}else{_0x4ca180=0xce;}_0x4fa8b0[_0xa845('0x17')](_0x4ca180);return _0x4fa8b0[_0xa845('0x1d')](_0xa845('0x1e'),_0xb611f5+'-'+_0x28b6b5+'/'+_0x4a4a1f)[_0xa845('0x1f')](_0x3ef403);}return null;};}function patchUpdates(_0x1e48df){return function(_0x359cba){try{jsonpatch['apply'](_0x359cba,_0x1e48df,!![]);}catch(_0x171c85){return BPromise[_0xa845('0x20')](_0x171c85);}return _0x359cba[_0xa845('0x21')]();};}function saveUpdates(_0x13f90c,_0x4ce832){return function(_0x5c5c62){if(_0x5c5c62){return _0x5c5c62[_0xa845('0x22')](_0x13f90c)[_0xa845('0x23')](function(_0x466336){return _0x466336;});}return null;};}function removeEntity(_0x2ec7c7,_0x4d036f){return function(_0x2de845){if(_0x2de845){return _0x2de845[_0xa845('0x24')]()['then'](function(){_0x2ec7c7['status'](0xcc)[_0xa845('0x18')]();});}};}function handleEntityNotFound(_0xe884df,_0x4fb865){return function(_0x3f518a){if(!_0x3f518a){_0xe884df[_0xa845('0x16')](0x194);}return _0x3f518a;};}function handleError(_0x126559,_0x2e28a9){_0x2e28a9=_0x2e28a9||0x1f4;return function(_0x24f3ab){logger['error'](_0x24f3ab[_0xa845('0x25')]);if(_0x24f3ab[_0xa845('0x26')]){delete _0x24f3ab['name'];}_0x126559[_0xa845('0x17')](_0x2e28a9)[_0xa845('0x27')](_0x24f3ab);};}var utilLicense=require('../../config/license/util');exports[_0xa845('0x28')]=function(_0x3b1d60,_0x3ded04){var _0x4f783f={'raw':!![],'where':{'id':0x1}},_0x5dab1b={};_0x5dab1b['model']=_[_0xa845('0x29')](db[_0xa845('0x2a')][_0xa845('0x2b')]);_0x5dab1b[_0xa845('0x2c')]=_[_0xa845('0x29')](_0x3b1d60[_0xa845('0x2c')]);_0x5dab1b[_0xa845('0x2d')]=_[_0xa845('0x2e')](_0x5dab1b[_0xa845('0x2f')],_0x5dab1b[_0xa845('0x2c')]);_0x4f783f['attributes']=_[_0xa845('0x2e')](_0x5dab1b[_0xa845('0x2f')],qs[_0xa845('0x30')](_0x3b1d60['query'][_0xa845('0x30')]));_0x4f783f[_0xa845('0x31')]=_0x4f783f['attributes']['length']?_0x4f783f['attributes']:_0x5dab1b[_0xa845('0x2f')];_0x4f783f=_[_0xa845('0x32')]({},_0x4f783f,_0x3b1d60[_0xa845('0x33')]);return utilLicense['getLicense'](_0x4f783f)['then'](respondWithResult(_0x3ded04,null))[_0xa845('0x34')](handleError(_0x3ded04,null));};exports[_0xa845('0x22')]=function(_0x180e41,_0x411aa3){if(_0x180e41[_0xa845('0x35')]['id']){delete _0x180e41[_0xa845('0x35')]['id'];}return db['License']['find']({'where':{'id':_0x180e41['params']['id']}})[_0xa845('0x23')](handleEntityNotFound(_0x411aa3,null))['then'](function(_0x33d8d6){var _0x25793a=_0x33d8d6[_0xa845('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x25793a,_0x180e41[_0xa845('0x35')]['key']);})[_0xa845('0x23')](function(_0x3f29cd){if(!_0x3f29cd[_0xa845('0x37')]){return saveUpdates(_0x180e41[_0xa845('0x35')],null);}return _0x3f29cd;})[_0xa845('0x23')](respondWithResult(_0x411aa3,null))[_0xa845('0x34')](handleError(_0x411aa3,null));};exports[_0xa845('0x38')]=function(_0x573db5,_0xd7af04){var _0x2f1591=_0xa845('0x39');var _0x2cd4f7=path[_0xa845('0x3a')](_0xa845('0x3b'),_0xa845('0x3c'),'xcally',_0x2f1591);_0xd7af04[_0xa845('0x3d')](_0xa845('0x3e'),_0xa845('0x3f')+_0x2f1591);_0xd7af04[_0xa845('0x1d')](_0xa845('0x40'),_0xa845('0x41'));_0xd7af04[_0xa845('0x42')](_0x2cd4f7);}; \ No newline at end of file +var _0x5c22=['demo','downloadLogFile','join','log','xcally','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','../../config/license/util','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','params','get','checkLicense','key'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c22,0x97));var _0x25c2=function(_0x6a58bb,_0x3e6845){_0x6a58bb=_0x6a58bb-0x0;var _0x407f34=_0x5c22[_0x6a58bb];return _0x407f34;};'use strict';var emlformat=require(_0x25c2('0x0'));var rimraf=require(_0x25c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c2('0x2'));var rp=require('request-promise');var moment=require(_0x25c2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x25c2('0x4'));var util=require(_0x25c2('0x5'));var path=require(_0x25c2('0x6'));var sox=require(_0x25c2('0x7'));var csv=require(_0x25c2('0x8'));var ejs=require(_0x25c2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25c2('0xa'));var crypto=require(_0x25c2('0xb'));var jsforce=require(_0x25c2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x25c2('0x8'));var querystring=require(_0x25c2('0xd'));var Papa=require(_0x25c2('0xe'));var Redis=require('ioredis');var authService=require(_0x25c2('0xf'));var qs=require(_0x25c2('0x10'));var as=require(_0x25c2('0x11'));var hardwareService=require(_0x25c2('0x12'));var logger=require(_0x25c2('0x13'))(_0x25c2('0x14'));var utils=require(_0x25c2('0x15'));var config=require(_0x25c2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x25c2('0x17'))['db'];function respondWithStatusCode(_0x39d999,_0x1d3b66){_0x1d3b66=_0x1d3b66||0xcc;return function(_0x58afbd){if(_0x58afbd){return _0x39d999['sendStatus'](_0x1d3b66);}return _0x39d999['status'](_0x1d3b66)[_0x25c2('0x18')]();};}function respondWithResult(_0x57a9bb,_0x93fcac){_0x93fcac=_0x93fcac||0xc8;return function(_0x4f75f0){if(_0x4f75f0){return _0x57a9bb[_0x25c2('0x19')](_0x93fcac)['json'](_0x4f75f0);}};}function respondWithFilteredResult(_0x425934,_0x571a15){return function(_0x21e3ba){if(_0x21e3ba){var _0x41e3eb=typeof _0x571a15[_0x25c2('0x1a')]===_0x25c2('0x1b')&&typeof _0x571a15[_0x25c2('0x1c')]===_0x25c2('0x1b');var _0x12dac6=_0x21e3ba['count'];var _0x4215d5=_0x41e3eb?0x0:_0x571a15[_0x25c2('0x1a')];var _0x1bb699=_0x41e3eb?_0x21e3ba[_0x25c2('0x1d')]:_0x571a15[_0x25c2('0x1a')]+_0x571a15['limit'];var _0x234ac2;if(_0x1bb699>=_0x12dac6){_0x1bb699=_0x12dac6;_0x234ac2=0xc8;}else{_0x234ac2=0xce;}_0x425934[_0x25c2('0x19')](_0x234ac2);return _0x425934[_0x25c2('0x1e')](_0x25c2('0x1f'),_0x4215d5+'-'+_0x1bb699+'/'+_0x12dac6)[_0x25c2('0x20')](_0x21e3ba);}return null;};}function patchUpdates(_0x3f501f){return function(_0xcb6ed8){try{jsonpatch[_0x25c2('0x21')](_0xcb6ed8,_0x3f501f,!![]);}catch(_0x568a50){return BPromise[_0x25c2('0x22')](_0x568a50);}return _0xcb6ed8['save']();};}function saveUpdates(_0x57fcc6,_0x1d6504){return function(_0x1f0712){if(_0x1f0712){return _0x1f0712[_0x25c2('0x23')](_0x57fcc6)[_0x25c2('0x24')](function(_0x35e16a){return _0x35e16a;});}return null;};}function removeEntity(_0x3a1288,_0x169e14){return function(_0x42c7ac){if(_0x42c7ac){return _0x42c7ac[_0x25c2('0x25')]()[_0x25c2('0x24')](function(){_0x3a1288[_0x25c2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258998,_0x32c7e5){return function(_0x53cec0){if(!_0x53cec0){_0x258998[_0x25c2('0x26')](0x194);}return _0x53cec0;};}function handleError(_0x4da365,_0x3762e9){_0x3762e9=_0x3762e9||0x1f4;return function(_0x140642){logger[_0x25c2('0x27')](_0x140642[_0x25c2('0x28')]);if(_0x140642[_0x25c2('0x29')]){delete _0x140642['name'];}_0x4da365[_0x25c2('0x19')](_0x3762e9)[_0x25c2('0x2a')](_0x140642);};}var utilLicense=require(_0x25c2('0x2b'));exports['index']=function(_0x5f2ad9,_0x337ddb){var _0x2f1f90={'raw':!![],'where':{'id':0x1}},_0x15d15b={};_0x15d15b[_0x25c2('0x2c')]=_[_0x25c2('0x2d')](db[_0x25c2('0x2e')][_0x25c2('0x2f')]);_0x15d15b[_0x25c2('0x30')]=_['keys'](_0x5f2ad9['query']);_0x15d15b['filters']=_[_0x25c2('0x31')](_0x15d15b[_0x25c2('0x2c')],_0x15d15b[_0x25c2('0x30')]);_0x2f1f90[_0x25c2('0x32')]=_['intersection'](_0x15d15b[_0x25c2('0x2c')],qs[_0x25c2('0x33')](_0x5f2ad9[_0x25c2('0x30')][_0x25c2('0x33')]));_0x2f1f90[_0x25c2('0x32')]=_0x2f1f90[_0x25c2('0x32')][_0x25c2('0x34')]?_0x2f1f90[_0x25c2('0x32')]:_0x15d15b[_0x25c2('0x2c')];_0x2f1f90=_[_0x25c2('0x35')]({},_0x2f1f90,_0x5f2ad9[_0x25c2('0x36')]);return utilLicense[_0x25c2('0x37')](_0x2f1f90)[_0x25c2('0x24')](respondWithResult(_0x337ddb,null))[_0x25c2('0x38')](handleError(_0x337ddb,null));};exports[_0x25c2('0x23')]=function(_0x204252,_0x1e6f2c){if(_0x204252[_0x25c2('0x39')]['id']){delete _0x204252['body']['id'];}return db[_0x25c2('0x2e')]['find']({'where':{'id':_0x204252[_0x25c2('0x3a')]['id']}})[_0x25c2('0x24')](handleEntityNotFound(_0x1e6f2c,null))[_0x25c2('0x24')](function(_0x91faf){var _0x21b92b=_0x91faf[_0x25c2('0x3b')]({'plain':!![]});return utilLicense[_0x25c2('0x3c')](_0x21b92b,_0x204252['body'][_0x25c2('0x3d')]);})[_0x25c2('0x24')](function(_0x1589bd){if(!_0x1589bd[_0x25c2('0x3e')]){return saveUpdates(_0x204252[_0x25c2('0x39')],null);}return _0x1589bd;})[_0x25c2('0x24')](respondWithResult(_0x1e6f2c,null))[_0x25c2('0x38')](handleError(_0x1e6f2c,null));};exports[_0x25c2('0x3f')]=function(_0x46da2e,_0x595b6d){var _0x4a38ac='license-info.log';var _0x1635e2=path[_0x25c2('0x40')]('/var',_0x25c2('0x41'),_0x25c2('0x42'),_0x4a38ac);_0x595b6d['setHeader'](_0x25c2('0x43'),_0x25c2('0x44')+_0x4a38ac);_0x595b6d[_0x25c2('0x1e')]('Content-Type',_0x25c2('0x45'));_0x595b6d[_0x25c2('0x46')](_0x1635e2);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 46a600e..6298a0a 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 _0x81a0=['request-promise','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x497ea9,_0x52c36b){var _0x3564ad=function(_0x12a41d){while(--_0x12a41d){_0x497ea9['push'](_0x497ea9['shift']());}};_0x3564ad(++_0x52c36b);}(_0x81a0,0x104));var _0x081a=function(_0x40f0c2,_0x2cece7){_0x40f0c2=_0x40f0c2-0x0;var _0x480e92=_0x81a0[_0x40f0c2];return _0x480e92;};'use strict';var _=require(_0x081a('0x0'));var util=require(_0x081a('0x1'));var logger=require(_0x081a('0x2'))(_0x081a('0x3'));var moment=require(_0x081a('0x4'));var BPromise=require(_0x081a('0x5'));var rp=require(_0x081a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x081a('0x7'));var config=require(_0x081a('0x8'));var attributes=require(_0x081a('0x9'));module[_0x081a('0xa')]=function(_0x121c43,_0x9273b2){return _0x121c43[_0x081a('0xb')](_0x081a('0xc'),attributes,{'tableName':_0x081a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eac=['path','rimraf','../../config/environment','./license.attributes','exports','License','license','util','api','moment','bluebird','request-promise'];(function(_0x56d20e,_0x217c31){var _0x18b27a=function(_0x5d68bb){while(--_0x5d68bb){_0x56d20e['push'](_0x56d20e['shift']());}};_0x18b27a(++_0x217c31);}(_0x8eac,0x13f));var _0xc8ea=function(_0x3e469e,_0x334923){_0x3e469e=_0x3e469e-0x0;var _0x33d855=_0x8eac[_0x3e469e];return _0x33d855;};'use strict';var _=require('lodash');var util=require(_0xc8ea('0x0'));var logger=require('../../config/logger')(_0xc8ea('0x1'));var moment=require(_0xc8ea('0x2'));var BPromise=require(_0xc8ea('0x3'));var rp=require(_0xc8ea('0x4'));var fs=require('fs');var path=require(_0xc8ea('0x5'));var rimraf=require(_0xc8ea('0x6'));var config=require(_0xc8ea('0x7'));var attributes=require(_0xc8ea('0x8'));module[_0xc8ea('0x9')]=function(_0x5be89a,_0x23c6e9){return _0x5be89a['define'](_0xc8ea('0xa'),attributes,{'tableName':_0xc8ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 071dbc8..b632e97 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 _0x409b=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cb91f,_0x406af5){var _0x51c7e3=function(_0x5d2c67){while(--_0x5d2c67){_0x2cb91f['push'](_0x2cb91f['shift']());}};_0x51c7e3(++_0x406af5);}(_0x409b,0x19e));var _0xb409=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x409b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xb409('0x0'));var moment=require(_0xb409('0x1'));var BPromise=require(_0xb409('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb409('0x3'));var db=require(_0xb409('0x4'))['db'];var utils=require(_0xb409('0x5'));var logger=require(_0xb409('0x6'))(_0xb409('0x7'));var config=require(_0xb409('0x8'));var jayson=require(_0xb409('0x9'));var client=jayson['client'][_0xb409('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x752435,_0x8a6bb1,_0xd5b7bb){return new BPromise(function(_0xc59931,_0xd065c7){return client['request'](_0x752435,_0xd5b7bb)[_0xb409('0xb')](function(_0x1d4f85){logger[_0xb409('0xc')](_0xb409('0xd'),_0x8a6bb1,_0xb409('0xe'));logger[_0xb409('0xf')](_0xb409('0x10'),_0x8a6bb1,_0xb409('0xe'),JSON['stringify'](_0x1d4f85));if(_0x1d4f85[_0xb409('0x11')]){if(_0x1d4f85[_0xb409('0x11')][_0xb409('0x12')]===0x1f4){logger[_0xb409('0x11')](_0xb409('0xd'),_0x8a6bb1,_0x1d4f85[_0xb409('0x11')][_0xb409('0x13')]);return _0xd065c7(_0x1d4f85[_0xb409('0x11')][_0xb409('0x13')]);}logger['error'](_0xb409('0xd'),_0x8a6bb1,_0x1d4f85[_0xb409('0x11')][_0xb409('0x13')]);return _0xc59931(_0x1d4f85[_0xb409('0x11')][_0xb409('0x13')]);}else{logger[_0xb409('0xc')](_0xb409('0xd'),_0x8a6bb1,_0xb409('0xe'));_0xc59931(_0x1d4f85['result'][_0xb409('0x13')]);}})['catch'](function(_0x45e5d3){logger['error'](_0xb409('0xd'),_0x8a6bb1,_0x45e5d3);_0xd065c7(_0x45e5d3);});});} \ No newline at end of file +var _0x292c=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info'];(function(_0x378cb1,_0x32a374){var _0x31e5d3=function(_0x43b256){while(--_0x43b256){_0x378cb1['push'](_0x378cb1['shift']());}};_0x31e5d3(++_0x32a374);}(_0x292c,0x18e));var _0xc292=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x292c[_0x1f44e4];return _0x591989;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var moment=require(_0xc292('0x1'));var BPromise=require(_0xc292('0x2'));var rs=require(_0xc292('0x3'));var fs=require('fs');var Redis=require(_0xc292('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc292('0x5'));var logger=require(_0xc292('0x6'))('rpc');var config=require(_0xc292('0x7'));var jayson=require(_0xc292('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x104a82,_0x5ba3ee,_0x5f12d7){return new BPromise(function(_0x2aaa11,_0x327331){return client['request'](_0x104a82,_0x5f12d7)['then'](function(_0x51f8f0){logger[_0xc292('0x9')](_0xc292('0xa'),_0x5ba3ee,_0xc292('0xb'));logger[_0xc292('0xc')](_0xc292('0xd'),_0x5ba3ee,_0xc292('0xb'),JSON['stringify'](_0x51f8f0));if(_0x51f8f0[_0xc292('0xe')]){if(_0x51f8f0['error']['code']===0x1f4){logger[_0xc292('0xe')]('License,\x20%s,\x20%s',_0x5ba3ee,_0x51f8f0[_0xc292('0xe')][_0xc292('0xf')]);return _0x327331(_0x51f8f0[_0xc292('0xe')][_0xc292('0xf')]);}logger[_0xc292('0xe')](_0xc292('0xa'),_0x5ba3ee,_0x51f8f0['error'][_0xc292('0xf')]);return _0x2aaa11(_0x51f8f0[_0xc292('0xe')]['message']);}else{logger[_0xc292('0x9')](_0xc292('0xa'),_0x5ba3ee,_0xc292('0xb'));_0x2aaa11(_0x51f8f0['result'][_0xc292('0xf')]);}})[_0xc292('0x10')](function(_0x2ab66f){logger[_0xc292('0xe')](_0xc292('0xa'),_0x5ba3ee,_0x2ab66f);_0x327331(_0x2ab66f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 65457ff..679c228 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 _0x4186=['show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','addAnswer','post','create','addSmtp','addApplications','send','addAgents','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4e1280,_0x3b8e04){var _0x59c5f=function(_0x50a33e){while(--_0x50a33e){_0x4e1280['push'](_0x4e1280['shift']());}};_0x59c5f(++_0x3b8e04);}(_0x4186,0x121));var _0x6418=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0x4186[_0x2e58c7];return _0x26eb00;};'use strict';var multer=require('multer');var util=require(_0x6418('0x0'));var path=require(_0x6418('0x1'));var timeout=require(_0x6418('0x2'));var express=require(_0x6418('0x3'));var router=express['Router']();var fs_extra=require(_0x6418('0x4'));var auth=require(_0x6418('0x5'));var interaction=require(_0x6418('0x6'));var config=require(_0x6418('0x7'));var controller=require('./mailAccount.controller');router[_0x6418('0x8')]('/',auth[_0x6418('0x9')](),controller[_0x6418('0xa')]);router[_0x6418('0x8')]('/describe',auth[_0x6418('0x9')](),controller['describe']);router['get'](_0x6418('0xb'),auth[_0x6418('0x9')](),controller[_0x6418('0xc')]);router[_0x6418('0x8')](_0x6418('0xd'),auth[_0x6418('0x9')](),controller[_0x6418('0xe')]);router[_0x6418('0x8')](_0x6418('0xf'),auth[_0x6418('0x9')](),controller['getAnswers']);router[_0x6418('0x8')](_0x6418('0x10'),auth[_0x6418('0x9')](),controller['getImap']);router[_0x6418('0x8')](_0x6418('0x11'),auth[_0x6418('0x9')](),controller[_0x6418('0x12')]);router['get'](_0x6418('0x13'),auth[_0x6418('0x9')](),controller[_0x6418('0x14')]);router['get'](_0x6418('0x15'),auth[_0x6418('0x9')](),controller[_0x6418('0x16')]);router[_0x6418('0x8')]('/:id/messages',auth[_0x6418('0x9')](),controller['getMessages']);router[_0x6418('0x8')](_0x6418('0x17'),auth['isAuthenticated'](),controller[_0x6418('0x18')]);router[_0x6418('0x8')](_0x6418('0x19'),auth['isAuthenticated'](),controller[_0x6418('0x1a')]);router['post'](_0x6418('0xd'),auth['isAuthenticated'](),controller[_0x6418('0x1b')]);router['post'](_0x6418('0xf'),auth[_0x6418('0x9')](),controller[_0x6418('0x1c')]);router[_0x6418('0x1d')]('/',auth[_0x6418('0x9')](),controller[_0x6418('0x1e')]);router[_0x6418('0x1d')](_0x6418('0x10'),auth[_0x6418('0x9')](),controller['addImap']);router['post'](_0x6418('0x11'),auth[_0x6418('0x9')](),controller[_0x6418('0x1f')]);router[_0x6418('0x1d')](_0x6418('0x13'),auth[_0x6418('0x9')](),controller['addInteraction']);router[_0x6418('0x1d')](_0x6418('0x15'),auth[_0x6418('0x9')](),controller[_0x6418('0x20')]);router[_0x6418('0x1d')]('/:id/send',auth[_0x6418('0x9')](),controller[_0x6418('0x21')]);router[_0x6418('0x1d')](_0x6418('0x19'),auth['isAuthenticated'](),controller[_0x6418('0x22')]);router['put']('/:id',auth[_0x6418('0x9')](),controller['update']);router[_0x6418('0x23')]('/:id/dispositions',auth[_0x6418('0x9')](),controller[_0x6418('0x24')]);router[_0x6418('0x23')]('/:id/canned_answers',auth[_0x6418('0x9')](),controller[_0x6418('0x25')]);router[_0x6418('0x23')](_0x6418('0x10'),auth['isAuthenticated'](),controller[_0x6418('0x26')]);router[_0x6418('0x23')](_0x6418('0x11'),auth[_0x6418('0x9')](),controller[_0x6418('0x27')]);router[_0x6418('0x23')](_0x6418('0xb'),auth[_0x6418('0x9')](),controller[_0x6418('0x28')]);router['delete'](_0x6418('0x19'),auth['isAuthenticated'](),controller[_0x6418('0x29')]);module[_0x6418('0x2a')]=router; \ No newline at end of file +var _0x332e=['getAgents','post','addAnswer','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','util','connect-timeout','Router','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x332e,0x121));var _0xe332=function(_0x5a36dd,_0x5b2d2c){_0x5a36dd=_0x5a36dd-0x0;var _0x15503d=_0x332e[_0x5a36dd];return _0x15503d;};'use strict';var multer=require('multer');var util=require(_0xe332('0x0'));var path=require('path');var timeout=require(_0xe332('0x1'));var express=require('express');var router=express[_0xe332('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe332('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe332('0x4'));router[_0xe332('0x5')]('/',auth[_0xe332('0x6')](),controller[_0xe332('0x7')]);router[_0xe332('0x5')](_0xe332('0x8'),auth[_0xe332('0x6')](),controller[_0xe332('0x9')]);router['get'](_0xe332('0xa'),auth[_0xe332('0x6')](),controller[_0xe332('0xb')]);router[_0xe332('0x5')](_0xe332('0xc'),auth[_0xe332('0x6')](),controller['getDispositions']);router['get'](_0xe332('0xd'),auth[_0xe332('0x6')](),controller['getAnswers']);router[_0xe332('0x5')](_0xe332('0xe'),auth[_0xe332('0x6')](),controller[_0xe332('0xf')]);router[_0xe332('0x5')](_0xe332('0x10'),auth['isAuthenticated'](),controller[_0xe332('0x11')]);router['get'](_0xe332('0x12'),auth['isAuthenticated'](),controller[_0xe332('0x13')]);router[_0xe332('0x5')]('/:id/applications',auth[_0xe332('0x6')](),controller[_0xe332('0x14')]);router[_0xe332('0x5')](_0xe332('0x15'),auth[_0xe332('0x6')](),controller[_0xe332('0x16')]);router[_0xe332('0x5')](_0xe332('0x17'),auth[_0xe332('0x6')](),controller[_0xe332('0x18')]);router[_0xe332('0x5')](_0xe332('0x19'),auth['isAuthenticated'](),controller[_0xe332('0x1a')]);router[_0xe332('0x1b')](_0xe332('0xc'),auth[_0xe332('0x6')](),controller['addDisposition']);router[_0xe332('0x1b')]('/:id/canned_answers',auth[_0xe332('0x6')](),controller[_0xe332('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe332('0x1d')]);router[_0xe332('0x1b')](_0xe332('0xe'),auth[_0xe332('0x6')](),controller[_0xe332('0x1e')]);router[_0xe332('0x1b')](_0xe332('0x10'),auth[_0xe332('0x6')](),controller[_0xe332('0x1f')]);router[_0xe332('0x1b')](_0xe332('0x12'),auth[_0xe332('0x6')](),controller[_0xe332('0x20')]);router[_0xe332('0x1b')](_0xe332('0x21'),auth[_0xe332('0x6')](),controller[_0xe332('0x22')]);router[_0xe332('0x1b')](_0xe332('0x23'),auth['isAuthenticated'](),controller['send']);router[_0xe332('0x1b')](_0xe332('0x19'),auth['isAuthenticated'](),controller[_0xe332('0x24')]);router[_0xe332('0x25')](_0xe332('0xa'),auth['isAuthenticated'](),controller[_0xe332('0x26')]);router[_0xe332('0x27')](_0xe332('0xc'),auth['isAuthenticated'](),controller[_0xe332('0x28')]);router[_0xe332('0x27')](_0xe332('0xd'),auth['isAuthenticated'](),controller[_0xe332('0x29')]);router['delete'](_0xe332('0xe'),auth[_0xe332('0x6')](),controller[_0xe332('0x2a')]);router[_0xe332('0x27')](_0xe332('0x10'),auth[_0xe332('0x6')](),controller['removeSmtp']);router[_0xe332('0x27')]('/:id',auth['isAuthenticated'](),controller[_0xe332('0x2b')]);router[_0xe332('0x27')](_0xe332('0x19'),auth[_0xe332('0x6')](),controller[_0xe332('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index e5a910d..aeb46c8 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 _0xc4bf=['STRING','BOOLEAN','TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','gmail','hotmail','outlook365','provider','custom','getDataValue','sequelize','exports'];(function(_0x6a2a94,_0x5cb27f){var _0x1f2e37=function(_0x17ffff){while(--_0x17ffff){_0x6a2a94['push'](_0x6a2a94['shift']());}};_0x1f2e37(++_0x5cb27f);}(_0xc4bf,0x196));var _0xfc4b=function(_0x489df9,_0x5d63b8){_0x489df9=_0x489df9-0x0;var _0x1f2679=_0xc4bf[_0x489df9];return _0x1f2679;};'use strict';var Sequelize=require(_0xfc4b('0x0'));module[_0xfc4b('0x1')]={'description':{'type':Sequelize[_0xfc4b('0x2')]},'name':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xfc4b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xfc4b('0x4')]},'markAsUnread':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xfc4b('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfc4b('0x6');}},'notificationSound':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfc4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfc4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc4b('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xfc4b('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xfc4b('0x3')],'defaultValue':![],'comment':_0xfc4b('0x8'),'set':function(_0x6f9f91){if(!_0x6f9f91)this[_0xfc4b('0x9')](_0xfc4b('0xa'),null);this[_0xfc4b('0x9')]('mandatoryDisposition',_0x6f9f91);}},'provider':{'type':Sequelize['ENUM'](_0xfc4b('0xb'),_0xfc4b('0xc'),'yahoo',_0xfc4b('0xd')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xfc4b('0xe')))return _0xfc4b('0xf');return this[_0xfc4b('0x10')](_0xfc4b('0xe'));},'set':function(_0x32c2af){if(_0x32c2af===_0xfc4b('0xf'))_0x32c2af=null;return this[_0xfc4b('0x9')]('provider',_0x32c2af);}}}; \ No newline at end of file +var _0x2fbf=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider','custom','getDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x2fbf,0xa6));var _0xf2fb=function(_0x2f48e2,_0x29c40b){_0x2f48e2=_0x2f48e2-0x0;var _0x47fde5=_0x2fbf[_0x2f48e2];return _0x47fde5;};'use strict';var Sequelize=require(_0xf2fb('0x0'));module[_0xf2fb('0x1')]={'description':{'type':Sequelize[_0xf2fb('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xf2fb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf2fb('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf2fb('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf2fb('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf2fb('0x4')]},'markAsUnread':{'type':Sequelize[_0xf2fb('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf2fb('0x2')],'allowNull':![],'defaultValue':_0xf2fb('0x5')},'fontSize':{'type':Sequelize[_0xf2fb('0x6')](0x2)[_0xf2fb('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf2fb('0x8');}},'notificationSound':{'type':Sequelize[_0xf2fb('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf2fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf2fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf2fb('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf2fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf2fb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf2fb('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf2fb('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf2fb('0xa'),'set':function(_0x1a6d1e){if(!_0x1a6d1e)this[_0xf2fb('0xb')](_0xf2fb('0xc'),null);this['setDataValue'](_0xf2fb('0xd'),_0x1a6d1e);}},'provider':{'type':Sequelize[_0xf2fb('0xe')](_0xf2fb('0xf'),_0xf2fb('0x10'),_0xf2fb('0x11'),_0xf2fb('0x12')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xf2fb('0x13')))return _0xf2fb('0x14');return this[_0xf2fb('0x15')](_0xf2fb('0x13'));},'set':function(_0x31f658){if(_0x31f658===_0xf2fb('0x14'))_0x31f658=null;return this[_0xf2fb('0xb')](_0xf2fb('0x13'),_0x31f658);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index af8c087..937e50c 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 _0x212c=['MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','MailAccount','include','show','params','length','options','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','find','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','findAll','rows','ids','addAnswer','CannedAnswer','getAnswers','pick','includeAll','removeAnswers','key','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','finally','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','updatedAt','DESC','CloudProvider','from','format','%s\x20<%s>','attachments','root','server/files/attachments','basename','SendMail','sendMail','List','List\x20not\x20found','Contacts','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','get'];(function(_0xe60ec0,_0x2ce97a){var _0x2e5e3c=function(_0xb321b4){while(--_0xb321b4){_0xe60ec0['push'](_0xe60ec0['shift']());}};_0x2e5e3c(++_0x2ce97a);}(_0x212c,0x15d));var _0xc212=function(_0x2d012f,_0x3ba679){_0x2d012f=_0x2d012f-0x0;var _0x3a9b9a=_0x212c[_0x2d012f];return _0x3a9b9a;};'use strict';var moment=require(_0xc212('0x0'));var BPromise=require(_0xc212('0x1'));var util=require(_0xc212('0x2'));var path=require(_0xc212('0x3'));var _=require('lodash');var juice=require('juice');var Redis=require(_0xc212('0x4'));var qs=require(_0xc212('0x5'));var logger=require(_0xc212('0x6'))(_0xc212('0x7'));var config=require(_0xc212('0x8'));var db=require('../../mysqldb')['db'];config[_0xc212('0x9')]=_[_0xc212('0xa')](config[_0xc212('0x9')],{'host':_0xc212('0xb'),'port':0x18eb});var socket=require(_0xc212('0xc'))(new Redis(config['redis']));require(_0xc212('0xd'))[_0xc212('0xe')](socket);var jayson=require(_0xc212('0xf'));var client=jayson[_0xc212('0x10')][_0xc212('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x9124cb,_0x3e8ee9,_0xa6143e,_0x16cb47){return new BPromise(function(_0x3d21a4,_0xa764da){var _0x4fdacf=_0x16cb47||client;return _0x4fdacf[_0xc212('0x12')](_0x9124cb,_0xa6143e)[_0xc212('0x13')](function(_0x56e4d9){logger[_0xc212('0x14')](_0xc212('0x15'),_0x3e8ee9,_0xc212('0x16'));logger['debug'](_0xc212('0x17'),_0x3e8ee9,_0xc212('0x16'),JSON[_0xc212('0x18')](_0x56e4d9));if(_0x56e4d9[_0xc212('0x19')]){if(_0x56e4d9[_0xc212('0x19')][_0xc212('0x1a')]===0x1f4){logger[_0xc212('0x19')](_0xc212('0x15'),_0x3e8ee9,_0x56e4d9[_0xc212('0x19')]['message']);return _0xa764da(_0x56e4d9['error'][_0xc212('0x1b')]);}logger[_0xc212('0x19')](_0xc212('0x15'),_0x3e8ee9,_0x56e4d9[_0xc212('0x19')][_0xc212('0x1b')]);return _0x3d21a4(_0x56e4d9[_0xc212('0x19')][_0xc212('0x1b')]);}else{logger[_0xc212('0x14')](_0xc212('0x15'),_0x3e8ee9,_0xc212('0x16'));_0x3d21a4(_0x56e4d9['result']['message']);}})[_0xc212('0x1c')](function(_0x169015){logger[_0xc212('0x19')]('MailAccount,\x20%s,\x20%s',_0x3e8ee9,_0x169015);_0xa764da(_0x169015);});});}function respondWithStatusCode(_0x34a6cc,_0x558a80){_0x558a80=_0x558a80||0xcc;return function(_0x4286e8){if(_0x4286e8){return _0x34a6cc[_0xc212('0x1d')](_0x558a80);}return _0x34a6cc['status'](_0x558a80)[_0xc212('0x1e')]();};}function respondWithResult(_0x3c39dc,_0x7b232d){_0x7b232d=_0x7b232d||0xc8;return function(_0x320c7b){if(_0x320c7b){return _0x3c39dc[_0xc212('0x1f')](_0x7b232d)[_0xc212('0x20')](_0x320c7b);}};}function respondWithFilteredResult(_0xae799e,_0x5d913b){return function(_0x1a04fa){if(_0x1a04fa){var _0x1bd40c=typeof _0x5d913b[_0xc212('0x21')]===_0xc212('0x22')&&typeof _0x5d913b['limit']===_0xc212('0x22');var _0x4ed2f5=_0x1a04fa[_0xc212('0x23')];var _0x6c2c4=_0x1bd40c?0x0:_0x5d913b['offset'];var _0x526f79=_0x1bd40c?_0x1a04fa[_0xc212('0x23')]:_0x5d913b['offset']+_0x5d913b[_0xc212('0x24')];var _0x58463d;if(_0x526f79>=_0x4ed2f5){_0x526f79=_0x4ed2f5;_0x58463d=0xc8;}else{_0x58463d=0xce;}_0xae799e[_0xc212('0x1f')](_0x58463d);return _0xae799e[_0xc212('0x25')](_0xc212('0x26'),_0x6c2c4+'-'+_0x526f79+'/'+_0x4ed2f5)[_0xc212('0x20')](_0x1a04fa);}return null;};}function saveUpdates(_0x390a3e){return function(_0x54aba7){if(_0x54aba7){return _0x54aba7[_0xc212('0x27')](_0x390a3e)['then'](function(_0xc0773c){return _0xc0773c;});}return null;};}function removeEntity(_0x59e54f){return function(_0x5e861e){if(_0x5e861e){return _0x5e861e['destroy']()[_0xc212('0x13')](function(){var _0x1060c3=_0x5e861e[_0xc212('0x28')]({'plain':!![]});var _0x1384b2=_0xc212('0x29');return db[_0xc212('0x2a')][_0xc212('0x2b')]({'where':{'type':_0x1384b2,'resourceId':_0x1060c3['id']}})['then'](function(){return _0x5e861e;});})['then'](function(){_0x59e54f[_0xc212('0x1f')](0xcc)[_0xc212('0x1e')]();});}};}function handleEntityNotFound(_0x1c0a00){return function(_0x381ffb){if(!_0x381ffb){_0x1c0a00[_0xc212('0x1d')](0x194);}return _0x381ffb;};}function handleError(_0x61f088,_0x5aaae6){_0x5aaae6=_0x5aaae6||0x1f4;return function(_0x5435bb){logger[_0xc212('0x19')](_0x5435bb[_0xc212('0x2c')]);if(_0x5435bb[_0xc212('0x2d')]){delete _0x5435bb[_0xc212('0x2d')];}_0x61f088[_0xc212('0x1f')](_0x5aaae6)[_0xc212('0x2e')](_0x5435bb);};}function getImapHost(_0x424371){switch(_0x424371){case _0xc212('0x2f'):return _0xc212('0x30');case'yahoo':return _0xc212('0x31');case _0xc212('0x32'):return'imap-mail.outlook.com';case _0xc212('0x33'):return'outlook.office365.com';}throw new Error(_0xc212('0x34'),_0x424371);}function getSmtpHost(_0x1e6f2d){switch(_0x1e6f2d){case'gmail':return _0xc212('0x35');case _0xc212('0x36'):return'smtp.mail.yahoo.com';case'hotmail':return'smtp-mail.outlook.com';case _0xc212('0x33'):return _0xc212('0x37');}throw new Error(_0xc212('0x34'),_0x1e6f2d);}function getAuthenticationOptions(_0x5998aa,_0x730e5f){var _0x209d85={};var _0x416096={};if(_0x5998aa){_0x209d85['user']=_0x416096[_0xc212('0x38')]=_0x730e5f[_0xc212('0x39')];_0x209d85[_0xc212('0x3a')]=_0x416096[_0xc212('0x3b')]=_0x730e5f[_0xc212('0x3a')];if(_0x730e5f[_0xc212('0x3c')]){_0x209d85[_0xc212('0x3c')]=_0x416096['modernAuthentication']=!![];_0x209d85[_0xc212('0x3d')]=_0x416096[_0xc212('0x3d')]=_0x730e5f[_0xc212('0x3d')];_0x209d85[_0xc212('0x3a')]=_0x416096[_0xc212('0x3b')]=null;}else{_0x209d85[_0xc212('0x3d')]=_0x416096['CloudProviderId']=null;}_0x209d85['host']=getImapHost(_0x5998aa);_0x209d85[_0xc212('0x3e')]=0x3e1;_0x416096[_0xc212('0x3f')]=getSmtpHost(_0x5998aa);_0x416096[_0xc212('0x3e')]=0x24b;_0x416096[_0xc212('0x40')]=![];_0x209d85[_0xc212('0x41')]=_0x416096['service']=null;}else{if(_0x730e5f[_0xc212('0x42')]){_0x209d85['user']=_0x416096[_0xc212('0x38')]=_0x730e5f[_0xc212('0x39')];_0x209d85[_0xc212('0x3a')]=_0x416096[_0xc212('0x3b')]=_0x730e5f['password'];}else{_0x209d85[_0xc212('0x42')]=_0x416096[_0xc212('0x42')]=![];_0x209d85[_0xc212('0x38')]=_0x416096[_0xc212('0x38')]=null;_0x209d85['password']=_0x416096['pass']=null;}_0x209d85[_0xc212('0x3f')]=_0x730e5f['Imap'][_0xc212('0x3f')];_0x209d85['port']=_0x730e5f[_0xc212('0x43')]['port'];_0x416096[_0xc212('0x3f')]=_0x730e5f[_0xc212('0x44')][_0xc212('0x3f')];_0x416096['port']=_0x730e5f[_0xc212('0x44')]['port'];}return{'Imap':_0x209d85,'Smtp':_0x416096};}exports[_0xc212('0x45')]=function(_0x478b08,_0x102c0e){var _0x35d791={'include':[{'model':db[_0xc212('0x46')],'as':_0xc212('0x43')},{'model':db[_0xc212('0x47')],'as':_0xc212('0x44')},{'model':db[_0xc212('0x48')],'as':_0xc212('0x49')}]},_0x3b7e45={},_0x4d1f29={'count':0x0,'rows':[]};var _0x36d6d7=_[_0xc212('0x4a')](db['MailAccount'][_0xc212('0x4b')],function(_0x4ef3a0){return{'name':_0x4ef3a0[_0xc212('0x4c')],'type':_0x4ef3a0['type']['key']};});_0x3b7e45[_0xc212('0x4d')]=_[_0xc212('0x4a')](_0x36d6d7,_0xc212('0x2d'));_0x3b7e45[_0xc212('0x4e')]=_[_0xc212('0x4f')](_0x478b08['query']);_0x3b7e45[_0xc212('0x50')]=_[_0xc212('0x51')](_0x3b7e45['model'],_0x3b7e45[_0xc212('0x4e')]);_0x35d791[_0xc212('0x52')]=_[_0xc212('0x51')](_0x3b7e45[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x478b08[_0xc212('0x4e')]['fields']));_0x35d791[_0xc212('0x52')]=_0x35d791[_0xc212('0x52')]['length']?_0x35d791[_0xc212('0x52')]:_0x3b7e45[_0xc212('0x4d')];if(!_0x478b08[_0xc212('0x4e')]['hasOwnProperty'](_0xc212('0x54'))){_0x35d791[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x478b08[_0xc212('0x4e')][_0xc212('0x24')]);_0x35d791[_0xc212('0x21')]=qs['offset'](_0x478b08[_0xc212('0x4e')][_0xc212('0x21')]);}_0x35d791[_0xc212('0x55')]=qs[_0xc212('0x56')](_0x478b08[_0xc212('0x4e')][_0xc212('0x56')]);_0x35d791[_0xc212('0x57')]=qs[_0xc212('0x50')](_['pick'](_0x478b08[_0xc212('0x4e')],_0x3b7e45[_0xc212('0x50')]),_0x36d6d7);if(_0x478b08['query'][_0xc212('0x58')]){_0x35d791[_0xc212('0x57')]=_['merge'](_0x35d791[_0xc212('0x57')],{'$or':_[_0xc212('0x4a')](_0x36d6d7,function(_0x55f165){if(_0x55f165['type']!==_0xc212('0x59')){var _0x5b8c0a={};_0x5b8c0a[_0x55f165[_0xc212('0x2d')]]={'$like':'%'+_0x478b08[_0xc212('0x4e')][_0xc212('0x58')]+'%'};return _0x5b8c0a;}})});}_0x35d791=_[_0xc212('0x5a')]({},_0x35d791,_0x478b08['options']);var _0x462f34={'where':_0x35d791[_0xc212('0x57')]};return db[_0xc212('0x5b')]['count'](_0x462f34)[_0xc212('0x13')](function(_0x5b81ff){_0x4d1f29[_0xc212('0x23')]=_0x5b81ff;if(_0x478b08[_0xc212('0x4e')]['includeAll']){_0x35d791[_0xc212('0x5c')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x35d791);})[_0xc212('0x13')](function(_0x4e38b8){_0x4d1f29['rows']=_0x4e38b8;return _0x4d1f29;})[_0xc212('0x13')](respondWithFilteredResult(_0x102c0e,_0x35d791))['catch'](handleError(_0x102c0e,null));};exports[_0xc212('0x5d')]=function(_0x2d00c8,_0xf085db){var _0x124397={'raw':![],'where':{'id':_0x2d00c8[_0xc212('0x5e')]['id']},'include':[{'model':db[_0xc212('0x46')],'as':'Imap'},{'model':db[_0xc212('0x47')],'as':'Smtp'},{'model':db[_0xc212('0x48')],'as':_0xc212('0x49')}]},_0x2ab0f9={};_0x2ab0f9[_0xc212('0x4d')]=_[_0xc212('0x4f')](db[_0xc212('0x5b')][_0xc212('0x4b')]);_0x2ab0f9[_0xc212('0x4e')]=_[_0xc212('0x4f')](_0x2d00c8['query']);_0x2ab0f9['filters']=_[_0xc212('0x51')](_0x2ab0f9[_0xc212('0x4d')],_0x2ab0f9['query']);_0x124397['attributes']=_['intersection'](_0x2ab0f9[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x2d00c8[_0xc212('0x4e')]['fields']));_0x124397['attributes']=_0x124397[_0xc212('0x52')][_0xc212('0x5f')]?_0x124397[_0xc212('0x52')]:_0x2ab0f9[_0xc212('0x4d')];if(_0x2d00c8[_0xc212('0x4e')]['includeAll']){_0x124397['include']=[{'all':!![]}];}_0x124397=_[_0xc212('0x5a')]({},_0x124397,_0x2d00c8[_0xc212('0x60')]);return db[_0xc212('0x5b')]['find'](_0x124397)['then'](handleEntityNotFound(_0xf085db,null))[_0xc212('0x13')](respondWithResult(_0xf085db,null))[_0xc212('0x1c')](handleError(_0xf085db,null));};exports['update']=function(_0x557ac2,_0x4d4e01){if(_0x557ac2[_0xc212('0x61')]['id']){delete _0x557ac2[_0xc212('0x61')]['id'];}var _0x3836b4=_0x557ac2['body'][_0xc212('0x62')]===_0xc212('0x63')?null:_0x557ac2[_0xc212('0x61')][_0xc212('0x62')];var _0x508217=_0x557ac2[_0xc212('0x61')][_0xc212('0x43')]||{};var _0x583019=_0x557ac2[_0xc212('0x61')]['Smtp']||{};if(_0x3836b4){_0x508217[_0xc212('0x3f')]=getImapHost(_0x3836b4);_0x508217[_0xc212('0x3e')]=0x3e1;_0x583019[_0xc212('0x3f')]=getSmtpHost(_0x3836b4);_0x583019[_0xc212('0x3e')]=0x24b;_0x583019['secure']=![];}if(_0x583019[_0xc212('0x3c')]){_0x583019[_0xc212('0x40')]=![];}else{_0x583019[_0xc212('0x3d')]=null;}if(!_0x508217['modernAuthentication'])_0x508217['CloudProviderId']=null;_0x557ac2['body'][_0xc212('0x43')]=_0x508217;_0x557ac2[_0xc212('0x61')][_0xc212('0x44')]=_0x583019;return db[_0xc212('0x5b')]['find']({'where':{'id':_0x557ac2[_0xc212('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xc212('0x43')},{'model':db[_0xc212('0x47')],'as':_0xc212('0x44')},{'model':db[_0xc212('0x48')],'as':'mandatoryDispositionPause'}]})[_0xc212('0x13')](handleEntityNotFound(_0x4d4e01,null))[_0xc212('0x13')](function(_0x54ecdf){if(!_0x54ecdf)throw new Error(_0xc212('0x64'));if(_0x54ecdf[_0xc212('0x41')])delete _0x557ac2[_0xc212('0x61')]['Imap'];return _0x54ecdf;})['then'](saveUpdates(_0x557ac2[_0xc212('0x61')],null))[_0xc212('0x13')](function(_0x30ac5e){if(!_0x557ac2[_0xc212('0x61')][_0xc212('0x43')])return _0x30ac5e;return db['MailServerIn'][_0xc212('0x27')](_0x557ac2[_0xc212('0x61')]['Imap'],{'where':{'MailAccountId':_0x30ac5e['id']}})[_0xc212('0x13')](function(){return _0x30ac5e;});})[_0xc212('0x13')](function(_0x7444e5){if(!_0x557ac2['body'][_0xc212('0x44')])return _0x7444e5;return db[_0xc212('0x47')]['update'](_0x557ac2[_0xc212('0x61')][_0xc212('0x44')],{'where':{'MailAccountId':_0x7444e5['id']}})[_0xc212('0x13')](function(){return _0x7444e5;});})[_0xc212('0x13')](respondWithResult(_0x4d4e01,null))[_0xc212('0x1c')](handleError(_0x4d4e01,null));};exports[_0xc212('0x65')]=function(_0x5f293b,_0x4e8de8){return db[_0xc212('0x5b')]['describe']()[_0xc212('0x13')](respondWithResult(_0x4e8de8,null))[_0xc212('0x1c')](handleError(_0x4e8de8,null));};exports[_0xc212('0x66')]=function(_0x3e39be,_0x4a0304){if(_0x3e39be[_0xc212('0x61')]['id']){delete _0x3e39be[_0xc212('0x61')]['id'];}return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0x3e39be['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x4a0304,null))[_0xc212('0x13')](function(_0x5d0b2d){if(_0x5d0b2d){_0x3e39be[_0xc212('0x61')][_0xc212('0x68')]=_0x5d0b2d['id'];return db[_0xc212('0x69')][_0xc212('0x6a')](_0x3e39be[_0xc212('0x61')]);}})[_0xc212('0x13')](respondWithResult(_0x4a0304,null))[_0xc212('0x1c')](handleError(_0x4a0304,null));};exports[_0xc212('0x6b')]=function(_0x468c99,_0x5efd1a){var _0x46f9c0={'raw':![],'where':{}};var _0x551d4f={};var _0x33e902={'count':0x0,'rows':[]};return db['MailAccount'][_0xc212('0x6c')]({'where':{'id':_0x468c99[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x5efd1a,null))[_0xc212('0x13')](function(_0x535756){if(_0x535756){_0x551d4f[_0xc212('0x4d')]=_['keys'](db[_0xc212('0x69')][_0xc212('0x4b')]);_0x551d4f['query']=_[_0xc212('0x4f')](_0x468c99[_0xc212('0x4e')]);_0x551d4f[_0xc212('0x50')]=_['intersection'](_0x551d4f[_0xc212('0x4d')],_0x551d4f[_0xc212('0x4e')]);_0x46f9c0[_0xc212('0x52')]=_['intersection'](_0x551d4f[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x468c99[_0xc212('0x4e')][_0xc212('0x53')]));_0x46f9c0['attributes']=_0x46f9c0[_0xc212('0x52')][_0xc212('0x5f')]?_0x46f9c0[_0xc212('0x52')]:_0x551d4f[_0xc212('0x4d')];if(!_0x468c99[_0xc212('0x4e')][_0xc212('0x6d')]('nolimit')){_0x46f9c0[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x468c99[_0xc212('0x4e')][_0xc212('0x24')]);_0x46f9c0[_0xc212('0x21')]=qs[_0xc212('0x21')](_0x468c99[_0xc212('0x4e')][_0xc212('0x21')]);}_0x46f9c0[_0xc212('0x55')]=qs['sort'](_0x468c99[_0xc212('0x4e')]['sort']);_0x46f9c0['where']=qs[_0xc212('0x50')](_['pick'](_0x468c99[_0xc212('0x4e')],_0x551d4f[_0xc212('0x50')]));_0x46f9c0['where']['MailAccountId']=_0x535756['id'];if(_0x468c99['query'][_0xc212('0x58')]){_0x46f9c0['where']=_[_0xc212('0x5a')](_0x46f9c0[_0xc212('0x57')],{'$or':_['map'](_0x46f9c0[_0xc212('0x52')],function(_0xde2a28){var _0x221d9d={};_0x221d9d[_0xde2a28]={'$like':'%'+_0x468c99[_0xc212('0x4e')][_0xc212('0x58')]+'%'};return _0x221d9d;})});}_0x46f9c0=_['merge']({},_0x46f9c0,_0x468c99['options']);return db[_0xc212('0x69')]['count']({'where':_0x46f9c0[_0xc212('0x57')]})[_0xc212('0x13')](function(_0x53124f){_0x33e902[_0xc212('0x23')]=_0x53124f;if(_0x468c99[_0xc212('0x4e')]['includeAll']){_0x46f9c0['include']=[{'all':!![]}];}return db[_0xc212('0x69')][_0xc212('0x6e')](_0x46f9c0);})[_0xc212('0x13')](function(_0x1f2232){_0x33e902[_0xc212('0x6f')]=_0x1f2232;return _0x33e902;});}})[_0xc212('0x13')](respondWithFilteredResult(_0x5efd1a,_0x46f9c0))['catch'](handleError(_0x5efd1a,null));};exports['removeDispositions']=function(_0x15bc38,_0x54a370){return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0x15bc38[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x54a370,null))[_0xc212('0x13')](function(_0x4ca87e){if(_0x4ca87e){return _0x4ca87e['removeDispositions'](_0x15bc38[_0xc212('0x4e')][_0xc212('0x70')]);}})[_0xc212('0x13')](respondWithStatusCode(_0x54a370,null))['catch'](handleError(_0x54a370,null));};exports[_0xc212('0x71')]=function(_0x3b3c62,_0x2c385c){if(_0x3b3c62['body']['id']){delete _0x3b3c62[_0xc212('0x61')]['id'];}return db[_0xc212('0x5b')]['find']({'where':{'id':_0x3b3c62[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x2c385c,null))['then'](function(_0x4cd896){if(_0x4cd896){_0x3b3c62[_0xc212('0x61')][_0xc212('0x68')]=_0x4cd896['id'];return db[_0xc212('0x72')]['create'](_0x3b3c62[_0xc212('0x61')]);}})[_0xc212('0x13')](respondWithResult(_0x2c385c,null))[_0xc212('0x1c')](handleError(_0x2c385c,null));};exports[_0xc212('0x73')]=function(_0x255151,_0x24dc8a){var _0x2d59ae={'raw':![],'where':{}};var _0xa50037={};var _0x5677d3={'count':0x0,'rows':[]};return db[_0xc212('0x5b')][_0xc212('0x6c')]({'where':{'id':_0x255151['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x24dc8a,null))[_0xc212('0x13')](function(_0x22de70){if(_0x22de70){_0xa50037[_0xc212('0x4d')]=_['keys'](db[_0xc212('0x72')]['rawAttributes']);_0xa50037['query']=_[_0xc212('0x4f')](_0x255151[_0xc212('0x4e')]);_0xa50037[_0xc212('0x50')]=_[_0xc212('0x51')](_0xa50037[_0xc212('0x4d')],_0xa50037['query']);_0x2d59ae['attributes']=_[_0xc212('0x51')](_0xa50037[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x255151[_0xc212('0x4e')]['fields']));_0x2d59ae['attributes']=_0x2d59ae['attributes'][_0xc212('0x5f')]?_0x2d59ae['attributes']:_0xa50037[_0xc212('0x4d')];if(!_0x255151[_0xc212('0x4e')]['hasOwnProperty']('nolimit')){_0x2d59ae[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x255151[_0xc212('0x4e')][_0xc212('0x24')]);_0x2d59ae['offset']=qs[_0xc212('0x21')](_0x255151['query']['offset']);}_0x2d59ae['order']=qs['sort'](_0x255151[_0xc212('0x4e')][_0xc212('0x56')]);_0x2d59ae[_0xc212('0x57')]=qs[_0xc212('0x50')](_[_0xc212('0x74')](_0x255151[_0xc212('0x4e')],_0xa50037[_0xc212('0x50')]));_0x2d59ae[_0xc212('0x57')]['MailAccountId']=_0x22de70['id'];if(_0x255151[_0xc212('0x4e')]['filter']){_0x2d59ae[_0xc212('0x57')]=_[_0xc212('0x5a')](_0x2d59ae[_0xc212('0x57')],{'$or':_[_0xc212('0x4a')](_0x2d59ae[_0xc212('0x52')],function(_0x19e879){var _0x273725={};_0x273725[_0x19e879]={'$like':'%'+_0x255151['query'][_0xc212('0x58')]+'%'};return _0x273725;})});}_0x2d59ae=_[_0xc212('0x5a')]({},_0x2d59ae,_0x255151[_0xc212('0x60')]);return db[_0xc212('0x72')]['count']({'where':_0x2d59ae[_0xc212('0x57')]})[_0xc212('0x13')](function(_0x31c1b0){_0x5677d3[_0xc212('0x23')]=_0x31c1b0;if(_0x255151[_0xc212('0x4e')][_0xc212('0x75')]){_0x2d59ae[_0xc212('0x5c')]=[{'all':!![]}];}return db[_0xc212('0x72')][_0xc212('0x6e')](_0x2d59ae);})[_0xc212('0x13')](function(_0x5f6c92){_0x5677d3[_0xc212('0x6f')]=_0x5f6c92;return _0x5677d3;});}})[_0xc212('0x13')](respondWithFilteredResult(_0x24dc8a,_0x2d59ae))[_0xc212('0x1c')](handleError(_0x24dc8a,null));};exports[_0xc212('0x76')]=function(_0x22de73,_0x5b4b32){return db['MailAccount'][_0xc212('0x67')]({'where':{'id':_0x22de73['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x5b4b32,null))[_0xc212('0x13')](function(_0x5885d2){if(_0x5885d2){return _0x5885d2[_0xc212('0x76')](_0x22de73['query'][_0xc212('0x70')]);}})[_0xc212('0x13')](respondWithStatusCode(_0x5b4b32,null))[_0xc212('0x1c')](handleError(_0x5b4b32,null));};exports[_0xc212('0x6a')]=function(_0x5e6508,_0x2a49e8){var _0x4aa7cb={'name':_0x5e6508[_0xc212('0x61')][_0xc212('0x2d')],'key':_0x5e6508[_0xc212('0x61')][_0xc212('0x77')],'provider':_0x5e6508[_0xc212('0x61')][_0xc212('0x62')]==='custom'?null:_0x5e6508[_0xc212('0x61')][_0xc212('0x62')],'email':_0x5e6508[_0xc212('0x61')][_0xc212('0x78')],'ListId':_0x5e6508['body']['ListId'],'active':!_[_0xc212('0x79')](_0x5e6508[_0xc212('0x61')][_0xc212('0x7a')])?_0x5e6508[_0xc212('0x61')][_0xc212('0x7a')]:!![],'description':_0x5e6508[_0xc212('0x61')][_0xc212('0x7b')]||null};var _0x503b10=getAuthenticationOptions(_0x4aa7cb[_0xc212('0x62')],_0x5e6508[_0xc212('0x61')]);_0x4aa7cb[_0xc212('0x43')]=_0x503b10['Imap'];_0x4aa7cb['Smtp']=_0x503b10[_0xc212('0x44')];return db['MailAccount'][_0xc212('0x6a')](_0x4aa7cb,{'include':[{'model':db[_0xc212('0x47')],'as':_0xc212('0x44')},{'model':db['MailServerIn'],'as':_0xc212('0x43')}]})[_0xc212('0x13')](function(_0x56f50a){var _0x2e9b12=_0x5e6508[_0xc212('0x38')]['get']({'plain':!![]});if(!_0x2e9b12)throw new Error(_0xc212('0x7c'));if(_0x2e9b12[_0xc212('0x7d')]===_0xc212('0x38')){var _0x4d3ba6=_0x56f50a[_0xc212('0x28')]({'plain':!![]});return db['UserProfileSection'][_0xc212('0x67')]({'where':{'name':'MailAccounts','userProfileId':_0x2e9b12[_0xc212('0x7e')]},'raw':!![]})['then'](function(_0x2ed9df){if(_0x2ed9df&&_0x2ed9df[_0xc212('0x7f')]===0x0){return db[_0xc212('0x2a')][_0xc212('0x6a')]({'name':_0x4d3ba6['name'],'resourceId':_0x4d3ba6['id'],'type':_0x2ed9df[_0xc212('0x2d')],'sectionId':_0x2ed9df['id']},{})['then'](function(){return _0x56f50a;});}else{return _0x56f50a;}})['catch'](function(_0x891269){logger[_0xc212('0x19')](_0xc212('0x80'),_0x891269);throw _0x891269;});}return _0x56f50a;})[_0xc212('0x13')](respondWithResult(_0x2a49e8,0xc9))['catch'](handleError(_0x2a49e8,null));};exports[_0xc212('0x81')]=function(_0x204cb5,_0xae14ff){return db[_0xc212('0x5b')]['findOne']({'where':{'id':_0x204cb5['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0xae14ff,null))[_0xc212('0x13')](function(_0x983673){if(_0x983673){return _0x983673[_0xc212('0x81')]();}return null;})[_0xc212('0x13')](respondWithResult(_0xae14ff,null))[_0xc212('0x1c')](handleError(_0xae14ff,null));};exports[_0xc212('0x82')]=function(_0x16bd1a,_0x4293f4){if(_0x16bd1a[_0xc212('0x61')]['id']){delete _0x16bd1a[_0xc212('0x61')]['id'];}return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0x16bd1a['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x4293f4,null))['then'](function(_0x2cebe5){if(_0x2cebe5){_0x16bd1a['body'][_0xc212('0x68')]=_0x2cebe5['id'];return db['MailServerIn'][_0xc212('0x6a')](_0x16bd1a[_0xc212('0x61')]);}})[_0xc212('0x13')](respondWithResult(_0x4293f4,null))[_0xc212('0x1c')](handleError(_0x4293f4,null));};exports[_0xc212('0x83')]=function(_0x3ab3a1,_0x4fb4cf){return db[_0xc212('0x5b')][_0xc212('0x6c')]({'where':{'id':_0x3ab3a1[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x4fb4cf,null))[_0xc212('0x13')](function(_0x1d7d05){if(_0x1d7d05){return _0x1d7d05['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x4fb4cf,null))[_0xc212('0x1c')](handleError(_0x4fb4cf,null));};exports[_0xc212('0x84')]=function(_0x3bffbb,_0x341894){return db[_0xc212('0x5b')]['findOne']({'where':{'id':_0x3bffbb[_0xc212('0x5e')]['id']}})['then'](handleEntityNotFound(_0x341894,null))[_0xc212('0x13')](function(_0x5f5044){if(_0x5f5044){return _0x5f5044[_0xc212('0x84')]();}return null;})['then'](respondWithResult(_0x341894,null))['catch'](handleError(_0x341894,null));};exports[_0xc212('0x85')]=function(_0x44a7e8,_0x5dead8){if(_0x44a7e8['body']['id']){delete _0x44a7e8['body']['id'];}return db[_0xc212('0x5b')]['find']({'where':{'id':_0x44a7e8['params']['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x5dead8,null))['then'](function(_0x2ae51a){if(_0x2ae51a){_0x44a7e8[_0xc212('0x61')][_0xc212('0x68')]=_0x2ae51a['id'];return db[_0xc212('0x47')][_0xc212('0x6a')](_0x44a7e8[_0xc212('0x61')]);}})[_0xc212('0x13')](respondWithResult(_0x5dead8,null))['catch'](handleError(_0x5dead8,null));};exports[_0xc212('0x86')]=function(_0x1b8a65,_0x377257){return db['MailAccount'][_0xc212('0x6c')]({'where':{'id':_0x1b8a65[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x377257,null))[_0xc212('0x13')](function(_0x26cba7){if(_0x26cba7){return _0x26cba7[_0xc212('0x87')](null);}return null;})[_0xc212('0x13')](respondWithStatusCode(_0x377257,null))[_0xc212('0x1c')](handleError(_0x377257,null));};exports[_0xc212('0x88')]=function(_0x621b48,_0x2eb528){return db[_0xc212('0x89')]['find']({'where':{'id':_0x621b48[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x2eb528,null))[_0xc212('0x13')](function(_0x15d6e2){if(_0x15d6e2){return _0x15d6e2[_0xc212('0x88')](_0x621b48[_0xc212('0x61')][_0xc212('0x70')],_[_0xc212('0x8a')](_0x621b48['body'],['ids','id'])||{});}})[_0xc212('0x13')](respondWithResult(_0x2eb528,null))['catch'](handleError(_0x2eb528,null));};exports[_0xc212('0x8b')]=function(_0x198c07,_0x2d91c3){var _0x5135d4={'raw':![],'where':{}};var _0x10fffd={};var _0xc2f91={'count':0x0,'rows':[]};return db[_0xc212('0x5b')]['findOne']({'where':{'id':_0x198c07[_0xc212('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2d91c3,null))['then'](function(_0x3d6894){if(_0x3d6894){_0x10fffd[_0xc212('0x4d')]=_[_0xc212('0x4f')](db[_0xc212('0x89')][_0xc212('0x4b')]);_0x10fffd[_0xc212('0x4e')]=_['keys'](_0x198c07[_0xc212('0x4e')]);_0x10fffd['filters']=_[_0xc212('0x51')](_0x10fffd[_0xc212('0x4d')],_0x10fffd[_0xc212('0x4e')]);_0x5135d4['attributes']=_['intersection'](_0x10fffd[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x198c07[_0xc212('0x4e')][_0xc212('0x53')]));_0x5135d4[_0xc212('0x52')]=_0x5135d4[_0xc212('0x52')][_0xc212('0x5f')]?_0x5135d4[_0xc212('0x52')]:_0x10fffd[_0xc212('0x4d')];if(!_0x198c07[_0xc212('0x4e')][_0xc212('0x6d')](_0xc212('0x54'))){_0x5135d4['limit']=qs[_0xc212('0x24')](_0x198c07[_0xc212('0x4e')][_0xc212('0x24')]);_0x5135d4[_0xc212('0x21')]=qs[_0xc212('0x21')](_0x198c07['query']['offset']);}_0x5135d4[_0xc212('0x55')]=qs[_0xc212('0x56')](_0x198c07[_0xc212('0x4e')][_0xc212('0x56')]);_0x5135d4[_0xc212('0x57')]=qs['filters'](_[_0xc212('0x74')](_0x198c07[_0xc212('0x4e')],_0x10fffd[_0xc212('0x50')]));_0x5135d4[_0xc212('0x57')][_0xc212('0x68')]=_0x3d6894['id'];if(_0x198c07[_0xc212('0x4e')][_0xc212('0x58')]){_0x5135d4[_0xc212('0x57')]=_[_0xc212('0x5a')](_0x5135d4[_0xc212('0x57')],{'$or':_[_0xc212('0x4a')](_0x5135d4['attributes'],function(_0x546827){var _0x1a448a={};_0x1a448a[_0x546827]={'$like':'%'+_0x198c07[_0xc212('0x4e')]['filter']+'%'};return _0x1a448a;})});}_0x5135d4=_[_0xc212('0x5a')]({},_0x5135d4,_0x198c07[_0xc212('0x60')]);return db[_0xc212('0x89')][_0xc212('0x23')]({'where':_0x5135d4[_0xc212('0x57')]})[_0xc212('0x13')](function(_0xe8072b){_0xc2f91[_0xc212('0x23')]=_0xe8072b;if(_0x198c07[_0xc212('0x4e')][_0xc212('0x75')]){_0x5135d4[_0xc212('0x5c')]=[{'model':db[_0xc212('0x8c')],'as':_0xc212('0x8d'),'required':![]},{'model':db[_0xc212('0x8e')],'as':_0xc212('0x8f'),'attributes':['name',_0xc212('0x90'),_0xc212('0x91')],'required':![]},{'model':db['Tag'],'as':_0xc212('0x92'),'attributes':['id','name',_0xc212('0x93')],'where':_0x198c07['query'][_0xc212('0x94')]?{'id':_0x198c07[_0xc212('0x4e')]['tag']}:undefined,'required':_0x198c07['query'][_0xc212('0x94')]?!![]:![]}];}return db[_0xc212('0x89')][_0xc212('0x6e')](_0x5135d4);})['then'](function(_0x19b163){_0xc2f91[_0xc212('0x6f')]=_0x19b163;return _0xc2f91;});}})[_0xc212('0x13')](respondWithFilteredResult(_0x2d91c3,_0x5135d4))[_0xc212('0x1c')](handleError(_0x2d91c3,null));};exports[_0xc212('0x95')]=function addApplications(_0x5dbe37,_0x38837f){var _0x182bc8=_0x5dbe37[_0xc212('0x5e')]['id'];var _0x1f0e2f=_0x5dbe37[_0xc212('0x61')];var _0x5e2542=0xc8;var _0x1c4a85=null;return db[_0xc212('0x96')]['transaction']({'isolationLevel':db[_0xc212('0x96')][_0xc212('0x97')][_0xc212('0x98')][_0xc212('0x99')]},function(_0x484b04){return db[_0xc212('0x5b')][_0xc212('0x6c')]({'where':{'id':_0x182bc8},'transaction':_0x484b04})[_0xc212('0x13')](function(_0x99484b){if(_0x99484b){return db[_0xc212('0x9a')][_0xc212('0x2b')]({'where':{'MailAccountId':_0x182bc8},'transaction':_0x484b04})['then'](function(){var _0x2ca2df=_[_0xc212('0x4a')](_0x1f0e2f,function(_0x34ea51){_0x34ea51['MailAccountId']=_0x182bc8;return _0x34ea51;});return db['MailApplication'][_0xc212('0x9b')](_0x2ca2df,{'transaction':_0x484b04});});}else{_0x5e2542=0x194;_0x1c4a85=[];}});})[_0xc212('0x13')](function(){if(_0x5e2542!==0x194){return db[_0xc212('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x182bc8},'order':'priority'})['then'](function(_0x4d1310){_0x1c4a85=_0x4d1310;});}})[_0xc212('0x1c')](function(_0x11c3d4){_0x5e2542=0x1f4;logger[_0xc212('0x19')](_0x11c3d4['stack']);if(_0x11c3d4['name']){delete _0x11c3d4[_0xc212('0x2d')];}_0x1c4a85=_0x11c3d4;})[_0xc212('0x9c')](function(){if(_0x1c4a85===null){_0x38837f['sendStatus'](_0x5e2542);}else{if(_0x5e2542===0x1f4){_0x38837f[_0xc212('0x1f')](_0x5e2542)[_0xc212('0x2e')](_0x1c4a85);}else{_0x38837f[_0xc212('0x1f')](_0x5e2542)[_0xc212('0x20')](_0x1c4a85);}}});};exports[_0xc212('0x9d')]=function(_0x3ff5b4,_0x1edcfc){var _0x2f84ab={};var _0x3eeda9={};var _0x1f09f1;var _0x34d08a;return db['MailAccount']['findOne']({'where':{'id':_0x3ff5b4[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x1edcfc,null))[_0xc212('0x13')](function(_0x237884){if(_0x237884){_0x1f09f1=_0x237884;_0x3eeda9['model']=_['keys'](db['MailApplication'][_0xc212('0x4b')]);_0x3eeda9[_0xc212('0x4e')]=_['keys'](_0x3ff5b4[_0xc212('0x4e')]);_0x3eeda9[_0xc212('0x50')]=_['intersection'](_0x3eeda9['model'],_0x3eeda9[_0xc212('0x4e')]);_0x2f84ab[_0xc212('0x52')]=_['intersection'](_0x3eeda9[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x3ff5b4[_0xc212('0x4e')][_0xc212('0x53')]));_0x2f84ab[_0xc212('0x52')]=_0x2f84ab[_0xc212('0x52')]['length']?_0x2f84ab[_0xc212('0x52')]:_0x3eeda9['model'];_0x2f84ab[_0xc212('0x55')]=qs[_0xc212('0x56')](_0x3ff5b4[_0xc212('0x4e')][_0xc212('0x56')]);_0x2f84ab[_0xc212('0x57')]=qs[_0xc212('0x50')](_[_0xc212('0x74')](_0x3ff5b4[_0xc212('0x4e')],_0x3eeda9[_0xc212('0x50')]));if(_0x3ff5b4[_0xc212('0x4e')][_0xc212('0x58')]){_0x2f84ab[_0xc212('0x57')]=_[_0xc212('0x5a')](_0x2f84ab[_0xc212('0x57')],{'$or':_['map'](_0x2f84ab[_0xc212('0x52')],function(_0xd78dd1){var _0x329662={};_0x329662[_0xd78dd1]={'$like':'%'+_0x3ff5b4[_0xc212('0x4e')][_0xc212('0x58')]+'%'};return _0x329662;})});}_0x2f84ab=_[_0xc212('0x5a')]({},_0x2f84ab,_0x3ff5b4['options']);return _0x1f09f1['getApplications'](_0x2f84ab);}})['then'](function(_0xa93056){if(_0xa93056){_0x34d08a=_0xa93056['length'];if(!_0x3ff5b4['query']['hasOwnProperty'](_0xc212('0x54'))){_0x2f84ab[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x3ff5b4[_0xc212('0x4e')]['limit']);_0x2f84ab[_0xc212('0x21')]=qs['offset'](_0x3ff5b4[_0xc212('0x4e')][_0xc212('0x21')]);}return _0x1f09f1[_0xc212('0x9d')](_0x2f84ab);}})[_0xc212('0x13')](function(_0x1cd657){if(_0x1cd657){return _0x1cd657?{'count':_0x34d08a,'rows':_0x1cd657}:null;}})[_0xc212('0x13')](respondWithResult(_0x1edcfc,null))[_0xc212('0x1c')](handleError(_0x1edcfc,null));};exports['getMessages']=function(_0x324852,_0x13e530){var _0xf356f={'raw':!![],'where':{}};var _0x4266b7={};var _0x24c49b={'count':0x0,'rows':[]};return db[_0xc212('0x5b')][_0xc212('0x6c')]({'where':{'id':_0x324852[_0xc212('0x5e')]['id']}})['then'](handleEntityNotFound(_0x13e530,null))['then'](function(_0x35daca){if(_0x35daca){_0x4266b7[_0xc212('0x4d')]=_[_0xc212('0x4f')](db[_0xc212('0x9e')][_0xc212('0x4b')]);_0x4266b7['query']=_[_0xc212('0x4f')](_0x324852['query']);_0x4266b7[_0xc212('0x50')]=_[_0xc212('0x51')](_0x4266b7[_0xc212('0x4d')],_0x4266b7[_0xc212('0x4e')]);_0xf356f[_0xc212('0x52')]=_[_0xc212('0x51')](_0x4266b7[_0xc212('0x4d')],qs['fields'](_0x324852[_0xc212('0x4e')][_0xc212('0x53')]));_0xf356f[_0xc212('0x52')]=_0xf356f[_0xc212('0x52')][_0xc212('0x5f')]?_0xf356f[_0xc212('0x52')]:_0x4266b7[_0xc212('0x4d')];if(!_0x324852['query']['hasOwnProperty'](_0xc212('0x54'))){_0xf356f[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x324852['query'][_0xc212('0x24')]);_0xf356f['offset']=qs[_0xc212('0x21')](_0x324852[_0xc212('0x4e')]['offset']);}_0xf356f[_0xc212('0x55')]=qs['sort'](_0x324852[_0xc212('0x4e')][_0xc212('0x56')]);_0xf356f[_0xc212('0x57')]=qs[_0xc212('0x50')](_[_0xc212('0x74')](_0x324852[_0xc212('0x4e')],_0x4266b7[_0xc212('0x50')]));_0xf356f[_0xc212('0x57')][_0xc212('0x68')]=_0x35daca['id'];if(_0x324852[_0xc212('0x4e')][_0xc212('0x58')]){_0xf356f[_0xc212('0x57')]=_[_0xc212('0x5a')](_0xf356f[_0xc212('0x57')],{'$or':_[_0xc212('0x4a')](_0xf356f['attributes'],function(_0x509839){var _0x3c5ef1={};_0x3c5ef1[_0x509839]={'$like':'%'+_0x324852[_0xc212('0x4e')][_0xc212('0x58')]+'%'};return _0x3c5ef1;})});}if(_0x324852[_0xc212('0x4e')][_0xc212('0x9f')]){var _0x167de4=_0x324852[_0xc212('0x4e')][_0xc212('0x9f')][_0xc212('0xa0')](',');var _0x38574f={};_0x38574f[_0x167de4[0x0]]={'$gte':moment(_0x167de4[0x1])['format'](_0xc212('0xa1'))};_0xf356f[_0xc212('0x57')]=_[_0xc212('0x5a')](_0xf356f[_0xc212('0x57')],_0x38574f);}_0xf356f=_[_0xc212('0x5a')]({},_0xf356f,_0x324852[_0xc212('0x60')]);return db[_0xc212('0x9e')]['count']({'where':_0xf356f['where']})[_0xc212('0x13')](function(_0x31c8c8){_0x24c49b[_0xc212('0x23')]=_0x31c8c8;if(_0x324852[_0xc212('0x4e')][_0xc212('0x75')]){_0xf356f['include']=[{'all':!![]}];}return db[_0xc212('0x9e')][_0xc212('0x6e')](_0xf356f);})[_0xc212('0x13')](function(_0x5a3edf){if(_0x324852[_0xc212('0x4e')]['inlineCss']===_0xc212('0xa2')){for(var _0x5c7922=0x0;_0x5c7922<_0x5a3edf[_0xc212('0x5f')];_0x5c7922++){_0x5a3edf[_0x5c7922][_0xc212('0x61')]=juice(_0x5a3edf[_0x5c7922][_0xc212('0x61')]);}}_0x24c49b[_0xc212('0x6f')]=_0x5a3edf;return _0x24c49b;});}})[_0xc212('0x13')](respondWithFilteredResult(_0x13e530,_0xf356f))[_0xc212('0x1c')](handleError(_0x13e530,null));};exports[_0xc212('0x2e')]=function(_0x42a13b,_0x469b4a){var _0x1b5927,_0x41c054={},_0x5a5acf;if(_0x42a13b['body']['to']){_0x5a5acf=_0x42a13b[_0xc212('0x61')]['to'][_0xc212('0xa0')](',')[0x0];}return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0x42a13b[_0xc212('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5a5acf},'limit':0x1,'order':[[_0xc212('0xa3'),_0xc212('0xa4')]]}]},{'model':db[_0xc212('0x47')],'as':_0xc212('0x44'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc212('0xa5'),'raw':!![]}]}]})[_0xc212('0x13')](handleEntityNotFound(_0x469b4a,null))[_0xc212('0x13')](function(_0x2d8646){if(!_0x2d8646)return;_0x1b5927=_0x2d8646;if(!_0x2d8646[_0xc212('0x44')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0xc212('0x79')](_0x42a13b['body'][_0xc212('0xa6')])){_0x42a13b[_0xc212('0x61')]['from']=util[_0xc212('0xa7')](_0xc212('0xa8'),_0x2d8646[_0xc212('0x2d')],_0x2d8646['email']||_0x2d8646[_0xc212('0x44')][_0xc212('0x38')]);}if(_0x42a13b[_0xc212('0x61')][_0xc212('0xa9')]&&_0x42a13b[_0xc212('0x61')]['attachments']['length']){for(var _0x5b033e=0x0;_0x5b033e<_0x42a13b[_0xc212('0x61')][_0xc212('0xa9')][_0xc212('0x5f')];_0x5b033e+=0x1){_0x42a13b[_0xc212('0x61')][_0xc212('0xa9')][_0x5b033e]={'filename':_0x42a13b[_0xc212('0x61')][_0xc212('0xa9')][_0x5b033e][_0xc212('0x2d')],'path':path['join'](config[_0xc212('0xaa')],_0xc212('0xab'),_0x42a13b[_0xc212('0x61')][_0xc212('0xa9')][_0x5b033e][_0xc212('0xac')])};}}var _0x5c1075=_0x2d8646['getSmtpOptions']();return respondWithRpcPromise(_0xc212('0xad'),_0xc212('0xae'),{'account':_0x5c1075,'message':_0x42a13b['body']});})[_0xc212('0x13')](function(_0x2a3444){if(!_0x2a3444)return;_0x41c054=_0x2a3444;if(!_0x1b5927[_0xc212('0xaf')])throw new Error(_0xc212('0xb0'));if(_0x1b5927[_0xc212('0xaf')][_0xc212('0xb1')][_0xc212('0x5f')])return _0x1b5927['List'][_0xc212('0xb1')][0x0];return db[_0xc212('0x8c')][_0xc212('0x6a')](_[_0xc212('0xa')](_0x42a13b[_0xc212('0x61')],{'firstName':_0x42a13b[_0xc212('0x61')]['to'],'email':_0x42a13b[_0xc212('0x61')]['to'],'phone':_0x42a13b[_0xc212('0x61')]['to'],'ListId':_0x1b5927[_0xc212('0xb2')]}));})[_0xc212('0x13')](function(_0x1e55a1){if(!_0x1e55a1)return;var _0x53961a={'UserId':_0x42a13b[_0xc212('0x38')]['id'],'ContactId':_0x1e55a1['id'],'MailAccountId':_0x1b5927['id'],'inReplyTo':_0x41c054[_0xc212('0xb3')],'to':_0x42a13b['body'][_0xc212('0xa6')],'cc':_0x42a13b['body']['cc'],'subject':_0x42a13b[_0xc212('0x61')][_0xc212('0xb4')],'attach':_0x42a13b[_0xc212('0x61')][_0xc212('0xb5')],'firstMsgDirection':_0xc212('0xb6'),'lastMsgAt':moment()[_0xc212('0xa7')](_0xc212('0xa1')),'lastMsgDirection':_0xc212('0xb6'),'Messages':[_[_0xc212('0x5a')](_0x42a13b['body'],{'messageId':_0x41c054['messageId'],'sentAt':moment()[_0xc212('0xa7')](_0xc212('0xa1')),'read':!![],'MailAccountId':_0x1b5927['id'],'UserId':_0x42a13b['user']['id'],'ContactId':_0x1e55a1['id']})]};if(_0x42a13b[_0xc212('0x61')][_0xc212('0xb7')]){_0x53961a=_['merge'](_0x53961a,_0x42a13b[_0xc212('0x61')][_0xc212('0xb7')]);}return db[_0xc212('0x89')]['create'](_0x53961a,{'include':[{'model':db[_0xc212('0x9e')],'as':_0xc212('0xb8')}]});})[_0xc212('0x13')](respondWithResult(_0x469b4a,null))[_0xc212('0x1c')](handleError(_0x469b4a,null));};exports[_0xc212('0xb9')]=function(_0xff15af,_0x2106bf){return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0xff15af[_0xc212('0x5e')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xc212('0x44'),'raw':!![],'include':[{'model':db[_0xc212('0xa5')],'as':_0xc212('0xa5'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2106bf,null))['then'](function(_0x424af9){if(!_0x424af9[_0xc212('0x44')])return;var _0x224f64=_0x424af9['getSmtpOptions']();return respondWithRpcPromise(_0xc212('0xba'),'verifySmtp',{'account':_0x224f64});})['then'](respondWithResult(_0x2106bf,null))[_0xc212('0x1c')](handleError(_0x2106bf,null));};exports['destroy']=function(_0x122662,_0x1d9d59){return db['MailAccount'][_0xc212('0x67')]({'where':{'id':_0x122662[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x1d9d59,null))[_0xc212('0x13')](function(_0x23b916){if(_0x23b916&&_0x23b916[_0xc212('0x41')]){throw new db[(_0xc212('0xbb'))]['ValidationError'](_0xc212('0xbc'));}return _0x23b916;})[_0xc212('0x13')](removeEntity(_0x1d9d59,null))[_0xc212('0x1c')](handleError(_0x1d9d59,null));};exports[_0xc212('0xbd')]=function(_0x4664d1,_0x33b796){return db[_0xc212('0x5b')]['find']({'where':{'id':_0x4664d1[_0xc212('0x5e')]['id']}})['then'](handleEntityNotFound(_0x33b796,null))[_0xc212('0x13')](function(_0x59fe72){if(_0x59fe72){return _0x59fe72[_0xc212('0xbd')](_0x4664d1[_0xc212('0x61')][_0xc212('0x70')],_[_0xc212('0x8a')](_0x4664d1[_0xc212('0x61')],[_0xc212('0x70'),'id'])||{})['spread'](function(_0x515b09){for(var _0x71c744=0x0;_0x71c744<_0x4664d1[_0xc212('0x61')][_0xc212('0x70')][_0xc212('0x5f')];_0x71c744+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x4664d1[_0xc212('0x61')][_0xc212('0x70')][_0x71c744]),'MailAccountId':Number(_0x4664d1['params']['id'])});}return _0x515b09;});}})['then'](respondWithResult(_0x33b796,null))[_0xc212('0x1c')](handleError(_0x33b796,null));};exports[_0xc212('0xbe')]=function(_0x67d848,_0x4a077d){return db[_0xc212('0x5b')][_0xc212('0x67')]({'where':{'id':_0x67d848[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x4a077d,null))[_0xc212('0x13')](function(_0x159812){if(_0x159812){return _0x159812[_0xc212('0xbe')](_0x67d848[_0xc212('0x4e')][_0xc212('0x70')])['then'](function(){if(_[_0xc212('0xbf')](_0x67d848[_0xc212('0x4e')][_0xc212('0x70')])){for(var _0x42a6de=0x0;_0x42a6de<_0x67d848['query']['ids']['length'];_0x42a6de+=0x1){socket[_0xc212('0xc0')]('userMailAccount:remove',{'UserId':Number(_0x67d848[_0xc212('0x4e')]['ids'][_0x42a6de]),'MailAccountId':Number(_0x67d848[_0xc212('0x5e')]['id'])});}}else{socket[_0xc212('0xc0')](_0xc212('0xc1'),{'UserId':Number(_0x67d848[_0xc212('0x4e')][_0xc212('0x70')]),'MailAccountId':Number(_0x67d848[_0xc212('0x5e')]['id'])});}});}})[_0xc212('0x13')](respondWithStatusCode(_0x4a077d,null))['catch'](handleError(_0x4a077d,null));};exports['getAgents']=function(_0x3c6aad,_0x236cce){var _0x8ff998={};var _0x137206={};var _0x59babf;var _0x5760bd;return db['MailAccount']['findOne']({'where':{'id':_0x3c6aad[_0xc212('0x5e')]['id']}})[_0xc212('0x13')](handleEntityNotFound(_0x236cce,null))[_0xc212('0x13')](function(_0x434f04){if(_0x434f04){_0x59babf=_0x434f04;_0x137206[_0xc212('0x4d')]=_['keys'](db[_0xc212('0x8e')][_0xc212('0x4b')]);_0x137206[_0xc212('0x4e')]=_[_0xc212('0x4f')](_0x3c6aad['query']);_0x137206['filters']=_[_0xc212('0x51')](_0x137206[_0xc212('0x4d')],_0x137206[_0xc212('0x4e')]);_0x8ff998['attributes']=_['intersection'](_0x137206[_0xc212('0x4d')],qs[_0xc212('0x53')](_0x3c6aad[_0xc212('0x4e')]['fields']));_0x8ff998['attributes']=_0x8ff998[_0xc212('0x52')][_0xc212('0x5f')]?_0x8ff998[_0xc212('0x52')]:_0x137206[_0xc212('0x4d')];_0x8ff998[_0xc212('0x55')]=qs[_0xc212('0x56')](_0x3c6aad[_0xc212('0x4e')][_0xc212('0x56')]);_0x8ff998[_0xc212('0x57')]=qs[_0xc212('0x50')](_[_0xc212('0x74')](_0x3c6aad[_0xc212('0x4e')],_0x137206[_0xc212('0x50')]));if(_0x3c6aad[_0xc212('0x4e')][_0xc212('0x58')]){_0x8ff998[_0xc212('0x57')]=_[_0xc212('0x5a')](_0x8ff998[_0xc212('0x57')],{'$or':_[_0xc212('0x4a')](_0x8ff998['attributes'],function(_0x2f9c0c){var _0x1ba60f={};_0x1ba60f[_0x2f9c0c]={'$like':'%'+_0x3c6aad[_0xc212('0x4e')][_0xc212('0x58')]+'%'};return _0x1ba60f;})});}_0x8ff998=_['merge']({},_0x8ff998,_0x3c6aad['options']);return _0x59babf[_0xc212('0xc2')](_0x8ff998);}})['then'](function(_0x594ebe){if(_0x594ebe){_0x5760bd=_0x594ebe['length'];if(!_0x3c6aad[_0xc212('0x4e')][_0xc212('0x6d')](_0xc212('0x54'))){_0x8ff998[_0xc212('0x24')]=qs[_0xc212('0x24')](_0x3c6aad[_0xc212('0x4e')][_0xc212('0x24')]);_0x8ff998[_0xc212('0x21')]=qs[_0xc212('0x21')](_0x3c6aad[_0xc212('0x4e')][_0xc212('0x21')]);}return _0x59babf[_0xc212('0xc2')](_0x8ff998);}})[_0xc212('0x13')](function(_0x2c9395){if(_0x2c9395){return _0x2c9395?{'count':_0x5760bd,'rows':_0x2c9395}:null;}})[_0xc212('0x13')](respondWithResult(_0x236cce,null))[_0xc212('0x1c')](handleError(_0x236cce,null));}; \ No newline at end of file +var _0x1d96=['Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','merge','find','update','body','provider','custom','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','key','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','tag','sequelize','transaction','Transaction','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','List','Contacts','updatedAt','DESC','isNil','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','List\x20not\x20found','defaults','messageId','subject','attach','Interaction','Messages','verifySmtp','CloudProvider','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','bluebird','util','lodash','juice','ioredis','../../config/logger','api','../../config/environment','redis','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','get','MailAccounts','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x1d96,0x89));var _0x61d9=function(_0xdfd149,_0x5306d0){_0xdfd149=_0xdfd149-0x0;var _0x56cce3=_0x1d96[_0xdfd149];return _0x56cce3;};'use strict';var moment=require('moment');var BPromise=require(_0x61d9('0x0'));var util=require(_0x61d9('0x1'));var path=require('path');var _=require(_0x61d9('0x2'));var juice=require(_0x61d9('0x3'));var Redis=require(_0x61d9('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x61d9('0x5'))(_0x61d9('0x6'));var config=require(_0x61d9('0x7'));var db=require('../../mysqldb')['db'];config[_0x61d9('0x8')]=_['defaults'](config[_0x61d9('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61d9('0x8')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x61d9('0x9'));var client=jayson[_0x61d9('0xa')][_0x61d9('0xb')]({'port':0x232b});function respondWithRpcPromise(_0x18fa10,_0x3b1886,_0xee5d79,_0x25236c){return new BPromise(function(_0x18a113,_0x1518f2){var _0x46d9c5=_0x25236c||client;return _0x46d9c5[_0x61d9('0xc')](_0x18fa10,_0xee5d79)[_0x61d9('0xd')](function(_0x5196f0){logger['info'](_0x61d9('0xe'),_0x3b1886,'request\x20sent');logger[_0x61d9('0xf')](_0x61d9('0x10'),_0x3b1886,_0x61d9('0x11'),JSON[_0x61d9('0x12')](_0x5196f0));if(_0x5196f0['error']){if(_0x5196f0[_0x61d9('0x13')][_0x61d9('0x14')]===0x1f4){logger[_0x61d9('0x13')](_0x61d9('0xe'),_0x3b1886,_0x5196f0['error'][_0x61d9('0x15')]);return _0x1518f2(_0x5196f0[_0x61d9('0x13')]['message']);}logger['error'](_0x61d9('0xe'),_0x3b1886,_0x5196f0[_0x61d9('0x13')][_0x61d9('0x15')]);return _0x18a113(_0x5196f0[_0x61d9('0x13')]['message']);}else{logger[_0x61d9('0x16')]('MailAccount,\x20%s,\x20%s',_0x3b1886,_0x61d9('0x11'));_0x18a113(_0x5196f0['result'][_0x61d9('0x15')]);}})[_0x61d9('0x17')](function(_0x4a4da4){logger[_0x61d9('0x13')](_0x61d9('0xe'),_0x3b1886,_0x4a4da4);_0x1518f2(_0x4a4da4);});});}function respondWithStatusCode(_0x5a19fe,_0x2d1943){_0x2d1943=_0x2d1943||0xcc;return function(_0x1dd6c2){if(_0x1dd6c2){return _0x5a19fe[_0x61d9('0x18')](_0x2d1943);}return _0x5a19fe[_0x61d9('0x19')](_0x2d1943)[_0x61d9('0x1a')]();};}function respondWithResult(_0x2482a8,_0x4cc043){_0x4cc043=_0x4cc043||0xc8;return function(_0x190249){if(_0x190249){return _0x2482a8[_0x61d9('0x19')](_0x4cc043)['json'](_0x190249);}};}function respondWithFilteredResult(_0x1bf10c,_0x10317d){return function(_0x142550){if(_0x142550){var _0x17659f=typeof _0x10317d[_0x61d9('0x1b')]===_0x61d9('0x1c')&&typeof _0x10317d[_0x61d9('0x1d')]===_0x61d9('0x1c');var _0x5ce9c2=_0x142550[_0x61d9('0x1e')];var _0x39fdfa=_0x17659f?0x0:_0x10317d['offset'];var _0x54dcea=_0x17659f?_0x142550[_0x61d9('0x1e')]:_0x10317d[_0x61d9('0x1b')]+_0x10317d[_0x61d9('0x1d')];var _0x518212;if(_0x54dcea>=_0x5ce9c2){_0x54dcea=_0x5ce9c2;_0x518212=0xc8;}else{_0x518212=0xce;}_0x1bf10c[_0x61d9('0x19')](_0x518212);return _0x1bf10c[_0x61d9('0x1f')](_0x61d9('0x20'),_0x39fdfa+'-'+_0x54dcea+'/'+_0x5ce9c2)[_0x61d9('0x21')](_0x142550);}return null;};}function saveUpdates(_0xc1875e){return function(_0x22ccdb){if(_0x22ccdb){return _0x22ccdb['update'](_0xc1875e)[_0x61d9('0xd')](function(_0x2f00de){return _0x2f00de;});}return null;};}function removeEntity(_0x48ee5a){return function(_0x1b8105){if(_0x1b8105){return _0x1b8105[_0x61d9('0x22')]()[_0x61d9('0xd')](function(){var _0x39090b=_0x1b8105[_0x61d9('0x23')]({'plain':!![]});var _0x559ab5=_0x61d9('0x24');return db[_0x61d9('0x25')][_0x61d9('0x22')]({'where':{'type':_0x559ab5,'resourceId':_0x39090b['id']}})[_0x61d9('0xd')](function(){return _0x1b8105;});})[_0x61d9('0xd')](function(){_0x48ee5a[_0x61d9('0x19')](0xcc)[_0x61d9('0x1a')]();});}};}function handleEntityNotFound(_0x41f7d5){return function(_0x7a89d0){if(!_0x7a89d0){_0x41f7d5[_0x61d9('0x18')](0x194);}return _0x7a89d0;};}function handleError(_0x1c910e,_0x6f2903){_0x6f2903=_0x6f2903||0x1f4;return function(_0x17cfd7){logger['error'](_0x17cfd7[_0x61d9('0x26')]);if(_0x17cfd7[_0x61d9('0x27')]){delete _0x17cfd7[_0x61d9('0x27')];}_0x1c910e[_0x61d9('0x19')](_0x6f2903)['send'](_0x17cfd7);};}function getImapHost(_0xee104){switch(_0xee104){case _0x61d9('0x28'):return _0x61d9('0x29');case _0x61d9('0x2a'):return'imap.mail.yahoo.com';case _0x61d9('0x2b'):return _0x61d9('0x2c');case _0x61d9('0x2d'):return _0x61d9('0x2e');}throw new Error(_0x61d9('0x2f'),_0xee104);}function getSmtpHost(_0x41d153){switch(_0x41d153){case _0x61d9('0x28'):return'smtp.gmail.com';case'yahoo':return _0x61d9('0x30');case _0x61d9('0x2b'):return'smtp-mail.outlook.com';case'outlook365':return _0x61d9('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x41d153);}function getAuthenticationOptions(_0x133b41,_0x335261){var _0x5e6415={};var _0x18508b={};if(_0x133b41){_0x5e6415[_0x61d9('0x32')]=_0x18508b['user']=_0x335261['username'];_0x5e6415[_0x61d9('0x33')]=_0x18508b[_0x61d9('0x34')]=_0x335261[_0x61d9('0x33')];if(_0x335261[_0x61d9('0x35')]){_0x5e6415[_0x61d9('0x35')]=_0x18508b[_0x61d9('0x35')]=!![];_0x5e6415[_0x61d9('0x36')]=_0x18508b[_0x61d9('0x36')]=_0x335261[_0x61d9('0x36')];_0x5e6415[_0x61d9('0x33')]=_0x18508b[_0x61d9('0x34')]=null;}else{_0x5e6415[_0x61d9('0x36')]=_0x18508b[_0x61d9('0x36')]=null;}_0x5e6415['host']=getImapHost(_0x133b41);_0x5e6415[_0x61d9('0x37')]=0x3e1;_0x18508b[_0x61d9('0x38')]=getSmtpHost(_0x133b41);_0x18508b['port']=0x24b;_0x18508b[_0x61d9('0x39')]=![];_0x5e6415['service']=_0x18508b[_0x61d9('0x3a')]=null;}else{if(_0x335261[_0x61d9('0x3b')]){_0x5e6415[_0x61d9('0x32')]=_0x18508b[_0x61d9('0x32')]=_0x335261[_0x61d9('0x3c')];_0x5e6415[_0x61d9('0x33')]=_0x18508b['pass']=_0x335261['password'];}else{_0x5e6415[_0x61d9('0x3b')]=_0x18508b[_0x61d9('0x3b')]=![];_0x5e6415['user']=_0x18508b['user']=null;_0x5e6415[_0x61d9('0x33')]=_0x18508b[_0x61d9('0x34')]=null;}_0x5e6415[_0x61d9('0x38')]=_0x335261['Imap'][_0x61d9('0x38')];_0x5e6415[_0x61d9('0x37')]=_0x335261[_0x61d9('0x3d')]['port'];_0x18508b[_0x61d9('0x38')]=_0x335261['Smtp']['host'];_0x18508b[_0x61d9('0x37')]=_0x335261[_0x61d9('0x3e')][_0x61d9('0x37')];}return{'Imap':_0x5e6415,'Smtp':_0x18508b};}exports['index']=function(_0x537b97,_0x46bcbe){var _0xbd9fa6={'include':[{'model':db[_0x61d9('0x3f')],'as':_0x61d9('0x3d')},{'model':db[_0x61d9('0x40')],'as':'Smtp'},{'model':db[_0x61d9('0x41')],'as':_0x61d9('0x42')}]},_0x30d466={},_0x2f64a8={'count':0x0,'rows':[]};var _0x35d724=_[_0x61d9('0x43')](db[_0x61d9('0x44')][_0x61d9('0x45')],function(_0x440348){return{'name':_0x440348[_0x61d9('0x46')],'type':_0x440348[_0x61d9('0x47')]['key']};});_0x30d466[_0x61d9('0x48')]=_['map'](_0x35d724,_0x61d9('0x27'));_0x30d466['query']=_[_0x61d9('0x49')](_0x537b97[_0x61d9('0x4a')]);_0x30d466[_0x61d9('0x4b')]=_[_0x61d9('0x4c')](_0x30d466[_0x61d9('0x48')],_0x30d466['query']);_0xbd9fa6['attributes']=_[_0x61d9('0x4c')](_0x30d466[_0x61d9('0x48')],qs['fields'](_0x537b97['query'][_0x61d9('0x4d')]));_0xbd9fa6[_0x61d9('0x4e')]=_0xbd9fa6['attributes']['length']?_0xbd9fa6['attributes']:_0x30d466[_0x61d9('0x48')];if(!_0x537b97['query'][_0x61d9('0x4f')](_0x61d9('0x50'))){_0xbd9fa6[_0x61d9('0x1d')]=qs[_0x61d9('0x1d')](_0x537b97[_0x61d9('0x4a')][_0x61d9('0x1d')]);_0xbd9fa6[_0x61d9('0x1b')]=qs[_0x61d9('0x1b')](_0x537b97[_0x61d9('0x4a')][_0x61d9('0x1b')]);}_0xbd9fa6['order']=qs[_0x61d9('0x51')](_0x537b97[_0x61d9('0x4a')][_0x61d9('0x51')]);_0xbd9fa6[_0x61d9('0x52')]=qs[_0x61d9('0x4b')](_['pick'](_0x537b97[_0x61d9('0x4a')],_0x30d466['filters']),_0x35d724);if(_0x537b97[_0x61d9('0x4a')]['filter']){_0xbd9fa6['where']=_['merge'](_0xbd9fa6[_0x61d9('0x52')],{'$or':_['map'](_0x35d724,function(_0x2ae14b){if(_0x2ae14b[_0x61d9('0x47')]!==_0x61d9('0x53')){var _0x6b0434={};_0x6b0434[_0x2ae14b[_0x61d9('0x27')]]={'$like':'%'+_0x537b97['query'][_0x61d9('0x54')]+'%'};return _0x6b0434;}})});}_0xbd9fa6=_['merge']({},_0xbd9fa6,_0x537b97[_0x61d9('0x55')]);var _0x5e8be4={'where':_0xbd9fa6[_0x61d9('0x52')]};return db[_0x61d9('0x44')]['count'](_0x5e8be4)[_0x61d9('0xd')](function(_0x3f8b15){_0x2f64a8[_0x61d9('0x1e')]=_0x3f8b15;if(_0x537b97[_0x61d9('0x4a')][_0x61d9('0x56')]){_0xbd9fa6[_0x61d9('0x57')]=[{'all':!![]}];}return db['MailAccount'][_0x61d9('0x58')](_0xbd9fa6);})[_0x61d9('0xd')](function(_0x46710a){_0x2f64a8[_0x61d9('0x59')]=_0x46710a;return _0x2f64a8;})['then'](respondWithFilteredResult(_0x46bcbe,_0xbd9fa6))[_0x61d9('0x17')](handleError(_0x46bcbe,null));};exports[_0x61d9('0x5a')]=function(_0x477add,_0x2791e9){var _0x569239={'raw':![],'where':{'id':_0x477add[_0x61d9('0x5b')]['id']},'include':[{'model':db[_0x61d9('0x3f')],'as':_0x61d9('0x3d')},{'model':db[_0x61d9('0x40')],'as':_0x61d9('0x3e')},{'model':db[_0x61d9('0x41')],'as':_0x61d9('0x42')}]},_0x458058={};_0x458058[_0x61d9('0x48')]=_[_0x61d9('0x49')](db[_0x61d9('0x44')][_0x61d9('0x45')]);_0x458058[_0x61d9('0x4a')]=_[_0x61d9('0x49')](_0x477add[_0x61d9('0x4a')]);_0x458058['filters']=_[_0x61d9('0x4c')](_0x458058['model'],_0x458058['query']);_0x569239[_0x61d9('0x4e')]=_[_0x61d9('0x4c')](_0x458058[_0x61d9('0x48')],qs[_0x61d9('0x4d')](_0x477add[_0x61d9('0x4a')][_0x61d9('0x4d')]));_0x569239[_0x61d9('0x4e')]=_0x569239[_0x61d9('0x4e')][_0x61d9('0x5c')]?_0x569239[_0x61d9('0x4e')]:_0x458058[_0x61d9('0x48')];if(_0x477add[_0x61d9('0x4a')][_0x61d9('0x56')]){_0x569239[_0x61d9('0x57')]=[{'all':!![]}];}_0x569239=_[_0x61d9('0x5d')]({},_0x569239,_0x477add['options']);return db[_0x61d9('0x44')][_0x61d9('0x5e')](_0x569239)[_0x61d9('0xd')](handleEntityNotFound(_0x2791e9,null))[_0x61d9('0xd')](respondWithResult(_0x2791e9,null))[_0x61d9('0x17')](handleError(_0x2791e9,null));};exports[_0x61d9('0x5f')]=function(_0x55a370,_0x8718f1){if(_0x55a370[_0x61d9('0x60')]['id']){delete _0x55a370[_0x61d9('0x60')]['id'];}var _0x7fd103=_0x55a370[_0x61d9('0x60')][_0x61d9('0x61')]===_0x61d9('0x62')?null:_0x55a370[_0x61d9('0x60')][_0x61d9('0x61')];var _0x5689a8=_0x55a370[_0x61d9('0x60')][_0x61d9('0x3d')]||{};var _0x368649=_0x55a370[_0x61d9('0x60')][_0x61d9('0x3e')]||{};if(_0x7fd103){_0x5689a8['host']=getImapHost(_0x7fd103);_0x5689a8['port']=0x3e1;_0x368649[_0x61d9('0x38')]=getSmtpHost(_0x7fd103);_0x368649['port']=0x24b;_0x368649[_0x61d9('0x39')]=![];}if(_0x368649[_0x61d9('0x35')]){_0x368649[_0x61d9('0x39')]=![];}else{_0x368649['CloudProviderId']=null;}if(!_0x5689a8[_0x61d9('0x35')])_0x5689a8['CloudProviderId']=null;_0x55a370[_0x61d9('0x60')][_0x61d9('0x3d')]=_0x5689a8;_0x55a370[_0x61d9('0x60')][_0x61d9('0x3e')]=_0x368649;return db[_0x61d9('0x44')]['find']({'where':{'id':_0x55a370[_0x61d9('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x61d9('0x41')],'as':_0x61d9('0x42')}]})[_0x61d9('0xd')](handleEntityNotFound(_0x8718f1,null))[_0x61d9('0xd')](function(_0x233a1c){if(!_0x233a1c)throw new Error('Mail\x20Account\x20not\x20found');if(_0x233a1c[_0x61d9('0x3a')])delete _0x55a370['body'][_0x61d9('0x3d')];return _0x233a1c;})[_0x61d9('0xd')](saveUpdates(_0x55a370[_0x61d9('0x60')],null))['then'](function(_0x386e95){if(!_0x55a370[_0x61d9('0x60')][_0x61d9('0x3d')])return _0x386e95;return db['MailServerIn'][_0x61d9('0x5f')](_0x55a370[_0x61d9('0x60')][_0x61d9('0x3d')],{'where':{'MailAccountId':_0x386e95['id']}})['then'](function(){return _0x386e95;});})[_0x61d9('0xd')](function(_0x40edef){if(!_0x55a370[_0x61d9('0x60')][_0x61d9('0x3e')])return _0x40edef;return db[_0x61d9('0x40')][_0x61d9('0x5f')](_0x55a370[_0x61d9('0x60')][_0x61d9('0x3e')],{'where':{'MailAccountId':_0x40edef['id']}})[_0x61d9('0xd')](function(){return _0x40edef;});})[_0x61d9('0xd')](respondWithResult(_0x8718f1,null))[_0x61d9('0x17')](handleError(_0x8718f1,null));};exports[_0x61d9('0x63')]=function(_0x3ddf91,_0xa8f500){return db[_0x61d9('0x44')][_0x61d9('0x63')]()[_0x61d9('0xd')](respondWithResult(_0xa8f500,null))[_0x61d9('0x17')](handleError(_0xa8f500,null));};exports[_0x61d9('0x64')]=function(_0x3d2155,_0x5ad8c1){if(_0x3d2155[_0x61d9('0x60')]['id']){delete _0x3d2155[_0x61d9('0x60')]['id'];}return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x3d2155[_0x61d9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ad8c1,null))[_0x61d9('0xd')](function(_0x400f12){if(_0x400f12){_0x3d2155[_0x61d9('0x60')][_0x61d9('0x65')]=_0x400f12['id'];return db[_0x61d9('0x66')][_0x61d9('0x67')](_0x3d2155[_0x61d9('0x60')]);}})['then'](respondWithResult(_0x5ad8c1,null))[_0x61d9('0x17')](handleError(_0x5ad8c1,null));};exports[_0x61d9('0x68')]=function(_0x1aa829,_0x9be883){var _0xcd7b4a={'raw':![],'where':{}};var _0x27d935={};var _0x4763c4={'count':0x0,'rows':[]};return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0x1aa829['params']['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x9be883,null))[_0x61d9('0xd')](function(_0x50d03d){if(_0x50d03d){_0x27d935['model']=_[_0x61d9('0x49')](db[_0x61d9('0x66')]['rawAttributes']);_0x27d935[_0x61d9('0x4a')]=_[_0x61d9('0x49')](_0x1aa829[_0x61d9('0x4a')]);_0x27d935[_0x61d9('0x4b')]=_['intersection'](_0x27d935['model'],_0x27d935[_0x61d9('0x4a')]);_0xcd7b4a[_0x61d9('0x4e')]=_[_0x61d9('0x4c')](_0x27d935[_0x61d9('0x48')],qs[_0x61d9('0x4d')](_0x1aa829[_0x61d9('0x4a')][_0x61d9('0x4d')]));_0xcd7b4a[_0x61d9('0x4e')]=_0xcd7b4a[_0x61d9('0x4e')]['length']?_0xcd7b4a[_0x61d9('0x4e')]:_0x27d935[_0x61d9('0x48')];if(!_0x1aa829[_0x61d9('0x4a')][_0x61d9('0x4f')]('nolimit')){_0xcd7b4a[_0x61d9('0x1d')]=qs[_0x61d9('0x1d')](_0x1aa829['query']['limit']);_0xcd7b4a[_0x61d9('0x1b')]=qs['offset'](_0x1aa829[_0x61d9('0x4a')]['offset']);}_0xcd7b4a[_0x61d9('0x6a')]=qs['sort'](_0x1aa829['query'][_0x61d9('0x51')]);_0xcd7b4a[_0x61d9('0x52')]=qs[_0x61d9('0x4b')](_[_0x61d9('0x6b')](_0x1aa829[_0x61d9('0x4a')],_0x27d935['filters']));_0xcd7b4a[_0x61d9('0x52')][_0x61d9('0x65')]=_0x50d03d['id'];if(_0x1aa829[_0x61d9('0x4a')][_0x61d9('0x54')]){_0xcd7b4a['where']=_['merge'](_0xcd7b4a[_0x61d9('0x52')],{'$or':_[_0x61d9('0x43')](_0xcd7b4a['attributes'],function(_0x563a0b){var _0x46b67b={};_0x46b67b[_0x563a0b]={'$like':'%'+_0x1aa829['query'][_0x61d9('0x54')]+'%'};return _0x46b67b;})});}_0xcd7b4a=_[_0x61d9('0x5d')]({},_0xcd7b4a,_0x1aa829[_0x61d9('0x55')]);return db[_0x61d9('0x66')][_0x61d9('0x1e')]({'where':_0xcd7b4a[_0x61d9('0x52')]})['then'](function(_0x30af51){_0x4763c4[_0x61d9('0x1e')]=_0x30af51;if(_0x1aa829['query'][_0x61d9('0x56')]){_0xcd7b4a[_0x61d9('0x57')]=[{'all':!![]}];}return db[_0x61d9('0x66')]['findAll'](_0xcd7b4a);})[_0x61d9('0xd')](function(_0x16080a){_0x4763c4['rows']=_0x16080a;return _0x4763c4;});}})[_0x61d9('0xd')](respondWithFilteredResult(_0x9be883,_0xcd7b4a))[_0x61d9('0x17')](handleError(_0x9be883,null));};exports[_0x61d9('0x6c')]=function(_0x3d51b8,_0x4e1217){return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x3d51b8[_0x61d9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4e1217,null))[_0x61d9('0xd')](function(_0x13b512){if(_0x13b512){return _0x13b512['removeDispositions'](_0x3d51b8['query'][_0x61d9('0x6d')]);}})[_0x61d9('0xd')](respondWithStatusCode(_0x4e1217,null))['catch'](handleError(_0x4e1217,null));};exports[_0x61d9('0x6e')]=function(_0x45e46a,_0x1609d9){if(_0x45e46a[_0x61d9('0x60')]['id']){delete _0x45e46a[_0x61d9('0x60')]['id'];}return db['MailAccount'][_0x61d9('0x5e')]({'where':{'id':_0x45e46a[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x1609d9,null))[_0x61d9('0xd')](function(_0x19e10e){if(_0x19e10e){_0x45e46a[_0x61d9('0x60')][_0x61d9('0x65')]=_0x19e10e['id'];return db[_0x61d9('0x6f')][_0x61d9('0x67')](_0x45e46a[_0x61d9('0x60')]);}})[_0x61d9('0xd')](respondWithResult(_0x1609d9,null))['catch'](handleError(_0x1609d9,null));};exports['getAnswers']=function(_0xe48452,_0x532b53){var _0x432258={'raw':![],'where':{}};var _0x39ddff={};var _0x29fe66={'count':0x0,'rows':[]};return db[_0x61d9('0x44')]['findOne']({'where':{'id':_0xe48452[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x532b53,null))['then'](function(_0x2eb82b){if(_0x2eb82b){_0x39ddff['model']=_[_0x61d9('0x49')](db[_0x61d9('0x6f')][_0x61d9('0x45')]);_0x39ddff[_0x61d9('0x4a')]=_[_0x61d9('0x49')](_0xe48452['query']);_0x39ddff[_0x61d9('0x4b')]=_['intersection'](_0x39ddff['model'],_0x39ddff[_0x61d9('0x4a')]);_0x432258[_0x61d9('0x4e')]=_[_0x61d9('0x4c')](_0x39ddff[_0x61d9('0x48')],qs['fields'](_0xe48452[_0x61d9('0x4a')]['fields']));_0x432258[_0x61d9('0x4e')]=_0x432258[_0x61d9('0x4e')]['length']?_0x432258[_0x61d9('0x4e')]:_0x39ddff[_0x61d9('0x48')];if(!_0xe48452[_0x61d9('0x4a')]['hasOwnProperty'](_0x61d9('0x50'))){_0x432258[_0x61d9('0x1d')]=qs[_0x61d9('0x1d')](_0xe48452[_0x61d9('0x4a')][_0x61d9('0x1d')]);_0x432258['offset']=qs[_0x61d9('0x1b')](_0xe48452[_0x61d9('0x4a')][_0x61d9('0x1b')]);}_0x432258[_0x61d9('0x6a')]=qs[_0x61d9('0x51')](_0xe48452[_0x61d9('0x4a')]['sort']);_0x432258[_0x61d9('0x52')]=qs['filters'](_[_0x61d9('0x6b')](_0xe48452[_0x61d9('0x4a')],_0x39ddff[_0x61d9('0x4b')]));_0x432258['where'][_0x61d9('0x65')]=_0x2eb82b['id'];if(_0xe48452[_0x61d9('0x4a')]['filter']){_0x432258[_0x61d9('0x52')]=_[_0x61d9('0x5d')](_0x432258[_0x61d9('0x52')],{'$or':_['map'](_0x432258['attributes'],function(_0x49eee1){var _0x24600e={};_0x24600e[_0x49eee1]={'$like':'%'+_0xe48452[_0x61d9('0x4a')]['filter']+'%'};return _0x24600e;})});}_0x432258=_[_0x61d9('0x5d')]({},_0x432258,_0xe48452[_0x61d9('0x55')]);return db['CannedAnswer']['count']({'where':_0x432258[_0x61d9('0x52')]})[_0x61d9('0xd')](function(_0x5f2fd0){_0x29fe66[_0x61d9('0x1e')]=_0x5f2fd0;if(_0xe48452[_0x61d9('0x4a')][_0x61d9('0x56')]){_0x432258[_0x61d9('0x57')]=[{'all':!![]}];}return db[_0x61d9('0x6f')][_0x61d9('0x58')](_0x432258);})[_0x61d9('0xd')](function(_0x2ce5c4){_0x29fe66[_0x61d9('0x59')]=_0x2ce5c4;return _0x29fe66;});}})['then'](respondWithFilteredResult(_0x532b53,_0x432258))[_0x61d9('0x17')](handleError(_0x532b53,null));};exports['removeAnswers']=function(_0x2bcb77,_0x1f718d){return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x2bcb77[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x1f718d,null))[_0x61d9('0xd')](function(_0x9dc17b){if(_0x9dc17b){return _0x9dc17b[_0x61d9('0x70')](_0x2bcb77[_0x61d9('0x4a')][_0x61d9('0x6d')]);}})['then'](respondWithStatusCode(_0x1f718d,null))['catch'](handleError(_0x1f718d,null));};exports[_0x61d9('0x67')]=function(_0x41950f,_0x2dadcc){var _0x3ee7f8={'name':_0x41950f['body'][_0x61d9('0x27')],'key':_0x41950f['body'][_0x61d9('0x71')],'provider':_0x41950f[_0x61d9('0x60')]['provider']==='custom'?null:_0x41950f[_0x61d9('0x60')][_0x61d9('0x61')],'email':_0x41950f[_0x61d9('0x60')][_0x61d9('0x72')],'ListId':_0x41950f[_0x61d9('0x60')][_0x61d9('0x73')],'active':!_['isNil'](_0x41950f[_0x61d9('0x60')][_0x61d9('0x74')])?_0x41950f[_0x61d9('0x60')][_0x61d9('0x74')]:!![],'description':_0x41950f[_0x61d9('0x60')][_0x61d9('0x75')]||null};var _0x41834f=getAuthenticationOptions(_0x3ee7f8['provider'],_0x41950f[_0x61d9('0x60')]);_0x3ee7f8[_0x61d9('0x3d')]=_0x41834f[_0x61d9('0x3d')];_0x3ee7f8[_0x61d9('0x3e')]=_0x41834f[_0x61d9('0x3e')];return db[_0x61d9('0x44')][_0x61d9('0x67')](_0x3ee7f8,{'include':[{'model':db[_0x61d9('0x40')],'as':_0x61d9('0x3e')},{'model':db[_0x61d9('0x3f')],'as':_0x61d9('0x3d')}]})[_0x61d9('0xd')](function(_0x36b1eb){var _0x23359a=_0x41950f[_0x61d9('0x32')][_0x61d9('0x23')]({'plain':!![]});if(!_0x23359a)throw new Error(_0x61d9('0x76'));if(_0x23359a[_0x61d9('0x77')]===_0x61d9('0x32')){var _0x37c555=_0x36b1eb['get']({'plain':!![]});return db[_0x61d9('0x78')][_0x61d9('0x5e')]({'where':{'name':_0x61d9('0x24'),'userProfileId':_0x23359a['userProfileId']},'raw':!![]})[_0x61d9('0xd')](function(_0x3e4b3a){if(_0x3e4b3a&&_0x3e4b3a[_0x61d9('0x79')]===0x0){return db[_0x61d9('0x25')][_0x61d9('0x67')]({'name':_0x37c555[_0x61d9('0x27')],'resourceId':_0x37c555['id'],'type':_0x3e4b3a['name'],'sectionId':_0x3e4b3a['id']},{})['then'](function(){return _0x36b1eb;});}else{return _0x36b1eb;}})[_0x61d9('0x17')](function(_0x2f8d20){logger[_0x61d9('0x13')](_0x61d9('0x7a'),_0x2f8d20);throw _0x2f8d20;});}return _0x36b1eb;})[_0x61d9('0xd')](respondWithResult(_0x2dadcc,0xc9))[_0x61d9('0x17')](handleError(_0x2dadcc,null));};exports['getImap']=function(_0x567eda,_0x3c641d){return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0x567eda[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x3c641d,null))[_0x61d9('0xd')](function(_0x233c37){if(_0x233c37){return _0x233c37['getImap']();}return null;})[_0x61d9('0xd')](respondWithResult(_0x3c641d,null))[_0x61d9('0x17')](handleError(_0x3c641d,null));};exports[_0x61d9('0x7b')]=function(_0x1175d2,_0x5bb0af){if(_0x1175d2[_0x61d9('0x60')]['id']){delete _0x1175d2[_0x61d9('0x60')]['id'];}return db[_0x61d9('0x44')]['find']({'where':{'id':_0x1175d2[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x5bb0af,null))[_0x61d9('0xd')](function(_0x3329e2){if(_0x3329e2){_0x1175d2['body']['MailAccountId']=_0x3329e2['id'];return db['MailServerIn'][_0x61d9('0x67')](_0x1175d2[_0x61d9('0x60')]);}})[_0x61d9('0xd')](respondWithResult(_0x5bb0af,null))['catch'](handleError(_0x5bb0af,null));};exports['removeImap']=function(_0x319dbe,_0x3f1c08){return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0x319dbe[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x3f1c08,null))[_0x61d9('0xd')](function(_0x48b631){if(_0x48b631){return _0x48b631[_0x61d9('0x7c')](null);}return null;})[_0x61d9('0xd')](respondWithStatusCode(_0x3f1c08,null))[_0x61d9('0x17')](handleError(_0x3f1c08,null));};exports[_0x61d9('0x7d')]=function(_0x3ee034,_0x208166){return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0x3ee034['params']['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x208166,null))[_0x61d9('0xd')](function(_0x3fc156){if(_0x3fc156){return _0x3fc156[_0x61d9('0x7d')]();}return null;})[_0x61d9('0xd')](respondWithResult(_0x208166,null))[_0x61d9('0x17')](handleError(_0x208166,null));};exports['addSmtp']=function(_0x5b09b5,_0x374034){if(_0x5b09b5[_0x61d9('0x60')]['id']){delete _0x5b09b5['body']['id'];}return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x5b09b5[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x374034,null))['then'](function(_0x13f414){if(_0x13f414){_0x5b09b5[_0x61d9('0x60')][_0x61d9('0x65')]=_0x13f414['id'];return db['MailServerOut'][_0x61d9('0x67')](_0x5b09b5[_0x61d9('0x60')]);}})['then'](respondWithResult(_0x374034,null))[_0x61d9('0x17')](handleError(_0x374034,null));};exports[_0x61d9('0x7e')]=function(_0x148917,_0x26ecfb){return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0x148917[_0x61d9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x26ecfb,null))[_0x61d9('0xd')](function(_0x781c42){if(_0x781c42){return _0x781c42[_0x61d9('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x26ecfb,null))[_0x61d9('0x17')](handleError(_0x26ecfb,null));};exports[_0x61d9('0x80')]=function(_0xe6b6e0,_0x1e2a47){return db[_0x61d9('0x81')][_0x61d9('0x5e')]({'where':{'id':_0xe6b6e0[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x1e2a47,null))[_0x61d9('0xd')](function(_0x104984){if(_0x104984){return _0x104984['addInteraction'](_0xe6b6e0[_0x61d9('0x60')][_0x61d9('0x6d')],_[_0x61d9('0x82')](_0xe6b6e0['body'],[_0x61d9('0x6d'),'id'])||{});}})[_0x61d9('0xd')](respondWithResult(_0x1e2a47,null))[_0x61d9('0x17')](handleError(_0x1e2a47,null));};exports[_0x61d9('0x83')]=function(_0xf3a3ed,_0x22559c){var _0x30d5da={'raw':![],'where':{}};var _0x307d7b={};var _0x20b7d8={'count':0x0,'rows':[]};return db[_0x61d9('0x44')][_0x61d9('0x69')]({'where':{'id':_0xf3a3ed[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x22559c,null))[_0x61d9('0xd')](function(_0x58bafa){if(_0x58bafa){_0x307d7b[_0x61d9('0x48')]=_['keys'](db[_0x61d9('0x81')][_0x61d9('0x45')]);_0x307d7b[_0x61d9('0x4a')]=_[_0x61d9('0x49')](_0xf3a3ed['query']);_0x307d7b[_0x61d9('0x4b')]=_[_0x61d9('0x4c')](_0x307d7b['model'],_0x307d7b['query']);_0x30d5da['attributes']=_[_0x61d9('0x4c')](_0x307d7b[_0x61d9('0x48')],qs[_0x61d9('0x4d')](_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x4d')]));_0x30d5da[_0x61d9('0x4e')]=_0x30d5da['attributes'][_0x61d9('0x5c')]?_0x30d5da[_0x61d9('0x4e')]:_0x307d7b[_0x61d9('0x48')];if(!_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x4f')](_0x61d9('0x50'))){_0x30d5da['limit']=qs[_0x61d9('0x1d')](_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x1d')]);_0x30d5da['offset']=qs[_0x61d9('0x1b')](_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x1b')]);}_0x30d5da[_0x61d9('0x6a')]=qs[_0x61d9('0x51')](_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x51')]);_0x30d5da[_0x61d9('0x52')]=qs[_0x61d9('0x4b')](_['pick'](_0xf3a3ed['query'],_0x307d7b[_0x61d9('0x4b')]));_0x30d5da[_0x61d9('0x52')][_0x61d9('0x65')]=_0x58bafa['id'];if(_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x54')]){_0x30d5da[_0x61d9('0x52')]=_['merge'](_0x30d5da[_0x61d9('0x52')],{'$or':_['map'](_0x30d5da[_0x61d9('0x4e')],function(_0x25e625){var _0x42a946={};_0x42a946[_0x25e625]={'$like':'%'+_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x54')]+'%'};return _0x42a946;})});}_0x30d5da=_[_0x61d9('0x5d')]({},_0x30d5da,_0xf3a3ed['options']);return db[_0x61d9('0x81')][_0x61d9('0x1e')]({'where':_0x30d5da['where']})[_0x61d9('0xd')](function(_0x1a1501){_0x20b7d8[_0x61d9('0x1e')]=_0x1a1501;if(_0xf3a3ed[_0x61d9('0x4a')]['includeAll']){_0x30d5da['include']=[{'model':db[_0x61d9('0x84')],'as':_0x61d9('0x85'),'required':![]},{'model':db[_0x61d9('0x86')],'as':_0x61d9('0x87'),'attributes':['name',_0x61d9('0x88'),_0x61d9('0x89')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x61d9('0x27'),'color'],'where':_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x8a')]?{'id':_0xf3a3ed[_0x61d9('0x4a')][_0x61d9('0x8a')]}:undefined,'required':_0xf3a3ed['query'][_0x61d9('0x8a')]?!![]:![]}];}return db[_0x61d9('0x81')]['findAll'](_0x30d5da);})[_0x61d9('0xd')](function(_0x5de8bd){_0x20b7d8[_0x61d9('0x59')]=_0x5de8bd;return _0x20b7d8;});}})['then'](respondWithFilteredResult(_0x22559c,_0x30d5da))[_0x61d9('0x17')](handleError(_0x22559c,null));};exports['addApplications']=function addApplications(_0x42e873,_0x57fc70){var _0x5a603a=_0x42e873[_0x61d9('0x5b')]['id'];var _0x23a823=_0x42e873[_0x61d9('0x60')];var _0x44ead7=0xc8;var _0xbb50ed=null;return db[_0x61d9('0x8b')][_0x61d9('0x8c')]({'isolationLevel':db[_0x61d9('0x8b')][_0x61d9('0x8d')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4fa402){return db['MailAccount']['findOne']({'where':{'id':_0x5a603a},'transaction':_0x4fa402})['then'](function(_0x46a2e9){if(_0x46a2e9){return db[_0x61d9('0x8e')][_0x61d9('0x22')]({'where':{'MailAccountId':_0x5a603a},'transaction':_0x4fa402})[_0x61d9('0xd')](function(){var _0x2ce1b1=_[_0x61d9('0x43')](_0x23a823,function(_0x38e099){_0x38e099[_0x61d9('0x65')]=_0x5a603a;return _0x38e099;});return db[_0x61d9('0x8e')][_0x61d9('0x8f')](_0x2ce1b1,{'transaction':_0x4fa402});});}else{_0x44ead7=0x194;_0xbb50ed=[];}});})[_0x61d9('0xd')](function(){if(_0x44ead7!==0x194){return db[_0x61d9('0x8e')][_0x61d9('0x90')]({'where':{'MailAccountId':_0x5a603a},'order':'priority'})[_0x61d9('0xd')](function(_0x36e242){_0xbb50ed=_0x36e242;});}})[_0x61d9('0x17')](function(_0x326303){_0x44ead7=0x1f4;logger[_0x61d9('0x13')](_0x326303[_0x61d9('0x26')]);if(_0x326303[_0x61d9('0x27')]){delete _0x326303[_0x61d9('0x27')];}_0xbb50ed=_0x326303;})[_0x61d9('0x91')](function(){if(_0xbb50ed===null){_0x57fc70['sendStatus'](_0x44ead7);}else{if(_0x44ead7===0x1f4){_0x57fc70[_0x61d9('0x19')](_0x44ead7)['send'](_0xbb50ed);}else{_0x57fc70[_0x61d9('0x19')](_0x44ead7)[_0x61d9('0x21')](_0xbb50ed);}}});};exports[_0x61d9('0x92')]=function(_0x241473,_0x39cee2){var _0x9f9d94={};var _0x5c891c={};var _0x364d8a;var _0x57ebd0;return db['MailAccount'][_0x61d9('0x69')]({'where':{'id':_0x241473['params']['id']}})['then'](handleEntityNotFound(_0x39cee2,null))[_0x61d9('0xd')](function(_0x2937e0){if(_0x2937e0){_0x364d8a=_0x2937e0;_0x5c891c[_0x61d9('0x48')]=_[_0x61d9('0x49')](db[_0x61d9('0x8e')][_0x61d9('0x45')]);_0x5c891c['query']=_[_0x61d9('0x49')](_0x241473[_0x61d9('0x4a')]);_0x5c891c[_0x61d9('0x4b')]=_[_0x61d9('0x4c')](_0x5c891c['model'],_0x5c891c[_0x61d9('0x4a')]);_0x9f9d94[_0x61d9('0x4e')]=_[_0x61d9('0x4c')](_0x5c891c[_0x61d9('0x48')],qs[_0x61d9('0x4d')](_0x241473[_0x61d9('0x4a')][_0x61d9('0x4d')]));_0x9f9d94[_0x61d9('0x4e')]=_0x9f9d94[_0x61d9('0x4e')]['length']?_0x9f9d94[_0x61d9('0x4e')]:_0x5c891c[_0x61d9('0x48')];_0x9f9d94[_0x61d9('0x6a')]=qs[_0x61d9('0x51')](_0x241473[_0x61d9('0x4a')][_0x61d9('0x51')]);_0x9f9d94['where']=qs[_0x61d9('0x4b')](_[_0x61d9('0x6b')](_0x241473['query'],_0x5c891c[_0x61d9('0x4b')]));if(_0x241473[_0x61d9('0x4a')]['filter']){_0x9f9d94[_0x61d9('0x52')]=_[_0x61d9('0x5d')](_0x9f9d94[_0x61d9('0x52')],{'$or':_[_0x61d9('0x43')](_0x9f9d94[_0x61d9('0x4e')],function(_0xc5cfe3){var _0x42a284={};_0x42a284[_0xc5cfe3]={'$like':'%'+_0x241473[_0x61d9('0x4a')][_0x61d9('0x54')]+'%'};return _0x42a284;})});}_0x9f9d94=_[_0x61d9('0x5d')]({},_0x9f9d94,_0x241473['options']);return _0x364d8a[_0x61d9('0x92')](_0x9f9d94);}})[_0x61d9('0xd')](function(_0x24651d){if(_0x24651d){_0x57ebd0=_0x24651d[_0x61d9('0x5c')];if(!_0x241473[_0x61d9('0x4a')][_0x61d9('0x4f')]('nolimit')){_0x9f9d94[_0x61d9('0x1d')]=qs['limit'](_0x241473[_0x61d9('0x4a')][_0x61d9('0x1d')]);_0x9f9d94[_0x61d9('0x1b')]=qs['offset'](_0x241473[_0x61d9('0x4a')]['offset']);}return _0x364d8a[_0x61d9('0x92')](_0x9f9d94);}})['then'](function(_0x3cfebc){if(_0x3cfebc){return _0x3cfebc?{'count':_0x57ebd0,'rows':_0x3cfebc}:null;}})[_0x61d9('0xd')](respondWithResult(_0x39cee2,null))[_0x61d9('0x17')](handleError(_0x39cee2,null));};exports['getMessages']=function(_0x5b8764,_0x44ba47){var _0x11138b={'raw':!![],'where':{}};var _0x22e0ee={};var _0x1920ea={'count':0x0,'rows':[]};return db['MailAccount'][_0x61d9('0x69')]({'where':{'id':_0x5b8764[_0x61d9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x44ba47,null))[_0x61d9('0xd')](function(_0x14ebe6){if(_0x14ebe6){_0x22e0ee['model']=_['keys'](db[_0x61d9('0x93')]['rawAttributes']);_0x22e0ee[_0x61d9('0x4a')]=_['keys'](_0x5b8764[_0x61d9('0x4a')]);_0x22e0ee[_0x61d9('0x4b')]=_[_0x61d9('0x4c')](_0x22e0ee[_0x61d9('0x48')],_0x22e0ee['query']);_0x11138b[_0x61d9('0x4e')]=_[_0x61d9('0x4c')](_0x22e0ee[_0x61d9('0x48')],qs['fields'](_0x5b8764[_0x61d9('0x4a')]['fields']));_0x11138b[_0x61d9('0x4e')]=_0x11138b[_0x61d9('0x4e')][_0x61d9('0x5c')]?_0x11138b['attributes']:_0x22e0ee[_0x61d9('0x48')];if(!_0x5b8764['query'][_0x61d9('0x4f')](_0x61d9('0x50'))){_0x11138b[_0x61d9('0x1d')]=qs['limit'](_0x5b8764[_0x61d9('0x4a')]['limit']);_0x11138b[_0x61d9('0x1b')]=qs[_0x61d9('0x1b')](_0x5b8764[_0x61d9('0x4a')][_0x61d9('0x1b')]);}_0x11138b[_0x61d9('0x6a')]=qs[_0x61d9('0x51')](_0x5b8764[_0x61d9('0x4a')][_0x61d9('0x51')]);_0x11138b[_0x61d9('0x52')]=qs['filters'](_['pick'](_0x5b8764[_0x61d9('0x4a')],_0x22e0ee['filters']));_0x11138b[_0x61d9('0x52')]['MailAccountId']=_0x14ebe6['id'];if(_0x5b8764[_0x61d9('0x4a')][_0x61d9('0x54')]){_0x11138b['where']=_[_0x61d9('0x5d')](_0x11138b['where'],{'$or':_[_0x61d9('0x43')](_0x11138b[_0x61d9('0x4e')],function(_0x275b03){var _0x5b4011={};_0x5b4011[_0x275b03]={'$like':'%'+_0x5b8764['query'][_0x61d9('0x54')]+'%'};return _0x5b4011;})});}if(_0x5b8764['query'][_0x61d9('0x94')]){var _0x3576ee=_0x5b8764[_0x61d9('0x4a')]['$gte'][_0x61d9('0x95')](',');var _0x4e0e8f={};_0x4e0e8f[_0x3576ee[0x0]]={'$gte':moment(_0x3576ee[0x1])['format'](_0x61d9('0x96'))};_0x11138b[_0x61d9('0x52')]=_['merge'](_0x11138b[_0x61d9('0x52')],_0x4e0e8f);}_0x11138b=_[_0x61d9('0x5d')]({},_0x11138b,_0x5b8764[_0x61d9('0x55')]);return db[_0x61d9('0x93')][_0x61d9('0x1e')]({'where':_0x11138b['where']})[_0x61d9('0xd')](function(_0x306653){_0x1920ea[_0x61d9('0x1e')]=_0x306653;if(_0x5b8764[_0x61d9('0x4a')]['includeAll']){_0x11138b[_0x61d9('0x57')]=[{'all':!![]}];}return db[_0x61d9('0x93')][_0x61d9('0x58')](_0x11138b);})[_0x61d9('0xd')](function(_0x4dbec2){if(_0x5b8764[_0x61d9('0x4a')]['inlineCss']===_0x61d9('0x97')){for(var _0x2c32cc=0x0;_0x2c32cc<_0x4dbec2[_0x61d9('0x5c')];_0x2c32cc++){_0x4dbec2[_0x2c32cc][_0x61d9('0x60')]=juice(_0x4dbec2[_0x2c32cc][_0x61d9('0x60')]);}}_0x1920ea[_0x61d9('0x59')]=_0x4dbec2;return _0x1920ea;});}})[_0x61d9('0xd')](respondWithFilteredResult(_0x44ba47,_0x11138b))['catch'](handleError(_0x44ba47,null));};exports['send']=function(_0xfe47,_0x233169){var _0x37ce12,_0x49fb79={},_0x55ca95;if(_0xfe47['body']['to']){_0x55ca95=_0xfe47['body']['to'][_0x61d9('0x95')](',')[0x0];}return db[_0x61d9('0x44')]['find']({'where':{'id':_0xfe47['params']['id']},'include':[{'model':db['CmList'],'as':_0x61d9('0x98'),'include':[{'model':db[_0x61d9('0x84')],'as':_0x61d9('0x99'),'where':{'email':_0x55ca95},'limit':0x1,'order':[[_0x61d9('0x9a'),_0x61d9('0x9b')]]}]},{'model':db[_0x61d9('0x40')],'as':_0x61d9('0x3e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x61d9('0xd')](handleEntityNotFound(_0x233169,null))['then'](function(_0xda189f){if(!_0xda189f)return;_0x37ce12=_0xda189f;if(!_0xda189f[_0x61d9('0x3e')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x61d9('0x9c')](_0xfe47['body'][_0x61d9('0x9d')])){_0xfe47[_0x61d9('0x60')][_0x61d9('0x9d')]=util[_0x61d9('0x9e')](_0x61d9('0x9f'),_0xda189f['name'],_0xda189f['email']||_0xda189f['Smtp'][_0x61d9('0x32')]);}if(_0xfe47[_0x61d9('0x60')]['attachments']&&_0xfe47[_0x61d9('0x60')]['attachments'][_0x61d9('0x5c')]){for(var _0x2d0bf5=0x0;_0x2d0bf5<_0xfe47['body'][_0x61d9('0xa0')][_0x61d9('0x5c')];_0x2d0bf5+=0x1){_0xfe47[_0x61d9('0x60')]['attachments'][_0x2d0bf5]={'filename':_0xfe47[_0x61d9('0x60')][_0x61d9('0xa0')][_0x2d0bf5][_0x61d9('0x27')],'path':path[_0x61d9('0xa1')](config[_0x61d9('0xa2')],_0x61d9('0xa3'),_0xfe47[_0x61d9('0x60')][_0x61d9('0xa0')][_0x2d0bf5]['basename'])};}}var _0x3dad3f=_0xda189f[_0x61d9('0xa4')]();return respondWithRpcPromise(_0x61d9('0xa5'),'sendMail',{'account':_0x3dad3f,'message':_0xfe47[_0x61d9('0x60')]});})[_0x61d9('0xd')](function(_0x574acb){if(!_0x574acb)return;_0x49fb79=_0x574acb;if(!_0x37ce12[_0x61d9('0x98')])throw new Error(_0x61d9('0xa6'));if(_0x37ce12['List'][_0x61d9('0x99')][_0x61d9('0x5c')])return _0x37ce12[_0x61d9('0x98')][_0x61d9('0x99')][0x0];return db[_0x61d9('0x84')][_0x61d9('0x67')](_[_0x61d9('0xa7')](_0xfe47['body'],{'firstName':_0xfe47[_0x61d9('0x60')]['to'],'email':_0xfe47['body']['to'],'phone':_0xfe47[_0x61d9('0x60')]['to'],'ListId':_0x37ce12[_0x61d9('0x73')]}));})[_0x61d9('0xd')](function(_0x4a7263){if(!_0x4a7263)return;var _0x12ac34={'UserId':_0xfe47[_0x61d9('0x32')]['id'],'ContactId':_0x4a7263['id'],'MailAccountId':_0x37ce12['id'],'inReplyTo':_0x49fb79[_0x61d9('0xa8')],'to':_0xfe47['body'][_0x61d9('0x9d')],'cc':_0xfe47[_0x61d9('0x60')]['cc'],'subject':_0xfe47[_0x61d9('0x60')][_0x61d9('0xa9')],'attach':_0xfe47[_0x61d9('0x60')][_0x61d9('0xaa')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x61d9('0x9e')](_0x61d9('0x96')),'lastMsgDirection':'out','Messages':[_[_0x61d9('0x5d')](_0xfe47['body'],{'messageId':_0x49fb79[_0x61d9('0xa8')],'sentAt':moment()[_0x61d9('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x37ce12['id'],'UserId':_0xfe47['user']['id'],'ContactId':_0x4a7263['id']})]};if(_0xfe47[_0x61d9('0x60')][_0x61d9('0xab')]){_0x12ac34=_[_0x61d9('0x5d')](_0x12ac34,_0xfe47[_0x61d9('0x60')]['Interaction']);}return db[_0x61d9('0x81')]['create'](_0x12ac34,{'include':[{'model':db[_0x61d9('0x93')],'as':_0x61d9('0xac')}]});})['then'](respondWithResult(_0x233169,null))['catch'](handleError(_0x233169,null));};exports[_0x61d9('0xad')]=function(_0x7d4f16,_0xcba18a){return db['MailAccount']['find']({'where':{'id':_0x7d4f16['params']['id']},'include':[{'model':db[_0x61d9('0x40')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x61d9('0xae')],'as':'CloudProvider','raw':!![]}]}]})[_0x61d9('0xd')](handleEntityNotFound(_0xcba18a,null))[_0x61d9('0xd')](function(_0x23139b){if(!_0x23139b[_0x61d9('0x3e')])return;var _0x52d17f=_0x23139b['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x61d9('0xad'),{'account':_0x52d17f});})['then'](respondWithResult(_0xcba18a,null))[_0x61d9('0x17')](handleError(_0xcba18a,null));};exports['destroy']=function(_0x3ac9cc,_0x3b6950){return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x3ac9cc['params']['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x3b6950,null))[_0x61d9('0xd')](function(_0x1a9b59){if(_0x1a9b59&&_0x1a9b59[_0x61d9('0x3a')]){throw new db[(_0x61d9('0xaf'))][(_0x61d9('0xb0'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1a9b59;})['then'](removeEntity(_0x3b6950,null))[_0x61d9('0x17')](handleError(_0x3b6950,null));};exports[_0x61d9('0xb1')]=function(_0x1e8e5c,_0x2def42){return db[_0x61d9('0x44')]['find']({'where':{'id':_0x1e8e5c[_0x61d9('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2def42,null))['then'](function(_0x23b950){if(_0x23b950){return _0x23b950['addAgents'](_0x1e8e5c[_0x61d9('0x60')][_0x61d9('0x6d')],_['omit'](_0x1e8e5c[_0x61d9('0x60')],[_0x61d9('0x6d'),'id'])||{})[_0x61d9('0xb2')](function(_0x5a2810){for(var _0x212237=0x0;_0x212237<_0x1e8e5c['body'][_0x61d9('0x6d')][_0x61d9('0x5c')];_0x212237+=0x1){socket[_0x61d9('0xb3')](_0x61d9('0xb4'),{'UserId':Number(_0x1e8e5c['body'][_0x61d9('0x6d')][_0x212237]),'MailAccountId':Number(_0x1e8e5c[_0x61d9('0x5b')]['id'])});}return _0x5a2810;});}})[_0x61d9('0xd')](respondWithResult(_0x2def42,null))['catch'](handleError(_0x2def42,null));};exports[_0x61d9('0xb5')]=function(_0x9c9354,_0x5961f3){return db[_0x61d9('0x44')][_0x61d9('0x5e')]({'where':{'id':_0x9c9354[_0x61d9('0x5b')]['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x5961f3,null))[_0x61d9('0xd')](function(_0x3197f5){if(_0x3197f5){return _0x3197f5[_0x61d9('0xb5')](_0x9c9354[_0x61d9('0x4a')][_0x61d9('0x6d')])[_0x61d9('0xd')](function(){if(_['isArray'](_0x9c9354[_0x61d9('0x4a')][_0x61d9('0x6d')])){for(var _0x3a7b08=0x0;_0x3a7b08<_0x9c9354[_0x61d9('0x4a')][_0x61d9('0x6d')][_0x61d9('0x5c')];_0x3a7b08+=0x1){socket['emit'](_0x61d9('0xb6'),{'UserId':Number(_0x9c9354[_0x61d9('0x4a')][_0x61d9('0x6d')][_0x3a7b08]),'MailAccountId':Number(_0x9c9354[_0x61d9('0x5b')]['id'])});}}else{socket[_0x61d9('0xb3')](_0x61d9('0xb6'),{'UserId':Number(_0x9c9354[_0x61d9('0x4a')][_0x61d9('0x6d')]),'MailAccountId':Number(_0x9c9354[_0x61d9('0x5b')]['id'])});}});}})[_0x61d9('0xd')](respondWithStatusCode(_0x5961f3,null))[_0x61d9('0x17')](handleError(_0x5961f3,null));};exports[_0x61d9('0xb7')]=function(_0x351ef8,_0x1f7664){var _0x37bf0f={};var _0x3ec27f={};var _0x1bc5c1;var _0x35d9d8;return db[_0x61d9('0x44')]['findOne']({'where':{'id':_0x351ef8['params']['id']}})[_0x61d9('0xd')](handleEntityNotFound(_0x1f7664,null))['then'](function(_0x46006d){if(_0x46006d){_0x1bc5c1=_0x46006d;_0x3ec27f[_0x61d9('0x48')]=_[_0x61d9('0x49')](db[_0x61d9('0x86')][_0x61d9('0x45')]);_0x3ec27f[_0x61d9('0x4a')]=_[_0x61d9('0x49')](_0x351ef8[_0x61d9('0x4a')]);_0x3ec27f[_0x61d9('0x4b')]=_[_0x61d9('0x4c')](_0x3ec27f[_0x61d9('0x48')],_0x3ec27f[_0x61d9('0x4a')]);_0x37bf0f[_0x61d9('0x4e')]=_['intersection'](_0x3ec27f[_0x61d9('0x48')],qs['fields'](_0x351ef8[_0x61d9('0x4a')][_0x61d9('0x4d')]));_0x37bf0f[_0x61d9('0x4e')]=_0x37bf0f['attributes'][_0x61d9('0x5c')]?_0x37bf0f['attributes']:_0x3ec27f[_0x61d9('0x48')];_0x37bf0f[_0x61d9('0x6a')]=qs[_0x61d9('0x51')](_0x351ef8[_0x61d9('0x4a')]['sort']);_0x37bf0f['where']=qs[_0x61d9('0x4b')](_['pick'](_0x351ef8[_0x61d9('0x4a')],_0x3ec27f[_0x61d9('0x4b')]));if(_0x351ef8[_0x61d9('0x4a')][_0x61d9('0x54')]){_0x37bf0f[_0x61d9('0x52')]=_['merge'](_0x37bf0f['where'],{'$or':_[_0x61d9('0x43')](_0x37bf0f[_0x61d9('0x4e')],function(_0x2b912f){var _0x31583c={};_0x31583c[_0x2b912f]={'$like':'%'+_0x351ef8[_0x61d9('0x4a')]['filter']+'%'};return _0x31583c;})});}_0x37bf0f=_[_0x61d9('0x5d')]({},_0x37bf0f,_0x351ef8[_0x61d9('0x55')]);return _0x1bc5c1[_0x61d9('0xb7')](_0x37bf0f);}})[_0x61d9('0xd')](function(_0x4e19a9){if(_0x4e19a9){_0x35d9d8=_0x4e19a9[_0x61d9('0x5c')];if(!_0x351ef8[_0x61d9('0x4a')]['hasOwnProperty']('nolimit')){_0x37bf0f['limit']=qs['limit'](_0x351ef8['query'][_0x61d9('0x1d')]);_0x37bf0f[_0x61d9('0x1b')]=qs[_0x61d9('0x1b')](_0x351ef8['query'][_0x61d9('0x1b')]);}return _0x1bc5c1[_0x61d9('0xb7')](_0x37bf0f);}})[_0x61d9('0xd')](function(_0xc7e5dd){if(_0xc7e5dd){return _0xc7e5dd?{'count':_0x35d9d8,'rows':_0xc7e5dd}:null;}})['then'](respondWithResult(_0x1f7664,null))[_0x61d9('0x17')](handleError(_0x1f7664,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 80c41cc..f430862 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 _0x0a93=['hasOwnProperty','hook','events','../../mysqldb','MailAccount','save','update','remove'];(function(_0x4f8942,_0x586651){var _0x6310b9=function(_0x2d429d){while(--_0x2d429d){_0x4f8942['push'](_0x4f8942['shift']());}};_0x6310b9(++_0x586651);}(_0x0a93,0x6a));var _0x30a9=function(_0x4960dc,_0xcc7f8e){_0x4960dc=_0x4960dc-0x0;var _0xcd4caa=_0x0a93[_0x4960dc];return _0xcd4caa;};'use strict';var EventEmitter=require(_0x30a9('0x0'));var MailAccount=require(_0x30a9('0x1'))['db'][_0x30a9('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x30a9('0x3'),'afterUpdate':_0x30a9('0x4'),'afterDestroy':_0x30a9('0x5')};function emitEvent(_0x2bdf19){return function(_0x556c5e,_0x53e03b,_0x54321d){MailAccountEvents['emit'](_0x2bdf19+':'+_0x556c5e['id'],_0x556c5e);MailAccountEvents['emit'](_0x2bdf19,_0x556c5e);_0x54321d(null);};}for(var e in events){if(events[_0x30a9('0x6')](e)){var event=events[e];MailAccount[_0x30a9('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x6299=['update','remove','emit','hasOwnProperty','MailAccount','setMaxListeners','save'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x6299,0x169));var _0x9629=function(_0x321b2c,_0x19f2fa){_0x321b2c=_0x321b2c-0x0;var _0x11945d=_0x6299[_0x321b2c];return _0x11945d;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x9629('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9629('0x1')](0x0);var events={'afterCreate':_0x9629('0x2'),'afterUpdate':_0x9629('0x3'),'afterDestroy':_0x9629('0x4')};function emitEvent(_0x3eb5e5){return function(_0x55d4ce,_0x327ee9,_0x42064f){MailAccountEvents[_0x9629('0x5')](_0x3eb5e5+':'+_0x55d4ce['id'],_0x55d4ce);MailAccountEvents[_0x9629('0x5')](_0x3eb5e5,_0x55d4ce);_0x42064f(null);};}for(var e in events){if(events[_0x9629('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 0bbbbbf..0bcf50f 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 _0xeec7=['OAuth2','user','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','custom','provider','host','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth'];(function(_0x15b14d,_0x555dbd){var _0x26d589=function(_0x1a8b0c){while(--_0x1a8b0c){_0x15b14d['push'](_0x15b14d['shift']());}};_0x26d589(++_0x555dbd);}(_0xeec7,0x1d8));var _0x7eec=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0xeec7[_0x1c7b4c];return _0x18daf6;};'use strict';var attributes=require(_0x7eec('0x0'));module['exports']=function(_0x396fb1){return _0x396fb1[_0x7eec('0x1')](_0x7eec('0x2'),attributes,{'tableName':_0x7eec('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1e0a24=this;var _0x3a21b4={'id':_0x1e0a24['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1e0a24['provider']!==_0x7eec('0x4')){_0x3a21b4['service']=_0x1e0a24[_0x7eec('0x5')];}else{_0x3a21b4[_0x7eec('0x6')]=_0x1e0a24[_0x7eec('0x7')][_0x7eec('0x6')];_0x3a21b4['port']=_0x1e0a24[_0x7eec('0x7')]['port'];_0x3a21b4[_0x7eec('0x8')]=_0x1e0a24['Smtp'][_0x7eec('0x8')];}if(_0x1e0a24[_0x7eec('0x7')][_0x7eec('0x9')]){if(_0x1e0a24[_0x7eec('0x7')][_0x7eec('0xa')]){if(!_0x1e0a24[_0x7eec('0x7')][_0x7eec('0xb')])throw new Error(_0x7eec('0xc'));_0x3a21b4[_0x7eec('0xd')]={'type':_0x7eec('0xe'),'user':_0x1e0a24['Smtp'][_0x7eec('0xf')],'accessToken':_0x1e0a24[_0x7eec('0x7')][_0x7eec('0xb')][_0x7eec('0x10')]};}else{_0x3a21b4[_0x7eec('0xd')]={'user':_0x1e0a24[_0x7eec('0x7')][_0x7eec('0xf')],'pass':_0x1e0a24[_0x7eec('0x7')][_0x7eec('0x11')]};}}return _0x3a21b4;}}});}; \ No newline at end of file +var _0xd50e=['auth','data5','user','exports','MailAccount','provider','custom','service','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found'];(function(_0x21655b,_0x188e9f){var _0xd740ec=function(_0x1fca9b){while(--_0x1fca9b){_0x21655b['push'](_0x21655b['shift']());}};_0xd740ec(++_0x188e9f);}(_0xd50e,0x99));var _0xed50=function(_0x1702d7,_0x2d0e0f){_0x1702d7=_0x1702d7-0x0;var _0x4e1bef=_0xd50e[_0x1702d7];return _0x4e1bef;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xed50('0x0')]=function(_0x5dfde1){return _0x5dfde1['define'](_0xed50('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3d1814=this;var _0x63c1c0={'id':_0x3d1814['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d1814[_0xed50('0x2')]!==_0xed50('0x3')){_0x63c1c0[_0xed50('0x4')]=_0x3d1814[_0xed50('0x2')];}else{_0x63c1c0[_0xed50('0x5')]=_0x3d1814[_0xed50('0x6')][_0xed50('0x5')];_0x63c1c0[_0xed50('0x7')]=_0x3d1814[_0xed50('0x6')]['port'];_0x63c1c0[_0xed50('0x8')]=_0x3d1814[_0xed50('0x6')][_0xed50('0x8')];}if(_0x3d1814[_0xed50('0x6')][_0xed50('0x9')]){if(_0x3d1814[_0xed50('0x6')]['modernAuthentication']){if(!_0x3d1814[_0xed50('0x6')][_0xed50('0xa')])throw new Error(_0xed50('0xb'));_0x63c1c0[_0xed50('0xc')]={'type':'OAuth2','user':_0x3d1814['Smtp']['user'],'accessToken':_0x3d1814['Smtp'][_0xed50('0xa')][_0xed50('0xd')]};}else{_0x63c1c0['auth']={'user':_0x3d1814[_0xed50('0x6')][_0xed50('0xe')],'pass':_0x3d1814[_0xed50('0x6')]['pass']};}}return _0x63c1c0;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 9b8c04b..0865eb6 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 _0xfc65=['startRouting','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','list','priority','asc','push','length','close','autoclose','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','format','interaction','created','attachments','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start'];(function(_0x14672f,_0x29bdc8){var _0x233e55=function(_0x78abf5){while(--_0x78abf5){_0x14672f['push'](_0x14672f['shift']());}};_0x233e55(++_0x29bdc8);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x553c83,_0x3e0356){_0x553c83=_0x553c83-0x0;var _0x4aa47b=_0xfc65[_0x553c83];return _0x4aa47b;};'use strict';var _=require(_0x5fc6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5fc6('0x1'));var Redis=require(_0x5fc6('0x2'));var db=require(_0x5fc6('0x3'))['db'];var logger=require(_0x5fc6('0x4'))(_0x5fc6('0x5'));var config=require(_0x5fc6('0x6'));var jayson=require(_0x5fc6('0x7'));var client=jayson[_0x5fc6('0x8')][_0x5fc6('0x9')]({'port':0x232c});config[_0x5fc6('0xa')]=_[_0x5fc6('0xb')](config[_0x5fc6('0xa')],{'host':_0x5fc6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fc6('0xa')]));require(_0x5fc6('0xd'))[_0x5fc6('0xe')](socket);function respondWithRpcPromise(_0x3d9a11,_0x16c285,_0xbc3db9){return new BPromise(function(_0x23c4e2,_0x27cad8){return client[_0x5fc6('0xf')](_0x3d9a11,_0xbc3db9)[_0x5fc6('0x10')](function(_0x4cc207){logger[_0x5fc6('0x11')]('MailAccount,\x20%s,\x20%s',_0x16c285,_0x5fc6('0x12'));logger[_0x5fc6('0x13')](_0x5fc6('0x14'),_0x16c285,_0x5fc6('0x12'),JSON['stringify'](_0x4cc207));if(_0x4cc207[_0x5fc6('0x15')]){if(_0x4cc207[_0x5fc6('0x15')][_0x5fc6('0x16')]===0x1f4){logger[_0x5fc6('0x15')](_0x5fc6('0x17'),_0x16c285,_0x4cc207[_0x5fc6('0x15')][_0x5fc6('0x18')]);return _0x27cad8(_0x4cc207[_0x5fc6('0x15')][_0x5fc6('0x18')]);}logger[_0x5fc6('0x15')]('MailAccount,\x20%s,\x20%s',_0x16c285,_0x4cc207['error'][_0x5fc6('0x18')]);return _0x23c4e2(_0x4cc207[_0x5fc6('0x15')]['message']);}else{logger[_0x5fc6('0x11')](_0x5fc6('0x17'),_0x16c285,_0x5fc6('0x12'));_0x23c4e2(_0x4cc207[_0x5fc6('0x19')][_0x5fc6('0x18')]);}})[_0x5fc6('0x1a')](function(_0x569bbc){logger[_0x5fc6('0x15')](_0x5fc6('0x17'),_0x16c285,_0x569bbc);_0x27cad8(_0x569bbc);});});}exports[_0x5fc6('0x1b')]=function(_0xad2ccb){var _0x5c76e7=this;return new Promise(function(_0xafe3a8,_0x1d2bd1){return db[_0x5fc6('0x1c')][_0x5fc6('0x1d')]({'raw':_0xad2ccb[_0x5fc6('0x1e')]?_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x1f')]===undefined?!![]:![]:!![],'where':_0xad2ccb[_0x5fc6('0x1e')]?_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x20')]||null:null,'attributes':_0xad2ccb['options']?_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x21')]||null:null,'limit':_0xad2ccb[_0x5fc6('0x1e')]?_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x22')]||null:null,'include':_0xad2ccb[_0x5fc6('0x1e')]?_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x23')]?_['map'](_0xad2ccb[_0x5fc6('0x1e')][_0x5fc6('0x23')],function(_0x1db1f0){return{'model':db[_0x1db1f0[_0x5fc6('0x24')]],'as':_0x1db1f0['as'],'attributes':_0x1db1f0[_0x5fc6('0x21')],'include':_0x1db1f0[_0x5fc6('0x23')]?_['map'](_0x1db1f0[_0x5fc6('0x23')],function(_0xd31fa1){return{'model':db[_0xd31fa1['model']],'as':_0xd31fa1['as'],'attributes':_0xd31fa1[_0x5fc6('0x21')],'include':_0xd31fa1[_0x5fc6('0x23')]?_[_0x5fc6('0x25')](_0xd31fa1[_0x5fc6('0x23')],function(_0x2abeeb){return{'model':db[_0x2abeeb['model']],'as':_0x2abeeb['as'],'attributes':_0x2abeeb[_0x5fc6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5fc6('0x10')](function(_0x21066b){logger[_0x5fc6('0x11')](_0x5fc6('0x1b'),_0xad2ccb);logger[_0x5fc6('0x13')](_0x5fc6('0x1b'),_0xad2ccb,JSON[_0x5fc6('0x26')](_0x21066b));_0xafe3a8(_0x21066b);})[_0x5fc6('0x1a')](function(_0x57502b){logger[_0x5fc6('0x15')]('GetMailAccount',_0x57502b[_0x5fc6('0x18')],_0xad2ccb);_0x1d2bd1(_0x5c76e7[_0x5fc6('0x15')](0x1f4,_0x57502b[_0x5fc6('0x18')]));});});};exports[_0x5fc6('0x27')]=function(_0x331c2b){var _0x479e96=this;return new Promise(function(_0x1dbb8c,_0x330f9b){return db[_0x5fc6('0x1c')][_0x5fc6('0x28')]({'raw':_0x331c2b[_0x5fc6('0x1e')]?_0x331c2b[_0x5fc6('0x1e')][_0x5fc6('0x1f')]===undefined?!![]:![]:!![],'where':_0x331c2b[_0x5fc6('0x1e')]?_0x331c2b['options'][_0x5fc6('0x20')]||null:null,'attributes':_0x331c2b[_0x5fc6('0x1e')]?_0x331c2b['options']['attributes']||null:null,'include':_0x331c2b[_0x5fc6('0x1e')]?_0x331c2b[_0x5fc6('0x1e')]['include']?_[_0x5fc6('0x25')](_0x331c2b[_0x5fc6('0x1e')][_0x5fc6('0x23')],function(_0x1a3f21){return{'model':db[_0x1a3f21['model']],'as':_0x1a3f21['as'],'attributes':_0x1a3f21['attributes'],'include':_0x1a3f21[_0x5fc6('0x23')]?_[_0x5fc6('0x25')](_0x1a3f21['include'],function(_0x58552a){return{'model':db[_0x58552a[_0x5fc6('0x24')]],'as':_0x58552a['as'],'attributes':_0x58552a[_0x5fc6('0x21')],'include':_0x58552a['include']?_[_0x5fc6('0x25')](_0x58552a['include'],function(_0x2f95ba){return{'model':db[_0x2f95ba[_0x5fc6('0x24')]],'as':_0x2f95ba['as'],'attributes':_0x2f95ba[_0x5fc6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5fc6('0x10')](function(_0x51fe4f){if(_0x331c2b[_0x5fc6('0x1e')][_0x5fc6('0x29')]===!![])_0x51fe4f[_0x5fc6('0x2a')](_0x5fc6('0x2b'),_0x51fe4f[_0x5fc6('0x2c')]());logger[_0x5fc6('0x11')]('ShowMailAccount',_0x331c2b);logger[_0x5fc6('0x13')]('ShowMailAccount',_0x331c2b,JSON[_0x5fc6('0x26')](_0x51fe4f));_0x1dbb8c(_0x51fe4f);})[_0x5fc6('0x1a')](function(_0x5df9d3){logger[_0x5fc6('0x15')](_0x5fc6('0x27'),_0x5df9d3['message'],_0x331c2b);_0x330f9b(_0x479e96['error'](0x1f4,_0x5df9d3[_0x5fc6('0x18')]));});});};exports[_0x5fc6('0x2d')]=function(_0xb5492a){var _0x3883a9=this;return new Promise(function(_0x370bc4,_0x1b6d1a){var _0x43b764={'body':_0xb5492a[_0x5fc6('0x2e')],'channel':_0x5fc6('0x2f')};var _0x1b72a3=_[_0x5fc6('0x30')](_['keys'](db[_0x5fc6('0x31')][_0x5fc6('0x32')]),[_0x5fc6('0x33'),_0x5fc6('0x34'),_0x5fc6('0x35'),'ListId']);var _0x56dd97=![];if(_0xb5492a['body']['id']){delete _0xb5492a[_0x5fc6('0x2e')]['id'];}if(_[_0x5fc6('0x36')](_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x37')])){return _0x1b6d1a(_0x3883a9['error'](0x1f4,_0x5fc6('0x38')));}if(_[_0x5fc6('0x36')](_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x2e')])||_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x2e')]===''){return _0x1b6d1a(_0x3883a9['error'](0x1f4,_0x5fc6('0x39')));}if(_['isNil'](_0xb5492a['body']['mapKey'])){return _0x1b6d1a(_0x3883a9[_0x5fc6('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b72a3));}if(!_[_0x5fc6('0x3a')](_0x1b72a3,_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x3b')])){return _0x1b6d1a(_0x3883a9['error'](0x1f4,_0x5fc6('0x3c')+_0x1b72a3));}var _0x58ecb1={};_0x58ecb1[_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x3b')]]=_0xb5492a['body'][_0x5fc6('0x37')];return db['MailAccount'][_0x5fc6('0x28')]({'where':{'id':_0xb5492a[_0x5fc6('0x3d')]['id']},'include':[{'model':db[_0x5fc6('0x3e')],'as':_0x5fc6('0x3f'),'include':[{'model':db['CmContact'],'as':_0x5fc6('0x40'),'where':_0x58ecb1,'limit':0x1,'order':[[_0x5fc6('0x34'),_0x5fc6('0x41')]]}]},{'model':db[_0x5fc6('0x42')],'as':'Applications'},{'model':db[_0x5fc6('0x43')],'as':_0x5fc6('0x44'),'include':[{'model':db[_0x5fc6('0x45')],'as':_0x5fc6('0x45')}]}]})[_0x5fc6('0x10')](function(_0x298151){if(_0x298151&&_0x298151[_0x5fc6('0x3f')]){var _0x49eb58=_0x298151[_0x5fc6('0x46')]({'plain':!![]});_0x43b764[_0x5fc6('0x3d')]=_[_0x5fc6('0x47')](_0x49eb58,['Applications',_0x5fc6('0x3f')]);_0x43b764[_0x5fc6('0x3d')][_0x5fc6('0x2b')]=_0x298151[_0x5fc6('0x2c')]();_0x43b764[_0x5fc6('0x48')]=_0x49eb58[_0x5fc6('0x49')];_0x43b764[_0x5fc6('0x4a')]=_0x49eb58[_0x5fc6('0x3f')];_0x43b764[_0x5fc6('0x48')]=_['orderBy'](_0x43b764[_0x5fc6('0x48')],[_0x5fc6('0x4b')],[_0x5fc6('0x4c')]);if(_0x43b764[_0x5fc6('0x3d')]&&_0x43b764[_0x5fc6('0x3d')]['autoclose']){_0x43b764[_0x5fc6('0x48')][_0x5fc6('0x4d')]({'id':0x0,'priority':_0x43b764['applications'][_0x5fc6('0x4e')]+0x1,'app':_0x5fc6('0x4f'),'appdata':_0x5fc6('0x50'),'interval':_0x5fc6('0x51')});}if(_0x43b764[_0x5fc6('0x3d')][_0x5fc6('0x49')]){delete _0x43b764[_0x5fc6('0x3d')]['Applications'];}if(_0x43b764['account']['List']){delete _0x43b764[_0x5fc6('0x3d')][_0x5fc6('0x3f')];}if(_0x49eb58[_0x5fc6('0x3f')]['Contacts'][_0x5fc6('0x4e')]){return _0x49eb58[_0x5fc6('0x3f')]['Contacts'][0x0];}var _0x1415df=_[_0x5fc6('0xb')](_0xb5492a[_0x5fc6('0x2e')],{'firstName':_0xb5492a['body'][_0x5fc6('0x37')],'ListId':_0x49eb58[_0x5fc6('0x52')]});_0x1415df[_0xb5492a['body'][_0x5fc6('0x3b')]]=_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x37')];return db[_0x5fc6('0x31')][_0x5fc6('0x53')](_0x1415df);}else{throw new Error(_0x5fc6('0x54'));}})[_0x5fc6('0x10')](function(_0x3bd2aa){_0x43b764[_0x5fc6('0x55')]=_0x3bd2aa;if(_0x3bd2aa){if(!_0xb5492a['body']['message']['messageId']){_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x56')]=rs[_0x5fc6('0x57')]()+'\x20'+_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x37')];}var _0x25b097={'ContactId':_0x3bd2aa['id'],'MailAccountId':_0xb5492a[_0x5fc6('0x3d')]['id'],'inReplyTo':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')]['messageId'],'to':_0xb5492a['body']['message']['from'],'cc':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')]['cc'],'subject':_0xb5492a['body'][_0x5fc6('0x18')]['subject'],'attach':_0xb5492a['body']['message'][_0x5fc6('0x58')],'lastMsgAt':moment()['format'](_0x5fc6('0x59')),'lastMsgDirection':'in'};return db[_0x5fc6('0x5a')][_0x5fc6('0x28')]({'where':{'closed':![],'MailAccountId':_0xb5492a['account']['id']},'include':[{'model':db[_0x5fc6('0x5b')],'as':_0x5fc6('0x5c'),'attributes':[_0x5fc6('0x56')],'where':{'messageId':_0xb5492a['body'][_0x5fc6('0x18')][_0x5fc6('0x5d')]}}]})[_0x5fc6('0x10')](function(_0x385923){if(_0x385923){return[_0x385923,![]];}return db[_0x5fc6('0x5a')][_0x5fc6('0x53')](_0x25b097)[_0x5fc6('0x10')](function(_0x3dfa9e){return[_0x3dfa9e,!![]];});});}else{throw new Error(_0x5fc6('0x5e'));}})[_0x5fc6('0x5f')](function(_0x176db6,_0x3f9a6e){if(_0x176db6){_0x56dd97=_0x3f9a6e;if(!_0x3f9a6e){return _0x176db6[_0x5fc6('0x60')]({'inReplyTo':_0xb5492a['body'][_0x5fc6('0x18')][_0x5fc6('0x56')],'to':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')][_0x5fc6('0x37')],'cc':_0xb5492a[_0x5fc6('0x2e')]['message']['cc'],'subject':_0xb5492a['body'][_0x5fc6('0x18')][_0x5fc6('0x61')],'attach':_0x176db6[_0x5fc6('0x58')]?_0x176db6[_0x5fc6('0x58')]:_0xb5492a['body'][_0x5fc6('0x18')][_0x5fc6('0x58')],'substatus':null,'substatusAt':moment()[_0x5fc6('0x62')](_0x5fc6('0x59')),'lastMsgAt':moment()[_0x5fc6('0x62')](_0x5fc6('0x59')),'lastMsgDirection':'in'});}else{return _0x176db6;}}})['then'](function(_0xd32e0c){_0x43b764[_0x5fc6('0x63')]=_0xd32e0c[_0x5fc6('0x46')]({'plain':!![]});_0x43b764[_0x5fc6('0x63')][_0x5fc6('0x64')]=_0x56dd97;return db['MailMessage'][_0x5fc6('0x53')]({'body':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x2e')],'MailAccountId':_0xb5492a['account']['id'],'MailInteractionId':_0xd32e0c['id'],'direction':'in','ContactId':_0x43b764[_0x5fc6('0x55')]['id'],'messageId':_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x56')],'from':_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x37')],'to':_0xb5492a[_0x5fc6('0x2e')]['message']['to'],'cc':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')]['cc'],'subject':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')]['subject'],'attach':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')][_0x5fc6('0x58')],'Attachments':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')][_0x5fc6('0x65')],'originTo':_0xb5492a[_0x5fc6('0x2e')]['message']['originTo'],'originCc':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')][_0x5fc6('0x66')],'bcc':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')]['bcc'],'ChatWebsiteId':_0xb5492a[_0x5fc6('0x2e')][_0x5fc6('0x18')][_0x5fc6('0x67')]||null,'originChannel':_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x68')]||_0x5fc6('0x69'),'ChatOfflineMessageId':_0xb5492a[_0x5fc6('0x2e')]['message'][_0x5fc6('0x6a')]||null},{'include':[{'model':db[_0x5fc6('0x6b')],'as':_0x5fc6('0x6c')}]});})[_0x5fc6('0x10')](function(_0x2fc0c5){_0x43b764[_0x5fc6('0x18')]=_0x2fc0c5;if(!_0x43b764[_0x5fc6('0x63')][_0x5fc6('0x6d')]){return;}return db[_0x5fc6('0x6e')][_0x5fc6('0x28')]({'attributes':['id',_0x5fc6('0x6f')],'where':{'id':_0x43b764['interaction'][_0x5fc6('0x6d')]}});})['then'](function(_0x5b6492){if(_0x5b6492){_0x43b764[_0x5fc6('0x48')][_0x5fc6('0x70')]({'id':0x0,'priority':0x0,'app':_0x5fc6('0x71'),'appdata':_0x5b6492[_0x5fc6('0x6f')]+','+(_0x43b764[_0x5fc6('0x3d')][_0x5fc6('0x72')]||0xa),'interval':_0x5fc6('0x51')});}if(!_0x43b764['interaction'][_0x5fc6('0x73')]){return;}return db['MailQueue']['find']({'attributes':['id','name'],'where':{'id':_0x43b764[_0x5fc6('0x63')][_0x5fc6('0x73')]}});})[_0x5fc6('0x10')](function(_0x77b4ab){if(_0x77b4ab){_0x43b764[_0x5fc6('0x48')][_0x5fc6('0x70')]({'id':0x0,'priority':0x1,'app':_0x5fc6('0x74'),'appdata':_0x77b4ab['name']+','+(_0x43b764[_0x5fc6('0x3d')][_0x5fc6('0x75')]||0x12c),'interval':_0x5fc6('0x51')});}return respondWithRpcPromise(_0x5fc6('0x76'),_0x5fc6('0x77'),_0x43b764);})['then'](function(_0x5dfab6){_0x370bc4(_0x5dfab6);})[_0x5fc6('0x1a')](function(_0x3282bc){_0x1b6d1a(_0x3883a9['error'](0x1f4,_0x3282bc['message']));});});}; \ No newline at end of file +var _0xe626=['omit','Applications','list','applications','orderBy','asc','autoclose','push','close','*,*,*,*','length','CmContact','create','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowMailAccount','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','updatedAt','MailApplication','MailServerOut','Smtp','CloudProvider','get'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe626,0x9d));var _0x6e62=function(_0x5ca259,_0x145448){_0x5ca259=_0x5ca259-0x0;var _0x30d5d8=_0xe626[_0x5ca259];return _0x30d5d8;};'use strict';var _=require(_0x6e62('0x0'));var moment=require(_0x6e62('0x1'));var BPromise=require(_0x6e62('0x2'));var rs=require(_0x6e62('0x3'));var Redis=require('ioredis');var db=require(_0x6e62('0x4'))['db'];var logger=require(_0x6e62('0x5'))(_0x6e62('0x6'));var config=require(_0x6e62('0x7'));var jayson=require(_0x6e62('0x8'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x6e62('0x9')](config[_0x6e62('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e62('0xb'))(new Redis(config[_0x6e62('0xa')]));require(_0x6e62('0xc'))[_0x6e62('0xd')](socket);function respondWithRpcPromise(_0x5af723,_0xa6e8be,_0x3d677f){return new BPromise(function(_0x4e25d3,_0x2fbfd0){return client['request'](_0x5af723,_0x3d677f)[_0x6e62('0xe')](function(_0x543d09){logger[_0x6e62('0xf')]('MailAccount,\x20%s,\x20%s',_0xa6e8be,_0x6e62('0x10'));logger[_0x6e62('0x11')](_0x6e62('0x12'),_0xa6e8be,_0x6e62('0x10'),JSON[_0x6e62('0x13')](_0x543d09));if(_0x543d09[_0x6e62('0x14')]){if(_0x543d09[_0x6e62('0x14')]['code']===0x1f4){logger['error'](_0x6e62('0x15'),_0xa6e8be,_0x543d09[_0x6e62('0x14')]['message']);return _0x2fbfd0(_0x543d09[_0x6e62('0x14')][_0x6e62('0x16')]);}logger[_0x6e62('0x14')](_0x6e62('0x15'),_0xa6e8be,_0x543d09['error'][_0x6e62('0x16')]);return _0x4e25d3(_0x543d09[_0x6e62('0x14')][_0x6e62('0x16')]);}else{logger[_0x6e62('0xf')](_0x6e62('0x15'),_0xa6e8be,_0x6e62('0x10'));_0x4e25d3(_0x543d09[_0x6e62('0x17')][_0x6e62('0x16')]);}})[_0x6e62('0x18')](function(_0x15bce5){logger['error'](_0x6e62('0x15'),_0xa6e8be,_0x15bce5);_0x2fbfd0(_0x15bce5);});});}exports[_0x6e62('0x19')]=function(_0x55ce3b){var _0xefbfb6=this;return new Promise(function(_0x4ecdff,_0xf7d17f){return db[_0x6e62('0x1a')][_0x6e62('0x1b')]({'raw':_0x55ce3b[_0x6e62('0x1c')]?_0x55ce3b[_0x6e62('0x1c')][_0x6e62('0x1d')]===undefined?!![]:![]:!![],'where':_0x55ce3b[_0x6e62('0x1c')]?_0x55ce3b[_0x6e62('0x1c')][_0x6e62('0x1e')]||null:null,'attributes':_0x55ce3b[_0x6e62('0x1c')]?_0x55ce3b[_0x6e62('0x1c')]['attributes']||null:null,'limit':_0x55ce3b[_0x6e62('0x1c')]?_0x55ce3b['options'][_0x6e62('0x1f')]||null:null,'include':_0x55ce3b[_0x6e62('0x1c')]?_0x55ce3b[_0x6e62('0x1c')][_0x6e62('0x20')]?_[_0x6e62('0x21')](_0x55ce3b[_0x6e62('0x1c')][_0x6e62('0x20')],function(_0x3a1683){return{'model':db[_0x3a1683[_0x6e62('0x22')]],'as':_0x3a1683['as'],'attributes':_0x3a1683[_0x6e62('0x23')],'include':_0x3a1683['include']?_[_0x6e62('0x21')](_0x3a1683['include'],function(_0x2f9c68){return{'model':db[_0x2f9c68[_0x6e62('0x22')]],'as':_0x2f9c68['as'],'attributes':_0x2f9c68[_0x6e62('0x23')],'include':_0x2f9c68[_0x6e62('0x20')]?_[_0x6e62('0x21')](_0x2f9c68[_0x6e62('0x20')],function(_0x4ecc45){return{'model':db[_0x4ecc45[_0x6e62('0x22')]],'as':_0x4ecc45['as'],'attributes':_0x4ecc45[_0x6e62('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6e62('0xe')](function(_0x50ba00){logger['info'](_0x6e62('0x19'),_0x55ce3b);logger['debug']('GetMailAccount',_0x55ce3b,JSON['stringify'](_0x50ba00));_0x4ecdff(_0x50ba00);})['catch'](function(_0x17f634){logger['error'](_0x6e62('0x19'),_0x17f634['message'],_0x55ce3b);_0xf7d17f(_0xefbfb6[_0x6e62('0x14')](0x1f4,_0x17f634[_0x6e62('0x16')]));});});};exports[_0x6e62('0x24')]=function(_0x4f73b5){var _0x574d73=this;return new Promise(function(_0x2d12f6,_0xb8d42e){return db['MailAccount']['find']({'raw':_0x4f73b5['options']?_0x4f73b5[_0x6e62('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4f73b5[_0x6e62('0x1c')]?_0x4f73b5[_0x6e62('0x1c')][_0x6e62('0x1e')]||null:null,'attributes':_0x4f73b5[_0x6e62('0x1c')]?_0x4f73b5[_0x6e62('0x1c')]['attributes']||null:null,'include':_0x4f73b5['options']?_0x4f73b5[_0x6e62('0x1c')][_0x6e62('0x20')]?_[_0x6e62('0x21')](_0x4f73b5[_0x6e62('0x1c')][_0x6e62('0x20')],function(_0xfe729c){return{'model':db[_0xfe729c[_0x6e62('0x22')]],'as':_0xfe729c['as'],'attributes':_0xfe729c[_0x6e62('0x23')],'include':_0xfe729c[_0x6e62('0x20')]?_['map'](_0xfe729c[_0x6e62('0x20')],function(_0x3ddf6e){return{'model':db[_0x3ddf6e[_0x6e62('0x22')]],'as':_0x3ddf6e['as'],'attributes':_0x3ddf6e['attributes'],'include':_0x3ddf6e[_0x6e62('0x20')]?_[_0x6e62('0x21')](_0x3ddf6e['include'],function(_0x19c758){return{'model':db[_0x19c758[_0x6e62('0x22')]],'as':_0x19c758['as'],'attributes':_0x19c758[_0x6e62('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6e62('0xe')](function(_0x304ac1){if(_0x4f73b5['options'][_0x6e62('0x25')]===!![])_0x304ac1[_0x6e62('0x26')](_0x6e62('0x27'),_0x304ac1[_0x6e62('0x28')]());logger[_0x6e62('0xf')]('ShowMailAccount',_0x4f73b5);logger[_0x6e62('0x11')](_0x6e62('0x24'),_0x4f73b5,JSON[_0x6e62('0x13')](_0x304ac1));_0x2d12f6(_0x304ac1);})['catch'](function(_0x28af80){logger[_0x6e62('0x14')]('ShowMailAccount',_0x28af80['message'],_0x4f73b5);_0xb8d42e(_0x574d73[_0x6e62('0x14')](0x1f4,_0x28af80[_0x6e62('0x16')]));});});};exports[_0x6e62('0x29')]=function(_0x5257be){var _0x5133a2=this;return new Promise(function(_0x1ef318,_0x4ac790){var _0x504e16={'body':_0x5257be[_0x6e62('0x2a')],'channel':_0x6e62('0x2b')};var _0xd07973=_[_0x6e62('0x2c')](_[_0x6e62('0x2d')](db['CmContact'][_0x6e62('0x2e')]),['createdAt','updatedAt',_0x6e62('0x2f'),_0x6e62('0x30')]);var _0x940288=![];if(_0x5257be['body']['id']){delete _0x5257be[_0x6e62('0x2a')]['id'];}if(_['isNil'](_0x5257be[_0x6e62('0x2a')][_0x6e62('0x31')])){return _0x4ac790(_0x5133a2[_0x6e62('0x14')](0x1f4,_0x6e62('0x32')));}if(_[_0x6e62('0x33')](_0x5257be[_0x6e62('0x2a')][_0x6e62('0x2a')])||_0x5257be[_0x6e62('0x2a')][_0x6e62('0x2a')]===''){return _0x4ac790(_0x5133a2[_0x6e62('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x5257be['body'][_0x6e62('0x34')])){return _0x4ac790(_0x5133a2['error'](0x1f4,_0x6e62('0x35')+_0xd07973));}if(!_[_0x6e62('0x36')](_0xd07973,_0x5257be['body'][_0x6e62('0x34')])){return _0x4ac790(_0x5133a2[_0x6e62('0x14')](0x1f4,_0x6e62('0x37')+_0xd07973));}var _0x2efc75={};_0x2efc75[_0x5257be[_0x6e62('0x2a')][_0x6e62('0x34')]]=_0x5257be[_0x6e62('0x2a')][_0x6e62('0x31')];return db[_0x6e62('0x1a')][_0x6e62('0x38')]({'where':{'id':_0x5257be[_0x6e62('0x39')]['id']},'include':[{'model':db[_0x6e62('0x3a')],'as':_0x6e62('0x3b'),'include':[{'model':db['CmContact'],'as':_0x6e62('0x3c'),'where':_0x2efc75,'limit':0x1,'order':[[_0x6e62('0x3d'),'DESC']]}]},{'model':db[_0x6e62('0x3e')],'as':'Applications'},{'model':db[_0x6e62('0x3f')],'as':_0x6e62('0x40'),'include':[{'model':db[_0x6e62('0x41')],'as':'CloudProvider'}]}]})[_0x6e62('0xe')](function(_0x4745a3){if(_0x4745a3&&_0x4745a3[_0x6e62('0x3b')]){var _0x212290=_0x4745a3[_0x6e62('0x42')]({'plain':!![]});_0x504e16[_0x6e62('0x39')]=_[_0x6e62('0x43')](_0x212290,[_0x6e62('0x44'),_0x6e62('0x3b')]);_0x504e16[_0x6e62('0x39')][_0x6e62('0x27')]=_0x4745a3['getSmtpOptions']();_0x504e16['applications']=_0x212290[_0x6e62('0x44')];_0x504e16[_0x6e62('0x45')]=_0x212290[_0x6e62('0x3b')];_0x504e16[_0x6e62('0x46')]=_[_0x6e62('0x47')](_0x504e16[_0x6e62('0x46')],['priority'],[_0x6e62('0x48')]);if(_0x504e16['account']&&_0x504e16[_0x6e62('0x39')][_0x6e62('0x49')]){_0x504e16[_0x6e62('0x46')][_0x6e62('0x4a')]({'id':0x0,'priority':_0x504e16[_0x6e62('0x46')]['length']+0x1,'app':_0x6e62('0x4b'),'appdata':_0x6e62('0x49'),'interval':_0x6e62('0x4c')});}if(_0x504e16[_0x6e62('0x39')]['Applications']){delete _0x504e16[_0x6e62('0x39')]['Applications'];}if(_0x504e16[_0x6e62('0x39')][_0x6e62('0x3b')]){delete _0x504e16[_0x6e62('0x39')][_0x6e62('0x3b')];}if(_0x212290[_0x6e62('0x3b')][_0x6e62('0x3c')][_0x6e62('0x4d')]){return _0x212290['List'][_0x6e62('0x3c')][0x0];}var _0x51dfca=_[_0x6e62('0x9')](_0x5257be[_0x6e62('0x2a')],{'firstName':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x31')],'ListId':_0x212290[_0x6e62('0x30')]});_0x51dfca[_0x5257be['body'][_0x6e62('0x34')]]=_0x5257be['body'][_0x6e62('0x31')];return db[_0x6e62('0x4e')][_0x6e62('0x4f')](_0x51dfca);}else{throw new Error('List\x20not\x20found');}})[_0x6e62('0xe')](function(_0x264c50){_0x504e16['contact']=_0x264c50;if(_0x264c50){if(!_0x5257be[_0x6e62('0x2a')]['message'][_0x6e62('0x50')]){_0x5257be['body'][_0x6e62('0x16')][_0x6e62('0x50')]=rs['generate']()+'\x20'+_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')]['from'];}var _0x5735b4={'ContactId':_0x264c50['id'],'MailAccountId':_0x5257be[_0x6e62('0x39')]['id'],'inReplyTo':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x50')],'to':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x31')],'cc':_0x5257be['body'][_0x6e62('0x16')]['cc'],'subject':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x51')],'attach':_0x5257be[_0x6e62('0x2a')]['message'][_0x6e62('0x52')],'lastMsgAt':moment()[_0x6e62('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x6e62('0x54')][_0x6e62('0x38')]({'where':{'closed':![],'MailAccountId':_0x5257be[_0x6e62('0x39')]['id']},'include':[{'model':db[_0x6e62('0x55')],'as':_0x6e62('0x56'),'attributes':['messageId'],'where':{'messageId':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x57')]}}]})['then'](function(_0x2254ea){if(_0x2254ea){return[_0x2254ea,![]];}return db[_0x6e62('0x54')]['create'](_0x5735b4)[_0x6e62('0xe')](function(_0x5b5b66){return[_0x5b5b66,!![]];});});}else{throw new Error(_0x6e62('0x58'));}})[_0x6e62('0x59')](function(_0xb465,_0x5db78e){if(_0xb465){_0x940288=_0x5db78e;if(!_0x5db78e){return _0xb465['update']({'inReplyTo':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x50')],'to':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x31')],'cc':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')]['cc'],'subject':_0x5257be['body'][_0x6e62('0x16')][_0x6e62('0x51')],'attach':_0xb465['attach']?_0xb465[_0x6e62('0x52')]:_0x5257be['body'][_0x6e62('0x16')][_0x6e62('0x52')],'substatus':null,'substatusAt':moment()[_0x6e62('0x53')](_0x6e62('0x5a')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0xb465;}}})[_0x6e62('0xe')](function(_0xa15705){_0x504e16[_0x6e62('0x5b')]=_0xa15705[_0x6e62('0x42')]({'plain':!![]});_0x504e16[_0x6e62('0x5b')][_0x6e62('0x5c')]=_0x940288;return db[_0x6e62('0x55')][_0x6e62('0x4f')]({'body':_0x5257be['body'][_0x6e62('0x2a')],'MailAccountId':_0x5257be[_0x6e62('0x39')]['id'],'MailInteractionId':_0xa15705['id'],'direction':'in','ContactId':_0x504e16[_0x6e62('0x5d')]['id'],'messageId':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x50')],'from':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x31')],'to':_0x5257be['body'][_0x6e62('0x16')]['to'],'cc':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')]['cc'],'subject':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x51')],'attach':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x52')],'Attachments':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x5e')],'originTo':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x5f')],'originCc':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')]['originCc'],'bcc':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x60')],'ChatWebsiteId':_0x5257be[_0x6e62('0x2a')]['message'][_0x6e62('0x61')]||null,'originChannel':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')]['originChannel']||_0x6e62('0x62'),'ChatOfflineMessageId':_0x5257be[_0x6e62('0x2a')][_0x6e62('0x16')][_0x6e62('0x63')]||null},{'include':[{'model':db['Attachment'],'as':_0x6e62('0x64')}]});})[_0x6e62('0xe')](function(_0x334f07){_0x504e16[_0x6e62('0x16')]=_0x334f07;if(!_0x504e16[_0x6e62('0x5b')][_0x6e62('0x65')]){return;}return db[_0x6e62('0x66')][_0x6e62('0x38')]({'attributes':['id',_0x6e62('0x67')],'where':{'id':_0x504e16[_0x6e62('0x5b')][_0x6e62('0x65')]}});})[_0x6e62('0xe')](function(_0x1cd07e){if(_0x1cd07e){_0x504e16[_0x6e62('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6e62('0x68'),'appdata':_0x1cd07e[_0x6e62('0x67')]+','+(_0x504e16[_0x6e62('0x39')][_0x6e62('0x69')]||0xa),'interval':_0x6e62('0x4c')});}if(!_0x504e16[_0x6e62('0x5b')][_0x6e62('0x6a')]){return;}return db[_0x6e62('0x6b')]['find']({'attributes':['id',_0x6e62('0x67')],'where':{'id':_0x504e16[_0x6e62('0x5b')][_0x6e62('0x6a')]}});})[_0x6e62('0xe')](function(_0x1f91fe){if(_0x1f91fe){_0x504e16[_0x6e62('0x46')][_0x6e62('0x6c')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1f91fe[_0x6e62('0x67')]+','+(_0x504e16[_0x6e62('0x39')][_0x6e62('0x6d')]||0x12c),'interval':_0x6e62('0x4c')});}return respondWithRpcPromise(_0x6e62('0x6e'),_0x6e62('0x6f'),_0x504e16);})[_0x6e62('0xe')](function(_0x266ed9){_0x1ef318(_0x266ed9);})[_0x6e62('0x18')](function(_0x2bff13){_0x4ac790(_0x5133a2[_0x6e62('0x14')](0x1f4,_0x2bff13[_0x6e62('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 0891239..d1943db 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 _0xd04a=['update','emit','removeListener','register','remove'];(function(_0x329738,_0x4dcfbd){var _0x575c66=function(_0x5851c1){while(--_0x5851c1){_0x329738['push'](_0x329738['shift']());}};_0x575c66(++_0x4dcfbd);}(_0xd04a,0xd6));var _0xad04=function(_0x2a5ea0,_0x2bc5dc){_0x2a5ea0=_0x2a5ea0-0x0;var _0xce040f=_0xd04a[_0x2a5ea0];return _0xce040f;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xad04('0x0'),_0xad04('0x1')];function createListener(_0x5234a8,_0x45d37e){return function(_0x5c4ba3){_0x45d37e[_0xad04('0x2')](_0x5234a8,_0x5c4ba3);};}function removeListener(_0x417eb0,_0x3df177){return function(){MailAccountEvents[_0xad04('0x3')](_0x417eb0,_0x3df177);};}exports[_0xad04('0x4')]=function(_0x5ef258){for(var _0x419ce3=0x0,_0x1fcf20=events['length'];_0x419ce3<_0x1fcf20;_0x419ce3++){var _0x51a2b5=events[_0x419ce3];var _0x595f2b=createListener('mailAccount:'+_0x51a2b5,_0x5ef258);MailAccountEvents['on'](_0x51a2b5,_0x595f2b);}}; \ No newline at end of file +var _0x09ef=['save','remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09ef,0x15e));var _0xf09e=function(_0xd66d9f,_0x610165){_0xd66d9f=_0xd66d9f-0x0;var _0x483580=_0x09ef[_0xd66d9f];return _0x483580;};'use strict';var MailAccountEvents=require(_0xf09e('0x0'));var events=[_0xf09e('0x1'),_0xf09e('0x2'),_0xf09e('0x3')];function createListener(_0x476c52,_0x17004f){return function(_0x504169){_0x17004f[_0xf09e('0x4')](_0x476c52,_0x504169);};}function removeListener(_0x56eab9,_0xbefffe){return function(){MailAccountEvents[_0xf09e('0x5')](_0x56eab9,_0xbefffe);};}exports[_0xf09e('0x6')]=function(_0xf4ba1b){for(var _0x311400=0x0,_0x294258=events[_0xf09e('0x7')];_0x311400<_0x294258;_0x311400++){var _0x877574=events[_0x311400];var _0x2e5a79=createListener(_0xf09e('0x8')+_0x877574,_0xf4ba1b);MailAccountEvents['on'](_0x877574,_0x2e5a79);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index a27f74a..bc29f5c 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 _0x0d32=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x0d32,0x7c));var _0x20d3=function(_0x3f09ed,_0x16f3dd){_0x3f09ed=_0x3f09ed-0x0;var _0x4412a2=_0x0d32[_0x3f09ed];return _0x4412a2;};'use strict';var multer=require(_0x20d3('0x0'));var util=require(_0x20d3('0x1'));var path=require(_0x20d3('0x2'));var timeout=require(_0x20d3('0x3'));var express=require(_0x20d3('0x4'));var router=express[_0x20d3('0x5')]();var fs_extra=require(_0x20d3('0x6'));var auth=require(_0x20d3('0x7'));var interaction=require(_0x20d3('0x8'));var config=require(_0x20d3('0x9'));var controller=require('./mailApplication.controller');router['get'](_0x20d3('0xa'),auth[_0x20d3('0xb')](),controller['show']);router[_0x20d3('0xc')](_0x20d3('0xa'),auth[_0x20d3('0xb')](),controller[_0x20d3('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x20d3('0xe')]);module[_0x20d3('0xf')]=router; \ No newline at end of file +var _0x3f88=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','put','/:id','update','delete'];(function(_0x512a57,_0x2c4458){var _0x48502b=function(_0xaff2a0){while(--_0xaff2a0){_0x512a57['push'](_0x512a57['shift']());}};_0x48502b(++_0x2c4458);}(_0x3f88,0x1d6));var _0x83f8=function(_0x19a770,_0x4ebdbf){_0x19a770=_0x19a770-0x0;var _0xe85dbc=_0x3f88[_0x19a770];return _0xe85dbc;};'use strict';var multer=require(_0x83f8('0x0'));var util=require(_0x83f8('0x1'));var path=require(_0x83f8('0x2'));var timeout=require(_0x83f8('0x3'));var express=require(_0x83f8('0x4'));var router=express[_0x83f8('0x5')]();var fs_extra=require(_0x83f8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x83f8('0x7'));var config=require(_0x83f8('0x8'));var controller=require(_0x83f8('0x9'));router[_0x83f8('0xa')]('/:id',auth[_0x83f8('0xb')](),controller['show']);router[_0x83f8('0xc')](_0x83f8('0xd'),auth[_0x83f8('0xb')](),controller[_0x83f8('0xe')]);router[_0x83f8('0xf')](_0x83f8('0xd'),auth[_0x83f8('0xb')](),controller[_0x83f8('0x10')]);module[_0x83f8('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index eb93033..0e4d4c9 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 _0x3a59=['TEXT','sequelize','STRING'];(function(_0x47d551,_0x6d3f96){var _0x27ec22=function(_0x3ef836){while(--_0x3ef836){_0x47d551['push'](_0x47d551['shift']());}};_0x27ec22(++_0x6d3f96);}(_0x3a59,0x136));var _0x93a5=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x3a59[_0x286bfb];return _0x52b683;};'use strict';var Sequelize=require(_0x93a5('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x93a5('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x93a5('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x93a5('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4b4f=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x6fc5ba,_0x4a75c6){var _0x26e04c=function(_0x5e7173){while(--_0x5e7173){_0x6fc5ba['push'](_0x6fc5ba['shift']());}};_0x26e04c(++_0x4a75c6);}(_0x4b4f,0x1e7));var _0xf4b4=function(_0x99c4a1,_0x40e7a8){_0x99c4a1=_0x99c4a1-0x0;var _0x371738=_0x4b4f[_0x99c4a1];return _0x371738;};'use strict';var Sequelize=require('sequelize');module[_0xf4b4('0x0')]={'priority':{'type':Sequelize[_0xf4b4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf4b4('0x2')],'allowNull':![],'defaultValue':_0xf4b4('0x3')},'appdata':{'type':Sequelize[_0xf4b4('0x4')]()},'description':{'type':Sequelize[_0xf4b4('0x2')]},'interval':{'type':Sequelize[_0xf4b4('0x2')],'defaultValue':_0xf4b4('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7d25d6a..51c44a2 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 _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0xa6b937,_0x2306d0){var _0x507b33=function(_0x52afa8){while(--_0x52afa8){_0xa6b937['push'](_0xa6b937['shift']());}};_0x507b33(++_0x2306d0);}(_0xf4eb,0xec));var _0xbf4e=function(_0xd2e043,_0x5321d5){_0xd2e043=_0xd2e043-0x0;var _0x19dd53=_0xf4eb[_0xd2e043];return _0x19dd53;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x8e3507,_0x7c734c){var _0x48c52b=function(_0x51225f){while(--_0x51225f){_0x8e3507['push'](_0x8e3507['shift']());}};_0x48c52b(++_0x7c734c);}(_0xe706,0xa3));var _0x6e70=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xe706[_0x7b173];return _0x1c598c;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f6cc074..c615ad4 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 _0xae0d=['bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xae0d,0x15b));var _0xdae0=function(_0x3140ed,_0x1112c9){_0x3140ed=_0x3140ed-0x0;var _0xdeb47f=_0xae0d[_0x3140ed];return _0xdeb47f;};'use strict';var _=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var logger=require(_0xdae0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdae0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdae0('0x4'));var rimraf=require(_0xdae0('0x5'));var config=require(_0xdae0('0x6'));var attributes=require(_0xdae0('0x7'));module[_0xdae0('0x8')]=function(_0x4009d9,_0x12f163){return _0x4009d9[_0xdae0('0x9')](_0xdae0('0xa'),attributes,{'tableName':_0xdae0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdae0('0xc'),'collate':_0xdae0('0xd')});}; \ No newline at end of file +var _0xf68c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','mail_applications','utf8mb4'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xf68c,0x9d));var _0xcf68=function(_0x4eb17c,_0x4e942e){_0x4eb17c=_0x4eb17c-0x0;var _0x5cf0f0=_0xf68c[_0x4eb17c];return _0x5cf0f0;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var logger=require(_0xcf68('0x2'))('api');var moment=require(_0xcf68('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf68('0x4'));var fs=require('fs');var path=require(_0xcf68('0x5'));var rimraf=require(_0xcf68('0x6'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xcf68('0x7')]=function(_0x389543,_0x19c7c3){return _0x389543[_0xcf68('0x8')]('MailApplication',attributes,{'tableName':_0xcf68('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcf68('0xa'),'collate':_0xcf68('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6923cbb..87ca68c 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 _0xafc1=['request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailApplication','update','options','raw','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0xafc1,0xae));var _0x1afc=function(_0x59b65c,_0x2e1472){_0x59b65c=_0x59b65c-0x0;var _0x1179b1=_0xafc1[_0x59b65c];return _0x1179b1;};'use strict';var _=require(_0x1afc('0x0'));var util=require('util');var moment=require(_0x1afc('0x1'));var BPromise=require(_0x1afc('0x2'));var rs=require(_0x1afc('0x3'));var fs=require('fs');var Redis=require(_0x1afc('0x4'));var db=require(_0x1afc('0x5'))['db'];var utils=require(_0x1afc('0x6'));var logger=require(_0x1afc('0x7'))(_0x1afc('0x8'));var config=require('../../config/environment');var jayson=require(_0x1afc('0x9'));var client=jayson[_0x1afc('0xa')][_0x1afc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c988,_0x239ee3,_0x2caf8d){return new BPromise(function(_0x18e4c5,_0x437bb6){return client[_0x1afc('0xc')](_0x16c988,_0x2caf8d)[_0x1afc('0xd')](function(_0x311ac9){logger[_0x1afc('0xe')](_0x1afc('0xf'),_0x239ee3,_0x1afc('0x10'));logger[_0x1afc('0x11')](_0x1afc('0x12'),_0x239ee3,_0x1afc('0x10'),JSON['stringify'](_0x311ac9));if(_0x311ac9[_0x1afc('0x13')]){if(_0x311ac9[_0x1afc('0x13')][_0x1afc('0x14')]===0x1f4){logger['error'](_0x1afc('0xf'),_0x239ee3,_0x311ac9[_0x1afc('0x13')][_0x1afc('0x15')]);return _0x437bb6(_0x311ac9[_0x1afc('0x13')][_0x1afc('0x15')]);}logger[_0x1afc('0x13')](_0x1afc('0xf'),_0x239ee3,_0x311ac9[_0x1afc('0x13')][_0x1afc('0x15')]);return _0x18e4c5(_0x311ac9['error'][_0x1afc('0x15')]);}else{logger[_0x1afc('0xe')](_0x1afc('0xf'),_0x239ee3,_0x1afc('0x10'));_0x18e4c5(_0x311ac9['result'][_0x1afc('0x15')]);}})[_0x1afc('0x16')](function(_0x4ddd00){logger[_0x1afc('0x13')](_0x1afc('0xf'),_0x239ee3,_0x4ddd00);_0x437bb6(_0x4ddd00);});});}exports[_0x1afc('0x17')]=function(_0x2fd76c){var _0x5c3a97=this;return new Promise(function(_0x45fe7e,_0x3c4529){return db['MailApplication'][_0x1afc('0x18')](_0x2fd76c['body'],{'raw':_0x2fd76c[_0x1afc('0x19')]?_0x2fd76c[_0x1afc('0x19')][_0x1afc('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fd76c[_0x1afc('0x19')]?_0x2fd76c['options'][_0x1afc('0x1b')]||null:null,'attributes':_0x2fd76c[_0x1afc('0x19')]?_0x2fd76c['options'][_0x1afc('0x1c')]||null:null,'limit':_0x2fd76c['options']?_0x2fd76c['options'][_0x1afc('0x1d')]||null:null})[_0x1afc('0xd')](function(_0x3a5412){logger[_0x1afc('0xe')](_0x1afc('0x17'),_0x2fd76c);logger[_0x1afc('0x11')](_0x1afc('0x17'),_0x2fd76c,JSON[_0x1afc('0x1e')](_0x3a5412));_0x45fe7e(_0x3a5412);})['catch'](function(_0x45ace4){logger[_0x1afc('0x13')]('UpdateMailApplication',_0x45ace4[_0x1afc('0x15')],_0x2fd76c);_0x3c4529(_0x5c3a97[_0x1afc('0x13')](0x1f4,_0x45ace4[_0x1afc('0x15')]));});});}; \ No newline at end of file +var _0xa63e=['jayson/promise','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3da7ab,_0x2e00dc){var _0x4819ed=function(_0x484ce3){while(--_0x484ce3){_0x3da7ab['push'](_0x3da7ab['shift']());}};_0x4819ed(++_0x2e00dc);}(_0xa63e,0xa2));var _0xea63=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa63e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xea63('0x0'));var util=require(_0xea63('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xea63('0x2'));var fs=require('fs');var Redis=require(_0xea63('0x3'));var db=require(_0xea63('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea63('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xea63('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7136,_0x1e82ad,_0x1676f3){return new BPromise(function(_0xd2ce80,_0x5b79da){return client[_0xea63('0x7')](_0x4c7136,_0x1676f3)[_0xea63('0x8')](function(_0x2a2e70){logger[_0xea63('0x9')](_0xea63('0xa'),_0x1e82ad,'request\x20sent');logger[_0xea63('0xb')](_0xea63('0xc'),_0x1e82ad,_0xea63('0xd'),JSON[_0xea63('0xe')](_0x2a2e70));if(_0x2a2e70['error']){if(_0x2a2e70[_0xea63('0xf')][_0xea63('0x10')]===0x1f4){logger[_0xea63('0xf')](_0xea63('0xa'),_0x1e82ad,_0x2a2e70[_0xea63('0xf')]['message']);return _0x5b79da(_0x2a2e70[_0xea63('0xf')]['message']);}logger[_0xea63('0xf')](_0xea63('0xa'),_0x1e82ad,_0x2a2e70[_0xea63('0xf')][_0xea63('0x11')]);return _0xd2ce80(_0x2a2e70[_0xea63('0xf')][_0xea63('0x11')]);}else{logger[_0xea63('0x9')](_0xea63('0xa'),_0x1e82ad,_0xea63('0xd'));_0xd2ce80(_0x2a2e70[_0xea63('0x12')][_0xea63('0x11')]);}})[_0xea63('0x13')](function(_0x1e40a4){logger['error'](_0xea63('0xa'),_0x1e82ad,_0x1e40a4);_0x5b79da(_0x1e40a4);});});}exports[_0xea63('0x14')]=function(_0x54c637){var _0x523397=this;return new Promise(function(_0x4b83d0,_0x28ac09){return db['MailApplication'][_0xea63('0x15')](_0x54c637[_0xea63('0x16')],{'raw':_0x54c637[_0xea63('0x17')]?_0x54c637[_0xea63('0x17')][_0xea63('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c637[_0xea63('0x17')]?_0x54c637['options'][_0xea63('0x19')]||null:null,'attributes':_0x54c637[_0xea63('0x17')]?_0x54c637[_0xea63('0x17')][_0xea63('0x1a')]||null:null,'limit':_0x54c637['options']?_0x54c637[_0xea63('0x17')][_0xea63('0x1b')]||null:null})[_0xea63('0x8')](function(_0x2ad813){logger[_0xea63('0x9')](_0xea63('0x14'),_0x54c637);logger[_0xea63('0xb')](_0xea63('0x14'),_0x54c637,JSON['stringify'](_0x2ad813));_0x4b83d0(_0x2ad813);})['catch'](function(_0x5cfe20){logger[_0xea63('0xf')](_0xea63('0x14'),_0x5cfe20[_0xea63('0x11')],_0x54c637);_0x28ac09(_0x523397['error'](0x1f4,_0x5cfe20[_0xea63('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 7e152e0..1af07d6 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 _0xf055=['mail','mailinteraction:addtags','addTags','update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked'];(function(_0x29e7a1,_0x379ef6){var _0xe2a3b9=function(_0x1e90ca){while(--_0x1e90ca){_0x29e7a1['push'](_0x29e7a1['shift']());}};_0xe2a3b9(++_0x379ef6);}(_0xf055,0x1a0));var _0x5f05=function(_0x134c79,_0x2136d3){_0x134c79=_0x134c79-0x0;var _0x2c2142=_0xf055[_0x134c79];return _0x2c2142;};'use strict';var express=require(_0x5f05('0x0'));var router=express[_0x5f05('0x1')]();var auth=require(_0x5f05('0x2'));var interaction=require(_0x5f05('0x3'));var controller=require(_0x5f05('0x4'));router[_0x5f05('0x5')]('/',auth[_0x5f05('0x6')](),controller['index']);router[_0x5f05('0x5')]('/describe',auth[_0x5f05('0x6')](),controller[_0x5f05('0x7')]);router[_0x5f05('0x5')](_0x5f05('0x8'),auth[_0x5f05('0x6')](),controller['show']);router['get'](_0x5f05('0x9'),auth[_0x5f05('0x6')](),controller['getMessages']);router[_0x5f05('0x5')](_0x5f05('0xa'),auth[_0x5f05('0x6')](),controller[_0x5f05('0xb')]);router[_0x5f05('0xc')]('/',auth[_0x5f05('0x6')](),controller[_0x5f05('0xd')]);router['post'](_0x5f05('0x9'),auth[_0x5f05('0x6')](),controller['addMessage']);router['post'](_0x5f05('0xe'),auth[_0x5f05('0x6')](),interaction[_0x5f05('0xf')](_0x5f05('0x10'),_0x5f05('0x11')),controller[_0x5f05('0x12')]);router['put'](_0x5f05('0x8'),auth[_0x5f05('0x6')](),interaction[_0x5f05('0xf')](_0x5f05('0x10'),'mailinteraction:update'),controller[_0x5f05('0x13')]);router[_0x5f05('0x14')]('/:id',auth[_0x5f05('0x6')](),interaction[_0x5f05('0xf')](_0x5f05('0x10'),'mailinteraction:destroy'),controller[_0x5f05('0x15')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x5f05('0x16')]);module[_0x5f05('0x17')]=router; \ No newline at end of file +var _0x3fa0=['removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','mailinteraction:destroy','delete'];(function(_0x4836bc,_0x1a0976){var _0x43d34a=function(_0x2a99a4){while(--_0x2a99a4){_0x4836bc['push'](_0x4836bc['shift']());}};_0x43d34a(++_0x1a0976);}(_0x3fa0,0x1cd));var _0x03fa=function(_0x4e3c65,_0x35aefe){_0x4e3c65=_0x4e3c65-0x0;var _0x2b5fe3=_0x3fa0[_0x4e3c65];return _0x2b5fe3;};'use strict';var express=require(_0x03fa('0x0'));var router=express[_0x03fa('0x1')]();var auth=require(_0x03fa('0x2'));var interaction=require(_0x03fa('0x3'));var controller=require('./mailInteraction.controller');router[_0x03fa('0x4')]('/',auth[_0x03fa('0x5')](),controller[_0x03fa('0x6')]);router['get'](_0x03fa('0x7'),auth['isAuthenticated'](),controller[_0x03fa('0x8')]);router[_0x03fa('0x4')](_0x03fa('0x9'),auth[_0x03fa('0x5')](),controller['show']);router[_0x03fa('0x4')](_0x03fa('0xa'),auth[_0x03fa('0x5')](),controller[_0x03fa('0xb')]);router['get'](_0x03fa('0xc'),auth[_0x03fa('0x5')](),controller['download']);router[_0x03fa('0xd')]('/',auth[_0x03fa('0x5')](),controller[_0x03fa('0xe')]);router[_0x03fa('0xd')](_0x03fa('0xa'),auth['isAuthenticated'](),controller[_0x03fa('0xf')]);router[_0x03fa('0xd')](_0x03fa('0x10'),auth[_0x03fa('0x5')](),interaction[_0x03fa('0x11')](_0x03fa('0x12'),_0x03fa('0x13')),controller[_0x03fa('0x14')]);router['put']('/:id',auth[_0x03fa('0x5')](),interaction[_0x03fa('0x11')](_0x03fa('0x12'),_0x03fa('0x15')),controller[_0x03fa('0x16')]);router['delete'](_0x03fa('0x9'),auth['isAuthenticated'](),interaction[_0x03fa('0x11')]('mail',_0x03fa('0x17')),controller['destroy']);router[_0x03fa('0x18')](_0x03fa('0x10'),auth[_0x03fa('0x5')](),controller[_0x03fa('0x19')]);module[_0x03fa('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 ac1153f..3b8cef9 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 _0x1000=['sequelize','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','INTEGER'];(function(_0x5986d5,_0x1421fd){var _0x2204f4=function(_0x3bfabe){while(--_0x3bfabe){_0x5986d5['push'](_0x5986d5['shift']());}};_0x2204f4(++_0x1421fd);}(_0x1000,0x6c));var _0x0100=function(_0x3f7120,_0x6e32c4){_0x3f7120=_0x3f7120-0x0;var _0x2e29c3=_0x1000[_0x3f7120];return _0x2e29c3;};'use strict';var Sequelize=require(_0x0100('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x0100('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0100('0x2')]},'disposition':{'type':Sequelize[_0x0100('0x3')]},'secondDisposition':{'type':Sequelize[_0x0100('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0100('0x3')]},'note':{'type':Sequelize[_0x0100('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x0100('0x3')]},'cc':{'type':Sequelize[_0x0100('0x4')](_0x0100('0x5'))},'subject':{'type':Sequelize[_0x0100('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0100('0x2')]},'substatus':{'type':Sequelize[_0x0100('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x0100('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0100('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0100('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0100('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0100('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0100('0x8')]}}; \ No newline at end of file +var _0x8876=['long','DATE','out','ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x8876,0xec));var _0x6887=function(_0x321679,_0x1549d5){_0x321679=_0x321679-0x0;var _0x54ccca=_0x8876[_0x321679];return _0x54ccca;};'use strict';var Sequelize=require(_0x6887('0x0'));var iconv=require(_0x6887('0x1'));module[_0x6887('0x2')]={'closed':{'type':Sequelize[_0x6887('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6887('0x4')]},'secondDisposition':{'type':Sequelize[_0x6887('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6887('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6887('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6887('0x4')]},'cc':{'type':Sequelize[_0x6887('0x5')](_0x6887('0x6'))},'subject':{'type':Sequelize[_0x6887('0x5')]()},'attach':{'type':Sequelize[_0x6887('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x6887('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6887('0x7')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6887('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6887('0x9')]('in',_0x6887('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6887('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8a42ac8..982ee67 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 _0xe3c0=['juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','destroy','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','catch','show','params','model','keys','intersection','attributes','length','merge','find','create','body','describe','MailMessage','addMessage','omit','ids','findOne','filters','fields','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','inlineCss','addTags','Tag','color','emit','mailInteractionTags:save','removeTags','download','root','files','join','attachments','Attachment','from','bcc','createdAt','Messages','get','mkdirSync','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','push','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0xe3c0,0x1b5));var _0x0e3c=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xe3c0[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0x0e3c('0x0'));var rimraf=require(_0x0e3c('0x1'));var zipdir=require(_0x0e3c('0x2'));var moment=require(_0x0e3c('0x3'));var BPromise=require('bluebird');var util=require(_0x0e3c('0x4'));var path=require(_0x0e3c('0x5'));var fs=require('fs');var _=require(_0x0e3c('0x6'));var juice=require(_0x0e3c('0x7'));var Redis=require(_0x0e3c('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x0e3c('0x9'));var logger=require(_0x0e3c('0xa'))(_0x0e3c('0xb'));var config=require(_0x0e3c('0xc'));var db=require(_0x0e3c('0xd'))['db'];var htmlEntities=require(_0x0e3c('0xe'));config[_0x0e3c('0xf')]=_[_0x0e3c('0x10')](config[_0x0e3c('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e3c('0x11'))(new Redis(config['redis']));require(_0x0e3c('0x12'))[_0x0e3c('0x13')](socket);function respondWithStatusCode(_0x529580,_0x1b47b4){_0x1b47b4=_0x1b47b4||0xcc;return function(_0x2fcd9a){if(_0x2fcd9a){return _0x529580[_0x0e3c('0x14')](_0x1b47b4);}return _0x529580[_0x0e3c('0x15')](_0x1b47b4)[_0x0e3c('0x16')]();};}function respondWithResult(_0x547383,_0x3c710e){_0x3c710e=_0x3c710e||0xc8;return function(_0x1d8070){if(_0x1d8070){return _0x547383[_0x0e3c('0x15')](_0x3c710e)['json'](_0x1d8070);}};}function respondWithFilteredResult(_0x10e511,_0x16ddd7){return function(_0x5dab40){if(_0x5dab40){var _0x128eed=typeof _0x16ddd7[_0x0e3c('0x17')]===_0x0e3c('0x18')&&typeof _0x16ddd7[_0x0e3c('0x19')]===_0x0e3c('0x18');var _0xe3f157=_0x5dab40[_0x0e3c('0x1a')];var _0x10e283=_0x128eed?0x0:_0x16ddd7[_0x0e3c('0x17')];var _0x338deb=_0x128eed?_0x5dab40[_0x0e3c('0x1a')]:_0x16ddd7['offset']+_0x16ddd7[_0x0e3c('0x19')];var _0x535a93;if(_0x338deb>=_0xe3f157){_0x338deb=_0xe3f157;_0x535a93=0xc8;}else{_0x535a93=0xce;}_0x10e511['status'](_0x535a93);return _0x10e511[_0x0e3c('0x1b')]('Content-Range',_0x10e283+'-'+_0x338deb+'/'+_0xe3f157)[_0x0e3c('0x1c')](_0x5dab40);}return null;};}function saveUpdates(_0x34303b){return function(_0x1618c9){if(_0x1618c9){return _0x1618c9[_0x0e3c('0x1d')](_0x34303b)[_0x0e3c('0x1e')](function(_0x1c6ed8){return _0x1c6ed8;});}return null;};}function removeEntity(_0x235c42){return function(_0xf53937){if(_0xf53937){return _0xf53937[_0x0e3c('0x1f')]()[_0x0e3c('0x1e')](function(){_0x235c42[_0x0e3c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277d49){return function(_0x368cae){if(!_0x368cae){_0x277d49[_0x0e3c('0x14')](0x194);}return _0x368cae;};}function handleError(_0x737e7,_0x18a908){_0x18a908=_0x18a908||0x1f4;return function(_0x48a7d9){logger[_0x0e3c('0x20')](_0x48a7d9[_0x0e3c('0x21')]);if(_0x48a7d9[_0x0e3c('0x22')]){delete _0x48a7d9[_0x0e3c('0x22')];}_0x737e7[_0x0e3c('0x15')](_0x18a908)[_0x0e3c('0x23')](_0x48a7d9);};}exports[_0x0e3c('0x24')]=function(_0x56b152,_0x114ed4){var _0x49763e={};var _0x14a0e4=_['map'](db[_0x0e3c('0x25')][_0x0e3c('0x26')],function(_0x8f346){return{'name':_0x8f346[_0x0e3c('0x27')],'type':_0x8f346[_0x0e3c('0x28')][_0x0e3c('0x29')]};});_0x49763e=qs[_0x0e3c('0x2a')](_0x14a0e4,_0x56b152);return interaction[_0x0e3c('0x2b')](_0x0e3c('0x2c'),_0x56b152[_0x0e3c('0x2d')],_0x56b152['user'],_0x49763e,_0x14a0e4)[_0x0e3c('0x1e')](respondWithFilteredResult(_0x114ed4,_0x49763e))[_0x0e3c('0x2e')](handleError(_0x114ed4,null));};exports[_0x0e3c('0x2f')]=function(_0x5c40ec,_0x2f50ae){var _0x3cba7a={'raw':![],'where':{'id':_0x5c40ec[_0x0e3c('0x30')]['id']}},_0x344d84={};_0x344d84[_0x0e3c('0x31')]=_[_0x0e3c('0x32')](db[_0x0e3c('0x25')]['rawAttributes']);_0x344d84[_0x0e3c('0x2d')]=_[_0x0e3c('0x32')](_0x5c40ec[_0x0e3c('0x2d')]);_0x344d84['filters']=_[_0x0e3c('0x33')](_0x344d84[_0x0e3c('0x31')],_0x344d84[_0x0e3c('0x2d')]);_0x3cba7a['attributes']=_[_0x0e3c('0x33')](_0x344d84[_0x0e3c('0x31')],qs['fields'](_0x5c40ec['query']['fields']));_0x3cba7a[_0x0e3c('0x34')]=_0x3cba7a[_0x0e3c('0x34')][_0x0e3c('0x35')]?_0x3cba7a[_0x0e3c('0x34')]:_0x344d84[_0x0e3c('0x31')];if(_0x5c40ec[_0x0e3c('0x2d')]['includeAll']){_0x3cba7a['include']=[{'all':!![]}];}_0x3cba7a=_[_0x0e3c('0x36')]({},_0x3cba7a,_0x5c40ec['options']);return db['MailInteraction'][_0x0e3c('0x37')](_0x3cba7a)['then'](handleEntityNotFound(_0x2f50ae,null))[_0x0e3c('0x1e')](respondWithResult(_0x2f50ae,null))['catch'](handleError(_0x2f50ae,null));};exports[_0x0e3c('0x38')]=function(_0x446815,_0x1d861a){return db[_0x0e3c('0x25')][_0x0e3c('0x38')](_0x446815[_0x0e3c('0x39')],{})[_0x0e3c('0x1e')](respondWithResult(_0x1d861a,0xc9))['catch'](handleError(_0x1d861a,null));};exports[_0x0e3c('0x1d')]=function(_0x306921,_0x1ab1bd){if(_0x306921[_0x0e3c('0x39')]['id']){delete _0x306921[_0x0e3c('0x39')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x306921[_0x0e3c('0x30')]['id']}})[_0x0e3c('0x1e')](handleEntityNotFound(_0x1ab1bd,null))[_0x0e3c('0x1e')](saveUpdates(_0x306921[_0x0e3c('0x39')],null))['then'](respondWithResult(_0x1ab1bd,null))['catch'](handleError(_0x1ab1bd,null));};exports[_0x0e3c('0x1f')]=function(_0x41e8a4,_0x4e4e08){return db['MailInteraction'][_0x0e3c('0x37')]({'where':{'id':_0x41e8a4[_0x0e3c('0x30')]['id']}})['then'](handleEntityNotFound(_0x4e4e08,null))['then'](removeEntity(_0x4e4e08,null))[_0x0e3c('0x2e')](handleError(_0x4e4e08,null));};exports[_0x0e3c('0x3a')]=function(_0x29c12a,_0x193f29){return db[_0x0e3c('0x25')][_0x0e3c('0x3a')]()[_0x0e3c('0x1e')](respondWithResult(_0x193f29,null))[_0x0e3c('0x2e')](handleError(_0x193f29,null));};exports['addMessage']=function(_0x587cbb,_0x405132){return db[_0x0e3c('0x3b')][_0x0e3c('0x37')]({'where':{'id':_0x587cbb[_0x0e3c('0x30')]['id']}})[_0x0e3c('0x1e')](handleEntityNotFound(_0x405132,null))[_0x0e3c('0x1e')](function(_0x652e9f){if(_0x652e9f){return _0x652e9f[_0x0e3c('0x3c')](_0x587cbb['body']['ids'],_[_0x0e3c('0x3d')](_0x587cbb[_0x0e3c('0x39')],[_0x0e3c('0x3e'),'id'])||{});}})[_0x0e3c('0x1e')](respondWithResult(_0x405132,null))[_0x0e3c('0x2e')](handleError(_0x405132,null));};exports['getMessages']=function(_0x57a021,_0x350896){var _0x28a994={'raw':![],'where':{}};var _0x4fab80={};var _0x40a8e1={'count':0x0,'rows':[]};return db[_0x0e3c('0x25')][_0x0e3c('0x3f')]({'where':{'id':_0x57a021[_0x0e3c('0x30')]['id']}})[_0x0e3c('0x1e')](handleEntityNotFound(_0x350896,null))[_0x0e3c('0x1e')](function(_0x25276a){if(_0x25276a){_0x4fab80[_0x0e3c('0x31')]=_[_0x0e3c('0x32')](db[_0x0e3c('0x3b')]['rawAttributes']);_0x4fab80[_0x0e3c('0x2d')]=_[_0x0e3c('0x32')](_0x57a021[_0x0e3c('0x2d')]);_0x4fab80[_0x0e3c('0x40')]=_['intersection'](_0x4fab80[_0x0e3c('0x31')],_0x4fab80[_0x0e3c('0x2d')]);_0x28a994['attributes']=_[_0x0e3c('0x33')](_0x4fab80[_0x0e3c('0x31')],qs[_0x0e3c('0x41')](_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x41')]));_0x28a994[_0x0e3c('0x34')]=_0x28a994[_0x0e3c('0x34')][_0x0e3c('0x35')]?_0x28a994[_0x0e3c('0x34')]:_0x4fab80[_0x0e3c('0x31')];if(!_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x42')](_0x0e3c('0x43'))){_0x28a994[_0x0e3c('0x19')]=qs['limit'](_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x19')]);_0x28a994[_0x0e3c('0x17')]=qs['offset'](_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x17')]);}_0x28a994[_0x0e3c('0x44')]=qs['sort'](_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x45')]);_0x28a994[_0x0e3c('0x46')]=qs[_0x0e3c('0x40')](_[_0x0e3c('0x47')](_0x57a021['query'],_0x4fab80[_0x0e3c('0x40')]));_0x28a994[_0x0e3c('0x46')][_0x0e3c('0x48')]=_0x25276a['id'];if(_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x49')]){_0x28a994[_0x0e3c('0x46')]=_[_0x0e3c('0x36')](_0x28a994[_0x0e3c('0x46')],{'$or':_[_0x0e3c('0x4a')](_0x28a994['attributes'],function(_0x2375e3){var _0x5d0a2c={};_0x5d0a2c[_0x2375e3]={'$like':'%'+_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x49')]+'%'};return _0x5d0a2c;})});}if(_0x57a021['query'][_0x0e3c('0x4b')]){var _0x5d9b2f=_0x57a021[_0x0e3c('0x2d')]['$gte'][_0x0e3c('0x4c')](',');var _0x522a81={};_0x522a81[_0x5d9b2f[0x0]]={'$gte':moment(_0x5d9b2f[0x1])[_0x0e3c('0x4d')](_0x0e3c('0x4e'))};_0x28a994[_0x0e3c('0x46')]=_['merge'](_0x28a994[_0x0e3c('0x46')],_0x522a81);}_0x28a994=_['merge']({},_0x28a994,_0x57a021[_0x0e3c('0x4f')]);return db[_0x0e3c('0x3b')][_0x0e3c('0x1a')]({'where':_0x28a994['where']})['then'](function(_0x5a216a){_0x40a8e1[_0x0e3c('0x1a')]=_0x5a216a;if(_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x50')]){_0x28a994['include']=[{'all':!![]}];}return db[_0x0e3c('0x3b')][_0x0e3c('0x2b')](_0x28a994);})['then'](function(_0x2e1255){if(_0x57a021[_0x0e3c('0x2d')][_0x0e3c('0x51')]==='true'){for(var _0x1c52f9=0x0;_0x1c52f9<_0x2e1255['length'];_0x1c52f9++){_0x2e1255[_0x1c52f9][_0x0e3c('0x39')]=juice(_0x2e1255[_0x1c52f9]['body']);}}_0x40a8e1['rows']=_0x2e1255;return _0x40a8e1;});}})[_0x0e3c('0x1e')](respondWithFilteredResult(_0x350896,_0x28a994))[_0x0e3c('0x2e')](handleError(_0x350896,null));};exports[_0x0e3c('0x52')]=function(_0x7bdf3d,_0x176f9d){return db[_0x0e3c('0x25')][_0x0e3c('0x37')]({'where':{'id':_0x7bdf3d[_0x0e3c('0x30')]['id']}})[_0x0e3c('0x1e')](handleEntityNotFound(_0x176f9d,null))['then'](function(_0xec2cbb){if(_0xec2cbb){return _0xec2cbb['setTags'](_0x7bdf3d['body'][_0x0e3c('0x3e')],_[_0x0e3c('0x3d')](_0x7bdf3d['body'],[_0x0e3c('0x3e'),'id'])||{})['spread'](function(){return db[_0x0e3c('0x53')][_0x0e3c('0x2b')]({'attributes':['id','name',_0x0e3c('0x54')],'where':{'id':_0x7bdf3d[_0x0e3c('0x39')][_0x0e3c('0x3e')]}});})[_0x0e3c('0x1e')](function(_0x11a806){socket[_0x0e3c('0x55')](_0x0e3c('0x56'),{'id':Number(_0x7bdf3d[_0x0e3c('0x30')]['id']),'tags':_0x11a806||[]});return{'id':Number(_0x7bdf3d[_0x0e3c('0x30')]['id']),'tags':_0x11a806||[]};});}})[_0x0e3c('0x1e')](respondWithResult(_0x176f9d,null))['catch'](handleError(_0x176f9d,null));};exports[_0x0e3c('0x57')]=function(_0x590242,_0x6a5046){return db[_0x0e3c('0x25')][_0x0e3c('0x37')]({'where':{'id':_0x590242['params']['id']}})[_0x0e3c('0x1e')](handleEntityNotFound(_0x6a5046,null))['then'](function(_0x4b5c69){if(_0x4b5c69){return _0x4b5c69[_0x0e3c('0x57')](_0x590242[_0x0e3c('0x2d')][_0x0e3c('0x3e')]);}})[_0x0e3c('0x1e')](respondWithStatusCode(_0x6a5046,null))['catch'](handleError(_0x6a5046,null));};exports[_0x0e3c('0x58')]=function(_0x20ca2c,_0x49a50d){var _0xe7761b=moment()['unix']()['toString']();var _0x1e0067=path['join'](config[_0x0e3c('0x59')],'server',_0x0e3c('0x5a'),'tmp');var _0x1b47e9=path[_0x0e3c('0x5b')](config[_0x0e3c('0x59')],'server','files','attachments');var _0xc69978=path[_0x0e3c('0x5b')](_0x1e0067,_0xe7761b);var _0x568990=util[_0x0e3c('0x4d')]('transcript-%d-%s.zip',_0x20ca2c[_0x0e3c('0x30')]['id'],_0xe7761b);var _0x1743bd=path[_0x0e3c('0x5b')](_0x1e0067,_0x568990);var _0x311022=[];if(_0x20ca2c[_0x0e3c('0x2d')][_0x0e3c('0x5c')]){_0x311022['push']({'model':db[_0x0e3c('0x5d')],'as':'Attachments','raw':!![]});}var _0x3968f0=[{'model':db[_0x0e3c('0x3b')],'as':'Messages','attributes':['id',_0x0e3c('0x39'),_0x0e3c('0x5e'),'to','cc',_0x0e3c('0x5f'),'subject',_0x0e3c('0x60')],'where':{'secret':![]},'order':qs[_0x0e3c('0x45')]('id'),'include':_0x311022}];return db[_0x0e3c('0x25')][_0x0e3c('0x37')]({'where':{'id':_0x20ca2c[_0x0e3c('0x30')]['id']},'include':_0x3968f0})['then'](handleEntityNotFound(_0x49a50d,null))[_0x0e3c('0x1e')](function(_0x368eb2){if(_0x368eb2&&_0x368eb2[_0x0e3c('0x61')]){var _0x38813d=_0x368eb2[_0x0e3c('0x62')]({'plain':!![]});fs[_0x0e3c('0x63')](_0xc69978);return BPromise['each'](_0x38813d[_0x0e3c('0x61')],function(_0x2c8f44,_0x213e8c){var _0x34d52e={'from':_0x2c8f44[_0x0e3c('0x5e')],'to':_0x2c8f44['to']||'missing.recipient@your.company.com','subject':_0x2c8f44[_0x0e3c('0x64')],'html':htmlEntities['decode'](_0x2c8f44[_0x0e3c('0x39')]),'headers':{'Date':moment(_0x2c8f44[_0x0e3c('0x60')])[_0x0e3c('0x4d')](_0x0e3c('0x65'))},'attachments':[]};if(_0x2c8f44['cc']){_0x34d52e[_0x0e3c('0x66')]['Cc']=_0x2c8f44['cc'];}if(_0x2c8f44[_0x0e3c('0x5f')]){_0x34d52e[_0x0e3c('0x66')][_0x0e3c('0x67')]=_0x2c8f44[_0x0e3c('0x5f')];}return new BPromise(function(_0x368680,_0x5b259d){if(_0x2c8f44[_0x0e3c('0x68')]){for(var _0x3a814d=0x0;_0x3a814d<_0x2c8f44[_0x0e3c('0x68')][_0x0e3c('0x35')];_0x3a814d++){var _0x3622ff=_0x2c8f44[_0x0e3c('0x68')][_0x3a814d];var _0x1f585e=path[_0x0e3c('0x5b')](_0x1b47e9,_0x3622ff['basename']);if(fs['existsSync'](_0x1f585e)){_0x34d52e[_0x0e3c('0x5c')][_0x0e3c('0x69')]({'name':_0x3622ff[_0x0e3c('0x22')],'contentType':_0x3622ff['type'],'data':fs[_0x0e3c('0x6a')](_0x1f585e)});}}}emlformat[_0x0e3c('0x6b')](_0x34d52e,function(_0x32d10e,_0x524ff1){if(_0x32d10e)return _0x5b259d(_0x32d10e);fs[_0x0e3c('0x6c')](path[_0x0e3c('0x5b')](_0xc69978,util[_0x0e3c('0x4d')](_0x0e3c('0x6d'),_0x213e8c)),_0x524ff1);return _0x368680(_0x524ff1);});});})[_0x0e3c('0x1e')](function(){return new BPromise(function(_0x170485,_0x595d41){zipdir(_0xc69978,{'saveTo':_0x1743bd},function(_0x54da45,_0xbb99a8){if(_0x54da45)return _0x595d41(_0x54da45);return _0x170485(_0xbb99a8);});})[_0x0e3c('0x1e')](function(){return new BPromise(function(_0x3026f7,_0x1fb2ec){rimraf(_0xc69978,function(_0x1a1d0c){if(_0x1a1d0c)_0x1fb2ec(_0x1a1d0c);return _0x3026f7();});});})['then'](function(){return _0x49a50d['download'](_0x1743bd,_0x568990,function(_0xc4e56e){if(!_0xc4e56e)fs[_0x0e3c('0x6e')](_0x1743bd);});});});}else{return _0x49a50d[_0x0e3c('0x14')](0xc8);}})[_0x0e3c('0x2e')](handleError(_0x49a50d,null));}; \ No newline at end of file +var _0x78d8=['format','push','Messages','from','bcc','subject','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','path','lodash','juice','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','status','end','sendStatus','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','user','catch','params','keys','filters','intersection','attributes','model','length','includeAll','include','options','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','fields','hasOwnProperty','nolimit','sort','where','filter','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','rows','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','join','files','attachments'];(function(_0x148086,_0xc3acf6){var _0x5a1173=function(_0x1d21b6){while(--_0x1d21b6){_0x148086['push'](_0x148086['shift']());}};_0x5a1173(++_0xc3acf6);}(_0x78d8,0x16a));var _0x878d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x78d8[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x878d('0x0'));var rimraf=require(_0x878d('0x1'));var zipdir=require(_0x878d('0x2'));var moment=require(_0x878d('0x3'));var BPromise=require('bluebird');var util=require(_0x878d('0x4'));var path=require(_0x878d('0x5'));var fs=require('fs');var _=require(_0x878d('0x6'));var juice=require(_0x878d('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x878d('0x8'))('api');var config=require(_0x878d('0x9'));var db=require(_0x878d('0xa'))['db'];var htmlEntities=require(_0x878d('0xb'));config[_0x878d('0xc')]=_[_0x878d('0xd')](config['redis'],{'host':_0x878d('0xe'),'port':0x18eb});var socket=require(_0x878d('0xf'))(new Redis(config['redis']));require(_0x878d('0x10'))[_0x878d('0x11')](socket);function respondWithStatusCode(_0x5ae1d5,_0x1dcb6a){_0x1dcb6a=_0x1dcb6a||0xcc;return function(_0xd8623){if(_0xd8623){return _0x5ae1d5['sendStatus'](_0x1dcb6a);}return _0x5ae1d5['status'](_0x1dcb6a)['end']();};}function respondWithResult(_0x5e760c,_0x41c559){_0x41c559=_0x41c559||0xc8;return function(_0x2a0027){if(_0x2a0027){return _0x5e760c['status'](_0x41c559)[_0x878d('0x12')](_0x2a0027);}};}function respondWithFilteredResult(_0x2bc91f,_0x2d6417){return function(_0x154ae3){if(_0x154ae3){var _0x34048c=typeof _0x2d6417['offset']===_0x878d('0x13')&&typeof _0x2d6417[_0x878d('0x14')]==='undefined';var _0x5d8fcc=_0x154ae3[_0x878d('0x15')];var _0x4211d0=_0x34048c?0x0:_0x2d6417[_0x878d('0x16')];var _0x784a5e=_0x34048c?_0x154ae3[_0x878d('0x15')]:_0x2d6417[_0x878d('0x16')]+_0x2d6417['limit'];var _0x59b719;if(_0x784a5e>=_0x5d8fcc){_0x784a5e=_0x5d8fcc;_0x59b719=0xc8;}else{_0x59b719=0xce;}_0x2bc91f['status'](_0x59b719);return _0x2bc91f[_0x878d('0x17')](_0x878d('0x18'),_0x4211d0+'-'+_0x784a5e+'/'+_0x5d8fcc)[_0x878d('0x12')](_0x154ae3);}return null;};}function saveUpdates(_0x350aa7){return function(_0x3c3551){if(_0x3c3551){return _0x3c3551[_0x878d('0x19')](_0x350aa7)[_0x878d('0x1a')](function(_0x2b5d6e){return _0x2b5d6e;});}return null;};}function removeEntity(_0x29e862){return function(_0x5b6070){if(_0x5b6070){return _0x5b6070[_0x878d('0x1b')]()[_0x878d('0x1a')](function(){_0x29e862[_0x878d('0x1c')](0xcc)[_0x878d('0x1d')]();});}};}function handleEntityNotFound(_0x42d4c6){return function(_0x41d663){if(!_0x41d663){_0x42d4c6[_0x878d('0x1e')](0x194);}return _0x41d663;};}function handleError(_0x57f88a,_0x50c9c3){_0x50c9c3=_0x50c9c3||0x1f4;return function(_0x1d21e0){logger[_0x878d('0x1f')](_0x1d21e0[_0x878d('0x20')]);if(_0x1d21e0[_0x878d('0x21')]){delete _0x1d21e0[_0x878d('0x21')];}_0x57f88a[_0x878d('0x1c')](_0x50c9c3)[_0x878d('0x22')](_0x1d21e0);};}exports[_0x878d('0x23')]=function(_0x3bcfe6,_0xe70533){var _0x233252={};var _0xb5a26b=_[_0x878d('0x24')](db[_0x878d('0x25')][_0x878d('0x26')],function(_0x181f67){return{'name':_0x181f67[_0x878d('0x27')],'type':_0x181f67[_0x878d('0x28')][_0x878d('0x29')]};});_0x233252=qs[_0x878d('0x2a')](_0xb5a26b,_0x3bcfe6);return interaction[_0x878d('0x2b')](_0x878d('0x2c'),_0x3bcfe6[_0x878d('0x2d')],_0x3bcfe6[_0x878d('0x2e')],_0x233252,_0xb5a26b)[_0x878d('0x1a')](respondWithFilteredResult(_0xe70533,_0x233252))[_0x878d('0x2f')](handleError(_0xe70533,null));};exports['show']=function(_0x41ea3d,_0x4faa21){var _0x3ec798={'raw':![],'where':{'id':_0x41ea3d[_0x878d('0x30')]['id']}},_0x1ec0c1={};_0x1ec0c1['model']=_[_0x878d('0x31')](db[_0x878d('0x25')]['rawAttributes']);_0x1ec0c1[_0x878d('0x2d')]=_['keys'](_0x41ea3d['query']);_0x1ec0c1[_0x878d('0x32')]=_[_0x878d('0x33')](_0x1ec0c1['model'],_0x1ec0c1[_0x878d('0x2d')]);_0x3ec798[_0x878d('0x34')]=_['intersection'](_0x1ec0c1[_0x878d('0x35')],qs['fields'](_0x41ea3d[_0x878d('0x2d')]['fields']));_0x3ec798['attributes']=_0x3ec798[_0x878d('0x34')][_0x878d('0x36')]?_0x3ec798['attributes']:_0x1ec0c1[_0x878d('0x35')];if(_0x41ea3d[_0x878d('0x2d')][_0x878d('0x37')]){_0x3ec798[_0x878d('0x38')]=[{'all':!![]}];}_0x3ec798=_['merge']({},_0x3ec798,_0x41ea3d[_0x878d('0x39')]);return db[_0x878d('0x25')]['find'](_0x3ec798)[_0x878d('0x1a')](handleEntityNotFound(_0x4faa21,null))[_0x878d('0x1a')](respondWithResult(_0x4faa21,null))[_0x878d('0x2f')](handleError(_0x4faa21,null));};exports[_0x878d('0x3a')]=function(_0x51f3ca,_0x2f77bc){return db[_0x878d('0x25')][_0x878d('0x3a')](_0x51f3ca[_0x878d('0x3b')],{})[_0x878d('0x1a')](respondWithResult(_0x2f77bc,0xc9))[_0x878d('0x2f')](handleError(_0x2f77bc,null));};exports[_0x878d('0x19')]=function(_0x1c6af9,_0x25c66c){if(_0x1c6af9[_0x878d('0x3b')]['id']){delete _0x1c6af9[_0x878d('0x3b')]['id'];}return db[_0x878d('0x25')][_0x878d('0x3c')]({'where':{'id':_0x1c6af9[_0x878d('0x30')]['id']}})['then'](handleEntityNotFound(_0x25c66c,null))[_0x878d('0x1a')](saveUpdates(_0x1c6af9[_0x878d('0x3b')],null))['then'](respondWithResult(_0x25c66c,null))['catch'](handleError(_0x25c66c,null));};exports[_0x878d('0x1b')]=function(_0x1609d9,_0x508813){return db[_0x878d('0x25')][_0x878d('0x3c')]({'where':{'id':_0x1609d9[_0x878d('0x30')]['id']}})[_0x878d('0x1a')](handleEntityNotFound(_0x508813,null))[_0x878d('0x1a')](removeEntity(_0x508813,null))['catch'](handleError(_0x508813,null));};exports['describe']=function(_0x51187f,_0x5ba95b){return db[_0x878d('0x25')][_0x878d('0x3d')]()[_0x878d('0x1a')](respondWithResult(_0x5ba95b,null))[_0x878d('0x2f')](handleError(_0x5ba95b,null));};exports[_0x878d('0x3e')]=function(_0x366a52,_0x48c3b7){return db['MailMessage']['find']({'where':{'id':_0x366a52['params']['id']}})[_0x878d('0x1a')](handleEntityNotFound(_0x48c3b7,null))[_0x878d('0x1a')](function(_0x2ce47e){if(_0x2ce47e){return _0x2ce47e[_0x878d('0x3e')](_0x366a52[_0x878d('0x3b')][_0x878d('0x3f')],_[_0x878d('0x40')](_0x366a52['body'],[_0x878d('0x3f'),'id'])||{});}})[_0x878d('0x1a')](respondWithResult(_0x48c3b7,null))['catch'](handleError(_0x48c3b7,null));};exports[_0x878d('0x41')]=function(_0x59d76c,_0x441f6e){var _0x5a9569={'raw':![],'where':{}};var _0x29201a={};var _0x545c84={'count':0x0,'rows':[]};return db[_0x878d('0x25')][_0x878d('0x42')]({'where':{'id':_0x59d76c[_0x878d('0x30')]['id']}})[_0x878d('0x1a')](handleEntityNotFound(_0x441f6e,null))[_0x878d('0x1a')](function(_0x2603f5){if(_0x2603f5){_0x29201a[_0x878d('0x35')]=_[_0x878d('0x31')](db['MailMessage']['rawAttributes']);_0x29201a[_0x878d('0x2d')]=_['keys'](_0x59d76c[_0x878d('0x2d')]);_0x29201a[_0x878d('0x32')]=_[_0x878d('0x33')](_0x29201a[_0x878d('0x35')],_0x29201a[_0x878d('0x2d')]);_0x5a9569[_0x878d('0x34')]=_[_0x878d('0x33')](_0x29201a['model'],qs[_0x878d('0x43')](_0x59d76c[_0x878d('0x2d')][_0x878d('0x43')]));_0x5a9569[_0x878d('0x34')]=_0x5a9569[_0x878d('0x34')][_0x878d('0x36')]?_0x5a9569[_0x878d('0x34')]:_0x29201a[_0x878d('0x35')];if(!_0x59d76c['query'][_0x878d('0x44')](_0x878d('0x45'))){_0x5a9569[_0x878d('0x14')]=qs[_0x878d('0x14')](_0x59d76c[_0x878d('0x2d')][_0x878d('0x14')]);_0x5a9569[_0x878d('0x16')]=qs[_0x878d('0x16')](_0x59d76c[_0x878d('0x2d')][_0x878d('0x16')]);}_0x5a9569['order']=qs[_0x878d('0x46')](_0x59d76c['query']['sort']);_0x5a9569[_0x878d('0x47')]=qs[_0x878d('0x32')](_['pick'](_0x59d76c[_0x878d('0x2d')],_0x29201a[_0x878d('0x32')]));_0x5a9569[_0x878d('0x47')]['MailInteractionId']=_0x2603f5['id'];if(_0x59d76c['query'][_0x878d('0x48')]){_0x5a9569[_0x878d('0x47')]=_[_0x878d('0x49')](_0x5a9569[_0x878d('0x47')],{'$or':_[_0x878d('0x24')](_0x5a9569[_0x878d('0x34')],function(_0x1cdedb){var _0x47c8fc={};_0x47c8fc[_0x1cdedb]={'$like':'%'+_0x59d76c[_0x878d('0x2d')][_0x878d('0x48')]+'%'};return _0x47c8fc;})});}if(_0x59d76c[_0x878d('0x2d')][_0x878d('0x4a')]){var _0x1b4516=_0x59d76c['query']['$gte']['split'](',');var _0x4e727a={};_0x4e727a[_0x1b4516[0x0]]={'$gte':moment(_0x1b4516[0x1])['format'](_0x878d('0x4b'))};_0x5a9569[_0x878d('0x47')]=_[_0x878d('0x49')](_0x5a9569[_0x878d('0x47')],_0x4e727a);}_0x5a9569=_[_0x878d('0x49')]({},_0x5a9569,_0x59d76c[_0x878d('0x39')]);return db[_0x878d('0x4c')][_0x878d('0x15')]({'where':_0x5a9569[_0x878d('0x47')]})[_0x878d('0x1a')](function(_0x5c0b41){_0x545c84[_0x878d('0x15')]=_0x5c0b41;if(_0x59d76c[_0x878d('0x2d')][_0x878d('0x37')]){_0x5a9569[_0x878d('0x38')]=[{'all':!![]}];}return db[_0x878d('0x4c')][_0x878d('0x2b')](_0x5a9569);})[_0x878d('0x1a')](function(_0x341415){if(_0x59d76c[_0x878d('0x2d')][_0x878d('0x4d')]===_0x878d('0x4e')){for(var _0x47c3ab=0x0;_0x47c3ab<_0x341415[_0x878d('0x36')];_0x47c3ab++){_0x341415[_0x47c3ab][_0x878d('0x3b')]=juice(_0x341415[_0x47c3ab][_0x878d('0x3b')]);}}_0x545c84[_0x878d('0x4f')]=_0x341415;return _0x545c84;});}})[_0x878d('0x1a')](respondWithFilteredResult(_0x441f6e,_0x5a9569))[_0x878d('0x2f')](handleError(_0x441f6e,null));};exports['addTags']=function(_0x1df06c,_0x79bf1d){return db[_0x878d('0x25')]['find']({'where':{'id':_0x1df06c['params']['id']}})[_0x878d('0x1a')](handleEntityNotFound(_0x79bf1d,null))['then'](function(_0x585fce){if(_0x585fce){return _0x585fce['setTags'](_0x1df06c[_0x878d('0x3b')][_0x878d('0x3f')],_[_0x878d('0x40')](_0x1df06c[_0x878d('0x3b')],[_0x878d('0x3f'),'id'])||{})['spread'](function(){return db[_0x878d('0x50')][_0x878d('0x2b')]({'attributes':['id',_0x878d('0x21'),_0x878d('0x51')],'where':{'id':_0x1df06c[_0x878d('0x3b')][_0x878d('0x3f')]}});})[_0x878d('0x1a')](function(_0x44bb53){socket[_0x878d('0x52')](_0x878d('0x53'),{'id':Number(_0x1df06c[_0x878d('0x30')]['id']),'tags':_0x44bb53||[]});return{'id':Number(_0x1df06c[_0x878d('0x30')]['id']),'tags':_0x44bb53||[]};});}})[_0x878d('0x1a')](respondWithResult(_0x79bf1d,null))['catch'](handleError(_0x79bf1d,null));};exports[_0x878d('0x54')]=function(_0x3b9561,_0x2e5863){return db[_0x878d('0x25')][_0x878d('0x3c')]({'where':{'id':_0x3b9561['params']['id']}})['then'](handleEntityNotFound(_0x2e5863,null))['then'](function(_0x52f351){if(_0x52f351){return _0x52f351[_0x878d('0x54')](_0x3b9561[_0x878d('0x2d')][_0x878d('0x3f')]);}})[_0x878d('0x1a')](respondWithStatusCode(_0x2e5863,null))[_0x878d('0x2f')](handleError(_0x2e5863,null));};exports[_0x878d('0x55')]=function(_0xa163e7,_0x515537){var _0x34fe8a=moment()[_0x878d('0x56')]()[_0x878d('0x57')]();var _0x59a020=path['join'](config[_0x878d('0x58')],_0x878d('0x59'),'files',_0x878d('0x5a'));var _0x450f3e=path[_0x878d('0x5b')](config[_0x878d('0x58')],_0x878d('0x59'),_0x878d('0x5c'),_0x878d('0x5d'));var _0x109a12=path[_0x878d('0x5b')](_0x59a020,_0x34fe8a);var _0x291a95=util[_0x878d('0x5e')]('transcript-%d-%s.zip',_0xa163e7[_0x878d('0x30')]['id'],_0x34fe8a);var _0x170695=path[_0x878d('0x5b')](_0x59a020,_0x291a95);var _0x1734cc=[];if(_0xa163e7[_0x878d('0x2d')][_0x878d('0x5d')]){_0x1734cc[_0x878d('0x5f')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0xbb0b8c=[{'model':db[_0x878d('0x4c')],'as':_0x878d('0x60'),'attributes':['id','body',_0x878d('0x61'),'to','cc',_0x878d('0x62'),_0x878d('0x63'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1734cc}];return db[_0x878d('0x25')][_0x878d('0x3c')]({'where':{'id':_0xa163e7[_0x878d('0x30')]['id']},'include':_0xbb0b8c})[_0x878d('0x1a')](handleEntityNotFound(_0x515537,null))[_0x878d('0x1a')](function(_0x508043){if(_0x508043&&_0x508043[_0x878d('0x60')]){var _0x1da41e=_0x508043[_0x878d('0x64')]({'plain':!![]});fs['mkdirSync'](_0x109a12);return BPromise[_0x878d('0x65')](_0x1da41e[_0x878d('0x60')],function(_0x36a3be,_0x342436){var _0x3e431c={'from':_0x36a3be['from'],'to':_0x36a3be['to']||_0x878d('0x66'),'subject':_0x36a3be[_0x878d('0x63')],'html':htmlEntities[_0x878d('0x67')](_0x36a3be['body']),'headers':{'Date':moment(_0x36a3be['createdAt'])[_0x878d('0x5e')](_0x878d('0x68'))},'attachments':[]};if(_0x36a3be['cc']){_0x3e431c[_0x878d('0x69')]['Cc']=_0x36a3be['cc'];}if(_0x36a3be[_0x878d('0x62')]){_0x3e431c[_0x878d('0x69')][_0x878d('0x6a')]=_0x36a3be[_0x878d('0x62')];}return new BPromise(function(_0x5b9ef7,_0x34cf99){if(_0x36a3be[_0x878d('0x6b')]){for(var _0x53090b=0x0;_0x53090b<_0x36a3be['Attachments'][_0x878d('0x36')];_0x53090b++){var _0x367003=_0x36a3be[_0x878d('0x6b')][_0x53090b];var _0x3ef8b1=path[_0x878d('0x5b')](_0x450f3e,_0x367003['basename']);if(fs[_0x878d('0x6c')](_0x3ef8b1)){_0x3e431c[_0x878d('0x5d')][_0x878d('0x5f')]({'name':_0x367003['name'],'contentType':_0x367003[_0x878d('0x28')],'data':fs[_0x878d('0x6d')](_0x3ef8b1)});}}}emlformat[_0x878d('0x6e')](_0x3e431c,function(_0x509f47,_0x225419){if(_0x509f47)return _0x34cf99(_0x509f47);fs[_0x878d('0x6f')](path[_0x878d('0x5b')](_0x109a12,util[_0x878d('0x5e')](_0x878d('0x70'),_0x342436)),_0x225419);return _0x5b9ef7(_0x225419);});});})[_0x878d('0x1a')](function(){return new BPromise(function(_0x127ab1,_0x341c0b){zipdir(_0x109a12,{'saveTo':_0x170695},function(_0x41969a,_0x50ad21){if(_0x41969a)return _0x341c0b(_0x41969a);return _0x127ab1(_0x50ad21);});})[_0x878d('0x1a')](function(){return new BPromise(function(_0x56d042,_0x17cd64){rimraf(_0x109a12,function(_0x579cd4){if(_0x579cd4)_0x17cd64(_0x579cd4);return _0x56d042();});});})[_0x878d('0x1a')](function(){return _0x515537[_0x878d('0x55')](_0x170695,_0x291a95,function(_0x3c2f93){if(!_0x3c2f93)fs[_0x878d('0x71')](_0x170695);});});});}else{return _0x515537[_0x878d('0x1e')](0xc8);}})['catch'](handleError(_0x515537,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 7668e2d..89ee338 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 _0x7b1b=['exports','events','MailInteraction','MailMessage','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x7b1b,0xa1));var _0xb7b1=function(_0x5dd6a0,_0x5745e3){_0x5dd6a0=_0x5dd6a0-0x0;var _0x4bfbff=_0x7b1b[_0x5dd6a0];return _0x4bfbff;};'use strict';var EventEmitter=require(_0xb7b1('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xb7b1('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xb7b1('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb7b1('0x3'),'afterUpdate':'update','afterDestroy':_0xb7b1('0x4')};function emitEvent(_0x511c98){return function(_0x5cf423,_0x4ab2cb,_0x4fb22d){_0x5cf423['getUsers']({'attributes':['id'],'raw':!![]})[_0xb7b1('0x5')](function(_0x2b4fef){_0x5cf423[_0xb7b1('0x6')](_0xb7b1('0x7'),_0x2b4fef[_0xb7b1('0x8')](function(_0x3d16f9){return{'id':_0x3d16f9['id']};}));return MailMessage[_0xb7b1('0x9')]({'where':{'MailInteractionId':_0x5cf423['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb7b1('0x5')](function(_0x33b890){_0x5cf423[_0xb7b1('0x6')](_0xb7b1('0xa'),_0x33b890['length']);MailInteractionEvents[_0xb7b1('0xb')](_0x511c98+':'+_0x5cf423['id'],_0x5cf423);MailInteractionEvents[_0xb7b1('0xb')](_0x511c98,_0x5cf423);_0x4fb22d(null);})[_0xb7b1('0xc')](_0x4fb22d(null));};}for(var e in events){if(events[_0xb7b1('0xd')](e)){var event=events[e];MailInteraction[_0xb7b1('0xe')](e,emitEvent(event));}}module[_0xb7b1('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x11d8=['length','emit','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','update','remove','getUsers','then','Users','map','setDataValue'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x11d8,0x145));var _0x811d=function(_0x28e4ec,_0x22f691){_0x28e4ec=_0x28e4ec-0x0;var _0x161a64=_0x11d8[_0x28e4ec];return _0x161a64;};'use strict';var EventEmitter=require(_0x811d('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x811d('0x1')];var MailMessage=require(_0x811d('0x2'))['db'][_0x811d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x811d('0x4'),'afterDestroy':_0x811d('0x5')};function emitEvent(_0x3d696a){return function(_0x1d265f,_0x41e100,_0x1e7850){_0x1d265f[_0x811d('0x6')]({'attributes':['id'],'raw':!![]})[_0x811d('0x7')](function(_0x1d0aa9){_0x1d265f['setDataValue'](_0x811d('0x8'),_0x1d0aa9[_0x811d('0x9')](function(_0x14a39a){return{'id':_0x14a39a['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1d265f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x811d('0x7')](function(_0x52dc9d){_0x1d265f[_0x811d('0xa')]('unreadMessages',_0x52dc9d[_0x811d('0xb')]);MailInteractionEvents[_0x811d('0xc')](_0x3d696a+':'+_0x1d265f['id'],_0x1d265f);MailInteractionEvents[_0x811d('0xc')](_0x3d696a,_0x1d265f);_0x1e7850(null);})['catch'](_0x1e7850(null));};}for(var e in events){if(events[_0x811d('0xd')](e)){var event=events[e];MailInteraction[_0x811d('0xe')](e,emitEvent(event));}}module[_0x811d('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 166b187..2f4c39d 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 _0xb25d=['MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','models','get'];(function(_0x13b3b5,_0x52d8d8){var _0x337cd0=function(_0x31fbdf){while(--_0x31fbdf){_0x13b3b5['push'](_0x13b3b5['shift']());}};_0x337cd0(++_0x52d8d8);}(_0xb25d,0x132));var _0xdb25=function(_0x58da9c,_0x109e4c){_0x58da9c=_0x58da9c-0x0;var _0x3916c7=_0xb25d[_0x58da9c];return _0x3916c7;};'use strict';var _=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var logger=require(_0xdb25('0x2'))(_0xdb25('0x3'));var moment=require('moment');var BPromise=require(_0xdb25('0x4'));var rp=require(_0xdb25('0x5'));var fs=require('fs');var path=require(_0xdb25('0x6'));var rimraf=require(_0xdb25('0x7'));var config=require(_0xdb25('0x8'));var attributes=require(_0xdb25('0x9'));module['exports']=function(_0x428709,_0x5f3645){return _0x428709[_0xdb25('0xa')](_0xdb25('0xb'),attributes,{'tableName':_0xdb25('0xc'),'paranoid':![],'indexes':[{'name':_0xdb25('0xd'),'fields':[_0xdb25('0xe'),'to'],'type':_0xdb25('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x342724,_0x50724a,_0x39f8de){if(_0x342724[_0xdb25('0x10')]){_0x342724[_0xdb25('0x11')]=moment()[_0xdb25('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x342724[_0xdb25('0x13')]){_0x342724[_0xdb25('0x14')]=moment()['format'](_0xdb25('0x15'));}_0x39f8de(null,_0x50724a);},'beforeUpdate':function(_0x148a6c,_0x411a71,_0x2a1d56){if(_0x148a6c['changed'](_0xdb25('0x10'))){_0x148a6c[_0xdb25('0x11')]=_0x148a6c[_0xdb25('0x10')]?moment()[_0xdb25('0x12')](_0xdb25('0x15')):null;}if(_0x148a6c['changed'](_0xdb25('0x13'))){_0x148a6c[_0xdb25('0x14')]=moment()['format'](_0xdb25('0x15'));_0x148a6c[_0xdb25('0x10')]=null;_0x148a6c[_0xdb25('0x11')]=null;}_0x2a1d56(null,_0x148a6c);},'afterUpdate':function(_0x513181,_0x5bce79,_0x30a965){var _0x2426b8=_0x428709[_0xdb25('0x16')];var _0x9e68b1=_0x513181[_0xdb25('0x17')]({'plain':!![]});if(_0x9e68b1[_0xdb25('0x13')]){return _0x2426b8[_0xdb25('0x18')][_0xdb25('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x9e68b1['id']}})[_0xdb25('0x1a')](function(){_0x30a965();})[_0xdb25('0x1b')](function(_0x3b9d0d){_0x30a965(_0x3b9d0d);});}else{_0x30a965();}}},'charset':_0xdb25('0x1c'),'collate':_0xdb25('0x1d')});}; \ No newline at end of file +var _0xd147=['get','update','then','catch','utf8mb4','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','substatus','changed','closedAt','models'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xd147,0x123));var _0x7d14=function(_0x169f84,_0x2af343){_0x169f84=_0x169f84-0x0;var _0x215e89=_0xd147[_0x169f84];return _0x215e89;};'use strict';var _=require(_0x7d14('0x0'));var util=require('util');var logger=require(_0x7d14('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d14('0x2'));var rp=require(_0x7d14('0x3'));var fs=require('fs');var path=require(_0x7d14('0x4'));var rimraf=require(_0x7d14('0x5'));var config=require(_0x7d14('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x7d14('0x7')]=function(_0x775142,_0x27310a){return _0x775142[_0x7d14('0x8')](_0x7d14('0x9'),attributes,{'tableName':_0x7d14('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x7d14('0xb'),'to'],'type':_0x7d14('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x266f5f,_0x2ec326,_0x5761ba){if(_0x266f5f['substatus']){_0x266f5f[_0x7d14('0xd')]=moment()[_0x7d14('0xe')](_0x7d14('0xf'));}if(_0x266f5f[_0x7d14('0x10')]){_0x266f5f['closedAt']=moment()[_0x7d14('0xe')](_0x7d14('0xf'));}_0x5761ba(null,_0x2ec326);},'beforeUpdate':function(_0x39061a,_0x107462,_0xfd41f0){if(_0x39061a['changed'](_0x7d14('0x11'))){_0x39061a[_0x7d14('0xd')]=_0x39061a['substatus']?moment()[_0x7d14('0xe')](_0x7d14('0xf')):null;}if(_0x39061a[_0x7d14('0x12')]('closed')){_0x39061a[_0x7d14('0x13')]=moment()[_0x7d14('0xe')](_0x7d14('0xf'));_0x39061a[_0x7d14('0x11')]=null;_0x39061a[_0x7d14('0xd')]=null;}_0xfd41f0(null,_0x39061a);},'afterUpdate':function(_0x19e83a,_0x4a4fd7,_0x582854){var _0x214477=_0x775142[_0x7d14('0x14')];var _0x4cb619=_0x19e83a[_0x7d14('0x15')]({'plain':!![]});if(_0x4cb619[_0x7d14('0x10')]){return _0x214477['MailMessage'][_0x7d14('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x4cb619['id']}})[_0x7d14('0x17')](function(){_0x582854();})[_0x7d14('0x18')](function(_0x109eac){_0x582854(_0x109eac);});}else{_0x582854();}}},'charset':_0x7d14('0x19'),'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 bb00610..1a3f7bb 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 _0x1c23=['http','redis','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','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x56d4c7,_0x8166){var _0x266d6e=function(_0xc475e){while(--_0xc475e){_0x56d4c7['push'](_0x56d4c7['shift']());}};_0x266d6e(++_0x8166);}(_0x1c23,0x1d5));var _0x31c2=function(_0x5b39f2,_0x2f7a2e){_0x5b39f2=_0x5b39f2-0x0;var _0x5b7cb8=_0x1c23[_0x5b39f2];return _0x5b7cb8;};'use strict';var _=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var moment=require(_0x31c2('0x2'));var BPromise=require(_0x31c2('0x3'));var rs=require(_0x31c2('0x4'));var fs=require('fs');var Redis=require(_0x31c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31c2('0x6'));var logger=require(_0x31c2('0x7'))('rpc');var config=require(_0x31c2('0x8'));var jayson=require(_0x31c2('0x9'));var client=jayson[_0x31c2('0xa')][_0x31c2('0xb')]({'port':0x232a});config[_0x31c2('0xc')]=_['defaults'](config[_0x31c2('0xc')],{'host':_0x31c2('0xd'),'port':0x18eb});var socket=require(_0x31c2('0xe'))(new Redis(config[_0x31c2('0xc')]));require(_0x31c2('0xf'))['register'](socket);function respondWithRpcPromise(_0x4821dd,_0x3794c4,_0x29f71f){return new BPromise(function(_0x22875b,_0x24443c){return client[_0x31c2('0x10')](_0x4821dd,_0x29f71f)[_0x31c2('0x11')](function(_0x5c1c28){logger[_0x31c2('0x12')]('MailInteraction,\x20%s,\x20%s',_0x3794c4,_0x31c2('0x13'));logger[_0x31c2('0x14')](_0x31c2('0x15'),_0x3794c4,'request\x20sent',JSON[_0x31c2('0x16')](_0x5c1c28));if(_0x5c1c28[_0x31c2('0x17')]){if(_0x5c1c28['error'][_0x31c2('0x18')]===0x1f4){logger[_0x31c2('0x17')](_0x31c2('0x19'),_0x3794c4,_0x5c1c28[_0x31c2('0x17')][_0x31c2('0x1a')]);return _0x24443c(_0x5c1c28[_0x31c2('0x17')][_0x31c2('0x1a')]);}logger[_0x31c2('0x17')](_0x31c2('0x19'),_0x3794c4,_0x5c1c28[_0x31c2('0x17')][_0x31c2('0x1a')]);return _0x22875b(_0x5c1c28['error']['message']);}else{logger[_0x31c2('0x12')](_0x31c2('0x19'),_0x3794c4,_0x31c2('0x13'));_0x22875b(_0x5c1c28['result']['message']);}})[_0x31c2('0x1b')](function(_0x4a52fa){logger[_0x31c2('0x17')](_0x31c2('0x19'),_0x3794c4,_0x4a52fa);_0x24443c(_0x4a52fa);});});}exports[_0x31c2('0x1c')]=function(_0xb4c4a5){var _0x55e997=this;return new Promise(function(_0xc29f8a,_0x4ae7ad){return db[_0x31c2('0x1d')][_0x31c2('0x1e')](_0xb4c4a5['body'],{'raw':_0xb4c4a5['options']?_0xb4c4a5[_0x31c2('0x1f')][_0x31c2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4c4a5['options']?_0xb4c4a5[_0x31c2('0x1f')][_0x31c2('0x21')]||null:null,'attributes':_0xb4c4a5[_0x31c2('0x1f')]?_0xb4c4a5[_0x31c2('0x1f')]['attributes']||null:null,'limit':_0xb4c4a5[_0x31c2('0x1f')]?_0xb4c4a5[_0x31c2('0x1f')]['limit']||null:null})[_0x31c2('0x11')](function(_0x598a87){logger['info'](_0x31c2('0x1c'),_0xb4c4a5);logger['debug'](_0x31c2('0x1c'),_0xb4c4a5,JSON[_0x31c2('0x16')](_0x598a87));_0xc29f8a(_0x598a87);})[_0x31c2('0x1b')](function(_0x211a43){logger[_0x31c2('0x17')]('UpdateMailInteraction',_0x211a43[_0x31c2('0x1a')],_0xb4c4a5);_0x4ae7ad(_0x55e997[_0x31c2('0x17')](0x1f4,_0x211a43[_0x31c2('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x28d51a){return new Promise(function(_0x3c0ec1,_0xf8879a){return db[_0x31c2('0x1d')][_0x31c2('0x22')]({'where':_0x28d51a[_0x31c2('0x1f')]?_0x28d51a[_0x31c2('0x1f')]['where']||null:null})[_0x31c2('0x11')](function(_0x394712){if(_0x394712){return _0x394712[_0x31c2('0x23')](_0x28d51a[_0x31c2('0x24')][_0x31c2('0x25')],_[_0x31c2('0x26')](_0x28d51a[_0x31c2('0x24')],['ids','id'])||{});}})['spread'](function(_0x421987){logger['info'](_0x31c2('0x27'),_0x28d51a);logger[_0x31c2('0x14')](_0x31c2('0x27'),_0x28d51a,JSON[_0x31c2('0x16')](_0x421987));_0x3c0ec1(_0x421987);})['catch'](function(_0xca74fc){logger['error'](_0x31c2('0x27'),_0xca74fc[_0x31c2('0x1a')],_0x28d51a);_0xf8879a(_this[_0x31c2('0x17')](0x1f4,_0xca74fc[_0x31c2('0x1a')]));});});}; \ No newline at end of file +var _0x36bb=['ids','omit','body','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','find','addTags'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var moment=require(_0xb36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb36b('0x3'));var fs=require('fs');var Redis=require(_0xb36b('0x4'));var db=require(_0xb36b('0x5'))['db'];var utils=require(_0xb36b('0x6'));var logger=require(_0xb36b('0x7'))(_0xb36b('0x8'));var config=require(_0xb36b('0x9'));var jayson=require(_0xb36b('0xa'));var client=jayson[_0xb36b('0xb')][_0xb36b('0xc')]({'port':0x232a});config[_0xb36b('0xd')]=_[_0xb36b('0xe')](config[_0xb36b('0xd')],{'host':_0xb36b('0xf'),'port':0x18eb});var socket=require(_0xb36b('0x10'))(new Redis(config[_0xb36b('0xd')]));require(_0xb36b('0x11'))[_0xb36b('0x12')](socket);function respondWithRpcPromise(_0x18dea6,_0x5b70e7,_0x2323b0){return new BPromise(function(_0x2b26c4,_0x2bd78b){return client['request'](_0x18dea6,_0x2323b0)[_0xb36b('0x13')](function(_0x449056){logger[_0xb36b('0x14')](_0xb36b('0x15'),_0x5b70e7,_0xb36b('0x16'));logger[_0xb36b('0x17')](_0xb36b('0x18'),_0x5b70e7,_0xb36b('0x16'),JSON[_0xb36b('0x19')](_0x449056));if(_0x449056[_0xb36b('0x1a')]){if(_0x449056[_0xb36b('0x1a')]['code']===0x1f4){logger[_0xb36b('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x5b70e7,_0x449056['error'][_0xb36b('0x1b')]);return _0x2bd78b(_0x449056[_0xb36b('0x1a')][_0xb36b('0x1b')]);}logger[_0xb36b('0x1a')](_0xb36b('0x15'),_0x5b70e7,_0x449056[_0xb36b('0x1a')]['message']);return _0x2b26c4(_0x449056[_0xb36b('0x1a')][_0xb36b('0x1b')]);}else{logger[_0xb36b('0x14')](_0xb36b('0x15'),_0x5b70e7,'request\x20sent');_0x2b26c4(_0x449056[_0xb36b('0x1c')][_0xb36b('0x1b')]);}})[_0xb36b('0x1d')](function(_0x57a7b2){logger[_0xb36b('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x5b70e7,_0x57a7b2);_0x2bd78b(_0x57a7b2);});});}exports[_0xb36b('0x1e')]=function(_0xac85bd){var _0x27979d=this;return new Promise(function(_0x3eba4b,_0x4049fa){return db[_0xb36b('0x1f')][_0xb36b('0x20')](_0xac85bd['body'],{'raw':_0xac85bd[_0xb36b('0x21')]?_0xac85bd['options'][_0xb36b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xac85bd['options']?_0xac85bd[_0xb36b('0x21')][_0xb36b('0x23')]||null:null,'attributes':_0xac85bd[_0xb36b('0x21')]?_0xac85bd[_0xb36b('0x21')][_0xb36b('0x24')]||null:null,'limit':_0xac85bd['options']?_0xac85bd[_0xb36b('0x21')][_0xb36b('0x25')]||null:null})[_0xb36b('0x13')](function(_0x553915){logger[_0xb36b('0x14')]('UpdateMailInteraction',_0xac85bd);logger['debug']('UpdateMailInteraction',_0xac85bd,JSON[_0xb36b('0x19')](_0x553915));_0x3eba4b(_0x553915);})[_0xb36b('0x1d')](function(_0x2e8402){logger[_0xb36b('0x1a')](_0xb36b('0x1e'),_0x2e8402[_0xb36b('0x1b')],_0xac85bd);_0x4049fa(_0x27979d[_0xb36b('0x1a')](0x1f4,_0x2e8402[_0xb36b('0x1b')]));});});};exports['AddTagsToMailInteraction']=function(_0x5f5d1d){return new Promise(function(_0x90718e,_0x2724bf){return db[_0xb36b('0x1f')][_0xb36b('0x26')]({'where':_0x5f5d1d['options']?_0x5f5d1d['options'][_0xb36b('0x23')]||null:null})['then'](function(_0x3e376f){if(_0x3e376f){return _0x3e376f[_0xb36b('0x27')](_0x5f5d1d['body'][_0xb36b('0x28')],_[_0xb36b('0x29')](_0x5f5d1d[_0xb36b('0x2a')],[_0xb36b('0x28'),'id'])||{});}})[_0xb36b('0x2b')](function(_0x415e0e){logger[_0xb36b('0x14')](_0xb36b('0x2c'),_0x5f5d1d);logger[_0xb36b('0x17')](_0xb36b('0x2c'),_0x5f5d1d,JSON[_0xb36b('0x19')](_0x415e0e));_0x90718e(_0x415e0e);})[_0xb36b('0x1d')](function(_0x558766){logger['error'](_0xb36b('0x2c'),_0x558766[_0xb36b('0x1b')],_0x5f5d1d);_0x2724bf(_this['error'](0x1f4,_0x558766[_0xb36b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b4eda4d..daa8789 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 _0xefc1=['register','mailInteraction:','save','remove'];(function(_0x1e2ce7,_0xedc9ef){var _0x562e2d=function(_0x7b4d7d){while(--_0x7b4d7d){_0x1e2ce7['push'](_0x1e2ce7['shift']());}};_0x562e2d(++_0xedc9ef);}(_0xefc1,0xb6));var _0x1efc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xefc1[_0x543084];return _0x306a57;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x1efc('0x0'),_0x1efc('0x1'),'update'];function createListener(_0x3dca45,_0x1e0382){return function(_0x3759e1){_0x1e0382['emit'](_0x3dca45,_0x3759e1);};}function removeListener(_0x55aaff,_0x185427){return function(){MailInteractionEvents['removeListener'](_0x55aaff,_0x185427);};}exports[_0x1efc('0x2')]=function(_0x464ab3){for(var _0x18102b=0x0,_0x54c6ab=events['length'];_0x18102b<_0x54c6ab;_0x18102b++){var _0x4482f4=events[_0x18102b];var _0x3313ef=createListener(_0x1efc('0x3')+_0x4482f4,_0x464ab3);MailInteractionEvents['on'](_0x4482f4,_0x3313ef);}}; \ No newline at end of file +var _0xd4cf=['update','emit','register','length','mailInteraction:','save','remove'];(function(_0x236023,_0x20dea0){var _0x5f0ceb=function(_0x234c57){while(--_0x234c57){_0x236023['push'](_0x236023['shift']());}};_0x5f0ceb(++_0x20dea0);}(_0xd4cf,0x1be));var _0xfd4c=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xd4cf[_0x47adb8];return _0x4689a8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xfd4c('0x0'),_0xfd4c('0x1'),_0xfd4c('0x2')];function createListener(_0x5624d9,_0x32e2e7){return function(_0x1ed3f8){_0x32e2e7[_0xfd4c('0x3')](_0x5624d9,_0x1ed3f8);};}function removeListener(_0x160cdc,_0x328224){return function(){MailInteractionEvents['removeListener'](_0x160cdc,_0x328224);};}exports[_0xfd4c('0x4')]=function(_0x67d204){for(var _0x165be9=0x0,_0x2e4da8=events[_0xfd4c('0x5')];_0x165be9<_0x2e4da8;_0x165be9++){var _0x2182c1=events[_0x165be9];var _0x1b0a03=createListener(_0xfd4c('0x6')+_0x2182c1,_0x67d204);MailInteractionEvents['on'](_0x2182c1,_0x1b0a03);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 9521f95..19c0cb6 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 _0xc423=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path'];(function(_0x1e71b7,_0x199ed3){var _0x4d0f44=function(_0x41c405){while(--_0x41c405){_0x1e71b7['push'](_0x1e71b7['shift']());}};_0x4d0f44(++_0x199ed3);}(_0xc423,0x159));var _0x3c42=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc423[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x3c42('0x0'));var util=require(_0x3c42('0x1'));var path=require(_0x3c42('0x2'));var timeout=require(_0x3c42('0x3'));var express=require(_0x3c42('0x4'));var router=express['Router']();var fs_extra=require(_0x3c42('0x5'));var auth=require(_0x3c42('0x6'));var interaction=require(_0x3c42('0x7'));var config=require('../../config/environment');var controller=require(_0x3c42('0x8'));router[_0x3c42('0x9')]('/',auth[_0x3c42('0xa')](),controller[_0x3c42('0xb')]);router[_0x3c42('0x9')](_0x3c42('0xc'),auth[_0x3c42('0xa')](),controller[_0x3c42('0xd')]);router['get'](_0x3c42('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3c42('0x9')](_0x3c42('0xf'),auth[_0x3c42('0xa')](),controller[_0x3c42('0x10')]);router[_0x3c42('0x11')]('/',auth[_0x3c42('0xa')](),interaction[_0x3c42('0x12')](_0x3c42('0x13'),'mailmessage:create'),controller[_0x3c42('0x14')]);router[_0x3c42('0x15')](_0x3c42('0xe'),auth[_0x3c42('0xa')](),controller[_0x3c42('0x16')]);router['put'](_0x3c42('0x17'),auth['isAuthenticated'](),controller[_0x3c42('0x18')]);router[_0x3c42('0x15')](_0x3c42('0x19'),auth['isAuthenticated'](),controller[_0x3c42('0x1a')]);router[_0x3c42('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x3c42('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6305=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create','put'];(function(_0x2166e1,_0x4a9a63){var _0x42ada1=function(_0x1d487a){while(--_0x1d487a){_0x2166e1['push'](_0x2166e1['shift']());}};_0x42ada1(++_0x4a9a63);}(_0x6305,0x1ab));var _0x5630=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6305[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x5630('0x0'));var path=require('path');var timeout=require(_0x5630('0x1'));var express=require(_0x5630('0x2'));var router=express[_0x5630('0x3')]();var fs_extra=require(_0x5630('0x4'));var auth=require(_0x5630('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5630('0x6'));var controller=require(_0x5630('0x7'));router[_0x5630('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5630('0x8')](_0x5630('0x9'),auth[_0x5630('0xa')](),controller[_0x5630('0xb')]);router[_0x5630('0x8')](_0x5630('0xc'),auth[_0x5630('0xa')](),controller[_0x5630('0xd')]);router[_0x5630('0x8')](_0x5630('0xe'),auth[_0x5630('0xa')](),controller[_0x5630('0xf')]);router['post']('/',auth[_0x5630('0xa')](),interaction[_0x5630('0x10')](_0x5630('0x11'),_0x5630('0x12')),controller[_0x5630('0x13')]);router['put'](_0x5630('0xc'),auth[_0x5630('0xa')](),controller['update']);router[_0x5630('0x14')](_0x5630('0x15'),auth[_0x5630('0xa')](),controller[_0x5630('0x16')]);router[_0x5630('0x14')](_0x5630('0x17'),auth['isAuthenticated'](),controller[_0x5630('0x18')]);router[_0x5630('0x19')](_0x5630('0xc'),auth[_0x5630('0xa')](),controller[_0x5630('0x1a')]);module[_0x5630('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b934e01..d442aa7 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 _0xd51b=['Chat','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd51b,0xb5));var _0xbd51=function(_0x1876d8,_0x1dc055){_0x1876d8=_0x1876d8-0x0;var _0x16539d=_0xd51b[_0x1876d8];return _0x16539d;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xbd51('0x0')]={'body':{'type':Sequelize['TEXT'](_0xbd51('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbd51('0x2')](_0xbd51('0x3'))},'read':{'type':Sequelize[_0xbd51('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbd51('0x5')]('in',_0xbd51('0x6')),'defaultValue':_0xbd51('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbd51('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbd51('0x2')](_0xbd51('0x1'))},'cc':{'type':Sequelize[_0xbd51('0x2')](_0xbd51('0x1'))},'bcc':{'type':Sequelize[_0xbd51('0x2')](_0xbd51('0x1'))},'subject':{'type':Sequelize[_0xbd51('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xbd51('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbd51('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbd51('0x9')]},'originTo':{'type':Sequelize[_0xbd51('0x2')](_0xbd51('0x1'))},'originCc':{'type':Sequelize[_0xbd51('0x2')]('long')},'originChannel':{'type':Sequelize[_0xbd51('0x5')](_0xbd51('0xa'),_0xbd51('0xb')),'defaultValue':_0xbd51('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xc2fd=['Email','Chat','sequelize','lodash','exports','TEXT','long','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x425128,_0x594343){var _0x5bb8dc=function(_0x31a4d4){while(--_0x31a4d4){_0x425128['push'](_0x425128['shift']());}};_0x5bb8dc(++_0x594343);}(_0xc2fd,0x12e));var _0xdc2f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc2fd[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xdc2f('0x0'));var _=require(_0xdc2f('0x1'));module[_0xdc2f('0x2')]={'body':{'type':Sequelize[_0xdc2f('0x3')](_0xdc2f('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc2f('0x5')]('in',_0xdc2f('0x6')),'defaultValue':_0xdc2f('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xdc2f('0x7')]},'to':{'type':Sequelize[_0xdc2f('0x3')](_0xdc2f('0x4'))},'cc':{'type':Sequelize[_0xdc2f('0x3')](_0xdc2f('0x4'))},'bcc':{'type':Sequelize[_0xdc2f('0x3')](_0xdc2f('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xdc2f('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdc2f('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdc2f('0x8')]},'originTo':{'type':Sequelize[_0xdc2f('0x3')](_0xdc2f('0x4'))},'originCc':{'type':Sequelize[_0xdc2f('0x3')]('long')},'originChannel':{'type':Sequelize[_0xdc2f('0x5')](_0xdc2f('0xa'),_0xdc2f('0xb')),'defaultValue':_0xdc2f('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 05454fc..a93eb7b 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 _0x86d3=['http','request','info','request\x20sent','debug','error','code','MailMessage,\x20%s,\x20%s','message','catch','json','undefined','limit','count','offset','status','update','then','destroy','sendStatus','name','index','map','MailMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','show','params','options','body','find','describe','create','direction','secret','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','server/files/attachments','basename','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','SIP/%s','fromString','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','type','readFileSync','build','writeFileSync','unlinkSync','eml-format','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','html-entities','./mailMessage.socket','register','client'];(function(_0x178892,_0x1c71d2){var _0x228722=function(_0xd6112e){while(--_0xd6112e){_0x178892['push'](_0x178892['shift']());}};_0x228722(++_0x1c71d2);}(_0x86d3,0x122));var _0x386d=function(_0x49fa98,_0x11accf){_0x49fa98=_0x49fa98-0x0;var _0x1698f1=_0x86d3[_0x49fa98];return _0x1698f1;};'use strict';var emlformat=require(_0x386d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x386d('0x1'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x386d('0x2'));var htmlToText=require(_0x386d('0x3'));var qs=require(_0x386d('0x4'));var logger=require(_0x386d('0x5'))(_0x386d('0x6'));var interaction_log=require('../../config/logger')(_0x386d('0x7'));var config=require(_0x386d('0x8'));var db=require('../../mysqldb')['db'];config[_0x386d('0x9')]=_[_0x386d('0xa')](config[_0x386d('0x9')],{'host':_0x386d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x386d('0x9')]));var htmlEntities=require(_0x386d('0xc'));require(_0x386d('0xd'))[_0x386d('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x386d('0xf')][_0x386d('0x10')]({'port':0x232c});var client9003=jayson[_0x386d('0xf')][_0x386d('0x10')]({'port':0x232b});var client9002=jayson[_0x386d('0xf')][_0x386d('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x2c5068,_0x252d87,_0x4f5f80,_0x465478){return new BPromise(function(_0x3e6e39,_0x220567){var _0x43b4c3=_0x465478||client;return _0x43b4c3[_0x386d('0x11')](_0x2c5068,_0x4f5f80)['then'](function(_0x4f9038){logger[_0x386d('0x12')]('MailMessage,\x20%s,\x20%s',_0x252d87,_0x386d('0x13'));logger[_0x386d('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x252d87,_0x386d('0x13'),JSON['stringify'](_0x4f9038));if(_0x4f9038[_0x386d('0x15')]){if(_0x4f9038['error'][_0x386d('0x16')]===0x1f4){logger[_0x386d('0x15')](_0x386d('0x17'),_0x252d87,_0x4f9038[_0x386d('0x15')][_0x386d('0x18')]);return _0x220567(_0x4f9038['error'][_0x386d('0x18')]);}logger[_0x386d('0x15')](_0x386d('0x17'),_0x252d87,_0x4f9038[_0x386d('0x15')]['message']);return _0x3e6e39(_0x4f9038[_0x386d('0x15')][_0x386d('0x18')]);}else{logger[_0x386d('0x12')](_0x386d('0x17'),_0x252d87,_0x386d('0x13'));_0x3e6e39(_0x4f9038['result'][_0x386d('0x18')]);}})[_0x386d('0x19')](function(_0x4237d6){logger[_0x386d('0x15')](_0x386d('0x17'),_0x252d87,_0x4237d6);_0x220567(_0x4237d6);});});}function respondWithResult(_0x19c0bd,_0x5ea04b){_0x5ea04b=_0x5ea04b||0xc8;return function(_0x3dfa71){if(_0x3dfa71){return _0x19c0bd['status'](_0x5ea04b)[_0x386d('0x1a')](_0x3dfa71);}};}function respondWithFilteredResult(_0x50c4c5,_0x5af261){return function(_0x53fdb6){if(_0x53fdb6){var _0x46f153=typeof _0x5af261['offset']===_0x386d('0x1b')&&typeof _0x5af261[_0x386d('0x1c')]==='undefined';var _0x5d27f7=_0x53fdb6[_0x386d('0x1d')];var _0x1b71ba=_0x46f153?0x0:_0x5af261[_0x386d('0x1e')];var _0x136206=_0x46f153?_0x53fdb6['count']:_0x5af261[_0x386d('0x1e')]+_0x5af261[_0x386d('0x1c')];var _0x94afc5;if(_0x136206>=_0x5d27f7){_0x136206=_0x5d27f7;_0x94afc5=0xc8;}else{_0x94afc5=0xce;}_0x50c4c5[_0x386d('0x1f')](_0x94afc5);return _0x50c4c5['set']('Content-Range',_0x1b71ba+'-'+_0x136206+'/'+_0x5d27f7)[_0x386d('0x1a')](_0x53fdb6);}return null;};}function saveUpdates(_0x88df88){return function(_0x5e1d48){if(_0x5e1d48){return _0x5e1d48[_0x386d('0x20')](_0x88df88)[_0x386d('0x21')](function(_0x350610){return _0x350610;});}return null;};}function removeEntity(_0x160151){return function(_0x1c9a46){if(_0x1c9a46){return _0x1c9a46[_0x386d('0x22')]()[_0x386d('0x21')](function(){_0x160151[_0x386d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3addc1){return function(_0x1ed2d2){if(!_0x1ed2d2){_0x3addc1[_0x386d('0x23')](0x194);}return _0x1ed2d2;};}function handleError(_0x480742,_0x4b0c7e){_0x4b0c7e=_0x4b0c7e||0x1f4;return function(_0x3c51a8){logger[_0x386d('0x15')](_0x3c51a8['stack']);if(_0x3c51a8[_0x386d('0x24')]){delete _0x3c51a8[_0x386d('0x24')];}_0x480742['status'](_0x4b0c7e)['send'](_0x3c51a8);};}exports[_0x386d('0x25')]=function(_0x2089a3,_0x27e429){var _0x342795={},_0x38d5ac={},_0x2c4b8f={'count':0x0,'rows':[]};var _0x966815=_[_0x386d('0x26')](db[_0x386d('0x27')][_0x386d('0x28')],function(_0x3bf9ae){return{'name':_0x3bf9ae[_0x386d('0x29')],'type':_0x3bf9ae['type'][_0x386d('0x2a')]};});_0x38d5ac['model']=_[_0x386d('0x26')](_0x966815,_0x386d('0x24'));_0x38d5ac[_0x386d('0x2b')]=_[_0x386d('0x2c')](_0x2089a3['query']);_0x38d5ac[_0x386d('0x2d')]=_[_0x386d('0x2e')](_0x38d5ac[_0x386d('0x2f')],_0x38d5ac[_0x386d('0x2b')]);_0x342795[_0x386d('0x30')]=_[_0x386d('0x2e')](_0x38d5ac['model'],qs['fields'](_0x2089a3['query'][_0x386d('0x31')]));_0x342795[_0x386d('0x30')]=_0x342795['attributes'][_0x386d('0x32')]?_0x342795[_0x386d('0x30')]:_0x38d5ac[_0x386d('0x2f')];if(!_0x2089a3[_0x386d('0x2b')][_0x386d('0x33')]('nolimit')){_0x342795['limit']=qs[_0x386d('0x1c')](_0x2089a3[_0x386d('0x2b')][_0x386d('0x1c')]);_0x342795['offset']=qs[_0x386d('0x1e')](_0x2089a3['query']['offset']);}_0x342795[_0x386d('0x34')]=qs[_0x386d('0x35')](_0x2089a3[_0x386d('0x2b')][_0x386d('0x35')]);_0x342795['where']=qs['filters'](_['pick'](_0x2089a3[_0x386d('0x2b')],_0x38d5ac[_0x386d('0x2d')]),_0x966815);if(_0x2089a3[_0x386d('0x2b')]['filter']){_0x342795[_0x386d('0x36')]=_[_0x386d('0x37')](_0x342795[_0x386d('0x36')],{'$or':_[_0x386d('0x26')](_0x966815,function(_0x43d6ff){if(_0x43d6ff['type']!==_0x386d('0x38')){var _0x1c30a3={};_0x1c30a3[_0x43d6ff[_0x386d('0x24')]]={'$like':'%'+_0x2089a3['query'][_0x386d('0x39')]+'%'};return _0x1c30a3;}})});}_0x342795=_['merge']({},_0x342795,_0x2089a3['options']);var _0x56513b={'where':_0x342795[_0x386d('0x36')]};return db['MailMessage'][_0x386d('0x1d')](_0x56513b)[_0x386d('0x21')](function(_0x4cdb61){_0x2c4b8f[_0x386d('0x1d')]=_0x4cdb61;if(_0x2089a3['query'][_0x386d('0x3a')]){_0x342795['include']=[{'all':!![]}];}return db[_0x386d('0x27')][_0x386d('0x3b')](_0x342795);})[_0x386d('0x21')](function(_0x68b681){_0x2c4b8f['rows']=_0x68b681;return _0x2c4b8f;})[_0x386d('0x21')](respondWithFilteredResult(_0x27e429,_0x342795))['catch'](handleError(_0x27e429,null));};exports[_0x386d('0x3c')]=function(_0x45b73a,_0x17c2a8){var _0x172274={'raw':!![],'where':{'id':_0x45b73a[_0x386d('0x3d')]['id']}},_0x1162dd={};_0x1162dd[_0x386d('0x2f')]=_[_0x386d('0x2c')](db[_0x386d('0x27')][_0x386d('0x28')]);_0x1162dd[_0x386d('0x2b')]=_[_0x386d('0x2c')](_0x45b73a['query']);_0x1162dd[_0x386d('0x2d')]=_[_0x386d('0x2e')](_0x1162dd[_0x386d('0x2f')],_0x1162dd['query']);_0x172274['attributes']=_[_0x386d('0x2e')](_0x1162dd[_0x386d('0x2f')],qs[_0x386d('0x31')](_0x45b73a[_0x386d('0x2b')][_0x386d('0x31')]));_0x172274['attributes']=_0x172274[_0x386d('0x30')][_0x386d('0x32')]?_0x172274[_0x386d('0x30')]:_0x1162dd[_0x386d('0x2f')];if(_0x45b73a[_0x386d('0x2b')][_0x386d('0x3a')]){_0x172274['include']=[{'all':!![]}];}_0x172274=_[_0x386d('0x37')]({},_0x172274,_0x45b73a[_0x386d('0x3e')]);return db[_0x386d('0x27')]['find'](_0x172274)[_0x386d('0x21')](handleEntityNotFound(_0x17c2a8,null))[_0x386d('0x21')](respondWithResult(_0x17c2a8,null))[_0x386d('0x19')](handleError(_0x17c2a8,null));};exports[_0x386d('0x20')]=function(_0x3af095,_0x19c515){if(_0x3af095[_0x386d('0x3f')]['id']){delete _0x3af095['body']['id'];}return db[_0x386d('0x27')][_0x386d('0x40')]({'where':{'id':_0x3af095[_0x386d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x19c515,null))[_0x386d('0x21')](saveUpdates(_0x3af095[_0x386d('0x3f')],null))[_0x386d('0x21')](respondWithResult(_0x19c515,null))[_0x386d('0x19')](handleError(_0x19c515,null));};exports[_0x386d('0x22')]=function(_0x536066,_0x43e4e7){return db['MailMessage'][_0x386d('0x40')]({'where':{'id':_0x536066['params']['id']}})[_0x386d('0x21')](handleEntityNotFound(_0x43e4e7,null))[_0x386d('0x21')](removeEntity(_0x43e4e7,null))[_0x386d('0x19')](handleError(_0x43e4e7,null));};exports[_0x386d('0x41')]=function(_0x12ae04,_0x49e00a){return db[_0x386d('0x27')][_0x386d('0x41')]()[_0x386d('0x21')](respondWithResult(_0x49e00a,null))[_0x386d('0x19')](handleError(_0x49e00a,null));};exports[_0x386d('0x42')]=function(_0x4f15c0,_0x3555fe){return db['MailMessage'][_0x386d('0x42')](_0x4f15c0[_0x386d('0x3f')])[_0x386d('0x21')](function(_0x5f376c){if(_0x5f376c){if(_0x5f376c[_0x386d('0x43')]==='out'&&!_0x5f376c[_0x386d('0x44')]){var _0x5b4396,_0x19f9e4,_0x504ea5;if(_0x4f15c0[_0x386d('0x3f')]['to']){_0x19f9e4=_0x4f15c0[_0x386d('0x3f')]['to'][_0x386d('0x45')](',')[0x0];}return db['MailAccount'][_0x386d('0x46')]({'where':{'id':_0x5f376c[_0x386d('0x47')]},'include':[{'model':db[_0x386d('0x48')],'as':_0x386d('0x49'),'include':[{'model':db[_0x386d('0x4a')],'as':_0x386d('0x4b'),'where':{'email':_0x19f9e4},'limit':0x1,'order':[[_0x386d('0x4c'),_0x386d('0x4d')]]}]},{'model':db[_0x386d('0x4e')],'as':_0x386d('0x4f'),'raw':!![],'include':[{'model':db[_0x386d('0x50')],'as':_0x386d('0x50'),'raw':!![]}]}]})['then'](function(_0x884097){_0x5b4396=_0x884097;if(!_0x5b4396||!_0x5b4396['Smtp'])return;var _0x442dfd=_0x5b4396[_0x386d('0x51')]();if(_0x4f15c0[_0x386d('0x3f')][_0x386d('0x52')]&&_0x4f15c0[_0x386d('0x3f')][_0x386d('0x52')][_0x386d('0x32')]){for(var _0x12ae40=0x0;_0x12ae40<_0x4f15c0['body'][_0x386d('0x52')][_0x386d('0x32')];_0x12ae40+=0x1){_0x4f15c0[_0x386d('0x3f')][_0x386d('0x52')][_0x12ae40]={'filename':_0x4f15c0[_0x386d('0x3f')][_0x386d('0x52')][_0x12ae40]['name'],'path':path[_0x386d('0x53')](config['root'],_0x386d('0x54'),_0x4f15c0[_0x386d('0x3f')][_0x386d('0x52')][_0x12ae40][_0x386d('0x55')])};}}_0x504ea5={'account':_0x442dfd,'message':_0x4f15c0[_0x386d('0x3f')]};return;})[_0x386d('0x21')](function(){if(_0x5b4396[_0x386d('0x49')]){if(_0x5b4396[_0x386d('0x49')][_0x386d('0x4b')][_0x386d('0x32')]){return _0x5b4396['List'][_0x386d('0x4b')][0x0];}else{return db[_0x386d('0x4a')][_0x386d('0x42')](_[_0x386d('0xa')](_0x4f15c0[_0x386d('0x3f')],{'firstName':_0x4f15c0[_0x386d('0x3f')]['to'],'email':_0x4f15c0[_0x386d('0x3f')]['to'],'phone':_0x4f15c0[_0x386d('0x3f')]['to'],'ListId':_0x5b4396[_0x386d('0x56')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x386d('0x21')](function(){if(_0x504ea5){return respondWithRpcPromise(_0x386d('0x57'),_0x386d('0x58'),_0x504ea5,client9003)[_0x386d('0x21')](function(_0x345612){return _0x5f376c[_0x386d('0x20')]({'read':!![],'messageId':_0x345612[_0x386d('0x59')],'sentAt':moment()[_0x386d('0x5a')](_0x386d('0x5b'))});})[_0x386d('0x19')](function(_0xecee4b){logger['error']('%s',JSON['stringify'](_0xecee4b));return _0x5f376c;});}return _0x5f376c;});}return _0x5f376c;}})[_0x386d('0x21')](respondWithResult(_0x3555fe,0xc9))[_0x386d('0x19')](handleError(_0x3555fe,null));};exports[_0x386d('0x5c')]=function(_0x398ebc,_0x2c1514){var _0x1602f7={'agent':{},'channel':_0x386d('0x5d')};if(_0x398ebc[_0x386d('0x3f')]['id']){delete _0x398ebc['body']['id'];}_0x398ebc[_0x386d('0x3f')][_0x386d('0x5e')]=!![];_0x398ebc['body'][_0x386d('0x5f')]=moment()['format'](_0x386d('0x5b'));_0x398ebc[_0x386d('0x3f')][_0x386d('0x60')]=_0x398ebc[_0x386d('0x3f')][_0x386d('0x60')]||_0x398ebc[_0x386d('0x61')]['id'];_0x1602f7[_0x386d('0x62')]['id']=_0x398ebc[_0x386d('0x3f')]['UserId'];return db[_0x386d('0x27')][_0x386d('0x40')]({'where':{'id':_0x398ebc[_0x386d('0x3d')]['id'],'UserId':null}})[_0x386d('0x21')](handleEntityNotFound(_0x2c1514,null))[_0x386d('0x21')](saveUpdates(_0x398ebc[_0x386d('0x3f')],null))['then'](function(_0x3a84e0){if(_0x3a84e0){_0x1602f7[_0x386d('0x18')]=_0x3a84e0[_0x386d('0x63')]({'plain':!![]});return db[_0x386d('0x64')][_0x386d('0x40')]({'where':{'id':_0x3a84e0[_0x386d('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2c1514,null))[_0x386d('0x21')](function(_0x14bea1){if(_0x14bea1){return _0x14bea1[_0x386d('0x20')]({'UserId':_0x398ebc[_0x386d('0x3f')][_0x386d('0x60')],'read1stAt':_[_0x386d('0x66')](_0x14bea1[_0x386d('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1e5458){if(_0x1e5458){_0x1602f7[_0x386d('0x68')]=_0x1e5458['get']({'plain':!![]});interaction_log[_0x386d('0x12')](_0x386d('0x69'),_0x398ebc[_0x386d('0x61')]['id'],_0x398ebc[_0x386d('0x61')]['name'],_0x398ebc[_0x386d('0x61')][_0x386d('0x6a')],_0x1602f7[_0x386d('0x68')]['id'],_0x398ebc[_0x386d('0x3f')]?JSON[_0x386d('0x6b')](_0x398ebc['body']):_0x386d('0x6c'));return respondWithRpcPromise(_0x386d('0x6d'),'acceptMessage',_0x1602f7);}return null;})[_0x386d('0x21')](function(_0x56fdf7){var _0x2a4e5a=_0x386d('0x6e')+_0x56fdf7[_0x386d('0x18')][_0x386d('0x6f')];return db['sequelize']['query'](_0x2a4e5a,{'type':db[_0x386d('0x70')][_0x386d('0x71')]['SELECT'],'raw':!![]})[_0x386d('0x21')](function(_0x4f7666){return _0x4f7666;});})[_0x386d('0x21')](function(_0x46d5e7){if(_0x46d5e7){_0x1602f7[_0x386d('0x18')][_0x386d('0x72')]=_0x46d5e7[0x0];if(!_0x398ebc[_0x386d('0x3f')][_0x386d('0x60')])return;return db[_0x386d('0x73')][_0x386d('0x40')]({'where':{'id':_0x398ebc[_0x386d('0x3f')][_0x386d('0x60')],'role':'agent'},'attributes':['id',_0x386d('0x24'),'fullname',_0x386d('0x74'),_0x386d('0x75')],'raw':!![]});}return null;})[_0x386d('0x21')](function(_0x10352b){if(!_0x10352b)return null;_0x1602f7[_0x386d('0x18')][_0x386d('0x62')]=_0x10352b;return _0x1602f7;})['then'](function(_0x4801e1){if(_0x4801e1){if(_0x398ebc[_0x386d('0x3f')]['manual']){_0x1602f7['message'][_0x386d('0x76')]=util[_0x386d('0x5a')]('SIP/%s',_0x398ebc[_0x386d('0x61')][_0x386d('0x24')]);_0x1602f7[_0x386d('0x18')][_0x386d('0x77')]=_0x1602f7[_0x386d('0x77')];_0x1602f7[_0x386d('0x18')][_0x386d('0x78')]=_0x1602f7[_0x386d('0x77')];_0x1602f7[_0x386d('0x18')][_0x386d('0x79')]=_0x386d('0x5c');_0x1602f7[_0x386d('0x18')][_0x386d('0x3f')]=htmlToText['fromString'](_0x1602f7['message'][_0x386d('0x3f')]);return respondWithRpcPromise(_0x386d('0x7a'),_0x386d('0x7a'),{'event':_0x386d('0x7b'),'message':_0x1602f7['message']},client9002)[_0x386d('0x21')](function(){return _0x1602f7;});}return _0x1602f7;}return null;})[_0x386d('0x21')](respondWithResult(_0x2c1514,null))[_0x386d('0x19')](handleError(_0x2c1514,null));};exports[_0x386d('0x7c')]=function(_0x17a852,_0x60e4fd){var _0x4f2c56={'agent':{},'channel':_0x386d('0x5d')};if(_0x17a852[_0x386d('0x3f')]['id']){delete _0x17a852[_0x386d('0x3f')]['id'];}_0x17a852[_0x386d('0x3f')][_0x386d('0x60')]=_0x17a852[_0x386d('0x3f')][_0x386d('0x60')]||_0x17a852[_0x386d('0x61')]['id'];_0x4f2c56[_0x386d('0x62')]['id']=_0x17a852['body']['UserId'];return db['MailMessage'][_0x386d('0x40')]({'where':{'id':_0x17a852[_0x386d('0x3d')]['id'],'UserId':null}})[_0x386d('0x21')](handleEntityNotFound(_0x60e4fd,null))[_0x386d('0x21')](function(_0x21d295){if(_0x21d295){_0x4f2c56['message']=_0x21d295[_0x386d('0x63')]({'plain':!![]});return db[_0x386d('0x64')][_0x386d('0x40')]({'where':{'id':_0x21d295[_0x386d('0x65')]}});}return null;})[_0x386d('0x21')](handleEntityNotFound(_0x60e4fd,null))[_0x386d('0x21')](function(_0x31274d){if(_0x31274d){_0x4f2c56[_0x386d('0x68')]=_0x31274d[_0x386d('0x63')]({'plain':!![]});interaction_log['info'](_0x386d('0x7d'),_0x17a852[_0x386d('0x61')]['id'],_0x17a852[_0x386d('0x61')]['name'],_0x17a852[_0x386d('0x61')]['role'],_0x4f2c56['interaction']['id'],_0x17a852[_0x386d('0x3f')]?JSON[_0x386d('0x6b')](_0x17a852[_0x386d('0x3f')]):'null');return respondWithRpcPromise('RejectMessage',_0x386d('0x7e'),_0x4f2c56);}return null;})[_0x386d('0x21')](function(_0x1bde04){var _0x4db285=_0x386d('0x6e')+_0x1bde04['message']['ContactId'];return db['sequelize']['query'](_0x4db285,{'type':db[_0x386d('0x70')][_0x386d('0x71')]['SELECT'],'raw':!![]})[_0x386d('0x21')](function(_0x58819b){return _0x58819b;});})[_0x386d('0x21')](function(_0x5b662a){if(_0x5b662a){_0x4f2c56['message']['contact']=_0x5b662a[0x0];if(!_0x17a852['body']['UserId'])return;return db[_0x386d('0x73')][_0x386d('0x40')]({'where':{'id':_0x17a852[_0x386d('0x3f')][_0x386d('0x60')],'role':_0x386d('0x62')},'attributes':['id',_0x386d('0x24'),_0x386d('0x7f'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x7376be){if(!_0x7376be)return null;_0x4f2c56[_0x386d('0x18')][_0x386d('0x62')]=_0x7376be;return _0x4f2c56;})[_0x386d('0x21')](function(_0x45838a){if(_0x45838a){_0x45838a[_0x386d('0x18')]['interface']=util[_0x386d('0x5a')](_0x386d('0x80'),_0x17a852[_0x386d('0x61')][_0x386d('0x24')]);_0x45838a['message'][_0x386d('0x77')]=_0x4f2c56[_0x386d('0x77')];_0x45838a[_0x386d('0x18')][_0x386d('0x78')]=_0x4f2c56[_0x386d('0x77')];_0x45838a[_0x386d('0x18')][_0x386d('0x79')]='reject';_0x45838a['message'][_0x386d('0x3f')]=htmlToText[_0x386d('0x81')](_0x4f2c56['message'][_0x386d('0x3f')]);respondWithRpcPromise(_0x386d('0x7a'),_0x386d('0x7a'),{'event':'rejectmessage','message':_0x45838a[_0x386d('0x18')]},client9002);return _0x4f2c56;}return null;})[_0x386d('0x21')](respondWithResult(_0x60e4fd,null))['catch'](handleError(_0x60e4fd,null));};exports['download']=function(_0x234fc2,_0x410a04){var _0x169ddc=moment()[_0x386d('0x82')]()[_0x386d('0x83')]();var _0x3f4e12=path[_0x386d('0x53')](config[_0x386d('0x84')],_0x386d('0x85'),_0x386d('0x86'),_0x386d('0x87'));var _0x319fb4=path['join'](config[_0x386d('0x84')],_0x386d('0x85'),'files',_0x386d('0x52'));var _0x1afc82=util[_0x386d('0x5a')](_0x386d('0x88'),_0x169ddc);return db['MailMessage'][_0x386d('0x40')]({'where':{'id':_0x234fc2['params']['id']},'attributes':['id',_0x386d('0x3f'),_0x386d('0x89'),'to','cc',_0x386d('0x8a'),_0x386d('0x8b'),'createdAt'],'include':_0x234fc2[_0x386d('0x2b')][_0x386d('0x52')]?[{'model':db[_0x386d('0x8c')],'as':'Attachments'}]:undefined})[_0x386d('0x21')](handleEntityNotFound(_0x410a04,null))[_0x386d('0x21')](function(_0x2dc7b2){if(_0x2dc7b2){var _0xfaea8f=_0x2dc7b2;var _0x18c695={'from':_0xfaea8f[_0x386d('0x89')],'to':_0xfaea8f['to'],'subject':_0xfaea8f[_0x386d('0x8b')],'html':htmlEntities[_0x386d('0x8d')](_0xfaea8f[_0x386d('0x3f')]),'headers':{'Date':moment(_0xfaea8f[_0x386d('0x8e')])[_0x386d('0x5a')](_0x386d('0x8f'))},'attachments':[]};if(_0x2dc7b2['cc']){_0x18c695[_0x386d('0x90')]['Cc']=_0x2dc7b2['cc'];}if(_0x2dc7b2['bcc']){_0x18c695['headers'][_0x386d('0x91')]=_0x2dc7b2[_0x386d('0x8a')];}return new BPromise(function(_0x3e0bd8,_0x2bfbd7){if(_0x2dc7b2[_0x386d('0x92')]){for(var _0x3d430e=0x0;_0x3d430e<_0x2dc7b2[_0x386d('0x92')][_0x386d('0x32')];_0x3d430e++){var _0x1dd81a=_0x2dc7b2[_0x386d('0x92')][_0x3d430e];var _0x484640=path[_0x386d('0x53')](_0x319fb4,_0x1dd81a[_0x386d('0x55')]);if(fs[_0x386d('0x93')](_0x484640)){_0x18c695['attachments']['push']({'name':_0x1dd81a[_0x386d('0x24')],'contentType':_0x1dd81a[_0x386d('0x94')],'data':fs[_0x386d('0x95')](_0x484640)});}}}emlformat[_0x386d('0x96')](_0x18c695,function(_0x4a584e,_0x4015da){if(_0x4a584e)return _0x2bfbd7(_0x4a584e);fs[_0x386d('0x97')](path['join'](_0x3f4e12,_0x1afc82),_0x4015da);return _0x3e0bd8(_0x4015da);});});}})['then'](function(_0x1c08af){if(_0x1c08af){return _0x410a04['download'](path[_0x386d('0x53')](_0x3f4e12,_0x1afc82),_0x1afc82,function(_0x20bf45){if(!_0x20bf45)fs[_0x386d('0x98')](path[_0x386d('0x53')](_0x3f4e12,_0x1afc82));});}})['catch'](handleError(_0x410a04,null));}; \ No newline at end of file +var _0x71c5=['../../config/environment','../../mysqldb','redis','localhost','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','info','catch','status','json','offset','limit','count','set','Content-Range','destroy','end','sendStatus','name','index','map','MailMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','model','find','update','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','User','SIP/%s','event','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','decode','headers','bcc','Bcc','Attachments','existsSync','push','writeFileSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger'];(function(_0x581100,_0x5649f5){var _0x1b5d17=function(_0x2d1fd6){while(--_0x2d1fd6){_0x581100['push'](_0x581100['shift']());}};_0x1b5d17(++_0x5649f5);}(_0x71c5,0x92));var _0x571c=function(_0x438287,_0x261d2e){_0x438287=_0x438287-0x0;var _0x1e5146=_0x71c5[_0x438287];return _0x1e5146;};'use strict';var emlformat=require(_0x571c('0x0'));var moment=require(_0x571c('0x1'));var BPromise=require('bluebird');var util=require(_0x571c('0x2'));var path=require(_0x571c('0x3'));var fs=require('fs');var _=require(_0x571c('0x4'));var Redis=require(_0x571c('0x5'));var htmlToText=require(_0x571c('0x6'));var qs=require(_0x571c('0x7'));var logger=require('../../config/logger')('api');var interaction_log=require(_0x571c('0x8'))('mail-interactions');var config=require(_0x571c('0x9'));var db=require(_0x571c('0xa'))['db'];config[_0x571c('0xb')]=_['defaults'](config[_0x571c('0xb')],{'host':_0x571c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x571c('0xb')]));var htmlEntities=require(_0x571c('0xd'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x571c('0xe'));var client=jayson[_0x571c('0xf')][_0x571c('0x10')]({'port':0x232c});var client9003=jayson[_0x571c('0xf')]['http']({'port':0x232b});var client9002=jayson[_0x571c('0xf')][_0x571c('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x5afbc4,_0x57467d,_0x2227bf,_0xdb601d){return new BPromise(function(_0x122c07,_0xe33286){var _0x3b81b6=_0xdb601d||client;return _0x3b81b6[_0x571c('0x11')](_0x5afbc4,_0x2227bf)[_0x571c('0x12')](function(_0x2ab936){logger['info'](_0x571c('0x13'),_0x57467d,_0x571c('0x14'));logger[_0x571c('0x15')](_0x571c('0x16'),_0x57467d,_0x571c('0x14'),JSON[_0x571c('0x17')](_0x2ab936));if(_0x2ab936[_0x571c('0x18')]){if(_0x2ab936['error'][_0x571c('0x19')]===0x1f4){logger[_0x571c('0x18')](_0x571c('0x13'),_0x57467d,_0x2ab936[_0x571c('0x18')]['message']);return _0xe33286(_0x2ab936[_0x571c('0x18')]['message']);}logger[_0x571c('0x18')](_0x571c('0x13'),_0x57467d,_0x2ab936[_0x571c('0x18')][_0x571c('0x1a')]);return _0x122c07(_0x2ab936[_0x571c('0x18')][_0x571c('0x1a')]);}else{logger[_0x571c('0x1b')](_0x571c('0x13'),_0x57467d,_0x571c('0x14'));_0x122c07(_0x2ab936['result']['message']);}})[_0x571c('0x1c')](function(_0x1a0d21){logger[_0x571c('0x18')](_0x571c('0x13'),_0x57467d,_0x1a0d21);_0xe33286(_0x1a0d21);});});}function respondWithResult(_0x22c0e5,_0x1612d2){_0x1612d2=_0x1612d2||0xc8;return function(_0x2f353c){if(_0x2f353c){return _0x22c0e5[_0x571c('0x1d')](_0x1612d2)[_0x571c('0x1e')](_0x2f353c);}};}function respondWithFilteredResult(_0x16ccf0,_0x671bf1){return function(_0x54f67d){if(_0x54f67d){var _0x3c01c5=typeof _0x671bf1[_0x571c('0x1f')]==='undefined'&&typeof _0x671bf1[_0x571c('0x20')]==='undefined';var _0xa5671b=_0x54f67d[_0x571c('0x21')];var _0x31390e=_0x3c01c5?0x0:_0x671bf1[_0x571c('0x1f')];var _0x8e42f3=_0x3c01c5?_0x54f67d[_0x571c('0x21')]:_0x671bf1[_0x571c('0x1f')]+_0x671bf1[_0x571c('0x20')];var _0x475351;if(_0x8e42f3>=_0xa5671b){_0x8e42f3=_0xa5671b;_0x475351=0xc8;}else{_0x475351=0xce;}_0x16ccf0[_0x571c('0x1d')](_0x475351);return _0x16ccf0[_0x571c('0x22')](_0x571c('0x23'),_0x31390e+'-'+_0x8e42f3+'/'+_0xa5671b)['json'](_0x54f67d);}return null;};}function saveUpdates(_0x1c689f){return function(_0x1f2939){if(_0x1f2939){return _0x1f2939['update'](_0x1c689f)[_0x571c('0x12')](function(_0x28cc8c){return _0x28cc8c;});}return null;};}function removeEntity(_0x5eb796){return function(_0xaf8f6d){if(_0xaf8f6d){return _0xaf8f6d[_0x571c('0x24')]()['then'](function(){_0x5eb796[_0x571c('0x1d')](0xcc)[_0x571c('0x25')]();});}};}function handleEntityNotFound(_0xf05355){return function(_0x385f38){if(!_0x385f38){_0xf05355[_0x571c('0x26')](0x194);}return _0x385f38;};}function handleError(_0x52d337,_0x875910){_0x875910=_0x875910||0x1f4;return function(_0x4c50c0){logger[_0x571c('0x18')](_0x4c50c0['stack']);if(_0x4c50c0[_0x571c('0x27')]){delete _0x4c50c0['name'];}_0x52d337[_0x571c('0x1d')](_0x875910)['send'](_0x4c50c0);};}exports[_0x571c('0x28')]=function(_0x1deea7,_0xabd51a){var _0x13ebfc={},_0x5e8209={},_0x3b89fa={'count':0x0,'rows':[]};var _0x543b1e=_[_0x571c('0x29')](db[_0x571c('0x2a')][_0x571c('0x2b')],function(_0xd7d32){return{'name':_0xd7d32[_0x571c('0x2c')],'type':_0xd7d32[_0x571c('0x2d')]['key']};});_0x5e8209['model']=_[_0x571c('0x29')](_0x543b1e,'name');_0x5e8209[_0x571c('0x2e')]=_[_0x571c('0x2f')](_0x1deea7[_0x571c('0x2e')]);_0x5e8209[_0x571c('0x30')]=_[_0x571c('0x31')](_0x5e8209['model'],_0x5e8209['query']);_0x13ebfc[_0x571c('0x32')]=_['intersection'](_0x5e8209['model'],qs[_0x571c('0x33')](_0x1deea7[_0x571c('0x2e')][_0x571c('0x33')]));_0x13ebfc['attributes']=_0x13ebfc['attributes'][_0x571c('0x34')]?_0x13ebfc[_0x571c('0x32')]:_0x5e8209['model'];if(!_0x1deea7[_0x571c('0x2e')][_0x571c('0x35')](_0x571c('0x36'))){_0x13ebfc['limit']=qs[_0x571c('0x20')](_0x1deea7[_0x571c('0x2e')][_0x571c('0x20')]);_0x13ebfc[_0x571c('0x1f')]=qs[_0x571c('0x1f')](_0x1deea7[_0x571c('0x2e')][_0x571c('0x1f')]);}_0x13ebfc[_0x571c('0x37')]=qs['sort'](_0x1deea7[_0x571c('0x2e')]['sort']);_0x13ebfc[_0x571c('0x38')]=qs[_0x571c('0x30')](_[_0x571c('0x39')](_0x1deea7[_0x571c('0x2e')],_0x5e8209['filters']),_0x543b1e);if(_0x1deea7[_0x571c('0x2e')][_0x571c('0x3a')]){_0x13ebfc[_0x571c('0x38')]=_[_0x571c('0x3b')](_0x13ebfc[_0x571c('0x38')],{'$or':_['map'](_0x543b1e,function(_0xb47507){if(_0xb47507[_0x571c('0x2d')]!==_0x571c('0x3c')){var _0x27ab8e={};_0x27ab8e[_0xb47507[_0x571c('0x27')]]={'$like':'%'+_0x1deea7[_0x571c('0x2e')][_0x571c('0x3a')]+'%'};return _0x27ab8e;}})});}_0x13ebfc=_[_0x571c('0x3b')]({},_0x13ebfc,_0x1deea7[_0x571c('0x3d')]);var _0x4d3091={'where':_0x13ebfc[_0x571c('0x38')]};return db[_0x571c('0x2a')]['count'](_0x4d3091)[_0x571c('0x12')](function(_0x4d107b){_0x3b89fa[_0x571c('0x21')]=_0x4d107b;if(_0x1deea7[_0x571c('0x2e')]['includeAll']){_0x13ebfc[_0x571c('0x3e')]=[{'all':!![]}];}return db[_0x571c('0x2a')][_0x571c('0x3f')](_0x13ebfc);})[_0x571c('0x12')](function(_0x530778){_0x3b89fa['rows']=_0x530778;return _0x3b89fa;})[_0x571c('0x12')](respondWithFilteredResult(_0xabd51a,_0x13ebfc))[_0x571c('0x1c')](handleError(_0xabd51a,null));};exports['show']=function(_0x346fe3,_0x1d6ce3){var _0x19f2f4={'raw':!![],'where':{'id':_0x346fe3['params']['id']}},_0x462e67={};_0x462e67[_0x571c('0x40')]=_[_0x571c('0x2f')](db[_0x571c('0x2a')][_0x571c('0x2b')]);_0x462e67['query']=_[_0x571c('0x2f')](_0x346fe3['query']);_0x462e67[_0x571c('0x30')]=_[_0x571c('0x31')](_0x462e67['model'],_0x462e67[_0x571c('0x2e')]);_0x19f2f4[_0x571c('0x32')]=_[_0x571c('0x31')](_0x462e67[_0x571c('0x40')],qs[_0x571c('0x33')](_0x346fe3[_0x571c('0x2e')]['fields']));_0x19f2f4[_0x571c('0x32')]=_0x19f2f4[_0x571c('0x32')]['length']?_0x19f2f4[_0x571c('0x32')]:_0x462e67['model'];if(_0x346fe3[_0x571c('0x2e')]['includeAll']){_0x19f2f4[_0x571c('0x3e')]=[{'all':!![]}];}_0x19f2f4=_[_0x571c('0x3b')]({},_0x19f2f4,_0x346fe3[_0x571c('0x3d')]);return db[_0x571c('0x2a')][_0x571c('0x41')](_0x19f2f4)['then'](handleEntityNotFound(_0x1d6ce3,null))[_0x571c('0x12')](respondWithResult(_0x1d6ce3,null))['catch'](handleError(_0x1d6ce3,null));};exports[_0x571c('0x42')]=function(_0x5bad98,_0x100dde){if(_0x5bad98[_0x571c('0x43')]['id']){delete _0x5bad98[_0x571c('0x43')]['id'];}return db[_0x571c('0x2a')][_0x571c('0x41')]({'where':{'id':_0x5bad98[_0x571c('0x44')]['id']}})[_0x571c('0x12')](handleEntityNotFound(_0x100dde,null))[_0x571c('0x12')](saveUpdates(_0x5bad98[_0x571c('0x43')],null))[_0x571c('0x12')](respondWithResult(_0x100dde,null))[_0x571c('0x1c')](handleError(_0x100dde,null));};exports[_0x571c('0x24')]=function(_0x2f84d6,_0x4612af){return db[_0x571c('0x2a')][_0x571c('0x41')]({'where':{'id':_0x2f84d6[_0x571c('0x44')]['id']}})[_0x571c('0x12')](handleEntityNotFound(_0x4612af,null))[_0x571c('0x12')](removeEntity(_0x4612af,null))['catch'](handleError(_0x4612af,null));};exports[_0x571c('0x45')]=function(_0x3124e3,_0x4654af){return db['MailMessage'][_0x571c('0x45')]()[_0x571c('0x12')](respondWithResult(_0x4654af,null))['catch'](handleError(_0x4654af,null));};exports[_0x571c('0x46')]=function(_0xb020dc,_0x320147){return db[_0x571c('0x2a')][_0x571c('0x46')](_0xb020dc[_0x571c('0x43')])[_0x571c('0x12')](function(_0x3fa3e4){if(_0x3fa3e4){if(_0x3fa3e4[_0x571c('0x47')]===_0x571c('0x48')&&!_0x3fa3e4[_0x571c('0x49')]){var _0x18d6e6,_0x3bea63,_0xeae9bf;if(_0xb020dc[_0x571c('0x43')]['to']){_0x3bea63=_0xb020dc[_0x571c('0x43')]['to'][_0x571c('0x4a')](',')[0x0];}return db[_0x571c('0x4b')][_0x571c('0x4c')]({'where':{'id':_0x3fa3e4[_0x571c('0x4d')]},'include':[{'model':db[_0x571c('0x4e')],'as':_0x571c('0x4f'),'include':[{'model':db[_0x571c('0x50')],'as':_0x571c('0x51'),'where':{'email':_0x3bea63},'limit':0x1,'order':[[_0x571c('0x52'),_0x571c('0x53')]]}]},{'model':db[_0x571c('0x54')],'as':_0x571c('0x55'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x571c('0x12')](function(_0x4f5d9a){_0x18d6e6=_0x4f5d9a;if(!_0x18d6e6||!_0x18d6e6[_0x571c('0x55')])return;var _0x49719a=_0x18d6e6[_0x571c('0x56')]();if(_0xb020dc[_0x571c('0x43')][_0x571c('0x57')]&&_0xb020dc['body'][_0x571c('0x57')]['length']){for(var _0x9d0f44=0x0;_0x9d0f44<_0xb020dc[_0x571c('0x43')][_0x571c('0x57')][_0x571c('0x34')];_0x9d0f44+=0x1){_0xb020dc[_0x571c('0x43')][_0x571c('0x57')][_0x9d0f44]={'filename':_0xb020dc['body']['attachments'][_0x9d0f44][_0x571c('0x27')],'path':path[_0x571c('0x58')](config['root'],_0x571c('0x59'),_0xb020dc[_0x571c('0x43')][_0x571c('0x57')][_0x9d0f44][_0x571c('0x5a')])};}}_0xeae9bf={'account':_0x49719a,'message':_0xb020dc[_0x571c('0x43')]};return;})['then'](function(){if(_0x18d6e6['List']){if(_0x18d6e6[_0x571c('0x4f')][_0x571c('0x51')]['length']){return _0x18d6e6['List'][_0x571c('0x51')][0x0];}else{return db[_0x571c('0x50')][_0x571c('0x46')](_[_0x571c('0x5b')](_0xb020dc[_0x571c('0x43')],{'firstName':_0xb020dc['body']['to'],'email':_0xb020dc[_0x571c('0x43')]['to'],'phone':_0xb020dc[_0x571c('0x43')]['to'],'ListId':_0x18d6e6[_0x571c('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x571c('0x12')](function(){if(_0xeae9bf){return respondWithRpcPromise(_0x571c('0x5d'),_0x571c('0x5e'),_0xeae9bf,client9003)[_0x571c('0x12')](function(_0xd7efcc){return _0x3fa3e4[_0x571c('0x42')]({'read':!![],'messageId':_0xd7efcc[_0x571c('0x5f')],'sentAt':moment()[_0x571c('0x60')](_0x571c('0x61'))});})[_0x571c('0x1c')](function(_0x2392d4){logger[_0x571c('0x18')]('%s',JSON[_0x571c('0x17')](_0x2392d4));return _0x3fa3e4;});}return _0x3fa3e4;});}return _0x3fa3e4;}})[_0x571c('0x12')](respondWithResult(_0x320147,0xc9))[_0x571c('0x1c')](handleError(_0x320147,null));};exports['accept']=function(_0x5ae96a,_0x5a4a3e){var _0x2a2b66={'agent':{},'channel':_0x571c('0x62')};if(_0x5ae96a[_0x571c('0x43')]['id']){delete _0x5ae96a[_0x571c('0x43')]['id'];}_0x5ae96a[_0x571c('0x43')][_0x571c('0x63')]=!![];_0x5ae96a[_0x571c('0x43')][_0x571c('0x64')]=moment()[_0x571c('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')]=_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')]||_0x5ae96a[_0x571c('0x66')]['id'];_0x2a2b66[_0x571c('0x67')]['id']=_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')];return db[_0x571c('0x2a')][_0x571c('0x41')]({'where':{'id':_0x5ae96a[_0x571c('0x44')]['id'],'UserId':null}})[_0x571c('0x12')](handleEntityNotFound(_0x5a4a3e,null))[_0x571c('0x12')](saveUpdates(_0x5ae96a[_0x571c('0x43')],null))[_0x571c('0x12')](function(_0x31898f){if(_0x31898f){_0x2a2b66[_0x571c('0x1a')]=_0x31898f[_0x571c('0x68')]({'plain':!![]});return db[_0x571c('0x69')]['find']({'where':{'id':_0x31898f[_0x571c('0x6a')]}});}return null;})[_0x571c('0x12')](handleEntityNotFound(_0x5a4a3e,null))[_0x571c('0x12')](function(_0x56abf2){if(_0x56abf2){return _0x56abf2['update']({'UserId':_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')],'read1stAt':_['isNil'](_0x56abf2[_0x571c('0x6b')])?moment()[_0x571c('0x60')](_0x571c('0x61')):undefined});}return null;})[_0x571c('0x12')](function(_0x4aa9fc){if(_0x4aa9fc){_0x2a2b66[_0x571c('0x6c')]=_0x4aa9fc[_0x571c('0x68')]({'plain':!![]});interaction_log[_0x571c('0x1b')](_0x571c('0x6d'),_0x5ae96a[_0x571c('0x66')]['id'],_0x5ae96a['user'][_0x571c('0x27')],_0x5ae96a[_0x571c('0x66')]['role'],_0x2a2b66[_0x571c('0x6c')]['id'],_0x5ae96a[_0x571c('0x43')]?JSON[_0x571c('0x17')](_0x5ae96a['body']):_0x571c('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x571c('0x6f'),_0x2a2b66);}return null;})['then'](function(_0x2db4bf){var _0x2e2023=_0x571c('0x70')+_0x2db4bf[_0x571c('0x1a')][_0x571c('0x71')];return db['sequelize'][_0x571c('0x2e')](_0x2e2023,{'type':db[_0x571c('0x72')][_0x571c('0x73')][_0x571c('0x74')],'raw':!![]})[_0x571c('0x12')](function(_0x43effe){return _0x43effe;});})['then'](function(_0x1ec09c){if(_0x1ec09c){_0x2a2b66[_0x571c('0x1a')][_0x571c('0x75')]=_0x1ec09c[0x0];if(!_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')])return;return db['User'][_0x571c('0x41')]({'where':{'id':_0x5ae96a[_0x571c('0x43')][_0x571c('0x65')],'role':_0x571c('0x67')},'attributes':['id',_0x571c('0x27'),_0x571c('0x76'),_0x571c('0x77'),_0x571c('0x78')],'raw':!![]});}return null;})[_0x571c('0x12')](function(_0xf274cd){if(!_0xf274cd)return null;_0x2a2b66[_0x571c('0x1a')][_0x571c('0x67')]=_0xf274cd;return _0x2a2b66;})[_0x571c('0x12')](function(_0x5c0cdc){if(_0x5c0cdc){if(_0x5ae96a[_0x571c('0x43')][_0x571c('0x79')]){_0x2a2b66[_0x571c('0x1a')][_0x571c('0x7a')]=util[_0x571c('0x60')]('SIP/%s',_0x5ae96a['user'][_0x571c('0x27')]);_0x2a2b66['message']['channel']=_0x2a2b66['channel'];_0x2a2b66[_0x571c('0x1a')]['motionChannel']=_0x2a2b66[_0x571c('0x7b')];_0x2a2b66[_0x571c('0x1a')]['event']='accept';_0x2a2b66[_0x571c('0x1a')][_0x571c('0x43')]=htmlToText[_0x571c('0x7c')](_0x2a2b66[_0x571c('0x1a')][_0x571c('0x43')]);return respondWithRpcPromise(_0x571c('0x7d'),_0x571c('0x7d'),{'event':_0x571c('0x7e'),'message':_0x2a2b66[_0x571c('0x1a')]},client9002)[_0x571c('0x12')](function(){return _0x2a2b66;});}return _0x2a2b66;}return null;})['then'](respondWithResult(_0x5a4a3e,null))[_0x571c('0x1c')](handleError(_0x5a4a3e,null));};exports[_0x571c('0x7f')]=function(_0x3b76cc,_0xc66664){var _0x592c03={'agent':{},'channel':_0x571c('0x62')};if(_0x3b76cc[_0x571c('0x43')]['id']){delete _0x3b76cc[_0x571c('0x43')]['id'];}_0x3b76cc['body'][_0x571c('0x65')]=_0x3b76cc[_0x571c('0x43')][_0x571c('0x65')]||_0x3b76cc[_0x571c('0x66')]['id'];_0x592c03[_0x571c('0x67')]['id']=_0x3b76cc[_0x571c('0x43')]['UserId'];return db[_0x571c('0x2a')][_0x571c('0x41')]({'where':{'id':_0x3b76cc[_0x571c('0x44')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc66664,null))['then'](function(_0xb971ec){if(_0xb971ec){_0x592c03[_0x571c('0x1a')]=_0xb971ec[_0x571c('0x68')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0xb971ec[_0x571c('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0xc66664,null))['then'](function(_0x59c956){if(_0x59c956){_0x592c03[_0x571c('0x6c')]=_0x59c956[_0x571c('0x68')]({'plain':!![]});interaction_log['info'](_0x571c('0x80'),_0x3b76cc[_0x571c('0x66')]['id'],_0x3b76cc[_0x571c('0x66')][_0x571c('0x27')],_0x3b76cc[_0x571c('0x66')][_0x571c('0x81')],_0x592c03[_0x571c('0x6c')]['id'],_0x3b76cc['body']?JSON['stringify'](_0x3b76cc[_0x571c('0x43')]):'null');return respondWithRpcPromise('RejectMessage',_0x571c('0x82'),_0x592c03);}return null;})['then'](function(_0x4dff4e){var _0x96c1f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4dff4e[_0x571c('0x1a')][_0x571c('0x71')];return db['sequelize'][_0x571c('0x2e')](_0x96c1f,{'type':db[_0x571c('0x72')][_0x571c('0x73')][_0x571c('0x74')],'raw':!![]})['then'](function(_0x297e2b){return _0x297e2b;});})['then'](function(_0x53d652){if(_0x53d652){_0x592c03[_0x571c('0x1a')][_0x571c('0x75')]=_0x53d652[0x0];if(!_0x3b76cc['body'][_0x571c('0x65')])return;return db[_0x571c('0x83')]['find']({'where':{'id':_0x3b76cc[_0x571c('0x43')]['UserId'],'role':'agent'},'attributes':['id','name',_0x571c('0x76'),_0x571c('0x77'),'internal'],'raw':!![]});}return null;})[_0x571c('0x12')](function(_0x51fc0b){if(!_0x51fc0b)return null;_0x592c03['message'][_0x571c('0x67')]=_0x51fc0b;return _0x592c03;})[_0x571c('0x12')](function(_0x4d6e7d){if(_0x4d6e7d){_0x4d6e7d['message'][_0x571c('0x7a')]=util[_0x571c('0x60')](_0x571c('0x84'),_0x3b76cc[_0x571c('0x66')][_0x571c('0x27')]);_0x4d6e7d[_0x571c('0x1a')][_0x571c('0x7b')]=_0x592c03[_0x571c('0x7b')];_0x4d6e7d[_0x571c('0x1a')]['motionChannel']=_0x592c03['channel'];_0x4d6e7d['message'][_0x571c('0x85')]=_0x571c('0x7f');_0x4d6e7d[_0x571c('0x1a')][_0x571c('0x43')]=htmlToText[_0x571c('0x7c')](_0x592c03[_0x571c('0x1a')]['body']);respondWithRpcPromise(_0x571c('0x7d'),'EventManager',{'event':_0x571c('0x86'),'message':_0x4d6e7d['message']},client9002);return _0x592c03;}return null;})[_0x571c('0x12')](respondWithResult(_0xc66664,null))[_0x571c('0x1c')](handleError(_0xc66664,null));};exports[_0x571c('0x87')]=function(_0x3372fb,_0x169979){var _0x38c0e7=moment()[_0x571c('0x88')]()[_0x571c('0x89')]();var _0x4e6e33=path[_0x571c('0x58')](config[_0x571c('0x8a')],_0x571c('0x8b'),_0x571c('0x8c'),_0x571c('0x8d'));var _0x35d643=path[_0x571c('0x58')](config[_0x571c('0x8a')],'server',_0x571c('0x8c'),_0x571c('0x57'));var _0xfdd4a1=util[_0x571c('0x60')](_0x571c('0x8e'),_0x38c0e7);return db['MailMessage'][_0x571c('0x41')]({'where':{'id':_0x3372fb[_0x571c('0x44')]['id']},'attributes':['id',_0x571c('0x43'),_0x571c('0x8f'),'to','cc','bcc',_0x571c('0x90'),_0x571c('0x91')],'include':_0x3372fb[_0x571c('0x2e')][_0x571c('0x57')]?[{'model':db[_0x571c('0x92')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x169979,null))[_0x571c('0x12')](function(_0x41ada7){if(_0x41ada7){var _0x49248a=_0x41ada7;var _0x43b5dc={'from':_0x49248a[_0x571c('0x8f')],'to':_0x49248a['to'],'subject':_0x49248a[_0x571c('0x90')],'html':htmlEntities[_0x571c('0x93')](_0x49248a[_0x571c('0x43')]),'headers':{'Date':moment(_0x49248a[_0x571c('0x91')])[_0x571c('0x60')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x41ada7['cc']){_0x43b5dc[_0x571c('0x94')]['Cc']=_0x41ada7['cc'];}if(_0x41ada7[_0x571c('0x95')]){_0x43b5dc[_0x571c('0x94')][_0x571c('0x96')]=_0x41ada7[_0x571c('0x95')];}return new BPromise(function(_0x1ab6b5,_0x32fe54){if(_0x41ada7[_0x571c('0x97')]){for(var _0x2e6626=0x0;_0x2e6626<_0x41ada7[_0x571c('0x97')][_0x571c('0x34')];_0x2e6626++){var _0x1eb5f4=_0x41ada7[_0x571c('0x97')][_0x2e6626];var _0x396e85=path['join'](_0x35d643,_0x1eb5f4[_0x571c('0x5a')]);if(fs[_0x571c('0x98')](_0x396e85)){_0x43b5dc[_0x571c('0x57')][_0x571c('0x99')]({'name':_0x1eb5f4[_0x571c('0x27')],'contentType':_0x1eb5f4[_0x571c('0x2d')],'data':fs['readFileSync'](_0x396e85)});}}}emlformat['build'](_0x43b5dc,function(_0x52fe79,_0x163ccb){if(_0x52fe79)return _0x32fe54(_0x52fe79);fs[_0x571c('0x9a')](path[_0x571c('0x58')](_0x4e6e33,_0xfdd4a1),_0x163ccb);return _0x1ab6b5(_0x163ccb);});});}})[_0x571c('0x12')](function(_0x37b6d0){if(_0x37b6d0){return _0x169979[_0x571c('0x87')](path['join'](_0x4e6e33,_0xfdd4a1),_0xfdd4a1,function(_0xd8ef00){if(!_0xd8ef00)fs['unlinkSync'](path[_0x571c('0x58')](_0x4e6e33,_0xfdd4a1));});}})[_0x571c('0x1c')](handleError(_0x169979,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 4c72e23..d7d1d39 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 _0x3310=['../../mysqldb','MailMessage','setMaxListeners','update','emit','hook','exports','events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3310,0x1df));var _0x0331=function(_0x208808,_0x4eb5b0){_0x208808=_0x208808-0x0;var _0xe6c0e0=_0x3310[_0x208808];return _0xe6c0e0;};'use strict';var EventEmitter=require(_0x0331('0x0'));var MailMessage=require(_0x0331('0x1'))['db'][_0x0331('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0331('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0331('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f6e09){return function(_0x52fb92,_0x1552f0,_0xb501cd){MailMessageEvents[_0x0331('0x5')](_0x5f6e09+':'+_0x52fb92['id'],_0x52fb92);MailMessageEvents[_0x0331('0x5')](_0x5f6e09,_0x52fb92);_0xb501cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x0331('0x6')](e,emitEvent(event));}}module[_0x0331('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xed91=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb','MailMessage'];(function(_0x488b85,_0x10ec23){var _0x59d07d=function(_0x16838b){while(--_0x16838b){_0x488b85['push'](_0x488b85['shift']());}};_0x59d07d(++_0x10ec23);}(_0xed91,0x19e));var _0x1ed9=function(_0x3be19,_0x2c6bd8){_0x3be19=_0x3be19-0x0;var _0x4d8c32=_0xed91[_0x3be19];return _0x4d8c32;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x1ed9('0x0'))['db'][_0x1ed9('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1ed9('0x2')](0x0);var events={'afterCreate':_0x1ed9('0x3'),'afterUpdate':_0x1ed9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55d53f){return function(_0x56ba91,_0x1e86ac,_0xfe113d){MailMessageEvents[_0x1ed9('0x5')](_0x55d53f+':'+_0x56ba91['id'],_0x56ba91);MailMessageEvents[_0x1ed9('0x5')](_0x55d53f,_0x56ba91);_0xfe113d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x1ed9('0x6')](e,emitEvent(event));}}module[_0x1ed9('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b50312c..add8a1b 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 _0x5719=['../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','secret','isNil','UserId','findOne','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf'];(function(_0x358548,_0x1be5eb){var _0x5d19e6=function(_0x4856c7){while(--_0x4856c7){_0x358548['push'](_0x358548['shift']());}};_0x5d19e6(++_0x1be5eb);}(_0x5719,0xec));var _0x9571=function(_0x13ff1b,_0x44a638){_0x13ff1b=_0x13ff1b-0x0;var _0x2d936c=_0x5719[_0x13ff1b];return _0x2d936c;};'use strict';var _=require(_0x9571('0x0'));var util=require(_0x9571('0x1'));var logger=require(_0x9571('0x2'))('api');var moment=require(_0x9571('0x3'));var BPromise=require(_0x9571('0x4'));var rp=require(_0x9571('0x5'));var htmlToText=require(_0x9571('0x6'));var fs=require('fs');var path=require(_0x9571('0x7'));var rimraf=require(_0x9571('0x8'));var config=require(_0x9571('0x9'));var attributes=require(_0x9571('0xa'));module[_0x9571('0xb')]=function(_0x47141d,_0x37cb2c){return _0x47141d[_0x9571('0xc')](_0x9571('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9571('0xe'),'fields':[_0x9571('0xe')]},{'name':_0x9571('0xf'),'fields':[_0x9571('0x10'),_0x9571('0x11')],'type':_0x9571('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50b816,_0x611919,_0x4dcebc){if(_0x50b816[_0x9571('0x13')]){_0x50b816[_0x9571('0x10')]=htmlToText[_0x9571('0x14')](_0x50b816[_0x9571('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4dcebc(null,_0x611919);},'afterCreate':function(_0x5df278,_0x28a999,_0x1f2b26){var _0x23932c=_0x47141d[_0x9571('0x15')];var _0x20ceb9=_0x5df278['get']({'plain':!![]});if(_0x20ceb9[_0x9571('0x16')][_0x9571('0x17')]()==='in'||_0x20ceb9['direction'][_0x9571('0x17')]()==='out'&&!_0x20ceb9[_0x9571('0x18')]&&!_[_0x9571('0x19')](_0x20ceb9[_0x9571('0x1a')])){_0x23932c['MailInteraction'][_0x9571('0x1b')]({'where':{'id':_0x20ceb9[_0x9571('0x1c')]}})[_0x9571('0x1d')](function(_0x4e9588){if(_0x4e9588){_0x4e9588[_0x9571('0x1e')]({'lastMsgAt':_0x20ceb9['createdAt'],'lastMsgDirection':_0x20ceb9[_0x9571('0x16')][_0x9571('0x17')]()});}})[_0x9571('0x1f')](function(_0x224b33){console[_0x9571('0x20')](_0x224b33);});}_0x1f2b26();}},'charset':_0x9571('0x21'),'collate':_0x9571('0x22')});}; \ No newline at end of file +var _0xed4b=['catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','models','toLowerCase','direction','out','secret','isNil','MailInteraction','MailInteractionId','then','update','createdAt'];(function(_0x20d5b2,_0x256831){var _0xa268a1=function(_0x49b212){while(--_0x49b212){_0x20d5b2['push'](_0x20d5b2['shift']());}};_0xa268a1(++_0x256831);}(_0xed4b,0x1c5));var _0xbed4=function(_0x328bae,_0x4289c7){_0x328bae=_0x328bae-0x0;var _0x58a8d7=_0xed4b[_0x328bae];return _0x58a8d7;};'use strict';var _=require(_0xbed4('0x0'));var util=require(_0xbed4('0x1'));var logger=require(_0xbed4('0x2'))('api');var moment=require(_0xbed4('0x3'));var BPromise=require(_0xbed4('0x4'));var rp=require('request-promise');var htmlToText=require(_0xbed4('0x5'));var fs=require('fs');var path=require(_0xbed4('0x6'));var rimraf=require(_0xbed4('0x7'));var config=require('../../config/environment');var attributes=require(_0xbed4('0x8'));module['exports']=function(_0x3a313b,_0x504b7b){return _0x3a313b['define'](_0xbed4('0x9'),attributes,{'tableName':_0xbed4('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xbed4('0xb')]},{'name':_0xbed4('0xc'),'fields':['plainBody',_0xbed4('0xd')],'type':_0xbed4('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27bdc0,_0x2393fc,_0x3c86e1){if(_0x27bdc0['body']){_0x27bdc0['plainBody']=htmlToText['fromString'](_0x27bdc0[_0xbed4('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3c86e1(null,_0x2393fc);},'afterCreate':function(_0x32c045,_0xac2deb,_0x23fdbe){var _0x296ba9=_0x3a313b[_0xbed4('0x10')];var _0x47aeee=_0x32c045['get']({'plain':!![]});if(_0x47aeee['direction'][_0xbed4('0x11')]()==='in'||_0x47aeee[_0xbed4('0x12')][_0xbed4('0x11')]()===_0xbed4('0x13')&&!_0x47aeee[_0xbed4('0x14')]&&!_[_0xbed4('0x15')](_0x47aeee['UserId'])){_0x296ba9[_0xbed4('0x16')]['findOne']({'where':{'id':_0x47aeee[_0xbed4('0x17')]}})[_0xbed4('0x18')](function(_0x67a4fb){if(_0x67a4fb){_0x67a4fb[_0xbed4('0x19')]({'lastMsgAt':_0x47aeee[_0xbed4('0x1a')],'lastMsgDirection':_0x47aeee['direction'][_0xbed4('0x11')]()});}})[_0xbed4('0x1b')](function(_0x1b2e35){console[_0xbed4('0x1c')](_0x1b2e35);});}_0x23fdbe();}},'charset':'utf8mb4','collate':_0xbed4('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 033c208..4da9cff 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 _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body'];(function(_0x28a043,_0x3d894d){var _0x48a72b=function(_0x4ea9e2){while(--_0x4ea9e2){_0x28a043['push'](_0x28a043['shift']());}};_0x48a72b(++_0x3d894d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b432a,_0x578c42){_0x4b432a=_0x4b432a-0x0;var _0x505158=_0xb10b[_0x4b432a];return _0x505158;};'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});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);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('MailMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file +var _0x7708=['info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','catch','lodash','util','bluebird','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7708,0x188));var _0x8770=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x7708[_0x359bbe];return _0x1b3353;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var moment=require('moment');var BPromise=require(_0x8770('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8770('0x3'))(_0x8770('0x4'));var config=require('../../config/environment');var jayson=require(_0x8770('0x5'));var client=jayson['client'][_0x8770('0x6')]({'port':0x232a});config[_0x8770('0x7')]=_[_0x8770('0x8')](config[_0x8770('0x7')],{'host':_0x8770('0x9'),'port':0x18eb});var socket=require(_0x8770('0xa'))(new Redis(config[_0x8770('0x7')]));require('./mailMessage.socket')[_0x8770('0xb')](socket);function respondWithRpcPromise(_0x2ca830,_0x3f357a,_0x4e4551){return new BPromise(function(_0x390af0,_0x10e4a3){return client[_0x8770('0xc')](_0x2ca830,_0x4e4551)[_0x8770('0xd')](function(_0x4a0ca1){logger[_0x8770('0xe')](_0x8770('0xf'),_0x3f357a,_0x8770('0x10'));logger['debug'](_0x8770('0x11'),_0x3f357a,_0x8770('0x10'),JSON[_0x8770('0x12')](_0x4a0ca1));if(_0x4a0ca1[_0x8770('0x13')]){if(_0x4a0ca1[_0x8770('0x13')][_0x8770('0x14')]===0x1f4){logger[_0x8770('0x13')](_0x8770('0xf'),_0x3f357a,_0x4a0ca1['error'][_0x8770('0x15')]);return _0x10e4a3(_0x4a0ca1[_0x8770('0x13')]['message']);}logger[_0x8770('0x13')]('MailMessage,\x20%s,\x20%s',_0x3f357a,_0x4a0ca1[_0x8770('0x13')]['message']);return _0x390af0(_0x4a0ca1['error']['message']);}else{logger[_0x8770('0xe')](_0x8770('0xf'),_0x3f357a,_0x8770('0x10'));_0x390af0(_0x4a0ca1[_0x8770('0x16')]['message']);}})['catch'](function(_0x349bd4){logger[_0x8770('0x13')](_0x8770('0xf'),_0x3f357a,_0x349bd4);_0x10e4a3(_0x349bd4);});});}exports[_0x8770('0x17')]=function(_0x4d2c7e){var _0x4e1fa6=this;return new Promise(function(_0x3e1fe7,_0x1234dd){return db[_0x8770('0x18')][_0x8770('0x19')](_0x4d2c7e['body'],{'raw':_0x4d2c7e['options']?_0x4d2c7e[_0x8770('0x1a')][_0x8770('0x1b')]===undefined?!![]:![]:!![]})[_0x8770('0xd')](function(_0x2918a7){logger[_0x8770('0xe')](_0x8770('0x17'),_0x4d2c7e);logger['debug'](_0x8770('0x17'),_0x4d2c7e,JSON[_0x8770('0x12')](_0x2918a7));_0x3e1fe7(_0x2918a7);})[_0x8770('0x1c')](function(_0x2515c5){logger['error'](_0x8770('0x17'),_0x2515c5['message'],_0x4d2c7e);_0x1234dd(_0x4e1fa6[_0x8770('0x13')](0x1f4,_0x2515c5[_0x8770('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8d29632..617a966 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 _0x7df8=['length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7df8,0x1a0));var _0x87df=function(_0x26834f,_0x18f679){_0x26834f=_0x26834f-0x0;var _0x11c269=_0x7df8[_0x26834f];return _0x11c269;};'use strict';var MailMessageEvents=require(_0x87df('0x0'));var events=[_0x87df('0x1'),_0x87df('0x2'),_0x87df('0x3')];function createListener(_0x44e349,_0x3de7e2){return function(_0x4c4855){_0x3de7e2['emit'](_0x44e349,_0x4c4855);};}function removeListener(_0x3b9929,_0x15108c){return function(){MailMessageEvents['removeListener'](_0x3b9929,_0x15108c);};}exports['register']=function(_0x5e4e9e){for(var _0x5a1aac=0x0,_0x49f565=events[_0x87df('0x4')];_0x5a1aac<_0x49f565;_0x5a1aac++){var _0x41b41f=events[_0x5a1aac];var _0x3daa75=createListener(_0x87df('0x5')+_0x41b41f,_0x5e4e9e);MailMessageEvents['on'](_0x41b41f,_0x3daa75);}}; \ No newline at end of file +var _0xaaea=['removeListener','length','mailMessage:','save','update','emit'];(function(_0x31e4f5,_0xd1ba1){var _0x341a7e=function(_0x59ba5b){while(--_0x59ba5b){_0x31e4f5['push'](_0x31e4f5['shift']());}};_0x341a7e(++_0xd1ba1);}(_0xaaea,0x183));var _0xaaae=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xaaea[_0x17d9e3];return _0x14192d;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xaaae('0x0'),'remove',_0xaaae('0x1')];function createListener(_0x1961bd,_0x507490){return function(_0x4b6def){_0x507490[_0xaaae('0x2')](_0x1961bd,_0x4b6def);};}function removeListener(_0x11c365,_0x29e647){return function(){MailMessageEvents[_0xaaae('0x3')](_0x11c365,_0x29e647);};}exports['register']=function(_0x140d1f){for(var _0x170245=0x0,_0x2c2b87=events[_0xaaae('0x4')];_0x170245<_0x2c2b87;_0x170245++){var _0x5298d9=events[_0x170245];var _0x341e14=createListener(_0xaaae('0x5')+_0x5298d9,_0x140d1f);MailMessageEvents['on'](_0x5298d9,_0x341e14);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8e00a1c..29adc23 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 _0x22d0=['/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','/:id/teams','getTeams'];(function(_0x547cc7,_0x11a028){var _0x4b61ea=function(_0x24dd05){while(--_0x24dd05){_0x547cc7['push'](_0x547cc7['shift']());}};_0x4b61ea(++_0x11a028);}(_0x22d0,0x186));var _0x022d=function(_0x35e54a,_0x46953a){_0x35e54a=_0x35e54a-0x0;var _0x35c2b0=_0x22d0[_0x35e54a];return _0x35c2b0;};'use strict';var multer=require(_0x022d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x022d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x022d('0x2'));var interaction=require(_0x022d('0x3'));var config=require(_0x022d('0x4'));var controller=require(_0x022d('0x5'));router['get']('/',auth[_0x022d('0x6')](),controller[_0x022d('0x7')]);router[_0x022d('0x8')](_0x022d('0x9'),auth[_0x022d('0x6')](),controller[_0x022d('0xa')]);router[_0x022d('0x8')](_0x022d('0xb'),auth[_0x022d('0x6')](),controller['show']);router['get'](_0x022d('0xc'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x022d('0xd'),auth[_0x022d('0x6')](),controller[_0x022d('0xe')]);router[_0x022d('0x8')](_0x022d('0xf'),auth[_0x022d('0x6')](),controller[_0x022d('0x10')]);router[_0x022d('0x11')]('/',auth[_0x022d('0x6')](),controller[_0x022d('0x12')]);router[_0x022d('0x11')]('/:id/teams',auth[_0x022d('0x6')](),controller[_0x022d('0x13')]);router['post']('/:id/users',auth[_0x022d('0x6')](),controller[_0x022d('0x14')]);router['put'](_0x022d('0xb'),auth[_0x022d('0x6')](),controller[_0x022d('0x15')]);router[_0x022d('0x16')]('/:id',auth[_0x022d('0x6')](),controller[_0x022d('0x17')]);router['delete'](_0x022d('0xd'),auth[_0x022d('0x6')](),controller[_0x022d('0x18')]);router[_0x022d('0x16')](_0x022d('0xf'),auth[_0x022d('0x6')](),controller[_0x022d('0x19')]);module[_0x022d('0x1a')]=router; \ No newline at end of file +var _0x3687=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams'];(function(_0x1fe380,_0xc0c451){var _0x837ad9=function(_0x1d4c73){while(--_0x1d4c73){_0x1fe380['push'](_0x1fe380['shift']());}};_0x837ad9(++_0xc0c451);}(_0x3687,0x97));var _0x7368=function(_0x2e22f7,_0x4bcfdc){_0x2e22f7=_0x2e22f7-0x0;var _0x4a49c0=_0x3687[_0x2e22f7];return _0x4a49c0;};'use strict';var multer=require(_0x7368('0x0'));var util=require(_0x7368('0x1'));var path=require(_0x7368('0x2'));var timeout=require(_0x7368('0x3'));var express=require(_0x7368('0x4'));var router=express[_0x7368('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7368('0x6'));var interaction=require(_0x7368('0x7'));var config=require(_0x7368('0x8'));var controller=require(_0x7368('0x9'));router[_0x7368('0xa')]('/',auth[_0x7368('0xb')](),controller[_0x7368('0xc')]);router[_0x7368('0xa')]('/describe',auth[_0x7368('0xb')](),controller[_0x7368('0xd')]);router[_0x7368('0xa')]('/:id',auth[_0x7368('0xb')](),controller['show']);router[_0x7368('0xa')](_0x7368('0xe'),auth['isAuthenticated'](),controller[_0x7368('0xf')]);router[_0x7368('0xa')](_0x7368('0x10'),auth['isAuthenticated'](),controller[_0x7368('0x11')]);router[_0x7368('0xa')](_0x7368('0x12'),auth['isAuthenticated'](),controller[_0x7368('0x13')]);router[_0x7368('0x14')]('/',auth[_0x7368('0xb')](),controller['create']);router[_0x7368('0x14')]('/:id/teams',auth[_0x7368('0xb')](),controller[_0x7368('0x15')]);router[_0x7368('0x14')](_0x7368('0x12'),auth[_0x7368('0xb')](),controller[_0x7368('0x16')]);router[_0x7368('0x17')](_0x7368('0x18'),auth[_0x7368('0xb')](),controller[_0x7368('0x19')]);router[_0x7368('0x1a')](_0x7368('0x18'),auth[_0x7368('0xb')](),controller[_0x7368('0x1b')]);router['delete']('/:id/teams',auth[_0x7368('0xb')](),controller[_0x7368('0x1c')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x7368('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index b384e80..3b79519 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 _0x5723=['name','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x58c73b,_0x35d50a){var _0x16c62b=function(_0x16c72c){while(--_0x16c72c){_0x58c73b['push'](_0x58c73b['shift']());}};_0x16c62b(++_0x35d50a);}(_0x5723,0x124));var _0x3572=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5723[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3572('0x0'));module['exports']={'name':{'type':Sequelize[_0x3572('0x1')],'unique':_0x3572('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3572('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3572('0x3'),_0x3572('0x4'),_0x3572('0x5'))}}; \ No newline at end of file +var _0x3ba5=['exports','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x39257c,_0xc54331){var _0x4fed0b=function(_0x51b453){while(--_0x51b453){_0x39257c['push'](_0x39257c['shift']());}};_0x4fed0b(++_0xc54331);}(_0x3ba5,0x107));var _0x53ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ba5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x53ba('0x0'));module[_0x53ba('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x53ba('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x53ba('0x3')]('rrmemory',_0x53ba('0x4'),_0x53ba('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index eb5a01f..563f897 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 _0x24f2=['userMailQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','json','offset','limit','count','Content-Range','update','then','destroy','get','MailQueues','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','getOptions','where','MailQueue','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','hasOwnProperty','nolimit','pick','MailQueueId','merge','filter','UserMailQueue','findAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','sort','addTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','ids','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','SELECT','every','map','TeamId','includes','union','compact','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread'];(function(_0x37941e,_0x101a10){var _0x5d1984=function(_0x415d87){while(--_0x415d87){_0x37941e['push'](_0x37941e['shift']());}};_0x5d1984(++_0x101a10);}(_0x24f2,0xff));var _0x224f=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x24f2[_0x4e5552];return _0x60a338;};'use strict';var BPromise=require(_0x224f('0x0'));var util=require(_0x224f('0x1'));var _=require(_0x224f('0x2'));var squel=require(_0x224f('0x3'));var Redis=require(_0x224f('0x4'));var qs=require(_0x224f('0x5'));var logger=require('../../config/logger')(_0x224f('0x6'));var config=require(_0x224f('0x7'));var db=require('../../mysqldb')['db'];config[_0x224f('0x8')]=_[_0x224f('0x9')](config[_0x224f('0x8')],{'host':_0x224f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x224f('0x8')]));require(_0x224f('0xb'))[_0x224f('0xc')](socket);function respondWithStatusCode(_0x129607,_0x130ab4){_0x130ab4=_0x130ab4||0xcc;return function(_0x23cf7f){if(_0x23cf7f){return _0x129607[_0x224f('0xd')](_0x130ab4);}return _0x129607[_0x224f('0xe')](_0x130ab4)['end']();};}function respondWithResult(_0x4a3420,_0xb88320){_0xb88320=_0xb88320||0xc8;return function(_0x187818){if(_0x187818){return _0x4a3420[_0x224f('0xe')](_0xb88320)[_0x224f('0xf')](_0x187818);}};}function respondWithFilteredResult(_0x3dd3a4,_0x266979){return function(_0x561560){if(_0x561560){var _0x3ae612=typeof _0x266979[_0x224f('0x10')]==='undefined'&&typeof _0x266979[_0x224f('0x11')]==='undefined';var _0x7f98f6=_0x561560[_0x224f('0x12')];var _0x37946f=_0x3ae612?0x0:_0x266979['offset'];var _0x170557=_0x3ae612?_0x561560[_0x224f('0x12')]:_0x266979[_0x224f('0x10')]+_0x266979[_0x224f('0x11')];var _0x2f20dd;if(_0x170557>=_0x7f98f6){_0x170557=_0x7f98f6;_0x2f20dd=0xc8;}else{_0x2f20dd=0xce;}_0x3dd3a4[_0x224f('0xe')](_0x2f20dd);return _0x3dd3a4['set'](_0x224f('0x13'),_0x37946f+'-'+_0x170557+'/'+_0x7f98f6)[_0x224f('0xf')](_0x561560);}return null;};}function saveUpdates(_0x48b87b){return function(_0x1fc764){if(_0x1fc764){return _0x1fc764[_0x224f('0x14')](_0x48b87b)[_0x224f('0x15')](function(_0x621064){return _0x621064;});}return null;};}function removeEntity(_0x4c7103){return function(_0x160891){if(_0x160891){return _0x160891[_0x224f('0x16')]()[_0x224f('0x15')](function(){var _0x3f25cf=_0x160891[_0x224f('0x17')]({'plain':!![]});var _0x3c34db=_0x224f('0x18');return db['UserProfileResource'][_0x224f('0x16')]({'where':{'type':_0x3c34db,'resourceId':_0x3f25cf['id']}})[_0x224f('0x15')](function(){return _0x160891;});})[_0x224f('0x15')](function(){_0x4c7103[_0x224f('0xe')](0xcc)[_0x224f('0x19')]();});}};}function handleEntityNotFound(_0x36f5e3){return function(_0x5e9d7d){if(!_0x5e9d7d){_0x36f5e3[_0x224f('0xd')](0x194);}return _0x5e9d7d;};}function handleError(_0x258733,_0x3e2f14){_0x3e2f14=_0x3e2f14||0x1f4;return function(_0x24cbe6){logger[_0x224f('0x1a')](_0x24cbe6[_0x224f('0x1b')]);if(_0x24cbe6[_0x224f('0x1c')]){delete _0x24cbe6[_0x224f('0x1c')];}_0x258733[_0x224f('0xe')](_0x3e2f14)[_0x224f('0x1d')](_0x24cbe6);};}exports[_0x224f('0x1e')]=function(_0x50f255,_0x3fc3bb){var _0x1774f8={};var _0x10030a={'count':0x0,'rows':[]};var _0x58342f=_['map'](db['MailQueue'][_0x224f('0x1f')],function(_0xf0acd7){return{'name':_0xf0acd7[_0x224f('0x20')],'type':_0xf0acd7[_0x224f('0x21')][_0x224f('0x22')]};});_0x1774f8=qs[_0x224f('0x23')](_0x58342f,_0x50f255);var _0x15ae8d={'where':_0x1774f8[_0x224f('0x24')]};return db[_0x224f('0x25')]['count'](_0x15ae8d)[_0x224f('0x15')](function(_0xf1e937){_0x10030a[_0x224f('0x12')]=_0xf1e937;_0x1774f8[_0x224f('0x26')]=qs[_0x224f('0x26')](_0x50f255[_0x224f('0x27')]);return db[_0x224f('0x25')]['findAll'](_0x1774f8);})[_0x224f('0x15')](function(_0xbd56ff){_0x10030a[_0x224f('0x28')]=_0xbd56ff;return _0x10030a;})['then'](respondWithFilteredResult(_0x3fc3bb,_0x1774f8))[_0x224f('0x29')](handleError(_0x3fc3bb,null));};exports[_0x224f('0x2a')]=function(_0x5213aa,_0x3b7cb9){var _0x60a8fe={'raw':!![],'where':{'id':_0x5213aa[_0x224f('0x2b')]['id']}},_0x374f69={};_0x374f69[_0x224f('0x2c')]=_[_0x224f('0x2d')](db[_0x224f('0x25')]['rawAttributes']);_0x374f69['query']=_[_0x224f('0x2d')](_0x5213aa[_0x224f('0x27')]);_0x374f69[_0x224f('0x2e')]=_[_0x224f('0x2f')](_0x374f69['model'],_0x374f69[_0x224f('0x27')]);_0x60a8fe[_0x224f('0x30')]=_[_0x224f('0x2f')](_0x374f69[_0x224f('0x2c')],qs[_0x224f('0x31')](_0x5213aa[_0x224f('0x27')][_0x224f('0x31')]));_0x60a8fe[_0x224f('0x30')]=_0x60a8fe['attributes'][_0x224f('0x32')]?_0x60a8fe[_0x224f('0x30')]:_0x374f69[_0x224f('0x2c')];if(_0x5213aa['query'][_0x224f('0x33')]){_0x60a8fe[_0x224f('0x26')]=[{'all':!![]}];}_0x60a8fe=_['merge']({},_0x60a8fe,_0x5213aa[_0x224f('0x34')]);return db[_0x224f('0x25')]['find'](_0x60a8fe)['then'](handleEntityNotFound(_0x3b7cb9,null))['then'](respondWithResult(_0x3b7cb9,null))[_0x224f('0x29')](handleError(_0x3b7cb9,null));};exports['create']=function(_0x51be07,_0x55fd31){return db[_0x224f('0x25')]['create'](_0x51be07[_0x224f('0x35')],{})['then'](function(_0x9bb54f){var _0x3e0d28=_0x51be07[_0x224f('0x36')][_0x224f('0x17')]({'plain':!![]});if(!_0x3e0d28)throw new Error(_0x224f('0x37'));if(_0x3e0d28['role']==='user'){var _0x2ebd92=_0x9bb54f['get']({'plain':!![]});var _0x4a0ea4='MailQueues';return db[_0x224f('0x38')]['find']({'where':{'name':_0x4a0ea4,'userProfileId':_0x3e0d28[_0x224f('0x39')]},'raw':!![]})[_0x224f('0x15')](function(_0x14a81d){if(_0x14a81d&&_0x14a81d[_0x224f('0x3a')]===0x0){return db['UserProfileResource'][_0x224f('0x3b')]({'name':_0x2ebd92[_0x224f('0x1c')],'resourceId':_0x2ebd92['id'],'type':_0x14a81d['name'],'sectionId':_0x14a81d['id']},{})['then'](function(){return _0x9bb54f;});}else{return _0x9bb54f;}})['catch'](function(_0x3e3e89){logger[_0x224f('0x1a')](_0x224f('0x3c'),_0x3e3e89);throw _0x3e3e89;});}return _0x9bb54f;})['then'](respondWithResult(_0x55fd31,0xc9))['catch'](handleError(_0x55fd31,null));};exports[_0x224f('0x14')]=function(_0xd609d3,_0x4105a6){if(_0xd609d3['body']['id']){delete _0xd609d3[_0x224f('0x35')]['id'];}return db[_0x224f('0x25')][_0x224f('0x3d')]({'where':{'id':_0xd609d3[_0x224f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4105a6,null))['then'](saveUpdates(_0xd609d3[_0x224f('0x35')],null))[_0x224f('0x15')](respondWithResult(_0x4105a6,null))[_0x224f('0x29')](handleError(_0x4105a6,null));};exports[_0x224f('0x16')]=function(_0x57c7f1,_0x506b24){return db[_0x224f('0x25')][_0x224f('0x3d')]({'where':{'id':_0x57c7f1[_0x224f('0x2b')]['id']}})[_0x224f('0x15')](handleEntityNotFound(_0x506b24,null))['then'](removeEntity(_0x506b24,null))[_0x224f('0x29')](handleError(_0x506b24,null));};exports['describe']=function(_0x5d43b8,_0xe1ce5c){return db[_0x224f('0x25')][_0x224f('0x3e')]()[_0x224f('0x15')](respondWithResult(_0xe1ce5c,null))[_0x224f('0x29')](handleError(_0xe1ce5c,null));};exports[_0x224f('0x3f')]=function(_0x1f68fd,_0xff9999){var _0x51c866={'raw':!![],'where':{}},_0x32ff62={},_0x19dd4d;return db[_0x224f('0x25')][_0x224f('0x40')]({'where':{'id':_0x1f68fd[_0x224f('0x2b')]['id']}})[_0x224f('0x15')](handleEntityNotFound(_0xff9999,null))[_0x224f('0x15')](function(_0x5df853){if(_0x5df853){_0x19dd4d=_0x5df853[_0x224f('0x17')]({'plain':!![]});_0x32ff62[_0x224f('0x2c')]=_[_0x224f('0x2d')](db['UserMailQueue'][_0x224f('0x1f')]);_0x32ff62[_0x224f('0x27')]=_[_0x224f('0x2d')](_0x1f68fd['query']);_0x32ff62[_0x224f('0x2e')]=_[_0x224f('0x2f')](_0x32ff62['model'],_0x32ff62[_0x224f('0x27')]);_0x51c866[_0x224f('0x30')]=_[_0x224f('0x2f')](_0x32ff62['model'],qs['fields'](_0x1f68fd[_0x224f('0x27')]['fields']));_0x51c866[_0x224f('0x30')]=_0x51c866[_0x224f('0x30')][_0x224f('0x32')]?_0x51c866[_0x224f('0x30')]:_0x32ff62[_0x224f('0x2c')];if(!_0x1f68fd[_0x224f('0x27')][_0x224f('0x41')](_0x224f('0x42'))){_0x51c866['limit']=qs[_0x224f('0x11')](_0x1f68fd[_0x224f('0x27')][_0x224f('0x11')]);_0x51c866[_0x224f('0x10')]=qs[_0x224f('0x10')](_0x1f68fd[_0x224f('0x27')]['offset']);}_0x51c866['order']=qs['sort'](_0x1f68fd[_0x224f('0x27')]['sort']);_0x51c866[_0x224f('0x24')]=qs[_0x224f('0x2e')](_[_0x224f('0x43')](_0x1f68fd[_0x224f('0x27')],_0x32ff62[_0x224f('0x2e')]));_0x51c866[_0x224f('0x24')][_0x224f('0x44')]=_0x5df853['id'];if(_0x1f68fd[_0x224f('0x27')]['filter']){_0x51c866[_0x224f('0x24')]=_[_0x224f('0x45')](_0x51c866[_0x224f('0x24')],{'$or':_['map'](_0x51c866[_0x224f('0x30')],function(_0xa8d3c9){var _0x954a2e={};_0x954a2e[_0xa8d3c9]={'$like':'%'+_0x1f68fd['query'][_0x224f('0x46')]+'%'};return _0x954a2e;})});}_0x51c866=_[_0x224f('0x45')]({},_0x51c866,_0x1f68fd[_0x224f('0x34')]);return db[_0x224f('0x47')][_0x224f('0x48')](_0x51c866);}})[_0x224f('0x15')](function(_0x29a8a1){if(_0x29a8a1){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x29a8a1,_0x224f('0x49')),'role':'agent'},'attributes':['id',_0x224f('0x1c'),_0x224f('0x4a'),_0x224f('0x4b'),_0x224f('0x4c')]});}})[_0x224f('0x15')](function(_0x1a0b3c){if(_0x1a0b3c){return{'count':_0x1a0b3c[_0x224f('0x12')],'rows':_['map'](_0x1a0b3c['rows'],function(_0x1a6715){return{'membername':_0x1a6715[_0x224f('0x1c')],'UserId':_0x1a6715['id'],'queue_name':_0x19dd4d['name'],'MailQueueId':_0x19dd4d['id'],'interface':util[_0x224f('0x4d')](_0x224f('0x4e'),_0x224f('0x4f'),_0x1a6715[_0x224f('0x1c')]),'penalty':0x0,'paused':_0x1a6715[_0x224f('0x4a')],'createdAt':_0x1a6715['createdAt'],'updatedAt':_0x1a6715[_0x224f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x224f('0x15')](respondWithFilteredResult(_0xff9999,_0x51c866))[_0x224f('0x29')](handleError(_0xff9999,null));};exports[_0x224f('0x50')]=function(_0xb861b3,_0x250dbd){var _0x30928c={};var _0x3da326={};var _0x2edb41;var _0x2be8cd;return db[_0x224f('0x25')][_0x224f('0x40')]({'where':{'id':_0xb861b3['params']['id']}})[_0x224f('0x15')](handleEntityNotFound(_0x250dbd,null))[_0x224f('0x15')](function(_0x3d661c){if(_0x3d661c){_0x2edb41=_0x3d661c;_0x3da326['model']=_['keys'](db[_0x224f('0x51')]['rawAttributes']);_0x3da326[_0x224f('0x27')]=_[_0x224f('0x2d')](_0xb861b3[_0x224f('0x27')]);_0x3da326['filters']=_[_0x224f('0x2f')](_0x3da326['model'],_0x3da326[_0x224f('0x27')]);_0x30928c['attributes']=_[_0x224f('0x2f')](_0x3da326[_0x224f('0x2c')],qs['fields'](_0xb861b3[_0x224f('0x27')]['fields']));_0x30928c[_0x224f('0x30')]=_0x30928c[_0x224f('0x30')][_0x224f('0x32')]?_0x30928c[_0x224f('0x30')]:_0x3da326[_0x224f('0x2c')];_0x30928c[_0x224f('0x52')]=qs[_0x224f('0x53')](_0xb861b3[_0x224f('0x27')][_0x224f('0x53')]);_0x30928c[_0x224f('0x24')]=qs[_0x224f('0x2e')](_[_0x224f('0x43')](_0xb861b3['query'],_0x3da326[_0x224f('0x2e')]));if(_0xb861b3[_0x224f('0x27')][_0x224f('0x46')]){_0x30928c['where']=_[_0x224f('0x45')](_0x30928c['where'],{'$or':_['map'](_0x30928c['attributes'],function(_0x122652){var _0x53b680={};_0x53b680[_0x122652]={'$like':'%'+_0xb861b3['query'][_0x224f('0x46')]+'%'};return _0x53b680;})});}_0x30928c=_[_0x224f('0x45')]({},_0x30928c,_0xb861b3[_0x224f('0x34')]);return _0x2edb41[_0x224f('0x50')](_0x30928c);}})[_0x224f('0x15')](function(_0x2d31d9){if(_0x2d31d9){_0x2be8cd=_0x2d31d9[_0x224f('0x32')];if(!_0xb861b3[_0x224f('0x27')][_0x224f('0x41')]('nolimit')){_0x30928c[_0x224f('0x11')]=qs[_0x224f('0x11')](_0xb861b3[_0x224f('0x27')]['limit']);_0x30928c[_0x224f('0x10')]=qs['offset'](_0xb861b3['query'][_0x224f('0x10')]);}return _0x2edb41[_0x224f('0x50')](_0x30928c);}})['then'](function(_0x595801){if(_0x595801){return _0x595801?{'count':_0x2be8cd,'rows':_0x595801}:null;}})[_0x224f('0x15')](respondWithResult(_0x250dbd,null))[_0x224f('0x29')](handleError(_0x250dbd,null));};exports[_0x224f('0x54')]=function(_0x52192f,_0x276856){var _0x3bd1c3=_0x52192f['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x3bd1c3},'attributes':['id'],'include':[{'model':db[_0x224f('0x55')],'as':_0x224f('0x56'),'attributes':['id',_0x224f('0x1c'),_0x224f('0x57'),_0x224f('0x58'),'interface'],'raw':!![]}]})['then'](function(_0x21b568){if(_0x21b568){var _0x86c89c=_[_0x224f('0x59')](_0x21b568,function(_0x472db4){var _0x1c7207=_0x472db4[_0x224f('0x17')]({'plain':!![]});return _0x1c7207[_0x224f('0x56')];});return db[_0x224f('0x25')][_0x224f('0x3d')]({'where':{'id':_0x52192f[_0x224f('0x2b')]['id']}})[_0x224f('0x15')](function(_0x3adf79){return db[_0x224f('0x5a')][_0x224f('0x5b')](function(_0x48cb85){return _0x3adf79[_0x224f('0x54')](_0x3bd1c3,{'transaction':_0x48cb85})[_0x224f('0x15')](function(){return BPromise[_0x224f('0x5c')](_0x86c89c,function(_0x155489){return db['UserMailQueue'][_0x224f('0x5d')]({'where':{'UserId':_0x155489['id'],'MailQueueId':_0x52192f[_0x224f('0x2b')]['id']},'transaction':_0x48cb85});});})[_0x224f('0x15')](function(){_0x86c89c['forEach'](function(_0x27d274){socket[_0x224f('0x5e')]('userMailQueue:save',{'UserId':_0x27d274['id'],'MailQueueId':_0x3adf79['id']});});});});});}})[_0x224f('0x15')](respondWithStatusCode(_0x276856,null))[_0x224f('0x29')](handleError(_0x276856,null));};exports[_0x224f('0x5f')]=function(_0x2f5eaf,_0x5492a6){return db[_0x224f('0x51')]['findAll']({'where':{'id':_0x2f5eaf['query'][_0x224f('0x60')]},'attributes':['id'],'include':[{'model':db[_0x224f('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x224f('0x15')](handleEntityNotFound(_0x5492a6,null))[_0x224f('0x15')](function(_0x25d834){var _0x42b642=_['map'](_0x25d834,'id');var _0x2b1ab7=[];var _0x311d05=[];var _0x451117=squel[_0x224f('0x61')]();_0x451117['field']('tq.TeamId')[_0x224f('0x62')](_0x224f('0x63'),'tq')[_0x224f('0x64')](_0x224f('0x65'),'ut',_0x224f('0x66'))[_0x224f('0x24')](_0x224f('0x67'),_0x2f5eaf['params']['id']);for(var _0x13896b=0x0;_0x13896b<_0x25d834[_0x224f('0x32')];_0x13896b+=0x1){let _0x4441d3=_0x25d834[_0x13896b];for(var _0x3048b3=0x0;_0x3048b3<_0x4441d3['Agents'][_0x224f('0x32')];_0x3048b3+=0x1){let _0x34cb39=_0x4441d3['Agents'][_0x3048b3];var _0x3f5856=_0x451117[_0x224f('0x68')]();_0x3f5856[_0x224f('0x24')](_0x224f('0x69'),_0x34cb39['id']);_0x311d05[_0x224f('0x6a')](db[_0x224f('0x5a')][_0x224f('0x27')](_0x3f5856[_0x224f('0x6b')](),{'type':db[_0x224f('0x5a')][_0x224f('0x6c')][_0x224f('0x6d')]})['then'](function(_0x1482a2){if(_0x1482a2[_0x224f('0x32')]===0x1){return _0x34cb39['id'];}else{var _0x11c994=_[_0x224f('0x6e')](_[_0x224f('0x6f')](_0x1482a2,_0x224f('0x70')),function(_0x149a11){return _[_0x224f('0x71')](_0x42b642,_0x149a11);});if(_0x11c994){return _0x34cb39['id'];}}}));}}return BPromise['all'](_0x311d05)[_0x224f('0x15')](function(_0x5e8911){_0x2b1ab7=_(_0x2b1ab7)[_0x224f('0x72')](_0x5e8911)[_0x224f('0x73')]()['value']();return db['MailQueue'][_0x224f('0x3d')]({'where':{'id':_0x2f5eaf[_0x224f('0x2b')]['id']}})[_0x224f('0x15')](function(_0x122988){return db['sequelize'][_0x224f('0x5b')](function(_0x1f40d5){return _0x122988[_0x224f('0x5f')](_0x2f5eaf[_0x224f('0x27')][_0x224f('0x60')],{'transaction':_0x1f40d5})[_0x224f('0x15')](function(){if(!_[_0x224f('0x74')](_0x2b1ab7)){return _0x122988[_0x224f('0x75')](_0x2b1ab7,{'transaction':_0x1f40d5});}})['then'](function(){_0x2b1ab7[_0x224f('0x76')](function(_0x1790a4){socket['emit'](_0x224f('0x77'),{'UserId':_0x1790a4,'MailQueueId':_0x122988['id']});});});});});});})[_0x224f('0x15')](respondWithStatusCode(_0x5492a6,null))[_0x224f('0x29')](handleError(_0x5492a6,null));};exports['addAgents']=function(_0xf5bd90,_0x1c3c9e){return db[_0x224f('0x25')][_0x224f('0x3d')]({'where':{'id':_0xf5bd90['params']['id']}})[_0x224f('0x15')](handleEntityNotFound(_0x1c3c9e,null))[_0x224f('0x15')](function(_0xda820){if(_0xda820){return _0xda820[_0x224f('0x78')](_0xf5bd90[_0x224f('0x35')][_0x224f('0x60')],_[_0x224f('0x79')](_0xf5bd90[_0x224f('0x35')],[_0x224f('0x60'),'id'])||{})[_0x224f('0x7a')](function(_0x209cdf){for(var _0x573ab5=0x0;_0x573ab5<_0xf5bd90[_0x224f('0x35')][_0x224f('0x60')][_0x224f('0x32')];_0x573ab5+=0x1){socket[_0x224f('0x5e')](_0x224f('0x7b'),{'UserId':Number(_0xf5bd90[_0x224f('0x35')]['ids'][_0x573ab5]),'MailQueueId':Number(_0xf5bd90[_0x224f('0x2b')]['id'])});}return _0x209cdf;});}})[_0x224f('0x15')](respondWithResult(_0x1c3c9e,null))[_0x224f('0x29')](handleError(_0x1c3c9e,null));};exports[_0x224f('0x75')]=function(_0x547aeb,_0x41a560){return db[_0x224f('0x25')]['find']({'where':{'id':_0x547aeb['params']['id']}})[_0x224f('0x15')](handleEntityNotFound(_0x41a560,null))[_0x224f('0x15')](function(_0x34d9fe){if(_0x34d9fe){return _0x34d9fe[_0x224f('0x75')](_0x547aeb[_0x224f('0x27')][_0x224f('0x60')])[_0x224f('0x15')](function(){if(_[_0x224f('0x7c')](_0x547aeb['query'][_0x224f('0x60')])){for(var _0x508420=0x0;_0x508420<_0x547aeb['query'][_0x224f('0x60')][_0x224f('0x32')];_0x508420+=0x1){socket[_0x224f('0x5e')](_0x224f('0x77'),{'UserId':Number(_0x547aeb[_0x224f('0x27')][_0x224f('0x60')][_0x508420]),'MailQueueId':Number(_0x547aeb[_0x224f('0x2b')]['id'])});}}else{socket['emit'](_0x224f('0x77'),{'UserId':Number(_0x547aeb[_0x224f('0x27')][_0x224f('0x60')]),'MailQueueId':Number(_0x547aeb[_0x224f('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x41a560,null))[_0x224f('0x29')](handleError(_0x41a560,null));};exports[_0x224f('0x7d')]=function(_0x34c1ce,_0x88e35c){var _0x5cfb3a={};var _0x3e8a21={};var _0x5c66b0;var _0x97138f;return db[_0x224f('0x25')]['findOne']({'where':{'id':_0x34c1ce[_0x224f('0x2b')]['id']}})[_0x224f('0x15')](handleEntityNotFound(_0x88e35c,null))['then'](function(_0x398b55){if(_0x398b55){_0x5c66b0=_0x398b55;_0x3e8a21[_0x224f('0x2c')]=_[_0x224f('0x2d')](db['User'][_0x224f('0x1f')]);_0x3e8a21[_0x224f('0x27')]=_[_0x224f('0x2d')](_0x34c1ce['query']);_0x3e8a21[_0x224f('0x2e')]=_[_0x224f('0x2f')](_0x3e8a21[_0x224f('0x2c')],_0x3e8a21[_0x224f('0x27')]);_0x5cfb3a['attributes']=_[_0x224f('0x2f')](_0x3e8a21[_0x224f('0x2c')],qs[_0x224f('0x31')](_0x34c1ce[_0x224f('0x27')]['fields']));_0x5cfb3a[_0x224f('0x30')]=_0x5cfb3a[_0x224f('0x30')][_0x224f('0x32')]?_0x5cfb3a['attributes']:_0x3e8a21[_0x224f('0x2c')];_0x5cfb3a['order']=qs['sort'](_0x34c1ce[_0x224f('0x27')][_0x224f('0x53')]);_0x5cfb3a[_0x224f('0x24')]=qs[_0x224f('0x2e')](_[_0x224f('0x43')](_0x34c1ce[_0x224f('0x27')],_0x3e8a21['filters']));if(_0x34c1ce[_0x224f('0x27')][_0x224f('0x46')]){_0x5cfb3a['where']=_[_0x224f('0x45')](_0x5cfb3a[_0x224f('0x24')],{'$or':_[_0x224f('0x6f')](_0x5cfb3a[_0x224f('0x30')],function(_0x51a98a){var _0x30675e={};_0x30675e[_0x51a98a]={'$like':'%'+_0x34c1ce[_0x224f('0x27')][_0x224f('0x46')]+'%'};return _0x30675e;})});}_0x5cfb3a=_[_0x224f('0x45')]({},_0x5cfb3a,_0x34c1ce[_0x224f('0x34')]);return _0x5c66b0[_0x224f('0x7d')](_0x5cfb3a);}})[_0x224f('0x15')](function(_0x237d07){if(_0x237d07){_0x97138f=_0x237d07['length'];if(!_0x34c1ce[_0x224f('0x27')]['hasOwnProperty'](_0x224f('0x42'))){_0x5cfb3a[_0x224f('0x11')]=qs[_0x224f('0x11')](_0x34c1ce['query']['limit']);_0x5cfb3a[_0x224f('0x10')]=qs[_0x224f('0x10')](_0x34c1ce[_0x224f('0x27')][_0x224f('0x10')]);}return _0x5c66b0[_0x224f('0x7d')](_0x5cfb3a);}})[_0x224f('0x15')](function(_0x35c071){if(_0x35c071){return _0x35c071?{'count':_0x97138f,'rows':_0x35c071}:null;}})[_0x224f('0x15')](respondWithResult(_0x88e35c,null))['catch'](handleError(_0x88e35c,null));}; \ No newline at end of file +var _0xd1cd=['keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','rawAttributes','hasOwnProperty','order','sort','where','filter','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','pick','getTeams','nolimit','addTeams','ids','Team','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','Agents','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','compact','value','removeTeams','addAgents','omit','spread','removeAgents','getAgents','bluebird','util','lodash','squel','ioredis','api','../../config/environment','redis','localhost','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','then','get','destroy','error','stack','name','send','index','map','MailQueue','fieldName','type','key','getOptions','include','query','findAll','show','params','model'];(function(_0x143ccf,_0x2aa561){var _0x23331a=function(_0x567093){while(--_0x567093){_0x143ccf['push'](_0x143ccf['shift']());}};_0x23331a(++_0x2aa561);}(_0xd1cd,0x143));var _0xdd1c=function(_0x51f32d,_0x374f42){_0x51f32d=_0x51f32d-0x0;var _0x3ddc33=_0xd1cd[_0x51f32d];return _0x3ddc33;};'use strict';var BPromise=require(_0xdd1c('0x0'));var util=require(_0xdd1c('0x1'));var _=require(_0xdd1c('0x2'));var squel=require(_0xdd1c('0x3'));var Redis=require(_0xdd1c('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xdd1c('0x5'));var config=require(_0xdd1c('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdd1c('0x7')],{'host':_0xdd1c('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd1c('0x7')]));require('./mailQueue.socket')[_0xdd1c('0x9')](socket);function respondWithStatusCode(_0x4db47e,_0x8e89ea){_0x8e89ea=_0x8e89ea||0xcc;return function(_0x5c7239){if(_0x5c7239){return _0x4db47e[_0xdd1c('0xa')](_0x8e89ea);}return _0x4db47e[_0xdd1c('0xb')](_0x8e89ea)[_0xdd1c('0xc')]();};}function respondWithResult(_0xaa8b22,_0x593c45){_0x593c45=_0x593c45||0xc8;return function(_0xb6b350){if(_0xb6b350){return _0xaa8b22[_0xdd1c('0xb')](_0x593c45)[_0xdd1c('0xd')](_0xb6b350);}};}function respondWithFilteredResult(_0x10b30f,_0x358b35){return function(_0x2f7eaa){if(_0x2f7eaa){var _0x41b134=typeof _0x358b35['offset']===_0xdd1c('0xe')&&typeof _0x358b35['limit']==='undefined';var _0x4fe875=_0x2f7eaa[_0xdd1c('0xf')];var _0x64231b=_0x41b134?0x0:_0x358b35[_0xdd1c('0x10')];var _0x6ef450=_0x41b134?_0x2f7eaa[_0xdd1c('0xf')]:_0x358b35[_0xdd1c('0x10')]+_0x358b35[_0xdd1c('0x11')];var _0xe4fc24;if(_0x6ef450>=_0x4fe875){_0x6ef450=_0x4fe875;_0xe4fc24=0xc8;}else{_0xe4fc24=0xce;}_0x10b30f[_0xdd1c('0xb')](_0xe4fc24);return _0x10b30f['set'](_0xdd1c('0x12'),_0x64231b+'-'+_0x6ef450+'/'+_0x4fe875)['json'](_0x2f7eaa);}return null;};}function saveUpdates(_0x2c86cd){return function(_0x5e5e9b){if(_0x5e5e9b){return _0x5e5e9b[_0xdd1c('0x13')](_0x2c86cd)[_0xdd1c('0x14')](function(_0x3c5e25){return _0x3c5e25;});}return null;};}function removeEntity(_0x3f8cb7){return function(_0x1007dd){if(_0x1007dd){return _0x1007dd['destroy']()[_0xdd1c('0x14')](function(){var _0x154a13=_0x1007dd[_0xdd1c('0x15')]({'plain':!![]});var _0x4b5e0f='MailQueues';return db['UserProfileResource'][_0xdd1c('0x16')]({'where':{'type':_0x4b5e0f,'resourceId':_0x154a13['id']}})[_0xdd1c('0x14')](function(){return _0x1007dd;});})[_0xdd1c('0x14')](function(){_0x3f8cb7['status'](0xcc)[_0xdd1c('0xc')]();});}};}function handleEntityNotFound(_0x5b98c0){return function(_0x2d2b8d){if(!_0x2d2b8d){_0x5b98c0['sendStatus'](0x194);}return _0x2d2b8d;};}function handleError(_0x408f26,_0x2da5e9){_0x2da5e9=_0x2da5e9||0x1f4;return function(_0xbe2b7){logger[_0xdd1c('0x17')](_0xbe2b7[_0xdd1c('0x18')]);if(_0xbe2b7[_0xdd1c('0x19')]){delete _0xbe2b7[_0xdd1c('0x19')];}_0x408f26[_0xdd1c('0xb')](_0x2da5e9)[_0xdd1c('0x1a')](_0xbe2b7);};}exports[_0xdd1c('0x1b')]=function(_0x4ee1ae,_0x3feea8){var _0x4122ec={};var _0x30c4d1={'count':0x0,'rows':[]};var _0x438b30=_[_0xdd1c('0x1c')](db[_0xdd1c('0x1d')]['rawAttributes'],function(_0x4b5ff7){return{'name':_0x4b5ff7[_0xdd1c('0x1e')],'type':_0x4b5ff7[_0xdd1c('0x1f')][_0xdd1c('0x20')]};});_0x4122ec=qs[_0xdd1c('0x21')](_0x438b30,_0x4ee1ae);var _0x1a60c5={'where':_0x4122ec['where']};return db[_0xdd1c('0x1d')]['count'](_0x1a60c5)[_0xdd1c('0x14')](function(_0x8f032e){_0x30c4d1[_0xdd1c('0xf')]=_0x8f032e;_0x4122ec[_0xdd1c('0x22')]=qs[_0xdd1c('0x22')](_0x4ee1ae[_0xdd1c('0x23')]);return db[_0xdd1c('0x1d')][_0xdd1c('0x24')](_0x4122ec);})[_0xdd1c('0x14')](function(_0x5ed9bd){_0x30c4d1['rows']=_0x5ed9bd;return _0x30c4d1;})[_0xdd1c('0x14')](respondWithFilteredResult(_0x3feea8,_0x4122ec))['catch'](handleError(_0x3feea8,null));};exports[_0xdd1c('0x25')]=function(_0x24ccec,_0x57d242){var _0x59439b={'raw':!![],'where':{'id':_0x24ccec[_0xdd1c('0x26')]['id']}},_0x5ed6a9={};_0x5ed6a9[_0xdd1c('0x27')]=_[_0xdd1c('0x28')](db[_0xdd1c('0x1d')]['rawAttributes']);_0x5ed6a9[_0xdd1c('0x23')]=_[_0xdd1c('0x28')](_0x24ccec[_0xdd1c('0x23')]);_0x5ed6a9[_0xdd1c('0x29')]=_[_0xdd1c('0x2a')](_0x5ed6a9[_0xdd1c('0x27')],_0x5ed6a9['query']);_0x59439b[_0xdd1c('0x2b')]=_[_0xdd1c('0x2a')](_0x5ed6a9[_0xdd1c('0x27')],qs[_0xdd1c('0x2c')](_0x24ccec[_0xdd1c('0x23')][_0xdd1c('0x2c')]));_0x59439b[_0xdd1c('0x2b')]=_0x59439b['attributes'][_0xdd1c('0x2d')]?_0x59439b['attributes']:_0x5ed6a9[_0xdd1c('0x27')];if(_0x24ccec[_0xdd1c('0x23')][_0xdd1c('0x2e')]){_0x59439b[_0xdd1c('0x22')]=[{'all':!![]}];}_0x59439b=_[_0xdd1c('0x2f')]({},_0x59439b,_0x24ccec[_0xdd1c('0x30')]);return db['MailQueue'][_0xdd1c('0x31')](_0x59439b)[_0xdd1c('0x14')](handleEntityNotFound(_0x57d242,null))[_0xdd1c('0x14')](respondWithResult(_0x57d242,null))[_0xdd1c('0x32')](handleError(_0x57d242,null));};exports[_0xdd1c('0x33')]=function(_0x215a12,_0x4938a6){return db[_0xdd1c('0x1d')][_0xdd1c('0x33')](_0x215a12['body'],{})[_0xdd1c('0x14')](function(_0x238b35){var _0x41b615=_0x215a12[_0xdd1c('0x34')][_0xdd1c('0x15')]({'plain':!![]});if(!_0x41b615)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41b615[_0xdd1c('0x35')]==='user'){var _0x3a7323=_0x238b35[_0xdd1c('0x15')]({'plain':!![]});var _0x16aab3='MailQueues';return db[_0xdd1c('0x36')][_0xdd1c('0x31')]({'where':{'name':_0x16aab3,'userProfileId':_0x41b615[_0xdd1c('0x37')]},'raw':!![]})[_0xdd1c('0x14')](function(_0x4ea3b9){if(_0x4ea3b9&&_0x4ea3b9[_0xdd1c('0x38')]===0x0){return db[_0xdd1c('0x39')][_0xdd1c('0x33')]({'name':_0x3a7323[_0xdd1c('0x19')],'resourceId':_0x3a7323['id'],'type':_0x4ea3b9[_0xdd1c('0x19')],'sectionId':_0x4ea3b9['id']},{})[_0xdd1c('0x14')](function(){return _0x238b35;});}else{return _0x238b35;}})[_0xdd1c('0x32')](function(_0xf037ef){logger[_0xdd1c('0x17')](_0xdd1c('0x3a'),_0xf037ef);throw _0xf037ef;});}return _0x238b35;})['then'](respondWithResult(_0x4938a6,0xc9))[_0xdd1c('0x32')](handleError(_0x4938a6,null));};exports[_0xdd1c('0x13')]=function(_0x45e5c2,_0x5ac0f2){if(_0x45e5c2['body']['id']){delete _0x45e5c2[_0xdd1c('0x3b')]['id'];}return db['MailQueue'][_0xdd1c('0x31')]({'where':{'id':_0x45e5c2[_0xdd1c('0x26')]['id']}})[_0xdd1c('0x14')](handleEntityNotFound(_0x5ac0f2,null))[_0xdd1c('0x14')](saveUpdates(_0x45e5c2[_0xdd1c('0x3b')],null))['then'](respondWithResult(_0x5ac0f2,null))[_0xdd1c('0x32')](handleError(_0x5ac0f2,null));};exports[_0xdd1c('0x16')]=function(_0x392841,_0x4b721b){return db[_0xdd1c('0x1d')][_0xdd1c('0x31')]({'where':{'id':_0x392841['params']['id']}})['then'](handleEntityNotFound(_0x4b721b,null))[_0xdd1c('0x14')](removeEntity(_0x4b721b,null))[_0xdd1c('0x32')](handleError(_0x4b721b,null));};exports[_0xdd1c('0x3c')]=function(_0x4791e,_0x4f9a24){return db[_0xdd1c('0x1d')][_0xdd1c('0x3c')]()[_0xdd1c('0x14')](respondWithResult(_0x4f9a24,null))[_0xdd1c('0x32')](handleError(_0x4f9a24,null));};exports[_0xdd1c('0x3d')]=function(_0x1f6fb6,_0x5d0704){var _0x5b2502={'raw':!![],'where':{}},_0x292f13={},_0x8b5cf7;return db[_0xdd1c('0x1d')][_0xdd1c('0x3e')]({'where':{'id':_0x1f6fb6[_0xdd1c('0x26')]['id']}})[_0xdd1c('0x14')](handleEntityNotFound(_0x5d0704,null))['then'](function(_0x4e151f){if(_0x4e151f){_0x8b5cf7=_0x4e151f[_0xdd1c('0x15')]({'plain':!![]});_0x292f13['model']=_['keys'](db['UserMailQueue'][_0xdd1c('0x3f')]);_0x292f13['query']=_[_0xdd1c('0x28')](_0x1f6fb6[_0xdd1c('0x23')]);_0x292f13[_0xdd1c('0x29')]=_[_0xdd1c('0x2a')](_0x292f13[_0xdd1c('0x27')],_0x292f13[_0xdd1c('0x23')]);_0x5b2502[_0xdd1c('0x2b')]=_[_0xdd1c('0x2a')](_0x292f13[_0xdd1c('0x27')],qs[_0xdd1c('0x2c')](_0x1f6fb6[_0xdd1c('0x23')][_0xdd1c('0x2c')]));_0x5b2502[_0xdd1c('0x2b')]=_0x5b2502[_0xdd1c('0x2b')]['length']?_0x5b2502[_0xdd1c('0x2b')]:_0x292f13[_0xdd1c('0x27')];if(!_0x1f6fb6[_0xdd1c('0x23')][_0xdd1c('0x40')]('nolimit')){_0x5b2502[_0xdd1c('0x11')]=qs[_0xdd1c('0x11')](_0x1f6fb6['query'][_0xdd1c('0x11')]);_0x5b2502[_0xdd1c('0x10')]=qs[_0xdd1c('0x10')](_0x1f6fb6[_0xdd1c('0x23')][_0xdd1c('0x10')]);}_0x5b2502[_0xdd1c('0x41')]=qs[_0xdd1c('0x42')](_0x1f6fb6[_0xdd1c('0x23')]['sort']);_0x5b2502['where']=qs[_0xdd1c('0x29')](_['pick'](_0x1f6fb6[_0xdd1c('0x23')],_0x292f13[_0xdd1c('0x29')]));_0x5b2502[_0xdd1c('0x43')]['MailQueueId']=_0x4e151f['id'];if(_0x1f6fb6['query']['filter']){_0x5b2502[_0xdd1c('0x43')]=_[_0xdd1c('0x2f')](_0x5b2502[_0xdd1c('0x43')],{'$or':_[_0xdd1c('0x1c')](_0x5b2502[_0xdd1c('0x2b')],function(_0x90ce46){var _0x406f2b={};_0x406f2b[_0x90ce46]={'$like':'%'+_0x1f6fb6[_0xdd1c('0x23')][_0xdd1c('0x44')]+'%'};return _0x406f2b;})});}_0x5b2502=_[_0xdd1c('0x2f')]({},_0x5b2502,_0x1f6fb6[_0xdd1c('0x30')]);return db[_0xdd1c('0x45')][_0xdd1c('0x24')](_0x5b2502);}})[_0xdd1c('0x14')](function(_0x1d7ffe){if(_0x1d7ffe){return db[_0xdd1c('0x46')][_0xdd1c('0x47')]({'where':{'id':_[_0xdd1c('0x1c')](_0x1d7ffe,_0xdd1c('0x48')),'role':_0xdd1c('0x49')},'attributes':['id',_0xdd1c('0x19'),_0xdd1c('0x4a'),_0xdd1c('0x4b'),_0xdd1c('0x4c')]});}})[_0xdd1c('0x14')](function(_0x621dbb){if(_0x621dbb){return{'count':_0x621dbb[_0xdd1c('0xf')],'rows':_['map'](_0x621dbb[_0xdd1c('0x4d')],function(_0x1cb49b){return{'membername':_0x1cb49b[_0xdd1c('0x19')],'UserId':_0x1cb49b['id'],'queue_name':_0x8b5cf7[_0xdd1c('0x19')],'MailQueueId':_0x8b5cf7['id'],'interface':util[_0xdd1c('0x4e')](_0xdd1c('0x4f'),_0xdd1c('0x50'),_0x1cb49b[_0xdd1c('0x19')]),'penalty':0x0,'paused':_0x1cb49b[_0xdd1c('0x4a')],'createdAt':_0x1cb49b[_0xdd1c('0x4c')],'updatedAt':_0x1cb49b[_0xdd1c('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5d0704,_0x5b2502))[_0xdd1c('0x32')](handleError(_0x5d0704,null));};exports['getTeams']=function(_0x3b08d4,_0x2969f9){var _0x1d43ff={};var _0x168214={};var _0x2d69d8;var _0x2b9671;return db[_0xdd1c('0x1d')]['findOne']({'where':{'id':_0x3b08d4['params']['id']}})['then'](handleEntityNotFound(_0x2969f9,null))['then'](function(_0x4b3454){if(_0x4b3454){_0x2d69d8=_0x4b3454;_0x168214[_0xdd1c('0x27')]=_[_0xdd1c('0x28')](db['Team'][_0xdd1c('0x3f')]);_0x168214[_0xdd1c('0x23')]=_[_0xdd1c('0x28')](_0x3b08d4[_0xdd1c('0x23')]);_0x168214['filters']=_[_0xdd1c('0x2a')](_0x168214['model'],_0x168214[_0xdd1c('0x23')]);_0x1d43ff[_0xdd1c('0x2b')]=_[_0xdd1c('0x2a')](_0x168214[_0xdd1c('0x27')],qs[_0xdd1c('0x2c')](_0x3b08d4['query'][_0xdd1c('0x2c')]));_0x1d43ff[_0xdd1c('0x2b')]=_0x1d43ff[_0xdd1c('0x2b')][_0xdd1c('0x2d')]?_0x1d43ff[_0xdd1c('0x2b')]:_0x168214[_0xdd1c('0x27')];_0x1d43ff[_0xdd1c('0x41')]=qs[_0xdd1c('0x42')](_0x3b08d4[_0xdd1c('0x23')][_0xdd1c('0x42')]);_0x1d43ff[_0xdd1c('0x43')]=qs[_0xdd1c('0x29')](_[_0xdd1c('0x51')](_0x3b08d4[_0xdd1c('0x23')],_0x168214[_0xdd1c('0x29')]));if(_0x3b08d4['query'][_0xdd1c('0x44')]){_0x1d43ff['where']=_[_0xdd1c('0x2f')](_0x1d43ff[_0xdd1c('0x43')],{'$or':_[_0xdd1c('0x1c')](_0x1d43ff[_0xdd1c('0x2b')],function(_0x23e6fb){var _0x171c88={};_0x171c88[_0x23e6fb]={'$like':'%'+_0x3b08d4['query']['filter']+'%'};return _0x171c88;})});}_0x1d43ff=_[_0xdd1c('0x2f')]({},_0x1d43ff,_0x3b08d4['options']);return _0x2d69d8[_0xdd1c('0x52')](_0x1d43ff);}})[_0xdd1c('0x14')](function(_0x13b8b1){if(_0x13b8b1){_0x2b9671=_0x13b8b1[_0xdd1c('0x2d')];if(!_0x3b08d4[_0xdd1c('0x23')]['hasOwnProperty'](_0xdd1c('0x53'))){_0x1d43ff['limit']=qs['limit'](_0x3b08d4[_0xdd1c('0x23')]['limit']);_0x1d43ff[_0xdd1c('0x10')]=qs['offset'](_0x3b08d4[_0xdd1c('0x23')][_0xdd1c('0x10')]);}return _0x2d69d8[_0xdd1c('0x52')](_0x1d43ff);}})[_0xdd1c('0x14')](function(_0x3ef9ea){if(_0x3ef9ea){return _0x3ef9ea?{'count':_0x2b9671,'rows':_0x3ef9ea}:null;}})['then'](respondWithResult(_0x2969f9,null))[_0xdd1c('0x32')](handleError(_0x2969f9,null));};exports[_0xdd1c('0x54')]=function(_0x183db4,_0x4ba0c6){var _0x50103d=_0x183db4[_0xdd1c('0x3b')][_0xdd1c('0x55')];return db[_0xdd1c('0x56')][_0xdd1c('0x24')]({'where':{'id':_0x50103d},'attributes':['id'],'include':[{'model':db[_0xdd1c('0x46')],'as':'Agents','attributes':['id',_0xdd1c('0x19'),'online','voicePause',_0xdd1c('0x57')],'raw':!![]}]})[_0xdd1c('0x14')](function(_0x38c87b){if(_0x38c87b){var _0x4ecfa1=_[_0xdd1c('0x58')](_0x38c87b,function(_0x7077de){var _0xaa1dc6=_0x7077de[_0xdd1c('0x15')]({'plain':!![]});return _0xaa1dc6['Agents'];});return db['MailQueue'][_0xdd1c('0x31')]({'where':{'id':_0x183db4['params']['id']}})[_0xdd1c('0x14')](function(_0x576c90){return db[_0xdd1c('0x59')][_0xdd1c('0x5a')](function(_0x27236d){return _0x576c90[_0xdd1c('0x54')](_0x50103d,{'transaction':_0x27236d})['then'](function(){return BPromise[_0xdd1c('0x5b')](_0x4ecfa1,function(_0x2de350){return db['UserMailQueue'][_0xdd1c('0x5c')]({'where':{'UserId':_0x2de350['id'],'MailQueueId':_0x183db4['params']['id']},'transaction':_0x27236d});});})[_0xdd1c('0x14')](function(){_0x4ecfa1[_0xdd1c('0x5d')](function(_0x2c6a87){socket[_0xdd1c('0x5e')](_0xdd1c('0x5f'),{'UserId':_0x2c6a87['id'],'MailQueueId':_0x576c90['id']});});});});});}})['then'](respondWithStatusCode(_0x4ba0c6,null))[_0xdd1c('0x32')](handleError(_0x4ba0c6,null));};exports['removeTeams']=function(_0x5f011d,_0x503e98){return db['Team'][_0xdd1c('0x24')]({'where':{'id':_0x5f011d[_0xdd1c('0x23')][_0xdd1c('0x55')]},'attributes':['id'],'include':[{'model':db[_0xdd1c('0x46')],'as':_0xdd1c('0x60'),'attributes':['id'],'raw':!![]}]})[_0xdd1c('0x14')](handleEntityNotFound(_0x503e98,null))['then'](function(_0x1e8102){var _0x3383cc=_['map'](_0x1e8102,'id');var _0x3bd853=[];var _0x562698=[];var _0x293faf=squel[_0xdd1c('0x61')]();_0x293faf[_0xdd1c('0x62')](_0xdd1c('0x63'))['from'](_0xdd1c('0x64'),'tq')[_0xdd1c('0x65')](_0xdd1c('0x66'),'ut',_0xdd1c('0x67'))[_0xdd1c('0x43')](_0xdd1c('0x68'),_0x5f011d[_0xdd1c('0x26')]['id']);for(var _0x193cfc=0x0;_0x193cfc<_0x1e8102[_0xdd1c('0x2d')];_0x193cfc+=0x1){let _0x37fc20=_0x1e8102[_0x193cfc];for(var _0x4f129d=0x0;_0x4f129d<_0x37fc20[_0xdd1c('0x60')]['length'];_0x4f129d+=0x1){let _0x2e3a22=_0x37fc20['Agents'][_0x4f129d];var _0x2d0df3=_0x293faf[_0xdd1c('0x69')]();_0x2d0df3[_0xdd1c('0x43')](_0xdd1c('0x6a'),_0x2e3a22['id']);_0x562698[_0xdd1c('0x6b')](db[_0xdd1c('0x59')][_0xdd1c('0x23')](_0x2d0df3['toString'](),{'type':db[_0xdd1c('0x59')][_0xdd1c('0x6c')]['SELECT']})['then'](function(_0x5d02ac){if(_0x5d02ac[_0xdd1c('0x2d')]===0x1){return _0x2e3a22['id'];}else{var _0x88f177=_[_0xdd1c('0x6d')](_[_0xdd1c('0x1c')](_0x5d02ac,_0xdd1c('0x6e')),function(_0x5ac401){return _[_0xdd1c('0x6f')](_0x3383cc,_0x5ac401);});if(_0x88f177){return _0x2e3a22['id'];}}}));}}return BPromise[_0xdd1c('0x70')](_0x562698)[_0xdd1c('0x14')](function(_0x9e5ef7){_0x3bd853=_(_0x3bd853)['union'](_0x9e5ef7)[_0xdd1c('0x71')]()[_0xdd1c('0x72')]();return db[_0xdd1c('0x1d')]['find']({'where':{'id':_0x5f011d[_0xdd1c('0x26')]['id']}})[_0xdd1c('0x14')](function(_0x374507){return db[_0xdd1c('0x59')][_0xdd1c('0x5a')](function(_0x59d8f5){return _0x374507[_0xdd1c('0x73')](_0x5f011d[_0xdd1c('0x23')][_0xdd1c('0x55')],{'transaction':_0x59d8f5})[_0xdd1c('0x14')](function(){if(!_['isEmpty'](_0x3bd853)){return _0x374507['removeAgents'](_0x3bd853,{'transaction':_0x59d8f5});}})[_0xdd1c('0x14')](function(){_0x3bd853[_0xdd1c('0x5d')](function(_0x22d86a){socket[_0xdd1c('0x5e')]('userMailQueue:remove',{'UserId':_0x22d86a,'MailQueueId':_0x374507['id']});});});});});});})[_0xdd1c('0x14')](respondWithStatusCode(_0x503e98,null))[_0xdd1c('0x32')](handleError(_0x503e98,null));};exports[_0xdd1c('0x74')]=function(_0x5b8ad9,_0x39d3ff){return db['MailQueue']['find']({'where':{'id':_0x5b8ad9['params']['id']}})[_0xdd1c('0x14')](handleEntityNotFound(_0x39d3ff,null))[_0xdd1c('0x14')](function(_0x373f44){if(_0x373f44){return _0x373f44['addAgents'](_0x5b8ad9['body'][_0xdd1c('0x55')],_[_0xdd1c('0x75')](_0x5b8ad9[_0xdd1c('0x3b')],[_0xdd1c('0x55'),'id'])||{})[_0xdd1c('0x76')](function(_0x5ab1b9){for(var _0x4a1dcf=0x0;_0x4a1dcf<_0x5b8ad9[_0xdd1c('0x3b')][_0xdd1c('0x55')]['length'];_0x4a1dcf+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x5b8ad9['body'][_0xdd1c('0x55')][_0x4a1dcf]),'MailQueueId':Number(_0x5b8ad9[_0xdd1c('0x26')]['id'])});}return _0x5ab1b9;});}})[_0xdd1c('0x14')](respondWithResult(_0x39d3ff,null))[_0xdd1c('0x32')](handleError(_0x39d3ff,null));};exports['removeAgents']=function(_0x4bd3f5,_0x1d2836){return db[_0xdd1c('0x1d')][_0xdd1c('0x31')]({'where':{'id':_0x4bd3f5['params']['id']}})[_0xdd1c('0x14')](handleEntityNotFound(_0x1d2836,null))[_0xdd1c('0x14')](function(_0x1b2761){if(_0x1b2761){return _0x1b2761[_0xdd1c('0x77')](_0x4bd3f5[_0xdd1c('0x23')][_0xdd1c('0x55')])[_0xdd1c('0x14')](function(){if(_['isArray'](_0x4bd3f5[_0xdd1c('0x23')][_0xdd1c('0x55')])){for(var _0x59c50f=0x0;_0x59c50f<_0x4bd3f5[_0xdd1c('0x23')][_0xdd1c('0x55')][_0xdd1c('0x2d')];_0x59c50f+=0x1){socket[_0xdd1c('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x4bd3f5['query']['ids'][_0x59c50f]),'MailQueueId':Number(_0x4bd3f5[_0xdd1c('0x26')]['id'])});}}else{socket[_0xdd1c('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x4bd3f5[_0xdd1c('0x23')][_0xdd1c('0x55')]),'MailQueueId':Number(_0x4bd3f5[_0xdd1c('0x26')]['id'])});}});}})[_0xdd1c('0x14')](respondWithStatusCode(_0x1d2836,null))[_0xdd1c('0x32')](handleError(_0x1d2836,null));};exports[_0xdd1c('0x78')]=function(_0xae6ce5,_0x64d06f){var _0x121b8c={};var _0x4d68a4={};var _0x4d86b3;var _0x3bfb66;return db[_0xdd1c('0x1d')]['findOne']({'where':{'id':_0xae6ce5[_0xdd1c('0x26')]['id']}})[_0xdd1c('0x14')](handleEntityNotFound(_0x64d06f,null))['then'](function(_0xd5967a){if(_0xd5967a){_0x4d86b3=_0xd5967a;_0x4d68a4[_0xdd1c('0x27')]=_[_0xdd1c('0x28')](db['User']['rawAttributes']);_0x4d68a4[_0xdd1c('0x23')]=_[_0xdd1c('0x28')](_0xae6ce5[_0xdd1c('0x23')]);_0x4d68a4['filters']=_[_0xdd1c('0x2a')](_0x4d68a4[_0xdd1c('0x27')],_0x4d68a4[_0xdd1c('0x23')]);_0x121b8c[_0xdd1c('0x2b')]=_[_0xdd1c('0x2a')](_0x4d68a4[_0xdd1c('0x27')],qs['fields'](_0xae6ce5[_0xdd1c('0x23')][_0xdd1c('0x2c')]));_0x121b8c[_0xdd1c('0x2b')]=_0x121b8c[_0xdd1c('0x2b')][_0xdd1c('0x2d')]?_0x121b8c[_0xdd1c('0x2b')]:_0x4d68a4['model'];_0x121b8c[_0xdd1c('0x41')]=qs[_0xdd1c('0x42')](_0xae6ce5['query'][_0xdd1c('0x42')]);_0x121b8c[_0xdd1c('0x43')]=qs['filters'](_[_0xdd1c('0x51')](_0xae6ce5['query'],_0x4d68a4['filters']));if(_0xae6ce5[_0xdd1c('0x23')]['filter']){_0x121b8c[_0xdd1c('0x43')]=_[_0xdd1c('0x2f')](_0x121b8c[_0xdd1c('0x43')],{'$or':_['map'](_0x121b8c[_0xdd1c('0x2b')],function(_0x59d5be){var _0x1f1983={};_0x1f1983[_0x59d5be]={'$like':'%'+_0xae6ce5[_0xdd1c('0x23')]['filter']+'%'};return _0x1f1983;})});}_0x121b8c=_[_0xdd1c('0x2f')]({},_0x121b8c,_0xae6ce5[_0xdd1c('0x30')]);return _0x4d86b3[_0xdd1c('0x78')](_0x121b8c);}})[_0xdd1c('0x14')](function(_0x72d530){if(_0x72d530){_0x3bfb66=_0x72d530[_0xdd1c('0x2d')];if(!_0xae6ce5[_0xdd1c('0x23')][_0xdd1c('0x40')](_0xdd1c('0x53'))){_0x121b8c['limit']=qs['limit'](_0xae6ce5[_0xdd1c('0x23')]['limit']);_0x121b8c[_0xdd1c('0x10')]=qs[_0xdd1c('0x10')](_0xae6ce5[_0xdd1c('0x23')][_0xdd1c('0x10')]);}return _0x4d86b3[_0xdd1c('0x78')](_0x121b8c);}})['then'](function(_0x32f147){if(_0x32f147){return _0x32f147?{'count':_0x3bfb66,'rows':_0x32f147}:null;}})[_0xdd1c('0x14')](respondWithResult(_0x64d06f,null))[_0xdd1c('0x32')](handleError(_0x64d06f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ae8b384..bb26136 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 _0x73e4=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit'];(function(_0xadc7a0,_0x175356){var _0x113f84=function(_0x3d5e76){while(--_0x3d5e76){_0xadc7a0['push'](_0xadc7a0['shift']());}};_0x113f84(++_0x175356);}(_0x73e4,0x1df));var _0x473e=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0x73e4[_0x39ea42];return _0x33f5b7;};'use strict';var EventEmitter=require(_0x473e('0x0'));var MailQueue=require(_0x473e('0x1'))['db'][_0x473e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x473e('0x3')](0x0);var events={'afterCreate':_0x473e('0x4'),'afterUpdate':'update','afterDestroy':_0x473e('0x5')};function emitEvent(_0x2c9a1c){return function(_0x2ddb37,_0x4b9bc4,_0x4e065e){MailQueueEvents['emit'](_0x2c9a1c+':'+_0x2ddb37['id'],_0x2ddb37);MailQueueEvents[_0x473e('0x6')](_0x2c9a1c,_0x2ddb37);_0x4e065e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x473e('0x7')](e,emitEvent(event));}}module[_0x473e('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x1c76=['remove','emit','hasOwnProperty','hook','exports','events','MailQueue','setMaxListeners','save'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x1c76,0x71));var _0x61c7=function(_0x3fbdc3,_0x28809f){_0x3fbdc3=_0x3fbdc3-0x0;var _0x463e87=_0x1c76[_0x3fbdc3];return _0x463e87;};'use strict';var EventEmitter=require(_0x61c7('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x61c7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x61c7('0x2')](0x0);var events={'afterCreate':_0x61c7('0x3'),'afterUpdate':'update','afterDestroy':_0x61c7('0x4')};function emitEvent(_0x45f7e1){return function(_0x1759a5,_0x61b0db,_0x3cdf3d){MailQueueEvents[_0x61c7('0x5')](_0x45f7e1+':'+_0x1759a5['id'],_0x1759a5);MailQueueEvents[_0x61c7('0x5')](_0x45f7e1,_0x1759a5);_0x3cdf3d(null);};}for(var e in events){if(events[_0x61c7('0x6')](e)){var event=events[e];MailQueue[_0x61c7('0x7')](e,emitEvent(event));}}module[_0x61c7('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 86cd014..6c0d704 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 _0x9095=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','MailQueue','mail_queues'];(function(_0x4a4122,_0x3ddf94){var _0x22f915=function(_0x50fb5b){while(--_0x50fb5b){_0x4a4122['push'](_0x4a4122['shift']());}};_0x22f915(++_0x3ddf94);}(_0x9095,0x190));var _0x5909=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x9095[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require('lodash');var util=require(_0x5909('0x0'));var logger=require(_0x5909('0x1'))(_0x5909('0x2'));var moment=require('moment');var BPromise=require(_0x5909('0x3'));var rp=require(_0x5909('0x4'));var fs=require('fs');var path=require(_0x5909('0x5'));var rimraf=require(_0x5909('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x5909('0x7')]=function(_0x339416,_0x4b82f2){return _0x339416['define'](_0x5909('0x8'),attributes,{'tableName':_0x5909('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65e9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0x140e67,_0x43d9b2){var _0x254383=function(_0x4b7ffb){while(--_0x4b7ffb){_0x140e67['push'](_0x140e67['shift']());}};_0x254383(++_0x43d9b2);}(_0x65e9,0x1a0));var _0x965e=function(_0x134f3f,_0x877e10){_0x134f3f=_0x134f3f-0x0;var _0x1147d4=_0x65e9[_0x134f3f];return _0x1147d4;};'use strict';var _=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var logger=require(_0x965e('0x2'))(_0x965e('0x3'));var moment=require(_0x965e('0x4'));var BPromise=require(_0x965e('0x5'));var rp=require(_0x965e('0x6'));var fs=require('fs');var path=require(_0x965e('0x7'));var rimraf=require(_0x965e('0x8'));var config=require(_0x965e('0x9'));var attributes=require(_0x965e('0xa'));module[_0x965e('0xb')]=function(_0x5d48d8,_0x7022d6){return _0x5d48d8['define'](_0x965e('0xc'),attributes,{'tableName':_0x965e('0xd'),'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 6f29a04..52a6404 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 _0x1601=['model','catch','ShowMailQueue','find','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','options','raw','where','limit','include','map','attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1601,0x151));var _0x1160=function(_0x4e1991,_0xeb727c){_0x4e1991=_0x4e1991-0x0;var _0x318050=_0x1601[_0x4e1991];return _0x318050;};'use strict';var _=require('lodash');var util=require(_0x1160('0x0'));var moment=require('moment');var BPromise=require(_0x1160('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1160('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1160('0x3'))(_0x1160('0x4'));var config=require(_0x1160('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1160('0x6')]({'port':0x232a});config[_0x1160('0x7')]=_[_0x1160('0x8')](config['redis'],{'host':_0x1160('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1160('0x7')]));require(_0x1160('0xa'))[_0x1160('0xb')](socket);function respondWithRpcPromise(_0x35fbfe,_0x536fbe,_0x39da44){return new BPromise(function(_0x14d24f,_0x9872a5){return client[_0x1160('0xc')](_0x35fbfe,_0x39da44)[_0x1160('0xd')](function(_0x4f41bf){logger[_0x1160('0xe')]('MailQueue,\x20%s,\x20%s',_0x536fbe,_0x1160('0xf'));logger[_0x1160('0x10')](_0x1160('0x11'),_0x536fbe,_0x1160('0xf'),JSON[_0x1160('0x12')](_0x4f41bf));if(_0x4f41bf['error']){if(_0x4f41bf[_0x1160('0x13')][_0x1160('0x14')]===0x1f4){logger[_0x1160('0x13')](_0x1160('0x15'),_0x536fbe,_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);return _0x9872a5(_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);}logger[_0x1160('0x13')](_0x1160('0x15'),_0x536fbe,_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);return _0x14d24f(_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);}else{logger[_0x1160('0xe')](_0x1160('0x15'),_0x536fbe,_0x1160('0xf'));_0x14d24f(_0x4f41bf[_0x1160('0x17')]['message']);}})['catch'](function(_0x221b5d){logger['error']('MailQueue,\x20%s,\x20%s',_0x536fbe,_0x221b5d);_0x9872a5(_0x221b5d);});});}exports[_0x1160('0x18')]=function(_0x7efc43){var _0xe7bfcb=this;return new Promise(function(_0x3c1ce9,_0x4abddd){return db[_0x1160('0x19')]['findAll']({'raw':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1b')]===undefined?!![]:![]:!![],'where':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1c')]||null:null,'attributes':_0x7efc43['options']?_0x7efc43[_0x1160('0x1a')]['attributes']||null:null,'limit':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1d')]||null:null,'include':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x7efc43[_0x1160('0x1a')][_0x1160('0x1e')],function(_0x52d053){return{'model':db[_0x52d053['model']],'as':_0x52d053['as'],'attributes':_0x52d053[_0x1160('0x20')],'include':_0x52d053[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x52d053[_0x1160('0x1e')],function(_0x532a43){return{'model':db[_0x532a43[_0x1160('0x21')]],'as':_0x532a43['as'],'attributes':_0x532a43[_0x1160('0x20')],'include':_0x532a43['include']?_[_0x1160('0x1f')](_0x532a43[_0x1160('0x1e')],function(_0x1d45b1){return{'model':db[_0x1d45b1[_0x1160('0x21')]],'as':_0x1d45b1['as'],'attributes':_0x1d45b1[_0x1160('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cde09){logger[_0x1160('0xe')](_0x1160('0x18'),_0x7efc43);logger[_0x1160('0x10')]('GetMailQueue',_0x7efc43,JSON[_0x1160('0x12')](_0x3cde09));_0x3c1ce9(_0x3cde09);})[_0x1160('0x22')](function(_0x5609d0){logger[_0x1160('0x13')]('GetMailQueue',_0x5609d0['message'],_0x7efc43);_0x4abddd(_0xe7bfcb[_0x1160('0x13')](0x1f4,_0x5609d0[_0x1160('0x16')]));});});};exports[_0x1160('0x23')]=function(_0x319196){var _0x4ab8e4=this;return new Promise(function(_0x44d8c8,_0xdff5a3){return db['MailQueue'][_0x1160('0x24')]({'raw':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1b')]===undefined?!![]:![]:!![],'where':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1c')]||null:null,'attributes':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')]['attributes']||null:null,'include':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1e')]?_['map'](_0x319196[_0x1160('0x1a')][_0x1160('0x1e')],function(_0x595015){return{'model':db[_0x595015[_0x1160('0x21')]],'as':_0x595015['as'],'attributes':_0x595015['attributes'],'include':_0x595015[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x595015['include'],function(_0x36fc9c){return{'model':db[_0x36fc9c[_0x1160('0x21')]],'as':_0x36fc9c['as'],'attributes':_0x36fc9c[_0x1160('0x20')],'include':_0x36fc9c[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x36fc9c[_0x1160('0x1e')],function(_0x203531){return{'model':db[_0x203531['model']],'as':_0x203531['as'],'attributes':_0x203531[_0x1160('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1160('0xd')](function(_0x1a05f9){logger[_0x1160('0xe')](_0x1160('0x23'),_0x319196);logger[_0x1160('0x10')](_0x1160('0x23'),_0x319196,JSON[_0x1160('0x12')](_0x1a05f9));_0x44d8c8(_0x1a05f9);})['catch'](function(_0xaafdbe){logger['error']('ShowMailQueue',_0xaafdbe[_0x1160('0x16')],_0x319196);_0xdff5a3(_0x4ab8e4[_0x1160('0x13')](0x1f4,_0xaafdbe[_0x1160('0x16')]));});});}; \ No newline at end of file +var _0x827a=['redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','model','include','debug','ShowMailQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dec7f,_0x40acc9){var _0x4a93d7=function(_0x5622e5){while(--_0x5622e5){_0x3dec7f['push'](_0x3dec7f['shift']());}};_0x4a93d7(++_0x40acc9);}(_0x827a,0x167));var _0xa827=function(_0x107010,_0x31e73e){_0x107010=_0x107010-0x0;var _0x380e82=_0x827a[_0x107010];return _0x380e82;};'use strict';var _=require(_0xa827('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa827('0x1'));var rs=require(_0xa827('0x2'));var fs=require('fs');var Redis=require(_0xa827('0x3'));var db=require(_0xa827('0x4'))['db'];var utils=require(_0xa827('0x5'));var logger=require('../../config/logger')(_0xa827('0x6'));var config=require(_0xa827('0x7'));var jayson=require(_0xa827('0x8'));var client=jayson['client'][_0xa827('0x9')]({'port':0x232a});config[_0xa827('0xa')]=_[_0xa827('0xb')](config[_0xa827('0xa')],{'host':_0xa827('0xc'),'port':0x18eb});var socket=require(_0xa827('0xd'))(new Redis(config['redis']));require(_0xa827('0xe'))[_0xa827('0xf')](socket);function respondWithRpcPromise(_0x240299,_0x207b29,_0x1d225b){return new BPromise(function(_0x160a4f,_0x468403){return client['request'](_0x240299,_0x1d225b)[_0xa827('0x10')](function(_0x5b85df){logger['info'](_0xa827('0x11'),_0x207b29,_0xa827('0x12'));logger['debug'](_0xa827('0x13'),_0x207b29,_0xa827('0x12'),JSON[_0xa827('0x14')](_0x5b85df));if(_0x5b85df[_0xa827('0x15')]){if(_0x5b85df[_0xa827('0x15')][_0xa827('0x16')]===0x1f4){logger['error'](_0xa827('0x11'),_0x207b29,_0x5b85df[_0xa827('0x15')]['message']);return _0x468403(_0x5b85df[_0xa827('0x15')][_0xa827('0x17')]);}logger['error'](_0xa827('0x11'),_0x207b29,_0x5b85df[_0xa827('0x15')][_0xa827('0x17')]);return _0x160a4f(_0x5b85df[_0xa827('0x15')][_0xa827('0x17')]);}else{logger[_0xa827('0x18')]('MailQueue,\x20%s,\x20%s',_0x207b29,'request\x20sent');_0x160a4f(_0x5b85df[_0xa827('0x19')][_0xa827('0x17')]);}})[_0xa827('0x1a')](function(_0x3a4bb3){logger[_0xa827('0x15')](_0xa827('0x11'),_0x207b29,_0x3a4bb3);_0x468403(_0x3a4bb3);});});}exports[_0xa827('0x1b')]=function(_0x53ce64){var _0x4bc21c=this;return new Promise(function(_0x763966,_0x25ccdb){return db[_0xa827('0x1c')][_0xa827('0x1d')]({'raw':_0x53ce64['options']?_0x53ce64[_0xa827('0x1e')][_0xa827('0x1f')]===undefined?!![]:![]:!![],'where':_0x53ce64[_0xa827('0x1e')]?_0x53ce64[_0xa827('0x1e')][_0xa827('0x20')]||null:null,'attributes':_0x53ce64[_0xa827('0x1e')]?_0x53ce64[_0xa827('0x1e')][_0xa827('0x21')]||null:null,'limit':_0x53ce64[_0xa827('0x1e')]?_0x53ce64['options'][_0xa827('0x22')]||null:null,'include':_0x53ce64[_0xa827('0x1e')]?_0x53ce64[_0xa827('0x1e')]['include']?_[_0xa827('0x23')](_0x53ce64[_0xa827('0x1e')]['include'],function(_0x17c8ee){return{'model':db[_0x17c8ee[_0xa827('0x24')]],'as':_0x17c8ee['as'],'attributes':_0x17c8ee['attributes'],'include':_0x17c8ee[_0xa827('0x25')]?_[_0xa827('0x23')](_0x17c8ee[_0xa827('0x25')],function(_0x385cb9){return{'model':db[_0x385cb9[_0xa827('0x24')]],'as':_0x385cb9['as'],'attributes':_0x385cb9[_0xa827('0x21')],'include':_0x385cb9[_0xa827('0x25')]?_[_0xa827('0x23')](_0x385cb9[_0xa827('0x25')],function(_0x1fcb54){return{'model':db[_0x1fcb54[_0xa827('0x24')]],'as':_0x1fcb54['as'],'attributes':_0x1fcb54[_0xa827('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19fa2f){logger[_0xa827('0x18')](_0xa827('0x1b'),_0x53ce64);logger[_0xa827('0x26')](_0xa827('0x1b'),_0x53ce64,JSON['stringify'](_0x19fa2f));_0x763966(_0x19fa2f);})[_0xa827('0x1a')](function(_0x2f3668){logger[_0xa827('0x15')](_0xa827('0x1b'),_0x2f3668[_0xa827('0x17')],_0x53ce64);_0x25ccdb(_0x4bc21c['error'](0x1f4,_0x2f3668[_0xa827('0x17')]));});});};exports[_0xa827('0x27')]=function(_0x127b5a){var _0x50d308=this;return new Promise(function(_0x3d0aec,_0x2063bf){return db['MailQueue'][_0xa827('0x28')]({'raw':_0x127b5a[_0xa827('0x1e')]?_0x127b5a['options'][_0xa827('0x1f')]===undefined?!![]:![]:!![],'where':_0x127b5a[_0xa827('0x1e')]?_0x127b5a[_0xa827('0x1e')][_0xa827('0x20')]||null:null,'attributes':_0x127b5a[_0xa827('0x1e')]?_0x127b5a['options']['attributes']||null:null,'include':_0x127b5a[_0xa827('0x1e')]?_0x127b5a[_0xa827('0x1e')][_0xa827('0x25')]?_[_0xa827('0x23')](_0x127b5a[_0xa827('0x1e')][_0xa827('0x25')],function(_0x2e4727){return{'model':db[_0x2e4727[_0xa827('0x24')]],'as':_0x2e4727['as'],'attributes':_0x2e4727[_0xa827('0x21')],'include':_0x2e4727['include']?_[_0xa827('0x23')](_0x2e4727[_0xa827('0x25')],function(_0x396908){return{'model':db[_0x396908[_0xa827('0x24')]],'as':_0x396908['as'],'attributes':_0x396908[_0xa827('0x21')],'include':_0x396908['include']?_[_0xa827('0x23')](_0x396908[_0xa827('0x25')],function(_0x3f9ecb){return{'model':db[_0x3f9ecb[_0xa827('0x24')]],'as':_0x3f9ecb['as'],'attributes':_0x3f9ecb[_0xa827('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa827('0x10')](function(_0x36a21a){logger['info'](_0xa827('0x27'),_0x127b5a);logger[_0xa827('0x26')]('ShowMailQueue',_0x127b5a,JSON[_0xa827('0x14')](_0x36a21a));_0x3d0aec(_0x36a21a);})[_0xa827('0x1a')](function(_0x4eeae9){logger[_0xa827('0x15')](_0xa827('0x27'),_0x4eeae9['message'],_0x127b5a);_0x2063bf(_0x50d308[_0xa827('0x15')](0x1f4,_0x4eeae9[_0xa827('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9bae056..eb15818 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 _0x0f03=['register','length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener'];(function(_0x1cc6fa,_0x5b91e3){var _0x468b91=function(_0x1c37b2){while(--_0x1c37b2){_0x1cc6fa['push'](_0x1cc6fa['shift']());}};_0x468b91(++_0x5b91e3);}(_0x0f03,0x113));var _0x30f0=function(_0x19365a,_0x6fd7d3){_0x19365a=_0x19365a-0x0;var _0x30bac3=_0x0f03[_0x19365a];return _0x30bac3;};'use strict';var MailQueueEvents=require(_0x30f0('0x0'));var events=['save',_0x30f0('0x1'),_0x30f0('0x2')];function createListener(_0x2a8f11,_0x1d1970){return function(_0x292aaf){_0x1d1970[_0x30f0('0x3')](_0x2a8f11,_0x292aaf);};}function removeListener(_0x3000d,_0x48816a){return function(){MailQueueEvents[_0x30f0('0x4')](_0x3000d,_0x48816a);};}exports[_0x30f0('0x5')]=function(_0x213cb3){for(var _0x58ea11=0x0,_0x21ffcb=events[_0x30f0('0x6')];_0x58ea11<_0x21ffcb;_0x58ea11++){var _0x3cdd7b=events[_0x58ea11];var _0x1e6ee2=createListener(_0x30f0('0x7')+_0x3cdd7b,_0x213cb3);MailQueueEvents['on'](_0x3cdd7b,_0x1e6ee2);}}; \ No newline at end of file +var _0xbee0=['emit','length','mailQueue:','save','remove','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbee0,0x147));var _0x0bee=function(_0x34b6f6,_0x440274){_0x34b6f6=_0x34b6f6-0x0;var _0x104376=_0xbee0[_0x34b6f6];return _0x104376;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x0bee('0x0'),_0x0bee('0x1'),_0x0bee('0x2')];function createListener(_0x37fcf4,_0x1e68ef){return function(_0x1a5077){_0x1e68ef[_0x0bee('0x3')](_0x37fcf4,_0x1a5077);};}function removeListener(_0xaed51f,_0x4ac5c8){return function(){MailQueueEvents['removeListener'](_0xaed51f,_0x4ac5c8);};}exports['register']=function(_0xd0c8f){for(var _0xa3a091=0x0,_0x3e499b=events[_0x0bee('0x4')];_0xa3a091<_0x3e499b;_0xa3a091++){var _0x498d63=events[_0xa3a091];var _0x163a08=createListener(_0x0bee('0x5')+_0x498d63,_0xd0c8f);MailQueueEvents['on'](_0x498d63,_0x163a08);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f3c6f69..6484b63 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 _0x3ecc=['index','/describe','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x3ecc,0xb2));var _0xc3ec=function(_0x427a0e,_0x4a275e){_0x427a0e=_0x427a0e-0x0;var _0x5262da=_0x3ecc[_0x427a0e];return _0x5262da;};'use strict';var multer=require(_0xc3ec('0x0'));var util=require(_0xc3ec('0x1'));var path=require(_0xc3ec('0x2'));var timeout=require(_0xc3ec('0x3'));var express=require('express');var router=express[_0xc3ec('0x4')]();var fs_extra=require(_0xc3ec('0x5'));var auth=require(_0xc3ec('0x6'));var interaction=require(_0xc3ec('0x7'));var config=require(_0xc3ec('0x8'));var controller=require(_0xc3ec('0x9'));router[_0xc3ec('0xa')]('/',auth['isAuthenticated'](),controller[_0xc3ec('0xb')]);router[_0xc3ec('0xa')](_0xc3ec('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3ec('0xd'),auth[_0xc3ec('0xe')](),controller[_0xc3ec('0xf')]);router[_0xc3ec('0x10')]('/',auth['isAuthenticated'](),controller[_0xc3ec('0x11')]);router[_0xc3ec('0x12')]('/:id',auth[_0xc3ec('0xe')](),controller['update']);router[_0xc3ec('0x13')](_0xc3ec('0xd'),auth[_0xc3ec('0xe')](),controller[_0xc3ec('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5322=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x5322,0xe5));var _0x2532=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x5322[_0x553150];return _0x18193d;};'use strict';var multer=require(_0x2532('0x0'));var util=require(_0x2532('0x1'));var path=require(_0x2532('0x2'));var timeout=require('connect-timeout');var express=require(_0x2532('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2532('0x4'));var interaction=require(_0x2532('0x5'));var config=require(_0x2532('0x6'));var controller=require(_0x2532('0x7'));router[_0x2532('0x8')]('/',auth[_0x2532('0x9')](),controller[_0x2532('0xa')]);router[_0x2532('0x8')]('/describe',auth[_0x2532('0x9')](),controller[_0x2532('0xb')]);router[_0x2532('0x8')](_0x2532('0xc'),auth[_0x2532('0x9')](),controller[_0x2532('0xd')]);router[_0x2532('0xe')]('/',auth['isAuthenticated'](),controller[_0x2532('0xf')]);router[_0x2532('0x10')](_0x2532('0xc'),auth[_0x2532('0x9')](),controller[_0x2532('0x11')]);router[_0x2532('0x12')](_0x2532('0xc'),auth[_0x2532('0x9')](),controller[_0x2532('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f795c37..93ae947 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 _0xc61d=['STRING','DATE','exports'];(function(_0x4bc458,_0x2ef1ea){var _0x87c5c7=function(_0x2f3959){while(--_0x2f3959){_0x4bc458['push'](_0x4bc458['shift']());}};_0x87c5c7(++_0x2ef1ea);}(_0xc61d,0x19a));var _0xdc61=function(_0x2f24e7,_0x38df4c){_0x2f24e7=_0x2f24e7-0x0;var _0x44bfc7=_0xc61d[_0x2f24e7];return _0x44bfc7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xdc61('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdc61('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdc61('0x2')]},'acceptAt':{'type':Sequelize[_0xdc61('0x2')]},'exitAt':{'type':Sequelize[_0xdc61('0x2')]},'reason':{'type':Sequelize[_0xdc61('0x1')]}}; \ No newline at end of file +var _0xaa9c=['moment','sequelize','exports','STRING','DATE'];(function(_0x24c086,_0x1cc5e8){var _0x41c437=function(_0x5e4299){while(--_0x5e4299){_0x24c086['push'](_0x24c086['shift']());}};_0x41c437(++_0x1cc5e8);}(_0xaa9c,0x1f4));var _0xcaa9=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xaa9c[_0x5f3f88];return _0xd08119;};'use strict';var moment=require(_0xcaa9('0x0'));var Sequelize=require(_0xcaa9('0x1'));module[_0xcaa9('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcaa9('0x3')]},'joinAt':{'type':Sequelize[_0xcaa9('0x4')]},'leaveAt':{'type':Sequelize[_0xcaa9('0x4')]},'acceptAt':{'type':Sequelize[_0xcaa9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xcaa9('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 1cd16fb..a6518ed 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 _0x3a6d=['keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','type','options','includeAll','rows','catch','params','rawAttributes','merge','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','then','error','stack','name','send','index','map','MailQueueReport','fieldName','key','query'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3a6d[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0xd3a6('0x0'));var rimraf=require(_0xd3a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3a6('0x2'));var rp=require(_0xd3a6('0x3'));var moment=require(_0xd3a6('0x4'));var BPromise=require(_0xd3a6('0x5'));var Mustache=require(_0xd3a6('0x6'));var util=require('util');var path=require(_0xd3a6('0x7'));var sox=require(_0xd3a6('0x8'));var csv=require(_0xd3a6('0x9'));var ejs=require(_0xd3a6('0xa'));var fs=require('fs');var fs_extra=require(_0xd3a6('0xb'));var _=require(_0xd3a6('0xc'));var squel=require('squel');var crypto=require(_0xd3a6('0xd'));var jsforce=require(_0xd3a6('0xe'));var deskjs=require(_0xd3a6('0xf'));var toCsv=require(_0xd3a6('0x9'));var querystring=require(_0xd3a6('0x10'));var Papa=require(_0xd3a6('0x11'));var Redis=require(_0xd3a6('0x12'));var authService=require(_0xd3a6('0x13'));var qs=require(_0xd3a6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3a6('0x15'));var logger=require(_0xd3a6('0x16'))(_0xd3a6('0x17'));var utils=require(_0xd3a6('0x18'));var config=require(_0xd3a6('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b0467,_0x1c6ad7){_0x1c6ad7=_0x1c6ad7||0xcc;return function(_0x671004){if(_0x671004){return _0x4b0467[_0xd3a6('0x1a')](_0x1c6ad7);}return _0x4b0467[_0xd3a6('0x1b')](_0x1c6ad7)[_0xd3a6('0x1c')]();};}function respondWithResult(_0x2911a0,_0xa56452){_0xa56452=_0xa56452||0xc8;return function(_0x4e67fb){if(_0x4e67fb){return _0x2911a0[_0xd3a6('0x1b')](_0xa56452)[_0xd3a6('0x1d')](_0x4e67fb);}};}function respondWithFilteredResult(_0x171a8f,_0x500a37){return function(_0x3c2399){if(_0x3c2399){var _0x305b61=typeof _0x500a37[_0xd3a6('0x1e')]==='undefined'&&typeof _0x500a37[_0xd3a6('0x1f')]==='undefined';var _0x518b6d=_0x3c2399[_0xd3a6('0x20')];var _0x8d1286=_0x305b61?0x0:_0x500a37[_0xd3a6('0x1e')];var _0xbe58b4=_0x305b61?_0x3c2399[_0xd3a6('0x20')]:_0x500a37[_0xd3a6('0x1e')]+_0x500a37[_0xd3a6('0x1f')];var _0x4ec27c;if(_0xbe58b4>=_0x518b6d){_0xbe58b4=_0x518b6d;_0x4ec27c=0xc8;}else{_0x4ec27c=0xce;}_0x171a8f[_0xd3a6('0x1b')](_0x4ec27c);return _0x171a8f['set'](_0xd3a6('0x21'),_0x8d1286+'-'+_0xbe58b4+'/'+_0x518b6d)[_0xd3a6('0x1d')](_0x3c2399);}return null;};}function patchUpdates(_0x12f2c1){return function(_0x20a34e){try{jsonpatch[_0xd3a6('0x22')](_0x20a34e,_0x12f2c1,!![]);}catch(_0x6ecd88){return BPromise['reject'](_0x6ecd88);}return _0x20a34e[_0xd3a6('0x23')]();};}function saveUpdates(_0x422f5c,_0x57cf15){return function(_0x543a6a){if(_0x543a6a){return _0x543a6a['update'](_0x422f5c)['then'](function(_0x5c9075){return _0x5c9075;});}return null;};}function removeEntity(_0x98a12a,_0x400982){return function(_0x3d0b28){if(_0x3d0b28){return _0x3d0b28['destroy']()[_0xd3a6('0x24')](function(){_0x98a12a['status'](0xcc)[_0xd3a6('0x1c')]();});}};}function handleEntityNotFound(_0x16afc8,_0x429079){return function(_0x4f6130){if(!_0x4f6130){_0x16afc8[_0xd3a6('0x1a')](0x194);}return _0x4f6130;};}function handleError(_0x3bc8d1,_0x1b09ac){_0x1b09ac=_0x1b09ac||0x1f4;return function(_0x219e32){logger[_0xd3a6('0x25')](_0x219e32[_0xd3a6('0x26')]);if(_0x219e32['name']){delete _0x219e32[_0xd3a6('0x27')];}_0x3bc8d1[_0xd3a6('0x1b')](_0x1b09ac)[_0xd3a6('0x28')](_0x219e32);};}exports[_0xd3a6('0x29')]=function(_0x30abc2,_0x45c628){var _0x5c2186={},_0x535bd4={},_0x1f4859={'count':0x0,'rows':[]};var _0x210aa1=_[_0xd3a6('0x2a')](db[_0xd3a6('0x2b')]['rawAttributes'],function(_0x3de3bb){return{'name':_0x3de3bb[_0xd3a6('0x2c')],'type':_0x3de3bb['type'][_0xd3a6('0x2d')]};});_0x535bd4['model']=_[_0xd3a6('0x2a')](_0x210aa1,_0xd3a6('0x27'));_0x535bd4[_0xd3a6('0x2e')]=_[_0xd3a6('0x2f')](_0x30abc2[_0xd3a6('0x2e')]);_0x535bd4[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x535bd4['model'],_0x535bd4['query']);_0x5c2186[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x535bd4[_0xd3a6('0x33')],qs['fields'](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x5c2186[_0xd3a6('0x32')]=_0x5c2186[_0xd3a6('0x32')][_0xd3a6('0x35')]?_0x5c2186[_0xd3a6('0x32')]:_0x535bd4[_0xd3a6('0x33')];if(!_0x30abc2[_0xd3a6('0x2e')]['hasOwnProperty'](_0xd3a6('0x36'))){_0x5c2186[_0xd3a6('0x1f')]=qs[_0xd3a6('0x1f')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x1f')]);_0x5c2186[_0xd3a6('0x1e')]=qs['offset'](_0x30abc2[_0xd3a6('0x2e')]['offset']);}_0x5c2186[_0xd3a6('0x37')]=qs[_0xd3a6('0x38')](_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x38')]);_0x5c2186['where']=qs['filters'](_[_0xd3a6('0x39')](_0x30abc2[_0xd3a6('0x2e')],_0x535bd4[_0xd3a6('0x30')]),_0x210aa1);if(_0x30abc2['query'][_0xd3a6('0x3a')]){_0x5c2186[_0xd3a6('0x3b')]=_['merge'](_0x5c2186[_0xd3a6('0x3b')],{'$or':_['map'](_0x210aa1,function(_0x1e695a){if(_0x1e695a[_0xd3a6('0x3c')]!=='VIRTUAL'){var _0x219ba5={};_0x219ba5[_0x1e695a['name']]={'$like':'%'+_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3a')]+'%'};return _0x219ba5;}})});}_0x5c2186=_['merge']({},_0x5c2186,_0x30abc2[_0xd3a6('0x3d')]);var _0xfcef03={'where':_0x5c2186[_0xd3a6('0x3b')]};return db[_0xd3a6('0x2b')]['count'](_0xfcef03)[_0xd3a6('0x24')](function(_0x324dbd){_0x1f4859[_0xd3a6('0x20')]=_0x324dbd;if(_0x30abc2[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x5c2186['include']=[{'all':!![]}];}return db[_0xd3a6('0x2b')]['findAll'](_0x5c2186);})[_0xd3a6('0x24')](function(_0x1bc18a){_0x1f4859[_0xd3a6('0x3f')]=_0x1bc18a;return _0x1f4859;})['then'](respondWithFilteredResult(_0x45c628,_0x5c2186))[_0xd3a6('0x40')](handleError(_0x45c628,null));};exports['show']=function(_0x23aa99,_0x4cbf76){var _0x448213={'raw':!![],'where':{'id':_0x23aa99[_0xd3a6('0x41')]['id']}},_0x629153={};_0x629153[_0xd3a6('0x33')]=_[_0xd3a6('0x2f')](db[_0xd3a6('0x2b')][_0xd3a6('0x42')]);_0x629153['query']=_[_0xd3a6('0x2f')](_0x23aa99[_0xd3a6('0x2e')]);_0x629153[_0xd3a6('0x30')]=_[_0xd3a6('0x31')](_0x629153['model'],_0x629153[_0xd3a6('0x2e')]);_0x448213[_0xd3a6('0x32')]=_[_0xd3a6('0x31')](_0x629153[_0xd3a6('0x33')],qs[_0xd3a6('0x34')](_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x34')]));_0x448213[_0xd3a6('0x32')]=_0x448213['attributes'][_0xd3a6('0x35')]?_0x448213[_0xd3a6('0x32')]:_0x629153[_0xd3a6('0x33')];if(_0x23aa99[_0xd3a6('0x2e')][_0xd3a6('0x3e')]){_0x448213['include']=[{'all':!![]}];}_0x448213=_[_0xd3a6('0x43')]({},_0x448213,_0x23aa99[_0xd3a6('0x3d')]);return db[_0xd3a6('0x2b')][_0xd3a6('0x44')](_0x448213)[_0xd3a6('0x24')](handleEntityNotFound(_0x4cbf76,null))[_0xd3a6('0x24')](respondWithResult(_0x4cbf76,null))[_0xd3a6('0x40')](handleError(_0x4cbf76,null));};exports[_0xd3a6('0x45')]=function(_0x4ac576,_0x7828c2){return db['MailQueueReport'][_0xd3a6('0x45')](_0x4ac576[_0xd3a6('0x46')],{})['then'](respondWithResult(_0x7828c2,0xc9))[_0xd3a6('0x40')](handleError(_0x7828c2,null));};exports[_0xd3a6('0x47')]=function(_0x3cf99a,_0x375067){if(_0x3cf99a[_0xd3a6('0x46')]['id']){delete _0x3cf99a[_0xd3a6('0x46')]['id'];}return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x3cf99a[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x375067,null))['then'](saveUpdates(_0x3cf99a[_0xd3a6('0x46')],null))[_0xd3a6('0x24')](respondWithResult(_0x375067,null))[_0xd3a6('0x40')](handleError(_0x375067,null));};exports[_0xd3a6('0x48')]=function(_0x26bd65,_0x225393){return db[_0xd3a6('0x2b')][_0xd3a6('0x44')]({'where':{'id':_0x26bd65[_0xd3a6('0x41')]['id']}})[_0xd3a6('0x24')](handleEntityNotFound(_0x225393,null))['then'](removeEntity(_0x225393,null))[_0xd3a6('0x40')](handleError(_0x225393,null));};exports[_0xd3a6('0x49')]=function(_0x618b72,_0x4995b7){return db[_0xd3a6('0x2b')]['describe']()['then'](respondWithResult(_0x4995b7,null))['catch'](handleError(_0x4995b7,null));}; \ No newline at end of file +var _0xf2e3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','error','stack','name','send','index','MailQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','then','includeAll','include','rows','catch','show','params','create','body','update','destroy','find','describe','eml-format'];(function(_0x4fc0a9,_0x3b4ff5){var _0x226a32=function(_0x5b359a){while(--_0x5b359a){_0x4fc0a9['push'](_0x4fc0a9['shift']());}};_0x226a32(++_0x3b4ff5);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xf2e3[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x3f2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f2e('0x1'));var jsonpatch=require(_0x3f2e('0x2'));var rp=require(_0x3f2e('0x3'));var moment=require(_0x3f2e('0x4'));var BPromise=require(_0x3f2e('0x5'));var Mustache=require(_0x3f2e('0x6'));var util=require(_0x3f2e('0x7'));var path=require(_0x3f2e('0x8'));var sox=require(_0x3f2e('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f2e('0xb'));var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0x11'));var querystring=require(_0x3f2e('0x12'));var Papa=require(_0x3f2e('0x13'));var Redis=require(_0x3f2e('0x14'));var authService=require(_0x3f2e('0x15'));var qs=require(_0x3f2e('0x16'));var as=require(_0x3f2e('0x17'));var hardwareService=require(_0x3f2e('0x18'));var logger=require(_0x3f2e('0x19'))(_0x3f2e('0x1a'));var utils=require(_0x3f2e('0x1b'));var config=require(_0x3f2e('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f2e('0x1d'))['db'];function respondWithStatusCode(_0xaa6ef5,_0x5471f9){_0x5471f9=_0x5471f9||0xcc;return function(_0xe83663){if(_0xe83663){return _0xaa6ef5[_0x3f2e('0x1e')](_0x5471f9);}return _0xaa6ef5[_0x3f2e('0x1f')](_0x5471f9)[_0x3f2e('0x20')]();};}function respondWithResult(_0x3d20d1,_0x57cba7){_0x57cba7=_0x57cba7||0xc8;return function(_0x298080){if(_0x298080){return _0x3d20d1[_0x3f2e('0x1f')](_0x57cba7)[_0x3f2e('0x21')](_0x298080);}};}function respondWithFilteredResult(_0x4f2e38,_0x43f69e){return function(_0x218b44){if(_0x218b44){var _0x17ef58=typeof _0x43f69e[_0x3f2e('0x22')]===_0x3f2e('0x23')&&typeof _0x43f69e[_0x3f2e('0x24')]===_0x3f2e('0x23');var _0x155411=_0x218b44[_0x3f2e('0x25')];var _0xc00add=_0x17ef58?0x0:_0x43f69e[_0x3f2e('0x22')];var _0x5b9989=_0x17ef58?_0x218b44[_0x3f2e('0x25')]:_0x43f69e[_0x3f2e('0x22')]+_0x43f69e[_0x3f2e('0x24')];var _0xbe899c;if(_0x5b9989>=_0x155411){_0x5b9989=_0x155411;_0xbe899c=0xc8;}else{_0xbe899c=0xce;}_0x4f2e38[_0x3f2e('0x1f')](_0xbe899c);return _0x4f2e38['set']('Content-Range',_0xc00add+'-'+_0x5b9989+'/'+_0x155411)[_0x3f2e('0x21')](_0x218b44);}return null;};}function patchUpdates(_0x11f84c){return function(_0x38bbae){try{jsonpatch[_0x3f2e('0x26')](_0x38bbae,_0x11f84c,!![]);}catch(_0x4381e5){return BPromise[_0x3f2e('0x27')](_0x4381e5);}return _0x38bbae['save']();};}function saveUpdates(_0x5a7047,_0xf81165){return function(_0x37dab2){if(_0x37dab2){return _0x37dab2['update'](_0x5a7047)['then'](function(_0x46bb1c){return _0x46bb1c;});}return null;};}function removeEntity(_0x5646f5,_0x1b8c67){return function(_0x401ed9){if(_0x401ed9){return _0x401ed9['destroy']()['then'](function(){_0x5646f5['status'](0xcc)[_0x3f2e('0x20')]();});}};}function handleEntityNotFound(_0x3d7631,_0x4c61d9){return function(_0x11a7cc){if(!_0x11a7cc){_0x3d7631['sendStatus'](0x194);}return _0x11a7cc;};}function handleError(_0x1ad875,_0x598541){_0x598541=_0x598541||0x1f4;return function(_0x2806d0){logger[_0x3f2e('0x28')](_0x2806d0[_0x3f2e('0x29')]);if(_0x2806d0[_0x3f2e('0x2a')]){delete _0x2806d0[_0x3f2e('0x2a')];}_0x1ad875['status'](_0x598541)[_0x3f2e('0x2b')](_0x2806d0);};}exports[_0x3f2e('0x2c')]=function(_0x5eab38,_0x528063){var _0x2b9fda={},_0x1e5db4={},_0x35f421={'count':0x0,'rows':[]};var _0x22e6ad=_['map'](db[_0x3f2e('0x2d')][_0x3f2e('0x2e')],function(_0x37ddfe){return{'name':_0x37ddfe['fieldName'],'type':_0x37ddfe[_0x3f2e('0x2f')][_0x3f2e('0x30')]};});_0x1e5db4[_0x3f2e('0x31')]=_['map'](_0x22e6ad,_0x3f2e('0x2a'));_0x1e5db4[_0x3f2e('0x32')]=_[_0x3f2e('0x33')](_0x5eab38[_0x3f2e('0x32')]);_0x1e5db4[_0x3f2e('0x34')]=_[_0x3f2e('0x35')](_0x1e5db4['model'],_0x1e5db4[_0x3f2e('0x32')]);_0x2b9fda[_0x3f2e('0x36')]=_[_0x3f2e('0x35')](_0x1e5db4[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x37')]));_0x2b9fda['attributes']=_0x2b9fda[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x2b9fda[_0x3f2e('0x36')]:_0x1e5db4[_0x3f2e('0x31')];if(!_0x5eab38['query']['hasOwnProperty'](_0x3f2e('0x39'))){_0x2b9fda[_0x3f2e('0x24')]=qs[_0x3f2e('0x24')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x24')]);_0x2b9fda[_0x3f2e('0x22')]=qs[_0x3f2e('0x22')](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x22')]);}_0x2b9fda[_0x3f2e('0x3a')]=qs['sort'](_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3b')]);_0x2b9fda[_0x3f2e('0x3c')]=qs[_0x3f2e('0x34')](_['pick'](_0x5eab38[_0x3f2e('0x32')],_0x1e5db4[_0x3f2e('0x34')]),_0x22e6ad);if(_0x5eab38[_0x3f2e('0x32')][_0x3f2e('0x3d')]){_0x2b9fda[_0x3f2e('0x3c')]=_[_0x3f2e('0x3e')](_0x2b9fda[_0x3f2e('0x3c')],{'$or':_[_0x3f2e('0x3f')](_0x22e6ad,function(_0x4c5ac2){if(_0x4c5ac2[_0x3f2e('0x2f')]!==_0x3f2e('0x40')){var _0x238b6b={};_0x238b6b[_0x4c5ac2[_0x3f2e('0x2a')]]={'$like':'%'+_0x5eab38['query'][_0x3f2e('0x3d')]+'%'};return _0x238b6b;}})});}_0x2b9fda=_[_0x3f2e('0x3e')]({},_0x2b9fda,_0x5eab38['options']);var _0x3fc694={'where':_0x2b9fda[_0x3f2e('0x3c')]};return db['MailQueueReport'][_0x3f2e('0x25')](_0x3fc694)[_0x3f2e('0x41')](function(_0x849236){_0x35f421[_0x3f2e('0x25')]=_0x849236;if(_0x5eab38['query'][_0x3f2e('0x42')]){_0x2b9fda[_0x3f2e('0x43')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x2b9fda);})[_0x3f2e('0x41')](function(_0x23de01){_0x35f421[_0x3f2e('0x44')]=_0x23de01;return _0x35f421;})['then'](respondWithFilteredResult(_0x528063,_0x2b9fda))[_0x3f2e('0x45')](handleError(_0x528063,null));};exports[_0x3f2e('0x46')]=function(_0x43b35a,_0xe9000a){var _0x24df56={'raw':!![],'where':{'id':_0x43b35a[_0x3f2e('0x47')]['id']}},_0x3668dc={};_0x3668dc[_0x3f2e('0x31')]=_[_0x3f2e('0x33')](db[_0x3f2e('0x2d')]['rawAttributes']);_0x3668dc['query']=_[_0x3f2e('0x33')](_0x43b35a[_0x3f2e('0x32')]);_0x3668dc['filters']=_['intersection'](_0x3668dc[_0x3f2e('0x31')],_0x3668dc[_0x3f2e('0x32')]);_0x24df56[_0x3f2e('0x36')]=_['intersection'](_0x3668dc[_0x3f2e('0x31')],qs[_0x3f2e('0x37')](_0x43b35a[_0x3f2e('0x32')]['fields']));_0x24df56[_0x3f2e('0x36')]=_0x24df56[_0x3f2e('0x36')][_0x3f2e('0x38')]?_0x24df56['attributes']:_0x3668dc[_0x3f2e('0x31')];if(_0x43b35a[_0x3f2e('0x32')][_0x3f2e('0x42')]){_0x24df56['include']=[{'all':!![]}];}_0x24df56=_[_0x3f2e('0x3e')]({},_0x24df56,_0x43b35a['options']);return db[_0x3f2e('0x2d')]['find'](_0x24df56)['then'](handleEntityNotFound(_0xe9000a,null))[_0x3f2e('0x41')](respondWithResult(_0xe9000a,null))[_0x3f2e('0x45')](handleError(_0xe9000a,null));};exports[_0x3f2e('0x48')]=function(_0x3d6fd2,_0x3e7fac){return db['MailQueueReport']['create'](_0x3d6fd2[_0x3f2e('0x49')],{})[_0x3f2e('0x41')](respondWithResult(_0x3e7fac,0xc9))[_0x3f2e('0x45')](handleError(_0x3e7fac,null));};exports[_0x3f2e('0x4a')]=function(_0x39dbd1,_0xb891b2){if(_0x39dbd1[_0x3f2e('0x49')]['id']){delete _0x39dbd1[_0x3f2e('0x49')]['id'];}return db[_0x3f2e('0x2d')]['find']({'where':{'id':_0x39dbd1['params']['id']}})[_0x3f2e('0x41')](handleEntityNotFound(_0xb891b2,null))['then'](saveUpdates(_0x39dbd1[_0x3f2e('0x49')],null))[_0x3f2e('0x41')](respondWithResult(_0xb891b2,null))[_0x3f2e('0x45')](handleError(_0xb891b2,null));};exports[_0x3f2e('0x4b')]=function(_0x4b6950,_0xd871da){return db['MailQueueReport'][_0x3f2e('0x4c')]({'where':{'id':_0x4b6950[_0x3f2e('0x47')]['id']}})['then'](handleEntityNotFound(_0xd871da,null))[_0x3f2e('0x41')](removeEntity(_0xd871da,null))['catch'](handleError(_0xd871da,null));};exports[_0x3f2e('0x4d')]=function(_0x336003,_0x9ccf3b){return db['MailQueueReport'][_0x3f2e('0x4d')]()[_0x3f2e('0x41')](respondWithResult(_0x9ccf3b,null))[_0x3f2e('0x45')](handleError(_0x9ccf3b,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b5ea4b3..4fa8365 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 _0x70e2=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2d1877,_0x1dab8e){var _0x1a950e=function(_0x35e56e){while(--_0x35e56e){_0x2d1877['push'](_0x2d1877['shift']());}};_0x1a950e(++_0x1dab8e);}(_0x70e2,0x119));var _0x270e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x70e2[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var logger=require(_0x270e('0x2'))(_0x270e('0x3'));var moment=require(_0x270e('0x4'));var BPromise=require(_0x270e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x270e('0x6'));var rimraf=require(_0x270e('0x7'));var config=require(_0x270e('0x8'));var attributes=require(_0x270e('0x9'));module[_0x270e('0xa')]=function(_0x51bee4,_0x413c32){return _0x51bee4[_0x270e('0xb')](_0x270e('0xc'),attributes,{'tableName':_0x270e('0xd'),'paranoid':![],'indexes':[{'name':_0x270e('0xe'),'fields':[_0x270e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88f2=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x88f2,0xc0));var _0x288f=function(_0x434c85,_0x3fd354){_0x434c85=_0x434c85-0x0;var _0x241458=_0x88f2[_0x434c85];return _0x241458;};'use strict';var _=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var logger=require(_0x288f('0x2'))('api');var moment=require(_0x288f('0x3'));var BPromise=require(_0x288f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x288f('0x5'));var rimraf=require(_0x288f('0x6'));var config=require('../../config/environment');var attributes=require(_0x288f('0x7'));module[_0x288f('0x8')]=function(_0x19004d,_0x108a5c){return _0x19004d[_0x288f('0x9')](_0x288f('0xa'),attributes,{'tableName':_0x288f('0xb'),'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 787e5b2..065efd0 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x4fdf11,_0x424d57){var _0x462038=function(_0x3a7d45){while(--_0x3a7d45){_0x4fdf11['push'](_0x4fdf11['shift']());}};_0x462038(++_0x424d57);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd25008,_0x2bfabf){var _0x282447=function(_0xb8fe0b){while(--_0xb8fe0b){_0xd25008['push'](_0xd25008['shift']());}};_0x282447(++_0x2bfabf);}(_0x326f,0xd1));var _0xf326=function(_0x28fee2,_0x2d33d7){_0x28fee2=_0x28fee2-0x0;var _0x5d013f=_0x326f[_0x28fee2];return _0x5d013f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index da27396..d8e6f06 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x202a98,_0x5a8367){var _0x12b54d=function(_0x3a08bf){while(--_0x3a08bf){_0x202a98['push'](_0x202a98['shift']());}};_0x12b54d(++_0x5a8367);}(_0xedd9,0xfc));var _0x9edd=function(_0x9defc4,_0x569d66){_0x9defc4=_0x9defc4-0x0;var _0x5bb415=_0xedd9[_0x9defc4];return _0x5bb415;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5cf877,_0x45bc82){var _0x2dc09c=function(_0x2843de){while(--_0x2843de){_0x5cf877['push'](_0x5cf877['shift']());}};_0x2dc09c(++_0x45bc82);}(_0x70e0,0x17b));var _0x070e=function(_0x2a2d71,_0x1c87a2){_0x2a2d71=_0x2a2d71-0x0;var _0x4fa0b3=_0x70e0[_0x2a2d71];return _0x4fa0b3;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index cef01c8..9ce48d9 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 _0xdf94=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3d1684,_0x103504){var _0x20dbaa=function(_0xc5a5f){while(--_0xc5a5f){_0x3d1684['push'](_0x3d1684['shift']());}};_0x20dbaa(++_0x103504);}(_0xdf94,0x1d7));var _0x4df9=function(_0x58fd36,_0x41104f){_0x58fd36=_0x58fd36-0x0;var _0x113ac7=_0xdf94[_0x58fd36];return _0x113ac7;};'use strict';var Sequelize=require('sequelize');module[_0x4df9('0x0')]={'description':{'type':Sequelize[_0x4df9('0x1')]},'host':{'type':Sequelize[_0x4df9('0x1')]},'authentication':{'type':Sequelize[_0x4df9('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4df9('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4df9('0x3')]},'tls':{'type':Sequelize[_0x4df9('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4df9('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x4df9('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb563=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0xb8cd85,_0x12d745){var _0x1ddb38=function(_0x420478){while(--_0x420478){_0xb8cd85['push'](_0xb8cd85['shift']());}};_0x1ddb38(++_0x12d745);}(_0xb563,0x16e));var _0x3b56=function(_0x3f2f33,_0x481350){_0x3f2f33=_0x3f2f33-0x0;var _0x35bc47=_0xb563[_0x3f2f33];return _0x35bc47;};'use strict';var Sequelize=require('sequelize');module[_0x3b56('0x0')]={'description':{'type':Sequelize[_0x3b56('0x1')]},'host':{'type':Sequelize[_0x3b56('0x1')]},'authentication':{'type':Sequelize[_0x3b56('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3b56('0x1')]},'password':{'type':Sequelize[_0x3b56('0x1')]},'port':{'type':Sequelize[_0x3b56('0x3')]},'tls':{'type':Sequelize[_0x3b56('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x3b56('0x4')},'connTimeout':{'type':Sequelize[_0x3b56('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3b56('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3b56('0x1')]},'modernAuthentication':{'type':Sequelize[_0x3b56('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c57fdfe..7e75f24 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 _0x95f4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x95f4,0x184));var _0x495f=function(_0x1878b5,_0x22cd53){_0x1878b5=_0x1878b5-0x0;var _0x4bdb4d=_0x95f4[_0x1878b5];return _0x4bdb4d;};'use strict';var _=require('lodash');var util=require(_0x495f('0x0'));var logger=require(_0x495f('0x1'))(_0x495f('0x2'));var moment=require('moment');var BPromise=require(_0x495f('0x3'));var rp=require(_0x495f('0x4'));var fs=require('fs');var path=require(_0x495f('0x5'));var rimraf=require(_0x495f('0x6'));var config=require(_0x495f('0x7'));var attributes=require(_0x495f('0x8'));module[_0x495f('0x9')]=function(_0xdabcbb,_0x373f14){return _0xdabcbb[_0x495f('0xa')](_0x495f('0xb'),attributes,{'tableName':_0x495f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6e=['bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment'];(function(_0x428966,_0x539b91){var _0x20dc3d=function(_0x3c89de){while(--_0x3c89de){_0x428966['push'](_0x428966['shift']());}};_0x20dc3d(++_0x539b91);}(_0x3c6e,0x168));var _0xe3c6=function(_0x5a3af1,_0x397a79){_0x5a3af1=_0x5a3af1-0x0;var _0xbaa54c=_0x3c6e[_0x5a3af1];return _0xbaa54c;};'use strict';var _=require(_0xe3c6('0x0'));var util=require('util');var logger=require(_0xe3c6('0x1'))(_0xe3c6('0x2'));var moment=require(_0xe3c6('0x3'));var BPromise=require(_0xe3c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3c6('0x5'));var rimraf=require(_0xe3c6('0x6'));var config=require(_0xe3c6('0x7'));var attributes=require(_0xe3c6('0x8'));module[_0xe3c6('0x9')]=function(_0x2edab1,_0x409a83){return _0x2edab1[_0xe3c6('0xa')](_0xe3c6('0xb'),attributes,{'tableName':_0xe3c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index a072e3f..7522832 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 _0xad8a=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','findAll','options','raw','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x1deef9,_0x51a983){var _0x4faf21=function(_0x8ba69){while(--_0x8ba69){_0x1deef9['push'](_0x1deef9['shift']());}};_0x4faf21(++_0x51a983);}(_0xad8a,0xb0));var _0xaad8=function(_0x3db83f,_0x2614a9){_0x3db83f=_0x3db83f-0x0;var _0x3d99c7=_0xad8a[_0x3db83f];return _0x3d99c7;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var moment=require(_0xaad8('0x2'));var BPromise=require(_0xaad8('0x3'));var rs=require(_0xaad8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad8('0x5'))['db'];var utils=require(_0xaad8('0x6'));var logger=require(_0xaad8('0x7'))('rpc');var config=require(_0xaad8('0x8'));var jayson=require(_0xaad8('0x9'));var client=jayson[_0xaad8('0xa')][_0xaad8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x95aef9,_0x39c599,_0x28f3a1){return new BPromise(function(_0xf3a6c7,_0x11408a){return client[_0xaad8('0xc')](_0x95aef9,_0x28f3a1)['then'](function(_0x52477f){logger[_0xaad8('0xd')](_0xaad8('0xe'),_0x39c599,_0xaad8('0xf'));logger[_0xaad8('0x10')](_0xaad8('0x11'),_0x39c599,_0xaad8('0xf'),JSON[_0xaad8('0x12')](_0x52477f));if(_0x52477f[_0xaad8('0x13')]){if(_0x52477f[_0xaad8('0x13')]['code']===0x1f4){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0x11408a(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);return _0xf3a6c7(_0x52477f[_0xaad8('0x13')][_0xaad8('0x14')]);}else{logger[_0xaad8('0xd')]('MailServerIn,\x20%s,\x20%s',_0x39c599,_0xaad8('0xf'));_0xf3a6c7(_0x52477f[_0xaad8('0x15')]['message']);}})[_0xaad8('0x16')](function(_0x2a8e12){logger[_0xaad8('0x13')](_0xaad8('0xe'),_0x39c599,_0x2a8e12);_0x11408a(_0x2a8e12);});});}exports[_0xaad8('0x17')]=function(_0x3895e2){var _0x535b82=this;return new Promise(function(_0xfd8b0a,_0x26684c){return db['MailServerIn'][_0xaad8('0x18')]({'raw':_0x3895e2['options']?_0x3895e2[_0xaad8('0x19')][_0xaad8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3895e2[_0xaad8('0x19')]?_0x3895e2[_0xaad8('0x19')]['where']||null:null,'attributes':_0x3895e2[_0xaad8('0x19')]?_0x3895e2[_0xaad8('0x19')]['attributes']||null:null,'limit':_0x3895e2[_0xaad8('0x19')]?_0x3895e2[_0xaad8('0x19')][_0xaad8('0x1b')]||null:null,'include':_0x3895e2['options']?_0x3895e2['options'][_0xaad8('0x1c')]?_[_0xaad8('0x1d')](_0x3895e2[_0xaad8('0x19')][_0xaad8('0x1c')],function(_0x29ba69){return{'model':db[_0x29ba69[_0xaad8('0x1e')]],'as':_0x29ba69['as'],'attributes':_0x29ba69[_0xaad8('0x1f')],'include':_0x29ba69[_0xaad8('0x1c')]?_[_0xaad8('0x1d')](_0x29ba69[_0xaad8('0x1c')],function(_0x1bbac4){return{'model':db[_0x1bbac4[_0xaad8('0x1e')]],'as':_0x1bbac4['as'],'attributes':_0x1bbac4[_0xaad8('0x1f')],'include':_0x1bbac4[_0xaad8('0x1c')]?_[_0xaad8('0x1d')](_0x1bbac4['include'],function(_0x3d254e){return{'model':db[_0x3d254e[_0xaad8('0x1e')]],'as':_0x3d254e['as'],'attributes':_0x3d254e[_0xaad8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x237c67){logger[_0xaad8('0xd')](_0xaad8('0x17'),_0x3895e2);logger[_0xaad8('0x10')](_0xaad8('0x17'),_0x3895e2,JSON['stringify'](_0x237c67));_0xfd8b0a(_0x237c67);})[_0xaad8('0x16')](function(_0x43c489){logger[_0xaad8('0x13')](_0xaad8('0x17'),_0x43c489[_0xaad8('0x14')],_0x3895e2);_0x26684c(_0x535b82['error'](0x1f4,_0x43c489[_0xaad8('0x14')]));});});}; \ No newline at end of file +var _0xbaa8=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','include','map','model','attributes'];(function(_0x568782,_0x11abe6){var _0x5ea78c=function(_0x272c96){while(--_0x272c96){_0x568782['push'](_0x568782['shift']());}};_0x5ea78c(++_0x11abe6);}(_0xbaa8,0x1d2));var _0x8baa=function(_0x27b1ca,_0xd8979e){_0x27b1ca=_0x27b1ca-0x0;var _0x1c32ee=_0xbaa8[_0x27b1ca];return _0x1c32ee;};'use strict';var _=require(_0x8baa('0x0'));var util=require(_0x8baa('0x1'));var moment=require(_0x8baa('0x2'));var BPromise=require(_0x8baa('0x3'));var rs=require(_0x8baa('0x4'));var fs=require('fs');var Redis=require(_0x8baa('0x5'));var db=require(_0x8baa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8baa('0x7'));var config=require('../../config/environment');var jayson=require(_0x8baa('0x8'));var client=jayson['client'][_0x8baa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ba019,_0x54097a,_0xf2f101){return new BPromise(function(_0x30f2cb,_0x306eac){return client[_0x8baa('0xa')](_0x4ba019,_0xf2f101)[_0x8baa('0xb')](function(_0x59b980){logger[_0x8baa('0xc')](_0x8baa('0xd'),_0x54097a,_0x8baa('0xe'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x54097a,'request\x20sent',JSON[_0x8baa('0xf')](_0x59b980));if(_0x59b980['error']){if(_0x59b980[_0x8baa('0x10')][_0x8baa('0x11')]===0x1f4){logger[_0x8baa('0x10')]('MailServerIn,\x20%s,\x20%s',_0x54097a,_0x59b980[_0x8baa('0x10')][_0x8baa('0x12')]);return _0x306eac(_0x59b980[_0x8baa('0x10')][_0x8baa('0x12')]);}logger[_0x8baa('0x10')](_0x8baa('0xd'),_0x54097a,_0x59b980['error'][_0x8baa('0x12')]);return _0x30f2cb(_0x59b980[_0x8baa('0x10')][_0x8baa('0x12')]);}else{logger[_0x8baa('0xc')](_0x8baa('0xd'),_0x54097a,_0x8baa('0xe'));_0x30f2cb(_0x59b980[_0x8baa('0x13')][_0x8baa('0x12')]);}})[_0x8baa('0x14')](function(_0x41a961){logger[_0x8baa('0x10')](_0x8baa('0xd'),_0x54097a,_0x41a961);_0x306eac(_0x41a961);});});}exports[_0x8baa('0x15')]=function(_0x17aefd){var _0x2a166c=this;return new Promise(function(_0x5a653c,_0x569889){return db[_0x8baa('0x16')]['findAll']({'raw':_0x17aefd['options']?_0x17aefd[_0x8baa('0x17')][_0x8baa('0x18')]===undefined?!![]:![]:!![],'where':_0x17aefd[_0x8baa('0x17')]?_0x17aefd[_0x8baa('0x17')][_0x8baa('0x19')]||null:null,'attributes':_0x17aefd[_0x8baa('0x17')]?_0x17aefd[_0x8baa('0x17')]['attributes']||null:null,'limit':_0x17aefd[_0x8baa('0x17')]?_0x17aefd[_0x8baa('0x17')]['limit']||null:null,'include':_0x17aefd[_0x8baa('0x17')]?_0x17aefd['options'][_0x8baa('0x1a')]?_[_0x8baa('0x1b')](_0x17aefd[_0x8baa('0x17')][_0x8baa('0x1a')],function(_0x1b7dd3){return{'model':db[_0x1b7dd3[_0x8baa('0x1c')]],'as':_0x1b7dd3['as'],'attributes':_0x1b7dd3[_0x8baa('0x1d')],'include':_0x1b7dd3[_0x8baa('0x1a')]?_[_0x8baa('0x1b')](_0x1b7dd3[_0x8baa('0x1a')],function(_0x478bba){return{'model':db[_0x478bba[_0x8baa('0x1c')]],'as':_0x478bba['as'],'attributes':_0x478bba[_0x8baa('0x1d')],'include':_0x478bba[_0x8baa('0x1a')]?_['map'](_0x478bba[_0x8baa('0x1a')],function(_0x49ea6f){return{'model':db[_0x49ea6f[_0x8baa('0x1c')]],'as':_0x49ea6f['as'],'attributes':_0x49ea6f[_0x8baa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8baa('0xb')](function(_0x1e54c5){logger['info'](_0x8baa('0x15'),_0x17aefd);logger[_0x8baa('0x1e')](_0x8baa('0x15'),_0x17aefd,JSON['stringify'](_0x1e54c5));_0x5a653c(_0x1e54c5);})[_0x8baa('0x14')](function(_0x5e1a55){logger[_0x8baa('0x10')](_0x8baa('0x15'),_0x5e1a55[_0x8baa('0x12')],_0x17aefd);_0x569889(_0x2a166c['error'](0x1f4,_0x5e1a55[_0x8baa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7cbe667..3e9ac68 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x2144dd,_0x52d9e8){_0x2144dd=_0x2144dd-0x0;var _0x519331=_0x7a54[_0x2144dd];return _0x519331;};'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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index b40c12c..39603af 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 _0x1775=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x181a6d,_0x74b05e){var _0x26c766=function(_0x2028df){while(--_0x2028df){_0x181a6d['push'](_0x181a6d['shift']());}};_0x26c766(++_0x74b05e);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'description':{'type':Sequelize[_0x5177('0x1')]},'host':{'type':Sequelize[_0x5177('0x1')]},'user':{'type':Sequelize[_0x5177('0x1')]},'pass':{'type':Sequelize[_0x5177('0x1')]},'port':{'type':Sequelize[_0x5177('0x2')]},'secure':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5177('0x1')]},'authentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9354=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x1540bc,_0xde65cc){var _0x502d93=function(_0x483368){while(--_0x483368){_0x1540bc['push'](_0x1540bc['shift']());}};_0x502d93(++_0xde65cc);}(_0x9354,0x96));var _0x4935=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x9354[_0x2962d5];return _0x273406;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'description':{'type':Sequelize[_0x4935('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x4935('0x1')]},'pass':{'type':Sequelize[_0x4935('0x1')]},'port':{'type':Sequelize[_0x4935('0x2')]},'secure':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4935('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index ad35002..af97fac 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 _0x71bb=['zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','key','map','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf'];(function(_0x116170,_0x52d23e){var _0x12b47b=function(_0x3c167a){while(--_0x3c167a){_0x116170['push'](_0x116170['shift']());}};_0x12b47b(++_0x52d23e);}(_0x71bb,0x176));var _0xb71b=function(_0x5eb7df,_0x199b27){_0x5eb7df=_0x5eb7df-0x0;var _0x13daa9=_0x71bb[_0x5eb7df];return _0x13daa9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71b('0x0'));var zipdir=require(_0xb71b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb71b('0x2'));var moment=require('moment');var BPromise=require(_0xb71b('0x3'));var Mustache=require(_0xb71b('0x4'));var util=require('util');var path=require(_0xb71b('0x5'));var sox=require(_0xb71b('0x6'));var csv=require('to-csv');var ejs=require(_0xb71b('0x7'));var fs=require('fs');var fs_extra=require(_0xb71b('0x8'));var _=require(_0xb71b('0x9'));var squel=require(_0xb71b('0xa'));var crypto=require(_0xb71b('0xb'));var jsforce=require(_0xb71b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb71b('0xd'));var querystring=require(_0xb71b('0xe'));var Papa=require(_0xb71b('0xf'));var Redis=require(_0xb71b('0x10'));var authService=require(_0xb71b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb71b('0x13'));var config=require(_0xb71b('0x14'));var licenseUtil=require(_0xb71b('0x15'));var db=require(_0xb71b('0x16'))['db'];function respondWithStatusCode(_0x5ed632,_0x526094){_0x526094=_0x526094||0xcc;return function(_0x5bdfee){if(_0x5bdfee){return _0x5ed632[_0xb71b('0x17')](_0x526094);}return _0x5ed632[_0xb71b('0x18')](_0x526094)[_0xb71b('0x19')]();};}function respondWithResult(_0x2beb3d,_0x17195a){_0x17195a=_0x17195a||0xc8;return function(_0x5df4ee){if(_0x5df4ee){return _0x2beb3d[_0xb71b('0x18')](_0x17195a)[_0xb71b('0x1a')](_0x5df4ee);}};}function respondWithFilteredResult(_0x4d0ab2,_0x431b47){return function(_0x177d58){if(_0x177d58){var _0x1462d0=typeof _0x431b47[_0xb71b('0x1b')]===_0xb71b('0x1c')&&typeof _0x431b47[_0xb71b('0x1d')]===_0xb71b('0x1c');var _0x2c36b9=_0x177d58[_0xb71b('0x1e')];var _0x1bb1ff=_0x1462d0?0x0:_0x431b47[_0xb71b('0x1b')];var _0xaa495e=_0x1462d0?_0x177d58[_0xb71b('0x1e')]:_0x431b47[_0xb71b('0x1b')]+_0x431b47[_0xb71b('0x1d')];var _0x2b3e69;if(_0xaa495e>=_0x2c36b9){_0xaa495e=_0x2c36b9;_0x2b3e69=0xc8;}else{_0x2b3e69=0xce;}_0x4d0ab2['status'](_0x2b3e69);return _0x4d0ab2['set'](_0xb71b('0x1f'),_0x1bb1ff+'-'+_0xaa495e+'/'+_0x2c36b9)[_0xb71b('0x1a')](_0x177d58);}return null;};}function patchUpdates(_0x488542){return function(_0x34bce4){try{jsonpatch[_0xb71b('0x20')](_0x34bce4,_0x488542,!![]);}catch(_0x7cde97){return BPromise[_0xb71b('0x21')](_0x7cde97);}return _0x34bce4[_0xb71b('0x22')]();};}function saveUpdates(_0xc9616b,_0x13b0d6){return function(_0x556298){if(_0x556298){return _0x556298[_0xb71b('0x23')](_0xc9616b)[_0xb71b('0x24')](function(_0x4dbb86){return _0x4dbb86;});}return null;};}function removeEntity(_0x13cd98,_0x1b73dc){return function(_0x4e8bcd){if(_0x4e8bcd){return _0x4e8bcd[_0xb71b('0x25')]()[_0xb71b('0x24')](function(){_0x13cd98[_0xb71b('0x18')](0xcc)[_0xb71b('0x19')]();});}};}function handleEntityNotFound(_0x1832bb,_0xa9d0f7){return function(_0x5cfc1d){if(!_0x5cfc1d){_0x1832bb['sendStatus'](0x194);}return _0x5cfc1d;};}function handleError(_0x5a57b8,_0x162f6a){_0x162f6a=_0x162f6a||0x1f4;return function(_0x1a6562){logger[_0xb71b('0x26')](_0x1a6562[_0xb71b('0x27')]);if(_0x1a6562[_0xb71b('0x28')]){delete _0x1a6562[_0xb71b('0x28')];}_0x5a57b8[_0xb71b('0x18')](_0x162f6a)[_0xb71b('0x29')](_0x1a6562);};}exports[_0xb71b('0x2a')]=function(_0x47aea5,_0x5a2f71){var _0xe216e3={},_0xba73be={},_0x1f1cb0={'count':0x0,'rows':[]};var _0x5a1ace=_['map'](db[_0xb71b('0x2b')][_0xb71b('0x2c')],function(_0x2c090f){return{'name':_0x2c090f[_0xb71b('0x2d')],'type':_0x2c090f['type'][_0xb71b('0x2e')]};});_0xba73be['model']=_[_0xb71b('0x2f')](_0x5a1ace,_0xb71b('0x28'));_0xba73be['query']=_[_0xb71b('0x30')](_0x47aea5[_0xb71b('0x31')]);_0xba73be[_0xb71b('0x32')]=_[_0xb71b('0x33')](_0xba73be['model'],_0xba73be[_0xb71b('0x31')]);_0xe216e3[_0xb71b('0x34')]=_[_0xb71b('0x33')](_0xba73be[_0xb71b('0x35')],qs['fields'](_0x47aea5[_0xb71b('0x31')][_0xb71b('0x36')]));_0xe216e3['attributes']=_0xe216e3[_0xb71b('0x34')][_0xb71b('0x37')]?_0xe216e3[_0xb71b('0x34')]:_0xba73be[_0xb71b('0x35')];if(!_0x47aea5[_0xb71b('0x31')]['hasOwnProperty'](_0xb71b('0x38'))){_0xe216e3[_0xb71b('0x1d')]=qs[_0xb71b('0x1d')](_0x47aea5[_0xb71b('0x31')][_0xb71b('0x1d')]);_0xe216e3[_0xb71b('0x1b')]=qs[_0xb71b('0x1b')](_0x47aea5[_0xb71b('0x31')][_0xb71b('0x1b')]);}_0xe216e3[_0xb71b('0x39')]=qs[_0xb71b('0x3a')](_0x47aea5[_0xb71b('0x31')][_0xb71b('0x3a')]);_0xe216e3['where']=qs['filters'](_[_0xb71b('0x3b')](_0x47aea5['query'],_0xba73be[_0xb71b('0x32')]),_0x5a1ace);if(_0x47aea5[_0xb71b('0x31')][_0xb71b('0x3c')]){_0xe216e3[_0xb71b('0x3d')]=_[_0xb71b('0x3e')](_0xe216e3[_0xb71b('0x3d')],{'$or':_['map'](_0x5a1ace,function(_0x48af29){if(_0x48af29['type']!==_0xb71b('0x3f')){var _0x336d6a={};_0x336d6a[_0x48af29['name']]={'$like':'%'+_0x47aea5['query'][_0xb71b('0x3c')]+'%'};return _0x336d6a;}})});}_0xe216e3=_['merge']({},_0xe216e3,_0x47aea5['options']);var _0x5e0451={'where':_0xe216e3[_0xb71b('0x3d')]};return db[_0xb71b('0x2b')][_0xb71b('0x1e')](_0x5e0451)['then'](function(_0x2f9720){_0x1f1cb0[_0xb71b('0x1e')]=_0x2f9720;if(_0x47aea5[_0xb71b('0x31')][_0xb71b('0x40')]){_0xe216e3[_0xb71b('0x41')]=[{'all':!![]}];}return db[_0xb71b('0x2b')][_0xb71b('0x42')](_0xe216e3);})['then'](function(_0x5d6fa4){_0x1f1cb0[_0xb71b('0x43')]=_0x5d6fa4;return _0x1f1cb0;})[_0xb71b('0x24')](respondWithFilteredResult(_0x5a2f71,_0xe216e3))[_0xb71b('0x44')](handleError(_0x5a2f71,null));};exports[_0xb71b('0x45')]=function(_0x86ee8d,_0xd13d13){var _0x28d7e8={'raw':!![],'where':{'id':_0x86ee8d['params']['id']}},_0x52a2d0={};_0x52a2d0[_0xb71b('0x35')]=_[_0xb71b('0x30')](db[_0xb71b('0x2b')][_0xb71b('0x2c')]);_0x52a2d0[_0xb71b('0x31')]=_[_0xb71b('0x30')](_0x86ee8d[_0xb71b('0x31')]);_0x52a2d0[_0xb71b('0x32')]=_[_0xb71b('0x33')](_0x52a2d0[_0xb71b('0x35')],_0x52a2d0[_0xb71b('0x31')]);_0x28d7e8[_0xb71b('0x34')]=_[_0xb71b('0x33')](_0x52a2d0['model'],qs[_0xb71b('0x36')](_0x86ee8d[_0xb71b('0x31')][_0xb71b('0x36')]));_0x28d7e8[_0xb71b('0x34')]=_0x28d7e8[_0xb71b('0x34')][_0xb71b('0x37')]?_0x28d7e8[_0xb71b('0x34')]:_0x52a2d0['model'];if(_0x86ee8d[_0xb71b('0x31')][_0xb71b('0x40')]){_0x28d7e8[_0xb71b('0x41')]=[{'all':!![]}];}_0x28d7e8=_[_0xb71b('0x3e')]({},_0x28d7e8,_0x86ee8d[_0xb71b('0x46')]);return db['MailServerOut'][_0xb71b('0x47')](_0x28d7e8)[_0xb71b('0x24')](handleEntityNotFound(_0xd13d13,null))['then'](respondWithResult(_0xd13d13,null))[_0xb71b('0x44')](handleError(_0xd13d13,null));};exports[_0xb71b('0x48')]=function(_0x52c7fe,_0x43fa7a){return db['MailServerOut'][_0xb71b('0x48')](_0x52c7fe[_0xb71b('0x49')],{})[_0xb71b('0x24')](respondWithResult(_0x43fa7a,0xc9))[_0xb71b('0x44')](handleError(_0x43fa7a,null));};exports[_0xb71b('0x23')]=function(_0x1257c9,_0x2daeb2){if(_0x1257c9[_0xb71b('0x49')]['id']){delete _0x1257c9[_0xb71b('0x49')]['id'];}return db['MailServerOut'][_0xb71b('0x47')]({'where':{'id':_0x1257c9[_0xb71b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2daeb2,null))[_0xb71b('0x24')](saveUpdates(_0x1257c9[_0xb71b('0x49')],null))['then'](respondWithResult(_0x2daeb2,null))[_0xb71b('0x44')](handleError(_0x2daeb2,null));};exports['destroy']=function(_0x20a4fb,_0x548131){return db['MailServerOut'][_0xb71b('0x47')]({'where':{'id':_0x20a4fb[_0xb71b('0x4a')]['id']}})[_0xb71b('0x24')](handleEntityNotFound(_0x548131,null))[_0xb71b('0x24')](removeEntity(_0x548131,null))[_0xb71b('0x44')](handleError(_0x548131,null));}; \ No newline at end of file +var _0x444f=['filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','json','undefined','limit','offset','count','set','Content-Range','save','update','destroy','sendStatus','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick'];(function(_0x10c7c4,_0x5bbcd5){var _0x559a09=function(_0x27f426){while(--_0x27f426){_0x10c7c4['push'](_0x10c7c4['shift']());}};_0x559a09(++_0x5bbcd5);}(_0x444f,0x1c6));var _0xf444=function(_0x5ec3e2,_0x5294df){_0x5ec3e2=_0x5ec3e2-0x0;var _0x152654=_0x444f[_0x5ec3e2];return _0x152654;};'use strict';var emlformat=require(_0xf444('0x0'));var rimraf=require(_0xf444('0x1'));var zipdir=require(_0xf444('0x2'));var jsonpatch=require(_0xf444('0x3'));var rp=require(_0xf444('0x4'));var moment=require(_0xf444('0x5'));var BPromise=require(_0xf444('0x6'));var Mustache=require(_0xf444('0x7'));var util=require(_0xf444('0x8'));var path=require(_0xf444('0x9'));var sox=require(_0xf444('0xa'));var csv=require(_0xf444('0xb'));var ejs=require(_0xf444('0xc'));var fs=require('fs');var fs_extra=require(_0xf444('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf444('0xe'));var jsforce=require(_0xf444('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf444('0xb'));var querystring=require(_0xf444('0x10'));var Papa=require(_0xf444('0x11'));var Redis=require(_0xf444('0x12'));var authService=require(_0xf444('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf444('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf444('0x15'))(_0xf444('0x16'));var utils=require('../../config/utils');var config=require(_0xf444('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49de5c,_0x4fdefa){_0x4fdefa=_0x4fdefa||0xcc;return function(_0x286f96){if(_0x286f96){return _0x49de5c['sendStatus'](_0x4fdefa);}return _0x49de5c[_0xf444('0x18')](_0x4fdefa)['end']();};}function respondWithResult(_0x4a2a86,_0x5a11ae){_0x5a11ae=_0x5a11ae||0xc8;return function(_0x749f09){if(_0x749f09){return _0x4a2a86[_0xf444('0x18')](_0x5a11ae)[_0xf444('0x19')](_0x749f09);}};}function respondWithFilteredResult(_0x5071c7,_0x592e23){return function(_0x215edf){if(_0x215edf){var _0x23709c=typeof _0x592e23['offset']===_0xf444('0x1a')&&typeof _0x592e23[_0xf444('0x1b')]===_0xf444('0x1a');var _0x1dcbf8=_0x215edf['count'];var _0x43bd4f=_0x23709c?0x0:_0x592e23[_0xf444('0x1c')];var _0x1c9909=_0x23709c?_0x215edf[_0xf444('0x1d')]:_0x592e23['offset']+_0x592e23[_0xf444('0x1b')];var _0x2a8a08;if(_0x1c9909>=_0x1dcbf8){_0x1c9909=_0x1dcbf8;_0x2a8a08=0xc8;}else{_0x2a8a08=0xce;}_0x5071c7[_0xf444('0x18')](_0x2a8a08);return _0x5071c7[_0xf444('0x1e')](_0xf444('0x1f'),_0x43bd4f+'-'+_0x1c9909+'/'+_0x1dcbf8)['json'](_0x215edf);}return null;};}function patchUpdates(_0x314f53){return function(_0x5c14d5){try{jsonpatch['apply'](_0x5c14d5,_0x314f53,!![]);}catch(_0x17872f){return BPromise['reject'](_0x17872f);}return _0x5c14d5[_0xf444('0x20')]();};}function saveUpdates(_0x5f54f0,_0x4df09a){return function(_0x22f02a){if(_0x22f02a){return _0x22f02a[_0xf444('0x21')](_0x5f54f0)['then'](function(_0x993d03){return _0x993d03;});}return null;};}function removeEntity(_0x5e667f,_0x523d2a){return function(_0x27bd4c){if(_0x27bd4c){return _0x27bd4c[_0xf444('0x22')]()['then'](function(){_0x5e667f[_0xf444('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x524a08,_0x13188d){return function(_0x2caf89){if(!_0x2caf89){_0x524a08[_0xf444('0x23')](0x194);}return _0x2caf89;};}function handleError(_0x186b92,_0x1b9eff){_0x1b9eff=_0x1b9eff||0x1f4;return function(_0xe761cc){logger[_0xf444('0x24')](_0xe761cc[_0xf444('0x25')]);if(_0xe761cc[_0xf444('0x26')]){delete _0xe761cc['name'];}_0x186b92[_0xf444('0x18')](_0x1b9eff)['send'](_0xe761cc);};}exports[_0xf444('0x27')]=function(_0x169de3,_0x1073d8){var _0xf06b18={},_0xa670a={},_0x22b173={'count':0x0,'rows':[]};var _0x40f5c7=_[_0xf444('0x28')](db[_0xf444('0x29')][_0xf444('0x2a')],function(_0x391c21){return{'name':_0x391c21[_0xf444('0x2b')],'type':_0x391c21[_0xf444('0x2c')][_0xf444('0x2d')]};});_0xa670a[_0xf444('0x2e')]=_[_0xf444('0x28')](_0x40f5c7,_0xf444('0x26'));_0xa670a[_0xf444('0x2f')]=_[_0xf444('0x30')](_0x169de3['query']);_0xa670a[_0xf444('0x31')]=_[_0xf444('0x32')](_0xa670a[_0xf444('0x2e')],_0xa670a['query']);_0xf06b18[_0xf444('0x33')]=_['intersection'](_0xa670a[_0xf444('0x2e')],qs[_0xf444('0x34')](_0x169de3['query'][_0xf444('0x34')]));_0xf06b18[_0xf444('0x33')]=_0xf06b18['attributes'][_0xf444('0x35')]?_0xf06b18[_0xf444('0x33')]:_0xa670a[_0xf444('0x2e')];if(!_0x169de3['query'][_0xf444('0x36')]('nolimit')){_0xf06b18[_0xf444('0x1b')]=qs[_0xf444('0x1b')](_0x169de3['query']['limit']);_0xf06b18[_0xf444('0x1c')]=qs['offset'](_0x169de3[_0xf444('0x2f')][_0xf444('0x1c')]);}_0xf06b18['order']=qs[_0xf444('0x37')](_0x169de3[_0xf444('0x2f')][_0xf444('0x37')]);_0xf06b18['where']=qs[_0xf444('0x31')](_[_0xf444('0x38')](_0x169de3[_0xf444('0x2f')],_0xa670a[_0xf444('0x31')]),_0x40f5c7);if(_0x169de3['query'][_0xf444('0x39')]){_0xf06b18[_0xf444('0x3a')]=_[_0xf444('0x3b')](_0xf06b18[_0xf444('0x3a')],{'$or':_['map'](_0x40f5c7,function(_0x8f8dd8){if(_0x8f8dd8[_0xf444('0x2c')]!==_0xf444('0x3c')){var _0x292185={};_0x292185[_0x8f8dd8[_0xf444('0x26')]]={'$like':'%'+_0x169de3[_0xf444('0x2f')][_0xf444('0x39')]+'%'};return _0x292185;}})});}_0xf06b18=_[_0xf444('0x3b')]({},_0xf06b18,_0x169de3[_0xf444('0x3d')]);var _0x46cf33={'where':_0xf06b18[_0xf444('0x3a')]};return db[_0xf444('0x29')][_0xf444('0x1d')](_0x46cf33)[_0xf444('0x3e')](function(_0x39974c){_0x22b173[_0xf444('0x1d')]=_0x39974c;if(_0x169de3[_0xf444('0x2f')][_0xf444('0x3f')]){_0xf06b18[_0xf444('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0xf444('0x41')](_0xf06b18);})[_0xf444('0x3e')](function(_0x348250){_0x22b173[_0xf444('0x42')]=_0x348250;return _0x22b173;})['then'](respondWithFilteredResult(_0x1073d8,_0xf06b18))[_0xf444('0x43')](handleError(_0x1073d8,null));};exports[_0xf444('0x44')]=function(_0x5c46ff,_0x4ff6e0){var _0x547b9a={'raw':!![],'where':{'id':_0x5c46ff['params']['id']}},_0x1cd206={};_0x1cd206[_0xf444('0x2e')]=_[_0xf444('0x30')](db[_0xf444('0x29')][_0xf444('0x2a')]);_0x1cd206[_0xf444('0x2f')]=_[_0xf444('0x30')](_0x5c46ff['query']);_0x1cd206[_0xf444('0x31')]=_[_0xf444('0x32')](_0x1cd206['model'],_0x1cd206[_0xf444('0x2f')]);_0x547b9a['attributes']=_[_0xf444('0x32')](_0x1cd206[_0xf444('0x2e')],qs['fields'](_0x5c46ff[_0xf444('0x2f')][_0xf444('0x34')]));_0x547b9a['attributes']=_0x547b9a[_0xf444('0x33')]['length']?_0x547b9a[_0xf444('0x33')]:_0x1cd206[_0xf444('0x2e')];if(_0x5c46ff[_0xf444('0x2f')]['includeAll']){_0x547b9a['include']=[{'all':!![]}];}_0x547b9a=_[_0xf444('0x3b')]({},_0x547b9a,_0x5c46ff[_0xf444('0x3d')]);return db[_0xf444('0x29')][_0xf444('0x45')](_0x547b9a)[_0xf444('0x3e')](handleEntityNotFound(_0x4ff6e0,null))['then'](respondWithResult(_0x4ff6e0,null))['catch'](handleError(_0x4ff6e0,null));};exports[_0xf444('0x46')]=function(_0x35371a,_0x563ce3){return db[_0xf444('0x29')][_0xf444('0x46')](_0x35371a[_0xf444('0x47')],{})[_0xf444('0x3e')](respondWithResult(_0x563ce3,0xc9))[_0xf444('0x43')](handleError(_0x563ce3,null));};exports[_0xf444('0x21')]=function(_0x405726,_0x1444b1){if(_0x405726[_0xf444('0x47')]['id']){delete _0x405726[_0xf444('0x47')]['id'];}return db[_0xf444('0x29')][_0xf444('0x45')]({'where':{'id':_0x405726[_0xf444('0x48')]['id']}})['then'](handleEntityNotFound(_0x1444b1,null))[_0xf444('0x3e')](saveUpdates(_0x405726[_0xf444('0x47')],null))[_0xf444('0x3e')](respondWithResult(_0x1444b1,null))[_0xf444('0x43')](handleError(_0x1444b1,null));};exports[_0xf444('0x22')]=function(_0x2a48a6,_0x47cea5){return db[_0xf444('0x29')][_0xf444('0x45')]({'where':{'id':_0x2a48a6[_0xf444('0x48')]['id']}})['then'](handleEntityNotFound(_0x47cea5,null))[_0xf444('0x3e')](removeEntity(_0x47cea5,null))[_0xf444('0x43')](handleError(_0x47cea5,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a3dcee8..64acb01 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 _0x193c=['MailServerOut','mail_servers_out','lodash','util','api','moment','bluebird','request-promise','path','define'];(function(_0x35c627,_0x4a2520){var _0x4f2ce5=function(_0x4196bb){while(--_0x4196bb){_0x35c627['push'](_0x35c627['shift']());}};_0x4f2ce5(++_0x4a2520);}(_0x193c,0x1ce));var _0xc193=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x193c[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xc193('0x0'));var util=require(_0xc193('0x1'));var logger=require('../../config/logger')(_0xc193('0x2'));var moment=require(_0xc193('0x3'));var BPromise=require(_0xc193('0x4'));var rp=require(_0xc193('0x5'));var fs=require('fs');var path=require(_0xc193('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x259150,_0x50d468){return _0x259150[_0xc193('0x7')](_0xc193('0x8'),attributes,{'tableName':_0xc193('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1655=['request-promise','path','rimraf','define','mail_servers_out','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1655,0x95));var _0x5165=function(_0x2b406c,_0x1daeac){_0x2b406c=_0x2b406c-0x0;var _0x2d74d9=_0x1655[_0x2b406c];return _0x2d74d9;};'use strict';var _=require('lodash');var util=require(_0x5165('0x0'));var logger=require('../../config/logger')(_0x5165('0x1'));var moment=require(_0x5165('0x2'));var BPromise=require(_0x5165('0x3'));var rp=require(_0x5165('0x4'));var fs=require('fs');var path=require(_0x5165('0x5'));var rimraf=require(_0x5165('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x5cb38c,_0x167143){return _0x5cb38c[_0x5165('0x7')]('MailServerOut',attributes,{'tableName':_0x5165('0x8'),'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 28e3e3c..3e082fe 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xd2a93a,_0x5cfc39){var _0x41d6f4=function(_0x1a1020){while(--_0x1a1020){_0xd2a93a['push'](_0xd2a93a['shift']());}};_0x41d6f4(++_0x5cfc39);}(_0xdb28,0x106));var _0x8db2=function(_0x8cf4d6,_0x58be29){_0x8cf4d6=_0x8cf4d6-0x0;var _0x2e0793=_0xdb28[_0x8cf4d6];return _0x2e0793;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3affea,_0x45726b){var _0x434ead=function(_0x288515){while(--_0x288515){_0x3affea['push'](_0x3affea['shift']());}};_0x434ead(++_0x45726b);}(_0xdb28,0x106));var _0x8db2=function(_0x2fbb24,_0xa91302){_0x2fbb24=_0x2fbb24-0x0;var _0x46aa99=_0xdb28[_0x2fbb24];return _0x46aa99;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e22c50c..4b61cfe 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 _0x4077=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4077,0xcf));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7407('0x0'));var util=require(_0x7407('0x1'));var path=require(_0x7407('0x2'));var timeout=require(_0x7407('0x3'));var express=require(_0x7407('0x4'));var router=express[_0x7407('0x5')]();var fs_extra=require(_0x7407('0x6'));var auth=require(_0x7407('0x7'));var interaction=require(_0x7407('0x8'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x7407('0x9')]('/',auth[_0x7407('0xa')](),controller[_0x7407('0xb')]);router[_0x7407('0x9')](_0x7407('0xc'),auth['isAuthenticated'](),controller[_0x7407('0xd')]);router[_0x7407('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7407('0xe')]);router[_0x7407('0xf')]('/',auth[_0x7407('0xa')](),controller[_0x7407('0x10')]);router[_0x7407('0x11')](_0x7407('0x12'),auth[_0x7407('0xa')](),controller[_0x7407('0x13')]);router[_0x7407('0x14')]('/:id',auth[_0x7407('0xa')](),controller[_0x7407('0x15')]);module[_0x7407('0x16')]=router; \ No newline at end of file +var _0x2e70=['isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','index','/describe'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x2e70,0x1bf));var _0x02e7=function(_0xae9ef4,_0x31188d){_0xae9ef4=_0xae9ef4-0x0;var _0x2259cc=_0x2e70[_0xae9ef4];return _0x2259cc;};'use strict';var multer=require(_0x02e7('0x0'));var util=require(_0x02e7('0x1'));var path=require(_0x02e7('0x2'));var timeout=require(_0x02e7('0x3'));var express=require(_0x02e7('0x4'));var router=express[_0x02e7('0x5')]();var fs_extra=require(_0x02e7('0x6'));var auth=require(_0x02e7('0x7'));var interaction=require(_0x02e7('0x8'));var config=require('../../config/environment');var controller=require(_0x02e7('0x9'));router[_0x02e7('0xa')]('/',auth['isAuthenticated'](),controller[_0x02e7('0xb')]);router[_0x02e7('0xa')](_0x02e7('0xc'),auth[_0x02e7('0xd')](),controller[_0x02e7('0xe')]);router[_0x02e7('0xa')](_0x02e7('0xf'),auth[_0x02e7('0xd')](),controller[_0x02e7('0x10')]);router[_0x02e7('0x11')]('/',auth[_0x02e7('0xd')](),controller[_0x02e7('0x12')]);router[_0x02e7('0x13')](_0x02e7('0xf'),auth['isAuthenticated'](),controller[_0x02e7('0x14')]);router['delete'](_0x02e7('0xf'),auth[_0x02e7('0xd')](),controller[_0x02e7('0x15')]);module[_0x02e7('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 61865b8..19e068c 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 _0xfc46=['name','sequelize','STRING'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0xfc46,0x9a));var _0x6fc4=function(_0x228641,_0x25d636){_0x228641=_0x228641-0x0;var _0x5d5d78=_0xfc46[_0x228641];return _0x5d5d78;};'use strict';var Sequelize=require(_0x6fc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fc4('0x1')],'unique':_0x6fc4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6fc4('0x1')]}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','name','STRING'];(function(_0x2fa69c,_0x336b16){var _0x2202a3=function(_0x541559){while(--_0x541559){_0x2fa69c['push'](_0x2fa69c['shift']());}};_0x2202a3(++_0x336b16);}(_0x46ed,0x168));var _0xd46e=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x46ed[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd46e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 4a1655c..1b84867 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 _0x42c6=['jsforce','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','save','update','then','destroy','error','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','MailSubstatus','include','findAll','rows','show','params','rawAttributes','keys','length','find','create','body','describe','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x478ce1,_0x460726){var _0x5c8c1a=function(_0x44625e){while(--_0x44625e){_0x478ce1['push'](_0x478ce1['shift']());}};_0x5c8c1a(++_0x460726);}(_0x42c6,0x8d));var _0x642c=function(_0x2f2b37,_0x5a545b){_0x2f2b37=_0x2f2b37-0x0;var _0x170f0b=_0x42c6[_0x2f2b37];return _0x170f0b;};'use strict';var emlformat=require(_0x642c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x642c('0x1'));var jsonpatch=require(_0x642c('0x2'));var rp=require('request-promise');var moment=require(_0x642c('0x3'));var BPromise=require(_0x642c('0x4'));var Mustache=require(_0x642c('0x5'));var util=require(_0x642c('0x6'));var path=require(_0x642c('0x7'));var sox=require(_0x642c('0x8'));var csv=require(_0x642c('0x9'));var ejs=require(_0x642c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x642c('0xb'));var squel=require(_0x642c('0xc'));var crypto=require('crypto');var jsforce=require(_0x642c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x642c('0x9'));var querystring=require('querystring');var Papa=require(_0x642c('0xe'));var Redis=require(_0x642c('0xf'));var authService=require(_0x642c('0x10'));var qs=require(_0x642c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x642c('0x12'));var logger=require(_0x642c('0x13'))(_0x642c('0x14'));var utils=require(_0x642c('0x15'));var config=require(_0x642c('0x16'));var licenseUtil=require(_0x642c('0x17'));var db=require(_0x642c('0x18'))['db'];function respondWithStatusCode(_0x442ca5,_0xee4004){_0xee4004=_0xee4004||0xcc;return function(_0x423ed8){if(_0x423ed8){return _0x442ca5[_0x642c('0x19')](_0xee4004);}return _0x442ca5[_0x642c('0x1a')](_0xee4004)[_0x642c('0x1b')]();};}function respondWithResult(_0x55e173,_0x23e01d){_0x23e01d=_0x23e01d||0xc8;return function(_0x5117d4){if(_0x5117d4){return _0x55e173[_0x642c('0x1a')](_0x23e01d)['json'](_0x5117d4);}};}function respondWithFilteredResult(_0x49ad01,_0x1476fc){return function(_0x500631){if(_0x500631){var _0x254510=typeof _0x1476fc[_0x642c('0x1c')]===_0x642c('0x1d')&&typeof _0x1476fc[_0x642c('0x1e')]===_0x642c('0x1d');var _0xfc6b98=_0x500631[_0x642c('0x1f')];var _0x4a683c=_0x254510?0x0:_0x1476fc['offset'];var _0x4b2a5e=_0x254510?_0x500631[_0x642c('0x1f')]:_0x1476fc[_0x642c('0x1c')]+_0x1476fc[_0x642c('0x1e')];var _0x6e263b;if(_0x4b2a5e>=_0xfc6b98){_0x4b2a5e=_0xfc6b98;_0x6e263b=0xc8;}else{_0x6e263b=0xce;}_0x49ad01['status'](_0x6e263b);return _0x49ad01[_0x642c('0x20')](_0x642c('0x21'),_0x4a683c+'-'+_0x4b2a5e+'/'+_0xfc6b98)[_0x642c('0x22')](_0x500631);}return null;};}function patchUpdates(_0x32a8cf){return function(_0x2a13d6){try{jsonpatch['apply'](_0x2a13d6,_0x32a8cf,!![]);}catch(_0x412479){return BPromise[_0x642c('0x23')](_0x412479);}return _0x2a13d6[_0x642c('0x24')]();};}function saveUpdates(_0x5eeec8,_0x51e9aa){return function(_0x4260a5){if(_0x4260a5){return _0x4260a5[_0x642c('0x25')](_0x5eeec8)[_0x642c('0x26')](function(_0x153f90){return _0x153f90;});}return null;};}function removeEntity(_0x2e54fa,_0x4e2953){return function(_0x547ac4){if(_0x547ac4){return _0x547ac4[_0x642c('0x27')]()[_0x642c('0x26')](function(){_0x2e54fa[_0x642c('0x1a')](0xcc)[_0x642c('0x1b')]();});}};}function handleEntityNotFound(_0x4516dc,_0x2ab79c){return function(_0x4f9fe9){if(!_0x4f9fe9){_0x4516dc[_0x642c('0x19')](0x194);}return _0x4f9fe9;};}function handleError(_0x358c3f,_0x2b1d35){_0x2b1d35=_0x2b1d35||0x1f4;return function(_0x37c223){logger[_0x642c('0x28')](_0x37c223[_0x642c('0x29')]);if(_0x37c223[_0x642c('0x2a')]){delete _0x37c223[_0x642c('0x2a')];}_0x358c3f[_0x642c('0x1a')](_0x2b1d35)['send'](_0x37c223);};}exports[_0x642c('0x2b')]=function(_0x169a52,_0x1a573f){var _0x14d951={},_0x56be6c={},_0x383ab2={'count':0x0,'rows':[]};var _0x504648=_[_0x642c('0x2c')](db['MailSubstatus']['rawAttributes'],function(_0x3d07de){return{'name':_0x3d07de[_0x642c('0x2d')],'type':_0x3d07de[_0x642c('0x2e')]['key']};});_0x56be6c[_0x642c('0x2f')]=_[_0x642c('0x2c')](_0x504648,'name');_0x56be6c['query']=_['keys'](_0x169a52[_0x642c('0x30')]);_0x56be6c['filters']=_[_0x642c('0x31')](_0x56be6c[_0x642c('0x2f')],_0x56be6c[_0x642c('0x30')]);_0x14d951[_0x642c('0x32')]=_[_0x642c('0x31')](_0x56be6c[_0x642c('0x2f')],qs['fields'](_0x169a52[_0x642c('0x30')][_0x642c('0x33')]));_0x14d951[_0x642c('0x32')]=_0x14d951[_0x642c('0x32')]['length']?_0x14d951[_0x642c('0x32')]:_0x56be6c[_0x642c('0x2f')];if(!_0x169a52[_0x642c('0x30')][_0x642c('0x34')](_0x642c('0x35'))){_0x14d951[_0x642c('0x1e')]=qs[_0x642c('0x1e')](_0x169a52[_0x642c('0x30')][_0x642c('0x1e')]);_0x14d951[_0x642c('0x1c')]=qs['offset'](_0x169a52[_0x642c('0x30')][_0x642c('0x1c')]);}_0x14d951[_0x642c('0x36')]=qs['sort'](_0x169a52[_0x642c('0x30')][_0x642c('0x37')]);_0x14d951[_0x642c('0x38')]=qs[_0x642c('0x39')](_[_0x642c('0x3a')](_0x169a52[_0x642c('0x30')],_0x56be6c[_0x642c('0x39')]),_0x504648);if(_0x169a52[_0x642c('0x30')][_0x642c('0x3b')]){_0x14d951[_0x642c('0x38')]=_[_0x642c('0x3c')](_0x14d951[_0x642c('0x38')],{'$or':_[_0x642c('0x2c')](_0x504648,function(_0x5b3f3c){if(_0x5b3f3c[_0x642c('0x2e')]!==_0x642c('0x3d')){var _0xb021f4={};_0xb021f4[_0x5b3f3c[_0x642c('0x2a')]]={'$like':'%'+_0x169a52[_0x642c('0x30')][_0x642c('0x3b')]+'%'};return _0xb021f4;}})});}_0x14d951=_[_0x642c('0x3c')]({},_0x14d951,_0x169a52[_0x642c('0x3e')]);var _0x3c1ce0={'where':_0x14d951[_0x642c('0x38')]};return db[_0x642c('0x3f')][_0x642c('0x1f')](_0x3c1ce0)['then'](function(_0x6c9879){_0x383ab2['count']=_0x6c9879;if(_0x169a52['query']['includeAll']){_0x14d951[_0x642c('0x40')]=[{'all':!![]}];}return db[_0x642c('0x3f')][_0x642c('0x41')](_0x14d951);})[_0x642c('0x26')](function(_0x137366){_0x383ab2[_0x642c('0x42')]=_0x137366;return _0x383ab2;})[_0x642c('0x26')](respondWithFilteredResult(_0x1a573f,_0x14d951))['catch'](handleError(_0x1a573f,null));};exports[_0x642c('0x43')]=function(_0x1460b8,_0xf8258c){var _0x5e1baa={'raw':!![],'where':{'id':_0x1460b8[_0x642c('0x44')]['id']}},_0x2b99fe={};_0x2b99fe[_0x642c('0x2f')]=_['keys'](db['MailSubstatus'][_0x642c('0x45')]);_0x2b99fe['query']=_[_0x642c('0x46')](_0x1460b8[_0x642c('0x30')]);_0x2b99fe[_0x642c('0x39')]=_[_0x642c('0x31')](_0x2b99fe[_0x642c('0x2f')],_0x2b99fe['query']);_0x5e1baa[_0x642c('0x32')]=_[_0x642c('0x31')](_0x2b99fe[_0x642c('0x2f')],qs[_0x642c('0x33')](_0x1460b8[_0x642c('0x30')][_0x642c('0x33')]));_0x5e1baa['attributes']=_0x5e1baa['attributes'][_0x642c('0x47')]?_0x5e1baa[_0x642c('0x32')]:_0x2b99fe[_0x642c('0x2f')];if(_0x1460b8[_0x642c('0x30')]['includeAll']){_0x5e1baa[_0x642c('0x40')]=[{'all':!![]}];}_0x5e1baa=_['merge']({},_0x5e1baa,_0x1460b8['options']);return db[_0x642c('0x3f')][_0x642c('0x48')](_0x5e1baa)['then'](handleEntityNotFound(_0xf8258c,null))['then'](respondWithResult(_0xf8258c,null))['catch'](handleError(_0xf8258c,null));};exports[_0x642c('0x49')]=function(_0x3a265b,_0x28c587){return db[_0x642c('0x3f')][_0x642c('0x49')](_0x3a265b[_0x642c('0x4a')],{})[_0x642c('0x26')](respondWithResult(_0x28c587,0xc9))['catch'](handleError(_0x28c587,null));};exports[_0x642c('0x25')]=function(_0x475730,_0x319bf3){if(_0x475730['body']['id']){delete _0x475730[_0x642c('0x4a')]['id'];}return db[_0x642c('0x3f')][_0x642c('0x48')]({'where':{'id':_0x475730['params']['id']}})[_0x642c('0x26')](handleEntityNotFound(_0x319bf3,null))[_0x642c('0x26')](saveUpdates(_0x475730[_0x642c('0x4a')],null))[_0x642c('0x26')](respondWithResult(_0x319bf3,null))['catch'](handleError(_0x319bf3,null));};exports[_0x642c('0x27')]=function(_0x1e8439,_0x30c95c){return db[_0x642c('0x3f')][_0x642c('0x48')]({'where':{'id':_0x1e8439[_0x642c('0x44')]['id']}})[_0x642c('0x26')](handleEntityNotFound(_0x30c95c,null))[_0x642c('0x26')](removeEntity(_0x30c95c,null))['catch'](handleError(_0x30c95c,null));};exports[_0x642c('0x4b')]=function(_0x3d473b,_0x11b337){return db[_0x642c('0x3f')]['describe']()[_0x642c('0x26')](respondWithResult(_0x11b337,null))[_0x642c('0x4c')](handleError(_0x11b337,null));}; \ No newline at end of file +var _0x4c16=['zip-dir','fast-json-patch','moment','mustache','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','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','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','destroy','error','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','fields','find','create','body','update','params','describe','eml-format'];(function(_0x531daf,_0x24a221){var _0x486c56=function(_0x167b26){while(--_0x167b26){_0x531daf['push'](_0x531daf['shift']());}};_0x486c56(++_0x24a221);}(_0x4c16,0x1cd));var _0x64c1=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x4c16[_0x506d83];return _0x335e8b;};'use strict';var emlformat=require(_0x64c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64c1('0x1'));var jsonpatch=require(_0x64c1('0x2'));var rp=require('request-promise');var moment=require(_0x64c1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x64c1('0x4'));var util=require('util');var path=require(_0x64c1('0x5'));var sox=require(_0x64c1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64c1('0x7'));var _=require(_0x64c1('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x64c1('0x9'));var deskjs=require(_0x64c1('0xa'));var toCsv=require(_0x64c1('0xb'));var querystring=require(_0x64c1('0xc'));var Papa=require(_0x64c1('0xd'));var Redis=require(_0x64c1('0xe'));var authService=require(_0x64c1('0xf'));var qs=require(_0x64c1('0x10'));var as=require(_0x64c1('0x11'));var hardwareService=require(_0x64c1('0x12'));var logger=require('../../config/logger')(_0x64c1('0x13'));var utils=require(_0x64c1('0x14'));var config=require(_0x64c1('0x15'));var licenseUtil=require(_0x64c1('0x16'));var db=require(_0x64c1('0x17'))['db'];function respondWithStatusCode(_0x2f0af0,_0x14c1b6){_0x14c1b6=_0x14c1b6||0xcc;return function(_0x11a93e){if(_0x11a93e){return _0x2f0af0[_0x64c1('0x18')](_0x14c1b6);}return _0x2f0af0['status'](_0x14c1b6)[_0x64c1('0x19')]();};}function respondWithResult(_0x54806e,_0x4e1871){_0x4e1871=_0x4e1871||0xc8;return function(_0x4e1ea2){if(_0x4e1ea2){return _0x54806e[_0x64c1('0x1a')](_0x4e1871)['json'](_0x4e1ea2);}};}function respondWithFilteredResult(_0x4374a6,_0x3171ef){return function(_0x2b8e43){if(_0x2b8e43){var _0x1fe733=typeof _0x3171ef[_0x64c1('0x1b')]==='undefined'&&typeof _0x3171ef[_0x64c1('0x1c')]===_0x64c1('0x1d');var _0x2ebc3f=_0x2b8e43[_0x64c1('0x1e')];var _0x314930=_0x1fe733?0x0:_0x3171ef['offset'];var _0x5d2153=_0x1fe733?_0x2b8e43['count']:_0x3171ef[_0x64c1('0x1b')]+_0x3171ef[_0x64c1('0x1c')];var _0x4b458a;if(_0x5d2153>=_0x2ebc3f){_0x5d2153=_0x2ebc3f;_0x4b458a=0xc8;}else{_0x4b458a=0xce;}_0x4374a6[_0x64c1('0x1a')](_0x4b458a);return _0x4374a6[_0x64c1('0x1f')](_0x64c1('0x20'),_0x314930+'-'+_0x5d2153+'/'+_0x2ebc3f)[_0x64c1('0x21')](_0x2b8e43);}return null;};}function patchUpdates(_0x58253e){return function(_0x1de70b){try{jsonpatch[_0x64c1('0x22')](_0x1de70b,_0x58253e,!![]);}catch(_0x2f5a04){return BPromise['reject'](_0x2f5a04);}return _0x1de70b[_0x64c1('0x23')]();};}function saveUpdates(_0x40bb98,_0x589fbb){return function(_0x32bfd5){if(_0x32bfd5){return _0x32bfd5['update'](_0x40bb98)['then'](function(_0xe7db9b){return _0xe7db9b;});}return null;};}function removeEntity(_0xc7c4aa,_0x38b8d5){return function(_0x301fe7){if(_0x301fe7){return _0x301fe7[_0x64c1('0x24')]()['then'](function(){_0xc7c4aa[_0x64c1('0x1a')](0xcc)[_0x64c1('0x19')]();});}};}function handleEntityNotFound(_0x55ce13,_0x4e4ff8){return function(_0x3d6aaa){if(!_0x3d6aaa){_0x55ce13['sendStatus'](0x194);}return _0x3d6aaa;};}function handleError(_0x4e0849,_0x49408b){_0x49408b=_0x49408b||0x1f4;return function(_0x22361f){logger[_0x64c1('0x25')](_0x22361f['stack']);if(_0x22361f[_0x64c1('0x26')]){delete _0x22361f['name'];}_0x4e0849[_0x64c1('0x1a')](_0x49408b)['send'](_0x22361f);};}exports[_0x64c1('0x27')]=function(_0x1b0c45,_0x4a7cc0){var _0x4f8804={},_0x51620e={},_0x5f417e={'count':0x0,'rows':[]};var _0x292d05=_[_0x64c1('0x28')](db[_0x64c1('0x29')][_0x64c1('0x2a')],function(_0x46fbf2){return{'name':_0x46fbf2[_0x64c1('0x2b')],'type':_0x46fbf2[_0x64c1('0x2c')][_0x64c1('0x2d')]};});_0x51620e['model']=_[_0x64c1('0x28')](_0x292d05,_0x64c1('0x26'));_0x51620e[_0x64c1('0x2e')]=_[_0x64c1('0x2f')](_0x1b0c45[_0x64c1('0x2e')]);_0x51620e['filters']=_[_0x64c1('0x30')](_0x51620e[_0x64c1('0x31')],_0x51620e[_0x64c1('0x2e')]);_0x4f8804[_0x64c1('0x32')]=_[_0x64c1('0x30')](_0x51620e[_0x64c1('0x31')],qs['fields'](_0x1b0c45['query']['fields']));_0x4f8804[_0x64c1('0x32')]=_0x4f8804[_0x64c1('0x32')][_0x64c1('0x33')]?_0x4f8804[_0x64c1('0x32')]:_0x51620e[_0x64c1('0x31')];if(!_0x1b0c45[_0x64c1('0x2e')][_0x64c1('0x34')](_0x64c1('0x35'))){_0x4f8804[_0x64c1('0x1c')]=qs[_0x64c1('0x1c')](_0x1b0c45[_0x64c1('0x2e')][_0x64c1('0x1c')]);_0x4f8804[_0x64c1('0x1b')]=qs[_0x64c1('0x1b')](_0x1b0c45['query']['offset']);}_0x4f8804[_0x64c1('0x36')]=qs[_0x64c1('0x37')](_0x1b0c45[_0x64c1('0x2e')]['sort']);_0x4f8804[_0x64c1('0x38')]=qs[_0x64c1('0x39')](_[_0x64c1('0x3a')](_0x1b0c45['query'],_0x51620e['filters']),_0x292d05);if(_0x1b0c45[_0x64c1('0x2e')][_0x64c1('0x3b')]){_0x4f8804[_0x64c1('0x38')]=_['merge'](_0x4f8804['where'],{'$or':_['map'](_0x292d05,function(_0x3a5e72){if(_0x3a5e72[_0x64c1('0x2c')]!==_0x64c1('0x3c')){var _0x209d3e={};_0x209d3e[_0x3a5e72['name']]={'$like':'%'+_0x1b0c45[_0x64c1('0x2e')][_0x64c1('0x3b')]+'%'};return _0x209d3e;}})});}_0x4f8804=_[_0x64c1('0x3d')]({},_0x4f8804,_0x1b0c45[_0x64c1('0x3e')]);var _0x1d7897={'where':_0x4f8804['where']};return db[_0x64c1('0x29')]['count'](_0x1d7897)[_0x64c1('0x3f')](function(_0x25d770){_0x5f417e[_0x64c1('0x1e')]=_0x25d770;if(_0x1b0c45[_0x64c1('0x2e')][_0x64c1('0x40')]){_0x4f8804[_0x64c1('0x41')]=[{'all':!![]}];}return db[_0x64c1('0x29')][_0x64c1('0x42')](_0x4f8804);})[_0x64c1('0x3f')](function(_0x56771a){_0x5f417e[_0x64c1('0x43')]=_0x56771a;return _0x5f417e;})[_0x64c1('0x3f')](respondWithFilteredResult(_0x4a7cc0,_0x4f8804))[_0x64c1('0x44')](handleError(_0x4a7cc0,null));};exports[_0x64c1('0x45')]=function(_0x12e9b9,_0x1adf73){var _0x4d50e7={'raw':!![],'where':{'id':_0x12e9b9['params']['id']}},_0x3729d0={};_0x3729d0[_0x64c1('0x31')]=_[_0x64c1('0x2f')](db['MailSubstatus']['rawAttributes']);_0x3729d0['query']=_['keys'](_0x12e9b9['query']);_0x3729d0['filters']=_['intersection'](_0x3729d0[_0x64c1('0x31')],_0x3729d0[_0x64c1('0x2e')]);_0x4d50e7[_0x64c1('0x32')]=_[_0x64c1('0x30')](_0x3729d0[_0x64c1('0x31')],qs[_0x64c1('0x46')](_0x12e9b9[_0x64c1('0x2e')][_0x64c1('0x46')]));_0x4d50e7['attributes']=_0x4d50e7[_0x64c1('0x32')][_0x64c1('0x33')]?_0x4d50e7[_0x64c1('0x32')]:_0x3729d0[_0x64c1('0x31')];if(_0x12e9b9[_0x64c1('0x2e')][_0x64c1('0x40')]){_0x4d50e7['include']=[{'all':!![]}];}_0x4d50e7=_[_0x64c1('0x3d')]({},_0x4d50e7,_0x12e9b9[_0x64c1('0x3e')]);return db[_0x64c1('0x29')][_0x64c1('0x47')](_0x4d50e7)[_0x64c1('0x3f')](handleEntityNotFound(_0x1adf73,null))[_0x64c1('0x3f')](respondWithResult(_0x1adf73,null))[_0x64c1('0x44')](handleError(_0x1adf73,null));};exports['create']=function(_0x307a41,_0xf776b9){return db[_0x64c1('0x29')][_0x64c1('0x48')](_0x307a41[_0x64c1('0x49')],{})[_0x64c1('0x3f')](respondWithResult(_0xf776b9,0xc9))[_0x64c1('0x44')](handleError(_0xf776b9,null));};exports[_0x64c1('0x4a')]=function(_0x2e7918,_0x5be09c){if(_0x2e7918[_0x64c1('0x49')]['id']){delete _0x2e7918[_0x64c1('0x49')]['id'];}return db[_0x64c1('0x29')][_0x64c1('0x47')]({'where':{'id':_0x2e7918[_0x64c1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5be09c,null))[_0x64c1('0x3f')](saveUpdates(_0x2e7918[_0x64c1('0x49')],null))[_0x64c1('0x3f')](respondWithResult(_0x5be09c,null))[_0x64c1('0x44')](handleError(_0x5be09c,null));};exports[_0x64c1('0x24')]=function(_0x4b6381,_0x2d3e3a){return db[_0x64c1('0x29')][_0x64c1('0x47')]({'where':{'id':_0x4b6381['params']['id']}})[_0x64c1('0x3f')](handleEntityNotFound(_0x2d3e3a,null))[_0x64c1('0x3f')](removeEntity(_0x2d3e3a,null))[_0x64c1('0x44')](handleError(_0x2d3e3a,null));};exports[_0x64c1('0x4c')]=function(_0xd183ba,_0x3b1f14){return db[_0x64c1('0x29')][_0x64c1('0x4c')]()[_0x64c1('0x3f')](respondWithResult(_0x3b1f14,null))[_0x64c1('0x44')](handleError(_0x3b1f14,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b1fffbf..d2f70a9 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 _0x01a0=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2fbe52,_0x2a0921){var _0x3bb8fe=function(_0xcf2b30){while(--_0xcf2b30){_0x2fbe52['push'](_0x2fbe52['shift']());}};_0x3bb8fe(++_0x2a0921);}(_0x01a0,0x195));var _0x001a=function(_0x3a177b,_0x10d9fe){_0x3a177b=_0x3a177b-0x0;var _0x205959=_0x01a0[_0x3a177b];return _0x205959;};'use strict';var EventEmitter=require(_0x001a('0x0'));var MailSubstatus=require(_0x001a('0x1'))['db'][_0x001a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x001a('0x3')](0x0);var events={'afterUpdate':_0x001a('0x4')};function emitEvent(_0x53836a){return function(_0x50550a,_0x5f3782,_0xfd97dc){MailSubstatusEvents['emit'](_0x53836a+':'+_0x50550a['id'],_0x50550a);MailSubstatusEvents[_0x001a('0x5')](_0x53836a,_0x50550a);_0xfd97dc(null);};}for(var e in events){if(events[_0x001a('0x6')](e)){var event=events[e];MailSubstatus[_0x001a('0x7')](e,emitEvent(event));}}module[_0x001a('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x360d=['events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','exports'];(function(_0x26861b,_0x1aa482){var _0x70027c=function(_0x449341){while(--_0x449341){_0x26861b['push'](_0x26861b['shift']());}};_0x70027c(++_0x1aa482);}(_0x360d,0xc0));var _0xd360=function(_0x65959d,_0x4dd888){_0x65959d=_0x65959d-0x0;var _0x2d71aa=_0x360d[_0x65959d];return _0x2d71aa;};'use strict';var EventEmitter=require(_0xd360('0x0'));var MailSubstatus=require(_0xd360('0x1'))['db'][_0xd360('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xd360('0x3')};function emitEvent(_0x44d4c2){return function(_0x3f8692,_0x31dbc8,_0x10c28b){MailSubstatusEvents[_0xd360('0x4')](_0x44d4c2+':'+_0x3f8692['id'],_0x3f8692);MailSubstatusEvents[_0xd360('0x4')](_0x44d4c2,_0x3f8692);_0x10c28b(null);};}for(var e in events){if(events[_0xd360('0x5')](e)){var event=events[e];MailSubstatus[_0xd360('0x6')](e,emitEvent(event));}}module[_0xd360('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9018e71..de98478 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 _0x0a0c=['name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update'];(function(_0x417605,_0x4752b0){var _0x2f6c62=function(_0x495d97){while(--_0x495d97){_0x417605['push'](_0x417605['shift']());}};_0x2f6c62(++_0x4752b0);}(_0x0a0c,0x19b));var _0xc0a0=function(_0x1275d6,_0x3d30f1){_0x1275d6=_0x1275d6-0x0;var _0x34c1b4=_0x0a0c[_0x1275d6];return _0x34c1b4;};'use strict';var attributes=require(_0xc0a0('0x0'));module[_0xc0a0('0x1')]=function(_0x2fac61){var _0xacc2f4=_0x2fac61[_0xc0a0('0x2')];return _0x2fac61[_0xc0a0('0x3')]('MailSubstatus',attributes,{'tableName':_0xc0a0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3f5c8a,_0x18643d,_0x10962f){return _0xacc2f4[_0xc0a0('0x5')][_0xc0a0('0x6')]({'value':_0x3f5c8a[_0xc0a0('0x7')]},{'where':{'field':'mailSubstatus','value':_0x3f5c8a[_0xc0a0('0x8')][_0xc0a0('0x7')]}})[_0xc0a0('0x9')](function(){_0x10962f();})[_0xc0a0('0xa')](function(_0x58f236){_0x10962f(_0x58f236);});}}});}; \ No newline at end of file +var _0x3a50=['MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','catch','./mailSubstatus.attributes','models'];(function(_0x93cd94,_0x21a1d9){var _0x5096f6=function(_0x45e81c){while(--_0x45e81c){_0x93cd94['push'](_0x93cd94['shift']());}};_0x5096f6(++_0x21a1d9);}(_0x3a50,0xcd));var _0x03a5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3a50[_0x4a9fb1];return _0x348672;};'use strict';var attributes=require(_0x03a5('0x0'));module['exports']=function(_0x5514af){var _0x12ab07=_0x5514af[_0x03a5('0x1')];return _0x5514af['define'](_0x03a5('0x2'),attributes,{'tableName':_0x03a5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x30a5fc,_0x3983bd,_0x190c1a){return _0x12ab07[_0x03a5('0x4')][_0x03a5('0x5')]({'value':_0x30a5fc[_0x03a5('0x6')]},{'where':{'field':'mailSubstatus','value':_0x30a5fc[_0x03a5('0x7')][_0x03a5('0x6')]}})['then'](function(){_0x190c1a();})[_0x03a5('0x8')](function(_0x3bd324){_0x190c1a(_0x3bd324);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index edb2654..2adf8f6 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 _0xcd8e=['request','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3e9942,_0x12e0e6){var _0x2f7e3f=function(_0x512089){while(--_0x512089){_0x3e9942['push'](_0x3e9942['shift']());}};_0x2f7e3f(++_0x12e0e6);}(_0xcd8e,0xa9));var _0xecd8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcd8e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xecd8('0x0'));var util=require('util');var moment=require(_0xecd8('0x1'));var BPromise=require(_0xecd8('0x2'));var rs=require(_0xecd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xecd8('0x4'));var logger=require(_0xecd8('0x5'))(_0xecd8('0x6'));var config=require(_0xecd8('0x7'));var jayson=require(_0xecd8('0x8'));var client=jayson[_0xecd8('0x9')][_0xecd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ec2c,_0x4038cf,_0x2dacee){return new BPromise(function(_0x426fff,_0x9a6c5a){return client[_0xecd8('0xb')](_0x13ec2c,_0x2dacee)['then'](function(_0x586992){logger['info'](_0xecd8('0xc'),_0x4038cf,_0xecd8('0xd'));logger['debug'](_0xecd8('0xe'),_0x4038cf,_0xecd8('0xd'),JSON['stringify'](_0x586992));if(_0x586992[_0xecd8('0xf')]){if(_0x586992['error']['code']===0x1f4){logger[_0xecd8('0xf')](_0xecd8('0xc'),_0x4038cf,_0x586992[_0xecd8('0xf')]['message']);return _0x9a6c5a(_0x586992[_0xecd8('0xf')][_0xecd8('0x10')]);}logger['error'](_0xecd8('0xc'),_0x4038cf,_0x586992[_0xecd8('0xf')][_0xecd8('0x10')]);return _0x426fff(_0x586992['error'][_0xecd8('0x10')]);}else{logger[_0xecd8('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4038cf,_0xecd8('0xd'));_0x426fff(_0x586992[_0xecd8('0x12')][_0xecd8('0x10')]);}})[_0xecd8('0x13')](function(_0x135712){logger[_0xecd8('0xf')](_0xecd8('0xc'),_0x4038cf,_0x135712);_0x9a6c5a(_0x135712);});});} \ No newline at end of file +var _0xcef4=['http','then','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcef4,0x7d));var _0x4cef=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xcef4[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x4cef('0x0'));var util=require('util');var moment=require(_0x4cef('0x1'));var BPromise=require('bluebird');var rs=require(_0x4cef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4cef('0x3'));var logger=require(_0x4cef('0x4'))('rpc');var config=require(_0x4cef('0x5'));var jayson=require(_0x4cef('0x6'));var client=jayson[_0x4cef('0x7')][_0x4cef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fe89d,_0x5e05e2,_0x383047){return new BPromise(function(_0x184186,_0x5e76f3){return client['request'](_0x3fe89d,_0x383047)[_0x4cef('0x9')](function(_0x23ffca){logger['info'](_0x4cef('0xa'),_0x5e05e2,'request\x20sent');logger[_0x4cef('0xb')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5e05e2,_0x4cef('0xc'),JSON[_0x4cef('0xd')](_0x23ffca));if(_0x23ffca[_0x4cef('0xe')]){if(_0x23ffca['error'][_0x4cef('0xf')]===0x1f4){logger[_0x4cef('0xe')](_0x4cef('0xa'),_0x5e05e2,_0x23ffca[_0x4cef('0xe')][_0x4cef('0x10')]);return _0x5e76f3(_0x23ffca[_0x4cef('0xe')][_0x4cef('0x10')]);}logger[_0x4cef('0xe')](_0x4cef('0xa'),_0x5e05e2,_0x23ffca[_0x4cef('0xe')]['message']);return _0x184186(_0x23ffca['error'][_0x4cef('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5e05e2,_0x4cef('0xc'));_0x184186(_0x23ffca[_0x4cef('0x11')][_0x4cef('0x10')]);}})[_0x4cef('0x12')](function(_0x59852e){logger['error'](_0x4cef('0xa'),_0x5e05e2,_0x59852e);_0x5e76f3(_0x59852e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b4232bd..5f1dabf 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 _0x2ee8=['/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x33c8c7,_0x35103c){var _0x3bc0b2=function(_0x4f828a){while(--_0x4f828a){_0x33c8c7['push'](_0x33c8c7['shift']());}};_0x3bc0b2(++_0x35103c);}(_0x2ee8,0x126));var _0x82ee=function(_0xa7f9b5,_0xfd46ac){_0xa7f9b5=_0xa7f9b5-0x0;var _0x599723=_0x2ee8[_0xa7f9b5];return _0x599723;};'use strict';var multer=require(_0x82ee('0x0'));var util=require('util');var path=require(_0x82ee('0x1'));var timeout=require(_0x82ee('0x2'));var express=require(_0x82ee('0x3'));var router=express[_0x82ee('0x4')]();var fs_extra=require(_0x82ee('0x5'));var auth=require(_0x82ee('0x6'));var interaction=require(_0x82ee('0x7'));var config=require(_0x82ee('0x8'));var controller=require(_0x82ee('0x9'));router[_0x82ee('0xa')]('/',auth[_0x82ee('0xb')](),controller['index']);router['get'](_0x82ee('0xc'),auth['isAuthenticated'](),controller[_0x82ee('0xd')]);router[_0x82ee('0xa')](_0x82ee('0xe'),auth[_0x82ee('0xb')](),controller['show']);router[_0x82ee('0xf')]('/',auth[_0x82ee('0xb')](),controller[_0x82ee('0x10')]);router[_0x82ee('0x11')](_0x82ee('0xe'),auth[_0x82ee('0xb')](),controller[_0x82ee('0x12')]);router[_0x82ee('0x13')](_0x82ee('0xe'),auth[_0x82ee('0xb')](),controller[_0x82ee('0x14')]);module[_0x82ee('0x15')]=router; \ No newline at end of file +var _0xb6fc=['delete','destroy','exports','connect-timeout','express','fs-extra','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0xb6fc,0x1c3));var _0xcb6f=function(_0xd61ec0,_0x15e726){_0xd61ec0=_0xd61ec0-0x0;var _0x8d9e1e=_0xb6fc[_0xd61ec0];return _0x8d9e1e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcb6f('0x0'));var express=require(_0xcb6f('0x1'));var router=express['Router']();var fs_extra=require(_0xcb6f('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb6f('0x3'));var controller=require(_0xcb6f('0x4'));router[_0xcb6f('0x5')]('/',auth[_0xcb6f('0x6')](),controller['index']);router[_0xcb6f('0x5')](_0xcb6f('0x7'),auth[_0xcb6f('0x6')](),controller[_0xcb6f('0x8')]);router['get'](_0xcb6f('0x9'),auth[_0xcb6f('0x6')](),controller[_0xcb6f('0xa')]);router[_0xcb6f('0xb')]('/',auth[_0xcb6f('0x6')](),controller[_0xcb6f('0xc')]);router['put'](_0xcb6f('0x9'),auth[_0xcb6f('0x6')](),controller['update']);router[_0xcb6f('0xd')]('/:id',auth[_0xcb6f('0x6')](),controller[_0xcb6f('0xe')]);module[_0xcb6f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index c719fa7..331b985 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x9bde,0xe1));var _0xe9bd=function(_0x6b9c99,_0x2399ea){_0x6b9c99=_0x6b9c99-0x0;var _0x48464d=_0x9bde[_0x6b9c99];return _0x48464d;};'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 +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5e2b7b,_0x420e59){_0x5e2b7b=_0x5e2b7b-0x0;var _0x39af67=_0xb43b[_0x5e2b7b];return _0x39af67;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 1310b88..1a3da7a 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 _0xba2b=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x4d17ac,_0x25fa6f){var _0x24e8a5=function(_0x126cef){while(--_0x126cef){_0x4d17ac['push'](_0x4d17ac['shift']());}};_0x24e8a5(++_0x25fa6f);}(_0xba2b,0x7f));var _0xbba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba2b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbba2('0x0'));var rimraf=require(_0xbba2('0x1'));var zipdir=require(_0xbba2('0x2'));var jsonpatch=require(_0xbba2('0x3'));var rp=require(_0xbba2('0x4'));var moment=require(_0xbba2('0x5'));var BPromise=require(_0xbba2('0x6'));var Mustache=require(_0xbba2('0x7'));var util=require(_0xbba2('0x8'));var path=require(_0xbba2('0x9'));var sox=require(_0xbba2('0xa'));var csv=require(_0xbba2('0xb'));var ejs=require(_0xbba2('0xc'));var fs=require('fs');var fs_extra=require(_0xbba2('0xd'));var _=require(_0xbba2('0xe'));var squel=require(_0xbba2('0xf'));var crypto=require(_0xbba2('0x10'));var jsforce=require(_0xbba2('0x11'));var deskjs=require(_0xbba2('0x12'));var toCsv=require(_0xbba2('0xb'));var querystring=require(_0xbba2('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbba2('0x14'));var qs=require(_0xbba2('0x15'));var as=require(_0xbba2('0x16'));var hardwareService=require(_0xbba2('0x17'));var logger=require('../../config/logger')(_0xbba2('0x18'));var utils=require(_0xbba2('0x19'));var config=require(_0xbba2('0x1a'));var licenseUtil=require(_0xbba2('0x1b'));var db=require(_0xbba2('0x1c'))['db'];function respondWithStatusCode(_0x213f1f,_0x80764d){_0x80764d=_0x80764d||0xcc;return function(_0x14cb6a){if(_0x14cb6a){return _0x213f1f['sendStatus'](_0x80764d);}return _0x213f1f[_0xbba2('0x1d')](_0x80764d)[_0xbba2('0x1e')]();};}function respondWithResult(_0x4b62f6,_0x436c82){_0x436c82=_0x436c82||0xc8;return function(_0x2c89bb){if(_0x2c89bb){return _0x4b62f6[_0xbba2('0x1d')](_0x436c82)[_0xbba2('0x1f')](_0x2c89bb);}};}function respondWithFilteredResult(_0x56fb7c,_0x2bde3c){return function(_0x5eee8e){if(_0x5eee8e){var _0x1bf914=typeof _0x2bde3c[_0xbba2('0x20')]===_0xbba2('0x21')&&typeof _0x2bde3c['limit']===_0xbba2('0x21');var _0x8e1bca=_0x5eee8e[_0xbba2('0x22')];var _0x2dc126=_0x1bf914?0x0:_0x2bde3c[_0xbba2('0x20')];var _0x5233ee=_0x1bf914?_0x5eee8e[_0xbba2('0x22')]:_0x2bde3c[_0xbba2('0x20')]+_0x2bde3c[_0xbba2('0x23')];var _0x16f499;if(_0x5233ee>=_0x8e1bca){_0x5233ee=_0x8e1bca;_0x16f499=0xc8;}else{_0x16f499=0xce;}_0x56fb7c[_0xbba2('0x1d')](_0x16f499);return _0x56fb7c['set']('Content-Range',_0x2dc126+'-'+_0x5233ee+'/'+_0x8e1bca)[_0xbba2('0x1f')](_0x5eee8e);}return null;};}function patchUpdates(_0x41aa59){return function(_0x30bd0d){try{jsonpatch[_0xbba2('0x24')](_0x30bd0d,_0x41aa59,!![]);}catch(_0x2b72e3){return BPromise[_0xbba2('0x25')](_0x2b72e3);}return _0x30bd0d[_0xbba2('0x26')]();};}function saveUpdates(_0x550f74,_0x531740){return function(_0xebb16c){if(_0xebb16c){return _0xebb16c[_0xbba2('0x27')](_0x550f74)[_0xbba2('0x28')](function(_0x12bf39){return _0x12bf39;});}return null;};}function removeEntity(_0x3938ee,_0x50e249){return function(_0x53678f){if(_0x53678f){return _0x53678f[_0xbba2('0x29')]()[_0xbba2('0x28')](function(){_0x3938ee[_0xbba2('0x1d')](0xcc)[_0xbba2('0x1e')]();});}};}function handleEntityNotFound(_0x4b1be2,_0xe570e0){return function(_0x5c7135){if(!_0x5c7135){_0x4b1be2['sendStatus'](0x194);}return _0x5c7135;};}function handleError(_0x4c2c1f,_0x3c89e1){_0x3c89e1=_0x3c89e1||0x1f4;return function(_0x5cb498){logger[_0xbba2('0x2a')](_0x5cb498[_0xbba2('0x2b')]);if(_0x5cb498[_0xbba2('0x2c')]){delete _0x5cb498[_0xbba2('0x2c')];}_0x4c2c1f['status'](_0x3c89e1)[_0xbba2('0x2d')](_0x5cb498);};}exports[_0xbba2('0x2e')]=function(_0x445d86,_0x34f9c2){var _0x57bc66={},_0x6d6710={},_0x342a7b={'count':0x0,'rows':[]};var _0x4e8da1=_['map'](db[_0xbba2('0x2f')][_0xbba2('0x30')],function(_0x195985){return{'name':_0x195985['fieldName'],'type':_0x195985[_0xbba2('0x31')][_0xbba2('0x32')]};});_0x6d6710[_0xbba2('0x33')]=_[_0xbba2('0x34')](_0x4e8da1,_0xbba2('0x2c'));_0x6d6710['query']=_[_0xbba2('0x35')](_0x445d86[_0xbba2('0x36')]);_0x6d6710[_0xbba2('0x37')]=_['intersection'](_0x6d6710['model'],_0x6d6710[_0xbba2('0x36')]);_0x57bc66[_0xbba2('0x38')]=_[_0xbba2('0x39')](_0x6d6710[_0xbba2('0x33')],qs[_0xbba2('0x3a')](_0x445d86['query']['fields']));_0x57bc66[_0xbba2('0x38')]=_0x57bc66[_0xbba2('0x38')][_0xbba2('0x3b')]?_0x57bc66[_0xbba2('0x38')]:_0x6d6710[_0xbba2('0x33')];if(!_0x445d86[_0xbba2('0x36')]['hasOwnProperty']('nolimit')){_0x57bc66['limit']=qs[_0xbba2('0x23')](_0x445d86[_0xbba2('0x36')][_0xbba2('0x23')]);_0x57bc66[_0xbba2('0x20')]=qs[_0xbba2('0x20')](_0x445d86[_0xbba2('0x36')][_0xbba2('0x20')]);}_0x57bc66[_0xbba2('0x3c')]=qs[_0xbba2('0x3d')](_0x445d86[_0xbba2('0x36')]['sort']);_0x57bc66[_0xbba2('0x3e')]=qs[_0xbba2('0x37')](_[_0xbba2('0x3f')](_0x445d86[_0xbba2('0x36')],_0x6d6710['filters']),_0x4e8da1);if(_0x445d86[_0xbba2('0x36')][_0xbba2('0x40')]){_0x57bc66['where']=_[_0xbba2('0x41')](_0x57bc66[_0xbba2('0x3e')],{'$or':_['map'](_0x4e8da1,function(_0x3bc1da){if(_0x3bc1da[_0xbba2('0x31')]!==_0xbba2('0x42')){var _0x1d8a54={};_0x1d8a54[_0x3bc1da[_0xbba2('0x2c')]]={'$like':'%'+_0x445d86['query'][_0xbba2('0x40')]+'%'};return _0x1d8a54;}})});}_0x57bc66=_[_0xbba2('0x41')]({},_0x57bc66,_0x445d86['options']);var _0x264a32={'where':_0x57bc66['where']};return db[_0xbba2('0x2f')][_0xbba2('0x22')](_0x264a32)[_0xbba2('0x28')](function(_0x51e657){_0x342a7b[_0xbba2('0x22')]=_0x51e657;if(_0x445d86['query']['includeAll']){_0x57bc66[_0xbba2('0x43')]=[{'all':!![]}];}return db['MailTransferReport'][_0xbba2('0x44')](_0x57bc66);})[_0xbba2('0x28')](function(_0x35cfa9){_0x342a7b[_0xbba2('0x45')]=_0x35cfa9;return _0x342a7b;})[_0xbba2('0x28')](respondWithFilteredResult(_0x34f9c2,_0x57bc66))[_0xbba2('0x46')](handleError(_0x34f9c2,null));};exports['show']=function(_0x165316,_0x92f551){var _0x2341b8={'raw':!![],'where':{'id':_0x165316['params']['id']}},_0x2aa906={};_0x2aa906['model']=_['keys'](db[_0xbba2('0x2f')][_0xbba2('0x30')]);_0x2aa906[_0xbba2('0x36')]=_[_0xbba2('0x35')](_0x165316[_0xbba2('0x36')]);_0x2aa906[_0xbba2('0x37')]=_[_0xbba2('0x39')](_0x2aa906[_0xbba2('0x33')],_0x2aa906[_0xbba2('0x36')]);_0x2341b8[_0xbba2('0x38')]=_['intersection'](_0x2aa906['model'],qs[_0xbba2('0x3a')](_0x165316[_0xbba2('0x36')][_0xbba2('0x3a')]));_0x2341b8['attributes']=_0x2341b8[_0xbba2('0x38')][_0xbba2('0x3b')]?_0x2341b8[_0xbba2('0x38')]:_0x2aa906[_0xbba2('0x33')];if(_0x165316[_0xbba2('0x36')][_0xbba2('0x47')]){_0x2341b8[_0xbba2('0x43')]=[{'all':!![]}];}_0x2341b8=_['merge']({},_0x2341b8,_0x165316[_0xbba2('0x48')]);return db[_0xbba2('0x2f')][_0xbba2('0x49')](_0x2341b8)['then'](handleEntityNotFound(_0x92f551,null))[_0xbba2('0x28')](respondWithResult(_0x92f551,null))['catch'](handleError(_0x92f551,null));};exports[_0xbba2('0x4a')]=function(_0x5a0ec5,_0x531a3f){return db[_0xbba2('0x2f')][_0xbba2('0x4a')](_0x5a0ec5[_0xbba2('0x4b')],{})[_0xbba2('0x28')](respondWithResult(_0x531a3f,0xc9))['catch'](handleError(_0x531a3f,null));};exports[_0xbba2('0x27')]=function(_0x4d6d72,_0x26e131){if(_0x4d6d72[_0xbba2('0x4b')]['id']){delete _0x4d6d72[_0xbba2('0x4b')]['id'];}return db[_0xbba2('0x2f')]['find']({'where':{'id':_0x4d6d72['params']['id']}})[_0xbba2('0x28')](handleEntityNotFound(_0x26e131,null))['then'](saveUpdates(_0x4d6d72[_0xbba2('0x4b')],null))['then'](respondWithResult(_0x26e131,null))[_0xbba2('0x46')](handleError(_0x26e131,null));};exports[_0xbba2('0x29')]=function(_0x3387a1,_0x28fb71){return db[_0xbba2('0x2f')][_0xbba2('0x49')]({'where':{'id':_0x3387a1['params']['id']}})[_0xbba2('0x28')](handleEntityNotFound(_0x28fb71,null))['then'](removeEntity(_0x28fb71,null))['catch'](handleError(_0x28fb71,null));};exports[_0xbba2('0x4c')]=function(_0x325de2,_0x46b010){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x46b010,null))['catch'](handleError(_0x46b010,null));}; \ No newline at end of file +var _0x8e73=['sox','to-csv','lodash','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','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','name','send','map','MailTransferReport','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x188907,_0x1afb5d){var _0x39c928=function(_0x3d211c){while(--_0x3d211c){_0x188907['push'](_0x188907['shift']());}};_0x39c928(++_0x1afb5d);}(_0x8e73,0x120));var _0x38e7=function(_0xd231ea,_0x26d119){_0xd231ea=_0xd231ea-0x0;var _0x507a1d=_0x8e73[_0xd231ea];return _0x507a1d;};'use strict';var emlformat=require(_0x38e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38e7('0x1'));var jsonpatch=require(_0x38e7('0x2'));var rp=require(_0x38e7('0x3'));var moment=require(_0x38e7('0x4'));var BPromise=require(_0x38e7('0x5'));var Mustache=require(_0x38e7('0x6'));var util=require(_0x38e7('0x7'));var path=require('path');var sox=require(_0x38e7('0x8'));var csv=require(_0x38e7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38e7('0xa'));var squel=require('squel');var crypto=require(_0x38e7('0xb'));var jsforce=require(_0x38e7('0xc'));var deskjs=require(_0x38e7('0xd'));var toCsv=require(_0x38e7('0x9'));var querystring=require(_0x38e7('0xe'));var Papa=require('papaparse');var Redis=require(_0x38e7('0xf'));var authService=require(_0x38e7('0x10'));var qs=require(_0x38e7('0x11'));var as=require(_0x38e7('0x12'));var hardwareService=require(_0x38e7('0x13'));var logger=require(_0x38e7('0x14'))(_0x38e7('0x15'));var utils=require(_0x38e7('0x16'));var config=require(_0x38e7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x38e7('0x18'))['db'];function respondWithStatusCode(_0x37db7d,_0x1ee1e5){_0x1ee1e5=_0x1ee1e5||0xcc;return function(_0x541976){if(_0x541976){return _0x37db7d['sendStatus'](_0x1ee1e5);}return _0x37db7d[_0x38e7('0x19')](_0x1ee1e5)[_0x38e7('0x1a')]();};}function respondWithResult(_0x48c2f0,_0x8a986d){_0x8a986d=_0x8a986d||0xc8;return function(_0x5dabf7){if(_0x5dabf7){return _0x48c2f0['status'](_0x8a986d)['json'](_0x5dabf7);}};}function respondWithFilteredResult(_0x9983b4,_0x39077e){return function(_0x34fd75){if(_0x34fd75){var _0x5153f7=typeof _0x39077e[_0x38e7('0x1b')]===_0x38e7('0x1c')&&typeof _0x39077e['limit']===_0x38e7('0x1c');var _0x45e60a=_0x34fd75[_0x38e7('0x1d')];var _0x3f7ca0=_0x5153f7?0x0:_0x39077e[_0x38e7('0x1b')];var _0x1dd9df=_0x5153f7?_0x34fd75[_0x38e7('0x1d')]:_0x39077e[_0x38e7('0x1b')]+_0x39077e[_0x38e7('0x1e')];var _0x4e53fa;if(_0x1dd9df>=_0x45e60a){_0x1dd9df=_0x45e60a;_0x4e53fa=0xc8;}else{_0x4e53fa=0xce;}_0x9983b4[_0x38e7('0x19')](_0x4e53fa);return _0x9983b4['set'](_0x38e7('0x1f'),_0x3f7ca0+'-'+_0x1dd9df+'/'+_0x45e60a)[_0x38e7('0x20')](_0x34fd75);}return null;};}function patchUpdates(_0x4a1e3c){return function(_0x24b20c){try{jsonpatch[_0x38e7('0x21')](_0x24b20c,_0x4a1e3c,!![]);}catch(_0x14815c){return BPromise['reject'](_0x14815c);}return _0x24b20c[_0x38e7('0x22')]();};}function saveUpdates(_0x1ab4f5,_0x4e3394){return function(_0x337562){if(_0x337562){return _0x337562[_0x38e7('0x23')](_0x1ab4f5)['then'](function(_0x51b63a){return _0x51b63a;});}return null;};}function removeEntity(_0x17c600,_0x236e0a){return function(_0x4ba855){if(_0x4ba855){return _0x4ba855['destroy']()[_0x38e7('0x24')](function(){_0x17c600['status'](0xcc)[_0x38e7('0x1a')]();});}};}function handleEntityNotFound(_0x163923,_0x35ad43){return function(_0x8ee384){if(!_0x8ee384){_0x163923['sendStatus'](0x194);}return _0x8ee384;};}function handleError(_0x480f6c,_0xb38cd6){_0xb38cd6=_0xb38cd6||0x1f4;return function(_0x5d77c9){logger['error'](_0x5d77c9['stack']);if(_0x5d77c9[_0x38e7('0x25')]){delete _0x5d77c9[_0x38e7('0x25')];}_0x480f6c[_0x38e7('0x19')](_0xb38cd6)[_0x38e7('0x26')](_0x5d77c9);};}exports['index']=function(_0x1ad467,_0x37bae3){var _0x58cbb3={},_0x50e2c3={},_0x3d215e={'count':0x0,'rows':[]};var _0x34f0d1=_[_0x38e7('0x27')](db[_0x38e7('0x28')]['rawAttributes'],function(_0x328076){return{'name':_0x328076['fieldName'],'type':_0x328076[_0x38e7('0x29')][_0x38e7('0x2a')]};});_0x50e2c3[_0x38e7('0x2b')]=_[_0x38e7('0x27')](_0x34f0d1,'name');_0x50e2c3[_0x38e7('0x2c')]=_['keys'](_0x1ad467['query']);_0x50e2c3[_0x38e7('0x2d')]=_['intersection'](_0x50e2c3[_0x38e7('0x2b')],_0x50e2c3['query']);_0x58cbb3['attributes']=_[_0x38e7('0x2e')](_0x50e2c3['model'],qs[_0x38e7('0x2f')](_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x2f')]));_0x58cbb3[_0x38e7('0x30')]=_0x58cbb3['attributes']['length']?_0x58cbb3['attributes']:_0x50e2c3['model'];if(!_0x1ad467['query'][_0x38e7('0x31')](_0x38e7('0x32'))){_0x58cbb3[_0x38e7('0x1e')]=qs[_0x38e7('0x1e')](_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x1e')]);_0x58cbb3[_0x38e7('0x1b')]=qs['offset'](_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x1b')]);}_0x58cbb3[_0x38e7('0x33')]=qs[_0x38e7('0x34')](_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x34')]);_0x58cbb3['where']=qs[_0x38e7('0x2d')](_[_0x38e7('0x35')](_0x1ad467[_0x38e7('0x2c')],_0x50e2c3[_0x38e7('0x2d')]),_0x34f0d1);if(_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x36')]){_0x58cbb3[_0x38e7('0x37')]=_[_0x38e7('0x38')](_0x58cbb3[_0x38e7('0x37')],{'$or':_[_0x38e7('0x27')](_0x34f0d1,function(_0x32c2a9){if(_0x32c2a9['type']!==_0x38e7('0x39')){var _0x5840d0={};_0x5840d0[_0x32c2a9['name']]={'$like':'%'+_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x36')]+'%'};return _0x5840d0;}})});}_0x58cbb3=_[_0x38e7('0x38')]({},_0x58cbb3,_0x1ad467[_0x38e7('0x3a')]);var _0x42e377={'where':_0x58cbb3[_0x38e7('0x37')]};return db['MailTransferReport']['count'](_0x42e377)[_0x38e7('0x24')](function(_0x219955){_0x3d215e[_0x38e7('0x1d')]=_0x219955;if(_0x1ad467[_0x38e7('0x2c')][_0x38e7('0x3b')]){_0x58cbb3[_0x38e7('0x3c')]=[{'all':!![]}];}return db[_0x38e7('0x28')][_0x38e7('0x3d')](_0x58cbb3);})['then'](function(_0x219aec){_0x3d215e[_0x38e7('0x3e')]=_0x219aec;return _0x3d215e;})[_0x38e7('0x24')](respondWithFilteredResult(_0x37bae3,_0x58cbb3))[_0x38e7('0x3f')](handleError(_0x37bae3,null));};exports[_0x38e7('0x40')]=function(_0x44c712,_0x5535f4){var _0x519bd2={'raw':!![],'where':{'id':_0x44c712['params']['id']}},_0x364c1b={};_0x364c1b['model']=_[_0x38e7('0x41')](db[_0x38e7('0x28')][_0x38e7('0x42')]);_0x364c1b[_0x38e7('0x2c')]=_[_0x38e7('0x41')](_0x44c712['query']);_0x364c1b[_0x38e7('0x2d')]=_[_0x38e7('0x2e')](_0x364c1b[_0x38e7('0x2b')],_0x364c1b[_0x38e7('0x2c')]);_0x519bd2[_0x38e7('0x30')]=_[_0x38e7('0x2e')](_0x364c1b[_0x38e7('0x2b')],qs[_0x38e7('0x2f')](_0x44c712[_0x38e7('0x2c')][_0x38e7('0x2f')]));_0x519bd2[_0x38e7('0x30')]=_0x519bd2[_0x38e7('0x30')][_0x38e7('0x43')]?_0x519bd2[_0x38e7('0x30')]:_0x364c1b[_0x38e7('0x2b')];if(_0x44c712[_0x38e7('0x2c')][_0x38e7('0x3b')]){_0x519bd2[_0x38e7('0x3c')]=[{'all':!![]}];}_0x519bd2=_[_0x38e7('0x38')]({},_0x519bd2,_0x44c712['options']);return db[_0x38e7('0x28')][_0x38e7('0x44')](_0x519bd2)[_0x38e7('0x24')](handleEntityNotFound(_0x5535f4,null))[_0x38e7('0x24')](respondWithResult(_0x5535f4,null))['catch'](handleError(_0x5535f4,null));};exports[_0x38e7('0x45')]=function(_0x4f388d,_0x500ccc){return db['MailTransferReport'][_0x38e7('0x45')](_0x4f388d['body'],{})['then'](respondWithResult(_0x500ccc,0xc9))[_0x38e7('0x3f')](handleError(_0x500ccc,null));};exports[_0x38e7('0x23')]=function(_0x3f66da,_0x2a7239){if(_0x3f66da[_0x38e7('0x46')]['id']){delete _0x3f66da[_0x38e7('0x46')]['id'];}return db['MailTransferReport'][_0x38e7('0x44')]({'where':{'id':_0x3f66da[_0x38e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a7239,null))[_0x38e7('0x24')](saveUpdates(_0x3f66da[_0x38e7('0x46')],null))[_0x38e7('0x24')](respondWithResult(_0x2a7239,null))['catch'](handleError(_0x2a7239,null));};exports[_0x38e7('0x48')]=function(_0x39b024,_0x545f82){return db[_0x38e7('0x28')]['find']({'where':{'id':_0x39b024['params']['id']}})[_0x38e7('0x24')](handleEntityNotFound(_0x545f82,null))['then'](removeEntity(_0x545f82,null))[_0x38e7('0x3f')](handleError(_0x545f82,null));};exports[_0x38e7('0x49')]=function(_0x25cb98,_0x538cad){return db[_0x38e7('0x28')][_0x38e7('0x49')]()[_0x38e7('0x24')](respondWithResult(_0x538cad,null))[_0x38e7('0x3f')](handleError(_0x538cad,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index d3b0282..56d139d 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 _0xdd50=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','MailTransferReport','uniqueid'];(function(_0x377bb5,_0x1acb05){var _0x4fd548=function(_0x2fbb07){while(--_0x2fbb07){_0x377bb5['push'](_0x377bb5['shift']());}};_0x4fd548(++_0x1acb05);}(_0xdd50,0x172));var _0x0dd5=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0xdd50[_0x336376];return _0x1d2a8e;};'use strict';var _=require('lodash');var util=require(_0x0dd5('0x0'));var logger=require(_0x0dd5('0x1'))(_0x0dd5('0x2'));var moment=require(_0x0dd5('0x3'));var BPromise=require(_0x0dd5('0x4'));var rp=require(_0x0dd5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module[_0x0dd5('0x6')]=function(_0x4f6b13,_0x9471f5){return _0x4f6b13[_0x0dd5('0x7')](_0x0dd5('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0dd5('0x9'),'fields':[_0x0dd5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3756=['path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23b999,_0x434ecc){var _0x5ea2dc=function(_0x391e36){while(--_0x391e36){_0x23b999['push'](_0x23b999['shift']());}};_0x5ea2dc(++_0x434ecc);}(_0x3756,0x116));var _0x6375=function(_0xf8bb68,_0x369b1a){_0xf8bb68=_0xf8bb68-0x0;var _0x179af6=_0x3756[_0xf8bb68];return _0x179af6;};'use strict';var _=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var logger=require(_0x6375('0x2'))(_0x6375('0x3'));var moment=require(_0x6375('0x4'));var BPromise=require(_0x6375('0x5'));var rp=require(_0x6375('0x6'));var fs=require('fs');var path=require(_0x6375('0x7'));var rimraf=require(_0x6375('0x8'));var config=require(_0x6375('0x9'));var attributes=require(_0x6375('0xa'));module[_0x6375('0xb')]=function(_0x2cf0f9,_0x1dae97){return _0x2cf0f9[_0x6375('0xc')](_0x6375('0xd'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6375('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a2a388b..6253938 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 _0xef4e=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','rpc'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0xef4e,0x19f));var _0xeef4=function(_0xc0754,_0x37f107){_0xc0754=_0xc0754-0x0;var _0x195498=_0xef4e[_0xc0754];return _0x195498;};'use strict';var _=require(_0xeef4('0x0'));var util=require('util');var moment=require(_0xeef4('0x1'));var BPromise=require(_0xeef4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeef4('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeef4('0x4'));var config=require('../../config/environment');var jayson=require(_0xeef4('0x5'));var client=jayson[_0xeef4('0x6')][_0xeef4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa5c32,_0x4bf706,_0xaf20f3){return new BPromise(function(_0x478d44,_0x40c2ea){return client[_0xeef4('0x8')](_0xa5c32,_0xaf20f3)[_0xeef4('0x9')](function(_0x14f927){logger[_0xeef4('0xa')](_0xeef4('0xb'),_0x4bf706,_0xeef4('0xc'));logger[_0xeef4('0xd')](_0xeef4('0xe'),_0x4bf706,'request\x20sent',JSON['stringify'](_0x14f927));if(_0x14f927['error']){if(_0x14f927[_0xeef4('0xf')][_0xeef4('0x10')]===0x1f4){logger[_0xeef4('0xf')](_0xeef4('0xb'),_0x4bf706,_0x14f927[_0xeef4('0xf')]['message']);return _0x40c2ea(_0x14f927[_0xeef4('0xf')][_0xeef4('0x11')]);}logger[_0xeef4('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4bf706,_0x14f927['error'][_0xeef4('0x11')]);return _0x478d44(_0x14f927['error'][_0xeef4('0x11')]);}else{logger['info'](_0xeef4('0xb'),_0x4bf706,'request\x20sent');_0x478d44(_0x14f927[_0xeef4('0x12')]['message']);}})[_0xeef4('0x13')](function(_0x25f950){logger[_0xeef4('0xf')](_0xeef4('0xb'),_0x4bf706,_0x25f950);_0x40c2ea(_0x25f950);});});} \ No newline at end of file +var _0xb27f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15bd3e,_0x172ef6){var _0x3d219f=function(_0xfe1e1){while(--_0xfe1e1){_0x15bd3e['push'](_0x15bd3e['shift']());}};_0x3d219f(++_0x172ef6);}(_0xb27f,0xdd));var _0xfb27=function(_0x364043,_0x1bc227){_0x364043=_0x364043-0x0;var _0x1c5b3c=_0xb27f[_0x364043];return _0x1c5b3c;};'use strict';var _=require(_0xfb27('0x0'));var util=require(_0xfb27('0x1'));var moment=require(_0xfb27('0x2'));var BPromise=require(_0xfb27('0x3'));var rs=require(_0xfb27('0x4'));var fs=require('fs');var Redis=require(_0xfb27('0x5'));var db=require(_0xfb27('0x6'))['db'];var utils=require(_0xfb27('0x7'));var logger=require(_0xfb27('0x8'))('rpc');var config=require(_0xfb27('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb27('0xa')][_0xfb27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c41fc,_0x35ffe0,_0x26ed1e){return new BPromise(function(_0x44381a,_0x29b121){return client[_0xfb27('0xc')](_0x1c41fc,_0x26ed1e)['then'](function(_0x36b7a1){logger[_0xfb27('0xd')](_0xfb27('0xe'),_0x35ffe0,_0xfb27('0xf'));logger[_0xfb27('0x10')](_0xfb27('0x11'),_0x35ffe0,_0xfb27('0xf'),JSON[_0xfb27('0x12')](_0x36b7a1));if(_0x36b7a1[_0xfb27('0x13')]){if(_0x36b7a1[_0xfb27('0x13')][_0xfb27('0x14')]===0x1f4){logger['error'](_0xfb27('0xe'),_0x35ffe0,_0x36b7a1[_0xfb27('0x13')][_0xfb27('0x15')]);return _0x29b121(_0x36b7a1[_0xfb27('0x13')]['message']);}logger[_0xfb27('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x35ffe0,_0x36b7a1[_0xfb27('0x13')]['message']);return _0x44381a(_0x36b7a1[_0xfb27('0x13')]['message']);}else{logger[_0xfb27('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x35ffe0,_0xfb27('0xf'));_0x44381a(_0x36b7a1[_0xfb27('0x16')][_0xfb27('0x15')]);}})[_0xfb27('0x17')](function(_0xedce55){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x35ffe0,_0xedce55);_0x29b121(_0xedce55);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f7e3eb4..e69e372 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 _0x90ce=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','destroy','multer','util'];(function(_0x17266e,_0x5d273d){var _0x8eeaf4=function(_0xda6721){while(--_0xda6721){_0x17266e['push'](_0x17266e['shift']());}};_0x8eeaf4(++_0x5d273d);}(_0x90ce,0x1d9));var _0xe90c=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x90ce[_0x1f6f84];return _0x177f40;};'use strict';var multer=require(_0xe90c('0x0'));var util=require(_0xe90c('0x1'));var path=require(_0xe90c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe90c('0x3'));var router=express[_0xe90c('0x4')]();var fs_extra=require(_0xe90c('0x5'));var auth=require(_0xe90c('0x6'));var interaction=require(_0xe90c('0x7'));var config=require('../../config/environment');var controller=require(_0xe90c('0x8'));router[_0xe90c('0x9')]('/',auth['isAuthenticated'](),controller[_0xe90c('0xa')]);router['get']('/describe',auth[_0xe90c('0xb')](),controller[_0xe90c('0xc')]);router['get'](_0xe90c('0xd'),auth[_0xe90c('0xb')](),controller[_0xe90c('0xe')]);router[_0xe90c('0xf')]('/',auth[_0xe90c('0xb')](),controller[_0xe90c('0x10')]);router[_0xe90c('0x11')](_0xe90c('0xd'),auth[_0xe90c('0xb')](),controller['update']);router['delete'](_0xe90c('0xd'),auth[_0xe90c('0xb')](),controller[_0xe90c('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1d15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x1d15,0x1dd));var _0x51d1=function(_0x426167,_0x265f09){_0x426167=_0x426167-0x0;var _0x735124=_0x1d15[_0x426167];return _0x735124;};'use strict';var multer=require(_0x51d1('0x0'));var util=require(_0x51d1('0x1'));var path=require(_0x51d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x51d1('0x3'));var router=express[_0x51d1('0x4')]();var fs_extra=require(_0x51d1('0x5'));var auth=require(_0x51d1('0x6'));var interaction=require(_0x51d1('0x7'));var config=require(_0x51d1('0x8'));var controller=require(_0x51d1('0x9'));router[_0x51d1('0xa')]('/',auth['isAuthenticated'](),controller[_0x51d1('0xb')]);router[_0x51d1('0xa')](_0x51d1('0xc'),auth['isAuthenticated'](),controller[_0x51d1('0xd')]);router[_0x51d1('0xa')](_0x51d1('0xe'),auth[_0x51d1('0xf')](),controller[_0x51d1('0x10')]);router[_0x51d1('0x11')]('/',auth[_0x51d1('0xf')](),controller[_0x51d1('0x12')]);router[_0x51d1('0x13')](_0x51d1('0xe'),auth[_0x51d1('0xf')](),controller[_0x51d1('0x14')]);router[_0x51d1('0x15')](_0x51d1('0xe'),auth[_0x51d1('0xf')](),controller[_0x51d1('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e142300..acfe644 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 _0x71c0=['talk:[start]','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x29d491,_0x340b76){var _0x20aaef=function(_0x317d63){while(--_0x317d63){_0x29d491['push'](_0x29d491['shift']());}};_0x20aaef(++_0x340b76);}(_0x71c0,0x1a3));var _0x071c=function(_0x95916a,_0x3707d7){_0x95916a=_0x95916a-0x0;var _0x2a0ac4=_0x71c0[_0x95916a];return _0x2a0ac4;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x071c('0x0')]},'membername':{'type':Sequelize[_0x071c('0x0')]},'interface':{'type':Sequelize[_0x071c('0x0')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x071c('0x1'),'comment':_0x071c('0x2')},'duration':{'type':Sequelize[_0x071c('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x071c('0x4')],'set':function(_0x3760dd){var _0x5c88ba=moment(_0x3760dd);var _0x5e9b58=moment(this[_0x071c('0x5')]('enterAt'));var _0x54777b=_0x5c88ba[_0x071c('0x6')](_0x5e9b58,_0x071c('0x7'));this[_0x071c('0x8')]('exitAt',_0x3760dd);this['setDataValue']('duration',_0x54777b>=0x0?_0x54777b:null);}},'data1':{'type':Sequelize[_0x071c('0x0')],'comment':_0x071c('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0x071c('0xa')},'data3':{'type':Sequelize[_0x071c('0x0')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x071c('0x0')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x071c('0x0')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x071c('0x0')]},'internal':{'type':Sequelize[_0x071c('0x3')]},'uniqueid':{'type':Sequelize[_0x071c('0x0')]}}; \ No newline at end of file +var _0x1322=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt'];(function(_0x305cdc,_0x5c2820){var _0x321002=function(_0x6b098d){while(--_0x6b098d){_0x305cdc['push'](_0x305cdc['shift']());}};_0x321002(++_0x5c2820);}(_0x1322,0x65));var _0x2132=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1322[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x2132('0x0'));var moment=require('moment');module[_0x2132('0x1')]={'channel':{'type':Sequelize[_0x2132('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2132('0x2')]},'type':{'type':Sequelize[_0x2132('0x2')],'defaultValue':_0x2132('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2132('0x4')]},'enterAt':{'type':Sequelize[_0x2132('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5ca79a){var _0x54564b=moment(_0x5ca79a);var _0x4772f1=moment(this['getDataValue'](_0x2132('0x6')));var _0xc1b422=_0x54564b[_0x2132('0x7')](_0x4772f1,_0x2132('0x8'));this[_0x2132('0x9')](_0x2132('0xa'),_0x5ca79a);this['setDataValue'](_0x2132('0xb'),_0xc1b422>=0x0?_0xc1b422:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x2132('0xc')},'data2':{'type':Sequelize[_0x2132('0x2')],'comment':_0x2132('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x2132('0xe')},'data5':{'type':Sequelize[_0x2132('0x2')],'comment':_0x2132('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x2132('0x4')]},'uniqueid':{'type':Sequelize[_0x2132('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 7102a6c..478a39b 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 _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x34e8,0x12c));var _0x834e=function(_0x434c37,_0x61ee91){_0x434c37=_0x434c37-0x0;var _0x3cc37f=_0x34e8[_0x434c37];return _0x3cc37f;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x21d599,_0x97e6cd){var _0x57301f=function(_0x3ca042){while(--_0x3ca042){_0x21d599['push'](_0x21d599['shift']());}};_0x57301f(++_0x97e6cd);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a1a813a..d953c36 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 _0x150a=['report_member','membername_interface','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x1e4c44,_0x28478e){var _0x20dd61=function(_0x3d6bbd){while(--_0x3d6bbd){_0x1e4c44['push'](_0x1e4c44['shift']());}};_0x20dd61(++_0x28478e);}(_0x150a,0x1a7));var _0xa150=function(_0x200d69,_0x430951){_0x200d69=_0x200d69-0x0;var _0x14fde8=_0x150a[_0x200d69];return _0x14fde8;};'use strict';var _=require(_0xa150('0x0'));var util=require(_0xa150('0x1'));var logger=require(_0xa150('0x2'))('api');var moment=require(_0xa150('0x3'));var BPromise=require(_0xa150('0x4'));var rp=require(_0xa150('0x5'));var fs=require('fs');var path=require(_0xa150('0x6'));var rimraf=require('rimraf');var config=require(_0xa150('0x7'));var attributes=require(_0xa150('0x8'));module['exports']=function(_0x59c49c,_0x245742){return _0x59c49c[_0xa150('0x9')](_0xa150('0xa'),attributes,{'tableName':_0xa150('0xb'),'paranoid':![],'indexes':[{'name':_0xa150('0xc'),'fields':['membername',_0xa150('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5ea=['path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','util','moment','bluebird','request-promise'];(function(_0x561975,_0x1d64fc){var _0x15b7f5=function(_0x43bfc1){while(--_0x43bfc1){_0x561975['push'](_0x561975['shift']());}};_0x15b7f5(++_0x1d64fc);}(_0xf5ea,0xc0));var _0xaf5e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf5ea[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xaf5e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xaf5e('0x1'));var BPromise=require(_0xaf5e('0x2'));var rp=require(_0xaf5e('0x3'));var fs=require('fs');var path=require(_0xaf5e('0x4'));var rimraf=require(_0xaf5e('0x5'));var config=require(_0xaf5e('0x6'));var attributes=require(_0xaf5e('0x7'));module[_0xaf5e('0x8')]=function(_0x60f9e2,_0x174735){return _0x60f9e2[_0xaf5e('0x9')](_0xaf5e('0xa'),attributes,{'tableName':_0xaf5e('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xaf5e('0xc'),_0xaf5e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index c42b567..ab4c799 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 _0xafc4=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','model','map','CreateMemberReport','create','body','debug','UpdateMemberReport'];(function(_0x595ae0,_0x4bdeae){var _0x87773a=function(_0xa7e1e7){while(--_0xa7e1e7){_0x595ae0['push'](_0x595ae0['shift']());}};_0x87773a(++_0x4bdeae);}(_0xafc4,0x69));var _0x4afc=function(_0x4ba578,_0xad9860){_0x4ba578=_0x4ba578-0x0;var _0x5a0af6=_0xafc4[_0x4ba578];return _0x5a0af6;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('MemberReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetMemberReport',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetMemberReport',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['MemberReport'][_0x4afc('0x1f')](_0x17a43d[_0x4afc('0x20')],{'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![]})[_0x4afc('0xa')](function(_0xbabe1e){logger[_0x4afc('0xb')]('CreateMemberReport',_0x17a43d);logger[_0x4afc('0x21')]('CreateMemberReport',_0x17a43d,JSON['stringify'](_0xbabe1e));_0xc1d91(_0xbabe1e);})[_0x4afc('0x13')](function(_0x33ebbc){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x33ebbc[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x33ebbc['message']));});});};exports[_0x4afc('0x22')]=function(_0x2d0ad8){var _0x111dbf=this;return new Promise(function(_0x127ac8,_0x3127e6){return db[_0x4afc('0x15')]['update'](_0x2d0ad8[_0x4afc('0x20')],{'raw':_0x2d0ad8[_0x4afc('0x16')]?_0x2d0ad8[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d0ad8['options']?_0x2d0ad8['options'][_0x4afc('0x18')]||null:null,'attributes':_0x2d0ad8[_0x4afc('0x16')]?_0x2d0ad8[_0x4afc('0x16')]['attributes']||null:null,'limit':_0x2d0ad8['options']?_0x2d0ad8[_0x4afc('0x16')]['limit']||null:null})['then'](function(_0x295b53){logger[_0x4afc('0xb')](_0x4afc('0x22'),_0x2d0ad8);logger[_0x4afc('0x21')](_0x4afc('0x22'),_0x2d0ad8,JSON[_0x4afc('0xe')](_0x295b53));_0x127ac8(_0x295b53);})[_0x4afc('0x13')](function(_0x29c0df){logger[_0x4afc('0xf')](_0x4afc('0x22'),_0x29c0df[_0x4afc('0x11')],_0x2d0ad8);_0x3127e6(_0x111dbf[_0x4afc('0xf')](0x1f4,_0x29c0df[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0xf31b=['model','attributes','MemberReport','create','body','raw','CreateMemberReport','UpdateMemberReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','findAll','options','where','include','map'];(function(_0xea81ab,_0x23eb5e){var _0xb98237=function(_0x132024){while(--_0x132024){_0xea81ab['push'](_0xea81ab['shift']());}};_0xb98237(++_0x23eb5e);}(_0xf31b,0x1a0));var _0xbf31=function(_0x5a6e12,_0x100540){_0x5a6e12=_0x5a6e12-0x0;var _0x65f287=_0xf31b[_0x5a6e12];return _0x65f287;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var moment=require(_0xbf31('0x2'));var BPromise=require(_0xbf31('0x3'));var rs=require(_0xbf31('0x4'));var fs=require('fs');var Redis=require(_0xbf31('0x5'));var db=require(_0xbf31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf31('0x7'))(_0xbf31('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf6c0f,_0xde14a4,_0x547919){return new BPromise(function(_0x4d02dd,_0x3da1a2){return client['request'](_0xcf6c0f,_0x547919)[_0xbf31('0xa')](function(_0x23d576){logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));logger[_0xbf31('0xe')](_0xbf31('0xf'),_0xde14a4,_0xbf31('0xd'),JSON[_0xbf31('0x10')](_0x23d576));if(_0x23d576[_0xbf31('0x11')]){if(_0x23d576[_0xbf31('0x11')][_0xbf31('0x12')]===0x1f4){logger[_0xbf31('0x11')]('MemberReport,\x20%s,\x20%s',_0xde14a4,_0x23d576['error']['message']);return _0x3da1a2(_0x23d576['error'][_0xbf31('0x13')]);}logger[_0xbf31('0x11')](_0xbf31('0xc'),_0xde14a4,_0x23d576[_0xbf31('0x11')]['message']);return _0x4d02dd(_0x23d576['error'][_0xbf31('0x13')]);}else{logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));_0x4d02dd(_0x23d576[_0xbf31('0x14')]['message']);}})[_0xbf31('0x15')](function(_0x5e9b58){logger['error'](_0xbf31('0xc'),_0xde14a4,_0x5e9b58);_0x3da1a2(_0x5e9b58);});});}exports[_0xbf31('0x16')]=function(_0x1cb0ce){var _0x1101e4=this;return new Promise(function(_0x19878b,_0x522532){return db['MemberReport'][_0xbf31('0x17')]({'raw':_0x1cb0ce[_0xbf31('0x18')]?_0x1cb0ce[_0xbf31('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1cb0ce[_0xbf31('0x18')]?_0x1cb0ce[_0xbf31('0x18')][_0xbf31('0x19')]||null:null,'attributes':_0x1cb0ce[_0xbf31('0x18')]?_0x1cb0ce[_0xbf31('0x18')]['attributes']||null:null,'limit':_0x1cb0ce[_0xbf31('0x18')]?_0x1cb0ce['options']['limit']||null:null,'include':_0x1cb0ce[_0xbf31('0x18')]?_0x1cb0ce[_0xbf31('0x18')][_0xbf31('0x1a')]?_[_0xbf31('0x1b')](_0x1cb0ce[_0xbf31('0x18')][_0xbf31('0x1a')],function(_0x59f899){return{'model':db[_0x59f899[_0xbf31('0x1c')]],'as':_0x59f899['as'],'attributes':_0x59f899[_0xbf31('0x1d')],'include':_0x59f899[_0xbf31('0x1a')]?_[_0xbf31('0x1b')](_0x59f899[_0xbf31('0x1a')],function(_0x15b9b3){return{'model':db[_0x15b9b3['model']],'as':_0x15b9b3['as'],'attributes':_0x15b9b3[_0xbf31('0x1d')],'include':_0x15b9b3[_0xbf31('0x1a')]?_[_0xbf31('0x1b')](_0x15b9b3[_0xbf31('0x1a')],function(_0x224d71){return{'model':db[_0x224d71['model']],'as':_0x224d71['as'],'attributes':_0x224d71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf31('0xa')](function(_0x1a17f4){logger[_0xbf31('0xb')](_0xbf31('0x16'),_0x1cb0ce);logger['debug']('GetMemberReport',_0x1cb0ce,JSON['stringify'](_0x1a17f4));_0x19878b(_0x1a17f4);})['catch'](function(_0x3a6b75){logger[_0xbf31('0x11')]('GetMemberReport',_0x3a6b75[_0xbf31('0x13')],_0x1cb0ce);_0x522532(_0x1101e4[_0xbf31('0x11')](0x1f4,_0x3a6b75[_0xbf31('0x13')]));});});};exports['CreateMemberReport']=function(_0x4f7551){var _0x5a7b09=this;return new Promise(function(_0x3a6da6,_0x11e289){return db[_0xbf31('0x1e')][_0xbf31('0x1f')](_0x4f7551[_0xbf31('0x20')],{'raw':_0x4f7551[_0xbf31('0x18')]?_0x4f7551['options'][_0xbf31('0x21')]===undefined?!![]:![]:!![]})[_0xbf31('0xa')](function(_0x18c166){logger[_0xbf31('0xb')](_0xbf31('0x22'),_0x4f7551);logger[_0xbf31('0xe')]('CreateMemberReport',_0x4f7551,JSON[_0xbf31('0x10')](_0x18c166));_0x3a6da6(_0x18c166);})['catch'](function(_0x55eb67){logger[_0xbf31('0x11')](_0xbf31('0x22'),_0x55eb67[_0xbf31('0x13')],_0x4f7551);_0x11e289(_0x5a7b09['error'](0x1f4,_0x55eb67[_0xbf31('0x13')]));});});};exports[_0xbf31('0x23')]=function(_0x41bfa9){var _0x2091a8=this;return new Promise(function(_0x421d2e,_0x27c7da){return db[_0xbf31('0x1e')]['update'](_0x41bfa9[_0xbf31('0x20')],{'raw':_0x41bfa9[_0xbf31('0x18')]?_0x41bfa9[_0xbf31('0x18')][_0xbf31('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41bfa9[_0xbf31('0x18')]?_0x41bfa9['options']['where']||null:null,'attributes':_0x41bfa9[_0xbf31('0x18')]?_0x41bfa9[_0xbf31('0x18')][_0xbf31('0x1d')]||null:null,'limit':_0x41bfa9[_0xbf31('0x18')]?_0x41bfa9[_0xbf31('0x18')][_0xbf31('0x24')]||null:null})['then'](function(_0x343f72){logger[_0xbf31('0xb')](_0xbf31('0x23'),_0x41bfa9);logger[_0xbf31('0xe')](_0xbf31('0x23'),_0x41bfa9,JSON['stringify'](_0x343f72));_0x421d2e(_0x343f72);})[_0xbf31('0x15')](function(_0x3f86c5){logger['error']('UpdateMemberReport',_0x3f86c5[_0xbf31('0x13')],_0x41bfa9);_0x27c7da(_0x2091a8[_0xbf31('0x11')](0x1f4,_0x3f86c5['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3ea1f07..a3b163a 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 _0x2499=['../../components/interaction/service','./migration.controller','get','index','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2499,0x7d));var _0x9249=function(_0x500ca7,_0x5d4949){_0x500ca7=_0x500ca7-0x0;var _0x1d09ae=_0x2499[_0x500ca7];return _0x1d09ae;};'use strict';var multer=require(_0x9249('0x0'));var util=require(_0x9249('0x1'));var path=require(_0x9249('0x2'));var timeout=require(_0x9249('0x3'));var express=require(_0x9249('0x4'));var router=express['Router']();var fs_extra=require(_0x9249('0x5'));var auth=require(_0x9249('0x6'));var interaction=require(_0x9249('0x7'));var config=require('../../config/environment');var controller=require(_0x9249('0x8'));router[_0x9249('0x9')]('/',controller[_0x9249('0xa')]);module['exports']=router; \ No newline at end of file +var _0x5482=['path','connect-timeout','express','fs-extra','../../components/auth/service','get','index','exports','multer','util'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0x5482,0xf8));var _0x2548=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0x5482[_0x51bda1];return _0x1ce08c;};'use strict';var multer=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var path=require(_0x2548('0x2'));var timeout=require(_0x2548('0x3'));var express=require(_0x2548('0x4'));var router=express['Router']();var fs_extra=require(_0x2548('0x5'));var auth=require(_0x2548('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x2548('0x7')]('/',controller[_0x2548('0x8')]);module[_0x2548('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 448f032..d360174 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 _0xe5c6=['exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe5c6,0xbb));var _0x6e5c=function(_0x45faab,_0x384f81){_0x45faab=_0x45faab-0x0;var _0x2f7be9=_0xe5c6[_0x45faab];return _0x2f7be9;};'use strict';var Sequelize=require('sequelize');module[_0x6e5c('0x0')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x1dcc=['version','sequelize','STRING'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x1dcc,0x97));var _0xc1dc=function(_0x4e4e61,_0x436823){_0x4e4e61=_0x4e4e61-0x0;var _0x588850=_0x1dcc[_0x4e4e61];return _0x588850;};'use strict';var Sequelize=require(_0xc1dc('0x0'));module['exports']={'version':{'type':Sequelize[_0xc1dc('0x1')],'unique':_0xc1dc('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index b066c1e..4e20f1a 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 _0x163b=['model','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','map','query','keys','filters','intersection'];(function(_0x315f9a,_0x2b67fc){var _0x22adf4=function(_0x55bfdd){while(--_0x55bfdd){_0x315f9a['push'](_0x315f9a['shift']());}};_0x22adf4(++_0x2b67fc);}(_0x163b,0x91));var _0xb163=function(_0x37b4af,_0x43c63b){_0x37b4af=_0x37b4af-0x0;var _0x30043a=_0x163b[_0x37b4af];return _0x30043a;};'use strict';var emlformat=require(_0xb163('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb163('0x1'));var rp=require(_0xb163('0x2'));var moment=require(_0xb163('0x3'));var BPromise=require(_0xb163('0x4'));var Mustache=require('mustache');var util=require(_0xb163('0x5'));var path=require('path');var sox=require(_0xb163('0x6'));var csv=require(_0xb163('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb163('0x8'));var squel=require(_0xb163('0x9'));var crypto=require(_0xb163('0xa'));var jsforce=require(_0xb163('0xb'));var deskjs=require(_0xb163('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb163('0xd'));var Papa=require(_0xb163('0xe'));var Redis=require('ioredis');var authService=require(_0xb163('0xf'));var qs=require(_0xb163('0x10'));var as=require(_0xb163('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb163('0x12'))('api');var utils=require(_0xb163('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb163('0x14'))['db'];function respondWithStatusCode(_0xdfdf61,_0x494c4c){_0x494c4c=_0x494c4c||0xcc;return function(_0x3ebfa6){if(_0x3ebfa6){return _0xdfdf61[_0xb163('0x15')](_0x494c4c);}return _0xdfdf61[_0xb163('0x16')](_0x494c4c)[_0xb163('0x17')]();};}function respondWithResult(_0x446775,_0xd3c599){_0xd3c599=_0xd3c599||0xc8;return function(_0x3419d2){if(_0x3419d2){return _0x446775[_0xb163('0x16')](_0xd3c599)[_0xb163('0x18')](_0x3419d2);}};}function respondWithFilteredResult(_0x1266fd,_0x2d5965){return function(_0xc1336c){if(_0xc1336c){var _0x4888b1=typeof _0x2d5965['offset']===_0xb163('0x19')&&typeof _0x2d5965[_0xb163('0x1a')]===_0xb163('0x19');var _0x177ef0=_0xc1336c[_0xb163('0x1b')];var _0x3d6e67=_0x4888b1?0x0:_0x2d5965[_0xb163('0x1c')];var _0x3ecc9d=_0x4888b1?_0xc1336c[_0xb163('0x1b')]:_0x2d5965[_0xb163('0x1c')]+_0x2d5965['limit'];var _0x5b7e1d;if(_0x3ecc9d>=_0x177ef0){_0x3ecc9d=_0x177ef0;_0x5b7e1d=0xc8;}else{_0x5b7e1d=0xce;}_0x1266fd[_0xb163('0x16')](_0x5b7e1d);return _0x1266fd['set'](_0xb163('0x1d'),_0x3d6e67+'-'+_0x3ecc9d+'/'+_0x177ef0)[_0xb163('0x18')](_0xc1336c);}return null;};}function patchUpdates(_0x94a368){return function(_0x4137a3){try{jsonpatch[_0xb163('0x1e')](_0x4137a3,_0x94a368,!![]);}catch(_0x3ac78c){return BPromise[_0xb163('0x1f')](_0x3ac78c);}return _0x4137a3[_0xb163('0x20')]();};}function saveUpdates(_0x206896,_0x7aeef0){return function(_0x52424b){if(_0x52424b){return _0x52424b[_0xb163('0x21')](_0x206896)[_0xb163('0x22')](function(_0x9b703d){return _0x9b703d;});}return null;};}function removeEntity(_0x43da6a,_0x119d4e){return function(_0x3860ab){if(_0x3860ab){return _0x3860ab[_0xb163('0x23')]()[_0xb163('0x22')](function(){_0x43da6a[_0xb163('0x16')](0xcc)[_0xb163('0x17')]();});}};}function handleEntityNotFound(_0x2c8076,_0x438c61){return function(_0x50fd9e){if(!_0x50fd9e){_0x2c8076[_0xb163('0x15')](0x194);}return _0x50fd9e;};}function handleError(_0xd29d20,_0x5f2136){_0x5f2136=_0x5f2136||0x1f4;return function(_0x6370ef){logger[_0xb163('0x24')](_0x6370ef[_0xb163('0x25')]);if(_0x6370ef[_0xb163('0x26')]){delete _0x6370ef[_0xb163('0x26')];}_0xd29d20[_0xb163('0x16')](_0x5f2136)[_0xb163('0x27')](_0x6370ef);};}exports[_0xb163('0x28')]=function(_0x173d95,_0x179b51){var _0x3a6d6a={},_0x17b53d={},_0x4a874b={'count':0x0,'rows':[]};var _0x17cd02=_['map'](db[_0xb163('0x29')][_0xb163('0x2a')],function(_0x521a5b){return{'name':_0x521a5b[_0xb163('0x2b')],'type':_0x521a5b[_0xb163('0x2c')]['key']};});_0x17b53d['model']=_[_0xb163('0x2d')](_0x17cd02,'name');_0x17b53d[_0xb163('0x2e')]=_[_0xb163('0x2f')](_0x173d95[_0xb163('0x2e')]);_0x17b53d[_0xb163('0x30')]=_[_0xb163('0x31')](_0x17b53d[_0xb163('0x32')],_0x17b53d[_0xb163('0x2e')]);_0x3a6d6a[_0xb163('0x33')]=_[_0xb163('0x31')](_0x17b53d[_0xb163('0x32')],qs[_0xb163('0x34')](_0x173d95['query'][_0xb163('0x34')]));_0x3a6d6a[_0xb163('0x33')]=_0x3a6d6a[_0xb163('0x33')][_0xb163('0x35')]?_0x3a6d6a[_0xb163('0x33')]:_0x17b53d[_0xb163('0x32')];if(!_0x173d95[_0xb163('0x2e')]['hasOwnProperty'](_0xb163('0x36'))){_0x3a6d6a['limit']=qs[_0xb163('0x1a')](_0x173d95[_0xb163('0x2e')][_0xb163('0x1a')]);_0x3a6d6a[_0xb163('0x1c')]=qs['offset'](_0x173d95[_0xb163('0x2e')]['offset']);}_0x3a6d6a[_0xb163('0x37')]=qs[_0xb163('0x38')](_0x173d95['query'][_0xb163('0x38')]);_0x3a6d6a['where']=qs[_0xb163('0x30')](_['pick'](_0x173d95['query'],_0x17b53d[_0xb163('0x30')]),_0x17cd02);if(_0x173d95['query'][_0xb163('0x39')]){_0x3a6d6a['where']=_[_0xb163('0x3a')](_0x3a6d6a[_0xb163('0x3b')],{'$or':_[_0xb163('0x2d')](_0x17cd02,function(_0x2152a9){if(_0x2152a9[_0xb163('0x2c')]!==_0xb163('0x3c')){var _0x42d1cd={};_0x42d1cd[_0x2152a9['name']]={'$like':'%'+_0x173d95[_0xb163('0x2e')][_0xb163('0x39')]+'%'};return _0x42d1cd;}})});}_0x3a6d6a=_['merge']({},_0x3a6d6a,_0x173d95[_0xb163('0x3d')]);var _0x13fd71={'where':_0x3a6d6a[_0xb163('0x3b')]};return db[_0xb163('0x29')]['count'](_0x13fd71)[_0xb163('0x22')](function(_0x14f925){_0x4a874b[_0xb163('0x1b')]=_0x14f925;if(_0x173d95[_0xb163('0x2e')][_0xb163('0x3e')]){_0x3a6d6a['include']=[{'all':!![]}];}return db[_0xb163('0x29')][_0xb163('0x3f')](_0x3a6d6a);})['then'](function(_0x91d1d9){_0x4a874b[_0xb163('0x40')]=_0x91d1d9;return _0x4a874b;})['then'](respondWithFilteredResult(_0x179b51,_0x3a6d6a))['catch'](handleError(_0x179b51,null));}; \ No newline at end of file +var _0x2f1e=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Migration','includeAll','findAll','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0xc7232c,_0xfffc66){var _0x178f83=function(_0x983cbe){while(--_0x983cbe){_0xc7232c['push'](_0xc7232c['shift']());}};_0x178f83(++_0xfffc66);}(_0x2f1e,0xd9));var _0xe2f1=function(_0x250bbc,_0x3297f3){_0x250bbc=_0x250bbc-0x0;var _0x489e34=_0x2f1e[_0x250bbc];return _0x489e34;};'use strict';var emlformat=require(_0xe2f1('0x0'));var rimraf=require(_0xe2f1('0x1'));var zipdir=require(_0xe2f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe2f1('0x3'));var BPromise=require(_0xe2f1('0x4'));var Mustache=require(_0xe2f1('0x5'));var util=require(_0xe2f1('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(_0xe2f1('0x7'));var _=require(_0xe2f1('0x8'));var squel=require(_0xe2f1('0x9'));var crypto=require(_0xe2f1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe2f1('0xb'));var Papa=require('papaparse');var Redis=require(_0xe2f1('0xc'));var authService=require(_0xe2f1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe2f1('0xe'));var hardwareService=require(_0xe2f1('0xf'));var logger=require(_0xe2f1('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe2f1('0x11'));var licenseUtil=require(_0xe2f1('0x12'));var db=require(_0xe2f1('0x13'))['db'];function respondWithStatusCode(_0xfed82e,_0x49fd7b){_0x49fd7b=_0x49fd7b||0xcc;return function(_0x5794df){if(_0x5794df){return _0xfed82e[_0xe2f1('0x14')](_0x49fd7b);}return _0xfed82e[_0xe2f1('0x15')](_0x49fd7b)[_0xe2f1('0x16')]();};}function respondWithResult(_0x46fed5,_0x3c9df5){_0x3c9df5=_0x3c9df5||0xc8;return function(_0x4ad29c){if(_0x4ad29c){return _0x46fed5[_0xe2f1('0x15')](_0x3c9df5)[_0xe2f1('0x17')](_0x4ad29c);}};}function respondWithFilteredResult(_0x16ac98,_0x3b0ad8){return function(_0x7c6fb){if(_0x7c6fb){var _0x3a1e75=typeof _0x3b0ad8[_0xe2f1('0x18')]==='undefined'&&typeof _0x3b0ad8[_0xe2f1('0x19')]==='undefined';var _0x2e71fc=_0x7c6fb[_0xe2f1('0x1a')];var _0x5e1d8d=_0x3a1e75?0x0:_0x3b0ad8[_0xe2f1('0x18')];var _0x2a7bef=_0x3a1e75?_0x7c6fb[_0xe2f1('0x1a')]:_0x3b0ad8[_0xe2f1('0x18')]+_0x3b0ad8[_0xe2f1('0x19')];var _0x1e755a;if(_0x2a7bef>=_0x2e71fc){_0x2a7bef=_0x2e71fc;_0x1e755a=0xc8;}else{_0x1e755a=0xce;}_0x16ac98['status'](_0x1e755a);return _0x16ac98[_0xe2f1('0x1b')](_0xe2f1('0x1c'),_0x5e1d8d+'-'+_0x2a7bef+'/'+_0x2e71fc)[_0xe2f1('0x17')](_0x7c6fb);}return null;};}function patchUpdates(_0x5e1a01){return function(_0x4af296){try{jsonpatch['apply'](_0x4af296,_0x5e1a01,!![]);}catch(_0x33089e){return BPromise['reject'](_0x33089e);}return _0x4af296[_0xe2f1('0x1d')]();};}function saveUpdates(_0x5880a6,_0x3b02af){return function(_0x58512f){if(_0x58512f){return _0x58512f['update'](_0x5880a6)[_0xe2f1('0x1e')](function(_0x52464e){return _0x52464e;});}return null;};}function removeEntity(_0x85b28,_0x319491){return function(_0x43353c){if(_0x43353c){return _0x43353c[_0xe2f1('0x1f')]()[_0xe2f1('0x1e')](function(){_0x85b28[_0xe2f1('0x15')](0xcc)[_0xe2f1('0x16')]();});}};}function handleEntityNotFound(_0x5dc89e,_0x3d94be){return function(_0x45844e){if(!_0x45844e){_0x5dc89e[_0xe2f1('0x14')](0x194);}return _0x45844e;};}function handleError(_0x2aadf9,_0x234cbc){_0x234cbc=_0x234cbc||0x1f4;return function(_0x3f6456){logger[_0xe2f1('0x20')](_0x3f6456[_0xe2f1('0x21')]);if(_0x3f6456[_0xe2f1('0x22')]){delete _0x3f6456['name'];}_0x2aadf9[_0xe2f1('0x15')](_0x234cbc)[_0xe2f1('0x23')](_0x3f6456);};}exports['index']=function(_0x391a59,_0x273b6){var _0x5cda0a={},_0x3c02f7={},_0x22900a={'count':0x0,'rows':[]};var _0x5f348a=_['map'](db['Migration'][_0xe2f1('0x24')],function(_0x33b58d){return{'name':_0x33b58d[_0xe2f1('0x25')],'type':_0x33b58d[_0xe2f1('0x26')][_0xe2f1('0x27')]};});_0x3c02f7[_0xe2f1('0x28')]=_[_0xe2f1('0x29')](_0x5f348a,_0xe2f1('0x22'));_0x3c02f7['query']=_[_0xe2f1('0x2a')](_0x391a59[_0xe2f1('0x2b')]);_0x3c02f7['filters']=_[_0xe2f1('0x2c')](_0x3c02f7[_0xe2f1('0x28')],_0x3c02f7[_0xe2f1('0x2b')]);_0x5cda0a[_0xe2f1('0x2d')]=_['intersection'](_0x3c02f7[_0xe2f1('0x28')],qs['fields'](_0x391a59[_0xe2f1('0x2b')]['fields']));_0x5cda0a[_0xe2f1('0x2d')]=_0x5cda0a['attributes']['length']?_0x5cda0a[_0xe2f1('0x2d')]:_0x3c02f7['model'];if(!_0x391a59[_0xe2f1('0x2b')]['hasOwnProperty'](_0xe2f1('0x2e'))){_0x5cda0a['limit']=qs[_0xe2f1('0x19')](_0x391a59['query'][_0xe2f1('0x19')]);_0x5cda0a['offset']=qs[_0xe2f1('0x18')](_0x391a59[_0xe2f1('0x2b')][_0xe2f1('0x18')]);}_0x5cda0a[_0xe2f1('0x2f')]=qs[_0xe2f1('0x30')](_0x391a59['query'][_0xe2f1('0x30')]);_0x5cda0a[_0xe2f1('0x31')]=qs['filters'](_[_0xe2f1('0x32')](_0x391a59[_0xe2f1('0x2b')],_0x3c02f7['filters']),_0x5f348a);if(_0x391a59['query']['filter']){_0x5cda0a['where']=_[_0xe2f1('0x33')](_0x5cda0a['where'],{'$or':_[_0xe2f1('0x29')](_0x5f348a,function(_0x20d349){if(_0x20d349[_0xe2f1('0x26')]!==_0xe2f1('0x34')){var _0x1fbfc7={};_0x1fbfc7[_0x20d349['name']]={'$like':'%'+_0x391a59[_0xe2f1('0x2b')][_0xe2f1('0x35')]+'%'};return _0x1fbfc7;}})});}_0x5cda0a=_[_0xe2f1('0x33')]({},_0x5cda0a,_0x391a59[_0xe2f1('0x36')]);var _0x47e24f={'where':_0x5cda0a['where']};return db[_0xe2f1('0x37')][_0xe2f1('0x1a')](_0x47e24f)[_0xe2f1('0x1e')](function(_0x10e777){_0x22900a[_0xe2f1('0x1a')]=_0x10e777;if(_0x391a59[_0xe2f1('0x2b')][_0xe2f1('0x38')]){_0x5cda0a['include']=[{'all':!![]}];}return db[_0xe2f1('0x37')][_0xe2f1('0x39')](_0x5cda0a);})[_0xe2f1('0x1e')](function(_0x5dea56){_0x22900a['rows']=_0x5dea56;return _0x22900a;})[_0xe2f1('0x1e')](respondWithFilteredResult(_0x273b6,_0x5cda0a))[_0xe2f1('0x3a')](handleError(_0x273b6,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 9c00e77..f834367 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 _0x2a71=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','migrations'];(function(_0x1b0cbb,_0x317bd9){var _0xf65219=function(_0x19a30e){while(--_0x19a30e){_0x1b0cbb['push'](_0x1b0cbb['shift']());}};_0xf65219(++_0x317bd9);}(_0x2a71,0x179));var _0x12a7=function(_0x343f5b,_0x5c5f5f){_0x343f5b=_0x343f5b-0x0;var _0x14d9cc=_0x2a71[_0x343f5b];return _0x14d9cc;};'use strict';var _=require(_0x12a7('0x0'));var util=require(_0x12a7('0x1'));var logger=require(_0x12a7('0x2'))(_0x12a7('0x3'));var moment=require(_0x12a7('0x4'));var BPromise=require(_0x12a7('0x5'));var rp=require(_0x12a7('0x6'));var fs=require('fs');var path=require(_0x12a7('0x7'));var rimraf=require(_0x12a7('0x8'));var config=require(_0x12a7('0x9'));var attributes=require(_0x12a7('0xa'));module['exports']=function(_0xdfe28f,_0x4506b1){return _0xdfe28f[_0x12a7('0xb')]('Migration',attributes,{'tableName':_0x12a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf43=['rimraf','../../config/environment','./migration.attributes','define','Migration','migrations','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1bd12a,_0x27965e){var _0x2f6ae7=function(_0x1082a6){while(--_0x1082a6){_0x1bd12a['push'](_0x1bd12a['shift']());}};_0x2f6ae7(++_0x27965e);}(_0xbf43,0x7e));var _0x3bf4=function(_0xd314a,_0x72ff74){_0xd314a=_0xd314a-0x0;var _0x32fb49=_0xbf43[_0xd314a];return _0x32fb49;};'use strict';var _=require(_0x3bf4('0x0'));var util=require('util');var logger=require(_0x3bf4('0x1'))(_0x3bf4('0x2'));var moment=require('moment');var BPromise=require(_0x3bf4('0x3'));var rp=require(_0x3bf4('0x4'));var fs=require('fs');var path=require(_0x3bf4('0x5'));var rimraf=require(_0x3bf4('0x6'));var config=require(_0x3bf4('0x7'));var attributes=require(_0x3bf4('0x8'));module['exports']=function(_0x39a91b,_0x26c281){return _0x39a91b[_0x3bf4('0x9')](_0x3bf4('0xa'),attributes,{'tableName':_0x3bf4('0xb'),'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 15f357b..b4f1d0f 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 _0x6c76=['request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Migration,\x20%s,\x20%s'];(function(_0x1824f0,_0x450d1c){var _0x22df10=function(_0x3d7a4f){while(--_0x3d7a4f){_0x1824f0['push'](_0x1824f0['shift']());}};_0x22df10(++_0x450d1c);}(_0x6c76,0x184));var _0x66c7=function(_0x40850a,_0x240159){_0x40850a=_0x40850a-0x0;var _0x3f6fca=_0x6c76[_0x40850a];return _0x3f6fca;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Migration,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Migration,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Migration,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});} \ No newline at end of file +var _0x8a9a=['message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x5c0129,_0x541aab){var _0x40cd3f=function(_0x15942d){while(--_0x15942d){_0x5c0129['push'](_0x5c0129['shift']());}};_0x40cd3f(++_0x541aab);}(_0x8a9a,0x193));var _0xa8a9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8a9a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa8a9('0x0'));var BPromise=require(_0xa8a9('0x1'));var rs=require(_0xa8a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8a9('0x3'))['db'];var utils=require(_0xa8a9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8a9('0x5'));var jayson=require(_0xa8a9('0x6'));var client=jayson[_0xa8a9('0x7')][_0xa8a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b3f08,_0x5c3c57,_0x47fda8){return new BPromise(function(_0x4414c6,_0x16dadc){return client[_0xa8a9('0x9')](_0x1b3f08,_0x47fda8)[_0xa8a9('0xa')](function(_0x242b63){logger[_0xa8a9('0xb')](_0xa8a9('0xc'),_0x5c3c57,'request\x20sent');logger[_0xa8a9('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x5c3c57,_0xa8a9('0xe'),JSON['stringify'](_0x242b63));if(_0x242b63[_0xa8a9('0xf')]){if(_0x242b63[_0xa8a9('0xf')][_0xa8a9('0x10')]===0x1f4){logger[_0xa8a9('0xf')](_0xa8a9('0xc'),_0x5c3c57,_0x242b63[_0xa8a9('0xf')]['message']);return _0x16dadc(_0x242b63['error'][_0xa8a9('0x11')]);}logger['error'](_0xa8a9('0xc'),_0x5c3c57,_0x242b63[_0xa8a9('0xf')][_0xa8a9('0x11')]);return _0x4414c6(_0x242b63[_0xa8a9('0xf')][_0xa8a9('0x11')]);}else{logger['info'](_0xa8a9('0xc'),_0x5c3c57,'request\x20sent');_0x4414c6(_0x242b63[_0xa8a9('0x12')]['message']);}})[_0xa8a9('0x13')](function(_0x3215b0){logger['error'](_0xa8a9('0xc'),_0x5c3c57,_0x3215b0);_0x16dadc(_0x3215b0);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 81eeae0..8b2baba 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 _0x7b77=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x8ea18d,_0x4f5e70){var _0x285c0d=function(_0xb604cf){while(--_0xb604cf){_0x8ea18d['push'](_0x8ea18d['shift']());}};_0x285c0d(++_0x4f5e70);}(_0x7b77,0x179));var _0x77b7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7b77[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var path=require(_0x77b7('0x2'));var timeout=require(_0x77b7('0x3'));var express=require('express');var router=express[_0x77b7('0x4')]();var fs_extra=require(_0x77b7('0x5'));var auth=require(_0x77b7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x77b7('0x7'));var controller=require(_0x77b7('0x8'));router[_0x77b7('0x9')]('/',auth[_0x77b7('0xa')](),controller[_0x77b7('0xb')]);router[_0x77b7('0x9')]('/:id',auth[_0x77b7('0xa')](),controller[_0x77b7('0xc')]);router[_0x77b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x77b7('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x77b7('0xf')]);router[_0x77b7('0x10')]('/:id',auth[_0x77b7('0xa')](),controller[_0x77b7('0x11')]);module[_0x77b7('0x12')]=router; \ No newline at end of file +var _0x2c24=['../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e4100,_0xc2be9c){var _0x22f675=function(_0x15eaec){while(--_0x15eaec){_0x5e4100['push'](_0x5e4100['shift']());}};_0x22f675(++_0xc2be9c);}(_0x2c24,0x1e6));var _0x42c2=function(_0x5ee438,_0x45d632){_0x5ee438=_0x5ee438-0x0;var _0x107efb=_0x2c24[_0x5ee438];return _0x107efb;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require(_0x42c2('0x3'));var express=require(_0x42c2('0x4'));var router=express[_0x42c2('0x5')]();var fs_extra=require(_0x42c2('0x6'));var auth=require(_0x42c2('0x7'));var interaction=require(_0x42c2('0x8'));var config=require('../../config/environment');var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0xe')]);router[_0x42c2('0xf')]('/',auth[_0x42c2('0xd')](),controller['create']);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x10')]);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index be7b9e1..90320ce 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 _0xc748=['stun','turn','STRING','exports','externip'];(function(_0x2568e8,_0x4622c3){var _0x4169fa=function(_0x1260af){while(--_0x1260af){_0x2568e8['push'](_0x2568e8['shift']());}};_0x4169fa(++_0x4622c3);}(_0xc748,0xa3));var _0x8c74=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xc748[_0x4b1032];return _0x5a1d55;};'use strict';var Sequelize=require('sequelize');module[_0x8c74('0x0')]={'type':{'type':Sequelize['ENUM']('localnet',_0x8c74('0x1'),_0x8c74('0x2'),_0x8c74('0x3'))},'value':{'type':Sequelize[_0x8c74('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca8d=['externip','stun','turn','STRING','sequelize','ENUM','localnet'];(function(_0x283cc1,_0x1f53be){var _0x27a2ec=function(_0x3fb88c){while(--_0x3fb88c){_0x283cc1['push'](_0x283cc1['shift']());}};_0x27a2ec(++_0x1f53be);}(_0xca8d,0xc1));var _0xdca8=function(_0x3168e1,_0xa046e0){_0x3168e1=_0x3168e1-0x0;var _0x13ad69=_0xca8d[_0x3168e1];return _0x13ad69;};'use strict';var Sequelize=require(_0xdca8('0x0'));module['exports']={'type':{'type':Sequelize[_0xdca8('0x1')](_0xdca8('0x2'),_0xdca8('0x3'),_0xdca8('0x4'),_0xdca8('0x5'))},'value':{'type':Sequelize[_0xdca8('0x6')]},'username':{'type':Sequelize[_0xdca8('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 45ff15a..ebbfb00 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 _0x6982=['sendStatus','send','index','map','Network','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','count','includeAll','findAll','include','find','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','params','/etc/asterisk/sip_xcally_%s.conf','path','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','limit','undefined','Content-Range','update','then','destroy'];(function(_0x566667,_0x3f99c2){var _0x277136=function(_0x129ea0){while(--_0x129ea0){_0x566667['push'](_0x566667['shift']());}};_0x277136(++_0x3f99c2);}(_0x6982,0x1c1));var _0x2698=function(_0x5708c8,_0x5a3bc3){_0x5708c8=_0x5708c8-0x0;var _0x595a01=_0x6982[_0x5708c8];return _0x595a01;};'use strict';var util=require('util');var path=require(_0x2698('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var qs=require(_0x2698('0x1'));var logger=require(_0x2698('0x2'))('api');var config=require(_0x2698('0x3'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2698('0x4'));var client=jayson[_0x2698('0x5')][_0x2698('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4c7899,_0x458dab,_0x5db5d1,_0x559642){return new Promise(function(_0x273b6f,_0x16abc9){var _0x24adae=_0x559642||client;return _0x24adae['request'](_0x4c7899,_0x5db5d1)['then'](function(_0x6bd155){logger[_0x2698('0x7')](_0x2698('0x8'),_0x458dab,_0x2698('0x9'));logger['debug'](_0x2698('0xa'),_0x458dab,_0x2698('0x9'),JSON['stringify'](_0x6bd155));if(_0x6bd155[_0x2698('0xb')]){if(_0x6bd155[_0x2698('0xb')][_0x2698('0xc')]===0x1f4){logger[_0x2698('0xb')](_0x2698('0x8'),_0x458dab,_0x6bd155[_0x2698('0xb')]['message']);return _0x16abc9(_0x6bd155[_0x2698('0xb')][_0x2698('0xd')]);}logger[_0x2698('0xb')](_0x2698('0x8'),_0x458dab,_0x6bd155['error'][_0x2698('0xd')]);return _0x273b6f(_0x6bd155[_0x2698('0xb')][_0x2698('0xd')]);}else{logger[_0x2698('0x7')](_0x2698('0x8'),_0x458dab,_0x2698('0x9'));_0x273b6f(_0x6bd155[_0x2698('0xe')]['message']);}})[_0x2698('0xf')](function(_0x347f59){logger[_0x2698('0xb')]('Network,\x20%s,\x20%s',_0x458dab,_0x347f59);_0x16abc9(_0x347f59);});});}function respondWithResult(_0x370529,_0x1924ac){_0x1924ac=_0x1924ac||0xc8;return function(_0x46f799){if(_0x46f799){return _0x370529[_0x2698('0x10')](_0x1924ac)[_0x2698('0x11')](_0x46f799);}};}function respondWithFilteredResult(_0x1f1d87,_0xc371a3){return function(_0x95313d){if(_0x95313d){var _0x4d7abe=typeof _0xc371a3[_0x2698('0x12')]==='undefined'&&typeof _0xc371a3[_0x2698('0x13')]===_0x2698('0x14');var _0x10d5db=_0x95313d['count'];var _0x1813e6=_0x4d7abe?0x0:_0xc371a3[_0x2698('0x12')];var _0x382485=_0x4d7abe?_0x95313d['count']:_0xc371a3[_0x2698('0x12')]+_0xc371a3[_0x2698('0x13')];var _0x107d02;if(_0x382485>=_0x10d5db){_0x382485=_0x10d5db;_0x107d02=0xc8;}else{_0x107d02=0xce;}_0x1f1d87['status'](_0x107d02);return _0x1f1d87['set'](_0x2698('0x15'),_0x1813e6+'-'+_0x382485+'/'+_0x10d5db)['json'](_0x95313d);}return null;};}function saveUpdates(_0x5b0418){return function(_0x69d15b){if(_0x69d15b){return _0x69d15b[_0x2698('0x16')](_0x5b0418)[_0x2698('0x17')](function(_0x1f9dc0){return _0x1f9dc0;});}return null;};}function removeEntity(_0x5db93e){return function(_0x242407){if(_0x242407){return _0x242407[_0x2698('0x18')]()[_0x2698('0x17')](function(){_0x5db93e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a28b9){return function(_0x2ff17a){if(!_0x2ff17a){_0x4a28b9[_0x2698('0x19')](0x194);}return _0x2ff17a;};}function handleError(_0x5f3497,_0x1fc91d){_0x1fc91d=_0x1fc91d||0x1f4;return function(_0x33427c){logger[_0x2698('0xb')](_0x33427c['stack']);if(_0x33427c['name']){delete _0x33427c['name'];}_0x5f3497[_0x2698('0x10')](_0x1fc91d)[_0x2698('0x1a')](_0x33427c);};}exports[_0x2698('0x1b')]=function(_0x2735c2,_0x47b990){var _0x1d771f={},_0x47fe71={},_0x4ed0b2={'count':0x0,'rows':[]};var _0x26f015=_[_0x2698('0x1c')](db[_0x2698('0x1d')][_0x2698('0x1e')],function(_0x472b0a){return{'name':_0x472b0a[_0x2698('0x1f')],'type':_0x472b0a[_0x2698('0x20')]['key']};});_0x47fe71['model']=_[_0x2698('0x1c')](_0x26f015,'name');_0x47fe71[_0x2698('0x21')]=_[_0x2698('0x22')](_0x2735c2[_0x2698('0x21')]);_0x47fe71[_0x2698('0x23')]=_[_0x2698('0x24')](_0x47fe71[_0x2698('0x25')],_0x47fe71[_0x2698('0x21')]);_0x1d771f[_0x2698('0x26')]=_['intersection'](_0x47fe71[_0x2698('0x25')],qs[_0x2698('0x27')](_0x2735c2[_0x2698('0x21')]['fields']));_0x1d771f[_0x2698('0x26')]=_0x1d771f[_0x2698('0x26')][_0x2698('0x28')]?_0x1d771f[_0x2698('0x26')]:_0x47fe71['model'];if(!_0x2735c2['query'][_0x2698('0x29')]('nolimit')){_0x1d771f[_0x2698('0x13')]=qs[_0x2698('0x13')](_0x2735c2[_0x2698('0x21')][_0x2698('0x13')]);_0x1d771f[_0x2698('0x12')]=qs['offset'](_0x2735c2[_0x2698('0x21')]['offset']);}_0x1d771f[_0x2698('0x2a')]=qs[_0x2698('0x2b')](_0x2735c2[_0x2698('0x21')][_0x2698('0x2b')]);_0x1d771f[_0x2698('0x2c')]=qs[_0x2698('0x23')](_[_0x2698('0x2d')](_0x2735c2[_0x2698('0x21')],_0x47fe71[_0x2698('0x23')]),_0x26f015);if(_0x2735c2[_0x2698('0x21')][_0x2698('0x2e')]){_0x1d771f['where']=_[_0x2698('0x2f')](_0x1d771f['where'],{'$or':_['map'](_0x26f015,function(_0x2fbd3b){if(_0x2fbd3b[_0x2698('0x20')]!==_0x2698('0x30')){var _0x20ffe9={};_0x20ffe9[_0x2fbd3b[_0x2698('0x31')]]={'$like':'%'+_0x2735c2[_0x2698('0x21')][_0x2698('0x2e')]+'%'};return _0x20ffe9;}})});}_0x1d771f=_['merge']({},_0x1d771f,_0x2735c2[_0x2698('0x32')]);var _0x223655={'where':_0x1d771f[_0x2698('0x2c')]};return db[_0x2698('0x1d')][_0x2698('0x33')](_0x223655)['then'](function(_0x2a03be){_0x4ed0b2['count']=_0x2a03be;if(_0x2735c2[_0x2698('0x21')][_0x2698('0x34')]){_0x1d771f['include']=[{'all':!![]}];}return db['Network'][_0x2698('0x35')](_0x1d771f);})[_0x2698('0x17')](function(_0x180d28){_0x4ed0b2['rows']=_0x180d28;return _0x4ed0b2;})[_0x2698('0x17')](respondWithFilteredResult(_0x47b990,_0x1d771f))[_0x2698('0xf')](handleError(_0x47b990,null));};exports['show']=function(_0x49ba0e,_0x395455){var _0x2d6508={'raw':!![],'where':{'id':_0x49ba0e['params']['id']}},_0x900e82={};_0x900e82['model']=_[_0x2698('0x22')](db['Network'][_0x2698('0x1e')]);_0x900e82[_0x2698('0x21')]=_['keys'](_0x49ba0e[_0x2698('0x21')]);_0x900e82[_0x2698('0x23')]=_[_0x2698('0x24')](_0x900e82[_0x2698('0x25')],_0x900e82[_0x2698('0x21')]);_0x2d6508[_0x2698('0x26')]=_[_0x2698('0x24')](_0x900e82[_0x2698('0x25')],qs['fields'](_0x49ba0e[_0x2698('0x21')][_0x2698('0x27')]));_0x2d6508['attributes']=_0x2d6508[_0x2698('0x26')][_0x2698('0x28')]?_0x2d6508['attributes']:_0x900e82[_0x2698('0x25')];if(_0x49ba0e[_0x2698('0x21')][_0x2698('0x34')]){_0x2d6508[_0x2698('0x36')]=[{'all':!![]}];}_0x2d6508=_[_0x2698('0x2f')]({},_0x2d6508,_0x49ba0e[_0x2698('0x32')]);return db[_0x2698('0x1d')][_0x2698('0x37')](_0x2d6508)['then'](handleEntityNotFound(_0x395455,null))[_0x2698('0x17')](respondWithResult(_0x395455,null))[_0x2698('0xf')](handleError(_0x395455,null));};exports[_0x2698('0x38')]=function(_0x1f8370,_0x342359){var _0x974c5;return db[_0x2698('0x1d')][_0x2698('0x38')](_0x1f8370[_0x2698('0x39')],{'raw':!![]})[_0x2698('0x17')](function(_0x2933c1){_0x974c5=_0x2933c1;return db[_0x2698('0x1d')]['findAll']({'where':{'type':_0x1f8370[_0x2698('0x39')][_0x2698('0x20')]},'raw':!![]});})['then'](function(_0x27d353){if(_0x974c5[_0x2698('0x20')]['toUpperCase']()==_0x2698('0x3a')){var _0xf82510=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x3e')),_0x2698('0x3f'));var _0x4830d6=ejs[_0x2698('0x40')](_0xf82510,{'networks':_0x27d353||[]});fs['writeFileSync'](_0x2698('0x41'),_0x4830d6);return respondWithRpcPromise(_0x2698('0x42'),'create',{'module':_0x2698('0x43')});}else if(_0x974c5[_0x2698('0x20')][_0x2698('0x44')]()==_0x2698('0x45')){var _0x551818=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x46')),'utf8');var _0x1504e6=ejs['render'](_0x551818,{'networks':_0x27d353||[]});fs[_0x2698('0x47')](_0x2698('0x48'),_0x1504e6);return respondWithRpcPromise(_0x2698('0x42'),_0x2698('0x38'),{'module':_0x2698('0x43')});}else{var _0x2a0f57=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config['root'],_0x2698('0x49')),_0x2698('0x3f'));var _0x38a4ec=ejs[_0x2698('0x40')](_0x2a0f57,{'networks':_0x27d353||[]});fs[_0x2698('0x47')](util[_0x2698('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x1f8370[_0x2698('0x39')]['type'][_0x2698('0x4b')]()),_0x38a4ec);return respondWithRpcPromise(_0x2698('0x42'),_0x2698('0x38'),{'module':_0x2698('0x4c')});}})[_0x2698('0x17')](function(){return _0x974c5;})[_0x2698('0x17')](respondWithResult(_0x342359,0xc9))['catch'](handleError(_0x342359,null));};exports[_0x2698('0x16')]=function(_0x1d7b5f,_0x5da1a0){var _0x9318b6;return db['Network']['find']({'where':{'id':_0x1d7b5f[_0x2698('0x4d')]['id']}})[_0x2698('0x17')](handleEntityNotFound(_0x5da1a0,null))['then'](saveUpdates(_0x1d7b5f[_0x2698('0x39')],null))['then'](function(_0x2e85b5){if(_0x2e85b5){_0x9318b6=_0x2e85b5;return db[_0x2698('0x1d')]['findAll']({'where':{'type':_0x9318b6[_0x2698('0x20')]},'raw':!![]});}return null;})[_0x2698('0x17')](function(_0x360521){if(_0x9318b6[_0x2698('0x20')][_0x2698('0x44')]()==_0x2698('0x3a')){var _0x6ddfc6=fs['readFileSync'](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x3e')),'utf8');var _0x43b289=ejs['render'](_0x6ddfc6,{'networks':_0x360521||[]});fs[_0x2698('0x47')]('/etc/asterisk/stun_xcally.conf',_0x43b289);return respondWithRpcPromise(_0x2698('0x42'),_0x2698('0x16'),{'module':'res_stun_monitor.so'});}else if(_0x9318b6[_0x2698('0x20')][_0x2698('0x44')]()=='TURN'){var _0x9acde=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],'server/files/templates/turn_multiple.ejs'),_0x2698('0x3f'));var _0x45292a=ejs[_0x2698('0x40')](_0x9acde,{'networks':_0x360521||[]});fs[_0x2698('0x47')](_0x2698('0x48'),_0x45292a);return respondWithRpcPromise(_0x2698('0x42'),_0x2698('0x16'),{'module':_0x2698('0x43')});}else{var _0x4153d6=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x49')),_0x2698('0x3f'));var _0x415c0a=ejs['render'](_0x4153d6,{'networks':_0x360521||[]});fs['writeFileSync'](util[_0x2698('0x4a')](_0x2698('0x4e'),_0x1d7b5f[_0x2698('0x39')][_0x2698('0x20')]['toLowerCase']()),_0x415c0a);return respondWithRpcPromise('Reload',_0x2698('0x16'),{'module':'chan_sip.so'});}})[_0x2698('0x17')](function(_0x261761){if(_0x261761){return _0x9318b6;}return null;})[_0x2698('0x17')](respondWithResult(_0x5da1a0,null))[_0x2698('0xf')](handleError(_0x5da1a0,null));};exports[_0x2698('0x18')]=function(_0x5affb3,_0x4a93d1){var _0x59fc68;return db[_0x2698('0x1d')]['find']({'where':{'id':_0x5affb3[_0x2698('0x4d')]['id']}})[_0x2698('0x17')](function(_0x75600f){_0x59fc68=_0x75600f;return _0x75600f;})[_0x2698('0x17')](handleEntityNotFound(_0x4a93d1,null))[_0x2698('0x17')](removeEntity(_0x4a93d1,null))[_0x2698('0x17')](function(){if(_0x59fc68){return db[_0x2698('0x1d')]['findAll']({'where':{'type':_0x59fc68['type']},'raw':!![]});}})[_0x2698('0x17')](function(_0x5630e1){if(_0x59fc68[_0x2698('0x20')][_0x2698('0x44')]()=='STUN'){var _0x51bbe8=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x3e')),_0x2698('0x3f'));var _0x2d3df1=ejs[_0x2698('0x40')](_0x51bbe8,{'networks':_0x5630e1||[]});fs[_0x2698('0x47')](_0x2698('0x41'),_0x2d3df1);return respondWithRpcPromise('Reload','destroy',{'module':_0x2698('0x43')});}else if(_0x59fc68[_0x2698('0x20')][_0x2698('0x44')]()=='TURN'){var _0x1eea7e=fs['readFileSync'](path['join'](config[_0x2698('0x3d')],_0x2698('0x46')),'utf8');var _0x24bc57=ejs[_0x2698('0x40')](_0x1eea7e,{'networks':_0x5630e1||[]});fs[_0x2698('0x47')](_0x2698('0x48'),_0x24bc57);return respondWithRpcPromise('Reload',_0x2698('0x18'),{'module':'res_stun_monitor.so'});}else{var _0x1b1d6f=fs[_0x2698('0x3b')](path[_0x2698('0x3c')](config[_0x2698('0x3d')],_0x2698('0x49')),_0x2698('0x3f'));var _0x366b6=ejs[_0x2698('0x40')](_0x1b1d6f,{'networks':_0x5630e1||[]});fs['writeFileSync'](util[_0x2698('0x4a')](_0x2698('0x4e'),_0x59fc68[_0x2698('0x20')][_0x2698('0x4b')]()),_0x366b6);return respondWithRpcPromise(_0x2698('0x42'),_0x2698('0x18'),{'module':_0x2698('0x4c')});}})['catch'](handleError(_0x4a93d1,null));}; \ No newline at end of file +var _0x5140=['status','offset','undefined','limit','set','Content-Range','json','destroy','end','sendStatus','stack','name','send','map','Network','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','show','params','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','find','format','chan_sip.so','util','ejs','../../components/parsers/qs','api','jayson/promise','http','then','info','request\x20sent','debug','error','code','Network,\x20%s,\x20%s','message','result','catch'];(function(_0x51cd23,_0x273cbe){var _0x22f2c8=function(_0x515cd5){while(--_0x515cd5){_0x51cd23['push'](_0x51cd23['shift']());}};_0x22f2c8(++_0x273cbe);}(_0x5140,0xe6));var _0x0514=function(_0x5ceedf,_0x3bc004){_0x5ceedf=_0x5ceedf-0x0;var _0x1976dd=_0x5140[_0x5ceedf];return _0x1976dd;};'use strict';var util=require(_0x0514('0x0'));var path=require('path');var ejs=require(_0x0514('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x0514('0x2'));var logger=require('../../config/logger')(_0x0514('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0514('0x4'));var client=jayson['client'][_0x0514('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3d3aae,_0x23ff4c,_0x102b7f,_0x281f38){return new Promise(function(_0x287ca2,_0x1cf829){var _0x507bde=_0x281f38||client;return _0x507bde['request'](_0x3d3aae,_0x102b7f)[_0x0514('0x6')](function(_0x3cfe0e){logger[_0x0514('0x7')]('Network,\x20%s,\x20%s',_0x23ff4c,_0x0514('0x8'));logger[_0x0514('0x9')]('Network,\x20%s,\x20%s,\x20%s',_0x23ff4c,_0x0514('0x8'),JSON['stringify'](_0x3cfe0e));if(_0x3cfe0e[_0x0514('0xa')]){if(_0x3cfe0e[_0x0514('0xa')][_0x0514('0xb')]===0x1f4){logger[_0x0514('0xa')](_0x0514('0xc'),_0x23ff4c,_0x3cfe0e[_0x0514('0xa')][_0x0514('0xd')]);return _0x1cf829(_0x3cfe0e[_0x0514('0xa')][_0x0514('0xd')]);}logger[_0x0514('0xa')](_0x0514('0xc'),_0x23ff4c,_0x3cfe0e['error'][_0x0514('0xd')]);return _0x287ca2(_0x3cfe0e['error'][_0x0514('0xd')]);}else{logger[_0x0514('0x7')](_0x0514('0xc'),_0x23ff4c,_0x0514('0x8'));_0x287ca2(_0x3cfe0e[_0x0514('0xe')][_0x0514('0xd')]);}})[_0x0514('0xf')](function(_0x2ac99b){logger[_0x0514('0xa')]('Network,\x20%s,\x20%s',_0x23ff4c,_0x2ac99b);_0x1cf829(_0x2ac99b);});});}function respondWithResult(_0xcd73d8,_0x272c6c){_0x272c6c=_0x272c6c||0xc8;return function(_0x4f6fb0){if(_0x4f6fb0){return _0xcd73d8[_0x0514('0x10')](_0x272c6c)['json'](_0x4f6fb0);}};}function respondWithFilteredResult(_0x23bb2e,_0x26c14f){return function(_0x1c7f1b){if(_0x1c7f1b){var _0x372b4a=typeof _0x26c14f[_0x0514('0x11')]===_0x0514('0x12')&&typeof _0x26c14f[_0x0514('0x13')]===_0x0514('0x12');var _0x48b5a7=_0x1c7f1b['count'];var _0x3447b4=_0x372b4a?0x0:_0x26c14f[_0x0514('0x11')];var _0x139e91=_0x372b4a?_0x1c7f1b['count']:_0x26c14f[_0x0514('0x11')]+_0x26c14f[_0x0514('0x13')];var _0x5a321e;if(_0x139e91>=_0x48b5a7){_0x139e91=_0x48b5a7;_0x5a321e=0xc8;}else{_0x5a321e=0xce;}_0x23bb2e['status'](_0x5a321e);return _0x23bb2e[_0x0514('0x14')](_0x0514('0x15'),_0x3447b4+'-'+_0x139e91+'/'+_0x48b5a7)[_0x0514('0x16')](_0x1c7f1b);}return null;};}function saveUpdates(_0x2127b7){return function(_0x32981b){if(_0x32981b){return _0x32981b['update'](_0x2127b7)[_0x0514('0x6')](function(_0x348570){return _0x348570;});}return null;};}function removeEntity(_0x12d3a9){return function(_0x4ae2b9){if(_0x4ae2b9){return _0x4ae2b9[_0x0514('0x17')]()[_0x0514('0x6')](function(){_0x12d3a9[_0x0514('0x10')](0xcc)[_0x0514('0x18')]();});}};}function handleEntityNotFound(_0x1329d2){return function(_0x37afa3){if(!_0x37afa3){_0x1329d2[_0x0514('0x19')](0x194);}return _0x37afa3;};}function handleError(_0x381d27,_0x582b07){_0x582b07=_0x582b07||0x1f4;return function(_0x48d3c4){logger[_0x0514('0xa')](_0x48d3c4[_0x0514('0x1a')]);if(_0x48d3c4['name']){delete _0x48d3c4[_0x0514('0x1b')];}_0x381d27[_0x0514('0x10')](_0x582b07)[_0x0514('0x1c')](_0x48d3c4);};}exports['index']=function(_0x373de1,_0x7b9190){var _0x51bf6a={},_0x21487a={},_0xf17c4e={'count':0x0,'rows':[]};var _0x35fde2=_[_0x0514('0x1d')](db[_0x0514('0x1e')][_0x0514('0x1f')],function(_0x3fd359){return{'name':_0x3fd359['fieldName'],'type':_0x3fd359[_0x0514('0x20')][_0x0514('0x21')]};});_0x21487a[_0x0514('0x22')]=_['map'](_0x35fde2,_0x0514('0x1b'));_0x21487a[_0x0514('0x23')]=_[_0x0514('0x24')](_0x373de1['query']);_0x21487a['filters']=_[_0x0514('0x25')](_0x21487a['model'],_0x21487a['query']);_0x51bf6a[_0x0514('0x26')]=_['intersection'](_0x21487a[_0x0514('0x22')],qs[_0x0514('0x27')](_0x373de1[_0x0514('0x23')][_0x0514('0x27')]));_0x51bf6a['attributes']=_0x51bf6a[_0x0514('0x26')][_0x0514('0x28')]?_0x51bf6a[_0x0514('0x26')]:_0x21487a[_0x0514('0x22')];if(!_0x373de1[_0x0514('0x23')][_0x0514('0x29')](_0x0514('0x2a'))){_0x51bf6a[_0x0514('0x13')]=qs['limit'](_0x373de1[_0x0514('0x23')][_0x0514('0x13')]);_0x51bf6a[_0x0514('0x11')]=qs[_0x0514('0x11')](_0x373de1['query'][_0x0514('0x11')]);}_0x51bf6a[_0x0514('0x2b')]=qs['sort'](_0x373de1[_0x0514('0x23')][_0x0514('0x2c')]);_0x51bf6a['where']=qs['filters'](_[_0x0514('0x2d')](_0x373de1[_0x0514('0x23')],_0x21487a[_0x0514('0x2e')]),_0x35fde2);if(_0x373de1[_0x0514('0x23')][_0x0514('0x2f')]){_0x51bf6a['where']=_[_0x0514('0x30')](_0x51bf6a[_0x0514('0x31')],{'$or':_[_0x0514('0x1d')](_0x35fde2,function(_0x57c916){if(_0x57c916[_0x0514('0x20')]!==_0x0514('0x32')){var _0x104a6e={};_0x104a6e[_0x57c916[_0x0514('0x1b')]]={'$like':'%'+_0x373de1[_0x0514('0x23')][_0x0514('0x2f')]+'%'};return _0x104a6e;}})});}_0x51bf6a=_[_0x0514('0x30')]({},_0x51bf6a,_0x373de1[_0x0514('0x33')]);var _0x38f5d3={'where':_0x51bf6a[_0x0514('0x31')]};return db[_0x0514('0x1e')][_0x0514('0x34')](_0x38f5d3)[_0x0514('0x6')](function(_0x4baf3e){_0xf17c4e['count']=_0x4baf3e;if(_0x373de1[_0x0514('0x23')][_0x0514('0x35')]){_0x51bf6a[_0x0514('0x36')]=[{'all':!![]}];}return db[_0x0514('0x1e')][_0x0514('0x37')](_0x51bf6a);})[_0x0514('0x6')](function(_0x539f8c){_0xf17c4e['rows']=_0x539f8c;return _0xf17c4e;})[_0x0514('0x6')](respondWithFilteredResult(_0x7b9190,_0x51bf6a))[_0x0514('0xf')](handleError(_0x7b9190,null));};exports[_0x0514('0x38')]=function(_0x58d43f,_0x4de16c){var _0xbb8c0e={'raw':!![],'where':{'id':_0x58d43f[_0x0514('0x39')]['id']}},_0x2470b5={};_0x2470b5[_0x0514('0x22')]=_['keys'](db[_0x0514('0x1e')]['rawAttributes']);_0x2470b5[_0x0514('0x23')]=_[_0x0514('0x24')](_0x58d43f[_0x0514('0x23')]);_0x2470b5[_0x0514('0x2e')]=_[_0x0514('0x25')](_0x2470b5[_0x0514('0x22')],_0x2470b5[_0x0514('0x23')]);_0xbb8c0e[_0x0514('0x26')]=_[_0x0514('0x25')](_0x2470b5[_0x0514('0x22')],qs[_0x0514('0x27')](_0x58d43f[_0x0514('0x23')][_0x0514('0x27')]));_0xbb8c0e[_0x0514('0x26')]=_0xbb8c0e[_0x0514('0x26')]['length']?_0xbb8c0e[_0x0514('0x26')]:_0x2470b5[_0x0514('0x22')];if(_0x58d43f[_0x0514('0x23')][_0x0514('0x35')]){_0xbb8c0e[_0x0514('0x36')]=[{'all':!![]}];}_0xbb8c0e=_['merge']({},_0xbb8c0e,_0x58d43f[_0x0514('0x33')]);return db[_0x0514('0x1e')]['find'](_0xbb8c0e)[_0x0514('0x6')](handleEntityNotFound(_0x4de16c,null))['then'](respondWithResult(_0x4de16c,null))['catch'](handleError(_0x4de16c,null));};exports[_0x0514('0x3a')]=function(_0x54b43f,_0x5bcae9){var _0x165ac2;return db[_0x0514('0x1e')][_0x0514('0x3a')](_0x54b43f['body'],{'raw':!![]})[_0x0514('0x6')](function(_0x298c4f){_0x165ac2=_0x298c4f;return db[_0x0514('0x1e')]['findAll']({'where':{'type':_0x54b43f[_0x0514('0x3b')]['type']},'raw':!![]});})[_0x0514('0x6')](function(_0xbd3b4e){if(_0x165ac2[_0x0514('0x20')][_0x0514('0x3c')]()==_0x0514('0x3d')){var _0x52e89b=fs[_0x0514('0x3e')](path['join'](config[_0x0514('0x3f')],_0x0514('0x40')),_0x0514('0x41'));var _0x30c746=ejs['render'](_0x52e89b,{'networks':_0xbd3b4e||[]});fs[_0x0514('0x42')](_0x0514('0x43'),_0x30c746);return respondWithRpcPromise(_0x0514('0x44'),'create',{'module':_0x0514('0x45')});}else if(_0x165ac2['type'][_0x0514('0x3c')]()==_0x0514('0x46')){var _0x55f745=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x48')),_0x0514('0x41'));var _0x324c20=ejs[_0x0514('0x49')](_0x55f745,{'networks':_0xbd3b4e||[]});fs[_0x0514('0x42')](_0x0514('0x4a'),_0x324c20);return respondWithRpcPromise(_0x0514('0x44'),'create',{'module':'res_stun_monitor.so'});}else{var _0x5bb679=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x4b')),_0x0514('0x41'));var _0x3ea216=ejs['render'](_0x5bb679,{'networks':_0xbd3b4e||[]});fs[_0x0514('0x42')](util['format'](_0x0514('0x4c'),_0x54b43f[_0x0514('0x3b')][_0x0514('0x20')][_0x0514('0x4d')]()),_0x3ea216);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x3a'),{'module':'chan_sip.so'});}})[_0x0514('0x6')](function(){return _0x165ac2;})['then'](respondWithResult(_0x5bcae9,0xc9))['catch'](handleError(_0x5bcae9,null));};exports[_0x0514('0x4e')]=function(_0x64ab3,_0x1f4ae6){var _0x30d20f;return db[_0x0514('0x1e')][_0x0514('0x4f')]({'where':{'id':_0x64ab3[_0x0514('0x39')]['id']}})[_0x0514('0x6')](handleEntityNotFound(_0x1f4ae6,null))[_0x0514('0x6')](saveUpdates(_0x64ab3[_0x0514('0x3b')],null))[_0x0514('0x6')](function(_0x285992){if(_0x285992){_0x30d20f=_0x285992;return db['Network'][_0x0514('0x37')]({'where':{'type':_0x30d20f['type']},'raw':!![]});}return null;})[_0x0514('0x6')](function(_0x27f3cc){if(_0x30d20f[_0x0514('0x20')][_0x0514('0x3c')]()=='STUN'){var _0x72554d=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x40')),_0x0514('0x41'));var _0x27c987=ejs[_0x0514('0x49')](_0x72554d,{'networks':_0x27f3cc||[]});fs[_0x0514('0x42')](_0x0514('0x43'),_0x27c987);return respondWithRpcPromise('Reload',_0x0514('0x4e'),{'module':_0x0514('0x45')});}else if(_0x30d20f[_0x0514('0x20')][_0x0514('0x3c')]()==_0x0514('0x46')){var _0x281009=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x48')),_0x0514('0x41'));var _0x163220=ejs[_0x0514('0x49')](_0x281009,{'networks':_0x27f3cc||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x163220);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x4e'),{'module':_0x0514('0x45')});}else{var _0x59798d=fs[_0x0514('0x3e')](path['join'](config[_0x0514('0x3f')],_0x0514('0x4b')),_0x0514('0x41'));var _0x12d211=ejs[_0x0514('0x49')](_0x59798d,{'networks':_0x27f3cc||[]});fs[_0x0514('0x42')](util[_0x0514('0x50')](_0x0514('0x4c'),_0x64ab3['body'][_0x0514('0x20')]['toLowerCase']()),_0x12d211);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x4e'),{'module':_0x0514('0x51')});}})[_0x0514('0x6')](function(_0x42de52){if(_0x42de52){return _0x30d20f;}return null;})[_0x0514('0x6')](respondWithResult(_0x1f4ae6,null))[_0x0514('0xf')](handleError(_0x1f4ae6,null));};exports['destroy']=function(_0x13a680,_0x45b6c1){var _0x5ed4fc;return db[_0x0514('0x1e')][_0x0514('0x4f')]({'where':{'id':_0x13a680[_0x0514('0x39')]['id']}})[_0x0514('0x6')](function(_0x26f2a5){_0x5ed4fc=_0x26f2a5;return _0x26f2a5;})[_0x0514('0x6')](handleEntityNotFound(_0x45b6c1,null))[_0x0514('0x6')](removeEntity(_0x45b6c1,null))[_0x0514('0x6')](function(){if(_0x5ed4fc){return db[_0x0514('0x1e')][_0x0514('0x37')]({'where':{'type':_0x5ed4fc['type']},'raw':!![]});}})[_0x0514('0x6')](function(_0x6da402){if(_0x5ed4fc['type'][_0x0514('0x3c')]()==_0x0514('0x3d')){var _0x4c0a3f=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x40')),_0x0514('0x41'));var _0x56682a=ejs[_0x0514('0x49')](_0x4c0a3f,{'networks':_0x6da402||[]});fs[_0x0514('0x42')](_0x0514('0x43'),_0x56682a);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x17'),{'module':_0x0514('0x45')});}else if(_0x5ed4fc['type'][_0x0514('0x3c')]()=='TURN'){var _0x5bea68=fs['readFileSync'](path[_0x0514('0x47')](config[_0x0514('0x3f')],_0x0514('0x48')),_0x0514('0x41'));var _0xd8431d=ejs[_0x0514('0x49')](_0x5bea68,{'networks':_0x6da402||[]});fs[_0x0514('0x42')](_0x0514('0x4a'),_0xd8431d);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x17'),{'module':_0x0514('0x45')});}else{var _0x5040c8=fs[_0x0514('0x3e')](path[_0x0514('0x47')](config[_0x0514('0x3f')],'server/files/templates/network.ejs'),_0x0514('0x41'));var _0x227fa1=ejs[_0x0514('0x49')](_0x5040c8,{'networks':_0x6da402||[]});fs[_0x0514('0x42')](util[_0x0514('0x50')](_0x0514('0x4c'),_0x5ed4fc[_0x0514('0x20')][_0x0514('0x4d')]()),_0x227fa1);return respondWithRpcPromise(_0x0514('0x44'),_0x0514('0x17'),{'module':_0x0514('0x51')});}})['catch'](handleError(_0x45b6c1,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e0f8d64..86ebdb5 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 _0xc3fe=['request-promise','rimraf','../../config/environment','./network.attributes','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0xaa63b5,_0xc4ee62){var _0x417bf9=function(_0x2c912c){while(--_0x2c912c){_0xaa63b5['push'](_0xaa63b5['shift']());}};_0x417bf9(++_0xc4ee62);}(_0xc3fe,0xff));var _0xec3f=function(_0x1d506a,_0x4fc4a0){_0x1d506a=_0x1d506a-0x0;var _0x5edd79=_0xc3fe[_0x1d506a];return _0x5edd79;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var logger=require(_0xec3f('0x2'))('api');var moment=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var rp=require(_0xec3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec3f('0x6'));var config=require(_0xec3f('0x7'));var attributes=require(_0xec3f('0x8'));module['exports']=function(_0x4fb9aa,_0x2d5b29){return _0x4fb9aa[_0xec3f('0x9')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa902=['../../config/logger','api','moment','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa902,0x8d));var _0x2a90=function(_0x55d50c,_0x2ac2b4){_0x55d50c=_0x55d50c-0x0;var _0xee1ce1=_0xa902[_0x55d50c];return _0xee1ce1;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))(_0x2a90('0x3'));var moment=require(_0x2a90('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a90('0x6'));var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x21e1d2,_0x4a32c7){return _0x21e1d2[_0x2a90('0x9')]('Network',attributes,{'tableName':_0x2a90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 487b594..efb4127 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27efc8,_0x1dbb5c){var _0x4a3c6a=function(_0x3957a7){while(--_0x3957a7){_0x27efc8['push'](_0x27efc8['shift']());}};_0x4a3c6a(++_0x1dbb5c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +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(_0x44ca11,_0x4f2109){_0x44ca11=_0x44ca11-0x0;var _0x190443=_0x7a54[_0x44ca11];return _0x190443;};'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 24359ac..5733b77 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 _0x1575=['get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','removeAnswers','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1575,0x94));var _0x5157=function(_0x202c99,_0x121caf){_0x202c99=_0x202c99-0x0;var _0x256a0f=_0x1575[_0x202c99];return _0x256a0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5157('0x0'));var timeout=require('connect-timeout');var express=require(_0x5157('0x1'));var router=express[_0x5157('0x2')]();var fs_extra=require(_0x5157('0x3'));var auth=require(_0x5157('0x4'));var interaction=require(_0x5157('0x5'));var config=require(_0x5157('0x6'));var controller=require(_0x5157('0x7'));router[_0x5157('0x8')]('/',auth['isAuthenticated'](),controller[_0x5157('0x9')]);router[_0x5157('0x8')]('/describe',auth[_0x5157('0xa')](),controller[_0x5157('0xb')]);router[_0x5157('0x8')](_0x5157('0xc'),auth[_0x5157('0xa')](),controller[_0x5157('0xd')]);router['get'](_0x5157('0xe'),auth[_0x5157('0xa')](),controller[_0x5157('0xf')]);router[_0x5157('0x8')](_0x5157('0x10'),auth[_0x5157('0xa')](),controller[_0x5157('0x11')]);router[_0x5157('0x8')](_0x5157('0x12'),auth[_0x5157('0xa')](),controller['getApplications']);router[_0x5157('0x8')](_0x5157('0x13'),auth[_0x5157('0xa')](),controller[_0x5157('0x14')]);router[_0x5157('0x8')](_0x5157('0x15'),auth['isAuthenticated'](),controller[_0x5157('0x16')]);router[_0x5157('0x17')]('/',auth['isAuthenticated'](),controller[_0x5157('0x18')]);router['post'](_0x5157('0xe'),auth[_0x5157('0xa')](),controller[_0x5157('0x19')]);router[_0x5157('0x17')](_0x5157('0x10'),auth[_0x5157('0xa')](),controller[_0x5157('0x1a')]);router[_0x5157('0x17')](_0x5157('0x1b'),controller[_0x5157('0x1c')]);router[_0x5157('0x17')]('/:id/applications',auth[_0x5157('0xa')](),controller[_0x5157('0x1d')]);router[_0x5157('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x5157('0x1e')]);router[_0x5157('0x17')](_0x5157('0x1f'),auth['isAuthenticated'](),controller[_0x5157('0x20')]);router[_0x5157('0x21')](_0x5157('0xc'),auth[_0x5157('0xa')](),controller[_0x5157('0x22')]);router[_0x5157('0x23')](_0x5157('0xc'),auth[_0x5157('0xa')](),controller['destroy']);router[_0x5157('0x23')](_0x5157('0xe'),auth[_0x5157('0xa')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x5157('0xa')](),controller[_0x5157('0x24')]);router[_0x5157('0x23')](_0x5157('0x15'),auth[_0x5157('0xa')](),controller[_0x5157('0x25')]);module[_0x5157('0x26')]=router; \ No newline at end of file +var _0xa242=['index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa242,0x19c));var _0x2a24=function(_0x2ec05f,_0x3b757b){_0x2ec05f=_0x2ec05f-0x0;var _0x1c4f67=_0xa242[_0x2ec05f];return _0x1c4f67;};'use strict';var multer=require('multer');var util=require(_0x2a24('0x0'));var path=require('path');var timeout=require(_0x2a24('0x1'));var express=require(_0x2a24('0x2'));var router=express[_0x2a24('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2a24('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2a24('0x5'));router[_0x2a24('0x6')]('/',auth[_0x2a24('0x7')](),controller[_0x2a24('0x8')]);router[_0x2a24('0x6')]('/describe',auth[_0x2a24('0x7')](),controller[_0x2a24('0x9')]);router[_0x2a24('0x6')](_0x2a24('0xa'),auth['isAuthenticated'](),controller[_0x2a24('0xb')]);router[_0x2a24('0x6')](_0x2a24('0xc'),auth[_0x2a24('0x7')](),controller[_0x2a24('0xd')]);router[_0x2a24('0x6')]('/:id/canned_answers',auth[_0x2a24('0x7')](),controller[_0x2a24('0xe')]);router[_0x2a24('0x6')](_0x2a24('0xf'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x10')]);router['get']('/:id/interactions',auth[_0x2a24('0x7')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x2a24('0x7')](),controller['getAgents']);router[_0x2a24('0x11')]('/',auth[_0x2a24('0x7')](),controller['create']);router[_0x2a24('0x11')](_0x2a24('0xc'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x12')]);router['post'](_0x2a24('0x13'),auth['isAuthenticated'](),controller[_0x2a24('0x14')]);router['post'](_0x2a24('0x15'),controller[_0x2a24('0x16')]);router[_0x2a24('0x11')](_0x2a24('0xf'),auth['isAuthenticated'](),controller[_0x2a24('0x17')]);router['post']('/:id/users',auth[_0x2a24('0x7')](),controller[_0x2a24('0x18')]);router[_0x2a24('0x11')]('/:id/send',auth['isAuthenticated'](),controller[_0x2a24('0x19')]);router[_0x2a24('0x1a')]('/:id',auth[_0x2a24('0x7')](),controller[_0x2a24('0x1b')]);router[_0x2a24('0x1c')](_0x2a24('0xa'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x1d')]);router[_0x2a24('0x1c')](_0x2a24('0xc'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x1e')]);router[_0x2a24('0x1c')](_0x2a24('0x13'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x1f')]);router['delete'](_0x2a24('0x20'),auth[_0x2a24('0x7')](),controller[_0x2a24('0x21')]);module[_0x2a24('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 2cb4268..c329726 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 _0x974b=['exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3340c8,_0x3d67d7){var _0x30ca8a=function(_0x435fff){while(--_0x435fff){_0x3340c8['push'](_0x3340c8['shift']());}};_0x30ca8a(++_0x3d67d7);}(_0x974b,0xbf));var _0xb974=function(_0x3f5d1a,_0x33400b){_0x3f5d1a=_0x3f5d1a-0x0;var _0x2db38a=_0x974b[_0x3f5d1a];return _0x2db38a;};'use strict';var Sequelize=require(_0xb974('0x0'));var rs=require('randomstring');module[_0xb974('0x1')]={'name':{'type':Sequelize[_0xb974('0x2')],'unique':_0xb974('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb974('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb974('0x4')]();}},'replyUri':{'type':Sequelize[_0xb974('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb974('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb974('0x5');}},'notificationSound':{'type':Sequelize[_0xb974('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb974('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb974('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb974('0x2')]},'queueTransfer':{'type':Sequelize[_0xb974('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb974('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb974('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb974('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb974('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xb974('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb974('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27f4d1){if(!_0x27f4d1)this[_0xb974('0x9')](_0xb974('0xa'),null);this['setDataValue'](_0xb974('0xb'),_0x27f4d1);}}}; \ No newline at end of file +var _0x37bc=['name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports'];(function(_0xbd12ed,_0x27581b){var _0x1ccdec=function(_0x58bb6c){while(--_0x58bb6c){_0xbd12ed['push'](_0xbd12ed['shift']());}};_0x1ccdec(++_0x27581b);}(_0x37bc,0x185));var _0xc37b=function(_0x4b0d73,_0x459902){_0x4b0d73=_0x4b0d73-0x0;var _0xac39aa=_0x37bc[_0x4b0d73];return _0xac39aa;};'use strict';var Sequelize=require(_0xc37b('0x0'));var rs=require(_0xc37b('0x1'));module[_0xc37b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xc37b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc37b('0x4')]},'token':{'type':Sequelize[_0xc37b('0x4')],'defaultValue':function(){return rs[_0xc37b('0x5')]();}},'replyUri':{'type':Sequelize[_0xc37b('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc37b('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc37b('0x6')],'defaultValue':function(){return _0xc37b('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc37b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc37b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc37b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc37b('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc37b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc37b('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xc37b('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xc37b('0x8')],'defaultValue':![],'comment':_0xc37b('0xb'),'set':function(_0x4ebf66){if(!_0x4ebf66)this['setDataValue'](_0xc37b('0xc'),null);this[_0xc37b('0xd')]('mandatoryDisposition',_0x4ebf66);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f38b264..c80655d 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 _0x853e=['sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','describe','addDisposition','findOne','Disposition','order','removeDispositions','ids','CannedAnswer','getAnswers','length','nolimit','OpenchannelAccountId','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','from','contact','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','end','sendStatus','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x853e,0x1ea));var _0xe853=function(_0x313ae4,_0x588a94){_0x313ae4=_0x313ae4-0x0;var _0x1e42af=_0x853e[_0x313ae4];return _0x1e42af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe853('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe853('0x1'));var rp=require('request-promise');var moment=require(_0xe853('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe853('0x3'));var util=require(_0xe853('0x4'));var path=require(_0xe853('0x5'));var sox=require(_0xe853('0x6'));var csv=require(_0xe853('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0x8'));var _=require(_0xe853('0x9'));var squel=require(_0xe853('0xa'));var crypto=require(_0xe853('0xb'));var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require(_0xe853('0x7'));var querystring=require(_0xe853('0xe'));var Papa=require(_0xe853('0xf'));var Redis=require(_0xe853('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe853('0x12'));var config=require(_0xe853('0x13'));var licenseUtil=require(_0xe853('0x14'));var db=require('../../mysqldb')['db'];config[_0xe853('0x15')]=_[_0xe853('0x16')](config[_0xe853('0x15')],{'host':_0xe853('0x17'),'port':0x18eb});var socket=require(_0xe853('0x18'))(new Redis(config[_0xe853('0x15')]));require(_0xe853('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe853('0x1a')][_0xe853('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x41c489,_0x11e4a0,_0x21c5f0,_0x9309a5){return new BPromise(function(_0x335ca3,_0x111f2e){var _0x2a98fa=_0x9309a5||client;return _0x2a98fa[_0xe853('0x1c')](_0x41c489,_0x21c5f0)[_0xe853('0x1d')](function(_0x1d2526){logger[_0xe853('0x1e')](_0xe853('0x1f'),_0x11e4a0,_0xe853('0x20'));logger[_0xe853('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11e4a0,_0xe853('0x20'),JSON[_0xe853('0x22')](_0x1d2526));if(_0x1d2526[_0xe853('0x23')]){if(_0x1d2526[_0xe853('0x23')][_0xe853('0x24')]===0x1f4){logger[_0xe853('0x23')](_0xe853('0x1f'),_0x11e4a0,_0x1d2526[_0xe853('0x23')][_0xe853('0x25')]);return _0x111f2e(_0x1d2526[_0xe853('0x23')][_0xe853('0x25')]);}logger['error'](_0xe853('0x1f'),_0x11e4a0,_0x1d2526[_0xe853('0x23')][_0xe853('0x25')]);return _0x335ca3(_0x1d2526[_0xe853('0x23')][_0xe853('0x25')]);}else{logger[_0xe853('0x1e')](_0xe853('0x1f'),_0x11e4a0,_0xe853('0x20'));_0x335ca3(_0x1d2526['result'][_0xe853('0x25')]);}})[_0xe853('0x26')](function(_0x198895){logger[_0xe853('0x23')](_0xe853('0x1f'),_0x11e4a0,_0x198895);_0x111f2e(_0x198895);});});}function respondWithStatusCode(_0x58454e,_0x1fdaaf){_0x1fdaaf=_0x1fdaaf||0xcc;return function(_0x33e0b0){if(_0x33e0b0){return _0x58454e['sendStatus'](_0x1fdaaf);}return _0x58454e[_0xe853('0x27')](_0x1fdaaf)['end']();};}function respondWithResult(_0x5c8852,_0x545738){_0x545738=_0x545738||0xc8;return function(_0x586fa0){if(_0x586fa0){return _0x5c8852[_0xe853('0x27')](_0x545738)[_0xe853('0x28')](_0x586fa0);}};}function respondWithFilteredResult(_0x438b5b,_0x5d268f){return function(_0x397301){if(_0x397301){var _0x1e99c8=typeof _0x5d268f[_0xe853('0x29')]===_0xe853('0x2a')&&typeof _0x5d268f[_0xe853('0x2b')]===_0xe853('0x2a');var _0x51fc77=_0x397301['count'];var _0x139fa2=_0x1e99c8?0x0:_0x5d268f[_0xe853('0x29')];var _0x47cace=_0x1e99c8?_0x397301[_0xe853('0x2c')]:_0x5d268f['offset']+_0x5d268f[_0xe853('0x2b')];var _0x1bede6;if(_0x47cace>=_0x51fc77){_0x47cace=_0x51fc77;_0x1bede6=0xc8;}else{_0x1bede6=0xce;}_0x438b5b[_0xe853('0x27')](_0x1bede6);return _0x438b5b['set'](_0xe853('0x2d'),_0x139fa2+'-'+_0x47cace+'/'+_0x51fc77)[_0xe853('0x28')](_0x397301);}return null;};}function patchUpdates(_0x21d3e5){return function(_0x44e383){try{jsonpatch[_0xe853('0x2e')](_0x44e383,_0x21d3e5,!![]);}catch(_0x38c960){return BPromise[_0xe853('0x2f')](_0x38c960);}return _0x44e383[_0xe853('0x30')]();};}function saveUpdates(_0x165ac9,_0x290025){return function(_0x11e503){if(_0x11e503){return _0x11e503['update'](_0x165ac9)[_0xe853('0x1d')](function(_0x56c49b){return _0x56c49b;});}return null;};}function removeEntity(_0x342528,_0x43e7f7){return function(_0x22d5ec){if(_0x22d5ec){return _0x22d5ec[_0xe853('0x31')]()['then'](function(){var _0x37c67c=_0x22d5ec[_0xe853('0x32')]({'plain':!![]});var _0x2287c8=_0xe853('0x33');return db[_0xe853('0x34')][_0xe853('0x31')]({'where':{'type':_0x2287c8,'resourceId':_0x37c67c['id']}})['then'](function(){return _0x22d5ec;});})[_0xe853('0x1d')](function(){_0x342528[_0xe853('0x27')](0xcc)[_0xe853('0x35')]();});}};}function handleEntityNotFound(_0x69dba5,_0xc8b547){return function(_0x2dbf3b){if(!_0x2dbf3b){_0x69dba5[_0xe853('0x36')](0x194);}return _0x2dbf3b;};}function handleError(_0x1ef84e,_0xaf7166){_0xaf7166=_0xaf7166||0x1f4;return function(_0x5d9735){logger['error'](_0x5d9735[_0xe853('0x37')]);if(_0x5d9735[_0xe853('0x38')]){delete _0x5d9735[_0xe853('0x38')];}_0x1ef84e['status'](_0xaf7166)[_0xe853('0x39')](_0x5d9735);};}exports['index']=function(_0x52bbaa,_0x4af4fc){var _0x29ed45={'include':[{'model':db['Pause'],'as':_0xe853('0x3a')}]},_0x5b1fe4={},_0x3ae0cb={'count':0x0,'rows':[]};var _0x1c0696=_[_0xe853('0x3b')](db[_0xe853('0x3c')][_0xe853('0x3d')],function(_0x9fca20){return{'name':_0x9fca20['fieldName'],'type':_0x9fca20['type'][_0xe853('0x3e')]};});_0x5b1fe4['model']=_[_0xe853('0x3b')](_0x1c0696,_0xe853('0x38'));_0x5b1fe4[_0xe853('0x3f')]=_[_0xe853('0x40')](_0x52bbaa[_0xe853('0x3f')]);_0x5b1fe4[_0xe853('0x41')]=_[_0xe853('0x42')](_0x5b1fe4['model'],_0x5b1fe4[_0xe853('0x3f')]);_0x29ed45[_0xe853('0x43')]=_[_0xe853('0x42')](_0x5b1fe4['model'],qs[_0xe853('0x44')](_0x52bbaa[_0xe853('0x3f')]['fields']));_0x29ed45[_0xe853('0x43')]=_0x29ed45[_0xe853('0x43')]['length']?_0x29ed45[_0xe853('0x43')]:_0x5b1fe4[_0xe853('0x45')];if(!_0x52bbaa[_0xe853('0x3f')][_0xe853('0x46')]('nolimit')){_0x29ed45[_0xe853('0x2b')]=qs['limit'](_0x52bbaa[_0xe853('0x3f')][_0xe853('0x2b')]);_0x29ed45[_0xe853('0x29')]=qs['offset'](_0x52bbaa[_0xe853('0x3f')][_0xe853('0x29')]);}_0x29ed45['order']=qs[_0xe853('0x47')](_0x52bbaa['query'][_0xe853('0x47')]);_0x29ed45[_0xe853('0x48')]=qs[_0xe853('0x41')](_[_0xe853('0x49')](_0x52bbaa['query'],_0x5b1fe4['filters']),_0x1c0696);if(_0x52bbaa[_0xe853('0x3f')][_0xe853('0x4a')]){_0x29ed45['where']=_[_0xe853('0x4b')](_0x29ed45[_0xe853('0x48')],{'$or':_['map'](_0x1c0696,function(_0x5e8329){if(_0x5e8329[_0xe853('0x4c')]!==_0xe853('0x4d')){var _0x27c306={};_0x27c306[_0x5e8329[_0xe853('0x38')]]={'$like':'%'+_0x52bbaa[_0xe853('0x3f')][_0xe853('0x4a')]+'%'};return _0x27c306;}})});}_0x29ed45=_[_0xe853('0x4b')]({},_0x29ed45,_0x52bbaa[_0xe853('0x4e')]);var _0x1f07f6={'where':_0x29ed45[_0xe853('0x48')]};return db['OpenchannelAccount']['count'](_0x1f07f6)[_0xe853('0x1d')](function(_0x2986a7){_0x3ae0cb['count']=_0x2986a7;if(_0x52bbaa[_0xe853('0x3f')][_0xe853('0x4f')]){_0x29ed45['include']=[{'all':!![]}];}return db[_0xe853('0x3c')][_0xe853('0x50')](_0x29ed45);})[_0xe853('0x1d')](function(_0x5eeb43){_0x3ae0cb[_0xe853('0x51')]=_0x5eeb43;return _0x3ae0cb;})[_0xe853('0x1d')](respondWithFilteredResult(_0x4af4fc,_0x29ed45))['catch'](handleError(_0x4af4fc,null));};exports[_0xe853('0x52')]=function(_0x18d215,_0x38ca06){var _0xd0de05={'raw':![],'where':{'id':_0x18d215[_0xe853('0x53')]['id']},'include':[{'model':db[_0xe853('0x54')],'as':_0xe853('0x3a')}]},_0x428c83={};_0x428c83['model']=_[_0xe853('0x40')](db[_0xe853('0x3c')][_0xe853('0x3d')]);_0x428c83[_0xe853('0x3f')]=_[_0xe853('0x40')](_0x18d215[_0xe853('0x3f')]);_0x428c83[_0xe853('0x41')]=_[_0xe853('0x42')](_0x428c83[_0xe853('0x45')],_0x428c83[_0xe853('0x3f')]);_0xd0de05[_0xe853('0x43')]=_[_0xe853('0x42')](_0x428c83[_0xe853('0x45')],qs[_0xe853('0x44')](_0x18d215[_0xe853('0x3f')][_0xe853('0x44')]));_0xd0de05['attributes']=_0xd0de05[_0xe853('0x43')]['length']?_0xd0de05[_0xe853('0x43')]:_0x428c83[_0xe853('0x45')];if(_0x18d215[_0xe853('0x3f')]['includeAll']){_0xd0de05[_0xe853('0x55')]=[{'all':!![]}];}_0xd0de05=_[_0xe853('0x4b')]({},_0xd0de05,_0x18d215['options']);return db['OpenchannelAccount'][_0xe853('0x56')](_0xd0de05)[_0xe853('0x1d')](handleEntityNotFound(_0x38ca06,null))['then'](respondWithResult(_0x38ca06,null))[_0xe853('0x26')](handleError(_0x38ca06,null));};exports[_0xe853('0x57')]=function(_0x3327fa,_0x256dec){return db[_0xe853('0x3c')][_0xe853('0x57')](_0x3327fa[_0xe853('0x58')],{})['then'](function(_0x8188fb){var _0x1a88f4=_0x3327fa[_0xe853('0x59')][_0xe853('0x32')]({'plain':!![]});if(!_0x1a88f4)throw new Error(_0xe853('0x5a'));if(_0x1a88f4['role']==='user'){var _0x33d6b7=_0x8188fb[_0xe853('0x32')]({'plain':!![]});var _0x1d3940=_0xe853('0x33');return db[_0xe853('0x5b')][_0xe853('0x56')]({'where':{'name':_0x1d3940,'userProfileId':_0x1a88f4['userProfileId']},'raw':!![]})[_0xe853('0x1d')](function(_0x54b058){if(_0x54b058&&_0x54b058[_0xe853('0x5c')]===0x0){return db[_0xe853('0x34')]['create']({'name':_0x33d6b7[_0xe853('0x38')],'resourceId':_0x33d6b7['id'],'type':_0x54b058[_0xe853('0x38')],'sectionId':_0x54b058['id']},{})['then'](function(){return _0x8188fb;});}else{return _0x8188fb;}})[_0xe853('0x26')](function(_0x2dd6ed){logger[_0xe853('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dd6ed);throw _0x2dd6ed;});}return _0x8188fb;})['then'](respondWithResult(_0x256dec,0xc9))['catch'](handleError(_0x256dec,null));};exports[_0xe853('0x5d')]=function(_0x688f6d,_0x182980){if(_0x688f6d[_0xe853('0x58')]['id']){delete _0x688f6d[_0xe853('0x58')]['id'];}return db[_0xe853('0x3c')][_0xe853('0x56')]({'where':{'id':_0x688f6d[_0xe853('0x53')]['id']},'include':[{'model':db[_0xe853('0x54')],'as':_0xe853('0x3a')}]})['then'](handleEntityNotFound(_0x182980,null))[_0xe853('0x1d')](saveUpdates(_0x688f6d[_0xe853('0x58')],null))[_0xe853('0x1d')](respondWithResult(_0x182980,null))['catch'](handleError(_0x182980,null));};exports[_0xe853('0x31')]=function(_0x3416ae,_0x45c966){return db[_0xe853('0x3c')][_0xe853('0x56')]({'where':{'id':_0x3416ae[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x45c966,null))['then'](removeEntity(_0x45c966,null))['catch'](handleError(_0x45c966,null));};exports[_0xe853('0x5e')]=function(_0x416b33,_0x3ecf96){return db[_0xe853('0x3c')][_0xe853('0x5e')]()[_0xe853('0x1d')](respondWithResult(_0x3ecf96,null))[_0xe853('0x26')](handleError(_0x3ecf96,null));};exports[_0xe853('0x5f')]=function(_0x4f914d,_0x7e9300,_0x316cf1){if(_0x4f914d['body']['id']){delete _0x4f914d[_0xe853('0x58')]['id'];}return db['OpenchannelAccount'][_0xe853('0x56')]({'where':{'id':_0x4f914d['params']['id']}})['then'](handleEntityNotFound(_0x7e9300,null))[_0xe853('0x1d')](function(_0x4d72b7){if(_0x4d72b7){_0x4f914d[_0xe853('0x58')]['OpenchannelAccountId']=_0x4d72b7['id'];return db['Disposition'][_0xe853('0x57')](_0x4f914d[_0xe853('0x58')]);}})[_0xe853('0x1d')](respondWithResult(_0x7e9300,null))[_0xe853('0x26')](handleError(_0x7e9300,null));};exports['getDispositions']=function(_0x53b8e0,_0x238d54,_0x4dd074){var _0xbb7073={'raw':![],'where':{}};var _0x4c85c0={};var _0x462ded={'count':0x0,'rows':[]};return db[_0xe853('0x3c')][_0xe853('0x60')]({'where':{'id':_0x53b8e0[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x238d54,null))['then'](function(_0x229966){if(_0x229966){_0x4c85c0[_0xe853('0x45')]=_[_0xe853('0x40')](db[_0xe853('0x61')][_0xe853('0x3d')]);_0x4c85c0['query']=_[_0xe853('0x40')](_0x53b8e0[_0xe853('0x3f')]);_0x4c85c0['filters']=_[_0xe853('0x42')](_0x4c85c0[_0xe853('0x45')],_0x4c85c0[_0xe853('0x3f')]);_0xbb7073[_0xe853('0x43')]=_[_0xe853('0x42')](_0x4c85c0[_0xe853('0x45')],qs['fields'](_0x53b8e0[_0xe853('0x3f')][_0xe853('0x44')]));_0xbb7073[_0xe853('0x43')]=_0xbb7073[_0xe853('0x43')]['length']?_0xbb7073[_0xe853('0x43')]:_0x4c85c0[_0xe853('0x45')];if(!_0x53b8e0['query'][_0xe853('0x46')]('nolimit')){_0xbb7073[_0xe853('0x2b')]=qs[_0xe853('0x2b')](_0x53b8e0[_0xe853('0x3f')]['limit']);_0xbb7073[_0xe853('0x29')]=qs[_0xe853('0x29')](_0x53b8e0[_0xe853('0x3f')]['offset']);}_0xbb7073[_0xe853('0x62')]=qs[_0xe853('0x47')](_0x53b8e0[_0xe853('0x3f')][_0xe853('0x47')]);_0xbb7073[_0xe853('0x48')]=qs[_0xe853('0x41')](_[_0xe853('0x49')](_0x53b8e0['query'],_0x4c85c0[_0xe853('0x41')]));_0xbb7073[_0xe853('0x48')]['OpenchannelAccountId']=_0x229966['id'];if(_0x53b8e0['query'][_0xe853('0x4a')]){_0xbb7073[_0xe853('0x48')]=_[_0xe853('0x4b')](_0xbb7073[_0xe853('0x48')],{'$or':_[_0xe853('0x3b')](_0xbb7073['attributes'],function(_0xa57b05){var _0x13fb51={};_0x13fb51[_0xa57b05]={'$like':'%'+_0x53b8e0[_0xe853('0x3f')]['filter']+'%'};return _0x13fb51;})});}_0xbb7073=_['merge']({},_0xbb7073,_0x53b8e0['options']);return db[_0xe853('0x61')]['count']({'where':_0xbb7073[_0xe853('0x48')]})[_0xe853('0x1d')](function(_0x4c207d){_0x462ded[_0xe853('0x2c')]=_0x4c207d;if(_0x53b8e0['query'][_0xe853('0x4f')]){_0xbb7073[_0xe853('0x55')]=[{'all':!![]}];}return db[_0xe853('0x61')]['findAll'](_0xbb7073);})[_0xe853('0x1d')](function(_0x26a240){_0x462ded[_0xe853('0x51')]=_0x26a240;return _0x462ded;});}})[_0xe853('0x1d')](respondWithFilteredResult(_0x238d54,_0xbb7073))[_0xe853('0x26')](handleError(_0x238d54,null));};exports['removeDispositions']=function(_0x3f18c4,_0x310f8b,_0x36c41f){return db[_0xe853('0x3c')][_0xe853('0x56')]({'where':{'id':_0x3f18c4[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x310f8b,null))['then'](function(_0x270595){if(_0x270595){return _0x270595[_0xe853('0x63')](_0x3f18c4[_0xe853('0x3f')][_0xe853('0x64')]);}})[_0xe853('0x1d')](respondWithStatusCode(_0x310f8b,null))['catch'](handleError(_0x310f8b,null));};exports['addAnswer']=function(_0x8f9ea0,_0x32e18b,_0x41333d){if(_0x8f9ea0[_0xe853('0x58')]['id']){delete _0x8f9ea0[_0xe853('0x58')]['id'];}return db[_0xe853('0x3c')][_0xe853('0x56')]({'where':{'id':_0x8f9ea0[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x32e18b,null))[_0xe853('0x1d')](function(_0x265780){if(_0x265780){_0x8f9ea0[_0xe853('0x58')]['OpenchannelAccountId']=_0x265780['id'];return db[_0xe853('0x65')][_0xe853('0x57')](_0x8f9ea0['body']);}})[_0xe853('0x1d')](respondWithResult(_0x32e18b,null))[_0xe853('0x26')](handleError(_0x32e18b,null));};exports[_0xe853('0x66')]=function(_0x3c12db,_0x41410e,_0x31cbb3){var _0x367ed9={'raw':![],'where':{}};var _0x1a1e33={};var _0x965060={'count':0x0,'rows':[]};return db[_0xe853('0x3c')][_0xe853('0x60')]({'where':{'id':_0x3c12db['params']['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x41410e,null))[_0xe853('0x1d')](function(_0x5be42c){if(_0x5be42c){_0x1a1e33[_0xe853('0x45')]=_['keys'](db[_0xe853('0x65')]['rawAttributes']);_0x1a1e33[_0xe853('0x3f')]=_['keys'](_0x3c12db[_0xe853('0x3f')]);_0x1a1e33[_0xe853('0x41')]=_['intersection'](_0x1a1e33[_0xe853('0x45')],_0x1a1e33[_0xe853('0x3f')]);_0x367ed9[_0xe853('0x43')]=_['intersection'](_0x1a1e33[_0xe853('0x45')],qs[_0xe853('0x44')](_0x3c12db['query']['fields']));_0x367ed9[_0xe853('0x43')]=_0x367ed9[_0xe853('0x43')][_0xe853('0x67')]?_0x367ed9[_0xe853('0x43')]:_0x1a1e33[_0xe853('0x45')];if(!_0x3c12db[_0xe853('0x3f')][_0xe853('0x46')](_0xe853('0x68'))){_0x367ed9[_0xe853('0x2b')]=qs[_0xe853('0x2b')](_0x3c12db[_0xe853('0x3f')][_0xe853('0x2b')]);_0x367ed9['offset']=qs['offset'](_0x3c12db['query'][_0xe853('0x29')]);}_0x367ed9[_0xe853('0x62')]=qs['sort'](_0x3c12db[_0xe853('0x3f')][_0xe853('0x47')]);_0x367ed9[_0xe853('0x48')]=qs[_0xe853('0x41')](_[_0xe853('0x49')](_0x3c12db[_0xe853('0x3f')],_0x1a1e33[_0xe853('0x41')]));_0x367ed9[_0xe853('0x48')][_0xe853('0x69')]=_0x5be42c['id'];if(_0x3c12db[_0xe853('0x3f')][_0xe853('0x4a')]){_0x367ed9['where']=_[_0xe853('0x4b')](_0x367ed9[_0xe853('0x48')],{'$or':_[_0xe853('0x3b')](_0x367ed9[_0xe853('0x43')],function(_0x3060ee){var _0x3f8bc0={};_0x3f8bc0[_0x3060ee]={'$like':'%'+_0x3c12db[_0xe853('0x3f')][_0xe853('0x4a')]+'%'};return _0x3f8bc0;})});}_0x367ed9=_[_0xe853('0x4b')]({},_0x367ed9,_0x3c12db[_0xe853('0x4e')]);return db['CannedAnswer'][_0xe853('0x2c')]({'where':_0x367ed9[_0xe853('0x48')]})[_0xe853('0x1d')](function(_0x328b60){_0x965060['count']=_0x328b60;if(_0x3c12db[_0xe853('0x3f')][_0xe853('0x4f')]){_0x367ed9['include']=[{'all':!![]}];}return db[_0xe853('0x65')][_0xe853('0x50')](_0x367ed9);})[_0xe853('0x1d')](function(_0x4c2554){_0x965060[_0xe853('0x51')]=_0x4c2554;return _0x965060;});}})[_0xe853('0x1d')](respondWithFilteredResult(_0x41410e,_0x367ed9))[_0xe853('0x26')](handleError(_0x41410e,null));};exports[_0xe853('0x6a')]=function(_0x269ef2,_0x3e7c96,_0x14e989){return db['OpenchannelAccount'][_0xe853('0x56')]({'where':{'id':_0x269ef2['params']['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x3e7c96,null))[_0xe853('0x1d')](function(_0x55433e){if(_0x55433e){return _0x55433e[_0xe853('0x6a')](_0x269ef2['query'][_0xe853('0x64')]);}})[_0xe853('0x1d')](respondWithStatusCode(_0x3e7c96,null))['catch'](handleError(_0x3e7c96,null));};exports[_0xe853('0x6b')]=function(_0x1532b1,_0x12646d,_0x2459f6){var _0x1374a8={'body':_0x1532b1['body'],'channel':_0xe853('0x6c')};var _0x5d3e00=[];var _0x24b9eb=[];var _0x19e4f4={};var _0x4ea957=![];return db[_0xe853('0x6d')][_0xe853('0x5e')]()[_0xe853('0x1d')](function(_0x445155){if(!_0x445155){throw new db[(_0xe853('0x6e'))][(_0xe853('0x6f'))]('no\x20available\x20attributes');}_0x5d3e00=_['difference'](_[_0xe853('0x40')](_0x445155),['createdAt','updatedAt']);_0x24b9eb=_['difference'](_[_0xe853('0x40')](_0x445155),['createdAt',_0xe853('0x70'),_0xe853('0x71'),_0xe853('0x72')]);if(_0x1532b1[_0xe853('0x58')]['id']){delete _0x1532b1[_0xe853('0x58')]['id'];}if(_['isNil'](_0x1532b1[_0xe853('0x58')]['from'])){throw new db['Sequelize']['ValidationError'](_0xe853('0x73'));}if(_[_0xe853('0x74')](_0x1532b1[_0xe853('0x58')]['body'])||_0x1532b1[_0xe853('0x58')][_0xe853('0x58')]===''){throw new db[(_0xe853('0x6e'))][(_0xe853('0x6f'))](_0xe853('0x75'));}if(_[_0xe853('0x74')](_0x1532b1[_0xe853('0x58')]['mapKey'])){throw new db[(_0xe853('0x6e'))]['ValidationError'](_0xe853('0x76')+_0x24b9eb);}if(!_[_0xe853('0x77')](_0x24b9eb,_0x1532b1[_0xe853('0x58')][_0xe853('0x78')])){throw new db[(_0xe853('0x6e'))]['ValidationError'](_0xe853('0x79')+_0x24b9eb);}_0x19e4f4[_0x1532b1[_0xe853('0x58')][_0xe853('0x78')]]=_0x1532b1[_0xe853('0x58')]['from'];})[_0xe853('0x1d')](function(){return db[_0xe853('0x3c')]['find']({'where':{'id':_0x1532b1[_0xe853('0x53')]['id']},'include':[{'model':db[_0xe853('0x7a')],'as':_0xe853('0x7b'),'include':[{'model':db[_0xe853('0x6d')],'as':_0xe853('0x7c'),'where':_0x19e4f4,'limit':0x1,'order':[['updatedAt',_0xe853('0x7d')]]}]},{'model':db[_0xe853('0x7e')],'as':_0xe853('0x7f')}]});})[_0xe853('0x1d')](handleEntityNotFound(_0x12646d,null))[_0xe853('0x1d')](function(_0x2d87c6){if(_0x2d87c6&&_0x2d87c6[_0xe853('0x7b')]){_0x1374a8[_0xe853('0x80')]=_0x2d87c6;_0x1374a8[_0xe853('0x81')]=_0x2d87c6['Applications'];_0x1374a8[_0xe853('0x82')]=_0x2d87c6[_0xe853('0x7b')];_0x1374a8[_0xe853('0x81')]=_[_0xe853('0x83')](_0x1374a8['applications'],[_0xe853('0x84')],[_0xe853('0x85')]);if(_0x1374a8[_0xe853('0x80')]['Applications']){delete _0x1374a8[_0xe853('0x80')]['Applications'];}if(_0x1374a8[_0xe853('0x80')][_0xe853('0x7b')]&&_0x1374a8['account'][_0xe853('0x7b')][_0xe853('0x7c')]['length']){return _0x1374a8[_0xe853('0x80')][_0xe853('0x7b')]['Contacts'][0x0];}var _0x364a93=_[_0xe853('0x16')](_0x1532b1[_0xe853('0x58')],{'firstName':_0x1532b1[_0xe853('0x58')][_0xe853('0x86')],'ListId':_0x2d87c6[_0xe853('0x72')]});_0x364a93[_0x1532b1[_0xe853('0x58')]['mapKey']]=_0x1532b1['body'][_0xe853('0x86')];return db['CmContact'][_0xe853('0x57')](_0x364a93,{'fields':_0x5d3e00,'raw':!![]});}})[_0xe853('0x1d')](handleEntityNotFound(_0x12646d,null))[_0xe853('0x1d')](function(_0x27ae88){_0x1374a8[_0xe853('0x87')]=_0x27ae88;if(_0x27ae88){var _0x1ca7ad={'ContactId':_0x27ae88['id'],'OpenchannelAccountId':_0x1532b1[_0xe853('0x53')]['id'],'from':(_0x27ae88['firstName']||'')+'\x20'+(_0x27ae88['lastName']||'')};var _0x27a677={'OpenchannelAccountId':_0x1532b1['params']['id'],'closed':![]};if(_0x1532b1[_0xe853('0x58')][_0xe853('0x88')]){_0x27a677[_0xe853('0x88')]=_0x1532b1[_0xe853('0x58')][_0xe853('0x88')];return db[_0xe853('0x89')][_0xe853('0x56')]({'where':_0x27a677})['then'](function(_0x30c98d){if(_0x30c98d){return[_0x30c98d,![]];}_0x1ca7ad['threadId']=_0x1532b1['body'][_0xe853('0x88')];_0x1ca7ad[_0xe853('0x8a')]=_0x1532b1['body']['externalUrl'];return db[_0xe853('0x89')][_0xe853('0x57')](_0x1ca7ad)['then'](function(_0x52a3fb){return[_0x52a3fb,!![]];});});}else{_0x27a677[_0xe853('0x88')]=null;}_0x27a677['ContactId']=_0x27ae88['id'];return db['OpenchannelInteraction']['find']({'where':_0x27a677})[_0xe853('0x1d')](function(_0x3da748){if(_0x3da748){return[_0x3da748,![]];}return db[_0xe853('0x89')][_0xe853('0x57')](_0x1ca7ad)[_0xe853('0x1d')](function(_0x2ae935){return[_0x2ae935,!![]];});});}})[_0xe853('0x8b')](function(_0x34e2d6,_0x2da6de){if(_0x34e2d6){_0x4ea957=_0x2da6de;if(!_0x2da6de){var _0x4c4a04={'from':(_0x1374a8[_0xe853('0x87')]['firstName']||'')+'\x20'+(_0x1374a8['contact'][_0xe853('0x8c')]||'')};if(_0x1532b1[_0xe853('0x58')][_0xe853('0x88')]&&_0x1532b1[_0xe853('0x58')]['messageId']&&_0x1532b1[_0xe853('0x58')][_0xe853('0x88')]!=_0x1532b1[_0xe853('0x58')]['messageId']){_0x4c4a04[_0xe853('0x88')]=_0x1532b1[_0xe853('0x58')][_0xe853('0x8d')];}return _0x34e2d6[_0xe853('0x5d')](_0x4c4a04);}else{return _0x34e2d6;}}})[_0xe853('0x1d')](function(_0x51f06e){_0x1374a8[_0xe853('0x8e')]=_0x51f06e[_0xe853('0x32')]({'plain':!![]});_0x1374a8['interaction'][_0xe853('0x8f')]=_0x4ea957;if(_0x1374a8[_0xe853('0x8e')][_0xe853('0x8f')]){if(_0x1374a8['account'][_0xe853('0x90')]){_0x1374a8[_0xe853('0x81')][_0xe853('0x91')]({'id':0x0,'priority':_0x1374a8[_0xe853('0x81')][_0xe853('0x67')]+0x1,'app':_0xe853('0x92'),'appdata':_0xe853('0x93'),'interval':_0xe853('0x94')});}}return db['OpenchannelMessage'][_0xe853('0x57')]({'body':_0x1532b1[_0xe853('0x58')][_0xe853('0x58')],'OpenchannelAccountId':_0x1532b1[_0xe853('0x53')]['id'],'OpenchannelInteractionId':_0x51f06e['id'],'direction':'in','ContactId':_0x1374a8['contact']['id'],'AttachmentId':_0x1532b1[_0xe853('0x58')][_0xe853('0x95')]});})[_0xe853('0x1d')](function(_0x3f46f8){_0x1374a8[_0xe853('0x25')]=_0x3f46f8;if(!_0x1374a8[_0xe853('0x8e')][_0xe853('0x96')])return;return db[_0xe853('0x97')][_0xe853('0x56')]({'attributes':['id',_0xe853('0x38')],'where':{'id':_0x1374a8[_0xe853('0x8e')][_0xe853('0x96')]}});})[_0xe853('0x1d')](function(_0x322ff1){if(_0x322ff1){_0x1374a8[_0xe853('0x81')][_0xe853('0x98')]({'id':0x0,'priority':0x0,'app':_0xe853('0x99'),'appdata':_0x322ff1[_0xe853('0x38')]+','+(_0x1374a8[_0xe853('0x80')][_0xe853('0x9a')]||0xa),'interval':_0xe853('0x94')});}if(!_0x1374a8[_0xe853('0x8e')]['queueId'])return;return db['OpenchannelQueue'][_0xe853('0x56')]({'attributes':['id','name'],'where':{'id':_0x1374a8[_0xe853('0x8e')][_0xe853('0x9b')]}});})[_0xe853('0x1d')](function(_0x37364f){if(_0x37364f){_0x1374a8[_0xe853('0x81')][_0xe853('0x98')]({'id':0x0,'priority':0x1,'app':_0xe853('0x9c'),'appdata':_0x37364f[_0xe853('0x38')]+','+(_0x1374a8[_0xe853('0x80')][_0xe853('0x9d')]||0x12c),'interval':_0xe853('0x94')});}return respondWithRpcPromise(_0xe853('0x9e'),_0xe853('0x9f'),_0x1374a8);})['then'](function(_0x2b3532){respondWithRpcPromise(_0xe853('0xa0'),'EventManager',{'event':'notify','message':_0x2b3532},client9002);return _0x2b3532;})['then'](respondWithResult(_0x12646d,null))[_0xe853('0x26')](handleError(_0x12646d,null));};exports['addApplications']=function(_0x4b6f02,_0x17329f){var _0x568927=_0x4b6f02[_0xe853('0x53')]['id'];var _0x51b3ae=_0x4b6f02[_0xe853('0x58')];var _0x2b3d41=0xc8;var _0x229c52=null;return db[_0xe853('0xa1')][_0xe853('0xa2')]({'isolationLevel':db['sequelize'][_0xe853('0xa3')][_0xe853('0xa4')][_0xe853('0xa5')]},function(_0x42c93b){return db[_0xe853('0x3c')][_0xe853('0x60')]({'where':{'id':_0x568927},'transaction':_0x42c93b})[_0xe853('0x1d')](function(_0x38133a){if(_0x38133a){return db[_0xe853('0x7e')][_0xe853('0x31')]({'where':{'OpenchannelAccountId':_0x568927},'transaction':_0x42c93b})['then'](function(){var _0x2e57c5=_[_0xe853('0x3b')](_0x51b3ae,function(_0x16b8a1){_0x16b8a1[_0xe853('0x69')]=_0x568927;return _0x16b8a1;});return db[_0xe853('0x7e')]['bulkCreate'](_0x2e57c5,{'transaction':_0x42c93b});});}else{_0x2b3d41=0x194;_0x229c52=[];}});})[_0xe853('0x1d')](function(){if(_0x2b3d41!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x568927},'order':_0xe853('0x84')})['then'](function(_0x25b97b){_0x229c52=_0x25b97b;});}})['catch'](function(_0x2fdae7){_0x2b3d41=0x1f4;logger['error'](_0x2fdae7[_0xe853('0x37')]);if(_0x2fdae7[_0xe853('0x38')]){delete _0x2fdae7[_0xe853('0x38')];}_0x229c52=_0x2fdae7;})[_0xe853('0xa6')](function(){if(_0x229c52===null){_0x17329f[_0xe853('0x36')](_0x2b3d41);}else{if(_0x2b3d41===0x1f4){_0x17329f[_0xe853('0x27')](_0x2b3d41)[_0xe853('0x39')](_0x229c52);}else{_0x17329f[_0xe853('0x27')](_0x2b3d41)[_0xe853('0x28')](_0x229c52);}}});};exports[_0xe853('0xa7')]=function(_0x39ae4d,_0x6533ba,_0x1e9417){var _0x38e348={};var _0x2d1bb6={};var _0x23a130;var _0x38adf6;return db[_0xe853('0x3c')]['findOne']({'where':{'id':_0x39ae4d[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x6533ba,null))[_0xe853('0x1d')](function(_0x5aa098){if(_0x5aa098){_0x23a130=_0x5aa098;_0x2d1bb6[_0xe853('0x45')]=_['keys'](db[_0xe853('0x7e')][_0xe853('0x3d')]);_0x2d1bb6['query']=_['keys'](_0x39ae4d['query']);_0x2d1bb6[_0xe853('0x41')]=_[_0xe853('0x42')](_0x2d1bb6[_0xe853('0x45')],_0x2d1bb6[_0xe853('0x3f')]);_0x38e348['attributes']=_[_0xe853('0x42')](_0x2d1bb6[_0xe853('0x45')],qs[_0xe853('0x44')](_0x39ae4d[_0xe853('0x3f')][_0xe853('0x44')]));_0x38e348[_0xe853('0x43')]=_0x38e348[_0xe853('0x43')]['length']?_0x38e348[_0xe853('0x43')]:_0x2d1bb6[_0xe853('0x45')];_0x38e348[_0xe853('0x62')]=qs['sort'](_0x39ae4d[_0xe853('0x3f')][_0xe853('0x47')]);_0x38e348[_0xe853('0x48')]=qs[_0xe853('0x41')](_[_0xe853('0x49')](_0x39ae4d['query'],_0x2d1bb6[_0xe853('0x41')]));if(_0x39ae4d[_0xe853('0x3f')][_0xe853('0x4a')]){_0x38e348[_0xe853('0x48')]=_[_0xe853('0x4b')](_0x38e348[_0xe853('0x48')],{'$or':_[_0xe853('0x3b')](_0x38e348[_0xe853('0x43')],function(_0x188bb4){var _0x1f3b91={};_0x1f3b91[_0x188bb4]={'$like':'%'+_0x39ae4d['query'][_0xe853('0x4a')]+'%'};return _0x1f3b91;})});}_0x38e348=_[_0xe853('0x4b')]({},_0x38e348,_0x39ae4d[_0xe853('0x4e')]);return _0x23a130['getApplications'](_0x38e348);}})['then'](function(_0x585ffe){if(_0x585ffe){_0x38adf6=_0x585ffe[_0xe853('0x67')];if(!_0x39ae4d['query'][_0xe853('0x46')](_0xe853('0x68'))){_0x38e348['limit']=qs['limit'](_0x39ae4d['query']['limit']);_0x38e348[_0xe853('0x29')]=qs[_0xe853('0x29')](_0x39ae4d[_0xe853('0x3f')][_0xe853('0x29')]);}return _0x23a130[_0xe853('0xa7')](_0x38e348);}})['then'](function(_0x5653c4){if(_0x5653c4){return _0x5653c4?{'count':_0x38adf6,'rows':_0x5653c4}:null;}})[_0xe853('0x1d')](respondWithResult(_0x6533ba,null))[_0xe853('0x26')](handleError(_0x6533ba,null));};exports[_0xe853('0xa8')]=function(_0x3a928a,_0x1f92ef,_0x5b4d72){var _0x10ab67={'raw':![],'where':{}};var _0x4624b8={};var _0x3317f3={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3a928a[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x1f92ef,null))[_0xe853('0x1d')](function(_0xa0ad23){if(_0xa0ad23){_0x4624b8[_0xe853('0x45')]=_[_0xe853('0x40')](db[_0xe853('0x89')]['rawAttributes']);_0x4624b8[_0xe853('0x3f')]=_[_0xe853('0x40')](_0x3a928a['query']);_0x4624b8[_0xe853('0x41')]=_[_0xe853('0x42')](_0x4624b8['model'],_0x4624b8[_0xe853('0x3f')]);_0x10ab67[_0xe853('0x43')]=_[_0xe853('0x42')](_0x4624b8[_0xe853('0x45')],qs[_0xe853('0x44')](_0x3a928a[_0xe853('0x3f')][_0xe853('0x44')]));_0x10ab67[_0xe853('0x43')]=_0x10ab67['attributes'][_0xe853('0x67')]?_0x10ab67['attributes']:_0x4624b8[_0xe853('0x45')];if(!_0x3a928a[_0xe853('0x3f')][_0xe853('0x46')](_0xe853('0x68'))){_0x10ab67[_0xe853('0x2b')]=qs['limit'](_0x3a928a[_0xe853('0x3f')][_0xe853('0x2b')]);_0x10ab67[_0xe853('0x29')]=qs[_0xe853('0x29')](_0x3a928a[_0xe853('0x3f')][_0xe853('0x29')]);}_0x10ab67[_0xe853('0x62')]=qs[_0xe853('0x47')](_0x3a928a[_0xe853('0x3f')][_0xe853('0x47')]);_0x10ab67[_0xe853('0x48')]=qs[_0xe853('0x41')](_[_0xe853('0x49')](_0x3a928a['query'],_0x4624b8[_0xe853('0x41')]));_0x10ab67[_0xe853('0x48')][_0xe853('0x69')]=_0xa0ad23['id'];if(_0x3a928a['query']['filter']){_0x10ab67[_0xe853('0x48')]=_[_0xe853('0x4b')](_0x10ab67[_0xe853('0x48')],{'$or':_[_0xe853('0x3b')](_0x10ab67[_0xe853('0x43')],function(_0x567569){var _0x1374b7={};_0x1374b7[_0x567569]={'$like':'%'+_0x3a928a[_0xe853('0x3f')][_0xe853('0x4a')]+'%'};return _0x1374b7;})});}_0x10ab67=_['merge']({},_0x10ab67,_0x3a928a[_0xe853('0x4e')]);return db['OpenchannelInteraction'][_0xe853('0x2c')]({'where':_0x10ab67[_0xe853('0x48')]})[_0xe853('0x1d')](function(_0x1b562f){_0x3317f3[_0xe853('0x2c')]=_0x1b562f;if(_0x3a928a[_0xe853('0x3f')][_0xe853('0x4f')]){_0x10ab67[_0xe853('0x55')]=[{'model':db[_0xe853('0x6d')],'as':_0xe853('0xa9'),'required':![]},{'model':db[_0xe853('0x97')],'as':'Owner','attributes':[_0xe853('0x38'),_0xe853('0xaa'),_0xe853('0xab')],'required':![]},{'model':db[_0xe853('0xac')],'as':_0xe853('0xad'),'attributes':['id',_0xe853('0x38'),_0xe853('0xae')],'where':_0x3a928a['query'][_0xe853('0xaf')]?{'id':_0x3a928a['query']['tag']}:undefined,'required':_0x3a928a[_0xe853('0x3f')][_0xe853('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xe853('0x50')](_0x10ab67);})[_0xe853('0x1d')](function(_0x2caf0d){_0x3317f3[_0xe853('0x51')]=_0x2caf0d;return _0x3317f3;});}})[_0xe853('0x1d')](respondWithFilteredResult(_0x1f92ef,_0x10ab67))['catch'](handleError(_0x1f92ef,null));};exports[_0xe853('0xb0')]=function(_0x27c1aa,_0x536867,_0x40a9fe){return db[_0xe853('0x3c')][_0xe853('0x56')]({'where':{'id':_0x27c1aa[_0xe853('0x53')]['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x536867,null))[_0xe853('0x1d')](function(_0x680a0a){if(_0x680a0a){return _0x680a0a['addAgents'](_0x27c1aa[_0xe853('0x58')][_0xe853('0x64')],_['omit'](_0x27c1aa[_0xe853('0x58')],[_0xe853('0x64'),'id'])||{})[_0xe853('0x8b')](function(_0x38c7f6){for(var _0x1dc090=0x0;_0x1dc090<_0x27c1aa[_0xe853('0x58')][_0xe853('0x64')][_0xe853('0x67')];_0x1dc090+=0x1){socket['emit'](_0xe853('0xb1'),{'UserId':Number(_0x27c1aa['body'][_0xe853('0x64')][_0x1dc090]),'OpenchannelAccountId':Number(_0x27c1aa[_0xe853('0x53')]['id'])});}return _0x38c7f6;});}})[_0xe853('0x1d')](respondWithResult(_0x536867,null))[_0xe853('0x26')](handleError(_0x536867,null));};exports['removeAgents']=function(_0x44221f,_0x260a11,_0x4b85d7){return db[_0xe853('0x3c')]['find']({'where':{'id':_0x44221f['params']['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x260a11,null))['then'](function(_0x67ba7b){if(_0x67ba7b){return _0x67ba7b[_0xe853('0xb2')](_0x44221f['query'][_0xe853('0x64')])[_0xe853('0x1d')](function(){if(_[_0xe853('0xb3')](_0x44221f[_0xe853('0x3f')][_0xe853('0x64')])){for(var _0x264407=0x0;_0x264407<_0x44221f[_0xe853('0x3f')][_0xe853('0x64')][_0xe853('0x67')];_0x264407+=0x1){socket[_0xe853('0xb4')](_0xe853('0xb5'),{'UserId':Number(_0x44221f[_0xe853('0x3f')]['ids'][_0x264407]),'OpenchannelAccountId':Number(_0x44221f[_0xe853('0x53')]['id'])});}}else{socket[_0xe853('0xb4')](_0xe853('0xb5'),{'UserId':Number(_0x44221f[_0xe853('0x3f')][_0xe853('0x64')]),'OpenchannelAccountId':Number(_0x44221f[_0xe853('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x260a11,null))[_0xe853('0x26')](handleError(_0x260a11,null));};exports[_0xe853('0xb6')]=function(_0x433fb8,_0x345a4d,_0xc9f75f){var _0x3db59a={};var _0x104ac1={};var _0xa8a34b;var _0x4393c8;return db['OpenchannelAccount'][_0xe853('0x60')]({'where':{'id':_0x433fb8['params']['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x345a4d,null))[_0xe853('0x1d')](function(_0x104400){if(_0x104400){_0xa8a34b=_0x104400;_0x104ac1[_0xe853('0x45')]=_[_0xe853('0x40')](db['User'][_0xe853('0x3d')]);_0x104ac1[_0xe853('0x3f')]=_[_0xe853('0x40')](_0x433fb8[_0xe853('0x3f')]);_0x104ac1[_0xe853('0x41')]=_[_0xe853('0x42')](_0x104ac1[_0xe853('0x45')],_0x104ac1[_0xe853('0x3f')]);_0x3db59a[_0xe853('0x43')]=_[_0xe853('0x42')](_0x104ac1[_0xe853('0x45')],qs[_0xe853('0x44')](_0x433fb8['query'][_0xe853('0x44')]));_0x3db59a[_0xe853('0x43')]=_0x3db59a[_0xe853('0x43')][_0xe853('0x67')]?_0x3db59a[_0xe853('0x43')]:_0x104ac1[_0xe853('0x45')];_0x3db59a[_0xe853('0x62')]=qs[_0xe853('0x47')](_0x433fb8[_0xe853('0x3f')]['sort']);_0x3db59a[_0xe853('0x48')]=qs['filters'](_['pick'](_0x433fb8[_0xe853('0x3f')],_0x104ac1[_0xe853('0x41')]));if(_0x433fb8[_0xe853('0x3f')]['filter']){_0x3db59a['where']=_[_0xe853('0x4b')](_0x3db59a[_0xe853('0x48')],{'$or':_[_0xe853('0x3b')](_0x3db59a['attributes'],function(_0x5891b6){var _0x39216c={};_0x39216c[_0x5891b6]={'$like':'%'+_0x433fb8['query']['filter']+'%'};return _0x39216c;})});}_0x3db59a=_['merge']({},_0x3db59a,_0x433fb8[_0xe853('0x4e')]);return _0xa8a34b[_0xe853('0xb6')](_0x3db59a);}})['then'](function(_0x524c29){if(_0x524c29){_0x4393c8=_0x524c29[_0xe853('0x67')];if(!_0x433fb8[_0xe853('0x3f')][_0xe853('0x46')](_0xe853('0x68'))){_0x3db59a[_0xe853('0x2b')]=qs[_0xe853('0x2b')](_0x433fb8[_0xe853('0x3f')][_0xe853('0x2b')]);_0x3db59a[_0xe853('0x29')]=qs[_0xe853('0x29')](_0x433fb8[_0xe853('0x3f')][_0xe853('0x29')]);}return _0xa8a34b['getAgents'](_0x3db59a);}})[_0xe853('0x1d')](function(_0x29be17){if(_0x29be17){return _0x29be17?{'count':_0x4393c8,'rows':_0x29be17}:null;}})[_0xe853('0x1d')](respondWithResult(_0x345a4d,null))[_0xe853('0x26')](handleError(_0x345a4d,null));};exports[_0xe853('0x39')]=function(_0x4e4a0b,_0x5bc989,_0x423bdb){var _0x2158b0,_0x40134c,_0x30ebcf;if(_[_0xe853('0x74')](_0x4e4a0b[_0xe853('0x58')]['body'])||_0x4e4a0b['body'][_0xe853('0x58')]===''){throw new db['Sequelize']['ValidationError'](_0xe853('0x75'));}if(_['isNil'](_0x4e4a0b[_0xe853('0x58')]['to'])){}_0x2158b0=_0x4e4a0b[_0xe853('0x58')]['to'];return db[_0xe853('0x3c')][_0xe853('0x60')]({'where':{'id':_0x4e4a0b['params']['id']}})[_0xe853('0x1d')](handleEntityNotFound(_0x5bc989,null))['then'](function(_0x492604){if(_0x492604){return db['OpenchannelAccount']['find']({'where':{'id':_0x492604['id']},'include':[{'model':db[_0xe853('0x7a')],'as':_0xe853('0x7b'),'include':[{'model':db[_0xe853('0x6d')],'as':_0xe853('0x7c'),'where':{[_0x492604[_0xe853('0x78')]]:_0x2158b0},'limit':0x1,'order':[[_0xe853('0x70'),'DESC']]}]}]})[_0xe853('0x1d')](handleEntityNotFound(_0x5bc989,null))[_0xe853('0x1d')](function(_0x2b8f78){if(_0x2b8f78&&_0x2b8f78[_0xe853('0x7b')]){_0x40134c=_0x2b8f78[_0xe853('0x32')]({'plain':!![]});if(_0x40134c[_0xe853('0x7b')]&&_0x40134c[_0xe853('0x7b')]['Contacts']['length']){return _0x40134c[_0xe853('0x7b')][_0xe853('0x7c')][0x0];}return db[_0xe853('0x6d')][_0xe853('0x57')](_[_0xe853('0x16')](_0x4e4a0b['body'],{'firstName':_0x2158b0,[_0x2b8f78['mapKey']]:_0x2158b0,'phone':_0x2158b0,'ListId':_0x40134c['ListId']}));}})[_0xe853('0x1d')](handleEntityNotFound(_0x5bc989,null))[_0xe853('0x1d')](function(_0x235310){if(_0x235310){_0x30ebcf=_0x235310;return db[_0xe853('0x89')]['find']({'where':{'ContactId':_0x30ebcf['id'],'closed':![],'OpenchannelAccountId':_0x40134c['id']}})[_0xe853('0x1d')](function(_0x3ded6e){if(_0x3ded6e){return[_0x3ded6e,![]];}return db[_0xe853('0x89')][_0xe853('0x57')]({'UserId':_0x4e4a0b[_0xe853('0x59')]['id'],'ContactId':_0x30ebcf['id'],'OpenchannelAccountId':_0x40134c['id'],'lastMsgDirection':_0xe853('0xb7'),'firstMsgDirection':_0xe853('0xb7'),'Messages':[_[_0xe853('0x4b')](_0x4e4a0b[_0xe853('0x58')],{'read':![],'body':_0x4e4a0b['body'][_0xe853('0x58')],'OpenchannelAccountId':_0x40134c['id'],'UserId':_0x4e4a0b[_0xe853('0x59')]['id'],'ContactId':_0x30ebcf['id']})]},{'include':[{'model':db[_0xe853('0xb8')],'as':_0xe853('0xb9')}]})[_0xe853('0x1d')](function(_0x25421f){return[_0x25421f,!![]];});});}})['spread'](function(_0x57b44c,_0x1719f5){if(_0x1719f5){return _0x57b44c;}return db[_0xe853('0xb8')][_0xe853('0x57')](_[_0xe853('0x4b')](_0x4e4a0b[_0xe853('0x58')],{'read':![],'body':_0x4e4a0b[_0xe853('0x58')][_0xe853('0x58')],'OpenchannelAccountId':_0x40134c['id'],'OpenchannelInteractionId':_0x57b44c['id'],'UserId':_0x4e4a0b[_0xe853('0x59')]['id'],'ContactId':_0x30ebcf['id']}))[_0xe853('0x1d')](function(_0x106d30){_0x57b44c['dataValues'][_0xe853('0xb9')]=[];_0x57b44c[_0xe853('0xba')][_0xe853('0xb9')]['push'](_0x106d30[_0xe853('0xba')]);return _0x57b44c;});});}})[_0xe853('0x1d')](respondWithResult(_0x5bc989,null))[_0xe853('0x26')](handleError(_0x5bc989,null));}; \ No newline at end of file +var _0xf02c=['apply','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','hasOwnProperty','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','OpenchannelApplication','List','account','Applications','applications','orderBy','priority','asc','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','queue','waitForTheAssignedQueue','startRouting','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','Tag','color','tag','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x45347a,_0x546c3e){var _0x24726e=function(_0x3fbb67){while(--_0x3fbb67){_0x45347a['push'](_0x45347a['shift']());}};_0x24726e(++_0x546c3e);}(_0xf02c,0x92));var _0xcf02=function(_0x46ea22,_0x1f2cd2){_0x46ea22=_0x46ea22-0x0;var _0x278a09=_0xf02c[_0x46ea22];return _0x278a09;};'use strict';var emlformat=require(_0xcf02('0x0'));var rimraf=require(_0xcf02('0x1'));var zipdir=require(_0xcf02('0x2'));var jsonpatch=require(_0xcf02('0x3'));var rp=require(_0xcf02('0x4'));var moment=require(_0xcf02('0x5'));var BPromise=require(_0xcf02('0x6'));var Mustache=require(_0xcf02('0x7'));var util=require(_0xcf02('0x8'));var path=require(_0xcf02('0x9'));var sox=require(_0xcf02('0xa'));var csv=require(_0xcf02('0xb'));var ejs=require(_0xcf02('0xc'));var fs=require('fs');var fs_extra=require(_0xcf02('0xd'));var _=require(_0xcf02('0xe'));var squel=require('squel');var crypto=require(_0xcf02('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf02('0x10'));var Papa=require(_0xcf02('0x11'));var Redis=require(_0xcf02('0x12'));var authService=require(_0xcf02('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcf02('0x14'));var hardwareService=require(_0xcf02('0x15'));var logger=require(_0xcf02('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcf02('0x17'));var licenseUtil=require(_0xcf02('0x18'));var db=require(_0xcf02('0x19'))['db'];config[_0xcf02('0x1a')]=_[_0xcf02('0x1b')](config['redis'],{'host':_0xcf02('0x1c'),'port':0x18eb});var socket=require(_0xcf02('0x1d'))(new Redis(config[_0xcf02('0x1a')]));require(_0xcf02('0x1e'))[_0xcf02('0x1f')](socket);var jayson=require(_0xcf02('0x20'));var client=jayson[_0xcf02('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xcf02('0x21')][_0xcf02('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x275870,_0x5b2512,_0x554499,_0x419418){return new BPromise(function(_0x59f337,_0x14b378){var _0x4a2d89=_0x419418||client;return _0x4a2d89['request'](_0x275870,_0x554499)['then'](function(_0x2860fd){logger['info'](_0xcf02('0x23'),_0x5b2512,_0xcf02('0x24'));logger[_0xcf02('0x25')](_0xcf02('0x26'),_0x5b2512,'request\x20sent',JSON['stringify'](_0x2860fd));if(_0x2860fd[_0xcf02('0x27')]){if(_0x2860fd[_0xcf02('0x27')]['code']===0x1f4){logger[_0xcf02('0x27')](_0xcf02('0x23'),_0x5b2512,_0x2860fd[_0xcf02('0x27')][_0xcf02('0x28')]);return _0x14b378(_0x2860fd['error'][_0xcf02('0x28')]);}logger[_0xcf02('0x27')](_0xcf02('0x23'),_0x5b2512,_0x2860fd[_0xcf02('0x27')][_0xcf02('0x28')]);return _0x59f337(_0x2860fd[_0xcf02('0x27')][_0xcf02('0x28')]);}else{logger[_0xcf02('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b2512,'request\x20sent');_0x59f337(_0x2860fd['result'][_0xcf02('0x28')]);}})[_0xcf02('0x2a')](function(_0x2fd260){logger[_0xcf02('0x27')](_0xcf02('0x23'),_0x5b2512,_0x2fd260);_0x14b378(_0x2fd260);});});}function respondWithStatusCode(_0x21a6ca,_0x207cfe){_0x207cfe=_0x207cfe||0xcc;return function(_0x1cccb0){if(_0x1cccb0){return _0x21a6ca[_0xcf02('0x2b')](_0x207cfe);}return _0x21a6ca[_0xcf02('0x2c')](_0x207cfe)[_0xcf02('0x2d')]();};}function respondWithResult(_0x58c2a3,_0x54716d){_0x54716d=_0x54716d||0xc8;return function(_0x2f103e){if(_0x2f103e){return _0x58c2a3[_0xcf02('0x2c')](_0x54716d)[_0xcf02('0x2e')](_0x2f103e);}};}function respondWithFilteredResult(_0x210256,_0x3cc47e){return function(_0x5eb4c5){if(_0x5eb4c5){var _0x2b8bc6=typeof _0x3cc47e[_0xcf02('0x2f')]===_0xcf02('0x30')&&typeof _0x3cc47e['limit']===_0xcf02('0x30');var _0x174f90=_0x5eb4c5[_0xcf02('0x31')];var _0x5af4c3=_0x2b8bc6?0x0:_0x3cc47e[_0xcf02('0x2f')];var _0x320d89=_0x2b8bc6?_0x5eb4c5['count']:_0x3cc47e[_0xcf02('0x2f')]+_0x3cc47e[_0xcf02('0x32')];var _0x5bb15e;if(_0x320d89>=_0x174f90){_0x320d89=_0x174f90;_0x5bb15e=0xc8;}else{_0x5bb15e=0xce;}_0x210256[_0xcf02('0x2c')](_0x5bb15e);return _0x210256[_0xcf02('0x33')](_0xcf02('0x34'),_0x5af4c3+'-'+_0x320d89+'/'+_0x174f90)[_0xcf02('0x2e')](_0x5eb4c5);}return null;};}function patchUpdates(_0x474221){return function(_0x578a26){try{jsonpatch[_0xcf02('0x35')](_0x578a26,_0x474221,!![]);}catch(_0x285d45){return BPromise[_0xcf02('0x36')](_0x285d45);}return _0x578a26[_0xcf02('0x37')]();};}function saveUpdates(_0x18f1a9,_0x5007ae){return function(_0x5f23f0){if(_0x5f23f0){return _0x5f23f0[_0xcf02('0x38')](_0x18f1a9)[_0xcf02('0x39')](function(_0x135ec8){return _0x135ec8;});}return null;};}function removeEntity(_0x47c1d8,_0x5b912f){return function(_0x17e96f){if(_0x17e96f){return _0x17e96f[_0xcf02('0x3a')]()[_0xcf02('0x39')](function(){var _0x2775b8=_0x17e96f[_0xcf02('0x3b')]({'plain':!![]});var _0x5b0571=_0xcf02('0x3c');return db[_0xcf02('0x3d')][_0xcf02('0x3a')]({'where':{'type':_0x5b0571,'resourceId':_0x2775b8['id']}})['then'](function(){return _0x17e96f;});})[_0xcf02('0x39')](function(){_0x47c1d8[_0xcf02('0x2c')](0xcc)[_0xcf02('0x2d')]();});}};}function handleEntityNotFound(_0x2e418e,_0x1a0cca){return function(_0x4b2c19){if(!_0x4b2c19){_0x2e418e[_0xcf02('0x2b')](0x194);}return _0x4b2c19;};}function handleError(_0xec7844,_0x568953){_0x568953=_0x568953||0x1f4;return function(_0x3bb89a){logger[_0xcf02('0x27')](_0x3bb89a[_0xcf02('0x3e')]);if(_0x3bb89a[_0xcf02('0x3f')]){delete _0x3bb89a['name'];}_0xec7844[_0xcf02('0x2c')](_0x568953)[_0xcf02('0x40')](_0x3bb89a);};}exports[_0xcf02('0x41')]=function(_0x43af50,_0x3d6d1d){var _0x4e7da9={'include':[{'model':db[_0xcf02('0x42')],'as':_0xcf02('0x43')}]},_0x4b58cb={},_0xecca8f={'count':0x0,'rows':[]};var _0x301630=_[_0xcf02('0x44')](db['OpenchannelAccount'][_0xcf02('0x45')],function(_0x4ec645){return{'name':_0x4ec645[_0xcf02('0x46')],'type':_0x4ec645[_0xcf02('0x47')][_0xcf02('0x48')]};});_0x4b58cb[_0xcf02('0x49')]=_['map'](_0x301630,'name');_0x4b58cb[_0xcf02('0x4a')]=_[_0xcf02('0x4b')](_0x43af50[_0xcf02('0x4a')]);_0x4b58cb[_0xcf02('0x4c')]=_[_0xcf02('0x4d')](_0x4b58cb[_0xcf02('0x49')],_0x4b58cb['query']);_0x4e7da9[_0xcf02('0x4e')]=_[_0xcf02('0x4d')](_0x4b58cb[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x43af50[_0xcf02('0x4a')][_0xcf02('0x4f')]));_0x4e7da9['attributes']=_0x4e7da9[_0xcf02('0x4e')]['length']?_0x4e7da9[_0xcf02('0x4e')]:_0x4b58cb[_0xcf02('0x49')];if(!_0x43af50[_0xcf02('0x4a')]['hasOwnProperty'](_0xcf02('0x50'))){_0x4e7da9['limit']=qs[_0xcf02('0x32')](_0x43af50['query'][_0xcf02('0x32')]);_0x4e7da9[_0xcf02('0x2f')]=qs[_0xcf02('0x2f')](_0x43af50[_0xcf02('0x4a')]['offset']);}_0x4e7da9['order']=qs[_0xcf02('0x51')](_0x43af50[_0xcf02('0x4a')][_0xcf02('0x51')]);_0x4e7da9[_0xcf02('0x52')]=qs[_0xcf02('0x4c')](_[_0xcf02('0x53')](_0x43af50['query'],_0x4b58cb[_0xcf02('0x4c')]),_0x301630);if(_0x43af50[_0xcf02('0x4a')][_0xcf02('0x54')]){_0x4e7da9[_0xcf02('0x52')]=_[_0xcf02('0x55')](_0x4e7da9[_0xcf02('0x52')],{'$or':_[_0xcf02('0x44')](_0x301630,function(_0x52b580){if(_0x52b580['type']!==_0xcf02('0x56')){var _0x58d9c7={};_0x58d9c7[_0x52b580[_0xcf02('0x3f')]]={'$like':'%'+_0x43af50['query'][_0xcf02('0x54')]+'%'};return _0x58d9c7;}})});}_0x4e7da9=_[_0xcf02('0x55')]({},_0x4e7da9,_0x43af50[_0xcf02('0x57')]);var _0x175765={'where':_0x4e7da9[_0xcf02('0x52')]};return db[_0xcf02('0x58')][_0xcf02('0x31')](_0x175765)[_0xcf02('0x39')](function(_0x333c56){_0xecca8f[_0xcf02('0x31')]=_0x333c56;if(_0x43af50['query'][_0xcf02('0x59')]){_0x4e7da9[_0xcf02('0x5a')]=[{'all':!![]}];}return db[_0xcf02('0x58')][_0xcf02('0x5b')](_0x4e7da9);})['then'](function(_0x13d8f0){_0xecca8f[_0xcf02('0x5c')]=_0x13d8f0;return _0xecca8f;})[_0xcf02('0x39')](respondWithFilteredResult(_0x3d6d1d,_0x4e7da9))[_0xcf02('0x2a')](handleError(_0x3d6d1d,null));};exports[_0xcf02('0x5d')]=function(_0x22529a,_0x256fa1){var _0x28d1e8={'raw':![],'where':{'id':_0x22529a[_0xcf02('0x5e')]['id']},'include':[{'model':db[_0xcf02('0x42')],'as':_0xcf02('0x43')}]},_0x305b8c={};_0x305b8c['model']=_[_0xcf02('0x4b')](db[_0xcf02('0x58')][_0xcf02('0x45')]);_0x305b8c[_0xcf02('0x4a')]=_[_0xcf02('0x4b')](_0x22529a['query']);_0x305b8c[_0xcf02('0x4c')]=_['intersection'](_0x305b8c[_0xcf02('0x49')],_0x305b8c[_0xcf02('0x4a')]);_0x28d1e8['attributes']=_[_0xcf02('0x4d')](_0x305b8c[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x22529a[_0xcf02('0x4a')][_0xcf02('0x4f')]));_0x28d1e8[_0xcf02('0x4e')]=_0x28d1e8['attributes'][_0xcf02('0x5f')]?_0x28d1e8[_0xcf02('0x4e')]:_0x305b8c['model'];if(_0x22529a['query'][_0xcf02('0x59')]){_0x28d1e8['include']=[{'all':!![]}];}_0x28d1e8=_[_0xcf02('0x55')]({},_0x28d1e8,_0x22529a[_0xcf02('0x57')]);return db[_0xcf02('0x58')]['find'](_0x28d1e8)[_0xcf02('0x39')](handleEntityNotFound(_0x256fa1,null))[_0xcf02('0x39')](respondWithResult(_0x256fa1,null))['catch'](handleError(_0x256fa1,null));};exports['create']=function(_0x44be67,_0x361c89){return db[_0xcf02('0x58')][_0xcf02('0x60')](_0x44be67[_0xcf02('0x61')],{})[_0xcf02('0x39')](function(_0x4e34e0){var _0x171f18=_0x44be67[_0xcf02('0x62')][_0xcf02('0x3b')]({'plain':!![]});if(!_0x171f18)throw new Error(_0xcf02('0x63'));if(_0x171f18[_0xcf02('0x64')]===_0xcf02('0x62')){var _0x404d0e=_0x4e34e0[_0xcf02('0x3b')]({'plain':!![]});var _0x56bc68=_0xcf02('0x3c');return db['UserProfileSection'][_0xcf02('0x65')]({'where':{'name':_0x56bc68,'userProfileId':_0x171f18[_0xcf02('0x66')]},'raw':!![]})[_0xcf02('0x39')](function(_0x261637){if(_0x261637&&_0x261637[_0xcf02('0x67')]===0x0){return db['UserProfileResource'][_0xcf02('0x60')]({'name':_0x404d0e['name'],'resourceId':_0x404d0e['id'],'type':_0x261637[_0xcf02('0x3f')],'sectionId':_0x261637['id']},{})['then'](function(){return _0x4e34e0;});}else{return _0x4e34e0;}})[_0xcf02('0x2a')](function(_0x3dba76){logger[_0xcf02('0x27')](_0xcf02('0x68'),_0x3dba76);throw _0x3dba76;});}return _0x4e34e0;})[_0xcf02('0x39')](respondWithResult(_0x361c89,0xc9))['catch'](handleError(_0x361c89,null));};exports[_0xcf02('0x38')]=function(_0x546f96,_0x329cd5){if(_0x546f96[_0xcf02('0x61')]['id']){delete _0x546f96['body']['id'];}return db[_0xcf02('0x58')]['find']({'where':{'id':_0x546f96[_0xcf02('0x5e')]['id']},'include':[{'model':db[_0xcf02('0x42')],'as':_0xcf02('0x43')}]})[_0xcf02('0x39')](handleEntityNotFound(_0x329cd5,null))[_0xcf02('0x39')](saveUpdates(_0x546f96[_0xcf02('0x61')],null))[_0xcf02('0x39')](respondWithResult(_0x329cd5,null))[_0xcf02('0x2a')](handleError(_0x329cd5,null));};exports[_0xcf02('0x3a')]=function(_0x315157,_0x12147d){return db[_0xcf02('0x58')]['find']({'where':{'id':_0x315157[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x12147d,null))['then'](removeEntity(_0x12147d,null))[_0xcf02('0x2a')](handleError(_0x12147d,null));};exports[_0xcf02('0x69')]=function(_0x2367e8,_0x30d33c){return db[_0xcf02('0x58')][_0xcf02('0x69')]()[_0xcf02('0x39')](respondWithResult(_0x30d33c,null))[_0xcf02('0x2a')](handleError(_0x30d33c,null));};exports[_0xcf02('0x6a')]=function(_0x18b257,_0x2f869d,_0x2d7324){if(_0x18b257[_0xcf02('0x61')]['id']){delete _0x18b257[_0xcf02('0x61')]['id'];}return db['OpenchannelAccount'][_0xcf02('0x65')]({'where':{'id':_0x18b257[_0xcf02('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2f869d,null))[_0xcf02('0x39')](function(_0x5ca523){if(_0x5ca523){_0x18b257[_0xcf02('0x61')][_0xcf02('0x6b')]=_0x5ca523['id'];return db[_0xcf02('0x6c')][_0xcf02('0x60')](_0x18b257[_0xcf02('0x61')]);}})[_0xcf02('0x39')](respondWithResult(_0x2f869d,null))[_0xcf02('0x2a')](handleError(_0x2f869d,null));};exports[_0xcf02('0x6d')]=function(_0x29dec5,_0x5203aa,_0x331840){var _0x5df783={'raw':![],'where':{}};var _0x173841={};var _0x454d30={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x29dec5[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x5203aa,null))[_0xcf02('0x39')](function(_0xd0589){if(_0xd0589){_0x173841[_0xcf02('0x49')]=_[_0xcf02('0x4b')](db[_0xcf02('0x6c')][_0xcf02('0x45')]);_0x173841[_0xcf02('0x4a')]=_['keys'](_0x29dec5[_0xcf02('0x4a')]);_0x173841[_0xcf02('0x4c')]=_['intersection'](_0x173841[_0xcf02('0x49')],_0x173841[_0xcf02('0x4a')]);_0x5df783[_0xcf02('0x4e')]=_[_0xcf02('0x4d')](_0x173841[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x29dec5['query'][_0xcf02('0x4f')]));_0x5df783[_0xcf02('0x4e')]=_0x5df783[_0xcf02('0x4e')]['length']?_0x5df783[_0xcf02('0x4e')]:_0x173841[_0xcf02('0x49')];if(!_0x29dec5['query'][_0xcf02('0x6e')]('nolimit')){_0x5df783[_0xcf02('0x32')]=qs['limit'](_0x29dec5[_0xcf02('0x4a')][_0xcf02('0x32')]);_0x5df783[_0xcf02('0x2f')]=qs[_0xcf02('0x2f')](_0x29dec5[_0xcf02('0x4a')][_0xcf02('0x2f')]);}_0x5df783[_0xcf02('0x6f')]=qs[_0xcf02('0x51')](_0x29dec5[_0xcf02('0x4a')][_0xcf02('0x51')]);_0x5df783['where']=qs[_0xcf02('0x4c')](_[_0xcf02('0x53')](_0x29dec5[_0xcf02('0x4a')],_0x173841['filters']));_0x5df783[_0xcf02('0x52')][_0xcf02('0x6b')]=_0xd0589['id'];if(_0x29dec5[_0xcf02('0x4a')]['filter']){_0x5df783[_0xcf02('0x52')]=_[_0xcf02('0x55')](_0x5df783[_0xcf02('0x52')],{'$or':_[_0xcf02('0x44')](_0x5df783[_0xcf02('0x4e')],function(_0x430aa8){var _0x3e308d={};_0x3e308d[_0x430aa8]={'$like':'%'+_0x29dec5[_0xcf02('0x4a')][_0xcf02('0x54')]+'%'};return _0x3e308d;})});}_0x5df783=_[_0xcf02('0x55')]({},_0x5df783,_0x29dec5[_0xcf02('0x57')]);return db[_0xcf02('0x6c')]['count']({'where':_0x5df783['where']})[_0xcf02('0x39')](function(_0x2b6cd9){_0x454d30['count']=_0x2b6cd9;if(_0x29dec5[_0xcf02('0x4a')]['includeAll']){_0x5df783[_0xcf02('0x5a')]=[{'all':!![]}];}return db[_0xcf02('0x6c')]['findAll'](_0x5df783);})[_0xcf02('0x39')](function(_0x52a803){_0x454d30[_0xcf02('0x5c')]=_0x52a803;return _0x454d30;});}})[_0xcf02('0x39')](respondWithFilteredResult(_0x5203aa,_0x5df783))['catch'](handleError(_0x5203aa,null));};exports[_0xcf02('0x70')]=function(_0x5d9c09,_0xe3fc74,_0x1b9beb){return db['OpenchannelAccount'][_0xcf02('0x65')]({'where':{'id':_0x5d9c09[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0xe3fc74,null))[_0xcf02('0x39')](function(_0x45679a){if(_0x45679a){return _0x45679a[_0xcf02('0x70')](_0x5d9c09[_0xcf02('0x4a')][_0xcf02('0x71')]);}})[_0xcf02('0x39')](respondWithStatusCode(_0xe3fc74,null))[_0xcf02('0x2a')](handleError(_0xe3fc74,null));};exports[_0xcf02('0x72')]=function(_0x1e34cb,_0x6df9f7,_0x1a7ac7){if(_0x1e34cb[_0xcf02('0x61')]['id']){delete _0x1e34cb[_0xcf02('0x61')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1e34cb[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x6df9f7,null))[_0xcf02('0x39')](function(_0x321ca8){if(_0x321ca8){_0x1e34cb[_0xcf02('0x61')][_0xcf02('0x6b')]=_0x321ca8['id'];return db['CannedAnswer']['create'](_0x1e34cb[_0xcf02('0x61')]);}})[_0xcf02('0x39')](respondWithResult(_0x6df9f7,null))['catch'](handleError(_0x6df9f7,null));};exports[_0xcf02('0x73')]=function(_0x130038,_0x3377a0,_0x502b79){var _0x256d9e={'raw':![],'where':{}};var _0x52671f={};var _0x3b5745={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x130038[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x3377a0,null))[_0xcf02('0x39')](function(_0x2558ca){if(_0x2558ca){_0x52671f[_0xcf02('0x49')]=_['keys'](db[_0xcf02('0x74')][_0xcf02('0x45')]);_0x52671f[_0xcf02('0x4a')]=_['keys'](_0x130038['query']);_0x52671f[_0xcf02('0x4c')]=_[_0xcf02('0x4d')](_0x52671f['model'],_0x52671f[_0xcf02('0x4a')]);_0x256d9e[_0xcf02('0x4e')]=_[_0xcf02('0x4d')](_0x52671f[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x130038[_0xcf02('0x4a')][_0xcf02('0x4f')]));_0x256d9e[_0xcf02('0x4e')]=_0x256d9e[_0xcf02('0x4e')][_0xcf02('0x5f')]?_0x256d9e[_0xcf02('0x4e')]:_0x52671f[_0xcf02('0x49')];if(!_0x130038[_0xcf02('0x4a')][_0xcf02('0x6e')](_0xcf02('0x50'))){_0x256d9e[_0xcf02('0x32')]=qs[_0xcf02('0x32')](_0x130038[_0xcf02('0x4a')][_0xcf02('0x32')]);_0x256d9e[_0xcf02('0x2f')]=qs[_0xcf02('0x2f')](_0x130038[_0xcf02('0x4a')]['offset']);}_0x256d9e[_0xcf02('0x6f')]=qs[_0xcf02('0x51')](_0x130038['query'][_0xcf02('0x51')]);_0x256d9e[_0xcf02('0x52')]=qs['filters'](_[_0xcf02('0x53')](_0x130038[_0xcf02('0x4a')],_0x52671f[_0xcf02('0x4c')]));_0x256d9e[_0xcf02('0x52')][_0xcf02('0x6b')]=_0x2558ca['id'];if(_0x130038[_0xcf02('0x4a')]['filter']){_0x256d9e[_0xcf02('0x52')]=_['merge'](_0x256d9e[_0xcf02('0x52')],{'$or':_[_0xcf02('0x44')](_0x256d9e[_0xcf02('0x4e')],function(_0x16848a){var _0x51b677={};_0x51b677[_0x16848a]={'$like':'%'+_0x130038[_0xcf02('0x4a')]['filter']+'%'};return _0x51b677;})});}_0x256d9e=_[_0xcf02('0x55')]({},_0x256d9e,_0x130038[_0xcf02('0x57')]);return db['CannedAnswer'][_0xcf02('0x31')]({'where':_0x256d9e[_0xcf02('0x52')]})[_0xcf02('0x39')](function(_0x5dcf1f){_0x3b5745[_0xcf02('0x31')]=_0x5dcf1f;if(_0x130038[_0xcf02('0x4a')]['includeAll']){_0x256d9e[_0xcf02('0x5a')]=[{'all':!![]}];}return db[_0xcf02('0x74')]['findAll'](_0x256d9e);})[_0xcf02('0x39')](function(_0x7253d9){_0x3b5745[_0xcf02('0x5c')]=_0x7253d9;return _0x3b5745;});}})[_0xcf02('0x39')](respondWithFilteredResult(_0x3377a0,_0x256d9e))['catch'](handleError(_0x3377a0,null));};exports[_0xcf02('0x75')]=function(_0x305e39,_0x359508,_0xa85d30){return db[_0xcf02('0x58')][_0xcf02('0x65')]({'where':{'id':_0x305e39[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x359508,null))[_0xcf02('0x39')](function(_0x28d7d8){if(_0x28d7d8){return _0x28d7d8[_0xcf02('0x75')](_0x305e39[_0xcf02('0x4a')][_0xcf02('0x71')]);}})[_0xcf02('0x39')](respondWithStatusCode(_0x359508,null))['catch'](handleError(_0x359508,null));};exports[_0xcf02('0x76')]=function(_0x5e1b68,_0x2eedef,_0x47dd7b){var _0x44eba2={'body':_0x5e1b68[_0xcf02('0x61')],'channel':'openchannel'};var _0x4a612f=[];var _0x5bde2d=[];var _0x1130c1={};var _0x5b5211=![];return db[_0xcf02('0x77')]['describe']()[_0xcf02('0x39')](function(_0x46576f){if(!_0x46576f){throw new db[(_0xcf02('0x78'))][(_0xcf02('0x79'))]('no\x20available\x20attributes');}_0x4a612f=_[_0xcf02('0x7a')](_[_0xcf02('0x4b')](_0x46576f),[_0xcf02('0x7b'),_0xcf02('0x7c')]);_0x5bde2d=_[_0xcf02('0x7a')](_['keys'](_0x46576f),['createdAt',_0xcf02('0x7c'),_0xcf02('0x7d'),_0xcf02('0x7e')]);if(_0x5e1b68[_0xcf02('0x61')]['id']){delete _0x5e1b68[_0xcf02('0x61')]['id'];}if(_[_0xcf02('0x7f')](_0x5e1b68[_0xcf02('0x61')]['from'])){throw new db['Sequelize'][(_0xcf02('0x79'))]('from\x20is\x20mandatory');}if(_[_0xcf02('0x7f')](_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x61')])||_0x5e1b68[_0xcf02('0x61')]['body']===''){throw new db[(_0xcf02('0x78'))][(_0xcf02('0x79'))](_0xcf02('0x80'));}if(_[_0xcf02('0x7f')](_0x5e1b68[_0xcf02('0x61')]['mapKey'])){throw new db['Sequelize'][(_0xcf02('0x79'))](_0xcf02('0x81')+_0x5bde2d);}if(!_[_0xcf02('0x82')](_0x5bde2d,_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x83')])){throw new db['Sequelize'][(_0xcf02('0x79'))](_0xcf02('0x84')+_0x5bde2d);}_0x1130c1[_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x83')]]=_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x85')];})['then'](function(){return db[_0xcf02('0x58')]['find']({'where':{'id':_0x5e1b68[_0xcf02('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xcf02('0x86'),'where':_0x1130c1,'limit':0x1,'order':[[_0xcf02('0x7c'),_0xcf02('0x87')]]}]},{'model':db[_0xcf02('0x88')],'as':'Applications'}]});})[_0xcf02('0x39')](handleEntityNotFound(_0x2eedef,null))[_0xcf02('0x39')](function(_0x24c3dd){if(_0x24c3dd&&_0x24c3dd[_0xcf02('0x89')]){_0x44eba2[_0xcf02('0x8a')]=_0x24c3dd;_0x44eba2['applications']=_0x24c3dd[_0xcf02('0x8b')];_0x44eba2['list']=_0x24c3dd[_0xcf02('0x89')];_0x44eba2[_0xcf02('0x8c')]=_[_0xcf02('0x8d')](_0x44eba2[_0xcf02('0x8c')],[_0xcf02('0x8e')],[_0xcf02('0x8f')]);if(_0x44eba2[_0xcf02('0x8a')][_0xcf02('0x8b')]){delete _0x44eba2[_0xcf02('0x8a')][_0xcf02('0x8b')];}if(_0x44eba2[_0xcf02('0x8a')][_0xcf02('0x89')]&&_0x44eba2[_0xcf02('0x8a')][_0xcf02('0x89')][_0xcf02('0x86')][_0xcf02('0x5f')]){return _0x44eba2['account']['List'][_0xcf02('0x86')][0x0];}var _0x46dc9f=_[_0xcf02('0x1b')](_0x5e1b68['body'],{'firstName':_0x5e1b68[_0xcf02('0x61')]['from'],'ListId':_0x24c3dd['ListId']});_0x46dc9f[_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x83')]]=_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x85')];return db[_0xcf02('0x77')][_0xcf02('0x60')](_0x46dc9f,{'fields':_0x4a612f,'raw':!![]});}})['then'](handleEntityNotFound(_0x2eedef,null))[_0xcf02('0x39')](function(_0x399869){_0x44eba2['contact']=_0x399869;if(_0x399869){var _0xec0101={'ContactId':_0x399869['id'],'OpenchannelAccountId':_0x5e1b68[_0xcf02('0x5e')]['id'],'from':(_0x399869[_0xcf02('0x90')]||'')+'\x20'+(_0x399869['lastName']||'')};var _0xd6999b={'OpenchannelAccountId':_0x5e1b68[_0xcf02('0x5e')]['id'],'closed':![]};if(_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x91')]){_0xd6999b['threadId']=_0x5e1b68['body']['threadId'];return db[_0xcf02('0x92')][_0xcf02('0x65')]({'where':_0xd6999b})['then'](function(_0x132e2a){if(_0x132e2a){return[_0x132e2a,![]];}_0xec0101[_0xcf02('0x91')]=_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x91')];_0xec0101[_0xcf02('0x93')]=_0x5e1b68['body'][_0xcf02('0x93')];return db[_0xcf02('0x92')][_0xcf02('0x60')](_0xec0101)[_0xcf02('0x39')](function(_0x136a83){return[_0x136a83,!![]];});});}else{_0xd6999b['threadId']=null;}_0xd6999b[_0xcf02('0x94')]=_0x399869['id'];return db['OpenchannelInteraction']['find']({'where':_0xd6999b})[_0xcf02('0x39')](function(_0x6f6dbc){if(_0x6f6dbc){return[_0x6f6dbc,![]];}return db[_0xcf02('0x92')]['create'](_0xec0101)[_0xcf02('0x39')](function(_0x4b2e40){return[_0x4b2e40,!![]];});});}})[_0xcf02('0x95')](function(_0x590b0b,_0x4312b0){if(_0x590b0b){_0x5b5211=_0x4312b0;if(!_0x4312b0){var _0x3488b2={'from':(_0x44eba2[_0xcf02('0x96')]['firstName']||'')+'\x20'+(_0x44eba2[_0xcf02('0x96')][_0xcf02('0x97')]||'')};if(_0x5e1b68[_0xcf02('0x61')]['threadId']&&_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x98')]&&_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x91')]!=_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x98')]){_0x3488b2[_0xcf02('0x91')]=_0x5e1b68['body'][_0xcf02('0x98')];}return _0x590b0b['update'](_0x3488b2);}else{return _0x590b0b;}}})[_0xcf02('0x39')](function(_0x541f35){_0x44eba2['interaction']=_0x541f35['get']({'plain':!![]});_0x44eba2['interaction'][_0xcf02('0x99')]=_0x5b5211;if(_0x44eba2['interaction']['created']){if(_0x44eba2['account'][_0xcf02('0x9a')]){_0x44eba2[_0xcf02('0x8c')][_0xcf02('0x9b')]({'id':0x0,'priority':_0x44eba2[_0xcf02('0x8c')][_0xcf02('0x5f')]+0x1,'app':_0xcf02('0x9c'),'appdata':_0xcf02('0x9d'),'interval':'*,*,*,*'});}}return db[_0xcf02('0x9e')][_0xcf02('0x60')]({'body':_0x5e1b68['body']['body'],'OpenchannelAccountId':_0x5e1b68[_0xcf02('0x5e')]['id'],'OpenchannelInteractionId':_0x541f35['id'],'direction':'in','ContactId':_0x44eba2[_0xcf02('0x96')]['id'],'AttachmentId':_0x5e1b68[_0xcf02('0x61')][_0xcf02('0x9f')]});})[_0xcf02('0x39')](function(_0x1f80b2){_0x44eba2[_0xcf02('0x28')]=_0x1f80b2;if(!_0x44eba2[_0xcf02('0xa0')][_0xcf02('0xa1')])return;return db[_0xcf02('0xa2')]['find']({'attributes':['id',_0xcf02('0x3f')],'where':{'id':_0x44eba2[_0xcf02('0xa0')][_0xcf02('0xa1')]}});})['then'](function(_0x37b9a9){if(_0x37b9a9){_0x44eba2['applications'][_0xcf02('0xa3')]({'id':0x0,'priority':0x0,'app':_0xcf02('0xa4'),'appdata':_0x37b9a9['name']+','+(_0x44eba2[_0xcf02('0x8a')][_0xcf02('0xa5')]||0xa),'interval':_0xcf02('0xa6')});}if(!_0x44eba2['interaction']['queueId'])return;return db['OpenchannelQueue'][_0xcf02('0x65')]({'attributes':['id','name'],'where':{'id':_0x44eba2['interaction'][_0xcf02('0xa7')]}});})[_0xcf02('0x39')](function(_0x430801){if(_0x430801){_0x44eba2[_0xcf02('0x8c')][_0xcf02('0xa3')]({'id':0x0,'priority':0x1,'app':_0xcf02('0xa8'),'appdata':_0x430801[_0xcf02('0x3f')]+','+(_0x44eba2[_0xcf02('0x8a')][_0xcf02('0xa9')]||0x12c),'interval':_0xcf02('0xa6')});}return respondWithRpcPromise('Start',_0xcf02('0xaa'),_0x44eba2);})[_0xcf02('0x39')](function(_0x3c719d){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x3c719d},client9002);return _0x3c719d;})[_0xcf02('0x39')](respondWithResult(_0x2eedef,null))['catch'](handleError(_0x2eedef,null));};exports[_0xcf02('0xab')]=function(_0xc98359,_0x37ae87){var _0x1c6c70=_0xc98359[_0xcf02('0x5e')]['id'];var _0x5401b0=_0xc98359[_0xcf02('0x61')];var _0x2c3565=0xc8;var _0x456c16=null;return db['sequelize'][_0xcf02('0xac')]({'isolationLevel':db[_0xcf02('0xad')][_0xcf02('0xae')][_0xcf02('0xaf')][_0xcf02('0xb0')]},function(_0x911ae5){return db[_0xcf02('0x58')][_0xcf02('0xb1')]({'where':{'id':_0x1c6c70},'transaction':_0x911ae5})[_0xcf02('0x39')](function(_0x14c978){if(_0x14c978){return db[_0xcf02('0x88')][_0xcf02('0x3a')]({'where':{'OpenchannelAccountId':_0x1c6c70},'transaction':_0x911ae5})[_0xcf02('0x39')](function(){var _0x262d94=_['map'](_0x5401b0,function(_0x1fc833){_0x1fc833[_0xcf02('0x6b')]=_0x1c6c70;return _0x1fc833;});return db[_0xcf02('0x88')][_0xcf02('0xb2')](_0x262d94,{'transaction':_0x911ae5});});}else{_0x2c3565=0x194;_0x456c16=[];}});})['then'](function(){if(_0x2c3565!==0x194){return db[_0xcf02('0x88')][_0xcf02('0xb3')]({'where':{'OpenchannelAccountId':_0x1c6c70},'order':_0xcf02('0x8e')})[_0xcf02('0x39')](function(_0x261b7d){_0x456c16=_0x261b7d;});}})[_0xcf02('0x2a')](function(_0x53d613){_0x2c3565=0x1f4;logger[_0xcf02('0x27')](_0x53d613[_0xcf02('0x3e')]);if(_0x53d613['name']){delete _0x53d613['name'];}_0x456c16=_0x53d613;})['finally'](function(){if(_0x456c16===null){_0x37ae87[_0xcf02('0x2b')](_0x2c3565);}else{if(_0x2c3565===0x1f4){_0x37ae87['status'](_0x2c3565)[_0xcf02('0x40')](_0x456c16);}else{_0x37ae87['status'](_0x2c3565)['json'](_0x456c16);}}});};exports[_0xcf02('0xb4')]=function(_0x18f4e0,_0x30bd28,_0x4ba8ae){var _0x286183={};var _0x1f1a7d={};var _0x7aa344;var _0x3ab790;return db[_0xcf02('0x58')][_0xcf02('0xb1')]({'where':{'id':_0x18f4e0['params']['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x30bd28,null))[_0xcf02('0x39')](function(_0x59d96c){if(_0x59d96c){_0x7aa344=_0x59d96c;_0x1f1a7d[_0xcf02('0x49')]=_['keys'](db['OpenchannelApplication'][_0xcf02('0x45')]);_0x1f1a7d['query']=_[_0xcf02('0x4b')](_0x18f4e0[_0xcf02('0x4a')]);_0x1f1a7d[_0xcf02('0x4c')]=_[_0xcf02('0x4d')](_0x1f1a7d['model'],_0x1f1a7d['query']);_0x286183[_0xcf02('0x4e')]=_['intersection'](_0x1f1a7d[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x18f4e0[_0xcf02('0x4a')]['fields']));_0x286183['attributes']=_0x286183[_0xcf02('0x4e')]['length']?_0x286183[_0xcf02('0x4e')]:_0x1f1a7d[_0xcf02('0x49')];_0x286183[_0xcf02('0x6f')]=qs[_0xcf02('0x51')](_0x18f4e0[_0xcf02('0x4a')]['sort']);_0x286183['where']=qs[_0xcf02('0x4c')](_['pick'](_0x18f4e0[_0xcf02('0x4a')],_0x1f1a7d['filters']));if(_0x18f4e0['query'][_0xcf02('0x54')]){_0x286183['where']=_[_0xcf02('0x55')](_0x286183['where'],{'$or':_['map'](_0x286183[_0xcf02('0x4e')],function(_0x44dba4){var _0x39511b={};_0x39511b[_0x44dba4]={'$like':'%'+_0x18f4e0['query'][_0xcf02('0x54')]+'%'};return _0x39511b;})});}_0x286183=_['merge']({},_0x286183,_0x18f4e0[_0xcf02('0x57')]);return _0x7aa344['getApplications'](_0x286183);}})[_0xcf02('0x39')](function(_0x36e2ab){if(_0x36e2ab){_0x3ab790=_0x36e2ab['length'];if(!_0x18f4e0[_0xcf02('0x4a')]['hasOwnProperty'](_0xcf02('0x50'))){_0x286183[_0xcf02('0x32')]=qs[_0xcf02('0x32')](_0x18f4e0[_0xcf02('0x4a')][_0xcf02('0x32')]);_0x286183[_0xcf02('0x2f')]=qs['offset'](_0x18f4e0[_0xcf02('0x4a')][_0xcf02('0x2f')]);}return _0x7aa344[_0xcf02('0xb4')](_0x286183);}})[_0xcf02('0x39')](function(_0x39814e){if(_0x39814e){return _0x39814e?{'count':_0x3ab790,'rows':_0x39814e}:null;}})[_0xcf02('0x39')](respondWithResult(_0x30bd28,null))[_0xcf02('0x2a')](handleError(_0x30bd28,null));};exports[_0xcf02('0xb5')]=function(_0x284969,_0x596a1a,_0x1eb882){var _0x2aa86b={'raw':![],'where':{}};var _0x12df3c={};var _0x3df54f={'count':0x0,'rows':[]};return db[_0xcf02('0x58')]['findOne']({'where':{'id':_0x284969[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x596a1a,null))[_0xcf02('0x39')](function(_0x311df2){if(_0x311df2){_0x12df3c['model']=_['keys'](db[_0xcf02('0x92')][_0xcf02('0x45')]);_0x12df3c[_0xcf02('0x4a')]=_[_0xcf02('0x4b')](_0x284969[_0xcf02('0x4a')]);_0x12df3c[_0xcf02('0x4c')]=_[_0xcf02('0x4d')](_0x12df3c[_0xcf02('0x49')],_0x12df3c[_0xcf02('0x4a')]);_0x2aa86b[_0xcf02('0x4e')]=_[_0xcf02('0x4d')](_0x12df3c[_0xcf02('0x49')],qs[_0xcf02('0x4f')](_0x284969[_0xcf02('0x4a')][_0xcf02('0x4f')]));_0x2aa86b[_0xcf02('0x4e')]=_0x2aa86b[_0xcf02('0x4e')]['length']?_0x2aa86b[_0xcf02('0x4e')]:_0x12df3c[_0xcf02('0x49')];if(!_0x284969[_0xcf02('0x4a')][_0xcf02('0x6e')](_0xcf02('0x50'))){_0x2aa86b[_0xcf02('0x32')]=qs[_0xcf02('0x32')](_0x284969['query']['limit']);_0x2aa86b[_0xcf02('0x2f')]=qs[_0xcf02('0x2f')](_0x284969[_0xcf02('0x4a')][_0xcf02('0x2f')]);}_0x2aa86b[_0xcf02('0x6f')]=qs[_0xcf02('0x51')](_0x284969[_0xcf02('0x4a')][_0xcf02('0x51')]);_0x2aa86b[_0xcf02('0x52')]=qs[_0xcf02('0x4c')](_[_0xcf02('0x53')](_0x284969[_0xcf02('0x4a')],_0x12df3c['filters']));_0x2aa86b[_0xcf02('0x52')][_0xcf02('0x6b')]=_0x311df2['id'];if(_0x284969[_0xcf02('0x4a')][_0xcf02('0x54')]){_0x2aa86b[_0xcf02('0x52')]=_['merge'](_0x2aa86b[_0xcf02('0x52')],{'$or':_[_0xcf02('0x44')](_0x2aa86b[_0xcf02('0x4e')],function(_0x5752e3){var _0x1e2bb5={};_0x1e2bb5[_0x5752e3]={'$like':'%'+_0x284969['query'][_0xcf02('0x54')]+'%'};return _0x1e2bb5;})});}_0x2aa86b=_['merge']({},_0x2aa86b,_0x284969['options']);return db[_0xcf02('0x92')]['count']({'where':_0x2aa86b[_0xcf02('0x52')]})[_0xcf02('0x39')](function(_0x32f850){_0x3df54f[_0xcf02('0x31')]=_0x32f850;if(_0x284969[_0xcf02('0x4a')][_0xcf02('0x59')]){_0x2aa86b[_0xcf02('0x5a')]=[{'model':db[_0xcf02('0x77')],'as':_0xcf02('0xb6'),'required':![]},{'model':db[_0xcf02('0xa2')],'as':_0xcf02('0xb7'),'attributes':[_0xcf02('0x3f'),_0xcf02('0xb8'),'internal'],'required':![]},{'model':db[_0xcf02('0xb9')],'as':'Tags','attributes':['id','name',_0xcf02('0xba')],'where':_0x284969[_0xcf02('0x4a')][_0xcf02('0xbb')]?{'id':_0x284969['query'][_0xcf02('0xbb')]}:undefined,'required':_0x284969['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xcf02('0x5b')](_0x2aa86b);})[_0xcf02('0x39')](function(_0x142f45){_0x3df54f['rows']=_0x142f45;return _0x3df54f;});}})[_0xcf02('0x39')](respondWithFilteredResult(_0x596a1a,_0x2aa86b))[_0xcf02('0x2a')](handleError(_0x596a1a,null));};exports['addAgents']=function(_0x172aa7,_0x475b64,_0x4097c1){return db['OpenchannelAccount'][_0xcf02('0x65')]({'where':{'id':_0x172aa7['params']['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x475b64,null))['then'](function(_0x47255c){if(_0x47255c){return _0x47255c['addAgents'](_0x172aa7['body'][_0xcf02('0x71')],_[_0xcf02('0xbc')](_0x172aa7[_0xcf02('0x61')],[_0xcf02('0x71'),'id'])||{})[_0xcf02('0x95')](function(_0x2de0ca){for(var _0x36ca7b=0x0;_0x36ca7b<_0x172aa7['body'][_0xcf02('0x71')][_0xcf02('0x5f')];_0x36ca7b+=0x1){socket['emit'](_0xcf02('0xbd'),{'UserId':Number(_0x172aa7[_0xcf02('0x61')][_0xcf02('0x71')][_0x36ca7b]),'OpenchannelAccountId':Number(_0x172aa7['params']['id'])});}return _0x2de0ca;});}})['then'](respondWithResult(_0x475b64,null))[_0xcf02('0x2a')](handleError(_0x475b64,null));};exports[_0xcf02('0xbe')]=function(_0xcb393d,_0x1f5f93,_0x20d050){return db[_0xcf02('0x58')][_0xcf02('0x65')]({'where':{'id':_0xcb393d['params']['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x1f5f93,null))[_0xcf02('0x39')](function(_0x55f72a){if(_0x55f72a){return _0x55f72a['removeAgents'](_0xcb393d[_0xcf02('0x4a')][_0xcf02('0x71')])[_0xcf02('0x39')](function(){if(_[_0xcf02('0xbf')](_0xcb393d['query'][_0xcf02('0x71')])){for(var _0x10db01=0x0;_0x10db01<_0xcb393d[_0xcf02('0x4a')][_0xcf02('0x71')][_0xcf02('0x5f')];_0x10db01+=0x1){socket[_0xcf02('0xc0')](_0xcf02('0xc1'),{'UserId':Number(_0xcb393d['query'][_0xcf02('0x71')][_0x10db01]),'OpenchannelAccountId':Number(_0xcb393d[_0xcf02('0x5e')]['id'])});}}else{socket[_0xcf02('0xc0')](_0xcf02('0xc1'),{'UserId':Number(_0xcb393d['query'][_0xcf02('0x71')]),'OpenchannelAccountId':Number(_0xcb393d['params']['id'])});}});}})[_0xcf02('0x39')](respondWithStatusCode(_0x1f5f93,null))[_0xcf02('0x2a')](handleError(_0x1f5f93,null));};exports[_0xcf02('0xc2')]=function(_0xd7ae9c,_0x5b8c38,_0x168f6a){var _0x3a5119={};var _0x338070={};var _0x471b08;var _0x10eff7;return db[_0xcf02('0x58')][_0xcf02('0xb1')]({'where':{'id':_0xd7ae9c[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x5b8c38,null))[_0xcf02('0x39')](function(_0x24ebc3){if(_0x24ebc3){_0x471b08=_0x24ebc3;_0x338070[_0xcf02('0x49')]=_[_0xcf02('0x4b')](db['User'][_0xcf02('0x45')]);_0x338070['query']=_[_0xcf02('0x4b')](_0xd7ae9c['query']);_0x338070[_0xcf02('0x4c')]=_['intersection'](_0x338070[_0xcf02('0x49')],_0x338070[_0xcf02('0x4a')]);_0x3a5119[_0xcf02('0x4e')]=_[_0xcf02('0x4d')](_0x338070['model'],qs[_0xcf02('0x4f')](_0xd7ae9c[_0xcf02('0x4a')]['fields']));_0x3a5119['attributes']=_0x3a5119[_0xcf02('0x4e')][_0xcf02('0x5f')]?_0x3a5119['attributes']:_0x338070[_0xcf02('0x49')];_0x3a5119[_0xcf02('0x6f')]=qs[_0xcf02('0x51')](_0xd7ae9c[_0xcf02('0x4a')][_0xcf02('0x51')]);_0x3a5119[_0xcf02('0x52')]=qs[_0xcf02('0x4c')](_[_0xcf02('0x53')](_0xd7ae9c[_0xcf02('0x4a')],_0x338070[_0xcf02('0x4c')]));if(_0xd7ae9c[_0xcf02('0x4a')][_0xcf02('0x54')]){_0x3a5119[_0xcf02('0x52')]=_['merge'](_0x3a5119[_0xcf02('0x52')],{'$or':_[_0xcf02('0x44')](_0x3a5119['attributes'],function(_0x4a8ef9){var _0x3fc3b7={};_0x3fc3b7[_0x4a8ef9]={'$like':'%'+_0xd7ae9c['query'][_0xcf02('0x54')]+'%'};return _0x3fc3b7;})});}_0x3a5119=_[_0xcf02('0x55')]({},_0x3a5119,_0xd7ae9c[_0xcf02('0x57')]);return _0x471b08[_0xcf02('0xc2')](_0x3a5119);}})[_0xcf02('0x39')](function(_0x42f6b8){if(_0x42f6b8){_0x10eff7=_0x42f6b8[_0xcf02('0x5f')];if(!_0xd7ae9c[_0xcf02('0x4a')][_0xcf02('0x6e')]('nolimit')){_0x3a5119[_0xcf02('0x32')]=qs[_0xcf02('0x32')](_0xd7ae9c[_0xcf02('0x4a')][_0xcf02('0x32')]);_0x3a5119[_0xcf02('0x2f')]=qs[_0xcf02('0x2f')](_0xd7ae9c['query'][_0xcf02('0x2f')]);}return _0x471b08['getAgents'](_0x3a5119);}})['then'](function(_0x30a44c){if(_0x30a44c){return _0x30a44c?{'count':_0x10eff7,'rows':_0x30a44c}:null;}})[_0xcf02('0x39')](respondWithResult(_0x5b8c38,null))[_0xcf02('0x2a')](handleError(_0x5b8c38,null));};exports[_0xcf02('0x40')]=function(_0x194a42,_0x57489e,_0x45e3ea){var _0x4f5a57,_0x5e717f,_0x1c3f08;if(_['isNil'](_0x194a42[_0xcf02('0x61')]['body'])||_0x194a42[_0xcf02('0x61')][_0xcf02('0x61')]===''){throw new db[(_0xcf02('0x78'))][(_0xcf02('0x79'))](_0xcf02('0x80'));}if(_[_0xcf02('0x7f')](_0x194a42[_0xcf02('0x61')]['to'])){}_0x4f5a57=_0x194a42[_0xcf02('0x61')]['to'];return db[_0xcf02('0x58')][_0xcf02('0xb1')]({'where':{'id':_0x194a42[_0xcf02('0x5e')]['id']}})[_0xcf02('0x39')](handleEntityNotFound(_0x57489e,null))[_0xcf02('0x39')](function(_0x49896e){if(_0x49896e){return db['OpenchannelAccount']['find']({'where':{'id':_0x49896e['id']},'include':[{'model':db[_0xcf02('0xc3')],'as':'List','include':[{'model':db[_0xcf02('0x77')],'as':_0xcf02('0x86'),'where':{[_0x49896e[_0xcf02('0x83')]]:_0x4f5a57},'limit':0x1,'order':[[_0xcf02('0x7c'),_0xcf02('0x87')]]}]}]})[_0xcf02('0x39')](handleEntityNotFound(_0x57489e,null))[_0xcf02('0x39')](function(_0x54976b){if(_0x54976b&&_0x54976b['List']){_0x5e717f=_0x54976b[_0xcf02('0x3b')]({'plain':!![]});if(_0x5e717f['List']&&_0x5e717f[_0xcf02('0x89')][_0xcf02('0x86')][_0xcf02('0x5f')]){return _0x5e717f[_0xcf02('0x89')][_0xcf02('0x86')][0x0];}return db['CmContact'][_0xcf02('0x60')](_['defaults'](_0x194a42['body'],{'firstName':_0x4f5a57,[_0x54976b[_0xcf02('0x83')]]:_0x4f5a57,'phone':_0x4f5a57,'ListId':_0x5e717f['ListId']}));}})[_0xcf02('0x39')](handleEntityNotFound(_0x57489e,null))[_0xcf02('0x39')](function(_0x40c1d7){if(_0x40c1d7){_0x1c3f08=_0x40c1d7;return db[_0xcf02('0x92')][_0xcf02('0x65')]({'where':{'ContactId':_0x1c3f08['id'],'closed':![],'OpenchannelAccountId':_0x5e717f['id']}})[_0xcf02('0x39')](function(_0x46a251){if(_0x46a251){return[_0x46a251,![]];}return db['OpenchannelInteraction'][_0xcf02('0x60')]({'UserId':_0x194a42[_0xcf02('0x62')]['id'],'ContactId':_0x1c3f08['id'],'OpenchannelAccountId':_0x5e717f['id'],'lastMsgDirection':_0xcf02('0xc4'),'firstMsgDirection':_0xcf02('0xc4'),'Messages':[_['merge'](_0x194a42['body'],{'read':![],'body':_0x194a42['body'][_0xcf02('0x61')],'OpenchannelAccountId':_0x5e717f['id'],'UserId':_0x194a42[_0xcf02('0x62')]['id'],'ContactId':_0x1c3f08['id']})]},{'include':[{'model':db[_0xcf02('0x9e')],'as':'Messages'}]})[_0xcf02('0x39')](function(_0x36267f){return[_0x36267f,!![]];});});}})[_0xcf02('0x95')](function(_0x2a6102,_0xbb63c4){if(_0xbb63c4){return _0x2a6102;}return db[_0xcf02('0x9e')][_0xcf02('0x60')](_[_0xcf02('0x55')](_0x194a42[_0xcf02('0x61')],{'read':![],'body':_0x194a42['body']['body'],'OpenchannelAccountId':_0x5e717f['id'],'OpenchannelInteractionId':_0x2a6102['id'],'UserId':_0x194a42['user']['id'],'ContactId':_0x1c3f08['id']}))[_0xcf02('0x39')](function(_0x5e9d78){_0x2a6102[_0xcf02('0xc5')][_0xcf02('0xc6')]=[];_0x2a6102[_0xcf02('0xc5')][_0xcf02('0xc6')][_0xcf02('0x9b')](_0x5e9d78['dataValues']);return _0x2a6102;});});}})[_0xcf02('0x39')](respondWithResult(_0x57489e,null))[_0xcf02('0x2a')](handleError(_0x57489e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ecca0e5..80f47f0 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 _0x6324=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit'];(function(_0x40909e,_0x63b633){var _0xa32cfc=function(_0x1ee851){while(--_0x1ee851){_0x40909e['push'](_0x40909e['shift']());}};_0xa32cfc(++_0x63b633);}(_0x6324,0x142));var _0x4632=function(_0x261fee,_0x46a708){_0x261fee=_0x261fee-0x0;var _0x26f7b4=_0x6324[_0x261fee];return _0x26f7b4;};'use strict';var EventEmitter=require(_0x4632('0x0'));var OpenchannelAccount=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bea40){return function(_0x54c200,_0x13b218,_0x592e39){OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40+':'+_0x54c200['id'],_0x54c200);OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40,_0x54c200);_0x592e39(null);};}for(var e in events){if(events[_0x4632('0x6')](e)){var event=events[e];OpenchannelAccount[_0x4632('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xaa88=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x5d7d6b,_0x3e1cde){var _0x2e5b64=function(_0x271709){while(--_0x271709){_0x5d7d6b['push'](_0x5d7d6b['shift']());}};_0x2e5b64(++_0x3e1cde);}(_0xaa88,0x137));var _0x8aa8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xaa88[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0x8aa8('0x0'));var OpenchannelAccount=require(_0x8aa8('0x1'))['db'][_0x8aa8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8aa8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aa8('0x4'),'afterDestroy':_0x8aa8('0x5')};function emitEvent(_0x43f7e4){return function(_0x3b2c88,_0x3e3b70,_0x350e8b){OpenchannelAccountEvents['emit'](_0x43f7e4+':'+_0x3b2c88['id'],_0x3b2c88);OpenchannelAccountEvents['emit'](_0x43f7e4,_0x3b2c88);_0x350e8b(null);};}for(var e in events){if(events[_0x8aa8('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8aa8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index bda0caa..43b14a8 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(_0x3843f1,_0x24274c){var _0x3685c9=function(_0x57dd34){while(--_0x57dd34){_0x3843f1['push'](_0x3843f1['shift']());}};_0x3685c9(++_0x24274c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x2af5cd,_0x52ba10){var _0x14aaa0=function(_0x49de7a){while(--_0x49de7a){_0x2af5cd['push'](_0x2af5cd['shift']());}};_0x14aaa0(++_0x52ba10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 68d7224..7583f19 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 _0x757a=['redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x122835,_0x5bf3c2){var _0x5ef7ab=function(_0xc3ce51){while(--_0xc3ce51){_0x122835['push'](_0x122835['shift']());}};_0x5ef7ab(++_0x5bf3c2);}(_0x757a,0xde));var _0xa757=function(_0x17fa2b,_0x5a61e0){_0x17fa2b=_0x17fa2b-0x0;var _0x8cb6b3=_0x757a[_0x17fa2b];return _0x8cb6b3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});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);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});} \ No newline at end of file +var _0x00b3=['OpenchannelAccount,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./openchannelAccount.socket','register','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x00b3,0x17a));var _0x300b=function(_0x49fd8a,_0x5656b9){_0x49fd8a=_0x49fd8a-0x0;var _0x40d07a=_0x00b3[_0x49fd8a];return _0x40d07a;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x300b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x300b('0xa')]));require(_0x300b('0xb'))[_0x300b('0xc')](socket);function respondWithRpcPromise(_0x4d8d78,_0x42e5a5,_0x3d907e){return new BPromise(function(_0x243abf,_0x212b2b){return client['request'](_0x4d8d78,_0x3d907e)[_0x300b('0xd')](function(_0x2eeb2d){logger[_0x300b('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x42e5a5,_0x300b('0xf'));logger[_0x300b('0x10')](_0x300b('0x11'),_0x42e5a5,_0x300b('0xf'),JSON[_0x300b('0x12')](_0x2eeb2d));if(_0x2eeb2d[_0x300b('0x13')]){if(_0x2eeb2d[_0x300b('0x13')][_0x300b('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x42e5a5,_0x2eeb2d['error']['message']);return _0x212b2b(_0x2eeb2d[_0x300b('0x13')][_0x300b('0x15')]);}logger[_0x300b('0x13')](_0x300b('0x16'),_0x42e5a5,_0x2eeb2d['error']['message']);return _0x243abf(_0x2eeb2d[_0x300b('0x13')][_0x300b('0x15')]);}else{logger[_0x300b('0xe')](_0x300b('0x16'),_0x42e5a5,'request\x20sent');_0x243abf(_0x2eeb2d[_0x300b('0x17')][_0x300b('0x15')]);}})[_0x300b('0x18')](function(_0x5cba7c){logger[_0x300b('0x13')](_0x300b('0x16'),_0x42e5a5,_0x5cba7c);_0x212b2b(_0x5cba7c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3dd201f..11b9b1d 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 _0x4a81=['save','remove','update','openchannelAccount:','./openchannelAccount.events'];(function(_0x58cf07,_0x2e3858){var _0x42afe0=function(_0x3c71ff){while(--_0x3c71ff){_0x58cf07['push'](_0x58cf07['shift']());}};_0x42afe0(++_0x2e3858);}(_0x4a81,0x1b7));var _0x14a8=function(_0x539958,_0xe91ab6){_0x539958=_0x539958-0x0;var _0x365443=_0x4a81[_0x539958];return _0x365443;};'use strict';var OpenchannelAccountEvents=require(_0x14a8('0x0'));var events=[_0x14a8('0x1'),_0x14a8('0x2'),_0x14a8('0x3')];function createListener(_0x4a7f9e,_0x5845a3){return function(_0x45869b){_0x5845a3['emit'](_0x4a7f9e,_0x45869b);};}function removeListener(_0x39c3d4,_0x3363f8){return function(){OpenchannelAccountEvents['removeListener'](_0x39c3d4,_0x3363f8);};}exports['register']=function(_0x2cd6d2){for(var _0x4aa19e=0x0,_0x134295=events['length'];_0x4aa19e<_0x134295;_0x4aa19e++){var _0x26e442=events[_0x4aa19e];var _0x4271b5=createListener(_0x14a8('0x4')+_0x26e442,_0x2cd6d2);OpenchannelAccountEvents['on'](_0x26e442,_0x4271b5);}}; \ No newline at end of file +var _0x4c6d=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x39f8ae,_0x1079b7){var _0x2de47f=function(_0x108a74){while(--_0x108a74){_0x39f8ae['push'](_0x39f8ae['shift']());}};_0x2de47f(++_0x1079b7);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x9c473d,_0x102fa4){_0x9c473d=_0x9c473d-0x0;var _0x25369d=_0x4c6d[_0x9c473d];return _0x25369d;};'use strict';var OpenchannelAccountEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){OpenchannelAccountEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);OpenchannelAccountEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 2914081..5aa7d8f 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 _0x2966=['delete','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2966,0xc7));var _0x6296=function(_0x12838c,_0x186682){_0x12838c=_0x12838c-0x0;var _0x4a859d=_0x2966[_0x12838c];return _0x4a859d;};'use strict';var multer=require(_0x6296('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6296('0x1'));var router=express[_0x6296('0x2')]();var fs_extra=require(_0x6296('0x3'));var auth=require(_0x6296('0x4'));var interaction=require(_0x6296('0x5'));var config=require(_0x6296('0x6'));var controller=require(_0x6296('0x7'));router[_0x6296('0x8')]('/',auth[_0x6296('0x9')](),controller[_0x6296('0xa')]);router[_0x6296('0x8')](_0x6296('0xb'),auth[_0x6296('0x9')](),controller[_0x6296('0xc')]);router[_0x6296('0xd')]('/',auth[_0x6296('0x9')](),controller[_0x6296('0xe')]);router[_0x6296('0xf')]('/:id',auth[_0x6296('0x9')](),controller[_0x6296('0x10')]);router[_0x6296('0x11')](_0x6296('0xb'),auth[_0x6296('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa0b8=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller'];(function(_0x1055a1,_0x329e6a){var _0x42a061=function(_0x1c276d){while(--_0x1c276d){_0x1055a1['push'](_0x1055a1['shift']());}};_0x42a061(++_0x329e6a);}(_0xa0b8,0x172));var _0x8a0b=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0xa0b8[_0x49a1a0];return _0x518a4f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a0b('0x0'));var timeout=require(_0x8a0b('0x1'));var express=require(_0x8a0b('0x2'));var router=express[_0x8a0b('0x3')]();var fs_extra=require(_0x8a0b('0x4'));var auth=require(_0x8a0b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a0b('0x6'));var controller=require(_0x8a0b('0x7'));router[_0x8a0b('0x8')]('/',auth[_0x8a0b('0x9')](),controller['index']);router[_0x8a0b('0x8')](_0x8a0b('0xa'),auth[_0x8a0b('0x9')](),controller[_0x8a0b('0xb')]);router[_0x8a0b('0xc')]('/',auth[_0x8a0b('0x9')](),controller[_0x8a0b('0xd')]);router[_0x8a0b('0xe')](_0x8a0b('0xa'),auth[_0x8a0b('0x9')](),controller[_0x8a0b('0xf')]);router[_0x8a0b('0x10')]('/:id',auth[_0x8a0b('0x9')](),controller[_0x8a0b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 005bfcf..f46cd88 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 _0xe23c=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2d7678,_0x55201c){var _0x21fd13=function(_0x501a88){while(--_0x501a88){_0x2d7678['push'](_0x2d7678['shift']());}};_0x21fd13(++_0x55201c);}(_0xe23c,0xfc));var _0xce23=function(_0x5a7d5f,_0x5695cb){_0x5a7d5f=_0x5a7d5f-0x0;var _0x5dcded=_0xe23c[_0x5a7d5f];return _0x5dcded;};'use strict';var Sequelize=require('sequelize');module[_0xce23('0x0')]={'priority':{'type':Sequelize[_0xce23('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xce23('0x2')],'allowNull':![],'defaultValue':_0xce23('0x3')},'appdata':{'type':Sequelize[_0xce23('0x4')]()},'description':{'type':Sequelize[_0xce23('0x2')]},'interval':{'type':Sequelize[_0xce23('0x2')],'defaultValue':_0xce23('0x5')}}; \ No newline at end of file +var _0xe64f=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe64f,0x1b3));var _0xfe64=function(_0x3a5239,_0x1876d0){_0x3a5239=_0x3a5239-0x0;var _0x556232=_0xe64f[_0x3a5239];return _0x556232;};'use strict';var Sequelize=require('sequelize');module[_0xfe64('0x0')]={'priority':{'type':Sequelize[_0xfe64('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfe64('0x2')],'allowNull':![],'defaultValue':_0xfe64('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfe64('0x2')],'defaultValue':_0xfe64('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 5d1f862..b33bd12 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 _0x05ab=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','save','update','destroy','then','stack','name','index','map','OpenchannelApplication'];(function(_0x3f986b,_0x3b35f5){var _0x5148b2=function(_0x4ab31f){while(--_0x4ab31f){_0x3f986b['push'](_0x3f986b['shift']());}};_0x5148b2(++_0x3b35f5);}(_0x05ab,0x1e2));var _0xb05a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x05ab[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0xb05a('0x0'));var rimraf=require(_0xb05a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb05a('0x2'));var rp=require(_0xb05a('0x3'));var moment=require(_0xb05a('0x4'));var BPromise=require(_0xb05a('0x5'));var Mustache=require(_0xb05a('0x6'));var util=require(_0xb05a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb05a('0x8'));var fs=require('fs');var fs_extra=require(_0xb05a('0x9'));var _=require('lodash');var squel=require(_0xb05a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb05a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb05a('0xc'));var Redis=require('ioredis');var authService=require(_0xb05a('0xd'));var qs=require(_0xb05a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb05a('0xf'));var utils=require('../../config/utils');var config=require(_0xb05a('0x10'));var licenseUtil=require(_0xb05a('0x11'));var db=require(_0xb05a('0x12'))['db'];function respondWithStatusCode(_0x415f6d,_0x19adad){_0x19adad=_0x19adad||0xcc;return function(_0x226c5b){if(_0x226c5b){return _0x415f6d[_0xb05a('0x13')](_0x19adad);}return _0x415f6d['status'](_0x19adad)[_0xb05a('0x14')]();};}function respondWithResult(_0x3705ff,_0x58f434){_0x58f434=_0x58f434||0xc8;return function(_0x27796d){if(_0x27796d){return _0x3705ff[_0xb05a('0x15')](_0x58f434)['json'](_0x27796d);}};}function respondWithFilteredResult(_0x477025,_0x3777b0){return function(_0x5b5299){if(_0x5b5299){var _0x28939b=typeof _0x3777b0[_0xb05a('0x16')]==='undefined'&&typeof _0x3777b0[_0xb05a('0x17')]===_0xb05a('0x18');var _0x156b90=_0x5b5299[_0xb05a('0x19')];var _0xd52464=_0x28939b?0x0:_0x3777b0['offset'];var _0x527feb=_0x28939b?_0x5b5299['count']:_0x3777b0[_0xb05a('0x16')]+_0x3777b0[_0xb05a('0x17')];var _0x2b6c05;if(_0x527feb>=_0x156b90){_0x527feb=_0x156b90;_0x2b6c05=0xc8;}else{_0x2b6c05=0xce;}_0x477025[_0xb05a('0x15')](_0x2b6c05);return _0x477025[_0xb05a('0x1a')]('Content-Range',_0xd52464+'-'+_0x527feb+'/'+_0x156b90)[_0xb05a('0x1b')](_0x5b5299);}return null;};}function patchUpdates(_0x5df23f){return function(_0x2697e9){try{jsonpatch[_0xb05a('0x1c')](_0x2697e9,_0x5df23f,!![]);}catch(_0x38963a){return BPromise['reject'](_0x38963a);}return _0x2697e9[_0xb05a('0x1d')]();};}function saveUpdates(_0x537ccd,_0x32f325){return function(_0x6c112e){if(_0x6c112e){return _0x6c112e[_0xb05a('0x1e')](_0x537ccd)['then'](function(_0x2cc8fa){return _0x2cc8fa;});}return null;};}function removeEntity(_0xe42ac5,_0x286ef7){return function(_0xdcf144){if(_0xdcf144){return _0xdcf144[_0xb05a('0x1f')]()[_0xb05a('0x20')](function(){_0xe42ac5[_0xb05a('0x15')](0xcc)[_0xb05a('0x14')]();});}};}function handleEntityNotFound(_0x294441,_0x3e07c4){return function(_0x967809){if(!_0x967809){_0x294441['sendStatus'](0x194);}return _0x967809;};}function handleError(_0x530242,_0x33471f){_0x33471f=_0x33471f||0x1f4;return function(_0x1ddf1d){logger['error'](_0x1ddf1d[_0xb05a('0x21')]);if(_0x1ddf1d[_0xb05a('0x22')]){delete _0x1ddf1d[_0xb05a('0x22')];}_0x530242[_0xb05a('0x15')](_0x33471f)['send'](_0x1ddf1d);};}exports[_0xb05a('0x23')]=function(_0x5aecc1,_0xb84ad0){var _0x27163c={},_0x28ab4b={},_0x9b300f={'count':0x0,'rows':[]};var _0x81f6c5=_[_0xb05a('0x24')](db[_0xb05a('0x25')][_0xb05a('0x26')],function(_0xbcdd4){return{'name':_0xbcdd4[_0xb05a('0x27')],'type':_0xbcdd4[_0xb05a('0x28')]['key']};});_0x28ab4b[_0xb05a('0x29')]=_[_0xb05a('0x24')](_0x81f6c5,'name');_0x28ab4b[_0xb05a('0x2a')]=_[_0xb05a('0x2b')](_0x5aecc1[_0xb05a('0x2a')]);_0x28ab4b[_0xb05a('0x2c')]=_[_0xb05a('0x2d')](_0x28ab4b[_0xb05a('0x29')],_0x28ab4b[_0xb05a('0x2a')]);_0x27163c[_0xb05a('0x2e')]=_[_0xb05a('0x2d')](_0x28ab4b[_0xb05a('0x29')],qs['fields'](_0x5aecc1['query'][_0xb05a('0x2f')]));_0x27163c['attributes']=_0x27163c['attributes']['length']?_0x27163c[_0xb05a('0x2e')]:_0x28ab4b[_0xb05a('0x29')];if(!_0x5aecc1[_0xb05a('0x2a')][_0xb05a('0x30')]('nolimit')){_0x27163c[_0xb05a('0x17')]=qs[_0xb05a('0x17')](_0x5aecc1[_0xb05a('0x2a')][_0xb05a('0x17')]);_0x27163c[_0xb05a('0x16')]=qs[_0xb05a('0x16')](_0x5aecc1['query'][_0xb05a('0x16')]);}_0x27163c[_0xb05a('0x31')]=qs[_0xb05a('0x32')](_0x5aecc1[_0xb05a('0x2a')][_0xb05a('0x32')]);_0x27163c[_0xb05a('0x33')]=qs[_0xb05a('0x2c')](_[_0xb05a('0x34')](_0x5aecc1[_0xb05a('0x2a')],_0x28ab4b[_0xb05a('0x2c')]),_0x81f6c5);if(_0x5aecc1[_0xb05a('0x2a')]['filter']){_0x27163c['where']=_[_0xb05a('0x35')](_0x27163c[_0xb05a('0x33')],{'$or':_['map'](_0x81f6c5,function(_0x171397){if(_0x171397[_0xb05a('0x28')]!=='VIRTUAL'){var _0x1fec37={};_0x1fec37[_0x171397[_0xb05a('0x22')]]={'$like':'%'+_0x5aecc1[_0xb05a('0x2a')]['filter']+'%'};return _0x1fec37;}})});}_0x27163c=_[_0xb05a('0x35')]({},_0x27163c,_0x5aecc1[_0xb05a('0x36')]);var _0x144807={'where':_0x27163c[_0xb05a('0x33')]};return db['OpenchannelApplication'][_0xb05a('0x19')](_0x144807)[_0xb05a('0x20')](function(_0x3a02c8){_0x9b300f[_0xb05a('0x19')]=_0x3a02c8;if(_0x5aecc1['query'][_0xb05a('0x37')]){_0x27163c[_0xb05a('0x38')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xb05a('0x39')](_0x27163c);})[_0xb05a('0x20')](function(_0x42db2c){_0x9b300f['rows']=_0x42db2c;return _0x9b300f;})[_0xb05a('0x20')](respondWithFilteredResult(_0xb84ad0,_0x27163c))[_0xb05a('0x3a')](handleError(_0xb84ad0,null));};exports[_0xb05a('0x3b')]=function(_0x2bb7b0,_0x59ad4c){var _0x5de788={'raw':!![],'where':{'id':_0x2bb7b0['params']['id']}},_0x3e1c8d={};_0x3e1c8d[_0xb05a('0x29')]=_['keys'](db[_0xb05a('0x25')][_0xb05a('0x26')]);_0x3e1c8d[_0xb05a('0x2a')]=_['keys'](_0x2bb7b0[_0xb05a('0x2a')]);_0x3e1c8d[_0xb05a('0x2c')]=_[_0xb05a('0x2d')](_0x3e1c8d[_0xb05a('0x29')],_0x3e1c8d['query']);_0x5de788[_0xb05a('0x2e')]=_[_0xb05a('0x2d')](_0x3e1c8d['model'],qs[_0xb05a('0x2f')](_0x2bb7b0['query']['fields']));_0x5de788[_0xb05a('0x2e')]=_0x5de788['attributes'][_0xb05a('0x3c')]?_0x5de788['attributes']:_0x3e1c8d['model'];if(_0x2bb7b0[_0xb05a('0x2a')][_0xb05a('0x37')]){_0x5de788[_0xb05a('0x38')]=[{'all':!![]}];}_0x5de788=_[_0xb05a('0x35')]({},_0x5de788,_0x2bb7b0[_0xb05a('0x36')]);return db['OpenchannelApplication'][_0xb05a('0x3d')](_0x5de788)[_0xb05a('0x20')](handleEntityNotFound(_0x59ad4c,null))[_0xb05a('0x20')](respondWithResult(_0x59ad4c,null))['catch'](handleError(_0x59ad4c,null));};exports['create']=function(_0x40817f,_0x50eefe){return db[_0xb05a('0x25')][_0xb05a('0x3e')](_0x40817f['body'],{})[_0xb05a('0x20')](respondWithResult(_0x50eefe,0xc9))[_0xb05a('0x3a')](handleError(_0x50eefe,null));};exports[_0xb05a('0x1e')]=function(_0x16e156,_0x16294d){if(_0x16e156[_0xb05a('0x3f')]['id']){delete _0x16e156[_0xb05a('0x3f')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x16e156['params']['id']}})[_0xb05a('0x20')](handleEntityNotFound(_0x16294d,null))['then'](saveUpdates(_0x16e156[_0xb05a('0x3f')],null))[_0xb05a('0x20')](respondWithResult(_0x16294d,null))[_0xb05a('0x3a')](handleError(_0x16294d,null));};exports[_0xb05a('0x1f')]=function(_0x2b48f8,_0x33ef98){return db[_0xb05a('0x25')][_0xb05a('0x3d')]({'where':{'id':_0x2b48f8[_0xb05a('0x40')]['id']}})[_0xb05a('0x20')](handleEntityNotFound(_0x33ef98,null))[_0xb05a('0x20')](removeEntity(_0x33ef98,null))[_0xb05a('0x3a')](handleError(_0x33ef98,null));}; \ No newline at end of file +var _0xc524=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','OpenchannelApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','destroy'];(function(_0x5a9c9b,_0x4d90b1){var _0x442380=function(_0x1c4e91){while(--_0x1c4e91){_0x5a9c9b['push'](_0x5a9c9b['shift']());}};_0x442380(++_0x4d90b1);}(_0xc524,0xde));var _0x4c52=function(_0x2b5511,_0x325913){_0x2b5511=_0x2b5511-0x0;var _0x11efd4=_0xc524[_0x2b5511];return _0x11efd4;};'use strict';var emlformat=require(_0x4c52('0x0'));var rimraf=require(_0x4c52('0x1'));var zipdir=require(_0x4c52('0x2'));var jsonpatch=require(_0x4c52('0x3'));var rp=require(_0x4c52('0x4'));var moment=require(_0x4c52('0x5'));var BPromise=require(_0x4c52('0x6'));var Mustache=require(_0x4c52('0x7'));var util=require(_0x4c52('0x8'));var path=require(_0x4c52('0x9'));var sox=require(_0x4c52('0xa'));var csv=require(_0x4c52('0xb'));var ejs=require(_0x4c52('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c52('0xd'));var squel=require('squel');var crypto=require(_0x4c52('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c52('0xb'));var querystring=require(_0x4c52('0xf'));var Papa=require(_0x4c52('0x10'));var Redis=require('ioredis');var authService=require(_0x4c52('0x11'));var qs=require(_0x4c52('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c52('0x13'));var logger=require(_0x4c52('0x14'))(_0x4c52('0x15'));var utils=require(_0x4c52('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4c52('0x17'));var db=require(_0x4c52('0x18'))['db'];function respondWithStatusCode(_0x1d2156,_0x3da0c2){_0x3da0c2=_0x3da0c2||0xcc;return function(_0x3eed37){if(_0x3eed37){return _0x1d2156['sendStatus'](_0x3da0c2);}return _0x1d2156[_0x4c52('0x19')](_0x3da0c2)[_0x4c52('0x1a')]();};}function respondWithResult(_0x182662,_0x3aafab){_0x3aafab=_0x3aafab||0xc8;return function(_0xd313eb){if(_0xd313eb){return _0x182662[_0x4c52('0x19')](_0x3aafab)[_0x4c52('0x1b')](_0xd313eb);}};}function respondWithFilteredResult(_0x35115e,_0x634efa){return function(_0x794f5d){if(_0x794f5d){var _0x300066=typeof _0x634efa[_0x4c52('0x1c')]===_0x4c52('0x1d')&&typeof _0x634efa['limit']===_0x4c52('0x1d');var _0x298284=_0x794f5d[_0x4c52('0x1e')];var _0x28c403=_0x300066?0x0:_0x634efa['offset'];var _0x595942=_0x300066?_0x794f5d[_0x4c52('0x1e')]:_0x634efa[_0x4c52('0x1c')]+_0x634efa[_0x4c52('0x1f')];var _0x1f9f07;if(_0x595942>=_0x298284){_0x595942=_0x298284;_0x1f9f07=0xc8;}else{_0x1f9f07=0xce;}_0x35115e[_0x4c52('0x19')](_0x1f9f07);return _0x35115e['set'](_0x4c52('0x20'),_0x28c403+'-'+_0x595942+'/'+_0x298284)[_0x4c52('0x1b')](_0x794f5d);}return null;};}function patchUpdates(_0x474e8e){return function(_0x5d0a05){try{jsonpatch[_0x4c52('0x21')](_0x5d0a05,_0x474e8e,!![]);}catch(_0x233220){return BPromise[_0x4c52('0x22')](_0x233220);}return _0x5d0a05[_0x4c52('0x23')]();};}function saveUpdates(_0x4a29c6,_0x262b95){return function(_0x27fb06){if(_0x27fb06){return _0x27fb06[_0x4c52('0x24')](_0x4a29c6)['then'](function(_0x5a9a2b){return _0x5a9a2b;});}return null;};}function removeEntity(_0x493faa,_0x2685d3){return function(_0x1c6dfb){if(_0x1c6dfb){return _0x1c6dfb['destroy']()[_0x4c52('0x25')](function(){_0x493faa[_0x4c52('0x19')](0xcc)[_0x4c52('0x1a')]();});}};}function handleEntityNotFound(_0x3f353a,_0x16752a){return function(_0x5d281e){if(!_0x5d281e){_0x3f353a[_0x4c52('0x26')](0x194);}return _0x5d281e;};}function handleError(_0x411bb7,_0x109c56){_0x109c56=_0x109c56||0x1f4;return function(_0x594ace){logger[_0x4c52('0x27')](_0x594ace['stack']);if(_0x594ace['name']){delete _0x594ace[_0x4c52('0x28')];}_0x411bb7['status'](_0x109c56)[_0x4c52('0x29')](_0x594ace);};}exports['index']=function(_0x2f129c,_0x3168de){var _0x5476a0={},_0xa04d8c={},_0x4ff606={'count':0x0,'rows':[]};var _0x1134b0=_[_0x4c52('0x2a')](db[_0x4c52('0x2b')][_0x4c52('0x2c')],function(_0x49ce5c){return{'name':_0x49ce5c['fieldName'],'type':_0x49ce5c[_0x4c52('0x2d')][_0x4c52('0x2e')]};});_0xa04d8c[_0x4c52('0x2f')]=_[_0x4c52('0x2a')](_0x1134b0,_0x4c52('0x28'));_0xa04d8c[_0x4c52('0x30')]=_['keys'](_0x2f129c[_0x4c52('0x30')]);_0xa04d8c[_0x4c52('0x31')]=_[_0x4c52('0x32')](_0xa04d8c[_0x4c52('0x2f')],_0xa04d8c[_0x4c52('0x30')]);_0x5476a0[_0x4c52('0x33')]=_[_0x4c52('0x32')](_0xa04d8c['model'],qs[_0x4c52('0x34')](_0x2f129c['query'][_0x4c52('0x34')]));_0x5476a0[_0x4c52('0x33')]=_0x5476a0[_0x4c52('0x33')][_0x4c52('0x35')]?_0x5476a0[_0x4c52('0x33')]:_0xa04d8c[_0x4c52('0x2f')];if(!_0x2f129c[_0x4c52('0x30')][_0x4c52('0x36')](_0x4c52('0x37'))){_0x5476a0[_0x4c52('0x1f')]=qs['limit'](_0x2f129c['query'][_0x4c52('0x1f')]);_0x5476a0[_0x4c52('0x1c')]=qs[_0x4c52('0x1c')](_0x2f129c['query'][_0x4c52('0x1c')]);}_0x5476a0[_0x4c52('0x38')]=qs[_0x4c52('0x39')](_0x2f129c[_0x4c52('0x30')][_0x4c52('0x39')]);_0x5476a0[_0x4c52('0x3a')]=qs[_0x4c52('0x31')](_[_0x4c52('0x3b')](_0x2f129c['query'],_0xa04d8c[_0x4c52('0x31')]),_0x1134b0);if(_0x2f129c[_0x4c52('0x30')][_0x4c52('0x3c')]){_0x5476a0[_0x4c52('0x3a')]=_[_0x4c52('0x3d')](_0x5476a0[_0x4c52('0x3a')],{'$or':_['map'](_0x1134b0,function(_0x2158c8){if(_0x2158c8[_0x4c52('0x2d')]!=='VIRTUAL'){var _0x57c512={};_0x57c512[_0x2158c8[_0x4c52('0x28')]]={'$like':'%'+_0x2f129c['query'][_0x4c52('0x3c')]+'%'};return _0x57c512;}})});}_0x5476a0=_[_0x4c52('0x3d')]({},_0x5476a0,_0x2f129c[_0x4c52('0x3e')]);var _0x3c35be={'where':_0x5476a0[_0x4c52('0x3a')]};return db[_0x4c52('0x2b')]['count'](_0x3c35be)[_0x4c52('0x25')](function(_0xe076f2){_0x4ff606['count']=_0xe076f2;if(_0x2f129c[_0x4c52('0x30')][_0x4c52('0x3f')]){_0x5476a0['include']=[{'all':!![]}];}return db[_0x4c52('0x2b')][_0x4c52('0x40')](_0x5476a0);})['then'](function(_0x1d3596){_0x4ff606[_0x4c52('0x41')]=_0x1d3596;return _0x4ff606;})[_0x4c52('0x25')](respondWithFilteredResult(_0x3168de,_0x5476a0))[_0x4c52('0x42')](handleError(_0x3168de,null));};exports[_0x4c52('0x43')]=function(_0x440523,_0x39b8ae){var _0x5d201a={'raw':!![],'where':{'id':_0x440523[_0x4c52('0x44')]['id']}},_0x18d423={};_0x18d423['model']=_[_0x4c52('0x45')](db[_0x4c52('0x2b')][_0x4c52('0x2c')]);_0x18d423[_0x4c52('0x30')]=_[_0x4c52('0x45')](_0x440523[_0x4c52('0x30')]);_0x18d423['filters']=_[_0x4c52('0x32')](_0x18d423[_0x4c52('0x2f')],_0x18d423[_0x4c52('0x30')]);_0x5d201a[_0x4c52('0x33')]=_[_0x4c52('0x32')](_0x18d423['model'],qs[_0x4c52('0x34')](_0x440523[_0x4c52('0x30')][_0x4c52('0x34')]));_0x5d201a[_0x4c52('0x33')]=_0x5d201a[_0x4c52('0x33')][_0x4c52('0x35')]?_0x5d201a[_0x4c52('0x33')]:_0x18d423[_0x4c52('0x2f')];if(_0x440523['query'][_0x4c52('0x3f')]){_0x5d201a['include']=[{'all':!![]}];}_0x5d201a=_[_0x4c52('0x3d')]({},_0x5d201a,_0x440523['options']);return db[_0x4c52('0x2b')][_0x4c52('0x46')](_0x5d201a)[_0x4c52('0x25')](handleEntityNotFound(_0x39b8ae,null))['then'](respondWithResult(_0x39b8ae,null))[_0x4c52('0x42')](handleError(_0x39b8ae,null));};exports[_0x4c52('0x47')]=function(_0x202c3e,_0x557752){return db['OpenchannelApplication'][_0x4c52('0x47')](_0x202c3e[_0x4c52('0x48')],{})[_0x4c52('0x25')](respondWithResult(_0x557752,0xc9))['catch'](handleError(_0x557752,null));};exports[_0x4c52('0x24')]=function(_0x4b386c,_0x2e9657){if(_0x4b386c[_0x4c52('0x48')]['id']){delete _0x4b386c['body']['id'];}return db[_0x4c52('0x2b')][_0x4c52('0x46')]({'where':{'id':_0x4b386c['params']['id']}})[_0x4c52('0x25')](handleEntityNotFound(_0x2e9657,null))[_0x4c52('0x25')](saveUpdates(_0x4b386c['body'],null))[_0x4c52('0x25')](respondWithResult(_0x2e9657,null))[_0x4c52('0x42')](handleError(_0x2e9657,null));};exports[_0x4c52('0x49')]=function(_0x5b2f6d,_0x1c5249){return db[_0x4c52('0x2b')]['find']({'where':{'id':_0x5b2f6d[_0x4c52('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c5249,null))[_0x4c52('0x25')](removeEntity(_0x1c5249,null))[_0x4c52('0x42')](handleError(_0x1c5249,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 457afe6..7da3e52 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 _0x6ed8=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ed8,0x8d));var _0x86ed=function(_0x314f45,_0x4a71c6){_0x314f45=_0x314f45-0x0;var _0x11202c=_0x6ed8[_0x314f45];return _0x11202c;};'use strict';var _=require(_0x86ed('0x0'));var util=require(_0x86ed('0x1'));var logger=require(_0x86ed('0x2'))(_0x86ed('0x3'));var moment=require('moment');var BPromise=require(_0x86ed('0x4'));var rp=require(_0x86ed('0x5'));var fs=require('fs');var path=require(_0x86ed('0x6'));var rimraf=require(_0x86ed('0x7'));var config=require(_0x86ed('0x8'));var attributes=require(_0x86ed('0x9'));module[_0x86ed('0xa')]=function(_0x50d64e,_0x32b087){return _0x50d64e[_0x86ed('0xb')](_0x86ed('0xc'),attributes,{'tableName':_0x86ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x86ed('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe369=['request-promise','path','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0xee60da,_0x59b0a0){var _0x5365e7=function(_0x2d2c17){while(--_0x2d2c17){_0xee60da['push'](_0xee60da['shift']());}};_0x5365e7(++_0x59b0a0);}(_0xe369,0xd4));var _0x9e36=function(_0x4f2658,_0x525842){_0x4f2658=_0x4f2658-0x0;var _0x2d0018=_0xe369[_0x4f2658];return _0x2d0018;};'use strict';var _=require(_0x9e36('0x0'));var util=require('util');var logger=require(_0x9e36('0x1'))(_0x9e36('0x2'));var moment=require(_0x9e36('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e36('0x4'));var fs=require('fs');var path=require(_0x9e36('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e36('0x6'));module[_0x9e36('0x7')]=function(_0x354295,_0x4c5226){return _0x354295[_0x9e36('0x8')](_0x9e36('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e36('0xa'),'collate':_0x9e36('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 932fd4c..cf07fa9 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 _0x1763=['update','body','options','raw','attributes','limit','UpdateOpenchannelApplication','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','OpenchannelApplication'];(function(_0x583a7b,_0x2561d8){var _0x23f652=function(_0x4ac81d){while(--_0x4ac81d){_0x583a7b['push'](_0x583a7b['shift']());}};_0x23f652(++_0x2561d8);}(_0x1763,0x15c));var _0x3176=function(_0x40d548,_0x233d52){_0x40d548=_0x40d548-0x0;var _0x1791f8=_0x1763[_0x40d548];return _0x1791f8;};'use strict';var _=require(_0x3176('0x0'));var util=require('util');var moment=require(_0x3176('0x1'));var BPromise=require('bluebird');var rs=require(_0x3176('0x2'));var fs=require('fs');var Redis=require(_0x3176('0x3'));var db=require(_0x3176('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3176('0x5'))(_0x3176('0x6'));var config=require(_0x3176('0x7'));var jayson=require(_0x3176('0x8'));var client=jayson[_0x3176('0x9')][_0x3176('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab228,_0x2f4995,_0x571046){return new BPromise(function(_0x2a1b47,_0x929d4c){return client['request'](_0x5ab228,_0x571046)[_0x3176('0xb')](function(_0x377587){logger[_0x3176('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2f4995,_0x3176('0xd'));logger[_0x3176('0xe')](_0x3176('0xf'),_0x2f4995,_0x3176('0xd'),JSON[_0x3176('0x10')](_0x377587));if(_0x377587['error']){if(_0x377587[_0x3176('0x11')][_0x3176('0x12')]===0x1f4){logger['error'](_0x3176('0x13'),_0x2f4995,_0x377587[_0x3176('0x11')][_0x3176('0x14')]);return _0x929d4c(_0x377587[_0x3176('0x11')][_0x3176('0x14')]);}logger['error'](_0x3176('0x13'),_0x2f4995,_0x377587[_0x3176('0x11')]['message']);return _0x2a1b47(_0x377587['error'][_0x3176('0x14')]);}else{logger[_0x3176('0xc')](_0x3176('0x13'),_0x2f4995,_0x3176('0xd'));_0x2a1b47(_0x377587[_0x3176('0x15')][_0x3176('0x14')]);}})[_0x3176('0x16')](function(_0x2d8c3e){logger[_0x3176('0x11')](_0x3176('0x13'),_0x2f4995,_0x2d8c3e);_0x929d4c(_0x2d8c3e);});});}exports['UpdateOpenchannelApplication']=function(_0x430b66){var _0x91b727=this;return new Promise(function(_0x1edc6b,_0x1e727a){return db[_0x3176('0x17')][_0x3176('0x18')](_0x430b66[_0x3176('0x19')],{'raw':_0x430b66[_0x3176('0x1a')]?_0x430b66['options'][_0x3176('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x430b66[_0x3176('0x1a')]?_0x430b66[_0x3176('0x1a')]['where']||null:null,'attributes':_0x430b66['options']?_0x430b66[_0x3176('0x1a')][_0x3176('0x1c')]||null:null,'limit':_0x430b66[_0x3176('0x1a')]?_0x430b66[_0x3176('0x1a')][_0x3176('0x1d')]||null:null})[_0x3176('0xb')](function(_0x1f4572){logger['info']('UpdateOpenchannelApplication',_0x430b66);logger['debug'](_0x3176('0x1e'),_0x430b66,JSON[_0x3176('0x10')](_0x1f4572));_0x1edc6b(_0x1f4572);})[_0x3176('0x16')](function(_0x4118c3){logger[_0x3176('0x11')](_0x3176('0x1e'),_0x4118c3[_0x3176('0x14')],_0x430b66);_0x1e727a(_0x91b727[_0x3176('0x11')](0x1f4,_0x4118c3[_0x3176('0x14')]));});});}; \ No newline at end of file +var _0xfbc4=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','debug','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbc4,0x167));var _0x4fbc=function(_0x116eab,_0x17a89d){_0x116eab=_0x116eab-0x0;var _0x44a129=_0xfbc4[_0x116eab];return _0x44a129;};'use strict';var _=require(_0x4fbc('0x0'));var util=require(_0x4fbc('0x1'));var moment=require(_0x4fbc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fbc('0x3'));var db=require(_0x4fbc('0x4'))['db'];var utils=require(_0x4fbc('0x5'));var logger=require(_0x4fbc('0x6'))('rpc');var config=require(_0x4fbc('0x7'));var jayson=require(_0x4fbc('0x8'));var client=jayson[_0x4fbc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a082c,_0x554c3b,_0x1e2d50){return new BPromise(function(_0x3c4834,_0x4fb63b){return client[_0x4fbc('0xa')](_0x4a082c,_0x1e2d50)[_0x4fbc('0xb')](function(_0x572ed0){logger[_0x4fbc('0xc')](_0x4fbc('0xd'),_0x554c3b,_0x4fbc('0xe'));logger['debug'](_0x4fbc('0xf'),_0x554c3b,_0x4fbc('0xe'),JSON[_0x4fbc('0x10')](_0x572ed0));if(_0x572ed0[_0x4fbc('0x11')]){if(_0x572ed0['error'][_0x4fbc('0x12')]===0x1f4){logger[_0x4fbc('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x554c3b,_0x572ed0[_0x4fbc('0x11')][_0x4fbc('0x13')]);return _0x4fb63b(_0x572ed0[_0x4fbc('0x11')][_0x4fbc('0x13')]);}logger[_0x4fbc('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x554c3b,_0x572ed0[_0x4fbc('0x11')][_0x4fbc('0x13')]);return _0x3c4834(_0x572ed0['error'][_0x4fbc('0x13')]);}else{logger[_0x4fbc('0xc')](_0x4fbc('0xd'),_0x554c3b,'request\x20sent');_0x3c4834(_0x572ed0['result'][_0x4fbc('0x13')]);}})['catch'](function(_0x245ecd){logger[_0x4fbc('0x11')](_0x4fbc('0xd'),_0x554c3b,_0x245ecd);_0x4fb63b(_0x245ecd);});});}exports['UpdateOpenchannelApplication']=function(_0x488925){var _0x419b55=this;return new Promise(function(_0x35e2ef,_0x9a8f34){return db[_0x4fbc('0x14')][_0x4fbc('0x15')](_0x488925['body'],{'raw':_0x488925['options']?_0x488925[_0x4fbc('0x16')][_0x4fbc('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488925['options']?_0x488925[_0x4fbc('0x16')][_0x4fbc('0x18')]||null:null,'attributes':_0x488925[_0x4fbc('0x16')]?_0x488925[_0x4fbc('0x16')][_0x4fbc('0x19')]||null:null,'limit':_0x488925[_0x4fbc('0x16')]?_0x488925[_0x4fbc('0x16')][_0x4fbc('0x1a')]||null:null})[_0x4fbc('0xb')](function(_0x2bf080){logger['info'](_0x4fbc('0x1b'),_0x488925);logger[_0x4fbc('0x1c')](_0x4fbc('0x1b'),_0x488925,JSON[_0x4fbc('0x10')](_0x2bf080));_0x35e2ef(_0x2bf080);})[_0x4fbc('0x1d')](function(_0x5a5bb1){logger['error']('UpdateOpenchannelApplication',_0x5a5bb1[_0x4fbc('0x13')],_0x488925);_0x9a8f34(_0x419b55[_0x4fbc('0x11')](0x1f4,_0x5a5bb1[_0x4fbc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 997aa00..a22f4a4 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 _0xd748=['describe','/:id','/:id/messages','getMessages','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x467cbd,_0x1f9c26){var _0x4d5c0a=function(_0x4bbc52){while(--_0x4bbc52){_0x467cbd['push'](_0x467cbd['shift']());}};_0x4d5c0a(++_0x1f9c26);}(_0xd748,0x1f2));var _0x8d74=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xd748[_0x10852d];return _0x13a8d6;};'use strict';var multer=require(_0x8d74('0x0'));var util=require(_0x8d74('0x1'));var path=require(_0x8d74('0x2'));var timeout=require(_0x8d74('0x3'));var express=require(_0x8d74('0x4'));var router=express[_0x8d74('0x5')]();var fs_extra=require(_0x8d74('0x6'));var auth=require(_0x8d74('0x7'));var interaction=require(_0x8d74('0x8'));var config=require(_0x8d74('0x9'));var controller=require(_0x8d74('0xa'));router[_0x8d74('0xb')]('/',auth[_0x8d74('0xc')](),controller[_0x8d74('0xd')]);router[_0x8d74('0xb')]('/describe',auth[_0x8d74('0xc')](),controller[_0x8d74('0xe')]);router[_0x8d74('0xb')](_0x8d74('0xf'),auth[_0x8d74('0xc')](),controller['show']);router[_0x8d74('0xb')](_0x8d74('0x10'),auth['isAuthenticated'](),controller[_0x8d74('0x11')]);router['get']('/:id/download',auth[_0x8d74('0xc')](),controller[_0x8d74('0x12')]);router[_0x8d74('0x13')]('/',auth[_0x8d74('0xc')](),controller['create']);router[_0x8d74('0x13')](_0x8d74('0x10'),auth[_0x8d74('0xc')](),controller['addMessage']);router[_0x8d74('0x13')](_0x8d74('0x14'),auth[_0x8d74('0xc')](),interaction[_0x8d74('0x15')](_0x8d74('0x16'),_0x8d74('0x17')),controller[_0x8d74('0x18')]);router['put']('/:id',auth[_0x8d74('0xc')](),interaction[_0x8d74('0x15')](_0x8d74('0x16'),_0x8d74('0x19')),controller[_0x8d74('0x1a')]);router[_0x8d74('0x1b')](_0x8d74('0xf'),auth['isAuthenticated'](),interaction[_0x8d74('0x15')](_0x8d74('0x16'),_0x8d74('0x1c')),controller[_0x8d74('0x1d')]);router[_0x8d74('0x1b')]('/:id/tags',auth[_0x8d74('0xc')](),controller[_0x8d74('0x1e')]);module[_0x8d74('0x1f')]=router; \ No newline at end of file +var _0x1357=['put','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0x41215f,_0x58e0e1){var _0x1d0aad=function(_0x871168){while(--_0x871168){_0x41215f['push'](_0x41215f['shift']());}};_0x1d0aad(++_0x58e0e1);}(_0x1357,0x1e6));var _0x7135=function(_0x3a877f,_0x21b9ec){_0x3a877f=_0x3a877f-0x0;var _0x21f53b=_0x1357[_0x3a877f];return _0x21f53b;};'use strict';var multer=require(_0x7135('0x0'));var util=require(_0x7135('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7135('0x2'));var router=express[_0x7135('0x3')]();var fs_extra=require(_0x7135('0x4'));var auth=require(_0x7135('0x5'));var interaction=require(_0x7135('0x6'));var config=require(_0x7135('0x7'));var controller=require(_0x7135('0x8'));router[_0x7135('0x9')]('/',auth[_0x7135('0xa')](),controller[_0x7135('0xb')]);router['get'](_0x7135('0xc'),auth['isAuthenticated'](),controller[_0x7135('0xd')]);router['get'](_0x7135('0xe'),auth[_0x7135('0xa')](),controller['show']);router[_0x7135('0x9')](_0x7135('0xf'),auth[_0x7135('0xa')](),controller['getMessages']);router['get'](_0x7135('0x10'),auth[_0x7135('0xa')](),controller['download']);router[_0x7135('0x11')]('/',auth[_0x7135('0xa')](),controller[_0x7135('0x12')]);router[_0x7135('0x11')](_0x7135('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x7135('0x13'),auth[_0x7135('0xa')](),interaction[_0x7135('0x14')](_0x7135('0x15'),_0x7135('0x16')),controller[_0x7135('0x17')]);router[_0x7135('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x7135('0x15'),'openchannelinteraction:update'),controller[_0x7135('0x19')]);router[_0x7135('0x1a')](_0x7135('0xe'),auth[_0x7135('0xa')](),interaction[_0x7135('0x14')](_0x7135('0x15'),_0x7135('0x1b')),controller[_0x7135('0x1c')]);router[_0x7135('0x1a')](_0x7135('0x13'),auth[_0x7135('0xa')](),controller['removeTags']);module[_0x7135('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9675e46..13d0f07 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 _0x36e1=['exports','BOOLEAN','STRING','DATE','ENUM','out','INTEGER','sequelize'];(function(_0x597992,_0x516580){var _0x2bea67=function(_0x40b79f){while(--_0x40b79f){_0x597992['push'](_0x597992['shift']());}};_0x2bea67(++_0x516580);}(_0x36e1,0x187));var _0x136e=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x36e1[_0x2797c6];return _0x54809f;};'use strict';var Sequelize=require(_0x136e('0x0'));module[_0x136e('0x1')]={'closed':{'type':Sequelize[_0x136e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x136e('0x3')]},'secondDisposition':{'type':Sequelize[_0x136e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x136e('0x3')]},'note':{'type':Sequelize[_0x136e('0x3')]},'read1stAt':{'type':Sequelize[_0x136e('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x136e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x136e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x136e('0x5')]('in',_0x136e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x136e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x136e('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x136e('0x7')]}}; \ No newline at end of file +var _0xf69b=['ENUM','out','BOOLEAN','INTEGER','exports','DATE','STRING'];(function(_0x4a9f69,_0x38c563){var _0x33e3a1=function(_0x53e727){while(--_0x53e727){_0x4a9f69['push'](_0x4a9f69['shift']());}};_0x33e3a1(++_0x38c563);}(_0xf69b,0xc8));var _0xbf69=function(_0x105a2f,_0xdcbfb8){_0x105a2f=_0x105a2f-0x0;var _0x1b0e19=_0xf69b[_0x105a2f];return _0x1b0e19;};'use strict';var Sequelize=require('sequelize');module[_0xbf69('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbf69('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbf69('0x2')]},'thirdDisposition':{'type':Sequelize[_0xbf69('0x2')]},'note':{'type':Sequelize[_0xbf69('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xbf69('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xbf69('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xbf69('0x3')]('in',_0xbf69('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xbf69('0x3')]('in',_0xbf69('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbf69('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xbf69('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbf69('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 78cf2e5..f3c7cb8 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 _0x29bd=['error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','openchannel','user','catch','from','params','model','keys','query','filters','intersection','attributes','fields','includeAll','include','merge','find','create','body','describe','addMessage','OpenchannelMessage','ids','length','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','rows','addTags','omit','spread','Tag','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','fullname','get','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','basename','root','views','downloadInteraction.ejs','Openchannel','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','sendStatus'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x29bd,0x16c));var _0xd29b=function(_0x538229,_0x1844c7){_0x538229=_0x538229-0x0;var _0x2557f5=_0x29bd[_0x538229];return _0x2557f5;};'use strict';var rimraf=require(_0xd29b('0x0'));var zipdir=require(_0xd29b('0x1'));var moment=require(_0xd29b('0x2'));var util=require(_0xd29b('0x3'));var path=require(_0xd29b('0x4'));var ejs=require(_0xd29b('0x5'));var fs=require('fs');var _=require(_0xd29b('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xd29b('0x7'));var pdf=require(_0xd29b('0x8'));var logger=require(_0xd29b('0x9'))(_0xd29b('0xa'));var config=require(_0xd29b('0xb'));var db=require(_0xd29b('0xc'))['db'];config[_0xd29b('0xd')]=_[_0xd29b('0xe')](config[_0xd29b('0xd')],{'host':_0xd29b('0xf'),'port':0x18eb});var socket=require(_0xd29b('0x10'))(new Redis(config[_0xd29b('0xd')]));require(_0xd29b('0x11'))[_0xd29b('0x12')](socket);function respondWithStatusCode(_0x2b49cb,_0x784dc){_0x784dc=_0x784dc||0xcc;return function(_0x43e19b){if(_0x43e19b){return _0x2b49cb['sendStatus'](_0x784dc);}return _0x2b49cb['status'](_0x784dc)[_0xd29b('0x13')]();};}function respondWithResult(_0x3031fc,_0x1102c3){_0x1102c3=_0x1102c3||0xc8;return function(_0x5be87d){if(_0x5be87d){return _0x3031fc[_0xd29b('0x14')](_0x1102c3)['json'](_0x5be87d);}};}function respondWithFilteredResult(_0x11fb2d,_0x11bf4d){return function(_0x3bae6a){if(_0x3bae6a){var _0x5b367f=typeof _0x11bf4d[_0xd29b('0x15')]===_0xd29b('0x16')&&typeof _0x11bf4d[_0xd29b('0x17')]===_0xd29b('0x16');var _0xf5664c=_0x3bae6a[_0xd29b('0x18')];var _0x4a91d4=_0x5b367f?0x0:_0x11bf4d[_0xd29b('0x15')];var _0x2d72a7=_0x5b367f?_0x3bae6a[_0xd29b('0x18')]:_0x11bf4d[_0xd29b('0x15')]+_0x11bf4d[_0xd29b('0x17')];var _0x3c0122;if(_0x2d72a7>=_0xf5664c){_0x2d72a7=_0xf5664c;_0x3c0122=0xc8;}else{_0x3c0122=0xce;}_0x11fb2d[_0xd29b('0x14')](_0x3c0122);return _0x11fb2d[_0xd29b('0x19')](_0xd29b('0x1a'),_0x4a91d4+'-'+_0x2d72a7+'/'+_0xf5664c)[_0xd29b('0x1b')](_0x3bae6a);}return null;};}function saveUpdates(_0x21b9ca){return function(_0x8e7982){if(_0x8e7982){return _0x8e7982[_0xd29b('0x1c')](_0x21b9ca)['then'](function(_0x5a21cc){return _0x5a21cc;});}return null;};}function removeEntity(_0x21206a){return function(_0xaf4a93){if(_0xaf4a93){return _0xaf4a93[_0xd29b('0x1d')]()[_0xd29b('0x1e')](function(){_0x21206a[_0xd29b('0x14')](0xcc)[_0xd29b('0x13')]();});}};}function handleEntityNotFound(_0x8b8b55){return function(_0x8a8736){if(!_0x8a8736){_0x8b8b55[_0xd29b('0x1f')](0x194);}return _0x8a8736;};}function handleError(_0x28f683,_0x2d223a){_0x2d223a=_0x2d223a||0x1f4;return function(_0x56ca21){logger[_0xd29b('0x20')](_0x56ca21[_0xd29b('0x21')]);if(_0x56ca21['name']){delete _0x56ca21[_0xd29b('0x22')];}_0x28f683[_0xd29b('0x14')](_0x2d223a)[_0xd29b('0x23')](_0x56ca21);};}exports[_0xd29b('0x24')]=function(_0x1774a4,_0x2bc678){var _0x1c71ca={};var _0x1ef447=_[_0xd29b('0x25')](db[_0xd29b('0x26')][_0xd29b('0x27')],function(_0x1017af){return{'name':_0x1017af['fieldName'],'type':_0x1017af[_0xd29b('0x28')][_0xd29b('0x29')]};});_0x1c71ca=qs[_0xd29b('0x2a')](_0x1ef447,_0x1774a4);return interaction['findAll'](_0xd29b('0x2b'),_0x1774a4['query'],_0x1774a4[_0xd29b('0x2c')],_0x1c71ca,_0x1ef447)[_0xd29b('0x1e')](respondWithFilteredResult(_0x2bc678,_0x1c71ca))[_0xd29b('0x2d')](handleError(_0x2bc678,null));};exports['show']=function(_0x1d21b6,_0x469238){var _0x506699={};if(_0x1d21b6['query'][_0xd29b('0x28')]&&_0x1d21b6['query'][_0xd29b('0x28')]===_0xd29b('0x2e')){_0x506699[_0xd29b('0x2e')]=_0x1d21b6[_0xd29b('0x2f')]['id'];}else{_0x506699['id']=_0x1d21b6['params']['id'];}var _0x57e151={'raw':![],'where':_0x506699},_0x428a5b={};_0x428a5b[_0xd29b('0x30')]=_[_0xd29b('0x31')](db[_0xd29b('0x26')][_0xd29b('0x27')]);_0x428a5b[_0xd29b('0x32')]=_[_0xd29b('0x31')](_0x1d21b6['query']);_0x428a5b[_0xd29b('0x33')]=_[_0xd29b('0x34')](_0x428a5b[_0xd29b('0x30')],_0x428a5b[_0xd29b('0x32')]);_0x57e151[_0xd29b('0x35')]=_['intersection'](_0x428a5b[_0xd29b('0x30')],qs['fields'](_0x1d21b6[_0xd29b('0x32')][_0xd29b('0x36')]));_0x57e151['attributes']=_0x57e151[_0xd29b('0x35')]['length']?_0x57e151[_0xd29b('0x35')]:_0x428a5b['model'];if(_0x1d21b6['query'][_0xd29b('0x37')]){_0x57e151[_0xd29b('0x38')]=[{'all':!![]}];}_0x57e151=_[_0xd29b('0x39')]({},_0x57e151,_0x1d21b6['options']);return db['OpenchannelInteraction'][_0xd29b('0x3a')](_0x57e151)[_0xd29b('0x1e')](handleEntityNotFound(_0x469238,null))[_0xd29b('0x1e')](respondWithResult(_0x469238,null))[_0xd29b('0x2d')](handleError(_0x469238,null));};exports[_0xd29b('0x3b')]=function(_0x3df4ac,_0x226733){return db[_0xd29b('0x26')][_0xd29b('0x3b')](_0x3df4ac[_0xd29b('0x3c')],{})[_0xd29b('0x1e')](respondWithResult(_0x226733,0xc9))[_0xd29b('0x2d')](handleError(_0x226733,null));};exports[_0xd29b('0x1c')]=function(_0x4b26a3,_0x3cf5de){if(_0x4b26a3['body']['id']){delete _0x4b26a3[_0xd29b('0x3c')]['id'];}return db['OpenchannelInteraction'][_0xd29b('0x3a')]({'where':{'id':_0x4b26a3[_0xd29b('0x2f')]['id']}})[_0xd29b('0x1e')](handleEntityNotFound(_0x3cf5de,null))['then'](saveUpdates(_0x4b26a3['body'],null))[_0xd29b('0x1e')](respondWithResult(_0x3cf5de,null))[_0xd29b('0x2d')](handleError(_0x3cf5de,null));};exports['destroy']=function(_0x199393,_0x500bca){return db[_0xd29b('0x26')][_0xd29b('0x3a')]({'where':{'id':_0x199393[_0xd29b('0x2f')]['id']}})[_0xd29b('0x1e')](handleEntityNotFound(_0x500bca,null))[_0xd29b('0x1e')](removeEntity(_0x500bca,null))[_0xd29b('0x2d')](handleError(_0x500bca,null));};exports[_0xd29b('0x3d')]=function(_0x17303c,_0x3b5bc0){return db[_0xd29b('0x26')]['describe']()[_0xd29b('0x1e')](respondWithResult(_0x3b5bc0,null))['catch'](handleError(_0x3b5bc0,null));};exports[_0xd29b('0x3e')]=function(_0x48c65b,_0xcbf835){return db[_0xd29b('0x3f')][_0xd29b('0x3a')]({'where':{'id':_0x48c65b[_0xd29b('0x2f')]['id']}})['then'](handleEntityNotFound(_0xcbf835,null))['then'](function(_0x237fae){if(_0x237fae){return _0x237fae[_0xd29b('0x3e')](_0x48c65b[_0xd29b('0x3c')][_0xd29b('0x40')],_['omit'](_0x48c65b[_0xd29b('0x3c')],[_0xd29b('0x40'),'id'])||{});}})[_0xd29b('0x1e')](respondWithResult(_0xcbf835,null))[_0xd29b('0x2d')](handleError(_0xcbf835,null));};exports['getMessages']=function(_0x134813,_0x3b020e){var _0x3ec92c={'raw':![],'where':{}};var _0x4b6d5a={};var _0x4221bf={'count':0x0,'rows':[]};return db[_0xd29b('0x26')]['findOne']({'where':{'id':_0x134813[_0xd29b('0x2f')]['id']}})[_0xd29b('0x1e')](handleEntityNotFound(_0x3b020e,null))[_0xd29b('0x1e')](function(_0x2cb812){if(_0x2cb812){_0x4b6d5a[_0xd29b('0x30')]=_[_0xd29b('0x31')](db[_0xd29b('0x3f')][_0xd29b('0x27')]);_0x4b6d5a[_0xd29b('0x32')]=_['keys'](_0x134813['query']);_0x4b6d5a[_0xd29b('0x33')]=_['intersection'](_0x4b6d5a['model'],_0x4b6d5a[_0xd29b('0x32')]);_0x3ec92c[_0xd29b('0x35')]=_['intersection'](_0x4b6d5a[_0xd29b('0x30')],qs['fields'](_0x134813['query'][_0xd29b('0x36')]));_0x3ec92c[_0xd29b('0x35')]=_0x3ec92c[_0xd29b('0x35')][_0xd29b('0x41')]?_0x3ec92c[_0xd29b('0x35')]:_0x4b6d5a[_0xd29b('0x30')];if(!_0x134813[_0xd29b('0x32')][_0xd29b('0x42')](_0xd29b('0x43'))){_0x3ec92c[_0xd29b('0x17')]=qs[_0xd29b('0x17')](_0x134813['query'][_0xd29b('0x17')]);_0x3ec92c[_0xd29b('0x15')]=qs[_0xd29b('0x15')](_0x134813[_0xd29b('0x32')][_0xd29b('0x15')]);}_0x3ec92c[_0xd29b('0x44')]=qs[_0xd29b('0x45')](_0x134813[_0xd29b('0x32')][_0xd29b('0x45')]);_0x3ec92c[_0xd29b('0x46')]=qs['filters'](_['pick'](_0x134813[_0xd29b('0x32')],_0x4b6d5a['filters']));_0x3ec92c[_0xd29b('0x46')][_0xd29b('0x47')]=_0x2cb812['id'];if(_0x134813[_0xd29b('0x32')]['filter']){_0x3ec92c[_0xd29b('0x46')]=_[_0xd29b('0x39')](_0x3ec92c['where'],{'$or':_['map'](_0x3ec92c[_0xd29b('0x35')],function(_0x19fa4c){var _0x53a267={};_0x53a267[_0x19fa4c]={'$like':'%'+_0x134813[_0xd29b('0x32')][_0xd29b('0x48')]+'%'};return _0x53a267;})});}if(_0x134813[_0xd29b('0x32')][_0xd29b('0x49')]){var _0x2db764=_0x134813[_0xd29b('0x32')]['$gte'][_0xd29b('0x4a')](',');var _0x371ec4={};_0x371ec4[_0x2db764[0x0]]={'$gte':moment(_0x2db764[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3ec92c[_0xd29b('0x46')]=_['merge'](_0x3ec92c[_0xd29b('0x46')],_0x371ec4);}_0x3ec92c=_[_0xd29b('0x39')]({},_0x3ec92c,_0x134813['options']);return db['OpenchannelMessage'][_0xd29b('0x18')]({'where':_0x3ec92c[_0xd29b('0x46')]})[_0xd29b('0x1e')](function(_0x53a932){_0x4221bf[_0xd29b('0x18')]=_0x53a932;if(_0x134813[_0xd29b('0x32')][_0xd29b('0x37')]){_0x3ec92c['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3ec92c);})[_0xd29b('0x1e')](function(_0x44cbab){_0x4221bf[_0xd29b('0x4b')]=_0x44cbab;return _0x4221bf;});}})[_0xd29b('0x1e')](respondWithFilteredResult(_0x3b020e,_0x3ec92c))[_0xd29b('0x2d')](handleError(_0x3b020e,null));};exports[_0xd29b('0x4c')]=function(_0x5172bc,_0x1a12db){return db['OpenchannelInteraction'][_0xd29b('0x3a')]({'where':{'id':_0x5172bc['params']['id']}})['then'](handleEntityNotFound(_0x1a12db,null))[_0xd29b('0x1e')](function(_0x1a8c03){if(_0x1a8c03){return _0x1a8c03['setTags'](_0x5172bc[_0xd29b('0x3c')][_0xd29b('0x40')],_[_0xd29b('0x4d')](_0x5172bc[_0xd29b('0x3c')],[_0xd29b('0x40'),'id'])||{})[_0xd29b('0x4e')](function(){return db[_0xd29b('0x4f')][_0xd29b('0x50')]({'attributes':['id',_0xd29b('0x22'),'color'],'where':{'id':_0x5172bc[_0xd29b('0x3c')][_0xd29b('0x40')]}});})[_0xd29b('0x1e')](function(_0x3751c9){socket[_0xd29b('0x51')](_0xd29b('0x52'),{'id':Number(_0x5172bc[_0xd29b('0x2f')]['id']),'tags':_0x3751c9||[]});return{'id':Number(_0x5172bc[_0xd29b('0x2f')]['id']),'tags':_0x3751c9||[]};});}})[_0xd29b('0x1e')](respondWithResult(_0x1a12db,null))[_0xd29b('0x2d')](handleError(_0x1a12db,null));};exports[_0xd29b('0x53')]=function(_0x4a0abc,_0x1bb336){return db[_0xd29b('0x26')][_0xd29b('0x3a')]({'where':{'id':_0x4a0abc[_0xd29b('0x2f')]['id']}})[_0xd29b('0x1e')](handleEntityNotFound(_0x1bb336,null))[_0xd29b('0x1e')](function(_0x507a58){if(_0x507a58){return _0x507a58[_0xd29b('0x53')](_0x4a0abc[_0xd29b('0x32')][_0xd29b('0x40')]);}})[_0xd29b('0x1e')](respondWithStatusCode(_0x1bb336,null))['catch'](handleError(_0x1bb336,null));};exports[_0xd29b('0x54')]=function(_0x129855,_0x5c49b3){var _0xfa9dcb=moment()[_0xd29b('0x55')]()[_0xd29b('0x56')]();var _0x8decf8=path['join'](config['root'],_0xd29b('0x57'),_0xd29b('0x58'),_0xd29b('0x59'));var _0x4307a3=path[_0xd29b('0x5a')](config['root'],_0xd29b('0x57'),_0xd29b('0x58'),_0xd29b('0x5b'));var _0x55cf30=path[_0xd29b('0x5a')](_0x8decf8,_0xfa9dcb);var _0x102fa1=util[_0xd29b('0x5c')](_0xd29b('0x5d'),_0x129855[_0xd29b('0x2f')]['id'],_0xfa9dcb);var _0x5e68b5=path['join'](_0x8decf8,_0x102fa1);var _0x4bc4bd=[];_0x4bc4bd[_0xd29b('0x5e')]({'model':db[_0xd29b('0x5f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4bc4bd['push']({'model':db[_0xd29b('0x60')],'as':_0xd29b('0x61'),'attributes':['id',_0xd29b('0x62'),_0xd29b('0x63')],'raw':!![]});if(_0x129855[_0xd29b('0x32')][_0xd29b('0x5b')]){_0x4bc4bd[_0xd29b('0x5e')]({'model':db[_0xd29b('0x64')],'as':_0xd29b('0x64'),'raw':!![]});}var _0x5c305c=[{'model':db[_0xd29b('0x3f')],'as':_0xd29b('0x65'),'attributes':['id',_0xd29b('0x3c'),_0xd29b('0x66'),'direction',_0xd29b('0x67'),_0xd29b('0x68')],'include':_0x4bc4bd}];_0x5c305c[_0xd29b('0x5e')]({'model':db[_0xd29b('0x69')],'as':_0xd29b('0x6a'),'attributes':['id',_0xd29b('0x22')]});_0x5c305c[_0xd29b('0x5e')]({'model':db[_0xd29b('0x5f')],'as':'Owner','attributes':['id',_0xd29b('0x6b')]});return db[_0xd29b('0x26')]['find']({'where':{'id':_0x129855['params']['id']},'include':_0x5c305c})[_0xd29b('0x1e')](handleEntityNotFound(_0x5c49b3,null))[_0xd29b('0x1e')](function(_0x2238aa){if(_0x2238aa){var _0x2ec334=_0x2238aa[_0xd29b('0x6c')]({'plain':!![]});fs[_0xd29b('0x6d')](_0x55cf30);var _0x612919={'channel':'Openchannel','account':_0x2ec334['Account'][_0xd29b('0x22')],'agent':_0x2ec334[_0xd29b('0x6e')]?_0x2ec334[_0xd29b('0x6e')][_0xd29b('0x6b')]:_0xd29b('0x6f'),'createdAt':moment(_0x2ec334[_0xd29b('0x66')])['format'](_0xd29b('0x70'))[_0xd29b('0x56')](),'closedAt':_0x2ec334[_0xd29b('0x71')]?moment(_0x2ec334[_0xd29b('0x72')])[_0xd29b('0x5c')](_0xd29b('0x70'))['toString']():'','disposition':_0x2ec334['disposition'],'visibility':_0x2ec334[_0xd29b('0x73')]?_0xd29b('0x74'):_0xd29b('0x75'),'messages':_(_0x2ec334[_0xd29b('0x65')])[_0xd29b('0x48')]({'secret':![]})[_0xd29b('0x25')](function(_0x59c23c){if(_0x59c23c['Attachment']){var _0x5cd67b=path[_0xd29b('0x5a')](_0x4307a3,_0x59c23c[_0xd29b('0x64')]['basename']);if(fs[_0xd29b('0x76')](_0x5cd67b)){fs[_0xd29b('0x77')](_0x5cd67b)[_0xd29b('0x78')](fs[_0xd29b('0x79')](path[_0xd29b('0x5a')](_0x55cf30,_0x59c23c[_0xd29b('0x64')]['basename'])));}}return{'date':moment(_0x59c23c[_0xd29b('0x66')])['format'](_0xd29b('0x70'))[_0xd29b('0x56')](),'sender':_0x59c23c[_0xd29b('0x7a')]===_0xd29b('0x7b')?_0x59c23c[_0xd29b('0x5f')]?_0x59c23c[_0xd29b('0x5f')][_0xd29b('0x6b')]:_0xd29b('0x7c'):_0x59c23c[_0xd29b('0x61')][_0xd29b('0x62')]+(_0x59c23c[_0xd29b('0x61')][_0xd29b('0x63')]?'\x20'+_0x59c23c[_0xd29b('0x61')][_0xd29b('0x63')]:''),'body':_0x59c23c['Attachment']?_0x59c23c['Attachment'][_0xd29b('0x7d')]:_0x59c23c[_0xd29b('0x3c')],'direction':_0x59c23c['direction']===_0xd29b('0x7b')?'A':'C','secret':_0x59c23c['secret'],'read':_0x59c23c[_0xd29b('0x68')],'attachment':_0x59c23c[_0xd29b('0x64')]};})['value']()};return ejs['renderFile'](path[_0xd29b('0x5a')](config[_0xd29b('0x7e')],_0xd29b('0x57'),_0xd29b('0x7f'),_0xd29b('0x80')),{'interaction':_0x612919})[_0xd29b('0x1e')](function(_0x56d217){var _0x9d57e5=path['join'](_0x55cf30,'transcript-'+_0x2ec334['id']+'-'+_0xfa9dcb+'.pdf');var _0x5ef02e={'path':_0x9d57e5,'channel':_0xd29b('0x81'),'interactionId':_0x2ec334['id']};return pdf[_0xd29b('0x82')](_0x56d217,_0x5ef02e);})[_0xd29b('0x1e')](function(){return new Promise(function(_0x265cd6,_0x4675e3){zipdir(_0x55cf30,{'saveTo':_0x5e68b5},function(_0x429fe6,_0x2362df){if(_0x429fe6)return _0x4675e3(_0x429fe6);return _0x265cd6(_0x2362df);});})[_0xd29b('0x1e')](function(){return new Promise(function(_0x45c488,_0x4674a8){rimraf(_0x55cf30,function(_0xa13b3f){if(_0xa13b3f)_0x4674a8(_0xa13b3f);return _0x45c488();});});})[_0xd29b('0x1e')](function(){return _0x5c49b3[_0xd29b('0x54')](_0x5e68b5,_0x102fa1,function(_0x400965){if(_0x400965){logger[_0xd29b('0x20')]('Unable\x20to\x20delete\x20zip\x20file',_0x400965);}else{fs[_0xd29b('0x83')](_0x5e68b5);}});});});}else{return _0x5c49b3[_0xd29b('0x1f')](0xc8);}})['catch'](handleError(_0x5c49b3,null));}; \ No newline at end of file +var _0x9454=['api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','error','stack','name','index','map','OpenchannelInteraction','fieldName','findAll','openchannel','user','then','show','query','type','from','params','model','keys','rawAttributes','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','body','describe','addMessage','OpenchannelMessage','omit','findOne','hasOwnProperty','nolimit','order','sort','filters','pick','where','OpenchannelInteractionId','filter','$gte','split','format','rows','addTags','setTags','ids','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','get','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','secret','renderFile','views','transcript-','.pdf','Openchannel','createPdfFromHTML','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger'];(function(_0x1f4251,_0xf94d85){var _0x5bc2f9=function(_0x29c5c2){while(--_0x29c5c2){_0x1f4251['push'](_0x1f4251['shift']());}};_0x5bc2f9(++_0xf94d85);}(_0x9454,0x179));var _0x4945=function(_0x346665,_0x1041b7){_0x346665=_0x346665-0x0;var _0x16f527=_0x9454[_0x346665];return _0x16f527;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4945('0x0'));var moment=require(_0x4945('0x1'));var util=require(_0x4945('0x2'));var path=require(_0x4945('0x3'));var ejs=require(_0x4945('0x4'));var fs=require('fs');var _=require(_0x4945('0x5'));var Redis=require(_0x4945('0x6'));var interaction=require(_0x4945('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4945('0x8'));var logger=require(_0x4945('0x9'))(_0x4945('0xa'));var config=require(_0x4945('0xb'));var db=require(_0x4945('0xc'))['db'];config['redis']=_['defaults'](config[_0x4945('0xd')],{'host':_0x4945('0xe'),'port':0x18eb});var socket=require(_0x4945('0xf'))(new Redis(config[_0x4945('0xd')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4d4788,_0xf71b0){_0xf71b0=_0xf71b0||0xcc;return function(_0x188490){if(_0x188490){return _0x4d4788[_0x4945('0x10')](_0xf71b0);}return _0x4d4788[_0x4945('0x11')](_0xf71b0)['end']();};}function respondWithResult(_0x545307,_0x1e5fb9){_0x1e5fb9=_0x1e5fb9||0xc8;return function(_0x5953cf){if(_0x5953cf){return _0x545307['status'](_0x1e5fb9)[_0x4945('0x12')](_0x5953cf);}};}function respondWithFilteredResult(_0x2dfecf,_0x3df3f7){return function(_0x114d28){if(_0x114d28){var _0x2a5d14=typeof _0x3df3f7[_0x4945('0x13')]===_0x4945('0x14')&&typeof _0x3df3f7[_0x4945('0x15')]===_0x4945('0x14');var _0xc7748a=_0x114d28['count'];var _0x1ab3e5=_0x2a5d14?0x0:_0x3df3f7[_0x4945('0x13')];var _0x5343d1=_0x2a5d14?_0x114d28[_0x4945('0x16')]:_0x3df3f7[_0x4945('0x13')]+_0x3df3f7[_0x4945('0x15')];var _0x371eb4;if(_0x5343d1>=_0xc7748a){_0x5343d1=_0xc7748a;_0x371eb4=0xc8;}else{_0x371eb4=0xce;}_0x2dfecf[_0x4945('0x11')](_0x371eb4);return _0x2dfecf[_0x4945('0x17')](_0x4945('0x18'),_0x1ab3e5+'-'+_0x5343d1+'/'+_0xc7748a)[_0x4945('0x12')](_0x114d28);}return null;};}function saveUpdates(_0x12105f){return function(_0x57a54c){if(_0x57a54c){return _0x57a54c['update'](_0x12105f)['then'](function(_0x1e2dab){return _0x1e2dab;});}return null;};}function removeEntity(_0x3e77b8){return function(_0x16b4a1){if(_0x16b4a1){return _0x16b4a1[_0x4945('0x19')]()['then'](function(){_0x3e77b8[_0x4945('0x11')](0xcc)[_0x4945('0x1a')]();});}};}function handleEntityNotFound(_0x1b58e4){return function(_0x2fd470){if(!_0x2fd470){_0x1b58e4[_0x4945('0x10')](0x194);}return _0x2fd470;};}function handleError(_0x9f548d,_0x32c183){_0x32c183=_0x32c183||0x1f4;return function(_0x49e177){logger[_0x4945('0x1b')](_0x49e177[_0x4945('0x1c')]);if(_0x49e177[_0x4945('0x1d')]){delete _0x49e177[_0x4945('0x1d')];}_0x9f548d[_0x4945('0x11')](_0x32c183)['send'](_0x49e177);};}exports[_0x4945('0x1e')]=function(_0x32bcbe,_0xb9547b){var _0xf3038d={};var _0x17944b=_[_0x4945('0x1f')](db[_0x4945('0x20')]['rawAttributes'],function(_0x2c3ecd){return{'name':_0x2c3ecd[_0x4945('0x21')],'type':_0x2c3ecd['type']['key']};});_0xf3038d=qs['getOptions'](_0x17944b,_0x32bcbe);return interaction[_0x4945('0x22')](_0x4945('0x23'),_0x32bcbe['query'],_0x32bcbe[_0x4945('0x24')],_0xf3038d,_0x17944b)[_0x4945('0x25')](respondWithFilteredResult(_0xb9547b,_0xf3038d))['catch'](handleError(_0xb9547b,null));};exports[_0x4945('0x26')]=function(_0x6bd217,_0x129ffe){var _0x458cd={};if(_0x6bd217[_0x4945('0x27')][_0x4945('0x28')]&&_0x6bd217['query'][_0x4945('0x28')]===_0x4945('0x29')){_0x458cd[_0x4945('0x29')]=_0x6bd217[_0x4945('0x2a')]['id'];}else{_0x458cd['id']=_0x6bd217[_0x4945('0x2a')]['id'];}var _0xeec73d={'raw':![],'where':_0x458cd},_0x1348f6={};_0x1348f6[_0x4945('0x2b')]=_[_0x4945('0x2c')](db['OpenchannelInteraction'][_0x4945('0x2d')]);_0x1348f6[_0x4945('0x27')]=_[_0x4945('0x2c')](_0x6bd217[_0x4945('0x27')]);_0x1348f6['filters']=_[_0x4945('0x2e')](_0x1348f6[_0x4945('0x2b')],_0x1348f6[_0x4945('0x27')]);_0xeec73d['attributes']=_[_0x4945('0x2e')](_0x1348f6[_0x4945('0x2b')],qs[_0x4945('0x2f')](_0x6bd217[_0x4945('0x27')][_0x4945('0x2f')]));_0xeec73d[_0x4945('0x30')]=_0xeec73d['attributes'][_0x4945('0x31')]?_0xeec73d[_0x4945('0x30')]:_0x1348f6[_0x4945('0x2b')];if(_0x6bd217[_0x4945('0x27')][_0x4945('0x32')]){_0xeec73d[_0x4945('0x33')]=[{'all':!![]}];}_0xeec73d=_[_0x4945('0x34')]({},_0xeec73d,_0x6bd217[_0x4945('0x35')]);return db[_0x4945('0x20')][_0x4945('0x36')](_0xeec73d)[_0x4945('0x25')](handleEntityNotFound(_0x129ffe,null))['then'](respondWithResult(_0x129ffe,null))[_0x4945('0x37')](handleError(_0x129ffe,null));};exports['create']=function(_0xe4d561,_0x2dc788){return db[_0x4945('0x20')]['create'](_0xe4d561['body'],{})[_0x4945('0x25')](respondWithResult(_0x2dc788,0xc9))[_0x4945('0x37')](handleError(_0x2dc788,null));};exports['update']=function(_0x5a3b25,_0x449c3a){if(_0x5a3b25[_0x4945('0x38')]['id']){delete _0x5a3b25[_0x4945('0x38')]['id'];}return db[_0x4945('0x20')]['find']({'where':{'id':_0x5a3b25[_0x4945('0x2a')]['id']}})['then'](handleEntityNotFound(_0x449c3a,null))[_0x4945('0x25')](saveUpdates(_0x5a3b25[_0x4945('0x38')],null))['then'](respondWithResult(_0x449c3a,null))[_0x4945('0x37')](handleError(_0x449c3a,null));};exports[_0x4945('0x19')]=function(_0x3aefae,_0x24cb71){return db[_0x4945('0x20')][_0x4945('0x36')]({'where':{'id':_0x3aefae[_0x4945('0x2a')]['id']}})['then'](handleEntityNotFound(_0x24cb71,null))[_0x4945('0x25')](removeEntity(_0x24cb71,null))[_0x4945('0x37')](handleError(_0x24cb71,null));};exports[_0x4945('0x39')]=function(_0x58fbf1,_0x7ef3b7){return db[_0x4945('0x20')][_0x4945('0x39')]()[_0x4945('0x25')](respondWithResult(_0x7ef3b7,null))[_0x4945('0x37')](handleError(_0x7ef3b7,null));};exports[_0x4945('0x3a')]=function(_0x495db3,_0xe99d8){return db[_0x4945('0x3b')]['find']({'where':{'id':_0x495db3[_0x4945('0x2a')]['id']}})['then'](handleEntityNotFound(_0xe99d8,null))[_0x4945('0x25')](function(_0x5d796b){if(_0x5d796b){return _0x5d796b[_0x4945('0x3a')](_0x495db3['body']['ids'],_[_0x4945('0x3c')](_0x495db3[_0x4945('0x38')],['ids','id'])||{});}})[_0x4945('0x25')](respondWithResult(_0xe99d8,null))[_0x4945('0x37')](handleError(_0xe99d8,null));};exports['getMessages']=function(_0x5b601c,_0x31b3e2){var _0x492de9={'raw':![],'where':{}};var _0x1b9a7f={};var _0x21880d={'count':0x0,'rows':[]};return db[_0x4945('0x20')][_0x4945('0x3d')]({'where':{'id':_0x5b601c[_0x4945('0x2a')]['id']}})[_0x4945('0x25')](handleEntityNotFound(_0x31b3e2,null))[_0x4945('0x25')](function(_0x45b0f7){if(_0x45b0f7){_0x1b9a7f[_0x4945('0x2b')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x1b9a7f['query']=_['keys'](_0x5b601c[_0x4945('0x27')]);_0x1b9a7f['filters']=_[_0x4945('0x2e')](_0x1b9a7f[_0x4945('0x2b')],_0x1b9a7f[_0x4945('0x27')]);_0x492de9['attributes']=_['intersection'](_0x1b9a7f['model'],qs['fields'](_0x5b601c['query'][_0x4945('0x2f')]));_0x492de9['attributes']=_0x492de9[_0x4945('0x30')][_0x4945('0x31')]?_0x492de9[_0x4945('0x30')]:_0x1b9a7f['model'];if(!_0x5b601c[_0x4945('0x27')][_0x4945('0x3e')](_0x4945('0x3f'))){_0x492de9[_0x4945('0x15')]=qs[_0x4945('0x15')](_0x5b601c['query'][_0x4945('0x15')]);_0x492de9[_0x4945('0x13')]=qs[_0x4945('0x13')](_0x5b601c[_0x4945('0x27')]['offset']);}_0x492de9[_0x4945('0x40')]=qs[_0x4945('0x41')](_0x5b601c[_0x4945('0x27')][_0x4945('0x41')]);_0x492de9['where']=qs[_0x4945('0x42')](_[_0x4945('0x43')](_0x5b601c['query'],_0x1b9a7f['filters']));_0x492de9[_0x4945('0x44')][_0x4945('0x45')]=_0x45b0f7['id'];if(_0x5b601c[_0x4945('0x27')][_0x4945('0x46')]){_0x492de9[_0x4945('0x44')]=_['merge'](_0x492de9[_0x4945('0x44')],{'$or':_[_0x4945('0x1f')](_0x492de9['attributes'],function(_0x1ebca1){var _0x333df0={};_0x333df0[_0x1ebca1]={'$like':'%'+_0x5b601c['query'][_0x4945('0x46')]+'%'};return _0x333df0;})});}if(_0x5b601c[_0x4945('0x27')][_0x4945('0x47')]){var _0x5a3c1d=_0x5b601c['query'][_0x4945('0x47')][_0x4945('0x48')](',');var _0x6c1b04={};_0x6c1b04[_0x5a3c1d[0x0]]={'$gte':moment(_0x5a3c1d[0x1])[_0x4945('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x492de9['where']=_[_0x4945('0x34')](_0x492de9[_0x4945('0x44')],_0x6c1b04);}_0x492de9=_[_0x4945('0x34')]({},_0x492de9,_0x5b601c[_0x4945('0x35')]);return db[_0x4945('0x3b')][_0x4945('0x16')]({'where':_0x492de9[_0x4945('0x44')]})[_0x4945('0x25')](function(_0x59ef90){_0x21880d[_0x4945('0x16')]=_0x59ef90;if(_0x5b601c['query'][_0x4945('0x32')]){_0x492de9[_0x4945('0x33')]=[{'all':!![]}];}return db[_0x4945('0x3b')]['findAll'](_0x492de9);})[_0x4945('0x25')](function(_0x2bdef4){_0x21880d[_0x4945('0x4a')]=_0x2bdef4;return _0x21880d;});}})[_0x4945('0x25')](respondWithFilteredResult(_0x31b3e2,_0x492de9))[_0x4945('0x37')](handleError(_0x31b3e2,null));};exports[_0x4945('0x4b')]=function(_0x3a82df,_0x56a85c){return db[_0x4945('0x20')][_0x4945('0x36')]({'where':{'id':_0x3a82df[_0x4945('0x2a')]['id']}})[_0x4945('0x25')](handleEntityNotFound(_0x56a85c,null))[_0x4945('0x25')](function(_0x292e19){if(_0x292e19){return _0x292e19[_0x4945('0x4c')](_0x3a82df[_0x4945('0x38')]['ids'],_[_0x4945('0x3c')](_0x3a82df['body'],[_0x4945('0x4d'),'id'])||{})[_0x4945('0x4e')](function(){return db[_0x4945('0x4f')][_0x4945('0x22')]({'attributes':['id',_0x4945('0x1d'),_0x4945('0x50')],'where':{'id':_0x3a82df[_0x4945('0x38')][_0x4945('0x4d')]}});})[_0x4945('0x25')](function(_0x23f2fd){socket['emit'](_0x4945('0x51'),{'id':Number(_0x3a82df['params']['id']),'tags':_0x23f2fd||[]});return{'id':Number(_0x3a82df[_0x4945('0x2a')]['id']),'tags':_0x23f2fd||[]};});}})[_0x4945('0x25')](respondWithResult(_0x56a85c,null))[_0x4945('0x37')](handleError(_0x56a85c,null));};exports[_0x4945('0x52')]=function(_0x1a5b73,_0xdfd479){return db[_0x4945('0x20')][_0x4945('0x36')]({'where':{'id':_0x1a5b73[_0x4945('0x2a')]['id']}})[_0x4945('0x25')](handleEntityNotFound(_0xdfd479,null))[_0x4945('0x25')](function(_0x2b7c9e){if(_0x2b7c9e){return _0x2b7c9e[_0x4945('0x52')](_0x1a5b73['query'][_0x4945('0x4d')]);}})[_0x4945('0x25')](respondWithStatusCode(_0xdfd479,null))['catch'](handleError(_0xdfd479,null));};exports[_0x4945('0x53')]=function(_0x5c5fef,_0x3ece33){var _0x4cd6c5=moment()[_0x4945('0x54')]()[_0x4945('0x55')]();var _0x15403f=path[_0x4945('0x56')](config['root'],_0x4945('0x57'),_0x4945('0x58'),_0x4945('0x59'));var _0x42e5b4=path[_0x4945('0x56')](config[_0x4945('0x5a')],_0x4945('0x57'),'files','attachments');var _0xfcc723=path['join'](_0x15403f,_0x4cd6c5);var _0xe88be=util[_0x4945('0x49')](_0x4945('0x5b'),_0x5c5fef[_0x4945('0x2a')]['id'],_0x4cd6c5);var _0x3f547e=path[_0x4945('0x56')](_0x15403f,_0xe88be);var _0x13caf5=[];_0x13caf5[_0x4945('0x5c')]({'model':db[_0x4945('0x5d')],'as':'User','attributes':['id',_0x4945('0x5e')],'raw':!![]});_0x13caf5[_0x4945('0x5c')]({'model':db[_0x4945('0x5f')],'as':_0x4945('0x60'),'attributes':['id','firstName',_0x4945('0x61')],'raw':!![]});if(_0x5c5fef['query'][_0x4945('0x62')]){_0x13caf5[_0x4945('0x5c')]({'model':db[_0x4945('0x63')],'as':_0x4945('0x63'),'raw':!![]});}var _0x3c7c15=[{'model':db[_0x4945('0x3b')],'as':_0x4945('0x64'),'attributes':['id',_0x4945('0x38'),_0x4945('0x65'),_0x4945('0x66'),'secret',_0x4945('0x67')],'include':_0x13caf5}];_0x3c7c15['push']({'model':db[_0x4945('0x68')],'as':'Account','attributes':['id',_0x4945('0x1d')]});_0x3c7c15[_0x4945('0x5c')]({'model':db[_0x4945('0x5d')],'as':'Owner','attributes':['id',_0x4945('0x5e')]});return db[_0x4945('0x20')]['find']({'where':{'id':_0x5c5fef[_0x4945('0x2a')]['id']},'include':_0x3c7c15})['then'](handleEntityNotFound(_0x3ece33,null))[_0x4945('0x25')](function(_0x4147cc){if(_0x4147cc){var _0x37432c=_0x4147cc[_0x4945('0x69')]({'plain':!![]});fs['mkdirSync'](_0xfcc723);var _0x410d55={'channel':'Openchannel','account':_0x37432c[_0x4945('0x6a')]['name'],'agent':_0x37432c[_0x4945('0x6b')]?_0x37432c[_0x4945('0x6b')][_0x4945('0x5e')]:_0x4945('0x6c'),'createdAt':moment(_0x37432c[_0x4945('0x65')])[_0x4945('0x49')](_0x4945('0x6d'))[_0x4945('0x55')](),'closedAt':_0x37432c['closed']?moment(_0x37432c[_0x4945('0x6e')])[_0x4945('0x49')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x37432c['disposition'],'visibility':_0x37432c[_0x4945('0x6f')]?_0x4945('0x70'):'Private','messages':_(_0x37432c[_0x4945('0x64')])[_0x4945('0x46')]({'secret':![]})['map'](function(_0x4d6b3a){if(_0x4d6b3a[_0x4945('0x63')]){var _0x530b9b=path[_0x4945('0x56')](_0x42e5b4,_0x4d6b3a[_0x4945('0x63')][_0x4945('0x71')]);if(fs[_0x4945('0x72')](_0x530b9b)){fs[_0x4945('0x73')](_0x530b9b)[_0x4945('0x74')](fs[_0x4945('0x75')](path['join'](_0xfcc723,_0x4d6b3a[_0x4945('0x63')]['basename'])));}}return{'date':moment(_0x4d6b3a[_0x4945('0x65')])[_0x4945('0x49')](_0x4945('0x6d'))[_0x4945('0x55')](),'sender':_0x4d6b3a[_0x4945('0x66')]===_0x4945('0x76')?_0x4d6b3a[_0x4945('0x5d')]?_0x4d6b3a[_0x4945('0x5d')][_0x4945('0x5e')]:_0x4945('0x77'):_0x4d6b3a[_0x4945('0x60')][_0x4945('0x78')]+(_0x4d6b3a[_0x4945('0x60')][_0x4945('0x61')]?'\x20'+_0x4d6b3a['Contact'][_0x4945('0x61')]:''),'body':_0x4d6b3a[_0x4945('0x63')]?_0x4d6b3a[_0x4945('0x63')][_0x4945('0x71')]:_0x4d6b3a[_0x4945('0x38')],'direction':_0x4d6b3a[_0x4945('0x66')]===_0x4945('0x76')?'A':'C','secret':_0x4d6b3a[_0x4945('0x79')],'read':_0x4d6b3a[_0x4945('0x67')],'attachment':_0x4d6b3a['Attachment']};})['value']()};return ejs[_0x4945('0x7a')](path[_0x4945('0x56')](config[_0x4945('0x5a')],_0x4945('0x57'),_0x4945('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x410d55})[_0x4945('0x25')](function(_0xf452d9){var _0x39c942=path[_0x4945('0x56')](_0xfcc723,_0x4945('0x7c')+_0x37432c['id']+'-'+_0x4cd6c5+_0x4945('0x7d'));var _0x33b92c={'path':_0x39c942,'channel':_0x4945('0x7e'),'interactionId':_0x37432c['id']};return pdf[_0x4945('0x7f')](_0xf452d9,_0x33b92c);})[_0x4945('0x25')](function(){return new Promise(function(_0x4b2a2d,_0x3eac77){zipdir(_0xfcc723,{'saveTo':_0x3f547e},function(_0x4138e8,_0x2bce70){if(_0x4138e8)return _0x3eac77(_0x4138e8);return _0x4b2a2d(_0x2bce70);});})['then'](function(){return new Promise(function(_0x403011,_0x2670dd){rimraf(_0xfcc723,function(_0x52d062){if(_0x52d062)_0x2670dd(_0x52d062);return _0x403011();});});})['then'](function(){return _0x3ece33[_0x4945('0x53')](_0x3f547e,_0xe88be,function(_0x326cdd){if(_0x326cdd){logger[_0x4945('0x1b')]('Unable\x20to\x20delete\x20zip\x20file',_0x326cdd);}else{fs[_0x4945('0x80')](_0x3f547e);}});});});}else{return _0x3ece33[_0x4945('0x10')](0xc8);}})['catch'](handleError(_0x3ece33,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index fc7ffa6..6ba74d8 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 _0x4e23=['setMaxListeners','remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x4e23,0x183));var _0x34e2=function(_0x8b2fb8,_0x547221){_0x8b2fb8=_0x8b2fb8-0x0;var _0x28059e=_0x4e23[_0x8b2fb8];return _0x28059e;};'use strict';var EventEmitter=require(_0x34e2('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x34e2('0x1')];var OpenchannelMessage=require(_0x34e2('0x2'))['db'][_0x34e2('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x34e2('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x34e2('0x5')};function emitEvent(_0x13133a){return function(_0x37c662,_0x542035,_0x35c8da){_0x37c662[_0x34e2('0x6')]({'attributes':['id'],'raw':!![]})[_0x34e2('0x7')](function(_0x1cabac){_0x37c662[_0x34e2('0x8')]('Users',_0x1cabac['map'](function(_0x53922c){return{'id':_0x53922c['id']};}));return OpenchannelMessage[_0x34e2('0x9')]({'where':{'OpenchannelInteractionId':_0x37c662['id'],'direction':'in','read':![]},'raw':!![]});})[_0x34e2('0x7')](function(_0x1069a7){_0x37c662['setDataValue'](_0x34e2('0xa'),_0x1069a7[_0x34e2('0xb')]);OpenchannelInteractionEvents['emit'](_0x13133a+':'+_0x37c662['id'],_0x37c662);OpenchannelInteractionEvents[_0x34e2('0xc')](_0x13133a,_0x37c662);_0x35c8da(null);})[_0x34e2('0xd')](_0x35c8da(null));};}for(var e in events){if(events[_0x34e2('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x34e2('0xf')](e,emitEvent(event));}}module[_0x34e2('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1b1e=['setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x21bbee,_0x1b4a3d){var _0x29c1e1=function(_0x58034e){while(--_0x58034e){_0x21bbee['push'](_0x21bbee['shift']());}};_0x29c1e1(++_0x1b4a3d);}(_0x1b1e,0x10b));var _0xe1b1=function(_0x53dd9b,_0x24d9e9){_0x53dd9b=_0x53dd9b-0x0;var _0x42f82b=_0x1b1e[_0x53dd9b];return _0x42f82b;};'use strict';var EventEmitter=require(_0xe1b1('0x0'));var OpenchannelInteraction=require(_0xe1b1('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe1b1('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe1b1('0x3')](0x0);var events={'afterCreate':_0xe1b1('0x4'),'afterUpdate':_0xe1b1('0x5'),'afterDestroy':_0xe1b1('0x6')};function emitEvent(_0x18fdef){return function(_0x1e3a01,_0x4e1c70,_0x1eaf67){_0x1e3a01[_0xe1b1('0x7')]({'attributes':['id'],'raw':!![]})[_0xe1b1('0x8')](function(_0x242776){_0x1e3a01['setDataValue']('Users',_0x242776[_0xe1b1('0x9')](function(_0x80cedd){return{'id':_0x80cedd['id']};}));return OpenchannelMessage[_0xe1b1('0xa')]({'where':{'OpenchannelInteractionId':_0x1e3a01['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe1b1('0x8')](function(_0x30d3df){_0x1e3a01[_0xe1b1('0xb')](_0xe1b1('0xc'),_0x30d3df[_0xe1b1('0xd')]);OpenchannelInteractionEvents[_0xe1b1('0xe')](_0x18fdef+':'+_0x1e3a01['id'],_0x1e3a01);OpenchannelInteractionEvents[_0xe1b1('0xe')](_0x18fdef,_0x1e3a01);_0x1eaf67(null);})[_0xe1b1('0xf')](_0x1eaf67(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xe1b1('0x10')](e,emitEvent(event));}}module[_0xe1b1('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 43d1dec..946b849 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 _0xbcd9=['utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4'];(function(_0x414549,_0x5829e0){var _0x3f488c=function(_0x3b97e4){while(--_0x3b97e4){_0x414549['push'](_0x414549['shift']());}};_0x3f488c(++_0x5829e0);}(_0xbcd9,0x105));var _0x9bcd=function(_0xaf292,_0x38baae){_0xaf292=_0xaf292-0x0;var _0x32a0d1=_0xbcd9[_0xaf292];return _0x32a0d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9bcd('0x0'));var moment=require(_0x9bcd('0x1'));var BPromise=require(_0x9bcd('0x2'));var rp=require(_0x9bcd('0x3'));var fs=require('fs');var path=require(_0x9bcd('0x4'));var rimraf=require('rimraf');var config=require(_0x9bcd('0x5'));var attributes=require(_0x9bcd('0x6'));module[_0x9bcd('0x7')]=function(_0x21779f,_0x49b73b){return _0x21779f[_0x9bcd('0x8')](_0x9bcd('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9bcd('0xa'),'collate':_0x9bcd('0xb'),'hooks':{'beforeUpdate':function(_0x3e3680,_0x469cbd,_0xa6583e){if(_0x3e3680[_0x9bcd('0xc')]('closed')){_0x3e3680[_0x9bcd('0xd')]=moment()[_0x9bcd('0xe')](_0x9bcd('0xf'));}_0xa6583e(null,_0x3e3680);}}});}; \ No newline at end of file +var _0x932e=['exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x32436d,_0x1e2b21){var _0x157038=function(_0x5bd3b9){while(--_0x5bd3b9){_0x32436d['push'](_0x32436d['shift']());}};_0x157038(++_0x1e2b21);}(_0x932e,0x1d3));var _0xe932=function(_0x33958e,_0x1c2974){_0x33958e=_0x33958e-0x0;var _0x2029fd=_0x932e[_0x33958e];return _0x2029fd;};'use strict';var _=require(_0xe932('0x0'));var util=require(_0xe932('0x1'));var logger=require(_0xe932('0x2'))(_0xe932('0x3'));var moment=require(_0xe932('0x4'));var BPromise=require('bluebird');var rp=require(_0xe932('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe932('0x6'));var config=require(_0xe932('0x7'));var attributes=require(_0xe932('0x8'));module[_0xe932('0x9')]=function(_0x1145ca,_0x2ba006){return _0x1145ca[_0xe932('0xa')](_0xe932('0xb'),attributes,{'tableName':_0xe932('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x197af7,_0xef411f,_0x2c5dd8){if(_0x197af7[_0xe932('0xd')](_0xe932('0xe'))){_0x197af7['closedAt']=moment()[_0xe932('0xf')](_0xe932('0x10'));}_0x2c5dd8(null,_0x197af7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index fb3fb24..a71a676 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 _0x75a5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','ids','omit','spread','AddTags','moment','randomstring'];(function(_0x3b52af,_0x53b4ca){var _0x4b3c6c=function(_0x589446){while(--_0x589446){_0x3b52af['push'](_0x3b52af['shift']());}};_0x4b3c6c(++_0x53b4ca);}(_0x75a5,0x1ea));var _0x575a=function(_0x209577,_0xb63b8f){_0x209577=_0x209577-0x0;var _0x47a69a=_0x75a5[_0x209577];return _0x47a69a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x575a('0x0'));var BPromise=require('bluebird');var rs=require(_0x575a('0x1'));var fs=require('fs');var Redis=require(_0x575a('0x2'));var db=require(_0x575a('0x3'))['db'];var utils=require(_0x575a('0x4'));var logger=require(_0x575a('0x5'))(_0x575a('0x6'));var config=require(_0x575a('0x7'));var jayson=require(_0x575a('0x8'));var client=jayson[_0x575a('0x9')][_0x575a('0xa')]({'port':0x232a});config[_0x575a('0xb')]=_['defaults'](config['redis'],{'host':_0x575a('0xc'),'port':0x18eb});var socket=require(_0x575a('0xd'))(new Redis(config[_0x575a('0xb')]));require(_0x575a('0xe'))['register'](socket);function respondWithRpcPromise(_0x23f4d1,_0x1eb5c4,_0x3084d2){return new BPromise(function(_0x130459,_0x56f269){return client[_0x575a('0xf')](_0x23f4d1,_0x3084d2)[_0x575a('0x10')](function(_0x3f84fc){logger[_0x575a('0x11')](_0x575a('0x12'),_0x1eb5c4,_0x575a('0x13'));logger[_0x575a('0x14')](_0x575a('0x15'),_0x1eb5c4,_0x575a('0x13'),JSON['stringify'](_0x3f84fc));if(_0x3f84fc['error']){if(_0x3f84fc[_0x575a('0x16')][_0x575a('0x17')]===0x1f4){logger[_0x575a('0x16')](_0x575a('0x12'),_0x1eb5c4,_0x3f84fc['error']['message']);return _0x56f269(_0x3f84fc['error']['message']);}logger['error'](_0x575a('0x12'),_0x1eb5c4,_0x3f84fc[_0x575a('0x16')][_0x575a('0x18')]);return _0x130459(_0x3f84fc[_0x575a('0x16')][_0x575a('0x18')]);}else{logger['info'](_0x575a('0x12'),_0x1eb5c4,_0x575a('0x13'));_0x130459(_0x3f84fc[_0x575a('0x19')][_0x575a('0x18')]);}})[_0x575a('0x1a')](function(_0x5865a5){logger[_0x575a('0x16')](_0x575a('0x12'),_0x1eb5c4,_0x5865a5);_0x56f269(_0x5865a5);});});}exports[_0x575a('0x1b')]=function(_0x219b89){var _0x2a18b9=this;return new Promise(function(_0x45f599,_0x145f56){return db['OpenchannelInteraction'][_0x575a('0x1c')](_0x219b89[_0x575a('0x1d')],{'raw':_0x219b89[_0x575a('0x1e')]?_0x219b89[_0x575a('0x1e')][_0x575a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x219b89[_0x575a('0x1e')]?_0x219b89[_0x575a('0x1e')]['where']||null:null,'attributes':_0x219b89['options']?_0x219b89[_0x575a('0x1e')]['attributes']||null:null,'limit':_0x219b89[_0x575a('0x1e')]?_0x219b89[_0x575a('0x1e')]['limit']||null:null})[_0x575a('0x10')](function(_0x156faa){logger[_0x575a('0x11')]('UpdateOpenchannelInteraction',_0x219b89);logger[_0x575a('0x14')](_0x575a('0x1b'),_0x219b89,JSON[_0x575a('0x20')](_0x156faa));_0x45f599(_0x156faa);})[_0x575a('0x1a')](function(_0x4429b2){logger['error'](_0x575a('0x1b'),_0x4429b2[_0x575a('0x18')],_0x219b89);_0x145f56(_0x2a18b9[_0x575a('0x16')](0x1f4,_0x4429b2[_0x575a('0x18')]));});});};exports[_0x575a('0x21')]=function(_0x57d1a8){return new Promise(function(_0x458ba2,_0x4c9de3){return db[_0x575a('0x22')][_0x575a('0x23')]({'where':_0x57d1a8[_0x575a('0x1e')]?_0x57d1a8[_0x575a('0x1e')][_0x575a('0x24')]||null:null})[_0x575a('0x10')](function(_0x16b4db){if(_0x16b4db){return _0x16b4db['addTags'](_0x57d1a8[_0x575a('0x1d')][_0x575a('0x25')],_[_0x575a('0x26')](_0x57d1a8['body'],[_0x575a('0x25'),'id'])||{});}})[_0x575a('0x27')](function(_0xa13ae5){logger[_0x575a('0x11')](_0x575a('0x28'),_0x57d1a8);logger[_0x575a('0x14')](_0x575a('0x28'),_0x57d1a8,JSON[_0x575a('0x20')](_0xa13ae5));_0x458ba2(_0xa13ae5);})[_0x575a('0x1a')](function(_0x28ef96){logger['error'](_0x575a('0x28'),_0x28ef96[_0x575a('0x18')],_0x57d1a8);_0x4c9de3(_this['error'](0x1f4,_0x28ef96[_0x575a('0x18')]));});});}; \ No newline at end of file +var _0xc0f1=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','omit','ids','spread','debug','AddTags'];(function(_0x2850c0,_0x1363a7){var _0x21e830=function(_0x3ec70a){while(--_0x3ec70a){_0x2850c0['push'](_0x2850c0['shift']());}};_0x21e830(++_0x1363a7);}(_0xc0f1,0x102));var _0x1c0f=function(_0x5bdb83,_0x3605de){_0x5bdb83=_0x5bdb83-0x0;var _0x1986bb=_0xc0f1[_0x5bdb83];return _0x1986bb;};'use strict';var _=require(_0x1c0f('0x0'));var util=require(_0x1c0f('0x1'));var moment=require(_0x1c0f('0x2'));var BPromise=require('bluebird');var rs=require(_0x1c0f('0x3'));var fs=require('fs');var Redis=require(_0x1c0f('0x4'));var db=require(_0x1c0f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c0f('0x6'))(_0x1c0f('0x7'));var config=require(_0x1c0f('0x8'));var jayson=require(_0x1c0f('0x9'));var client=jayson[_0x1c0f('0xa')]['http']({'port':0x232a});config[_0x1c0f('0xb')]=_['defaults'](config[_0x1c0f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c0f('0xc'))(new Redis(config[_0x1c0f('0xb')]));require(_0x1c0f('0xd'))[_0x1c0f('0xe')](socket);function respondWithRpcPromise(_0x5e19e3,_0x50cbeb,_0x95d62f){return new BPromise(function(_0x41744c,_0x1f322c){return client[_0x1c0f('0xf')](_0x5e19e3,_0x95d62f)[_0x1c0f('0x10')](function(_0x49d1fa){logger[_0x1c0f('0x11')](_0x1c0f('0x12'),_0x50cbeb,'request\x20sent');logger['debug'](_0x1c0f('0x13'),_0x50cbeb,_0x1c0f('0x14'),JSON['stringify'](_0x49d1fa));if(_0x49d1fa[_0x1c0f('0x15')]){if(_0x49d1fa[_0x1c0f('0x15')][_0x1c0f('0x16')]===0x1f4){logger[_0x1c0f('0x15')](_0x1c0f('0x12'),_0x50cbeb,_0x49d1fa[_0x1c0f('0x15')][_0x1c0f('0x17')]);return _0x1f322c(_0x49d1fa[_0x1c0f('0x15')][_0x1c0f('0x17')]);}logger[_0x1c0f('0x15')](_0x1c0f('0x12'),_0x50cbeb,_0x49d1fa[_0x1c0f('0x15')][_0x1c0f('0x17')]);return _0x41744c(_0x49d1fa[_0x1c0f('0x15')][_0x1c0f('0x17')]);}else{logger[_0x1c0f('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x50cbeb,'request\x20sent');_0x41744c(_0x49d1fa[_0x1c0f('0x18')][_0x1c0f('0x17')]);}})[_0x1c0f('0x19')](function(_0x42ddd5){logger[_0x1c0f('0x15')](_0x1c0f('0x12'),_0x50cbeb,_0x42ddd5);_0x1f322c(_0x42ddd5);});});}exports[_0x1c0f('0x1a')]=function(_0x4c4555){var _0x5cc1de=this;return new Promise(function(_0x262e85,_0x50c32d){return db['OpenchannelInteraction'][_0x1c0f('0x1b')](_0x4c4555[_0x1c0f('0x1c')],{'raw':_0x4c4555[_0x1c0f('0x1d')]?_0x4c4555[_0x1c0f('0x1d')][_0x1c0f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c4555[_0x1c0f('0x1d')]?_0x4c4555['options']['where']||null:null,'attributes':_0x4c4555['options']?_0x4c4555[_0x1c0f('0x1d')][_0x1c0f('0x1f')]||null:null,'limit':_0x4c4555['options']?_0x4c4555['options'][_0x1c0f('0x20')]||null:null})[_0x1c0f('0x10')](function(_0x1d57ff){logger[_0x1c0f('0x11')](_0x1c0f('0x1a'),_0x4c4555);logger['debug']('UpdateOpenchannelInteraction',_0x4c4555,JSON[_0x1c0f('0x21')](_0x1d57ff));_0x262e85(_0x1d57ff);})[_0x1c0f('0x19')](function(_0x455853){logger['error'](_0x1c0f('0x1a'),_0x455853[_0x1c0f('0x17')],_0x4c4555);_0x50c32d(_0x5cc1de[_0x1c0f('0x15')](0x1f4,_0x455853[_0x1c0f('0x17')]));});});};exports[_0x1c0f('0x22')]=function(_0x136e0f){return new Promise(function(_0x5e9ef2,_0x281216){return db[_0x1c0f('0x23')][_0x1c0f('0x24')]({'where':_0x136e0f[_0x1c0f('0x1d')]?_0x136e0f['options']['where']||null:null})[_0x1c0f('0x10')](function(_0x52e336){if(_0x52e336){return _0x52e336[_0x1c0f('0x25')](_0x136e0f[_0x1c0f('0x1c')]['ids'],_[_0x1c0f('0x26')](_0x136e0f[_0x1c0f('0x1c')],[_0x1c0f('0x27'),'id'])||{});}})[_0x1c0f('0x28')](function(_0x1efd6c){logger['info']('AddTags',_0x136e0f);logger[_0x1c0f('0x29')](_0x1c0f('0x2a'),_0x136e0f,JSON['stringify'](_0x1efd6c));_0x5e9ef2(_0x1efd6c);})[_0x1c0f('0x19')](function(_0x3bf671){logger[_0x1c0f('0x15')](_0x1c0f('0x2a'),_0x3bf671[_0x1c0f('0x17')],_0x136e0f);_0x281216(_this[_0x1c0f('0x15')](0x1f4,_0x3bf671['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index f4f209f..6233f8a 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 _0xb347=['update','removeListener','register','length','openchannelInteraction:','save','remove'];(function(_0x3636e0,_0x464dab){var _0x984370=function(_0x16c17f){while(--_0x16c17f){_0x3636e0['push'](_0x3636e0['shift']());}};_0x984370(++_0x464dab);}(_0xb347,0x1e8));var _0x7b34=function(_0x2d7e78,_0x57432b){_0x2d7e78=_0x2d7e78-0x0;var _0x4e4f16=_0xb347[_0x2d7e78];return _0x4e4f16;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x7b34('0x0'),_0x7b34('0x1'),_0x7b34('0x2')];function createListener(_0x56baf4,_0x43c464){return function(_0x151c56){_0x43c464['emit'](_0x56baf4,_0x151c56);};}function removeListener(_0x3becac,_0x240089){return function(){OpenchannelInteractionEvents[_0x7b34('0x3')](_0x3becac,_0x240089);};}exports[_0x7b34('0x4')]=function(_0x2e85b7){for(var _0x4b898e=0x0,_0xf8c69d=events[_0x7b34('0x5')];_0x4b898e<_0xf8c69d;_0x4b898e++){var _0x44f87f=events[_0x4b898e];var _0x1815ae=createListener(_0x7b34('0x6')+_0x44f87f,_0x2e85b7);OpenchannelInteractionEvents['on'](_0x44f87f,_0x1815ae);}}; \ No newline at end of file +var _0x4a41=['update','length','openchannelInteraction:'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4a41,0xf0));var _0x14a4=function(_0x1e2b91,_0x4360f0){_0x1e2b91=_0x1e2b91-0x0;var _0x40f517=_0x4a41[_0x1e2b91];return _0x40f517;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove',_0x14a4('0x0')];function createListener(_0x156ccf,_0x3156e8){return function(_0x58d383){_0x3156e8['emit'](_0x156ccf,_0x58d383);};}function removeListener(_0x56a309,_0x5384a7){return function(){OpenchannelInteractionEvents['removeListener'](_0x56a309,_0x5384a7);};}exports['register']=function(_0x2c0cae){for(var _0x16d98a=0x0,_0x41de77=events[_0x14a4('0x1')];_0x16d98a<_0x41de77;_0x16d98a++){var _0x5e8a26=events[_0x16d98a];var _0x4d4b0e=createListener(_0x14a4('0x2')+_0x5e8a26,_0x2c0cae);OpenchannelInteractionEvents['on'](_0x5e8a26,_0x4d4b0e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f7036d0..dc76d44 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x2f5a27,_0x575ae6){var _0x37bf23=function(_0x358e99){while(--_0x358e99){_0x2f5a27['push'](_0x2f5a27['shift']());}};_0x37bf23(++_0x575ae6);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x430369,_0x312a46){var _0x10483a=function(_0x3bd135){while(--_0x3bd135){_0x430369['push'](_0x430369['shift']());}};_0x10483a(++_0x312a46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 3bb54fa..7c33c50 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 _0x49db=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x5ed8f8,_0x245c75){var _0x1eddd2=function(_0x17c56b){while(--_0x17c56b){_0x5ed8f8['push'](_0x5ed8f8['shift']());}};_0x1eddd2(++_0x245c75);}(_0x49db,0xc5));var _0xb49d=function(_0x4c8e60,_0x260f03){_0x4c8e60=_0x4c8e60-0x0;var _0x5e1e62=_0x49db[_0x4c8e60];return _0x5e1e62;};'use strict';var Sequelize=require(_0xb49d('0x0'));module[_0xb49d('0x1')]={'body':{'type':Sequelize[_0xb49d('0x2')](_0xb49d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb49d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb49d('0x5')]('in',_0xb49d('0x6')),'defaultValue':_0xb49d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb49d('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9147=['out','DATE','STRING','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x1daefa,_0x36f14b){var _0x3b87a9=function(_0x114b85){while(--_0x114b85){_0x1daefa['push'](_0x1daefa['shift']());}};_0x3b87a9(++_0x36f14b);}(_0x9147,0x7b));var _0x7914=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x9147[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x7914('0x0'));module[_0x7914('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7914('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7914('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7914('0x4')]('in','out'),'defaultValue':_0x7914('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7914('0x6')]},'providerName':{'type':Sequelize[_0x7914('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1ec511f..af37f27 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 _0xcfbd=['format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','socket.io-emitter','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','includeAll','include','show','params','length','options','find','create','body','describe','../../config/logger','openchannel','read','readAt'];(function(_0x772163,_0x4af539){var _0x29b72d=function(_0x1605c5){while(--_0x1605c5){_0x772163['push'](_0x772163['shift']());}};_0x29b72d(++_0x4af539);}(_0xcfbd,0x1a1));var _0xdcfb=function(_0x57e4ec,_0x3c5538){_0x57e4ec=_0x57e4ec-0x0;var _0x5cff0a=_0xcfbd[_0x57e4ec];return _0x5cff0a;};'use strict';var emlformat=require(_0xdcfb('0x0'));var rimraf=require(_0xdcfb('0x1'));var zipdir=require(_0xdcfb('0x2'));var jsonpatch=require(_0xdcfb('0x3'));var rp=require(_0xdcfb('0x4'));var moment=require(_0xdcfb('0x5'));var BPromise=require(_0xdcfb('0x6'));var Mustache=require('mustache');var util=require(_0xdcfb('0x7'));var path=require(_0xdcfb('0x8'));var sox=require(_0xdcfb('0x9'));var csv=require(_0xdcfb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcfb('0xb'));var _=require(_0xdcfb('0xc'));var squel=require('squel');var crypto=require(_0xdcfb('0xd'));var jsforce=require(_0xdcfb('0xe'));var deskjs=require(_0xdcfb('0xf'));var toCsv=require(_0xdcfb('0xa'));var querystring=require(_0xdcfb('0x10'));var Papa=require(_0xdcfb('0x11'));var Redis=require(_0xdcfb('0x12'));var authService=require(_0xdcfb('0x13'));var qs=require(_0xdcfb('0x14'));var as=require(_0xdcfb('0x15'));var hardwareService=require(_0xdcfb('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdcfb('0x17'))['db'];config[_0xdcfb('0x18')]=_['defaults'](config[_0xdcfb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdcfb('0x19'))(new Redis(config[_0xdcfb('0x18')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdcfb('0x1a')][_0xdcfb('0x1b')]({'port':0x232c});var client9002=jayson[_0xdcfb('0x1a')][_0xdcfb('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x693d15,_0x57b821,_0x1c3983,_0x35e840){return new BPromise(function(_0x55bbd8,_0x99c1c4){var _0x45d785=_0x35e840||client;return _0x45d785['request'](_0x693d15,_0x1c3983)[_0xdcfb('0x1c')](function(_0x19b195){logger[_0xdcfb('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x57b821,_0xdcfb('0x1e'));logger[_0xdcfb('0x1f')](_0xdcfb('0x20'),_0x57b821,_0xdcfb('0x1e'),JSON[_0xdcfb('0x21')](_0x19b195));if(_0x19b195['error']){if(_0x19b195['error'][_0xdcfb('0x22')]===0x1f4){logger[_0xdcfb('0x23')](_0xdcfb('0x24'),_0x57b821,_0x19b195['error'][_0xdcfb('0x25')]);return _0x99c1c4(_0x19b195['error'][_0xdcfb('0x25')]);}logger[_0xdcfb('0x23')](_0xdcfb('0x24'),_0x57b821,_0x19b195[_0xdcfb('0x23')][_0xdcfb('0x25')]);return _0x55bbd8(_0x19b195[_0xdcfb('0x23')][_0xdcfb('0x25')]);}else{logger['info'](_0xdcfb('0x24'),_0x57b821,_0xdcfb('0x1e'));_0x55bbd8(_0x19b195[_0xdcfb('0x26')][_0xdcfb('0x25')]);}})[_0xdcfb('0x27')](function(_0x5d2315){logger[_0xdcfb('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x57b821,_0x5d2315);_0x99c1c4(_0x5d2315);});});}function respondWithStatusCode(_0x3f4abb,_0x57ee2f){_0x57ee2f=_0x57ee2f||0xcc;return function(_0x448c94){if(_0x448c94){return _0x3f4abb[_0xdcfb('0x28')](_0x57ee2f);}return _0x3f4abb[_0xdcfb('0x29')](_0x57ee2f)[_0xdcfb('0x2a')]();};}function respondWithResult(_0x44bee3,_0x5150ae){_0x5150ae=_0x5150ae||0xc8;return function(_0x516f8a){if(_0x516f8a){return _0x44bee3[_0xdcfb('0x29')](_0x5150ae)[_0xdcfb('0x2b')](_0x516f8a);}};}function respondWithFilteredResult(_0x4b5f66,_0x15c8a1){return function(_0x29f798){if(_0x29f798){var _0xf79a3a=typeof _0x15c8a1[_0xdcfb('0x2c')]===_0xdcfb('0x2d')&&typeof _0x15c8a1[_0xdcfb('0x2e')]===_0xdcfb('0x2d');var _0x1d4591=_0x29f798[_0xdcfb('0x2f')];var _0x19bedb=_0xf79a3a?0x0:_0x15c8a1['offset'];var _0x346123=_0xf79a3a?_0x29f798[_0xdcfb('0x2f')]:_0x15c8a1[_0xdcfb('0x2c')]+_0x15c8a1[_0xdcfb('0x2e')];var _0x2e9926;if(_0x346123>=_0x1d4591){_0x346123=_0x1d4591;_0x2e9926=0xc8;}else{_0x2e9926=0xce;}_0x4b5f66['status'](_0x2e9926);return _0x4b5f66[_0xdcfb('0x30')]('Content-Range',_0x19bedb+'-'+_0x346123+'/'+_0x1d4591)[_0xdcfb('0x2b')](_0x29f798);}return null;};}function patchUpdates(_0x44c234){return function(_0x1249c3){try{jsonpatch[_0xdcfb('0x31')](_0x1249c3,_0x44c234,!![]);}catch(_0x2c02e1){return BPromise[_0xdcfb('0x32')](_0x2c02e1);}return _0x1249c3[_0xdcfb('0x33')]();};}function saveUpdates(_0x4221c6,_0x1fc39f){return function(_0x4e344f){if(_0x4e344f){return _0x4e344f[_0xdcfb('0x34')](_0x4221c6)[_0xdcfb('0x1c')](function(_0x4ed25c){return _0x4ed25c;});}return null;};}function removeEntity(_0x3c095b,_0x117be7){return function(_0xc2ee76){if(_0xc2ee76){return _0xc2ee76[_0xdcfb('0x35')]()[_0xdcfb('0x1c')](function(){_0x3c095b[_0xdcfb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x533cdb,_0x3e28bb){return function(_0x2ecd61){if(!_0x2ecd61){_0x533cdb[_0xdcfb('0x28')](0x194);}return _0x2ecd61;};}function handleError(_0x3757fa,_0x2d86b6){_0x2d86b6=_0x2d86b6||0x1f4;return function(_0x4ae505){logger[_0xdcfb('0x23')](_0x4ae505[_0xdcfb('0x36')]);if(_0x4ae505[_0xdcfb('0x37')]){delete _0x4ae505[_0xdcfb('0x37')];}_0x3757fa['status'](_0x2d86b6)[_0xdcfb('0x38')](_0x4ae505);};}exports[_0xdcfb('0x39')]=function(_0x5c9e1e,_0x42a205){var _0x383ff3={},_0x941c50={},_0x597dd4={'count':0x0,'rows':[]};var _0x453c1c=_[_0xdcfb('0x3a')](db[_0xdcfb('0x3b')][_0xdcfb('0x3c')],function(_0x3b128a){return{'name':_0x3b128a[_0xdcfb('0x3d')],'type':_0x3b128a[_0xdcfb('0x3e')]['key']};});_0x941c50[_0xdcfb('0x3f')]=_[_0xdcfb('0x3a')](_0x453c1c,'name');_0x941c50[_0xdcfb('0x40')]=_[_0xdcfb('0x41')](_0x5c9e1e[_0xdcfb('0x40')]);_0x941c50[_0xdcfb('0x42')]=_[_0xdcfb('0x43')](_0x941c50[_0xdcfb('0x3f')],_0x941c50[_0xdcfb('0x40')]);_0x383ff3['attributes']=_[_0xdcfb('0x43')](_0x941c50[_0xdcfb('0x3f')],qs[_0xdcfb('0x44')](_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x44')]));_0x383ff3[_0xdcfb('0x45')]=_0x383ff3[_0xdcfb('0x45')]['length']?_0x383ff3[_0xdcfb('0x45')]:_0x941c50[_0xdcfb('0x3f')];if(!_0x5c9e1e[_0xdcfb('0x40')]['hasOwnProperty'](_0xdcfb('0x46'))){_0x383ff3[_0xdcfb('0x2e')]=qs['limit'](_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x2e')]);_0x383ff3['offset']=qs[_0xdcfb('0x2c')](_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x2c')]);}_0x383ff3[_0xdcfb('0x47')]=qs[_0xdcfb('0x48')](_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x48')]);_0x383ff3['where']=qs['filters'](_[_0xdcfb('0x49')](_0x5c9e1e['query'],_0x941c50[_0xdcfb('0x42')]),_0x453c1c);if(_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x4a')]){_0x383ff3['where']=_[_0xdcfb('0x4b')](_0x383ff3[_0xdcfb('0x4c')],{'$or':_[_0xdcfb('0x3a')](_0x453c1c,function(_0x592da4){if(_0x592da4['type']!=='VIRTUAL'){var _0x440803={};_0x440803[_0x592da4['name']]={'$like':'%'+_0x5c9e1e[_0xdcfb('0x40')][_0xdcfb('0x4a')]+'%'};return _0x440803;}})});}_0x383ff3=_[_0xdcfb('0x4b')]({},_0x383ff3,_0x5c9e1e['options']);var _0x461061={'where':_0x383ff3['where']};return db[_0xdcfb('0x3b')][_0xdcfb('0x2f')](_0x461061)[_0xdcfb('0x1c')](function(_0x50e20d){_0x597dd4[_0xdcfb('0x2f')]=_0x50e20d;if(_0x5c9e1e['query'][_0xdcfb('0x4d')]){_0x383ff3[_0xdcfb('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x383ff3);})[_0xdcfb('0x1c')](function(_0x295bd7){_0x597dd4['rows']=_0x295bd7;return _0x597dd4;})[_0xdcfb('0x1c')](respondWithFilteredResult(_0x42a205,_0x383ff3))[_0xdcfb('0x27')](handleError(_0x42a205,null));};exports[_0xdcfb('0x4f')]=function(_0x5e76bd,_0x2dd35a){var _0x494d4a={'raw':!![],'where':{'id':_0x5e76bd[_0xdcfb('0x50')]['id']}},_0x357ed8={};_0x357ed8[_0xdcfb('0x3f')]=_[_0xdcfb('0x41')](db[_0xdcfb('0x3b')][_0xdcfb('0x3c')]);_0x357ed8[_0xdcfb('0x40')]=_[_0xdcfb('0x41')](_0x5e76bd['query']);_0x357ed8[_0xdcfb('0x42')]=_[_0xdcfb('0x43')](_0x357ed8[_0xdcfb('0x3f')],_0x357ed8[_0xdcfb('0x40')]);_0x494d4a['attributes']=_[_0xdcfb('0x43')](_0x357ed8['model'],qs['fields'](_0x5e76bd[_0xdcfb('0x40')][_0xdcfb('0x44')]));_0x494d4a[_0xdcfb('0x45')]=_0x494d4a[_0xdcfb('0x45')][_0xdcfb('0x51')]?_0x494d4a['attributes']:_0x357ed8[_0xdcfb('0x3f')];if(_0x5e76bd[_0xdcfb('0x40')][_0xdcfb('0x4d')]){_0x494d4a[_0xdcfb('0x4e')]=[{'all':!![]}];}_0x494d4a=_['merge']({},_0x494d4a,_0x5e76bd[_0xdcfb('0x52')]);return db[_0xdcfb('0x3b')][_0xdcfb('0x53')](_0x494d4a)[_0xdcfb('0x1c')](handleEntityNotFound(_0x2dd35a,null))[_0xdcfb('0x1c')](respondWithResult(_0x2dd35a,null))[_0xdcfb('0x27')](handleError(_0x2dd35a,null));};exports[_0xdcfb('0x54')]=function(_0x34781a,_0x5ed369){return db[_0xdcfb('0x3b')][_0xdcfb('0x54')](_0x34781a['body'],{})[_0xdcfb('0x1c')](respondWithResult(_0x5ed369,0xc9))[_0xdcfb('0x27')](handleError(_0x5ed369,null));};exports[_0xdcfb('0x34')]=function(_0x771302,_0x59a9a9){if(_0x771302[_0xdcfb('0x55')]['id']){delete _0x771302['body']['id'];}return db['OpenchannelMessage'][_0xdcfb('0x53')]({'where':{'id':_0x771302[_0xdcfb('0x50')]['id']}})['then'](handleEntityNotFound(_0x59a9a9,null))[_0xdcfb('0x1c')](saveUpdates(_0x771302[_0xdcfb('0x55')],null))['then'](respondWithResult(_0x59a9a9,null))[_0xdcfb('0x27')](handleError(_0x59a9a9,null));};exports['destroy']=function(_0x2d3af1,_0x56c51a){return db[_0xdcfb('0x3b')][_0xdcfb('0x53')]({'where':{'id':_0x2d3af1['params']['id']}})[_0xdcfb('0x1c')](handleEntityNotFound(_0x56c51a,null))[_0xdcfb('0x1c')](removeEntity(_0x56c51a,null))[_0xdcfb('0x27')](handleError(_0x56c51a,null));};exports[_0xdcfb('0x56')]=function(_0x1e0517,_0x1cdd97){return db[_0xdcfb('0x3b')][_0xdcfb('0x56')]()[_0xdcfb('0x1c')](respondWithResult(_0x1cdd97,null))[_0xdcfb('0x27')](handleError(_0x1cdd97,null));};var interaction_log=require(_0xdcfb('0x57'))('openchannel-interactions');exports['accept']=function(_0x1b88a9,_0x328723,_0x2713c4){var _0x3f73ae={'agent':{},'channel':_0xdcfb('0x58')};if(_0x1b88a9[_0xdcfb('0x55')]['id']){delete _0x1b88a9[_0xdcfb('0x55')]['id'];}_0x1b88a9[_0xdcfb('0x55')][_0xdcfb('0x59')]=!![];_0x1b88a9[_0xdcfb('0x55')][_0xdcfb('0x5a')]=moment()[_0xdcfb('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b88a9[_0xdcfb('0x55')]['UserId']=_0x1b88a9[_0xdcfb('0x55')][_0xdcfb('0x5c')]||_0x1b88a9[_0xdcfb('0x5d')]['id'];_0x3f73ae[_0xdcfb('0x5e')]['id']=_0x1b88a9['body'][_0xdcfb('0x5c')];return db['OpenchannelMessage'][_0xdcfb('0x53')]({'where':{'id':_0x1b88a9[_0xdcfb('0x50')]['id'],'UserId':null}})[_0xdcfb('0x1c')](handleEntityNotFound(_0x328723,null))[_0xdcfb('0x1c')](saveUpdates(_0x1b88a9[_0xdcfb('0x55')],null))[_0xdcfb('0x1c')](function(_0x974927){if(_0x974927){_0x3f73ae[_0xdcfb('0x25')]=_0x974927['get']({'plain':!![]});return db[_0xdcfb('0x5f')][_0xdcfb('0x53')]({'where':{'id':_0x974927[_0xdcfb('0x60')]}});}return null;})[_0xdcfb('0x1c')](handleEntityNotFound(_0x328723,null))['then'](function(_0x11308b){if(_0x11308b){return _0x11308b[_0xdcfb('0x34')]({'UserId':_0x1b88a9[_0xdcfb('0x55')]['UserId'],'read1stAt':_[_0xdcfb('0x61')](_0x11308b['read1stAt'])?moment()[_0xdcfb('0x5b')](_0xdcfb('0x62')):undefined});}return null;})[_0xdcfb('0x1c')](function(_0x173920){if(_0x173920){_0x3f73ae['interaction']=_0x173920[_0xdcfb('0x63')]({'plain':!![]});interaction_log['info'](_0xdcfb('0x64'),_0x1b88a9['user']['id'],_0x1b88a9[_0xdcfb('0x5d')]['name'],_0x1b88a9[_0xdcfb('0x5d')][_0xdcfb('0x65')],_0x3f73ae[_0xdcfb('0x66')]['id'],_0x1b88a9[_0xdcfb('0x55')]?JSON[_0xdcfb('0x21')](_0x1b88a9['body']):_0xdcfb('0x67'));return respondWithRpcPromise('AcceptMessage',_0xdcfb('0x68'),_0x3f73ae);}return null;})[_0xdcfb('0x1c')](function(_0x216e6){var _0x544883=_0xdcfb('0x69')+_0x216e6[_0xdcfb('0x25')][_0xdcfb('0x6a')];return db['sequelize'][_0xdcfb('0x40')](_0x544883,{'type':db[_0xdcfb('0x6b')]['QueryTypes'][_0xdcfb('0x6c')],'raw':!![]})['then'](function(_0x323257){return _0x323257;});})['then'](function(_0x1d870c){if(_0x1d870c){_0x3f73ae['message'][_0xdcfb('0x6d')]=_0x1d870c[0x0];if(!_0x1b88a9[_0xdcfb('0x55')][_0xdcfb('0x5c')])return;return db[_0xdcfb('0x6e')][_0xdcfb('0x53')]({'where':{'id':_0x1b88a9[_0xdcfb('0x55')][_0xdcfb('0x5c')],'role':_0xdcfb('0x5e')},'attributes':['id',_0xdcfb('0x37'),_0xdcfb('0x6f'),_0xdcfb('0x70'),_0xdcfb('0x71')],'raw':!![]});}return null;})[_0xdcfb('0x1c')](function(_0x35f8f6){if(!_0x35f8f6)return null;_0x3f73ae[_0xdcfb('0x25')][_0xdcfb('0x5e')]=_0x35f8f6;return _0x3f73ae;})['then'](function(_0x1b8106){if(_0x1b8106){if(_0x1b88a9[_0xdcfb('0x55')]['manual']){_0x3f73ae[_0xdcfb('0x25')][_0xdcfb('0x72')]=util[_0xdcfb('0x5b')](_0xdcfb('0x73'),_0x1b88a9['user']['name']);_0x3f73ae[_0xdcfb('0x25')][_0xdcfb('0x74')]=_0x3f73ae[_0xdcfb('0x74')];_0x3f73ae[_0xdcfb('0x25')][_0xdcfb('0x75')]=_0x3f73ae[_0xdcfb('0x74')];_0x3f73ae[_0xdcfb('0x25')][_0xdcfb('0x76')]=_0xdcfb('0x77');return respondWithRpcPromise(_0xdcfb('0x78'),_0xdcfb('0x78'),{'event':_0xdcfb('0x79'),'message':_0x3f73ae[_0xdcfb('0x25')]},client9002)[_0xdcfb('0x1c')](function(){return _0x3f73ae;});}return _0x3f73ae;}return null;})['then'](respondWithResult(_0x328723,null))[_0xdcfb('0x27')](handleError(_0x328723,null));};var interaction_log=require('../../config/logger')(_0xdcfb('0x7a'));exports[_0xdcfb('0x32')]=function(_0x287a6e,_0x55dccf,_0x31dcf1){var _0x429807={'agent':{},'channel':'openchannel'};if(_0x287a6e[_0xdcfb('0x55')]['id']){delete _0x287a6e['body']['id'];}_0x287a6e[_0xdcfb('0x55')][_0xdcfb('0x5c')]=_0x287a6e[_0xdcfb('0x55')][_0xdcfb('0x5c')]||_0x287a6e[_0xdcfb('0x5d')]['id'];_0x429807[_0xdcfb('0x5e')]['id']=_0x287a6e[_0xdcfb('0x55')][_0xdcfb('0x5c')];return db[_0xdcfb('0x3b')]['find']({'where':{'id':_0x287a6e[_0xdcfb('0x50')]['id'],'UserId':null}})[_0xdcfb('0x1c')](handleEntityNotFound(_0x55dccf,null))[_0xdcfb('0x1c')](function(_0x2c4c36){if(_0x2c4c36){_0x429807[_0xdcfb('0x25')]=_0x2c4c36[_0xdcfb('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdcfb('0x53')]({'where':{'id':_0x2c4c36['OpenchannelInteractionId']}});}return null;})[_0xdcfb('0x1c')](handleEntityNotFound(_0x55dccf,null))[_0xdcfb('0x1c')](function(_0x32822e){if(_0x32822e){_0x429807[_0xdcfb('0x66')]=_0x32822e[_0xdcfb('0x63')]({'plain':!![]});interaction_log[_0xdcfb('0x1d')](_0xdcfb('0x7b'),_0x287a6e[_0xdcfb('0x5d')]['id'],_0x287a6e['user'][_0xdcfb('0x37')],_0x287a6e['user'][_0xdcfb('0x65')],_0x429807[_0xdcfb('0x66')]['id'],_0x287a6e['body']?JSON[_0xdcfb('0x21')](_0x287a6e['body']):'null');return respondWithRpcPromise('RejectMessage',_0xdcfb('0x7c'),_0x429807);}return null;})[_0xdcfb('0x1c')](function(_0x2259c2){var _0x396911=_0xdcfb('0x69')+_0x2259c2[_0xdcfb('0x25')][_0xdcfb('0x6a')];return db[_0xdcfb('0x7d')]['query'](_0x396911,{'type':db['Sequelize']['QueryTypes'][_0xdcfb('0x6c')],'raw':!![]})[_0xdcfb('0x1c')](function(_0x4f6ad4){return _0x4f6ad4;});})[_0xdcfb('0x1c')](function(_0x4b2388){if(_0x4b2388){_0x429807[_0xdcfb('0x25')][_0xdcfb('0x6d')]=_0x4b2388[0x0];if(!_0x287a6e[_0xdcfb('0x55')]['UserId'])return;return db[_0xdcfb('0x6e')]['find']({'where':{'id':_0x287a6e[_0xdcfb('0x55')][_0xdcfb('0x5c')],'role':'agent'},'attributes':['id',_0xdcfb('0x37'),_0xdcfb('0x6f'),_0xdcfb('0x70'),_0xdcfb('0x71')],'raw':!![]});}return null;})[_0xdcfb('0x1c')](function(_0x30138c){if(!_0x30138c)return null;_0x429807[_0xdcfb('0x25')][_0xdcfb('0x5e')]=_0x30138c;return _0x429807;})[_0xdcfb('0x1c')](function(_0x544e96){if(_0x544e96){_0x544e96[_0xdcfb('0x25')][_0xdcfb('0x72')]=util[_0xdcfb('0x5b')](_0xdcfb('0x73'),_0x287a6e['user'][_0xdcfb('0x37')]);_0x544e96[_0xdcfb('0x25')][_0xdcfb('0x74')]=_0x429807['channel'];_0x544e96[_0xdcfb('0x25')]['motionChannel']=_0x429807[_0xdcfb('0x74')];_0x544e96[_0xdcfb('0x25')]['event']=_0xdcfb('0x32');respondWithRpcPromise(_0xdcfb('0x78'),_0xdcfb('0x78'),{'event':_0xdcfb('0x7e'),'message':_0x544e96[_0xdcfb('0x25')]},client9002);return _0x429807;}return null;})[_0xdcfb('0x1c')](respondWithResult(_0x55dccf,null))[_0xdcfb('0x27')](handleError(_0x55dccf,null));}; \ No newline at end of file +var _0x7953=['rows','show','params','merge','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','manual','interface','channel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','QueryTypes','internal','SIP/%s','motionChannel','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7953,0x1c4));var _0x3795=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x7953[_0x36d25e];return _0x4b95b8;};'use strict';var emlformat=require(_0x3795('0x0'));var rimraf=require(_0x3795('0x1'));var zipdir=require(_0x3795('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3795('0x3'));var moment=require('moment');var BPromise=require(_0x3795('0x4'));var Mustache=require('mustache');var util=require(_0x3795('0x5'));var path=require(_0x3795('0x6'));var sox=require(_0x3795('0x7'));var csv=require('to-csv');var ejs=require(_0x3795('0x8'));var fs=require('fs');var fs_extra=require(_0x3795('0x9'));var _=require(_0x3795('0xa'));var squel=require(_0x3795('0xb'));var crypto=require(_0x3795('0xc'));var jsforce=require(_0x3795('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3795('0xe'));var querystring=require('querystring');var Papa=require(_0x3795('0xf'));var Redis=require(_0x3795('0x10'));var authService=require(_0x3795('0x11'));var qs=require(_0x3795('0x12'));var as=require(_0x3795('0x13'));var hardwareService=require(_0x3795('0x14'));var logger=require('../../config/logger')(_0x3795('0x15'));var utils=require(_0x3795('0x16'));var config=require(_0x3795('0x17'));var licenseUtil=require(_0x3795('0x18'));var db=require('../../mysqldb')['db'];config[_0x3795('0x19')]=_['defaults'](config['redis'],{'host':_0x3795('0x1a'),'port':0x18eb});var socket=require(_0x3795('0x1b'))(new Redis(config[_0x3795('0x19')]));require(_0x3795('0x1c'))[_0x3795('0x1d')](socket);var jayson=require(_0x3795('0x1e'));var client=jayson[_0x3795('0x1f')][_0x3795('0x20')]({'port':0x232c});var client9002=jayson[_0x3795('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364aa7,_0x33a68d,_0x4bd7c7,_0xa415fa){return new BPromise(function(_0x29ee9d,_0x519580){var _0x47de79=_0xa415fa||client;return _0x47de79[_0x3795('0x21')](_0x364aa7,_0x4bd7c7)[_0x3795('0x22')](function(_0x39df78){logger[_0x3795('0x23')](_0x3795('0x24'),_0x33a68d,'request\x20sent');logger[_0x3795('0x25')](_0x3795('0x26'),_0x33a68d,_0x3795('0x27'),JSON['stringify'](_0x39df78));if(_0x39df78[_0x3795('0x28')]){if(_0x39df78[_0x3795('0x28')]['code']===0x1f4){logger[_0x3795('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x33a68d,_0x39df78[_0x3795('0x28')][_0x3795('0x29')]);return _0x519580(_0x39df78[_0x3795('0x28')][_0x3795('0x29')]);}logger[_0x3795('0x28')](_0x3795('0x24'),_0x33a68d,_0x39df78[_0x3795('0x28')]['message']);return _0x29ee9d(_0x39df78[_0x3795('0x28')][_0x3795('0x29')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x33a68d,_0x3795('0x27'));_0x29ee9d(_0x39df78['result'][_0x3795('0x29')]);}})[_0x3795('0x2a')](function(_0xdd3a90){logger[_0x3795('0x28')](_0x3795('0x24'),_0x33a68d,_0xdd3a90);_0x519580(_0xdd3a90);});});}function respondWithStatusCode(_0x4df3df,_0x310a33){_0x310a33=_0x310a33||0xcc;return function(_0x2f5343){if(_0x2f5343){return _0x4df3df[_0x3795('0x2b')](_0x310a33);}return _0x4df3df['status'](_0x310a33)[_0x3795('0x2c')]();};}function respondWithResult(_0x2dd1e3,_0x3f99c0){_0x3f99c0=_0x3f99c0||0xc8;return function(_0x28c65e){if(_0x28c65e){return _0x2dd1e3[_0x3795('0x2d')](_0x3f99c0)[_0x3795('0x2e')](_0x28c65e);}};}function respondWithFilteredResult(_0x55e160,_0x5d8df6){return function(_0x588e16){if(_0x588e16){var _0x5784ee=typeof _0x5d8df6[_0x3795('0x2f')]===_0x3795('0x30')&&typeof _0x5d8df6['limit']===_0x3795('0x30');var _0x13da3f=_0x588e16['count'];var _0x489424=_0x5784ee?0x0:_0x5d8df6['offset'];var _0x4f51a7=_0x5784ee?_0x588e16[_0x3795('0x31')]:_0x5d8df6[_0x3795('0x2f')]+_0x5d8df6[_0x3795('0x32')];var _0xc6fe3;if(_0x4f51a7>=_0x13da3f){_0x4f51a7=_0x13da3f;_0xc6fe3=0xc8;}else{_0xc6fe3=0xce;}_0x55e160[_0x3795('0x2d')](_0xc6fe3);return _0x55e160[_0x3795('0x33')](_0x3795('0x34'),_0x489424+'-'+_0x4f51a7+'/'+_0x13da3f)[_0x3795('0x2e')](_0x588e16);}return null;};}function patchUpdates(_0x1f78ba){return function(_0x3b686b){try{jsonpatch[_0x3795('0x35')](_0x3b686b,_0x1f78ba,!![]);}catch(_0x16b72b){return BPromise[_0x3795('0x36')](_0x16b72b);}return _0x3b686b['save']();};}function saveUpdates(_0x440c8f,_0x581fc1){return function(_0x5a03f7){if(_0x5a03f7){return _0x5a03f7[_0x3795('0x37')](_0x440c8f)[_0x3795('0x22')](function(_0x1a3426){return _0x1a3426;});}return null;};}function removeEntity(_0x20abb8,_0x2cbd8d){return function(_0x518045){if(_0x518045){return _0x518045[_0x3795('0x38')]()['then'](function(){_0x20abb8[_0x3795('0x2d')](0xcc)[_0x3795('0x2c')]();});}};}function handleEntityNotFound(_0x1da50b,_0x2b4832){return function(_0x36b90f){if(!_0x36b90f){_0x1da50b[_0x3795('0x2b')](0x194);}return _0x36b90f;};}function handleError(_0x29e877,_0x3792e3){_0x3792e3=_0x3792e3||0x1f4;return function(_0x384791){logger[_0x3795('0x28')](_0x384791[_0x3795('0x39')]);if(_0x384791[_0x3795('0x3a')]){delete _0x384791[_0x3795('0x3a')];}_0x29e877[_0x3795('0x2d')](_0x3792e3)[_0x3795('0x3b')](_0x384791);};}exports['index']=function(_0x53049b,_0x3a0d17){var _0x249797={},_0xbe8655={},_0x26de71={'count':0x0,'rows':[]};var _0x423359=_[_0x3795('0x3c')](db[_0x3795('0x3d')][_0x3795('0x3e')],function(_0x4bb73e){return{'name':_0x4bb73e['fieldName'],'type':_0x4bb73e[_0x3795('0x3f')][_0x3795('0x40')]};});_0xbe8655['model']=_['map'](_0x423359,_0x3795('0x3a'));_0xbe8655['query']=_[_0x3795('0x41')](_0x53049b[_0x3795('0x42')]);_0xbe8655[_0x3795('0x43')]=_[_0x3795('0x44')](_0xbe8655[_0x3795('0x45')],_0xbe8655[_0x3795('0x42')]);_0x249797['attributes']=_['intersection'](_0xbe8655[_0x3795('0x45')],qs['fields'](_0x53049b[_0x3795('0x42')][_0x3795('0x46')]));_0x249797['attributes']=_0x249797[_0x3795('0x47')][_0x3795('0x48')]?_0x249797[_0x3795('0x47')]:_0xbe8655[_0x3795('0x45')];if(!_0x53049b[_0x3795('0x42')]['hasOwnProperty'](_0x3795('0x49'))){_0x249797['limit']=qs[_0x3795('0x32')](_0x53049b[_0x3795('0x42')][_0x3795('0x32')]);_0x249797[_0x3795('0x2f')]=qs[_0x3795('0x2f')](_0x53049b['query'][_0x3795('0x2f')]);}_0x249797[_0x3795('0x4a')]=qs[_0x3795('0x4b')](_0x53049b[_0x3795('0x42')][_0x3795('0x4b')]);_0x249797[_0x3795('0x4c')]=qs[_0x3795('0x43')](_[_0x3795('0x4d')](_0x53049b[_0x3795('0x42')],_0xbe8655['filters']),_0x423359);if(_0x53049b[_0x3795('0x42')][_0x3795('0x4e')]){_0x249797['where']=_['merge'](_0x249797['where'],{'$or':_[_0x3795('0x3c')](_0x423359,function(_0x4d3b58){if(_0x4d3b58[_0x3795('0x3f')]!==_0x3795('0x4f')){var _0x33fb9d={};_0x33fb9d[_0x4d3b58[_0x3795('0x3a')]]={'$like':'%'+_0x53049b[_0x3795('0x42')][_0x3795('0x4e')]+'%'};return _0x33fb9d;}})});}_0x249797=_['merge']({},_0x249797,_0x53049b[_0x3795('0x50')]);var _0x3a4d47={'where':_0x249797[_0x3795('0x4c')]};return db['OpenchannelMessage'][_0x3795('0x31')](_0x3a4d47)[_0x3795('0x22')](function(_0x53ed14){_0x26de71[_0x3795('0x31')]=_0x53ed14;if(_0x53049b['query'][_0x3795('0x51')]){_0x249797[_0x3795('0x52')]=[{'all':!![]}];}return db[_0x3795('0x3d')][_0x3795('0x53')](_0x249797);})[_0x3795('0x22')](function(_0x2ca80e){_0x26de71[_0x3795('0x54')]=_0x2ca80e;return _0x26de71;})[_0x3795('0x22')](respondWithFilteredResult(_0x3a0d17,_0x249797))[_0x3795('0x2a')](handleError(_0x3a0d17,null));};exports[_0x3795('0x55')]=function(_0x267e88,_0x4a4dd9){var _0x5510e3={'raw':!![],'where':{'id':_0x267e88[_0x3795('0x56')]['id']}},_0x3ab496={};_0x3ab496[_0x3795('0x45')]=_['keys'](db[_0x3795('0x3d')][_0x3795('0x3e')]);_0x3ab496['query']=_['keys'](_0x267e88[_0x3795('0x42')]);_0x3ab496[_0x3795('0x43')]=_[_0x3795('0x44')](_0x3ab496['model'],_0x3ab496[_0x3795('0x42')]);_0x5510e3[_0x3795('0x47')]=_[_0x3795('0x44')](_0x3ab496[_0x3795('0x45')],qs[_0x3795('0x46')](_0x267e88[_0x3795('0x42')][_0x3795('0x46')]));_0x5510e3[_0x3795('0x47')]=_0x5510e3[_0x3795('0x47')][_0x3795('0x48')]?_0x5510e3[_0x3795('0x47')]:_0x3ab496[_0x3795('0x45')];if(_0x267e88[_0x3795('0x42')][_0x3795('0x51')]){_0x5510e3[_0x3795('0x52')]=[{'all':!![]}];}_0x5510e3=_[_0x3795('0x57')]({},_0x5510e3,_0x267e88[_0x3795('0x50')]);return db['OpenchannelMessage'][_0x3795('0x58')](_0x5510e3)[_0x3795('0x22')](handleEntityNotFound(_0x4a4dd9,null))[_0x3795('0x22')](respondWithResult(_0x4a4dd9,null))[_0x3795('0x2a')](handleError(_0x4a4dd9,null));};exports[_0x3795('0x59')]=function(_0x5429f1,_0x1c7de6){return db[_0x3795('0x3d')]['create'](_0x5429f1['body'],{})[_0x3795('0x22')](respondWithResult(_0x1c7de6,0xc9))[_0x3795('0x2a')](handleError(_0x1c7de6,null));};exports[_0x3795('0x37')]=function(_0x235a87,_0x907dc4){if(_0x235a87[_0x3795('0x5a')]['id']){delete _0x235a87['body']['id'];}return db[_0x3795('0x3d')][_0x3795('0x58')]({'where':{'id':_0x235a87['params']['id']}})['then'](handleEntityNotFound(_0x907dc4,null))['then'](saveUpdates(_0x235a87[_0x3795('0x5a')],null))[_0x3795('0x22')](respondWithResult(_0x907dc4,null))[_0x3795('0x2a')](handleError(_0x907dc4,null));};exports[_0x3795('0x38')]=function(_0x18614e,_0xa551ce){return db[_0x3795('0x3d')][_0x3795('0x58')]({'where':{'id':_0x18614e[_0x3795('0x56')]['id']}})['then'](handleEntityNotFound(_0xa551ce,null))[_0x3795('0x22')](removeEntity(_0xa551ce,null))['catch'](handleError(_0xa551ce,null));};exports['describe']=function(_0x4b435a,_0x3f3b7c){return db[_0x3795('0x3d')][_0x3795('0x5b')]()[_0x3795('0x22')](respondWithResult(_0x3f3b7c,null))['catch'](handleError(_0x3f3b7c,null));};var interaction_log=require(_0x3795('0x5c'))(_0x3795('0x5d'));exports[_0x3795('0x5e')]=function(_0x583cdc,_0x37ea20,_0x4d7287){var _0x1f7c34={'agent':{},'channel':_0x3795('0x5f')};if(_0x583cdc['body']['id']){delete _0x583cdc[_0x3795('0x5a')]['id'];}_0x583cdc[_0x3795('0x5a')]['read']=!![];_0x583cdc[_0x3795('0x5a')][_0x3795('0x60')]=moment()[_0x3795('0x61')](_0x3795('0x62'));_0x583cdc[_0x3795('0x5a')]['UserId']=_0x583cdc[_0x3795('0x5a')][_0x3795('0x63')]||_0x583cdc['user']['id'];_0x1f7c34[_0x3795('0x64')]['id']=_0x583cdc[_0x3795('0x5a')][_0x3795('0x63')];return db[_0x3795('0x3d')][_0x3795('0x58')]({'where':{'id':_0x583cdc[_0x3795('0x56')]['id'],'UserId':null}})[_0x3795('0x22')](handleEntityNotFound(_0x37ea20,null))['then'](saveUpdates(_0x583cdc['body'],null))[_0x3795('0x22')](function(_0x3eb56e){if(_0x3eb56e){_0x1f7c34['message']=_0x3eb56e[_0x3795('0x65')]({'plain':!![]});return db[_0x3795('0x66')][_0x3795('0x58')]({'where':{'id':_0x3eb56e[_0x3795('0x67')]}});}return null;})[_0x3795('0x22')](handleEntityNotFound(_0x37ea20,null))[_0x3795('0x22')](function(_0x59d9b8){if(_0x59d9b8){return _0x59d9b8[_0x3795('0x37')]({'UserId':_0x583cdc[_0x3795('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x59d9b8[_0x3795('0x68')])?moment()[_0x3795('0x61')](_0x3795('0x62')):undefined});}return null;})[_0x3795('0x22')](function(_0x2ce127){if(_0x2ce127){_0x1f7c34[_0x3795('0x69')]=_0x2ce127['get']({'plain':!![]});interaction_log[_0x3795('0x23')](_0x3795('0x6a'),_0x583cdc['user']['id'],_0x583cdc[_0x3795('0x6b')][_0x3795('0x3a')],_0x583cdc[_0x3795('0x6b')][_0x3795('0x6c')],_0x1f7c34[_0x3795('0x69')]['id'],_0x583cdc['body']?JSON[_0x3795('0x6d')](_0x583cdc[_0x3795('0x5a')]):_0x3795('0x6e'));return respondWithRpcPromise(_0x3795('0x6f'),'acceptMessage',_0x1f7c34);}return null;})[_0x3795('0x22')](function(_0x3268be){var _0x827b13=_0x3795('0x70')+_0x3268be[_0x3795('0x29')][_0x3795('0x71')];return db['sequelize']['query'](_0x827b13,{'type':db[_0x3795('0x72')]['QueryTypes'][_0x3795('0x73')],'raw':!![]})[_0x3795('0x22')](function(_0x3ff835){return _0x3ff835;});})['then'](function(_0x384395){if(_0x384395){_0x1f7c34[_0x3795('0x29')][_0x3795('0x74')]=_0x384395[0x0];if(!_0x583cdc[_0x3795('0x5a')][_0x3795('0x63')])return;return db[_0x3795('0x75')][_0x3795('0x58')]({'where':{'id':_0x583cdc[_0x3795('0x5a')][_0x3795('0x63')],'role':'agent'},'attributes':['id',_0x3795('0x3a'),_0x3795('0x76'),_0x3795('0x77'),'internal'],'raw':!![]});}return null;})[_0x3795('0x22')](function(_0x54c283){if(!_0x54c283)return null;_0x1f7c34[_0x3795('0x29')][_0x3795('0x64')]=_0x54c283;return _0x1f7c34;})[_0x3795('0x22')](function(_0x11c5b4){if(_0x11c5b4){if(_0x583cdc[_0x3795('0x5a')][_0x3795('0x78')]){_0x1f7c34[_0x3795('0x29')][_0x3795('0x79')]=util['format']('SIP/%s',_0x583cdc[_0x3795('0x6b')]['name']);_0x1f7c34['message'][_0x3795('0x7a')]=_0x1f7c34[_0x3795('0x7a')];_0x1f7c34[_0x3795('0x29')]['motionChannel']=_0x1f7c34['channel'];_0x1f7c34[_0x3795('0x29')]['event']=_0x3795('0x5e');return respondWithRpcPromise(_0x3795('0x7b'),_0x3795('0x7b'),{'event':_0x3795('0x7c'),'message':_0x1f7c34[_0x3795('0x29')]},client9002)[_0x3795('0x22')](function(){return _0x1f7c34;});}return _0x1f7c34;}return null;})['then'](respondWithResult(_0x37ea20,null))['catch'](handleError(_0x37ea20,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x3795('0x36')]=function(_0x26d798,_0x158585,_0x3629e4){var _0x443f10={'agent':{},'channel':_0x3795('0x5f')};if(_0x26d798[_0x3795('0x5a')]['id']){delete _0x26d798[_0x3795('0x5a')]['id'];}_0x26d798['body'][_0x3795('0x63')]=_0x26d798[_0x3795('0x5a')]['UserId']||_0x26d798['user']['id'];_0x443f10[_0x3795('0x64')]['id']=_0x26d798['body'][_0x3795('0x63')];return db[_0x3795('0x3d')][_0x3795('0x58')]({'where':{'id':_0x26d798[_0x3795('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x158585,null))[_0x3795('0x22')](function(_0x37f392){if(_0x37f392){_0x443f10[_0x3795('0x29')]=_0x37f392[_0x3795('0x65')]({'plain':!![]});return db[_0x3795('0x66')]['find']({'where':{'id':_0x37f392[_0x3795('0x67')]}});}return null;})[_0x3795('0x22')](handleEntityNotFound(_0x158585,null))[_0x3795('0x22')](function(_0x5ae319){if(_0x5ae319){_0x443f10[_0x3795('0x69')]=_0x5ae319[_0x3795('0x65')]({'plain':!![]});interaction_log[_0x3795('0x23')](_0x3795('0x7d'),_0x26d798['user']['id'],_0x26d798[_0x3795('0x6b')]['name'],_0x26d798[_0x3795('0x6b')][_0x3795('0x6c')],_0x443f10[_0x3795('0x69')]['id'],_0x26d798['body']?JSON[_0x3795('0x6d')](_0x26d798[_0x3795('0x5a')]):_0x3795('0x6e'));return respondWithRpcPromise('RejectMessage',_0x3795('0x7e'),_0x443f10);}return null;})[_0x3795('0x22')](function(_0x1fbb45){var _0x1f9ca8=_0x3795('0x70')+_0x1fbb45['message']['ContactId'];return db[_0x3795('0x7f')]['query'](_0x1f9ca8,{'type':db[_0x3795('0x72')][_0x3795('0x80')][_0x3795('0x73')],'raw':!![]})[_0x3795('0x22')](function(_0x2141dc){return _0x2141dc;});})['then'](function(_0x33b0fe){if(_0x33b0fe){_0x443f10['message'][_0x3795('0x74')]=_0x33b0fe[0x0];if(!_0x26d798[_0x3795('0x5a')][_0x3795('0x63')])return;return db[_0x3795('0x75')]['find']({'where':{'id':_0x26d798[_0x3795('0x5a')][_0x3795('0x63')],'role':_0x3795('0x64')},'attributes':['id','name',_0x3795('0x76'),_0x3795('0x77'),_0x3795('0x81')],'raw':!![]});}return null;})[_0x3795('0x22')](function(_0x1af217){if(!_0x1af217)return null;_0x443f10[_0x3795('0x29')][_0x3795('0x64')]=_0x1af217;return _0x443f10;})[_0x3795('0x22')](function(_0x458ac9){if(_0x458ac9){_0x458ac9[_0x3795('0x29')][_0x3795('0x79')]=util[_0x3795('0x61')](_0x3795('0x82'),_0x26d798['user'][_0x3795('0x3a')]);_0x458ac9[_0x3795('0x29')][_0x3795('0x7a')]=_0x443f10['channel'];_0x458ac9[_0x3795('0x29')][_0x3795('0x83')]=_0x443f10[_0x3795('0x7a')];_0x458ac9[_0x3795('0x29')][_0x3795('0x84')]=_0x3795('0x36');respondWithRpcPromise(_0x3795('0x7b'),_0x3795('0x7b'),{'event':_0x3795('0x85'),'message':_0x458ac9[_0x3795('0x29')]},client9002);return _0x443f10;}return null;})[_0x3795('0x22')](respondWithResult(_0x158585,null))[_0x3795('0x2a')](handleError(_0x158585,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 24e565f..29d0604 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 _0x25d1=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x523a03,_0x47d6d3){var _0x1f6f00=function(_0x3396ca){while(--_0x3396ca){_0x523a03['push'](_0x523a03['shift']());}};_0x1f6f00(++_0x47d6d3);}(_0x25d1,0x150));var _0x125d=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x25d1[_0x3e8cae];return _0x45c4d6;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x125d('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x125d('0x1')](0x0);var events={'afterCreate':_0x125d('0x2'),'afterUpdate':_0x125d('0x3'),'afterDestroy':_0x125d('0x4')};function emitEvent(_0x586f08){return function(_0x2460b0,_0x1d1706,_0x1044a9){OpenchannelMessageEvents[_0x125d('0x5')](_0x586f08+':'+_0x2460b0['id'],_0x2460b0);OpenchannelMessageEvents['emit'](_0x586f08,_0x2460b0);_0x1044a9(null);};}for(var e in events){if(events[_0x125d('0x6')](e)){var event=events[e];OpenchannelMessage[_0x125d('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xa600=['OpenchannelMessage','setMaxListeners','remove','emit','exports','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa600,0x1cd));var _0x0a60=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa600[_0x3899d1];return _0xeb4a7d;};'use strict';var EventEmitter=require(_0x0a60('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x0a60('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0a60('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0a60('0x3')};function emitEvent(_0x40a7c9){return function(_0x34df09,_0x18df20,_0x408554){OpenchannelMessageEvents['emit'](_0x40a7c9+':'+_0x34df09['id'],_0x34df09);OpenchannelMessageEvents[_0x0a60('0x4')](_0x40a7c9,_0x34df09);_0x408554(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0a60('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 2dec51c..746922a 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 _0x202a=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','replyUri','Interaction','omit','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect'];(function(_0x5891c,_0x26c3ab){var _0x82a0a7=function(_0x5cf85c){while(--_0x5cf85c){_0x5891c['push'](_0x5891c['shift']());}};_0x82a0a7(++_0x26c3ab);}(_0x202a,0x1e0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa202('0x0'));var util=require(_0xa202('0x1'));var logger=require(_0xa202('0x2'))('api');var moment=require(_0xa202('0x3'));var BPromise=require('bluebird');var rp=require(_0xa202('0x4'));var fs=require('fs');var path=require(_0xa202('0x5'));var rimraf=require(_0xa202('0x6'));var config=require(_0xa202('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xa202('0x8')]=function(_0x21d7d0,_0x51afa8){return _0x21d7d0[_0xa202('0x9')](_0xa202('0xa'),attributes,{'tableName':_0xa202('0xb'),'paranoid':![],'indexes':[{'name':_0xa202('0xc'),'fields':[_0xa202('0xd')],'type':_0xa202('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1de2a9,_0x307f72,_0x2055d7){var _0x59bbdc=_0x21d7d0[_0xa202('0xf')];var _0x3f38d6=_0x1de2a9[_0xa202('0x10')]({'plain':!![]});if(_0x3f38d6[_0xa202('0x11')][_0xa202('0x12')]()==='in'||_0x3f38d6[_0xa202('0x11')][_0xa202('0x12')]()===_0xa202('0x13')&&!_0x3f38d6[_0xa202('0x14')]&&!_[_0xa202('0x15')](_0x3f38d6[_0xa202('0x16')])){_0x59bbdc['OpenchannelInteraction'][_0xa202('0x17')]({'where':{'id':_0x3f38d6[_0xa202('0x18')]}})[_0xa202('0x19')](function(_0x1f92d6){if(_0x1f92d6){_0x1f92d6[_0xa202('0x1a')]({'lastMsgAt':_0x3f38d6[_0xa202('0x1b')],'lastMsgDirection':_0x3f38d6[_0xa202('0x11')][_0xa202('0x12')]()});}})[_0xa202('0x1c')](function(_0x23bce9){console['error'](_0x23bce9);});}if(_0x3f38d6[_0xa202('0x11')]===_0xa202('0x13')&&!_0x3f38d6[_0xa202('0x14')]){var _0x42b39f;_0x59bbdc['CmContact']['describe']()['then'](function(_0x175b74){return _0x59bbdc[_0xa202('0x1d')][_0xa202('0x1e')]({'where':{'id':_0x3f38d6[_0xa202('0x1f')]},'include':[{'model':_0x59bbdc[_0xa202('0x20')],'as':_0xa202('0x21'),'where':{'id':_0x3f38d6['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x59bbdc[_0xa202('0x22')],'as':_0xa202('0x23'),'attributes':_[_0xa202('0x24')](_0x175b74)}]}]});})['then'](function(_0x37c1d9){_0x42b39f=_0x37c1d9['get']({'plain':!![]});if(_0x42b39f&&_0x42b39f['replyUri']){logger[_0xa202('0x25')](_0xa202('0x26'),'afterCreate',util[_0xa202('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x3f38d6['id'],_0x42b39f[_0xa202('0x28')]));if(_0x42b39f['Interactions']&&_0x42b39f['Interactions']['length']){_0x3f38d6[_0xa202('0x29')]=_[_0xa202('0x2a')](_0x42b39f[_0xa202('0x21')][0x0],'Contact');_0x3f38d6[_0xa202('0x23')]=_0x42b39f[_0xa202('0x21')][0x0]['Contact'];}var _0x307f72={'method':'POST','uri':encodeURI(_0x42b39f[_0xa202('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x307f72[_0xa202('0x2b')]){case _0xa202('0x2c'):_0x307f72['qs']=_0x3f38d6;break;case'POST':_0x307f72[_0xa202('0xd')]=_0x3f38d6;break;}return rp(_0x307f72)[_0xa202('0x19')](function(_0x1513e0){logger['info'](_0xa202('0x26'),_0xa202('0x2d'),util[_0xa202('0x27')](_0xa202('0x2e'),_0x3f38d6['id'],_0x42b39f[_0xa202('0x28')]));if(_0x1513e0[_0xa202('0xd')][_0xa202('0x2f')]&&_0x1513e0[_0xa202('0xd')]['threadId']!=_0x3f38d6[_0xa202('0x29')][_0xa202('0x2f')]){return _0x59bbdc['OpenchannelInteraction'][_0xa202('0x1a')]({'threadId':_0x1513e0[_0xa202('0xd')]['threadId']},{'where':{'id':_0x3f38d6['Interaction']['id']}});}else{return;}})[_0xa202('0x19')](function(){return _0x1de2a9[_0xa202('0x1a')]({'read':!![]});})[_0xa202('0x1c')](function(_0x37130f){logger[_0xa202('0x30')](_0xa202('0x26'),_0xa202('0x2d'),util[_0xa202('0x31')](_0x37130f,{'showHidden':![],'depth':null}));_0x2055d7();});}else{_0x2055d7();}})[_0xa202('0x32')](function(){_0x2055d7();});}else{_0x2055d7();}}},'charset':_0xa202('0x33'),'collate':_0xa202('0x34')});}; \ No newline at end of file +var _0xe66e=['catch','error','secret','describe','find','OpenchannelAccountId','OpenchannelInteraction','Contact','keys','then','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','body','format','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','findOne','OpenchannelInteractionId','update'];(function(_0x42eb9d,_0xc372c4){var _0x2bbe80=function(_0x54d132){while(--_0x54d132){_0x42eb9d['push'](_0x42eb9d['shift']());}};_0x2bbe80(++_0xc372c4);}(_0xe66e,0x121));var _0xee66=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0xe66e[_0x33d4a2];return _0x2c793f;};'use strict';var _=require(_0xee66('0x0'));var util=require(_0xee66('0x1'));var logger=require(_0xee66('0x2'))(_0xee66('0x3'));var moment=require('moment');var BPromise=require(_0xee66('0x4'));var rp=require(_0xee66('0x5'));var fs=require('fs');var path=require(_0xee66('0x6'));var rimraf=require('rimraf');var config=require(_0xee66('0x7'));var attributes=require(_0xee66('0x8'));module['exports']=function(_0x4a8c11,_0x2c67f6){return _0x4a8c11[_0xee66('0x9')](_0xee66('0xa'),attributes,{'tableName':_0xee66('0xb'),'paranoid':![],'indexes':[{'name':_0xee66('0xc'),'fields':['body'],'type':_0xee66('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x98ad3d,_0x25fedb,_0x379bd8){var _0x59d20e=_0x4a8c11['models'];var _0x53992d=_0x98ad3d[_0xee66('0xe')]({'plain':!![]});if(_0x53992d[_0xee66('0xf')][_0xee66('0x10')]()==='in'||_0x53992d['direction']['toLowerCase']()===_0xee66('0x11')&&!_0x53992d['secret']&&!_[_0xee66('0x12')](_0x53992d[_0xee66('0x13')])){_0x59d20e['OpenchannelInteraction'][_0xee66('0x14')]({'where':{'id':_0x53992d[_0xee66('0x15')]}})['then'](function(_0x410ab2){if(_0x410ab2){_0x410ab2[_0xee66('0x16')]({'lastMsgAt':_0x53992d['createdAt'],'lastMsgDirection':_0x53992d[_0xee66('0xf')][_0xee66('0x10')]()});}})[_0xee66('0x17')](function(_0x4681d7){console[_0xee66('0x18')](_0x4681d7);});}if(_0x53992d['direction']==='out'&&!_0x53992d[_0xee66('0x19')]){var _0x84f56e;_0x59d20e['CmContact'][_0xee66('0x1a')]()['then'](function(_0x5d8af5){return _0x59d20e['OpenchannelAccount'][_0xee66('0x1b')]({'where':{'id':_0x53992d[_0xee66('0x1c')]},'include':[{'model':_0x59d20e[_0xee66('0x1d')],'as':'Interactions','where':{'id':_0x53992d[_0xee66('0x15')]},'limit':0x1,'include':[{'model':_0x59d20e['CmContact'],'as':_0xee66('0x1e'),'attributes':_[_0xee66('0x1f')](_0x5d8af5)}]}]});})[_0xee66('0x20')](function(_0x1cca03){_0x84f56e=_0x1cca03[_0xee66('0xe')]({'plain':!![]});if(_0x84f56e&&_0x84f56e[_0xee66('0x21')]){logger[_0xee66('0x22')](_0xee66('0x23'),_0xee66('0x24'),util['format'](_0xee66('0x25'),_0x53992d['id'],_0x84f56e['replyUri']));if(_0x84f56e['Interactions']&&_0x84f56e[_0xee66('0x26')][_0xee66('0x27')]){_0x53992d[_0xee66('0x28')]=_[_0xee66('0x29')](_0x84f56e[_0xee66('0x26')][0x0],_0xee66('0x1e'));_0x53992d[_0xee66('0x1e')]=_0x84f56e['Interactions'][0x0]['Contact'];}var _0x25fedb={'method':_0xee66('0x2a'),'uri':encodeURI(_0x84f56e[_0xee66('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x25fedb[_0xee66('0x2b')]){case _0xee66('0x2c'):_0x25fedb['qs']=_0x53992d;break;case'POST':_0x25fedb[_0xee66('0x2d')]=_0x53992d;break;}return rp(_0x25fedb)[_0xee66('0x20')](function(_0x54ae02){logger['info'](_0xee66('0x23'),_0xee66('0x24'),util[_0xee66('0x2e')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x53992d['id'],_0x84f56e[_0xee66('0x21')]));if(_0x54ae02['body']['threadId']&&_0x54ae02[_0xee66('0x2d')][_0xee66('0x2f')]!=_0x53992d[_0xee66('0x28')]['threadId']){return _0x59d20e[_0xee66('0x1d')]['update']({'threadId':_0x54ae02[_0xee66('0x2d')]['threadId']},{'where':{'id':_0x53992d[_0xee66('0x28')]['id']}});}else{return;}})['then'](function(){return _0x98ad3d[_0xee66('0x16')]({'read':!![]});})[_0xee66('0x17')](function(_0x6caf9a){logger[_0xee66('0x18')](_0xee66('0x23'),_0xee66('0x24'),util[_0xee66('0x30')](_0x6caf9a,{'showHidden':![],'depth':null}));_0x379bd8();});}else{_0x379bd8();}})[_0xee66('0x31')](function(){_0x379bd8();});}else{_0x379bd8();}}},'charset':_0xee66('0x32'),'collate':_0xee66('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index dcfa422..a19bede 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d0f36,_0x477b6d){var _0x1648ba=function(_0x47d3d8){while(--_0x47d3d8){_0x3d0f36['push'](_0x3d0f36['shift']());}};_0x1648ba(++_0x477b6d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5f1330,_0x5be4fe){_0x5f1330=_0x5f1330-0x0;var _0x205aeb=_0x5f2f[_0x5f1330];return _0x205aeb;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x4ca6ab,_0x29bc6c){var _0x516678=function(_0x108d0e){while(--_0x108d0e){_0x4ca6ab['push'](_0x4ca6ab['shift']());}};_0x516678(++_0x29bc6c);}(_0xdb28,0x106));var _0x8db2=function(_0x8aae1e,_0x55ecd8){_0x8aae1e=_0x8aae1e-0x0;var _0x2dc41c=_0xdb28[_0x8aae1e];return _0x2dc41c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d89d65d..b222e03 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 _0xdced=['save','remove','update','removeListener','register','length','openchannelMessage:'];(function(_0x4b0c37,_0x4cc3a8){var _0x58e950=function(_0x2588ce){while(--_0x2588ce){_0x4b0c37['push'](_0x4b0c37['shift']());}};_0x58e950(++_0x4cc3a8);}(_0xdced,0xcb));var _0xddce=function(_0x35944f,_0x5b1107){_0x35944f=_0x35944f-0x0;var _0xb26f38=_0xdced[_0x35944f];return _0xb26f38;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xddce('0x0'),_0xddce('0x1'),_0xddce('0x2')];function createListener(_0x3d775a,_0x7e2315){return function(_0x1a747d){_0x7e2315['emit'](_0x3d775a,_0x1a747d);};}function removeListener(_0x1c3f2a,_0x509b66){return function(){OpenchannelMessageEvents[_0xddce('0x3')](_0x1c3f2a,_0x509b66);};}exports[_0xddce('0x4')]=function(_0x541f99){for(var _0x31c76b=0x0,_0x57e11c=events[_0xddce('0x5')];_0x31c76b<_0x57e11c;_0x31c76b++){var _0x46b464=events[_0x31c76b];var _0x272a2c=createListener(_0xddce('0x6')+_0x46b464,_0x541f99);OpenchannelMessageEvents['on'](_0x46b464,_0x272a2c);}}; \ No newline at end of file +var _0x4f03=['./openchannelMessage.events','save','remove','emit','removeListener','register','openchannelMessage:'];(function(_0x2683a4,_0x48e780){var _0x284a0c=function(_0x48362a){while(--_0x48362a){_0x2683a4['push'](_0x2683a4['shift']());}};_0x284a0c(++_0x48e780);}(_0x4f03,0xfc));var _0x34f0=function(_0x42f247,_0x5bbeca){_0x42f247=_0x42f247-0x0;var _0x411317=_0x4f03[_0x42f247];return _0x411317;};'use strict';var OpenchannelMessageEvents=require(_0x34f0('0x0'));var events=[_0x34f0('0x1'),_0x34f0('0x2'),'update'];function createListener(_0x348701,_0x562977){return function(_0x93d5e4){_0x562977[_0x34f0('0x3')](_0x348701,_0x93d5e4);};}function removeListener(_0x1b582a,_0x205cce){return function(){OpenchannelMessageEvents[_0x34f0('0x4')](_0x1b582a,_0x205cce);};}exports[_0x34f0('0x5')]=function(_0x29ac6f){for(var _0x2bd273=0x0,_0x78caec=events['length'];_0x2bd273<_0x78caec;_0x2bd273++){var _0x4ebda4=events[_0x2bd273];var _0x235784=createListener(_0x34f0('0x6')+_0x4ebda4,_0x29ac6f);OpenchannelMessageEvents['on'](_0x4ebda4,_0x235784);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fdb1325..cd54fb9 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 _0x14bf=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x14bf,0x17a));var _0xf14b=function(_0x27dda3,_0x4e37aa){_0x27dda3=_0x27dda3-0x0;var _0x3e6a6e=_0x14bf[_0x27dda3];return _0x3e6a6e;};'use strict';var multer=require(_0xf14b('0x0'));var util=require(_0xf14b('0x1'));var path=require(_0xf14b('0x2'));var timeout=require(_0xf14b('0x3'));var express=require('express');var router=express[_0xf14b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf14b('0x5'));var controller=require('./openchannelQueue.controller');router[_0xf14b('0x6')]('/',auth['isAuthenticated'](),controller[_0xf14b('0x7')]);router[_0xf14b('0x6')](_0xf14b('0x8'),auth[_0xf14b('0x9')](),controller['describe']);router[_0xf14b('0x6')](_0xf14b('0xa'),auth['isAuthenticated'](),controller[_0xf14b('0xb')]);router['get'](_0xf14b('0xc'),auth[_0xf14b('0x9')](),controller[_0xf14b('0xd')]);router['get'](_0xf14b('0xe'),auth[_0xf14b('0x9')](),controller[_0xf14b('0xf')]);router[_0xf14b('0x6')](_0xf14b('0x10'),auth['isAuthenticated'](),controller[_0xf14b('0x11')]);router[_0xf14b('0x12')]('/',auth[_0xf14b('0x9')](),controller[_0xf14b('0x13')]);router[_0xf14b('0x12')](_0xf14b('0xe'),auth[_0xf14b('0x9')](),controller['addTeams']);router[_0xf14b('0x12')](_0xf14b('0x10'),auth[_0xf14b('0x9')](),controller[_0xf14b('0x14')]);router['put'](_0xf14b('0xa'),auth[_0xf14b('0x9')](),controller[_0xf14b('0x15')]);router['delete'](_0xf14b('0xa'),auth[_0xf14b('0x9')](),controller['destroy']);router[_0xf14b('0x16')](_0xf14b('0xe'),auth[_0xf14b('0x9')](),controller[_0xf14b('0x17')]);router[_0xf14b('0x16')](_0xf14b('0x10'),auth[_0xf14b('0x9')](),controller[_0xf14b('0x18')]);module[_0xf14b('0x19')]=router; \ No newline at end of file +var _0x5efa=['show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x1a93bb,_0x1be2c4){var _0x5c591b=function(_0xf138dc){while(--_0xf138dc){_0x1a93bb['push'](_0x1a93bb['shift']());}};_0x5c591b(++_0x1be2c4);}(_0x5efa,0x196));var _0xa5ef=function(_0x4ce712,_0x1d325d){_0x4ce712=_0x4ce712-0x0;var _0x4e8220=_0x5efa[_0x4ce712];return _0x4e8220;};'use strict';var multer=require(_0xa5ef('0x0'));var util=require(_0xa5ef('0x1'));var path=require(_0xa5ef('0x2'));var timeout=require(_0xa5ef('0x3'));var express=require('express');var router=express[_0xa5ef('0x4')]();var fs_extra=require(_0xa5ef('0x5'));var auth=require(_0xa5ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5ef('0x7'));var controller=require(_0xa5ef('0x8'));router[_0xa5ef('0x9')]('/',auth[_0xa5ef('0xa')](),controller[_0xa5ef('0xb')]);router[_0xa5ef('0x9')]('/describe',auth[_0xa5ef('0xa')](),controller[_0xa5ef('0xc')]);router[_0xa5ef('0x9')](_0xa5ef('0xd'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0xe')]);router[_0xa5ef('0x9')]('/:id/members',auth[_0xa5ef('0xa')](),controller[_0xa5ef('0xf')]);router[_0xa5ef('0x9')](_0xa5ef('0x10'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x11')]);router[_0xa5ef('0x9')](_0xa5ef('0x12'),auth['isAuthenticated'](),controller[_0xa5ef('0x13')]);router[_0xa5ef('0x14')]('/',auth[_0xa5ef('0xa')](),controller['create']);router[_0xa5ef('0x14')](_0xa5ef('0x10'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x15')]);router[_0xa5ef('0x14')](_0xa5ef('0x12'),auth['isAuthenticated'](),controller[_0xa5ef('0x16')]);router[_0xa5ef('0x17')](_0xa5ef('0xd'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x18')]);router[_0xa5ef('0x19')](_0xa5ef('0xd'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x1a')]);router[_0xa5ef('0x19')]('/:id/teams',auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x1b')]);router['delete'](_0xa5ef('0x12'),auth[_0xa5ef('0xa')](),controller[_0xa5ef('0x1c')]);module[_0xa5ef('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0964b45..79c1b0b 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 _0xcf6f=['exports','STRING','name','INTEGER','ENUM','beepall','sequelize'];(function(_0x12f074,_0x48b78e){var _0x2aa23b=function(_0xf4b797){while(--_0xf4b797){_0x12f074['push'](_0x12f074['shift']());}};_0x2aa23b(++_0x48b78e);}(_0xcf6f,0x1a3));var _0xfcf6=function(_0x226369,_0x1f1a9c){_0x226369=_0x226369-0x0;var _0x51545a=_0xcf6f[_0x226369];return _0x51545a;};'use strict';var Sequelize=require(_0xfcf6('0x0'));module[_0xfcf6('0x1')]={'name':{'type':Sequelize[_0xfcf6('0x2')],'unique':_0xfcf6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfcf6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfcf6('0x5')]('rrmemory',_0xfcf6('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x16d4=['exports','name','INTEGER','ENUM','beepall','sequelize'];(function(_0x52405b,_0x2d1f1a){var _0xadf5be=function(_0x2dae9f){while(--_0x2dae9f){_0x52405b['push'](_0x52405b['shift']());}};_0xadf5be(++_0x2d1f1a);}(_0x16d4,0x1c7));var _0x416d=function(_0x50cd0a,_0x4d1b81){_0x50cd0a=_0x50cd0a-0x0;var _0x1bd6ba=_0x16d4[_0x50cd0a];return _0x1bd6ba;};'use strict';var Sequelize=require(_0x416d('0x0'));module[_0x416d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x416d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x416d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x416d('0x4')]('rrmemory',_0x416d('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index df7ce70..968f71f 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 _0x6f35=['userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','transaction','forEach','userOpenchannelQueue:remove','addAgents','removeAgents','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','then','destroy','get','stack','name','index','map','OpenchannelQueue','type','key','getOptions','where','query','rows','catch','model','keys','rawAttributes','filters','intersection','fields','attributes','length','include','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','pick','OpenchannelQueueId','filter','findAll','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','order','getTeams','addTeams','ids','Agents','online','voicePause','interface','findOrCreate','emit'];(function(_0x2731a0,_0x5e59ff){var _0x418aed=function(_0xc78500){while(--_0xc78500){_0x2731a0['push'](_0x2731a0['shift']());}};_0x418aed(++_0x5e59ff);}(_0x6f35,0x8e));var _0x56f3=function(_0x257b00,_0x3658be){_0x257b00=_0x257b00-0x0;var _0x247e16=_0x6f35[_0x257b00];return _0x247e16;};'use strict';var BPromise=require(_0x56f3('0x0'));var util=require('util');var _=require(_0x56f3('0x1'));var squel=require(_0x56f3('0x2'));var Redis=require(_0x56f3('0x3'));var qs=require(_0x56f3('0x4'));var logger=require(_0x56f3('0x5'))(_0x56f3('0x6'));var config=require(_0x56f3('0x7'));var db=require(_0x56f3('0x8'))['db'];config[_0x56f3('0x9')]=_[_0x56f3('0xa')](config[_0x56f3('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56f3('0x9')]));require(_0x56f3('0xb'))[_0x56f3('0xc')](socket);function respondWithStatusCode(_0xb8f1f5,_0x2ba0df){_0x2ba0df=_0x2ba0df||0xcc;return function(_0x10d90f){if(_0x10d90f){return _0xb8f1f5[_0x56f3('0xd')](_0x2ba0df);}return _0xb8f1f5[_0x56f3('0xe')](_0x2ba0df)[_0x56f3('0xf')]();};}function respondWithResult(_0x577f0f,_0x23b837){_0x23b837=_0x23b837||0xc8;return function(_0x2e82ef){if(_0x2e82ef){return _0x577f0f['status'](_0x23b837)[_0x56f3('0x10')](_0x2e82ef);}};}function respondWithFilteredResult(_0x41403d,_0x3e0818){return function(_0x4b8b63){if(_0x4b8b63){var _0x5e7aca=typeof _0x3e0818['offset']===_0x56f3('0x11')&&typeof _0x3e0818[_0x56f3('0x12')]===_0x56f3('0x11');var _0x43b863=_0x4b8b63[_0x56f3('0x13')];var _0x43ad6f=_0x5e7aca?0x0:_0x3e0818[_0x56f3('0x14')];var _0x5c6344=_0x5e7aca?_0x4b8b63[_0x56f3('0x13')]:_0x3e0818['offset']+_0x3e0818[_0x56f3('0x12')];var _0x33ae78;if(_0x5c6344>=_0x43b863){_0x5c6344=_0x43b863;_0x33ae78=0xc8;}else{_0x33ae78=0xce;}_0x41403d[_0x56f3('0xe')](_0x33ae78);return _0x41403d['set'](_0x56f3('0x15'),_0x43ad6f+'-'+_0x5c6344+'/'+_0x43b863)[_0x56f3('0x10')](_0x4b8b63);}return null;};}function saveUpdates(_0x30643e){return function(_0x32c45d){if(_0x32c45d){return _0x32c45d['update'](_0x30643e)[_0x56f3('0x16')](function(_0x241cd2){return _0x241cd2;});}return null;};}function removeEntity(_0x42f2a7){return function(_0x962f34){if(_0x962f34){return _0x962f34[_0x56f3('0x17')]()['then'](function(){var _0x32ec4a=_0x962f34[_0x56f3('0x18')]({'plain':!![]});var _0xbbaa='OpenchannelQueues';return db['UserProfileResource'][_0x56f3('0x17')]({'where':{'type':_0xbbaa,'resourceId':_0x32ec4a['id']}})[_0x56f3('0x16')](function(){return _0x962f34;});})['then'](function(){_0x42f2a7[_0x56f3('0xe')](0xcc)[_0x56f3('0xf')]();});}};}function handleEntityNotFound(_0x26b11a){return function(_0x282e65){if(!_0x282e65){_0x26b11a['sendStatus'](0x194);}return _0x282e65;};}function handleError(_0x4624d4,_0x5dc4fb){_0x5dc4fb=_0x5dc4fb||0x1f4;return function(_0x3f98b4){logger['error'](_0x3f98b4[_0x56f3('0x19')]);if(_0x3f98b4[_0x56f3('0x1a')]){delete _0x3f98b4['name'];}_0x4624d4[_0x56f3('0xe')](_0x5dc4fb)['send'](_0x3f98b4);};}exports[_0x56f3('0x1b')]=function(_0x27a976,_0x1126aa){var _0x5f3ac1={};var _0x52050b={'count':0x0,'rows':[]};var _0x7e45e3=_[_0x56f3('0x1c')](db[_0x56f3('0x1d')]['rawAttributes'],function(_0x23ddde){return{'name':_0x23ddde['fieldName'],'type':_0x23ddde[_0x56f3('0x1e')][_0x56f3('0x1f')]};});_0x5f3ac1=qs[_0x56f3('0x20')](_0x7e45e3,_0x27a976);var _0x51a1fc={'where':_0x5f3ac1[_0x56f3('0x21')]};return db[_0x56f3('0x1d')][_0x56f3('0x13')](_0x51a1fc)['then'](function(_0xbc447c){_0x52050b[_0x56f3('0x13')]=_0xbc447c;_0x5f3ac1['include']=qs['include'](_0x27a976[_0x56f3('0x22')]);return db['OpenchannelQueue']['findAll'](_0x5f3ac1);})[_0x56f3('0x16')](function(_0x41d57d){_0x52050b[_0x56f3('0x23')]=_0x41d57d;return _0x52050b;})[_0x56f3('0x16')](respondWithFilteredResult(_0x1126aa,_0x5f3ac1))[_0x56f3('0x24')](handleError(_0x1126aa,null));};exports['show']=function(_0x4f307a,_0x5e8d08){var _0x179751={'raw':!![],'where':{'id':_0x4f307a['params']['id']}},_0x24561b={};_0x24561b[_0x56f3('0x25')]=_[_0x56f3('0x26')](db[_0x56f3('0x1d')][_0x56f3('0x27')]);_0x24561b[_0x56f3('0x22')]=_[_0x56f3('0x26')](_0x4f307a[_0x56f3('0x22')]);_0x24561b[_0x56f3('0x28')]=_[_0x56f3('0x29')](_0x24561b[_0x56f3('0x25')],_0x24561b[_0x56f3('0x22')]);_0x179751['attributes']=_[_0x56f3('0x29')](_0x24561b[_0x56f3('0x25')],qs[_0x56f3('0x2a')](_0x4f307a[_0x56f3('0x22')][_0x56f3('0x2a')]));_0x179751[_0x56f3('0x2b')]=_0x179751[_0x56f3('0x2b')][_0x56f3('0x2c')]?_0x179751[_0x56f3('0x2b')]:_0x24561b[_0x56f3('0x25')];if(_0x4f307a[_0x56f3('0x22')]['includeAll']){_0x179751[_0x56f3('0x2d')]=[{'all':!![]}];}_0x179751=_[_0x56f3('0x2e')]({},_0x179751,_0x4f307a[_0x56f3('0x2f')]);return db['OpenchannelQueue'][_0x56f3('0x30')](_0x179751)[_0x56f3('0x16')](handleEntityNotFound(_0x5e8d08,null))[_0x56f3('0x16')](respondWithResult(_0x5e8d08,null))[_0x56f3('0x24')](handleError(_0x5e8d08,null));};exports[_0x56f3('0x31')]=function(_0x37d9da,_0xf96d5e){return db['OpenchannelQueue']['create'](_0x37d9da[_0x56f3('0x32')],{})[_0x56f3('0x16')](function(_0xb7025b){var _0x5871c7=_0x37d9da['user'][_0x56f3('0x18')]({'plain':!![]});if(!_0x5871c7)throw new Error(_0x56f3('0x33'));if(_0x5871c7[_0x56f3('0x34')]==='user'){var _0x34bd8a=_0xb7025b[_0x56f3('0x18')]({'plain':!![]});var _0x536b8b=_0x56f3('0x35');return db[_0x56f3('0x36')][_0x56f3('0x30')]({'where':{'name':_0x536b8b,'userProfileId':_0x5871c7[_0x56f3('0x37')]},'raw':!![]})['then'](function(_0xf4e49e){if(_0xf4e49e&&_0xf4e49e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34bd8a[_0x56f3('0x1a')],'resourceId':_0x34bd8a['id'],'type':_0xf4e49e['name'],'sectionId':_0xf4e49e['id']},{})[_0x56f3('0x16')](function(){return _0xb7025b;});}else{return _0xb7025b;}})[_0x56f3('0x24')](function(_0x341982){logger['error'](_0x56f3('0x38'),_0x341982);throw _0x341982;});}return _0xb7025b;})[_0x56f3('0x16')](respondWithResult(_0xf96d5e,0xc9))['catch'](handleError(_0xf96d5e,null));};exports[_0x56f3('0x39')]=function(_0x451d45,_0x7320a1){if(_0x451d45[_0x56f3('0x32')]['id']){delete _0x451d45[_0x56f3('0x32')]['id'];}return db[_0x56f3('0x1d')][_0x56f3('0x30')]({'where':{'id':_0x451d45[_0x56f3('0x3a')]['id']}})[_0x56f3('0x16')](handleEntityNotFound(_0x7320a1,null))[_0x56f3('0x16')](saveUpdates(_0x451d45['body'],null))['then'](respondWithResult(_0x7320a1,null))['catch'](handleError(_0x7320a1,null));};exports['destroy']=function(_0x11bdfe,_0x50369c){return db['OpenchannelQueue'][_0x56f3('0x30')]({'where':{'id':_0x11bdfe['params']['id']}})['then'](handleEntityNotFound(_0x50369c,null))[_0x56f3('0x16')](removeEntity(_0x50369c,null))[_0x56f3('0x24')](handleError(_0x50369c,null));};exports[_0x56f3('0x3b')]=function(_0x270fe9,_0x3b24bf){return db[_0x56f3('0x1d')][_0x56f3('0x3b')]()[_0x56f3('0x16')](respondWithResult(_0x3b24bf,null))['catch'](handleError(_0x3b24bf,null));};exports[_0x56f3('0x3c')]=function(_0x123cca,_0x4497fc){var _0x9ec491={'raw':!![],'where':{}},_0x424783={},_0xcc1347;return db[_0x56f3('0x1d')][_0x56f3('0x3d')]({'where':{'id':_0x123cca[_0x56f3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4497fc,null))['then'](function(_0x14075b){if(_0x14075b){_0xcc1347=_0x14075b['get']({'plain':!![]});_0x424783[_0x56f3('0x25')]=_['keys'](db[_0x56f3('0x3e')][_0x56f3('0x27')]);_0x424783[_0x56f3('0x22')]=_[_0x56f3('0x26')](_0x123cca[_0x56f3('0x22')]);_0x424783[_0x56f3('0x28')]=_[_0x56f3('0x29')](_0x424783[_0x56f3('0x25')],_0x424783['query']);_0x9ec491[_0x56f3('0x2b')]=_[_0x56f3('0x29')](_0x424783[_0x56f3('0x25')],qs[_0x56f3('0x2a')](_0x123cca[_0x56f3('0x22')][_0x56f3('0x2a')]));_0x9ec491['attributes']=_0x9ec491[_0x56f3('0x2b')]['length']?_0x9ec491[_0x56f3('0x2b')]:_0x424783[_0x56f3('0x25')];if(!_0x123cca[_0x56f3('0x22')][_0x56f3('0x3f')](_0x56f3('0x40'))){_0x9ec491[_0x56f3('0x12')]=qs[_0x56f3('0x12')](_0x123cca['query'][_0x56f3('0x12')]);_0x9ec491['offset']=qs['offset'](_0x123cca[_0x56f3('0x22')][_0x56f3('0x14')]);}_0x9ec491['order']=qs[_0x56f3('0x41')](_0x123cca[_0x56f3('0x22')][_0x56f3('0x41')]);_0x9ec491[_0x56f3('0x21')]=qs[_0x56f3('0x28')](_[_0x56f3('0x42')](_0x123cca[_0x56f3('0x22')],_0x424783[_0x56f3('0x28')]));_0x9ec491['where'][_0x56f3('0x43')]=_0x14075b['id'];if(_0x123cca[_0x56f3('0x22')][_0x56f3('0x44')]){_0x9ec491[_0x56f3('0x21')]=_[_0x56f3('0x2e')](_0x9ec491['where'],{'$or':_[_0x56f3('0x1c')](_0x9ec491[_0x56f3('0x2b')],function(_0x88417a){var _0x10cbfc={};_0x10cbfc[_0x88417a]={'$like':'%'+_0x123cca[_0x56f3('0x22')][_0x56f3('0x44')]+'%'};return _0x10cbfc;})});}_0x9ec491=_[_0x56f3('0x2e')]({},_0x9ec491,_0x123cca[_0x56f3('0x2f')]);return db[_0x56f3('0x3e')][_0x56f3('0x45')](_0x9ec491);}})['then'](function(_0x49113f){if(_0x49113f){return db[_0x56f3('0x46')][_0x56f3('0x47')]({'where':{'id':_[_0x56f3('0x1c')](_0x49113f,_0x56f3('0x48')),'role':_0x56f3('0x49')},'attributes':['id','name',_0x56f3('0x4a'),'updatedAt',_0x56f3('0x4b')]});}})['then'](function(_0xb11b0d){if(_0xb11b0d){return{'count':_0xb11b0d['count'],'rows':_[_0x56f3('0x1c')](_0xb11b0d[_0x56f3('0x23')],function(_0x3889c5){return{'membername':_0x3889c5[_0x56f3('0x1a')],'UserId':_0x3889c5['id'],'queue_name':_0xcc1347[_0x56f3('0x1a')],'OpenchannelQueueId':_0xcc1347['id'],'interface':util[_0x56f3('0x4c')](_0x56f3('0x4d'),_0x56f3('0x4e'),_0x3889c5['name']),'penalty':0x0,'paused':_0x3889c5[_0x56f3('0x4a')],'createdAt':_0x3889c5[_0x56f3('0x4b')],'updatedAt':_0x3889c5[_0x56f3('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x56f3('0x16')](respondWithFilteredResult(_0x4497fc,_0x9ec491))[_0x56f3('0x24')](handleError(_0x4497fc,null));};exports['getTeams']=function(_0x1cad85,_0x29d9eb){var _0xafc8d={};var _0x3bcfa1={};var _0x31f556;var _0x5bd3f6;return db['OpenchannelQueue'][_0x56f3('0x3d')]({'where':{'id':_0x1cad85['params']['id']}})[_0x56f3('0x16')](handleEntityNotFound(_0x29d9eb,null))[_0x56f3('0x16')](function(_0x1a07e3){if(_0x1a07e3){_0x31f556=_0x1a07e3;_0x3bcfa1[_0x56f3('0x25')]=_[_0x56f3('0x26')](db['Team'][_0x56f3('0x27')]);_0x3bcfa1['query']=_[_0x56f3('0x26')](_0x1cad85['query']);_0x3bcfa1[_0x56f3('0x28')]=_[_0x56f3('0x29')](_0x3bcfa1[_0x56f3('0x25')],_0x3bcfa1[_0x56f3('0x22')]);_0xafc8d['attributes']=_[_0x56f3('0x29')](_0x3bcfa1['model'],qs['fields'](_0x1cad85['query'][_0x56f3('0x2a')]));_0xafc8d[_0x56f3('0x2b')]=_0xafc8d[_0x56f3('0x2b')]['length']?_0xafc8d[_0x56f3('0x2b')]:_0x3bcfa1[_0x56f3('0x25')];_0xafc8d[_0x56f3('0x50')]=qs['sort'](_0x1cad85[_0x56f3('0x22')]['sort']);_0xafc8d[_0x56f3('0x21')]=qs[_0x56f3('0x28')](_[_0x56f3('0x42')](_0x1cad85[_0x56f3('0x22')],_0x3bcfa1[_0x56f3('0x28')]));if(_0x1cad85[_0x56f3('0x22')][_0x56f3('0x44')]){_0xafc8d[_0x56f3('0x21')]=_[_0x56f3('0x2e')](_0xafc8d['where'],{'$or':_[_0x56f3('0x1c')](_0xafc8d[_0x56f3('0x2b')],function(_0xd64bcc){var _0x1ce65e={};_0x1ce65e[_0xd64bcc]={'$like':'%'+_0x1cad85['query'][_0x56f3('0x44')]+'%'};return _0x1ce65e;})});}_0xafc8d=_[_0x56f3('0x2e')]({},_0xafc8d,_0x1cad85[_0x56f3('0x2f')]);return _0x31f556[_0x56f3('0x51')](_0xafc8d);}})[_0x56f3('0x16')](function(_0x54a4df){if(_0x54a4df){_0x5bd3f6=_0x54a4df[_0x56f3('0x2c')];if(!_0x1cad85[_0x56f3('0x22')][_0x56f3('0x3f')](_0x56f3('0x40'))){_0xafc8d[_0x56f3('0x12')]=qs[_0x56f3('0x12')](_0x1cad85['query']['limit']);_0xafc8d[_0x56f3('0x14')]=qs[_0x56f3('0x14')](_0x1cad85['query'][_0x56f3('0x14')]);}return _0x31f556[_0x56f3('0x51')](_0xafc8d);}})[_0x56f3('0x16')](function(_0x567c05){if(_0x567c05){return _0x567c05?{'count':_0x5bd3f6,'rows':_0x567c05}:null;}})[_0x56f3('0x16')](respondWithResult(_0x29d9eb,null))[_0x56f3('0x24')](handleError(_0x29d9eb,null));};exports[_0x56f3('0x52')]=function(_0x52c9d7,_0x1f83aa){var _0x2aec0c=_0x52c9d7[_0x56f3('0x32')][_0x56f3('0x53')];return db['Team']['findAll']({'where':{'id':_0x2aec0c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x56f3('0x54'),'attributes':['id',_0x56f3('0x1a'),_0x56f3('0x55'),_0x56f3('0x56'),_0x56f3('0x57')],'raw':!![]}]})[_0x56f3('0x16')](function(_0x77d96d){if(_0x77d96d){var _0x5b5ba3=_['flatMap'](_0x77d96d,function(_0x1dd65b){var _0x5981ef=_0x1dd65b[_0x56f3('0x18')]({'plain':!![]});return _0x5981ef[_0x56f3('0x54')];});return db[_0x56f3('0x1d')]['find']({'where':{'id':_0x52c9d7[_0x56f3('0x3a')]['id']}})['then'](function(_0x27c2eb){return db['sequelize']['transaction'](function(_0x27aebc){return _0x27c2eb[_0x56f3('0x52')](_0x2aec0c,{'transaction':_0x27aebc})['then'](function(){return BPromise['each'](_0x5b5ba3,function(_0x45b71e){return db[_0x56f3('0x3e')][_0x56f3('0x58')]({'where':{'UserId':_0x45b71e['id'],'OpenchannelQueueId':_0x52c9d7[_0x56f3('0x3a')]['id']},'transaction':_0x27aebc});});})[_0x56f3('0x16')](function(){_0x5b5ba3['forEach'](function(_0x32d617){socket[_0x56f3('0x59')](_0x56f3('0x5a'),{'UserId':_0x32d617['id'],'OpenchannelQueueId':_0x27c2eb['id']});});});});});}})[_0x56f3('0x16')](respondWithStatusCode(_0x1f83aa,null))[_0x56f3('0x24')](handleError(_0x1f83aa,null));};exports[_0x56f3('0x5b')]=function(_0x5534f8,_0x38c706){return db[_0x56f3('0x5c')][_0x56f3('0x45')]({'where':{'id':_0x5534f8[_0x56f3('0x22')][_0x56f3('0x53')]},'attributes':['id'],'include':[{'model':db[_0x56f3('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38c706,null))[_0x56f3('0x16')](function(_0xd8e9f7){var _0x3167ce=_[_0x56f3('0x1c')](_0xd8e9f7,'id');var _0x365306=[];var _0x7eec83=[];var _0x9a1070=squel[_0x56f3('0x5d')]();_0x9a1070[_0x56f3('0x5e')](_0x56f3('0x5f'))[_0x56f3('0x60')](_0x56f3('0x61'),'tq')[_0x56f3('0x62')](_0x56f3('0x63'),'ut',_0x56f3('0x64'))[_0x56f3('0x21')]('OpenchannelQueueId\x20=\x20?',_0x5534f8['params']['id']);for(var _0x3dc497=0x0;_0x3dc497<_0xd8e9f7['length'];_0x3dc497+=0x1){let _0x36fcf8=_0xd8e9f7[_0x3dc497];for(var _0x5a2816=0x0;_0x5a2816<_0x36fcf8['Agents'][_0x56f3('0x2c')];_0x5a2816+=0x1){let _0x44f581=_0x36fcf8[_0x56f3('0x54')][_0x5a2816];var _0x3afd9f=_0x9a1070[_0x56f3('0x65')]();_0x3afd9f[_0x56f3('0x21')]('ut.UserId\x20=\x20?',_0x44f581['id']);_0x7eec83[_0x56f3('0x66')](db[_0x56f3('0x67')][_0x56f3('0x22')](_0x3afd9f['toString'](),{'type':db[_0x56f3('0x67')][_0x56f3('0x68')][_0x56f3('0x69')]})[_0x56f3('0x16')](function(_0x3ff0ed){if(_0x3ff0ed['length']===0x1){return _0x44f581['id'];}else{var _0x1a1342=_['every'](_['map'](_0x3ff0ed,_0x56f3('0x6a')),function(_0x35b154){return _[_0x56f3('0x6b')](_0x3167ce,_0x35b154);});if(_0x1a1342){return _0x44f581['id'];}}}));}}return BPromise[_0x56f3('0x6c')](_0x7eec83)[_0x56f3('0x16')](function(_0x573740){_0x365306=_(_0x365306)[_0x56f3('0x6d')](_0x573740)['compact']()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x5534f8[_0x56f3('0x3a')]['id']}})['then'](function(_0x540fb8){return db[_0x56f3('0x67')][_0x56f3('0x6e')](function(_0x1c3d4c){return _0x540fb8[_0x56f3('0x5b')](_0x5534f8[_0x56f3('0x22')][_0x56f3('0x53')],{'transaction':_0x1c3d4c})[_0x56f3('0x16')](function(){if(!_['isEmpty'](_0x365306)){return _0x540fb8['removeAgents'](_0x365306,{'transaction':_0x1c3d4c});}})[_0x56f3('0x16')](function(){_0x365306[_0x56f3('0x6f')](function(_0x500294){socket[_0x56f3('0x59')](_0x56f3('0x70'),{'UserId':_0x500294,'OpenchannelQueueId':_0x540fb8['id']});});});});});});})['then'](respondWithStatusCode(_0x38c706,null))[_0x56f3('0x24')](handleError(_0x38c706,null));};exports['addAgents']=function(_0x5961d8,_0x36f661){return db['OpenchannelQueue']['find']({'where':{'id':_0x5961d8['params']['id']}})[_0x56f3('0x16')](handleEntityNotFound(_0x36f661,null))[_0x56f3('0x16')](function(_0x18848e){if(_0x18848e){return _0x18848e[_0x56f3('0x71')](_0x5961d8[_0x56f3('0x32')][_0x56f3('0x53')],_['omit'](_0x5961d8[_0x56f3('0x32')],[_0x56f3('0x53'),'id'])||{})['spread'](function(_0x3c2a0e){for(var _0x54ae91=0x0;_0x54ae91<_0x5961d8[_0x56f3('0x32')][_0x56f3('0x53')]['length'];_0x54ae91+=0x1){socket['emit'](_0x56f3('0x5a'),{'UserId':Number(_0x5961d8[_0x56f3('0x32')][_0x56f3('0x53')][_0x54ae91]),'OpenchannelQueueId':Number(_0x5961d8[_0x56f3('0x3a')]['id'])});}return _0x3c2a0e;});}})[_0x56f3('0x16')](respondWithResult(_0x36f661,null))[_0x56f3('0x24')](handleError(_0x36f661,null));};exports[_0x56f3('0x72')]=function(_0x3d8914,_0x216757){return db[_0x56f3('0x1d')][_0x56f3('0x30')]({'where':{'id':_0x3d8914[_0x56f3('0x3a')]['id']}})[_0x56f3('0x16')](handleEntityNotFound(_0x216757,null))[_0x56f3('0x16')](function(_0x273090){if(_0x273090){return _0x273090[_0x56f3('0x72')](_0x3d8914[_0x56f3('0x22')]['ids'])[_0x56f3('0x16')](function(){if(_['isArray'](_0x3d8914[_0x56f3('0x22')][_0x56f3('0x53')])){for(var _0x409e8d=0x0;_0x409e8d<_0x3d8914['query'][_0x56f3('0x53')]['length'];_0x409e8d+=0x1){socket['emit'](_0x56f3('0x70'),{'UserId':Number(_0x3d8914[_0x56f3('0x22')][_0x56f3('0x53')][_0x409e8d]),'OpenchannelQueueId':Number(_0x3d8914[_0x56f3('0x3a')]['id'])});}}else{socket['emit'](_0x56f3('0x70'),{'UserId':Number(_0x3d8914[_0x56f3('0x22')][_0x56f3('0x53')]),'OpenchannelQueueId':Number(_0x3d8914[_0x56f3('0x3a')]['id'])});}});}})[_0x56f3('0x16')](respondWithStatusCode(_0x216757,null))['catch'](handleError(_0x216757,null));};exports[_0x56f3('0x73')]=function(_0x3054ef,_0x3076e8){var _0x176547={};var _0x683c44={};var _0x455432;var _0x109abf;return db[_0x56f3('0x1d')]['findOne']({'where':{'id':_0x3054ef[_0x56f3('0x3a')]['id']}})[_0x56f3('0x16')](handleEntityNotFound(_0x3076e8,null))[_0x56f3('0x16')](function(_0x1da95b){if(_0x1da95b){_0x455432=_0x1da95b;_0x683c44[_0x56f3('0x25')]=_['keys'](db[_0x56f3('0x46')]['rawAttributes']);_0x683c44['query']=_['keys'](_0x3054ef[_0x56f3('0x22')]);_0x683c44[_0x56f3('0x28')]=_[_0x56f3('0x29')](_0x683c44[_0x56f3('0x25')],_0x683c44[_0x56f3('0x22')]);_0x176547[_0x56f3('0x2b')]=_[_0x56f3('0x29')](_0x683c44['model'],qs[_0x56f3('0x2a')](_0x3054ef[_0x56f3('0x22')][_0x56f3('0x2a')]));_0x176547[_0x56f3('0x2b')]=_0x176547['attributes'][_0x56f3('0x2c')]?_0x176547[_0x56f3('0x2b')]:_0x683c44[_0x56f3('0x25')];_0x176547[_0x56f3('0x50')]=qs['sort'](_0x3054ef[_0x56f3('0x22')][_0x56f3('0x41')]);_0x176547[_0x56f3('0x21')]=qs[_0x56f3('0x28')](_[_0x56f3('0x42')](_0x3054ef[_0x56f3('0x22')],_0x683c44[_0x56f3('0x28')]));if(_0x3054ef[_0x56f3('0x22')]['filter']){_0x176547[_0x56f3('0x21')]=_[_0x56f3('0x2e')](_0x176547[_0x56f3('0x21')],{'$or':_[_0x56f3('0x1c')](_0x176547[_0x56f3('0x2b')],function(_0x49e0ba){var _0xee8fdc={};_0xee8fdc[_0x49e0ba]={'$like':'%'+_0x3054ef['query'][_0x56f3('0x44')]+'%'};return _0xee8fdc;})});}_0x176547=_['merge']({},_0x176547,_0x3054ef[_0x56f3('0x2f')]);return _0x455432[_0x56f3('0x73')](_0x176547);}})[_0x56f3('0x16')](function(_0x4d195a){if(_0x4d195a){_0x109abf=_0x4d195a[_0x56f3('0x2c')];if(!_0x3054ef[_0x56f3('0x22')]['hasOwnProperty'](_0x56f3('0x40'))){_0x176547[_0x56f3('0x12')]=qs[_0x56f3('0x12')](_0x3054ef[_0x56f3('0x22')][_0x56f3('0x12')]);_0x176547[_0x56f3('0x14')]=qs[_0x56f3('0x14')](_0x3054ef[_0x56f3('0x22')]['offset']);}return _0x455432['getAgents'](_0x176547);}})[_0x56f3('0x16')](function(_0x273946){if(_0x273946){return _0x273946?{'count':_0x109abf,'rows':_0x273946}:null;}})[_0x56f3('0x16')](respondWithResult(_0x3076e8,null))[_0x56f3('0x24')](handleError(_0x3076e8,null));}; \ No newline at end of file +var _0xc084=['team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','omit','removeAgents','isArray','getAgents','hasOwnProperty','bluebird','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','OpenchannelQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','fields','attributes','merge','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','limit','order','sort','where','pick','OpenchannelQueueId','filter','UserOpenchannelQueue','User','UserId','agent','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','length','nolimit','addTeams','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from'];(function(_0x2170b1,_0x5c99e9){var _0x4be2c3=function(_0x790566){while(--_0x790566){_0x2170b1['push'](_0x2170b1['shift']());}};_0x4be2c3(++_0x5c99e9);}(_0xc084,0x181));var _0x4c08=function(_0x2e16b1,_0x4d60fe){_0x2e16b1=_0x2e16b1-0x0;var _0x419aca=_0xc084[_0x2e16b1];return _0x419aca;};'use strict';var BPromise=require(_0x4c08('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0x4c08('0x1'));var Redis=require(_0x4c08('0x2'));var qs=require(_0x4c08('0x3'));var logger=require('../../config/logger')(_0x4c08('0x4'));var config=require(_0x4c08('0x5'));var db=require(_0x4c08('0x6'))['db'];config['redis']=_['defaults'](config[_0x4c08('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c08('0x8'))(new Redis(config[_0x4c08('0x7')]));require(_0x4c08('0x9'))[_0x4c08('0xa')](socket);function respondWithStatusCode(_0x49b9ad,_0x46a227){_0x46a227=_0x46a227||0xcc;return function(_0x3c20ff){if(_0x3c20ff){return _0x49b9ad[_0x4c08('0xb')](_0x46a227);}return _0x49b9ad[_0x4c08('0xc')](_0x46a227)[_0x4c08('0xd')]();};}function respondWithResult(_0x40330d,_0x1fe634){_0x1fe634=_0x1fe634||0xc8;return function(_0x4ab1cc){if(_0x4ab1cc){return _0x40330d[_0x4c08('0xc')](_0x1fe634)[_0x4c08('0xe')](_0x4ab1cc);}};}function respondWithFilteredResult(_0x57f6fc,_0xf87613){return function(_0x50ae3b){if(_0x50ae3b){var _0x5f0a41=typeof _0xf87613[_0x4c08('0xf')]===_0x4c08('0x10')&&typeof _0xf87613['limit']===_0x4c08('0x10');var _0x538040=_0x50ae3b['count'];var _0x1eb7f0=_0x5f0a41?0x0:_0xf87613[_0x4c08('0xf')];var _0x51fa90=_0x5f0a41?_0x50ae3b[_0x4c08('0x11')]:_0xf87613[_0x4c08('0xf')]+_0xf87613['limit'];var _0x20ff6a;if(_0x51fa90>=_0x538040){_0x51fa90=_0x538040;_0x20ff6a=0xc8;}else{_0x20ff6a=0xce;}_0x57f6fc[_0x4c08('0xc')](_0x20ff6a);return _0x57f6fc[_0x4c08('0x12')](_0x4c08('0x13'),_0x1eb7f0+'-'+_0x51fa90+'/'+_0x538040)[_0x4c08('0xe')](_0x50ae3b);}return null;};}function saveUpdates(_0x1118b1){return function(_0x6a7c84){if(_0x6a7c84){return _0x6a7c84[_0x4c08('0x14')](_0x1118b1)['then'](function(_0x4cd850){return _0x4cd850;});}return null;};}function removeEntity(_0xbeff8e){return function(_0x5f25cc){if(_0x5f25cc){return _0x5f25cc[_0x4c08('0x15')]()[_0x4c08('0x16')](function(){var _0xcf654a=_0x5f25cc['get']({'plain':!![]});var _0x432e24='OpenchannelQueues';return db[_0x4c08('0x17')][_0x4c08('0x15')]({'where':{'type':_0x432e24,'resourceId':_0xcf654a['id']}})[_0x4c08('0x16')](function(){return _0x5f25cc;});})[_0x4c08('0x16')](function(){_0xbeff8e[_0x4c08('0xc')](0xcc)[_0x4c08('0xd')]();});}};}function handleEntityNotFound(_0x9d2d91){return function(_0x543f44){if(!_0x543f44){_0x9d2d91[_0x4c08('0xb')](0x194);}return _0x543f44;};}function handleError(_0xa16582,_0xde6c43){_0xde6c43=_0xde6c43||0x1f4;return function(_0x756e67){logger['error'](_0x756e67[_0x4c08('0x18')]);if(_0x756e67[_0x4c08('0x19')]){delete _0x756e67['name'];}_0xa16582[_0x4c08('0xc')](_0xde6c43)[_0x4c08('0x1a')](_0x756e67);};}exports[_0x4c08('0x1b')]=function(_0x273228,_0x12af18){var _0x12b5ae={};var _0x4e5f3c={'count':0x0,'rows':[]};var _0x321e25=_[_0x4c08('0x1c')](db['OpenchannelQueue'][_0x4c08('0x1d')],function(_0x1ceaf2){return{'name':_0x1ceaf2[_0x4c08('0x1e')],'type':_0x1ceaf2['type'][_0x4c08('0x1f')]};});_0x12b5ae=qs[_0x4c08('0x20')](_0x321e25,_0x273228);var _0x38d938={'where':_0x12b5ae['where']};return db[_0x4c08('0x21')]['count'](_0x38d938)['then'](function(_0x4007d7){_0x4e5f3c[_0x4c08('0x11')]=_0x4007d7;_0x12b5ae[_0x4c08('0x22')]=qs[_0x4c08('0x22')](_0x273228['query']);return db[_0x4c08('0x21')][_0x4c08('0x23')](_0x12b5ae);})['then'](function(_0x1d2039){_0x4e5f3c[_0x4c08('0x24')]=_0x1d2039;return _0x4e5f3c;})['then'](respondWithFilteredResult(_0x12af18,_0x12b5ae))[_0x4c08('0x25')](handleError(_0x12af18,null));};exports[_0x4c08('0x26')]=function(_0x3a996f,_0x5532f6){var _0x2805e4={'raw':!![],'where':{'id':_0x3a996f[_0x4c08('0x27')]['id']}},_0x1de653={};_0x1de653[_0x4c08('0x28')]=_[_0x4c08('0x29')](db[_0x4c08('0x21')]['rawAttributes']);_0x1de653['query']=_[_0x4c08('0x29')](_0x3a996f[_0x4c08('0x2a')]);_0x1de653[_0x4c08('0x2b')]=_[_0x4c08('0x2c')](_0x1de653[_0x4c08('0x28')],_0x1de653[_0x4c08('0x2a')]);_0x2805e4['attributes']=_[_0x4c08('0x2c')](_0x1de653[_0x4c08('0x28')],qs['fields'](_0x3a996f['query'][_0x4c08('0x2d')]));_0x2805e4[_0x4c08('0x2e')]=_0x2805e4['attributes']['length']?_0x2805e4[_0x4c08('0x2e')]:_0x1de653[_0x4c08('0x28')];if(_0x3a996f[_0x4c08('0x2a')]['includeAll']){_0x2805e4[_0x4c08('0x22')]=[{'all':!![]}];}_0x2805e4=_[_0x4c08('0x2f')]({},_0x2805e4,_0x3a996f[_0x4c08('0x30')]);return db[_0x4c08('0x21')]['find'](_0x2805e4)[_0x4c08('0x16')](handleEntityNotFound(_0x5532f6,null))['then'](respondWithResult(_0x5532f6,null))[_0x4c08('0x25')](handleError(_0x5532f6,null));};exports[_0x4c08('0x31')]=function(_0x503183,_0x12e06b){return db['OpenchannelQueue'][_0x4c08('0x31')](_0x503183['body'],{})['then'](function(_0x233fe2){var _0x2458bb=_0x503183['user'][_0x4c08('0x32')]({'plain':!![]});if(!_0x2458bb)throw new Error(_0x4c08('0x33'));if(_0x2458bb[_0x4c08('0x34')]===_0x4c08('0x35')){var _0x4b6cff=_0x233fe2[_0x4c08('0x32')]({'plain':!![]});var _0x1e1a33=_0x4c08('0x36');return db[_0x4c08('0x37')][_0x4c08('0x38')]({'where':{'name':_0x1e1a33,'userProfileId':_0x2458bb['userProfileId']},'raw':!![]})['then'](function(_0x222069){if(_0x222069&&_0x222069[_0x4c08('0x39')]===0x0){return db['UserProfileResource'][_0x4c08('0x31')]({'name':_0x4b6cff[_0x4c08('0x19')],'resourceId':_0x4b6cff['id'],'type':_0x222069[_0x4c08('0x19')],'sectionId':_0x222069['id']},{})['then'](function(){return _0x233fe2;});}else{return _0x233fe2;}})[_0x4c08('0x25')](function(_0x1eacf3){logger[_0x4c08('0x3a')](_0x4c08('0x3b'),_0x1eacf3);throw _0x1eacf3;});}return _0x233fe2;})['then'](respondWithResult(_0x12e06b,0xc9))[_0x4c08('0x25')](handleError(_0x12e06b,null));};exports[_0x4c08('0x14')]=function(_0x22d3ba,_0x2eb142){if(_0x22d3ba[_0x4c08('0x3c')]['id']){delete _0x22d3ba[_0x4c08('0x3c')]['id'];}return db[_0x4c08('0x21')][_0x4c08('0x38')]({'where':{'id':_0x22d3ba[_0x4c08('0x27')]['id']}})[_0x4c08('0x16')](handleEntityNotFound(_0x2eb142,null))[_0x4c08('0x16')](saveUpdates(_0x22d3ba[_0x4c08('0x3c')],null))['then'](respondWithResult(_0x2eb142,null))[_0x4c08('0x25')](handleError(_0x2eb142,null));};exports['destroy']=function(_0x3fd991,_0x1db292){return db[_0x4c08('0x21')]['find']({'where':{'id':_0x3fd991[_0x4c08('0x27')]['id']}})['then'](handleEntityNotFound(_0x1db292,null))['then'](removeEntity(_0x1db292,null))['catch'](handleError(_0x1db292,null));};exports[_0x4c08('0x3d')]=function(_0x4ad8e2,_0x544808){return db[_0x4c08('0x21')][_0x4c08('0x3d')]()[_0x4c08('0x16')](respondWithResult(_0x544808,null))[_0x4c08('0x25')](handleError(_0x544808,null));};exports[_0x4c08('0x3e')]=function(_0x160f9a,_0xdc52a0){var _0x23dd57={'raw':!![],'where':{}},_0x23fb6a={},_0x54b337;return db['OpenchannelQueue'][_0x4c08('0x3f')]({'where':{'id':_0x160f9a[_0x4c08('0x27')]['id']}})['then'](handleEntityNotFound(_0xdc52a0,null))[_0x4c08('0x16')](function(_0x2f568f){if(_0x2f568f){_0x54b337=_0x2f568f[_0x4c08('0x32')]({'plain':!![]});_0x23fb6a[_0x4c08('0x28')]=_[_0x4c08('0x29')](db['UserOpenchannelQueue'][_0x4c08('0x1d')]);_0x23fb6a[_0x4c08('0x2a')]=_[_0x4c08('0x29')](_0x160f9a[_0x4c08('0x2a')]);_0x23fb6a[_0x4c08('0x2b')]=_[_0x4c08('0x2c')](_0x23fb6a['model'],_0x23fb6a[_0x4c08('0x2a')]);_0x23dd57[_0x4c08('0x2e')]=_[_0x4c08('0x2c')](_0x23fb6a[_0x4c08('0x28')],qs['fields'](_0x160f9a['query']['fields']));_0x23dd57[_0x4c08('0x2e')]=_0x23dd57[_0x4c08('0x2e')]['length']?_0x23dd57[_0x4c08('0x2e')]:_0x23fb6a[_0x4c08('0x28')];if(!_0x160f9a[_0x4c08('0x2a')]['hasOwnProperty']('nolimit')){_0x23dd57[_0x4c08('0x40')]=qs['limit'](_0x160f9a[_0x4c08('0x2a')][_0x4c08('0x40')]);_0x23dd57['offset']=qs[_0x4c08('0xf')](_0x160f9a['query'][_0x4c08('0xf')]);}_0x23dd57[_0x4c08('0x41')]=qs[_0x4c08('0x42')](_0x160f9a['query'][_0x4c08('0x42')]);_0x23dd57[_0x4c08('0x43')]=qs[_0x4c08('0x2b')](_[_0x4c08('0x44')](_0x160f9a['query'],_0x23fb6a['filters']));_0x23dd57[_0x4c08('0x43')][_0x4c08('0x45')]=_0x2f568f['id'];if(_0x160f9a['query']['filter']){_0x23dd57[_0x4c08('0x43')]=_[_0x4c08('0x2f')](_0x23dd57[_0x4c08('0x43')],{'$or':_['map'](_0x23dd57[_0x4c08('0x2e')],function(_0x3b62b7){var _0x431e93={};_0x431e93[_0x3b62b7]={'$like':'%'+_0x160f9a['query'][_0x4c08('0x46')]+'%'};return _0x431e93;})});}_0x23dd57=_[_0x4c08('0x2f')]({},_0x23dd57,_0x160f9a[_0x4c08('0x30')]);return db[_0x4c08('0x47')][_0x4c08('0x23')](_0x23dd57);}})['then'](function(_0x5ee1a8){if(_0x5ee1a8){return db[_0x4c08('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x5ee1a8,_0x4c08('0x49')),'role':_0x4c08('0x4a')},'attributes':['id','name',_0x4c08('0x4b'),'updatedAt',_0x4c08('0x4c')]});}})[_0x4c08('0x16')](function(_0x3c1010){if(_0x3c1010){return{'count':_0x3c1010[_0x4c08('0x11')],'rows':_[_0x4c08('0x1c')](_0x3c1010['rows'],function(_0x41f758){return{'membername':_0x41f758[_0x4c08('0x19')],'UserId':_0x41f758['id'],'queue_name':_0x54b337[_0x4c08('0x19')],'OpenchannelQueueId':_0x54b337['id'],'interface':util['format'](_0x4c08('0x4d'),_0x4c08('0x4e'),_0x41f758[_0x4c08('0x19')]),'penalty':0x0,'paused':_0x41f758[_0x4c08('0x4b')],'createdAt':_0x41f758[_0x4c08('0x4c')],'updatedAt':_0x41f758[_0x4c08('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4c08('0x16')](respondWithFilteredResult(_0xdc52a0,_0x23dd57))[_0x4c08('0x25')](handleError(_0xdc52a0,null));};exports[_0x4c08('0x50')]=function(_0x4b1d25,_0x325f32){var _0x391992={};var _0x5b1c50={};var _0x4f3cc9;var _0x510a8b;return db[_0x4c08('0x21')]['findOne']({'where':{'id':_0x4b1d25[_0x4c08('0x27')]['id']}})[_0x4c08('0x16')](handleEntityNotFound(_0x325f32,null))[_0x4c08('0x16')](function(_0x4fe07f){if(_0x4fe07f){_0x4f3cc9=_0x4fe07f;_0x5b1c50[_0x4c08('0x28')]=_[_0x4c08('0x29')](db[_0x4c08('0x51')][_0x4c08('0x1d')]);_0x5b1c50[_0x4c08('0x2a')]=_[_0x4c08('0x29')](_0x4b1d25[_0x4c08('0x2a')]);_0x5b1c50['filters']=_[_0x4c08('0x2c')](_0x5b1c50[_0x4c08('0x28')],_0x5b1c50[_0x4c08('0x2a')]);_0x391992['attributes']=_[_0x4c08('0x2c')](_0x5b1c50['model'],qs[_0x4c08('0x2d')](_0x4b1d25[_0x4c08('0x2a')][_0x4c08('0x2d')]));_0x391992[_0x4c08('0x2e')]=_0x391992[_0x4c08('0x2e')][_0x4c08('0x52')]?_0x391992[_0x4c08('0x2e')]:_0x5b1c50[_0x4c08('0x28')];_0x391992[_0x4c08('0x41')]=qs['sort'](_0x4b1d25[_0x4c08('0x2a')]['sort']);_0x391992[_0x4c08('0x43')]=qs['filters'](_[_0x4c08('0x44')](_0x4b1d25[_0x4c08('0x2a')],_0x5b1c50['filters']));if(_0x4b1d25['query'][_0x4c08('0x46')]){_0x391992[_0x4c08('0x43')]=_['merge'](_0x391992['where'],{'$or':_[_0x4c08('0x1c')](_0x391992[_0x4c08('0x2e')],function(_0x57302d){var _0x108c5f={};_0x108c5f[_0x57302d]={'$like':'%'+_0x4b1d25[_0x4c08('0x2a')]['filter']+'%'};return _0x108c5f;})});}_0x391992=_[_0x4c08('0x2f')]({},_0x391992,_0x4b1d25[_0x4c08('0x30')]);return _0x4f3cc9[_0x4c08('0x50')](_0x391992);}})['then'](function(_0x1c0cfe){if(_0x1c0cfe){_0x510a8b=_0x1c0cfe[_0x4c08('0x52')];if(!_0x4b1d25[_0x4c08('0x2a')]['hasOwnProperty'](_0x4c08('0x53'))){_0x391992['limit']=qs['limit'](_0x4b1d25[_0x4c08('0x2a')]['limit']);_0x391992[_0x4c08('0xf')]=qs[_0x4c08('0xf')](_0x4b1d25['query'][_0x4c08('0xf')]);}return _0x4f3cc9['getTeams'](_0x391992);}})[_0x4c08('0x16')](function(_0x416333){if(_0x416333){return _0x416333?{'count':_0x510a8b,'rows':_0x416333}:null;}})[_0x4c08('0x16')](respondWithResult(_0x325f32,null))['catch'](handleError(_0x325f32,null));};exports[_0x4c08('0x54')]=function(_0x3c966b,_0x2e4972){var _0x14be71=_0x3c966b[_0x4c08('0x3c')][_0x4c08('0x55')];return db['Team'][_0x4c08('0x23')]({'where':{'id':_0x14be71},'attributes':['id'],'include':[{'model':db[_0x4c08('0x48')],'as':_0x4c08('0x56'),'attributes':['id',_0x4c08('0x19'),_0x4c08('0x57'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0xd1123a){if(_0xd1123a){var _0x3e5e88=_[_0x4c08('0x58')](_0xd1123a,function(_0x2f9217){var _0x274fa5=_0x2f9217[_0x4c08('0x32')]({'plain':!![]});return _0x274fa5[_0x4c08('0x56')];});return db[_0x4c08('0x21')]['find']({'where':{'id':_0x3c966b[_0x4c08('0x27')]['id']}})[_0x4c08('0x16')](function(_0x55b9c8){return db[_0x4c08('0x59')][_0x4c08('0x5a')](function(_0x172a85){return _0x55b9c8[_0x4c08('0x54')](_0x14be71,{'transaction':_0x172a85})[_0x4c08('0x16')](function(){return BPromise['each'](_0x3e5e88,function(_0x1b8b33){return db[_0x4c08('0x47')][_0x4c08('0x5b')]({'where':{'UserId':_0x1b8b33['id'],'OpenchannelQueueId':_0x3c966b[_0x4c08('0x27')]['id']},'transaction':_0x172a85});});})[_0x4c08('0x16')](function(){_0x3e5e88[_0x4c08('0x5c')](function(_0x333aa7){socket[_0x4c08('0x5d')](_0x4c08('0x5e'),{'UserId':_0x333aa7['id'],'OpenchannelQueueId':_0x55b9c8['id']});});});});});}})['then'](respondWithStatusCode(_0x2e4972,null))['catch'](handleError(_0x2e4972,null));};exports[_0x4c08('0x5f')]=function(_0x590f89,_0x494ab9){return db['Team']['findAll']({'where':{'id':_0x590f89['query'][_0x4c08('0x55')]},'attributes':['id'],'include':[{'model':db[_0x4c08('0x48')],'as':_0x4c08('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x494ab9,null))['then'](function(_0x422718){var _0x36474b=_[_0x4c08('0x1c')](_0x422718,'id');var _0x5ffd2e=[];var _0x8beec7=[];var _0x49bc9d=squel[_0x4c08('0x60')]();_0x49bc9d['field'](_0x4c08('0x61'))[_0x4c08('0x62')](_0x4c08('0x63'),'tq')[_0x4c08('0x64')](_0x4c08('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4c08('0x43')](_0x4c08('0x66'),_0x590f89[_0x4c08('0x27')]['id']);for(var _0x3249f5=0x0;_0x3249f5<_0x422718[_0x4c08('0x52')];_0x3249f5+=0x1){let _0x7531fc=_0x422718[_0x3249f5];for(var _0xbc89b8=0x0;_0xbc89b8<_0x7531fc[_0x4c08('0x56')][_0x4c08('0x52')];_0xbc89b8+=0x1){let _0x86099b=_0x7531fc[_0x4c08('0x56')][_0xbc89b8];var _0x17ecf2=_0x49bc9d['clone']();_0x17ecf2[_0x4c08('0x43')](_0x4c08('0x67'),_0x86099b['id']);_0x8beec7[_0x4c08('0x68')](db['sequelize'][_0x4c08('0x2a')](_0x17ecf2[_0x4c08('0x69')](),{'type':db[_0x4c08('0x59')][_0x4c08('0x6a')]['SELECT']})[_0x4c08('0x16')](function(_0x2f547d){if(_0x2f547d[_0x4c08('0x52')]===0x1){return _0x86099b['id'];}else{var _0x2283eb=_[_0x4c08('0x6b')](_[_0x4c08('0x1c')](_0x2f547d,_0x4c08('0x6c')),function(_0x46bca5){return _[_0x4c08('0x6d')](_0x36474b,_0x46bca5);});if(_0x2283eb){return _0x86099b['id'];}}}));}}return BPromise[_0x4c08('0x6e')](_0x8beec7)[_0x4c08('0x16')](function(_0x4b38d5){_0x5ffd2e=_(_0x5ffd2e)[_0x4c08('0x6f')](_0x4b38d5)[_0x4c08('0x70')]()[_0x4c08('0x71')]();return db['OpenchannelQueue'][_0x4c08('0x38')]({'where':{'id':_0x590f89[_0x4c08('0x27')]['id']}})['then'](function(_0x1a029e){return db['sequelize'][_0x4c08('0x5a')](function(_0x92e364){return _0x1a029e['removeTeams'](_0x590f89['query']['ids'],{'transaction':_0x92e364})[_0x4c08('0x16')](function(){if(!_[_0x4c08('0x72')](_0x5ffd2e)){return _0x1a029e['removeAgents'](_0x5ffd2e,{'transaction':_0x92e364});}})['then'](function(){_0x5ffd2e[_0x4c08('0x5c')](function(_0x16cae4){socket[_0x4c08('0x5d')](_0x4c08('0x73'),{'UserId':_0x16cae4,'OpenchannelQueueId':_0x1a029e['id']});});});});});});})['then'](respondWithStatusCode(_0x494ab9,null))[_0x4c08('0x25')](handleError(_0x494ab9,null));};exports['addAgents']=function(_0x264e98,_0x2c81a5){return db[_0x4c08('0x21')][_0x4c08('0x38')]({'where':{'id':_0x264e98[_0x4c08('0x27')]['id']}})[_0x4c08('0x16')](handleEntityNotFound(_0x2c81a5,null))[_0x4c08('0x16')](function(_0x2fa727){if(_0x2fa727){return _0x2fa727['addAgents'](_0x264e98[_0x4c08('0x3c')][_0x4c08('0x55')],_[_0x4c08('0x74')](_0x264e98[_0x4c08('0x3c')],[_0x4c08('0x55'),'id'])||{})['spread'](function(_0x303fc0){for(var _0x4854ea=0x0;_0x4854ea<_0x264e98[_0x4c08('0x3c')][_0x4c08('0x55')]['length'];_0x4854ea+=0x1){socket[_0x4c08('0x5d')](_0x4c08('0x5e'),{'UserId':Number(_0x264e98[_0x4c08('0x3c')][_0x4c08('0x55')][_0x4854ea]),'OpenchannelQueueId':Number(_0x264e98[_0x4c08('0x27')]['id'])});}return _0x303fc0;});}})['then'](respondWithResult(_0x2c81a5,null))[_0x4c08('0x25')](handleError(_0x2c81a5,null));};exports[_0x4c08('0x75')]=function(_0x5d78c5,_0x5226fa){return db[_0x4c08('0x21')]['find']({'where':{'id':_0x5d78c5[_0x4c08('0x27')]['id']}})['then'](handleEntityNotFound(_0x5226fa,null))['then'](function(_0x12b594){if(_0x12b594){return _0x12b594[_0x4c08('0x75')](_0x5d78c5[_0x4c08('0x2a')][_0x4c08('0x55')])[_0x4c08('0x16')](function(){if(_[_0x4c08('0x76')](_0x5d78c5[_0x4c08('0x2a')][_0x4c08('0x55')])){for(var _0x487fbe=0x0;_0x487fbe<_0x5d78c5[_0x4c08('0x2a')]['ids'][_0x4c08('0x52')];_0x487fbe+=0x1){socket['emit'](_0x4c08('0x73'),{'UserId':Number(_0x5d78c5[_0x4c08('0x2a')]['ids'][_0x487fbe]),'OpenchannelQueueId':Number(_0x5d78c5[_0x4c08('0x27')]['id'])});}}else{socket[_0x4c08('0x5d')](_0x4c08('0x73'),{'UserId':Number(_0x5d78c5[_0x4c08('0x2a')][_0x4c08('0x55')]),'OpenchannelQueueId':Number(_0x5d78c5[_0x4c08('0x27')]['id'])});}});}})[_0x4c08('0x16')](respondWithStatusCode(_0x5226fa,null))[_0x4c08('0x25')](handleError(_0x5226fa,null));};exports['getAgents']=function(_0x21e5c7,_0x4c4b49){var _0x578c48={};var _0x27f5fd={};var _0x3e1b55;var _0x155290;return db['OpenchannelQueue'][_0x4c08('0x3f')]({'where':{'id':_0x21e5c7[_0x4c08('0x27')]['id']}})['then'](handleEntityNotFound(_0x4c4b49,null))[_0x4c08('0x16')](function(_0x5965ae){if(_0x5965ae){_0x3e1b55=_0x5965ae;_0x27f5fd[_0x4c08('0x28')]=_[_0x4c08('0x29')](db['User']['rawAttributes']);_0x27f5fd[_0x4c08('0x2a')]=_[_0x4c08('0x29')](_0x21e5c7[_0x4c08('0x2a')]);_0x27f5fd[_0x4c08('0x2b')]=_[_0x4c08('0x2c')](_0x27f5fd['model'],_0x27f5fd[_0x4c08('0x2a')]);_0x578c48['attributes']=_[_0x4c08('0x2c')](_0x27f5fd[_0x4c08('0x28')],qs[_0x4c08('0x2d')](_0x21e5c7['query'][_0x4c08('0x2d')]));_0x578c48[_0x4c08('0x2e')]=_0x578c48[_0x4c08('0x2e')][_0x4c08('0x52')]?_0x578c48[_0x4c08('0x2e')]:_0x27f5fd[_0x4c08('0x28')];_0x578c48[_0x4c08('0x41')]=qs[_0x4c08('0x42')](_0x21e5c7['query'][_0x4c08('0x42')]);_0x578c48[_0x4c08('0x43')]=qs['filters'](_[_0x4c08('0x44')](_0x21e5c7[_0x4c08('0x2a')],_0x27f5fd[_0x4c08('0x2b')]));if(_0x21e5c7[_0x4c08('0x2a')][_0x4c08('0x46')]){_0x578c48[_0x4c08('0x43')]=_[_0x4c08('0x2f')](_0x578c48[_0x4c08('0x43')],{'$or':_[_0x4c08('0x1c')](_0x578c48[_0x4c08('0x2e')],function(_0x45b480){var _0x24287f={};_0x24287f[_0x45b480]={'$like':'%'+_0x21e5c7[_0x4c08('0x2a')]['filter']+'%'};return _0x24287f;})});}_0x578c48=_[_0x4c08('0x2f')]({},_0x578c48,_0x21e5c7[_0x4c08('0x30')]);return _0x3e1b55[_0x4c08('0x77')](_0x578c48);}})[_0x4c08('0x16')](function(_0x3377ba){if(_0x3377ba){_0x155290=_0x3377ba[_0x4c08('0x52')];if(!_0x21e5c7[_0x4c08('0x2a')][_0x4c08('0x78')](_0x4c08('0x53'))){_0x578c48[_0x4c08('0x40')]=qs[_0x4c08('0x40')](_0x21e5c7[_0x4c08('0x2a')][_0x4c08('0x40')]);_0x578c48[_0x4c08('0xf')]=qs[_0x4c08('0xf')](_0x21e5c7[_0x4c08('0x2a')][_0x4c08('0xf')]);}return _0x3e1b55[_0x4c08('0x77')](_0x578c48);}})[_0x4c08('0x16')](function(_0x290f99){if(_0x290f99){return _0x290f99?{'count':_0x155290,'rows':_0x290f99}:null;}})[_0x4c08('0x16')](respondWithResult(_0x4c4b49,null))[_0x4c08('0x25')](handleError(_0x4c4b49,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4d63dc0..51e03d1 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 _0x98ef=['save','update','remove','emit','hook','../../mysqldb','OpenchannelQueue'];(function(_0x297160,_0x82adb3){var _0x2f7717=function(_0x484a8e){while(--_0x484a8e){_0x297160['push'](_0x297160['shift']());}};_0x2f7717(++_0x82adb3);}(_0x98ef,0x11d));var _0xf98e=function(_0x1f2da8,_0x10b850){_0x1f2da8=_0x1f2da8-0x0;var _0x559ddc=_0x98ef[_0x1f2da8];return _0x559ddc;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xf98e('0x0'))['db'][_0xf98e('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf98e('0x2'),'afterUpdate':_0xf98e('0x3'),'afterDestroy':_0xf98e('0x4')};function emitEvent(_0xeb3bf0){return function(_0x2ef67e,_0x41c147,_0x4813ca){OpenchannelQueueEvents[_0xf98e('0x5')](_0xeb3bf0+':'+_0x2ef67e['id'],_0x2ef67e);OpenchannelQueueEvents[_0xf98e('0x5')](_0xeb3bf0,_0x2ef67e);_0x4813ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xf98e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x3299=['hook','exports','events','../../mysqldb','OpenchannelQueue','save','update','emit','hasOwnProperty'];(function(_0x39de39,_0xc93702){var _0x5137a2=function(_0x3cf31e){while(--_0x3cf31e){_0x39de39['push'](_0x39de39['shift']());}};_0x5137a2(++_0xc93702);}(_0x3299,0x18e));var _0x9329=function(_0x196548,_0x2bc492){_0x196548=_0x196548-0x0;var _0x47e2d2=_0x3299[_0x196548];return _0x47e2d2;};'use strict';var EventEmitter=require(_0x9329('0x0'));var OpenchannelQueue=require(_0x9329('0x1'))['db'][_0x9329('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9329('0x3'),'afterUpdate':_0x9329('0x4'),'afterDestroy':'remove'};function emitEvent(_0x578db9){return function(_0x349cf0,_0x306292,_0x463ac8){OpenchannelQueueEvents[_0x9329('0x5')](_0x578db9+':'+_0x349cf0['id'],_0x349cf0);OpenchannelQueueEvents['emit'](_0x578db9,_0x349cf0);_0x463ac8(null);};}for(var e in events){if(events[_0x9329('0x6')](e)){var event=events[e];OpenchannelQueue[_0x9329('0x7')](e,emitEvent(event));}}module[_0x9329('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 5af986c..6531ba0 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 _0x2673=['exports','define','OpenchannelQueue','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelQueue.attributes'];(function(_0x393064,_0x72d92){var _0x5c30af=function(_0x1952f6){while(--_0x1952f6){_0x393064['push'](_0x393064['shift']());}};_0x5c30af(++_0x72d92);}(_0x2673,0x12f));var _0x3267=function(_0x15da5f,_0x3fce0e){_0x15da5f=_0x15da5f-0x0;var _0x1992f1=_0x2673[_0x15da5f];return _0x1992f1;};'use strict';var _=require(_0x3267('0x0'));var util=require('util');var logger=require(_0x3267('0x1'))(_0x3267('0x2'));var moment=require(_0x3267('0x3'));var BPromise=require(_0x3267('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3267('0x5'));var attributes=require(_0x3267('0x6'));module[_0x3267('0x7')]=function(_0x412d03,_0x1817ff){return _0x412d03[_0x3267('0x8')](_0x3267('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55af=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_queues','util'];(function(_0x3cf8f1,_0x5d3d4d){var _0x260bb2=function(_0x429791){while(--_0x429791){_0x3cf8f1['push'](_0x3cf8f1['shift']());}};_0x260bb2(++_0x5d3d4d);}(_0x55af,0xb3));var _0xf55a=function(_0xefec37,_0xdd679){_0xefec37=_0xefec37-0x0;var _0x5a6c6d=_0x55af[_0xefec37];return _0x5a6c6d;};'use strict';var _=require('lodash');var util=require(_0xf55a('0x0'));var logger=require(_0xf55a('0x1'))(_0xf55a('0x2'));var moment=require(_0xf55a('0x3'));var BPromise=require(_0xf55a('0x4'));var rp=require(_0xf55a('0x5'));var fs=require('fs');var path=require(_0xf55a('0x6'));var rimraf=require(_0xf55a('0x7'));var config=require(_0xf55a('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xf55a('0x9')]=function(_0x5c66e4,_0x261526){return _0x5c66e4[_0xf55a('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xf55a('0xb'),'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 25e4ef4..61e0c95 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 _0x72e7=['findAll','options','raw','limit','include','map','model','attributes','find','where','ShowOpenchannelQueue','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0x72e7,0x1e0));var _0x772e=function(_0x4fa8da,_0x50a548){_0x4fa8da=_0x4fa8da-0x0;var _0x4965d0=_0x72e7[_0x4fa8da];return _0x4965d0;};'use strict';var _=require(_0x772e('0x0'));var util=require(_0x772e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x772e('0x2'));var fs=require('fs');var Redis=require(_0x772e('0x3'));var db=require(_0x772e('0x4'))['db'];var utils=require(_0x772e('0x5'));var logger=require(_0x772e('0x6'))('rpc');var config=require(_0x772e('0x7'));var jayson=require(_0x772e('0x8'));var client=jayson['client'][_0x772e('0x9')]({'port':0x232a});config[_0x772e('0xa')]=_[_0x772e('0xb')](config[_0x772e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x772e('0xa')]));require(_0x772e('0xc'))[_0x772e('0xd')](socket);function respondWithRpcPromise(_0x2a7e59,_0x2ac9a9,_0x290175){return new BPromise(function(_0x2b24cf,_0xeceb1c){return client['request'](_0x2a7e59,_0x290175)[_0x772e('0xe')](function(_0x10f2fc){logger['info'](_0x772e('0xf'),_0x2ac9a9,_0x772e('0x10'));logger[_0x772e('0x11')](_0x772e('0x12'),_0x2ac9a9,_0x772e('0x10'),JSON['stringify'](_0x10f2fc));if(_0x10f2fc[_0x772e('0x13')]){if(_0x10f2fc[_0x772e('0x13')][_0x772e('0x14')]===0x1f4){logger[_0x772e('0x13')](_0x772e('0xf'),_0x2ac9a9,_0x10f2fc[_0x772e('0x13')]['message']);return _0xeceb1c(_0x10f2fc[_0x772e('0x13')][_0x772e('0x15')]);}logger['error'](_0x772e('0xf'),_0x2ac9a9,_0x10f2fc[_0x772e('0x13')][_0x772e('0x15')]);return _0x2b24cf(_0x10f2fc[_0x772e('0x13')][_0x772e('0x15')]);}else{logger[_0x772e('0x16')](_0x772e('0xf'),_0x2ac9a9,_0x772e('0x10'));_0x2b24cf(_0x10f2fc[_0x772e('0x17')][_0x772e('0x15')]);}})[_0x772e('0x18')](function(_0xc55e89){logger[_0x772e('0x13')](_0x772e('0xf'),_0x2ac9a9,_0xc55e89);_0xeceb1c(_0xc55e89);});});}exports[_0x772e('0x19')]=function(_0x3b095a){var _0x516cc2=this;return new Promise(function(_0x397940,_0x18f4e8){return db[_0x772e('0x1a')][_0x772e('0x1b')]({'raw':_0x3b095a[_0x772e('0x1c')]?_0x3b095a[_0x772e('0x1c')][_0x772e('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b095a[_0x772e('0x1c')]?_0x3b095a[_0x772e('0x1c')]['where']||null:null,'attributes':_0x3b095a[_0x772e('0x1c')]?_0x3b095a[_0x772e('0x1c')]['attributes']||null:null,'limit':_0x3b095a['options']?_0x3b095a[_0x772e('0x1c')][_0x772e('0x1e')]||null:null,'include':_0x3b095a[_0x772e('0x1c')]?_0x3b095a[_0x772e('0x1c')][_0x772e('0x1f')]?_[_0x772e('0x20')](_0x3b095a[_0x772e('0x1c')][_0x772e('0x1f')],function(_0x292a2f){return{'model':db[_0x292a2f[_0x772e('0x21')]],'as':_0x292a2f['as'],'attributes':_0x292a2f[_0x772e('0x22')],'include':_0x292a2f['include']?_[_0x772e('0x20')](_0x292a2f[_0x772e('0x1f')],function(_0x4d5aef){return{'model':db[_0x4d5aef[_0x772e('0x21')]],'as':_0x4d5aef['as'],'attributes':_0x4d5aef['attributes'],'include':_0x4d5aef[_0x772e('0x1f')]?_[_0x772e('0x20')](_0x4d5aef[_0x772e('0x1f')],function(_0xe5f4b1){return{'model':db[_0xe5f4b1[_0x772e('0x21')]],'as':_0xe5f4b1['as'],'attributes':_0xe5f4b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x772e('0xe')](function(_0x1e627f){logger[_0x772e('0x16')](_0x772e('0x19'),_0x3b095a);logger['debug']('GetOpenchannelQueue',_0x3b095a,JSON['stringify'](_0x1e627f));_0x397940(_0x1e627f);})[_0x772e('0x18')](function(_0x2d15f5){logger['error'](_0x772e('0x19'),_0x2d15f5[_0x772e('0x15')],_0x3b095a);_0x18f4e8(_0x516cc2[_0x772e('0x13')](0x1f4,_0x2d15f5[_0x772e('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x2b55cd){var _0x5fa5dc=this;return new Promise(function(_0x4fa7ff,_0x4c6225){return db['OpenchannelQueue'][_0x772e('0x23')]({'raw':_0x2b55cd[_0x772e('0x1c')]?_0x2b55cd['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b55cd[_0x772e('0x1c')]?_0x2b55cd[_0x772e('0x1c')][_0x772e('0x24')]||null:null,'attributes':_0x2b55cd['options']?_0x2b55cd['options'][_0x772e('0x22')]||null:null,'include':_0x2b55cd[_0x772e('0x1c')]?_0x2b55cd[_0x772e('0x1c')]['include']?_[_0x772e('0x20')](_0x2b55cd[_0x772e('0x1c')][_0x772e('0x1f')],function(_0x81fcc9){return{'model':db[_0x81fcc9[_0x772e('0x21')]],'as':_0x81fcc9['as'],'attributes':_0x81fcc9[_0x772e('0x22')],'include':_0x81fcc9[_0x772e('0x1f')]?_[_0x772e('0x20')](_0x81fcc9[_0x772e('0x1f')],function(_0x8f534b){return{'model':db[_0x8f534b[_0x772e('0x21')]],'as':_0x8f534b['as'],'attributes':_0x8f534b[_0x772e('0x22')],'include':_0x8f534b[_0x772e('0x1f')]?_[_0x772e('0x20')](_0x8f534b[_0x772e('0x1f')],function(_0x5a94c0){return{'model':db[_0x5a94c0[_0x772e('0x21')]],'as':_0x5a94c0['as'],'attributes':_0x5a94c0[_0x772e('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x352698){logger[_0x772e('0x16')](_0x772e('0x25'),_0x2b55cd);logger[_0x772e('0x11')](_0x772e('0x25'),_0x2b55cd,JSON[_0x772e('0x26')](_0x352698));_0x4fa7ff(_0x352698);})[_0x772e('0x18')](function(_0x55fbde){logger[_0x772e('0x13')](_0x772e('0x25'),_0x55fbde[_0x772e('0x15')],_0x2b55cd);_0x4c6225(_0x5fa5dc['error'](0x1f4,_0x55fbde[_0x772e('0x15')]));});});}; \ No newline at end of file +var _0xea1d=['OpenchannelQueue,\x20%s,\x20%s','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c1784,_0x5e3ad5){var _0x356e09=function(_0x43edd3){while(--_0x43edd3){_0x1c1784['push'](_0x1c1784['shift']());}};_0x356e09(++_0x5e3ad5);}(_0xea1d,0x145));var _0xdea1=function(_0xaa821e,_0x547d14){_0xaa821e=_0xaa821e-0x0;var _0x5bb85b=_0xea1d[_0xaa821e];return _0x5bb85b;};'use strict';var _=require(_0xdea1('0x0'));var util=require(_0xdea1('0x1'));var moment=require(_0xdea1('0x2'));var BPromise=require('bluebird');var rs=require(_0xdea1('0x3'));var fs=require('fs');var Redis=require(_0xdea1('0x4'));var db=require(_0xdea1('0x5'))['db'];var utils=require(_0xdea1('0x6'));var logger=require('../../config/logger')(_0xdea1('0x7'));var config=require(_0xdea1('0x8'));var jayson=require(_0xdea1('0x9'));var client=jayson[_0xdea1('0xa')][_0xdea1('0xb')]({'port':0x232a});config[_0xdea1('0xc')]=_[_0xdea1('0xd')](config[_0xdea1('0xc')],{'host':_0xdea1('0xe'),'port':0x18eb});var socket=require(_0xdea1('0xf'))(new Redis(config[_0xdea1('0xc')]));require(_0xdea1('0x10'))[_0xdea1('0x11')](socket);function respondWithRpcPromise(_0x5f79fe,_0x22b8e8,_0x130b53){return new BPromise(function(_0x1519ee,_0x5f28b4){return client[_0xdea1('0x12')](_0x5f79fe,_0x130b53)['then'](function(_0x4bcf92){logger[_0xdea1('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x22b8e8,_0xdea1('0x14'));logger[_0xdea1('0x15')](_0xdea1('0x16'),_0x22b8e8,_0xdea1('0x14'),JSON[_0xdea1('0x17')](_0x4bcf92));if(_0x4bcf92['error']){if(_0x4bcf92[_0xdea1('0x18')][_0xdea1('0x19')]===0x1f4){logger[_0xdea1('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x22b8e8,_0x4bcf92[_0xdea1('0x18')][_0xdea1('0x1a')]);return _0x5f28b4(_0x4bcf92['error']['message']);}logger[_0xdea1('0x18')](_0xdea1('0x1b'),_0x22b8e8,_0x4bcf92[_0xdea1('0x18')][_0xdea1('0x1a')]);return _0x1519ee(_0x4bcf92[_0xdea1('0x18')]['message']);}else{logger[_0xdea1('0x13')](_0xdea1('0x1b'),_0x22b8e8,_0xdea1('0x14'));_0x1519ee(_0x4bcf92[_0xdea1('0x1c')][_0xdea1('0x1a')]);}})[_0xdea1('0x1d')](function(_0x128d8e){logger[_0xdea1('0x18')](_0xdea1('0x1b'),_0x22b8e8,_0x128d8e);_0x5f28b4(_0x128d8e);});});}exports[_0xdea1('0x1e')]=function(_0x506a79){var _0x59618c=this;return new Promise(function(_0x36dcea,_0x16a8ce){return db[_0xdea1('0x1f')][_0xdea1('0x20')]({'raw':_0x506a79[_0xdea1('0x21')]?_0x506a79[_0xdea1('0x21')][_0xdea1('0x22')]===undefined?!![]:![]:!![],'where':_0x506a79[_0xdea1('0x21')]?_0x506a79[_0xdea1('0x21')][_0xdea1('0x23')]||null:null,'attributes':_0x506a79[_0xdea1('0x21')]?_0x506a79[_0xdea1('0x21')][_0xdea1('0x24')]||null:null,'limit':_0x506a79['options']?_0x506a79['options'][_0xdea1('0x25')]||null:null,'include':_0x506a79[_0xdea1('0x21')]?_0x506a79[_0xdea1('0x21')]['include']?_[_0xdea1('0x26')](_0x506a79[_0xdea1('0x21')][_0xdea1('0x27')],function(_0x127d9f){return{'model':db[_0x127d9f[_0xdea1('0x28')]],'as':_0x127d9f['as'],'attributes':_0x127d9f['attributes'],'include':_0x127d9f[_0xdea1('0x27')]?_['map'](_0x127d9f[_0xdea1('0x27')],function(_0x24156c){return{'model':db[_0x24156c[_0xdea1('0x28')]],'as':_0x24156c['as'],'attributes':_0x24156c['attributes'],'include':_0x24156c[_0xdea1('0x27')]?_['map'](_0x24156c['include'],function(_0x481915){return{'model':db[_0x481915[_0xdea1('0x28')]],'as':_0x481915['as'],'attributes':_0x481915['attributes']};}):[]};}):[]};}):[]:[]})[_0xdea1('0x29')](function(_0x1fb9ab){logger[_0xdea1('0x13')](_0xdea1('0x1e'),_0x506a79);logger[_0xdea1('0x15')](_0xdea1('0x1e'),_0x506a79,JSON[_0xdea1('0x17')](_0x1fb9ab));_0x36dcea(_0x1fb9ab);})[_0xdea1('0x1d')](function(_0x4b4cd6){logger[_0xdea1('0x18')]('GetOpenchannelQueue',_0x4b4cd6['message'],_0x506a79);_0x16a8ce(_0x59618c[_0xdea1('0x18')](0x1f4,_0x4b4cd6[_0xdea1('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x48d401){var _0x177d1d=this;return new Promise(function(_0xdf0994,_0x498b7e){return db[_0xdea1('0x1f')][_0xdea1('0x2a')]({'raw':_0x48d401[_0xdea1('0x21')]?_0x48d401[_0xdea1('0x21')][_0xdea1('0x22')]===undefined?!![]:![]:!![],'where':_0x48d401[_0xdea1('0x21')]?_0x48d401[_0xdea1('0x21')][_0xdea1('0x23')]||null:null,'attributes':_0x48d401[_0xdea1('0x21')]?_0x48d401[_0xdea1('0x21')]['attributes']||null:null,'include':_0x48d401[_0xdea1('0x21')]?_0x48d401[_0xdea1('0x21')][_0xdea1('0x27')]?_[_0xdea1('0x26')](_0x48d401['options'][_0xdea1('0x27')],function(_0x3b33f6){return{'model':db[_0x3b33f6[_0xdea1('0x28')]],'as':_0x3b33f6['as'],'attributes':_0x3b33f6[_0xdea1('0x24')],'include':_0x3b33f6[_0xdea1('0x27')]?_[_0xdea1('0x26')](_0x3b33f6[_0xdea1('0x27')],function(_0x41b194){return{'model':db[_0x41b194[_0xdea1('0x28')]],'as':_0x41b194['as'],'attributes':_0x41b194[_0xdea1('0x24')],'include':_0x41b194[_0xdea1('0x27')]?_['map'](_0x41b194[_0xdea1('0x27')],function(_0x43c65d){return{'model':db[_0x43c65d[_0xdea1('0x28')]],'as':_0x43c65d['as'],'attributes':_0x43c65d[_0xdea1('0x24')]};}):[]};}):[]};}):[]:[]})[_0xdea1('0x29')](function(_0x3592af){logger[_0xdea1('0x13')]('ShowOpenchannelQueue',_0x48d401);logger[_0xdea1('0x15')]('ShowOpenchannelQueue',_0x48d401,JSON['stringify'](_0x3592af));_0xdf0994(_0x3592af);})['catch'](function(_0x489f10){logger[_0xdea1('0x18')](_0xdea1('0x2b'),_0x489f10[_0xdea1('0x1a')],_0x48d401);_0x498b7e(_0x177d1d[_0xdea1('0x18')](0x1f4,_0x489f10[_0xdea1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cb4b046..0446706 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 _0x587d=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit'];(function(_0x138064,_0x438903){var _0x4dc0d6=function(_0x4ed311){while(--_0x4ed311){_0x138064['push'](_0x138064['shift']());}};_0x4dc0d6(++_0x438903);}(_0x587d,0x134));var _0xd587=function(_0x15c236,_0x1328ce){_0x15c236=_0x15c236-0x0;var _0x234900=_0x587d[_0x15c236];return _0x234900;};'use strict';var OpenchannelQueueEvents=require(_0xd587('0x0'));var events=[_0xd587('0x1'),_0xd587('0x2'),'update'];function createListener(_0x36b36d,_0x502f01){return function(_0x52f599){_0x502f01[_0xd587('0x3')](_0x36b36d,_0x52f599);};}function removeListener(_0x44e258,_0x46ca65){return function(){OpenchannelQueueEvents[_0xd587('0x4')](_0x44e258,_0x46ca65);};}exports[_0xd587('0x5')]=function(_0x71b568){for(var _0x270e3e=0x0,_0x568b0a=events[_0xd587('0x6')];_0x270e3e<_0x568b0a;_0x270e3e++){var _0x579279=events[_0x270e3e];var _0x47d747=createListener(_0xd587('0x7')+_0x579279,_0x71b568);OpenchannelQueueEvents['on'](_0x579279,_0x47d747);}}; \ No newline at end of file +var _0xdba1=['register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x4cae35,_0x1f7f2f){var _0x199bc4=function(_0x3deb5c){while(--_0x3deb5c){_0x4cae35['push'](_0x4cae35['shift']());}};_0x199bc4(++_0x1f7f2f);}(_0xdba1,0xe9));var _0x1dba=function(_0x3e8c05,_0x407623){_0x3e8c05=_0x3e8c05-0x0;var _0x39f671=_0xdba1[_0x3e8c05];return _0x39f671;};'use strict';var OpenchannelQueueEvents=require(_0x1dba('0x0'));var events=[_0x1dba('0x1'),_0x1dba('0x2'),_0x1dba('0x3')];function createListener(_0x1de280,_0x4117af){return function(_0x7e74ff){_0x4117af[_0x1dba('0x4')](_0x1de280,_0x7e74ff);};}function removeListener(_0xe2e17b,_0x216fc4){return function(){OpenchannelQueueEvents['removeListener'](_0xe2e17b,_0x216fc4);};}exports[_0x1dba('0x5')]=function(_0x2bdcc4){for(var _0x328a08=0x0,_0x1a3b43=events['length'];_0x328a08<_0x1a3b43;_0x328a08++){var _0x4bd16d=events[_0x328a08];var _0x421264=createListener(_0x1dba('0x6')+_0x4bd16d,_0x2bdcc4);OpenchannelQueueEvents['on'](_0x4bd16d,_0x421264);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 20272de..3e13a67 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 _0xd291=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','put'];(function(_0x50cee2,_0x56709e){var _0x3875c3=function(_0x2812af){while(--_0x2812af){_0x50cee2['push'](_0x50cee2['shift']());}};_0x3875c3(++_0x56709e);}(_0xd291,0x13f));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var path=require(_0x1d29('0x2'));var timeout=require(_0x1d29('0x3'));var express=require(_0x1d29('0x4'));var router=express['Router']();var fs_extra=require(_0x1d29('0x5'));var auth=require(_0x1d29('0x6'));var interaction=require(_0x1d29('0x7'));var config=require(_0x1d29('0x8'));var controller=require(_0x1d29('0x9'));router[_0x1d29('0xa')]('/',auth[_0x1d29('0xb')](),controller['index']);router['get'](_0x1d29('0xc'),auth[_0x1d29('0xb')](),controller[_0x1d29('0xd')]);router[_0x1d29('0xa')](_0x1d29('0xe'),auth['isAuthenticated'](),controller[_0x1d29('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1d29('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1d29('0x11')]);router[_0x1d29('0x12')](_0x1d29('0xe'),auth[_0x1d29('0xb')](),controller[_0x1d29('0x13')]);module[_0x1d29('0x14')]=router; \ No newline at end of file +var _0x5694=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','create'];(function(_0x3ec0dd,_0x3a5e67){var _0x2818c7=function(_0x1f8166){while(--_0x1f8166){_0x3ec0dd['push'](_0x3ec0dd['shift']());}};_0x2818c7(++_0x3a5e67);}(_0x5694,0x10a));var _0x4569=function(_0x234018,_0x4d12b2){_0x234018=_0x234018-0x0;var _0x91c124=_0x5694[_0x234018];return _0x91c124;};'use strict';var multer=require(_0x4569('0x0'));var util=require(_0x4569('0x1'));var path=require('path');var timeout=require(_0x4569('0x2'));var express=require('express');var router=express[_0x4569('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4569('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4569('0x5'));var controller=require(_0x4569('0x6'));router[_0x4569('0x7')]('/',auth['isAuthenticated'](),controller[_0x4569('0x8')]);router[_0x4569('0x7')](_0x4569('0x9'),auth[_0x4569('0xa')](),controller[_0x4569('0xb')]);router[_0x4569('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4569('0xc')]);router['post']('/',auth[_0x4569('0xa')](),controller[_0x4569('0xd')]);router[_0x4569('0xe')](_0x4569('0xf'),auth[_0x4569('0xa')](),controller[_0x4569('0x10')]);router[_0x4569('0x11')](_0x4569('0xf'),auth[_0x4569('0xa')](),controller[_0x4569('0x12')]);module[_0x4569('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 e8e79cf..cf710b8 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 _0xa80e=['STRING','DATE','moment','sequelize','exports'];(function(_0x19ec40,_0x75c91d){var _0x1c6d1e=function(_0x45c42c){while(--_0x45c42c){_0x19ec40['push'](_0x19ec40['shift']());}};_0x1c6d1e(++_0x75c91d);}(_0xa80e,0x7f));var _0xea80=function(_0x3a777d,_0x2f0f12){_0x3a777d=_0x3a777d-0x0;var _0x5c2dbc=_0xa80e[_0x3a777d];return _0x5c2dbc;};'use strict';var moment=require(_0xea80('0x0'));var Sequelize=require(_0xea80('0x1'));module[_0xea80('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xea80('0x3')]},'joinAt':{'type':Sequelize[_0xea80('0x4')]},'leaveAt':{'type':Sequelize[_0xea80('0x4')]},'acceptAt':{'type':Sequelize[_0xea80('0x4')]},'exitAt':{'type':Sequelize[_0xea80('0x4')]},'reason':{'type':Sequelize[_0xea80('0x3')]}}; \ No newline at end of file +var _0x3923=['moment','sequelize','exports','STRING','DATE'];(function(_0x4e0c15,_0x5e8399){var _0x1403b3=function(_0x4281eb){while(--_0x4281eb){_0x4e0c15['push'](_0x4e0c15['shift']());}};_0x1403b3(++_0x5e8399);}(_0x3923,0x1e0));var _0x3392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3923[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0x3392('0x0'));var Sequelize=require(_0x3392('0x1'));module[_0x3392('0x2')]={'uniqueid':{'type':Sequelize[_0x3392('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3392('0x4')]},'leaveAt':{'type':Sequelize[_0x3392('0x4')]},'acceptAt':{'type':Sequelize[_0x3392('0x4')]},'exitAt':{'type':Sequelize[_0x3392('0x4')]},'reason':{'type':Sequelize[_0x3392('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6335e70..0ad154f 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 _0xbe08=['fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0xbe08,0x88));var _0x8be0=function(_0x2ae466,_0x5c07c0){_0x2ae466=_0x2ae466-0x0;var _0x3c4090=_0xbe08[_0x2ae466];return _0x3c4090;};'use strict';var emlformat=require(_0x8be0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8be0('0x1'));var rp=require(_0x8be0('0x2'));var moment=require(_0x8be0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8be0('0x4'));var util=require(_0x8be0('0x5'));var path=require(_0x8be0('0x6'));var sox=require(_0x8be0('0x7'));var csv=require(_0x8be0('0x8'));var ejs=require(_0x8be0('0x9'));var fs=require('fs');var fs_extra=require(_0x8be0('0xa'));var _=require('lodash');var squel=require(_0x8be0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8be0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8be0('0xd'));var Redis=require(_0x8be0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8be0('0xf'));var as=require(_0x8be0('0x10'));var hardwareService=require(_0x8be0('0x11'));var logger=require(_0x8be0('0x12'))('api');var utils=require(_0x8be0('0x13'));var config=require(_0x8be0('0x14'));var licenseUtil=require(_0x8be0('0x15'));var db=require(_0x8be0('0x16'))['db'];function respondWithStatusCode(_0x1f59be,_0x283b44){_0x283b44=_0x283b44||0xcc;return function(_0x4e632b){if(_0x4e632b){return _0x1f59be['sendStatus'](_0x283b44);}return _0x1f59be[_0x8be0('0x17')](_0x283b44)[_0x8be0('0x18')]();};}function respondWithResult(_0xfd7b3d,_0x12df3b){_0x12df3b=_0x12df3b||0xc8;return function(_0x54a28f){if(_0x54a28f){return _0xfd7b3d[_0x8be0('0x17')](_0x12df3b)[_0x8be0('0x19')](_0x54a28f);}};}function respondWithFilteredResult(_0x46342d,_0x301583){return function(_0x4f720c){if(_0x4f720c){var _0x3c86cd=typeof _0x301583[_0x8be0('0x1a')]==='undefined'&&typeof _0x301583[_0x8be0('0x1b')]===_0x8be0('0x1c');var _0x4fdc97=_0x4f720c[_0x8be0('0x1d')];var _0x2642e9=_0x3c86cd?0x0:_0x301583[_0x8be0('0x1a')];var _0x541706=_0x3c86cd?_0x4f720c[_0x8be0('0x1d')]:_0x301583[_0x8be0('0x1a')]+_0x301583['limit'];var _0x3a914c;if(_0x541706>=_0x4fdc97){_0x541706=_0x4fdc97;_0x3a914c=0xc8;}else{_0x3a914c=0xce;}_0x46342d[_0x8be0('0x17')](_0x3a914c);return _0x46342d[_0x8be0('0x1e')]('Content-Range',_0x2642e9+'-'+_0x541706+'/'+_0x4fdc97)[_0x8be0('0x19')](_0x4f720c);}return null;};}function patchUpdates(_0x4b157b){return function(_0xadd05d){try{jsonpatch[_0x8be0('0x1f')](_0xadd05d,_0x4b157b,!![]);}catch(_0x4bff58){return BPromise['reject'](_0x4bff58);}return _0xadd05d[_0x8be0('0x20')]();};}function saveUpdates(_0x3b6ea0,_0x3da316){return function(_0x2ecf59){if(_0x2ecf59){return _0x2ecf59[_0x8be0('0x21')](_0x3b6ea0)[_0x8be0('0x22')](function(_0x4faf9a){return _0x4faf9a;});}return null;};}function removeEntity(_0x16156d,_0x247080){return function(_0xe97871){if(_0xe97871){return _0xe97871[_0x8be0('0x23')]()['then'](function(){_0x16156d[_0x8be0('0x17')](0xcc)[_0x8be0('0x18')]();});}};}function handleEntityNotFound(_0x1025a0,_0x4f6f6b){return function(_0x3d77eb){if(!_0x3d77eb){_0x1025a0[_0x8be0('0x24')](0x194);}return _0x3d77eb;};}function handleError(_0x253ea4,_0x5182e1){_0x5182e1=_0x5182e1||0x1f4;return function(_0x5a6aba){logger[_0x8be0('0x25')](_0x5a6aba[_0x8be0('0x26')]);if(_0x5a6aba[_0x8be0('0x27')]){delete _0x5a6aba[_0x8be0('0x27')];}_0x253ea4[_0x8be0('0x17')](_0x5182e1)['send'](_0x5a6aba);};}exports[_0x8be0('0x28')]=function(_0x4af433,_0x440a6b){var _0x199697={},_0x31144e={},_0x252602={'count':0x0,'rows':[]};var _0x8dca23=_[_0x8be0('0x29')](db[_0x8be0('0x2a')][_0x8be0('0x2b')],function(_0x24d5ff){return{'name':_0x24d5ff[_0x8be0('0x2c')],'type':_0x24d5ff[_0x8be0('0x2d')][_0x8be0('0x2e')]};});_0x31144e[_0x8be0('0x2f')]=_[_0x8be0('0x29')](_0x8dca23,_0x8be0('0x27'));_0x31144e[_0x8be0('0x30')]=_[_0x8be0('0x31')](_0x4af433['query']);_0x31144e[_0x8be0('0x32')]=_[_0x8be0('0x33')](_0x31144e['model'],_0x31144e['query']);_0x199697[_0x8be0('0x34')]=_[_0x8be0('0x33')](_0x31144e[_0x8be0('0x2f')],qs['fields'](_0x4af433['query'][_0x8be0('0x35')]));_0x199697['attributes']=_0x199697[_0x8be0('0x34')][_0x8be0('0x36')]?_0x199697[_0x8be0('0x34')]:_0x31144e[_0x8be0('0x2f')];if(!_0x4af433[_0x8be0('0x30')][_0x8be0('0x37')](_0x8be0('0x38'))){_0x199697[_0x8be0('0x1b')]=qs[_0x8be0('0x1b')](_0x4af433['query'][_0x8be0('0x1b')]);_0x199697[_0x8be0('0x1a')]=qs[_0x8be0('0x1a')](_0x4af433['query'][_0x8be0('0x1a')]);}_0x199697['order']=qs['sort'](_0x4af433[_0x8be0('0x30')][_0x8be0('0x39')]);_0x199697['where']=qs[_0x8be0('0x32')](_['pick'](_0x4af433[_0x8be0('0x30')],_0x31144e[_0x8be0('0x32')]),_0x8dca23);if(_0x4af433[_0x8be0('0x30')][_0x8be0('0x3a')]){_0x199697['where']=_[_0x8be0('0x3b')](_0x199697[_0x8be0('0x3c')],{'$or':_['map'](_0x8dca23,function(_0x3d494f){if(_0x3d494f['type']!==_0x8be0('0x3d')){var _0x3767d4={};_0x3767d4[_0x3d494f['name']]={'$like':'%'+_0x4af433[_0x8be0('0x30')][_0x8be0('0x3a')]+'%'};return _0x3767d4;}})});}_0x199697=_['merge']({},_0x199697,_0x4af433[_0x8be0('0x3e')]);var _0x54f0ab={'where':_0x199697[_0x8be0('0x3c')]};return db[_0x8be0('0x2a')][_0x8be0('0x1d')](_0x54f0ab)[_0x8be0('0x22')](function(_0x35a2ee){_0x252602[_0x8be0('0x1d')]=_0x35a2ee;if(_0x4af433[_0x8be0('0x30')]['includeAll']){_0x199697[_0x8be0('0x3f')]=[{'all':!![]}];}return db[_0x8be0('0x2a')][_0x8be0('0x40')](_0x199697);})['then'](function(_0x21dfd6){_0x252602[_0x8be0('0x41')]=_0x21dfd6;return _0x252602;})[_0x8be0('0x22')](respondWithFilteredResult(_0x440a6b,_0x199697))[_0x8be0('0x42')](handleError(_0x440a6b,null));};exports['show']=function(_0x29172e,_0x3b3179){var _0x9f3079={'raw':!![],'where':{'id':_0x29172e[_0x8be0('0x43')]['id']}},_0x456076={};_0x456076[_0x8be0('0x2f')]=_[_0x8be0('0x31')](db['OpenchannelQueueReport']['rawAttributes']);_0x456076[_0x8be0('0x30')]=_['keys'](_0x29172e[_0x8be0('0x30')]);_0x456076[_0x8be0('0x32')]=_['intersection'](_0x456076[_0x8be0('0x2f')],_0x456076[_0x8be0('0x30')]);_0x9f3079[_0x8be0('0x34')]=_[_0x8be0('0x33')](_0x456076[_0x8be0('0x2f')],qs[_0x8be0('0x35')](_0x29172e[_0x8be0('0x30')][_0x8be0('0x35')]));_0x9f3079['attributes']=_0x9f3079[_0x8be0('0x34')]['length']?_0x9f3079['attributes']:_0x456076[_0x8be0('0x2f')];if(_0x29172e[_0x8be0('0x30')][_0x8be0('0x44')]){_0x9f3079[_0x8be0('0x3f')]=[{'all':!![]}];}_0x9f3079=_[_0x8be0('0x3b')]({},_0x9f3079,_0x29172e[_0x8be0('0x3e')]);return db[_0x8be0('0x2a')][_0x8be0('0x45')](_0x9f3079)[_0x8be0('0x22')](handleEntityNotFound(_0x3b3179,null))[_0x8be0('0x22')](respondWithResult(_0x3b3179,null))[_0x8be0('0x42')](handleError(_0x3b3179,null));};exports[_0x8be0('0x46')]=function(_0x5652d0,_0x4ef288){return db['OpenchannelQueueReport']['create'](_0x5652d0[_0x8be0('0x47')],{})[_0x8be0('0x22')](respondWithResult(_0x4ef288,0xc9))[_0x8be0('0x42')](handleError(_0x4ef288,null));};exports['update']=function(_0x14f294,_0x7bd1b0){if(_0x14f294['body']['id']){delete _0x14f294['body']['id'];}return db[_0x8be0('0x2a')][_0x8be0('0x45')]({'where':{'id':_0x14f294[_0x8be0('0x43')]['id']}})[_0x8be0('0x22')](handleEntityNotFound(_0x7bd1b0,null))['then'](saveUpdates(_0x14f294['body'],null))[_0x8be0('0x22')](respondWithResult(_0x7bd1b0,null))[_0x8be0('0x42')](handleError(_0x7bd1b0,null));};exports[_0x8be0('0x23')]=function(_0x323b4b,_0x1695d5){return db[_0x8be0('0x2a')][_0x8be0('0x45')]({'where':{'id':_0x323b4b[_0x8be0('0x43')]['id']}})[_0x8be0('0x22')](handleEntityNotFound(_0x1695d5,null))['then'](removeEntity(_0x1695d5,null))[_0x8be0('0x42')](handleError(_0x1695d5,null));};exports['describe']=function(_0x549fed,_0x8d6519){return db['OpenchannelQueueReport'][_0x8be0('0x48')]()[_0x8be0('0x22')](respondWithResult(_0x8d6519,null))[_0x8be0('0x42')](handleError(_0x8d6519,null));}; \ No newline at end of file +var _0x4d2d=['offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x3a6e85,_0x388c42){var _0xb1f143=function(_0x22e250){while(--_0x22e250){_0x3a6e85['push'](_0x3a6e85['shift']());}};_0xb1f143(++_0x388c42);}(_0x4d2d,0x7b));var _0xd4d2=function(_0x3c62ef,_0x4bb6ab){_0x3c62ef=_0x3c62ef-0x0;var _0x4d44f1=_0x4d2d[_0x3c62ef];return _0x4d44f1;};'use strict';var emlformat=require(_0xd4d2('0x0'));var rimraf=require(_0xd4d2('0x1'));var zipdir=require(_0xd4d2('0x2'));var jsonpatch=require(_0xd4d2('0x3'));var rp=require(_0xd4d2('0x4'));var moment=require(_0xd4d2('0x5'));var BPromise=require(_0xd4d2('0x6'));var Mustache=require(_0xd4d2('0x7'));var util=require(_0xd4d2('0x8'));var path=require(_0xd4d2('0x9'));var sox=require(_0xd4d2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4d2('0xb'));var _=require(_0xd4d2('0xc'));var squel=require('squel');var crypto=require(_0xd4d2('0xd'));var jsforce=require(_0xd4d2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd4d2('0xf'));var querystring=require(_0xd4d2('0x10'));var Papa=require(_0xd4d2('0x11'));var Redis=require('ioredis');var authService=require(_0xd4d2('0x12'));var qs=require(_0xd4d2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4d2('0x14'));var logger=require(_0xd4d2('0x15'))('api');var utils=require(_0xd4d2('0x16'));var config=require(_0xd4d2('0x17'));var licenseUtil=require(_0xd4d2('0x18'));var db=require(_0xd4d2('0x19'))['db'];function respondWithStatusCode(_0x2b51e3,_0x31f9e6){_0x31f9e6=_0x31f9e6||0xcc;return function(_0x4372fb){if(_0x4372fb){return _0x2b51e3[_0xd4d2('0x1a')](_0x31f9e6);}return _0x2b51e3[_0xd4d2('0x1b')](_0x31f9e6)[_0xd4d2('0x1c')]();};}function respondWithResult(_0x5c91f8,_0xbb5e01){_0xbb5e01=_0xbb5e01||0xc8;return function(_0x50de40){if(_0x50de40){return _0x5c91f8[_0xd4d2('0x1b')](_0xbb5e01)[_0xd4d2('0x1d')](_0x50de40);}};}function respondWithFilteredResult(_0x334094,_0x3876ab){return function(_0x4e85a1){if(_0x4e85a1){var _0x50b22d=typeof _0x3876ab['offset']===_0xd4d2('0x1e')&&typeof _0x3876ab[_0xd4d2('0x1f')]==='undefined';var _0x3d6535=_0x4e85a1[_0xd4d2('0x20')];var _0x6d6b64=_0x50b22d?0x0:_0x3876ab[_0xd4d2('0x21')];var _0x363d02=_0x50b22d?_0x4e85a1['count']:_0x3876ab[_0xd4d2('0x21')]+_0x3876ab[_0xd4d2('0x1f')];var _0x10400c;if(_0x363d02>=_0x3d6535){_0x363d02=_0x3d6535;_0x10400c=0xc8;}else{_0x10400c=0xce;}_0x334094[_0xd4d2('0x1b')](_0x10400c);return _0x334094['set'](_0xd4d2('0x22'),_0x6d6b64+'-'+_0x363d02+'/'+_0x3d6535)[_0xd4d2('0x1d')](_0x4e85a1);}return null;};}function patchUpdates(_0x2f0230){return function(_0x224f8b){try{jsonpatch[_0xd4d2('0x23')](_0x224f8b,_0x2f0230,!![]);}catch(_0x51382d){return BPromise[_0xd4d2('0x24')](_0x51382d);}return _0x224f8b[_0xd4d2('0x25')]();};}function saveUpdates(_0x37afb9,_0x4b3c0a){return function(_0x2891ff){if(_0x2891ff){return _0x2891ff[_0xd4d2('0x26')](_0x37afb9)[_0xd4d2('0x27')](function(_0x2fbf7d){return _0x2fbf7d;});}return null;};}function removeEntity(_0x568a44,_0x3425da){return function(_0x45bf76){if(_0x45bf76){return _0x45bf76[_0xd4d2('0x28')]()['then'](function(){_0x568a44[_0xd4d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ae093,_0x599ecb){return function(_0x4ffcb9){if(!_0x4ffcb9){_0x4ae093[_0xd4d2('0x1a')](0x194);}return _0x4ffcb9;};}function handleError(_0x422ba6,_0x4a7804){_0x4a7804=_0x4a7804||0x1f4;return function(_0x48ad42){logger[_0xd4d2('0x29')](_0x48ad42[_0xd4d2('0x2a')]);if(_0x48ad42[_0xd4d2('0x2b')]){delete _0x48ad42[_0xd4d2('0x2b')];}_0x422ba6[_0xd4d2('0x1b')](_0x4a7804)[_0xd4d2('0x2c')](_0x48ad42);};}exports['index']=function(_0x19c032,_0x5ee3da){var _0xa51ffe={},_0x39760e={},_0x3dc6e1={'count':0x0,'rows':[]};var _0x4e7ba8=_[_0xd4d2('0x2d')](db[_0xd4d2('0x2e')][_0xd4d2('0x2f')],function(_0x5cf0ad){return{'name':_0x5cf0ad['fieldName'],'type':_0x5cf0ad[_0xd4d2('0x30')][_0xd4d2('0x31')]};});_0x39760e[_0xd4d2('0x32')]=_['map'](_0x4e7ba8,'name');_0x39760e[_0xd4d2('0x33')]=_[_0xd4d2('0x34')](_0x19c032[_0xd4d2('0x33')]);_0x39760e[_0xd4d2('0x35')]=_[_0xd4d2('0x36')](_0x39760e[_0xd4d2('0x32')],_0x39760e[_0xd4d2('0x33')]);_0xa51ffe[_0xd4d2('0x37')]=_[_0xd4d2('0x36')](_0x39760e['model'],qs[_0xd4d2('0x38')](_0x19c032['query'][_0xd4d2('0x38')]));_0xa51ffe['attributes']=_0xa51ffe[_0xd4d2('0x37')][_0xd4d2('0x39')]?_0xa51ffe['attributes']:_0x39760e[_0xd4d2('0x32')];if(!_0x19c032[_0xd4d2('0x33')][_0xd4d2('0x3a')](_0xd4d2('0x3b'))){_0xa51ffe['limit']=qs[_0xd4d2('0x1f')](_0x19c032[_0xd4d2('0x33')][_0xd4d2('0x1f')]);_0xa51ffe[_0xd4d2('0x21')]=qs[_0xd4d2('0x21')](_0x19c032[_0xd4d2('0x33')][_0xd4d2('0x21')]);}_0xa51ffe[_0xd4d2('0x3c')]=qs[_0xd4d2('0x3d')](_0x19c032['query'][_0xd4d2('0x3d')]);_0xa51ffe['where']=qs[_0xd4d2('0x35')](_[_0xd4d2('0x3e')](_0x19c032[_0xd4d2('0x33')],_0x39760e[_0xd4d2('0x35')]),_0x4e7ba8);if(_0x19c032['query'][_0xd4d2('0x3f')]){_0xa51ffe[_0xd4d2('0x40')]=_[_0xd4d2('0x41')](_0xa51ffe[_0xd4d2('0x40')],{'$or':_['map'](_0x4e7ba8,function(_0x45f3d3){if(_0x45f3d3['type']!==_0xd4d2('0x42')){var _0x3ec34c={};_0x3ec34c[_0x45f3d3[_0xd4d2('0x2b')]]={'$like':'%'+_0x19c032[_0xd4d2('0x33')]['filter']+'%'};return _0x3ec34c;}})});}_0xa51ffe=_[_0xd4d2('0x41')]({},_0xa51ffe,_0x19c032[_0xd4d2('0x43')]);var _0x169826={'where':_0xa51ffe[_0xd4d2('0x40')]};return db[_0xd4d2('0x2e')][_0xd4d2('0x20')](_0x169826)['then'](function(_0x2aaa3b){_0x3dc6e1[_0xd4d2('0x20')]=_0x2aaa3b;if(_0x19c032[_0xd4d2('0x33')][_0xd4d2('0x44')]){_0xa51ffe[_0xd4d2('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0xa51ffe);})[_0xd4d2('0x27')](function(_0x33b90b){_0x3dc6e1[_0xd4d2('0x46')]=_0x33b90b;return _0x3dc6e1;})[_0xd4d2('0x27')](respondWithFilteredResult(_0x5ee3da,_0xa51ffe))[_0xd4d2('0x47')](handleError(_0x5ee3da,null));};exports[_0xd4d2('0x48')]=function(_0xb5c3f0,_0x55962a){var _0x45bd4f={'raw':!![],'where':{'id':_0xb5c3f0[_0xd4d2('0x49')]['id']}},_0x25d5e4={};_0x25d5e4[_0xd4d2('0x32')]=_[_0xd4d2('0x34')](db['OpenchannelQueueReport']['rawAttributes']);_0x25d5e4['query']=_[_0xd4d2('0x34')](_0xb5c3f0[_0xd4d2('0x33')]);_0x25d5e4[_0xd4d2('0x35')]=_['intersection'](_0x25d5e4['model'],_0x25d5e4[_0xd4d2('0x33')]);_0x45bd4f['attributes']=_[_0xd4d2('0x36')](_0x25d5e4['model'],qs[_0xd4d2('0x38')](_0xb5c3f0[_0xd4d2('0x33')][_0xd4d2('0x38')]));_0x45bd4f['attributes']=_0x45bd4f['attributes']['length']?_0x45bd4f[_0xd4d2('0x37')]:_0x25d5e4[_0xd4d2('0x32')];if(_0xb5c3f0[_0xd4d2('0x33')][_0xd4d2('0x44')]){_0x45bd4f['include']=[{'all':!![]}];}_0x45bd4f=_[_0xd4d2('0x41')]({},_0x45bd4f,_0xb5c3f0[_0xd4d2('0x43')]);return db[_0xd4d2('0x2e')]['find'](_0x45bd4f)[_0xd4d2('0x27')](handleEntityNotFound(_0x55962a,null))['then'](respondWithResult(_0x55962a,null))[_0xd4d2('0x47')](handleError(_0x55962a,null));};exports['create']=function(_0x388f2c,_0x574781){return db[_0xd4d2('0x2e')][_0xd4d2('0x4a')](_0x388f2c[_0xd4d2('0x4b')],{})[_0xd4d2('0x27')](respondWithResult(_0x574781,0xc9))[_0xd4d2('0x47')](handleError(_0x574781,null));};exports[_0xd4d2('0x26')]=function(_0x2cd218,_0x23c7c1){if(_0x2cd218[_0xd4d2('0x4b')]['id']){delete _0x2cd218[_0xd4d2('0x4b')]['id'];}return db[_0xd4d2('0x2e')][_0xd4d2('0x4c')]({'where':{'id':_0x2cd218[_0xd4d2('0x49')]['id']}})[_0xd4d2('0x27')](handleEntityNotFound(_0x23c7c1,null))[_0xd4d2('0x27')](saveUpdates(_0x2cd218['body'],null))[_0xd4d2('0x27')](respondWithResult(_0x23c7c1,null))[_0xd4d2('0x47')](handleError(_0x23c7c1,null));};exports[_0xd4d2('0x28')]=function(_0x2af5ad,_0x3ec4bd){return db[_0xd4d2('0x2e')]['find']({'where':{'id':_0x2af5ad['params']['id']}})['then'](handleEntityNotFound(_0x3ec4bd,null))[_0xd4d2('0x27')](removeEntity(_0x3ec4bd,null))['catch'](handleError(_0x3ec4bd,null));};exports[_0xd4d2('0x4d')]=function(_0x4d49ca,_0x4f6147){return db[_0xd4d2('0x2e')][_0xd4d2('0x4d')]()[_0xd4d2('0x27')](respondWithResult(_0x4f6147,null))['catch'](handleError(_0x4f6147,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 5dac4f1..6b42cec 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x32a299,_0x4f1137){var _0x420086=function(_0x15a2b2){while(--_0x15a2b2){_0x32a299['push'](_0x32a299['shift']());}};_0x420086(++_0x4f1137);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e4c4f,_0x53e5b5){_0x1e4c4f=_0x1e4c4f-0x0;var _0x55534c=_0x2ef3[_0x1e4c4f];return _0x55534c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x40cf44,_0x2934dd){var _0x160f31=function(_0x194c2b){while(--_0x194c2b){_0x40cf44['push'](_0x40cf44['shift']());}};_0x160f31(++_0x2934dd);}(_0x326f,0xd1));var _0xf326=function(_0x36e1e0,_0x48152c){_0x36e1e0=_0x36e1e0-0x0;var _0x18187f=_0x326f[_0x36e1e0];return _0x18187f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 28edb20..090febf 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 _0x36ee=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','update','body','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x2e2276,_0x43b703){var _0x5b61d5=function(_0x13fdef){while(--_0x13fdef){_0x2e2276['push'](_0x2e2276['shift']());}};_0x5b61d5(++_0x43b703);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')](_0x2184ae['body'],{'raw':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21e95e){logger[_0xe36e('0x15')](_0xe36e('0x18'),_0x2184ae);logger[_0xe36e('0xe')](_0xe36e('0x18'),_0x2184ae,JSON[_0xe36e('0x11')](_0x21e95e));_0x21d9a3(_0x21e95e);})['catch'](function(_0xd71137){logger[_0xe36e('0x12')](_0xe36e('0x18'),_0xd71137[_0xe36e('0x14')],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0xd71137['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4749a8){var _0x10818d=this;return new Promise(function(_0xb0cd85,_0xb32195){return db[_0xe36e('0x19')][_0xe36e('0x1d')](_0x4749a8[_0xe36e('0x1e')],{'raw':_0x4749a8['options']?_0x4749a8[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4749a8[_0xe36e('0x1b')]?_0x4749a8[_0xe36e('0x1b')]['where']||null:null,'attributes':_0x4749a8[_0xe36e('0x1b')]?_0x4749a8['options'][_0xe36e('0x1f')]||null:null,'limit':_0x4749a8['options']?_0x4749a8[_0xe36e('0x1b')]['limit']||null:null})[_0xe36e('0xc')](function(_0x4c5d98){logger[_0xe36e('0x15')]('UpdateOpenchannelQueueReport',_0x4749a8);logger['debug']('UpdateOpenchannelQueueReport',_0x4749a8,JSON['stringify'](_0x4c5d98));_0xb0cd85(_0x4c5d98);})[_0xe36e('0x17')](function(_0x1fc639){logger['error']('UpdateOpenchannelQueueReport',_0x1fc639[_0xe36e('0x14')],_0x4749a8);_0xb32195(_0x10818d[_0xe36e('0x12')](0x1f4,_0x1fc639[_0xe36e('0x14')]));});});}; \ No newline at end of file +var _0xfcbb=['body','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','UpdateOpenchannelQueueReport','update'];(function(_0x2bd5cc,_0x40c8ea){var _0x17515a=function(_0x501605){while(--_0x501605){_0x2bd5cc['push'](_0x2bd5cc['shift']());}};_0x17515a(++_0x40c8ea);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xf5c8c3,_0x51b6b5){_0xf5c8c3=_0xf5c8c3-0x0;var _0x52786a=_0xfcbb[_0xf5c8c3];return _0x52786a;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateOpenchannelQueueReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1a')]=function(_0x19616c){var _0x69c8e9=this;return new Promise(function(_0x14e43c,_0x11f6f7){return db[_0xbfcb('0x17')][_0xbfcb('0x1b')](_0x19616c[_0xbfcb('0x1c')],{'raw':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1e')]||null:null,'attributes':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1f')]||null:null,'limit':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x20')]||null:null})[_0xbfcb('0xa')](function(_0x3542e9){logger[_0xbfcb('0xb')](_0xbfcb('0x1a'),_0x19616c);logger[_0xbfcb('0xd')](_0xbfcb('0x1a'),_0x19616c,JSON['stringify'](_0x3542e9));_0x14e43c(_0x3542e9);})[_0xbfcb('0x15')](function(_0x3aa3cd){logger[_0xbfcb('0x10')](_0xbfcb('0x1a'),_0x3aa3cd[_0xbfcb('0x13')],_0x19616c);_0x11f6f7(_0x69c8e9[_0xbfcb('0x10')](0x1f4,_0x3aa3cd[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 77a1ef2..a02d323 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 _0xe261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x4d1be0,_0x135738){var _0x47d662=function(_0xdd044e){while(--_0xdd044e){_0x4d1be0['push'](_0x4d1be0['shift']());}};_0x47d662(++_0x135738);}(_0xe261,0x133));var _0x1e26=function(_0x1f0fdd,_0x51192b){_0x1f0fdd=_0x1f0fdd-0x0;var _0x389232=_0xe261[_0x1f0fdd];return _0x389232;};'use strict';var multer=require(_0x1e26('0x0'));var util=require(_0x1e26('0x1'));var path=require(_0x1e26('0x2'));var timeout=require(_0x1e26('0x3'));var express=require(_0x1e26('0x4'));var router=express[_0x1e26('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1e26('0x6'));var interaction=require(_0x1e26('0x7'));var config=require(_0x1e26('0x8'));var controller=require(_0x1e26('0x9'));router[_0x1e26('0xa')]('/',auth[_0x1e26('0xb')](),controller[_0x1e26('0xc')]);router[_0x1e26('0xa')](_0x1e26('0xd'),auth['isAuthenticated'](),controller[_0x1e26('0xe')]);router['get'](_0x1e26('0xf'),auth[_0x1e26('0xb')](),controller[_0x1e26('0x10')]);router['post']('/',auth[_0x1e26('0xb')](),controller['create']);router[_0x1e26('0x11')](_0x1e26('0xf'),auth[_0x1e26('0xb')](),controller[_0x1e26('0x12')]);router[_0x1e26('0x13')](_0x1e26('0xf'),auth[_0x1e26('0xb')](),controller[_0x1e26('0x14')]);module[_0x1e26('0x15')]=router; \ No newline at end of file +var _0x7257=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x3b9c7c,_0x7aff62){var _0x187907=function(_0x48cfd7){while(--_0x48cfd7){_0x3b9c7c['push'](_0x3b9c7c['shift']());}};_0x187907(++_0x7aff62);}(_0x7257,0xe4));var _0x7725=function(_0x43f552,_0x42808c){_0x43f552=_0x43f552-0x0;var _0x17911b=_0x7257[_0x43f552];return _0x17911b;};'use strict';var multer=require(_0x7725('0x0'));var util=require(_0x7725('0x1'));var path=require(_0x7725('0x2'));var timeout=require(_0x7725('0x3'));var express=require(_0x7725('0x4'));var router=express[_0x7725('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7725('0x6'));var interaction=require(_0x7725('0x7'));var config=require(_0x7725('0x8'));var controller=require(_0x7725('0x9'));router[_0x7725('0xa')]('/',auth[_0x7725('0xb')](),controller[_0x7725('0xc')]);router[_0x7725('0xa')](_0x7725('0xd'),auth['isAuthenticated'](),controller[_0x7725('0xe')]);router[_0x7725('0xa')](_0x7725('0xf'),auth[_0x7725('0xb')](),controller[_0x7725('0x10')]);router[_0x7725('0x11')]('/',auth[_0x7725('0xb')](),controller['create']);router[_0x7725('0x12')]('/:id',auth[_0x7725('0xb')](),controller[_0x7725('0x13')]);router[_0x7725('0x14')]('/:id',auth[_0x7725('0xb')](),controller[_0x7725('0x15')]);module[_0x7725('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4556a62..7bc4a4c 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xca7971,_0x42e52f){var _0x43a5d4=function(_0x160b19){while(--_0x160b19){_0xca7971['push'](_0xca7971['shift']());}};_0x43a5d4(++_0x42e52f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0xf3cd[_0x197185];return _0x2c8af1;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x39a885,_0x317185){var _0x5e3797=function(_0x1ae361){while(--_0x1ae361){_0x39a885['push'](_0x39a885['shift']());}};_0x5e3797(++_0x317185);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x00bb[_0x1e7b16];return _0x37fadc;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index eec2328..03bd7d5 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 _0xe49c=['order','sort','pick','filter','where','VIRTUAL','merge','OpenchannelTransferReport','include','findAll','rows','show','params','length','includeAll','options','catch','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','json','apply','reject','save','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xe49c,0xa7));var _0xce49=function(_0xc7f23c,_0x2be758){_0xc7f23c=_0xc7f23c-0x0;var _0x4b4def=_0xe49c[_0xc7f23c];return _0x4b4def;};'use strict';var emlformat=require(_0xce49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce49('0x1'));var jsonpatch=require(_0xce49('0x2'));var rp=require(_0xce49('0x3'));var moment=require(_0xce49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce49('0x5'));var util=require('util');var path=require('path');var sox=require(_0xce49('0x6'));var csv=require(_0xce49('0x7'));var ejs=require(_0xce49('0x8'));var fs=require('fs');var fs_extra=require(_0xce49('0x9'));var _=require(_0xce49('0xa'));var squel=require(_0xce49('0xb'));var crypto=require(_0xce49('0xc'));var jsforce=require(_0xce49('0xd'));var deskjs=require(_0xce49('0xe'));var toCsv=require(_0xce49('0x7'));var querystring=require('querystring');var Papa=require(_0xce49('0xf'));var Redis=require(_0xce49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xce49('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce49('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xce49('0x13'));var config=require(_0xce49('0x14'));var licenseUtil=require(_0xce49('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2f05,_0xaef963){_0xaef963=_0xaef963||0xcc;return function(_0x19109b){if(_0x19109b){return _0x3d2f05[_0xce49('0x16')](_0xaef963);}return _0x3d2f05['status'](_0xaef963)[_0xce49('0x17')]();};}function respondWithResult(_0x1e2aeb,_0x2dc5bc){_0x2dc5bc=_0x2dc5bc||0xc8;return function(_0xf3df12){if(_0xf3df12){return _0x1e2aeb['status'](_0x2dc5bc)['json'](_0xf3df12);}};}function respondWithFilteredResult(_0x410558,_0x24c7b1){return function(_0x45e142){if(_0x45e142){var _0x1da861=typeof _0x24c7b1[_0xce49('0x18')]===_0xce49('0x19')&&typeof _0x24c7b1[_0xce49('0x1a')]===_0xce49('0x19');var _0x2d6904=_0x45e142['count'];var _0x14634e=_0x1da861?0x0:_0x24c7b1[_0xce49('0x18')];var _0x331c94=_0x1da861?_0x45e142[_0xce49('0x1b')]:_0x24c7b1['offset']+_0x24c7b1[_0xce49('0x1a')];var _0x153a88;if(_0x331c94>=_0x2d6904){_0x331c94=_0x2d6904;_0x153a88=0xc8;}else{_0x153a88=0xce;}_0x410558[_0xce49('0x1c')](_0x153a88);return _0x410558['set']('Content-Range',_0x14634e+'-'+_0x331c94+'/'+_0x2d6904)[_0xce49('0x1d')](_0x45e142);}return null;};}function patchUpdates(_0x29f105){return function(_0x254bdf){try{jsonpatch[_0xce49('0x1e')](_0x254bdf,_0x29f105,!![]);}catch(_0x140b86){return BPromise[_0xce49('0x1f')](_0x140b86);}return _0x254bdf[_0xce49('0x20')]();};}function saveUpdates(_0x2e9bb8,_0x38401f){return function(_0x2413b1){if(_0x2413b1){return _0x2413b1['update'](_0x2e9bb8)[_0xce49('0x21')](function(_0x1d3ecd){return _0x1d3ecd;});}return null;};}function removeEntity(_0x5a21f4,_0x31b617){return function(_0x228b70){if(_0x228b70){return _0x228b70['destroy']()[_0xce49('0x21')](function(){_0x5a21f4[_0xce49('0x1c')](0xcc)[_0xce49('0x17')]();});}};}function handleEntityNotFound(_0x3294de,_0x2be29d){return function(_0x3988b6){if(!_0x3988b6){_0x3294de['sendStatus'](0x194);}return _0x3988b6;};}function handleError(_0x19d9f0,_0x4534f9){_0x4534f9=_0x4534f9||0x1f4;return function(_0x5f2a61){logger[_0xce49('0x22')](_0x5f2a61['stack']);if(_0x5f2a61['name']){delete _0x5f2a61[_0xce49('0x23')];}_0x19d9f0[_0xce49('0x1c')](_0x4534f9)[_0xce49('0x24')](_0x5f2a61);};}exports[_0xce49('0x25')]=function(_0xd8f330,_0x32687c){var _0x3657b1={},_0xd09c6e={},_0x5b9f69={'count':0x0,'rows':[]};var _0x5052b7=_['map'](db['OpenchannelTransferReport'][_0xce49('0x26')],function(_0x494106){return{'name':_0x494106[_0xce49('0x27')],'type':_0x494106[_0xce49('0x28')][_0xce49('0x29')]};});_0xd09c6e[_0xce49('0x2a')]=_[_0xce49('0x2b')](_0x5052b7,'name');_0xd09c6e[_0xce49('0x2c')]=_[_0xce49('0x2d')](_0xd8f330[_0xce49('0x2c')]);_0xd09c6e[_0xce49('0x2e')]=_[_0xce49('0x2f')](_0xd09c6e[_0xce49('0x2a')],_0xd09c6e['query']);_0x3657b1[_0xce49('0x30')]=_['intersection'](_0xd09c6e[_0xce49('0x2a')],qs[_0xce49('0x31')](_0xd8f330[_0xce49('0x2c')][_0xce49('0x31')]));_0x3657b1['attributes']=_0x3657b1[_0xce49('0x30')]['length']?_0x3657b1[_0xce49('0x30')]:_0xd09c6e[_0xce49('0x2a')];if(!_0xd8f330['query'][_0xce49('0x32')](_0xce49('0x33'))){_0x3657b1[_0xce49('0x1a')]=qs[_0xce49('0x1a')](_0xd8f330[_0xce49('0x2c')][_0xce49('0x1a')]);_0x3657b1[_0xce49('0x18')]=qs['offset'](_0xd8f330[_0xce49('0x2c')]['offset']);}_0x3657b1[_0xce49('0x34')]=qs[_0xce49('0x35')](_0xd8f330[_0xce49('0x2c')][_0xce49('0x35')]);_0x3657b1['where']=qs[_0xce49('0x2e')](_[_0xce49('0x36')](_0xd8f330[_0xce49('0x2c')],_0xd09c6e[_0xce49('0x2e')]),_0x5052b7);if(_0xd8f330[_0xce49('0x2c')][_0xce49('0x37')]){_0x3657b1[_0xce49('0x38')]=_['merge'](_0x3657b1[_0xce49('0x38')],{'$or':_[_0xce49('0x2b')](_0x5052b7,function(_0x27c6d9){if(_0x27c6d9[_0xce49('0x28')]!==_0xce49('0x39')){var _0x5e9b6e={};_0x5e9b6e[_0x27c6d9['name']]={'$like':'%'+_0xd8f330['query']['filter']+'%'};return _0x5e9b6e;}})});}_0x3657b1=_[_0xce49('0x3a')]({},_0x3657b1,_0xd8f330['options']);var _0x42acb8={'where':_0x3657b1['where']};return db[_0xce49('0x3b')][_0xce49('0x1b')](_0x42acb8)[_0xce49('0x21')](function(_0x12f260){_0x5b9f69[_0xce49('0x1b')]=_0x12f260;if(_0xd8f330['query']['includeAll']){_0x3657b1[_0xce49('0x3c')]=[{'all':!![]}];}return db[_0xce49('0x3b')][_0xce49('0x3d')](_0x3657b1);})[_0xce49('0x21')](function(_0x8afa6c){_0x5b9f69[_0xce49('0x3e')]=_0x8afa6c;return _0x5b9f69;})[_0xce49('0x21')](respondWithFilteredResult(_0x32687c,_0x3657b1))['catch'](handleError(_0x32687c,null));};exports[_0xce49('0x3f')]=function(_0x5df581,_0x5f3b33){var _0x47769a={'raw':!![],'where':{'id':_0x5df581[_0xce49('0x40')]['id']}},_0x5d9809={};_0x5d9809['model']=_[_0xce49('0x2d')](db['OpenchannelTransferReport'][_0xce49('0x26')]);_0x5d9809[_0xce49('0x2c')]=_['keys'](_0x5df581[_0xce49('0x2c')]);_0x5d9809[_0xce49('0x2e')]=_[_0xce49('0x2f')](_0x5d9809['model'],_0x5d9809['query']);_0x47769a[_0xce49('0x30')]=_[_0xce49('0x2f')](_0x5d9809['model'],qs[_0xce49('0x31')](_0x5df581['query'][_0xce49('0x31')]));_0x47769a[_0xce49('0x30')]=_0x47769a[_0xce49('0x30')][_0xce49('0x41')]?_0x47769a[_0xce49('0x30')]:_0x5d9809['model'];if(_0x5df581[_0xce49('0x2c')][_0xce49('0x42')]){_0x47769a['include']=[{'all':!![]}];}_0x47769a=_[_0xce49('0x3a')]({},_0x47769a,_0x5df581[_0xce49('0x43')]);return db[_0xce49('0x3b')]['find'](_0x47769a)['then'](handleEntityNotFound(_0x5f3b33,null))[_0xce49('0x21')](respondWithResult(_0x5f3b33,null))[_0xce49('0x44')](handleError(_0x5f3b33,null));};exports[_0xce49('0x45')]=function(_0x3b4fe4,_0x5029a2){return db[_0xce49('0x3b')][_0xce49('0x45')](_0x3b4fe4[_0xce49('0x46')],{})[_0xce49('0x21')](respondWithResult(_0x5029a2,0xc9))['catch'](handleError(_0x5029a2,null));};exports['update']=function(_0x3e083e,_0x2c0bfd){if(_0x3e083e['body']['id']){delete _0x3e083e[_0xce49('0x46')]['id'];}return db[_0xce49('0x3b')][_0xce49('0x47')]({'where':{'id':_0x3e083e[_0xce49('0x40')]['id']}})[_0xce49('0x21')](handleEntityNotFound(_0x2c0bfd,null))[_0xce49('0x21')](saveUpdates(_0x3e083e[_0xce49('0x46')],null))[_0xce49('0x21')](respondWithResult(_0x2c0bfd,null))[_0xce49('0x44')](handleError(_0x2c0bfd,null));};exports[_0xce49('0x48')]=function(_0x4aafc3,_0x3babfd){return db[_0xce49('0x3b')][_0xce49('0x47')]({'where':{'id':_0x4aafc3[_0xce49('0x40')]['id']}})[_0xce49('0x21')](handleEntityNotFound(_0x3babfd,null))[_0xce49('0x21')](removeEntity(_0x3babfd,null))[_0xce49('0x44')](handleError(_0x3babfd,null));};exports['describe']=function(_0x1d82d0,_0x3a4034){return db['OpenchannelTransferReport']['describe']()[_0xce49('0x21')](respondWithResult(_0x3a4034,null))['catch'](handleError(_0x3a4034,null));}; \ No newline at end of file +var _0xaab6=['reject','save','update','then','destroy','end','error','stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','json','apply'];(function(_0x1909e1,_0x53667a){var _0x560761=function(_0x229ab2){while(--_0x229ab2){_0x1909e1['push'](_0x1909e1['shift']());}};_0x560761(++_0x53667a);}(_0xaab6,0x76));var _0x6aab=function(_0x386306,_0x1363c9){_0x386306=_0x386306-0x0;var _0xcb23d=_0xaab6[_0x386306];return _0xcb23d;};'use strict';var emlformat=require(_0x6aab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6aab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6aab('0x2'));var moment=require(_0x6aab('0x3'));var BPromise=require(_0x6aab('0x4'));var Mustache=require(_0x6aab('0x5'));var util=require(_0x6aab('0x6'));var path=require('path');var sox=require(_0x6aab('0x7'));var csv=require(_0x6aab('0x8'));var ejs=require(_0x6aab('0x9'));var fs=require('fs');var fs_extra=require(_0x6aab('0xa'));var _=require(_0x6aab('0xb'));var squel=require('squel');var crypto=require(_0x6aab('0xc'));var jsforce=require(_0x6aab('0xd'));var deskjs=require(_0x6aab('0xe'));var toCsv=require(_0x6aab('0x8'));var querystring=require(_0x6aab('0xf'));var Papa=require(_0x6aab('0x10'));var Redis=require('ioredis');var authService=require(_0x6aab('0x11'));var qs=require(_0x6aab('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6aab('0x13'));var logger=require(_0x6aab('0x14'))('api');var utils=require(_0x6aab('0x15'));var config=require(_0x6aab('0x16'));var licenseUtil=require(_0x6aab('0x17'));var db=require(_0x6aab('0x18'))['db'];function respondWithStatusCode(_0x2bb536,_0x1c100e){_0x1c100e=_0x1c100e||0xcc;return function(_0x395671){if(_0x395671){return _0x2bb536[_0x6aab('0x19')](_0x1c100e);}return _0x2bb536[_0x6aab('0x1a')](_0x1c100e)['end']();};}function respondWithResult(_0x1562a5,_0x3104c3){_0x3104c3=_0x3104c3||0xc8;return function(_0x461452){if(_0x461452){return _0x1562a5['status'](_0x3104c3)['json'](_0x461452);}};}function respondWithFilteredResult(_0xc661a0,_0x3b0ec1){return function(_0x13ce26){if(_0x13ce26){var _0x540b06=typeof _0x3b0ec1[_0x6aab('0x1b')]===_0x6aab('0x1c')&&typeof _0x3b0ec1['limit']===_0x6aab('0x1c');var _0x2e888c=_0x13ce26[_0x6aab('0x1d')];var _0xe7172a=_0x540b06?0x0:_0x3b0ec1['offset'];var _0x24775e=_0x540b06?_0x13ce26[_0x6aab('0x1d')]:_0x3b0ec1[_0x6aab('0x1b')]+_0x3b0ec1['limit'];var _0x3b5526;if(_0x24775e>=_0x2e888c){_0x24775e=_0x2e888c;_0x3b5526=0xc8;}else{_0x3b5526=0xce;}_0xc661a0[_0x6aab('0x1a')](_0x3b5526);return _0xc661a0['set']('Content-Range',_0xe7172a+'-'+_0x24775e+'/'+_0x2e888c)[_0x6aab('0x1e')](_0x13ce26);}return null;};}function patchUpdates(_0x1b3385){return function(_0x526988){try{jsonpatch[_0x6aab('0x1f')](_0x526988,_0x1b3385,!![]);}catch(_0xe1eca1){return BPromise[_0x6aab('0x20')](_0xe1eca1);}return _0x526988[_0x6aab('0x21')]();};}function saveUpdates(_0x43a259,_0x4fde42){return function(_0x3594aa){if(_0x3594aa){return _0x3594aa[_0x6aab('0x22')](_0x43a259)[_0x6aab('0x23')](function(_0x272d84){return _0x272d84;});}return null;};}function removeEntity(_0x39176c,_0x5d77f8){return function(_0x913ecf){if(_0x913ecf){return _0x913ecf[_0x6aab('0x24')]()['then'](function(){_0x39176c['status'](0xcc)[_0x6aab('0x25')]();});}};}function handleEntityNotFound(_0x2d9452,_0x28fd05){return function(_0x2fa26b){if(!_0x2fa26b){_0x2d9452[_0x6aab('0x19')](0x194);}return _0x2fa26b;};}function handleError(_0x188868,_0x50e983){_0x50e983=_0x50e983||0x1f4;return function(_0x3512b0){logger[_0x6aab('0x26')](_0x3512b0[_0x6aab('0x27')]);if(_0x3512b0[_0x6aab('0x28')]){delete _0x3512b0[_0x6aab('0x28')];}_0x188868[_0x6aab('0x1a')](_0x50e983)['send'](_0x3512b0);};}exports['index']=function(_0x57965a,_0x488211){var _0x3781b4={},_0x504286={},_0x4c26fe={'count':0x0,'rows':[]};var _0x2d3a3c=_[_0x6aab('0x29')](db[_0x6aab('0x2a')][_0x6aab('0x2b')],function(_0x2e2103){return{'name':_0x2e2103[_0x6aab('0x2c')],'type':_0x2e2103['type'][_0x6aab('0x2d')]};});_0x504286[_0x6aab('0x2e')]=_[_0x6aab('0x29')](_0x2d3a3c,_0x6aab('0x28'));_0x504286[_0x6aab('0x2f')]=_[_0x6aab('0x30')](_0x57965a[_0x6aab('0x2f')]);_0x504286[_0x6aab('0x31')]=_[_0x6aab('0x32')](_0x504286['model'],_0x504286[_0x6aab('0x2f')]);_0x3781b4['attributes']=_[_0x6aab('0x32')](_0x504286['model'],qs[_0x6aab('0x33')](_0x57965a[_0x6aab('0x2f')][_0x6aab('0x33')]));_0x3781b4[_0x6aab('0x34')]=_0x3781b4[_0x6aab('0x34')][_0x6aab('0x35')]?_0x3781b4['attributes']:_0x504286[_0x6aab('0x2e')];if(!_0x57965a[_0x6aab('0x2f')][_0x6aab('0x36')](_0x6aab('0x37'))){_0x3781b4[_0x6aab('0x38')]=qs['limit'](_0x57965a[_0x6aab('0x2f')][_0x6aab('0x38')]);_0x3781b4['offset']=qs['offset'](_0x57965a[_0x6aab('0x2f')][_0x6aab('0x1b')]);}_0x3781b4[_0x6aab('0x39')]=qs[_0x6aab('0x3a')](_0x57965a[_0x6aab('0x2f')][_0x6aab('0x3a')]);_0x3781b4[_0x6aab('0x3b')]=qs['filters'](_[_0x6aab('0x3c')](_0x57965a['query'],_0x504286[_0x6aab('0x31')]),_0x2d3a3c);if(_0x57965a['query']['filter']){_0x3781b4[_0x6aab('0x3b')]=_[_0x6aab('0x3d')](_0x3781b4['where'],{'$or':_[_0x6aab('0x29')](_0x2d3a3c,function(_0x302e0b){if(_0x302e0b['type']!==_0x6aab('0x3e')){var _0x1763da={};_0x1763da[_0x302e0b[_0x6aab('0x28')]]={'$like':'%'+_0x57965a[_0x6aab('0x2f')][_0x6aab('0x3f')]+'%'};return _0x1763da;}})});}_0x3781b4=_[_0x6aab('0x3d')]({},_0x3781b4,_0x57965a[_0x6aab('0x40')]);var _0x338291={'where':_0x3781b4[_0x6aab('0x3b')]};return db[_0x6aab('0x2a')][_0x6aab('0x1d')](_0x338291)[_0x6aab('0x23')](function(_0x436250){_0x4c26fe[_0x6aab('0x1d')]=_0x436250;if(_0x57965a[_0x6aab('0x2f')][_0x6aab('0x41')]){_0x3781b4[_0x6aab('0x42')]=[{'all':!![]}];}return db[_0x6aab('0x2a')]['findAll'](_0x3781b4);})[_0x6aab('0x23')](function(_0x108943){_0x4c26fe[_0x6aab('0x43')]=_0x108943;return _0x4c26fe;})['then'](respondWithFilteredResult(_0x488211,_0x3781b4))[_0x6aab('0x44')](handleError(_0x488211,null));};exports[_0x6aab('0x45')]=function(_0x3a4b42,_0x19c621){var _0x1da5c8={'raw':!![],'where':{'id':_0x3a4b42['params']['id']}},_0x12d17f={};_0x12d17f[_0x6aab('0x2e')]=_[_0x6aab('0x30')](db[_0x6aab('0x2a')][_0x6aab('0x2b')]);_0x12d17f[_0x6aab('0x2f')]=_[_0x6aab('0x30')](_0x3a4b42['query']);_0x12d17f[_0x6aab('0x31')]=_[_0x6aab('0x32')](_0x12d17f[_0x6aab('0x2e')],_0x12d17f['query']);_0x1da5c8[_0x6aab('0x34')]=_[_0x6aab('0x32')](_0x12d17f[_0x6aab('0x2e')],qs['fields'](_0x3a4b42[_0x6aab('0x2f')][_0x6aab('0x33')]));_0x1da5c8[_0x6aab('0x34')]=_0x1da5c8['attributes'][_0x6aab('0x35')]?_0x1da5c8[_0x6aab('0x34')]:_0x12d17f[_0x6aab('0x2e')];if(_0x3a4b42[_0x6aab('0x2f')][_0x6aab('0x41')]){_0x1da5c8[_0x6aab('0x42')]=[{'all':!![]}];}_0x1da5c8=_[_0x6aab('0x3d')]({},_0x1da5c8,_0x3a4b42['options']);return db[_0x6aab('0x2a')][_0x6aab('0x46')](_0x1da5c8)[_0x6aab('0x23')](handleEntityNotFound(_0x19c621,null))[_0x6aab('0x23')](respondWithResult(_0x19c621,null))[_0x6aab('0x44')](handleError(_0x19c621,null));};exports[_0x6aab('0x47')]=function(_0x4f47e9,_0x3ac770){return db['OpenchannelTransferReport'][_0x6aab('0x47')](_0x4f47e9[_0x6aab('0x48')],{})['then'](respondWithResult(_0x3ac770,0xc9))[_0x6aab('0x44')](handleError(_0x3ac770,null));};exports['update']=function(_0x31795c,_0x1262b2){if(_0x31795c[_0x6aab('0x48')]['id']){delete _0x31795c['body']['id'];}return db[_0x6aab('0x2a')][_0x6aab('0x46')]({'where':{'id':_0x31795c[_0x6aab('0x49')]['id']}})['then'](handleEntityNotFound(_0x1262b2,null))[_0x6aab('0x23')](saveUpdates(_0x31795c[_0x6aab('0x48')],null))[_0x6aab('0x23')](respondWithResult(_0x1262b2,null))['catch'](handleError(_0x1262b2,null));};exports[_0x6aab('0x24')]=function(_0xadca30,_0x251471){return db[_0x6aab('0x2a')][_0x6aab('0x46')]({'where':{'id':_0xadca30[_0x6aab('0x49')]['id']}})[_0x6aab('0x23')](handleEntityNotFound(_0x251471,null))[_0x6aab('0x23')](removeEntity(_0x251471,null))[_0x6aab('0x44')](handleError(_0x251471,null));};exports['describe']=function(_0x2eed28,_0x27dfdd){return db[_0x6aab('0x2a')][_0x6aab('0x4a')]()[_0x6aab('0x23')](respondWithResult(_0x27dfdd,null))[_0x6aab('0x44')](handleError(_0x27dfdd,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 04aa499..d8f82a7 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 _0x9b53=['exports','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e4a6a,_0x287632){var _0xc8879f=function(_0x4a5f5a){while(--_0x4a5f5a){_0x5e4a6a['push'](_0x5e4a6a['shift']());}};_0xc8879f(++_0x287632);}(_0x9b53,0x1f1));var _0x39b5=function(_0x23c783,_0x4ff818){_0x23c783=_0x23c783-0x0;var _0x14fe0f=_0x9b53[_0x23c783];return _0x14fe0f;};'use strict';var _=require(_0x39b5('0x0'));var util=require(_0x39b5('0x1'));var logger=require(_0x39b5('0x2'))(_0x39b5('0x3'));var moment=require(_0x39b5('0x4'));var BPromise=require(_0x39b5('0x5'));var rp=require(_0x39b5('0x6'));var fs=require('fs');var path=require(_0x39b5('0x7'));var rimraf=require(_0x39b5('0x8'));var config=require(_0x39b5('0x9'));var attributes=require('./openchannelTransferReport.attributes');module[_0x39b5('0xa')]=function(_0x4cb835,_0x4b9d7b){return _0x4cb835['define'](_0x39b5('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x39b5('0xc'),'fields':[_0x39b5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdff0=['util','../../config/logger','api','bluebird','path','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x83cc7b,_0x337a6b){var _0x77e5ab=function(_0xe70954){while(--_0xe70954){_0x83cc7b['push'](_0x83cc7b['shift']());}};_0x77e5ab(++_0x337a6b);}(_0xdff0,0xa7));var _0x0dff=function(_0x5c00c8,_0xa71130){_0x5c00c8=_0x5c00c8-0x0;var _0x396ba4=_0xdff0[_0x5c00c8];return _0x396ba4;};'use strict';var _=require(_0x0dff('0x0'));var util=require(_0x0dff('0x1'));var logger=require(_0x0dff('0x2'))(_0x0dff('0x3'));var moment=require('moment');var BPromise=require(_0x0dff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dff('0x5'));var rimraf=require(_0x0dff('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x0dff('0x7')]=function(_0x57099a,_0x57ad90){return _0x57099a[_0x0dff('0x8')](_0x0dff('0x9'),attributes,{'tableName':_0x0dff('0xa'),'paranoid':![],'indexes':[{'name':_0x0dff('0xb'),'fields':[_0x0dff('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index b86beec..b143c5c 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 _0x5334=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0xe39886,_0x234df8){var _0xe374f6=function(_0x474399){while(--_0x474399){_0xe39886['push'](_0xe39886['shift']());}};_0xe374f6(++_0x234df8);}(_0x5334,0x84));var _0x4533=function(_0x2817f5,_0xbb1c52){_0x2817f5=_0x2817f5-0x0;var _0x303e39=_0x5334[_0x2817f5];return _0x303e39;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var moment=require(_0x4533('0x2'));var BPromise=require(_0x4533('0x3'));var rs=require(_0x4533('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4533('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4533('0x6'))(_0x4533('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4533('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dea06,_0x4d89e7,_0x487906){return new BPromise(function(_0x3fbdc3,_0x42f94b){return client[_0x4533('0x9')](_0x4dea06,_0x487906)[_0x4533('0xa')](function(_0x31018b){logger[_0x4533('0xb')](_0x4533('0xc'),_0x4d89e7,'request\x20sent');logger[_0x4533('0xd')](_0x4533('0xe'),_0x4d89e7,_0x4533('0xf'),JSON[_0x4533('0x10')](_0x31018b));if(_0x31018b['error']){if(_0x31018b[_0x4533('0x11')]['code']===0x1f4){logger[_0x4533('0x11')](_0x4533('0xc'),_0x4d89e7,_0x31018b[_0x4533('0x11')][_0x4533('0x12')]);return _0x42f94b(_0x31018b['error'][_0x4533('0x12')]);}logger[_0x4533('0x11')](_0x4533('0xc'),_0x4d89e7,_0x31018b[_0x4533('0x11')]['message']);return _0x3fbdc3(_0x31018b[_0x4533('0x11')]['message']);}else{logger['info'](_0x4533('0xc'),_0x4d89e7,_0x4533('0xf'));_0x3fbdc3(_0x31018b['result'][_0x4533('0x12')]);}})[_0x4533('0x13')](function(_0x2a9877){logger['error'](_0x4533('0xc'),_0x4d89e7,_0x2a9877);_0x42f94b(_0x2a9877);});});} \ No newline at end of file +var _0x4ce6=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x512389,_0x53128b){var _0x2e7867=function(_0x465b5a){while(--_0x465b5a){_0x512389['push'](_0x512389['shift']());}};_0x2e7867(++_0x53128b);}(_0x4ce6,0x108));var _0x64ce=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x4ce6[_0x35ef6b];return _0x3ad145;};'use strict';var _=require(_0x64ce('0x0'));var util=require('util');var moment=require(_0x64ce('0x1'));var BPromise=require(_0x64ce('0x2'));var rs=require(_0x64ce('0x3'));var fs=require('fs');var Redis=require(_0x64ce('0x4'));var db=require(_0x64ce('0x5'))['db'];var utils=require(_0x64ce('0x6'));var logger=require('../../config/logger')(_0x64ce('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x64ce('0x8')][_0x64ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b8f2d,_0x538b74,_0x3c279f){return new BPromise(function(_0x134230,_0x1b253e){return client[_0x64ce('0xa')](_0x5b8f2d,_0x3c279f)[_0x64ce('0xb')](function(_0x135482){logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));logger['debug'](_0x64ce('0xf'),_0x538b74,_0x64ce('0xe'),JSON[_0x64ce('0x10')](_0x135482));if(_0x135482[_0x64ce('0x11')]){if(_0x135482[_0x64ce('0x11')][_0x64ce('0x12')]===0x1f4){logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x538b74,_0x135482['error'][_0x64ce('0x13')]);return _0x1b253e(_0x135482['error']['message']);}logger[_0x64ce('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x538b74,_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);return _0x134230(_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);}else{logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));_0x134230(_0x135482[_0x64ce('0x14')][_0x64ce('0x13')]);}})['catch'](function(_0x4b49be){logger['error'](_0x64ce('0xd'),_0x538b74,_0x4b49be);_0x1b253e(_0x4b49be);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a7324ea..97f6a88 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 _0xe3bd=['post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xe3bd,0x126));var _0xde3b=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0xe3bd[_0x572637];return _0xb6748;};'use strict';var multer=require('multer');var util=require(_0xde3b('0x0'));var path=require(_0xde3b('0x1'));var timeout=require(_0xde3b('0x2'));var express=require('express');var router=express[_0xde3b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xde3b('0x4'));var interaction=require(_0xde3b('0x5'));var config=require(_0xde3b('0x6'));var controller=require('./pause.controller');router[_0xde3b('0x7')]('/',auth['isAuthenticated'](),controller[_0xde3b('0x8')]);router['get'](_0xde3b('0x9'),auth[_0xde3b('0xa')](),controller[_0xde3b('0xb')]);router[_0xde3b('0xc')]('/',auth[_0xde3b('0xa')](),controller[_0xde3b('0xd')]);router['put'](_0xde3b('0x9'),auth[_0xde3b('0xa')](),controller[_0xde3b('0xe')]);router[_0xde3b('0xf')]('/:id',auth[_0xde3b('0xa')](),controller[_0xde3b('0x10')]);module[_0xde3b('0x11')]=router; \ No newline at end of file +var _0x7dc0=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','index','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer'];(function(_0x55822d,_0x58b6ea){var _0x39eb7d=function(_0x2c0408){while(--_0x2c0408){_0x55822d['push'](_0x55822d['shift']());}};_0x39eb7d(++_0x58b6ea);}(_0x7dc0,0x10f));var _0x07dc=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x7dc0[_0x33bcdb];return _0x18a9bf;};'use strict';var multer=require(_0x07dc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x07dc('0x1'));var router=express[_0x07dc('0x2')]();var fs_extra=require(_0x07dc('0x3'));var auth=require(_0x07dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x07dc('0x5'));var controller=require(_0x07dc('0x6'));router[_0x07dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x07dc('0x8')]);router[_0x07dc('0x7')](_0x07dc('0x9'),auth['isAuthenticated'](),controller[_0x07dc('0xa')]);router[_0x07dc('0xb')]('/',auth[_0x07dc('0xc')](),controller['create']);router[_0x07dc('0xd')](_0x07dc('0x9'),auth[_0x07dc('0xc')](),controller[_0x07dc('0xe')]);router['delete'](_0x07dc('0x9'),auth[_0x07dc('0xc')](),controller[_0x07dc('0xf')]);module[_0x07dc('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 278eded..b73b568 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 _0xaeee=['STRING','sequelize','exports'];(function(_0x356327,_0x631377){var _0x941b71=function(_0x47b655){while(--_0x47b655){_0x356327['push'](_0x356327['shift']());}};_0x941b71(++_0x631377);}(_0xaeee,0x118));var _0xeaee=function(_0x25233f,_0x4b06c8){_0x25233f=_0x25233f-0x0;var _0x5458fb=_0xaeee[_0x25233f];return _0x5458fb;};'use strict';var Sequelize=require(_0xeaee('0x0'));module[_0xeaee('0x1')]={'name':{'type':Sequelize[_0xeaee('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xeaee('0x2')]}}; \ No newline at end of file +var _0x4390=['name','sequelize','exports','STRING'];(function(_0x18cbe5,_0x10cc58){var _0x237fc3=function(_0x17eaf6){while(--_0x17eaf6){_0x18cbe5['push'](_0x18cbe5['shift']());}};_0x237fc3(++_0x10cc58);}(_0x4390,0x8d));var _0x0439=function(_0x3a63b8,_0x1792e8){_0x3a63b8=_0x3a63b8-0x0;var _0x35f2c7=_0x4390[_0x3a63b8];return _0x35f2c7;};'use strict';var Sequelize=require(_0x0439('0x0'));module[_0x0439('0x1')]={'name':{'type':Sequelize[_0x0439('0x2')],'unique':_0x0439('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index fbfe67c..1f7cfae 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 _0x738a=['query','keys','filters','intersection','attributes','hasOwnProperty','order','pick','filter','where','merge','include','rows','catch','show','fields','length','includeAll','options','create','body','user','role','UserProfileSection','find','userProfileId','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','get','Pauses','destroy','name','send','index','map','Pause','rawAttributes','fieldName','type','model'];(function(_0x1b7679,_0x4a85d2){var _0x18ccf5=function(_0x7e412c){while(--_0x7e412c){_0x1b7679['push'](_0x1b7679['shift']());}};_0x18ccf5(++_0x4a85d2);}(_0x738a,0x1a6));var _0xa738=function(_0x23884b,_0x50c307){_0x23884b=_0x23884b-0x0;var _0x28113b=_0x738a[_0x23884b];return _0x28113b;};'use strict';var emlformat=require(_0xa738('0x0'));var rimraf=require(_0xa738('0x1'));var zipdir=require(_0xa738('0x2'));var jsonpatch=require(_0xa738('0x3'));var rp=require(_0xa738('0x4'));var moment=require(_0xa738('0x5'));var BPromise=require(_0xa738('0x6'));var Mustache=require(_0xa738('0x7'));var util=require(_0xa738('0x8'));var path=require(_0xa738('0x9'));var sox=require(_0xa738('0xa'));var csv=require(_0xa738('0xb'));var ejs=require(_0xa738('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa738('0xd'));var crypto=require(_0xa738('0xe'));var jsforce=require(_0xa738('0xf'));var deskjs=require(_0xa738('0x10'));var toCsv=require(_0xa738('0xb'));var querystring=require(_0xa738('0x11'));var Papa=require(_0xa738('0x12'));var Redis=require('ioredis');var authService=require(_0xa738('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa738('0x14'));var hardwareService=require(_0xa738('0x15'));var logger=require(_0xa738('0x16'))(_0xa738('0x17'));var utils=require(_0xa738('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa738('0x19'));var db=require(_0xa738('0x1a'))['db'];function respondWithStatusCode(_0x29f424,_0x14d778){_0x14d778=_0x14d778||0xcc;return function(_0x227d98){if(_0x227d98){return _0x29f424[_0xa738('0x1b')](_0x14d778);}return _0x29f424[_0xa738('0x1c')](_0x14d778)[_0xa738('0x1d')]();};}function respondWithResult(_0x1eecfe,_0x37ea2a){_0x37ea2a=_0x37ea2a||0xc8;return function(_0x4fb1a3){if(_0x4fb1a3){return _0x1eecfe[_0xa738('0x1c')](_0x37ea2a)[_0xa738('0x1e')](_0x4fb1a3);}};}function respondWithFilteredResult(_0x34b672,_0x395796){return function(_0x5081f8){if(_0x5081f8){var _0x54bf57=typeof _0x395796['offset']===_0xa738('0x1f')&&typeof _0x395796[_0xa738('0x20')]==='undefined';var _0x363055=_0x5081f8['count'];var _0xe863a6=_0x54bf57?0x0:_0x395796[_0xa738('0x21')];var _0x3802be=_0x54bf57?_0x5081f8[_0xa738('0x22')]:_0x395796[_0xa738('0x21')]+_0x395796[_0xa738('0x20')];var _0x999aba;if(_0x3802be>=_0x363055){_0x3802be=_0x363055;_0x999aba=0xc8;}else{_0x999aba=0xce;}_0x34b672[_0xa738('0x1c')](_0x999aba);return _0x34b672[_0xa738('0x23')](_0xa738('0x24'),_0xe863a6+'-'+_0x3802be+'/'+_0x363055)[_0xa738('0x1e')](_0x5081f8);}return null;};}function patchUpdates(_0x394148){return function(_0x510ec6){try{jsonpatch['apply'](_0x510ec6,_0x394148,!![]);}catch(_0x2e1279){return BPromise[_0xa738('0x25')](_0x2e1279);}return _0x510ec6['save']();};}function saveUpdates(_0x3e609a,_0x29b678){return function(_0x2d7d37){if(_0x2d7d37){return _0x2d7d37[_0xa738('0x26')](_0x3e609a)[_0xa738('0x27')](function(_0x33cafd){return _0x33cafd;});}return null;};}function removeEntity(_0x2dd1f1,_0x43e4a8){return function(_0x48c32e){if(_0x48c32e){return _0x48c32e['destroy']()[_0xa738('0x27')](function(){var _0x1d564d=_0x48c32e[_0xa738('0x28')]({'plain':!![]});var _0x1ec76b=_0xa738('0x29');return db['UserProfileResource'][_0xa738('0x2a')]({'where':{'type':_0x1ec76b,'resourceId':_0x1d564d['id']}})[_0xa738('0x27')](function(){return _0x48c32e;});})[_0xa738('0x27')](function(){_0x2dd1f1[_0xa738('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d91cd,_0x2a5a35){return function(_0x144deb){if(!_0x144deb){_0x2d91cd[_0xa738('0x1b')](0x194);}return _0x144deb;};}function handleError(_0x976c25,_0x207b29){_0x207b29=_0x207b29||0x1f4;return function(_0x425bfd){logger['error'](_0x425bfd['stack']);if(_0x425bfd['name']){delete _0x425bfd[_0xa738('0x2b')];}_0x976c25['status'](_0x207b29)[_0xa738('0x2c')](_0x425bfd);};}exports[_0xa738('0x2d')]=function(_0x4b9d7c,_0x1ceb9d){var _0x59cf32={},_0x1d176e={},_0x76e621={'count':0x0,'rows':[]};var _0x435138=_[_0xa738('0x2e')](db[_0xa738('0x2f')][_0xa738('0x30')],function(_0x5c01b5){return{'name':_0x5c01b5[_0xa738('0x31')],'type':_0x5c01b5[_0xa738('0x32')]['key']};});_0x1d176e[_0xa738('0x33')]=_['map'](_0x435138,'name');_0x1d176e[_0xa738('0x34')]=_[_0xa738('0x35')](_0x4b9d7c['query']);_0x1d176e[_0xa738('0x36')]=_[_0xa738('0x37')](_0x1d176e[_0xa738('0x33')],_0x1d176e[_0xa738('0x34')]);_0x59cf32[_0xa738('0x38')]=_[_0xa738('0x37')](_0x1d176e[_0xa738('0x33')],qs['fields'](_0x4b9d7c[_0xa738('0x34')]['fields']));_0x59cf32[_0xa738('0x38')]=_0x59cf32['attributes']['length']?_0x59cf32[_0xa738('0x38')]:_0x1d176e[_0xa738('0x33')];if(!_0x4b9d7c[_0xa738('0x34')][_0xa738('0x39')]('nolimit')){_0x59cf32[_0xa738('0x20')]=qs[_0xa738('0x20')](_0x4b9d7c[_0xa738('0x34')][_0xa738('0x20')]);_0x59cf32[_0xa738('0x21')]=qs[_0xa738('0x21')](_0x4b9d7c['query'][_0xa738('0x21')]);}_0x59cf32[_0xa738('0x3a')]=qs['sort'](_0x4b9d7c['query']['sort']);_0x59cf32['where']=qs['filters'](_[_0xa738('0x3b')](_0x4b9d7c[_0xa738('0x34')],_0x1d176e[_0xa738('0x36')]),_0x435138);if(_0x4b9d7c['query'][_0xa738('0x3c')]){_0x59cf32[_0xa738('0x3d')]=_[_0xa738('0x3e')](_0x59cf32[_0xa738('0x3d')],{'$or':_[_0xa738('0x2e')](_0x435138,function(_0x54ec61){if(_0x54ec61[_0xa738('0x32')]!=='VIRTUAL'){var _0x3cee68={};_0x3cee68[_0x54ec61[_0xa738('0x2b')]]={'$like':'%'+_0x4b9d7c[_0xa738('0x34')][_0xa738('0x3c')]+'%'};return _0x3cee68;}})});}_0x59cf32=_['merge']({},_0x59cf32,_0x4b9d7c['options']);var _0x5ea94d={'where':_0x59cf32[_0xa738('0x3d')]};return db[_0xa738('0x2f')][_0xa738('0x22')](_0x5ea94d)[_0xa738('0x27')](function(_0xe2e0d2){_0x76e621[_0xa738('0x22')]=_0xe2e0d2;if(_0x4b9d7c['query']['includeAll']){_0x59cf32[_0xa738('0x3f')]=[{'all':!![]}];}return db[_0xa738('0x2f')]['findAll'](_0x59cf32);})[_0xa738('0x27')](function(_0x1f96ad){_0x76e621[_0xa738('0x40')]=_0x1f96ad;return _0x76e621;})['then'](respondWithFilteredResult(_0x1ceb9d,_0x59cf32))[_0xa738('0x41')](handleError(_0x1ceb9d,null));};exports[_0xa738('0x42')]=function(_0x40cfd3,_0x748ce3){var _0x56dd8d={'raw':!![],'where':{'id':_0x40cfd3['params']['id']}},_0x3fd7d9={};_0x3fd7d9[_0xa738('0x33')]=_[_0xa738('0x35')](db[_0xa738('0x2f')][_0xa738('0x30')]);_0x3fd7d9[_0xa738('0x34')]=_['keys'](_0x40cfd3[_0xa738('0x34')]);_0x3fd7d9[_0xa738('0x36')]=_[_0xa738('0x37')](_0x3fd7d9[_0xa738('0x33')],_0x3fd7d9[_0xa738('0x34')]);_0x56dd8d['attributes']=_['intersection'](_0x3fd7d9[_0xa738('0x33')],qs['fields'](_0x40cfd3['query'][_0xa738('0x43')]));_0x56dd8d[_0xa738('0x38')]=_0x56dd8d[_0xa738('0x38')][_0xa738('0x44')]?_0x56dd8d[_0xa738('0x38')]:_0x3fd7d9[_0xa738('0x33')];if(_0x40cfd3['query'][_0xa738('0x45')]){_0x56dd8d[_0xa738('0x3f')]=[{'all':!![]}];}_0x56dd8d=_['merge']({},_0x56dd8d,_0x40cfd3[_0xa738('0x46')]);return db['Pause']['find'](_0x56dd8d)[_0xa738('0x27')](handleEntityNotFound(_0x748ce3,null))[_0xa738('0x27')](respondWithResult(_0x748ce3,null))['catch'](handleError(_0x748ce3,null));};exports[_0xa738('0x47')]=function(_0x286943,_0x9c73bc){return db[_0xa738('0x2f')][_0xa738('0x47')](_0x286943[_0xa738('0x48')],{})[_0xa738('0x27')](function(_0x2021be){var _0x572349=_0x286943[_0xa738('0x49')][_0xa738('0x28')]({'plain':!![]});if(!_0x572349)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x572349[_0xa738('0x4a')]==='user'){var _0x4b9235=_0x2021be[_0xa738('0x28')]({'plain':!![]});var _0x561236=_0xa738('0x29');return db[_0xa738('0x4b')][_0xa738('0x4c')]({'where':{'name':_0x561236,'userProfileId':_0x572349[_0xa738('0x4d')]},'raw':!![]})[_0xa738('0x27')](function(_0x538532){if(_0x538532&&_0x538532['autoAssociation']===0x0){return db['UserProfileResource'][_0xa738('0x47')]({'name':_0x4b9235[_0xa738('0x2b')],'resourceId':_0x4b9235['id'],'type':_0x538532[_0xa738('0x2b')],'sectionId':_0x538532['id']},{})[_0xa738('0x27')](function(){return _0x2021be;});}else{return _0x2021be;}})['catch'](function(_0x52817d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52817d);throw _0x52817d;});}return _0x2021be;})[_0xa738('0x27')](respondWithResult(_0x9c73bc,0xc9))[_0xa738('0x41')](handleError(_0x9c73bc,null));};exports['update']=function(_0x18cde9,_0x5c3b38){if(_0x18cde9[_0xa738('0x48')]['id']){delete _0x18cde9['body']['id'];}return db['Pause'][_0xa738('0x4c')]({'where':{'id':_0x18cde9[_0xa738('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5c3b38,null))[_0xa738('0x27')](saveUpdates(_0x18cde9['body'],null))[_0xa738('0x27')](respondWithResult(_0x5c3b38,null))[_0xa738('0x41')](handleError(_0x5c3b38,null));};exports[_0xa738('0x2a')]=function(_0x19fa70,_0x2ba9d8){return db[_0xa738('0x2f')][_0xa738('0x4c')]({'where':{'id':_0x19fa70[_0xa738('0x4e')]['id']}})[_0xa738('0x27')](handleEntityNotFound(_0x2ba9d8,null))[_0xa738('0x27')](removeEntity(_0x2ba9d8,null))[_0xa738('0x41')](handleError(_0x2ba9d8,null));}; \ No newline at end of file +var _0x43fe=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','get','end','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','rows','catch','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Pauses','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4c6d00,_0x25c874){var _0x2ea68f=function(_0x266b8b){while(--_0x266b8b){_0x4c6d00['push'](_0x4c6d00['shift']());}};_0x2ea68f(++_0x25c874);}(_0x43fe,0x1de));var _0xe43f=function(_0x3897e5,_0x56aca9){_0x3897e5=_0x3897e5-0x0;var _0x340a00=_0x43fe[_0x3897e5];return _0x340a00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe43f('0x0'));var jsonpatch=require(_0xe43f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe43f('0x2'));var Mustache=require(_0xe43f('0x3'));var util=require(_0xe43f('0x4'));var path=require(_0xe43f('0x5'));var sox=require(_0xe43f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe43f('0x7'));var squel=require('squel');var crypto=require(_0xe43f('0x8'));var jsforce=require(_0xe43f('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe43f('0xa'));var Papa=require(_0xe43f('0xb'));var Redis=require(_0xe43f('0xc'));var authService=require(_0xe43f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe43f('0xe'));var hardwareService=require(_0xe43f('0xf'));var logger=require(_0xe43f('0x10'))(_0xe43f('0x11'));var utils=require(_0xe43f('0x12'));var config=require(_0xe43f('0x13'));var licenseUtil=require(_0xe43f('0x14'));var db=require(_0xe43f('0x15'))['db'];function respondWithStatusCode(_0x46f9a1,_0x36a289){_0x36a289=_0x36a289||0xcc;return function(_0x23ba0d){if(_0x23ba0d){return _0x46f9a1[_0xe43f('0x16')](_0x36a289);}return _0x46f9a1['status'](_0x36a289)['end']();};}function respondWithResult(_0x161493,_0x1bc7c2){_0x1bc7c2=_0x1bc7c2||0xc8;return function(_0x1d352b){if(_0x1d352b){return _0x161493[_0xe43f('0x17')](_0x1bc7c2)['json'](_0x1d352b);}};}function respondWithFilteredResult(_0x2d5088,_0x2694b8){return function(_0x1aa002){if(_0x1aa002){var _0x4cf368=typeof _0x2694b8[_0xe43f('0x18')]==='undefined'&&typeof _0x2694b8[_0xe43f('0x19')]===_0xe43f('0x1a');var _0x3cdf30=_0x1aa002['count'];var _0x414a4c=_0x4cf368?0x0:_0x2694b8['offset'];var _0x594e25=_0x4cf368?_0x1aa002['count']:_0x2694b8[_0xe43f('0x18')]+_0x2694b8['limit'];var _0x59c870;if(_0x594e25>=_0x3cdf30){_0x594e25=_0x3cdf30;_0x59c870=0xc8;}else{_0x59c870=0xce;}_0x2d5088[_0xe43f('0x17')](_0x59c870);return _0x2d5088[_0xe43f('0x1b')](_0xe43f('0x1c'),_0x414a4c+'-'+_0x594e25+'/'+_0x3cdf30)[_0xe43f('0x1d')](_0x1aa002);}return null;};}function patchUpdates(_0x16b7d5){return function(_0x36af82){try{jsonpatch['apply'](_0x36af82,_0x16b7d5,!![]);}catch(_0x52c3e0){return BPromise[_0xe43f('0x1e')](_0x52c3e0);}return _0x36af82[_0xe43f('0x1f')]();};}function saveUpdates(_0x2afd4f,_0x546741){return function(_0x1cf58f){if(_0x1cf58f){return _0x1cf58f[_0xe43f('0x20')](_0x2afd4f)[_0xe43f('0x21')](function(_0x169a4d){return _0x169a4d;});}return null;};}function removeEntity(_0x230bd9,_0x3c07d8){return function(_0x3894f3){if(_0x3894f3){return _0x3894f3['destroy']()[_0xe43f('0x21')](function(){var _0x3155ad=_0x3894f3[_0xe43f('0x22')]({'plain':!![]});var _0x366ca1='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x366ca1,'resourceId':_0x3155ad['id']}})[_0xe43f('0x21')](function(){return _0x3894f3;});})['then'](function(){_0x230bd9[_0xe43f('0x17')](0xcc)[_0xe43f('0x23')]();});}};}function handleEntityNotFound(_0x2d97fe,_0x63680a){return function(_0x5f4226){if(!_0x5f4226){_0x2d97fe[_0xe43f('0x16')](0x194);}return _0x5f4226;};}function handleError(_0x44f1fd,_0x14fc8d){_0x14fc8d=_0x14fc8d||0x1f4;return function(_0x2ad4e4){logger[_0xe43f('0x24')](_0x2ad4e4[_0xe43f('0x25')]);if(_0x2ad4e4[_0xe43f('0x26')]){delete _0x2ad4e4[_0xe43f('0x26')];}_0x44f1fd[_0xe43f('0x17')](_0x14fc8d)[_0xe43f('0x27')](_0x2ad4e4);};}exports[_0xe43f('0x28')]=function(_0xef93ec,_0x2acb4d){var _0x1ddd92={},_0x1a22f5={},_0x2a6e98={'count':0x0,'rows':[]};var _0x3bbaa9=_[_0xe43f('0x29')](db[_0xe43f('0x2a')][_0xe43f('0x2b')],function(_0x2b9db0){return{'name':_0x2b9db0[_0xe43f('0x2c')],'type':_0x2b9db0[_0xe43f('0x2d')][_0xe43f('0x2e')]};});_0x1a22f5[_0xe43f('0x2f')]=_[_0xe43f('0x29')](_0x3bbaa9,_0xe43f('0x26'));_0x1a22f5['query']=_[_0xe43f('0x30')](_0xef93ec['query']);_0x1a22f5[_0xe43f('0x31')]=_[_0xe43f('0x32')](_0x1a22f5['model'],_0x1a22f5[_0xe43f('0x33')]);_0x1ddd92[_0xe43f('0x34')]=_[_0xe43f('0x32')](_0x1a22f5[_0xe43f('0x2f')],qs['fields'](_0xef93ec[_0xe43f('0x33')][_0xe43f('0x35')]));_0x1ddd92['attributes']=_0x1ddd92[_0xe43f('0x34')][_0xe43f('0x36')]?_0x1ddd92[_0xe43f('0x34')]:_0x1a22f5[_0xe43f('0x2f')];if(!_0xef93ec['query']['hasOwnProperty'](_0xe43f('0x37'))){_0x1ddd92[_0xe43f('0x19')]=qs['limit'](_0xef93ec[_0xe43f('0x33')][_0xe43f('0x19')]);_0x1ddd92['offset']=qs['offset'](_0xef93ec[_0xe43f('0x33')][_0xe43f('0x18')]);}_0x1ddd92['order']=qs[_0xe43f('0x38')](_0xef93ec[_0xe43f('0x33')][_0xe43f('0x38')]);_0x1ddd92[_0xe43f('0x39')]=qs[_0xe43f('0x31')](_[_0xe43f('0x3a')](_0xef93ec[_0xe43f('0x33')],_0x1a22f5[_0xe43f('0x31')]),_0x3bbaa9);if(_0xef93ec[_0xe43f('0x33')]['filter']){_0x1ddd92['where']=_[_0xe43f('0x3b')](_0x1ddd92[_0xe43f('0x39')],{'$or':_[_0xe43f('0x29')](_0x3bbaa9,function(_0x23b67d){if(_0x23b67d[_0xe43f('0x2d')]!==_0xe43f('0x3c')){var _0x44fd19={};_0x44fd19[_0x23b67d[_0xe43f('0x26')]]={'$like':'%'+_0xef93ec[_0xe43f('0x33')][_0xe43f('0x3d')]+'%'};return _0x44fd19;}})});}_0x1ddd92=_[_0xe43f('0x3b')]({},_0x1ddd92,_0xef93ec['options']);var _0x235e96={'where':_0x1ddd92[_0xe43f('0x39')]};return db[_0xe43f('0x2a')]['count'](_0x235e96)[_0xe43f('0x21')](function(_0x7ea43){_0x2a6e98[_0xe43f('0x3e')]=_0x7ea43;if(_0xef93ec[_0xe43f('0x33')][_0xe43f('0x3f')]){_0x1ddd92[_0xe43f('0x40')]=[{'all':!![]}];}return db[_0xe43f('0x2a')]['findAll'](_0x1ddd92);})[_0xe43f('0x21')](function(_0x43c04c){_0x2a6e98[_0xe43f('0x41')]=_0x43c04c;return _0x2a6e98;})[_0xe43f('0x21')](respondWithFilteredResult(_0x2acb4d,_0x1ddd92))[_0xe43f('0x42')](handleError(_0x2acb4d,null));};exports[_0xe43f('0x43')]=function(_0x5cd9a4,_0x2f8568){var _0x2ae764={'raw':!![],'where':{'id':_0x5cd9a4[_0xe43f('0x44')]['id']}},_0x43c253={};_0x43c253[_0xe43f('0x2f')]=_[_0xe43f('0x30')](db['Pause'][_0xe43f('0x2b')]);_0x43c253[_0xe43f('0x33')]=_['keys'](_0x5cd9a4['query']);_0x43c253['filters']=_[_0xe43f('0x32')](_0x43c253[_0xe43f('0x2f')],_0x43c253[_0xe43f('0x33')]);_0x2ae764[_0xe43f('0x34')]=_[_0xe43f('0x32')](_0x43c253['model'],qs[_0xe43f('0x35')](_0x5cd9a4[_0xe43f('0x33')][_0xe43f('0x35')]));_0x2ae764[_0xe43f('0x34')]=_0x2ae764[_0xe43f('0x34')][_0xe43f('0x36')]?_0x2ae764[_0xe43f('0x34')]:_0x43c253[_0xe43f('0x2f')];if(_0x5cd9a4[_0xe43f('0x33')][_0xe43f('0x3f')]){_0x2ae764['include']=[{'all':!![]}];}_0x2ae764=_[_0xe43f('0x3b')]({},_0x2ae764,_0x5cd9a4[_0xe43f('0x45')]);return db[_0xe43f('0x2a')]['find'](_0x2ae764)[_0xe43f('0x21')](handleEntityNotFound(_0x2f8568,null))['then'](respondWithResult(_0x2f8568,null))[_0xe43f('0x42')](handleError(_0x2f8568,null));};exports[_0xe43f('0x46')]=function(_0x3036fe,_0x175856){return db['Pause'][_0xe43f('0x46')](_0x3036fe[_0xe43f('0x47')],{})['then'](function(_0x40da14){var _0x874bfd=_0x3036fe['user'][_0xe43f('0x22')]({'plain':!![]});if(!_0x874bfd)throw new Error(_0xe43f('0x48'));if(_0x874bfd[_0xe43f('0x49')]===_0xe43f('0x4a')){var _0x499ce6=_0x40da14[_0xe43f('0x22')]({'plain':!![]});var _0x551a15=_0xe43f('0x4b');return db[_0xe43f('0x4c')][_0xe43f('0x4d')]({'where':{'name':_0x551a15,'userProfileId':_0x874bfd[_0xe43f('0x4e')]},'raw':!![]})[_0xe43f('0x21')](function(_0x31361f){if(_0x31361f&&_0x31361f[_0xe43f('0x4f')]===0x0){return db[_0xe43f('0x50')][_0xe43f('0x46')]({'name':_0x499ce6[_0xe43f('0x26')],'resourceId':_0x499ce6['id'],'type':_0x31361f[_0xe43f('0x26')],'sectionId':_0x31361f['id']},{})['then'](function(){return _0x40da14;});}else{return _0x40da14;}})[_0xe43f('0x42')](function(_0x461a33){logger[_0xe43f('0x24')](_0xe43f('0x51'),_0x461a33);throw _0x461a33;});}return _0x40da14;})[_0xe43f('0x21')](respondWithResult(_0x175856,0xc9))['catch'](handleError(_0x175856,null));};exports[_0xe43f('0x20')]=function(_0x56f66b,_0x4ad6f3){if(_0x56f66b[_0xe43f('0x47')]['id']){delete _0x56f66b[_0xe43f('0x47')]['id'];}return db[_0xe43f('0x2a')][_0xe43f('0x4d')]({'where':{'id':_0x56f66b[_0xe43f('0x44')]['id']}})[_0xe43f('0x21')](handleEntityNotFound(_0x4ad6f3,null))['then'](saveUpdates(_0x56f66b[_0xe43f('0x47')],null))[_0xe43f('0x21')](respondWithResult(_0x4ad6f3,null))[_0xe43f('0x42')](handleError(_0x4ad6f3,null));};exports['destroy']=function(_0x3a1795,_0x572ae6){return db[_0xe43f('0x2a')][_0xe43f('0x4d')]({'where':{'id':_0x3a1795[_0xe43f('0x44')]['id']}})['then'](handleEntityNotFound(_0x572ae6,null))[_0xe43f('0x21')](removeEntity(_0x572ae6,null))[_0xe43f('0x42')](handleError(_0x572ae6,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 69b3f61..2ffe0e8 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x1c969e,_0x379a6e){var _0x3fb966=function(_0x53f051){while(--_0x53f051){_0x1c969e['push'](_0x1c969e['shift']());}};_0x3fb966(++_0x379a6e);}(_0xf494,0x1c6));var _0x4f49=function(_0xfbbfec,_0xe79de1){_0xfbbfec=_0xfbbfec-0x0;var _0x34bf3c=_0xf494[_0xfbbfec];return _0x34bf3c;};'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')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x177973,_0x45beb5){var _0x20abfb=function(_0x5994ec){while(--_0x5994ec){_0x177973['push'](_0x177973['shift']());}};_0x20abfb(++_0x45beb5);}(_0x5fab,0x177));var _0xb5fa=function(_0x345e4c,_0x3e73ba){_0x345e4c=_0x345e4c-0x0;var _0x40c41c=_0x5fab[_0x345e4c];return _0x40c41c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c6c65d8..e7bc3ce 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(_0x588b21,_0x39d1c8){var _0x309b23=function(_0x458db4){while(--_0x458db4){_0x588b21['push'](_0x588b21['shift']());}};_0x309b23(++_0x39d1c8);}(_0xb10b,0x12a));var _0xbb10=function(_0xce44ee,_0x387d70){_0xce44ee=_0xce44ee-0x0;var _0xf97a49=_0xb10b[_0xce44ee];return _0xf97a49;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2fe0b8,_0x51ee32){var _0x26f2b0=function(_0x51e220){while(--_0x51e220){_0x2fe0b8['push'](_0x2fe0b8['shift']());}};_0x26f2b0(++_0x51ee32);}(_0xb10b,0x12a));var _0xbb10=function(_0x21eacf,_0x1d1f5b){_0x21eacf=_0x21eacf-0x0;var _0xbae3e=_0xb10b[_0x21eacf];return _0xbae3e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 724a3df..2e2c26b 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 _0xc6d8=['format','%s-%s%s','basename','extname','now','single','file','post','put','update','delete','exports','multer','path','express','fs-extra','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','/:id/download','download','diskStorage','root','originalname','replace'];(function(_0x169060,_0x3a386b){var _0x2aa180=function(_0x2b8ac7){while(--_0x2b8ac7){_0x169060['push'](_0x169060['shift']());}};_0x2aa180(++_0x3a386b);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x545f6d,_0x16c27e){_0x545f6d=_0x545f6d-0x0;var _0x594012=_0xc6d8[_0x545f6d];return _0x594012;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var fs_extra=require(_0x8c6d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c6d('0x4'));var controller=require(_0x8c6d('0x5'));router[_0x8c6d('0x6')]('/',auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x8')]);router[_0x8c6d('0x6')](_0x8c6d('0x9'),controller['webhookGet']);router[_0x8c6d('0x6')](_0x8c6d('0xa'),auth[_0x8c6d('0x7')](),controller['show']);router[_0x8c6d('0x6')](_0x8c6d('0xb'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0xc')]);var upload=multer({'storage':multer[_0x8c6d('0xd')]({'destination':function(_0x43a7ab,_0x60cd5c,_0x392a6b){_0x392a6b(null,path['join'](config[_0x8c6d('0xe')],'server/files/plugins'));},'filename':function(_0x4c0878,_0x22d0fb,_0x890e85){_0x22d0fb[_0x8c6d('0xf')]=_0x22d0fb[_0x8c6d('0xf')][_0x8c6d('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x890e85(null,util[_0x8c6d('0x11')](_0x8c6d('0x12'),path[_0x8c6d('0x13')](_0x22d0fb[_0x8c6d('0xf')],path[_0x8c6d('0x14')](_0x22d0fb['originalname'])),Date[_0x8c6d('0x15')](),path['extname'](_0x22d0fb[_0x8c6d('0xf')])));}})});router['post']('/',upload[_0x8c6d('0x16')](_0x8c6d('0x17')),controller['upload']);router[_0x8c6d('0x18')](_0x8c6d('0x9'),controller['webhookPost']);router[_0x8c6d('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x8c6d('0x1a')]);router['delete'](_0x8c6d('0xa'),auth[_0x8c6d('0x7')](),controller[_0x8c6d('0x1b')]);module[_0x8c6d('0x1c')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4fde8d,_0x3203b5){var _0x4a3643=function(_0x17ca13){while(--_0x17ca13){_0x4fde8d['push'](_0x4fde8d['shift']());}};_0x4a3643(++_0x3203b5);}(_0x579c,0xda));var _0xc579=function(_0x58d4ce,_0x154425){_0x58d4ce=_0x58d4ce-0x0;var _0x3c5170=_0x579c[_0x58d4ce];return _0x3c5170;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 0e466ac..fcfbbf8 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 _0xc81c=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','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'];(function(_0x97576f,_0x36282c){var _0x3ae416=function(_0x361e1a){while(--_0x361e1a){_0x97576f['push'](_0x97576f['shift']());}};_0x3ae416(++_0x36282c);}(_0xc81c,0x13c));var _0xcc81=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc81c[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xcc81('0x0'));module['exports']={'name':{'type':Sequelize[_0xcc81('0x1')]},'type':{'type':Sequelize[_0xcc81('0x2')](_0xcc81('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xcc81('0x4')]},'path':{'type':Sequelize[_0xcc81('0x1')],'comment':_0xcc81('0x5')},'active':{'type':Sequelize[_0xcc81('0x6')],'defaultValue':0x0,'comment':_0xcc81('0x7')},'sidebar':{'type':Sequelize[_0xcc81('0x2')](_0xcc81('0x8'),_0xcc81('0x9'),_0xcc81('0xa'),_0xcc81('0xb')),'defaultValue':_0xcc81('0xa'),'comment':_0xcc81('0xc')},'icon':{'type':Sequelize[_0xcc81('0x1')]},'adminUrl':{'type':Sequelize[_0xcc81('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xcc81('0x1')]}}; \ No newline at end of file +var _0x8558=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x27f947,_0x1f79ae){var _0xf6d2d3=function(_0x26eb86){while(--_0x26eb86){_0x27f947['push'](_0x27f947['shift']());}};_0xf6d2d3(++_0x1f79ae);}(_0x8558,0x103));var _0x8855=function(_0x7cb705,_0x2f3c8e){_0x7cb705=_0x7cb705-0x0;var _0x131fa4=_0x8558[_0x7cb705];return _0x131fa4;};'use strict';var Sequelize=require('sequelize');module[_0x8855('0x0')]={'name':{'type':Sequelize[_0x8855('0x1')]},'type':{'type':Sequelize[_0x8855('0x2')](_0x8855('0x3'),_0x8855('0x4'))},'description':{'type':Sequelize[_0x8855('0x5')]},'version':{'type':Sequelize[_0x8855('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x8855('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8855('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x8855('0x8'),_0x8855('0x9'),_0x8855('0xa'),_0x8855('0xb')),'defaultValue':_0x8855('0xa'),'comment':_0x8855('0xc')},'icon':{'type':Sequelize[_0x8855('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x8855('0x1')]},'scriptName':{'type':Sequelize[_0x8855('0x1')]},'scriptPath':{'type':Sequelize[_0x8855('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2260a83..8b3c08e 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 _0x44a2=['\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','UserProfileResource','stack','name','send','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','download','root','server/files/plugins','format','%s.zip','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','pipe','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptPath','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port'];(function(_0x1ae975,_0x70b40e){var _0x2576ca=function(_0x1b4e97){while(--_0x1b4e97){_0x1ae975['push'](_0x1ae975['shift']());}};_0x2576ca(++_0x70b40e);}(_0x44a2,0xb1));var _0x244a=function(_0x38fe0c,_0x33e9b3){_0x38fe0c=_0x38fe0c-0x0;var _0x2f30a2=_0x44a2[_0x38fe0c];return _0x2f30a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x244a('0x0'));var zipdir=require(_0x244a('0x1'));var jsonpatch=require(_0x244a('0x2'));var rp=require('request-promise');var moment=require(_0x244a('0x3'));var BPromise=require(_0x244a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x244a('0x5'));var sox=require(_0x244a('0x6'));var csv=require(_0x244a('0x7'));var ejs=require(_0x244a('0x8'));var fs=require('fs');var fs_extra=require(_0x244a('0x9'));var _=require(_0x244a('0xa'));var squel=require(_0x244a('0xb'));var crypto=require(_0x244a('0xc'));var jsforce=require(_0x244a('0xd'));var deskjs=require(_0x244a('0xe'));var toCsv=require(_0x244a('0x7'));var querystring=require(_0x244a('0xf'));var Papa=require('papaparse');var extract=require(_0x244a('0x10'));var rimraf=require(_0x244a('0x0'));var archiver=require(_0x244a('0x11'));var Redis=require(_0x244a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x244a('0x13'));var logger=require('../../config/logger')(_0x244a('0x14'));var utils=require(_0x244a('0x15'));var config=require(_0x244a('0x16'));var licenseUtil=require(_0x244a('0x17'));var db=require(_0x244a('0x18'))['db'];config[_0x244a('0x19')]=_['defaults'](config[_0x244a('0x19')],{'host':_0x244a('0x1a'),'port':0x18eb});var socket=require(_0x244a('0x1b'))(new Redis(config[_0x244a('0x19')]));require(_0x244a('0x1c'))[_0x244a('0x1d')](socket);function respondWithStatusCode(_0x3f431b,_0x1145ad){_0x1145ad=_0x1145ad||0xcc;return function(_0xe51522){if(_0xe51522){return _0x3f431b[_0x244a('0x1e')](_0x1145ad);}return _0x3f431b[_0x244a('0x1f')](_0x1145ad)[_0x244a('0x20')]();};}function respondWithResult(_0x5cdcc9,_0x15718d){_0x15718d=_0x15718d||0xc8;return function(_0x22c0aa){if(_0x22c0aa){return _0x5cdcc9[_0x244a('0x1f')](_0x15718d)['json'](_0x22c0aa);}};}function respondWithFilteredResult(_0x5826af,_0x310f96){return function(_0xdf06bd){if(_0xdf06bd){var _0xf1fbc9=typeof _0x310f96[_0x244a('0x21')]===_0x244a('0x22')&&typeof _0x310f96['limit']==='undefined';var _0x8d566f=_0xdf06bd[_0x244a('0x23')];var _0x2ebf2d=_0xf1fbc9?0x0:_0x310f96[_0x244a('0x21')];var _0xffa97c=_0xf1fbc9?_0xdf06bd[_0x244a('0x23')]:_0x310f96['offset']+_0x310f96[_0x244a('0x24')];var _0xc1af20;if(_0xffa97c>=_0x8d566f){_0xffa97c=_0x8d566f;_0xc1af20=0xc8;}else{_0xc1af20=0xce;}_0x5826af[_0x244a('0x1f')](_0xc1af20);return _0x5826af[_0x244a('0x25')](_0x244a('0x26'),_0x2ebf2d+'-'+_0xffa97c+'/'+_0x8d566f)[_0x244a('0x27')](_0xdf06bd);}return null;};}function patchUpdates(_0x268249){return function(_0x4047d7){try{jsonpatch[_0x244a('0x28')](_0x4047d7,_0x268249,!![]);}catch(_0x35eaab){return BPromise[_0x244a('0x29')](_0x35eaab);}return _0x4047d7[_0x244a('0x2a')]();};}function saveUpdates(_0x42b4a9,_0x436630){return function(_0x17d54d){if(_0x17d54d){return _0x17d54d['update'](_0x42b4a9)[_0x244a('0x2b')](function(_0x2e0b2b){return _0x2e0b2b;});}return null;};}function removeEntity(_0x25aeaa,_0x2717e1){return function(_0xf3ce89){if(_0xf3ce89){return _0xf3ce89[_0x244a('0x2c')]()[_0x244a('0x2b')](function(){var _0x592b74=_0xf3ce89['get']({'plain':!![]});var _0x1c9b9a='Plugins';return db[_0x244a('0x2d')][_0x244a('0x2c')]({'where':{'type':_0x1c9b9a,'resourceId':_0x592b74['id']}})[_0x244a('0x2b')](function(){return _0xf3ce89;});})[_0x244a('0x2b')](function(){_0x25aeaa[_0x244a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x591ceb,_0x4143d1){return function(_0x4ae90e){if(!_0x4ae90e){_0x591ceb['sendStatus'](0x194);}return _0x4ae90e;};}function handleError(_0x4df7af,_0x2e7eaa){_0x2e7eaa=_0x2e7eaa||0x1f4;return function(_0x18647b){logger['error'](_0x18647b[_0x244a('0x2e')]);if(_0x18647b[_0x244a('0x2f')]){delete _0x18647b[_0x244a('0x2f')];}_0x4df7af[_0x244a('0x1f')](_0x2e7eaa)[_0x244a('0x30')](_0x18647b);};}exports['index']=function(_0x134ab8,_0x34d1f1){var _0x448eb8={},_0x4668cc={},_0x54282f={'count':0x0,'rows':[]};var _0xf1400f=_['map'](db[_0x244a('0x31')][_0x244a('0x32')],function(_0x2e5299){return{'name':_0x2e5299[_0x244a('0x33')],'type':_0x2e5299[_0x244a('0x34')][_0x244a('0x35')]};});_0x4668cc[_0x244a('0x36')]=_['map'](_0xf1400f,_0x244a('0x2f'));_0x4668cc[_0x244a('0x37')]=_['keys'](_0x134ab8[_0x244a('0x37')]);_0x4668cc[_0x244a('0x38')]=_[_0x244a('0x39')](_0x4668cc['model'],_0x4668cc['query']);_0x448eb8[_0x244a('0x3a')]=_[_0x244a('0x39')](_0x4668cc[_0x244a('0x36')],qs[_0x244a('0x3b')](_0x134ab8[_0x244a('0x37')]['fields']));_0x448eb8[_0x244a('0x3a')]=_0x448eb8[_0x244a('0x3a')][_0x244a('0x3c')]?_0x448eb8[_0x244a('0x3a')]:_0x4668cc['model'];if(!_0x134ab8[_0x244a('0x37')][_0x244a('0x3d')](_0x244a('0x3e'))){_0x448eb8[_0x244a('0x24')]=qs[_0x244a('0x24')](_0x134ab8[_0x244a('0x37')]['limit']);_0x448eb8[_0x244a('0x21')]=qs[_0x244a('0x21')](_0x134ab8[_0x244a('0x37')][_0x244a('0x21')]);}_0x448eb8[_0x244a('0x3f')]=qs['sort'](_0x134ab8[_0x244a('0x37')][_0x244a('0x40')]);_0x448eb8[_0x244a('0x41')]=qs[_0x244a('0x38')](_['pick'](_0x134ab8[_0x244a('0x37')],_0x4668cc[_0x244a('0x38')]),_0xf1400f);if(_0x134ab8[_0x244a('0x37')][_0x244a('0x42')]){_0x448eb8['where']=_[_0x244a('0x43')](_0x448eb8[_0x244a('0x41')],{'$or':_[_0x244a('0x44')](_0xf1400f,function(_0x28e7a8){if(_0x28e7a8['type']!==_0x244a('0x45')){var _0x3c5ccf={};_0x3c5ccf[_0x28e7a8[_0x244a('0x2f')]]={'$like':'%'+_0x134ab8[_0x244a('0x37')][_0x244a('0x42')]+'%'};return _0x3c5ccf;}})});}_0x448eb8=_[_0x244a('0x43')]({},_0x448eb8,_0x134ab8[_0x244a('0x46')]);var _0x3413b4={'where':_0x448eb8[_0x244a('0x41')]};return db[_0x244a('0x31')][_0x244a('0x23')](_0x3413b4)[_0x244a('0x2b')](function(_0xa372b2){_0x54282f[_0x244a('0x23')]=_0xa372b2;if(_0x134ab8[_0x244a('0x37')]['includeAll']){_0x448eb8[_0x244a('0x47')]=[{'all':!![]}];}return db[_0x244a('0x31')]['findAll'](_0x448eb8);})[_0x244a('0x2b')](function(_0x27e4aa){_0x54282f[_0x244a('0x48')]=_0x27e4aa;return _0x54282f;})[_0x244a('0x2b')](respondWithFilteredResult(_0x34d1f1,_0x448eb8))[_0x244a('0x49')](handleError(_0x34d1f1,null));};exports[_0x244a('0x4a')]=function(_0x3c6d9f,_0xccced1){var _0x17cd19={'raw':!![],'where':{'id':_0x3c6d9f[_0x244a('0x4b')]['id']}},_0x13d71c={};_0x13d71c[_0x244a('0x36')]=_[_0x244a('0x4c')](db[_0x244a('0x31')]['rawAttributes']);_0x13d71c[_0x244a('0x37')]=_[_0x244a('0x4c')](_0x3c6d9f['query']);_0x13d71c[_0x244a('0x38')]=_['intersection'](_0x13d71c['model'],_0x13d71c[_0x244a('0x37')]);_0x17cd19[_0x244a('0x3a')]=_['intersection'](_0x13d71c['model'],qs[_0x244a('0x3b')](_0x3c6d9f[_0x244a('0x37')]['fields']));_0x17cd19[_0x244a('0x3a')]=_0x17cd19[_0x244a('0x3a')][_0x244a('0x3c')]?_0x17cd19['attributes']:_0x13d71c[_0x244a('0x36')];if(_0x3c6d9f[_0x244a('0x37')][_0x244a('0x4d')]){_0x17cd19[_0x244a('0x47')]=[{'all':!![]}];}_0x17cd19=_[_0x244a('0x43')]({},_0x17cd19,_0x3c6d9f[_0x244a('0x46')]);return db[_0x244a('0x31')][_0x244a('0x4e')](_0x17cd19)[_0x244a('0x2b')](handleEntityNotFound(_0xccced1,null))[_0x244a('0x2b')](respondWithResult(_0xccced1,null))[_0x244a('0x49')](handleError(_0xccced1,null));};exports[_0x244a('0x4f')]=function(_0x1f87e0,_0x19dd44,_0x4605f4){return db[_0x244a('0x31')][_0x244a('0x4e')]({'where':{'id':_0x1f87e0[_0x244a('0x4b')]['id']},'attributes':[_0x244a('0x2f'),_0x244a('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x19dd44,null))['then'](function(_0x1abec6){if(_0x1abec6){var _0x5ba6c2=path['join'](config[_0x244a('0x50')],_0x244a('0x51'),util[_0x244a('0x52')](_0x244a('0x53'),path[_0x244a('0x54')](_0x1abec6[_0x244a('0x5')])));var _0xd46ac5=fs['createWriteStream'](_0x5ba6c2);var _0x56cb01=archiver('zip',{'zlib':{'level':0x9}});_0x56cb01['on'](_0x244a('0x55'),function(_0x1a72c6){if(_0x1a72c6[_0x244a('0x56')]===_0x244a('0x57')){logger['error'](_0x1a72c6);}else{throw new db[(_0x244a('0x58'))][(_0x244a('0x59'))](_0x244a('0x5a'));}});_0x56cb01['on'](_0x244a('0x5b'),function(_0x5affa9){throw new db[(_0x244a('0x58'))][(_0x244a('0x59'))](_0x244a('0x5a'));});_0x56cb01[_0x244a('0x5c')](_0xd46ac5);_0x56cb01['glob'](_0x244a('0x5d'),{'cwd':path[_0x244a('0x5e')](config[_0x244a('0x50')],_0x244a('0x51'),path[_0x244a('0x5f')](_0x1abec6[_0x244a('0x5')])),'ignore':[path[_0x244a('0x5e')](path[_0x244a('0x54')](_0x1abec6[_0x244a('0x5')]),_0x244a('0x60')),path['join'](path[_0x244a('0x54')](_0x1abec6[_0x244a('0x5')]),_0x244a('0x61'))],'nodir':!![]})[_0x244a('0x62')]();_0xd46ac5['on'](_0x244a('0x63'),function(){if(!fs[_0x244a('0x64')](_0x5ba6c2)){throw new db['Sequelize'][(_0x244a('0x59'))](_0x244a('0x65'));}return _0x19dd44[_0x244a('0x4f')](_0x5ba6c2,util[_0x244a('0x52')](_0x244a('0x53'),path[_0x244a('0x54')](_0x1abec6[_0x244a('0x5')])),function(_0x10540d){if(_0x10540d){throw new db[(_0x244a('0x58'))][(_0x244a('0x59'))](_0x244a('0x66'));}fs[_0x244a('0x67')](_0x5ba6c2);logger['info']('Download\x20completed');logger[_0x244a('0x68')]('Temporary\x20file\x20removed');});});}return null;})[_0x244a('0x49')](handleError(_0x19dd44,null));};exports['upload']=function(_0x252a4d,_0x529701,_0x42d5e8){var _0x126ff4=path[_0x244a('0x54')](_0x252a4d[_0x244a('0x69')][_0x244a('0x6a')],path[_0x244a('0x6b')](_0x252a4d[_0x244a('0x69')][_0x244a('0x6a')]));var _0x5eb529=path['join'](config[_0x244a('0x50')],_0x244a('0x51'),_0x252a4d[_0x244a('0x69')][_0x244a('0x6a')]);var _0x59f29b=path[_0x244a('0x5e')](config[_0x244a('0x50')],_0x244a('0x51'),_0x126ff4);logger[_0x244a('0x68')](_0x244a('0x6c'),_0x5eb529);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x59f29b);try{fs['chmodSync'](_0x5eb529,parseInt('0777',0x8));extract(_0x5eb529,{'dir':_0x59f29b},function(_0x113d0a){if(_0x113d0a){logger[_0x244a('0x5b')](_0x113d0a);handleError(_0x113d0a,!![]);};var _0x559927=fs[_0x244a('0x6d')](_0x59f29b);if(_0x559927[_0x244a('0x3c')]>0x1){removeReferences(_0x5eb529,_0x59f29b);logger[_0x244a('0x5b')](_0x244a('0x6e'));return _0x42d5e8(new Error(_0x244a('0x6e')));}var _0x5e8c8b=fs[_0x244a('0x6f')](path[_0x244a('0x5e')](_0x59f29b,_0x559927[0x0]));if(_0x5e8c8b[_0x244a('0x70')]()){removeReferences(_0x5eb529,_0x59f29b);logger[_0x244a('0x5b')](_0x244a('0x6e'));return _0x42d5e8(new Error('Invalid\x20plugin\x20structure'));}if(_0x5e8c8b[_0x244a('0x71')]()){var _0x5e9793=fs['readdirSync'](path[_0x244a('0x5e')](_0x59f29b,_0x559927[0x0]));if(_0x5e9793['length']===0x0){removeReferences(_0x5eb529,_0x59f29b);logger[_0x244a('0x5b')]('Invalid\x20plugin\x20structure');return _0x42d5e8(new Error(_0x244a('0x6e')));}var _0x4fbec5=_0x5e9793[_0x244a('0x72')](function(_0x16039a){return _0x16039a===_0x244a('0x73');});if(!_0x4fbec5){return _0x42d5e8(new Error(_0x244a('0x74')));}var _0x4bb4ac=fs[_0x244a('0x75')](path[_0x244a('0x5e')](_0x59f29b,_0x559927[0x0],_0x244a('0x73')));var _0x11faa2=JSON[_0x244a('0x76')](_0x4bb4ac);if(_0x244a('0x22')==typeof _0x11faa2[_0x244a('0x2f')]){return _0x42d5e8(new Error(_0x244a('0x77')));}if(_0x244a('0x22')==typeof _0x11faa2[_0x244a('0x34')]){return _0x42d5e8(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x11faa2[_0x244a('0x78')]){return _0x42d5e8(new Error(_0x244a('0x79')));}if('undefined'==typeof _0x11faa2[_0x244a('0x7a')]){return _0x42d5e8(new Error(_0x244a('0x7b')));}if(_0x11faa2[_0x244a('0x34')]===_0x244a('0x7c')){if('undefined'==typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')]){return _0x42d5e8(new Error(_0x244a('0x7e')));}if(_0x244a('0x22')==typeof _0x11faa2[_0x244a('0x7a')]['views'][_0x244a('0x7f')]&&_0x244a('0x22')==typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')][_0x244a('0x80')]){return _0x42d5e8(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x11faa2[_0x244a('0x34')]==='script'){if('undefined'==typeof _0x11faa2[_0x244a('0x7a')]['scriptName']){return _0x42d5e8(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x244a('0x22')==typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x81')]){return _0x42d5e8(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x42d5e8(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x35b4a0=_0x11faa2['name'];var _0x560d4a=_0x11faa2['description'];var _0x5c53dd=_0x11faa2[_0x244a('0x34')];var _0x22492e=_0x11faa2[_0x244a('0x82')]?_0x11faa2[_0x244a('0x82')]:_0x244a('0x83');var _0x5994a1=_0x11faa2['icon']?_0x11faa2[_0x244a('0x84')]:_0x244a('0x85');var _0x17919b='';var _0x4e6e2e='';var _0x372d84='';var _0x5db8fd='';var _0x1affdb=_0x11faa2[_0x244a('0x78')];if(_0x5c53dd==='html'){if(_0x244a('0x22')!=typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')]['admin']){var _0x512285=_0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')][_0x244a('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x244a('0x86')](_0x512285)){_0x17919b=path[_0x244a('0x5e')](_0x244a('0x87'),_0x126ff4,_0x559927[0x0],_0x512285);}else{_0x17919b=_0x512285;}}else{logger[_0x244a('0x68')](_0x244a('0x88'));}if(_0x244a('0x22')!=typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')][_0x244a('0x80')]){var _0x15c59e=_0x11faa2['parameters'][_0x244a('0x7d')][_0x244a('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x244a('0x86')](_0x15c59e)){_0x4e6e2e=path[_0x244a('0x5e')](_0x244a('0x87'),_0x126ff4,_0x559927[0x0],_0x15c59e);}else{_0x4e6e2e=_0x15c59e;}}else{logger[_0x244a('0x68')](_0x244a('0x89'));}}else if(_0x5c53dd===_0x244a('0x8a')){_0x372d84=_0x11faa2['parameters']['scriptName'];_0x5db8fd=_0x11faa2[_0x244a('0x7a')][_0x244a('0x81')];if('undefined'!=typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')]){if(_0x244a('0x22')!=typeof _0x11faa2['parameters'][_0x244a('0x7d')][_0x244a('0x7f')]){var _0x512285=_0x11faa2[_0x244a('0x7a')]['views'][_0x244a('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x244a('0x86')](_0x512285)){_0x17919b=path[_0x244a('0x5e')](_0x244a('0x87'),_0x126ff4,_0x559927[0x0],_0x512285);}else{_0x17919b=_0x512285;}}if('undefined'!=typeof _0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')][_0x244a('0x80')]){var _0x15c59e=_0x11faa2[_0x244a('0x7a')][_0x244a('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x15c59e)){_0x4e6e2e=path['join'](_0x244a('0x87'),_0x126ff4,_0x559927[0x0],_0x15c59e);}else{_0x4e6e2e=_0x15c59e;}}}}var _0x368559={'name':_0x35b4a0,'description':_0x560d4a,'path':path[_0x244a('0x5e')](_0x126ff4,_0x559927[0x0]),'type':_0x5c53dd,'sidebar':_0x22492e,'icon':_0x5994a1,'adminUrl':_0x17919b,'agentUrl':_0x4e6e2e,'scriptName':_0x372d84,'scriptPath':_0x5db8fd,'version':_0x1affdb};removeReferences(_0x5eb529,null);return db[_0x244a('0x31')][_0x244a('0x8b')](_0x368559)[_0x244a('0x2b')](function(_0xceb069){var _0x3e455e={'role':_0x252a4d[_0x244a('0x8c')][_0x244a('0x8d')],'userProfileId':_0x252a4d['body']['userProfileId']};if(!_0x3e455e)throw new Error(_0x244a('0x8e'));if(_0x3e455e[_0x244a('0x8d')]==='user'){var _0x3cf90f=_0xceb069[_0x244a('0x8f')]({'plain':!![]});return db[_0x244a('0x90')][_0x244a('0x4e')]({'where':{'name':'Plugins','userProfileId':_0x3e455e[_0x244a('0x91')]},'raw':!![]})['then'](function(_0x81958c){if(_0x81958c&&_0x81958c['autoAssociation']===0x0){return db['UserProfileResource'][_0x244a('0x8b')]({'name':_0x3cf90f['name'],'resourceId':_0x3cf90f['id'],'type':_0x81958c[_0x244a('0x2f')],'sectionId':_0x81958c['id']},{})[_0x244a('0x2b')](function(){return _0xceb069;});}else{return _0xceb069;}})['catch'](function(_0x2a3355){logger[_0x244a('0x5b')](_0x244a('0x92'),_0x2a3355);throw _0x2a3355;});}return _0xceb069;})[_0x244a('0x2b')](respondWithResult(_0x529701,null))['catch'](handleError(_0x529701,null));}});}catch(_0xf160f6){_0x529701['status'](0x1f4)[_0x244a('0x30')](_0xf160f6);}};function removeReferences(_0x5a353c,_0x7d2130){try{if(_0x5a353c){fs['unlinkSync'](_0x5a353c);logger['info'](_0x244a('0x93'));}if(_0x7d2130){rimraf(_0x7d2130,function(){});logger[_0x244a('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x263aa0){logger[_0x244a('0x5b')](_0x263aa0);}}exports[_0x244a('0x94')]=function(_0x19ed65,_0x5f4786,_0x9bbbdc){return db[_0x244a('0x31')]['find']({'where':{'id':_0x19ed65[_0x244a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5f4786,null))[_0x244a('0x2b')](saveUpdates(_0x19ed65['body'],null))['then'](respondWithResult(_0x5f4786,null))[_0x244a('0x49')](handleError(_0x5f4786,null));};exports[_0x244a('0x95')]=function(_0x17c123,_0x46ff94,_0x5561d9){return db[_0x244a('0x31')]['find']({'where':{'id':_0x17c123[_0x244a('0x4b')]['id']}})[_0x244a('0x2b')](function(_0x5bb77a){if(_0x5bb77a){return _0x5bb77a['destroy']();}})[_0x244a('0x2b')](function(_0x262ea6){rimraf(path[_0x244a('0x5e')](config[_0x244a('0x50')],'server/files/plugins',path[_0x244a('0x5f')](_0x262ea6[_0x244a('0x5')])),function(){});return _0x262ea6;})[_0x244a('0x2b')](handleEntityNotFound(_0x46ff94,null))[_0x244a('0x2b')](respondWithStatusCode(_0x46ff94,null))['catch'](handleError(_0x46ff94,null));};exports['webhookGet']=function(_0x1a4246,_0x5556ad,_0x3fb793){return BPromise[_0x244a('0x96')]()['then'](function(){if(!_0x1a4246[_0x244a('0x37')][_0x244a('0x5')]){throw new Error(_0x244a('0x97'));}if(!_0x1a4246[_0x244a('0x37')][_0x244a('0x98')]){throw new Error(_0x244a('0x99'));}var _0x4efe8d=_0x1a4246['query'][_0x244a('0x9a')]?_0x1a4246[_0x244a('0x37')][_0x244a('0x9a')]+':'+_0x1a4246[_0x244a('0x37')]['port']:_0x244a('0x9b')+_0x1a4246[_0x244a('0x37')][_0x244a('0x98')];var _0x9b60ee=_0x1a4246[_0x244a('0x37')][_0x244a('0x27')]?_0x1a4246[_0x244a('0x37')]['json']:!![];var _0xaa19c5=_0x1a4246[_0x244a('0x37')]['encoding']?_0x1a4246[_0x244a('0x37')][_0x244a('0x9c')]:null;var _0x40e07d={'method':_0x1a4246['method'],'uri':util[_0x244a('0x52')](_0x244a('0x9d'),_0x4efe8d,_0x1a4246['query']['path']),'json':_0x9b60ee,'resolveWithFullResponse':!![],'encoding':_0xaa19c5,'qs':_0x1a4246['query']};if(_0x1a4246['headers']){_0x40e07d[_0x244a('0x9e')]=_0x1a4246[_0x244a('0x9e')];if(_0x40e07d['headers'][_0x244a('0x9f')]){delete _0x40e07d['headers'][_0x244a('0x9f')];}}if(_0x40e07d[_0x244a('0x9e')][_0x244a('0xa0')]){delete _0x40e07d[_0x244a('0x9e')]['content-type'];}return rp(_0x40e07d);})[_0x244a('0x2b')](function(_0x161799){if(_0x161799){_0x5556ad[_0x244a('0x25')](_0x161799['headers']);logger[_0x244a('0x68')](_0x161799['body']);if(_[_0x244a('0xa1')](_0x1a4246[_0x244a('0x37')][_0x244a('0x5')],'download')&&_0x161799[_0x244a('0xa2')]==0x1f4){return _0x5556ad[_0x244a('0x1e')](_0x161799['statusCode']);}else{return _0x5556ad['status'](_0x161799['statusCode'])[_0x244a('0x30')](_0x161799[_0x244a('0x8c')]);}}else{return _0x5556ad[_0x244a('0x1e')](0xc8);}})[_0x244a('0x49')](handleError(_0x5556ad,null));};exports[_0x244a('0xa3')]=function(_0x284be4,_0x1d3a26,_0x46f2a8){return BPromise[_0x244a('0x96')]()[_0x244a('0x2b')](function(){if(!_0x284be4[_0x244a('0x37')][_0x244a('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x284be4['query'][_0x244a('0x98')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x154c6a=_0x284be4[_0x244a('0x37')]['hostname']?_0x284be4['query'][_0x244a('0x9a')]+':'+_0x284be4[_0x244a('0x37')]['port']:'http://localhost:'+_0x284be4[_0x244a('0x37')][_0x244a('0x98')];var _0x14742f=_0x284be4[_0x244a('0x37')][_0x244a('0x27')]?_0x284be4[_0x244a('0x37')]['json']:!![];var _0x499b67=_0x284be4[_0x244a('0x37')][_0x244a('0x9c')]?_0x284be4[_0x244a('0x37')][_0x244a('0x9c')]:null;var _0x18285e={'method':_0x284be4[_0x244a('0xa4')],'uri':util[_0x244a('0x52')](_0x244a('0x9d'),_0x154c6a,_0x284be4[_0x244a('0x37')][_0x244a('0x5')]),'json':_0x14742f,'resolveWithFullResponse':!![],'encoding':_0x499b67,'body':_0x284be4[_0x244a('0x8c')]};if(_0x284be4[_0x244a('0x9e')]){_0x18285e['headers']=_0x284be4['headers'];if(_0x18285e[_0x244a('0x9e')][_0x244a('0x9f')]){delete _0x18285e[_0x244a('0x9e')][_0x244a('0x9f')];}}if(_0x18285e[_0x244a('0x9e')][_0x244a('0xa0')]){delete _0x18285e[_0x244a('0x9e')][_0x244a('0xa0')];}return rp(_0x18285e);})[_0x244a('0x2b')](function(_0x45e073){if(_0x45e073){_0x1d3a26[_0x244a('0x25')](_0x45e073[_0x244a('0x9e')]);logger[_0x244a('0x68')](_0x45e073[_0x244a('0x8c')]);return _0x1d3a26['status'](_0x45e073[_0x244a('0xa2')])['send'](_0x45e073['body']);}else{return _0x1d3a26[_0x244a('0x1e')](0xc8);}})[_0x244a('0x49')](handleError(_0x1d3a26,null));}; \ No newline at end of file +var _0xb7e0=['content-type','endsWith','statusCode','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length'];(function(_0x40b570,_0x284e18){var _0x5b5f8a=function(_0xeabebf){while(--_0xeabebf){_0x40b570['push'](_0x40b570['shift']());}};_0x5b5f8a(++_0x284e18);}(_0xb7e0,0x160));var _0x0b7e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb7e0[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x0b7e('0x0'));var rimraf=require(_0x0b7e('0x1'));var zipdir=require(_0x0b7e('0x2'));var jsonpatch=require(_0x0b7e('0x3'));var rp=require(_0x0b7e('0x4'));var moment=require(_0x0b7e('0x5'));var BPromise=require(_0x0b7e('0x6'));var Mustache=require('mustache');var util=require(_0x0b7e('0x7'));var path=require('path');var sox=require(_0x0b7e('0x8'));var csv=require(_0x0b7e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b7e('0xa'));var _=require(_0x0b7e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0b7e('0xc'));var deskjs=require(_0x0b7e('0xd'));var toCsv=require(_0x0b7e('0x9'));var querystring=require(_0x0b7e('0xe'));var Papa=require(_0x0b7e('0xf'));var extract=require(_0x0b7e('0x10'));var rimraf=require(_0x0b7e('0x1'));var archiver=require(_0x0b7e('0x11'));var Redis=require('ioredis');var authService=require(_0x0b7e('0x12'));var qs=require(_0x0b7e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b7e('0x14'));var logger=require(_0x0b7e('0x15'))('api');var utils=require(_0x0b7e('0x16'));var config=require(_0x0b7e('0x17'));var licenseUtil=require(_0x0b7e('0x18'));var db=require(_0x0b7e('0x19'))['db'];config[_0x0b7e('0x1a')]=_['defaults'](config[_0x0b7e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b7e('0x1b'))(new Redis(config['redis']));require(_0x0b7e('0x1c'))['register'](socket);function respondWithStatusCode(_0x10806f,_0x578b38){_0x578b38=_0x578b38||0xcc;return function(_0x1b7fe7){if(_0x1b7fe7){return _0x10806f[_0x0b7e('0x1d')](_0x578b38);}return _0x10806f['status'](_0x578b38)[_0x0b7e('0x1e')]();};}function respondWithResult(_0x169e8c,_0xf8fcb1){_0xf8fcb1=_0xf8fcb1||0xc8;return function(_0x2cbfe5){if(_0x2cbfe5){return _0x169e8c[_0x0b7e('0x1f')](_0xf8fcb1)[_0x0b7e('0x20')](_0x2cbfe5);}};}function respondWithFilteredResult(_0x26cef6,_0x476917){return function(_0x37eae8){if(_0x37eae8){var _0x46ec94=typeof _0x476917[_0x0b7e('0x21')]===_0x0b7e('0x22')&&typeof _0x476917[_0x0b7e('0x23')]===_0x0b7e('0x22');var _0x3fb7ef=_0x37eae8[_0x0b7e('0x24')];var _0x4c5a14=_0x46ec94?0x0:_0x476917[_0x0b7e('0x21')];var _0x255212=_0x46ec94?_0x37eae8['count']:_0x476917[_0x0b7e('0x21')]+_0x476917[_0x0b7e('0x23')];var _0x3b9468;if(_0x255212>=_0x3fb7ef){_0x255212=_0x3fb7ef;_0x3b9468=0xc8;}else{_0x3b9468=0xce;}_0x26cef6[_0x0b7e('0x1f')](_0x3b9468);return _0x26cef6[_0x0b7e('0x25')](_0x0b7e('0x26'),_0x4c5a14+'-'+_0x255212+'/'+_0x3fb7ef)[_0x0b7e('0x20')](_0x37eae8);}return null;};}function patchUpdates(_0x1c3a59){return function(_0x36b61b){try{jsonpatch[_0x0b7e('0x27')](_0x36b61b,_0x1c3a59,!![]);}catch(_0x581c9c){return BPromise['reject'](_0x581c9c);}return _0x36b61b[_0x0b7e('0x28')]();};}function saveUpdates(_0x39eea2,_0x3643ac){return function(_0x1e8c11){if(_0x1e8c11){return _0x1e8c11[_0x0b7e('0x29')](_0x39eea2)[_0x0b7e('0x2a')](function(_0x248f3d){return _0x248f3d;});}return null;};}function removeEntity(_0x34d9ea,_0x1ec261){return function(_0x279baa){if(_0x279baa){return _0x279baa[_0x0b7e('0x2b')]()[_0x0b7e('0x2a')](function(){var _0x1b312b=_0x279baa[_0x0b7e('0x2c')]({'plain':!![]});var _0x1f8c86=_0x0b7e('0x2d');return db[_0x0b7e('0x2e')]['destroy']({'where':{'type':_0x1f8c86,'resourceId':_0x1b312b['id']}})[_0x0b7e('0x2a')](function(){return _0x279baa;});})[_0x0b7e('0x2a')](function(){_0x34d9ea[_0x0b7e('0x1f')](0xcc)[_0x0b7e('0x1e')]();});}};}function handleEntityNotFound(_0x364ec3,_0x917dad){return function(_0x3fb7b9){if(!_0x3fb7b9){_0x364ec3['sendStatus'](0x194);}return _0x3fb7b9;};}function handleError(_0x4b52df,_0x4b9a07){_0x4b9a07=_0x4b9a07||0x1f4;return function(_0x32667f){logger[_0x0b7e('0x2f')](_0x32667f[_0x0b7e('0x30')]);if(_0x32667f[_0x0b7e('0x31')]){delete _0x32667f[_0x0b7e('0x31')];}_0x4b52df[_0x0b7e('0x1f')](_0x4b9a07)[_0x0b7e('0x32')](_0x32667f);};}exports[_0x0b7e('0x33')]=function(_0x20843b,_0x5bb9be){var _0x3a1f37={},_0x162b5e={},_0x46ca5c={'count':0x0,'rows':[]};var _0x188153=_[_0x0b7e('0x34')](db[_0x0b7e('0x35')]['rawAttributes'],function(_0x1c1685){return{'name':_0x1c1685[_0x0b7e('0x36')],'type':_0x1c1685[_0x0b7e('0x37')]['key']};});_0x162b5e[_0x0b7e('0x38')]=_[_0x0b7e('0x34')](_0x188153,_0x0b7e('0x31'));_0x162b5e[_0x0b7e('0x39')]=_['keys'](_0x20843b[_0x0b7e('0x39')]);_0x162b5e[_0x0b7e('0x3a')]=_[_0x0b7e('0x3b')](_0x162b5e[_0x0b7e('0x38')],_0x162b5e[_0x0b7e('0x39')]);_0x3a1f37[_0x0b7e('0x3c')]=_[_0x0b7e('0x3b')](_0x162b5e[_0x0b7e('0x38')],qs['fields'](_0x20843b[_0x0b7e('0x39')][_0x0b7e('0x3d')]));_0x3a1f37[_0x0b7e('0x3c')]=_0x3a1f37[_0x0b7e('0x3c')][_0x0b7e('0x3e')]?_0x3a1f37[_0x0b7e('0x3c')]:_0x162b5e[_0x0b7e('0x38')];if(!_0x20843b[_0x0b7e('0x39')]['hasOwnProperty']('nolimit')){_0x3a1f37[_0x0b7e('0x23')]=qs[_0x0b7e('0x23')](_0x20843b[_0x0b7e('0x39')][_0x0b7e('0x23')]);_0x3a1f37['offset']=qs[_0x0b7e('0x21')](_0x20843b['query'][_0x0b7e('0x21')]);}_0x3a1f37[_0x0b7e('0x3f')]=qs[_0x0b7e('0x40')](_0x20843b['query'][_0x0b7e('0x40')]);_0x3a1f37[_0x0b7e('0x41')]=qs[_0x0b7e('0x3a')](_['pick'](_0x20843b['query'],_0x162b5e['filters']),_0x188153);if(_0x20843b['query']['filter']){_0x3a1f37['where']=_[_0x0b7e('0x42')](_0x3a1f37['where'],{'$or':_[_0x0b7e('0x34')](_0x188153,function(_0x24d31a){if(_0x24d31a[_0x0b7e('0x37')]!==_0x0b7e('0x43')){var _0x280348={};_0x280348[_0x24d31a[_0x0b7e('0x31')]]={'$like':'%'+_0x20843b[_0x0b7e('0x39')][_0x0b7e('0x44')]+'%'};return _0x280348;}})});}_0x3a1f37=_[_0x0b7e('0x42')]({},_0x3a1f37,_0x20843b[_0x0b7e('0x45')]);var _0x17741b={'where':_0x3a1f37[_0x0b7e('0x41')]};return db[_0x0b7e('0x35')][_0x0b7e('0x24')](_0x17741b)[_0x0b7e('0x2a')](function(_0x3bbaa7){_0x46ca5c[_0x0b7e('0x24')]=_0x3bbaa7;if(_0x20843b[_0x0b7e('0x39')][_0x0b7e('0x46')]){_0x3a1f37[_0x0b7e('0x47')]=[{'all':!![]}];}return db['Plugin'][_0x0b7e('0x48')](_0x3a1f37);})['then'](function(_0x1135c9){_0x46ca5c[_0x0b7e('0x49')]=_0x1135c9;return _0x46ca5c;})[_0x0b7e('0x2a')](respondWithFilteredResult(_0x5bb9be,_0x3a1f37))[_0x0b7e('0x4a')](handleError(_0x5bb9be,null));};exports[_0x0b7e('0x4b')]=function(_0x1abdcb,_0x27f3ad){var _0x5457f8={'raw':!![],'where':{'id':_0x1abdcb[_0x0b7e('0x4c')]['id']}},_0x30fd96={};_0x30fd96['model']=_[_0x0b7e('0x4d')](db[_0x0b7e('0x35')][_0x0b7e('0x4e')]);_0x30fd96[_0x0b7e('0x39')]=_[_0x0b7e('0x4d')](_0x1abdcb[_0x0b7e('0x39')]);_0x30fd96[_0x0b7e('0x3a')]=_[_0x0b7e('0x3b')](_0x30fd96['model'],_0x30fd96[_0x0b7e('0x39')]);_0x5457f8[_0x0b7e('0x3c')]=_['intersection'](_0x30fd96[_0x0b7e('0x38')],qs[_0x0b7e('0x3d')](_0x1abdcb[_0x0b7e('0x39')][_0x0b7e('0x3d')]));_0x5457f8[_0x0b7e('0x3c')]=_0x5457f8[_0x0b7e('0x3c')][_0x0b7e('0x3e')]?_0x5457f8['attributes']:_0x30fd96['model'];if(_0x1abdcb[_0x0b7e('0x39')][_0x0b7e('0x46')]){_0x5457f8[_0x0b7e('0x47')]=[{'all':!![]}];}_0x5457f8=_[_0x0b7e('0x42')]({},_0x5457f8,_0x1abdcb[_0x0b7e('0x45')]);return db[_0x0b7e('0x35')]['find'](_0x5457f8)['then'](handleEntityNotFound(_0x27f3ad,null))[_0x0b7e('0x2a')](respondWithResult(_0x27f3ad,null))[_0x0b7e('0x4a')](handleError(_0x27f3ad,null));};exports['download']=function(_0x5ae69c,_0x3fea3c,_0x5ead84){return db[_0x0b7e('0x35')][_0x0b7e('0x4f')]({'where':{'id':_0x5ae69c['params']['id']},'attributes':[_0x0b7e('0x31'),_0x0b7e('0x50')],'raw':!![]})[_0x0b7e('0x2a')](handleEntityNotFound(_0x3fea3c,null))[_0x0b7e('0x2a')](function(_0x420c3f){if(_0x420c3f){var _0x35dc51=path[_0x0b7e('0x51')](config[_0x0b7e('0x52')],_0x0b7e('0x53'),util[_0x0b7e('0x54')](_0x0b7e('0x55'),path[_0x0b7e('0x56')](_0x420c3f[_0x0b7e('0x50')])));var _0x4d209a=fs[_0x0b7e('0x57')](_0x35dc51);var _0x540ba0=archiver(_0x0b7e('0x58'),{'zlib':{'level':0x9}});_0x540ba0['on'](_0x0b7e('0x59'),function(_0x43dcd2){if(_0x43dcd2['code']===_0x0b7e('0x5a')){logger[_0x0b7e('0x2f')](_0x43dcd2);}else{throw new db[(_0x0b7e('0x5b'))][(_0x0b7e('0x5c'))](_0x0b7e('0x5d'));}});_0x540ba0['on'](_0x0b7e('0x2f'),function(_0x9e925b){throw new db['Sequelize']['Error'](_0x0b7e('0x5d'));});_0x540ba0[_0x0b7e('0x5e')](_0x4d209a);_0x540ba0[_0x0b7e('0x5f')](_0x0b7e('0x60'),{'cwd':path[_0x0b7e('0x51')](config['root'],'server/files/plugins',path[_0x0b7e('0x61')](_0x420c3f[_0x0b7e('0x50')])),'ignore':[path[_0x0b7e('0x51')](path[_0x0b7e('0x56')](_0x420c3f['path']),_0x0b7e('0x62')),path['join'](path[_0x0b7e('0x56')](_0x420c3f[_0x0b7e('0x50')]),_0x0b7e('0x63'))],'nodir':!![]})[_0x0b7e('0x64')]();_0x4d209a['on'](_0x0b7e('0x65'),function(){if(!fs[_0x0b7e('0x66')](_0x35dc51)){throw new db['Sequelize'][(_0x0b7e('0x5c'))](_0x0b7e('0x67'));}return _0x3fea3c[_0x0b7e('0x68')](_0x35dc51,util[_0x0b7e('0x54')](_0x0b7e('0x55'),path[_0x0b7e('0x56')](_0x420c3f[_0x0b7e('0x50')])),function(_0x453566){if(_0x453566){throw new db[(_0x0b7e('0x5b'))]['Error'](_0x0b7e('0x69'));}fs['unlinkSync'](_0x35dc51);logger[_0x0b7e('0x6a')](_0x0b7e('0x6b'));logger[_0x0b7e('0x6a')](_0x0b7e('0x6c'));});});}return null;})[_0x0b7e('0x4a')](handleError(_0x3fea3c,null));};exports[_0x0b7e('0x6d')]=function(_0x1105ed,_0x1c8836,_0x2f8451){var _0x39b90=path[_0x0b7e('0x56')](_0x1105ed[_0x0b7e('0x6e')][_0x0b7e('0x6f')],path[_0x0b7e('0x70')](_0x1105ed[_0x0b7e('0x6e')]['filename']));var _0x1b5a4c=path[_0x0b7e('0x51')](config[_0x0b7e('0x52')],_0x0b7e('0x53'),_0x1105ed[_0x0b7e('0x6e')][_0x0b7e('0x6f')]);var _0x31d170=path[_0x0b7e('0x51')](config[_0x0b7e('0x52')],_0x0b7e('0x53'),_0x39b90);logger[_0x0b7e('0x6a')](_0x0b7e('0x71'),_0x1b5a4c);logger[_0x0b7e('0x6a')]('Plugin\x20upload\x20destination:\x20%s',_0x31d170);try{fs[_0x0b7e('0x72')](_0x1b5a4c,parseInt(_0x0b7e('0x73'),0x8));extract(_0x1b5a4c,{'dir':_0x31d170},function(_0x5de450){if(_0x5de450){logger[_0x0b7e('0x2f')](_0x5de450);handleError(_0x5de450,!![]);};var _0x1d8bd8=fs[_0x0b7e('0x74')](_0x31d170);if(_0x1d8bd8[_0x0b7e('0x3e')]>0x1){removeReferences(_0x1b5a4c,_0x31d170);logger[_0x0b7e('0x2f')](_0x0b7e('0x75'));return _0x2f8451(new Error('Invalid\x20plugin\x20structure'));}var _0x56fcc6=fs['lstatSync'](path['join'](_0x31d170,_0x1d8bd8[0x0]));if(_0x56fcc6[_0x0b7e('0x76')]()){removeReferences(_0x1b5a4c,_0x31d170);logger[_0x0b7e('0x2f')](_0x0b7e('0x75'));return _0x2f8451(new Error('Invalid\x20plugin\x20structure'));}if(_0x56fcc6[_0x0b7e('0x77')]()){var _0x1ed4ee=fs[_0x0b7e('0x74')](path[_0x0b7e('0x51')](_0x31d170,_0x1d8bd8[0x0]));if(_0x1ed4ee[_0x0b7e('0x3e')]===0x0){removeReferences(_0x1b5a4c,_0x31d170);logger[_0x0b7e('0x2f')](_0x0b7e('0x75'));return _0x2f8451(new Error('Invalid\x20plugin\x20structure'));}var _0x2a5810=_0x1ed4ee[_0x0b7e('0x78')](function(_0x330250){return _0x330250===_0x0b7e('0x79');});if(!_0x2a5810){return _0x2f8451(new Error('Plugin\x20manifest\x20missing'));}var _0x5497d8=fs[_0x0b7e('0x7a')](path[_0x0b7e('0x51')](_0x31d170,_0x1d8bd8[0x0],'manifest.json'));var _0x4cf28f=JSON[_0x0b7e('0x7b')](_0x5497d8);if(_0x0b7e('0x22')==typeof _0x4cf28f[_0x0b7e('0x31')]){return _0x2f8451(new Error(_0x0b7e('0x7c')));}if(_0x0b7e('0x22')==typeof _0x4cf28f[_0x0b7e('0x37')]){return _0x2f8451(new Error(_0x0b7e('0x7d')));}if('undefined'==typeof _0x4cf28f[_0x0b7e('0x7e')]){return _0x2f8451(new Error(_0x0b7e('0x7f')));}if(_0x0b7e('0x22')==typeof _0x4cf28f[_0x0b7e('0x80')]){return _0x2f8451(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4cf28f['type']==='html'){if(_0x0b7e('0x22')==typeof _0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x81')]){return _0x2f8451(new Error(_0x0b7e('0x82')));}if('undefined'==typeof _0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x81')][_0x0b7e('0x83')]&&'undefined'==typeof _0x4cf28f['parameters'][_0x0b7e('0x81')][_0x0b7e('0x84')]){return _0x2f8451(new Error(_0x0b7e('0x85')));}}else if(_0x4cf28f['type']===_0x0b7e('0x86')){if(_0x0b7e('0x22')==typeof _0x4cf28f['parameters'][_0x0b7e('0x87')]){return _0x2f8451(new Error(_0x0b7e('0x88')));}if(_0x0b7e('0x22')==typeof _0x4cf28f[_0x0b7e('0x80')]['scriptPath']){return _0x2f8451(new Error(_0x0b7e('0x89')));}}else{return _0x2f8451(new Error(_0x0b7e('0x8a')));}var _0x4ce7c6=_0x4cf28f[_0x0b7e('0x31')];var _0x539f0a=_0x4cf28f[_0x0b7e('0x8b')];var _0x39bdf8=_0x4cf28f[_0x0b7e('0x37')];var _0x49f4f8=_0x4cf28f[_0x0b7e('0x8c')]?_0x4cf28f[_0x0b7e('0x8c')]:_0x0b7e('0x8d');var _0x3bd880=_0x4cf28f[_0x0b7e('0x8e')]?_0x4cf28f['icon']:_0x0b7e('0x8f');var _0x4035da='';var _0x415eef='';var _0x41e00f='';var _0x59d3f4='';var _0x1c0e0f=_0x4cf28f[_0x0b7e('0x7e')];if(_0x39bdf8==='html'){if(_0x0b7e('0x22')!=typeof _0x4cf28f['parameters'][_0x0b7e('0x81')][_0x0b7e('0x83')]){var _0x5010fc=_0x4cf28f['parameters']['views'][_0x0b7e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x0b7e('0x90')](_0x5010fc)){_0x4035da=path[_0x0b7e('0x51')](_0x0b7e('0x91'),_0x39b90,_0x1d8bd8[0x0],_0x5010fc);}else{_0x4035da=_0x5010fc;}}else{logger[_0x0b7e('0x6a')](_0x0b7e('0x92'));}if(_0x0b7e('0x22')!=typeof _0x4cf28f[_0x0b7e('0x80')]['views'][_0x0b7e('0x84')]){var _0x4b4aee=_0x4cf28f[_0x0b7e('0x80')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b4aee)){_0x415eef=path['join'](_0x0b7e('0x91'),_0x39b90,_0x1d8bd8[0x0],_0x4b4aee);}else{_0x415eef=_0x4b4aee;}}else{logger[_0x0b7e('0x6a')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x39bdf8==='script'){_0x41e00f=_0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x87')];_0x59d3f4=_0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x93')];if(_0x0b7e('0x22')!=typeof _0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x81')]){if(_0x0b7e('0x22')!=typeof _0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x81')][_0x0b7e('0x83')]){var _0x5010fc=_0x4cf28f[_0x0b7e('0x80')][_0x0b7e('0x81')][_0x0b7e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x0b7e('0x90')](_0x5010fc)){_0x4035da=path[_0x0b7e('0x51')](_0x0b7e('0x91'),_0x39b90,_0x1d8bd8[0x0],_0x5010fc);}else{_0x4035da=_0x5010fc;}}if('undefined'!=typeof _0x4cf28f['parameters'][_0x0b7e('0x81')][_0x0b7e('0x84')]){var _0x4b4aee=_0x4cf28f['parameters'][_0x0b7e('0x81')][_0x0b7e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x0b7e('0x90')](_0x4b4aee)){_0x415eef=path[_0x0b7e('0x51')](_0x0b7e('0x91'),_0x39b90,_0x1d8bd8[0x0],_0x4b4aee);}else{_0x415eef=_0x4b4aee;}}}}var _0x25c05f={'name':_0x4ce7c6,'description':_0x539f0a,'path':path[_0x0b7e('0x51')](_0x39b90,_0x1d8bd8[0x0]),'type':_0x39bdf8,'sidebar':_0x49f4f8,'icon':_0x3bd880,'adminUrl':_0x4035da,'agentUrl':_0x415eef,'scriptName':_0x41e00f,'scriptPath':_0x59d3f4,'version':_0x1c0e0f};removeReferences(_0x1b5a4c,null);return db[_0x0b7e('0x35')][_0x0b7e('0x94')](_0x25c05f)[_0x0b7e('0x2a')](function(_0x4fb1db){var _0x1c67d3={'role':_0x1105ed[_0x0b7e('0x95')][_0x0b7e('0x96')],'userProfileId':_0x1105ed['body'][_0x0b7e('0x97')]};if(!_0x1c67d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c67d3[_0x0b7e('0x96')]==='user'){var _0x1d33e8=_0x4fb1db['get']({'plain':!![]});return db[_0x0b7e('0x98')]['find']({'where':{'name':_0x0b7e('0x2d'),'userProfileId':_0x1c67d3['userProfileId']},'raw':!![]})['then'](function(_0x2d8d4f){if(_0x2d8d4f&&_0x2d8d4f[_0x0b7e('0x99')]===0x0){return db[_0x0b7e('0x2e')][_0x0b7e('0x94')]({'name':_0x1d33e8[_0x0b7e('0x31')],'resourceId':_0x1d33e8['id'],'type':_0x2d8d4f[_0x0b7e('0x31')],'sectionId':_0x2d8d4f['id']},{})[_0x0b7e('0x2a')](function(){return _0x4fb1db;});}else{return _0x4fb1db;}})[_0x0b7e('0x4a')](function(_0x2682b7){logger[_0x0b7e('0x2f')](_0x0b7e('0x9a'),_0x2682b7);throw _0x2682b7;});}return _0x4fb1db;})[_0x0b7e('0x2a')](respondWithResult(_0x1c8836,null))[_0x0b7e('0x4a')](handleError(_0x1c8836,null));}});}catch(_0x21b0d6){_0x1c8836[_0x0b7e('0x1f')](0x1f4)[_0x0b7e('0x32')](_0x21b0d6);}};function removeReferences(_0x2e5532,_0x1a9a01){try{if(_0x2e5532){fs[_0x0b7e('0x9b')](_0x2e5532);logger['info'](_0x0b7e('0x9c'));}if(_0x1a9a01){rimraf(_0x1a9a01,function(){});logger[_0x0b7e('0x6a')](_0x0b7e('0x9d'));}}catch(_0xa3594f){logger[_0x0b7e('0x2f')](_0xa3594f);}}exports[_0x0b7e('0x29')]=function(_0xe3ba74,_0x3587b3,_0x508c58){return db['Plugin']['find']({'where':{'id':_0xe3ba74[_0x0b7e('0x4c')]['id']}})[_0x0b7e('0x2a')](handleEntityNotFound(_0x3587b3,null))[_0x0b7e('0x2a')](saveUpdates(_0xe3ba74[_0x0b7e('0x95')],null))['then'](respondWithResult(_0x3587b3,null))[_0x0b7e('0x4a')](handleError(_0x3587b3,null));};exports[_0x0b7e('0x9e')]=function(_0x2eea05,_0x50bf4b,_0x32ecd9){return db[_0x0b7e('0x35')][_0x0b7e('0x4f')]({'where':{'id':_0x2eea05[_0x0b7e('0x4c')]['id']}})['then'](function(_0x343ca6){if(_0x343ca6){return _0x343ca6[_0x0b7e('0x2b')]();}})[_0x0b7e('0x2a')](function(_0x381b82){rimraf(path[_0x0b7e('0x51')](config['root'],_0x0b7e('0x53'),path[_0x0b7e('0x61')](_0x381b82[_0x0b7e('0x50')])),function(){});return _0x381b82;})[_0x0b7e('0x2a')](handleEntityNotFound(_0x50bf4b,null))[_0x0b7e('0x2a')](respondWithStatusCode(_0x50bf4b,null))[_0x0b7e('0x4a')](handleError(_0x50bf4b,null));};exports[_0x0b7e('0x9f')]=function(_0x260716,_0x4d6a34,_0x22e254){return BPromise[_0x0b7e('0xa0')]()[_0x0b7e('0x2a')](function(){if(!_0x260716[_0x0b7e('0x39')][_0x0b7e('0x50')]){throw new Error(_0x0b7e('0xa1'));}if(!_0x260716[_0x0b7e('0x39')]['port']){throw new Error(_0x0b7e('0xa2'));}var _0x5487fc=_0x260716[_0x0b7e('0x39')]['hostname']?_0x260716[_0x0b7e('0x39')][_0x0b7e('0xa3')]+':'+_0x260716[_0x0b7e('0x39')][_0x0b7e('0xa4')]:'http://localhost:'+_0x260716[_0x0b7e('0x39')][_0x0b7e('0xa4')];var _0x9bcfb3=_0x260716['query']['json']?_0x260716[_0x0b7e('0x39')][_0x0b7e('0x20')]:!![];var _0x33fd18=_0x260716[_0x0b7e('0x39')][_0x0b7e('0xa5')]?_0x260716[_0x0b7e('0x39')][_0x0b7e('0xa5')]:null;var _0x51ac5={'method':_0x260716[_0x0b7e('0xa6')],'uri':util['format'](_0x0b7e('0xa7'),_0x5487fc,_0x260716[_0x0b7e('0x39')]['path']),'json':_0x9bcfb3,'resolveWithFullResponse':!![],'encoding':_0x33fd18,'qs':_0x260716[_0x0b7e('0x39')]};if(_0x260716[_0x0b7e('0xa8')]){_0x51ac5[_0x0b7e('0xa8')]=_0x260716[_0x0b7e('0xa8')];if(_0x51ac5[_0x0b7e('0xa8')][_0x0b7e('0xa9')]){delete _0x51ac5['headers'][_0x0b7e('0xa9')];}}if(_0x51ac5[_0x0b7e('0xa8')]['content-type']){delete _0x51ac5[_0x0b7e('0xa8')][_0x0b7e('0xaa')];}return rp(_0x51ac5);})[_0x0b7e('0x2a')](function(_0x443218){if(_0x443218){_0x4d6a34[_0x0b7e('0x25')](_0x443218[_0x0b7e('0xa8')]);logger[_0x0b7e('0x6a')](_0x443218[_0x0b7e('0x95')]);if(_[_0x0b7e('0xab')](_0x260716['query'][_0x0b7e('0x50')],'download')&&_0x443218[_0x0b7e('0xac')]==0x1f4){return _0x4d6a34[_0x0b7e('0x1d')](_0x443218[_0x0b7e('0xac')]);}else{return _0x4d6a34[_0x0b7e('0x1f')](_0x443218['statusCode'])[_0x0b7e('0x32')](_0x443218[_0x0b7e('0x95')]);}}else{return _0x4d6a34[_0x0b7e('0x1d')](0xc8);}})[_0x0b7e('0x4a')](handleError(_0x4d6a34,null));};exports['webhookPost']=function(_0x39b271,_0x5949af,_0x759300){return BPromise[_0x0b7e('0xa0')]()[_0x0b7e('0x2a')](function(){if(!_0x39b271[_0x0b7e('0x39')]['path']){throw new Error(_0x0b7e('0xa1'));}if(!_0x39b271[_0x0b7e('0x39')]['port']){throw new Error(_0x0b7e('0xa2'));}var _0x5b9ada=_0x39b271['query'][_0x0b7e('0xa3')]?_0x39b271[_0x0b7e('0x39')][_0x0b7e('0xa3')]+':'+_0x39b271[_0x0b7e('0x39')]['port']:_0x0b7e('0xad')+_0x39b271[_0x0b7e('0x39')][_0x0b7e('0xa4')];var _0x561b29=_0x39b271[_0x0b7e('0x39')]['json']?_0x39b271['query'][_0x0b7e('0x20')]:!![];var _0xe562a9=_0x39b271[_0x0b7e('0x39')]['encoding']?_0x39b271[_0x0b7e('0x39')][_0x0b7e('0xa5')]:null;var _0x48bd4d={'method':_0x39b271[_0x0b7e('0xa6')],'uri':util[_0x0b7e('0x54')](_0x0b7e('0xa7'),_0x5b9ada,_0x39b271[_0x0b7e('0x39')][_0x0b7e('0x50')]),'json':_0x561b29,'resolveWithFullResponse':!![],'encoding':_0xe562a9,'body':_0x39b271[_0x0b7e('0x95')]};if(_0x39b271[_0x0b7e('0xa8')]){_0x48bd4d[_0x0b7e('0xa8')]=_0x39b271['headers'];if(_0x48bd4d[_0x0b7e('0xa8')][_0x0b7e('0xa9')]){delete _0x48bd4d[_0x0b7e('0xa8')][_0x0b7e('0xa9')];}}if(_0x48bd4d[_0x0b7e('0xa8')][_0x0b7e('0xaa')]){delete _0x48bd4d[_0x0b7e('0xa8')][_0x0b7e('0xaa')];}return rp(_0x48bd4d);})[_0x0b7e('0x2a')](function(_0xdc4464){if(_0xdc4464){_0x5949af['set'](_0xdc4464['headers']);logger[_0x0b7e('0x6a')](_0xdc4464[_0x0b7e('0x95')]);return _0x5949af[_0x0b7e('0x1f')](_0xdc4464[_0x0b7e('0xac')])[_0x0b7e('0x32')](_0xdc4464[_0x0b7e('0x95')]);}else{return _0x5949af['sendStatus'](0xc8);}})[_0x0b7e('0x4a')](handleError(_0x5949af,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index aa45064..9f1da95 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 _0x22ed=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x382e3b,_0x382994){var _0x47d697=function(_0x3d2836){while(--_0x3d2836){_0x382e3b['push'](_0x382e3b['shift']());}};_0x47d697(++_0x382994);}(_0x22ed,0x1a9));var _0xd22e=function(_0x2c0854,_0x2844af){_0x2c0854=_0x2c0854-0x0;var _0x52b94d=_0x22ed[_0x2c0854];return _0x52b94d;};'use strict';var EventEmitter=require(_0xd22e('0x0'));var Plugin=require(_0xd22e('0x1'))['db'][_0xd22e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xd22e('0x3')](0x0);var events={'afterCreate':_0xd22e('0x4'),'afterUpdate':_0xd22e('0x5'),'afterDestroy':_0xd22e('0x6')};function emitEvent(_0x10244b){return function(_0x3a1306,_0x214c17,_0x3c4894){PluginEvents[_0xd22e('0x7')](_0x10244b+':'+_0x3a1306['id'],_0x3a1306);PluginEvents['emit'](_0x10244b,_0x3a1306);_0x3c4894(null);};}for(var e in events){if(events[_0xd22e('0x8')](e)){var event=events[e];Plugin[_0xd22e('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x0adf=['Plugin','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5ee46b,_0x9a3716){var _0x3e031c=function(_0x502308){while(--_0x502308){_0x5ee46b['push'](_0x5ee46b['shift']());}};_0x3e031c(++_0x9a3716);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x499cfb,_0x344ccf){_0x499cfb=_0x499cfb-0x0;var _0x2b948d=_0x0adf[_0x499cfb];return _0x2b948d;};'use strict';var EventEmitter=require(_0xf0ad('0x0'));var Plugin=require(_0xf0ad('0x1'))['db'][_0xf0ad('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ad('0x3'),'afterUpdate':_0xf0ad('0x4'),'afterDestroy':_0xf0ad('0x5')};function emitEvent(_0x187aa4){return function(_0x27d666,_0x459e70,_0x719547){PluginEvents['emit'](_0x187aa4+':'+_0x27d666['id'],_0x27d666);PluginEvents[_0xf0ad('0x6')](_0x187aa4,_0x27d666);_0x719547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xf0ad('0x7')](e,emitEvent(event));}}module[_0xf0ad('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 1ddd688..eca7ee2 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 _0x4f5d=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x14077a,_0x2d985d){var _0x5b5de7=function(_0x5805e6){while(--_0x5805e6){_0x14077a['push'](_0x14077a['shift']());}};_0x5b5de7(++_0x2d985d);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4f5d[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var logger=require(_0xd4f5('0x2'))(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x6'));var rimraf=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var attributes=require(_0xd4f5('0x9'));module[_0xd4f5('0xa')]=function(_0x2c44bb,_0x121bfd){return _0x2c44bb[_0xd4f5('0xb')](_0xd4f5('0xc'),attributes,{'tableName':_0xd4f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8db9=['api','moment','request-promise','path','rimraf','./plugin.attributes','exports','define','Plugin','plugins','../../config/logger'];(function(_0x1d93c8,_0x15b37b){var _0x33f5bd=function(_0x5d75e0){while(--_0x5d75e0){_0x1d93c8['push'](_0x1d93c8['shift']());}};_0x33f5bd(++_0x15b37b);}(_0x8db9,0x11d));var _0x98db=function(_0x4bac77,_0x3babc1){_0x4bac77=_0x4bac77-0x0;var _0x90e201=_0x8db9[_0x4bac77];return _0x90e201;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x98db('0x0'))(_0x98db('0x1'));var moment=require(_0x98db('0x2'));var BPromise=require('bluebird');var rp=require(_0x98db('0x3'));var fs=require('fs');var path=require(_0x98db('0x4'));var rimraf=require(_0x98db('0x5'));var config=require('../../config/environment');var attributes=require(_0x98db('0x6'));module[_0x98db('0x7')]=function(_0x169cf9,_0x223332){return _0x169cf9[_0x98db('0x8')](_0x98db('0x9'),attributes,{'tableName':_0x98db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index b250c8c..b38aa48 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 _0x051b=['request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','CreatePlugin','Plugin','body','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register'];(function(_0x44a6a2,_0x2584f3){var _0x2f8540=function(_0x52027f){while(--_0x52027f){_0x44a6a2['push'](_0x44a6a2['shift']());}};_0x2f8540(++_0x2584f3);}(_0x051b,0x14c));var _0xb051=function(_0x3860cf,_0x4f742a){_0x3860cf=_0x3860cf-0x0;var _0x2a3b0e=_0x051b[_0x3860cf];return _0x2a3b0e;};'use strict';var _=require(_0xb051('0x0'));var util=require(_0xb051('0x1'));var moment=require(_0xb051('0x2'));var BPromise=require(_0xb051('0x3'));var rs=require(_0xb051('0x4'));var fs=require('fs');var Redis=require(_0xb051('0x5'));var db=require(_0xb051('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb051('0x7'))(_0xb051('0x8'));var config=require(_0xb051('0x9'));var jayson=require(_0xb051('0xa'));var client=jayson[_0xb051('0xb')]['http']({'port':0x232a});config[_0xb051('0xc')]=_[_0xb051('0xd')](config[_0xb051('0xc')],{'host':_0xb051('0xe'),'port':0x18eb});var socket=require(_0xb051('0xf'))(new Redis(config[_0xb051('0xc')]));require(_0xb051('0x10'))[_0xb051('0x11')](socket);function respondWithRpcPromise(_0x322db2,_0x46cb90,_0x7573e9){return new BPromise(function(_0x36bffa,_0x4c3976){return client[_0xb051('0x12')](_0x322db2,_0x7573e9)[_0xb051('0x13')](function(_0x3defc4){logger[_0xb051('0x14')](_0xb051('0x15'),_0x46cb90,_0xb051('0x16'));logger[_0xb051('0x17')](_0xb051('0x18'),_0x46cb90,_0xb051('0x16'),JSON['stringify'](_0x3defc4));if(_0x3defc4['error']){if(_0x3defc4[_0xb051('0x19')]['code']===0x1f4){logger[_0xb051('0x19')]('Plugin,\x20%s,\x20%s',_0x46cb90,_0x3defc4[_0xb051('0x19')]['message']);return _0x4c3976(_0x3defc4[_0xb051('0x19')][_0xb051('0x1a')]);}logger['error'](_0xb051('0x15'),_0x46cb90,_0x3defc4[_0xb051('0x19')][_0xb051('0x1a')]);return _0x36bffa(_0x3defc4['error'][_0xb051('0x1a')]);}else{logger[_0xb051('0x14')](_0xb051('0x15'),_0x46cb90,_0xb051('0x16'));_0x36bffa(_0x3defc4[_0xb051('0x1b')]['message']);}})['catch'](function(_0x38b1a5){logger[_0xb051('0x19')](_0xb051('0x15'),_0x46cb90,_0x38b1a5);_0x4c3976(_0x38b1a5);});});}exports[_0xb051('0x1c')]=function(_0x28000e){var _0x562728=this;return new Promise(function(_0x4e4b8a,_0x534965){return db[_0xb051('0x1d')]['create'](_0x28000e[_0xb051('0x1e')],{'raw':_0x28000e['options']?_0x28000e[_0xb051('0x1f')][_0xb051('0x20')]===undefined?!![]:![]:!![]})[_0xb051('0x13')](function(_0x10fc68){logger[_0xb051('0x14')](_0xb051('0x1c'),_0x28000e);logger[_0xb051('0x17')](_0xb051('0x1c'),_0x28000e,JSON[_0xb051('0x21')](_0x10fc68));_0x4e4b8a(_0x10fc68);})[_0xb051('0x22')](function(_0xa47723){logger[_0xb051('0x19')](_0xb051('0x1c'),_0xa47723['message'],_0x28000e);_0x534965(_0x562728[_0xb051('0x19')](0x1f4,_0xa47723[_0xb051('0x1a')]));});});}; \ No newline at end of file +var _0x4a58=['../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0x4a58,0x1b1));var _0x84a5=function(_0x472ded,_0x7b9b67){_0x472ded=_0x472ded-0x0;var _0x4cdf81=_0x4a58[_0x472ded];return _0x4cdf81;};'use strict';var _=require(_0x84a5('0x0'));var util=require(_0x84a5('0x1'));var moment=require(_0x84a5('0x2'));var BPromise=require(_0x84a5('0x3'));var rs=require(_0x84a5('0x4'));var fs=require('fs');var Redis=require(_0x84a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84a5('0x6'));var logger=require(_0x84a5('0x7'))(_0x84a5('0x8'));var config=require(_0x84a5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x84a5('0xa')][_0x84a5('0xb')]({'port':0x232a});config[_0x84a5('0xc')]=_['defaults'](config[_0x84a5('0xc')],{'host':_0x84a5('0xd'),'port':0x18eb});var socket=require(_0x84a5('0xe'))(new Redis(config[_0x84a5('0xc')]));require('./plugin.socket')[_0x84a5('0xf')](socket);function respondWithRpcPromise(_0x4b5b51,_0x3c9946,_0x4d890e){return new BPromise(function(_0x3b9f1e,_0x49c64a){return client[_0x84a5('0x10')](_0x4b5b51,_0x4d890e)[_0x84a5('0x11')](function(_0x4b3b6b){logger[_0x84a5('0x12')](_0x84a5('0x13'),_0x3c9946,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x3c9946,_0x84a5('0x14'),JSON[_0x84a5('0x15')](_0x4b3b6b));if(_0x4b3b6b[_0x84a5('0x16')]){if(_0x4b3b6b[_0x84a5('0x16')][_0x84a5('0x17')]===0x1f4){logger[_0x84a5('0x16')](_0x84a5('0x13'),_0x3c9946,_0x4b3b6b[_0x84a5('0x16')][_0x84a5('0x18')]);return _0x49c64a(_0x4b3b6b[_0x84a5('0x16')][_0x84a5('0x18')]);}logger['error'](_0x84a5('0x13'),_0x3c9946,_0x4b3b6b[_0x84a5('0x16')]['message']);return _0x3b9f1e(_0x4b3b6b[_0x84a5('0x16')][_0x84a5('0x18')]);}else{logger[_0x84a5('0x12')](_0x84a5('0x13'),_0x3c9946,_0x84a5('0x14'));_0x3b9f1e(_0x4b3b6b[_0x84a5('0x19')][_0x84a5('0x18')]);}})[_0x84a5('0x1a')](function(_0x33f2a3){logger['error']('Plugin,\x20%s,\x20%s',_0x3c9946,_0x33f2a3);_0x49c64a(_0x33f2a3);});});}exports[_0x84a5('0x1b')]=function(_0x382081){var _0x5a2e7e=this;return new Promise(function(_0x591a8e,_0x37671e){return db[_0x84a5('0x1c')][_0x84a5('0x1d')](_0x382081[_0x84a5('0x1e')],{'raw':_0x382081[_0x84a5('0x1f')]?_0x382081[_0x84a5('0x1f')][_0x84a5('0x20')]===undefined?!![]:![]:!![]})[_0x84a5('0x11')](function(_0x18b44e){logger[_0x84a5('0x12')]('CreatePlugin',_0x382081);logger[_0x84a5('0x21')](_0x84a5('0x1b'),_0x382081,JSON[_0x84a5('0x15')](_0x18b44e));_0x591a8e(_0x18b44e);})[_0x84a5('0x1a')](function(_0x462184){logger[_0x84a5('0x16')]('CreatePlugin',_0x462184['message'],_0x382081);_0x37671e(_0x5a2e7e['error'](0x1f4,_0x462184[_0x84a5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5475a9b..3002492 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 _0x0388=['save','remove','update','emit','removeListener','register','length','plugin:','./plugin.events'];(function(_0x4e77e0,_0x2a8374){var _0x10ed26=function(_0x200533){while(--_0x200533){_0x4e77e0['push'](_0x4e77e0['shift']());}};_0x10ed26(++_0x2a8374);}(_0x0388,0x11f));var _0x8038=function(_0x4b5db1,_0x725d15){_0x4b5db1=_0x4b5db1-0x0;var _0x4e9793=_0x0388[_0x4b5db1];return _0x4e9793;};'use strict';var PluginEvents=require(_0x8038('0x0'));var events=[_0x8038('0x1'),_0x8038('0x2'),_0x8038('0x3')];function createListener(_0x25140d,_0x3c2989){return function(_0x2ebe2f){_0x3c2989[_0x8038('0x4')](_0x25140d,_0x2ebe2f);};}function removeListener(_0x5609b0,_0x6028c7){return function(){PluginEvents[_0x8038('0x5')](_0x5609b0,_0x6028c7);};}exports[_0x8038('0x6')]=function(_0x17dc46){for(var _0x134868=0x0,_0x13c5d1=events[_0x8038('0x7')];_0x134868<_0x13c5d1;_0x134868++){var _0x54f0a1=events[_0x134868];var _0x27e613=createListener(_0x8038('0x8')+_0x54f0a1,_0x17dc46);PluginEvents['on'](_0x54f0a1,_0x27e613);}}; \ No newline at end of file +var _0xb64d=['register','plugin:','./plugin.events','save','remove','emit','removeListener'];(function(_0x5d2891,_0x31f203){var _0x12565e=function(_0x1f6b2b){while(--_0x1f6b2b){_0x5d2891['push'](_0x5d2891['shift']());}};_0x12565e(++_0x31f203);}(_0xb64d,0x1b4));var _0xdb64=function(_0x3598f6,_0x4c2264){_0x3598f6=_0x3598f6-0x0;var _0x3fa522=_0xb64d[_0x3598f6];return _0x3fa522;};'use strict';var PluginEvents=require(_0xdb64('0x0'));var events=[_0xdb64('0x1'),_0xdb64('0x2'),'update'];function createListener(_0x275013,_0xdaef5b){return function(_0x2aa5b8){_0xdaef5b[_0xdb64('0x3')](_0x275013,_0x2aa5b8);};}function removeListener(_0x2a0f6d,_0x358d17){return function(){PluginEvents[_0xdb64('0x4')](_0x2a0f6d,_0x358d17);};}exports[_0xdb64('0x5')]=function(_0xf3014c){for(var _0x116b37=0x0,_0x2d4dad=events['length'];_0x116b37<_0x2d4dad;_0x116b37++){var _0x2b951d=events[_0x116b37];var _0x53971e=createListener(_0xdb64('0x6')+_0x2b951d,_0xf3014c);PluginEvents['on'](_0x2b951d,_0x53971e);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3a29875..cd6e8b4 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(_0x14c9d4,_0x44319b){var _0x1f696e=function(_0x241799){while(--_0x241799){_0x14c9d4['push'](_0x14c9d4['shift']());}};_0x1f696e(++_0x44319b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x23c76e,_0x487af4){var _0xfe864e=function(_0x506378){while(--_0x506378){_0x23c76e['push'](_0x23c76e['shift']());}};_0xfe864e(++_0x487af4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 43c4b53..3761ab8 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 _0x2f68=['dump','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','sendStatus','status','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','destroy','delete'];(function(_0x53884d,_0x48715c){var _0x2ae3dd=function(_0x256da8){while(--_0x256da8){_0x53884d['push'](_0x53884d['shift']());}};_0x2ae3dd(++_0x48715c);}(_0x2f68,0x9a));var _0x82f6=function(_0x56114e,_0x2e104a){_0x56114e=_0x56114e-0x0;var _0x424f16=_0x2f68[_0x56114e];return _0x424f16;};'use strict';var _=require('lodash');var pm2=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var path=require(_0x82f6('0x3'));var exec=require('child_process')[_0x82f6('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x2a06dc,_0x2ab73d){return function(_0x5dad09){if(!_0x5dad09){_0x2a06dc[_0x82f6('0x5')](0x194);;}return _0x5dad09;};}function respondWithResult(_0x2c4302,_0x542737){_0x542737=_0x542737||0xc8;return function(_0x5a8089){if(_0x5a8089){return _0x2c4302[_0x82f6('0x6')](_0x542737)['json'](_0x5a8089);}return null;};}function handleError(_0x5daa3c,_0x864400){_0x864400=_0x864400||0x1f4;return function(_0xbd30d5){logger[_0x82f6('0x7')](_0xbd30d5['stack']);if(_0xbd30d5[_0x82f6('0x8')]){delete _0xbd30d5[_0x82f6('0x8')];}_0x5daa3c['status'](_0x864400)[_0x82f6('0x9')](_0xbd30d5);};}function execChildProcess(){return new BPromise(function(_0x1eec2f,_0x3f8320){exec(_0x82f6('0xa'),function(_0x1a68c4,_0x34bd7c,_0x4c870e){logger[_0x82f6('0xb')](_0x34bd7c);logger[_0x82f6('0xb')](_0x4c870e);if(_0x1a68c4){logger['error'](_0x1a68c4);return _0x3f8320(_0x1a68c4);}return _0x1eec2f(_0x34bd7c);});});}exports[_0x82f6('0xc')]=function(_0x1f8bf5,_0x397527){return pm2[_0x82f6('0xd')]()[_0x82f6('0xe')](function(_0xa00275){if(_0xa00275){var _0x115c7b=_[_0x82f6('0xf')](_0xa00275,function(_0x1e7cbc){return _0x1e7cbc['name']===_0x82f6('0x10')||_0x1e7cbc['name']===_0x82f6('0x11');});return{'rows':_0x115c7b,'count':_0x115c7b[_0x82f6('0x12')]};}return null;})[_0x82f6('0xe')](respondWithResult(_0x397527,null))[_0x82f6('0x13')](handleError(_0x397527,null));};exports[_0x82f6('0x14')]=function(_0x2326ae,_0x326378){return pm2[_0x82f6('0x15')](_0x2326ae[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x326378,null))[_0x82f6('0xe')](handleEntityNotFound(_0x326378,null))[_0x82f6('0x13')](handleError(_0x326378,null));};exports[_0x82f6('0x17')]=function(_0x4fe226,_0x3a8269){if(_0x4fe226['body'][_0x82f6('0x8')]&&_0x4fe226[_0x82f6('0x18')]['script']){var _0x2b03ad=path[_0x82f6('0x19')](__dirname,_0x82f6('0x1a'),_0x4fe226[_0x82f6('0x18')]['script']);var _0xdc4dea=process['cwd']();process[_0x82f6('0x1b')](path[_0x82f6('0x1c')](_0x2b03ad));return execChildProcess()['then'](function(_0x516deb){process[_0x82f6('0x1b')](_0xdc4dea);return pm2[_0x82f6('0x1d')]({'name':_0x4fe226['body']['name'],'script':_0x2b03ad});})[_0x82f6('0xe')](function(_0x31face){pm2['dump']();return _0x31face[0x0];})[_0x82f6('0xe')](respondWithResult(_0x3a8269,0xc9))[_0x82f6('0x13')](handleError(_0x3a8269,null));}else{return _0x3a8269['status'](0x1f4)['send']({'message':_0x82f6('0x1e')});}};exports['update']=function(_0x469b6b,_0x5a6d69){if(_0x469b6b['body']['id']){delete _0x469b6b[_0x82f6('0x18')]['id'];}var _0x15c9b7={'online':_0x82f6('0x1f'),'stopped':_0x82f6('0x20')};if(_0x15c9b7['hasOwnProperty'](_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')])){return pm2[_0x15c9b7[_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')]]](_0x469b6b[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x5a6d69,0xc8))[_0x82f6('0x13')](handleError(_0x5a6d69,null));}else{return _0x5a6d69[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x21')});}};exports[_0x82f6('0x22')]=function(_0x20d1c5,_0x6ce179){if(_0x20d1c5[_0x82f6('0x18')]['id']){delete _0x20d1c5['body']['id'];}if(_0x20d1c5[_0x82f6('0x16')]['id']){return pm2[_0x82f6('0x23')](_0x20d1c5[_0x82f6('0x16')]['id'])['then'](function(_0x36f37a){pm2[_0x82f6('0x24')]();return _0x36f37a[0x0];})[_0x82f6('0xe')](respondWithResult(_0x6ce179,null))[_0x82f6('0x13')](handleError(_0x6ce179,null));}else{return _0x6ce179[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x25')});}}; \ No newline at end of file +var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x566438,_0x3abb6a){var _0x2d8c26=function(_0x9ac951){while(--_0x9ac951){_0x566438['push'](_0x566438['shift']());}};_0x2d8c26(++_0x3abb6a);}(_0xc788,0xc4));var _0x8c78=function(_0x2257c3,_0x38dc9b){_0x2257c3=_0x2257c3-0x0;var _0x53638c=_0xc788[_0x2257c3];return _0x53638c;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 498337a..88c9ea0 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 _0x824a=['Router','/agents','isAuthenticated','getAgents','get','/queues'];(function(_0x355e5d,_0x4b1a06){var _0x72c1d0=function(_0x4a9bea){while(--_0x4a9bea){_0x355e5d['push'](_0x355e5d['shift']());}};_0x72c1d0(++_0x4b1a06);}(_0x824a,0x1aa));var _0xa824=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x824a[_0x19950b];return _0x3c6b41;};'use strict';var express=require('express');var router=express[_0xa824('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0xa824('0x1'),auth[_0xa824('0x2')](),controller[_0xa824('0x3')]);router[_0xa824('0x4')](_0xa824('0x5'),auth[_0xa824('0x2')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0xb5d9=['get','/agents','getAgents','isAuthenticated','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x5c5823,_0x127a6b){var _0x1c962f=function(_0x1916b9){while(--_0x1916b9){_0x5c5823['push'](_0x5c5823['shift']());}};_0x1c962f(++_0x127a6b);}(_0xb5d9,0x191));var _0x9b5d=function(_0x1948cb,_0x37604a){_0x1948cb=_0x1948cb-0x0;var _0x4d63d7=_0xb5d9[_0x1948cb];return _0x4d63d7;};'use strict';var express=require(_0x9b5d('0x0'));var router=express[_0x9b5d('0x1')]();var auth=require(_0x9b5d('0x2'));var controller=require(_0x9b5d('0x3'));router[_0x9b5d('0x4')](_0x9b5d('0x5'),auth['isAuthenticated'](),controller[_0x9b5d('0x6')]);router['get']('/queues',auth[_0x9b5d('0x7')](),controller['getQueues']);module[_0x9b5d('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 1d252e4..c7fe4ff 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 _0x9639=['query','globalStatusFilter','pauseTypeFilter','*pause','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','type','key','role','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','merge','pause','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','rows','catch','getQueues','resolve','startCase','Queue','name','outbound','dialActive','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','status','set','Content-Range','json','getAgents','getChannels'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x9639,0x146));var _0x9963=function(_0x561d78,_0x15720d){_0x561d78=_0x561d78-0x0;var _0x1d9831=_0x9639[_0x561d78];return _0x1d9831;};'use strict';var _=require(_0x9963('0x0'));var util=require(_0x9963('0x1'));var rta=require(_0x9963('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x9963('0x3'));var utils=require(_0x9963('0x4'));var db=require(_0x9963('0x5'))['db'];var APIBadRequestError=require(_0x9963('0x6'))[_0x9963('0x7')];var APIHandleError=require(_0x9963('0x6'))[_0x9963('0x8')];function respondWithFilteredResult(_0x214414,_0x51e5c0){return function(_0x3085f5){if(_0x3085f5){var _0x284199=typeof _0x51e5c0[_0x9963('0x9')]==='undefined'&&typeof _0x51e5c0['limit']===_0x9963('0xa');var _0x1560e4=_0x3085f5[_0x9963('0xb')];var _0x471c6e=_0x284199?0x0:_0x51e5c0[_0x9963('0x9')];var _0x46995f=_0x284199?_0x3085f5[_0x9963('0xb')]:_0x51e5c0[_0x9963('0x9')]+_0x51e5c0['limit'];var _0x59bf01;if(_0x46995f>=_0x1560e4){_0x46995f=_0x1560e4;_0x59bf01=0xc8;}else{_0x59bf01=0xce;}_0x214414[_0x9963('0xc')](_0x59bf01);return _0x214414[_0x9963('0xd')](_0x9963('0xe'),_0x471c6e+'-'+_0x46995f+'/'+_0x1560e4)[_0x9963('0xf')](_0x3085f5);}return null;};}exports[_0x9963('0x10')]=function(_0x236991,_0x2c4599){var _0x2958fb={'count':0x0,'rows':[]};var _0x6d6aee={};var _0x4142e2;var _0x4a7b0d=utils[_0x9963('0x11')]();var _0x1e5127;var _0x5ee4a8;var _0x1062de=_0x236991[_0x9963('0x12')]['globalQueueFilter'];var _0x1a929a=_0x236991[_0x9963('0x12')][_0x9963('0x13')];var _0x4a8143=_0x236991[_0x9963('0x12')][_0x9963('0x14')];var _0x2750c1=_0x1a929a==='pause'||_0x1a929a===_0x9963('0x15')?!![]:![];var _0x24797f=[];var _0x18ced1;var _0x5d546e;Promise['resolve']()['then'](function(){if(_0x236991[_0x9963('0x12')]['channel']){if(!utils[_0x9963('0x16')](_0x236991[_0x9963('0x12')][_0x9963('0x17')])){throw new APIBadRequestError(util[_0x9963('0x18')](_0x9963('0x19'),_0x236991[_0x9963('0x12')][_0x9963('0x17')]));}_0x4142e2=_0x236991['query'][_0x9963('0x17')][_0x9963('0x1a')]();}if(!_0x236991['query']['sort']||!_0x236991['query'][_0x9963('0x1b')][_0x9963('0x1c')](_0x9963('0x1d'))){_0x236991[_0x9963('0x12')][_0x9963('0x1b')]=rta[_0x9963('0x1e')](_0x236991[_0x9963('0x12')][_0x9963('0x1b')]);return;}var _0x1d2324=rta[_0x9963('0x1f')](_0x236991[_0x9963('0x12')][_0x9963('0x1b')]);_0x236991[_0x9963('0x12')]['sort']=_0x1d2324[_0x9963('0x20')][_0x9963('0x21')](',');_0x18ced1=_0x1d2324[_0x9963('0x22')];})[_0x9963('0x23')](function(){if(!_0x1062de){return[];}return rta[_0x9963('0x24')](_0x1062de,_0x4142e2);})['then'](function(_0x44613a){_0x24797f=_0x44613a;return rta['getRealtimeAgents']();})['then'](function(_0x4d8ef3){_0x5ee4a8=_0x4d8ef3['rows'];if((!_0x1a929a||_0x2750c1)&&!_0x18ced1){return _0x24797f;}if(_0x18ced1&&!_0x1a929a){return rta[_0x9963('0x25')](_0x5ee4a8,_0x24797f,_0x18ced1);}else{return rta[_0x9963('0x26')](_0x5ee4a8,_0x24797f,_0x1a929a);}})[_0x9963('0x23')](function(_0x390e05){_0x24797f=_0x390e05;var _0x5dcddc=![];if(_0x24797f[_0x9963('0x27')]===0x0){if(_0x1062de||_0x1a929a){_0x5dcddc=!![];}if(_0x2750c1){_0x5dcddc=![];}}if(_0x5dcddc){return _0x2958fb;}var _0x331405=_[_0x9963('0x28')](db[_0x9963('0x29')][_0x9963('0x2a')],function(_0x3db549){return{'name':_0x3db549['fieldName'],'type':_0x3db549[_0x9963('0x2b')][_0x9963('0x2c')]};});_0x236991[_0x9963('0x12')][_0x9963('0x2d')]='agent';_0x6d6aee=qs[_0x9963('0x2e')](_0x331405,_0x236991);_0x6d6aee[_0x9963('0x2f')]=!![];var _0x3416fc=[];if(_0x24797f['length']>0x0){_0x3416fc[_0x9963('0x30')]({'id':{'$in':_0x24797f}});if(_0x18ced1&&!_0x1a929a){_0x5d546e=[db[_0x9963('0x31')][_0x9963('0x32')](_0x9963('0x33')+_0x24797f+')')];_0x6d6aee[_0x9963('0x22')]=_0x5d546e;}}if(_0x2750c1){_0x4a7b0d[_0x9963('0x34')](function(_0x4a6e61){var _0x3acdca=!![];if(_0x1a929a===_0x9963('0x15')&&_0x4142e2!==_0x4a6e61){_0x3acdca=![];}_0x3416fc[_0x9963('0x30')]({[_0x4a6e61+_0x9963('0x35')]:_0x3acdca});});if(_0x4a8143){_0x3416fc[_0x9963('0x30')]({'pauseType':_0x4a8143});}}else if(_0x1a929a){_0x4a7b0d['forEach'](function(_0x4d4861){_0x3416fc[_0x9963('0x30')]({[_0x4d4861+_0x9963('0x35')]:![]});});}_0x6d6aee['where']=_['merge'](_0x6d6aee[_0x9963('0x36')],{'$and':_0x3416fc});if(_0x236991['user']['role']==='user'){var _0x14ec4c={'params':{'id':_0x236991[_0x9963('0x37')][_0x9963('0x38')]},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x24797f,'customSorting':_0x5d546e}};if(_0x236991[_0x9963('0x12')][_0x9963('0x39')]){_0x14ec4c[_0x9963('0x12')][_0x9963('0x39')]=!![];}if(_0x2750c1){_0x14ec4c[_0x9963('0x12')][_0x9963('0x3a')]=_0x3416fc;}_0x14ec4c[_0x9963('0x12')]=Object[_0x9963('0x3b')](_0x14ec4c['query'],_0x236991[_0x9963('0x12')]);return db[_0x9963('0x3c')][_0x9963('0x3d')](_0x14ec4c);}return db[_0x9963('0x29')][_0x9963('0x3e')](_0x6d6aee);})[_0x9963('0x23')](function(_0x356bf0){_0x2958fb[_0x9963('0xb')]=_0x356bf0[_0x9963('0xb')];_0x1e5127=_0x356bf0['rows'];return _0x1e5127[_0x9963('0x28')](function(_0x16e47b){var _0x473329=_[_0x9963('0x3f')](_0x5ee4a8,['id',_0x16e47b['id']]);if(_0x473329){var _0x1d3804=rta[_0x9963('0x40')](_0x473329);_[_0x9963('0x41')](_0x16e47b,_0x1d3804);}_0x16e47b[_0x9963('0x1d')]=rta['getAgentStatus'](_0x16e47b);if(_0x16e47b[_0x9963('0x1d')]['includes'](_0x9963('0x42'))){_0x4a7b0d[_0x9963('0x34')](function(_0x4a20c6){if(_0x16e47b[_0x4a20c6+'Pause']){if(_0x4a20c6===_0x9963('0x43')){if(_0x16e47b[_0x9963('0x44')]!==_0x9963('0x45')){_0x16e47b['voiceStatus']=_0x9963('0x42');}}else{_0x16e47b[_0x4a20c6+_0x9963('0x46')]=_0x9963('0x42');}}});}return _0x16e47b;});})['then'](function(_0x5d05e9){if(!_0x18ced1||_0x5d546e){return _0x5d05e9;}return rta[_0x9963('0x47')](_0x5d05e9,_0x18ced1);})['then'](function(_0x24049a){var _0x5736b3=rta[_0x9963('0x48')]();_0x2958fb[_0x9963('0x49')]=_0x24049a[_0x9963('0x28')](function(_0x49ddfd){return _['pick'](_0x49ddfd,_0x5736b3);});return _0x2958fb;})[_0x9963('0x23')](respondWithFilteredResult(_0x2c4599,_0x6d6aee))[_0x9963('0x4a')](APIHandleError(_0x2c4599));};exports[_0x9963('0x4b')]=function(_0x5ace0b,_0x2a3a84){var _0x19be8d={'count':0x0,'rows':[]};var _0x592944={};var _0x5c6fcd;var _0x342eea;var _0x1adf8a;Promise[_0x9963('0x4c')]()[_0x9963('0x23')](function(){if(_0x5ace0b[_0x9963('0x12')]['channel']){if(!utils['isValidChannel'](_0x5ace0b[_0x9963('0x12')][_0x9963('0x17')])){throw new APIBadRequestError(util[_0x9963('0x18')](_0x9963('0x19'),_0x5ace0b[_0x9963('0x12')]['channel']));}_0x5c6fcd=_0x5ace0b['query'][_0x9963('0x17')][_0x9963('0x1a')]();}var _0x3a466d=_[_0x9963('0x4d')](_0x5c6fcd)+_0x9963('0x4e');var _0x370c37=_[_0x9963('0x28')](db[_0x3a466d]['rawAttributes'],function(_0x3e7c5d){return{'name':_0x3e7c5d['fieldName'],'type':_0x3e7c5d['type'][_0x9963('0x2c')]};});if(!_0x5ace0b[_0x9963('0x12')][_0x9963('0x20')]){var _0x135fc6=['id',_0x9963('0x4f')];if(_0x5c6fcd===_0x9963('0x43')){_0x135fc6[_0x9963('0x30')](_0x9963('0x2b'));if(_0x5ace0b[_0x9963('0x12')][_0x9963('0x2b')]===_0x9963('0x50')){_0x135fc6[_0x9963('0x30')]([_0x9963('0x51'),'dialMethod']);}}_0x5ace0b['query'][_0x9963('0x20')]=_0x135fc6['join'](',');}_0x592944=qs[_0x9963('0x2e')](_0x370c37,_0x5ace0b);if(_0x5ace0b[_0x9963('0x37')][_0x9963('0x2d')]===_0x9963('0x37')){var _0x4e1972={'params':{'id':_0x5ace0b[_0x9963('0x37')][_0x9963('0x38')]},'query':{'section':_0x5c6fcd==='voice'&&_0x5ace0b[_0x9963('0x12')][_0x9963('0x2b')]==='outbound'?'QueueCampaigns':_[_0x9963('0x4d')](_0x5c6fcd)+_0x9963('0x52'),'type':_0x5ace0b[_0x9963('0x12')][_0x9963('0x2b')],'nolimit':!![],'sort':_0x9963('0x4f'),'filter':_0x5ace0b['query'][_0x9963('0x53')]}};_0x4e1972[_0x9963('0x12')]=Object[_0x9963('0x3b')](_0x4e1972[_0x9963('0x12')],_0x5ace0b[_0x9963('0x12')]);delete _0x4e1972[_0x9963('0x12')]['id'];return db[_0x9963('0x3c')]['getResources'](_0x4e1972);}return db[_0x3a466d][_0x9963('0x3e')](_0x592944);})[_0x9963('0x23')](function(_0x3814fe){_0x19be8d[_0x9963('0xb')]=_0x3814fe[_0x9963('0xb')];_0x342eea=_0x3814fe[_0x9963('0x49')];return rtq[_0x9963('0x54')](_0x5ace0b,_0x5c6fcd);})[_0x9963('0x23')](function(_0x4dab51){_0x1adf8a=_0x4dab51[_0x9963('0x49')];return rtq[_0x9963('0x55')](_0x342eea,_0x1adf8a,_0x5c6fcd,_0x5ace0b[_0x9963('0x12')]['type']);})[_0x9963('0x23')](function(_0x3a80c2){_0x19be8d[_0x9963('0x49')]=_0x3a80c2;return _0x19be8d;})['then'](respondWithFilteredResult(_0x2a3a84,_0x592944))[_0x9963('0x4a')](APIHandleError(_0x2a3a84));}; \ No newline at end of file +var _0x608a=['../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','agent','getOptions','raw','push','sequelize','literal','forEach','Pause','merge','role','user','userProfileId','Agents','online','extraQueryConditions','assign','find','filterAgentAttributes','getAgentStatus','voice','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','resolve','isValidChannel','toLowerCase','Queue','key','name','outbound','dialActive','dialMethod','QueueCampaigns','startCase','Queues','filter','UserProfile','getResources','getRealtimeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x608a,0xfc));var _0xa608=function(_0x46a158,_0x13e95a){_0x46a158=_0x46a158-0x0;var _0x239032=_0x608a[_0x46a158];return _0x239032;};'use strict';var _=require(_0xa608('0x0'));var util=require('util');var rta=require(_0xa608('0x1'));var rtq=require(_0xa608('0x2'));var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0xa608('0x3'))['db'];var APIBadRequestError=require(_0xa608('0x4'))[_0xa608('0x5')];var APIHandleError=require(_0xa608('0x4'))[_0xa608('0x6')];function respondWithFilteredResult(_0x1fc5c3,_0xf24edc){return function(_0x20f5b5){if(_0x20f5b5){var _0x53d2a8=typeof _0xf24edc[_0xa608('0x7')]===_0xa608('0x8')&&typeof _0xf24edc['limit']===_0xa608('0x8');var _0x587efe=_0x20f5b5[_0xa608('0x9')];var _0x68ccb0=_0x53d2a8?0x0:_0xf24edc[_0xa608('0x7')];var _0x3f5c6a=_0x53d2a8?_0x20f5b5['count']:_0xf24edc[_0xa608('0x7')]+_0xf24edc[_0xa608('0xa')];var _0x11c4bb;if(_0x3f5c6a>=_0x587efe){_0x3f5c6a=_0x587efe;_0x11c4bb=0xc8;}else{_0x11c4bb=0xce;}_0x1fc5c3[_0xa608('0xb')](_0x11c4bb);return _0x1fc5c3[_0xa608('0xc')]('Content-Range',_0x68ccb0+'-'+_0x3f5c6a+'/'+_0x587efe)[_0xa608('0xd')](_0x20f5b5);}return null;};}exports[_0xa608('0xe')]=function(_0x36c5fc,_0x45a7cb){var _0x6d1c50={'count':0x0,'rows':[]};var _0x42fdf6={};var _0x5a3cf2;var _0x14ec13=utils[_0xa608('0xf')]();var _0x91c4e7;var _0x116d35;var _0x59f721=_0x36c5fc[_0xa608('0x10')][_0xa608('0x11')];var _0x1cee0=_0x36c5fc[_0xa608('0x10')][_0xa608('0x12')];var _0x31b4d2=_0x36c5fc[_0xa608('0x10')][_0xa608('0x13')];var _0xd7da6=_0x1cee0===_0xa608('0x14')||_0x1cee0===_0xa608('0x15')?!![]:![];var _0x35b5ac=[];var _0x1e78c8;var _0x5a6711;Promise['resolve']()[_0xa608('0x16')](function(){if(_0x36c5fc[_0xa608('0x10')][_0xa608('0x17')]){if(!utils['isValidChannel'](_0x36c5fc['query']['channel'])){throw new APIBadRequestError(util[_0xa608('0x18')](_0xa608('0x19'),_0x36c5fc['query']['channel']));}_0x5a3cf2=_0x36c5fc[_0xa608('0x10')]['channel']['toLowerCase']();}if(!_0x36c5fc['query'][_0xa608('0x1a')]||!_0x36c5fc[_0xa608('0x10')][_0xa608('0x1a')][_0xa608('0x1b')](_0xa608('0x1c'))){_0x36c5fc[_0xa608('0x10')]['sort']=rta[_0xa608('0x1d')](_0x36c5fc[_0xa608('0x10')][_0xa608('0x1a')]);return;}var _0x3d4903=rta[_0xa608('0x1e')](_0x36c5fc[_0xa608('0x10')][_0xa608('0x1a')]);_0x36c5fc[_0xa608('0x10')]['sort']=_0x3d4903[_0xa608('0x1f')][_0xa608('0x20')](',');_0x1e78c8=_0x3d4903[_0xa608('0x21')];})[_0xa608('0x16')](function(){if(!_0x59f721){return[];}return rta[_0xa608('0x22')](_0x59f721,_0x5a3cf2);})[_0xa608('0x16')](function(_0x5618e4){_0x35b5ac=_0x5618e4;return rta[_0xa608('0x23')]();})[_0xa608('0x16')](function(_0x11aecc){_0x116d35=_0x11aecc[_0xa608('0x24')];if((!_0x1cee0||_0xd7da6)&&!_0x1e78c8){return _0x35b5ac;}if(_0x1e78c8&&!_0x1cee0){return rta['getSortedAgentsIdsByStatus'](_0x116d35,_0x35b5ac,_0x1e78c8);}else{return rta[_0xa608('0x25')](_0x116d35,_0x35b5ac,_0x1cee0);}})['then'](function(_0x25eb43){_0x35b5ac=_0x25eb43;var _0x404f3d=![];if(_0x35b5ac[_0xa608('0x26')]===0x0){if(_0x59f721||_0x1cee0){_0x404f3d=!![];}if(_0xd7da6){_0x404f3d=![];}}if(_0x404f3d){return _0x6d1c50;}var _0x4662f1=_[_0xa608('0x27')](db[_0xa608('0x28')][_0xa608('0x29')],function(_0x36eaf3){return{'name':_0x36eaf3[_0xa608('0x2a')],'type':_0x36eaf3[_0xa608('0x2b')]['key']};});_0x36c5fc[_0xa608('0x10')]['role']=_0xa608('0x2c');_0x42fdf6=qs[_0xa608('0x2d')](_0x4662f1,_0x36c5fc);_0x42fdf6[_0xa608('0x2e')]=!![];var _0x36aacd=[];if(_0x35b5ac[_0xa608('0x26')]>0x0){_0x36aacd[_0xa608('0x2f')]({'id':{'$in':_0x35b5ac}});if(_0x1e78c8&&!_0x1cee0){_0x5a6711=[db[_0xa608('0x30')][_0xa608('0x31')]('FIELD(id,'+_0x35b5ac+')')];_0x42fdf6['order']=_0x5a6711;}}if(_0xd7da6){_0x14ec13[_0xa608('0x32')](function(_0x403fb0){var _0x1205db=!![];if(_0x1cee0===_0xa608('0x15')&&_0x5a3cf2!==_0x403fb0){_0x1205db=![];}_0x36aacd[_0xa608('0x2f')]({[_0x403fb0+_0xa608('0x33')]:_0x1205db});});if(_0x31b4d2){_0x36aacd['push']({'pauseType':_0x31b4d2});}}else if(_0x1cee0){_0x14ec13[_0xa608('0x32')](function(_0x580997){_0x36aacd[_0xa608('0x2f')]({[_0x580997+_0xa608('0x33')]:![]});});}_0x42fdf6['where']=_[_0xa608('0x34')](_0x42fdf6['where'],{'$and':_0x36aacd});if(_0x36c5fc['user'][_0xa608('0x35')]===_0xa608('0x36')){var _0x5bc9a2={'params':{'id':_0x36c5fc[_0xa608('0x36')][_0xa608('0x37')]},'query':{'section':_0xa608('0x38'),'role':_0xa608('0x2c'),'raw':!![],'ids':_0x35b5ac,'customSorting':_0x5a6711}};if(_0x36c5fc[_0xa608('0x10')][_0xa608('0x39')]){_0x5bc9a2['query'][_0xa608('0x39')]=!![];}if(_0xd7da6){_0x5bc9a2['query'][_0xa608('0x3a')]=_0x36aacd;}_0x5bc9a2[_0xa608('0x10')]=Object[_0xa608('0x3b')](_0x5bc9a2['query'],_0x36c5fc[_0xa608('0x10')]);return db['UserProfile']['getResources'](_0x5bc9a2);}return db['User']['findAndCountAll'](_0x42fdf6);})[_0xa608('0x16')](function(_0x5ca361){_0x6d1c50[_0xa608('0x9')]=_0x5ca361['count'];_0x91c4e7=_0x5ca361[_0xa608('0x24')];return _0x91c4e7[_0xa608('0x27')](function(_0x474e23){var _0x30d35=_[_0xa608('0x3c')](_0x116d35,['id',_0x474e23['id']]);if(_0x30d35){var _0x1e16d7=rta[_0xa608('0x3d')](_0x30d35);_[_0xa608('0x34')](_0x474e23,_0x1e16d7);}_0x474e23[_0xa608('0x1c')]=rta[_0xa608('0x3e')](_0x474e23);if(_0x474e23[_0xa608('0x1c')][_0xa608('0x1b')](_0xa608('0x14'))){_0x14ec13[_0xa608('0x32')](function(_0x1ef90b){if(_0x474e23[_0x1ef90b+_0xa608('0x33')]){if(_0x1ef90b===_0xa608('0x3f')){if(_0x474e23['voiceStatus']!==_0xa608('0x40')){_0x474e23['voiceStatus']=_0xa608('0x14');}}else{_0x474e23[_0x1ef90b+_0xa608('0x41')]=_0xa608('0x14');}}});}return _0x474e23;});})[_0xa608('0x16')](function(_0x7043ab){if(!_0x1e78c8||_0x5a6711){return _0x7043ab;}return rta[_0xa608('0x42')](_0x7043ab,_0x1e78c8);})[_0xa608('0x16')](function(_0x16548a){var _0x54a5c0=rta[_0xa608('0x43')]();_0x6d1c50['rows']=_0x16548a[_0xa608('0x27')](function(_0x14ad74){return _['pick'](_0x14ad74,_0x54a5c0);});return _0x6d1c50;})[_0xa608('0x16')](respondWithFilteredResult(_0x45a7cb,_0x42fdf6))[_0xa608('0x44')](APIHandleError(_0x45a7cb));};exports['getQueues']=function(_0x2c94ee,_0x577402){var _0x465ec4={'count':0x0,'rows':[]};var _0x2e127c={};var _0x32e4e2;var _0x371033;var _0x5a663f;Promise[_0xa608('0x45')]()['then'](function(){if(_0x2c94ee['query']['channel']){if(!utils[_0xa608('0x46')](_0x2c94ee['query']['channel'])){throw new APIBadRequestError(util[_0xa608('0x18')](_0xa608('0x19'),_0x2c94ee[_0xa608('0x10')][_0xa608('0x17')]));}_0x32e4e2=_0x2c94ee['query']['channel'][_0xa608('0x47')]();}var _0x332cc2=_['startCase'](_0x32e4e2)+_0xa608('0x48');var _0x5bbac1=_[_0xa608('0x27')](db[_0x332cc2][_0xa608('0x29')],function(_0x57eef1){return{'name':_0x57eef1[_0xa608('0x2a')],'type':_0x57eef1[_0xa608('0x2b')][_0xa608('0x49')]};});if(!_0x2c94ee[_0xa608('0x10')][_0xa608('0x1f')]){var _0x12ae14=['id',_0xa608('0x4a')];if(_0x32e4e2===_0xa608('0x3f')){_0x12ae14[_0xa608('0x2f')](_0xa608('0x2b'));if(_0x2c94ee[_0xa608('0x10')][_0xa608('0x2b')]===_0xa608('0x4b')){_0x12ae14[_0xa608('0x2f')]([_0xa608('0x4c'),_0xa608('0x4d')]);}}_0x2c94ee[_0xa608('0x10')][_0xa608('0x1f')]=_0x12ae14[_0xa608('0x20')](',');}_0x2e127c=qs['getOptions'](_0x5bbac1,_0x2c94ee);if(_0x2c94ee[_0xa608('0x36')]['role']===_0xa608('0x36')){var _0x2c995e={'params':{'id':_0x2c94ee[_0xa608('0x36')][_0xa608('0x37')]},'query':{'section':_0x32e4e2===_0xa608('0x3f')&&_0x2c94ee[_0xa608('0x10')]['type']==='outbound'?_0xa608('0x4e'):_[_0xa608('0x4f')](_0x32e4e2)+_0xa608('0x50'),'type':_0x2c94ee['query'][_0xa608('0x2b')],'nolimit':!![],'sort':'name','filter':_0x2c94ee['query'][_0xa608('0x51')]}};_0x2c995e[_0xa608('0x10')]=Object[_0xa608('0x3b')](_0x2c995e[_0xa608('0x10')],_0x2c94ee[_0xa608('0x10')]);delete _0x2c995e[_0xa608('0x10')]['id'];return db[_0xa608('0x52')][_0xa608('0x53')](_0x2c995e);}return db[_0x332cc2]['findAndCountAll'](_0x2e127c);})['then'](function(_0x267853){_0x465ec4[_0xa608('0x9')]=_0x267853[_0xa608('0x9')];_0x371033=_0x267853['rows'];return rtq[_0xa608('0x54')](_0x2c94ee,_0x32e4e2);})[_0xa608('0x16')](function(_0x4f67df){_0x5a663f=_0x4f67df[_0xa608('0x24')];return rtq['initializeQueues'](_0x371033,_0x5a663f,_0x32e4e2,_0x2c94ee[_0xa608('0x10')][_0xa608('0x2b')]);})[_0xa608('0x16')](function(_0x895604){_0x465ec4[_0xa608('0x24')]=_0x895604;return _0x465ec4;})[_0xa608('0x16')](respondWithFilteredResult(_0x577402,_0x2e127c))['catch'](APIHandleError(_0x577402));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index e4ddc86..0659523 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5c660a,_0x4b5262){var _0x3a77a4=function(_0x479c95){while(--_0x479c95){_0x5c660a['push'](_0x5c660a['shift']());}};_0x3a77a4(++_0x4b5262);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x582bd0,_0x53738e){var _0x4e2d82=function(_0x266111){while(--_0x266111){_0x582bd0['push'](_0x582bd0['shift']());}};_0x4e2d82(++_0x53738e);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 0678309..b617060 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 _0x93bb=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x56cc28,_0x4a921e){var _0x1f5798=function(_0x45f7a5){while(--_0x45f7a5){_0x56cc28['push'](_0x56cc28['shift']());}};_0x1f5798(++_0x4a921e);}(_0x93bb,0x135));var _0xb93b=function(_0x5e5105,_0x38c58e){_0x5e5105=_0x5e5105-0x0;var _0x5e8eb2=_0x93bb[_0x5e5105];return _0x5e8eb2;};'use strict';var Sequelize=require(_0xb93b('0x0'));module[_0xb93b('0x1')]={'state':{'type':Sequelize[_0xb93b('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb93b('0x3')]},'scheduledat':{'type':Sequelize[_0xb93b('0x4')]},'uniqueid':{'type':Sequelize[_0xb93b('0x3')]},'starttime':{'type':Sequelize[_0xb93b('0x4')]},'responsetime':{'type':Sequelize[_0xb93b('0x4')]},'ringtime':{'type':Sequelize[_0xb93b('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb93b('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb93b('0x3')]}}; \ No newline at end of file +var _0xf3a7=['DATE','exports','INTEGER','STRING'];(function(_0x59862e,_0x14e1f9){var _0x387910=function(_0x3d5a55){while(--_0x3d5a55){_0x59862e['push'](_0x59862e['shift']());}};_0x387910(++_0x14e1f9);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7f3a('0x0')]={'state':{'type':Sequelize[_0x7f3a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7f3a('0x2')]},'scheduledat':{'type':Sequelize[_0x7f3a('0x3')]},'uniqueid':{'type':Sequelize[_0x7f3a('0x2')]},'starttime':{'type':Sequelize[_0x7f3a('0x3')]},'responsetime':{'type':Sequelize[_0x7f3a('0x3')]},'ringtime':{'type':Sequelize[_0x7f3a('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7f3a('0x2')]},'campaigntype':{'type':Sequelize[_0x7f3a('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index f5c7800..12b7f62 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 _0x5861=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','lodash','util','../../config/logger','api','request-promise'];(function(_0x4d23dd,_0xc722e9){var _0x3005b6=function(_0x43d6b8){while(--_0x43d6b8){_0x4d23dd['push'](_0x4d23dd['shift']());}};_0x3005b6(++_0xc722e9);}(_0x5861,0xaf));var _0x1586=function(_0x516ee3,_0x2c3e16){_0x516ee3=_0x516ee3-0x0;var _0x384e5e=_0x5861[_0x516ee3];return _0x384e5e;};'use strict';var _=require(_0x1586('0x0'));var util=require(_0x1586('0x1'));var logger=require(_0x1586('0x2'))(_0x1586('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1586('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1586('0x5'));var config=require(_0x1586('0x6'));var attributes=require(_0x1586('0x7'));module[_0x1586('0x8')]=function(_0x333212,_0x35e6b9){return _0x333212['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf521=['bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf521,0x1ac));var _0x1f52=function(_0x5cb6f3,_0x4085bc){_0x5cb6f3=_0x5cb6f3-0x0;var _0x225ffe=_0xf521[_0x5cb6f3];return _0x225ffe;};'use strict';var _=require(_0x1f52('0x0'));var util=require(_0x1f52('0x1'));var logger=require(_0x1f52('0x2'))(_0x1f52('0x3'));var moment=require('moment');var BPromise=require(_0x1f52('0x4'));var rp=require(_0x1f52('0x5'));var fs=require('fs');var path=require(_0x1f52('0x6'));var rimraf=require(_0x1f52('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f52('0x8'));module[_0x1f52('0x9')]=function(_0xdf7be4,_0x13c54d){return _0xdf7be4[_0x1f52('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x1f52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 69e80af..f03b20a 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 _0xe3ab=['rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateReportAgentPreview','create','body','options','raw','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2a0220,_0x26b912){var _0x3b3ace=function(_0x43976f){while(--_0x43976f){_0x2a0220['push'](_0x2a0220['shift']());}};_0x3b3ace(++_0x26b912);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x321f81,_0x3b42ad){_0x321f81=_0x321f81-0x0;var _0x222334=_0xe3ab[_0x321f81];return _0x222334;};'use strict';var _=require(_0xbe3a('0x0'));var util=require('util');var moment=require(_0xbe3a('0x1'));var BPromise=require(_0xbe3a('0x2'));var rs=require(_0xbe3a('0x3'));var fs=require('fs');var Redis=require(_0xbe3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe3a('0x5'));var logger=require('../../config/logger')(_0xbe3a('0x6'));var config=require(_0xbe3a('0x7'));var jayson=require(_0xbe3a('0x8'));var client=jayson[_0xbe3a('0x9')][_0xbe3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b0ca0,_0x127fb1,_0x28151d){return new BPromise(function(_0x16f31a,_0x2ce90a){return client[_0xbe3a('0xb')](_0x3b0ca0,_0x28151d)[_0xbe3a('0xc')](function(_0x4e2e89){logger['info'](_0xbe3a('0xd'),_0x127fb1,_0xbe3a('0xe'));logger['debug'](_0xbe3a('0xf'),_0x127fb1,_0xbe3a('0xe'),JSON['stringify'](_0x4e2e89));if(_0x4e2e89[_0xbe3a('0x10')]){if(_0x4e2e89['error'][_0xbe3a('0x11')]===0x1f4){logger[_0xbe3a('0x10')](_0xbe3a('0xd'),_0x127fb1,_0x4e2e89[_0xbe3a('0x10')][_0xbe3a('0x12')]);return _0x2ce90a(_0x4e2e89[_0xbe3a('0x10')][_0xbe3a('0x12')]);}logger[_0xbe3a('0x10')](_0xbe3a('0xd'),_0x127fb1,_0x4e2e89[_0xbe3a('0x10')]['message']);return _0x16f31a(_0x4e2e89[_0xbe3a('0x10')][_0xbe3a('0x12')]);}else{logger[_0xbe3a('0x13')](_0xbe3a('0xd'),_0x127fb1,_0xbe3a('0xe'));_0x16f31a(_0x4e2e89[_0xbe3a('0x14')]['message']);}})[_0xbe3a('0x15')](function(_0x670959){logger[_0xbe3a('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x127fb1,_0x670959);_0x2ce90a(_0x670959);});});}exports[_0xbe3a('0x16')]=function(_0x13bc9d){var _0x2e1963=this;return new Promise(function(_0x120c7b,_0x1ab9f9){return db['ReportAgentPreview'][_0xbe3a('0x17')](_0x13bc9d[_0xbe3a('0x18')],{'raw':_0x13bc9d['options']?_0x13bc9d[_0xbe3a('0x19')][_0xbe3a('0x1a')]===undefined?!![]:![]:!![]})[_0xbe3a('0xc')](function(_0x5e6b76){logger[_0xbe3a('0x13')](_0xbe3a('0x16'),_0x13bc9d);logger[_0xbe3a('0x1b')]('CreateReportAgentPreview',_0x13bc9d,JSON[_0xbe3a('0x1c')](_0x5e6b76));_0x120c7b(_0x5e6b76);})[_0xbe3a('0x15')](function(_0x40bf5e){logger[_0xbe3a('0x10')]('CreateReportAgentPreview',_0x40bf5e[_0xbe3a('0x12')],_0x13bc9d);_0x1ab9f9(_0x2e1963['error'](0x1f4,_0x40bf5e[_0xbe3a('0x12')]));});});}; \ No newline at end of file +var _0x72d5=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','util','bluebird'];(function(_0x205941,_0x410eb2){var _0x32478e=function(_0x160333){while(--_0x160333){_0x205941['push'](_0x205941['shift']());}};_0x32478e(++_0x410eb2);}(_0x72d5,0x1e4));var _0x572d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x572d('0x0'));var moment=require('moment');var BPromise=require(_0x572d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x572d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x572d('0x3'));var logger=require(_0x572d('0x4'))(_0x572d('0x5'));var config=require(_0x572d('0x6'));var jayson=require(_0x572d('0x7'));var client=jayson[_0x572d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2746f1,_0x194811,_0x3c002a){return new BPromise(function(_0x14282e,_0x198d25){return client[_0x572d('0x9')](_0x2746f1,_0x3c002a)[_0x572d('0xa')](function(_0x448796){logger[_0x572d('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x194811,_0x572d('0xc'));logger[_0x572d('0xd')](_0x572d('0xe'),_0x194811,'request\x20sent',JSON[_0x572d('0xf')](_0x448796));if(_0x448796['error']){if(_0x448796[_0x572d('0x10')]['code']===0x1f4){logger[_0x572d('0x10')](_0x572d('0x11'),_0x194811,_0x448796[_0x572d('0x10')][_0x572d('0x12')]);return _0x198d25(_0x448796[_0x572d('0x10')][_0x572d('0x12')]);}logger[_0x572d('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x194811,_0x448796[_0x572d('0x10')][_0x572d('0x12')]);return _0x14282e(_0x448796[_0x572d('0x10')]['message']);}else{logger[_0x572d('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x194811,'request\x20sent');_0x14282e(_0x448796[_0x572d('0x13')][_0x572d('0x12')]);}})[_0x572d('0x14')](function(_0xe33bc5){logger[_0x572d('0x10')](_0x572d('0x11'),_0x194811,_0xe33bc5);_0x198d25(_0xe33bc5);});});}exports[_0x572d('0x15')]=function(_0x4024bf){var _0x5011d2=this;return new Promise(function(_0x5ea1ea,_0x28a39c){return db[_0x572d('0x16')][_0x572d('0x17')](_0x4024bf[_0x572d('0x18')],{'raw':_0x4024bf[_0x572d('0x19')]?_0x4024bf[_0x572d('0x19')][_0x572d('0x1a')]===undefined?!![]:![]:!![]})[_0x572d('0xa')](function(_0x3fffdf){logger[_0x572d('0xb')](_0x572d('0x15'),_0x4024bf);logger[_0x572d('0xd')](_0x572d('0x15'),_0x4024bf,JSON[_0x572d('0xf')](_0x3fffdf));_0x5ea1ea(_0x3fffdf);})['catch'](function(_0x5de29b){logger[_0x572d('0x10')]('CreateReportAgentPreview',_0x5de29b[_0x572d('0x12')],_0x4024bf);_0x28a39c(_0x5011d2[_0x572d('0x10')](0x1f4,_0x5de29b[_0x572d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index b7fd9da..4e4eb26 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 _0xf1c5=['/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','express','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailAccounts','/openchannel/queues','openchannelQueues'];(function(_0x31e997,_0x295fb6){var _0x2b8cd8=function(_0x1476b1){while(--_0x1476b1){_0x31e997['push'](_0x31e997['shift']());}};_0x2b8cd8(++_0x295fb6);}(_0xf1c5,0xd9));var _0x5f1c=function(_0x6496d,_0x263cb6){_0x6496d=_0x6496d-0x0;var _0x3ac068=_0xf1c5[_0x6496d];return _0x3ac068;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0x5f1c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x5f1c('0x1'));router[_0x5f1c('0x2')]('/voice/channels',auth[_0x5f1c('0x3')](),controller['voiceChannels']);router['get'](_0x5f1c('0x4'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x5')]);router[_0x5f1c('0x2')](_0x5f1c('0x6'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x7')]);router[_0x5f1c('0x2')]('/voice/queues',auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x8')]);router[_0x5f1c('0x2')](_0x5f1c('0x9'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0xa')]);router['get']('/mail/queues',auth[_0x5f1c('0x3')](),controller['mailQueues']);router[_0x5f1c('0x2')]('/mail/accounts',auth[_0x5f1c('0x3')](),controller[_0x5f1c('0xb')]);router[_0x5f1c('0x2')](_0x5f1c('0xc'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0xd')]);router[_0x5f1c('0x2')](_0x5f1c('0xe'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0xf')]);router['get'](_0x5f1c('0x10'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x11')]);router[_0x5f1c('0x2')](_0x5f1c('0x12'),auth[_0x5f1c('0x3')](),controller['faxQueues']);router[_0x5f1c('0x2')](_0x5f1c('0x13'),auth[_0x5f1c('0x3')](),controller['voiceQueuesPreview']);router[_0x5f1c('0x2')](_0x5f1c('0x14'),auth[_0x5f1c('0x3')](),controller['voiceQueuesChannels']);router[_0x5f1c('0x2')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x5f1c('0x15')]);router['get'](_0x5f1c('0x16'),auth['isAuthenticated'](),controller[_0x5f1c('0x17')]);router[_0x5f1c('0x2')](_0x5f1c('0x18'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x19')]);router[_0x5f1c('0x2')](_0x5f1c('0x1a'),auth['isAuthenticated'](),controller[_0x5f1c('0x1b')]);router[_0x5f1c('0x1c')](_0x5f1c('0x1a'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x1d')]);router[_0x5f1c('0x2')](_0x5f1c('0x1e'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x1f')]);router[_0x5f1c('0x2')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x5f1c('0x20')]);router['get'](_0x5f1c('0x21'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x22')]);router[_0x5f1c('0x1c')](_0x5f1c('0x23'),auth[_0x5f1c('0x3')](),controller['agentCapacity']);router['get'](_0x5f1c('0x24'),auth['isAuthenticated'](),controller['telephones']);router['get'](_0x5f1c('0x25'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x26')]);router['get'](_0x5f1c('0x27'),auth[_0x5f1c('0x3')](),controller['campaigns']);router[_0x5f1c('0x2')](_0x5f1c('0x28'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x5f1c('0x2')](_0x5f1c('0x29'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x2a')]);router[_0x5f1c('0x2')](_0x5f1c('0x2b'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x2c')]);router['get'](_0x5f1c('0x2d'),auth['isAuthenticated'](),controller[_0x5f1c('0x2e')]);router[_0x5f1c('0x2')](_0x5f1c('0x2f'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x30')]);router[_0x5f1c('0x2')](_0x5f1c('0x31'),auth['isAuthenticated'](),controller[_0x5f1c('0x32')]);router[_0x5f1c('0x2')](_0x5f1c('0x33'),auth[_0x5f1c('0x3')](),controller['whatsappQueuesWaitingInteractions']);router[_0x5f1c('0x2')](_0x5f1c('0x34'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x5f1c('0x35')](_0x5f1c('0x36'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x37')](_0x5f1c('0x38')));router[_0x5f1c('0x2')]('/mail/queues/:id',auth['isAuthenticated'](),controller['showMailQueues']);router[_0x5f1c('0x35')](_0x5f1c('0x39'),auth['isAuthenticated'](),controller[_0x5f1c('0x37')](_0x5f1c('0x3a')));router[_0x5f1c('0x2')]('/chat/queues/:id',auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x3b')]);router[_0x5f1c('0x35')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5f1c('0x37')](_0x5f1c('0x3c')));router[_0x5f1c('0x2')](_0x5f1c('0x3d'),auth['isAuthenticated'](),controller[_0x5f1c('0x3e')]);router[_0x5f1c('0x35')]('/openchannel/queues/:id/notify',auth[_0x5f1c('0x3')](),controller['queueNotify'](_0x5f1c('0x3f')));router[_0x5f1c('0x2')](_0x5f1c('0x40'),auth['isAuthenticated'](),controller[_0x5f1c('0x41')]);router[_0x5f1c('0x35')](_0x5f1c('0x42'),auth[_0x5f1c('0x3')](),controller['queueNotify'](_0x5f1c('0x43')));router[_0x5f1c('0x35')](_0x5f1c('0x44'),auth['isAuthenticated'](),controller[_0x5f1c('0x37')](_0x5f1c('0x45')));router['get'](_0x5f1c('0x46'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x47')]);router[_0x5f1c('0x2')](_0x5f1c('0x48'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x49')]);router[_0x5f1c('0x35')](_0x5f1c('0x4a'),auth[_0x5f1c('0x3')](),controller[_0x5f1c('0x4b')]);module[_0x5f1c('0x4c')]=router; \ No newline at end of file +var _0xcb05=['/voice/queues','mailQueues','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','/agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb05,0x86));var _0x5cb0=function(_0x536ca6,_0x2a9a1d){_0x536ca6=_0x536ca6-0x0;var _0x4afae3=_0xcb05[_0x536ca6];return _0x4afae3;};'use strict';var multer=require(_0x5cb0('0x0'));var util=require(_0x5cb0('0x1'));var path=require(_0x5cb0('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x5cb0('0x3'));var controller=require(_0x5cb0('0x4'));router[_0x5cb0('0x5')](_0x5cb0('0x6'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x8')]);router[_0x5cb0('0x5')](_0x5cb0('0x9'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0xa')]);router[_0x5cb0('0x5')](_0x5cb0('0xb'),auth[_0x5cb0('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x5cb0('0x5')](_0x5cb0('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0x5cb0('0x7')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0xd')]);router[_0x5cb0('0x5')]('/mail/accounts',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0xe')]);router[_0x5cb0('0x5')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x5cb0('0xf')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0x5cb0('0x10')]);router['get'](_0x5cb0('0x11'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x12')]);router[_0x5cb0('0x5')](_0x5cb0('0x13'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x5cb0('0x5')]('/voice/queues/preview/:id',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x14')]);router[_0x5cb0('0x5')](_0x5cb0('0x15'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x16')]);router[_0x5cb0('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x17')]);router[_0x5cb0('0x5')](_0x5cb0('0x18'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x19')]);router[_0x5cb0('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x5cb0('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x5cb0('0x5')](_0x5cb0('0x1a'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x1b')]);router[_0x5cb0('0x1c')](_0x5cb0('0x1a'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x1d')]);router[_0x5cb0('0x5')]('/outbound',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x1e')]);router['get'](_0x5cb0('0x1f'),auth[_0x5cb0('0x7')](),controller['outboundChannels']);router[_0x5cb0('0x5')](_0x5cb0('0x20'),auth[_0x5cb0('0x7')](),controller['agents']);router[_0x5cb0('0x1c')](_0x5cb0('0x21'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x22')]);router['get'](_0x5cb0('0x23'),auth['isAuthenticated'](),controller['telephones']);router[_0x5cb0('0x5')](_0x5cb0('0x24'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x25')]);router['get'](_0x5cb0('0x26'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x27')]);router[_0x5cb0('0x5')](_0x5cb0('0x28'),auth[_0x5cb0('0x7')](),controller['faxAccounts']);router['get'](_0x5cb0('0x29'),auth[_0x5cb0('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0x5cb0('0x5')](_0x5cb0('0x2a'),auth[_0x5cb0('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x5cb0('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x2b')]);router[_0x5cb0('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x2c')]);router[_0x5cb0('0x5')](_0x5cb0('0x2d'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x2e')]);router[_0x5cb0('0x5')](_0x5cb0('0x2f'),auth['isAuthenticated'](),controller[_0x5cb0('0x30')]);router['get'](_0x5cb0('0x31'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x32')]);router[_0x5cb0('0x33')](_0x5cb0('0x34'),auth[_0x5cb0('0x7')](),controller['queueNotify'](_0x5cb0('0x35')));router['get'](_0x5cb0('0x36'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x37')]);router['post'](_0x5cb0('0x38'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x39')](_0x5cb0('0x3a')));router['get']('/chat/queues/:id',auth[_0x5cb0('0x7')](),controller['showChatQueues']);router[_0x5cb0('0x33')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5cb0('0x39')]('fax'));router[_0x5cb0('0x5')](_0x5cb0('0x3b'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x3c')]);router['post'](_0x5cb0('0x3d'),auth['isAuthenticated'](),controller[_0x5cb0('0x39')](_0x5cb0('0x3e')));router[_0x5cb0('0x5')](_0x5cb0('0x3f'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x40')]);router[_0x5cb0('0x33')]('/sms/queues/:id/notify',auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x39')]('sms'));router[_0x5cb0('0x33')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x5cb0('0x39')](_0x5cb0('0x41')));router[_0x5cb0('0x5')](_0x5cb0('0x42'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x43')]);router[_0x5cb0('0x5')](_0x5cb0('0x44'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x45')]);router['post'](_0x5cb0('0x46'),auth[_0x5cb0('0x7')](),controller[_0x5cb0('0x47')]);module[_0x5cb0('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 0f10f04..b69ddaa 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 _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x4506ef,_0x2dc975){var _0x4e44ad=function(_0x5da483){while(--_0x5da483){_0x4506ef['push'](_0x4506ef['shift']());}};_0x4e44ad(++_0x2dc975);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x3fe5d2,_0x3f8e4a){var _0x26411e=function(_0x59c754){while(--_0x59c754){_0x3fe5d2['push'](_0x3fe5d2['shift']());}};_0x26411e(++_0x3f8e4a);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 25a61e0..dcf205b 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 _0x414f=['isAuthenticated','run','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','show'];(function(_0x3c54e3,_0x17c963){var _0x36ecc1=function(_0x564f85){while(--_0x564f85){_0x3c54e3['push'](_0x3c54e3['shift']());}};_0x36ecc1(++_0x17c963);}(_0x414f,0xc1));var _0xf414=function(_0x563d3b,_0x40812b){_0x563d3b=_0x563d3b-0x0;var _0xcc6fa4=_0x414f[_0x563d3b];return _0xcc6fa4;};'use strict';var multer=require(_0xf414('0x0'));var util=require(_0xf414('0x1'));var path=require(_0xf414('0x2'));var timeout=require(_0xf414('0x3'));var express=require(_0xf414('0x4'));var router=express[_0xf414('0x5')]();var fs_extra=require(_0xf414('0x6'));var auth=require(_0xf414('0x7'));var interaction=require(_0xf414('0x8'));var config=require(_0xf414('0x9'));var controller=require(_0xf414('0xa'));router[_0xf414('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf414('0xc'),auth['isAuthenticated'](),controller[_0xf414('0xd')]);router[_0xf414('0xb')]('/:id/run',auth[_0xf414('0xe')](),controller[_0xf414('0xf')]);router[_0xf414('0x10')]('/',auth[_0xf414('0xe')](),controller[_0xf414('0x11')]);router[_0xf414('0x12')](_0xf414('0xc'),auth[_0xf414('0xe')](),controller[_0xf414('0x13')]);router[_0xf414('0x14')](_0xf414('0xc'),auth[_0xf414('0xe')](),controller[_0xf414('0x15')]);module[_0xf414('0x16')]=router; \ No newline at end of file +var _0x405d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','/:id','show','run','create','delete'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x405d,0xea));var _0xd405=function(_0x405764,_0x30c6af){_0x405764=_0x405764-0x0;var _0xe95933=_0x405d[_0x405764];return _0xe95933;};'use strict';var multer=require(_0xd405('0x0'));var util=require(_0xd405('0x1'));var path=require(_0xd405('0x2'));var timeout=require(_0xd405('0x3'));var express=require(_0xd405('0x4'));var router=express[_0xd405('0x5')]();var fs_extra=require(_0xd405('0x6'));var auth=require(_0xd405('0x7'));var interaction=require(_0xd405('0x8'));var config=require(_0xd405('0x9'));var controller=require(_0xd405('0xa'));router['get']('/',auth[_0xd405('0xb')](),controller[_0xd405('0xc')]);router['get'](_0xd405('0xd'),auth[_0xd405('0xb')](),controller[_0xd405('0xe')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0xd405('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd405('0x10')]);router['put'](_0xd405('0xd'),auth[_0xd405('0xb')](),controller['update']);router[_0xd405('0x11')](_0xd405('0xd'),auth[_0xd405('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index af64e47..44202bb 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 _0x67ef=['pdf','xlsx','csv','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','days','hours'];(function(_0x378bc8,_0x479dce){var _0x128a05=function(_0x42a7f5){while(--_0x42a7f5){_0x378bc8['push'](_0x378bc8['shift']());}};_0x128a05(++_0x479dce);}(_0x67ef,0x1d1));var _0xf67e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x67ef[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require('sequelize');module[_0xf67e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf67e('0x1')]},'active':{'type':Sequelize[_0xf67e('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf67e('0x1')],'allowNull':![],'defaultValue':_0xf67e('0x3')},'startAt':{'type':Sequelize[_0xf67e('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf67e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf67e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf67e('0x6')](_0xf67e('0x7'),_0xf67e('0x8'),'months','weeks',_0xf67e('0x9'),_0xf67e('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xf67e('0x9')},'output':{'type':Sequelize[_0xf67e('0x6')]('csv',_0xf67e('0xb'),_0xf67e('0xc')),'allowNull':![],'defaultValue':_0xf67e('0xd')},'type':{'type':Sequelize[_0xf67e('0x6')](_0xf67e('0xe'),_0xf67e('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xf67e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xf67e('0x1')]},'cc':{'type':Sequelize[_0xf67e('0x10')]},'bcc':{'type':Sequelize[_0xf67e('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2055=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','csv','pdf','xlsx','default','TEXT','sequelize'];(function(_0x8c77b7,_0x52507b){var _0x32707a=function(_0x3f1f6d){while(--_0x3f1f6d){_0x8c77b7['push'](_0x8c77b7['shift']());}};_0x32707a(++_0x52507b);}(_0x2055,0x84));var _0x5205=function(_0x5e230c,_0x4d5960){_0x5e230c=_0x5e230c-0x0;var _0x3d7956=_0x2055[_0x5e230c];return _0x3d7956;};'use strict';var Sequelize=require(_0x5205('0x0'));module[_0x5205('0x1')]={'name':{'type':Sequelize[_0x5205('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5205('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5205('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x5205('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5205('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5205('0x7')](_0x5205('0x8'),_0x5205('0x9'),'months',_0x5205('0xa'),_0x5205('0xb'),_0x5205('0xc'),_0x5205('0xd')),'allowNull':![],'defaultValue':_0x5205('0xb')},'output':{'type':Sequelize[_0x5205('0x7')](_0x5205('0xe'),_0x5205('0xf'),_0x5205('0x10')),'allowNull':![],'defaultValue':_0x5205('0xe')},'type':{'type':Sequelize['ENUM']('custom',_0x5205('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5205('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x5205('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x5205('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 88f8123..04d34a0 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 _0x6dc7=['findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','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','apply','reject','save','then','get','Scheduler','destroy','name','send','index','map','Schedule','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0xbb704,_0x4bc327){var _0x37ba6d=function(_0x1304e0){while(--_0x1304e0){_0xbb704['push'](_0xbb704['shift']());}};_0x37ba6d(++_0x4bc327);}(_0x6dc7,0x67));var _0x76dc=function(_0x276603,_0x14db81){_0x276603=_0x276603-0x0;var _0x3b3ec8=_0x6dc7[_0x276603];return _0x3b3ec8;};'use strict';var emlformat=require(_0x76dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76dc('0x1'));var jsonpatch=require(_0x76dc('0x2'));var rp=require(_0x76dc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x76dc('0x4'));var path=require('path');var sox=require(_0x76dc('0x5'));var csv=require(_0x76dc('0x6'));var ejs=require(_0x76dc('0x7'));var fs=require('fs');var fs_extra=require(_0x76dc('0x8'));var _=require(_0x76dc('0x9'));var squel=require(_0x76dc('0xa'));var crypto=require(_0x76dc('0xb'));var jsforce=require(_0x76dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x76dc('0x6'));var querystring=require(_0x76dc('0xd'));var Papa=require('papaparse');var Redis=require(_0x76dc('0xe'));var authService=require(_0x76dc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x76dc('0x10'));var hardwareService=require(_0x76dc('0x11'));var logger=require(_0x76dc('0x12'))(_0x76dc('0x13'));var utils=require(_0x76dc('0x14'));var config=require(_0x76dc('0x15'));var licenseUtil=require(_0x76dc('0x16'));var db=require(_0x76dc('0x17'))['db'];function respondWithStatusCode(_0x33249b,_0x5604a6){_0x5604a6=_0x5604a6||0xcc;return function(_0x349940){if(_0x349940){return _0x33249b[_0x76dc('0x18')](_0x5604a6);}return _0x33249b[_0x76dc('0x19')](_0x5604a6)[_0x76dc('0x1a')]();};}function respondWithResult(_0x211f74,_0x4c3cca){_0x4c3cca=_0x4c3cca||0xc8;return function(_0x125a9c){if(_0x125a9c){return _0x211f74[_0x76dc('0x19')](_0x4c3cca)[_0x76dc('0x1b')](_0x125a9c);}};}function respondWithFilteredResult(_0x3259a0,_0x219e8a){return function(_0x1a9f5d){if(_0x1a9f5d){var _0x28cd56=typeof _0x219e8a[_0x76dc('0x1c')]===_0x76dc('0x1d')&&typeof _0x219e8a[_0x76dc('0x1e')]==='undefined';var _0x3435ee=_0x1a9f5d[_0x76dc('0x1f')];var _0x1a0266=_0x28cd56?0x0:_0x219e8a[_0x76dc('0x1c')];var _0xb42500=_0x28cd56?_0x1a9f5d['count']:_0x219e8a[_0x76dc('0x1c')]+_0x219e8a[_0x76dc('0x1e')];var _0x267911;if(_0xb42500>=_0x3435ee){_0xb42500=_0x3435ee;_0x267911=0xc8;}else{_0x267911=0xce;}_0x3259a0['status'](_0x267911);return _0x3259a0[_0x76dc('0x20')]('Content-Range',_0x1a0266+'-'+_0xb42500+'/'+_0x3435ee)['json'](_0x1a9f5d);}return null;};}function patchUpdates(_0x308d80){return function(_0x27ef14){try{jsonpatch[_0x76dc('0x21')](_0x27ef14,_0x308d80,!![]);}catch(_0x2ccfe4){return BPromise[_0x76dc('0x22')](_0x2ccfe4);}return _0x27ef14[_0x76dc('0x23')]();};}function saveUpdates(_0x25ee8d,_0x1c09cd){return function(_0x6d290a){if(_0x6d290a){return _0x6d290a['update'](_0x25ee8d)[_0x76dc('0x24')](function(_0xb5f54a){return _0xb5f54a;});}return null;};}function removeEntity(_0x15e6a3,_0x47dc32){return function(_0x229bbc){if(_0x229bbc){return _0x229bbc['destroy']()[_0x76dc('0x24')](function(){var _0x4d6fb0=_0x229bbc[_0x76dc('0x25')]({'plain':!![]});var _0x2ebd35=_0x76dc('0x26');return db['UserProfileResource'][_0x76dc('0x27')]({'where':{'type':_0x2ebd35,'resourceId':_0x4d6fb0['id']}})['then'](function(){return _0x229bbc;});})['then'](function(){_0x15e6a3[_0x76dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x132c78,_0xe9c271){return function(_0x56a2bf){if(!_0x56a2bf){_0x132c78[_0x76dc('0x18')](0x194);}return _0x56a2bf;};}function handleError(_0x39dba6,_0x3feba6){_0x3feba6=_0x3feba6||0x1f4;return function(_0x2cdaf2){logger['error'](_0x2cdaf2['stack']);if(_0x2cdaf2[_0x76dc('0x28')]){delete _0x2cdaf2['name'];}_0x39dba6['status'](_0x3feba6)[_0x76dc('0x29')](_0x2cdaf2);};}exports[_0x76dc('0x2a')]=function(_0x553ce7,_0x213895){var _0x35320a={},_0x16804c={},_0xc33987={'count':0x0,'rows':[]};var _0x493c7e=_[_0x76dc('0x2b')](db[_0x76dc('0x2c')]['rawAttributes'],function(_0x402729){return{'name':_0x402729['fieldName'],'type':_0x402729[_0x76dc('0x2d')][_0x76dc('0x2e')]};});_0x16804c[_0x76dc('0x2f')]=_['map'](_0x493c7e,_0x76dc('0x28'));_0x16804c[_0x76dc('0x30')]=_[_0x76dc('0x31')](_0x553ce7['query']);_0x16804c[_0x76dc('0x32')]=_[_0x76dc('0x33')](_0x16804c['model'],_0x16804c[_0x76dc('0x30')]);_0x35320a['attributes']=_[_0x76dc('0x33')](_0x16804c[_0x76dc('0x2f')],qs[_0x76dc('0x34')](_0x553ce7[_0x76dc('0x30')]['fields']));_0x35320a['attributes']=_0x35320a[_0x76dc('0x35')][_0x76dc('0x36')]?_0x35320a[_0x76dc('0x35')]:_0x16804c[_0x76dc('0x2f')];if(!_0x553ce7['query'][_0x76dc('0x37')]('nolimit')){_0x35320a[_0x76dc('0x1e')]=qs[_0x76dc('0x1e')](_0x553ce7[_0x76dc('0x30')][_0x76dc('0x1e')]);_0x35320a[_0x76dc('0x1c')]=qs[_0x76dc('0x1c')](_0x553ce7['query'][_0x76dc('0x1c')]);}_0x35320a[_0x76dc('0x38')]=qs[_0x76dc('0x39')](_0x553ce7[_0x76dc('0x30')][_0x76dc('0x39')]);_0x35320a[_0x76dc('0x3a')]=qs['filters'](_[_0x76dc('0x3b')](_0x553ce7[_0x76dc('0x30')],_0x16804c[_0x76dc('0x32')]),_0x493c7e);if(_0x553ce7[_0x76dc('0x30')][_0x76dc('0x3c')]){_0x35320a[_0x76dc('0x3a')]=_[_0x76dc('0x3d')](_0x35320a[_0x76dc('0x3a')],{'$or':_[_0x76dc('0x2b')](_0x493c7e,function(_0x37fa9f){if(_0x37fa9f[_0x76dc('0x2d')]!=='VIRTUAL'){var _0x2240fe={};_0x2240fe[_0x37fa9f[_0x76dc('0x28')]]={'$like':'%'+_0x553ce7['query'][_0x76dc('0x3c')]+'%'};return _0x2240fe;}})});}_0x35320a=_[_0x76dc('0x3d')]({},_0x35320a,_0x553ce7[_0x76dc('0x3e')]);var _0x5594d5={'where':_0x35320a[_0x76dc('0x3a')]};return db[_0x76dc('0x2c')][_0x76dc('0x1f')](_0x5594d5)['then'](function(_0x4e5a68){_0xc33987[_0x76dc('0x1f')]=_0x4e5a68;if(_0x553ce7['query'][_0x76dc('0x3f')]){_0x35320a[_0x76dc('0x40')]=[{'all':!![]}];}return db[_0x76dc('0x2c')][_0x76dc('0x41')](_0x35320a);})[_0x76dc('0x24')](function(_0x36e4ee){_0xc33987[_0x76dc('0x42')]=_0x36e4ee;return _0xc33987;})['then'](respondWithFilteredResult(_0x213895,_0x35320a))[_0x76dc('0x43')](handleError(_0x213895,null));};exports[_0x76dc('0x44')]=function(_0x2c9a24,_0x46cdf5){var _0x215cd8={'raw':![],'where':{'id':_0x2c9a24[_0x76dc('0x45')]['id']}},_0xf89000={};_0xf89000[_0x76dc('0x2f')]=_[_0x76dc('0x31')](db[_0x76dc('0x2c')][_0x76dc('0x46')]);_0xf89000[_0x76dc('0x30')]=_['keys'](_0x2c9a24[_0x76dc('0x30')]);_0xf89000[_0x76dc('0x32')]=_['intersection'](_0xf89000[_0x76dc('0x2f')],_0xf89000['query']);_0x215cd8[_0x76dc('0x35')]=_[_0x76dc('0x33')](_0xf89000[_0x76dc('0x2f')],qs['fields'](_0x2c9a24[_0x76dc('0x30')][_0x76dc('0x34')]));_0x215cd8[_0x76dc('0x35')]=_0x215cd8[_0x76dc('0x35')][_0x76dc('0x36')]?_0x215cd8[_0x76dc('0x35')]:_0xf89000[_0x76dc('0x2f')];if(_0x2c9a24['query'][_0x76dc('0x3f')]){_0x215cd8[_0x76dc('0x40')]=[{'all':!![]}];}_0x215cd8=_[_0x76dc('0x3d')]({},_0x215cd8,_0x2c9a24[_0x76dc('0x3e')]);return db['Schedule'][_0x76dc('0x47')](_0x215cd8)['then'](handleEntityNotFound(_0x46cdf5,null))[_0x76dc('0x24')](respondWithResult(_0x46cdf5,null))['catch'](handleError(_0x46cdf5,null));};exports['create']=function(_0x1d1e49,_0x12b41b){return db[_0x76dc('0x2c')][_0x76dc('0x48')](_0x1d1e49[_0x76dc('0x49')],{})[_0x76dc('0x24')](function(_0x4dcd61){var _0x4291ea=_0x1d1e49[_0x76dc('0x4a')]['get']({'plain':!![]});if(!_0x4291ea)throw new Error(_0x76dc('0x4b'));if(_0x4291ea[_0x76dc('0x4c')]===_0x76dc('0x4a')){var _0x1f488a=_0x4dcd61[_0x76dc('0x25')]({'plain':!![]});var _0x48ee54=_0x76dc('0x26');return db[_0x76dc('0x4d')][_0x76dc('0x47')]({'where':{'name':_0x48ee54,'userProfileId':_0x4291ea[_0x76dc('0x4e')]},'raw':!![]})['then'](function(_0x49655f){if(_0x49655f&&_0x49655f['autoAssociation']===0x0){return db[_0x76dc('0x4f')][_0x76dc('0x48')]({'name':_0x1f488a[_0x76dc('0x28')],'resourceId':_0x1f488a['id'],'type':_0x49655f[_0x76dc('0x28')],'sectionId':_0x49655f['id']},{})[_0x76dc('0x24')](function(){return _0x4dcd61;});}else{return _0x4dcd61;}})['catch'](function(_0x28ee63){logger['error'](_0x76dc('0x50'),_0x28ee63);throw _0x28ee63;});}return _0x4dcd61;})[_0x76dc('0x24')](respondWithResult(_0x12b41b,0xc9))[_0x76dc('0x43')](handleError(_0x12b41b,null));};exports[_0x76dc('0x51')]=function(_0x380bd3,_0x6cfbba){if(_0x380bd3['body']['id']){delete _0x380bd3[_0x76dc('0x49')]['id'];}return db['Schedule'][_0x76dc('0x47')]({'where':{'id':_0x380bd3[_0x76dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x6cfbba,null))[_0x76dc('0x24')](saveUpdates(_0x380bd3[_0x76dc('0x49')],null))['then'](respondWithResult(_0x6cfbba,null))[_0x76dc('0x43')](handleError(_0x6cfbba,null));};exports[_0x76dc('0x27')]=function(_0x4c2ae4,_0x1fae90){return db[_0x76dc('0x2c')][_0x76dc('0x47')]({'where':{'id':_0x4c2ae4['params']['id']}})['then'](handleEntityNotFound(_0x1fae90,null))[_0x76dc('0x24')](removeEntity(_0x1fae90,null))[_0x76dc('0x43')](handleError(_0x1fae90,null));};exports[_0x76dc('0x52')]=function(_0x24b3b6,_0x3179be,_0x71df53){var _0x3b6a49=require(_0x76dc('0x53'));return db[_0x76dc('0x2c')][_0x76dc('0x47')]({'where':{'id':_0x24b3b6['params']['id']},'raw':!![]})[_0x76dc('0x24')](handleEntityNotFound(_0x3179be,null))['then'](function(){_0x3b6a49['run'](_0x24b3b6[_0x76dc('0x45')]['id']);})[_0x76dc('0x24')](respondWithStatusCode(_0x3179be,null))[_0x76dc('0x43')](handleError(_0x3179be,null));}; \ No newline at end of file +var _0x4c31=['include','rows','catch','length','create','body','user','role','UserProfileSection','userProfileId','find','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Scheduler','error','stack','name','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x177cda,_0x1b4c02){var _0x335935=function(_0x4a7576){while(--_0x4a7576){_0x177cda['push'](_0x177cda['shift']());}};_0x335935(++_0x1b4c02);}(_0x4c31,0x104));var _0x14c3=function(_0x5d594e,_0x333c09){_0x5d594e=_0x5d594e-0x0;var _0x54d309=_0x4c31[_0x5d594e];return _0x54d309;};'use strict';var emlformat=require(_0x14c3('0x0'));var rimraf=require(_0x14c3('0x1'));var zipdir=require(_0x14c3('0x2'));var jsonpatch=require(_0x14c3('0x3'));var rp=require(_0x14c3('0x4'));var moment=require(_0x14c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x14c3('0x6'));var util=require(_0x14c3('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14c3('0x8'));var fs=require('fs');var fs_extra=require(_0x14c3('0x9'));var _=require(_0x14c3('0xa'));var squel=require(_0x14c3('0xb'));var crypto=require(_0x14c3('0xc'));var jsforce=require(_0x14c3('0xd'));var deskjs=require(_0x14c3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x14c3('0xf'));var Redis=require(_0x14c3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14c3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c3('0x12'));var logger=require(_0x14c3('0x13'))(_0x14c3('0x14'));var utils=require(_0x14c3('0x15'));var config=require(_0x14c3('0x16'));var licenseUtil=require(_0x14c3('0x17'));var db=require(_0x14c3('0x18'))['db'];function respondWithStatusCode(_0x99cd35,_0x289ac5){_0x289ac5=_0x289ac5||0xcc;return function(_0x1ce2bc){if(_0x1ce2bc){return _0x99cd35[_0x14c3('0x19')](_0x289ac5);}return _0x99cd35[_0x14c3('0x1a')](_0x289ac5)[_0x14c3('0x1b')]();};}function respondWithResult(_0x119c99,_0x146de5){_0x146de5=_0x146de5||0xc8;return function(_0x3e7ffe){if(_0x3e7ffe){return _0x119c99[_0x14c3('0x1a')](_0x146de5)[_0x14c3('0x1c')](_0x3e7ffe);}};}function respondWithFilteredResult(_0x22fd74,_0xb3265a){return function(_0x4a1d7e){if(_0x4a1d7e){var _0x3e183c=typeof _0xb3265a[_0x14c3('0x1d')]==='undefined'&&typeof _0xb3265a['limit']==='undefined';var _0x479155=_0x4a1d7e['count'];var _0x40ceb0=_0x3e183c?0x0:_0xb3265a[_0x14c3('0x1d')];var _0x367d7e=_0x3e183c?_0x4a1d7e[_0x14c3('0x1e')]:_0xb3265a[_0x14c3('0x1d')]+_0xb3265a[_0x14c3('0x1f')];var _0x134e63;if(_0x367d7e>=_0x479155){_0x367d7e=_0x479155;_0x134e63=0xc8;}else{_0x134e63=0xce;}_0x22fd74[_0x14c3('0x1a')](_0x134e63);return _0x22fd74[_0x14c3('0x20')](_0x14c3('0x21'),_0x40ceb0+'-'+_0x367d7e+'/'+_0x479155)['json'](_0x4a1d7e);}return null;};}function patchUpdates(_0x36f173){return function(_0x1ea748){try{jsonpatch[_0x14c3('0x22')](_0x1ea748,_0x36f173,!![]);}catch(_0x43076f){return BPromise[_0x14c3('0x23')](_0x43076f);}return _0x1ea748[_0x14c3('0x24')]();};}function saveUpdates(_0x1813b9,_0x4d29eb){return function(_0x2fc318){if(_0x2fc318){return _0x2fc318[_0x14c3('0x25')](_0x1813b9)['then'](function(_0x796069){return _0x796069;});}return null;};}function removeEntity(_0x16d696,_0xc797a9){return function(_0x3d6572){if(_0x3d6572){return _0x3d6572[_0x14c3('0x26')]()[_0x14c3('0x27')](function(){var _0x3e28b3=_0x3d6572[_0x14c3('0x28')]({'plain':!![]});var _0x3ddd36=_0x14c3('0x29');return db['UserProfileResource'][_0x14c3('0x26')]({'where':{'type':_0x3ddd36,'resourceId':_0x3e28b3['id']}})[_0x14c3('0x27')](function(){return _0x3d6572;});})[_0x14c3('0x27')](function(){_0x16d696[_0x14c3('0x1a')](0xcc)[_0x14c3('0x1b')]();});}};}function handleEntityNotFound(_0x51ce35,_0x5f4418){return function(_0x24c577){if(!_0x24c577){_0x51ce35[_0x14c3('0x19')](0x194);}return _0x24c577;};}function handleError(_0x3db401,_0x44ebee){_0x44ebee=_0x44ebee||0x1f4;return function(_0x144baa){logger[_0x14c3('0x2a')](_0x144baa[_0x14c3('0x2b')]);if(_0x144baa[_0x14c3('0x2c')]){delete _0x144baa[_0x14c3('0x2c')];}_0x3db401[_0x14c3('0x1a')](_0x44ebee)['send'](_0x144baa);};}exports[_0x14c3('0x2d')]=function(_0x3d123e,_0x2a6cdf){var _0x2469c1={},_0x584108={},_0x4cecb1={'count':0x0,'rows':[]};var _0x29a01d=_[_0x14c3('0x2e')](db[_0x14c3('0x2f')][_0x14c3('0x30')],function(_0x8cb07b){return{'name':_0x8cb07b[_0x14c3('0x31')],'type':_0x8cb07b[_0x14c3('0x32')][_0x14c3('0x33')]};});_0x584108[_0x14c3('0x34')]=_['map'](_0x29a01d,'name');_0x584108[_0x14c3('0x35')]=_[_0x14c3('0x36')](_0x3d123e[_0x14c3('0x35')]);_0x584108['filters']=_[_0x14c3('0x37')](_0x584108['model'],_0x584108[_0x14c3('0x35')]);_0x2469c1[_0x14c3('0x38')]=_[_0x14c3('0x37')](_0x584108[_0x14c3('0x34')],qs[_0x14c3('0x39')](_0x3d123e[_0x14c3('0x35')][_0x14c3('0x39')]));_0x2469c1['attributes']=_0x2469c1['attributes']['length']?_0x2469c1['attributes']:_0x584108[_0x14c3('0x34')];if(!_0x3d123e[_0x14c3('0x35')]['hasOwnProperty']('nolimit')){_0x2469c1['limit']=qs[_0x14c3('0x1f')](_0x3d123e[_0x14c3('0x35')][_0x14c3('0x1f')]);_0x2469c1[_0x14c3('0x1d')]=qs[_0x14c3('0x1d')](_0x3d123e[_0x14c3('0x35')][_0x14c3('0x1d')]);}_0x2469c1[_0x14c3('0x3a')]=qs[_0x14c3('0x3b')](_0x3d123e[_0x14c3('0x35')][_0x14c3('0x3b')]);_0x2469c1['where']=qs[_0x14c3('0x3c')](_[_0x14c3('0x3d')](_0x3d123e[_0x14c3('0x35')],_0x584108[_0x14c3('0x3c')]),_0x29a01d);if(_0x3d123e[_0x14c3('0x35')][_0x14c3('0x3e')]){_0x2469c1[_0x14c3('0x3f')]=_[_0x14c3('0x40')](_0x2469c1['where'],{'$or':_[_0x14c3('0x2e')](_0x29a01d,function(_0x1948b2){if(_0x1948b2['type']!==_0x14c3('0x41')){var _0x3cbfe2={};_0x3cbfe2[_0x1948b2['name']]={'$like':'%'+_0x3d123e[_0x14c3('0x35')][_0x14c3('0x3e')]+'%'};return _0x3cbfe2;}})});}_0x2469c1=_[_0x14c3('0x40')]({},_0x2469c1,_0x3d123e[_0x14c3('0x42')]);var _0x167b07={'where':_0x2469c1[_0x14c3('0x3f')]};return db[_0x14c3('0x2f')][_0x14c3('0x1e')](_0x167b07)[_0x14c3('0x27')](function(_0x77d086){_0x4cecb1[_0x14c3('0x1e')]=_0x77d086;if(_0x3d123e[_0x14c3('0x35')][_0x14c3('0x43')]){_0x2469c1[_0x14c3('0x44')]=[{'all':!![]}];}return db[_0x14c3('0x2f')]['findAll'](_0x2469c1);})[_0x14c3('0x27')](function(_0x5e9ee3){_0x4cecb1[_0x14c3('0x45')]=_0x5e9ee3;return _0x4cecb1;})['then'](respondWithFilteredResult(_0x2a6cdf,_0x2469c1))[_0x14c3('0x46')](handleError(_0x2a6cdf,null));};exports['show']=function(_0x3926e1,_0x4edfab){var _0x11a680={'raw':![],'where':{'id':_0x3926e1['params']['id']}},_0x33f370={};_0x33f370[_0x14c3('0x34')]=_[_0x14c3('0x36')](db[_0x14c3('0x2f')][_0x14c3('0x30')]);_0x33f370[_0x14c3('0x35')]=_['keys'](_0x3926e1[_0x14c3('0x35')]);_0x33f370['filters']=_[_0x14c3('0x37')](_0x33f370[_0x14c3('0x34')],_0x33f370[_0x14c3('0x35')]);_0x11a680[_0x14c3('0x38')]=_[_0x14c3('0x37')](_0x33f370[_0x14c3('0x34')],qs[_0x14c3('0x39')](_0x3926e1[_0x14c3('0x35')]['fields']));_0x11a680[_0x14c3('0x38')]=_0x11a680['attributes'][_0x14c3('0x47')]?_0x11a680['attributes']:_0x33f370['model'];if(_0x3926e1[_0x14c3('0x35')]['includeAll']){_0x11a680['include']=[{'all':!![]}];}_0x11a680=_['merge']({},_0x11a680,_0x3926e1[_0x14c3('0x42')]);return db[_0x14c3('0x2f')]['find'](_0x11a680)[_0x14c3('0x27')](handleEntityNotFound(_0x4edfab,null))[_0x14c3('0x27')](respondWithResult(_0x4edfab,null))[_0x14c3('0x46')](handleError(_0x4edfab,null));};exports['create']=function(_0x558187,_0x4d5050){return db[_0x14c3('0x2f')][_0x14c3('0x48')](_0x558187[_0x14c3('0x49')],{})[_0x14c3('0x27')](function(_0x2454a7){var _0x118c9c=_0x558187[_0x14c3('0x4a')][_0x14c3('0x28')]({'plain':!![]});if(!_0x118c9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x118c9c[_0x14c3('0x4b')]===_0x14c3('0x4a')){var _0x429f32=_0x2454a7['get']({'plain':!![]});var _0x52e037=_0x14c3('0x29');return db[_0x14c3('0x4c')]['find']({'where':{'name':_0x52e037,'userProfileId':_0x118c9c[_0x14c3('0x4d')]},'raw':!![]})[_0x14c3('0x27')](function(_0x374523){if(_0x374523&&_0x374523['autoAssociation']===0x0){return db['UserProfileResource'][_0x14c3('0x48')]({'name':_0x429f32[_0x14c3('0x2c')],'resourceId':_0x429f32['id'],'type':_0x374523['name'],'sectionId':_0x374523['id']},{})['then'](function(){return _0x2454a7;});}else{return _0x2454a7;}})[_0x14c3('0x46')](function(_0x442a63){logger[_0x14c3('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x442a63);throw _0x442a63;});}return _0x2454a7;})[_0x14c3('0x27')](respondWithResult(_0x4d5050,0xc9))[_0x14c3('0x46')](handleError(_0x4d5050,null));};exports[_0x14c3('0x25')]=function(_0x3e3ee7,_0x138caf){if(_0x3e3ee7[_0x14c3('0x49')]['id']){delete _0x3e3ee7[_0x14c3('0x49')]['id'];}return db[_0x14c3('0x2f')][_0x14c3('0x4e')]({'where':{'id':_0x3e3ee7[_0x14c3('0x4f')]['id']}})[_0x14c3('0x27')](handleEntityNotFound(_0x138caf,null))[_0x14c3('0x27')](saveUpdates(_0x3e3ee7[_0x14c3('0x49')],null))['then'](respondWithResult(_0x138caf,null))['catch'](handleError(_0x138caf,null));};exports[_0x14c3('0x26')]=function(_0x2450d4,_0x27c383){return db[_0x14c3('0x2f')][_0x14c3('0x4e')]({'where':{'id':_0x2450d4[_0x14c3('0x4f')]['id']}})[_0x14c3('0x27')](handleEntityNotFound(_0x27c383,null))[_0x14c3('0x27')](removeEntity(_0x27c383,null))['catch'](handleError(_0x27c383,null));};exports[_0x14c3('0x50')]=function(_0x302ece,_0x2840e9,_0x3c605e){var _0x5b2d42=require(_0x14c3('0x51'));return db[_0x14c3('0x2f')][_0x14c3('0x4e')]({'where':{'id':_0x302ece[_0x14c3('0x4f')]['id']},'raw':!![]})[_0x14c3('0x27')](handleEntityNotFound(_0x2840e9,null))[_0x14c3('0x27')](function(){_0x5b2d42[_0x14c3('0x50')](_0x302ece[_0x14c3('0x4f')]['id']);})[_0x14c3('0x27')](respondWithStatusCode(_0x2840e9,null))[_0x14c3('0x46')](handleError(_0x2840e9,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2beb89c..95c9548 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 _0x651d=['./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd9ff20,_0x270cfe){var _0x2313eb=function(_0x4d0909){while(--_0x4d0909){_0xd9ff20['push'](_0xd9ff20['shift']());}};_0x2313eb(++_0x270cfe);}(_0x651d,0x17e));var _0xd651=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x651d[_0x483d8b];return _0x6500f1;};'use strict';var _=require(_0xd651('0x0'));var util=require(_0xd651('0x1'));var logger=require(_0xd651('0x2'))(_0xd651('0x3'));var moment=require(_0xd651('0x4'));var BPromise=require(_0xd651('0x5'));var rp=require(_0xd651('0x6'));var fs=require('fs');var path=require(_0xd651('0x7'));var rimraf=require(_0xd651('0x8'));var config=require(_0xd651('0x9'));var attributes=require(_0xd651('0xa'));module[_0xd651('0xb')]=function(_0x5698df,_0x15c63e){return _0x5698df[_0xd651('0xc')](_0xd651('0xd'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd35=['rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44a124,_0x537f1f){var _0x243c78=function(_0x8cf13a){while(--_0x8cf13a){_0x44a124['push'](_0x44a124['shift']());}};_0x243c78(++_0x537f1f);}(_0xfd35,0x8a));var _0x5fd3=function(_0x5b60cf,_0x2d492c){_0x5b60cf=_0x5b60cf-0x0;var _0x290f18=_0xfd35[_0x5b60cf];return _0x290f18;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5fd3('0x0'))(_0x5fd3('0x1'));var moment=require(_0x5fd3('0x2'));var BPromise=require(_0x5fd3('0x3'));var rp=require(_0x5fd3('0x4'));var fs=require('fs');var path=require(_0x5fd3('0x5'));var rimraf=require(_0x5fd3('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd3('0x7'));module[_0x5fd3('0x8')]=function(_0x362dfa,_0x3c9b0c){return _0x362dfa[_0x5fd3('0x9')](_0x5fd3('0xa'),attributes,{'tableName':_0x5fd3('0xb'),'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 8ffea20..a525c04 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 _0xda9c=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xda9c,0xec));var _0xcda9=function(_0x35dcca,_0x14e01d){_0x35dcca=_0x35dcca-0x0;var _0x4d843c=_0xda9c[_0x35dcca];return _0x4d843c;};'use strict';var _=require(_0xcda9('0x0'));var util=require(_0xcda9('0x1'));var moment=require(_0xcda9('0x2'));var BPromise=require(_0xcda9('0x3'));var rs=require(_0xcda9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcda9('0x5'))['db'];var utils=require(_0xcda9('0x6'));var logger=require(_0xcda9('0x7'))(_0xcda9('0x8'));var config=require(_0xcda9('0x9'));var jayson=require(_0xcda9('0xa'));var client=jayson[_0xcda9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f8249,_0x1184c0,_0x2f7693){return new BPromise(function(_0x3976b0,_0x1f5013){return client[_0xcda9('0xc')](_0x2f8249,_0x2f7693)[_0xcda9('0xd')](function(_0x5ddc76){logger[_0xcda9('0xe')](_0xcda9('0xf'),_0x1184c0,_0xcda9('0x10'));logger[_0xcda9('0x11')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1184c0,_0xcda9('0x10'),JSON[_0xcda9('0x12')](_0x5ddc76));if(_0x5ddc76[_0xcda9('0x13')]){if(_0x5ddc76[_0xcda9('0x13')]['code']===0x1f4){logger[_0xcda9('0x13')](_0xcda9('0xf'),_0x1184c0,_0x5ddc76['error'][_0xcda9('0x14')]);return _0x1f5013(_0x5ddc76[_0xcda9('0x13')]['message']);}logger['error'](_0xcda9('0xf'),_0x1184c0,_0x5ddc76['error'][_0xcda9('0x14')]);return _0x3976b0(_0x5ddc76[_0xcda9('0x13')][_0xcda9('0x14')]);}else{logger['info'](_0xcda9('0xf'),_0x1184c0,_0xcda9('0x10'));_0x3976b0(_0x5ddc76[_0xcda9('0x15')][_0xcda9('0x14')]);}})[_0xcda9('0x16')](function(_0x45fc66){logger[_0xcda9('0x13')](_0xcda9('0xf'),_0x1184c0,_0x45fc66);_0x1f5013(_0x45fc66);});});} \ No newline at end of file +var _0x4d9c=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x3e00e2,_0x5eeb01){var _0x278680=function(_0x5e0ec6){while(--_0x5e0ec6){_0x3e00e2['push'](_0x3e00e2['shift']());}};_0x278680(++_0x5eeb01);}(_0x4d9c,0x12a));var _0xc4d9=function(_0x1608bf,_0x2f6c91){_0x1608bf=_0x1608bf-0x0;var _0x4e6471=_0x4d9c[_0x1608bf];return _0x4e6471;};'use strict';var _=require(_0xc4d9('0x0'));var util=require(_0xc4d9('0x1'));var moment=require(_0xc4d9('0x2'));var BPromise=require(_0xc4d9('0x3'));var rs=require(_0xc4d9('0x4'));var fs=require('fs');var Redis=require(_0xc4d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4d9('0x6'));var logger=require(_0xc4d9('0x7'))(_0xc4d9('0x8'));var config=require('../../config/environment');var jayson=require(_0xc4d9('0x9'));var client=jayson[_0xc4d9('0xa')][_0xc4d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ff06,_0x31db6e,_0x377518){return new BPromise(function(_0x241902,_0x1b1200){return client[_0xc4d9('0xc')](_0x5ff06,_0x377518)[_0xc4d9('0xd')](function(_0x43d448){logger[_0xc4d9('0xe')](_0xc4d9('0xf'),_0x31db6e,_0xc4d9('0x10'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x31db6e,_0xc4d9('0x10'),JSON[_0xc4d9('0x11')](_0x43d448));if(_0x43d448['error']){if(_0x43d448[_0xc4d9('0x12')][_0xc4d9('0x13')]===0x1f4){logger[_0xc4d9('0x12')](_0xc4d9('0xf'),_0x31db6e,_0x43d448[_0xc4d9('0x12')]['message']);return _0x1b1200(_0x43d448['error'][_0xc4d9('0x14')]);}logger[_0xc4d9('0x12')]('Schedule,\x20%s,\x20%s',_0x31db6e,_0x43d448[_0xc4d9('0x12')]['message']);return _0x241902(_0x43d448[_0xc4d9('0x12')][_0xc4d9('0x14')]);}else{logger['info'](_0xc4d9('0xf'),_0x31db6e,_0xc4d9('0x10'));_0x241902(_0x43d448['result']['message']);}})['catch'](function(_0x4dc0ef){logger[_0xc4d9('0x12')](_0xc4d9('0xf'),_0x31db6e,_0x4dc0ef);_0x1b1200(_0x4dc0ef);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 76282ac..09314a4 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 _0x9f97=['describe','/:id','show','/:id/download','download','post','put','update','delete','multer','util','path','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe'];(function(_0x3e0ee5,_0xe997ee){var _0xcacc74=function(_0x57bfcc){while(--_0x57bfcc){_0x3e0ee5['push'](_0x3e0ee5['shift']());}};_0xcacc74(++_0xe997ee);}(_0x9f97,0x149));var _0x79f9=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0x9f97[_0x2ed7d1];return _0x38ae3c;};'use strict';var multer=require(_0x79f9('0x0'));var util=require(_0x79f9('0x1'));var path=require(_0x79f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x79f9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x79f9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x79f9('0x5'));var controller=require(_0x79f9('0x6'));router[_0x79f9('0x7')]('/',auth[_0x79f9('0x8')](),controller[_0x79f9('0x9')]);router['get'](_0x79f9('0xa'),auth[_0x79f9('0x8')](),controller[_0x79f9('0xb')]);router[_0x79f9('0x7')](_0x79f9('0xc'),auth[_0x79f9('0x8')](),controller[_0x79f9('0xd')]);router[_0x79f9('0x7')](_0x79f9('0xe'),auth[_0x79f9('0x8')](),controller[_0x79f9('0xf')]);router[_0x79f9('0x10')]('/',auth[_0x79f9('0x8')](),controller['create']);router[_0x79f9('0x11')]('/:id',auth[_0x79f9('0x8')](),controller[_0x79f9('0x12')]);router[_0x79f9('0x13')](_0x79f9('0xc'),auth[_0x79f9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6b19=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','put','update'];(function(_0x78d8b7,_0x2cfc1d){var _0x5a979c=function(_0x3fee12){while(--_0x3fee12){_0x78d8b7['push'](_0x78d8b7['shift']());}};_0x5a979c(++_0x2cfc1d);}(_0x6b19,0xd4));var _0x96b1=function(_0x9b617e,_0x2a6fed){_0x9b617e=_0x9b617e-0x0;var _0x1e9ef9=_0x6b19[_0x9b617e];return _0x1e9ef9;};'use strict';var multer=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var path=require(_0x96b1('0x2'));var timeout=require(_0x96b1('0x3'));var express=require(_0x96b1('0x4'));var router=express[_0x96b1('0x5')]();var fs_extra=require(_0x96b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x96b1('0x7'));var config=require(_0x96b1('0x8'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x96b1('0x9')](),controller[_0x96b1('0xa')]);router[_0x96b1('0xb')](_0x96b1('0xc'),auth[_0x96b1('0x9')](),controller['describe']);router[_0x96b1('0xb')](_0x96b1('0xd'),auth[_0x96b1('0x9')](),controller[_0x96b1('0xe')]);router[_0x96b1('0xb')](_0x96b1('0xf'),auth['isAuthenticated'](),controller[_0x96b1('0x10')]);router['post']('/',auth[_0x96b1('0x9')](),controller['create']);router[_0x96b1('0x11')](_0x96b1('0xd'),auth[_0x96b1('0x9')](),controller[_0x96b1('0x12')]);router[_0x96b1('0x13')](_0x96b1('0xd'),auth[_0x96b1('0x9')](),controller[_0x96b1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index ef4b7c4..caa50d9 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 _0xa32b=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0xa32b,0x68));var _0xba32=function(_0x21a0cb,_0x5a4cc5){_0x21a0cb=_0x21a0cb-0x0;var _0x2e9bb4=_0xa32b[_0x21a0cb];return _0x2e9bb4;};'use strict';var Sequelize=require(_0xba32('0x0'));var moment=require('moment');var path=require(_0xba32('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0xba32('0x2')],'get':function(){return this[_0xba32('0x3')](_0xba32('0x4'))?path['extname'](this[_0xba32('0x3')](_0xba32('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xba32('0x5')]},'channel':{'type':Sequelize[_0xba32('0x5')]},'value':{'type':Sequelize[_0xba32('0x5')],'set':function(_0x5c5a59){var _0x1b1332=_0x5c5a59['replace'](/\\/g,'/');this[_0xba32('0x6')](_0xba32('0x4'),_0x1b1332);}},'rating':{'type':Sequelize[_0xba32('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xba32('0x7')],'set':function(_0x5d8f64){this['setDataValue']('startedAt',moment()['subtract'](_0x5d8f64,'ms'));this[_0xba32('0x6')]('closedAt',moment());this[_0xba32('0x6')]('duration',_0x5d8f64);}},'startedAt':{'type':Sequelize[_0xba32('0x8')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0xba32('0x9')](_0xba32('0xa'))[_0xba32('0xb')]();}},'closedAt':{'type':Sequelize[_0xba32('0x8')],'get':function(){return moment(this[_0xba32('0x3')]('closedAt'))[_0xba32('0x9')](_0xba32('0xa'))[_0xba32('0xb')]();}},'createdAt':{'type':Sequelize[_0xba32('0x8')],'get':function(){return moment(this[_0xba32('0x3')](_0xba32('0xc')))[_0xba32('0x9')]('MM-DD-YYYY\x20HH:mm')[_0xba32('0xb')]();}},'updatedAt':{'type':Sequelize[_0xba32('0x8')],'get':function(){return moment(this[_0xba32('0x3')](_0xba32('0xd')))[_0xba32('0x9')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x078f=['format','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','moment','path','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','DATE','toString'];(function(_0x1b7dec,_0x503774){var _0x5c30d2=function(_0x245c01){while(--_0x245c01){_0x1b7dec['push'](_0x1b7dec['shift']());}};_0x5c30d2(++_0x503774);}(_0x078f,0x1b4));var _0xf078=function(_0xf6eda5,_0x3b2921){_0xf6eda5=_0xf6eda5-0x0;var _0x1dd6d9=_0x078f[_0xf6eda5];return _0x1dd6d9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf078('0x0'));var path=require(_0xf078('0x1'));var config=require('../../config/environment');module[_0xf078('0x2')]={'format':{'type':Sequelize[_0xf078('0x3')],'get':function(){return this[_0xf078('0x4')](_0xf078('0x5'))?path['extname'](this[_0xf078('0x4')](_0xf078('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xf078('0x6')]},'channel':{'type':Sequelize[_0xf078('0x6')]},'value':{'type':Sequelize[_0xf078('0x6')],'set':function(_0x353874){var _0xa80959=_0x353874[_0xf078('0x7')](/\\/g,'/');this[_0xf078('0x8')](_0xf078('0x5'),_0xa80959);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf078('0x9')],'set':function(_0x52943d){this[_0xf078('0x8')](_0xf078('0xa'),moment()[_0xf078('0xb')](_0x52943d,'ms'));this[_0xf078('0x8')]('closedAt',moment());this[_0xf078('0x8')]('duration',_0x52943d);}},'startedAt':{'type':Sequelize[_0xf078('0xc')],'get':function(){return moment(this[_0xf078('0x4')](_0xf078('0xa')))['format']('MM-DD-YYYY\x20HH:mm')[_0xf078('0xd')]();}},'closedAt':{'type':Sequelize[_0xf078('0xc')],'get':function(){return moment(this[_0xf078('0x4')]('closedAt'))[_0xf078('0xe')](_0xf078('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0xf078('0xc')],'get':function(){return moment(this[_0xf078('0x4')](_0xf078('0x10')))[_0xf078('0xe')](_0xf078('0xf'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xf078('0x11')))[_0xf078('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 03c5648..a6e78bc 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 _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x59c60b,_0x277f56){var _0x35d08d=function(_0x4a75a1){while(--_0x4a75a1){_0x59c60b['push'](_0x59c60b['shift']());}};_0x35d08d(++_0x277f56);}(_0x33c5,0xe6));var _0x533c=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0x33c5[_0x35b195];return _0x2433bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file +var _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x1446f8,_0x37dff6){var _0x3dddc7=function(_0x25bd94){while(--_0x25bd94){_0x1446f8['push'](_0x1446f8['shift']());}};_0x3dddc7(++_0x37dff6);}(_0x207c,0x1e8));var _0xc207=function(_0x1acc01,_0x5cb80c){_0x1acc01=_0x1acc01-0x0;var _0x5603f1=_0x207c[_0x1acc01];return _0x5603f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ece78ee..a614628 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 _0x7793=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xcfc31d,_0xa87d72){var _0x56a8e5=function(_0x5ccc33){while(--_0x5ccc33){_0xcfc31d['push'](_0xcfc31d['shift']());}};_0x56a8e5(++_0xa87d72);}(_0x7793,0x7d));var _0x3779=function(_0x5e5537,_0x53577d){_0x5e5537=_0x5e5537-0x0;var _0x136983=_0x7793[_0x5e5537];return _0x136983;};'use strict';var _=require(_0x3779('0x0'));var util=require(_0x3779('0x1'));var logger=require(_0x3779('0x2'))(_0x3779('0x3'));var moment=require(_0x3779('0x4'));var BPromise=require(_0x3779('0x5'));var rp=require(_0x3779('0x6'));var fs=require('fs');var path=require(_0x3779('0x7'));var rimraf=require(_0x3779('0x8'));var config=require(_0x3779('0x9'));var attributes=require('./screenRecording.attributes');module[_0x3779('0xa')]=function(_0xb4ca8c,_0x5a7879){return _0xb4ca8c[_0x3779('0xb')](_0x3779('0xc'),attributes,{'tableName':_0x3779('0xd'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x3779('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b22=['define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x336b6d,_0x3f0432){var _0x1e348e=function(_0x35d53f){while(--_0x35d53f){_0x336b6d['push'](_0x336b6d['shift']());}};_0x1e348e(++_0x3f0432);}(_0x1b22,0x137));var _0x21b2=function(_0x5b1533,_0x27e66c){_0x5b1533=_0x5b1533-0x0;var _0x1ea41d=_0x1b22[_0x5b1533];return _0x1ea41d;};'use strict';var _=require(_0x21b2('0x0'));var util=require(_0x21b2('0x1'));var logger=require(_0x21b2('0x2'))(_0x21b2('0x3'));var moment=require(_0x21b2('0x4'));var BPromise=require(_0x21b2('0x5'));var rp=require(_0x21b2('0x6'));var fs=require('fs');var path=require(_0x21b2('0x7'));var rimraf=require(_0x21b2('0x8'));var config=require(_0x21b2('0x9'));var attributes=require(_0x21b2('0xa'));module['exports']=function(_0x1ca71a,_0xc6239e){return _0x1ca71a[_0x21b2('0xb')](_0x21b2('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x21b2('0xd'),'fields':[_0x21b2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4bedb8c..8133975 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 _0xa41e=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa41e,0x164));var _0xea41=function(_0x204c92,_0x5ddee9){_0x204c92=_0x204c92-0x0;var _0x16f530=_0xa41e[_0x204c92];return _0x16f530;};'use strict';var _=require('lodash');var util=require(_0xea41('0x0'));var moment=require(_0xea41('0x1'));var BPromise=require(_0xea41('0x2'));var rs=require(_0xea41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea41('0x4'))['db'];var utils=require(_0xea41('0x5'));var logger=require(_0xea41('0x6'))(_0xea41('0x7'));var config=require(_0xea41('0x8'));var jayson=require(_0xea41('0x9'));var client=jayson[_0xea41('0xa')][_0xea41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4348d0,_0x5b0507,_0x38e605){return new BPromise(function(_0x234c3e,_0x573b50){return client[_0xea41('0xc')](_0x4348d0,_0x38e605)[_0xea41('0xd')](function(_0x3a2d4b){logger[_0xea41('0xe')](_0xea41('0xf'),_0x5b0507,_0xea41('0x10'));logger[_0xea41('0x11')](_0xea41('0x12'),_0x5b0507,_0xea41('0x10'),JSON[_0xea41('0x13')](_0x3a2d4b));if(_0x3a2d4b[_0xea41('0x14')]){if(_0x3a2d4b[_0xea41('0x14')][_0xea41('0x15')]===0x1f4){logger[_0xea41('0x14')](_0xea41('0xf'),_0x5b0507,_0x3a2d4b[_0xea41('0x14')][_0xea41('0x16')]);return _0x573b50(_0x3a2d4b[_0xea41('0x14')][_0xea41('0x16')]);}logger[_0xea41('0x14')](_0xea41('0xf'),_0x5b0507,_0x3a2d4b['error'][_0xea41('0x16')]);return _0x234c3e(_0x3a2d4b[_0xea41('0x14')][_0xea41('0x16')]);}else{logger[_0xea41('0xe')](_0xea41('0xf'),_0x5b0507,_0xea41('0x10'));_0x234c3e(_0x3a2d4b[_0xea41('0x17')]['message']);}})[_0xea41('0x18')](function(_0x59de8f){logger[_0xea41('0x14')](_0xea41('0xf'),_0x5b0507,_0x59de8f);_0x573b50(_0x59de8f);});});} \ No newline at end of file +var _0xae68=['error','code','message','ScreenRecording,\x20%s,\x20%s','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42e4e0,_0x57ab9c){var _0x5ea33c=function(_0x239369){while(--_0x239369){_0x42e4e0['push'](_0x42e4e0['shift']());}};_0x5ea33c(++_0x57ab9c);}(_0xae68,0xec));var _0x8ae6=function(_0x514816,_0x57c091){_0x514816=_0x514816-0x0;var _0x5c3a43=_0xae68[_0x514816];return _0x5c3a43;};'use strict';var _=require(_0x8ae6('0x0'));var util=require('util');var moment=require(_0x8ae6('0x1'));var BPromise=require('bluebird');var rs=require(_0x8ae6('0x2'));var fs=require('fs');var Redis=require(_0x8ae6('0x3'));var db=require(_0x8ae6('0x4'))['db'];var utils=require(_0x8ae6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8ae6('0x6'));var jayson=require(_0x8ae6('0x7'));var client=jayson[_0x8ae6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b621e,_0x55573e,_0x2edfdc){return new BPromise(function(_0xf1ee57,_0x1c133c){return client[_0x8ae6('0x9')](_0x1b621e,_0x2edfdc)[_0x8ae6('0xa')](function(_0x17e03e){logger[_0x8ae6('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x55573e,_0x8ae6('0xc'));logger[_0x8ae6('0xd')](_0x8ae6('0xe'),_0x55573e,'request\x20sent',JSON[_0x8ae6('0xf')](_0x17e03e));if(_0x17e03e[_0x8ae6('0x10')]){if(_0x17e03e[_0x8ae6('0x10')][_0x8ae6('0x11')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x55573e,_0x17e03e[_0x8ae6('0x10')][_0x8ae6('0x12')]);return _0x1c133c(_0x17e03e[_0x8ae6('0x10')][_0x8ae6('0x12')]);}logger[_0x8ae6('0x10')](_0x8ae6('0x13'),_0x55573e,_0x17e03e['error'][_0x8ae6('0x12')]);return _0xf1ee57(_0x17e03e['error'][_0x8ae6('0x12')]);}else{logger[_0x8ae6('0xb')](_0x8ae6('0x13'),_0x55573e,_0x8ae6('0xc'));_0xf1ee57(_0x17e03e['result'][_0x8ae6('0x12')]);}})[_0x8ae6('0x14')](function(_0x38953c){logger[_0x8ae6('0x10')](_0x8ae6('0x13'),_0x55573e,_0x38953c);_0x1c133c(_0x38953c);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index bff4bc2..470b3a1 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 _0xb514=['%s%s','logo','extname','post','single','file','addLogo','server/files/images/logos/','format','logologin','originalname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','show','getLogo','getLogoLogin','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb514,0x16c));var _0x4b51=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xb514[_0x1a7550];return _0x426e22;};'use strict';var multer=require(_0x4b51('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b51('0x1'));var express=require(_0x4b51('0x2'));var router=express[_0x4b51('0x3')]();var fs_extra=require(_0x4b51('0x4'));var auth=require(_0x4b51('0x5'));var interaction=require(_0x4b51('0x6'));var config=require(_0x4b51('0x7'));var controller=require(_0x4b51('0x8'));router[_0x4b51('0x9')]('/',auth[_0x4b51('0xa')](),controller[_0x4b51('0xb')]);router['get'](_0x4b51('0xc'),controller['getDate']);router[_0x4b51('0x9')]('/:id',controller[_0x4b51('0xd')]);router['get']('/:id/logo',controller[_0x4b51('0xe')]);router[_0x4b51('0x9')]('/:id/logo_login',controller[_0x4b51('0xf')]);router['get']('/:id/gdpr',controller['gdpr']);router[_0x4b51('0x9')](_0x4b51('0x10'),controller[_0x4b51('0x11')]);router[_0x4b51('0x9')](_0x4b51('0x12'),controller[_0x4b51('0x13')]);var upload=multer({'storage':multer[_0x4b51('0x14')]({'destination':function(_0xa04a5,_0x5a689d,_0x1f4143){_0x1f4143(null,path[_0x4b51('0x15')](config[_0x4b51('0x16')],'server/files/images/logos/'));},'filename':function(_0x3736cc,_0x119bfb,_0x5c0b9d){_0x5c0b9d(null,util['format'](_0x4b51('0x17'),_0x4b51('0x18'),path[_0x4b51('0x19')](_0x119bfb['originalname'])));}})});router[_0x4b51('0x1a')]('/:id/logo',upload[_0x4b51('0x1b')](_0x4b51('0x1c')),controller[_0x4b51('0x1d')]);var upload=multer({'storage':multer[_0x4b51('0x14')]({'destination':function(_0xe81c00,_0x100fd8,_0x1a8aac){_0x1a8aac(null,path[_0x4b51('0x15')](config[_0x4b51('0x16')],_0x4b51('0x1e')));},'filename':function(_0x11f970,_0x4afe76,_0x2c9ef2){_0x2c9ef2(null,util[_0x4b51('0x1f')](_0x4b51('0x17'),_0x4b51('0x20'),path[_0x4b51('0x19')](_0x4afe76[_0x4b51('0x21')])));}})});router['post'](_0x4b51('0x22'),upload[_0x4b51('0x1b')](_0x4b51('0x1c')),controller[_0x4b51('0x23')]);var upload=multer({'storage':multer[_0x4b51('0x14')]({'destination':function(_0x55ac95,_0x1981cd,_0x36d4d3){_0x36d4d3(null,path[_0x4b51('0x15')](config[_0x4b51('0x16')],_0x4b51('0x1e')));},'filename':function(_0xf5a6d3,_0x39a3e1,_0x4fd832){_0x4fd832(null,util[_0x4b51('0x1f')](_0x4b51('0x17'),_0x4b51('0x24'),path['extname'](_0x39a3e1[_0x4b51('0x21')])));}})});router[_0x4b51('0x1a')]('/:id/preferred',upload['single']('file'),controller[_0x4b51('0x25')]);var upload=multer({'storage':multer[_0x4b51('0x14')]({'destination':function(_0x2848dc,_0x5dd161,_0x27b636){_0x27b636(null,path[_0x4b51('0x15')](config[_0x4b51('0x16')],_0x4b51('0x1e')));},'filename':function(_0x2fc22,_0x4ada1f,_0x55b69c){_0x55b69c(null,util['format'](_0x4b51('0x17'),_0x4b51('0x26'),path[_0x4b51('0x19')](_0x4ada1f['originalname'])));}})});router[_0x4b51('0x1a')](_0x4b51('0x12'),upload['single'](_0x4b51('0x1c')),controller[_0x4b51('0x27')]);router[_0x4b51('0x28')]('/:id',auth[_0x4b51('0xa')](),controller[_0x4b51('0x29')]);module[_0x4b51('0x2a')]=router; \ No newline at end of file +var _0xb389=['getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','originalname','post','single','file','addLogo','format','logologin','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon'];(function(_0x238b73,_0x3b9d3b){var _0x68f970=function(_0x474320){while(--_0x474320){_0x238b73['push'](_0x238b73['shift']());}};_0x68f970(++_0x3b9d3b);}(_0xb389,0xc6));var _0x9b38=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0xb389[_0x38ff1e];return _0x3755d4;};'use strict';var multer=require(_0x9b38('0x0'));var util=require('util');var path=require(_0x9b38('0x1'));var timeout=require(_0x9b38('0x2'));var express=require(_0x9b38('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9b38('0x4'));var config=require(_0x9b38('0x5'));var controller=require(_0x9b38('0x6'));router[_0x9b38('0x7')]('/',auth[_0x9b38('0x8')](),controller[_0x9b38('0x9')]);router[_0x9b38('0x7')](_0x9b38('0xa'),controller[_0x9b38('0xb')]);router[_0x9b38('0x7')](_0x9b38('0xc'),controller[_0x9b38('0xd')]);router['get'](_0x9b38('0xe'),controller[_0x9b38('0xf')]);router[_0x9b38('0x7')]('/:id/logo_login',controller[_0x9b38('0x10')]);router[_0x9b38('0x7')](_0x9b38('0x11'),controller[_0x9b38('0x12')]);router[_0x9b38('0x7')](_0x9b38('0x13'),controller[_0x9b38('0x14')]);router['get'](_0x9b38('0x15'),controller[_0x9b38('0x16')]);var upload=multer({'storage':multer[_0x9b38('0x17')]({'destination':function(_0x1866ea,_0x58c495,_0x26e733){_0x26e733(null,path[_0x9b38('0x18')](config[_0x9b38('0x19')],_0x9b38('0x1a')));},'filename':function(_0x2a69b6,_0x3542a7,_0x1e718a){_0x1e718a(null,util['format'](_0x9b38('0x1b'),'logo',path[_0x9b38('0x1c')](_0x3542a7[_0x9b38('0x1d')])));}})});router[_0x9b38('0x1e')](_0x9b38('0xe'),upload[_0x9b38('0x1f')](_0x9b38('0x20')),controller[_0x9b38('0x21')]);var upload=multer({'storage':multer[_0x9b38('0x17')]({'destination':function(_0x5592e8,_0x4e51d9,_0xef83e0){_0xef83e0(null,path['join'](config[_0x9b38('0x19')],_0x9b38('0x1a')));},'filename':function(_0x1fa848,_0x5e78bc,_0x37f8c5){_0x37f8c5(null,util[_0x9b38('0x22')](_0x9b38('0x1b'),_0x9b38('0x23'),path[_0x9b38('0x1c')](_0x5e78bc[_0x9b38('0x1d')])));}})});router[_0x9b38('0x1e')](_0x9b38('0x24'),upload['single'](_0x9b38('0x20')),controller[_0x9b38('0x25')]);var upload=multer({'storage':multer[_0x9b38('0x17')]({'destination':function(_0xf34e5f,_0x443cb5,_0x2de0c4){_0x2de0c4(null,path[_0x9b38('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x42c138,_0xc1a51d,_0x3277b0){_0x3277b0(null,util['format'](_0x9b38('0x1b'),_0x9b38('0x26'),path['extname'](_0xc1a51d[_0x9b38('0x1d')])));}})});router['post'](_0x9b38('0x13'),upload[_0x9b38('0x1f')](_0x9b38('0x20')),controller[_0x9b38('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x87ab14,_0x361ded,_0x32ee98){_0x32ee98(null,path['join'](config[_0x9b38('0x19')],_0x9b38('0x1a')));},'filename':function(_0x390991,_0x66daba,_0x1c6fbc){_0x1c6fbc(null,util[_0x9b38('0x22')]('%s%s',_0x9b38('0x28'),path['extname'](_0x66daba['originalname'])));}})});router[_0x9b38('0x1e')](_0x9b38('0x15'),upload[_0x9b38('0x1f')]('file'),controller['addFavicon']);router[_0x9b38('0x29')]('/:id',auth[_0x9b38('0x8')](),controller[_0x9b38('0x2a')]);module[_0x9b38('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index dad3ad5..f347f95 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x452854,_0x3d2b64){var _0xccfda=function(_0x5f2467){while(--_0x5f2467){_0x452854['push'](_0x452854['shift']());}};_0xccfda(++_0x3d2b64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5c2db0,_0x3ac8bc){var _0x179691=function(_0x17b2eb){while(--_0x17b2eb){_0x5c2db0['push'](_0x5c2db0['shift']());}};_0x179691(++_0x3ac8bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index faf6474..3141f3b 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 _0x8ed3=['code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','params','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','custom','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ed3,0x1d4));var _0x38ed=function(_0x26c1ff,_0xb7c424){_0x26c1ff=_0x26c1ff-0x0;var _0xa7f0ee=_0x8ed3[_0x26c1ff];return _0xa7f0ee;};'use strict';var emlformat=require(_0x38ed('0x0'));var rimraf=require(_0x38ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ed('0x2'));var rp=require(_0x38ed('0x3'));var moment=require(_0x38ed('0x4'));var BPromise=require(_0x38ed('0x5'));var Mustache=require(_0x38ed('0x6'));var util=require(_0x38ed('0x7'));var path=require(_0x38ed('0x8'));var sox=require(_0x38ed('0x9'));var csv=require('to-csv');var ejs=require(_0x38ed('0xa'));var fs=require('fs');var fs_extra=require(_0x38ed('0xb'));var _=require(_0x38ed('0xc'));var squel=require('squel');var crypto=require(_0x38ed('0xd'));var jsforce=require(_0x38ed('0xe'));var deskjs=require(_0x38ed('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x38ed('0x10'));var Redis=require(_0x38ed('0x11'));var authService=require(_0x38ed('0x12'));var qs=require(_0x38ed('0x13'));var as=require(_0x38ed('0x14'));var hardwareService=require(_0x38ed('0x15'));var logger=require(_0x38ed('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x38ed('0x17'));var licenseUtil=require(_0x38ed('0x18'));var db=require(_0x38ed('0x19'))['db'];var jayson=require(_0x38ed('0x1a'));var client=jayson[_0x38ed('0x1b')][_0x38ed('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4e8dbb,_0x10adf9,_0x578d8b,_0x39cf33){return new BPromise(function(_0x4d8c18,_0x366819){var _0x355498=_0x39cf33||client;return _0x355498[_0x38ed('0x1d')](_0x4e8dbb,_0x578d8b)[_0x38ed('0x1e')](function(_0x44a246){logger[_0x38ed('0x1f')](_0x38ed('0x20'),_0x10adf9,_0x38ed('0x21'));logger[_0x38ed('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0x10adf9,_0x38ed('0x21'),JSON['stringify'](_0x44a246));if(_0x44a246[_0x38ed('0x23')]){if(_0x44a246[_0x38ed('0x23')][_0x38ed('0x24')]===0x1f4){logger[_0x38ed('0x23')](_0x38ed('0x20'),_0x10adf9,_0x44a246[_0x38ed('0x23')][_0x38ed('0x25')]);return _0x366819(_0x44a246[_0x38ed('0x23')][_0x38ed('0x25')]);}logger[_0x38ed('0x23')]('Setting,\x20%s,\x20%s',_0x10adf9,_0x44a246['error'][_0x38ed('0x25')]);return _0x4d8c18(_0x44a246[_0x38ed('0x23')][_0x38ed('0x25')]);}else{logger['info'](_0x38ed('0x20'),_0x10adf9,'request\x20sent');_0x4d8c18(_0x44a246['result'][_0x38ed('0x25')]);}})[_0x38ed('0x26')](function(_0x2e4207){logger[_0x38ed('0x23')]('Setting,\x20%s,\x20%s',_0x10adf9,_0x2e4207);_0x366819(_0x2e4207);});});}function respondWithStatusCode(_0x2c9ee9,_0x2ce646){_0x2ce646=_0x2ce646||0xcc;return function(_0x47e64b){if(_0x47e64b){return _0x2c9ee9[_0x38ed('0x27')](_0x2ce646);}return _0x2c9ee9[_0x38ed('0x28')](_0x2ce646)[_0x38ed('0x29')]();};}function respondWithResult(_0x16b3c3,_0x32f80d){_0x32f80d=_0x32f80d||0xc8;return function(_0x5b4370){if(_0x5b4370){return _0x16b3c3['status'](_0x32f80d)[_0x38ed('0x2a')](_0x5b4370);}};}function respondWithFilteredResult(_0xb20a7,_0x5f3a0c){return function(_0xfe2e1f){if(_0xfe2e1f){var _0x685dee=typeof _0x5f3a0c['offset']===_0x38ed('0x2b')&&typeof _0x5f3a0c[_0x38ed('0x2c')]===_0x38ed('0x2b');var _0x12d6f3=_0xfe2e1f[_0x38ed('0x2d')];var _0x19e4f9=_0x685dee?0x0:_0x5f3a0c[_0x38ed('0x2e')];var _0x13dea0=_0x685dee?_0xfe2e1f[_0x38ed('0x2d')]:_0x5f3a0c['offset']+_0x5f3a0c[_0x38ed('0x2c')];var _0x59736a;if(_0x13dea0>=_0x12d6f3){_0x13dea0=_0x12d6f3;_0x59736a=0xc8;}else{_0x59736a=0xce;}_0xb20a7[_0x38ed('0x28')](_0x59736a);return _0xb20a7[_0x38ed('0x2f')](_0x38ed('0x30'),_0x19e4f9+'-'+_0x13dea0+'/'+_0x12d6f3)['json'](_0xfe2e1f);}return null;};}function patchUpdates(_0xc15955){return function(_0x350b7a){try{jsonpatch[_0x38ed('0x31')](_0x350b7a,_0xc15955,!![]);}catch(_0x5a069d){return BPromise[_0x38ed('0x32')](_0x5a069d);}return _0x350b7a[_0x38ed('0x33')]();};}function saveUpdates(_0x105fc0,_0x52dfa1){return function(_0x345d71){if(_0x345d71){return _0x345d71[_0x38ed('0x34')](_0x105fc0)[_0x38ed('0x1e')](function(_0x2e2e0d){return _0x2e2e0d;});}return null;};}function removeEntity(_0x5875b6,_0x79b811){return function(_0x4d1cdf){if(_0x4d1cdf){return _0x4d1cdf[_0x38ed('0x35')]()['then'](function(){_0x5875b6['status'](0xcc)[_0x38ed('0x29')]();});}};}function handleEntityNotFound(_0x1b2974,_0x5af6a0){return function(_0x2a0983){if(!_0x2a0983){_0x1b2974[_0x38ed('0x27')](0x194);}return _0x2a0983;};}function handleError(_0x5dd8ee,_0x5bb85d){_0x5bb85d=_0x5bb85d||0x1f4;return function(_0x58f572){logger[_0x38ed('0x23')](_0x58f572[_0x38ed('0x36')]);if(_0x58f572['name']){delete _0x58f572[_0x38ed('0x37')];}_0x5dd8ee[_0x38ed('0x28')](_0x5bb85d)[_0x38ed('0x38')](_0x58f572);};}exports[_0x38ed('0x39')]=function(_0x37fcac,_0x56b191){var _0x3ca4ee={},_0x2e151c={},_0xe34b46={'count':0x0,'rows':[]};var _0xc6c9=_['map'](db[_0x38ed('0x3a')][_0x38ed('0x3b')],function(_0xa805c6){return{'name':_0xa805c6[_0x38ed('0x3c')],'type':_0xa805c6[_0x38ed('0x3d')][_0x38ed('0x3e')]};});_0x2e151c[_0x38ed('0x3f')]=_[_0x38ed('0x40')](_0xc6c9,_0x38ed('0x37'));_0x2e151c['query']=_[_0x38ed('0x41')](_0x37fcac[_0x38ed('0x42')]);_0x2e151c[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x2e151c[_0x38ed('0x3f')],_0x2e151c['query']);_0x3ca4ee[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x2e151c[_0x38ed('0x3f')],qs['fields'](_0x37fcac['query'][_0x38ed('0x46')]));_0x3ca4ee['attributes']=_0x3ca4ee[_0x38ed('0x45')][_0x38ed('0x47')]?_0x3ca4ee[_0x38ed('0x45')]:_0x2e151c[_0x38ed('0x3f')];if(!_0x37fcac[_0x38ed('0x42')][_0x38ed('0x48')](_0x38ed('0x49'))){_0x3ca4ee[_0x38ed('0x2c')]=qs['limit'](_0x37fcac[_0x38ed('0x42')][_0x38ed('0x2c')]);_0x3ca4ee[_0x38ed('0x2e')]=qs[_0x38ed('0x2e')](_0x37fcac['query'][_0x38ed('0x2e')]);}_0x3ca4ee[_0x38ed('0x4a')]=qs['sort'](_0x37fcac[_0x38ed('0x42')][_0x38ed('0x4b')]);_0x3ca4ee[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x37fcac[_0x38ed('0x42')],_0x2e151c[_0x38ed('0x43')]),_0xc6c9);if(_0x37fcac[_0x38ed('0x42')][_0x38ed('0x4d')]){_0x3ca4ee[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x3ca4ee[_0x38ed('0x4c')],{'$or':_['map'](_0xc6c9,function(_0x46611a){if(_0x46611a['type']!=='VIRTUAL'){var _0x1abfac={};_0x1abfac[_0x46611a['name']]={'$like':'%'+_0x37fcac[_0x38ed('0x42')][_0x38ed('0x4d')]+'%'};return _0x1abfac;}})});}_0x3ca4ee=_[_0x38ed('0x4e')]({},_0x3ca4ee,_0x37fcac[_0x38ed('0x4f')]);var _0x4a5814={'where':_0x3ca4ee['where']};return db[_0x38ed('0x3a')][_0x38ed('0x2d')](_0x4a5814)[_0x38ed('0x1e')](function(_0x22d394){_0xe34b46[_0x38ed('0x2d')]=_0x22d394;if(_0x37fcac['query'][_0x38ed('0x50')]){_0x3ca4ee[_0x38ed('0x51')]=[{'all':!![]}];}return db[_0x38ed('0x3a')][_0x38ed('0x52')](_0x3ca4ee);})['then'](function(_0x49e492){_0xe34b46['rows']=_0x49e492;return _0xe34b46;})['then'](respondWithFilteredResult(_0x56b191,_0x3ca4ee))[_0x38ed('0x26')](handleError(_0x56b191,null));};exports[_0x38ed('0x53')]=function(_0x1eaffc,_0x28d896){var _0x1f01e0={'raw':![],'where':{'id':_0x1eaffc[_0x38ed('0x54')]['id']}},_0x2701c2={};_0x2701c2['model']=_[_0x38ed('0x41')](db['Setting'][_0x38ed('0x3b')]);_0x2701c2[_0x38ed('0x42')]=_[_0x38ed('0x41')](_0x1eaffc['query']);_0x2701c2['filters']=_[_0x38ed('0x44')](_0x2701c2['model'],_0x2701c2[_0x38ed('0x42')]);_0x1f01e0['attributes']=_['intersection'](_0x2701c2[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x1eaffc['query'][_0x38ed('0x46')]));_0x1f01e0['attributes']=_0x1f01e0[_0x38ed('0x45')][_0x38ed('0x47')]?_0x1f01e0[_0x38ed('0x45')]:_0x2701c2[_0x38ed('0x3f')];if(_0x1eaffc['query'][_0x38ed('0x50')]){_0x1f01e0[_0x38ed('0x51')]=[{'all':!![]}];}_0x1f01e0=_[_0x38ed('0x4e')]({},_0x1f01e0,_0x1eaffc['options']);return db[_0x38ed('0x3a')][_0x38ed('0x55')](_0x1f01e0)[_0x38ed('0x1e')](handleEntityNotFound(_0x28d896,null))[_0x38ed('0x1e')](respondWithResult(_0x28d896,null))[_0x38ed('0x26')](handleError(_0x28d896,null));};exports[_0x38ed('0x34')]=function(_0x2fb560,_0x46660a){if(_0x2fb560[_0x38ed('0x56')]['id']){delete _0x2fb560['body']['id'];}return db['Setting']['find']({'where':{'id':_0x2fb560[_0x38ed('0x54')]['id']}})[_0x38ed('0x1e')](handleEntityNotFound(_0x46660a,null))['then'](saveUpdates(_0x2fb560[_0x38ed('0x56')],null))['then'](respondWithResult(_0x46660a,null))[_0x38ed('0x26')](handleError(_0x46660a,null));};exports['addLogo']=function(_0xb42563,_0x567e6f,_0x51076d){if(_0xb42563[_0x38ed('0x57')]&&_0xb42563[_0x38ed('0x57')][_0x38ed('0x58')]){_0xb42563[_0x38ed('0x56')][_0x38ed('0x59')]=_0xb42563[_0x38ed('0x57')][_0x38ed('0x58')];}return db[_0x38ed('0x3a')][_0x38ed('0x55')]({'where':{'id':_0xb42563[_0x38ed('0x54')]['id']}})[_0x38ed('0x1e')](handleEntityNotFound(_0x567e6f,null))[_0x38ed('0x1e')](saveUpdates(_0xb42563['body'],null))[_0x38ed('0x1e')](respondWithResult(_0x567e6f,null))['catch'](handleError(_0x567e6f,null));};exports[_0x38ed('0x5a')]=function(_0x56034b,_0x8451a8,_0x101ca1){if(_0x56034b[_0x38ed('0x57')]&&_0x56034b[_0x38ed('0x57')][_0x38ed('0x58')]){_0x56034b['body'][_0x38ed('0x5b')]=_0x56034b['file'][_0x38ed('0x58')];}return db['Setting'][_0x38ed('0x55')]({'where':{'id':_0x56034b['params']['id']}})['then'](handleEntityNotFound(_0x8451a8,null))['then'](saveUpdates(_0x56034b[_0x38ed('0x56')],null))['then'](respondWithResult(_0x8451a8,null))[_0x38ed('0x26')](handleError(_0x8451a8,null));};var utilLicense=require(_0x38ed('0x18'));exports[_0x38ed('0x5c')]=function(_0x47372e,_0x36bee0,_0x508dbe){var _0x3a894c='server/files/images/logos';var _0xf23ec5={'custom':![]};return utilLicense[_0x38ed('0x5d')]()[_0x38ed('0x1e')](function(_0x32d300){if(_0x32d300){_0xf23ec5=_0x32d300;}return db[_0x38ed('0x3a')][_0x38ed('0x55')]({'where':{'id':_0x47372e[_0x38ed('0x54')]['id']},'attributes':[_0x38ed('0x59'),'loginLogo',_0x38ed('0x5e'),_0x38ed('0x5f'),_0x38ed('0x60'),_0x38ed('0x61'),_0x38ed('0x62'),_0x38ed('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x36bee0,null))[_0x38ed('0x1e')](function(_0x188932){if(_0x188932){var _0xb3bd23=_0x188932[_0x38ed('0x59')]&&fs[_0x38ed('0x64')](path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x3a894c,_[_0x38ed('0x67')](_0x188932[_0x38ed('0x59')])))?path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x3a894c,_['toLower'](_0x188932[_0x38ed('0x59')])):path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x3a894c,_['toLower'](_0x38ed('0x68')));var _0xac6922=_0x38ed('0x69')+_[_0x38ed('0x6a')]('logo');if(_0x188932[_0xac6922]||!_0xf23ec5['custom']){_0xb3bd23=path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x3a894c,_[_0x38ed('0x67')](_0x38ed('0x68')));}if(!fs[_0x38ed('0x64')](_0xb3bd23)){throw new db[(_0x38ed('0x6b'))][(_0x38ed('0x6c'))](_[_0x38ed('0x6a')]('logo')+'\x20not\x20found');}return _0x36bee0[_0x38ed('0x6d')](_0xb3bd23);}})[_0x38ed('0x26')](handleError(_0x36bee0,null));};var utilLicense=require(_0x38ed('0x18'));exports[_0x38ed('0x6e')]=function(_0x39340b,_0x5a0104,_0x337812){var _0xe8941c=_0x38ed('0x6f');var _0x539f8a={'custom':![]};return utilLicense[_0x38ed('0x5d')]()[_0x38ed('0x1e')](function(_0x1d2b74){if(_0x1d2b74){_0x539f8a=_0x1d2b74;}return db[_0x38ed('0x3a')]['find']({'where':{'id':_0x39340b[_0x38ed('0x54')]['id']},'attributes':[_0x38ed('0x59'),'loginLogo',_0x38ed('0x5e'),_0x38ed('0x5f'),_0x38ed('0x60'),_0x38ed('0x61'),_0x38ed('0x62'),_0x38ed('0x63')],'raw':!![]});})[_0x38ed('0x1e')](handleEntityNotFound(_0x5a0104,null))['then'](function(_0x10701e){if(_0x10701e){var _0x47440c=_0x10701e[_0x38ed('0x5b')]&&fs[_0x38ed('0x64')](path['join'](config[_0x38ed('0x66')],_0xe8941c,_[_0x38ed('0x67')](_0x10701e[_0x38ed('0x5b')])))?path['join'](config['root'],_0xe8941c,_[_0x38ed('0x67')](_0x10701e[_0x38ed('0x5b')])):path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0xe8941c,_[_0x38ed('0x67')](_0x38ed('0x70')));var _0x151d8a=_0x38ed('0x69')+_[_0x38ed('0x6a')](_0x38ed('0x5b'));if(_0x10701e[_0x151d8a]||!_0x539f8a[_0x38ed('0x71')]){_0x47440c=path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0xe8941c,_[_0x38ed('0x67')](_0x38ed('0x70')));}if(!fs[_0x38ed('0x64')](_0x47440c)){throw new db[(_0x38ed('0x6b'))][(_0x38ed('0x6c'))](_[_0x38ed('0x6a')](_0x38ed('0x5b'))+_0x38ed('0x72'));}return _0x5a0104['download'](_0x47440c);}})[_0x38ed('0x26')](handleError(_0x5a0104,null));};exports[_0x38ed('0x73')]=function(_0x526203,_0x46e6bd){return db['Setting'][_0x38ed('0x55')]({'where':{'id':_0x526203['params']['id']},'attributes':[_0x38ed('0x74')]})[_0x38ed('0x1e')](respondWithResult(_0x46e6bd,null))[_0x38ed('0x26')](handleError(_0x46e6bd,null));};exports[_0x38ed('0x75')]=function(_0x20d844,_0x4661ed,_0xe63ca7){if(_0x20d844[_0x38ed('0x57')]&&_0x20d844[_0x38ed('0x57')][_0x38ed('0x58')]){_0x20d844[_0x38ed('0x56')][_0x38ed('0x5e')]=_0x20d844[_0x38ed('0x57')][_0x38ed('0x58')];}return db[_0x38ed('0x3a')][_0x38ed('0x55')]({'where':{'id':_0x20d844[_0x38ed('0x54')]['id']}})[_0x38ed('0x1e')](handleEntityNotFound(_0x4661ed,null))[_0x38ed('0x1e')](saveUpdates(_0x20d844[_0x38ed('0x56')],null))[_0x38ed('0x1e')](respondWithResult(_0x4661ed,null))['catch'](handleError(_0x4661ed,null));};var utilLicense=require(_0x38ed('0x18'));exports[_0x38ed('0x76')]=function(_0x4e7d00,_0x7028a2,_0x2a999f){var _0x539e28=_0x38ed('0x6f');var _0x25df96={'custom':![]};return utilLicense[_0x38ed('0x5d')]()[_0x38ed('0x1e')](function(_0x340ca2){if(_0x340ca2){_0x25df96=_0x340ca2;}return db['Setting']['find']({'where':{'id':_0x4e7d00[_0x38ed('0x54')]['id']},'attributes':[_0x38ed('0x59'),_0x38ed('0x5b'),'preferred',_0x38ed('0x5f'),_0x38ed('0x60'),'defaultLoginLogo','defaultPreferred',_0x38ed('0x63')],'raw':!![]});})[_0x38ed('0x1e')](handleEntityNotFound(_0x7028a2,null))[_0x38ed('0x1e')](function(_0x2beda3){if(_0x2beda3){var _0x2d119a=_0x2beda3[_0x38ed('0x5e')]&&fs[_0x38ed('0x64')](path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x539e28,_[_0x38ed('0x67')](_0x2beda3[_0x38ed('0x5e')])))?path['join'](config[_0x38ed('0x66')],_0x539e28,_[_0x38ed('0x67')](_0x2beda3[_0x38ed('0x5e')])):path[_0x38ed('0x65')](config['root'],_0x539e28,_[_0x38ed('0x67')](_0x38ed('0x77')));var _0x1ae945='default'+_['upperFirst'](_0x38ed('0x5e'));if(_0x2beda3[_0x1ae945]||!_0x25df96['custom']||!_0x25df96[_0x38ed('0x5e')]){_0x2d119a=path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x539e28,_[_0x38ed('0x67')](_0x38ed('0x77')));}if(!fs['existsSync'](_0x2d119a)){throw new db['Sequelize'][(_0x38ed('0x6c'))](_['upperFirst'](_0x38ed('0x5e'))+'\x20not\x20found');}return _0x7028a2[_0x38ed('0x6d')](_0x2d119a);}})[_0x38ed('0x26')](handleError(_0x7028a2,null));};exports[_0x38ed('0x78')]=function(_0x3a353c,_0x518619,_0x6de69c){if(_0x3a353c[_0x38ed('0x57')]&&_0x3a353c['file'][_0x38ed('0x58')]){_0x3a353c[_0x38ed('0x56')][_0x38ed('0x5f')]=_0x3a353c[_0x38ed('0x57')][_0x38ed('0x58')];}return db[_0x38ed('0x3a')][_0x38ed('0x55')]({'where':{'id':_0x3a353c[_0x38ed('0x54')]['id']}})[_0x38ed('0x1e')](handleEntityNotFound(_0x518619,null))['then'](saveUpdates(_0x3a353c[_0x38ed('0x56')],null))['then'](respondWithResult(_0x518619,null))[_0x38ed('0x26')](handleError(_0x518619,null));};var utilLicense=require('../../config/license/util');exports[_0x38ed('0x79')]=function(_0x2930b4,_0x367bf2,_0xd6a55e){var _0x7e4a30=_0x38ed('0x6f');var _0x5cb4b0={'custom':![]};return utilLicense[_0x38ed('0x5d')]()[_0x38ed('0x1e')](function(_0x5ecd50){if(_0x5ecd50){_0x5cb4b0=_0x5ecd50;}return db['Setting'][_0x38ed('0x55')]({'where':{'id':_0x2930b4[_0x38ed('0x54')]['id']},'attributes':['logo',_0x38ed('0x5b'),_0x38ed('0x5e'),_0x38ed('0x5f'),_0x38ed('0x60'),'defaultLoginLogo',_0x38ed('0x62'),_0x38ed('0x63')],'raw':!![]});})[_0x38ed('0x1e')](handleEntityNotFound(_0x367bf2,null))[_0x38ed('0x1e')](function(_0x5d5aab){if(_0x5d5aab){var _0x545961=_0x5d5aab[_0x38ed('0x5f')]&&fs[_0x38ed('0x64')](path['join'](config[_0x38ed('0x66')],_0x7e4a30,_[_0x38ed('0x67')](_0x5d5aab[_0x38ed('0x5f')])))?path['join'](config[_0x38ed('0x66')],_0x7e4a30,_[_0x38ed('0x67')](_0x5d5aab[_0x38ed('0x5f')])):path['join'](config[_0x38ed('0x66')],_0x7e4a30,_[_0x38ed('0x67')](_0x38ed('0x7a')));var _0x1edc57=_0x38ed('0x69')+_[_0x38ed('0x6a')](_0x38ed('0x5f'));if(_0x5d5aab[_0x1edc57]||!_0x5cb4b0[_0x38ed('0x71')]){_0x545961=path[_0x38ed('0x65')](config[_0x38ed('0x66')],_0x7e4a30,_[_0x38ed('0x67')]('default_favicon.ico'));}if(!fs[_0x38ed('0x64')](_0x545961)){throw new db['Sequelize'][(_0x38ed('0x6c'))](_['upperFirst']('favicon')+_0x38ed('0x72'));}return _0x367bf2['download'](_0x545961);}})['catch'](handleError(_0x367bf2,null));};exports['getDate']=function(_0x12cfb1,_0x56ea95){var _0x65f1a4={'offset':moment()[_0x38ed('0x7b')]()};_0x65f1a4['now']=moment()['utcOffset'](_0x65f1a4['offset'])[_0x38ed('0x7c')](_0x38ed('0x7d'));return _0x56ea95[_0x38ed('0x28')](0xc8)['send'](_0x65f1a4);}; \ No newline at end of file +var _0x63a3=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','show','params','filters','length','include','options','find','update','body','addLogo','file','logo','filename','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x63a3,0x15b));var _0x363a=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x63a3[_0x6a0266];return _0x309e00;};'use strict';var emlformat=require(_0x363a('0x0'));var rimraf=require(_0x363a('0x1'));var zipdir=require(_0x363a('0x2'));var jsonpatch=require(_0x363a('0x3'));var rp=require(_0x363a('0x4'));var moment=require(_0x363a('0x5'));var BPromise=require(_0x363a('0x6'));var Mustache=require('mustache');var util=require(_0x363a('0x7'));var path=require(_0x363a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x363a('0x9'));var fs=require('fs');var fs_extra=require(_0x363a('0xa'));var _=require(_0x363a('0xb'));var squel=require(_0x363a('0xc'));var crypto=require(_0x363a('0xd'));var jsforce=require(_0x363a('0xe'));var deskjs=require(_0x363a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x363a('0x10'));var Papa=require('papaparse');var Redis=require(_0x363a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x363a('0x12'));var as=require(_0x363a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x363a('0x14'));var config=require(_0x363a('0x15'));var licenseUtil=require(_0x363a('0x16'));var db=require(_0x363a('0x17'))['db'];var jayson=require(_0x363a('0x18'));var client=jayson[_0x363a('0x19')][_0x363a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2503f0,_0x7d8bd,_0x49b63c,_0x41597a){return new BPromise(function(_0x5bbd9c,_0x353d5e){var _0x28ec14=_0x41597a||client;return _0x28ec14[_0x363a('0x1b')](_0x2503f0,_0x49b63c)['then'](function(_0x353ad1){logger[_0x363a('0x1c')](_0x363a('0x1d'),_0x7d8bd,_0x363a('0x1e'));logger[_0x363a('0x1f')](_0x363a('0x20'),_0x7d8bd,_0x363a('0x1e'),JSON[_0x363a('0x21')](_0x353ad1));if(_0x353ad1[_0x363a('0x22')]){if(_0x353ad1[_0x363a('0x22')][_0x363a('0x23')]===0x1f4){logger['error'](_0x363a('0x1d'),_0x7d8bd,_0x353ad1['error']['message']);return _0x353d5e(_0x353ad1['error'][_0x363a('0x24')]);}logger[_0x363a('0x22')]('Setting,\x20%s,\x20%s',_0x7d8bd,_0x353ad1[_0x363a('0x22')][_0x363a('0x24')]);return _0x5bbd9c(_0x353ad1[_0x363a('0x22')]['message']);}else{logger[_0x363a('0x1c')]('Setting,\x20%s,\x20%s',_0x7d8bd,'request\x20sent');_0x5bbd9c(_0x353ad1[_0x363a('0x25')]['message']);}})[_0x363a('0x26')](function(_0x34990c){logger['error']('Setting,\x20%s,\x20%s',_0x7d8bd,_0x34990c);_0x353d5e(_0x34990c);});});}function respondWithStatusCode(_0x139304,_0x170bef){_0x170bef=_0x170bef||0xcc;return function(_0x190836){if(_0x190836){return _0x139304['sendStatus'](_0x170bef);}return _0x139304[_0x363a('0x27')](_0x170bef)[_0x363a('0x28')]();};}function respondWithResult(_0x2f8098,_0x4d6f09){_0x4d6f09=_0x4d6f09||0xc8;return function(_0x4f5b65){if(_0x4f5b65){return _0x2f8098[_0x363a('0x27')](_0x4d6f09)[_0x363a('0x29')](_0x4f5b65);}};}function respondWithFilteredResult(_0x456022,_0x4da3c4){return function(_0x2a1ecd){if(_0x2a1ecd){var _0x4b01ab=typeof _0x4da3c4[_0x363a('0x2a')]===_0x363a('0x2b')&&typeof _0x4da3c4[_0x363a('0x2c')]===_0x363a('0x2b');var _0x1dbae5=_0x2a1ecd[_0x363a('0x2d')];var _0x45cdcd=_0x4b01ab?0x0:_0x4da3c4[_0x363a('0x2a')];var _0x34435a=_0x4b01ab?_0x2a1ecd[_0x363a('0x2d')]:_0x4da3c4[_0x363a('0x2a')]+_0x4da3c4['limit'];var _0x166618;if(_0x34435a>=_0x1dbae5){_0x34435a=_0x1dbae5;_0x166618=0xc8;}else{_0x166618=0xce;}_0x456022[_0x363a('0x27')](_0x166618);return _0x456022[_0x363a('0x2e')](_0x363a('0x2f'),_0x45cdcd+'-'+_0x34435a+'/'+_0x1dbae5)[_0x363a('0x29')](_0x2a1ecd);}return null;};}function patchUpdates(_0x4cf426){return function(_0x52d297){try{jsonpatch['apply'](_0x52d297,_0x4cf426,!![]);}catch(_0x401efa){return BPromise[_0x363a('0x30')](_0x401efa);}return _0x52d297['save']();};}function saveUpdates(_0x4814cb,_0x1d16a6){return function(_0x1b0553){if(_0x1b0553){return _0x1b0553['update'](_0x4814cb)['then'](function(_0x56862f){return _0x56862f;});}return null;};}function removeEntity(_0xe9c389,_0x366bd1){return function(_0x57dd6e){if(_0x57dd6e){return _0x57dd6e[_0x363a('0x31')]()[_0x363a('0x32')](function(){_0xe9c389[_0x363a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26311b,_0x222493){return function(_0x4446ad){if(!_0x4446ad){_0x26311b[_0x363a('0x33')](0x194);}return _0x4446ad;};}function handleError(_0x38c43a,_0x266cae){_0x266cae=_0x266cae||0x1f4;return function(_0x23c278){logger['error'](_0x23c278[_0x363a('0x34')]);if(_0x23c278[_0x363a('0x35')]){delete _0x23c278['name'];}_0x38c43a[_0x363a('0x27')](_0x266cae)[_0x363a('0x36')](_0x23c278);};}exports[_0x363a('0x37')]=function(_0x4313fa,_0x2dc097){var _0x283f1e={},_0x528c77={},_0xf3dcdd={'count':0x0,'rows':[]};var _0x587296=_[_0x363a('0x38')](db[_0x363a('0x39')][_0x363a('0x3a')],function(_0x21ed8c){return{'name':_0x21ed8c[_0x363a('0x3b')],'type':_0x21ed8c[_0x363a('0x3c')][_0x363a('0x3d')]};});_0x528c77[_0x363a('0x3e')]=_['map'](_0x587296,_0x363a('0x35'));_0x528c77[_0x363a('0x3f')]=_[_0x363a('0x40')](_0x4313fa[_0x363a('0x3f')]);_0x528c77['filters']=_['intersection'](_0x528c77['model'],_0x528c77[_0x363a('0x3f')]);_0x283f1e[_0x363a('0x41')]=_[_0x363a('0x42')](_0x528c77[_0x363a('0x3e')],qs['fields'](_0x4313fa[_0x363a('0x3f')][_0x363a('0x43')]));_0x283f1e[_0x363a('0x41')]=_0x283f1e[_0x363a('0x41')]['length']?_0x283f1e[_0x363a('0x41')]:_0x528c77['model'];if(!_0x4313fa[_0x363a('0x3f')][_0x363a('0x44')](_0x363a('0x45'))){_0x283f1e[_0x363a('0x2c')]=qs[_0x363a('0x2c')](_0x4313fa[_0x363a('0x3f')][_0x363a('0x2c')]);_0x283f1e['offset']=qs[_0x363a('0x2a')](_0x4313fa[_0x363a('0x3f')]['offset']);}_0x283f1e[_0x363a('0x46')]=qs[_0x363a('0x47')](_0x4313fa[_0x363a('0x3f')][_0x363a('0x47')]);_0x283f1e[_0x363a('0x48')]=qs['filters'](_[_0x363a('0x49')](_0x4313fa[_0x363a('0x3f')],_0x528c77['filters']),_0x587296);if(_0x4313fa['query']['filter']){_0x283f1e[_0x363a('0x48')]=_[_0x363a('0x4a')](_0x283f1e['where'],{'$or':_[_0x363a('0x38')](_0x587296,function(_0xd16e04){if(_0xd16e04['type']!==_0x363a('0x4b')){var _0x309ded={};_0x309ded[_0xd16e04[_0x363a('0x35')]]={'$like':'%'+_0x4313fa[_0x363a('0x3f')]['filter']+'%'};return _0x309ded;}})});}_0x283f1e=_[_0x363a('0x4a')]({},_0x283f1e,_0x4313fa['options']);var _0x50ef2d={'where':_0x283f1e[_0x363a('0x48')]};return db['Setting'][_0x363a('0x2d')](_0x50ef2d)[_0x363a('0x32')](function(_0x313462){_0xf3dcdd[_0x363a('0x2d')]=_0x313462;if(_0x4313fa['query']['includeAll']){_0x283f1e['include']=[{'all':!![]}];}return db['Setting']['findAll'](_0x283f1e);})[_0x363a('0x32')](function(_0x1cbf26){_0xf3dcdd['rows']=_0x1cbf26;return _0xf3dcdd;})[_0x363a('0x32')](respondWithFilteredResult(_0x2dc097,_0x283f1e))[_0x363a('0x26')](handleError(_0x2dc097,null));};exports[_0x363a('0x4c')]=function(_0x5c233b,_0x138d44){var _0x5c8143={'raw':![],'where':{'id':_0x5c233b[_0x363a('0x4d')]['id']}},_0x52a4e0={};_0x52a4e0[_0x363a('0x3e')]=_[_0x363a('0x40')](db[_0x363a('0x39')]['rawAttributes']);_0x52a4e0['query']=_[_0x363a('0x40')](_0x5c233b[_0x363a('0x3f')]);_0x52a4e0[_0x363a('0x4e')]=_['intersection'](_0x52a4e0[_0x363a('0x3e')],_0x52a4e0[_0x363a('0x3f')]);_0x5c8143['attributes']=_[_0x363a('0x42')](_0x52a4e0[_0x363a('0x3e')],qs[_0x363a('0x43')](_0x5c233b[_0x363a('0x3f')]['fields']));_0x5c8143[_0x363a('0x41')]=_0x5c8143['attributes'][_0x363a('0x4f')]?_0x5c8143[_0x363a('0x41')]:_0x52a4e0['model'];if(_0x5c233b[_0x363a('0x3f')]['includeAll']){_0x5c8143[_0x363a('0x50')]=[{'all':!![]}];}_0x5c8143=_[_0x363a('0x4a')]({},_0x5c8143,_0x5c233b[_0x363a('0x51')]);return db[_0x363a('0x39')][_0x363a('0x52')](_0x5c8143)[_0x363a('0x32')](handleEntityNotFound(_0x138d44,null))['then'](respondWithResult(_0x138d44,null))[_0x363a('0x26')](handleError(_0x138d44,null));};exports[_0x363a('0x53')]=function(_0x143c2e,_0x37d084){if(_0x143c2e[_0x363a('0x54')]['id']){delete _0x143c2e['body']['id'];}return db[_0x363a('0x39')]['find']({'where':{'id':_0x143c2e[_0x363a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x37d084,null))[_0x363a('0x32')](saveUpdates(_0x143c2e[_0x363a('0x54')],null))[_0x363a('0x32')](respondWithResult(_0x37d084,null))['catch'](handleError(_0x37d084,null));};exports[_0x363a('0x55')]=function(_0x823f31,_0x2bf1ed,_0x192239){if(_0x823f31['file']&&_0x823f31[_0x363a('0x56')]['filename']){_0x823f31[_0x363a('0x54')][_0x363a('0x57')]=_0x823f31['file'][_0x363a('0x58')];}return db['Setting'][_0x363a('0x52')]({'where':{'id':_0x823f31[_0x363a('0x4d')]['id']}})[_0x363a('0x32')](handleEntityNotFound(_0x2bf1ed,null))['then'](saveUpdates(_0x823f31[_0x363a('0x54')],null))[_0x363a('0x32')](respondWithResult(_0x2bf1ed,null))[_0x363a('0x26')](handleError(_0x2bf1ed,null));};exports['addLogoLogin']=function(_0x416533,_0x310b6a,_0x12f6aa){if(_0x416533[_0x363a('0x56')]&&_0x416533[_0x363a('0x56')][_0x363a('0x58')]){_0x416533[_0x363a('0x54')][_0x363a('0x59')]=_0x416533['file'][_0x363a('0x58')];}return db[_0x363a('0x39')]['find']({'where':{'id':_0x416533[_0x363a('0x4d')]['id']}})[_0x363a('0x32')](handleEntityNotFound(_0x310b6a,null))['then'](saveUpdates(_0x416533[_0x363a('0x54')],null))[_0x363a('0x32')](respondWithResult(_0x310b6a,null))[_0x363a('0x26')](handleError(_0x310b6a,null));};var utilLicense=require(_0x363a('0x16'));exports['getLogo']=function(_0x584c17,_0x45a916,_0x49d99f){var _0x4d7aae=_0x363a('0x5a');var _0x2eee1b={'custom':![]};return utilLicense['getLicense']()[_0x363a('0x32')](function(_0x4bb4d7){if(_0x4bb4d7){_0x2eee1b=_0x4bb4d7;}return db['Setting']['find']({'where':{'id':_0x584c17[_0x363a('0x4d')]['id']},'attributes':['logo',_0x363a('0x59'),_0x363a('0x5b'),_0x363a('0x5c'),_0x363a('0x5d'),'defaultLoginLogo',_0x363a('0x5e'),_0x363a('0x5f')],'raw':!![]});})[_0x363a('0x32')](handleEntityNotFound(_0x45a916,null))[_0x363a('0x32')](function(_0x242633){if(_0x242633){var _0xf9658b=_0x242633[_0x363a('0x57')]&&fs['existsSync'](path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4d7aae,_[_0x363a('0x62')](_0x242633[_0x363a('0x57')])))?path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4d7aae,_[_0x363a('0x62')](_0x242633[_0x363a('0x57')])):path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4d7aae,_[_0x363a('0x62')](_0x363a('0x63')));var _0x2a4597=_0x363a('0x64')+_[_0x363a('0x65')](_0x363a('0x57'));if(_0x242633[_0x2a4597]||!_0x2eee1b[_0x363a('0x66')]){_0xf9658b=path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4d7aae,_[_0x363a('0x62')](_0x363a('0x63')));}if(!fs[_0x363a('0x67')](_0xf9658b)){throw new db[(_0x363a('0x68'))][(_0x363a('0x69'))](_[_0x363a('0x65')](_0x363a('0x57'))+_0x363a('0x6a'));}return _0x45a916[_0x363a('0x6b')](_0xf9658b);}})[_0x363a('0x26')](handleError(_0x45a916,null));};var utilLicense=require(_0x363a('0x16'));exports[_0x363a('0x6c')]=function(_0x29cbe7,_0x1faac0,_0x4a5d7e){var _0x342993=_0x363a('0x5a');var _0x42f2b7={'custom':![]};return utilLicense[_0x363a('0x6d')]()[_0x363a('0x32')](function(_0x1e1ccc){if(_0x1e1ccc){_0x42f2b7=_0x1e1ccc;}return db['Setting'][_0x363a('0x52')]({'where':{'id':_0x29cbe7['params']['id']},'attributes':[_0x363a('0x57'),_0x363a('0x59'),'preferred',_0x363a('0x5c'),_0x363a('0x5d'),_0x363a('0x6e'),_0x363a('0x5e'),_0x363a('0x5f')],'raw':!![]});})[_0x363a('0x32')](handleEntityNotFound(_0x1faac0,null))[_0x363a('0x32')](function(_0x440bf4){if(_0x440bf4){var _0x191012=_0x440bf4['loginLogo']&&fs[_0x363a('0x67')](path['join'](config[_0x363a('0x61')],_0x342993,_[_0x363a('0x62')](_0x440bf4[_0x363a('0x59')])))?path[_0x363a('0x60')](config['root'],_0x342993,_[_0x363a('0x62')](_0x440bf4[_0x363a('0x59')])):path['join'](config[_0x363a('0x61')],_0x342993,_[_0x363a('0x62')](_0x363a('0x6f')));var _0x453078=_0x363a('0x64')+_[_0x363a('0x65')](_0x363a('0x59'));if(_0x440bf4[_0x453078]||!_0x42f2b7['custom']){_0x191012=path[_0x363a('0x60')](config[_0x363a('0x61')],_0x342993,_[_0x363a('0x62')]('default_loginLogo.svg'));}if(!fs[_0x363a('0x67')](_0x191012)){throw new db[(_0x363a('0x68'))][(_0x363a('0x69'))](_['upperFirst'](_0x363a('0x59'))+_0x363a('0x6a'));}return _0x1faac0[_0x363a('0x6b')](_0x191012);}})[_0x363a('0x26')](handleError(_0x1faac0,null));};exports[_0x363a('0x70')]=function(_0x638599,_0x578ae1){return db[_0x363a('0x39')][_0x363a('0x52')]({'where':{'id':_0x638599['params']['id']},'attributes':[_0x363a('0x71')]})[_0x363a('0x32')](respondWithResult(_0x578ae1,null))['catch'](handleError(_0x578ae1,null));};exports[_0x363a('0x72')]=function(_0x2d5bd1,_0x1712e9,_0x263189){if(_0x2d5bd1[_0x363a('0x56')]&&_0x2d5bd1[_0x363a('0x56')][_0x363a('0x58')]){_0x2d5bd1[_0x363a('0x54')][_0x363a('0x5b')]=_0x2d5bd1[_0x363a('0x56')][_0x363a('0x58')];}return db[_0x363a('0x39')]['find']({'where':{'id':_0x2d5bd1[_0x363a('0x4d')]['id']}})[_0x363a('0x32')](handleEntityNotFound(_0x1712e9,null))[_0x363a('0x32')](saveUpdates(_0x2d5bd1[_0x363a('0x54')],null))[_0x363a('0x32')](respondWithResult(_0x1712e9,null))[_0x363a('0x26')](handleError(_0x1712e9,null));};var utilLicense=require('../../config/license/util');exports[_0x363a('0x73')]=function(_0x3621a7,_0x440955,_0x16d727){var _0xbdb90e=_0x363a('0x5a');var _0x51a279={'custom':![]};return utilLicense['getLicense']()[_0x363a('0x32')](function(_0x3e4212){if(_0x3e4212){_0x51a279=_0x3e4212;}return db[_0x363a('0x39')][_0x363a('0x52')]({'where':{'id':_0x3621a7[_0x363a('0x4d')]['id']},'attributes':[_0x363a('0x57'),'loginLogo','preferred',_0x363a('0x5c'),_0x363a('0x5d'),_0x363a('0x6e'),_0x363a('0x5e'),_0x363a('0x5f')],'raw':!![]});})[_0x363a('0x32')](handleEntityNotFound(_0x440955,null))['then'](function(_0x3589f1){if(_0x3589f1){var _0x370ff4=_0x3589f1['preferred']&&fs[_0x363a('0x67')](path[_0x363a('0x60')](config[_0x363a('0x61')],_0xbdb90e,_['toLower'](_0x3589f1['preferred'])))?path['join'](config[_0x363a('0x61')],_0xbdb90e,_[_0x363a('0x62')](_0x3589f1[_0x363a('0x5b')])):path[_0x363a('0x60')](config[_0x363a('0x61')],_0xbdb90e,_[_0x363a('0x62')](_0x363a('0x74')));var _0x4ba747=_0x363a('0x64')+_[_0x363a('0x65')](_0x363a('0x5b'));if(_0x3589f1[_0x4ba747]||!_0x51a279[_0x363a('0x66')]||!_0x51a279['preferred']){_0x370ff4=path[_0x363a('0x60')](config[_0x363a('0x61')],_0xbdb90e,_[_0x363a('0x62')](_0x363a('0x74')));}if(!fs['existsSync'](_0x370ff4)){throw new db[(_0x363a('0x68'))][(_0x363a('0x69'))](_[_0x363a('0x65')]('preferred')+_0x363a('0x6a'));}return _0x440955[_0x363a('0x6b')](_0x370ff4);}})[_0x363a('0x26')](handleError(_0x440955,null));};exports[_0x363a('0x75')]=function(_0x1b56c8,_0x1d9974,_0x36ea7e){if(_0x1b56c8[_0x363a('0x56')]&&_0x1b56c8['file']['filename']){_0x1b56c8[_0x363a('0x54')][_0x363a('0x5c')]=_0x1b56c8[_0x363a('0x56')][_0x363a('0x58')];}return db[_0x363a('0x39')][_0x363a('0x52')]({'where':{'id':_0x1b56c8[_0x363a('0x4d')]['id']}})[_0x363a('0x32')](handleEntityNotFound(_0x1d9974,null))['then'](saveUpdates(_0x1b56c8[_0x363a('0x54')],null))[_0x363a('0x32')](respondWithResult(_0x1d9974,null))[_0x363a('0x26')](handleError(_0x1d9974,null));};var utilLicense=require(_0x363a('0x16'));exports['getFavicon']=function(_0x3806f5,_0x2ec551,_0x327411){var _0x4bb990=_0x363a('0x5a');var _0x2d3119={'custom':![]};return utilLicense[_0x363a('0x6d')]()[_0x363a('0x32')](function(_0x31d9de){if(_0x31d9de){_0x2d3119=_0x31d9de;}return db[_0x363a('0x39')][_0x363a('0x52')]({'where':{'id':_0x3806f5[_0x363a('0x4d')]['id']},'attributes':[_0x363a('0x57'),_0x363a('0x59'),'preferred',_0x363a('0x5c'),_0x363a('0x5d'),_0x363a('0x6e'),_0x363a('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2ec551,null))[_0x363a('0x32')](function(_0x527d6a){if(_0x527d6a){var _0x24b8a6=_0x527d6a[_0x363a('0x5c')]&&fs[_0x363a('0x67')](path['join'](config['root'],_0x4bb990,_[_0x363a('0x62')](_0x527d6a[_0x363a('0x5c')])))?path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4bb990,_[_0x363a('0x62')](_0x527d6a[_0x363a('0x5c')])):path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4bb990,_[_0x363a('0x62')]('default_favicon.ico'));var _0x196cca=_0x363a('0x64')+_['upperFirst']('favicon');if(_0x527d6a[_0x196cca]||!_0x2d3119[_0x363a('0x66')]){_0x24b8a6=path[_0x363a('0x60')](config[_0x363a('0x61')],_0x4bb990,_[_0x363a('0x62')]('default_favicon.ico'));}if(!fs[_0x363a('0x67')](_0x24b8a6)){throw new db[(_0x363a('0x68'))][(_0x363a('0x69'))](_[_0x363a('0x65')](_0x363a('0x5c'))+'\x20not\x20found');}return _0x2ec551[_0x363a('0x6b')](_0x24b8a6);}})[_0x363a('0x26')](handleError(_0x2ec551,null));};exports['getDate']=function(_0x28187c,_0x578c45){var _0x45a4d7={'offset':moment()[_0x363a('0x76')]()};_0x45a4d7[_0x363a('0x77')]=moment()[_0x363a('0x76')](_0x45a4d7[_0x363a('0x2a')])[_0x363a('0x78')](_0x363a('0x79'));return _0x578c45[_0x363a('0x27')](0xc8)['send'](_0x45a4d7);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 28d270e..672c68c 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x55ca,0x126));var _0xa55c=function(_0x5e32f3,_0x3386c1){_0x5e32f3=_0x5e32f3-0x0;var _0x4d4e03=_0x55ca[_0x5e32f3];return _0x4d4e03;};'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 +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x55ca,0x126));var _0xa55c=function(_0x1875c8,_0x4e5f7a){_0x1875c8=_0x1875c8-0x0;var _0x28ed91=_0x55ca[_0x1875c8];return _0x28ed91;};'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 677aca9..d9aceb6 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 _0x4208=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','include','map','model','attributes','then','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4208,0xd8));var _0x8420=function(_0x43a4c2,_0x4e400f){_0x43a4c2=_0x43a4c2-0x0;var _0x3cd4fb=_0x4208[_0x43a4c2];return _0x3cd4fb;};'use strict';var _=require(_0x8420('0x0'));var util=require(_0x8420('0x1'));var moment=require(_0x8420('0x2'));var BPromise=require('bluebird');var rs=require(_0x8420('0x3'));var fs=require('fs');var Redis=require(_0x8420('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8420('0x5'));var logger=require(_0x8420('0x6'))(_0x8420('0x7'));var config=require('../../config/environment');var jayson=require(_0x8420('0x8'));var client=jayson['client'][_0x8420('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4850cc,_0x4f3b67,_0x4fbaac){return new BPromise(function(_0x523b64,_0x416d71){return client[_0x8420('0xa')](_0x4850cc,_0x4fbaac)['then'](function(_0x21c8f7){logger[_0x8420('0xb')]('Setting,\x20%s,\x20%s',_0x4f3b67,_0x8420('0xc'));logger[_0x8420('0xd')](_0x8420('0xe'),_0x4f3b67,'request\x20sent',JSON[_0x8420('0xf')](_0x21c8f7));if(_0x21c8f7[_0x8420('0x10')]){if(_0x21c8f7['error'][_0x8420('0x11')]===0x1f4){logger[_0x8420('0x10')](_0x8420('0x12'),_0x4f3b67,_0x21c8f7['error']['message']);return _0x416d71(_0x21c8f7['error']['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x4f3b67,_0x21c8f7[_0x8420('0x10')][_0x8420('0x13')]);return _0x523b64(_0x21c8f7[_0x8420('0x10')][_0x8420('0x13')]);}else{logger[_0x8420('0xb')]('Setting,\x20%s,\x20%s',_0x4f3b67,_0x8420('0xc'));_0x523b64(_0x21c8f7[_0x8420('0x14')]['message']);}})[_0x8420('0x15')](function(_0xf3334b){logger[_0x8420('0x10')](_0x8420('0x12'),_0x4f3b67,_0xf3334b);_0x416d71(_0xf3334b);});});}exports[_0x8420('0x16')]=function(_0x1452fe){var _0x3925ca=this;return new Promise(function(_0x5010ad,_0x201fd4){return db[_0x8420('0x17')][_0x8420('0x18')]({'raw':_0x1452fe[_0x8420('0x19')]?_0x1452fe[_0x8420('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1452fe['options']?_0x1452fe[_0x8420('0x19')]['where']||null:null,'attributes':_0x1452fe[_0x8420('0x19')]?_0x1452fe[_0x8420('0x19')]['attributes']||null:null,'include':_0x1452fe['options']?_0x1452fe[_0x8420('0x19')][_0x8420('0x1a')]?_[_0x8420('0x1b')](_0x1452fe[_0x8420('0x19')][_0x8420('0x1a')],function(_0x5b2800){return{'model':db[_0x5b2800[_0x8420('0x1c')]],'as':_0x5b2800['as'],'attributes':_0x5b2800['attributes'],'include':_0x5b2800[_0x8420('0x1a')]?_['map'](_0x5b2800[_0x8420('0x1a')],function(_0x459342){return{'model':db[_0x459342[_0x8420('0x1c')]],'as':_0x459342['as'],'attributes':_0x459342[_0x8420('0x1d')],'include':_0x459342[_0x8420('0x1a')]?_[_0x8420('0x1b')](_0x459342[_0x8420('0x1a')],function(_0x48c2b1){return{'model':db[_0x48c2b1[_0x8420('0x1c')]],'as':_0x48c2b1['as'],'attributes':_0x48c2b1[_0x8420('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8420('0x1e')](function(_0x5600c0){logger[_0x8420('0xb')]('ShowSetting',_0x1452fe);logger[_0x8420('0xd')](_0x8420('0x16'),_0x1452fe,JSON[_0x8420('0xf')](_0x5600c0));_0x5010ad(_0x5600c0);})[_0x8420('0x15')](function(_0x2f79e2){logger[_0x8420('0x10')](_0x8420('0x16'),_0x2f79e2[_0x8420('0x13')],_0x1452fe);_0x201fd4(_0x3925ca['error'](0x1f4,_0x2f79e2['message']));});});}; \ No newline at end of file +var _0x2d86=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Setting,\x20%s,\x20%s','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','debug','catch'];(function(_0x117282,_0x46f977){var _0x1729af=function(_0x578742){while(--_0x578742){_0x117282['push'](_0x117282['shift']());}};_0x1729af(++_0x46f977);}(_0x2d86,0x1c0));var _0x62d8=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x2d86[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x62d8('0x0'));var util=require(_0x62d8('0x1'));var moment=require(_0x62d8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62d8('0x3'));var db=require(_0x62d8('0x4'))['db'];var utils=require(_0x62d8('0x5'));var logger=require('../../config/logger')(_0x62d8('0x6'));var config=require(_0x62d8('0x7'));var jayson=require(_0x62d8('0x8'));var client=jayson[_0x62d8('0x9')][_0x62d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d8705,_0x40b6d2,_0x6b424f){return new BPromise(function(_0x5410a3,_0x53af5f){return client[_0x62d8('0xb')](_0x3d8705,_0x6b424f)[_0x62d8('0xc')](function(_0x373b8d){logger[_0x62d8('0xd')]('Setting,\x20%s,\x20%s',_0x40b6d2,'request\x20sent');logger['debug'](_0x62d8('0xe'),_0x40b6d2,_0x62d8('0xf'),JSON['stringify'](_0x373b8d));if(_0x373b8d[_0x62d8('0x10')]){if(_0x373b8d[_0x62d8('0x10')][_0x62d8('0x11')]===0x1f4){logger[_0x62d8('0x10')]('Setting,\x20%s,\x20%s',_0x40b6d2,_0x373b8d[_0x62d8('0x10')][_0x62d8('0x12')]);return _0x53af5f(_0x373b8d['error'][_0x62d8('0x12')]);}logger[_0x62d8('0x10')](_0x62d8('0x13'),_0x40b6d2,_0x373b8d[_0x62d8('0x10')][_0x62d8('0x12')]);return _0x5410a3(_0x373b8d[_0x62d8('0x10')]['message']);}else{logger['info'](_0x62d8('0x13'),_0x40b6d2,'request\x20sent');_0x5410a3(_0x373b8d['result'][_0x62d8('0x12')]);}})['catch'](function(_0x3b0395){logger[_0x62d8('0x10')](_0x62d8('0x13'),_0x40b6d2,_0x3b0395);_0x53af5f(_0x3b0395);});});}exports[_0x62d8('0x14')]=function(_0x4f3853){var _0x5b809e=this;return new Promise(function(_0x57b7cc,_0x2dd9c6){return db[_0x62d8('0x15')][_0x62d8('0x16')]({'raw':_0x4f3853[_0x62d8('0x17')]?_0x4f3853[_0x62d8('0x17')][_0x62d8('0x18')]===undefined?!![]:![]:!![],'where':_0x4f3853[_0x62d8('0x17')]?_0x4f3853[_0x62d8('0x17')][_0x62d8('0x19')]||null:null,'attributes':_0x4f3853[_0x62d8('0x17')]?_0x4f3853['options'][_0x62d8('0x1a')]||null:null,'include':_0x4f3853['options']?_0x4f3853[_0x62d8('0x17')][_0x62d8('0x1b')]?_[_0x62d8('0x1c')](_0x4f3853[_0x62d8('0x17')]['include'],function(_0x68160f){return{'model':db[_0x68160f['model']],'as':_0x68160f['as'],'attributes':_0x68160f[_0x62d8('0x1a')],'include':_0x68160f[_0x62d8('0x1b')]?_[_0x62d8('0x1c')](_0x68160f[_0x62d8('0x1b')],function(_0x18c702){return{'model':db[_0x18c702[_0x62d8('0x1d')]],'as':_0x18c702['as'],'attributes':_0x18c702[_0x62d8('0x1a')],'include':_0x18c702[_0x62d8('0x1b')]?_[_0x62d8('0x1c')](_0x18c702['include'],function(_0x1e7e23){return{'model':db[_0x1e7e23[_0x62d8('0x1d')]],'as':_0x1e7e23['as'],'attributes':_0x1e7e23[_0x62d8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20100f){logger['info'](_0x62d8('0x14'),_0x4f3853);logger[_0x62d8('0x1e')](_0x62d8('0x14'),_0x4f3853,JSON['stringify'](_0x20100f));_0x57b7cc(_0x20100f);})[_0x62d8('0x1f')](function(_0x5358fb){logger['error'](_0x62d8('0x14'),_0x5358fb[_0x62d8('0x12')],_0x4f3853);_0x2dd9c6(_0x5b809e[_0x62d8('0x10')](0x1f4,_0x5358fb['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4bbe60f..9ee7a97 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0xe4a9e8,_0x29735c){var _0x214927=function(_0x23c387){while(--_0x23c387){_0xe4a9e8['push'](_0xe4a9e8['shift']());}};_0x214927(++_0x29735c);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab65f,_0x4d7cd0){_0x5ab65f=_0x5ab65f-0x0;var _0x4adaa8=_0x7a54[_0x5ab65f];return _0x4adaa8;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x525370,_0x5abe18){var _0x4a1ae9=function(_0x257f97){while(--_0x257f97){_0x525370['push'](_0x525370['shift']());}};_0x4a1ae9(++_0x5abe18);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 43420f2..97f5043 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 _0x6a5a=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio'];(function(_0x11d626,_0x4a1805){var _0x11c15c=function(_0x4117e7){while(--_0x4117e7){_0x11d626['push'](_0x11d626['shift']());}};_0x11c15c(++_0x4a1805);}(_0x6a5a,0x1c1));var _0xa6a5=function(_0x3c8cf3,_0x424160){_0x3c8cf3=_0x3c8cf3-0x0;var _0x554a7d=_0x6a5a[_0x3c8cf3];return _0x554a7d;};'use strict';var Sequelize=require(_0xa6a5('0x0'));var rs=require(_0xa6a5('0x1'));module['exports']={'name':{'type':Sequelize[_0xa6a5('0x2')],'unique':_0xa6a5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa6a5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa6a5('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa6a5('0x2')],'defaultValue':function(){return rs[_0xa6a5('0x4')]();}},'phone':{'type':Sequelize[_0xa6a5('0x2')]},'type':{'type':Sequelize[_0xa6a5('0x5')](_0xa6a5('0x6'),_0xa6a5('0x7'),_0xa6a5('0x8'),_0xa6a5('0x9'),_0xa6a5('0xa'),_0xa6a5('0xb'),_0xa6a5('0xc'),_0xa6a5('0xd'),_0xa6a5('0xe'),'intelepeer')},'accountSid':{'type':Sequelize[_0xa6a5('0x2')]},'authId':{'type':Sequelize[_0xa6a5('0x2')]},'authToken':{'type':Sequelize[_0xa6a5('0x2')]},'smsMethod':{'type':Sequelize[_0xa6a5('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa6a5('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xa6a5('0x2')]},'applicationId':{'type':Sequelize[_0xa6a5('0x2')]},'accountId':{'type':Sequelize[_0xa6a5('0x2')]},'senderString':{'type':Sequelize[_0xa6a5('0x2')]},'deliveryReport':{'type':Sequelize[_0xa6a5('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa6a5('0x10')],'defaultValue':function(){return _0xa6a5('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6a5('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa6a5('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa6a5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6a5('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6a5('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa6a5('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6a5('0x12')],'comment':_0xa6a5('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa6a5('0x14'),'set':function(_0x436cd7){if(!_0x436cd7)this[_0xa6a5('0x15')](_0xa6a5('0x16'),null);this[_0xa6a5('0x15')](_0xa6a5('0x17'),_0x436cd7);}}}; \ No newline at end of file +var _0xb374=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','ENUM','twilio'];(function(_0x377018,_0x177167){var _0x44b8ad=function(_0x150f43){while(--_0x150f43){_0x377018['push'](_0x377018['shift']());}};_0x44b8ad(++_0x177167);}(_0xb374,0x1b3));var _0x4b37=function(_0x45f679,_0x4d3767){_0x45f679=_0x45f679-0x0;var _0x47ce4a=_0xb374[_0x45f679];return _0x47ce4a;};'use strict';var Sequelize=require(_0x4b37('0x0'));var rs=require(_0x4b37('0x1'));module['exports']={'name':{'type':Sequelize[_0x4b37('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4b37('0x3')]();}},'phone':{'type':Sequelize[_0x4b37('0x2')]},'type':{'type':Sequelize[_0x4b37('0x4')](_0x4b37('0x5'),_0x4b37('0x6'),_0x4b37('0x7'),_0x4b37('0x8'),_0x4b37('0x9'),_0x4b37('0xa'),_0x4b37('0xb'),'csc','infobip',_0x4b37('0xc'))},'accountSid':{'type':Sequelize[_0x4b37('0x2')]},'authId':{'type':Sequelize[_0x4b37('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x4b37('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4b37('0x2')]},'password':{'type':Sequelize[_0x4b37('0x2')]},'apiKey':{'type':Sequelize[_0x4b37('0x2')]},'applicationId':{'type':Sequelize[_0x4b37('0x2')]},'accountId':{'type':Sequelize[_0x4b37('0x2')]},'senderString':{'type':Sequelize[_0x4b37('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x4b37('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4b37('0xd')],'defaultValue':function(){return _0x4b37('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4b37('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4b37('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4b37('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4b37('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4b37('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4b37('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4b37('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4b37('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x4b37('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x12df5a){if(!_0x12df5a)this[_0x4b37('0x12')](_0x4b37('0x13'),null);this[_0x4b37('0x12')](_0x4b37('0x14'),_0x12df5a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 5fa32cd..eba71b2 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 _0x1729=['unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','Owner','fullname','internal','Tags','tag','to\x20is\x20mandatory','List','user','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SmsAccount','include','findAll','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','filter','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','rows','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','CmContact','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId'];(function(_0x3cfd5d,_0x5a35d3){var _0x1ffc55=function(_0x56ebdf){while(--_0x56ebdf){_0x3cfd5d['push'](_0x3cfd5d['shift']());}};_0x1ffc55(++_0x5a35d3);}(_0x1729,0x11f));var _0x9172=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x1729[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0x9172('0x0'));var rimraf=require(_0x9172('0x1'));var zipdir=require(_0x9172('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9172('0x3'));var moment=require(_0x9172('0x4'));var BPromise=require(_0x9172('0x5'));var Mustache=require(_0x9172('0x6'));var util=require(_0x9172('0x7'));var path=require(_0x9172('0x8'));var sox=require(_0x9172('0x9'));var csv=require(_0x9172('0xa'));var ejs=require(_0x9172('0xb'));var fs=require('fs');var fs_extra=require(_0x9172('0xc'));var _=require(_0x9172('0xd'));var squel=require(_0x9172('0xe'));var crypto=require(_0x9172('0xf'));var jsforce=require(_0x9172('0x10'));var deskjs=require(_0x9172('0x11'));var toCsv=require(_0x9172('0xa'));var querystring=require(_0x9172('0x12'));var Papa=require(_0x9172('0x13'));var Redis=require('ioredis');var authService=require(_0x9172('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9172('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9172('0x16'))(_0x9172('0x17'));var utils=require(_0x9172('0x18'));var config=require(_0x9172('0x19'));var licenseUtil=require(_0x9172('0x1a'));var db=require(_0x9172('0x1b'))['db'];config[_0x9172('0x1c')]=_['defaults'](config[_0x9172('0x1c')],{'host':_0x9172('0x1d'),'port':0x18eb});var socket=require(_0x9172('0x1e'))(new Redis(config['redis']));require(_0x9172('0x1f'))[_0x9172('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9172('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1f79f9,_0x54d7d4,_0x385e79,_0x481846){return new BPromise(function(_0x4f7677,_0x5cd4fd){var _0x1e6dcb=_0x481846||client;return _0x1e6dcb[_0x9172('0x22')](_0x1f79f9,_0x385e79)[_0x9172('0x23')](function(_0x4ca73d){logger['info'](_0x9172('0x24'),_0x54d7d4,_0x9172('0x25'));logger[_0x9172('0x26')](_0x9172('0x27'),_0x54d7d4,_0x9172('0x25'),JSON['stringify'](_0x4ca73d));if(_0x4ca73d[_0x9172('0x28')]){if(_0x4ca73d[_0x9172('0x28')][_0x9172('0x29')]===0x1f4){logger[_0x9172('0x28')]('SmsAccount,\x20%s,\x20%s',_0x54d7d4,_0x4ca73d[_0x9172('0x28')][_0x9172('0x2a')]);return _0x5cd4fd(_0x4ca73d[_0x9172('0x28')]['message']);}logger[_0x9172('0x28')](_0x9172('0x24'),_0x54d7d4,_0x4ca73d['error'][_0x9172('0x2a')]);return _0x4f7677(_0x4ca73d[_0x9172('0x28')][_0x9172('0x2a')]);}else{logger[_0x9172('0x2b')](_0x9172('0x24'),_0x54d7d4,_0x9172('0x25'));_0x4f7677(_0x4ca73d[_0x9172('0x2c')][_0x9172('0x2a')]);}})[_0x9172('0x2d')](function(_0x5d9512){logger[_0x9172('0x28')](_0x9172('0x24'),_0x54d7d4,_0x5d9512);_0x5cd4fd(_0x5d9512);});});}function respondWithStatusCode(_0x1a1781,_0x40ccb7){_0x40ccb7=_0x40ccb7||0xcc;return function(_0x47fa42){if(_0x47fa42){return _0x1a1781[_0x9172('0x2e')](_0x40ccb7);}return _0x1a1781[_0x9172('0x2f')](_0x40ccb7)[_0x9172('0x30')]();};}function respondWithResult(_0xc2eb19,_0x56cfb6){_0x56cfb6=_0x56cfb6||0xc8;return function(_0x205726){if(_0x205726){return _0xc2eb19['status'](_0x56cfb6)[_0x9172('0x31')](_0x205726);}};}function respondWithFilteredResult(_0x100144,_0x362218){return function(_0x4e591f){if(_0x4e591f){var _0x18adff=typeof _0x362218[_0x9172('0x32')]==='undefined'&&typeof _0x362218[_0x9172('0x33')]==='undefined';var _0x3e6c0e=_0x4e591f[_0x9172('0x34')];var _0x213040=_0x18adff?0x0:_0x362218['offset'];var _0x3c2c18=_0x18adff?_0x4e591f[_0x9172('0x34')]:_0x362218['offset']+_0x362218['limit'];var _0x2fc81b;if(_0x3c2c18>=_0x3e6c0e){_0x3c2c18=_0x3e6c0e;_0x2fc81b=0xc8;}else{_0x2fc81b=0xce;}_0x100144[_0x9172('0x2f')](_0x2fc81b);return _0x100144[_0x9172('0x35')](_0x9172('0x36'),_0x213040+'-'+_0x3c2c18+'/'+_0x3e6c0e)[_0x9172('0x31')](_0x4e591f);}return null;};}function patchUpdates(_0x19dd86){return function(_0x5528a8){try{jsonpatch[_0x9172('0x37')](_0x5528a8,_0x19dd86,!![]);}catch(_0xf0fdb2){return BPromise[_0x9172('0x38')](_0xf0fdb2);}return _0x5528a8[_0x9172('0x39')]();};}function saveUpdates(_0x2fb911,_0x42524d){return function(_0x4b2962){if(_0x4b2962){return _0x4b2962[_0x9172('0x3a')](_0x2fb911)[_0x9172('0x23')](function(_0x381de4){return _0x381de4;});}return null;};}function removeEntity(_0x577f90,_0x1bb68a){return function(_0x155cc9){if(_0x155cc9){return _0x155cc9[_0x9172('0x3b')]()[_0x9172('0x23')](function(){var _0x4c75f6=_0x155cc9[_0x9172('0x3c')]({'plain':!![]});var _0x24df16=_0x9172('0x3d');return db['UserProfileResource']['destroy']({'where':{'type':_0x24df16,'resourceId':_0x4c75f6['id']}})[_0x9172('0x23')](function(){return _0x155cc9;});})['then'](function(){_0x577f90['status'](0xcc)[_0x9172('0x30')]();});}};}function handleEntityNotFound(_0x5d17d4,_0x568a9d){return function(_0x5537aa){if(!_0x5537aa){_0x5d17d4['sendStatus'](0x194);}return _0x5537aa;};}function handleError(_0x56e019,_0x1dd909){_0x1dd909=_0x1dd909||0x1f4;return function(_0xd70a5c){logger[_0x9172('0x28')](_0xd70a5c[_0x9172('0x3e')]);if(_0xd70a5c[_0x9172('0x3f')]){delete _0xd70a5c['name'];}_0x56e019[_0x9172('0x2f')](_0x1dd909)[_0x9172('0x40')](_0xd70a5c);};}exports[_0x9172('0x41')]=function(_0x3928c1,_0x332db4){var _0x104c0c={'include':[{'model':db[_0x9172('0x42')],'as':_0x9172('0x43')}]},_0x2d926c={},_0x13caf8={'count':0x0,'rows':[]};var _0x110fec=_[_0x9172('0x44')](db['SmsAccount'][_0x9172('0x45')],function(_0x1ed223){return{'name':_0x1ed223['fieldName'],'type':_0x1ed223[_0x9172('0x46')][_0x9172('0x47')]};});_0x2d926c[_0x9172('0x48')]=_['map'](_0x110fec,_0x9172('0x3f'));_0x2d926c[_0x9172('0x49')]=_['keys'](_0x3928c1[_0x9172('0x49')]);_0x2d926c[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0x2d926c[_0x9172('0x48')],_0x2d926c[_0x9172('0x49')]);_0x104c0c[_0x9172('0x4c')]=_[_0x9172('0x4b')](_0x2d926c[_0x9172('0x48')],qs[_0x9172('0x4d')](_0x3928c1[_0x9172('0x49')][_0x9172('0x4d')]));_0x104c0c[_0x9172('0x4c')]=_0x104c0c[_0x9172('0x4c')][_0x9172('0x4e')]?_0x104c0c[_0x9172('0x4c')]:_0x2d926c['model'];if(!_0x3928c1[_0x9172('0x49')][_0x9172('0x4f')](_0x9172('0x50'))){_0x104c0c['limit']=qs[_0x9172('0x33')](_0x3928c1[_0x9172('0x49')][_0x9172('0x33')]);_0x104c0c[_0x9172('0x32')]=qs[_0x9172('0x32')](_0x3928c1[_0x9172('0x49')]['offset']);}_0x104c0c[_0x9172('0x51')]=qs[_0x9172('0x52')](_0x3928c1[_0x9172('0x49')][_0x9172('0x52')]);_0x104c0c[_0x9172('0x53')]=qs[_0x9172('0x4a')](_[_0x9172('0x54')](_0x3928c1[_0x9172('0x49')],_0x2d926c[_0x9172('0x4a')]),_0x110fec);if(_0x3928c1[_0x9172('0x49')]['filter']){_0x104c0c[_0x9172('0x53')]=_[_0x9172('0x55')](_0x104c0c['where'],{'$or':_[_0x9172('0x44')](_0x110fec,function(_0x4ffa7b){if(_0x4ffa7b[_0x9172('0x46')]!==_0x9172('0x56')){var _0x5f60e4={};_0x5f60e4[_0x4ffa7b['name']]={'$like':'%'+_0x3928c1[_0x9172('0x49')]['filter']+'%'};return _0x5f60e4;}})});}_0x104c0c=_[_0x9172('0x55')]({},_0x104c0c,_0x3928c1[_0x9172('0x57')]);var _0x16e291={'where':_0x104c0c[_0x9172('0x53')]};return db[_0x9172('0x58')][_0x9172('0x34')](_0x16e291)['then'](function(_0x435ce6){_0x13caf8[_0x9172('0x34')]=_0x435ce6;if(_0x3928c1[_0x9172('0x49')]['includeAll']){_0x104c0c[_0x9172('0x59')]=[{'all':!![]}];}return db['SmsAccount'][_0x9172('0x5a')](_0x104c0c);})[_0x9172('0x23')](function(_0x77abe3){_0x13caf8['rows']=_0x77abe3;return _0x13caf8;})[_0x9172('0x23')](respondWithFilteredResult(_0x332db4,_0x104c0c))[_0x9172('0x2d')](handleError(_0x332db4,null));};exports[_0x9172('0x5b')]=function(_0x18eb6f,_0x16ed0e){var _0x22f817={'raw':![],'where':{'id':_0x18eb6f[_0x9172('0x5c')]['id']},'include':[{'model':db[_0x9172('0x42')],'as':_0x9172('0x43')}]},_0x27a79a={};_0x27a79a[_0x9172('0x48')]=_['keys'](db[_0x9172('0x58')][_0x9172('0x45')]);_0x27a79a['query']=_[_0x9172('0x5d')](_0x18eb6f['query']);_0x27a79a['filters']=_['intersection'](_0x27a79a[_0x9172('0x48')],_0x27a79a[_0x9172('0x49')]);_0x22f817['attributes']=_[_0x9172('0x4b')](_0x27a79a[_0x9172('0x48')],qs[_0x9172('0x4d')](_0x18eb6f[_0x9172('0x49')][_0x9172('0x4d')]));_0x22f817[_0x9172('0x4c')]=_0x22f817[_0x9172('0x4c')][_0x9172('0x4e')]?_0x22f817[_0x9172('0x4c')]:_0x27a79a[_0x9172('0x48')];if(_0x18eb6f[_0x9172('0x49')]['includeAll']){_0x22f817[_0x9172('0x59')]=[{'all':!![]}];}_0x22f817=_[_0x9172('0x55')]({},_0x22f817,_0x18eb6f['options']);return db['SmsAccount'][_0x9172('0x5e')](_0x22f817)[_0x9172('0x23')](handleEntityNotFound(_0x16ed0e,null))['then'](respondWithResult(_0x16ed0e,null))[_0x9172('0x2d')](handleError(_0x16ed0e,null));};exports[_0x9172('0x5f')]=function(_0x183c6d,_0x5ad2b4){return db['SmsAccount']['create'](_0x183c6d[_0x9172('0x60')],{})[_0x9172('0x23')](function(_0x5d4e55){var _0x3115ac=_0x183c6d['user'][_0x9172('0x3c')]({'plain':!![]});if(!_0x3115ac)throw new Error(_0x9172('0x61'));if(_0x3115ac['role']==='user'){var _0x21294e=_0x5d4e55[_0x9172('0x3c')]({'plain':!![]});var _0x25581f=_0x9172('0x3d');return db[_0x9172('0x62')][_0x9172('0x5e')]({'where':{'name':_0x25581f,'userProfileId':_0x3115ac[_0x9172('0x63')]},'raw':!![]})[_0x9172('0x23')](function(_0x37e563){if(_0x37e563&&_0x37e563['autoAssociation']===0x0){return db['UserProfileResource'][_0x9172('0x5f')]({'name':_0x21294e[_0x9172('0x3f')],'resourceId':_0x21294e['id'],'type':_0x37e563[_0x9172('0x3f')],'sectionId':_0x37e563['id']},{})[_0x9172('0x23')](function(){return _0x5d4e55;});}else{return _0x5d4e55;}})[_0x9172('0x2d')](function(_0x30089f){logger['error'](_0x9172('0x64'),_0x30089f);throw _0x30089f;});}return _0x5d4e55;})['then'](respondWithResult(_0x5ad2b4,0xc9))['catch'](handleError(_0x5ad2b4,null));};exports[_0x9172('0x3a')]=function(_0x4fb5ab,_0x91d5e9){if(_0x4fb5ab['body']['id']){delete _0x4fb5ab['body']['id'];}return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x4fb5ab[_0x9172('0x5c')]['id']},'include':[{'model':db[_0x9172('0x42')],'as':_0x9172('0x43')}]})[_0x9172('0x23')](handleEntityNotFound(_0x91d5e9,null))[_0x9172('0x23')](saveUpdates(_0x4fb5ab[_0x9172('0x60')],null))['then'](respondWithResult(_0x91d5e9,null))['catch'](handleError(_0x91d5e9,null));};exports[_0x9172('0x3b')]=function(_0x2e758d,_0x3cc548){return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x2e758d[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x3cc548,null))[_0x9172('0x23')](removeEntity(_0x3cc548,null))[_0x9172('0x2d')](handleError(_0x3cc548,null));};exports['describe']=function(_0x3c6aa5,_0x534213){return db[_0x9172('0x58')][_0x9172('0x65')]()[_0x9172('0x23')](respondWithResult(_0x534213,null))[_0x9172('0x2d')](handleError(_0x534213,null));};exports['addDisposition']=function(_0x54da66,_0x19abc6,_0xd6f234){if(_0x54da66[_0x9172('0x60')]['id']){delete _0x54da66[_0x9172('0x60')]['id'];}return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x54da66[_0x9172('0x5c')]['id']}})['then'](handleEntityNotFound(_0x19abc6,null))['then'](function(_0x3c0418){if(_0x3c0418){_0x54da66[_0x9172('0x60')][_0x9172('0x66')]=_0x3c0418['id'];return db[_0x9172('0x67')][_0x9172('0x5f')](_0x54da66[_0x9172('0x60')]);}})[_0x9172('0x23')](respondWithResult(_0x19abc6,null))[_0x9172('0x2d')](handleError(_0x19abc6,null));};exports[_0x9172('0x68')]=function(_0x5dd9c0,_0x506883,_0x166009){var _0x5b4e66={'raw':![],'where':{}};var _0x21d761={};var _0x30feb8={'count':0x0,'rows':[]};return db[_0x9172('0x58')][_0x9172('0x69')]({'where':{'id':_0x5dd9c0[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x506883,null))[_0x9172('0x23')](function(_0x559c38){if(_0x559c38){_0x21d761[_0x9172('0x48')]=_[_0x9172('0x5d')](db['Disposition']['rawAttributes']);_0x21d761[_0x9172('0x49')]=_[_0x9172('0x5d')](_0x5dd9c0[_0x9172('0x49')]);_0x21d761[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0x21d761[_0x9172('0x48')],_0x21d761[_0x9172('0x49')]);_0x5b4e66[_0x9172('0x4c')]=_[_0x9172('0x4b')](_0x21d761['model'],qs['fields'](_0x5dd9c0[_0x9172('0x49')][_0x9172('0x4d')]));_0x5b4e66[_0x9172('0x4c')]=_0x5b4e66[_0x9172('0x4c')][_0x9172('0x4e')]?_0x5b4e66[_0x9172('0x4c')]:_0x21d761[_0x9172('0x48')];if(!_0x5dd9c0[_0x9172('0x49')][_0x9172('0x4f')](_0x9172('0x50'))){_0x5b4e66[_0x9172('0x33')]=qs['limit'](_0x5dd9c0[_0x9172('0x49')]['limit']);_0x5b4e66[_0x9172('0x32')]=qs[_0x9172('0x32')](_0x5dd9c0['query'][_0x9172('0x32')]);}_0x5b4e66[_0x9172('0x51')]=qs[_0x9172('0x52')](_0x5dd9c0['query']['sort']);_0x5b4e66[_0x9172('0x53')]=qs['filters'](_['pick'](_0x5dd9c0[_0x9172('0x49')],_0x21d761[_0x9172('0x4a')]));_0x5b4e66['where'][_0x9172('0x66')]=_0x559c38['id'];if(_0x5dd9c0[_0x9172('0x49')][_0x9172('0x6a')]){_0x5b4e66[_0x9172('0x53')]=_[_0x9172('0x55')](_0x5b4e66[_0x9172('0x53')],{'$or':_[_0x9172('0x44')](_0x5b4e66[_0x9172('0x4c')],function(_0x41aa63){var _0x1967d2={};_0x1967d2[_0x41aa63]={'$like':'%'+_0x5dd9c0[_0x9172('0x49')][_0x9172('0x6a')]+'%'};return _0x1967d2;})});}_0x5b4e66=_[_0x9172('0x55')]({},_0x5b4e66,_0x5dd9c0[_0x9172('0x57')]);return db[_0x9172('0x67')]['count']({'where':_0x5b4e66['where']})[_0x9172('0x23')](function(_0x1f5958){_0x30feb8[_0x9172('0x34')]=_0x1f5958;if(_0x5dd9c0['query'][_0x9172('0x6b')]){_0x5b4e66[_0x9172('0x59')]=[{'all':!![]}];}return db[_0x9172('0x67')][_0x9172('0x5a')](_0x5b4e66);})[_0x9172('0x23')](function(_0x4794d9){_0x30feb8['rows']=_0x4794d9;return _0x30feb8;});}})[_0x9172('0x23')](respondWithFilteredResult(_0x506883,_0x5b4e66))['catch'](handleError(_0x506883,null));};exports[_0x9172('0x6c')]=function(_0x55fb7b,_0xf04747,_0x35a3c9){return db['SmsAccount'][_0x9172('0x5e')]({'where':{'id':_0x55fb7b[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0xf04747,null))[_0x9172('0x23')](function(_0x58b521){if(_0x58b521){return _0x58b521[_0x9172('0x6c')](_0x55fb7b['query'][_0x9172('0x6d')]);}})[_0x9172('0x23')](respondWithStatusCode(_0xf04747,null))[_0x9172('0x2d')](handleError(_0xf04747,null));};exports[_0x9172('0x6e')]=function(_0x5b9d4e,_0x3cc583,_0x3fbb1a){if(_0x5b9d4e[_0x9172('0x60')]['id']){delete _0x5b9d4e[_0x9172('0x60')]['id'];}return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x5b9d4e[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x3cc583,null))[_0x9172('0x23')](function(_0x4fa8e4){if(_0x4fa8e4){_0x5b9d4e[_0x9172('0x60')][_0x9172('0x66')]=_0x4fa8e4['id'];return db[_0x9172('0x6f')][_0x9172('0x5f')](_0x5b9d4e[_0x9172('0x60')]);}})[_0x9172('0x23')](respondWithResult(_0x3cc583,null))[_0x9172('0x2d')](handleError(_0x3cc583,null));};exports['getAnswers']=function(_0xd08928,_0x4198cf,_0x10da7a){var _0x28ea62={'raw':![],'where':{}};var _0x2d8a8a={};var _0x3ecaf9={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xd08928[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x4198cf,null))[_0x9172('0x23')](function(_0xb65b8d){if(_0xb65b8d){_0x2d8a8a[_0x9172('0x48')]=_['keys'](db[_0x9172('0x6f')][_0x9172('0x45')]);_0x2d8a8a[_0x9172('0x49')]=_[_0x9172('0x5d')](_0xd08928[_0x9172('0x49')]);_0x2d8a8a[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0x2d8a8a[_0x9172('0x48')],_0x2d8a8a[_0x9172('0x49')]);_0x28ea62['attributes']=_['intersection'](_0x2d8a8a['model'],qs[_0x9172('0x4d')](_0xd08928[_0x9172('0x49')][_0x9172('0x4d')]));_0x28ea62['attributes']=_0x28ea62[_0x9172('0x4c')][_0x9172('0x4e')]?_0x28ea62[_0x9172('0x4c')]:_0x2d8a8a[_0x9172('0x48')];if(!_0xd08928['query']['hasOwnProperty'](_0x9172('0x50'))){_0x28ea62[_0x9172('0x33')]=qs['limit'](_0xd08928[_0x9172('0x49')][_0x9172('0x33')]);_0x28ea62[_0x9172('0x32')]=qs['offset'](_0xd08928[_0x9172('0x49')][_0x9172('0x32')]);}_0x28ea62[_0x9172('0x51')]=qs['sort'](_0xd08928[_0x9172('0x49')][_0x9172('0x52')]);_0x28ea62['where']=qs[_0x9172('0x4a')](_['pick'](_0xd08928[_0x9172('0x49')],_0x2d8a8a[_0x9172('0x4a')]));_0x28ea62[_0x9172('0x53')][_0x9172('0x66')]=_0xb65b8d['id'];if(_0xd08928[_0x9172('0x49')]['filter']){_0x28ea62[_0x9172('0x53')]=_[_0x9172('0x55')](_0x28ea62[_0x9172('0x53')],{'$or':_[_0x9172('0x44')](_0x28ea62[_0x9172('0x4c')],function(_0x3fc5b1){var _0x528e28={};_0x528e28[_0x3fc5b1]={'$like':'%'+_0xd08928[_0x9172('0x49')]['filter']+'%'};return _0x528e28;})});}_0x28ea62=_['merge']({},_0x28ea62,_0xd08928[_0x9172('0x57')]);return db[_0x9172('0x6f')][_0x9172('0x34')]({'where':_0x28ea62[_0x9172('0x53')]})[_0x9172('0x23')](function(_0x68c0a){_0x3ecaf9['count']=_0x68c0a;if(_0xd08928[_0x9172('0x49')]['includeAll']){_0x28ea62[_0x9172('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9172('0x5a')](_0x28ea62);})['then'](function(_0x547531){_0x3ecaf9[_0x9172('0x70')]=_0x547531;return _0x3ecaf9;});}})['then'](respondWithFilteredResult(_0x4198cf,_0x28ea62))[_0x9172('0x2d')](handleError(_0x4198cf,null));};exports[_0x9172('0x71')]=function(_0x263fc5,_0x454a27,_0x1679cb){return db[_0x9172('0x58')]['find']({'where':{'id':_0x263fc5[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x454a27,null))[_0x9172('0x23')](function(_0x4eafb7){if(_0x4eafb7){return _0x4eafb7['removeAnswers'](_0x263fc5['query'][_0x9172('0x6d')]);}})[_0x9172('0x23')](respondWithStatusCode(_0x454a27,null))[_0x9172('0x2d')](handleError(_0x454a27,null));};exports[_0x9172('0x72')]=function(_0x1cb729,_0x2c8ccf,_0x23f9bb){var _0x1784ba={'channel':_0x9172('0x73')};var _0x353026=[];var _0x3a4e77=[];var _0x48d1ad={};return db['SmsAccount']['find']({'where':{'id':_0x1cb729[_0x9172('0x5c')]['id']},'include':[{'model':db[_0x9172('0x74')],'as':_0x9172('0x75')}]})['then'](handleEntityNotFound(_0x2c8ccf,null))[_0x9172('0x23')](function(_0x24d1af){_0x1784ba[_0x9172('0x76')]=_0x24d1af;_0x1784ba[_0x9172('0x77')]=_['orderBy'](_0x24d1af['Applications'],[_0x9172('0x78')],[_0x9172('0x79')]);if(_0x1784ba[_0x9172('0x76')][_0x9172('0x75')]){delete _0x1784ba[_0x9172('0x76')]['Applications'];}return db[_0x9172('0x7a')][_0x9172('0x65')]();})[_0x9172('0x23')](function(_0x4a6bd7){if(!_0x4a6bd7){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x353026=_['difference'](_['keys'](_0x4a6bd7),['createdAt',_0x9172('0x7b')]);_0x3a4e77=_[_0x9172('0x7c')](_[_0x9172('0x5d')](_0x4a6bd7),[_0x9172('0x7d'),_0x9172('0x7b'),_0x9172('0x7e'),_0x9172('0x7f')]);_0x1784ba[_0x9172('0x60')]={'mapKey':_0x9172('0x80')};if(_0x1784ba[_0x9172('0x76')][_0x9172('0x46')]){switch(_0x1784ba[_0x9172('0x76')]['type']){case _0x9172('0x81'):_0x1784ba[_0x9172('0x60')][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')]['From'];_0x1784ba[_0x9172('0x60')][_0x9172('0x60')]=_0x1cb729['body'][_0x9172('0x83')];_0x1784ba['body']['messageId']=_0x1cb729[_0x9172('0x60')][_0x9172('0x84')];break;case _0x9172('0x85'):_0x1784ba['body'][_0x9172('0x82')]='+'+_0x1cb729[_0x9172('0x60')][_0x9172('0x86')];_0x1784ba['body'][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x87')];break;case _0x9172('0x88'):_0x1784ba['body'][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')]['from'];_0x1784ba[_0x9172('0x60')][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x2a')];break;case _0x9172('0x89'):_0x1784ba[_0x9172('0x60')][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')]['from'];_0x1784ba[_0x9172('0x60')][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x60')];_0x1784ba[_0x9172('0x60')][_0x9172('0x8a')]=_0x1cb729['body'][_0x9172('0x8b')];break;case _0x9172('0x8c'):_0x1784ba[_0x9172('0x60')]['from']=_0x1cb729['body'][_0x9172('0x8d')];_0x1784ba[_0x9172('0x60')]['body']=_0x1cb729[_0x9172('0x60')][_0x9172('0x8e')];_0x1784ba[_0x9172('0x60')]['messageId']=_0x1cb729['body'][_0x9172('0x8f')];break;case _0x9172('0x90'):_0x1784ba[_0x9172('0x60')][_0x9172('0x82')]='+'+_0x1cb729[_0x9172('0x60')][_0x9172('0x91')][0x0]['from'];_0x1784ba[_0x9172('0x60')]['body']=_0x1cb729[_0x9172('0x60')]['results'][0x0][_0x9172('0x87')];_0x1784ba['body']['messageId']=_0x1cb729[_0x9172('0x60')][_0x9172('0x91')][0x0][_0x9172('0x8a')];break;case'csc':_0x1784ba[_0x9172('0x60')][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x92')];_0x1784ba[_0x9172('0x60')]['body']=_0x1cb729[_0x9172('0x60')]['segmentedMessage']['message'];break;case _0x9172('0x93'):_0x1784ba['body'][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x94')];_0x1784ba[_0x9172('0x60')][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x87')];_0x1784ba[_0x9172('0x60')][_0x9172('0x8a')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x95')];break;case _0x9172('0x96'):_0x1784ba[_0x9172('0x60')]['messageId']=_0x1cb729[_0x9172('0x60')][0x0][_0x9172('0x2a')]['id'];_0x1784ba[_0x9172('0x60')][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')][0x0][_0x9172('0x2a')][_0x9172('0x82')];_0x1784ba[_0x9172('0x60')][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][0x0]['message'][_0x9172('0x87')];break;case _0x9172('0x97'):_0x1784ba['body'][_0x9172('0x82')]=_0x1cb729[_0x9172('0x60')]['from'];_0x1784ba['body'][_0x9172('0x60')]=_0x1cb729[_0x9172('0x60')][_0x9172('0x2a')];_0x1784ba['body'][_0x9172('0x8a')]=_0x1cb729['body'][_0x9172('0x98')];break;}}if(_0x1784ba[_0x9172('0x60')]['id']){delete _0x1784ba['body']['id'];}if(_[_0x9172('0x99')](_0x1784ba[_0x9172('0x60')][_0x9172('0x82')])){throw new db['Sequelize'][(_0x9172('0x9a'))]('from\x20is\x20mandatory');}if(_[_0x9172('0x99')](_0x1784ba[_0x9172('0x60')][_0x9172('0x60')])||_0x1784ba['body'][_0x9172('0x60')]===''){throw new db[(_0x9172('0x9b'))][(_0x9172('0x9a'))](_0x9172('0x9c'));}if(_[_0x9172('0x99')](_0x1784ba[_0x9172('0x60')][_0x9172('0x9d')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a4e77);}if(!_[_0x9172('0x9e')](_0x3a4e77,_0x1784ba[_0x9172('0x60')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x9172('0x9f')+_0x3a4e77);}_0x48d1ad[_0x1784ba['body'][_0x9172('0x9d')]]=_0x1784ba['body']['from'];return db[_0x9172('0xa0')][_0x9172('0x5e')]({'where':{'id':_0x1784ba[_0x9172('0x76')][_0x9172('0x7f')]},'include':[{'model':db[_0x9172('0x7a')],'as':_0x9172('0xa1'),'where':_0x48d1ad,'limit':0x1,'order':[[_0x9172('0x7b'),_0x9172('0xa2')]]}]});})[_0x9172('0x23')](handleEntityNotFound(_0x2c8ccf,null))['then'](function(_0x5c371){if(_0x5c371){_0x1784ba[_0x9172('0xa3')]=_['omit'](_0x5c371,['Contacts']);if(_0x5c371[_0x9172('0xa1')][_0x9172('0x4e')]){return _0x5c371[_0x9172('0xa1')][0x0];}var _0x31c34e=_[_0x9172('0xa4')](_0x1784ba[_0x9172('0x60')],{'firstName':_0x1784ba[_0x9172('0x60')][_0x9172('0x82')],'ListId':_0x5c371['id']});_0x31c34e[_0x1784ba[_0x9172('0x60')][_0x9172('0x9d')]]=_0x1784ba[_0x9172('0x60')][_0x9172('0x82')];return db[_0x9172('0x7a')][_0x9172('0x5f')](_0x31c34e,{'fields':_0x353026,'raw':!![]});}})[_0x9172('0x23')](handleEntityNotFound(_0x2c8ccf,null))[_0x9172('0x23')](function(_0x10b13f){if(_0x10b13f){_0x1784ba[_0x9172('0xa5')]=_0x10b13f;var _0x241ace={'ContactId':_0x10b13f['id'],'phone':_0x1784ba[_0x9172('0x60')][_0x9172('0x82')],'SmsAccountId':_0x1cb729[_0x9172('0x5c')]['id']};var _0x2ad0e={'ContactId':_0x10b13f['id'],'SmsAccountId':_0x1cb729['params']['id'],'closed':![]};return db[_0x9172('0xa6')][_0x9172('0x5e')]({'where':_0x2ad0e})[_0x9172('0x23')](function(_0x11363c){if(_0x11363c){return[_0x11363c,![]];}return db[_0x9172('0xa6')]['create'](_0x241ace)['then'](function(_0x319f23){return[_0x319f23,!![]];});});}})[_0x9172('0xa7')](function(_0x39cac8,_0x4167b3){_0x1784ba[_0x9172('0xa8')]=_0x39cac8[_0x9172('0x3c')]({'plain':!![]});_0x1784ba[_0x9172('0xa8')][_0x9172('0xa9')]=![];if(_0x4167b3){if(_0x1784ba[_0x9172('0x76')]['autoclose']){_0x1784ba[_0x9172('0x77')][_0x9172('0xaa')]({'id':0x0,'priority':_0x1784ba[_0x9172('0x77')]['length']+0x1,'app':_0x9172('0xab'),'appdata':_0x9172('0xac'),'interval':_0x9172('0xad')});}_0x1784ba['interaction'][_0x9172('0xa9')]=!![];}return db[_0x9172('0xae')]['create']({'phone':_0x1784ba[_0x9172('0x60')][_0x9172('0x82')],'messageId':_0x1784ba[_0x9172('0x60')][_0x9172('0x8a')],'body':_0x1784ba[_0x9172('0x60')]['body'],'SmsAccountId':_0x1cb729[_0x9172('0x5c')]['id'],'SmsInteractionId':_0x39cac8['id'],'direction':'in','ContactId':_0x39cac8[_0x9172('0xaf')],'AttachmentId':_0x1784ba['body']['AttachmentId']});})['then'](function(_0x27f560){_0x1784ba[_0x9172('0x2a')]=_0x27f560;if(!_0x1784ba[_0x9172('0xa8')][_0x9172('0xb0')])return;return db['User'][_0x9172('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1784ba[_0x9172('0xa8')][_0x9172('0xb0')]}});})[_0x9172('0x23')](function(_0x320446){if(_0x320446){_0x1784ba[_0x9172('0x77')][_0x9172('0xb1')]({'id':0x0,'priority':0x0,'app':_0x9172('0xb2'),'appdata':_0x320446[_0x9172('0x3f')]+','+(_0x1784ba[_0x9172('0x76')][_0x9172('0xb3')]||0xa),'interval':_0x9172('0xad')});}if(!_0x1784ba[_0x9172('0xa8')][_0x9172('0xb4')])return;return db[_0x9172('0xb5')]['find']({'attributes':['id',_0x9172('0x3f')],'where':{'id':_0x1784ba[_0x9172('0xa8')][_0x9172('0xb4')]}});})[_0x9172('0x23')](function(_0x1ff527){if(_0x1ff527){_0x1784ba['applications'][_0x9172('0xb1')]({'id':0x0,'priority':0x1,'app':_0x9172('0xb6'),'appdata':_0x1ff527[_0x9172('0x3f')]+','+(_0x1784ba['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x9172('0xad')});}return respondWithRpcPromise('Start',_0x9172('0xb7'),_0x1784ba);})[_0x9172('0x23')](function(_0x1b177d){if(_0x1b177d){var _0x5217d6=0xc8;var _0x44187e='receiveMessage';logger[_0x9172('0x2b')](_0x9172('0x27'),_0x44187e,_0x5217d6,_0x9172('0xb8'));logger[_0x9172('0x26')](_0x9172('0xb9'),_0x44187e,_0x5217d6,_0x9172('0xb8'),JSON['stringify'](_0x1b177d));if(_0x1784ba[_0x9172('0x76')][_0x9172('0x46')]===_0x9172('0x81')){return _0x2c8ccf['status'](_0x5217d6)[_0x9172('0x35')]('Content-Type',_0x9172('0xba'))[_0x9172('0x40')]('\x0a');}else{return _0x2c8ccf[_0x9172('0x2f')](_0x5217d6)[_0x9172('0x31')](_0x1b177d);}}})['catch'](handleError(_0x2c8ccf,null));};exports[_0x9172('0xbb')]=function(_0x518c49,_0x4b010b){var _0x1d91be=_0x518c49[_0x9172('0x5c')]['id'];var _0x43bcc6=_0x518c49[_0x9172('0x60')];var _0x578547=0xc8;var _0x5e52b3=null;return db[_0x9172('0xbc')][_0x9172('0xbd')]({'isolationLevel':db[_0x9172('0xbc')][_0x9172('0xbe')]['ISOLATION_LEVELS'][_0x9172('0xbf')]},function(_0x19ba38){return db[_0x9172('0x58')]['findOne']({'where':{'id':_0x1d91be},'transaction':_0x19ba38})['then'](function(_0x4a0f7b){if(_0x4a0f7b){return db[_0x9172('0x74')][_0x9172('0x3b')]({'where':{'SmsAccountId':_0x1d91be},'transaction':_0x19ba38})[_0x9172('0x23')](function(){var _0xe4342f=_[_0x9172('0x44')](_0x43bcc6,function(_0x15a226){_0x15a226[_0x9172('0x66')]=_0x1d91be;return _0x15a226;});return db['SmsApplication'][_0x9172('0xc0')](_0xe4342f,{'transaction':_0x19ba38});});}else{_0x578547=0x194;_0x5e52b3=[];}});})[_0x9172('0x23')](function(){if(_0x578547!==0x194){return db[_0x9172('0x74')][_0x9172('0xc1')]({'where':{'SmsAccountId':_0x1d91be},'order':_0x9172('0x78')})[_0x9172('0x23')](function(_0x2d1b76){_0x5e52b3=_0x2d1b76;});}})['catch'](function(_0x4be026){_0x578547=0x1f4;logger[_0x9172('0x28')](_0x4be026['stack']);if(_0x4be026[_0x9172('0x3f')]){delete _0x4be026[_0x9172('0x3f')];}_0x5e52b3=_0x4be026;})[_0x9172('0xc2')](function(){if(_0x5e52b3===null){_0x4b010b[_0x9172('0x2e')](_0x578547);}else{if(_0x578547===0x1f4){_0x4b010b[_0x9172('0x2f')](_0x578547)[_0x9172('0x40')](_0x5e52b3);}else{_0x4b010b[_0x9172('0x2f')](_0x578547)['json'](_0x5e52b3);}}});};exports[_0x9172('0xc3')]=function(_0x21b878,_0x4f05b4,_0x43536d){var _0xc237fa={};var _0x736652={};var _0x3435a5;var _0x217344;return db[_0x9172('0x58')]['findOne']({'where':{'id':_0x21b878['params']['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x4f05b4,null))[_0x9172('0x23')](function(_0x9bf1c8){if(_0x9bf1c8){_0x3435a5=_0x9bf1c8;_0x736652[_0x9172('0x48')]=_[_0x9172('0x5d')](db[_0x9172('0x74')][_0x9172('0x45')]);_0x736652[_0x9172('0x49')]=_[_0x9172('0x5d')](_0x21b878[_0x9172('0x49')]);_0x736652[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0x736652[_0x9172('0x48')],_0x736652[_0x9172('0x49')]);_0xc237fa[_0x9172('0x4c')]=_['intersection'](_0x736652[_0x9172('0x48')],qs[_0x9172('0x4d')](_0x21b878['query'][_0x9172('0x4d')]));_0xc237fa[_0x9172('0x4c')]=_0xc237fa['attributes'][_0x9172('0x4e')]?_0xc237fa[_0x9172('0x4c')]:_0x736652[_0x9172('0x48')];_0xc237fa[_0x9172('0x51')]=qs[_0x9172('0x52')](_0x21b878['query'][_0x9172('0x52')]);_0xc237fa[_0x9172('0x53')]=qs['filters'](_['pick'](_0x21b878['query'],_0x736652[_0x9172('0x4a')]));if(_0x21b878[_0x9172('0x49')]['filter']){_0xc237fa[_0x9172('0x53')]=_[_0x9172('0x55')](_0xc237fa[_0x9172('0x53')],{'$or':_[_0x9172('0x44')](_0xc237fa[_0x9172('0x4c')],function(_0x4dd7e4){var _0x432a73={};_0x432a73[_0x4dd7e4]={'$like':'%'+_0x21b878['query'][_0x9172('0x6a')]+'%'};return _0x432a73;})});}_0xc237fa=_[_0x9172('0x55')]({},_0xc237fa,_0x21b878['options']);return _0x3435a5[_0x9172('0xc3')](_0xc237fa);}})[_0x9172('0x23')](function(_0x51c4b7){if(_0x51c4b7){_0x217344=_0x51c4b7['length'];if(!_0x21b878[_0x9172('0x49')]['hasOwnProperty']('nolimit')){_0xc237fa[_0x9172('0x33')]=qs['limit'](_0x21b878[_0x9172('0x49')][_0x9172('0x33')]);_0xc237fa['offset']=qs[_0x9172('0x32')](_0x21b878[_0x9172('0x49')][_0x9172('0x32')]);}return _0x3435a5[_0x9172('0xc3')](_0xc237fa);}})[_0x9172('0x23')](function(_0x16a780){if(_0x16a780){return _0x16a780?{'count':_0x217344,'rows':_0x16a780}:null;}})[_0x9172('0x23')](respondWithResult(_0x4f05b4,null))[_0x9172('0x2d')](handleError(_0x4f05b4,null));};exports['getInteractions']=function(_0xcd35e2,_0x5eafca,_0x53d1b5){var _0x421500={'raw':![],'where':{}};var _0x2101dc={};var _0x5f4977={'count':0x0,'rows':[]};return db[_0x9172('0x58')][_0x9172('0x69')]({'where':{'id':_0xcd35e2[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x5eafca,null))[_0x9172('0x23')](function(_0x39714b){if(_0x39714b){_0x2101dc[_0x9172('0x48')]=_[_0x9172('0x5d')](db[_0x9172('0xa6')]['rawAttributes']);_0x2101dc[_0x9172('0x49')]=_['keys'](_0xcd35e2[_0x9172('0x49')]);_0x2101dc[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0x2101dc[_0x9172('0x48')],_0x2101dc['query']);_0x421500[_0x9172('0x4c')]=_[_0x9172('0x4b')](_0x2101dc['model'],qs[_0x9172('0x4d')](_0xcd35e2[_0x9172('0x49')]['fields']));_0x421500[_0x9172('0x4c')]=_0x421500[_0x9172('0x4c')][_0x9172('0x4e')]?_0x421500[_0x9172('0x4c')]:_0x2101dc[_0x9172('0x48')];if(!_0xcd35e2['query']['hasOwnProperty'](_0x9172('0x50'))){_0x421500[_0x9172('0x33')]=qs[_0x9172('0x33')](_0xcd35e2['query']['limit']);_0x421500[_0x9172('0x32')]=qs[_0x9172('0x32')](_0xcd35e2[_0x9172('0x49')][_0x9172('0x32')]);}_0x421500[_0x9172('0x51')]=qs[_0x9172('0x52')](_0xcd35e2[_0x9172('0x49')][_0x9172('0x52')]);_0x421500['where']=qs['filters'](_[_0x9172('0x54')](_0xcd35e2[_0x9172('0x49')],_0x2101dc[_0x9172('0x4a')]));_0x421500[_0x9172('0x53')]['SmsAccountId']=_0x39714b['id'];if(_0xcd35e2[_0x9172('0x49')][_0x9172('0x6a')]){_0x421500[_0x9172('0x53')]=_[_0x9172('0x55')](_0x421500[_0x9172('0x53')],{'$or':_['map'](_0x421500['attributes'],function(_0x1cd672){var _0xbe69d6={};_0xbe69d6[_0x1cd672]={'$like':'%'+_0xcd35e2[_0x9172('0x49')][_0x9172('0x6a')]+'%'};return _0xbe69d6;})});}_0x421500=_['merge']({},_0x421500,_0xcd35e2[_0x9172('0x57')]);return db[_0x9172('0xa6')][_0x9172('0x34')]({'where':_0x421500[_0x9172('0x53')]})[_0x9172('0x23')](function(_0x2e560e){_0x5f4977[_0x9172('0x34')]=_0x2e560e;if(_0xcd35e2[_0x9172('0x49')][_0x9172('0x6b')]){_0x421500[_0x9172('0x59')]=[{'model':db[_0x9172('0x7a')],'as':_0x9172('0xc4'),'required':![]},{'model':db[_0x9172('0xc5')],'as':_0x9172('0xc6'),'attributes':[_0x9172('0x3f'),_0x9172('0xc7'),_0x9172('0xc8')],'required':![]},{'model':db['Tag'],'as':_0x9172('0xc9'),'attributes':['id',_0x9172('0x3f'),'color'],'where':_0xcd35e2[_0x9172('0x49')][_0x9172('0xca')]?{'id':_0xcd35e2[_0x9172('0x49')][_0x9172('0xca')]}:undefined,'required':_0xcd35e2[_0x9172('0x49')][_0x9172('0xca')]?!![]:![]}];}return db[_0x9172('0xa6')][_0x9172('0x5a')](_0x421500);})[_0x9172('0x23')](function(_0x3161e1){_0x5f4977[_0x9172('0x70')]=_0x3161e1;return _0x5f4977;});}})[_0x9172('0x23')](respondWithFilteredResult(_0x5eafca,_0x421500))[_0x9172('0x2d')](handleError(_0x5eafca,null));};exports[_0x9172('0x40')]=function(_0x263470,_0x25c77c,_0x2344fb){var _0x901fa9,_0x47a99e,_0x50fe6f;if(_['isNil'](_0x263470[_0x9172('0x60')][_0x9172('0x60')])||_0x263470[_0x9172('0x60')][_0x9172('0x60')]===''){throw new db[(_0x9172('0x9b'))][(_0x9172('0x9a'))](_0x9172('0x9c'));}if(_[_0x9172('0x99')](_0x263470[_0x9172('0x60')]['to'])){throw new db['Sequelize'][(_0x9172('0x9a'))](_0x9172('0xcb'));}_0x901fa9=_0x263470['body']['to'];return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x263470[_0x9172('0x5c')]['id']},'include':[{'model':db[_0x9172('0xa0')],'as':_0x9172('0xcc'),'include':[{'model':db[_0x9172('0x7a')],'as':_0x9172('0xa1'),'where':{'mobile':_0x901fa9},'limit':0x1,'order':[['updatedAt',_0x9172('0xa2')]]}]}]})[_0x9172('0x23')](handleEntityNotFound(_0x25c77c,null))[_0x9172('0x23')](function(_0x4d255a){if(_0x4d255a&&_0x4d255a[_0x9172('0xcc')]){_0x47a99e=_0x4d255a[_0x9172('0x3c')]({'plain':!![]});if(_0x47a99e['List']&&_0x47a99e[_0x9172('0xcc')][_0x9172('0xa1')][_0x9172('0x4e')]){return _0x47a99e['List'][_0x9172('0xa1')][0x0];}return db['CmContact'][_0x9172('0x5f')](_['defaults'](_0x263470['body'],{'firstName':_0x901fa9,'mobile':_0x901fa9,'phone':_0x901fa9,'ListId':_0x47a99e['ListId']}));}})[_0x9172('0x23')](handleEntityNotFound(_0x25c77c,null))[_0x9172('0x23')](function(_0x5be2a1){if(_0x5be2a1){_0x50fe6f=_0x5be2a1;return db['SmsInteraction'][_0x9172('0x5e')]({'where':{'ContactId':_0x50fe6f['id'],'closed':![],'SmsAccountId':_0x47a99e['id']}})[_0x9172('0x23')](function(_0x44122d){if(_0x44122d){return[_0x44122d,![]];}return db[_0x9172('0xa6')][_0x9172('0x5f')]({'UserId':_0x263470[_0x9172('0xcd')]['id'],'ContactId':_0x50fe6f['id'],'SmsAccountId':_0x47a99e['id'],'phone':_0x901fa9,'firstMsgDirection':_0x9172('0xce'),'Messages':[_['merge'](_0x263470[_0x9172('0x60')],{'read':![],'body':_0x263470[_0x9172('0x60')][_0x9172('0x60')],'phone':_0x901fa9,'SmsAccountId':_0x47a99e['id'],'UserId':_0x263470[_0x9172('0xcd')]['id'],'ContactId':_0x50fe6f['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x9172('0xcf')}]})['then'](function(_0x416d0b){return[_0x416d0b,!![]];});});}})[_0x9172('0xa7')](function(_0x3cb745,_0x1dcd6f){if(_0x1dcd6f){return _0x3cb745;}return db[_0x9172('0xae')]['create'](_[_0x9172('0x55')](_0x263470[_0x9172('0x60')],{'read':![],'body':_0x263470['body'][_0x9172('0x60')],'phone':_0x901fa9,'SmsAccountId':_0x47a99e['id'],'SmsInteractionId':_0x3cb745['id'],'UserId':_0x263470[_0x9172('0xcd')]['id'],'ContactId':_0x50fe6f['id']}))[_0x9172('0x23')](function(_0x5117e9){_0x3cb745[_0x9172('0xd0')]['Messages']=[];_0x3cb745['dataValues'][_0x9172('0xcf')][_0x9172('0xaa')](_0x5117e9[_0x9172('0xd0')]);return _0x3cb745;});})[_0x9172('0x23')](respondWithResult(_0x25c77c,null))['catch'](handleError(_0x25c77c,null));};exports[_0x9172('0x2f')]=function(_0x10c6b9,_0x4a9d8c,_0x11d5b6){if(_0x10c6b9['body']['id']){delete _0x10c6b9[_0x9172('0x60')]['id'];}var _0x5c5a37,_0x4c8a54,_0x4b0462;return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x10c6b9['params']['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x4a9d8c,null))[_0x9172('0x23')](function(_0x4bf54c){if(_0x4bf54c){_0x4b0462=_0x4bf54c;logger['debug'](_0x9172('0x27'),'status',_0x9172('0xd1'),_0x4bf54c[_0x9172('0x46')],util['inspect'](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));switch(_0x4bf54c['type']){case'skebby':if(_0x10c6b9[_0x9172('0x60')]['skebby_dispatch_id']&&_0x10c6b9[_0x9172('0x60')][_0x9172('0x2f')]){_0x4c8a54=_0x10c6b9['body'][_0x9172('0x2f')];return db[_0x9172('0xae')][_0x9172('0x5e')]({'where':{'messageId':_0x10c6b9[_0x9172('0x60')][_0x9172('0xd2')]}});}break;case _0x9172('0x88'):if(_0x10c6b9[_0x9172('0x60')][_0x9172('0xd3')]&&_0x10c6b9[_0x9172('0x60')][_0x9172('0xd4')]){_0x4c8a54=_0x10c6b9['body'][_0x9172('0xd4')];return db['SmsMessage'][_0x9172('0x5e')]({'where':{'messageId':_0x10c6b9[_0x9172('0x60')]['requestid']}});}break;case _0x9172('0x89'):if(_0x10c6b9[_0x9172('0x60')]['message_id']&&_0x10c6b9[_0x9172('0x60')]['status_code']){_0x4c8a54=_0x10c6b9[_0x9172('0x60')][_0x9172('0xd5')];return db['SmsMessage'][_0x9172('0x5e')]({'where':{'messageId':_0x10c6b9['body'][_0x9172('0x8b')]}});}break;case _0x9172('0x90'):var _0x1bb57a=_0x10c6b9['body'][_0x9172('0x91')][0x0];if(_0x1bb57a[_0x9172('0x8a')]&&_0x1bb57a[_0x9172('0x2f')][_0x9172('0xd6')]===_0x9172('0xd7')){_0x4c8a54=_0x1bb57a[_0x9172('0x2f')][_0x9172('0xd6')];return db['SmsMessage']['find']({'where':{'messageId':_0x1bb57a['messageId']}});}break;case _0x9172('0x93'):if(_0x10c6b9[_0x9172('0x60')][_0x9172('0x8a')]&&_0x10c6b9[_0x9172('0x60')]['status']){_0x4c8a54=_0x10c6b9[_0x9172('0x60')][_0x9172('0x2f')];return db['SmsMessage']['find']({'where':{'messageId':_0x10c6b9[_0x9172('0x60')][_0x9172('0x8a')]}});}break;case _0x9172('0x96'):if(_0x10c6b9[_0x9172('0x60')][0x0][_0x9172('0x2a')]['id']){_0x4c8a54=_0x10c6b9[_0x9172('0x60')][0x0][_0x9172('0x46')];return db[_0x9172('0xae')][_0x9172('0x5e')]({'where':{'messageId':_0x10c6b9[_0x9172('0x60')][0x0][_0x9172('0x2a')]['id']}});}break;case _0x9172('0x97'):if(_0x10c6b9[_0x9172('0x60')][_0x9172('0xd8')]&&_0x10c6b9[_0x9172('0x60')][_0x9172('0x2f')]){_0x4c8a54=_0x10c6b9[_0x9172('0x60')][_0x9172('0x2f')];return db[_0x9172('0xae')][_0x9172('0x5e')]({'where':{'messageId':_0x10c6b9[_0x9172('0x60')][_0x9172('0xd8')]}});}break;}}})[_0x9172('0x23')](handleEntityNotFound(_0x4a9d8c,null))['then'](function(_0x1eee78){if(_0x1eee78){_0x5c5a37=_0x1eee78;switch(_0x4b0462[_0x9172('0x46')]){case _0x9172('0x85'):if(_0x4c8a54===_0x9172('0xd7')){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')](_0x9172('0x27'),'status','skebby',util['inspect'](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;case _0x9172('0x88'):if(_0x4c8a54==='1'){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9172('0x85'),util[_0x9172('0xd9')](_0x10c6b9['body'],{'showHidden':![],'depth':null}));}break;case _0x9172('0x89'):if(!_0x10c6b9['body'][_0x9172('0xda')]&&_0x4c8a54>=0xc8&&_0x4c8a54<=0xce){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')](_0x9172('0x27'),_0x9172('0x2f'),_0x9172('0x89'),util[_0x9172('0xd9')](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;case _0x9172('0x90'):var _0x41682a=_0x10c6b9[_0x9172('0x60')][_0x9172('0x91')][0x0];if(_0x41682a[_0x9172('0x2f')][_0x9172('0xd6')]===_0x9172('0xd7')){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')](_0x9172('0x27'),'status','infobip',util[_0x9172('0xd9')](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;case _0x9172('0x93'):if(_0x4c8a54==_0x9172('0xdb')||_0x4c8a54==_0x9172('0xdc')){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')](_0x9172('0x27'),_0x9172('0x2f'),_0x9172('0x93'),util['inspect'](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;case _0x9172('0x96'):if(_0x4c8a54=='message-delivered'){return _0x5c5a37['update']({'read':!![]});}else{logger[_0x9172('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','bandwidth',util[_0x9172('0xd9')](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;case _0x9172('0x97'):if(_0x4c8a54==='DELIVRD'||_0x4c8a54===_0x9172('0xdd')){return _0x5c5a37[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9172('0x2f'),_0x9172('0x97'),util[_0x9172('0xd9')](_0x10c6b9[_0x9172('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5c5a37;}})[_0x9172('0x23')](respondWithResult(_0x4a9d8c,null))['catch'](handleError(_0x4a9d8c,null));};exports[_0x9172('0xde')]=function(_0x2593bf,_0x558635,_0x223785){var _0x5cce7f,_0x5e1392,_0x1a72c4;return db['SmsAccount'][_0x9172('0x5e')]({'where':{'id':_0x2593bf[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x558635,null))[_0x9172('0x23')](function(_0x14d7b9){if(_0x14d7b9){_0x1a72c4=_0x14d7b9;logger[_0x9172('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9172('0xd1'),_0x14d7b9[_0x9172('0x46')],util[_0x9172('0xd9')](_0x2593bf[_0x9172('0x49')],{'showHidden':![],'depth':null}));switch(_0x14d7b9['type']){case _0x9172('0xdf'):if(_0x2593bf[_0x9172('0x49')][_0x9172('0xe0')]&&_0x2593bf[_0x9172('0x49')][_0x9172('0xe1')]){_0x5e1392=_0x2593bf[_0x9172('0x49')][_0x9172('0xe1')];return db['SmsMessage'][_0x9172('0x5e')]({'where':{'messageId':_0x2593bf[_0x9172('0x49')][_0x9172('0xe0')]}});}break;}}})['then'](handleEntityNotFound(_0x558635,null))['then'](function(_0x565b5a){if(_0x565b5a){_0x5cce7f=_0x565b5a;switch(_0x1a72c4[_0x9172('0x46')]){case _0x9172('0xdf'):if(_0x5e1392==='2'||_0x5e1392==='6'){return _0x5cce7f[_0x9172('0x3a')]({'read':!![]});}else{logger[_0x9172('0x28')](_0x9172('0x27'),_0x9172('0x2f'),_0x9172('0xdf'),util[_0x9172('0xd9')](_0x2593bf['query'],{'showHidden':![],'depth':null}));};break;}return _0x5cce7f;}})[_0x9172('0x23')](respondWithResult(_0x558635,null))['catch'](handleError(_0x558635,null));};exports[_0x9172('0xe2')]=function(_0x5e2681,_0x2e024f,_0x1d3fa9){return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x5e2681[_0x9172('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e024f,null))['then'](function(_0x4fb608){if(_0x4fb608){return _0x4fb608['addAgents'](_0x5e2681['body'][_0x9172('0x6d')],_['omit'](_0x5e2681[_0x9172('0x60')],[_0x9172('0x6d'),'id'])||{})[_0x9172('0xa7')](function(_0x161734){for(var _0x1ccc85=0x0;_0x1ccc85<_0x5e2681['body'][_0x9172('0x6d')][_0x9172('0x4e')];_0x1ccc85+=0x1){socket[_0x9172('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x5e2681[_0x9172('0x60')]['ids'][_0x1ccc85]),'SmsAccountId':Number(_0x5e2681[_0x9172('0x5c')]['id'])});}return _0x161734;});}})[_0x9172('0x23')](respondWithResult(_0x2e024f,null))[_0x9172('0x2d')](handleError(_0x2e024f,null));};exports[_0x9172('0xe4')]=function(_0x57892a,_0x19ec90,_0x4a8ce2){return db[_0x9172('0x58')][_0x9172('0x5e')]({'where':{'id':_0x57892a[_0x9172('0x5c')]['id']}})[_0x9172('0x23')](handleEntityNotFound(_0x19ec90,null))[_0x9172('0x23')](function(_0x1aef48){if(_0x1aef48){return _0x1aef48[_0x9172('0xe4')](_0x57892a[_0x9172('0x49')][_0x9172('0x6d')])[_0x9172('0x23')](function(){if(_[_0x9172('0xe5')](_0x57892a[_0x9172('0x49')][_0x9172('0x6d')])){for(var _0x53109c=0x0;_0x53109c<_0x57892a[_0x9172('0x49')][_0x9172('0x6d')]['length'];_0x53109c+=0x1){socket[_0x9172('0xe3')](_0x9172('0xe6'),{'UserId':Number(_0x57892a[_0x9172('0x49')][_0x9172('0x6d')][_0x53109c]),'SmsAccountId':Number(_0x57892a[_0x9172('0x5c')]['id'])});}}else{socket[_0x9172('0xe3')](_0x9172('0xe6'),{'UserId':Number(_0x57892a[_0x9172('0x49')]['ids']),'SmsAccountId':Number(_0x57892a[_0x9172('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x19ec90,null))[_0x9172('0x2d')](handleError(_0x19ec90,null));};exports[_0x9172('0xe7')]=function(_0x2a4737,_0x520dbb,_0x5ef0e1){var _0x156257={};var _0xce022d={};var _0x2b8765;var _0x1c1b4e;return db['SmsAccount'][_0x9172('0x69')]({'where':{'id':_0x2a4737[_0x9172('0x5c')]['id']}})['then'](handleEntityNotFound(_0x520dbb,null))[_0x9172('0x23')](function(_0x5bad62){if(_0x5bad62){_0x2b8765=_0x5bad62;_0xce022d[_0x9172('0x48')]=_[_0x9172('0x5d')](db[_0x9172('0xc5')][_0x9172('0x45')]);_0xce022d['query']=_[_0x9172('0x5d')](_0x2a4737[_0x9172('0x49')]);_0xce022d[_0x9172('0x4a')]=_[_0x9172('0x4b')](_0xce022d['model'],_0xce022d['query']);_0x156257[_0x9172('0x4c')]=_[_0x9172('0x4b')](_0xce022d[_0x9172('0x48')],qs[_0x9172('0x4d')](_0x2a4737[_0x9172('0x49')][_0x9172('0x4d')]));_0x156257[_0x9172('0x4c')]=_0x156257[_0x9172('0x4c')][_0x9172('0x4e')]?_0x156257[_0x9172('0x4c')]:_0xce022d[_0x9172('0x48')];_0x156257[_0x9172('0x51')]=qs[_0x9172('0x52')](_0x2a4737['query']['sort']);_0x156257[_0x9172('0x53')]=qs['filters'](_[_0x9172('0x54')](_0x2a4737[_0x9172('0x49')],_0xce022d[_0x9172('0x4a')]));if(_0x2a4737[_0x9172('0x49')]['filter']){_0x156257[_0x9172('0x53')]=_[_0x9172('0x55')](_0x156257[_0x9172('0x53')],{'$or':_['map'](_0x156257[_0x9172('0x4c')],function(_0x283c79){var _0x1ad3b0={};_0x1ad3b0[_0x283c79]={'$like':'%'+_0x2a4737[_0x9172('0x49')][_0x9172('0x6a')]+'%'};return _0x1ad3b0;})});}_0x156257=_['merge']({},_0x156257,_0x2a4737[_0x9172('0x57')]);return _0x2b8765[_0x9172('0xe7')](_0x156257);}})[_0x9172('0x23')](function(_0x3010a3){if(_0x3010a3){_0x1c1b4e=_0x3010a3[_0x9172('0x4e')];if(!_0x2a4737[_0x9172('0x49')][_0x9172('0x4f')](_0x9172('0x50'))){_0x156257['limit']=qs[_0x9172('0x33')](_0x2a4737['query'][_0x9172('0x33')]);_0x156257[_0x9172('0x32')]=qs[_0x9172('0x32')](_0x2a4737['query'][_0x9172('0x32')]);}return _0x2b8765[_0x9172('0xe7')](_0x156257);}})[_0x9172('0x23')](function(_0x1ec7ae){if(_0x1ec7ae){return _0x1ec7ae?{'count':_0x1c1b4e,'rows':_0x1ec7ae}:null;}})['then'](respondWithResult(_0x520dbb,null))['catch'](handleError(_0x520dbb,null));}; \ No newline at end of file +var _0xf064=['pick','VIRTUAL','filter','merge','options','include','findAll','params','Pause','includeAll','create','body','user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','find','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','Sequelize','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','created','autoclose','push','close','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','queue','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','json','getApplications','getInteractions','Contact','User','Owner','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','emit','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','apply','save','get','destroy','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x17d71e,_0x367d27){var _0x11fe08=function(_0x39c4ad){while(--_0x39c4ad){_0x17d71e['push'](_0x17d71e['shift']());}};_0x11fe08(++_0x367d27);}(_0xf064,0x181));var _0x4f06=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xf064[_0x555069];return _0x100af7;};'use strict';var emlformat=require(_0x4f06('0x0'));var rimraf=require(_0x4f06('0x1'));var zipdir=require(_0x4f06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f06('0x3'));var moment=require(_0x4f06('0x4'));var BPromise=require(_0x4f06('0x5'));var Mustache=require(_0x4f06('0x6'));var util=require('util');var path=require(_0x4f06('0x7'));var sox=require(_0x4f06('0x8'));var csv=require(_0x4f06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f06('0xa'));var squel=require(_0x4f06('0xb'));var crypto=require(_0x4f06('0xc'));var jsforce=require(_0x4f06('0xd'));var deskjs=require(_0x4f06('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f06('0xf'));var Papa=require(_0x4f06('0x10'));var Redis=require(_0x4f06('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f06('0x12'));var as=require(_0x4f06('0x13'));var hardwareService=require(_0x4f06('0x14'));var logger=require(_0x4f06('0x15'))('api');var utils=require(_0x4f06('0x16'));var config=require(_0x4f06('0x17'));var licenseUtil=require(_0x4f06('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4f06('0x19')](config[_0x4f06('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f06('0x1b'))(new Redis(config[_0x4f06('0x1a')]));require(_0x4f06('0x1c'))['register'](socket);var jayson=require(_0x4f06('0x1d'));var client=jayson[_0x4f06('0x1e')][_0x4f06('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1dd32f,_0x3dc1c9,_0xdab307,_0x328071){return new BPromise(function(_0x4b75fd,_0x35b2f1){var _0x4493af=_0x328071||client;return _0x4493af[_0x4f06('0x20')](_0x1dd32f,_0xdab307)[_0x4f06('0x21')](function(_0x56851f){logger[_0x4f06('0x22')]('SmsAccount,\x20%s,\x20%s',_0x3dc1c9,_0x4f06('0x23'));logger['debug'](_0x4f06('0x24'),_0x3dc1c9,_0x4f06('0x23'),JSON[_0x4f06('0x25')](_0x56851f));if(_0x56851f['error']){if(_0x56851f[_0x4f06('0x26')][_0x4f06('0x27')]===0x1f4){logger[_0x4f06('0x26')](_0x4f06('0x28'),_0x3dc1c9,_0x56851f[_0x4f06('0x26')][_0x4f06('0x29')]);return _0x35b2f1(_0x56851f[_0x4f06('0x26')][_0x4f06('0x29')]);}logger[_0x4f06('0x26')](_0x4f06('0x28'),_0x3dc1c9,_0x56851f[_0x4f06('0x26')][_0x4f06('0x29')]);return _0x4b75fd(_0x56851f['error'][_0x4f06('0x29')]);}else{logger[_0x4f06('0x22')](_0x4f06('0x28'),_0x3dc1c9,_0x4f06('0x23'));_0x4b75fd(_0x56851f[_0x4f06('0x2a')][_0x4f06('0x29')]);}})[_0x4f06('0x2b')](function(_0x537cfe){logger[_0x4f06('0x26')](_0x4f06('0x28'),_0x3dc1c9,_0x537cfe);_0x35b2f1(_0x537cfe);});});}function respondWithStatusCode(_0x2eb363,_0x80c2b3){_0x80c2b3=_0x80c2b3||0xcc;return function(_0x4127a){if(_0x4127a){return _0x2eb363[_0x4f06('0x2c')](_0x80c2b3);}return _0x2eb363[_0x4f06('0x2d')](_0x80c2b3)['end']();};}function respondWithResult(_0x359f2d,_0xa2fa69){_0xa2fa69=_0xa2fa69||0xc8;return function(_0x416516){if(_0x416516){return _0x359f2d[_0x4f06('0x2d')](_0xa2fa69)['json'](_0x416516);}};}function respondWithFilteredResult(_0x244273,_0x509df9){return function(_0x572c36){if(_0x572c36){var _0x415e85=typeof _0x509df9[_0x4f06('0x2e')]===_0x4f06('0x2f')&&typeof _0x509df9[_0x4f06('0x30')]===_0x4f06('0x2f');var _0x2a6cee=_0x572c36['count'];var _0x5caec2=_0x415e85?0x0:_0x509df9['offset'];var _0x245306=_0x415e85?_0x572c36[_0x4f06('0x31')]:_0x509df9[_0x4f06('0x2e')]+_0x509df9[_0x4f06('0x30')];var _0x327a69;if(_0x245306>=_0x2a6cee){_0x245306=_0x2a6cee;_0x327a69=0xc8;}else{_0x327a69=0xce;}_0x244273[_0x4f06('0x2d')](_0x327a69);return _0x244273[_0x4f06('0x32')]('Content-Range',_0x5caec2+'-'+_0x245306+'/'+_0x2a6cee)['json'](_0x572c36);}return null;};}function patchUpdates(_0x3812f8){return function(_0x2ca751){try{jsonpatch[_0x4f06('0x33')](_0x2ca751,_0x3812f8,!![]);}catch(_0x32788b){return BPromise['reject'](_0x32788b);}return _0x2ca751[_0x4f06('0x34')]();};}function saveUpdates(_0x52a98c,_0x241ef4){return function(_0x102a48){if(_0x102a48){return _0x102a48['update'](_0x52a98c)[_0x4f06('0x21')](function(_0x9bfb9b){return _0x9bfb9b;});}return null;};}function removeEntity(_0x411042,_0x2f1764){return function(_0x58c2b9){if(_0x58c2b9){return _0x58c2b9['destroy']()[_0x4f06('0x21')](function(){var _0x110ef6=_0x58c2b9[_0x4f06('0x35')]({'plain':!![]});var _0x1fff01='SmsAccounts';return db['UserProfileResource'][_0x4f06('0x36')]({'where':{'type':_0x1fff01,'resourceId':_0x110ef6['id']}})['then'](function(){return _0x58c2b9;});})[_0x4f06('0x21')](function(){_0x411042[_0x4f06('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ccdf7,_0x5e74c3){return function(_0x8fe7fc){if(!_0x8fe7fc){_0x5ccdf7['sendStatus'](0x194);}return _0x8fe7fc;};}function handleError(_0x22c1dc,_0x3bb34c){_0x3bb34c=_0x3bb34c||0x1f4;return function(_0x1b3cc2){logger['error'](_0x1b3cc2['stack']);if(_0x1b3cc2[_0x4f06('0x37')]){delete _0x1b3cc2[_0x4f06('0x37')];}_0x22c1dc[_0x4f06('0x2d')](_0x3bb34c)[_0x4f06('0x38')](_0x1b3cc2);};}exports[_0x4f06('0x39')]=function(_0x1039f1,_0x1a594e){var _0x2e48be={'include':[{'model':db['Pause'],'as':_0x4f06('0x3a')}]},_0x3f9443={},_0x2d7ac3={'count':0x0,'rows':[]};var _0x5c8129=_['map'](db[_0x4f06('0x3b')][_0x4f06('0x3c')],function(_0x23b868){return{'name':_0x23b868[_0x4f06('0x3d')],'type':_0x23b868[_0x4f06('0x3e')][_0x4f06('0x3f')]};});_0x3f9443[_0x4f06('0x40')]=_[_0x4f06('0x41')](_0x5c8129,_0x4f06('0x37'));_0x3f9443['query']=_[_0x4f06('0x42')](_0x1039f1['query']);_0x3f9443[_0x4f06('0x43')]=_[_0x4f06('0x44')](_0x3f9443[_0x4f06('0x40')],_0x3f9443[_0x4f06('0x45')]);_0x2e48be['attributes']=_['intersection'](_0x3f9443[_0x4f06('0x40')],qs[_0x4f06('0x46')](_0x1039f1[_0x4f06('0x45')][_0x4f06('0x46')]));_0x2e48be[_0x4f06('0x47')]=_0x2e48be[_0x4f06('0x47')][_0x4f06('0x48')]?_0x2e48be[_0x4f06('0x47')]:_0x3f9443['model'];if(!_0x1039f1[_0x4f06('0x45')][_0x4f06('0x49')]('nolimit')){_0x2e48be[_0x4f06('0x30')]=qs['limit'](_0x1039f1[_0x4f06('0x45')]['limit']);_0x2e48be[_0x4f06('0x2e')]=qs['offset'](_0x1039f1['query'][_0x4f06('0x2e')]);}_0x2e48be[_0x4f06('0x4a')]=qs['sort'](_0x1039f1['query'][_0x4f06('0x4b')]);_0x2e48be[_0x4f06('0x4c')]=qs[_0x4f06('0x43')](_[_0x4f06('0x4d')](_0x1039f1[_0x4f06('0x45')],_0x3f9443[_0x4f06('0x43')]),_0x5c8129);if(_0x1039f1[_0x4f06('0x45')]['filter']){_0x2e48be['where']=_['merge'](_0x2e48be[_0x4f06('0x4c')],{'$or':_[_0x4f06('0x41')](_0x5c8129,function(_0x2c88bb){if(_0x2c88bb['type']!==_0x4f06('0x4e')){var _0x24487f={};_0x24487f[_0x2c88bb['name']]={'$like':'%'+_0x1039f1['query'][_0x4f06('0x4f')]+'%'};return _0x24487f;}})});}_0x2e48be=_[_0x4f06('0x50')]({},_0x2e48be,_0x1039f1[_0x4f06('0x51')]);var _0x671aed={'where':_0x2e48be[_0x4f06('0x4c')]};return db[_0x4f06('0x3b')][_0x4f06('0x31')](_0x671aed)[_0x4f06('0x21')](function(_0x4ab450){_0x2d7ac3[_0x4f06('0x31')]=_0x4ab450;if(_0x1039f1[_0x4f06('0x45')]['includeAll']){_0x2e48be[_0x4f06('0x52')]=[{'all':!![]}];}return db[_0x4f06('0x3b')][_0x4f06('0x53')](_0x2e48be);})[_0x4f06('0x21')](function(_0x16f454){_0x2d7ac3['rows']=_0x16f454;return _0x2d7ac3;})['then'](respondWithFilteredResult(_0x1a594e,_0x2e48be))[_0x4f06('0x2b')](handleError(_0x1a594e,null));};exports['show']=function(_0x521e70,_0xce40dd){var _0xbaeed7={'raw':![],'where':{'id':_0x521e70[_0x4f06('0x54')]['id']},'include':[{'model':db[_0x4f06('0x55')],'as':_0x4f06('0x3a')}]},_0x2e840e={};_0x2e840e[_0x4f06('0x40')]=_[_0x4f06('0x42')](db[_0x4f06('0x3b')]['rawAttributes']);_0x2e840e[_0x4f06('0x45')]=_[_0x4f06('0x42')](_0x521e70[_0x4f06('0x45')]);_0x2e840e[_0x4f06('0x43')]=_['intersection'](_0x2e840e[_0x4f06('0x40')],_0x2e840e['query']);_0xbaeed7[_0x4f06('0x47')]=_['intersection'](_0x2e840e[_0x4f06('0x40')],qs[_0x4f06('0x46')](_0x521e70[_0x4f06('0x45')][_0x4f06('0x46')]));_0xbaeed7[_0x4f06('0x47')]=_0xbaeed7[_0x4f06('0x47')][_0x4f06('0x48')]?_0xbaeed7[_0x4f06('0x47')]:_0x2e840e[_0x4f06('0x40')];if(_0x521e70['query'][_0x4f06('0x56')]){_0xbaeed7[_0x4f06('0x52')]=[{'all':!![]}];}_0xbaeed7=_[_0x4f06('0x50')]({},_0xbaeed7,_0x521e70[_0x4f06('0x51')]);return db['SmsAccount']['find'](_0xbaeed7)[_0x4f06('0x21')](handleEntityNotFound(_0xce40dd,null))[_0x4f06('0x21')](respondWithResult(_0xce40dd,null))[_0x4f06('0x2b')](handleError(_0xce40dd,null));};exports['create']=function(_0x16a532,_0x15d213){return db['SmsAccount'][_0x4f06('0x57')](_0x16a532[_0x4f06('0x58')],{})[_0x4f06('0x21')](function(_0x2b8864){var _0x1f08f2=_0x16a532[_0x4f06('0x59')][_0x4f06('0x35')]({'plain':!![]});if(!_0x1f08f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f08f2[_0x4f06('0x5a')]===_0x4f06('0x59')){var _0x4df417=_0x2b8864[_0x4f06('0x35')]({'plain':!![]});var _0x2dca75=_0x4f06('0x5b');return db[_0x4f06('0x5c')]['find']({'where':{'name':_0x2dca75,'userProfileId':_0x1f08f2[_0x4f06('0x5d')]},'raw':!![]})[_0x4f06('0x21')](function(_0x55afdc){if(_0x55afdc&&_0x55afdc[_0x4f06('0x5e')]===0x0){return db[_0x4f06('0x5f')]['create']({'name':_0x4df417['name'],'resourceId':_0x4df417['id'],'type':_0x55afdc['name'],'sectionId':_0x55afdc['id']},{})['then'](function(){return _0x2b8864;});}else{return _0x2b8864;}})[_0x4f06('0x2b')](function(_0x5dc770){logger[_0x4f06('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc770);throw _0x5dc770;});}return _0x2b8864;})[_0x4f06('0x21')](respondWithResult(_0x15d213,0xc9))[_0x4f06('0x2b')](handleError(_0x15d213,null));};exports[_0x4f06('0x60')]=function(_0x8f1ae6,_0x59ee13){if(_0x8f1ae6['body']['id']){delete _0x8f1ae6[_0x4f06('0x58')]['id'];}return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x8f1ae6[_0x4f06('0x54')]['id']},'include':[{'model':db[_0x4f06('0x55')],'as':_0x4f06('0x3a')}]})[_0x4f06('0x21')](handleEntityNotFound(_0x59ee13,null))[_0x4f06('0x21')](saveUpdates(_0x8f1ae6[_0x4f06('0x58')],null))['then'](respondWithResult(_0x59ee13,null))['catch'](handleError(_0x59ee13,null));};exports[_0x4f06('0x36')]=function(_0x11d944,_0x18a10a){return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x11d944['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x18a10a,null))[_0x4f06('0x21')](removeEntity(_0x18a10a,null))[_0x4f06('0x2b')](handleError(_0x18a10a,null));};exports[_0x4f06('0x62')]=function(_0x13c6f9,_0x5b945b){return db['SmsAccount'][_0x4f06('0x62')]()[_0x4f06('0x21')](respondWithResult(_0x5b945b,null))[_0x4f06('0x2b')](handleError(_0x5b945b,null));};exports[_0x4f06('0x63')]=function(_0x55bf7a,_0x1a0e9c,_0x19d4f8){if(_0x55bf7a[_0x4f06('0x58')]['id']){delete _0x55bf7a[_0x4f06('0x58')]['id'];}return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x55bf7a['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x1a0e9c,null))['then'](function(_0xb3933c){if(_0xb3933c){_0x55bf7a[_0x4f06('0x58')][_0x4f06('0x64')]=_0xb3933c['id'];return db[_0x4f06('0x65')][_0x4f06('0x57')](_0x55bf7a[_0x4f06('0x58')]);}})['then'](respondWithResult(_0x1a0e9c,null))[_0x4f06('0x2b')](handleError(_0x1a0e9c,null));};exports[_0x4f06('0x66')]=function(_0x288b2e,_0x54919b,_0x3de02f){var _0x5ecb2f={'raw':![],'where':{}};var _0x2fbc3f={};var _0x4e9717={'count':0x0,'rows':[]};return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0x288b2e[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x54919b,null))['then'](function(_0x53b364){if(_0x53b364){_0x2fbc3f[_0x4f06('0x40')]=_[_0x4f06('0x42')](db[_0x4f06('0x65')][_0x4f06('0x3c')]);_0x2fbc3f[_0x4f06('0x45')]=_[_0x4f06('0x42')](_0x288b2e[_0x4f06('0x45')]);_0x2fbc3f[_0x4f06('0x43')]=_[_0x4f06('0x44')](_0x2fbc3f[_0x4f06('0x40')],_0x2fbc3f['query']);_0x5ecb2f['attributes']=_[_0x4f06('0x44')](_0x2fbc3f[_0x4f06('0x40')],qs[_0x4f06('0x46')](_0x288b2e[_0x4f06('0x45')][_0x4f06('0x46')]));_0x5ecb2f['attributes']=_0x5ecb2f[_0x4f06('0x47')]['length']?_0x5ecb2f[_0x4f06('0x47')]:_0x2fbc3f['model'];if(!_0x288b2e[_0x4f06('0x45')][_0x4f06('0x49')](_0x4f06('0x68'))){_0x5ecb2f[_0x4f06('0x30')]=qs[_0x4f06('0x30')](_0x288b2e[_0x4f06('0x45')]['limit']);_0x5ecb2f[_0x4f06('0x2e')]=qs['offset'](_0x288b2e[_0x4f06('0x45')][_0x4f06('0x2e')]);}_0x5ecb2f['order']=qs[_0x4f06('0x4b')](_0x288b2e['query']['sort']);_0x5ecb2f[_0x4f06('0x4c')]=qs['filters'](_['pick'](_0x288b2e[_0x4f06('0x45')],_0x2fbc3f[_0x4f06('0x43')]));_0x5ecb2f[_0x4f06('0x4c')][_0x4f06('0x64')]=_0x53b364['id'];if(_0x288b2e[_0x4f06('0x45')][_0x4f06('0x4f')]){_0x5ecb2f['where']=_[_0x4f06('0x50')](_0x5ecb2f[_0x4f06('0x4c')],{'$or':_['map'](_0x5ecb2f['attributes'],function(_0xf18126){var _0x535a80={};_0x535a80[_0xf18126]={'$like':'%'+_0x288b2e[_0x4f06('0x45')]['filter']+'%'};return _0x535a80;})});}_0x5ecb2f=_['merge']({},_0x5ecb2f,_0x288b2e[_0x4f06('0x51')]);return db[_0x4f06('0x65')][_0x4f06('0x31')]({'where':_0x5ecb2f[_0x4f06('0x4c')]})[_0x4f06('0x21')](function(_0x5174f7){_0x4e9717['count']=_0x5174f7;if(_0x288b2e[_0x4f06('0x45')][_0x4f06('0x56')]){_0x5ecb2f[_0x4f06('0x52')]=[{'all':!![]}];}return db[_0x4f06('0x65')][_0x4f06('0x53')](_0x5ecb2f);})[_0x4f06('0x21')](function(_0x2fc7d){_0x4e9717[_0x4f06('0x69')]=_0x2fc7d;return _0x4e9717;});}})[_0x4f06('0x21')](respondWithFilteredResult(_0x54919b,_0x5ecb2f))['catch'](handleError(_0x54919b,null));};exports[_0x4f06('0x6a')]=function(_0x36c3ee,_0x28c152,_0x2ec446){return db[_0x4f06('0x3b')]['find']({'where':{'id':_0x36c3ee[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x28c152,null))['then'](function(_0x3f3b80){if(_0x3f3b80){return _0x3f3b80[_0x4f06('0x6a')](_0x36c3ee[_0x4f06('0x45')]['ids']);}})[_0x4f06('0x21')](respondWithStatusCode(_0x28c152,null))['catch'](handleError(_0x28c152,null));};exports[_0x4f06('0x6b')]=function(_0x9362b5,_0x4f41cf,_0x709343){if(_0x9362b5[_0x4f06('0x58')]['id']){delete _0x9362b5[_0x4f06('0x58')]['id'];}return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x9362b5[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x4f41cf,null))['then'](function(_0x3857fc){if(_0x3857fc){_0x9362b5['body'][_0x4f06('0x64')]=_0x3857fc['id'];return db[_0x4f06('0x6c')]['create'](_0x9362b5[_0x4f06('0x58')]);}})[_0x4f06('0x21')](respondWithResult(_0x4f41cf,null))[_0x4f06('0x2b')](handleError(_0x4f41cf,null));};exports['getAnswers']=function(_0x392028,_0x38b7f7,_0x572f83){var _0x213e0e={'raw':![],'where':{}};var _0x27c64a={};var _0x794823={'count':0x0,'rows':[]};return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0x392028['params']['id']}})['then'](handleEntityNotFound(_0x38b7f7,null))[_0x4f06('0x21')](function(_0x3ed954){if(_0x3ed954){_0x27c64a[_0x4f06('0x40')]=_[_0x4f06('0x42')](db['CannedAnswer'][_0x4f06('0x3c')]);_0x27c64a[_0x4f06('0x45')]=_[_0x4f06('0x42')](_0x392028['query']);_0x27c64a['filters']=_[_0x4f06('0x44')](_0x27c64a[_0x4f06('0x40')],_0x27c64a['query']);_0x213e0e['attributes']=_[_0x4f06('0x44')](_0x27c64a['model'],qs[_0x4f06('0x46')](_0x392028['query'][_0x4f06('0x46')]));_0x213e0e['attributes']=_0x213e0e[_0x4f06('0x47')][_0x4f06('0x48')]?_0x213e0e[_0x4f06('0x47')]:_0x27c64a[_0x4f06('0x40')];if(!_0x392028[_0x4f06('0x45')][_0x4f06('0x49')](_0x4f06('0x68'))){_0x213e0e[_0x4f06('0x30')]=qs[_0x4f06('0x30')](_0x392028[_0x4f06('0x45')][_0x4f06('0x30')]);_0x213e0e[_0x4f06('0x2e')]=qs[_0x4f06('0x2e')](_0x392028['query'][_0x4f06('0x2e')]);}_0x213e0e[_0x4f06('0x4a')]=qs['sort'](_0x392028[_0x4f06('0x45')][_0x4f06('0x4b')]);_0x213e0e['where']=qs[_0x4f06('0x43')](_[_0x4f06('0x4d')](_0x392028[_0x4f06('0x45')],_0x27c64a[_0x4f06('0x43')]));_0x213e0e[_0x4f06('0x4c')][_0x4f06('0x64')]=_0x3ed954['id'];if(_0x392028['query'][_0x4f06('0x4f')]){_0x213e0e[_0x4f06('0x4c')]=_['merge'](_0x213e0e[_0x4f06('0x4c')],{'$or':_[_0x4f06('0x41')](_0x213e0e[_0x4f06('0x47')],function(_0x141468){var _0x455157={};_0x455157[_0x141468]={'$like':'%'+_0x392028[_0x4f06('0x45')][_0x4f06('0x4f')]+'%'};return _0x455157;})});}_0x213e0e=_[_0x4f06('0x50')]({},_0x213e0e,_0x392028['options']);return db[_0x4f06('0x6c')][_0x4f06('0x31')]({'where':_0x213e0e[_0x4f06('0x4c')]})[_0x4f06('0x21')](function(_0x1f2b76){_0x794823[_0x4f06('0x31')]=_0x1f2b76;if(_0x392028[_0x4f06('0x45')][_0x4f06('0x56')]){_0x213e0e['include']=[{'all':!![]}];}return db[_0x4f06('0x6c')][_0x4f06('0x53')](_0x213e0e);})[_0x4f06('0x21')](function(_0x37b5a8){_0x794823['rows']=_0x37b5a8;return _0x794823;});}})[_0x4f06('0x21')](respondWithFilteredResult(_0x38b7f7,_0x213e0e))[_0x4f06('0x2b')](handleError(_0x38b7f7,null));};exports['removeAnswers']=function(_0xa09b1a,_0x504460,_0x57f41e){return db[_0x4f06('0x3b')]['find']({'where':{'id':_0xa09b1a[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x504460,null))[_0x4f06('0x21')](function(_0x42de6){if(_0x42de6){return _0x42de6[_0x4f06('0x6d')](_0xa09b1a[_0x4f06('0x45')][_0x4f06('0x6e')]);}})[_0x4f06('0x21')](respondWithStatusCode(_0x504460,null))[_0x4f06('0x2b')](handleError(_0x504460,null));};exports['notify']=function(_0x1f385b,_0x225230,_0x5dfd58){var _0x519bec={'channel':_0x4f06('0x6f')};var _0x517eaa=[];var _0xc368f0=[];var _0x49b9fa={};return db['SmsAccount'][_0x4f06('0x61')]({'where':{'id':_0x1f385b['params']['id']},'include':[{'model':db[_0x4f06('0x70')],'as':_0x4f06('0x71')}]})[_0x4f06('0x21')](handleEntityNotFound(_0x225230,null))[_0x4f06('0x21')](function(_0x49e746){_0x519bec[_0x4f06('0x72')]=_0x49e746;_0x519bec[_0x4f06('0x73')]=_[_0x4f06('0x74')](_0x49e746[_0x4f06('0x71')],[_0x4f06('0x75')],['asc']);if(_0x519bec['account'][_0x4f06('0x71')]){delete _0x519bec[_0x4f06('0x72')][_0x4f06('0x71')];}return db[_0x4f06('0x76')][_0x4f06('0x62')]();})[_0x4f06('0x21')](function(_0x3199c3){if(!_0x3199c3){throw new db['Sequelize'][(_0x4f06('0x77'))]('no\x20available\x20attributes');}_0x517eaa=_[_0x4f06('0x78')](_[_0x4f06('0x42')](_0x3199c3),[_0x4f06('0x79'),_0x4f06('0x7a')]);_0xc368f0=_[_0x4f06('0x78')](_['keys'](_0x3199c3),[_0x4f06('0x79'),_0x4f06('0x7a'),_0x4f06('0x7b'),_0x4f06('0x7c')]);_0x519bec[_0x4f06('0x58')]={'mapKey':_0x4f06('0x7d')};if(_0x519bec[_0x4f06('0x72')]['type']){switch(_0x519bec[_0x4f06('0x72')][_0x4f06('0x3e')]){case _0x4f06('0x7e'):_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')]=_0x1f385b['body'][_0x4f06('0x80')];_0x519bec['body']['body']=_0x1f385b['body'][_0x4f06('0x81')];_0x519bec['body']['messageId']=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x82')];break;case _0x4f06('0x83'):_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')]='+'+_0x1f385b['body'][_0x4f06('0x84')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')]['text'];break;case _0x4f06('0x85'):_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x7f')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')]['message'];break;case _0x4f06('0x86'):_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')]=_0x1f385b['body'][_0x4f06('0x7f')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x58')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x87')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x88')];break;case _0x4f06('0x89'):_0x519bec['body']['from']=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x80')];_0x519bec['body'][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x8a')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x87')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x8b')];break;case _0x4f06('0x8c'):_0x519bec[_0x4f06('0x58')]['from']='+'+_0x1f385b['body']['results'][0x0][_0x4f06('0x7f')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x8d')][0x0][_0x4f06('0x8e')];_0x519bec[_0x4f06('0x58')]['messageId']=_0x1f385b['body']['results'][0x0]['messageId'];break;case _0x4f06('0x8f'):_0x519bec[_0x4f06('0x58')]['from']=_0x1f385b['body'][_0x4f06('0x90')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x91')][_0x4f06('0x29')];break;case _0x4f06('0x92'):_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')]=_0x1f385b[_0x4f06('0x58')]['fromNumber'];_0x519bec[_0x4f06('0x58')]['body']=_0x1f385b[_0x4f06('0x58')]['text'];_0x519bec[_0x4f06('0x58')][_0x4f06('0x87')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x93')];break;case _0x4f06('0x94'):_0x519bec[_0x4f06('0x58')]['messageId']=_0x1f385b['body'][0x0]['message']['id'];_0x519bec['body'][_0x4f06('0x7f')]=_0x1f385b[_0x4f06('0x58')][0x0][_0x4f06('0x29')]['from'];_0x519bec['body'][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][0x0][_0x4f06('0x29')]['text'];break;case _0x4f06('0x95'):_0x519bec[_0x4f06('0x58')]['from']=_0x1f385b['body'][_0x4f06('0x7f')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x29')];_0x519bec[_0x4f06('0x58')][_0x4f06('0x87')]=_0x1f385b[_0x4f06('0x58')][_0x4f06('0x96')];break;}}if(_0x519bec['body']['id']){delete _0x519bec[_0x4f06('0x58')]['id'];}if(_[_0x4f06('0x97')](_0x519bec['body'][_0x4f06('0x7f')])){throw new db['Sequelize'][(_0x4f06('0x77'))](_0x4f06('0x98'));}if(_[_0x4f06('0x97')](_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')])||_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')]===''){throw new db[(_0x4f06('0x99'))][(_0x4f06('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4f06('0x97')](_0x519bec['body'][_0x4f06('0x9a')])){throw new db['Sequelize'][(_0x4f06('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xc368f0);}if(!_[_0x4f06('0x9b')](_0xc368f0,_0x519bec[_0x4f06('0x58')][_0x4f06('0x9a')])){throw new db['Sequelize'][(_0x4f06('0x77'))](_0x4f06('0x9c')+_0xc368f0);}_0x49b9fa[_0x519bec['body']['mapKey']]=_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')];return db[_0x4f06('0x9d')][_0x4f06('0x61')]({'where':{'id':_0x519bec[_0x4f06('0x72')][_0x4f06('0x7c')]},'include':[{'model':db[_0x4f06('0x76')],'as':_0x4f06('0x9e'),'where':_0x49b9fa,'limit':0x1,'order':[[_0x4f06('0x7a'),_0x4f06('0x9f')]]}]});})['then'](handleEntityNotFound(_0x225230,null))[_0x4f06('0x21')](function(_0x10084c){if(_0x10084c){_0x519bec['list']=_[_0x4f06('0xa0')](_0x10084c,['Contacts']);if(_0x10084c['Contacts'][_0x4f06('0x48')]){return _0x10084c['Contacts'][0x0];}var _0x365a28=_[_0x4f06('0x19')](_0x519bec[_0x4f06('0x58')],{'firstName':_0x519bec[_0x4f06('0x58')]['from'],'ListId':_0x10084c['id']});_0x365a28[_0x519bec[_0x4f06('0x58')][_0x4f06('0x9a')]]=_0x519bec[_0x4f06('0x58')]['from'];return db[_0x4f06('0x76')][_0x4f06('0x57')](_0x365a28,{'fields':_0x517eaa,'raw':!![]});}})['then'](handleEntityNotFound(_0x225230,null))[_0x4f06('0x21')](function(_0x4bf5a5){if(_0x4bf5a5){_0x519bec[_0x4f06('0xa1')]=_0x4bf5a5;var _0x1a6a59={'ContactId':_0x4bf5a5['id'],'phone':_0x519bec[_0x4f06('0x58')][_0x4f06('0x7f')],'SmsAccountId':_0x1f385b['params']['id']};var _0x1969f8={'ContactId':_0x4bf5a5['id'],'SmsAccountId':_0x1f385b[_0x4f06('0x54')]['id'],'closed':![]};return db[_0x4f06('0xa2')][_0x4f06('0x61')]({'where':_0x1969f8})[_0x4f06('0x21')](function(_0x1b29bc){if(_0x1b29bc){return[_0x1b29bc,![]];}return db[_0x4f06('0xa2')]['create'](_0x1a6a59)['then'](function(_0x12ee5a){return[_0x12ee5a,!![]];});});}})[_0x4f06('0xa3')](function(_0x4c6731,_0x409820){_0x519bec['interaction']=_0x4c6731[_0x4f06('0x35')]({'plain':!![]});_0x519bec['interaction'][_0x4f06('0xa4')]=![];if(_0x409820){if(_0x519bec[_0x4f06('0x72')][_0x4f06('0xa5')]){_0x519bec[_0x4f06('0x73')][_0x4f06('0xa6')]({'id':0x0,'priority':_0x519bec[_0x4f06('0x73')][_0x4f06('0x48')]+0x1,'app':_0x4f06('0xa7'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x519bec['interaction'][_0x4f06('0xa4')]=!![];}return db['SmsMessage'][_0x4f06('0x57')]({'phone':_0x519bec[_0x4f06('0x58')]['from'],'messageId':_0x519bec[_0x4f06('0x58')][_0x4f06('0x87')],'body':_0x519bec[_0x4f06('0x58')][_0x4f06('0x58')],'SmsAccountId':_0x1f385b[_0x4f06('0x54')]['id'],'SmsInteractionId':_0x4c6731['id'],'direction':'in','ContactId':_0x4c6731[_0x4f06('0xa8')],'AttachmentId':_0x519bec[_0x4f06('0x58')][_0x4f06('0xa9')]});})[_0x4f06('0x21')](function(_0x106b75){_0x519bec[_0x4f06('0x29')]=_0x106b75;if(!_0x519bec[_0x4f06('0xaa')][_0x4f06('0xab')])return;return db['User'][_0x4f06('0x61')]({'attributes':['id','name'],'where':{'id':_0x519bec['interaction'][_0x4f06('0xab')]}});})['then'](function(_0xf06019){if(_0xf06019){_0x519bec[_0x4f06('0x73')][_0x4f06('0xac')]({'id':0x0,'priority':0x0,'app':_0x4f06('0xad'),'appdata':_0xf06019[_0x4f06('0x37')]+','+(_0x519bec['account'][_0x4f06('0xae')]||0xa),'interval':_0x4f06('0xaf')});}if(!_0x519bec['interaction'][_0x4f06('0xb0')])return;return db['SmsQueue']['find']({'attributes':['id',_0x4f06('0x37')],'where':{'id':_0x519bec['interaction'][_0x4f06('0xb0')]}});})[_0x4f06('0x21')](function(_0x255e60){if(_0x255e60){_0x519bec['applications'][_0x4f06('0xac')]({'id':0x0,'priority':0x1,'app':_0x4f06('0xb1'),'appdata':_0x255e60['name']+','+(_0x519bec[_0x4f06('0x72')]['waitForTheAssignedQueue']||0x12c),'interval':_0x4f06('0xaf')});}return respondWithRpcPromise(_0x4f06('0xb2'),_0x4f06('0xb3'),_0x519bec);})[_0x4f06('0x21')](function(_0x5ae85e){if(_0x5ae85e){var _0x2b6f89=0xc8;var _0x57fd38=_0x4f06('0xb4');logger['info'](_0x4f06('0x24'),_0x57fd38,_0x2b6f89,'entity\x20found');logger[_0x4f06('0xb5')](_0x4f06('0xb6'),_0x57fd38,_0x2b6f89,'entity\x20found',JSON['stringify'](_0x5ae85e));if(_0x519bec['account'][_0x4f06('0x3e')]==='twilio'){return _0x225230[_0x4f06('0x2d')](_0x2b6f89)[_0x4f06('0x32')](_0x4f06('0xb7'),'text/xml')[_0x4f06('0x38')]('\x0a');}else{return _0x225230['status'](_0x2b6f89)['json'](_0x5ae85e);}}})[_0x4f06('0x2b')](handleError(_0x225230,null));};exports[_0x4f06('0xb8')]=function(_0x38433c,_0x49e70f){var _0x4fe865=_0x38433c[_0x4f06('0x54')]['id'];var _0x3b641e=_0x38433c[_0x4f06('0x58')];var _0x517f72=0xc8;var _0x17f47b=null;return db[_0x4f06('0xb9')][_0x4f06('0xba')]({'isolationLevel':db[_0x4f06('0xb9')][_0x4f06('0xbb')][_0x4f06('0xbc')][_0x4f06('0xbd')]},function(_0x4d8862){return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0x4fe865},'transaction':_0x4d8862})[_0x4f06('0x21')](function(_0x23a704){if(_0x23a704){return db[_0x4f06('0x70')][_0x4f06('0x36')]({'where':{'SmsAccountId':_0x4fe865},'transaction':_0x4d8862})[_0x4f06('0x21')](function(){var _0x39966f=_['map'](_0x3b641e,function(_0x23379d){_0x23379d['SmsAccountId']=_0x4fe865;return _0x23379d;});return db[_0x4f06('0x70')][_0x4f06('0xbe')](_0x39966f,{'transaction':_0x4d8862});});}else{_0x517f72=0x194;_0x17f47b=[];}});})[_0x4f06('0x21')](function(){if(_0x517f72!==0x194){return db['SmsApplication'][_0x4f06('0xbf')]({'where':{'SmsAccountId':_0x4fe865},'order':_0x4f06('0x75')})[_0x4f06('0x21')](function(_0x1522fa){_0x17f47b=_0x1522fa;});}})['catch'](function(_0x47e192){_0x517f72=0x1f4;logger[_0x4f06('0x26')](_0x47e192[_0x4f06('0xc0')]);if(_0x47e192[_0x4f06('0x37')]){delete _0x47e192[_0x4f06('0x37')];}_0x17f47b=_0x47e192;})[_0x4f06('0xc1')](function(){if(_0x17f47b===null){_0x49e70f[_0x4f06('0x2c')](_0x517f72);}else{if(_0x517f72===0x1f4){_0x49e70f[_0x4f06('0x2d')](_0x517f72)[_0x4f06('0x38')](_0x17f47b);}else{_0x49e70f[_0x4f06('0x2d')](_0x517f72)[_0x4f06('0xc2')](_0x17f47b);}}});};exports[_0x4f06('0xc3')]=function(_0x375a65,_0x35b0b7,_0x2c7d84){var _0x2ecfce={};var _0x1c9669={};var _0x13d864;var _0x2dd807;return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0x375a65['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x35b0b7,null))['then'](function(_0x37a7fa){if(_0x37a7fa){_0x13d864=_0x37a7fa;_0x1c9669['model']=_[_0x4f06('0x42')](db[_0x4f06('0x70')][_0x4f06('0x3c')]);_0x1c9669['query']=_['keys'](_0x375a65[_0x4f06('0x45')]);_0x1c9669[_0x4f06('0x43')]=_[_0x4f06('0x44')](_0x1c9669[_0x4f06('0x40')],_0x1c9669[_0x4f06('0x45')]);_0x2ecfce[_0x4f06('0x47')]=_['intersection'](_0x1c9669[_0x4f06('0x40')],qs[_0x4f06('0x46')](_0x375a65[_0x4f06('0x45')][_0x4f06('0x46')]));_0x2ecfce[_0x4f06('0x47')]=_0x2ecfce[_0x4f06('0x47')][_0x4f06('0x48')]?_0x2ecfce[_0x4f06('0x47')]:_0x1c9669[_0x4f06('0x40')];_0x2ecfce[_0x4f06('0x4a')]=qs[_0x4f06('0x4b')](_0x375a65[_0x4f06('0x45')][_0x4f06('0x4b')]);_0x2ecfce[_0x4f06('0x4c')]=qs['filters'](_['pick'](_0x375a65[_0x4f06('0x45')],_0x1c9669[_0x4f06('0x43')]));if(_0x375a65[_0x4f06('0x45')][_0x4f06('0x4f')]){_0x2ecfce[_0x4f06('0x4c')]=_[_0x4f06('0x50')](_0x2ecfce[_0x4f06('0x4c')],{'$or':_[_0x4f06('0x41')](_0x2ecfce[_0x4f06('0x47')],function(_0x12524c){var _0x36d403={};_0x36d403[_0x12524c]={'$like':'%'+_0x375a65['query']['filter']+'%'};return _0x36d403;})});}_0x2ecfce=_[_0x4f06('0x50')]({},_0x2ecfce,_0x375a65['options']);return _0x13d864[_0x4f06('0xc3')](_0x2ecfce);}})['then'](function(_0x5a7e02){if(_0x5a7e02){_0x2dd807=_0x5a7e02['length'];if(!_0x375a65['query']['hasOwnProperty'](_0x4f06('0x68'))){_0x2ecfce[_0x4f06('0x30')]=qs[_0x4f06('0x30')](_0x375a65[_0x4f06('0x45')][_0x4f06('0x30')]);_0x2ecfce[_0x4f06('0x2e')]=qs[_0x4f06('0x2e')](_0x375a65[_0x4f06('0x45')][_0x4f06('0x2e')]);}return _0x13d864['getApplications'](_0x2ecfce);}})[_0x4f06('0x21')](function(_0x1fd352){if(_0x1fd352){return _0x1fd352?{'count':_0x2dd807,'rows':_0x1fd352}:null;}})[_0x4f06('0x21')](respondWithResult(_0x35b0b7,null))[_0x4f06('0x2b')](handleError(_0x35b0b7,null));};exports[_0x4f06('0xc4')]=function(_0x2c1816,_0x403483,_0x308a61){var _0xd444df={'raw':![],'where':{}};var _0x4547ef={};var _0x4726cc={'count':0x0,'rows':[]};return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0x2c1816[_0x4f06('0x54')]['id']}})['then'](handleEntityNotFound(_0x403483,null))['then'](function(_0x2f024f){if(_0x2f024f){_0x4547ef[_0x4f06('0x40')]=_['keys'](db[_0x4f06('0xa2')]['rawAttributes']);_0x4547ef[_0x4f06('0x45')]=_[_0x4f06('0x42')](_0x2c1816[_0x4f06('0x45')]);_0x4547ef['filters']=_[_0x4f06('0x44')](_0x4547ef['model'],_0x4547ef['query']);_0xd444df[_0x4f06('0x47')]=_[_0x4f06('0x44')](_0x4547ef[_0x4f06('0x40')],qs[_0x4f06('0x46')](_0x2c1816['query'][_0x4f06('0x46')]));_0xd444df[_0x4f06('0x47')]=_0xd444df[_0x4f06('0x47')][_0x4f06('0x48')]?_0xd444df[_0x4f06('0x47')]:_0x4547ef['model'];if(!_0x2c1816[_0x4f06('0x45')][_0x4f06('0x49')](_0x4f06('0x68'))){_0xd444df[_0x4f06('0x30')]=qs['limit'](_0x2c1816['query'][_0x4f06('0x30')]);_0xd444df[_0x4f06('0x2e')]=qs[_0x4f06('0x2e')](_0x2c1816[_0x4f06('0x45')][_0x4f06('0x2e')]);}_0xd444df['order']=qs[_0x4f06('0x4b')](_0x2c1816[_0x4f06('0x45')][_0x4f06('0x4b')]);_0xd444df[_0x4f06('0x4c')]=qs[_0x4f06('0x43')](_[_0x4f06('0x4d')](_0x2c1816[_0x4f06('0x45')],_0x4547ef[_0x4f06('0x43')]));_0xd444df[_0x4f06('0x4c')][_0x4f06('0x64')]=_0x2f024f['id'];if(_0x2c1816[_0x4f06('0x45')]['filter']){_0xd444df[_0x4f06('0x4c')]=_[_0x4f06('0x50')](_0xd444df[_0x4f06('0x4c')],{'$or':_[_0x4f06('0x41')](_0xd444df[_0x4f06('0x47')],function(_0x51c74b){var _0xb1f0e={};_0xb1f0e[_0x51c74b]={'$like':'%'+_0x2c1816['query'][_0x4f06('0x4f')]+'%'};return _0xb1f0e;})});}_0xd444df=_[_0x4f06('0x50')]({},_0xd444df,_0x2c1816[_0x4f06('0x51')]);return db[_0x4f06('0xa2')][_0x4f06('0x31')]({'where':_0xd444df[_0x4f06('0x4c')]})['then'](function(_0x423d6b){_0x4726cc['count']=_0x423d6b;if(_0x2c1816[_0x4f06('0x45')][_0x4f06('0x56')]){_0xd444df['include']=[{'model':db[_0x4f06('0x76')],'as':_0x4f06('0xc5'),'required':![]},{'model':db[_0x4f06('0xc6')],'as':_0x4f06('0xc7'),'attributes':[_0x4f06('0x37'),'fullname',_0x4f06('0xc8')],'required':![]},{'model':db['Tag'],'as':_0x4f06('0xc9'),'attributes':['id','name',_0x4f06('0xca')],'where':_0x2c1816['query'][_0x4f06('0xcb')]?{'id':_0x2c1816[_0x4f06('0x45')]['tag']}:undefined,'required':_0x2c1816[_0x4f06('0x45')][_0x4f06('0xcb')]?!![]:![]}];}return db[_0x4f06('0xa2')][_0x4f06('0x53')](_0xd444df);})[_0x4f06('0x21')](function(_0x388efd){_0x4726cc[_0x4f06('0x69')]=_0x388efd;return _0x4726cc;});}})[_0x4f06('0x21')](respondWithFilteredResult(_0x403483,_0xd444df))[_0x4f06('0x2b')](handleError(_0x403483,null));};exports[_0x4f06('0x38')]=function(_0x25e481,_0x47d21e,_0x11b31d){var _0x2ffec7,_0x2651e1,_0x4230e9;if(_[_0x4f06('0x97')](_0x25e481[_0x4f06('0x58')][_0x4f06('0x58')])||_0x25e481[_0x4f06('0x58')][_0x4f06('0x58')]===''){throw new db['Sequelize']['ValidationError'](_0x4f06('0xcc'));}if(_[_0x4f06('0x97')](_0x25e481[_0x4f06('0x58')]['to'])){throw new db[(_0x4f06('0x99'))][(_0x4f06('0x77'))](_0x4f06('0xcd'));}_0x2ffec7=_0x25e481[_0x4f06('0x58')]['to'];return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x25e481['params']['id']},'include':[{'model':db[_0x4f06('0x9d')],'as':_0x4f06('0xce'),'include':[{'model':db[_0x4f06('0x76')],'as':_0x4f06('0x9e'),'where':{'mobile':_0x2ffec7},'limit':0x1,'order':[[_0x4f06('0x7a'),_0x4f06('0x9f')]]}]}]})[_0x4f06('0x21')](handleEntityNotFound(_0x47d21e,null))['then'](function(_0x5e31aa){if(_0x5e31aa&&_0x5e31aa[_0x4f06('0xce')]){_0x2651e1=_0x5e31aa[_0x4f06('0x35')]({'plain':!![]});if(_0x2651e1['List']&&_0x2651e1[_0x4f06('0xce')][_0x4f06('0x9e')][_0x4f06('0x48')]){return _0x2651e1[_0x4f06('0xce')][_0x4f06('0x9e')][0x0];}return db['CmContact'][_0x4f06('0x57')](_[_0x4f06('0x19')](_0x25e481[_0x4f06('0x58')],{'firstName':_0x2ffec7,'mobile':_0x2ffec7,'phone':_0x2ffec7,'ListId':_0x2651e1[_0x4f06('0x7c')]}));}})[_0x4f06('0x21')](handleEntityNotFound(_0x47d21e,null))[_0x4f06('0x21')](function(_0x19c844){if(_0x19c844){_0x4230e9=_0x19c844;return db['SmsInteraction'][_0x4f06('0x61')]({'where':{'ContactId':_0x4230e9['id'],'closed':![],'SmsAccountId':_0x2651e1['id']}})[_0x4f06('0x21')](function(_0x2aca17){if(_0x2aca17){return[_0x2aca17,![]];}return db[_0x4f06('0xa2')][_0x4f06('0x57')]({'UserId':_0x25e481['user']['id'],'ContactId':_0x4230e9['id'],'SmsAccountId':_0x2651e1['id'],'phone':_0x2ffec7,'firstMsgDirection':_0x4f06('0xcf'),'Messages':[_[_0x4f06('0x50')](_0x25e481['body'],{'read':![],'body':_0x25e481[_0x4f06('0x58')][_0x4f06('0x58')],'phone':_0x2ffec7,'SmsAccountId':_0x2651e1['id'],'UserId':_0x25e481[_0x4f06('0x59')]['id'],'ContactId':_0x4230e9['id']})]},{'include':[{'model':db[_0x4f06('0xd0')],'as':'Messages'}]})[_0x4f06('0x21')](function(_0x7600dc){return[_0x7600dc,!![]];});});}})['spread'](function(_0x124ba8,_0x616bf){if(_0x616bf){return _0x124ba8;}return db[_0x4f06('0xd0')][_0x4f06('0x57')](_['merge'](_0x25e481[_0x4f06('0x58')],{'read':![],'body':_0x25e481[_0x4f06('0x58')][_0x4f06('0x58')],'phone':_0x2ffec7,'SmsAccountId':_0x2651e1['id'],'SmsInteractionId':_0x124ba8['id'],'UserId':_0x25e481[_0x4f06('0x59')]['id'],'ContactId':_0x4230e9['id']}))['then'](function(_0x36df23){_0x124ba8['dataValues'][_0x4f06('0xd1')]=[];_0x124ba8[_0x4f06('0xd2')]['Messages'][_0x4f06('0xa6')](_0x36df23[_0x4f06('0xd2')]);return _0x124ba8;});})[_0x4f06('0x21')](respondWithResult(_0x47d21e,null))['catch'](handleError(_0x47d21e,null));};exports['status']=function(_0x48c1d8,_0x46bfd4,_0x35a70e){if(_0x48c1d8[_0x4f06('0x58')]['id']){delete _0x48c1d8[_0x4f06('0x58')]['id'];}var _0x128f06,_0x2df5a0,_0x3e49c4;return db[_0x4f06('0x3b')]['find']({'where':{'id':_0x48c1d8[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x46bfd4,null))[_0x4f06('0x21')](function(_0x59b64c){if(_0x59b64c){_0x3e49c4=_0x59b64c;logger[_0x4f06('0xb5')](_0x4f06('0x24'),_0x4f06('0x2d'),'received\x20delivery\x20report\x20from',_0x59b64c[_0x4f06('0x3e')],util[_0x4f06('0xd3')](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));switch(_0x59b64c[_0x4f06('0x3e')]){case _0x4f06('0x83'):if(_0x48c1d8[_0x4f06('0x58')]['skebby_dispatch_id']&&_0x48c1d8[_0x4f06('0x58')]['status']){_0x2df5a0=_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x2d')];return db[_0x4f06('0xd0')][_0x4f06('0x61')]({'where':{'messageId':_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xd4')]}});}break;case _0x4f06('0x85'):if(_0x48c1d8['body'][_0x4f06('0xd5')]&&_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xd6')]){_0x2df5a0=_0x48c1d8['body'][_0x4f06('0xd6')];return db[_0x4f06('0xd0')]['find']({'where':{'messageId':_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xd5')]}});}break;case _0x4f06('0x86'):if(_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x88')]&&_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xd7')]){_0x2df5a0=_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x88')]}});}break;case _0x4f06('0x8c'):var _0x51bb10=_0x48c1d8['body'][_0x4f06('0x8d')][0x0];if(_0x51bb10['messageId']&&_0x51bb10[_0x4f06('0x2d')]['groupName']===_0x4f06('0xd8')){_0x2df5a0=_0x51bb10[_0x4f06('0x2d')][_0x4f06('0xd9')];return db[_0x4f06('0xd0')]['find']({'where':{'messageId':_0x51bb10['messageId']}});}break;case _0x4f06('0x92'):if(_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x87')]&&_0x48c1d8[_0x4f06('0x58')]['status']){_0x2df5a0=_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x2d')];return db[_0x4f06('0xd0')][_0x4f06('0x61')]({'where':{'messageId':_0x48c1d8['body'][_0x4f06('0x87')]}});}break;case _0x4f06('0x94'):if(_0x48c1d8[_0x4f06('0x58')][0x0][_0x4f06('0x29')]['id']){_0x2df5a0=_0x48c1d8['body'][0x0][_0x4f06('0x3e')];return db[_0x4f06('0xd0')][_0x4f06('0x61')]({'where':{'messageId':_0x48c1d8[_0x4f06('0x58')][0x0][_0x4f06('0x29')]['id']}});}break;case _0x4f06('0x95'):if(_0x48c1d8[_0x4f06('0x58')]['redif']&&_0x48c1d8[_0x4f06('0x58')][_0x4f06('0x2d')]){_0x2df5a0=_0x48c1d8['body']['status'];return db[_0x4f06('0xd0')]['find']({'where':{'messageId':_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xda')]}});}break;}}})[_0x4f06('0x21')](handleEntityNotFound(_0x46bfd4,null))[_0x4f06('0x21')](function(_0x5a5d0a){if(_0x5a5d0a){_0x128f06=_0x5a5d0a;switch(_0x3e49c4['type']){case _0x4f06('0x83'):if(_0x2df5a0===_0x4f06('0xd8')){return _0x128f06[_0x4f06('0x60')]({'read':!![]});}else{logger[_0x4f06('0x26')](_0x4f06('0x24'),_0x4f06('0x2d'),_0x4f06('0x83'),util[_0x4f06('0xd3')](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2df5a0==='1'){return _0x128f06[_0x4f06('0x60')]({'read':!![]});}else{logger[_0x4f06('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4f06('0x83'),util[_0x4f06('0xd3')](_0x48c1d8['body'],{'showHidden':![],'depth':null}));}break;case _0x4f06('0x86'):if(!_0x48c1d8[_0x4f06('0x58')][_0x4f06('0xdb')]&&_0x2df5a0>=0xc8&&_0x2df5a0<=0xce){return _0x128f06['update']({'read':!![]});}else{logger[_0x4f06('0x26')](_0x4f06('0x24'),_0x4f06('0x2d'),'clicksend',util[_0x4f06('0xd3')](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4f06('0x8c'):var _0x1cd0b8=_0x48c1d8['body'][_0x4f06('0x8d')][0x0];if(_0x1cd0b8[_0x4f06('0x2d')][_0x4f06('0xd9')]===_0x4f06('0xd8')){return _0x128f06[_0x4f06('0x60')]({'read':!![]});}else{logger[_0x4f06('0x26')](_0x4f06('0x24'),'status','infobip',util[_0x4f06('0xd3')](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2df5a0=='DELIVERED_TO_GATEWAY'||_0x2df5a0==_0x4f06('0xdc')){return _0x128f06['update']({'read':!![]});}else{logger[_0x4f06('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f06('0x2d'),_0x4f06('0x92'),util['inspect'](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4f06('0x94'):if(_0x2df5a0==_0x4f06('0xdd')){return _0x128f06['update']({'read':!![]});}else{logger[_0x4f06('0x26')](_0x4f06('0x24'),'status',_0x4f06('0x94'),util[_0x4f06('0xd3')](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;case _0x4f06('0x95'):if(_0x2df5a0==='DELIVRD'||_0x2df5a0===_0x4f06('0xde')){return _0x128f06[_0x4f06('0x60')]({'read':!![]});}else{logger[_0x4f06('0x26')](_0x4f06('0x24'),'status',_0x4f06('0x95'),util['inspect'](_0x48c1d8[_0x4f06('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x128f06;}})['then'](respondWithResult(_0x46bfd4,null))[_0x4f06('0x2b')](handleError(_0x46bfd4,null));};exports[_0x4f06('0xdf')]=function(_0x1be048,_0x2bc613,_0x28c4a5){var _0x181b86,_0xd8d182,_0x5517f9;return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x1be048['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x2bc613,null))[_0x4f06('0x21')](function(_0x26daa7){if(_0x26daa7){_0x5517f9=_0x26daa7;logger[_0x4f06('0xb5')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4f06('0xe0'),_0x26daa7[_0x4f06('0x3e')],util['inspect'](_0x1be048[_0x4f06('0x45')],{'showHidden':![],'depth':null}));switch(_0x26daa7[_0x4f06('0x3e')]){case _0x4f06('0x8f'):if(_0x1be048['query']['message-id']&&_0x1be048['query'][_0x4f06('0xe1')]){_0xd8d182=_0x1be048['query'][_0x4f06('0xe1')];return db['SmsMessage'][_0x4f06('0x61')]({'where':{'messageId':_0x1be048[_0x4f06('0x45')][_0x4f06('0xe2')]}});}break;}}})[_0x4f06('0x21')](handleEntityNotFound(_0x2bc613,null))[_0x4f06('0x21')](function(_0x45d57a){if(_0x45d57a){_0x181b86=_0x45d57a;switch(_0x5517f9[_0x4f06('0x3e')]){case _0x4f06('0x8f'):if(_0xd8d182==='2'||_0xd8d182==='6'){return _0x181b86['update']({'read':!![]});}else{logger[_0x4f06('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f06('0x2d'),_0x4f06('0x8f'),util[_0x4f06('0xd3')](_0x1be048[_0x4f06('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x181b86;}})[_0x4f06('0x21')](respondWithResult(_0x2bc613,null))[_0x4f06('0x2b')](handleError(_0x2bc613,null));};exports['addAgents']=function(_0x5e1252,_0x91c2bf,_0x5fdc04){return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x5e1252[_0x4f06('0x54')]['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x91c2bf,null))[_0x4f06('0x21')](function(_0x4a5323){if(_0x4a5323){return _0x4a5323['addAgents'](_0x5e1252[_0x4f06('0x58')][_0x4f06('0x6e')],_[_0x4f06('0xa0')](_0x5e1252[_0x4f06('0x58')],[_0x4f06('0x6e'),'id'])||{})[_0x4f06('0xa3')](function(_0x7ad0e2){for(var _0x4c77ef=0x0;_0x4c77ef<_0x5e1252['body'][_0x4f06('0x6e')][_0x4f06('0x48')];_0x4c77ef+=0x1){socket[_0x4f06('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x5e1252[_0x4f06('0x58')]['ids'][_0x4c77ef]),'SmsAccountId':Number(_0x5e1252[_0x4f06('0x54')]['id'])});}return _0x7ad0e2;});}})[_0x4f06('0x21')](respondWithResult(_0x91c2bf,null))[_0x4f06('0x2b')](handleError(_0x91c2bf,null));};exports['removeAgents']=function(_0x4e3613,_0xc77cf6,_0xb07eea){return db[_0x4f06('0x3b')][_0x4f06('0x61')]({'where':{'id':_0x4e3613['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0xc77cf6,null))[_0x4f06('0x21')](function(_0x43553e){if(_0x43553e){return _0x43553e['removeAgents'](_0x4e3613['query'][_0x4f06('0x6e')])[_0x4f06('0x21')](function(){if(_[_0x4f06('0xe4')](_0x4e3613[_0x4f06('0x45')][_0x4f06('0x6e')])){for(var _0x3026eb=0x0;_0x3026eb<_0x4e3613[_0x4f06('0x45')][_0x4f06('0x6e')][_0x4f06('0x48')];_0x3026eb+=0x1){socket['emit'](_0x4f06('0xe5'),{'UserId':Number(_0x4e3613[_0x4f06('0x45')][_0x4f06('0x6e')][_0x3026eb]),'SmsAccountId':Number(_0x4e3613[_0x4f06('0x54')]['id'])});}}else{socket[_0x4f06('0xe3')](_0x4f06('0xe5'),{'UserId':Number(_0x4e3613[_0x4f06('0x45')][_0x4f06('0x6e')]),'SmsAccountId':Number(_0x4e3613['params']['id'])});}});}})[_0x4f06('0x21')](respondWithStatusCode(_0xc77cf6,null))[_0x4f06('0x2b')](handleError(_0xc77cf6,null));};exports[_0x4f06('0xe6')]=function(_0xdc1eaa,_0x531631,_0x5d9d89){var _0x1cfac3={};var _0x56d918={};var _0x1f354d;var _0x811b8f;return db[_0x4f06('0x3b')][_0x4f06('0x67')]({'where':{'id':_0xdc1eaa['params']['id']}})[_0x4f06('0x21')](handleEntityNotFound(_0x531631,null))['then'](function(_0xe2c1ec){if(_0xe2c1ec){_0x1f354d=_0xe2c1ec;_0x56d918[_0x4f06('0x40')]=_[_0x4f06('0x42')](db[_0x4f06('0xc6')]['rawAttributes']);_0x56d918['query']=_[_0x4f06('0x42')](_0xdc1eaa[_0x4f06('0x45')]);_0x56d918['filters']=_[_0x4f06('0x44')](_0x56d918[_0x4f06('0x40')],_0x56d918[_0x4f06('0x45')]);_0x1cfac3['attributes']=_['intersection'](_0x56d918[_0x4f06('0x40')],qs['fields'](_0xdc1eaa['query'][_0x4f06('0x46')]));_0x1cfac3[_0x4f06('0x47')]=_0x1cfac3[_0x4f06('0x47')]['length']?_0x1cfac3[_0x4f06('0x47')]:_0x56d918['model'];_0x1cfac3['order']=qs[_0x4f06('0x4b')](_0xdc1eaa['query'][_0x4f06('0x4b')]);_0x1cfac3[_0x4f06('0x4c')]=qs['filters'](_[_0x4f06('0x4d')](_0xdc1eaa[_0x4f06('0x45')],_0x56d918['filters']));if(_0xdc1eaa[_0x4f06('0x45')][_0x4f06('0x4f')]){_0x1cfac3[_0x4f06('0x4c')]=_[_0x4f06('0x50')](_0x1cfac3[_0x4f06('0x4c')],{'$or':_[_0x4f06('0x41')](_0x1cfac3[_0x4f06('0x47')],function(_0x3b6ef7){var _0x598722={};_0x598722[_0x3b6ef7]={'$like':'%'+_0xdc1eaa['query'][_0x4f06('0x4f')]+'%'};return _0x598722;})});}_0x1cfac3=_['merge']({},_0x1cfac3,_0xdc1eaa[_0x4f06('0x51')]);return _0x1f354d[_0x4f06('0xe6')](_0x1cfac3);}})[_0x4f06('0x21')](function(_0x353825){if(_0x353825){_0x811b8f=_0x353825[_0x4f06('0x48')];if(!_0xdc1eaa['query'][_0x4f06('0x49')](_0x4f06('0x68'))){_0x1cfac3['limit']=qs['limit'](_0xdc1eaa[_0x4f06('0x45')][_0x4f06('0x30')]);_0x1cfac3[_0x4f06('0x2e')]=qs[_0x4f06('0x2e')](_0xdc1eaa['query'][_0x4f06('0x2e')]);}return _0x1f354d[_0x4f06('0xe6')](_0x1cfac3);}})[_0x4f06('0x21')](function(_0x331740){if(_0x331740){return _0x331740?{'count':_0x811b8f,'rows':_0x331740}:null;}})[_0x4f06('0x21')](respondWithResult(_0x531631,null))[_0x4f06('0x2b')](handleError(_0x531631,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 820a7fa..e815112 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 _0x21d9=['../../mysqldb','SmsAccount','setMaxListeners','save','update','hasOwnProperty','hook','events'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x21d9,0x16f));var _0x921d=function(_0x2341ab,_0x326a6c){_0x2341ab=_0x2341ab-0x0;var _0x54533e=_0x21d9[_0x2341ab];return _0x54533e;};'use strict';var EventEmitter=require(_0x921d('0x0'));var SmsAccount=require(_0x921d('0x1'))['db'][_0x921d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x921d('0x3')](0x0);var events={'afterCreate':_0x921d('0x4'),'afterUpdate':_0x921d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x39eda4){return function(_0x32234f,_0x38f9cd,_0x41fb51){SmsAccountEvents['emit'](_0x39eda4+':'+_0x32234f['id'],_0x32234f);SmsAccountEvents['emit'](_0x39eda4,_0x32234f);_0x41fb51(null);};}for(var e in events){if(events[_0x921d('0x6')](e)){var event=events[e];SmsAccount[_0x921d('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xfa69=['remove','emit','hasOwnProperty','exports','events'];(function(_0x300522,_0x4562b4){var _0x536ff5=function(_0x3158b4){while(--_0x3158b4){_0x300522['push'](_0x300522['shift']());}};_0x536ff5(++_0x4562b4);}(_0xfa69,0x12b));var _0x9fa6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfa69[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x9fa6('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9fa6('0x1')};function emitEvent(_0x3fec6f){return function(_0x2c1215,_0x412f67,_0x26b531){SmsAccountEvents[_0x9fa6('0x2')](_0x3fec6f+':'+_0x2c1215['id'],_0x2c1215);SmsAccountEvents[_0x9fa6('0x2')](_0x3fec6f,_0x2c1215);_0x26b531(null);};}for(var e in events){if(events[_0x9fa6('0x3')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x9fa6('0x4')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index b8224e8..cc0c4ec 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 _0xf83f=['define','SmsAccount','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xf83f,0x162));var _0xff83=function(_0xca0940,_0x293603){_0xca0940=_0xca0940-0x0;var _0xbc10f3=_0xf83f[_0xca0940];return _0xbc10f3;};'use strict';var _=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var logger=require('../../config/logger')(_0xff83('0x2'));var moment=require(_0xff83('0x3'));var BPromise=require(_0xff83('0x4'));var rp=require(_0xff83('0x5'));var fs=require('fs');var path=require(_0xff83('0x6'));var rimraf=require('rimraf');var config=require(_0xff83('0x7'));var attributes=require('./smsAccount.attributes');module[_0xff83('0x8')]=function(_0x4d97cd,_0x1d8d4f){return _0x4d97cd[_0xff83('0x9')](_0xff83('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55c7=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5d3394,_0x5e5dce){var _0x102ca5=function(_0x40e9a9){while(--_0x40e9a9){_0x5d3394['push'](_0x5d3394['shift']());}};_0x102ca5(++_0x5e5dce);}(_0x55c7,0x191));var _0x755c=function(_0x3a2d2a,_0x20a1d5){_0x3a2d2a=_0x3a2d2a-0x0;var _0x5c2f4c=_0x55c7[_0x3a2d2a];return _0x5c2f4c;};'use strict';var _=require('lodash');var util=require(_0x755c('0x0'));var logger=require(_0x755c('0x1'))(_0x755c('0x2'));var moment=require(_0x755c('0x3'));var BPromise=require(_0x755c('0x4'));var rp=require(_0x755c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x755c('0x6'));var config=require(_0x755c('0x7'));var attributes=require(_0x755c('0x8'));module['exports']=function(_0xe102c9,_0x5a2c3f){return _0xe102c9[_0x755c('0x9')](_0x755c('0xa'),attributes,{'tableName':_0x755c('0xb'),'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 80f21f9..e6c5b02 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 _0x7c65=['SmsAccount,\x20%s,\x20%s','message','info','result','find','options','where','attributes','include','map','model','ShowSmsAccount','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3575ed,_0x3294bb){var _0x36cb29=function(_0x346b66){while(--_0x346b66){_0x3575ed['push'](_0x3575ed['shift']());}};_0x36cb29(++_0x3294bb);}(_0x7c65,0x95));var _0x57c6=function(_0x3c68b6,_0x381ac5){_0x3c68b6=_0x3c68b6-0x0;var _0x423ec7=_0x7c65[_0x3c68b6];return _0x423ec7;};'use strict';var _=require(_0x57c6('0x0'));var util=require('util');var moment=require(_0x57c6('0x1'));var BPromise=require(_0x57c6('0x2'));var rs=require(_0x57c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x57c6('0x4'));var logger=require(_0x57c6('0x5'))(_0x57c6('0x6'));var config=require(_0x57c6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57c6('0x8')][_0x57c6('0x9')]({'port':0x232a});config[_0x57c6('0xa')]=_[_0x57c6('0xb')](config[_0x57c6('0xa')],{'host':_0x57c6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57c6('0xa')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x22d75f,_0x2de272,_0x429a4e){return new BPromise(function(_0x30cb6e,_0x325a0b){return client[_0x57c6('0xd')](_0x22d75f,_0x429a4e)[_0x57c6('0xe')](function(_0x3a8be9){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2de272,_0x57c6('0xf'));logger[_0x57c6('0x10')](_0x57c6('0x11'),_0x2de272,_0x57c6('0xf'),JSON[_0x57c6('0x12')](_0x3a8be9));if(_0x3a8be9[_0x57c6('0x13')]){if(_0x3a8be9[_0x57c6('0x13')][_0x57c6('0x14')]===0x1f4){logger[_0x57c6('0x13')](_0x57c6('0x15'),_0x2de272,_0x3a8be9[_0x57c6('0x13')][_0x57c6('0x16')]);return _0x325a0b(_0x3a8be9[_0x57c6('0x13')]['message']);}logger[_0x57c6('0x13')](_0x57c6('0x15'),_0x2de272,_0x3a8be9[_0x57c6('0x13')][_0x57c6('0x16')]);return _0x30cb6e(_0x3a8be9[_0x57c6('0x13')][_0x57c6('0x16')]);}else{logger[_0x57c6('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2de272,_0x57c6('0xf'));_0x30cb6e(_0x3a8be9[_0x57c6('0x18')][_0x57c6('0x16')]);}})['catch'](function(_0x3fb152){logger[_0x57c6('0x13')]('SmsAccount,\x20%s,\x20%s',_0x2de272,_0x3fb152);_0x325a0b(_0x3fb152);});});}exports['ShowSmsAccount']=function(_0x5b8892){var _0x2147df=this;return new Promise(function(_0x1c9a20,_0xd7eefa){return db['SmsAccount'][_0x57c6('0x19')]({'raw':_0x5b8892[_0x57c6('0x1a')]?_0x5b8892[_0x57c6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5b8892[_0x57c6('0x1a')]?_0x5b8892[_0x57c6('0x1a')][_0x57c6('0x1b')]||null:null,'attributes':_0x5b8892[_0x57c6('0x1a')]?_0x5b8892[_0x57c6('0x1a')][_0x57c6('0x1c')]||null:null,'include':_0x5b8892[_0x57c6('0x1a')]?_0x5b8892[_0x57c6('0x1a')][_0x57c6('0x1d')]?_[_0x57c6('0x1e')](_0x5b8892['options']['include'],function(_0x503059){return{'model':db[_0x503059['model']],'as':_0x503059['as'],'attributes':_0x503059[_0x57c6('0x1c')],'include':_0x503059[_0x57c6('0x1d')]?_[_0x57c6('0x1e')](_0x503059['include'],function(_0x3178de){return{'model':db[_0x3178de[_0x57c6('0x1f')]],'as':_0x3178de['as'],'attributes':_0x3178de[_0x57c6('0x1c')],'include':_0x3178de['include']?_[_0x57c6('0x1e')](_0x3178de[_0x57c6('0x1d')],function(_0x52f015){return{'model':db[_0x52f015['model']],'as':_0x52f015['as'],'attributes':_0x52f015['attributes']};}):[]};}):[]};}):[]:[]})[_0x57c6('0xe')](function(_0x3f4da8){logger[_0x57c6('0x17')](_0x57c6('0x20'),_0x5b8892);logger['debug'](_0x57c6('0x20'),_0x5b8892,JSON['stringify'](_0x3f4da8));_0x1c9a20(_0x3f4da8);})[_0x57c6('0x21')](function(_0x33a06a){logger['error'](_0x57c6('0x20'),_0x33a06a[_0x57c6('0x16')],_0x5b8892);_0xd7eefa(_0x2147df['error'](0x1f4,_0x33a06a[_0x57c6('0x16')]));});});}; \ No newline at end of file +var _0xd549=['stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSmsAccount','options','raw','where','attributes','include','map','model'];(function(_0x299bb8,_0xe0eea6){var _0x3ad7f4=function(_0x7fa2ae){while(--_0x7fa2ae){_0x299bb8['push'](_0x299bb8['shift']());}};_0x3ad7f4(++_0xe0eea6);}(_0xd549,0x121));var _0x9d54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd549[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d54('0x0'));var util=require(_0x9d54('0x1'));var moment=require(_0x9d54('0x2'));var BPromise=require(_0x9d54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d54('0x4'))['db'];var utils=require(_0x9d54('0x5'));var logger=require(_0x9d54('0x6'))(_0x9d54('0x7'));var config=require(_0x9d54('0x8'));var jayson=require(_0x9d54('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9d54('0xa')]=_[_0x9d54('0xb')](config['redis'],{'host':_0x9d54('0xc'),'port':0x18eb});var socket=require(_0x9d54('0xd'))(new Redis(config['redis']));require(_0x9d54('0xe'))[_0x9d54('0xf')](socket);function respondWithRpcPromise(_0xe928e0,_0x857446,_0x48957c){return new BPromise(function(_0x5b4b90,_0x20db60){return client[_0x9d54('0x10')](_0xe928e0,_0x48957c)[_0x9d54('0x11')](function(_0x59d7a7){logger[_0x9d54('0x12')](_0x9d54('0x13'),_0x857446,_0x9d54('0x14'));logger[_0x9d54('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x857446,_0x9d54('0x14'),JSON['stringify'](_0x59d7a7));if(_0x59d7a7[_0x9d54('0x16')]){if(_0x59d7a7[_0x9d54('0x16')][_0x9d54('0x17')]===0x1f4){logger[_0x9d54('0x16')](_0x9d54('0x13'),_0x857446,_0x59d7a7['error']['message']);return _0x20db60(_0x59d7a7[_0x9d54('0x16')]['message']);}logger[_0x9d54('0x16')](_0x9d54('0x13'),_0x857446,_0x59d7a7[_0x9d54('0x16')][_0x9d54('0x18')]);return _0x5b4b90(_0x59d7a7[_0x9d54('0x16')][_0x9d54('0x18')]);}else{logger[_0x9d54('0x12')]('SmsAccount,\x20%s,\x20%s',_0x857446,_0x9d54('0x14'));_0x5b4b90(_0x59d7a7[_0x9d54('0x19')]['message']);}})[_0x9d54('0x1a')](function(_0x31aa46){logger['error'](_0x9d54('0x13'),_0x857446,_0x31aa46);_0x20db60(_0x31aa46);});});}exports[_0x9d54('0x1b')]=function(_0x5a6e1a){var _0x6d20de=this;return new Promise(function(_0x17de39,_0x32c42c){return db['SmsAccount']['find']({'raw':_0x5a6e1a[_0x9d54('0x1c')]?_0x5a6e1a[_0x9d54('0x1c')][_0x9d54('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a6e1a[_0x9d54('0x1c')]?_0x5a6e1a[_0x9d54('0x1c')][_0x9d54('0x1e')]||null:null,'attributes':_0x5a6e1a[_0x9d54('0x1c')]?_0x5a6e1a[_0x9d54('0x1c')][_0x9d54('0x1f')]||null:null,'include':_0x5a6e1a[_0x9d54('0x1c')]?_0x5a6e1a[_0x9d54('0x1c')][_0x9d54('0x20')]?_[_0x9d54('0x21')](_0x5a6e1a[_0x9d54('0x1c')]['include'],function(_0x270fb0){return{'model':db[_0x270fb0[_0x9d54('0x22')]],'as':_0x270fb0['as'],'attributes':_0x270fb0[_0x9d54('0x1f')],'include':_0x270fb0[_0x9d54('0x20')]?_[_0x9d54('0x21')](_0x270fb0[_0x9d54('0x20')],function(_0x2e2ba1){return{'model':db[_0x2e2ba1['model']],'as':_0x2e2ba1['as'],'attributes':_0x2e2ba1[_0x9d54('0x1f')],'include':_0x2e2ba1[_0x9d54('0x20')]?_[_0x9d54('0x21')](_0x2e2ba1[_0x9d54('0x20')],function(_0x1b3c36){return{'model':db[_0x1b3c36[_0x9d54('0x22')]],'as':_0x1b3c36['as'],'attributes':_0x1b3c36['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d54('0x11')](function(_0x2b16f7){logger['info'](_0x9d54('0x1b'),_0x5a6e1a);logger[_0x9d54('0x15')]('ShowSmsAccount',_0x5a6e1a,JSON[_0x9d54('0x23')](_0x2b16f7));_0x17de39(_0x2b16f7);})[_0x9d54('0x1a')](function(_0x4e577f){logger['error'](_0x9d54('0x1b'),_0x4e577f[_0x9d54('0x18')],_0x5a6e1a);_0x32c42c(_0x6d20de[_0x9d54('0x16')](0x1f4,_0x4e577f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 6251421..763bc2f 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 9567a9a..16fe814 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(_0x1f5700,_0x19a2e0){var _0x25925e=function(_0x140956){while(--_0x140956){_0x1f5700['push'](_0x1f5700['shift']());}};_0x25925e(++_0x19a2e0);}(_0xedd9,0xfc));var _0x9edd=function(_0x23a092,_0x4682ff){_0x23a092=_0x23a092-0x0;var _0xadcf39=_0xedd9[_0x23a092];return _0xadcf39;};'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(_0x52a7fd,_0x34bd2e){var _0x5485d4=function(_0x15da28){while(--_0x15da28){_0x52a7fd['push'](_0x52a7fd['shift']());}};_0x5485d4(++_0x34bd2e);}(_0xedd9,0xfc));var _0x9edd=function(_0xef72e2,_0xe2aa88){_0xef72e2=_0xef72e2-0x0;var _0x20f01a=_0xedd9[_0xef72e2];return _0x20f01a;};'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 ce59d3a..082f9ac 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 _0x057f=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x3da6e5,_0x1e2021){var _0x3ea51c=function(_0x116dcf){while(--_0x116dcf){_0x3da6e5['push'](_0x3da6e5['shift']());}};_0x3ea51c(++_0x1e2021);}(_0x057f,0x10b));var _0xf057=function(_0x4a1a85,_0x162d79){_0x4a1a85=_0x4a1a85-0x0;var _0x15f578=_0x057f[_0x4a1a85];return _0x15f578;};'use strict';var Sequelize=require(_0xf057('0x0'));module[_0xf057('0x1')]={'priority':{'type':Sequelize[_0xf057('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf057('0x3')],'allowNull':![],'defaultValue':_0xf057('0x4')},'appdata':{'type':Sequelize[_0xf057('0x5')]()},'description':{'type':Sequelize[_0xf057('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf057('0x6')}}; \ No newline at end of file +var _0xe60b=['*,*,*,*','sequelize','INTEGER','noop','STRING'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xe60b,0xf1));var _0xbe60=function(_0x3453a5,_0x1a369a){_0x3453a5=_0x3453a5-0x0;var _0x1948a6=_0xe60b[_0x3453a5];return _0x1948a6;};'use strict';var Sequelize=require(_0xbe60('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbe60('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe60('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbe60('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbe60('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 50e9354..b716b61 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 _0x4c5a=['SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','intersection','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','set','apply','reject','save','update','then','status','end','sendStatus','stack','name','send','index','map'];(function(_0x4621be,_0x4aed45){var _0x3e5b37=function(_0x303730){while(--_0x303730){_0x4621be['push'](_0x4621be['shift']());}};_0x3e5b37(++_0x4aed45);}(_0x4c5a,0x1ef));var _0xa4c5=function(_0x499099,_0x4139dd){_0x499099=_0x499099-0x0;var _0x2c6bd4=_0x4c5a[_0x499099];return _0x2c6bd4;};'use strict';var emlformat=require(_0xa4c5('0x0'));var rimraf=require(_0xa4c5('0x1'));var zipdir=require(_0xa4c5('0x2'));var jsonpatch=require(_0xa4c5('0x3'));var rp=require(_0xa4c5('0x4'));var moment=require('moment');var BPromise=require(_0xa4c5('0x5'));var Mustache=require(_0xa4c5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa4c5('0x7'));var csv=require('to-csv');var ejs=require(_0xa4c5('0x8'));var fs=require('fs');var fs_extra=require(_0xa4c5('0x9'));var _=require(_0xa4c5('0xa'));var squel=require(_0xa4c5('0xb'));var crypto=require(_0xa4c5('0xc'));var jsforce=require(_0xa4c5('0xd'));var deskjs=require(_0xa4c5('0xe'));var toCsv=require(_0xa4c5('0xf'));var querystring=require(_0xa4c5('0x10'));var Papa=require(_0xa4c5('0x11'));var Redis=require('ioredis');var authService=require(_0xa4c5('0x12'));var qs=require(_0xa4c5('0x13'));var as=require(_0xa4c5('0x14'));var hardwareService=require(_0xa4c5('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa4c5('0x16'));var config=require(_0xa4c5('0x17'));var licenseUtil=require(_0xa4c5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23ac26,_0x3d7038){_0x3d7038=_0x3d7038||0xcc;return function(_0x3e122b){if(_0x3e122b){return _0x23ac26['sendStatus'](_0x3d7038);}return _0x23ac26['status'](_0x3d7038)['end']();};}function respondWithResult(_0x3ae317,_0x525527){_0x525527=_0x525527||0xc8;return function(_0x3dc482){if(_0x3dc482){return _0x3ae317['status'](_0x525527)[_0xa4c5('0x19')](_0x3dc482);}};}function respondWithFilteredResult(_0x18f1d5,_0x185454){return function(_0x13dd07){if(_0x13dd07){var _0x2505f0=typeof _0x185454[_0xa4c5('0x1a')]===_0xa4c5('0x1b')&&typeof _0x185454[_0xa4c5('0x1c')]===_0xa4c5('0x1b');var _0x230671=_0x13dd07[_0xa4c5('0x1d')];var _0xa35496=_0x2505f0?0x0:_0x185454['offset'];var _0x2da979=_0x2505f0?_0x13dd07['count']:_0x185454[_0xa4c5('0x1a')]+_0x185454[_0xa4c5('0x1c')];var _0x201e13;if(_0x2da979>=_0x230671){_0x2da979=_0x230671;_0x201e13=0xc8;}else{_0x201e13=0xce;}_0x18f1d5['status'](_0x201e13);return _0x18f1d5[_0xa4c5('0x1e')]('Content-Range',_0xa35496+'-'+_0x2da979+'/'+_0x230671)[_0xa4c5('0x19')](_0x13dd07);}return null;};}function patchUpdates(_0x429109){return function(_0x1378d9){try{jsonpatch[_0xa4c5('0x1f')](_0x1378d9,_0x429109,!![]);}catch(_0x318f39){return BPromise[_0xa4c5('0x20')](_0x318f39);}return _0x1378d9[_0xa4c5('0x21')]();};}function saveUpdates(_0x3ee3c6,_0x3224b3){return function(_0x51e0ac){if(_0x51e0ac){return _0x51e0ac[_0xa4c5('0x22')](_0x3ee3c6)[_0xa4c5('0x23')](function(_0x5d174b){return _0x5d174b;});}return null;};}function removeEntity(_0xea1e9,_0x153b71){return function(_0x36ff22){if(_0x36ff22){return _0x36ff22['destroy']()[_0xa4c5('0x23')](function(){_0xea1e9[_0xa4c5('0x24')](0xcc)[_0xa4c5('0x25')]();});}};}function handleEntityNotFound(_0x347b0b,_0x36c249){return function(_0xee5941){if(!_0xee5941){_0x347b0b[_0xa4c5('0x26')](0x194);}return _0xee5941;};}function handleError(_0x100388,_0x1a30cf){_0x1a30cf=_0x1a30cf||0x1f4;return function(_0x169eac){logger['error'](_0x169eac[_0xa4c5('0x27')]);if(_0x169eac['name']){delete _0x169eac[_0xa4c5('0x28')];}_0x100388['status'](_0x1a30cf)[_0xa4c5('0x29')](_0x169eac);};}exports[_0xa4c5('0x2a')]=function(_0x3fd266,_0x2e1a77){var _0x4d632a={},_0x185266={},_0x5332bb={'count':0x0,'rows':[]};var _0x268dd2=_[_0xa4c5('0x2b')](db[_0xa4c5('0x2c')][_0xa4c5('0x2d')],function(_0x522884){return{'name':_0x522884[_0xa4c5('0x2e')],'type':_0x522884['type'][_0xa4c5('0x2f')]};});_0x185266[_0xa4c5('0x30')]=_[_0xa4c5('0x2b')](_0x268dd2,_0xa4c5('0x28'));_0x185266[_0xa4c5('0x31')]=_[_0xa4c5('0x32')](_0x3fd266['query']);_0x185266[_0xa4c5('0x33')]=_['intersection'](_0x185266[_0xa4c5('0x30')],_0x185266[_0xa4c5('0x31')]);_0x4d632a[_0xa4c5('0x34')]=_['intersection'](_0x185266[_0xa4c5('0x30')],qs[_0xa4c5('0x35')](_0x3fd266[_0xa4c5('0x31')][_0xa4c5('0x35')]));_0x4d632a[_0xa4c5('0x34')]=_0x4d632a[_0xa4c5('0x34')][_0xa4c5('0x36')]?_0x4d632a[_0xa4c5('0x34')]:_0x185266[_0xa4c5('0x30')];if(!_0x3fd266[_0xa4c5('0x31')][_0xa4c5('0x37')](_0xa4c5('0x38'))){_0x4d632a[_0xa4c5('0x1c')]=qs[_0xa4c5('0x1c')](_0x3fd266[_0xa4c5('0x31')]['limit']);_0x4d632a[_0xa4c5('0x1a')]=qs[_0xa4c5('0x1a')](_0x3fd266['query']['offset']);}_0x4d632a[_0xa4c5('0x39')]=qs[_0xa4c5('0x3a')](_0x3fd266['query']['sort']);_0x4d632a['where']=qs[_0xa4c5('0x33')](_[_0xa4c5('0x3b')](_0x3fd266['query'],_0x185266['filters']),_0x268dd2);if(_0x3fd266[_0xa4c5('0x31')][_0xa4c5('0x3c')]){_0x4d632a[_0xa4c5('0x3d')]=_['merge'](_0x4d632a[_0xa4c5('0x3d')],{'$or':_['map'](_0x268dd2,function(_0x3a6550){if(_0x3a6550[_0xa4c5('0x3e')]!==_0xa4c5('0x3f')){var _0x1ba8be={};_0x1ba8be[_0x3a6550[_0xa4c5('0x28')]]={'$like':'%'+_0x3fd266[_0xa4c5('0x31')][_0xa4c5('0x3c')]+'%'};return _0x1ba8be;}})});}_0x4d632a=_[_0xa4c5('0x40')]({},_0x4d632a,_0x3fd266[_0xa4c5('0x41')]);var _0x38b01c={'where':_0x4d632a['where']};return db['SmsApplication']['count'](_0x38b01c)[_0xa4c5('0x23')](function(_0x30152f){_0x5332bb['count']=_0x30152f;if(_0x3fd266[_0xa4c5('0x31')][_0xa4c5('0x42')]){_0x4d632a[_0xa4c5('0x43')]=[{'all':!![]}];}return db[_0xa4c5('0x2c')][_0xa4c5('0x44')](_0x4d632a);})['then'](function(_0x2bb5fd){_0x5332bb['rows']=_0x2bb5fd;return _0x5332bb;})[_0xa4c5('0x23')](respondWithFilteredResult(_0x2e1a77,_0x4d632a))[_0xa4c5('0x45')](handleError(_0x2e1a77,null));};exports[_0xa4c5('0x46')]=function(_0x38a4fa,_0x4d668b){var _0x4c9913={'raw':!![],'where':{'id':_0x38a4fa['params']['id']}},_0x446e6f={};_0x446e6f[_0xa4c5('0x30')]=_[_0xa4c5('0x32')](db['SmsApplication']['rawAttributes']);_0x446e6f[_0xa4c5('0x31')]=_[_0xa4c5('0x32')](_0x38a4fa[_0xa4c5('0x31')]);_0x446e6f['filters']=_['intersection'](_0x446e6f[_0xa4c5('0x30')],_0x446e6f[_0xa4c5('0x31')]);_0x4c9913['attributes']=_[_0xa4c5('0x47')](_0x446e6f[_0xa4c5('0x30')],qs[_0xa4c5('0x35')](_0x38a4fa[_0xa4c5('0x31')][_0xa4c5('0x35')]));_0x4c9913['attributes']=_0x4c9913[_0xa4c5('0x34')][_0xa4c5('0x36')]?_0x4c9913['attributes']:_0x446e6f['model'];if(_0x38a4fa[_0xa4c5('0x31')][_0xa4c5('0x42')]){_0x4c9913[_0xa4c5('0x43')]=[{'all':!![]}];}_0x4c9913=_[_0xa4c5('0x40')]({},_0x4c9913,_0x38a4fa[_0xa4c5('0x41')]);return db[_0xa4c5('0x2c')][_0xa4c5('0x48')](_0x4c9913)[_0xa4c5('0x23')](handleEntityNotFound(_0x4d668b,null))[_0xa4c5('0x23')](respondWithResult(_0x4d668b,null))[_0xa4c5('0x45')](handleError(_0x4d668b,null));};exports[_0xa4c5('0x49')]=function(_0x42b996,_0x265e24){return db['SmsApplication'][_0xa4c5('0x49')](_0x42b996[_0xa4c5('0x4a')],{})[_0xa4c5('0x23')](respondWithResult(_0x265e24,0xc9))[_0xa4c5('0x45')](handleError(_0x265e24,null));};exports[_0xa4c5('0x22')]=function(_0x1b6d8c,_0x20fb6f){if(_0x1b6d8c[_0xa4c5('0x4a')]['id']){delete _0x1b6d8c['body']['id'];}return db[_0xa4c5('0x2c')][_0xa4c5('0x48')]({'where':{'id':_0x1b6d8c[_0xa4c5('0x4b')]['id']}})[_0xa4c5('0x23')](handleEntityNotFound(_0x20fb6f,null))[_0xa4c5('0x23')](saveUpdates(_0x1b6d8c['body'],null))['then'](respondWithResult(_0x20fb6f,null))[_0xa4c5('0x45')](handleError(_0x20fb6f,null));};exports[_0xa4c5('0x4c')]=function(_0x38187b,_0x1c28f0){return db[_0xa4c5('0x2c')]['find']({'where':{'id':_0x38187b[_0xa4c5('0x4b')]['id']}})[_0xa4c5('0x23')](handleEntityNotFound(_0x1c28f0,null))[_0xa4c5('0x23')](removeEntity(_0x1c28f0,null))[_0xa4c5('0x45')](handleError(_0x1c28f0,null));}; \ No newline at end of file +var _0xf1e7=['model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','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','limit','count','status','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key'];(function(_0x4c6403,_0x121316){var _0x18d7c8=function(_0x443ccb){while(--_0x443ccb){_0x4c6403['push'](_0x4c6403['shift']());}};_0x18d7c8(++_0x121316);}(_0xf1e7,0x198));var _0x7f1e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf1e7[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require(_0x7f1e('0x0'));var rimraf=require(_0x7f1e('0x1'));var zipdir=require(_0x7f1e('0x2'));var jsonpatch=require(_0x7f1e('0x3'));var rp=require('request-promise');var moment=require(_0x7f1e('0x4'));var BPromise=require(_0x7f1e('0x5'));var Mustache=require(_0x7f1e('0x6'));var util=require(_0x7f1e('0x7'));var path=require(_0x7f1e('0x8'));var sox=require(_0x7f1e('0x9'));var csv=require(_0x7f1e('0xa'));var ejs=require(_0x7f1e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7f1e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7f1e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f1e('0xe'));var Redis=require(_0x7f1e('0xf'));var authService=require(_0x7f1e('0x10'));var qs=require(_0x7f1e('0x11'));var as=require(_0x7f1e('0x12'));var hardwareService=require(_0x7f1e('0x13'));var logger=require('../../config/logger')(_0x7f1e('0x14'));var utils=require(_0x7f1e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7f1e('0x16'));var db=require(_0x7f1e('0x17'))['db'];function respondWithStatusCode(_0x4e81e2,_0x3037dc){_0x3037dc=_0x3037dc||0xcc;return function(_0x4dac5f){if(_0x4dac5f){return _0x4e81e2[_0x7f1e('0x18')](_0x3037dc);}return _0x4e81e2['status'](_0x3037dc)[_0x7f1e('0x19')]();};}function respondWithResult(_0x54d222,_0x203034){_0x203034=_0x203034||0xc8;return function(_0x3198c4){if(_0x3198c4){return _0x54d222['status'](_0x203034)[_0x7f1e('0x1a')](_0x3198c4);}};}function respondWithFilteredResult(_0x540455,_0x2d724a){return function(_0x1a4029){if(_0x1a4029){var _0x21d20b=typeof _0x2d724a[_0x7f1e('0x1b')]===_0x7f1e('0x1c')&&typeof _0x2d724a[_0x7f1e('0x1d')]===_0x7f1e('0x1c');var _0x4ea9f8=_0x1a4029['count'];var _0x5670c9=_0x21d20b?0x0:_0x2d724a[_0x7f1e('0x1b')];var _0x5b9483=_0x21d20b?_0x1a4029[_0x7f1e('0x1e')]:_0x2d724a[_0x7f1e('0x1b')]+_0x2d724a[_0x7f1e('0x1d')];var _0x28eda9;if(_0x5b9483>=_0x4ea9f8){_0x5b9483=_0x4ea9f8;_0x28eda9=0xc8;}else{_0x28eda9=0xce;}_0x540455[_0x7f1e('0x1f')](_0x28eda9);return _0x540455[_0x7f1e('0x20')](_0x7f1e('0x21'),_0x5670c9+'-'+_0x5b9483+'/'+_0x4ea9f8)[_0x7f1e('0x1a')](_0x1a4029);}return null;};}function patchUpdates(_0x5261b7){return function(_0x11dce6){try{jsonpatch[_0x7f1e('0x22')](_0x11dce6,_0x5261b7,!![]);}catch(_0x3af59b){return BPromise['reject'](_0x3af59b);}return _0x11dce6[_0x7f1e('0x23')]();};}function saveUpdates(_0xbbfc47,_0x3d3c2a){return function(_0x13bd78){if(_0x13bd78){return _0x13bd78[_0x7f1e('0x24')](_0xbbfc47)[_0x7f1e('0x25')](function(_0x406d89){return _0x406d89;});}return null;};}function removeEntity(_0x1238b2,_0x21d594){return function(_0x472167){if(_0x472167){return _0x472167['destroy']()['then'](function(){_0x1238b2[_0x7f1e('0x1f')](0xcc)[_0x7f1e('0x19')]();});}};}function handleEntityNotFound(_0x22dce,_0x134d69){return function(_0x4b24dd){if(!_0x4b24dd){_0x22dce[_0x7f1e('0x18')](0x194);}return _0x4b24dd;};}function handleError(_0x7c8595,_0x116620){_0x116620=_0x116620||0x1f4;return function(_0x5e5798){logger[_0x7f1e('0x26')](_0x5e5798[_0x7f1e('0x27')]);if(_0x5e5798[_0x7f1e('0x28')]){delete _0x5e5798[_0x7f1e('0x28')];}_0x7c8595['status'](_0x116620)[_0x7f1e('0x29')](_0x5e5798);};}exports[_0x7f1e('0x2a')]=function(_0x369c93,_0x1e0097){var _0x326459={},_0x14fd23={},_0x2ae1a0={'count':0x0,'rows':[]};var _0x404eac=_[_0x7f1e('0x2b')](db[_0x7f1e('0x2c')][_0x7f1e('0x2d')],function(_0x254375){return{'name':_0x254375['fieldName'],'type':_0x254375[_0x7f1e('0x2e')][_0x7f1e('0x2f')]};});_0x14fd23[_0x7f1e('0x30')]=_['map'](_0x404eac,_0x7f1e('0x28'));_0x14fd23['query']=_[_0x7f1e('0x31')](_0x369c93['query']);_0x14fd23[_0x7f1e('0x32')]=_[_0x7f1e('0x33')](_0x14fd23['model'],_0x14fd23[_0x7f1e('0x34')]);_0x326459[_0x7f1e('0x35')]=_['intersection'](_0x14fd23[_0x7f1e('0x30')],qs[_0x7f1e('0x36')](_0x369c93[_0x7f1e('0x34')][_0x7f1e('0x36')]));_0x326459[_0x7f1e('0x35')]=_0x326459[_0x7f1e('0x35')][_0x7f1e('0x37')]?_0x326459[_0x7f1e('0x35')]:_0x14fd23['model'];if(!_0x369c93[_0x7f1e('0x34')]['hasOwnProperty'](_0x7f1e('0x38'))){_0x326459['limit']=qs[_0x7f1e('0x1d')](_0x369c93[_0x7f1e('0x34')][_0x7f1e('0x1d')]);_0x326459['offset']=qs[_0x7f1e('0x1b')](_0x369c93[_0x7f1e('0x34')][_0x7f1e('0x1b')]);}_0x326459[_0x7f1e('0x39')]=qs[_0x7f1e('0x3a')](_0x369c93[_0x7f1e('0x34')]['sort']);_0x326459['where']=qs[_0x7f1e('0x32')](_[_0x7f1e('0x3b')](_0x369c93['query'],_0x14fd23[_0x7f1e('0x32')]),_0x404eac);if(_0x369c93[_0x7f1e('0x34')]['filter']){_0x326459[_0x7f1e('0x3c')]=_[_0x7f1e('0x3d')](_0x326459[_0x7f1e('0x3c')],{'$or':_[_0x7f1e('0x2b')](_0x404eac,function(_0x1de7ca){if(_0x1de7ca[_0x7f1e('0x2e')]!==_0x7f1e('0x3e')){var _0x12860f={};_0x12860f[_0x1de7ca[_0x7f1e('0x28')]]={'$like':'%'+_0x369c93[_0x7f1e('0x34')][_0x7f1e('0x3f')]+'%'};return _0x12860f;}})});}_0x326459=_[_0x7f1e('0x3d')]({},_0x326459,_0x369c93[_0x7f1e('0x40')]);var _0x4bfb2b={'where':_0x326459[_0x7f1e('0x3c')]};return db[_0x7f1e('0x2c')]['count'](_0x4bfb2b)[_0x7f1e('0x25')](function(_0x20ae45){_0x2ae1a0[_0x7f1e('0x1e')]=_0x20ae45;if(_0x369c93[_0x7f1e('0x34')][_0x7f1e('0x41')]){_0x326459[_0x7f1e('0x42')]=[{'all':!![]}];}return db[_0x7f1e('0x2c')][_0x7f1e('0x43')](_0x326459);})['then'](function(_0x13402e){_0x2ae1a0[_0x7f1e('0x44')]=_0x13402e;return _0x2ae1a0;})[_0x7f1e('0x25')](respondWithFilteredResult(_0x1e0097,_0x326459))['catch'](handleError(_0x1e0097,null));};exports[_0x7f1e('0x45')]=function(_0x47d35c,_0x24406c){var _0x15b998={'raw':!![],'where':{'id':_0x47d35c[_0x7f1e('0x46')]['id']}},_0x42f144={};_0x42f144[_0x7f1e('0x30')]=_['keys'](db[_0x7f1e('0x2c')][_0x7f1e('0x2d')]);_0x42f144['query']=_[_0x7f1e('0x31')](_0x47d35c[_0x7f1e('0x34')]);_0x42f144['filters']=_[_0x7f1e('0x33')](_0x42f144['model'],_0x42f144[_0x7f1e('0x34')]);_0x15b998[_0x7f1e('0x35')]=_[_0x7f1e('0x33')](_0x42f144[_0x7f1e('0x30')],qs[_0x7f1e('0x36')](_0x47d35c[_0x7f1e('0x34')]['fields']));_0x15b998['attributes']=_0x15b998[_0x7f1e('0x35')][_0x7f1e('0x37')]?_0x15b998[_0x7f1e('0x35')]:_0x42f144[_0x7f1e('0x30')];if(_0x47d35c[_0x7f1e('0x34')][_0x7f1e('0x41')]){_0x15b998['include']=[{'all':!![]}];}_0x15b998=_[_0x7f1e('0x3d')]({},_0x15b998,_0x47d35c['options']);return db[_0x7f1e('0x2c')][_0x7f1e('0x47')](_0x15b998)[_0x7f1e('0x25')](handleEntityNotFound(_0x24406c,null))[_0x7f1e('0x25')](respondWithResult(_0x24406c,null))[_0x7f1e('0x48')](handleError(_0x24406c,null));};exports['create']=function(_0x56025b,_0xf459f5){return db[_0x7f1e('0x2c')][_0x7f1e('0x49')](_0x56025b['body'],{})[_0x7f1e('0x25')](respondWithResult(_0xf459f5,0xc9))[_0x7f1e('0x48')](handleError(_0xf459f5,null));};exports[_0x7f1e('0x24')]=function(_0x4cb86a,_0x3a81f6){if(_0x4cb86a[_0x7f1e('0x4a')]['id']){delete _0x4cb86a[_0x7f1e('0x4a')]['id'];}return db[_0x7f1e('0x2c')][_0x7f1e('0x47')]({'where':{'id':_0x4cb86a[_0x7f1e('0x46')]['id']}})[_0x7f1e('0x25')](handleEntityNotFound(_0x3a81f6,null))[_0x7f1e('0x25')](saveUpdates(_0x4cb86a[_0x7f1e('0x4a')],null))[_0x7f1e('0x25')](respondWithResult(_0x3a81f6,null))['catch'](handleError(_0x3a81f6,null));};exports[_0x7f1e('0x4b')]=function(_0x16729c,_0x29be6f){return db[_0x7f1e('0x2c')][_0x7f1e('0x47')]({'where':{'id':_0x16729c['params']['id']}})[_0x7f1e('0x25')](handleEntityNotFound(_0x29be6f,null))[_0x7f1e('0x25')](removeEntity(_0x29be6f,null))[_0x7f1e('0x48')](handleError(_0x29be6f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 0b3f095..0869311 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 _0x7cf8=['./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cf8,0x13a));var _0x87cf=function(_0x36dbe3,_0x1557ed){_0x36dbe3=_0x36dbe3-0x0;var _0x560dcb=_0x7cf8[_0x36dbe3];return _0x560dcb;};'use strict';var _=require(_0x87cf('0x0'));var util=require(_0x87cf('0x1'));var logger=require(_0x87cf('0x2'))(_0x87cf('0x3'));var moment=require(_0x87cf('0x4'));var BPromise=require(_0x87cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87cf('0x6'));var rimraf=require(_0x87cf('0x7'));var config=require('../../config/environment');var attributes=require(_0x87cf('0x8'));module[_0x87cf('0x9')]=function(_0x3bd3e0,_0x2c90ad){return _0x3bd3e0['define'](_0x87cf('0xa'),attributes,{'tableName':_0x87cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87cf('0xc'),'collate':_0x87cf('0xd')});}; \ No newline at end of file +var _0x01d8=['util','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x329067,_0x24c60f){var _0x3f4ef4=function(_0x46d674){while(--_0x46d674){_0x329067['push'](_0x329067['shift']());}};_0x3f4ef4(++_0x24c60f);}(_0x01d8,0x1c6));var _0x801d=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x01d8[_0x55cc58];return _0x26062e;};'use strict';var _=require(_0x801d('0x0'));var util=require(_0x801d('0x1'));var logger=require('../../config/logger')(_0x801d('0x2'));var moment=require(_0x801d('0x3'));var BPromise=require(_0x801d('0x4'));var rp=require(_0x801d('0x5'));var fs=require('fs');var path=require(_0x801d('0x6'));var rimraf=require(_0x801d('0x7'));var config=require('../../config/environment');var attributes=require(_0x801d('0x8'));module['exports']=function(_0x3213e9,_0x24c42a){return _0x3213e9[_0x801d('0x9')](_0x801d('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x801d('0xb'),'collate':_0x801d('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3378561..8d99f32 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 _0x056b=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0x056b,0xb6));var _0xb056=function(_0x342afb,_0x68c265){_0x342afb=_0x342afb-0x0;var _0x446112=_0x056b[_0x342afb];return _0x446112;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('SmsApplication,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('SmsApplication,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('SmsApplication,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});} \ No newline at end of file +var _0xd48e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsApplication,\x20%s,\x20%s','message','catch'];(function(_0x2189f2,_0x42428e){var _0x28362b=function(_0x1cec8){while(--_0x1cec8){_0x2189f2['push'](_0x2189f2['shift']());}};_0x28362b(++_0x42428e);}(_0xd48e,0x93));var _0xed48=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xd48e[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require('lodash');var util=require(_0xed48('0x0'));var moment=require(_0xed48('0x1'));var BPromise=require(_0xed48('0x2'));var rs=require(_0xed48('0x3'));var fs=require('fs');var Redis=require(_0xed48('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed48('0x5'));var logger=require(_0xed48('0x6'))(_0xed48('0x7'));var config=require('../../config/environment');var jayson=require(_0xed48('0x8'));var client=jayson[_0xed48('0x9')][_0xed48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b4ce,_0x2cc522,_0x1c9299){return new BPromise(function(_0x52a5e2,_0x5f0f1b){return client['request'](_0x50b4ce,_0x1c9299)[_0xed48('0xb')](function(_0x28096a){logger[_0xed48('0xc')]('SmsApplication,\x20%s,\x20%s',_0x2cc522,'request\x20sent');logger[_0xed48('0xd')](_0xed48('0xe'),_0x2cc522,_0xed48('0xf'),JSON['stringify'](_0x28096a));if(_0x28096a[_0xed48('0x10')]){if(_0x28096a[_0xed48('0x10')][_0xed48('0x11')]===0x1f4){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x5f0f1b(_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);}logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x52a5e2(_0x28096a['error'][_0xed48('0x13')]);}else{logger['info'](_0xed48('0x12'),_0x2cc522,'request\x20sent');_0x52a5e2(_0x28096a['result'][_0xed48('0x13')]);}})[_0xed48('0x14')](function(_0x3dd77d){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x3dd77d);_0x5f0f1b(_0x3dd77d);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e9c3b37..0810e86 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 _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x34b7,0x196));var _0x734b=function(_0x7b17fe,_0x1233ff){_0x7b17fe=_0x7b17fe-0x0;var _0x5215be=_0x34b7[_0x7b17fe];return _0x5215be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file +var _0xb03e=['exports','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','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x3f23fc,_0x50a770){var _0x5e66f8=function(_0xc7b415){while(--_0xc7b415){_0x3f23fc['push'](_0x3f23fc['shift']());}};_0x5e66f8(++_0x50a770);}(_0xb03e,0x1eb));var _0xeb03=function(_0x6b17fd,_0x4fb143){_0x6b17fd=_0x6b17fd-0x0;var _0x325f8c=_0xb03e[_0x6b17fd];return _0x325f8c;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 45cafb6..30d73bf 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 _0xd6f9=['ENUM','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xd6f9[_0x16de68];return _0x1c277e;};'use strict';var Sequelize=require(_0x9d6f('0x0'));var moment=require(_0x9d6f('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9d6f('0x2')]},'disposition':{'type':Sequelize[_0x9d6f('0x3')]},'secondDisposition':{'type':Sequelize[_0x9d6f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9d6f('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9d6f('0x3')]},'read1stAt':{'type':Sequelize[_0x9d6f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x9d6f('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9d6f('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9d6f('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xef4d=['BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize','moment','exports'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0xef4d,0x165));var _0xdef4=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xef4d[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0xdef4('0x0'));var moment=require(_0xdef4('0x1'));module[_0xdef4('0x2')]={'closed':{'type':Sequelize[_0xdef4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdef4('0x4')]},'disposition':{'type':Sequelize[_0xdef4('0x5')]},'secondDisposition':{'type':Sequelize[_0xdef4('0x5')]},'thirdDisposition':{'type':Sequelize[_0xdef4('0x5')]},'note':{'type':Sequelize[_0xdef4('0x5')]},'phone':{'type':Sequelize[_0xdef4('0x5')]},'read1stAt':{'type':Sequelize[_0xdef4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdef4('0x6')]('in',_0xdef4('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xdef4('0x6')]('in',_0xdef4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdef4('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xdef4('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b96f18c..88b33a7 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 _0xfe73=['merge','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','rawAttributes','filters','nolimit','order','sort','where','pick','SmsInteractionId','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','files','tmp','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','direction','read','SmsAccount','Owner','get','N.A.','createdAt','closed','closedAt','out','System','secret','value','renderFile','server','views','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','ejs','lodash','../../components/parsers/qs','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','fieldName','getOptions','findAll','sms','query','user','catch','params','model','keys','intersection','attributes','fields','length','includeAll'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0xfe73,0x12f));var _0x3fe7=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xfe73[_0x31a371];return _0x2a5bd6;};'use strict';var rimraf=require(_0x3fe7('0x0'));var zipdir=require(_0x3fe7('0x1'));var moment=require(_0x3fe7('0x2'));var BPromise=require(_0x3fe7('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x3fe7('0x4'));var fs=require('fs');var _=require(_0x3fe7('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x3fe7('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x3fe7('0x7'))['db'];config['redis']=_[_0x3fe7('0x8')](config[_0x3fe7('0x9')],{'host':_0x3fe7('0xa'),'port':0x18eb});var socket=require(_0x3fe7('0xb'))(new Redis(config[_0x3fe7('0x9')]));require('./smsInteraction.socket')[_0x3fe7('0xc')](socket);function respondWithStatusCode(_0x5edc48,_0x5b3f66){_0x5b3f66=_0x5b3f66||0xcc;return function(_0x351a8a){if(_0x351a8a){return _0x5edc48[_0x3fe7('0xd')](_0x5b3f66);}return _0x5edc48[_0x3fe7('0xe')](_0x5b3f66)[_0x3fe7('0xf')]();};}function respondWithResult(_0x346f2c,_0x39ab0f){_0x39ab0f=_0x39ab0f||0xc8;return function(_0x3dddaa){if(_0x3dddaa){return _0x346f2c['status'](_0x39ab0f)[_0x3fe7('0x10')](_0x3dddaa);}};}function respondWithFilteredResult(_0x5ed9a1,_0x9f3d5b){return function(_0xd792a5){if(_0xd792a5){var _0x309260=typeof _0x9f3d5b[_0x3fe7('0x11')]==='undefined'&&typeof _0x9f3d5b[_0x3fe7('0x12')]===_0x3fe7('0x13');var _0x1e6f0b=_0xd792a5[_0x3fe7('0x14')];var _0x2e8076=_0x309260?0x0:_0x9f3d5b[_0x3fe7('0x11')];var _0xe1c88a=_0x309260?_0xd792a5[_0x3fe7('0x14')]:_0x9f3d5b[_0x3fe7('0x11')]+_0x9f3d5b[_0x3fe7('0x12')];var _0x489913;if(_0xe1c88a>=_0x1e6f0b){_0xe1c88a=_0x1e6f0b;_0x489913=0xc8;}else{_0x489913=0xce;}_0x5ed9a1[_0x3fe7('0xe')](_0x489913);return _0x5ed9a1[_0x3fe7('0x15')](_0x3fe7('0x16'),_0x2e8076+'-'+_0xe1c88a+'/'+_0x1e6f0b)['json'](_0xd792a5);}return null;};}function saveUpdates(_0x41711e){return function(_0xae37d3){if(_0xae37d3){return _0xae37d3[_0x3fe7('0x17')](_0x41711e)[_0x3fe7('0x18')](function(_0x4d98f7){return _0x4d98f7;});}return null;};}function removeEntity(_0x550c84){return function(_0xc7d300){if(_0xc7d300){return _0xc7d300[_0x3fe7('0x19')]()[_0x3fe7('0x18')](function(){_0x550c84['status'](0xcc)[_0x3fe7('0xf')]();});}};}function handleEntityNotFound(_0x1067d1){return function(_0x46021c){if(!_0x46021c){_0x1067d1['sendStatus'](0x194);}return _0x46021c;};}function handleError(_0x57d937,_0x133dcf){_0x133dcf=_0x133dcf||0x1f4;return function(_0x3ad457){logger[_0x3fe7('0x1a')](_0x3ad457[_0x3fe7('0x1b')]);if(_0x3ad457[_0x3fe7('0x1c')]){delete _0x3ad457[_0x3fe7('0x1c')];}_0x57d937[_0x3fe7('0xe')](_0x133dcf)[_0x3fe7('0x1d')](_0x3ad457);};}exports[_0x3fe7('0x1e')]=function(_0x55142e,_0x57958e){var _0x24f9f7={};var _0x423132=_[_0x3fe7('0x1f')](db[_0x3fe7('0x20')]['rawAttributes'],function(_0x37f6d){return{'name':_0x37f6d[_0x3fe7('0x21')],'type':_0x37f6d['type']['key']};});_0x24f9f7=qs[_0x3fe7('0x22')](_0x423132,_0x55142e);return interaction[_0x3fe7('0x23')](_0x3fe7('0x24'),_0x55142e[_0x3fe7('0x25')],_0x55142e[_0x3fe7('0x26')],_0x24f9f7,_0x423132)[_0x3fe7('0x18')](respondWithFilteredResult(_0x57958e,_0x24f9f7))[_0x3fe7('0x27')](handleError(_0x57958e,null));};exports['show']=function(_0x1f574d,_0xeceebe){var _0x5179ac={'raw':![],'where':{'id':_0x1f574d[_0x3fe7('0x28')]['id']}},_0x3cfa7c={};_0x3cfa7c[_0x3fe7('0x29')]=_[_0x3fe7('0x2a')](db[_0x3fe7('0x20')]['rawAttributes']);_0x3cfa7c[_0x3fe7('0x25')]=_[_0x3fe7('0x2a')](_0x1f574d[_0x3fe7('0x25')]);_0x3cfa7c['filters']=_[_0x3fe7('0x2b')](_0x3cfa7c[_0x3fe7('0x29')],_0x3cfa7c[_0x3fe7('0x25')]);_0x5179ac[_0x3fe7('0x2c')]=_[_0x3fe7('0x2b')](_0x3cfa7c['model'],qs[_0x3fe7('0x2d')](_0x1f574d[_0x3fe7('0x25')][_0x3fe7('0x2d')]));_0x5179ac[_0x3fe7('0x2c')]=_0x5179ac[_0x3fe7('0x2c')][_0x3fe7('0x2e')]?_0x5179ac[_0x3fe7('0x2c')]:_0x3cfa7c['model'];if(_0x1f574d['query'][_0x3fe7('0x2f')]){_0x5179ac['include']=[{'all':!![]}];}_0x5179ac=_[_0x3fe7('0x30')]({},_0x5179ac,_0x1f574d[_0x3fe7('0x31')]);return db[_0x3fe7('0x20')][_0x3fe7('0x32')](_0x5179ac)['then'](handleEntityNotFound(_0xeceebe,null))[_0x3fe7('0x18')](respondWithResult(_0xeceebe,null))[_0x3fe7('0x27')](handleError(_0xeceebe,null));};exports[_0x3fe7('0x33')]=function(_0x16b16b,_0x5c12b0){return db[_0x3fe7('0x20')]['create'](_0x16b16b[_0x3fe7('0x34')],{})[_0x3fe7('0x18')](respondWithResult(_0x5c12b0,0xc9))[_0x3fe7('0x27')](handleError(_0x5c12b0,null));};exports['update']=function(_0xe76e85,_0x5b5e21){if(_0xe76e85[_0x3fe7('0x34')]['id']){delete _0xe76e85[_0x3fe7('0x34')]['id'];}return db[_0x3fe7('0x20')][_0x3fe7('0x32')]({'where':{'id':_0xe76e85['params']['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x5b5e21,null))['then'](saveUpdates(_0xe76e85['body'],null))[_0x3fe7('0x18')](respondWithResult(_0x5b5e21,null))[_0x3fe7('0x27')](handleError(_0x5b5e21,null));};exports[_0x3fe7('0x19')]=function(_0x19768d,_0x6d7a3c){return db[_0x3fe7('0x20')][_0x3fe7('0x32')]({'where':{'id':_0x19768d['params']['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x6d7a3c,null))[_0x3fe7('0x18')](removeEntity(_0x6d7a3c,null))['catch'](handleError(_0x6d7a3c,null));};exports[_0x3fe7('0x35')]=function(_0x2fbd8d,_0x358123){return db[_0x3fe7('0x20')][_0x3fe7('0x35')]()['then'](respondWithResult(_0x358123,null))[_0x3fe7('0x27')](handleError(_0x358123,null));};exports[_0x3fe7('0x36')]=function(_0x21ac64,_0x58124f){return db[_0x3fe7('0x37')][_0x3fe7('0x32')]({'where':{'id':_0x21ac64['params']['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x58124f,null))[_0x3fe7('0x18')](function(_0x2ea61b){if(_0x2ea61b){return _0x2ea61b[_0x3fe7('0x36')](_0x21ac64['body'][_0x3fe7('0x38')],_[_0x3fe7('0x39')](_0x21ac64[_0x3fe7('0x34')],['ids','id'])||{});}})['then'](respondWithResult(_0x58124f,null))[_0x3fe7('0x27')](handleError(_0x58124f,null));};exports['getMessages']=function(_0x185ee4,_0x4e014d){var _0x43952f={'raw':![],'where':{}};var _0x216430={};var _0x26143a={'count':0x0,'rows':[]};return db[_0x3fe7('0x20')][_0x3fe7('0x3a')]({'where':{'id':_0x185ee4['params']['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x4e014d,null))[_0x3fe7('0x18')](function(_0x63c351){if(_0x63c351){_0x216430[_0x3fe7('0x29')]=_[_0x3fe7('0x2a')](db[_0x3fe7('0x37')][_0x3fe7('0x3b')]);_0x216430['query']=_['keys'](_0x185ee4[_0x3fe7('0x25')]);_0x216430[_0x3fe7('0x3c')]=_['intersection'](_0x216430[_0x3fe7('0x29')],_0x216430['query']);_0x43952f[_0x3fe7('0x2c')]=_[_0x3fe7('0x2b')](_0x216430[_0x3fe7('0x29')],qs['fields'](_0x185ee4['query'][_0x3fe7('0x2d')]));_0x43952f['attributes']=_0x43952f[_0x3fe7('0x2c')][_0x3fe7('0x2e')]?_0x43952f[_0x3fe7('0x2c')]:_0x216430[_0x3fe7('0x29')];if(!_0x185ee4[_0x3fe7('0x25')]['hasOwnProperty'](_0x3fe7('0x3d'))){_0x43952f[_0x3fe7('0x12')]=qs[_0x3fe7('0x12')](_0x185ee4[_0x3fe7('0x25')][_0x3fe7('0x12')]);_0x43952f[_0x3fe7('0x11')]=qs[_0x3fe7('0x11')](_0x185ee4[_0x3fe7('0x25')][_0x3fe7('0x11')]);}_0x43952f[_0x3fe7('0x3e')]=qs[_0x3fe7('0x3f')](_0x185ee4['query']['sort']);_0x43952f[_0x3fe7('0x40')]=qs[_0x3fe7('0x3c')](_[_0x3fe7('0x41')](_0x185ee4[_0x3fe7('0x25')],_0x216430[_0x3fe7('0x3c')]));_0x43952f[_0x3fe7('0x40')][_0x3fe7('0x42')]=_0x63c351['id'];if(_0x185ee4[_0x3fe7('0x25')]['filter']){_0x43952f[_0x3fe7('0x40')]=_[_0x3fe7('0x30')](_0x43952f[_0x3fe7('0x40')],{'$or':_[_0x3fe7('0x1f')](_0x43952f[_0x3fe7('0x2c')],function(_0x405579){var _0x1e36e8={};_0x1e36e8[_0x405579]={'$like':'%'+_0x185ee4[_0x3fe7('0x25')]['filter']+'%'};return _0x1e36e8;})});}if(_0x185ee4[_0x3fe7('0x25')]['$gte']){var _0x12ee8f=_0x185ee4[_0x3fe7('0x25')]['$gte'][_0x3fe7('0x43')](',');var _0x25b8b0={};_0x25b8b0[_0x12ee8f[0x0]]={'$gte':moment(_0x12ee8f[0x1])[_0x3fe7('0x44')](_0x3fe7('0x45'))};_0x43952f[_0x3fe7('0x40')]=_[_0x3fe7('0x30')](_0x43952f[_0x3fe7('0x40')],_0x25b8b0);}_0x43952f=_[_0x3fe7('0x30')]({},_0x43952f,_0x185ee4['options']);return db[_0x3fe7('0x37')][_0x3fe7('0x14')]({'where':_0x43952f[_0x3fe7('0x40')]})[_0x3fe7('0x18')](function(_0xce7e26){_0x26143a['count']=_0xce7e26;if(_0x185ee4['query']['includeAll']){_0x43952f[_0x3fe7('0x46')]=[{'all':!![]}];}return db[_0x3fe7('0x37')]['findAll'](_0x43952f);})[_0x3fe7('0x18')](function(_0x58c934){_0x26143a[_0x3fe7('0x47')]=_0x58c934;return _0x26143a;});}})[_0x3fe7('0x18')](respondWithFilteredResult(_0x4e014d,_0x43952f))[_0x3fe7('0x27')](handleError(_0x4e014d,null));};exports[_0x3fe7('0x48')]=function(_0x32cfcf,_0x21c054){return db['SmsInteraction'][_0x3fe7('0x32')]({'where':{'id':_0x32cfcf[_0x3fe7('0x28')]['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x21c054,null))['then'](function(_0x5018ad){if(_0x5018ad){return _0x5018ad[_0x3fe7('0x49')](_0x32cfcf[_0x3fe7('0x34')]['ids'],_[_0x3fe7('0x39')](_0x32cfcf[_0x3fe7('0x34')],[_0x3fe7('0x38'),'id'])||{})[_0x3fe7('0x4a')](function(){return db[_0x3fe7('0x4b')]['findAll']({'attributes':['id',_0x3fe7('0x1c'),_0x3fe7('0x4c')],'where':{'id':_0x32cfcf[_0x3fe7('0x34')][_0x3fe7('0x38')]}});})[_0x3fe7('0x18')](function(_0x5c11d8){socket[_0x3fe7('0x4d')](_0x3fe7('0x4e'),{'id':Number(_0x32cfcf[_0x3fe7('0x28')]['id']),'tags':_0x5c11d8||[]});return{'id':Number(_0x32cfcf[_0x3fe7('0x28')]['id']),'tags':_0x5c11d8||[]};});}})[_0x3fe7('0x18')](respondWithResult(_0x21c054,null))[_0x3fe7('0x27')](handleError(_0x21c054,null));};exports[_0x3fe7('0x4f')]=function(_0x151374,_0x5a6b71){return db[_0x3fe7('0x20')]['find']({'where':{'id':_0x151374[_0x3fe7('0x28')]['id']}})[_0x3fe7('0x18')](handleEntityNotFound(_0x5a6b71,null))[_0x3fe7('0x18')](function(_0x33170f){if(_0x33170f){return _0x33170f[_0x3fe7('0x4f')](_0x151374['query'][_0x3fe7('0x38')]);}})['then'](respondWithStatusCode(_0x5a6b71,null))['catch'](handleError(_0x5a6b71,null));};exports[_0x3fe7('0x50')]=function(_0x5c9e8d,_0x41494c){var _0x22316f=moment()['unix']()[_0x3fe7('0x51')]();var _0x194f94=path[_0x3fe7('0x52')](config[_0x3fe7('0x53')],'server',_0x3fe7('0x54'),_0x3fe7('0x55'));var _0x4f279c=path[_0x3fe7('0x52')](_0x194f94,_0x22316f);var _0x447667=util[_0x3fe7('0x44')](_0x3fe7('0x56'),_0x5c9e8d['params']['id'],_0x22316f);var _0xf00999=path[_0x3fe7('0x52')](_0x194f94,_0x447667);var _0x4c2072=[];_0x4c2072['push']({'model':db[_0x3fe7('0x57')],'as':_0x3fe7('0x57'),'attributes':['id',_0x3fe7('0x58')],'raw':!![]});_0x4c2072[_0x3fe7('0x59')]({'model':db[_0x3fe7('0x5a')],'as':_0x3fe7('0x5b'),'attributes':['id',_0x3fe7('0x5c'),_0x3fe7('0x5d')],'raw':!![]});var _0x738c9b=[{'model':db[_0x3fe7('0x37')],'as':_0x3fe7('0x5e'),'attributes':['id',_0x3fe7('0x34'),'createdAt',_0x3fe7('0x5f'),'secret',_0x3fe7('0x60')],'include':_0x4c2072}];_0x738c9b[_0x3fe7('0x59')]({'model':db[_0x3fe7('0x61')],'as':'Account','attributes':['id',_0x3fe7('0x1c')]});_0x738c9b[_0x3fe7('0x59')]({'model':db[_0x3fe7('0x57')],'as':_0x3fe7('0x62'),'attributes':['id',_0x3fe7('0x58')]});return db[_0x3fe7('0x20')]['find']({'where':{'id':_0x5c9e8d['params']['id']},'include':_0x738c9b})['then'](handleEntityNotFound(_0x41494c,null))[_0x3fe7('0x18')](function(_0x8025b6){if(_0x8025b6){var _0x40e396=_0x8025b6[_0x3fe7('0x63')]({'plain':!![]});fs['mkdirSync'](_0x4f279c);var _0x267440={'channel':'Sms','account':_0x40e396['Account']['name'],'agent':_0x40e396[_0x3fe7('0x62')]?_0x40e396[_0x3fe7('0x62')][_0x3fe7('0x58')]:_0x3fe7('0x64'),'createdAt':moment(_0x40e396[_0x3fe7('0x65')])[_0x3fe7('0x44')](_0x3fe7('0x45'))['toString'](),'closedAt':_0x40e396[_0x3fe7('0x66')]?moment(_0x40e396[_0x3fe7('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3fe7('0x51')]():'','disposition':_0x40e396['disposition'],'messages':_(_0x40e396[_0x3fe7('0x5e')])['filter']({'secret':![]})[_0x3fe7('0x1f')](function(_0x575711){return{'date':moment(_0x575711['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x575711['direction']===_0x3fe7('0x68')?_0x575711['User']?_0x575711[_0x3fe7('0x57')]['fullname']:_0x3fe7('0x69'):_0x575711['Contact'][_0x3fe7('0x5c')]+(_0x575711[_0x3fe7('0x5b')]['lastName']?'\x20'+_0x575711[_0x3fe7('0x5b')][_0x3fe7('0x5d')]:''),'body':_0x575711[_0x3fe7('0x34')],'direction':_0x575711[_0x3fe7('0x5f')]===_0x3fe7('0x68')?'A':'C','secret':_0x575711[_0x3fe7('0x6a')],'read':_0x575711[_0x3fe7('0x60')]};})[_0x3fe7('0x6b')]()};return ejs[_0x3fe7('0x6c')](path[_0x3fe7('0x52')](config[_0x3fe7('0x53')],_0x3fe7('0x6d'),_0x3fe7('0x6e'),_0x3fe7('0x6f')),{'interaction':_0x267440})[_0x3fe7('0x18')](function(_0x209bae){var _0x305c03=path[_0x3fe7('0x52')](_0x4f279c,'transcript-'+_0x40e396['id']+'-'+_0x22316f+_0x3fe7('0x70'));var _0x3b1da4={'path':_0x305c03,'channel':_0x3fe7('0x71'),'interactionId':_0x40e396['id']};return pdf[_0x3fe7('0x72')](_0x209bae,_0x3b1da4);})['then'](function(){return new BPromise(function(_0x9aab07,_0x42a21a){zipdir(_0x4f279c,{'saveTo':_0xf00999},function(_0xf6c15,_0x200b42){if(_0xf6c15)return _0x42a21a(_0xf6c15);return _0x9aab07(_0x200b42);});})['then'](function(){return new BPromise(function(_0x130478,_0x17f6d4){rimraf(_0x4f279c,function(_0x59d4cd){if(_0x59d4cd)_0x17f6d4(_0x59d4cd);return _0x130478();});});})[_0x3fe7('0x18')](function(){return _0x41494c[_0x3fe7('0x50')](_0xf00999,_0x447667,function(_0x33a220){if(_0x33a220){console['log'](_0x3fe7('0x73'),_0x33a220);}else{fs[_0x3fe7('0x74')](_0xf00999);}});});});}else{return _0x41494c[_0x3fe7('0xd')](0xc8);}})[_0x3fe7('0x27')](handleError(_0x41494c,null));}; \ No newline at end of file +var _0xfcfc=['secret','read','SmsAccount','Account','Owner','fullname','get','mkdirSync','N.A.','closed','closedAt','disposition','System','Contact','out','renderFile','root','views','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','util','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','SmsInteraction','body','describe','ids','omit','getMessages','SmsMessage','hasOwnProperty','order','sort','where','pick','SmsInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','User','push','firstName','lastName','Messages','createdAt','direction'];(function(_0x27f38d,_0x1a5e24){var _0x19a504=function(_0x33c85b){while(--_0x33c85b){_0x27f38d['push'](_0x27f38d['shift']());}};_0x19a504(++_0x1a5e24);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x2ef976,_0x4ba238){_0x2ef976=_0x2ef976-0x0;var _0x1d34ae=_0xfcfc[_0x2ef976];return _0x1d34ae;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcfcf('0x0'));var moment=require(_0xcfcf('0x1'));var BPromise=require(_0xcfcf('0x2'));var util=require(_0xcfcf('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xcfcf('0x4'));var interaction=require(_0xcfcf('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0xcfcf('0x6'));var logger=require(_0xcfcf('0x7'))(_0xcfcf('0x8'));var config=require(_0xcfcf('0x9'));var db=require(_0xcfcf('0xa'))['db'];config[_0xcfcf('0xb')]=_['defaults'](config[_0xcfcf('0xb')],{'host':_0xcfcf('0xc'),'port':0x18eb});var socket=require(_0xcfcf('0xd'))(new Redis(config[_0xcfcf('0xb')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x35d88d,_0x1833f7){_0x1833f7=_0x1833f7||0xcc;return function(_0x4eade5){if(_0x4eade5){return _0x35d88d[_0xcfcf('0xe')](_0x1833f7);}return _0x35d88d[_0xcfcf('0xf')](_0x1833f7)[_0xcfcf('0x10')]();};}function respondWithResult(_0x4adf26,_0x15c9ce){_0x15c9ce=_0x15c9ce||0xc8;return function(_0x413135){if(_0x413135){return _0x4adf26[_0xcfcf('0xf')](_0x15c9ce)[_0xcfcf('0x11')](_0x413135);}};}function respondWithFilteredResult(_0x16f5d0,_0x3c1101){return function(_0x1709cc){if(_0x1709cc){var _0x106d18=typeof _0x3c1101[_0xcfcf('0x12')]==='undefined'&&typeof _0x3c1101[_0xcfcf('0x13')]==='undefined';var _0x3aba49=_0x1709cc[_0xcfcf('0x14')];var _0x1f88a7=_0x106d18?0x0:_0x3c1101[_0xcfcf('0x12')];var _0x1bcd69=_0x106d18?_0x1709cc['count']:_0x3c1101[_0xcfcf('0x12')]+_0x3c1101['limit'];var _0x31c1ec;if(_0x1bcd69>=_0x3aba49){_0x1bcd69=_0x3aba49;_0x31c1ec=0xc8;}else{_0x31c1ec=0xce;}_0x16f5d0[_0xcfcf('0xf')](_0x31c1ec);return _0x16f5d0['set']('Content-Range',_0x1f88a7+'-'+_0x1bcd69+'/'+_0x3aba49)['json'](_0x1709cc);}return null;};}function saveUpdates(_0x42b955){return function(_0x1dfb30){if(_0x1dfb30){return _0x1dfb30[_0xcfcf('0x15')](_0x42b955)[_0xcfcf('0x16')](function(_0x5aecc9){return _0x5aecc9;});}return null;};}function removeEntity(_0x166715){return function(_0x2299c0){if(_0x2299c0){return _0x2299c0['destroy']()[_0xcfcf('0x16')](function(){_0x166715[_0xcfcf('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dbfff){return function(_0x3d9670){if(!_0x3d9670){_0x4dbfff['sendStatus'](0x194);}return _0x3d9670;};}function handleError(_0x2ff9fc,_0x274fc7){_0x274fc7=_0x274fc7||0x1f4;return function(_0x796972){logger[_0xcfcf('0x17')](_0x796972[_0xcfcf('0x18')]);if(_0x796972[_0xcfcf('0x19')]){delete _0x796972[_0xcfcf('0x19')];}_0x2ff9fc['status'](_0x274fc7)[_0xcfcf('0x1a')](_0x796972);};}exports[_0xcfcf('0x1b')]=function(_0x36b64d,_0x450d24){var _0x3668fa={};var _0x3bda0d=_[_0xcfcf('0x1c')](db['SmsInteraction'][_0xcfcf('0x1d')],function(_0x33a96a){return{'name':_0x33a96a[_0xcfcf('0x1e')],'type':_0x33a96a['type'][_0xcfcf('0x1f')]};});_0x3668fa=qs[_0xcfcf('0x20')](_0x3bda0d,_0x36b64d);return interaction[_0xcfcf('0x21')](_0xcfcf('0x22'),_0x36b64d[_0xcfcf('0x23')],_0x36b64d[_0xcfcf('0x24')],_0x3668fa,_0x3bda0d)[_0xcfcf('0x16')](respondWithFilteredResult(_0x450d24,_0x3668fa))[_0xcfcf('0x25')](handleError(_0x450d24,null));};exports[_0xcfcf('0x26')]=function(_0x2c7baa,_0x39f654){var _0x231db2={'raw':![],'where':{'id':_0x2c7baa[_0xcfcf('0x27')]['id']}},_0x311a4c={};_0x311a4c[_0xcfcf('0x28')]=_[_0xcfcf('0x29')](db['SmsInteraction'][_0xcfcf('0x1d')]);_0x311a4c[_0xcfcf('0x23')]=_['keys'](_0x2c7baa[_0xcfcf('0x23')]);_0x311a4c[_0xcfcf('0x2a')]=_[_0xcfcf('0x2b')](_0x311a4c[_0xcfcf('0x28')],_0x311a4c[_0xcfcf('0x23')]);_0x231db2[_0xcfcf('0x2c')]=_[_0xcfcf('0x2b')](_0x311a4c['model'],qs[_0xcfcf('0x2d')](_0x2c7baa[_0xcfcf('0x23')]['fields']));_0x231db2[_0xcfcf('0x2c')]=_0x231db2[_0xcfcf('0x2c')][_0xcfcf('0x2e')]?_0x231db2[_0xcfcf('0x2c')]:_0x311a4c[_0xcfcf('0x28')];if(_0x2c7baa[_0xcfcf('0x23')][_0xcfcf('0x2f')]){_0x231db2['include']=[{'all':!![]}];}_0x231db2=_['merge']({},_0x231db2,_0x2c7baa[_0xcfcf('0x30')]);return db['SmsInteraction'][_0xcfcf('0x31')](_0x231db2)[_0xcfcf('0x16')](handleEntityNotFound(_0x39f654,null))[_0xcfcf('0x16')](respondWithResult(_0x39f654,null))[_0xcfcf('0x25')](handleError(_0x39f654,null));};exports[_0xcfcf('0x32')]=function(_0x362307,_0x547e7e){return db[_0xcfcf('0x33')][_0xcfcf('0x32')](_0x362307['body'],{})['then'](respondWithResult(_0x547e7e,0xc9))[_0xcfcf('0x25')](handleError(_0x547e7e,null));};exports[_0xcfcf('0x15')]=function(_0x2a1373,_0x59cb2f){if(_0x2a1373[_0xcfcf('0x34')]['id']){delete _0x2a1373[_0xcfcf('0x34')]['id'];}return db[_0xcfcf('0x33')][_0xcfcf('0x31')]({'where':{'id':_0x2a1373[_0xcfcf('0x27')]['id']}})[_0xcfcf('0x16')](handleEntityNotFound(_0x59cb2f,null))[_0xcfcf('0x16')](saveUpdates(_0x2a1373[_0xcfcf('0x34')],null))['then'](respondWithResult(_0x59cb2f,null))[_0xcfcf('0x25')](handleError(_0x59cb2f,null));};exports['destroy']=function(_0x37e22c,_0x1ca954){return db[_0xcfcf('0x33')][_0xcfcf('0x31')]({'where':{'id':_0x37e22c['params']['id']}})[_0xcfcf('0x16')](handleEntityNotFound(_0x1ca954,null))[_0xcfcf('0x16')](removeEntity(_0x1ca954,null))[_0xcfcf('0x25')](handleError(_0x1ca954,null));};exports['describe']=function(_0x57aa4b,_0x10521f){return db[_0xcfcf('0x33')][_0xcfcf('0x35')]()[_0xcfcf('0x16')](respondWithResult(_0x10521f,null))['catch'](handleError(_0x10521f,null));};exports['addMessage']=function(_0x1650ca,_0xddcd73){return db['SmsMessage'][_0xcfcf('0x31')]({'where':{'id':_0x1650ca[_0xcfcf('0x27')]['id']}})['then'](handleEntityNotFound(_0xddcd73,null))[_0xcfcf('0x16')](function(_0x168ebe){if(_0x168ebe){return _0x168ebe['addMessage'](_0x1650ca[_0xcfcf('0x34')][_0xcfcf('0x36')],_[_0xcfcf('0x37')](_0x1650ca[_0xcfcf('0x34')],['ids','id'])||{});}})[_0xcfcf('0x16')](respondWithResult(_0xddcd73,null))[_0xcfcf('0x25')](handleError(_0xddcd73,null));};exports[_0xcfcf('0x38')]=function(_0x3fd0b1,_0x354c83){var _0x275669={'raw':![],'where':{}};var _0xc933f1={};var _0x3ae0c2={'count':0x0,'rows':[]};return db[_0xcfcf('0x33')]['findOne']({'where':{'id':_0x3fd0b1['params']['id']}})[_0xcfcf('0x16')](handleEntityNotFound(_0x354c83,null))[_0xcfcf('0x16')](function(_0x42285f){if(_0x42285f){_0xc933f1[_0xcfcf('0x28')]=_[_0xcfcf('0x29')](db[_0xcfcf('0x39')][_0xcfcf('0x1d')]);_0xc933f1[_0xcfcf('0x23')]=_[_0xcfcf('0x29')](_0x3fd0b1['query']);_0xc933f1['filters']=_['intersection'](_0xc933f1[_0xcfcf('0x28')],_0xc933f1[_0xcfcf('0x23')]);_0x275669['attributes']=_[_0xcfcf('0x2b')](_0xc933f1[_0xcfcf('0x28')],qs[_0xcfcf('0x2d')](_0x3fd0b1[_0xcfcf('0x23')][_0xcfcf('0x2d')]));_0x275669[_0xcfcf('0x2c')]=_0x275669[_0xcfcf('0x2c')]['length']?_0x275669[_0xcfcf('0x2c')]:_0xc933f1[_0xcfcf('0x28')];if(!_0x3fd0b1[_0xcfcf('0x23')][_0xcfcf('0x3a')]('nolimit')){_0x275669[_0xcfcf('0x13')]=qs[_0xcfcf('0x13')](_0x3fd0b1[_0xcfcf('0x23')]['limit']);_0x275669[_0xcfcf('0x12')]=qs[_0xcfcf('0x12')](_0x3fd0b1[_0xcfcf('0x23')][_0xcfcf('0x12')]);}_0x275669[_0xcfcf('0x3b')]=qs[_0xcfcf('0x3c')](_0x3fd0b1[_0xcfcf('0x23')]['sort']);_0x275669[_0xcfcf('0x3d')]=qs[_0xcfcf('0x2a')](_[_0xcfcf('0x3e')](_0x3fd0b1['query'],_0xc933f1[_0xcfcf('0x2a')]));_0x275669['where'][_0xcfcf('0x3f')]=_0x42285f['id'];if(_0x3fd0b1[_0xcfcf('0x23')]['filter']){_0x275669[_0xcfcf('0x3d')]=_[_0xcfcf('0x40')](_0x275669[_0xcfcf('0x3d')],{'$or':_[_0xcfcf('0x1c')](_0x275669[_0xcfcf('0x2c')],function(_0x1085c4){var _0x85dd5f={};_0x85dd5f[_0x1085c4]={'$like':'%'+_0x3fd0b1['query'][_0xcfcf('0x41')]+'%'};return _0x85dd5f;})});}if(_0x3fd0b1['query'][_0xcfcf('0x42')]){var _0x5d4a1e=_0x3fd0b1[_0xcfcf('0x23')][_0xcfcf('0x42')][_0xcfcf('0x43')](',');var _0x2d8630={};_0x2d8630[_0x5d4a1e[0x0]]={'$gte':moment(_0x5d4a1e[0x1])[_0xcfcf('0x44')](_0xcfcf('0x45'))};_0x275669[_0xcfcf('0x3d')]=_[_0xcfcf('0x40')](_0x275669[_0xcfcf('0x3d')],_0x2d8630);}_0x275669=_[_0xcfcf('0x40')]({},_0x275669,_0x3fd0b1['options']);return db[_0xcfcf('0x39')][_0xcfcf('0x14')]({'where':_0x275669['where']})[_0xcfcf('0x16')](function(_0x587677){_0x3ae0c2['count']=_0x587677;if(_0x3fd0b1[_0xcfcf('0x23')][_0xcfcf('0x2f')]){_0x275669[_0xcfcf('0x46')]=[{'all':!![]}];}return db[_0xcfcf('0x39')][_0xcfcf('0x21')](_0x275669);})[_0xcfcf('0x16')](function(_0x200c60){_0x3ae0c2[_0xcfcf('0x47')]=_0x200c60;return _0x3ae0c2;});}})[_0xcfcf('0x16')](respondWithFilteredResult(_0x354c83,_0x275669))[_0xcfcf('0x25')](handleError(_0x354c83,null));};exports[_0xcfcf('0x48')]=function(_0x2f1037,_0x47be73){return db[_0xcfcf('0x33')][_0xcfcf('0x31')]({'where':{'id':_0x2f1037[_0xcfcf('0x27')]['id']}})[_0xcfcf('0x16')](handleEntityNotFound(_0x47be73,null))[_0xcfcf('0x16')](function(_0x50a3b0){if(_0x50a3b0){return _0x50a3b0[_0xcfcf('0x49')](_0x2f1037[_0xcfcf('0x34')][_0xcfcf('0x36')],_[_0xcfcf('0x37')](_0x2f1037['body'],[_0xcfcf('0x36'),'id'])||{})[_0xcfcf('0x4a')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xcfcf('0x4b')],'where':{'id':_0x2f1037[_0xcfcf('0x34')][_0xcfcf('0x36')]}});})[_0xcfcf('0x16')](function(_0x42db68){socket[_0xcfcf('0x4c')](_0xcfcf('0x4d'),{'id':Number(_0x2f1037[_0xcfcf('0x27')]['id']),'tags':_0x42db68||[]});return{'id':Number(_0x2f1037[_0xcfcf('0x27')]['id']),'tags':_0x42db68||[]};});}})[_0xcfcf('0x16')](respondWithResult(_0x47be73,null))[_0xcfcf('0x25')](handleError(_0x47be73,null));};exports['removeTags']=function(_0x47a24f,_0x31c6ca){return db[_0xcfcf('0x33')][_0xcfcf('0x31')]({'where':{'id':_0x47a24f[_0xcfcf('0x27')]['id']}})[_0xcfcf('0x16')](handleEntityNotFound(_0x31c6ca,null))['then'](function(_0x15721b){if(_0x15721b){return _0x15721b[_0xcfcf('0x4e')](_0x47a24f[_0xcfcf('0x23')][_0xcfcf('0x36')]);}})['then'](respondWithStatusCode(_0x31c6ca,null))[_0xcfcf('0x25')](handleError(_0x31c6ca,null));};exports[_0xcfcf('0x4f')]=function(_0x407781,_0xdba625){var _0x4c695e=moment()[_0xcfcf('0x50')]()[_0xcfcf('0x51')]();var _0x314d96=path[_0xcfcf('0x52')](config['root'],_0xcfcf('0x53'),_0xcfcf('0x54'),_0xcfcf('0x55'));var _0x1ad504=path[_0xcfcf('0x52')](_0x314d96,_0x4c695e);var _0x2d3b7d=util[_0xcfcf('0x44')]('transcript-%d-%s.zip',_0x407781[_0xcfcf('0x27')]['id'],_0x4c695e);var _0x47ee16=path['join'](_0x314d96,_0x2d3b7d);var _0x3a8e4b=[];_0x3a8e4b['push']({'model':db[_0xcfcf('0x56')],'as':_0xcfcf('0x56'),'attributes':['id','fullname'],'raw':!![]});_0x3a8e4b[_0xcfcf('0x57')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xcfcf('0x58'),_0xcfcf('0x59')],'raw':!![]});var _0x36027f=[{'model':db[_0xcfcf('0x39')],'as':_0xcfcf('0x5a'),'attributes':['id','body',_0xcfcf('0x5b'),_0xcfcf('0x5c'),_0xcfcf('0x5d'),_0xcfcf('0x5e')],'include':_0x3a8e4b}];_0x36027f[_0xcfcf('0x57')]({'model':db[_0xcfcf('0x5f')],'as':_0xcfcf('0x60'),'attributes':['id','name']});_0x36027f[_0xcfcf('0x57')]({'model':db[_0xcfcf('0x56')],'as':_0xcfcf('0x61'),'attributes':['id',_0xcfcf('0x62')]});return db[_0xcfcf('0x33')]['find']({'where':{'id':_0x407781[_0xcfcf('0x27')]['id']},'include':_0x36027f})['then'](handleEntityNotFound(_0xdba625,null))[_0xcfcf('0x16')](function(_0x4d2310){if(_0x4d2310){var _0x4b4b35=_0x4d2310[_0xcfcf('0x63')]({'plain':!![]});fs[_0xcfcf('0x64')](_0x1ad504);var _0x51dc1b={'channel':'Sms','account':_0x4b4b35[_0xcfcf('0x60')]['name'],'agent':_0x4b4b35[_0xcfcf('0x61')]?_0x4b4b35[_0xcfcf('0x61')]['fullname']:_0xcfcf('0x65'),'createdAt':moment(_0x4b4b35[_0xcfcf('0x5b')])[_0xcfcf('0x44')](_0xcfcf('0x45'))['toString'](),'closedAt':_0x4b4b35[_0xcfcf('0x66')]?moment(_0x4b4b35[_0xcfcf('0x67')])['format'](_0xcfcf('0x45'))[_0xcfcf('0x51')]():'','disposition':_0x4b4b35[_0xcfcf('0x68')],'messages':_(_0x4b4b35[_0xcfcf('0x5a')])['filter']({'secret':![]})[_0xcfcf('0x1c')](function(_0x4f7119){return{'date':moment(_0x4f7119[_0xcfcf('0x5b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xcfcf('0x51')](),'sender':_0x4f7119['direction']==='out'?_0x4f7119[_0xcfcf('0x56')]?_0x4f7119[_0xcfcf('0x56')][_0xcfcf('0x62')]:_0xcfcf('0x69'):_0x4f7119[_0xcfcf('0x6a')][_0xcfcf('0x58')]+(_0x4f7119[_0xcfcf('0x6a')][_0xcfcf('0x59')]?'\x20'+_0x4f7119[_0xcfcf('0x6a')][_0xcfcf('0x59')]:''),'body':_0x4f7119['body'],'direction':_0x4f7119[_0xcfcf('0x5c')]===_0xcfcf('0x6b')?'A':'C','secret':_0x4f7119['secret'],'read':_0x4f7119[_0xcfcf('0x5e')]};})['value']()};return ejs[_0xcfcf('0x6c')](path[_0xcfcf('0x52')](config[_0xcfcf('0x6d')],'server',_0xcfcf('0x6e'),'downloadInteraction.ejs'),{'interaction':_0x51dc1b})['then'](function(_0x5a1b4b){var _0x16ef28=path[_0xcfcf('0x52')](_0x1ad504,'transcript-'+_0x4b4b35['id']+'-'+_0x4c695e+'.pdf');var _0xbbcd18={'path':_0x16ef28,'channel':'Sms','interactionId':_0x4b4b35['id']};return pdf[_0xcfcf('0x6f')](_0x5a1b4b,_0xbbcd18);})[_0xcfcf('0x16')](function(){return new BPromise(function(_0x2977be,_0x1a918f){zipdir(_0x1ad504,{'saveTo':_0x47ee16},function(_0xf2d549,_0x1caf5a){if(_0xf2d549)return _0x1a918f(_0xf2d549);return _0x2977be(_0x1caf5a);});})[_0xcfcf('0x16')](function(){return new BPromise(function(_0x24ba95,_0x3e695a){rimraf(_0x1ad504,function(_0x32e1ff){if(_0x32e1ff)_0x3e695a(_0x32e1ff);return _0x24ba95();});});})[_0xcfcf('0x16')](function(){return _0xdba625[_0xcfcf('0x4f')](_0x47ee16,_0x2d3b7d,function(_0x5a8eb2){if(_0x5a8eb2){console['log'](_0xcfcf('0x70'),_0x5a8eb2);}else{fs[_0xcfcf('0x71')](_0x47ee16);}});});});}else{return _0xdba625[_0xcfcf('0xe')](0xc8);}})[_0xcfcf('0x25')](handleError(_0xdba625,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2c3c96d..f80a827 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 _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3670c4,_0x5d1d84){var _0x27bb48=function(_0x119276){while(--_0x119276){_0x3670c4['push'](_0x3670c4['shift']());}};_0x27bb48(++_0x5d1d84);}(_0x4991,0xf7));var _0x1499=function(_0x29d322,_0x1daf8a){_0x29d322=_0x29d322-0x0;var _0x2fa103=_0x4991[_0x29d322];return _0x2fa103;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 148d5f7..2872f14 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 _0x9181=['../../config/environment','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x264a59,_0x31c079){var _0xa2eb76=function(_0x20e23b){while(--_0x20e23b){_0x264a59['push'](_0x264a59['shift']());}};_0xa2eb76(++_0x31c079);}(_0x9181,0x138));var _0x1918=function(_0x43d978,_0x198291){_0x43d978=_0x43d978-0x0;var _0x4b874d=_0x9181[_0x43d978];return _0x4b874d;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var logger=require(_0x1918('0x2'))(_0x1918('0x3'));var moment=require(_0x1918('0x4'));var BPromise=require(_0x1918('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1918('0x6'));var rimraf=require(_0x1918('0x7'));var config=require(_0x1918('0x8'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x2c9e27,_0x340489){return _0x2c9e27[_0x1918('0x9')](_0x1918('0xa'),attributes,{'tableName':_0x1918('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f1240,_0x227547,_0x3e779b){if(_0x3f1240[_0x1918('0xc')](_0x1918('0xd'))){_0x3f1240[_0x1918('0xe')]=moment()['format'](_0x1918('0xf'));}_0x3e779b(null,_0x3f1240);}}});}; \ No newline at end of file +var _0x2035=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2035,0x74));var _0x5203=function(_0x15ac77,_0x928b2d){_0x15ac77=_0x15ac77-0x0;var _0x6550b7=_0x2035[_0x15ac77];return _0x6550b7;};'use strict';var _=require(_0x5203('0x0'));var util=require(_0x5203('0x1'));var logger=require('../../config/logger')(_0x5203('0x2'));var moment=require(_0x5203('0x3'));var BPromise=require(_0x5203('0x4'));var rp=require(_0x5203('0x5'));var fs=require('fs');var path=require(_0x5203('0x6'));var rimraf=require(_0x5203('0x7'));var config=require(_0x5203('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x5203('0x9')]=function(_0x5092f5,_0x564dd4){return _0x5092f5[_0x5203('0xa')](_0x5203('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x280cd6,_0x138963,_0x49805e){if(_0x280cd6[_0x5203('0xc')](_0x5203('0xd'))){_0x280cd6[_0x5203('0xe')]=moment()[_0x5203('0xf')](_0x5203('0x10'));}_0x49805e(null,_0x280cd6);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 0207dec..d0cc7f3 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 _0x3020=['where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','attributes','limit','debug','find'];(function(_0x116b01,_0x2a7947){var _0x4fd916=function(_0x1187ab){while(--_0x1187ab){_0x116b01['push'](_0x116b01['shift']());}};_0x4fd916(++_0x2a7947);}(_0x3020,0x81));var _0x0302=function(_0x46f743,_0x1419b8){_0x46f743=_0x46f743-0x0;var _0x30694c=_0x3020[_0x46f743];return _0x30694c;};'use strict';var _=require(_0x0302('0x0'));var util=require('util');var moment=require(_0x0302('0x1'));var BPromise=require(_0x0302('0x2'));var rs=require(_0x0302('0x3'));var fs=require('fs');var Redis=require(_0x0302('0x4'));var db=require(_0x0302('0x5'))['db'];var utils=require(_0x0302('0x6'));var logger=require('../../config/logger')(_0x0302('0x7'));var config=require(_0x0302('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0302('0x9')]['http']({'port':0x232a});config[_0x0302('0xa')]=_['defaults'](config[_0x0302('0xa')],{'host':_0x0302('0xb'),'port':0x18eb});var socket=require(_0x0302('0xc'))(new Redis(config[_0x0302('0xa')]));require(_0x0302('0xd'))[_0x0302('0xe')](socket);function respondWithRpcPromise(_0x2efd1d,_0x2e72e0,_0xe3f8b3){return new BPromise(function(_0x350694,_0x57af6d){return client[_0x0302('0xf')](_0x2efd1d,_0xe3f8b3)[_0x0302('0x10')](function(_0x2e29d4){logger['info'](_0x0302('0x11'),_0x2e72e0,_0x0302('0x12'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2e72e0,_0x0302('0x12'),JSON[_0x0302('0x13')](_0x2e29d4));if(_0x2e29d4[_0x0302('0x14')]){if(_0x2e29d4[_0x0302('0x14')][_0x0302('0x15')]===0x1f4){logger[_0x0302('0x14')](_0x0302('0x11'),_0x2e72e0,_0x2e29d4[_0x0302('0x14')][_0x0302('0x16')]);return _0x57af6d(_0x2e29d4[_0x0302('0x14')]['message']);}logger[_0x0302('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2e72e0,_0x2e29d4[_0x0302('0x14')][_0x0302('0x16')]);return _0x350694(_0x2e29d4[_0x0302('0x14')]['message']);}else{logger[_0x0302('0x17')](_0x0302('0x11'),_0x2e72e0,'request\x20sent');_0x350694(_0x2e29d4[_0x0302('0x18')]['message']);}})[_0x0302('0x19')](function(_0x2929c6){logger[_0x0302('0x14')](_0x0302('0x11'),_0x2e72e0,_0x2929c6);_0x57af6d(_0x2929c6);});});}exports[_0x0302('0x1a')]=function(_0x2ec66a){var _0x38d007=this;return new Promise(function(_0x3ef6f8,_0x2a17d9){return db[_0x0302('0x1b')][_0x0302('0x1c')](_0x2ec66a[_0x0302('0x1d')],{'raw':_0x2ec66a[_0x0302('0x1e')]?_0x2ec66a[_0x0302('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec66a[_0x0302('0x1e')]?_0x2ec66a[_0x0302('0x1e')]['where']||null:null,'attributes':_0x2ec66a['options']?_0x2ec66a[_0x0302('0x1e')][_0x0302('0x1f')]||null:null,'limit':_0x2ec66a['options']?_0x2ec66a[_0x0302('0x1e')][_0x0302('0x20')]||null:null})['then'](function(_0x10b8cb){logger['info'](_0x0302('0x1a'),_0x2ec66a);logger[_0x0302('0x21')](_0x0302('0x1a'),_0x2ec66a,JSON[_0x0302('0x13')](_0x10b8cb));_0x3ef6f8(_0x10b8cb);})['catch'](function(_0x38970c){logger[_0x0302('0x14')](_0x0302('0x1a'),_0x38970c[_0x0302('0x16')],_0x2ec66a);_0x2a17d9(_0x38d007[_0x0302('0x14')](0x1f4,_0x38970c['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x10016d){return new Promise(function(_0x1ff8bc,_0x466023){return db[_0x0302('0x1b')][_0x0302('0x22')]({'where':_0x10016d[_0x0302('0x1e')]?_0x10016d[_0x0302('0x1e')][_0x0302('0x23')]||null:null})['then'](function(_0x30ffdc){if(_0x30ffdc){return _0x30ffdc[_0x0302('0x24')](_0x10016d[_0x0302('0x1d')][_0x0302('0x25')],_[_0x0302('0x26')](_0x10016d[_0x0302('0x1d')],['ids','id'])||{});}})[_0x0302('0x27')](function(_0x4188b3){logger[_0x0302('0x17')](_0x0302('0x28'),_0x10016d);logger[_0x0302('0x21')](_0x0302('0x28'),_0x10016d,JSON[_0x0302('0x13')](_0x4188b3));_0x1ff8bc(_0x4188b3);})[_0x0302('0x19')](function(_0x3d2fa8){logger['error'](_0x0302('0x28'),_0x3d2fa8[_0x0302('0x16')],_0x10016d);_0x466023(_this[_0x0302('0x14')](0x1f4,_0x3d2fa8[_0x0302('0x16')]));});});}; \ No newline at end of file +var _0x3310=['body','options','where','attributes','limit','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x1c3dcc,_0x197b39){var _0x8c4874=function(_0xabb81a){while(--_0xabb81a){_0x1c3dcc['push'](_0x1c3dcc['shift']());}};_0x8c4874(++_0x197b39);}(_0x3310,0x14c));var _0x0331=function(_0x5c65a4,_0x354c57){_0x5c65a4=_0x5c65a4-0x0;var _0x276021=_0x3310[_0x5c65a4];return _0x276021;};'use strict';var _=require(_0x0331('0x0'));var util=require(_0x0331('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0331('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0331('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0331('0x4'))(_0x0331('0x5'));var config=require('../../config/environment');var jayson=require(_0x0331('0x6'));var client=jayson['client'][_0x0331('0x7')]({'port':0x232a});config['redis']=_[_0x0331('0x8')](config['redis'],{'host':_0x0331('0x9'),'port':0x18eb});var socket=require(_0x0331('0xa'))(new Redis(config[_0x0331('0xb')]));require('./smsInteraction.socket')[_0x0331('0xc')](socket);function respondWithRpcPromise(_0x2e3671,_0x4c6b73,_0x4d5109){return new BPromise(function(_0x30238e,_0x1ac83c){return client[_0x0331('0xd')](_0x2e3671,_0x4d5109)[_0x0331('0xe')](function(_0x58ff1b){logger['info'](_0x0331('0xf'),_0x4c6b73,_0x0331('0x10'));logger[_0x0331('0x11')](_0x0331('0x12'),_0x4c6b73,_0x0331('0x10'),JSON['stringify'](_0x58ff1b));if(_0x58ff1b[_0x0331('0x13')]){if(_0x58ff1b[_0x0331('0x13')][_0x0331('0x14')]===0x1f4){logger[_0x0331('0x13')](_0x0331('0xf'),_0x4c6b73,_0x58ff1b[_0x0331('0x13')]['message']);return _0x1ac83c(_0x58ff1b[_0x0331('0x13')][_0x0331('0x15')]);}logger[_0x0331('0x13')](_0x0331('0xf'),_0x4c6b73,_0x58ff1b[_0x0331('0x13')][_0x0331('0x15')]);return _0x30238e(_0x58ff1b[_0x0331('0x13')][_0x0331('0x15')]);}else{logger[_0x0331('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x4c6b73,_0x0331('0x10'));_0x30238e(_0x58ff1b[_0x0331('0x17')]['message']);}})[_0x0331('0x18')](function(_0x5e3f71){logger[_0x0331('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x4c6b73,_0x5e3f71);_0x1ac83c(_0x5e3f71);});});}exports[_0x0331('0x19')]=function(_0x3a2604){var _0x26a7a8=this;return new Promise(function(_0x1ee7fd,_0x44fe97){return db[_0x0331('0x1a')][_0x0331('0x1b')](_0x3a2604[_0x0331('0x1c')],{'raw':_0x3a2604[_0x0331('0x1d')]?_0x3a2604[_0x0331('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a2604[_0x0331('0x1d')]?_0x3a2604[_0x0331('0x1d')][_0x0331('0x1e')]||null:null,'attributes':_0x3a2604[_0x0331('0x1d')]?_0x3a2604[_0x0331('0x1d')][_0x0331('0x1f')]||null:null,'limit':_0x3a2604[_0x0331('0x1d')]?_0x3a2604[_0x0331('0x1d')][_0x0331('0x20')]||null:null})[_0x0331('0xe')](function(_0x24ee70){logger[_0x0331('0x16')](_0x0331('0x19'),_0x3a2604);logger['debug']('UpdateSmsInteraction',_0x3a2604,JSON[_0x0331('0x21')](_0x24ee70));_0x1ee7fd(_0x24ee70);})['catch'](function(_0x108555){logger['error']('UpdateSmsInteraction',_0x108555['message'],_0x3a2604);_0x44fe97(_0x26a7a8[_0x0331('0x13')](0x1f4,_0x108555[_0x0331('0x15')]));});});};exports['AddTagsToSmsInteraction']=function(_0x10ac64){return new Promise(function(_0x2a5531,_0x3f3ab5){return db[_0x0331('0x1a')][_0x0331('0x22')]({'where':_0x10ac64['options']?_0x10ac64[_0x0331('0x1d')]['where']||null:null})[_0x0331('0xe')](function(_0x2fbadf){if(_0x2fbadf){return _0x2fbadf[_0x0331('0x23')](_0x10ac64[_0x0331('0x1c')][_0x0331('0x24')],_[_0x0331('0x25')](_0x10ac64[_0x0331('0x1c')],[_0x0331('0x24'),'id'])||{});}})[_0x0331('0x26')](function(_0x4862ee){logger[_0x0331('0x16')](_0x0331('0x27'),_0x10ac64);logger[_0x0331('0x11')](_0x0331('0x27'),_0x10ac64,JSON['stringify'](_0x4862ee));_0x2a5531(_0x4862ee);})[_0x0331('0x18')](function(_0x25fc78){logger[_0x0331('0x13')](_0x0331('0x27'),_0x25fc78[_0x0331('0x15')],_0x10ac64);_0x3f3ab5(_this[_0x0331('0x13')](0x1f4,_0x25fc78[_0x0331('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 28c7c9c..80934aa 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 _0x6e11=['./smsInteraction.events','save','remove','emit','register','length','smsInteraction:'];(function(_0x2af009,_0x5432ee){var _0x46d15f=function(_0x26569f){while(--_0x26569f){_0x2af009['push'](_0x2af009['shift']());}};_0x46d15f(++_0x5432ee);}(_0x6e11,0x1ab));var _0x16e1=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x6e11[_0x310504];return _0x5b36d0;};'use strict';var SmsInteractionEvents=require(_0x16e1('0x0'));var events=[_0x16e1('0x1'),_0x16e1('0x2'),'update'];function createListener(_0x388557,_0xa0bbac){return function(_0x5ed52c){_0xa0bbac[_0x16e1('0x3')](_0x388557,_0x5ed52c);};}function removeListener(_0x477350,_0x2be153){return function(){SmsInteractionEvents['removeListener'](_0x477350,_0x2be153);};}exports[_0x16e1('0x4')]=function(_0x3eec1b){for(var _0xcece47=0x0,_0x28b8b3=events[_0x16e1('0x5')];_0xcece47<_0x28b8b3;_0xcece47++){var _0x5e4e97=events[_0xcece47];var _0x6f0ae6=createListener(_0x16e1('0x6')+_0x5e4e97,_0x3eec1b);SmsInteractionEvents['on'](_0x5e4e97,_0x6f0ae6);}}; \ No newline at end of file +var _0xa893=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xa893,0xe1));var _0x3a89=function(_0x5a9af4,_0x30b0fb){_0x5a9af4=_0x5a9af4-0x0;var _0x140a28=_0xa893[_0x5a9af4];return _0x140a28;};'use strict';var SmsInteractionEvents=require(_0x3a89('0x0'));var events=[_0x3a89('0x1'),_0x3a89('0x2'),_0x3a89('0x3')];function createListener(_0x439c2f,_0x2bfcb1){return function(_0x3c9e2e){_0x2bfcb1[_0x3a89('0x4')](_0x439c2f,_0x3c9e2e);};}function removeListener(_0x3a4452,_0x267710){return function(){SmsInteractionEvents[_0x3a89('0x5')](_0x3a4452,_0x267710);};}exports[_0x3a89('0x6')]=function(_0x31f35e){for(var _0x44bea9=0x0,_0x311475=events[_0x3a89('0x7')];_0x44bea9<_0x311475;_0x44bea9++){var _0x43ee3c=events[_0x44bea9];var _0x26fccf=createListener(_0x3a89('0x8')+_0x43ee3c,_0x31f35e);SmsInteractionEvents['on'](_0x43ee3c,_0x26fccf);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 6ecd7c1..1549447 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 _0xfea2=['fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','/:id/status','status','put','/:id/reject','reject','destroy','exports','util','connect-timeout','express','Router'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfea2,0xa4));var _0x2fea=function(_0xace5bb,_0x4322f6){_0xace5bb=_0xace5bb-0x0;var _0x37bd48=_0xfea2[_0xace5bb];return _0x37bd48;};'use strict';var multer=require('multer');var util=require(_0x2fea('0x0'));var path=require('path');var timeout=require(_0x2fea('0x1'));var express=require(_0x2fea('0x2'));var router=express[_0x2fea('0x3')]();var fs_extra=require(_0x2fea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2fea('0x5'));var config=require(_0x2fea('0x6'));var controller=require(_0x2fea('0x7'));router[_0x2fea('0x8')]('/',auth[_0x2fea('0x9')](),controller[_0x2fea('0xa')]);router[_0x2fea('0x8')](_0x2fea('0xb'),auth[_0x2fea('0x9')](),controller['describe']);router[_0x2fea('0x8')](_0x2fea('0xc'),auth[_0x2fea('0x9')](),controller[_0x2fea('0xd')]);router[_0x2fea('0xe')]('/',auth['isAuthenticated'](),interaction[_0x2fea('0xf')](_0x2fea('0x10'),'smsmessage:create'),controller['create']);router[_0x2fea('0xe')](_0x2fea('0x11'),controller[_0x2fea('0x12')]);router[_0x2fea('0x13')](_0x2fea('0xc'),auth[_0x2fea('0x9')](),controller['update']);router[_0x2fea('0x13')]('/:id/accept',auth[_0x2fea('0x9')](),controller['accept']);router[_0x2fea('0x13')](_0x2fea('0x14'),auth[_0x2fea('0x9')](),controller[_0x2fea('0x15')]);router['delete'](_0x2fea('0xc'),auth[_0x2fea('0x9')](),controller[_0x2fea('0x16')]);module[_0x2fea('0x17')]=router; \ No newline at end of file +var _0xdc97=['/:id','post','sms','smsmessage:create','create','put','/:id/accept','accept','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x169afa,_0x48f99c){var _0x52a8a1=function(_0x42fd39){while(--_0x42fd39){_0x169afa['push'](_0x169afa['shift']());}};_0x52a8a1(++_0x48f99c);}(_0xdc97,0x17a));var _0x7dc9=function(_0x4ba347,_0x170fbe){_0x4ba347=_0x4ba347-0x0;var _0x515cfa=_0xdc97[_0x4ba347];return _0x515cfa;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7dc9('0x2'));var router=express[_0x7dc9('0x3')]();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0x8')](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller['show']);router[_0x7dc9('0xe')]('/',auth[_0x7dc9('0x9')](),interaction['tracked'](_0x7dc9('0xf'),_0x7dc9('0x10')),controller[_0x7dc9('0x11')]);router['post']('/:id/status',controller['status']);router[_0x7dc9('0x12')](_0x7dc9('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7dc9('0x12')](_0x7dc9('0x13'),auth['isAuthenticated'](),controller[_0x7dc9('0x14')]);router[_0x7dc9('0x12')]('/:id/reject',auth[_0x7dc9('0x9')](),controller['reject']);router[_0x7dc9('0x15')](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x16')]);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 3195434..4c16625 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 _0x88ce=['STRING','DATE','TEXT','exports','medium','BOOLEAN','ENUM','out'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x88ce,0xab));var _0xe88c=function(_0x1b2871,_0x11e8bf){_0x1b2871=_0x1b2871-0x0;var _0xb2e25e=_0x88ce[_0x1b2871];return _0xb2e25e;};'use strict';var Sequelize=require('sequelize');module[_0xe88c('0x0')]={'body':{'type':Sequelize['TEXT'](_0xe88c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xe88c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe88c('0x3')]('in',_0xe88c('0x4')),'defaultValue':_0xe88c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe88c('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe88c('0x6')]},'secret':{'type':Sequelize[_0xe88c('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe88c('0x5')]},'providerResponse':{'type':Sequelize[_0xe88c('0x7')]}}; \ No newline at end of file +var _0x0f50=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','exports'];(function(_0x5dda6d,_0x3860ee){var _0x379b89=function(_0xf8bd33){while(--_0xf8bd33){_0x5dda6d['push'](_0x5dda6d['shift']());}};_0x379b89(++_0x3860ee);}(_0x0f50,0x6f));var _0x00f5=function(_0x5e7761,_0x411e9a){_0x5e7761=_0x5e7761-0x0;var _0x327be0=_0x0f50[_0x5e7761];return _0x327be0;};'use strict';var Sequelize=require('sequelize');module[_0x00f5('0x0')]={'body':{'type':Sequelize[_0x00f5('0x1')](_0x00f5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x00f5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00f5('0x4')]('in',_0x00f5('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x00f5('0x6')](0xbe)},'phone':{'type':Sequelize[_0x00f5('0x6')]},'readAt':{'type':Sequelize[_0x00f5('0x7')]},'secret':{'type':Sequelize[_0x00f5('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x00f5('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index c8cb4e9..8dc8355 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 _0xc7bd=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','create','body','find','describe','../../config/logger','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','User','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','results','groupName','DELIVERED','infobip','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x16fcdc,_0x1ea569){var _0x28f952=function(_0x307fce){while(--_0x307fce){_0x16fcdc['push'](_0x16fcdc['shift']());}};_0x28f952(++_0x1ea569);}(_0xc7bd,0x86));var _0xdc7b=function(_0x4bb2fb,_0x24d580){_0x4bb2fb=_0x4bb2fb-0x0;var _0xb41875=_0xc7bd[_0x4bb2fb];return _0xb41875;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc7b('0x0'));var zipdir=require(_0xdc7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc7b('0x2'));var moment=require('moment');var BPromise=require(_0xdc7b('0x3'));var Mustache=require('mustache');var util=require(_0xdc7b('0x4'));var path=require(_0xdc7b('0x5'));var sox=require(_0xdc7b('0x6'));var csv=require(_0xdc7b('0x7'));var ejs=require(_0xdc7b('0x8'));var fs=require('fs');var fs_extra=require(_0xdc7b('0x9'));var _=require(_0xdc7b('0xa'));var squel=require('squel');var crypto=require(_0xdc7b('0xb'));var jsforce=require(_0xdc7b('0xc'));var deskjs=require(_0xdc7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc7b('0xe'));var Redis=require(_0xdc7b('0xf'));var authService=require(_0xdc7b('0x10'));var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')(_0xdc7b('0x14'));var utils=require(_0xdc7b('0x15'));var config=require(_0xdc7b('0x16'));var licenseUtil=require(_0xdc7b('0x17'));var db=require(_0xdc7b('0x18'))['db'];config[_0xdc7b('0x19')]=_['defaults'](config[_0xdc7b('0x19')],{'host':_0xdc7b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc7b('0x19')]));require('./smsMessage.socket')[_0xdc7b('0x1b')](socket);var jayson=require(_0xdc7b('0x1c'));var client=jayson[_0xdc7b('0x1d')][_0xdc7b('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xdc7b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2088f1,_0x5e0281,_0x35c671,_0x12b8ca){return new BPromise(function(_0xefe69c,_0x2ed99d){var _0x19b289=_0x12b8ca||client;return _0x19b289[_0xdc7b('0x1f')](_0x2088f1,_0x35c671)[_0xdc7b('0x20')](function(_0x25334e){logger['info'](_0xdc7b('0x21'),_0x5e0281,'request\x20sent');logger[_0xdc7b('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e0281,_0xdc7b('0x23'),JSON[_0xdc7b('0x24')](_0x25334e));if(_0x25334e[_0xdc7b('0x25')]){if(_0x25334e[_0xdc7b('0x25')][_0xdc7b('0x26')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x5e0281,_0x25334e['error'][_0xdc7b('0x27')]);return _0x2ed99d(_0x25334e[_0xdc7b('0x25')]['message']);}logger[_0xdc7b('0x25')](_0xdc7b('0x21'),_0x5e0281,_0x25334e[_0xdc7b('0x25')]['message']);return _0xefe69c(_0x25334e[_0xdc7b('0x25')]['message']);}else{logger[_0xdc7b('0x28')](_0xdc7b('0x21'),_0x5e0281,_0xdc7b('0x23'));_0xefe69c(_0x25334e[_0xdc7b('0x29')][_0xdc7b('0x27')]);}})[_0xdc7b('0x2a')](function(_0x10c260){logger[_0xdc7b('0x25')](_0xdc7b('0x21'),_0x5e0281,_0x10c260);_0x2ed99d(_0x10c260);});});}function respondWithStatusCode(_0x5b6ad7,_0x1c1eaf){_0x1c1eaf=_0x1c1eaf||0xcc;return function(_0x48189d){if(_0x48189d){return _0x5b6ad7[_0xdc7b('0x2b')](_0x1c1eaf);}return _0x5b6ad7[_0xdc7b('0x2c')](_0x1c1eaf)['end']();};}function respondWithResult(_0x30b37d,_0x5be3e4){_0x5be3e4=_0x5be3e4||0xc8;return function(_0x4525d4){if(_0x4525d4){return _0x30b37d[_0xdc7b('0x2c')](_0x5be3e4)[_0xdc7b('0x2d')](_0x4525d4);}};}function respondWithFilteredResult(_0x5bbe04,_0x2eb566){return function(_0x102288){if(_0x102288){var _0x2cfd85=typeof _0x2eb566[_0xdc7b('0x2e')]===_0xdc7b('0x2f')&&typeof _0x2eb566['limit']===_0xdc7b('0x2f');var _0x1f795d=_0x102288[_0xdc7b('0x30')];var _0x2d493d=_0x2cfd85?0x0:_0x2eb566['offset'];var _0x102731=_0x2cfd85?_0x102288[_0xdc7b('0x30')]:_0x2eb566[_0xdc7b('0x2e')]+_0x2eb566[_0xdc7b('0x31')];var _0x4ad851;if(_0x102731>=_0x1f795d){_0x102731=_0x1f795d;_0x4ad851=0xc8;}else{_0x4ad851=0xce;}_0x5bbe04[_0xdc7b('0x2c')](_0x4ad851);return _0x5bbe04[_0xdc7b('0x32')](_0xdc7b('0x33'),_0x2d493d+'-'+_0x102731+'/'+_0x1f795d)[_0xdc7b('0x2d')](_0x102288);}return null;};}function patchUpdates(_0x195d45){return function(_0x571e32){try{jsonpatch[_0xdc7b('0x34')](_0x571e32,_0x195d45,!![]);}catch(_0x5a4468){return BPromise[_0xdc7b('0x35')](_0x5a4468);}return _0x571e32[_0xdc7b('0x36')]();};}function saveUpdates(_0x41d6cd,_0x533047){return function(_0x37cfac){if(_0x37cfac){return _0x37cfac[_0xdc7b('0x37')](_0x41d6cd)[_0xdc7b('0x20')](function(_0x4b03f0){return _0x4b03f0;});}return null;};}function removeEntity(_0x1fe37e,_0x3d73c1){return function(_0x5c3a6c){if(_0x5c3a6c){return _0x5c3a6c[_0xdc7b('0x38')]()['then'](function(){_0x1fe37e[_0xdc7b('0x2c')](0xcc)[_0xdc7b('0x39')]();});}};}function handleEntityNotFound(_0x535f69,_0x338447){return function(_0x5a1ac0){if(!_0x5a1ac0){_0x535f69[_0xdc7b('0x2b')](0x194);}return _0x5a1ac0;};}function handleError(_0xce2413,_0x14138d){_0x14138d=_0x14138d||0x1f4;return function(_0x1fc5f6){logger[_0xdc7b('0x25')](_0x1fc5f6[_0xdc7b('0x3a')]);if(_0x1fc5f6['name']){delete _0x1fc5f6[_0xdc7b('0x3b')];}_0xce2413[_0xdc7b('0x2c')](_0x14138d)[_0xdc7b('0x3c')](_0x1fc5f6);};}exports['index']=function(_0x5dc9d5,_0x53e502){var _0x36c272={},_0x3038b5={},_0x3e5007={'count':0x0,'rows':[]};var _0x162b4e=_[_0xdc7b('0x3d')](db[_0xdc7b('0x3e')][_0xdc7b('0x3f')],function(_0x239ffe){return{'name':_0x239ffe[_0xdc7b('0x40')],'type':_0x239ffe[_0xdc7b('0x41')]['key']};});_0x3038b5[_0xdc7b('0x42')]=_[_0xdc7b('0x3d')](_0x162b4e,'name');_0x3038b5['query']=_[_0xdc7b('0x43')](_0x5dc9d5[_0xdc7b('0x44')]);_0x3038b5[_0xdc7b('0x45')]=_[_0xdc7b('0x46')](_0x3038b5[_0xdc7b('0x42')],_0x3038b5[_0xdc7b('0x44')]);_0x36c272[_0xdc7b('0x47')]=_[_0xdc7b('0x46')](_0x3038b5[_0xdc7b('0x42')],qs[_0xdc7b('0x48')](_0x5dc9d5['query'][_0xdc7b('0x48')]));_0x36c272[_0xdc7b('0x47')]=_0x36c272[_0xdc7b('0x47')]['length']?_0x36c272[_0xdc7b('0x47')]:_0x3038b5[_0xdc7b('0x42')];if(!_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x49')](_0xdc7b('0x4a'))){_0x36c272[_0xdc7b('0x31')]=qs[_0xdc7b('0x31')](_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x31')]);_0x36c272[_0xdc7b('0x2e')]=qs['offset'](_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x2e')]);}_0x36c272[_0xdc7b('0x4b')]=qs[_0xdc7b('0x4c')](_0x5dc9d5[_0xdc7b('0x44')]['sort']);_0x36c272[_0xdc7b('0x4d')]=qs[_0xdc7b('0x45')](_[_0xdc7b('0x4e')](_0x5dc9d5['query'],_0x3038b5[_0xdc7b('0x45')]),_0x162b4e);if(_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x4f')]){_0x36c272[_0xdc7b('0x4d')]=_['merge'](_0x36c272['where'],{'$or':_[_0xdc7b('0x3d')](_0x162b4e,function(_0x4ea569){if(_0x4ea569['type']!==_0xdc7b('0x50')){var _0xb3a171={};_0xb3a171[_0x4ea569[_0xdc7b('0x3b')]]={'$like':'%'+_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x4f')]+'%'};return _0xb3a171;}})});}_0x36c272=_[_0xdc7b('0x51')]({},_0x36c272,_0x5dc9d5['options']);var _0x5f2349={'where':_0x36c272[_0xdc7b('0x4d')]};return db[_0xdc7b('0x3e')][_0xdc7b('0x30')](_0x5f2349)[_0xdc7b('0x20')](function(_0x2dfd57){_0x3e5007[_0xdc7b('0x30')]=_0x2dfd57;if(_0x5dc9d5[_0xdc7b('0x44')][_0xdc7b('0x52')]){_0x36c272[_0xdc7b('0x53')]=[{'all':!![]}];}return db[_0xdc7b('0x3e')][_0xdc7b('0x54')](_0x36c272);})['then'](function(_0x33cc3c){_0x3e5007[_0xdc7b('0x55')]=_0x33cc3c;return _0x3e5007;})['then'](respondWithFilteredResult(_0x53e502,_0x36c272))['catch'](handleError(_0x53e502,null));};exports[_0xdc7b('0x56')]=function(_0x3a6b7f,_0x1c063e){var _0x227a68={'raw':!![],'where':{'id':_0x3a6b7f[_0xdc7b('0x57')]['id']}},_0x425de5={};_0x425de5[_0xdc7b('0x42')]=_[_0xdc7b('0x43')](db['SmsMessage']['rawAttributes']);_0x425de5[_0xdc7b('0x44')]=_[_0xdc7b('0x43')](_0x3a6b7f[_0xdc7b('0x44')]);_0x425de5['filters']=_['intersection'](_0x425de5[_0xdc7b('0x42')],_0x425de5[_0xdc7b('0x44')]);_0x227a68['attributes']=_[_0xdc7b('0x46')](_0x425de5[_0xdc7b('0x42')],qs['fields'](_0x3a6b7f[_0xdc7b('0x44')][_0xdc7b('0x48')]));_0x227a68[_0xdc7b('0x47')]=_0x227a68[_0xdc7b('0x47')]['length']?_0x227a68[_0xdc7b('0x47')]:_0x425de5[_0xdc7b('0x42')];if(_0x3a6b7f[_0xdc7b('0x44')][_0xdc7b('0x52')]){_0x227a68[_0xdc7b('0x53')]=[{'all':!![]}];}_0x227a68=_[_0xdc7b('0x51')]({},_0x227a68,_0x3a6b7f[_0xdc7b('0x58')]);return db[_0xdc7b('0x3e')]['find'](_0x227a68)[_0xdc7b('0x20')](handleEntityNotFound(_0x1c063e,null))[_0xdc7b('0x20')](respondWithResult(_0x1c063e,null))[_0xdc7b('0x2a')](handleError(_0x1c063e,null));};exports[_0xdc7b('0x59')]=function(_0x38d694,_0x587c24){return db[_0xdc7b('0x3e')][_0xdc7b('0x59')](_0x38d694[_0xdc7b('0x5a')],{})[_0xdc7b('0x20')](respondWithResult(_0x587c24,0xc9))[_0xdc7b('0x2a')](handleError(_0x587c24,null));};exports[_0xdc7b('0x37')]=function(_0x12937e,_0x3e8a91){if(_0x12937e['body']['id']){delete _0x12937e[_0xdc7b('0x5a')]['id'];}return db[_0xdc7b('0x3e')][_0xdc7b('0x5b')]({'where':{'id':_0x12937e[_0xdc7b('0x57')]['id']}})[_0xdc7b('0x20')](handleEntityNotFound(_0x3e8a91,null))[_0xdc7b('0x20')](saveUpdates(_0x12937e[_0xdc7b('0x5a')],null))[_0xdc7b('0x20')](respondWithResult(_0x3e8a91,null))[_0xdc7b('0x2a')](handleError(_0x3e8a91,null));};exports[_0xdc7b('0x38')]=function(_0x350111,_0x242dba){return db['SmsMessage'][_0xdc7b('0x5b')]({'where':{'id':_0x350111['params']['id']}})[_0xdc7b('0x20')](handleEntityNotFound(_0x242dba,null))[_0xdc7b('0x20')](removeEntity(_0x242dba,null))['catch'](handleError(_0x242dba,null));};exports[_0xdc7b('0x5c')]=function(_0xd13ed5,_0x383d83){return db[_0xdc7b('0x3e')][_0xdc7b('0x5c')]()[_0xdc7b('0x20')](respondWithResult(_0x383d83,null))[_0xdc7b('0x2a')](handleError(_0x383d83,null));};var interaction_log=require(_0xdc7b('0x5d'))(_0xdc7b('0x5e'));exports[_0xdc7b('0x5f')]=function(_0xa6471c,_0x1d6dad,_0x47dc98){var _0x59a484={'agent':{},'channel':_0xdc7b('0x60')};if(_0xa6471c[_0xdc7b('0x5a')]['id']){delete _0xa6471c['body']['id'];}_0xa6471c['body']['read']=!![];_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x61')]=moment()['format'](_0xdc7b('0x62'));_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x63')]=_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x63')]||_0xa6471c[_0xdc7b('0x64')]['id'];_0x59a484[_0xdc7b('0x65')]['id']=_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x63')];return db[_0xdc7b('0x3e')][_0xdc7b('0x5b')]({'where':{'id':_0xa6471c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d6dad,null))[_0xdc7b('0x20')](saveUpdates(_0xa6471c['body'],null))[_0xdc7b('0x20')](function(_0xc507c6){if(_0xc507c6){_0x59a484['message']=_0xc507c6[_0xdc7b('0x66')]({'plain':!![]});return db['SmsInteraction'][_0xdc7b('0x5b')]({'where':{'id':_0xc507c6[_0xdc7b('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1d6dad,null))[_0xdc7b('0x20')](function(_0x2f21c4){if(_0x2f21c4){return _0x2f21c4[_0xdc7b('0x37')]({'UserId':_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x63')],'read1stAt':_[_0xdc7b('0x68')](_0x2f21c4[_0xdc7b('0x69')])?moment()['format'](_0xdc7b('0x62')):undefined});}return null;})[_0xdc7b('0x20')](function(_0x555b23){if(_0x555b23){_0x59a484[_0xdc7b('0x6a')]=_0x555b23[_0xdc7b('0x66')]({'plain':!![]});interaction_log['info'](_0xdc7b('0x6b'),_0xa6471c[_0xdc7b('0x64')]['id'],_0xa6471c['user'][_0xdc7b('0x3b')],_0xa6471c['user']['role'],_0x59a484[_0xdc7b('0x6a')]['id'],_0xa6471c[_0xdc7b('0x5a')]?JSON[_0xdc7b('0x24')](_0xa6471c[_0xdc7b('0x5a')]):_0xdc7b('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xdc7b('0x6d'),_0x59a484);}return null;})['then'](function(_0x50c80c){var _0x353af4=_0xdc7b('0x6e')+_0x50c80c[_0xdc7b('0x27')][_0xdc7b('0x6f')];return db[_0xdc7b('0x70')][_0xdc7b('0x44')](_0x353af4,{'type':db[_0xdc7b('0x71')][_0xdc7b('0x72')][_0xdc7b('0x73')],'raw':!![]})[_0xdc7b('0x20')](function(_0x45ee01){return _0x45ee01;});})[_0xdc7b('0x20')](function(_0x1ef6dd){if(_0x1ef6dd){_0x59a484['message']['contact']=_0x1ef6dd[0x0];if(!_0xa6471c[_0xdc7b('0x5a')][_0xdc7b('0x63')])return;return db['User'][_0xdc7b('0x5b')]({'where':{'id':_0xa6471c['body'][_0xdc7b('0x63')],'role':_0xdc7b('0x65')},'attributes':['id',_0xdc7b('0x3b'),_0xdc7b('0x74'),_0xdc7b('0x75'),_0xdc7b('0x76')],'raw':!![]});}return null;})[_0xdc7b('0x20')](function(_0x842451){if(!_0x842451)return null;_0x59a484[_0xdc7b('0x27')][_0xdc7b('0x65')]=_0x842451;return _0x59a484;})['then'](function(_0x24639e){if(_0x24639e){if(_0xa6471c['body'][_0xdc7b('0x77')]){_0x59a484[_0xdc7b('0x27')][_0xdc7b('0x78')]=util[_0xdc7b('0x79')](_0xdc7b('0x7a'),_0xa6471c['user'][_0xdc7b('0x3b')]);_0x59a484['message'][_0xdc7b('0x7b')]=_0x59a484[_0xdc7b('0x7b')];_0x59a484['message'][_0xdc7b('0x7c')]=_0x59a484[_0xdc7b('0x7b')];_0x59a484['message'][_0xdc7b('0x7d')]='accept';return respondWithRpcPromise(_0xdc7b('0x7e'),'EventManager',{'event':_0xdc7b('0x7f'),'message':_0x59a484[_0xdc7b('0x27')]},client9002)[_0xdc7b('0x20')](function(){return _0x59a484;});}return _0x59a484;}return null;})[_0xdc7b('0x20')](respondWithResult(_0x1d6dad,null))['catch'](handleError(_0x1d6dad,null));};var interaction_log=require(_0xdc7b('0x5d'))(_0xdc7b('0x5e'));exports[_0xdc7b('0x35')]=function(_0x472138,_0x52a29f,_0x3e8d8b){var _0x18a690={'agent':{},'channel':'sms'};if(_0x472138[_0xdc7b('0x5a')]['id']){delete _0x472138[_0xdc7b('0x5a')]['id'];}_0x472138['body'][_0xdc7b('0x63')]=_0x472138[_0xdc7b('0x5a')][_0xdc7b('0x63')]||_0x472138['user']['id'];_0x18a690[_0xdc7b('0x65')]['id']=_0x472138['body'][_0xdc7b('0x63')];return db['SmsMessage']['find']({'where':{'id':_0x472138[_0xdc7b('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52a29f,null))['then'](function(_0x438afd){if(_0x438afd){_0x18a690['message']=_0x438afd[_0xdc7b('0x66')]({'plain':!![]});return db[_0xdc7b('0x80')][_0xdc7b('0x5b')]({'where':{'id':_0x438afd[_0xdc7b('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x52a29f,null))[_0xdc7b('0x20')](function(_0x28bbc1){if(_0x28bbc1){_0x18a690[_0xdc7b('0x6a')]=_0x28bbc1[_0xdc7b('0x66')]({'plain':!![]});interaction_log['info'](_0xdc7b('0x81'),_0x472138['user']['id'],_0x472138['user']['name'],_0x472138[_0xdc7b('0x64')][_0xdc7b('0x82')],_0x18a690[_0xdc7b('0x6a')]['id'],_0x472138['body']?JSON[_0xdc7b('0x24')](_0x472138[_0xdc7b('0x5a')]):_0xdc7b('0x6c'));return respondWithRpcPromise('RejectMessage',_0xdc7b('0x83'),_0x18a690);}return null;})[_0xdc7b('0x20')](function(_0x5da655){var _0x51ae68='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5da655[_0xdc7b('0x27')][_0xdc7b('0x6f')];return db['sequelize'][_0xdc7b('0x44')](_0x51ae68,{'type':db[_0xdc7b('0x71')][_0xdc7b('0x72')][_0xdc7b('0x73')],'raw':!![]})[_0xdc7b('0x20')](function(_0x1943a8){return _0x1943a8;});})[_0xdc7b('0x20')](function(_0x34f4d9){if(_0x34f4d9){_0x18a690[_0xdc7b('0x27')]['contact']=_0x34f4d9[0x0];if(!_0x472138['body'][_0xdc7b('0x63')])return;return db[_0xdc7b('0x84')][_0xdc7b('0x5b')]({'where':{'id':_0x472138['body'][_0xdc7b('0x63')],'role':_0xdc7b('0x65')},'attributes':['id',_0xdc7b('0x3b'),_0xdc7b('0x74'),_0xdc7b('0x75'),_0xdc7b('0x76')],'raw':!![]});}return null;})[_0xdc7b('0x20')](function(_0x44cc4c){if(!_0x44cc4c)return null;_0x18a690[_0xdc7b('0x27')][_0xdc7b('0x65')]=_0x44cc4c;return _0x18a690;})['then'](function(_0x4d474b){if(_0x4d474b){_0x4d474b[_0xdc7b('0x27')][_0xdc7b('0x78')]=util[_0xdc7b('0x79')](_0xdc7b('0x7a'),_0x472138[_0xdc7b('0x64')][_0xdc7b('0x3b')]);_0x4d474b[_0xdc7b('0x27')][_0xdc7b('0x7b')]=_0x18a690['channel'];_0x4d474b[_0xdc7b('0x27')][_0xdc7b('0x7c')]=_0x18a690[_0xdc7b('0x7b')];_0x4d474b[_0xdc7b('0x27')][_0xdc7b('0x7d')]=_0xdc7b('0x35');respondWithRpcPromise('EventManager',_0xdc7b('0x7e'),{'event':_0xdc7b('0x85'),'message':_0x4d474b[_0xdc7b('0x27')]},client9002);return _0x18a690;}return null;})['then'](respondWithResult(_0x52a29f,null))[_0xdc7b('0x2a')](handleError(_0x52a29f,null));};exports[_0xdc7b('0x2c')]=function(_0x54d0bb,_0x525099,_0x58f693){if(_0x54d0bb['body']['id']){delete _0x54d0bb[_0xdc7b('0x5a')]['id'];}var _0x20f062;return db[_0xdc7b('0x3e')][_0xdc7b('0x5b')]({'where':{'id':_0x54d0bb[_0xdc7b('0x57')]['id']}})[_0xdc7b('0x20')](handleEntityNotFound(_0x525099,null))[_0xdc7b('0x20')](function(_0x1bdca2){if(_0x1bdca2){_0x20f062=_0x1bdca2;return db[_0xdc7b('0x86')][_0xdc7b('0x5b')]({'where':{'id':_0x1bdca2[_0xdc7b('0x87')]}});}})[_0xdc7b('0x20')](handleEntityNotFound(_0x525099,null))[_0xdc7b('0x20')](function(_0x8501da){if(_0x8501da){logger[_0xdc7b('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc7b('0x2c'),_0xdc7b('0x88'),_0x8501da['type'],util[_0xdc7b('0x89')](_0x54d0bb[_0xdc7b('0x5a')],{'showHidden':![],'depth':null}));switch(_0x8501da[_0xdc7b('0x41')]){case _0xdc7b('0x8a'):if(_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x8b')]&&_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x8b')]===_0x20f062[_0xdc7b('0x8c')]){return _0x20f062[_0xdc7b('0x37')]({'read':!![]});}else{logger[_0xdc7b('0x25')](_0xdc7b('0x8d'),_0xdc7b('0x2c'),'twilio',util['inspect'](_0x54d0bb[_0xdc7b('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdc7b('0x8e'):if(_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x8f')]&&_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x8f')]===_0x20f062['messageId']&&_[_0xdc7b('0x90')]([_0xdc7b('0x91'),_0xdc7b('0x92')],_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x93')])>=0x0){return _0x20f062[_0xdc7b('0x37')]({'read':!![]});}else{logger[_0xdc7b('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdc7b('0x2c'),'plivio',util[_0xdc7b('0x89')](_0x54d0bb['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x32df27=_0x54d0bb[_0xdc7b('0x5a')][_0xdc7b('0x94')][0x0];if(_0x32df27[_0xdc7b('0x2c')][_0xdc7b('0x95')]===_0xdc7b('0x96')){return _0x20f062['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdc7b('0x2c'),_0xdc7b('0x97'),util[_0xdc7b('0x89')](_0x54d0bb[_0xdc7b('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x20f062;}})[_0xdc7b('0x20')](respondWithResult(_0x525099,null))[_0xdc7b('0x2a')](handleError(_0x525099,null));}; \ No newline at end of file +var _0x6f83=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','stack','name','index','SmsMessage','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','rawAttributes','include','find','create','body','destroy','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','user','role','null','acceptMessage','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','SmsAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsMessage.socket','register','client','http','info','request\x20sent','debug'];(function(_0x2d0733,_0x53fc28){var _0xb67250=function(_0x111705){while(--_0x111705){_0x2d0733['push'](_0x2d0733['shift']());}};_0xb67250(++_0x53fc28);}(_0x6f83,0x72));var _0x36f8=function(_0x2fb721,_0x29d43e){_0x2fb721=_0x2fb721-0x0;var _0x74fa8c=_0x6f83[_0x2fb721];return _0x74fa8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36f8('0x0'));var zipdir=require(_0x36f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36f8('0x2'));var moment=require(_0x36f8('0x3'));var BPromise=require(_0x36f8('0x4'));var Mustache=require(_0x36f8('0x5'));var util=require(_0x36f8('0x6'));var path=require(_0x36f8('0x7'));var sox=require(_0x36f8('0x8'));var csv=require(_0x36f8('0x9'));var ejs=require(_0x36f8('0xa'));var fs=require('fs');var fs_extra=require(_0x36f8('0xb'));var _=require(_0x36f8('0xc'));var squel=require(_0x36f8('0xd'));var crypto=require(_0x36f8('0xe'));var jsforce=require(_0x36f8('0xf'));var deskjs=require(_0x36f8('0x10'));var toCsv=require(_0x36f8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x36f8('0x11'));var qs=require(_0x36f8('0x12'));var as=require(_0x36f8('0x13'));var hardwareService=require(_0x36f8('0x14'));var logger=require(_0x36f8('0x15'))(_0x36f8('0x16'));var utils=require(_0x36f8('0x17'));var config=require(_0x36f8('0x18'));var licenseUtil=require(_0x36f8('0x19'));var db=require('../../mysqldb')['db'];config[_0x36f8('0x1a')]=_[_0x36f8('0x1b')](config[_0x36f8('0x1a')],{'host':_0x36f8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36f8('0x1a')]));require(_0x36f8('0x1d'))[_0x36f8('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x36f8('0x1f')][_0x36f8('0x20')]({'port':0x232c});var client9002=jayson[_0x36f8('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x429efc,_0x3e3281,_0x36596e,_0x3525ab){return new BPromise(function(_0x5ec545,_0x5d52b8){var _0x3f9947=_0x3525ab||client;return _0x3f9947['request'](_0x429efc,_0x36596e)['then'](function(_0x3db780){logger[_0x36f8('0x21')]('SmsMessage,\x20%s,\x20%s',_0x3e3281,_0x36f8('0x22'));logger[_0x36f8('0x23')](_0x36f8('0x24'),_0x3e3281,_0x36f8('0x22'),JSON[_0x36f8('0x25')](_0x3db780));if(_0x3db780[_0x36f8('0x26')]){if(_0x3db780[_0x36f8('0x26')][_0x36f8('0x27')]===0x1f4){logger[_0x36f8('0x26')](_0x36f8('0x28'),_0x3e3281,_0x3db780[_0x36f8('0x26')][_0x36f8('0x29')]);return _0x5d52b8(_0x3db780['error'][_0x36f8('0x29')]);}logger[_0x36f8('0x26')](_0x36f8('0x28'),_0x3e3281,_0x3db780['error'][_0x36f8('0x29')]);return _0x5ec545(_0x3db780['error'][_0x36f8('0x29')]);}else{logger[_0x36f8('0x21')]('SmsMessage,\x20%s,\x20%s',_0x3e3281,_0x36f8('0x22'));_0x5ec545(_0x3db780['result'][_0x36f8('0x29')]);}})[_0x36f8('0x2a')](function(_0xb2acc5){logger[_0x36f8('0x26')](_0x36f8('0x28'),_0x3e3281,_0xb2acc5);_0x5d52b8(_0xb2acc5);});});}function respondWithStatusCode(_0xc3381b,_0x59291b){_0x59291b=_0x59291b||0xcc;return function(_0x462fd2){if(_0x462fd2){return _0xc3381b[_0x36f8('0x2b')](_0x59291b);}return _0xc3381b[_0x36f8('0x2c')](_0x59291b)[_0x36f8('0x2d')]();};}function respondWithResult(_0x38b1f1,_0x1a4fed){_0x1a4fed=_0x1a4fed||0xc8;return function(_0xdd5ac5){if(_0xdd5ac5){return _0x38b1f1[_0x36f8('0x2c')](_0x1a4fed)[_0x36f8('0x2e')](_0xdd5ac5);}};}function respondWithFilteredResult(_0x51a2a1,_0x449882){return function(_0x1f67ea){if(_0x1f67ea){var _0x3f01a6=typeof _0x449882[_0x36f8('0x2f')]===_0x36f8('0x30')&&typeof _0x449882[_0x36f8('0x31')]==='undefined';var _0x6d469d=_0x1f67ea[_0x36f8('0x32')];var _0x151803=_0x3f01a6?0x0:_0x449882[_0x36f8('0x2f')];var _0x23ddfb=_0x3f01a6?_0x1f67ea[_0x36f8('0x32')]:_0x449882[_0x36f8('0x2f')]+_0x449882[_0x36f8('0x31')];var _0x3762c8;if(_0x23ddfb>=_0x6d469d){_0x23ddfb=_0x6d469d;_0x3762c8=0xc8;}else{_0x3762c8=0xce;}_0x51a2a1[_0x36f8('0x2c')](_0x3762c8);return _0x51a2a1[_0x36f8('0x33')]('Content-Range',_0x151803+'-'+_0x23ddfb+'/'+_0x6d469d)['json'](_0x1f67ea);}return null;};}function patchUpdates(_0x4a4c14){return function(_0x37bf98){try{jsonpatch[_0x36f8('0x34')](_0x37bf98,_0x4a4c14,!![]);}catch(_0xdfec16){return BPromise['reject'](_0xdfec16);}return _0x37bf98[_0x36f8('0x35')]();};}function saveUpdates(_0x24d19c,_0x605541){return function(_0x37f58f){if(_0x37f58f){return _0x37f58f[_0x36f8('0x36')](_0x24d19c)[_0x36f8('0x37')](function(_0x823b3d){return _0x823b3d;});}return null;};}function removeEntity(_0x7caeb5,_0xa8a16a){return function(_0x4089bf){if(_0x4089bf){return _0x4089bf['destroy']()[_0x36f8('0x37')](function(){_0x7caeb5[_0x36f8('0x2c')](0xcc)[_0x36f8('0x2d')]();});}};}function handleEntityNotFound(_0x1eb28f,_0x369dc9){return function(_0x5b223a){if(!_0x5b223a){_0x1eb28f[_0x36f8('0x2b')](0x194);}return _0x5b223a;};}function handleError(_0x9801ab,_0xc7933b){_0xc7933b=_0xc7933b||0x1f4;return function(_0x58649d){logger[_0x36f8('0x26')](_0x58649d[_0x36f8('0x38')]);if(_0x58649d[_0x36f8('0x39')]){delete _0x58649d[_0x36f8('0x39')];}_0x9801ab['status'](_0xc7933b)['send'](_0x58649d);};}exports[_0x36f8('0x3a')]=function(_0x1e7132,_0x29959e){var _0x21270a={},_0x24e310={},_0x1c5f22={'count':0x0,'rows':[]};var _0x1e231e=_['map'](db[_0x36f8('0x3b')]['rawAttributes'],function(_0x258c27){return{'name':_0x258c27[_0x36f8('0x3c')],'type':_0x258c27[_0x36f8('0x3d')]['key']};});_0x24e310['model']=_[_0x36f8('0x3e')](_0x1e231e,_0x36f8('0x39'));_0x24e310[_0x36f8('0x3f')]=_[_0x36f8('0x40')](_0x1e7132[_0x36f8('0x3f')]);_0x24e310[_0x36f8('0x41')]=_[_0x36f8('0x42')](_0x24e310[_0x36f8('0x43')],_0x24e310[_0x36f8('0x3f')]);_0x21270a[_0x36f8('0x44')]=_['intersection'](_0x24e310[_0x36f8('0x43')],qs[_0x36f8('0x45')](_0x1e7132[_0x36f8('0x3f')][_0x36f8('0x45')]));_0x21270a[_0x36f8('0x44')]=_0x21270a['attributes'][_0x36f8('0x46')]?_0x21270a[_0x36f8('0x44')]:_0x24e310[_0x36f8('0x43')];if(!_0x1e7132['query'][_0x36f8('0x47')](_0x36f8('0x48'))){_0x21270a[_0x36f8('0x31')]=qs[_0x36f8('0x31')](_0x1e7132[_0x36f8('0x3f')]['limit']);_0x21270a[_0x36f8('0x2f')]=qs[_0x36f8('0x2f')](_0x1e7132[_0x36f8('0x3f')][_0x36f8('0x2f')]);}_0x21270a[_0x36f8('0x49')]=qs[_0x36f8('0x4a')](_0x1e7132[_0x36f8('0x3f')][_0x36f8('0x4a')]);_0x21270a['where']=qs[_0x36f8('0x41')](_['pick'](_0x1e7132[_0x36f8('0x3f')],_0x24e310[_0x36f8('0x41')]),_0x1e231e);if(_0x1e7132['query'][_0x36f8('0x4b')]){_0x21270a[_0x36f8('0x4c')]=_['merge'](_0x21270a['where'],{'$or':_[_0x36f8('0x3e')](_0x1e231e,function(_0x2885c8){if(_0x2885c8[_0x36f8('0x3d')]!==_0x36f8('0x4d')){var _0x31b7ee={};_0x31b7ee[_0x2885c8['name']]={'$like':'%'+_0x1e7132['query'][_0x36f8('0x4b')]+'%'};return _0x31b7ee;}})});}_0x21270a=_[_0x36f8('0x4e')]({},_0x21270a,_0x1e7132[_0x36f8('0x4f')]);var _0xd492f1={'where':_0x21270a[_0x36f8('0x4c')]};return db['SmsMessage']['count'](_0xd492f1)[_0x36f8('0x37')](function(_0x1f173d){_0x1c5f22[_0x36f8('0x32')]=_0x1f173d;if(_0x1e7132[_0x36f8('0x3f')][_0x36f8('0x50')]){_0x21270a['include']=[{'all':!![]}];}return db[_0x36f8('0x3b')]['findAll'](_0x21270a);})[_0x36f8('0x37')](function(_0x1c546d){_0x1c5f22[_0x36f8('0x51')]=_0x1c546d;return _0x1c5f22;})['then'](respondWithFilteredResult(_0x29959e,_0x21270a))[_0x36f8('0x2a')](handleError(_0x29959e,null));};exports[_0x36f8('0x52')]=function(_0xee9639,_0x29f4e3){var _0x3dba01={'raw':!![],'where':{'id':_0xee9639[_0x36f8('0x53')]['id']}},_0x5942c1={};_0x5942c1['model']=_['keys'](db['SmsMessage'][_0x36f8('0x54')]);_0x5942c1[_0x36f8('0x3f')]=_[_0x36f8('0x40')](_0xee9639[_0x36f8('0x3f')]);_0x5942c1[_0x36f8('0x41')]=_['intersection'](_0x5942c1['model'],_0x5942c1[_0x36f8('0x3f')]);_0x3dba01[_0x36f8('0x44')]=_[_0x36f8('0x42')](_0x5942c1[_0x36f8('0x43')],qs['fields'](_0xee9639['query'][_0x36f8('0x45')]));_0x3dba01['attributes']=_0x3dba01[_0x36f8('0x44')][_0x36f8('0x46')]?_0x3dba01['attributes']:_0x5942c1[_0x36f8('0x43')];if(_0xee9639['query']['includeAll']){_0x3dba01[_0x36f8('0x55')]=[{'all':!![]}];}_0x3dba01=_['merge']({},_0x3dba01,_0xee9639[_0x36f8('0x4f')]);return db['SmsMessage'][_0x36f8('0x56')](_0x3dba01)[_0x36f8('0x37')](handleEntityNotFound(_0x29f4e3,null))[_0x36f8('0x37')](respondWithResult(_0x29f4e3,null))['catch'](handleError(_0x29f4e3,null));};exports[_0x36f8('0x57')]=function(_0x194578,_0x240286){return db['SmsMessage'][_0x36f8('0x57')](_0x194578['body'],{})[_0x36f8('0x37')](respondWithResult(_0x240286,0xc9))[_0x36f8('0x2a')](handleError(_0x240286,null));};exports[_0x36f8('0x36')]=function(_0x3e275a,_0x216aff){if(_0x3e275a[_0x36f8('0x58')]['id']){delete _0x3e275a[_0x36f8('0x58')]['id'];}return db[_0x36f8('0x3b')][_0x36f8('0x56')]({'where':{'id':_0x3e275a[_0x36f8('0x53')]['id']}})[_0x36f8('0x37')](handleEntityNotFound(_0x216aff,null))[_0x36f8('0x37')](saveUpdates(_0x3e275a[_0x36f8('0x58')],null))[_0x36f8('0x37')](respondWithResult(_0x216aff,null))[_0x36f8('0x2a')](handleError(_0x216aff,null));};exports[_0x36f8('0x59')]=function(_0x4b158a,_0x351d22){return db['SmsMessage'][_0x36f8('0x56')]({'where':{'id':_0x4b158a[_0x36f8('0x53')]['id']}})[_0x36f8('0x37')](handleEntityNotFound(_0x351d22,null))[_0x36f8('0x37')](removeEntity(_0x351d22,null))[_0x36f8('0x2a')](handleError(_0x351d22,null));};exports[_0x36f8('0x5a')]=function(_0x65b81c,_0x35bf06){return db[_0x36f8('0x3b')][_0x36f8('0x5a')]()['then'](respondWithResult(_0x35bf06,null))[_0x36f8('0x2a')](handleError(_0x35bf06,null));};var interaction_log=require(_0x36f8('0x15'))(_0x36f8('0x5b'));exports[_0x36f8('0x5c')]=function(_0x433925,_0x122ef3,_0xe89a0){var _0x16cc7a={'agent':{},'channel':'sms'};if(_0x433925[_0x36f8('0x58')]['id']){delete _0x433925[_0x36f8('0x58')]['id'];}_0x433925['body'][_0x36f8('0x5d')]=!![];_0x433925[_0x36f8('0x58')][_0x36f8('0x5e')]=moment()[_0x36f8('0x5f')](_0x36f8('0x60'));_0x433925[_0x36f8('0x58')][_0x36f8('0x61')]=_0x433925[_0x36f8('0x58')][_0x36f8('0x61')]||_0x433925['user']['id'];_0x16cc7a[_0x36f8('0x62')]['id']=_0x433925['body'][_0x36f8('0x61')];return db[_0x36f8('0x3b')][_0x36f8('0x56')]({'where':{'id':_0x433925[_0x36f8('0x53')]['id'],'UserId':null}})[_0x36f8('0x37')](handleEntityNotFound(_0x122ef3,null))['then'](saveUpdates(_0x433925['body'],null))['then'](function(_0x310ddf){if(_0x310ddf){_0x16cc7a['message']=_0x310ddf[_0x36f8('0x63')]({'plain':!![]});return db[_0x36f8('0x64')]['find']({'where':{'id':_0x310ddf[_0x36f8('0x65')]}});}return null;})[_0x36f8('0x37')](handleEntityNotFound(_0x122ef3,null))[_0x36f8('0x37')](function(_0x59f43b){if(_0x59f43b){return _0x59f43b[_0x36f8('0x36')]({'UserId':_0x433925[_0x36f8('0x58')][_0x36f8('0x61')],'read1stAt':_[_0x36f8('0x66')](_0x59f43b[_0x36f8('0x67')])?moment()[_0x36f8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x36f8('0x37')](function(_0xf03c48){if(_0xf03c48){_0x16cc7a[_0x36f8('0x68')]=_0xf03c48[_0x36f8('0x63')]({'plain':!![]});interaction_log[_0x36f8('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x433925[_0x36f8('0x69')]['id'],_0x433925[_0x36f8('0x69')][_0x36f8('0x39')],_0x433925['user'][_0x36f8('0x6a')],_0x16cc7a['interaction']['id'],_0x433925[_0x36f8('0x58')]?JSON['stringify'](_0x433925[_0x36f8('0x58')]):_0x36f8('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x36f8('0x6c'),_0x16cc7a);}return null;})[_0x36f8('0x37')](function(_0x5f2319){var _0x1af693='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f2319[_0x36f8('0x29')]['ContactId'];return db[_0x36f8('0x6d')]['query'](_0x1af693,{'type':db['Sequelize']['QueryTypes'][_0x36f8('0x6e')],'raw':!![]})[_0x36f8('0x37')](function(_0x1d616c){return _0x1d616c;});})[_0x36f8('0x37')](function(_0x4d1920){if(_0x4d1920){_0x16cc7a[_0x36f8('0x29')][_0x36f8('0x6f')]=_0x4d1920[0x0];if(!_0x433925[_0x36f8('0x58')][_0x36f8('0x61')])return;return db[_0x36f8('0x70')][_0x36f8('0x56')]({'where':{'id':_0x433925[_0x36f8('0x58')][_0x36f8('0x61')],'role':_0x36f8('0x62')},'attributes':['id','name',_0x36f8('0x71'),_0x36f8('0x72'),_0x36f8('0x73')],'raw':!![]});}return null;})[_0x36f8('0x37')](function(_0x5e70c4){if(!_0x5e70c4)return null;_0x16cc7a['message']['agent']=_0x5e70c4;return _0x16cc7a;})[_0x36f8('0x37')](function(_0x18b79d){if(_0x18b79d){if(_0x433925['body'][_0x36f8('0x74')]){_0x16cc7a[_0x36f8('0x29')][_0x36f8('0x75')]=util['format'](_0x36f8('0x76'),_0x433925[_0x36f8('0x69')]['name']);_0x16cc7a[_0x36f8('0x29')][_0x36f8('0x77')]=_0x16cc7a[_0x36f8('0x77')];_0x16cc7a[_0x36f8('0x29')][_0x36f8('0x78')]=_0x16cc7a[_0x36f8('0x77')];_0x16cc7a[_0x36f8('0x29')][_0x36f8('0x79')]=_0x36f8('0x5c');return respondWithRpcPromise(_0x36f8('0x7a'),_0x36f8('0x7a'),{'event':_0x36f8('0x7b'),'message':_0x16cc7a['message']},client9002)[_0x36f8('0x37')](function(){return _0x16cc7a;});}return _0x16cc7a;}return null;})[_0x36f8('0x37')](respondWithResult(_0x122ef3,null))[_0x36f8('0x2a')](handleError(_0x122ef3,null));};var interaction_log=require(_0x36f8('0x15'))(_0x36f8('0x5b'));exports[_0x36f8('0x7c')]=function(_0x56d85e,_0x260d47,_0x238188){var _0x471e01={'agent':{},'channel':_0x36f8('0x7d')};if(_0x56d85e[_0x36f8('0x58')]['id']){delete _0x56d85e[_0x36f8('0x58')]['id'];}_0x56d85e[_0x36f8('0x58')]['UserId']=_0x56d85e['body'][_0x36f8('0x61')]||_0x56d85e[_0x36f8('0x69')]['id'];_0x471e01['agent']['id']=_0x56d85e[_0x36f8('0x58')][_0x36f8('0x61')];return db[_0x36f8('0x3b')][_0x36f8('0x56')]({'where':{'id':_0x56d85e['params']['id'],'UserId':null}})[_0x36f8('0x37')](handleEntityNotFound(_0x260d47,null))['then'](function(_0x1d4239){if(_0x1d4239){_0x471e01[_0x36f8('0x29')]=_0x1d4239[_0x36f8('0x63')]({'plain':!![]});return db[_0x36f8('0x64')][_0x36f8('0x56')]({'where':{'id':_0x1d4239[_0x36f8('0x65')]}});}return null;})[_0x36f8('0x37')](handleEntityNotFound(_0x260d47,null))['then'](function(_0x1d0485){if(_0x1d0485){_0x471e01[_0x36f8('0x68')]=_0x1d0485[_0x36f8('0x63')]({'plain':!![]});interaction_log[_0x36f8('0x21')](_0x36f8('0x7e'),_0x56d85e[_0x36f8('0x69')]['id'],_0x56d85e[_0x36f8('0x69')]['name'],_0x56d85e['user'][_0x36f8('0x6a')],_0x471e01[_0x36f8('0x68')]['id'],_0x56d85e[_0x36f8('0x58')]?JSON[_0x36f8('0x25')](_0x56d85e['body']):_0x36f8('0x6b'));return respondWithRpcPromise(_0x36f8('0x7f'),_0x36f8('0x80'),_0x471e01);}return null;})[_0x36f8('0x37')](function(_0x224912){var _0x49d22c=_0x36f8('0x81')+_0x224912[_0x36f8('0x29')][_0x36f8('0x82')];return db[_0x36f8('0x6d')][_0x36f8('0x3f')](_0x49d22c,{'type':db[_0x36f8('0x83')]['QueryTypes']['SELECT'],'raw':!![]})[_0x36f8('0x37')](function(_0x5211af){return _0x5211af;});})[_0x36f8('0x37')](function(_0xa317f8){if(_0xa317f8){_0x471e01[_0x36f8('0x29')]['contact']=_0xa317f8[0x0];if(!_0x56d85e['body'][_0x36f8('0x61')])return;return db[_0x36f8('0x70')]['find']({'where':{'id':_0x56d85e[_0x36f8('0x58')][_0x36f8('0x61')],'role':_0x36f8('0x62')},'attributes':['id',_0x36f8('0x39'),'fullname',_0x36f8('0x72'),_0x36f8('0x73')],'raw':!![]});}return null;})[_0x36f8('0x37')](function(_0x1bd045){if(!_0x1bd045)return null;_0x471e01['message']['agent']=_0x1bd045;return _0x471e01;})[_0x36f8('0x37')](function(_0x26bf10){if(_0x26bf10){_0x26bf10[_0x36f8('0x29')][_0x36f8('0x75')]=util[_0x36f8('0x5f')](_0x36f8('0x76'),_0x56d85e['user']['name']);_0x26bf10[_0x36f8('0x29')][_0x36f8('0x77')]=_0x471e01[_0x36f8('0x77')];_0x26bf10[_0x36f8('0x29')]['motionChannel']=_0x471e01[_0x36f8('0x77')];_0x26bf10['message']['event']=_0x36f8('0x7c');respondWithRpcPromise(_0x36f8('0x7a'),_0x36f8('0x7a'),{'event':_0x36f8('0x84'),'message':_0x26bf10['message']},client9002);return _0x471e01;}return null;})[_0x36f8('0x37')](respondWithResult(_0x260d47,null))[_0x36f8('0x2a')](handleError(_0x260d47,null));};exports[_0x36f8('0x2c')]=function(_0xbae81c,_0x430afe,_0x11b8ed){if(_0xbae81c[_0x36f8('0x58')]['id']){delete _0xbae81c[_0x36f8('0x58')]['id'];}var _0x4713b2;return db[_0x36f8('0x3b')][_0x36f8('0x56')]({'where':{'id':_0xbae81c[_0x36f8('0x53')]['id']}})[_0x36f8('0x37')](handleEntityNotFound(_0x430afe,null))[_0x36f8('0x37')](function(_0x3dad48){if(_0x3dad48){_0x4713b2=_0x3dad48;return db[_0x36f8('0x85')]['find']({'where':{'id':_0x3dad48[_0x36f8('0x86')]}});}})[_0x36f8('0x37')](handleEntityNotFound(_0x430afe,null))[_0x36f8('0x37')](function(_0x212e60){if(_0x212e60){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x36f8('0x2c'),_0x36f8('0x87'),_0x212e60[_0x36f8('0x3d')],util['inspect'](_0xbae81c[_0x36f8('0x58')],{'showHidden':![],'depth':null}));switch(_0x212e60[_0x36f8('0x3d')]){case _0x36f8('0x88'):if(_0xbae81c['body']['MessageSid']&&_0xbae81c[_0x36f8('0x58')][_0x36f8('0x89')]===_0x4713b2[_0x36f8('0x8a')]){return _0x4713b2[_0x36f8('0x36')]({'read':!![]});}else{logger[_0x36f8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x36f8('0x2c'),'twilio',util[_0x36f8('0x8b')](_0xbae81c[_0x36f8('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xbae81c[_0x36f8('0x58')][_0x36f8('0x8c')]&&_0xbae81c['body'][_0x36f8('0x8c')]===_0x4713b2['messageId']&&_[_0x36f8('0x8d')]([_0x36f8('0x8e'),_0x36f8('0x8f')],_0xbae81c[_0x36f8('0x58')][_0x36f8('0x90')])>=0x0){return _0x4713b2['update']({'read':!![]});}else{logger[_0x36f8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x36f8('0x2c'),_0x36f8('0x91'),util[_0x36f8('0x8b')](_0xbae81c['body'],{'showHidden':![],'depth':null}));}break;case _0x36f8('0x92'):var _0xfe721=_0xbae81c['body'][_0x36f8('0x93')][0x0];if(_0xfe721[_0x36f8('0x2c')][_0x36f8('0x94')]==='DELIVERED'){return _0x4713b2['update']({'read':!![]});}else{logger['error'](_0x36f8('0x95'),_0x36f8('0x2c'),_0x36f8('0x92'),util[_0x36f8('0x8b')](_0xbae81c[_0x36f8('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x4713b2;}})[_0x36f8('0x37')](respondWithResult(_0x430afe,null))[_0x36f8('0x2a')](handleError(_0x430afe,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8129658..b03ef47 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 _0x91f3=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x57eb2d,_0x5e4918){var _0xd8e18=function(_0x189389){while(--_0x189389){_0x57eb2d['push'](_0x57eb2d['shift']());}};_0xd8e18(++_0x5e4918);}(_0x91f3,0x76));var _0x391f=function(_0x44b6f8,_0x302591){_0x44b6f8=_0x44b6f8-0x0;var _0x32b459=_0x91f3[_0x44b6f8];return _0x32b459;};'use strict';var EventEmitter=require(_0x391f('0x0'));var SmsMessage=require(_0x391f('0x1'))['db'][_0x391f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x391f('0x3')](0x0);var events={'afterCreate':_0x391f('0x4'),'afterUpdate':_0x391f('0x5'),'afterDestroy':_0x391f('0x6')};function emitEvent(_0x34a03a){return function(_0x489d54,_0x48945f,_0x1389b0){SmsMessageEvents[_0x391f('0x7')](_0x34a03a+':'+_0x489d54['id'],_0x489d54);SmsMessageEvents[_0x391f('0x7')](_0x34a03a,_0x489d54);_0x1389b0(null);};}for(var e in events){if(events[_0x391f('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x391f('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xeef4=['exports','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x106151,_0x372724){var _0x5c5182=function(_0x4eec4e){while(--_0x4eec4e){_0x106151['push'](_0x106151['shift']());}};_0x5c5182(++_0x372724);}(_0xeef4,0x1a9));var _0x4eef=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0xeef4[_0x2abaae];return _0x5b5745;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4eef('0x0')](0x0);var events={'afterCreate':_0x4eef('0x1'),'afterUpdate':_0x4eef('0x2'),'afterDestroy':_0x4eef('0x3')};function emitEvent(_0x4df411){return function(_0xf66518,_0x3f0318,_0xfefe5c){SmsMessageEvents[_0x4eef('0x4')](_0x4df411+':'+_0xf66518['id'],_0xf66518);SmsMessageEvents[_0x4eef('0x4')](_0x4df411,_0xf66518);_0xfefe5c(null);};}for(var e in events){if(events[_0x4eef('0x5')](e)){var event=events[e];SmsMessage[_0x4eef('0x6')](e,emitEvent(event));}}module[_0x4eef('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7d375d9..ef258bf 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 _0xe289=['crypto','apiKey','login','text','timestamp','keys','sort','createHash','digest','signature=','csc','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','status','intelepeer','finally','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','createdAt','error','find','SmsAccountId','twilio','accountSid','authToken','messages','create','phone','/api/sms/messages/','/status?token=','token','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url'];(function(_0x203dfa,_0x19b6f6){var _0x4a5283=function(_0x63167a){while(--_0x63167a){_0x203dfa['push'](_0x203dfa['shift']());}};_0x4a5283(++_0x19b6f6);}(_0xe289,0x92));var _0x9e28=function(_0x538af4,_0x38f152){_0x538af4=_0x538af4-0x0;var _0x28d15f=_0xe289[_0x538af4];return _0x28d15f;};'use strict';var _=require('lodash');var util=require(_0x9e28('0x0'));var logger=require(_0x9e28('0x1'))(_0x9e28('0x2'));var moment=require('moment');var BPromise=require(_0x9e28('0x3'));var rp=require(_0x9e28('0x4'));var fs=require('fs');var path=require(_0x9e28('0x5'));var rimraf=require(_0x9e28('0x6'));var config=require(_0x9e28('0x7'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x5678d2,_0xc1c87e){return _0x5678d2[_0x9e28('0x8')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x9e28('0x9'),'fields':[_0x9e28('0x9')]},{'name':_0x9e28('0xa'),'fields':[_0x9e28('0xb')],'type':_0x9e28('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ea2e6,_0x1a84df,_0x12d7fc){var _0x10908d=_0x5678d2[_0x9e28('0xd')];var _0x4b56d9=_0x3ea2e6[_0x9e28('0xe')]({'plain':!![]});if(_0x4b56d9[_0x9e28('0xf')][_0x9e28('0x10')]()==='in'||_0x4b56d9[_0x9e28('0xf')][_0x9e28('0x10')]()===_0x9e28('0x11')&&!_0x4b56d9[_0x9e28('0x12')]&&!_[_0x9e28('0x13')](_0x4b56d9[_0x9e28('0x14')])&&!_[_0x9e28('0x13')](_0x4b56d9[_0x9e28('0x15')])){_0x10908d[_0x9e28('0x16')]['findOne']({'where':{'id':_0x4b56d9[_0x9e28('0x15')]}})[_0x9e28('0x17')](function(_0x2dd0ef){if(_0x2dd0ef){_0x2dd0ef['update']({'lastMsgAt':_0x4b56d9[_0x9e28('0x18')],'lastMsgDirection':_0x4b56d9[_0x9e28('0xf')][_0x9e28('0x10')]()});}})['catch'](function(_0xa97298){console[_0x9e28('0x19')](_0xa97298);});}if(_0x4b56d9[_0x9e28('0xf')]===_0x9e28('0x11')&&!_0x4b56d9['secret']){var _0x4a65d3;_0x10908d['SmsAccount'][_0x9e28('0x1a')]({'where':{'id':_0x4b56d9[_0x9e28('0x1b')]},'raw':!![]})[_0x9e28('0x17')](function(_0x2048cc){_0x4a65d3=_0x2048cc;if(_0x4a65d3&&_0x4a65d3['type']){switch(_0x4a65d3['type']){case _0x9e28('0x1c'):var _0x34be4d=require(_0x9e28('0x1c'));if(_0x4a65d3[_0x9e28('0x1d')]&&_0x4a65d3[_0x9e28('0x1e')]&&_0x4a65d3['phone']){var _0x25108c=new _0x34be4d(_0x4a65d3[_0x9e28('0x1d')],_0x4a65d3['authToken']);_0x25108c[_0x9e28('0x1f')][_0x9e28('0x20')]({'body':_0x4b56d9['body'],'to':_0x4b56d9[_0x9e28('0x21')],'from':_0x4a65d3[_0x9e28('0x21')],'statusCallback':_0x4a65d3['remote']+_0x9e28('0x22')+_0x4b56d9['id']+_0x9e28('0x23')+_0x4a65d3[_0x9e28('0x24')]})[_0x9e28('0x17')](function(_0x4b4d5e){if(_0x4b4d5e[_0x9e28('0x25')]){return _0x3ea2e6[_0x9e28('0x26')]({'messageId':_0x4b4d5e[_0x9e28('0x25')]});}})[_0x9e28('0x27')](function(_0x36e8af){logger['error'](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x1c'),util[_0x9e28('0x2a')](_0x36e8af,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x9e28('0x2b'):var _0x79b209=_0x9e28('0x2c');if(_0x4a65d3[_0x9e28('0x2d')]&&_0x4a65d3[_0x9e28('0x2e')]){var _0x30a349={'recipient':[_0x4b56d9[_0x9e28('0x21')]],'message':_0x4b56d9['body'],'message_type':_0x4a65d3[_0x9e28('0x2f')]};if(_0x4a65d3[_0x9e28('0x2f')]&&_0x4a65d3[_0x9e28('0x2f')]!=='SI'){_0x30a349[_0x9e28('0x30')]=_0x4a65d3[_0x9e28('0x21')];}var _0x5645fc={'url':_0x79b209+_0x9e28('0x31')+_0x4a65d3[_0x9e28('0x2d')]+_0x9e28('0x32')+_0x4a65d3[_0x9e28('0x2e')],'method':_0x9e28('0x33')};rp(_0x5645fc)[_0x9e28('0x17')](function(_0x5e576b){var _0x1c97ae=_0x5e576b[_0x9e28('0x34')](';');var _0x256e16={'user_key':_0x1c97ae[0x0],'session_key':_0x1c97ae[0x1]};_0x5645fc={'url':_0x79b209+_0x9e28('0x35'),'method':'POST','headers':{'user_key':_0x256e16[_0x9e28('0x36')],'Session_key':_0x256e16[_0x9e28('0x37')]},'json':!![],'body':_0x30a349};return rp(_0x5645fc);})[_0x9e28('0x17')](function(_0x3d5750){if(_0x3d5750[_0x9e28('0x38')]>=0x1){var _0x1513a7={'messageId':_0x3d5750[_0x9e28('0x39')]};if(_0x4a65d3[_0x9e28('0x2f')]!=='GP'||!_0x4a65d3[_0x9e28('0x3a')]){_0x1513a7[_0x9e28('0x3b')]=!![];}return _0x3ea2e6[_0x9e28('0x26')](_0x1513a7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e28('0x29'),'skebby',util[_0x9e28('0x2a')](_0x3d5750,{'showHidden':![],'depth':null}));}})[_0x9e28('0x27')](function(_0x45f997){return logger['error'](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x2b'),util[_0x9e28('0x2a')](_0x45f997,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x2b'),_0x9e28('0x3c'));}break;case _0x9e28('0x3d'):if(_0x4a65d3[_0x9e28('0x1e')]){var _0x30e564={'recipient':_0x4b56d9[_0x9e28('0x21')],'message':_0x4b56d9['body'],'sender':_0x4a65d3[_0x9e28('0x3e')]||_0x4a65d3['phone'],'authorization':_0x4a65d3[_0x9e28('0x1e')]};var _0x1a84df={'method':_0x9e28('0x3f'),'uri':_0x9e28('0x40'),'body':_0x30e564,'json':!![]};rp(_0x1a84df)[_0x9e28('0x17')](function(_0x123f54){var _0x4f1194={'messageId':_0x123f54[_0x9e28('0x41')]};if(!_0x4a65d3['deliveryReport']){_0x4f1194[_0x9e28('0x3b')]=!![];}return _0x3ea2e6[_0x9e28('0x26')](_0x4f1194);})['catch'](function(_0x1961e2){logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x3d'),util['inspect'](_0x1961e2,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e28('0x29'),'connectel',_0x9e28('0x42'));}break;case _0x9e28('0x43'):if(_0x4a65d3[_0x9e28('0x2d')]&&_0x4a65d3['password']){var _0x30e564={'messages':[{'source':_0x9e28('0x44'),'to':_0x4b56d9['phone'],'body':_0x4b56d9[_0x9e28('0xb')],'from':_0x4a65d3['senderString']||_0x4a65d3[_0x9e28('0x21')]}]};var _0xd204a1=util[_0x9e28('0x45')](_0x9e28('0x46'),_0x4a65d3[_0x9e28('0x2d')],_0x4a65d3[_0x9e28('0x2e')]);var _0x1a84df={'method':_0x9e28('0x3f'),'uri':_0x9e28('0x47'),'body':_0x30e564,'headers':{'Authorization':util[_0x9e28('0x45')](_0x9e28('0x48'),new Buffer(_0xd204a1)[_0x9e28('0x49')](_0x9e28('0x4a')))},'json':!![]};rp(_0x1a84df)[_0x9e28('0x17')](function(_0x3295d4){if(_0x3295d4[_0x9e28('0x4b')]>=0xc8&&_0x3295d4[_0x9e28('0x4b')]<=0xce){if(_0x3295d4[_0x9e28('0x4c')]&&_0x3295d4[_0x9e28('0x4c')][_0x9e28('0x4d')]>0x0){var _0x32a024=_['head'](_0x3295d4[_0x9e28('0x4c')]['messages']);var _0x146af7={'messageId':_0x32a024[_0x9e28('0x4e')]};if(!_0x4a65d3[_0x9e28('0x3a')]){_0x146af7[_0x9e28('0x3b')]=!![];}return _0x3ea2e6['update'](_0x146af7);}else{logger[_0x9e28('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9e28('0x4f'),util[_0x9e28('0x2a')](_0x3295d4,{'showHidden':![],'depth':null}));}}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),'afterCreate','clickSend',util[_0x9e28('0x2a')](_0x3295d4,{'showHidden':![],'depth':null}));}})[_0x9e28('0x27')](function(_0x381f2b){logger[_0x9e28('0x19')](_0x9e28('0x28'),'afterCreate','clickSend',util['inspect'](_0x381f2b,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x4f'),_0x9e28('0x3c'));}break;case _0x9e28('0x50'):if(_0x4a65d3['authId']&&_0x4a65d3[_0x9e28('0x1e')]){var _0x30e564={'dst':_0x4b56d9[_0x9e28('0x21')],'text':_0x4b56d9[_0x9e28('0xb')],'src':_0x4a65d3[_0x9e28('0x3e')]||_0x4a65d3[_0x9e28('0x21')],'url':_0x4a65d3[_0x9e28('0x51')]+_0x9e28('0x22')+_0x4b56d9['id']+_0x9e28('0x23')+_0x4a65d3[_0x9e28('0x24')]};var _0xd204a1=util[_0x9e28('0x45')](_0x9e28('0x46'),_0x4a65d3['authId'],_0x4a65d3[_0x9e28('0x1e')]);var _0x1a84df={'method':'POST','uri':util['format'](_0x9e28('0x52'),_0x4a65d3['authId']),'body':_0x30e564,'headers':{'Authorization':util[_0x9e28('0x45')](_0x9e28('0x48'),new Buffer(_0xd204a1)[_0x9e28('0x49')](_0x9e28('0x4a')))},'json':!![]};rp(_0x1a84df)[_0x9e28('0x17')](function(_0x588316){var _0x18e6b7={'messageId':_0x588316[_0x9e28('0x53')][0x0]};return _0x3ea2e6[_0x9e28('0x26')](_0x18e6b7);})[_0x9e28('0x27')](function(_0x3d7742){logger[_0x9e28('0x19')](_0x9e28('0x28'),'afterCreate',_0x9e28('0x50'),util[_0x9e28('0x2a')](_0x3d7742,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x50'),_0x9e28('0x54'));}break;case'infobip':if(_0x4a65d3[_0x9e28('0x2d')]&&_0x4a65d3['password']){if(_0x4a65d3[_0x9e28('0x55')]){var _0x5e6bef={'method':_0x9e28('0x3f'),'uri':_0x4a65d3[_0x9e28('0x55')]+_0x9e28('0x56'),'body':{'username':_0x4a65d3['username'],'password':_0x4a65d3[_0x9e28('0x2e')]},'json':!![]};return rp(_0x5e6bef)['then'](function(_0x5ad7c3){var _0x17b54a={'method':'POST','uri':_0x4a65d3[_0x9e28('0x55')]+_0x9e28('0x57'),'body':{'messages':[{'from':_0x4a65d3['phone'],'destinations':[{'to':_0x4b56d9[_0x9e28('0x21')]}],'text':_0x4b56d9['body'],'notifyUrl':_0x4a65d3[_0x9e28('0x51')]+_0x9e28('0x22')+_0x4b56d9['id']+'/status?token='+_0x4a65d3[_0x9e28('0x24')],'notifyContentType':_0x9e28('0x58'),'callbackData':_0x4a65d3[_0x9e28('0x21')]+';'+_0x4b56d9['body']}]},'headers':{'Authorization':_0x9e28('0x59')+_0x5ad7c3['token']},'json':!![]};return rp(_0x17b54a)[_0x9e28('0x17')](function(_0x210190){if(_0x210190[_0x9e28('0x1f')]){var _0x3ccdf7={'messageId':_0x210190[_0x9e28('0x1f')][0x0][_0x9e28('0x9')]};if(!_0x4a65d3[_0x9e28('0x3a')]){_0x3ccdf7[_0x9e28('0x3b')]=!![];}return _0x3ea2e6[_0x9e28('0x26')](_0x3ccdf7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e28('0x29'),_0x9e28('0x5a'),util[_0x9e28('0x2a')](_0x210190,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x573a0c){return logger[_0x9e28('0x19')](_0x9e28('0x28'),'afterCreate',_0x9e28('0x5a'),util[_0x9e28('0x2a')](_0x573a0c,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x5a'),_0x9e28('0x5b'));}}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x5a'),_0x9e28('0x3c'));}break;case'csc':var _0x464adf=require(_0x9e28('0x5c'));if(_0x4a65d3[_0x9e28('0x5d')]){var _0x195958={};_0x195958[_0x9e28('0x5e')]=_0x4a65d3['username'];_0x195958[_0x9e28('0x21')]=_0x4b56d9['phone'];_0x195958['sender']=_0x4a65d3[_0x9e28('0x21')];_0x195958[_0x9e28('0x5f')]=_0x4b56d9[_0x9e28('0xb')];_0x195958[_0x9e28('0x60')]=+new Date();var _0x5c175e='';var _0x266150='';var _0x41cf08=Object[_0x9e28('0x61')](_0x195958);_0x41cf08[_0x9e28('0x62')]();for(var _0x30f5db=0x0;_0x30f5db<_0x41cf08['length'];_0x30f5db++){if(_0x5c175e!=''){_0x5c175e+='&';}_0x5c175e+=_0x41cf08[_0x30f5db]+'='+encodeURIComponent(_0x195958[_0x41cf08[_0x30f5db]]);_0x266150+=_0x195958[_0x41cf08[_0x30f5db]];}_0x266150+=_0x4a65d3[_0x9e28('0x5d')];_0x266150=_0x464adf[_0x9e28('0x63')]('md5')[_0x9e28('0x26')](_0x266150)[_0x9e28('0x64')]('hex');if(_0x5c175e!==''){_0x5c175e+='&';}_0x5c175e+=_0x9e28('0x65')+_0x266150;var _0x5645fc={'method':_0x9e28('0x33'),'uri':_0x4a65d3[_0x9e28('0x55')]+'/external/get/send.php?'+_0x5c175e,'json':!![]};return rp(_0x5645fc)[_0x9e28('0x17')](function(_0x544bd2){var _0x542911=Object['keys'](_0x544bd2);if(_0x544bd2[_0x542911[0x0]][_0x9e28('0x19')]&&parseInt(_0x544bd2[_0x542911[0x0]]['error'])===0x0){var _0x1d5a97={'messageId':_0x544bd2[_0x542911[0x0]]['id_sms']};if(!_0x4a65d3[_0x9e28('0x3a')]){_0x1d5a97['read']=!![];}return _0x3ea2e6['update'](_0x1d5a97);}else{return logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x66'),util[_0x9e28('0x2a')](_0x544bd2[_0x9e28('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x462c65){return logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x66'),util['inspect'](_0x462c65,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0x9e28('0x67'):if(_0x4a65d3[_0x9e28('0x5d')]){var _0xc1b8f2={'method':_0x9e28('0x3f'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x4a65d3[_0x9e28('0x5d')]},'body':{'content':_0x4b56d9[_0x9e28('0xb')],'to':[_0x4b56d9[_0x9e28('0x21')]],'from':_0x4a65d3['phone'],'binary':![],'clientMessageId':_0x9e28('0x68'),'charset':_0x9e28('0x69')},'json':!![]};rp(_0xc1b8f2)[_0x9e28('0x17')](function(_0x263a00){if(!_0x263a00[_0x9e28('0x19')]){var _0x4b5a60={'messageId':_0x263a00[_0x9e28('0x1f')][0x0]['apiMessageId']};if(!_0x4a65d3[_0x9e28('0x3a')]){_0x4b5a60['read']=!![];}return _0x3ea2e6[_0x9e28('0x26')](_0x4b5a60);}else{return logger['error'](_0x9e28('0x28'),_0x9e28('0x29'),'clickatell',util['inspect'](_0x263a00[_0x9e28('0x19')],{'showHidden':![],'depth':null}));}})[_0x9e28('0x27')](function(_0x40a47e){return logger['error'](_0x9e28('0x28'),'afterCreate','clickatell',util[_0x9e28('0x2a')](_0x40a47e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9e28('0x28'),'afterCreate',_0x9e28('0x67'),_0x9e28('0x6a'));}break;case _0x9e28('0x6b'):if(_0x4a65d3[_0x9e28('0x2d')]&&_0x4a65d3[_0x9e28('0x2e')]){var _0xd204a1=util[_0x9e28('0x45')]('%s:%s',_0x4a65d3[_0x9e28('0x2d')],_0x4a65d3[_0x9e28('0x2e')]);var _0x1a84df={'method':'POST','uri':_0x9e28('0x6c')+_0x4a65d3['accountId']+'/messages','body':{'to':[_0x4b56d9[_0x9e28('0x21')]],'text':_0x4b56d9[_0x9e28('0xb')],'from':_0x4a65d3[_0x9e28('0x21')],'applicationId':_0x4a65d3[_0x9e28('0x6d')]},'headers':{'Authorization':util[_0x9e28('0x45')]('Basic\x20%s',new Buffer(_0xd204a1)[_0x9e28('0x49')](_0x9e28('0x4a')))},'json':!![]};rp(_0x1a84df)[_0x9e28('0x17')](function(_0x25cefc){if(_0x25cefc['id']){var _0x6bdf39={'messageId':_0x25cefc['id']};return _0x3ea2e6['update'](_0x6bdf39);}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x6b'),util['inspect'](_0x25cefc,{'showHidden':![],'depth':null}));}})[_0x9e28('0x27')](function(_0x1eb48b){logger[_0x9e28('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x9e28('0x6b'),util[_0x9e28('0x2a')](_0x1eb48b,{'showHidden':![],'depth':null}));});}else{logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x4a65d3[_0x9e28('0x5d')]){var _0x31f151={};var _0x5645fc={'method':_0x9e28('0x3f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x4a65d3['apiKey'],'Content-Type':_0x9e28('0x58')},'body':{'from':_0x4a65d3[_0x9e28('0x21')],'to':_0x4b56d9[_0x9e28('0x21')],'text':_0x4b56d9[_0x9e28('0xb')]},'json':!![]};return rp(_0x5645fc)['then'](function(_0x1640a2){if(_0x1640a2[_0x9e28('0x6e')]==0xca){_0x31f151['message']=_0x1640a2;var _0x4e2fb6={'method':_0x9e28('0x3f'),'uri':_0x9e28('0x6f'),'headers':{'Authorization':_0x9e28('0x70')+_0x4a65d3[_0x9e28('0x5d')],'Content-Type':_0x9e28('0x58')},'body':{'refid':_0x31f151[_0x9e28('0x71')][_0x9e28('0x72')]},'json':!![]};return rp(_0x4e2fb6)[_0x9e28('0x17')](function(_0x106a1c){_0x31f151[_0x9e28('0x73')]=_0x106a1c;var _0x829823={'messageId':_0x31f151[_0x9e28('0x71')][_0x9e28('0x72')],'read':!![]};return _0x3ea2e6[_0x9e28('0x26')](_0x829823);});}else{return logger['error'](_0x9e28('0x28'),_0x9e28('0x29'),'intelepeer',util[_0x9e28('0x2a')](_0x1640a2,{'showHidden':![],'depth':null}));}})[_0x9e28('0x27')](function(_0xcc6d4c){return logger[_0x9e28('0x19')](_0x9e28('0x28'),_0x9e28('0x29'),_0x9e28('0x74'),util[_0x9e28('0x2a')](_0xcc6d4c,{'showHidden':![],'depth':null}));});}else{return logger[_0x9e28('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e28('0x29'),_0x9e28('0x74'),'Token\x20not\x20received');}break;}}})[_0x9e28('0x75')](function(){_0x12d7fc();});}else{_0x12d7fc();}}},'charset':_0x9e28('0x76'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1386=['bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','username','GET','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/status?token=','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0x1386,0x179));var _0x6138=function(_0x5f53ab,_0x324327){_0x5f53ab=_0x5f53ab-0x0;var _0x116166=_0x1386[_0x5f53ab];return _0x116166;};'use strict';var _=require(_0x6138('0x0'));var util=require(_0x6138('0x1'));var logger=require(_0x6138('0x2'))('api');var moment=require(_0x6138('0x3'));var BPromise=require(_0x6138('0x4'));var rp=require(_0x6138('0x5'));var fs=require('fs');var path=require(_0x6138('0x6'));var rimraf=require('rimraf');var config=require(_0x6138('0x7'));var attributes=require(_0x6138('0x8'));module['exports']=function(_0x31b1de,_0x56a7b0){return _0x31b1de[_0x6138('0x9')](_0x6138('0xa'),attributes,{'tableName':_0x6138('0xb'),'paranoid':![],'indexes':[{'name':_0x6138('0xc'),'fields':[_0x6138('0xc')]},{'name':_0x6138('0xd'),'fields':[_0x6138('0xe')],'type':_0x6138('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59ff1e,_0x5be73b,_0x3b027a){var _0x3259bb=_0x31b1de[_0x6138('0x10')];var _0x235aed=_0x59ff1e[_0x6138('0x11')]({'plain':!![]});if(_0x235aed[_0x6138('0x12')][_0x6138('0x13')]()==='in'||_0x235aed['direction'][_0x6138('0x13')]()===_0x6138('0x14')&&!_0x235aed[_0x6138('0x15')]&&!_[_0x6138('0x16')](_0x235aed[_0x6138('0x17')])&&!_['isNil'](_0x235aed[_0x6138('0x18')])){_0x3259bb[_0x6138('0x19')]['findOne']({'where':{'id':_0x235aed[_0x6138('0x18')]}})[_0x6138('0x1a')](function(_0x397565){if(_0x397565){_0x397565[_0x6138('0x1b')]({'lastMsgAt':_0x235aed[_0x6138('0x1c')],'lastMsgDirection':_0x235aed['direction']['toLowerCase']()});}})[_0x6138('0x1d')](function(_0x5ac6d2){console[_0x6138('0x1e')](_0x5ac6d2);});}if(_0x235aed[_0x6138('0x12')]===_0x6138('0x14')&&!_0x235aed[_0x6138('0x15')]){var _0x333edb;_0x3259bb[_0x6138('0x1f')][_0x6138('0x20')]({'where':{'id':_0x235aed[_0x6138('0x21')]},'raw':!![]})[_0x6138('0x1a')](function(_0x3d4c0c){_0x333edb=_0x3d4c0c;if(_0x333edb&&_0x333edb[_0x6138('0x22')]){switch(_0x333edb['type']){case _0x6138('0x23'):var _0x4ee7a3=require(_0x6138('0x23'));if(_0x333edb['accountSid']&&_0x333edb[_0x6138('0x24')]&&_0x333edb[_0x6138('0x25')]){var _0x3f6910=new _0x4ee7a3(_0x333edb[_0x6138('0x26')],_0x333edb[_0x6138('0x24')]);_0x3f6910[_0x6138('0x27')][_0x6138('0x28')]({'body':_0x235aed[_0x6138('0xe')],'to':_0x235aed[_0x6138('0x25')],'from':_0x333edb[_0x6138('0x25')],'statusCallback':_0x333edb[_0x6138('0x29')]+'/api/sms/messages/'+_0x235aed['id']+'/status?token='+_0x333edb[_0x6138('0x2a')]})[_0x6138('0x1a')](function(_0x13b4c8){if(_0x13b4c8[_0x6138('0x2b')]){return _0x59ff1e[_0x6138('0x1b')]({'messageId':_0x13b4c8['sid']});}})[_0x6138('0x1d')](function(_0x23b000){logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x23'),util[_0x6138('0x2e')](_0x23b000,{'showHidden':![],'depth':null}));});}else{logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x23'),_0x6138('0x2f'));}break;case _0x6138('0x30'):var _0x971806='https://api.skebby.it/API/v1.0/REST/';if(_0x333edb['username']&&_0x333edb[_0x6138('0x31')]){var _0x2b8e7c={'recipient':[_0x235aed[_0x6138('0x25')]],'message':_0x235aed[_0x6138('0xe')],'message_type':_0x333edb[_0x6138('0x32')]};if(_0x333edb[_0x6138('0x32')]&&_0x333edb[_0x6138('0x32')]!=='SI'){_0x2b8e7c[_0x6138('0x33')]=_0x333edb[_0x6138('0x25')];}var _0x574ffc={'url':_0x971806+'login?username='+_0x333edb[_0x6138('0x34')]+'&password='+_0x333edb[_0x6138('0x31')],'method':_0x6138('0x35')};rp(_0x574ffc)[_0x6138('0x1a')](function(_0xf87958){var _0x207e04=_0xf87958[_0x6138('0x36')](';');var _0x9d0ea5={'user_key':_0x207e04[0x0],'session_key':_0x207e04[0x1]};_0x574ffc={'url':_0x971806+_0x6138('0x37'),'method':_0x6138('0x38'),'headers':{'user_key':_0x9d0ea5['user_key'],'Session_key':_0x9d0ea5[_0x6138('0x39')]},'json':!![],'body':_0x2b8e7c};return rp(_0x574ffc);})[_0x6138('0x1a')](function(_0x46d28d){if(_0x46d28d[_0x6138('0x3a')]>=0x1){var _0x11db76={'messageId':_0x46d28d[_0x6138('0x3b')]};if(_0x333edb[_0x6138('0x32')]!=='GP'||!_0x333edb[_0x6138('0x3c')]){_0x11db76[_0x6138('0x3d')]=!![];}return _0x59ff1e['update'](_0x11db76);}else{return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),'skebby',util[_0x6138('0x2e')](_0x46d28d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x371895){return logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),'skebby',util[_0x6138('0x2e')](_0x371895,{'showHidden':![],'depth':null}));});}else{logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x30'),_0x6138('0x3e'));}break;case _0x6138('0x3f'):if(_0x333edb[_0x6138('0x24')]){var _0x26d431={'recipient':_0x235aed[_0x6138('0x25')],'message':_0x235aed[_0x6138('0xe')],'sender':_0x333edb[_0x6138('0x40')]||_0x333edb['phone'],'authorization':_0x333edb[_0x6138('0x24')]};var _0x5be73b={'method':_0x6138('0x38'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x26d431,'json':!![]};rp(_0x5be73b)[_0x6138('0x1a')](function(_0x47674f){var _0x138958={'messageId':_0x47674f[_0x6138('0x41')]};if(!_0x333edb[_0x6138('0x3c')]){_0x138958[_0x6138('0x3d')]=!![];}return _0x59ff1e[_0x6138('0x1b')](_0x138958);})['catch'](function(_0x1437b9){logger[_0x6138('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6138('0x2d'),_0x6138('0x3f'),util[_0x6138('0x2e')](_0x1437b9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x3f'),_0x6138('0x42'));}break;case _0x6138('0x43'):if(_0x333edb[_0x6138('0x34')]&&_0x333edb[_0x6138('0x31')]){var _0x26d431={'messages':[{'source':_0x6138('0x44'),'to':_0x235aed[_0x6138('0x25')],'body':_0x235aed[_0x6138('0xe')],'from':_0x333edb[_0x6138('0x40')]||_0x333edb[_0x6138('0x25')]}]};var _0x565998=util[_0x6138('0x45')](_0x6138('0x46'),_0x333edb[_0x6138('0x34')],_0x333edb['password']);var _0x5be73b={'method':_0x6138('0x38'),'uri':_0x6138('0x47'),'body':_0x26d431,'headers':{'Authorization':util[_0x6138('0x45')](_0x6138('0x48'),new Buffer(_0x565998)['toString'](_0x6138('0x49')))},'json':!![]};rp(_0x5be73b)['then'](function(_0x2f91b6){if(_0x2f91b6[_0x6138('0x4a')]>=0xc8&&_0x2f91b6[_0x6138('0x4a')]<=0xce){if(_0x2f91b6[_0x6138('0x4b')]&&_0x2f91b6[_0x6138('0x4b')][_0x6138('0x4c')]>0x0){var _0x346141=_['head'](_0x2f91b6[_0x6138('0x4b')][_0x6138('0x27')]);var _0x3af8b1={'messageId':_0x346141[_0x6138('0x4d')]};if(!_0x333edb['deliveryReport']){_0x3af8b1['read']=!![];}return _0x59ff1e[_0x6138('0x1b')](_0x3af8b1);}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x4e'),util[_0x6138('0x2e')](_0x2f91b6,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x4e'),util[_0x6138('0x2e')](_0x2f91b6,{'showHidden':![],'depth':null}));}})[_0x6138('0x1d')](function(_0x54a0ec){logger[_0x6138('0x1e')](_0x6138('0x2c'),'afterCreate',_0x6138('0x4e'),util['inspect'](_0x54a0ec,{'showHidden':![],'depth':null}));});}else{logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x4e'),_0x6138('0x3e'));}break;case _0x6138('0x4f'):if(_0x333edb[_0x6138('0x50')]&&_0x333edb[_0x6138('0x24')]){var _0x26d431={'dst':_0x235aed[_0x6138('0x25')],'text':_0x235aed['body'],'src':_0x333edb['senderString']||_0x333edb[_0x6138('0x25')],'url':_0x333edb['remote']+'/api/sms/messages/'+_0x235aed['id']+_0x6138('0x51')+_0x333edb['token']};var _0x565998=util[_0x6138('0x45')](_0x6138('0x46'),_0x333edb[_0x6138('0x50')],_0x333edb[_0x6138('0x24')]);var _0x5be73b={'method':'POST','uri':util[_0x6138('0x45')]('https://api.plivo.com/v1/Account/%s/Message/',_0x333edb[_0x6138('0x50')]),'body':_0x26d431,'headers':{'Authorization':util[_0x6138('0x45')](_0x6138('0x48'),new Buffer(_0x565998)[_0x6138('0x52')](_0x6138('0x49')))},'json':!![]};rp(_0x5be73b)['then'](function(_0x228ad5){var _0x582208={'messageId':_0x228ad5[_0x6138('0x53')][0x0]};return _0x59ff1e[_0x6138('0x1b')](_0x582208);})[_0x6138('0x1d')](function(_0x2ae4d8){logger['error'](_0x6138('0x2c'),'afterCreate','plivo',util[_0x6138('0x2e')](_0x2ae4d8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x4f'),_0x6138('0x54'));}break;case _0x6138('0x55'):if(_0x333edb[_0x6138('0x34')]&&_0x333edb['password']){if(_0x333edb[_0x6138('0x56')]){var _0x5d46b6={'method':'POST','uri':_0x333edb[_0x6138('0x56')]+_0x6138('0x57'),'body':{'username':_0x333edb['username'],'password':_0x333edb[_0x6138('0x31')]},'json':!![]};return rp(_0x5d46b6)['then'](function(_0x460d3c){var _0x333ed8={'method':_0x6138('0x38'),'uri':_0x333edb['baseUrl']+_0x6138('0x58'),'body':{'messages':[{'from':_0x333edb['phone'],'destinations':[{'to':_0x235aed['phone']}],'text':_0x235aed[_0x6138('0xe')],'notifyUrl':_0x333edb['remote']+_0x6138('0x59')+_0x235aed['id']+_0x6138('0x51')+_0x333edb[_0x6138('0x2a')],'notifyContentType':'application/json','callbackData':_0x333edb[_0x6138('0x25')]+';'+_0x235aed[_0x6138('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x460d3c[_0x6138('0x2a')]},'json':!![]};return rp(_0x333ed8)['then'](function(_0x1fee65){if(_0x1fee65[_0x6138('0x27')]){var _0x3da5fe={'messageId':_0x1fee65[_0x6138('0x27')][0x0][_0x6138('0xc')]};if(!_0x333edb['deliveryReport']){_0x3da5fe['read']=!![];}return _0x59ff1e['update'](_0x3da5fe);}else{return logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),'infobip',util['inspect'](_0x1fee65,{'showHidden':![],'depth':null}));}});})[_0x6138('0x1d')](function(_0x5c7f85){return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x55'),util[_0x6138('0x2e')](_0x5c7f85,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6138('0x2c'),'afterCreate',_0x6138('0x55'),_0x6138('0x5a'));}}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),'infobip',_0x6138('0x3e'));}break;case'csc':var _0x12211c=require(_0x6138('0x5b'));if(_0x333edb[_0x6138('0x5c')]){var _0x1518bd={};_0x1518bd[_0x6138('0x5d')]=_0x333edb[_0x6138('0x34')];_0x1518bd[_0x6138('0x25')]=_0x235aed[_0x6138('0x25')];_0x1518bd[_0x6138('0x33')]=_0x333edb['phone'];_0x1518bd[_0x6138('0x5e')]=_0x235aed['body'];_0x1518bd[_0x6138('0x5f')]=+new Date();var _0x3f56a8='';var _0x42974f='';var _0x154349=Object[_0x6138('0x60')](_0x1518bd);_0x154349[_0x6138('0x61')]();for(var _0x477090=0x0;_0x477090<_0x154349[_0x6138('0x62')];_0x477090++){if(_0x3f56a8!=''){_0x3f56a8+='&';}_0x3f56a8+=_0x154349[_0x477090]+'='+encodeURIComponent(_0x1518bd[_0x154349[_0x477090]]);_0x42974f+=_0x1518bd[_0x154349[_0x477090]];}_0x42974f+=_0x333edb['apiKey'];_0x42974f=_0x12211c[_0x6138('0x63')](_0x6138('0x64'))[_0x6138('0x1b')](_0x42974f)[_0x6138('0x65')]('hex');if(_0x3f56a8!==''){_0x3f56a8+='&';}_0x3f56a8+=_0x6138('0x66')+_0x42974f;var _0x574ffc={'method':'GET','uri':_0x333edb['baseUrl']+_0x6138('0x67')+_0x3f56a8,'json':!![]};return rp(_0x574ffc)[_0x6138('0x1a')](function(_0x47543f){var _0x47edaa=Object[_0x6138('0x60')](_0x47543f);if(_0x47543f[_0x47edaa[0x0]][_0x6138('0x1e')]&&parseInt(_0x47543f[_0x47edaa[0x0]]['error'])===0x0){var _0xe6f458={'messageId':_0x47543f[_0x47edaa[0x0]][_0x6138('0x68')]};if(!_0x333edb[_0x6138('0x3c')]){_0xe6f458[_0x6138('0x3d')]=!![];}return _0x59ff1e['update'](_0xe6f458);}else{return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),'csc',util[_0x6138('0x2e')](_0x47543f['error'],{'showHidden':![],'depth':null}));}})[_0x6138('0x1d')](function(_0x353c22){return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x69'),util[_0x6138('0x2e')](_0x353c22,{'showHidden':![],'depth':null}));});}else{logger[_0x6138('0x1e')](_0x6138('0x2c'),'afterCreate',_0x6138('0x69'),'Missing\x20parameters:\x20apiKey');}break;case _0x6138('0x6a'):if(_0x333edb[_0x6138('0x5c')]){var _0x23c412={'method':_0x6138('0x38'),'uri':_0x6138('0x6b'),'headers':{'Authorization':_0x333edb['apiKey']},'body':{'content':_0x235aed['body'],'to':[_0x235aed['phone']],'from':_0x333edb[_0x6138('0x25')],'binary':![],'clientMessageId':_0x6138('0x6c'),'charset':'UTF-8'},'json':!![]};rp(_0x23c412)[_0x6138('0x1a')](function(_0x1affdc){if(!_0x1affdc[_0x6138('0x1e')]){var _0x4dce3d={'messageId':_0x1affdc[_0x6138('0x27')][0x0]['apiMessageId']};if(!_0x333edb[_0x6138('0x3c')]){_0x4dce3d[_0x6138('0x3d')]=!![];}return _0x59ff1e['update'](_0x4dce3d);}else{return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x6a'),util['inspect'](_0x1affdc['error'],{'showHidden':![],'depth':null}));}})[_0x6138('0x1d')](function(_0x24d995){return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x6a'),util[_0x6138('0x2e')](_0x24d995,{'showHidden':![],'depth':null}));});}else{logger[_0x6138('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6138('0x2d'),'clickatell',_0x6138('0x6d'));}break;case _0x6138('0x6e'):if(_0x333edb[_0x6138('0x34')]&&_0x333edb[_0x6138('0x31')]){var _0x565998=util[_0x6138('0x45')](_0x6138('0x46'),_0x333edb[_0x6138('0x34')],_0x333edb[_0x6138('0x31')]);var _0x5be73b={'method':_0x6138('0x38'),'uri':_0x6138('0x6f')+_0x333edb[_0x6138('0x70')]+'/messages','body':{'to':[_0x235aed['phone']],'text':_0x235aed[_0x6138('0xe')],'from':_0x333edb[_0x6138('0x25')],'applicationId':_0x333edb[_0x6138('0x71')]},'headers':{'Authorization':util[_0x6138('0x45')]('Basic\x20%s',new Buffer(_0x565998)[_0x6138('0x52')](_0x6138('0x49')))},'json':!![]};rp(_0x5be73b)['then'](function(_0x3007d2){if(_0x3007d2['id']){var _0x2b5c20={'messageId':_0x3007d2['id']};return _0x59ff1e[_0x6138('0x1b')](_0x2b5c20);}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),'bandwidth',util[_0x6138('0x2e')](_0x3007d2,{'showHidden':![],'depth':null}));}})[_0x6138('0x1d')](function(_0x19f9e4){logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x6e'),util[_0x6138('0x2e')](_0x19f9e4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6138('0x2c'),_0x6138('0x2d'),_0x6138('0x6e'),_0x6138('0x3e'));}break;case _0x6138('0x72'):if(_0x333edb[_0x6138('0x5c')]){var _0x10832d={};var _0x574ffc={'method':_0x6138('0x38'),'uri':_0x6138('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x333edb[_0x6138('0x5c')],'Content-Type':_0x6138('0x74')},'body':{'from':_0x333edb[_0x6138('0x25')],'to':_0x235aed[_0x6138('0x25')],'text':_0x235aed['body']},'json':!![]};return rp(_0x574ffc)[_0x6138('0x1a')](function(_0x127c51){if(_0x127c51[_0x6138('0x75')]==0xca){_0x10832d[_0x6138('0x76')]=_0x127c51;var _0x3754e6={'method':_0x6138('0x38'),'uri':_0x6138('0x77'),'headers':{'Authorization':_0x6138('0x78')+_0x333edb[_0x6138('0x5c')],'Content-Type':_0x6138('0x74')},'body':{'refid':_0x10832d['message'][_0x6138('0x79')]},'json':!![]};return rp(_0x3754e6)[_0x6138('0x1a')](function(_0x48b7a5){_0x10832d[_0x6138('0x7a')]=_0x48b7a5;var _0xee8e55={'messageId':_0x10832d[_0x6138('0x76')]['refid'],'read':!![]};return _0x59ff1e['update'](_0xee8e55);});}else{return logger[_0x6138('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6138('0x72'),util[_0x6138('0x2e')](_0x127c51,{'showHidden':![],'depth':null}));}})[_0x6138('0x1d')](function(_0x4d62dc){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6138('0x72'),util[_0x6138('0x2e')](_0x4d62dc,{'showHidden':![],'depth':null}));});}else{return logger[_0x6138('0x1e')](_0x6138('0x2c'),_0x6138('0x2d'),'intelepeer',_0x6138('0x7b'));}break;}}})[_0x6138('0x7c')](function(){_0x3b027a();});}else{_0x3b027a();}}},'charset':_0x6138('0x7d'),'collate':_0x6138('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 162c40d..69a90ae 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 _0xd6d2=['../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','info','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2abf7f,_0x23b05a){var _0x248bce=function(_0x4c836d){while(--_0x4c836d){_0x2abf7f['push'](_0x2abf7f['shift']());}};_0x248bce(++_0x23b05a);}(_0xd6d2,0x13b));var _0x2d6d=function(_0x318b92,_0x3cfd51){_0x318b92=_0x318b92-0x0;var _0x195785=_0xd6d2[_0x318b92];return _0x195785;};'use strict';var _=require(_0x2d6d('0x0'));var util=require('util');var moment=require(_0x2d6d('0x1'));var BPromise=require(_0x2d6d('0x2'));var rs=require(_0x2d6d('0x3'));var fs=require('fs');var Redis=require(_0x2d6d('0x4'));var db=require(_0x2d6d('0x5'))['db'];var utils=require(_0x2d6d('0x6'));var logger=require(_0x2d6d('0x7'))(_0x2d6d('0x8'));var config=require(_0x2d6d('0x9'));var jayson=require(_0x2d6d('0xa'));var client=jayson[_0x2d6d('0xb')][_0x2d6d('0xc')]({'port':0x232a});config['redis']=_[_0x2d6d('0xd')](config[_0x2d6d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d6d('0xf'))(new Redis(config[_0x2d6d('0xe')]));require(_0x2d6d('0x10'))[_0x2d6d('0x11')](socket);function respondWithRpcPromise(_0x486c5f,_0x4fb248,_0x26edfc){return new BPromise(function(_0x3383dd,_0x4b4ab4){return client[_0x2d6d('0x12')](_0x486c5f,_0x26edfc)[_0x2d6d('0x13')](function(_0x10939a){logger['info'](_0x2d6d('0x14'),_0x4fb248,_0x2d6d('0x15'));logger['debug'](_0x2d6d('0x16'),_0x4fb248,_0x2d6d('0x15'),JSON['stringify'](_0x10939a));if(_0x10939a['error']){if(_0x10939a[_0x2d6d('0x17')][_0x2d6d('0x18')]===0x1f4){logger[_0x2d6d('0x17')](_0x2d6d('0x14'),_0x4fb248,_0x10939a['error'][_0x2d6d('0x19')]);return _0x4b4ab4(_0x10939a[_0x2d6d('0x17')]['message']);}logger['error'](_0x2d6d('0x14'),_0x4fb248,_0x10939a['error']['message']);return _0x3383dd(_0x10939a[_0x2d6d('0x17')][_0x2d6d('0x19')]);}else{logger['info'](_0x2d6d('0x14'),_0x4fb248,'request\x20sent');_0x3383dd(_0x10939a[_0x2d6d('0x1a')][_0x2d6d('0x19')]);}})[_0x2d6d('0x1b')](function(_0xafdb42){logger[_0x2d6d('0x17')](_0x2d6d('0x14'),_0x4fb248,_0xafdb42);_0x4b4ab4(_0xafdb42);});});}exports[_0x2d6d('0x1c')]=function(_0x349381){var _0x361130=this;return new Promise(function(_0x1a6cec,_0x552da3){return db['SmsMessage'][_0x2d6d('0x1d')](_0x349381[_0x2d6d('0x1e')],{'raw':_0x349381[_0x2d6d('0x1f')]?_0x349381[_0x2d6d('0x1f')][_0x2d6d('0x20')]===undefined?!![]:![]:!![]})[_0x2d6d('0x13')](function(_0x372baa){logger[_0x2d6d('0x21')](_0x2d6d('0x1c'),_0x349381);logger[_0x2d6d('0x22')](_0x2d6d('0x1c'),_0x349381,JSON[_0x2d6d('0x23')](_0x372baa));_0x1a6cec(_0x372baa);})[_0x2d6d('0x1b')](function(_0x56d41f){logger[_0x2d6d('0x17')](_0x2d6d('0x1c'),_0x56d41f[_0x2d6d('0x19')],_0x349381);_0x552da3(_0x361130[_0x2d6d('0x17')](0x1f4,_0x56d41f[_0x2d6d('0x19')]));});});}; \ No newline at end of file +var _0x4e16=['debug','error','SmsMessage,\x20%s,\x20%s','message','result','SmsMessage','create','body','options','raw','CreateSmsMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','request\x20sent'];(function(_0x508dc5,_0x1aa23c){var _0x403554=function(_0x25d1ac){while(--_0x25d1ac){_0x508dc5['push'](_0x508dc5['shift']());}};_0x403554(++_0x1aa23c);}(_0x4e16,0xba));var _0x64e1=function(_0x1409f2,_0x3dc2a3){_0x1409f2=_0x1409f2-0x0;var _0x30db32=_0x4e16[_0x1409f2];return _0x30db32;};'use strict';var _=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var moment=require(_0x64e1('0x2'));var BPromise=require(_0x64e1('0x3'));var rs=require(_0x64e1('0x4'));var fs=require('fs');var Redis=require(_0x64e1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64e1('0x6'));var logger=require('../../config/logger')(_0x64e1('0x7'));var config=require('../../config/environment');var jayson=require(_0x64e1('0x8'));var client=jayson[_0x64e1('0x9')][_0x64e1('0xa')]({'port':0x232a});config[_0x64e1('0xb')]=_[_0x64e1('0xc')](config[_0x64e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x64e1('0xd'))(new Redis(config[_0x64e1('0xb')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x29e16a,_0xd2cf5a,_0x1c809a){return new BPromise(function(_0x42a4b9,_0x2d8786){return client['request'](_0x29e16a,_0x1c809a)[_0x64e1('0xe')](function(_0x387cbc){logger[_0x64e1('0xf')]('SmsMessage,\x20%s,\x20%s',_0xd2cf5a,_0x64e1('0x10'));logger[_0x64e1('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd2cf5a,_0x64e1('0x10'),JSON['stringify'](_0x387cbc));if(_0x387cbc[_0x64e1('0x12')]){if(_0x387cbc[_0x64e1('0x12')]['code']===0x1f4){logger[_0x64e1('0x12')](_0x64e1('0x13'),_0xd2cf5a,_0x387cbc[_0x64e1('0x12')][_0x64e1('0x14')]);return _0x2d8786(_0x387cbc[_0x64e1('0x12')]['message']);}logger[_0x64e1('0x12')]('SmsMessage,\x20%s,\x20%s',_0xd2cf5a,_0x387cbc[_0x64e1('0x12')][_0x64e1('0x14')]);return _0x42a4b9(_0x387cbc['error'][_0x64e1('0x14')]);}else{logger[_0x64e1('0xf')](_0x64e1('0x13'),_0xd2cf5a,_0x64e1('0x10'));_0x42a4b9(_0x387cbc[_0x64e1('0x15')][_0x64e1('0x14')]);}})['catch'](function(_0x48b721){logger[_0x64e1('0x12')](_0x64e1('0x13'),_0xd2cf5a,_0x48b721);_0x2d8786(_0x48b721);});});}exports['CreateSmsMessage']=function(_0x3a1b64){var _0x2129b5=this;return new Promise(function(_0x851666,_0x3ab48a){return db[_0x64e1('0x16')][_0x64e1('0x17')](_0x3a1b64[_0x64e1('0x18')],{'raw':_0x3a1b64[_0x64e1('0x19')]?_0x3a1b64[_0x64e1('0x19')][_0x64e1('0x1a')]===undefined?!![]:![]:!![]})[_0x64e1('0xe')](function(_0x4a18eb){logger[_0x64e1('0xf')](_0x64e1('0x1b'),_0x3a1b64);logger['debug'](_0x64e1('0x1b'),_0x3a1b64,JSON[_0x64e1('0x1c')](_0x4a18eb));_0x851666(_0x4a18eb);})['catch'](function(_0x32ec73){logger[_0x64e1('0x12')](_0x64e1('0x1b'),_0x32ec73[_0x64e1('0x14')],_0x3a1b64);_0x3ab48a(_0x2129b5['error'](0x1f4,_0x32ec73[_0x64e1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 836c2c3..8ae2beb 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 _0xd9f7=['removeListener','register','length','smsMessage:','save','emit'];(function(_0x13b20a,_0x126b31){var _0x4aaef6=function(_0x53b8de){while(--_0x53b8de){_0x13b20a['push'](_0x13b20a['shift']());}};_0x4aaef6(++_0x126b31);}(_0xd9f7,0x118));var _0x7d9f=function(_0x219536,_0x8e0b9b){_0x219536=_0x219536-0x0;var _0x231e4d=_0xd9f7[_0x219536];return _0x231e4d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x7d9f('0x0'),'remove','update'];function createListener(_0x9f2659,_0xa7b02){return function(_0x4dbfeb){_0xa7b02[_0x7d9f('0x1')](_0x9f2659,_0x4dbfeb);};}function removeListener(_0x27736e,_0x591c06){return function(){SmsMessageEvents[_0x7d9f('0x2')](_0x27736e,_0x591c06);};}exports[_0x7d9f('0x3')]=function(_0x257727){for(var _0x38d247=0x0,_0x55264a=events[_0x7d9f('0x4')];_0x38d247<_0x55264a;_0x38d247++){var _0x45441a=events[_0x38d247];var _0x713147=createListener(_0x7d9f('0x5')+_0x45441a,_0x257727);SmsMessageEvents['on'](_0x45441a,_0x713147);}}; \ No newline at end of file +var _0xae0b=['remove','register','smsMessage:','./smsMessage.events','save'];(function(_0x5a42cb,_0x4998cb){var _0x29a905=function(_0x48b6ba){while(--_0x48b6ba){_0x5a42cb['push'](_0x5a42cb['shift']());}};_0x29a905(++_0x4998cb);}(_0xae0b,0x94));var _0xbae0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae0b[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0xbae0('0x0'));var events=[_0xbae0('0x1'),_0xbae0('0x2'),'update'];function createListener(_0x3f287c,_0x5bbf0c){return function(_0x58ba98){_0x5bbf0c['emit'](_0x3f287c,_0x58ba98);};}function removeListener(_0x45e84c,_0x472884){return function(){SmsMessageEvents['removeListener'](_0x45e84c,_0x472884);};}exports[_0xbae0('0x3')]=function(_0x45face){for(var _0x3e5bc0=0x0,_0x4d7093=events['length'];_0x3e5bc0<_0x4d7093;_0x3e5bc0++){var _0x3144ef=events[_0x3e5bc0];var _0x494c09=createListener(_0xbae0('0x4')+_0x3144ef,_0x45face);SmsMessageEvents['on'](_0x3144ef,_0x494c09);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index f6ead24..a75acd3 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 _0x449a=['/:id/teams','addTeams','post','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','/:id','show','/:id/members','isAuthenticated','getMembers','getTeams','/:id/users','create'];(function(_0x43554c,_0xaefc41){var _0x1ec98c=function(_0x48aa1c){while(--_0x48aa1c){_0x43554c['push'](_0x43554c['shift']());}};_0x1ec98c(++_0xaefc41);}(_0x449a,0x191));var _0xa449=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x449a[_0x3305de];return _0x3b5a84;};'use strict';var multer=require(_0xa449('0x0'));var util=require(_0xa449('0x1'));var path=require(_0xa449('0x2'));var timeout=require('connect-timeout');var express=require(_0xa449('0x3'));var router=express[_0xa449('0x4')]();var fs_extra=require(_0xa449('0x5'));var auth=require(_0xa449('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa449('0x7'));var controller=require(_0xa449('0x8'));router[_0xa449('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa449('0x9')](_0xa449('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa449('0x9')](_0xa449('0xb'),auth['isAuthenticated'](),controller[_0xa449('0xc')]);router[_0xa449('0x9')](_0xa449('0xd'),auth[_0xa449('0xe')](),controller[_0xa449('0xf')]);router[_0xa449('0x9')]('/:id/teams',auth[_0xa449('0xe')](),controller[_0xa449('0x10')]);router['get'](_0xa449('0x11'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xa449('0x12')]);router['post'](_0xa449('0x13'),auth[_0xa449('0xe')](),controller[_0xa449('0x14')]);router[_0xa449('0x15')](_0xa449('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0xa449('0x16')]('/:id',auth[_0xa449('0xe')](),controller[_0xa449('0x17')]);router[_0xa449('0x18')](_0xa449('0xb'),auth[_0xa449('0xe')](),controller[_0xa449('0x19')]);router[_0xa449('0x18')](_0xa449('0x13'),auth[_0xa449('0xe')](),controller['removeTeams']);router[_0xa449('0x18')](_0xa449('0x11'),auth[_0xa449('0xe')](),controller[_0xa449('0x1a')]);module[_0xa449('0x1b')]=router; \ No newline at end of file +var _0xca4b=['removeAgents','multer','util','path','connect-timeout','express','../../components/interaction/service','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','destroy','removeTeams'];(function(_0x3d3082,_0x389bbf){var _0x1e7f66=function(_0x543aeb){while(--_0x543aeb){_0x3d3082['push'](_0x3d3082['shift']());}};_0x1e7f66(++_0x389bbf);}(_0xca4b,0x69));var _0xbca4=function(_0x47698c,_0x3be6d0){_0x47698c=_0x47698c-0x0;var _0x32539a=_0xca4b[_0x47698c];return _0x32539a;};'use strict';var multer=require(_0xbca4('0x0'));var util=require(_0xbca4('0x1'));var path=require(_0xbca4('0x2'));var timeout=require(_0xbca4('0x3'));var express=require(_0xbca4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbca4('0x5'));var config=require('../../config/environment');var controller=require(_0xbca4('0x6'));router[_0xbca4('0x7')]('/',auth['isAuthenticated'](),controller[_0xbca4('0x8')]);router['get'](_0xbca4('0x9'),auth[_0xbca4('0xa')](),controller[_0xbca4('0xb')]);router[_0xbca4('0x7')](_0xbca4('0xc'),auth[_0xbca4('0xa')](),controller[_0xbca4('0xd')]);router['get'](_0xbca4('0xe'),auth[_0xbca4('0xa')](),controller['getMembers']);router[_0xbca4('0x7')](_0xbca4('0xf'),auth[_0xbca4('0xa')](),controller['getTeams']);router[_0xbca4('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xbca4('0x10')]);router[_0xbca4('0x11')]('/',auth[_0xbca4('0xa')](),controller[_0xbca4('0x12')]);router[_0xbca4('0x11')](_0xbca4('0xf'),auth[_0xbca4('0xa')](),controller[_0xbca4('0x13')]);router[_0xbca4('0x11')](_0xbca4('0x14'),auth[_0xbca4('0xa')](),controller[_0xbca4('0x15')]);router[_0xbca4('0x16')](_0xbca4('0xc'),auth[_0xbca4('0xa')](),controller['update']);router['delete'](_0xbca4('0xc'),auth['isAuthenticated'](),controller[_0xbca4('0x17')]);router['delete'](_0xbca4('0xf'),auth[_0xbca4('0xa')](),controller[_0xbca4('0x18')]);router['delete'](_0xbca4('0x14'),auth[_0xbca4('0xa')](),controller[_0xbca4('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 297374f..5686d81 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 _0x5836=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x15c740,_0x3ab5cd){var _0x249631=function(_0x2c0006){while(--_0x2c0006){_0x15c740['push'](_0x15c740['shift']());}};_0x249631(++_0x3ab5cd);}(_0x5836,0x1f1));var _0x6583=function(_0x2d24e2,_0x38c3af){_0x2d24e2=_0x2d24e2-0x0;var _0x330f61=_0x5836[_0x2d24e2];return _0x330f61;};'use strict';var Sequelize=require(_0x6583('0x0'));module[_0x6583('0x1')]={'name':{'type':Sequelize[_0x6583('0x2')],'unique':_0x6583('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6583('0x2')]},'timeout':{'type':Sequelize[_0x6583('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x6583('0x5'),_0x6583('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xf639=['sequelize','exports','STRING','ENUM','rrmemory','beepall'];(function(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0xf639,0x144));var _0x9f63=function(_0x356196,_0x3f914d){_0x356196=_0x356196-0x0;var _0x26533e=_0xf639[_0x356196];return _0x26533e;};'use strict';var Sequelize=require(_0x9f63('0x0'));module[_0x9f63('0x1')]={'name':{'type':Sequelize[_0x9f63('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9f63('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f63('0x3')](_0x9f63('0x4'),_0x9f63('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 5c93581..0564c02 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 _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x5b8ad4,_0x2e2409){var _0x5e8fbe=function(_0x220503){while(--_0x220503){_0x5b8ad4['push'](_0x5b8ad4['shift']());}};_0x5e8fbe(++_0x2e2409);}(_0xdb28,0x106));var _0x8db2=function(_0x57e801,_0x2e0c25){_0x57e801=_0x57e801-0x0;var _0x28a9e8=_0xdb28[_0x57e801];return _0x28a9e8;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44bb75,_0x1ce3d2){_0x44bb75=_0x44bb75-0x0;var _0x39dbc8=_0x5f2f[_0x44bb75];return _0x39dbc8;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f022b46..3cc89f5 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 _0xb02d=['remove','hook','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x1720ec,_0x3f61b6){var _0x17921c=function(_0x2e4cf9){while(--_0x2e4cf9){_0x1720ec['push'](_0x1720ec['shift']());}};_0x17921c(++_0x3f61b6);}(_0xb02d,0x188));var _0xdb02=function(_0x372b6f,_0x53b7e4){_0x372b6f=_0x372b6f-0x0;var _0x49af2b=_0xb02d[_0x372b6f];return _0x49af2b;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xdb02('0x0'))['db'][_0xdb02('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xdb02('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdb02('0x3')};function emitEvent(_0x485915){return function(_0x16b5da,_0x1ec630,_0x362b9c){SmsQueueEvents['emit'](_0x485915+':'+_0x16b5da['id'],_0x16b5da);SmsQueueEvents['emit'](_0x485915,_0x16b5da);_0x362b9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xdb02('0x4')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xcb27=['save','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb27,0x19d));var _0x7cb2=function(_0x2f14df,_0x339470){_0x2f14df=_0x2f14df-0x0;var _0x43f46e=_0xcb27[_0x2f14df];return _0x43f46e;};'use strict';var EventEmitter=require(_0x7cb2('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x7cb2('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7cb2('0x2')](0x0);var events={'afterCreate':_0x7cb2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3c4f12){return function(_0x1a20d6,_0x3336db,_0x1f58f2){SmsQueueEvents[_0x7cb2('0x4')](_0x3c4f12+':'+_0x1a20d6['id'],_0x1a20d6);SmsQueueEvents['emit'](_0x3c4f12,_0x1a20d6);_0x1f58f2(null);};}for(var e in events){if(events[_0x7cb2('0x5')](e)){var event=events[e];SmsQueue[_0x7cb2('0x6')](e,emitEvent(event));}}module[_0x7cb2('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 17f9ebb..130d0a6 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 _0xef83=['bluebird','request-promise','path','rimraf','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1a8a82,_0x4dc3d4){var _0xd30750=function(_0x48371b){while(--_0x48371b){_0x1a8a82['push'](_0x1a8a82['shift']());}};_0xd30750(++_0x4dc3d4);}(_0xef83,0xb1));var _0x3ef8=function(_0x56f151,_0x281759){_0x56f151=_0x56f151-0x0;var _0x52c1e3=_0xef83[_0x56f151];return _0x52c1e3;};'use strict';var _=require(_0x3ef8('0x0'));var util=require(_0x3ef8('0x1'));var logger=require(_0x3ef8('0x2'))(_0x3ef8('0x3'));var moment=require(_0x3ef8('0x4'));var BPromise=require(_0x3ef8('0x5'));var rp=require(_0x3ef8('0x6'));var fs=require('fs');var path=require(_0x3ef8('0x7'));var rimraf=require(_0x3ef8('0x8'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x3ef8('0x9')]=function(_0x6a0d62,_0xc53f8f){return _0x6a0d62[_0x3ef8('0xa')](_0x3ef8('0xb'),attributes,{'tableName':_0x3ef8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fe5=['../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x224436,_0x13088b){var _0x3c694a=function(_0x5b9648){while(--_0x5b9648){_0x224436['push'](_0x224436['shift']());}};_0x3c694a(++_0x13088b);}(_0x8fe5,0xae));var _0x58fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8fe5[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x58fe('0x0'));var logger=require(_0x58fe('0x1'))(_0x58fe('0x2'));var moment=require(_0x58fe('0x3'));var BPromise=require(_0x58fe('0x4'));var rp=require(_0x58fe('0x5'));var fs=require('fs');var path=require(_0x58fe('0x6'));var rimraf=require(_0x58fe('0x7'));var config=require(_0x58fe('0x8'));var attributes=require(_0x58fe('0x9'));module['exports']=function(_0x411981,_0x3af4f5){return _0x411981[_0x58fe('0xa')](_0x58fe('0xb'),attributes,{'tableName':_0x58fe('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 9e492a4..a01677a 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 _0x30b9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','catch','ShowSmsQueue','find','lodash','util','moment'];(function(_0x368017,_0x44fc9c){var _0x54b512=function(_0x87ded0){while(--_0x87ded0){_0x368017['push'](_0x368017['shift']());}};_0x54b512(++_0x44fc9c);}(_0x30b9,0xd4));var _0x930b=function(_0x38e804,_0x55745b){_0x38e804=_0x38e804-0x0;var _0x4999af=_0x30b9[_0x38e804];return _0x4999af;};'use strict';var _=require(_0x930b('0x0'));var util=require(_0x930b('0x1'));var moment=require(_0x930b('0x2'));var BPromise=require(_0x930b('0x3'));var rs=require(_0x930b('0x4'));var fs=require('fs');var Redis=require(_0x930b('0x5'));var db=require(_0x930b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x930b('0x7'))(_0x930b('0x8'));var config=require(_0x930b('0x9'));var jayson=require(_0x930b('0xa'));var client=jayson[_0x930b('0xb')][_0x930b('0xc')]({'port':0x232a});config[_0x930b('0xd')]=_[_0x930b('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x930b('0xf'))(new Redis(config[_0x930b('0xd')]));require(_0x930b('0x10'))[_0x930b('0x11')](socket);function respondWithRpcPromise(_0x29979b,_0x480d1a,_0x1fa4f6){return new BPromise(function(_0x49bdee,_0x1d93d5){return client['request'](_0x29979b,_0x1fa4f6)['then'](function(_0x1e19f6){logger[_0x930b('0x12')](_0x930b('0x13'),_0x480d1a,'request\x20sent');logger[_0x930b('0x14')](_0x930b('0x15'),_0x480d1a,_0x930b('0x16'),JSON[_0x930b('0x17')](_0x1e19f6));if(_0x1e19f6['error']){if(_0x1e19f6[_0x930b('0x18')][_0x930b('0x19')]===0x1f4){logger[_0x930b('0x18')](_0x930b('0x13'),_0x480d1a,_0x1e19f6[_0x930b('0x18')][_0x930b('0x1a')]);return _0x1d93d5(_0x1e19f6['error']['message']);}logger[_0x930b('0x18')](_0x930b('0x13'),_0x480d1a,_0x1e19f6['error'][_0x930b('0x1a')]);return _0x49bdee(_0x1e19f6[_0x930b('0x18')]['message']);}else{logger[_0x930b('0x12')](_0x930b('0x13'),_0x480d1a,_0x930b('0x16'));_0x49bdee(_0x1e19f6[_0x930b('0x1b')][_0x930b('0x1a')]);}})['catch'](function(_0x418a2c){logger[_0x930b('0x18')](_0x930b('0x13'),_0x480d1a,_0x418a2c);_0x1d93d5(_0x418a2c);});});}exports[_0x930b('0x1c')]=function(_0x508e0a){var _0x2667e9=this;return new Promise(function(_0xa403af,_0x41870){return db[_0x930b('0x1d')][_0x930b('0x1e')]({'raw':_0x508e0a['options']?_0x508e0a[_0x930b('0x1f')][_0x930b('0x20')]===undefined?!![]:![]:!![],'where':_0x508e0a[_0x930b('0x1f')]?_0x508e0a[_0x930b('0x1f')][_0x930b('0x21')]||null:null,'attributes':_0x508e0a[_0x930b('0x1f')]?_0x508e0a[_0x930b('0x1f')]['attributes']||null:null,'limit':_0x508e0a[_0x930b('0x1f')]?_0x508e0a[_0x930b('0x1f')][_0x930b('0x22')]||null:null,'include':_0x508e0a[_0x930b('0x1f')]?_0x508e0a[_0x930b('0x1f')][_0x930b('0x23')]?_[_0x930b('0x24')](_0x508e0a[_0x930b('0x1f')]['include'],function(_0x1f175f){return{'model':db[_0x1f175f[_0x930b('0x25')]],'as':_0x1f175f['as'],'attributes':_0x1f175f[_0x930b('0x26')],'include':_0x1f175f['include']?_['map'](_0x1f175f[_0x930b('0x23')],function(_0x3e301f){return{'model':db[_0x3e301f[_0x930b('0x25')]],'as':_0x3e301f['as'],'attributes':_0x3e301f[_0x930b('0x26')],'include':_0x3e301f[_0x930b('0x23')]?_[_0x930b('0x24')](_0x3e301f[_0x930b('0x23')],function(_0x25b2e5){return{'model':db[_0x25b2e5[_0x930b('0x25')]],'as':_0x25b2e5['as'],'attributes':_0x25b2e5[_0x930b('0x26')]};}):[]};}):[]};}):[]:[]})[_0x930b('0x27')](function(_0x1d4d65){logger['info'](_0x930b('0x1c'),_0x508e0a);logger['debug'](_0x930b('0x1c'),_0x508e0a,JSON[_0x930b('0x17')](_0x1d4d65));_0xa403af(_0x1d4d65);})[_0x930b('0x28')](function(_0x56f917){logger[_0x930b('0x18')](_0x930b('0x1c'),_0x56f917[_0x930b('0x1a')],_0x508e0a);_0x41870(_0x2667e9['error'](0x1f4,_0x56f917[_0x930b('0x1a')]));});});};exports[_0x930b('0x29')]=function(_0x2e24d4){var _0x2c84f2=this;return new Promise(function(_0x4344e7,_0x54c32f){return db[_0x930b('0x1d')][_0x930b('0x2a')]({'raw':_0x2e24d4[_0x930b('0x1f')]?_0x2e24d4[_0x930b('0x1f')][_0x930b('0x20')]===undefined?!![]:![]:!![],'where':_0x2e24d4[_0x930b('0x1f')]?_0x2e24d4['options']['where']||null:null,'attributes':_0x2e24d4[_0x930b('0x1f')]?_0x2e24d4[_0x930b('0x1f')][_0x930b('0x26')]||null:null,'include':_0x2e24d4['options']?_0x2e24d4[_0x930b('0x1f')][_0x930b('0x23')]?_[_0x930b('0x24')](_0x2e24d4[_0x930b('0x1f')][_0x930b('0x23')],function(_0x5006bb){return{'model':db[_0x5006bb[_0x930b('0x25')]],'as':_0x5006bb['as'],'attributes':_0x5006bb[_0x930b('0x26')],'include':_0x5006bb[_0x930b('0x23')]?_['map'](_0x5006bb[_0x930b('0x23')],function(_0x1b6001){return{'model':db[_0x1b6001[_0x930b('0x25')]],'as':_0x1b6001['as'],'attributes':_0x1b6001[_0x930b('0x26')],'include':_0x1b6001['include']?_['map'](_0x1b6001['include'],function(_0x571160){return{'model':db[_0x571160[_0x930b('0x25')]],'as':_0x571160['as'],'attributes':_0x571160['attributes']};}):[]};}):[]};}):[]:[]})[_0x930b('0x27')](function(_0x52dddb){logger['info']('ShowSmsQueue',_0x2e24d4);logger[_0x930b('0x14')](_0x930b('0x29'),_0x2e24d4,JSON['stringify'](_0x52dddb));_0x4344e7(_0x52dddb);})[_0x930b('0x28')](function(_0x333a3e){logger[_0x930b('0x18')](_0x930b('0x29'),_0x333a3e[_0x930b('0x1a')],_0x2e24d4);_0x54c32f(_0x2c84f2[_0x930b('0x18')](0x1f4,_0x333a3e['message']));});});}; \ No newline at end of file +var _0xf237=['GetSmsQueue','SmsQueue','options','where','attributes','limit','include','map','model','then','debug','find','raw','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32d368,_0x37db1c){var _0x4fedd8=function(_0x4b6a30){while(--_0x4b6a30){_0x32d368['push'](_0x32d368['shift']());}};_0x4fedd8(++_0x37db1c);}(_0xf237,0xb2));var _0x7f23=function(_0x50188e,_0x3b667b){_0x50188e=_0x50188e-0x0;var _0x298c5b=_0xf237[_0x50188e];return _0x298c5b;};'use strict';var _=require(_0x7f23('0x0'));var util=require(_0x7f23('0x1'));var moment=require(_0x7f23('0x2'));var BPromise=require(_0x7f23('0x3'));var rs=require(_0x7f23('0x4'));var fs=require('fs');var Redis=require(_0x7f23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f23('0x6'));var logger=require(_0x7f23('0x7'))(_0x7f23('0x8'));var config=require(_0x7f23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7f23('0xa')][_0x7f23('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7f23('0xc')],{'host':_0x7f23('0xd'),'port':0x18eb});var socket=require(_0x7f23('0xe'))(new Redis(config[_0x7f23('0xc')]));require(_0x7f23('0xf'))[_0x7f23('0x10')](socket);function respondWithRpcPromise(_0xe679f0,_0x35a008,_0x339578){return new BPromise(function(_0x116b56,_0x47575a){return client['request'](_0xe679f0,_0x339578)['then'](function(_0xdf2c0b){logger[_0x7f23('0x11')](_0x7f23('0x12'),_0x35a008,_0x7f23('0x13'));logger['debug'](_0x7f23('0x14'),_0x35a008,'request\x20sent',JSON[_0x7f23('0x15')](_0xdf2c0b));if(_0xdf2c0b['error']){if(_0xdf2c0b[_0x7f23('0x16')][_0x7f23('0x17')]===0x1f4){logger['error'](_0x7f23('0x12'),_0x35a008,_0xdf2c0b[_0x7f23('0x16')][_0x7f23('0x18')]);return _0x47575a(_0xdf2c0b[_0x7f23('0x16')][_0x7f23('0x18')]);}logger['error'](_0x7f23('0x12'),_0x35a008,_0xdf2c0b[_0x7f23('0x16')][_0x7f23('0x18')]);return _0x116b56(_0xdf2c0b[_0x7f23('0x16')]['message']);}else{logger[_0x7f23('0x11')](_0x7f23('0x12'),_0x35a008,_0x7f23('0x13'));_0x116b56(_0xdf2c0b[_0x7f23('0x19')][_0x7f23('0x18')]);}})[_0x7f23('0x1a')](function(_0x37edab){logger[_0x7f23('0x16')]('SmsQueue,\x20%s,\x20%s',_0x35a008,_0x37edab);_0x47575a(_0x37edab);});});}exports[_0x7f23('0x1b')]=function(_0x55595d){var _0x1e036d=this;return new Promise(function(_0x4813b8,_0xb60762){return db[_0x7f23('0x1c')]['findAll']({'raw':_0x55595d[_0x7f23('0x1d')]?_0x55595d[_0x7f23('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55595d['options']?_0x55595d[_0x7f23('0x1d')][_0x7f23('0x1e')]||null:null,'attributes':_0x55595d[_0x7f23('0x1d')]?_0x55595d['options'][_0x7f23('0x1f')]||null:null,'limit':_0x55595d['options']?_0x55595d[_0x7f23('0x1d')][_0x7f23('0x20')]||null:null,'include':_0x55595d['options']?_0x55595d[_0x7f23('0x1d')][_0x7f23('0x21')]?_[_0x7f23('0x22')](_0x55595d[_0x7f23('0x1d')][_0x7f23('0x21')],function(_0x6e0e4a){return{'model':db[_0x6e0e4a[_0x7f23('0x23')]],'as':_0x6e0e4a['as'],'attributes':_0x6e0e4a[_0x7f23('0x1f')],'include':_0x6e0e4a[_0x7f23('0x21')]?_['map'](_0x6e0e4a['include'],function(_0x53409f){return{'model':db[_0x53409f[_0x7f23('0x23')]],'as':_0x53409f['as'],'attributes':_0x53409f['attributes'],'include':_0x53409f[_0x7f23('0x21')]?_[_0x7f23('0x22')](_0x53409f['include'],function(_0x294f71){return{'model':db[_0x294f71[_0x7f23('0x23')]],'as':_0x294f71['as'],'attributes':_0x294f71[_0x7f23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7f23('0x24')](function(_0xd0d6e2){logger[_0x7f23('0x11')](_0x7f23('0x1b'),_0x55595d);logger[_0x7f23('0x25')](_0x7f23('0x1b'),_0x55595d,JSON[_0x7f23('0x15')](_0xd0d6e2));_0x4813b8(_0xd0d6e2);})['catch'](function(_0x2aa7a9){logger[_0x7f23('0x16')]('GetSmsQueue',_0x2aa7a9[_0x7f23('0x18')],_0x55595d);_0xb60762(_0x1e036d[_0x7f23('0x16')](0x1f4,_0x2aa7a9[_0x7f23('0x18')]));});});};exports['ShowSmsQueue']=function(_0x2a1e31){var _0x3a43f9=this;return new Promise(function(_0x49ecdc,_0x14a22f){return db[_0x7f23('0x1c')][_0x7f23('0x26')]({'raw':_0x2a1e31[_0x7f23('0x1d')]?_0x2a1e31['options'][_0x7f23('0x27')]===undefined?!![]:![]:!![],'where':_0x2a1e31[_0x7f23('0x1d')]?_0x2a1e31[_0x7f23('0x1d')][_0x7f23('0x1e')]||null:null,'attributes':_0x2a1e31[_0x7f23('0x1d')]?_0x2a1e31[_0x7f23('0x1d')]['attributes']||null:null,'include':_0x2a1e31[_0x7f23('0x1d')]?_0x2a1e31[_0x7f23('0x1d')][_0x7f23('0x21')]?_[_0x7f23('0x22')](_0x2a1e31['options']['include'],function(_0x65a6ef){return{'model':db[_0x65a6ef['model']],'as':_0x65a6ef['as'],'attributes':_0x65a6ef[_0x7f23('0x1f')],'include':_0x65a6ef[_0x7f23('0x21')]?_['map'](_0x65a6ef['include'],function(_0xc87693){return{'model':db[_0xc87693[_0x7f23('0x23')]],'as':_0xc87693['as'],'attributes':_0xc87693[_0x7f23('0x1f')],'include':_0xc87693['include']?_[_0x7f23('0x22')](_0xc87693['include'],function(_0x48129d){return{'model':db[_0x48129d['model']],'as':_0x48129d['as'],'attributes':_0x48129d[_0x7f23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7f23('0x24')](function(_0x2c50a1){logger[_0x7f23('0x11')]('ShowSmsQueue',_0x2a1e31);logger[_0x7f23('0x25')](_0x7f23('0x28'),_0x2a1e31,JSON[_0x7f23('0x15')](_0x2c50a1));_0x49ecdc(_0x2c50a1);})[_0x7f23('0x1a')](function(_0x2e42af){logger[_0x7f23('0x16')](_0x7f23('0x28'),_0x2e42af['message'],_0x2a1e31);_0x14a22f(_0x3a43f9['error'](0x1f4,_0x2e42af['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 556ddc3..a19d5e7 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 _0xea12=['emit','register','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4dc392,_0x255362){var _0x4e45ad=function(_0x1d932d){while(--_0x1d932d){_0x4dc392['push'](_0x4dc392['shift']());}};_0x4e45ad(++_0x255362);}(_0xea12,0x192));var _0x2ea1=function(_0x501c4c,_0x30ce7f){_0x501c4c=_0x501c4c-0x0;var _0x318509=_0xea12[_0x501c4c];return _0x318509;};'use strict';var SmsQueueEvents=require(_0x2ea1('0x0'));var events=[_0x2ea1('0x1'),_0x2ea1('0x2'),_0x2ea1('0x3')];function createListener(_0x15bfbb,_0x5a4d42){return function(_0x1b2088){_0x5a4d42[_0x2ea1('0x4')](_0x15bfbb,_0x1b2088);};}function removeListener(_0x15c6e1,_0x1c74ea){return function(){SmsQueueEvents['removeListener'](_0x15c6e1,_0x1c74ea);};}exports[_0x2ea1('0x5')]=function(_0xcf48dd){for(var _0x43bd47=0x0,_0x17e581=events['length'];_0x43bd47<_0x17e581;_0x43bd47++){var _0x14b921=events[_0x43bd47];var _0x2b33b0=createListener(_0x2ea1('0x6')+_0x14b921,_0xcf48dd);SmsQueueEvents['on'](_0x14b921,_0x2b33b0);}}; \ No newline at end of file +var _0x8797=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x9911a6,_0x3f751d){var _0x5b445d=function(_0x40a6b8){while(--_0x40a6b8){_0x9911a6['push'](_0x9911a6['shift']());}};_0x5b445d(++_0x3f751d);}(_0x8797,0x169));var _0x7879=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0x8797[_0x4d05a0];return _0x4c999c;};'use strict';var SmsQueueEvents=require(_0x7879('0x0'));var events=[_0x7879('0x1'),_0x7879('0x2'),_0x7879('0x3')];function createListener(_0x1891ee,_0x440ac1){return function(_0x1898c4){_0x440ac1[_0x7879('0x4')](_0x1891ee,_0x1898c4);};}function removeListener(_0x3eb0cd,_0x28d4a6){return function(){SmsQueueEvents[_0x7879('0x5')](_0x3eb0cd,_0x28d4a6);};}exports[_0x7879('0x6')]=function(_0x5bdc04){for(var _0x52a236=0x0,_0x54988a=events[_0x7879('0x7')];_0x52a236<_0x54988a;_0x52a236++){var _0x33739f=events[_0x52a236];var _0x1feaa6=createListener(_0x7879('0x8')+_0x33739f,_0x5bdc04);SmsQueueEvents['on'](_0x33739f,_0x1feaa6);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 0d01541..881d389 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 _0xb073=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2e4cdb,_0x5983be){var _0x48002c=function(_0x272b14){while(--_0x272b14){_0x2e4cdb['push'](_0x2e4cdb['shift']());}};_0x48002c(++_0x5983be);}(_0xb073,0x187));var _0x3b07=function(_0x35156b,_0x4f47e1){_0x35156b=_0x35156b-0x0;var _0x5e9bee=_0xb073[_0x35156b];return _0x5e9bee;};'use strict';var multer=require('multer');var util=require(_0x3b07('0x0'));var path=require('path');var timeout=require(_0x3b07('0x1'));var express=require(_0x3b07('0x2'));var router=express[_0x3b07('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3b07('0x4'));var interaction=require(_0x3b07('0x5'));var config=require(_0x3b07('0x6'));var controller=require('./smsQueueReport.controller');router[_0x3b07('0x7')]('/',auth[_0x3b07('0x8')](),controller[_0x3b07('0x9')]);router[_0x3b07('0x7')](_0x3b07('0xa'),auth[_0x3b07('0x8')](),controller[_0x3b07('0xb')]);router[_0x3b07('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3b07('0xc')]);router[_0x3b07('0xd')]('/',auth[_0x3b07('0x8')](),controller[_0x3b07('0xe')]);router[_0x3b07('0xf')](_0x3b07('0x10'),auth[_0x3b07('0x8')](),controller[_0x3b07('0x11')]);router[_0x3b07('0x12')](_0x3b07('0x10'),auth[_0x3b07('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb613=['delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb613,0x9d));var _0x3b61=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xb613[_0x118139];return _0x2fece9;};'use strict';var multer=require(_0x3b61('0x0'));var util=require(_0x3b61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b61('0x2'));var router=express[_0x3b61('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3b61('0x4'));var interaction=require(_0x3b61('0x5'));var config=require(_0x3b61('0x6'));var controller=require(_0x3b61('0x7'));router[_0x3b61('0x8')]('/',auth[_0x3b61('0x9')](),controller[_0x3b61('0xa')]);router['get'](_0x3b61('0xb'),auth[_0x3b61('0x9')](),controller[_0x3b61('0xc')]);router[_0x3b61('0x8')](_0x3b61('0xd'),auth[_0x3b61('0x9')](),controller[_0x3b61('0xe')]);router[_0x3b61('0xf')]('/',auth[_0x3b61('0x9')](),controller[_0x3b61('0x10')]);router[_0x3b61('0x11')](_0x3b61('0xd'),auth[_0x3b61('0x9')](),controller[_0x3b61('0x12')]);router[_0x3b61('0x13')]('/:id',auth[_0x3b61('0x9')](),controller[_0x3b61('0x14')]);module[_0x3b61('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 35d429f..3f3df61 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 _0xd3fd=['DATE','moment','sequelize','exports','STRING'];(function(_0x244b11,_0x5454db){var _0x2e5192=function(_0x4a78d5){while(--_0x4a78d5){_0x244b11['push'](_0x244b11['shift']());}};_0x2e5192(++_0x5454db);}(_0xd3fd,0x10a));var _0xdd3f=function(_0x293a70,_0x59d647){_0x293a70=_0x293a70-0x0;var _0x13c872=_0xd3fd[_0x293a70];return _0x13c872;};'use strict';var moment=require(_0xdd3f('0x0'));var Sequelize=require(_0xdd3f('0x1'));module[_0xdd3f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdd3f('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdd3f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdd3f('0x3')]}}; \ No newline at end of file +var _0xedf2=['sequelize','STRING','DATE'];(function(_0x537abc,_0x19aaf2){var _0x139c64=function(_0x4f410c){while(--_0x4f410c){_0x537abc['push'](_0x537abc['shift']());}};_0x139c64(++_0x19aaf2);}(_0xedf2,0xa2));var _0x2edf=function(_0x541dc0,_0xb3b817){_0x541dc0=_0x541dc0-0x0;var _0x1172ca=_0xedf2[_0x541dc0];return _0x1172ca;};'use strict';var moment=require('moment');var Sequelize=require(_0x2edf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2edf('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2edf('0x1')]},'joinAt':{'type':Sequelize[_0x2edf('0x2')]},'leaveAt':{'type':Sequelize[_0x2edf('0x2')]},'acceptAt':{'type':Sequelize[_0x2edf('0x2')]},'exitAt':{'type':Sequelize[_0x2edf('0x2')]},'reason':{'type':Sequelize[_0x2edf('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 00757f4..ecdfb6e 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 _0x4f1a=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','show','params','fields','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4f1a,0xb8));var _0xa4f1=function(_0x27d0d8,_0x2b657d){_0x27d0d8=_0x27d0d8-0x0;var _0x2b79d1=_0x4f1a[_0x27d0d8];return _0x2b79d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4f1('0x1'));var rp=require(_0xa4f1('0x2'));var moment=require('moment');var BPromise=require(_0xa4f1('0x3'));var Mustache=require('mustache');var util=require(_0xa4f1('0x4'));var path=require(_0xa4f1('0x5'));var sox=require(_0xa4f1('0x6'));var csv=require(_0xa4f1('0x7'));var ejs=require(_0xa4f1('0x8'));var fs=require('fs');var fs_extra=require(_0xa4f1('0x9'));var _=require(_0xa4f1('0xa'));var squel=require(_0xa4f1('0xb'));var crypto=require(_0xa4f1('0xc'));var jsforce=require(_0xa4f1('0xd'));var deskjs=require(_0xa4f1('0xe'));var toCsv=require(_0xa4f1('0x7'));var querystring=require('querystring');var Papa=require(_0xa4f1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa4f1('0x10'));var as=require(_0xa4f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4f1('0x12'))(_0xa4f1('0x13'));var utils=require('../../config/utils');var config=require(_0xa4f1('0x14'));var licenseUtil=require(_0xa4f1('0x15'));var db=require(_0xa4f1('0x16'))['db'];function respondWithStatusCode(_0x3da255,_0x24b31c){_0x24b31c=_0x24b31c||0xcc;return function(_0x4ddda6){if(_0x4ddda6){return _0x3da255[_0xa4f1('0x17')](_0x24b31c);}return _0x3da255['status'](_0x24b31c)[_0xa4f1('0x18')]();};}function respondWithResult(_0x19b297,_0x5d6464){_0x5d6464=_0x5d6464||0xc8;return function(_0x4b8a24){if(_0x4b8a24){return _0x19b297['status'](_0x5d6464)[_0xa4f1('0x19')](_0x4b8a24);}};}function respondWithFilteredResult(_0x17c7fe,_0x5d7619){return function(_0x3ff4d8){if(_0x3ff4d8){var _0x1fb21a=typeof _0x5d7619[_0xa4f1('0x1a')]===_0xa4f1('0x1b')&&typeof _0x5d7619[_0xa4f1('0x1c')]===_0xa4f1('0x1b');var _0x178975=_0x3ff4d8[_0xa4f1('0x1d')];var _0x35c0ba=_0x1fb21a?0x0:_0x5d7619[_0xa4f1('0x1a')];var _0x530f98=_0x1fb21a?_0x3ff4d8[_0xa4f1('0x1d')]:_0x5d7619[_0xa4f1('0x1a')]+_0x5d7619['limit'];var _0x39b2f7;if(_0x530f98>=_0x178975){_0x530f98=_0x178975;_0x39b2f7=0xc8;}else{_0x39b2f7=0xce;}_0x17c7fe[_0xa4f1('0x1e')](_0x39b2f7);return _0x17c7fe[_0xa4f1('0x1f')](_0xa4f1('0x20'),_0x35c0ba+'-'+_0x530f98+'/'+_0x178975)[_0xa4f1('0x19')](_0x3ff4d8);}return null;};}function patchUpdates(_0x3807ce){return function(_0x4b2a8c){try{jsonpatch[_0xa4f1('0x21')](_0x4b2a8c,_0x3807ce,!![]);}catch(_0x17003c){return BPromise[_0xa4f1('0x22')](_0x17003c);}return _0x4b2a8c['save']();};}function saveUpdates(_0x36b6b6,_0x2cb7b5){return function(_0x16e86d){if(_0x16e86d){return _0x16e86d[_0xa4f1('0x23')](_0x36b6b6)[_0xa4f1('0x24')](function(_0xfc4854){return _0xfc4854;});}return null;};}function removeEntity(_0x458ad7,_0x37d32a){return function(_0x48cda5){if(_0x48cda5){return _0x48cda5[_0xa4f1('0x25')]()[_0xa4f1('0x24')](function(){_0x458ad7[_0xa4f1('0x1e')](0xcc)[_0xa4f1('0x18')]();});}};}function handleEntityNotFound(_0x30a4bf,_0x5a2851){return function(_0x35f19c){if(!_0x35f19c){_0x30a4bf[_0xa4f1('0x17')](0x194);}return _0x35f19c;};}function handleError(_0x3d1e24,_0x32a3b8){_0x32a3b8=_0x32a3b8||0x1f4;return function(_0x4e1150){logger[_0xa4f1('0x26')](_0x4e1150[_0xa4f1('0x27')]);if(_0x4e1150[_0xa4f1('0x28')]){delete _0x4e1150[_0xa4f1('0x28')];}_0x3d1e24[_0xa4f1('0x1e')](_0x32a3b8)[_0xa4f1('0x29')](_0x4e1150);};}exports[_0xa4f1('0x2a')]=function(_0x1c0db3,_0x258be5){var _0x4facc1={},_0x4aee51={},_0x5f16f7={'count':0x0,'rows':[]};var _0x2e409c=_[_0xa4f1('0x2b')](db['SmsQueueReport'][_0xa4f1('0x2c')],function(_0x3aec38){return{'name':_0x3aec38[_0xa4f1('0x2d')],'type':_0x3aec38[_0xa4f1('0x2e')][_0xa4f1('0x2f')]};});_0x4aee51['model']=_[_0xa4f1('0x2b')](_0x2e409c,'name');_0x4aee51[_0xa4f1('0x30')]=_[_0xa4f1('0x31')](_0x1c0db3['query']);_0x4aee51['filters']=_['intersection'](_0x4aee51['model'],_0x4aee51[_0xa4f1('0x30')]);_0x4facc1[_0xa4f1('0x32')]=_[_0xa4f1('0x33')](_0x4aee51[_0xa4f1('0x34')],qs['fields'](_0x1c0db3[_0xa4f1('0x30')]['fields']));_0x4facc1[_0xa4f1('0x32')]=_0x4facc1[_0xa4f1('0x32')][_0xa4f1('0x35')]?_0x4facc1['attributes']:_0x4aee51[_0xa4f1('0x34')];if(!_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x36')]('nolimit')){_0x4facc1[_0xa4f1('0x1c')]=qs[_0xa4f1('0x1c')](_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x1c')]);_0x4facc1[_0xa4f1('0x1a')]=qs[_0xa4f1('0x1a')](_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x1a')]);}_0x4facc1['order']=qs[_0xa4f1('0x37')](_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x37')]);_0x4facc1[_0xa4f1('0x38')]=qs[_0xa4f1('0x39')](_['pick'](_0x1c0db3[_0xa4f1('0x30')],_0x4aee51[_0xa4f1('0x39')]),_0x2e409c);if(_0x1c0db3['query'][_0xa4f1('0x3a')]){_0x4facc1[_0xa4f1('0x38')]=_[_0xa4f1('0x3b')](_0x4facc1['where'],{'$or':_['map'](_0x2e409c,function(_0x5c391c){if(_0x5c391c['type']!==_0xa4f1('0x3c')){var _0x58b724={};_0x58b724[_0x5c391c[_0xa4f1('0x28')]]={'$like':'%'+_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x3a')]+'%'};return _0x58b724;}})});}_0x4facc1=_[_0xa4f1('0x3b')]({},_0x4facc1,_0x1c0db3['options']);var _0x2dddf3={'where':_0x4facc1[_0xa4f1('0x38')]};return db[_0xa4f1('0x3d')][_0xa4f1('0x1d')](_0x2dddf3)['then'](function(_0x264565){_0x5f16f7[_0xa4f1('0x1d')]=_0x264565;if(_0x1c0db3[_0xa4f1('0x30')][_0xa4f1('0x3e')]){_0x4facc1[_0xa4f1('0x3f')]=[{'all':!![]}];}return db[_0xa4f1('0x3d')][_0xa4f1('0x40')](_0x4facc1);})[_0xa4f1('0x24')](function(_0x21421f){_0x5f16f7[_0xa4f1('0x41')]=_0x21421f;return _0x5f16f7;})[_0xa4f1('0x24')](respondWithFilteredResult(_0x258be5,_0x4facc1))['catch'](handleError(_0x258be5,null));};exports[_0xa4f1('0x42')]=function(_0x3c5f68,_0x5840b8){var _0xd4a4c7={'raw':!![],'where':{'id':_0x3c5f68[_0xa4f1('0x43')]['id']}},_0x45317f={};_0x45317f[_0xa4f1('0x34')]=_[_0xa4f1('0x31')](db[_0xa4f1('0x3d')][_0xa4f1('0x2c')]);_0x45317f[_0xa4f1('0x30')]=_[_0xa4f1('0x31')](_0x3c5f68[_0xa4f1('0x30')]);_0x45317f['filters']=_[_0xa4f1('0x33')](_0x45317f[_0xa4f1('0x34')],_0x45317f[_0xa4f1('0x30')]);_0xd4a4c7[_0xa4f1('0x32')]=_[_0xa4f1('0x33')](_0x45317f['model'],qs['fields'](_0x3c5f68['query'][_0xa4f1('0x44')]));_0xd4a4c7['attributes']=_0xd4a4c7['attributes'][_0xa4f1('0x35')]?_0xd4a4c7[_0xa4f1('0x32')]:_0x45317f['model'];if(_0x3c5f68[_0xa4f1('0x30')][_0xa4f1('0x3e')]){_0xd4a4c7['include']=[{'all':!![]}];}_0xd4a4c7=_[_0xa4f1('0x3b')]({},_0xd4a4c7,_0x3c5f68['options']);return db[_0xa4f1('0x3d')]['find'](_0xd4a4c7)[_0xa4f1('0x24')](handleEntityNotFound(_0x5840b8,null))['then'](respondWithResult(_0x5840b8,null))[_0xa4f1('0x45')](handleError(_0x5840b8,null));};exports['create']=function(_0x5df525,_0x4e68ba){return db['SmsQueueReport'][_0xa4f1('0x46')](_0x5df525[_0xa4f1('0x47')],{})[_0xa4f1('0x24')](respondWithResult(_0x4e68ba,0xc9))[_0xa4f1('0x45')](handleError(_0x4e68ba,null));};exports[_0xa4f1('0x23')]=function(_0x4b5f80,_0x23e213){if(_0x4b5f80[_0xa4f1('0x47')]['id']){delete _0x4b5f80['body']['id'];}return db[_0xa4f1('0x3d')][_0xa4f1('0x48')]({'where':{'id':_0x4b5f80[_0xa4f1('0x43')]['id']}})[_0xa4f1('0x24')](handleEntityNotFound(_0x23e213,null))[_0xa4f1('0x24')](saveUpdates(_0x4b5f80['body'],null))[_0xa4f1('0x24')](respondWithResult(_0x23e213,null))[_0xa4f1('0x45')](handleError(_0x23e213,null));};exports[_0xa4f1('0x25')]=function(_0x10159d,_0x38725f){return db[_0xa4f1('0x3d')][_0xa4f1('0x48')]({'where':{'id':_0x10159d['params']['id']}})[_0xa4f1('0x24')](handleEntityNotFound(_0x38725f,null))[_0xa4f1('0x24')](removeEntity(_0x38725f,null))['catch'](handleError(_0x38725f,null));};exports['describe']=function(_0x1661f3,_0x1c1615){return db['SmsQueueReport'][_0xa4f1('0x49')]()[_0xa4f1('0x24')](respondWithResult(_0x1c1615,null))[_0xa4f1('0x45')](handleError(_0x1c1615,null));}; \ No newline at end of file +var _0xd3ae=['map','SmsQueueReport','rawAttributes','type','key','model','query','intersection','attributes','fields','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','catch','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3ae,0x65));var _0xed3a=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xd3ae[_0x38c632];return _0x12737e;};'use strict';var emlformat=require(_0xed3a('0x0'));var rimraf=require(_0xed3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed3a('0x2'));var rp=require('request-promise');var moment=require(_0xed3a('0x3'));var BPromise=require(_0xed3a('0x4'));var Mustache=require(_0xed3a('0x5'));var util=require(_0xed3a('0x6'));var path=require(_0xed3a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed3a('0x8'));var fs=require('fs');var fs_extra=require(_0xed3a('0x9'));var _=require('lodash');var squel=require(_0xed3a('0xa'));var crypto=require('crypto');var jsforce=require(_0xed3a('0xb'));var deskjs=require(_0xed3a('0xc'));var toCsv=require(_0xed3a('0xd'));var querystring=require('querystring');var Papa=require(_0xed3a('0xe'));var Redis=require(_0xed3a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xed3a('0x10'));var as=require(_0xed3a('0x11'));var hardwareService=require(_0xed3a('0x12'));var logger=require(_0xed3a('0x13'))(_0xed3a('0x14'));var utils=require(_0xed3a('0x15'));var config=require(_0xed3a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x303a3a,_0x1cc1a6){_0x1cc1a6=_0x1cc1a6||0xcc;return function(_0x226670){if(_0x226670){return _0x303a3a[_0xed3a('0x17')](_0x1cc1a6);}return _0x303a3a[_0xed3a('0x18')](_0x1cc1a6)[_0xed3a('0x19')]();};}function respondWithResult(_0x58ab5d,_0x3a7f92){_0x3a7f92=_0x3a7f92||0xc8;return function(_0x4e4e20){if(_0x4e4e20){return _0x58ab5d[_0xed3a('0x18')](_0x3a7f92)[_0xed3a('0x1a')](_0x4e4e20);}};}function respondWithFilteredResult(_0xfca430,_0x36b16a){return function(_0x1280fa){if(_0x1280fa){var _0x13a28f=typeof _0x36b16a[_0xed3a('0x1b')]===_0xed3a('0x1c')&&typeof _0x36b16a[_0xed3a('0x1d')]===_0xed3a('0x1c');var _0x3b51a9=_0x1280fa['count'];var _0x535eca=_0x13a28f?0x0:_0x36b16a[_0xed3a('0x1b')];var _0x2e6331=_0x13a28f?_0x1280fa[_0xed3a('0x1e')]:_0x36b16a[_0xed3a('0x1b')]+_0x36b16a[_0xed3a('0x1d')];var _0x4d981d;if(_0x2e6331>=_0x3b51a9){_0x2e6331=_0x3b51a9;_0x4d981d=0xc8;}else{_0x4d981d=0xce;}_0xfca430['status'](_0x4d981d);return _0xfca430[_0xed3a('0x1f')](_0xed3a('0x20'),_0x535eca+'-'+_0x2e6331+'/'+_0x3b51a9)[_0xed3a('0x1a')](_0x1280fa);}return null;};}function patchUpdates(_0x2f2af8){return function(_0x3897fe){try{jsonpatch['apply'](_0x3897fe,_0x2f2af8,!![]);}catch(_0x5825cb){return BPromise['reject'](_0x5825cb);}return _0x3897fe[_0xed3a('0x21')]();};}function saveUpdates(_0x27ed1d,_0xe7021){return function(_0x187a61){if(_0x187a61){return _0x187a61['update'](_0x27ed1d)[_0xed3a('0x22')](function(_0x23520c){return _0x23520c;});}return null;};}function removeEntity(_0x160131,_0x18c215){return function(_0x2ccc14){if(_0x2ccc14){return _0x2ccc14[_0xed3a('0x23')]()[_0xed3a('0x22')](function(){_0x160131[_0xed3a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dcabc,_0x52012b){return function(_0x53e47f){if(!_0x53e47f){_0x1dcabc['sendStatus'](0x194);}return _0x53e47f;};}function handleError(_0x5c9677,_0x381420){_0x381420=_0x381420||0x1f4;return function(_0x1335ce){logger['error'](_0x1335ce[_0xed3a('0x24')]);if(_0x1335ce['name']){delete _0x1335ce[_0xed3a('0x25')];}_0x5c9677[_0xed3a('0x18')](_0x381420)[_0xed3a('0x26')](_0x1335ce);};}exports['index']=function(_0x5ca26a,_0x42a8dd){var _0x18a35d={},_0x431d93={},_0x18fe63={'count':0x0,'rows':[]};var _0x14953f=_[_0xed3a('0x27')](db[_0xed3a('0x28')][_0xed3a('0x29')],function(_0x24394b){return{'name':_0x24394b['fieldName'],'type':_0x24394b[_0xed3a('0x2a')][_0xed3a('0x2b')]};});_0x431d93[_0xed3a('0x2c')]=_[_0xed3a('0x27')](_0x14953f,_0xed3a('0x25'));_0x431d93['query']=_['keys'](_0x5ca26a[_0xed3a('0x2d')]);_0x431d93['filters']=_[_0xed3a('0x2e')](_0x431d93[_0xed3a('0x2c')],_0x431d93[_0xed3a('0x2d')]);_0x18a35d[_0xed3a('0x2f')]=_[_0xed3a('0x2e')](_0x431d93[_0xed3a('0x2c')],qs[_0xed3a('0x30')](_0x5ca26a[_0xed3a('0x2d')]['fields']));_0x18a35d['attributes']=_0x18a35d[_0xed3a('0x2f')]['length']?_0x18a35d[_0xed3a('0x2f')]:_0x431d93[_0xed3a('0x2c')];if(!_0x5ca26a[_0xed3a('0x2d')]['hasOwnProperty']('nolimit')){_0x18a35d[_0xed3a('0x1d')]=qs[_0xed3a('0x1d')](_0x5ca26a[_0xed3a('0x2d')][_0xed3a('0x1d')]);_0x18a35d[_0xed3a('0x1b')]=qs[_0xed3a('0x1b')](_0x5ca26a[_0xed3a('0x2d')][_0xed3a('0x1b')]);}_0x18a35d['order']=qs[_0xed3a('0x31')](_0x5ca26a['query']['sort']);_0x18a35d[_0xed3a('0x32')]=qs['filters'](_[_0xed3a('0x33')](_0x5ca26a[_0xed3a('0x2d')],_0x431d93[_0xed3a('0x34')]),_0x14953f);if(_0x5ca26a['query'][_0xed3a('0x35')]){_0x18a35d[_0xed3a('0x32')]=_[_0xed3a('0x36')](_0x18a35d[_0xed3a('0x32')],{'$or':_[_0xed3a('0x27')](_0x14953f,function(_0x4ffc39){if(_0x4ffc39[_0xed3a('0x2a')]!==_0xed3a('0x37')){var _0x17d732={};_0x17d732[_0x4ffc39[_0xed3a('0x25')]]={'$like':'%'+_0x5ca26a[_0xed3a('0x2d')][_0xed3a('0x35')]+'%'};return _0x17d732;}})});}_0x18a35d=_[_0xed3a('0x36')]({},_0x18a35d,_0x5ca26a[_0xed3a('0x38')]);var _0x5a008a={'where':_0x18a35d['where']};return db[_0xed3a('0x28')][_0xed3a('0x1e')](_0x5a008a)[_0xed3a('0x22')](function(_0x5ddf7e){_0x18fe63[_0xed3a('0x1e')]=_0x5ddf7e;if(_0x5ca26a[_0xed3a('0x2d')]['includeAll']){_0x18a35d[_0xed3a('0x39')]=[{'all':!![]}];}return db[_0xed3a('0x28')][_0xed3a('0x3a')](_0x18a35d);})['then'](function(_0xd92807){_0x18fe63[_0xed3a('0x3b')]=_0xd92807;return _0x18fe63;})[_0xed3a('0x22')](respondWithFilteredResult(_0x42a8dd,_0x18a35d))['catch'](handleError(_0x42a8dd,null));};exports[_0xed3a('0x3c')]=function(_0x3010f8,_0x391d0e){var _0x5748dd={'raw':!![],'where':{'id':_0x3010f8['params']['id']}},_0x213478={};_0x213478[_0xed3a('0x2c')]=_[_0xed3a('0x3d')](db[_0xed3a('0x28')][_0xed3a('0x29')]);_0x213478['query']=_['keys'](_0x3010f8[_0xed3a('0x2d')]);_0x213478[_0xed3a('0x34')]=_['intersection'](_0x213478[_0xed3a('0x2c')],_0x213478['query']);_0x5748dd[_0xed3a('0x2f')]=_[_0xed3a('0x2e')](_0x213478[_0xed3a('0x2c')],qs[_0xed3a('0x30')](_0x3010f8['query'][_0xed3a('0x30')]));_0x5748dd['attributes']=_0x5748dd[_0xed3a('0x2f')][_0xed3a('0x3e')]?_0x5748dd[_0xed3a('0x2f')]:_0x213478[_0xed3a('0x2c')];if(_0x3010f8['query'][_0xed3a('0x3f')]){_0x5748dd[_0xed3a('0x39')]=[{'all':!![]}];}_0x5748dd=_[_0xed3a('0x36')]({},_0x5748dd,_0x3010f8[_0xed3a('0x38')]);return db[_0xed3a('0x28')]['find'](_0x5748dd)['then'](handleEntityNotFound(_0x391d0e,null))[_0xed3a('0x22')](respondWithResult(_0x391d0e,null))[_0xed3a('0x40')](handleError(_0x391d0e,null));};exports[_0xed3a('0x41')]=function(_0x3090da,_0x290092){return db[_0xed3a('0x28')]['create'](_0x3090da[_0xed3a('0x42')],{})[_0xed3a('0x22')](respondWithResult(_0x290092,0xc9))[_0xed3a('0x40')](handleError(_0x290092,null));};exports[_0xed3a('0x43')]=function(_0x386e73,_0x29d38f){if(_0x386e73[_0xed3a('0x42')]['id']){delete _0x386e73[_0xed3a('0x42')]['id'];}return db[_0xed3a('0x28')]['find']({'where':{'id':_0x386e73[_0xed3a('0x44')]['id']}})[_0xed3a('0x22')](handleEntityNotFound(_0x29d38f,null))[_0xed3a('0x22')](saveUpdates(_0x386e73[_0xed3a('0x42')],null))[_0xed3a('0x22')](respondWithResult(_0x29d38f,null))[_0xed3a('0x40')](handleError(_0x29d38f,null));};exports['destroy']=function(_0x49da30,_0x3c72a5){return db['SmsQueueReport']['find']({'where':{'id':_0x49da30[_0xed3a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c72a5,null))[_0xed3a('0x22')](removeEntity(_0x3c72a5,null))[_0xed3a('0x40')](handleError(_0x3c72a5,null));};exports[_0xed3a('0x45')]=function(_0x5eef2f,_0x798be9){return db[_0xed3a('0x28')][_0xed3a('0x45')]()[_0xed3a('0x22')](respondWithResult(_0x798be9,null))[_0xed3a('0x40')](handleError(_0x798be9,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9537ec7..50073fb 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(_0x2ef1f5,_0x32fffd){var _0x4e5c57=function(_0x2e52b1){while(--_0x2e52b1){_0x2ef1f5['push'](_0x2ef1f5['shift']());}};_0x4e5c57(++_0x32fffd);}(_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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 f532b33..a450a7f 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 _0xce8e=['request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','stringify','UpdateSmsQueueReport','update','options','raw','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0xab56c3,_0x16490c){var _0x3de734=function(_0x38c0bb){while(--_0x38c0bb){_0xab56c3['push'](_0xab56c3['shift']());}};_0x3de734(++_0x16490c);}(_0xce8e,0x14a));var _0xece8=function(_0x45b259,_0x43d36e){_0x45b259=_0x45b259-0x0;var _0x254bc7=_0xce8e[_0x45b259];return _0x254bc7;};'use strict';var _=require('lodash');var util=require(_0xece8('0x0'));var moment=require(_0xece8('0x1'));var BPromise=require(_0xece8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xece8('0x3'));var db=require(_0xece8('0x4'))['db'];var utils=require(_0xece8('0x5'));var logger=require(_0xece8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xece8('0x7'));var client=jayson[_0xece8('0x8')][_0xece8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x160b48,_0x52e546,_0x498a3f){return new BPromise(function(_0x5bab8e,_0x4991e0){return client[_0xece8('0xa')](_0x160b48,_0x498a3f)[_0xece8('0xb')](function(_0x262976){logger[_0xece8('0xc')](_0xece8('0xd'),_0x52e546,'request\x20sent');logger[_0xece8('0xe')](_0xece8('0xf'),_0x52e546,'request\x20sent',JSON['stringify'](_0x262976));if(_0x262976[_0xece8('0x10')]){if(_0x262976[_0xece8('0x10')][_0xece8('0x11')]===0x1f4){logger[_0xece8('0x10')](_0xece8('0xd'),_0x52e546,_0x262976['error'][_0xece8('0x12')]);return _0x4991e0(_0x262976[_0xece8('0x10')]['message']);}logger[_0xece8('0x10')](_0xece8('0xd'),_0x52e546,_0x262976[_0xece8('0x10')]['message']);return _0x5bab8e(_0x262976[_0xece8('0x10')][_0xece8('0x12')]);}else{logger['info'](_0xece8('0xd'),_0x52e546,_0xece8('0x13'));_0x5bab8e(_0x262976[_0xece8('0x14')][_0xece8('0x12')]);}})[_0xece8('0x15')](function(_0x3763be){logger[_0xece8('0x10')](_0xece8('0xd'),_0x52e546,_0x3763be);_0x4991e0(_0x3763be);});});}exports[_0xece8('0x16')]=function(_0x5718f3){var _0x5e64d4=this;return new Promise(function(_0x35fd84,_0x3755df){return db[_0xece8('0x17')][_0xece8('0x18')](_0x5718f3[_0xece8('0x19')],{'raw':_0x5718f3['options']?_0x5718f3['options']['raw']===undefined?!![]:![]:!![]})[_0xece8('0xb')](function(_0x29fd7e){logger['info'](_0xece8('0x16'),_0x5718f3);logger[_0xece8('0xe')](_0xece8('0x16'),_0x5718f3,JSON[_0xece8('0x1a')](_0x29fd7e));_0x35fd84(_0x29fd7e);})['catch'](function(_0x24260e){logger[_0xece8('0x10')](_0xece8('0x16'),_0x24260e[_0xece8('0x12')],_0x5718f3);_0x3755df(_0x5e64d4['error'](0x1f4,_0x24260e[_0xece8('0x12')]));});});};exports[_0xece8('0x1b')]=function(_0x226c47){var _0x354eed=this;return new Promise(function(_0x2629d0,_0x25276e){return db['SmsQueueReport'][_0xece8('0x1c')](_0x226c47['body'],{'raw':_0x226c47[_0xece8('0x1d')]?_0x226c47['options'][_0xece8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x226c47[_0xece8('0x1d')]?_0x226c47['options'][_0xece8('0x1f')]||null:null,'attributes':_0x226c47['options']?_0x226c47[_0xece8('0x1d')][_0xece8('0x20')]||null:null,'limit':_0x226c47[_0xece8('0x1d')]?_0x226c47[_0xece8('0x1d')][_0xece8('0x21')]||null:null})[_0xece8('0xb')](function(_0x135697){logger[_0xece8('0xc')](_0xece8('0x1b'),_0x226c47);logger[_0xece8('0xe')](_0xece8('0x1b'),_0x226c47,JSON[_0xece8('0x1a')](_0x135697));_0x2629d0(_0x135697);})[_0xece8('0x15')](function(_0x50aafc){logger[_0xece8('0x10')](_0xece8('0x1b'),_0x50aafc[_0xece8('0x12')],_0x226c47);_0x25276e(_0x354eed[_0xece8('0x10')](0x1f4,_0x50aafc[_0xece8('0x12')]));});});}; \ No newline at end of file +var _0xd5ba=['CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','UpdateSmsQueueReport','where','attributes','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x55bc6c,_0x1f7ab1){var _0x5300ec=function(_0x486f49){while(--_0x486f49){_0x55bc6c['push'](_0x55bc6c['shift']());}};_0x5300ec(++_0x1f7ab1);}(_0xd5ba,0x82));var _0xad5b=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd5ba[_0x279d37];return _0x530173;};'use strict';var _=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var moment=require(_0xad5b('0x2'));var BPromise=require('bluebird');var rs=require(_0xad5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad5b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad5b('0x5'));var config=require(_0xad5b('0x6'));var jayson=require(_0xad5b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26f20c,_0x13f2c8,_0x18f37c){return new BPromise(function(_0x25c672,_0x289c24){return client[_0xad5b('0x8')](_0x26f20c,_0x18f37c)[_0xad5b('0x9')](function(_0x257e91){logger[_0xad5b('0xa')](_0xad5b('0xb'),_0x13f2c8,'request\x20sent');logger['debug'](_0xad5b('0xc'),_0x13f2c8,_0xad5b('0xd'),JSON[_0xad5b('0xe')](_0x257e91));if(_0x257e91[_0xad5b('0xf')]){if(_0x257e91[_0xad5b('0xf')][_0xad5b('0x10')]===0x1f4){logger['error'](_0xad5b('0xb'),_0x13f2c8,_0x257e91[_0xad5b('0xf')][_0xad5b('0x11')]);return _0x289c24(_0x257e91[_0xad5b('0xf')][_0xad5b('0x11')]);}logger['error'](_0xad5b('0xb'),_0x13f2c8,_0x257e91[_0xad5b('0xf')][_0xad5b('0x11')]);return _0x25c672(_0x257e91['error']['message']);}else{logger[_0xad5b('0xa')](_0xad5b('0xb'),_0x13f2c8,_0xad5b('0xd'));_0x25c672(_0x257e91[_0xad5b('0x12')][_0xad5b('0x11')]);}})[_0xad5b('0x13')](function(_0x178932){logger[_0xad5b('0xf')](_0xad5b('0xb'),_0x13f2c8,_0x178932);_0x289c24(_0x178932);});});}exports[_0xad5b('0x14')]=function(_0x442db0){var _0x115994=this;return new Promise(function(_0x80d008,_0x87a22b){return db[_0xad5b('0x15')][_0xad5b('0x16')](_0x442db0[_0xad5b('0x17')],{'raw':_0x442db0[_0xad5b('0x18')]?_0x442db0['options'][_0xad5b('0x19')]===undefined?!![]:![]:!![]})[_0xad5b('0x9')](function(_0x1d2f5c){logger['info'](_0xad5b('0x14'),_0x442db0);logger[_0xad5b('0x1a')](_0xad5b('0x14'),_0x442db0,JSON[_0xad5b('0xe')](_0x1d2f5c));_0x80d008(_0x1d2f5c);})[_0xad5b('0x13')](function(_0x2548d7){logger[_0xad5b('0xf')]('CreateSmsQueueReport',_0x2548d7['message'],_0x442db0);_0x87a22b(_0x115994['error'](0x1f4,_0x2548d7[_0xad5b('0x11')]));});});};exports[_0xad5b('0x1b')]=function(_0x2af13c){var _0xf3f1d1=this;return new Promise(function(_0x299ebc,_0x524f1f){return db[_0xad5b('0x15')]['update'](_0x2af13c['body'],{'raw':_0x2af13c[_0xad5b('0x18')]?_0x2af13c['options'][_0xad5b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af13c[_0xad5b('0x18')]?_0x2af13c[_0xad5b('0x18')][_0xad5b('0x1c')]||null:null,'attributes':_0x2af13c[_0xad5b('0x18')]?_0x2af13c[_0xad5b('0x18')][_0xad5b('0x1d')]||null:null,'limit':_0x2af13c[_0xad5b('0x18')]?_0x2af13c[_0xad5b('0x18')]['limit']||null:null})['then'](function(_0x705b58){logger[_0xad5b('0xa')](_0xad5b('0x1b'),_0x2af13c);logger[_0xad5b('0x1a')](_0xad5b('0x1b'),_0x2af13c,JSON[_0xad5b('0xe')](_0x705b58));_0x299ebc(_0x705b58);})[_0xad5b('0x13')](function(_0x6c184){logger[_0xad5b('0xf')](_0xad5b('0x1b'),_0x6c184[_0xad5b('0x11')],_0x2af13c);_0x524f1f(_0xf3f1d1['error'](0x1f4,_0x6c184[_0xad5b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 631159f..dcd4acd 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 _0x0c02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','util','path','express','Router'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x20c0('0x9')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0xe')]('/',auth[_0x20c0('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x20c0('0xf')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfd0f=['index','/describe','describe','/:id','show','post','put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated'];(function(_0x37ff3d,_0x2c06de){var _0x3ed104=function(_0x2a8a08){while(--_0x2a8a08){_0x37ff3d['push'](_0x37ff3d['shift']());}};_0x3ed104(++_0x2c06de);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x190ce1,_0x4ee5c8){_0x190ce1=_0x190ce1-0x0;var _0x380f9b=_0xfd0f[_0x190ce1];return _0x380f9b;};'use strict';var multer=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var path=require('path');var timeout=require(_0xffd0('0x2'));var express=require(_0xffd0('0x3'));var router=express[_0xffd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffd0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd0('0x6'));var controller=require(_0xffd0('0x7'));router[_0xffd0('0x8')]('/',auth[_0xffd0('0x9')](),controller[_0xffd0('0xa')]);router[_0xffd0('0x8')](_0xffd0('0xb'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xc')]);router['get'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller[_0xffd0('0xe')]);router[_0xffd0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xffd0('0x10')](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['update']);router['delete'](_0xffd0('0xd'),auth[_0xffd0('0x9')](),controller['destroy']);module[_0xffd0('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6034eab..89b7fc2 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2dbc5b,_0x141f92){var _0x2bd121=function(_0x12e161){while(--_0x12e161){_0x2dbc5b['push'](_0x2dbc5b['shift']());}};_0x2bd121(++_0x141f92);}(_0xaa88,0x137));var _0x8aa8=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xaa88[_0x5216e0];return _0x5b3f40;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4ffa11,_0x120051){var _0x1f669d=function(_0x44b3ab){while(--_0x44b3ab){_0x4ffa11['push'](_0x4ffa11['shift']());}};_0x1f669d(++_0x120051);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4b84[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 5e2090f..bdfb589 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 _0x0ea9=['keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','SmsTransferReport','findAll','catch','show','params'];(function(_0x50ca2e,_0x3294ee){var _0x8a58c5=function(_0x6f29aa){while(--_0x6f29aa){_0x50ca2e['push'](_0x50ca2e['shift']());}};_0x8a58c5(++_0x3294ee);}(_0x0ea9,0xe9));var _0x90ea=function(_0x2d4c2d,_0x3a7895){_0x2d4c2d=_0x2d4c2d-0x0;var _0x25f284=_0x0ea9[_0x2d4c2d];return _0x25f284;};'use strict';var emlformat=require(_0x90ea('0x0'));var rimraf=require(_0x90ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90ea('0x2'));var rp=require(_0x90ea('0x3'));var moment=require(_0x90ea('0x4'));var BPromise=require(_0x90ea('0x5'));var Mustache=require(_0x90ea('0x6'));var util=require(_0x90ea('0x7'));var path=require(_0x90ea('0x8'));var sox=require('sox');var csv=require(_0x90ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90ea('0xa'));var _=require(_0x90ea('0xb'));var squel=require(_0x90ea('0xc'));var crypto=require(_0x90ea('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x90ea('0xe'));var toCsv=require(_0x90ea('0x9'));var querystring=require(_0x90ea('0xf'));var Papa=require(_0x90ea('0x10'));var Redis=require(_0x90ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90ea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90ea('0x13'));var utils=require('../../config/utils');var config=require(_0x90ea('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x90ea('0x15'))['db'];function respondWithStatusCode(_0x55fe94,_0x225feb){_0x225feb=_0x225feb||0xcc;return function(_0x79ab2d){if(_0x79ab2d){return _0x55fe94[_0x90ea('0x16')](_0x225feb);}return _0x55fe94['status'](_0x225feb)[_0x90ea('0x17')]();};}function respondWithResult(_0x4b3b53,_0x1d716a){_0x1d716a=_0x1d716a||0xc8;return function(_0x42421c){if(_0x42421c){return _0x4b3b53[_0x90ea('0x18')](_0x1d716a)['json'](_0x42421c);}};}function respondWithFilteredResult(_0x2ce8de,_0x3a0b14){return function(_0x1610e5){if(_0x1610e5){var _0x1b9dc4=typeof _0x3a0b14[_0x90ea('0x19')]===_0x90ea('0x1a')&&typeof _0x3a0b14['limit']===_0x90ea('0x1a');var _0x24a277=_0x1610e5[_0x90ea('0x1b')];var _0x5d3c56=_0x1b9dc4?0x0:_0x3a0b14[_0x90ea('0x19')];var _0x3acf92=_0x1b9dc4?_0x1610e5[_0x90ea('0x1b')]:_0x3a0b14['offset']+_0x3a0b14['limit'];var _0x1c655c;if(_0x3acf92>=_0x24a277){_0x3acf92=_0x24a277;_0x1c655c=0xc8;}else{_0x1c655c=0xce;}_0x2ce8de['status'](_0x1c655c);return _0x2ce8de[_0x90ea('0x1c')](_0x90ea('0x1d'),_0x5d3c56+'-'+_0x3acf92+'/'+_0x24a277)[_0x90ea('0x1e')](_0x1610e5);}return null;};}function patchUpdates(_0x874145){return function(_0x2bcddc){try{jsonpatch[_0x90ea('0x1f')](_0x2bcddc,_0x874145,!![]);}catch(_0x1c61b2){return BPromise[_0x90ea('0x20')](_0x1c61b2);}return _0x2bcddc[_0x90ea('0x21')]();};}function saveUpdates(_0x1bab7f,_0x2c4032){return function(_0x10855d){if(_0x10855d){return _0x10855d[_0x90ea('0x22')](_0x1bab7f)[_0x90ea('0x23')](function(_0x1ad239){return _0x1ad239;});}return null;};}function removeEntity(_0x165856,_0x206843){return function(_0x28edc7){if(_0x28edc7){return _0x28edc7[_0x90ea('0x24')]()[_0x90ea('0x23')](function(){_0x165856[_0x90ea('0x18')](0xcc)[_0x90ea('0x17')]();});}};}function handleEntityNotFound(_0x1cf7ec,_0x5d1df7){return function(_0x4eaa3c){if(!_0x4eaa3c){_0x1cf7ec[_0x90ea('0x16')](0x194);}return _0x4eaa3c;};}function handleError(_0x1c6650,_0x16f5d2){_0x16f5d2=_0x16f5d2||0x1f4;return function(_0xa580c9){logger[_0x90ea('0x25')](_0xa580c9['stack']);if(_0xa580c9[_0x90ea('0x26')]){delete _0xa580c9[_0x90ea('0x26')];}_0x1c6650['status'](_0x16f5d2)[_0x90ea('0x27')](_0xa580c9);};}exports[_0x90ea('0x28')]=function(_0x52dd4c,_0x3762b8){var _0x5b5fbb={},_0x44dd4e={},_0x44be47={'count':0x0,'rows':[]};var _0xd4ccb6=_[_0x90ea('0x29')](db['SmsTransferReport'][_0x90ea('0x2a')],function(_0x5864e3){return{'name':_0x5864e3[_0x90ea('0x2b')],'type':_0x5864e3[_0x90ea('0x2c')][_0x90ea('0x2d')]};});_0x44dd4e[_0x90ea('0x2e')]=_[_0x90ea('0x29')](_0xd4ccb6,_0x90ea('0x26'));_0x44dd4e[_0x90ea('0x2f')]=_['keys'](_0x52dd4c['query']);_0x44dd4e[_0x90ea('0x30')]=_[_0x90ea('0x31')](_0x44dd4e[_0x90ea('0x2e')],_0x44dd4e['query']);_0x5b5fbb[_0x90ea('0x32')]=_[_0x90ea('0x31')](_0x44dd4e[_0x90ea('0x2e')],qs[_0x90ea('0x33')](_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x33')]));_0x5b5fbb['attributes']=_0x5b5fbb[_0x90ea('0x32')][_0x90ea('0x34')]?_0x5b5fbb['attributes']:_0x44dd4e['model'];if(!_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x35')](_0x90ea('0x36'))){_0x5b5fbb['limit']=qs[_0x90ea('0x37')](_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x37')]);_0x5b5fbb['offset']=qs[_0x90ea('0x19')](_0x52dd4c[_0x90ea('0x2f')]['offset']);}_0x5b5fbb[_0x90ea('0x38')]=qs[_0x90ea('0x39')](_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x39')]);_0x5b5fbb[_0x90ea('0x3a')]=qs[_0x90ea('0x30')](_[_0x90ea('0x3b')](_0x52dd4c[_0x90ea('0x2f')],_0x44dd4e[_0x90ea('0x30')]),_0xd4ccb6);if(_0x52dd4c[_0x90ea('0x2f')]['filter']){_0x5b5fbb[_0x90ea('0x3a')]=_[_0x90ea('0x3c')](_0x5b5fbb[_0x90ea('0x3a')],{'$or':_[_0x90ea('0x29')](_0xd4ccb6,function(_0x559a06){if(_0x559a06[_0x90ea('0x2c')]!==_0x90ea('0x3d')){var _0x27c4ec={};_0x27c4ec[_0x559a06[_0x90ea('0x26')]]={'$like':'%'+_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x3e')]+'%'};return _0x27c4ec;}})});}_0x5b5fbb=_[_0x90ea('0x3c')]({},_0x5b5fbb,_0x52dd4c[_0x90ea('0x3f')]);var _0xa6afdb={'where':_0x5b5fbb[_0x90ea('0x3a')]};return db['SmsTransferReport'][_0x90ea('0x1b')](_0xa6afdb)[_0x90ea('0x23')](function(_0x278226){_0x44be47[_0x90ea('0x1b')]=_0x278226;if(_0x52dd4c[_0x90ea('0x2f')][_0x90ea('0x40')]){_0x5b5fbb[_0x90ea('0x41')]=[{'all':!![]}];}return db[_0x90ea('0x42')][_0x90ea('0x43')](_0x5b5fbb);})[_0x90ea('0x23')](function(_0x216519){_0x44be47['rows']=_0x216519;return _0x44be47;})[_0x90ea('0x23')](respondWithFilteredResult(_0x3762b8,_0x5b5fbb))[_0x90ea('0x44')](handleError(_0x3762b8,null));};exports[_0x90ea('0x45')]=function(_0xc0a749,_0x307c41){var _0xf5821={'raw':!![],'where':{'id':_0xc0a749[_0x90ea('0x46')]['id']}},_0x34f4aa={};_0x34f4aa['model']=_[_0x90ea('0x47')](db[_0x90ea('0x42')][_0x90ea('0x2a')]);_0x34f4aa['query']=_[_0x90ea('0x47')](_0xc0a749[_0x90ea('0x2f')]);_0x34f4aa[_0x90ea('0x30')]=_[_0x90ea('0x31')](_0x34f4aa['model'],_0x34f4aa['query']);_0xf5821[_0x90ea('0x32')]=_[_0x90ea('0x31')](_0x34f4aa[_0x90ea('0x2e')],qs[_0x90ea('0x33')](_0xc0a749[_0x90ea('0x2f')][_0x90ea('0x33')]));_0xf5821[_0x90ea('0x32')]=_0xf5821['attributes'][_0x90ea('0x34')]?_0xf5821['attributes']:_0x34f4aa[_0x90ea('0x2e')];if(_0xc0a749[_0x90ea('0x2f')][_0x90ea('0x40')]){_0xf5821['include']=[{'all':!![]}];}_0xf5821=_['merge']({},_0xf5821,_0xc0a749[_0x90ea('0x3f')]);return db['SmsTransferReport'][_0x90ea('0x48')](_0xf5821)[_0x90ea('0x23')](handleEntityNotFound(_0x307c41,null))[_0x90ea('0x23')](respondWithResult(_0x307c41,null))[_0x90ea('0x44')](handleError(_0x307c41,null));};exports[_0x90ea('0x49')]=function(_0x4289a3,_0x1edf3f){return db[_0x90ea('0x42')]['create'](_0x4289a3[_0x90ea('0x4a')],{})[_0x90ea('0x23')](respondWithResult(_0x1edf3f,0xc9))[_0x90ea('0x44')](handleError(_0x1edf3f,null));};exports['update']=function(_0x2510b8,_0x203b40){if(_0x2510b8['body']['id']){delete _0x2510b8['body']['id'];}return db[_0x90ea('0x42')][_0x90ea('0x48')]({'where':{'id':_0x2510b8['params']['id']}})[_0x90ea('0x23')](handleEntityNotFound(_0x203b40,null))[_0x90ea('0x23')](saveUpdates(_0x2510b8['body'],null))[_0x90ea('0x23')](respondWithResult(_0x203b40,null))['catch'](handleError(_0x203b40,null));};exports[_0x90ea('0x24')]=function(_0x1c8996,_0x53bea7){return db['SmsTransferReport']['find']({'where':{'id':_0x1c8996[_0x90ea('0x46')]['id']}})[_0x90ea('0x23')](handleEntityNotFound(_0x53bea7,null))['then'](removeEntity(_0x53bea7,null))['catch'](handleError(_0x53bea7,null));};exports[_0x90ea('0x4b')]=function(_0x484c6a,_0x57312f){return db['SmsTransferReport'][_0x90ea('0x4b')]()[_0x90ea('0x23')](respondWithResult(_0x57312f,null))['catch'](handleError(_0x57312f,null));}; \ No newline at end of file +var _0x3cfa=['fields','length','model','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','SmsTransferReport','then','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','save','update','end','error','name','send','index','map','fieldName','key','query','keys','filters','intersection','attributes'];(function(_0x2cbdaf,_0x4a5412){var _0x548a3f=function(_0x1ca11d){while(--_0x1ca11d){_0x2cbdaf['push'](_0x2cbdaf['shift']());}};_0x548a3f(++_0x4a5412);}(_0x3cfa,0x14e));var _0xa3cf=function(_0x2bc263,_0x2fd0c0){_0x2bc263=_0x2bc263-0x0;var _0x5f1f88=_0x3cfa[_0x2bc263];return _0x5f1f88;};'use strict';var emlformat=require(_0xa3cf('0x0'));var rimraf=require(_0xa3cf('0x1'));var zipdir=require(_0xa3cf('0x2'));var jsonpatch=require(_0xa3cf('0x3'));var rp=require('request-promise');var moment=require(_0xa3cf('0x4'));var BPromise=require(_0xa3cf('0x5'));var Mustache=require(_0xa3cf('0x6'));var util=require(_0xa3cf('0x7'));var path=require('path');var sox=require(_0xa3cf('0x8'));var csv=require(_0xa3cf('0x9'));var ejs=require(_0xa3cf('0xa'));var fs=require('fs');var fs_extra=require(_0xa3cf('0xb'));var _=require(_0xa3cf('0xc'));var squel=require(_0xa3cf('0xd'));var crypto=require(_0xa3cf('0xe'));var jsforce=require(_0xa3cf('0xf'));var deskjs=require(_0xa3cf('0x10'));var toCsv=require(_0xa3cf('0x9'));var querystring=require(_0xa3cf('0x11'));var Papa=require(_0xa3cf('0x12'));var Redis=require(_0xa3cf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa3cf('0x14'));var as=require(_0xa3cf('0x15'));var hardwareService=require(_0xa3cf('0x16'));var logger=require(_0xa3cf('0x17'))('api');var utils=require(_0xa3cf('0x18'));var config=require(_0xa3cf('0x19'));var licenseUtil=require(_0xa3cf('0x1a'));var db=require(_0xa3cf('0x1b'))['db'];function respondWithStatusCode(_0x180889,_0x290c28){_0x290c28=_0x290c28||0xcc;return function(_0x37bc59){if(_0x37bc59){return _0x180889[_0xa3cf('0x1c')](_0x290c28);}return _0x180889[_0xa3cf('0x1d')](_0x290c28)['end']();};}function respondWithResult(_0x21bc56,_0x13ae49){_0x13ae49=_0x13ae49||0xc8;return function(_0x28cefe){if(_0x28cefe){return _0x21bc56[_0xa3cf('0x1d')](_0x13ae49)[_0xa3cf('0x1e')](_0x28cefe);}};}function respondWithFilteredResult(_0x1e8a39,_0x1d5d82){return function(_0x3bf3b3){if(_0x3bf3b3){var _0x27552f=typeof _0x1d5d82[_0xa3cf('0x1f')]==='undefined'&&typeof _0x1d5d82[_0xa3cf('0x20')]==='undefined';var _0x56fb0b=_0x3bf3b3['count'];var _0x1ce443=_0x27552f?0x0:_0x1d5d82[_0xa3cf('0x1f')];var _0x1d5b4b=_0x27552f?_0x3bf3b3[_0xa3cf('0x21')]:_0x1d5d82[_0xa3cf('0x1f')]+_0x1d5d82[_0xa3cf('0x20')];var _0x210003;if(_0x1d5b4b>=_0x56fb0b){_0x1d5b4b=_0x56fb0b;_0x210003=0xc8;}else{_0x210003=0xce;}_0x1e8a39[_0xa3cf('0x1d')](_0x210003);return _0x1e8a39['set'](_0xa3cf('0x22'),_0x1ce443+'-'+_0x1d5b4b+'/'+_0x56fb0b)['json'](_0x3bf3b3);}return null;};}function patchUpdates(_0x32ffc1){return function(_0x28a9e3){try{jsonpatch[_0xa3cf('0x23')](_0x28a9e3,_0x32ffc1,!![]);}catch(_0x943c0){return BPromise['reject'](_0x943c0);}return _0x28a9e3[_0xa3cf('0x24')]();};}function saveUpdates(_0x108b91,_0x3f45d6){return function(_0x2b62fc){if(_0x2b62fc){return _0x2b62fc[_0xa3cf('0x25')](_0x108b91)['then'](function(_0x1d74b8){return _0x1d74b8;});}return null;};}function removeEntity(_0x29e967,_0x2fe869){return function(_0x1263c9){if(_0x1263c9){return _0x1263c9['destroy']()['then'](function(){_0x29e967[_0xa3cf('0x1d')](0xcc)[_0xa3cf('0x26')]();});}};}function handleEntityNotFound(_0xb9bee5,_0x3ff61c){return function(_0x358afd){if(!_0x358afd){_0xb9bee5[_0xa3cf('0x1c')](0x194);}return _0x358afd;};}function handleError(_0x45fd71,_0x382ff2){_0x382ff2=_0x382ff2||0x1f4;return function(_0x1bcf93){logger[_0xa3cf('0x27')](_0x1bcf93['stack']);if(_0x1bcf93[_0xa3cf('0x28')]){delete _0x1bcf93[_0xa3cf('0x28')];}_0x45fd71[_0xa3cf('0x1d')](_0x382ff2)[_0xa3cf('0x29')](_0x1bcf93);};}exports[_0xa3cf('0x2a')]=function(_0x5a6876,_0x18fa9c){var _0x36416d={},_0x34fc3d={},_0x224ebc={'count':0x0,'rows':[]};var _0x287115=_[_0xa3cf('0x2b')](db['SmsTransferReport']['rawAttributes'],function(_0xac8cea){return{'name':_0xac8cea[_0xa3cf('0x2c')],'type':_0xac8cea['type'][_0xa3cf('0x2d')]};});_0x34fc3d['model']=_[_0xa3cf('0x2b')](_0x287115,_0xa3cf('0x28'));_0x34fc3d[_0xa3cf('0x2e')]=_[_0xa3cf('0x2f')](_0x5a6876[_0xa3cf('0x2e')]);_0x34fc3d[_0xa3cf('0x30')]=_[_0xa3cf('0x31')](_0x34fc3d['model'],_0x34fc3d[_0xa3cf('0x2e')]);_0x36416d[_0xa3cf('0x32')]=_[_0xa3cf('0x31')](_0x34fc3d['model'],qs[_0xa3cf('0x33')](_0x5a6876[_0xa3cf('0x2e')][_0xa3cf('0x33')]));_0x36416d[_0xa3cf('0x32')]=_0x36416d[_0xa3cf('0x32')][_0xa3cf('0x34')]?_0x36416d['attributes']:_0x34fc3d[_0xa3cf('0x35')];if(!_0x5a6876[_0xa3cf('0x2e')][_0xa3cf('0x36')](_0xa3cf('0x37'))){_0x36416d['limit']=qs[_0xa3cf('0x20')](_0x5a6876['query'][_0xa3cf('0x20')]);_0x36416d[_0xa3cf('0x1f')]=qs['offset'](_0x5a6876['query'][_0xa3cf('0x1f')]);}_0x36416d[_0xa3cf('0x38')]=qs[_0xa3cf('0x39')](_0x5a6876[_0xa3cf('0x2e')]['sort']);_0x36416d[_0xa3cf('0x3a')]=qs['filters'](_['pick'](_0x5a6876['query'],_0x34fc3d[_0xa3cf('0x30')]),_0x287115);if(_0x5a6876['query']['filter']){_0x36416d['where']=_[_0xa3cf('0x3b')](_0x36416d[_0xa3cf('0x3a')],{'$or':_[_0xa3cf('0x2b')](_0x287115,function(_0x547f80){if(_0x547f80[_0xa3cf('0x3c')]!=='VIRTUAL'){var _0x446222={};_0x446222[_0x547f80[_0xa3cf('0x28')]]={'$like':'%'+_0x5a6876['query'][_0xa3cf('0x3d')]+'%'};return _0x446222;}})});}_0x36416d=_['merge']({},_0x36416d,_0x5a6876[_0xa3cf('0x3e')]);var _0x5d4648={'where':_0x36416d[_0xa3cf('0x3a')]};return db[_0xa3cf('0x3f')][_0xa3cf('0x21')](_0x5d4648)[_0xa3cf('0x40')](function(_0x46d06b){_0x224ebc[_0xa3cf('0x21')]=_0x46d06b;if(_0x5a6876[_0xa3cf('0x2e')]['includeAll']){_0x36416d[_0xa3cf('0x41')]=[{'all':!![]}];}return db[_0xa3cf('0x3f')][_0xa3cf('0x42')](_0x36416d);})['then'](function(_0x198315){_0x224ebc[_0xa3cf('0x43')]=_0x198315;return _0x224ebc;})['then'](respondWithFilteredResult(_0x18fa9c,_0x36416d))[_0xa3cf('0x44')](handleError(_0x18fa9c,null));};exports[_0xa3cf('0x45')]=function(_0x456429,_0x4f0bd9){var _0x1026fa={'raw':!![],'where':{'id':_0x456429['params']['id']}},_0x58944c={};_0x58944c[_0xa3cf('0x35')]=_[_0xa3cf('0x2f')](db[_0xa3cf('0x3f')][_0xa3cf('0x46')]);_0x58944c['query']=_[_0xa3cf('0x2f')](_0x456429[_0xa3cf('0x2e')]);_0x58944c[_0xa3cf('0x30')]=_[_0xa3cf('0x31')](_0x58944c[_0xa3cf('0x35')],_0x58944c[_0xa3cf('0x2e')]);_0x1026fa['attributes']=_[_0xa3cf('0x31')](_0x58944c[_0xa3cf('0x35')],qs[_0xa3cf('0x33')](_0x456429['query'][_0xa3cf('0x33')]));_0x1026fa[_0xa3cf('0x32')]=_0x1026fa['attributes'][_0xa3cf('0x34')]?_0x1026fa[_0xa3cf('0x32')]:_0x58944c[_0xa3cf('0x35')];if(_0x456429[_0xa3cf('0x2e')]['includeAll']){_0x1026fa[_0xa3cf('0x41')]=[{'all':!![]}];}_0x1026fa=_[_0xa3cf('0x3b')]({},_0x1026fa,_0x456429[_0xa3cf('0x3e')]);return db[_0xa3cf('0x3f')][_0xa3cf('0x47')](_0x1026fa)[_0xa3cf('0x40')](handleEntityNotFound(_0x4f0bd9,null))[_0xa3cf('0x40')](respondWithResult(_0x4f0bd9,null))['catch'](handleError(_0x4f0bd9,null));};exports['create']=function(_0x297992,_0x10d6bc){return db[_0xa3cf('0x3f')][_0xa3cf('0x48')](_0x297992[_0xa3cf('0x49')],{})[_0xa3cf('0x40')](respondWithResult(_0x10d6bc,0xc9))[_0xa3cf('0x44')](handleError(_0x10d6bc,null));};exports['update']=function(_0x16e897,_0xe9dfa){if(_0x16e897[_0xa3cf('0x49')]['id']){delete _0x16e897[_0xa3cf('0x49')]['id'];}return db[_0xa3cf('0x3f')][_0xa3cf('0x47')]({'where':{'id':_0x16e897[_0xa3cf('0x4a')]['id']}})[_0xa3cf('0x40')](handleEntityNotFound(_0xe9dfa,null))[_0xa3cf('0x40')](saveUpdates(_0x16e897[_0xa3cf('0x49')],null))[_0xa3cf('0x40')](respondWithResult(_0xe9dfa,null))[_0xa3cf('0x44')](handleError(_0xe9dfa,null));};exports[_0xa3cf('0x4b')]=function(_0x30409e,_0x557b02){return db[_0xa3cf('0x3f')][_0xa3cf('0x47')]({'where':{'id':_0x30409e[_0xa3cf('0x4a')]['id']}})[_0xa3cf('0x40')](handleEntityNotFound(_0x557b02,null))['then'](removeEntity(_0x557b02,null))[_0xa3cf('0x44')](handleError(_0x557b02,null));};exports[_0xa3cf('0x4c')]=function(_0x80408d,_0x239c5c){return db['SmsTransferReport'][_0xa3cf('0x4c')]()[_0xa3cf('0x40')](respondWithResult(_0x239c5c,null))[_0xa3cf('0x44')](handleError(_0x239c5c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 60a0405..f71a5ae 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 _0xaad1=['lodash','../../config/logger','bluebird','rimraf','./smsTransferReport.attributes','exports','define','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaad1,0x148));var _0x1aad=function(_0x25bb2d,_0x580e5f){_0x25bb2d=_0x25bb2d-0x0;var _0x4fb7d5=_0xaad1[_0x25bb2d];return _0x4fb7d5;};'use strict';var _=require(_0x1aad('0x0'));var util=require('util');var logger=require(_0x1aad('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1aad('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1aad('0x3'));var config=require('../../config/environment');var attributes=require(_0x1aad('0x4'));module[_0x1aad('0x5')]=function(_0x29bd24,_0x4c885f){return _0x29bd24[_0x1aad('0x6')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x1aad('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9f5=['moment','bluebird','request-promise','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger'];(function(_0x385d5d,_0x58415a){var _0x4564d3=function(_0x40d8b5){while(--_0x40d8b5){_0x385d5d['push'](_0x385d5d['shift']());}};_0x4564d3(++_0x58415a);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x39758d,_0x346423){_0x39758d=_0x39758d-0x0;var _0x44ac11=_0xc9f5[_0x39758d];return _0x44ac11;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var logger=require(_0x5c9f('0x1'))('api');var moment=require(_0x5c9f('0x2'));var BPromise=require(_0x5c9f('0x3'));var rp=require(_0x5c9f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c9f('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x5c9f('0x6')]=function(_0x563d0c,_0x3100cf){return _0x563d0c[_0x5c9f('0x7')](_0x5c9f('0x8'),attributes,{'tableName':_0x5c9f('0x9'),'paranoid':![],'indexes':[{'name':_0x5c9f('0xa'),'fields':[_0x5c9f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 3981169..d2e6366 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 _0x385b=['SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x466aeb,_0x3a35bf){var _0x57818e=function(_0x28ac49){while(--_0x28ac49){_0x466aeb['push'](_0x466aeb['shift']());}};_0x57818e(++_0x3a35bf);}(_0x385b,0x1a7));var _0xb385=function(_0xfb6cef,_0x206adf){_0xfb6cef=_0xfb6cef-0x0;var _0x40eb07=_0x385b[_0xfb6cef];return _0x40eb07;};'use strict';var _=require('lodash');var util=require(_0xb385('0x0'));var moment=require('moment');var BPromise=require(_0xb385('0x1'));var rs=require(_0xb385('0x2'));var fs=require('fs');var Redis=require(_0xb385('0x3'));var db=require(_0xb385('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb385('0x5'))(_0xb385('0x6'));var config=require(_0xb385('0x7'));var jayson=require(_0xb385('0x8'));var client=jayson[_0xb385('0x9')][_0xb385('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x411034,_0x367d50,_0x5b7929){return new BPromise(function(_0x397ddc,_0xe2bfc1){return client[_0xb385('0xb')](_0x411034,_0x5b7929)[_0xb385('0xc')](function(_0x507620){logger[_0xb385('0xd')](_0xb385('0xe'),_0x367d50,'request\x20sent');logger[_0xb385('0xf')](_0xb385('0x10'),_0x367d50,_0xb385('0x11'),JSON[_0xb385('0x12')](_0x507620));if(_0x507620[_0xb385('0x13')]){if(_0x507620[_0xb385('0x13')]['code']===0x1f4){logger[_0xb385('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x367d50,_0x507620['error'][_0xb385('0x14')]);return _0xe2bfc1(_0x507620['error'][_0xb385('0x14')]);}logger[_0xb385('0x13')](_0xb385('0xe'),_0x367d50,_0x507620['error'][_0xb385('0x14')]);return _0x397ddc(_0x507620[_0xb385('0x13')][_0xb385('0x14')]);}else{logger['info'](_0xb385('0xe'),_0x367d50,_0xb385('0x11'));_0x397ddc(_0x507620[_0xb385('0x15')]['message']);}})[_0xb385('0x16')](function(_0xad040a){logger[_0xb385('0x13')](_0xb385('0xe'),_0x367d50,_0xad040a);_0xe2bfc1(_0xad040a);});});} \ No newline at end of file +var _0x4677=['http','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a560e,_0x3e1d9e){var _0x6e7c6d=function(_0x145f91){while(--_0x145f91){_0x3a560e['push'](_0x3a560e['shift']());}};_0x6e7c6d(++_0x3e1d9e);}(_0x4677,0x155));var _0x7467=function(_0x1e18ee,_0x55e6b8){_0x1e18ee=_0x1e18ee-0x0;var _0x3d3f37=_0x4677[_0x1e18ee];return _0x3d3f37;};'use strict';var _=require(_0x7467('0x0'));var util=require('util');var moment=require(_0x7467('0x1'));var BPromise=require(_0x7467('0x2'));var rs=require(_0x7467('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7467('0x4'))['db'];var utils=require(_0x7467('0x5'));var logger=require(_0x7467('0x6'))(_0x7467('0x7'));var config=require(_0x7467('0x8'));var jayson=require(_0x7467('0x9'));var client=jayson[_0x7467('0xa')][_0x7467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198e6a,_0x4b26a7,_0x588489){return new BPromise(function(_0x418ff9,_0x1cc835){return client['request'](_0x198e6a,_0x588489)[_0x7467('0xc')](function(_0x4365e6){logger['info'](_0x7467('0xd'),_0x4b26a7,'request\x20sent');logger[_0x7467('0xe')](_0x7467('0xf'),_0x4b26a7,_0x7467('0x10'),JSON['stringify'](_0x4365e6));if(_0x4365e6[_0x7467('0x11')]){if(_0x4365e6[_0x7467('0x11')][_0x7467('0x12')]===0x1f4){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x4365e6[_0x7467('0x11')]['message']);return _0x1cc835(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}logger[_0x7467('0x11')](_0x7467('0xd'),_0x4b26a7,_0x4365e6['error'][_0x7467('0x13')]);return _0x418ff9(_0x4365e6[_0x7467('0x11')][_0x7467('0x13')]);}else{logger['info'](_0x7467('0xd'),_0x4b26a7,_0x7467('0x10'));_0x418ff9(_0x4365e6[_0x7467('0x14')]['message']);}})[_0x7467('0x15')](function(_0x1df628){logger[_0x7467('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4b26a7,_0x1df628);_0x1cc835(_0x1df628);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8075e65..0131feb 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 _0xa00c=['../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','download','root','originalname','replace','basename','extname','now','post','single','file','put','update','delete','exports','multer','express','Router','../../components/auth/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa00c,0x1d7));var _0xca00=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa00c[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xca00('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca00('0x1'));var router=express[_0xca00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xca00('0x3'));var interaction=require(_0xca00('0x4'));var config=require(_0xca00('0x5'));var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xca00('0x6')]);router[_0xca00('0x7')](_0xca00('0x8'),auth[_0xca00('0x9')](),controller[_0xca00('0xa')]);router[_0xca00('0x7')]('/:id/download',auth[_0xca00('0x9')](),controller[_0xca00('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x366b2b,_0xe2bddf,_0x1bced7){_0x1bced7(null,path['join'](config[_0xca00('0xc')],'server/files/sounds/original/'));},'filename':function(_0x406a25,_0x50eed2,_0x579445){_0x50eed2[_0xca00('0xd')]=_0x50eed2[_0xca00('0xd')][_0xca00('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x579445(null,util['format']('%s-%s%s',path[_0xca00('0xf')](_0x50eed2[_0xca00('0xd')],path[_0xca00('0x10')](_0x50eed2[_0xca00('0xd')])),Date[_0xca00('0x11')](),path[_0xca00('0x10')](_0x50eed2['originalname'])));}})});router[_0xca00('0x12')]('/',upload[_0xca00('0x13')](_0xca00('0x14')),controller['create']);router[_0xca00('0x15')](_0xca00('0x8'),auth[_0xca00('0x9')](),controller[_0xca00('0x16')]);router['delete'](_0xca00('0x8'),auth[_0xca00('0x9')](),controller[_0xca00('0x17')]);module[_0xca00('0x18')]=router; \ No newline at end of file +var _0xb25c=['connect-timeout','express','Router','fs-extra','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','diskStorage','join','originalname','replace','now','extname','single','file','create','put','update','delete','exports','multer','util'];(function(_0xe63d37,_0x50b996){var _0x2d9265=function(_0x26b2be){while(--_0x26b2be){_0xe63d37['push'](_0xe63d37['shift']());}};_0x2d9265(++_0x50b996);}(_0xb25c,0x18e));var _0xcb25=function(_0x43c5f1,_0x149025){_0x43c5f1=_0x43c5f1-0x0;var _0x46d143=_0xb25c[_0x43c5f1];return _0x46d143;};'use strict';var multer=require(_0xcb25('0x0'));var util=require(_0xcb25('0x1'));var path=require('path');var timeout=require(_0xcb25('0x2'));var express=require(_0xcb25('0x3'));var router=express[_0xcb25('0x4')]();var fs_extra=require(_0xcb25('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb25('0x6'));var controller=require(_0xcb25('0x7'));router[_0xcb25('0x8')]('/',auth[_0xcb25('0x9')](),controller[_0xcb25('0xa')]);router[_0xcb25('0x8')](_0xcb25('0xb'),auth[_0xcb25('0x9')](),controller['show']);router[_0xcb25('0x8')]('/:id/download',auth[_0xcb25('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xcb25('0xc')]({'destination':function(_0x425ab3,_0x181afd,_0xd0c4eb){_0xd0c4eb(null,path[_0xcb25('0xd')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x5e9a6f,_0x534a23,_0x33d17a){_0x534a23['originalname']=_0x534a23[_0xcb25('0xe')][_0xcb25('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33d17a(null,util['format']('%s-%s%s',path['basename'](_0x534a23[_0xcb25('0xe')],path['extname'](_0x534a23[_0xcb25('0xe')])),Date[_0xcb25('0x10')](),path[_0xcb25('0x11')](_0x534a23[_0xcb25('0xe')])));}})});router['post']('/',upload[_0xcb25('0x12')](_0xcb25('0x13')),controller[_0xcb25('0x14')]);router[_0xcb25('0x15')](_0xcb25('0xb'),auth[_0xcb25('0x9')](),controller[_0xcb25('0x16')]);router[_0xcb25('0x17')](_0xcb25('0xb'),auth[_0xcb25('0x9')](),controller[_0xcb25('0x17')]);module[_0xcb25('0x18')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 0240c5c..ae4ddac 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 _0x6b74=['exports','STRING','BIGINT','FLOAT','INTEGER','sequelize'];(function(_0x6a1820,_0x30dce4){var _0x17a165=function(_0x4a8b8a){while(--_0x4a8b8a){_0x6a1820['push'](_0x6a1820['shift']());}};_0x17a165(++_0x30dce4);}(_0x6b74,0x65));var _0x46b7=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x6b74[_0xa79977];return _0x109f10;};'use strict';var Sequelize=require(_0x46b7('0x0'));module[_0x46b7('0x1')]={'name':{'type':Sequelize[_0x46b7('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x46b7('0x2')]},'display_name':{'type':Sequelize[_0x46b7('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x46b7('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x46b7('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x46b7('0x2')]},'converted_duration':{'type':Sequelize[_0x46b7('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x46b7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x46b7('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x61c8=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x24b1d9,_0x1d552d){var _0x4f92f5=function(_0x5c9258){while(--_0x5c9258){_0x24b1d9['push'](_0x24b1d9['shift']());}};_0x4f92f5(++_0x1d552d);}(_0x61c8,0x199));var _0x861c=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x61c8[_0xe09d0];return _0x44ad05;};'use strict';var Sequelize=require(_0x861c('0x0'));module[_0x861c('0x1')]={'name':{'type':Sequelize[_0x861c('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x861c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x861c('0x2')]},'original_format':{'type':Sequelize[_0x861c('0x2')]},'original_duration':{'type':Sequelize[_0x861c('0x3')]},'original_sampleCount':{'type':Sequelize[_0x861c('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x861c('0x4')]},'original_sampleRate':{'type':Sequelize[_0x861c('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x861c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x861c('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x861c('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c1c3fec..66a2653 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 _0xcd05=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','update','destroy','then','get','Sounds','UserProfileResource','end','name','index','Sound','type','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','show','params','rawAttributes','options','find','catch','download','save_name','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','converted_format','create','basename','file','originalname','filename','extname','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','error','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x4e65e5,_0x54b75c){var _0x67bc9c=function(_0x3961c6){while(--_0x3961c6){_0x4e65e5['push'](_0x4e65e5['shift']());}};_0x67bc9c(++_0x54b75c);}(_0xcd05,0x1cb));var _0x5cd0=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xcd05[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x5cd0('0x0'));var rimraf=require(_0x5cd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cd0('0x2'));var rp=require(_0x5cd0('0x3'));var moment=require('moment');var BPromise=require(_0x5cd0('0x4'));var Mustache=require(_0x5cd0('0x5'));var util=require('util');var path=require(_0x5cd0('0x6'));var sox=require(_0x5cd0('0x7'));var csv=require(_0x5cd0('0x8'));var ejs=require(_0x5cd0('0x9'));var fs=require('fs');var fs_extra=require(_0x5cd0('0xa'));var _=require(_0x5cd0('0xb'));var squel=require(_0x5cd0('0xc'));var crypto=require(_0x5cd0('0xd'));var jsforce=require(_0x5cd0('0xe'));var deskjs=require(_0x5cd0('0xf'));var toCsv=require(_0x5cd0('0x8'));var querystring=require('querystring');var Papa=require(_0x5cd0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5cd0('0x11'));var as=require(_0x5cd0('0x12'));var hardwareService=require(_0x5cd0('0x13'));var logger=require(_0x5cd0('0x14'))('api');var utils=require(_0x5cd0('0x15'));var config=require(_0x5cd0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cd0('0x17'))['db'];function respondWithStatusCode(_0x4d2681,_0x4d1d2f){_0x4d1d2f=_0x4d1d2f||0xcc;return function(_0x183659){if(_0x183659){return _0x4d2681[_0x5cd0('0x18')](_0x4d1d2f);}return _0x4d2681[_0x5cd0('0x19')](_0x4d1d2f)['end']();};}function respondWithResult(_0x5b0e96,_0x2b4485){_0x2b4485=_0x2b4485||0xc8;return function(_0x42b0b8){if(_0x42b0b8){return _0x5b0e96[_0x5cd0('0x19')](_0x2b4485)[_0x5cd0('0x1a')](_0x42b0b8);}};}function respondWithFilteredResult(_0x187baf,_0x3f920f){return function(_0x1c207d){if(_0x1c207d){var _0x502861=typeof _0x3f920f[_0x5cd0('0x1b')]===_0x5cd0('0x1c')&&typeof _0x3f920f[_0x5cd0('0x1d')]===_0x5cd0('0x1c');var _0xe352d0=_0x1c207d['count'];var _0x362bc8=_0x502861?0x0:_0x3f920f[_0x5cd0('0x1b')];var _0x212e36=_0x502861?_0x1c207d[_0x5cd0('0x1e')]:_0x3f920f[_0x5cd0('0x1b')]+_0x3f920f[_0x5cd0('0x1d')];var _0x319d36;if(_0x212e36>=_0xe352d0){_0x212e36=_0xe352d0;_0x319d36=0xc8;}else{_0x319d36=0xce;}_0x187baf[_0x5cd0('0x19')](_0x319d36);return _0x187baf[_0x5cd0('0x1f')]('Content-Range',_0x362bc8+'-'+_0x212e36+'/'+_0xe352d0)[_0x5cd0('0x1a')](_0x1c207d);}return null;};}function patchUpdates(_0xc8dd90){return function(_0xda351f){try{jsonpatch['apply'](_0xda351f,_0xc8dd90,!![]);}catch(_0x9c3a3c){return BPromise['reject'](_0x9c3a3c);}return _0xda351f['save']();};}function saveUpdates(_0x1d103b,_0x5d4bfb){return function(_0x424122){if(_0x424122){return _0x424122[_0x5cd0('0x20')](_0x1d103b)['then'](function(_0xf32766){return _0xf32766;});}return null;};}function removeEntity(_0x5bf1cb,_0x4ed0d4){return function(_0x365dbe){if(_0x365dbe){return _0x365dbe[_0x5cd0('0x21')]()[_0x5cd0('0x22')](function(){var _0x519eb3=_0x365dbe[_0x5cd0('0x23')]({'plain':!![]});var _0x10e180=_0x5cd0('0x24');return db[_0x5cd0('0x25')][_0x5cd0('0x21')]({'where':{'type':_0x10e180,'resourceId':_0x519eb3['id']}})[_0x5cd0('0x22')](function(){return _0x365dbe;});})[_0x5cd0('0x22')](function(){_0x5bf1cb['status'](0xcc)[_0x5cd0('0x26')]();});}};}function handleEntityNotFound(_0x2619f6,_0x30a83c){return function(_0x2ec2d6){if(!_0x2ec2d6){_0x2619f6[_0x5cd0('0x18')](0x194);}return _0x2ec2d6;};}function handleError(_0x58e36c,_0x171c26){_0x171c26=_0x171c26||0x1f4;return function(_0x31fa94){logger['error'](_0x31fa94['stack']);if(_0x31fa94[_0x5cd0('0x27')]){delete _0x31fa94[_0x5cd0('0x27')];}_0x58e36c['status'](_0x171c26)['send'](_0x31fa94);};}exports[_0x5cd0('0x28')]=function(_0x6bdd5f,_0x5ca9d4){var _0x25acf1={},_0x542429={},_0x58414d={'count':0x0,'rows':[]};var _0x4d6ebb=_['map'](db[_0x5cd0('0x29')]['rawAttributes'],function(_0x22b702){return{'name':_0x22b702['fieldName'],'type':_0x22b702[_0x5cd0('0x2a')]['key']};});_0x542429['model']=_[_0x5cd0('0x2b')](_0x4d6ebb,'name');_0x542429[_0x5cd0('0x2c')]=_[_0x5cd0('0x2d')](_0x6bdd5f[_0x5cd0('0x2c')]);_0x542429['filters']=_[_0x5cd0('0x2e')](_0x542429['model'],_0x542429[_0x5cd0('0x2c')]);_0x25acf1[_0x5cd0('0x2f')]=_[_0x5cd0('0x2e')](_0x542429[_0x5cd0('0x30')],qs[_0x5cd0('0x31')](_0x6bdd5f['query'][_0x5cd0('0x31')]));_0x25acf1['attributes']=_0x25acf1[_0x5cd0('0x2f')][_0x5cd0('0x32')]?_0x25acf1[_0x5cd0('0x2f')]:_0x542429['model'];if(!_0x6bdd5f[_0x5cd0('0x2c')][_0x5cd0('0x33')](_0x5cd0('0x34'))){_0x25acf1['limit']=qs[_0x5cd0('0x1d')](_0x6bdd5f[_0x5cd0('0x2c')]['limit']);_0x25acf1['offset']=qs[_0x5cd0('0x1b')](_0x6bdd5f[_0x5cd0('0x2c')][_0x5cd0('0x1b')]);}_0x25acf1[_0x5cd0('0x35')]=qs[_0x5cd0('0x36')](_0x6bdd5f[_0x5cd0('0x2c')][_0x5cd0('0x36')]);_0x25acf1[_0x5cd0('0x37')]=qs[_0x5cd0('0x38')](_[_0x5cd0('0x39')](_0x6bdd5f[_0x5cd0('0x2c')],_0x542429[_0x5cd0('0x38')]),_0x4d6ebb);if(_0x6bdd5f[_0x5cd0('0x2c')][_0x5cd0('0x3a')]){_0x25acf1['where']=_[_0x5cd0('0x3b')](_0x25acf1[_0x5cd0('0x37')],{'$or':_[_0x5cd0('0x2b')](_0x4d6ebb,function(_0x111172){if(_0x111172['type']!=='VIRTUAL'){var _0x1f0774={};_0x1f0774[_0x111172['name']]={'$like':'%'+_0x6bdd5f[_0x5cd0('0x2c')][_0x5cd0('0x3a')]+'%'};return _0x1f0774;}})});}_0x25acf1=_['merge']({},_0x25acf1,_0x6bdd5f['options']);var _0xec9d1e={'where':_0x25acf1['where']};return db[_0x5cd0('0x29')][_0x5cd0('0x1e')](_0xec9d1e)['then'](function(_0x889615){_0x58414d[_0x5cd0('0x1e')]=_0x889615;if(_0x6bdd5f['query'][_0x5cd0('0x3c')]){_0x25acf1[_0x5cd0('0x3d')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x25acf1);})[_0x5cd0('0x22')](function(_0x49bb3c){_0x58414d[_0x5cd0('0x3e')]=_0x49bb3c;return _0x58414d;})[_0x5cd0('0x22')](respondWithFilteredResult(_0x5ca9d4,_0x25acf1))['catch'](handleError(_0x5ca9d4,null));};exports[_0x5cd0('0x3f')]=function(_0x68bee7,_0x3ea629){var _0x59129c={'raw':!![],'where':{'id':_0x68bee7[_0x5cd0('0x40')]['id']}},_0x31073c={};_0x31073c[_0x5cd0('0x30')]=_[_0x5cd0('0x2d')](db[_0x5cd0('0x29')][_0x5cd0('0x41')]);_0x31073c[_0x5cd0('0x2c')]=_['keys'](_0x68bee7['query']);_0x31073c['filters']=_[_0x5cd0('0x2e')](_0x31073c['model'],_0x31073c[_0x5cd0('0x2c')]);_0x59129c['attributes']=_[_0x5cd0('0x2e')](_0x31073c['model'],qs[_0x5cd0('0x31')](_0x68bee7[_0x5cd0('0x2c')]['fields']));_0x59129c[_0x5cd0('0x2f')]=_0x59129c['attributes'][_0x5cd0('0x32')]?_0x59129c[_0x5cd0('0x2f')]:_0x31073c['model'];if(_0x68bee7[_0x5cd0('0x2c')]['includeAll']){_0x59129c[_0x5cd0('0x3d')]=[{'all':!![]}];}_0x59129c=_['merge']({},_0x59129c,_0x68bee7[_0x5cd0('0x42')]);return db[_0x5cd0('0x29')][_0x5cd0('0x43')](_0x59129c)['then'](handleEntityNotFound(_0x3ea629,null))[_0x5cd0('0x22')](respondWithResult(_0x3ea629,null))[_0x5cd0('0x44')](handleError(_0x3ea629,null));};exports[_0x5cd0('0x45')]=function(_0x35cc5d,_0x3879a1,_0x30d153){return db[_0x5cd0('0x29')][_0x5cd0('0x43')]({'where':{'id':_0x35cc5d['params']['id']},'attributes':[_0x5cd0('0x27'),_0x5cd0('0x46'),'converted_format'],'raw':!![]})[_0x5cd0('0x22')](handleEntityNotFound(_0x3879a1,null))[_0x5cd0('0x22')](function(_0x5a4e21){if(_0x5a4e21){if(!fs['existsSync'](path[_0x5cd0('0x47')](config[_0x5cd0('0x48')],_0x5cd0('0x49'),_0x5a4e21['save_name']+'.'+_0x5a4e21['converted_format']))){throw new db['Sequelize'][(_0x5cd0('0x4a'))](_0x5cd0('0x4b'));}return _0x3879a1['download'](path[_0x5cd0('0x47')](config['root'],_0x5cd0('0x49'),util[_0x5cd0('0x4c')](_0x5cd0('0x4d'),_0x5a4e21['save_name'],_0x5a4e21['converted_format'])),util[_0x5cd0('0x4c')](_0x5cd0('0x4d'),_0x5a4e21[_0x5cd0('0x27')],_0x5a4e21[_0x5cd0('0x4e')]));}return null;})[_0x5cd0('0x44')](handleError(_0x3879a1,null));};exports[_0x5cd0('0x4f')]=function(_0x4db521,_0x1e42c1,_0x2b9c60){var _0x5d742b={'name':path[_0x5cd0('0x50')](_0x4db521[_0x5cd0('0x51')][_0x5cd0('0x52')],path['extname'](_0x4db521['file'][_0x5cd0('0x52')])),'save_name':path[_0x5cd0('0x50')](_0x4db521['file'][_0x5cd0('0x53')],path[_0x5cd0('0x54')](_0x4db521[_0x5cd0('0x51')][_0x5cd0('0x53')])),'original_format':path[_0x5cd0('0x54')](_0x4db521[_0x5cd0('0x51')][_0x5cd0('0x52')])['substring'](0x1),'converted_format':'wav'};var _0x41fd11=path['join'](config[_0x5cd0('0x48')],_0x5cd0('0x55'),_0x4db521[_0x5cd0('0x51')][_0x5cd0('0x53')]);var _0x5522e5=path['join'](config['root'],_0x5cd0('0x49'),util[_0x5cd0('0x4c')](_0x5cd0('0x4d'),path[_0x5cd0('0x50')](_0x4db521['file'][_0x5cd0('0x53')],path[_0x5cd0('0x54')](_0x4db521[_0x5cd0('0x51')]['filename'])),_0x5d742b[_0x5cd0('0x4e')]));logger[_0x5cd0('0x56')](_0x5cd0('0x57'),_0x41fd11);logger[_0x5cd0('0x56')](_0x5cd0('0x58'),_0x5522e5);try{fs[_0x5cd0('0x59')](_0x41fd11,parseInt(_0x5cd0('0x5a'),0x8));var _0x6edbf2=sox['transcode'](_0x41fd11,_0x5522e5,{'sampleRate':0x1f40,'format':_0x5cd0('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6edbf2['on'](_0x5cd0('0x5c'),function(_0x453211){fs[_0x5cd0('0x5d')](_0x41fd11);_0x1e42c1['status'](0x1f4)[_0x5cd0('0x5e')](_0x453211);});_0x6edbf2['on'](_0x5cd0('0x5f'),function(_0x2e0280){_0x5d742b[_0x5cd0('0x60')]=isNaN(_0x2e0280[_0x5cd0('0x61')])?null:_0x2e0280[_0x5cd0('0x61')]*0x3e8;_0x5d742b['original_sampleCount']=isNaN(_0x2e0280[_0x5cd0('0x62')])?null:_0x2e0280[_0x5cd0('0x62')];_0x5d742b[_0x5cd0('0x63')]=isNaN(_0x2e0280[_0x5cd0('0x64')])?null:_0x2e0280[_0x5cd0('0x64')];_0x5d742b['original_bitRate']=isNaN(_0x2e0280[_0x5cd0('0x65')])?null:_0x2e0280[_0x5cd0('0x65')];_0x5d742b[_0x5cd0('0x66')]=isNaN(_0x2e0280[_0x5cd0('0x67')])?null:_0x2e0280[_0x5cd0('0x67')];});_0x6edbf2['on'](_0x5cd0('0x68'),function(_0x20fdbb){_0x5d742b['converted_duration']=isNaN(_0x20fdbb[_0x5cd0('0x61')])?null:_0x20fdbb[_0x5cd0('0x61')]*0x3e8;_0x5d742b[_0x5cd0('0x69')]=isNaN(_0x20fdbb[_0x5cd0('0x62')])?null:_0x20fdbb[_0x5cd0('0x62')];_0x5d742b[_0x5cd0('0x6a')]=isNaN(_0x20fdbb[_0x5cd0('0x64')])?null:_0x20fdbb[_0x5cd0('0x64')];_0x5d742b[_0x5cd0('0x6b')]=isNaN(_0x20fdbb['bitRate'])?null:_0x20fdbb[_0x5cd0('0x65')];_0x5d742b['converted_sampleRate']=isNaN(_0x20fdbb[_0x5cd0('0x67')])?null:_0x20fdbb[_0x5cd0('0x67')];});_0x6edbf2['on'](_0x5cd0('0x26'),function(){fs[_0x5cd0('0x59')](_0x5522e5,parseInt(_0x5cd0('0x5a'),0x8));return db[_0x5cd0('0x29')][_0x5cd0('0x4f')](_0x5d742b)['then'](function(_0x491829){var _0x556f41={'role':_0x4db521[_0x5cd0('0x6c')]['role'],'userProfileId':_0x4db521[_0x5cd0('0x6c')]['userProfileId']};if(!_0x556f41)throw new Error(_0x5cd0('0x6d'));if(_0x556f41[_0x5cd0('0x6e')]===_0x5cd0('0x6f')){var _0x3c074d=_0x491829[_0x5cd0('0x23')]({'plain':!![]});return db[_0x5cd0('0x70')][_0x5cd0('0x43')]({'where':{'name':'Sounds','userProfileId':_0x556f41[_0x5cd0('0x71')]},'raw':!![]})['then'](function(_0x106026){if(_0x106026&&_0x106026['autoAssociation']===0x0){return db[_0x5cd0('0x25')]['create']({'name':_0x3c074d[_0x5cd0('0x27')],'resourceId':_0x3c074d['id'],'type':_0x106026['name'],'sectionId':_0x106026['id']},{})[_0x5cd0('0x22')](function(){return _0x491829;});}else{return _0x491829;}})[_0x5cd0('0x44')](function(_0x13256c){logger[_0x5cd0('0x5c')](_0x5cd0('0x72'),_0x13256c);throw _0x13256c;});}return _0x491829;})[_0x5cd0('0x22')](respondWithResult(_0x1e42c1,null))[_0x5cd0('0x44')](handleError(_0x1e42c1,null));});_0x6edbf2['start']();}catch(_0x47ec5a){_0x1e42c1[_0x5cd0('0x19')](0x1f4)[_0x5cd0('0x5e')](_0x47ec5a);}};exports[_0x5cd0('0x20')]=function(_0x251467,_0x5e3ade,_0x547303){return db[_0x5cd0('0x29')][_0x5cd0('0x43')]({'where':{'id':_0x251467[_0x5cd0('0x40')]['id']}})[_0x5cd0('0x22')](handleEntityNotFound(_0x5e3ade,null))[_0x5cd0('0x22')](saveUpdates(_[_0x5cd0('0x39')](_0x251467[_0x5cd0('0x6c')],[_0x5cd0('0x27'),'description']),null))[_0x5cd0('0x22')](respondWithResult(_0x5e3ade,null))[_0x5cd0('0x44')](handleError(_0x5e3ade,null));};exports[_0x5cd0('0x73')]=function(_0x41336c,_0x44c5a2,_0x4e615e){return db[_0x5cd0('0x29')][_0x5cd0('0x43')]({'where':{'id':_0x41336c[_0x5cd0('0x40')]['id']}})['then'](function(_0x2f08a6){if(_0x2f08a6){return _0x2f08a6[_0x5cd0('0x21')]();}})[_0x5cd0('0x22')](function(_0x2ac9e7){var _0x116a64=path[_0x5cd0('0x47')](config['root'],'server/files/sounds/original',util[_0x5cd0('0x4c')]('%s.%s',_0x2ac9e7[_0x5cd0('0x46')],_0x2ac9e7[_0x5cd0('0x74')]));var _0x544573=path[_0x5cd0('0x47')](config[_0x5cd0('0x48')],_0x5cd0('0x49'),util['format']('%s.%s',_0x2ac9e7['save_name'],_0x2ac9e7[_0x5cd0('0x4e')]));fs[_0x5cd0('0x5d')](_0x116a64);fs[_0x5cd0('0x5d')](_0x544573);return _0x2ac9e7;})['then'](function(_0x2fcdf6){if(_0x2fcdf6){return _0x44c5a2[_0x5cd0('0x19')](0xcc)[_0x5cd0('0x26')]();}})[_0x5cd0('0x22')](handleEntityNotFound(_0x44c5a2,null))[_0x5cd0('0x44')](handleError(_0x44c5a2,null));}; \ No newline at end of file +var _0xeff5=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','Sounds','destroy','name','index','map','Sound','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','length','catch','download','find','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','root','%s.%s','format','create','originalname','file','basename','extname','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','error','unlinkSync','send','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xe66f5a,_0x20056b){var _0x9f6f71=function(_0x85f64b){while(--_0x85f64b){_0xe66f5a['push'](_0xe66f5a['shift']());}};_0x9f6f71(++_0x20056b);}(_0xeff5,0x79));var _0x5eff=function(_0xe51ca0,_0x59fb1f){_0xe51ca0=_0xe51ca0-0x0;var _0xae8cf0=_0xeff5[_0xe51ca0];return _0xae8cf0;};'use strict';var emlformat=require(_0x5eff('0x0'));var rimraf=require(_0x5eff('0x1'));var zipdir=require(_0x5eff('0x2'));var jsonpatch=require(_0x5eff('0x3'));var rp=require(_0x5eff('0x4'));var moment=require(_0x5eff('0x5'));var BPromise=require(_0x5eff('0x6'));var Mustache=require(_0x5eff('0x7'));var util=require(_0x5eff('0x8'));var path=require(_0x5eff('0x9'));var sox=require(_0x5eff('0xa'));var csv=require(_0x5eff('0xb'));var ejs=require(_0x5eff('0xc'));var fs=require('fs');var fs_extra=require(_0x5eff('0xd'));var _=require('lodash');var squel=require(_0x5eff('0xe'));var crypto=require(_0x5eff('0xf'));var jsforce=require(_0x5eff('0x10'));var deskjs=require(_0x5eff('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5eff('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5eff('0x13'));var qs=require(_0x5eff('0x14'));var as=require(_0x5eff('0x15'));var hardwareService=require(_0x5eff('0x16'));var logger=require(_0x5eff('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5eff('0x18'));var licenseUtil=require(_0x5eff('0x19'));var db=require(_0x5eff('0x1a'))['db'];function respondWithStatusCode(_0x59bcfc,_0x23870e){_0x23870e=_0x23870e||0xcc;return function(_0x22760d){if(_0x22760d){return _0x59bcfc[_0x5eff('0x1b')](_0x23870e);}return _0x59bcfc[_0x5eff('0x1c')](_0x23870e)[_0x5eff('0x1d')]();};}function respondWithResult(_0x2a7686,_0x5b5288){_0x5b5288=_0x5b5288||0xc8;return function(_0x82d121){if(_0x82d121){return _0x2a7686[_0x5eff('0x1c')](_0x5b5288)['json'](_0x82d121);}};}function respondWithFilteredResult(_0x2f7f32,_0x4c200c){return function(_0x2ecaad){if(_0x2ecaad){var _0x358281=typeof _0x4c200c[_0x5eff('0x1e')]===_0x5eff('0x1f')&&typeof _0x4c200c['limit']==='undefined';var _0x1fd3b8=_0x2ecaad[_0x5eff('0x20')];var _0x94957c=_0x358281?0x0:_0x4c200c[_0x5eff('0x1e')];var _0x3f5d60=_0x358281?_0x2ecaad[_0x5eff('0x20')]:_0x4c200c[_0x5eff('0x1e')]+_0x4c200c[_0x5eff('0x21')];var _0x3780b7;if(_0x3f5d60>=_0x1fd3b8){_0x3f5d60=_0x1fd3b8;_0x3780b7=0xc8;}else{_0x3780b7=0xce;}_0x2f7f32[_0x5eff('0x1c')](_0x3780b7);return _0x2f7f32[_0x5eff('0x22')]('Content-Range',_0x94957c+'-'+_0x3f5d60+'/'+_0x1fd3b8)[_0x5eff('0x23')](_0x2ecaad);}return null;};}function patchUpdates(_0x221964){return function(_0x19c674){try{jsonpatch[_0x5eff('0x24')](_0x19c674,_0x221964,!![]);}catch(_0x322fb2){return BPromise[_0x5eff('0x25')](_0x322fb2);}return _0x19c674[_0x5eff('0x26')]();};}function saveUpdates(_0x3479f6,_0x44ac2d){return function(_0x205c7a){if(_0x205c7a){return _0x205c7a[_0x5eff('0x27')](_0x3479f6)[_0x5eff('0x28')](function(_0x198de0){return _0x198de0;});}return null;};}function removeEntity(_0x14d652,_0x2d4c66){return function(_0x14722a){if(_0x14722a){return _0x14722a['destroy']()[_0x5eff('0x28')](function(){var _0x27721e=_0x14722a['get']({'plain':!![]});var _0x325a21=_0x5eff('0x29');return db['UserProfileResource'][_0x5eff('0x2a')]({'where':{'type':_0x325a21,'resourceId':_0x27721e['id']}})[_0x5eff('0x28')](function(){return _0x14722a;});})[_0x5eff('0x28')](function(){_0x14d652[_0x5eff('0x1c')](0xcc)[_0x5eff('0x1d')]();});}};}function handleEntityNotFound(_0x16a92c,_0x32c2fe){return function(_0x705a2b){if(!_0x705a2b){_0x16a92c[_0x5eff('0x1b')](0x194);}return _0x705a2b;};}function handleError(_0x4605fd,_0x1faf49){_0x1faf49=_0x1faf49||0x1f4;return function(_0x4f419e){logger['error'](_0x4f419e['stack']);if(_0x4f419e[_0x5eff('0x2b')]){delete _0x4f419e[_0x5eff('0x2b')];}_0x4605fd[_0x5eff('0x1c')](_0x1faf49)['send'](_0x4f419e);};}exports[_0x5eff('0x2c')]=function(_0x316d0c,_0x4647e8){var _0xca1fd3={},_0x5824a1={},_0x14038d={'count':0x0,'rows':[]};var _0x2067d5=_[_0x5eff('0x2d')](db[_0x5eff('0x2e')]['rawAttributes'],function(_0x1a8e30){return{'name':_0x1a8e30[_0x5eff('0x2f')],'type':_0x1a8e30[_0x5eff('0x30')][_0x5eff('0x31')]};});_0x5824a1[_0x5eff('0x32')]=_[_0x5eff('0x2d')](_0x2067d5,_0x5eff('0x2b'));_0x5824a1[_0x5eff('0x33')]=_[_0x5eff('0x34')](_0x316d0c[_0x5eff('0x33')]);_0x5824a1[_0x5eff('0x35')]=_['intersection'](_0x5824a1[_0x5eff('0x32')],_0x5824a1[_0x5eff('0x33')]);_0xca1fd3[_0x5eff('0x36')]=_['intersection'](_0x5824a1[_0x5eff('0x32')],qs[_0x5eff('0x37')](_0x316d0c[_0x5eff('0x33')][_0x5eff('0x37')]));_0xca1fd3['attributes']=_0xca1fd3[_0x5eff('0x36')]['length']?_0xca1fd3['attributes']:_0x5824a1[_0x5eff('0x32')];if(!_0x316d0c[_0x5eff('0x33')][_0x5eff('0x38')]('nolimit')){_0xca1fd3[_0x5eff('0x21')]=qs['limit'](_0x316d0c[_0x5eff('0x33')][_0x5eff('0x21')]);_0xca1fd3[_0x5eff('0x1e')]=qs[_0x5eff('0x1e')](_0x316d0c['query'][_0x5eff('0x1e')]);}_0xca1fd3['order']=qs['sort'](_0x316d0c['query'][_0x5eff('0x39')]);_0xca1fd3[_0x5eff('0x3a')]=qs[_0x5eff('0x35')](_[_0x5eff('0x3b')](_0x316d0c['query'],_0x5824a1[_0x5eff('0x35')]),_0x2067d5);if(_0x316d0c['query'][_0x5eff('0x3c')]){_0xca1fd3[_0x5eff('0x3a')]=_[_0x5eff('0x3d')](_0xca1fd3[_0x5eff('0x3a')],{'$or':_['map'](_0x2067d5,function(_0x574943){if(_0x574943[_0x5eff('0x30')]!==_0x5eff('0x3e')){var _0x32d173={};_0x32d173[_0x574943[_0x5eff('0x2b')]]={'$like':'%'+_0x316d0c[_0x5eff('0x33')]['filter']+'%'};return _0x32d173;}})});}_0xca1fd3=_['merge']({},_0xca1fd3,_0x316d0c[_0x5eff('0x3f')]);var _0x4ebcdc={'where':_0xca1fd3[_0x5eff('0x3a')]};return db[_0x5eff('0x2e')][_0x5eff('0x20')](_0x4ebcdc)[_0x5eff('0x28')](function(_0x59ddb0){_0x14038d[_0x5eff('0x20')]=_0x59ddb0;if(_0x316d0c[_0x5eff('0x33')][_0x5eff('0x40')]){_0xca1fd3[_0x5eff('0x41')]=[{'all':!![]}];}return db[_0x5eff('0x2e')][_0x5eff('0x42')](_0xca1fd3);})[_0x5eff('0x28')](function(_0x213564){_0x14038d[_0x5eff('0x43')]=_0x213564;return _0x14038d;})[_0x5eff('0x28')](respondWithFilteredResult(_0x4647e8,_0xca1fd3))['catch'](handleError(_0x4647e8,null));};exports[_0x5eff('0x44')]=function(_0x59a46f,_0x5d8259){var _0x2e97b3={'raw':!![],'where':{'id':_0x59a46f[_0x5eff('0x45')]['id']}},_0x57468b={};_0x57468b[_0x5eff('0x32')]=_[_0x5eff('0x34')](db[_0x5eff('0x2e')][_0x5eff('0x46')]);_0x57468b[_0x5eff('0x33')]=_['keys'](_0x59a46f[_0x5eff('0x33')]);_0x57468b[_0x5eff('0x35')]=_[_0x5eff('0x47')](_0x57468b[_0x5eff('0x32')],_0x57468b['query']);_0x2e97b3[_0x5eff('0x36')]=_[_0x5eff('0x47')](_0x57468b[_0x5eff('0x32')],qs[_0x5eff('0x37')](_0x59a46f['query']['fields']));_0x2e97b3[_0x5eff('0x36')]=_0x2e97b3['attributes'][_0x5eff('0x48')]?_0x2e97b3[_0x5eff('0x36')]:_0x57468b[_0x5eff('0x32')];if(_0x59a46f[_0x5eff('0x33')]['includeAll']){_0x2e97b3[_0x5eff('0x41')]=[{'all':!![]}];}_0x2e97b3=_[_0x5eff('0x3d')]({},_0x2e97b3,_0x59a46f[_0x5eff('0x3f')]);return db[_0x5eff('0x2e')]['find'](_0x2e97b3)[_0x5eff('0x28')](handleEntityNotFound(_0x5d8259,null))[_0x5eff('0x28')](respondWithResult(_0x5d8259,null))[_0x5eff('0x49')](handleError(_0x5d8259,null));};exports[_0x5eff('0x4a')]=function(_0x1ffd68,_0xd616a9,_0x5a02f2){return db[_0x5eff('0x2e')][_0x5eff('0x4b')]({'where':{'id':_0x1ffd68[_0x5eff('0x45')]['id']},'attributes':[_0x5eff('0x2b'),_0x5eff('0x4c'),_0x5eff('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xd616a9,null))[_0x5eff('0x28')](function(_0x37d4e0){if(_0x37d4e0){if(!fs[_0x5eff('0x4e')](path[_0x5eff('0x4f')](config['root'],_0x5eff('0x50'),_0x37d4e0[_0x5eff('0x4c')]+'.'+_0x37d4e0[_0x5eff('0x4d')]))){throw new db[(_0x5eff('0x51'))]['ValidationError'](_0x5eff('0x52'));}return _0xd616a9[_0x5eff('0x4a')](path[_0x5eff('0x4f')](config[_0x5eff('0x53')],_0x5eff('0x50'),util['format'](_0x5eff('0x54'),_0x37d4e0[_0x5eff('0x4c')],_0x37d4e0[_0x5eff('0x4d')])),util[_0x5eff('0x55')](_0x5eff('0x54'),_0x37d4e0[_0x5eff('0x2b')],_0x37d4e0[_0x5eff('0x4d')]));}return null;})[_0x5eff('0x49')](handleError(_0xd616a9,null));};exports[_0x5eff('0x56')]=function(_0x3ba796,_0x9b4afc,_0x52d3b7){var _0x42b53d={'name':path['basename'](_0x3ba796['file'][_0x5eff('0x57')],path['extname'](_0x3ba796[_0x5eff('0x58')][_0x5eff('0x57')])),'save_name':path[_0x5eff('0x59')](_0x3ba796['file']['filename'],path[_0x5eff('0x5a')](_0x3ba796[_0x5eff('0x58')]['filename'])),'original_format':path[_0x5eff('0x5a')](_0x3ba796[_0x5eff('0x58')][_0x5eff('0x57')])['substring'](0x1),'converted_format':_0x5eff('0x5b')};var _0x4ca90c=path[_0x5eff('0x4f')](config[_0x5eff('0x53')],_0x5eff('0x5c'),_0x3ba796[_0x5eff('0x58')][_0x5eff('0x5d')]);var _0x398c47=path[_0x5eff('0x4f')](config[_0x5eff('0x53')],_0x5eff('0x50'),util['format'](_0x5eff('0x54'),path['basename'](_0x3ba796[_0x5eff('0x58')][_0x5eff('0x5d')],path[_0x5eff('0x5a')](_0x3ba796[_0x5eff('0x58')]['filename'])),_0x42b53d['converted_format']));logger[_0x5eff('0x5e')](_0x5eff('0x5f'),_0x4ca90c);logger[_0x5eff('0x5e')]('Sound\x20upload\x20destination:\x20%s',_0x398c47);try{fs['chmodSync'](_0x4ca90c,parseInt(_0x5eff('0x60'),0x8));var _0x97877c=sox[_0x5eff('0x61')](_0x4ca90c,_0x398c47,{'sampleRate':0x1f40,'format':_0x5eff('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x97877c['on'](_0x5eff('0x62'),function(_0x56a21d){fs[_0x5eff('0x63')](_0x4ca90c);_0x9b4afc[_0x5eff('0x1c')](0x1f4)[_0x5eff('0x64')](_0x56a21d);});_0x97877c['on']('src',function(_0x50b125){_0x42b53d['original_duration']=isNaN(_0x50b125[_0x5eff('0x65')])?null:_0x50b125['duration']*0x3e8;_0x42b53d[_0x5eff('0x66')]=isNaN(_0x50b125[_0x5eff('0x67')])?null:_0x50b125[_0x5eff('0x67')];_0x42b53d['original_channelCount']=isNaN(_0x50b125[_0x5eff('0x68')])?null:_0x50b125[_0x5eff('0x68')];_0x42b53d[_0x5eff('0x69')]=isNaN(_0x50b125[_0x5eff('0x6a')])?null:_0x50b125['bitRate'];_0x42b53d[_0x5eff('0x6b')]=isNaN(_0x50b125[_0x5eff('0x6c')])?null:_0x50b125[_0x5eff('0x6c')];});_0x97877c['on'](_0x5eff('0x6d'),function(_0x36dae4){_0x42b53d[_0x5eff('0x6e')]=isNaN(_0x36dae4['duration'])?null:_0x36dae4[_0x5eff('0x65')]*0x3e8;_0x42b53d[_0x5eff('0x6f')]=isNaN(_0x36dae4[_0x5eff('0x67')])?null:_0x36dae4[_0x5eff('0x67')];_0x42b53d['converted_channelCount']=isNaN(_0x36dae4[_0x5eff('0x68')])?null:_0x36dae4[_0x5eff('0x68')];_0x42b53d[_0x5eff('0x70')]=isNaN(_0x36dae4[_0x5eff('0x6a')])?null:_0x36dae4[_0x5eff('0x6a')];_0x42b53d[_0x5eff('0x71')]=isNaN(_0x36dae4['sampleRate'])?null:_0x36dae4['sampleRate'];});_0x97877c['on'](_0x5eff('0x1d'),function(){fs[_0x5eff('0x72')](_0x398c47,parseInt(_0x5eff('0x60'),0x8));return db[_0x5eff('0x2e')][_0x5eff('0x56')](_0x42b53d)[_0x5eff('0x28')](function(_0x485a13){var _0x54db23={'role':_0x3ba796['body']['role'],'userProfileId':_0x3ba796[_0x5eff('0x73')][_0x5eff('0x74')]};if(!_0x54db23)throw new Error(_0x5eff('0x75'));if(_0x54db23[_0x5eff('0x76')]===_0x5eff('0x77')){var _0x4e4926=_0x485a13[_0x5eff('0x78')]({'plain':!![]});return db['UserProfileSection'][_0x5eff('0x4b')]({'where':{'name':_0x5eff('0x29'),'userProfileId':_0x54db23['userProfileId']},'raw':!![]})[_0x5eff('0x28')](function(_0x15c861){if(_0x15c861&&_0x15c861[_0x5eff('0x79')]===0x0){return db['UserProfileResource']['create']({'name':_0x4e4926[_0x5eff('0x2b')],'resourceId':_0x4e4926['id'],'type':_0x15c861[_0x5eff('0x2b')],'sectionId':_0x15c861['id']},{})[_0x5eff('0x28')](function(){return _0x485a13;});}else{return _0x485a13;}})[_0x5eff('0x49')](function(_0x591fc8){logger['error'](_0x5eff('0x7a'),_0x591fc8);throw _0x591fc8;});}return _0x485a13;})[_0x5eff('0x28')](respondWithResult(_0x9b4afc,null))['catch'](handleError(_0x9b4afc,null));});_0x97877c[_0x5eff('0x7b')]();}catch(_0x3ad68e){_0x9b4afc[_0x5eff('0x1c')](0x1f4)[_0x5eff('0x64')](_0x3ad68e);}};exports[_0x5eff('0x27')]=function(_0x2ce0a7,_0x2946a7,_0x5ee443){return db[_0x5eff('0x2e')][_0x5eff('0x4b')]({'where':{'id':_0x2ce0a7[_0x5eff('0x45')]['id']}})['then'](handleEntityNotFound(_0x2946a7,null))[_0x5eff('0x28')](saveUpdates(_[_0x5eff('0x3b')](_0x2ce0a7[_0x5eff('0x73')],[_0x5eff('0x2b'),_0x5eff('0x7c')]),null))[_0x5eff('0x28')](respondWithResult(_0x2946a7,null))['catch'](handleError(_0x2946a7,null));};exports[_0x5eff('0x7d')]=function(_0x307997,_0x4af7e1,_0x4865f3){return db[_0x5eff('0x2e')][_0x5eff('0x4b')]({'where':{'id':_0x307997[_0x5eff('0x45')]['id']}})[_0x5eff('0x28')](function(_0x30e395){if(_0x30e395){return _0x30e395[_0x5eff('0x2a')]();}})[_0x5eff('0x28')](function(_0x10a3ab){var _0x4fc1a2=path[_0x5eff('0x4f')](config['root'],'server/files/sounds/original',util[_0x5eff('0x55')](_0x5eff('0x54'),_0x10a3ab[_0x5eff('0x4c')],_0x10a3ab[_0x5eff('0x7e')]));var _0x478d2e=path[_0x5eff('0x4f')](config[_0x5eff('0x53')],'server/files/sounds/converted',util[_0x5eff('0x55')](_0x5eff('0x54'),_0x10a3ab[_0x5eff('0x4c')],_0x10a3ab[_0x5eff('0x4d')]));fs[_0x5eff('0x63')](_0x4fc1a2);fs[_0x5eff('0x63')](_0x478d2e);return _0x10a3ab;})[_0x5eff('0x28')](function(_0x1e1bd6){if(_0x1e1bd6){return _0x4af7e1[_0x5eff('0x1c')](0xcc)[_0x5eff('0x1d')]();}})[_0x5eff('0x28')](handleEntityNotFound(_0x4af7e1,null))[_0x5eff('0x49')](handleError(_0x4af7e1,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 7bf5e8f..6541e23 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 _0xc9a7=['moment','request-promise','path','rimraf','./sound.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x4a65ca,_0x1a3208){var _0xa01c97=function(_0x4a9e3b){while(--_0x4a9e3b){_0x4a65ca['push'](_0x4a65ca['shift']());}};_0xa01c97(++_0x1a3208);}(_0xc9a7,0x147));var _0x7c9a=function(_0x5d36b1,_0x243fac){_0x5d36b1=_0x5d36b1-0x0;var _0x43fbe3=_0xc9a7[_0x5d36b1];return _0x43fbe3;};'use strict';var _=require(_0x7c9a('0x0'));var util=require(_0x7c9a('0x1'));var logger=require(_0x7c9a('0x2'))('api');var moment=require(_0x7c9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c9a('0x4'));var fs=require('fs');var path=require(_0x7c9a('0x5'));var rimraf=require(_0x7c9a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7c9a('0x7'));module[_0x7c9a('0x8')]=function(_0x1ae0ec,_0x27790f){return _0x1ae0ec[_0x7c9a('0x9')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x670d=['tools_sounds','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x670d,0x12d));var _0xd670=function(_0x50d253,_0x35de56){_0x50d253=_0x50d253-0x0;var _0x5bb298=_0x670d[_0x50d253];return _0x5bb298;};'use strict';var _=require('lodash');var util=require(_0xd670('0x0'));var logger=require(_0xd670('0x1'))(_0xd670('0x2'));var moment=require(_0xd670('0x3'));var BPromise=require(_0xd670('0x4'));var rp=require(_0xd670('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd670('0x6'));var config=require(_0xd670('0x7'));var attributes=require('./sound.attributes');module[_0xd670('0x8')]=function(_0x271ba3,_0x4b7016){return _0x271ba3['define']('Sound',attributes,{'tableName':_0xd670('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 14b517c..75ca3a0 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 _0x92e0=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','map','include','model','attributes','ShowSound','util','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x92e0,0x166));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x092e('0x0'));var moment=require('moment');var BPromise=require(_0x092e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x092e('0x2'));var db=require(_0x092e('0x3'))['db'];var utils=require(_0x092e('0x4'));var logger=require('../../config/logger')(_0x092e('0x5'));var config=require('../../config/environment');var jayson=require(_0x092e('0x6'));var client=jayson[_0x092e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545bc6,_0xa52f9c,_0x41277a){return new BPromise(function(_0x131812,_0x291528){return client[_0x092e('0x8')](_0x545bc6,_0x41277a)[_0x092e('0x9')](function(_0xbcabe2){logger[_0x092e('0xa')](_0x092e('0xb'),_0xa52f9c,_0x092e('0xc'));logger[_0x092e('0xd')](_0x092e('0xe'),_0xa52f9c,'request\x20sent',JSON[_0x092e('0xf')](_0xbcabe2));if(_0xbcabe2[_0x092e('0x10')]){if(_0xbcabe2['error'][_0x092e('0x11')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0xa52f9c,_0xbcabe2[_0x092e('0x10')][_0x092e('0x12')]);return _0x291528(_0xbcabe2[_0x092e('0x10')][_0x092e('0x12')]);}logger[_0x092e('0x10')](_0x092e('0xb'),_0xa52f9c,_0xbcabe2[_0x092e('0x10')]['message']);return _0x131812(_0xbcabe2[_0x092e('0x10')][_0x092e('0x12')]);}else{logger[_0x092e('0xa')](_0x092e('0xb'),_0xa52f9c,_0x092e('0xc'));_0x131812(_0xbcabe2[_0x092e('0x13')]['message']);}})[_0x092e('0x14')](function(_0x1e4589){logger[_0x092e('0x10')](_0x092e('0xb'),_0xa52f9c,_0x1e4589);_0x291528(_0x1e4589);});});}exports['ShowSound']=function(_0x367db0){var _0x2cb49d=this;return new Promise(function(_0xfef2de,_0x2bc301){return db['Sound'][_0x092e('0x15')]({'raw':_0x367db0['options']?_0x367db0[_0x092e('0x16')][_0x092e('0x17')]===undefined?!![]:![]:!![],'where':_0x367db0['options']?_0x367db0['options'][_0x092e('0x18')]||null:null,'attributes':_0x367db0[_0x092e('0x16')]?_0x367db0[_0x092e('0x16')]['attributes']||null:null,'include':_0x367db0[_0x092e('0x16')]?_0x367db0[_0x092e('0x16')]['include']?_[_0x092e('0x19')](_0x367db0[_0x092e('0x16')][_0x092e('0x1a')],function(_0x32b136){return{'model':db[_0x32b136[_0x092e('0x1b')]],'as':_0x32b136['as'],'attributes':_0x32b136[_0x092e('0x1c')],'include':_0x32b136[_0x092e('0x1a')]?_['map'](_0x32b136['include'],function(_0x152f5d){return{'model':db[_0x152f5d['model']],'as':_0x152f5d['as'],'attributes':_0x152f5d[_0x092e('0x1c')],'include':_0x152f5d[_0x092e('0x1a')]?_[_0x092e('0x19')](_0x152f5d[_0x092e('0x1a')],function(_0x5bfe07){return{'model':db[_0x5bfe07[_0x092e('0x1b')]],'as':_0x5bfe07['as'],'attributes':_0x5bfe07[_0x092e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x092e('0x9')](function(_0xb38be3){logger[_0x092e('0xa')](_0x092e('0x1d'),_0x367db0);logger[_0x092e('0xd')](_0x092e('0x1d'),_0x367db0,JSON[_0x092e('0xf')](_0xb38be3));_0xfef2de(_0xb38be3);})[_0x092e('0x14')](function(_0x3c52fb){logger[_0x092e('0x10')]('ShowSound',_0x3c52fb[_0x092e('0x12')],_0x367db0);_0x2bc301(_0x2cb49d[_0x092e('0x10')](0x1f4,_0x3c52fb[_0x092e('0x12')]));});});}; \ No newline at end of file +var _0xdd73=['message','catch','ShowSound','find','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error'];(function(_0x137591,_0x3c918e){var _0xa2ed64=function(_0x16b68e){while(--_0x16b68e){_0x137591['push'](_0x137591['shift']());}};_0xa2ed64(++_0x3c918e);}(_0xdd73,0x82));var _0x3dd7=function(_0x8e2f22,_0x4bd4db){_0x8e2f22=_0x8e2f22-0x0;var _0xf7fe9e=_0xdd73[_0x8e2f22];return _0xf7fe9e;};'use strict';var _=require(_0x3dd7('0x0'));var util=require(_0x3dd7('0x1'));var moment=require(_0x3dd7('0x2'));var BPromise=require(_0x3dd7('0x3'));var rs=require(_0x3dd7('0x4'));var fs=require('fs');var Redis=require(_0x3dd7('0x5'));var db=require(_0x3dd7('0x6'))['db'];var utils=require(_0x3dd7('0x7'));var logger=require('../../config/logger')(_0x3dd7('0x8'));var config=require(_0x3dd7('0x9'));var jayson=require(_0x3dd7('0xa'));var client=jayson[_0x3dd7('0xb')][_0x3dd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40fa68,_0x1127df,_0x36eaed){return new BPromise(function(_0xff41e8,_0x13af36){return client['request'](_0x40fa68,_0x36eaed)[_0x3dd7('0xd')](function(_0x4298d7){logger[_0x3dd7('0xe')](_0x3dd7('0xf'),_0x1127df,_0x3dd7('0x10'));logger[_0x3dd7('0x11')](_0x3dd7('0x12'),_0x1127df,_0x3dd7('0x10'),JSON['stringify'](_0x4298d7));if(_0x4298d7['error']){if(_0x4298d7['error']['code']===0x1f4){logger[_0x3dd7('0x13')](_0x3dd7('0xf'),_0x1127df,_0x4298d7[_0x3dd7('0x13')]['message']);return _0x13af36(_0x4298d7[_0x3dd7('0x13')][_0x3dd7('0x14')]);}logger[_0x3dd7('0x13')](_0x3dd7('0xf'),_0x1127df,_0x4298d7['error'][_0x3dd7('0x14')]);return _0xff41e8(_0x4298d7[_0x3dd7('0x13')][_0x3dd7('0x14')]);}else{logger[_0x3dd7('0xe')](_0x3dd7('0xf'),_0x1127df,'request\x20sent');_0xff41e8(_0x4298d7['result'][_0x3dd7('0x14')]);}})[_0x3dd7('0x15')](function(_0x163a16){logger[_0x3dd7('0x13')](_0x3dd7('0xf'),_0x1127df,_0x163a16);_0x13af36(_0x163a16);});});}exports[_0x3dd7('0x16')]=function(_0x3b7d46){var _0xb9123f=this;return new Promise(function(_0x1604cf,_0x2ef87f){return db['Sound'][_0x3dd7('0x17')]({'raw':_0x3b7d46['options']?_0x3b7d46['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b7d46['options']?_0x3b7d46[_0x3dd7('0x18')][_0x3dd7('0x19')]||null:null,'attributes':_0x3b7d46[_0x3dd7('0x18')]?_0x3b7d46['options']['attributes']||null:null,'include':_0x3b7d46[_0x3dd7('0x18')]?_0x3b7d46['options'][_0x3dd7('0x1a')]?_[_0x3dd7('0x1b')](_0x3b7d46['options'][_0x3dd7('0x1a')],function(_0x29f48d){return{'model':db[_0x29f48d[_0x3dd7('0x1c')]],'as':_0x29f48d['as'],'attributes':_0x29f48d[_0x3dd7('0x1d')],'include':_0x29f48d['include']?_[_0x3dd7('0x1b')](_0x29f48d[_0x3dd7('0x1a')],function(_0x43ac29){return{'model':db[_0x43ac29[_0x3dd7('0x1c')]],'as':_0x43ac29['as'],'attributes':_0x43ac29['attributes'],'include':_0x43ac29[_0x3dd7('0x1a')]?_[_0x3dd7('0x1b')](_0x43ac29[_0x3dd7('0x1a')],function(_0x23df35){return{'model':db[_0x23df35[_0x3dd7('0x1c')]],'as':_0x23df35['as'],'attributes':_0x23df35[_0x3dd7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3dd7('0xd')](function(_0x1f615b){logger[_0x3dd7('0xe')](_0x3dd7('0x16'),_0x3b7d46);logger[_0x3dd7('0x11')](_0x3dd7('0x16'),_0x3b7d46,JSON['stringify'](_0x1f615b));_0x1604cf(_0x1f615b);})[_0x3dd7('0x15')](function(_0x2a4053){logger['error']('ShowSound',_0x2a4053[_0x3dd7('0x14')],_0x3b7d46);_0x2ef87f(_0xb9123f[_0x3dd7('0x13')](0x1f4,_0x2a4053[_0x3dd7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 34c108d..66c018f 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x2f3947,_0x2ee083){var _0x3e6ab7=function(_0x4057c0){while(--_0x4057c0){_0x2f3947['push'](_0x2f3947['shift']());}};_0x3e6ab7(++_0x2ee083);}(_0x4fc2,0x111));var _0x24fc=function(_0x6751fa,_0x410198){_0x6751fa=_0x6751fa-0x0;var _0x3f24c1=_0x4fc2[_0x6751fa];return _0x3f24c1;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x557750,_0x1d144d){var _0x21db38=function(_0x256e7d){while(--_0x256e7d){_0x557750['push'](_0x557750['shift']());}};_0x21db38(++_0x1d144d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb7e7[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6fe9c99..808ca81 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 _0x6b02=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x31697f,_0x4c2b4a){var _0x47b369=function(_0x33dbf8){while(--_0x33dbf8){_0x31697f['push'](_0x31697f['shift']());}};_0x47b369(++_0x4c2b4a);}(_0x6b02,0x90));var _0x26b0=function(_0xc79916,_0x50c372){_0xc79916=_0xc79916-0x0;var _0x4df2ab=_0x6b02[_0xc79916];return _0x4df2ab;};'use strict';var Sequelize=require(_0x26b0('0x0'));module[_0x26b0('0x1')]={'uniqueid':{'type':Sequelize[_0x26b0('0x2')]},'body':{'type':Sequelize[_0x26b0('0x3')](_0x26b0('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x26b0('0x5')]('in',_0x26b0('0x6')),'defaultValue':_0x26b0('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x26b0('0x3')]}}; \ No newline at end of file +var _0x20ae=['sequelize','exports','medium','ENUM','out','STRING'];(function(_0x389ee3,_0x38c8b5){var _0x4f7d1f=function(_0x3c35e5){while(--_0x3c35e5){_0x389ee3['push'](_0x389ee3['shift']());}};_0x4f7d1f(++_0x38c8b5);}(_0x20ae,0x144));var _0xe20a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x20ae[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0xe20a('0x0'));module[_0xe20a('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xe20a('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xe20a('0x3')]('in',_0xe20a('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xe20a('0x5')]},'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 daf131d..d389457 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 _0x21ad=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','merge','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x3bbe6f,_0x218a49){var _0x1acc60=function(_0x25a8f9){while(--_0x25a8f9){_0x3bbe6f['push'](_0x3bbe6f['shift']());}};_0x1acc60(++_0x218a49);}(_0x21ad,0x85));var _0xd21a=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x21ad[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0xd21a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd21a('0x1'));var jsonpatch=require(_0xd21a('0x2'));var rp=require(_0xd21a('0x3'));var moment=require('moment');var BPromise=require(_0xd21a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd21a('0x5'));var sox=require(_0xd21a('0x6'));var csv=require(_0xd21a('0x7'));var ejs=require(_0xd21a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd21a('0x9'));var squel=require(_0xd21a('0xa'));var crypto=require(_0xd21a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd21a('0xc'));var toCsv=require(_0xd21a('0x7'));var querystring=require('querystring');var Papa=require(_0xd21a('0xd'));var Redis=require(_0xd21a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd21a('0xf'));var as=require(_0xd21a('0x10'));var hardwareService=require(_0xd21a('0x11'));var logger=require(_0xd21a('0x12'))(_0xd21a('0x13'));var utils=require(_0xd21a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd21a('0x15'));var db=require(_0xd21a('0x16'))['db'];function respondWithStatusCode(_0x559f4a,_0x12c44e){_0x12c44e=_0x12c44e||0xcc;return function(_0x455ba0){if(_0x455ba0){return _0x559f4a[_0xd21a('0x17')](_0x12c44e);}return _0x559f4a[_0xd21a('0x18')](_0x12c44e)[_0xd21a('0x19')]();};}function respondWithResult(_0xd4ff0e,_0x445cd9){_0x445cd9=_0x445cd9||0xc8;return function(_0x4ee3b4){if(_0x4ee3b4){return _0xd4ff0e['status'](_0x445cd9)[_0xd21a('0x1a')](_0x4ee3b4);}};}function respondWithFilteredResult(_0x20d9a6,_0x216be9){return function(_0x2d0095){if(_0x2d0095){var _0x51a6b5=typeof _0x216be9[_0xd21a('0x1b')]===_0xd21a('0x1c')&&typeof _0x216be9[_0xd21a('0x1d')]===_0xd21a('0x1c');var _0x1b88ff=_0x2d0095[_0xd21a('0x1e')];var _0x357e71=_0x51a6b5?0x0:_0x216be9[_0xd21a('0x1b')];var _0x4c3d6d=_0x51a6b5?_0x2d0095[_0xd21a('0x1e')]:_0x216be9[_0xd21a('0x1b')]+_0x216be9['limit'];var _0x2a18bb;if(_0x4c3d6d>=_0x1b88ff){_0x4c3d6d=_0x1b88ff;_0x2a18bb=0xc8;}else{_0x2a18bb=0xce;}_0x20d9a6[_0xd21a('0x18')](_0x2a18bb);return _0x20d9a6['set']('Content-Range',_0x357e71+'-'+_0x4c3d6d+'/'+_0x1b88ff)[_0xd21a('0x1a')](_0x2d0095);}return null;};}function patchUpdates(_0x905fd4){return function(_0x186ed0){try{jsonpatch[_0xd21a('0x1f')](_0x186ed0,_0x905fd4,!![]);}catch(_0x1c9734){return BPromise['reject'](_0x1c9734);}return _0x186ed0[_0xd21a('0x20')]();};}function saveUpdates(_0x1d0805,_0x192424){return function(_0x7f9b2){if(_0x7f9b2){return _0x7f9b2[_0xd21a('0x21')](_0x1d0805)[_0xd21a('0x22')](function(_0x16ceb3){return _0x16ceb3;});}return null;};}function removeEntity(_0x3e41b8,_0x14e397){return function(_0x4d4a64){if(_0x4d4a64){return _0x4d4a64[_0xd21a('0x23')]()[_0xd21a('0x22')](function(){_0x3e41b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3dc5,_0xa0bde7){return function(_0x2cfcff){if(!_0x2cfcff){_0x5d3dc5[_0xd21a('0x17')](0x194);}return _0x2cfcff;};}function handleError(_0x579aea,_0x29121a){_0x29121a=_0x29121a||0x1f4;return function(_0x27c022){logger[_0xd21a('0x24')](_0x27c022[_0xd21a('0x25')]);if(_0x27c022[_0xd21a('0x26')]){delete _0x27c022[_0xd21a('0x26')];}_0x579aea[_0xd21a('0x18')](_0x29121a)[_0xd21a('0x27')](_0x27c022);};}exports[_0xd21a('0x28')]=function(_0x1208e2,_0x4d7a16){var _0x4d517c={},_0x591b9a={},_0x5710e0={'count':0x0,'rows':[]};var _0x228a2f=_[_0xd21a('0x29')](db[_0xd21a('0x2a')]['rawAttributes'],function(_0x2489c4){return{'name':_0x2489c4[_0xd21a('0x2b')],'type':_0x2489c4[_0xd21a('0x2c')][_0xd21a('0x2d')]};});_0x591b9a[_0xd21a('0x2e')]=_[_0xd21a('0x29')](_0x228a2f,_0xd21a('0x26'));_0x591b9a[_0xd21a('0x2f')]=_[_0xd21a('0x30')](_0x1208e2[_0xd21a('0x2f')]);_0x591b9a['filters']=_[_0xd21a('0x31')](_0x591b9a[_0xd21a('0x2e')],_0x591b9a[_0xd21a('0x2f')]);_0x4d517c[_0xd21a('0x32')]=_['intersection'](_0x591b9a['model'],qs[_0xd21a('0x33')](_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x33')]));_0x4d517c[_0xd21a('0x32')]=_0x4d517c['attributes'][_0xd21a('0x34')]?_0x4d517c['attributes']:_0x591b9a[_0xd21a('0x2e')];if(!_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x35')]('nolimit')){_0x4d517c[_0xd21a('0x1d')]=qs['limit'](_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x1d')]);_0x4d517c['offset']=qs[_0xd21a('0x1b')](_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x1b')]);}_0x4d517c[_0xd21a('0x36')]=qs[_0xd21a('0x37')](_0x1208e2['query'][_0xd21a('0x37')]);_0x4d517c[_0xd21a('0x38')]=qs[_0xd21a('0x39')](_[_0xd21a('0x3a')](_0x1208e2[_0xd21a('0x2f')],_0x591b9a[_0xd21a('0x39')]),_0x228a2f);if(_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x3b')]){_0x4d517c[_0xd21a('0x38')]=_['merge'](_0x4d517c[_0xd21a('0x38')],{'$or':_[_0xd21a('0x29')](_0x228a2f,function(_0x846f4b){if(_0x846f4b[_0xd21a('0x2c')]!==_0xd21a('0x3c')){var _0x2c7cfe={};_0x2c7cfe[_0x846f4b['name']]={'$like':'%'+_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x3b')]+'%'};return _0x2c7cfe;}})});}_0x4d517c=_['merge']({},_0x4d517c,_0x1208e2[_0xd21a('0x3d')]);var _0xc8c707={'where':_0x4d517c[_0xd21a('0x38')]};return db[_0xd21a('0x2a')][_0xd21a('0x1e')](_0xc8c707)['then'](function(_0x261204){_0x5710e0[_0xd21a('0x1e')]=_0x261204;if(_0x1208e2[_0xd21a('0x2f')][_0xd21a('0x3e')]){_0x4d517c[_0xd21a('0x3f')]=[{'all':!![]}];}return db[_0xd21a('0x2a')][_0xd21a('0x40')](_0x4d517c);})[_0xd21a('0x22')](function(_0x46269d){_0x5710e0[_0xd21a('0x41')]=_0x46269d;return _0x5710e0;})[_0xd21a('0x22')](respondWithFilteredResult(_0x4d7a16,_0x4d517c))[_0xd21a('0x42')](handleError(_0x4d7a16,null));};exports['show']=function(_0x5a064c,_0xfcd393){var _0x5cf655={'raw':!![],'where':{'id':_0x5a064c['params']['id']}},_0x55e178={};_0x55e178[_0xd21a('0x2e')]=_[_0xd21a('0x30')](db['SquareMessage'][_0xd21a('0x43')]);_0x55e178[_0xd21a('0x2f')]=_[_0xd21a('0x30')](_0x5a064c[_0xd21a('0x2f')]);_0x55e178[_0xd21a('0x39')]=_[_0xd21a('0x31')](_0x55e178[_0xd21a('0x2e')],_0x55e178['query']);_0x5cf655[_0xd21a('0x32')]=_['intersection'](_0x55e178[_0xd21a('0x2e')],qs['fields'](_0x5a064c[_0xd21a('0x2f')]['fields']));_0x5cf655['attributes']=_0x5cf655[_0xd21a('0x32')]['length']?_0x5cf655[_0xd21a('0x32')]:_0x55e178[_0xd21a('0x2e')];if(_0x5a064c['query'][_0xd21a('0x3e')]){_0x5cf655[_0xd21a('0x3f')]=[{'all':!![]}];}_0x5cf655=_[_0xd21a('0x44')]({},_0x5cf655,_0x5a064c['options']);return db[_0xd21a('0x2a')]['find'](_0x5cf655)['then'](handleEntityNotFound(_0xfcd393,null))[_0xd21a('0x22')](respondWithResult(_0xfcd393,null))[_0xd21a('0x42')](handleError(_0xfcd393,null));};exports[_0xd21a('0x45')]=function(_0x2ffe7c,_0x224b6a){return db[_0xd21a('0x2a')][_0xd21a('0x45')](_0x2ffe7c['body'],{})[_0xd21a('0x22')](respondWithResult(_0x224b6a,0xc9))['catch'](handleError(_0x224b6a,null));};exports[_0xd21a('0x21')]=function(_0x30584a,_0x282ea7){if(_0x30584a[_0xd21a('0x46')]['id']){delete _0x30584a[_0xd21a('0x46')]['id'];}return db[_0xd21a('0x2a')][_0xd21a('0x47')]({'where':{'id':_0x30584a[_0xd21a('0x48')]['id']}})[_0xd21a('0x22')](handleEntityNotFound(_0x282ea7,null))[_0xd21a('0x22')](saveUpdates(_0x30584a[_0xd21a('0x46')],null))[_0xd21a('0x22')](respondWithResult(_0x282ea7,null))[_0xd21a('0x42')](handleError(_0x282ea7,null));};exports[_0xd21a('0x23')]=function(_0x4cd0c8,_0x115965){return db[_0xd21a('0x2a')][_0xd21a('0x47')]({'where':{'id':_0x4cd0c8[_0xd21a('0x48')]['id']}})[_0xd21a('0x22')](handleEntityNotFound(_0x115965,null))[_0xd21a('0x22')](removeEntity(_0x115965,null))[_0xd21a('0x42')](handleError(_0x115965,null));}; \ No newline at end of file +var _0x4530=['sendStatus','error','name','SquareMessage','rawAttributes','fieldName','key','map','keys','query','filters','intersection','fields','attributes','model','hasOwnProperty','order','sort','pick','merge','type','filter','where','includeAll','include','findAll','rows','length','find','catch','create','body','params','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','ioredis','../../components/auth/service','../../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','apply','reject','save','update','destroy','then'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x4530,0x1e9));var _0x0453=function(_0xa1e030,_0x579969){_0xa1e030=_0xa1e030-0x0;var _0x1619bb=_0x4530[_0xa1e030];return _0x1619bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0453('0x0'));var zipdir=require(_0x0453('0x1'));var jsonpatch=require(_0x0453('0x2'));var rp=require(_0x0453('0x3'));var moment=require(_0x0453('0x4'));var BPromise=require(_0x0453('0x5'));var Mustache=require(_0x0453('0x6'));var util=require(_0x0453('0x7'));var path=require(_0x0453('0x8'));var sox=require(_0x0453('0x9'));var csv=require(_0x0453('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0453('0xb'));var _=require(_0x0453('0xc'));var squel=require(_0x0453('0xd'));var crypto=require(_0x0453('0xe'));var jsforce=require(_0x0453('0xf'));var deskjs=require(_0x0453('0x10'));var toCsv=require(_0x0453('0xa'));var querystring=require(_0x0453('0x11'));var Papa=require(_0x0453('0x12'));var Redis=require(_0x0453('0x13'));var authService=require(_0x0453('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0453('0x15'));var hardwareService=require(_0x0453('0x16'));var logger=require('../../config/logger')(_0x0453('0x17'));var utils=require(_0x0453('0x18'));var config=require(_0x0453('0x19'));var licenseUtil=require(_0x0453('0x1a'));var db=require(_0x0453('0x1b'))['db'];function respondWithStatusCode(_0x2db95b,_0x1e8aa7){_0x1e8aa7=_0x1e8aa7||0xcc;return function(_0x5af496){if(_0x5af496){return _0x2db95b['sendStatus'](_0x1e8aa7);}return _0x2db95b[_0x0453('0x1c')](_0x1e8aa7)[_0x0453('0x1d')]();};}function respondWithResult(_0x587b93,_0x3f60d2){_0x3f60d2=_0x3f60d2||0xc8;return function(_0x1ae2c1){if(_0x1ae2c1){return _0x587b93[_0x0453('0x1c')](_0x3f60d2)[_0x0453('0x1e')](_0x1ae2c1);}};}function respondWithFilteredResult(_0xacb535,_0x34ae90){return function(_0x519bf7){if(_0x519bf7){var _0x419e91=typeof _0x34ae90[_0x0453('0x1f')]===_0x0453('0x20')&&typeof _0x34ae90[_0x0453('0x21')]===_0x0453('0x20');var _0x59c3dd=_0x519bf7['count'];var _0x4300ff=_0x419e91?0x0:_0x34ae90[_0x0453('0x1f')];var _0x4fba62=_0x419e91?_0x519bf7[_0x0453('0x22')]:_0x34ae90[_0x0453('0x1f')]+_0x34ae90[_0x0453('0x21')];var _0x48ac90;if(_0x4fba62>=_0x59c3dd){_0x4fba62=_0x59c3dd;_0x48ac90=0xc8;}else{_0x48ac90=0xce;}_0xacb535[_0x0453('0x1c')](_0x48ac90);return _0xacb535[_0x0453('0x23')](_0x0453('0x24'),_0x4300ff+'-'+_0x4fba62+'/'+_0x59c3dd)[_0x0453('0x1e')](_0x519bf7);}return null;};}function patchUpdates(_0x2f2c39){return function(_0xfb1c12){try{jsonpatch[_0x0453('0x25')](_0xfb1c12,_0x2f2c39,!![]);}catch(_0x2f2cd4){return BPromise[_0x0453('0x26')](_0x2f2cd4);}return _0xfb1c12[_0x0453('0x27')]();};}function saveUpdates(_0x47dc0b,_0xc60ad3){return function(_0xbe3d2d){if(_0xbe3d2d){return _0xbe3d2d[_0x0453('0x28')](_0x47dc0b)['then'](function(_0x37bcc6){return _0x37bcc6;});}return null;};}function removeEntity(_0x399c5f,_0xae25c5){return function(_0x411665){if(_0x411665){return _0x411665[_0x0453('0x29')]()[_0x0453('0x2a')](function(){_0x399c5f['status'](0xcc)[_0x0453('0x1d')]();});}};}function handleEntityNotFound(_0x94606,_0x547cdd){return function(_0x2b347a){if(!_0x2b347a){_0x94606[_0x0453('0x2b')](0x194);}return _0x2b347a;};}function handleError(_0x314bd0,_0x31a1d9){_0x31a1d9=_0x31a1d9||0x1f4;return function(_0x15f6ad){logger[_0x0453('0x2c')](_0x15f6ad['stack']);if(_0x15f6ad[_0x0453('0x2d')]){delete _0x15f6ad['name'];}_0x314bd0['status'](_0x31a1d9)['send'](_0x15f6ad);};}exports['index']=function(_0x2662ce,_0x26ef0e){var _0xf9c944={},_0x2da859={},_0x4b9b60={'count':0x0,'rows':[]};var _0x1a6632=_['map'](db[_0x0453('0x2e')][_0x0453('0x2f')],function(_0x24eca5){return{'name':_0x24eca5[_0x0453('0x30')],'type':_0x24eca5['type'][_0x0453('0x31')]};});_0x2da859['model']=_[_0x0453('0x32')](_0x1a6632,'name');_0x2da859['query']=_[_0x0453('0x33')](_0x2662ce[_0x0453('0x34')]);_0x2da859[_0x0453('0x35')]=_[_0x0453('0x36')](_0x2da859['model'],_0x2da859[_0x0453('0x34')]);_0xf9c944['attributes']=_['intersection'](_0x2da859['model'],qs[_0x0453('0x37')](_0x2662ce['query'][_0x0453('0x37')]));_0xf9c944[_0x0453('0x38')]=_0xf9c944['attributes']['length']?_0xf9c944[_0x0453('0x38')]:_0x2da859[_0x0453('0x39')];if(!_0x2662ce[_0x0453('0x34')][_0x0453('0x3a')]('nolimit')){_0xf9c944['limit']=qs[_0x0453('0x21')](_0x2662ce[_0x0453('0x34')]['limit']);_0xf9c944['offset']=qs[_0x0453('0x1f')](_0x2662ce[_0x0453('0x34')][_0x0453('0x1f')]);}_0xf9c944[_0x0453('0x3b')]=qs[_0x0453('0x3c')](_0x2662ce[_0x0453('0x34')][_0x0453('0x3c')]);_0xf9c944['where']=qs[_0x0453('0x35')](_[_0x0453('0x3d')](_0x2662ce['query'],_0x2da859[_0x0453('0x35')]),_0x1a6632);if(_0x2662ce['query']['filter']){_0xf9c944['where']=_[_0x0453('0x3e')](_0xf9c944['where'],{'$or':_[_0x0453('0x32')](_0x1a6632,function(_0x5911fc){if(_0x5911fc[_0x0453('0x3f')]!=='VIRTUAL'){var _0x4ffb3a={};_0x4ffb3a[_0x5911fc[_0x0453('0x2d')]]={'$like':'%'+_0x2662ce[_0x0453('0x34')][_0x0453('0x40')]+'%'};return _0x4ffb3a;}})});}_0xf9c944=_[_0x0453('0x3e')]({},_0xf9c944,_0x2662ce['options']);var _0x4326e0={'where':_0xf9c944[_0x0453('0x41')]};return db[_0x0453('0x2e')][_0x0453('0x22')](_0x4326e0)[_0x0453('0x2a')](function(_0x942bc3){_0x4b9b60[_0x0453('0x22')]=_0x942bc3;if(_0x2662ce[_0x0453('0x34')][_0x0453('0x42')]){_0xf9c944[_0x0453('0x43')]=[{'all':!![]}];}return db[_0x0453('0x2e')][_0x0453('0x44')](_0xf9c944);})[_0x0453('0x2a')](function(_0x575ce2){_0x4b9b60[_0x0453('0x45')]=_0x575ce2;return _0x4b9b60;})['then'](respondWithFilteredResult(_0x26ef0e,_0xf9c944))['catch'](handleError(_0x26ef0e,null));};exports['show']=function(_0x5d53cc,_0x4c7be9){var _0x29495f={'raw':!![],'where':{'id':_0x5d53cc['params']['id']}},_0x244698={};_0x244698['model']=_['keys'](db['SquareMessage'][_0x0453('0x2f')]);_0x244698['query']=_[_0x0453('0x33')](_0x5d53cc[_0x0453('0x34')]);_0x244698[_0x0453('0x35')]=_[_0x0453('0x36')](_0x244698[_0x0453('0x39')],_0x244698[_0x0453('0x34')]);_0x29495f[_0x0453('0x38')]=_[_0x0453('0x36')](_0x244698['model'],qs['fields'](_0x5d53cc[_0x0453('0x34')][_0x0453('0x37')]));_0x29495f[_0x0453('0x38')]=_0x29495f[_0x0453('0x38')][_0x0453('0x46')]?_0x29495f[_0x0453('0x38')]:_0x244698['model'];if(_0x5d53cc[_0x0453('0x34')][_0x0453('0x42')]){_0x29495f[_0x0453('0x43')]=[{'all':!![]}];}_0x29495f=_[_0x0453('0x3e')]({},_0x29495f,_0x5d53cc['options']);return db[_0x0453('0x2e')][_0x0453('0x47')](_0x29495f)[_0x0453('0x2a')](handleEntityNotFound(_0x4c7be9,null))[_0x0453('0x2a')](respondWithResult(_0x4c7be9,null))[_0x0453('0x48')](handleError(_0x4c7be9,null));};exports[_0x0453('0x49')]=function(_0x55327e,_0x53f83c){return db['SquareMessage'][_0x0453('0x49')](_0x55327e['body'],{})[_0x0453('0x2a')](respondWithResult(_0x53f83c,0xc9))[_0x0453('0x48')](handleError(_0x53f83c,null));};exports[_0x0453('0x28')]=function(_0xf8899d,_0x57a7d5){if(_0xf8899d[_0x0453('0x4a')]['id']){delete _0xf8899d[_0x0453('0x4a')]['id'];}return db[_0x0453('0x2e')][_0x0453('0x47')]({'where':{'id':_0xf8899d[_0x0453('0x4b')]['id']}})[_0x0453('0x2a')](handleEntityNotFound(_0x57a7d5,null))[_0x0453('0x2a')](saveUpdates(_0xf8899d[_0x0453('0x4a')],null))[_0x0453('0x2a')](respondWithResult(_0x57a7d5,null))['catch'](handleError(_0x57a7d5,null));};exports[_0x0453('0x29')]=function(_0x3a74ee,_0x41638a){return db['SquareMessage'][_0x0453('0x47')]({'where':{'id':_0x3a74ee[_0x0453('0x4b')]['id']}})[_0x0453('0x2a')](handleEntityNotFound(_0x41638a,null))[_0x0453('0x2a')](removeEntity(_0x41638a,null))[_0x0453('0x48')](handleError(_0x41638a,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a3c1066..4de8f56 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 _0xb0c4=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0xb0c4,0xc2));var _0x4b0c=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0xb0c4[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0x4b0c('0x0'));var util=require('util');var logger=require(_0x4b0c('0x1'))(_0x4b0c('0x2'));var moment=require('moment');var BPromise=require(_0x4b0c('0x3'));var rp=require(_0x4b0c('0x4'));var fs=require('fs');var path=require(_0x4b0c('0x5'));var rimraf=require(_0x4b0c('0x6'));var config=require(_0x4b0c('0x7'));var attributes=require(_0x4b0c('0x8'));module[_0x4b0c('0x9')]=function(_0x2a1999,_0xc28b43){return _0x2a1999[_0x4b0c('0xa')](_0x4b0c('0xb'),attributes,{'tableName':_0x4b0c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecf8=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2abb9d,_0x5b077f){var _0x9d25d6=function(_0x13b280){while(--_0x13b280){_0x2abb9d['push'](_0x2abb9d['shift']());}};_0x9d25d6(++_0x5b077f);}(_0xecf8,0xbe));var _0x8ecf=function(_0x29ace8,_0x30dfe5){_0x29ace8=_0x29ace8-0x0;var _0x5e63b5=_0xecf8[_0x29ace8];return _0x5e63b5;};'use strict';var _=require(_0x8ecf('0x0'));var util=require('util');var logger=require(_0x8ecf('0x1'))(_0x8ecf('0x2'));var moment=require(_0x8ecf('0x3'));var BPromise=require(_0x8ecf('0x4'));var rp=require(_0x8ecf('0x5'));var fs=require('fs');var path=require(_0x8ecf('0x6'));var rimraf=require(_0x8ecf('0x7'));var config=require(_0x8ecf('0x8'));var attributes=require(_0x8ecf('0x9'));module[_0x8ecf('0xa')]=function(_0x292e8c,_0x53674d){return _0x292e8c[_0x8ecf('0xb')](_0x8ecf('0xc'),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 97b7e9a..9b4c7ef 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 _0x443a=['rpc','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x235fdc,_0x4e76cf){var _0x5e0dfd=function(_0x3dea73){while(--_0x3dea73){_0x235fdc['push'](_0x235fdc['shift']());}};_0x5e0dfd(++_0x4e76cf);}(_0x443a,0x1aa));var _0xa443=function(_0x4b7c5a,_0x57eaf5){_0x4b7c5a=_0x4b7c5a-0x0;var _0x40ff02=_0x443a[_0x4b7c5a];return _0x40ff02;};'use strict';var _=require(_0xa443('0x0'));var util=require(_0xa443('0x1'));var moment=require(_0xa443('0x2'));var BPromise=require(_0xa443('0x3'));var rs=require(_0xa443('0x4'));var fs=require('fs');var Redis=require(_0xa443('0x5'));var db=require(_0xa443('0x6'))['db'];var utils=require(_0xa443('0x7'));var logger=require(_0xa443('0x8'))(_0xa443('0x9'));var config=require('../../config/environment');var jayson=require(_0xa443('0xa'));var client=jayson[_0xa443('0xb')][_0xa443('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2ede,_0x406436,_0x298ff6){return new BPromise(function(_0xec3bab,_0x4ac779){return client[_0xa443('0xd')](_0x1e2ede,_0x298ff6)['then'](function(_0x13a168){logger[_0xa443('0xe')](_0xa443('0xf'),_0x406436,_0xa443('0x10'));logger[_0xa443('0x11')](_0xa443('0x12'),_0x406436,'request\x20sent',JSON[_0xa443('0x13')](_0x13a168));if(_0x13a168[_0xa443('0x14')]){if(_0x13a168[_0xa443('0x14')][_0xa443('0x15')]===0x1f4){logger[_0xa443('0x14')](_0xa443('0xf'),_0x406436,_0x13a168['error'][_0xa443('0x16')]);return _0x4ac779(_0x13a168[_0xa443('0x14')][_0xa443('0x16')]);}logger['error'](_0xa443('0xf'),_0x406436,_0x13a168[_0xa443('0x14')][_0xa443('0x16')]);return _0xec3bab(_0x13a168[_0xa443('0x14')][_0xa443('0x16')]);}else{logger[_0xa443('0xe')](_0xa443('0xf'),_0x406436,_0xa443('0x10'));_0xec3bab(_0x13a168[_0xa443('0x17')][_0xa443('0x16')]);}})['catch'](function(_0x25148e){logger[_0xa443('0x14')](_0xa443('0xf'),_0x406436,_0x25148e);_0x4ac779(_0x25148e);});});}exports[_0xa443('0x18')]=function(_0x13feb5){var _0x4427b2=this;return new Promise(function(_0x192a7,_0x26c2be){return db[_0xa443('0x19')][_0xa443('0x1a')](_0x13feb5[_0xa443('0x1b')],{'raw':_0x13feb5['options']?_0x13feb5[_0xa443('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x10f862){logger[_0xa443('0xe')]('CreateSquareMessage',_0x13feb5);logger['debug'](_0xa443('0x18'),_0x13feb5,JSON[_0xa443('0x13')](_0x10f862));_0x192a7(_0x10f862);})['catch'](function(_0x408a49){logger[_0xa443('0x14')]('CreateSquareMessage',_0x408a49[_0xa443('0x16')],_0x13feb5);_0x26c2be(_0x4427b2['error'](0x1f4,_0x408a49[_0xa443('0x16')]));});});}; \ No newline at end of file +var _0x8d87=['SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a75c0,_0x32a872){var _0x2969e4=function(_0x63769b){while(--_0x63769b){_0x4a75c0['push'](_0x4a75c0['shift']());}};_0x2969e4(++_0x32a872);}(_0x8d87,0x9b));var _0x78d8=function(_0x53f715,_0x52587b){_0x53f715=_0x53f715-0x0;var _0x16c757=_0x8d87[_0x53f715];return _0x16c757;};'use strict';var _=require(_0x78d8('0x0'));var util=require(_0x78d8('0x1'));var moment=require(_0x78d8('0x2'));var BPromise=require(_0x78d8('0x3'));var rs=require(_0x78d8('0x4'));var fs=require('fs');var Redis=require(_0x78d8('0x5'));var db=require(_0x78d8('0x6'))['db'];var utils=require(_0x78d8('0x7'));var logger=require(_0x78d8('0x8'))(_0x78d8('0x9'));var config=require(_0x78d8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x78d8('0xb')][_0x78d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x109d7f,_0x5ecf18,_0x285543){return new BPromise(function(_0x13da23,_0x377aa6){return client[_0x78d8('0xd')](_0x109d7f,_0x285543)[_0x78d8('0xe')](function(_0x1a755a){logger[_0x78d8('0xf')](_0x78d8('0x10'),_0x5ecf18,_0x78d8('0x11'));logger[_0x78d8('0x12')](_0x78d8('0x13'),_0x5ecf18,_0x78d8('0x11'),JSON[_0x78d8('0x14')](_0x1a755a));if(_0x1a755a[_0x78d8('0x15')]){if(_0x1a755a['error']['code']===0x1f4){logger[_0x78d8('0x15')]('SquareMessage,\x20%s,\x20%s',_0x5ecf18,_0x1a755a[_0x78d8('0x15')][_0x78d8('0x16')]);return _0x377aa6(_0x1a755a[_0x78d8('0x15')][_0x78d8('0x16')]);}logger[_0x78d8('0x15')](_0x78d8('0x10'),_0x5ecf18,_0x1a755a[_0x78d8('0x15')][_0x78d8('0x16')]);return _0x13da23(_0x1a755a[_0x78d8('0x15')]['message']);}else{logger[_0x78d8('0xf')](_0x78d8('0x10'),_0x5ecf18,_0x78d8('0x11'));_0x13da23(_0x1a755a[_0x78d8('0x17')][_0x78d8('0x16')]);}})[_0x78d8('0x18')](function(_0x5aaf9a){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5ecf18,_0x5aaf9a);_0x377aa6(_0x5aaf9a);});});}exports[_0x78d8('0x19')]=function(_0x8e3941){var _0x60bf3c=this;return new Promise(function(_0x2e811b,_0x2e3408){return db[_0x78d8('0x1a')][_0x78d8('0x1b')](_0x8e3941['body'],{'raw':_0x8e3941[_0x78d8('0x1c')]?_0x8e3941['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e9469){logger[_0x78d8('0xf')](_0x78d8('0x19'),_0x8e3941);logger['debug']('CreateSquareMessage',_0x8e3941,JSON[_0x78d8('0x14')](_0x2e9469));_0x2e811b(_0x2e9469);})[_0x78d8('0x18')](function(_0x59291b){logger['error'](_0x78d8('0x19'),_0x59291b[_0x78d8('0x16')],_0x8e3941);_0x2e3408(_0x60bf3c[_0x78d8('0x15')](0x1f4,_0x59291b[_0x78d8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 578d748..908b451 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 _0x3097=['update','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','post','create'];(function(_0x5e7b08,_0x47bbc6){var _0x5a73b9=function(_0x4b5cf3){while(--_0x4b5cf3){_0x5e7b08['push'](_0x5e7b08['shift']());}};_0x5a73b9(++_0x47bbc6);}(_0x3097,0x16a));var _0x7309=function(_0x204be9,_0x525eaf){_0x204be9=_0x204be9-0x0;var _0x54fe9c=_0x3097[_0x204be9];return _0x54fe9c;};'use strict';var multer=require(_0x7309('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7309('0x1'));var router=express[_0x7309('0x2')]();var fs_extra=require(_0x7309('0x3'));var auth=require(_0x7309('0x4'));var interaction=require(_0x7309('0x5'));var config=require('../../config/environment');var controller=require(_0x7309('0x6'));router[_0x7309('0x7')]('/',auth[_0x7309('0x8')](),controller[_0x7309('0x9')]);router[_0x7309('0x7')](_0x7309('0xa'),auth['isAuthenticated'](),controller[_0x7309('0xb')]);router[_0x7309('0x7')](_0x7309('0xc'),auth['isAuthenticated'](),timeout(_0x7309('0xd')),controller['test']);router[_0x7309('0xe')]('/',auth[_0x7309('0x8')](),controller[_0x7309('0xf')]);router['put']('/:id',auth[_0x7309('0x8')](),controller[_0x7309('0x10')]);router['delete'](_0x7309('0xa'),auth[_0x7309('0x8')](),controller['destroy']);module[_0x7309('0x11')]=router; \ No newline at end of file +var _0x6662=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test','post','put','/:id','exports','multer','util','path','express','Router'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6662,0xeb));var _0x2666=function(_0x569744,_0x30c532){_0x569744=_0x569744-0x0;var _0x57e918=_0x6662[_0x569744];return _0x57e918;};'use strict';var multer=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var path=require(_0x2666('0x2'));var timeout=require('connect-timeout');var express=require(_0x2666('0x3'));var router=express[_0x2666('0x4')]();var fs_extra=require(_0x2666('0x5'));var auth=require(_0x2666('0x6'));var interaction=require(_0x2666('0x7'));var config=require(_0x2666('0x8'));var controller=require(_0x2666('0x9'));router[_0x2666('0xa')]('/',auth[_0x2666('0xb')](),controller[_0x2666('0xc')]);router[_0x2666('0xa')]('/:id',auth[_0x2666('0xb')](),controller[_0x2666('0xd')]);router[_0x2666('0xa')](_0x2666('0xe'),auth[_0x2666('0xb')](),timeout('15s'),controller[_0x2666('0xf')]);router[_0x2666('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2666('0x11')](_0x2666('0x12'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2666('0xb')](),controller['destroy']);module[_0x2666('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5f858fd..dd0ee80 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 _0x5638=['name','sequelize','STRING'];(function(_0x4bcf0d,_0x3bd4b9){var _0x1134e6=function(_0xae6e25){while(--_0xae6e25){_0x4bcf0d['push'](_0x4bcf0d['shift']());}};_0x1134e6(++_0x3bd4b9);}(_0x5638,0x127));var _0x8563=function(_0x51a189,_0x134d97){_0x51a189=_0x51a189-0x0;var _0x9cdefc=_0x5638[_0x51a189];return _0x9cdefc;};'use strict';var Sequelize=require(_0x8563('0x0'));module['exports']={'name':{'type':Sequelize[_0x8563('0x1')],'unique':_0x8563('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8563('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd618=['sequelize','exports','STRING','name'];(function(_0x4103e0,_0x1f681a){var _0x955879=function(_0x162049){while(--_0x162049){_0x4103e0['push'](_0x4103e0['shift']());}};_0x955879(++_0x1f681a);}(_0xd618,0xf8));var _0x8d61=function(_0x55e631,_0x4e9bdb){_0x55e631=_0x55e631-0x0;var _0x1a0670=_0xd618[_0x55e631];return _0x1a0670;};'use strict';var Sequelize=require(_0x8d61('0x0'));module[_0x8d61('0x1')]={'name':{'type':Sequelize[_0x8d61('0x2')],'unique':_0x8d61('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 9758106..85a5dbd 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 _0xde35=['request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','show','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','rimraf','zip-dir','fast-json-patch'];(function(_0x5177f7,_0x5c9bdb){var _0x120715=function(_0x255bae){while(--_0x255bae){_0x5177f7['push'](_0x5177f7['shift']());}};_0x120715(++_0x5c9bdb);}(_0xde35,0x159));var _0x5de3=function(_0x574e35,_0x255a18){_0x574e35=_0x574e35-0x0;var _0x48ffac=_0xde35[_0x574e35];return _0x48ffac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5de3('0x0'));var zipdir=require(_0x5de3('0x1'));var jsonpatch=require(_0x5de3('0x2'));var rp=require(_0x5de3('0x3'));var moment=require(_0x5de3('0x4'));var BPromise=require(_0x5de3('0x5'));var Mustache=require(_0x5de3('0x6'));var util=require('util');var path=require(_0x5de3('0x7'));var sox=require(_0x5de3('0x8'));var csv=require(_0x5de3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5de3('0xa'));var crypto=require(_0x5de3('0xb'));var jsforce=require(_0x5de3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5de3('0x9'));var querystring=require(_0x5de3('0xd'));var Papa=require(_0x5de3('0xe'));var Redis=require('ioredis');var authService=require(_0x5de3('0xf'));var qs=require(_0x5de3('0x10'));var as=require(_0x5de3('0x11'));var hardwareService=require(_0x5de3('0x12'));var logger=require(_0x5de3('0x13'))(_0x5de3('0x14'));var utils=require(_0x5de3('0x15'));var config=require(_0x5de3('0x16'));var licenseUtil=require(_0x5de3('0x17'));var db=require(_0x5de3('0x18'))['db'];function respondWithStatusCode(_0x16497d,_0x296a4a){_0x296a4a=_0x296a4a||0xcc;return function(_0x2af906){if(_0x2af906){return _0x16497d['sendStatus'](_0x296a4a);}return _0x16497d['status'](_0x296a4a)[_0x5de3('0x19')]();};}function respondWithResult(_0x40ec2d,_0x44e9e9){_0x44e9e9=_0x44e9e9||0xc8;return function(_0x397d35){if(_0x397d35){return _0x40ec2d['status'](_0x44e9e9)['json'](_0x397d35);}};}function respondWithFilteredResult(_0x145f91,_0x3b2cb5){return function(_0x447c30){if(_0x447c30){var _0x81b176=typeof _0x3b2cb5[_0x5de3('0x1a')]===_0x5de3('0x1b')&&typeof _0x3b2cb5[_0x5de3('0x1c')]==='undefined';var _0x282801=_0x447c30[_0x5de3('0x1d')];var _0x339107=_0x81b176?0x0:_0x3b2cb5[_0x5de3('0x1a')];var _0x157260=_0x81b176?_0x447c30['count']:_0x3b2cb5['offset']+_0x3b2cb5['limit'];var _0x5bfb31;if(_0x157260>=_0x282801){_0x157260=_0x282801;_0x5bfb31=0xc8;}else{_0x5bfb31=0xce;}_0x145f91[_0x5de3('0x1e')](_0x5bfb31);return _0x145f91[_0x5de3('0x1f')](_0x5de3('0x20'),_0x339107+'-'+_0x157260+'/'+_0x282801)[_0x5de3('0x21')](_0x447c30);}return null;};}function patchUpdates(_0x2d6ea7){return function(_0x55057b){try{jsonpatch[_0x5de3('0x22')](_0x55057b,_0x2d6ea7,!![]);}catch(_0xf6506e){return BPromise['reject'](_0xf6506e);}return _0x55057b[_0x5de3('0x23')]();};}function saveUpdates(_0x2885ca,_0x3855f8){return function(_0x20619f){if(_0x20619f){return _0x20619f[_0x5de3('0x24')](_0x2885ca)[_0x5de3('0x25')](function(_0x5f0fde){return _0x5f0fde;});}return null;};}function removeEntity(_0x8bda68,_0x2ff505){return function(_0x94cda1){if(_0x94cda1){return _0x94cda1[_0x5de3('0x26')]()[_0x5de3('0x25')](function(){var _0x48d7fa=_0x94cda1['get']({'plain':!![]});var _0x29ab58=_0x5de3('0x27');return db[_0x5de3('0x28')][_0x5de3('0x26')]({'where':{'type':_0x29ab58,'resourceId':_0x48d7fa['id']}})[_0x5de3('0x25')](function(){return _0x94cda1;});})['then'](function(){_0x8bda68[_0x5de3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x521a17,_0x120938){return function(_0x36c6c8){if(!_0x36c6c8){_0x521a17['sendStatus'](0x194);}return _0x36c6c8;};}function handleError(_0x2e9141,_0x5bbb50){_0x5bbb50=_0x5bbb50||0x1f4;return function(_0x1f1765){logger[_0x5de3('0x29')](_0x1f1765[_0x5de3('0x2a')]);if(_0x1f1765[_0x5de3('0x2b')]){delete _0x1f1765['name'];}_0x2e9141[_0x5de3('0x1e')](_0x5bbb50)[_0x5de3('0x2c')](_0x1f1765);};}exports[_0x5de3('0x2d')]=function(_0x53e0f0,_0xdfa9bf){var _0x30ab99={},_0x44c5f7={},_0x308457={'count':0x0,'rows':[]};var _0x4ea58b=_[_0x5de3('0x2e')](db[_0x5de3('0x2f')][_0x5de3('0x30')],function(_0x129acd){return{'name':_0x129acd[_0x5de3('0x31')],'type':_0x129acd[_0x5de3('0x32')][_0x5de3('0x33')]};});_0x44c5f7[_0x5de3('0x34')]=_[_0x5de3('0x2e')](_0x4ea58b,_0x5de3('0x2b'));_0x44c5f7[_0x5de3('0x35')]=_[_0x5de3('0x36')](_0x53e0f0['query']);_0x44c5f7[_0x5de3('0x37')]=_[_0x5de3('0x38')](_0x44c5f7[_0x5de3('0x34')],_0x44c5f7[_0x5de3('0x35')]);_0x30ab99[_0x5de3('0x39')]=_[_0x5de3('0x38')](_0x44c5f7[_0x5de3('0x34')],qs['fields'](_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x3a')]));_0x30ab99[_0x5de3('0x39')]=_0x30ab99[_0x5de3('0x39')][_0x5de3('0x3b')]?_0x30ab99[_0x5de3('0x39')]:_0x44c5f7[_0x5de3('0x34')];if(!_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x3c')](_0x5de3('0x3d'))){_0x30ab99[_0x5de3('0x1c')]=qs['limit'](_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x1c')]);_0x30ab99[_0x5de3('0x1a')]=qs[_0x5de3('0x1a')](_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x1a')]);}_0x30ab99['order']=qs[_0x5de3('0x3e')](_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x3e')]);_0x30ab99[_0x5de3('0x3f')]=qs['filters'](_[_0x5de3('0x40')](_0x53e0f0[_0x5de3('0x35')],_0x44c5f7['filters']),_0x4ea58b);if(_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x41')]){_0x30ab99['where']=_[_0x5de3('0x42')](_0x30ab99[_0x5de3('0x3f')],{'$or':_[_0x5de3('0x2e')](_0x4ea58b,function(_0x50259c){if(_0x50259c[_0x5de3('0x32')]!=='VIRTUAL'){var _0x4809fb={};_0x4809fb[_0x50259c[_0x5de3('0x2b')]]={'$like':'%'+_0x53e0f0['query'][_0x5de3('0x41')]+'%'};return _0x4809fb;}})});}_0x30ab99=_[_0x5de3('0x42')]({},_0x30ab99,_0x53e0f0[_0x5de3('0x43')]);var _0x53f679={'where':_0x30ab99[_0x5de3('0x3f')]};return db[_0x5de3('0x2f')]['count'](_0x53f679)[_0x5de3('0x25')](function(_0x44b227){_0x308457[_0x5de3('0x1d')]=_0x44b227;if(_0x53e0f0[_0x5de3('0x35')][_0x5de3('0x44')]){_0x30ab99['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x5de3('0x45')](_0x30ab99);})[_0x5de3('0x25')](function(_0x904bac){_0x308457['rows']=_0x904bac;return _0x308457;})[_0x5de3('0x25')](respondWithFilteredResult(_0xdfa9bf,_0x30ab99))['catch'](handleError(_0xdfa9bf,null));};exports[_0x5de3('0x46')]=function(_0x41ea84,_0x54c4c6){var _0x4afa58={'raw':!![],'where':{'id':_0x41ea84['params']['id']}},_0x261939={};_0x261939[_0x5de3('0x34')]=_[_0x5de3('0x36')](db['SquareOdbc'][_0x5de3('0x30')]);_0x261939[_0x5de3('0x35')]=_[_0x5de3('0x36')](_0x41ea84[_0x5de3('0x35')]);_0x261939[_0x5de3('0x37')]=_[_0x5de3('0x38')](_0x261939['model'],_0x261939[_0x5de3('0x35')]);_0x4afa58[_0x5de3('0x39')]=_['intersection'](_0x261939[_0x5de3('0x34')],qs['fields'](_0x41ea84['query']['fields']));_0x4afa58['attributes']=_0x4afa58[_0x5de3('0x39')][_0x5de3('0x3b')]?_0x4afa58[_0x5de3('0x39')]:_0x261939[_0x5de3('0x34')];if(_0x41ea84[_0x5de3('0x35')][_0x5de3('0x44')]){_0x4afa58[_0x5de3('0x47')]=[{'all':!![]}];}_0x4afa58=_[_0x5de3('0x42')]({},_0x4afa58,_0x41ea84['options']);return db[_0x5de3('0x2f')][_0x5de3('0x48')](_0x4afa58)[_0x5de3('0x25')](handleEntityNotFound(_0x54c4c6,null))[_0x5de3('0x25')](respondWithResult(_0x54c4c6,null))['catch'](handleError(_0x54c4c6,null));};exports[_0x5de3('0x49')]=function(_0x6bd73f,_0x5a1009){return db[_0x5de3('0x2f')]['create'](_0x6bd73f[_0x5de3('0x4a')],{})[_0x5de3('0x25')](function(_0x581dcc){var _0x23e055=_0x6bd73f['user'][_0x5de3('0x4b')]({'plain':!![]});if(!_0x23e055)throw new Error(_0x5de3('0x4c'));if(_0x23e055['role']===_0x5de3('0x4d')){var _0x5b358d=_0x581dcc[_0x5de3('0x4b')]({'plain':!![]});var _0x214855=_0x5de3('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x214855,'userProfileId':_0x23e055[_0x5de3('0x4e')]},'raw':!![]})[_0x5de3('0x25')](function(_0x2d9b6f){if(_0x2d9b6f&&_0x2d9b6f[_0x5de3('0x4f')]===0x0){return db['UserProfileResource'][_0x5de3('0x49')]({'name':_0x5b358d[_0x5de3('0x2b')],'resourceId':_0x5b358d['id'],'type':_0x2d9b6f[_0x5de3('0x2b')],'sectionId':_0x2d9b6f['id']},{})[_0x5de3('0x25')](function(){return _0x581dcc;});}else{return _0x581dcc;}})[_0x5de3('0x50')](function(_0x55e6de){logger[_0x5de3('0x29')](_0x5de3('0x51'),_0x55e6de);throw _0x55e6de;});}return _0x581dcc;})[_0x5de3('0x25')](respondWithResult(_0x5a1009,0xc9))['catch'](handleError(_0x5a1009,null));};exports[_0x5de3('0x24')]=function(_0x551a91,_0x48a0e9){if(_0x551a91[_0x5de3('0x4a')]['id']){delete _0x551a91[_0x5de3('0x4a')]['id'];}return db[_0x5de3('0x2f')]['find']({'where':{'id':_0x551a91[_0x5de3('0x52')]['id']}})[_0x5de3('0x25')](handleEntityNotFound(_0x48a0e9,null))[_0x5de3('0x25')](saveUpdates(_0x551a91[_0x5de3('0x4a')],null))[_0x5de3('0x25')](respondWithResult(_0x48a0e9,null))[_0x5de3('0x50')](handleError(_0x48a0e9,null));};exports[_0x5de3('0x26')]=function(_0x362475,_0x210887){return db[_0x5de3('0x2f')][_0x5de3('0x48')]({'where':{'id':_0x362475['params']['id']}})[_0x5de3('0x25')](handleEntityNotFound(_0x210887,null))[_0x5de3('0x25')](removeEntity(_0x210887,null))[_0x5de3('0x50')](handleError(_0x210887,null));};exports[_0x5de3('0x53')]=function(_0x43bd49,_0xa4fb79,_0x5a2fe5){var _0x5599dc;return db[_0x5de3('0x2f')][_0x5de3('0x48')]({'where':{'id':_0x43bd49[_0x5de3('0x52')]['id']},'attributes':['id',_0x5de3('0x54')]})[_0x5de3('0x25')](handleEntityNotFound(_0xa4fb79,null))[_0x5de3('0x25')](function(_0x11f8f4){if(_0x11f8f4){var _0x5e8c84=require(_0x5de3('0x55'))();_0x5e8c84[_0x5de3('0x56')](_0x11f8f4[_0x5de3('0x54')]);_0x5e8c84['closeSync']();return _0x11f8f4;}})['then'](respondWithResult(_0xa4fb79,null))[_0x5de3('0x50')](handleError(_0xa4fb79,null));}; \ No newline at end of file +var _0x7a8f=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','get','ODBC','UserProfileResource','destroy','error','name','index','map','SquareOdbc','type','key','intersection','model','query','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','include','findAll','catch','show','keys','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a8f,0x99));var _0xf7a8=function(_0x30d50a,_0x597bd1){_0x30d50a=_0x30d50a-0x0;var _0x1c0af9=_0x7a8f[_0x30d50a];return _0x1c0af9;};'use strict';var emlformat=require(_0xf7a8('0x0'));var rimraf=require(_0xf7a8('0x1'));var zipdir=require(_0xf7a8('0x2'));var jsonpatch=require(_0xf7a8('0x3'));var rp=require(_0xf7a8('0x4'));var moment=require(_0xf7a8('0x5'));var BPromise=require(_0xf7a8('0x6'));var Mustache=require('mustache');var util=require(_0xf7a8('0x7'));var path=require('path');var sox=require(_0xf7a8('0x8'));var csv=require(_0xf7a8('0x9'));var ejs=require(_0xf7a8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a8('0xb'));var squel=require('squel');var crypto=require(_0xf7a8('0xc'));var jsforce=require(_0xf7a8('0xd'));var deskjs=require(_0xf7a8('0xe'));var toCsv=require(_0xf7a8('0x9'));var querystring=require(_0xf7a8('0xf'));var Papa=require(_0xf7a8('0x10'));var Redis=require(_0xf7a8('0x11'));var authService=require(_0xf7a8('0x12'));var qs=require(_0xf7a8('0x13'));var as=require(_0xf7a8('0x14'));var hardwareService=require(_0xf7a8('0x15'));var logger=require('../../config/logger')(_0xf7a8('0x16'));var utils=require('../../config/utils');var config=require(_0xf7a8('0x17'));var licenseUtil=require(_0xf7a8('0x18'));var db=require(_0xf7a8('0x19'))['db'];function respondWithStatusCode(_0x211286,_0x53167f){_0x53167f=_0x53167f||0xcc;return function(_0x804887){if(_0x804887){return _0x211286[_0xf7a8('0x1a')](_0x53167f);}return _0x211286[_0xf7a8('0x1b')](_0x53167f)['end']();};}function respondWithResult(_0x11f5a8,_0x2814b4){_0x2814b4=_0x2814b4||0xc8;return function(_0x2dba4b){if(_0x2dba4b){return _0x11f5a8['status'](_0x2814b4)['json'](_0x2dba4b);}};}function respondWithFilteredResult(_0x5d895e,_0x3bd93a){return function(_0x175f00){if(_0x175f00){var _0x56187b=typeof _0x3bd93a[_0xf7a8('0x1c')]===_0xf7a8('0x1d')&&typeof _0x3bd93a[_0xf7a8('0x1e')]==='undefined';var _0x1fa6f9=_0x175f00[_0xf7a8('0x1f')];var _0x5160e3=_0x56187b?0x0:_0x3bd93a['offset'];var _0x2d23f9=_0x56187b?_0x175f00[_0xf7a8('0x1f')]:_0x3bd93a[_0xf7a8('0x1c')]+_0x3bd93a[_0xf7a8('0x1e')];var _0x39d139;if(_0x2d23f9>=_0x1fa6f9){_0x2d23f9=_0x1fa6f9;_0x39d139=0xc8;}else{_0x39d139=0xce;}_0x5d895e[_0xf7a8('0x1b')](_0x39d139);return _0x5d895e['set'](_0xf7a8('0x20'),_0x5160e3+'-'+_0x2d23f9+'/'+_0x1fa6f9)[_0xf7a8('0x21')](_0x175f00);}return null;};}function patchUpdates(_0x2be7c5){return function(_0x5f072a){try{jsonpatch['apply'](_0x5f072a,_0x2be7c5,!![]);}catch(_0x48af72){return BPromise[_0xf7a8('0x22')](_0x48af72);}return _0x5f072a['save']();};}function saveUpdates(_0x10238f,_0x27f741){return function(_0x1af728){if(_0x1af728){return _0x1af728[_0xf7a8('0x23')](_0x10238f)[_0xf7a8('0x24')](function(_0x25a25f){return _0x25a25f;});}return null;};}function removeEntity(_0x3e8c6e,_0x120fa5){return function(_0x2b8e8a){if(_0x2b8e8a){return _0x2b8e8a['destroy']()['then'](function(){var _0x5ca07c=_0x2b8e8a[_0xf7a8('0x25')]({'plain':!![]});var _0x213289=_0xf7a8('0x26');return db[_0xf7a8('0x27')][_0xf7a8('0x28')]({'where':{'type':_0x213289,'resourceId':_0x5ca07c['id']}})[_0xf7a8('0x24')](function(){return _0x2b8e8a;});})[_0xf7a8('0x24')](function(){_0x3e8c6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea0bf,_0xe726b){return function(_0x12b26b){if(!_0x12b26b){_0x3ea0bf[_0xf7a8('0x1a')](0x194);}return _0x12b26b;};}function handleError(_0xe2fcf7,_0x29fcca){_0x29fcca=_0x29fcca||0x1f4;return function(_0x68d850){logger[_0xf7a8('0x29')](_0x68d850['stack']);if(_0x68d850[_0xf7a8('0x2a')]){delete _0x68d850[_0xf7a8('0x2a')];}_0xe2fcf7[_0xf7a8('0x1b')](_0x29fcca)['send'](_0x68d850);};}exports[_0xf7a8('0x2b')]=function(_0x125465,_0x192a6a){var _0x172c04={},_0x3ec9be={},_0x42e764={'count':0x0,'rows':[]};var _0x13927c=_[_0xf7a8('0x2c')](db[_0xf7a8('0x2d')]['rawAttributes'],function(_0x36ef55){return{'name':_0x36ef55['fieldName'],'type':_0x36ef55[_0xf7a8('0x2e')][_0xf7a8('0x2f')]};});_0x3ec9be['model']=_['map'](_0x13927c,_0xf7a8('0x2a'));_0x3ec9be['query']=_['keys'](_0x125465['query']);_0x3ec9be['filters']=_[_0xf7a8('0x30')](_0x3ec9be[_0xf7a8('0x31')],_0x3ec9be[_0xf7a8('0x32')]);_0x172c04[_0xf7a8('0x33')]=_[_0xf7a8('0x30')](_0x3ec9be['model'],qs[_0xf7a8('0x34')](_0x125465[_0xf7a8('0x32')][_0xf7a8('0x34')]));_0x172c04[_0xf7a8('0x33')]=_0x172c04[_0xf7a8('0x33')][_0xf7a8('0x35')]?_0x172c04[_0xf7a8('0x33')]:_0x3ec9be[_0xf7a8('0x31')];if(!_0x125465[_0xf7a8('0x32')]['hasOwnProperty'](_0xf7a8('0x36'))){_0x172c04['limit']=qs['limit'](_0x125465[_0xf7a8('0x32')][_0xf7a8('0x1e')]);_0x172c04[_0xf7a8('0x1c')]=qs['offset'](_0x125465[_0xf7a8('0x32')][_0xf7a8('0x1c')]);}_0x172c04[_0xf7a8('0x37')]=qs[_0xf7a8('0x38')](_0x125465['query'][_0xf7a8('0x38')]);_0x172c04['where']=qs[_0xf7a8('0x39')](_['pick'](_0x125465['query'],_0x3ec9be[_0xf7a8('0x39')]),_0x13927c);if(_0x125465[_0xf7a8('0x32')][_0xf7a8('0x3a')]){_0x172c04['where']=_[_0xf7a8('0x3b')](_0x172c04[_0xf7a8('0x3c')],{'$or':_[_0xf7a8('0x2c')](_0x13927c,function(_0x1d3700){if(_0x1d3700[_0xf7a8('0x2e')]!==_0xf7a8('0x3d')){var _0x4831a8={};_0x4831a8[_0x1d3700[_0xf7a8('0x2a')]]={'$like':'%'+_0x125465[_0xf7a8('0x32')][_0xf7a8('0x3a')]+'%'};return _0x4831a8;}})});}_0x172c04=_[_0xf7a8('0x3b')]({},_0x172c04,_0x125465['options']);var _0x24a444={'where':_0x172c04[_0xf7a8('0x3c')]};return db['SquareOdbc']['count'](_0x24a444)[_0xf7a8('0x24')](function(_0x2cd666){_0x42e764[_0xf7a8('0x1f')]=_0x2cd666;if(_0x125465['query']['includeAll']){_0x172c04[_0xf7a8('0x3e')]=[{'all':!![]}];}return db[_0xf7a8('0x2d')][_0xf7a8('0x3f')](_0x172c04);})[_0xf7a8('0x24')](function(_0xf2bc79){_0x42e764['rows']=_0xf2bc79;return _0x42e764;})[_0xf7a8('0x24')](respondWithFilteredResult(_0x192a6a,_0x172c04))[_0xf7a8('0x40')](handleError(_0x192a6a,null));};exports[_0xf7a8('0x41')]=function(_0x1020ea,_0x2f5c71){var _0xb31aec={'raw':!![],'where':{'id':_0x1020ea['params']['id']}},_0xca75a2={};_0xca75a2[_0xf7a8('0x31')]=_[_0xf7a8('0x42')](db['SquareOdbc'][_0xf7a8('0x43')]);_0xca75a2[_0xf7a8('0x32')]=_['keys'](_0x1020ea['query']);_0xca75a2['filters']=_['intersection'](_0xca75a2['model'],_0xca75a2[_0xf7a8('0x32')]);_0xb31aec[_0xf7a8('0x33')]=_[_0xf7a8('0x30')](_0xca75a2[_0xf7a8('0x31')],qs[_0xf7a8('0x34')](_0x1020ea[_0xf7a8('0x32')][_0xf7a8('0x34')]));_0xb31aec[_0xf7a8('0x33')]=_0xb31aec[_0xf7a8('0x33')][_0xf7a8('0x35')]?_0xb31aec[_0xf7a8('0x33')]:_0xca75a2[_0xf7a8('0x31')];if(_0x1020ea['query'][_0xf7a8('0x44')]){_0xb31aec[_0xf7a8('0x3e')]=[{'all':!![]}];}_0xb31aec=_[_0xf7a8('0x3b')]({},_0xb31aec,_0x1020ea[_0xf7a8('0x45')]);return db[_0xf7a8('0x2d')][_0xf7a8('0x46')](_0xb31aec)['then'](handleEntityNotFound(_0x2f5c71,null))[_0xf7a8('0x24')](respondWithResult(_0x2f5c71,null))['catch'](handleError(_0x2f5c71,null));};exports[_0xf7a8('0x47')]=function(_0x226f34,_0x932022){return db['SquareOdbc'][_0xf7a8('0x47')](_0x226f34[_0xf7a8('0x48')],{})[_0xf7a8('0x24')](function(_0x589115){var _0x1d29bf=_0x226f34[_0xf7a8('0x49')][_0xf7a8('0x25')]({'plain':!![]});if(!_0x1d29bf)throw new Error(_0xf7a8('0x4a'));if(_0x1d29bf[_0xf7a8('0x4b')]===_0xf7a8('0x49')){var _0x2aaf29=_0x589115[_0xf7a8('0x25')]({'plain':!![]});var _0x4b7e82=_0xf7a8('0x26');return db[_0xf7a8('0x4c')][_0xf7a8('0x46')]({'where':{'name':_0x4b7e82,'userProfileId':_0x1d29bf['userProfileId']},'raw':!![]})[_0xf7a8('0x24')](function(_0x26e67f){if(_0x26e67f&&_0x26e67f['autoAssociation']===0x0){return db[_0xf7a8('0x27')][_0xf7a8('0x47')]({'name':_0x2aaf29[_0xf7a8('0x2a')],'resourceId':_0x2aaf29['id'],'type':_0x26e67f['name'],'sectionId':_0x26e67f['id']},{})[_0xf7a8('0x24')](function(){return _0x589115;});}else{return _0x589115;}})['catch'](function(_0x4ee992){logger[_0xf7a8('0x29')](_0xf7a8('0x4d'),_0x4ee992);throw _0x4ee992;});}return _0x589115;})['then'](respondWithResult(_0x932022,0xc9))[_0xf7a8('0x40')](handleError(_0x932022,null));};exports['update']=function(_0x456e84,_0x23ad35){if(_0x456e84[_0xf7a8('0x48')]['id']){delete _0x456e84['body']['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x456e84['params']['id']}})[_0xf7a8('0x24')](handleEntityNotFound(_0x23ad35,null))[_0xf7a8('0x24')](saveUpdates(_0x456e84['body'],null))[_0xf7a8('0x24')](respondWithResult(_0x23ad35,null))[_0xf7a8('0x40')](handleError(_0x23ad35,null));};exports[_0xf7a8('0x28')]=function(_0x404337,_0x381146){return db[_0xf7a8('0x2d')]['find']({'where':{'id':_0x404337[_0xf7a8('0x4e')]['id']}})[_0xf7a8('0x24')](handleEntityNotFound(_0x381146,null))[_0xf7a8('0x24')](removeEntity(_0x381146,null))['catch'](handleError(_0x381146,null));};exports[_0xf7a8('0x4f')]=function(_0x4b3211,_0x5d2765,_0x124083){var _0xe25374;return db[_0xf7a8('0x2d')]['find']({'where':{'id':_0x4b3211[_0xf7a8('0x4e')]['id']},'attributes':['id',_0xf7a8('0x50')]})[_0xf7a8('0x24')](handleEntityNotFound(_0x5d2765,null))[_0xf7a8('0x24')](function(_0x29c3db){if(_0x29c3db){var _0x1f787f=require(_0xf7a8('0x51'))();_0x1f787f['openSync'](_0x29c3db[_0xf7a8('0x50')]);_0x1f787f[_0xf7a8('0x52')]();return _0x29c3db;}})[_0xf7a8('0x24')](respondWithResult(_0x5d2765,null))['catch'](handleError(_0x5d2765,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index d0a892e..650a8a1 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 _0xed3d=['moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','api'];(function(_0xc416a5,_0x4d95ce){var _0x1c82b9=function(_0x17ca10){while(--_0x17ca10){_0xc416a5['push'](_0xc416a5['shift']());}};_0x1c82b9(++_0x4d95ce);}(_0xed3d,0x1e9));var _0xded3=function(_0xcbb2dd,_0x9cc69b){_0xcbb2dd=_0xcbb2dd-0x0;var _0x34f9bc=_0xed3d[_0xcbb2dd];return _0x34f9bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xded3('0x0'));var moment=require(_0xded3('0x1'));var BPromise=require(_0xded3('0x2'));var rp=require(_0xded3('0x3'));var fs=require('fs');var path=require(_0xded3('0x4'));var rimraf=require('rimraf');var config=require(_0xded3('0x5'));var attributes=require(_0xded3('0x6'));module[_0xded3('0x7')]=function(_0x2c4d0f,_0x57f634){return _0x2c4d0f[_0xded3('0x8')]('SquareOdbc',attributes,{'tableName':_0xded3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22f4=['request-promise','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a5355,_0x2d9bce){var _0x3b389a=function(_0x4c669a){while(--_0x4c669a){_0x5a5355['push'](_0x5a5355['shift']());}};_0x3b389a(++_0x2d9bce);}(_0x22f4,0x1df));var _0x422f=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x22f4[_0x585d09];return _0x7d9a14;};'use strict';var _=require(_0x422f('0x0'));var util=require(_0x422f('0x1'));var logger=require(_0x422f('0x2'))('api');var moment=require(_0x422f('0x3'));var BPromise=require(_0x422f('0x4'));var rp=require(_0x422f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x422f('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x422f('0x7')]=function(_0x46f460,_0x3d050d){return _0x46f460[_0x422f('0x8')](_0x422f('0x9'),attributes,{'tableName':_0x422f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b41d21b..ca89ae6 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 _0x2394=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareOdbc','options','where','attributes','include','map','model','then','ShowSquareOdbc','stringify'];(function(_0x5ca4b1,_0x50fa81){var _0x3970e6=function(_0x1fb8e2){while(--_0x1fb8e2){_0x5ca4b1['push'](_0x5ca4b1['shift']());}};_0x3970e6(++_0x50fa81);}(_0x2394,0xa0));var _0x4239=function(_0x3f4f78,_0x34055b){_0x3f4f78=_0x3f4f78-0x0;var _0x419576=_0x2394[_0x3f4f78];return _0x419576;};'use strict';var _=require(_0x4239('0x0'));var util=require(_0x4239('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4239('0x2'));var fs=require('fs');var Redis=require(_0x4239('0x3'));var db=require(_0x4239('0x4'))['db'];var utils=require(_0x4239('0x5'));var logger=require(_0x4239('0x6'))(_0x4239('0x7'));var config=require(_0x4239('0x8'));var jayson=require(_0x4239('0x9'));var client=jayson['client'][_0x4239('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4be3af,_0x394479,_0x359eed){return new BPromise(function(_0x359f15,_0x2ee482){return client[_0x4239('0xb')](_0x4be3af,_0x359eed)['then'](function(_0x1a1c7c){logger[_0x4239('0xc')](_0x4239('0xd'),_0x394479,_0x4239('0xe'));logger[_0x4239('0xf')](_0x4239('0x10'),_0x394479,_0x4239('0xe'),JSON['stringify'](_0x1a1c7c));if(_0x1a1c7c[_0x4239('0x11')]){if(_0x1a1c7c['error'][_0x4239('0x12')]===0x1f4){logger[_0x4239('0x11')](_0x4239('0xd'),_0x394479,_0x1a1c7c[_0x4239('0x11')][_0x4239('0x13')]);return _0x2ee482(_0x1a1c7c[_0x4239('0x11')][_0x4239('0x13')]);}logger[_0x4239('0x11')](_0x4239('0xd'),_0x394479,_0x1a1c7c[_0x4239('0x11')]['message']);return _0x359f15(_0x1a1c7c[_0x4239('0x11')]['message']);}else{logger[_0x4239('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x394479,_0x4239('0xe'));_0x359f15(_0x1a1c7c[_0x4239('0x14')]['message']);}})[_0x4239('0x15')](function(_0x43b8a9){logger['error'](_0x4239('0xd'),_0x394479,_0x43b8a9);_0x2ee482(_0x43b8a9);});});}exports['ShowSquareOdbc']=function(_0x4d12b9){var _0x5b4ac5=this;return new Promise(function(_0x1d603c,_0x31da4c){return db[_0x4239('0x16')]['find']({'raw':_0x4d12b9[_0x4239('0x17')]?_0x4d12b9['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d12b9[_0x4239('0x17')]?_0x4d12b9['options'][_0x4239('0x18')]||null:null,'attributes':_0x4d12b9[_0x4239('0x17')]?_0x4d12b9[_0x4239('0x17')][_0x4239('0x19')]||null:null,'include':_0x4d12b9[_0x4239('0x17')]?_0x4d12b9['options'][_0x4239('0x1a')]?_[_0x4239('0x1b')](_0x4d12b9[_0x4239('0x17')][_0x4239('0x1a')],function(_0x319311){return{'model':db[_0x319311[_0x4239('0x1c')]],'as':_0x319311['as'],'attributes':_0x319311[_0x4239('0x19')],'include':_0x319311[_0x4239('0x1a')]?_['map'](_0x319311[_0x4239('0x1a')],function(_0x444e8a){return{'model':db[_0x444e8a[_0x4239('0x1c')]],'as':_0x444e8a['as'],'attributes':_0x444e8a['attributes'],'include':_0x444e8a['include']?_[_0x4239('0x1b')](_0x444e8a['include'],function(_0x348d0c){return{'model':db[_0x348d0c[_0x4239('0x1c')]],'as':_0x348d0c['as'],'attributes':_0x348d0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4239('0x1d')](function(_0xf0e7ed){logger['info'](_0x4239('0x1e'),_0x4d12b9);logger[_0x4239('0xf')]('ShowSquareOdbc',_0x4d12b9,JSON[_0x4239('0x1f')](_0xf0e7ed));_0x1d603c(_0xf0e7ed);})[_0x4239('0x15')](function(_0x9cbc35){logger[_0x4239('0x11')](_0x4239('0x1e'),_0x9cbc35[_0x4239('0x13')],_0x4d12b9);_0x31da4c(_0x5b4ac5[_0x4239('0x11')](0x1f4,_0x9cbc35[_0x4239('0x13')]));});});}; \ No newline at end of file +var _0x8a48=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45cf08,_0x315051){var _0x506c37=function(_0x29d6b9){while(--_0x29d6b9){_0x45cf08['push'](_0x45cf08['shift']());}};_0x506c37(++_0x315051);}(_0x8a48,0x119));var _0x88a4=function(_0x4a0a61,_0x46dc1b){_0x4a0a61=_0x4a0a61-0x0;var _0x568b99=_0x8a48[_0x4a0a61];return _0x568b99;};'use strict';var _=require(_0x88a4('0x0'));var util=require(_0x88a4('0x1'));var moment=require(_0x88a4('0x2'));var BPromise=require(_0x88a4('0x3'));var rs=require(_0x88a4('0x4'));var fs=require('fs');var Redis=require(_0x88a4('0x5'));var db=require(_0x88a4('0x6'))['db'];var utils=require(_0x88a4('0x7'));var logger=require('../../config/logger')(_0x88a4('0x8'));var config=require(_0x88a4('0x9'));var jayson=require(_0x88a4('0xa'));var client=jayson['client'][_0x88a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x417512,_0x5a6931,_0x44609b){return new BPromise(function(_0x485d12,_0x151f91){return client[_0x88a4('0xc')](_0x417512,_0x44609b)[_0x88a4('0xd')](function(_0x535ce8){logger[_0x88a4('0xe')](_0x88a4('0xf'),_0x5a6931,'request\x20sent');logger[_0x88a4('0x10')](_0x88a4('0x11'),_0x5a6931,_0x88a4('0x12'),JSON[_0x88a4('0x13')](_0x535ce8));if(_0x535ce8[_0x88a4('0x14')]){if(_0x535ce8[_0x88a4('0x14')][_0x88a4('0x15')]===0x1f4){logger[_0x88a4('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5a6931,_0x535ce8['error'][_0x88a4('0x16')]);return _0x151f91(_0x535ce8[_0x88a4('0x14')]['message']);}logger[_0x88a4('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5a6931,_0x535ce8[_0x88a4('0x14')][_0x88a4('0x16')]);return _0x485d12(_0x535ce8[_0x88a4('0x14')]['message']);}else{logger['info'](_0x88a4('0xf'),_0x5a6931,_0x88a4('0x12'));_0x485d12(_0x535ce8[_0x88a4('0x17')][_0x88a4('0x16')]);}})[_0x88a4('0x18')](function(_0x5ab298){logger[_0x88a4('0x14')](_0x88a4('0xf'),_0x5a6931,_0x5ab298);_0x151f91(_0x5ab298);});});}exports[_0x88a4('0x19')]=function(_0x476cb4){var _0x3da5bf=this;return new Promise(function(_0x39e416,_0x124ee9){return db[_0x88a4('0x1a')]['find']({'raw':_0x476cb4[_0x88a4('0x1b')]?_0x476cb4[_0x88a4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x476cb4['options']?_0x476cb4[_0x88a4('0x1b')]['where']||null:null,'attributes':_0x476cb4[_0x88a4('0x1b')]?_0x476cb4['options'][_0x88a4('0x1c')]||null:null,'include':_0x476cb4[_0x88a4('0x1b')]?_0x476cb4[_0x88a4('0x1b')][_0x88a4('0x1d')]?_[_0x88a4('0x1e')](_0x476cb4['options'][_0x88a4('0x1d')],function(_0x400ec2){return{'model':db[_0x400ec2[_0x88a4('0x1f')]],'as':_0x400ec2['as'],'attributes':_0x400ec2[_0x88a4('0x1c')],'include':_0x400ec2[_0x88a4('0x1d')]?_['map'](_0x400ec2[_0x88a4('0x1d')],function(_0x30e08f){return{'model':db[_0x30e08f['model']],'as':_0x30e08f['as'],'attributes':_0x30e08f[_0x88a4('0x1c')],'include':_0x30e08f['include']?_[_0x88a4('0x1e')](_0x30e08f['include'],function(_0x5149b2){return{'model':db[_0x5149b2['model']],'as':_0x5149b2['as'],'attributes':_0x5149b2[_0x88a4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x122985){logger[_0x88a4('0xe')](_0x88a4('0x19'),_0x476cb4);logger[_0x88a4('0x10')](_0x88a4('0x19'),_0x476cb4,JSON[_0x88a4('0x13')](_0x122985));_0x39e416(_0x122985);})[_0x88a4('0x18')](function(_0x112c64){logger[_0x88a4('0x14')](_0x88a4('0x19'),_0x112c64[_0x88a4('0x16')],_0x476cb4);_0x124ee9(_0x3da5bf[_0x88a4('0x14')](0x1f4,_0x112c64[_0x88a4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 54faba3..ab72955 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 _0x2bea=['delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2bea,0x75));var _0xa2be=function(_0x57c4bb,_0x395d85){_0x57c4bb=_0x57c4bb-0x0;var _0x54cc20=_0x2bea[_0x57c4bb];return _0x54cc20;};'use strict';var multer=require('multer');var util=require(_0xa2be('0x0'));var path=require(_0xa2be('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2be('0x2'));var router=express['Router']();var fs_extra=require(_0xa2be('0x3'));var auth=require(_0xa2be('0x4'));var interaction=require(_0xa2be('0x5'));var config=require(_0xa2be('0x6'));var controller=require(_0xa2be('0x7'));router[_0xa2be('0x8')]('/',auth[_0xa2be('0x9')](),controller[_0xa2be('0xa')]);router[_0xa2be('0x8')](_0xa2be('0xb'),auth[_0xa2be('0x9')](),controller[_0xa2be('0xc')]);router[_0xa2be('0xd')]('/',auth[_0xa2be('0x9')](),controller[_0xa2be('0xe')]);router[_0xa2be('0xf')](_0xa2be('0xb'),auth[_0xa2be('0x9')](),controller['update']);router[_0xa2be('0x10')](_0xa2be('0xb'),auth[_0xa2be('0x9')](),controller[_0xa2be('0x11')]);module[_0xa2be('0x12')]=router; \ No newline at end of file +var _0xea76=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','index','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports'];(function(_0x1a7c6b,_0x184353){var _0x5b3784=function(_0xf1aec5){while(--_0xf1aec5){_0x1a7c6b['push'](_0x1a7c6b['shift']());}};_0x5b3784(++_0x184353);}(_0xea76,0x104));var _0x6ea7=function(_0x594f7a,_0x128a04){_0x594f7a=_0x594f7a-0x0;var _0x47d35c=_0xea76[_0x594f7a];return _0x47d35c;};'use strict';var multer=require(_0x6ea7('0x0'));var util=require(_0x6ea7('0x1'));var path=require('path');var timeout=require(_0x6ea7('0x2'));var express=require(_0x6ea7('0x3'));var router=express[_0x6ea7('0x4')]();var fs_extra=require(_0x6ea7('0x5'));var auth=require(_0x6ea7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6ea7('0x7'));var controller=require(_0x6ea7('0x8'));router[_0x6ea7('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ea7('0xa')]);router[_0x6ea7('0x9')]('/:id',auth[_0x6ea7('0xb')](),controller[_0x6ea7('0xc')]);router[_0x6ea7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ea7('0xe')](_0x6ea7('0xf'),auth[_0x6ea7('0xb')](),controller[_0x6ea7('0x10')]);router[_0x6ea7('0x11')](_0x6ea7('0xf'),auth[_0x6ea7('0xb')](),controller[_0x6ea7('0x12')]);module[_0x6ea7('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 180bb53..0b0e814 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 _0x04bc=['production','toString','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','utf8'];(function(_0x1324dd,_0x379837){var _0x4023ab=function(_0x56356b){while(--_0x56356b){_0x1324dd['push'](_0x1324dd['shift']());}};_0x4023ab(++_0x379837);}(_0x04bc,0x87));var _0xc04b=function(_0x43511b,_0x3e2b51){_0x43511b=_0x43511b-0x0;var _0x1fb9de=_0x04bc[_0x43511b];return _0x1fb9de;};'use strict';var Sequelize=require(_0xc04b('0x0'));module[_0xc04b('0x1')]={'name':{'type':Sequelize[_0xc04b('0x2')],'unique':_0xc04b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc04b('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xc04b('0x4')](_0xc04b('0x5')),'get':function(){if(this[_0xc04b('0x6')](_0xc04b('0x7'))){return this[_0xc04b('0x6')](_0xc04b('0x7'))['toString'](_0xc04b('0x8'));}}},'production':{'type':Sequelize[_0xc04b('0x4')](_0xc04b('0x5')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0xc04b('0x9'))[_0xc04b('0xa')]('utf8');}}},'savedAt':{'type':Sequelize[_0xc04b('0xb')]},'publishedAt':{'type':Sequelize[_0xc04b('0xb')]}}; \ No newline at end of file +var _0x3383=['preproduction','toString','BLOB','production','utf8','DATE','sequelize','exports','name','STRING','TEXT','long','getDataValue'];(function(_0x2398de,_0x3dacdf){var _0x2863c7=function(_0x494147){while(--_0x494147){_0x2398de['push'](_0x2398de['shift']());}};_0x2863c7(++_0x3dacdf);}(_0x3383,0x1cd));var _0x3338=function(_0x62ade9,_0x2620bf){_0x62ade9=_0x62ade9-0x0;var _0xdbc98e=_0x3383[_0x62ade9];return _0xdbc98e;};'use strict';var Sequelize=require(_0x3338('0x0'));module[_0x3338('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3338('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3338('0x3')]},'notes':{'type':Sequelize[_0x3338('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x3338('0x5')),'get':function(){if(this[_0x3338('0x6')](_0x3338('0x7'))){return this['getDataValue'](_0x3338('0x7'))[_0x3338('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x3338('0x9')](_0x3338('0x5')),'get':function(){if(this[_0x3338('0x6')](_0x3338('0xa'))){return this[_0x3338('0x6')](_0x3338('0xa'))[_0x3338('0x8')](_0x3338('0xb'));}}},'savedAt':{'type':Sequelize[_0x3338('0xc')]},'publishedAt':{'type':Sequelize[_0x3338('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ed4de16..56d1e96 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 _0x5289=['rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','end','error','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll'];(function(_0x2c8bc7,_0x4ff58d){var _0x3a1da5=function(_0x133eb4){while(--_0x133eb4){_0x2c8bc7['push'](_0x2c8bc7['shift']());}};_0x3a1da5(++_0x4ff58d);}(_0x5289,0x1b2));var _0x9528=function(_0x4fc0fc,_0x36bb55){_0x4fc0fc=_0x4fc0fc-0x0;var _0xf9689=_0x5289[_0x4fc0fc];return _0xf9689;};'use strict';var _=require(_0x9528('0x0'));var Redis=require('ioredis');var qs=require(_0x9528('0x1'));var logger=require(_0x9528('0x2'))(_0x9528('0x3'));var config=require(_0x9528('0x4'));var db=require('../../mysqldb')['db'];config[_0x9528('0x5')]=_[_0x9528('0x6')](config[_0x9528('0x5')],{'host':_0x9528('0x7'),'port':0x18eb});var socket=require(_0x9528('0x8'))(new Redis(config[_0x9528('0x5')]));require(_0x9528('0x9'))[_0x9528('0xa')](socket);function respondWithResult(_0x20ebb5,_0x57dc3){_0x57dc3=_0x57dc3||0xc8;return function(_0x3de24b){if(_0x3de24b){return _0x20ebb5[_0x9528('0xb')](_0x57dc3)[_0x9528('0xc')](_0x3de24b);}};}function respondWithFilteredResult(_0x295b77,_0x3ca5f7){return function(_0x4c55d7){if(_0x4c55d7){var _0x310bec=typeof _0x3ca5f7['offset']===_0x9528('0xd')&&typeof _0x3ca5f7[_0x9528('0xe')]===_0x9528('0xd');var _0x3e1809=_0x4c55d7[_0x9528('0xf')];var _0x112150=_0x310bec?0x0:_0x3ca5f7['offset'];var _0x583089=_0x310bec?_0x4c55d7[_0x9528('0xf')]:_0x3ca5f7[_0x9528('0x10')]+_0x3ca5f7[_0x9528('0xe')];var _0x50d88f;if(_0x583089>=_0x3e1809){_0x583089=_0x3e1809;_0x50d88f=0xc8;}else{_0x50d88f=0xce;}_0x295b77[_0x9528('0xb')](_0x50d88f);return _0x295b77[_0x9528('0x11')]('Content-Range',_0x112150+'-'+_0x583089+'/'+_0x3e1809)['json'](_0x4c55d7);}return null;};}function saveUpdates(_0x24b813){return function(_0x52fe18){if(_0x52fe18){return _0x52fe18[_0x9528('0x12')](_0x24b813)[_0x9528('0x13')](function(_0x5f2e44){return _0x5f2e44;});}return null;};}function removeEntity(_0x2545de){return function(_0xbdf5e2){if(_0xbdf5e2){return _0xbdf5e2[_0x9528('0x14')]()[_0x9528('0x13')](function(){var _0x24834a=_0xbdf5e2[_0x9528('0x15')]({'plain':!![]});var _0x4c4b05=_0x9528('0x16');return db[_0x9528('0x17')]['destroy']({'where':{'type':_0x4c4b05,'resourceId':_0x24834a['id']}})[_0x9528('0x13')](function(){return _0xbdf5e2;});})['then'](function(){var _0x3769b7=new Redis(config[_0x9528('0x5')]);_0x3769b7[_0x9528('0x18')](_0x9528('0x19'),JSON['stringify']({'id':_0xbdf5e2['id'],'deleted':!![]}));})[_0x9528('0x13')](function(){_0x2545de[_0x9528('0xb')](0xcc)[_0x9528('0x1a')]();});}};}function handleEntityNotFound(_0x3f30e1){return function(_0x3b698e){if(!_0x3b698e){_0x3f30e1['sendStatus'](0x194);}return _0x3b698e;};}function handleError(_0x166cca,_0x56788b){_0x56788b=_0x56788b||0x1f4;return function(_0x10cf80){logger[_0x9528('0x1b')](_0x10cf80['stack']);if(_0x10cf80[_0x9528('0x1c')]){delete _0x10cf80[_0x9528('0x1c')];}_0x166cca[_0x9528('0xb')](_0x56788b)['send'](_0x10cf80);};}exports[_0x9528('0x1d')]=function(_0x53fb5c,_0x4ab248){var _0x3a359f={},_0x513494={},_0x2878d1={'count':0x0,'rows':[]};var _0x516a84=_[_0x9528('0x1e')](db[_0x9528('0x1f')][_0x9528('0x20')],function(_0x30d39a){return{'name':_0x30d39a[_0x9528('0x21')],'type':_0x30d39a[_0x9528('0x22')][_0x9528('0x23')]};});_0x513494[_0x9528('0x24')]=_[_0x9528('0x1e')](_0x516a84,_0x9528('0x1c'));_0x513494[_0x9528('0x25')]=_[_0x9528('0x26')](_0x53fb5c[_0x9528('0x25')]);_0x513494[_0x9528('0x27')]=_['intersection'](_0x513494['model'],_0x513494['query']);_0x3a359f['attributes']=_[_0x9528('0x28')](_0x513494[_0x9528('0x24')],qs[_0x9528('0x29')](_0x53fb5c[_0x9528('0x25')][_0x9528('0x29')]));_0x3a359f[_0x9528('0x2a')]=_0x3a359f[_0x9528('0x2a')][_0x9528('0x2b')]?_0x3a359f[_0x9528('0x2a')]:_0x513494[_0x9528('0x24')];if(!_0x53fb5c[_0x9528('0x25')][_0x9528('0x2c')](_0x9528('0x2d'))){_0x3a359f[_0x9528('0xe')]=qs[_0x9528('0xe')](_0x53fb5c[_0x9528('0x25')]['limit']);_0x3a359f[_0x9528('0x10')]=qs[_0x9528('0x10')](_0x53fb5c[_0x9528('0x25')]['offset']);}_0x3a359f[_0x9528('0x2e')]=qs[_0x9528('0x2f')](_0x53fb5c['query']['sort']);_0x3a359f['where']=qs[_0x9528('0x27')](_[_0x9528('0x30')](_0x53fb5c[_0x9528('0x25')],_0x513494[_0x9528('0x27')]),_0x516a84);if(_0x53fb5c['query'][_0x9528('0x31')]){_0x3a359f[_0x9528('0x32')]=_[_0x9528('0x33')](_0x3a359f[_0x9528('0x32')],{'$or':_[_0x9528('0x1e')](_0x516a84,function(_0x5f7e79){if(_0x5f7e79[_0x9528('0x22')]!=='VIRTUAL'){var _0x340b1e={};_0x340b1e[_0x5f7e79[_0x9528('0x1c')]]={'$like':'%'+_0x53fb5c[_0x9528('0x25')][_0x9528('0x31')]+'%'};return _0x340b1e;}})});}_0x3a359f=_['merge']({},_0x3a359f,_0x53fb5c[_0x9528('0x34')]);var _0x3761bf={'where':_0x3a359f[_0x9528('0x32')]};return db[_0x9528('0x1f')][_0x9528('0xf')](_0x3761bf)[_0x9528('0x13')](function(_0x141a2b){_0x2878d1['count']=_0x141a2b;if(_0x53fb5c[_0x9528('0x25')][_0x9528('0x35')]){_0x3a359f[_0x9528('0x36')]=[{'all':!![]}];}return db['SquareProject'][_0x9528('0x37')](_0x3a359f);})['then'](function(_0x6bdf32){_0x2878d1[_0x9528('0x38')]=_0x6bdf32;return _0x2878d1;})['then'](respondWithFilteredResult(_0x4ab248,_0x3a359f))['catch'](handleError(_0x4ab248,null));};exports[_0x9528('0x39')]=function(_0x1cac25,_0x2cc41d){var _0x3b4387={'raw':![],'where':{'id':_0x1cac25[_0x9528('0x3a')]['id']}},_0x4aeeb3={};_0x4aeeb3[_0x9528('0x24')]=_[_0x9528('0x26')](db[_0x9528('0x1f')][_0x9528('0x20')]);_0x4aeeb3[_0x9528('0x25')]=_[_0x9528('0x26')](_0x1cac25['query']);_0x4aeeb3[_0x9528('0x27')]=_[_0x9528('0x28')](_0x4aeeb3[_0x9528('0x24')],_0x4aeeb3['query']);_0x3b4387[_0x9528('0x2a')]=_[_0x9528('0x28')](_0x4aeeb3[_0x9528('0x24')],qs[_0x9528('0x29')](_0x1cac25['query'][_0x9528('0x29')]));_0x3b4387['attributes']=_0x3b4387[_0x9528('0x2a')]['length']?_0x3b4387['attributes']:_0x4aeeb3[_0x9528('0x24')];if(_0x1cac25['query'][_0x9528('0x35')]){_0x3b4387['include']=[{'all':!![]}];}_0x3b4387=_[_0x9528('0x33')]({},_0x3b4387,_0x1cac25['options']);return db['SquareProject'][_0x9528('0x3b')](_0x3b4387)['then'](handleEntityNotFound(_0x2cc41d,null))[_0x9528('0x13')](respondWithResult(_0x2cc41d,null))[_0x9528('0x3c')](handleError(_0x2cc41d,null));};exports[_0x9528('0x3d')]=function(_0x85cb84,_0x2a3f44){return db[_0x9528('0x1f')][_0x9528('0x3d')](_0x85cb84[_0x9528('0x3e')],{})[_0x9528('0x13')](function(_0x175d19){var _0x256c4a=_0x85cb84['user'][_0x9528('0x15')]({'plain':!![]});if(!_0x256c4a)throw new Error(_0x9528('0x3f'));if(_0x256c4a[_0x9528('0x40')]==='user'){var _0x2cf009=_0x175d19[_0x9528('0x15')]({'plain':!![]});var _0x2ce9ee=_0x9528('0x16');return db[_0x9528('0x41')][_0x9528('0x3b')]({'where':{'name':_0x2ce9ee,'userProfileId':_0x256c4a[_0x9528('0x42')]},'raw':!![]})[_0x9528('0x13')](function(_0x58e50e){if(_0x58e50e&&_0x58e50e[_0x9528('0x43')]===0x0){return db[_0x9528('0x17')]['create']({'name':_0x2cf009['name'],'resourceId':_0x2cf009['id'],'type':_0x58e50e[_0x9528('0x1c')],'sectionId':_0x58e50e['id']},{})['then'](function(){return _0x175d19;});}else{return _0x175d19;}})[_0x9528('0x3c')](function(_0x38aaff){logger[_0x9528('0x1b')](_0x9528('0x44'),_0x38aaff);throw _0x38aaff;});}return _0x175d19;})[_0x9528('0x13')](respondWithResult(_0x2a3f44,0xc9))['catch'](handleError(_0x2a3f44,null));};exports[_0x9528('0x12')]=function(_0x1fd533,_0x31634e){if(_0x1fd533['body']['id']){delete _0x1fd533[_0x9528('0x3e')]['id'];}return db['SquareProject'][_0x9528('0x3b')]({'where':{'id':_0x1fd533[_0x9528('0x3a')]['id']}})[_0x9528('0x13')](handleEntityNotFound(_0x31634e,null))[_0x9528('0x13')](saveUpdates(_0x1fd533[_0x9528('0x3e')],null))['then'](function(_0x46278b){if(!_0x46278b)return;var _0x540a87=_0x46278b[_0x9528('0x15')]({'plain':!![]});return _0x540a87;})[_0x9528('0x13')](function(_0x43bc0c){var _0x1b1012=new Redis(config[_0x9528('0x5')]);_0x1b1012[_0x9528('0x18')](_0x9528('0x19'),JSON['stringify'](_[_0x9528('0x30')](_0x43bc0c,['id','name',_0x9528('0x45')])));return _0x43bc0c;})[_0x9528('0x13')](respondWithResult(_0x31634e,null))[_0x9528('0x3c')](handleError(_0x31634e,null));};exports[_0x9528('0x14')]=function(_0x7f36da,_0x118f32){return db['SquareProject']['find']({'where':{'id':_0x7f36da[_0x9528('0x3a')]['id']}})['then'](handleEntityNotFound(_0x118f32,null))[_0x9528('0x13')](removeEntity(_0x118f32,null))[_0x9528('0x3c')](handleError(_0x118f32,null));}; \ No newline at end of file +var _0xc2c2=['./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','SquareProjects','publish','agi','stringify','end','sendStatus','error','send','index','map','SquareProject','type','model','name','query','keys','filters','intersection','attributes','fields','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x32a21c,_0x1dbc37){var _0x1f8e3d=function(_0x807065){while(--_0x807065){_0x32a21c['push'](_0x32a21c['shift']());}};_0x1f8e3d(++_0x1dbc37);}(_0xc2c2,0xff));var _0x2c2c=function(_0x13f7f7,_0x47d731){_0x13f7f7=_0x13f7f7-0x0;var _0x5b9123=_0xc2c2[_0x13f7f7];return _0x5b9123;};'use strict';var _=require(_0x2c2c('0x0'));var Redis=require(_0x2c2c('0x1'));var qs=require(_0x2c2c('0x2'));var logger=require(_0x2c2c('0x3'))('api');var config=require(_0x2c2c('0x4'));var db=require(_0x2c2c('0x5'))['db'];config['redis']=_['defaults'](config[_0x2c2c('0x6')],{'host':_0x2c2c('0x7'),'port':0x18eb});var socket=require(_0x2c2c('0x8'))(new Redis(config[_0x2c2c('0x6')]));require(_0x2c2c('0x9'))[_0x2c2c('0xa')](socket);function respondWithResult(_0x592831,_0x5c9a76){_0x5c9a76=_0x5c9a76||0xc8;return function(_0x28a0aa){if(_0x28a0aa){return _0x592831[_0x2c2c('0xb')](_0x5c9a76)[_0x2c2c('0xc')](_0x28a0aa);}};}function respondWithFilteredResult(_0x24105f,_0x3fe932){return function(_0x2d435){if(_0x2d435){var _0xf419cb=typeof _0x3fe932[_0x2c2c('0xd')]===_0x2c2c('0xe')&&typeof _0x3fe932[_0x2c2c('0xf')]===_0x2c2c('0xe');var _0x20ecbf=_0x2d435[_0x2c2c('0x10')];var _0x3ba97a=_0xf419cb?0x0:_0x3fe932['offset'];var _0x42152d=_0xf419cb?_0x2d435[_0x2c2c('0x10')]:_0x3fe932['offset']+_0x3fe932['limit'];var _0x118705;if(_0x42152d>=_0x20ecbf){_0x42152d=_0x20ecbf;_0x118705=0xc8;}else{_0x118705=0xce;}_0x24105f[_0x2c2c('0xb')](_0x118705);return _0x24105f[_0x2c2c('0x11')](_0x2c2c('0x12'),_0x3ba97a+'-'+_0x42152d+'/'+_0x20ecbf)[_0x2c2c('0xc')](_0x2d435);}return null;};}function saveUpdates(_0x99f854){return function(_0x5a17b5){if(_0x5a17b5){return _0x5a17b5[_0x2c2c('0x13')](_0x99f854)['then'](function(_0x43c582){return _0x43c582;});}return null;};}function removeEntity(_0x32a165){return function(_0x2dd804){if(_0x2dd804){return _0x2dd804[_0x2c2c('0x14')]()[_0x2c2c('0x15')](function(){var _0x20c758=_0x2dd804[_0x2c2c('0x16')]({'plain':!![]});var _0x5f4048=_0x2c2c('0x17');return db['UserProfileResource'][_0x2c2c('0x14')]({'where':{'type':_0x5f4048,'resourceId':_0x20c758['id']}})[_0x2c2c('0x15')](function(){return _0x2dd804;});})[_0x2c2c('0x15')](function(){var _0x41cedf=new Redis(config[_0x2c2c('0x6')]);_0x41cedf[_0x2c2c('0x18')](_0x2c2c('0x19'),JSON[_0x2c2c('0x1a')]({'id':_0x2dd804['id'],'deleted':!![]}));})['then'](function(){_0x32a165[_0x2c2c('0xb')](0xcc)[_0x2c2c('0x1b')]();});}};}function handleEntityNotFound(_0x2daaa){return function(_0x531013){if(!_0x531013){_0x2daaa[_0x2c2c('0x1c')](0x194);}return _0x531013;};}function handleError(_0x3f2055,_0x1e2930){_0x1e2930=_0x1e2930||0x1f4;return function(_0x1a969d){logger[_0x2c2c('0x1d')](_0x1a969d['stack']);if(_0x1a969d['name']){delete _0x1a969d['name'];}_0x3f2055['status'](_0x1e2930)[_0x2c2c('0x1e')](_0x1a969d);};}exports[_0x2c2c('0x1f')]=function(_0x322856,_0x5a3bed){var _0x231e26={},_0x3dd509={},_0x539596={'count':0x0,'rows':[]};var _0x108105=_[_0x2c2c('0x20')](db[_0x2c2c('0x21')]['rawAttributes'],function(_0x3c249c){return{'name':_0x3c249c['fieldName'],'type':_0x3c249c[_0x2c2c('0x22')]['key']};});_0x3dd509[_0x2c2c('0x23')]=_['map'](_0x108105,_0x2c2c('0x24'));_0x3dd509[_0x2c2c('0x25')]=_[_0x2c2c('0x26')](_0x322856['query']);_0x3dd509[_0x2c2c('0x27')]=_[_0x2c2c('0x28')](_0x3dd509[_0x2c2c('0x23')],_0x3dd509['query']);_0x231e26[_0x2c2c('0x29')]=_[_0x2c2c('0x28')](_0x3dd509['model'],qs[_0x2c2c('0x2a')](_0x322856[_0x2c2c('0x25')][_0x2c2c('0x2a')]));_0x231e26[_0x2c2c('0x29')]=_0x231e26[_0x2c2c('0x29')]['length']?_0x231e26['attributes']:_0x3dd509[_0x2c2c('0x23')];if(!_0x322856[_0x2c2c('0x25')]['hasOwnProperty']('nolimit')){_0x231e26[_0x2c2c('0xf')]=qs[_0x2c2c('0xf')](_0x322856[_0x2c2c('0x25')]['limit']);_0x231e26[_0x2c2c('0xd')]=qs[_0x2c2c('0xd')](_0x322856[_0x2c2c('0x25')]['offset']);}_0x231e26['order']=qs[_0x2c2c('0x2b')](_0x322856[_0x2c2c('0x25')][_0x2c2c('0x2b')]);_0x231e26[_0x2c2c('0x2c')]=qs[_0x2c2c('0x27')](_[_0x2c2c('0x2d')](_0x322856[_0x2c2c('0x25')],_0x3dd509['filters']),_0x108105);if(_0x322856['query'][_0x2c2c('0x2e')]){_0x231e26[_0x2c2c('0x2c')]=_['merge'](_0x231e26[_0x2c2c('0x2c')],{'$or':_['map'](_0x108105,function(_0x15ade4){if(_0x15ade4[_0x2c2c('0x22')]!=='VIRTUAL'){var _0x393fb9={};_0x393fb9[_0x15ade4[_0x2c2c('0x24')]]={'$like':'%'+_0x322856['query'][_0x2c2c('0x2e')]+'%'};return _0x393fb9;}})});}_0x231e26=_[_0x2c2c('0x2f')]({},_0x231e26,_0x322856[_0x2c2c('0x30')]);var _0xa03ff2={'where':_0x231e26[_0x2c2c('0x2c')]};return db[_0x2c2c('0x21')]['count'](_0xa03ff2)[_0x2c2c('0x15')](function(_0x46295b){_0x539596['count']=_0x46295b;if(_0x322856[_0x2c2c('0x25')][_0x2c2c('0x31')]){_0x231e26[_0x2c2c('0x32')]=[{'all':!![]}];}return db[_0x2c2c('0x21')][_0x2c2c('0x33')](_0x231e26);})['then'](function(_0x2da405){_0x539596[_0x2c2c('0x34')]=_0x2da405;return _0x539596;})[_0x2c2c('0x15')](respondWithFilteredResult(_0x5a3bed,_0x231e26))[_0x2c2c('0x35')](handleError(_0x5a3bed,null));};exports[_0x2c2c('0x36')]=function(_0x45a157,_0x37a565){var _0x471e7d={'raw':![],'where':{'id':_0x45a157['params']['id']}},_0x3f185e={};_0x3f185e[_0x2c2c('0x23')]=_[_0x2c2c('0x26')](db[_0x2c2c('0x21')][_0x2c2c('0x37')]);_0x3f185e['query']=_[_0x2c2c('0x26')](_0x45a157['query']);_0x3f185e[_0x2c2c('0x27')]=_['intersection'](_0x3f185e['model'],_0x3f185e[_0x2c2c('0x25')]);_0x471e7d[_0x2c2c('0x29')]=_[_0x2c2c('0x28')](_0x3f185e[_0x2c2c('0x23')],qs['fields'](_0x45a157[_0x2c2c('0x25')]['fields']));_0x471e7d[_0x2c2c('0x29')]=_0x471e7d[_0x2c2c('0x29')]['length']?_0x471e7d[_0x2c2c('0x29')]:_0x3f185e[_0x2c2c('0x23')];if(_0x45a157[_0x2c2c('0x25')][_0x2c2c('0x31')]){_0x471e7d[_0x2c2c('0x32')]=[{'all':!![]}];}_0x471e7d=_[_0x2c2c('0x2f')]({},_0x471e7d,_0x45a157['options']);return db[_0x2c2c('0x21')][_0x2c2c('0x38')](_0x471e7d)[_0x2c2c('0x15')](handleEntityNotFound(_0x37a565,null))['then'](respondWithResult(_0x37a565,null))[_0x2c2c('0x35')](handleError(_0x37a565,null));};exports['create']=function(_0x5a6e34,_0x175f02){return db[_0x2c2c('0x21')]['create'](_0x5a6e34[_0x2c2c('0x39')],{})['then'](function(_0x3a4ba5){var _0x5cc1ad=_0x5a6e34[_0x2c2c('0x3a')][_0x2c2c('0x16')]({'plain':!![]});if(!_0x5cc1ad)throw new Error(_0x2c2c('0x3b'));if(_0x5cc1ad[_0x2c2c('0x3c')]===_0x2c2c('0x3a')){var _0x5d7a56=_0x3a4ba5[_0x2c2c('0x16')]({'plain':!![]});var _0x2a19f1=_0x2c2c('0x17');return db['UserProfileSection'][_0x2c2c('0x38')]({'where':{'name':_0x2a19f1,'userProfileId':_0x5cc1ad[_0x2c2c('0x3d')]},'raw':!![]})['then'](function(_0x61fcc4){if(_0x61fcc4&&_0x61fcc4[_0x2c2c('0x3e')]===0x0){return db['UserProfileResource'][_0x2c2c('0x3f')]({'name':_0x5d7a56[_0x2c2c('0x24')],'resourceId':_0x5d7a56['id'],'type':_0x61fcc4[_0x2c2c('0x24')],'sectionId':_0x61fcc4['id']},{})['then'](function(){return _0x3a4ba5;});}else{return _0x3a4ba5;}})[_0x2c2c('0x35')](function(_0x336882){logger['error'](_0x2c2c('0x40'),_0x336882);throw _0x336882;});}return _0x3a4ba5;})[_0x2c2c('0x15')](respondWithResult(_0x175f02,0xc9))[_0x2c2c('0x35')](handleError(_0x175f02,null));};exports[_0x2c2c('0x13')]=function(_0x191158,_0x1433e3){if(_0x191158[_0x2c2c('0x39')]['id']){delete _0x191158[_0x2c2c('0x39')]['id'];}return db[_0x2c2c('0x21')][_0x2c2c('0x38')]({'where':{'id':_0x191158['params']['id']}})[_0x2c2c('0x15')](handleEntityNotFound(_0x1433e3,null))[_0x2c2c('0x15')](saveUpdates(_0x191158[_0x2c2c('0x39')],null))['then'](function(_0x19cdd7){if(!_0x19cdd7)return;var _0x3bf53d=_0x19cdd7[_0x2c2c('0x16')]({'plain':!![]});return _0x3bf53d;})[_0x2c2c('0x15')](function(_0x325c36){var _0x20991a=new Redis(config[_0x2c2c('0x6')]);_0x20991a['publish'](_0x2c2c('0x19'),JSON['stringify'](_[_0x2c2c('0x2d')](_0x325c36,['id',_0x2c2c('0x24'),'production'])));return _0x325c36;})[_0x2c2c('0x15')](respondWithResult(_0x1433e3,null))['catch'](handleError(_0x1433e3,null));};exports['destroy']=function(_0x45c8c2,_0x4cbaf6){return db[_0x2c2c('0x21')][_0x2c2c('0x38')]({'where':{'id':_0x45c8c2[_0x2c2c('0x41')]['id']}})[_0x2c2c('0x15')](handleEntityNotFound(_0x4cbaf6,null))[_0x2c2c('0x15')](removeEntity(_0x4cbaf6,null))[_0x2c2c('0x35')](handleError(_0x4cbaf6,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e290510..198ad9c 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 _0x8ec9=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ec9,0xf4));var _0x98ec=function(_0x159de8,_0x2d2ad9){_0x159de8=_0x159de8-0x0;var _0x1332f8=_0x8ec9[_0x159de8];return _0x1332f8;};'use strict';var EventEmitter=require(_0x98ec('0x0'));var SquareProject=require(_0x98ec('0x1'))['db'][_0x98ec('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x98ec('0x3')](0x0);var events={'afterCreate':_0x98ec('0x4'),'afterUpdate':_0x98ec('0x5'),'afterDestroy':_0x98ec('0x6')};function emitEvent(_0x5ad660){return function(_0x563355,_0x52c8db,_0x2487f2){SquareProjectEvents[_0x98ec('0x7')](_0x5ad660+':'+_0x563355['id'],_0x563355);SquareProjectEvents[_0x98ec('0x7')](_0x5ad660,_0x563355);_0x2487f2(null);};}for(var e in events){if(events[_0x98ec('0x8')](e)){var event=events[e];SquareProject[_0x98ec('0x9')](e,emitEvent(event));}}module[_0x98ec('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0x83fd=['hasOwnProperty','hook','events','../../mysqldb','SquareProject','setMaxListeners','save','remove','emit'];(function(_0x3084f0,_0x2ea711){var _0x20c3dd=function(_0x4b1614){while(--_0x4b1614){_0x3084f0['push'](_0x3084f0['shift']());}};_0x20c3dd(++_0x2ea711);}(_0x83fd,0x107));var _0xd83f=function(_0x572b5f,_0x45c983){_0x572b5f=_0x572b5f-0x0;var _0x1e6f96=_0x83fd[_0x572b5f];return _0x1e6f96;};'use strict';var EventEmitter=require(_0xd83f('0x0'));var SquareProject=require(_0xd83f('0x1'))['db'][_0xd83f('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd83f('0x3')](0x0);var events={'afterCreate':_0xd83f('0x4'),'afterUpdate':'update','afterDestroy':_0xd83f('0x5')};function emitEvent(_0x4fa24b){return function(_0x238cc7,_0x4637cf,_0x550a04){SquareProjectEvents[_0xd83f('0x6')](_0x4fa24b+':'+_0x238cc7['id'],_0x238cc7);SquareProjectEvents[_0xd83f('0x6')](_0x4fa24b,_0x238cc7);_0x550a04(null);};}for(var e in events){if(events[_0xd83f('0x7')](e)){var event=events[e];SquareProject[_0xd83f('0x8')](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 5788820..baf0155 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 _0x97c2=['production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x38857f,_0x54e6bf){var _0x574b0a=function(_0x1f88c9){while(--_0x1f88c9){_0x38857f['push'](_0x38857f['shift']());}};_0x574b0a(++_0x54e6bf);}(_0x97c2,0x17c));var _0x297c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x297c('0x0'));var util=require(_0x297c('0x1'));var logger=require(_0x297c('0x2'))(_0x297c('0x3'));var moment=require(_0x297c('0x4'));var BPromise=require(_0x297c('0x5'));var rp=require(_0x297c('0x6'));var fs=require('fs');var path=require(_0x297c('0x7'));var rimraf=require(_0x297c('0x8'));var config=require(_0x297c('0x9'));var attributes=require(_0x297c('0xa'));module[_0x297c('0xb')]=function(_0x441a28,_0x167486){return _0x441a28[_0x297c('0xc')](_0x297c('0xd'),attributes,{'tableName':_0x297c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x395e7e,_0x1cd2c6,_0x182825){if(_0x395e7e['changed'](_0x297c('0xf'))){_0x395e7e['savedAt']=moment()[_0x297c('0x10')](_0x297c('0x11'));}if(_0x395e7e[_0x297c('0x12')](_0x297c('0x13'))){_0x395e7e[_0x297c('0x14')]=moment()[_0x297c('0x10')](_0x297c('0x11'));}_0x182825(null,_0x395e7e);}}});}; \ No newline at end of file +var _0xa13b=['preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed'];(function(_0x1c27af,_0x5ba365){var _0x53736d=function(_0x1160ce){while(--_0x1160ce){_0x1c27af['push'](_0x1c27af['shift']());}};_0x53736d(++_0x5ba365);}(_0xa13b,0x194));var _0xba13=function(_0x402dbb,_0x22a80f){_0x402dbb=_0x402dbb-0x0;var _0x69b4b=_0xa13b[_0x402dbb];return _0x69b4b;};'use strict';var _=require(_0xba13('0x0'));var util=require(_0xba13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xba13('0x2'));var BPromise=require(_0xba13('0x3'));var rp=require(_0xba13('0x4'));var fs=require('fs');var path=require(_0xba13('0x5'));var rimraf=require(_0xba13('0x6'));var config=require(_0xba13('0x7'));var attributes=require(_0xba13('0x8'));module[_0xba13('0x9')]=function(_0x38af7b,_0x2f4b9a){return _0x38af7b[_0xba13('0xa')](_0xba13('0xb'),attributes,{'tableName':_0xba13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26dff2,_0xce6930,_0x366eea){if(_0x26dff2[_0xba13('0xd')](_0xba13('0xe'))){_0x26dff2['savedAt']=moment()['format'](_0xba13('0xf'));}if(_0x26dff2['changed'](_0xba13('0x10'))){_0x26dff2[_0xba13('0x11')]=moment()[_0xba13('0x12')](_0xba13('0xf'));}_0x366eea(null,_0x26dff2);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 354e38f..58edc51 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 _0x428f=['./squareProject.socket','register','GetSquareProjects','options','raw','where','attributes','limit','include','map','model','then','debug','error','message','SquareProject','find','info','ShowSquareProject','stringify','catch','ioredis','rpc','../../config/environment','redis','socket.io-emitter'];(function(_0x2e0505,_0x5d5cb1){var _0x1a698b=function(_0x5594de){while(--_0x5594de){_0x2e0505['push'](_0x2e0505['shift']());}};_0x1a698b(++_0x5d5cb1);}(_0x428f,0x1b5));var _0xf428=function(_0x1e3a63,_0x1e33f2){_0x1e3a63=_0x1e3a63-0x0;var _0x2a89d6=_0x428f[_0x1e3a63];return _0x2a89d6;};'use strict';var _=require('lodash');var Redis=require(_0xf428('0x0'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xf428('0x1'));var config=require(_0xf428('0x2'));config['redis']=_['defaults'](config[_0xf428('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0xf428('0x4'))(new Redis(config[_0xf428('0x3')]));require(_0xf428('0x5'))[_0xf428('0x6')](socket);exports[_0xf428('0x7')]=function(_0x391063){var _0x108716=this;return new Promise(function(_0x98b74b,_0x113013){return db['SquareProject']['findAll']({'raw':_0x391063['options']?_0x391063[_0xf428('0x8')][_0xf428('0x9')]===undefined?!![]:![]:!![],'where':_0x391063[_0xf428('0x8')]?_0x391063[_0xf428('0x8')][_0xf428('0xa')]||null:null,'attributes':_0x391063[_0xf428('0x8')]?_0x391063[_0xf428('0x8')][_0xf428('0xb')]||null:null,'limit':_0x391063[_0xf428('0x8')]?_0x391063[_0xf428('0x8')][_0xf428('0xc')]||null:null,'include':_0x391063[_0xf428('0x8')]?_0x391063['options'][_0xf428('0xd')]?_[_0xf428('0xe')](_0x391063[_0xf428('0x8')][_0xf428('0xd')],function(_0x4ba98e){return{'model':db[_0x4ba98e[_0xf428('0xf')]],'as':_0x4ba98e['as'],'attributes':_0x4ba98e[_0xf428('0xb')],'include':_0x4ba98e['include']?_['map'](_0x4ba98e[_0xf428('0xd')],function(_0x3a42e7){return{'model':db[_0x3a42e7[_0xf428('0xf')]],'as':_0x3a42e7['as'],'attributes':_0x3a42e7[_0xf428('0xb')],'include':_0x3a42e7['include']?_['map'](_0x3a42e7['include'],function(_0x43ca79){return{'model':db[_0x43ca79[_0xf428('0xf')]],'as':_0x43ca79['as'],'attributes':_0x43ca79[_0xf428('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf428('0x10')](function(_0x2ef0b8){logger['info'](_0xf428('0x7'),_0x391063);logger[_0xf428('0x11')](_0xf428('0x7'),_0x391063,JSON['stringify'](_0x2ef0b8));_0x98b74b(_0x2ef0b8);})['catch'](function(_0x53eb1b){logger[_0xf428('0x12')](_0xf428('0x7'),_0x53eb1b[_0xf428('0x13')],_0x391063);_0x113013(_0x108716[_0xf428('0x12')](0x1f4,_0x53eb1b[_0xf428('0x13')]));});});};exports['ShowSquareProject']=function(_0x2c9eac){var _0x572758=this;return new Promise(function(_0xb9738c,_0x460db4){return db[_0xf428('0x14')][_0xf428('0x15')]({'raw':_0x2c9eac[_0xf428('0x8')]?_0x2c9eac['options'][_0xf428('0x9')]===undefined?!![]:![]:!![],'where':_0x2c9eac[_0xf428('0x8')]?_0x2c9eac[_0xf428('0x8')][_0xf428('0xa')]||null:null,'attributes':_0x2c9eac[_0xf428('0x8')]?_0x2c9eac[_0xf428('0x8')][_0xf428('0xb')]||null:null,'include':_0x2c9eac[_0xf428('0x8')]?_0x2c9eac['options'][_0xf428('0xd')]?_[_0xf428('0xe')](_0x2c9eac[_0xf428('0x8')][_0xf428('0xd')],function(_0x52c79e){return{'model':db[_0x52c79e['model']],'as':_0x52c79e['as'],'attributes':_0x52c79e['attributes'],'include':_0x52c79e[_0xf428('0xd')]?_[_0xf428('0xe')](_0x52c79e['include'],function(_0x381ba8){return{'model':db[_0x381ba8[_0xf428('0xf')]],'as':_0x381ba8['as'],'attributes':_0x381ba8[_0xf428('0xb')],'include':_0x381ba8['include']?_[_0xf428('0xe')](_0x381ba8['include'],function(_0x46b345){return{'model':db[_0x46b345[_0xf428('0xf')]],'as':_0x46b345['as'],'attributes':_0x46b345[_0xf428('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf428('0x10')](function(_0x24cbf0){logger[_0xf428('0x16')](_0xf428('0x17'),_0x2c9eac);logger[_0xf428('0x11')](_0xf428('0x17'),_0x2c9eac,JSON[_0xf428('0x18')](_0x24cbf0));_0xb9738c(_0x24cbf0);})[_0xf428('0x19')](function(_0x499616){logger[_0xf428('0x12')](_0xf428('0x17'),_0x499616[_0xf428('0x13')],_0x2c9eac);_0x460db4(_0x572758[_0xf428('0x12')](0x1f4,_0x499616[_0xf428('0x13')]));});});}; \ No newline at end of file +var _0x179b=['message','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','ShowSquareProject','find'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0x179b,0x12d));var _0xb179=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x179b[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0xb179('0x0'));var Redis=require(_0xb179('0x1'));var db=require(_0xb179('0x2'))['db'];var logger=require(_0xb179('0x3'))('rpc');var config=require(_0xb179('0x4'));config['redis']=_[_0xb179('0x5')](config['redis'],{'host':_0xb179('0x6'),'port':0x18eb});var socket=require(_0xb179('0x7'))(new Redis(config['redis']));require(_0xb179('0x8'))[_0xb179('0x9')](socket);exports[_0xb179('0xa')]=function(_0x15a2b0){var _0x3d1053=this;return new Promise(function(_0x4c10fc,_0x5689f6){return db[_0xb179('0xb')][_0xb179('0xc')]({'raw':_0x15a2b0[_0xb179('0xd')]?_0x15a2b0[_0xb179('0xd')][_0xb179('0xe')]===undefined?!![]:![]:!![],'where':_0x15a2b0[_0xb179('0xd')]?_0x15a2b0[_0xb179('0xd')][_0xb179('0xf')]||null:null,'attributes':_0x15a2b0['options']?_0x15a2b0[_0xb179('0xd')][_0xb179('0x10')]||null:null,'limit':_0x15a2b0[_0xb179('0xd')]?_0x15a2b0[_0xb179('0xd')][_0xb179('0x11')]||null:null,'include':_0x15a2b0[_0xb179('0xd')]?_0x15a2b0['options'][_0xb179('0x12')]?_['map'](_0x15a2b0[_0xb179('0xd')][_0xb179('0x12')],function(_0x1c410a){return{'model':db[_0x1c410a['model']],'as':_0x1c410a['as'],'attributes':_0x1c410a[_0xb179('0x10')],'include':_0x1c410a[_0xb179('0x12')]?_[_0xb179('0x13')](_0x1c410a[_0xb179('0x12')],function(_0x391377){return{'model':db[_0x391377[_0xb179('0x14')]],'as':_0x391377['as'],'attributes':_0x391377['attributes'],'include':_0x391377[_0xb179('0x12')]?_[_0xb179('0x13')](_0x391377[_0xb179('0x12')],function(_0x4fce8e){return{'model':db[_0x4fce8e[_0xb179('0x14')]],'as':_0x4fce8e['as'],'attributes':_0x4fce8e[_0xb179('0x10')]};}):[]};}):[]};}):[]:[]})[_0xb179('0x15')](function(_0x47f0bc){logger[_0xb179('0x16')](_0xb179('0xa'),_0x15a2b0);logger[_0xb179('0x17')]('GetSquareProjects',_0x15a2b0,JSON[_0xb179('0x18')](_0x47f0bc));_0x4c10fc(_0x47f0bc);})[_0xb179('0x19')](function(_0x2cd64a){logger[_0xb179('0x1a')](_0xb179('0xa'),_0x2cd64a['message'],_0x15a2b0);_0x5689f6(_0x3d1053[_0xb179('0x1a')](0x1f4,_0x2cd64a['message']));});});};exports[_0xb179('0x1b')]=function(_0x149350){var _0xe0d152=this;return new Promise(function(_0x311c7a,_0x1a3452){return db[_0xb179('0xb')][_0xb179('0x1c')]({'raw':_0x149350['options']?_0x149350[_0xb179('0xd')][_0xb179('0xe')]===undefined?!![]:![]:!![],'where':_0x149350[_0xb179('0xd')]?_0x149350[_0xb179('0xd')][_0xb179('0xf')]||null:null,'attributes':_0x149350[_0xb179('0xd')]?_0x149350['options'][_0xb179('0x10')]||null:null,'include':_0x149350[_0xb179('0xd')]?_0x149350[_0xb179('0xd')][_0xb179('0x12')]?_['map'](_0x149350['options'][_0xb179('0x12')],function(_0x1b0439){return{'model':db[_0x1b0439[_0xb179('0x14')]],'as':_0x1b0439['as'],'attributes':_0x1b0439['attributes'],'include':_0x1b0439[_0xb179('0x12')]?_['map'](_0x1b0439[_0xb179('0x12')],function(_0x437870){return{'model':db[_0x437870[_0xb179('0x14')]],'as':_0x437870['as'],'attributes':_0x437870[_0xb179('0x10')],'include':_0x437870[_0xb179('0x12')]?_[_0xb179('0x13')](_0x437870[_0xb179('0x12')],function(_0x203dda){return{'model':db[_0x203dda['model']],'as':_0x203dda['as'],'attributes':_0x203dda[_0xb179('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14a2b6){logger[_0xb179('0x16')](_0xb179('0x1b'),_0x149350);logger[_0xb179('0x17')](_0xb179('0x1b'),_0x149350,JSON[_0xb179('0x18')](_0x14a2b6));_0x311c7a(_0x14a2b6);})[_0xb179('0x19')](function(_0x4cd4ca){logger[_0xb179('0x1a')](_0xb179('0x1b'),_0x4cd4ca['message'],_0x149350);_0x1a3452(_0xe0d152['error'](0x1f4,_0x4cd4ca[_0xb179('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 64324c8..fea4cdb 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 _0x094c=['./squareProject.events','remove','update','removeListener','register','length','squareProject:'];(function(_0x136d06,_0x2a2214){var _0x93021c=function(_0x66b423){while(--_0x66b423){_0x136d06['push'](_0x136d06['shift']());}};_0x93021c(++_0x2a2214);}(_0x094c,0x118));var _0xc094=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0x094c[_0x5b8685];return _0xa3ef57;};'use strict';var SquareProjectEvents=require(_0xc094('0x0'));var events=['save',_0xc094('0x1'),_0xc094('0x2')];function createListener(_0x13ddc6,_0x231829){return function(_0x5f0c94){_0x231829['emit'](_0x13ddc6,_0x5f0c94);};}function removeListener(_0xea6e0b,_0x1150f9){return function(){SquareProjectEvents[_0xc094('0x3')](_0xea6e0b,_0x1150f9);};}exports[_0xc094('0x4')]=function(_0x5b2737){for(var _0x2e7ba6=0x0,_0x264b76=events[_0xc094('0x5')];_0x2e7ba6<_0x264b76;_0x2e7ba6++){var _0x5b6fe2=events[_0x2e7ba6];var _0x1093e1=createListener(_0xc094('0x6')+_0x5b6fe2,_0x5b2737);SquareProjectEvents['on'](_0x5b6fe2,_0x1093e1);}}; \ No newline at end of file +var _0xaeaf=['removeListener','length','squareProject:','save','remove','emit'];(function(_0x3fa7aa,_0x31c849){var _0x582cd2=function(_0x143188){while(--_0x143188){_0x3fa7aa['push'](_0x3fa7aa['shift']());}};_0x582cd2(++_0x31c849);}(_0xaeaf,0x1b3));var _0xfaea=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xaeaf[_0x5783f4];return _0x28e380;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xfaea('0x0'),_0xfaea('0x1'),'update'];function createListener(_0x25fc59,_0x45d193){return function(_0x13e78d){_0x45d193[_0xfaea('0x2')](_0x25fc59,_0x13e78d);};}function removeListener(_0x3509b0,_0x1c84f4){return function(){SquareProjectEvents[_0xfaea('0x3')](_0x3509b0,_0x1c84f4);};}exports['register']=function(_0x2bb86d){for(var _0x202c87=0x0,_0x55dcfc=events[_0xfaea('0x4')];_0x202c87<_0x55dcfc;_0x202c87++){var _0x264950=events[_0x202c87];var _0x4951b9=createListener(_0xfaea('0x5')+_0x264950,_0x2bb86d);SquareProjectEvents['on'](_0x264950,_0x4951b9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c085e33..8a89a4c 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x5b07bc,_0x312ae2){var _0x53c8ac=function(_0x558a36){while(--_0x558a36){_0x5b07bc['push'](_0x5b07bc['shift']());}};_0x53c8ac(++_0x312ae2);}(_0x53ec,0x192));var _0xc53e=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0x53ec[_0x5ea2f9];return _0x36e586;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x51e852,_0x100b5f){var _0x42248b=function(_0xdcbaf1){while(--_0xdcbaf1){_0x51e852['push'](_0x51e852['shift']());}};_0x42248b(++_0x100b5f);}(_0xe14b,0x93));var _0xbe14=function(_0x534ca8,_0x43dbd4){_0x534ca8=_0x534ca8-0x0;var _0x32f906=_0xe14b[_0x534ca8];return _0x32f906;};'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['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b0632c9..93678cc 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 _0xd8fb=['STRING','getDataValue','savePath','sequelize','exports'];(function(_0x365b46,_0xe73199){var _0x42616f=function(_0x243a7c){while(--_0x243a7c){_0x365b46['push'](_0x365b46['shift']());}};_0x42616f(++_0xe73199);}(_0xd8fb,0x99));var _0xbd8f=function(_0x28326f,_0x3f1095){_0x28326f=_0x28326f-0x0;var _0x4a24be=_0xd8fb[_0x28326f];return _0x4a24be;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'uniqueid':{'type':Sequelize[_0xbd8f('0x2')]},'callerid':{'type':Sequelize[_0xbd8f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbd8f('0x2')]},'accountcode':{'type':Sequelize[_0xbd8f('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbd8f('0x2')]},'saveName':{'type':Sequelize[_0xbd8f('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xbd8f('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0xf503c4='';var _0x578499=this[_0xbd8f('0x3')](_0xbd8f('0x4'));if(_0x578499){_0xf503c4=_0x578499['substring'](_0x578499['lastIndexOf']('.'));}return _0xf503c4;}}}; \ No newline at end of file +var _0xb458=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x4087bf,_0x433f69){var _0xd70470=function(_0x40aa98){while(--_0x40aa98){_0x4087bf['push'](_0x4087bf['shift']());}};_0xd70470(++_0x433f69);}(_0xb458,0x103));var _0x8b45=function(_0x18c6cd,_0x3d50d2){_0x18c6cd=_0x18c6cd-0x0;var _0x450f8b=_0xb458[_0x18c6cd];return _0x450f8b;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'uniqueid':{'type':Sequelize[_0x8b45('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8b45('0x2')]},'extension':{'type':Sequelize[_0x8b45('0x2')]},'priority':{'type':Sequelize[_0x8b45('0x2')]},'accountcode':{'type':Sequelize[_0x8b45('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x8b45('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x8b45('0x2')]},'format':{'type':Sequelize[_0x8b45('0x3')],'get':function(){var _0x2daa9a='';var _0x3a8ccb=this[_0x8b45('0x4')]('savePath');if(_0x3a8ccb){_0x2daa9a=_0x3a8ccb[_0x8b45('0x5')](_0x3a8ccb[_0x8b45('0x6')]('.'));}return _0x2daa9a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index f996116..75c723e 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 _0x66e6=['status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','where','filter','merge','options','SquareRecording','includeAll','include','rows','catch','show','params','length','create','body','find','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0xb05925,_0x21c9c7){var _0x4e09d6=function(_0x3bec9d){while(--_0x3bec9d){_0xb05925['push'](_0xb05925['shift']());}};_0x4e09d6(++_0x21c9c7);}(_0x66e6,0xa6));var _0x666e=function(_0x491fc2,_0x4d7cff){_0x491fc2=_0x491fc2-0x0;var _0x157e9f=_0x66e6[_0x491fc2];return _0x157e9f;};'use strict';var emlformat=require(_0x666e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x666e('0x1'));var jsonpatch=require(_0x666e('0x2'));var rp=require(_0x666e('0x3'));var moment=require('moment');var BPromise=require(_0x666e('0x4'));var Mustache=require(_0x666e('0x5'));var util=require(_0x666e('0x6'));var path=require(_0x666e('0x7'));var sox=require('sox');var csv=require(_0x666e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x666e('0x9'));var crypto=require(_0x666e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x666e('0xb'));var toCsv=require(_0x666e('0x8'));var querystring=require(_0x666e('0xc'));var Papa=require(_0x666e('0xd'));var Redis=require(_0x666e('0xe'));var authService=require(_0x666e('0xf'));var qs=require(_0x666e('0x10'));var as=require(_0x666e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x666e('0x12'));var utils=require(_0x666e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x666e('0x14'))['db'];function respondWithStatusCode(_0x404c5e,_0x34c830){_0x34c830=_0x34c830||0xcc;return function(_0xfdecbf){if(_0xfdecbf){return _0x404c5e[_0x666e('0x15')](_0x34c830);}return _0x404c5e[_0x666e('0x16')](_0x34c830)['end']();};}function respondWithResult(_0x506a52,_0x2876f2){_0x2876f2=_0x2876f2||0xc8;return function(_0x2f8404){if(_0x2f8404){return _0x506a52[_0x666e('0x16')](_0x2876f2)['json'](_0x2f8404);}};}function respondWithFilteredResult(_0x3b56de,_0x5da30b){return function(_0x2cb85f){if(_0x2cb85f){var _0x4ff58d=typeof _0x5da30b['offset']==='undefined'&&typeof _0x5da30b[_0x666e('0x17')]===_0x666e('0x18');var _0x2fce61=_0x2cb85f[_0x666e('0x19')];var _0x3f5da1=_0x4ff58d?0x0:_0x5da30b[_0x666e('0x1a')];var _0x1b299d=_0x4ff58d?_0x2cb85f[_0x666e('0x19')]:_0x5da30b[_0x666e('0x1a')]+_0x5da30b['limit'];var _0x1d8a61;if(_0x1b299d>=_0x2fce61){_0x1b299d=_0x2fce61;_0x1d8a61=0xc8;}else{_0x1d8a61=0xce;}_0x3b56de['status'](_0x1d8a61);return _0x3b56de[_0x666e('0x1b')](_0x666e('0x1c'),_0x3f5da1+'-'+_0x1b299d+'/'+_0x2fce61)[_0x666e('0x1d')](_0x2cb85f);}return null;};}function patchUpdates(_0x5a154b){return function(_0x268850){try{jsonpatch[_0x666e('0x1e')](_0x268850,_0x5a154b,!![]);}catch(_0x3ffa8e){return BPromise[_0x666e('0x1f')](_0x3ffa8e);}return _0x268850[_0x666e('0x20')]();};}function saveUpdates(_0xf2359b,_0x2c1613){return function(_0x3a37d6){if(_0x3a37d6){return _0x3a37d6[_0x666e('0x21')](_0xf2359b)[_0x666e('0x22')](function(_0x4131fa){return _0x4131fa;});}return null;};}function removeEntity(_0xcf5916,_0x134ace){return function(_0x2e4751){if(_0x2e4751){return _0x2e4751['destroy']()['then'](function(){_0xcf5916[_0x666e('0x16')](0xcc)[_0x666e('0x23')]();});}};}function handleEntityNotFound(_0x3bc18e,_0x5bf517){return function(_0x9f7707){if(!_0x9f7707){_0x3bc18e[_0x666e('0x15')](0x194);}return _0x9f7707;};}function handleError(_0x34e8d3,_0x1a9071){_0x1a9071=_0x1a9071||0x1f4;return function(_0x2a2843){logger[_0x666e('0x24')](_0x2a2843[_0x666e('0x25')]);if(_0x2a2843[_0x666e('0x26')]){delete _0x2a2843[_0x666e('0x26')];}_0x34e8d3[_0x666e('0x16')](_0x1a9071)[_0x666e('0x27')](_0x2a2843);};}exports['index']=function(_0x20eb58,_0x48cb92){var _0x28659b={},_0x58b584={},_0x1ed778={'count':0x0,'rows':[]};var _0x4cd97e=_['map'](db['SquareRecording'][_0x666e('0x28')],function(_0x3477b8){return{'name':_0x3477b8[_0x666e('0x29')],'type':_0x3477b8[_0x666e('0x2a')][_0x666e('0x2b')]};});_0x58b584['model']=_[_0x666e('0x2c')](_0x4cd97e,_0x666e('0x26'));_0x58b584[_0x666e('0x2d')]=_[_0x666e('0x2e')](_0x20eb58[_0x666e('0x2d')]);_0x58b584[_0x666e('0x2f')]=_[_0x666e('0x30')](_0x58b584[_0x666e('0x31')],_0x58b584[_0x666e('0x2d')]);_0x28659b[_0x666e('0x32')]=_[_0x666e('0x30')](_0x58b584[_0x666e('0x31')],qs[_0x666e('0x33')](_0x20eb58[_0x666e('0x2d')][_0x666e('0x33')]));_0x28659b[_0x666e('0x32')]=_0x28659b[_0x666e('0x32')]['length']?_0x28659b[_0x666e('0x32')]:_0x58b584['model'];if(!_0x20eb58[_0x666e('0x2d')][_0x666e('0x34')]('nolimit')){_0x28659b[_0x666e('0x17')]=qs[_0x666e('0x17')](_0x20eb58[_0x666e('0x2d')][_0x666e('0x17')]);_0x28659b['offset']=qs['offset'](_0x20eb58[_0x666e('0x2d')][_0x666e('0x1a')]);}_0x28659b['order']=qs[_0x666e('0x35')](_0x20eb58[_0x666e('0x2d')][_0x666e('0x35')]);_0x28659b['where']=qs['filters'](_[_0x666e('0x36')](_0x20eb58[_0x666e('0x2d')],_0x58b584[_0x666e('0x2f')]),_0x4cd97e);if(_0x20eb58[_0x666e('0x2d')]['filter']){_0x28659b[_0x666e('0x37')]=_['merge'](_0x28659b[_0x666e('0x37')],{'$or':_[_0x666e('0x2c')](_0x4cd97e,function(_0x43b2d4){if(_0x43b2d4[_0x666e('0x2a')]!=='VIRTUAL'){var _0x5864fc={};_0x5864fc[_0x43b2d4[_0x666e('0x26')]]={'$like':'%'+_0x20eb58[_0x666e('0x2d')][_0x666e('0x38')]+'%'};return _0x5864fc;}})});}_0x28659b=_[_0x666e('0x39')]({},_0x28659b,_0x20eb58[_0x666e('0x3a')]);var _0x17c50e={'where':_0x28659b[_0x666e('0x37')]};return db[_0x666e('0x3b')]['count'](_0x17c50e)['then'](function(_0x3ac628){_0x1ed778[_0x666e('0x19')]=_0x3ac628;if(_0x20eb58['query'][_0x666e('0x3c')]){_0x28659b[_0x666e('0x3d')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x28659b);})['then'](function(_0x3ae372){_0x1ed778[_0x666e('0x3e')]=_0x3ae372;return _0x1ed778;})[_0x666e('0x22')](respondWithFilteredResult(_0x48cb92,_0x28659b))[_0x666e('0x3f')](handleError(_0x48cb92,null));};exports[_0x666e('0x40')]=function(_0x39bbcb,_0x346d8d){var _0x115386={'raw':!![],'where':{'id':_0x39bbcb[_0x666e('0x41')]['id']}},_0x2207f5={};_0x2207f5[_0x666e('0x31')]=_[_0x666e('0x2e')](db[_0x666e('0x3b')][_0x666e('0x28')]);_0x2207f5[_0x666e('0x2d')]=_[_0x666e('0x2e')](_0x39bbcb['query']);_0x2207f5[_0x666e('0x2f')]=_[_0x666e('0x30')](_0x2207f5[_0x666e('0x31')],_0x2207f5[_0x666e('0x2d')]);_0x115386[_0x666e('0x32')]=_[_0x666e('0x30')](_0x2207f5[_0x666e('0x31')],qs['fields'](_0x39bbcb[_0x666e('0x2d')][_0x666e('0x33')]));_0x115386['attributes']=_0x115386[_0x666e('0x32')][_0x666e('0x42')]?_0x115386[_0x666e('0x32')]:_0x2207f5[_0x666e('0x31')];if(_0x39bbcb[_0x666e('0x2d')][_0x666e('0x3c')]){_0x115386['include']=[{'all':!![]}];}_0x115386=_[_0x666e('0x39')]({},_0x115386,_0x39bbcb[_0x666e('0x3a')]);return db['SquareRecording']['find'](_0x115386)[_0x666e('0x22')](handleEntityNotFound(_0x346d8d,null))['then'](respondWithResult(_0x346d8d,null))[_0x666e('0x3f')](handleError(_0x346d8d,null));};exports['create']=function(_0x58e004,_0x5a6b5b){return db['SquareRecording'][_0x666e('0x43')](_0x58e004[_0x666e('0x44')],{})['then'](respondWithResult(_0x5a6b5b,0xc9))[_0x666e('0x3f')](handleError(_0x5a6b5b,null));};exports[_0x666e('0x21')]=function(_0x3be833,_0x30a915){if(_0x3be833[_0x666e('0x44')]['id']){delete _0x3be833['body']['id'];}return db[_0x666e('0x3b')][_0x666e('0x45')]({'where':{'id':_0x3be833[_0x666e('0x41')]['id']}})[_0x666e('0x22')](handleEntityNotFound(_0x30a915,null))[_0x666e('0x22')](saveUpdates(_0x3be833[_0x666e('0x44')],null))[_0x666e('0x22')](respondWithResult(_0x30a915,null))[_0x666e('0x3f')](handleError(_0x30a915,null));};exports[_0x666e('0x46')]=function(_0x4826bf,_0x53b0c1,_0x34331c){var _0x4f895d=require(_0x666e('0x47'));var _0xe60cd9=![];var _0x580cd2={};if(_0x4826bf['query']['type']&&_0x4826bf[_0x666e('0x2d')][_0x666e('0x2a')]===_0x666e('0x48')){_0x580cd2[_0x666e('0x48')]=_0x4826bf[_0x666e('0x41')]['id'];}else{_0x580cd2['id']=_0x4826bf[_0x666e('0x41')]['id'];}return db['SquareRecording'][_0x666e('0x45')]({'where':_0x580cd2,'attributes':['id','savePath',_0x666e('0x49')],'raw':!![]})[_0x666e('0x22')](handleEntityNotFound(_0x53b0c1,null))['then'](function(_0x3394c1){if(_0x3394c1){var _0x245bea=_0x3394c1[_0x666e('0x4a')];var _0x53baf2=util[_0x666e('0x4b')](_0x666e('0x4c'),_0x245bea);if(fs[_0x666e('0x4d')](_0x53baf2)){_0xe60cd9=!![];return _0x4f895d['decryptFile'](_0x53baf2,_0x245bea,config[_0x666e('0x4e')][_0x666e('0x4f')])['then'](function(){return _0x3394c1;});}return _0x3394c1;}})['then'](function(_0x1a62e3){if(_0x1a62e3){var _0x3ae2b9=_0x1a62e3[_0x666e('0x4a')];if(!fs[_0x666e('0x4d')](_0x3ae2b9)){throw new db[(_0x666e('0x50'))][(_0x666e('0x51'))](_0x666e('0x52'));}if(_0x1a62e3[_0x666e('0x49')]){return _0x53b0c1[_0x666e('0x46')](_0x3ae2b9,_0x1a62e3[_0x666e('0x49')]+path[_0x666e('0x53')](_0x3ae2b9),function(){if(_0xe60cd9){fs[_0x666e('0x54')](_0x3ae2b9);}});}else{return _0x53b0c1[_0x666e('0x46')](_0x3ae2b9,function(_0xe499f1){if(_0xe60cd9){fs[_0x666e('0x54')](_0x3ae2b9);}});}}})[_0x666e('0x3f')](function(_0x53b3bf){if(_0x53b3bf[_0x666e('0x55')]==='SquareRecording\x20not\x20found'){_0x53b0c1[_0x666e('0x16')](0x194)['send'](_0x666e('0x56'));}else{return handleError(_0x53b0c1,null);}});};exports[_0x666e('0x57')]=function(_0x2fff32,_0x1645cc){return db['SquareRecording'][_0x666e('0x45')]({'where':{'id':_0x2fff32[_0x666e('0x41')]['id']}})['then'](function(_0x26f150){if(_['isNil'](_0x26f150)){throw new ReferenceError(_0x666e('0x58'));}return _0x26f150;})[_0x666e('0x22')](function(_0x2817d8){var _0x509a70=_0x2817d8['savePath'];logger[_0x666e('0x59')](_0x666e('0x5a'),_0x509a70);if(!_[_0x666e('0x5b')](_0x2817d8[_0x666e('0x4a')])&&fs[_0x666e('0x4d')](_0x509a70)){logger[_0x666e('0x59')](_0x666e('0x5c')+_0x509a70+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x666e('0x5d')](_0x509a70);}_0x509a70=_0x509a70+'.cypher';if(!_['isNil'](_0x2817d8[_0x666e('0x4a')])&&fs['existsSync'](_0x509a70)){logger[_0x666e('0x59')]('File:\x20\x22'+_0x509a70+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x666e('0x5d')](_0x509a70);}return _0x2817d8;})[_0x666e('0x22')](function(_0xc474ee){if(!_0xc474ee)throw new InternalError();return _0xc474ee[_0x666e('0x57')]();})[_0x666e('0x22')](function(){_0x1645cc[_0x666e('0x16')](0xcc)['end']();})[_0x666e('0x3f')](handleError(_0x1645cc,null));}; \ No newline at end of file +var _0x371d=['filters','intersection','query','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','send','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','name','index','map','SquareRecording','rawAttributes','fieldName','type','model','keys'];(function(_0x581f8e,_0x5617cb){var _0x18aec=function(_0x4536c7){while(--_0x4536c7){_0x581f8e['push'](_0x581f8e['shift']());}};_0x18aec(++_0x5617cb);}(_0x371d,0x196));var _0xd371=function(_0x392c5f,_0x219854){_0x392c5f=_0x392c5f-0x0;var _0x432918=_0x371d[_0x392c5f];return _0x432918;};'use strict';var emlformat=require(_0xd371('0x0'));var rimraf=require(_0xd371('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd371('0x2'));var moment=require(_0xd371('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd371('0x4'));var util=require(_0xd371('0x5'));var path=require('path');var sox=require(_0xd371('0x6'));var csv=require(_0xd371('0x7'));var ejs=require(_0xd371('0x8'));var fs=require('fs');var fs_extra=require(_0xd371('0x9'));var _=require(_0xd371('0xa'));var squel=require(_0xd371('0xb'));var crypto=require(_0xd371('0xc'));var jsforce=require(_0xd371('0xd'));var deskjs=require(_0xd371('0xe'));var toCsv=require(_0xd371('0x7'));var querystring=require(_0xd371('0xf'));var Papa=require(_0xd371('0x10'));var Redis=require(_0xd371('0x11'));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(_0xd371('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd371('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd371('0x14'))['db'];function respondWithStatusCode(_0x26bdb9,_0x30a2b4){_0x30a2b4=_0x30a2b4||0xcc;return function(_0x565fec){if(_0x565fec){return _0x26bdb9[_0xd371('0x15')](_0x30a2b4);}return _0x26bdb9['status'](_0x30a2b4)['end']();};}function respondWithResult(_0x23161f,_0x5d2812){_0x5d2812=_0x5d2812||0xc8;return function(_0x1f5cee){if(_0x1f5cee){return _0x23161f[_0xd371('0x16')](_0x5d2812)['json'](_0x1f5cee);}};}function respondWithFilteredResult(_0x53d29b,_0x2982a4){return function(_0x4fad33){if(_0x4fad33){var _0x3f02b7=typeof _0x2982a4[_0xd371('0x17')]===_0xd371('0x18')&&typeof _0x2982a4[_0xd371('0x19')]===_0xd371('0x18');var _0x42710c=_0x4fad33['count'];var _0x56014e=_0x3f02b7?0x0:_0x2982a4[_0xd371('0x17')];var _0x550826=_0x3f02b7?_0x4fad33[_0xd371('0x1a')]:_0x2982a4[_0xd371('0x17')]+_0x2982a4[_0xd371('0x19')];var _0x299608;if(_0x550826>=_0x42710c){_0x550826=_0x42710c;_0x299608=0xc8;}else{_0x299608=0xce;}_0x53d29b['status'](_0x299608);return _0x53d29b[_0xd371('0x1b')]('Content-Range',_0x56014e+'-'+_0x550826+'/'+_0x42710c)['json'](_0x4fad33);}return null;};}function patchUpdates(_0x24d2ce){return function(_0x32f166){try{jsonpatch[_0xd371('0x1c')](_0x32f166,_0x24d2ce,!![]);}catch(_0x2a1a92){return BPromise[_0xd371('0x1d')](_0x2a1a92);}return _0x32f166[_0xd371('0x1e')]();};}function saveUpdates(_0x460070,_0x30cc23){return function(_0x2c2454){if(_0x2c2454){return _0x2c2454[_0xd371('0x1f')](_0x460070)[_0xd371('0x20')](function(_0x516888){return _0x516888;});}return null;};}function removeEntity(_0x129cec,_0x3ad0a8){return function(_0xff198){if(_0xff198){return _0xff198[_0xd371('0x21')]()[_0xd371('0x20')](function(){_0x129cec[_0xd371('0x16')](0xcc)[_0xd371('0x22')]();});}};}function handleEntityNotFound(_0x472428,_0xec365a){return function(_0x8f7575){if(!_0x8f7575){_0x472428[_0xd371('0x15')](0x194);}return _0x8f7575;};}function handleError(_0x21e20b,_0x373b72){_0x373b72=_0x373b72||0x1f4;return function(_0x35bb61){logger['error'](_0x35bb61['stack']);if(_0x35bb61[_0xd371('0x23')]){delete _0x35bb61[_0xd371('0x23')];}_0x21e20b[_0xd371('0x16')](_0x373b72)['send'](_0x35bb61);};}exports[_0xd371('0x24')]=function(_0x115e0f,_0x2c2804){var _0x421583={},_0x568be1={},_0x43ebac={'count':0x0,'rows':[]};var _0x4c49f3=_[_0xd371('0x25')](db[_0xd371('0x26')][_0xd371('0x27')],function(_0x498c5a){return{'name':_0x498c5a[_0xd371('0x28')],'type':_0x498c5a[_0xd371('0x29')]['key']};});_0x568be1[_0xd371('0x2a')]=_[_0xd371('0x25')](_0x4c49f3,_0xd371('0x23'));_0x568be1['query']=_[_0xd371('0x2b')](_0x115e0f['query']);_0x568be1[_0xd371('0x2c')]=_[_0xd371('0x2d')](_0x568be1[_0xd371('0x2a')],_0x568be1[_0xd371('0x2e')]);_0x421583['attributes']=_[_0xd371('0x2d')](_0x568be1['model'],qs[_0xd371('0x2f')](_0x115e0f['query'][_0xd371('0x2f')]));_0x421583[_0xd371('0x30')]=_0x421583[_0xd371('0x30')][_0xd371('0x31')]?_0x421583[_0xd371('0x30')]:_0x568be1[_0xd371('0x2a')];if(!_0x115e0f[_0xd371('0x2e')][_0xd371('0x32')]('nolimit')){_0x421583[_0xd371('0x19')]=qs['limit'](_0x115e0f['query'][_0xd371('0x19')]);_0x421583[_0xd371('0x17')]=qs[_0xd371('0x17')](_0x115e0f[_0xd371('0x2e')][_0xd371('0x17')]);}_0x421583[_0xd371('0x33')]=qs['sort'](_0x115e0f['query']['sort']);_0x421583[_0xd371('0x34')]=qs[_0xd371('0x2c')](_[_0xd371('0x35')](_0x115e0f[_0xd371('0x2e')],_0x568be1[_0xd371('0x2c')]),_0x4c49f3);if(_0x115e0f[_0xd371('0x2e')][_0xd371('0x36')]){_0x421583[_0xd371('0x34')]=_[_0xd371('0x37')](_0x421583[_0xd371('0x34')],{'$or':_[_0xd371('0x25')](_0x4c49f3,function(_0x1b9257){if(_0x1b9257[_0xd371('0x29')]!=='VIRTUAL'){var _0x5c48b8={};_0x5c48b8[_0x1b9257[_0xd371('0x23')]]={'$like':'%'+_0x115e0f['query']['filter']+'%'};return _0x5c48b8;}})});}_0x421583=_[_0xd371('0x37')]({},_0x421583,_0x115e0f['options']);var _0x438677={'where':_0x421583['where']};return db[_0xd371('0x26')][_0xd371('0x1a')](_0x438677)[_0xd371('0x20')](function(_0x10f244){_0x43ebac['count']=_0x10f244;if(_0x115e0f[_0xd371('0x2e')][_0xd371('0x38')]){_0x421583[_0xd371('0x39')]=[{'all':!![]}];}return db['SquareRecording'][_0xd371('0x3a')](_0x421583);})[_0xd371('0x20')](function(_0x286909){_0x43ebac['rows']=_0x286909;return _0x43ebac;})[_0xd371('0x20')](respondWithFilteredResult(_0x2c2804,_0x421583))[_0xd371('0x3b')](handleError(_0x2c2804,null));};exports[_0xd371('0x3c')]=function(_0x335dad,_0x1b548d){var _0x249d76={'raw':!![],'where':{'id':_0x335dad[_0xd371('0x3d')]['id']}},_0x359205={};_0x359205[_0xd371('0x2a')]=_[_0xd371('0x2b')](db['SquareRecording'][_0xd371('0x27')]);_0x359205[_0xd371('0x2e')]=_[_0xd371('0x2b')](_0x335dad['query']);_0x359205[_0xd371('0x2c')]=_['intersection'](_0x359205['model'],_0x359205['query']);_0x249d76[_0xd371('0x30')]=_['intersection'](_0x359205[_0xd371('0x2a')],qs['fields'](_0x335dad[_0xd371('0x2e')]['fields']));_0x249d76[_0xd371('0x30')]=_0x249d76['attributes'][_0xd371('0x31')]?_0x249d76[_0xd371('0x30')]:_0x359205['model'];if(_0x335dad[_0xd371('0x2e')][_0xd371('0x38')]){_0x249d76[_0xd371('0x39')]=[{'all':!![]}];}_0x249d76=_[_0xd371('0x37')]({},_0x249d76,_0x335dad[_0xd371('0x3e')]);return db[_0xd371('0x26')][_0xd371('0x3f')](_0x249d76)[_0xd371('0x20')](handleEntityNotFound(_0x1b548d,null))[_0xd371('0x20')](respondWithResult(_0x1b548d,null))['catch'](handleError(_0x1b548d,null));};exports[_0xd371('0x40')]=function(_0x58a610,_0x31429c){return db[_0xd371('0x26')][_0xd371('0x40')](_0x58a610[_0xd371('0x41')],{})[_0xd371('0x20')](respondWithResult(_0x31429c,0xc9))[_0xd371('0x3b')](handleError(_0x31429c,null));};exports[_0xd371('0x1f')]=function(_0x32d638,_0x176cd4){if(_0x32d638[_0xd371('0x41')]['id']){delete _0x32d638[_0xd371('0x41')]['id'];}return db['SquareRecording'][_0xd371('0x3f')]({'where':{'id':_0x32d638[_0xd371('0x3d')]['id']}})[_0xd371('0x20')](handleEntityNotFound(_0x176cd4,null))[_0xd371('0x20')](saveUpdates(_0x32d638[_0xd371('0x41')],null))[_0xd371('0x20')](respondWithResult(_0x176cd4,null))['catch'](handleError(_0x176cd4,null));};exports['download']=function(_0x17d047,_0x39e440,_0x488d7a){var _0x4149a3=require(_0xd371('0x42'));var _0xa60d8=![];var _0x112f61={};if(_0x17d047[_0xd371('0x2e')][_0xd371('0x29')]&&_0x17d047['query'][_0xd371('0x29')]===_0xd371('0x43')){_0x112f61[_0xd371('0x43')]=_0x17d047['params']['id'];}else{_0x112f61['id']=_0x17d047[_0xd371('0x3d')]['id'];}return db[_0xd371('0x26')][_0xd371('0x3f')]({'where':_0x112f61,'attributes':['id',_0xd371('0x44'),_0xd371('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x39e440,null))['then'](function(_0x5d6a1b){if(_0x5d6a1b){var _0x4cefc1=_0x5d6a1b[_0xd371('0x44')];var _0x3ed84f=util[_0xd371('0x46')](_0xd371('0x47'),_0x4cefc1);if(fs[_0xd371('0x48')](_0x3ed84f)){_0xa60d8=!![];return _0x4149a3[_0xd371('0x49')](_0x3ed84f,_0x4cefc1,config['secrets']['recording'])['then'](function(){return _0x5d6a1b;});}return _0x5d6a1b;}})[_0xd371('0x20')](function(_0x5be092){if(_0x5be092){var _0x4fbdbf=_0x5be092[_0xd371('0x44')];if(!fs[_0xd371('0x48')](_0x4fbdbf)){throw new db[(_0xd371('0x4a'))][(_0xd371('0x4b'))](_0xd371('0x4c'));}if(_0x5be092[_0xd371('0x45')]){return _0x39e440[_0xd371('0x4d')](_0x4fbdbf,_0x5be092[_0xd371('0x45')]+path[_0xd371('0x4e')](_0x4fbdbf),function(){if(_0xa60d8){fs[_0xd371('0x4f')](_0x4fbdbf);}});}else{return _0x39e440['download'](_0x4fbdbf,function(_0x65a5bf){if(_0xa60d8){fs[_0xd371('0x4f')](_0x4fbdbf);}});}}})[_0xd371('0x3b')](function(_0x295717){if(_0x295717[_0xd371('0x50')]==='SquareRecording\x20not\x20found'){_0x39e440['status'](0x194)[_0xd371('0x51')]('Not\x20found');}else{return handleError(_0x39e440,null);}});};exports[_0xd371('0x21')]=function(_0x2cff87,_0x5727c5){return db[_0xd371('0x26')][_0xd371('0x3f')]({'where':{'id':_0x2cff87[_0xd371('0x3d')]['id']}})[_0xd371('0x20')](function(_0x43ad24){if(_['isNil'](_0x43ad24)){throw new ReferenceError(_0xd371('0x52'));}return _0x43ad24;})['then'](function(_0x4be541){var _0x430def=_0x4be541[_0xd371('0x44')];logger[_0xd371('0x53')](_0xd371('0x54'),_0x430def);if(!_[_0xd371('0x55')](_0x4be541[_0xd371('0x44')])&&fs[_0xd371('0x48')](_0x430def)){logger['info'](_0xd371('0x56')+_0x430def+_0xd371('0x57'));fs[_0xd371('0x58')](_0x430def);}_0x430def=_0x430def+_0xd371('0x59');if(!_[_0xd371('0x55')](_0x4be541[_0xd371('0x44')])&&fs[_0xd371('0x48')](_0x430def)){logger[_0xd371('0x53')]('File:\x20\x22'+_0x430def+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd371('0x58')](_0x430def);}return _0x4be541;})[_0xd371('0x20')](function(_0xe13e43){if(!_0xe13e43)throw new InternalError();return _0xe13e43[_0xd371('0x21')]();})[_0xd371('0x20')](function(){_0x5727c5[_0xd371('0x16')](0xcc)['end']();})['catch'](handleError(_0x5727c5,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c08e54f..81dc28d 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 _0xb90a=['../../config/environment','./squareRecording.attributes','define','SquareRecording','lodash','util','api'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xb90a,0x12a));var _0xab90=function(_0x206aec,_0x3a5d60){_0x206aec=_0x206aec-0x0;var _0x369042=_0xb90a[_0x206aec];return _0x369042;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var logger=require('../../config/logger')(_0xab90('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('rimraf');var config=require(_0xab90('0x3'));var attributes=require(_0xab90('0x4'));module['exports']=function(_0x5e0540,_0xf36407){return _0x5e0540[_0xab90('0x5')](_0xab90('0x6'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4744=['define','SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x4744,0x107));var _0x4474=function(_0x2e161b,_0x53debc){_0x2e161b=_0x2e161b-0x0;var _0x3ab170=_0x4744[_0x2e161b];return _0x3ab170;};'use strict';var _=require(_0x4474('0x0'));var util=require(_0x4474('0x1'));var logger=require('../../config/logger')(_0x4474('0x2'));var moment=require(_0x4474('0x3'));var BPromise=require(_0x4474('0x4'));var rp=require(_0x4474('0x5'));var fs=require('fs');var path=require(_0x4474('0x6'));var rimraf=require(_0x4474('0x7'));var config=require(_0x4474('0x8'));var attributes=require(_0x4474('0x9'));module['exports']=function(_0x55df3c,_0x3042b9){return _0x55df3c[_0x4474('0xa')](_0x4474('0xb'),attributes,{'tableName':_0x4474('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index ba5a5d7..057b282 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 _0xd152=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','options','raw','util','randomstring'];(function(_0x4b0167,_0x154254){var _0x635b82=function(_0x3ecb62){while(--_0x3ecb62){_0x4b0167['push'](_0x4b0167['shift']());}};_0x635b82(++_0x154254);}(_0xd152,0x66));var _0x2d15=function(_0x2bdc0b,_0x487dae){_0x2bdc0b=_0x2bdc0b-0x0;var _0x2a8794=_0xd152[_0x2bdc0b];return _0x2a8794;};'use strict';var _=require('lodash');var util=require(_0x2d15('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d15('0x1'));var fs=require('fs');var Redis=require(_0x2d15('0x2'));var db=require(_0x2d15('0x3'))['db'];var utils=require(_0x2d15('0x4'));var logger=require(_0x2d15('0x5'))('rpc');var config=require(_0x2d15('0x6'));var jayson=require(_0x2d15('0x7'));var client=jayson[_0x2d15('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10fe47,_0x1cd3b2,_0x39665e){return new BPromise(function(_0x304e48,_0x4d6218){return client[_0x2d15('0x9')](_0x10fe47,_0x39665e)[_0x2d15('0xa')](function(_0x18d6d3){logger[_0x2d15('0xb')](_0x2d15('0xc'),_0x1cd3b2,_0x2d15('0xd'));logger[_0x2d15('0xe')](_0x2d15('0xf'),_0x1cd3b2,_0x2d15('0xd'),JSON[_0x2d15('0x10')](_0x18d6d3));if(_0x18d6d3[_0x2d15('0x11')]){if(_0x18d6d3['error'][_0x2d15('0x12')]===0x1f4){logger[_0x2d15('0x11')](_0x2d15('0xc'),_0x1cd3b2,_0x18d6d3['error'][_0x2d15('0x13')]);return _0x4d6218(_0x18d6d3[_0x2d15('0x11')][_0x2d15('0x13')]);}logger[_0x2d15('0x11')](_0x2d15('0xc'),_0x1cd3b2,_0x18d6d3['error'][_0x2d15('0x13')]);return _0x304e48(_0x18d6d3[_0x2d15('0x11')][_0x2d15('0x13')]);}else{logger[_0x2d15('0xb')](_0x2d15('0xc'),_0x1cd3b2,_0x2d15('0xd'));_0x304e48(_0x18d6d3[_0x2d15('0x14')][_0x2d15('0x13')]);}})[_0x2d15('0x15')](function(_0x560e10){logger['error']('SquareRecording,\x20%s,\x20%s',_0x1cd3b2,_0x560e10);_0x4d6218(_0x560e10);});});}exports[_0x2d15('0x16')]=function(_0x5632ba){var _0xdeac07=this;return new Promise(function(_0x267334,_0x203cae){return db[_0x2d15('0x17')]['create'](_0x5632ba['body'],{'raw':_0x5632ba[_0x2d15('0x18')]?_0x5632ba['options'][_0x2d15('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x33771d){logger[_0x2d15('0xb')](_0x2d15('0x16'),_0x5632ba);logger['debug']('CreateSquareRecording',_0x5632ba,JSON[_0x2d15('0x10')](_0x33771d));_0x267334(_0x33771d);})[_0x2d15('0x15')](function(_0x317219){logger[_0x2d15('0x11')](_0x2d15('0x16'),_0x317219[_0x2d15('0x13')],_0x5632ba);_0x203cae(_0xdeac07[_0x2d15('0x11')](0x1f4,_0x317219[_0x2d15('0x13')]));});});}; \ No newline at end of file +var _0x9fa9=['message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','debug','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38f4da,_0x3a1583){var _0x497613=function(_0x563142){while(--_0x563142){_0x38f4da['push'](_0x38f4da['shift']());}};_0x497613(++_0x3a1583);}(_0x9fa9,0xb2));var _0x99fa=function(_0x34f350,_0x1750d5){_0x34f350=_0x34f350-0x0;var _0x45024e=_0x9fa9[_0x34f350];return _0x45024e;};'use strict';var _=require('lodash');var util=require(_0x99fa('0x0'));var moment=require(_0x99fa('0x1'));var BPromise=require('bluebird');var rs=require(_0x99fa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99fa('0x3'))['db'];var utils=require(_0x99fa('0x4'));var logger=require(_0x99fa('0x5'))(_0x99fa('0x6'));var config=require(_0x99fa('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x99fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44062b,_0x120f74,_0x607b16){return new BPromise(function(_0x50be2d,_0x406f42){return client[_0x99fa('0x9')](_0x44062b,_0x607b16)[_0x99fa('0xa')](function(_0x41b8e2){logger[_0x99fa('0xb')](_0x99fa('0xc'),_0x120f74,_0x99fa('0xd'));logger['debug'](_0x99fa('0xe'),_0x120f74,'request\x20sent',JSON[_0x99fa('0xf')](_0x41b8e2));if(_0x41b8e2[_0x99fa('0x10')]){if(_0x41b8e2['error'][_0x99fa('0x11')]===0x1f4){logger[_0x99fa('0x10')]('SquareRecording,\x20%s,\x20%s',_0x120f74,_0x41b8e2['error']['message']);return _0x406f42(_0x41b8e2['error']['message']);}logger['error'](_0x99fa('0xc'),_0x120f74,_0x41b8e2[_0x99fa('0x10')][_0x99fa('0x12')]);return _0x50be2d(_0x41b8e2[_0x99fa('0x10')][_0x99fa('0x12')]);}else{logger[_0x99fa('0xb')](_0x99fa('0xc'),_0x120f74,_0x99fa('0xd'));_0x50be2d(_0x41b8e2[_0x99fa('0x13')][_0x99fa('0x12')]);}})['catch'](function(_0x476738){logger[_0x99fa('0x10')](_0x99fa('0xc'),_0x120f74,_0x476738);_0x406f42(_0x476738);});});}exports[_0x99fa('0x14')]=function(_0x2a4f9f){var _0x10a3e7=this;return new Promise(function(_0x4e8b5f,_0x5df8bc){return db[_0x99fa('0x15')][_0x99fa('0x16')](_0x2a4f9f[_0x99fa('0x17')],{'raw':_0x2a4f9f[_0x99fa('0x18')]?_0x2a4f9f['options'][_0x99fa('0x19')]===undefined?!![]:![]:!![]})[_0x99fa('0xa')](function(_0x59ffbc){logger[_0x99fa('0xb')](_0x99fa('0x14'),_0x2a4f9f);logger[_0x99fa('0x1a')](_0x99fa('0x14'),_0x2a4f9f,JSON[_0x99fa('0xf')](_0x59ffbc));_0x4e8b5f(_0x59ffbc);})[_0x99fa('0x1b')](function(_0x1d172f){logger[_0x99fa('0x10')](_0x99fa('0x14'),_0x1d172f[_0x99fa('0x12')],_0x2a4f9f);_0x5df8bc(_0x10a3e7['error'](0x1f4,_0x1d172f[_0x99fa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index dfcbdef..2066a07 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x28d4d0,_0x59656f){var _0x11d661=function(_0x227d63){while(--_0x227d63){_0x28d4d0['push'](_0x28d4d0['shift']());}};_0x11d661(++_0x59656f);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_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 8615664..f3a9604 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 _0xdc96=['DATE','BOOLEAN','exports','STRING'];(function(_0x5a4e85,_0x30ba85){var _0x209aa7=function(_0x287c43){while(--_0x287c43){_0x5a4e85['push'](_0x5a4e85['shift']());}};_0x209aa7(++_0x30ba85);}(_0xdc96,0x1da));var _0x6dc9=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xdc96[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require('sequelize');module[_0x6dc9('0x0')]={'network':{'type':Sequelize[_0x6dc9('0x1')]},'network_script':{'type':Sequelize[_0x6dc9('0x1')]},'request':{'type':Sequelize[_0x6dc9('0x1')]},'channel':{'type':Sequelize[_0x6dc9('0x1')]},'language':{'type':Sequelize[_0x6dc9('0x1')]},'type':{'type':Sequelize[_0x6dc9('0x1')]},'uniqueid':{'type':Sequelize[_0x6dc9('0x1')]},'version':{'type':Sequelize[_0x6dc9('0x1')]},'callerid':{'type':Sequelize[_0x6dc9('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x6dc9('0x1')]},'callingani2':{'type':Sequelize[_0x6dc9('0x1')]},'callington':{'type':Sequelize[_0x6dc9('0x1')]},'callingtns':{'type':Sequelize[_0x6dc9('0x1')]},'dnid':{'type':Sequelize[_0x6dc9('0x1')]},'rdnis':{'type':Sequelize[_0x6dc9('0x1')]},'context':{'type':Sequelize[_0x6dc9('0x1')]},'extension':{'type':Sequelize[_0x6dc9('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x6dc9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x6dc9('0x1')]},'project_name':{'type':Sequelize[_0x6dc9('0x1')]},'joinAt':{'type':Sequelize[_0x6dc9('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x6dc9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0e94=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x1d654f,_0x9cf763){var _0x5416d5=function(_0x3d6085){while(--_0x3d6085){_0x1d654f['push'](_0x1d654f['shift']());}};_0x5416d5(++_0x9cf763);}(_0x0e94,0x88));var _0x40e9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0e94[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x40e9('0x0'));module[_0x40e9('0x1')]={'network':{'type':Sequelize[_0x40e9('0x2')]},'network_script':{'type':Sequelize[_0x40e9('0x2')]},'request':{'type':Sequelize[_0x40e9('0x2')]},'channel':{'type':Sequelize[_0x40e9('0x2')]},'language':{'type':Sequelize[_0x40e9('0x2')]},'type':{'type':Sequelize[_0x40e9('0x2')]},'uniqueid':{'type':Sequelize[_0x40e9('0x2')]},'version':{'type':Sequelize[_0x40e9('0x2')]},'callerid':{'type':Sequelize[_0x40e9('0x2')]},'calleridname':{'type':Sequelize[_0x40e9('0x2')]},'callingpres':{'type':Sequelize[_0x40e9('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x40e9('0x2')]},'callingtns':{'type':Sequelize[_0x40e9('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x40e9('0x2')]},'context':{'type':Sequelize[_0x40e9('0x2')]},'extension':{'type':Sequelize[_0x40e9('0x2')]},'priority':{'type':Sequelize[_0x40e9('0x2')]},'enhanced':{'type':Sequelize[_0x40e9('0x2')]},'accountcode':{'type':Sequelize[_0x40e9('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x40e9('0x2')]},'joinAt':{'type':Sequelize[_0x40e9('0x3')]},'leaveAt':{'type':Sequelize[_0x40e9('0x3')]},'bot':{'type':Sequelize[_0x40e9('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 5b103bc..b51bfff 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 _0xd3f7=['map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','SquareReport','includeAll','include','findAll','rows','params','keys','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd3f7,0xbb));var _0x7d3f=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xd3f7[_0xc77819];return _0x1c9434;};'use strict';var emlformat=require(_0x7d3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d3f('0x1'));var jsonpatch=require(_0x7d3f('0x2'));var rp=require(_0x7d3f('0x3'));var moment=require(_0x7d3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d3f('0x5'));var util=require(_0x7d3f('0x6'));var path=require(_0x7d3f('0x7'));var sox=require(_0x7d3f('0x8'));var csv=require(_0x7d3f('0x9'));var ejs=require(_0x7d3f('0xa'));var fs=require('fs');var fs_extra=require(_0x7d3f('0xb'));var _=require(_0x7d3f('0xc'));var squel=require(_0x7d3f('0xd'));var crypto=require(_0x7d3f('0xe'));var jsforce=require(_0x7d3f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7d3f('0x9'));var querystring=require(_0x7d3f('0x10'));var Papa=require(_0x7d3f('0x11'));var Redis=require(_0x7d3f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7d3f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d3f('0x14'));var logger=require('../../config/logger')(_0x7d3f('0x15'));var utils=require(_0x7d3f('0x16'));var config=require(_0x7d3f('0x17'));var licenseUtil=require(_0x7d3f('0x18'));var db=require(_0x7d3f('0x19'))['db'];function respondWithStatusCode(_0x2e16b2,_0x53c9b6){_0x53c9b6=_0x53c9b6||0xcc;return function(_0x340f8b){if(_0x340f8b){return _0x2e16b2[_0x7d3f('0x1a')](_0x53c9b6);}return _0x2e16b2['status'](_0x53c9b6)['end']();};}function respondWithResult(_0x2244bd,_0x474c20){_0x474c20=_0x474c20||0xc8;return function(_0x15bfa0){if(_0x15bfa0){return _0x2244bd[_0x7d3f('0x1b')](_0x474c20)[_0x7d3f('0x1c')](_0x15bfa0);}};}function respondWithFilteredResult(_0x4468b1,_0x5f0a29){return function(_0x149261){if(_0x149261){var _0x2dfe3e=typeof _0x5f0a29[_0x7d3f('0x1d')]===_0x7d3f('0x1e')&&typeof _0x5f0a29[_0x7d3f('0x1f')]===_0x7d3f('0x1e');var _0x58de31=_0x149261[_0x7d3f('0x20')];var _0x33fd54=_0x2dfe3e?0x0:_0x5f0a29[_0x7d3f('0x1d')];var _0x4c4a0c=_0x2dfe3e?_0x149261[_0x7d3f('0x20')]:_0x5f0a29[_0x7d3f('0x1d')]+_0x5f0a29[_0x7d3f('0x1f')];var _0x27cfa7;if(_0x4c4a0c>=_0x58de31){_0x4c4a0c=_0x58de31;_0x27cfa7=0xc8;}else{_0x27cfa7=0xce;}_0x4468b1['status'](_0x27cfa7);return _0x4468b1[_0x7d3f('0x21')](_0x7d3f('0x22'),_0x33fd54+'-'+_0x4c4a0c+'/'+_0x58de31)[_0x7d3f('0x1c')](_0x149261);}return null;};}function patchUpdates(_0xce1191){return function(_0x527e9d){try{jsonpatch[_0x7d3f('0x23')](_0x527e9d,_0xce1191,!![]);}catch(_0x378561){return BPromise[_0x7d3f('0x24')](_0x378561);}return _0x527e9d['save']();};}function saveUpdates(_0x5f5b54,_0x2ef99f){return function(_0x5715c5){if(_0x5715c5){return _0x5715c5[_0x7d3f('0x25')](_0x5f5b54)[_0x7d3f('0x26')](function(_0x4c5743){return _0x4c5743;});}return null;};}function removeEntity(_0x37606e,_0x3ec5f0){return function(_0x5d2c21){if(_0x5d2c21){return _0x5d2c21['destroy']()[_0x7d3f('0x26')](function(){_0x37606e['status'](0xcc)[_0x7d3f('0x27')]();});}};}function handleEntityNotFound(_0xe37283,_0x623dfe){return function(_0x1ee0b3){if(!_0x1ee0b3){_0xe37283[_0x7d3f('0x1a')](0x194);}return _0x1ee0b3;};}function handleError(_0x1cd5d4,_0x4fb007){_0x4fb007=_0x4fb007||0x1f4;return function(_0x98b0bb){logger[_0x7d3f('0x28')](_0x98b0bb[_0x7d3f('0x29')]);if(_0x98b0bb[_0x7d3f('0x2a')]){delete _0x98b0bb['name'];}_0x1cd5d4[_0x7d3f('0x1b')](_0x4fb007)[_0x7d3f('0x2b')](_0x98b0bb);};}exports['index']=function(_0x918bf6,_0x47ddbc){var _0x5fde36={},_0x4869cf={},_0x1287c1={'count':0x0,'rows':[]};var _0x8f241d=_[_0x7d3f('0x2c')](db['SquareReport'][_0x7d3f('0x2d')],function(_0x531d11){return{'name':_0x531d11[_0x7d3f('0x2e')],'type':_0x531d11['type'][_0x7d3f('0x2f')]};});_0x4869cf[_0x7d3f('0x30')]=_[_0x7d3f('0x2c')](_0x8f241d,_0x7d3f('0x2a'));_0x4869cf[_0x7d3f('0x31')]=_['keys'](_0x918bf6['query']);_0x4869cf[_0x7d3f('0x32')]=_[_0x7d3f('0x33')](_0x4869cf['model'],_0x4869cf[_0x7d3f('0x31')]);_0x5fde36[_0x7d3f('0x34')]=_['intersection'](_0x4869cf['model'],qs[_0x7d3f('0x35')](_0x918bf6[_0x7d3f('0x31')]['fields']));_0x5fde36[_0x7d3f('0x34')]=_0x5fde36[_0x7d3f('0x34')][_0x7d3f('0x36')]?_0x5fde36['attributes']:_0x4869cf['model'];if(!_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x37')]('nolimit')){_0x5fde36[_0x7d3f('0x1f')]=qs[_0x7d3f('0x1f')](_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x1f')]);_0x5fde36['offset']=qs[_0x7d3f('0x1d')](_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x1d')]);}_0x5fde36[_0x7d3f('0x38')]=qs[_0x7d3f('0x39')](_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x39')]);_0x5fde36[_0x7d3f('0x3a')]=qs[_0x7d3f('0x32')](_[_0x7d3f('0x3b')](_0x918bf6[_0x7d3f('0x31')],_0x4869cf[_0x7d3f('0x32')]),_0x8f241d);if(_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x3c')]){_0x5fde36[_0x7d3f('0x3a')]=_['merge'](_0x5fde36[_0x7d3f('0x3a')],{'$or':_[_0x7d3f('0x2c')](_0x8f241d,function(_0x299713){if(_0x299713[_0x7d3f('0x3d')]!=='VIRTUAL'){var _0x29c75f={};_0x29c75f[_0x299713[_0x7d3f('0x2a')]]={'$like':'%'+_0x918bf6['query']['filter']+'%'};return _0x29c75f;}})});}_0x5fde36=_[_0x7d3f('0x3e')]({},_0x5fde36,_0x918bf6[_0x7d3f('0x3f')]);var _0x245438={'where':_0x5fde36[_0x7d3f('0x3a')]};return db[_0x7d3f('0x40')]['count'](_0x245438)[_0x7d3f('0x26')](function(_0x3c446f){_0x1287c1['count']=_0x3c446f;if(_0x918bf6[_0x7d3f('0x31')][_0x7d3f('0x41')]){_0x5fde36[_0x7d3f('0x42')]=[{'all':!![]}];}return db['SquareReport'][_0x7d3f('0x43')](_0x5fde36);})[_0x7d3f('0x26')](function(_0x4e828d){_0x1287c1[_0x7d3f('0x44')]=_0x4e828d;return _0x1287c1;})['then'](respondWithFilteredResult(_0x47ddbc,_0x5fde36))['catch'](handleError(_0x47ddbc,null));};exports['show']=function(_0x444c6c,_0xcc98b3){var _0xb990c6={'raw':!![],'where':{'id':_0x444c6c[_0x7d3f('0x45')]['id']}},_0x21a19a={};_0x21a19a[_0x7d3f('0x30')]=_[_0x7d3f('0x46')](db[_0x7d3f('0x40')][_0x7d3f('0x2d')]);_0x21a19a['query']=_[_0x7d3f('0x46')](_0x444c6c[_0x7d3f('0x31')]);_0x21a19a[_0x7d3f('0x32')]=_[_0x7d3f('0x33')](_0x21a19a['model'],_0x21a19a[_0x7d3f('0x31')]);_0xb990c6[_0x7d3f('0x34')]=_[_0x7d3f('0x33')](_0x21a19a[_0x7d3f('0x30')],qs['fields'](_0x444c6c['query'][_0x7d3f('0x35')]));_0xb990c6['attributes']=_0xb990c6['attributes']['length']?_0xb990c6[_0x7d3f('0x34')]:_0x21a19a[_0x7d3f('0x30')];if(_0x444c6c[_0x7d3f('0x31')]['includeAll']){_0xb990c6[_0x7d3f('0x42')]=[{'all':!![]}];}_0xb990c6=_[_0x7d3f('0x3e')]({},_0xb990c6,_0x444c6c[_0x7d3f('0x3f')]);return db[_0x7d3f('0x40')][_0x7d3f('0x47')](_0xb990c6)[_0x7d3f('0x26')](handleEntityNotFound(_0xcc98b3,null))['then'](respondWithResult(_0xcc98b3,null))[_0x7d3f('0x48')](handleError(_0xcc98b3,null));};exports[_0x7d3f('0x49')]=function(_0xcccc1d,_0x3c3933){return db[_0x7d3f('0x40')][_0x7d3f('0x49')](_0xcccc1d['body'],{})[_0x7d3f('0x26')](respondWithResult(_0x3c3933,0xc9))['catch'](handleError(_0x3c3933,null));};exports[_0x7d3f('0x25')]=function(_0x200e71,_0x1d4b1f){if(_0x200e71['body']['id']){delete _0x200e71[_0x7d3f('0x4a')]['id'];}return db[_0x7d3f('0x40')]['find']({'where':{'id':_0x200e71[_0x7d3f('0x45')]['id']}})[_0x7d3f('0x26')](handleEntityNotFound(_0x1d4b1f,null))[_0x7d3f('0x26')](saveUpdates(_0x200e71['body'],null))[_0x7d3f('0x26')](respondWithResult(_0x1d4b1f,null))[_0x7d3f('0x48')](handleError(_0x1d4b1f,null));};exports[_0x7d3f('0x4b')]=function(_0x3364e1,_0x5dc3fa){return db[_0x7d3f('0x40')]['find']({'where':{'id':_0x3364e1[_0x7d3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5dc3fa,null))[_0x7d3f('0x26')](removeEntity(_0x5dc3fa,null))[_0x7d3f('0x48')](handleError(_0x5dc3fa,null));};exports[_0x7d3f('0x4c')]=function(_0x379221,_0x348cd7){return db['SquareReport'][_0x7d3f('0x4c')]()[_0x7d3f('0x26')](respondWithResult(_0x348cd7,null))[_0x7d3f('0x48')](handleError(_0x348cd7,null));}; \ No newline at end of file +var _0xb69d=['sox','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','error','name','send','map','SquareReport','rawAttributes','fieldName','key','query','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','options','then','includeAll','include','rows','show','keys','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x1ded0f,_0x2c82a9){var _0x1ad47a=function(_0x5b745b){while(--_0x5b745b){_0x1ded0f['push'](_0x1ded0f['shift']());}};_0x1ad47a(++_0x2c82a9);}(_0xb69d,0x88));var _0xdb69=function(_0x4291bc,_0x153760){_0x4291bc=_0x4291bc-0x0;var _0x7167ed=_0xb69d[_0x4291bc];return _0x7167ed;};'use strict';var emlformat=require(_0xdb69('0x0'));var rimraf=require(_0xdb69('0x1'));var zipdir=require(_0xdb69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdb69('0x3'));var BPromise=require(_0xdb69('0x4'));var Mustache=require(_0xdb69('0x5'));var util=require(_0xdb69('0x6'));var path=require(_0xdb69('0x7'));var sox=require(_0xdb69('0x8'));var csv=require(_0xdb69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb69('0xa'));var _=require(_0xdb69('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb69('0xc'));var deskjs=require(_0xdb69('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdb69('0xe'));var authService=require(_0xdb69('0xf'));var qs=require(_0xdb69('0x10'));var as=require(_0xdb69('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb69('0x12'))(_0xdb69('0x13'));var utils=require(_0xdb69('0x14'));var config=require(_0xdb69('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb69('0x16'))['db'];function respondWithStatusCode(_0x1c1f0a,_0x3438b3){_0x3438b3=_0x3438b3||0xcc;return function(_0x3de89c){if(_0x3de89c){return _0x1c1f0a[_0xdb69('0x17')](_0x3438b3);}return _0x1c1f0a[_0xdb69('0x18')](_0x3438b3)[_0xdb69('0x19')]();};}function respondWithResult(_0x2baca1,_0x26cd0e){_0x26cd0e=_0x26cd0e||0xc8;return function(_0x18045f){if(_0x18045f){return _0x2baca1[_0xdb69('0x18')](_0x26cd0e)['json'](_0x18045f);}};}function respondWithFilteredResult(_0x21a762,_0x3cc2c7){return function(_0x29a70f){if(_0x29a70f){var _0x5ea643=typeof _0x3cc2c7[_0xdb69('0x1a')]===_0xdb69('0x1b')&&typeof _0x3cc2c7[_0xdb69('0x1c')]==='undefined';var _0x4f029d=_0x29a70f[_0xdb69('0x1d')];var _0x4418fc=_0x5ea643?0x0:_0x3cc2c7[_0xdb69('0x1a')];var _0xcaa7f5=_0x5ea643?_0x29a70f[_0xdb69('0x1d')]:_0x3cc2c7[_0xdb69('0x1a')]+_0x3cc2c7[_0xdb69('0x1c')];var _0x1caa43;if(_0xcaa7f5>=_0x4f029d){_0xcaa7f5=_0x4f029d;_0x1caa43=0xc8;}else{_0x1caa43=0xce;}_0x21a762[_0xdb69('0x18')](_0x1caa43);return _0x21a762[_0xdb69('0x1e')](_0xdb69('0x1f'),_0x4418fc+'-'+_0xcaa7f5+'/'+_0x4f029d)[_0xdb69('0x20')](_0x29a70f);}return null;};}function patchUpdates(_0x9db583){return function(_0x13dba9){try{jsonpatch[_0xdb69('0x21')](_0x13dba9,_0x9db583,!![]);}catch(_0x4955b3){return BPromise[_0xdb69('0x22')](_0x4955b3);}return _0x13dba9['save']();};}function saveUpdates(_0x557028,_0x497494){return function(_0x2e5e4e){if(_0x2e5e4e){return _0x2e5e4e[_0xdb69('0x23')](_0x557028)['then'](function(_0x25dd51){return _0x25dd51;});}return null;};}function removeEntity(_0x321035,_0x42a0af){return function(_0x1a1a17){if(_0x1a1a17){return _0x1a1a17[_0xdb69('0x24')]()['then'](function(){_0x321035[_0xdb69('0x18')](0xcc)[_0xdb69('0x19')]();});}};}function handleEntityNotFound(_0x2f3f2a,_0x660a0){return function(_0x3ff76e){if(!_0x3ff76e){_0x2f3f2a[_0xdb69('0x17')](0x194);}return _0x3ff76e;};}function handleError(_0x2b7190,_0x23c65e){_0x23c65e=_0x23c65e||0x1f4;return function(_0x499747){logger[_0xdb69('0x25')](_0x499747['stack']);if(_0x499747[_0xdb69('0x26')]){delete _0x499747[_0xdb69('0x26')];}_0x2b7190[_0xdb69('0x18')](_0x23c65e)[_0xdb69('0x27')](_0x499747);};}exports['index']=function(_0xcda215,_0x24f62a){var _0x148e06={},_0x16ab3b={},_0x229de8={'count':0x0,'rows':[]};var _0x3bf9bb=_[_0xdb69('0x28')](db[_0xdb69('0x29')][_0xdb69('0x2a')],function(_0x9f9a10){return{'name':_0x9f9a10[_0xdb69('0x2b')],'type':_0x9f9a10['type'][_0xdb69('0x2c')]};});_0x16ab3b['model']=_[_0xdb69('0x28')](_0x3bf9bb,_0xdb69('0x26'));_0x16ab3b[_0xdb69('0x2d')]=_['keys'](_0xcda215['query']);_0x16ab3b['filters']=_['intersection'](_0x16ab3b[_0xdb69('0x2e')],_0x16ab3b['query']);_0x148e06[_0xdb69('0x2f')]=_['intersection'](_0x16ab3b[_0xdb69('0x2e')],qs[_0xdb69('0x30')](_0xcda215[_0xdb69('0x2d')][_0xdb69('0x30')]));_0x148e06['attributes']=_0x148e06['attributes'][_0xdb69('0x31')]?_0x148e06[_0xdb69('0x2f')]:_0x16ab3b[_0xdb69('0x2e')];if(!_0xcda215['query'][_0xdb69('0x32')]('nolimit')){_0x148e06[_0xdb69('0x1c')]=qs[_0xdb69('0x1c')](_0xcda215[_0xdb69('0x2d')]['limit']);_0x148e06['offset']=qs[_0xdb69('0x1a')](_0xcda215[_0xdb69('0x2d')][_0xdb69('0x1a')]);}_0x148e06[_0xdb69('0x33')]=qs[_0xdb69('0x34')](_0xcda215[_0xdb69('0x2d')]['sort']);_0x148e06[_0xdb69('0x35')]=qs[_0xdb69('0x36')](_['pick'](_0xcda215[_0xdb69('0x2d')],_0x16ab3b['filters']),_0x3bf9bb);if(_0xcda215[_0xdb69('0x2d')][_0xdb69('0x37')]){_0x148e06[_0xdb69('0x35')]=_[_0xdb69('0x38')](_0x148e06[_0xdb69('0x35')],{'$or':_[_0xdb69('0x28')](_0x3bf9bb,function(_0x3b6455){if(_0x3b6455[_0xdb69('0x39')]!=='VIRTUAL'){var _0x4ae5fc={};_0x4ae5fc[_0x3b6455['name']]={'$like':'%'+_0xcda215[_0xdb69('0x2d')][_0xdb69('0x37')]+'%'};return _0x4ae5fc;}})});}_0x148e06=_[_0xdb69('0x38')]({},_0x148e06,_0xcda215[_0xdb69('0x3a')]);var _0x5a5a5={'where':_0x148e06[_0xdb69('0x35')]};return db[_0xdb69('0x29')][_0xdb69('0x1d')](_0x5a5a5)[_0xdb69('0x3b')](function(_0x31d0a0){_0x229de8[_0xdb69('0x1d')]=_0x31d0a0;if(_0xcda215[_0xdb69('0x2d')][_0xdb69('0x3c')]){_0x148e06[_0xdb69('0x3d')]=[{'all':!![]}];}return db[_0xdb69('0x29')]['findAll'](_0x148e06);})[_0xdb69('0x3b')](function(_0x379275){_0x229de8[_0xdb69('0x3e')]=_0x379275;return _0x229de8;})[_0xdb69('0x3b')](respondWithFilteredResult(_0x24f62a,_0x148e06))['catch'](handleError(_0x24f62a,null));};exports[_0xdb69('0x3f')]=function(_0x1324aa,_0x1c784f){var _0x1cb9f0={'raw':!![],'where':{'id':_0x1324aa['params']['id']}},_0x57d4ea={};_0x57d4ea[_0xdb69('0x2e')]=_[_0xdb69('0x40')](db['SquareReport'][_0xdb69('0x2a')]);_0x57d4ea[_0xdb69('0x2d')]=_[_0xdb69('0x40')](_0x1324aa[_0xdb69('0x2d')]);_0x57d4ea[_0xdb69('0x36')]=_['intersection'](_0x57d4ea['model'],_0x57d4ea[_0xdb69('0x2d')]);_0x1cb9f0[_0xdb69('0x2f')]=_[_0xdb69('0x41')](_0x57d4ea['model'],qs['fields'](_0x1324aa[_0xdb69('0x2d')][_0xdb69('0x30')]));_0x1cb9f0[_0xdb69('0x2f')]=_0x1cb9f0[_0xdb69('0x2f')]['length']?_0x1cb9f0[_0xdb69('0x2f')]:_0x57d4ea[_0xdb69('0x2e')];if(_0x1324aa[_0xdb69('0x2d')][_0xdb69('0x3c')]){_0x1cb9f0[_0xdb69('0x3d')]=[{'all':!![]}];}_0x1cb9f0=_[_0xdb69('0x38')]({},_0x1cb9f0,_0x1324aa[_0xdb69('0x3a')]);return db[_0xdb69('0x29')][_0xdb69('0x42')](_0x1cb9f0)[_0xdb69('0x3b')](handleEntityNotFound(_0x1c784f,null))['then'](respondWithResult(_0x1c784f,null))['catch'](handleError(_0x1c784f,null));};exports[_0xdb69('0x43')]=function(_0x34519f,_0x576f8c){return db[_0xdb69('0x29')][_0xdb69('0x43')](_0x34519f['body'],{})[_0xdb69('0x3b')](respondWithResult(_0x576f8c,0xc9))[_0xdb69('0x44')](handleError(_0x576f8c,null));};exports[_0xdb69('0x23')]=function(_0xf6111e,_0x442492){if(_0xf6111e[_0xdb69('0x45')]['id']){delete _0xf6111e[_0xdb69('0x45')]['id'];}return db['SquareReport']['find']({'where':{'id':_0xf6111e[_0xdb69('0x46')]['id']}})[_0xdb69('0x3b')](handleEntityNotFound(_0x442492,null))[_0xdb69('0x3b')](saveUpdates(_0xf6111e['body'],null))['then'](respondWithResult(_0x442492,null))[_0xdb69('0x44')](handleError(_0x442492,null));};exports[_0xdb69('0x24')]=function(_0x36336e,_0x28b1ce){return db[_0xdb69('0x29')][_0xdb69('0x42')]({'where':{'id':_0x36336e[_0xdb69('0x46')]['id']}})[_0xdb69('0x3b')](handleEntityNotFound(_0x28b1ce,null))[_0xdb69('0x3b')](removeEntity(_0x28b1ce,null))[_0xdb69('0x44')](handleError(_0x28b1ce,null));};exports['describe']=function(_0x52fa1b,_0x27e707){return db[_0xdb69('0x29')][_0xdb69('0x47')]()[_0xdb69('0x3b')](respondWithResult(_0x27e707,null))['catch'](handleError(_0x27e707,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 2bc2a35..392e757 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 _0x47cd=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','define','SquareReport','report_square','uniqueid','project_name'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x47cd,0xc4));var _0xd47c=function(_0x5ac31d,_0x56aaac){_0x5ac31d=_0x5ac31d-0x0;var _0x49a8bf=_0x47cd[_0x5ac31d];return _0x49a8bf;};'use strict';var _=require(_0xd47c('0x0'));var util=require(_0xd47c('0x1'));var logger=require(_0xd47c('0x2'))('api');var moment=require(_0xd47c('0x3'));var BPromise=require(_0xd47c('0x4'));var rp=require(_0xd47c('0x5'));var fs=require('fs');var path=require(_0xd47c('0x6'));var rimraf=require(_0xd47c('0x7'));var config=require('../../config/environment');var attributes=require(_0xd47c('0x8'));module['exports']=function(_0x54313b,_0x2364bf){return _0x54313b[_0xd47c('0x9')](_0xd47c('0xa'),attributes,{'tableName':_0xd47c('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd47c('0xc'),_0xd47c('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa29=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name'];(function(_0x3eafcb,_0x50f5da){var _0x163eba=function(_0x462e44){while(--_0x462e44){_0x3eafcb['push'](_0x3eafcb['shift']());}};_0x163eba(++_0x50f5da);}(_0xfa29,0x181));var _0x9fa2=function(_0x5aa72c,_0x1028d3){_0x5aa72c=_0x5aa72c-0x0;var _0x2474d3=_0xfa29[_0x5aa72c];return _0x2474d3;};'use strict';var _=require(_0x9fa2('0x0'));var util=require(_0x9fa2('0x1'));var logger=require(_0x9fa2('0x2'))(_0x9fa2('0x3'));var moment=require(_0x9fa2('0x4'));var BPromise=require(_0x9fa2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fa2('0x6'));var rimraf=require(_0x9fa2('0x7'));var config=require('../../config/environment');var attributes=require(_0x9fa2('0x8'));module[_0x9fa2('0x9')]=function(_0x17d01e,_0x556096){return _0x17d01e[_0x9fa2('0xa')](_0x9fa2('0xb'),attributes,{'tableName':_0x9fa2('0xc'),'paranoid':![],'indexes':[{'name':_0x9fa2('0xd'),'fields':['uniqueid',_0x9fa2('0xe')]},{'name':_0x9fa2('0xf'),'fields':[_0x9fa2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index f222268..ea79d2a 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 _0x657b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateSquareReport','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','attributes','limit','stringify','lodash','util','moment'];(function(_0x59bd02,_0x5cf860){var _0x40fefc=function(_0x51b864){while(--_0x51b864){_0x59bd02['push'](_0x59bd02['shift']());}};_0x40fefc(++_0x5cf860);}(_0x657b,0xfd));var _0xb657=function(_0x45cd42,_0x3f8140){_0x45cd42=_0x45cd42-0x0;var _0x750010=_0x657b[_0x45cd42];return _0x750010;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var moment=require(_0xb657('0x2'));var BPromise=require('bluebird');var rs=require(_0xb657('0x3'));var fs=require('fs');var Redis=require(_0xb657('0x4'));var db=require(_0xb657('0x5'))['db'];var utils=require(_0xb657('0x6'));var logger=require(_0xb657('0x7'))('rpc');var config=require(_0xb657('0x8'));var jayson=require(_0xb657('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2adafc,_0xa82260,_0x1f0d42){return new BPromise(function(_0x5de110,_0x2c1fb1){return client['request'](_0x2adafc,_0x1f0d42)[_0xb657('0xa')](function(_0x361629){logger['info'](_0xb657('0xb'),_0xa82260,_0xb657('0xc'));logger[_0xb657('0xd')](_0xb657('0xe'),_0xa82260,'request\x20sent',JSON['stringify'](_0x361629));if(_0x361629['error']){if(_0x361629[_0xb657('0xf')][_0xb657('0x10')]===0x1f4){logger[_0xb657('0xf')](_0xb657('0xb'),_0xa82260,_0x361629[_0xb657('0xf')][_0xb657('0x11')]);return _0x2c1fb1(_0x361629[_0xb657('0xf')][_0xb657('0x11')]);}logger[_0xb657('0xf')](_0xb657('0xb'),_0xa82260,_0x361629[_0xb657('0xf')][_0xb657('0x11')]);return _0x5de110(_0x361629[_0xb657('0xf')][_0xb657('0x11')]);}else{logger[_0xb657('0x12')]('SquareReport,\x20%s,\x20%s',_0xa82260,_0xb657('0xc'));_0x5de110(_0x361629[_0xb657('0x13')][_0xb657('0x11')]);}})['catch'](function(_0x2edc5d){logger[_0xb657('0xf')](_0xb657('0xb'),_0xa82260,_0x2edc5d);_0x2c1fb1(_0x2edc5d);});});}exports[_0xb657('0x14')]=function(_0x4612f9){var _0x4f7730=this;return new Promise(function(_0x8ede6f,_0x32e480){return db[_0xb657('0x15')][_0xb657('0x16')](_0x4612f9[_0xb657('0x17')],{'raw':_0x4612f9[_0xb657('0x18')]?_0x4612f9[_0xb657('0x18')][_0xb657('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xd95153){logger[_0xb657('0x12')](_0xb657('0x14'),_0x4612f9);logger['debug'](_0xb657('0x14'),_0x4612f9,JSON['stringify'](_0xd95153));_0x8ede6f(_0xd95153);})[_0xb657('0x1a')](function(_0x4c58f2){logger[_0xb657('0xf')](_0xb657('0x14'),_0x4c58f2[_0xb657('0x11')],_0x4612f9);_0x32e480(_0x4f7730[_0xb657('0xf')](0x1f4,_0x4c58f2['message']));});});};exports[_0xb657('0x1b')]=function(_0x2dbc47){var _0x122907=this;return new Promise(function(_0x4b9bc7,_0x1ce186){return db[_0xb657('0x15')][_0xb657('0x1c')](_0x2dbc47[_0xb657('0x17')],{'raw':_0x2dbc47[_0xb657('0x18')]?_0x2dbc47[_0xb657('0x18')][_0xb657('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dbc47[_0xb657('0x18')]?_0x2dbc47[_0xb657('0x18')]['where']||null:null,'attributes':_0x2dbc47[_0xb657('0x18')]?_0x2dbc47[_0xb657('0x18')][_0xb657('0x1d')]||null:null,'limit':_0x2dbc47[_0xb657('0x18')]?_0x2dbc47[_0xb657('0x18')][_0xb657('0x1e')]||null:null})['then'](function(_0x2497a2){logger[_0xb657('0x12')]('UpdateSquareReport',_0x2dbc47);logger[_0xb657('0xd')]('UpdateSquareReport',_0x2dbc47,JSON[_0xb657('0x1f')](_0x2497a2));_0x4b9bc7(_0x2497a2);})[_0xb657('0x1a')](function(_0x431346){logger[_0xb657('0xf')](_0xb657('0x1b'),_0x431346[_0xb657('0x11')],_0x2dbc47);_0x1ce186(_0x122907[_0xb657('0xf')](0x1f4,_0x431346[_0xb657('0x11')]));});});}; \ No newline at end of file +var _0x7cb6=['CreateSquareReport','create','body','options','raw','debug','UpdateSquareReport','update','attributes','limit','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x44e487,_0x457420){var _0x347512=function(_0x1f6c38){while(--_0x1f6c38){_0x44e487['push'](_0x44e487['shift']());}};_0x347512(++_0x457420);}(_0x7cb6,0x88));var _0x67cb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7cb6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x67cb('0x0'));var util=require(_0x67cb('0x1'));var moment=require(_0x67cb('0x2'));var BPromise=require(_0x67cb('0x3'));var rs=require(_0x67cb('0x4'));var fs=require('fs');var Redis=require(_0x67cb('0x5'));var db=require(_0x67cb('0x6'))['db'];var utils=require(_0x67cb('0x7'));var logger=require(_0x67cb('0x8'))(_0x67cb('0x9'));var config=require(_0x67cb('0xa'));var jayson=require(_0x67cb('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1892b8,_0xbf304,_0x60cabf){return new BPromise(function(_0x14ff50,_0x41e653){return client['request'](_0x1892b8,_0x60cabf)[_0x67cb('0xc')](function(_0x85f11b){logger['info'](_0x67cb('0xd'),_0xbf304,_0x67cb('0xe'));logger['debug'](_0x67cb('0xf'),_0xbf304,_0x67cb('0xe'),JSON['stringify'](_0x85f11b));if(_0x85f11b['error']){if(_0x85f11b[_0x67cb('0x10')]['code']===0x1f4){logger[_0x67cb('0x10')]('SquareReport,\x20%s,\x20%s',_0xbf304,_0x85f11b[_0x67cb('0x10')][_0x67cb('0x11')]);return _0x41e653(_0x85f11b['error'][_0x67cb('0x11')]);}logger['error'](_0x67cb('0xd'),_0xbf304,_0x85f11b['error'][_0x67cb('0x11')]);return _0x14ff50(_0x85f11b['error'][_0x67cb('0x11')]);}else{logger[_0x67cb('0x12')]('SquareReport,\x20%s,\x20%s',_0xbf304,_0x67cb('0xe'));_0x14ff50(_0x85f11b['result'][_0x67cb('0x11')]);}})['catch'](function(_0x4817b8){logger[_0x67cb('0x10')](_0x67cb('0xd'),_0xbf304,_0x4817b8);_0x41e653(_0x4817b8);});});}exports[_0x67cb('0x13')]=function(_0x50717c){var _0x2712ad=this;return new Promise(function(_0x161f43,_0x577e7d){return db['SquareReport'][_0x67cb('0x14')](_0x50717c[_0x67cb('0x15')],{'raw':_0x50717c[_0x67cb('0x16')]?_0x50717c['options'][_0x67cb('0x17')]===undefined?!![]:![]:!![]})[_0x67cb('0xc')](function(_0x23f1a3){logger['info'](_0x67cb('0x13'),_0x50717c);logger[_0x67cb('0x18')](_0x67cb('0x13'),_0x50717c,JSON['stringify'](_0x23f1a3));_0x161f43(_0x23f1a3);})['catch'](function(_0x3852c9){logger[_0x67cb('0x10')](_0x67cb('0x13'),_0x3852c9[_0x67cb('0x11')],_0x50717c);_0x577e7d(_0x2712ad[_0x67cb('0x10')](0x1f4,_0x3852c9[_0x67cb('0x11')]));});});};exports[_0x67cb('0x19')]=function(_0x25e692){var _0x371d8b=this;return new Promise(function(_0x1847d7,_0x244ec0){return db['SquareReport'][_0x67cb('0x1a')](_0x25e692[_0x67cb('0x15')],{'raw':_0x25e692[_0x67cb('0x16')]?_0x25e692[_0x67cb('0x16')][_0x67cb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e692[_0x67cb('0x16')]?_0x25e692['options']['where']||null:null,'attributes':_0x25e692[_0x67cb('0x16')]?_0x25e692[_0x67cb('0x16')][_0x67cb('0x1b')]||null:null,'limit':_0x25e692['options']?_0x25e692['options'][_0x67cb('0x1c')]||null:null})[_0x67cb('0xc')](function(_0x35f1ff){logger['info']('UpdateSquareReport',_0x25e692);logger[_0x67cb('0x18')](_0x67cb('0x19'),_0x25e692,JSON[_0x67cb('0x1d')](_0x35f1ff));_0x1847d7(_0x35f1ff);})[_0x67cb('0x1e')](function(_0x2ddcc5){logger[_0x67cb('0x10')](_0x67cb('0x19'),_0x2ddcc5[_0x67cb('0x11')],_0x25e692);_0x244ec0(_0x371d8b[_0x67cb('0x10')](0x1f4,_0x2ddcc5[_0x67cb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 3b9482a..aa6d330 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 _0x3564=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x27b9a5,_0x16f995){var _0x5df8fb=function(_0x47c0e7){while(--_0x47c0e7){_0x27b9a5['push'](_0x27b9a5['shift']());}};_0x5df8fb(++_0x16f995);}(_0x3564,0xfa));var _0x4356=function(_0x58c802,_0x361a3d){_0x58c802=_0x58c802-0x0;var _0x3a0e12=_0x3564[_0x58c802];return _0x3a0e12;};'use strict';var multer=require(_0x4356('0x0'));var util=require(_0x4356('0x1'));var path=require(_0x4356('0x2'));var timeout=require(_0x4356('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4356('0x4'));var interaction=require(_0x4356('0x5'));var config=require(_0x4356('0x6'));var controller=require(_0x4356('0x7'));router[_0x4356('0x8')]('/',auth[_0x4356('0x9')](),controller['index']);router[_0x4356('0x8')](_0x4356('0xa'),auth[_0x4356('0x9')](),controller[_0x4356('0xb')]);router[_0x4356('0x8')](_0x4356('0xc'),auth[_0x4356('0x9')](),controller[_0x4356('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4356('0xe')]);router[_0x4356('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4356('0x10')]);router[_0x4356('0x11')](_0x4356('0xc'),auth[_0x4356('0x9')](),controller[_0x4356('0x12')]);module[_0x4356('0x13')]=router; \ No newline at end of file +var _0x5363=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1057cb,_0x7b8162){var _0x7fbf7e=function(_0x5fa6a3){while(--_0x5fa6a3){_0x1057cb['push'](_0x1057cb['shift']());}};_0x7fbf7e(++_0x7b8162);}(_0x5363,0x12c));var _0x3536=function(_0x289686,_0x44e470){_0x289686=_0x289686-0x0;var _0x1b4f7a=_0x5363[_0x289686];return _0x1b4f7a;};'use strict';var multer=require(_0x3536('0x0'));var util=require(_0x3536('0x1'));var path=require(_0x3536('0x2'));var timeout=require(_0x3536('0x3'));var express=require(_0x3536('0x4'));var router=express[_0x3536('0x5')]();var fs_extra=require(_0x3536('0x6'));var auth=require(_0x3536('0x7'));var interaction=require(_0x3536('0x8'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x3536('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3536('0x9')]('/describe',auth[_0x3536('0xa')](),controller[_0x3536('0xb')]);router[_0x3536('0x9')](_0x3536('0xc'),auth[_0x3536('0xa')](),controller[_0x3536('0xd')]);router[_0x3536('0xe')]('/',auth['isAuthenticated'](),controller[_0x3536('0xf')]);router['put'](_0x3536('0xc'),auth[_0x3536('0xa')](),controller[_0x3536('0x10')]);router[_0x3536('0x11')](_0x3536('0xc'),auth[_0x3536('0xa')](),controller[_0x3536('0x12')]);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 9ab8457..32c54c8 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 _0x8891=['TEXT','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8891,0x10d));var _0x1889=function(_0x4301c7,_0x34373b){_0x4301c7=_0x4301c7-0x0;var _0x167782=_0x8891[_0x4301c7];return _0x167782;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x1889('0x0')]},'node':{'type':Sequelize[_0x1889('0x0')]},'application':{'type':Sequelize[_0x1889('0x0')]},'data':{'type':Sequelize[_0x1889('0x1')]},'project_name':{'type':Sequelize[_0x1889('0x0')]},'callerid':{'type':Sequelize[_0x1889('0x0')]}}; \ No newline at end of file +var _0x344d=['sequelize','exports','STRING','TEXT'];(function(_0x2560b1,_0xb7ed4b){var _0x4fd7f8=function(_0x10062d){while(--_0x10062d){_0x2560b1['push'](_0x2560b1['shift']());}};_0x4fd7f8(++_0xb7ed4b);}(_0x344d,0x18c));var _0xd344=function(_0x2937ea,_0x43a2a9){_0x2937ea=_0x2937ea-0x0;var _0x40b81b=_0x344d[_0x2937ea];return _0x40b81b;};'use strict';var Sequelize=require(_0xd344('0x0'));module[_0xd344('0x1')]={'uniqueid':{'type':Sequelize[_0xd344('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xd344('0x3')]},'project_name':{'type':Sequelize[_0xd344('0x2')]},'callerid':{'type':Sequelize[_0xd344('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4081850..24834d9 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 _0xfd1e=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','nolimit','limit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','show','params','intersection','includeAll','find','create','body','describe','eml-format','rimraf'];(function(_0x30e7f6,_0x19f9b6){var _0x472de0=function(_0x3b32f8){while(--_0x3b32f8){_0x30e7f6['push'](_0x30e7f6['shift']());}};_0x472de0(++_0x19f9b6);}(_0xfd1e,0x92));var _0xefd1=function(_0x3c9c3b,_0x1e016c){_0x3c9c3b=_0x3c9c3b-0x0;var _0x4236a9=_0xfd1e[_0x3c9c3b];return _0x4236a9;};'use strict';var emlformat=require(_0xefd1('0x0'));var rimraf=require(_0xefd1('0x1'));var zipdir=require(_0xefd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefd1('0x3'));var BPromise=require(_0xefd1('0x4'));var Mustache=require(_0xefd1('0x5'));var util=require(_0xefd1('0x6'));var path=require(_0xefd1('0x7'));var sox=require(_0xefd1('0x8'));var csv=require(_0xefd1('0x9'));var ejs=require(_0xefd1('0xa'));var fs=require('fs');var fs_extra=require(_0xefd1('0xb'));var _=require(_0xefd1('0xc'));var squel=require(_0xefd1('0xd'));var crypto=require(_0xefd1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xefd1('0xf'));var toCsv=require(_0xefd1('0x9'));var querystring=require('querystring');var Papa=require(_0xefd1('0x10'));var Redis=require(_0xefd1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefd1('0x12'));var logger=require('../../config/logger')(_0xefd1('0x13'));var utils=require(_0xefd1('0x14'));var config=require(_0xefd1('0x15'));var licenseUtil=require(_0xefd1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bb9c5,_0x3f49ab){_0x3f49ab=_0x3f49ab||0xcc;return function(_0x3ca97b){if(_0x3ca97b){return _0x4bb9c5['sendStatus'](_0x3f49ab);}return _0x4bb9c5[_0xefd1('0x17')](_0x3f49ab)[_0xefd1('0x18')]();};}function respondWithResult(_0x214202,_0x4b546f){_0x4b546f=_0x4b546f||0xc8;return function(_0x3ac173){if(_0x3ac173){return _0x214202[_0xefd1('0x17')](_0x4b546f)['json'](_0x3ac173);}};}function respondWithFilteredResult(_0x1607fc,_0x26d19d){return function(_0xca96f5){if(_0xca96f5){var _0x139b1b=typeof _0x26d19d[_0xefd1('0x19')]===_0xefd1('0x1a')&&typeof _0x26d19d['limit']==='undefined';var _0x40ebee=_0xca96f5['count'];var _0x11b087=_0x139b1b?0x0:_0x26d19d[_0xefd1('0x19')];var _0x1530e3=_0x139b1b?_0xca96f5[_0xefd1('0x1b')]:_0x26d19d['offset']+_0x26d19d['limit'];var _0x328985;if(_0x1530e3>=_0x40ebee){_0x1530e3=_0x40ebee;_0x328985=0xc8;}else{_0x328985=0xce;}_0x1607fc[_0xefd1('0x17')](_0x328985);return _0x1607fc[_0xefd1('0x1c')](_0xefd1('0x1d'),_0x11b087+'-'+_0x1530e3+'/'+_0x40ebee)['json'](_0xca96f5);}return null;};}function patchUpdates(_0x5b95d3){return function(_0x3086cc){try{jsonpatch[_0xefd1('0x1e')](_0x3086cc,_0x5b95d3,!![]);}catch(_0x2abe01){return BPromise[_0xefd1('0x1f')](_0x2abe01);}return _0x3086cc[_0xefd1('0x20')]();};}function saveUpdates(_0x2426db,_0xc624d8){return function(_0x4911cd){if(_0x4911cd){return _0x4911cd[_0xefd1('0x21')](_0x2426db)[_0xefd1('0x22')](function(_0x5642b3){return _0x5642b3;});}return null;};}function removeEntity(_0x421a2d,_0x588ca){return function(_0x231107){if(_0x231107){return _0x231107[_0xefd1('0x23')]()[_0xefd1('0x22')](function(){_0x421a2d[_0xefd1('0x17')](0xcc)[_0xefd1('0x18')]();});}};}function handleEntityNotFound(_0x590e38,_0x4565c1){return function(_0x275cfb){if(!_0x275cfb){_0x590e38[_0xefd1('0x24')](0x194);}return _0x275cfb;};}function handleError(_0x3b3908,_0x2f12ce){_0x2f12ce=_0x2f12ce||0x1f4;return function(_0x1609c2){logger['error'](_0x1609c2[_0xefd1('0x25')]);if(_0x1609c2[_0xefd1('0x26')]){delete _0x1609c2[_0xefd1('0x26')];}_0x3b3908[_0xefd1('0x17')](_0x2f12ce)[_0xefd1('0x27')](_0x1609c2);};}exports[_0xefd1('0x28')]=function(_0x5b43bc,_0x1e6201){var _0x364492={},_0x2c2e32={},_0xa8ee30={'count':0x0,'rows':[]};var _0x6ef74a=_[_0xefd1('0x29')](db[_0xefd1('0x2a')][_0xefd1('0x2b')],function(_0x14485f){return{'name':_0x14485f[_0xefd1('0x2c')],'type':_0x14485f['type'][_0xefd1('0x2d')]};});_0x2c2e32[_0xefd1('0x2e')]=_[_0xefd1('0x29')](_0x6ef74a,'name');_0x2c2e32[_0xefd1('0x2f')]=_[_0xefd1('0x30')](_0x5b43bc[_0xefd1('0x2f')]);_0x2c2e32['filters']=_['intersection'](_0x2c2e32[_0xefd1('0x2e')],_0x2c2e32[_0xefd1('0x2f')]);_0x364492[_0xefd1('0x31')]=_['intersection'](_0x2c2e32[_0xefd1('0x2e')],qs[_0xefd1('0x32')](_0x5b43bc[_0xefd1('0x2f')][_0xefd1('0x32')]));_0x364492[_0xefd1('0x31')]=_0x364492[_0xefd1('0x31')][_0xefd1('0x33')]?_0x364492[_0xefd1('0x31')]:_0x2c2e32[_0xefd1('0x2e')];if(!_0x5b43bc[_0xefd1('0x2f')]['hasOwnProperty'](_0xefd1('0x34'))){_0x364492['limit']=qs['limit'](_0x5b43bc[_0xefd1('0x2f')][_0xefd1('0x35')]);_0x364492[_0xefd1('0x19')]=qs[_0xefd1('0x19')](_0x5b43bc[_0xefd1('0x2f')]['offset']);}_0x364492['order']=qs[_0xefd1('0x36')](_0x5b43bc[_0xefd1('0x2f')][_0xefd1('0x36')]);_0x364492[_0xefd1('0x37')]=qs[_0xefd1('0x38')](_[_0xefd1('0x39')](_0x5b43bc['query'],_0x2c2e32[_0xefd1('0x38')]),_0x6ef74a);if(_0x5b43bc[_0xefd1('0x2f')][_0xefd1('0x3a')]){_0x364492['where']=_['merge'](_0x364492[_0xefd1('0x37')],{'$or':_[_0xefd1('0x29')](_0x6ef74a,function(_0x2d0043){if(_0x2d0043[_0xefd1('0x3b')]!==_0xefd1('0x3c')){var _0x389d4e={};_0x389d4e[_0x2d0043[_0xefd1('0x26')]]={'$like':'%'+_0x5b43bc[_0xefd1('0x2f')][_0xefd1('0x3a')]+'%'};return _0x389d4e;}})});}_0x364492=_[_0xefd1('0x3d')]({},_0x364492,_0x5b43bc[_0xefd1('0x3e')]);var _0x2f9277={'where':_0x364492[_0xefd1('0x37')]};return db[_0xefd1('0x2a')][_0xefd1('0x1b')](_0x2f9277)[_0xefd1('0x22')](function(_0x25074b){_0xa8ee30[_0xefd1('0x1b')]=_0x25074b;if(_0x5b43bc[_0xefd1('0x2f')]['includeAll']){_0x364492[_0xefd1('0x3f')]=[{'all':!![]}];}return db[_0xefd1('0x2a')][_0xefd1('0x40')](_0x364492);})[_0xefd1('0x22')](function(_0x287777){_0xa8ee30['rows']=_0x287777;return _0xa8ee30;})[_0xefd1('0x22')](respondWithFilteredResult(_0x1e6201,_0x364492))[_0xefd1('0x41')](handleError(_0x1e6201,null));};exports[_0xefd1('0x42')]=function(_0x2adc42,_0x42d88e){var _0x38c37e={'raw':!![],'where':{'id':_0x2adc42[_0xefd1('0x43')]['id']}},_0x46aa59={};_0x46aa59[_0xefd1('0x2e')]=_[_0xefd1('0x30')](db[_0xefd1('0x2a')][_0xefd1('0x2b')]);_0x46aa59[_0xefd1('0x2f')]=_[_0xefd1('0x30')](_0x2adc42[_0xefd1('0x2f')]);_0x46aa59[_0xefd1('0x38')]=_['intersection'](_0x46aa59[_0xefd1('0x2e')],_0x46aa59[_0xefd1('0x2f')]);_0x38c37e[_0xefd1('0x31')]=_[_0xefd1('0x44')](_0x46aa59[_0xefd1('0x2e')],qs[_0xefd1('0x32')](_0x2adc42['query']['fields']));_0x38c37e[_0xefd1('0x31')]=_0x38c37e['attributes']['length']?_0x38c37e[_0xefd1('0x31')]:_0x46aa59['model'];if(_0x2adc42[_0xefd1('0x2f')][_0xefd1('0x45')]){_0x38c37e['include']=[{'all':!![]}];}_0x38c37e=_[_0xefd1('0x3d')]({},_0x38c37e,_0x2adc42[_0xefd1('0x3e')]);return db[_0xefd1('0x2a')][_0xefd1('0x46')](_0x38c37e)[_0xefd1('0x22')](handleEntityNotFound(_0x42d88e,null))[_0xefd1('0x22')](respondWithResult(_0x42d88e,null))[_0xefd1('0x41')](handleError(_0x42d88e,null));};exports[_0xefd1('0x47')]=function(_0x2f68d3,_0x4bedcb){return db[_0xefd1('0x2a')][_0xefd1('0x47')](_0x2f68d3[_0xefd1('0x48')],{})[_0xefd1('0x22')](respondWithResult(_0x4bedcb,0xc9))[_0xefd1('0x41')](handleError(_0x4bedcb,null));};exports[_0xefd1('0x21')]=function(_0x3108fb,_0x1d038b){if(_0x3108fb[_0xefd1('0x48')]['id']){delete _0x3108fb['body']['id'];}return db[_0xefd1('0x2a')][_0xefd1('0x46')]({'where':{'id':_0x3108fb[_0xefd1('0x43')]['id']}})[_0xefd1('0x22')](handleEntityNotFound(_0x1d038b,null))['then'](saveUpdates(_0x3108fb[_0xefd1('0x48')],null))[_0xefd1('0x22')](respondWithResult(_0x1d038b,null))['catch'](handleError(_0x1d038b,null));};exports[_0xefd1('0x23')]=function(_0x186db5,_0x178935){return db[_0xefd1('0x2a')][_0xefd1('0x46')]({'where':{'id':_0x186db5['params']['id']}})[_0xefd1('0x22')](handleEntityNotFound(_0x178935,null))[_0xefd1('0x22')](removeEntity(_0x178935,null))['catch'](handleError(_0x178935,null));};exports['describe']=function(_0x44eb86,_0x1ca725){return db[_0xefd1('0x2a')][_0xefd1('0x49')]()[_0xefd1('0x22')](respondWithResult(_0x1ca725,null))[_0xefd1('0x41')](handleError(_0x1ca725,null));}; \ No newline at end of file +var _0xb389=['then','error','stack','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x413221,_0x6a775e){var _0x407264=function(_0xeba6d7){while(--_0xeba6d7){_0x413221['push'](_0x413221['shift']());}};_0x407264(++_0x6a775e);}(_0xb389,0x1a9));var _0x9b38=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0xb389[_0x4702ee];return _0x62ca7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b38('0x0'));var zipdir=require(_0x9b38('0x1'));var jsonpatch=require(_0x9b38('0x2'));var rp=require('request-promise');var moment=require(_0x9b38('0x3'));var BPromise=require(_0x9b38('0x4'));var Mustache=require(_0x9b38('0x5'));var util=require('util');var path=require(_0x9b38('0x6'));var sox=require(_0x9b38('0x7'));var csv=require(_0x9b38('0x8'));var ejs=require(_0x9b38('0x9'));var fs=require('fs');var fs_extra=require(_0x9b38('0xa'));var _=require(_0x9b38('0xb'));var squel=require(_0x9b38('0xc'));var crypto=require('crypto');var jsforce=require(_0x9b38('0xd'));var deskjs=require(_0x9b38('0xe'));var toCsv=require(_0x9b38('0x8'));var querystring=require(_0x9b38('0xf'));var Papa=require(_0x9b38('0x10'));var Redis=require(_0x9b38('0x11'));var authService=require(_0x9b38('0x12'));var qs=require(_0x9b38('0x13'));var as=require(_0x9b38('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b38('0x15'))('api');var utils=require(_0x9b38('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9b38('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b898a,_0x4b9201){_0x4b9201=_0x4b9201||0xcc;return function(_0x19f638){if(_0x19f638){return _0x3b898a[_0x9b38('0x18')](_0x4b9201);}return _0x3b898a[_0x9b38('0x19')](_0x4b9201)[_0x9b38('0x1a')]();};}function respondWithResult(_0x54b539,_0x382655){_0x382655=_0x382655||0xc8;return function(_0x86d0c0){if(_0x86d0c0){return _0x54b539[_0x9b38('0x19')](_0x382655)[_0x9b38('0x1b')](_0x86d0c0);}};}function respondWithFilteredResult(_0xdbbfe1,_0x23a0c6){return function(_0xb39bfc){if(_0xb39bfc){var _0x243393=typeof _0x23a0c6[_0x9b38('0x1c')]===_0x9b38('0x1d')&&typeof _0x23a0c6[_0x9b38('0x1e')]===_0x9b38('0x1d');var _0x1cc5c7=_0xb39bfc[_0x9b38('0x1f')];var _0x15d013=_0x243393?0x0:_0x23a0c6['offset'];var _0x3e9ac3=_0x243393?_0xb39bfc[_0x9b38('0x1f')]:_0x23a0c6[_0x9b38('0x1c')]+_0x23a0c6[_0x9b38('0x1e')];var _0x255199;if(_0x3e9ac3>=_0x1cc5c7){_0x3e9ac3=_0x1cc5c7;_0x255199=0xc8;}else{_0x255199=0xce;}_0xdbbfe1[_0x9b38('0x19')](_0x255199);return _0xdbbfe1[_0x9b38('0x20')](_0x9b38('0x21'),_0x15d013+'-'+_0x3e9ac3+'/'+_0x1cc5c7)[_0x9b38('0x1b')](_0xb39bfc);}return null;};}function patchUpdates(_0x5666d1){return function(_0x498783){try{jsonpatch['apply'](_0x498783,_0x5666d1,!![]);}catch(_0x35f96d){return BPromise[_0x9b38('0x22')](_0x35f96d);}return _0x498783[_0x9b38('0x23')]();};}function saveUpdates(_0x30037e,_0x1fbbd2){return function(_0x470001){if(_0x470001){return _0x470001[_0x9b38('0x24')](_0x30037e)[_0x9b38('0x25')](function(_0x3b65a3){return _0x3b65a3;});}return null;};}function removeEntity(_0x49bf64,_0x46c4c1){return function(_0x1d8b9a){if(_0x1d8b9a){return _0x1d8b9a['destroy']()[_0x9b38('0x25')](function(){_0x49bf64[_0x9b38('0x19')](0xcc)[_0x9b38('0x1a')]();});}};}function handleEntityNotFound(_0x4b375d,_0x38f9ae){return function(_0x595692){if(!_0x595692){_0x4b375d[_0x9b38('0x18')](0x194);}return _0x595692;};}function handleError(_0x364b01,_0x224020){_0x224020=_0x224020||0x1f4;return function(_0x2dca52){logger[_0x9b38('0x26')](_0x2dca52[_0x9b38('0x27')]);if(_0x2dca52['name']){delete _0x2dca52['name'];}_0x364b01['status'](_0x224020)[_0x9b38('0x28')](_0x2dca52);};}exports[_0x9b38('0x29')]=function(_0x2d23f0,_0x4498b0){var _0x3062fc={},_0x58fd49={},_0x206fa6={'count':0x0,'rows':[]};var _0x2c3ba1=_[_0x9b38('0x2a')](db[_0x9b38('0x2b')][_0x9b38('0x2c')],function(_0x1ea19d){return{'name':_0x1ea19d[_0x9b38('0x2d')],'type':_0x1ea19d[_0x9b38('0x2e')][_0x9b38('0x2f')]};});_0x58fd49[_0x9b38('0x30')]=_[_0x9b38('0x2a')](_0x2c3ba1,_0x9b38('0x31'));_0x58fd49[_0x9b38('0x32')]=_[_0x9b38('0x33')](_0x2d23f0[_0x9b38('0x32')]);_0x58fd49[_0x9b38('0x34')]=_[_0x9b38('0x35')](_0x58fd49[_0x9b38('0x30')],_0x58fd49['query']);_0x3062fc[_0x9b38('0x36')]=_[_0x9b38('0x35')](_0x58fd49[_0x9b38('0x30')],qs[_0x9b38('0x37')](_0x2d23f0[_0x9b38('0x32')][_0x9b38('0x37')]));_0x3062fc['attributes']=_0x3062fc['attributes'][_0x9b38('0x38')]?_0x3062fc[_0x9b38('0x36')]:_0x58fd49[_0x9b38('0x30')];if(!_0x2d23f0[_0x9b38('0x32')]['hasOwnProperty'](_0x9b38('0x39'))){_0x3062fc['limit']=qs[_0x9b38('0x1e')](_0x2d23f0[_0x9b38('0x32')][_0x9b38('0x1e')]);_0x3062fc['offset']=qs[_0x9b38('0x1c')](_0x2d23f0[_0x9b38('0x32')][_0x9b38('0x1c')]);}_0x3062fc[_0x9b38('0x3a')]=qs['sort'](_0x2d23f0[_0x9b38('0x32')][_0x9b38('0x3b')]);_0x3062fc[_0x9b38('0x3c')]=qs[_0x9b38('0x34')](_[_0x9b38('0x3d')](_0x2d23f0[_0x9b38('0x32')],_0x58fd49[_0x9b38('0x34')]),_0x2c3ba1);if(_0x2d23f0['query']['filter']){_0x3062fc[_0x9b38('0x3c')]=_[_0x9b38('0x3e')](_0x3062fc[_0x9b38('0x3c')],{'$or':_[_0x9b38('0x2a')](_0x2c3ba1,function(_0x45ca6a){if(_0x45ca6a[_0x9b38('0x2e')]!=='VIRTUAL'){var _0x3cca78={};_0x3cca78[_0x45ca6a[_0x9b38('0x31')]]={'$like':'%'+_0x2d23f0['query'][_0x9b38('0x3f')]+'%'};return _0x3cca78;}})});}_0x3062fc=_[_0x9b38('0x3e')]({},_0x3062fc,_0x2d23f0[_0x9b38('0x40')]);var _0x1da3e3={'where':_0x3062fc[_0x9b38('0x3c')]};return db['SquareDetailsReport']['count'](_0x1da3e3)[_0x9b38('0x25')](function(_0x521d3e){_0x206fa6[_0x9b38('0x1f')]=_0x521d3e;if(_0x2d23f0[_0x9b38('0x32')][_0x9b38('0x41')]){_0x3062fc[_0x9b38('0x42')]=[{'all':!![]}];}return db[_0x9b38('0x2b')][_0x9b38('0x43')](_0x3062fc);})[_0x9b38('0x25')](function(_0x8e61b0){_0x206fa6[_0x9b38('0x44')]=_0x8e61b0;return _0x206fa6;})[_0x9b38('0x25')](respondWithFilteredResult(_0x4498b0,_0x3062fc))[_0x9b38('0x45')](handleError(_0x4498b0,null));};exports[_0x9b38('0x46')]=function(_0x2430f8,_0x4b9623){var _0x4a73e8={'raw':!![],'where':{'id':_0x2430f8[_0x9b38('0x47')]['id']}},_0x559db5={};_0x559db5[_0x9b38('0x30')]=_[_0x9b38('0x33')](db[_0x9b38('0x2b')]['rawAttributes']);_0x559db5['query']=_[_0x9b38('0x33')](_0x2430f8[_0x9b38('0x32')]);_0x559db5[_0x9b38('0x34')]=_[_0x9b38('0x35')](_0x559db5[_0x9b38('0x30')],_0x559db5['query']);_0x4a73e8[_0x9b38('0x36')]=_[_0x9b38('0x35')](_0x559db5[_0x9b38('0x30')],qs[_0x9b38('0x37')](_0x2430f8[_0x9b38('0x32')][_0x9b38('0x37')]));_0x4a73e8[_0x9b38('0x36')]=_0x4a73e8[_0x9b38('0x36')][_0x9b38('0x38')]?_0x4a73e8[_0x9b38('0x36')]:_0x559db5[_0x9b38('0x30')];if(_0x2430f8[_0x9b38('0x32')]['includeAll']){_0x4a73e8[_0x9b38('0x42')]=[{'all':!![]}];}_0x4a73e8=_['merge']({},_0x4a73e8,_0x2430f8[_0x9b38('0x40')]);return db[_0x9b38('0x2b')][_0x9b38('0x48')](_0x4a73e8)[_0x9b38('0x25')](handleEntityNotFound(_0x4b9623,null))[_0x9b38('0x25')](respondWithResult(_0x4b9623,null))[_0x9b38('0x45')](handleError(_0x4b9623,null));};exports[_0x9b38('0x49')]=function(_0x43d5a4,_0x11f329){return db[_0x9b38('0x2b')]['create'](_0x43d5a4[_0x9b38('0x4a')],{})[_0x9b38('0x25')](respondWithResult(_0x11f329,0xc9))[_0x9b38('0x45')](handleError(_0x11f329,null));};exports[_0x9b38('0x24')]=function(_0x5b7145,_0x142452){if(_0x5b7145['body']['id']){delete _0x5b7145[_0x9b38('0x4a')]['id'];}return db['SquareDetailsReport'][_0x9b38('0x48')]({'where':{'id':_0x5b7145[_0x9b38('0x47')]['id']}})[_0x9b38('0x25')](handleEntityNotFound(_0x142452,null))[_0x9b38('0x25')](saveUpdates(_0x5b7145['body'],null))['then'](respondWithResult(_0x142452,null))[_0x9b38('0x45')](handleError(_0x142452,null));};exports[_0x9b38('0x4b')]=function(_0x2714fc,_0x19cb13){return db[_0x9b38('0x2b')][_0x9b38('0x48')]({'where':{'id':_0x2714fc['params']['id']}})[_0x9b38('0x25')](handleEntityNotFound(_0x19cb13,null))[_0x9b38('0x25')](removeEntity(_0x19cb13,null))['catch'](handleError(_0x19cb13,null));};exports[_0x9b38('0x4c')]=function(_0x343043,_0x22a584){return db['SquareDetailsReport'][_0x9b38('0x4c')]()[_0x9b38('0x25')](respondWithResult(_0x22a584,null))[_0x9b38('0x45')](handleError(_0x22a584,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f452599..07daad9 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 _0x56c0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x11a694,_0xce229c){var _0x1041e5=function(_0x3bf368){while(--_0x3bf368){_0x11a694['push'](_0x11a694['shift']());}};_0x1041e5(++_0xce229c);}(_0x56c0,0x12b));var _0x056c=function(_0x5b47fa,_0x42b2c6){_0x5b47fa=_0x5b47fa-0x0;var _0x34aeae=_0x56c0[_0x5b47fa];return _0x34aeae;};'use strict';var _=require(_0x056c('0x0'));var util=require('util');var logger=require(_0x056c('0x1'))(_0x056c('0x2'));var moment=require(_0x056c('0x3'));var BPromise=require(_0x056c('0x4'));var rp=require(_0x056c('0x5'));var fs=require('fs');var path=require(_0x056c('0x6'));var rimraf=require('rimraf');var config=require(_0x056c('0x7'));var attributes=require(_0x056c('0x8'));module['exports']=function(_0x2cb0ee,_0x208649){return _0x2cb0ee[_0x056c('0x9')](_0x056c('0xa'),attributes,{'tableName':_0x056c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fb5=['rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fb5,0xca));var _0x54fb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4fb5[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x54fb('0x0'));var util=require(_0x54fb('0x1'));var logger=require(_0x54fb('0x2'))(_0x54fb('0x3'));var moment=require(_0x54fb('0x4'));var BPromise=require(_0x54fb('0x5'));var rp=require(_0x54fb('0x6'));var fs=require('fs');var path=require(_0x54fb('0x7'));var rimraf=require(_0x54fb('0x8'));var config=require('../../config/environment');var attributes=require(_0x54fb('0x9'));module[_0x54fb('0xa')]=function(_0x452c0c,_0x548e1f){return _0x452c0c[_0x54fb('0xb')](_0x54fb('0xc'),attributes,{'tableName':_0x54fb('0xd'),'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 b78706c..13215db 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 _0x7382=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','stringify','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x632aa4,_0x20076f){var _0x82b9d3=function(_0x11cf5c){while(--_0x11cf5c){_0x632aa4['push'](_0x632aa4['shift']());}};_0x82b9d3(++_0x20076f);}(_0x7382,0x111));var _0x2738=function(_0x2ce774,_0x49c84a){_0x2ce774=_0x2ce774-0x0;var _0xd84a5a=_0x7382[_0x2ce774];return _0xd84a5a;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));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(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});}; \ No newline at end of file +var _0xe493=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','create','options','raw','lodash','util','moment','bluebird'];(function(_0x4a4125,_0x43fe9f){var _0x3501b9=function(_0x65be93){while(--_0x65be93){_0x4a4125['push'](_0x4a4125['shift']());}};_0x3501b9(++_0x43fe9f);}(_0xe493,0x7e));var _0x3e49=function(_0x57c180,_0x4303ee){_0x57c180=_0x57c180-0x0;var _0x5b7062=_0xe493[_0x57c180];return _0x5b7062;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var moment=require(_0x3e49('0x2'));var BPromise=require(_0x3e49('0x3'));var rs=require(_0x3e49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e49('0x5'))['db'];var utils=require(_0x3e49('0x6'));var logger=require('../../config/logger')(_0x3e49('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e49('0x8'));var client=jayson[_0x3e49('0x9')][_0x3e49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7821,_0x12dd84,_0x3626b6){return new BPromise(function(_0x4e96ac,_0x56b767){return client['request'](_0x3f7821,_0x3626b6)[_0x3e49('0xb')](function(_0x8b8c0e){logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));logger[_0x3e49('0xf')](_0x3e49('0x10'),_0x12dd84,_0x3e49('0xe'),JSON[_0x3e49('0x11')](_0x8b8c0e));if(_0x8b8c0e[_0x3e49('0x12')]){if(_0x8b8c0e[_0x3e49('0x12')]['code']===0x1f4){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x56b767(_0x8b8c0e[_0x3e49('0x12')]['message']);}logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x4e96ac(_0x8b8c0e[_0x3e49('0x12')][_0x3e49('0x13')]);}else{logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));_0x4e96ac(_0x8b8c0e[_0x3e49('0x14')][_0x3e49('0x13')]);}})[_0x3e49('0x15')](function(_0x1d9cce){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x1d9cce);_0x56b767(_0x1d9cce);});});}exports[_0x3e49('0x16')]=function(_0x3ae5f4){var _0x448c36=this;return new Promise(function(_0x4e1cdf,_0xf33205){return db['SquareDetailsReport'][_0x3e49('0x17')](_0x3ae5f4['body'],{'raw':_0x3ae5f4[_0x3e49('0x18')]?_0x3ae5f4['options'][_0x3e49('0x19')]===undefined?!![]:![]:!![]})[_0x3e49('0xb')](function(_0x420d7b){logger['info'](_0x3e49('0x16'),_0x3ae5f4);logger['debug'](_0x3e49('0x16'),_0x3ae5f4,JSON[_0x3e49('0x11')](_0x420d7b));_0x4e1cdf(_0x420d7b);})[_0x3e49('0x15')](function(_0x5e0f1d){logger['error'](_0x3e49('0x16'),_0x5e0f1d['message'],_0x3ae5f4);_0xf33205(_0x448c36[_0x3e49('0x12')](0x1f4,_0x5e0f1d[_0x3e49('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3f9ce81..12f8ef3 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 _0xec14=['isAuthenticated','index','/process/:pid/kill','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x5459b0,_0x4d2ef8){var _0x675a35=function(_0x538e11){while(--_0x538e11){_0x5459b0['push'](_0x5459b0['shift']());}};_0x675a35(++_0x4d2ef8);}(_0xec14,0x1ac));var _0x4ec1=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xec14[_0x373dee];return _0x46798f;};'use strict';var express=require(_0x4ec1('0x0'));var router=express[_0x4ec1('0x1')]();var auth=require(_0x4ec1('0x2'));var controller=require(_0x4ec1('0x3'));router['get']('/',auth[_0x4ec1('0x4')](),controller[_0x4ec1('0x5')]);router['get'](_0x4ec1('0x6'),auth[_0x4ec1('0x4')](),controller['killProcess']);module[_0x4ec1('0x7')]=router; \ No newline at end of file +var _0x80d8=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','../../components/auth/service','./system.controller','index','get'];(function(_0x59168c,_0x17a1c1){var _0x4fd2e3=function(_0x4bb77e){while(--_0x4bb77e){_0x59168c['push'](_0x59168c['shift']());}};_0x4fd2e3(++_0x17a1c1);}(_0x80d8,0x12d));var _0x880d=function(_0x2f25ed,_0x3e0622){_0x2f25ed=_0x2f25ed-0x0;var _0x19c980=_0x80d8[_0x2f25ed];return _0x19c980;};'use strict';var express=require(_0x880d('0x0'));var router=express['Router']();var auth=require(_0x880d('0x1'));var controller=require(_0x880d('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x880d('0x3')]);router[_0x880d('0x4')](_0x880d('0x5'),auth[_0x880d('0x6')](),controller[_0x880d('0x7')]);module[_0x880d('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 8520b9a..07056f3 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 _0xd60f=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','getAllData','json','catch','status','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','SIGINT','killProcess','child_process','exec','util'];(function(_0x38690a,_0x266237){var _0xac4ede=function(_0x17bd4f){while(--_0x17bd4f){_0x38690a['push'](_0x38690a['shift']());}};_0xac4ede(++_0x266237);}(_0xd60f,0x1a6));var _0xfd60=function(_0x522903,_0x1c42c7){_0x522903=_0x522903-0x0;var _0x4f43d6=_0xd60f[_0x522903];return _0x4f43d6;};'use strict';var info=require('systeminformation');var exec=require(_0xfd60('0x0'))[_0xfd60('0x1')];var logger=require('../../config/logger')('api');var util=require(_0xfd60('0x2'));var BPromise=require(_0xfd60('0x3'));var _=require(_0xfd60('0x4'));function handleError(_0x25dfcd,_0x5e09a4,_0x3a91b9){_0x5e09a4=_0x5e09a4||0x1f4;return function(_0x3897cd){logger[_0xfd60('0x5')](_0xfd60('0x6'),_0x3a91b9,_0x5e09a4,util[_0xfd60('0x7')](_0x3897cd,{'showHidden':![],'depth':null}));delete _0x3897cd[_0xfd60('0x8')];_0x25dfcd['status'](_0x5e09a4)['send'](_0x3897cd);};}exports['index']=function(_0x1933fb,_0x2ea0f1){return info[_0xfd60('0x9')]()['then'](function(_0x424f9d){return _0x2ea0f1['status'](0xc8)[_0xfd60('0xa')](_0x424f9d);})[_0xfd60('0xb')](function(_0x56148c){return _0x2ea0f1[_0xfd60('0xc')](0x1f4)['json'](_0x56148c);});};exports['killProcess']=function(_0x18d132,_0xe9a0d6){var _0x587037=[_0xfd60('0xd')];return new BPromise(function(_0x2879dd,_0xe6dca7){return exec(util[_0xfd60('0xe')](_0xfd60('0xf'),_0x18d132['params'][_0xfd60('0x10')]),function(_0x8011eb,_0x5a5708,_0x19c83d){if(_0x8011eb){return _0xe6dca7(_0x8011eb);}return _0x2879dd(_0x5a5708);});})[_0xfd60('0x11')](function(_0x2497d4){var _0x459e2a=![];var _0x1d4f20=_0x2497d4[_0xfd60('0x12')](/\n/);for(var _0xb391dd=0x0,_0x5a4d84=_0x587037[_0xfd60('0x13')];_0xb391dd<_0x5a4d84,_0x459e2a===![];_0xb391dd+=0x1){if(_0x2497d4['indexOf'](_0x587037[_0xb391dd])>=0x0){_0x459e2a=!![];}}if(!_0x459e2a){throw new Error(util['format'](_0xfd60('0x14'),_0x18d132['params'][_0xfd60('0x10')]));}process[_0xfd60('0x15')](_0x18d132[_0xfd60('0x16')][_0xfd60('0x10')],_0xfd60('0x17'));return _0xe9a0d6['status'](0xc8)[_0xfd60('0xa')]({'message':util[_0xfd60('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x18d132[_0xfd60('0x16')][_0xfd60('0x10')])});})[_0xfd60('0xb')](handleError(_0xe9a0d6,null,_0xfd60('0x18')));}; \ No newline at end of file +var _0x7c8c=['index','then','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','name','status'];(function(_0x433843,_0x1e7f0e){var _0x55e749=function(_0x2014bb){while(--_0x2014bb){_0x433843['push'](_0x433843['shift']());}};_0x55e749(++_0x1e7f0e);}(_0x7c8c,0x16d));var _0xc7c8=function(_0x28db9a,_0x4f5d8a){_0x28db9a=_0x28db9a-0x0;var _0x2c6138=_0x7c8c[_0x28db9a];return _0x2c6138;};'use strict';var info=require(_0xc7c8('0x0'));var exec=require(_0xc7c8('0x1'))['exec'];var logger=require(_0xc7c8('0x2'))(_0xc7c8('0x3'));var util=require(_0xc7c8('0x4'));var BPromise=require(_0xc7c8('0x5'));var _=require(_0xc7c8('0x6'));function handleError(_0x5ab593,_0x109c9a,_0x4360bc){_0x109c9a=_0x109c9a||0x1f4;return function(_0x4acb54){logger[_0xc7c8('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4360bc,_0x109c9a,util['inspect'](_0x4acb54,{'showHidden':![],'depth':null}));delete _0x4acb54[_0xc7c8('0x8')];_0x5ab593[_0xc7c8('0x9')](_0x109c9a)['send'](_0x4acb54);};}exports[_0xc7c8('0xa')]=function(_0x141fa3,_0x1981b1){return info['getAllData']()[_0xc7c8('0xb')](function(_0x161799){return _0x1981b1[_0xc7c8('0x9')](0xc8)['json'](_0x161799);})['catch'](function(_0x184ac3){return _0x1981b1[_0xc7c8('0x9')](0x1f4)['json'](_0x184ac3);});};exports[_0xc7c8('0xc')]=function(_0x53f0f7,_0x20c519){var _0x58c0e9=[_0xc7c8('0xd')];return new BPromise(function(_0x492b18,_0xaa2fc9){return exec(util[_0xc7c8('0xe')](_0xc7c8('0xf'),_0x53f0f7['params'][_0xc7c8('0x10')]),function(_0x8ace99,_0x571b2a,_0x4dbf13){if(_0x8ace99){return _0xaa2fc9(_0x8ace99);}return _0x492b18(_0x571b2a);});})['then'](function(_0x90adc6){var _0x4dac60=![];var _0x4a1c6f=_0x90adc6[_0xc7c8('0x11')](/\n/);for(var _0x15b845=0x0,_0x4f0bbf=_0x58c0e9['length'];_0x15b845<_0x4f0bbf,_0x4dac60===![];_0x15b845+=0x1){if(_0x90adc6[_0xc7c8('0x12')](_0x58c0e9[_0x15b845])>=0x0){_0x4dac60=!![];}}if(!_0x4dac60){throw new Error(util['format'](_0xc7c8('0x13'),_0x53f0f7[_0xc7c8('0x14')][_0xc7c8('0x10')]));}process['kill'](_0x53f0f7['params']['pid'],_0xc7c8('0x15'));return _0x20c519[_0xc7c8('0x9')](0xc8)[_0xc7c8('0x16')]({'message':util[_0xc7c8('0xe')](_0xc7c8('0x17'),_0x53f0f7[_0xc7c8('0x14')]['pid'])});})[_0xc7c8('0x18')](handleError(_0x20c519,null,_0xc7c8('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8dd0dc3..3b8d9e1 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 _0x7c5a=['../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','show','post','create','put','/:id','destroy','exports','util','path'];(function(_0x14aea5,_0xa0740f){var _0x571a59=function(_0x1a7dbe){while(--_0x1a7dbe){_0x14aea5['push'](_0x14aea5['shift']());}};_0x571a59(++_0xa0740f);}(_0x7c5a,0x184));var _0xa7c5=function(_0x46ad9e,_0x44df29){_0x46ad9e=_0x46ad9e-0x0;var _0x470e4a=_0x7c5a[_0x46ad9e];return _0x470e4a;};'use strict';var multer=require('multer');var util=require(_0xa7c5('0x0'));var path=require(_0xa7c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa7c5('0x2'));var interaction=require(_0xa7c5('0x3'));var config=require('../../config/environment');var controller=require(_0xa7c5('0x4'));router['get']('/',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0x6')]);router[_0xa7c5('0x7')]('/:id',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0x8')]);router[_0xa7c5('0x9')]('/',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0xa')]);router[_0xa7c5('0xb')](_0xa7c5('0xc'),auth[_0xa7c5('0x5')](),controller['update']);router['delete']('/:id',auth[_0xa7c5('0x5')](),controller[_0xa7c5('0xd')]);module[_0xa7c5('0xe')]=router; \ No newline at end of file +var _0xf22d=['../../components/interaction/service','./tag.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x204300,_0xd48962){var _0x41541f=function(_0x144488){while(--_0x144488){_0x204300['push'](_0x204300['shift']());}};_0x41541f(++_0xd48962);}(_0xf22d,0x150));var _0xdf22=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xf22d[_0x20e7e3];return _0x14b9de;};'use strict';var multer=require(_0xdf22('0x0'));var util=require('util');var path=require(_0xdf22('0x1'));var timeout=require(_0xdf22('0x2'));var express=require(_0xdf22('0x3'));var router=express['Router']();var fs_extra=require(_0xdf22('0x4'));var auth=require(_0xdf22('0x5'));var interaction=require(_0xdf22('0x6'));var config=require('../../config/environment');var controller=require(_0xdf22('0x7'));router[_0xdf22('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf22('0x9')]);router[_0xdf22('0x8')](_0xdf22('0xa'),auth[_0xdf22('0xb')](),controller[_0xdf22('0xc')]);router[_0xdf22('0xd')]('/',auth[_0xdf22('0xb')](),controller['create']);router[_0xdf22('0xe')](_0xdf22('0xa'),auth[_0xdf22('0xb')](),controller[_0xdf22('0xf')]);router[_0xdf22('0x10')](_0xdf22('0xa'),auth[_0xdf22('0xb')](),controller[_0xdf22('0x11')]);module[_0xdf22('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 51833e6..ec6a708 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 _0xb84e=['STRING','name','exports'];(function(_0x28e3de,_0x53c407){var _0xd5954b=function(_0x246952){while(--_0x246952){_0x28e3de['push'](_0x28e3de['shift']());}};_0xd5954b(++_0x53c407);}(_0xb84e,0xbf));var _0xeb84=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xb84e[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require('sequelize');module[_0xeb84('0x0')]={'name':{'type':Sequelize[_0xeb84('0x1')],'unique':_0xeb84('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb84('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb78e=['STRING','#0091EA','sequelize','exports','name'];(function(_0x4d5ccb,_0x3bdbfe){var _0x29c4ae=function(_0x5678c1){while(--_0x5678c1){_0x4d5ccb['push'](_0x4d5ccb['shift']());}};_0x29c4ae(++_0x3bdbfe);}(_0xb78e,0x1c9));var _0xeb78=function(_0x294f08,_0x1ea447){_0x294f08=_0x294f08-0x0;var _0x382ab4=_0xb78e[_0x294f08];return _0x382ab4;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xeb78('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb78('0x3')],'defaultValue':_0xeb78('0x4')},'description':{'type':Sequelize[_0xeb78('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a4ed17e..b32c119 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 _0xf4eb=['body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create'];(function(_0x4daf96,_0x30ffec){var _0x3f88ed=function(_0x2bab56){while(--_0x2bab56){_0x4daf96['push'](_0x4daf96['shift']());}};_0x3f88ed(++_0x30ffec);}(_0xf4eb,0xec));var _0xbf4e=function(_0xf6a9b3,_0x5cdaba){_0xf6a9b3=_0xf6a9b3-0x0;var _0x3d0a82=_0xf4eb[_0xf6a9b3];return _0x3d0a82;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['Tag'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));}; \ No newline at end of file +var _0x85b5=['save','then','get','Tags','UserProfileResource','destroy','sendStatus','error','stack','send','map','Tag','rawAttributes','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject'];(function(_0x40b004,_0x5e46f5){var _0x4344e0=function(_0x19b96d){while(--_0x19b96d){_0x40b004['push'](_0x40b004['shift']());}};_0x4344e0(++_0x5e46f5);}(_0x85b5,0x7f));var _0x585b=function(_0x5c6604,_0x1b8c1e){_0x5c6604=_0x5c6604-0x0;var _0x5c0d85=_0x85b5[_0x5c6604];return _0x5c0d85;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){var _0x10dd42=_0x1c8a7b[_0x585b('0x21')]({'plain':!![]});var _0x428a9a=_0x585b('0x22');return db[_0x585b('0x23')][_0x585b('0x24')]({'where':{'type':_0x428a9a,'resourceId':_0x10dd42['id']}})[_0x585b('0x20')](function(){return _0x1c8a7b;});})[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x35075c,_0x11dc56){return function(_0x476ed9){if(!_0x476ed9){_0x35075c[_0x585b('0x25')](0x194);}return _0x476ed9;};}function handleError(_0x554099,_0x2f848c){_0x2f848c=_0x2f848c||0x1f4;return function(_0x205ffe){logger[_0x585b('0x26')](_0x205ffe[_0x585b('0x27')]);if(_0x205ffe['name']){delete _0x205ffe['name'];}_0x554099[_0x585b('0x15')](_0x2f848c)[_0x585b('0x28')](_0x205ffe);};}exports['index']=function(_0x2ce768,_0x112fb5){var _0x5c9249={},_0x47020d={},_0x3e700a={'count':0x0,'rows':[]};var _0x2ab871=_[_0x585b('0x29')](db[_0x585b('0x2a')][_0x585b('0x2b')],function(_0x227149){return{'name':_0x227149[_0x585b('0x2c')],'type':_0x227149[_0x585b('0x2d')][_0x585b('0x2e')]};});_0x47020d['model']=_[_0x585b('0x29')](_0x2ab871,_0x585b('0x2f'));_0x47020d[_0x585b('0x30')]=_['keys'](_0x2ce768[_0x585b('0x30')]);_0x47020d[_0x585b('0x31')]=_[_0x585b('0x32')](_0x47020d['model'],_0x47020d[_0x585b('0x30')]);_0x5c9249[_0x585b('0x33')]=_[_0x585b('0x32')](_0x47020d[_0x585b('0x34')],qs['fields'](_0x2ce768['query'][_0x585b('0x35')]));_0x5c9249[_0x585b('0x33')]=_0x5c9249[_0x585b('0x33')][_0x585b('0x36')]?_0x5c9249[_0x585b('0x33')]:_0x47020d['model'];if(!_0x2ce768[_0x585b('0x30')][_0x585b('0x37')](_0x585b('0x38'))){_0x5c9249[_0x585b('0x1b')]=qs[_0x585b('0x1b')](_0x2ce768['query']['limit']);_0x5c9249['offset']=qs[_0x585b('0x1a')](_0x2ce768[_0x585b('0x30')][_0x585b('0x1a')]);}_0x5c9249[_0x585b('0x39')]=qs[_0x585b('0x3a')](_0x2ce768[_0x585b('0x30')][_0x585b('0x3a')]);_0x5c9249[_0x585b('0x3b')]=qs[_0x585b('0x31')](_['pick'](_0x2ce768[_0x585b('0x30')],_0x47020d[_0x585b('0x31')]),_0x2ab871);if(_0x2ce768['query'][_0x585b('0x3c')]){_0x5c9249[_0x585b('0x3b')]=_[_0x585b('0x3d')](_0x5c9249[_0x585b('0x3b')],{'$or':_[_0x585b('0x29')](_0x2ab871,function(_0x12f7b1){if(_0x12f7b1['type']!==_0x585b('0x3e')){var _0x3c10b2={};_0x3c10b2[_0x12f7b1[_0x585b('0x2f')]]={'$like':'%'+_0x2ce768[_0x585b('0x30')][_0x585b('0x3c')]+'%'};return _0x3c10b2;}})});}_0x5c9249=_[_0x585b('0x3d')]({},_0x5c9249,_0x2ce768[_0x585b('0x3f')]);var _0xc543ca={'where':_0x5c9249['where']};return db[_0x585b('0x2a')][_0x585b('0x19')](_0xc543ca)[_0x585b('0x20')](function(_0x4c5a14){_0x3e700a[_0x585b('0x19')]=_0x4c5a14;if(_0x2ce768[_0x585b('0x30')][_0x585b('0x40')]){_0x5c9249['include']=[{'all':!![]}];}return db[_0x585b('0x2a')][_0x585b('0x41')](_0x5c9249);})['then'](function(_0x4edd57){_0x3e700a[_0x585b('0x42')]=_0x4edd57;return _0x3e700a;})['then'](respondWithFilteredResult(_0x112fb5,_0x5c9249))[_0x585b('0x43')](handleError(_0x112fb5,null));};exports['show']=function(_0x207d79,_0x33380b){var _0x5e989e={'raw':!![],'where':{'id':_0x207d79['params']['id']}},_0xa26652={};_0xa26652['model']=_['keys'](db[_0x585b('0x2a')]['rawAttributes']);_0xa26652[_0x585b('0x30')]=_[_0x585b('0x44')](_0x207d79['query']);_0xa26652[_0x585b('0x31')]=_[_0x585b('0x32')](_0xa26652[_0x585b('0x34')],_0xa26652['query']);_0x5e989e['attributes']=_['intersection'](_0xa26652[_0x585b('0x34')],qs[_0x585b('0x35')](_0x207d79[_0x585b('0x30')][_0x585b('0x35')]));_0x5e989e['attributes']=_0x5e989e[_0x585b('0x33')][_0x585b('0x36')]?_0x5e989e[_0x585b('0x33')]:_0xa26652[_0x585b('0x34')];if(_0x207d79['query'][_0x585b('0x40')]){_0x5e989e[_0x585b('0x45')]=[{'all':!![]}];}_0x5e989e=_[_0x585b('0x3d')]({},_0x5e989e,_0x207d79[_0x585b('0x3f')]);return db[_0x585b('0x2a')]['find'](_0x5e989e)['then'](handleEntityNotFound(_0x33380b,null))['then'](respondWithResult(_0x33380b,null))[_0x585b('0x43')](handleError(_0x33380b,null));};exports['create']=function(_0x1f8ae0,_0x54ab6f){return db['Tag']['create'](_0x1f8ae0[_0x585b('0x46')],{})[_0x585b('0x20')](function(_0x47c349){var _0x5116a8=_0x1f8ae0[_0x585b('0x47')][_0x585b('0x21')]({'plain':!![]});if(!_0x5116a8)throw new Error(_0x585b('0x48'));if(_0x5116a8['role']===_0x585b('0x47')){var _0x4ca120=_0x47c349[_0x585b('0x21')]({'plain':!![]});var _0x5f31cb=_0x585b('0x22');return db['UserProfileSection'][_0x585b('0x49')]({'where':{'name':_0x5f31cb,'userProfileId':_0x5116a8['userProfileId']},'raw':!![]})[_0x585b('0x20')](function(_0x259dac){if(_0x259dac&&_0x259dac[_0x585b('0x4a')]===0x0){return db[_0x585b('0x23')][_0x585b('0x4b')]({'name':_0x4ca120['name'],'resourceId':_0x4ca120['id'],'type':_0x259dac[_0x585b('0x2f')],'sectionId':_0x259dac['id']},{})[_0x585b('0x20')](function(){return _0x47c349;});}else{return _0x47c349;}})[_0x585b('0x43')](function(_0x2d0f60){logger[_0x585b('0x26')](_0x585b('0x4c'),_0x2d0f60);throw _0x2d0f60;});}return _0x47c349;})['then'](respondWithResult(_0x54ab6f,0xc9))[_0x585b('0x43')](handleError(_0x54ab6f,null));};exports[_0x585b('0x4d')]=function(_0x14a30b,_0x2f0741){if(_0x14a30b['body']['id']){delete _0x14a30b[_0x585b('0x46')]['id'];}return db[_0x585b('0x2a')][_0x585b('0x49')]({'where':{'id':_0x14a30b['params']['id']}})['then'](handleEntityNotFound(_0x2f0741,null))['then'](saveUpdates(_0x14a30b['body'],null))['then'](respondWithResult(_0x2f0741,null))['catch'](handleError(_0x2f0741,null));};exports[_0x585b('0x24')]=function(_0x39f29e,_0x102733){return db['Tag'][_0x585b('0x49')]({'where':{'id':_0x39f29e[_0x585b('0x4e')]['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x102733,null))[_0x585b('0x20')](removeEntity(_0x102733,null))['catch'](handleError(_0x102733,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 5d05a22..098d1cc 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 _0x0e5c=['../../config/logger','api','moment','bluebird','path','./tag.attributes','exports','tools_tags','lodash','util'];(function(_0x2f4402,_0x7ae62e){var _0x332446=function(_0x418082){while(--_0x418082){_0x2f4402['push'](_0x2f4402['shift']());}};_0x332446(++_0x7ae62e);}(_0x0e5c,0x1e8));var _0xc0e5=function(_0x5be795,_0x1cb1b8){_0x5be795=_0x5be795-0x0;var _0x4e8a3b=_0x0e5c[_0x5be795];return _0x4e8a3b;};'use strict';var _=require(_0xc0e5('0x0'));var util=require(_0xc0e5('0x1'));var logger=require(_0xc0e5('0x2'))(_0xc0e5('0x3'));var moment=require(_0xc0e5('0x4'));var BPromise=require(_0xc0e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0e5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc0e5('0x7'));module[_0xc0e5('0x8')]=function(_0x17d889,_0x4866df){return _0x17d889['define']('Tag',attributes,{'tableName':_0xc0e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91b0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','lodash','util','../../config/logger','api'];(function(_0x518892,_0x3fe64e){var _0x2ad247=function(_0x5b4327){while(--_0x5b4327){_0x518892['push'](_0x518892['shift']());}};_0x2ad247(++_0x3fe64e);}(_0x91b0,0x1ca));var _0x091b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x91b0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x091b('0x0'));var util=require(_0x091b('0x1'));var logger=require(_0x091b('0x2'))(_0x091b('0x3'));var moment=require(_0x091b('0x4'));var BPromise=require(_0x091b('0x5'));var rp=require(_0x091b('0x6'));var fs=require('fs');var path=require(_0x091b('0x7'));var rimraf=require(_0x091b('0x8'));var config=require(_0x091b('0x9'));var attributes=require(_0x091b('0xa'));module['exports']=function(_0x4b7c11,_0x58e92f){return _0x4b7c11['define']('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 9c499b3..5e531bf 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 _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x39507b,_0x3efdac){var _0x5e7dd4=function(_0x18527e){while(--_0x18527e){_0x39507b['push'](_0x39507b['shift']());}};_0x5e7dd4(++_0x3efdac);}(_0x207c,0x1e8));var _0xc207=function(_0x2efb96,_0x40a4ce){_0x2efb96=_0x2efb96-0x0;var _0x50d38d=_0x207c[_0x2efb96];return _0x50d38d;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('Tag,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('Tag,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});} \ No newline at end of file +var _0xb458=['Tag,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','debug'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb458,0x103));var _0x8b45=function(_0x682cd2,_0x38817d){_0x682cd2=_0x682cd2-0x0;var _0x3aacb7=_0xb458[_0x682cd2];return _0x3aacb7;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f07cb69..78b845e 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 53b75ec..a32f9ed 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 _0xb10b=['name','sequelize','STRING'];(function(_0x2a6023,_0x1b8215){var _0x6332=function(_0x53a75b){while(--_0x53a75b){_0x2a6023['push'](_0x2a6023['shift']());}};_0x6332(++_0x1b8215);}(_0xb10b,0x12a));var _0xbb10=function(_0x54d506,_0xabf5c2){_0x54d506=_0x54d506-0x0;var _0x5d3040=_0xb10b[_0x54d506];return _0x5d3040;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e46bb9e..5e641e3 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 _0x2a06=['intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','toLowerCase','Queue','order','pick','capitalize','channel','Queues','addQueues','ValidationError','Unknown\x20channel','add','ids','removeQueues','remove','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','QueueId','online','voicePause','isNil','format','SIP/%s','interface','all','upsert','addAgents','spread','removeAgents','isArray','UserVoiceQueueRt','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./team.socket','register','sendStatus','status','end','offset','undefined','count','set','json','apply','save','update','then','stack','name','send','map','Team','rawAttributes','fieldName','type','model','query','keys'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x2a06,0x1a2));var _0x62a0=function(_0x2da29f,_0x2f1bba){_0x2da29f=_0x2da29f-0x0;var _0x3b0a84=_0x2a06[_0x2da29f];return _0x3b0a84;};'use strict';var emlformat=require(_0x62a0('0x0'));var rimraf=require(_0x62a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62a0('0x2'));var rp=require(_0x62a0('0x3'));var moment=require('moment');var BPromise=require(_0x62a0('0x4'));var Mustache=require('mustache');var util=require(_0x62a0('0x5'));var path=require('path');var sox=require(_0x62a0('0x6'));var csv=require(_0x62a0('0x7'));var ejs=require(_0x62a0('0x8'));var fs=require('fs');var fs_extra=require(_0x62a0('0x9'));var _=require(_0x62a0('0xa'));var squel=require(_0x62a0('0xb'));var crypto=require(_0x62a0('0xc'));var jsforce=require(_0x62a0('0xd'));var deskjs=require(_0x62a0('0xe'));var toCsv=require(_0x62a0('0x7'));var querystring=require(_0x62a0('0xf'));var Papa=require('papaparse');var Redis=require(_0x62a0('0x10'));var authService=require(_0x62a0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x62a0('0x12'));var hardwareService=require(_0x62a0('0x13'));var logger=require(_0x62a0('0x14'))(_0x62a0('0x15'));var utils=require('../../config/utils');var config=require(_0x62a0('0x16'));var licenseUtil=require(_0x62a0('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x62a0('0x18')](config['redis'],{'host':_0x62a0('0x19'),'port':0x18eb});var socket=require(_0x62a0('0x1a'))(new Redis(config[_0x62a0('0x1b')]));require(_0x62a0('0x1c'))[_0x62a0('0x1d')](socket);function respondWithStatusCode(_0x2729b9,_0x5ac616){_0x5ac616=_0x5ac616||0xcc;return function(_0x4f2355){if(_0x4f2355){return _0x2729b9[_0x62a0('0x1e')](_0x5ac616);}return _0x2729b9[_0x62a0('0x1f')](_0x5ac616)[_0x62a0('0x20')]();};}function respondWithResult(_0x575f7f,_0x10ec23){_0x10ec23=_0x10ec23||0xc8;return function(_0x1dbcaa){if(_0x1dbcaa){return _0x575f7f[_0x62a0('0x1f')](_0x10ec23)['json'](_0x1dbcaa);}};}function respondWithFilteredResult(_0x5144b6,_0x52c417){return function(_0x4b25aa){if(_0x4b25aa){var _0x2e4358=typeof _0x52c417[_0x62a0('0x21')]===_0x62a0('0x22')&&typeof _0x52c417['limit']===_0x62a0('0x22');var _0x17076e=_0x4b25aa['count'];var _0x418a38=_0x2e4358?0x0:_0x52c417[_0x62a0('0x21')];var _0x1d21b2=_0x2e4358?_0x4b25aa[_0x62a0('0x23')]:_0x52c417['offset']+_0x52c417['limit'];var _0x472e7f;if(_0x1d21b2>=_0x17076e){_0x1d21b2=_0x17076e;_0x472e7f=0xc8;}else{_0x472e7f=0xce;}_0x5144b6[_0x62a0('0x1f')](_0x472e7f);return _0x5144b6[_0x62a0('0x24')]('Content-Range',_0x418a38+'-'+_0x1d21b2+'/'+_0x17076e)[_0x62a0('0x25')](_0x4b25aa);}return null;};}function patchUpdates(_0xeff190){return function(_0x447ab0){try{jsonpatch[_0x62a0('0x26')](_0x447ab0,_0xeff190,!![]);}catch(_0x3da50c){return BPromise['reject'](_0x3da50c);}return _0x447ab0[_0x62a0('0x27')]();};}function saveUpdates(_0x3636ac,_0x1f7609){return function(_0x53bea1){if(_0x53bea1){return _0x53bea1[_0x62a0('0x28')](_0x3636ac)[_0x62a0('0x29')](function(_0x577f57){return _0x577f57;});}return null;};}function handleEntityNotFound(_0xe912fe,_0x11a11f){return function(_0x1c5a71){if(!_0x1c5a71){_0xe912fe[_0x62a0('0x1e')](0x194);}return _0x1c5a71;};}function handleError(_0x5b5c1c,_0x3d40c2){_0x3d40c2=_0x3d40c2||0x1f4;return function(_0x56672d){logger['error'](_0x56672d[_0x62a0('0x2a')]);if(_0x56672d[_0x62a0('0x2b')]){delete _0x56672d[_0x62a0('0x2b')];}_0x5b5c1c[_0x62a0('0x1f')](_0x3d40c2)[_0x62a0('0x2c')](_0x56672d);};}exports['index']=function(_0x1861c9,_0x47f8f8){var _0x5c41d7={},_0x4d0906={},_0x358596={'count':0x0,'rows':[]};var _0x167e7a=_[_0x62a0('0x2d')](db[_0x62a0('0x2e')][_0x62a0('0x2f')],function(_0x448c04){return{'name':_0x448c04[_0x62a0('0x30')],'type':_0x448c04[_0x62a0('0x31')]['key']};});_0x4d0906[_0x62a0('0x32')]=_[_0x62a0('0x2d')](_0x167e7a,_0x62a0('0x2b'));_0x4d0906[_0x62a0('0x33')]=_[_0x62a0('0x34')](_0x1861c9[_0x62a0('0x33')]);_0x4d0906['filters']=_[_0x62a0('0x35')](_0x4d0906[_0x62a0('0x32')],_0x4d0906[_0x62a0('0x33')]);_0x5c41d7[_0x62a0('0x36')]=_[_0x62a0('0x35')](_0x4d0906[_0x62a0('0x32')],qs[_0x62a0('0x37')](_0x1861c9[_0x62a0('0x33')][_0x62a0('0x37')]));_0x5c41d7[_0x62a0('0x36')]=_0x5c41d7[_0x62a0('0x36')][_0x62a0('0x38')]?_0x5c41d7[_0x62a0('0x36')]:_0x4d0906['model'];if(!_0x1861c9['query'][_0x62a0('0x39')]('nolimit')){_0x5c41d7['limit']=qs[_0x62a0('0x3a')](_0x1861c9[_0x62a0('0x33')][_0x62a0('0x3a')]);_0x5c41d7['offset']=qs[_0x62a0('0x21')](_0x1861c9[_0x62a0('0x33')][_0x62a0('0x21')]);}_0x5c41d7['order']=qs[_0x62a0('0x3b')](_0x1861c9['query']['sort']);_0x5c41d7[_0x62a0('0x3c')]=qs[_0x62a0('0x3d')](_['pick'](_0x1861c9[_0x62a0('0x33')],_0x4d0906[_0x62a0('0x3d')]),_0x167e7a);if(_0x1861c9[_0x62a0('0x33')][_0x62a0('0x3e')]){_0x5c41d7['where']=_['merge'](_0x5c41d7['where'],{'$or':_[_0x62a0('0x2d')](_0x167e7a,function(_0x48199d){if(_0x48199d[_0x62a0('0x31')]!==_0x62a0('0x3f')){var _0x14733c={};_0x14733c[_0x48199d['name']]={'$like':'%'+_0x1861c9['query']['filter']+'%'};return _0x14733c;}})});}_0x5c41d7=_[_0x62a0('0x40')]({},_0x5c41d7,_0x1861c9[_0x62a0('0x41')]);var _0xf907cc={'where':_0x5c41d7[_0x62a0('0x3c')]};return db[_0x62a0('0x2e')]['count'](_0xf907cc)[_0x62a0('0x29')](function(_0x34b51d){_0x358596[_0x62a0('0x23')]=_0x34b51d;if(_0x1861c9[_0x62a0('0x33')][_0x62a0('0x42')]){_0x5c41d7[_0x62a0('0x43')]=[{'all':!![]}];}return db[_0x62a0('0x2e')][_0x62a0('0x44')](_0x5c41d7);})[_0x62a0('0x29')](function(_0x306c6d){_0x358596[_0x62a0('0x45')]=_0x306c6d;return _0x358596;})[_0x62a0('0x29')](respondWithFilteredResult(_0x47f8f8,_0x5c41d7))[_0x62a0('0x46')](handleError(_0x47f8f8,null));};exports[_0x62a0('0x47')]=function(_0x1adb97,_0x251d04){var _0x4a1288={'raw':![],'where':{'id':_0x1adb97[_0x62a0('0x48')]['id']}},_0x38c50f={};_0x38c50f[_0x62a0('0x32')]=_[_0x62a0('0x34')](db[_0x62a0('0x2e')][_0x62a0('0x2f')]);_0x38c50f[_0x62a0('0x33')]=_[_0x62a0('0x34')](_0x1adb97[_0x62a0('0x33')]);_0x38c50f['filters']=_[_0x62a0('0x35')](_0x38c50f[_0x62a0('0x32')],_0x38c50f['query']);_0x4a1288[_0x62a0('0x36')]=_[_0x62a0('0x35')](_0x38c50f[_0x62a0('0x32')],qs['fields'](_0x1adb97[_0x62a0('0x33')][_0x62a0('0x37')]));_0x4a1288[_0x62a0('0x36')]=_0x4a1288[_0x62a0('0x36')][_0x62a0('0x38')]?_0x4a1288[_0x62a0('0x36')]:_0x38c50f['model'];if(_0x1adb97[_0x62a0('0x33')]['includeAll']){_0x4a1288['include']=[{'all':!![]}];}_0x4a1288=_[_0x62a0('0x40')]({},_0x4a1288,_0x1adb97[_0x62a0('0x41')]);return db[_0x62a0('0x2e')]['find'](_0x4a1288)[_0x62a0('0x29')](handleEntityNotFound(_0x251d04,null))['then'](respondWithResult(_0x251d04,null))[_0x62a0('0x46')](handleError(_0x251d04,null));};exports['create']=function(_0x42682e,_0x5c80b0){return db['Team'][_0x62a0('0x49')](_0x42682e['body'],{})[_0x62a0('0x29')](function(_0xb148b6){var _0x1921f9=_0x42682e[_0x62a0('0x4a')][_0x62a0('0x4b')]({'plain':!![]});if(!_0x1921f9)throw new Error(_0x62a0('0x4c'));if(_0x1921f9[_0x62a0('0x4d')]===_0x62a0('0x4a')){var _0x242457=_0xb148b6[_0x62a0('0x4b')]({'plain':!![]});var _0x158430=_0x62a0('0x4e');return db[_0x62a0('0x4f')][_0x62a0('0x50')]({'where':{'name':_0x158430,'userProfileId':_0x1921f9[_0x62a0('0x51')]},'raw':!![]})['then'](function(_0x6ba22d){if(_0x6ba22d&&_0x6ba22d['autoAssociation']===0x0){return db[_0x62a0('0x52')][_0x62a0('0x49')]({'name':_0x242457[_0x62a0('0x2b')],'resourceId':_0x242457['id'],'type':_0x6ba22d[_0x62a0('0x2b')],'sectionId':_0x6ba22d['id']},{})['then'](function(){return _0xb148b6;});}else{return _0xb148b6;}})[_0x62a0('0x46')](function(_0x5a6280){logger[_0x62a0('0x53')](_0x62a0('0x54'),_0x5a6280);throw _0x5a6280;});}return _0xb148b6;})[_0x62a0('0x29')](respondWithResult(_0x5c80b0,0xc9))[_0x62a0('0x46')](handleError(_0x5c80b0,null));};exports[_0x62a0('0x28')]=function(_0x25632d,_0x23ba12){if(_0x25632d[_0x62a0('0x55')]['id']){delete _0x25632d[_0x62a0('0x55')]['id'];}return db[_0x62a0('0x2e')][_0x62a0('0x50')]({'where':{'id':_0x25632d[_0x62a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x23ba12,null))[_0x62a0('0x29')](saveUpdates(_0x25632d['body'],null))[_0x62a0('0x29')](respondWithResult(_0x23ba12,null))[_0x62a0('0x46')](handleError(_0x23ba12,null));};exports[_0x62a0('0x56')]=function(_0x151001,_0x13d20d){var _0x28c7a4=_0x151001[_0x62a0('0x48')]['id'];var _0x24b01c=[];return db[_0x62a0('0x57')][_0x62a0('0x58')](function(_0x156c68){var _0x498ce3=_0x62a0('0x59')+_0x28c7a4;return db[_0x62a0('0x57')]['query'](_0x498ce3,{'type':db[_0x62a0('0x5a')][_0x62a0('0x5b')][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68})[_0x62a0('0x29')](function(_0x59369b){_0x24b01c=_[_0x62a0('0x2d')](_0x59369b,function(_0x1460e3){return Number(_0x1460e3[_0x62a0('0x5d')]);});})[_0x62a0('0x29')](function(){var _0x405e75='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x28c7a4;return db[_0x62a0('0x57')][_0x62a0('0x33')](_0x405e75,{'type':db[_0x62a0('0x5a')][_0x62a0('0x5b')]['SELECT'],'raw':!![],'transaction':_0x156c68});})[_0x62a0('0x29')](function(_0x1f5b78){var _0x55daf4=_[_0x62a0('0x2d')](_0x1f5b78,function(_0x353942){return Number(_0x353942[_0x62a0('0x5e')]);});return db[_0x62a0('0x5f')][_0x62a0('0x56')]({'where':{'UserId':{'$in':_0x24b01c},'VoiceQueueId':{'$in':_0x55daf4}},'transaction':_0x156c68});})['then'](function(){var _0x4052c1=_0x62a0('0x60')+_0x28c7a4;return db['sequelize'][_0x62a0('0x33')](_0x4052c1,{'type':db['Sequelize']['QueryTypes'][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68});})[_0x62a0('0x29')](function(_0x555fba){var _0x364609=_['map'](_0x555fba,function(_0xd32508){return Number(_0xd32508[_0x62a0('0x61')]);});return db['UserMailQueue'][_0x62a0('0x56')]({'where':{'UserId':{'$in':_0x24b01c},'MailQueueId':{'$in':_0x364609}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){var _0x351c7d=_0x62a0('0x62')+_0x28c7a4;return db[_0x62a0('0x57')]['query'](_0x351c7d,{'type':db[_0x62a0('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x156c68});})['then'](function(_0xf333da){var _0x378ac2=_[_0x62a0('0x2d')](_0xf333da,function(_0x35ad29){return Number(_0x35ad29['SmsQueueId']);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x24b01c},'SmsQueueId':{'$in':_0x378ac2}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){var _0x2c1eb5=_0x62a0('0x63')+_0x28c7a4;return db[_0x62a0('0x57')]['query'](_0x2c1eb5,{'type':db[_0x62a0('0x5a')]['QueryTypes'][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68});})['then'](function(_0xb1e86d){var _0x4972f1=_[_0x62a0('0x2d')](_0xb1e86d,function(_0x239498){return Number(_0x239498[_0x62a0('0x64')]);});return db[_0x62a0('0x65')][_0x62a0('0x56')]({'where':{'UserId':{'$in':_0x24b01c},'ChatQueueId':{'$in':_0x4972f1}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){var _0x580e82=_0x62a0('0x66')+_0x28c7a4;return db[_0x62a0('0x57')][_0x62a0('0x33')](_0x580e82,{'type':db['Sequelize'][_0x62a0('0x5b')][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68});})[_0x62a0('0x29')](function(_0x5881f3){var _0xb432c1=_['map'](_0x5881f3,function(_0x5e5bf6){return Number(_0x5e5bf6[_0x62a0('0x67')]);});return db[_0x62a0('0x68')]['destroy']({'where':{'UserId':{'$in':_0x24b01c},'FaxQueueId':{'$in':_0xb432c1}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){var _0xef5ef8=_0x62a0('0x69')+_0x28c7a4;return db[_0x62a0('0x57')][_0x62a0('0x33')](_0xef5ef8,{'type':db[_0x62a0('0x5a')][_0x62a0('0x5b')][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68});})[_0x62a0('0x29')](function(_0x40b6c5){var _0x28248c=_[_0x62a0('0x2d')](_0x40b6c5,function(_0x5bfba7){return Number(_0x5bfba7['OpenchannelQueueId']);});return db[_0x62a0('0x6a')][_0x62a0('0x56')]({'where':{'UserId':{'$in':_0x24b01c},'OpenchannelQueueId':{'$in':_0x28248c}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){var _0x313caf='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x28c7a4;return db[_0x62a0('0x57')][_0x62a0('0x33')](_0x313caf,{'type':db['Sequelize']['QueryTypes'][_0x62a0('0x5c')],'raw':!![],'transaction':_0x156c68});})['then'](function(_0x428a5d){var _0x415e4d=_['map'](_0x428a5d,function(_0x5b733b){return Number(_0x5b733b[_0x62a0('0x6b')]);});return db[_0x62a0('0x6c')][_0x62a0('0x56')]({'where':{'UserId':{'$in':_0x24b01c},'WhatsappQueueId':{'$in':_0x415e4d}},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){return db[_0x62a0('0x6d')][_0x62a0('0x50')]({'where':{'TeamId':_0x28c7a4}});})[_0x62a0('0x29')](function(_0x1c1eb9){if(_0x1c1eb9===null){return;}return db[_0x62a0('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x24b01c},'VoicePrefixId':_0x1c1eb9[_0x62a0('0x6f')]},'transaction':_0x156c68});})[_0x62a0('0x29')](function(){return db[_0x62a0('0x2e')]['destroy']({'where':{'id':_0x28c7a4},'cascade':!![],'transaction':_0x156c68});})[_0x62a0('0x29')](function(_0x44c7c4){if(_0x44c7c4===0x0){_0x13d20d[_0x62a0('0x1e')](0x194);}else{return db['UserProfileResource'][_0x62a0('0x56')]({'where':{'type':'Teams','resourceId':_0x28c7a4},'cascade':!![],'transaction':_0x156c68})[_0x62a0('0x29')](function(){_0x13d20d[_0x62a0('0x1f')](0xcc)['end']();});}})['catch'](function(_0x49f7b3){_0x13d20d['status'](0x1f4)['send'](_0x49f7b3);});});};exports[_0x62a0('0x70')]=function(_0x5e1010,_0x3c2bfb,_0x3d85e3){return db[_0x62a0('0x2e')][_0x62a0('0x71')]({'where':{'id':_0x5e1010[_0x62a0('0x48')]['id']}})[_0x62a0('0x29')](handleEntityNotFound(_0x3c2bfb,null))[_0x62a0('0x29')](function(_0x593fcd){if(!_0x5e1010[_0x62a0('0x33')]['channel']||!utils[_0x62a0('0x72')](_0x5e1010[_0x62a0('0x33')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x5aca1a={};var _0x16994e={};_0x16994e['model']=_[_0x62a0('0x34')](db[_['capitalize'](_0x5e1010[_0x62a0('0x33')]['channel'][_0x62a0('0x73')]())+_0x62a0('0x74')][_0x62a0('0x2f')]);_0x16994e[_0x62a0('0x33')]=_[_0x62a0('0x34')](_0x5e1010['query']);_0x16994e[_0x62a0('0x3d')]=_['intersection'](_0x16994e[_0x62a0('0x32')],_0x16994e[_0x62a0('0x33')]);_0x5aca1a[_0x62a0('0x36')]=_[_0x62a0('0x35')](_0x16994e[_0x62a0('0x32')],qs[_0x62a0('0x37')](_0x5e1010[_0x62a0('0x33')][_0x62a0('0x37')]));_0x5aca1a[_0x62a0('0x36')]=_0x5aca1a['attributes']['length']?_0x5aca1a[_0x62a0('0x36')]:_0x16994e['model'];_0x5aca1a[_0x62a0('0x3a')]=qs[_0x62a0('0x3a')](_0x5e1010['query'][_0x62a0('0x3a')]);_0x5aca1a[_0x62a0('0x21')]=qs[_0x62a0('0x21')](_0x5e1010[_0x62a0('0x33')][_0x62a0('0x21')]);_0x5aca1a[_0x62a0('0x75')]=qs[_0x62a0('0x3b')](_0x5e1010[_0x62a0('0x33')][_0x62a0('0x3b')]);_0x5aca1a[_0x62a0('0x3c')]=qs['filters'](_[_0x62a0('0x76')](_0x5e1010['query'],_0x16994e[_0x62a0('0x3d')]));_0x5aca1a=_[_0x62a0('0x40')]({},_0x5aca1a,_0x5e1010[_0x62a0('0x41')]);return _0x593fcd[_0x62a0('0x4b')+_[_0x62a0('0x77')](_0x5e1010[_0x62a0('0x33')][_0x62a0('0x78')][_0x62a0('0x73')]())+_0x62a0('0x79')](_0x5aca1a);})[_0x62a0('0x29')](respondWithResult(_0x3c2bfb,null))[_0x62a0('0x46')](handleError(_0x3c2bfb,null));};exports[_0x62a0('0x7a')]=function(_0x1fee0f,_0x83f822,_0x11a421){return db[_0x62a0('0x2e')][_0x62a0('0x71')]({'where':{'id':_0x1fee0f[_0x62a0('0x48')]['id']}})['then'](function(_0x417b4b){if(_0x417b4b){if(!_0x1fee0f['body'][_0x62a0('0x78')]||!utils[_0x62a0('0x72')](_0x1fee0f[_0x62a0('0x55')]['channel'])){throw new db['Sequelize'][(_0x62a0('0x7b'))](_0x62a0('0x7c'));}return _0x417b4b[_0x62a0('0x7d')+_[_0x62a0('0x77')](_0x1fee0f[_0x62a0('0x55')][_0x62a0('0x78')][_0x62a0('0x73')]())+_0x62a0('0x79')](_0x1fee0f[_0x62a0('0x55')][_0x62a0('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x83f822,null))[_0x62a0('0x29')](respondWithStatusCode(_0x83f822,null))[_0x62a0('0x46')](handleError(_0x83f822,null));};exports[_0x62a0('0x7f')]=function(_0x11e4de,_0x3af900,_0x2fb1ac){return db[_0x62a0('0x2e')]['findOne']({'where':{'id':_0x11e4de[_0x62a0('0x48')]['id']}})['then'](function(_0x30bc3b){if(_0x30bc3b){if(!_0x11e4de[_0x62a0('0x33')][_0x62a0('0x78')]||!utils[_0x62a0('0x72')](_0x11e4de[_0x62a0('0x33')]['channel'])){throw new db['Sequelize'][(_0x62a0('0x7b'))](_0x62a0('0x7c'));}return _0x30bc3b[_0x62a0('0x80')+_[_0x62a0('0x77')](_0x11e4de['query'][_0x62a0('0x78')][_0x62a0('0x73')]())+'Queues'](_0x11e4de[_0x62a0('0x33')][_0x62a0('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x3af900,null))[_0x62a0('0x29')](respondWithStatusCode(_0x3af900,null))['catch'](handleError(_0x3af900,null));};exports['addAgents']=function(_0x581720,_0x33ac17){var _0x5a8262=_['isArray'](_0x581720[_0x62a0('0x55')][_0x62a0('0x7e')])?_0x581720[_0x62a0('0x55')]['ids']:[_0x581720['body']['ids']];var _0x1629bc=_0x581720['params']['id'];return db[_0x62a0('0x2e')][_0x62a0('0x50')]({'where':{'id':_0x1629bc}})[_0x62a0('0x29')](handleEntityNotFound(_0x33ac17,null))[_0x62a0('0x29')](function(_0x479cb3){if(_0x479cb3){var _0x3e0672=['Voice',_0x62a0('0x81'),_0x62a0('0x82'),_0x62a0('0x83'),_0x62a0('0x84'),_0x62a0('0x85'),_0x62a0('0x86')];return db[_0x62a0('0x57')][_0x62a0('0x58')](function(_0x3007ab){var _0x1d813a=_[_0x62a0('0x2d')](_0x3e0672,function(_0x51c964){var _0x4fc9a8={'attributes':['id',_0x62a0('0x2b')]};if(_0x51c964===_0x62a0('0x87')){_0x4fc9a8['through']={'attributes':['penalty']};}return _0x479cb3[_0x62a0('0x4b')+_0x51c964+_0x62a0('0x79')](_0x4fc9a8)[_0x62a0('0x29')](function(_0x45cd8b){var _0x4908a4=_[_0x62a0('0x2d')](_0x45cd8b,function(_0x54fb65){var _0x6b5817=_[_0x62a0('0x2d')](_0x5a8262,function(_0x181f4c){var _0x6df270={'where':{'UserId':_0x181f4c,[_0x51c964+'QueueId']:_0x54fb65['id']},'transaction':_0x3007ab};if(_0x51c964===_0x62a0('0x87')){_0x6df270['defaults']={'penalty':_0x54fb65[_0x62a0('0x88')][_0x62a0('0x89')]};}return db[_0x62a0('0x8a')+_0x51c964+_0x62a0('0x74')][_0x62a0('0x8b')](_0x6df270)[_0x62a0('0x29')](function(){socket[_0x62a0('0x8c')](_0x62a0('0x4a')+_0x51c964+_0x62a0('0x8d'),{'UserId':_0x181f4c,[_0x51c964+_0x62a0('0x8e')]:_0x54fb65['id']});if(_0x51c964!==_0x62a0('0x87')){return;}return db[_0x62a0('0x8a')]['findAll']({'where':{'id':_0x5a8262,'online':0x1},'attributes':['id',_0x62a0('0x2b'),_0x62a0('0x8f'),_0x62a0('0x90'),'interface'],'raw':!![]})['then'](function(_0x2d5b3d){var _0x453578=_['map'](_0x2d5b3d,function(_0x5e5473){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5e5473['name'],'UserId':_0x5e5473['id'],'queue_name':_0x54fb65['name'],'VoiceQueueId':_0x54fb65['id'],'interface':_[_0x62a0('0x91')](_0x5e5473['interface'])?util[_0x62a0('0x92')](_0x62a0('0x93'),_0x5e5473[_0x62a0('0x2b')]):_0x5e5473[_0x62a0('0x94')],'paused':_0x5e5473[_0x62a0('0x90')]||![],'penalty':_0x54fb65['TeamVoiceQueue']['penalty']},{'transaction':_0x3007ab});});return Promise[_0x62a0('0x95')](_0x453578);});});});return Promise[_0x62a0('0x95')](_0x6b5817);});return Promise[_0x62a0('0x95')](_0x4908a4);})[_0x62a0('0x29')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1629bc}})['then'](function(_0x51427a){if(_0x51427a){var _0x106514=_[_0x62a0('0x2d')](_0x5a8262,function(_0x11a2c8){db[_0x62a0('0x6e')][_0x62a0('0x96')]({'UserId':_0x11a2c8,'VoicePrefixId':_0x51427a['VoicePrefixId']});});return Promise[_0x62a0('0x95')](_0x106514);}});});});return Promise[_0x62a0('0x95')](_0x1d813a)[_0x62a0('0x29')](function(){return _0x479cb3[_0x62a0('0x97')](_0x5a8262,{'transaction':_0x3007ab})[_0x62a0('0x98')](function(_0x1cc535){return _0x1cc535;});});});}})[_0x62a0('0x29')](respondWithResult(_0x33ac17,null))[_0x62a0('0x46')](handleError(_0x33ac17,null));};exports[_0x62a0('0x99')]=function(_0x1562d2,_0x3060d7){var _0x2d7fea=_[_0x62a0('0x9a')](_0x1562d2[_0x62a0('0x33')]['ids'])?_0x1562d2[_0x62a0('0x33')][_0x62a0('0x7e')]:[_0x1562d2[_0x62a0('0x33')]['ids']];var _0x43ad7b=_0x1562d2[_0x62a0('0x48')]['id'];return db['Team']['find']({'where':{'id':_0x43ad7b}})[_0x62a0('0x29')](handleEntityNotFound(_0x3060d7,null))['then'](function(_0x30620a){if(_0x30620a){var _0x4dfc8e=[_0x62a0('0x87'),_0x62a0('0x81'),_0x62a0('0x82'),'Sms',_0x62a0('0x84'),_0x62a0('0x85'),_0x62a0('0x86')];return db[_0x62a0('0x57')][_0x62a0('0x58')](function(_0x153512){var _0x223435=_[_0x62a0('0x2d')](_0x4dfc8e,function(_0x5ca6f2){var _0x5dbdb4={'attributes':['id',_0x62a0('0x2b')]};return _0x30620a[_0x62a0('0x4b')+_0x5ca6f2+_0x62a0('0x79')](_0x5dbdb4)['then'](function(_0x19d0e1){var _0x31e4c5=_[_0x62a0('0x2d')](_0x19d0e1,function(_0x1bc5a7){return _0x1bc5a7['removeAgents'](_0x2d7fea,{'transaction':_0x153512})[_0x62a0('0x29')](function(){var _0x16a478=_[_0x62a0('0x2d')](_0x2d7fea,function(_0x13d100){socket[_0x62a0('0x8c')](_0x62a0('0x4a')+_0x5ca6f2+'Queue:remove',{'UserId':Number(_0x13d100),[_0x5ca6f2+'QueueId']:_0x1bc5a7['id']});if(_0x5ca6f2!==_0x62a0('0x87')){return;}return db[_0x62a0('0x9b')][_0x62a0('0x56')]({'where':{'VoiceQueueId':_0x1bc5a7['id'],'UserId':_0x13d100},'transaction':_0x153512});});return Promise[_0x62a0('0x95')](_0x16a478);});});return Promise[_0x62a0('0x95')](_0x31e4c5);});});return Promise['all'](_0x223435)[_0x62a0('0x29')](function(){return _0x30620a[_0x62a0('0x99')](_0x2d7fea,{'transaction':_0x153512});})['then'](function(){return db[_0x62a0('0x6d')][_0x62a0('0x71')]({'where':{'teamId':_0x43ad7b}})[_0x62a0('0x29')](function(_0x31f884){if(_0x31f884){var _0x265c48=_[_0x62a0('0x2d')](_0x2d7fea,function(_0x1c1f34){db[_0x62a0('0x6e')][_0x62a0('0x56')]({'where':{'UserId':_0x1c1f34,'VoicePrefixId':_0x31f884[_0x62a0('0x6f')]}});});return Promise[_0x62a0('0x95')](_0x265c48);}});});});}})[_0x62a0('0x29')](respondWithStatusCode(_0x3060d7,null))[_0x62a0('0x46')](handleError(_0x3060d7,null));};exports['getAgents']=function(_0xefbffc,_0x5b57b6,_0x20af73){var _0x5d20e0={};var _0x4470e6={};var _0x41d654;var _0x2ab786;return db[_0x62a0('0x2e')][_0x62a0('0x71')]({'where':{'id':_0xefbffc[_0x62a0('0x48')]['id']}})[_0x62a0('0x29')](handleEntityNotFound(_0x5b57b6,null))[_0x62a0('0x29')](function(_0x2e0428){if(_0x2e0428){_0x41d654=_0x2e0428;_0x4470e6[_0x62a0('0x32')]=_[_0x62a0('0x34')](db[_0x62a0('0x8a')][_0x62a0('0x2f')]);_0x4470e6[_0x62a0('0x33')]=_[_0x62a0('0x34')](_0xefbffc[_0x62a0('0x33')]);_0x4470e6['filters']=_[_0x62a0('0x35')](_0x4470e6['model'],_0x4470e6['query']);_0x5d20e0[_0x62a0('0x36')]=_[_0x62a0('0x35')](_0x4470e6[_0x62a0('0x32')],qs[_0x62a0('0x37')](_0xefbffc[_0x62a0('0x33')][_0x62a0('0x37')]));_0x5d20e0[_0x62a0('0x36')]=_0x5d20e0[_0x62a0('0x36')]['length']?_0x5d20e0[_0x62a0('0x36')]:_0x4470e6[_0x62a0('0x32')];_0x5d20e0['order']=qs['sort'](_0xefbffc['query'][_0x62a0('0x3b')]);_0x5d20e0[_0x62a0('0x3c')]=qs[_0x62a0('0x3d')](_[_0x62a0('0x76')](_0xefbffc[_0x62a0('0x33')],_0x4470e6[_0x62a0('0x3d')]));if(_0xefbffc[_0x62a0('0x33')][_0x62a0('0x3e')]){_0x5d20e0[_0x62a0('0x3c')]=_[_0x62a0('0x40')](_0x5d20e0[_0x62a0('0x3c')],{'$or':_[_0x62a0('0x2d')](_0x5d20e0[_0x62a0('0x36')],function(_0x3fc8d2){var _0x1225d4={};_0x1225d4[_0x3fc8d2]={'$like':'%'+_0xefbffc['query'][_0x62a0('0x3e')]+'%'};return _0x1225d4;})});}_0x5d20e0=_[_0x62a0('0x40')]({},_0x5d20e0,_0xefbffc[_0x62a0('0x41')]);return _0x41d654['getAgents'](_0x5d20e0);}})['then'](function(_0x453f08){if(_0x453f08){_0x2ab786=_0x453f08[_0x62a0('0x38')];if(!_0xefbffc[_0x62a0('0x33')][_0x62a0('0x39')]('nolimit')){_0x5d20e0[_0x62a0('0x3a')]=qs[_0x62a0('0x3a')](_0xefbffc['query']['limit']);_0x5d20e0[_0x62a0('0x21')]=qs[_0x62a0('0x21')](_0xefbffc[_0x62a0('0x33')]['offset']);}return _0x41d654[_0x62a0('0x9c')](_0x5d20e0);}})['then'](function(_0x28beb2){if(_0x28beb2){return _0x28beb2?{'count':_0x2ab786,'rows':_0x28beb2}:null;}})[_0x62a0('0x29')](respondWithResult(_0x5b57b6,null))[_0x62a0('0x46')](handleError(_0x5b57b6,null));}; \ No newline at end of file +var _0x36b5=['upsert','addAgents','spread','removeAgents','Openchannel','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','length','pick','addQueues','add','ids','removeQueues','remove','Queues','Voice','Chat','Mail','Sms','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','user','Queue:save','online','UserVoiceQueueRt','isNil','interface','format','SIP/%s','voicePause','all'];(function(_0x25a85c,_0xc50610){var _0x491a29=function(_0x3c407c){while(--_0x3c407c){_0x25a85c['push'](_0x25a85c['shift']());}};_0x491a29(++_0xc50610);}(_0x36b5,0x145));var _0x536b=function(_0x3d2b19,_0x349a5b){_0x3d2b19=_0x3d2b19-0x0;var _0x29769b=_0x36b5[_0x3d2b19];return _0x29769b;};'use strict';var emlformat=require(_0x536b('0x0'));var rimraf=require(_0x536b('0x1'));var zipdir=require(_0x536b('0x2'));var jsonpatch=require(_0x536b('0x3'));var rp=require(_0x536b('0x4'));var moment=require(_0x536b('0x5'));var BPromise=require(_0x536b('0x6'));var Mustache=require(_0x536b('0x7'));var util=require('util');var path=require(_0x536b('0x8'));var sox=require(_0x536b('0x9'));var csv=require(_0x536b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x536b('0xb'));var _=require(_0x536b('0xc'));var squel=require(_0x536b('0xd'));var crypto=require(_0x536b('0xe'));var jsforce=require(_0x536b('0xf'));var deskjs=require(_0x536b('0x10'));var toCsv=require(_0x536b('0xa'));var querystring=require(_0x536b('0x11'));var Papa=require(_0x536b('0x12'));var Redis=require(_0x536b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x536b('0x14'));var as=require(_0x536b('0x15'));var hardwareService=require(_0x536b('0x16'));var logger=require(_0x536b('0x17'))('api');var utils=require(_0x536b('0x18'));var config=require(_0x536b('0x19'));var licenseUtil=require(_0x536b('0x1a'));var db=require(_0x536b('0x1b'))['db'];config[_0x536b('0x1c')]=_[_0x536b('0x1d')](config[_0x536b('0x1c')],{'host':_0x536b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x536b('0x1c')]));require(_0x536b('0x1f'))[_0x536b('0x20')](socket);function respondWithStatusCode(_0xb1492a,_0x384aec){_0x384aec=_0x384aec||0xcc;return function(_0x16a7fd){if(_0x16a7fd){return _0xb1492a[_0x536b('0x21')](_0x384aec);}return _0xb1492a[_0x536b('0x22')](_0x384aec)[_0x536b('0x23')]();};}function respondWithResult(_0x36f78b,_0x44923b){_0x44923b=_0x44923b||0xc8;return function(_0x24b86c){if(_0x24b86c){return _0x36f78b[_0x536b('0x22')](_0x44923b)[_0x536b('0x24')](_0x24b86c);}};}function respondWithFilteredResult(_0x545369,_0x4965fd){return function(_0x179002){if(_0x179002){var _0xf83153=typeof _0x4965fd[_0x536b('0x25')]==='undefined'&&typeof _0x4965fd[_0x536b('0x26')]===_0x536b('0x27');var _0x254c4a=_0x179002[_0x536b('0x28')];var _0x1b6572=_0xf83153?0x0:_0x4965fd['offset'];var _0x3e6e7c=_0xf83153?_0x179002['count']:_0x4965fd[_0x536b('0x25')]+_0x4965fd['limit'];var _0x5155be;if(_0x3e6e7c>=_0x254c4a){_0x3e6e7c=_0x254c4a;_0x5155be=0xc8;}else{_0x5155be=0xce;}_0x545369[_0x536b('0x22')](_0x5155be);return _0x545369[_0x536b('0x29')](_0x536b('0x2a'),_0x1b6572+'-'+_0x3e6e7c+'/'+_0x254c4a)['json'](_0x179002);}return null;};}function patchUpdates(_0xae5410){return function(_0x289de8){try{jsonpatch['apply'](_0x289de8,_0xae5410,!![]);}catch(_0x19d28c){return BPromise['reject'](_0x19d28c);}return _0x289de8[_0x536b('0x2b')]();};}function saveUpdates(_0x51005a,_0x236890){return function(_0x5a49df){if(_0x5a49df){return _0x5a49df[_0x536b('0x2c')](_0x51005a)[_0x536b('0x2d')](function(_0x31ccfa){return _0x31ccfa;});}return null;};}function handleEntityNotFound(_0x3a904b,_0x46f10e){return function(_0x61d88f){if(!_0x61d88f){_0x3a904b[_0x536b('0x21')](0x194);}return _0x61d88f;};}function handleError(_0x263a8e,_0x203b48){_0x203b48=_0x203b48||0x1f4;return function(_0x562c50){logger[_0x536b('0x2e')](_0x562c50[_0x536b('0x2f')]);if(_0x562c50[_0x536b('0x30')]){delete _0x562c50[_0x536b('0x30')];}_0x263a8e[_0x536b('0x22')](_0x203b48)[_0x536b('0x31')](_0x562c50);};}exports[_0x536b('0x32')]=function(_0x4f9e9d,_0xf91bb2){var _0x418b48={},_0x46d245={},_0x1b7f19={'count':0x0,'rows':[]};var _0x531478=_[_0x536b('0x33')](db[_0x536b('0x34')][_0x536b('0x35')],function(_0x51af09){return{'name':_0x51af09[_0x536b('0x36')],'type':_0x51af09[_0x536b('0x37')]['key']};});_0x46d245[_0x536b('0x38')]=_[_0x536b('0x33')](_0x531478,'name');_0x46d245[_0x536b('0x39')]=_['keys'](_0x4f9e9d[_0x536b('0x39')]);_0x46d245['filters']=_[_0x536b('0x3a')](_0x46d245[_0x536b('0x38')],_0x46d245[_0x536b('0x39')]);_0x418b48['attributes']=_['intersection'](_0x46d245[_0x536b('0x38')],qs[_0x536b('0x3b')](_0x4f9e9d[_0x536b('0x39')][_0x536b('0x3b')]));_0x418b48['attributes']=_0x418b48[_0x536b('0x3c')]['length']?_0x418b48[_0x536b('0x3c')]:_0x46d245[_0x536b('0x38')];if(!_0x4f9e9d[_0x536b('0x39')][_0x536b('0x3d')](_0x536b('0x3e'))){_0x418b48['limit']=qs[_0x536b('0x26')](_0x4f9e9d[_0x536b('0x39')]['limit']);_0x418b48[_0x536b('0x25')]=qs[_0x536b('0x25')](_0x4f9e9d[_0x536b('0x39')][_0x536b('0x25')]);}_0x418b48[_0x536b('0x3f')]=qs[_0x536b('0x40')](_0x4f9e9d[_0x536b('0x39')][_0x536b('0x40')]);_0x418b48['where']=qs[_0x536b('0x41')](_['pick'](_0x4f9e9d['query'],_0x46d245['filters']),_0x531478);if(_0x4f9e9d['query']['filter']){_0x418b48[_0x536b('0x42')]=_[_0x536b('0x43')](_0x418b48[_0x536b('0x42')],{'$or':_[_0x536b('0x33')](_0x531478,function(_0xcf62a4){if(_0xcf62a4[_0x536b('0x37')]!==_0x536b('0x44')){var _0x4a33f8={};_0x4a33f8[_0xcf62a4[_0x536b('0x30')]]={'$like':'%'+_0x4f9e9d[_0x536b('0x39')][_0x536b('0x45')]+'%'};return _0x4a33f8;}})});}_0x418b48=_['merge']({},_0x418b48,_0x4f9e9d[_0x536b('0x46')]);var _0x6627bb={'where':_0x418b48[_0x536b('0x42')]};return db[_0x536b('0x34')][_0x536b('0x28')](_0x6627bb)[_0x536b('0x2d')](function(_0x4303f4){_0x1b7f19[_0x536b('0x28')]=_0x4303f4;if(_0x4f9e9d[_0x536b('0x39')]['includeAll']){_0x418b48[_0x536b('0x47')]=[{'all':!![]}];}return db[_0x536b('0x34')][_0x536b('0x48')](_0x418b48);})['then'](function(_0x589f77){_0x1b7f19[_0x536b('0x49')]=_0x589f77;return _0x1b7f19;})['then'](respondWithFilteredResult(_0xf91bb2,_0x418b48))[_0x536b('0x4a')](handleError(_0xf91bb2,null));};exports['show']=function(_0x5d61c3,_0x2b9fa9){var _0xc90673={'raw':![],'where':{'id':_0x5d61c3[_0x536b('0x4b')]['id']}},_0x47d9b6={};_0x47d9b6[_0x536b('0x38')]=_[_0x536b('0x4c')](db[_0x536b('0x34')][_0x536b('0x35')]);_0x47d9b6[_0x536b('0x39')]=_['keys'](_0x5d61c3[_0x536b('0x39')]);_0x47d9b6[_0x536b('0x41')]=_['intersection'](_0x47d9b6[_0x536b('0x38')],_0x47d9b6['query']);_0xc90673['attributes']=_[_0x536b('0x3a')](_0x47d9b6[_0x536b('0x38')],qs[_0x536b('0x3b')](_0x5d61c3[_0x536b('0x39')]['fields']));_0xc90673['attributes']=_0xc90673[_0x536b('0x3c')]['length']?_0xc90673[_0x536b('0x3c')]:_0x47d9b6[_0x536b('0x38')];if(_0x5d61c3[_0x536b('0x39')][_0x536b('0x4d')]){_0xc90673[_0x536b('0x47')]=[{'all':!![]}];}_0xc90673=_[_0x536b('0x43')]({},_0xc90673,_0x5d61c3['options']);return db[_0x536b('0x34')][_0x536b('0x4e')](_0xc90673)[_0x536b('0x2d')](handleEntityNotFound(_0x2b9fa9,null))[_0x536b('0x2d')](respondWithResult(_0x2b9fa9,null))['catch'](handleError(_0x2b9fa9,null));};exports[_0x536b('0x4f')]=function(_0x330fb2,_0x5b9e20){return db[_0x536b('0x34')]['create'](_0x330fb2['body'],{})[_0x536b('0x2d')](function(_0x102699){var _0x315c2a=_0x330fb2['user'][_0x536b('0x50')]({'plain':!![]});if(!_0x315c2a)throw new Error(_0x536b('0x51'));if(_0x315c2a[_0x536b('0x52')]==='user'){var _0x311f84=_0x102699[_0x536b('0x50')]({'plain':!![]});var _0xb14772=_0x536b('0x53');return db[_0x536b('0x54')][_0x536b('0x4e')]({'where':{'name':_0xb14772,'userProfileId':_0x315c2a[_0x536b('0x55')]},'raw':!![]})[_0x536b('0x2d')](function(_0x570e0c){if(_0x570e0c&&_0x570e0c[_0x536b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x311f84['name'],'resourceId':_0x311f84['id'],'type':_0x570e0c['name'],'sectionId':_0x570e0c['id']},{})[_0x536b('0x2d')](function(){return _0x102699;});}else{return _0x102699;}})[_0x536b('0x4a')](function(_0x3477c8){logger['error'](_0x536b('0x57'),_0x3477c8);throw _0x3477c8;});}return _0x102699;})[_0x536b('0x2d')](respondWithResult(_0x5b9e20,0xc9))[_0x536b('0x4a')](handleError(_0x5b9e20,null));};exports[_0x536b('0x2c')]=function(_0x37bced,_0x2e4799){if(_0x37bced[_0x536b('0x58')]['id']){delete _0x37bced[_0x536b('0x58')]['id'];}return db[_0x536b('0x34')]['find']({'where':{'id':_0x37bced[_0x536b('0x4b')]['id']}})[_0x536b('0x2d')](handleEntityNotFound(_0x2e4799,null))[_0x536b('0x2d')](saveUpdates(_0x37bced[_0x536b('0x58')],null))['then'](respondWithResult(_0x2e4799,null))['catch'](handleError(_0x2e4799,null));};exports[_0x536b('0x59')]=function(_0x377226,_0x1174ee){var _0x1c69a3=_0x377226[_0x536b('0x4b')]['id'];var _0x2a9adf=[];return db['sequelize']['transaction'](function(_0x36886b){var _0x193ff9='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1c69a3;return db[_0x536b('0x5a')]['query'](_0x193ff9,{'type':db[_0x536b('0x5b')][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b})[_0x536b('0x2d')](function(_0x4b7c0a){_0x2a9adf=_[_0x536b('0x33')](_0x4b7c0a,function(_0x51e0a2){return Number(_0x51e0a2[_0x536b('0x5e')]);});})['then'](function(){var _0x3d5a04=_0x536b('0x5f')+_0x1c69a3;return db[_0x536b('0x5a')][_0x536b('0x39')](_0x3d5a04,{'type':db[_0x536b('0x5b')][_0x536b('0x5c')]['SELECT'],'raw':!![],'transaction':_0x36886b});})[_0x536b('0x2d')](function(_0x480d3d){var _0x3396f6=_[_0x536b('0x33')](_0x480d3d,function(_0x9742d4){return Number(_0x9742d4[_0x536b('0x60')]);});return db['UserVoiceQueue'][_0x536b('0x59')]({'where':{'UserId':{'$in':_0x2a9adf},'VoiceQueueId':{'$in':_0x3396f6}},'transaction':_0x36886b});})['then'](function(){var _0x2b2017=_0x536b('0x61')+_0x1c69a3;return db[_0x536b('0x5a')][_0x536b('0x39')](_0x2b2017,{'type':db['Sequelize'][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b});})['then'](function(_0x47c632){var _0x24f3f8=_[_0x536b('0x33')](_0x47c632,function(_0x25ff26){return Number(_0x25ff26[_0x536b('0x62')]);});return db[_0x536b('0x63')][_0x536b('0x59')]({'where':{'UserId':{'$in':_0x2a9adf},'MailQueueId':{'$in':_0x24f3f8}},'transaction':_0x36886b});})['then'](function(){var _0x329975=_0x536b('0x64')+_0x1c69a3;return db[_0x536b('0x5a')]['query'](_0x329975,{'type':db['Sequelize'][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b});})[_0x536b('0x2d')](function(_0x55ecd7){var _0x4d3cf5=_[_0x536b('0x33')](_0x55ecd7,function(_0x4285ed){return Number(_0x4285ed[_0x536b('0x65')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x2a9adf},'SmsQueueId':{'$in':_0x4d3cf5}},'transaction':_0x36886b});})['then'](function(){var _0x5ce696=_0x536b('0x66')+_0x1c69a3;return db[_0x536b('0x5a')][_0x536b('0x39')](_0x5ce696,{'type':db['Sequelize'][_0x536b('0x5c')]['SELECT'],'raw':!![],'transaction':_0x36886b});})['then'](function(_0x3ccfea){var _0x53a238=_[_0x536b('0x33')](_0x3ccfea,function(_0x821e83){return Number(_0x821e83[_0x536b('0x67')]);});return db[_0x536b('0x68')]['destroy']({'where':{'UserId':{'$in':_0x2a9adf},'ChatQueueId':{'$in':_0x53a238}},'transaction':_0x36886b});})[_0x536b('0x2d')](function(){var _0x1be5dd='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1c69a3;return db[_0x536b('0x5a')][_0x536b('0x39')](_0x1be5dd,{'type':db['Sequelize'][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b});})['then'](function(_0x26086d){var _0xaa5ede=_['map'](_0x26086d,function(_0x2df58d){return Number(_0x2df58d[_0x536b('0x69')]);});return db[_0x536b('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x2a9adf},'FaxQueueId':{'$in':_0xaa5ede}},'transaction':_0x36886b});})[_0x536b('0x2d')](function(){var _0x4ac543=_0x536b('0x6b')+_0x1c69a3;return db[_0x536b('0x5a')][_0x536b('0x39')](_0x4ac543,{'type':db[_0x536b('0x5b')][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b});})['then'](function(_0x4057a9){var _0x1cfc00=_[_0x536b('0x33')](_0x4057a9,function(_0x2bb2a2){return Number(_0x2bb2a2[_0x536b('0x6c')]);});return db[_0x536b('0x6d')][_0x536b('0x59')]({'where':{'UserId':{'$in':_0x2a9adf},'OpenchannelQueueId':{'$in':_0x1cfc00}},'transaction':_0x36886b});})[_0x536b('0x2d')](function(){var _0x308c19='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1c69a3;return db[_0x536b('0x5a')]['query'](_0x308c19,{'type':db[_0x536b('0x5b')][_0x536b('0x5c')][_0x536b('0x5d')],'raw':!![],'transaction':_0x36886b});})[_0x536b('0x2d')](function(_0x4dbee2){var _0x236538=_[_0x536b('0x33')](_0x4dbee2,function(_0x91528d){return Number(_0x91528d['WhatsappQueueId']);});return db[_0x536b('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x2a9adf},'WhatsappQueueId':{'$in':_0x236538}},'transaction':_0x36886b});})[_0x536b('0x2d')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x1c69a3}});})[_0x536b('0x2d')](function(_0x1be832){if(_0x1be832===null){return;}return db[_0x536b('0x6f')][_0x536b('0x59')]({'where':{'UserId':{'$in':_0x2a9adf},'VoicePrefixId':_0x1be832[_0x536b('0x70')]},'transaction':_0x36886b});})['then'](function(){return db[_0x536b('0x34')][_0x536b('0x59')]({'where':{'id':_0x1c69a3},'cascade':!![],'transaction':_0x36886b});})[_0x536b('0x2d')](function(_0x2da841){if(_0x2da841===0x0){_0x1174ee[_0x536b('0x21')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':'Teams','resourceId':_0x1c69a3},'cascade':!![],'transaction':_0x36886b})[_0x536b('0x2d')](function(){_0x1174ee[_0x536b('0x22')](0xcc)[_0x536b('0x23')]();});}})['catch'](function(_0x3f3d03){_0x1174ee['status'](0x1f4)[_0x536b('0x31')](_0x3f3d03);});});};exports[_0x536b('0x71')]=function(_0x49664d,_0x5d8d81,_0xcce554){return db[_0x536b('0x34')][_0x536b('0x72')]({'where':{'id':_0x49664d['params']['id']}})['then'](handleEntityNotFound(_0x5d8d81,null))['then'](function(_0x5605d3){if(!_0x49664d[_0x536b('0x39')][_0x536b('0x73')]||!utils[_0x536b('0x74')](_0x49664d[_0x536b('0x39')][_0x536b('0x73')])){throw new db['Sequelize'][(_0x536b('0x75'))](_0x536b('0x76'));}var _0x4003e9={};var _0x1206ce={};_0x1206ce[_0x536b('0x38')]=_[_0x536b('0x4c')](db[_[_0x536b('0x77')](_0x49664d[_0x536b('0x39')][_0x536b('0x73')][_0x536b('0x78')]())+_0x536b('0x79')]['rawAttributes']);_0x1206ce[_0x536b('0x39')]=_[_0x536b('0x4c')](_0x49664d[_0x536b('0x39')]);_0x1206ce[_0x536b('0x41')]=_['intersection'](_0x1206ce[_0x536b('0x38')],_0x1206ce[_0x536b('0x39')]);_0x4003e9[_0x536b('0x3c')]=_['intersection'](_0x1206ce[_0x536b('0x38')],qs['fields'](_0x49664d[_0x536b('0x39')][_0x536b('0x3b')]));_0x4003e9['attributes']=_0x4003e9[_0x536b('0x3c')][_0x536b('0x7a')]?_0x4003e9['attributes']:_0x1206ce['model'];_0x4003e9[_0x536b('0x26')]=qs[_0x536b('0x26')](_0x49664d[_0x536b('0x39')][_0x536b('0x26')]);_0x4003e9[_0x536b('0x25')]=qs['offset'](_0x49664d[_0x536b('0x39')][_0x536b('0x25')]);_0x4003e9[_0x536b('0x3f')]=qs[_0x536b('0x40')](_0x49664d[_0x536b('0x39')]['sort']);_0x4003e9['where']=qs[_0x536b('0x41')](_[_0x536b('0x7b')](_0x49664d[_0x536b('0x39')],_0x1206ce[_0x536b('0x41')]));_0x4003e9=_[_0x536b('0x43')]({},_0x4003e9,_0x49664d[_0x536b('0x46')]);return _0x5605d3[_0x536b('0x50')+_[_0x536b('0x77')](_0x49664d['query'][_0x536b('0x73')][_0x536b('0x78')]())+'Queues'](_0x4003e9);})['then'](respondWithResult(_0x5d8d81,null))[_0x536b('0x4a')](handleError(_0x5d8d81,null));};exports[_0x536b('0x7c')]=function(_0x276998,_0x2b90be,_0x49ee85){return db[_0x536b('0x34')]['findOne']({'where':{'id':_0x276998[_0x536b('0x4b')]['id']}})[_0x536b('0x2d')](function(_0x536147){if(_0x536147){if(!_0x276998[_0x536b('0x58')]['channel']||!utils[_0x536b('0x74')](_0x276998['body'][_0x536b('0x73')])){throw new db['Sequelize'][(_0x536b('0x75'))](_0x536b('0x76'));}return _0x536147[_0x536b('0x7d')+_[_0x536b('0x77')](_0x276998[_0x536b('0x58')][_0x536b('0x73')][_0x536b('0x78')]())+'Queues'](_0x276998[_0x536b('0x58')][_0x536b('0x7e')]);}return null;})[_0x536b('0x2d')](handleEntityNotFound(_0x2b90be,null))['then'](respondWithStatusCode(_0x2b90be,null))[_0x536b('0x4a')](handleError(_0x2b90be,null));};exports[_0x536b('0x7f')]=function(_0x45261e,_0xf08241,_0x4e29b3){return db[_0x536b('0x34')][_0x536b('0x72')]({'where':{'id':_0x45261e[_0x536b('0x4b')]['id']}})[_0x536b('0x2d')](function(_0x4baedf){if(_0x4baedf){if(!_0x45261e[_0x536b('0x39')][_0x536b('0x73')]||!utils[_0x536b('0x74')](_0x45261e['query']['channel'])){throw new db[(_0x536b('0x5b'))][(_0x536b('0x75'))](_0x536b('0x76'));}return _0x4baedf[_0x536b('0x80')+_['capitalize'](_0x45261e[_0x536b('0x39')]['channel'][_0x536b('0x78')]())+_0x536b('0x81')](_0x45261e[_0x536b('0x39')]['ids']);}return null;})[_0x536b('0x2d')](handleEntityNotFound(_0xf08241,null))['then'](respondWithStatusCode(_0xf08241,null))[_0x536b('0x4a')](handleError(_0xf08241,null));};exports['addAgents']=function(_0x83c4de,_0x4f4131){var _0x239d60=_['isArray'](_0x83c4de[_0x536b('0x58')][_0x536b('0x7e')])?_0x83c4de['body'][_0x536b('0x7e')]:[_0x83c4de[_0x536b('0x58')]['ids']];var _0x2c8e71=_0x83c4de[_0x536b('0x4b')]['id'];return db[_0x536b('0x34')][_0x536b('0x4e')]({'where':{'id':_0x2c8e71}})['then'](handleEntityNotFound(_0x4f4131,null))[_0x536b('0x2d')](function(_0x183e9b){if(_0x183e9b){var _0x3140e5=[_0x536b('0x82'),_0x536b('0x83'),_0x536b('0x84'),_0x536b('0x85'),_0x536b('0x86'),'Openchannel',_0x536b('0x87')];return db[_0x536b('0x5a')]['transaction'](function(_0x2ff2ca){var _0x4441e4=_[_0x536b('0x33')](_0x3140e5,function(_0x107efd){var _0x5e1b59={'attributes':['id',_0x536b('0x30')]};if(_0x107efd==='Voice'){_0x5e1b59[_0x536b('0x88')]={'attributes':[_0x536b('0x89')]};}return _0x183e9b[_0x536b('0x50')+_0x107efd+'Queues'](_0x5e1b59)['then'](function(_0xd26d09){var _0x2111f4=_[_0x536b('0x33')](_0xd26d09,function(_0x29ed13){var _0x20cce0=_[_0x536b('0x33')](_0x239d60,function(_0xece903){var _0x3262e8={'where':{'UserId':_0xece903,[_0x107efd+_0x536b('0x8a')]:_0x29ed13['id']},'transaction':_0x2ff2ca};if(_0x107efd==='Voice'){_0x3262e8['defaults']={'penalty':_0x29ed13[_0x536b('0x8b')][_0x536b('0x89')]};}return db[_0x536b('0x8c')+_0x107efd+'Queue'][_0x536b('0x8d')](_0x3262e8)[_0x536b('0x2d')](function(){socket['emit'](_0x536b('0x8e')+_0x107efd+_0x536b('0x8f'),{'UserId':_0xece903,[_0x107efd+_0x536b('0x8a')]:_0x29ed13['id']});if(_0x107efd!=='Voice'){return;}return db[_0x536b('0x8c')]['findAll']({'where':{'id':_0x239d60,'online':0x1},'attributes':['id',_0x536b('0x30'),_0x536b('0x90'),'voicePause','interface'],'raw':!![]})[_0x536b('0x2d')](function(_0x4dc205){var _0xe1405f=_[_0x536b('0x33')](_0x4dc205,function(_0x2eff47){return db[_0x536b('0x91')]['upsert']({'membername':_0x2eff47[_0x536b('0x30')],'UserId':_0x2eff47['id'],'queue_name':_0x29ed13[_0x536b('0x30')],'VoiceQueueId':_0x29ed13['id'],'interface':_[_0x536b('0x92')](_0x2eff47[_0x536b('0x93')])?util[_0x536b('0x94')](_0x536b('0x95'),_0x2eff47[_0x536b('0x30')]):_0x2eff47[_0x536b('0x93')],'paused':_0x2eff47[_0x536b('0x96')]||![],'penalty':_0x29ed13['TeamVoiceQueue'][_0x536b('0x89')]},{'transaction':_0x2ff2ca});});return Promise[_0x536b('0x97')](_0xe1405f);});});});return Promise[_0x536b('0x97')](_0x20cce0);});return Promise[_0x536b('0x97')](_0x2111f4);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2c8e71}})['then'](function(_0x2ae5a7){if(_0x2ae5a7){var _0x56d5a7=_[_0x536b('0x33')](_0x239d60,function(_0x449fc0){db[_0x536b('0x6f')][_0x536b('0x98')]({'UserId':_0x449fc0,'VoicePrefixId':_0x2ae5a7[_0x536b('0x70')]});});return Promise['all'](_0x56d5a7);}});});});return Promise[_0x536b('0x97')](_0x4441e4)[_0x536b('0x2d')](function(){return _0x183e9b[_0x536b('0x99')](_0x239d60,{'transaction':_0x2ff2ca})[_0x536b('0x9a')](function(_0xf7fd47){return _0xf7fd47;});});});}})['then'](respondWithResult(_0x4f4131,null))[_0x536b('0x4a')](handleError(_0x4f4131,null));};exports[_0x536b('0x9b')]=function(_0x2e02b,_0x1f17b2){var _0x2c2000=_['isArray'](_0x2e02b['query'][_0x536b('0x7e')])?_0x2e02b[_0x536b('0x39')]['ids']:[_0x2e02b[_0x536b('0x39')][_0x536b('0x7e')]];var _0x40330a=_0x2e02b[_0x536b('0x4b')]['id'];return db[_0x536b('0x34')][_0x536b('0x4e')]({'where':{'id':_0x40330a}})[_0x536b('0x2d')](handleEntityNotFound(_0x1f17b2,null))['then'](function(_0x3dc837){if(_0x3dc837){var _0x583d50=['Voice','Chat',_0x536b('0x84'),'Sms',_0x536b('0x86'),_0x536b('0x9c'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x12fca7){var _0x34c29b=_[_0x536b('0x33')](_0x583d50,function(_0xa7f0be){var _0x5c376d={'attributes':['id',_0x536b('0x30')]};return _0x3dc837[_0x536b('0x50')+_0xa7f0be+_0x536b('0x81')](_0x5c376d)[_0x536b('0x2d')](function(_0x1bd811){var _0x3a7527=_['map'](_0x1bd811,function(_0x4309af){return _0x4309af[_0x536b('0x9b')](_0x2c2000,{'transaction':_0x12fca7})['then'](function(){var _0x4e0668=_[_0x536b('0x33')](_0x2c2000,function(_0x5348ce){socket[_0x536b('0x9d')](_0x536b('0x8e')+_0xa7f0be+'Queue:remove',{'UserId':Number(_0x5348ce),[_0xa7f0be+_0x536b('0x8a')]:_0x4309af['id']});if(_0xa7f0be!=='Voice'){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4309af['id'],'UserId':_0x5348ce},'transaction':_0x12fca7});});return Promise[_0x536b('0x97')](_0x4e0668);});});return Promise['all'](_0x3a7527);});});return Promise[_0x536b('0x97')](_0x34c29b)[_0x536b('0x2d')](function(){return _0x3dc837[_0x536b('0x9b')](_0x2c2000,{'transaction':_0x12fca7});})[_0x536b('0x2d')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x40330a}})[_0x536b('0x2d')](function(_0x473216){if(_0x473216){var _0x4cb24b=_[_0x536b('0x33')](_0x2c2000,function(_0x2ca808){db[_0x536b('0x6f')][_0x536b('0x59')]({'where':{'UserId':_0x2ca808,'VoicePrefixId':_0x473216[_0x536b('0x70')]}});});return Promise[_0x536b('0x97')](_0x4cb24b);}});});});}})['then'](respondWithStatusCode(_0x1f17b2,null))[_0x536b('0x4a')](handleError(_0x1f17b2,null));};exports[_0x536b('0x9e')]=function(_0x40a360,_0x29b801,_0x5b8942){var _0x2c68c6={};var _0xfd713b={};var _0x39409f;var _0x1a0941;return db[_0x536b('0x34')]['findOne']({'where':{'id':_0x40a360['params']['id']}})[_0x536b('0x2d')](handleEntityNotFound(_0x29b801,null))['then'](function(_0x16a11d){if(_0x16a11d){_0x39409f=_0x16a11d;_0xfd713b[_0x536b('0x38')]=_[_0x536b('0x4c')](db[_0x536b('0x8c')][_0x536b('0x35')]);_0xfd713b[_0x536b('0x39')]=_[_0x536b('0x4c')](_0x40a360[_0x536b('0x39')]);_0xfd713b[_0x536b('0x41')]=_[_0x536b('0x3a')](_0xfd713b[_0x536b('0x38')],_0xfd713b[_0x536b('0x39')]);_0x2c68c6['attributes']=_[_0x536b('0x3a')](_0xfd713b[_0x536b('0x38')],qs['fields'](_0x40a360['query']['fields']));_0x2c68c6[_0x536b('0x3c')]=_0x2c68c6['attributes'][_0x536b('0x7a')]?_0x2c68c6['attributes']:_0xfd713b[_0x536b('0x38')];_0x2c68c6['order']=qs[_0x536b('0x40')](_0x40a360[_0x536b('0x39')][_0x536b('0x40')]);_0x2c68c6['where']=qs[_0x536b('0x41')](_[_0x536b('0x7b')](_0x40a360[_0x536b('0x39')],_0xfd713b[_0x536b('0x41')]));if(_0x40a360[_0x536b('0x39')]['filter']){_0x2c68c6[_0x536b('0x42')]=_[_0x536b('0x43')](_0x2c68c6[_0x536b('0x42')],{'$or':_[_0x536b('0x33')](_0x2c68c6[_0x536b('0x3c')],function(_0x50b23c){var _0x279a5e={};_0x279a5e[_0x50b23c]={'$like':'%'+_0x40a360[_0x536b('0x39')][_0x536b('0x45')]+'%'};return _0x279a5e;})});}_0x2c68c6=_[_0x536b('0x43')]({},_0x2c68c6,_0x40a360[_0x536b('0x46')]);return _0x39409f[_0x536b('0x9e')](_0x2c68c6);}})[_0x536b('0x2d')](function(_0x75acb8){if(_0x75acb8){_0x1a0941=_0x75acb8[_0x536b('0x7a')];if(!_0x40a360[_0x536b('0x39')][_0x536b('0x3d')]('nolimit')){_0x2c68c6[_0x536b('0x26')]=qs[_0x536b('0x26')](_0x40a360[_0x536b('0x39')][_0x536b('0x26')]);_0x2c68c6['offset']=qs[_0x536b('0x25')](_0x40a360[_0x536b('0x39')]['offset']);}return _0x39409f['getAgents'](_0x2c68c6);}})[_0x536b('0x2d')](function(_0x2dc990){if(_0x2dc990){return _0x2dc990?{'count':_0x1a0941,'rows':_0x2dc990}:null;}})[_0x536b('0x2d')](respondWithResult(_0x29b801,null))['catch'](handleError(_0x29b801,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5280bda..90083ef 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 _0xe510=['emit','hasOwnProperty','exports','events','../../mysqldb','Team','save','update'];(function(_0x5ad70b,_0x308a10){var _0x11a670=function(_0x2ad636){while(--_0x2ad636){_0x5ad70b['push'](_0x5ad70b['shift']());}};_0x11a670(++_0x308a10);}(_0xe510,0x6b));var _0x0e51=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xe510[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x0e51('0x0'));var Team=require(_0x0e51('0x1'))['db'][_0x0e51('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e51('0x3'),'afterUpdate':_0x0e51('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35ad94){return function(_0x4169bb,_0x43fd90,_0xd48654){TeamEvents[_0x0e51('0x5')](_0x35ad94+':'+_0x4169bb['id'],_0x4169bb);TeamEvents[_0x0e51('0x5')](_0x35ad94,_0x4169bb);_0xd48654(null);};}for(var e in events){if(events[_0x0e51('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x0e51('0x7')]=TeamEvents; \ No newline at end of file +var _0x3a26=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x1e1ed4,_0x3fe6a8){var _0x1593d7=function(_0x23e76e){while(--_0x23e76e){_0x1e1ed4['push'](_0x1e1ed4['shift']());}};_0x1593d7(++_0x3fe6a8);}(_0x3a26,0x1f4));var _0x63a2=function(_0x43b3cf,_0x4c75e8){_0x43b3cf=_0x43b3cf-0x0;var _0x287a6d=_0x3a26[_0x43b3cf];return _0x287a6d;};'use strict';var EventEmitter=require(_0x63a2('0x0'));var Team=require(_0x63a2('0x1'))['db'][_0x63a2('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x63a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x63a2('0x4'),'afterDestroy':_0x63a2('0x5')};function emitEvent(_0x596626){return function(_0xe0eae6,_0x50e38f,_0x233075){TeamEvents['emit'](_0x596626+':'+_0xe0eae6['id'],_0xe0eae6);TeamEvents['emit'](_0x596626,_0xe0eae6);_0x233075(null);};}for(var e in events){if(events[_0x63a2('0x6')](e)){var event=events[e];Team[_0x63a2('0x7')](e,emitEvent(event));}}module[_0x63a2('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 38e9ab4..5a8cbcc 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 _0xb048=['resolve','all','get','then','map','catch','define','teams','Chat','Fax','Openchannel','Voice'];(function(_0x34c519,_0x4b45da){var _0x7efb32=function(_0x22a56a){while(--_0x22a56a){_0x34c519['push'](_0x34c519['shift']());}};_0x7efb32(++_0x4b45da);}(_0xb048,0x15e));var _0x8b04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb048[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0xc38971,_0x41d033){var _0x30a032=_0x8b04('0x0')+_0x41d033+'Queues';return _0xc38971[_0x30a032]()[_0x8b04('0x1')](function(_0x56853f){return _[_0x8b04('0x2')](_0x56853f,function(_0x2f2981){_0x2f2981['setDataValue']('channel',_0x41d033);return _0x2f2981;});})[_0x8b04('0x3')](function(_0xa8bc98){throw _0xa8bc98;});}module['exports']=function(_0x5e334d){return _0x5e334d[_0x8b04('0x4')]('Team',attributes,{'tableName':_0x8b04('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x25ba03=this;var _0xe33378=[_0x8b04('0x6'),_0x8b04('0x7'),'Mail',_0x8b04('0x8'),'Sms',_0x8b04('0x9'),'Whatsapp'];return Promise[_0x8b04('0xa')]()[_0x8b04('0x1')](function(){var _0xec75de=_[_0x8b04('0x2')](_0xe33378,function(_0x1f3ae6){return getQueuesByChannel(_0x25ba03,_0x1f3ae6);});return Promise[_0x8b04('0xb')](_0xec75de);})[_0x8b04('0x3')](function(_0x35ba79){throw _0x35ba79;});}}});}; \ No newline at end of file +var _0x80c7=['resolve','map','all','./team.attributes','get','Queues','then','channel','catch','exports','define','Team','Chat','Openchannel','Sms','Voice','Whatsapp'];(function(_0x467e8e,_0x162852){var _0x16c2a5=function(_0x380795){while(--_0x380795){_0x467e8e['push'](_0x467e8e['shift']());}};_0x16c2a5(++_0x162852);}(_0x80c7,0x18a));var _0x780c=function(_0x1e44a4,_0x58f0ea){_0x1e44a4=_0x1e44a4-0x0;var _0x2d69b0=_0x80c7[_0x1e44a4];return _0x2d69b0;};'use strict';var _=require('lodash');var attributes=require(_0x780c('0x0'));function getQueuesByChannel(_0x4b019f,_0x1ee4c5){var _0x548736=_0x780c('0x1')+_0x1ee4c5+_0x780c('0x2');return _0x4b019f[_0x548736]()[_0x780c('0x3')](function(_0x5a032b){return _['map'](_0x5a032b,function(_0x1cf3c3){_0x1cf3c3['setDataValue'](_0x780c('0x4'),_0x1ee4c5);return _0x1cf3c3;});})[_0x780c('0x5')](function(_0x46b7b2){throw _0x46b7b2;});}module[_0x780c('0x6')]=function(_0x17f901){return _0x17f901[_0x780c('0x7')](_0x780c('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1fcd0f=this;var _0x5b6028=[_0x780c('0x9'),'Fax','Mail',_0x780c('0xa'),_0x780c('0xb'),_0x780c('0xc'),_0x780c('0xd')];return Promise[_0x780c('0xe')]()[_0x780c('0x3')](function(){var _0x13a88b=_[_0x780c('0xf')](_0x5b6028,function(_0x42ec4b){return getQueuesByChannel(_0x1fcd0f,_0x42ec4b);});return Promise[_0x780c('0x10')](_0x13a88b);})[_0x780c('0x5')](function(_0x5ef3f2){throw _0x5ef3f2;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9fc9c1d..1a4266e 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 _0x0b19=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4625ce,_0x55986a){var _0x5d5e26=function(_0x14e834){while(--_0x14e834){_0x4625ce['push'](_0x4625ce['shift']());}};_0x5d5e26(++_0x55986a);}(_0x0b19,0x190));var _0x90b1=function(_0x5d9675,_0xdceabd){_0x5d9675=_0x5d9675-0x0;var _0x1fd2f6=_0x0b19[_0x5d9675];return _0x1fd2f6;};'use strict';var _=require('lodash');var util=require(_0x90b1('0x0'));var moment=require(_0x90b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x90b1('0x2'));var fs=require('fs');var Redis=require(_0x90b1('0x3'));var db=require(_0x90b1('0x4'))['db'];var utils=require(_0x90b1('0x5'));var logger=require(_0x90b1('0x6'))('rpc');var config=require(_0x90b1('0x7'));var jayson=require(_0x90b1('0x8'));var client=jayson['client'][_0x90b1('0x9')]({'port':0x232a});config[_0x90b1('0xa')]=_['defaults'](config[_0x90b1('0xa')],{'host':_0x90b1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90b1('0xa')]));require(_0x90b1('0xc'))['register'](socket);function respondWithRpcPromise(_0x3e0177,_0x59c8f9,_0x2be798){return new BPromise(function(_0x4893fd,_0xd1cec9){return client[_0x90b1('0xd')](_0x3e0177,_0x2be798)[_0x90b1('0xe')](function(_0x16f26d){logger[_0x90b1('0xf')](_0x90b1('0x10'),_0x59c8f9,_0x90b1('0x11'));logger[_0x90b1('0x12')](_0x90b1('0x13'),_0x59c8f9,_0x90b1('0x11'),JSON['stringify'](_0x16f26d));if(_0x16f26d[_0x90b1('0x14')]){if(_0x16f26d[_0x90b1('0x14')][_0x90b1('0x15')]===0x1f4){logger[_0x90b1('0x14')](_0x90b1('0x10'),_0x59c8f9,_0x16f26d[_0x90b1('0x14')]['message']);return _0xd1cec9(_0x16f26d['error'][_0x90b1('0x16')]);}logger[_0x90b1('0x14')](_0x90b1('0x10'),_0x59c8f9,_0x16f26d[_0x90b1('0x14')]['message']);return _0x4893fd(_0x16f26d[_0x90b1('0x14')][_0x90b1('0x16')]);}else{logger[_0x90b1('0xf')](_0x90b1('0x10'),_0x59c8f9,'request\x20sent');_0x4893fd(_0x16f26d[_0x90b1('0x17')][_0x90b1('0x16')]);}})[_0x90b1('0x18')](function(_0x2471ea){logger[_0x90b1('0x14')](_0x90b1('0x10'),_0x59c8f9,_0x2471ea);_0xd1cec9(_0x2471ea);});});} \ No newline at end of file +var _0x032e=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x350902,_0x209604){var _0x4bbba5=function(_0x402a4c){while(--_0x402a4c){_0x350902['push'](_0x350902['shift']());}};_0x4bbba5(++_0x209604);}(_0x032e,0x124));var _0xe032=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x032e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('Team,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a4a9ec9..a3e9e33 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 _0x56dc=['team:','./team.events','remove','update','removeListener','register','length'];(function(_0x4f6e1a,_0x579259){var _0x49b458=function(_0x4b5a61){while(--_0x4b5a61){_0x4f6e1a['push'](_0x4f6e1a['shift']());}};_0x49b458(++_0x579259);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0xc56d('0x0'));var events=['save',_0xc56d('0x1'),_0xc56d('0x2')];function createListener(_0x1bb6ec,_0x11e58b){return function(_0x1cfc0f){_0x11e58b['emit'](_0x1bb6ec,_0x1cfc0f);};}function removeListener(_0x2ffdfe,_0x2e7620){return function(){TeamEvents[_0xc56d('0x3')](_0x2ffdfe,_0x2e7620);};}exports[_0xc56d('0x4')]=function(_0x3eb4ed){for(var _0x3e68f4=0x0,_0x571341=events[_0xc56d('0x5')];_0x3e68f4<_0x571341;_0x3e68f4++){var _0x24b556=events[_0x3e68f4];var _0x3ac7cd=createListener(_0xc56d('0x6')+_0x24b556,_0x3eb4ed);TeamEvents['on'](_0x24b556,_0x3ac7cd);}}; \ No newline at end of file +var _0x6aa4=['length','team:','./team.events','save','remove','emit','removeListener','register'];(function(_0x59d517,_0x166ca2){var _0x522a2e=function(_0x49fd5a){while(--_0x49fd5a){_0x59d517['push'](_0x59d517['shift']());}};_0x522a2e(++_0x166ca2);}(_0x6aa4,0xb2));var _0x46aa=function(_0x3a3857,_0x98cfc3){_0x3a3857=_0x3a3857-0x0;var _0x31ff92=_0x6aa4[_0x3a3857];return _0x31ff92;};'use strict';var TeamEvents=require(_0x46aa('0x0'));var events=[_0x46aa('0x1'),_0x46aa('0x2'),'update'];function createListener(_0x25cf6a,_0x598ef0){return function(_0x1242ef){_0x598ef0[_0x46aa('0x3')](_0x25cf6a,_0x1242ef);};}function removeListener(_0x3d4a1e,_0x3b47ba){return function(){TeamEvents[_0x46aa('0x4')](_0x3d4a1e,_0x3b47ba);};}exports[_0x46aa('0x5')]=function(_0x290f7d){for(var _0x8d685c=0x0,_0x3a7d40=events[_0x46aa('0x6')];_0x8d685c<_0x3a7d40;_0x8d685c++){var _0x482dfb=events[_0x8d685c];var _0x12ad97=createListener(_0x46aa('0x7')+_0x482dfb,_0x290f7d);TeamEvents['on'](_0x482dfb,_0x12ad97);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index dedd50a..dafb736 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 _0x24b3=['INTEGER','sequelize','exports'];(function(_0x7e6c4c,_0x4768c0){var _0x51ec6b=function(_0x444d53){while(--_0x444d53){_0x7e6c4c['push'](_0x7e6c4c['shift']());}};_0x51ec6b(++_0x4768c0);}(_0x24b3,0xd3));var _0x324b=function(_0x4248e0,_0x1d3b1d){_0x4248e0=_0x4248e0-0x0;var _0x5c44f1=_0x24b3[_0x4248e0];return _0x5c44f1;};'use strict';var Sequelize=require(_0x324b('0x0'));module[_0x324b('0x1')]={'TeamId':{'type':Sequelize[_0x324b('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdf96=['sequelize','exports','INTEGER'];(function(_0x50d26b,_0x259ae9){var _0x5b8cdc=function(_0x5b5fa7){while(--_0x5b5fa7){_0x50d26b['push'](_0x50d26b['shift']());}};_0x5b8cdc(++_0x259ae9);}(_0xdf96,0xfc));var _0x6df9=function(_0x389f4f,_0x3b8dfd){_0x389f4f=_0x389f4f-0x0;var _0x41c9b8=_0xdf96[_0x389f4f];return _0x41c9b8;};'use strict';var Sequelize=require(_0x6df9('0x0'));module[_0x6df9('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6df9('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 4ac75f6..c37da50 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 _0xee4e=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xee4e,0x122));var _0xeee4=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xee4e[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var logger=require(_0xeee4('0x2'))('api');var moment=require(_0xeee4('0x3'));var BPromise=require(_0xeee4('0x4'));var rp=require(_0xeee4('0x5'));var fs=require('fs');var path=require(_0xeee4('0x6'));var rimraf=require(_0xeee4('0x7'));var config=require(_0xeee4('0x8'));var attributes=require(_0xeee4('0x9'));module[_0xeee4('0xa')]=function(_0x5564f7,_0xcf3bbd){return _0x5564f7[_0xeee4('0xb')](_0xeee4('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75e3=['request-promise','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird'];(function(_0x6019ad,_0x177ce3){var _0x327802=function(_0x214cce){while(--_0x214cce){_0x6019ad['push'](_0x6019ad['shift']());}};_0x327802(++_0x177ce3);}(_0x75e3,0x104));var _0x375e=function(_0x5351b8,_0x1bed41){_0x5351b8=_0x5351b8-0x0;var _0x61dee6=_0x75e3[_0x5351b8];return _0x61dee6;};'use strict';var _=require('lodash');var util=require(_0x375e('0x0'));var logger=require(_0x375e('0x1'))('api');var moment=require(_0x375e('0x2'));var BPromise=require(_0x375e('0x3'));var rp=require(_0x375e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x375e('0x5'));module['exports']=function(_0x17e32c,_0x52f876){return _0x17e32c['define'](_0x375e('0x6'),attributes,{'tableName':_0x375e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index dfb0ede..18c42a5 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x647508,_0x39d116){var _0x4c54b1=function(_0x54e222){while(--_0x54e222){_0x647508['push'](_0x647508['shift']());}};_0x4c54b1(++_0x39d116);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 6831afa..4c00f57 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 _0xe341=['sequelize','INTEGER'];(function(_0x1999b3,_0x14aaf6){var _0x31a31a=function(_0x326679){while(--_0x326679){_0x1999b3['push'](_0x1999b3['shift']());}};_0x31a31a(++_0x14aaf6);}(_0xe341,0x18c));var _0x1e34=function(_0x248f6a,_0x54db0b){_0x248f6a=_0x248f6a-0x0;var _0x151dd0=_0xe341[_0x248f6a];return _0x151dd0;};'use strict';var Sequelize=require(_0x1e34('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1e34('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x444a=['sequelize','exports','INTEGER'];(function(_0x4a25e3,_0xffc2aa){var _0xc2ac02=function(_0x1f0eba){while(--_0x1f0eba){_0x4a25e3['push'](_0x4a25e3['shift']());}};_0xc2ac02(++_0xffc2aa);}(_0x444a,0xba));var _0xa444=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x444a[_0x5a6644];return _0x3a2a5d;};'use strict';var Sequelize=require(_0xa444('0x0'));module[_0xa444('0x1')]={'penalty':{'type':Sequelize[_0xa444('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index c1e8afd..1306a1f 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 _0x6737=['../../config/environment','./teamVoiceQueue.attributes','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x47c725,_0x2ebe05){var _0x35cc43=function(_0x10ca71){while(--_0x10ca71){_0x47c725['push'](_0x47c725['shift']());}};_0x35cc43(++_0x2ebe05);}(_0x6737,0xe2));var _0x7673=function(_0x2ebbb8,_0x4431c9){_0x2ebbb8=_0x2ebbb8-0x0;var _0x254e15=_0x6737[_0x2ebbb8];return _0x254e15;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var logger=require(_0x7673('0x1'))('api');var moment=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var rp=require(_0x7673('0x4'));var fs=require('fs');var path=require(_0x7673('0x5'));var rimraf=require('rimraf');var config=require(_0x7673('0x6'));var attributes=require(_0x7673('0x7'));module['exports']=function(_0x2f5edc,_0x15230f){return _0x2f5edc['define']('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9879=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','../../config/logger','moment'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0x9879,0x98));var _0x9987=function(_0x49f683,_0x1200fa){_0x49f683=_0x49f683-0x0;var _0x463692=_0x9879[_0x49f683];return _0x463692;};'use strict';var _=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var logger=require(_0x9987('0x2'))('api');var moment=require(_0x9987('0x3'));var BPromise=require('bluebird');var rp=require(_0x9987('0x4'));var fs=require('fs');var path=require(_0x9987('0x5'));var rimraf=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var attributes=require(_0x9987('0x8'));module[_0x9987('0x9')]=function(_0x4258df,_0x4d479d){return _0x4258df[_0x9987('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x9987('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 95371d4..6847773 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 _0xb56b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0xb56b,0xdc));var _0xbb56=function(_0x2638d0,_0x52f653){_0x2638d0=_0x2638d0-0x0;var _0x411a60=_0xb56b[_0x2638d0];return _0x411a60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbb56('0x0'));var BPromise=require(_0xbb56('0x1'));var rs=require(_0xbb56('0x2'));var fs=require('fs');var Redis=require(_0xbb56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb56('0x4'));var logger=require(_0xbb56('0x5'))('rpc');var config=require(_0xbb56('0x6'));var jayson=require(_0xbb56('0x7'));var client=jayson[_0xbb56('0x8')][_0xbb56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24a583,_0x475f03,_0x3107a5){return new BPromise(function(_0x4615fe,_0x5c8c9a){return client['request'](_0x24a583,_0x3107a5)[_0xbb56('0xa')](function(_0x3f659e){logger['info'](_0xbb56('0xb'),_0x475f03,_0xbb56('0xc'));logger[_0xbb56('0xd')](_0xbb56('0xe'),_0x475f03,'request\x20sent',JSON[_0xbb56('0xf')](_0x3f659e));if(_0x3f659e[_0xbb56('0x10')]){if(_0x3f659e[_0xbb56('0x10')][_0xbb56('0x11')]===0x1f4){logger[_0xbb56('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x475f03,_0x3f659e[_0xbb56('0x10')][_0xbb56('0x12')]);return _0x5c8c9a(_0x3f659e[_0xbb56('0x10')][_0xbb56('0x12')]);}logger[_0xbb56('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x475f03,_0x3f659e[_0xbb56('0x10')][_0xbb56('0x12')]);return _0x4615fe(_0x3f659e[_0xbb56('0x10')][_0xbb56('0x12')]);}else{logger[_0xbb56('0x13')](_0xbb56('0xb'),_0x475f03,'request\x20sent');_0x4615fe(_0x3f659e[_0xbb56('0x14')]['message']);}})[_0xbb56('0x15')](function(_0x190e8e){logger[_0xbb56('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x475f03,_0x190e8e);_0x5c8c9a(_0x190e8e);});});} \ No newline at end of file +var _0x303a=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x303a,0x1a0));var _0xa303=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x303a[_0x5ad0d7];return _0xd83bd;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 37ad6e1..fb5ab3c 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 _0xd9eb=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xbd53d6,_0x53f8d9){var _0x1dc607=function(_0x11a292){while(--_0x11a292){_0xbd53d6['push'](_0xbd53d6['shift']());}};_0x1dc607(++_0x53f8d9);}(_0xd9eb,0xca));var _0xbd9e=function(_0x4b1475,_0x41bf4c){_0x4b1475=_0x4b1475-0x0;var _0x3153e6=_0xd9eb[_0x4b1475];return _0x3153e6;};'use strict';var multer=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var path=require(_0xbd9e('0x2'));var timeout=require(_0xbd9e('0x3'));var express=require(_0xbd9e('0x4'));var router=express[_0xbd9e('0x5')]();var fs_extra=require(_0xbd9e('0x6'));var auth=require(_0xbd9e('0x7'));var interaction=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var controller=require(_0xbd9e('0xa'));router[_0xbd9e('0xb')]('/',auth[_0xbd9e('0xc')](),controller['index']);router[_0xbd9e('0xb')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0xe')]);router[_0xbd9e('0xf')]('/',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x10')]);router[_0xbd9e('0x11')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x12')]);router[_0xbd9e('0x13')]('/:id',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd0da=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','create','put','update','delete','destroy'];(function(_0x48ced4,_0x28eedb){var _0x1aa323=function(_0x465b73){while(--_0x465b73){_0x48ced4['push'](_0x48ced4['shift']());}};_0x1aa323(++_0x28eedb);}(_0xd0da,0x1b1));var _0xad0d=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xd0da[_0x593564];return _0x211a89;};'use strict';var multer=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var timeout=require(_0xad0d('0x3'));var express=require(_0xad0d('0x4'));var router=express['Router']();var fs_extra=require(_0xad0d('0x5'));var auth=require(_0xad0d('0x6'));var interaction=require(_0xad0d('0x7'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xad0d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad0d('0x8')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xb')]);router['post']('/',auth[_0xad0d('0xa')](),controller[_0xad0d('0xc')]);router[_0xad0d('0xd')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0xe')]);router[_0xad0d('0xf')](_0xad0d('0x9'),auth[_0xad0d('0xa')](),controller[_0xad0d('0x10')]);module[_0xad0d('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 2ae6165..3849f0f 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 _0xc2a5=['sequelize','exports','STRING'];(function(_0x2ea26d,_0x49f40f){var _0x596837=function(_0x59a595){while(--_0x59a595){_0x2ea26d['push'](_0x2ea26d['shift']());}};_0x596837(++_0x49f40f);}(_0xc2a5,0x1a1));var _0x5c2a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc2a5[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x5c2a('0x0'));module[_0x5c2a('0x1')]={'name':{'type':Sequelize[_0x5c2a('0x2')]},'description':{'type':Sequelize[_0x5c2a('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdcd0=['STRING','TEXT'];(function(_0x1b5349,_0x15c2a1){var _0x3d1ac8=function(_0x3d83fc){while(--_0x3d83fc){_0x1b5349['push'](_0x1b5349['shift']());}};_0x3d1ac8(++_0x15c2a1);}(_0xdcd0,0x1ac));var _0x0dcd=function(_0x117773,_0x208c95){_0x117773=_0x117773-0x0;var _0x40c850=_0xdcd0[_0x117773];return _0x40c850;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0dcd('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0dcd('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9fd1909..86adc47 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 _0xc03b=['limit','count','offset','set','Content-Range','reject','save','then','destroy','Templates','error','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','catch','create','body','get','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc03b,0x135));var _0xbc03=function(_0x5b445b,_0xd251da){_0x5b445b=_0x5b445b-0x0;var _0x1a40fe=_0xc03b[_0x5b445b];return _0x1a40fe;};'use strict';var emlformat=require(_0xbc03('0x0'));var rimraf=require(_0xbc03('0x1'));var zipdir=require(_0xbc03('0x2'));var jsonpatch=require(_0xbc03('0x3'));var rp=require(_0xbc03('0x4'));var moment=require(_0xbc03('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbc03('0x6'));var path=require(_0xbc03('0x7'));var sox=require(_0xbc03('0x8'));var csv=require(_0xbc03('0x9'));var ejs=require(_0xbc03('0xa'));var fs=require('fs');var fs_extra=require(_0xbc03('0xb'));var _=require(_0xbc03('0xc'));var squel=require(_0xbc03('0xd'));var crypto=require('crypto');var jsforce=require(_0xbc03('0xe'));var deskjs=require(_0xbc03('0xf'));var toCsv=require(_0xbc03('0x9'));var querystring=require(_0xbc03('0x10'));var Papa=require(_0xbc03('0x11'));var Redis=require('ioredis');var authService=require(_0xbc03('0x12'));var qs=require(_0xbc03('0x13'));var as=require(_0xbc03('0x14'));var hardwareService=require(_0xbc03('0x15'));var logger=require(_0xbc03('0x16'))('api');var utils=require(_0xbc03('0x17'));var config=require(_0xbc03('0x18'));var licenseUtil=require(_0xbc03('0x19'));var db=require(_0xbc03('0x1a'))['db'];function respondWithStatusCode(_0x1e60da,_0x4580f3){_0x4580f3=_0x4580f3||0xcc;return function(_0x4708eb){if(_0x4708eb){return _0x1e60da[_0xbc03('0x1b')](_0x4580f3);}return _0x1e60da[_0xbc03('0x1c')](_0x4580f3)[_0xbc03('0x1d')]();};}function respondWithResult(_0x22ef7a,_0x7452ef){_0x7452ef=_0x7452ef||0xc8;return function(_0xea245e){if(_0xea245e){return _0x22ef7a[_0xbc03('0x1c')](_0x7452ef)[_0xbc03('0x1e')](_0xea245e);}};}function respondWithFilteredResult(_0x3d9142,_0x1c56d0){return function(_0xf2e4f6){if(_0xf2e4f6){var _0x35eb0e=typeof _0x1c56d0['offset']==='undefined'&&typeof _0x1c56d0[_0xbc03('0x1f')]==='undefined';var _0x1a24c9=_0xf2e4f6[_0xbc03('0x20')];var _0x57b9ff=_0x35eb0e?0x0:_0x1c56d0[_0xbc03('0x21')];var _0x5445dc=_0x35eb0e?_0xf2e4f6[_0xbc03('0x20')]:_0x1c56d0[_0xbc03('0x21')]+_0x1c56d0[_0xbc03('0x1f')];var _0x4f2647;if(_0x5445dc>=_0x1a24c9){_0x5445dc=_0x1a24c9;_0x4f2647=0xc8;}else{_0x4f2647=0xce;}_0x3d9142[_0xbc03('0x1c')](_0x4f2647);return _0x3d9142[_0xbc03('0x22')](_0xbc03('0x23'),_0x57b9ff+'-'+_0x5445dc+'/'+_0x1a24c9)[_0xbc03('0x1e')](_0xf2e4f6);}return null;};}function patchUpdates(_0x4c3e2f){return function(_0x55bfca){try{jsonpatch['apply'](_0x55bfca,_0x4c3e2f,!![]);}catch(_0x16482c){return BPromise[_0xbc03('0x24')](_0x16482c);}return _0x55bfca[_0xbc03('0x25')]();};}function saveUpdates(_0x2f6846,_0x3a23b5){return function(_0x28bfc6){if(_0x28bfc6){return _0x28bfc6['update'](_0x2f6846)[_0xbc03('0x26')](function(_0x4857e4){return _0x4857e4;});}return null;};}function removeEntity(_0x555c47,_0x115318){return function(_0x49306e){if(_0x49306e){return _0x49306e[_0xbc03('0x27')]()[_0xbc03('0x26')](function(){var _0x219b4b=_0x49306e['get']({'plain':!![]});var _0x265de4=_0xbc03('0x28');return db['UserProfileResource'][_0xbc03('0x27')]({'where':{'type':_0x265de4,'resourceId':_0x219b4b['id']}})[_0xbc03('0x26')](function(){return _0x49306e;});})[_0xbc03('0x26')](function(){_0x555c47[_0xbc03('0x1c')](0xcc)[_0xbc03('0x1d')]();});}};}function handleEntityNotFound(_0x5d0050,_0xb5c9b0){return function(_0x412d0c){if(!_0x412d0c){_0x5d0050[_0xbc03('0x1b')](0x194);}return _0x412d0c;};}function handleError(_0x2282a1,_0x541ef2){_0x541ef2=_0x541ef2||0x1f4;return function(_0x46fcef){logger[_0xbc03('0x29')](_0x46fcef['stack']);if(_0x46fcef[_0xbc03('0x2a')]){delete _0x46fcef['name'];}_0x2282a1[_0xbc03('0x1c')](_0x541ef2)[_0xbc03('0x2b')](_0x46fcef);};}exports[_0xbc03('0x2c')]=function(_0x27f235,_0x368bbd){var _0x23c918={},_0x22d52={},_0x3cf80a={'count':0x0,'rows':[]};var _0x40a0aa=_[_0xbc03('0x2d')](db[_0xbc03('0x2e')][_0xbc03('0x2f')],function(_0x2b8b72){return{'name':_0x2b8b72[_0xbc03('0x30')],'type':_0x2b8b72[_0xbc03('0x31')][_0xbc03('0x32')]};});_0x22d52[_0xbc03('0x33')]=_['map'](_0x40a0aa,_0xbc03('0x2a'));_0x22d52[_0xbc03('0x34')]=_[_0xbc03('0x35')](_0x27f235[_0xbc03('0x34')]);_0x22d52['filters']=_[_0xbc03('0x36')](_0x22d52[_0xbc03('0x33')],_0x22d52[_0xbc03('0x34')]);_0x23c918[_0xbc03('0x37')]=_['intersection'](_0x22d52[_0xbc03('0x33')],qs[_0xbc03('0x38')](_0x27f235[_0xbc03('0x34')][_0xbc03('0x38')]));_0x23c918[_0xbc03('0x37')]=_0x23c918[_0xbc03('0x37')][_0xbc03('0x39')]?_0x23c918[_0xbc03('0x37')]:_0x22d52['model'];if(!_0x27f235['query'][_0xbc03('0x3a')](_0xbc03('0x3b'))){_0x23c918[_0xbc03('0x1f')]=qs[_0xbc03('0x1f')](_0x27f235[_0xbc03('0x34')]['limit']);_0x23c918['offset']=qs[_0xbc03('0x21')](_0x27f235[_0xbc03('0x34')][_0xbc03('0x21')]);}_0x23c918[_0xbc03('0x3c')]=qs['sort'](_0x27f235[_0xbc03('0x34')][_0xbc03('0x3d')]);_0x23c918[_0xbc03('0x3e')]=qs[_0xbc03('0x3f')](_[_0xbc03('0x40')](_0x27f235[_0xbc03('0x34')],_0x22d52['filters']),_0x40a0aa);if(_0x27f235[_0xbc03('0x34')][_0xbc03('0x41')]){_0x23c918[_0xbc03('0x3e')]=_[_0xbc03('0x42')](_0x23c918[_0xbc03('0x3e')],{'$or':_[_0xbc03('0x2d')](_0x40a0aa,function(_0x2e95d2){if(_0x2e95d2[_0xbc03('0x31')]!==_0xbc03('0x43')){var _0x20984b={};_0x20984b[_0x2e95d2['name']]={'$like':'%'+_0x27f235[_0xbc03('0x34')]['filter']+'%'};return _0x20984b;}})});}_0x23c918=_[_0xbc03('0x42')]({},_0x23c918,_0x27f235[_0xbc03('0x44')]);var _0x164c70={'where':_0x23c918[_0xbc03('0x3e')]};return db[_0xbc03('0x2e')]['count'](_0x164c70)[_0xbc03('0x26')](function(_0x34b59d){_0x3cf80a['count']=_0x34b59d;if(_0x27f235[_0xbc03('0x34')][_0xbc03('0x45')]){_0x23c918[_0xbc03('0x46')]=[{'all':!![]}];}return db[_0xbc03('0x2e')]['findAll'](_0x23c918);})['then'](function(_0x561e11){_0x3cf80a['rows']=_0x561e11;return _0x3cf80a;})['then'](respondWithFilteredResult(_0x368bbd,_0x23c918))['catch'](handleError(_0x368bbd,null));};exports[_0xbc03('0x47')]=function(_0x5e2c22,_0x8b0666){var _0x22338b={'raw':!![],'where':{'id':_0x5e2c22[_0xbc03('0x48')]['id']}},_0x53bcf5={};_0x53bcf5[_0xbc03('0x33')]=_['keys'](db[_0xbc03('0x2e')]['rawAttributes']);_0x53bcf5[_0xbc03('0x34')]=_[_0xbc03('0x35')](_0x5e2c22[_0xbc03('0x34')]);_0x53bcf5[_0xbc03('0x3f')]=_[_0xbc03('0x36')](_0x53bcf5[_0xbc03('0x33')],_0x53bcf5[_0xbc03('0x34')]);_0x22338b[_0xbc03('0x37')]=_[_0xbc03('0x36')](_0x53bcf5[_0xbc03('0x33')],qs['fields'](_0x5e2c22[_0xbc03('0x34')]['fields']));_0x22338b[_0xbc03('0x37')]=_0x22338b[_0xbc03('0x37')]['length']?_0x22338b[_0xbc03('0x37')]:_0x53bcf5[_0xbc03('0x33')];if(_0x5e2c22[_0xbc03('0x34')][_0xbc03('0x45')]){_0x22338b[_0xbc03('0x46')]=[{'all':!![]}];}_0x22338b=_['merge']({},_0x22338b,_0x5e2c22[_0xbc03('0x44')]);return db[_0xbc03('0x2e')][_0xbc03('0x49')](_0x22338b)[_0xbc03('0x26')](handleEntityNotFound(_0x8b0666,null))[_0xbc03('0x26')](respondWithResult(_0x8b0666,null))[_0xbc03('0x4a')](handleError(_0x8b0666,null));};exports[_0xbc03('0x4b')]=function(_0x28bd68,_0x254d5b){return db[_0xbc03('0x2e')][_0xbc03('0x4b')](_0x28bd68[_0xbc03('0x4c')],{})[_0xbc03('0x26')](function(_0x16d3a7){var _0x172334=_0x28bd68['user'][_0xbc03('0x4d')]({'plain':!![]});if(!_0x172334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x172334[_0xbc03('0x4e')]===_0xbc03('0x4f')){var _0x56acda=_0x16d3a7['get']({'plain':!![]});var _0x5282fd='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x5282fd,'userProfileId':_0x172334[_0xbc03('0x50')]},'raw':!![]})[_0xbc03('0x26')](function(_0x41dfcb){if(_0x41dfcb&&_0x41dfcb[_0xbc03('0x51')]===0x0){return db[_0xbc03('0x52')][_0xbc03('0x4b')]({'name':_0x56acda[_0xbc03('0x2a')],'resourceId':_0x56acda['id'],'type':_0x41dfcb['name'],'sectionId':_0x41dfcb['id']},{})['then'](function(){return _0x16d3a7;});}else{return _0x16d3a7;}})[_0xbc03('0x4a')](function(_0x305106){logger[_0xbc03('0x29')](_0xbc03('0x53'),_0x305106);throw _0x305106;});}return _0x16d3a7;})['then'](respondWithResult(_0x254d5b,0xc9))['catch'](handleError(_0x254d5b,null));};exports[_0xbc03('0x54')]=function(_0x2566d1,_0x543296){if(_0x2566d1[_0xbc03('0x4c')]['id']){delete _0x2566d1['body']['id'];}return db[_0xbc03('0x2e')][_0xbc03('0x49')]({'where':{'id':_0x2566d1['params']['id']}})['then'](handleEntityNotFound(_0x543296,null))['then'](saveUpdates(_0x2566d1[_0xbc03('0x4c')],null))[_0xbc03('0x26')](respondWithResult(_0x543296,null))[_0xbc03('0x4a')](handleError(_0x543296,null));};exports['destroy']=function(_0x5e6078,_0x36b9fd){return db[_0xbc03('0x2e')]['find']({'where':{'id':_0x5e6078[_0xbc03('0x48')]['id']}})['then'](handleEntityNotFound(_0x36b9fd,null))['then'](removeEntity(_0x36b9fd,null))['catch'](handleError(_0x36b9fd,null));}; \ No newline at end of file +var _0x374f=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','then','includeAll','findAll','show','params','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','error','stack','name','Template','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes'];(function(_0xba6f5,_0x3c7d08){var _0x334f46=function(_0x17107d){while(--_0x17107d){_0xba6f5['push'](_0xba6f5['shift']());}};_0x334f46(++_0x3c7d08);}(_0x374f,0xc0));var _0xf374=function(_0x4bff41,_0x29210d){_0x4bff41=_0x4bff41-0x0;var _0x3c83eb=_0x374f[_0x4bff41];return _0x3c83eb;};'use strict';var emlformat=require(_0xf374('0x0'));var rimraf=require(_0xf374('0x1'));var zipdir=require(_0xf374('0x2'));var jsonpatch=require(_0xf374('0x3'));var rp=require('request-promise');var moment=require(_0xf374('0x4'));var BPromise=require(_0xf374('0x5'));var Mustache=require(_0xf374('0x6'));var util=require(_0xf374('0x7'));var path=require(_0xf374('0x8'));var sox=require(_0xf374('0x9'));var csv=require(_0xf374('0xa'));var ejs=require(_0xf374('0xb'));var fs=require('fs');var fs_extra=require(_0xf374('0xc'));var _=require(_0xf374('0xd'));var squel=require(_0xf374('0xe'));var crypto=require(_0xf374('0xf'));var jsforce=require(_0xf374('0x10'));var deskjs=require(_0xf374('0x11'));var toCsv=require(_0xf374('0xa'));var querystring=require(_0xf374('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf374('0x13'));var as=require(_0xf374('0x14'));var hardwareService=require(_0xf374('0x15'));var logger=require('../../config/logger')(_0xf374('0x16'));var utils=require(_0xf374('0x17'));var config=require(_0xf374('0x18'));var licenseUtil=require(_0xf374('0x19'));var db=require(_0xf374('0x1a'))['db'];function respondWithStatusCode(_0x4b7586,_0x4588df){_0x4588df=_0x4588df||0xcc;return function(_0x5bd9e5){if(_0x5bd9e5){return _0x4b7586['sendStatus'](_0x4588df);}return _0x4b7586[_0xf374('0x1b')](_0x4588df)[_0xf374('0x1c')]();};}function respondWithResult(_0x2081d6,_0x1649c4){_0x1649c4=_0x1649c4||0xc8;return function(_0x1dc157){if(_0x1dc157){return _0x2081d6[_0xf374('0x1b')](_0x1649c4)[_0xf374('0x1d')](_0x1dc157);}};}function respondWithFilteredResult(_0x170d0e,_0x5942ae){return function(_0x5ca147){if(_0x5ca147){var _0xf9d9ff=typeof _0x5942ae[_0xf374('0x1e')]==='undefined'&&typeof _0x5942ae['limit']==='undefined';var _0x58e991=_0x5ca147[_0xf374('0x1f')];var _0x12d916=_0xf9d9ff?0x0:_0x5942ae[_0xf374('0x1e')];var _0xc269c5=_0xf9d9ff?_0x5ca147['count']:_0x5942ae[_0xf374('0x1e')]+_0x5942ae[_0xf374('0x20')];var _0x678cd7;if(_0xc269c5>=_0x58e991){_0xc269c5=_0x58e991;_0x678cd7=0xc8;}else{_0x678cd7=0xce;}_0x170d0e[_0xf374('0x1b')](_0x678cd7);return _0x170d0e[_0xf374('0x21')](_0xf374('0x22'),_0x12d916+'-'+_0xc269c5+'/'+_0x58e991)[_0xf374('0x1d')](_0x5ca147);}return null;};}function patchUpdates(_0x2d536d){return function(_0x24068f){try{jsonpatch[_0xf374('0x23')](_0x24068f,_0x2d536d,!![]);}catch(_0x36aac1){return BPromise[_0xf374('0x24')](_0x36aac1);}return _0x24068f[_0xf374('0x25')]();};}function saveUpdates(_0x303e21,_0x3bd19f){return function(_0x1261b3){if(_0x1261b3){return _0x1261b3[_0xf374('0x26')](_0x303e21)['then'](function(_0x5f17ca){return _0x5f17ca;});}return null;};}function removeEntity(_0x56357f,_0x40ca32){return function(_0x26d2bd){if(_0x26d2bd){return _0x26d2bd[_0xf374('0x27')]()['then'](function(){var _0x55dcfe=_0x26d2bd[_0xf374('0x28')]({'plain':!![]});var _0xd76da5='Templates';return db[_0xf374('0x29')][_0xf374('0x27')]({'where':{'type':_0xd76da5,'resourceId':_0x55dcfe['id']}})['then'](function(){return _0x26d2bd;});})['then'](function(){_0x56357f[_0xf374('0x1b')](0xcc)[_0xf374('0x1c')]();});}};}function handleEntityNotFound(_0x533f16,_0x58a390){return function(_0x46662f){if(!_0x46662f){_0x533f16['sendStatus'](0x194);}return _0x46662f;};}function handleError(_0x1e0edd,_0x12aef1){_0x12aef1=_0x12aef1||0x1f4;return function(_0x510076){logger[_0xf374('0x2a')](_0x510076[_0xf374('0x2b')]);if(_0x510076[_0xf374('0x2c')]){delete _0x510076[_0xf374('0x2c')];}_0x1e0edd[_0xf374('0x1b')](_0x12aef1)['send'](_0x510076);};}exports['index']=function(_0x170947,_0x37c341){var _0x3cd7f5={},_0x18ad54={},_0x3c0e08={'count':0x0,'rows':[]};var _0x2b73ae=_['map'](db[_0xf374('0x2d')][_0xf374('0x2e')],function(_0x287645){return{'name':_0x287645[_0xf374('0x2f')],'type':_0x287645[_0xf374('0x30')]['key']};});_0x18ad54['model']=_['map'](_0x2b73ae,_0xf374('0x2c'));_0x18ad54[_0xf374('0x31')]=_[_0xf374('0x32')](_0x170947[_0xf374('0x31')]);_0x18ad54[_0xf374('0x33')]=_[_0xf374('0x34')](_0x18ad54['model'],_0x18ad54[_0xf374('0x31')]);_0x3cd7f5[_0xf374('0x35')]=_[_0xf374('0x34')](_0x18ad54[_0xf374('0x36')],qs[_0xf374('0x37')](_0x170947[_0xf374('0x31')][_0xf374('0x37')]));_0x3cd7f5[_0xf374('0x35')]=_0x3cd7f5[_0xf374('0x35')][_0xf374('0x38')]?_0x3cd7f5[_0xf374('0x35')]:_0x18ad54['model'];if(!_0x170947[_0xf374('0x31')][_0xf374('0x39')](_0xf374('0x3a'))){_0x3cd7f5[_0xf374('0x20')]=qs[_0xf374('0x20')](_0x170947[_0xf374('0x31')][_0xf374('0x20')]);_0x3cd7f5[_0xf374('0x1e')]=qs[_0xf374('0x1e')](_0x170947[_0xf374('0x31')][_0xf374('0x1e')]);}_0x3cd7f5[_0xf374('0x3b')]=qs[_0xf374('0x3c')](_0x170947[_0xf374('0x31')][_0xf374('0x3c')]);_0x3cd7f5[_0xf374('0x3d')]=qs[_0xf374('0x33')](_[_0xf374('0x3e')](_0x170947[_0xf374('0x31')],_0x18ad54[_0xf374('0x33')]),_0x2b73ae);if(_0x170947[_0xf374('0x31')]['filter']){_0x3cd7f5[_0xf374('0x3d')]=_[_0xf374('0x3f')](_0x3cd7f5[_0xf374('0x3d')],{'$or':_[_0xf374('0x40')](_0x2b73ae,function(_0x2f7c2d){if(_0x2f7c2d['type']!==_0xf374('0x41')){var _0x4b5d6f={};_0x4b5d6f[_0x2f7c2d[_0xf374('0x2c')]]={'$like':'%'+_0x170947[_0xf374('0x31')]['filter']+'%'};return _0x4b5d6f;}})});}_0x3cd7f5=_['merge']({},_0x3cd7f5,_0x170947[_0xf374('0x42')]);var _0x4aa471={'where':_0x3cd7f5[_0xf374('0x3d')]};return db[_0xf374('0x2d')][_0xf374('0x1f')](_0x4aa471)[_0xf374('0x43')](function(_0xbb0c9c){_0x3c0e08['count']=_0xbb0c9c;if(_0x170947[_0xf374('0x31')][_0xf374('0x44')]){_0x3cd7f5['include']=[{'all':!![]}];}return db['Template'][_0xf374('0x45')](_0x3cd7f5);})[_0xf374('0x43')](function(_0x938b7c){_0x3c0e08['rows']=_0x938b7c;return _0x3c0e08;})[_0xf374('0x43')](respondWithFilteredResult(_0x37c341,_0x3cd7f5))['catch'](handleError(_0x37c341,null));};exports[_0xf374('0x46')]=function(_0x3634be,_0x1ffbc2){var _0x2aab25={'raw':!![],'where':{'id':_0x3634be[_0xf374('0x47')]['id']}},_0x1ba59e={};_0x1ba59e[_0xf374('0x36')]=_[_0xf374('0x32')](db[_0xf374('0x2d')]['rawAttributes']);_0x1ba59e['query']=_[_0xf374('0x32')](_0x3634be['query']);_0x1ba59e['filters']=_[_0xf374('0x34')](_0x1ba59e[_0xf374('0x36')],_0x1ba59e[_0xf374('0x31')]);_0x2aab25['attributes']=_[_0xf374('0x34')](_0x1ba59e['model'],qs['fields'](_0x3634be[_0xf374('0x31')][_0xf374('0x37')]));_0x2aab25['attributes']=_0x2aab25[_0xf374('0x35')][_0xf374('0x38')]?_0x2aab25[_0xf374('0x35')]:_0x1ba59e[_0xf374('0x36')];if(_0x3634be['query'][_0xf374('0x44')]){_0x2aab25[_0xf374('0x48')]=[{'all':!![]}];}_0x2aab25=_[_0xf374('0x3f')]({},_0x2aab25,_0x3634be[_0xf374('0x42')]);return db[_0xf374('0x2d')]['find'](_0x2aab25)['then'](handleEntityNotFound(_0x1ffbc2,null))['then'](respondWithResult(_0x1ffbc2,null))[_0xf374('0x49')](handleError(_0x1ffbc2,null));};exports[_0xf374('0x4a')]=function(_0x54025d,_0x1f730f){return db[_0xf374('0x2d')][_0xf374('0x4a')](_0x54025d['body'],{})[_0xf374('0x43')](function(_0x3c3289){var _0x2b7186=_0x54025d[_0xf374('0x4b')][_0xf374('0x28')]({'plain':!![]});if(!_0x2b7186)throw new Error(_0xf374('0x4c'));if(_0x2b7186['role']===_0xf374('0x4b')){var _0x5c47e0=_0x3c3289[_0xf374('0x28')]({'plain':!![]});var _0x1504bd='Templates';return db[_0xf374('0x4d')][_0xf374('0x4e')]({'where':{'name':_0x1504bd,'userProfileId':_0x2b7186[_0xf374('0x4f')]},'raw':!![]})[_0xf374('0x43')](function(_0x1c4e9b){if(_0x1c4e9b&&_0x1c4e9b['autoAssociation']===0x0){return db['UserProfileResource'][_0xf374('0x4a')]({'name':_0x5c47e0[_0xf374('0x2c')],'resourceId':_0x5c47e0['id'],'type':_0x1c4e9b[_0xf374('0x2c')],'sectionId':_0x1c4e9b['id']},{})['then'](function(){return _0x3c3289;});}else{return _0x3c3289;}})[_0xf374('0x49')](function(_0x5e2a8a){logger[_0xf374('0x2a')](_0xf374('0x50'),_0x5e2a8a);throw _0x5e2a8a;});}return _0x3c3289;})['then'](respondWithResult(_0x1f730f,0xc9))[_0xf374('0x49')](handleError(_0x1f730f,null));};exports[_0xf374('0x26')]=function(_0x58f248,_0x3d3247){if(_0x58f248['body']['id']){delete _0x58f248[_0xf374('0x51')]['id'];}return db[_0xf374('0x2d')][_0xf374('0x4e')]({'where':{'id':_0x58f248[_0xf374('0x47')]['id']}})[_0xf374('0x43')](handleEntityNotFound(_0x3d3247,null))['then'](saveUpdates(_0x58f248['body'],null))[_0xf374('0x43')](respondWithResult(_0x3d3247,null))[_0xf374('0x49')](handleError(_0x3d3247,null));};exports[_0xf374('0x27')]=function(_0x37be1d,_0x2fd8a4){return db['Template']['find']({'where':{'id':_0x37be1d['params']['id']}})[_0xf374('0x43')](handleEntityNotFound(_0x2fd8a4,null))[_0xf374('0x43')](removeEntity(_0x2fd8a4,null))[_0xf374('0x49')](handleError(_0x2fd8a4,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b1555e4..17175e0 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 _0x88ec=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./template.attributes','define','Template','tools_templates'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x88ec,0x160));var _0xc88e=function(_0x2518d4,_0x3e189d){_0x2518d4=_0x2518d4-0x0;var _0xdb00bc=_0x88ec[_0x2518d4];return _0xdb00bc;};'use strict';var _=require(_0xc88e('0x0'));var util=require(_0xc88e('0x1'));var logger=require(_0xc88e('0x2'))('api');var moment=require(_0xc88e('0x3'));var BPromise=require(_0xc88e('0x4'));var rp=require(_0xc88e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc88e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc88e('0x7'));module['exports']=function(_0x2b4a0e,_0x5c9f54){return _0x2b4a0e[_0xc88e('0x8')](_0xc88e('0x9'),attributes,{'tableName':_0xc88e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6294=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x582be3,_0xbc36fc){var _0x322c06=function(_0x5af5b8){while(--_0x5af5b8){_0x582be3['push'](_0x582be3['shift']());}};_0x322c06(++_0xbc36fc);}(_0x6294,0xf4));var _0x4629=function(_0x344abf,_0x330b36){_0x344abf=_0x344abf-0x0;var _0x2c644f=_0x6294[_0x344abf];return _0x2c644f;};'use strict';var _=require(_0x4629('0x0'));var util=require('util');var logger=require(_0x4629('0x1'))(_0x4629('0x2'));var moment=require(_0x4629('0x3'));var BPromise=require(_0x4629('0x4'));var rp=require(_0x4629('0x5'));var fs=require('fs');var path=require(_0x4629('0x6'));var rimraf=require(_0x4629('0x7'));var config=require(_0x4629('0x8'));var attributes=require(_0x4629('0x9'));module[_0x4629('0xa')]=function(_0x31b330,_0x2c2ca3){return _0x31b330[_0x4629('0xb')](_0x4629('0xc'),attributes,{'tableName':_0x4629('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 7252fd9..4236858 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 _0x46a8=['http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','raw','options','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46a8,0x135));var _0x846a=function(_0x3dbeca,_0x11d0c6){_0x3dbeca=_0x3dbeca-0x0;var _0x94352c=_0x46a8[_0x3dbeca];return _0x94352c;};'use strict';var _=require(_0x846a('0x0'));var util=require(_0x846a('0x1'));var moment=require(_0x846a('0x2'));var BPromise=require(_0x846a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x846a('0x4'));var db=require(_0x846a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x846a('0x6'))(_0x846a('0x7'));var config=require(_0x846a('0x8'));var jayson=require(_0x846a('0x9'));var client=jayson[_0x846a('0xa')][_0x846a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x539560,_0x2cf245,_0x329c51){return new BPromise(function(_0x235035,_0x1cb6b4){return client[_0x846a('0xc')](_0x539560,_0x329c51)[_0x846a('0xd')](function(_0x142fbd){logger[_0x846a('0xe')]('Template,\x20%s,\x20%s',_0x2cf245,_0x846a('0xf'));logger[_0x846a('0x10')](_0x846a('0x11'),_0x2cf245,_0x846a('0xf'),JSON[_0x846a('0x12')](_0x142fbd));if(_0x142fbd[_0x846a('0x13')]){if(_0x142fbd[_0x846a('0x13')][_0x846a('0x14')]===0x1f4){logger[_0x846a('0x13')](_0x846a('0x15'),_0x2cf245,_0x142fbd[_0x846a('0x13')][_0x846a('0x16')]);return _0x1cb6b4(_0x142fbd['error'][_0x846a('0x16')]);}logger[_0x846a('0x13')](_0x846a('0x15'),_0x2cf245,_0x142fbd[_0x846a('0x13')]['message']);return _0x235035(_0x142fbd[_0x846a('0x13')][_0x846a('0x16')]);}else{logger[_0x846a('0xe')](_0x846a('0x15'),_0x2cf245,_0x846a('0xf'));_0x235035(_0x142fbd[_0x846a('0x17')][_0x846a('0x16')]);}})[_0x846a('0x18')](function(_0x1c48f3){logger['error'](_0x846a('0x15'),_0x2cf245,_0x1c48f3);_0x1cb6b4(_0x1c48f3);});});}exports[_0x846a('0x19')]=function(_0x861b2e){var _0x1b4170=this;return new Promise(function(_0x3e68d4,_0x37864b){return db['Template']['findAll']({'raw':_0x861b2e['options']?_0x861b2e['options'][_0x846a('0x1a')]===undefined?!![]:![]:!![],'where':_0x861b2e[_0x846a('0x1b')]?_0x861b2e[_0x846a('0x1b')]['where']||null:null,'attributes':_0x861b2e[_0x846a('0x1b')]?_0x861b2e[_0x846a('0x1b')][_0x846a('0x1c')]||null:null,'limit':_0x861b2e[_0x846a('0x1b')]?_0x861b2e['options']['limit']||null:null,'include':_0x861b2e[_0x846a('0x1b')]?_0x861b2e['options'][_0x846a('0x1d')]?_[_0x846a('0x1e')](_0x861b2e[_0x846a('0x1b')]['include'],function(_0x2276ca){return{'model':db[_0x2276ca[_0x846a('0x1f')]],'as':_0x2276ca['as'],'attributes':_0x2276ca[_0x846a('0x1c')],'include':_0x2276ca[_0x846a('0x1d')]?_['map'](_0x2276ca['include'],function(_0x4372f2){return{'model':db[_0x4372f2[_0x846a('0x1f')]],'as':_0x4372f2['as'],'attributes':_0x4372f2['attributes'],'include':_0x4372f2[_0x846a('0x1d')]?_[_0x846a('0x1e')](_0x4372f2[_0x846a('0x1d')],function(_0x1ed14e){return{'model':db[_0x1ed14e[_0x846a('0x1f')]],'as':_0x1ed14e['as'],'attributes':_0x1ed14e[_0x846a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x846a('0xd')](function(_0x911efb){logger['info'](_0x846a('0x19'),_0x861b2e);logger[_0x846a('0x10')](_0x846a('0x19'),_0x861b2e,JSON[_0x846a('0x12')](_0x911efb));_0x3e68d4(_0x911efb);})['catch'](function(_0x3e945b){logger[_0x846a('0x13')](_0x846a('0x19'),_0x3e945b['message'],_0x861b2e);_0x37864b(_0x1b4170['error'](0x1f4,_0x3e945b['message']));});});}; \ No newline at end of file +var _0xb346=['GetTemplate','Template','options','raw','where','limit','include','map','model','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x387735,_0x92457f){var _0x5d9f80=function(_0x3932a2){while(--_0x3932a2){_0x387735['push'](_0x387735['shift']());}};_0x5d9f80(++_0x92457f);}(_0xb346,0x1b7));var _0x6b34=function(_0x560efe,_0x363f55){_0x560efe=_0x560efe-0x0;var _0x479c0e=_0xb346[_0x560efe];return _0x479c0e;};'use strict';var _=require('lodash');var util=require(_0x6b34('0x0'));var moment=require('moment');var BPromise=require(_0x6b34('0x1'));var rs=require(_0x6b34('0x2'));var fs=require('fs');var Redis=require(_0x6b34('0x3'));var db=require(_0x6b34('0x4'))['db'];var utils=require(_0x6b34('0x5'));var logger=require(_0x6b34('0x6'))(_0x6b34('0x7'));var config=require(_0x6b34('0x8'));var jayson=require(_0x6b34('0x9'));var client=jayson[_0x6b34('0xa')][_0x6b34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2532fc,_0x278aea,_0x2f6269){return new BPromise(function(_0x5c260b,_0x389733){return client['request'](_0x2532fc,_0x2f6269)[_0x6b34('0xc')](function(_0x44eae6){logger[_0x6b34('0xd')](_0x6b34('0xe'),_0x278aea,_0x6b34('0xf'));logger[_0x6b34('0x10')](_0x6b34('0x11'),_0x278aea,_0x6b34('0xf'),JSON[_0x6b34('0x12')](_0x44eae6));if(_0x44eae6[_0x6b34('0x13')]){if(_0x44eae6['error'][_0x6b34('0x14')]===0x1f4){logger[_0x6b34('0x13')](_0x6b34('0xe'),_0x278aea,_0x44eae6[_0x6b34('0x13')][_0x6b34('0x15')]);return _0x389733(_0x44eae6[_0x6b34('0x13')]['message']);}logger[_0x6b34('0x13')](_0x6b34('0xe'),_0x278aea,_0x44eae6['error'][_0x6b34('0x15')]);return _0x5c260b(_0x44eae6[_0x6b34('0x13')][_0x6b34('0x15')]);}else{logger[_0x6b34('0xd')](_0x6b34('0xe'),_0x278aea,_0x6b34('0xf'));_0x5c260b(_0x44eae6['result']['message']);}})[_0x6b34('0x16')](function(_0x203896){logger[_0x6b34('0x13')]('Template,\x20%s,\x20%s',_0x278aea,_0x203896);_0x389733(_0x203896);});});}exports[_0x6b34('0x17')]=function(_0x1d9b97){var _0x357471=this;return new Promise(function(_0x125a95,_0x25db84){return db[_0x6b34('0x18')]['findAll']({'raw':_0x1d9b97[_0x6b34('0x19')]?_0x1d9b97[_0x6b34('0x19')][_0x6b34('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d9b97['options']?_0x1d9b97[_0x6b34('0x19')][_0x6b34('0x1b')]||null:null,'attributes':_0x1d9b97['options']?_0x1d9b97[_0x6b34('0x19')]['attributes']||null:null,'limit':_0x1d9b97['options']?_0x1d9b97['options'][_0x6b34('0x1c')]||null:null,'include':_0x1d9b97[_0x6b34('0x19')]?_0x1d9b97[_0x6b34('0x19')][_0x6b34('0x1d')]?_[_0x6b34('0x1e')](_0x1d9b97[_0x6b34('0x19')]['include'],function(_0x142611){return{'model':db[_0x142611[_0x6b34('0x1f')]],'as':_0x142611['as'],'attributes':_0x142611[_0x6b34('0x20')],'include':_0x142611['include']?_[_0x6b34('0x1e')](_0x142611[_0x6b34('0x1d')],function(_0x3b6f1d){return{'model':db[_0x3b6f1d[_0x6b34('0x1f')]],'as':_0x3b6f1d['as'],'attributes':_0x3b6f1d[_0x6b34('0x20')],'include':_0x3b6f1d[_0x6b34('0x1d')]?_['map'](_0x3b6f1d['include'],function(_0x46e3eb){return{'model':db[_0x46e3eb[_0x6b34('0x1f')]],'as':_0x46e3eb['as'],'attributes':_0x46e3eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b34('0xc')](function(_0x5d791a){logger[_0x6b34('0xd')]('GetTemplate',_0x1d9b97);logger[_0x6b34('0x10')]('GetTemplate',_0x1d9b97,JSON['stringify'](_0x5d791a));_0x125a95(_0x5d791a);})[_0x6b34('0x16')](function(_0x58aad6){logger[_0x6b34('0x13')](_0x6b34('0x17'),_0x58aad6[_0x6b34('0x15')],_0x1d9b97);_0x25db84(_0x357471[_0x6b34('0x13')](0x1f4,_0x58aad6['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index bbd5e7e..5cc8551 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 _0x8265=['get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x8265,0xa0));var _0x5826=function(_0x2ee21f,_0x1fb11f){_0x2ee21f=_0x2ee21f-0x0;var _0x14161a=_0x8265[_0x2ee21f];return _0x14161a;};'use strict';var multer=require(_0x5826('0x0'));var util=require(_0x5826('0x1'));var path=require(_0x5826('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5826('0x3')]();var fs_extra=require(_0x5826('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5826('0x5'));var config=require(_0x5826('0x6'));var controller=require(_0x5826('0x7'));router[_0x5826('0x8')]('/',auth[_0x5826('0x9')](),controller['index']);router[_0x5826('0x8')](_0x5826('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5826('0xb'),auth[_0x5826('0x9')](),controller[_0x5826('0xc')]);router['get']('/:id/any_conditions',auth[_0x5826('0x9')](),controller['getAnyConditions']);router['get'](_0x5826('0xd'),auth[_0x5826('0x9')](),controller[_0x5826('0xe')]);router[_0x5826('0xf')]('/',auth[_0x5826('0x9')](),controller[_0x5826('0x10')]);router[_0x5826('0xf')](_0x5826('0xb'),auth[_0x5826('0x9')](),controller[_0x5826('0x11')]);router[_0x5826('0xf')](_0x5826('0x12'),auth[_0x5826('0x9')](),controller[_0x5826('0x13')]);router['post'](_0x5826('0xd'),auth[_0x5826('0x9')](),controller['addAction']);router[_0x5826('0x14')](_0x5826('0xa'),auth[_0x5826('0x9')](),controller['update']);router[_0x5826('0x15')](_0x5826('0xa'),auth[_0x5826('0x9')](),controller[_0x5826('0x16')]);module[_0x5826('0x17')]=router; \ No newline at end of file +var _0xb975=['./trigger.controller','isAuthenticated','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','put','update','destroy','exports','multer','util','path','express','../../config/environment'];(function(_0x34c2d4,_0x418ed2){var _0x38796a=function(_0xf017c5){while(--_0xf017c5){_0x34c2d4['push'](_0x34c2d4['shift']());}};_0x38796a(++_0x418ed2);}(_0xb975,0x199));var _0x5b97=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xb975[_0x273dc5];return _0x46dae7;};'use strict';var multer=require(_0x5b97('0x0'));var util=require(_0x5b97('0x1'));var path=require(_0x5b97('0x2'));var timeout=require('connect-timeout');var express=require(_0x5b97('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b97('0x4'));var controller=require(_0x5b97('0x5'));router['get']('/',auth[_0x5b97('0x6')](),controller['index']);router[_0x5b97('0x7')](_0x5b97('0x8'),auth[_0x5b97('0x6')](),controller[_0x5b97('0x9')]);router[_0x5b97('0x7')](_0x5b97('0xa'),auth['isAuthenticated'](),controller[_0x5b97('0xb')]);router[_0x5b97('0x7')](_0x5b97('0xc'),auth[_0x5b97('0x6')](),controller[_0x5b97('0xd')]);router[_0x5b97('0x7')](_0x5b97('0xe'),auth[_0x5b97('0x6')](),controller[_0x5b97('0xf')]);router[_0x5b97('0x10')]('/',auth[_0x5b97('0x6')](),controller['create']);router[_0x5b97('0x10')](_0x5b97('0xa'),auth['isAuthenticated'](),controller[_0x5b97('0x11')]);router[_0x5b97('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x5b97('0x12')]);router[_0x5b97('0x10')](_0x5b97('0xe'),auth[_0x5b97('0x6')](),controller['addAction']);router[_0x5b97('0x13')](_0x5b97('0x8'),auth[_0x5b97('0x6')](),controller[_0x5b97('0x14')]);router['delete']('/:id',auth[_0x5b97('0x6')](),controller[_0x5b97('0x15')]);module[_0x5b97('0x16')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 9cb2539..0406c1b 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 _0xc45b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x14b767,_0x577e84){var _0x22267a=function(_0xa87ebc){while(--_0xa87ebc){_0x14b767['push'](_0x14b767['shift']());}};_0x22267a(++_0x577e84);}(_0xc45b,0x169));var _0xbc45=function(_0x37f492,_0x337b42){_0x37f492=_0x37f492-0x0;var _0x469e0e=_0xc45b[_0x37f492];return _0x469e0e;};'use strict';var Sequelize=require(_0xbc45('0x0'));module[_0xbc45('0x1')]={'name':{'type':Sequelize[_0xbc45('0x2')]},'channel':{'type':Sequelize[_0xbc45('0x2')]},'description':{'type':Sequelize[_0xbc45('0x2')]},'status':{'type':Sequelize[_0xbc45('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xacbd=['sequelize','STRING','BOOLEAN'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xacbd,0x8a));var _0xdacb=function(_0x207e53,_0x295abc){_0x207e53=_0x207e53-0x0;var _0x4e6c3a=_0xacbd[_0x207e53];return _0x4e6c3a;};'use strict';var Sequelize=require(_0xdacb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdacb('0x1')]},'channel':{'type':Sequelize[_0xdacb('0x1')]},'description':{'type':Sequelize[_0xdacb('0x1')]},'status':{'type':Sequelize[_0xdacb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6b62766..f2f554e 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 _0xbb9f=['Action','getActions','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','offset','set','json','apply','reject','save','update','then','get','Triggers','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','hasOwnProperty','nolimit','getAnyConditions','addAction'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xbb9f,0xc2));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfbb9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfbb9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbb9('0x2'));var BPromise=require(_0xfbb9('0x3'));var Mustache=require('mustache');var util=require(_0xfbb9('0x4'));var path=require('path');var sox=require(_0xfbb9('0x5'));var csv=require(_0xfbb9('0x6'));var ejs=require(_0xfbb9('0x7'));var fs=require('fs');var fs_extra=require(_0xfbb9('0x8'));var _=require(_0xfbb9('0x9'));var squel=require(_0xfbb9('0xa'));var crypto=require(_0xfbb9('0xb'));var jsforce=require(_0xfbb9('0xc'));var deskjs=require(_0xfbb9('0xd'));var toCsv=require(_0xfbb9('0x6'));var querystring=require(_0xfbb9('0xe'));var Papa=require(_0xfbb9('0xf'));var Redis=require(_0xfbb9('0x10'));var authService=require(_0xfbb9('0x11'));var qs=require(_0xfbb9('0x12'));var as=require(_0xfbb9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbb9('0x14'))(_0xfbb9('0x15'));var utils=require(_0xfbb9('0x16'));var config=require(_0xfbb9('0x17'));var licenseUtil=require(_0xfbb9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xebec91,_0x124ee1){_0x124ee1=_0x124ee1||0xcc;return function(_0x4beb14){if(_0x4beb14){return _0xebec91[_0xfbb9('0x19')](_0x124ee1);}return _0xebec91['status'](_0x124ee1)[_0xfbb9('0x1a')]();};}function respondWithResult(_0x41521b,_0x33b59){_0x33b59=_0x33b59||0xc8;return function(_0x5f519f){if(_0x5f519f){return _0x41521b[_0xfbb9('0x1b')](_0x33b59)['json'](_0x5f519f);}};}function respondWithFilteredResult(_0x1cb051,_0x502e69){return function(_0x39849c){if(_0x39849c){var _0x31e763=typeof _0x502e69['offset']===_0xfbb9('0x1c')&&typeof _0x502e69[_0xfbb9('0x1d')]===_0xfbb9('0x1c');var _0x2e582d=_0x39849c['count'];var _0x3f9624=_0x31e763?0x0:_0x502e69[_0xfbb9('0x1e')];var _0x52a5ba=_0x31e763?_0x39849c['count']:_0x502e69[_0xfbb9('0x1e')]+_0x502e69['limit'];var _0x4e78dd;if(_0x52a5ba>=_0x2e582d){_0x52a5ba=_0x2e582d;_0x4e78dd=0xc8;}else{_0x4e78dd=0xce;}_0x1cb051[_0xfbb9('0x1b')](_0x4e78dd);return _0x1cb051[_0xfbb9('0x1f')]('Content-Range',_0x3f9624+'-'+_0x52a5ba+'/'+_0x2e582d)[_0xfbb9('0x20')](_0x39849c);}return null;};}function patchUpdates(_0x17d8fc){return function(_0x2a2315){try{jsonpatch[_0xfbb9('0x21')](_0x2a2315,_0x17d8fc,!![]);}catch(_0x17541d){return BPromise[_0xfbb9('0x22')](_0x17541d);}return _0x2a2315[_0xfbb9('0x23')]();};}function saveUpdates(_0x572c50,_0x4a1dd1){return function(_0x5000f6){if(_0x5000f6){return _0x5000f6[_0xfbb9('0x24')](_0x572c50)[_0xfbb9('0x25')](function(_0xe7f6d0){return _0xe7f6d0;});}return null;};}function removeEntity(_0x191890,_0x59f652){return function(_0x42eb79){if(_0x42eb79){return _0x42eb79['destroy']()['then'](function(){var _0x420b96=_0x42eb79[_0xfbb9('0x26')]({'plain':!![]});var _0x17c501=_0xfbb9('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x17c501,'resourceId':_0x420b96['id']}})[_0xfbb9('0x25')](function(){return _0x42eb79;});})[_0xfbb9('0x25')](function(){_0x191890[_0xfbb9('0x1b')](0xcc)[_0xfbb9('0x1a')]();});}};}function handleEntityNotFound(_0x542f82,_0x5dfd72){return function(_0x10f783){if(!_0x10f783){_0x542f82[_0xfbb9('0x19')](0x194);}return _0x10f783;};}function handleError(_0x5e9ab6,_0x152895){_0x152895=_0x152895||0x1f4;return function(_0x415a45){logger['error'](_0x415a45['stack']);if(_0x415a45[_0xfbb9('0x28')]){delete _0x415a45[_0xfbb9('0x28')];}_0x5e9ab6[_0xfbb9('0x1b')](_0x152895)[_0xfbb9('0x29')](_0x415a45);};}exports[_0xfbb9('0x2a')]=function(_0x521523,_0xec4b16){var _0x5a5642={},_0x7b45c5={},_0x4d0603={'count':0x0,'rows':[]};var _0x1c31f7=_[_0xfbb9('0x2b')](db[_0xfbb9('0x2c')][_0xfbb9('0x2d')],function(_0x33f1a2){return{'name':_0x33f1a2[_0xfbb9('0x2e')],'type':_0x33f1a2[_0xfbb9('0x2f')][_0xfbb9('0x30')]};});_0x7b45c5[_0xfbb9('0x31')]=_[_0xfbb9('0x2b')](_0x1c31f7,'name');_0x7b45c5[_0xfbb9('0x32')]=_[_0xfbb9('0x33')](_0x521523[_0xfbb9('0x32')]);_0x7b45c5[_0xfbb9('0x34')]=_[_0xfbb9('0x35')](_0x7b45c5[_0xfbb9('0x31')],_0x7b45c5[_0xfbb9('0x32')]);_0x5a5642[_0xfbb9('0x36')]=_[_0xfbb9('0x35')](_0x7b45c5['model'],qs['fields'](_0x521523[_0xfbb9('0x32')]['fields']));_0x5a5642['attributes']=_0x5a5642[_0xfbb9('0x36')][_0xfbb9('0x37')]?_0x5a5642[_0xfbb9('0x36')]:_0x7b45c5[_0xfbb9('0x31')];if(!_0x521523[_0xfbb9('0x32')]['hasOwnProperty']('nolimit')){_0x5a5642['limit']=qs['limit'](_0x521523[_0xfbb9('0x32')]['limit']);_0x5a5642[_0xfbb9('0x1e')]=qs[_0xfbb9('0x1e')](_0x521523[_0xfbb9('0x32')]['offset']);}_0x5a5642[_0xfbb9('0x38')]=qs[_0xfbb9('0x39')](_0x521523[_0xfbb9('0x32')][_0xfbb9('0x39')]);_0x5a5642['where']=qs[_0xfbb9('0x34')](_[_0xfbb9('0x3a')](_0x521523['query'],_0x7b45c5['filters']),_0x1c31f7);if(_0x521523[_0xfbb9('0x32')][_0xfbb9('0x3b')]){_0x5a5642[_0xfbb9('0x3c')]=_[_0xfbb9('0x3d')](_0x5a5642[_0xfbb9('0x3c')],{'$or':_[_0xfbb9('0x2b')](_0x1c31f7,function(_0x1e51f2){if(_0x1e51f2[_0xfbb9('0x2f')]!==_0xfbb9('0x3e')){var _0x1168a2={};_0x1168a2[_0x1e51f2[_0xfbb9('0x28')]]={'$like':'%'+_0x521523[_0xfbb9('0x32')]['filter']+'%'};return _0x1168a2;}})});}_0x5a5642=_[_0xfbb9('0x3d')]({},_0x5a5642,_0x521523[_0xfbb9('0x3f')]);var _0x19b769={'where':_0x5a5642[_0xfbb9('0x3c')]};return db[_0xfbb9('0x2c')][_0xfbb9('0x40')](_0x19b769)[_0xfbb9('0x25')](function(_0x467460){_0x4d0603['count']=_0x467460;if(_0x521523['query'][_0xfbb9('0x41')]){_0x5a5642[_0xfbb9('0x42')]=[{'all':!![]}];}return db[_0xfbb9('0x2c')]['findAll'](_0x5a5642);})[_0xfbb9('0x25')](function(_0x1c2403){_0x4d0603[_0xfbb9('0x43')]=_0x1c2403;return _0x4d0603;})[_0xfbb9('0x25')](respondWithFilteredResult(_0xec4b16,_0x5a5642))[_0xfbb9('0x44')](handleError(_0xec4b16,null));};exports[_0xfbb9('0x45')]=function(_0x1a121d,_0x109f7d){var _0x5113b8={'raw':![],'where':{'id':_0x1a121d[_0xfbb9('0x46')]['id']}},_0x3c1c0b={};_0x3c1c0b[_0xfbb9('0x31')]=_[_0xfbb9('0x33')](db[_0xfbb9('0x2c')]['rawAttributes']);_0x3c1c0b[_0xfbb9('0x32')]=_[_0xfbb9('0x33')](_0x1a121d[_0xfbb9('0x32')]);_0x3c1c0b[_0xfbb9('0x34')]=_[_0xfbb9('0x35')](_0x3c1c0b[_0xfbb9('0x31')],_0x3c1c0b['query']);_0x5113b8[_0xfbb9('0x36')]=_['intersection'](_0x3c1c0b[_0xfbb9('0x31')],qs[_0xfbb9('0x47')](_0x1a121d['query'][_0xfbb9('0x47')]));_0x5113b8['attributes']=_0x5113b8[_0xfbb9('0x36')][_0xfbb9('0x37')]?_0x5113b8[_0xfbb9('0x36')]:_0x3c1c0b[_0xfbb9('0x31')];if(_0x1a121d[_0xfbb9('0x32')]['includeAll']){_0x5113b8[_0xfbb9('0x42')]=[{'all':!![]}];}_0x5113b8=_[_0xfbb9('0x3d')]({},_0x5113b8,_0x1a121d['options']);return db[_0xfbb9('0x2c')][_0xfbb9('0x48')](_0x5113b8)[_0xfbb9('0x25')](handleEntityNotFound(_0x109f7d,null))[_0xfbb9('0x25')](respondWithResult(_0x109f7d,null))[_0xfbb9('0x44')](handleError(_0x109f7d,null));};exports[_0xfbb9('0x49')]=function(_0x1f1823,_0x5ceea1){return db[_0xfbb9('0x2c')]['create'](_0x1f1823[_0xfbb9('0x4a')],{})[_0xfbb9('0x25')](function(_0x2cd20a){var _0xffa7f9=_0x1f1823[_0xfbb9('0x4b')][_0xfbb9('0x26')]({'plain':!![]});if(!_0xffa7f9)throw new Error(_0xfbb9('0x4c'));if(_0xffa7f9[_0xfbb9('0x4d')]==='user'){var _0x2a2b12=_0x2cd20a[_0xfbb9('0x26')]({'plain':!![]});var _0x1a6770=_0xfbb9('0x27');return db[_0xfbb9('0x4e')][_0xfbb9('0x48')]({'where':{'name':_0x1a6770,'userProfileId':_0xffa7f9['userProfileId']},'raw':!![]})[_0xfbb9('0x25')](function(_0x5aa669){if(_0x5aa669&&_0x5aa669[_0xfbb9('0x4f')]===0x0){return db[_0xfbb9('0x50')][_0xfbb9('0x49')]({'name':_0x2a2b12['name'],'resourceId':_0x2a2b12['id'],'type':_0x5aa669[_0xfbb9('0x28')],'sectionId':_0x5aa669['id']},{})[_0xfbb9('0x25')](function(){return _0x2cd20a;});}else{return _0x2cd20a;}})[_0xfbb9('0x44')](function(_0x3f1e7f){logger[_0xfbb9('0x51')](_0xfbb9('0x52'),_0x3f1e7f);throw _0x3f1e7f;});}return _0x2cd20a;})[_0xfbb9('0x25')](respondWithResult(_0x5ceea1,0xc9))[_0xfbb9('0x44')](handleError(_0x5ceea1,null));};exports[_0xfbb9('0x24')]=function(_0x2a6e4c,_0xff1b60){if(_0x2a6e4c[_0xfbb9('0x4a')]['id']){delete _0x2a6e4c[_0xfbb9('0x4a')]['id'];}return db[_0xfbb9('0x2c')][_0xfbb9('0x48')]({'where':{'id':_0x2a6e4c[_0xfbb9('0x46')]['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0xff1b60,null))[_0xfbb9('0x25')](saveUpdates(_0x2a6e4c[_0xfbb9('0x4a')],null))['then'](respondWithResult(_0xff1b60,null))[_0xfbb9('0x44')](handleError(_0xff1b60,null));};exports[_0xfbb9('0x53')]=function(_0x48414d,_0x1376cb){return db[_0xfbb9('0x2c')][_0xfbb9('0x48')]({'where':{'id':_0x48414d['params']['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0x1376cb,null))['then'](removeEntity(_0x1376cb,null))['catch'](handleError(_0x1376cb,null));};exports[_0xfbb9('0x54')]=function(_0xf67bd9,_0xa3ad7a,_0x30cf09){if(_0xf67bd9[_0xfbb9('0x4a')]['id']){delete _0xf67bd9[_0xfbb9('0x4a')]['id'];}return db[_0xfbb9('0x2c')]['find']({'where':{'id':_0xf67bd9[_0xfbb9('0x46')]['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0xa3ad7a,null))[_0xfbb9('0x25')](function(_0x2cd3c7){if(_0x2cd3c7){_0xf67bd9['body'][_0xfbb9('0x55')]=_0x2cd3c7['id'];return db[_0xfbb9('0x56')][_0xfbb9('0x49')](_0xf67bd9[_0xfbb9('0x4a')]);}})[_0xfbb9('0x25')](respondWithResult(_0xa3ad7a,null))['catch'](handleError(_0xa3ad7a,null));};exports[_0xfbb9('0x57')]=function(_0x4f5030,_0x15ce36,_0x27ddb7){if(_0x4f5030[_0xfbb9('0x4a')]['id']){delete _0x4f5030[_0xfbb9('0x4a')]['id'];}return db[_0xfbb9('0x2c')][_0xfbb9('0x48')]({'where':{'id':_0x4f5030['params']['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0x15ce36,null))[_0xfbb9('0x25')](function(_0x1f7756){if(_0x1f7756){_0x4f5030[_0xfbb9('0x4a')]['TriggerAnyId']=_0x1f7756['id'];return db[_0xfbb9('0x56')][_0xfbb9('0x49')](_0x4f5030[_0xfbb9('0x4a')]);}})['then'](respondWithResult(_0x15ce36,null))[_0xfbb9('0x44')](handleError(_0x15ce36,null));};exports[_0xfbb9('0x58')]=function(_0x2be222,_0x2cddb5,_0x478cea){var _0x459db6={};var _0x470cdb={};var _0x129662;var _0x4ab6c1;return db['Trigger'][_0xfbb9('0x59')]({'where':{'id':_0x2be222['params']['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0x2cddb5,null))[_0xfbb9('0x25')](function(_0x50c2a7){if(_0x50c2a7){_0x129662=_0x50c2a7;_0x470cdb[_0xfbb9('0x31')]=_[_0xfbb9('0x33')](db[_0xfbb9('0x56')][_0xfbb9('0x2d')]);_0x470cdb[_0xfbb9('0x32')]=_[_0xfbb9('0x33')](_0x2be222['query']);_0x470cdb['filters']=_[_0xfbb9('0x35')](_0x470cdb['model'],_0x470cdb[_0xfbb9('0x32')]);_0x459db6[_0xfbb9('0x36')]=_[_0xfbb9('0x35')](_0x470cdb[_0xfbb9('0x31')],qs['fields'](_0x2be222[_0xfbb9('0x32')][_0xfbb9('0x47')]));_0x459db6[_0xfbb9('0x36')]=_0x459db6['attributes'][_0xfbb9('0x37')]?_0x459db6[_0xfbb9('0x36')]:_0x470cdb[_0xfbb9('0x31')];_0x459db6[_0xfbb9('0x38')]=qs[_0xfbb9('0x39')](_0x2be222['query']['sort']);_0x459db6[_0xfbb9('0x3c')]=qs['filters'](_['pick'](_0x2be222[_0xfbb9('0x32')],_0x470cdb[_0xfbb9('0x34')]));if(_0x2be222[_0xfbb9('0x32')][_0xfbb9('0x3b')]){_0x459db6[_0xfbb9('0x3c')]=_[_0xfbb9('0x3d')](_0x459db6[_0xfbb9('0x3c')],{'$or':_[_0xfbb9('0x2b')](_0x459db6[_0xfbb9('0x36')],function(_0x3e839f){var _0x1dc5dd={};_0x1dc5dd[_0x3e839f]={'$like':'%'+_0x2be222[_0xfbb9('0x32')][_0xfbb9('0x3b')]+'%'};return _0x1dc5dd;})});}_0x459db6=_[_0xfbb9('0x3d')]({},_0x459db6,_0x2be222[_0xfbb9('0x3f')]);return _0x129662[_0xfbb9('0x58')](_0x459db6);}})[_0xfbb9('0x25')](function(_0x2d252a){if(_0x2d252a){_0x4ab6c1=_0x2d252a[_0xfbb9('0x37')];if(!_0x2be222[_0xfbb9('0x32')][_0xfbb9('0x5a')](_0xfbb9('0x5b'))){_0x459db6[_0xfbb9('0x1d')]=qs[_0xfbb9('0x1d')](_0x2be222['query'][_0xfbb9('0x1d')]);_0x459db6[_0xfbb9('0x1e')]=qs['offset'](_0x2be222['query'][_0xfbb9('0x1e')]);}return _0x129662[_0xfbb9('0x58')](_0x459db6);}})['then'](function(_0x5691f6){if(_0x5691f6){return _0x5691f6?{'count':_0x4ab6c1,'rows':_0x5691f6}:null;}})[_0xfbb9('0x25')](respondWithResult(_0x2cddb5,null))[_0xfbb9('0x44')](handleError(_0x2cddb5,null));};exports['getAnyConditions']=function(_0x5b8793,_0x24cda2,_0x11c290){var _0x190665={};var _0x2d5b08={};var _0x36bd4b;var _0x21c795;return db[_0xfbb9('0x2c')][_0xfbb9('0x59')]({'where':{'id':_0x5b8793['params']['id']}})['then'](handleEntityNotFound(_0x24cda2,null))[_0xfbb9('0x25')](function(_0x460f73){if(_0x460f73){_0x36bd4b=_0x460f73;_0x2d5b08[_0xfbb9('0x31')]=_[_0xfbb9('0x33')](db[_0xfbb9('0x56')]['rawAttributes']);_0x2d5b08[_0xfbb9('0x32')]=_[_0xfbb9('0x33')](_0x5b8793[_0xfbb9('0x32')]);_0x2d5b08[_0xfbb9('0x34')]=_['intersection'](_0x2d5b08[_0xfbb9('0x31')],_0x2d5b08['query']);_0x190665[_0xfbb9('0x36')]=_[_0xfbb9('0x35')](_0x2d5b08['model'],qs[_0xfbb9('0x47')](_0x5b8793[_0xfbb9('0x32')][_0xfbb9('0x47')]));_0x190665[_0xfbb9('0x36')]=_0x190665[_0xfbb9('0x36')][_0xfbb9('0x37')]?_0x190665['attributes']:_0x2d5b08[_0xfbb9('0x31')];_0x190665['order']=qs['sort'](_0x5b8793[_0xfbb9('0x32')]['sort']);_0x190665[_0xfbb9('0x3c')]=qs['filters'](_[_0xfbb9('0x3a')](_0x5b8793[_0xfbb9('0x32')],_0x2d5b08[_0xfbb9('0x34')]));if(_0x5b8793[_0xfbb9('0x32')][_0xfbb9('0x3b')]){_0x190665[_0xfbb9('0x3c')]=_['merge'](_0x190665[_0xfbb9('0x3c')],{'$or':_[_0xfbb9('0x2b')](_0x190665[_0xfbb9('0x36')],function(_0x1bfaf8){var _0x31d895={};_0x31d895[_0x1bfaf8]={'$like':'%'+_0x5b8793[_0xfbb9('0x32')]['filter']+'%'};return _0x31d895;})});}_0x190665=_[_0xfbb9('0x3d')]({},_0x190665,_0x5b8793[_0xfbb9('0x3f')]);return _0x36bd4b[_0xfbb9('0x5c')](_0x190665);}})[_0xfbb9('0x25')](function(_0x1c54da){if(_0x1c54da){_0x21c795=_0x1c54da['length'];if(!_0x5b8793['query'][_0xfbb9('0x5a')](_0xfbb9('0x5b'))){_0x190665[_0xfbb9('0x1d')]=qs[_0xfbb9('0x1d')](_0x5b8793[_0xfbb9('0x32')][_0xfbb9('0x1d')]);_0x190665[_0xfbb9('0x1e')]=qs['offset'](_0x5b8793[_0xfbb9('0x32')]['offset']);}return _0x36bd4b[_0xfbb9('0x5c')](_0x190665);}})[_0xfbb9('0x25')](function(_0x1ab98a){if(_0x1ab98a){return _0x1ab98a?{'count':_0x21c795,'rows':_0x1ab98a}:null;}})[_0xfbb9('0x25')](respondWithResult(_0x24cda2,null))[_0xfbb9('0x44')](handleError(_0x24cda2,null));};exports[_0xfbb9('0x5d')]=function(_0x396a9f,_0x289847,_0x325850){if(_0x396a9f[_0xfbb9('0x4a')]['id']){delete _0x396a9f[_0xfbb9('0x4a')]['id'];}return db[_0xfbb9('0x2c')][_0xfbb9('0x48')]({'where':{'id':_0x396a9f[_0xfbb9('0x46')]['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0x289847,null))[_0xfbb9('0x25')](function(_0x13ecfc){if(_0x13ecfc){_0x396a9f[_0xfbb9('0x4a')]['TriggerId']=_0x13ecfc['id'];return db[_0xfbb9('0x5e')][_0xfbb9('0x49')](_0x396a9f['body']);}})[_0xfbb9('0x25')](respondWithResult(_0x289847,null))[_0xfbb9('0x44')](handleError(_0x289847,null));};exports['getActions']=function(_0x29f9c8,_0x14ee3a,_0x3d2f5e){var _0x2d4f31={};var _0x29a40c={};var _0x110973;var _0x546f9c;return db[_0xfbb9('0x2c')][_0xfbb9('0x59')]({'where':{'id':_0x29f9c8[_0xfbb9('0x46')]['id']}})[_0xfbb9('0x25')](handleEntityNotFound(_0x14ee3a,null))[_0xfbb9('0x25')](function(_0x3f1ff3){if(_0x3f1ff3){_0x110973=_0x3f1ff3;_0x29a40c[_0xfbb9('0x31')]=_[_0xfbb9('0x33')](db[_0xfbb9('0x5e')][_0xfbb9('0x2d')]);_0x29a40c[_0xfbb9('0x32')]=_[_0xfbb9('0x33')](_0x29f9c8['query']);_0x29a40c[_0xfbb9('0x34')]=_[_0xfbb9('0x35')](_0x29a40c[_0xfbb9('0x31')],_0x29a40c['query']);_0x2d4f31[_0xfbb9('0x36')]=_[_0xfbb9('0x35')](_0x29a40c['model'],qs[_0xfbb9('0x47')](_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x47')]));_0x2d4f31['attributes']=_0x2d4f31[_0xfbb9('0x36')]['length']?_0x2d4f31['attributes']:_0x29a40c['model'];_0x2d4f31[_0xfbb9('0x38')]=qs[_0xfbb9('0x39')](_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x39')]);_0x2d4f31[_0xfbb9('0x3c')]=qs[_0xfbb9('0x34')](_[_0xfbb9('0x3a')](_0x29f9c8[_0xfbb9('0x32')],_0x29a40c['filters']));if(_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x3b')]){_0x2d4f31[_0xfbb9('0x3c')]=_['merge'](_0x2d4f31[_0xfbb9('0x3c')],{'$or':_[_0xfbb9('0x2b')](_0x2d4f31[_0xfbb9('0x36')],function(_0xb3ddcb){var _0x555be8={};_0x555be8[_0xb3ddcb]={'$like':'%'+_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x3b')]+'%'};return _0x555be8;})});}_0x2d4f31=_[_0xfbb9('0x3d')]({},_0x2d4f31,_0x29f9c8['options']);return _0x110973[_0xfbb9('0x5f')](_0x2d4f31);}})[_0xfbb9('0x25')](function(_0x2b63fe){if(_0x2b63fe){_0x546f9c=_0x2b63fe[_0xfbb9('0x37')];if(!_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x5a')]('nolimit')){_0x2d4f31[_0xfbb9('0x1d')]=qs[_0xfbb9('0x1d')](_0x29f9c8[_0xfbb9('0x32')]['limit']);_0x2d4f31[_0xfbb9('0x1e')]=qs[_0xfbb9('0x1e')](_0x29f9c8[_0xfbb9('0x32')][_0xfbb9('0x1e')]);}return _0x110973[_0xfbb9('0x5f')](_0x2d4f31);}})[_0xfbb9('0x25')](function(_0x4eccbf){if(_0x4eccbf){return _0x4eccbf?{'count':_0x546f9c,'rows':_0x4eccbf}:null;}})['then'](respondWithResult(_0x14ee3a,null))[_0xfbb9('0x44')](handleError(_0x14ee3a,null));}; \ No newline at end of file +var _0xb6b6=['../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','map','Trigger','rawAttributes','fieldName','key','query','filters','model','attributes','fields','nolimit','order','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','length','sort','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x12cc29,_0x3a50a7){var _0x287818=function(_0x55bdac){while(--_0x55bdac){_0x12cc29['push'](_0x12cc29['shift']());}};_0x287818(++_0x3a50a7);}(_0xb6b6,0x1b8));var _0x6b6b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb6b6[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b6b('0x1'));var rp=require(_0x6b6b('0x2'));var moment=require(_0x6b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6b6b('0x4'));var util=require(_0x6b6b('0x5'));var path=require('path');var sox=require(_0x6b6b('0x6'));var csv=require(_0x6b6b('0x7'));var ejs=require(_0x6b6b('0x8'));var fs=require('fs');var fs_extra=require(_0x6b6b('0x9'));var _=require(_0x6b6b('0xa'));var squel=require(_0x6b6b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b6b('0x7'));var querystring=require(_0x6b6b('0xc'));var Papa=require(_0x6b6b('0xd'));var Redis=require(_0x6b6b('0xe'));var authService=require(_0x6b6b('0xf'));var qs=require(_0x6b6b('0x10'));var as=require(_0x6b6b('0x11'));var hardwareService=require(_0x6b6b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6b6b('0x13'));var config=require(_0x6b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b6b('0x15'))['db'];function respondWithStatusCode(_0x4ca661,_0x434078){_0x434078=_0x434078||0xcc;return function(_0xc24a6){if(_0xc24a6){return _0x4ca661['sendStatus'](_0x434078);}return _0x4ca661[_0x6b6b('0x16')](_0x434078)[_0x6b6b('0x17')]();};}function respondWithResult(_0xd5e69e,_0x5339e0){_0x5339e0=_0x5339e0||0xc8;return function(_0x38c94a){if(_0x38c94a){return _0xd5e69e[_0x6b6b('0x16')](_0x5339e0)['json'](_0x38c94a);}};}function respondWithFilteredResult(_0x43bea9,_0x2fd8bc){return function(_0x28ed3a){if(_0x28ed3a){var _0x135a4e=typeof _0x2fd8bc[_0x6b6b('0x18')]==='undefined'&&typeof _0x2fd8bc[_0x6b6b('0x19')]===_0x6b6b('0x1a');var _0x2e315d=_0x28ed3a[_0x6b6b('0x1b')];var _0x1e50bd=_0x135a4e?0x0:_0x2fd8bc[_0x6b6b('0x18')];var _0x3fbe65=_0x135a4e?_0x28ed3a['count']:_0x2fd8bc[_0x6b6b('0x18')]+_0x2fd8bc[_0x6b6b('0x19')];var _0x3dbd2b;if(_0x3fbe65>=_0x2e315d){_0x3fbe65=_0x2e315d;_0x3dbd2b=0xc8;}else{_0x3dbd2b=0xce;}_0x43bea9['status'](_0x3dbd2b);return _0x43bea9['set'](_0x6b6b('0x1c'),_0x1e50bd+'-'+_0x3fbe65+'/'+_0x2e315d)[_0x6b6b('0x1d')](_0x28ed3a);}return null;};}function patchUpdates(_0x1e1d72){return function(_0x7d5a0){try{jsonpatch['apply'](_0x7d5a0,_0x1e1d72,!![]);}catch(_0x39eae0){return BPromise[_0x6b6b('0x1e')](_0x39eae0);}return _0x7d5a0[_0x6b6b('0x1f')]();};}function saveUpdates(_0x332258,_0xc766e5){return function(_0x427160){if(_0x427160){return _0x427160[_0x6b6b('0x20')](_0x332258)['then'](function(_0x5a67c5){return _0x5a67c5;});}return null;};}function removeEntity(_0x427341,_0x2bdce8){return function(_0x4f4014){if(_0x4f4014){return _0x4f4014[_0x6b6b('0x21')]()[_0x6b6b('0x22')](function(){var _0x3d85f8=_0x4f4014[_0x6b6b('0x23')]({'plain':!![]});var _0x29c8fb=_0x6b6b('0x24');return db[_0x6b6b('0x25')]['destroy']({'where':{'type':_0x29c8fb,'resourceId':_0x3d85f8['id']}})[_0x6b6b('0x22')](function(){return _0x4f4014;});})[_0x6b6b('0x22')](function(){_0x427341[_0x6b6b('0x16')](0xcc)[_0x6b6b('0x17')]();});}};}function handleEntityNotFound(_0x1009f4,_0x26def2){return function(_0x3b7809){if(!_0x3b7809){_0x1009f4['sendStatus'](0x194);}return _0x3b7809;};}function handleError(_0x5f569a,_0x4307a4){_0x4307a4=_0x4307a4||0x1f4;return function(_0x598b4a){logger[_0x6b6b('0x26')](_0x598b4a[_0x6b6b('0x27')]);if(_0x598b4a[_0x6b6b('0x28')]){delete _0x598b4a[_0x6b6b('0x28')];}_0x5f569a['status'](_0x4307a4)[_0x6b6b('0x29')](_0x598b4a);};}exports['index']=function(_0x28b5a1,_0x11de3e){var _0x563285={},_0x1cd26e={},_0x570426={'count':0x0,'rows':[]};var _0x1e72b2=_[_0x6b6b('0x2a')](db[_0x6b6b('0x2b')][_0x6b6b('0x2c')],function(_0x57ebb9){return{'name':_0x57ebb9[_0x6b6b('0x2d')],'type':_0x57ebb9['type'][_0x6b6b('0x2e')]};});_0x1cd26e['model']=_[_0x6b6b('0x2a')](_0x1e72b2,_0x6b6b('0x28'));_0x1cd26e['query']=_['keys'](_0x28b5a1[_0x6b6b('0x2f')]);_0x1cd26e[_0x6b6b('0x30')]=_['intersection'](_0x1cd26e[_0x6b6b('0x31')],_0x1cd26e[_0x6b6b('0x2f')]);_0x563285[_0x6b6b('0x32')]=_['intersection'](_0x1cd26e['model'],qs['fields'](_0x28b5a1['query'][_0x6b6b('0x33')]));_0x563285[_0x6b6b('0x32')]=_0x563285[_0x6b6b('0x32')]['length']?_0x563285[_0x6b6b('0x32')]:_0x1cd26e[_0x6b6b('0x31')];if(!_0x28b5a1[_0x6b6b('0x2f')]['hasOwnProperty'](_0x6b6b('0x34'))){_0x563285[_0x6b6b('0x19')]=qs[_0x6b6b('0x19')](_0x28b5a1[_0x6b6b('0x2f')][_0x6b6b('0x19')]);_0x563285['offset']=qs[_0x6b6b('0x18')](_0x28b5a1[_0x6b6b('0x2f')][_0x6b6b('0x18')]);}_0x563285[_0x6b6b('0x35')]=qs['sort'](_0x28b5a1['query']['sort']);_0x563285['where']=qs[_0x6b6b('0x30')](_[_0x6b6b('0x36')](_0x28b5a1['query'],_0x1cd26e[_0x6b6b('0x30')]),_0x1e72b2);if(_0x28b5a1[_0x6b6b('0x2f')][_0x6b6b('0x37')]){_0x563285[_0x6b6b('0x38')]=_[_0x6b6b('0x39')](_0x563285[_0x6b6b('0x38')],{'$or':_['map'](_0x1e72b2,function(_0x459552){if(_0x459552[_0x6b6b('0x3a')]!=='VIRTUAL'){var _0x55c9ff={};_0x55c9ff[_0x459552['name']]={'$like':'%'+_0x28b5a1[_0x6b6b('0x2f')][_0x6b6b('0x37')]+'%'};return _0x55c9ff;}})});}_0x563285=_[_0x6b6b('0x39')]({},_0x563285,_0x28b5a1[_0x6b6b('0x3b')]);var _0x570e24={'where':_0x563285[_0x6b6b('0x38')]};return db['Trigger'][_0x6b6b('0x1b')](_0x570e24)[_0x6b6b('0x22')](function(_0x3971fb){_0x570426[_0x6b6b('0x1b')]=_0x3971fb;if(_0x28b5a1[_0x6b6b('0x2f')][_0x6b6b('0x3c')]){_0x563285[_0x6b6b('0x3d')]=[{'all':!![]}];}return db[_0x6b6b('0x2b')][_0x6b6b('0x3e')](_0x563285);})[_0x6b6b('0x22')](function(_0x3b0763){_0x570426[_0x6b6b('0x3f')]=_0x3b0763;return _0x570426;})[_0x6b6b('0x22')](respondWithFilteredResult(_0x11de3e,_0x563285))[_0x6b6b('0x40')](handleError(_0x11de3e,null));};exports[_0x6b6b('0x41')]=function(_0xea453b,_0x546c8e){var _0x3faeae={'raw':![],'where':{'id':_0xea453b[_0x6b6b('0x42')]['id']}},_0x47de2e={};_0x47de2e[_0x6b6b('0x31')]=_[_0x6b6b('0x43')](db[_0x6b6b('0x2b')]['rawAttributes']);_0x47de2e[_0x6b6b('0x2f')]=_[_0x6b6b('0x43')](_0xea453b[_0x6b6b('0x2f')]);_0x47de2e[_0x6b6b('0x30')]=_[_0x6b6b('0x44')](_0x47de2e['model'],_0x47de2e[_0x6b6b('0x2f')]);_0x3faeae['attributes']=_[_0x6b6b('0x44')](_0x47de2e[_0x6b6b('0x31')],qs['fields'](_0xea453b[_0x6b6b('0x2f')][_0x6b6b('0x33')]));_0x3faeae[_0x6b6b('0x32')]=_0x3faeae['attributes']['length']?_0x3faeae[_0x6b6b('0x32')]:_0x47de2e[_0x6b6b('0x31')];if(_0xea453b[_0x6b6b('0x2f')][_0x6b6b('0x3c')]){_0x3faeae[_0x6b6b('0x3d')]=[{'all':!![]}];}_0x3faeae=_[_0x6b6b('0x39')]({},_0x3faeae,_0xea453b[_0x6b6b('0x3b')]);return db[_0x6b6b('0x2b')][_0x6b6b('0x45')](_0x3faeae)[_0x6b6b('0x22')](handleEntityNotFound(_0x546c8e,null))[_0x6b6b('0x22')](respondWithResult(_0x546c8e,null))['catch'](handleError(_0x546c8e,null));};exports[_0x6b6b('0x46')]=function(_0x1a0df3,_0x46e08c){return db[_0x6b6b('0x2b')][_0x6b6b('0x46')](_0x1a0df3[_0x6b6b('0x47')],{})[_0x6b6b('0x22')](function(_0x3ea177){var _0x23b80e=_0x1a0df3[_0x6b6b('0x48')][_0x6b6b('0x23')]({'plain':!![]});if(!_0x23b80e)throw new Error(_0x6b6b('0x49'));if(_0x23b80e[_0x6b6b('0x4a')]===_0x6b6b('0x48')){var _0x2a141e=_0x3ea177[_0x6b6b('0x23')]({'plain':!![]});var _0x406088=_0x6b6b('0x24');return db['UserProfileSection'][_0x6b6b('0x45')]({'where':{'name':_0x406088,'userProfileId':_0x23b80e[_0x6b6b('0x4b')]},'raw':!![]})[_0x6b6b('0x22')](function(_0x13e703){if(_0x13e703&&_0x13e703[_0x6b6b('0x4c')]===0x0){return db[_0x6b6b('0x25')][_0x6b6b('0x46')]({'name':_0x2a141e[_0x6b6b('0x28')],'resourceId':_0x2a141e['id'],'type':_0x13e703['name'],'sectionId':_0x13e703['id']},{})['then'](function(){return _0x3ea177;});}else{return _0x3ea177;}})['catch'](function(_0x100edb){logger['error'](_0x6b6b('0x4d'),_0x100edb);throw _0x100edb;});}return _0x3ea177;})[_0x6b6b('0x22')](respondWithResult(_0x46e08c,0xc9))[_0x6b6b('0x40')](handleError(_0x46e08c,null));};exports[_0x6b6b('0x20')]=function(_0x33f07b,_0x49fe17){if(_0x33f07b['body']['id']){delete _0x33f07b['body']['id'];}return db[_0x6b6b('0x2b')]['find']({'where':{'id':_0x33f07b[_0x6b6b('0x42')]['id']}})['then'](handleEntityNotFound(_0x49fe17,null))['then'](saveUpdates(_0x33f07b[_0x6b6b('0x47')],null))[_0x6b6b('0x22')](respondWithResult(_0x49fe17,null))[_0x6b6b('0x40')](handleError(_0x49fe17,null));};exports[_0x6b6b('0x21')]=function(_0x4a7cf9,_0x245d90){return db[_0x6b6b('0x2b')][_0x6b6b('0x45')]({'where':{'id':_0x4a7cf9[_0x6b6b('0x42')]['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x245d90,null))[_0x6b6b('0x22')](removeEntity(_0x245d90,null))['catch'](handleError(_0x245d90,null));};exports['addAllCondition']=function(_0x2b5e60,_0x2bab38,_0x1cf587){if(_0x2b5e60['body']['id']){delete _0x2b5e60[_0x6b6b('0x47')]['id'];}return db[_0x6b6b('0x2b')][_0x6b6b('0x45')]({'where':{'id':_0x2b5e60[_0x6b6b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2bab38,null))[_0x6b6b('0x22')](function(_0x48b936){if(_0x48b936){_0x2b5e60['body'][_0x6b6b('0x4e')]=_0x48b936['id'];return db[_0x6b6b('0x4f')][_0x6b6b('0x46')](_0x2b5e60['body']);}})[_0x6b6b('0x22')](respondWithResult(_0x2bab38,null))[_0x6b6b('0x40')](handleError(_0x2bab38,null));};exports[_0x6b6b('0x50')]=function(_0x4e4cda,_0x1f541d,_0xe18fe4){if(_0x4e4cda['body']['id']){delete _0x4e4cda[_0x6b6b('0x47')]['id'];}return db['Trigger'][_0x6b6b('0x45')]({'where':{'id':_0x4e4cda[_0x6b6b('0x42')]['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x1f541d,null))['then'](function(_0x276e8f){if(_0x276e8f){_0x4e4cda[_0x6b6b('0x47')][_0x6b6b('0x51')]=_0x276e8f['id'];return db[_0x6b6b('0x4f')][_0x6b6b('0x46')](_0x4e4cda[_0x6b6b('0x47')]);}})[_0x6b6b('0x22')](respondWithResult(_0x1f541d,null))['catch'](handleError(_0x1f541d,null));};exports[_0x6b6b('0x52')]=function(_0x15bd2d,_0x5edf08,_0xc2b2e4){var _0xd3c8c5={};var _0x1ea341={};var _0x17b3d6;var _0x52b2c4;return db[_0x6b6b('0x2b')][_0x6b6b('0x53')]({'where':{'id':_0x15bd2d[_0x6b6b('0x42')]['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x5edf08,null))[_0x6b6b('0x22')](function(_0x28fb19){if(_0x28fb19){_0x17b3d6=_0x28fb19;_0x1ea341[_0x6b6b('0x31')]=_[_0x6b6b('0x43')](db['Condition']['rawAttributes']);_0x1ea341['query']=_['keys'](_0x15bd2d['query']);_0x1ea341['filters']=_['intersection'](_0x1ea341[_0x6b6b('0x31')],_0x1ea341['query']);_0xd3c8c5['attributes']=_[_0x6b6b('0x44')](_0x1ea341[_0x6b6b('0x31')],qs['fields'](_0x15bd2d[_0x6b6b('0x2f')][_0x6b6b('0x33')]));_0xd3c8c5[_0x6b6b('0x32')]=_0xd3c8c5['attributes'][_0x6b6b('0x54')]?_0xd3c8c5['attributes']:_0x1ea341[_0x6b6b('0x31')];_0xd3c8c5[_0x6b6b('0x35')]=qs[_0x6b6b('0x55')](_0x15bd2d[_0x6b6b('0x2f')][_0x6b6b('0x55')]);_0xd3c8c5[_0x6b6b('0x38')]=qs[_0x6b6b('0x30')](_['pick'](_0x15bd2d[_0x6b6b('0x2f')],_0x1ea341[_0x6b6b('0x30')]));if(_0x15bd2d[_0x6b6b('0x2f')][_0x6b6b('0x37')]){_0xd3c8c5[_0x6b6b('0x38')]=_[_0x6b6b('0x39')](_0xd3c8c5['where'],{'$or':_[_0x6b6b('0x2a')](_0xd3c8c5['attributes'],function(_0x3c169e){var _0x10328b={};_0x10328b[_0x3c169e]={'$like':'%'+_0x15bd2d[_0x6b6b('0x2f')]['filter']+'%'};return _0x10328b;})});}_0xd3c8c5=_[_0x6b6b('0x39')]({},_0xd3c8c5,_0x15bd2d[_0x6b6b('0x3b')]);return _0x17b3d6['getAllConditions'](_0xd3c8c5);}})['then'](function(_0x2dd016){if(_0x2dd016){_0x52b2c4=_0x2dd016[_0x6b6b('0x54')];if(!_0x15bd2d[_0x6b6b('0x2f')][_0x6b6b('0x56')](_0x6b6b('0x34'))){_0xd3c8c5[_0x6b6b('0x19')]=qs[_0x6b6b('0x19')](_0x15bd2d[_0x6b6b('0x2f')][_0x6b6b('0x19')]);_0xd3c8c5[_0x6b6b('0x18')]=qs['offset'](_0x15bd2d['query'][_0x6b6b('0x18')]);}return _0x17b3d6[_0x6b6b('0x52')](_0xd3c8c5);}})[_0x6b6b('0x22')](function(_0x25021a){if(_0x25021a){return _0x25021a?{'count':_0x52b2c4,'rows':_0x25021a}:null;}})[_0x6b6b('0x22')](respondWithResult(_0x5edf08,null))[_0x6b6b('0x40')](handleError(_0x5edf08,null));};exports[_0x6b6b('0x57')]=function(_0x2e7752,_0x3342ba,_0x520503){var _0x4146b5={};var _0x46e4c4={};var _0x2d8e12;var _0x5b6372;return db[_0x6b6b('0x2b')][_0x6b6b('0x53')]({'where':{'id':_0x2e7752[_0x6b6b('0x42')]['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x3342ba,null))[_0x6b6b('0x22')](function(_0xc37108){if(_0xc37108){_0x2d8e12=_0xc37108;_0x46e4c4['model']=_[_0x6b6b('0x43')](db['Condition'][_0x6b6b('0x2c')]);_0x46e4c4[_0x6b6b('0x2f')]=_[_0x6b6b('0x43')](_0x2e7752[_0x6b6b('0x2f')]);_0x46e4c4[_0x6b6b('0x30')]=_[_0x6b6b('0x44')](_0x46e4c4['model'],_0x46e4c4[_0x6b6b('0x2f')]);_0x4146b5[_0x6b6b('0x32')]=_['intersection'](_0x46e4c4[_0x6b6b('0x31')],qs[_0x6b6b('0x33')](_0x2e7752[_0x6b6b('0x2f')]['fields']));_0x4146b5['attributes']=_0x4146b5[_0x6b6b('0x32')]['length']?_0x4146b5[_0x6b6b('0x32')]:_0x46e4c4[_0x6b6b('0x31')];_0x4146b5[_0x6b6b('0x35')]=qs[_0x6b6b('0x55')](_0x2e7752[_0x6b6b('0x2f')][_0x6b6b('0x55')]);_0x4146b5[_0x6b6b('0x38')]=qs[_0x6b6b('0x30')](_[_0x6b6b('0x36')](_0x2e7752[_0x6b6b('0x2f')],_0x46e4c4[_0x6b6b('0x30')]));if(_0x2e7752[_0x6b6b('0x2f')][_0x6b6b('0x37')]){_0x4146b5[_0x6b6b('0x38')]=_[_0x6b6b('0x39')](_0x4146b5[_0x6b6b('0x38')],{'$or':_[_0x6b6b('0x2a')](_0x4146b5[_0x6b6b('0x32')],function(_0x360b2a){var _0x422f89={};_0x422f89[_0x360b2a]={'$like':'%'+_0x2e7752['query'][_0x6b6b('0x37')]+'%'};return _0x422f89;})});}_0x4146b5=_['merge']({},_0x4146b5,_0x2e7752['options']);return _0x2d8e12[_0x6b6b('0x57')](_0x4146b5);}})[_0x6b6b('0x22')](function(_0x3156f2){if(_0x3156f2){_0x5b6372=_0x3156f2['length'];if(!_0x2e7752[_0x6b6b('0x2f')]['hasOwnProperty'](_0x6b6b('0x34'))){_0x4146b5[_0x6b6b('0x19')]=qs[_0x6b6b('0x19')](_0x2e7752[_0x6b6b('0x2f')]['limit']);_0x4146b5['offset']=qs[_0x6b6b('0x18')](_0x2e7752[_0x6b6b('0x2f')][_0x6b6b('0x18')]);}return _0x2d8e12[_0x6b6b('0x57')](_0x4146b5);}})['then'](function(_0x2a98c8){if(_0x2a98c8){return _0x2a98c8?{'count':_0x5b6372,'rows':_0x2a98c8}:null;}})['then'](respondWithResult(_0x3342ba,null))[_0x6b6b('0x40')](handleError(_0x3342ba,null));};exports[_0x6b6b('0x58')]=function(_0x3b29e8,_0x59a6c1,_0x5bcd7d){if(_0x3b29e8['body']['id']){delete _0x3b29e8['body']['id'];}return db[_0x6b6b('0x2b')][_0x6b6b('0x45')]({'where':{'id':_0x3b29e8['params']['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x59a6c1,null))['then'](function(_0x261078){if(_0x261078){_0x3b29e8[_0x6b6b('0x47')][_0x6b6b('0x59')]=_0x261078['id'];return db[_0x6b6b('0x5a')][_0x6b6b('0x46')](_0x3b29e8[_0x6b6b('0x47')]);}})['then'](respondWithResult(_0x59a6c1,null))[_0x6b6b('0x40')](handleError(_0x59a6c1,null));};exports['getActions']=function(_0x21ff4f,_0x41d666,_0x2da3fd){var _0x549245={};var _0x53df19={};var _0x2e8b7d;var _0x1d2abf;return db['Trigger'][_0x6b6b('0x53')]({'where':{'id':_0x21ff4f[_0x6b6b('0x42')]['id']}})[_0x6b6b('0x22')](handleEntityNotFound(_0x41d666,null))[_0x6b6b('0x22')](function(_0x1975b9){if(_0x1975b9){_0x2e8b7d=_0x1975b9;_0x53df19[_0x6b6b('0x31')]=_[_0x6b6b('0x43')](db[_0x6b6b('0x5a')][_0x6b6b('0x2c')]);_0x53df19[_0x6b6b('0x2f')]=_['keys'](_0x21ff4f[_0x6b6b('0x2f')]);_0x53df19['filters']=_['intersection'](_0x53df19[_0x6b6b('0x31')],_0x53df19[_0x6b6b('0x2f')]);_0x549245[_0x6b6b('0x32')]=_['intersection'](_0x53df19[_0x6b6b('0x31')],qs[_0x6b6b('0x33')](_0x21ff4f['query'][_0x6b6b('0x33')]));_0x549245['attributes']=_0x549245[_0x6b6b('0x32')][_0x6b6b('0x54')]?_0x549245[_0x6b6b('0x32')]:_0x53df19['model'];_0x549245[_0x6b6b('0x35')]=qs[_0x6b6b('0x55')](_0x21ff4f[_0x6b6b('0x2f')][_0x6b6b('0x55')]);_0x549245['where']=qs[_0x6b6b('0x30')](_[_0x6b6b('0x36')](_0x21ff4f['query'],_0x53df19[_0x6b6b('0x30')]));if(_0x21ff4f[_0x6b6b('0x2f')][_0x6b6b('0x37')]){_0x549245['where']=_[_0x6b6b('0x39')](_0x549245[_0x6b6b('0x38')],{'$or':_[_0x6b6b('0x2a')](_0x549245[_0x6b6b('0x32')],function(_0x468a06){var _0x4648dc={};_0x4648dc[_0x468a06]={'$like':'%'+_0x21ff4f[_0x6b6b('0x2f')][_0x6b6b('0x37')]+'%'};return _0x4648dc;})});}_0x549245=_[_0x6b6b('0x39')]({},_0x549245,_0x21ff4f[_0x6b6b('0x3b')]);return _0x2e8b7d[_0x6b6b('0x5b')](_0x549245);}})[_0x6b6b('0x22')](function(_0x5bf578){if(_0x5bf578){_0x1d2abf=_0x5bf578['length'];if(!_0x21ff4f[_0x6b6b('0x2f')]['hasOwnProperty'](_0x6b6b('0x34'))){_0x549245['limit']=qs[_0x6b6b('0x19')](_0x21ff4f[_0x6b6b('0x2f')]['limit']);_0x549245[_0x6b6b('0x18')]=qs[_0x6b6b('0x18')](_0x21ff4f[_0x6b6b('0x2f')][_0x6b6b('0x18')]);}return _0x2e8b7d['getActions'](_0x549245);}})['then'](function(_0x10eed1){if(_0x10eed1){return _0x10eed1?{'count':_0x1d2abf,'rows':_0x10eed1}:null;}})['then'](respondWithResult(_0x41d666,null))[_0x6b6b('0x40')](handleError(_0x41d666,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index dc47e39..9485817 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 _0xaab2=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xaab2,0xca));var _0x2aab=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xaab2[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var logger=require(_0x2aab('0x1'))(_0x2aab('0x2'));var moment=require('moment');var BPromise=require(_0x2aab('0x3'));var rp=require(_0x2aab('0x4'));var fs=require('fs');var path=require(_0x2aab('0x5'));var rimraf=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var attributes=require('./trigger.attributes');module[_0x2aab('0x8')]=function(_0x5b35ec,_0x3af395){return _0x5b35ec[_0x2aab('0x9')](_0x2aab('0xa'),attributes,{'tableName':_0x2aab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd50=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','Trigger','tools_triggers','lodash'];(function(_0xf64e5,_0x4a3232){var _0x5f312c=function(_0x4d816c){while(--_0x4d816c){_0xf64e5['push'](_0xf64e5['shift']());}};_0x5f312c(++_0x4a3232);}(_0xbd50,0x196));var _0x0bd5=function(_0xa16640,_0x25fc45){_0xa16640=_0xa16640-0x0;var _0x34172f=_0xbd50[_0xa16640];return _0x34172f;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var logger=require(_0x0bd5('0x2'))('api');var moment=require(_0x0bd5('0x3'));var BPromise=require(_0x0bd5('0x4'));var rp=require(_0x0bd5('0x5'));var fs=require('fs');var path=require(_0x0bd5('0x6'));var rimraf=require(_0x0bd5('0x7'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0x376024,_0x2ef1d0){return _0x376024[_0x0bd5('0x8')](_0x0bd5('0x9'),attributes,{'tableName':_0x0bd5('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 3d362d0..d6b628c 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 _0xb768=['error','code','Trigger,\x20%s,\x20%s','message','info','request\x20sent','GetTrigger','Trigger','findAll','options','raw','limit','include','map','attributes','model','debug','catch','ShowTrigger','find','where','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x490357,_0x34428b){var _0x5d435b=function(_0x124420){while(--_0x124420){_0x490357['push'](_0x490357['shift']());}};_0x5d435b(++_0x34428b);}(_0xb768,0x1ba));var _0x8b76=function(_0x1487e1,_0x4cf4ce){_0x1487e1=_0x1487e1-0x0;var _0x2eab21=_0xb768[_0x1487e1];return _0x2eab21;};'use strict';var _=require(_0x8b76('0x0'));var util=require('util');var moment=require(_0x8b76('0x1'));var BPromise=require(_0x8b76('0x2'));var rs=require(_0x8b76('0x3'));var fs=require('fs');var Redis=require(_0x8b76('0x4'));var db=require(_0x8b76('0x5'))['db'];var utils=require(_0x8b76('0x6'));var logger=require(_0x8b76('0x7'))('rpc');var config=require(_0x8b76('0x8'));var jayson=require(_0x8b76('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20975e,_0x18ee9f,_0xfd1daf){return new BPromise(function(_0x7c1186,_0x56a1b7){return client[_0x8b76('0xa')](_0x20975e,_0xfd1daf)['then'](function(_0x545091){logger['info']('Trigger,\x20%s,\x20%s',_0x18ee9f,'request\x20sent');logger['debug'](_0x8b76('0xb'),_0x18ee9f,'request\x20sent',JSON[_0x8b76('0xc')](_0x545091));if(_0x545091[_0x8b76('0xd')]){if(_0x545091[_0x8b76('0xd')][_0x8b76('0xe')]===0x1f4){logger[_0x8b76('0xd')](_0x8b76('0xf'),_0x18ee9f,_0x545091['error']['message']);return _0x56a1b7(_0x545091['error']['message']);}logger[_0x8b76('0xd')]('Trigger,\x20%s,\x20%s',_0x18ee9f,_0x545091[_0x8b76('0xd')][_0x8b76('0x10')]);return _0x7c1186(_0x545091['error'][_0x8b76('0x10')]);}else{logger[_0x8b76('0x11')]('Trigger,\x20%s,\x20%s',_0x18ee9f,_0x8b76('0x12'));_0x7c1186(_0x545091['result'][_0x8b76('0x10')]);}})['catch'](function(_0x39dd0f){logger[_0x8b76('0xd')](_0x8b76('0xf'),_0x18ee9f,_0x39dd0f);_0x56a1b7(_0x39dd0f);});});}exports[_0x8b76('0x13')]=function(_0x5c7663){var _0xb83619=this;return new Promise(function(_0x6d3968,_0x1ffae8){return db[_0x8b76('0x14')][_0x8b76('0x15')]({'raw':_0x5c7663['options']?_0x5c7663[_0x8b76('0x16')][_0x8b76('0x17')]===undefined?!![]:![]:!![],'where':_0x5c7663[_0x8b76('0x16')]?_0x5c7663[_0x8b76('0x16')]['where']||null:null,'attributes':_0x5c7663[_0x8b76('0x16')]?_0x5c7663[_0x8b76('0x16')]['attributes']||null:null,'limit':_0x5c7663[_0x8b76('0x16')]?_0x5c7663['options'][_0x8b76('0x18')]||null:null,'include':_0x5c7663[_0x8b76('0x16')]?_0x5c7663[_0x8b76('0x16')][_0x8b76('0x19')]?_[_0x8b76('0x1a')](_0x5c7663['options'][_0x8b76('0x19')],function(_0x22d43c){return{'model':db[_0x22d43c['model']],'as':_0x22d43c['as'],'attributes':_0x22d43c[_0x8b76('0x1b')],'include':_0x22d43c[_0x8b76('0x19')]?_[_0x8b76('0x1a')](_0x22d43c[_0x8b76('0x19')],function(_0x3726a0){return{'model':db[_0x3726a0['model']],'as':_0x3726a0['as'],'attributes':_0x3726a0[_0x8b76('0x1b')],'include':_0x3726a0['include']?_[_0x8b76('0x1a')](_0x3726a0[_0x8b76('0x19')],function(_0x237087){return{'model':db[_0x237087[_0x8b76('0x1c')]],'as':_0x237087['as'],'attributes':_0x237087[_0x8b76('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28d16b){logger[_0x8b76('0x11')](_0x8b76('0x13'),_0x5c7663);logger[_0x8b76('0x1d')](_0x8b76('0x13'),_0x5c7663,JSON['stringify'](_0x28d16b));_0x6d3968(_0x28d16b);})[_0x8b76('0x1e')](function(_0x24dbac){logger[_0x8b76('0xd')](_0x8b76('0x13'),_0x24dbac[_0x8b76('0x10')],_0x5c7663);_0x1ffae8(_0xb83619[_0x8b76('0xd')](0x1f4,_0x24dbac[_0x8b76('0x10')]));});});};exports[_0x8b76('0x1f')]=function(_0x34064d){var _0x11d485=this;return new Promise(function(_0x29987a,_0x4c8581){return db[_0x8b76('0x14')][_0x8b76('0x20')]({'raw':_0x34064d[_0x8b76('0x16')]?_0x34064d[_0x8b76('0x16')][_0x8b76('0x17')]===undefined?!![]:![]:!![],'where':_0x34064d[_0x8b76('0x16')]?_0x34064d[_0x8b76('0x16')][_0x8b76('0x21')]||null:null,'attributes':_0x34064d['options']?_0x34064d[_0x8b76('0x16')][_0x8b76('0x1b')]||null:null,'include':_0x34064d['options']?_0x34064d['options'][_0x8b76('0x19')]?_[_0x8b76('0x1a')](_0x34064d[_0x8b76('0x16')]['include'],function(_0x45512a){return{'model':db[_0x45512a[_0x8b76('0x1c')]],'as':_0x45512a['as'],'attributes':_0x45512a['attributes'],'include':_0x45512a['include']?_[_0x8b76('0x1a')](_0x45512a[_0x8b76('0x19')],function(_0x1be8f3){return{'model':db[_0x1be8f3[_0x8b76('0x1c')]],'as':_0x1be8f3['as'],'attributes':_0x1be8f3['attributes'],'include':_0x1be8f3[_0x8b76('0x19')]?_[_0x8b76('0x1a')](_0x1be8f3[_0x8b76('0x19')],function(_0x33b39b){return{'model':db[_0x33b39b['model']],'as':_0x33b39b['as'],'attributes':_0x33b39b[_0x8b76('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8b76('0x22')](function(_0x5e749f){logger[_0x8b76('0x11')]('ShowTrigger',_0x34064d);logger[_0x8b76('0x1d')](_0x8b76('0x1f'),_0x34064d,JSON[_0x8b76('0xc')](_0x5e749f));_0x29987a(_0x5e749f);})[_0x8b76('0x1e')](function(_0x5961a9){logger['error'](_0x8b76('0x1f'),_0x5961a9['message'],_0x34064d);_0x4c8581(_0x11d485['error'](0x1f4,_0x5961a9['message']));});});}; \ No newline at end of file +var _0x4596=['code','message','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','debug','find','where','ShowTrigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x4596,0x183));var _0x6459=function(_0x221474,_0x4d57ba){_0x221474=_0x221474-0x0;var _0x41e156=_0x4596[_0x221474];return _0x41e156;};'use strict';var _=require(_0x6459('0x0'));var util=require('util');var moment=require(_0x6459('0x1'));var BPromise=require(_0x6459('0x2'));var rs=require(_0x6459('0x3'));var fs=require('fs');var Redis=require(_0x6459('0x4'));var db=require(_0x6459('0x5'))['db'];var utils=require(_0x6459('0x6'));var logger=require('../../config/logger')(_0x6459('0x7'));var config=require(_0x6459('0x8'));var jayson=require(_0x6459('0x9'));var client=jayson[_0x6459('0xa')][_0x6459('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec749,_0x353909,_0x3d7e06){return new BPromise(function(_0x5de377,_0x23ed37){return client[_0x6459('0xc')](_0x3ec749,_0x3d7e06)[_0x6459('0xd')](function(_0x2223f2){logger[_0x6459('0xe')](_0x6459('0xf'),_0x353909,_0x6459('0x10'));logger['debug'](_0x6459('0x11'),_0x353909,'request\x20sent',JSON[_0x6459('0x12')](_0x2223f2));if(_0x2223f2['error']){if(_0x2223f2[_0x6459('0x13')][_0x6459('0x14')]===0x1f4){logger[_0x6459('0x13')](_0x6459('0xf'),_0x353909,_0x2223f2[_0x6459('0x13')][_0x6459('0x15')]);return _0x23ed37(_0x2223f2[_0x6459('0x13')][_0x6459('0x15')]);}logger['error'](_0x6459('0xf'),_0x353909,_0x2223f2['error'][_0x6459('0x15')]);return _0x5de377(_0x2223f2[_0x6459('0x13')][_0x6459('0x15')]);}else{logger['info'](_0x6459('0xf'),_0x353909,_0x6459('0x10'));_0x5de377(_0x2223f2['result']['message']);}})[_0x6459('0x16')](function(_0xd04c79){logger['error']('Trigger,\x20%s,\x20%s',_0x353909,_0xd04c79);_0x23ed37(_0xd04c79);});});}exports[_0x6459('0x17')]=function(_0x1a797b){var _0x438483=this;return new Promise(function(_0x2b793,_0x4dc0d0){return db[_0x6459('0x18')][_0x6459('0x19')]({'raw':_0x1a797b[_0x6459('0x1a')]?_0x1a797b[_0x6459('0x1a')][_0x6459('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a797b[_0x6459('0x1a')]?_0x1a797b[_0x6459('0x1a')]['where']||null:null,'attributes':_0x1a797b['options']?_0x1a797b['options'][_0x6459('0x1c')]||null:null,'limit':_0x1a797b[_0x6459('0x1a')]?_0x1a797b[_0x6459('0x1a')][_0x6459('0x1d')]||null:null,'include':_0x1a797b[_0x6459('0x1a')]?_0x1a797b[_0x6459('0x1a')][_0x6459('0x1e')]?_[_0x6459('0x1f')](_0x1a797b[_0x6459('0x1a')][_0x6459('0x1e')],function(_0x50dc9a){return{'model':db[_0x50dc9a[_0x6459('0x20')]],'as':_0x50dc9a['as'],'attributes':_0x50dc9a[_0x6459('0x1c')],'include':_0x50dc9a[_0x6459('0x1e')]?_[_0x6459('0x1f')](_0x50dc9a['include'],function(_0x33f496){return{'model':db[_0x33f496[_0x6459('0x20')]],'as':_0x33f496['as'],'attributes':_0x33f496[_0x6459('0x1c')],'include':_0x33f496['include']?_[_0x6459('0x1f')](_0x33f496[_0x6459('0x1e')],function(_0x3f13ca){return{'model':db[_0x3f13ca[_0x6459('0x20')]],'as':_0x3f13ca['as'],'attributes':_0x3f13ca['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c2416){logger[_0x6459('0xe')](_0x6459('0x17'),_0x1a797b);logger[_0x6459('0x21')](_0x6459('0x17'),_0x1a797b,JSON[_0x6459('0x12')](_0x4c2416));_0x2b793(_0x4c2416);})[_0x6459('0x16')](function(_0x187eab){logger[_0x6459('0x13')]('GetTrigger',_0x187eab[_0x6459('0x15')],_0x1a797b);_0x4dc0d0(_0x438483['error'](0x1f4,_0x187eab[_0x6459('0x15')]));});});};exports['ShowTrigger']=function(_0x26b91f){var _0x56cffe=this;return new Promise(function(_0xca6d96,_0x1ce3bf){return db[_0x6459('0x18')][_0x6459('0x22')]({'raw':_0x26b91f[_0x6459('0x1a')]?_0x26b91f[_0x6459('0x1a')][_0x6459('0x1b')]===undefined?!![]:![]:!![],'where':_0x26b91f[_0x6459('0x1a')]?_0x26b91f[_0x6459('0x1a')][_0x6459('0x23')]||null:null,'attributes':_0x26b91f['options']?_0x26b91f[_0x6459('0x1a')]['attributes']||null:null,'include':_0x26b91f[_0x6459('0x1a')]?_0x26b91f[_0x6459('0x1a')][_0x6459('0x1e')]?_[_0x6459('0x1f')](_0x26b91f[_0x6459('0x1a')][_0x6459('0x1e')],function(_0xaa2e11){return{'model':db[_0xaa2e11[_0x6459('0x20')]],'as':_0xaa2e11['as'],'attributes':_0xaa2e11[_0x6459('0x1c')],'include':_0xaa2e11[_0x6459('0x1e')]?_[_0x6459('0x1f')](_0xaa2e11[_0x6459('0x1e')],function(_0x2ccd74){return{'model':db[_0x2ccd74['model']],'as':_0x2ccd74['as'],'attributes':_0x2ccd74['attributes'],'include':_0x2ccd74[_0x6459('0x1e')]?_['map'](_0x2ccd74[_0x6459('0x1e')],function(_0x46f393){return{'model':db[_0x46f393[_0x6459('0x20')]],'as':_0x46f393['as'],'attributes':_0x46f393[_0x6459('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40651c){logger[_0x6459('0xe')](_0x6459('0x24'),_0x26b91f);logger[_0x6459('0x21')](_0x6459('0x24'),_0x26b91f,JSON[_0x6459('0x12')](_0x40651c));_0xca6d96(_0x40651c);})[_0x6459('0x16')](function(_0x3fabe2){logger[_0x6459('0x13')](_0x6459('0x24'),_0x3fabe2[_0x6459('0x15')],_0x26b91f);_0x1ce3bf(_0x56cffe['error'](0x1f4,_0x3fabe2[_0x6459('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d2b7fcd..2426d5d 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 _0x11f1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x789166,_0x4941e4){var _0x1fcb38=function(_0x419105){while(--_0x419105){_0x789166['push'](_0x789166['shift']());}};_0x1fcb38(++_0x4941e4);}(_0x11f1,0x7c));var _0x111f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x11f1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x111f('0x0'));var util=require(_0x111f('0x1'));var path=require(_0x111f('0x2'));var timeout=require(_0x111f('0x3'));var express=require(_0x111f('0x4'));var router=express[_0x111f('0x5')]();var fs_extra=require(_0x111f('0x6'));var auth=require(_0x111f('0x7'));var interaction=require(_0x111f('0x8'));var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0x111f('0x9')](),controller[_0x111f('0xa')]);router[_0x111f('0xb')](_0x111f('0xc'),auth['isAuthenticated'](),controller[_0x111f('0xd')]);router[_0x111f('0xe')]('/:id/clone',auth[_0x111f('0x9')](),controller['clone']);router[_0x111f('0xe')]('/',auth[_0x111f('0x9')](),controller[_0x111f('0xf')]);router[_0x111f('0x10')](_0x111f('0xc'),auth[_0x111f('0x9')](),controller[_0x111f('0x11')]);router[_0x111f('0x12')](_0x111f('0xc'),auth[_0x111f('0x9')](),controller[_0x111f('0x13')]);module[_0x111f('0x14')]=router; \ No newline at end of file +var _0x4ddb=['update','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','post','/:id/clone','clone','create','put','/:id'];(function(_0x39be9c,_0x3716b3){var _0x16eae7=function(_0x409f97){while(--_0x409f97){_0x39be9c['push'](_0x39be9c['shift']());}};_0x16eae7(++_0x3716b3);}(_0x4ddb,0xbc));var _0xb4dd=function(_0x48cf09,_0x3b5f6c){_0x48cf09=_0x48cf09-0x0;var _0x203b57=_0x4ddb[_0x48cf09];return _0x203b57;};'use strict';var multer=require(_0xb4dd('0x0'));var util=require('util');var path=require(_0xb4dd('0x1'));var timeout=require(_0xb4dd('0x2'));var express=require(_0xb4dd('0x3'));var router=express['Router']();var fs_extra=require(_0xb4dd('0x4'));var auth=require(_0xb4dd('0x5'));var interaction=require(_0xb4dd('0x6'));var config=require('../../config/environment');var controller=require(_0xb4dd('0x7'));router[_0xb4dd('0x8')]('/',auth[_0xb4dd('0x9')](),controller['index']);router[_0xb4dd('0x8')]('/:id',auth[_0xb4dd('0x9')](),controller['show']);router[_0xb4dd('0xa')](_0xb4dd('0xb'),auth['isAuthenticated'](),controller[_0xb4dd('0xc')]);router[_0xb4dd('0xa')]('/',auth[_0xb4dd('0x9')](),controller[_0xb4dd('0xd')]);router[_0xb4dd('0xe')](_0xb4dd('0xf'),auth[_0xb4dd('0x9')](),controller[_0xb4dd('0x10')]);router['delete'](_0xb4dd('0xf'),auth[_0xb4dd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 23ad6e0..f641f34 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 _0xc098=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','friend','peer','from-voip-provider','ENUM'];(function(_0x12adf0,_0x2ae018){var _0x195152=function(_0x3afd8e){while(--_0x3afd8e){_0x12adf0['push'](_0x12adf0['shift']());}};_0x195152(++_0x2ae018);}(_0xc098,0xf7));var _0x8c09=function(_0x37962d,_0xcde842){_0x37962d=_0x37962d-0x0;var _0x30330d=_0xc098[_0x37962d];return _0x30330d;};'use strict';var Sequelize=require(_0x8c09('0x0'));module[_0x8c09('0x1')]={'name':{'type':Sequelize[_0x8c09('0x2')],'allowNull':![],'unique':_0x8c09('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8c09('0x4'),'user',_0x8c09('0x5')),'allowNull':![],'defaultValue':_0x8c09('0x4')},'context':{'type':Sequelize[_0x8c09('0x2')],'allowNull':![],'defaultValue':_0x8c09('0x6')},'callingpres':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x8'),_0x8c09('0x9'),_0x8c09('0xa'),_0x8c09('0xb'),_0x8c09('0xc'),_0x8c09('0xd'),_0x8c09('0xe'),_0x8c09('0xf'))},'deny':{'type':Sequelize[_0x8c09('0x2')]},'permit':{'type':Sequelize[_0x8c09('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x8c09('0x2')]},'remotesecret':{'type':Sequelize[_0x8c09('0x2')]},'transport':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':_0x8c09('0x10'),'set':function(_0x4d7816){this[_0x8c09('0x11')](_0x8c09('0x12'),_0x4d7816?_0x4d7816[_0x8c09('0x13')](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue']('transport')[_0x8c09('0x14')](','):null;},'comment':_0x8c09('0x15')},'dtmfmode':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x16'),_0x8c09('0x17'),_0x8c09('0x18'),_0x8c09('0x19'),_0x8c09('0x1a')),'defaultValue':_0x8c09('0x16')},'directmedia':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no',_0x8c09('0x1c'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8c09('0x7')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8c09('0x2')]},'directmediadeny':{'type':Sequelize[_0x8c09('0x2')]},'nat':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':'force_rport,comedia','set':function(_0xf54ee8){this[_0x8c09('0x11')]('nat',_0xf54ee8?_0xf54ee8[_0x8c09('0x13')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x8c09('0x1d')]('nat')[_0x8c09('0x14')](','):null;},'comment':_0x8c09('0x1e')},'callgroup':{'type':Sequelize[_0x8c09('0x2')]},'namedcallgroup':{'type':Sequelize[_0x8c09('0x2')]},'pickupgroup':{'type':Sequelize[_0x8c09('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x8c09('0x2')]},'language':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x8c09('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x6d5e0d){this[_0x8c09('0x11')]('allow',_0x6d5e0d?_0x6d5e0d[_0x8c09('0x13')](';'):_0x8c09('0x1f'));},'get':function(){return this[_0x8c09('0x1d')](_0x8c09('0x20'))?this['getDataValue']('allow')[_0x8c09('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8c09('0x7')]('yes','no')},'insecure':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':_0x8c09('0x21'),'set':function(_0x2d4a1e){this[_0x8c09('0x11')]('insecure',_0x2d4a1e?_0x2d4a1e[_0x8c09('0x13')](','):null);},'get':function(){return this[_0x8c09('0x1d')](_0x8c09('0x22'))?this[_0x8c09('0x1d')](_0x8c09('0x22'))[_0x8c09('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8c09('0x7')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8c09('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no',_0x8c09('0x23'))},'promiscredir':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x8c09('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x8c09('0x25')},'amaflags':{'type':Sequelize[_0x8c09('0x2')]},'callcounter':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no'),'defaultValue':_0x8c09('0x1b')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x8c09('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x8c09('0x2')]},'template':{'type':Sequelize[_0x8c09('0x2')]},'videosupport':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no',_0x8c09('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8c09('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x8c09('0x2')]},'session_timers':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x27'),_0x8c09('0x28'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x8c09('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x29'),'uas'),'defaultValue':_0x8c09('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x8c09('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8c09('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x8c09('0x1b'),'no'),'defaultValue':_0x8c09('0x1b')},'keepalive':{'type':Sequelize[_0x8c09('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x8c09('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8c09('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x8c09('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8c09('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x8c09('0x24')](0xb)},'timerb':{'type':Sequelize[_0x8c09('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8c09('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x8c09('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x8c09('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x8c09('0x2')]},'maxforwards':{'type':Sequelize[_0x8c09('0x24')](0xb)},'encryption':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x1b'),'no',_0x8c09('0x2c'),_0x8c09('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x8c09('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8c09('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x8c09('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x8c09('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8c09('0x7')](_0x8c09('0x2e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8c09('0x2')]},'usereqphone':{'type':Sequelize[_0x8c09('0x7')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8c09('0x2')]},'recordofffeature':{'type':Sequelize[_0x8c09('0x2')]},'call_limit':{'type':Sequelize[_0x8c09('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8c09('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x8c09('0x7')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x8c09('0x2')]},'mohsuggest':{'type':Sequelize[_0x8c09('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c09('0x2')]},'host':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':_0x8c09('0x2f')},'canreinvite':{'type':Sequelize[_0x8c09('0x7')]('yes','no',_0x8c09('0x1c'),_0x8c09('0x30'),_0x8c09('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8c09('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8c09('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x8f2e=['allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uas','pai','fingerprint','active','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','friend','user','peer','STRING','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','join','getDataValue','transport','split','rfc2833','info','inband','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0x3c560a,_0x1c46d4){var _0x22e9be=function(_0xd72419){while(--_0xd72419){_0x3c560a['push'](_0x3c560a['shift']());}};_0x22e9be(++_0x1c46d4);}(_0x8f2e,0x1f3));var _0xe8f2=function(_0x5810cb,_0x2c06be){_0x5810cb=_0x5810cb-0x0;var _0x2f2dd4=_0x8f2e[_0x5810cb];return _0x2f2dd4;};'use strict';var Sequelize=require(_0xe8f2('0x0'));module[_0xe8f2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe8f2('0x2'),_0xe8f2('0x3'),_0xe8f2('0x4')),'allowNull':![],'defaultValue':_0xe8f2('0x2')},'context':{'type':Sequelize[_0xe8f2('0x5')],'allowNull':![],'defaultValue':_0xe8f2('0x6')},'callingpres':{'type':Sequelize[_0xe8f2('0x7')]('ALLOWED_NOT_SCREENED',_0xe8f2('0x8'),'ALLOWED_FAILED_SCREEN',_0xe8f2('0x9'),_0xe8f2('0xa'),_0xe8f2('0xb'),_0xe8f2('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xe8f2('0x5')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xe8f2('0x5')]},'remotesecret':{'type':Sequelize[_0xe8f2('0x5')]},'transport':{'type':Sequelize[_0xe8f2('0x5')],'defaultValue':_0xe8f2('0xd'),'set':function(_0x574000){this[_0xe8f2('0xe')]('transport',_0x574000?_0x574000[_0xe8f2('0xf')](','):null);},'get':function(){return this[_0xe8f2('0x10')](_0xe8f2('0x11'))?this[_0xe8f2('0x10')]('transport')[_0xe8f2('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xe8f2('0x13'),_0xe8f2('0x14'),'shortinfo',_0xe8f2('0x15'),'auto'),'defaultValue':_0xe8f2('0x13')},'directmedia':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no',_0xe8f2('0x17'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe8f2('0x5')]},'directmediadeny':{'type':Sequelize[_0xe8f2('0x5')]},'nat':{'type':Sequelize[_0xe8f2('0x5')],'defaultValue':_0xe8f2('0x18'),'set':function(_0x53f652){this['setDataValue'](_0xe8f2('0x19'),_0x53f652?_0x53f652[_0xe8f2('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xe8f2('0x19'))?this[_0xe8f2('0x10')](_0xe8f2('0x19'))[_0xe8f2('0x12')](','):null;},'comment':_0xe8f2('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xe8f2('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8f2('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe8f2('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xe8f2('0x1b')},'allow':{'type':Sequelize[_0xe8f2('0x5')],'allowNull':![],'defaultValue':_0xe8f2('0x1c'),'set':function(_0x5c5953){this[_0xe8f2('0xe')](_0xe8f2('0x1d'),_0x5c5953?_0x5c5953['join'](';'):_0xe8f2('0x1c'));},'get':function(){return this['getDataValue'](_0xe8f2('0x1d'))?this[_0xe8f2('0x10')](_0xe8f2('0x1d'))[_0xe8f2('0x12')](';'):null;},'comment':_0xe8f2('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0xe8f2('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xe8f2('0x1f'),'set':function(_0x114dec){this[_0xe8f2('0xe')]('insecure',_0x114dec?_0x114dec[_0xe8f2('0xf')](','):null);},'get':function(){return this[_0xe8f2('0x10')](_0xe8f2('0x20'))?this[_0xe8f2('0x10')](_0xe8f2('0x20'))[_0xe8f2('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no',_0xe8f2('0x21'))},'promiscredir':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xe8f2('0x7')]('yes','no')},'accountcode':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'setvar':{'type':Sequelize[_0xe8f2('0x5')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xe8f2('0x23')},'amaflags':{'type':Sequelize[_0xe8f2('0x5')]},'callcounter':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no'),'defaultValue':_0xe8f2('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe8f2('0x7')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0xe8f2('0x16'),'no',_0xe8f2('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'mailbox':{'type':Sequelize[_0xe8f2('0x5')]},'session_timers':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x25'),'refuse',_0xe8f2('0x26'))},'session_expires':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xe8f2('0x7')]('uac','uas'),'defaultValue':_0xe8f2('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xe8f2('0x5')]},'fromdomain':{'type':Sequelize[_0xe8f2('0x5')]},'fromuser':{'type':Sequelize[_0xe8f2('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xe8f2('0x7')]('yes','no'),'defaultValue':_0xe8f2('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xe8f2('0x5')]},'defaultuser':{'type':Sequelize[_0xe8f2('0x5')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no',_0xe8f2('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe8f2('0x5')]},'timert1':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xe8f2('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xe8f2('0x5')]},'contactdeny':{'type':Sequelize[_0xe8f2('0x5')]},'contactacl':{'type':Sequelize[_0xe8f2('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xe8f2('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xe8f2('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe8f2('0x7')]('yes','no')},'force_avp':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'icesupport':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xe8f2('0x7')]('yes','no',_0xe8f2('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe8f2('0x5')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xe8f2('0x5')]},'dtlscafile':{'type':Sequelize[_0xe8f2('0x5')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x2a'),'passive',_0xe8f2('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe8f2('0x5')]},'recordofffeature':{'type':Sequelize[_0xe8f2('0x5')]},'call_limit':{'type':Sequelize[_0xe8f2('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xe8f2('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xe8f2('0x7')](_0xe8f2('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xe8f2('0x5')]},'mohsuggest':{'type':Sequelize[_0xe8f2('0x5')]},'parkinglot':{'type':Sequelize[_0xe8f2('0x5')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe8f2('0x5')],'defaultValue':_0xe8f2('0x2c')},'canreinvite':{'type':Sequelize['ENUM'](_0xe8f2('0x16'),'no',_0xe8f2('0x17'),_0xe8f2('0x2d'),_0xe8f2('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe8f2('0x5')]},'otherFields':{'type':Sequelize[_0xe8f2('0x5')]},'active':{'type':Sequelize[_0xe8f2('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe8f2('0x5')],'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 d16b27a..91cb339 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x1592ac,_0x537d4f){var _0x55d2b9=function(_0x5f25f3){while(--_0x5f25f3){_0x1592ac['push'](_0x1592ac['shift']());}};_0x55d2b9(++_0x537d4f);}(_0xdace,0xc5));var _0xedac=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xdace[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file +var _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x5c052d,_0x34d3d8){var _0x3cfc57=function(_0x15334b){while(--_0x15334b){_0x5c052d['push'](_0x5c052d['shift']());}};_0x3cfc57(++_0x34d3d8);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 7ec9656..db207c0 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 _0xa3ea=['lodash','util','../../config/logger','api','moment','request-promise','path','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3ea,0x1ec));var _0xaa3e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa3ea[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaa3e('0x0'));var util=require(_0xaa3e('0x1'));var logger=require(_0xaa3e('0x2'))(_0xaa3e('0x3'));var moment=require(_0xaa3e('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa3e('0x5'));var fs=require('fs');var path=require(_0xaa3e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa3e('0x7'));module[_0xaa3e('0x8')]=function(_0x3b8620,_0x9baa61){return _0x3b8620[_0xaa3e('0x9')](_0xaa3e('0xa'),attributes,{'tableName':_0xaa3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71d5=['rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1d828c,_0x545c77){var _0x3d341a=function(_0x3f7ec8){while(--_0x3f7ec8){_0x1d828c['push'](_0x1d828c['shift']());}};_0x3d341a(++_0x545c77);}(_0x71d5,0x17e));var _0x571d=function(_0x4393d1,_0x2111fb){_0x4393d1=_0x4393d1-0x0;var _0x1b6e18=_0x71d5[_0x4393d1];return _0x1b6e18;};'use strict';var _=require(_0x571d('0x0'));var util=require(_0x571d('0x1'));var logger=require(_0x571d('0x2'))(_0x571d('0x3'));var moment=require(_0x571d('0x4'));var BPromise=require(_0x571d('0x5'));var rp=require(_0x571d('0x6'));var fs=require('fs');var path=require(_0x571d('0x7'));var rimraf=require(_0x571d('0x8'));var config=require(_0x571d('0x9'));var attributes=require(_0x571d('0xa'));module['exports']=function(_0x2a4a0a,_0x46cd74){return _0x2a4a0a[_0x571d('0xb')](_0x571d('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 5bb2872..e9c6929 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 _0xfc6e=['error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc6e,0x13b));var _0xefc6=function(_0x24f9d9,_0x6b4d81){_0x24f9d9=_0x24f9d9-0x0;var _0x392b6c=_0xfc6e[_0x24f9d9];return _0x392b6c;};'use strict';var _=require(_0xefc6('0x0'));var util=require(_0xefc6('0x1'));var moment=require(_0xefc6('0x2'));var BPromise=require(_0xefc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefc6('0x4'));var db=require(_0xefc6('0x5'))['db'];var utils=require(_0xefc6('0x6'));var logger=require(_0xefc6('0x7'))(_0xefc6('0x8'));var config=require(_0xefc6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xefc6('0xa')][_0xefc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x530c78,_0x11f049,_0x533f5d){return new BPromise(function(_0xb0b489,_0x329c9d){return client[_0xefc6('0xc')](_0x530c78,_0x533f5d)[_0xefc6('0xd')](function(_0x26c51b){logger['info'](_0xefc6('0xe'),_0x11f049,_0xefc6('0xf'));logger[_0xefc6('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x11f049,_0xefc6('0xf'),JSON[_0xefc6('0x11')](_0x26c51b));if(_0x26c51b[_0xefc6('0x12')]){if(_0x26c51b['error'][_0xefc6('0x13')]===0x1f4){logger[_0xefc6('0x12')](_0xefc6('0xe'),_0x11f049,_0x26c51b[_0xefc6('0x12')]['message']);return _0x329c9d(_0x26c51b['error'][_0xefc6('0x14')]);}logger[_0xefc6('0x12')]('Trunk,\x20%s,\x20%s',_0x11f049,_0x26c51b['error'][_0xefc6('0x14')]);return _0xb0b489(_0x26c51b['error']['message']);}else{logger[_0xefc6('0x15')](_0xefc6('0xe'),_0x11f049,'request\x20sent');_0xb0b489(_0x26c51b[_0xefc6('0x16')][_0xefc6('0x14')]);}})[_0xefc6('0x17')](function(_0x15d301){logger[_0xefc6('0x12')](_0xefc6('0xe'),_0x11f049,_0x15d301);_0x329c9d(_0x15d301);});});}exports[_0xefc6('0x18')]=function(_0x2005a7){var _0x2d94d6=this;return new Promise(function(_0x21e94c,_0x73e8d7){return db[_0xefc6('0x19')][_0xefc6('0x1a')]({'raw':_0x2005a7[_0xefc6('0x1b')]?_0x2005a7['options'][_0xefc6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2005a7[_0xefc6('0x1b')]?_0x2005a7[_0xefc6('0x1b')][_0xefc6('0x1d')]||null:null,'attributes':_0x2005a7[_0xefc6('0x1b')]?_0x2005a7['options'][_0xefc6('0x1e')]||null:null,'limit':_0x2005a7['options']?_0x2005a7['options'][_0xefc6('0x1f')]||null:null,'include':_0x2005a7[_0xefc6('0x1b')]?_0x2005a7['options'][_0xefc6('0x20')]?_[_0xefc6('0x21')](_0x2005a7['options'][_0xefc6('0x20')],function(_0x4817ad){return{'model':db[_0x4817ad[_0xefc6('0x22')]],'as':_0x4817ad['as'],'attributes':_0x4817ad[_0xefc6('0x1e')],'include':_0x4817ad['include']?_[_0xefc6('0x21')](_0x4817ad[_0xefc6('0x20')],function(_0x516651){return{'model':db[_0x516651[_0xefc6('0x22')]],'as':_0x516651['as'],'attributes':_0x516651[_0xefc6('0x1e')],'include':_0x516651[_0xefc6('0x20')]?_[_0xefc6('0x21')](_0x516651[_0xefc6('0x20')],function(_0x52d771){return{'model':db[_0x52d771[_0xefc6('0x22')]],'as':_0x52d771['as'],'attributes':_0x52d771[_0xefc6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xefc6('0xd')](function(_0x34a690){logger['info'](_0xefc6('0x18'),_0x2005a7);logger[_0xefc6('0x10')](_0xefc6('0x18'),_0x2005a7,JSON[_0xefc6('0x11')](_0x34a690));_0x21e94c(_0x34a690);})['catch'](function(_0x2d3dbb){logger[_0xefc6('0x12')](_0xefc6('0x18'),_0x2d3dbb[_0xefc6('0x14')],_0x2005a7);_0x73e8d7(_0x2d94d6['error'](0x1f4,_0x2d3dbb['message']));});});};exports[_0xefc6('0x23')]=function(_0x228358){var _0x482a34=this;return new Promise(function(_0xb77676,_0x39ffca){return db[_0xefc6('0x19')][_0xefc6('0x24')]({'raw':_0x228358[_0xefc6('0x1b')]?_0x228358[_0xefc6('0x1b')][_0xefc6('0x1c')]===undefined?!![]:![]:!![],'where':_0x228358['options']?_0x228358['options'][_0xefc6('0x1d')]||null:null,'attributes':_0x228358[_0xefc6('0x1b')]?_0x228358[_0xefc6('0x1b')][_0xefc6('0x1e')]||null:null,'include':_0x228358['options']?_0x228358[_0xefc6('0x1b')][_0xefc6('0x20')]?_[_0xefc6('0x21')](_0x228358[_0xefc6('0x1b')][_0xefc6('0x20')],function(_0x26eb2f){return{'model':db[_0x26eb2f[_0xefc6('0x22')]],'as':_0x26eb2f['as'],'attributes':_0x26eb2f[_0xefc6('0x1e')],'include':_0x26eb2f['include']?_[_0xefc6('0x21')](_0x26eb2f['include'],function(_0x1386f7){return{'model':db[_0x1386f7[_0xefc6('0x22')]],'as':_0x1386f7['as'],'attributes':_0x1386f7[_0xefc6('0x1e')],'include':_0x1386f7[_0xefc6('0x20')]?_[_0xefc6('0x21')](_0x1386f7[_0xefc6('0x20')],function(_0x4a1f6f){return{'model':db[_0x4a1f6f[_0xefc6('0x22')]],'as':_0x4a1f6f['as'],'attributes':_0x4a1f6f[_0xefc6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xefc6('0xd')](function(_0x2687a7){logger[_0xefc6('0x15')](_0xefc6('0x23'),_0x228358);logger[_0xefc6('0x10')](_0xefc6('0x23'),_0x228358,JSON[_0xefc6('0x11')](_0x2687a7));_0xb77676(_0x2687a7);})[_0xefc6('0x17')](function(_0x5c32a6){logger[_0xefc6('0x12')](_0xefc6('0x23'),_0x5c32a6[_0xefc6('0x14')],_0x228358);_0x39ffca(_0x482a34['error'](0x1f4,_0x5c32a6[_0xefc6('0x14')]));});});}; \ No newline at end of file +var _0x7a73=['info','GetTrunk','catch','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','http','request','then','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','Trunk','findAll','raw','options','where','include','map','model','attributes'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x7a73,0x65));var _0x37a7=function(_0x11b4f9,_0x123cba){_0x11b4f9=_0x11b4f9-0x0;var _0x433974=_0x7a73[_0x11b4f9];return _0x433974;};'use strict';var _=require(_0x37a7('0x0'));var util=require(_0x37a7('0x1'));var moment=require(_0x37a7('0x2'));var BPromise=require(_0x37a7('0x3'));var rs=require(_0x37a7('0x4'));var fs=require('fs');var Redis=require(_0x37a7('0x5'));var db=require(_0x37a7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x37a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2894cc,_0x335de1,_0x47d22b){return new BPromise(function(_0x4705b0,_0x58a2db){return client[_0x37a7('0x8')](_0x2894cc,_0x47d22b)[_0x37a7('0x9')](function(_0x560c39){logger['info']('Trunk,\x20%s,\x20%s',_0x335de1,_0x37a7('0xa'));logger[_0x37a7('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x335de1,_0x37a7('0xa'),JSON[_0x37a7('0xc')](_0x560c39));if(_0x560c39[_0x37a7('0xd')]){if(_0x560c39[_0x37a7('0xd')][_0x37a7('0xe')]===0x1f4){logger[_0x37a7('0xd')](_0x37a7('0xf'),_0x335de1,_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);return _0x58a2db(_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);}logger[_0x37a7('0xd')](_0x37a7('0xf'),_0x335de1,_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);return _0x4705b0(_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);}else{logger['info'](_0x37a7('0xf'),_0x335de1,_0x37a7('0xa'));_0x4705b0(_0x560c39[_0x37a7('0x11')][_0x37a7('0x10')]);}})['catch'](function(_0x89914){logger['error'](_0x37a7('0xf'),_0x335de1,_0x89914);_0x58a2db(_0x89914);});});}exports['GetTrunk']=function(_0xf526a6){var _0x111d52=this;return new Promise(function(_0x549802,_0x406c12){return db[_0x37a7('0x12')][_0x37a7('0x13')]({'raw':_0xf526a6['options']?_0xf526a6['options'][_0x37a7('0x14')]===undefined?!![]:![]:!![],'where':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')][_0x37a7('0x16')]||null:null,'attributes':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')]['attributes']||null:null,'limit':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')]['limit']||null:null,'include':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')][_0x37a7('0x17')]?_[_0x37a7('0x18')](_0xf526a6[_0x37a7('0x15')][_0x37a7('0x17')],function(_0x879003){return{'model':db[_0x879003[_0x37a7('0x19')]],'as':_0x879003['as'],'attributes':_0x879003[_0x37a7('0x1a')],'include':_0x879003[_0x37a7('0x17')]?_[_0x37a7('0x18')](_0x879003[_0x37a7('0x17')],function(_0x175a29){return{'model':db[_0x175a29['model']],'as':_0x175a29['as'],'attributes':_0x175a29[_0x37a7('0x1a')],'include':_0x175a29['include']?_[_0x37a7('0x18')](_0x175a29[_0x37a7('0x17')],function(_0x4f516b){return{'model':db[_0x4f516b[_0x37a7('0x19')]],'as':_0x4f516b['as'],'attributes':_0x4f516b[_0x37a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x37a7('0x9')](function(_0x113d6a){logger[_0x37a7('0x1b')](_0x37a7('0x1c'),_0xf526a6);logger[_0x37a7('0xb')](_0x37a7('0x1c'),_0xf526a6,JSON[_0x37a7('0xc')](_0x113d6a));_0x549802(_0x113d6a);})[_0x37a7('0x1d')](function(_0x125412){logger[_0x37a7('0xd')](_0x37a7('0x1c'),_0x125412[_0x37a7('0x10')],_0xf526a6);_0x406c12(_0x111d52[_0x37a7('0xd')](0x1f4,_0x125412[_0x37a7('0x10')]));});});};exports[_0x37a7('0x1e')]=function(_0x476937){var _0x3d75b3=this;return new Promise(function(_0x3f5d62,_0x3ac8d9){return db[_0x37a7('0x12')][_0x37a7('0x1f')]({'raw':_0x476937['options']?_0x476937[_0x37a7('0x15')][_0x37a7('0x14')]===undefined?!![]:![]:!![],'where':_0x476937[_0x37a7('0x15')]?_0x476937['options'][_0x37a7('0x16')]||null:null,'attributes':_0x476937['options']?_0x476937['options'][_0x37a7('0x1a')]||null:null,'include':_0x476937[_0x37a7('0x15')]?_0x476937[_0x37a7('0x15')][_0x37a7('0x17')]?_[_0x37a7('0x18')](_0x476937['options']['include'],function(_0xe7a75b){return{'model':db[_0xe7a75b[_0x37a7('0x19')]],'as':_0xe7a75b['as'],'attributes':_0xe7a75b[_0x37a7('0x1a')],'include':_0xe7a75b[_0x37a7('0x17')]?_[_0x37a7('0x18')](_0xe7a75b['include'],function(_0x494b46){return{'model':db[_0x494b46[_0x37a7('0x19')]],'as':_0x494b46['as'],'attributes':_0x494b46[_0x37a7('0x1a')],'include':_0x494b46[_0x37a7('0x17')]?_[_0x37a7('0x18')](_0x494b46[_0x37a7('0x17')],function(_0x52af66){return{'model':db[_0x52af66[_0x37a7('0x19')]],'as':_0x52af66['as'],'attributes':_0x52af66['attributes']};}):[]};}):[]};}):[]:[]})[_0x37a7('0x9')](function(_0xd7c9cf){logger[_0x37a7('0x1b')]('ShowTrunk',_0x476937);logger[_0x37a7('0xb')](_0x37a7('0x1e'),_0x476937,JSON[_0x37a7('0xc')](_0xd7c9cf));_0x3f5d62(_0xd7c9cf);})[_0x37a7('0x1d')](function(_0x56cf70){logger['error'](_0x37a7('0x1e'),_0x56cf70[_0x37a7('0x10')],_0x476937);_0x3ac8d9(_0x3d75b3[_0x37a7('0xd')](0x1f4,_0x56cf70[_0x37a7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5a9106c..a1de394 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 _0x66cb=['/:id','isAuthenticated','exports','express','Router'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x66cb,0x67));var _0xb66c=function(_0x4e438f,_0x4733c7){_0x4e438f=_0x4e438f-0x0;var _0x418ed9=_0x66cb[_0x4e438f];return _0x418ed9;};'use strict';var express=require(_0xb66c('0x0'));var router=express[_0xb66c('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put'](_0xb66c('0x2'),auth[_0xb66c('0x3')](),controller['update']);module[_0xb66c('0x4')]=router; \ No newline at end of file +var _0xf382=['./user-setting.controller','put','/:id','isAuthenticated','update','../../components/auth/service'];(function(_0x5ba6b8,_0x404eec){var _0x2dd1e9=function(_0x4a9bfa){while(--_0x4a9bfa){_0x5ba6b8['push'](_0x5ba6b8['shift']());}};_0x2dd1e9(++_0x404eec);}(_0xf382,0xb9));var _0x2f38=function(_0x169cf7,_0xba0095){_0x169cf7=_0x169cf7-0x0;var _0x4f1709=_0xf382[_0x169cf7];return _0x4f1709;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x2f38('0x0'));var controller=require(_0x2f38('0x1'));router[_0x2f38('0x2')](_0x2f38('0x3'),auth[_0x2f38('0x4')](),controller[_0x2f38('0x5')]);module['exports']=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 51b397f..8dde3c6 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 _0x3a1b=['INTEGER','UserId','error','warning','info','ENUM','TEXT','DATE'];(function(_0x30b951,_0x1b13d2){var _0x41b6a1=function(_0x5663c2){while(--_0x5663c2){_0x30b951['push'](_0x30b951['shift']());}};_0x41b6a1(++_0x1b13d2);}(_0x3a1b,0x19a));var _0xb3a1=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a1b[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xb3a1('0x0'),_0xb3a1('0x1'),_0xb3a1('0x2'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xb3a1('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xb3a1('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb3a1('0x4')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb3a1('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb3a1('0x6')],'unique':_0xb3a1('0x7')}}; \ No newline at end of file +var _0x3af9=['debug','exports','BOOLEAN','TEXT','INTEGER','UserId','sequelize','error','warning'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x3af9,0x1e3));var _0x93af=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3af9[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x93af('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x93af('0x1'),_0x93af('0x2'),'info',_0x93af('0x3')];module[_0x93af('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x93af('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x93af('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x93af('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x93af('0x7')],'unique':_0x93af('0x8')}}; \ 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 6f30423..83cbbd7 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 _0x5127=['status','send','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','body','catch','lodash','ioredis','../../config/logger','api','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','json','update','then','sendStatus','error','stack','name'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x5127,0x18f));var _0x7512=function(_0x52cbe0,_0x332b2e){_0x52cbe0=_0x52cbe0-0x0;var _0x4bb9da=_0x5127[_0x52cbe0];return _0x4bb9da;};'use strict';var _=require(_0x7512('0x0'));var Redis=require(_0x7512('0x1'));var logger=require(_0x7512('0x2'))(_0x7512('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x7512('0x4'))(new Redis(config['redis']));require(_0x7512('0x5'))[_0x7512('0x6')](socket);config[_0x7512('0x7')]=_[_0x7512('0x8')](config[_0x7512('0x7')],{'host':_0x7512('0x9'),'port':0x18eb});function respondWithResult(_0x4e6779,_0x4d0765){_0x4d0765=_0x4d0765||0xc8;return function(_0x2d2e88){if(_0x2d2e88){return _0x4e6779['status'](_0x4d0765)[_0x7512('0xa')](_0x2d2e88);}};}function saveUpdates(_0x49b608){return function(_0x7328d7){if(_0x7328d7){return _0x7328d7[_0x7512('0xb')](_0x49b608)[_0x7512('0xc')](function(_0x3db733){return _0x3db733;});}return null;};}function handleEntityNotFound(_0x255ab9){return function(_0x7c0280){if(!_0x7c0280){_0x255ab9[_0x7512('0xd')](0x194);}return _0x7c0280;};}function handleError(_0x3c3efc,_0x202032){_0x202032=_0x202032||0x1f4;return function(_0x885024){logger[_0x7512('0xe')](_0x885024[_0x7512('0xf')]);if(_0x885024[_0x7512('0x10')]){delete _0x885024[_0x7512('0x10')];}_0x3c3efc[_0x7512('0x11')](_0x202032)[_0x7512('0x12')](_0x885024);};}exports[_0x7512('0xb')]=function(_0x527d96,_0x463c6){if(_0x527d96['user'][_0x7512('0x13')]!==_0x7512('0x14'))throw new Error(_0x7512('0x15'));if(isNaN(Number(_0x527d96[_0x7512('0x16')]['id'])))throw new Error(_0x7512('0x17'));return db['UserSetting']['find']({'where':{'id':_0x527d96[_0x7512('0x16')]['id']}})[_0x7512('0xc')](handleEntityNotFound(_0x463c6,null))[_0x7512('0xc')](saveUpdates(_0x527d96[_0x7512('0x18')],null))['then'](respondWithResult(_0x463c6,null))[_0x7512('0x19')](handleError(_0x463c6,null));}; \ No newline at end of file +var _0x1bca=['socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status','json','update','sendStatus','error','name','send','user','role','admin','Unauthorized','params','find','then','body','catch','ioredis','../../config/environment'];(function(_0x337e47,_0x3ef503){var _0xe18c2e=function(_0x21dc01){while(--_0x21dc01){_0x337e47['push'](_0x337e47['shift']());}};_0xe18c2e(++_0x3ef503);}(_0x1bca,0xb6));var _0xa1bc=function(_0x155bd6,_0x28ed03){_0x155bd6=_0x155bd6-0x0;var _0x5b18d5=_0x1bca[_0x155bd6];return _0x5b18d5;};'use strict';var _=require('lodash');var Redis=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var config=require(_0xa1bc('0x1'));var db=require('../../mysqldb')['db'];var socket=require(_0xa1bc('0x2'))(new Redis(config[_0xa1bc('0x3')]));require(_0xa1bc('0x4'))['register'](socket);config[_0xa1bc('0x3')]=_[_0xa1bc('0x5')](config[_0xa1bc('0x3')],{'host':_0xa1bc('0x6'),'port':0x18eb});function respondWithResult(_0x54bffb,_0x43a67){_0x43a67=_0x43a67||0xc8;return function(_0x432b65){if(_0x432b65){return _0x54bffb[_0xa1bc('0x7')](_0x43a67)[_0xa1bc('0x8')](_0x432b65);}};}function saveUpdates(_0x16b36f){return function(_0x3ec26c){if(_0x3ec26c){return _0x3ec26c[_0xa1bc('0x9')](_0x16b36f)['then'](function(_0x1b826d){return _0x1b826d;});}return null;};}function handleEntityNotFound(_0x1edde3){return function(_0x23203c){if(!_0x23203c){_0x1edde3[_0xa1bc('0xa')](0x194);}return _0x23203c;};}function handleError(_0x327c9a,_0x24a815){_0x24a815=_0x24a815||0x1f4;return function(_0x40c40e){logger[_0xa1bc('0xb')](_0x40c40e['stack']);if(_0x40c40e['name']){delete _0x40c40e[_0xa1bc('0xc')];}_0x327c9a[_0xa1bc('0x7')](_0x24a815)[_0xa1bc('0xd')](_0x40c40e);};}exports[_0xa1bc('0x9')]=function(_0x3019a1,_0x210f9a){if(_0x3019a1[_0xa1bc('0xe')][_0xa1bc('0xf')]!==_0xa1bc('0x10'))throw new Error(_0xa1bc('0x11'));if(isNaN(Number(_0x3019a1[_0xa1bc('0x12')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0xa1bc('0x13')]({'where':{'id':_0x3019a1[_0xa1bc('0x12')]['id']}})[_0xa1bc('0x14')](handleEntityNotFound(_0x210f9a,null))[_0xa1bc('0x14')](saveUpdates(_0x3019a1[_0xa1bc('0x15')],null))[_0xa1bc('0x14')](respondWithResult(_0x210f9a,null))[_0xa1bc('0x16')](handleError(_0x210f9a,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 03ce2cb..a87e085 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 _0x30df=['hook','events','../../mysqldb','UserSetting','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x30df,0x12a));var _0xf30d=function(_0x2c00ff,_0x2b584c){_0x2c00ff=_0x2c00ff-0x0;var _0x56b8b6=_0x30df[_0x2c00ff];return _0x56b8b6;};'use strict';var EventEmitter=require(_0xf30d('0x0'));var UserSetting=require(_0xf30d('0x1'))['db'][_0xf30d('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf30d('0x3')](0x0);var events={'afterCreate':_0xf30d('0x4'),'afterUpdate':'update','afterDestroy':_0xf30d('0x5')};function emitEvent(_0x3fd0f3){return function(_0x481ce7,_0x40756a,_0x11c7aa){UserSettingEvents[_0xf30d('0x6')](_0x3fd0f3+':'+_0x481ce7['id'],_0x481ce7);UserSettingEvents[_0xf30d('0x6')](_0x3fd0f3,_0x481ce7);_0x11c7aa(null);};}for(var e in events){if(events[_0xf30d('0x7')](e)){var event=events[e];UserSetting[_0xf30d('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xcd02=['exports','../../mysqldb','remove','emit','hasOwnProperty'];(function(_0x31910f,_0xef8563){var _0x59b88a=function(_0x18afeb){while(--_0x18afeb){_0x31910f['push'](_0x31910f['shift']());}};_0x59b88a(++_0xef8563);}(_0xcd02,0x191));var _0x2cd0=function(_0xae05de,_0x518819){_0xae05de=_0xae05de-0x0;var _0xb859db=_0xcd02[_0xae05de];return _0xb859db;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x2cd0('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2cd0('0x1')};function emitEvent(_0x27ceb2){return function(_0x3270a4,_0x389f4b,_0x2779cc){UserSettingEvents[_0x2cd0('0x2')](_0x27ceb2+':'+_0x3270a4['id'],_0x3270a4);UserSettingEvents[_0x2cd0('0x2')](_0x27ceb2,_0x3270a4);_0x2779cc(null);};}for(var e in events){if(events[_0x2cd0('0x3')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x2cd0('0x4')]=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 05be8b5..42b40b9 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 _0x5d86=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3ac919,_0x3b0588){var _0x425be6=function(_0x533915){while(--_0x533915){_0x3ac919['push'](_0x3ac919['shift']());}};_0x425be6(++_0x3b0588);}(_0x5d86,0x76));var _0x65d8=function(_0x4a4b9b,_0x47c325){_0x4a4b9b=_0x4a4b9b-0x0;var _0x260375=_0x5d86[_0x4a4b9b];return _0x260375;};'use strict';var attributes=require(_0x65d8('0x0'));module[_0x65d8('0x1')]=function(_0x5686cc){return _0x5686cc['define'](_0x65d8('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bfcd7){if(!_0x2bfcd7[_0x65d8('0x3')])_0x2bfcd7['clientSideLoggingEnabledSince']=null;else if(_0x2bfcd7[_0x65d8('0x4')]===null)_0x2bfcd7['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x693f=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x23bf82,_0x3be0c5){var _0x4b6703=function(_0x165796){while(--_0x165796){_0x23bf82['push'](_0x23bf82['shift']());}};_0x4b6703(++_0x3be0c5);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0xf693('0x0'));module[_0xf693('0x1')]=function(_0x3511a1){return _0x3511a1[_0xf693('0x2')]('UserSetting',attributes,{'tableName':_0xf693('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x151799){if(!_0x151799[_0xf693('0x4')])_0x151799[_0xf693('0x5')]=null;else if(_0x151799[_0xf693('0x5')]===null)_0x151799[_0xf693('0x5')]=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 a3e1cfd..7cbc8ea 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 _0xe33b=['emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','save','remove','update'];(function(_0x1954c7,_0x1ee1d1){var _0x3e9ed7=function(_0x3aa64f){while(--_0x3aa64f){_0x1954c7['push'](_0x1954c7['shift']());}};_0x3e9ed7(++_0x1ee1d1);}(_0xe33b,0x197));var _0xbe33=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xe33b[_0x39e283];return _0x7de89f;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xbe33('0x0'),_0xbe33('0x1'),_0xbe33('0x2')];function createListener(_0x4f2e09,_0x563b89){return function(_0x278099){_0x563b89[_0xbe33('0x3')](_0x4f2e09,_0x278099);if(_0x4f2e09===_0xbe33('0x4')){_0x563b89[_0xbe33('0x3')](_0xbe33('0x5')+_0x278099[_0xbe33('0x6')],_0x278099);}};}exports[_0xbe33('0x7')]=function(_0x212eba){for(var _0xeae4d9=0x0,_0x3f90f4=events[_0xbe33('0x8')];_0xeae4d9<_0x3f90f4;_0xeae4d9++){var _0x4410ea=events[_0xeae4d9];var _0x2da4b8=createListener(_0xbe33('0x9')+_0x4410ea,_0x212eba);UserSettingEvents['on'](_0x4410ea,_0x2da4b8);}}; \ No newline at end of file +var _0xfad1=['emit','register','length','user-setting:','./user-setting.events','remove','update'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xfad1,0x12a));var _0x1fad=function(_0x46e3fb,_0x4abb5f){_0x46e3fb=_0x46e3fb-0x0;var _0x4684f0=_0xfad1[_0x46e3fb];return _0x4684f0;};'use strict';var UserSettingEvents=require(_0x1fad('0x0'));var events=['save',_0x1fad('0x1'),_0x1fad('0x2')];function createListener(_0x473fd7,_0x455e17){return function(_0x28e41e){_0x455e17[_0x1fad('0x3')](_0x473fd7,_0x28e41e);if(_0x473fd7==='user-setting:update'){_0x455e17[_0x1fad('0x3')]('user-setting:update:user-'+_0x28e41e['UserId'],_0x28e41e);}};}exports[_0x1fad('0x4')]=function(_0x408aa9){for(var _0x15488e=0x0,_0x550b36=events[_0x1fad('0x5')];_0x15488e<_0x550b36;_0x15488e++){var _0x18d8fc=events[_0x15488e];var _0x6f76e4=createListener(_0x1fad('0x6')+_0x18d8fc,_0x408aa9);UserSettingEvents['on'](_0x18d8fc,_0x6f76e4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 5992c5b..428cbda 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 _0x7c7d=['removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/whoami','whoami','getPresence','show','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/agents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root','format','%s-%s','now','originalname','single','file','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addWhatsappAccounts','put','/:id','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x7c7d,0x158));var _0xd7c7=function(_0xb78ee,_0x706ed4){_0xb78ee=_0xb78ee-0x0;var _0x30258b=_0x7c7d[_0xb78ee];return _0x30258b;};'use strict';var multer=require(_0xd7c7('0x0'));var util=require(_0xd7c7('0x1'));var path=require(_0xd7c7('0x2'));var timeout=require(_0xd7c7('0x3'));var express=require(_0xd7c7('0x4'));var router=express[_0xd7c7('0x5')]();var fs_extra=require(_0xd7c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd7c7('0x7'));var config=require(_0xd7c7('0x8'));var controller=require('./user.controller');router['get']('/',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0xa')]);router['get'](_0xd7c7('0xb'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0xc')]);router[_0xd7c7('0xd')](_0xd7c7('0xe'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0xf')]);router[_0xd7c7('0xd')]('/presence',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x10')]);router[_0xd7c7('0xd')]('/:id',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x11')]);router[_0xd7c7('0xd')](_0xd7c7('0x12'),controller['getAvatar']);router[_0xd7c7('0xd')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0xd7c7('0x13')]);router['get'](_0xd7c7('0x14'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x15')]);router[_0xd7c7('0xd')](_0xd7c7('0x16'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x17')]);router[_0xd7c7('0xd')](_0xd7c7('0x18'),auth['isAuthenticated'](),controller[_0xd7c7('0x19')]);router['get'](_0xd7c7('0x1a'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x1b')]);router['get'](_0xd7c7('0x1c'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x1d')]);router['get']('/:id/screen_recordings',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x1e')]);router['get'](_0xd7c7('0x1f'),auth[_0xd7c7('0x9')](),controller['getChatInteractions']);router[_0xd7c7('0xd')]('/:id/openchannel/interactions',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x20')]);router[_0xd7c7('0xd')](_0xd7c7('0x21'),auth['isAuthenticated'](),controller[_0xd7c7('0x22')]);router[_0xd7c7('0xd')](_0xd7c7('0x23'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x24')]);router[_0xd7c7('0xd')](_0xd7c7('0x25'),auth['isAuthenticated'](),controller[_0xd7c7('0x26')]);router[_0xd7c7('0xd')](_0xd7c7('0x27'),auth[_0xd7c7('0x9')](),controller['getWhatsappInteractions']);router[_0xd7c7('0xd')](_0xd7c7('0x28'),auth['isAuthenticated'](),controller['getTeams']);router[_0xd7c7('0xd')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xd7c7('0xd')](_0xd7c7('0x29'),auth[_0xd7c7('0x9')](),controller['getAgents']);router[_0xd7c7('0xd')](_0xd7c7('0x2a'),auth[_0xd7c7('0x9')](),controller['getVoicePrefixes']);router['get'](_0xd7c7('0x2b'),auth['isAuthenticated'](),controller[_0xd7c7('0x2c')]);router[_0xd7c7('0xd')](_0xd7c7('0x2d'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x2e')]);router[_0xd7c7('0xd')](_0xd7c7('0x2f'),auth['isAuthenticated'](),controller[_0xd7c7('0x30')]);router[_0xd7c7('0xd')](_0xd7c7('0x31'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x32')]);router[_0xd7c7('0xd')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xd7c7('0x33')]);router[_0xd7c7('0xd')](_0xd7c7('0x34'),auth[_0xd7c7('0x9')](),controller['getWhatsappAccounts']);router['get'](_0xd7c7('0x35'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x36')]);router[_0xd7c7('0xd')](_0xd7c7('0x37'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x38')]);router[_0xd7c7('0x39')](_0xd7c7('0x14'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x3a')]);router[_0xd7c7('0x39')]('/',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x3b')]);router[_0xd7c7('0x39')](_0xd7c7('0x3c'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x3d')]);router[_0xd7c7('0x39')](_0xd7c7('0x16'),auth['isAuthenticated'](),controller[_0xd7c7('0x3e')]);var upload=multer({'storage':multer[_0xd7c7('0x3f')]({'destination':function(_0x35b25e,_0x4959dc,_0x590ad8){_0x590ad8(null,path['join'](config[_0xd7c7('0x40')],'server/files/images/'));},'filename':function(_0x77ee22,_0x39505b,_0x38eb3){_0x38eb3(null,util[_0xd7c7('0x41')](_0xd7c7('0x42'),Date[_0xd7c7('0x43')](),_0x39505b[_0xd7c7('0x44')]));}})});router[_0xd7c7('0x39')]('/:id/avatar',upload[_0xd7c7('0x45')](_0xd7c7('0x46')),controller['addAvatar']);router[_0xd7c7('0x39')]('/:id/login',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x47')]);router[_0xd7c7('0x39')](_0xd7c7('0x48'),auth['isAuthenticated'](),controller[_0xd7c7('0x49')]);router[_0xd7c7('0x39')]('/:id/pause',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x4a')]);router['post'](_0xd7c7('0x4b'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x4c')]);router[_0xd7c7('0x39')](_0xd7c7('0x28'),auth['isAuthenticated'](),controller[_0xd7c7('0x4d')]);router[_0xd7c7('0x39')](_0xd7c7('0x4e'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x4f')]);router[_0xd7c7('0x39')]('/:id/mail_interactions',auth[_0xd7c7('0x9')](),controller['addMailInteractions']);router['post']('/:id/fax_interactions',auth[_0xd7c7('0x9')](),controller['addFaxInteractions']);router[_0xd7c7('0x39')]('/:id/sms_interactions',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x50')]);router[_0xd7c7('0x39')](_0xd7c7('0x51'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x52')]);router[_0xd7c7('0x39')](_0xd7c7('0x53'),auth['isAuthenticated'](),controller[_0xd7c7('0x54')]);router['post'](_0xd7c7('0x2b'),auth['isAuthenticated'](),controller[_0xd7c7('0x55')]);router[_0xd7c7('0x39')](_0xd7c7('0x2d'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x56')]);router['post'](_0xd7c7('0x2f'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x57')]);router[_0xd7c7('0x39')](_0xd7c7('0x31'),auth[_0xd7c7('0x9')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0xd7c7('0x9')](),controller['addChatWebsites']);router[_0xd7c7('0x39')]('/:id/whatsapp_accounts',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x58')]);router['post'](_0xd7c7('0x37'),auth[_0xd7c7('0x9')](),controller['createApiKey']);router[_0xd7c7('0x59')](_0xd7c7('0x5a'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x5b')]);router[_0xd7c7('0x59')](_0xd7c7('0x5c'),auth['isAuthenticated'](),controller[_0xd7c7('0x5d')]);router[_0xd7c7('0x5e')]('/:id/queues',auth[_0xd7c7('0x9')](),controller['removeQueues']);router[_0xd7c7('0x5e')](_0xd7c7('0x28'),auth['isAuthenticated'](),controller[_0xd7c7('0x5f')]);router[_0xd7c7('0x5e')](_0xd7c7('0x5a'),auth['isAuthenticated'](),controller[_0xd7c7('0x60')]);router[_0xd7c7('0x5e')]('/:id/chat_interactions',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x61')]);router['delete']('/:id/mail_interactions',auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x62')]);router[_0xd7c7('0x5e')](_0xd7c7('0x63'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x64')]);router[_0xd7c7('0x5e')](_0xd7c7('0x65'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete'](_0xd7c7('0x51'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x66')]);router['delete'](_0xd7c7('0x53'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete'](_0xd7c7('0x2b'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x67')]);router['delete'](_0xd7c7('0x2d'),auth['isAuthenticated'](),controller[_0xd7c7('0x68')]);router['delete'](_0xd7c7('0x2f'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x69')]);router[_0xd7c7('0x5e')](_0xd7c7('0x31'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x6a')]);router[_0xd7c7('0x5e')](_0xd7c7('0x6b'),auth['isAuthenticated'](),controller[_0xd7c7('0x6c')]);router[_0xd7c7('0x5e')](_0xd7c7('0x34'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0xd7c7('0x37'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x6d')]);router[_0xd7c7('0x39')](_0xd7c7('0x6e'),auth[_0xd7c7('0x9')](),controller[_0xd7c7('0x6f')]);module[_0xd7c7('0x70')]=router; \ No newline at end of file +var _0xbde2=['now','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','update','removeQueues','delete','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeWhatsappAccounts','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','format','%s-%s'];(function(_0x22a4cc,_0x5731e4){var _0x27bb2f=function(_0x282372){while(--_0x282372){_0x22a4cc['push'](_0x22a4cc['shift']());}};_0x27bb2f(++_0x5731e4);}(_0xbde2,0x111));var _0x2bde=function(_0x391e60,_0x3fb454){_0x391e60=_0x391e60-0x0;var _0xc95b4e=_0xbde2[_0x391e60];return _0xc95b4e;};'use strict';var multer=require(_0x2bde('0x0'));var util=require(_0x2bde('0x1'));var path=require(_0x2bde('0x2'));var timeout=require(_0x2bde('0x3'));var express=require(_0x2bde('0x4'));var router=express[_0x2bde('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2bde('0x6'));var interaction=require(_0x2bde('0x7'));var config=require(_0x2bde('0x8'));var controller=require(_0x2bde('0x9'));router[_0x2bde('0xa')]('/',auth[_0x2bde('0xb')](),controller[_0x2bde('0xc')]);router[_0x2bde('0xa')]('/describe',auth[_0x2bde('0xb')](),controller[_0x2bde('0xd')]);router[_0x2bde('0xa')](_0x2bde('0xe'),auth[_0x2bde('0xb')](),controller['whoami']);router[_0x2bde('0xa')](_0x2bde('0xf'),auth['isAuthenticated'](),controller['getPresence']);router[_0x2bde('0xa')](_0x2bde('0x10'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x11')]);router[_0x2bde('0xa')](_0x2bde('0x12'),controller[_0x2bde('0x13')]);router[_0x2bde('0xa')](_0x2bde('0x14'),auth['isAuthenticated'](),controller[_0x2bde('0x15')]);router[_0x2bde('0xa')](_0x2bde('0x16'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x17')]);router['get'](_0x2bde('0x18'),auth['isAuthenticated'](),controller['getQueues']);router[_0x2bde('0xa')]('/:id/queues_rt',auth[_0x2bde('0xb')](),controller['getVoiceQueuesRt']);router[_0x2bde('0xa')](_0x2bde('0x19'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x1a')]);router['get'](_0x2bde('0x1b'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x1c')]);router[_0x2bde('0xa')](_0x2bde('0x1d'),auth['isAuthenticated'](),controller[_0x2bde('0x1e')]);router[_0x2bde('0xa')](_0x2bde('0x1f'),auth[_0x2bde('0xb')](),controller['getChatInteractions']);router[_0x2bde('0xa')](_0x2bde('0x20'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x21')]);router[_0x2bde('0xa')](_0x2bde('0x22'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x23')]);router[_0x2bde('0xa')](_0x2bde('0x24'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x25')]);router[_0x2bde('0xa')](_0x2bde('0x26'),auth['isAuthenticated'](),controller[_0x2bde('0x27')]);router[_0x2bde('0xa')](_0x2bde('0x28'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x2bde('0xa')](_0x2bde('0x29'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x2a')]);router[_0x2bde('0xa')](_0x2bde('0x2b'),auth[_0x2bde('0xb')](),controller['getLists']);router[_0x2bde('0xa')](_0x2bde('0x2c'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x2d')]);router[_0x2bde('0xa')](_0x2bde('0x2e'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x2f')]);router['get'](_0x2bde('0x30'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x31')]);router['get'](_0x2bde('0x32'),auth[_0x2bde('0xb')](),controller['getMailAccounts']);router['get'](_0x2bde('0x33'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x34')]);router[_0x2bde('0xa')]('/:id/sms_accounts',auth[_0x2bde('0xb')](),controller[_0x2bde('0x35')]);router['get'](_0x2bde('0x36'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x37')]);router['get']('/:id/whatsapp_accounts',auth[_0x2bde('0xb')](),controller[_0x2bde('0x38')]);router[_0x2bde('0xa')]('/:id/scheduled_calls',auth[_0x2bde('0xb')](),controller[_0x2bde('0x39')]);router[_0x2bde('0xa')](_0x2bde('0x3a'),auth[_0x2bde('0xb')](),controller['getApiKey']);router[_0x2bde('0x3b')](_0x2bde('0x16'),auth['isAuthenticated'](),controller[_0x2bde('0x3c')]);router[_0x2bde('0x3b')]('/',auth['isAuthenticated'](),controller[_0x2bde('0x3d')]);router[_0x2bde('0x3b')](_0x2bde('0x3e'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x3f')]);router['post'](_0x2bde('0x18'),auth[_0x2bde('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2bde('0x40')]({'destination':function(_0x346135,_0x17ce8b,_0x5e61b7){_0x5e61b7(null,path[_0x2bde('0x41')](config[_0x2bde('0x42')],'server/files/images/'));},'filename':function(_0x50c652,_0x367ff3,_0x18120d){_0x18120d(null,util[_0x2bde('0x43')](_0x2bde('0x44'),Date[_0x2bde('0x45')](),_0x367ff3[_0x2bde('0x46')]));}})});router[_0x2bde('0x3b')](_0x2bde('0x12'),upload[_0x2bde('0x47')](_0x2bde('0x48')),controller[_0x2bde('0x49')]);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0x2bde('0x4a')]);router[_0x2bde('0x3b')](_0x2bde('0x4b'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x4c')]);router[_0x2bde('0x3b')](_0x2bde('0x4d'),auth[_0x2bde('0xb')](),controller['pause']);router[_0x2bde('0x3b')](_0x2bde('0x4e'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x4f')]);router['post'](_0x2bde('0x29'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x50')]);router['post'](_0x2bde('0x51'),auth[_0x2bde('0xb')](),controller['addChatInteractions']);router[_0x2bde('0x3b')](_0x2bde('0x52'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x53')]);router['post']('/:id/fax_interactions',auth[_0x2bde('0xb')](),controller[_0x2bde('0x54')]);router[_0x2bde('0x3b')]('/:id/sms_interactions',auth[_0x2bde('0xb')](),controller[_0x2bde('0x55')]);router[_0x2bde('0x3b')](_0x2bde('0x56'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x57')]);router['post'](_0x2bde('0x58'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x59')]);router[_0x2bde('0x3b')](_0x2bde('0x30'),auth['isAuthenticated'](),controller[_0x2bde('0x5a')]);router[_0x2bde('0x3b')](_0x2bde('0x32'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x5b')]);router[_0x2bde('0x3b')](_0x2bde('0x33'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x5c')]);router['post'](_0x2bde('0x5d'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x5e')]);router[_0x2bde('0x3b')](_0x2bde('0x36'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x5f')]);router[_0x2bde('0x3b')](_0x2bde('0x60'),auth['isAuthenticated'](),controller[_0x2bde('0x61')]);router['post']('/:id/api_key',auth[_0x2bde('0xb')](),controller[_0x2bde('0x62')]);router[_0x2bde('0x63')](_0x2bde('0x10'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x64')]);router[_0x2bde('0x63')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router['delete'](_0x2bde('0x18'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x65')]);router['delete']('/:id/teams',auth[_0x2bde('0xb')](),controller['removeTeams']);router[_0x2bde('0x66')](_0x2bde('0x10'),auth['isAuthenticated'](),controller['destroy']);router[_0x2bde('0x66')](_0x2bde('0x51'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x67')]);router[_0x2bde('0x66')]('/:id/mail_interactions',auth[_0x2bde('0xb')](),controller[_0x2bde('0x68')]);router[_0x2bde('0x66')](_0x2bde('0x69'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x6a')]);router[_0x2bde('0x66')]('/:id/sms_interactions',auth[_0x2bde('0xb')](),controller[_0x2bde('0x6b')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x2bde('0x66')]('/:id/whatsapp_interactions',auth[_0x2bde('0xb')](),controller[_0x2bde('0x6c')]);router[_0x2bde('0x66')](_0x2bde('0x30'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x6d')]);router[_0x2bde('0x66')]('/:id/mail_accounts',auth[_0x2bde('0xb')](),controller[_0x2bde('0x6e')]);router[_0x2bde('0x66')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x2bde('0x6f')]);router['delete'](_0x2bde('0x5d'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x2bde('0xb')](),controller['removeChatWebsites']);router['delete'](_0x2bde('0x60'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x70')]);router['delete'](_0x2bde('0x3a'),auth[_0x2bde('0xb')](),controller[_0x2bde('0x71')]);router[_0x2bde('0x3b')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller['messengerSoundNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index d85bcf4..e685433 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 _0x3948=['join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','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','always','accept','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','TEXT','get','isArray','encryption','avpf','dtlssetup','dtlscertfile','rtcp_mux','force_avp','dtlsenable','dtlsverify','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','fullname','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','admin','user','local','internal','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','ENUM','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport'];(function(_0x36f1b9,_0x64bb99){var _0x11280d=function(_0x3a0601){while(--_0x3a0601){_0x36f1b9['push'](_0x36f1b9['shift']());}};_0x11280d(++_0x64bb99);}(_0x3948,0x93));var _0x8394=function(_0x209b37,_0x19f075){_0x209b37=_0x209b37-0x0;var _0x1d8b90=_0x3948[_0x209b37];return _0x1d8b90;};'use strict';var Sequelize=require(_0x8394('0x0'));var moment=require(_0x8394('0x1'));var util=require(_0x8394('0x2'));var _=require('lodash');module[_0x8394('0x3')]={'name':{'type':Sequelize[_0x8394('0x4')],'allowNull':![],'unique':_0x8394('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4ce966){this[_0x8394('0x6')](_0x8394('0x5'),_0x4ce966);this['setDataValue'](_0x8394('0x7'),_0x4ce966);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4e5afe){this[_0x8394('0x6')](_0x8394('0x8'),_0x4e5afe);this[_0x8394('0x6')]('callerid',util[_0x8394('0x9')](_0x8394('0xa'),_0x4e5afe,this[_0x8394('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x8394('0x4')]},'email':{'type':Sequelize[_0x8394('0x4')],'allowNull':![],'unique':_0x8394('0xc'),'validate':{'isEmail':!![]},'set':function(_0x224a45){if(_0x224a45){this['setDataValue'](_0x8394('0xc'),_0x224a45[_0x8394('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0x8394('0xe'),_0x8394('0xf'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x8394('0x4')],'defaultValue':_0x8394('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x8394('0x11'),'set':function(_0x4ba95a){this[_0x8394('0x6')](_0x8394('0x11'),_0x4ba95a);this[_0x8394('0x6')](_0x8394('0x12'),_0x4ba95a);this['setDataValue'](_0x8394('0x13'),util[_0x8394('0x9')](_0x8394('0xa'),this[_0x8394('0xb')](_0x8394('0x8')),_0x4ba95a));}},'salt':{'type':Sequelize[_0x8394('0x4')]},'phone':{'type':Sequelize[_0x8394('0x4')]},'mobile':{'type':Sequelize[_0x8394('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x8394('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8394('0x4')]},'country':{'type':Sequelize[_0x8394('0x4')]},'online':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x8394('0x4')],'defaultValue':_0x8394('0x15')},'lastPauseAt':{'type':Sequelize[_0x8394('0x16')]},'chatCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x8394('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x8394('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8394('0x18')},'ipaddr':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x8394('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x1a'),_0x8394('0xf'),_0x8394('0x1b')),'allowNull':!![],'defaultValue':_0x8394('0x1a')},'context':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![],'defaultValue':_0x8394('0x1c')},'callingpres':{'type':Sequelize[_0x8394('0x19')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x8394('0x1d'),_0x8394('0x1e'),_0x8394('0x1f'),_0x8394('0x20'),_0x8394('0x21'),_0x8394('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![],'defaultValue':_0x8394('0x23'),'set':function(_0xba32d1){this[_0x8394('0x6')](_0x8394('0x24'),_0xba32d1?_0xba32d1[_0x8394('0x25')](','):null);},'get':function(){return this[_0x8394('0xb')](_0x8394('0x24'))?this['getDataValue'](_0x8394('0x24'))['split'](','):null;},'comment':_0x8394('0x26')},'dtmfmode':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x27'),_0x8394('0x28'),_0x8394('0x29'),'inband',_0x8394('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no',_0x8394('0x2c'),'update',_0x8394('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8394('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8394('0x2e'),'set':function(_0x30ec9a){this['setDataValue'](_0x8394('0x2f'),_0x30ec9a?_0x30ec9a[_0x8394('0x25')](','):null);},'get':function(){return this[_0x8394('0xb')](_0x8394('0x2f'))?this[_0x8394('0xb')](_0x8394('0x2f'))[_0x8394('0x30')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8394('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8394('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x8394('0x4')]},'language':{'type':Sequelize[_0x8394('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8394('0x4')]},'disallow':{'type':Sequelize[_0x8394('0x4')],'allowNull':![],'defaultValue':_0x8394('0x31')},'allow':{'type':Sequelize[_0x8394('0x4')],'allowNull':![],'defaultValue':_0x8394('0x32'),'set':function(_0x3927e2){this[_0x8394('0x6')](_0x8394('0x33'),_0x3927e2?_0x3927e2[_0x8394('0x25')](';'):_0x8394('0x32'));},'get':function(){return this[_0x8394('0xb')](_0x8394('0x33'))?this[_0x8394('0xb')](_0x8394('0x33'))['split'](';'):null;},'comment':_0x8394('0x34')},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![],'set':function(_0x175996){this[_0x8394('0x6')]('insecure',_0x175996?_0x175996[_0x8394('0x25')](','):null);},'get':function(){return this[_0x8394('0xb')](_0x8394('0x35'))?this[_0x8394('0xb')](_0x8394('0x35'))[_0x8394('0x30')](','):null;},'comment':_0x8394('0x36')},'trustrpid':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no',_0x8394('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x8394('0x2b')},'busylevel':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no',_0x8394('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x8394('0x39'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x3a'),_0x8394('0x3b')),'allowNull':!![],'defaultValue':_0x8394('0x3b')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x8394('0x2b')},'keepalive':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8394('0x19')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x8394('0x2b'),'no',_0x8394('0x3c'),_0x8394('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x8394('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x3e'),_0x8394('0x3f'),_0x8394('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x8394('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x8394('0x19')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no','nonat',_0x8394('0x41'),_0x8394('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x8394('0x16')]},'passwordResetAt':{'type':Sequelize[_0x8394('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x8394('0x43')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4e57ff){this[_0x8394('0x6')]('showWebBar',_0x4e57ff);var _0xe9ac3e=this[_0x8394('0x44')]({'plain':!![]});switch(_0x4e57ff){case 0x0:case 0x1:var _0x246702=_0xe9ac3e[_0x8394('0x24')]?_[_0x8394('0x45')](_0xe9ac3e[_0x8394('0x24')])?_0xe9ac3e[_0x8394('0x24')][_0x8394('0x25')]():_0xe9ac3e[_0x8394('0x24')]:_0x8394('0x23');if(_0x246702==='wss'){_0x246702=_0x8394('0x23');}this[_0x8394('0x6')](_0x8394('0x24'),_0x246702);this[_0x8394('0x6')](_0x8394('0x46'),'no');this[_0x8394('0x6')](_0x8394('0x47'),null);this[_0x8394('0x6')]('force_avp',null);this['setDataValue']('icesupport',null);this[_0x8394('0x6')]('dtlsenable',null);this['setDataValue']('dtlsverify',null);this[_0x8394('0x6')](_0x8394('0x48'),null);this['setDataValue'](_0x8394('0x49'),null);this[_0x8394('0x6')]('dtlsprivatekey',null);this[_0x8394('0x6')](_0x8394('0x4a'),'no');break;case 0x2:this[_0x8394('0x6')](_0x8394('0x24'),'wss');this[_0x8394('0x6')](_0x8394('0x46'),_0x8394('0x2b'));this[_0x8394('0x6')](_0x8394('0x47'),_0x8394('0x2b'));this[_0x8394('0x6')](_0x8394('0x4b'),_0x8394('0x2b'));this[_0x8394('0x6')]('icesupport',_0x8394('0x2b'));this[_0x8394('0x6')](_0x8394('0x4c'),'yes');this[_0x8394('0x6')](_0x8394('0x4d'),'no');this['setDataValue']('dtlssetup',_0x8394('0x40'));this[_0x8394('0x6')](_0x8394('0x49'),_0xe9ac3e[_0x8394('0x49')]||_0x8394('0x4e'));this[_0x8394('0x6')](_0x8394('0x4f'),_0xe9ac3e[_0x8394('0x4f')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x8394('0x4a'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x8394('0x43')],'set':function(_0x56af6a){this[_0x8394('0x6')](_0x8394('0x50'),_0x56af6a?_0x56af6a[_0x8394('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x8394('0x50'))?_[_0x8394('0x51')](this[_0x8394('0xb')]('permissions')[_0x8394('0x30')](','),function(_0x358949){return parseInt(_0x358949,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x8394('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x8394('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x8394('0x19')](_0x8394('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x8394('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x8394('0x52')],'get':function(){return this[_0x8394('0xb')](_0x8394('0x53'))?this['getDataValue'](_0x8394('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x8394('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x8394('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![],'set':function(_0x34b68b){if(typeof _0x34b68b===_0x8394('0x54')){var _0x25a31c=_0x34b68b==='1'?!![]:_0x34b68b==='0'?![]:_0x34b68b===_0x8394('0x55')?!![]:_0x34b68b===_0x8394('0x56')?![]:![];this[_0x8394('0x6')](_0x8394('0x57'),_0x25a31c);}else{this[_0x8394('0x6')](_0x8394('0x57'),_0x34b68b);}}},'blocked':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![],'set':function(_0x452f29){this[_0x8394('0x6')](_0x8394('0x58'),_0x452f29);if(_0x452f29===!![]){this[_0x8394('0x6')](_0x8394('0x59'),moment());this[_0x8394('0x6')](_0x8394('0x5a'),0x0);}else{this[_0x8394('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x8394('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x8394('0x17')](0x5)[_0x8394('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8394('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x8394('0x17')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x8394('0x14')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9a5a=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','callerid','fullname','BOOLEAN','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','never','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','udp','wss','encryption','avpf','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','dtlsenable'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x9a5a,0x1ea));var _0xa9a5=function(_0x175e3a,_0x2b04e1){_0x175e3a=_0x175e3a-0x0;var _0x447a7d=_0x9a5a[_0x175e3a];return _0x447a7d;};'use strict';var Sequelize=require(_0xa9a5('0x0'));var moment=require(_0xa9a5('0x1'));var util=require(_0xa9a5('0x2'));var _=require(_0xa9a5('0x3'));module[_0xa9a5('0x4')]={'name':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3a7890){this[_0xa9a5('0x6')]('name',_0x3a7890);this[_0xa9a5('0x6')](_0xa9a5('0x7'),_0x3a7890);},'comment':_0xa9a5('0x8')},'fullname':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'set':function(_0x1f114e){this[_0xa9a5('0x6')]('fullname',_0x1f114e);this[_0xa9a5('0x6')]('callerid',util[_0xa9a5('0x9')](_0xa9a5('0xa'),_0x1f114e,this[_0xa9a5('0xb')](_0xa9a5('0xc'))));}},'alias':{'type':Sequelize[_0xa9a5('0x5')]},'email':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x309cca){if(_0x309cca){this[_0xa9a5('0x6')](_0xa9a5('0xd'),_0x309cca[_0xa9a5('0xe')]());}}},'role':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x10'),_0xa9a5('0x11'),_0xa9a5('0x12'),_0xa9a5('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa9a5('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':![],'unique':_0xa9a5('0xc'),'set':function(_0x2dfd05){this[_0xa9a5('0x6')](_0xa9a5('0xc'),_0x2dfd05);this[_0xa9a5('0x6')](_0xa9a5('0x15'),_0x2dfd05);this[_0xa9a5('0x6')](_0xa9a5('0x16'),util[_0xa9a5('0x9')](_0xa9a5('0xa'),this[_0xa9a5('0xb')](_0xa9a5('0x17')),_0x2dfd05));}},'salt':{'type':Sequelize[_0xa9a5('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xa9a5('0x5')]},'zipcode':{'type':Sequelize[_0xa9a5('0x5')]},'userpic':{'type':Sequelize[_0xa9a5('0x5')]},'city':{'type':Sequelize[_0xa9a5('0x5')]},'country':{'type':Sequelize[_0xa9a5('0x5')]},'online':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa9a5('0x19')]},'voicePause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa9a5('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xa9a5('0x19')]},'chatCapacity':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa9a5('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![],'defaultValue':_0xa9a5('0x1a')},'ipaddr':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa9a5('0x1b'),_0xa9a5('0x11'),_0xa9a5('0x1c')),'allowNull':!![],'defaultValue':_0xa9a5('0x1b')},'context':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![],'defaultValue':_0xa9a5('0x1d')},'callingpres':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x1e'),'ALLOWED_PASSED_SCREEN',_0xa9a5('0x1f'),_0xa9a5('0x20'),_0xa9a5('0x21'),_0xa9a5('0x22'),_0xa9a5('0x23'),_0xa9a5('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x304974){this[_0xa9a5('0x6')](_0xa9a5('0x25'),_0x304974?_0x304974[_0xa9a5('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xa9a5('0x25'))?this['getDataValue'](_0xa9a5('0x25'))[_0xa9a5('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa9a5('0xf')]('rfc2833',_0xa9a5('0x28'),_0xa9a5('0x29'),_0xa9a5('0x2a'),_0xa9a5('0x2b')),'allowNull':!![],'defaultValue':_0xa9a5('0x2c')},'directmedia':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no',_0xa9a5('0x2e'),_0xa9a5('0x2f'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![],'defaultValue':_0xa9a5('0x30'),'set':function(_0x56efe0){this[_0xa9a5('0x6')]('nat',_0x56efe0?_0x56efe0[_0xa9a5('0x26')](','):null);},'get':function(){return this[_0xa9a5('0xb')](_0xa9a5('0x31'))?this['getDataValue'](_0xa9a5('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa9a5('0x5')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xa9a5('0x5')]},'namedpickupgroup':{'type':Sequelize[_0xa9a5('0x5')]},'language':{'type':Sequelize[_0xa9a5('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa9a5('0x5')]},'disallow':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'defaultValue':_0xa9a5('0x32')},'allow':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':![],'defaultValue':_0xa9a5('0x33'),'set':function(_0x216713){this[_0xa9a5('0x6')](_0xa9a5('0x34'),_0x216713?_0x216713[_0xa9a5('0x26')](';'):_0xa9a5('0x33'));},'get':function(){return this[_0xa9a5('0xb')](_0xa9a5('0x34'))?this[_0xa9a5('0xb')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xa9a5('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![],'set':function(_0x2fc2c5){this[_0xa9a5('0x6')](_0xa9a5('0x35'),_0x2fc2c5?_0x2fc2c5[_0xa9a5('0x26')](','):null);},'get':function(){return this[_0xa9a5('0xb')]('insecure')?this[_0xa9a5('0xb')](_0xa9a5('0x35'))[_0xa9a5('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no',_0xa9a5('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xa9a5('0x2d')},'busylevel':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x37'),_0xa9a5('0x38'),_0xa9a5('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x3a'),_0xa9a5('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa9a5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa9a5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa9a5('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no',_0xa9a5('0x3c'),_0xa9a5('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x3e'),_0xa9a5('0x3f'),_0xa9a5('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa9a5('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa9a5('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa9a5('0xf')]('yes','no','nonat',_0xa9a5('0x2f'),_0xa9a5('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa9a5('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xa9a5('0x19')]},'passwordResetAt':{'type':Sequelize[_0xa9a5('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0,'set':function(_0x4dbacd){this[_0xa9a5('0x6')](_0xa9a5('0x42'),_0x4dbacd);var _0x25640c=this['get']({'plain':!![]});switch(_0x4dbacd){case 0x0:case 0x1:var _0x2f724e=_0x25640c['transport']?_[_0xa9a5('0x43')](_0x25640c[_0xa9a5('0x25')])?_0x25640c['transport'][_0xa9a5('0x26')]():_0x25640c[_0xa9a5('0x25')]:_0xa9a5('0x44');if(_0x2f724e===_0xa9a5('0x45')){_0x2f724e=_0xa9a5('0x44');}this[_0xa9a5('0x6')](_0xa9a5('0x25'),_0x2f724e);this['setDataValue'](_0xa9a5('0x46'),'no');this[_0xa9a5('0x6')](_0xa9a5('0x47'),null);this[_0xa9a5('0x6')]('force_avp',null);this[_0xa9a5('0x6')](_0xa9a5('0x48'),null);this[_0xa9a5('0x6')]('dtlsenable',null);this[_0xa9a5('0x6')](_0xa9a5('0x49'),null);this[_0xa9a5('0x6')](_0xa9a5('0x4a'),null);this[_0xa9a5('0x6')](_0xa9a5('0x4b'),null);this[_0xa9a5('0x6')](_0xa9a5('0x4c'),null);this[_0xa9a5('0x6')](_0xa9a5('0x4d'),'no');break;case 0x2:this[_0xa9a5('0x6')]('transport','wss');this[_0xa9a5('0x6')](_0xa9a5('0x46'),'yes');this[_0xa9a5('0x6')](_0xa9a5('0x47'),_0xa9a5('0x2d'));this[_0xa9a5('0x6')](_0xa9a5('0x4e'),'yes');this[_0xa9a5('0x6')]('icesupport',_0xa9a5('0x2d'));this[_0xa9a5('0x6')](_0xa9a5('0x4f'),_0xa9a5('0x2d'));this['setDataValue'](_0xa9a5('0x49'),'no');this['setDataValue'](_0xa9a5('0x4a'),'actpass');this[_0xa9a5('0x6')](_0xa9a5('0x4b'),_0x25640c[_0xa9a5('0x4b')]||_0xa9a5('0x50'));this[_0xa9a5('0x6')]('dtlsprivatekey',_0x25640c[_0xa9a5('0x4c')]||_0xa9a5('0x51'));this['setDataValue'](_0xa9a5('0x4d'),_0xa9a5('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0xa9a5('0x52')],'set':function(_0x1da2c6){this[_0xa9a5('0x6')]('permissions',_0x1da2c6?_0x1da2c6[_0xa9a5('0x26')](','):[]);},'get':function(){return this[_0xa9a5('0xb')](_0xa9a5('0x53'))?_[_0xa9a5('0x54')](this[_0xa9a5('0xb')]('permissions')[_0xa9a5('0x27')](','),function(_0xd0be0d){return parseInt(_0xd0be0d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa9a5('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa9a5('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa9a5('0xf')](_0xa9a5('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa9a5('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa9a5('0x55')],'get':function(){return this[_0xa9a5('0xb')](_0xa9a5('0x56'))?this[_0xa9a5('0xb')](_0xa9a5('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa9a5('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![],'set':function(_0x31127d){if(typeof _0x31127d===_0xa9a5('0x57')){var _0x122c2d=_0x31127d==='1'?!![]:_0x31127d==='0'?![]:_0x31127d===_0xa9a5('0x58')?!![]:_0x31127d===_0xa9a5('0x59')?![]:![];this[_0xa9a5('0x6')](_0xa9a5('0x5a'),_0x122c2d);}else{this[_0xa9a5('0x6')]('screenrecording',_0x31127d);}}},'blocked':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![],'set':function(_0x3c5f08){this[_0xa9a5('0x6')](_0xa9a5('0x5b'),_0x3c5f08);if(_0x3c5f08===!![]){this[_0xa9a5('0x6')](_0xa9a5('0x5c'),moment());this['setDataValue'](_0xa9a5('0x5d'),0x0);}else{this['setDataValue'](_0xa9a5('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0xa9a5('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa9a5('0x14')](0x5)[_0xa9a5('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xa9a5('0x18')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xa9a5('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 3858510..5e3e6c6 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 _0xd085=['LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','Team','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','Voice','UserVoicePrefix','VoicePrefixId','getDataValue','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','getLists','getAgents','values','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$contains','$any','CmHopper','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','teams','inbound','flatten','asc','uniqBy','orderBy','voiceStatus','unavailable','busy','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','messengerSoundNotification','enabled','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/environment','../../config/license/util','../../errors/api','handleError','socket.io-emitter','redis','./user.socket','register','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','update','role','agent','emit','userNotification:recalc:','then','get','admin','Users','user','Telephones','telephone','ignore','map','includes','find','destroy','error','stack','send','rawAttributes','type','key','filter','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','name','value','index','getOptions','where','User','query','includeAll','include','userSetting','attributes','push','rows','true','length','dataValues','sms','fax','mail','openchannel','catch','show','merge','options','whatsapp','all','body','params','describe','addContacts','ids','Setting','findById','securePassword','max','internal','isNil','min_internal','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','106','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','userProfileId','Agents','autoAssociation','UserProfileResource','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','UserProfileSection','findAll','isEmpty','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','enforcePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','capitalize','toLowerCase','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Queues','isArray','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','chat','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','hasOwnProperty','CmList','List','Tag','color','tag','model','keys','filters','intersection','order','sort','pick','Unknown\x20role','nolimit','Queue','getVoiceQueuesRt','fields','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','PAUSE'];(function(_0xc483a,_0x6894af){var _0x29a00=function(_0x1af000){while(--_0x1af000){_0xc483a['push'](_0xc483a['shift']());}};_0x29a00(++_0x6894af);}(_0xd085,0x8d));var _0x5d08=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xd085[_0x562f3b];return _0x1edd55;};'use strict';var moment=require('moment');var util=require(_0x5d08('0x0'));var path=require(_0x5d08('0x1'));var fs=require('fs');var _=require(_0x5d08('0x2'));var squel=require(_0x5d08('0x3'));var Redis=require(_0x5d08('0x4'));var authService=require('../../components/auth/service');var contacts=require(_0x5d08('0x5'));var qs=require(_0x5d08('0x6'));var rta=require(_0x5d08('0x7'));var logger=require(_0x5d08('0x8'))(_0x5d08('0x9'));var utils=require('../../config/utils');var config=require(_0x5d08('0xa'));var licenseUtil=require(_0x5d08('0xb'));var APIBadRequestError=require(_0x5d08('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0x5d08('0xc'))['APINotFoundError'];var APIHandleError=require(_0x5d08('0xc'))[_0x5d08('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x5d08('0xe'))(new Redis(config[_0x5d08('0xf')]));require(_0x5d08('0x10'))[_0x5d08('0x11')](socket);config[_0x5d08('0xf')]=_[_0x5d08('0x12')](config[_0x5d08('0xf')],{'host':_0x5d08('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x3c9a4e,_0x45aac7){_0x45aac7=_0x45aac7||0xcc;return function(_0x4f124f){if(_0x4f124f){return _0x3c9a4e[_0x5d08('0x14')](_0x45aac7);}return _0x3c9a4e[_0x5d08('0x15')](_0x45aac7)[_0x5d08('0x16')]();};}function respondWithResult(_0x5caabe,_0x37fb0e){_0x37fb0e=_0x37fb0e||0xc8;return function(_0x377220){if(_0x377220){return _0x5caabe[_0x5d08('0x15')](_0x37fb0e)[_0x5d08('0x17')](_0x377220);}};}function respondWithFilteredResult(_0x2ba462,_0x75d979){return function(_0xdbabba){if(_0xdbabba){var _0x43b856=typeof _0x75d979[_0x5d08('0x18')]===_0x5d08('0x19')&&typeof _0x75d979[_0x5d08('0x1a')]==='undefined';var _0x29124a=_0xdbabba[_0x5d08('0x1b')];var _0x9900ed=_0x43b856?0x0:_0x75d979[_0x5d08('0x18')];var _0x1174ac=_0x43b856?_0xdbabba[_0x5d08('0x1b')]:_0x75d979[_0x5d08('0x18')]+_0x75d979[_0x5d08('0x1a')];var _0x33a37e;if(_0x1174ac>=_0x29124a){_0x1174ac=_0x29124a;_0x33a37e=0xc8;}else{_0x33a37e=0xce;}_0x2ba462['status'](_0x33a37e);return _0x2ba462[_0x5d08('0x1c')]('Content-Range',_0x9900ed+'-'+_0x1174ac+'/'+_0x29124a)[_0x5d08('0x17')](_0xdbabba);}return null;};}function saveUpdates(_0x19f2bc){return function(_0x22075c){if(_0x22075c){return _0x22075c[_0x5d08('0x1d')](_0x19f2bc)['then'](function(_0x1dc19a){if(_0x1dc19a[_0x5d08('0x1e')]===_0x5d08('0x1f')){socket[_0x5d08('0x20')](_0x5d08('0x21')+_0x1dc19a['id'],_0x1dc19a);}return _0x1dc19a;});}return null;};}function removeEntity(_0x4b360c){return function(_0x39bed6){if(_0x39bed6){return _0x39bed6['destroy']()[_0x5d08('0x22')](function(){var _0x437bca=_0x39bed6[_0x5d08('0x23')]({'plain':!![]});if(_0x437bca[_0x5d08('0x1e')]===_0x5d08('0x24'))return;var _0xa555fd=[{'name':_0x5d08('0x25'),'value':_0x5d08('0x26'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x5d08('0x27'),'value':_0x5d08('0x28'),'ignore':![]}];var _0x392a9d=_(_0xa555fd)['filter'](_0x5d08('0x29'))[_0x5d08('0x2a')]('value')['value']();if(_[_0x5d08('0x2b')](_0x392a9d,_0x437bca['role'])){return;}var _0x5eebce=_[_0x5d08('0x2c')](_0xa555fd,['value',_0x437bca['role']])['name'];return db['UserProfileResource'][_0x5d08('0x2d')]({'where':{'type':_0x5eebce,'resourceId':_0x437bca['id']}})['then'](function(){return _0x39bed6;});})[_0x5d08('0x22')](function(){_0x4b360c['status'](0xcc)[_0x5d08('0x16')]();});}};}function handleEntityNotFound(_0x41f312){return function(_0x4b224c){if(!_0x4b224c){_0x41f312[_0x5d08('0x14')](0x194);}return _0x4b224c;};}function handleError(_0x33c11f,_0x4c82dd){_0x4c82dd=_0x4c82dd||0x1f4;return function(_0x150cb9){logger[_0x5d08('0x2e')](_0x150cb9[_0x5d08('0x2f')]);if(_0x150cb9['name']){delete _0x150cb9['name'];}_0x33c11f[_0x5d08('0x15')](_0x4c82dd)[_0x5d08('0x30')](_0x150cb9);};}function getUserAttributes(){return _(db['User'][_0x5d08('0x31')])['map'](function(_0x34aaba){return{'name':_0x34aaba['fieldName'],'type':_0x34aaba[_0x5d08('0x32')][_0x5d08('0x33')]};})[_0x5d08('0x34')](function(_0x3e1486){return!['password',_0x5d08('0x35'),_0x5d08('0x36'),_0x5d08('0x37'),_0x5d08('0x38'),_0x5d08('0x39')][_0x5d08('0x2b')](_0x3e1486[_0x5d08('0x3a')]);})[_0x5d08('0x3b')]();}exports[_0x5d08('0x3c')]=function(_0x474241,_0x1677ef){var _0x558590={},_0x34cda5={'count':0x0,'rows':[]};var _0x24fd89=getUserAttributes();_0x558590=qs[_0x5d08('0x3d')](_0x24fd89,_0x474241);var _0x30214f={'where':_0x558590[_0x5d08('0x3e')]};return db[_0x5d08('0x3f')][_0x5d08('0x1b')](_0x30214f)[_0x5d08('0x22')](function(_0x370ebf){_0x34cda5[_0x5d08('0x1b')]=_0x370ebf;if(_0x474241[_0x5d08('0x40')][_0x5d08('0x41')]){_0x558590[_0x5d08('0x42')]=[{'all':!![]}];}if(_0x474241[_0x5d08('0x40')][_0x5d08('0x43')]==='true'){_0x558590[_0x5d08('0x42')]=[{'model':db['UserSetting'],'as':_0x5d08('0x43')}];}if(!_[_0x5d08('0x2b')](_0x558590[_0x5d08('0x44')],'id')){_0x558590[_0x5d08('0x44')][_0x5d08('0x45')]('id');}return db[_0x5d08('0x3f')]['findAll'](_0x558590);})[_0x5d08('0x22')](function(_0x1fc39e){_0x34cda5[_0x5d08('0x46')]=_0x1fc39e;if(_0x474241[_0x5d08('0x40')]['openTabs']===_0x5d08('0x47')){var _0x2c400a=[];for(var _0x543aa9=0x0;_0x543aa9<_0x34cda5[_0x5d08('0x46')][_0x5d08('0x48')];_0x543aa9++){_0x2c400a[_0x5d08('0x45')](get_open_tabs('chat',_0x34cda5[_0x5d08('0x46')][_0x543aa9][_0x5d08('0x49')]));_0x2c400a[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4a'),_0x34cda5[_0x5d08('0x46')][_0x543aa9][_0x5d08('0x49')]));_0x2c400a[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4b'),_0x34cda5[_0x5d08('0x46')][_0x543aa9][_0x5d08('0x49')]));_0x2c400a[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4c'),_0x34cda5[_0x5d08('0x46')][_0x543aa9]['dataValues']));_0x2c400a[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4d'),_0x34cda5[_0x5d08('0x46')][_0x543aa9][_0x5d08('0x49')]));_0x2c400a[_0x5d08('0x45')](get_open_tabs('whatsapp',_0x34cda5[_0x5d08('0x46')][_0x543aa9][_0x5d08('0x49')]));}return Promise['all'](_0x2c400a)[_0x5d08('0x22')](function(){return _0x34cda5;});}else{return _0x34cda5;}})[_0x5d08('0x22')](respondWithFilteredResult(_0x1677ef,_0x558590))[_0x5d08('0x4e')](handleError(_0x1677ef,null));};exports[_0x5d08('0x4f')]=function(_0x3668d5,_0xbb1fa2){var _0x4a5ad3=getUserAttributes();_0x3668d5[_0x5d08('0x40')]['id']=_0x3668d5['params']['id'];var _0x1c2b8c=qs[_0x5d08('0x3d')](_0x4a5ad3,_0x3668d5);if(_0x3668d5['query'][_0x5d08('0x41')]){_0x1c2b8c[_0x5d08('0x42')]=[{'all':!![]}];}if(_0x3668d5[_0x5d08('0x40')][_0x5d08('0x43')]==='true'){_0x1c2b8c[_0x5d08('0x42')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x1c2b8c=_[_0x5d08('0x50')]({},_0x1c2b8c,_0x3668d5[_0x5d08('0x51')]);if(!_['includes'](_0x1c2b8c[_0x5d08('0x44')],'id')){_0x1c2b8c[_0x5d08('0x44')][_0x5d08('0x45')]('id');}return db['User'][_0x5d08('0x2c')](_0x1c2b8c)[_0x5d08('0x22')](handleEntityNotFound(_0xbb1fa2,null))[_0x5d08('0x22')](function(_0x33fab2){var _0x40e43d=[];values=_0x33fab2;if(_0x3668d5[_0x5d08('0x40')]['openTabs']==='true'){_0x40e43d['push'](get_open_tabs('chat',_0x33fab2[_0x5d08('0x49')]));_0x40e43d['push'](get_open_tabs(_0x5d08('0x4a'),_0x33fab2[_0x5d08('0x49')]));_0x40e43d[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4d'),_0x33fab2[_0x5d08('0x49')]));_0x40e43d['push'](get_open_tabs(_0x5d08('0x52'),_0x33fab2['dataValues']));_0x40e43d['push'](get_open_tabs(_0x5d08('0x4b'),_0x33fab2[_0x5d08('0x49')]));_0x40e43d[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4c'),_0x33fab2[_0x5d08('0x49')]));return Promise[_0x5d08('0x53')](_0x40e43d);}else{return values;}})[_0x5d08('0x22')](function(){return values;})[_0x5d08('0x22')](respondWithResult(_0xbb1fa2,null))[_0x5d08('0x4e')](handleError(_0xbb1fa2,null));};exports[_0x5d08('0x1d')]=function(_0x243d86,_0x747971){if(_0x243d86['body']['id']){delete _0x243d86[_0x5d08('0x54')]['id'];}delete _0x243d86[_0x5d08('0x54')][_0x5d08('0x1e')];return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x243d86[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x747971,null))['then'](saveUpdates(_0x243d86[_0x5d08('0x54')],null))['then'](respondWithResult(_0x747971,null))[_0x5d08('0x4e')](handleError(_0x747971,null));};exports[_0x5d08('0x56')]=function(_0x46072f,_0x2efabf){return db[_0x5d08('0x3f')]['describe']()['then'](respondWithResult(_0x2efabf,null))[_0x5d08('0x4e')](handleError(_0x2efabf,null));};exports['addContacts']=function(_0x14ab34,_0x3763ba){return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x14ab34[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x3763ba,null))[_0x5d08('0x22')](function(_0x300d64){if(_0x300d64){return _0x300d64[_0x5d08('0x57')](_0x14ab34[_0x5d08('0x54')][_0x5d08('0x58')],_['omit'](_0x14ab34[_0x5d08('0x54')],[_0x5d08('0x58'),'id'])||{});}})[_0x5d08('0x22')](respondWithResult(_0x3763ba,null))[_0x5d08('0x4e')](handleError(_0x3763ba,null));};function validateUser(_0x2056c2){return new Promise(function(_0x11b09c,_0x33ffc8){if(_0x2056c2['internal'])return _0x11b09c(_0x2056c2);return db[_0x5d08('0x59')][_0x5d08('0x5a')](0x1)[_0x5d08('0x22')](function(_0x22766c){if(_0x22766c[_0x5d08('0x5b')])authService['validatePasswordPattern'](_0x2056c2['password']);db[_0x5d08('0x3f')][_0x5d08('0x5c')](_0x5d08('0x5d'))[_0x5d08('0x22')](function(_0x3674ef){if(_[_0x5d08('0x5e')](_0x3674ef)){_0x2056c2[_0x5d08('0x5d')]=_0x22766c[_0x5d08('0x5f')]||0x1;return;}if(_[_0x5d08('0x5e')](_0x22766c['min_internal'])||_0x22766c[_0x5d08('0x5f')]===_0x3674ef){_0x2056c2['internal']=_0x3674ef+0x1;return;}if(_0x22766c[_0x5d08('0x5f')]>_0x3674ef){_0x2056c2['internal']=_0x22766c[_0x5d08('0x5f')];return;}return db[_0x5d08('0x60')][_0x5d08('0x40')]('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['sequelize'][_0x5d08('0x61')]['SELECT']})[_0x5d08('0x22')](function(_0x44661d){if(_0x44661d&&_0x44661d[_0x5d08('0x48')]){for(var _0x2129ef=0x0,_0x394578=_0x44661d['length'];_0x2129ef<_0x394578&&_[_0x5d08('0x5e')](_0x2056c2['internal']);_0x2129ef++){if(_0x22766c[_0x5d08('0x5f')]<=_0x44661d[_0x2129ef][_0x5d08('0x62')]){_0x2056c2[_0x5d08('0x5d')]=_0x44661d[_0x2129ef][_0x5d08('0x62')];}else if(_0x22766c[_0x5d08('0x5f')]>_0x44661d[_0x2129ef][_0x5d08('0x62')]&&_0x22766c[_0x5d08('0x5f')]<=_0x44661d[_0x2129ef]['to']){_0x2056c2[_0x5d08('0x5d')]=_0x22766c[_0x5d08('0x5f')];}}}if(_[_0x5d08('0x5e')](_0x2056c2[_0x5d08('0x5d')])){_0x2056c2[_0x5d08('0x5d')]=_0x3674ef+0x1;}return _0x11b09c(_0x2056c2);});});})[_0x5d08('0x4e')](function(_0x3244cc){_0x33ffc8(_0x3244cc);});});}function updateUser(_0x3914ab){return new Promise(function(_0x16cbec,_0xd5ceef){try{if(_0x3914ab[_0x5d08('0x63')]){_0x3914ab[_0x5d08('0x64')]=_0x3914ab[_0x5d08('0x5d')];_0x3914ab[_0x5d08('0x65')]={'mailbox':_0x3914ab['internal'],'password':_0x3914ab['password'],'fullname':_0x3914ab[_0x5d08('0x66')],'email':_0x3914ab[_0x5d08('0x67')]};}if(_0x3914ab[_0x5d08('0x1e')]===_0x5d08('0x1f')){if(!_0x3914ab['permissions'])_0x3914ab[_0x5d08('0x68')]=[_0x5d08('0x69'),'102',_0x5d08('0x6a'),_0x5d08('0x6b'),_0x5d08('0x6c'),_0x5d08('0x6d'),_0x5d08('0x6e'),_0x5d08('0x6f'),'107','108',_0x5d08('0x70'),'100',_0x5d08('0x71'),_0x5d08('0x72'),_0x5d08('0x73')];}_0x16cbec(_0x3914ab);}catch(_0x5c7d8a){_0xd5ceef(_0x5c7d8a);}});}exports[_0x5d08('0x74')]=function(_0x5e99cd,_0x173a76){if(_0x5e99cd[_0x5d08('0x26')][_0x5d08('0x1e')]===_0x5d08('0x1f'))throw new Error(_0x5d08('0x75'));if(_0x5e99cd[_0x5d08('0x54')][_0x5d08('0x1e')]===_0x5d08('0x26')&&_0x5e99cd[_0x5d08('0x26')][_0x5d08('0x1e')]!==_0x5d08('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5e99cd[_0x5d08('0x54')][_0x5d08('0x1e')]===_0x5d08('0x24')&&_0x5e99cd[_0x5d08('0x26')][_0x5d08('0x1e')]!==_0x5d08('0x24')){throw new Error(_0x5d08('0x76'));}return licenseUtil['checkUserLimits']([_0x5e99cd[_0x5d08('0x54')]])[_0x5d08('0x22')](function(){return validateUser(_0x5e99cd['body']);})['then'](function(_0x257b17){return updateUser(_0x257b17)['then'](function(_0x50b116){if(_0x50b116[_0x5d08('0x1e')]==='admin'){_0x50b116['settingsEnabled']=_0x5e99cd[_0x5d08('0x26')]['settingsEnabled'];delete _0x50b116[_0x5d08('0x77')];}return _0x50b116;});})['then'](function(_0x2cd35c){return db[_0x5d08('0x3f')]['create'](_0x2cd35c,{'include':[{'model':db[_0x5d08('0x65')],'as':_0x5d08('0x65')}]});})[_0x5d08('0x22')](function(_0x119f0f){if(_0x5e99cd['body']['role']===_0x5d08('0x26'))return _0x119f0f;if(_0x5e99cd[_0x5d08('0x26')][_0x5d08('0x1e')]!==_0x5d08('0x26'))return _0x119f0f;return db['UserProfileSection']['find']({'where':{'name':_0x119f0f[_0x5d08('0x1e')]===_0x5d08('0x1f')?_0x5d08('0x78'):_0x5d08('0x27'),'userProfileId':_0x5e99cd[_0x5d08('0x26')][_0x5d08('0x77')]},'raw':!![]})[_0x5d08('0x22')](function(_0x3d9693){if(!_0x3d9693||_0x3d9693[_0x5d08('0x79')]!=0x0)return _0x119f0f;return db[_0x5d08('0x7a')][_0x5d08('0x74')]({'name':_0x119f0f[_0x5d08('0x3a')],'resourceId':_0x119f0f['id'],'type':_0x3d9693[_0x5d08('0x3a')],'sectionId':_0x3d9693['id']},{})[_0x5d08('0x22')](function(){return _0x119f0f;});})[_0x5d08('0x4e')](function(_0x376e28){logger[_0x5d08('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x376e28);throw _0x376e28;});})['then'](respondWithResult(_0x173a76,0xc9))[_0x5d08('0x4e')](handleError(_0x173a76,null));};exports[_0x5d08('0x7b')]=function(_0x2c495b,_0x29d467){var _0x50887d=_0x2c495b[_0x5d08('0x54')];var _0x38019f=[];if(_0x2c495b[_0x5d08('0x26')]['role']==='agent')throw new Error('Unauthorized');if(_[_0x5d08('0x7c')](_0x50887d,[_0x5d08('0x1e'),'user'])&&_0x2c495b['user'][_0x5d08('0x1e')]!==_0x5d08('0x24')){throw new Error(_0x5d08('0x7d'));}if(_['some'](_0x50887d,['role','admin'])&&_0x2c495b[_0x5d08('0x26')]['role']!==_0x5d08('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x5d08('0x7e')](_0x50887d)[_0x5d08('0x22')](function(){return validateUser(_0x50887d[0x0]);})[_0x5d08('0x22')](function(){for(var _0x2f29df=0x1;_0x2f29df<_0x50887d[_0x5d08('0x48')];_0x2f29df++){var _0x4f6b4a=_0x50887d[_0x2f29df-0x1]['internal'];if(!_0x50887d[_0x2f29df][_0x5d08('0x5d')])_0x50887d[_0x2f29df][_0x5d08('0x5d')]=_0x4f6b4a+0x1;_0x38019f[_0x5d08('0x45')](validateUser(_0x50887d[_0x2f29df]));}return Promise[_0x5d08('0x53')](_0x38019f);})[_0x5d08('0x22')](function(){_0x38019f=[];for(var _0x531784=0x0;_0x531784<_0x50887d[_0x5d08('0x48')];_0x531784++){_0x38019f[_0x5d08('0x45')](updateUser(_0x50887d[_0x531784]));}return Promise[_0x5d08('0x53')](_0x38019f);})[_0x5d08('0x22')](function(){_0x38019f=_0x50887d[_0x5d08('0x2a')](function(_0x3fe215){return db[_0x5d08('0x3f')][_0x5d08('0x74')](_0x3fe215,{'include':[{'model':db[_0x5d08('0x65')],'as':_0x5d08('0x65')}]})[_0x5d08('0x22')](function(_0x34c9b1){_0x3fe215['id']=_0x34c9b1['id'];return _0x3fe215;});});return Promise['all'](_0x38019f);})['then'](function(_0x2cfe63){if(_0x2c495b[_0x5d08('0x54')][_0x5d08('0x1e')]===_0x5d08('0x26'))return _0x2cfe63;if(_0x2c495b[_0x5d08('0x26')]['role']!==_0x5d08('0x26'))return _0x2cfe63;var _0x52ae10=_[_0x5d08('0x7c')](_0x2cfe63,function(_0x14adef){return _0x14adef[_0x5d08('0x1e')]===_0x5d08('0x1f')||_0x14adef[_0x5d08('0x1e')]===_0x5d08('0x28');});if(!_0x52ae10)return _0x2cfe63;return db[_0x5d08('0x7f')][_0x5d08('0x80')]({'where':{'name':{'$or':[_0x5d08('0x78'),_0x5d08('0x27')]},'userProfileId':_0x2c495b[_0x5d08('0x26')][_0x5d08('0x77')]},'raw':!![]})[_0x5d08('0x22')](function(_0x210f00){if(_[_0x5d08('0x81')](_0x210f00)||!_[_0x5d08('0x7c')](_0x210f00,[_0x5d08('0x79'),0x0]))return _0x2cfe63;_0x38019f=[];var _0x591b63=_(_0x210f00)[_0x5d08('0x2a')](function(_0x41b0ba){if(_0x41b0ba[_0x5d08('0x79')]===0x1)return;return _0x41b0ba[_0x5d08('0x3a')]==='Agents'?_0x5d08('0x1f'):'telephone';})['compact']()[_0x5d08('0x3b')]();for(var _0x3491dc=0x0;_0x3491dc<_0x2cfe63[_0x5d08('0x48')];_0x3491dc++){if(!_[_0x5d08('0x2b')](_0x591b63,_0x2cfe63[_0x3491dc]['role']))return;var _0x3f0bb9=_0x2cfe63[_0x3491dc]['role']==='agent'?_0x5d08('0x78'):_0x5d08('0x27');_0x38019f[_0x5d08('0x45')](db['UserProfileResource']['create']({'name':_0x2cfe63[_0x3491dc]['name'],'resourceId':_0x2cfe63[_0x3491dc]['id'],'type':_0x3f0bb9,'sectionId':_[_0x5d08('0x2c')](_0x210f00,[_0x5d08('0x3a'),_0x3f0bb9])['id']},{}));}return Promise[_0x5d08('0x53')](_0x38019f);});})[_0x5d08('0x22')](respondWithResult(_0x29d467,0xc9))[_0x5d08('0x4e')](handleError(_0x29d467,null));};exports['changePassword']=function(_0x93e861,_0x15ba51){if(_0x93e861[_0x5d08('0x54')]['id']){delete _0x93e861['body']['id'];}return db['User']['find']({'where':{'id':_0x93e861[_0x5d08('0x55')]['id']}})['then'](function(_0x41ea41){if(!_0x41ea41)return null;if(_0x41ea41['id']===_0x93e861[_0x5d08('0x26')]['id']){if(!_0x93e861[_0x5d08('0x54')][_0x5d08('0x82')]||!_0x93e861['body'][_0x5d08('0x83')]){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x86'));}if(!_0x41ea41[_0x5d08('0x87')](_0x93e861[_0x5d08('0x54')][_0x5d08('0x82')])){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x88'));}if(_0x93e861[_0x5d08('0x54')][_0x5d08('0x82')]===_0x93e861[_0x5d08('0x54')][_0x5d08('0x83')]){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x93e861[_0x5d08('0x26')][_0x5d08('0x1e')]==='admin'){if(!_0x93e861[_0x5d08('0x54')]['newPassword']){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x89'));}}else if(_0x93e861['user'][_0x5d08('0x1e')]==='user'){if(!_0x93e861[_0x5d08('0x54')][_0x5d08('0x83')]){throw new db['Sequelize'][(_0x5d08('0x85'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x41ea41[_0x5d08('0x1e')]!==_0x5d08('0x1f')){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x75'));}}else{throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x75'));}return _0x41ea41;})[_0x5d08('0x22')](handleEntityNotFound(_0x15ba51,null))['then'](function(_0x123f04){return db[_0x5d08('0x59')]['findOne']({'attributes':['id',_0x5d08('0x5b'),'enforcePasswordHistory',_0x5d08('0x8a')]})['then'](function(_0x1b74aa){if(_0x1b74aa['securePassword'])authService['validatePasswordPattern'](_0x93e861['body']['newPassword']);if(!_0x1b74aa[_0x5d08('0x8b')]||!_0x123f04[_0x5d08('0x36')])return _0x123f04;authService['validatePasswordHistory'](_0x93e861[_0x5d08('0x54')][_0x5d08('0x83')],_0x123f04[_0x5d08('0x36')],_0x1b74aa[_0x5d08('0x8a')]);return _0x123f04;})[_0x5d08('0x22')](saveUpdates({'password':_0x93e861[_0x5d08('0x54')][_0x5d08('0x83')],'passwordResetAt':_0x93e861[_0x5d08('0x26')]['id']==_0x93e861[_0x5d08('0x55')]['id']?moment():null,'previousPasswords':authService[_0x5d08('0x8c')](_0x93e861[_0x5d08('0x54')][_0x5d08('0x83')],_0x123f04[_0x5d08('0x36')])},null));})[_0x5d08('0x22')](respondWithResult(_0x15ba51,null))[_0x5d08('0x4e')](handleError(_0x15ba51,null));};exports[_0x5d08('0x8d')]=function(_0x4ecfbc,_0x2c48c2){var _0x5dc7d3=_0x4ecfbc[_0x5d08('0x54')][_0x5d08('0x8e')];return db['User'][_0x5d08('0x2c')]({'where':{'id':_0x4ecfbc[_0x5d08('0x55')]['id']},'attributes':['id',_0x5d08('0x3a'),_0x5d08('0x1e'),_0x5d08('0x8f'),_0x5d08('0x90'),_0x5d08('0x91'),_0x5d08('0x92')]})[_0x5d08('0x22')](handleEntityNotFound(_0x2c48c2,null))[_0x5d08('0x22')](function(_0x4754f2){if(_0x4754f2){if(!utils['isValidChannel'](_0x5dc7d3)){throw new db['Sequelize'][(_0x5d08('0x85'))](_0x5d08('0x93'));}return _0x4754f2['add'+_[_0x5d08('0x94')](_0x5dc7d3[_0x5d08('0x95')]())+'Queues'](_0x4ecfbc[_0x5d08('0x54')]['ids'],{'penalty':_0x4ecfbc[_0x5d08('0x54')][_0x5d08('0x96')]||0x0})[_0x5d08('0x97')](function(_0x1fdec6){for(var _0x8b0f15=0x0;_0x8b0f15<_0x4ecfbc[_0x5d08('0x54')][_0x5d08('0x58')]['length'];_0x8b0f15+=0x1){var _0x3225f3={'UserId':Number(_0x4ecfbc[_0x5d08('0x55')]['id'])};_0x3225f3[_[_0x5d08('0x94')](_0x5dc7d3[_0x5d08('0x95')]())+_0x5d08('0x98')]=Number(_0x4ecfbc[_0x5d08('0x54')]['ids'][_0x8b0f15]);socket[_0x5d08('0x20')]('user'+_['capitalize'](_0x5dc7d3[_0x5d08('0x95')]())+_0x5d08('0x99'),_0x3225f3);}return _0x1fdec6;})['then'](function(){if(_0x5dc7d3===_0x5d08('0x9a')){return db[_0x5d08('0x9b')]['findAll']({'where':{'id':_0x4ecfbc[_0x5d08('0x54')]['ids']||[]},'raw':!![],'attributes':['id',_0x5d08('0x3a')]});}})[_0x5d08('0x22')](function(_0x2efd16){var _0x27eb9e=_0x4754f2[_0x5d08('0x23')]({'plain':!![]});var _0x342f51=[];if(_0x5dc7d3===_0x5d08('0x9a')&&_0x27eb9e[_0x5d08('0x1e')]===_0x5d08('0x1f')&&_0x27eb9e[_0x5d08('0x8f')]){for(let _0x365a7b=0x0;_0x365a7b<_0x2efd16[_0x5d08('0x48')];_0x365a7b+=0x1){_0x342f51[_0x5d08('0x45')]({'membername':_0x27eb9e[_0x5d08('0x3a')],'UserId':_0x27eb9e['id'],'queue_name':_0x2efd16[_0x365a7b][_0x5d08('0x3a')],'VoiceQueueId':_0x2efd16[_0x365a7b]['id'],'interface':_[_0x5d08('0x5e')](_0x27eb9e[_0x5d08('0x92')])?util[_0x5d08('0x9c')](_0x5d08('0x9d'),_0x27eb9e[_0x5d08('0x3a')]):_0x27eb9e[_0x5d08('0x92')],'paused':_0x27eb9e[_0x5d08('0x91')]||![],'penalty':_0x4ecfbc[_0x5d08('0x54')][_0x5d08('0x96')]||0x0});}return Promise[_0x5d08('0x53')](_0x342f51['map'](function(_0x233500){return db[_0x5d08('0x9e')][_0x5d08('0x9f')](_0x233500);}));}return _0x4754f2;});}})[_0x5d08('0x22')](respondWithStatusCode(_0x2c48c2,null))[_0x5d08('0x4e')](handleError(_0x2c48c2,null));};exports[_0x5d08('0xa0')]=function(_0x4aacce,_0x3d2e16){var _0x322489,_0x4b8bce;return db['User']['find']({'where':{'id':_0x4aacce[_0x5d08('0x55')]['id']},'attributes':['id','name',_0x5d08('0x1e')]})['then'](handleEntityNotFound(_0x3d2e16,null))[_0x5d08('0x22')](function(_0x7778ce){if(_0x7778ce){_0x322489=_0x7778ce;if(!_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')]||!utils[_0x5d08('0xa1')](_0x4aacce[_0x5d08('0x40')]['channel'])){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))]('Unknown\x20channel');}return _0x7778ce['remove'+_['capitalize'](_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')][_0x5d08('0x95')]())+_0x5d08('0xa2')](_0x4aacce[_0x5d08('0x40')][_0x5d08('0x58')]);}})['then'](function(_0x4c24f8){if(_[_0x5d08('0xa3')](_0x4aacce['query'][_0x5d08('0x58')])){for(var _0x22e9d1=0x0;_0x22e9d1<_0x4aacce[_0x5d08('0x40')][_0x5d08('0x58')]['length'];_0x22e9d1+=0x1){_0x4b8bce={'UserId':Number(_0x4aacce[_0x5d08('0x55')]['id'])};_0x4b8bce[_[_0x5d08('0x94')](_0x4aacce[_0x5d08('0x40')]['channel'][_0x5d08('0x95')]())+_0x5d08('0x98')]=Number(_0x4aacce[_0x5d08('0x40')]['ids'][_0x22e9d1]);socket[_0x5d08('0x20')](_0x5d08('0x26')+_['capitalize'](_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')]['toLowerCase']())+_0x5d08('0xa4'),_0x4b8bce);}}else{_0x4b8bce={'UserId':Number(_0x4aacce[_0x5d08('0x55')]['id'])};_0x4b8bce[_[_0x5d08('0x94')](_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')][_0x5d08('0x95')]())+_0x5d08('0x98')]=Number(_0x4aacce['query']['ids']);socket[_0x5d08('0x20')]('user'+_['capitalize'](_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')]['toLowerCase']())+_0x5d08('0xa4'),_0x4b8bce);}return _0x4c24f8;})[_0x5d08('0x22')](function(){if(_0x4aacce[_0x5d08('0x40')][_0x5d08('0x8e')]===_0x5d08('0x9a')){return db[_0x5d08('0x9e')][_0x5d08('0x2d')]({'where':{'UserId':_0x4aacce[_0x5d08('0x55')]['id'],'VoiceQueueId':_0x4aacce['query']['ids']},'individualHooks':!![]})[_0x5d08('0x22')](function(){return _0x322489;});}return _0x322489;})[_0x5d08('0x22')](respondWithStatusCode(_0x3d2e16,null))['catch'](handleError(_0x3d2e16,null));};exports['addAvatar']=function(_0x176145,_0x1105bf){_0x176145[_0x5d08('0x54')][_0x5d08('0xa5')]=_0x176145[_0x5d08('0xa6')][_0x5d08('0xa7')];return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x176145[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0x1105bf,null))[_0x5d08('0x22')](saveUpdates(_0x176145[_0x5d08('0x54')],null))[_0x5d08('0x22')](respondWithResult(_0x1105bf,null))[_0x5d08('0x4e')](handleError(_0x1105bf,null));};exports[_0x5d08('0xa8')]=function(_0x3e307f,_0x329e8c){var _0x29c2a7=path[_0x5d08('0xa9')](config[_0x5d08('0xaa')],_0x5d08('0xab'));return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x3e307f[_0x5d08('0x55')]['id']},'attributes':['id',_0x5d08('0xa5')],'raw':!![]})[_0x5d08('0x22')](handleEntityNotFound(_0x329e8c,null))[_0x5d08('0x22')](function(_0x2acaea){if(_0x2acaea){if(_[_0x5d08('0x5e')](_0x2acaea[_0x5d08('0xa5')])){return _0x329e8c[_0x5d08('0xac')](_0x29c2a7);}else{if(!fs[_0x5d08('0xad')](path['join'](config['root'],_0x5d08('0xae'),_0x2acaea[_0x5d08('0xa5')]))){return _0x329e8c[_0x5d08('0xac')](_0x29c2a7);}return _0x329e8c[_0x5d08('0xac')](path['join'](config[_0x5d08('0xaa')],_0x5d08('0xae'),_0x2acaea[_0x5d08('0xa5')]));}}})[_0x5d08('0x4e')](handleError(_0x329e8c,null));};exports['getOpenTabs']=function(_0x181665,_0x4ec939){return db[_0x5d08('0x3f')]['find']({'where':{'id':_0x181665[_0x5d08('0x55')]['id']},'attributes':['id']})[_0x5d08('0x22')](handleEntityNotFound(_0x4ec939,null))[_0x5d08('0x22')](function(_0x38cc58){var _0x50c0a3=[];values=_0x38cc58[_0x5d08('0x49')];_0x50c0a3[_0x5d08('0x45')](get_open_tabs(_0x5d08('0xaf'),_0x38cc58[_0x5d08('0x49')]));_0x50c0a3[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4a'),_0x38cc58[_0x5d08('0x49')]));_0x50c0a3[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4d'),_0x38cc58[_0x5d08('0x49')]));_0x50c0a3['push'](get_open_tabs(_0x5d08('0x52'),_0x38cc58['dataValues']));_0x50c0a3[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4b'),_0x38cc58[_0x5d08('0x49')]));_0x50c0a3[_0x5d08('0x45')](get_open_tabs(_0x5d08('0x4c'),_0x38cc58[_0x5d08('0x49')]));return Promise[_0x5d08('0x53')](_0x50c0a3);})[_0x5d08('0x22')](function(_0x3e55a7){if(_0x3e55a7){var _0x17442b=_[_0x5d08('0x2a')](values[_0x5d08('0xb0')],function(_0x5229d4){return{'channel':'CHAT','id':_0x5229d4['id'],'createdAt':_0x5229d4[_0x5d08('0xb1')]};});var _0x5ec631=_[_0x5d08('0x2a')](values[_0x5d08('0xb2')],function(_0x22adc4){return{'channel':_0x5d08('0xb3'),'id':_0x22adc4['id'],'createdAt':_0x22adc4['createdAt']};});var _0x5a07e2=_[_0x5d08('0x2a')](values[_0x5d08('0xb4')],function(_0x200408){return{'channel':_0x5d08('0xb5'),'id':_0x200408['id'],'createdAt':_0x200408['createdAt']};});var _0x4c28c4=_[_0x5d08('0x2a')](values[_0x5d08('0xb6')],function(_0xef1052){return{'channel':_0x5d08('0xb7'),'id':_0xef1052['id'],'createdAt':_0xef1052[_0x5d08('0xb1')]};});var _0xbe5703=_['map'](values['SmsOpenTabs'],function(_0x1f8861){return{'channel':_0x5d08('0xb8'),'id':_0x1f8861['id'],'createdAt':_0x1f8861[_0x5d08('0xb1')]};});var _0x274a6f=_[_0x5d08('0x2a')](values[_0x5d08('0xb9')],function(_0x5ae83a){return{'channel':_0x5d08('0xba'),'id':_0x5ae83a['id'],'createdAt':_0x5ae83a[_0x5d08('0xb1')]};});var _0x5b0533=_[_0x5d08('0xbb')](_0x17442b,_0x5ec631,_0x5a07e2,_0x4c28c4,_0xbe5703,_0x274a6f);var _0x579f84={'count':_0x5b0533[_0x5d08('0x48')],'rows':_0x5b0533};return _0x579f84;}else return null;})[_0x5d08('0x22')](respondWithResult(_0x4ec939,null))['catch'](handleError(_0x4ec939,null));};exports[_0x5d08('0xbc')]=function(_0x3b9b04,_0x5c8b19){var _0x3c05d5={};return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x3b9b04[_0x5d08('0x55')]['id']}})['then'](function(_0x569d59){if(!_0x569d59){throw new APINotFoundError(util[_0x5d08('0x9c')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3b9b04[_0x5d08('0x55')]['id']));}return contacts['describe']();})[_0x5d08('0x22')](function(_0x47bd65){_0x3b9b04[_0x5d08('0x40')][_0x5d08('0x3f')]=_0x3b9b04[_0x5d08('0x55')]['id'];_0x3c05d5=qs[_0x5d08('0x3d')](_0x47bd65,_0x3b9b04);if(_0x3b9b04[_0x5d08('0x40')][_0x5d08('0xbe')](_0x5d08('0x41'))){_0x3c05d5['include']=[{'model':db[_0x5d08('0xbf')],'as':_0x5d08('0xc0'),'required':![]},{'model':db[_0x5d08('0xc1')],'as':'Tags','attributes':['id',_0x5d08('0x3a'),_0x5d08('0xc2')],'where':_0x3b9b04['query'][_0x5d08('0xc3')]?{'id':_0x3b9b04[_0x5d08('0x40')]['tag']}:undefined,'required':_0x3b9b04[_0x5d08('0x40')][_0x5d08('0xc3')]?!![]:![]}];}return contacts[_0x5d08('0x80')](_0x3b9b04['query'],_0x3b9b04[_0x5d08('0x26')],_0x3c05d5,_0x47bd65);})[_0x5d08('0x22')](respondWithFilteredResult(_0x5c8b19,_0x3c05d5))[_0x5d08('0x4e')](APIHandleError(_0x5c8b19));};exports['getQueues']=function(_0x52090f,_0x390b19){var _0x4e28c0;var _0x5a85b6={};var _0x4c248b;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x52090f['params']['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x390b19,null))[_0x5d08('0x22')](function(_0x240817){if(!utils[_0x5d08('0xa1')](_0x52090f[_0x5d08('0x40')]['channel'])){throw new db[(_0x5d08('0x84'))][(_0x5d08('0x85'))](_0x5d08('0x93'));}_0x4e28c0=_0x240817;var _0x52462a={};_0x52462a[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_['capitalize'](_0x52090f['query'][_0x5d08('0x8e')])+'Queue'][_0x5d08('0x31')]);_0x52462a[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x52090f[_0x5d08('0x40')]);_0x52462a[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x52462a[_0x5d08('0xc4')],_0x52462a[_0x5d08('0x40')]);_0x5a85b6[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x52462a['model'],qs['fields'](_0x52090f[_0x5d08('0x40')]['fields']));_0x5a85b6[_0x5d08('0x44')]=_0x5a85b6[_0x5d08('0x44')][_0x5d08('0x48')]?_0x5a85b6['attributes']:_0x52462a[_0x5d08('0xc4')];_0x5a85b6[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x52090f[_0x5d08('0x40')][_0x5d08('0xc9')]);_0x5a85b6[_0x5d08('0x3e')]=qs['filters'](_[_0x5d08('0xca')](_0x52090f['query'],_0x52462a[_0x5d08('0xc6')]));if(_0x52090f['query']['filter']){_0x5a85b6[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x5a85b6[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x5a85b6['attributes'],function(_0x42a74b){var _0x42703d={};_0x42703d[_0x42a74b]={'$like':'%'+_0x52090f[_0x5d08('0x40')][_0x5d08('0x34')]+'%'};return _0x42703d;})});}_0x5a85b6=_[_0x5d08('0x50')]({},_0x5a85b6,_0x52090f[_0x5d08('0x51')]);switch(_0x4e28c0[_0x5d08('0x1e')]){case _0x5d08('0x24'):return db[_['capitalize'](_0x52090f['query'][_0x5d08('0x8e')])+'Queue']['findAll'](_0x5a85b6);case'user':case _0x5d08('0x1f'):return _0x4e28c0[_0x5d08('0x23')+_[_0x5d08('0x94')](_0x52090f[_0x5d08('0x40')]['channel'])+_0x5d08('0xa2')](_0x5a85b6);default:throw new db[(_0x5d08('0x84'))]['ValidationError'](_0x5d08('0xcb'));}})[_0x5d08('0x22')](function(_0x48244f){_0x4c248b=_0x48244f[_0x5d08('0x48')];if(!_0x52090f[_0x5d08('0x40')]['hasOwnProperty'](_0x5d08('0xcc'))){_0x5a85b6[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x52090f[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x5a85b6[_0x5d08('0x18')]=qs[_0x5d08('0x18')](_0x52090f[_0x5d08('0x40')][_0x5d08('0x18')]);}switch(_0x4e28c0[_0x5d08('0x1e')]){case _0x5d08('0x24'):return db[_[_0x5d08('0x94')](_0x52090f[_0x5d08('0x40')][_0x5d08('0x8e')])+_0x5d08('0xcd')][_0x5d08('0x80')](_0x5a85b6);case _0x5d08('0x26'):case _0x5d08('0x1f'):return _0x4e28c0[_0x5d08('0x23')+_[_0x5d08('0x94')](_0x52090f[_0x5d08('0x40')][_0x5d08('0x8e')])+_0x5d08('0xa2')](_0x5a85b6);}})['then'](function(_0x25c6f9){return{'count':_0x4c248b,'rows':_0x25c6f9};})[_0x5d08('0x22')](respondWithResult(_0x390b19,null))[_0x5d08('0x4e')](handleError(_0x390b19,null));};exports[_0x5d08('0xce')]=function(_0x759aa7,_0x291c35){var _0x278f51={};var _0x30e3cf={};var _0x81072d;var _0x4c11bb;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x759aa7[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0x291c35,null))['then'](function(_0x1a07d4){if(_0x1a07d4){_0x81072d=_0x1a07d4;_0x30e3cf[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0x9e')][_0x5d08('0x31')]);_0x30e3cf[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x759aa7[_0x5d08('0x40')]);_0x30e3cf[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x30e3cf['model'],_0x30e3cf[_0x5d08('0x40')]);_0x278f51[_0x5d08('0x44')]=_['intersection'](_0x30e3cf[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x759aa7[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x278f51['attributes']=_0x278f51['attributes'][_0x5d08('0x48')]?_0x278f51['attributes']:_0x30e3cf[_0x5d08('0xc4')];_0x278f51[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x759aa7['query'][_0x5d08('0xc9')]);_0x278f51[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x759aa7[_0x5d08('0x40')],_0x30e3cf[_0x5d08('0xc6')]));if(_0x759aa7[_0x5d08('0x40')]['filter']){_0x278f51[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x278f51['where'],{'$or':_[_0x5d08('0x2a')](_0x278f51[_0x5d08('0x44')],function(_0x47d33a){var _0x570b8f={};_0x570b8f[_0x47d33a]={'$like':'%'+_0x759aa7[_0x5d08('0x40')][_0x5d08('0x34')]+'%'};return _0x570b8f;})});}_0x278f51=_[_0x5d08('0x50')]({},_0x278f51,_0x759aa7[_0x5d08('0x51')]);return _0x81072d[_0x5d08('0xce')](_0x278f51);}})[_0x5d08('0x22')](function(_0x40730d){if(_0x40730d){_0x4c11bb=_0x40730d[_0x5d08('0x48')];if(!_0x759aa7[_0x5d08('0x40')]['hasOwnProperty'](_0x5d08('0xcc'))){_0x278f51[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x759aa7[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x278f51[_0x5d08('0x18')]=qs[_0x5d08('0x18')](_0x759aa7['query'][_0x5d08('0x18')]);}return _0x81072d['getVoiceQueuesRt'](_0x278f51);}})[_0x5d08('0x22')](function(_0x10e47e){if(_0x10e47e){return _0x10e47e?{'count':_0x4c11bb,'rows':_0x10e47e}:null;}})[_0x5d08('0x22')](respondWithResult(_0x291c35,null))[_0x5d08('0x4e')](handleError(_0x291c35,null));};exports[_0x5d08('0xd0')]=function(_0x1c14f9,_0x25ab8b){var _0x2043ae={};var _0x200de1={};var _0x460a8e;var _0x15283f;return db[_0x5d08('0x3f')]['findOne']({'where':{'id':_0x1c14f9[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x25ab8b,null))[_0x5d08('0x22')](function(_0x146c2b){if(_0x146c2b){_0x460a8e=_0x146c2b;_0x200de1[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0xd1')][_0x5d08('0x31')]);_0x200de1['query']=_['keys'](_0x1c14f9[_0x5d08('0x40')]);_0x200de1[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x200de1[_0x5d08('0xc4')],_0x200de1[_0x5d08('0x40')]);_0x2043ae['attributes']=_['intersection'](_0x200de1[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x1c14f9[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x2043ae['attributes']=_0x2043ae[_0x5d08('0x44')][_0x5d08('0x48')]?_0x2043ae[_0x5d08('0x44')]:_0x200de1[_0x5d08('0xc4')];_0x2043ae[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x1c14f9[_0x5d08('0x40')][_0x5d08('0xc9')]);_0x2043ae[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x1c14f9['query'],_0x200de1[_0x5d08('0xc6')]));if(_0x1c14f9[_0x5d08('0x40')][_0x5d08('0x34')]){_0x2043ae[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x2043ae['where'],{'$or':_[_0x5d08('0x2a')](_0x2043ae['attributes'],function(_0x2b85bd){var _0x2eb1dc={};_0x2eb1dc[_0x2b85bd]={'$like':'%'+_0x1c14f9[_0x5d08('0x40')]['filter']+'%'};return _0x2eb1dc;})});}_0x2043ae=_['merge']({},_0x2043ae,_0x1c14f9['options']);return _0x460a8e[_0x5d08('0xd0')](_0x2043ae);}})['then'](function(_0x420814){if(_0x420814){_0x15283f=_0x420814[_0x5d08('0x48')];if(!_0x1c14f9[_0x5d08('0x40')][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x2043ae[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x1c14f9[_0x5d08('0x40')]['limit']);_0x2043ae['offset']=qs[_0x5d08('0x18')](_0x1c14f9['query'][_0x5d08('0x18')]);}return _0x460a8e[_0x5d08('0xd0')](_0x2043ae);}})[_0x5d08('0x22')](function(_0x564f99){if(_0x564f99){return _0x564f99?{'count':_0x15283f,'rows':_0x564f99}:null;}})[_0x5d08('0x22')](respondWithResult(_0x25ab8b,null))[_0x5d08('0x4e')](handleError(_0x25ab8b,null));};exports[_0x5d08('0xd2')]=function(_0x4008cb,_0x2853ca){var _0x55d2b0={'raw':!![],'where':{}};var _0x47a878={};var _0x9d8683={'count':0x0,'rows':[]};return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x4008cb[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x2853ca,null))[_0x5d08('0x22')](function(_0x3bd999){if(_0x3bd999){_0x47a878['model']=_[_0x5d08('0xc5')](db['VoiceRecording'][_0x5d08('0x31')]);_0x47a878[_0x5d08('0x40')]=_['keys'](_0x4008cb['query']);_0x47a878[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x47a878[_0x5d08('0xc4')],_0x47a878[_0x5d08('0x40')]);_0x55d2b0['attributes']=_[_0x5d08('0xc7')](_0x47a878[_0x5d08('0xc4')],qs['fields'](_0x4008cb['query']['fields']));_0x55d2b0[_0x5d08('0x44')]=_0x55d2b0['attributes'][_0x5d08('0x48')]?_0x55d2b0['attributes']:_0x47a878[_0x5d08('0xc4')];if(!_0x4008cb['query'][_0x5d08('0xbe')]('nolimit')){_0x55d2b0[_0x5d08('0x1a')]=qs['limit'](_0x4008cb[_0x5d08('0x40')]['limit']);_0x55d2b0['offset']=qs[_0x5d08('0x18')](_0x4008cb[_0x5d08('0x40')]['offset']);}_0x55d2b0[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x4008cb[_0x5d08('0x40')]['sort']);_0x55d2b0[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x4008cb[_0x5d08('0x40')],_0x47a878[_0x5d08('0xc6')]));_0x55d2b0[_0x5d08('0x3e')][_0x5d08('0xd3')]=_0x3bd999['id'];if(_0x4008cb[_0x5d08('0x40')]['filter']){_0x55d2b0[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x55d2b0[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x55d2b0[_0x5d08('0x44')],function(_0x23d156){var _0x1a2aa0={};_0x1a2aa0[_0x23d156]={'$like':'%'+_0x4008cb['query'][_0x5d08('0x34')]+'%'};return _0x1a2aa0;})});}_0x55d2b0=_[_0x5d08('0x50')]({},_0x55d2b0,_0x4008cb[_0x5d08('0x51')]);return db['VoiceRecording'][_0x5d08('0x1b')]({'where':_0x55d2b0[_0x5d08('0x3e')]})[_0x5d08('0x22')](function(_0x480049){_0x9d8683['count']=_0x480049;if(_0x4008cb[_0x5d08('0x40')][_0x5d08('0x41')]){_0x55d2b0['include']=[{'all':!![]}];}return db[_0x5d08('0xd4')][_0x5d08('0x80')](_0x55d2b0);})[_0x5d08('0x22')](function(_0x1bbfc3){_0x9d8683[_0x5d08('0x46')]=_0x1bbfc3;return _0x9d8683;});}})[_0x5d08('0x22')](respondWithFilteredResult(_0x2853ca,_0x55d2b0))['catch'](handleError(_0x2853ca,null));};exports[_0x5d08('0xd5')]=function(_0xfd7a2a,_0x2e6208){var _0x1b82e2={'raw':!![],'where':{}};var _0x2dfa95={};var _0xb6c7b2={'count':0x0,'rows':[]};return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0xfd7a2a[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e6208,null))[_0x5d08('0x22')](function(_0x52524e){if(_0x52524e){_0x2dfa95['model']=_[_0x5d08('0xc5')](db[_0x5d08('0xd6')][_0x5d08('0x31')]);_0x2dfa95[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0xfd7a2a[_0x5d08('0x40')]);_0x2dfa95[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x2dfa95[_0x5d08('0xc4')],_0x2dfa95[_0x5d08('0x40')]);_0x1b82e2[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x2dfa95['model'],qs[_0x5d08('0xcf')](_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x1b82e2['attributes']=_0x1b82e2[_0x5d08('0x44')]['length']?_0x1b82e2[_0x5d08('0x44')]:_0x2dfa95[_0x5d08('0xc4')];if(!_0xfd7a2a['query'][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x1b82e2['limit']=qs['limit'](_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x1b82e2[_0x5d08('0x18')]=qs['offset'](_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0x18')]);}_0x1b82e2[_0x5d08('0xc8')]=qs['sort'](_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0xc9')]);_0x1b82e2[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_['pick'](_0xfd7a2a['query'],_0x2dfa95[_0x5d08('0xc6')]));_0x1b82e2[_0x5d08('0x3e')][_0x5d08('0xd3')]=_0x52524e['id'];if(_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0x34')]){_0x1b82e2[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x1b82e2[_0x5d08('0x3e')],{'$or':_['map'](_0x1b82e2['attributes'],function(_0x23c936){var _0x30e3b2={};_0x30e3b2[_0x23c936]={'$like':'%'+_0xfd7a2a['query']['filter']+'%'};return _0x30e3b2;})});}_0x1b82e2=_[_0x5d08('0x50')]({},_0x1b82e2,_0xfd7a2a[_0x5d08('0x51')]);return db['ScreenRecording'][_0x5d08('0x1b')]({'where':_0x1b82e2[_0x5d08('0x3e')]})[_0x5d08('0x22')](function(_0x5bcde3){_0xb6c7b2[_0x5d08('0x1b')]=_0x5bcde3;if(_0xfd7a2a[_0x5d08('0x40')][_0x5d08('0x41')]){_0x1b82e2[_0x5d08('0x42')]=[{'all':!![]}];}return db[_0x5d08('0xd6')]['findAll'](_0x1b82e2);})[_0x5d08('0x22')](function(_0x3b6ba6){_0xb6c7b2['rows']=_0x3b6ba6;return _0xb6c7b2;});}})[_0x5d08('0x22')](respondWithFilteredResult(_0x2e6208,_0x1b82e2))[_0x5d08('0x4e')](handleError(_0x2e6208,null));};exports[_0x5d08('0xd7')]=function(_0x1c0996,_0x7518cd){var _0x37456f={};var _0x25b711={};var _0xda496f;var _0x1d97a4;return db[_0x5d08('0x3f')]['findOne']({'where':{'id':_0x1c0996[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x7518cd,null))['then'](function(_0x81151d){if(_0x81151d){_0xda496f=_0x81151d;_0x25b711[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0xd8')][_0x5d08('0x31')]);_0x25b711[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x1c0996[_0x5d08('0x40')]);_0x25b711[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x25b711[_0x5d08('0xc4')],_0x25b711[_0x5d08('0x40')]);_0x37456f[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x25b711[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x1c0996[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x37456f[_0x5d08('0x44')]=_0x37456f[_0x5d08('0x44')]['length']?_0x37456f[_0x5d08('0x44')]:_0x25b711[_0x5d08('0xc4')];_0x37456f['order']=qs['sort'](_0x1c0996['query'][_0x5d08('0xc9')]);_0x37456f[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x1c0996[_0x5d08('0x40')],_0x25b711[_0x5d08('0xc6')]));if(_0x1c0996[_0x5d08('0x40')][_0x5d08('0x34')]){_0x37456f[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x37456f[_0x5d08('0x3e')],{'$or':_['map'](_0x37456f[_0x5d08('0x44')],function(_0x16fe4e){var _0x871fdc={};_0x871fdc[_0x16fe4e]={'$like':'%'+_0x1c0996['query'][_0x5d08('0x34')]+'%'};return _0x871fdc;})});}_0x37456f=_[_0x5d08('0x50')]({},_0x37456f,_0x1c0996[_0x5d08('0x51')]);return _0xda496f['getChatInteractions'](_0x37456f);}})['then'](function(_0x305dfe){if(_0x305dfe){_0x1d97a4=_0x305dfe[_0x5d08('0x48')];if(!_0x1c0996[_0x5d08('0x40')][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x37456f['limit']=qs[_0x5d08('0x1a')](_0x1c0996[_0x5d08('0x40')]['limit']);_0x37456f[_0x5d08('0x18')]=qs[_0x5d08('0x18')](_0x1c0996[_0x5d08('0x40')]['offset']);}return _0xda496f[_0x5d08('0xd7')](_0x37456f);}})[_0x5d08('0x22')](function(_0x4a44b8){if(_0x4a44b8){return _0x4a44b8?{'count':_0x1d97a4,'rows':_0x4a44b8}:null;}})[_0x5d08('0x22')](respondWithResult(_0x7518cd,null))['catch'](handleError(_0x7518cd,null));};exports[_0x5d08('0xd9')]=function(_0x4f3863,_0x1112cc){var _0x20956a={};var _0x387465={};var _0x34a6f2;var _0xf0f893;return db[_0x5d08('0x3f')]['findOne']({'where':{'id':_0x4f3863[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0x1112cc,null))[_0x5d08('0x22')](function(_0x7b47e3){if(_0x7b47e3){_0x34a6f2=_0x7b47e3;_0x387465[_0x5d08('0xc4')]=_['keys'](db['OpenchannelInteraction'][_0x5d08('0x31')]);_0x387465[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x4f3863[_0x5d08('0x40')]);_0x387465['filters']=_[_0x5d08('0xc7')](_0x387465['model'],_0x387465[_0x5d08('0x40')]);_0x20956a[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x387465['model'],qs['fields'](_0x4f3863[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x20956a['attributes']=_0x20956a[_0x5d08('0x44')]['length']?_0x20956a[_0x5d08('0x44')]:_0x387465[_0x5d08('0xc4')];_0x20956a[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x4f3863['query'][_0x5d08('0xc9')]);_0x20956a[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x4f3863[_0x5d08('0x40')],_0x387465['filters']));if(_0x4f3863[_0x5d08('0x40')]['filter']){_0x20956a[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x20956a[_0x5d08('0x3e')],{'$or':_['map'](_0x20956a[_0x5d08('0x44')],function(_0x1f896c){var _0x59fd57={};_0x59fd57[_0x1f896c]={'$like':'%'+_0x4f3863[_0x5d08('0x40')][_0x5d08('0x34')]+'%'};return _0x59fd57;})});}_0x20956a=_['merge']({},_0x20956a,_0x4f3863[_0x5d08('0x51')]);return _0x34a6f2[_0x5d08('0xd9')](_0x20956a);}})[_0x5d08('0x22')](function(_0x50e474){if(_0x50e474){_0xf0f893=_0x50e474['length'];if(!_0x4f3863['query'][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x20956a[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x4f3863[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x20956a[_0x5d08('0x18')]=qs['offset'](_0x4f3863['query'][_0x5d08('0x18')]);}return _0x34a6f2[_0x5d08('0xd9')](_0x20956a);}})[_0x5d08('0x22')](function(_0x696b5c){if(_0x696b5c){return _0x696b5c?{'count':_0xf0f893,'rows':_0x696b5c}:null;}})[_0x5d08('0x22')](respondWithResult(_0x1112cc,null))[_0x5d08('0x4e')](handleError(_0x1112cc,null));};exports[_0x5d08('0xda')]=function(_0x4edfe8,_0x46a81f){var _0x1a48eb={'raw':!![],'where':{}};var _0x539370={};var _0x489629={'count':0x0,'rows':[]};return db[_0x5d08('0x3f')]['findOne']({'where':{'id':_0x4edfe8['params']['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x46a81f,null))[_0x5d08('0x22')](function(_0x1cdc37){if(_0x1cdc37){_0x539370['model']=_[_0x5d08('0xc5')](db[_0x5d08('0xdb')]['rawAttributes']);_0x539370[_0x5d08('0x40')]=_['keys'](_0x4edfe8[_0x5d08('0x40')]);_0x539370[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x539370['model'],_0x539370['query']);_0x1a48eb[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x539370[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x4edfe8['query'][_0x5d08('0xcf')]));_0x1a48eb[_0x5d08('0x44')]=_0x1a48eb[_0x5d08('0x44')]['length']?_0x1a48eb['attributes']:_0x539370['model'];if(!_0x4edfe8[_0x5d08('0x40')][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x1a48eb['limit']=qs[_0x5d08('0x1a')](_0x4edfe8[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x1a48eb[_0x5d08('0x18')]=qs['offset'](_0x4edfe8['query'][_0x5d08('0x18')]);}_0x1a48eb['order']=qs[_0x5d08('0xc9')](_0x4edfe8[_0x5d08('0x40')]['sort']);_0x1a48eb['where']=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x4edfe8['query'],_0x539370['filters']));_0x1a48eb[_0x5d08('0x3e')][_0x5d08('0xd3')]=_0x1cdc37['id'];if(_0x4edfe8[_0x5d08('0x40')]['filter']){_0x1a48eb[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x1a48eb[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x1a48eb[_0x5d08('0x44')],function(_0x5d7b49){var _0x57439a={};_0x57439a[_0x5d7b49]={'$like':'%'+_0x4edfe8[_0x5d08('0x40')]['filter']+'%'};return _0x57439a;})});}_0x1a48eb=_[_0x5d08('0x50')]({},_0x1a48eb,_0x4edfe8[_0x5d08('0x51')]);return db['MailInteraction'][_0x5d08('0x1b')]({'where':_0x1a48eb[_0x5d08('0x3e')]})[_0x5d08('0x22')](function(_0x2d07b0){_0x489629[_0x5d08('0x1b')]=_0x2d07b0;if(_0x4edfe8[_0x5d08('0x40')][_0x5d08('0x41')]){_0x1a48eb[_0x5d08('0x42')]=[{'all':!![]}];}return db[_0x5d08('0xdb')][_0x5d08('0x80')](_0x1a48eb);})[_0x5d08('0x22')](function(_0xb57a96){_0x489629[_0x5d08('0x46')]=_0xb57a96;return _0x489629;});}})[_0x5d08('0x22')](respondWithFilteredResult(_0x46a81f,_0x1a48eb))[_0x5d08('0x4e')](handleError(_0x46a81f,null));};exports[_0x5d08('0xdc')]=function(_0x4d9703,_0x43cc92){var _0x1d95df={};var _0x409129={};var _0x171bcb;var _0x3e51a1;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x4d9703[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x43cc92,null))[_0x5d08('0x22')](function(_0x58fe38){if(_0x58fe38){_0x171bcb=_0x58fe38;_0x409129[_0x5d08('0xc4')]=_['keys'](db[_0x5d08('0xdd')][_0x5d08('0x31')]);_0x409129['query']=_[_0x5d08('0xc5')](_0x4d9703['query']);_0x409129['filters']=_[_0x5d08('0xc7')](_0x409129[_0x5d08('0xc4')],_0x409129[_0x5d08('0x40')]);_0x1d95df[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x409129[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x4d9703[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x1d95df['attributes']=_0x1d95df['attributes'][_0x5d08('0x48')]?_0x1d95df['attributes']:_0x409129[_0x5d08('0xc4')];_0x1d95df[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x4d9703[_0x5d08('0x40')]['sort']);_0x1d95df['where']=qs[_0x5d08('0xc6')](_['pick'](_0x4d9703['query'],_0x409129[_0x5d08('0xc6')]));if(_0x4d9703[_0x5d08('0x40')]['filter']){_0x1d95df[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x1d95df[_0x5d08('0x3e')],{'$or':_['map'](_0x1d95df[_0x5d08('0x44')],function(_0x5654dd){var _0x1918da={};_0x1918da[_0x5654dd]={'$like':'%'+_0x4d9703[_0x5d08('0x40')][_0x5d08('0x34')]+'%'};return _0x1918da;})});}_0x1d95df=_[_0x5d08('0x50')]({},_0x1d95df,_0x4d9703[_0x5d08('0x51')]);return _0x171bcb[_0x5d08('0xdc')](_0x1d95df);}})['then'](function(_0x35445e){if(_0x35445e){_0x3e51a1=_0x35445e[_0x5d08('0x48')];if(!_0x4d9703['query'][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x1d95df['limit']=qs[_0x5d08('0x1a')](_0x4d9703[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x1d95df[_0x5d08('0x18')]=qs[_0x5d08('0x18')](_0x4d9703[_0x5d08('0x40')][_0x5d08('0x18')]);}return _0x171bcb[_0x5d08('0xdc')](_0x1d95df);}})[_0x5d08('0x22')](function(_0x5e60d6){if(_0x5e60d6){return _0x5e60d6?{'count':_0x3e51a1,'rows':_0x5e60d6}:null;}})[_0x5d08('0x22')](respondWithResult(_0x43cc92,null))[_0x5d08('0x4e')](handleError(_0x43cc92,null));};exports[_0x5d08('0xde')]=function(_0xc45edf,_0x5dcd70){var _0x3b0545={};var _0x1f2bac={};var _0x413e07;var _0x2c80da;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0xc45edf[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x5dcd70,null))[_0x5d08('0x22')](function(_0x5ea521){if(_0x5ea521){_0x413e07=_0x5ea521;_0x1f2bac[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0xdf')]['rawAttributes']);_0x1f2bac[_0x5d08('0x40')]=_['keys'](_0xc45edf[_0x5d08('0x40')]);_0x1f2bac[_0x5d08('0xc6')]=_[_0x5d08('0xc7')](_0x1f2bac[_0x5d08('0xc4')],_0x1f2bac[_0x5d08('0x40')]);_0x3b0545['attributes']=_[_0x5d08('0xc7')](_0x1f2bac[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0xc45edf['query']['fields']));_0x3b0545['attributes']=_0x3b0545[_0x5d08('0x44')][_0x5d08('0x48')]?_0x3b0545[_0x5d08('0x44')]:_0x1f2bac[_0x5d08('0xc4')];_0x3b0545[_0x5d08('0xc8')]=qs['sort'](_0xc45edf[_0x5d08('0x40')][_0x5d08('0xc9')]);_0x3b0545['where']=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0xc45edf['query'],_0x1f2bac[_0x5d08('0xc6')]));if(_0xc45edf[_0x5d08('0x40')][_0x5d08('0x34')]){_0x3b0545[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x3b0545[_0x5d08('0x3e')],{'$or':_['map'](_0x3b0545[_0x5d08('0x44')],function(_0x24c218){var _0x271976={};_0x271976[_0x24c218]={'$like':'%'+_0xc45edf[_0x5d08('0x40')]['filter']+'%'};return _0x271976;})});}_0x3b0545=_[_0x5d08('0x50')]({},_0x3b0545,_0xc45edf[_0x5d08('0x51')]);return _0x413e07[_0x5d08('0xde')](_0x3b0545);}})[_0x5d08('0x22')](function(_0x4fb2e1){if(_0x4fb2e1){_0x2c80da=_0x4fb2e1[_0x5d08('0x48')];if(!_0xc45edf[_0x5d08('0x40')]['hasOwnProperty'](_0x5d08('0xcc'))){_0x3b0545['limit']=qs[_0x5d08('0x1a')](_0xc45edf[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x3b0545['offset']=qs[_0x5d08('0x18')](_0xc45edf['query'][_0x5d08('0x18')]);}return _0x413e07['getFaxInteractions'](_0x3b0545);}})[_0x5d08('0x22')](function(_0x39220b){if(_0x39220b){return _0x39220b?{'count':_0x2c80da,'rows':_0x39220b}:null;}})[_0x5d08('0x22')](respondWithResult(_0x5dcd70,null))[_0x5d08('0x4e')](handleError(_0x5dcd70,null));};exports[_0x5d08('0xe0')]=function(_0x22a94c,_0x531d43){var _0x567dbf={};var _0x481ead={};var _0x540cf3;var _0x371a71;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x22a94c[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x531d43,null))['then'](function(_0x2af69e){if(_0x2af69e){_0x540cf3=_0x2af69e;_0x481ead[_0x5d08('0xc4')]=_['keys'](db[_0x5d08('0xe1')]['rawAttributes']);_0x481ead[_0x5d08('0x40')]=_['keys'](_0x22a94c[_0x5d08('0x40')]);_0x481ead['filters']=_[_0x5d08('0xc7')](_0x481ead[_0x5d08('0xc4')],_0x481ead[_0x5d08('0x40')]);_0x567dbf[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x481ead[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x22a94c[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x567dbf[_0x5d08('0x44')]=_0x567dbf['attributes'][_0x5d08('0x48')]?_0x567dbf['attributes']:_0x481ead[_0x5d08('0xc4')];_0x567dbf[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x22a94c['query'][_0x5d08('0xc9')]);_0x567dbf[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x22a94c[_0x5d08('0x40')],_0x481ead['filters']));if(_0x22a94c[_0x5d08('0x40')][_0x5d08('0x34')]){_0x567dbf[_0x5d08('0x3e')]=_['merge'](_0x567dbf['where'],{'$or':_['map'](_0x567dbf[_0x5d08('0x44')],function(_0x196c69){var _0x167ee4={};_0x167ee4[_0x196c69]={'$like':'%'+_0x22a94c['query']['filter']+'%'};return _0x167ee4;})});}_0x567dbf=_[_0x5d08('0x50')]({},_0x567dbf,_0x22a94c[_0x5d08('0x51')]);return _0x540cf3[_0x5d08('0xe0')](_0x567dbf);}})[_0x5d08('0x22')](function(_0x42fc48){if(_0x42fc48){_0x371a71=_0x42fc48[_0x5d08('0x48')];if(!_0x22a94c['query']['hasOwnProperty'](_0x5d08('0xcc'))){_0x567dbf['limit']=qs[_0x5d08('0x1a')](_0x22a94c[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x567dbf[_0x5d08('0x18')]=qs['offset'](_0x22a94c['query']['offset']);}return _0x540cf3[_0x5d08('0xe0')](_0x567dbf);}})['then'](function(_0x3c5124){if(_0x3c5124){return _0x3c5124?{'count':_0x371a71,'rows':_0x3c5124}:null;}})['then'](respondWithResult(_0x531d43,null))['catch'](handleError(_0x531d43,null));};exports['login']=function(_0x2a91c1,_0x1d0081,_0x5db421){var _0x118a00;var _0x59a9bc;var _0x48aae4;var _0x4e0b33=!_['isNil'](_0x2a91c1[_0x5d08('0x55')]['id'])?_0x2a91c1[_0x5d08('0x55')]['id']:!_['isNil'](_0x2a91c1[_0x5d08('0x26')]['id'])?_0x2a91c1[_0x5d08('0x26')]['id']:null;return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x4e0b33,'role':{'$or':[_0x5d08('0x24'),_0x5d08('0x26'),_0x5d08('0x1f')]}},'attributes':['id',_0x5d08('0x3a'),_0x5d08('0xe2'),_0x5d08('0xe3'),_0x5d08('0x1e'),_0x5d08('0x5d'),'loginInPause']})[_0x5d08('0x22')](function(_0x285a9d){if(_0x285a9d){if(_0x285a9d['role']==='agent'){_0x118a00=_0x285a9d;if(_0x2a91c1['body'][_0x5d08('0x92')]){_0x48aae4=util[_0x5d08('0x9c')]('LOCAL/%s@from-sip/n',_0x118a00[_0x2a91c1[_0x5d08('0x54')][_0x5d08('0x92')]]);}else if(_0x2a91c1['body'][_0x5d08('0xe4')]){_0x48aae4=util['format']('SIP/%s',_0x2a91c1[_0x5d08('0x54')]['intrf']);}else{_0x48aae4=util[_0x5d08('0x9c')]('SIP/%s',_0x118a00[_0x5d08('0x3a')]);}socket['to'](util[_0x5d08('0x9c')](_0x5d08('0xe5'),_0x118a00[_0x5d08('0x3a')]))[_0x5d08('0x20')]('user:forcelogout',{'user':{'id':_0x118a00['id'],'name':_0x118a00['name']},'ip':_0x2a91c1[_0x5d08('0xe6')][_0x5d08('0xe7')]||_0x2a91c1[_0x5d08('0xe8')][_0x5d08('0xe9')]||_0x2a91c1[_0x5d08('0xea')]['remoteAddress']||_0x2a91c1['connection'][_0x5d08('0xea')]['remoteAddress']});return db[_0x5d08('0x9e')][_0x5d08('0x2d')]({'where':{'membername':_0x118a00[_0x5d08('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x5d08('0x22')](function(){if(_0x118a00){return _0x118a00[_0x5d08('0xeb')]({'raw':!![]});}})[_0x5d08('0x22')](function(_0x211582){if(_0x118a00){if(_0x211582){_0x59a9bc=_0x211582;if(_0x59a9bc['length']){var _0x5ac9df=_0x59a9bc[_0x5d08('0x2a')](function(_0xadc220){var _0x3cd63f={'membername':_0x118a00[_0x5d08('0x3a')],'UserId':_0x118a00['id'],'queue_name':_0xadc220[_0x5d08('0x3a')],'VoiceQueueId':_0xadc220['id'],'interface':_0x48aae4,'paused':_0x118a00[_0x5d08('0x90')]||![],'penalty':_0xadc220['UserVoiceQueue.penalty']||0x0};return db[_0x5d08('0x9e')][_0x5d08('0x9f')](_0x3cd63f);});return Promise[_0x5d08('0x53')](_0x5ac9df);}}}})[_0x5d08('0x22')](function(){if(_0x118a00){return db['MemberReport'][_0x5d08('0x80')]({'where':{'membername':_0x118a00['name'],'exitAt':null}});}})[_0x5d08('0x22')](function(_0x2e4765){if(_0x118a00){var _0x4604f7=[];_0x2e4765['forEach'](function(_0x197995){_0x4604f7['push'](_0x197995[_0x5d08('0x1d')]({'exitAt':moment()[_0x5d08('0x9c')](_0x5d08('0xec'))}));});return Promise[_0x5d08('0x53')](_0x4604f7);}})['then'](function(){if(_0x118a00){var _0x3a4d5c=[];var _0x1396be=[];var _0xfd43d0=utils[_0x5d08('0xed')]();var _0x17013e={'membername':_0x118a00[_0x5d08('0x3a')],'interface':_0x48aae4,'enterAt':moment()[_0x5d08('0x9c')](_0x5d08('0xec')),'role':_0x118a00[_0x5d08('0x1e')],'internal':_0x118a00[_0x5d08('0x5d')]};_0xfd43d0[_0x5d08('0xee')](function(_0x31b8f1){_0x3a4d5c[_0x5d08('0x45')](_['merge']({'channel':_0x31b8f1,'type':_0x5d08('0xef'),'data1':_0x2a91c1[_0x5d08('0x54')]['device'],'data2':_0x48aae4},_0x17013e));if(_0x118a00['loginInPause']){_0x1396be[_0x5d08('0x45')](_[_0x5d08('0x50')]({'channel':_0x31b8f1,'type':_0x5d08('0xf0'),'data1':_0x5d08('0xf1')},_0x17013e));}});return db[_0x5d08('0xf2')][_0x5d08('0x7b')](_0x3a4d5c[_0x5d08('0xbb')](_0x1396be),{'individualHooks':!![]});}})[_0x5d08('0x22')](function(){if(_0x118a00){return _0x118a00[_0x5d08('0x1d')]({'online':!![],'lastLoginAt':moment()['format'](_0x5d08('0xec')),'voicePause':_0x118a00[_0x5d08('0x90')]||![],'mailPause':_0x118a00[_0x5d08('0x90')]||![],'chatPause':_0x118a00[_0x5d08('0x90')]||![],'faxPause':_0x118a00['loginInPause']||![],'smsPause':_0x118a00[_0x5d08('0x90')]||![],'openchannelPause':_0x118a00[_0x5d08('0x90')]||![],'whatsappPause':_0x118a00[_0x5d08('0x90')]||![],'pauseType':_0x118a00[_0x5d08('0x90')]?_0x5d08('0xf1'):null,'interface':_0x48aae4,'lastPauseAt':moment()[_0x5d08('0x9c')](_0x5d08('0xec'))});}})[_0x5d08('0x22')](function(_0x26a217){if(_0x2a91c1[_0x5d08('0xf3')]){return _0x5db421();}else{return Promise[_0x5d08('0xf4')](_0x26a217)[_0x5d08('0x22')](respondWithResult(_0x1d0081,null));}})[_0x5d08('0x4e')](handleError(_0x1d0081,null));};exports[_0x5d08('0xf5')]=function(_0x55bbf6,_0x344a8a){var _0x31786d;return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x55bbf6[_0x5d08('0x55')]['id'],'role':_0x5d08('0x1f')},'attributes':['id',_0x5d08('0x3a'),'role']})[_0x5d08('0x22')](handleEntityNotFound(_0x344a8a,null))['then'](function(_0x249f19){if(_0x249f19){_0x31786d=_0x249f19;return db[_0x5d08('0x9e')][_0x5d08('0x2d')]({'where':{'membername':_0x31786d['name']},'individualHooks':!![]});}})[_0x5d08('0x22')](function(){return db[_0x5d08('0xf2')][_0x5d08('0x80')]({'where':{'membername':_0x31786d[_0x5d08('0x3a')],'exitAt':null}});})[_0x5d08('0x22')](function(_0x5d8b2b){var _0x22668c=[];_0x5d8b2b[_0x5d08('0xee')](function(_0x2a480d){_0x22668c['push'](_0x2a480d[_0x5d08('0x1d')]({'exitAt':moment()[_0x5d08('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5d08('0x53')](_0x22668c);})['then'](function(){return _0x31786d[_0x5d08('0x1d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5d08('0x22')](respondWithResult(_0x344a8a,null))[_0x5d08('0x4e')](handleError(_0x344a8a,null));};exports[_0x5d08('0xf6')]=function(_0x1a9990,_0x5d7bc2){var _0x45b6c8;return db[_0x5d08('0x9e')][_0x5d08('0x1d')]({'paused':0x1},{'where':{'UserId':_0x1a9990['params']['id']},'individualHooks':!![]})[_0x5d08('0x22')](function(){return db[_0x5d08('0x3f')][_0x5d08('0x2c')]({'where':{'id':_0x1a9990[_0x5d08('0x55')]['id'],'role':_0x5d08('0x1f')},'attributes':['id','name',_0x5d08('0x1e'),'internal',_0x5d08('0x92'),_0x5d08('0x8f')]});})[_0x5d08('0x22')](handleEntityNotFound(_0x5d7bc2,null))[_0x5d08('0x22')](function(_0x324275){if(_0x324275){_0x45b6c8=_0x324275;return db['MemberReport']['findAll']({'where':{'membername':_0x45b6c8['name'],'type':_0x5d08('0xf0'),'exitAt':null}});}})[_0x5d08('0x22')](function(_0x4940c2){if(_0x4940c2[_0x5d08('0x48')]){var _0x4e5c88=moment()[_0x5d08('0x9c')](_0x5d08('0xec'));for(var _0x85e12=0x0,_0x2b0fda=_0x4940c2[_0x5d08('0x48')];_0x85e12<_0x2b0fda;_0x85e12++){_0x4940c2[_0x85e12]['updateAttributes']({'exitAt':_0x4e5c88});}}})[_0x5d08('0x22')](function(){var _0x309368=[];var _0xf55058=utils[_0x5d08('0xed')]();_0xf55058[_0x5d08('0xee')](function(_0x1eab0f){_0x309368['push']({'channel':_0x1eab0f,'membername':_0x45b6c8[_0x5d08('0x3a')],'interface':_[_0x5d08('0x5e')](_0x45b6c8['interface'])?util[_0x5d08('0x9c')](_0x5d08('0x9d'),_0x45b6c8[_0x5d08('0x3a')]):_0x45b6c8[_0x5d08('0x92')],'type':_0x5d08('0xf0'),'enterAt':moment()[_0x5d08('0x9c')](_0x5d08('0xec')),'data1':_0x1a9990[_0x5d08('0x54')][_0x5d08('0x32')]||_0x5d08('0xf7'),'role':_0x45b6c8[_0x5d08('0x1e')],'internal':_0x45b6c8['internal']});});return db[_0x5d08('0xf2')][_0x5d08('0x7b')](_0x309368,{'individualHooks':!![]});})[_0x5d08('0x22')](function(){return _0x45b6c8['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1a9990['body'][_0x5d08('0x32')]||_0x5d08('0xf7'),'lastPauseAt':moment()[_0x5d08('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x5d08('0x22')](respondWithResult(_0x5d7bc2,null))[_0x5d08('0x4e')](handleError(_0x5d7bc2,null));};exports['unpause']=function(_0x5a38ef,_0x48460e){if(_0x5a38ef[_0x5d08('0x54')][_0x5d08('0x8e')]&&!utils[_0x5d08('0xa1')](_0x5a38ef[_0x5d08('0x54')][_0x5d08('0x8e')])){throw new APIBadRequestError(util[_0x5d08('0x9c')](_0x5d08('0xf8'),_0x5a38ef[_0x5d08('0x54')][_0x5d08('0x8e')]));}return db['User'][_0x5d08('0x2c')]({'where':{'id':_0x5a38ef[_0x5d08('0x55')]['id']},'attributes':['id','name',_0x5d08('0x1e'),_0x5d08('0x5d'),_0x5d08('0x92'),'online',_0x5d08('0x91'),_0x5d08('0xf9'),_0x5d08('0xfa'),_0x5d08('0xfb'),_0x5d08('0xfc'),_0x5d08('0xfd'),'whatsappPause',_0x5d08('0xfe'),_0x5d08('0xff')]})[_0x5d08('0x22')](function(_0x1c7f54){if(!_0x1c7f54){throw new APINotFoundError(util['format'](_0x5d08('0x100'),_0x5a38ef[_0x5d08('0x55')]['id']));}return _0x1c7f54[_0x5d08('0x101')](_0x5a38ef[_0x5d08('0x54')][_0x5d08('0x8e')]);})[_0x5d08('0x22')](respondWithResult(_0x48460e,null))[_0x5d08('0x4e')](APIHandleError(_0x48460e));};exports['getTeams']=function(_0x2a88b7,_0x87981c){var _0x46454d={};var _0x1c95bd={};var _0x2eb6f4;var _0x5cce36;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x2a88b7[_0x5d08('0x55')]['id']}})[_0x5d08('0x22')](handleEntityNotFound(_0x87981c,null))[_0x5d08('0x22')](function(_0x437f70){if(_0x437f70){_0x2eb6f4=_0x437f70;_0x1c95bd[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0x102')][_0x5d08('0x31')]);_0x1c95bd[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x2a88b7[_0x5d08('0x40')]);_0x1c95bd['filters']=_[_0x5d08('0xc7')](_0x1c95bd['model'],_0x1c95bd['query']);_0x46454d[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x1c95bd[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x2a88b7[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x46454d[_0x5d08('0x44')]=_0x46454d[_0x5d08('0x44')][_0x5d08('0x48')]?_0x46454d[_0x5d08('0x44')]:_0x1c95bd[_0x5d08('0xc4')];_0x46454d[_0x5d08('0xc8')]=qs['sort'](_0x2a88b7['query'][_0x5d08('0xc9')]);_0x46454d[_0x5d08('0x3e')]=qs['filters'](_[_0x5d08('0xca')](_0x2a88b7['query'],_0x1c95bd[_0x5d08('0xc6')]));if(_0x2a88b7[_0x5d08('0x40')][_0x5d08('0x34')]){_0x46454d[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x46454d[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x46454d[_0x5d08('0x44')],function(_0x156e14){var _0x70ee0b={};_0x70ee0b[_0x156e14]={'$like':'%'+_0x2a88b7[_0x5d08('0x40')][_0x5d08('0x34')]+'%'};return _0x70ee0b;})});}_0x46454d=_['merge']({},_0x46454d,_0x2a88b7[_0x5d08('0x51')]);return _0x2eb6f4[_0x5d08('0x103')](_0x46454d);}})[_0x5d08('0x22')](function(_0x576e05){if(_0x576e05){_0x5cce36=_0x576e05[_0x5d08('0x48')];if(!_0x2a88b7[_0x5d08('0x40')][_0x5d08('0xbe')](_0x5d08('0xcc'))){_0x46454d[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x2a88b7[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x46454d[_0x5d08('0x18')]=qs[_0x5d08('0x18')](_0x2a88b7[_0x5d08('0x40')][_0x5d08('0x18')]);}return _0x2eb6f4[_0x5d08('0x103')](_0x46454d);}})[_0x5d08('0x22')](function(_0x3d8f12){if(_0x3d8f12){return _0x3d8f12?{'count':_0x5cce36,'rows':_0x3d8f12}:null;}})[_0x5d08('0x22')](respondWithResult(_0x87981c,null))[_0x5d08('0x4e')](handleError(_0x87981c,null));};exports[_0x5d08('0x104')]=function(_0x37167e,_0x28c846){var _0xd7f42=_0x37167e[_0x5d08('0x55')]['id'];var _0x378e78=_0x37167e[_0x5d08('0x54')]?_0x37167e[_0x5d08('0x54')][_0x5d08('0x58')]:null;var _0x259423=[];return Promise['resolve']()[_0x5d08('0x22')](function(){if(!_0x378e78)throw new APIBadRequestError(_0x5d08('0x105'));})[_0x5d08('0x22')](function(){return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0xd7f42}});})[_0x5d08('0x22')](function(_0x3057d1){if(!_0x3057d1)throw new APINotFoundError(util[_0x5d08('0x9c')](_0x5d08('0x100'),_0x37167e[_0x5d08('0x55')]['id']));return db['sequelize'][_0x5d08('0x106')](function(_0x4bedf0){return _0x3057d1[_0x5d08('0x104')](_0x378e78,{'transaction':_0x4bedf0})['then'](function(){return db['Team'][_0x5d08('0x80')]({'where':{'id':{'$in':_0x378e78}}});})[_0x5d08('0x22')](function(_0x22c4a6){var _0x349dda=_[_0x5d08('0x2a')](_0x22c4a6,function(_0x2886e5){return _0x2886e5[_0x5d08('0x107')]();});return Promise[_0x5d08('0x53')](_0x349dda);})[_0x5d08('0x22')](function(_0x413807){_0x259423=_[_0x5d08('0x108')](_0x413807);var _0x2279f1=_[_0x5d08('0x2a')](_0x259423,function(_0x4669cc){return _0x4669cc[_0x5d08('0x109')](_0x3057d1['id'],{'transaction':_0x4bedf0});});return Promise[_0x5d08('0x53')](_0x2279f1);})['then'](function(){if(!_0x3057d1[_0x5d08('0x8f')])return;var _0x19dbaa=_[_0x5d08('0x34')](_0x259423,function(_0x416202){return _0x416202['getDataValue'](_0x5d08('0x8e'))===_0x5d08('0x10a');});var _0x2c2742=_[_0x5d08('0x2a')](_0x19dbaa,function(_0x527344){return db['UserVoiceQueueRt'][_0x5d08('0x9f')]({'membername':_0x3057d1[_0x5d08('0x3a')],'UserId':_0x3057d1['id'],'queue_name':_0x527344['name'],'VoiceQueueId':_0x527344['id'],'interface':_[_0x5d08('0x5e')](_0x3057d1[_0x5d08('0x92')])?util[_0x5d08('0x9c')]('SIP/%s',_0x3057d1['name']):_0x3057d1[_0x5d08('0x92')],'paused':_0x3057d1[_0x5d08('0x91')]||![],'penalty':_0x3057d1[_0x5d08('0x96')]},{'transaction':_0x4bedf0});});return Promise['all'](_0x2c2742);})['then'](function(){return db['TeamVoicePrefix'][_0x5d08('0x80')]({'where':{'teamId':{'$in':_0x378e78}}});})[_0x5d08('0x22')](function(_0xd5d57e){var _0x2dabff=_[_0x5d08('0x2a')](_0xd5d57e,function(_0x781322){return db[_0x5d08('0x10b')][_0x5d08('0x74')]({'UserId':_0x3057d1['id'],'VoicePrefixId':_0x781322[_0x5d08('0x10c')]},{'transaction':_0x4bedf0});});return Promise[_0x5d08('0x53')](_0x2dabff);});});})['then'](function(){for(var _0x41be39=0x0;_0x41be39<_0x259423[_0x5d08('0x48')];_0x41be39++){var _0x23eadc=_0x259423[_0x41be39][_0x5d08('0x10d')](_0x5d08('0x8e'));var _0x23f2b2=_0x23eadc+'QueueId';socket['emit']('user'+_0x23eadc+_0x5d08('0x99'),{'UserId':_0xd7f42,['queueField']:_0x259423[_0x41be39]['id']});}})[_0x5d08('0x22')](respondWithStatusCode(_0x28c846,null))['catch'](APIHandleError(_0x28c846));};exports['removeTeams']=function(_0x3e88d5,_0x3bc515){var _0x376ff9=_0x3e88d5[_0x5d08('0x55')]['id'];var _0x30ad5a=null;if(_0x3e88d5[_0x5d08('0x40')][_0x5d08('0x58')]){_0x30ad5a=_[_0x5d08('0xa3')](_0x3e88d5[_0x5d08('0x40')]['ids'])?_0x3e88d5['query']['ids']:[_0x3e88d5[_0x5d08('0x40')][_0x5d08('0x58')]];}var _0x447fc8=[];return Promise['resolve']()[_0x5d08('0x22')](function(){if(!_0x30ad5a)throw new APIBadRequestError(_0x5d08('0x10e'));})['then'](function(){return db['User']['findOne']({'where':{'id':_0x376ff9}});})['then'](function(_0x29da9f){if(!_0x29da9f)throw new APINotFoundError(util[_0x5d08('0x9c')](_0x5d08('0x100'),_0x3e88d5['params']['id']));return db['sequelize'][_0x5d08('0x106')](function(_0x2d7e70){return _0x29da9f[_0x5d08('0x10f')](_0x30ad5a,{'transaction':_0x2d7e70})[_0x5d08('0x22')](function(){return db[_0x5d08('0x102')]['findAll']({'where':{'id':{'$in':_0x30ad5a}}});})['then'](function(_0x24aaa9){var _0x1837c8=_[_0x5d08('0x2a')](_0x24aaa9,function(_0x92b7a9){return _0x92b7a9[_0x5d08('0x107')]();});return Promise[_0x5d08('0x53')](_0x1837c8);})[_0x5d08('0x22')](function(_0x12fafd){_0x447fc8=_[_0x5d08('0x108')](_0x12fafd);var _0x5e70c1=_[_0x5d08('0x2a')](_0x447fc8,function(_0x4faa78){return _0x4faa78[_0x5d08('0x110')](_0x29da9f['id'],{'transaction':_0x2d7e70});});return Promise[_0x5d08('0x53')](_0x5e70c1);})['then'](function(){if(!_0x29da9f[_0x5d08('0x8f')])return;var _0x4f6f94=_['filter'](_0x447fc8,function(_0x141cc1){return _0x141cc1['getDataValue'](_0x5d08('0x8e'))===_0x5d08('0x10a');});var _0x132939=_['map'](_0x4f6f94,function(_0x19fdf8){return db[_0x5d08('0x9e')][_0x5d08('0x2d')]({'where':{'VoiceQueueId':_0x19fdf8['id'],'UserId':_0x29da9f['id']},'transaction':_0x2d7e70});});return Promise[_0x5d08('0x53')](_0x132939);})[_0x5d08('0x22')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x30ad5a}}});})[_0x5d08('0x22')](function(_0x48b831){var _0x38fe9f=_[_0x5d08('0x2a')](_0x48b831,function(_0x169f90){return db['UserVoicePrefix'][_0x5d08('0x2d')]({'where':{'UserId':_0x29da9f['id'],'VoicePrefixId':_0x169f90[_0x5d08('0x10c')]}},{'transaction':_0x2d7e70});});return Promise[_0x5d08('0x53')](_0x38fe9f);});});})['then'](function(){for(var _0x4db286=0x0;_0x4db286<_0x447fc8[_0x5d08('0x48')];_0x4db286++){var _0x272977=_0x447fc8[_0x4db286][_0x5d08('0x10d')](_0x5d08('0x8e'));var _0x4972b3=_0x272977+'QueueId';socket['emit']('user'+_0x272977+'Queue:remove',{'UserId':_0x376ff9,['queueField']:_0x447fc8[_0x4db286]['id']});}})[_0x5d08('0x22')](respondWithStatusCode(_0x3bc515,null))[_0x5d08('0x4e')](APIHandleError(_0x3bc515));};exports[_0x5d08('0x111')]=function(_0x18c580,_0xf84ddb){var _0x3fefce={};var _0x4f627e={};var _0x128beb;var _0x2dd84f;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x18c580[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0xf84ddb,null))[_0x5d08('0x22')](function(_0x3be355){if(_0x3be355){_0x128beb=_0x3be355;_0x4f627e[_0x5d08('0xc4')]=_[_0x5d08('0xc5')](db[_0x5d08('0xbf')]['rawAttributes']);_0x4f627e[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x18c580['query']);_0x4f627e[_0x5d08('0xc6')]=_['intersection'](_0x4f627e[_0x5d08('0xc4')],_0x4f627e[_0x5d08('0x40')]);_0x3fefce['attributes']=_['intersection'](_0x4f627e[_0x5d08('0xc4')],qs['fields'](_0x18c580[_0x5d08('0x40')][_0x5d08('0xcf')]));_0x3fefce[_0x5d08('0x44')]=_0x3fefce[_0x5d08('0x44')][_0x5d08('0x48')]?_0x3fefce[_0x5d08('0x44')]:_0x4f627e[_0x5d08('0xc4')];_0x3fefce[_0x5d08('0xc8')]=qs['sort'](_0x18c580['query'][_0x5d08('0xc9')]);_0x3fefce[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x18c580['query'],_0x4f627e[_0x5d08('0xc6')]));if(_0x18c580[_0x5d08('0x40')][_0x5d08('0x34')]){_0x3fefce[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x3fefce[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x3fefce[_0x5d08('0x44')],function(_0x36bb18){var _0x230ab9={};_0x230ab9[_0x36bb18]={'$like':'%'+_0x18c580[_0x5d08('0x40')]['filter']+'%'};return _0x230ab9;})});}_0x3fefce=_['merge']({},_0x3fefce,_0x18c580[_0x5d08('0x51')]);return _0x128beb['getLists'](_0x3fefce);}})['then'](function(_0x2387c5){if(_0x2387c5){_0x2dd84f=_0x2387c5[_0x5d08('0x48')];if(!_0x18c580[_0x5d08('0x40')][_0x5d08('0xbe')]('nolimit')){_0x3fefce[_0x5d08('0x1a')]=qs[_0x5d08('0x1a')](_0x18c580[_0x5d08('0x40')][_0x5d08('0x1a')]);_0x3fefce[_0x5d08('0x18')]=qs['offset'](_0x18c580['query']['offset']);}return _0x128beb[_0x5d08('0x111')](_0x3fefce);}})[_0x5d08('0x22')](function(_0x5bb841){if(_0x5bb841){return _0x5bb841?{'count':_0x2dd84f,'rows':_0x5bb841}:null;}})[_0x5d08('0x22')](respondWithResult(_0xf84ddb,null))['catch'](handleError(_0xf84ddb,null));};exports[_0x5d08('0x112')]=function(_0x1ccb0a,_0x599974){var _0x2e0d98={};var _0x4bf761={};var _0x11a6af;return db[_0x5d08('0x3f')][_0x5d08('0xbd')]({'where':{'id':_0x1ccb0a[_0x5d08('0x55')]['id']}})['then'](handleEntityNotFound(_0x599974,null))[_0x5d08('0x22')](function(_0x61411a){if(_0x61411a){_0x11a6af=_0x61411a;_0x4bf761['model']=_[_0x5d08('0xc5')](db['User'][_0x5d08('0x31')]);_0x4bf761[_0x5d08('0x40')]=_[_0x5d08('0xc5')](_0x1ccb0a[_0x5d08('0x40')]);_0x4bf761[_0x5d08('0xc6')]=_['intersection'](_0x4bf761[_0x5d08('0xc4')],_0x4bf761[_0x5d08('0x40')]);_0x2e0d98[_0x5d08('0x44')]=_[_0x5d08('0xc7')](_0x4bf761[_0x5d08('0xc4')],qs[_0x5d08('0xcf')](_0x1ccb0a['query'][_0x5d08('0xcf')]));_0x2e0d98[_0x5d08('0x44')]=_0x2e0d98[_0x5d08('0x44')][_0x5d08('0x48')]?_0x2e0d98[_0x5d08('0x44')]:_0x4bf761['model'];_0x2e0d98[_0x5d08('0xc8')]=qs[_0x5d08('0xc9')](_0x1ccb0a[_0x5d08('0x40')]['sort']);_0x2e0d98[_0x5d08('0x3e')]=qs[_0x5d08('0xc6')](_[_0x5d08('0xca')](_0x1ccb0a[_0x5d08('0x40')],_0x4bf761[_0x5d08('0xc6')]));if(_0x1ccb0a[_0x5d08('0x40')][_0x5d08('0x34')]){_0x2e0d98[_0x5d08('0x3e')]=_[_0x5d08('0x50')](_0x2e0d98[_0x5d08('0x3e')],{'$or':_[_0x5d08('0x2a')](_0x2e0d98[_0x5d08('0x44')],function(_0xecad3d){var _0x1f856f={};_0x1f856f[_0xecad3d]={'$like':'%'+_0x1ccb0a[_0x5d08('0x40')]['filter']+'%'};return _0x1f856f;})});}_0x2e0d98[_0x5d08('0xc4')]=db[_0x5d08('0x3f')];_0x2e0d98['as']=_0x5d08('0x78');_0x2e0d98=_[_0x5d08('0x50')]({},_0x2e0d98,_0x1ccb0a[_0x5d08('0x51')]);return _0x11a6af[_0x5d08('0xeb')]({'include':[_0x2e0d98]});}})['then'](function(_0x36f829){if(_0x36f829){var _0x15855c={},_0x2d6d4c=[];for(var _0x247447=0x0;_0x247447<_0x36f829[_0x5d08('0x48')];_0x247447+=0x1){for(var _0x36cba7=0x0,_0x51d27b;_0x36cba7<_0x36f829[_0x247447][_0x5d08('0x78')][_0x5d08('0x48')];_0x36cba7+=0x1){_0x51d27b=_0x36f829[_0x247447][_0x5d08('0x78')][_0x36cba7][_0x5d08('0x23')]({'plain':!![]});_0x15855c[_0x51d27b['id']]=_0x51d27b;}}_0x15855c=_[_0x5d08('0x113')](_0x15855c);for(var _0x59cc4d=qs[_0x5d08('0x18')](_0x1ccb0a[_0x5d08('0x40')][_0x5d08('0x18')]);_0x59cc4d<_0x15855c[_0x5d08('0x48')]&&_0x2d6d4c[_0x5d08('0x48')]=_0x5b3c7f){_0x7164bd=_0x5b3c7f;_0x2bdd88=0xc8;}else{_0x2bdd88=0xce;}_0x19ae4b[_0x53a5('0x13')](_0x2bdd88);return _0x19ae4b[_0x53a5('0x1a')](_0x53a5('0x1b'),_0x2c8306+'-'+_0x7164bd+'/'+_0x5b3c7f)['json'](_0xe4c814);}return null;};}function saveUpdates(_0x29c397){return function(_0x284777){if(_0x284777){return _0x284777[_0x53a5('0x1c')](_0x29c397)[_0x53a5('0x1d')](function(_0x423577){if(_0x423577['role']===_0x53a5('0x1e')){socket[_0x53a5('0x1f')]('userNotification:recalc:'+_0x423577['id'],_0x423577);}return _0x423577;});}return null;};}function removeEntity(_0x8306d9){return function(_0x11ad30){if(_0x11ad30){return _0x11ad30['destroy']()[_0x53a5('0x1d')](function(){var _0x365a0e=_0x11ad30[_0x53a5('0x20')]({'plain':!![]});if(_0x365a0e[_0x53a5('0x21')]==='admin')return;var _0x51a1db=[{'name':'Users','value':_0x53a5('0x22'),'ignore':!![]},{'name':_0x53a5('0x23'),'value':_0x53a5('0x1e'),'ignore':![]},{'name':_0x53a5('0x24'),'value':_0x53a5('0x25'),'ignore':![]}];var _0x292bdc=_(_0x51a1db)[_0x53a5('0x26')](_0x53a5('0x27'))[_0x53a5('0x28')](_0x53a5('0x29'))[_0x53a5('0x29')]();if(_[_0x53a5('0x2a')](_0x292bdc,_0x365a0e[_0x53a5('0x21')])){return;}var _0x5567a8=_[_0x53a5('0x2b')](_0x51a1db,[_0x53a5('0x29'),_0x365a0e[_0x53a5('0x21')]])[_0x53a5('0x2c')];return db[_0x53a5('0x2d')][_0x53a5('0x2e')]({'where':{'type':_0x5567a8,'resourceId':_0x365a0e['id']}})[_0x53a5('0x1d')](function(){return _0x11ad30;});})['then'](function(){_0x8306d9['status'](0xcc)[_0x53a5('0x14')]();});}};}function handleEntityNotFound(_0x3033fa){return function(_0x117ecf){if(!_0x117ecf){_0x3033fa[_0x53a5('0x2f')](0x194);}return _0x117ecf;};}function handleError(_0x37c579,_0x215f11){_0x215f11=_0x215f11||0x1f4;return function(_0x385369){logger[_0x53a5('0x30')](_0x385369[_0x53a5('0x31')]);if(_0x385369[_0x53a5('0x2c')]){delete _0x385369[_0x53a5('0x2c')];}_0x37c579[_0x53a5('0x13')](_0x215f11)['send'](_0x385369);};}function getUserAttributes(){return _(db[_0x53a5('0x32')][_0x53a5('0x33')])['map'](function(_0x42e037){return{'name':_0x42e037[_0x53a5('0x34')],'type':_0x42e037['type'][_0x53a5('0x35')]};})[_0x53a5('0x26')](function(_0x2cdc31){return![_0x53a5('0x36'),'salt','previousPasswords',_0x53a5('0x37'),'resetPasswordExpires',_0x53a5('0x38')]['includes'](_0x2cdc31[_0x53a5('0x2c')]);})[_0x53a5('0x29')]();}exports[_0x53a5('0x39')]=function(_0x50356b,_0x1db695){var _0x2d5aa8={},_0xb921f={'count':0x0,'rows':[]};var _0x291901=getUserAttributes();_0x2d5aa8=qs[_0x53a5('0x3a')](_0x291901,_0x50356b);var _0x33a798={'where':_0x2d5aa8[_0x53a5('0x3b')]};return db[_0x53a5('0x32')][_0x53a5('0x19')](_0x33a798)[_0x53a5('0x1d')](function(_0xf08045){_0xb921f['count']=_0xf08045;if(_0x50356b[_0x53a5('0x3c')]['includeAll']){_0x2d5aa8[_0x53a5('0x3d')]=[{'all':!![]}];}if(_0x50356b['query'][_0x53a5('0x3e')]==='true'){_0x2d5aa8[_0x53a5('0x3d')]=[{'model':db[_0x53a5('0x3f')],'as':_0x53a5('0x3e')}];}if(!_[_0x53a5('0x2a')](_0x2d5aa8[_0x53a5('0x40')],'id')){_0x2d5aa8[_0x53a5('0x40')][_0x53a5('0x41')]('id');}return db[_0x53a5('0x32')]['findAll'](_0x2d5aa8);})[_0x53a5('0x1d')](function(_0x30474a){_0xb921f[_0x53a5('0x42')]=_0x30474a;if(_0x50356b[_0x53a5('0x3c')]['openTabs']==='true'){var _0x43362f=[];for(var _0xa46ec8=0x0;_0xa46ec8<_0xb921f['rows'][_0x53a5('0x43')];_0xa46ec8++){_0x43362f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x44'),_0xb921f[_0x53a5('0x42')][_0xa46ec8][_0x53a5('0x45')]));_0x43362f['push'](get_open_tabs(_0x53a5('0x46'),_0xb921f['rows'][_0xa46ec8]['dataValues']));_0x43362f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x47'),_0xb921f[_0x53a5('0x42')][_0xa46ec8][_0x53a5('0x45')]));_0x43362f[_0x53a5('0x41')](get_open_tabs('mail',_0xb921f[_0x53a5('0x42')][_0xa46ec8][_0x53a5('0x45')]));_0x43362f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x48'),_0xb921f[_0x53a5('0x42')][_0xa46ec8][_0x53a5('0x45')]));_0x43362f[_0x53a5('0x41')](get_open_tabs('whatsapp',_0xb921f[_0x53a5('0x42')][_0xa46ec8][_0x53a5('0x45')]));}return Promise['all'](_0x43362f)['then'](function(){return _0xb921f;});}else{return _0xb921f;}})[_0x53a5('0x1d')](respondWithFilteredResult(_0x1db695,_0x2d5aa8))[_0x53a5('0x49')](handleError(_0x1db695,null));};exports['show']=function(_0x4c4609,_0x497837){var _0x2d8800=getUserAttributes();_0x4c4609[_0x53a5('0x3c')]['id']=_0x4c4609[_0x53a5('0x4a')]['id'];var _0x4439be=qs[_0x53a5('0x3a')](_0x2d8800,_0x4c4609);if(_0x4c4609[_0x53a5('0x3c')][_0x53a5('0x4b')]){_0x4439be[_0x53a5('0x3d')]=[{'all':!![]}];}if(_0x4c4609[_0x53a5('0x3c')][_0x53a5('0x3e')]==='true'){_0x4439be[_0x53a5('0x3d')]=[{'model':db[_0x53a5('0x3f')],'as':_0x53a5('0x3e')}];}_0x4439be=_[_0x53a5('0x4c')]({},_0x4439be,_0x4c4609['options']);if(!_[_0x53a5('0x2a')](_0x4439be['attributes'],'id')){_0x4439be[_0x53a5('0x40')]['push']('id');}return db[_0x53a5('0x32')][_0x53a5('0x2b')](_0x4439be)['then'](handleEntityNotFound(_0x497837,null))[_0x53a5('0x1d')](function(_0x3ab0c3){var _0x11805f=[];values=_0x3ab0c3;if(_0x4c4609[_0x53a5('0x3c')][_0x53a5('0x4d')]===_0x53a5('0x4e')){_0x11805f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x44'),_0x3ab0c3[_0x53a5('0x45')]));_0x11805f['push'](get_open_tabs(_0x53a5('0x46'),_0x3ab0c3[_0x53a5('0x45')]));_0x11805f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x48'),_0x3ab0c3['dataValues']));_0x11805f[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x4f'),_0x3ab0c3[_0x53a5('0x45')]));_0x11805f[_0x53a5('0x41')](get_open_tabs('fax',_0x3ab0c3['dataValues']));_0x11805f[_0x53a5('0x41')](get_open_tabs('mail',_0x3ab0c3['dataValues']));return Promise['all'](_0x11805f);}else{return values;}})[_0x53a5('0x1d')](function(){return values;})['then'](respondWithResult(_0x497837,null))[_0x53a5('0x49')](handleError(_0x497837,null));};exports[_0x53a5('0x1c')]=function(_0x178ac6,_0x4de9c9){if(_0x178ac6[_0x53a5('0x50')]['id']){delete _0x178ac6[_0x53a5('0x50')]['id'];}delete _0x178ac6[_0x53a5('0x50')][_0x53a5('0x21')];return db['User'][_0x53a5('0x2b')]({'where':{'id':_0x178ac6[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x4de9c9,null))['then'](saveUpdates(_0x178ac6[_0x53a5('0x50')],null))[_0x53a5('0x1d')](respondWithResult(_0x4de9c9,null))['catch'](handleError(_0x4de9c9,null));};exports['describe']=function(_0x664b90,_0x250eb1){return db[_0x53a5('0x32')]['describe']()[_0x53a5('0x1d')](respondWithResult(_0x250eb1,null))[_0x53a5('0x49')](handleError(_0x250eb1,null));};exports[_0x53a5('0x51')]=function(_0x34ef4c,_0xe7cc44){return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x34ef4c[_0x53a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe7cc44,null))['then'](function(_0x3e082d){if(_0x3e082d){return _0x3e082d['addContacts'](_0x34ef4c['body'][_0x53a5('0x52')],_[_0x53a5('0x53')](_0x34ef4c[_0x53a5('0x50')],[_0x53a5('0x52'),'id'])||{});}})[_0x53a5('0x1d')](respondWithResult(_0xe7cc44,null))[_0x53a5('0x49')](handleError(_0xe7cc44,null));};function validateUser(_0x1497eb){return new Promise(function(_0x1d6493,_0x380084){if(_0x1497eb['internal'])return _0x1d6493(_0x1497eb);return db[_0x53a5('0x54')][_0x53a5('0x55')](0x1)['then'](function(_0x4db617){if(_0x4db617[_0x53a5('0x56')])authService[_0x53a5('0x57')](_0x1497eb[_0x53a5('0x36')]);db[_0x53a5('0x32')][_0x53a5('0x58')]('internal')[_0x53a5('0x1d')](function(_0x2652d5){if(_[_0x53a5('0x59')](_0x2652d5)){_0x1497eb[_0x53a5('0x5a')]=_0x4db617[_0x53a5('0x5b')]||0x1;return;}if(_[_0x53a5('0x59')](_0x4db617[_0x53a5('0x5b')])||_0x4db617[_0x53a5('0x5b')]===_0x2652d5){_0x1497eb[_0x53a5('0x5a')]=_0x2652d5+0x1;return;}if(_0x4db617[_0x53a5('0x5b')]>_0x2652d5){_0x1497eb[_0x53a5('0x5a')]=_0x4db617[_0x53a5('0x5b')];return;}return db['sequelize']['query'](_0x53a5('0x5c'),{'type':db['sequelize'][_0x53a5('0x5d')][_0x53a5('0x5e')]})['then'](function(_0x4ae959){if(_0x4ae959&&_0x4ae959[_0x53a5('0x43')]){for(var _0x5de073=0x0,_0x534634=_0x4ae959[_0x53a5('0x43')];_0x5de073<_0x534634&&_[_0x53a5('0x59')](_0x1497eb[_0x53a5('0x5a')]);_0x5de073++){if(_0x4db617[_0x53a5('0x5b')]<=_0x4ae959[_0x5de073][_0x53a5('0x5f')]){_0x1497eb[_0x53a5('0x5a')]=_0x4ae959[_0x5de073][_0x53a5('0x5f')];}else if(_0x4db617[_0x53a5('0x5b')]>_0x4ae959[_0x5de073]['from']&&_0x4db617[_0x53a5('0x5b')]<=_0x4ae959[_0x5de073]['to']){_0x1497eb[_0x53a5('0x5a')]=_0x4db617[_0x53a5('0x5b')];}}}if(_[_0x53a5('0x59')](_0x1497eb[_0x53a5('0x5a')])){_0x1497eb[_0x53a5('0x5a')]=_0x2652d5+0x1;}return _0x1d6493(_0x1497eb);});});})[_0x53a5('0x49')](function(_0x43a68a){_0x380084(_0x43a68a);});});}function updateUser(_0x803627){return new Promise(function(_0x5ee0d2,_0xfd4df5){try{if(_0x803627[_0x53a5('0x60')]){_0x803627[_0x53a5('0x61')]=_0x803627[_0x53a5('0x5a')];_0x803627[_0x53a5('0x62')]={'mailbox':_0x803627[_0x53a5('0x5a')],'password':_0x803627[_0x53a5('0x36')],'fullname':_0x803627[_0x53a5('0x63')],'email':_0x803627['email']};}if(_0x803627[_0x53a5('0x21')]==='agent'){if(!_0x803627['permissions'])_0x803627[_0x53a5('0x64')]=[_0x53a5('0x65'),_0x53a5('0x66'),_0x53a5('0x67'),_0x53a5('0x68'),_0x53a5('0x69'),_0x53a5('0x6a'),_0x53a5('0x6b'),_0x53a5('0x6c'),_0x53a5('0x6d'),_0x53a5('0x6e'),_0x53a5('0x6f'),_0x53a5('0x70'),_0x53a5('0x71'),_0x53a5('0x72'),_0x53a5('0x73')];}_0x5ee0d2(_0x803627);}catch(_0x3440e1){_0xfd4df5(_0x3440e1);}});}exports[_0x53a5('0x74')]=function(_0x10d464,_0x4e191d){if(_0x10d464[_0x53a5('0x22')][_0x53a5('0x21')]===_0x53a5('0x1e'))throw new Error('Unauthorized');if(_0x10d464[_0x53a5('0x50')][_0x53a5('0x21')]===_0x53a5('0x22')&&_0x10d464[_0x53a5('0x22')]['role']!=='admin'){throw new Error(_0x53a5('0x75'));}if(_0x10d464['body'][_0x53a5('0x21')]==='admin'&&_0x10d464[_0x53a5('0x22')]['role']!==_0x53a5('0x76')){throw new Error(_0x53a5('0x77'));}return licenseUtil[_0x53a5('0x78')]([_0x10d464[_0x53a5('0x50')]])[_0x53a5('0x1d')](function(){return validateUser(_0x10d464[_0x53a5('0x50')]);})[_0x53a5('0x1d')](function(_0xa9c6c){return updateUser(_0xa9c6c)[_0x53a5('0x1d')](function(_0x3d461f){if(_0x3d461f['role']==='admin'){_0x3d461f[_0x53a5('0x79')]=_0x10d464['user'][_0x53a5('0x79')];delete _0x3d461f['userProfileId'];}return _0x3d461f;});})[_0x53a5('0x1d')](function(_0x30fa9d){return db[_0x53a5('0x32')][_0x53a5('0x74')](_0x30fa9d,{'include':[{'model':db['VoiceMail'],'as':_0x53a5('0x62')}]});})['then'](function(_0x4d44a8){if(_0x10d464['body']['role']==='user')return _0x4d44a8;if(_0x10d464['user'][_0x53a5('0x21')]!=='user')return _0x4d44a8;return db[_0x53a5('0x7a')][_0x53a5('0x2b')]({'where':{'name':_0x4d44a8[_0x53a5('0x21')]===_0x53a5('0x1e')?_0x53a5('0x23'):_0x53a5('0x24'),'userProfileId':_0x10d464[_0x53a5('0x22')][_0x53a5('0x7b')]},'raw':!![]})['then'](function(_0x17e869){if(!_0x17e869||_0x17e869['autoAssociation']!=0x0)return _0x4d44a8;return db['UserProfileResource'][_0x53a5('0x74')]({'name':_0x4d44a8[_0x53a5('0x2c')],'resourceId':_0x4d44a8['id'],'type':_0x17e869[_0x53a5('0x2c')],'sectionId':_0x17e869['id']},{})[_0x53a5('0x1d')](function(){return _0x4d44a8;});})[_0x53a5('0x49')](function(_0x155551){logger[_0x53a5('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x155551);throw _0x155551;});})[_0x53a5('0x1d')](respondWithResult(_0x4e191d,0xc9))['catch'](handleError(_0x4e191d,null));};exports[_0x53a5('0x7c')]=function(_0x1b2dfa,_0x403c4f){var _0xec435d=_0x1b2dfa[_0x53a5('0x50')];var _0x301c4e=[];if(_0x1b2dfa[_0x53a5('0x22')][_0x53a5('0x21')]==='agent')throw new Error(_0x53a5('0x7d'));if(_[_0x53a5('0x7e')](_0xec435d,[_0x53a5('0x21'),_0x53a5('0x22')])&&_0x1b2dfa[_0x53a5('0x22')][_0x53a5('0x21')]!==_0x53a5('0x76')){throw new Error(_0x53a5('0x75'));}if(_[_0x53a5('0x7e')](_0xec435d,[_0x53a5('0x21'),_0x53a5('0x76')])&&_0x1b2dfa[_0x53a5('0x22')][_0x53a5('0x21')]!==_0x53a5('0x76')){throw new Error(_0x53a5('0x7f'));}return licenseUtil[_0x53a5('0x78')](_0xec435d)['then'](function(){return validateUser(_0xec435d[0x0]);})[_0x53a5('0x1d')](function(){for(var _0x11f5a6=0x1;_0x11f5a6<_0xec435d[_0x53a5('0x43')];_0x11f5a6++){var _0x35bc67=_0xec435d[_0x11f5a6-0x1]['internal'];if(!_0xec435d[_0x11f5a6]['internal'])_0xec435d[_0x11f5a6][_0x53a5('0x5a')]=_0x35bc67+0x1;_0x301c4e['push'](validateUser(_0xec435d[_0x11f5a6]));}return Promise[_0x53a5('0x80')](_0x301c4e);})[_0x53a5('0x1d')](function(){_0x301c4e=[];for(var _0x350c0e=0x0;_0x350c0e<_0xec435d[_0x53a5('0x43')];_0x350c0e++){_0x301c4e[_0x53a5('0x41')](updateUser(_0xec435d[_0x350c0e]));}return Promise['all'](_0x301c4e);})[_0x53a5('0x1d')](function(){_0x301c4e=_0xec435d[_0x53a5('0x28')](function(_0x3d53de){return db[_0x53a5('0x32')][_0x53a5('0x74')](_0x3d53de,{'include':[{'model':db['VoiceMail'],'as':_0x53a5('0x62')}]})['then'](function(_0x59e09e){_0x3d53de['id']=_0x59e09e['id'];return _0x3d53de;});});return Promise[_0x53a5('0x80')](_0x301c4e);})[_0x53a5('0x1d')](function(_0xcd7dc1){if(_0x1b2dfa[_0x53a5('0x50')]['role']===_0x53a5('0x22'))return _0xcd7dc1;if(_0x1b2dfa[_0x53a5('0x22')]['role']!==_0x53a5('0x22'))return _0xcd7dc1;var _0x573c11=_[_0x53a5('0x7e')](_0xcd7dc1,function(_0x5f121a){return _0x5f121a['role']===_0x53a5('0x1e')||_0x5f121a['role']==='telephone';});if(!_0x573c11)return _0xcd7dc1;return db[_0x53a5('0x7a')][_0x53a5('0x81')]({'where':{'name':{'$or':[_0x53a5('0x23'),'Telephones']},'userProfileId':_0x1b2dfa['user'][_0x53a5('0x7b')]},'raw':!![]})[_0x53a5('0x1d')](function(_0x106f34){if(_[_0x53a5('0x82')](_0x106f34)||!_['some'](_0x106f34,[_0x53a5('0x83'),0x0]))return _0xcd7dc1;_0x301c4e=[];var _0x1ddc89=_(_0x106f34)[_0x53a5('0x28')](function(_0x3d3d55){if(_0x3d3d55[_0x53a5('0x83')]===0x1)return;return _0x3d3d55[_0x53a5('0x2c')]===_0x53a5('0x23')?_0x53a5('0x1e'):_0x53a5('0x25');})[_0x53a5('0x84')]()[_0x53a5('0x29')]();for(var _0xbbd57c=0x0;_0xbbd57c<_0xcd7dc1[_0x53a5('0x43')];_0xbbd57c++){if(!_[_0x53a5('0x2a')](_0x1ddc89,_0xcd7dc1[_0xbbd57c][_0x53a5('0x21')]))return;var _0x4f5211=_0xcd7dc1[_0xbbd57c][_0x53a5('0x21')]===_0x53a5('0x1e')?_0x53a5('0x23'):'Telephones';_0x301c4e[_0x53a5('0x41')](db[_0x53a5('0x2d')]['create']({'name':_0xcd7dc1[_0xbbd57c][_0x53a5('0x2c')],'resourceId':_0xcd7dc1[_0xbbd57c]['id'],'type':_0x4f5211,'sectionId':_[_0x53a5('0x2b')](_0x106f34,['name',_0x4f5211])['id']},{}));}return Promise[_0x53a5('0x80')](_0x301c4e);});})[_0x53a5('0x1d')](respondWithResult(_0x403c4f,0xc9))[_0x53a5('0x49')](handleError(_0x403c4f,null));};exports[_0x53a5('0x85')]=function(_0x38ccd9,_0x522609){if(_0x38ccd9['body']['id']){delete _0x38ccd9['body']['id'];}return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x38ccd9[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](function(_0x1ab70d){if(!_0x1ab70d)return null;if(_0x1ab70d['id']===_0x38ccd9[_0x53a5('0x22')]['id']){if(!_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x86')]||!_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x87')]){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x8a'));}if(!_0x1ab70d[_0x53a5('0x8b')](_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x86')])){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x8c'));}if(_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x86')]===_0x38ccd9[_0x53a5('0x50')]['newPassword']){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x8d'));}}else if(_0x38ccd9[_0x53a5('0x22')][_0x53a5('0x21')]==='admin'){if(!_0x38ccd9['body'][_0x53a5('0x87')]){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x8e'));}}else if(_0x38ccd9[_0x53a5('0x22')][_0x53a5('0x21')]==='user'){if(!_0x38ccd9[_0x53a5('0x50')]['newPassword']){throw new db[(_0x53a5('0x88'))]['ValidationError'](_0x53a5('0x8e'));}if(_0x1ab70d['role']!==_0x53a5('0x1e')){throw new db[(_0x53a5('0x88'))]['ValidationError'](_0x53a5('0x7d'));}}else{throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))]('Unauthorized');}return _0x1ab70d;})[_0x53a5('0x1d')](handleEntityNotFound(_0x522609,null))[_0x53a5('0x1d')](function(_0x3b22a6){return db['Setting'][_0x53a5('0x8f')]({'attributes':['id','securePassword',_0x53a5('0x90'),_0x53a5('0x91')]})[_0x53a5('0x1d')](function(_0x13d798){if(_0x13d798[_0x53a5('0x56')])authService[_0x53a5('0x57')](_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x87')]);if(!_0x13d798['enforcePasswordHistory']||!_0x3b22a6['previousPasswords'])return _0x3b22a6;authService['validatePasswordHistory'](_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x87')],_0x3b22a6['previousPasswords'],_0x13d798[_0x53a5('0x91')]);return _0x3b22a6;})['then'](saveUpdates({'password':_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x87')],'passwordResetAt':_0x38ccd9[_0x53a5('0x22')]['id']==_0x38ccd9[_0x53a5('0x4a')]['id']?moment():null,'previousPasswords':authService[_0x53a5('0x92')](_0x38ccd9[_0x53a5('0x50')][_0x53a5('0x87')],_0x3b22a6['previousPasswords'])},null));})['then'](respondWithResult(_0x522609,null))[_0x53a5('0x49')](handleError(_0x522609,null));};exports['addQueues']=function(_0xcd14c4,_0x197edd){var _0x70297d=_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x93')];return db[_0x53a5('0x32')]['find']({'where':{'id':_0xcd14c4[_0x53a5('0x4a')]['id']},'attributes':['id',_0x53a5('0x2c'),_0x53a5('0x21'),_0x53a5('0x94'),'loginInPause',_0x53a5('0x95'),_0x53a5('0x96')]})[_0x53a5('0x1d')](handleEntityNotFound(_0x197edd,null))[_0x53a5('0x1d')](function(_0x273a3d){if(_0x273a3d){if(!utils['isValidChannel'](_0x70297d)){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x97'));}return _0x273a3d[_0x53a5('0x98')+_[_0x53a5('0x99')](_0x70297d[_0x53a5('0x9a')]())+'Queues'](_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x52')],{'penalty':_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x9b')]||0x0})[_0x53a5('0x9c')](function(_0x5016cf){for(var _0x36c5f3=0x0;_0x36c5f3<_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x52')][_0x53a5('0x43')];_0x36c5f3+=0x1){var _0x1d65a1={'UserId':Number(_0xcd14c4[_0x53a5('0x4a')]['id'])};_0x1d65a1[_['capitalize'](_0x70297d['toLowerCase']())+_0x53a5('0x9d')]=Number(_0xcd14c4['body']['ids'][_0x36c5f3]);socket['emit'](_0x53a5('0x22')+_[_0x53a5('0x99')](_0x70297d[_0x53a5('0x9a')]())+'Queue:save',_0x1d65a1);}return _0x5016cf;})[_0x53a5('0x1d')](function(){if(_0x70297d===_0x53a5('0x9e')){return db[_0x53a5('0x9f')][_0x53a5('0x81')]({'where':{'id':_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x52')]||[]},'raw':!![],'attributes':['id',_0x53a5('0x2c')]});}})[_0x53a5('0x1d')](function(_0x39fd56){var _0xc2dc98=_0x273a3d[_0x53a5('0x20')]({'plain':!![]});var _0x4b5fde=[];if(_0x70297d===_0x53a5('0x9e')&&_0xc2dc98['role']===_0x53a5('0x1e')&&_0xc2dc98[_0x53a5('0x94')]){for(let _0x5ebd80=0x0;_0x5ebd80<_0x39fd56[_0x53a5('0x43')];_0x5ebd80+=0x1){_0x4b5fde[_0x53a5('0x41')]({'membername':_0xc2dc98[_0x53a5('0x2c')],'UserId':_0xc2dc98['id'],'queue_name':_0x39fd56[_0x5ebd80]['name'],'VoiceQueueId':_0x39fd56[_0x5ebd80]['id'],'interface':_[_0x53a5('0x59')](_0xc2dc98[_0x53a5('0x96')])?util['format']('SIP/%s',_0xc2dc98[_0x53a5('0x2c')]):_0xc2dc98[_0x53a5('0x96')],'paused':_0xc2dc98[_0x53a5('0x95')]||![],'penalty':_0xcd14c4[_0x53a5('0x50')][_0x53a5('0x9b')]||0x0});}return Promise[_0x53a5('0x80')](_0x4b5fde['map'](function(_0x59c352){return db[_0x53a5('0xa0')][_0x53a5('0xa1')](_0x59c352);}));}return _0x273a3d;});}})[_0x53a5('0x1d')](respondWithStatusCode(_0x197edd,null))[_0x53a5('0x49')](handleError(_0x197edd,null));};exports[_0x53a5('0xa2')]=function(_0x2628b2,_0xe833c){var _0x5f1458,_0x4c1942;return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x2628b2[_0x53a5('0x4a')]['id']},'attributes':['id',_0x53a5('0x2c'),'role']})[_0x53a5('0x1d')](handleEntityNotFound(_0xe833c,null))[_0x53a5('0x1d')](function(_0x2196c7){if(_0x2196c7){_0x5f1458=_0x2196c7;if(!_0x2628b2[_0x53a5('0x3c')]['channel']||!utils[_0x53a5('0xa3')](_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x93')])){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x97'));}return _0x2196c7[_0x53a5('0xa4')+_['capitalize'](_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x93')][_0x53a5('0x9a')]())+_0x53a5('0xa5')](_0x2628b2['query'][_0x53a5('0x52')]);}})[_0x53a5('0x1d')](function(_0x15369a){if(_[_0x53a5('0xa6')](_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x52')])){for(var _0x4d7627=0x0;_0x4d7627<_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x52')][_0x53a5('0x43')];_0x4d7627+=0x1){_0x4c1942={'UserId':Number(_0x2628b2[_0x53a5('0x4a')]['id'])};_0x4c1942[_[_0x53a5('0x99')](_0x2628b2[_0x53a5('0x3c')]['channel'][_0x53a5('0x9a')]())+_0x53a5('0x9d')]=Number(_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x52')][_0x4d7627]);socket[_0x53a5('0x1f')](_0x53a5('0x22')+_[_0x53a5('0x99')](_0x2628b2['query'][_0x53a5('0x93')][_0x53a5('0x9a')]())+_0x53a5('0xa7'),_0x4c1942);}}else{_0x4c1942={'UserId':Number(_0x2628b2[_0x53a5('0x4a')]['id'])};_0x4c1942[_[_0x53a5('0x99')](_0x2628b2['query']['channel'][_0x53a5('0x9a')]())+_0x53a5('0x9d')]=Number(_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x52')]);socket['emit'](_0x53a5('0x22')+_['capitalize'](_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x93')][_0x53a5('0x9a')]())+'Queue:remove',_0x4c1942);}return _0x15369a;})['then'](function(){if(_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x93')]===_0x53a5('0x9e')){return db[_0x53a5('0xa0')][_0x53a5('0x2e')]({'where':{'UserId':_0x2628b2[_0x53a5('0x4a')]['id'],'VoiceQueueId':_0x2628b2[_0x53a5('0x3c')][_0x53a5('0x52')]},'individualHooks':!![]})[_0x53a5('0x1d')](function(){return _0x5f1458;});}return _0x5f1458;})[_0x53a5('0x1d')](respondWithStatusCode(_0xe833c,null))['catch'](handleError(_0xe833c,null));};exports[_0x53a5('0xa8')]=function(_0x3012a5,_0x5ec872){_0x3012a5[_0x53a5('0x50')]['userpic']=_0x3012a5[_0x53a5('0xa9')][_0x53a5('0xaa')];return db[_0x53a5('0x32')]['find']({'where':{'id':_0x3012a5[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x5ec872,null))[_0x53a5('0x1d')](saveUpdates(_0x3012a5['body'],null))[_0x53a5('0x1d')](respondWithResult(_0x5ec872,null))[_0x53a5('0x49')](handleError(_0x5ec872,null));};exports[_0x53a5('0xab')]=function(_0x5ad5a9,_0x3e05ee){var _0x2618c5=path[_0x53a5('0xac')](config[_0x53a5('0xad')],_0x53a5('0xae'));return db['User'][_0x53a5('0x2b')]({'where':{'id':_0x5ad5a9['params']['id']},'attributes':['id',_0x53a5('0xaf')],'raw':!![]})[_0x53a5('0x1d')](handleEntityNotFound(_0x3e05ee,null))[_0x53a5('0x1d')](function(_0x406dc8){if(_0x406dc8){if(_[_0x53a5('0x59')](_0x406dc8[_0x53a5('0xaf')])){return _0x3e05ee[_0x53a5('0xb0')](_0x2618c5);}else{if(!fs[_0x53a5('0xb1')](path[_0x53a5('0xac')](config[_0x53a5('0xad')],_0x53a5('0xb2'),_0x406dc8[_0x53a5('0xaf')]))){return _0x3e05ee[_0x53a5('0xb0')](_0x2618c5);}return _0x3e05ee[_0x53a5('0xb0')](path[_0x53a5('0xac')](config[_0x53a5('0xad')],_0x53a5('0xb2'),_0x406dc8[_0x53a5('0xaf')]));}}})[_0x53a5('0x49')](handleError(_0x3e05ee,null));};exports[_0x53a5('0xb3')]=function(_0x3bd4d8,_0x37c786){return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x3bd4d8[_0x53a5('0x4a')]['id']},'attributes':['id']})[_0x53a5('0x1d')](handleEntityNotFound(_0x37c786,null))[_0x53a5('0x1d')](function(_0x3ba3b2){var _0x5af0af=[];values=_0x3ba3b2[_0x53a5('0x45')];_0x5af0af[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x44'),_0x3ba3b2[_0x53a5('0x45')]));_0x5af0af['push'](get_open_tabs(_0x53a5('0x46'),_0x3ba3b2[_0x53a5('0x45')]));_0x5af0af[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x48'),_0x3ba3b2[_0x53a5('0x45')]));_0x5af0af['push'](get_open_tabs(_0x53a5('0x4f'),_0x3ba3b2[_0x53a5('0x45')]));_0x5af0af[_0x53a5('0x41')](get_open_tabs(_0x53a5('0x47'),_0x3ba3b2['dataValues']));_0x5af0af['push'](get_open_tabs('mail',_0x3ba3b2[_0x53a5('0x45')]));return Promise['all'](_0x5af0af);})[_0x53a5('0x1d')](function(_0x2368a6){if(_0x2368a6){var _0x4494ff=_['map'](values[_0x53a5('0xb4')],function(_0x211d3e){return{'channel':_0x53a5('0xb5'),'id':_0x211d3e['id'],'createdAt':_0x211d3e[_0x53a5('0xb6')]};});var _0x1df012=_['map'](values['FaxOpenTabs'],function(_0x2a57a1){return{'channel':'FAX','id':_0x2a57a1['id'],'createdAt':_0x2a57a1['createdAt']};});var _0x4070de=_[_0x53a5('0x28')](values[_0x53a5('0xb7')],function(_0x232d9b){return{'channel':_0x53a5('0xb8'),'id':_0x232d9b['id'],'createdAt':_0x232d9b[_0x53a5('0xb6')]};});var _0x402e9f=_['map'](values['MailOpenTabs'],function(_0x4663ed){return{'channel':_0x53a5('0xb9'),'id':_0x4663ed['id'],'createdAt':_0x4663ed[_0x53a5('0xb6')]};});var _0x554420=_['map'](values[_0x53a5('0xba')],function(_0x5614d4){return{'channel':'SMS','id':_0x5614d4['id'],'createdAt':_0x5614d4[_0x53a5('0xb6')]};});var _0x9133e1=_[_0x53a5('0x28')](values['WhatsappOpenTabs'],function(_0x1acdbf){return{'channel':_0x53a5('0xbb'),'id':_0x1acdbf['id'],'createdAt':_0x1acdbf['createdAt']};});var _0x189edc=_[_0x53a5('0xbc')](_0x4494ff,_0x1df012,_0x4070de,_0x402e9f,_0x554420,_0x9133e1);var _0xe905a5={'count':_0x189edc[_0x53a5('0x43')],'rows':_0x189edc};return _0xe905a5;}else return null;})[_0x53a5('0x1d')](respondWithResult(_0x37c786,null))[_0x53a5('0x49')](handleError(_0x37c786,null));};exports['getContacts']=function(_0x42b972,_0x1a032a){var _0x2e9ece={};return db['User'][_0x53a5('0x8f')]({'where':{'id':_0x42b972[_0x53a5('0x4a')]['id']}})['then'](function(_0x5797d4){if(!_0x5797d4){throw new APINotFoundError(util['format'](_0x53a5('0xbd'),_0x42b972[_0x53a5('0x4a')]['id']));}return contacts['describe']();})[_0x53a5('0x1d')](function(_0x2f8f2b){_0x42b972[_0x53a5('0x3c')]['User']=_0x42b972['params']['id'];_0x2e9ece=qs['getOptions'](_0x2f8f2b,_0x42b972);if(_0x42b972[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0x4b'))){_0x2e9ece[_0x53a5('0x3d')]=[{'model':db['CmList'],'as':_0x53a5('0xbf'),'required':![]},{'model':db[_0x53a5('0xc0')],'as':_0x53a5('0xc1'),'attributes':['id',_0x53a5('0x2c'),_0x53a5('0xc2')],'where':_0x42b972['query'][_0x53a5('0xc3')]?{'id':_0x42b972[_0x53a5('0x3c')]['tag']}:undefined,'required':_0x42b972['query'][_0x53a5('0xc3')]?!![]:![]}];}return contacts['findAll'](_0x42b972[_0x53a5('0x3c')],_0x42b972[_0x53a5('0x22')],_0x2e9ece,_0x2f8f2b);})[_0x53a5('0x1d')](respondWithFilteredResult(_0x1a032a,_0x2e9ece))[_0x53a5('0x49')](APIHandleError(_0x1a032a));};exports[_0x53a5('0xc4')]=function(_0xb122d9,_0x380c59){var _0x12e0fd;var _0x272298={};var _0x4ab1d8;return db[_0x53a5('0x32')]['findOne']({'where':{'id':_0xb122d9[_0x53a5('0x4a')]['id']},'attributes':['id',_0x53a5('0x2c'),_0x53a5('0x21')]})['then'](handleEntityNotFound(_0x380c59,null))['then'](function(_0x233ef3){if(!utils[_0x53a5('0xa3')](_0xb122d9['query'][_0x53a5('0x93')])){throw new db[(_0x53a5('0x88'))][(_0x53a5('0x89'))](_0x53a5('0x97'));}_0x12e0fd=_0x233ef3;var _0x13a0e1={};_0x13a0e1[_0x53a5('0xc5')]=_['keys'](db[_[_0x53a5('0x99')](_0xb122d9[_0x53a5('0x3c')]['channel'])+'Queue']['rawAttributes']);_0x13a0e1[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0xb122d9['query']);_0x13a0e1['filters']=_[_0x53a5('0xc7')](_0x13a0e1['model'],_0x13a0e1[_0x53a5('0x3c')]);_0x272298[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x13a0e1[_0x53a5('0xc5')],qs['fields'](_0xb122d9[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x272298[_0x53a5('0x40')]=_0x272298[_0x53a5('0x40')][_0x53a5('0x43')]?_0x272298[_0x53a5('0x40')]:_0x13a0e1[_0x53a5('0xc5')];_0x272298['order']=qs[_0x53a5('0xc9')](_0xb122d9[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x272298[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0xb122d9[_0x53a5('0x3c')],_0x13a0e1[_0x53a5('0xca')]));if(_0xb122d9['query'][_0x53a5('0x26')]){_0x272298['where']=_[_0x53a5('0x4c')](_0x272298[_0x53a5('0x3b')],{'$or':_['map'](_0x272298[_0x53a5('0x40')],function(_0x3957d6){var _0x2f487f={};_0x2f487f[_0x3957d6]={'$like':'%'+_0xb122d9[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x2f487f;})});}_0x272298=_[_0x53a5('0x4c')]({},_0x272298,_0xb122d9['options']);switch(_0x12e0fd[_0x53a5('0x21')]){case _0x53a5('0x76'):return db[_[_0x53a5('0x99')](_0xb122d9[_0x53a5('0x3c')][_0x53a5('0x93')])+_0x53a5('0xcc')]['findAll'](_0x272298);case _0x53a5('0x22'):case _0x53a5('0x1e'):return _0x12e0fd[_0x53a5('0x20')+_[_0x53a5('0x99')](_0xb122d9[_0x53a5('0x3c')]['channel'])+'Queues'](_0x272298);default:throw new db[(_0x53a5('0x88'))]['ValidationError'](_0x53a5('0xcd'));}})['then'](function(_0x523aa5){_0x4ab1d8=_0x523aa5[_0x53a5('0x43')];if(!_0xb122d9[_0x53a5('0x3c')]['hasOwnProperty'](_0x53a5('0xce'))){_0x272298[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0xb122d9[_0x53a5('0x3c')][_0x53a5('0x18')]);_0x272298['offset']=qs[_0x53a5('0x16')](_0xb122d9['query'][_0x53a5('0x16')]);}switch(_0x12e0fd[_0x53a5('0x21')]){case _0x53a5('0x76'):return db[_[_0x53a5('0x99')](_0xb122d9[_0x53a5('0x3c')][_0x53a5('0x93')])+_0x53a5('0xcc')][_0x53a5('0x81')](_0x272298);case'user':case _0x53a5('0x1e'):return _0x12e0fd[_0x53a5('0x20')+_['capitalize'](_0xb122d9['query'][_0x53a5('0x93')])+'Queues'](_0x272298);}})[_0x53a5('0x1d')](function(_0x2dee3e){return{'count':_0x4ab1d8,'rows':_0x2dee3e};})[_0x53a5('0x1d')](respondWithResult(_0x380c59,null))['catch'](handleError(_0x380c59,null));};exports[_0x53a5('0xcf')]=function(_0x24a87f,_0x628931){var _0x213aff={};var _0x4eb4d5={};var _0x57d4d9;var _0x6b3566;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x24a87f['params']['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x628931,null))[_0x53a5('0x1d')](function(_0x217141){if(_0x217141){_0x57d4d9=_0x217141;_0x4eb4d5['model']=_[_0x53a5('0xc6')](db[_0x53a5('0xa0')][_0x53a5('0x33')]);_0x4eb4d5[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x24a87f[_0x53a5('0x3c')]);_0x4eb4d5[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x4eb4d5[_0x53a5('0xc5')],_0x4eb4d5[_0x53a5('0x3c')]);_0x213aff[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x4eb4d5[_0x53a5('0xc5')],qs['fields'](_0x24a87f[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x213aff[_0x53a5('0x40')]=_0x213aff[_0x53a5('0x40')][_0x53a5('0x43')]?_0x213aff[_0x53a5('0x40')]:_0x4eb4d5[_0x53a5('0xc5')];_0x213aff['order']=qs['sort'](_0x24a87f[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x213aff['where']=qs[_0x53a5('0xca')](_['pick'](_0x24a87f[_0x53a5('0x3c')],_0x4eb4d5[_0x53a5('0xca')]));if(_0x24a87f['query']['filter']){_0x213aff[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x213aff[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x213aff[_0x53a5('0x40')],function(_0x45244a){var _0x37b642={};_0x37b642[_0x45244a]={'$like':'%'+_0x24a87f[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x37b642;})});}_0x213aff=_['merge']({},_0x213aff,_0x24a87f[_0x53a5('0xd0')]);return _0x57d4d9['getVoiceQueuesRt'](_0x213aff);}})['then'](function(_0x5bcad1){if(_0x5bcad1){_0x6b3566=_0x5bcad1[_0x53a5('0x43')];if(!_0x24a87f['query'][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x213aff['limit']=qs[_0x53a5('0x18')](_0x24a87f[_0x53a5('0x3c')][_0x53a5('0x18')]);_0x213aff['offset']=qs['offset'](_0x24a87f[_0x53a5('0x3c')]['offset']);}return _0x57d4d9[_0x53a5('0xcf')](_0x213aff);}})[_0x53a5('0x1d')](function(_0x611b31){if(_0x611b31){return _0x611b31?{'count':_0x6b3566,'rows':_0x611b31}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x628931,null))[_0x53a5('0x49')](handleError(_0x628931,null));};exports[_0x53a5('0xd1')]=function(_0x298aba,_0xe7cfc5){var _0x293375={};var _0x7bface={};var _0x27279d;var _0x2f7878;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x298aba['params']['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0xe7cfc5,null))['then'](function(_0x2a92ab){if(_0x2a92ab){_0x27279d=_0x2a92ab;_0x7bface[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0xd2')]['rawAttributes']);_0x7bface['query']=_['keys'](_0x298aba[_0x53a5('0x3c')]);_0x7bface[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x7bface[_0x53a5('0xc5')],_0x7bface[_0x53a5('0x3c')]);_0x293375[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x7bface[_0x53a5('0xc5')],qs['fields'](_0x298aba['query'][_0x53a5('0xc8')]));_0x293375['attributes']=_0x293375[_0x53a5('0x40')][_0x53a5('0x43')]?_0x293375[_0x53a5('0x40')]:_0x7bface['model'];_0x293375[_0x53a5('0xd3')]=qs['sort'](_0x298aba[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x293375[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x298aba[_0x53a5('0x3c')],_0x7bface[_0x53a5('0xca')]));if(_0x298aba['query'][_0x53a5('0x26')]){_0x293375['where']=_[_0x53a5('0x4c')](_0x293375[_0x53a5('0x3b')],{'$or':_['map'](_0x293375['attributes'],function(_0x4cc528){var _0x1a956e={};_0x1a956e[_0x4cc528]={'$like':'%'+_0x298aba[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x1a956e;})});}_0x293375=_[_0x53a5('0x4c')]({},_0x293375,_0x298aba[_0x53a5('0xd0')]);return _0x27279d['getGroups'](_0x293375);}})[_0x53a5('0x1d')](function(_0x5f10c9){if(_0x5f10c9){_0x2f7878=_0x5f10c9[_0x53a5('0x43')];if(!_0x298aba[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x293375[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x298aba['query']['limit']);_0x293375[_0x53a5('0x16')]=qs[_0x53a5('0x16')](_0x298aba['query'][_0x53a5('0x16')]);}return _0x27279d['getGroups'](_0x293375);}})['then'](function(_0x3bd157){if(_0x3bd157){return _0x3bd157?{'count':_0x2f7878,'rows':_0x3bd157}:null;}})[_0x53a5('0x1d')](respondWithResult(_0xe7cfc5,null))[_0x53a5('0x49')](handleError(_0xe7cfc5,null));};exports[_0x53a5('0xd4')]=function(_0x4fc1ff,_0x389fff){var _0x29842b={'raw':!![],'where':{}};var _0x364992={};var _0x380301={'count':0x0,'rows':[]};return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x4fc1ff[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x389fff,null))['then'](function(_0x491183){if(_0x491183){_0x364992[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0xd5')][_0x53a5('0x33')]);_0x364992[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x4fc1ff[_0x53a5('0x3c')]);_0x364992['filters']=_[_0x53a5('0xc7')](_0x364992[_0x53a5('0xc5')],_0x364992[_0x53a5('0x3c')]);_0x29842b[_0x53a5('0x40')]=_['intersection'](_0x364992[_0x53a5('0xc5')],qs['fields'](_0x4fc1ff[_0x53a5('0x3c')]['fields']));_0x29842b['attributes']=_0x29842b[_0x53a5('0x40')][_0x53a5('0x43')]?_0x29842b[_0x53a5('0x40')]:_0x364992[_0x53a5('0xc5')];if(!_0x4fc1ff[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x29842b['limit']=qs[_0x53a5('0x18')](_0x4fc1ff['query'][_0x53a5('0x18')]);_0x29842b[_0x53a5('0x16')]=qs[_0x53a5('0x16')](_0x4fc1ff[_0x53a5('0x3c')][_0x53a5('0x16')]);}_0x29842b[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x4fc1ff[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x29842b['where']=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x4fc1ff[_0x53a5('0x3c')],_0x364992['filters']));_0x29842b[_0x53a5('0x3b')][_0x53a5('0xd6')]=_0x491183['id'];if(_0x4fc1ff[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x29842b['where']=_['merge'](_0x29842b['where'],{'$or':_[_0x53a5('0x28')](_0x29842b[_0x53a5('0x40')],function(_0x49316f){var _0x273feb={};_0x273feb[_0x49316f]={'$like':'%'+_0x4fc1ff['query']['filter']+'%'};return _0x273feb;})});}_0x29842b=_[_0x53a5('0x4c')]({},_0x29842b,_0x4fc1ff[_0x53a5('0xd0')]);return db[_0x53a5('0xd5')][_0x53a5('0x19')]({'where':_0x29842b['where']})[_0x53a5('0x1d')](function(_0x10ba4b){_0x380301[_0x53a5('0x19')]=_0x10ba4b;if(_0x4fc1ff[_0x53a5('0x3c')][_0x53a5('0x4b')]){_0x29842b[_0x53a5('0x3d')]=[{'all':!![]}];}return db[_0x53a5('0xd5')][_0x53a5('0x81')](_0x29842b);})['then'](function(_0x4ca757){_0x380301[_0x53a5('0x42')]=_0x4ca757;return _0x380301;});}})[_0x53a5('0x1d')](respondWithFilteredResult(_0x389fff,_0x29842b))[_0x53a5('0x49')](handleError(_0x389fff,null));};exports[_0x53a5('0xd7')]=function(_0x9dc7fb,_0x26b1a7){var _0x1d6eeb={'raw':!![],'where':{}};var _0x311b67={};var _0x5e795a={'count':0x0,'rows':[]};return db['User'][_0x53a5('0x8f')]({'where':{'id':_0x9dc7fb[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x26b1a7,null))[_0x53a5('0x1d')](function(_0x1c61ec){if(_0x1c61ec){_0x311b67['model']=_[_0x53a5('0xc6')](db[_0x53a5('0xd8')][_0x53a5('0x33')]);_0x311b67[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x9dc7fb[_0x53a5('0x3c')]);_0x311b67['filters']=_[_0x53a5('0xc7')](_0x311b67[_0x53a5('0xc5')],_0x311b67['query']);_0x1d6eeb[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x311b67[_0x53a5('0xc5')],qs[_0x53a5('0xc8')](_0x9dc7fb[_0x53a5('0x3c')]['fields']));_0x1d6eeb[_0x53a5('0x40')]=_0x1d6eeb['attributes'][_0x53a5('0x43')]?_0x1d6eeb[_0x53a5('0x40')]:_0x311b67[_0x53a5('0xc5')];if(!_0x9dc7fb[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x1d6eeb[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x9dc7fb[_0x53a5('0x3c')]['limit']);_0x1d6eeb[_0x53a5('0x16')]=qs[_0x53a5('0x16')](_0x9dc7fb[_0x53a5('0x3c')][_0x53a5('0x16')]);}_0x1d6eeb[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x9dc7fb['query'][_0x53a5('0xc9')]);_0x1d6eeb[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_['pick'](_0x9dc7fb[_0x53a5('0x3c')],_0x311b67['filters']));_0x1d6eeb[_0x53a5('0x3b')][_0x53a5('0xd6')]=_0x1c61ec['id'];if(_0x9dc7fb[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x1d6eeb[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x1d6eeb[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x1d6eeb[_0x53a5('0x40')],function(_0x112ab9){var _0x47ba39={};_0x47ba39[_0x112ab9]={'$like':'%'+_0x9dc7fb[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x47ba39;})});}_0x1d6eeb=_[_0x53a5('0x4c')]({},_0x1d6eeb,_0x9dc7fb['options']);return db['ScreenRecording'][_0x53a5('0x19')]({'where':_0x1d6eeb[_0x53a5('0x3b')]})['then'](function(_0x3ec9b3){_0x5e795a[_0x53a5('0x19')]=_0x3ec9b3;if(_0x9dc7fb[_0x53a5('0x3c')][_0x53a5('0x4b')]){_0x1d6eeb['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x53a5('0x81')](_0x1d6eeb);})[_0x53a5('0x1d')](function(_0xedfba){_0x5e795a[_0x53a5('0x42')]=_0xedfba;return _0x5e795a;});}})[_0x53a5('0x1d')](respondWithFilteredResult(_0x26b1a7,_0x1d6eeb))[_0x53a5('0x49')](handleError(_0x26b1a7,null));};exports[_0x53a5('0xd9')]=function(_0x4c8b05,_0x47a832){var _0x4ad139={};var _0xab217b={};var _0x4467cb;var _0x3d0cd9;return db[_0x53a5('0x32')]['findOne']({'where':{'id':_0x4c8b05[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x47a832,null))['then'](function(_0x738f8c){if(_0x738f8c){_0x4467cb=_0x738f8c;_0xab217b[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0xda')][_0x53a5('0x33')]);_0xab217b[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x4c8b05[_0x53a5('0x3c')]);_0xab217b[_0x53a5('0xca')]=_['intersection'](_0xab217b[_0x53a5('0xc5')],_0xab217b[_0x53a5('0x3c')]);_0x4ad139['attributes']=_[_0x53a5('0xc7')](_0xab217b[_0x53a5('0xc5')],qs[_0x53a5('0xc8')](_0x4c8b05[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x4ad139[_0x53a5('0x40')]=_0x4ad139['attributes'][_0x53a5('0x43')]?_0x4ad139[_0x53a5('0x40')]:_0xab217b[_0x53a5('0xc5')];_0x4ad139[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x4c8b05[_0x53a5('0x3c')]['sort']);_0x4ad139[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x4c8b05['query'],_0xab217b[_0x53a5('0xca')]));if(_0x4c8b05[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x4ad139[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x4ad139[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x4ad139['attributes'],function(_0x50d126){var _0x447573={};_0x447573[_0x50d126]={'$like':'%'+_0x4c8b05[_0x53a5('0x3c')]['filter']+'%'};return _0x447573;})});}_0x4ad139=_['merge']({},_0x4ad139,_0x4c8b05[_0x53a5('0xd0')]);return _0x4467cb[_0x53a5('0xd9')](_0x4ad139);}})[_0x53a5('0x1d')](function(_0x572c09){if(_0x572c09){_0x3d0cd9=_0x572c09[_0x53a5('0x43')];if(!_0x4c8b05[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x4ad139[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x4c8b05['query'][_0x53a5('0x18')]);_0x4ad139['offset']=qs[_0x53a5('0x16')](_0x4c8b05['query']['offset']);}return _0x4467cb['getChatInteractions'](_0x4ad139);}})['then'](function(_0x5714b1){if(_0x5714b1){return _0x5714b1?{'count':_0x3d0cd9,'rows':_0x5714b1}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x47a832,null))['catch'](handleError(_0x47a832,null));};exports['getOpenchannelInteractions']=function(_0x6fdaa1,_0x126417){var _0x14a49d={};var _0x2bc717={};var _0x18c499;var _0x370d1d;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x6fdaa1['params']['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x126417,null))[_0x53a5('0x1d')](function(_0xdfc786){if(_0xdfc786){_0x18c499=_0xdfc786;_0x2bc717[_0x53a5('0xc5')]=_['keys'](db[_0x53a5('0xdb')][_0x53a5('0x33')]);_0x2bc717['query']=_[_0x53a5('0xc6')](_0x6fdaa1[_0x53a5('0x3c')]);_0x2bc717['filters']=_[_0x53a5('0xc7')](_0x2bc717['model'],_0x2bc717['query']);_0x14a49d[_0x53a5('0x40')]=_['intersection'](_0x2bc717['model'],qs[_0x53a5('0xc8')](_0x6fdaa1['query'][_0x53a5('0xc8')]));_0x14a49d[_0x53a5('0x40')]=_0x14a49d[_0x53a5('0x40')][_0x53a5('0x43')]?_0x14a49d[_0x53a5('0x40')]:_0x2bc717[_0x53a5('0xc5')];_0x14a49d[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x6fdaa1[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x14a49d['where']=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x6fdaa1['query'],_0x2bc717[_0x53a5('0xca')]));if(_0x6fdaa1['query'][_0x53a5('0x26')]){_0x14a49d[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x14a49d[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x14a49d[_0x53a5('0x40')],function(_0x18a58b){var _0x99ec69={};_0x99ec69[_0x18a58b]={'$like':'%'+_0x6fdaa1[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x99ec69;})});}_0x14a49d=_[_0x53a5('0x4c')]({},_0x14a49d,_0x6fdaa1[_0x53a5('0xd0')]);return _0x18c499[_0x53a5('0xdc')](_0x14a49d);}})[_0x53a5('0x1d')](function(_0x1316ee){if(_0x1316ee){_0x370d1d=_0x1316ee[_0x53a5('0x43')];if(!_0x6fdaa1[_0x53a5('0x3c')][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x14a49d[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x6fdaa1[_0x53a5('0x3c')]['limit']);_0x14a49d[_0x53a5('0x16')]=qs[_0x53a5('0x16')](_0x6fdaa1[_0x53a5('0x3c')][_0x53a5('0x16')]);}return _0x18c499['getOpenchannelInteractions'](_0x14a49d);}})[_0x53a5('0x1d')](function(_0x16ae2c){if(_0x16ae2c){return _0x16ae2c?{'count':_0x370d1d,'rows':_0x16ae2c}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x126417,null))['catch'](handleError(_0x126417,null));};exports[_0x53a5('0xdd')]=function(_0x282bbd,_0x11c483){var _0x487650={'raw':!![],'where':{}};var _0x566671={};var _0x240bee={'count':0x0,'rows':[]};return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x282bbd[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x11c483,null))['then'](function(_0x296cb9){if(_0x296cb9){_0x566671['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x566671['query']=_[_0x53a5('0xc6')](_0x282bbd['query']);_0x566671[_0x53a5('0xca')]=_['intersection'](_0x566671[_0x53a5('0xc5')],_0x566671[_0x53a5('0x3c')]);_0x487650[_0x53a5('0x40')]=_['intersection'](_0x566671[_0x53a5('0xc5')],qs[_0x53a5('0xc8')](_0x282bbd[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x487650[_0x53a5('0x40')]=_0x487650[_0x53a5('0x40')][_0x53a5('0x43')]?_0x487650[_0x53a5('0x40')]:_0x566671[_0x53a5('0xc5')];if(!_0x282bbd['query'][_0x53a5('0xbe')](_0x53a5('0xce'))){_0x487650[_0x53a5('0x18')]=qs['limit'](_0x282bbd['query'][_0x53a5('0x18')]);_0x487650[_0x53a5('0x16')]=qs['offset'](_0x282bbd[_0x53a5('0x3c')][_0x53a5('0x16')]);}_0x487650[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x282bbd['query']['sort']);_0x487650[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_['pick'](_0x282bbd['query'],_0x566671[_0x53a5('0xca')]));_0x487650['where'][_0x53a5('0xd6')]=_0x296cb9['id'];if(_0x282bbd['query'][_0x53a5('0x26')]){_0x487650[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x487650[_0x53a5('0x3b')],{'$or':_['map'](_0x487650[_0x53a5('0x40')],function(_0x133ab5){var _0x551b93={};_0x551b93[_0x133ab5]={'$like':'%'+_0x282bbd['query'][_0x53a5('0x26')]+'%'};return _0x551b93;})});}_0x487650=_[_0x53a5('0x4c')]({},_0x487650,_0x282bbd[_0x53a5('0xd0')]);return db[_0x53a5('0xde')][_0x53a5('0x19')]({'where':_0x487650[_0x53a5('0x3b')]})[_0x53a5('0x1d')](function(_0x376680){_0x240bee[_0x53a5('0x19')]=_0x376680;if(_0x282bbd['query'][_0x53a5('0x4b')]){_0x487650[_0x53a5('0x3d')]=[{'all':!![]}];}return db[_0x53a5('0xde')][_0x53a5('0x81')](_0x487650);})[_0x53a5('0x1d')](function(_0x5430b9){_0x240bee[_0x53a5('0x42')]=_0x5430b9;return _0x240bee;});}})[_0x53a5('0x1d')](respondWithFilteredResult(_0x11c483,_0x487650))[_0x53a5('0x49')](handleError(_0x11c483,null));};exports[_0x53a5('0xdf')]=function(_0x5d69d9,_0xb2b3b3){var _0x307064={};var _0x1f559b={};var _0x1d2a99;var _0x9ce137;return db['User'][_0x53a5('0x8f')]({'where':{'id':_0x5d69d9[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0xb2b3b3,null))[_0x53a5('0x1d')](function(_0x53840e){if(_0x53840e){_0x1d2a99=_0x53840e;_0x1f559b[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0xe0')][_0x53a5('0x33')]);_0x1f559b[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x5d69d9[_0x53a5('0x3c')]);_0x1f559b[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x1f559b[_0x53a5('0xc5')],_0x1f559b[_0x53a5('0x3c')]);_0x307064[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x1f559b[_0x53a5('0xc5')],qs['fields'](_0x5d69d9[_0x53a5('0x3c')]['fields']));_0x307064[_0x53a5('0x40')]=_0x307064[_0x53a5('0x40')][_0x53a5('0x43')]?_0x307064[_0x53a5('0x40')]:_0x1f559b[_0x53a5('0xc5')];_0x307064['order']=qs[_0x53a5('0xc9')](_0x5d69d9[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x307064['where']=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x5d69d9[_0x53a5('0x3c')],_0x1f559b[_0x53a5('0xca')]));if(_0x5d69d9[_0x53a5('0x3c')]['filter']){_0x307064[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x307064[_0x53a5('0x3b')],{'$or':_['map'](_0x307064[_0x53a5('0x40')],function(_0x48ffdd){var _0x30a8ae={};_0x30a8ae[_0x48ffdd]={'$like':'%'+_0x5d69d9[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x30a8ae;})});}_0x307064=_[_0x53a5('0x4c')]({},_0x307064,_0x5d69d9[_0x53a5('0xd0')]);return _0x1d2a99['getSmsInteractions'](_0x307064);}})[_0x53a5('0x1d')](function(_0x1bd7c7){if(_0x1bd7c7){_0x9ce137=_0x1bd7c7[_0x53a5('0x43')];if(!_0x5d69d9['query'][_0x53a5('0xbe')]('nolimit')){_0x307064[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x5d69d9[_0x53a5('0x3c')][_0x53a5('0x18')]);_0x307064['offset']=qs['offset'](_0x5d69d9['query'][_0x53a5('0x16')]);}return _0x1d2a99[_0x53a5('0xdf')](_0x307064);}})['then'](function(_0xb9f8c2){if(_0xb9f8c2){return _0xb9f8c2?{'count':_0x9ce137,'rows':_0xb9f8c2}:null;}})[_0x53a5('0x1d')](respondWithResult(_0xb2b3b3,null))['catch'](handleError(_0xb2b3b3,null));};exports[_0x53a5('0xe1')]=function(_0x4e0fd8,_0x27f540){var _0x570d4={};var _0x269eae={};var _0x1c7927;var _0x13252e;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x4e0fd8[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x27f540,null))[_0x53a5('0x1d')](function(_0x12a235){if(_0x12a235){_0x1c7927=_0x12a235;_0x269eae['model']=_[_0x53a5('0xc6')](db[_0x53a5('0xe2')][_0x53a5('0x33')]);_0x269eae[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x4e0fd8['query']);_0x269eae[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x269eae[_0x53a5('0xc5')],_0x269eae['query']);_0x570d4[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x269eae['model'],qs[_0x53a5('0xc8')](_0x4e0fd8['query']['fields']));_0x570d4[_0x53a5('0x40')]=_0x570d4[_0x53a5('0x40')][_0x53a5('0x43')]?_0x570d4[_0x53a5('0x40')]:_0x269eae[_0x53a5('0xc5')];_0x570d4[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x4e0fd8[_0x53a5('0x3c')]['sort']);_0x570d4[_0x53a5('0x3b')]=qs['filters'](_[_0x53a5('0xcb')](_0x4e0fd8[_0x53a5('0x3c')],_0x269eae[_0x53a5('0xca')]));if(_0x4e0fd8[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x570d4[_0x53a5('0x3b')]=_['merge'](_0x570d4[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x570d4['attributes'],function(_0xd70586){var _0x33cee4={};_0x33cee4[_0xd70586]={'$like':'%'+_0x4e0fd8['query'][_0x53a5('0x26')]+'%'};return _0x33cee4;})});}_0x570d4=_[_0x53a5('0x4c')]({},_0x570d4,_0x4e0fd8[_0x53a5('0xd0')]);return _0x1c7927[_0x53a5('0xe1')](_0x570d4);}})[_0x53a5('0x1d')](function(_0x4f5b3a){if(_0x4f5b3a){_0x13252e=_0x4f5b3a[_0x53a5('0x43')];if(!_0x4e0fd8[_0x53a5('0x3c')]['hasOwnProperty'](_0x53a5('0xce'))){_0x570d4[_0x53a5('0x18')]=qs['limit'](_0x4e0fd8[_0x53a5('0x3c')]['limit']);_0x570d4[_0x53a5('0x16')]=qs[_0x53a5('0x16')](_0x4e0fd8['query'][_0x53a5('0x16')]);}return _0x1c7927[_0x53a5('0xe1')](_0x570d4);}})['then'](function(_0x5a0e4d){if(_0x5a0e4d){return _0x5a0e4d?{'count':_0x13252e,'rows':_0x5a0e4d}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x27f540,null))[_0x53a5('0x49')](handleError(_0x27f540,null));};exports[_0x53a5('0xe3')]=function(_0x4f0d11,_0x1b669a){var _0x536dee={};var _0x5956e6={};var _0x1447cf;var _0xa859e6;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x4f0d11[_0x53a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b669a,null))[_0x53a5('0x1d')](function(_0x2e3942){if(_0x2e3942){_0x1447cf=_0x2e3942;_0x5956e6[_0x53a5('0xc5')]=_['keys'](db[_0x53a5('0xe4')][_0x53a5('0x33')]);_0x5956e6[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x4f0d11[_0x53a5('0x3c')]);_0x5956e6[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x5956e6[_0x53a5('0xc5')],_0x5956e6['query']);_0x536dee[_0x53a5('0x40')]=_['intersection'](_0x5956e6[_0x53a5('0xc5')],qs[_0x53a5('0xc8')](_0x4f0d11[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x536dee[_0x53a5('0x40')]=_0x536dee[_0x53a5('0x40')]['length']?_0x536dee[_0x53a5('0x40')]:_0x5956e6[_0x53a5('0xc5')];_0x536dee[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x4f0d11['query']['sort']);_0x536dee[_0x53a5('0x3b')]=qs['filters'](_[_0x53a5('0xcb')](_0x4f0d11[_0x53a5('0x3c')],_0x5956e6['filters']));if(_0x4f0d11[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x536dee[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x536dee[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x536dee['attributes'],function(_0x3bdd18){var _0x5203da={};_0x5203da[_0x3bdd18]={'$like':'%'+_0x4f0d11['query'][_0x53a5('0x26')]+'%'};return _0x5203da;})});}_0x536dee=_[_0x53a5('0x4c')]({},_0x536dee,_0x4f0d11[_0x53a5('0xd0')]);return _0x1447cf[_0x53a5('0xe3')](_0x536dee);}})[_0x53a5('0x1d')](function(_0x25cba6){if(_0x25cba6){_0xa859e6=_0x25cba6[_0x53a5('0x43')];if(!_0x4f0d11[_0x53a5('0x3c')]['hasOwnProperty'](_0x53a5('0xce'))){_0x536dee[_0x53a5('0x18')]=qs['limit'](_0x4f0d11[_0x53a5('0x3c')][_0x53a5('0x18')]);_0x536dee['offset']=qs[_0x53a5('0x16')](_0x4f0d11['query']['offset']);}return _0x1447cf[_0x53a5('0xe3')](_0x536dee);}})[_0x53a5('0x1d')](function(_0x1ef6f9){if(_0x1ef6f9){return _0x1ef6f9?{'count':_0xa859e6,'rows':_0x1ef6f9}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x1b669a,null))['catch'](handleError(_0x1b669a,null));};exports['login']=function(_0x23aace,_0x4d2246,_0x3ba893){var _0x483d7c;var _0x410e7f;var _0x583a9f;var _0xab2d10=!_[_0x53a5('0x59')](_0x23aace['params']['id'])?_0x23aace[_0x53a5('0x4a')]['id']:!_['isNil'](_0x23aace[_0x53a5('0x22')]['id'])?_0x23aace[_0x53a5('0x22')]['id']:null;return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0xab2d10,'role':{'$or':[_0x53a5('0x76'),_0x53a5('0x22'),_0x53a5('0x1e')]}},'attributes':['id',_0x53a5('0x2c'),_0x53a5('0xe5'),_0x53a5('0xe6'),_0x53a5('0x21'),_0x53a5('0x5a'),'loginInPause']})[_0x53a5('0x1d')](function(_0x1d8d3e){if(_0x1d8d3e){if(_0x1d8d3e[_0x53a5('0x21')]===_0x53a5('0x1e')){_0x483d7c=_0x1d8d3e;if(_0x23aace[_0x53a5('0x50')][_0x53a5('0x96')]){_0x583a9f=util[_0x53a5('0xe7')](_0x53a5('0xe8'),_0x483d7c[_0x23aace[_0x53a5('0x50')][_0x53a5('0x96')]]);}else if(_0x23aace[_0x53a5('0x50')][_0x53a5('0xe9')]){_0x583a9f=util['format']('SIP/%s',_0x23aace[_0x53a5('0x50')][_0x53a5('0xe9')]);}else{_0x583a9f=util['format'](_0x53a5('0xea'),_0x483d7c[_0x53a5('0x2c')]);}socket['to'](util[_0x53a5('0xe7')](_0x53a5('0xeb'),_0x483d7c[_0x53a5('0x2c')]))[_0x53a5('0x1f')](_0x53a5('0xec'),{'user':{'id':_0x483d7c['id'],'name':_0x483d7c[_0x53a5('0x2c')]},'ip':_0x23aace[_0x53a5('0xed')][_0x53a5('0xee')]||_0x23aace[_0x53a5('0xef')][_0x53a5('0xf0')]||_0x23aace[_0x53a5('0xf1')][_0x53a5('0xf0')]||_0x23aace['connection'][_0x53a5('0xf1')][_0x53a5('0xf0')]});return db[_0x53a5('0xa0')]['destroy']({'where':{'membername':_0x483d7c['name']},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0x53a5('0xf2'));}})[_0x53a5('0x1d')](function(){if(_0x483d7c){return _0x483d7c[_0x53a5('0xf3')]({'raw':!![]});}})[_0x53a5('0x1d')](function(_0x3f1594){if(_0x483d7c){if(_0x3f1594){_0x410e7f=_0x3f1594;if(_0x410e7f[_0x53a5('0x43')]){var _0x5ab2fb=_0x410e7f['map'](function(_0x56b018){var _0x56aeb9={'membername':_0x483d7c[_0x53a5('0x2c')],'UserId':_0x483d7c['id'],'queue_name':_0x56b018['name'],'VoiceQueueId':_0x56b018['id'],'interface':_0x583a9f,'paused':_0x483d7c[_0x53a5('0xf4')]||![],'penalty':_0x56b018[_0x53a5('0xf5')]||0x0};return db[_0x53a5('0xa0')][_0x53a5('0xa1')](_0x56aeb9);});return Promise[_0x53a5('0x80')](_0x5ab2fb);}}}})['then'](function(){if(_0x483d7c){return db['MemberReport'][_0x53a5('0x81')]({'where':{'membername':_0x483d7c['name'],'exitAt':null}});}})['then'](function(_0x5b1aa4){if(_0x483d7c){var _0x25e4a6=[];_0x5b1aa4[_0x53a5('0xf6')](function(_0x4c93e9){_0x25e4a6[_0x53a5('0x41')](_0x4c93e9[_0x53a5('0x1c')]({'exitAt':moment()[_0x53a5('0xe7')](_0x53a5('0xf7'))}));});return Promise[_0x53a5('0x80')](_0x25e4a6);}})[_0x53a5('0x1d')](function(){if(_0x483d7c){var _0xbbc016=[];var _0x200345=[];var _0x176ba2=utils[_0x53a5('0xf8')]();var _0x2b644b={'membername':_0x483d7c['name'],'interface':_0x583a9f,'enterAt':moment()['format'](_0x53a5('0xf7')),'role':_0x483d7c[_0x53a5('0x21')],'internal':_0x483d7c[_0x53a5('0x5a')]};_0x176ba2[_0x53a5('0xf6')](function(_0x41752b){_0xbbc016[_0x53a5('0x41')](_['merge']({'channel':_0x41752b,'type':_0x53a5('0xf9'),'data1':_0x23aace[_0x53a5('0x50')][_0x53a5('0xfa')],'data2':_0x583a9f},_0x2b644b));if(_0x483d7c[_0x53a5('0xf4')]){_0x200345[_0x53a5('0x41')](_[_0x53a5('0x4c')]({'channel':_0x41752b,'type':_0x53a5('0xfb'),'data1':_0x53a5('0xfc')},_0x2b644b));}});return db[_0x53a5('0xfd')][_0x53a5('0x7c')](_0xbbc016[_0x53a5('0xbc')](_0x200345),{'individualHooks':!![]});}})['then'](function(){if(_0x483d7c){return _0x483d7c[_0x53a5('0x1c')]({'online':!![],'lastLoginAt':moment()[_0x53a5('0xe7')](_0x53a5('0xf7')),'voicePause':_0x483d7c[_0x53a5('0xf4')]||![],'mailPause':_0x483d7c['loginInPause']||![],'chatPause':_0x483d7c[_0x53a5('0xf4')]||![],'faxPause':_0x483d7c[_0x53a5('0xf4')]||![],'smsPause':_0x483d7c[_0x53a5('0xf4')]||![],'openchannelPause':_0x483d7c[_0x53a5('0xf4')]||![],'whatsappPause':_0x483d7c[_0x53a5('0xf4')]||![],'pauseType':_0x483d7c[_0x53a5('0xf4')]?_0x53a5('0xfc'):null,'interface':_0x583a9f,'lastPauseAt':moment()[_0x53a5('0xe7')](_0x53a5('0xf7'))});}})[_0x53a5('0x1d')](function(_0x463893){if(_0x23aace[_0x53a5('0xfe')]){return _0x3ba893();}else{return Promise[_0x53a5('0xff')](_0x463893)[_0x53a5('0x1d')](respondWithResult(_0x4d2246,null));}})[_0x53a5('0x49')](handleError(_0x4d2246,null));};exports['logout']=function(_0x2d3dfe,_0x9dfee7){var _0x72a786;return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x2d3dfe[_0x53a5('0x4a')]['id'],'role':'agent'},'attributes':['id','name',_0x53a5('0x21')]})['then'](handleEntityNotFound(_0x9dfee7,null))[_0x53a5('0x1d')](function(_0x1de5b4){if(_0x1de5b4){_0x72a786=_0x1de5b4;return db[_0x53a5('0xa0')][_0x53a5('0x2e')]({'where':{'membername':_0x72a786[_0x53a5('0x2c')]},'individualHooks':!![]});}})[_0x53a5('0x1d')](function(){return db[_0x53a5('0xfd')][_0x53a5('0x81')]({'where':{'membername':_0x72a786[_0x53a5('0x2c')],'exitAt':null}});})['then'](function(_0x56ad3b){var _0x56ff40=[];_0x56ad3b[_0x53a5('0xf6')](function(_0x5bdcb4){_0x56ff40[_0x53a5('0x41')](_0x5bdcb4[_0x53a5('0x1c')]({'exitAt':moment()[_0x53a5('0xe7')](_0x53a5('0xf7'))}));});return Promise[_0x53a5('0x80')](_0x56ff40);})[_0x53a5('0x1d')](function(){return _0x72a786[_0x53a5('0x1c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x53a5('0x1d')](respondWithResult(_0x9dfee7,null))[_0x53a5('0x49')](handleError(_0x9dfee7,null));};exports[_0x53a5('0x100')]=function(_0x55b8ce,_0x282743){var _0xebd43;return db[_0x53a5('0xa0')][_0x53a5('0x1c')]({'paused':0x1},{'where':{'UserId':_0x55b8ce[_0x53a5('0x4a')]['id']},'individualHooks':!![]})[_0x53a5('0x1d')](function(){return db[_0x53a5('0x32')][_0x53a5('0x2b')]({'where':{'id':_0x55b8ce[_0x53a5('0x4a')]['id'],'role':_0x53a5('0x1e')},'attributes':['id',_0x53a5('0x2c'),_0x53a5('0x21'),_0x53a5('0x5a'),_0x53a5('0x96'),'online']});})['then'](handleEntityNotFound(_0x282743,null))[_0x53a5('0x1d')](function(_0x4fb775){if(_0x4fb775){_0xebd43=_0x4fb775;return db[_0x53a5('0xfd')][_0x53a5('0x81')]({'where':{'membername':_0xebd43[_0x53a5('0x2c')],'type':_0x53a5('0xfb'),'exitAt':null}});}})['then'](function(_0x5ea8e8){if(_0x5ea8e8[_0x53a5('0x43')]){var _0x152460=moment()[_0x53a5('0xe7')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x521b90=0x0,_0x695a49=_0x5ea8e8['length'];_0x521b90<_0x695a49;_0x521b90++){_0x5ea8e8[_0x521b90][_0x53a5('0x101')]({'exitAt':_0x152460});}}})[_0x53a5('0x1d')](function(){var _0x4c6586=[];var _0x5ec964=utils['getChannels']();_0x5ec964[_0x53a5('0xf6')](function(_0x2da4b3){_0x4c6586[_0x53a5('0x41')]({'channel':_0x2da4b3,'membername':_0xebd43[_0x53a5('0x2c')],'interface':_[_0x53a5('0x59')](_0xebd43[_0x53a5('0x96')])?util['format'](_0x53a5('0xea'),_0xebd43[_0x53a5('0x2c')]):_0xebd43[_0x53a5('0x96')],'type':_0x53a5('0xfb'),'enterAt':moment()[_0x53a5('0xe7')](_0x53a5('0xf7')),'data1':_0x55b8ce['body']['type']||_0x53a5('0x102'),'role':_0xebd43[_0x53a5('0x21')],'internal':_0xebd43[_0x53a5('0x5a')]});});return db[_0x53a5('0xfd')][_0x53a5('0x7c')](_0x4c6586,{'individualHooks':!![]});})[_0x53a5('0x1d')](function(){return _0xebd43[_0x53a5('0x1c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x55b8ce[_0x53a5('0x50')][_0x53a5('0x103')]||_0x53a5('0x102'),'lastPauseAt':moment()[_0x53a5('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x282743,null))[_0x53a5('0x49')](handleError(_0x282743,null));};exports[_0x53a5('0x104')]=function(_0x1eb48e,_0x3ddca4){if(_0x1eb48e[_0x53a5('0x50')]['channel']&&!utils['isValidChannel'](_0x1eb48e[_0x53a5('0x50')][_0x53a5('0x93')])){throw new APIBadRequestError(util['format'](_0x53a5('0x105'),_0x1eb48e[_0x53a5('0x50')][_0x53a5('0x93')]));}return db[_0x53a5('0x32')]['find']({'where':{'id':_0x1eb48e['params']['id']},'attributes':['id','name','role',_0x53a5('0x5a'),_0x53a5('0x96'),_0x53a5('0x94'),_0x53a5('0x95'),_0x53a5('0x106'),'chatPause',_0x53a5('0x107'),_0x53a5('0x108'),_0x53a5('0x109'),_0x53a5('0x10a'),_0x53a5('0x10b'),_0x53a5('0x10c')]})[_0x53a5('0x1d')](function(_0x48bb08){if(!_0x48bb08){throw new APINotFoundError(util[_0x53a5('0xe7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1eb48e[_0x53a5('0x4a')]['id']));}return _0x48bb08['unpause'](_0x1eb48e['body'][_0x53a5('0x93')]);})[_0x53a5('0x1d')](respondWithResult(_0x3ddca4,null))[_0x53a5('0x49')](APIHandleError(_0x3ddca4));};exports['getTeams']=function(_0x165c77,_0x186d0f){var _0x220965={};var _0x3fa9da={};var _0x593c36;var _0x1a0d36;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x165c77[_0x53a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x186d0f,null))[_0x53a5('0x1d')](function(_0x1431a1){if(_0x1431a1){_0x593c36=_0x1431a1;_0x3fa9da[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0x10d')][_0x53a5('0x33')]);_0x3fa9da[_0x53a5('0x3c')]=_[_0x53a5('0xc6')](_0x165c77[_0x53a5('0x3c')]);_0x3fa9da[_0x53a5('0xca')]=_['intersection'](_0x3fa9da[_0x53a5('0xc5')],_0x3fa9da[_0x53a5('0x3c')]);_0x220965[_0x53a5('0x40')]=_['intersection'](_0x3fa9da[_0x53a5('0xc5')],qs['fields'](_0x165c77[_0x53a5('0x3c')]['fields']));_0x220965['attributes']=_0x220965[_0x53a5('0x40')][_0x53a5('0x43')]?_0x220965[_0x53a5('0x40')]:_0x3fa9da[_0x53a5('0xc5')];_0x220965[_0x53a5('0xd3')]=qs[_0x53a5('0xc9')](_0x165c77['query'][_0x53a5('0xc9')]);_0x220965[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x165c77['query'],_0x3fa9da[_0x53a5('0xca')]));if(_0x165c77[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x220965[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x220965[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x220965[_0x53a5('0x40')],function(_0x4254dd){var _0x4a9035={};_0x4a9035[_0x4254dd]={'$like':'%'+_0x165c77['query']['filter']+'%'};return _0x4a9035;})});}_0x220965=_['merge']({},_0x220965,_0x165c77['options']);return _0x593c36[_0x53a5('0x10e')](_0x220965);}})['then'](function(_0x50cf73){if(_0x50cf73){_0x1a0d36=_0x50cf73[_0x53a5('0x43')];if(!_0x165c77[_0x53a5('0x3c')]['hasOwnProperty'](_0x53a5('0xce'))){_0x220965[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x165c77[_0x53a5('0x3c')]['limit']);_0x220965['offset']=qs[_0x53a5('0x16')](_0x165c77[_0x53a5('0x3c')][_0x53a5('0x16')]);}return _0x593c36[_0x53a5('0x10e')](_0x220965);}})[_0x53a5('0x1d')](function(_0xa846cc){if(_0xa846cc){return _0xa846cc?{'count':_0x1a0d36,'rows':_0xa846cc}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x186d0f,null))[_0x53a5('0x49')](handleError(_0x186d0f,null));};exports[_0x53a5('0x10f')]=function(_0x103079,_0x78f3ca){var _0x398c70=_0x103079[_0x53a5('0x4a')]['id'];var _0x33b882=_0x103079[_0x53a5('0x50')]?_0x103079['body'][_0x53a5('0x52')]:null;var _0x201b5a=[];return Promise[_0x53a5('0xff')]()[_0x53a5('0x1d')](function(){if(!_0x33b882)throw new APIBadRequestError(_0x53a5('0x110'));})['then'](function(){return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x398c70}});})[_0x53a5('0x1d')](function(_0x39eb2c){if(!_0x39eb2c)throw new APINotFoundError(util[_0x53a5('0xe7')](_0x53a5('0xbd'),_0x103079[_0x53a5('0x4a')]['id']));return db[_0x53a5('0x111')][_0x53a5('0x112')](function(_0xfaa191){return _0x39eb2c[_0x53a5('0x10f')](_0x33b882,{'transaction':_0xfaa191})[_0x53a5('0x1d')](function(){return db[_0x53a5('0x10d')][_0x53a5('0x81')]({'where':{'id':{'$in':_0x33b882}}});})['then'](function(_0x4484a1){var _0x1da3a8=_[_0x53a5('0x28')](_0x4484a1,function(_0x1628c3){return _0x1628c3[_0x53a5('0x113')]();});return Promise[_0x53a5('0x80')](_0x1da3a8);})['then'](function(_0x17acd6){_0x201b5a=_[_0x53a5('0x114')](_0x17acd6);var _0x511bd2=_['map'](_0x201b5a,function(_0x2954a3){return _0x2954a3[_0x53a5('0x115')](_0x39eb2c['id'],{'transaction':_0xfaa191});});return Promise['all'](_0x511bd2);})[_0x53a5('0x1d')](function(){if(!_0x39eb2c[_0x53a5('0x94')])return;var _0x30117a=_['filter'](_0x201b5a,function(_0x504cbc){return _0x504cbc[_0x53a5('0x116')]('channel')==='Voice';});var _0x2989c4=_['map'](_0x30117a,function(_0x320dd4){return db['UserVoiceQueueRt']['upsert']({'membername':_0x39eb2c[_0x53a5('0x2c')],'UserId':_0x39eb2c['id'],'queue_name':_0x320dd4[_0x53a5('0x2c')],'VoiceQueueId':_0x320dd4['id'],'interface':_[_0x53a5('0x59')](_0x39eb2c['interface'])?util['format']('SIP/%s',_0x39eb2c[_0x53a5('0x2c')]):_0x39eb2c[_0x53a5('0x96')],'paused':_0x39eb2c['voicePause']||![],'penalty':_0x39eb2c['penalty']},{'transaction':_0xfaa191});});return Promise['all'](_0x2989c4);})['then'](function(){return db[_0x53a5('0x117')][_0x53a5('0x81')]({'where':{'teamId':{'$in':_0x33b882}}});})[_0x53a5('0x1d')](function(_0x3877fb){var _0x193e43=_[_0x53a5('0x28')](_0x3877fb,function(_0x557c93){return db[_0x53a5('0x118')][_0x53a5('0x74')]({'UserId':_0x39eb2c['id'],'VoicePrefixId':_0x557c93[_0x53a5('0x119')]},{'transaction':_0xfaa191});});return Promise[_0x53a5('0x80')](_0x193e43);});});})[_0x53a5('0x1d')](function(){for(var _0x1268ce=0x0;_0x1268ce<_0x201b5a[_0x53a5('0x43')];_0x1268ce++){var _0x3965c4=_0x201b5a[_0x1268ce][_0x53a5('0x116')](_0x53a5('0x93'));var _0x2e6b12=_0x3965c4+_0x53a5('0x9d');socket[_0x53a5('0x1f')]('user'+_0x3965c4+_0x53a5('0x11a'),{'UserId':_0x398c70,['queueField']:_0x201b5a[_0x1268ce]['id']});}})[_0x53a5('0x1d')](respondWithStatusCode(_0x78f3ca,null))[_0x53a5('0x49')](APIHandleError(_0x78f3ca));};exports[_0x53a5('0x11b')]=function(_0x15a840,_0x401fe2){var _0x2f11b5=_0x15a840['params']['id'];var _0x496bcd=null;if(_0x15a840[_0x53a5('0x3c')][_0x53a5('0x52')]){_0x496bcd=_[_0x53a5('0xa6')](_0x15a840[_0x53a5('0x3c')][_0x53a5('0x52')])?_0x15a840[_0x53a5('0x3c')][_0x53a5('0x52')]:[_0x15a840['query'][_0x53a5('0x52')]];}var _0xf99341=[];return Promise['resolve']()[_0x53a5('0x1d')](function(){if(!_0x496bcd)throw new APIBadRequestError(_0x53a5('0x11c'));})[_0x53a5('0x1d')](function(){return db['User'][_0x53a5('0x8f')]({'where':{'id':_0x2f11b5}});})['then'](function(_0xe8b2c7){if(!_0xe8b2c7)throw new APINotFoundError(util[_0x53a5('0xe7')](_0x53a5('0xbd'),_0x15a840['params']['id']));return db['sequelize'][_0x53a5('0x112')](function(_0x4f5f9b){return _0xe8b2c7[_0x53a5('0x11b')](_0x496bcd,{'transaction':_0x4f5f9b})[_0x53a5('0x1d')](function(){return db[_0x53a5('0x10d')][_0x53a5('0x81')]({'where':{'id':{'$in':_0x496bcd}}});})[_0x53a5('0x1d')](function(_0xe03529){var _0x2bfaa2=_[_0x53a5('0x28')](_0xe03529,function(_0x58c235){return _0x58c235['getAssociatedQueues']();});return Promise[_0x53a5('0x80')](_0x2bfaa2);})[_0x53a5('0x1d')](function(_0x2bd6ea){_0xf99341=_[_0x53a5('0x114')](_0x2bd6ea);var _0xca0c31=_['map'](_0xf99341,function(_0xb8b1a7){return _0xb8b1a7[_0x53a5('0x11d')](_0xe8b2c7['id'],{'transaction':_0x4f5f9b});});return Promise['all'](_0xca0c31);})[_0x53a5('0x1d')](function(){if(!_0xe8b2c7[_0x53a5('0x94')])return;var _0x41b9ca=_[_0x53a5('0x26')](_0xf99341,function(_0x5be760){return _0x5be760[_0x53a5('0x116')](_0x53a5('0x93'))==='Voice';});var _0x2d53de=_['map'](_0x41b9ca,function(_0x264228){return db[_0x53a5('0xa0')][_0x53a5('0x2e')]({'where':{'VoiceQueueId':_0x264228['id'],'UserId':_0xe8b2c7['id']},'transaction':_0x4f5f9b});});return Promise[_0x53a5('0x80')](_0x2d53de);})[_0x53a5('0x1d')](function(){return db[_0x53a5('0x117')][_0x53a5('0x81')]({'where':{'teamId':{'$in':_0x496bcd}}});})[_0x53a5('0x1d')](function(_0x3f0ada){var _0x599893=_[_0x53a5('0x28')](_0x3f0ada,function(_0x2c76ec){return db[_0x53a5('0x118')]['destroy']({'where':{'UserId':_0xe8b2c7['id'],'VoicePrefixId':_0x2c76ec['VoicePrefixId']}},{'transaction':_0x4f5f9b});});return Promise[_0x53a5('0x80')](_0x599893);});});})[_0x53a5('0x1d')](function(){for(var _0x267a66=0x0;_0x267a66<_0xf99341[_0x53a5('0x43')];_0x267a66++){var _0x49e1db=_0xf99341[_0x267a66]['getDataValue'](_0x53a5('0x93'));var _0x4a06f7=_0x49e1db+_0x53a5('0x9d');socket[_0x53a5('0x1f')](_0x53a5('0x22')+_0x49e1db+_0x53a5('0xa7'),{'UserId':_0x2f11b5,['queueField']:_0xf99341[_0x267a66]['id']});}})[_0x53a5('0x1d')](respondWithStatusCode(_0x401fe2,null))[_0x53a5('0x49')](APIHandleError(_0x401fe2));};exports['getLists']=function(_0x25a86e,_0x328814){var _0x39741b={};var _0x1fa491={};var _0x2a086f;var _0x101c87;return db['User']['findOne']({'where':{'id':_0x25a86e[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x328814,null))[_0x53a5('0x1d')](function(_0xa37b2c){if(_0xa37b2c){_0x2a086f=_0xa37b2c;_0x1fa491['model']=_[_0x53a5('0xc6')](db[_0x53a5('0x11e')]['rawAttributes']);_0x1fa491[_0x53a5('0x3c')]=_['keys'](_0x25a86e[_0x53a5('0x3c')]);_0x1fa491[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x1fa491[_0x53a5('0xc5')],_0x1fa491[_0x53a5('0x3c')]);_0x39741b[_0x53a5('0x40')]=_[_0x53a5('0xc7')](_0x1fa491['model'],qs['fields'](_0x25a86e[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x39741b[_0x53a5('0x40')]=_0x39741b['attributes'][_0x53a5('0x43')]?_0x39741b[_0x53a5('0x40')]:_0x1fa491[_0x53a5('0xc5')];_0x39741b['order']=qs[_0x53a5('0xc9')](_0x25a86e[_0x53a5('0x3c')][_0x53a5('0xc9')]);_0x39741b['where']=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x25a86e[_0x53a5('0x3c')],_0x1fa491[_0x53a5('0xca')]));if(_0x25a86e[_0x53a5('0x3c')][_0x53a5('0x26')]){_0x39741b[_0x53a5('0x3b')]=_['merge'](_0x39741b[_0x53a5('0x3b')],{'$or':_['map'](_0x39741b[_0x53a5('0x40')],function(_0x93ba71){var _0x50fd9e={};_0x50fd9e[_0x93ba71]={'$like':'%'+_0x25a86e[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x50fd9e;})});}_0x39741b=_['merge']({},_0x39741b,_0x25a86e[_0x53a5('0xd0')]);return _0x2a086f['getLists'](_0x39741b);}})[_0x53a5('0x1d')](function(_0x5875e5){if(_0x5875e5){_0x101c87=_0x5875e5[_0x53a5('0x43')];if(!_0x25a86e[_0x53a5('0x3c')]['hasOwnProperty'](_0x53a5('0xce'))){_0x39741b[_0x53a5('0x18')]=qs[_0x53a5('0x18')](_0x25a86e['query'][_0x53a5('0x18')]);_0x39741b['offset']=qs[_0x53a5('0x16')](_0x25a86e['query'][_0x53a5('0x16')]);}return _0x2a086f[_0x53a5('0x11f')](_0x39741b);}})[_0x53a5('0x1d')](function(_0x72bef6){if(_0x72bef6){return _0x72bef6?{'count':_0x101c87,'rows':_0x72bef6}:null;}})[_0x53a5('0x1d')](respondWithResult(_0x328814,null))[_0x53a5('0x49')](handleError(_0x328814,null));};exports['getAgents']=function(_0x22c1ca,_0x202e9f){var _0x54a8d1={};var _0x312be7={};var _0x322a68;return db[_0x53a5('0x32')][_0x53a5('0x8f')]({'where':{'id':_0x22c1ca[_0x53a5('0x4a')]['id']}})[_0x53a5('0x1d')](handleEntityNotFound(_0x202e9f,null))[_0x53a5('0x1d')](function(_0x17ff70){if(_0x17ff70){_0x322a68=_0x17ff70;_0x312be7[_0x53a5('0xc5')]=_[_0x53a5('0xc6')](db[_0x53a5('0x32')][_0x53a5('0x33')]);_0x312be7['query']=_['keys'](_0x22c1ca[_0x53a5('0x3c')]);_0x312be7[_0x53a5('0xca')]=_[_0x53a5('0xc7')](_0x312be7[_0x53a5('0xc5')],_0x312be7[_0x53a5('0x3c')]);_0x54a8d1[_0x53a5('0x40')]=_['intersection'](_0x312be7['model'],qs['fields'](_0x22c1ca[_0x53a5('0x3c')][_0x53a5('0xc8')]));_0x54a8d1[_0x53a5('0x40')]=_0x54a8d1[_0x53a5('0x40')][_0x53a5('0x43')]?_0x54a8d1[_0x53a5('0x40')]:_0x312be7[_0x53a5('0xc5')];_0x54a8d1[_0x53a5('0xd3')]=qs['sort'](_0x22c1ca[_0x53a5('0x3c')]['sort']);_0x54a8d1[_0x53a5('0x3b')]=qs[_0x53a5('0xca')](_[_0x53a5('0xcb')](_0x22c1ca[_0x53a5('0x3c')],_0x312be7[_0x53a5('0xca')]));if(_0x22c1ca['query'][_0x53a5('0x26')]){_0x54a8d1[_0x53a5('0x3b')]=_[_0x53a5('0x4c')](_0x54a8d1[_0x53a5('0x3b')],{'$or':_[_0x53a5('0x28')](_0x54a8d1[_0x53a5('0x40')],function(_0x10145d){var _0x21b67c={};_0x21b67c[_0x10145d]={'$like':'%'+_0x22c1ca[_0x53a5('0x3c')][_0x53a5('0x26')]+'%'};return _0x21b67c;})});}_0x54a8d1[_0x53a5('0xc5')]=db[_0x53a5('0x32')];_0x54a8d1['as']=_0x53a5('0x23');_0x54a8d1=_[_0x53a5('0x4c')]({},_0x54a8d1,_0x22c1ca[_0x53a5('0xd0')]);return _0x322a68[_0x53a5('0xf3')]({'include':[_0x54a8d1]});}})[_0x53a5('0x1d')](function(_0x287884){if(_0x287884){var _0x28c25c={},_0x31ef4e=[];for(var _0x4e23d9=0x0;_0x4e23d9<_0x287884[_0x53a5('0x43')];_0x4e23d9+=0x1){for(var _0x330263=0x0,_0x4bbead;_0x330263<_0x287884[_0x4e23d9]['Agents'][_0x53a5('0x43')];_0x330263+=0x1){_0x4bbead=_0x287884[_0x4e23d9][_0x53a5('0x23')][_0x330263][_0x53a5('0x20')]({'plain':!![]});_0x28c25c[_0x4bbead['id']]=_0x4bbead;}}_0x28c25c=_[_0x53a5('0x120')](_0x28c25c);for(var _0x366790=qs['offset'](_0x22c1ca[_0x53a5('0x3c')]['offset']);_0x366790<_0x28c25c[_0x53a5('0x43')]&&_0x31ef4e['length']=_0x40cf8e[_0x843a('0x4e')]){throw new Error(_0x843a('0x4f'));}})[_0x843a('0x17')](function(){if(_0x56c4bc){return db[_0x843a('0x26')][_0x843a('0x44')]({'where':{'membername':_0x56c4bc['name']},'individualHooks':!![]});}})[_0x843a('0x17')](function(){if(_0x56c4bc){return _0x56c4bc['getVoiceQueues']({'raw':!![]});}})[_0x843a('0x17')](function(_0x12ab4e){if(_0x56c4bc){if(_0x12ab4e){var _0x4a6820=[];_0x29fe2c=_0x12ab4e;if(_0x29fe2c[_0x843a('0x28')]){for(var _0x4dbc70=0x0;_0x4dbc70<_0x29fe2c['length'];_0x4dbc70++){_0x4a6820[_0x843a('0x2c')](db['UserVoiceQueueRt'][_0x843a('0x50')]({'membername':_0x56c4bc['name'],'UserId':_0x56c4bc['id'],'queue_name':_0x29fe2c[_0x4dbc70][_0x843a('0x22')],'VoiceQueueId':_0x29fe2c[_0x4dbc70]['id'],'interface':_0x5d294e,'paused':_0x56c4bc[_0x843a('0x49')]||![],'penalty':_0x29fe2c[_0x4dbc70][_0x843a('0x51')]||0x0}));}return BPromise[_0x843a('0x52')](_0x4a6820);}}}})[_0x843a('0x17')](function(){if(_0x56c4bc){return db[_0x843a('0x32')][_0x843a('0xf')]({'where':{'membername':_0x56c4bc[_0x843a('0x22')],'exitAt':null}});}})[_0x843a('0x17')](function(_0xb0a59f){if(_0x56c4bc){if(_0xb0a59f&&_0xb0a59f[_0x843a('0x28')]){var _0x2b46b7=[];_0xb0a59f['forEach'](function(_0x49a4f1){_0x2b46b7[_0x843a('0x2c')](_0x49a4f1['update']({'exitAt':moment()[_0x843a('0x29')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x843a('0x52')](_0x2b46b7);}}})[_0x843a('0x17')](function(){if(_0x56c4bc){var _0x4b38da=[];var _0x749007=[];var _0xd7e0e6=utils[_0x843a('0x53')]();var _0x39063a={'membername':_0x56c4bc[_0x843a('0x22')],'interface':_0x5d294e,'enterAt':moment()[_0x843a('0x29')](_0x843a('0x2a')),'role':_0x56c4bc[_0x843a('0x23')],'internal':_0x56c4bc[_0x843a('0x24')]};_0xd7e0e6[_0x843a('0x45')](function(_0x550337){_0x4b38da[_0x843a('0x2c')](_[_0x843a('0x54')]({'channel':_0x550337,'type':_0x843a('0x55'),'data1':_0x843a('0x56'),'data2':_0x5d294e},_0x39063a));if(_0x56c4bc[_0x843a('0x49')]){_0x749007[_0x843a('0x2c')](_[_0x843a('0x54')]({'channel':_0x550337,'type':_0x843a('0x27'),'data1':_0x843a('0x57')},_0x39063a));}});return db[_0x843a('0x32')][_0x843a('0x33')](_0x4b38da['concat'](_0x749007),{'individualHooks':!![]});}})[_0x843a('0x17')](function(){if(_0x56c4bc){return _0x56c4bc[_0x843a('0x34')]({'online':!![],'lastLoginAt':moment()[_0x843a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x56c4bc[_0x843a('0x49')]||![],'mailPause':_0x56c4bc[_0x843a('0x49')]||![],'chatPause':_0x56c4bc[_0x843a('0x49')]||![],'faxPause':_0x56c4bc['loginInPause']||![],'smsPause':_0x56c4bc[_0x843a('0x49')]||![],'openchannelPause':_0x56c4bc[_0x843a('0x49')]||![],'pauseType':_0x56c4bc['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x843a('0x2a')),'interface':_0x5d294e});}})[_0x843a('0x17')](function(_0x91db07){_0x4eef52(_0x91db07);})[_0x843a('0x19')](function(_0x3a1a77){_0x186f2b(_0x1fe341['error'](0x1f4,_0x3a1a77['message']));});});}; \ No newline at end of file +var _0xdd49=['system','LogoutUser','findOne','UserVoiceQueueRt','destroy','forEach','all','LoginUser','mobile','phone','loginInPause','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','bulkCreate','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','GetUser','User','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','catch','error','message','ShowUser','find','stringify','PauseUser','name','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','isNil','interface','SIP/%s','type','DEFAULT\x20PAUSE','role','uniqueid','update','body','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','unpause'];(function(_0xff5c1f,_0xabe381){var _0x412f49=function(_0x40cf4a){while(--_0x40cf4a){_0xff5c1f['push'](_0xff5c1f['shift']());}};_0x412f49(++_0xabe381);}(_0xdd49,0x12a));var _0x9dd4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdd49[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x9dd4('0x0'));var util=require(_0x9dd4('0x1'));var moment=require(_0x9dd4('0x2'));var BPromise=require(_0x9dd4('0x3'));var Redis=require(_0x9dd4('0x4'));var db=require(_0x9dd4('0x5'))['db'];var utils=require(_0x9dd4('0x6'));var logger=require(_0x9dd4('0x7'))(_0x9dd4('0x8'));var config=require(_0x9dd4('0x9'));config[_0x9dd4('0xa')]=_[_0x9dd4('0xb')](config[_0x9dd4('0xa')],{'host':_0x9dd4('0xc'),'port':0x18eb});var socket=require(_0x9dd4('0xd'))(new Redis(config['redis']));require(_0x9dd4('0xe'))['register'](socket);exports[_0x9dd4('0xf')]=function(_0x3b54cc){var _0x904447=this;return new Promise(function(_0x3e4d99,_0x230e49){return db[_0x9dd4('0x10')][_0x9dd4('0x11')]({'raw':_0x3b54cc['options']?_0x3b54cc[_0x9dd4('0x12')][_0x9dd4('0x13')]===undefined?!![]:![]:!![],'where':_0x3b54cc[_0x9dd4('0x12')]?_0x3b54cc[_0x9dd4('0x12')][_0x9dd4('0x14')]||null:null,'attributes':_0x3b54cc[_0x9dd4('0x12')]?_0x3b54cc['options'][_0x9dd4('0x15')]||null:null,'limit':_0x3b54cc[_0x9dd4('0x12')]?_0x3b54cc['options'][_0x9dd4('0x16')]||null:null,'include':_0x3b54cc['options']?_0x3b54cc[_0x9dd4('0x12')][_0x9dd4('0x17')]?_['map'](_0x3b54cc[_0x9dd4('0x12')][_0x9dd4('0x17')],function(_0x142fc3){return{'model':db[_0x142fc3[_0x9dd4('0x18')]],'as':_0x142fc3['as'],'attributes':_0x142fc3[_0x9dd4('0x15')],'include':_0x142fc3['include']?_[_0x9dd4('0x19')](_0x142fc3[_0x9dd4('0x17')],function(_0x451a66){return{'model':db[_0x451a66[_0x9dd4('0x18')]],'as':_0x451a66['as'],'attributes':_0x451a66[_0x9dd4('0x15')],'include':_0x451a66['include']?_[_0x9dd4('0x19')](_0x451a66[_0x9dd4('0x17')],function(_0x2d6520){return{'model':db[_0x2d6520[_0x9dd4('0x18')]],'as':_0x2d6520['as'],'attributes':_0x2d6520[_0x9dd4('0x15')]};}):[]};}):[]};}):[]:[]})[_0x9dd4('0x1a')](function(_0x164f2c){logger[_0x9dd4('0x1b')](_0x9dd4('0xf'),_0x3b54cc);logger[_0x9dd4('0x1c')](_0x9dd4('0xf'),_0x3b54cc,JSON['stringify'](_0x164f2c));_0x3e4d99(_0x164f2c);})[_0x9dd4('0x1d')](function(_0x263beb){logger[_0x9dd4('0x1e')](_0x9dd4('0xf'),_0x263beb[_0x9dd4('0x1f')],_0x3b54cc);_0x230e49(_0x904447[_0x9dd4('0x1e')](0x1f4,_0x263beb['message']));});});};exports[_0x9dd4('0x20')]=function(_0x26941){var _0x686097=this;return new Promise(function(_0x1b51db,_0x5d5e00){return db[_0x9dd4('0x10')][_0x9dd4('0x21')]({'raw':_0x26941[_0x9dd4('0x12')]?_0x26941['options'][_0x9dd4('0x13')]===undefined?!![]:![]:!![],'where':_0x26941['options']?_0x26941[_0x9dd4('0x12')][_0x9dd4('0x14')]||null:null,'attributes':_0x26941[_0x9dd4('0x12')]?_0x26941['options'][_0x9dd4('0x15')]||null:null,'include':_0x26941[_0x9dd4('0x12')]?_0x26941['options'][_0x9dd4('0x17')]?_['map'](_0x26941[_0x9dd4('0x12')][_0x9dd4('0x17')],function(_0x3734ce){return{'model':db[_0x3734ce[_0x9dd4('0x18')]],'as':_0x3734ce['as'],'attributes':_0x3734ce[_0x9dd4('0x15')],'include':_0x3734ce['include']?_[_0x9dd4('0x19')](_0x3734ce[_0x9dd4('0x17')],function(_0xe15d03){return{'model':db[_0xe15d03[_0x9dd4('0x18')]],'as':_0xe15d03['as'],'attributes':_0xe15d03[_0x9dd4('0x15')],'include':_0xe15d03[_0x9dd4('0x17')]?_[_0x9dd4('0x19')](_0xe15d03['include'],function(_0x113302){return{'model':db[_0x113302[_0x9dd4('0x18')]],'as':_0x113302['as'],'attributes':_0x113302['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dd4('0x1a')](function(_0x399483){logger[_0x9dd4('0x1b')](_0x9dd4('0x20'),_0x26941);logger[_0x9dd4('0x1c')]('ShowUser',_0x26941,JSON[_0x9dd4('0x22')](_0x399483));_0x1b51db(_0x399483);})['catch'](function(_0x37e188){logger[_0x9dd4('0x1e')](_0x9dd4('0x20'),_0x37e188[_0x9dd4('0x1f')],_0x26941);_0x5d5e00(_0x686097[_0x9dd4('0x1e')](0x1f4,_0x37e188[_0x9dd4('0x1f')]));});});};exports[_0x9dd4('0x23')]=function(_0x39a6f2){var _0x3d112e;return db['User'][_0x9dd4('0x21')]({'where':_0x39a6f2['options'][_0x9dd4('0x14')]||{},'attributes':['id',_0x9dd4('0x24'),'role',_0x9dd4('0x25'),'interface']})[_0x9dd4('0x1a')](function(_0xce3b40){if(!_0xce3b40){throw new Error(util[_0x9dd4('0x26')](_0x9dd4('0x27'),_0x39a6f2[_0x9dd4('0x28')]['id']));}_0x3d112e=_0xce3b40;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3d112e['id']},'individualHooks':!![]});})[_0x9dd4('0x1a')](function(){return db[_0x9dd4('0x29')]['findAll']({'where':{'membername':_0x3d112e[_0x9dd4('0x24')],'type':_0x9dd4('0x2a'),'exitAt':null}});})[_0x9dd4('0x1a')](function(_0x5dc304){if(_0x5dc304&&_0x5dc304[_0x9dd4('0x2b')]){var _0x487c58=moment()['format'](_0x9dd4('0x2c'));for(var _0x1252f3=0x0,_0x4a9915=_0x5dc304['length'];_0x1252f3<_0x4a9915;_0x1252f3++){_0x5dc304[_0x1252f3][_0x9dd4('0x2d')]({'exitAt':_0x487c58});}}})[_0x9dd4('0x1a')](function(){var _0x4590e2=[];var _0x4f7860=utils['getChannels']();_0x4f7860['forEach'](function(_0x319fea){_0x4590e2[_0x9dd4('0x2e')]({'channel':_0x319fea,'membername':_0x3d112e[_0x9dd4('0x24')],'interface':_[_0x9dd4('0x2f')](_0x3d112e[_0x9dd4('0x30')])?util[_0x9dd4('0x26')](_0x9dd4('0x31'),_0x3d112e['name']):_0x3d112e[_0x9dd4('0x30')],'type':'PAUSE','enterAt':moment()['format'](_0x9dd4('0x2c')),'data1':_0x39a6f2['body'][_0x9dd4('0x32')]||_0x9dd4('0x33'),'role':_0x3d112e[_0x9dd4('0x34')],'internal':_0x3d112e[_0x9dd4('0x25')],'uniqueid':_0x39a6f2['body'][_0x9dd4('0x35')]||null});});return db[_0x9dd4('0x29')]['bulkCreate'](_0x4590e2,{'individualHooks':!![]});})['then'](function(){return _0x3d112e[_0x9dd4('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x39a6f2[_0x9dd4('0x37')][_0x9dd4('0x32')]||_0x9dd4('0x33'),'lastPauseAt':moment()[_0x9dd4('0x26')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9dd4('0x1d')](function(_0x72a440){throw _0x72a440;});};exports['UnpauseUser']=function(_0x2e9d6f){return Promise[_0x9dd4('0x38')]()[_0x9dd4('0x1a')](function(){if(_0x2e9d6f[_0x9dd4('0x37')]['channel']&&!utils['isValidChannel'](_0x2e9d6f[_0x9dd4('0x37')][_0x9dd4('0x39')])){throw new Error(util[_0x9dd4('0x26')](_0x9dd4('0x3a'),_0x2e9d6f[_0x9dd4('0x37')][_0x9dd4('0x39')]));}return db[_0x9dd4('0x10')]['findOne']({'where':_0x2e9d6f['options'][_0x9dd4('0x14')]||{},'attributes':['id','name',_0x9dd4('0x34'),_0x9dd4('0x25'),_0x9dd4('0x30'),_0x9dd4('0x3b'),_0x9dd4('0x3c'),_0x9dd4('0x3d'),_0x9dd4('0x3e'),_0x9dd4('0x3f'),_0x9dd4('0x40'),'smsPause','whatsappPause','pauseType','lastPauseAt']});})[_0x9dd4('0x1a')](function(_0x5b230a){if(!_0x5b230a){throw new Error(util[_0x9dd4('0x26')](_0x9dd4('0x27'),_0x2e9d6f[_0x9dd4('0x28')]['id']));}return _0x5b230a[_0x9dd4('0x41')](_0x2e9d6f[_0x9dd4('0x37')]['channel'],_0x9dd4('0x42'));})[_0x9dd4('0x1d')](function(_0x50e158){throw _0x50e158;});};exports[_0x9dd4('0x43')]=function(_0x5dbcd6){var _0xd9e61f=this;return new Promise(function(_0x56579e,_0x223106){var _0x3bed30;return db[_0x9dd4('0x10')][_0x9dd4('0x44')]({'where':_0x5dbcd6[_0x9dd4('0x12')][_0x9dd4('0x14')]||{},'attributes':['id',_0x9dd4('0x24')]})[_0x9dd4('0x1a')](function(_0x567ad7){if(_0x567ad7){_0x3bed30=_0x567ad7;return db[_0x9dd4('0x45')][_0x9dd4('0x46')]({'where':{'membername':_0x3bed30[_0x9dd4('0x24')]},'individualHooks':!![]});}})['then'](function(){if(_0x3bed30){return db[_0x9dd4('0x29')][_0x9dd4('0x11')]({'where':{'membername':_0x3bed30['name'],'exitAt':null}});}})[_0x9dd4('0x1a')](function(_0x58fcd9){if(_0x3bed30){if(_0x58fcd9&&_0x58fcd9[_0x9dd4('0x2b')]){var _0x3e89af=[];_0x58fcd9[_0x9dd4('0x47')](function(_0x40a4ad){_0x3e89af[_0x9dd4('0x2e')](_0x40a4ad[_0x9dd4('0x36')]({'exitAt':moment()[_0x9dd4('0x26')](_0x9dd4('0x2c'))}));});return BPromise[_0x9dd4('0x48')](_0x3e89af);}}})[_0x9dd4('0x1a')](function(){if(_0x3bed30){return _0x3bed30['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9dd4('0x1a')](function(_0x37f242){_0x56579e(_0x37f242);})[_0x9dd4('0x1d')](function(_0x35e1f5){_0x223106(_0xd9e61f[_0x9dd4('0x1e')](0x1f4,_0x35e1f5[_0x9dd4('0x1f')]));});});};exports[_0x9dd4('0x49')]=function(_0x36ad6c){var _0x2e46a8=this;return new Promise(function(_0x8b072c,_0x3eb2f0){var _0x2a2402;var _0x3db984;var _0x377fe7;var _0x3802b7;return db[_0x9dd4('0x10')][_0x9dd4('0x44')]({'where':_0x36ad6c['options'][_0x9dd4('0x14')]||{},'attributes':['id',_0x9dd4('0x24'),'role',_0x9dd4('0x4a'),_0x9dd4('0x4b'),'internal',_0x9dd4('0x4c'),_0x9dd4('0x30')]})['then'](function(_0x4e2cc3){if(_0x4e2cc3){_0x2a2402=_0x4e2cc3;_0x3802b7=_0x36ad6c[_0x9dd4('0x37')][_0x9dd4('0x30')]?_0x36ad6c['body']['interface']:util[_0x9dd4('0x26')](_0x9dd4('0x31'),_0x2a2402[_0x9dd4('0x24')]);return db[_0x9dd4('0x10')]['count']({'where':{'role':_0x9dd4('0x4d'),'online':!![],'id':{'$ne':_0x2a2402['id']}}});}})['then'](function(_0x233d28){if(_0x233d28){_0x377fe7=_0x233d28;return require(_0x9dd4('0x4e'))[_0x9dd4('0x4f')]();}})[_0x9dd4('0x1a')](function(_0x4d9d3f){if(_0x4d9d3f&&_0x4d9d3f[_0x9dd4('0x50')]&&_0x377fe7>=_0x4d9d3f[_0x9dd4('0x50')]){throw new Error(_0x9dd4('0x51'));}})[_0x9dd4('0x1a')](function(){if(_0x2a2402){return db['UserVoiceQueueRt'][_0x9dd4('0x46')]({'where':{'membername':_0x2a2402[_0x9dd4('0x24')]},'individualHooks':!![]});}})['then'](function(){if(_0x2a2402){return _0x2a2402[_0x9dd4('0x52')]({'raw':!![]});}})['then'](function(_0xa2c546){if(_0x2a2402){if(_0xa2c546){var _0x5bae9e=[];_0x3db984=_0xa2c546;if(_0x3db984[_0x9dd4('0x2b')]){for(var _0x26244e=0x0;_0x26244e<_0x3db984[_0x9dd4('0x2b')];_0x26244e++){_0x5bae9e[_0x9dd4('0x2e')](db['UserVoiceQueueRt'][_0x9dd4('0x53')]({'membername':_0x2a2402[_0x9dd4('0x24')],'UserId':_0x2a2402['id'],'queue_name':_0x3db984[_0x26244e][_0x9dd4('0x24')],'VoiceQueueId':_0x3db984[_0x26244e]['id'],'interface':_0x3802b7,'paused':_0x2a2402[_0x9dd4('0x4c')]||![],'penalty':_0x3db984[_0x26244e][_0x9dd4('0x54')]||0x0}));}return BPromise[_0x9dd4('0x48')](_0x5bae9e);}}}})['then'](function(){if(_0x2a2402){return db[_0x9dd4('0x29')][_0x9dd4('0x11')]({'where':{'membername':_0x2a2402['name'],'exitAt':null}});}})[_0x9dd4('0x1a')](function(_0x36ab8b){if(_0x2a2402){if(_0x36ab8b&&_0x36ab8b['length']){var _0x43da58=[];_0x36ab8b[_0x9dd4('0x47')](function(_0x460f17){_0x43da58[_0x9dd4('0x2e')](_0x460f17[_0x9dd4('0x36')]({'exitAt':moment()[_0x9dd4('0x26')](_0x9dd4('0x2c'))}));});return BPromise['all'](_0x43da58);}}})[_0x9dd4('0x1a')](function(){if(_0x2a2402){var _0xb53979=[];var _0x5ec930=[];var _0x457630=utils[_0x9dd4('0x55')]();var _0xf554c9={'membername':_0x2a2402[_0x9dd4('0x24')],'interface':_0x3802b7,'enterAt':moment()[_0x9dd4('0x26')](_0x9dd4('0x2c')),'role':_0x2a2402[_0x9dd4('0x34')],'internal':_0x2a2402[_0x9dd4('0x25')]};_0x457630[_0x9dd4('0x47')](function(_0x105626){_0xb53979[_0x9dd4('0x2e')](_[_0x9dd4('0x56')]({'channel':_0x105626,'type':_0x9dd4('0x57'),'data1':_0x9dd4('0x58'),'data2':_0x3802b7},_0xf554c9));if(_0x2a2402[_0x9dd4('0x4c')]){_0x5ec930['push'](_[_0x9dd4('0x56')]({'channel':_0x105626,'type':_0x9dd4('0x2a'),'data1':'LOGININPAUSE'},_0xf554c9));}});return db['MemberReport'][_0x9dd4('0x59')](_0xb53979[_0x9dd4('0x5a')](_0x5ec930),{'individualHooks':!![]});}})[_0x9dd4('0x1a')](function(){if(_0x2a2402){return _0x2a2402[_0x9dd4('0x36')]({'online':!![],'lastLoginAt':moment()['format'](_0x9dd4('0x2c')),'voicePause':_0x2a2402[_0x9dd4('0x4c')]||![],'mailPause':_0x2a2402['loginInPause']||![],'chatPause':_0x2a2402['loginInPause']||![],'faxPause':_0x2a2402[_0x9dd4('0x4c')]||![],'smsPause':_0x2a2402[_0x9dd4('0x4c')]||![],'openchannelPause':_0x2a2402[_0x9dd4('0x4c')]||![],'pauseType':_0x2a2402[_0x9dd4('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x9dd4('0x2c')),'interface':_0x3802b7});}})[_0x9dd4('0x1a')](function(_0x1316a8){_0x8b072c(_0x1316a8);})[_0x9dd4('0x1d')](function(_0x4a2daa){_0x3eb2f0(_0x2e46a8['error'](0x1f4,_0x4a2daa[_0x9dd4('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b4d48bb..caa06ad 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 _0x6642=['register','length','user:','./user.events','update','removeListener'];(function(_0x3dc477,_0x3670c9){var _0x3fc1a8=function(_0x149e8b){while(--_0x149e8b){_0x3dc477['push'](_0x3dc477['shift']());}};_0x3fc1a8(++_0x3670c9);}(_0x6642,0xed));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x2664('0x0'));var events=['save','remove',_0x2664('0x1')];function createListener(_0x2ad635,_0x4723f3){return function(_0x39251a){_0x4723f3['emit'](_0x2ad635,_0x39251a);};}function removeListener(_0x553903,_0x5c5c4c){return function(){UserEvents[_0x2664('0x2')](_0x553903,_0x5c5c4c);};}exports[_0x2664('0x3')]=function(_0x65d277){for(var _0x52d467=0x0,_0x1804ed=events[_0x2664('0x4')];_0x52d467<_0x1804ed;_0x52d467++){var _0x12f7d7=events[_0x52d467];var _0x35c1ba=createListener(_0x2664('0x5')+_0x12f7d7,_0x65d277);UserEvents['on'](_0x12f7d7,_0x35c1ba);}}; \ No newline at end of file +var _0x61d3=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x61d3,0x71));var _0x361d=function(_0x308f79,_0x121c42){_0x308f79=_0x308f79-0x0;var _0x71490e=_0x61d3[_0x308f79];return _0x71490e;};'use strict';var UserEvents=require(_0x361d('0x0'));var events=[_0x361d('0x1'),_0x361d('0x2'),_0x361d('0x3')];function createListener(_0x4a4d94,_0x5ad28b){return function(_0x2c938e){_0x5ad28b[_0x361d('0x4')](_0x4a4d94,_0x2c938e);};}function removeListener(_0x213645,_0x5d13f1){return function(){UserEvents[_0x361d('0x5')](_0x213645,_0x5d13f1);};}exports[_0x361d('0x6')]=function(_0x1837fb){for(var _0x1114fd=0x0,_0x48053d=events[_0x361d('0x7')];_0x1114fd<_0x48053d;_0x1114fd++){var _0x1d5e6e=events[_0x1114fd];var _0x1103fd=createListener(_0x361d('0x8')+_0x1d5e6e,_0x1837fb);UserEvents['on'](_0x1d5e6e,_0x1103fd);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4577e32..77cc53b 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x489b01,_0x597248){var _0x5dcc6c=function(_0xf8a48e){while(--_0xf8a48e){_0x489b01['push'](_0x489b01['shift']());}};_0x5dcc6c(++_0x597248);}(_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 +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3199af,_0x339560){var _0x5aa4d0=function(_0x1cb5f0){while(--_0x1cb5f0){_0x3199af['push'](_0x3199af['shift']());}};_0x5aa4d0(++_0x339560);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index fb1c9ee..9006424 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 _0xcbe5=['INTEGER','sequelize','exports'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xcbe5,0xee));var _0x5cbe=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcbe5[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x5cbe('0x0'));module[_0x5cbe('0x1')]={'penalty':{'type':Sequelize[_0x5cbe('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 0a344dd..a1413b0 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 _0xc5d9=['define','user_has_chat_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x8346f1,_0x5a67dd){var _0x24abb7=function(_0x48cdb9){while(--_0x48cdb9){_0x8346f1['push'](_0x8346f1['shift']());}};_0x24abb7(++_0x5a67dd);}(_0xc5d9,0x91));var _0x9c5d=function(_0x577831,_0x5b8f90){_0x577831=_0x577831-0x0;var _0x181033=_0xc5d9[_0x577831];return _0x181033;};'use strict';var _=require('lodash');var util=require(_0x9c5d('0x0'));var logger=require('../../config/logger')(_0x9c5d('0x1'));var moment=require(_0x9c5d('0x2'));var BPromise=require(_0x9c5d('0x3'));var rp=require(_0x9c5d('0x4'));var fs=require('fs');var path=require(_0x9c5d('0x5'));var rimraf=require(_0x9c5d('0x6'));var config=require(_0x9c5d('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x9c5d('0x8')]=function(_0x5a756a,_0x43e042){return _0x5a756a[_0x9c5d('0x9')]('UserChatQueue',attributes,{'tableName':_0x9c5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadd9=['request-promise','rimraf','../../config/environment','./userChatQueue.attributes','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34b3b7,_0x50676a){var _0x3a3bc0=function(_0x1a442f){while(--_0x1a442f){_0x34b3b7['push'](_0x34b3b7['shift']());}};_0x3a3bc0(++_0x50676a);}(_0xadd9,0x11a));var _0x9add=function(_0x540d0e,_0x3ed766){_0x540d0e=_0x540d0e-0x0;var _0x515efa=_0xadd9[_0x540d0e];return _0x515efa;};'use strict';var _=require(_0x9add('0x0'));var util=require(_0x9add('0x1'));var logger=require(_0x9add('0x2'))(_0x9add('0x3'));var moment=require(_0x9add('0x4'));var BPromise=require(_0x9add('0x5'));var rp=require(_0x9add('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9add('0x7'));var config=require(_0x9add('0x8'));var attributes=require(_0x9add('0x9'));module['exports']=function(_0xe9e608,_0x4676a4){return _0xe9e608['define'](_0x9add('0xa'),attributes,{'tableName':_0x9add('0xb'),'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 73bbcaf..cfaf45d 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 _0x8078=['then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x5f2a50,_0x4700e0){var _0x7577ca=function(_0x45f47e){while(--_0x45f47e){_0x5f2a50['push'](_0x5f2a50['shift']());}};_0x7577ca(++_0x4700e0);}(_0x8078,0x1d3));var _0x8807=function(_0x295bcc,_0x3a69a0){_0x295bcc=_0x295bcc-0x0;var _0x245893=_0x8078[_0x295bcc];return _0x245893;};'use strict';var _=require(_0x8807('0x0'));var util=require('util');var moment=require(_0x8807('0x1'));var BPromise=require(_0x8807('0x2'));var rs=require(_0x8807('0x3'));var fs=require('fs');var Redis=require(_0x8807('0x4'));var db=require(_0x8807('0x5'))['db'];var utils=require(_0x8807('0x6'));var logger=require(_0x8807('0x7'))('rpc');var config=require(_0x8807('0x8'));var jayson=require(_0x8807('0x9'));var client=jayson[_0x8807('0xa')][_0x8807('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19cf68,_0x24eaa4,_0xda8f84){return new BPromise(function(_0x4d0885,_0x4c7f76){return client[_0x8807('0xc')](_0x19cf68,_0xda8f84)[_0x8807('0xd')](function(_0x1cd6c1){logger[_0x8807('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x24eaa4,'request\x20sent');logger[_0x8807('0xf')](_0x8807('0x10'),_0x24eaa4,_0x8807('0x11'),JSON[_0x8807('0x12')](_0x1cd6c1));if(_0x1cd6c1['error']){if(_0x1cd6c1[_0x8807('0x13')][_0x8807('0x14')]===0x1f4){logger[_0x8807('0x13')](_0x8807('0x15'),_0x24eaa4,_0x1cd6c1[_0x8807('0x13')][_0x8807('0x16')]);return _0x4c7f76(_0x1cd6c1[_0x8807('0x13')]['message']);}logger[_0x8807('0x13')](_0x8807('0x15'),_0x24eaa4,_0x1cd6c1[_0x8807('0x13')][_0x8807('0x16')]);return _0x4d0885(_0x1cd6c1['error']['message']);}else{logger[_0x8807('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x24eaa4,'request\x20sent');_0x4d0885(_0x1cd6c1[_0x8807('0x17')][_0x8807('0x16')]);}})['catch'](function(_0x4946ed){logger[_0x8807('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x24eaa4,_0x4946ed);_0x4c7f76(_0x4946ed);});});} \ No newline at end of file +var _0x4fc3=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','UserChatQueue,\x20%s,\x20%s'];(function(_0x20ff00,_0x22a2b2){var _0x2e7cb8=function(_0xce48f6){while(--_0xce48f6){_0x20ff00['push'](_0x20ff00['shift']());}};_0x2e7cb8(++_0x22a2b2);}(_0x4fc3,0x14c));var _0x34fc=function(_0x2111db,_0x24a22c){_0x2111db=_0x2111db-0x0;var _0xa2ba25=_0x4fc3[_0x2111db];return _0xa2ba25;};'use strict';var _=require(_0x34fc('0x0'));var util=require(_0x34fc('0x1'));var moment=require(_0x34fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x34fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34fc('0x4'))['db'];var utils=require(_0x34fc('0x5'));var logger=require('../../config/logger')(_0x34fc('0x6'));var config=require(_0x34fc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34fc('0x8')][_0x34fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x471972,_0x168ced,_0x371b5a){return new BPromise(function(_0x2b015f,_0x29edea){return client[_0x34fc('0xa')](_0x471972,_0x371b5a)[_0x34fc('0xb')](function(_0x326d67){logger[_0x34fc('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x168ced,_0x34fc('0xd'));logger[_0x34fc('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x168ced,_0x34fc('0xd'),JSON[_0x34fc('0xf')](_0x326d67));if(_0x326d67[_0x34fc('0x10')]){if(_0x326d67[_0x34fc('0x10')][_0x34fc('0x11')]===0x1f4){logger[_0x34fc('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x168ced,_0x326d67[_0x34fc('0x10')][_0x34fc('0x12')]);return _0x29edea(_0x326d67[_0x34fc('0x10')][_0x34fc('0x12')]);}logger['error'](_0x34fc('0x13'),_0x168ced,_0x326d67['error'][_0x34fc('0x12')]);return _0x2b015f(_0x326d67['error'][_0x34fc('0x12')]);}else{logger['info'](_0x34fc('0x13'),_0x168ced,_0x34fc('0xd'));_0x2b015f(_0x326d67[_0x34fc('0x14')]['message']);}})[_0x34fc('0x15')](function(_0x3a6555){logger['error'](_0x34fc('0x13'),_0x168ced,_0x3a6555);_0x29edea(_0x3a6555);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 507991e..0f2825e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x220fa9,_0x4255fb){var _0x518ed5=function(_0x280cd9){while(--_0x280cd9){_0x220fa9['push'](_0x220fa9['shift']());}};_0x518ed5(++_0x4255fb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x50aa3b,_0x4e92e1){var _0x4fa6da=function(_0x200ec1){while(--_0x200ec1){_0x50aa3b['push'](_0x50aa3b['shift']());}};_0x4fa6da(++_0x4e92e1);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 5e0a8dc..2561204 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 _0xf0fb=['STRING','exports','INTEGER'];(function(_0x526cee,_0x4752f5){var _0x318f56=function(_0x527f66){while(--_0x527f66){_0x526cee['push'](_0x526cee['shift']());}};_0x318f56(++_0x4752f5);}(_0xf0fb,0x1e7));var _0xbf0f=function(_0x913b85,_0x213182){_0x913b85=_0x913b85-0x0;var _0x1ce434=_0xf0fb[_0x913b85];return _0x1ce434;};'use strict';var Sequelize=require('sequelize');module[_0xbf0f('0x0')]={'penalty':{'type':Sequelize[_0xbf0f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbf0f('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbf0f('0x2')]}}; \ No newline at end of file +var _0xc371=['sequelize','INTEGER'];(function(_0x5ac4fb,_0x45525f){var _0x5af491=function(_0x4ec070){while(--_0x4ec070){_0x5ac4fb['push'](_0x5ac4fb['shift']());}};_0x5af491(++_0x45525f);}(_0xc371,0x13c));var _0x1c37=function(_0x37b004,_0x52d4b7){_0x37b004=_0x37b004-0x0;var _0x180d3d=_0xc371[_0x37b004];return _0x180d3d;};'use strict';var Sequelize=require(_0x1c37('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1c37('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1c37('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index b1bdbf0..e654b49 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 _0x216e=['UserFaxQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x216e,0x121));var _0xe216=function(_0x3e5d83,_0x44d303){_0x3e5d83=_0x3e5d83-0x0;var _0x22bef2=_0x216e[_0x3e5d83];return _0x22bef2;};'use strict';var _=require(_0xe216('0x0'));var util=require(_0xe216('0x1'));var logger=require(_0xe216('0x2'))(_0xe216('0x3'));var moment=require(_0xe216('0x4'));var BPromise=require('bluebird');var rp=require(_0xe216('0x5'));var fs=require('fs');var path=require(_0xe216('0x6'));var rimraf=require(_0xe216('0x7'));var config=require(_0xe216('0x8'));var attributes=require(_0xe216('0x9'));module['exports']=function(_0x1c9d54,_0x2d3cbc){return _0x1c9d54[_0xe216('0xa')](_0xe216('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb0c=['user_has_fax_queues','lodash','util','api','bluebird','request-promise','path','rimraf','exports','define','UserFaxQueue'];(function(_0x572b9a,_0x501bca){var _0x33e045=function(_0xb559ec){while(--_0xb559ec){_0x572b9a['push'](_0x572b9a['shift']());}};_0x33e045(++_0x501bca);}(_0xdb0c,0x11f));var _0xcdb0=function(_0x16f867,_0x555c27){_0x16f867=_0x16f867-0x0;var _0x3c99f9=_0xdb0c[_0x16f867];return _0x3c99f9;};'use strict';var _=require(_0xcdb0('0x0'));var util=require(_0xcdb0('0x1'));var logger=require('../../config/logger')(_0xcdb0('0x2'));var moment=require('moment');var BPromise=require(_0xcdb0('0x3'));var rp=require(_0xcdb0('0x4'));var fs=require('fs');var path=require(_0xcdb0('0x5'));var rimraf=require(_0xcdb0('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0xcdb0('0x7')]=function(_0x394b3c,_0x31c57a){return _0x394b3c[_0xcdb0('0x8')](_0xcdb0('0x9'),attributes,{'tableName':_0xcdb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 7ea72ce..0697572 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 _0x8779=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0x8779,0x1e0));var _0x9877=function(_0x26ea35,_0x26899c){_0x26ea35=_0x26ea35-0x0;var _0x284134=_0x8779[_0x26ea35];return _0x284134;};'use strict';var _=require(_0x9877('0x0'));var util=require('util');var moment=require(_0x9877('0x1'));var BPromise=require(_0x9877('0x2'));var rs=require(_0x9877('0x3'));var fs=require('fs');var Redis=require(_0x9877('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9877('0x5'));var logger=require(_0x9877('0x6'))(_0x9877('0x7'));var config=require(_0x9877('0x8'));var jayson=require(_0x9877('0x9'));var client=jayson[_0x9877('0xa')][_0x9877('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x325a0a,_0x4f86ca,_0x24ec68){return new BPromise(function(_0xa9a806,_0x395b4f){return client[_0x9877('0xc')](_0x325a0a,_0x24ec68)[_0x9877('0xd')](function(_0x41d061){logger[_0x9877('0xe')](_0x9877('0xf'),_0x4f86ca,'request\x20sent');logger[_0x9877('0x10')](_0x9877('0x11'),_0x4f86ca,_0x9877('0x12'),JSON['stringify'](_0x41d061));if(_0x41d061['error']){if(_0x41d061[_0x9877('0x13')][_0x9877('0x14')]===0x1f4){logger['error'](_0x9877('0xf'),_0x4f86ca,_0x41d061[_0x9877('0x13')][_0x9877('0x15')]);return _0x395b4f(_0x41d061[_0x9877('0x13')]['message']);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4f86ca,_0x41d061['error']['message']);return _0xa9a806(_0x41d061[_0x9877('0x13')][_0x9877('0x15')]);}else{logger[_0x9877('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4f86ca,'request\x20sent');_0xa9a806(_0x41d061['result'][_0x9877('0x15')]);}})[_0x9877('0x16')](function(_0xcad664){logger['error'](_0x9877('0xf'),_0x4f86ca,_0xcad664);_0x395b4f(_0xcad664);});});} \ No newline at end of file +var _0x1a58=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','catch','lodash','randomstring'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x1a58,0x1b6));var _0x81a5=function(_0x53e67e,_0x27b029){_0x53e67e=_0x53e67e-0x0;var _0x29fea3=_0x1a58[_0x53e67e];return _0x29fea3;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81a5('0x1'));var fs=require('fs');var Redis=require(_0x81a5('0x2'));var db=require(_0x81a5('0x3'))['db'];var utils=require(_0x81a5('0x4'));var logger=require(_0x81a5('0x5'))(_0x81a5('0x6'));var config=require(_0x81a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x81a5('0x8')][_0x81a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x882e6d,_0x230901,_0x2eefaf){return new BPromise(function(_0x5b6070,_0x2dafee){return client[_0x81a5('0xa')](_0x882e6d,_0x2eefaf)[_0x81a5('0xb')](function(_0x222675){logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));logger[_0x81a5('0xf')](_0x81a5('0x10'),_0x230901,_0x81a5('0xe'),JSON[_0x81a5('0x11')](_0x222675));if(_0x222675[_0x81a5('0x12')]){if(_0x222675[_0x81a5('0x12')][_0x81a5('0x13')]===0x1f4){logger[_0x81a5('0x12')](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);return _0x2dafee(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}logger['error'](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')]['message']);return _0x5b6070(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}else{logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));_0x5b6070(_0x222675['result']['message']);}})[_0x81a5('0x15')](function(_0x150d74){logger[_0x81a5('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x230901,_0x150d74);_0x2dafee(_0x150d74);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7353e8b..db63d59 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4f00b2,_0x43d128){var _0x49fa5d=function(_0x37824b){while(--_0x37824b){_0x4f00b2['push'](_0x4f00b2['shift']());}};_0x49fa5d(++_0x43d128);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0xcb91[_0x5756c6];return _0x4b5806;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x204671,_0x2cc028){var _0x16effa=function(_0xcdcaea){while(--_0xcdcaea){_0x204671['push'](_0x204671['shift']());}};_0x16effa(++_0x2cc028);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2618b5e..48603ba 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 _0x0b03=['exports','INTEGER','sequelize'];(function(_0x3c1c93,_0x37a5a5){var _0x1bd4d4=function(_0x160615){while(--_0x160615){_0x3c1c93['push'](_0x3c1c93['shift']());}};_0x1bd4d4(++_0x37a5a5);}(_0x0b03,0x19a));var _0x30b0=function(_0x4fd56e,_0x52db7c){_0x4fd56e=_0x4fd56e-0x0;var _0x80b7d2=_0x0b03[_0x4fd56e];return _0x80b7d2;};'use strict';var Sequelize=require(_0x30b0('0x0'));module[_0x30b0('0x1')]={'penalty':{'type':Sequelize[_0x30b0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb681=['sequelize','exports','INTEGER'];(function(_0x1fec1e,_0xce18d2){var _0x31f9ec=function(_0x347a9a){while(--_0x347a9a){_0x1fec1e['push'](_0x1fec1e['shift']());}};_0x31f9ec(++_0xce18d2);}(_0xb681,0x153));var _0x1b68=function(_0x5c11f3,_0x565efa){_0x5c11f3=_0x5c11f3-0x0;var _0x45f63a=_0xb681[_0x5c11f3];return _0x45f63a;};'use strict';var Sequelize=require(_0x1b68('0x0'));module[_0x1b68('0x1')]={'penalty':{'type':Sequelize[_0x1b68('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 9a4fab7..1cc1526 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 _0x9bf7=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes'];(function(_0x5ee507,_0x59e998){var _0x223caf=function(_0x39bfad){while(--_0x39bfad){_0x5ee507['push'](_0x5ee507['shift']());}};_0x223caf(++_0x59e998);}(_0x9bf7,0x162));var _0x79bf=function(_0x254fd4,_0x1a100b){_0x254fd4=_0x254fd4-0x0;var _0x17a264=_0x9bf7[_0x254fd4];return _0x17a264;};'use strict';var _=require(_0x79bf('0x0'));var util=require(_0x79bf('0x1'));var logger=require(_0x79bf('0x2'))(_0x79bf('0x3'));var moment=require(_0x79bf('0x4'));var BPromise=require(_0x79bf('0x5'));var rp=require(_0x79bf('0x6'));var fs=require('fs');var path=require(_0x79bf('0x7'));var rimraf=require('rimraf');var config=require(_0x79bf('0x8'));var attributes=require(_0x79bf('0x9'));module[_0x79bf('0xa')]=function(_0x3a1b76,_0x1c1422){return _0x3a1b76[_0x79bf('0xb')](_0x79bf('0xc'),attributes,{'tableName':_0x79bf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dc2=['define','user_has_mail_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x4e65c2,_0x18237c){var _0x21bf48=function(_0x51d501){while(--_0x51d501){_0x4e65c2['push'](_0x4e65c2['shift']());}};_0x21bf48(++_0x18237c);}(_0x2dc2,0x70));var _0x22dc=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x2dc2[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x22dc('0x0'));var util=require(_0x22dc('0x1'));var logger=require(_0x22dc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x22dc('0x3'));var rp=require(_0x22dc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22dc('0x5'));var config=require(_0x22dc('0x6'));var attributes=require(_0x22dc('0x7'));module[_0x22dc('0x8')]=function(_0x4f5309,_0x5cdcae){return _0x4f5309[_0x22dc('0x9')]('UserMailQueue',attributes,{'tableName':_0x22dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index cdbd341..777e77a 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4209a7,_0x350b11){var _0x5119fa=function(_0x2807b1){while(--_0x2807b1){_0x4209a7['push'](_0x4209a7['shift']());}};_0x5119fa(++_0x350b11);}(_0xa41a,0x6b));var _0xaa41=function(_0x47b6ff,_0xc8344a){_0x47b6ff=_0x47b6ff-0x0;var _0x306227=_0xa41a[_0x47b6ff];return _0x306227;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _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(_0x5678a5,_0x43505b){var _0x195890=function(_0x1788bb){while(--_0x1788bb){_0x5678a5['push'](_0x5678a5['shift']());}};_0x195890(++_0x43505b);}(_0x6aa7,0x178));var _0x76aa=function(_0x18f36f,_0x365f71){_0x18f36f=_0x18f36f-0x0;var _0x214f59=_0x6aa7[_0x18f36f];return _0x214f59;};'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 fc3dbd9..69c5610 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 _0xabad=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','path','express','Router'];(function(_0x48f532,_0x116847){var _0x558b6c=function(_0x382120){while(--_0x382120){_0x48f532['push'](_0x48f532['shift']());}};_0x558b6c(++_0x116847);}(_0xabad,0x1b5));var _0xdaba=function(_0x1d0b80,_0x41fc24){_0x1d0b80=_0x1d0b80-0x0;var _0x35d642=_0xabad[_0x1d0b80];return _0x35d642;};'use strict';var multer=require(_0xdaba('0x0'));var util=require(_0xdaba('0x1'));var path=require(_0xdaba('0x2'));var timeout=require('connect-timeout');var express=require(_0xdaba('0x3'));var router=express[_0xdaba('0x4')]();var fs_extra=require(_0xdaba('0x5'));var auth=require(_0xdaba('0x6'));var interaction=require(_0xdaba('0x7'));var config=require(_0xdaba('0x8'));var controller=require('./userNotification.controller');router[_0xdaba('0x9')]('/',auth[_0xdaba('0xa')](),controller[_0xdaba('0xb')]);module[_0xdaba('0xc')]=router; \ No newline at end of file +var _0xc842=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout'];(function(_0x1a8f8f,_0x2d8cc4){var _0x5a3e09=function(_0x2194bc){while(--_0x2194bc){_0x1a8f8f['push'](_0x1a8f8f['shift']());}};_0x5a3e09(++_0x2d8cc4);}(_0xc842,0xa4));var _0x2c84=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xc842[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0x2c84('0x0'));var util=require(_0x2c84('0x1'));var path=require(_0x2c84('0x2'));var timeout=require(_0x2c84('0x3'));var express=require('express');var router=express[_0x2c84('0x4')]();var fs_extra=require(_0x2c84('0x5'));var auth=require(_0x2c84('0x6'));var interaction=require(_0x2c84('0x7'));var config=require(_0x2c84('0x8'));var controller=require(_0x2c84('0x9'));router[_0x2c84('0xa')]('/',auth[_0x2c84('0xb')](),controller[_0x2c84('0xc')]);module[_0x2c84('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index cac0f30..de41dda 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 _0x3d42=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d42,0x107));var _0x23d4=function(_0x4adef5,_0x153611){_0x4adef5=_0x4adef5-0x0;var _0xbafb6d=_0x3d42[_0x4adef5];return _0xbafb6d;};'use strict';var Sequelize=require(_0x23d4('0x0'));module[_0x23d4('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x23d4('0x2')]},'recipientsId':{'type':Sequelize[_0x23d4('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x23d4('0x4')]}}; \ No newline at end of file +var _0x08f7=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2fc480,_0x2702ff){var _0x12bb41=function(_0x25f7f3){while(--_0x25f7f3){_0x2fc480['push'](_0x2fc480['shift']());}};_0x12bb41(++_0x2702ff);}(_0x08f7,0x10c));var _0x708f=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x08f7[_0x5ce3c8];return _0xa76867;};'use strict';var Sequelize=require(_0x708f('0x0'));module[_0x708f('0x1')]={'body':{'type':Sequelize[_0x708f('0x2')]},'senderName':{'type':Sequelize[_0x708f('0x3')]},'recipientsId':{'type':Sequelize[_0x708f('0x2')]},'recipientsDescription':{'type':Sequelize[_0x708f('0x3')]},'beep':{'type':Sequelize[_0x708f('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index f0a7930..266aaba 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 _0x6505=['to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','error','stack','name','send','sendUserNotification','text','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','hasOwnProperty','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','voicequeue','whatsappqueue','some','toLowerCase','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','join','create','recipient','emit','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','forEach','model','union','ids','queue','Queue','push','findOne','getAgents','map','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x44a680,_0x3298cc){var _0x16b806=function(_0x4db6b0){while(--_0x4db6b0){_0x44a680['push'](_0x44a680['shift']());}};_0x16b806(++_0x3298cc);}(_0x6505,0xb3));var _0x5650=function(_0x1bb5ac,_0x54147f){_0x1bb5ac=_0x1bb5ac-0x0;var _0x10a437=_0x6505[_0x1bb5ac];return _0x10a437;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5650('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5650('0x1'));var rp=require(_0x5650('0x2'));var moment=require(_0x5650('0x3'));var BPromise=require(_0x5650('0x4'));var Mustache=require(_0x5650('0x5'));var util=require(_0x5650('0x6'));var path=require(_0x5650('0x7'));var sox=require(_0x5650('0x8'));var csv=require(_0x5650('0x9'));var ejs=require(_0x5650('0xa'));var fs=require('fs');var fs_extra=require(_0x5650('0xb'));var _=require(_0x5650('0xc'));var squel=require('squel');var crypto=require(_0x5650('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5650('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5650('0xf'));var as=require(_0x5650('0x10'));var hardwareService=require(_0x5650('0x11'));var logger=require(_0x5650('0x12'))(_0x5650('0x13'));var utils=require(_0x5650('0x14'));var config=require(_0x5650('0x15'));var licenseUtil=require(_0x5650('0x16'));var db=require(_0x5650('0x17'))['db'];config[_0x5650('0x18')]=_[_0x5650('0x19')](config['redis'],{'host':_0x5650('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5650('0x18')]));require(_0x5650('0x1b'))[_0x5650('0x1c')](socket);function respondWithStatusCode(_0x3d2750,_0x5766a0){_0x5766a0=_0x5766a0||0xcc;return function(_0x53e167){if(_0x53e167){return _0x3d2750[_0x5650('0x1d')](_0x5766a0);}return _0x3d2750[_0x5650('0x1e')](_0x5766a0)[_0x5650('0x1f')]();};}function respondWithResult(_0x236bea,_0x421680){_0x421680=_0x421680||0xc8;return function(_0x23fd8e){if(_0x23fd8e){return _0x236bea[_0x5650('0x1e')](_0x421680)['json'](_0x23fd8e);}};}function respondWithFilteredResult(_0x365db0,_0x22fc8a){return function(_0x20c824){if(_0x20c824){var _0x56e2e2=typeof _0x22fc8a[_0x5650('0x20')]===_0x5650('0x21')&&typeof _0x22fc8a[_0x5650('0x22')]===_0x5650('0x21');var _0x37a99a=_0x20c824[_0x5650('0x23')];var _0x315b57=_0x56e2e2?0x0:_0x22fc8a[_0x5650('0x20')];var _0x18377a=_0x56e2e2?_0x20c824[_0x5650('0x23')]:_0x22fc8a[_0x5650('0x20')]+_0x22fc8a[_0x5650('0x22')];var _0x2abb02;if(_0x18377a>=_0x37a99a){_0x18377a=_0x37a99a;_0x2abb02=0xc8;}else{_0x2abb02=0xce;}_0x365db0[_0x5650('0x1e')](_0x2abb02);return _0x365db0[_0x5650('0x24')](_0x5650('0x25'),_0x315b57+'-'+_0x18377a+'/'+_0x37a99a)[_0x5650('0x26')](_0x20c824);}return null;};}function patchUpdates(_0x278fcc){return function(_0x28059e){try{jsonpatch[_0x5650('0x27')](_0x28059e,_0x278fcc,!![]);}catch(_0x374a1f){return BPromise[_0x5650('0x28')](_0x374a1f);}return _0x28059e['save']();};}function saveUpdates(_0x3e931b,_0x4a7885){return function(_0x28b7b6){if(_0x28b7b6){return _0x28b7b6[_0x5650('0x29')](_0x3e931b)['then'](function(_0x45dd5a){return _0x45dd5a;});}return null;};}function removeEntity(_0x27daaa,_0x541013){return function(_0x256591){if(_0x256591){return _0x256591['destroy']()['then'](function(){_0x27daaa[_0x5650('0x1e')](0xcc)[_0x5650('0x1f')]();});}};}function handleEntityNotFound(_0x43eff2,_0x4b8486){return function(_0xa41d8c){if(!_0xa41d8c){_0x43eff2[_0x5650('0x1d')](0x194);}return _0xa41d8c;};}function handleError(_0x45ab49,_0x283dc0){_0x283dc0=_0x283dc0||0x1f4;return function(_0x592ac9){logger[_0x5650('0x2a')](_0x592ac9[_0x5650('0x2b')]);if(_0x592ac9[_0x5650('0x2c')]){delete _0x592ac9[_0x5650('0x2c')];}_0x45ab49[_0x5650('0x1e')](_0x283dc0)[_0x5650('0x2d')](_0x592ac9);};}exports[_0x5650('0x2e')]=function(_0x335bed,_0x291097,_0x4796cd){if(!_0x335bed['body']['hasOwnProperty'](_0x5650('0x2f'))&&!_0x335bed[_0x5650('0x30')]['hasOwnProperty']('TemplateId')){throw new db[(_0x5650('0x31'))][(_0x5650('0x32'))](_0x5650('0x33'));}else{if(_0x335bed[_0x5650('0x30')]['hasOwnProperty'](_0x5650('0x34'))&&!_0x335bed[_0x5650('0x30')][_0x5650('0x35')](_0x5650('0x36'))){throw new db[(_0x5650('0x31'))][(_0x5650('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x335bed[_0x5650('0x30')]['hasOwnProperty'](_0x5650('0x37'))){throw new db[(_0x5650('0x31'))][(_0x5650('0x32'))](_0x5650('0x38'));}else{try{var _0x2f4ef8=JSON[_0x5650('0x39')](_0x335bed['body'][_0x5650('0x37')]);}catch(_0x3df1b6){logger[_0x5650('0x2a')](_0x3df1b6);throw new db['Sequelize'][(_0x5650('0x32'))](_0x5650('0x3a'));}var _0x1c3ae7=[_0x5650('0x3b'),'faxqueue','mailqueue',_0x5650('0x3c'),'smsqueue',_0x5650('0x3d'),_0x5650('0x3e'),'team','user'];if(_[_0x5650('0x3f')](_0x2f4ef8,function(_0x19d2e3){return!_['includes'](_0x1c3ae7,_0x19d2e3['model'][_0x5650('0x40')]());})){throw new db[(_0x5650('0x31'))][(_0x5650('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x288526={};_0x288526[_0x5650('0x41')]=_0x335bed[_0x5650('0x30')]['hasOwnProperty'](_0x5650('0x41'))?_0x335bed[_0x5650('0x30')][_0x5650('0x41')]:_0x335bed[_0x5650('0x42')][_0x5650('0x43')];_0x288526[_0x5650('0x44')]=_[_0x5650('0x45')](_0x335bed[_0x5650('0x30')]['recipientsDescription'])?null:_0x335bed['body'][_0x5650('0x44')];_0x288526['beep']=_0x335bed[_0x5650('0x30')][_0x5650('0x46')]||![];_0x288526[_0x5650('0x47')]=_0x335bed[_0x5650('0x42')]['id'];return getContent(_0x335bed['body'])[_0x5650('0x48')](function(_0xdabb42){_0x288526[_0x5650('0x30')]=_0xdabb42;return getRecipients(_0x2f4ef8);})['then'](function(_0x537f4c){_0x288526[_0x5650('0x49')]=_['sortBy'](_0x537f4c)[_0x5650('0x4a')](',');return db['sequelize']['transaction'](function(_0x347c65){return db['UserNotification'][_0x5650('0x4b')](_0x288526,{'raw':!![],'transaction':_0x347c65})[_0x5650('0x48')](function(_0x16cc1c){var _0x515f78={'sender':_0x288526[_0x5650('0x41')],'description':_0x288526['recipientsDescription'],'content':_0x288526[_0x5650('0x30')],'beep':_0x288526[_0x5650('0x46')]};_0x537f4c['forEach'](function(_0x42c208){_0x515f78[_0x5650('0x4c')]=_0x42c208;socket[_0x5650('0x4d')](_0x5650('0x4e'),_0x515f78);});return _0x16cc1c;});});})[_0x5650('0x48')](respondWithResult(_0x291097,0xc9))[_0x5650('0x4f')](handleError(_0x291097,null));};function getContent(_0x35bb0f){return new BPromise(function(_0x41e59b,_0x175474){if(_0x35bb0f[_0x5650('0x2f')]){_0x41e59b(_0x35bb0f[_0x5650('0x2f')]);return;}return db[_0x5650('0x50')]['findOne']({'attributes':['html'],'where':{'id':_0x35bb0f[_0x5650('0x34')]},'raw':!![]})[_0x5650('0x48')](function(_0x25a400){if(!_0x25a400)throw new db['Sequelize'][(_0x5650('0x32'))](_0x5650('0x51'));var _0x3823d6=Mustache[_0x5650('0x52')](_0x25a400[_0x5650('0x53')],_0x35bb0f[_0x5650('0x36')]);_0x41e59b(_0x3823d6);})[_0x5650('0x4f')](function(_0x393181){_0x175474(_0x393181);});});}function getRecipients(_0x12c656){return new BPromise(function(_0x38e9cf,_0x3584fa){var _0x4a865a=[];var _0x5ee238=[];_0x12c656[_0x5650('0x54')](function(_0x22fb6a){var _0x52286c=_['startCase'](_0x22fb6a[_0x5650('0x55')]['toLowerCase']());if(_0x52286c==='User'){_0x4a865a=_[_0x5650('0x56')](_0x4a865a,_0x22fb6a[_0x5650('0x57')]);}else{if(_['includes'](_0x52286c,'queue'))_0x52286c=_0x52286c['replace'](_0x5650('0x58'),_0x5650('0x59'));_0x22fb6a[_0x5650('0x57')][_0x5650('0x54')](function(_0x4942e3){_0x5ee238[_0x5650('0x5a')](getAgents(_0x52286c,_0x4942e3));});}});return BPromise['all'](_0x5ee238)['then'](function(_0x479b43){_0x4a865a=_[_0x5650('0x56')](_0x4a865a,_['flatten'](_0x479b43));_0x38e9cf(_0x4a865a);})[_0x5650('0x4f')](function(_0x15d281){_0x3584fa(_0x15d281);});});}function getAgents(_0x4fb17f,_0x2c480c){return new BPromise(function(_0x33a2a8,_0x267e73){return db[_0x4fb17f][_0x5650('0x5b')]({'where':{'id':_0x2c480c}})[_0x5650('0x48')](function(_0x410a47){return _0x410a47[_0x5650('0x5c')]({'attributes':['id'],'raw':!![]})[_0x5650('0x48')](function(_0xe1c426){var _0x3ae646=_[_0x5650('0x5d')](_0xe1c426,'id');_0x33a2a8(_0x3ae646);});})['catch'](function(_0x24ade3){_0x267e73(_0x24ade3);});});} \ No newline at end of file +var _0x7fa0=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','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','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','then','recipientsId','sortBy','join','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','Template','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','ids','replace','queue','Queue','push','all','union','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x2975c7,_0x5dcc22){var _0x26a179=function(_0x150969){while(--_0x150969){_0x2975c7['push'](_0x2975c7['shift']());}};_0x26a179(++_0x5dcc22);}(_0x7fa0,0x18e));var _0x07fa=function(_0x314d1d,_0x1211b8){_0x314d1d=_0x314d1d-0x0;var _0x31e31d=_0x7fa0[_0x314d1d];return _0x31e31d;};'use strict';var emlformat=require(_0x07fa('0x0'));var rimraf=require(_0x07fa('0x1'));var zipdir=require(_0x07fa('0x2'));var jsonpatch=require(_0x07fa('0x3'));var rp=require(_0x07fa('0x4'));var moment=require(_0x07fa('0x5'));var BPromise=require(_0x07fa('0x6'));var Mustache=require(_0x07fa('0x7'));var util=require('util');var path=require(_0x07fa('0x8'));var sox=require(_0x07fa('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x07fa('0xa'));var crypto=require(_0x07fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x07fa('0xc'));var toCsv=require('to-csv');var querystring=require(_0x07fa('0xd'));var Papa=require(_0x07fa('0xe'));var Redis=require(_0x07fa('0xf'));var authService=require(_0x07fa('0x10'));var qs=require(_0x07fa('0x11'));var as=require(_0x07fa('0x12'));var hardwareService=require(_0x07fa('0x13'));var logger=require(_0x07fa('0x14'))(_0x07fa('0x15'));var utils=require(_0x07fa('0x16'));var config=require(_0x07fa('0x17'));var licenseUtil=require(_0x07fa('0x18'));var db=require(_0x07fa('0x19'))['db'];config[_0x07fa('0x1a')]=_[_0x07fa('0x1b')](config['redis'],{'host':_0x07fa('0x1c'),'port':0x18eb});var socket=require(_0x07fa('0x1d'))(new Redis(config[_0x07fa('0x1a')]));require(_0x07fa('0x1e'))[_0x07fa('0x1f')](socket);function respondWithStatusCode(_0x5743d3,_0x5fb0e0){_0x5fb0e0=_0x5fb0e0||0xcc;return function(_0x3d060c){if(_0x3d060c){return _0x5743d3[_0x07fa('0x20')](_0x5fb0e0);}return _0x5743d3[_0x07fa('0x21')](_0x5fb0e0)[_0x07fa('0x22')]();};}function respondWithResult(_0x262bd8,_0x3ffb0d){_0x3ffb0d=_0x3ffb0d||0xc8;return function(_0x5968cf){if(_0x5968cf){return _0x262bd8[_0x07fa('0x21')](_0x3ffb0d)[_0x07fa('0x23')](_0x5968cf);}};}function respondWithFilteredResult(_0x2d57e7,_0x575856){return function(_0x23689c){if(_0x23689c){var _0x41f7a6=typeof _0x575856[_0x07fa('0x24')]==='undefined'&&typeof _0x575856['limit']===_0x07fa('0x25');var _0x10b08f=_0x23689c[_0x07fa('0x26')];var _0x132fcb=_0x41f7a6?0x0:_0x575856[_0x07fa('0x24')];var _0x321216=_0x41f7a6?_0x23689c['count']:_0x575856[_0x07fa('0x24')]+_0x575856[_0x07fa('0x27')];var _0x30b627;if(_0x321216>=_0x10b08f){_0x321216=_0x10b08f;_0x30b627=0xc8;}else{_0x30b627=0xce;}_0x2d57e7[_0x07fa('0x21')](_0x30b627);return _0x2d57e7[_0x07fa('0x28')]('Content-Range',_0x132fcb+'-'+_0x321216+'/'+_0x10b08f)[_0x07fa('0x23')](_0x23689c);}return null;};}function patchUpdates(_0x4c7d2b){return function(_0xdc6283){try{jsonpatch['apply'](_0xdc6283,_0x4c7d2b,!![]);}catch(_0x139b7e){return BPromise[_0x07fa('0x29')](_0x139b7e);}return _0xdc6283['save']();};}function saveUpdates(_0x232df7,_0x5d486f){return function(_0x2d2249){if(_0x2d2249){return _0x2d2249[_0x07fa('0x2a')](_0x232df7)['then'](function(_0x53567a){return _0x53567a;});}return null;};}function removeEntity(_0x1b08cc,_0x6f1d0f){return function(_0x5da65c){if(_0x5da65c){return _0x5da65c[_0x07fa('0x2b')]()['then'](function(){_0x1b08cc[_0x07fa('0x21')](0xcc)[_0x07fa('0x22')]();});}};}function handleEntityNotFound(_0x334e7d,_0x815f41){return function(_0x2f17d4){if(!_0x2f17d4){_0x334e7d[_0x07fa('0x20')](0x194);}return _0x2f17d4;};}function handleError(_0x25f9a9,_0xcf6ab1){_0xcf6ab1=_0xcf6ab1||0x1f4;return function(_0x2ef3fd){logger[_0x07fa('0x2c')](_0x2ef3fd[_0x07fa('0x2d')]);if(_0x2ef3fd['name']){delete _0x2ef3fd[_0x07fa('0x2e')];}_0x25f9a9[_0x07fa('0x21')](_0xcf6ab1)[_0x07fa('0x2f')](_0x2ef3fd);};}exports[_0x07fa('0x30')]=function(_0x38a62b,_0x3c0456,_0x5a4eb5){if(!_0x38a62b[_0x07fa('0x31')][_0x07fa('0x32')](_0x07fa('0x33'))&&!_0x38a62b[_0x07fa('0x31')][_0x07fa('0x32')]('TemplateId')){throw new db[(_0x07fa('0x34'))][(_0x07fa('0x35'))](_0x07fa('0x36'));}else{if(_0x38a62b['body'][_0x07fa('0x32')]('TemplateId')&&!_0x38a62b[_0x07fa('0x31')]['hasOwnProperty']('view')){throw new db['Sequelize']['ValidationError'](_0x07fa('0x37'));}if(!_0x38a62b[_0x07fa('0x31')]['hasOwnProperty'](_0x07fa('0x38'))){throw new db[(_0x07fa('0x34'))][(_0x07fa('0x35'))](_0x07fa('0x39'));}else{try{var _0x433e39=JSON['parse'](_0x38a62b['body']['recipients']);}catch(_0xd67973){logger[_0x07fa('0x2c')](_0xd67973);throw new db[(_0x07fa('0x34'))][(_0x07fa('0x35'))](_0x07fa('0x3a'));}var _0x23cdee=[_0x07fa('0x3b'),_0x07fa('0x3c'),_0x07fa('0x3d'),_0x07fa('0x3e'),_0x07fa('0x3f'),_0x07fa('0x40'),_0x07fa('0x41'),_0x07fa('0x42'),_0x07fa('0x43')];if(_[_0x07fa('0x44')](_0x433e39,function(_0x2c3afc){return!_['includes'](_0x23cdee,_0x2c3afc['model'][_0x07fa('0x45')]());})){throw new db[(_0x07fa('0x34'))][(_0x07fa('0x35'))](_0x07fa('0x46'));}}}var _0x258c87={};_0x258c87['senderName']=_0x38a62b[_0x07fa('0x31')][_0x07fa('0x32')](_0x07fa('0x47'))?_0x38a62b[_0x07fa('0x31')]['senderName']:_0x38a62b['user']['fullname'];_0x258c87[_0x07fa('0x48')]=_[_0x07fa('0x49')](_0x38a62b['body'][_0x07fa('0x48')])?null:_0x38a62b[_0x07fa('0x31')][_0x07fa('0x48')];_0x258c87[_0x07fa('0x4a')]=_0x38a62b[_0x07fa('0x31')]['beep']||![];_0x258c87['SenderId']=_0x38a62b[_0x07fa('0x43')]['id'];return getContent(_0x38a62b[_0x07fa('0x31')])[_0x07fa('0x4b')](function(_0xc219b7){_0x258c87['body']=_0xc219b7;return getRecipients(_0x433e39);})[_0x07fa('0x4b')](function(_0x1b1ef4){_0x258c87[_0x07fa('0x4c')]=_[_0x07fa('0x4d')](_0x1b1ef4)[_0x07fa('0x4e')](',');return db['sequelize'][_0x07fa('0x4f')](function(_0x65d907){return db[_0x07fa('0x50')][_0x07fa('0x51')](_0x258c87,{'raw':!![],'transaction':_0x65d907})['then'](function(_0x4ad5d2){var _0x3a1ec6={'sender':_0x258c87['senderName'],'description':_0x258c87[_0x07fa('0x48')],'content':_0x258c87[_0x07fa('0x31')],'beep':_0x258c87[_0x07fa('0x4a')]};_0x1b1ef4['forEach'](function(_0x2a760c){_0x3a1ec6[_0x07fa('0x52')]=_0x2a760c;socket[_0x07fa('0x53')](_0x07fa('0x54'),_0x3a1ec6);});return _0x4ad5d2;});});})[_0x07fa('0x4b')](respondWithResult(_0x3c0456,0xc9))[_0x07fa('0x55')](handleError(_0x3c0456,null));};function getContent(_0x111d8c){return new BPromise(function(_0x4087e3,_0x4163d8){if(_0x111d8c[_0x07fa('0x33')]){_0x4087e3(_0x111d8c[_0x07fa('0x33')]);return;}return db[_0x07fa('0x56')]['findOne']({'attributes':[_0x07fa('0x57')],'where':{'id':_0x111d8c[_0x07fa('0x58')]},'raw':!![]})[_0x07fa('0x4b')](function(_0x2fb946){if(!_0x2fb946)throw new db[(_0x07fa('0x34'))]['ValidationError'](_0x07fa('0x59'));var _0x4e0068=Mustache[_0x07fa('0x5a')](_0x2fb946['html'],_0x111d8c['view']);_0x4087e3(_0x4e0068);})['catch'](function(_0x896f7d){_0x4163d8(_0x896f7d);});});}function getRecipients(_0x320fc7){return new BPromise(function(_0x222088,_0x189430){var _0x29629c=[];var _0x4a0155=[];_0x320fc7[_0x07fa('0x5b')](function(_0xe9a8ad){var _0x4b0aa3=_[_0x07fa('0x5c')](_0xe9a8ad['model'][_0x07fa('0x45')]());if(_0x4b0aa3==='User'){_0x29629c=_['union'](_0x29629c,_0xe9a8ad[_0x07fa('0x5d')]);}else{if(_['includes'](_0x4b0aa3,'queue'))_0x4b0aa3=_0x4b0aa3[_0x07fa('0x5e')](_0x07fa('0x5f'),_0x07fa('0x60'));_0xe9a8ad[_0x07fa('0x5d')][_0x07fa('0x5b')](function(_0x5ea746){_0x4a0155[_0x07fa('0x61')](getAgents(_0x4b0aa3,_0x5ea746));});}});return BPromise[_0x07fa('0x62')](_0x4a0155)['then'](function(_0x339d85){_0x29629c=_[_0x07fa('0x63')](_0x29629c,_[_0x07fa('0x64')](_0x339d85));_0x222088(_0x29629c);})[_0x07fa('0x55')](function(_0x2d855a){_0x189430(_0x2d855a);});});}function getAgents(_0x3849a,_0x77089f){return new BPromise(function(_0x3279b2,_0x5cc904){return db[_0x3849a]['findOne']({'where':{'id':_0x77089f}})['then'](function(_0x214f66){return _0x214f66[_0x07fa('0x65')]({'attributes':['id'],'raw':!![]})[_0x07fa('0x4b')](function(_0x14e98f){var _0xd14746=_['map'](_0x14e98f,'id');_0x3279b2(_0xd14746);});})['catch'](function(_0x1e5544){_0x5cc904(_0x1e5544);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index f93838e..6125fb1 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 _0x6505=['../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1b8b1f,_0x5db94a){var _0x538d8b=function(_0x57a2c7){while(--_0x57a2c7){_0x1b8b1f['push'](_0x1b8b1f['shift']());}};_0x538d8b(++_0x5db94a);}(_0x6505,0x1c1));var _0x5650=function(_0x915a3c,_0x107136){_0x915a3c=_0x915a3c-0x0;var _0x204c99=_0x6505[_0x915a3c];return _0x204c99;};'use strict';var EventEmitter=require(_0x5650('0x0'));var UserNotification=require(_0x5650('0x1'))['db'][_0x5650('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5650('0x3'),'afterUpdate':_0x5650('0x4'),'afterDestroy':_0x5650('0x5')};function emitEvent(_0x33fda6){return function(_0x29a361,_0x3c8d59,_0x5e3da9){UserNotificationEvents[_0x5650('0x6')](_0x33fda6+':'+_0x29a361['id'],_0x29a361);UserNotificationEvents[_0x5650('0x6')](_0x33fda6,_0x29a361);_0x5e3da9(null);};}for(var e in events){if(events[_0x5650('0x7')](e)){var event=events[e];UserNotification[_0x5650('0x8')](e,emitEvent(event));}}module[_0x5650('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x39c1=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x9278c6,_0x50f57b){var _0x1eca17=function(_0x57a15b){while(--_0x57a15b){_0x9278c6['push'](_0x9278c6['shift']());}};_0x1eca17(++_0x50f57b);}(_0x39c1,0x154));var _0x139c=function(_0x2b2434,_0x5c6530){_0x2b2434=_0x2b2434-0x0;var _0x4e1dcb=_0x39c1[_0x2b2434];return _0x4e1dcb;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x139c('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x139c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x139c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5bc407){return function(_0x2975c5,_0x20bea2,_0x581ce8){UserNotificationEvents[_0x139c('0x3')](_0x5bc407+':'+_0x2975c5['id'],_0x2975c5);UserNotificationEvents['emit'](_0x5bc407,_0x2975c5);_0x581ce8(null);};}for(var e in events){if(events[_0x139c('0x4')](e)){var event=events[e];UserNotification[_0x139c('0x5')](e,emitEvent(event));}}module[_0x139c('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 834173d..338cc26 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 _0xf905=['rimraf','../../config/environment','exports','UserNotification','userNotifications','utf8mb4','api','moment','request-promise','path'];(function(_0x460f4e,_0x1ed514){var _0x51635d=function(_0x38e3ad){while(--_0x38e3ad){_0x460f4e['push'](_0x460f4e['shift']());}};_0x51635d(++_0x1ed514);}(_0xf905,0x15a));var _0x5f90=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xf905[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5f90('0x0'));var moment=require(_0x5f90('0x1'));var BPromise=require('bluebird');var rp=require(_0x5f90('0x2'));var fs=require('fs');var path=require(_0x5f90('0x3'));var rimraf=require(_0x5f90('0x4'));var config=require(_0x5f90('0x5'));var attributes=require('./userNotification.attributes');module[_0x5f90('0x6')]=function(_0x1d63d7,_0x1c4820){return _0x1d63d7['define'](_0x5f90('0x7'),attributes,{'tableName':_0x5f90('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f90('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x737b=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3eee59,_0x1e47a8){var _0x322fff=function(_0x5bd2b7){while(--_0x5bd2b7){_0x3eee59['push'](_0x3eee59['shift']());}};_0x322fff(++_0x1e47a8);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb737('0x0'));var util=require(_0xb737('0x1'));var logger=require('../../config/logger')(_0xb737('0x2'));var moment=require(_0xb737('0x3'));var BPromise=require(_0xb737('0x4'));var rp=require(_0xb737('0x5'));var fs=require('fs');var path=require(_0xb737('0x6'));var rimraf=require(_0xb737('0x7'));var config=require(_0xb737('0x8'));var attributes=require(_0xb737('0x9'));module[_0xb737('0xa')]=function(_0x3a718e,_0x1c1cf4){return _0x3a718e[_0xb737('0xb')](_0xb737('0xc'),attributes,{'tableName':_0xb737('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb737('0xe'),'collate':_0xb737('0xf')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 22f9c53..c8423b5 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 _0x8648=['rpc','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x288be1,_0x232e15){var _0x55047a=function(_0x48f1c1){while(--_0x48f1c1){_0x288be1['push'](_0x288be1['shift']());}};_0x55047a(++_0x232e15);}(_0x8648,0x1ed));var _0x8864=function(_0x42d658,_0x3b6d4c){_0x42d658=_0x42d658-0x0;var _0x17a459=_0x8648[_0x42d658];return _0x17a459;};'use strict';var _=require('lodash');var util=require(_0x8864('0x0'));var moment=require(_0x8864('0x1'));var BPromise=require('bluebird');var rs=require(_0x8864('0x2'));var fs=require('fs');var Redis=require(_0x8864('0x3'));var db=require(_0x8864('0x4'))['db'];var utils=require(_0x8864('0x5'));var logger=require(_0x8864('0x6'))(_0x8864('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8864('0x8')][_0x8864('0x9')]({'port':0x232a});config[_0x8864('0xa')]=_['defaults'](config[_0x8864('0xa')],{'host':_0x8864('0xb'),'port':0x18eb});var socket=require(_0x8864('0xc'))(new Redis(config[_0x8864('0xa')]));require(_0x8864('0xd'))[_0x8864('0xe')](socket);function respondWithRpcPromise(_0x2f0914,_0x35553f,_0x20c9bf){return new BPromise(function(_0x41ca26,_0x507e4e){return client[_0x8864('0xf')](_0x2f0914,_0x20c9bf)[_0x8864('0x10')](function(_0x138fec){logger[_0x8864('0x11')](_0x8864('0x12'),_0x35553f,'request\x20sent');logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x35553f,_0x8864('0x13'),JSON['stringify'](_0x138fec));if(_0x138fec[_0x8864('0x14')]){if(_0x138fec[_0x8864('0x14')][_0x8864('0x15')]===0x1f4){logger[_0x8864('0x14')](_0x8864('0x12'),_0x35553f,_0x138fec[_0x8864('0x14')][_0x8864('0x16')]);return _0x507e4e(_0x138fec[_0x8864('0x14')][_0x8864('0x16')]);}logger[_0x8864('0x14')]('UserNotification,\x20%s,\x20%s',_0x35553f,_0x138fec[_0x8864('0x14')][_0x8864('0x16')]);return _0x41ca26(_0x138fec[_0x8864('0x14')][_0x8864('0x16')]);}else{logger[_0x8864('0x11')](_0x8864('0x12'),_0x35553f,_0x8864('0x13'));_0x41ca26(_0x138fec[_0x8864('0x17')]['message']);}})[_0x8864('0x18')](function(_0x5ae462){logger[_0x8864('0x14')](_0x8864('0x12'),_0x35553f,_0x5ae462);_0x507e4e(_0x5ae462);});});} \ No newline at end of file +var _0xa3b6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0xa3b6,0x131));var _0x6a3b=function(_0x3f6919,_0x4c8e88){_0x3f6919=_0x3f6919-0x0;var _0x2dfef3=_0xa3b6[_0x3f6919];return _0x2dfef3;};'use strict';var _=require(_0x6a3b('0x0'));var util=require(_0x6a3b('0x1'));var moment=require('moment');var BPromise=require(_0x6a3b('0x2'));var rs=require(_0x6a3b('0x3'));var fs=require('fs');var Redis=require(_0x6a3b('0x4'));var db=require(_0x6a3b('0x5'))['db'];var utils=require(_0x6a3b('0x6'));var logger=require(_0x6a3b('0x7'))(_0x6a3b('0x8'));var config=require(_0x6a3b('0x9'));var jayson=require(_0x6a3b('0xa'));var client=jayson[_0x6a3b('0xb')][_0x6a3b('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6a3b('0xd')],{'host':_0x6a3b('0xe'),'port':0x18eb});var socket=require(_0x6a3b('0xf'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x106415,_0x194815,_0x1fb00a){return new BPromise(function(_0x55fd25,_0xaec2f2){return client[_0x6a3b('0x10')](_0x106415,_0x1fb00a)[_0x6a3b('0x11')](function(_0x3f369c){logger['info'](_0x6a3b('0x12'),_0x194815,_0x6a3b('0x13'));logger[_0x6a3b('0x14')](_0x6a3b('0x15'),_0x194815,_0x6a3b('0x13'),JSON[_0x6a3b('0x16')](_0x3f369c));if(_0x3f369c[_0x6a3b('0x17')]){if(_0x3f369c[_0x6a3b('0x17')][_0x6a3b('0x18')]===0x1f4){logger['error'](_0x6a3b('0x12'),_0x194815,_0x3f369c[_0x6a3b('0x17')]['message']);return _0xaec2f2(_0x3f369c[_0x6a3b('0x17')][_0x6a3b('0x19')]);}logger[_0x6a3b('0x17')]('UserNotification,\x20%s,\x20%s',_0x194815,_0x3f369c[_0x6a3b('0x17')][_0x6a3b('0x19')]);return _0x55fd25(_0x3f369c[_0x6a3b('0x17')][_0x6a3b('0x19')]);}else{logger[_0x6a3b('0x1a')](_0x6a3b('0x12'),_0x194815,_0x6a3b('0x13'));_0x55fd25(_0x3f369c['result'][_0x6a3b('0x19')]);}})[_0x6a3b('0x1b')](function(_0x501560){logger[_0x6a3b('0x17')]('UserNotification,\x20%s,\x20%s',_0x194815,_0x501560);_0xaec2f2(_0x501560);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index e8e4745..2dacc56 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 _0x5dda=['length','userNotification:','./userNotification.events','remove','update','removeListener','register'];(function(_0x3ab5d4,_0x30d994){var _0x16152c=function(_0x296e76){while(--_0x296e76){_0x3ab5d4['push'](_0x3ab5d4['shift']());}};_0x16152c(++_0x30d994);}(_0x5dda,0xfe));var _0xa5dd=function(_0xef207f,_0x4c6b58){_0xef207f=_0xef207f-0x0;var _0x202fa7=_0x5dda[_0xef207f];return _0x202fa7;};'use strict';var UserNotificationEvents=require(_0xa5dd('0x0'));var events=['save',_0xa5dd('0x1'),_0xa5dd('0x2')];function createListener(_0x485407,_0x1301ed){return function(_0x18d4e5){_0x1301ed['emit'](_0x485407,_0x18d4e5);};}function removeListener(_0x37bf28,_0x437fbb){return function(){UserNotificationEvents[_0xa5dd('0x3')](_0x37bf28,_0x437fbb);};}exports[_0xa5dd('0x4')]=function(_0x8e844e){for(var _0x428ba0=0x0,_0x25f5df=events[_0xa5dd('0x5')];_0x428ba0<_0x25f5df;_0x428ba0++){var _0x4bf626=events[_0x428ba0];var _0x41edfd=createListener(_0xa5dd('0x6')+_0x4bf626,_0x8e844e);UserNotificationEvents['on'](_0x4bf626,_0x41edfd);}}; \ No newline at end of file +var _0x4509=['length','./userNotification.events','save','update','register'];(function(_0x3d016c,_0x32277d){var _0x3b673c=function(_0x1287fc){while(--_0x1287fc){_0x3d016c['push'](_0x3d016c['shift']());}};_0x3b673c(++_0x32277d);}(_0x4509,0x123));var _0x9450=function(_0x48ed97,_0x363715){_0x48ed97=_0x48ed97-0x0;var _0x2326ea=_0x4509[_0x48ed97];return _0x2326ea;};'use strict';var UserNotificationEvents=require(_0x9450('0x0'));var events=[_0x9450('0x1'),'remove',_0x9450('0x2')];function createListener(_0x3ed80e,_0x505412){return function(_0x49102e){_0x505412['emit'](_0x3ed80e,_0x49102e);};}function removeListener(_0xa627fe,_0x3572da){return function(){UserNotificationEvents['removeListener'](_0xa627fe,_0x3572da);};}exports[_0x9450('0x3')]=function(_0x52d77a){for(var _0x4a6d1b=0x0,_0x36b7a8=events[_0x9450('0x4')];_0x4a6d1b<_0x36b7a8;_0x4a6d1b++){var _0x195ced=events[_0x4a6d1b];var _0x47392e=createListener('userNotification:'+_0x195ced,_0x52d77a);UserNotificationEvents['on'](_0x195ced,_0x47392e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 65e23ac..a71d435 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf06aa7,_0x1afe71){var _0x5ce8bc=function(_0x35343c){while(--_0x35343c){_0xf06aa7['push'](_0xf06aa7['shift']());}};_0x5ce8bc(++_0x1afe71);}(_0xe706,0xa3));var _0x6e70=function(_0xcfcdcb,_0x335750){_0xcfcdcb=_0xcfcdcb-0x0;var _0x55b9da=_0xe706[_0xcfcdcb];return _0x55b9da;};'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(_0x13c779,_0x5a82a8){var _0xcaa0e0=function(_0x37fef3){while(--_0x37fef3){_0x13c779['push'](_0x13c779['shift']());}};_0xcaa0e0(++_0x5a82a8);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 0bff8df..30daaea 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 _0x777d=['INTEGER'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0x777d,0xa0));var _0xd777=function(_0x12cbd8,_0x8ef0ce){_0x12cbd8=_0x12cbd8-0x0;var _0x2fb1ab=_0x777d[_0x12cbd8];return _0x2fb1ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd777('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc023=['INTEGER'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xc023,0x162));var _0x3c02=function(_0x15184c,_0x35a6e){_0x15184c=_0x15184c-0x0;var _0x35ca27=_0xc023[_0x15184c];return _0x35ca27;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3c02('0x0')],'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 248f659..b941f97 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 _0x4fe3=['path','rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','moment','bluebird'];(function(_0xe2e26,_0x47e75d){var _0x5e90d0=function(_0x2bda02){while(--_0x2bda02){_0xe2e26['push'](_0xe2e26['shift']());}};_0x5e90d0(++_0x47e75d);}(_0x4fe3,0x146));var _0x34fe=function(_0xeffe77,_0x5e3269){_0xeffe77=_0xeffe77-0x0;var _0x37daec=_0x4fe3[_0xeffe77];return _0x37daec;};'use strict';var _=require(_0x34fe('0x0'));var util=require(_0x34fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34fe('0x2'));var BPromise=require(_0x34fe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34fe('0x4'));var rimraf=require(_0x34fe('0x5'));var config=require('../../config/environment');var attributes=require(_0x34fe('0x6'));module[_0x34fe('0x7')]=function(_0x213540,_0x3100e0){return _0x213540['define'](_0x34fe('0x8'),attributes,{'tableName':_0x34fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd90=['user_has_openchannel_queues','util','../../config/logger','api','path','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x19869e,_0x231ccb){var _0x298a42=function(_0x21d037){while(--_0x21d037){_0x19869e['push'](_0x19869e['shift']());}};_0x298a42(++_0x231ccb);}(_0xdd90,0x129));var _0x0dd9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdd90[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x0dd9('0x0'));var logger=require(_0x0dd9('0x1'))(_0x0dd9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dd9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0dd9('0x4'));module[_0x0dd9('0x5')]=function(_0xf87d5f,_0x4c805f){return _0xf87d5f['define'](_0x0dd9('0x6'),attributes,{'tableName':_0x0dd9('0x7'),'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 6eb898c..89a9d23 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 _0x0332=['rpc','../../config/environment','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x0332,0x93));var _0x2033=function(_0xc2b9ae,_0x515445){_0xc2b9ae=_0xc2b9ae-0x0;var _0x31deda=_0x0332[_0xc2b9ae];return _0x31deda;};'use strict';var _=require('lodash');var util=require(_0x2033('0x0'));var moment=require(_0x2033('0x1'));var BPromise=require(_0x2033('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2033('0x3'));var db=require(_0x2033('0x4'))['db'];var utils=require(_0x2033('0x5'));var logger=require(_0x2033('0x6'))(_0x2033('0x7'));var config=require(_0x2033('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2033('0x9')][_0x2033('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ba2e4,_0x14aa94,_0x2eb5aa){return new BPromise(function(_0x546408,_0x5802bb){return client[_0x2033('0xb')](_0x1ba2e4,_0x2eb5aa)[_0x2033('0xc')](function(_0x2d85f1){logger[_0x2033('0xd')](_0x2033('0xe'),_0x14aa94,_0x2033('0xf'));logger[_0x2033('0x10')](_0x2033('0x11'),_0x14aa94,_0x2033('0xf'),JSON['stringify'](_0x2d85f1));if(_0x2d85f1[_0x2033('0x12')]){if(_0x2d85f1[_0x2033('0x12')][_0x2033('0x13')]===0x1f4){logger[_0x2033('0x12')](_0x2033('0xe'),_0x14aa94,_0x2d85f1['error'][_0x2033('0x14')]);return _0x5802bb(_0x2d85f1['error'][_0x2033('0x14')]);}logger['error'](_0x2033('0xe'),_0x14aa94,_0x2d85f1[_0x2033('0x12')][_0x2033('0x14')]);return _0x546408(_0x2d85f1[_0x2033('0x12')]['message']);}else{logger[_0x2033('0xd')](_0x2033('0xe'),_0x14aa94,_0x2033('0xf'));_0x546408(_0x2d85f1['result'][_0x2033('0x14')]);}})[_0x2033('0x15')](function(_0x471dd7){logger[_0x2033('0x12')](_0x2033('0xe'),_0x14aa94,_0x471dd7);_0x5802bb(_0x471dd7);});});} \ No newline at end of file +var _0xcc7c=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xcc7c,0x1d9));var _0xccc7=function(_0x254570,_0x560ae3){_0x254570=_0x254570-0x0;var _0x3c696b=_0xcc7c[_0x254570];return _0x3c696b;};'use strict';var _=require(_0xccc7('0x0'));var util=require(_0xccc7('0x1'));var moment=require(_0xccc7('0x2'));var BPromise=require(_0xccc7('0x3'));var rs=require(_0xccc7('0x4'));var fs=require('fs');var Redis=require(_0xccc7('0x5'));var db=require(_0xccc7('0x6'))['db'];var utils=require(_0xccc7('0x7'));var logger=require('../../config/logger')(_0xccc7('0x8'));var config=require('../../config/environment');var jayson=require(_0xccc7('0x9'));var client=jayson[_0xccc7('0xa')][_0xccc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e69a5,_0x54118f,_0x55e1f7){return new BPromise(function(_0xec425e,_0x3f29b6){return client[_0xccc7('0xc')](_0x4e69a5,_0x55e1f7)[_0xccc7('0xd')](function(_0x1a1c53){logger[_0xccc7('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54118f,_0xccc7('0xf'));logger[_0xccc7('0x10')](_0xccc7('0x11'),_0x54118f,_0xccc7('0xf'),JSON['stringify'](_0x1a1c53));if(_0x1a1c53[_0xccc7('0x12')]){if(_0x1a1c53[_0xccc7('0x12')][_0xccc7('0x13')]===0x1f4){logger['error'](_0xccc7('0x14'),_0x54118f,_0x1a1c53['error'][_0xccc7('0x15')]);return _0x3f29b6(_0x1a1c53[_0xccc7('0x12')][_0xccc7('0x15')]);}logger[_0xccc7('0x12')](_0xccc7('0x14'),_0x54118f,_0x1a1c53[_0xccc7('0x12')][_0xccc7('0x15')]);return _0xec425e(_0x1a1c53['error']['message']);}else{logger['info'](_0xccc7('0x14'),_0x54118f,_0xccc7('0xf'));_0xec425e(_0x1a1c53[_0xccc7('0x16')][_0xccc7('0x15')]);}})[_0xccc7('0x17')](function(_0x5a35f6){logger[_0xccc7('0x12')](_0xccc7('0x14'),_0x54118f,_0x5a35f6);_0x3f29b6(_0x5a35f6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 59975e0..46b2720 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 _0x0c7b=['/:id/sections','getSections','/:id/resources','post','/:id/clone','clone','addSections','update','destroy','delete','removeResources','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id'];(function(_0x555f7e,_0x43d467){var _0x4347ba=function(_0x596bd6){while(--_0x596bd6){_0x555f7e['push'](_0x555f7e['shift']());}};_0x4347ba(++_0x43d467);}(_0x0c7b,0x136));var _0xb0c7=function(_0x4aa9c5,_0x1c9375){_0x4aa9c5=_0x4aa9c5-0x0;var _0x1fce6e=_0x0c7b[_0x4aa9c5];return _0x1fce6e;};'use strict';var multer=require(_0xb0c7('0x0'));var util=require(_0xb0c7('0x1'));var path=require(_0xb0c7('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0c7('0x3'));var router=express[_0xb0c7('0x4')]();var fs_extra=require(_0xb0c7('0x5'));var auth=require(_0xb0c7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0xb0c7('0x7')]('/',auth[_0xb0c7('0x8')](),controller['index']);router[_0xb0c7('0x7')](_0xb0c7('0x9'),auth[_0xb0c7('0x8')](),controller[_0xb0c7('0xa')]);router['get'](_0xb0c7('0xb'),auth[_0xb0c7('0x8')](),controller['show']);router[_0xb0c7('0x7')](_0xb0c7('0xc'),auth[_0xb0c7('0x8')](),controller[_0xb0c7('0xd')]);router[_0xb0c7('0x7')](_0xb0c7('0xe'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0xb0c7('0x8')](),controller['create']);router[_0xb0c7('0xf')](_0xb0c7('0x10'),auth['isAuthenticated'](),controller[_0xb0c7('0x11')]);router[_0xb0c7('0xf')](_0xb0c7('0xc'),auth['isAuthenticated'](),controller[_0xb0c7('0x12')]);router[_0xb0c7('0xf')](_0xb0c7('0xe'),auth[_0xb0c7('0x8')](),controller['addResources']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb0c7('0x13')]);router['delete'](_0xb0c7('0xb'),auth[_0xb0c7('0x8')](),controller[_0xb0c7('0x14')]);router[_0xb0c7('0x15')](_0xb0c7('0xc'),auth['isAuthenticated'](),controller['removeSections']);router[_0xb0c7('0x15')](_0xb0c7('0xe'),auth[_0xb0c7('0x8')](),controller[_0xb0c7('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7ee5=['getSections','/:id/resources','getResources','post','clone','addSections','addResources','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x7ee5,0x169));var _0x57ee=function(_0x64e3c1,_0x14da00){_0x64e3c1=_0x64e3c1-0x0;var _0x44adc8=_0x7ee5[_0x64e3c1];return _0x44adc8;};'use strict';var multer=require(_0x57ee('0x0'));var util=require(_0x57ee('0x1'));var path=require('path');var timeout=require(_0x57ee('0x2'));var express=require('express');var router=express[_0x57ee('0x3')]();var fs_extra=require(_0x57ee('0x4'));var auth=require(_0x57ee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57ee('0x6'));var controller=require('./userProfile.controller');router[_0x57ee('0x7')]('/',auth[_0x57ee('0x8')](),controller['index']);router['get'](_0x57ee('0x9'),auth[_0x57ee('0x8')](),controller[_0x57ee('0xa')]);router[_0x57ee('0x7')](_0x57ee('0xb'),auth[_0x57ee('0x8')](),controller[_0x57ee('0xc')]);router[_0x57ee('0x7')](_0x57ee('0xd'),auth[_0x57ee('0x8')](),controller[_0x57ee('0xe')]);router[_0x57ee('0x7')](_0x57ee('0xf'),auth['isAuthenticated'](),controller[_0x57ee('0x10')]);router[_0x57ee('0x11')]('/',auth[_0x57ee('0x8')](),controller['create']);router['post']('/:id/clone',auth[_0x57ee('0x8')](),controller[_0x57ee('0x12')]);router['post'](_0x57ee('0xd'),auth['isAuthenticated'](),controller[_0x57ee('0x13')]);router[_0x57ee('0x11')](_0x57ee('0xf'),auth[_0x57ee('0x8')](),controller[_0x57ee('0x14')]);router[_0x57ee('0x15')](_0x57ee('0xb'),auth[_0x57ee('0x8')](),controller['update']);router[_0x57ee('0x16')]('/:id',auth[_0x57ee('0x8')](),controller[_0x57ee('0x17')]);router['delete'](_0x57ee('0xd'),auth[_0x57ee('0x8')](),controller['removeSections']);router[_0x57ee('0x16')](_0x57ee('0xf'),auth[_0x57ee('0x8')](),controller['removeResources']);module[_0x57ee('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 60d60a4..7a4772c 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 _0x3db9=['split','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3a8964,_0x45cbc2){var _0x295d95=function(_0x113b0a){while(--_0x113b0a){_0x3a8964['push'](_0x3a8964['shift']());}};_0x295d95(++_0x45cbc2);}(_0x3db9,0x1e2));var _0x93db=function(_0x3c9e8e,_0x20df03){_0x3c9e8e=_0x3c9e8e-0x0;var _0x57351a=_0x3db9[_0x3c9e8e];return _0x57351a;};'use strict';var Sequelize=require(_0x93db('0x0'));module['exports']={'name':{'type':Sequelize[_0x93db('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x479aba){this[_0x93db('0x2')](_0x93db('0x3'),_0x479aba?_0x479aba[_0x93db('0x4')](''):[]);},'get':function(){return this[_0x93db('0x5')](_0x93db('0x3'))?this['getDataValue']('crudPermissions')[_0x93db('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x93db('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x93db('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x93db('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc5cb=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0xc5cb,0x104));var _0xbc5c=function(_0x147771,_0x139c34){_0x147771=_0x147771-0x0;var _0x329716=_0xc5cb[_0x147771];return _0x329716;};'use strict';var Sequelize=require(_0xbc5c('0x0'));module[_0xbc5c('0x1')]={'name':{'type':Sequelize[_0xbc5c('0x2')],'allowNull':![],'unique':_0xbc5c('0x3')},'crudPermissions':{'type':Sequelize[_0xbc5c('0x2')],'set':function(_0x4bb498){this[_0xbc5c('0x4')](_0xbc5c('0x5'),_0x4bb498?_0x4bb498[_0xbc5c('0x6')](''):[]);},'get':function(){return this[_0xbc5c('0x7')]('crudPermissions')?this[_0xbc5c('0x7')](_0xbc5c('0x5'))[_0xbc5c('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbc5c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbc5c('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 676b593..e8ca776 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 _0x0d0a=['UserProfileResource','sectionId','userProfileId','UserProfileSection','Resources','describe','addSections','push','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','UserProfile','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','clone','get','createdAt','crudPermissions','omit','updatedAt','sequelize','transaction','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d0a,0xf6));var _0xa0d0=function(_0xb2386e,_0x40c6b2){_0xb2386e=_0xb2386e-0x0;var _0x568491=_0x0d0a[_0xb2386e];return _0x568491;};'use strict';var emlformat=require(_0xa0d0('0x0'));var rimraf=require(_0xa0d0('0x1'));var zipdir=require(_0xa0d0('0x2'));var jsonpatch=require(_0xa0d0('0x3'));var rp=require(_0xa0d0('0x4'));var moment=require(_0xa0d0('0x5'));var BPromise=require(_0xa0d0('0x6'));var Mustache=require('mustache');var util=require(_0xa0d0('0x7'));var path=require(_0xa0d0('0x8'));var sox=require('sox');var csv=require(_0xa0d0('0x9'));var ejs=require(_0xa0d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa0d0('0xb'));var crypto=require(_0xa0d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa0d0('0xd'));var toCsv=require(_0xa0d0('0x9'));var querystring=require(_0xa0d0('0xe'));var Papa=require(_0xa0d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d0('0x11'));var logger=require(_0xa0d0('0x12'))('api');var utils=require(_0xa0d0('0x13'));var config=require(_0xa0d0('0x14'));var licenseUtil=require(_0xa0d0('0x15'));var db=require('../../mysqldb')['db'];config[_0xa0d0('0x16')]=_[_0xa0d0('0x17')](config[_0xa0d0('0x16')],{'host':_0xa0d0('0x18'),'port':0x18eb});var socket=require(_0xa0d0('0x19'))(new Redis(config[_0xa0d0('0x16')]));require(_0xa0d0('0x1a'))['register'](socket);function respondWithStatusCode(_0xc08482,_0xf48e22){_0xf48e22=_0xf48e22||0xcc;return function(_0x41d267){if(_0x41d267){return _0xc08482[_0xa0d0('0x1b')](_0xf48e22);}return _0xc08482['status'](_0xf48e22)['end']();};}function respondWithResult(_0x482ae9,_0x3ffd64){_0x3ffd64=_0x3ffd64||0xc8;return function(_0x582ca1){if(_0x582ca1){return _0x482ae9[_0xa0d0('0x1c')](_0x3ffd64)['json'](_0x582ca1);}};}function respondWithFilteredResult(_0x3747ac,_0x36e674){return function(_0x10d2a0){if(_0x10d2a0){var _0x42bdee=typeof _0x36e674[_0xa0d0('0x1d')]===_0xa0d0('0x1e')&&typeof _0x36e674[_0xa0d0('0x1f')]==='undefined';var _0x1132b2=_0x10d2a0[_0xa0d0('0x20')];var _0x31ce62=_0x42bdee?0x0:_0x36e674[_0xa0d0('0x1d')];var _0x1ec680=_0x42bdee?_0x10d2a0[_0xa0d0('0x20')]:_0x36e674[_0xa0d0('0x1d')]+_0x36e674[_0xa0d0('0x1f')];var _0x40da96;if(_0x1ec680>=_0x1132b2){_0x1ec680=_0x1132b2;_0x40da96=0xc8;}else{_0x40da96=0xce;}_0x3747ac['status'](_0x40da96);return _0x3747ac[_0xa0d0('0x21')](_0xa0d0('0x22'),_0x31ce62+'-'+_0x1ec680+'/'+_0x1132b2)[_0xa0d0('0x23')](_0x10d2a0);}return null;};}function patchUpdates(_0x3630fd){return function(_0x237201){try{jsonpatch[_0xa0d0('0x24')](_0x237201,_0x3630fd,!![]);}catch(_0x2da0fd){return BPromise[_0xa0d0('0x25')](_0x2da0fd);}return _0x237201[_0xa0d0('0x26')]();};}function saveUpdates(_0xe884ea,_0x3e005d){return function(_0x563465){if(_0x563465){return _0x563465[_0xa0d0('0x27')](_0xe884ea)['then'](function(_0x5178b8){return _0x5178b8;});}return null;};}function removeEntity(_0x2261cc,_0x229de8){return function(_0x1e9863){if(_0x1e9863){return _0x1e9863[_0xa0d0('0x28')]()[_0xa0d0('0x29')](function(){_0x2261cc[_0xa0d0('0x1c')](0xcc)[_0xa0d0('0x2a')]();});}};}function handleEntityNotFound(_0x494022,_0x5e6d9f){return function(_0x3ba46d){if(!_0x3ba46d){_0x494022[_0xa0d0('0x1b')](0x194);}return _0x3ba46d;};}function handleError(_0x400286,_0x11e966){_0x11e966=_0x11e966||0x1f4;return function(_0x4351c1){logger[_0xa0d0('0x2b')](_0x4351c1[_0xa0d0('0x2c')]);if(_0x4351c1[_0xa0d0('0x2d')]){delete _0x4351c1['name'];}_0x400286[_0xa0d0('0x1c')](_0x11e966)['send'](_0x4351c1);};}exports['index']=function(_0x372d3f,_0x273e09){var _0x337929={},_0xe47f6e={},_0x168ea0={'count':0x0,'rows':[]};var _0xa5517=_['map'](db[_0xa0d0('0x2e')][_0xa0d0('0x2f')],function(_0x4c6fd3){return{'name':_0x4c6fd3[_0xa0d0('0x30')],'type':_0x4c6fd3[_0xa0d0('0x31')]['key']};});_0xe47f6e['model']=_[_0xa0d0('0x32')](_0xa5517,'name');_0xe47f6e[_0xa0d0('0x33')]=_[_0xa0d0('0x34')](_0x372d3f['query']);_0xe47f6e[_0xa0d0('0x35')]=_[_0xa0d0('0x36')](_0xe47f6e[_0xa0d0('0x37')],_0xe47f6e[_0xa0d0('0x33')]);_0x337929[_0xa0d0('0x38')]=_[_0xa0d0('0x36')](_0xe47f6e[_0xa0d0('0x37')],qs[_0xa0d0('0x39')](_0x372d3f['query'][_0xa0d0('0x39')]));_0x337929[_0xa0d0('0x38')]=_0x337929[_0xa0d0('0x38')][_0xa0d0('0x3a')]?_0x337929['attributes']:_0xe47f6e[_0xa0d0('0x37')];if(!_0x372d3f['query'][_0xa0d0('0x3b')](_0xa0d0('0x3c'))){_0x337929[_0xa0d0('0x1f')]=qs[_0xa0d0('0x1f')](_0x372d3f[_0xa0d0('0x33')][_0xa0d0('0x1f')]);_0x337929['offset']=qs['offset'](_0x372d3f[_0xa0d0('0x33')]['offset']);}_0x337929[_0xa0d0('0x3d')]=qs['sort'](_0x372d3f[_0xa0d0('0x33')][_0xa0d0('0x3e')]);_0x337929[_0xa0d0('0x3f')]=qs['filters'](_[_0xa0d0('0x40')](_0x372d3f[_0xa0d0('0x33')],_0xe47f6e[_0xa0d0('0x35')]),_0xa5517);if(_0x372d3f[_0xa0d0('0x33')][_0xa0d0('0x41')]){_0x337929[_0xa0d0('0x3f')]=_[_0xa0d0('0x42')](_0x337929[_0xa0d0('0x3f')],{'$or':_[_0xa0d0('0x32')](_0xa5517,function(_0x5828b4){if(_0x5828b4['type']!==_0xa0d0('0x43')){var _0x3df469={};_0x3df469[_0x5828b4[_0xa0d0('0x2d')]]={'$like':'%'+_0x372d3f[_0xa0d0('0x33')][_0xa0d0('0x41')]+'%'};return _0x3df469;}})});}_0x337929=_[_0xa0d0('0x42')]({},_0x337929,_0x372d3f[_0xa0d0('0x44')]);var _0x5d0ed3={'where':_0x337929['where']};return db[_0xa0d0('0x2e')]['count'](_0x5d0ed3)['then'](function(_0xbee6c9){_0x168ea0[_0xa0d0('0x20')]=_0xbee6c9;if(_0x372d3f['query'][_0xa0d0('0x45')]){_0x337929[_0xa0d0('0x46')]=[{'all':!![]}];}return db[_0xa0d0('0x2e')][_0xa0d0('0x47')](_0x337929);})[_0xa0d0('0x29')](function(_0x5525af){_0x168ea0[_0xa0d0('0x48')]=_0x5525af;return _0x168ea0;})['then'](respondWithFilteredResult(_0x273e09,_0x337929))[_0xa0d0('0x49')](handleError(_0x273e09,null));};exports['show']=function(_0x50e628,_0x395678){var _0x5f048d={'raw':![],'where':{'id':_0x50e628[_0xa0d0('0x4a')]['id']}},_0x57f19a={};_0x57f19a[_0xa0d0('0x37')]=_['keys'](db[_0xa0d0('0x2e')][_0xa0d0('0x2f')]);_0x57f19a[_0xa0d0('0x33')]=_[_0xa0d0('0x34')](_0x50e628[_0xa0d0('0x33')]);_0x57f19a['filters']=_[_0xa0d0('0x36')](_0x57f19a['model'],_0x57f19a[_0xa0d0('0x33')]);_0x5f048d['attributes']=_[_0xa0d0('0x36')](_0x57f19a[_0xa0d0('0x37')],qs[_0xa0d0('0x39')](_0x50e628[_0xa0d0('0x33')]['fields']));_0x5f048d['attributes']=_0x5f048d[_0xa0d0('0x38')][_0xa0d0('0x3a')]?_0x5f048d[_0xa0d0('0x38')]:_0x57f19a[_0xa0d0('0x37')];if(_0x50e628[_0xa0d0('0x33')][_0xa0d0('0x45')]){_0x5f048d[_0xa0d0('0x46')]=[{'all':!![]}];}_0x5f048d=_['merge']({},_0x5f048d,_0x50e628[_0xa0d0('0x44')]);return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')](_0x5f048d)['then'](handleEntityNotFound(_0x395678,null))[_0xa0d0('0x29')](respondWithResult(_0x395678,null))['catch'](handleError(_0x395678,null));};exports[_0xa0d0('0x4c')]=function(_0x3ae491,_0xa30e39){return db[_0xa0d0('0x2e')][_0xa0d0('0x4c')](_0x3ae491[_0xa0d0('0x4d')],{})[_0xa0d0('0x29')](respondWithResult(_0xa30e39,0xc9))['catch'](handleError(_0xa30e39,null));};exports[_0xa0d0('0x4e')]=function(_0x4f2909,_0x25c91d){var _0x24fa71={'where':{'id':_0x4f2909[_0xa0d0('0x4a')]['id']}},_0x4a5389={};_0x4a5389['model']=_[_0xa0d0('0x34')](db[_0xa0d0('0x2e')][_0xa0d0('0x2f')]);_0x24fa71[_0xa0d0('0x38')]=_[_0xa0d0('0x36')](_0x4a5389[_0xa0d0('0x37')],qs[_0xa0d0('0x39')](_0x4f2909[_0xa0d0('0x33')][_0xa0d0('0x39')]));_0x24fa71[_0xa0d0('0x38')]=_0x24fa71[_0xa0d0('0x38')][_0xa0d0('0x3a')]?_0x24fa71[_0xa0d0('0x38')]:_0x4a5389[_0xa0d0('0x37')];if(_0x4f2909[_0xa0d0('0x33')]['includeAll']){_0x24fa71['include']=[{'all':!![]}];}_0x24fa71=_[_0xa0d0('0x42')]({},_0x24fa71,_0x4f2909[_0xa0d0('0x44')]);return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')](_0x24fa71)[_0xa0d0('0x29')](handleEntityNotFound(_0x25c91d,null))[_0xa0d0('0x29')](function(_0x45fa8f){if(_0x45fa8f){var _0x4e7246=_0x45fa8f[_0xa0d0('0x4f')]({'plain':!![]});_0x4e7246=qs['omit'](_0x4e7246,['id',_0xa0d0('0x50'),'updatedAt',_0xa0d0('0x51')]);_0x4f2909[_0xa0d0('0x4d')]=_[_0xa0d0('0x52')](_0x4f2909[_0xa0d0('0x4d')],['id',_0xa0d0('0x50'),_0xa0d0('0x53')]);return db[_0xa0d0('0x54')][_0xa0d0('0x55')](function(_0x3859fd){return db[_0xa0d0('0x2e')][_0xa0d0('0x4c')](_[_0xa0d0('0x42')](_0x4e7246,_0x4f2909[_0xa0d0('0x4d')]),{'include':_0x4f2909[_0xa0d0('0x33')][_0xa0d0('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x3859fd})[_0xa0d0('0x29')](function(_0x178946){var _0x572f10=_0x178946[_0xa0d0('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0xa0d0('0x47')]({'where':{'userProfileId':_0x4f2909[_0xa0d0('0x4a')]['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x48c5d6){if(_0x48c5d6){return BPromise['each'](_0x48c5d6,function(_0x42c568){return new BPromise(function(_0x150cb0,_0x35b1b4){if(_0x42c568['autoAssociation']===null||_0x42c568[_0xa0d0('0x56')]===0x1)_0x150cb0(null);return db[_0xa0d0('0x57')]['findAll']({'where':{'sectionId':_0x42c568['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x7a143f){var _0x256c1a=_[_0xa0d0('0x32')](_0x7a143f,function(_0x541524){return qs['omit'](_0x541524,['id',_0xa0d0('0x50'),_0xa0d0('0x53'),_0xa0d0('0x58')]);});_0x150cb0(_0x256c1a);})[_0xa0d0('0x49')](function(_0x44f7f7){_0x35b1b4(_0x44f7f7);});})[_0xa0d0('0x29')](function(_0x13fdb7){var _0x43f14c=qs[_0xa0d0('0x52')](_0x42c568,['id',_0xa0d0('0x50'),_0xa0d0('0x53')]);_0x43f14c[_0xa0d0('0x59')]=_0x572f10['id'];if(_0x13fdb7)_0x43f14c['Resources']=_0x13fdb7;return _0x43f14c;})['then'](function(_0x297d2d){return db[_0xa0d0('0x5a')][_0xa0d0('0x4c')](_0x297d2d,{'include':[{'model':db[_0xa0d0('0x57')],'as':_0xa0d0('0x5b')}],'raw':!![],'transaction':_0x3859fd});});})[_0xa0d0('0x29')](function(){return _0x572f10;});}});});});}})[_0xa0d0('0x29')](respondWithResult(_0x25c91d,0xc9))['catch'](handleError(_0x25c91d,null));};exports[_0xa0d0('0x27')]=function(_0x189e39,_0x258efd){if(_0x189e39[_0xa0d0('0x4d')]['id']){delete _0x189e39[_0xa0d0('0x4d')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x189e39[_0xa0d0('0x4a')]['id']}})[_0xa0d0('0x29')](handleEntityNotFound(_0x258efd,null))[_0xa0d0('0x29')](saveUpdates(_0x189e39[_0xa0d0('0x4d')],null))[_0xa0d0('0x29')](respondWithResult(_0x258efd,null))[_0xa0d0('0x49')](handleError(_0x258efd,null));};exports['destroy']=function(_0x55f52b,_0x40f690){return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')]({'where':{'id':_0x55f52b[_0xa0d0('0x4a')]['id']}})[_0xa0d0('0x29')](handleEntityNotFound(_0x40f690,null))[_0xa0d0('0x29')](removeEntity(_0x40f690,null))[_0xa0d0('0x49')](handleError(_0x40f690,null));};exports[_0xa0d0('0x5c')]=function(_0x5cf970,_0x214a21){return db[_0xa0d0('0x2e')][_0xa0d0('0x5c')]()['then'](respondWithResult(_0x214a21,null))['catch'](handleError(_0x214a21,null));};exports[_0xa0d0('0x5d')]=function(_0xb13f2f,_0x10e693){var _0x1e279c=_0xb13f2f['body'];return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')]({'where':{'id':_0xb13f2f['params']['id']}})['then'](handleEntityNotFound(_0x10e693,null))[_0xa0d0('0x29')](function(_0x3b028a){if(_0x3b028a){return db[_0xa0d0('0x54')]['transaction'](function(_0x5297a0){return db[_0xa0d0('0x5a')][_0xa0d0('0x28')]({'where':{'userProfileId':_0xb13f2f['params']['id'],'sectionId':_[_0xa0d0('0x32')](_0x1e279c,function(_0x3967dd){return _0x3967dd['sectionId'];})},'transaction':_0x5297a0})['then'](function(){var _0x276ca0=_[_0xa0d0('0x32')](_0x1e279c,function(_0x15bd5f){_0x15bd5f[_0xa0d0('0x59')]=_0xb13f2f['params']['id'];return _0x15bd5f;});var _0x38af52=[];return BPromise['each'](_0x276ca0,function(_0x5a642e){return db['UserProfileSection']['create'](_0x5a642e,{'include':[{'model':db['UserProfileResource'],'as':_0xa0d0('0x5b')}],'raw':!![],'transaction':_0x5297a0})[_0xa0d0('0x29')](function(_0x1f7a6f){_0x38af52[_0xa0d0('0x5e')](_0x1f7a6f[_0xa0d0('0x4f')]({'plain':!![]}));});})[_0xa0d0('0x29')](function(){return _0x38af52;});});});}})[_0xa0d0('0x29')](function(_0x5e5781){return _0x5e5781;})[_0xa0d0('0x29')](respondWithResult(_0x10e693,null))[_0xa0d0('0x49')](handleError(_0x10e693,null));};exports['removeSections']=function(_0x5daf38,_0x57f115){var _0x4c06ce;return db[_0xa0d0('0x2e')]['find']({'where':{'id':_0x5daf38['params']['id']},'attributes':['id',_0xa0d0('0x2d')]})[_0xa0d0('0x29')](handleEntityNotFound(_0x57f115,null))[_0xa0d0('0x29')](function(_0xf48508){if(_0xf48508){_0x4c06ce=_0xf48508;return db[_0xa0d0('0x5a')][_0xa0d0('0x28')]({'where':{'userProfileId':_0x5daf38[_0xa0d0('0x4a')]['id'],'sectionId':_0x5daf38[_0xa0d0('0x33')][_0xa0d0('0x5f')]}});}})[_0xa0d0('0x29')](function(){return _0x4c06ce;})['then'](respondWithStatusCode(_0x57f115,null))[_0xa0d0('0x49')](handleError(_0x57f115,null));};exports[_0xa0d0('0x60')]=function(_0x572738,_0x156fe1){var _0x4a7fc3=[];var _0x506bb3=[];return db[_0xa0d0('0x5a')][_0xa0d0('0x47')]({'where':{'userProfileId':_0x572738[_0xa0d0('0x4a')]['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x1a496d){_0x4a7fc3=_[_0xa0d0('0x41')](_0x1a496d,function(_0x16a00a){return _0x16a00a[_0xa0d0('0x61')]===0x1||_[_0xa0d0('0x62')]([0x3eb,0x709],_0x16a00a['sectionId']);});if(!_[_0xa0d0('0x63')](_0x4a7fc3)){return _[_0xa0d0('0x32')](_0x4a7fc3,function(_0x224a20){return _0x224a20[_0xa0d0('0x58')];});}else{return;}})[_0xa0d0('0x29')](function(_0x13244d){if(_0x13244d)_0x506bb3=_0x13244d;if(_[_0xa0d0('0x62')](_0x506bb3,0x64)){var _0x356986=_[_0xa0d0('0x4b')](_0x4a7fc3,{'sectionId':0x64});return hasDefaultDashboard(_0x356986)[_0xa0d0('0x29')](function(_0x42912d){return _[_0xa0d0('0x32')](_0x4a7fc3,function(_0x4b2601){if(_0x4b2601[_0xa0d0('0x58')]===0x64){_0x4b2601[_0xa0d0('0x64')]=_0x42912d;}return _0x4b2601;});});}else{return;}})['then'](function(_0x3c466f){if(_0x3c466f)_0x4a7fc3=_0x3c466f;if(_[_0xa0d0('0x62')](_0x506bb3,0x3eb)){var _0xf24049=_[_0xa0d0('0x4b')](_0x4a7fc3,{'sectionId':0x3eb});return getCustomDashboards(_0xf24049)['then'](function(_0x508779){return _['map'](_0x4a7fc3,function(_0x20ca70){if(_0xf24049[_0xa0d0('0x61')]){if(_0x20ca70[_0xa0d0('0x58')]===0x3eb){_0x20ca70[_0xa0d0('0x64')]=_0x508779;}}else{if(_0x20ca70[_0xa0d0('0x58')]===0x64){if(!_0x20ca70[_0xa0d0('0x64')]){_0x20ca70[_0xa0d0('0x64')]=[];}_0x20ca70[_0xa0d0('0x64')]=_0x20ca70[_0xa0d0('0x64')][_0xa0d0('0x65')](_0x508779);}}return _0x20ca70;});});}else{return;}})[_0xa0d0('0x29')](function(_0x1099fa){if(_0x1099fa)_0x4a7fc3=_0x1099fa;if(_['includes'](_0x506bb3,0x709)){var _0xea62ec=_[_0xa0d0('0x4b')](_0x4a7fc3,{'sectionId':0x709});return getPlugins(_0xea62ec)[_0xa0d0('0x29')](function(_0x1bddb8){if(_0xea62ec[_0xa0d0('0x61')]){return _['map'](_0x4a7fc3,function(_0x29ea12){if(_0x29ea12[_0xa0d0('0x58')]===0x709){_0x29ea12[_0xa0d0('0x64')]=_0x1bddb8;}return _0x29ea12;});}else{var _0x5736e1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1bddb8};var _0xc5f401=_[_0xa0d0('0x32')](_0x4a7fc3);_0xc5f401[_0xa0d0('0x5e')](_0x5736e1);return _0xc5f401;}});}else{return;}})['then'](function(_0xd3a511){if(_0xd3a511)_0x4a7fc3=_0xd3a511;return _['filter'](_0x4a7fc3,[_0xa0d0('0x61'),0x1]);})[_0xa0d0('0x29')](respondWithResult(_0x156fe1,null))[_0xa0d0('0x49')](handleError(_0x156fe1,null));};function hasDefaultDashboard(_0x3423b7){var _0x4fe9e3=[0x65];return new BPromise(function(_0x5710d1,_0x2b3d42){try{if(_0x3423b7[_0xa0d0('0x56')]){_0x5710d1(_0x4fe9e3);}else{return db[_0xa0d0('0x57')][_0xa0d0('0x66')]({'where':{'sectionId':_0x3423b7['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x5574e6){_0x5574e6?_0x5710d1(_0x4fe9e3):_0x5710d1();});}}catch(_0x593ad9){_0x2b3d42(_0x593ad9);}});}function getCustomDashboards(_0x2c56b8){var _0x24da61=[];return new BPromise(function(_0x93ab21,_0x1ae3d4){try{if(_0x2c56b8[_0xa0d0('0x56')]){return db[_0xa0d0('0x67')]['findAll']({'raw':!![]})[_0xa0d0('0x29')](function(_0x1574e7){_0x1574e7[_0xa0d0('0x68')](function(_0x258e56){_0x24da61[_0xa0d0('0x5e')](_0x258e56['id']+0x1869f);});_0x93ab21(_0x24da61);});}else{return db['UserProfileResource'][_0xa0d0('0x47')]({'where':{'sectionId':_0x2c56b8['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x540e9c){_0x540e9c['forEach'](function(_0x380d6a){_0x24da61[_0xa0d0('0x5e')](_0x380d6a[_0xa0d0('0x69')]+0x1869f);});_0x93ab21(_0x24da61);});}}catch(_0x50e04f){_0x1ae3d4(_0x50e04f);}});}function getPlugins(_0x2f9aa7){var _0x1f5890=[];return new BPromise(function(_0x4f97f9,_0x257479){try{if(_0x2f9aa7[_0xa0d0('0x56')]){return db['Plugin'][_0xa0d0('0x47')]({'raw':!![]})[_0xa0d0('0x29')](function(_0x3b2db1){_0x3b2db1[_0xa0d0('0x68')](function(_0x36e33c){_0x1f5890[_0xa0d0('0x5e')](_0x36e33c['id']+0x15b38);});_0x4f97f9(_0x1f5890);});}else{return db[_0xa0d0('0x57')][_0xa0d0('0x47')]({'where':{'sectionId':_0x2f9aa7['id']},'raw':!![]})[_0xa0d0('0x29')](function(_0x171331){_0x171331[_0xa0d0('0x68')](function(_0x34d885){_0x1f5890[_0xa0d0('0x5e')](_0x34d885[_0xa0d0('0x69')]+0x15b38);});_0x4f97f9(_0x1f5890);});}}catch(_0x4756fb){_0x257479(_0x4756fb);}});}exports[_0xa0d0('0x6a')]=function(_0x524a74,_0x339058){return db['UserProfile'][_0xa0d0('0x4b')]({'where':{'id':_0x524a74['params']['id']}})[_0xa0d0('0x29')](handleEntityNotFound(_0x339058,null))[_0xa0d0('0x29')](function(_0xc1b983){if(_0xc1b983){return db[_0xa0d0('0x54')][_0xa0d0('0x55')](function(_0x3bcf2b){return db[_0xa0d0('0x5a')][_0xa0d0('0x47')]({'where':{'userProfileId':_0x524a74[_0xa0d0('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xa0d0('0x29')](function(_0x37a2ee){if(_0x37a2ee){return db[_0xa0d0('0x5a')]['destroy']({'where':{'userProfileId':_0x524a74['params']['id'],'id':_[_0xa0d0('0x32')](_0x37a2ee,function(_0x2a3471){return _0x2a3471['id'];})},'transaction':_0x3bcf2b});}})[_0xa0d0('0x29')](function(_0x2cd4f5){var _0x57129f=_[_0xa0d0('0x32')](_0x524a74['body'],function(_0x15d053){_0x15d053[_0xa0d0('0x59')]=_0x524a74[_0xa0d0('0x4a')]['id'];return _0x15d053;});return db[_0xa0d0('0x5a')][_0xa0d0('0x6b')](_0x57129f,{'raw':!![],'transaction':_0x3bcf2b});})['then'](function(_0x420128){var _0x4b1e37=_[_0xa0d0('0x41')](_[_0xa0d0('0x32')](_0x420128,function(_0x1c756e){return _0x1c756e['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4b1e37){return db[_0xa0d0('0x5a')][_0xa0d0('0x47')]({'where':{'userProfileId':_0x524a74[_0xa0d0('0x4a')]['id'],'sectionId':_[_0xa0d0('0x32')](_0x4b1e37,function(_0x42e64a){return _0x42e64a[_0xa0d0('0x58')];})},'attributes':['id',_0xa0d0('0x58')],'raw':!![]})[_0xa0d0('0x29')](function(_0x2a2ad2){var _0x52f63d=_[_0xa0d0('0x32')](_0x524a74[_0xa0d0('0x4d')],function(_0x417f34){_0x417f34[_0xa0d0('0x59')]=_0x524a74['params']['id'];return _0x417f34;});return db[_0xa0d0('0x57')][_0xa0d0('0x6b')](_0x52f63d,{'raw':!![],'transaction':_0x3bcf2b});});}})[_0xa0d0('0x49')](handleError(_0x339058,null));});}})[_0xa0d0('0x29')](function(_0x486ee8){var _0x2255c9=_['map'](_0x486ee8,function(_0x2124b5){return _0x2124b5[_0xa0d0('0x4f')]({'plain':!![]});});})[_0xa0d0('0x29')](respondWithResult(_0x339058,null))[_0xa0d0('0x49')](handleError(_0x339058,null));};exports[_0xa0d0('0x6c')]=function(_0x42e4b5,_0x2f75e3,_0x26ead9){return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')]({'where':{'id':_0x42e4b5['params']['id']}})[_0xa0d0('0x29')](handleEntityNotFound(_0x2f75e3,null))[_0xa0d0('0x29')](function(_0x41c570){if(_0x41c570){return _0x41c570[_0xa0d0('0x6c')](_0x42e4b5[_0xa0d0('0x33')][_0xa0d0('0x5f')]);}})['then'](respondWithStatusCode(_0x2f75e3,null))['catch'](handleError(_0x2f75e3,null));};exports['getResources']=function(_0x4a70ce,_0x43a60b){var _0x30b43c={};if(!_0x4a70ce[_0xa0d0('0x33')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x4a70ce['query'][_0xa0d0('0x3b')](_0xa0d0('0x3c'))){_0x30b43c['limit']=qs[_0xa0d0('0x1f')](_0x4a70ce[_0xa0d0('0x33')][_0xa0d0('0x1f')]);_0x30b43c[_0xa0d0('0x1d')]=qs[_0xa0d0('0x1d')](_0x4a70ce[_0xa0d0('0x33')][_0xa0d0('0x1d')]);}return db[_0xa0d0('0x2e')][_0xa0d0('0x4b')]({'where':{'id':_0x4a70ce[_0xa0d0('0x4a')]['id']}})['then'](function(_0x2adeda){if(!_0x2adeda)throw new Error(_0xa0d0('0x6d')+_0x4a70ce[_0xa0d0('0x4a')]['id']);return db[_0xa0d0('0x2e')][_0xa0d0('0x6e')](_0x4a70ce);})[_0xa0d0('0x29')](respondWithFilteredResult(_0x43a60b,_0x30b43c))[_0xa0d0('0x49')](handleError(_0x43a60b,null));}; \ No newline at end of file +var _0x34ce=['limit','count','offset','set','Content-Range','update','destroy','then','error','stack','name','index','map','UserProfile','rawAttributes','type','keys','query','filters','attributes','intersection','model','fields','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','catch','create','body','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','find','describe','addSections','userProfileId','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','undefined'];(function(_0x381b03,_0x3604d3){var _0x19d10d=function(_0x561f9a){while(--_0x561f9a){_0x381b03['push'](_0x381b03['shift']());}};_0x19d10d(++_0x3604d3);}(_0x34ce,0x11a));var _0xe34c=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x34ce[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0xe34c('0x0'));var rimraf=require(_0xe34c('0x1'));var zipdir=require(_0xe34c('0x2'));var jsonpatch=require(_0xe34c('0x3'));var rp=require(_0xe34c('0x4'));var moment=require(_0xe34c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe34c('0x6'));var util=require(_0xe34c('0x7'));var path=require('path');var sox=require(_0xe34c('0x8'));var csv=require(_0xe34c('0x9'));var ejs=require(_0xe34c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe34c('0xb'));var squel=require('squel');var crypto=require(_0xe34c('0xc'));var jsforce=require(_0xe34c('0xd'));var deskjs=require(_0xe34c('0xe'));var toCsv=require(_0xe34c('0x9'));var querystring=require(_0xe34c('0xf'));var Papa=require(_0xe34c('0x10'));var Redis=require(_0xe34c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe34c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe34c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe34c('0x14'));var db=require(_0xe34c('0x15'))['db'];config[_0xe34c('0x16')]=_[_0xe34c('0x17')](config[_0xe34c('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe34c('0x16')]));require('./userProfile.socket')[_0xe34c('0x18')](socket);function respondWithStatusCode(_0x1633f0,_0x155554){_0x155554=_0x155554||0xcc;return function(_0xcad557){if(_0xcad557){return _0x1633f0[_0xe34c('0x19')](_0x155554);}return _0x1633f0[_0xe34c('0x1a')](_0x155554)[_0xe34c('0x1b')]();};}function respondWithResult(_0x2ea244,_0x73682d){_0x73682d=_0x73682d||0xc8;return function(_0x540f6a){if(_0x540f6a){return _0x2ea244['status'](_0x73682d)[_0xe34c('0x1c')](_0x540f6a);}};}function respondWithFilteredResult(_0x168636,_0x335c3d){return function(_0x1c53f4){if(_0x1c53f4){var _0x142396=typeof _0x335c3d['offset']===_0xe34c('0x1d')&&typeof _0x335c3d[_0xe34c('0x1e')]==='undefined';var _0x33127a=_0x1c53f4[_0xe34c('0x1f')];var _0x78667a=_0x142396?0x0:_0x335c3d[_0xe34c('0x20')];var _0xe2b40f=_0x142396?_0x1c53f4[_0xe34c('0x1f')]:_0x335c3d['offset']+_0x335c3d[_0xe34c('0x1e')];var _0x5a2e5e;if(_0xe2b40f>=_0x33127a){_0xe2b40f=_0x33127a;_0x5a2e5e=0xc8;}else{_0x5a2e5e=0xce;}_0x168636['status'](_0x5a2e5e);return _0x168636[_0xe34c('0x21')](_0xe34c('0x22'),_0x78667a+'-'+_0xe2b40f+'/'+_0x33127a)[_0xe34c('0x1c')](_0x1c53f4);}return null;};}function patchUpdates(_0x4975bc){return function(_0x4b4280){try{jsonpatch['apply'](_0x4b4280,_0x4975bc,!![]);}catch(_0x5e0a02){return BPromise['reject'](_0x5e0a02);}return _0x4b4280['save']();};}function saveUpdates(_0x43bd14,_0x6672bd){return function(_0x5180c2){if(_0x5180c2){return _0x5180c2[_0xe34c('0x23')](_0x43bd14)['then'](function(_0x5d8985){return _0x5d8985;});}return null;};}function removeEntity(_0x51ba68,_0x43ed65){return function(_0x40af6e){if(_0x40af6e){return _0x40af6e[_0xe34c('0x24')]()[_0xe34c('0x25')](function(){_0x51ba68[_0xe34c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40eb3d,_0x14c66d){return function(_0x14caa7){if(!_0x14caa7){_0x40eb3d[_0xe34c('0x19')](0x194);}return _0x14caa7;};}function handleError(_0x113a19,_0x503c95){_0x503c95=_0x503c95||0x1f4;return function(_0x96faf8){logger[_0xe34c('0x26')](_0x96faf8[_0xe34c('0x27')]);if(_0x96faf8[_0xe34c('0x28')]){delete _0x96faf8[_0xe34c('0x28')];}_0x113a19[_0xe34c('0x1a')](_0x503c95)['send'](_0x96faf8);};}exports[_0xe34c('0x29')]=function(_0x36ffb5,_0x53fb67){var _0x3055d6={},_0x5dcabe={},_0x36b294={'count':0x0,'rows':[]};var _0x139fd7=_[_0xe34c('0x2a')](db[_0xe34c('0x2b')][_0xe34c('0x2c')],function(_0x5d1acc){return{'name':_0x5d1acc['fieldName'],'type':_0x5d1acc[_0xe34c('0x2d')]['key']};});_0x5dcabe['model']=_[_0xe34c('0x2a')](_0x139fd7,_0xe34c('0x28'));_0x5dcabe['query']=_[_0xe34c('0x2e')](_0x36ffb5[_0xe34c('0x2f')]);_0x5dcabe[_0xe34c('0x30')]=_['intersection'](_0x5dcabe['model'],_0x5dcabe[_0xe34c('0x2f')]);_0x3055d6[_0xe34c('0x31')]=_[_0xe34c('0x32')](_0x5dcabe[_0xe34c('0x33')],qs['fields'](_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x34')]));_0x3055d6[_0xe34c('0x31')]=_0x3055d6[_0xe34c('0x31')]['length']?_0x3055d6[_0xe34c('0x31')]:_0x5dcabe[_0xe34c('0x33')];if(!_0x36ffb5[_0xe34c('0x2f')]['hasOwnProperty']('nolimit')){_0x3055d6[_0xe34c('0x1e')]=qs['limit'](_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x1e')]);_0x3055d6[_0xe34c('0x20')]=qs['offset'](_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x20')]);}_0x3055d6['order']=qs[_0xe34c('0x35')](_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x35')]);_0x3055d6[_0xe34c('0x36')]=qs[_0xe34c('0x30')](_[_0xe34c('0x37')](_0x36ffb5[_0xe34c('0x2f')],_0x5dcabe['filters']),_0x139fd7);if(_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x38')]){_0x3055d6['where']=_[_0xe34c('0x39')](_0x3055d6[_0xe34c('0x36')],{'$or':_[_0xe34c('0x2a')](_0x139fd7,function(_0x1284c3){if(_0x1284c3[_0xe34c('0x2d')]!==_0xe34c('0x3a')){var _0x474fa1={};_0x474fa1[_0x1284c3[_0xe34c('0x28')]]={'$like':'%'+_0x36ffb5[_0xe34c('0x2f')]['filter']+'%'};return _0x474fa1;}})});}_0x3055d6=_[_0xe34c('0x39')]({},_0x3055d6,_0x36ffb5[_0xe34c('0x3b')]);var _0x312792={'where':_0x3055d6['where']};return db[_0xe34c('0x2b')][_0xe34c('0x1f')](_0x312792)[_0xe34c('0x25')](function(_0x3e3b6f){_0x36b294[_0xe34c('0x1f')]=_0x3e3b6f;if(_0x36ffb5[_0xe34c('0x2f')][_0xe34c('0x3c')]){_0x3055d6[_0xe34c('0x3d')]=[{'all':!![]}];}return db[_0xe34c('0x2b')][_0xe34c('0x3e')](_0x3055d6);})[_0xe34c('0x25')](function(_0x2d6429){_0x36b294['rows']=_0x2d6429;return _0x36b294;})[_0xe34c('0x25')](respondWithFilteredResult(_0x53fb67,_0x3055d6))['catch'](handleError(_0x53fb67,null));};exports[_0xe34c('0x3f')]=function(_0x4c6a78,_0x297425){var _0x3c8021={'raw':![],'where':{'id':_0x4c6a78[_0xe34c('0x40')]['id']}},_0x3373fa={};_0x3373fa[_0xe34c('0x33')]=_[_0xe34c('0x2e')](db[_0xe34c('0x2b')][_0xe34c('0x2c')]);_0x3373fa[_0xe34c('0x2f')]=_[_0xe34c('0x2e')](_0x4c6a78['query']);_0x3373fa[_0xe34c('0x30')]=_[_0xe34c('0x32')](_0x3373fa[_0xe34c('0x33')],_0x3373fa['query']);_0x3c8021[_0xe34c('0x31')]=_[_0xe34c('0x32')](_0x3373fa['model'],qs[_0xe34c('0x34')](_0x4c6a78['query'][_0xe34c('0x34')]));_0x3c8021[_0xe34c('0x31')]=_0x3c8021[_0xe34c('0x31')][_0xe34c('0x41')]?_0x3c8021['attributes']:_0x3373fa[_0xe34c('0x33')];if(_0x4c6a78[_0xe34c('0x2f')][_0xe34c('0x3c')]){_0x3c8021['include']=[{'all':!![]}];}_0x3c8021=_['merge']({},_0x3c8021,_0x4c6a78['options']);return db['UserProfile']['find'](_0x3c8021)['then'](handleEntityNotFound(_0x297425,null))[_0xe34c('0x25')](respondWithResult(_0x297425,null))[_0xe34c('0x42')](handleError(_0x297425,null));};exports[_0xe34c('0x43')]=function(_0x586118,_0x467f66){return db['UserProfile'][_0xe34c('0x43')](_0x586118[_0xe34c('0x44')],{})[_0xe34c('0x25')](respondWithResult(_0x467f66,0xc9))['catch'](handleError(_0x467f66,null));};exports['clone']=function(_0xd81674,_0x24bc57){var _0x1cc441={'where':{'id':_0xd81674[_0xe34c('0x40')]['id']}},_0x409e01={};_0x409e01[_0xe34c('0x33')]=_[_0xe34c('0x2e')](db[_0xe34c('0x2b')][_0xe34c('0x2c')]);_0x1cc441[_0xe34c('0x31')]=_[_0xe34c('0x32')](_0x409e01[_0xe34c('0x33')],qs[_0xe34c('0x34')](_0xd81674[_0xe34c('0x2f')]['fields']));_0x1cc441[_0xe34c('0x31')]=_0x1cc441[_0xe34c('0x31')][_0xe34c('0x41')]?_0x1cc441[_0xe34c('0x31')]:_0x409e01[_0xe34c('0x33')];if(_0xd81674[_0xe34c('0x2f')][_0xe34c('0x3c')]){_0x1cc441['include']=[{'all':!![]}];}_0x1cc441=_[_0xe34c('0x39')]({},_0x1cc441,_0xd81674[_0xe34c('0x3b')]);return db[_0xe34c('0x2b')]['find'](_0x1cc441)[_0xe34c('0x25')](handleEntityNotFound(_0x24bc57,null))[_0xe34c('0x25')](function(_0x107d12){if(_0x107d12){var _0x3bf984=_0x107d12[_0xe34c('0x45')]({'plain':!![]});_0x3bf984=qs['omit'](_0x3bf984,['id',_0xe34c('0x46'),_0xe34c('0x47'),_0xe34c('0x48')]);_0xd81674['body']=_[_0xe34c('0x49')](_0xd81674[_0xe34c('0x44')],['id',_0xe34c('0x46'),_0xe34c('0x47')]);return db[_0xe34c('0x4a')][_0xe34c('0x4b')](function(_0x5a4abb){return db['UserProfile']['create'](_[_0xe34c('0x39')](_0x3bf984,_0xd81674[_0xe34c('0x44')]),{'include':_0xd81674[_0xe34c('0x2f')][_0xe34c('0x3c')]?[{'all':!![]}]:undefined,'transaction':_0x5a4abb})[_0xe34c('0x25')](function(_0x4cedf9){var _0x105e6e=_0x4cedf9[_0xe34c('0x45')]({'plain':!![]});return db[_0xe34c('0x4c')][_0xe34c('0x3e')]({'where':{'userProfileId':_0xd81674[_0xe34c('0x40')]['id']},'raw':!![]})['then'](function(_0x16db7e){if(_0x16db7e){return BPromise[_0xe34c('0x4d')](_0x16db7e,function(_0x1740ed){return new BPromise(function(_0x1d6270,_0x141d4){if(_0x1740ed['autoAssociation']===null||_0x1740ed[_0xe34c('0x4e')]===0x1)_0x1d6270(null);return db[_0xe34c('0x4f')]['findAll']({'where':{'sectionId':_0x1740ed['id']},'raw':!![]})[_0xe34c('0x25')](function(_0x1a5b62){var _0x590f91=_[_0xe34c('0x2a')](_0x1a5b62,function(_0xb59559){return qs['omit'](_0xb59559,['id',_0xe34c('0x46'),_0xe34c('0x47'),_0xe34c('0x50')]);});_0x1d6270(_0x590f91);})[_0xe34c('0x42')](function(_0x5223af){_0x141d4(_0x5223af);});})[_0xe34c('0x25')](function(_0x2880d8){var _0x327876=qs[_0xe34c('0x49')](_0x1740ed,['id',_0xe34c('0x46'),_0xe34c('0x47')]);_0x327876['userProfileId']=_0x105e6e['id'];if(_0x2880d8)_0x327876[_0xe34c('0x51')]=_0x2880d8;return _0x327876;})[_0xe34c('0x25')](function(_0x1f0055){return db[_0xe34c('0x4c')]['create'](_0x1f0055,{'include':[{'model':db[_0xe34c('0x4f')],'as':_0xe34c('0x51')}],'raw':!![],'transaction':_0x5a4abb});});})[_0xe34c('0x25')](function(){return _0x105e6e;});}});});});}})[_0xe34c('0x25')](respondWithResult(_0x24bc57,0xc9))[_0xe34c('0x42')](handleError(_0x24bc57,null));};exports[_0xe34c('0x23')]=function(_0x2cdc7c,_0x2f9060){if(_0x2cdc7c[_0xe34c('0x44')]['id']){delete _0x2cdc7c[_0xe34c('0x44')]['id'];}return db[_0xe34c('0x2b')][_0xe34c('0x52')]({'where':{'id':_0x2cdc7c['params']['id']}})[_0xe34c('0x25')](handleEntityNotFound(_0x2f9060,null))[_0xe34c('0x25')](saveUpdates(_0x2cdc7c[_0xe34c('0x44')],null))[_0xe34c('0x25')](respondWithResult(_0x2f9060,null))[_0xe34c('0x42')](handleError(_0x2f9060,null));};exports[_0xe34c('0x24')]=function(_0x109fbc,_0x163837){return db['UserProfile'][_0xe34c('0x52')]({'where':{'id':_0x109fbc[_0xe34c('0x40')]['id']}})['then'](handleEntityNotFound(_0x163837,null))[_0xe34c('0x25')](removeEntity(_0x163837,null))[_0xe34c('0x42')](handleError(_0x163837,null));};exports['describe']=function(_0x616b01,_0x41f541){return db[_0xe34c('0x2b')][_0xe34c('0x53')]()[_0xe34c('0x25')](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0xe34c('0x54')]=function(_0x78e4a8,_0x5d6ea3){var _0x3095b7=_0x78e4a8['body'];return db[_0xe34c('0x2b')][_0xe34c('0x52')]({'where':{'id':_0x78e4a8[_0xe34c('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d6ea3,null))['then'](function(_0x5cd5bf){if(_0x5cd5bf){return db['sequelize'][_0xe34c('0x4b')](function(_0xb1e29f){return db[_0xe34c('0x4c')][_0xe34c('0x24')]({'where':{'userProfileId':_0x78e4a8[_0xe34c('0x40')]['id'],'sectionId':_[_0xe34c('0x2a')](_0x3095b7,function(_0x472c00){return _0x472c00[_0xe34c('0x50')];})},'transaction':_0xb1e29f})[_0xe34c('0x25')](function(){var _0x189f53=_[_0xe34c('0x2a')](_0x3095b7,function(_0x5d4671){_0x5d4671[_0xe34c('0x55')]=_0x78e4a8['params']['id'];return _0x5d4671;});var _0x593d5c=[];return BPromise[_0xe34c('0x4d')](_0x189f53,function(_0x45fdf1){return db[_0xe34c('0x4c')][_0xe34c('0x43')](_0x45fdf1,{'include':[{'model':db['UserProfileResource'],'as':_0xe34c('0x51')}],'raw':!![],'transaction':_0xb1e29f})[_0xe34c('0x25')](function(_0x34dc4f){_0x593d5c[_0xe34c('0x56')](_0x34dc4f[_0xe34c('0x45')]({'plain':!![]}));});})[_0xe34c('0x25')](function(){return _0x593d5c;});});});}})['then'](function(_0x5f5185){return _0x5f5185;})[_0xe34c('0x25')](respondWithResult(_0x5d6ea3,null))['catch'](handleError(_0x5d6ea3,null));};exports[_0xe34c('0x57')]=function(_0x133036,_0x472f27){var _0x4989ee;return db[_0xe34c('0x2b')]['find']({'where':{'id':_0x133036[_0xe34c('0x40')]['id']},'attributes':['id',_0xe34c('0x28')]})[_0xe34c('0x25')](handleEntityNotFound(_0x472f27,null))[_0xe34c('0x25')](function(_0x21cca6){if(_0x21cca6){_0x4989ee=_0x21cca6;return db['UserProfileSection'][_0xe34c('0x24')]({'where':{'userProfileId':_0x133036[_0xe34c('0x40')]['id'],'sectionId':_0x133036[_0xe34c('0x2f')][_0xe34c('0x58')]}});}})[_0xe34c('0x25')](function(){return _0x4989ee;})[_0xe34c('0x25')](respondWithStatusCode(_0x472f27,null))['catch'](handleError(_0x472f27,null));};exports['getSections']=function(_0x582f57,_0x1f3be7){var _0x309f40=[];var _0x5d1d63=[];return db[_0xe34c('0x4c')][_0xe34c('0x3e')]({'where':{'userProfileId':_0x582f57[_0xe34c('0x40')]['id']},'raw':!![]})[_0xe34c('0x25')](function(_0x201c0d){_0x309f40=_[_0xe34c('0x38')](_0x201c0d,function(_0xdc10ae){return _0xdc10ae[_0xe34c('0x59')]===0x1||_[_0xe34c('0x5a')]([0x3eb,0x709],_0xdc10ae[_0xe34c('0x50')]);});if(!_[_0xe34c('0x5b')](_0x309f40)){return _[_0xe34c('0x2a')](_0x309f40,function(_0x1e6cd6){return _0x1e6cd6[_0xe34c('0x50')];});}else{return;}})['then'](function(_0xd90076){if(_0xd90076)_0x5d1d63=_0xd90076;if(_['includes'](_0x5d1d63,0x64)){var _0x2977ea=_[_0xe34c('0x52')](_0x309f40,{'sectionId':0x64});return hasDefaultDashboard(_0x2977ea)[_0xe34c('0x25')](function(_0x4fcb7a){return _[_0xe34c('0x2a')](_0x309f40,function(_0x5cd4c9){if(_0x5cd4c9[_0xe34c('0x50')]===0x64){_0x5cd4c9[_0xe34c('0x5c')]=_0x4fcb7a;}return _0x5cd4c9;});});}else{return;}})[_0xe34c('0x25')](function(_0x39f8e1){if(_0x39f8e1)_0x309f40=_0x39f8e1;if(_[_0xe34c('0x5a')](_0x5d1d63,0x3eb)){var _0x2b3e17=_[_0xe34c('0x52')](_0x309f40,{'sectionId':0x3eb});return getCustomDashboards(_0x2b3e17)[_0xe34c('0x25')](function(_0x2bde7f){return _[_0xe34c('0x2a')](_0x309f40,function(_0x174a1c){if(_0x2b3e17[_0xe34c('0x59')]){if(_0x174a1c[_0xe34c('0x50')]===0x3eb){_0x174a1c['subsections']=_0x2bde7f;}}else{if(_0x174a1c[_0xe34c('0x50')]===0x64){if(!_0x174a1c['subsections']){_0x174a1c[_0xe34c('0x5c')]=[];}_0x174a1c['subsections']=_0x174a1c[_0xe34c('0x5c')][_0xe34c('0x5d')](_0x2bde7f);}}return _0x174a1c;});});}else{return;}})[_0xe34c('0x25')](function(_0x129b0d){if(_0x129b0d)_0x309f40=_0x129b0d;if(_['includes'](_0x5d1d63,0x709)){var _0x443eb7=_['find'](_0x309f40,{'sectionId':0x709});return getPlugins(_0x443eb7)[_0xe34c('0x25')](function(_0x4386ad){if(_0x443eb7['enabled']){return _[_0xe34c('0x2a')](_0x309f40,function(_0x5bc7ed){if(_0x5bc7ed[_0xe34c('0x50')]===0x709){_0x5bc7ed['subsections']=_0x4386ad;}return _0x5bc7ed;});}else{var _0x36e893={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4386ad};var _0x935bfe=_[_0xe34c('0x2a')](_0x309f40);_0x935bfe[_0xe34c('0x56')](_0x36e893);return _0x935bfe;}});}else{return;}})[_0xe34c('0x25')](function(_0x62ecc0){if(_0x62ecc0)_0x309f40=_0x62ecc0;return _['filter'](_0x309f40,[_0xe34c('0x59'),0x1]);})[_0xe34c('0x25')](respondWithResult(_0x1f3be7,null))[_0xe34c('0x42')](handleError(_0x1f3be7,null));};function hasDefaultDashboard(_0x1fdb8b){var _0x19ff3e=[0x65];return new BPromise(function(_0x26e329,_0x8d1793){try{if(_0x1fdb8b[_0xe34c('0x4e')]){_0x26e329(_0x19ff3e);}else{return db[_0xe34c('0x4f')]['findOne']({'where':{'sectionId':_0x1fdb8b['id']},'raw':!![]})['then'](function(_0x50a68d){_0x50a68d?_0x26e329(_0x19ff3e):_0x26e329();});}}catch(_0x31b44b){_0x8d1793(_0x31b44b);}});}function getCustomDashboards(_0x17c77f){var _0x106bad=[];return new BPromise(function(_0x5b540e,_0x541767){try{if(_0x17c77f[_0xe34c('0x4e')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xe34c('0x25')](function(_0x209fdd){_0x209fdd[_0xe34c('0x5e')](function(_0x9808e){_0x106bad[_0xe34c('0x56')](_0x9808e['id']+0x1869f);});_0x5b540e(_0x106bad);});}else{return db[_0xe34c('0x4f')][_0xe34c('0x3e')]({'where':{'sectionId':_0x17c77f['id']},'raw':!![]})[_0xe34c('0x25')](function(_0x7246a5){_0x7246a5['forEach'](function(_0x52cf5a){_0x106bad[_0xe34c('0x56')](_0x52cf5a[_0xe34c('0x5f')]+0x1869f);});_0x5b540e(_0x106bad);});}}catch(_0x11f754){_0x541767(_0x11f754);}});}function getPlugins(_0x485f1d){var _0x66d7f9=[];return new BPromise(function(_0x1ea1a6,_0x5afafd){try{if(_0x485f1d['autoAssociation']){return db['Plugin'][_0xe34c('0x3e')]({'raw':!![]})[_0xe34c('0x25')](function(_0x73e09d){_0x73e09d[_0xe34c('0x5e')](function(_0x4e4fa9){_0x66d7f9[_0xe34c('0x56')](_0x4e4fa9['id']+0x15b38);});_0x1ea1a6(_0x66d7f9);});}else{return db['UserProfileResource'][_0xe34c('0x3e')]({'where':{'sectionId':_0x485f1d['id']},'raw':!![]})[_0xe34c('0x25')](function(_0x14a984){_0x14a984[_0xe34c('0x5e')](function(_0x11efce){_0x66d7f9[_0xe34c('0x56')](_0x11efce[_0xe34c('0x5f')]+0x15b38);});_0x1ea1a6(_0x66d7f9);});}}catch(_0x9bb1b6){_0x5afafd(_0x9bb1b6);}});}exports[_0xe34c('0x60')]=function(_0x45474c,_0x23cdfc){return db[_0xe34c('0x2b')][_0xe34c('0x52')]({'where':{'id':_0x45474c[_0xe34c('0x40')]['id']}})['then'](handleEntityNotFound(_0x23cdfc,null))[_0xe34c('0x25')](function(_0x1b05a4){if(_0x1b05a4){return db['sequelize'][_0xe34c('0x4b')](function(_0xa4e36d){return db[_0xe34c('0x4c')][_0xe34c('0x3e')]({'where':{'userProfileId':_0x45474c[_0xe34c('0x40')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x10f74b){if(_0x10f74b){return db[_0xe34c('0x4c')][_0xe34c('0x24')]({'where':{'userProfileId':_0x45474c[_0xe34c('0x40')]['id'],'id':_['map'](_0x10f74b,function(_0x30c1d7){return _0x30c1d7['id'];})},'transaction':_0xa4e36d});}})[_0xe34c('0x25')](function(_0x436bbb){var _0xa5e943=_[_0xe34c('0x2a')](_0x45474c['body'],function(_0x90acce){_0x90acce[_0xe34c('0x55')]=_0x45474c[_0xe34c('0x40')]['id'];return _0x90acce;});return db[_0xe34c('0x4c')][_0xe34c('0x61')](_0xa5e943,{'raw':!![],'transaction':_0xa4e36d});})[_0xe34c('0x25')](function(_0x477149){var _0x26575c=_[_0xe34c('0x38')](_[_0xe34c('0x2a')](_0x477149,function(_0x1e0a37){return _0x1e0a37[_0xe34c('0x45')]({'plain':!![]});}),{'includeAll':![]});if(_0x26575c){return db[_0xe34c('0x4c')]['findAll']({'where':{'userProfileId':_0x45474c[_0xe34c('0x40')]['id'],'sectionId':_[_0xe34c('0x2a')](_0x26575c,function(_0x48dc24){return _0x48dc24[_0xe34c('0x50')];})},'attributes':['id',_0xe34c('0x50')],'raw':!![]})['then'](function(_0x59ad0e){var _0xdeccaf=_[_0xe34c('0x2a')](_0x45474c['body'],function(_0x4c1972){_0x4c1972[_0xe34c('0x55')]=_0x45474c['params']['id'];return _0x4c1972;});return db[_0xe34c('0x4f')][_0xe34c('0x61')](_0xdeccaf,{'raw':!![],'transaction':_0xa4e36d});});}})[_0xe34c('0x42')](handleError(_0x23cdfc,null));});}})[_0xe34c('0x25')](function(_0x56adf7){var _0x43976c=_[_0xe34c('0x2a')](_0x56adf7,function(_0x1b793d){return _0x1b793d['get']({'plain':!![]});});})[_0xe34c('0x25')](respondWithResult(_0x23cdfc,null))[_0xe34c('0x42')](handleError(_0x23cdfc,null));};exports[_0xe34c('0x62')]=function(_0x33f4b5,_0x5753a7,_0x57b548){return db[_0xe34c('0x2b')]['find']({'where':{'id':_0x33f4b5['params']['id']}})[_0xe34c('0x25')](handleEntityNotFound(_0x5753a7,null))['then'](function(_0x32e7e9){if(_0x32e7e9){return _0x32e7e9['removeResources'](_0x33f4b5[_0xe34c('0x2f')]['ids']);}})[_0xe34c('0x25')](respondWithStatusCode(_0x5753a7,null))[_0xe34c('0x42')](handleError(_0x5753a7,null));};exports[_0xe34c('0x63')]=function(_0x267bd7,_0x4d47e0){var _0x498411={};if(!_0x267bd7[_0xe34c('0x2f')][_0xe34c('0x64')])throw new Error('Missing\x20section\x20parameter');if(!_0x267bd7['query'][_0xe34c('0x65')](_0xe34c('0x66'))){_0x498411['limit']=qs[_0xe34c('0x1e')](_0x267bd7['query'][_0xe34c('0x1e')]);_0x498411[_0xe34c('0x20')]=qs[_0xe34c('0x20')](_0x267bd7[_0xe34c('0x2f')][_0xe34c('0x20')]);}return db[_0xe34c('0x2b')][_0xe34c('0x52')]({'where':{'id':_0x267bd7[_0xe34c('0x40')]['id']}})['then'](function(_0x18049d){if(!_0x18049d)throw new Error(_0xe34c('0x67')+_0x267bd7[_0xe34c('0x40')]['id']);return db[_0xe34c('0x2b')][_0xe34c('0x63')](_0x267bd7);})[_0xe34c('0x25')](respondWithFilteredResult(_0x4d47e0,_0x498411))[_0xe34c('0x42')](handleError(_0x4d47e0,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a60c462..f5c4cff 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 _0xcd05=['exports','events','save','update','remove','hook'];(function(_0x105a4e,_0x54cfa0){var _0x3e4c8f=function(_0x45a981){while(--_0x45a981){_0x105a4e['push'](_0x105a4e['shift']());}};_0x3e4c8f(++_0x54cfa0);}(_0xcd05,0x163));var _0x5cd0=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xcd05[_0x4843f9];return _0x193c6a;};'use strict';var EventEmitter=require(_0x5cd0('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5cd0('0x1'),'afterUpdate':_0x5cd0('0x2'),'afterDestroy':_0x5cd0('0x3')};function emitEvent(_0x35dfb3){return function(_0x48e5ac,_0x33b92d,_0x2d88ed){UserProfileEvents['emit'](_0x35dfb3+':'+_0x48e5ac['id'],_0x48e5ac);UserProfileEvents['emit'](_0x35dfb3,_0x48e5ac);_0x2d88ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x5cd0('0x4')](e,emitEvent(event));}}module[_0x5cd0('0x5')]=UserProfileEvents; \ No newline at end of file +var _0x0650=['update','emit','exports','events','UserProfile','setMaxListeners'];(function(_0x386d58,_0x475404){var _0x31a408=function(_0x2726f0){while(--_0x2726f0){_0x386d58['push'](_0x386d58['shift']());}};_0x31a408(++_0x475404);}(_0x0650,0xed));var _0x0065=function(_0x4f7786,_0x4ffc01){_0x4f7786=_0x4f7786-0x0;var _0x42fbb9=_0x0650[_0x4f7786];return _0x42fbb9;};'use strict';var EventEmitter=require(_0x0065('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x0065('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0065('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0065('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e05a4){return function(_0x8260ba,_0x3dd8c6,_0x4b15b1){UserProfileEvents[_0x0065('0x4')](_0x2e05a4+':'+_0x8260ba['id'],_0x8260ba);UserProfileEvents['emit'](_0x2e05a4,_0x8260ba);_0x4b15b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x0065('0x5')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 0d2e833..319228b 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 _0x2bad=['charAt','toUpperCase','slice','Sequelize','QueryTypes','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','query','toString','UserProfile','../../components/parsers/qs','section','mergeResources','isEmpty','length','push','UserProfileSection','find','params','union','ignore','model','all','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','merge','key','foreignKey','forEach','options','includeAll','include','reportType','default','reportId','DefaultReports','CustomReports','ids','customSorting','extraQueryConditions','count','Tags','color','tag','ThroughTags','openTabs','true','chat','rows','dataValues','fax','whatsapp','lodash','./userProfile.attributes','squel','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','parentSections','Agents','User','agent','membername','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','OpenchannelQueue','openchannelaccounts','SmsQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','role','admin','user','Telephones','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','Schedule','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric'];(function(_0x5002b7,_0x1ae153){var _0x5e7cfe=function(_0x1ac8af){while(--_0x1ac8af){_0x5002b7['push'](_0x5002b7['shift']());}};_0x5e7cfe(++_0x1ae153);}(_0x2bad,0x1bd));var _0xd2ba=function(_0x22d7bb,_0x4c158e){_0x22d7bb=_0x22d7bb-0x0;var _0x40a737=_0x2bad[_0x22d7bb];return _0x40a737;};'use strict';var _=require(_0xd2ba('0x0'));var attributes=require(_0xd2ba('0x1'));var squel=require(_0xd2ba('0x2'));module['exports']=function(_0x4c8a44){var _0xe3442e=_0x4c8a44['models'];function _0x4c5189(_0x6bf2a4,_0xc50cf2){return new Promise(function(_0xc8316,_0x3d2e53){if(!_0xc50cf2)return _0xc8316(null);var _0x1c3a93=_0xc50cf2['filter']?{[_0xc50cf2[_0xd2ba('0x3')][_0xd2ba('0x4')]]:_0xc50cf2[_0xd2ba('0x3')][_0xd2ba('0x5')]}:undefined;return _0xe3442e[_0x6bf2a4][_0xd2ba('0x6')]({'where':_0x1c3a93,'raw':!![]})[_0xd2ba('0x7')](function(_0xcea7d2){_0xc50cf2[_0xd2ba('0x8')]=_[_0xd2ba('0x9')](_0xcea7d2,'id');_0xc8316(_0xc50cf2);})[_0xd2ba('0xa')](function(_0x483f22){_0x3d2e53(_0x483f22);});});}function _0x2121f6(_0x45ac10,_0x5df6da){return new Promise(function(_0x21e794,_0x5e422c){var _0x3764ca=_0x45ac10[_0xd2ba('0x3')]?{[_0x45ac10[_0xd2ba('0x3')][_0xd2ba('0x4')]]:_0x45ac10[_0xd2ba('0x3')][_0xd2ba('0x5')]}:undefined;return _0xe3442e[_0x45ac10['model']][_0xd2ba('0x6')]({'where':_0x3764ca,'raw':!![]})[_0xd2ba('0x7')](function(_0x40afa8){_0x5df6da[_0xd2ba('0x8')]=_[_0xd2ba('0x9')](_0x40afa8,function(_0x5acc1c){return _0x5acc1c[_0xd2ba('0xb')];});_0x21e794(_0x5df6da);})['catch'](function(_0x3b5076){_0x5e422c(_0x3b5076);});});}function _0x429bcd(_0x2e97d3,_0x3eaf70,_0x5eff13){if(!_0x3eaf70)return Promise[_0xd2ba('0xc')](null);return new Promise(function(_0x44e597,_0x47c789){return _0xe3442e[_0xd2ba('0xd')]['findAll']({'where':{'sectionId':_0x3eaf70['id']},'raw':!![]})[_0xd2ba('0x7')](function(_0x3eca2e){if(_0x2e97d3[_0xd2ba('0x4')]&&_0x2e97d3['field']!=='id'){_0x3eaf70['associatedResources']=_['map'](_0x3eca2e,function(_0x43c8c2){return _0x43c8c2[_0x2e97d3[_0xd2ba('0x4')]];});}else{if(_0x5eff13===_0xd2ba('0xe')){_0x3eaf70[_0xd2ba('0x8')]=_[_0xd2ba('0x9')](_0x3eca2e,function(_0x48af4a){return{'id':_0x48af4a['resourceId'],'type':_0x48af4a[_0xd2ba('0xf')]};});}else{_0x3eaf70['associatedResources']=_[_0xd2ba('0x9')](_0x3eca2e,function(_0x291b09){return _0x291b09[_0xd2ba('0x10')];});}}_0x44e597(_0x3eaf70);})['catch'](function(_0x490e33){_0x47c789(_0x490e33);});});}function _0x2f0ad7(_0x4dc226,_0x25d070){var _0x2d34ab={'parentSections':[]};switch(_0x4dc226['toLowerCase']()){case _0xd2ba('0x11'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x13');break;case _0xd2ba('0x14'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x15');break;case _0xd2ba('0x16'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x17');_0x2d34ab['parentSections']=[{'name':_0xd2ba('0x18'),'field':_0xd2ba('0xb'),'foreignKey':'projectName'}];break;case _0xd2ba('0x19'):_0x2d34ab[_0xd2ba('0x12')]='JscriptyProject';break;case _0xd2ba('0x1a'):_0x2d34ab['childModel']=_0xd2ba('0x1b');_0x2d34ab['parentSections']=[{'name':_0xd2ba('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd2ba('0x1d'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x1e');break;case _0xd2ba('0x1f'):_0x2d34ab[_0xd2ba('0x12')]='CmCompany';break;case _0xd2ba('0x20'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x21');break;case _0xd2ba('0x22'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x23');break;case _0xd2ba('0x24'):_0x2d34ab['childModel']=_0xd2ba('0x25');break;case _0xd2ba('0x26'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x27');break;case _0xd2ba('0x28'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x29');break;case _0xd2ba('0x2a'):case _0xd2ba('0x2b'):case _0xd2ba('0x2c'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x2d');break;case _0xd2ba('0x2e'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x2f');break;case _0xd2ba('0x30'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x31');break;case _0xd2ba('0x32'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x33');_0x2d34ab[_0xd2ba('0x34')]=[{'name':_0xd2ba('0x35'),'field':'name','foreignKey':'membername','model':_0xd2ba('0x36'),'filter':{'field':'role','value':[_0xd2ba('0x37')]}},{'name':'Telephones','field':_0xd2ba('0xb'),'foreignKey':_0xd2ba('0x38'),'model':_0xd2ba('0x36'),'filter':{'field':'role','value':[_0xd2ba('0x39')]}},{'name':_0xd2ba('0x3a'),'field':'name','foreignKey':_0xd2ba('0x3b'),'model':_0xd2ba('0x3c'),'filter':{'field':'type','value':['inbound']}},{'name':_0xd2ba('0x3d'),'field':'name','foreignKey':_0xd2ba('0x3b'),'model':'VoiceQueue','filter':{'field':_0xd2ba('0xf'),'value':[_0xd2ba('0x3e')]}}];break;case'musiconholds':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x3f');break;case _0xd2ba('0x40'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x41');break;case _0xd2ba('0x42'):_0x2d34ab[_0xd2ba('0x12')]='VoicePrefix';break;case _0xd2ba('0x43'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x44');break;case'mailqueues':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x45');break;case _0xd2ba('0x46'):_0x2d34ab[_0xd2ba('0x12')]='MailAccount';break;case'mailsubstatuses':_0x2d34ab[_0xd2ba('0x12')]='MailSubstatus';break;case'openchannelqueues':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x47');break;case _0xd2ba('0x48'):_0x2d34ab[_0xd2ba('0x12')]='OpenchannelAccount';break;case'smsqueues':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x49');break;case'smsaccounts':_0x2d34ab['childModel']='SmsAccount';break;case'whatsappqueues':_0x2d34ab[_0xd2ba('0x12')]='WhatsappQueue';break;case _0xd2ba('0x4a'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x4b');break;case _0xd2ba('0x4c'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x4d');break;case _0xd2ba('0x4e'):case _0xd2ba('0x4f'):_0x2d34ab[_0xd2ba('0x12')]='VoiceQueue';if(_0x25d070){_0x2d34ab[_0xd2ba('0x34')]=[{'name':_0xd2ba('0x3a')},{'name':_0xd2ba('0x3d')}];}break;case'users':case _0xd2ba('0x50'):case _0xd2ba('0x51'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x36');if(_0x25d070){_0x2d34ab['parentSections']=[{'name':_0xd2ba('0x52'),'filter':{'field':_0xd2ba('0x53'),'value':[_0xd2ba('0x54'),_0xd2ba('0x55')]},'ignore':!![]},{'name':_0xd2ba('0x35')},{'name':_0xd2ba('0x56')}];}break;case'zendeskaccounts':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x57');break;case _0xd2ba('0x58'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x59');break;case'freshdeskaccounts':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x5a');break;case _0xd2ba('0x5b'):_0x2d34ab['childModel']=_0xd2ba('0x5c');break;case _0xd2ba('0x5d'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x5e');break;case _0xd2ba('0x5f'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x60');break;case _0xd2ba('0x61'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x36');break;case _0xd2ba('0x62'):_0x2d34ab[_0xd2ba('0x12')]='CannedAnswer';break;case _0xd2ba('0x63'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x64');break;case _0xd2ba('0x65'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x66');break;case _0xd2ba('0x67'):_0x2d34ab[_0xd2ba('0x12')]='Interval';break;case'pauses':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x68');break;case _0xd2ba('0x69'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x6a');break;case'sounds':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x6b');break;case _0xd2ba('0x6c'):_0x2d34ab['childModel']=_0xd2ba('0x6d');break;case'templates':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x6e');break;case _0xd2ba('0x6f'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x70');break;case'trunks':_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x71');break;case _0xd2ba('0x72'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x73');break;case _0xd2ba('0x74'):_0x2d34ab['childModel']=_0xd2ba('0x75');break;case _0xd2ba('0x76'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0xe');_0x2d34ab[_0xd2ba('0x34')]=[{'name':_0xd2ba('0x77'),'field':'id','foreignKey':'reportId'}];break;case _0xd2ba('0x78'):_0x2d34ab[_0xd2ba('0x12')]=_0xd2ba('0x79');break;}return _0x2d34ab;}function _0x30d060(_0x19e37b,_0x1bdb72){var _0x464a9d=_0x19e37b[_0xd2ba('0x7a')](0x0)[_0xd2ba('0x7b')]()+_0x19e37b[_0xd2ba('0x7c')](0x1);var _0x231d9f={'type':_0xe3442e[_0xd2ba('0x7d')][_0xd2ba('0x7e')]['SELECT'],'raw':!![]};return new Promise(function(_0x320623,_0x474ad6){var _0x5f56dc=squel['select']()[_0xd2ba('0x4')](_0xd2ba('0x7f')+_0x464a9d+_0xd2ba('0x80'),'id')[_0xd2ba('0x4')](_0xd2ba('0x81'))[_0xd2ba('0x82')]('user_has_'+_0x19e37b+_0xd2ba('0x83'),'ui')[_0xd2ba('0x84')](_0xd2ba('0x85'),_0x1bdb72['id']);return _0xe3442e['sequelize'][_0xd2ba('0x86')](_0x5f56dc[_0xd2ba('0x87')](),_0x231d9f)['then'](function(_0x3cf54f){_0x1bdb72[_0x464a9d+'OpenTabs']=_0x3cf54f;_0x320623(_0x3cf54f);})[_0xd2ba('0xa')](function(_0x5a5d60){_0x474ad6(_0x5a5d60);});});}return _0x4c8a44['define'](_0xd2ba('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b6aac){var _0x26b3e9=require(_0xd2ba('0x89'));var _0x3958f5={'raw':_0x3b6aac['query']['raw'],'where':{}};var _0x1e73ce={};var _0x3477c5={'count':0x0,'rows':[]};var _0x590db7=_0x3b6aac['query'][_0xd2ba('0x8a')];var _0x519ead=_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0x8b')]||![];var _0x50b0c7=_0x2f0ad7(_0x590db7,_0x519ead);if(!_0x50b0c7[_0xd2ba('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x590db7+'\x27');var _0x58d678=[{'name':_0x590db7}];if(!_[_0xd2ba('0x8c')](_0x50b0c7['parentSections']))_0x58d678=_0x50b0c7[_0xd2ba('0x34')];var _0x10b215=[];for(var _0x356b28=0x0;_0x356b28<_0x58d678[_0xd2ba('0x8d')];_0x356b28++){_0x10b215[_0xd2ba('0x8e')](_0xe3442e[_0xd2ba('0x8f')][_0xd2ba('0x90')]({'where':{'userProfileId':_0x3b6aac[_0xd2ba('0x91')]['id'],'name':_0x58d678[_0x356b28]['name']},'raw':!![]}));}return Promise['all'](_0x10b215)[_0xd2ba('0x7')](function(_0x4bb29f){var _0x4f21ae=_[_0xd2ba('0x3')](_0x4bb29f,function(_0x2d6ebe){return _0x2d6ebe?_0x2d6ebe:undefined;});var _0x3cb775=_[_0xd2ba('0x3')](_0x58d678,['ignore',!![]]);var _0x4422ad=_['isEmpty'](_0x4f21ae)&&_[_0xd2ba('0x8c')](_0x3cb775)?null:_[_0xd2ba('0x92')](_0x3cb775,_0x4f21ae);if(!_0x4422ad)return null;var _0x483cae=[];for(var _0x80614f=0x0;_0x80614f<_0x4422ad[_0xd2ba('0x8d')];_0x80614f++){var _0x2f15e0=_['find'](_0x58d678,function(_0x2ce471){return _0x4422ad[_0x80614f]?_0x2ce471['name']===_0x4422ad[_0x80614f][_0xd2ba('0xb')]:null;});if(_0x2f15e0){if(_0x4422ad[_0x80614f][_0xd2ba('0x93')]){_0x483cae[_0xd2ba('0x8e')](_0x4c5189(_0x50b0c7['childModel'],_0x4422ad[_0x80614f]));}else{if(!_0x4422ad[_0x80614f]['autoAssociation']){_0x483cae[_0xd2ba('0x8e')](_0x429bcd(_0x2f15e0,_0x4422ad[_0x80614f],_0x50b0c7[_0xd2ba('0x12')]));}else{if(_0x2f15e0[_0xd2ba('0x94')]){_0x483cae['push'](_0x2121f6(_0x2f15e0,_0x4422ad[_0x80614f]));}}}}}return Promise[_0xd2ba('0x95')](_0x483cae);})[_0xd2ba('0x7')](function(_0x4783da){var _0x52bee5=_0x4783da;var _0x1e7ab8=null;if(_0x52bee5){_0x1e7ab8=_0x52bee5['length']===0x1?_0x52bee5[0x0]:null;}if(!_0x1e7ab8&&!_0x52bee5)return _0x3477c5;var _0x57768a=_0xe3442e[_0x50b0c7[_0xd2ba('0x12')]][_0xd2ba('0x96')];_0x1e73ce[_0xd2ba('0x94')]=_[_0xd2ba('0x97')](_0x57768a);_0x1e73ce[_0xd2ba('0x86')]=_['keys'](_0x3b6aac[_0xd2ba('0x86')]);_0x1e73ce[_0xd2ba('0x98')]=_[_0xd2ba('0x99')](_0x1e73ce[_0xd2ba('0x94')],_0x1e73ce['query']);_0x3958f5['attributes']=_[_0xd2ba('0x99')](_0x1e73ce[_0xd2ba('0x94')],_0x26b3e9[_0xd2ba('0x9a')](_0x3b6aac[_0xd2ba('0x86')]['fields']));_0x3958f5['attributes']=_0x3958f5[_0xd2ba('0x9b')][_0xd2ba('0x8d')]?_0x3958f5[_0xd2ba('0x9b')]:_0x1e73ce[_0xd2ba('0x94')];if(!_0x3b6aac['query'][_0xd2ba('0x9c')]('nolimit')){_0x3958f5[_0xd2ba('0x9d')]=_0x26b3e9['limit'](_0x3b6aac['query'][_0xd2ba('0x9d')]);_0x3958f5[_0xd2ba('0x9e')]=_0x26b3e9[_0xd2ba('0x9e')](_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0x9e')]);}_0x3958f5[_0xd2ba('0x9f')]=_0x26b3e9[_0xd2ba('0xa0')](_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xa0')]);_0x3958f5[_0xd2ba('0x84')]=_0x26b3e9[_0xd2ba('0x98')](_[_0xd2ba('0xa1')](_0x3b6aac['query'],_0x1e73ce[_0xd2ba('0x98')]));if(_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0x3')]){_0x3958f5[_0xd2ba('0x84')]=_[_0xd2ba('0xa2')](_0x3958f5[_0xd2ba('0x84')],{'$or':_['map'](_0x57768a,function(_0x298d92){if(_0x298d92[_0xd2ba('0xf')][_0xd2ba('0xa3')]!=='VIRTUAL'){var _0x1974af={};_0x1974af[_0x298d92[_0xd2ba('0x4')]]={'$like':'%'+_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0x3')]+'%'};return _0x1974af;}})});}var _0x4b0b41=[];var _0x40371a=null;var _0xcdfb2a={};if(_0x1e7ab8){_0x40371a=_[_0xd2ba('0x90')](_0x58d678,['name',_0x1e7ab8[_0xd2ba('0xb')]]);if(_0x40371a[_0xd2ba('0x4')]){_0xcdfb2a={};if(_0x50b0c7['childModel']==='AnalyticExtractedReport'){_0xcdfb2a[_0x40371a['foreignKey']]=_[_0xd2ba('0x9')](_0x1e7ab8[_0xd2ba('0x8')],'id');}else{_0xcdfb2a[_0x40371a[_0xd2ba('0xa4')]]=_0x1e7ab8[_0xd2ba('0x8')];}_0x4b0b41[_0xd2ba('0x8e')](_0xcdfb2a);}else{_0x3958f5['where']['id']=_0x1e7ab8['associatedResources'];}}else{for(var _0x597051=0x0;_0x597051<_0x52bee5[_0xd2ba('0x8d')];_0x597051++){_0x40371a=_[_0xd2ba('0x90')](_0x58d678,['name',_0x52bee5[_0x597051][_0xd2ba('0xb')]]);if(_0x40371a[_0xd2ba('0x4')]){_0xcdfb2a={};_0xcdfb2a[_0x40371a[_0xd2ba('0xa4')]]=_0x52bee5[_0x597051]['associatedResources'];_0x4b0b41[_0xd2ba('0x8e')](_0xcdfb2a);}else{if(!_0x3958f5[_0xd2ba('0x84')]['id'])_0x3958f5[_0xd2ba('0x84')]['id']=[];_0x52bee5[_0x597051]['associatedResources'][_0xd2ba('0xa5')](function(_0x573bec){_0x3958f5[_0xd2ba('0x84')]['id'][_0xd2ba('0x8e')](_0x573bec);});}}}if(!_[_0xd2ba('0x8c')](_0x4b0b41)){_0x3958f5[_0xd2ba('0x84')]=_[_0xd2ba('0xa2')](_0x3958f5[_0xd2ba('0x84')],{'$and':{'$or':_0x4b0b41}});}_0x3958f5=_[_0xd2ba('0xa2')]({},_0x3958f5,_0x3b6aac[_0xd2ba('0xa6')]);if(_0x1e7ab8&&!_0x1e7ab8['autoAssociation']&&_0x50b0c7[_0xd2ba('0x12')]==='AnalyticExtractedReport'){if(_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xa7')]){_0x3958f5[_0xd2ba('0xa8')]=[{'all':!![]}];}return _0xe3442e[_0x50b0c7[_0xd2ba('0x12')]][_0xd2ba('0x6')](_0x3958f5)['then'](function(_0x276cf1){var _0x3f62d7=[];_0x276cf1[_0xd2ba('0xa5')](function(_0x4c8fbf){var _0x17b5ea;switch(_0x4c8fbf[_0xd2ba('0xa9')]){case _0xd2ba('0xaa'):_0x17b5ea=_[_0xd2ba('0x90')](_0x1e7ab8[_0xd2ba('0x8')],function(_0x5590a7){return _0x5590a7['id']===_0x4c8fbf[_0xd2ba('0xab')]&&_0x5590a7[_0xd2ba('0xf')]===_0xd2ba('0xac');});break;case'custom':_0x17b5ea=_[_0xd2ba('0x90')](_0x1e7ab8[_0xd2ba('0x8')],function(_0x505aee){return _0x505aee['id']===_0x4c8fbf[_0xd2ba('0xab')]&&_0x505aee[_0xd2ba('0xf')]===_0xd2ba('0xad');});break;}if(_0x17b5ea)_0x3f62d7[_0xd2ba('0x8e')](_0x4c8fbf);});_0x3477c5['count']=_0x3f62d7[_0xd2ba('0x8d')];_0x3477c5['rows']=_0x3f62d7;return _0x3477c5;});}else{if(!_[_0xd2ba('0x8c')](_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xae')])){_0x3958f5['where']['id']=_0x3958f5[_0xd2ba('0x84')]['id']?_[_0xd2ba('0x99')](_0x3958f5[_0xd2ba('0x84')]['id'],_0x3b6aac[_0xd2ba('0x86')]['ids']):_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xae')];if(_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xaf')]){_0x3958f5[_0xd2ba('0x9f')]=_0x3b6aac[_0xd2ba('0x86')]['customSorting'];}}if(_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xb0')]){_0x3958f5[_0xd2ba('0x84')]=_[_0xd2ba('0xa2')](_0x3958f5[_0xd2ba('0x84')],{'$and':_0x3b6aac['query'][_0xd2ba('0xb0')]});}return _0xe3442e[_0x50b0c7['childModel']][_0xd2ba('0xb1')]({'where':_0x3958f5[_0xd2ba('0x84')]})[_0xd2ba('0x7')](function(_0x628018){_0x3477c5[_0xd2ba('0xb1')]=_0x628018;if(_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xa7')]){if(_0x50b0c7[_0xd2ba('0x12')]==='CmContact'){_0x3958f5[_0xd2ba('0xa8')]=[{'model':_0xe3442e[_0xd2ba('0x6d')],'as':_0xd2ba('0xb2'),'attributes':['id',_0xd2ba('0xb'),_0xd2ba('0xb3')],'required':_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xb4')]?!![]:![]},{'model':_0xe3442e['Tag'],'as':_0xd2ba('0xb5'),'attributes':['id',_0xd2ba('0xb'),'color'],'through':_0x3b6aac['query'][_0xd2ba('0xb4')]?{'attributes':[],'where':{'TagId':_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xb4')]||undefined}}:{},'required':_0x3b6aac[_0xd2ba('0x86')][_0xd2ba('0xb4')]?!![]:![]}];}else{_0x3958f5['include']=[{'all':!![]}];}}return _0xe3442e[_0x50b0c7[_0xd2ba('0x12')]]['findAll'](_0x3958f5);})['then'](function(_0x50d34f){_0x3477c5['rows']=_0x50d34f;if(_0x590db7==='Agents'&&_0x3b6aac['query'][_0xd2ba('0xb6')]===_0xd2ba('0xb7')){var _0x3b1119=[];for(var _0x45fae3=0x0;_0x45fae3<_0x3477c5['rows'][_0xd2ba('0x8d')];_0x45fae3++){_0x3b1119[_0xd2ba('0x8e')](_0x30d060(_0xd2ba('0xb8'),_0x3477c5[_0xd2ba('0xb9')][_0x45fae3][_0xd2ba('0xba')]));_0x3b1119[_0xd2ba('0x8e')](_0x30d060('sms',_0x3477c5[_0xd2ba('0xb9')][_0x45fae3][_0xd2ba('0xba')]));_0x3b1119[_0xd2ba('0x8e')](_0x30d060(_0xd2ba('0xbb'),_0x3477c5[_0xd2ba('0xb9')][_0x45fae3][_0xd2ba('0xba')]));_0x3b1119['push'](_0x30d060('mail',_0x3477c5[_0xd2ba('0xb9')][_0x45fae3][_0xd2ba('0xba')]));_0x3b1119[_0xd2ba('0x8e')](_0x30d060('openchannel',_0x3477c5[_0xd2ba('0xb9')][_0x45fae3][_0xd2ba('0xba')]));_0x3b1119['push'](_0x30d060(_0xd2ba('0xbc'),_0x3477c5['rows'][_0x45fae3][_0xd2ba('0xba')]));}return Promise[_0xd2ba('0x95')](_0x3b1119)[_0xd2ba('0x7')](function(){return _0x3477c5;});}return _0x3477c5;});}});}}});}; \ No newline at end of file +var _0xa9b0=['reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','order','customSorting','extraQueryConditions','CmContact','color','tag','ThroughTags','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','exports','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','role','Telephones','telephone','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','User','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','CannedAnswer','dispositions','Dashboard','intervals','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','toString','OpenTabs','UserProfile','../../components/parsers/qs','query','section','Invalid\x20section\x20\x27','push','UserProfileSection','find','params','all','ignore','isEmpty','union','length','rawAttributes','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','type','key','foreignKey','forEach','autoAssociation','includeAll','include'];(function(_0xf98854,_0x8abe4c){var _0x456f98=function(_0x4143dc){while(--_0x4143dc){_0xf98854['push'](_0xf98854['shift']());}};_0x456f98(++_0x8abe4c);}(_0xa9b0,0xd4));var _0x0a9b=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0xa9b0[_0x23e6bb];return _0x1e3b4c;};'use strict';var _=require('lodash');var attributes=require(_0x0a9b('0x0'));var squel=require(_0x0a9b('0x1'));module[_0x0a9b('0x2')]=function(_0x1a8ca2){var _0x5537ef=_0x1a8ca2['models'];function _0x1ce674(_0x13f669,_0x498538){return new Promise(function(_0x25d6b9,_0xf7391e){if(!_0x498538)return _0x25d6b9(null);var _0x1f030a=_0x498538[_0x0a9b('0x3')]?{[_0x498538[_0x0a9b('0x3')][_0x0a9b('0x4')]]:_0x498538[_0x0a9b('0x3')]['value']}:undefined;return _0x5537ef[_0x13f669][_0x0a9b('0x5')]({'where':_0x1f030a,'raw':!![]})[_0x0a9b('0x6')](function(_0x3ff9c1){_0x498538['associatedResources']=_[_0x0a9b('0x7')](_0x3ff9c1,'id');_0x25d6b9(_0x498538);})[_0x0a9b('0x8')](function(_0x279657){_0xf7391e(_0x279657);});});}function _0x2da9cc(_0x2e6192,_0x479e26){return new Promise(function(_0x1f8056,_0x288d12){var _0x586315=_0x2e6192['filter']?{[_0x2e6192[_0x0a9b('0x3')]['field']]:_0x2e6192[_0x0a9b('0x3')][_0x0a9b('0x9')]}:undefined;return _0x5537ef[_0x2e6192[_0x0a9b('0xa')]][_0x0a9b('0x5')]({'where':_0x586315,'raw':!![]})[_0x0a9b('0x6')](function(_0x1c857f){_0x479e26[_0x0a9b('0xb')]=_[_0x0a9b('0x7')](_0x1c857f,function(_0x2a3dda){return _0x2a3dda[_0x0a9b('0xc')];});_0x1f8056(_0x479e26);})[_0x0a9b('0x8')](function(_0x50d9d2){_0x288d12(_0x50d9d2);});});}function _0x4b4e8c(_0x43c191,_0x16dace,_0x2e15f4){if(!_0x16dace)return Promise[_0x0a9b('0xd')](null);return new Promise(function(_0x14dd92,_0x28ce8c){return _0x5537ef[_0x0a9b('0xe')][_0x0a9b('0x5')]({'where':{'sectionId':_0x16dace['id']},'raw':!![]})[_0x0a9b('0x6')](function(_0xecbe07){if(_0x43c191[_0x0a9b('0x4')]&&_0x43c191[_0x0a9b('0x4')]!=='id'){_0x16dace[_0x0a9b('0xb')]=_[_0x0a9b('0x7')](_0xecbe07,function(_0x345c94){return _0x345c94[_0x43c191['field']];});}else{if(_0x2e15f4===_0x0a9b('0xf')){_0x16dace['associatedResources']=_[_0x0a9b('0x7')](_0xecbe07,function(_0x209330){return{'id':_0x209330['resourceId'],'type':_0x209330['type']};});}else{_0x16dace['associatedResources']=_[_0x0a9b('0x7')](_0xecbe07,function(_0x47fa2c){return _0x47fa2c['resourceId'];});}}_0x14dd92(_0x16dace);})[_0x0a9b('0x8')](function(_0x480fdd){_0x28ce8c(_0x480fdd);});});}function _0x54e808(_0x5e5a93,_0x37d030){var _0x47942a={'parentSections':[]};switch(_0x5e5a93[_0x0a9b('0x10')]()){case _0x0a9b('0x11'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x13');break;case'odbc':_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x14');break;case'squarerecordings':_0x47942a['childModel']=_0x0a9b('0x15');_0x47942a[_0x0a9b('0x16')]=[{'name':_0x0a9b('0x17'),'field':_0x0a9b('0xc'),'foreignKey':_0x0a9b('0x18')}];break;case _0x0a9b('0x19'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x1a');break;case _0x0a9b('0x1b'):_0x47942a['childModel']='CmContact';_0x47942a[_0x0a9b('0x16')]=[{'name':_0x0a9b('0x1c'),'field':'id','foreignKey':_0x0a9b('0x1d')}];break;case _0x0a9b('0x1e'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x1f');break;case _0x0a9b('0x20'):_0x47942a['childModel']=_0x0a9b('0x21');break;case _0x0a9b('0x22'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x23');break;case _0x0a9b('0x24'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x25');break;case'chatwebsites':_0x47942a[_0x0a9b('0x12')]='ChatWebsite';break;case _0x0a9b('0x26'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x27');break;case _0x0a9b('0x28'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x29');break;case _0x0a9b('0x2a'):case _0x0a9b('0x2b'):case _0x0a9b('0x2c'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x2d');break;case _0x0a9b('0x2e'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x2f');break;case _0x0a9b('0x30'):_0x47942a['childModel']=_0x0a9b('0x31');break;case _0x0a9b('0x32'):_0x47942a[_0x0a9b('0x12')]='VoiceRecording';_0x47942a[_0x0a9b('0x16')]=[{'name':_0x0a9b('0x33'),'field':'name','foreignKey':_0x0a9b('0x34'),'model':'User','filter':{'field':_0x0a9b('0x35'),'value':['agent']}},{'name':_0x0a9b('0x36'),'field':_0x0a9b('0xc'),'foreignKey':_0x0a9b('0x34'),'model':'User','filter':{'field':_0x0a9b('0x35'),'value':[_0x0a9b('0x37')]}},{'name':'VoiceQueues','field':_0x0a9b('0xc'),'foreignKey':_0x0a9b('0x38'),'model':_0x0a9b('0x39'),'filter':{'field':'type','value':['inbound']}},{'name':_0x0a9b('0x3a'),'field':'name','foreignKey':_0x0a9b('0x38'),'model':_0x0a9b('0x39'),'filter':{'field':'type','value':[_0x0a9b('0x3b')]}}];break;case _0x0a9b('0x3c'):_0x47942a[_0x0a9b('0x12')]='VoiceMusicOnHold';break;case _0x0a9b('0x3d'):_0x47942a['childModel']='VoiceChanSpy';break;case _0x0a9b('0x3e'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x3f');break;case'ivrcampaigns':_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x40');break;case _0x0a9b('0x41'):_0x47942a[_0x0a9b('0x12')]='MailQueue';break;case _0x0a9b('0x42'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x43');break;case _0x0a9b('0x44'):_0x47942a['childModel']=_0x0a9b('0x45');break;case'openchannelqueues':_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x46');break;case _0x0a9b('0x47'):_0x47942a['childModel']='OpenchannelAccount';break;case _0x0a9b('0x48'):_0x47942a[_0x0a9b('0x12')]='SmsQueue';break;case _0x0a9b('0x49'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x4a');break;case _0x0a9b('0x4b'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x4c');break;case _0x0a9b('0x4d'):_0x47942a['childModel']=_0x0a9b('0x4e');break;case _0x0a9b('0x4f'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x50');break;case _0x0a9b('0x51'):case _0x0a9b('0x52'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x39');if(_0x37d030){_0x47942a[_0x0a9b('0x16')]=[{'name':'VoiceQueues'},{'name':_0x0a9b('0x3a')}];}break;case'users':case _0x0a9b('0x53'):case _0x0a9b('0x54'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x55');if(_0x37d030){_0x47942a[_0x0a9b('0x16')]=[{'name':'Users','filter':{'field':_0x0a9b('0x35'),'value':['admin',_0x0a9b('0x56')]},'ignore':!![]},{'name':_0x0a9b('0x33')},{'name':'Telephones'}];}break;case _0x0a9b('0x57'):_0x47942a['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x47942a['childModel']=_0x0a9b('0x58');break;case _0x0a9b('0x59'):_0x47942a[_0x0a9b('0x12')]='FreshdeskAccount';break;case _0x0a9b('0x5a'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x5b');break;case _0x0a9b('0x5c'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x5d');break;case'zohoaccounts':_0x47942a['childModel']='ZohoAccount';break;case _0x0a9b('0x5e'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x55');break;case'cannedanswers':_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x5f');break;case _0x0a9b('0x60'):_0x47942a[_0x0a9b('0x12')]='Disposition';break;case'customdashboards':_0x47942a['childModel']=_0x0a9b('0x61');break;case _0x0a9b('0x62'):_0x47942a[_0x0a9b('0x12')]='Interval';break;case _0x0a9b('0x63'):_0x47942a['childModel']=_0x0a9b('0x64');break;case _0x0a9b('0x65'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x66');break;case _0x0a9b('0x67'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x68');break;case _0x0a9b('0x69'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x6a');break;case _0x0a9b('0x6b'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x6c');break;case _0x0a9b('0x6d'):_0x47942a['childModel']=_0x0a9b('0x6e');break;case _0x0a9b('0x6f'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x70');break;case _0x0a9b('0x71'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x72');break;case'plugins':_0x47942a['childModel']=_0x0a9b('0x73');break;case'extractedreports':_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0xf');_0x47942a['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x0a9b('0x74')}];break;case _0x0a9b('0x75'):_0x47942a[_0x0a9b('0x12')]=_0x0a9b('0x76');break;}return _0x47942a;}function _0x31e22e(_0x354178,_0xce084d){var _0x1347d6=_0x354178[_0x0a9b('0x77')](0x0)[_0x0a9b('0x78')]()+_0x354178['slice'](0x1);var _0x3e5db0={'type':_0x5537ef[_0x0a9b('0x79')]['QueryTypes'][_0x0a9b('0x7a')],'raw':!![]};return new Promise(function(_0x2624cf,_0x34f916){var _0x290113=squel[_0x0a9b('0x7b')]()['field']('ui.'+_0x1347d6+_0x0a9b('0x7c'),'id')['field'](_0x0a9b('0x7d'))[_0x0a9b('0x7e')](_0x0a9b('0x7f')+_0x354178+_0x0a9b('0x80'),'ui')[_0x0a9b('0x81')]('ui.UserId\x20=\x20?',_0xce084d['id']);return _0x5537ef[_0x0a9b('0x82')]['query'](_0x290113[_0x0a9b('0x83')](),_0x3e5db0)[_0x0a9b('0x6')](function(_0x5bb532){_0xce084d[_0x1347d6+_0x0a9b('0x84')]=_0x5bb532;_0x2624cf(_0x5bb532);})[_0x0a9b('0x8')](function(_0x331567){_0x34f916(_0x331567);});});}return _0x1a8ca2['define'](_0x0a9b('0x85'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3ca2bd){var _0x45396a=require(_0x0a9b('0x86'));var _0x328523={'raw':_0x3ca2bd[_0x0a9b('0x87')]['raw'],'where':{}};var _0x1e7efa={};var _0x3414b3={'count':0x0,'rows':[]};var _0x206334=_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0x88')];var _0x51c124=_0x3ca2bd[_0x0a9b('0x87')]['mergeResources']||![];var _0x50c24b=_0x54e808(_0x206334,_0x51c124);if(!_0x50c24b[_0x0a9b('0x12')])throw new Error(_0x0a9b('0x89')+_0x206334+'\x27');var _0x1506d6=[{'name':_0x206334}];if(!_['isEmpty'](_0x50c24b[_0x0a9b('0x16')]))_0x1506d6=_0x50c24b[_0x0a9b('0x16')];var _0x28b41f=[];for(var _0x13dfac=0x0;_0x13dfac<_0x1506d6['length'];_0x13dfac++){_0x28b41f[_0x0a9b('0x8a')](_0x5537ef[_0x0a9b('0x8b')][_0x0a9b('0x8c')]({'where':{'userProfileId':_0x3ca2bd[_0x0a9b('0x8d')]['id'],'name':_0x1506d6[_0x13dfac][_0x0a9b('0xc')]},'raw':!![]}));}return Promise[_0x0a9b('0x8e')](_0x28b41f)[_0x0a9b('0x6')](function(_0x243ec4){var _0x5a460d=_[_0x0a9b('0x3')](_0x243ec4,function(_0x1693c7){return _0x1693c7?_0x1693c7:undefined;});var _0x4abbdc=_[_0x0a9b('0x3')](_0x1506d6,[_0x0a9b('0x8f'),!![]]);var _0x354513=_[_0x0a9b('0x90')](_0x5a460d)&&_['isEmpty'](_0x4abbdc)?null:_[_0x0a9b('0x91')](_0x4abbdc,_0x5a460d);if(!_0x354513)return null;var _0x56e3cd=[];for(var _0x186ee7=0x0;_0x186ee7<_0x354513[_0x0a9b('0x92')];_0x186ee7++){var _0x55d5aa=_[_0x0a9b('0x8c')](_0x1506d6,function(_0x34a2ce){return _0x354513[_0x186ee7]?_0x34a2ce[_0x0a9b('0xc')]===_0x354513[_0x186ee7][_0x0a9b('0xc')]:null;});if(_0x55d5aa){if(_0x354513[_0x186ee7][_0x0a9b('0x8f')]){_0x56e3cd[_0x0a9b('0x8a')](_0x1ce674(_0x50c24b[_0x0a9b('0x12')],_0x354513[_0x186ee7]));}else{if(!_0x354513[_0x186ee7]['autoAssociation']){_0x56e3cd[_0x0a9b('0x8a')](_0x4b4e8c(_0x55d5aa,_0x354513[_0x186ee7],_0x50c24b[_0x0a9b('0x12')]));}else{if(_0x55d5aa[_0x0a9b('0xa')]){_0x56e3cd[_0x0a9b('0x8a')](_0x2da9cc(_0x55d5aa,_0x354513[_0x186ee7]));}}}}}return Promise['all'](_0x56e3cd);})['then'](function(_0x5ae0f8){var _0x4c1d03=_0x5ae0f8;var _0x53170b=null;if(_0x4c1d03){_0x53170b=_0x4c1d03[_0x0a9b('0x92')]===0x1?_0x4c1d03[0x0]:null;}if(!_0x53170b&&!_0x4c1d03)return _0x3414b3;var _0x5a3933=_0x5537ef[_0x50c24b[_0x0a9b('0x12')]][_0x0a9b('0x93')];_0x1e7efa[_0x0a9b('0xa')]=_[_0x0a9b('0x94')](_0x5a3933);_0x1e7efa['query']=_[_0x0a9b('0x94')](_0x3ca2bd[_0x0a9b('0x87')]);_0x1e7efa[_0x0a9b('0x95')]=_[_0x0a9b('0x96')](_0x1e7efa[_0x0a9b('0xa')],_0x1e7efa[_0x0a9b('0x87')]);_0x328523[_0x0a9b('0x97')]=_['intersection'](_0x1e7efa[_0x0a9b('0xa')],_0x45396a['fields'](_0x3ca2bd[_0x0a9b('0x87')]['fields']));_0x328523[_0x0a9b('0x97')]=_0x328523[_0x0a9b('0x97')]['length']?_0x328523['attributes']:_0x1e7efa['model'];if(!_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0x98')](_0x0a9b('0x99'))){_0x328523[_0x0a9b('0x9a')]=_0x45396a[_0x0a9b('0x9a')](_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0x9a')]);_0x328523['offset']=_0x45396a[_0x0a9b('0x9b')](_0x3ca2bd['query']['offset']);}_0x328523['order']=_0x45396a[_0x0a9b('0x9c')](_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0x9c')]);_0x328523[_0x0a9b('0x81')]=_0x45396a[_0x0a9b('0x95')](_[_0x0a9b('0x9d')](_0x3ca2bd[_0x0a9b('0x87')],_0x1e7efa[_0x0a9b('0x95')]));if(_0x3ca2bd['query'][_0x0a9b('0x3')]){_0x328523[_0x0a9b('0x81')]=_[_0x0a9b('0x9e')](_0x328523[_0x0a9b('0x81')],{'$or':_['map'](_0x5a3933,function(_0x5db334){if(_0x5db334[_0x0a9b('0x9f')][_0x0a9b('0xa0')]!=='VIRTUAL'){var _0x5a1410={};_0x5a1410[_0x5db334[_0x0a9b('0x4')]]={'$like':'%'+_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0x3')]+'%'};return _0x5a1410;}})});}var _0xd4a2a1=[];var _0x495c62=null;var _0x29003f={};if(_0x53170b){_0x495c62=_[_0x0a9b('0x8c')](_0x1506d6,[_0x0a9b('0xc'),_0x53170b[_0x0a9b('0xc')]]);if(_0x495c62[_0x0a9b('0x4')]){_0x29003f={};if(_0x50c24b['childModel']===_0x0a9b('0xf')){_0x29003f[_0x495c62['foreignKey']]=_[_0x0a9b('0x7')](_0x53170b[_0x0a9b('0xb')],'id');}else{_0x29003f[_0x495c62[_0x0a9b('0xa1')]]=_0x53170b['associatedResources'];}_0xd4a2a1['push'](_0x29003f);}else{_0x328523['where']['id']=_0x53170b[_0x0a9b('0xb')];}}else{for(var _0x5d506b=0x0;_0x5d506b<_0x4c1d03[_0x0a9b('0x92')];_0x5d506b++){_0x495c62=_[_0x0a9b('0x8c')](_0x1506d6,[_0x0a9b('0xc'),_0x4c1d03[_0x5d506b][_0x0a9b('0xc')]]);if(_0x495c62['field']){_0x29003f={};_0x29003f[_0x495c62['foreignKey']]=_0x4c1d03[_0x5d506b][_0x0a9b('0xb')];_0xd4a2a1[_0x0a9b('0x8a')](_0x29003f);}else{if(!_0x328523[_0x0a9b('0x81')]['id'])_0x328523[_0x0a9b('0x81')]['id']=[];_0x4c1d03[_0x5d506b][_0x0a9b('0xb')][_0x0a9b('0xa2')](function(_0x23314b){_0x328523[_0x0a9b('0x81')]['id'][_0x0a9b('0x8a')](_0x23314b);});}}}if(!_[_0x0a9b('0x90')](_0xd4a2a1)){_0x328523['where']=_[_0x0a9b('0x9e')](_0x328523[_0x0a9b('0x81')],{'$and':{'$or':_0xd4a2a1}});}_0x328523=_[_0x0a9b('0x9e')]({},_0x328523,_0x3ca2bd['options']);if(_0x53170b&&!_0x53170b[_0x0a9b('0xa3')]&&_0x50c24b[_0x0a9b('0x12')]==='AnalyticExtractedReport'){if(_0x3ca2bd['query'][_0x0a9b('0xa4')]){_0x328523[_0x0a9b('0xa5')]=[{'all':!![]}];}return _0x5537ef[_0x50c24b['childModel']]['findAll'](_0x328523)['then'](function(_0x56b01e){var _0x1b5d1d=[];_0x56b01e[_0x0a9b('0xa2')](function(_0x4152ba){var _0x2b8514;switch(_0x4152ba[_0x0a9b('0xa6')]){case _0x0a9b('0xa7'):_0x2b8514=_[_0x0a9b('0x8c')](_0x53170b[_0x0a9b('0xb')],function(_0x1d06de){return _0x1d06de['id']===_0x4152ba[_0x0a9b('0x74')]&&_0x1d06de[_0x0a9b('0x9f')]===_0x0a9b('0xa8');});break;case _0x0a9b('0xa9'):_0x2b8514=_[_0x0a9b('0x8c')](_0x53170b[_0x0a9b('0xb')],function(_0x4d41a0){return _0x4d41a0['id']===_0x4152ba['reportId']&&_0x4d41a0['type']===_0x0a9b('0xaa');});break;}if(_0x2b8514)_0x1b5d1d[_0x0a9b('0x8a')](_0x4152ba);});_0x3414b3[_0x0a9b('0xab')]=_0x1b5d1d[_0x0a9b('0x92')];_0x3414b3[_0x0a9b('0xac')]=_0x1b5d1d;return _0x3414b3;});}else{if(!_['isEmpty'](_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xad')])){_0x328523['where']['id']=_0x328523[_0x0a9b('0x81')]['id']?_[_0x0a9b('0x96')](_0x328523[_0x0a9b('0x81')]['id'],_0x3ca2bd[_0x0a9b('0x87')]['ids']):_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xad')];if(_0x3ca2bd['query']['customSorting']){_0x328523[_0x0a9b('0xae')]=_0x3ca2bd['query'][_0x0a9b('0xaf')];}}if(_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xb0')]){_0x328523[_0x0a9b('0x81')]=_[_0x0a9b('0x9e')](_0x328523[_0x0a9b('0x81')],{'$and':_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xb0')]});}return _0x5537ef[_0x50c24b['childModel']][_0x0a9b('0xab')]({'where':_0x328523[_0x0a9b('0x81')]})[_0x0a9b('0x6')](function(_0x387ef6){_0x3414b3[_0x0a9b('0xab')]=_0x387ef6;if(_0x3ca2bd[_0x0a9b('0x87')]['includeAll']){if(_0x50c24b[_0x0a9b('0x12')]===_0x0a9b('0xb1')){_0x328523[_0x0a9b('0xa5')]=[{'model':_0x5537ef[_0x0a9b('0x6a')],'as':'Tags','attributes':['id',_0x0a9b('0xc'),_0x0a9b('0xb2')],'required':_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xb3')]?!![]:![]},{'model':_0x5537ef[_0x0a9b('0x6a')],'as':_0x0a9b('0xb4'),'attributes':['id',_0x0a9b('0xc'),_0x0a9b('0xb2')],'through':_0x3ca2bd[_0x0a9b('0x87')][_0x0a9b('0xb3')]?{'attributes':[],'where':{'TagId':_0x3ca2bd[_0x0a9b('0x87')]['tag']||undefined}}:{},'required':_0x3ca2bd['query'][_0x0a9b('0xb3')]?!![]:![]}];}else{_0x328523[_0x0a9b('0xa5')]=[{'all':!![]}];}}return _0x5537ef[_0x50c24b[_0x0a9b('0x12')]]['findAll'](_0x328523);})[_0x0a9b('0x6')](function(_0xa7fe96){_0x3414b3[_0x0a9b('0xac')]=_0xa7fe96;if(_0x206334===_0x0a9b('0x33')&&_0x3ca2bd[_0x0a9b('0x87')]['openTabs']===_0x0a9b('0xb5')){var _0x1b6595=[];for(var _0x1dc65d=0x0;_0x1dc65d<_0x3414b3['rows'][_0x0a9b('0x92')];_0x1dc65d++){_0x1b6595[_0x0a9b('0x8a')](_0x31e22e(_0x0a9b('0xb6'),_0x3414b3[_0x0a9b('0xac')][_0x1dc65d]['dataValues']));_0x1b6595[_0x0a9b('0x8a')](_0x31e22e(_0x0a9b('0xb7'),_0x3414b3[_0x0a9b('0xac')][_0x1dc65d][_0x0a9b('0xb8')]));_0x1b6595[_0x0a9b('0x8a')](_0x31e22e(_0x0a9b('0xb9'),_0x3414b3['rows'][_0x1dc65d][_0x0a9b('0xb8')]));_0x1b6595['push'](_0x31e22e(_0x0a9b('0xba'),_0x3414b3[_0x0a9b('0xac')][_0x1dc65d][_0x0a9b('0xb8')]));_0x1b6595[_0x0a9b('0x8a')](_0x31e22e(_0x0a9b('0xbb'),_0x3414b3[_0x0a9b('0xac')][_0x1dc65d]['dataValues']));_0x1b6595[_0x0a9b('0x8a')](_0x31e22e(_0x0a9b('0xbc'),_0x3414b3[_0x0a9b('0xac')][_0x1dc65d][_0x0a9b('0xb8')]));}return Promise['all'](_0x1b6595)[_0x0a9b('0x6')](function(){return _0x3414b3;});}return _0x3414b3;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 41ab160..9d0aa7b 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 _0xb7ac=['redis','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x11dfc4,_0x14f848){var _0x3064d5=function(_0x59742a){while(--_0x59742a){_0x11dfc4['push'](_0x11dfc4['shift']());}};_0x3064d5(++_0x14f848);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x5b8649,_0x1174f3){_0x5b8649=_0x5b8649-0x0;var _0x1a02b2=_0xb7ac[_0x5b8649];return _0x1a02b2;};'use strict';var _=require(_0xcb7a('0x0'));var util=require(_0xcb7a('0x1'));var moment=require(_0xcb7a('0x2'));var BPromise=require(_0xcb7a('0x3'));var rs=require(_0xcb7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb7a('0x6'))(_0xcb7a('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb7a('0x8'));var client=jayson[_0xcb7a('0x9')][_0xcb7a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcb7a('0xb')],{'host':_0xcb7a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb7a('0xb')]));require(_0xcb7a('0xd'))[_0xcb7a('0xe')](socket);function respondWithRpcPromise(_0x168efd,_0x392713,_0xe1e01){return new BPromise(function(_0x4a470d,_0x39742a){return client[_0xcb7a('0xf')](_0x168efd,_0xe1e01)[_0xcb7a('0x10')](function(_0x5d84a9){logger[_0xcb7a('0x11')](_0xcb7a('0x12'),_0x392713,'request\x20sent');logger[_0xcb7a('0x13')](_0xcb7a('0x14'),_0x392713,_0xcb7a('0x15'),JSON[_0xcb7a('0x16')](_0x5d84a9));if(_0x5d84a9[_0xcb7a('0x17')]){if(_0x5d84a9[_0xcb7a('0x17')][_0xcb7a('0x18')]===0x1f4){logger[_0xcb7a('0x17')](_0xcb7a('0x12'),_0x392713,_0x5d84a9['error'][_0xcb7a('0x19')]);return _0x39742a(_0x5d84a9['error'][_0xcb7a('0x19')]);}logger[_0xcb7a('0x17')](_0xcb7a('0x12'),_0x392713,_0x5d84a9[_0xcb7a('0x17')]['message']);return _0x4a470d(_0x5d84a9[_0xcb7a('0x17')][_0xcb7a('0x19')]);}else{logger[_0xcb7a('0x11')](_0xcb7a('0x12'),_0x392713,_0xcb7a('0x15'));_0x4a470d(_0x5d84a9[_0xcb7a('0x1a')][_0xcb7a('0x19')]);}})['catch'](function(_0x27454e){logger[_0xcb7a('0x17')](_0xcb7a('0x12'),_0x392713,_0x27454e);_0x39742a(_0x27454e);});});} \ No newline at end of file +var _0x4253=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4253,0x14c));var _0x3425=function(_0x537fda,_0x1dd82d){_0x537fda=_0x537fda-0x0;var _0x27d1e9=_0x4253[_0x537fda];return _0x27d1e9;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var moment=require('moment');var BPromise=require(_0x3425('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3425('0x3'));var db=require(_0x3425('0x4'))['db'];var utils=require(_0x3425('0x5'));var logger=require(_0x3425('0x6'))(_0x3425('0x7'));var config=require(_0x3425('0x8'));var jayson=require(_0x3425('0x9'));var client=jayson[_0x3425('0xa')][_0x3425('0xb')]({'port':0x232a});config['redis']=_[_0x3425('0xc')](config[_0x3425('0xd')],{'host':_0x3425('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3425('0xd')]));require(_0x3425('0xf'))['register'](socket);function respondWithRpcPromise(_0x21c54d,_0x562e27,_0x5bcbf0){return new BPromise(function(_0x528436,_0x196d62){return client[_0x3425('0x10')](_0x21c54d,_0x5bcbf0)[_0x3425('0x11')](function(_0x5788e7){logger[_0x3425('0x12')](_0x3425('0x13'),_0x562e27,_0x3425('0x14'));logger['debug'](_0x3425('0x15'),_0x562e27,_0x3425('0x14'),JSON[_0x3425('0x16')](_0x5788e7));if(_0x5788e7[_0x3425('0x17')]){if(_0x5788e7[_0x3425('0x17')][_0x3425('0x18')]===0x1f4){logger[_0x3425('0x17')]('UserProfile,\x20%s,\x20%s',_0x562e27,_0x5788e7[_0x3425('0x17')]['message']);return _0x196d62(_0x5788e7[_0x3425('0x17')][_0x3425('0x19')]);}logger['error'](_0x3425('0x13'),_0x562e27,_0x5788e7[_0x3425('0x17')]['message']);return _0x528436(_0x5788e7[_0x3425('0x17')]['message']);}else{logger[_0x3425('0x12')](_0x3425('0x13'),_0x562e27,_0x3425('0x14'));_0x528436(_0x5788e7[_0x3425('0x1a')]['message']);}})[_0x3425('0x1b')](function(_0x5a5876){logger[_0x3425('0x17')](_0x3425('0x13'),_0x562e27,_0x5a5876);_0x196d62(_0x5a5876);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ca128e8..db570bf 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 _0x472e=['register','save','emit','removeListener'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x472e,0x175));var _0xe472=function(_0x4d1d2c,_0x44f4d8){_0x4d1d2c=_0x4d1d2c-0x0;var _0x2c4cb9=_0x472e[_0x4d1d2c];return _0x2c4cb9;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xe472('0x0'),'remove','update'];function createListener(_0x4090f7,_0xadc8c2){return function(_0x2b3b66){_0xadc8c2[_0xe472('0x1')](_0x4090f7,_0x2b3b66);};}function removeListener(_0x2f649a,_0x31a10c){return function(){UserProfileEvents[_0xe472('0x2')](_0x2f649a,_0x31a10c);};}exports[_0xe472('0x3')]=function(_0x4de619){for(var _0x382beb=0x0,_0x34e23e=events['length'];_0x382beb<_0x34e23e;_0x382beb++){var _0x23fe68=events[_0x382beb];var _0x16a58a=createListener('userProfile:'+_0x23fe68,_0x4de619);UserProfileEvents['on'](_0x23fe68,_0x16a58a);}}; \ No newline at end of file +var _0x0021=['./userProfile.events','save','remove','emit'];(function(_0x4ee2b9,_0x1c7cc0){var _0x1e9d13=function(_0xbf4d5c){while(--_0xbf4d5c){_0x4ee2b9['push'](_0x4ee2b9['shift']());}};_0x1e9d13(++_0x1c7cc0);}(_0x0021,0x1d4));var _0x1002=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x0021[_0x4a29a9];return _0x386570;};'use strict';var UserProfileEvents=require(_0x1002('0x0'));var events=[_0x1002('0x1'),_0x1002('0x2'),'update'];function createListener(_0x1a95c0,_0x356f52){return function(_0x221a44){_0x356f52[_0x1002('0x3')](_0x1a95c0,_0x221a44);};}function removeListener(_0x211cb9,_0x21e793){return function(){UserProfileEvents['removeListener'](_0x211cb9,_0x21e793);};}exports['register']=function(_0x35b34f){for(var _0x1da191=0x0,_0x152e40=events['length'];_0x1da191<_0x152e40;_0x1da191++){var _0x4639ba=events[_0x1da191];var _0x40f615=createListener('userProfile:'+_0x4639ba,_0x35b34f);UserProfileEvents['on'](_0x4639ba,_0x40f615);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 230726f..4fd9dbe 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 _0x6bee=['update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x6bee,0x180));var _0xe6be=function(_0x10d301,_0x101ae3){_0x10d301=_0x10d301-0x0;var _0x364a3d=_0x6bee[_0x10d301];return _0x364a3d;};'use strict';var multer=require(_0xe6be('0x0'));var util=require(_0xe6be('0x1'));var path=require('path');var timeout=require(_0xe6be('0x2'));var express=require(_0xe6be('0x3'));var router=express['Router']();var fs_extra=require(_0xe6be('0x4'));var auth=require(_0xe6be('0x5'));var interaction=require(_0xe6be('0x6'));var config=require(_0xe6be('0x7'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xe6be('0x8')](),controller[_0xe6be('0x9')]);router[_0xe6be('0xa')]('/describe',auth[_0xe6be('0x8')](),controller['describe']);router[_0xe6be('0xa')](_0xe6be('0xb'),auth[_0xe6be('0x8')](),controller[_0xe6be('0xc')]);router[_0xe6be('0xd')]('/',auth[_0xe6be('0x8')](),controller[_0xe6be('0xe')]);router['put'](_0xe6be('0xb'),auth[_0xe6be('0x8')](),controller[_0xe6be('0xf')]);router[_0xe6be('0x10')]('/:id',auth[_0xe6be('0x8')](),controller[_0xe6be('0x11')]);module[_0xe6be('0x12')]=router; \ No newline at end of file +var _0xf389=['/describe','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get'];(function(_0x45948d,_0x5b21e0){var _0x531cb1=function(_0x3bca58){while(--_0x3bca58){_0x45948d['push'](_0x45948d['shift']());}};_0x531cb1(++_0x5b21e0);}(_0xf389,0x11d));var _0x9f38=function(_0xce7312,_0x4e77e9){_0xce7312=_0xce7312-0x0;var _0x4fb4ac=_0xf389[_0xce7312];return _0x4fb4ac;};'use strict';var multer=require(_0x9f38('0x0'));var util=require(_0x9f38('0x1'));var path=require(_0x9f38('0x2'));var timeout=require(_0x9f38('0x3'));var express=require(_0x9f38('0x4'));var router=express[_0x9f38('0x5')]();var fs_extra=require(_0x9f38('0x6'));var auth=require(_0x9f38('0x7'));var interaction=require(_0x9f38('0x8'));var config=require(_0x9f38('0x9'));var controller=require(_0x9f38('0xa'));router['get']('/',auth[_0x9f38('0xb')](),controller[_0x9f38('0xc')]);router[_0x9f38('0xd')](_0x9f38('0xe'),auth['isAuthenticated'](),controller[_0x9f38('0xf')]);router['get'](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x11')]);router[_0x9f38('0x12')]('/',auth[_0x9f38('0xb')](),controller[_0x9f38('0x13')]);router['put'](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x14')]);router[_0x9f38('0x15')](_0x9f38('0x10'),auth[_0x9f38('0xb')](),controller[_0x9f38('0x16')]);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 c04e186..2b7213e 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 _0x064a=['sequelize','STRING','INTEGER'];(function(_0x445b39,_0x2e0005){var _0x21cc2a=function(_0x2e0fff){while(--_0x2e0fff){_0x445b39['push'](_0x445b39['shift']());}};_0x21cc2a(++_0x2e0005);}(_0x064a,0xd2));var _0xa064=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x064a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa064('0x0'));module['exports']={'name':{'type':Sequelize[_0xa064('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa064('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa064('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5717=['INTEGER','exports','STRING'];(function(_0x3321d7,_0x5f5681){var _0x44f518=function(_0x469820){while(--_0x469820){_0x3321d7['push'](_0x3321d7['shift']());}};_0x44f518(++_0x5f5681);}(_0x5717,0x112));var _0x7571=function(_0x32392f,_0x426580){_0x32392f=_0x32392f-0x0;var _0x6eb431=_0x5717[_0x32392f];return _0x6eb431;};'use strict';var Sequelize=require('sequelize');module[_0x7571('0x0')]={'name':{'type':Sequelize[_0x7571('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7571('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7571('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4032671..a1d1ec5 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 _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1bf611,_0x5a169b){var _0x46c450=function(_0x3528e0){while(--_0x3528e0){_0x1bf611['push'](_0x1bf611['shift']());}};_0x46c450(++_0x5a169b);}(_0x2542,0x169));var _0x2254=function(_0x1cf6d9,_0x53a22e){_0x1cf6d9=_0x1cf6d9-0x0;var _0x161909=_0x2542[_0x1cf6d9];return _0x161909;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['UserProfileResource'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x687b,0x14a));var _0xb687=function(_0x16d2c7,_0x5bf3c0){_0x16d2c7=_0x16d2c7-0x0;var _0x1c9a0a=_0x687b[_0x16d2c7];return _0x1c9a0a;};'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'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2401f83..1548abf 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 _0x1c54=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x5cd988,_0x1a180f){var _0x59f992=function(_0x2e12e0){while(--_0x2e12e0){_0x5cd988['push'](_0x5cd988['shift']());}};_0x59f992(++_0x1a180f);}(_0x1c54,0x1b2));var _0x41c5=function(_0x363319,_0x4fa1a1){_0x363319=_0x363319-0x0;var _0x182a62=_0x1c54[_0x363319];return _0x182a62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41c5('0x0'))(_0x41c5('0x1'));var moment=require(_0x41c5('0x2'));var BPromise=require('bluebird');var rp=require(_0x41c5('0x3'));var fs=require('fs');var path=require(_0x41c5('0x4'));var rimraf=require(_0x41c5('0x5'));var config=require(_0x41c5('0x6'));var attributes=require(_0x41c5('0x7'));module[_0x41c5('0x8')]=function(_0x18a87a,_0x5618da){return _0x18a87a[_0x41c5('0x9')]('UserProfileResource',attributes,{'tableName':_0x41c5('0xa'),'paranoid':![],'indexes':[{'name':_0x41c5('0xb'),'fields':[_0x41c5('0xc'),_0x41c5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e56=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x7e56,0x1db));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67e5('0x0'));var util=require('util');var logger=require(_0x67e5('0x1'))(_0x67e5('0x2'));var moment=require(_0x67e5('0x3'));var BPromise=require(_0x67e5('0x4'));var rp=require(_0x67e5('0x5'));var fs=require('fs');var path=require(_0x67e5('0x6'));var rimraf=require('rimraf');var config=require(_0x67e5('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x67e5('0x8')]=function(_0x5bf20b,_0x13dc93){return _0x5bf20b[_0x67e5('0x9')]('UserProfileResource',attributes,{'tableName':_0x67e5('0xa'),'paranoid':![],'indexes':[{'name':_0x67e5('0xb'),'fields':[_0x67e5('0xc'),_0x67e5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index f829583..17ca068 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 _0x5f2a=['rpc','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x39251c,_0x543903){var _0x22c9c2=function(_0x46fae1){while(--_0x46fae1){_0x39251c['push'](_0x39251c['shift']());}};_0x22c9c2(++_0x543903);}(_0x5f2a,0x19d));var _0xa5f2=function(_0x499b1c,_0x4c6536){_0x499b1c=_0x499b1c-0x0;var _0x236801=_0x5f2a[_0x499b1c];return _0x236801;};'use strict';var _=require(_0xa5f2('0x0'));var util=require(_0xa5f2('0x1'));var moment=require(_0xa5f2('0x2'));var BPromise=require(_0xa5f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5f2('0x5'));var logger=require(_0xa5f2('0x6'))(_0xa5f2('0x7'));var config=require('../../config/environment');var jayson=require(_0xa5f2('0x8'));var client=jayson[_0xa5f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33cc53,_0x2a2951,_0x14ef37){return new BPromise(function(_0xa11ea4,_0xe43c28){return client[_0xa5f2('0xa')](_0x33cc53,_0x14ef37)[_0xa5f2('0xb')](function(_0x227133){logger[_0xa5f2('0xc')](_0xa5f2('0xd'),_0x2a2951,'request\x20sent');logger[_0xa5f2('0xe')](_0xa5f2('0xf'),_0x2a2951,'request\x20sent',JSON[_0xa5f2('0x10')](_0x227133));if(_0x227133[_0xa5f2('0x11')]){if(_0x227133[_0xa5f2('0x11')]['code']===0x1f4){logger[_0xa5f2('0x11')](_0xa5f2('0xd'),_0x2a2951,_0x227133[_0xa5f2('0x11')][_0xa5f2('0x12')]);return _0xe43c28(_0x227133[_0xa5f2('0x11')][_0xa5f2('0x12')]);}logger[_0xa5f2('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2a2951,_0x227133[_0xa5f2('0x11')][_0xa5f2('0x12')]);return _0xa11ea4(_0x227133[_0xa5f2('0x11')][_0xa5f2('0x12')]);}else{logger[_0xa5f2('0xc')](_0xa5f2('0xd'),_0x2a2951,_0xa5f2('0x13'));_0xa11ea4(_0x227133[_0xa5f2('0x14')][_0xa5f2('0x12')]);}})['catch'](function(_0x3d9af3){logger[_0xa5f2('0x11')](_0xa5f2('0xd'),_0x2a2951,_0x3d9af3);_0xe43c28(_0x3d9af3);});});} \ No newline at end of file +var _0x7ccf=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7ccf,0xbc));var _0xf7cc=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x7ccf[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0xf7cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf7cc('0x1'));var rs=require(_0xf7cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7cc('0x3'))['db'];var utils=require(_0xf7cc('0x4'));var logger=require(_0xf7cc('0x5'))(_0xf7cc('0x6'));var config=require(_0xf7cc('0x7'));var jayson=require(_0xf7cc('0x8'));var client=jayson[_0xf7cc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59ff0d,_0xa9e3cf,_0x4ffdb2){return new BPromise(function(_0x451475,_0x3a7aa4){return client['request'](_0x59ff0d,_0x4ffdb2)['then'](function(_0x58bbf7){logger[_0xf7cc('0xa')](_0xf7cc('0xb'),_0xa9e3cf,_0xf7cc('0xc'));logger[_0xf7cc('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xa9e3cf,_0xf7cc('0xc'),JSON[_0xf7cc('0xe')](_0x58bbf7));if(_0x58bbf7[_0xf7cc('0xf')]){if(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x10')]===0x1f4){logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x58bbf7[_0xf7cc('0xf')]['message']);return _0x3a7aa4(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);}logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);return _0x451475(_0x58bbf7[_0xf7cc('0xf')][_0xf7cc('0x11')]);}else{logger[_0xf7cc('0xa')](_0xf7cc('0xb'),_0xa9e3cf,_0xf7cc('0xc'));_0x451475(_0x58bbf7['result'][_0xf7cc('0x11')]);}})['catch'](function(_0x5b98f6){logger[_0xf7cc('0xf')](_0xf7cc('0xb'),_0xa9e3cf,_0x5b98f6);_0x3a7aa4(_0x5b98f6);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d7af509..6c983dc 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 _0x3a06=['show','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','/:id'];(function(_0x3cf049,_0x411d0b){var _0x533bf8=function(_0x23b09e){while(--_0x23b09e){_0x3cf049['push'](_0x3cf049['shift']());}};_0x533bf8(++_0x411d0b);}(_0x3a06,0x182));var _0x63a0=function(_0x27caff,_0x3d8a9c){_0x27caff=_0x27caff-0x0;var _0x29a280=_0x3a06[_0x27caff];return _0x29a280;};'use strict';var multer=require('multer');var util=require(_0x63a0('0x0'));var path=require(_0x63a0('0x1'));var timeout=require(_0x63a0('0x2'));var express=require(_0x63a0('0x3'));var router=express[_0x63a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x63a0('0x5'));var interaction=require(_0x63a0('0x6'));var config=require(_0x63a0('0x7'));var controller=require(_0x63a0('0x8'));router[_0x63a0('0x9')]('/',auth['isAuthenticated'](),controller[_0x63a0('0xa')]);router[_0x63a0('0x9')]('/describe',auth[_0x63a0('0xb')](),controller['describe']);router[_0x63a0('0x9')](_0x63a0('0xc'),auth[_0x63a0('0xb')](),controller[_0x63a0('0xd')]);router[_0x63a0('0xe')]('/',auth[_0x63a0('0xb')](),controller['create']);router[_0x63a0('0xf')](_0x63a0('0xc'),auth[_0x63a0('0xb')](),controller['update']);router[_0x63a0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x63a0('0x11')]);module[_0x63a0('0x12')]=router; \ No newline at end of file +var _0x4e2c=['post','put','update','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x4e2c,0xe4));var _0xc4e2=function(_0xa04024,_0x531c9f){_0xa04024=_0xa04024-0x0;var _0x5bf7fc=_0x4e2c[_0xa04024];return _0x5bf7fc;};'use strict';var multer=require('multer');var util=require(_0xc4e2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc4e2('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xc4e2('0x2'));var interaction=require(_0xc4e2('0x3'));var config=require(_0xc4e2('0x4'));var controller=require(_0xc4e2('0x5'));router[_0xc4e2('0x6')]('/',auth[_0xc4e2('0x7')](),controller[_0xc4e2('0x8')]);router[_0xc4e2('0x6')](_0xc4e2('0x9'),auth[_0xc4e2('0x7')](),controller['describe']);router['get'](_0xc4e2('0xa'),auth['isAuthenticated'](),controller[_0xc4e2('0xb')]);router[_0xc4e2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc4e2('0xd')]('/:id',auth[_0xc4e2('0x7')](),controller[_0xc4e2('0xe')]);router['delete'](_0xc4e2('0xa'),auth[_0xc4e2('0x7')](),controller[_0xc4e2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9ca66d1..b6f5cd2 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 _0xe5b5=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0xaeed95,_0x422e6e){var _0x3e3959=function(_0x5d59b4){while(--_0x5d59b4){_0xaeed95['push'](_0xaeed95['shift']());}};_0x3e3959(++_0x422e6e);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xe5b5[_0x421725];return _0x51b322;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'name':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5e5b('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5e5b('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5e5b('0x2')],'set':function(_0xf20c6a){this[_0x5e5b('0x5')](_0x5e5b('0x6'),_0xf20c6a?_0xf20c6a[_0x5e5b('0x7')](''):[]);},'get':function(){return this[_0x5e5b('0x8')](_0x5e5b('0x6'))?this[_0x5e5b('0x8')](_0x5e5b('0x6'))[_0x5e5b('0x9')](''):[];}}}; \ No newline at end of file +var _0xed3c=['join','getDataValue','sequelize','exports','STRING','BOOLEAN','crudPermissions'];(function(_0x521e2f,_0x18d08a){var _0x1ecd5d=function(_0x20d140){while(--_0x20d140){_0x521e2f['push'](_0x521e2f['shift']());}};_0x1ecd5d(++_0x18d08a);}(_0xed3c,0x1a6));var _0xced3=function(_0x54d52c,_0x55b8d9){_0x54d52c=_0x54d52c-0x0;var _0x28f99e=_0xed3c[_0x54d52c];return _0x28f99e;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'name':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xced3('0x2')],'set':function(_0x5f03e0){this['setDataValue'](_0xced3('0x4'),_0x5f03e0?_0x5f03e0[_0xced3('0x5')](''):[]);},'get':function(){return this[_0xced3('0x6')](_0xced3('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 8d7688a..2f3c2f7 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 _0xf856=['merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','nolimit','limit','sort','where','filters','VIRTUAL'];(function(_0x24474c,_0x1704fd){var _0x78da18=function(_0x41c59e){while(--_0x41c59e){_0x24474c['push'](_0x24474c['shift']());}};_0x78da18(++_0x1704fd);}(_0xf856,0xef));var _0x6f85=function(_0x38d4e1,_0x304ee0){_0x38d4e1=_0x38d4e1-0x0;var _0x423606=_0xf856[_0x38d4e1];return _0x423606;};'use strict';var emlformat=require(_0x6f85('0x0'));var rimraf=require(_0x6f85('0x1'));var zipdir=require(_0x6f85('0x2'));var jsonpatch=require(_0x6f85('0x3'));var rp=require(_0x6f85('0x4'));var moment=require(_0x6f85('0x5'));var BPromise=require(_0x6f85('0x6'));var Mustache=require(_0x6f85('0x7'));var util=require(_0x6f85('0x8'));var path=require('path');var sox=require(_0x6f85('0x9'));var csv=require(_0x6f85('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f85('0xb'));var squel=require('squel');var crypto=require(_0x6f85('0xc'));var jsforce=require(_0x6f85('0xd'));var deskjs=require(_0x6f85('0xe'));var toCsv=require(_0x6f85('0xa'));var querystring=require('querystring');var Papa=require(_0x6f85('0xf'));var Redis=require(_0x6f85('0x10'));var authService=require(_0x6f85('0x11'));var qs=require(_0x6f85('0x12'));var as=require(_0x6f85('0x13'));var hardwareService=require(_0x6f85('0x14'));var logger=require(_0x6f85('0x15'))('api');var utils=require(_0x6f85('0x16'));var config=require(_0x6f85('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f85('0x18'))['db'];function respondWithStatusCode(_0x2487c4,_0x5bc75e){_0x5bc75e=_0x5bc75e||0xcc;return function(_0xa6bfa7){if(_0xa6bfa7){return _0x2487c4[_0x6f85('0x19')](_0x5bc75e);}return _0x2487c4['status'](_0x5bc75e)['end']();};}function respondWithResult(_0xd9647f,_0x29b938){_0x29b938=_0x29b938||0xc8;return function(_0x187d48){if(_0x187d48){return _0xd9647f['status'](_0x29b938)['json'](_0x187d48);}};}function respondWithFilteredResult(_0x2a53e8,_0x982980){return function(_0x3f2c2c){if(_0x3f2c2c){var _0x1d671c=typeof _0x982980['offset']===_0x6f85('0x1a')&&typeof _0x982980['limit']===_0x6f85('0x1a');var _0x63ddbc=_0x3f2c2c[_0x6f85('0x1b')];var _0x447918=_0x1d671c?0x0:_0x982980['offset'];var _0x316912=_0x1d671c?_0x3f2c2c[_0x6f85('0x1b')]:_0x982980[_0x6f85('0x1c')]+_0x982980['limit'];var _0x955e9e;if(_0x316912>=_0x63ddbc){_0x316912=_0x63ddbc;_0x955e9e=0xc8;}else{_0x955e9e=0xce;}_0x2a53e8[_0x6f85('0x1d')](_0x955e9e);return _0x2a53e8[_0x6f85('0x1e')](_0x6f85('0x1f'),_0x447918+'-'+_0x316912+'/'+_0x63ddbc)[_0x6f85('0x20')](_0x3f2c2c);}return null;};}function patchUpdates(_0x3aa893){return function(_0x168227){try{jsonpatch[_0x6f85('0x21')](_0x168227,_0x3aa893,!![]);}catch(_0x27aaf9){return BPromise['reject'](_0x27aaf9);}return _0x168227[_0x6f85('0x22')]();};}function saveUpdates(_0xe598f8,_0xd6707e){return function(_0x54f603){if(_0x54f603){return _0x54f603[_0x6f85('0x23')](_0xe598f8)[_0x6f85('0x24')](function(_0x573a47){return _0x573a47;});}return null;};}function removeEntity(_0x4043f6,_0x325cc2){return function(_0x28194f){if(_0x28194f){return _0x28194f[_0x6f85('0x25')]()[_0x6f85('0x24')](function(){_0x4043f6['status'](0xcc)[_0x6f85('0x26')]();});}};}function handleEntityNotFound(_0x51daa2,_0x539201){return function(_0x5e601c){if(!_0x5e601c){_0x51daa2[_0x6f85('0x19')](0x194);}return _0x5e601c;};}function handleError(_0x32fe1b,_0x4dc6c0){_0x4dc6c0=_0x4dc6c0||0x1f4;return function(_0x371bc7){logger[_0x6f85('0x27')](_0x371bc7[_0x6f85('0x28')]);if(_0x371bc7[_0x6f85('0x29')]){delete _0x371bc7[_0x6f85('0x29')];}_0x32fe1b[_0x6f85('0x1d')](_0x4dc6c0)[_0x6f85('0x2a')](_0x371bc7);};}exports[_0x6f85('0x2b')]=function(_0x4bb479,_0x190db7){var _0x28ed1d={},_0x25e24f={},_0x3738c1={'count':0x0,'rows':[]};var _0x51d03c=_[_0x6f85('0x2c')](db[_0x6f85('0x2d')][_0x6f85('0x2e')],function(_0x2af209){return{'name':_0x2af209[_0x6f85('0x2f')],'type':_0x2af209[_0x6f85('0x30')]['key']};});_0x25e24f[_0x6f85('0x31')]=_['map'](_0x51d03c,_0x6f85('0x29'));_0x25e24f[_0x6f85('0x32')]=_[_0x6f85('0x33')](_0x4bb479[_0x6f85('0x32')]);_0x25e24f['filters']=_[_0x6f85('0x34')](_0x25e24f[_0x6f85('0x31')],_0x25e24f[_0x6f85('0x32')]);_0x28ed1d[_0x6f85('0x35')]=_[_0x6f85('0x34')](_0x25e24f[_0x6f85('0x31')],qs['fields'](_0x4bb479[_0x6f85('0x32')]['fields']));_0x28ed1d['attributes']=_0x28ed1d['attributes'][_0x6f85('0x36')]?_0x28ed1d[_0x6f85('0x35')]:_0x25e24f[_0x6f85('0x31')];if(!_0x4bb479[_0x6f85('0x32')]['hasOwnProperty'](_0x6f85('0x37'))){_0x28ed1d[_0x6f85('0x38')]=qs['limit'](_0x4bb479[_0x6f85('0x32')][_0x6f85('0x38')]);_0x28ed1d[_0x6f85('0x1c')]=qs[_0x6f85('0x1c')](_0x4bb479[_0x6f85('0x32')][_0x6f85('0x1c')]);}_0x28ed1d['order']=qs[_0x6f85('0x39')](_0x4bb479['query']['sort']);_0x28ed1d[_0x6f85('0x3a')]=qs[_0x6f85('0x3b')](_['pick'](_0x4bb479[_0x6f85('0x32')],_0x25e24f['filters']),_0x51d03c);if(_0x4bb479[_0x6f85('0x32')]['filter']){_0x28ed1d[_0x6f85('0x3a')]=_['merge'](_0x28ed1d[_0x6f85('0x3a')],{'$or':_['map'](_0x51d03c,function(_0x4eb6ad){if(_0x4eb6ad[_0x6f85('0x30')]!==_0x6f85('0x3c')){var _0xae8f25={};_0xae8f25[_0x4eb6ad[_0x6f85('0x29')]]={'$like':'%'+_0x4bb479[_0x6f85('0x32')]['filter']+'%'};return _0xae8f25;}})});}_0x28ed1d=_[_0x6f85('0x3d')]({},_0x28ed1d,_0x4bb479[_0x6f85('0x3e')]);var _0x4c8055={'where':_0x28ed1d['where']};return db[_0x6f85('0x2d')][_0x6f85('0x1b')](_0x4c8055)[_0x6f85('0x24')](function(_0x275aa3){_0x3738c1['count']=_0x275aa3;if(_0x4bb479[_0x6f85('0x32')][_0x6f85('0x3f')]){_0x28ed1d['include']=[{'all':!![]}];}return db[_0x6f85('0x2d')][_0x6f85('0x40')](_0x28ed1d);})[_0x6f85('0x24')](function(_0x23957c){_0x3738c1[_0x6f85('0x41')]=_0x23957c;return _0x3738c1;})[_0x6f85('0x24')](respondWithFilteredResult(_0x190db7,_0x28ed1d))[_0x6f85('0x42')](handleError(_0x190db7,null));};exports[_0x6f85('0x43')]=function(_0x3afeef,_0x13d6e1){var _0x571e22={'raw':![],'where':{'id':_0x3afeef[_0x6f85('0x44')]['id']}},_0x5e9bb4={};_0x5e9bb4[_0x6f85('0x31')]=_['keys'](db['UserProfileSection']['rawAttributes']);_0x5e9bb4['query']=_['keys'](_0x3afeef[_0x6f85('0x32')]);_0x5e9bb4[_0x6f85('0x3b')]=_[_0x6f85('0x34')](_0x5e9bb4[_0x6f85('0x31')],_0x5e9bb4[_0x6f85('0x32')]);_0x571e22['attributes']=_[_0x6f85('0x34')](_0x5e9bb4['model'],qs['fields'](_0x3afeef[_0x6f85('0x32')][_0x6f85('0x45')]));_0x571e22[_0x6f85('0x35')]=_0x571e22[_0x6f85('0x35')][_0x6f85('0x36')]?_0x571e22['attributes']:_0x5e9bb4[_0x6f85('0x31')];if(_0x3afeef[_0x6f85('0x32')][_0x6f85('0x3f')]){_0x571e22[_0x6f85('0x46')]=[{'all':!![]}];}_0x571e22=_[_0x6f85('0x3d')]({},_0x571e22,_0x3afeef[_0x6f85('0x3e')]);return db['UserProfileSection'][_0x6f85('0x47')](_0x571e22)[_0x6f85('0x24')](handleEntityNotFound(_0x13d6e1,null))[_0x6f85('0x24')](respondWithResult(_0x13d6e1,null))[_0x6f85('0x42')](handleError(_0x13d6e1,null));};exports['create']=function(_0x10d279,_0x4fb122){return db[_0x6f85('0x2d')][_0x6f85('0x48')](_0x10d279[_0x6f85('0x49')],{})['then'](respondWithResult(_0x4fb122,0xc9))[_0x6f85('0x42')](handleError(_0x4fb122,null));};exports[_0x6f85('0x23')]=function(_0x448ee4,_0x1339e0){if(_0x448ee4[_0x6f85('0x49')]['id']){delete _0x448ee4['body']['id'];}return db[_0x6f85('0x2d')][_0x6f85('0x47')]({'where':{'id':_0x448ee4['params']['id']}})['then'](handleEntityNotFound(_0x1339e0,null))[_0x6f85('0x24')](saveUpdates(_0x448ee4['body'],null))[_0x6f85('0x24')](respondWithResult(_0x1339e0,null))[_0x6f85('0x42')](handleError(_0x1339e0,null));};exports[_0x6f85('0x25')]=function(_0x5226a9,_0x47b808){return db['UserProfileSection'][_0x6f85('0x47')]({'where':{'id':_0x5226a9[_0x6f85('0x44')]['id']}})[_0x6f85('0x24')](handleEntityNotFound(_0x47b808,null))[_0x6f85('0x24')](removeEntity(_0x47b808,null))['catch'](handleError(_0x47b808,null));};exports[_0x6f85('0x4a')]=function(_0x117508,_0x5aec6c){return db[_0x6f85('0x2d')][_0x6f85('0x4a')]()[_0x6f85('0x24')](respondWithResult(_0x5aec6c,null))[_0x6f85('0x42')](handleError(_0x5aec6c,null));}; \ No newline at end of file +var _0x1ebf=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','UserProfileSection'];(function(_0x67a134,_0x4d2473){var _0x2c4b7e=function(_0x3bf5fd){while(--_0x3bf5fd){_0x67a134['push'](_0x67a134['shift']());}};_0x2c4b7e(++_0x4d2473);}(_0x1ebf,0x15b));var _0xf1eb=function(_0x52fa5b,_0x264631){_0x52fa5b=_0x52fa5b-0x0;var _0x3bf60b=_0x1ebf[_0x52fa5b];return _0x3bf60b;};'use strict';var emlformat=require(_0xf1eb('0x0'));var rimraf=require(_0xf1eb('0x1'));var zipdir=require(_0xf1eb('0x2'));var jsonpatch=require(_0xf1eb('0x3'));var rp=require(_0xf1eb('0x4'));var moment=require(_0xf1eb('0x5'));var BPromise=require(_0xf1eb('0x6'));var Mustache=require(_0xf1eb('0x7'));var util=require(_0xf1eb('0x8'));var path=require(_0xf1eb('0x9'));var sox=require(_0xf1eb('0xa'));var csv=require('to-csv');var ejs=require(_0xf1eb('0xb'));var fs=require('fs');var fs_extra=require(_0xf1eb('0xc'));var _=require(_0xf1eb('0xd'));var squel=require('squel');var crypto=require(_0xf1eb('0xe'));var jsforce=require(_0xf1eb('0xf'));var deskjs=require(_0xf1eb('0x10'));var toCsv=require(_0xf1eb('0x11'));var querystring=require(_0xf1eb('0x12'));var Papa=require(_0xf1eb('0x13'));var Redis=require(_0xf1eb('0x14'));var authService=require(_0xf1eb('0x15'));var qs=require(_0xf1eb('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1eb('0x17'));var logger=require('../../config/logger')(_0xf1eb('0x18'));var utils=require(_0xf1eb('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf1eb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33627f,_0x2c501d){_0x2c501d=_0x2c501d||0xcc;return function(_0x1d4a8c){if(_0x1d4a8c){return _0x33627f[_0xf1eb('0x1b')](_0x2c501d);}return _0x33627f['status'](_0x2c501d)[_0xf1eb('0x1c')]();};}function respondWithResult(_0x116b2b,_0x941d69){_0x941d69=_0x941d69||0xc8;return function(_0x2c9200){if(_0x2c9200){return _0x116b2b[_0xf1eb('0x1d')](_0x941d69)[_0xf1eb('0x1e')](_0x2c9200);}};}function respondWithFilteredResult(_0x2f754e,_0x1fb959){return function(_0x521506){if(_0x521506){var _0x361ef6=typeof _0x1fb959[_0xf1eb('0x1f')]===_0xf1eb('0x20')&&typeof _0x1fb959[_0xf1eb('0x21')]===_0xf1eb('0x20');var _0x5d6f3a=_0x521506['count'];var _0x50f545=_0x361ef6?0x0:_0x1fb959['offset'];var _0x2e1793=_0x361ef6?_0x521506[_0xf1eb('0x22')]:_0x1fb959[_0xf1eb('0x1f')]+_0x1fb959[_0xf1eb('0x21')];var _0x4cc3a7;if(_0x2e1793>=_0x5d6f3a){_0x2e1793=_0x5d6f3a;_0x4cc3a7=0xc8;}else{_0x4cc3a7=0xce;}_0x2f754e[_0xf1eb('0x1d')](_0x4cc3a7);return _0x2f754e[_0xf1eb('0x23')](_0xf1eb('0x24'),_0x50f545+'-'+_0x2e1793+'/'+_0x5d6f3a)[_0xf1eb('0x1e')](_0x521506);}return null;};}function patchUpdates(_0x41ef40){return function(_0x15545a){try{jsonpatch[_0xf1eb('0x25')](_0x15545a,_0x41ef40,!![]);}catch(_0x254080){return BPromise[_0xf1eb('0x26')](_0x254080);}return _0x15545a[_0xf1eb('0x27')]();};}function saveUpdates(_0x40a393,_0x667f1){return function(_0x351658){if(_0x351658){return _0x351658['update'](_0x40a393)[_0xf1eb('0x28')](function(_0x221e34){return _0x221e34;});}return null;};}function removeEntity(_0x18863c,_0x59e4d9){return function(_0x3ff935){if(_0x3ff935){return _0x3ff935[_0xf1eb('0x29')]()[_0xf1eb('0x28')](function(){_0x18863c[_0xf1eb('0x1d')](0xcc)[_0xf1eb('0x1c')]();});}};}function handleEntityNotFound(_0x64e7fc,_0x55ae51){return function(_0x44a0dc){if(!_0x44a0dc){_0x64e7fc[_0xf1eb('0x1b')](0x194);}return _0x44a0dc;};}function handleError(_0x491596,_0x30fabc){_0x30fabc=_0x30fabc||0x1f4;return function(_0x1b1365){logger[_0xf1eb('0x2a')](_0x1b1365[_0xf1eb('0x2b')]);if(_0x1b1365[_0xf1eb('0x2c')]){delete _0x1b1365[_0xf1eb('0x2c')];}_0x491596[_0xf1eb('0x1d')](_0x30fabc)[_0xf1eb('0x2d')](_0x1b1365);};}exports[_0xf1eb('0x2e')]=function(_0x30f769,_0x2d125c){var _0xfa892f={},_0x17d302={},_0x464a7a={'count':0x0,'rows':[]};var _0x29dd48=_['map'](db[_0xf1eb('0x2f')][_0xf1eb('0x30')],function(_0x38628c){return{'name':_0x38628c[_0xf1eb('0x31')],'type':_0x38628c[_0xf1eb('0x32')]['key']};});_0x17d302[_0xf1eb('0x33')]=_[_0xf1eb('0x34')](_0x29dd48,_0xf1eb('0x2c'));_0x17d302[_0xf1eb('0x35')]=_['keys'](_0x30f769[_0xf1eb('0x35')]);_0x17d302[_0xf1eb('0x36')]=_[_0xf1eb('0x37')](_0x17d302['model'],_0x17d302['query']);_0xfa892f[_0xf1eb('0x38')]=_[_0xf1eb('0x37')](_0x17d302[_0xf1eb('0x33')],qs[_0xf1eb('0x39')](_0x30f769[_0xf1eb('0x35')][_0xf1eb('0x39')]));_0xfa892f[_0xf1eb('0x38')]=_0xfa892f[_0xf1eb('0x38')][_0xf1eb('0x3a')]?_0xfa892f['attributes']:_0x17d302[_0xf1eb('0x33')];if(!_0x30f769['query'][_0xf1eb('0x3b')](_0xf1eb('0x3c'))){_0xfa892f[_0xf1eb('0x21')]=qs[_0xf1eb('0x21')](_0x30f769[_0xf1eb('0x35')][_0xf1eb('0x21')]);_0xfa892f[_0xf1eb('0x1f')]=qs[_0xf1eb('0x1f')](_0x30f769['query'][_0xf1eb('0x1f')]);}_0xfa892f[_0xf1eb('0x3d')]=qs[_0xf1eb('0x3e')](_0x30f769[_0xf1eb('0x35')][_0xf1eb('0x3e')]);_0xfa892f['where']=qs[_0xf1eb('0x36')](_['pick'](_0x30f769[_0xf1eb('0x35')],_0x17d302[_0xf1eb('0x36')]),_0x29dd48);if(_0x30f769[_0xf1eb('0x35')]['filter']){_0xfa892f[_0xf1eb('0x3f')]=_[_0xf1eb('0x40')](_0xfa892f[_0xf1eb('0x3f')],{'$or':_[_0xf1eb('0x34')](_0x29dd48,function(_0x3bf878){if(_0x3bf878[_0xf1eb('0x32')]!=='VIRTUAL'){var _0x5bf838={};_0x5bf838[_0x3bf878['name']]={'$like':'%'+_0x30f769[_0xf1eb('0x35')][_0xf1eb('0x41')]+'%'};return _0x5bf838;}})});}_0xfa892f=_[_0xf1eb('0x40')]({},_0xfa892f,_0x30f769[_0xf1eb('0x42')]);var _0x1dfef2={'where':_0xfa892f['where']};return db[_0xf1eb('0x2f')][_0xf1eb('0x22')](_0x1dfef2)['then'](function(_0x5d83d7){_0x464a7a[_0xf1eb('0x22')]=_0x5d83d7;if(_0x30f769[_0xf1eb('0x35')][_0xf1eb('0x43')]){_0xfa892f[_0xf1eb('0x44')]=[{'all':!![]}];}return db['UserProfileSection'][_0xf1eb('0x45')](_0xfa892f);})[_0xf1eb('0x28')](function(_0x6bf408){_0x464a7a[_0xf1eb('0x46')]=_0x6bf408;return _0x464a7a;})[_0xf1eb('0x28')](respondWithFilteredResult(_0x2d125c,_0xfa892f))[_0xf1eb('0x47')](handleError(_0x2d125c,null));};exports['show']=function(_0x22e198,_0x52037c){var _0x486c85={'raw':![],'where':{'id':_0x22e198['params']['id']}},_0x226944={};_0x226944[_0xf1eb('0x33')]=_[_0xf1eb('0x48')](db['UserProfileSection'][_0xf1eb('0x30')]);_0x226944['query']=_[_0xf1eb('0x48')](_0x22e198[_0xf1eb('0x35')]);_0x226944['filters']=_[_0xf1eb('0x37')](_0x226944[_0xf1eb('0x33')],_0x226944['query']);_0x486c85['attributes']=_[_0xf1eb('0x37')](_0x226944[_0xf1eb('0x33')],qs[_0xf1eb('0x39')](_0x22e198[_0xf1eb('0x35')][_0xf1eb('0x39')]));_0x486c85[_0xf1eb('0x38')]=_0x486c85[_0xf1eb('0x38')]['length']?_0x486c85[_0xf1eb('0x38')]:_0x226944[_0xf1eb('0x33')];if(_0x22e198[_0xf1eb('0x35')]['includeAll']){_0x486c85[_0xf1eb('0x44')]=[{'all':!![]}];}_0x486c85=_[_0xf1eb('0x40')]({},_0x486c85,_0x22e198['options']);return db[_0xf1eb('0x2f')][_0xf1eb('0x49')](_0x486c85)['then'](handleEntityNotFound(_0x52037c,null))[_0xf1eb('0x28')](respondWithResult(_0x52037c,null))[_0xf1eb('0x47')](handleError(_0x52037c,null));};exports[_0xf1eb('0x4a')]=function(_0x31e80e,_0x2dc347){return db[_0xf1eb('0x2f')][_0xf1eb('0x4a')](_0x31e80e[_0xf1eb('0x4b')],{})[_0xf1eb('0x28')](respondWithResult(_0x2dc347,0xc9))[_0xf1eb('0x47')](handleError(_0x2dc347,null));};exports[_0xf1eb('0x4c')]=function(_0x1d8019,_0x435cd3){if(_0x1d8019[_0xf1eb('0x4b')]['id']){delete _0x1d8019[_0xf1eb('0x4b')]['id'];}return db[_0xf1eb('0x2f')]['find']({'where':{'id':_0x1d8019[_0xf1eb('0x4d')]['id']}})[_0xf1eb('0x28')](handleEntityNotFound(_0x435cd3,null))[_0xf1eb('0x28')](saveUpdates(_0x1d8019[_0xf1eb('0x4b')],null))[_0xf1eb('0x28')](respondWithResult(_0x435cd3,null))[_0xf1eb('0x47')](handleError(_0x435cd3,null));};exports[_0xf1eb('0x29')]=function(_0x21b129,_0x55e387){return db[_0xf1eb('0x2f')][_0xf1eb('0x49')]({'where':{'id':_0x21b129[_0xf1eb('0x4d')]['id']}})[_0xf1eb('0x28')](handleEntityNotFound(_0x55e387,null))[_0xf1eb('0x28')](removeEntity(_0x55e387,null))['catch'](handleError(_0x55e387,null));};exports[_0xf1eb('0x4e')]=function(_0x4ff48c,_0x4a3f3a){return db[_0xf1eb('0x2f')][_0xf1eb('0x4e')]()[_0xf1eb('0x28')](respondWithResult(_0x4a3f3a,null))[_0xf1eb('0x47')](handleError(_0x4a3f3a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index bbb2397..3d60ee1 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 _0x906b=['./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2d2498,_0x26426d){var _0x447a5b=function(_0x2977e8){while(--_0x2977e8){_0x2d2498['push'](_0x2d2498['shift']());}};_0x447a5b(++_0x26426d);}(_0x906b,0x1ef));var _0xb906=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x906b[_0x54defc];return _0x1955d3;};'use strict';var _=require(_0xb906('0x0'));var util=require(_0xb906('0x1'));var logger=require(_0xb906('0x2'))(_0xb906('0x3'));var moment=require(_0xb906('0x4'));var BPromise=require(_0xb906('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb906('0x6'));var rimraf=require(_0xb906('0x7'));var config=require(_0xb906('0x8'));var attributes=require(_0xb906('0x9'));module['exports']=function(_0x5d8052,_0x42f096){return _0x5d8052[_0xb906('0xa')](_0xb906('0xb'),attributes,{'tableName':_0xb906('0xc'),'paranoid':![],'indexes':[{'name':_0xb906('0xd'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e18=['moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6e18,0xc2));var _0x86e1=function(_0x4a9f28,_0x22352c){_0x4a9f28=_0x4a9f28-0x0;var _0x535a04=_0x6e18[_0x4a9f28];return _0x535a04;};'use strict';var _=require(_0x86e1('0x0'));var util=require(_0x86e1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x86e1('0x2'));var BPromise=require(_0x86e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86e1('0x4'));var rimraf=require(_0x86e1('0x5'));var config=require(_0x86e1('0x6'));var attributes=require(_0x86e1('0x7'));module[_0x86e1('0x8')]=function(_0x5a7dd5,_0x479407){return _0x5a7dd5[_0x86e1('0x9')](_0x86e1('0xa'),attributes,{'tableName':_0x86e1('0xb'),'paranoid':![],'indexes':[{'name':_0x86e1('0xc'),'fields':[_0x86e1('0xd'),'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 587c87e..8adb765 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 _0xa3eb=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s'];(function(_0x5e6ebe,_0x373752){var _0x5d80a0=function(_0x145677){while(--_0x145677){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x5d80a0(++_0x373752);}(_0xa3eb,0x93));var _0xba3e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa3eb[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xba3e('0x0'));var util=require(_0xba3e('0x1'));var moment=require(_0xba3e('0x2'));var BPromise=require(_0xba3e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3e('0x5'))(_0xba3e('0x6'));var config=require(_0xba3e('0x7'));var jayson=require(_0xba3e('0x8'));var client=jayson[_0xba3e('0x9')][_0xba3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x499c19,_0x28d96d,_0x47c02b){return new BPromise(function(_0x516adf,_0x534ffd){return client[_0xba3e('0xb')](_0x499c19,_0x47c02b)[_0xba3e('0xc')](function(_0x431fcc){logger['info'](_0xba3e('0xd'),_0x28d96d,_0xba3e('0xe'));logger[_0xba3e('0xf')](_0xba3e('0x10'),_0x28d96d,_0xba3e('0xe'),JSON[_0xba3e('0x11')](_0x431fcc));if(_0x431fcc['error']){if(_0x431fcc[_0xba3e('0x12')]['code']===0x1f4){logger[_0xba3e('0x12')](_0xba3e('0xd'),_0x28d96d,_0x431fcc['error'][_0xba3e('0x13')]);return _0x534ffd(_0x431fcc[_0xba3e('0x12')]['message']);}logger['error'](_0xba3e('0xd'),_0x28d96d,_0x431fcc[_0xba3e('0x12')][_0xba3e('0x13')]);return _0x516adf(_0x431fcc['error']['message']);}else{logger[_0xba3e('0x14')](_0xba3e('0xd'),_0x28d96d,_0xba3e('0xe'));_0x516adf(_0x431fcc[_0xba3e('0x15')][_0xba3e('0x13')]);}})[_0xba3e('0x16')](function(_0x18342e){logger[_0xba3e('0x12')](_0xba3e('0xd'),_0x28d96d,_0x18342e);_0x534ffd(_0x18342e);});});} \ No newline at end of file +var _0x29cd=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1d3dda,_0x362006){var _0x45de52=function(_0x3e9823){while(--_0x3e9823){_0x1d3dda['push'](_0x1d3dda['shift']());}};_0x45de52(++_0x362006);}(_0x29cd,0x17b));var _0xd29c=function(_0x410b0e,_0x31c41c){_0x410b0e=_0x410b0e-0x0;var _0x53dc9d=_0x29cd[_0x410b0e];return _0x53dc9d;};'use strict';var _=require(_0xd29c('0x0'));var util=require('util');var moment=require(_0xd29c('0x1'));var BPromise=require(_0xd29c('0x2'));var rs=require(_0xd29c('0x3'));var fs=require('fs');var Redis=require(_0xd29c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd29c('0x5'));var logger=require(_0xd29c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd29c('0x7'));var client=jayson[_0xd29c('0x8')][_0xd29c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x389864,_0x48633d,_0x241e70){return new BPromise(function(_0x3acf2e,_0x73603e){return client['request'](_0x389864,_0x241e70)['then'](function(_0x376d36){logger[_0xd29c('0xa')](_0xd29c('0xb'),_0x48633d,_0xd29c('0xc'));logger['debug'](_0xd29c('0xd'),_0x48633d,_0xd29c('0xc'),JSON[_0xd29c('0xe')](_0x376d36));if(_0x376d36[_0xd29c('0xf')]){if(_0x376d36[_0xd29c('0xf')][_0xd29c('0x10')]===0x1f4){logger[_0xd29c('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x48633d,_0x376d36['error'][_0xd29c('0x11')]);return _0x73603e(_0x376d36[_0xd29c('0xf')]['message']);}logger[_0xd29c('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x48633d,_0x376d36[_0xd29c('0xf')][_0xd29c('0x11')]);return _0x3acf2e(_0x376d36[_0xd29c('0xf')]['message']);}else{logger[_0xd29c('0xa')](_0xd29c('0xb'),_0x48633d,_0xd29c('0xc'));_0x3acf2e(_0x376d36[_0xd29c('0x12')][_0xd29c('0x11')]);}})['catch'](function(_0x4a28b7){logger['error'](_0xd29c('0xb'),_0x48633d,_0x4a28b7);_0x73603e(_0x4a28b7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 955a6c9..6b0793e 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(_0x448fbb,_0x38e9cd){var _0xb0b655=function(_0x42b5e4){while(--_0x42b5e4){_0x448fbb['push'](_0x448fbb['shift']());}};_0xb0b655(++_0x38e9cd);}(_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(_0x2d5ac8,_0x2b6a02){var _0x385e94=function(_0x535801){while(--_0x535801){_0x2d5ac8['push'](_0x2d5ac8['shift']());}};_0x385e94(++_0x2b6a02);}(_0x70e0,0x17b));var _0x070e=function(_0x20cf16,_0x310b57){_0x20cf16=_0x20cf16-0x0;var _0x576da4=_0x70e0[_0x20cf16];return _0x576da4;};'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 f51f7f7..f48175f 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 _0x28ff=['exports','INTEGER'];(function(_0x1b91ea,_0x2be1bb){var _0x13625f=function(_0x5d1f75){while(--_0x5d1f75){_0x1b91ea['push'](_0x1b91ea['shift']());}};_0x13625f(++_0x2be1bb);}(_0x28ff,0x7a));var _0xf28f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x28ff[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0xf28f('0x0')]={'penalty':{'type':Sequelize[_0xf28f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5343=['sequelize','exports','INTEGER'];(function(_0x3236a8,_0x44c5f2){var _0x209b4a=function(_0x22ed4c){while(--_0x22ed4c){_0x3236a8['push'](_0x3236a8['shift']());}};_0x209b4a(++_0x44c5f2);}(_0x5343,0x123));var _0x3534=function(_0x113f46,_0x422e03){_0x113f46=_0x113f46-0x0;var _0xbdbf7f=_0x5343[_0x113f46];return _0xbdbf7f;};'use strict';var Sequelize=require(_0x3534('0x0'));module[_0x3534('0x1')]={'penalty':{'type':Sequelize[_0x3534('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 5ac803d..dba40e4 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 _0x50a5=['util','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x50a5,0xd1));var _0x550a=function(_0x52c62f,_0x16b0a5){_0x52c62f=_0x52c62f-0x0;var _0x59d154=_0x50a5[_0x52c62f];return _0x59d154;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x550a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var attributes=require(_0x550a('0x5'));module[_0x550a('0x6')]=function(_0x402f66,_0x3b3c29){return _0x402f66[_0x550a('0x7')](_0x550a('0x8'),attributes,{'tableName':_0x550a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x313e38,_0xa8b45c){var _0x63a605=function(_0x328b19){while(--_0x328b19){_0x313e38['push'](_0x313e38['shift']());}};_0x63a605(++_0xa8b45c);}(_0x4ccb,0x196));var _0xb4cc=function(_0x34245e,_0x114d90){_0x34245e=_0x34245e-0x0;var _0x51f5c2=_0x4ccb[_0x34245e];return _0x51f5c2;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'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 a7de1e9..b38a9d7 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 _0x3c21=['catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x11a54c,_0x469134){var _0x182f4d=function(_0x22bafd){while(--_0x22bafd){_0x11a54c['push'](_0x11a54c['shift']());}};_0x182f4d(++_0x469134);}(_0x3c21,0x17b));var _0x13c2=function(_0x494dc8,_0x3b7c8c){_0x494dc8=_0x494dc8-0x0;var _0x1395ed=_0x3c21[_0x494dc8];return _0x1395ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x13c2('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c2('0x1'));var db=require(_0x13c2('0x2'))['db'];var utils=require(_0x13c2('0x3'));var logger=require(_0x13c2('0x4'))(_0x13c2('0x5'));var config=require(_0x13c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x13c2('0x7')][_0x13c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5eb998,_0x510718,_0x9f05d6){return new BPromise(function(_0x552136,_0x4a8a66){return client[_0x13c2('0x9')](_0x5eb998,_0x9f05d6)[_0x13c2('0xa')](function(_0x3dbb95){logger[_0x13c2('0xb')](_0x13c2('0xc'),_0x510718,_0x13c2('0xd'));logger['debug'](_0x13c2('0xe'),_0x510718,_0x13c2('0xd'),JSON[_0x13c2('0xf')](_0x3dbb95));if(_0x3dbb95[_0x13c2('0x10')]){if(_0x3dbb95['error'][_0x13c2('0x11')]===0x1f4){logger['error'](_0x13c2('0xc'),_0x510718,_0x3dbb95[_0x13c2('0x10')][_0x13c2('0x12')]);return _0x4a8a66(_0x3dbb95[_0x13c2('0x10')][_0x13c2('0x12')]);}logger[_0x13c2('0x10')](_0x13c2('0xc'),_0x510718,_0x3dbb95[_0x13c2('0x10')]['message']);return _0x552136(_0x3dbb95[_0x13c2('0x10')][_0x13c2('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x510718,_0x13c2('0xd'));_0x552136(_0x3dbb95[_0x13c2('0x13')]['message']);}})[_0x13c2('0x14')](function(_0x288cc3){logger[_0x13c2('0x10')](_0x13c2('0xc'),_0x510718,_0x288cc3);_0x4a8a66(_0x288cc3);});});} \ No newline at end of file +var _0xb104=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1f21dd,_0x3ba586){var _0x5d779d=function(_0x1d3549){while(--_0x1d3549){_0x1f21dd['push'](_0x1f21dd['shift']());}};_0x5d779d(++_0x3ba586);}(_0xb104,0xd8));var _0x4b10=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xb104[_0x264b9b];return _0x4c7a0e;};'use strict';var _=require(_0x4b10('0x0'));var util=require('util');var moment=require(_0x4b10('0x1'));var BPromise=require(_0x4b10('0x2'));var rs=require(_0x4b10('0x3'));var fs=require('fs');var Redis=require(_0x4b10('0x4'));var db=require(_0x4b10('0x5'))['db'];var utils=require(_0x4b10('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4b10('0x7'));var jayson=require(_0x4b10('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58d944,_0x1ee603,_0x444e13){return new BPromise(function(_0x1ca3cf,_0x22327b){return client['request'](_0x58d944,_0x444e13)['then'](function(_0x43a72f){logger[_0x4b10('0x9')](_0x4b10('0xa'),_0x1ee603,_0x4b10('0xb'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1ee603,'request\x20sent',JSON[_0x4b10('0xc')](_0x43a72f));if(_0x43a72f[_0x4b10('0xd')]){if(_0x43a72f[_0x4b10('0xd')][_0x4b10('0xe')]===0x1f4){logger[_0x4b10('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x1ee603,_0x43a72f['error'][_0x4b10('0xf')]);return _0x22327b(_0x43a72f['error']['message']);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1ee603,_0x43a72f[_0x4b10('0xd')][_0x4b10('0xf')]);return _0x1ca3cf(_0x43a72f['error'][_0x4b10('0xf')]);}else{logger[_0x4b10('0x9')](_0x4b10('0xa'),_0x1ee603,_0x4b10('0xb'));_0x1ca3cf(_0x43a72f['result'][_0x4b10('0xf')]);}})[_0x4b10('0x10')](function(_0x1e0c24){logger[_0x4b10('0xd')](_0x4b10('0xa'),_0x1ee603,_0x1e0c24);_0x22327b(_0x1e0c24);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index d79c59b..19bd5ce 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 _0x436e=['INTEGER','sequelize','exports'];(function(_0xfc689f,_0x40e569){var _0x12f1af=function(_0x2d7b20){while(--_0x2d7b20){_0xfc689f['push'](_0xfc689f['shift']());}};_0x12f1af(++_0x40e569);}(_0x436e,0x88));var _0xe436=function(_0x14fac6,_0x487864){_0x14fac6=_0x14fac6-0x0;var _0xb3e133=_0x436e[_0x14fac6];return _0xb3e133;};'use strict';var Sequelize=require(_0xe436('0x0'));module[_0xe436('0x1')]={'UserId':{'type':Sequelize[_0xe436('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe436('0x2')]}}; \ No newline at end of file +var _0x5c86=['INTEGER','exports'];(function(_0x59efbb,_0x1b77e1){var _0x1e143c=function(_0x411003){while(--_0x411003){_0x59efbb['push'](_0x59efbb['shift']());}};_0x1e143c(++_0x1b77e1);}(_0x5c86,0xa1));var _0x65c8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5c86[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x65c8('0x0')]={'UserId':{'type':Sequelize[_0x65c8('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x65c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 1a468c5..0334c06 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(_0x3ffc04,_0xe085ea){var _0x556146=function(_0x5c98c1){while(--_0x5c98c1){_0x3ffc04['push'](_0x3ffc04['shift']());}};_0x556146(++_0xe085ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x375e4f,_0x3f4242){var _0x235edb=function(_0x2de658){while(--_0x2de658){_0x375e4f['push'](_0x375e4f['shift']());}};_0x235edb(++_0x3f4242);}(_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 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 cbd8a5c..844455d 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(_0x25ef7d,_0x4aeaef){var _0xa8bf1e=function(_0x1b94cc){while(--_0x1b94cc){_0x25ef7d['push'](_0x25ef7d['shift']());}};_0xa8bf1e(++_0x4aeaef);}(_0xe706,0xa3));var _0x6e70=function(_0x5a184b,_0x457876){_0x5a184b=_0x5a184b-0x0;var _0x713964=_0xe706[_0x5a184b];return _0x713964;};'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(_0x97f085,_0x202eaf){var _0x311399=function(_0xe6d231){while(--_0xe6d231){_0x97f085['push'](_0x97f085['shift']());}};_0x311399(++_0x202eaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index fb93ae0..058451e 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 _0xf87a=['sequelize','exports'];(function(_0x5c4d97,_0x42dc72){var _0x5b4d19=function(_0x62f76a){while(--_0x62f76a){_0x5c4d97['push'](_0x5c4d97['shift']());}};_0x5b4d19(++_0x42dc72);}(_0xf87a,0xf6));var _0xaf87=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf87a[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xaf87('0x0'));module[_0xaf87('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbd8c=['INTEGER','exports'];(function(_0x329ebf,_0x905aa6){var _0x3e1ec4=function(_0x6f90ea){while(--_0x6f90ea){_0x329ebf['push'](_0x329ebf['shift']());}};_0x3e1ec4(++_0x905aa6);}(_0xbd8c,0xfd));var _0xcbd8=function(_0x2b5a1f,_0x134e66){_0x2b5a1f=_0x2b5a1f-0x0;var _0x38671b=_0xbd8c[_0x2b5a1f];return _0x38671b;};'use strict';var Sequelize=require('sequelize');module[_0xcbd8('0x0')]={'penalty':{'type':Sequelize[_0xcbd8('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 b05d567..08bc410 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 _0x471b=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x471b,0x133));var _0xb471=function(_0xd7b22,_0x34ebed){_0xd7b22=_0xd7b22-0x0;var _0x3fbb73=_0x471b[_0xd7b22];return _0x3fbb73;};'use strict';var _=require(_0xb471('0x0'));var util=require(_0xb471('0x1'));var logger=require(_0xb471('0x2'))(_0xb471('0x3'));var moment=require(_0xb471('0x4'));var BPromise=require(_0xb471('0x5'));var rp=require(_0xb471('0x6'));var fs=require('fs');var path=require(_0xb471('0x7'));var rimraf=require(_0xb471('0x8'));var config=require(_0xb471('0x9'));var attributes=require(_0xb471('0xa'));module[_0xb471('0xb')]=function(_0x5f2f59,_0x32ef57){return _0x5f2f59[_0xb471('0xc')](_0xb471('0xd'),attributes,{'tableName':_0xb471('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0d4=['../../config/logger','api','bluebird','path','rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','util'];(function(_0x51af00,_0x1f0374){var _0x48bbe7=function(_0x5ce433){while(--_0x5ce433){_0x51af00['push'](_0x51af00['shift']());}};_0x48bbe7(++_0x1f0374);}(_0xe0d4,0xdb));var _0x4e0d=function(_0x1ba522,_0x2570fe){_0x1ba522=_0x1ba522-0x0;var _0x964553=_0xe0d4[_0x1ba522];return _0x964553;};'use strict';var _=require('lodash');var util=require(_0x4e0d('0x0'));var logger=require(_0x4e0d('0x1'))(_0x4e0d('0x2'));var moment=require('moment');var BPromise=require(_0x4e0d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e0d('0x4'));var rimraf=require(_0x4e0d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e0d('0x6'));module[_0x4e0d('0x7')]=function(_0x191836,_0x7ca091){return _0x191836[_0x4e0d('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x4e0d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 13214e2..ee4227f 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 _0xc7d6=['http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x20c110,_0xee227e){var _0x2497ac=function(_0x2cef5f){while(--_0x2cef5f){_0x20c110['push'](_0x20c110['shift']());}};_0x2497ac(++_0xee227e);}(_0xc7d6,0x1b0));var _0x6c7d=function(_0x3fdc6c,_0x254cb1){_0x3fdc6c=_0x3fdc6c-0x0;var _0x59f304=_0xc7d6[_0x3fdc6c];return _0x59f304;};'use strict';var _=require('lodash');var util=require(_0x6c7d('0x0'));var moment=require('moment');var BPromise=require(_0x6c7d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c7d('0x2'));var db=require(_0x6c7d('0x3'))['db'];var utils=require(_0x6c7d('0x4'));var logger=require(_0x6c7d('0x5'))('rpc');var config=require(_0x6c7d('0x6'));var jayson=require(_0x6c7d('0x7'));var client=jayson[_0x6c7d('0x8')][_0x6c7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x86ea7e,_0x4bfec3,_0x164d2a){return new BPromise(function(_0x47d33c,_0x3c1c91){return client[_0x6c7d('0xa')](_0x86ea7e,_0x164d2a)['then'](function(_0x13ec7e){logger[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x4bfec3,_0x6c7d('0xd'));logger[_0x6c7d('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4bfec3,_0x6c7d('0xd'),JSON[_0x6c7d('0xf')](_0x13ec7e));if(_0x13ec7e[_0x6c7d('0x10')]){if(_0x13ec7e['error'][_0x6c7d('0x11')]===0x1f4){logger[_0x6c7d('0x10')](_0x6c7d('0xc'),_0x4bfec3,_0x13ec7e[_0x6c7d('0x10')][_0x6c7d('0x12')]);return _0x3c1c91(_0x13ec7e['error'][_0x6c7d('0x12')]);}logger[_0x6c7d('0x10')](_0x6c7d('0xc'),_0x4bfec3,_0x13ec7e[_0x6c7d('0x10')][_0x6c7d('0x12')]);return _0x47d33c(_0x13ec7e['error'][_0x6c7d('0x12')]);}else{logger[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x4bfec3,_0x6c7d('0xd'));_0x47d33c(_0x13ec7e[_0x6c7d('0x13')][_0x6c7d('0x12')]);}})[_0x6c7d('0x14')](function(_0x46862e){logger[_0x6c7d('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bfec3,_0x46862e);_0x3c1c91(_0x46862e);});});} \ No newline at end of file +var _0x7aea=['request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x7aea,0x196));var _0xa7ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa7ae('0x0'));var util=require(_0xa7ae('0x1'));var moment=require(_0xa7ae('0x2'));var BPromise=require(_0xa7ae('0x3'));var rs=require(_0xa7ae('0x4'));var fs=require('fs');var Redis=require(_0xa7ae('0x5'));var db=require(_0xa7ae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7ae('0x7'))(_0xa7ae('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa7ae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ebc79,_0x4c5ea0,_0x51488a){return new BPromise(function(_0x2fa7b8,_0x504ded){return client[_0xa7ae('0xa')](_0x2ebc79,_0x51488a)[_0xa7ae('0xb')](function(_0x32da8c){logger[_0xa7ae('0xc')](_0xa7ae('0xd'),_0x4c5ea0,_0xa7ae('0xe'));logger['debug'](_0xa7ae('0xf'),_0x4c5ea0,_0xa7ae('0xe'),JSON['stringify'](_0x32da8c));if(_0x32da8c[_0xa7ae('0x10')]){if(_0x32da8c[_0xa7ae('0x10')][_0xa7ae('0x11')]===0x1f4){logger[_0xa7ae('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x4c5ea0,_0x32da8c[_0xa7ae('0x10')][_0xa7ae('0x12')]);return _0x504ded(_0x32da8c[_0xa7ae('0x10')][_0xa7ae('0x12')]);}logger['error'](_0xa7ae('0xd'),_0x4c5ea0,_0x32da8c[_0xa7ae('0x10')]['message']);return _0x2fa7b8(_0x32da8c['error'][_0xa7ae('0x12')]);}else{logger[_0xa7ae('0xc')](_0xa7ae('0xd'),_0x4c5ea0,_0xa7ae('0xe'));_0x2fa7b8(_0x32da8c['result'][_0xa7ae('0x12')]);}})[_0xa7ae('0x13')](function(_0x19f3ec){logger[_0xa7ae('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x4c5ea0,_0x19f3ec);_0x504ded(_0x19f3ec);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c26a2bf..f3b175a 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x372bff,_0x2bb900){var _0x25b72b=function(_0x37e576){while(--_0x37e576){_0x372bff['push'](_0x372bff['shift']());}};_0x25b72b(++_0x2bb900);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x35ef32,_0x4c063d){var _0x3f5ec8=function(_0x346c56){while(--_0x346c56){_0x35ef32['push'](_0x35ef32['shift']());}};_0x3f5ec8(++_0x4c063d);}(_0x70e0,0x17b));var _0x070e=function(_0x29b218,_0x1e8626){_0x29b218=_0x29b218-0x0;var _0x1fd78d=_0x70e0[_0x29b218];return _0x1fd78d;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 9cf84f4..6335533 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 _0x3658=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3658,0x133));var _0x8365=function(_0x2ecb38,_0x520902){_0x2ecb38=_0x2ecb38-0x0;var _0x5e52ab=_0x3658[_0x2ecb38];return _0x5e52ab;};'use strict';var Sequelize=require(_0x8365('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8365('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8365('0x2')},'membername':{'type':Sequelize[_0x8365('0x3')],'allowNull':![],'comment':_0x8365('0x2')},'UserId':{'type':Sequelize[_0x8365('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8365('0x4'),'comment':_0x8365('0x2')},'VoiceQueueId':{'type':Sequelize[_0x8365('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x8365('0x3')],'allowNull':![],'unique':_0x8365('0x4'),'comment':_0x8365('0x2')},'penalty':{'type':Sequelize[_0x8365('0x1')](0xb),'defaultValue':0x0,'comment':_0x8365('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x8365('0x2')}}; \ No newline at end of file +var _0xeeb8=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x372def,_0x49b0f9){var _0x5b9c36=function(_0x203bf1){while(--_0x203bf1){_0x372def['push'](_0x372def['shift']());}};_0x5b9c36(++_0x49b0f9);}(_0xeeb8,0x168));var _0x8eeb=function(_0x236430,_0xb2be3b){_0x236430=_0x236430-0x0;var _0x298bbc=_0xeeb8[_0x236430];return _0x298bbc;};'use strict';var Sequelize=require('sequelize');module[_0x8eeb('0x0')]={'uniqueid':{'type':Sequelize[_0x8eeb('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8eeb('0x2')},'membername':{'type':Sequelize[_0x8eeb('0x3')],'allowNull':![],'comment':_0x8eeb('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8eeb('0x3')],'allowNull':![],'unique':_0x8eeb('0x4'),'comment':_0x8eeb('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x8eeb('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x8eeb('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x8eeb('0x1')](0xb),'defaultValue':0x0,'comment':_0x8eeb('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 656a386..54ad9e8 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 _0xb0ff=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x440a5b,_0x275d9d){var _0x979b76=function(_0x3e3878){while(--_0x3e3878){_0x440a5b['push'](_0x440a5b['shift']());}};_0x979b76(++_0x275d9d);}(_0xb0ff,0x1b4));var _0xfb0f=function(_0x65899e,_0x4d725c){_0x65899e=_0x65899e-0x0;var _0x428c87=_0xb0ff[_0x65899e];return _0x428c87;};'use strict';var EventEmitter=require(_0xfb0f('0x0'));var UserVoiceQueueRt=require(_0xfb0f('0x1'))['db'][_0xfb0f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xfb0f('0x3')](0x0);var events={'afterCreate':_0xfb0f('0x4'),'afterUpdate':_0xfb0f('0x5'),'afterDestroy':_0xfb0f('0x6')};function emitEvent(_0x1990e1){return function(_0x16f209,_0x1be24e,_0x2137b0){UserVoiceQueueRtEvents['emit'](_0x1990e1+':'+_0x16f209['id'],_0x16f209);UserVoiceQueueRtEvents[_0xfb0f('0x7')](_0x1990e1,_0x16f209);_0x2137b0(null);};}for(var e in events){if(events[_0xfb0f('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xfb0f('0x9')](e,emitEvent(event));}}module[_0xfb0f('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xcb04=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x5b9571,_0x18534a){var _0x368123=function(_0x30656){while(--_0x30656){_0x5b9571['push'](_0x5b9571['shift']());}};_0x368123(++_0x18534a);}(_0xcb04,0x10e));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4cb0('0x0'));var UserVoiceQueueRt=require(_0x4cb0('0x1'))['db'][_0x4cb0('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4cb0('0x3')](0x0);var events={'afterCreate':_0x4cb0('0x4'),'afterUpdate':_0x4cb0('0x5'),'afterDestroy':_0x4cb0('0x6')};function emitEvent(_0x28612f){return function(_0x21516e,_0x3f1f94,_0x359dac){UserVoiceQueueRtEvents[_0x4cb0('0x7')](_0x28612f+':'+_0x21516e['id'],_0x21516e);UserVoiceQueueRtEvents[_0x4cb0('0x7')](_0x28612f,_0x21516e);_0x359dac(null);};}for(var e in events){if(events[_0x4cb0('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x4cb0('0x9')](e,emitEvent(event));}}module[_0x4cb0('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c504e55..a96db54 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 _0xd476=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','bluebird'];(function(_0x4fb0fa,_0x32c64a){var _0x330041=function(_0x1ca639){while(--_0x1ca639){_0x4fb0fa['push'](_0x4fb0fa['shift']());}};_0x330041(++_0x32c64a);}(_0xd476,0xf9));var _0x6d47=function(_0x3d314e,_0x737e92){_0x3d314e=_0x3d314e-0x0;var _0x20bca1=_0xd476[_0x3d314e];return _0x20bca1;};'use strict';var _=require(_0x6d47('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6d47('0x1'));var moment=require(_0x6d47('0x2'));var BPromise=require(_0x6d47('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d47('0x4'));var rimraf=require(_0x6d47('0x5'));var config=require(_0x6d47('0x6'));var attributes=require(_0x6d47('0x7'));module['exports']=function(_0x1c3515,_0x2fde96){return _0x1c3515[_0x6d47('0x8')](_0x6d47('0x9'),attributes,{'tableName':_0x6d47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbea=['user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0xbbea,0x11f));var _0xabbe=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbbea[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xabbe('0x0'));var util=require(_0xabbe('0x1'));var logger=require(_0xabbe('0x2'))('api');var moment=require(_0xabbe('0x3'));var BPromise=require(_0xabbe('0x4'));var rp=require(_0xabbe('0x5'));var fs=require('fs');var path=require(_0xabbe('0x6'));var rimraf=require('rimraf');var config=require(_0xabbe('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xabbe('0x8')]=function(_0x2cca64,_0x5f51b3){return _0x2cca64[_0xabbe('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0xabbe('0xa'),'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 b51aa70..f7ccdf5 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 _0x5d8b=['outboundQueuePauses','stringify','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null'];(function(_0x18307e,_0x1898e8){var _0x24186b=function(_0x5ee12b){while(--_0x5ee12b){_0x18307e['push'](_0x18307e['shift']());}};_0x24186b(++_0x1898e8);}(_0x5d8b,0x1b2));var _0xb5d8=function(_0x35e384,_0x51501d){_0x35e384=_0x35e384-0x0;var _0x606b73=_0x5d8b[_0x35e384];return _0x606b73;};'use strict';var _=require(_0xb5d8('0x0'));var util=require(_0xb5d8('0x1'));var moment=require('moment');var BPromise=require(_0xb5d8('0x2'));var rs=require(_0xb5d8('0x3'));var fs=require('fs');var Redis=require(_0xb5d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5d8('0x5'));var config=require(_0xb5d8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb5d8('0x7')][_0xb5d8('0x8')]({'port':0x232a});config[_0xb5d8('0x9')]=_[_0xb5d8('0xa')](config[_0xb5d8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5d8('0xb'))(new Redis(config['redis']));require(_0xb5d8('0xc'))[_0xb5d8('0xd')](socket);function respondWithRpcPromise(_0x5692af,_0x2e9969,_0x383185){return new BPromise(function(_0x5b5f32,_0x58db4d){return client[_0xb5d8('0xe')](_0x5692af,_0x383185)[_0xb5d8('0xf')](function(_0x4795e7){logger[_0xb5d8('0x10')](_0xb5d8('0x11'),_0x2e9969,_0xb5d8('0x12'));logger[_0xb5d8('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2e9969,_0xb5d8('0x12'),JSON['stringify'](_0x4795e7));if(_0x4795e7['error']){if(_0x4795e7[_0xb5d8('0x14')][_0xb5d8('0x15')]===0x1f4){logger[_0xb5d8('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2e9969,_0x4795e7[_0xb5d8('0x14')][_0xb5d8('0x16')]);return _0x58db4d(_0x4795e7[_0xb5d8('0x14')]['message']);}logger[_0xb5d8('0x14')](_0xb5d8('0x11'),_0x2e9969,_0x4795e7[_0xb5d8('0x14')][_0xb5d8('0x16')]);return _0x5b5f32(_0x4795e7[_0xb5d8('0x14')]['message']);}else{logger[_0xb5d8('0x10')](_0xb5d8('0x11'),_0x2e9969,_0xb5d8('0x12'));_0x5b5f32(_0x4795e7[_0xb5d8('0x17')][_0xb5d8('0x16')]);}})[_0xb5d8('0x18')](function(_0x2a3c59){logger[_0xb5d8('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2e9969,_0x2a3c59);_0x58db4d(_0x2a3c59);});});}exports[_0xb5d8('0x19')]=function(_0x454f0b){var _0x219989=this;return new Promise(function(_0x41729c,_0x34fba0){return db[_0xb5d8('0x1a')][_0xb5d8('0x1b')]({'raw':_0x454f0b[_0xb5d8('0x1c')]?_0x454f0b[_0xb5d8('0x1c')][_0xb5d8('0x1d')]===undefined?!![]:![]:!![],'where':_0x454f0b[_0xb5d8('0x1c')]?_0x454f0b[_0xb5d8('0x1c')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xb5d8('0x1e'),db[_0xb5d8('0x1f')]['fn']('IF',db['sequelize'][_0xb5d8('0x20')](_0xb5d8('0x21')))),_0xb5d8('0x22')]]})[_0xb5d8('0xf')](function(_0xc11b59){logger['info'](_0xb5d8('0x19'),_0x454f0b);logger['debug'](_0xb5d8('0x19'),_0x454f0b,JSON[_0xb5d8('0x23')](_0xc11b59));_0x41729c(_0xc11b59);})[_0xb5d8('0x18')](function(_0x2b2857){logger['error'](_0xb5d8('0x19'),_0x2b2857[_0xb5d8('0x16')],_0x454f0b);_0x34fba0(_0x219989['error'](0x1f4,_0x2b2857[_0xb5d8('0x16')]));});});}; \ No newline at end of file +var _0xcdf1=['COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where'];(function(_0x4c1088,_0x3ff863){var _0x54a35e=function(_0x2ddfed){while(--_0x2ddfed){_0x4c1088['push'](_0x4c1088['shift']());}};_0x54a35e(++_0x3ff863);}(_0xcdf1,0x99));var _0x1cdf=function(_0xd845db,_0x57f0dd){_0xd845db=_0xd845db-0x0;var _0xa92be1=_0xcdf1[_0xd845db];return _0xa92be1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cdf('0x0'));var BPromise=require(_0x1cdf('0x1'));var rs=require(_0x1cdf('0x2'));var fs=require('fs');var Redis=require(_0x1cdf('0x3'));var db=require(_0x1cdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cdf('0x5'))(_0x1cdf('0x6'));var config=require(_0x1cdf('0x7'));var jayson=require(_0x1cdf('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1cdf('0x9')]=_[_0x1cdf('0xa')](config[_0x1cdf('0x9')],{'host':_0x1cdf('0xb'),'port':0x18eb});var socket=require(_0x1cdf('0xc'))(new Redis(config[_0x1cdf('0x9')]));require(_0x1cdf('0xd'))[_0x1cdf('0xe')](socket);function respondWithRpcPromise(_0x2eab24,_0x14b3c7,_0x4cfb2c){return new BPromise(function(_0x4b614d,_0x33801e){return client[_0x1cdf('0xf')](_0x2eab24,_0x4cfb2c)['then'](function(_0x2faa19){logger['info'](_0x1cdf('0x10'),_0x14b3c7,_0x1cdf('0x11'));logger[_0x1cdf('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x14b3c7,_0x1cdf('0x11'),JSON[_0x1cdf('0x13')](_0x2faa19));if(_0x2faa19[_0x1cdf('0x14')]){if(_0x2faa19['error'][_0x1cdf('0x15')]===0x1f4){logger[_0x1cdf('0x14')](_0x1cdf('0x10'),_0x14b3c7,_0x2faa19[_0x1cdf('0x14')][_0x1cdf('0x16')]);return _0x33801e(_0x2faa19['error'][_0x1cdf('0x16')]);}logger[_0x1cdf('0x14')](_0x1cdf('0x10'),_0x14b3c7,_0x2faa19['error'][_0x1cdf('0x16')]);return _0x4b614d(_0x2faa19[_0x1cdf('0x14')][_0x1cdf('0x16')]);}else{logger[_0x1cdf('0x17')](_0x1cdf('0x10'),_0x14b3c7,'request\x20sent');_0x4b614d(_0x2faa19[_0x1cdf('0x18')][_0x1cdf('0x16')]);}})[_0x1cdf('0x19')](function(_0x514962){logger[_0x1cdf('0x14')](_0x1cdf('0x10'),_0x14b3c7,_0x514962);_0x33801e(_0x514962);});});}exports[_0x1cdf('0x1a')]=function(_0x3abcad){var _0x400fa6=this;return new Promise(function(_0x129338,_0x13eca2){return db[_0x1cdf('0x1b')][_0x1cdf('0x1c')]({'raw':_0x3abcad[_0x1cdf('0x1d')]?_0x3abcad['options'][_0x1cdf('0x1e')]===undefined?!![]:![]:!![],'where':_0x3abcad[_0x1cdf('0x1d')]?_0x3abcad[_0x1cdf('0x1d')][_0x1cdf('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1cdf('0x20'),db[_0x1cdf('0x21')]['fn']('IF',db[_0x1cdf('0x21')][_0x1cdf('0x22')](_0x1cdf('0x23')))),'outboundQueuePauses']]})[_0x1cdf('0x24')](function(_0x52be23){logger['info'](_0x1cdf('0x1a'),_0x3abcad);logger[_0x1cdf('0x12')]('GetVoiceQueueRtPauses',_0x3abcad,JSON['stringify'](_0x52be23));_0x129338(_0x52be23);})['catch'](function(_0x48701c){logger[_0x1cdf('0x14')]('GetVoiceQueueRtPauses',_0x48701c[_0x1cdf('0x16')],_0x3abcad);_0x13eca2(_0x400fa6[_0x1cdf('0x14')](0x1f4,_0x48701c['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index ca781cf..d8f167e 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 _0x1ffe=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x207fa6,_0x54adff){var _0x5e2563=function(_0x51e76b){while(--_0x51e76b){_0x207fa6['push'](_0x207fa6['shift']());}};_0x5e2563(++_0x54adff);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x105a89,_0x3c1d74){_0x105a89=_0x105a89-0x0;var _0x377bf8=_0x1ffe[_0x105a89];return _0x377bf8;};'use strict';var UserVoiceQueueRtEvents=require(_0xe1ff('0x0'));var events=[_0xe1ff('0x1'),_0xe1ff('0x2'),_0xe1ff('0x3')];function createListener(_0x118ffc,_0x32ea02){return function(_0xbfcf6b){_0x32ea02[_0xe1ff('0x4')](_0x118ffc,_0xbfcf6b);};}function removeListener(_0x77b687,_0xceabbd){return function(){UserVoiceQueueRtEvents[_0xe1ff('0x5')](_0x77b687,_0xceabbd);};}exports[_0xe1ff('0x6')]=function(_0x54f710){for(var _0x4bd010=0x0,_0x40fb3a=events[_0xe1ff('0x7')];_0x4bd010<_0x40fb3a;_0x4bd010++){var _0x20d288=events[_0x4bd010];var _0x283152=createListener(_0xe1ff('0x8')+_0x20d288,_0x54f710);UserVoiceQueueRtEvents['on'](_0x20d288,_0x283152);}}; \ No newline at end of file +var _0x74f3=['save','remove','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x34e714,_0x83de64){var _0x3045b9=function(_0x31071c){while(--_0x31071c){_0x34e714['push'](_0x34e714['shift']());}};_0x3045b9(++_0x83de64);}(_0x74f3,0x164));var _0x374f=function(_0xb26465,_0x138e2c){_0xb26465=_0xb26465-0x0;var _0x23bc34=_0x74f3[_0xb26465];return _0x23bc34;};'use strict';var UserVoiceQueueRtEvents=require(_0x374f('0x0'));var events=[_0x374f('0x1'),_0x374f('0x2'),'update'];function createListener(_0x407670,_0x29c056){return function(_0x3dee9d){_0x29c056[_0x374f('0x3')](_0x407670,_0x3dee9d);};}function removeListener(_0x4a3be7,_0x3db0a){return function(){UserVoiceQueueRtEvents[_0x374f('0x4')](_0x4a3be7,_0x3db0a);};}exports['register']=function(_0x1292f2){for(var _0x1eb333=0x0,_0x405e93=events[_0x374f('0x5')];_0x1eb333<_0x405e93;_0x1eb333++){var _0x3bcc86=events[_0x1eb333];var _0x394073=createListener(_0x374f('0x6')+_0x3bcc86,_0x1292f2);UserVoiceQueueRtEvents['on'](_0x3bcc86,_0x394073);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 5e18285..1dda33c 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_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 797a301..0b7e031 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 _0x4485=['exports','INTEGER'];(function(_0x2b8b4d,_0x833705){var _0x38150e=function(_0x484130){while(--_0x484130){_0x2b8b4d['push'](_0x2b8b4d['shift']());}};_0x38150e(++_0x833705);}(_0x4485,0x1ac));var _0x5448=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x4485[_0x586fa2];return _0x515be9;};'use strict';var Sequelize=require('sequelize');module[_0x5448('0x0')]={'penalty':{'type':Sequelize[_0x5448('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa952=['exports','INTEGER','sequelize'];(function(_0x12b526,_0x407b8b){var _0xccb2bd=function(_0x1fefe0){while(--_0x1fefe0){_0x12b526['push'](_0x12b526['shift']());}};_0xccb2bd(++_0x407b8b);}(_0xa952,0x1b2));var _0x2a95=function(_0x1846f2,_0x353922){_0x1846f2=_0x1846f2-0x0;var _0x3f2021=_0xa952[_0x1846f2];return _0x3f2021;};'use strict';var Sequelize=require(_0x2a95('0x0'));module[_0x2a95('0x1')]={'penalty':{'type':Sequelize[_0x2a95('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 5cc26e5..dc3e86b 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 _0xea58=['./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4b9d59,_0x910c53){var _0x2426ba=function(_0x25bae3){while(--_0x25bae3){_0x4b9d59['push'](_0x4b9d59['shift']());}};_0x2426ba(++_0x910c53);}(_0xea58,0x101));var _0x8ea5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ea5('0x0'));var util=require(_0x8ea5('0x1'));var logger=require('../../config/logger')(_0x8ea5('0x2'));var moment=require('moment');var BPromise=require(_0x8ea5('0x3'));var rp=require(_0x8ea5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ea5('0x5'));var config=require(_0x8ea5('0x6'));var attributes=require(_0x8ea5('0x7'));module[_0x8ea5('0x8')]=function(_0x15772e,_0x1e4282){return _0x15772e[_0x8ea5('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x8ea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x103a=['moment','bluebird','request-promise','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x103a,0xb0));var _0xa103=function(_0x4e0d45,_0x55f937){_0x4e0d45=_0x4e0d45-0x0;var _0xb25758=_0x103a[_0x4e0d45];return _0xb25758;};'use strict';var _=require(_0xa103('0x0'));var util=require(_0xa103('0x1'));var logger=require(_0xa103('0x2'))(_0xa103('0x3'));var moment=require(_0xa103('0x4'));var BPromise=require(_0xa103('0x5'));var rp=require(_0xa103('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa103('0x7'));var attributes=require(_0xa103('0x8'));module[_0xa103('0x9')]=function(_0x2553b2,_0xe01b41){return _0x2553b2[_0xa103('0xa')](_0xa103('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','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 5876e07..532d9cd 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 _0x02e7=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe828e8,_0x2b34ac){var _0x4c1cce=function(_0x1a0b99){while(--_0x1a0b99){_0xe828e8['push'](_0xe828e8['shift']());}};_0x4c1cce(++_0x2b34ac);}(_0x02e7,0x97));var _0x702e=function(_0x10f626,_0x568cb9){_0x10f626=_0x10f626-0x0;var _0x307b1f=_0x02e7[_0x10f626];return _0x307b1f;};'use strict';var _=require(_0x702e('0x0'));var util=require(_0x702e('0x1'));var moment=require(_0x702e('0x2'));var BPromise=require(_0x702e('0x3'));var rs=require(_0x702e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x702e('0x5'))('rpc');var config=require(_0x702e('0x6'));var jayson=require(_0x702e('0x7'));var client=jayson['client'][_0x702e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa04225,_0x511bea,_0x3ab071){return new BPromise(function(_0x56f75d,_0xf73152){return client['request'](_0xa04225,_0x3ab071)[_0x702e('0x9')](function(_0x4d8168){logger[_0x702e('0xa')](_0x702e('0xb'),_0x511bea,_0x702e('0xc'));logger[_0x702e('0xd')](_0x702e('0xe'),_0x511bea,_0x702e('0xc'),JSON[_0x702e('0xf')](_0x4d8168));if(_0x4d8168['error']){if(_0x4d8168[_0x702e('0x10')][_0x702e('0x11')]===0x1f4){logger[_0x702e('0x10')](_0x702e('0xb'),_0x511bea,_0x4d8168['error'][_0x702e('0x12')]);return _0xf73152(_0x4d8168['error'][_0x702e('0x12')]);}logger['error'](_0x702e('0xb'),_0x511bea,_0x4d8168['error']['message']);return _0x56f75d(_0x4d8168[_0x702e('0x10')][_0x702e('0x12')]);}else{logger[_0x702e('0xa')](_0x702e('0xb'),_0x511bea,_0x702e('0xc'));_0x56f75d(_0x4d8168[_0x702e('0x13')][_0x702e('0x12')]);}})[_0x702e('0x14')](function(_0x1afc60){logger[_0x702e('0x10')](_0x702e('0xb'),_0x511bea,_0x1afc60);_0xf73152(_0x1afc60);});});} \ No newline at end of file +var _0x59b4=['http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x75869b,_0x847a55){var _0x2c7522=function(_0x50a6f1){while(--_0x50a6f1){_0x75869b['push'](_0x75869b['shift']());}};_0x2c7522(++_0x847a55);}(_0x59b4,0xa3));var _0x459b=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x59b4[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x459b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x459b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x459b('0x2'));var db=require(_0x459b('0x3'))['db'];var utils=require(_0x459b('0x4'));var logger=require(_0x459b('0x5'))(_0x459b('0x6'));var config=require(_0x459b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x459b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcbd526,_0x2ce91b,_0x245e2d){return new BPromise(function(_0x23c44f,_0x1860cd){return client[_0x459b('0x9')](_0xcbd526,_0x245e2d)[_0x459b('0xa')](function(_0x42b41a){logger['info'](_0x459b('0xb'),_0x2ce91b,_0x459b('0xc'));logger[_0x459b('0xd')](_0x459b('0xe'),_0x2ce91b,_0x459b('0xc'),JSON['stringify'](_0x42b41a));if(_0x42b41a[_0x459b('0xf')]){if(_0x42b41a[_0x459b('0xf')]['code']===0x1f4){logger[_0x459b('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2ce91b,_0x42b41a[_0x459b('0xf')][_0x459b('0x10')]);return _0x1860cd(_0x42b41a[_0x459b('0xf')][_0x459b('0x10')]);}logger['error'](_0x459b('0xb'),_0x2ce91b,_0x42b41a[_0x459b('0xf')]['message']);return _0x23c44f(_0x42b41a[_0x459b('0xf')][_0x459b('0x10')]);}else{logger[_0x459b('0x11')](_0x459b('0xb'),_0x2ce91b,_0x459b('0xc'));_0x23c44f(_0x42b41a[_0x459b('0x12')][_0x459b('0x10')]);}})['catch'](function(_0x188319){logger[_0x459b('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2ce91b,_0x188319);_0x1860cd(_0x188319);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 0e526e6..dbeb405 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 _0xbd3b=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','isAuthenticated','get','/:id','post','create','put','update','delete'];(function(_0x36cb19,_0x486e38){var _0x147f66=function(_0x139c84){while(--_0x139c84){_0x36cb19['push'](_0x36cb19['shift']());}};_0x147f66(++_0x486e38);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x211530,_0x3ea767){_0x211530=_0x211530-0x0;var _0x3b5427=_0xbd3b[_0x211530];return _0x3b5427;};'use strict';var multer=require(_0xbbd3('0x0'));var util=require(_0xbbd3('0x1'));var path=require(_0xbbd3('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbd3('0x3'));var router=express[_0xbbd3('0x4')]();var fs_extra=require(_0xbbd3('0x5'));var auth=require(_0xbbd3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd3('0x7'));var controller=require(_0xbbd3('0x8'));router['get']('/',auth[_0xbbd3('0x9')](),controller['index']);router[_0xbbd3('0xa')](_0xbbd3('0xb'),auth[_0xbbd3('0x9')](),controller['show']);router[_0xbbd3('0xc')]('/',auth[_0xbbd3('0x9')](),controller[_0xbbd3('0xd')]);router[_0xbbd3('0xe')]('/:id',auth[_0xbbd3('0x9')](),controller[_0xbbd3('0xf')]);router[_0xbbd3('0x10')](_0xbbd3('0xb'),auth['isAuthenticated'](),controller[_0xbbd3('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd691=['delete','/:id','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','post','create','put','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd691,0xe6));var _0x1d69=function(_0x2a78d9,_0x271b92){_0x2a78d9=_0x2a78d9-0x0;var _0x293145=_0xd691[_0x2a78d9];return _0x293145;};'use strict';var multer=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var path=require(_0x1d69('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d69('0x3'));var router=express[_0x1d69('0x4')]();var fs_extra=require(_0x1d69('0x5'));var auth=require(_0x1d69('0x6'));var interaction=require(_0x1d69('0x7'));var config=require(_0x1d69('0x8'));var controller=require(_0x1d69('0x9'));router[_0x1d69('0xa')]('/',auth[_0x1d69('0xb')](),controller[_0x1d69('0xc')]);router['get']('/:id',auth[_0x1d69('0xb')](),controller['show']);router[_0x1d69('0xd')]('/',auth[_0x1d69('0xb')](),controller[_0x1d69('0xe')]);router[_0x1d69('0xf')]('/:id',auth[_0x1d69('0xb')](),controller[_0x1d69('0x10')]);router[_0x1d69('0x11')](_0x1d69('0x12'),auth[_0x1d69('0xb')](),controller['destroy']);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 af23e4a..d7915c4 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 _0xe933=['exports','STRING','name','sequelize'];(function(_0x46e53b,_0x4453d4){var _0x209da6=function(_0x5089bd){while(--_0x5089bd){_0x46e53b['push'](_0x46e53b['shift']());}};_0x209da6(++_0x4453d4);}(_0xe933,0x103));var _0x3e93=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xe933[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0x3e93('0x0'));module[_0x3e93('0x1')]={'name':{'type':Sequelize[_0x3e93('0x2')],'unique':_0x3e93('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3e93('0x2')]}}; \ No newline at end of file +var _0x45a7=['STRING','name','sequelize','exports'];(function(_0x3ceb7b,_0x659062){var _0x548422=function(_0x2b3110){while(--_0x2b3110){_0x3ceb7b['push'](_0x3ceb7b['shift']());}};_0x548422(++_0x659062);}(_0x45a7,0x17e));var _0x745a=function(_0x2f2dba,_0x451d2e){_0x2f2dba=_0x2f2dba-0x0;var _0x27e85e=_0x45a7[_0x2f2dba];return _0x27e85e;};'use strict';var Sequelize=require(_0x745a('0x0'));module[_0x745a('0x1')]={'name':{'type':Sequelize[_0x745a('0x2')],'unique':_0x745a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x745a('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 6882943..dcfeaaf 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 _0x7765=['hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','name','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x43f2af,_0x583470){var _0x2c0a38=function(_0x4004f7){while(--_0x4004f7){_0x43f2af['push'](_0x43f2af['shift']());}};_0x2c0a38(++_0x583470);}(_0x7765,0x1f4));var _0x5776=function(_0x32267e,_0x308d62){_0x32267e=_0x32267e-0x0;var _0x185fff=_0x7765[_0x32267e];return _0x185fff;};'use strict';var emlformat=require(_0x5776('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5776('0x1'));var rp=require(_0x5776('0x2'));var moment=require(_0x5776('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5776('0x4'));var util=require(_0x5776('0x5'));var path=require('path');var sox=require(_0x5776('0x6'));var csv=require(_0x5776('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5776('0x8'));var _=require(_0x5776('0x9'));var squel=require(_0x5776('0xa'));var crypto=require('crypto');var jsforce=require(_0x5776('0xb'));var deskjs=require(_0x5776('0xc'));var toCsv=require(_0x5776('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5776('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5776('0xe'));var hardwareService=require(_0x5776('0xf'));var logger=require('../../config/logger')(_0x5776('0x10'));var utils=require(_0x5776('0x11'));var config=require(_0x5776('0x12'));var licenseUtil=require(_0x5776('0x13'));var db=require(_0x5776('0x14'))['db'];function respondWithStatusCode(_0x262618,_0x5f28b7){_0x5f28b7=_0x5f28b7||0xcc;return function(_0x52f498){if(_0x52f498){return _0x262618[_0x5776('0x15')](_0x5f28b7);}return _0x262618[_0x5776('0x16')](_0x5f28b7)['end']();};}function respondWithResult(_0x408944,_0x106756){_0x106756=_0x106756||0xc8;return function(_0x209c98){if(_0x209c98){return _0x408944[_0x5776('0x16')](_0x106756)[_0x5776('0x17')](_0x209c98);}};}function respondWithFilteredResult(_0x230233,_0x45db82){return function(_0x55caaf){if(_0x55caaf){var _0xadd6a1=typeof _0x45db82[_0x5776('0x18')]==='undefined'&&typeof _0x45db82[_0x5776('0x19')]===_0x5776('0x1a');var _0x20dd93=_0x55caaf['count'];var _0x3f4fbc=_0xadd6a1?0x0:_0x45db82[_0x5776('0x18')];var _0x365348=_0xadd6a1?_0x55caaf[_0x5776('0x1b')]:_0x45db82[_0x5776('0x18')]+_0x45db82[_0x5776('0x19')];var _0x17fb43;if(_0x365348>=_0x20dd93){_0x365348=_0x20dd93;_0x17fb43=0xc8;}else{_0x17fb43=0xce;}_0x230233[_0x5776('0x16')](_0x17fb43);return _0x230233['set'](_0x5776('0x1c'),_0x3f4fbc+'-'+_0x365348+'/'+_0x20dd93)[_0x5776('0x17')](_0x55caaf);}return null;};}function patchUpdates(_0x5ee81c){return function(_0x331593){try{jsonpatch['apply'](_0x331593,_0x5ee81c,!![]);}catch(_0x28830f){return BPromise[_0x5776('0x1d')](_0x28830f);}return _0x331593[_0x5776('0x1e')]();};}function saveUpdates(_0x4737b8,_0x141341){return function(_0x3663b0){if(_0x3663b0){return _0x3663b0[_0x5776('0x1f')](_0x4737b8)[_0x5776('0x20')](function(_0x56e32f){return _0x56e32f;});}return null;};}function removeEntity(_0x188cc9,_0x31c5f7){return function(_0x47f0a5){if(_0x47f0a5){return _0x47f0a5[_0x5776('0x21')]()[_0x5776('0x20')](function(){var _0x17e074=_0x47f0a5[_0x5776('0x22')]({'plain':!![]});var _0x7e8389=_0x5776('0x23');return db[_0x5776('0x24')][_0x5776('0x21')]({'where':{'type':_0x7e8389,'resourceId':_0x17e074['id']}})[_0x5776('0x20')](function(){return _0x47f0a5;});})[_0x5776('0x20')](function(){_0x188cc9[_0x5776('0x16')](0xcc)[_0x5776('0x25')]();});}};}function handleEntityNotFound(_0x3e24f5,_0x172088){return function(_0x36307c){if(!_0x36307c){_0x3e24f5[_0x5776('0x15')](0x194);}return _0x36307c;};}function handleError(_0x191c60,_0x5cfb7a){_0x5cfb7a=_0x5cfb7a||0x1f4;return function(_0x3b2321){logger['error'](_0x3b2321['stack']);if(_0x3b2321[_0x5776('0x26')]){delete _0x3b2321[_0x5776('0x26')];}_0x191c60[_0x5776('0x16')](_0x5cfb7a)['send'](_0x3b2321);};}exports[_0x5776('0x27')]=function(_0x3e437e,_0x5451a7){var _0x7ad30f={},_0x5ec451={},_0x4e112b={'count':0x0,'rows':[]};var _0x3676e0=_[_0x5776('0x28')](db[_0x5776('0x29')]['rawAttributes'],function(_0x1f87ff){return{'name':_0x1f87ff[_0x5776('0x2a')],'type':_0x1f87ff[_0x5776('0x2b')][_0x5776('0x2c')]};});_0x5ec451[_0x5776('0x2d')]=_[_0x5776('0x28')](_0x3676e0,_0x5776('0x26'));_0x5ec451[_0x5776('0x2e')]=_[_0x5776('0x2f')](_0x3e437e[_0x5776('0x2e')]);_0x5ec451[_0x5776('0x30')]=_[_0x5776('0x31')](_0x5ec451[_0x5776('0x2d')],_0x5ec451[_0x5776('0x2e')]);_0x7ad30f[_0x5776('0x32')]=_['intersection'](_0x5ec451[_0x5776('0x2d')],qs[_0x5776('0x33')](_0x3e437e[_0x5776('0x2e')][_0x5776('0x33')]));_0x7ad30f[_0x5776('0x32')]=_0x7ad30f[_0x5776('0x32')][_0x5776('0x34')]?_0x7ad30f[_0x5776('0x32')]:_0x5ec451[_0x5776('0x2d')];if(!_0x3e437e[_0x5776('0x2e')][_0x5776('0x35')](_0x5776('0x36'))){_0x7ad30f[_0x5776('0x19')]=qs[_0x5776('0x19')](_0x3e437e[_0x5776('0x2e')][_0x5776('0x19')]);_0x7ad30f[_0x5776('0x18')]=qs['offset'](_0x3e437e[_0x5776('0x2e')]['offset']);}_0x7ad30f[_0x5776('0x37')]=qs['sort'](_0x3e437e['query']['sort']);_0x7ad30f[_0x5776('0x38')]=qs[_0x5776('0x30')](_[_0x5776('0x39')](_0x3e437e['query'],_0x5ec451[_0x5776('0x30')]),_0x3676e0);if(_0x3e437e['query'][_0x5776('0x3a')]){_0x7ad30f['where']=_[_0x5776('0x3b')](_0x7ad30f[_0x5776('0x38')],{'$or':_[_0x5776('0x28')](_0x3676e0,function(_0x4f21d1){if(_0x4f21d1[_0x5776('0x2b')]!==_0x5776('0x3c')){var _0x2315ce={};_0x2315ce[_0x4f21d1[_0x5776('0x26')]]={'$like':'%'+_0x3e437e[_0x5776('0x2e')][_0x5776('0x3a')]+'%'};return _0x2315ce;}})});}_0x7ad30f=_[_0x5776('0x3b')]({},_0x7ad30f,_0x3e437e[_0x5776('0x3d')]);var _0xb95bb5={'where':_0x7ad30f[_0x5776('0x38')]};return db[_0x5776('0x29')][_0x5776('0x1b')](_0xb95bb5)['then'](function(_0x1b33dc){_0x4e112b['count']=_0x1b33dc;if(_0x3e437e[_0x5776('0x2e')][_0x5776('0x3e')]){_0x7ad30f['include']=[{'all':!![]}];}return db[_0x5776('0x29')][_0x5776('0x3f')](_0x7ad30f);})['then'](function(_0x8fcdc7){_0x4e112b[_0x5776('0x40')]=_0x8fcdc7;return _0x4e112b;})[_0x5776('0x20')](respondWithFilteredResult(_0x5451a7,_0x7ad30f))[_0x5776('0x41')](handleError(_0x5451a7,null));};exports[_0x5776('0x42')]=function(_0x216137,_0x37940f){var _0x20e89f={'raw':!![],'where':{'id':_0x216137[_0x5776('0x43')]['id']}},_0x19dbf1={};_0x19dbf1[_0x5776('0x2d')]=_[_0x5776('0x2f')](db[_0x5776('0x29')][_0x5776('0x44')]);_0x19dbf1[_0x5776('0x2e')]=_[_0x5776('0x2f')](_0x216137[_0x5776('0x2e')]);_0x19dbf1[_0x5776('0x30')]=_[_0x5776('0x31')](_0x19dbf1[_0x5776('0x2d')],_0x19dbf1[_0x5776('0x2e')]);_0x20e89f[_0x5776('0x32')]=_['intersection'](_0x19dbf1['model'],qs[_0x5776('0x33')](_0x216137[_0x5776('0x2e')][_0x5776('0x33')]));_0x20e89f['attributes']=_0x20e89f[_0x5776('0x32')]['length']?_0x20e89f[_0x5776('0x32')]:_0x19dbf1[_0x5776('0x2d')];if(_0x216137[_0x5776('0x2e')]['includeAll']){_0x20e89f[_0x5776('0x45')]=[{'all':!![]}];}_0x20e89f=_[_0x5776('0x3b')]({},_0x20e89f,_0x216137['options']);return db[_0x5776('0x29')][_0x5776('0x46')](_0x20e89f)[_0x5776('0x20')](handleEntityNotFound(_0x37940f,null))['then'](respondWithResult(_0x37940f,null))['catch'](handleError(_0x37940f,null));};exports[_0x5776('0x47')]=function(_0x491ea3,_0x25c197){return db[_0x5776('0x29')]['create'](_0x491ea3[_0x5776('0x48')],{})[_0x5776('0x20')](function(_0x5c6443){var _0x3d4ffb=_0x491ea3[_0x5776('0x49')][_0x5776('0x22')]({'plain':!![]});if(!_0x3d4ffb)throw new Error(_0x5776('0x4a'));if(_0x3d4ffb[_0x5776('0x4b')]===_0x5776('0x49')){var _0x402b19=_0x5c6443[_0x5776('0x22')]({'plain':!![]});var _0x180257=_0x5776('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x180257,'userProfileId':_0x3d4ffb[_0x5776('0x4c')]},'raw':!![]})[_0x5776('0x20')](function(_0x109b88){if(_0x109b88&&_0x109b88['autoAssociation']===0x0){return db[_0x5776('0x24')]['create']({'name':_0x402b19[_0x5776('0x26')],'resourceId':_0x402b19['id'],'type':_0x109b88[_0x5776('0x26')],'sectionId':_0x109b88['id']},{})['then'](function(){return _0x5c6443;});}else{return _0x5c6443;}})[_0x5776('0x41')](function(_0x4ef90d){logger[_0x5776('0x4d')](_0x5776('0x4e'),_0x4ef90d);throw _0x4ef90d;});}return _0x5c6443;})['then'](respondWithResult(_0x25c197,0xc9))[_0x5776('0x41')](handleError(_0x25c197,null));};exports[_0x5776('0x1f')]=function(_0x3c1910,_0x13e13b){if(_0x3c1910[_0x5776('0x48')]['id']){delete _0x3c1910[_0x5776('0x48')]['id'];}return db[_0x5776('0x29')][_0x5776('0x46')]({'where':{'id':_0x3c1910[_0x5776('0x43')]['id']}})[_0x5776('0x20')](handleEntityNotFound(_0x13e13b,null))['then'](saveUpdates(_0x3c1910[_0x5776('0x48')],null))['then'](respondWithResult(_0x13e13b,null))[_0x5776('0x41')](handleError(_0x13e13b,null));};exports['destroy']=function(_0x2c4305,_0x42f394){return db[_0x5776('0x29')]['find']({'where':{'id':_0x2c4305[_0x5776('0x43')]['id']}})[_0x5776('0x20')](handleEntityNotFound(_0x42f394,null))[_0x5776('0x20')](removeEntity(_0x42f394,null))[_0x5776('0x41')](handleError(_0x42f394,null));}; \ No newline at end of file +var _0xab23=['sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','update','then','destroy','get','Variables','error','name','index','Variable','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','merge','type','filter','options','includeAll','include','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','path'];(function(_0x104c8e,_0x4f26c8){var _0x39656b=function(_0x460988){while(--_0x460988){_0x104c8e['push'](_0x104c8e['shift']());}};_0x39656b(++_0x4f26c8);}(_0xab23,0x162));var _0x3ab2=function(_0x38149a,_0x1602e1){_0x38149a=_0x38149a-0x0;var _0x4fd47a=_0xab23[_0x38149a];return _0x4fd47a;};'use strict';var emlformat=require(_0x3ab2('0x0'));var rimraf=require(_0x3ab2('0x1'));var zipdir=require(_0x3ab2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ab2('0x3'));var moment=require('moment');var BPromise=require(_0x3ab2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3ab2('0x5'));var sox=require(_0x3ab2('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ab2('0x7'));var _=require(_0x3ab2('0x8'));var squel=require(_0x3ab2('0x9'));var crypto=require(_0x3ab2('0xa'));var jsforce=require(_0x3ab2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3ab2('0xc'));var querystring=require('querystring');var Papa=require(_0x3ab2('0xd'));var Redis=require('ioredis');var authService=require(_0x3ab2('0xe'));var qs=require(_0x3ab2('0xf'));var as=require(_0x3ab2('0x10'));var hardwareService=require(_0x3ab2('0x11'));var logger=require(_0x3ab2('0x12'))('api');var utils=require(_0x3ab2('0x13'));var config=require(_0x3ab2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ab2('0x15'))['db'];function respondWithStatusCode(_0x1d01b1,_0x342c8a){_0x342c8a=_0x342c8a||0xcc;return function(_0x33ed57){if(_0x33ed57){return _0x1d01b1[_0x3ab2('0x16')](_0x342c8a);}return _0x1d01b1[_0x3ab2('0x17')](_0x342c8a)[_0x3ab2('0x18')]();};}function respondWithResult(_0x1566c7,_0x2ef1e4){_0x2ef1e4=_0x2ef1e4||0xc8;return function(_0x2d2167){if(_0x2d2167){return _0x1566c7['status'](_0x2ef1e4)['json'](_0x2d2167);}};}function respondWithFilteredResult(_0x5691b6,_0x33005d){return function(_0x375d97){if(_0x375d97){var _0x54375f=typeof _0x33005d[_0x3ab2('0x19')]===_0x3ab2('0x1a')&&typeof _0x33005d['limit']===_0x3ab2('0x1a');var _0x4dd7da=_0x375d97[_0x3ab2('0x1b')];var _0x15961f=_0x54375f?0x0:_0x33005d[_0x3ab2('0x19')];var _0x152217=_0x54375f?_0x375d97[_0x3ab2('0x1b')]:_0x33005d[_0x3ab2('0x19')]+_0x33005d['limit'];var _0x32e5cf;if(_0x152217>=_0x4dd7da){_0x152217=_0x4dd7da;_0x32e5cf=0xc8;}else{_0x32e5cf=0xce;}_0x5691b6[_0x3ab2('0x17')](_0x32e5cf);return _0x5691b6[_0x3ab2('0x1c')]('Content-Range',_0x15961f+'-'+_0x152217+'/'+_0x4dd7da)[_0x3ab2('0x1d')](_0x375d97);}return null;};}function patchUpdates(_0x37e26f){return function(_0x2e943b){try{jsonpatch['apply'](_0x2e943b,_0x37e26f,!![]);}catch(_0x23be3f){return BPromise['reject'](_0x23be3f);}return _0x2e943b['save']();};}function saveUpdates(_0x3f41e0,_0x1f4db9){return function(_0x33ecc8){if(_0x33ecc8){return _0x33ecc8[_0x3ab2('0x1e')](_0x3f41e0)[_0x3ab2('0x1f')](function(_0x5ae40b){return _0x5ae40b;});}return null;};}function removeEntity(_0x47e459,_0x58234e){return function(_0x179d88){if(_0x179d88){return _0x179d88[_0x3ab2('0x20')]()[_0x3ab2('0x1f')](function(){var _0x4159e3=_0x179d88[_0x3ab2('0x21')]({'plain':!![]});var _0x122c0a=_0x3ab2('0x22');return db['UserProfileResource'][_0x3ab2('0x20')]({'where':{'type':_0x122c0a,'resourceId':_0x4159e3['id']}})[_0x3ab2('0x1f')](function(){return _0x179d88;});})[_0x3ab2('0x1f')](function(){_0x47e459['status'](0xcc)[_0x3ab2('0x18')]();});}};}function handleEntityNotFound(_0x3f98b9,_0x34fac0){return function(_0x96e68b){if(!_0x96e68b){_0x3f98b9[_0x3ab2('0x16')](0x194);}return _0x96e68b;};}function handleError(_0xd09724,_0x594fbf){_0x594fbf=_0x594fbf||0x1f4;return function(_0x32b313){logger[_0x3ab2('0x23')](_0x32b313['stack']);if(_0x32b313['name']){delete _0x32b313[_0x3ab2('0x24')];}_0xd09724[_0x3ab2('0x17')](_0x594fbf)['send'](_0x32b313);};}exports[_0x3ab2('0x25')]=function(_0x22be46,_0x1b950d){var _0x25d334={},_0x28c637={},_0x515380={'count':0x0,'rows':[]};var _0x25b32f=_['map'](db[_0x3ab2('0x26')][_0x3ab2('0x27')],function(_0x3c29ce){return{'name':_0x3c29ce['fieldName'],'type':_0x3c29ce['type'][_0x3ab2('0x28')]};});_0x28c637['model']=_['map'](_0x25b32f,_0x3ab2('0x24'));_0x28c637['query']=_[_0x3ab2('0x29')](_0x22be46[_0x3ab2('0x2a')]);_0x28c637[_0x3ab2('0x2b')]=_[_0x3ab2('0x2c')](_0x28c637[_0x3ab2('0x2d')],_0x28c637[_0x3ab2('0x2a')]);_0x25d334[_0x3ab2('0x2e')]=_[_0x3ab2('0x2c')](_0x28c637['model'],qs[_0x3ab2('0x2f')](_0x22be46[_0x3ab2('0x2a')][_0x3ab2('0x2f')]));_0x25d334[_0x3ab2('0x2e')]=_0x25d334[_0x3ab2('0x2e')][_0x3ab2('0x30')]?_0x25d334[_0x3ab2('0x2e')]:_0x28c637['model'];if(!_0x22be46['query']['hasOwnProperty'](_0x3ab2('0x31'))){_0x25d334[_0x3ab2('0x32')]=qs[_0x3ab2('0x32')](_0x22be46[_0x3ab2('0x2a')][_0x3ab2('0x32')]);_0x25d334['offset']=qs[_0x3ab2('0x19')](_0x22be46[_0x3ab2('0x2a')][_0x3ab2('0x19')]);}_0x25d334[_0x3ab2('0x33')]=qs[_0x3ab2('0x34')](_0x22be46[_0x3ab2('0x2a')][_0x3ab2('0x34')]);_0x25d334['where']=qs[_0x3ab2('0x2b')](_[_0x3ab2('0x35')](_0x22be46[_0x3ab2('0x2a')],_0x28c637[_0x3ab2('0x2b')]),_0x25b32f);if(_0x22be46[_0x3ab2('0x2a')]['filter']){_0x25d334['where']=_[_0x3ab2('0x36')](_0x25d334['where'],{'$or':_['map'](_0x25b32f,function(_0x345501){if(_0x345501[_0x3ab2('0x37')]!=='VIRTUAL'){var _0x1cb4e1={};_0x1cb4e1[_0x345501['name']]={'$like':'%'+_0x22be46[_0x3ab2('0x2a')][_0x3ab2('0x38')]+'%'};return _0x1cb4e1;}})});}_0x25d334=_[_0x3ab2('0x36')]({},_0x25d334,_0x22be46[_0x3ab2('0x39')]);var _0x38fc2a={'where':_0x25d334['where']};return db[_0x3ab2('0x26')][_0x3ab2('0x1b')](_0x38fc2a)['then'](function(_0x5e61b0){_0x515380[_0x3ab2('0x1b')]=_0x5e61b0;if(_0x22be46['query'][_0x3ab2('0x3a')]){_0x25d334[_0x3ab2('0x3b')]=[{'all':!![]}];}return db[_0x3ab2('0x26')]['findAll'](_0x25d334);})[_0x3ab2('0x1f')](function(_0x3d3468){_0x515380[_0x3ab2('0x3c')]=_0x3d3468;return _0x515380;})[_0x3ab2('0x1f')](respondWithFilteredResult(_0x1b950d,_0x25d334))[_0x3ab2('0x3d')](handleError(_0x1b950d,null));};exports['show']=function(_0x3d4a21,_0x185d11){var _0x500174={'raw':!![],'where':{'id':_0x3d4a21[_0x3ab2('0x3e')]['id']}},_0x51394d={};_0x51394d[_0x3ab2('0x2d')]=_[_0x3ab2('0x29')](db[_0x3ab2('0x26')][_0x3ab2('0x27')]);_0x51394d[_0x3ab2('0x2a')]=_['keys'](_0x3d4a21[_0x3ab2('0x2a')]);_0x51394d['filters']=_[_0x3ab2('0x2c')](_0x51394d['model'],_0x51394d[_0x3ab2('0x2a')]);_0x500174[_0x3ab2('0x2e')]=_[_0x3ab2('0x2c')](_0x51394d[_0x3ab2('0x2d')],qs[_0x3ab2('0x2f')](_0x3d4a21[_0x3ab2('0x2a')][_0x3ab2('0x2f')]));_0x500174['attributes']=_0x500174[_0x3ab2('0x2e')][_0x3ab2('0x30')]?_0x500174[_0x3ab2('0x2e')]:_0x51394d[_0x3ab2('0x2d')];if(_0x3d4a21[_0x3ab2('0x2a')][_0x3ab2('0x3a')]){_0x500174[_0x3ab2('0x3b')]=[{'all':!![]}];}_0x500174=_[_0x3ab2('0x36')]({},_0x500174,_0x3d4a21[_0x3ab2('0x39')]);return db['Variable'][_0x3ab2('0x3f')](_0x500174)[_0x3ab2('0x1f')](handleEntityNotFound(_0x185d11,null))[_0x3ab2('0x1f')](respondWithResult(_0x185d11,null))['catch'](handleError(_0x185d11,null));};exports['create']=function(_0x442e79,_0x29333a){return db[_0x3ab2('0x26')]['create'](_0x442e79[_0x3ab2('0x40')],{})['then'](function(_0x1a0d34){var _0x2d8f89=_0x442e79[_0x3ab2('0x41')][_0x3ab2('0x21')]({'plain':!![]});if(!_0x2d8f89)throw new Error(_0x3ab2('0x42'));if(_0x2d8f89[_0x3ab2('0x43')]===_0x3ab2('0x41')){var _0x4d5a22=_0x1a0d34[_0x3ab2('0x21')]({'plain':!![]});var _0x4bfada=_0x3ab2('0x22');return db['UserProfileSection'][_0x3ab2('0x3f')]({'where':{'name':_0x4bfada,'userProfileId':_0x2d8f89['userProfileId']},'raw':!![]})[_0x3ab2('0x1f')](function(_0x2fcdeb){if(_0x2fcdeb&&_0x2fcdeb[_0x3ab2('0x44')]===0x0){return db[_0x3ab2('0x45')][_0x3ab2('0x46')]({'name':_0x4d5a22[_0x3ab2('0x24')],'resourceId':_0x4d5a22['id'],'type':_0x2fcdeb[_0x3ab2('0x24')],'sectionId':_0x2fcdeb['id']},{})[_0x3ab2('0x1f')](function(){return _0x1a0d34;});}else{return _0x1a0d34;}})[_0x3ab2('0x3d')](function(_0xdb9dcb){logger[_0x3ab2('0x23')](_0x3ab2('0x47'),_0xdb9dcb);throw _0xdb9dcb;});}return _0x1a0d34;})[_0x3ab2('0x1f')](respondWithResult(_0x29333a,0xc9))[_0x3ab2('0x3d')](handleError(_0x29333a,null));};exports[_0x3ab2('0x1e')]=function(_0x40de35,_0x40e2a6){if(_0x40de35[_0x3ab2('0x40')]['id']){delete _0x40de35[_0x3ab2('0x40')]['id'];}return db[_0x3ab2('0x26')][_0x3ab2('0x3f')]({'where':{'id':_0x40de35['params']['id']}})['then'](handleEntityNotFound(_0x40e2a6,null))[_0x3ab2('0x1f')](saveUpdates(_0x40de35[_0x3ab2('0x40')],null))[_0x3ab2('0x1f')](respondWithResult(_0x40e2a6,null))[_0x3ab2('0x3d')](handleError(_0x40e2a6,null));};exports['destroy']=function(_0x53a9dd,_0x11f55a){return db['Variable'][_0x3ab2('0x3f')]({'where':{'id':_0x53a9dd[_0x3ab2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x11f55a,null))[_0x3ab2('0x1f')](removeEntity(_0x11f55a,null))[_0x3ab2('0x3d')](handleError(_0x11f55a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f7ae23e..fa8b7c6 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 _0x8f9b=['./variable.attributes','exports','define','tools_variables','lodash','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x290781,_0x53d542){var _0x1ef41f=function(_0x2940a5){while(--_0x2940a5){_0x290781['push'](_0x290781['shift']());}};_0x1ef41f(++_0x53d542);}(_0x8f9b,0x86));var _0xb8f9=function(_0xff1d2b,_0x50a288){_0xff1d2b=_0xff1d2b-0x0;var _0x3c549a=_0x8f9b[_0xff1d2b];return _0x3c549a;};'use strict';var _=require(_0xb8f9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb8f9('0x1'));var BPromise=require('bluebird');var rp=require(_0xb8f9('0x2'));var fs=require('fs');var path=require(_0xb8f9('0x3'));var rimraf=require(_0xb8f9('0x4'));var config=require(_0xb8f9('0x5'));var attributes=require(_0xb8f9('0x6'));module[_0xb8f9('0x7')]=function(_0x422996,_0x2bcb45){return _0x422996[_0xb8f9('0x8')]('Variable',attributes,{'tableName':_0xb8f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42ba=['./variable.attributes','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4a3795,_0x14a8e6){var _0x4ab7ba=function(_0x2ef2b4){while(--_0x2ef2b4){_0x4a3795['push'](_0x4a3795['shift']());}};_0x4ab7ba(++_0x14a8e6);}(_0x42ba,0x1f0));var _0xa42b=function(_0x21d436,_0x52c2c1){_0x21d436=_0x21d436-0x0;var _0x37b47b=_0x42ba[_0x21d436];return _0x37b47b;};'use strict';var _=require(_0xa42b('0x0'));var util=require('util');var logger=require(_0xa42b('0x1'))(_0xa42b('0x2'));var moment=require(_0xa42b('0x3'));var BPromise=require(_0xa42b('0x4'));var rp=require(_0xa42b('0x5'));var fs=require('fs');var path=require(_0xa42b('0x6'));var rimraf=require('rimraf');var config=require(_0xa42b('0x7'));var attributes=require(_0xa42b('0x8'));module['exports']=function(_0x481c91,_0x41f242){return _0x481c91[_0xa42b('0x9')](_0xa42b('0xa'),attributes,{'tableName':_0xa42b('0xb'),'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 6e7c9a2..217b9f4 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x5c9397,_0xe6bc88){var _0x194baf=function(_0x50d093){while(--_0x50d093){_0x5c9397['push'](_0x5c9397['shift']());}};_0x194baf(++_0xe6bc88);}(_0xe14b,0x93));var _0xbe14=function(_0xc2be36,_0x5a47fc){_0xc2be36=_0xc2be36-0x0;var _0x4c177d=_0xe14b[_0xc2be36];return _0x4c177d;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x35fb99,_0x37d22c){var _0x55b51d=function(_0x1eb4fa){while(--_0x1eb4fa){_0x35fb99['push'](_0x35fb99['shift']());}};_0x55b51d(++_0x37d22c);}(_0x814b,0x1a2));var _0xb814=function(_0x3f3c46,_0x33e972){_0x3f3c46=_0x3f3c46-0x0;var _0x7d1132=_0x814b[_0x3f3c46];return _0x7d1132;};'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')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 1a8c27d..58b2c94 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 _0x1c20=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','migrations','exports','Router','../../components/auth/service'];(function(_0x40c6a4,_0x2d633e){var _0x400f11=function(_0x199e91){while(--_0x199e91){_0x40c6a4['push'](_0x40c6a4['shift']());}};_0x400f11(++_0x2d633e);}(_0x1c20,0x1d2));var _0x01c2=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x1c20[_0x1aba25];return _0x47d997;};'use strict';var express=require('express');var router=express[_0x01c2('0x0')]();var auth=require(_0x01c2('0x1'));var controller=require('./version.controller');router[_0x01c2('0x2')]('/',controller[_0x01c2('0x3')]);router['get'](_0x01c2('0x4'),auth[_0x01c2('0x5')](),auth[_0x01c2('0x6')](),controller[_0x01c2('0x7')]);router[_0x01c2('0x2')](_0x01c2('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x01c2('0x9')]);router['get'](_0x01c2('0xa'),auth[_0x01c2('0x5')](),auth[_0x01c2('0x6')](),controller['pull']);router[_0x01c2('0x2')]('/restart',auth[_0x01c2('0x5')](),controller['restart']);router[_0x01c2('0x2')]('/migrations',controller[_0x01c2('0xb')]);module[_0x01c2('0xc')]=router; \ No newline at end of file +var _0x024d=['Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','/reset','isAuthenticated','pull','/restart','/migrations','migrations','express'];(function(_0x53693a,_0x3aa6a3){var _0x30775b=function(_0x882ea5){while(--_0x882ea5){_0x53693a['push'](_0x53693a['shift']());}};_0x30775b(++_0x3aa6a3);}(_0x024d,0xc3));var _0xd024=function(_0x1b7d68,_0x5c2c1b){_0x1b7d68=_0x1b7d68-0x0;var _0x2995b6=_0x024d[_0x1b7d68];return _0x2995b6;};'use strict';var express=require(_0xd024('0x0'));var router=express[_0xd024('0x1')]();var auth=require(_0xd024('0x2'));var controller=require(_0xd024('0x3'));router[_0xd024('0x4')]('/',controller[_0xd024('0x5')]);router[_0xd024('0x4')](_0xd024('0x6'),auth['isAuthenticated'](),auth[_0xd024('0x7')](),controller['fetch']);router[_0xd024('0x4')](_0xd024('0x8'),auth[_0xd024('0x9')](),auth[_0xd024('0x7')](),controller['reset']);router[_0xd024('0x4')]('/pull',auth[_0xd024('0x9')](),auth[_0xd024('0x7')](),controller[_0xd024('0xa')]);router[_0xd024('0x4')](_0xd024('0xb'),auth['isAuthenticated'](),controller['restart']);router[_0xd024('0x4')](_0xd024('0xc'),controller[_0xd024('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6d749c1..a634d0f 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 _0x35ed=['git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','.js','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.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','fetch','tags','latest','2.0.0','status','json','origin','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35ed,0xf3));var _0xd35e=function(_0x19a8eb,_0x3c20f6){_0x19a8eb=_0x19a8eb-0x0;var _0x792638=_0x35ed[_0x19a8eb];return _0x792638;};'use strict';var Umzug=require(_0xd35e('0x0'));var path=require(_0xd35e('0x1'));var fs=require('fs');var _=require(_0xd35e('0x2'));var pkginfo=require('pkginfo')(module,_0xd35e('0x3'));var compareVersions=require(_0xd35e('0x4'));var exec=require('child_process')[_0xd35e('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xd35e('0x6'));var pm2=require(_0xd35e('0x7'));var logger=require(_0xd35e('0x8'))(_0xd35e('0x9'));var git=require(_0xd35e('0xa'))(config[_0xd35e('0xb')]);exports['index']=function(_0x59ebdb,_0x317c52){var _0x1d1d48={'current':module[_0xd35e('0xc')]['version'],'phonebar':0x2};if(_0x59ebdb[_0xd35e('0xd')]&&_0x59ebdb[_0xd35e('0xd')]['latest']){return git[_0xd35e('0xe')]()[_0xd35e('0xf')](function(_0x361791,_0x5ccc5a){_0x1d1d48[_0xd35e('0x10')]=(_0x361791?module[_0xd35e('0xc')][_0xd35e('0x3')]:_0x5ccc5a[_0xd35e('0x10')])||_0xd35e('0x11');return _0x317c52[_0xd35e('0x12')](0xc8)['json'](_0x1d1d48);});}else{return _0x317c52[_0xd35e('0x12')](0xc8)[_0xd35e('0x13')](_0x1d1d48);}};exports[_0xd35e('0xe')]=function(_0x5edd0e,_0xdb5b3f){return git['fetch']([_0xd35e('0x14'),'master'],function(_0x5b5112){if(_0x5b5112){logger[_0xd35e('0x15')](_0x5b5112);return _0xdb5b3f[_0xd35e('0x12')](0x1f4)['json'](_0x5b5112);}logger['info'](_0xd35e('0x16'));return _0xdb5b3f[_0xd35e('0x12')](0xc8)[_0xd35e('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xd35e('0x17')]=function(_0x23ed4b,_0x3471e0){return git[_0xd35e('0x17')]([_0xd35e('0x18'),_0xd35e('0x19')],function(_0x45cfff){if(_0x45cfff){logger['error'](_0x45cfff);return _0x3471e0['status'](0x1f4)[_0xd35e('0x13')](_0x45cfff);}logger[_0xd35e('0x1a')](_0xd35e('0x1b'));return _0x3471e0[_0xd35e('0x12')](0xc8)['json']({'output':_0xd35e('0x1c')});});};exports[_0xd35e('0x1d')]=function(_0xcc25a8,_0x405d47){exec('npm\x20install\x20--production',function(_0x4a6092,_0x10567d,_0x604df8){logger[_0xd35e('0x1a')](_0x10567d);logger[_0xd35e('0x1a')](_0x604df8);if(_0x4a6092){logger[_0xd35e('0x15')](_0x4a6092);return _0x405d47['status'](0x1f4)[_0xd35e('0x13')](_0x4a6092);}return _0x405d47[_0xd35e('0x12')](0xc8)[_0xd35e('0x13')]({'output':_0x10567d});});};exports['restart']=function(_0x38aacd,_0x20ed01){return pm2[_0xd35e('0x1e')](_0xd35e('0x1f'))[_0xd35e('0x20')](function(_0x2e6fb4){logger['info'](_0xd35e('0x21'),_0x2e6fb4);return _0x20ed01[_0xd35e('0x12')](0xc8)['json']({'output':_0xd35e('0x22')});})[_0xd35e('0x23')](function(_0x386c21){logger[_0xd35e('0x15')](_0x386c21);return _0x20ed01['status'](0x1f4)['json'](_0x386c21);});};exports[_0xd35e('0x24')]=function(_0x59d91c,_0x4f9e29){var _0x121ea8=fs[_0xd35e('0x25')](path[_0xd35e('0x26')](config[_0xd35e('0xb')],'server',_0xd35e('0x24')));var _0x2b10e8=[];for(var _0x3bc825=0x0;_0x3bc825<_0x121ea8[_0xd35e('0x27')];_0x3bc825++){var _0x394284=_0x121ea8[_0x3bc825][_0xd35e('0x28')](_0xd35e('0x29'),'');if(compareVersions(module[_0xd35e('0xc')][_0xd35e('0x3')],_0x394284)===-0x1){_0x2b10e8['push'](_0x394284);}}if(_0x2b10e8[_0xd35e('0x27')]){var _0x13ed47=_0x2b10e8[_0xd35e('0x2a')](compareVersions);var _0x1321ea=new Umzug({'storage':_0xd35e('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0xd35e('0x2c'),'columnName':_0xd35e('0x3')},'migrations':{'params':[db[_0xd35e('0x2b')][_0xd35e('0x2d')](),db[_0xd35e('0x2b')][_0xd35e('0x2e')],function(){throw new Error(_0xd35e('0x2f'));}],'path':path['join'](config[_0xd35e('0xb')],'server',_0xd35e('0x24')),'pattern':/\.js$/}});_0x1321ea['up']({'migrations':_['map'](_0x13ed47,function(_0x5bfc67){return _0x5bfc67+'.js';})})[_0xd35e('0x20')](function(){return _0x4f9e29[_0xd35e('0x12')](0xc8)[_0xd35e('0x13')]({'output':_0xd35e('0x30')+module['exports'][_0xd35e('0x3')]+_0xd35e('0x31')+_[_0xd35e('0x32')](_0x13ed47),'migrations':_['join'](_0x13ed47)});})[_0xd35e('0x23')](function(_0x3a1872){if(_0x3a1872 instanceof db[_0xd35e('0x2b')][_0xd35e('0x33')]){return _0x4f9e29[_0xd35e('0x12')](0xc8)['json']({'output':_0xd35e('0x34')});}else{return _0x4f9e29[_0xd35e('0x12')](0x1f4)[_0xd35e('0x13')](_0x3a1872);}});}else{return _0x4f9e29['status'](0xc8)[_0xd35e('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x6960=['--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','catch','readdirSync','server','migrations','replace','.js','length','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','query','latest','tags','exports','2.0.0','status','json','fetch','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset'];(function(_0x283c3b,_0x741fa4){var _0x2ab028=function(_0x259f82){while(--_0x259f82){_0x283c3b['push'](_0x283c3b['shift']());}};_0x2ab028(++_0x741fa4);}(_0x6960,0x169));var _0x0696=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6960[_0x59ee6f];return _0x4c0979;};'use strict';var Umzug=require(_0x0696('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x0696('0x1'))(module,_0x0696('0x2'));var compareVersions=require(_0x0696('0x3'));var exec=require('child_process')[_0x0696('0x4')];var db=require(_0x0696('0x5'))['db'];var config=require(_0x0696('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x0696('0x7'))('update');var git=require(_0x0696('0x8'))(config[_0x0696('0x9')]);exports['index']=function(_0x596dc9,_0x20bc7a){var _0x4ea8d0={'current':module['exports']['version'],'phonebar':0x2};if(_0x596dc9[_0x0696('0xa')]&&_0x596dc9[_0x0696('0xa')][_0x0696('0xb')]){return git['fetch']()[_0x0696('0xc')](function(_0x3d09dd,_0x3a6862){_0x4ea8d0[_0x0696('0xb')]=(_0x3d09dd?module[_0x0696('0xd')][_0x0696('0x2')]:_0x3a6862[_0x0696('0xb')])||_0x0696('0xe');return _0x20bc7a[_0x0696('0xf')](0xc8)[_0x0696('0x10')](_0x4ea8d0);});}else{return _0x20bc7a[_0x0696('0xf')](0xc8)['json'](_0x4ea8d0);}};exports[_0x0696('0x11')]=function(_0x12190f,_0x40200d){return git[_0x0696('0x11')](['origin',_0x0696('0x12')],function(_0x4e40fd){if(_0x4e40fd){logger[_0x0696('0x13')](_0x4e40fd);return _0x40200d[_0x0696('0xf')](0x1f4)[_0x0696('0x10')](_0x4e40fd);}logger['info'](_0x0696('0x14'));return _0x40200d['status'](0xc8)[_0x0696('0x10')]({'output':_0x0696('0x15')});});};exports[_0x0696('0x16')]=function(_0x4ce6a0,_0x50a7be){return git[_0x0696('0x16')]([_0x0696('0x17'),_0x0696('0x18')],function(_0x6e3f81){if(_0x6e3f81){logger[_0x0696('0x13')](_0x6e3f81);return _0x50a7be[_0x0696('0xf')](0x1f4)['json'](_0x6e3f81);}logger[_0x0696('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x50a7be['status'](0xc8)[_0x0696('0x10')]({'output':_0x0696('0x1a')});});};exports[_0x0696('0x1b')]=function(_0x3e17d5,_0x510eca){exec('npm\x20install\x20--production',function(_0x450d74,_0x478c1a,_0x1ed38a){logger[_0x0696('0x19')](_0x478c1a);logger[_0x0696('0x19')](_0x1ed38a);if(_0x450d74){logger[_0x0696('0x13')](_0x450d74);return _0x510eca[_0x0696('0xf')](0x1f4)[_0x0696('0x10')](_0x450d74);}return _0x510eca[_0x0696('0xf')](0xc8)[_0x0696('0x10')]({'output':_0x478c1a});});};exports[_0x0696('0x1c')]=function(_0xddfd90,_0x8adf6f){return pm2[_0x0696('0x1c')]('motion2')[_0x0696('0x1d')](function(_0x24ecf4){logger[_0x0696('0x19')](_0x0696('0x1e'),_0x24ecf4);return _0x8adf6f['status'](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x0696('0x1f')](function(_0x3b04a4){logger['error'](_0x3b04a4);return _0x8adf6f[_0x0696('0xf')](0x1f4)[_0x0696('0x10')](_0x3b04a4);});};exports['migrations']=function(_0x50b7f8,_0x25c2b7){var _0x21eb93=fs[_0x0696('0x20')](path['join'](config[_0x0696('0x9')],_0x0696('0x21'),_0x0696('0x22')));var _0x57c093=[];for(var _0x336dfd=0x0;_0x336dfd<_0x21eb93['length'];_0x336dfd++){var _0x46b072=_0x21eb93[_0x336dfd][_0x0696('0x23')](_0x0696('0x24'),'');if(compareVersions(module[_0x0696('0xd')][_0x0696('0x2')],_0x46b072)===-0x1){_0x57c093['push'](_0x46b072);}}if(_0x57c093[_0x0696('0x25')]){var _0x11f377=_0x57c093['sort'](compareVersions);var _0x2a090a=new Umzug({'storage':_0x0696('0x26'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x0696('0x2')},'migrations':{'params':[db['sequelize'][_0x0696('0x27')](),db['sequelize'][_0x0696('0x28')],function(){throw new Error(_0x0696('0x29'));}],'path':path[_0x0696('0x2a')](config[_0x0696('0x9')],'server','migrations'),'pattern':/\.js$/}});_0x2a090a['up']({'migrations':_[_0x0696('0x2b')](_0x11f377,function(_0xf86d51){return _0xf86d51+_0x0696('0x24');})})[_0x0696('0x1d')](function(){return _0x25c2b7[_0x0696('0xf')](0xc8)[_0x0696('0x10')]({'output':_0x0696('0x2c')+module[_0x0696('0xd')][_0x0696('0x2')]+'\x20to\x20'+_[_0x0696('0x2d')](_0x11f377),'migrations':_[_0x0696('0x2a')](_0x11f377)});})[_0x0696('0x1f')](function(_0x223eae){if(_0x223eae instanceof db[_0x0696('0x26')][_0x0696('0x2e')]){return _0x25c2b7[_0x0696('0xf')](0xc8)[_0x0696('0x10')]({'output':_0x0696('0x2f')});}else{return _0x25c2b7[_0x0696('0xf')](0x1f4)['json'](_0x223eae);}});}else{return _0x25c2b7[_0x0696('0xf')](0xc8)[_0x0696('0x10')]({'output':_0x0696('0x2f')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 1f2833e..8f313a0 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 _0x28ff=['index','get','/describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x28ff,0x6d));var _0xf28f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x28ff[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xf28f('0x0'));var util=require(_0xf28f('0x1'));var path=require(_0xf28f('0x2'));var timeout=require(_0xf28f('0x3'));var express=require(_0xf28f('0x4'));var router=express[_0xf28f('0x5')]();var fs_extra=require(_0xf28f('0x6'));var auth=require(_0xf28f('0x7'));var interaction=require(_0xf28f('0x8'));var config=require('../../config/environment');var controller=require(_0xf28f('0x9'));router['get']('/',auth[_0xf28f('0xa')](),controller[_0xf28f('0xb')]);router[_0xf28f('0xc')](_0xf28f('0xd'),auth[_0xf28f('0xa')](),controller['describe']);router[_0xf28f('0xc')](_0xf28f('0xe'),auth[_0xf28f('0xa')](),controller[_0xf28f('0xf')]);router[_0xf28f('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf28f('0x11')]('/:id',auth[_0xf28f('0xa')](),controller['update']);router['delete']('/:id',auth[_0xf28f('0xa')](),controller[_0xf28f('0x12')]);module[_0xf28f('0x13')]=router; \ No newline at end of file +var _0xb70b=['show','post','create','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id'];(function(_0x578070,_0x1fcb84){var _0x1cdbbe=function(_0x2f3d51){while(--_0x2f3d51){_0x578070['push'](_0x578070['shift']());}};_0x1cdbbe(++_0x1fcb84);}(_0xb70b,0x1d9));var _0xbb70=function(_0x26db89,_0x5cf65e){_0x26db89=_0x26db89-0x0;var _0x407f4c=_0xb70b[_0x26db89];return _0x407f4c;};'use strict';var multer=require(_0xbb70('0x0'));var util=require(_0xbb70('0x1'));var path=require(_0xbb70('0x2'));var timeout=require(_0xbb70('0x3'));var express=require(_0xbb70('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb70('0x5'));var interaction=require(_0xbb70('0x6'));var config=require(_0xbb70('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xbb70('0x8')](),controller[_0xbb70('0x9')]);router[_0xbb70('0xa')]('/describe',auth[_0xbb70('0x8')](),controller[_0xbb70('0xb')]);router['get'](_0xbb70('0xc'),auth[_0xbb70('0x8')](),controller[_0xbb70('0xd')]);router[_0xbb70('0xe')]('/',auth[_0xbb70('0x8')](),controller[_0xbb70('0xf')]);router['put']('/:id',auth[_0xbb70('0x8')](),controller[_0xbb70('0x10')]);router[_0xbb70('0x11')](_0xbb70('0xc'),auth[_0xbb70('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 63f2471..23417a1 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 _0xb03e=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x3edb20,_0x1f08ec){var _0x885d4=function(_0x5b8191){while(--_0x5b8191){_0x3edb20['push'](_0x3edb20['shift']());}};_0x885d4(++_0x1f08ec);}(_0xb03e,0x1eb));var _0xeb03=function(_0x3f6bd1,_0x34afa1){_0x3f6bd1=_0x3f6bd1-0x0;var _0x17db50=_0xb03e[_0x3f6bd1];return _0x17db50;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'type':{'type':Sequelize[_0xeb03('0x1')]},'uniqueid':{'type':Sequelize[_0xeb03('0x1')]},'calleridnum':{'type':Sequelize[_0xeb03('0x1')]},'calleridname':{'type':Sequelize[_0xeb03('0x1')]},'queue':{'type':Sequelize[_0xeb03('0x1')]},'interface':{'type':Sequelize[_0xeb03('0x1')]},'membername':{'type':Sequelize[_0xeb03('0x1')]},'agentcalledAt':{'type':Sequelize[_0xeb03('0x2')]},'agentconnectAt':{'type':Sequelize[_0xeb03('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xeb03('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xeb03('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xeb03('0x3')]},'agentcomplete':{'type':Sequelize[_0xeb03('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xeb03('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xeb03('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xeb03('0x3')]},'agentacw':{'type':Sequelize[_0xeb03('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xeb03('0x1')]},'lastevent':{'type':Sequelize[_0xeb03('0x1')]},'channel':{'type':Sequelize[_0xeb03('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xeb03('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xeb03('0x1')]},'language':{'type':Sequelize[_0xeb03('0x1')]},'accountcode':{'type':Sequelize[_0xeb03('0x1')]},'context':{'type':Sequelize[_0xeb03('0x1')]},'exten':{'type':Sequelize[_0xeb03('0x1')]},'priority':{'type':Sequelize[_0xeb03('0x1')]},'destchannel':{'type':Sequelize[_0xeb03('0x1')]},'destchannelstate':{'type':Sequelize[_0xeb03('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xeb03('0x1')]},'destcalleridnum':{'type':Sequelize[_0xeb03('0x1')]},'destcalleridname':{'type':Sequelize[_0xeb03('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xeb03('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xeb03('0x1')]},'destaccountcode':{'type':Sequelize[_0xeb03('0x1')]},'destcontext':{'type':Sequelize[_0xeb03('0x1')]},'destexten':{'type':Sequelize[_0xeb03('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xeb03('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xeb03('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xeb03('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb03('0x1')],'comment':_0xeb03('0x5')},'transferexten':{'type':Sequelize[_0xeb03('0x1')]},'transferuniqueid':{'type':Sequelize[_0xeb03('0x1')]},'agententerreason':{'type':Sequelize[_0xeb03('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa32b=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN'];(function(_0x44cae2,_0x5021bc){var _0x55a7bc=function(_0x7c9d9f){while(--_0x7c9d9f){_0x44cae2['push'](_0x44cae2['shift']());}};_0x55a7bc(++_0x5021bc);}(_0xa32b,0x68));var _0xba32=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0xa32b[_0x29d2d2];return _0x3f6476;};'use strict';var Sequelize=require(_0xba32('0x0'));module['exports']={'type':{'type':Sequelize[_0xba32('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xba32('0x1')]},'queue':{'type':Sequelize[_0xba32('0x1')]},'interface':{'type':Sequelize[_0xba32('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xba32('0x2')]},'agentconnectAt':{'type':Sequelize[_0xba32('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xba32('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xba32('0x2')]},'agentdumpAt':{'type':Sequelize[_0xba32('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xba32('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xba32('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xba32('0x4')]},'agentacw':{'type':Sequelize[_0xba32('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xba32('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xba32('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xba32('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xba32('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xba32('0x1')]},'destchannel':{'type':Sequelize[_0xba32('0x1')]},'destchannelstate':{'type':Sequelize[_0xba32('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xba32('0x1')]},'destcalleridnum':{'type':Sequelize[_0xba32('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xba32('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xba32('0x1')]},'destlanguage':{'type':Sequelize[_0xba32('0x1')]},'destaccountcode':{'type':Sequelize[_0xba32('0x1')]},'destcontext':{'type':Sequelize[_0xba32('0x1')]},'destexten':{'type':Sequelize[_0xba32('0x1')]},'destpriority':{'type':Sequelize[_0xba32('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xba32('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xba32('0x1')]},'transfer':{'type':Sequelize[_0xba32('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xba32('0x1')],'comment':_0xba32('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 19321eb..4749b0d 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(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 a351eed..770bca0 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 _0xdb2a=['exports','define','report_agent','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./voiceAgentReport.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdb2a,0x16f));var _0xadb2=function(_0x386d23,_0x29dae2){_0x386d23=_0x386d23-0x0;var _0x548f37=_0xdb2a[_0x386d23];return _0x548f37;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb2('0x6'));module[_0xadb2('0x7')]=function(_0x1f5c7e,_0x297e69){return _0x1f5c7e[_0xadb2('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xadb2('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xadb2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0689=['uniqueid','destuniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x29c305,_0x3640f6){var _0x5a8cfc=function(_0x5b3131){while(--_0x5b3131){_0x29c305['push'](_0x29c305['shift']());}};_0x5a8cfc(++_0x3640f6);}(_0x0689,0x161));var _0x9068=function(_0x598e0e,_0x3607d3){_0x598e0e=_0x598e0e-0x0;var _0x11318c=_0x0689[_0x598e0e];return _0x11318c;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9068('0xb'),_0x9068('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 48c2ac6..f96f678 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 _0xc837=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport','options','raw','debug','stringify','update','body','attributes','limit','UpdateVoiceAgentReport','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5999ba,_0x97b26a){var _0x2140b5=function(_0x23b3fb){while(--_0x23b3fb){_0x5999ba['push'](_0x5999ba['shift']());}};_0x2140b5(++_0x97b26a);}(_0xc837,0x102));var _0x7c83=function(_0x5cb35f,_0x7e8da9){_0x5cb35f=_0x5cb35f-0x0;var _0x2a8213=_0xc837[_0x5cb35f];return _0x2a8213;};'use strict';var _=require('lodash');var util=require(_0x7c83('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c83('0x1'));var fs=require('fs');var Redis=require(_0x7c83('0x2'));var db=require(_0x7c83('0x3'))['db'];var utils=require(_0x7c83('0x4'));var logger=require(_0x7c83('0x5'))(_0x7c83('0x6'));var config=require(_0x7c83('0x7'));var jayson=require(_0x7c83('0x8'));var client=jayson[_0x7c83('0x9')][_0x7c83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e464a,_0x52e448,_0x3b1a2f){return new BPromise(function(_0x21642b,_0x21d421){return client[_0x7c83('0xb')](_0x5e464a,_0x3b1a2f)['then'](function(_0x39486d){logger['info'](_0x7c83('0xc'),_0x52e448,_0x7c83('0xd'));logger['debug'](_0x7c83('0xe'),_0x52e448,_0x7c83('0xd'),JSON['stringify'](_0x39486d));if(_0x39486d[_0x7c83('0xf')]){if(_0x39486d['error']['code']===0x1f4){logger[_0x7c83('0xf')](_0x7c83('0xc'),_0x52e448,_0x39486d[_0x7c83('0xf')][_0x7c83('0x10')]);return _0x21d421(_0x39486d[_0x7c83('0xf')][_0x7c83('0x10')]);}logger[_0x7c83('0xf')](_0x7c83('0xc'),_0x52e448,_0x39486d[_0x7c83('0xf')][_0x7c83('0x10')]);return _0x21642b(_0x39486d[_0x7c83('0xf')][_0x7c83('0x10')]);}else{logger[_0x7c83('0x11')](_0x7c83('0xc'),_0x52e448,_0x7c83('0xd'));_0x21642b(_0x39486d['result'][_0x7c83('0x10')]);}})[_0x7c83('0x12')](function(_0x580f8b){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x52e448,_0x580f8b);_0x21d421(_0x580f8b);});});}exports[_0x7c83('0x13')]=function(_0x572eed){var _0x4752d3=this;return new Promise(function(_0x45665a,_0x1d0072){return db[_0x7c83('0x14')]['create'](_0x572eed['body'],{'raw':_0x572eed[_0x7c83('0x15')]?_0x572eed[_0x7c83('0x15')][_0x7c83('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3342a3){logger[_0x7c83('0x11')](_0x7c83('0x13'),_0x572eed);logger[_0x7c83('0x17')](_0x7c83('0x13'),_0x572eed,JSON[_0x7c83('0x18')](_0x3342a3));_0x45665a(_0x3342a3);})['catch'](function(_0x28e96c){logger['error']('CreateVoiceAgentReport',_0x28e96c[_0x7c83('0x10')],_0x572eed);_0x1d0072(_0x4752d3[_0x7c83('0xf')](0x1f4,_0x28e96c[_0x7c83('0x10')]));});});};exports['UpdateVoiceAgentReport']=function(_0x5b885c){var _0xf698b4=this;return new Promise(function(_0x57e39f,_0x2d1ee9){return db[_0x7c83('0x14')][_0x7c83('0x19')](_0x5b885c[_0x7c83('0x1a')],{'raw':_0x5b885c[_0x7c83('0x15')]?_0x5b885c[_0x7c83('0x15')][_0x7c83('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b885c['options']?_0x5b885c[_0x7c83('0x15')]['where']||null:null,'attributes':_0x5b885c[_0x7c83('0x15')]?_0x5b885c['options'][_0x7c83('0x1b')]||null:null,'limit':_0x5b885c[_0x7c83('0x15')]?_0x5b885c[_0x7c83('0x15')][_0x7c83('0x1c')]||null:null})['then'](function(_0x1193f0){logger[_0x7c83('0x11')](_0x7c83('0x1d'),_0x5b885c);logger[_0x7c83('0x17')](_0x7c83('0x1d'),_0x5b885c,JSON[_0x7c83('0x18')](_0x1193f0));_0x57e39f(_0x1193f0);})[_0x7c83('0x12')](function(_0x26862d){logger['error'](_0x7c83('0x1d'),_0x26862d[_0x7c83('0x10')],_0x5b885c);_0x2d1ee9(_0xf698b4['error'](0x1f4,_0x26862d[_0x7c83('0x10')]));});});}; \ No newline at end of file +var _0x35ae=['result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','UpdateVoiceAgentReport','where','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x35ae,0x13f));var _0xe35a=function(_0x1f4666,_0x4c2268){_0x1f4666=_0x1f4666-0x0;var _0x4bb480=_0x35ae[_0x1f4666];return _0x4bb480;};'use strict';var _=require('lodash');var util=require(_0xe35a('0x0'));var moment=require(_0xe35a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe35a('0x2'));var fs=require('fs');var Redis=require(_0xe35a('0x3'));var db=require(_0xe35a('0x4'))['db'];var utils=require(_0xe35a('0x5'));var logger=require(_0xe35a('0x6'))(_0xe35a('0x7'));var config=require(_0xe35a('0x8'));var jayson=require(_0xe35a('0x9'));var client=jayson['client'][_0xe35a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x224a12,_0x49299b,_0x575207){return new BPromise(function(_0xb74b24,_0x11d7ea){return client[_0xe35a('0xb')](_0x224a12,_0x575207)[_0xe35a('0xc')](function(_0x192658){logger[_0xe35a('0xd')](_0xe35a('0xe'),_0x49299b,_0xe35a('0xf'));logger[_0xe35a('0x10')](_0xe35a('0x11'),_0x49299b,_0xe35a('0xf'),JSON[_0xe35a('0x12')](_0x192658));if(_0x192658[_0xe35a('0x13')]){if(_0x192658[_0xe35a('0x13')][_0xe35a('0x14')]===0x1f4){logger[_0xe35a('0x13')](_0xe35a('0xe'),_0x49299b,_0x192658['error'][_0xe35a('0x15')]);return _0x11d7ea(_0x192658[_0xe35a('0x13')][_0xe35a('0x15')]);}logger[_0xe35a('0x13')](_0xe35a('0xe'),_0x49299b,_0x192658[_0xe35a('0x13')]['message']);return _0xb74b24(_0x192658['error'][_0xe35a('0x15')]);}else{logger['info'](_0xe35a('0xe'),_0x49299b,_0xe35a('0xf'));_0xb74b24(_0x192658[_0xe35a('0x16')][_0xe35a('0x15')]);}})[_0xe35a('0x17')](function(_0x1cc598){logger[_0xe35a('0x13')](_0xe35a('0xe'),_0x49299b,_0x1cc598);_0x11d7ea(_0x1cc598);});});}exports[_0xe35a('0x18')]=function(_0x1d65f3){var _0xd865d5=this;return new Promise(function(_0x3e6b81,_0x28d890){return db[_0xe35a('0x19')]['create'](_0x1d65f3[_0xe35a('0x1a')],{'raw':_0x1d65f3['options']?_0x1d65f3[_0xe35a('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x437ed1){logger['info'](_0xe35a('0x18'),_0x1d65f3);logger[_0xe35a('0x10')]('CreateVoiceAgentReport',_0x1d65f3,JSON['stringify'](_0x437ed1));_0x3e6b81(_0x437ed1);})[_0xe35a('0x17')](function(_0x4c2a7d){logger['error']('CreateVoiceAgentReport',_0x4c2a7d[_0xe35a('0x15')],_0x1d65f3);_0x28d890(_0xd865d5[_0xe35a('0x13')](0x1f4,_0x4c2a7d[_0xe35a('0x15')]));});});};exports[_0xe35a('0x1c')]=function(_0xf84a03){var _0x1f2d90=this;return new Promise(function(_0x20f787,_0x396367){return db[_0xe35a('0x19')]['update'](_0xf84a03['body'],{'raw':_0xf84a03[_0xe35a('0x1b')]?_0xf84a03[_0xe35a('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf84a03[_0xe35a('0x1b')]?_0xf84a03[_0xe35a('0x1b')][_0xe35a('0x1d')]||null:null,'attributes':_0xf84a03[_0xe35a('0x1b')]?_0xf84a03[_0xe35a('0x1b')]['attributes']||null:null,'limit':_0xf84a03[_0xe35a('0x1b')]?_0xf84a03['options'][_0xe35a('0x1e')]||null:null})[_0xe35a('0xc')](function(_0x833c80){logger[_0xe35a('0xd')](_0xe35a('0x1c'),_0xf84a03);logger[_0xe35a('0x10')]('UpdateVoiceAgentReport',_0xf84a03,JSON[_0xe35a('0x12')](_0x833c80));_0x20f787(_0x833c80);})[_0xe35a('0x17')](function(_0x251d49){logger[_0xe35a('0x13')](_0xe35a('0x1c'),_0x251d49[_0xe35a('0x15')],_0xf84a03);_0x396367(_0x1f2d90[_0xe35a('0x13')](0x1f4,_0x251d49[_0xe35a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0cf86f6..46b9828 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 _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4ad37c,_0x2e7490){var _0x288919=function(_0x3988a2){while(--_0x3988a2){_0x4ad37c['push'](_0x4ad37c['shift']());}};_0x288919(++_0x2e7490);}(_0xf006,0x146));var _0x6f00=function(_0x1fbb0c,_0x41a37f){_0x1fbb0c=_0x1fbb0c-0x0;var _0x517125=_0xf006[_0x1fbb0c];return _0x517125;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=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(_0x28b55a,_0x1a2e62){var _0x5ea7f8=function(_0x563ac0){while(--_0x563ac0){_0x28b55a['push'](_0x28b55a['shift']());}};_0x5ea7f8(++_0x1a2e62);}(_0xcb66,0x19f));var _0x6cb6=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xcb66[_0x29d94e];return _0x106237;};'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 d1a1ba7..89bd610 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 _0x1280=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer'];(function(_0x112a3e,_0x23f15c){var _0x577bfc=function(_0x4c47c0){while(--_0x4c47c0){_0x112a3e['push'](_0x112a3e['shift']());}};_0x577bfc(++_0x23f15c);}(_0x1280,0xac));var _0x0128=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x1280[_0x5ad220];return _0xdec77d;};'use strict';var Sequelize=require(_0x0128('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0128('0x1')]},'type':{'type':Sequelize[_0x0128('0x2')](_0x0128('0x3'),_0x0128('0x4'),_0x0128('0x5'),_0x0128('0x6'),'outbound-fax',_0x0128('0x7'))},'tag':{'type':Sequelize[_0x0128('0x1')]},'accountcode':{'type':Sequelize[_0x0128('0x1')]},'source':{'type':Sequelize[_0x0128('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0128('0x1')]},'channel':{'type':Sequelize[_0x0128('0x1')]},'destinationchannel':{'type':Sequelize[_0x0128('0x1')]},'lastapplication':{'type':Sequelize[_0x0128('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x0128('0x8')]},'systemanswertime':{'type':Sequelize[_0x0128('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0128('0x8')]},'duration':{'type':Sequelize[_0x0128('0x9')]},'billableseconds':{'type':Sequelize[_0x0128('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0128('0x1')]},'userfield':{'type':Sequelize[_0x0128('0x1')]},'userDisposition':{'type':Sequelize[_0x0128('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x0128('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0128('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x0128('0x1')]}}; \ No newline at end of file +var _0xfd0c=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','inbound-fax'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfd0c,0x139));var _0xcfd0=function(_0x36888d,_0x22988e){_0x36888d=_0x36888d-0x0;var _0x14f524=_0xfd0c[_0x36888d];return _0x14f524;};'use strict';var Sequelize=require(_0xcfd0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcfd0('0x1')]},'type':{'type':Sequelize[_0xcfd0('0x2')](_0xcfd0('0x3'),_0xcfd0('0x4'),'outbound',_0xcfd0('0x5'),_0xcfd0('0x6'),_0xcfd0('0x7'))},'tag':{'type':Sequelize[_0xcfd0('0x1')]},'accountcode':{'type':Sequelize[_0xcfd0('0x1')]},'source':{'type':Sequelize[_0xcfd0('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xcfd0('0x1')]},'callerid':{'type':Sequelize[_0xcfd0('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xcfd0('0x1')]},'lastdata':{'type':Sequelize[_0xcfd0('0x8')]},'starttime':{'type':Sequelize[_0xcfd0('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xcfd0('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xcfd0('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcfd0('0x1')]},'amaflags':{'type':Sequelize[_0xcfd0('0x1')]},'userfield':{'type':Sequelize[_0xcfd0('0x1')]},'userDisposition':{'type':Sequelize[_0xcfd0('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xcfd0('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xcfd0('0x1')]},'routeid':{'type':Sequelize[_0xcfd0('0xa')]},'sipcallid':{'type':Sequelize[_0xcfd0('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0a8adf8..7d2549e 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 _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(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xadb5,0xad));var _0x5adb=function(_0x51c00b,_0x90cdb1){_0x51c00b=_0x51c00b-0x0;var _0x358950=_0xadb5[_0x51c00b];return _0x358950;};'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 +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x3ecf3f,_0x1709c9){var _0x1c6c85=function(_0x576ff8){while(--_0x576ff8){_0x3ecf3f['push'](_0x3ecf3f['shift']());}};_0x1c6c85(++_0x1709c9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58803c,_0x4a34df){_0x58803c=_0x58803c-0x0;var _0xf95b9b=_0x0b0e[_0x58803c];return _0xf95b9b;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 7632224..3ba4636 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 _0x1d89=['define','VoiceCallReport','report_call','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xe0f5da,_0x41478a){var _0x32685c=function(_0x177460){while(--_0x177460){_0xe0f5da['push'](_0xe0f5da['shift']());}};_0x32685c(++_0x41478a);}(_0x1d89,0x18f));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require('util');var logger=require(_0x91d8('0x1'))(_0x91d8('0x2'));var moment=require(_0x91d8('0x3'));var BPromise=require(_0x91d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91d8('0x5'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x2940a8,_0x4cdfed){return _0x2940a8[_0x91d8('0x6')](_0x91d8('0x7'),attributes,{'tableName':_0x91d8('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x14e2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_call','uniqueid','lodash'];(function(_0x14568d,_0x26fbc6){var _0x533662=function(_0xb6c6ef){while(--_0xb6c6ef){_0x14568d['push'](_0x14568d['shift']());}};_0x533662(++_0x26fbc6);}(_0x14e2,0x12b));var _0x214e=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x14e2[_0x22093a];return _0x2f4989;};'use strict';var _=require(_0x214e('0x0'));var util=require('util');var logger=require(_0x214e('0x1'))(_0x214e('0x2'));var moment=require(_0x214e('0x3'));var BPromise=require(_0x214e('0x4'));var rp=require(_0x214e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x214e('0x6'));var config=require(_0x214e('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x214e('0x8')]=function(_0x51d772,_0x429dcd){return _0x51d772[_0x214e('0x9')]('VoiceCallReport',attributes,{'tableName':_0x214e('0xa'),'paranoid':![],'indexes':[{'fields':[_0x214e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 68e0f48..5637d2c 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 _0xcb5e=['../../config/environment','jayson/promise','client','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceCallReport','stringify','create','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0xcb5e,0x69));var _0xecb5=function(_0x5abfd6,_0x37a1bd){_0x5abfd6=_0x5abfd6-0x0;var _0x354885=_0xcb5e[_0x5abfd6];return _0x354885;};'use strict';var _=require(_0xecb5('0x0'));var util=require(_0xecb5('0x1'));var moment=require(_0xecb5('0x2'));var BPromise=require(_0xecb5('0x3'));var rs=require(_0xecb5('0x4'));var fs=require('fs');var Redis=require(_0xecb5('0x5'));var db=require(_0xecb5('0x6'))['db'];var utils=require(_0xecb5('0x7'));var logger=require(_0xecb5('0x8'))('rpc');var config=require(_0xecb5('0x9'));var jayson=require(_0xecb5('0xa'));var client=jayson[_0xecb5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0ddcb,_0x2a30a4,_0x51ba87){return new BPromise(function(_0x3e1934,_0x4df274){return client['request'](_0xa0ddcb,_0x51ba87)['then'](function(_0x4c9257){logger[_0xecb5('0xc')](_0xecb5('0xd'),_0x2a30a4,'request\x20sent');logger[_0xecb5('0xe')](_0xecb5('0xf'),_0x2a30a4,'request\x20sent',JSON['stringify'](_0x4c9257));if(_0x4c9257[_0xecb5('0x10')]){if(_0x4c9257[_0xecb5('0x10')]['code']===0x1f4){logger[_0xecb5('0x10')](_0xecb5('0xd'),_0x2a30a4,_0x4c9257[_0xecb5('0x10')]['message']);return _0x4df274(_0x4c9257[_0xecb5('0x10')]['message']);}logger[_0xecb5('0x10')](_0xecb5('0xd'),_0x2a30a4,_0x4c9257[_0xecb5('0x10')][_0xecb5('0x11')]);return _0x3e1934(_0x4c9257['error'][_0xecb5('0x11')]);}else{logger[_0xecb5('0xc')](_0xecb5('0xd'),_0x2a30a4,_0xecb5('0x12'));_0x3e1934(_0x4c9257[_0xecb5('0x13')]['message']);}})[_0xecb5('0x14')](function(_0x51cd39){logger[_0xecb5('0x10')](_0xecb5('0xd'),_0x2a30a4,_0x51cd39);_0x4df274(_0x51cd39);});});}exports['GetVoiceCallReport']=function(_0x25ad7e){var _0x2230e2=this;return new Promise(function(_0x138de1,_0x1374a8){return db[_0xecb5('0x15')][_0xecb5('0x16')]({'raw':_0x25ad7e['options']?_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x18')]===undefined?!![]:![]:!![],'where':_0x25ad7e[_0xecb5('0x17')]?_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x19')]||null:null,'attributes':_0x25ad7e[_0xecb5('0x17')]?_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x1a')]||null:null,'limit':_0x25ad7e['options']?_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x1b')]||null:null,'include':_0x25ad7e[_0xecb5('0x17')]?_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x1c')]?_[_0xecb5('0x1d')](_0x25ad7e[_0xecb5('0x17')][_0xecb5('0x1c')],function(_0x5b8c27){return{'model':db[_0x5b8c27[_0xecb5('0x1e')]],'as':_0x5b8c27['as'],'attributes':_0x5b8c27[_0xecb5('0x1a')],'include':_0x5b8c27[_0xecb5('0x1c')]?_['map'](_0x5b8c27[_0xecb5('0x1c')],function(_0x12397f){return{'model':db[_0x12397f[_0xecb5('0x1e')]],'as':_0x12397f['as'],'attributes':_0x12397f[_0xecb5('0x1a')],'include':_0x12397f[_0xecb5('0x1c')]?_[_0xecb5('0x1d')](_0x12397f[_0xecb5('0x1c')],function(_0x50785d){return{'model':db[_0x50785d[_0xecb5('0x1e')]],'as':_0x50785d['as'],'attributes':_0x50785d['attributes']};}):[]};}):[]};}):[]:[]})[_0xecb5('0x1f')](function(_0x101e65){logger[_0xecb5('0xc')](_0xecb5('0x20'),_0x25ad7e);logger[_0xecb5('0xe')]('GetVoiceCallReport',_0x25ad7e,JSON[_0xecb5('0x21')](_0x101e65));_0x138de1(_0x101e65);})[_0xecb5('0x14')](function(_0x21cc92){logger[_0xecb5('0x10')](_0xecb5('0x20'),_0x21cc92['message'],_0x25ad7e);_0x1374a8(_0x2230e2['error'](0x1f4,_0x21cc92[_0xecb5('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x20a8a3){var _0x15070f=this;return new Promise(function(_0x337674,_0xb0c9f2){return db[_0xecb5('0x15')][_0xecb5('0x22')](_0x20a8a3['body'],{'raw':_0x20a8a3[_0xecb5('0x17')]?_0x20a8a3['options'][_0xecb5('0x18')]===undefined?!![]:![]:!![]})[_0xecb5('0x1f')](function(_0x3b59ec){logger[_0xecb5('0xc')](_0xecb5('0x23'),_0x20a8a3);logger[_0xecb5('0xe')](_0xecb5('0x23'),_0x20a8a3,JSON[_0xecb5('0x21')](_0x3b59ec));_0x337674(_0x3b59ec);})[_0xecb5('0x14')](function(_0xdb61b4){logger[_0xecb5('0x10')]('CreateVoiceCallReport',_0xdb61b4[_0xecb5('0x11')],_0x20a8a3);_0xb0c9f2(_0x15070f[_0xecb5('0x10')](0x1f4,_0xdb61b4['message']));});});};exports[_0xecb5('0x24')]=function(_0x5a3906){var _0x38355f=this;return new Promise(function(_0x54cf43,_0xb92b37){return db['VoiceCallReport'][_0xecb5('0x25')](_0x5a3906['body'],{'raw':_0x5a3906[_0xecb5('0x17')]?_0x5a3906[_0xecb5('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a3906[_0xecb5('0x17')]?_0x5a3906[_0xecb5('0x17')][_0xecb5('0x19')]||null:null,'attributes':_0x5a3906[_0xecb5('0x17')]?_0x5a3906['options'][_0xecb5('0x1a')]||null:null,'limit':_0x5a3906[_0xecb5('0x17')]?_0x5a3906['options'][_0xecb5('0x1b')]||null:null})['then'](function(_0x2f73ab){logger[_0xecb5('0xc')](_0xecb5('0x24'),_0x5a3906);logger['debug'](_0xecb5('0x24'),_0x5a3906,JSON[_0xecb5('0x21')](_0x2f73ab));_0x54cf43(_0x2f73ab);})[_0xecb5('0x14')](function(_0x5ad299){logger['error'](_0xecb5('0x24'),_0x5ad299[_0xecb5('0x11')],_0x5a3906);_0xb92b37(_0x38355f[_0xecb5('0x10')](0x1f4,_0x5ad299[_0xecb5('0x11')]));});});}; \ No newline at end of file +var _0xde10=['attributes','model','map','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include'];(function(_0x48f465,_0x57cf10){var _0x1eaf5c=function(_0x207b01){while(--_0x207b01){_0x48f465['push'](_0x48f465['shift']());}};_0x1eaf5c(++_0x57cf10);}(_0xde10,0x71));var _0x0de1=function(_0x1a1420,_0x11414d){_0x1a1420=_0x1a1420-0x0;var _0x10f6a0=_0xde10[_0x1a1420];return _0x10f6a0;};'use strict';var _=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0de1('0x2'));var fs=require('fs');var Redis=require(_0x0de1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0de1('0x4'));var logger=require(_0x0de1('0x5'))(_0x0de1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0de1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50d4fc,_0x50895a,_0xf357f4){return new BPromise(function(_0x1483ec,_0x3a3705){return client[_0x0de1('0x8')](_0x50d4fc,_0xf357f4)['then'](function(_0x38f157){logger['info'](_0x0de1('0x9'),_0x50895a,'request\x20sent');logger[_0x0de1('0xa')](_0x0de1('0xb'),_0x50895a,_0x0de1('0xc'),JSON[_0x0de1('0xd')](_0x38f157));if(_0x38f157[_0x0de1('0xe')]){if(_0x38f157[_0x0de1('0xe')][_0x0de1('0xf')]===0x1f4){logger['error'](_0x0de1('0x9'),_0x50895a,_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);return _0x3a3705(_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);}logger[_0x0de1('0xe')](_0x0de1('0x9'),_0x50895a,_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);return _0x1483ec(_0x38f157[_0x0de1('0xe')][_0x0de1('0x10')]);}else{logger[_0x0de1('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x50895a,'request\x20sent');_0x1483ec(_0x38f157['result']['message']);}})[_0x0de1('0x12')](function(_0x3c50e8){logger['error'](_0x0de1('0x9'),_0x50895a,_0x3c50e8);_0x3a3705(_0x3c50e8);});});}exports[_0x0de1('0x13')]=function(_0x55a12a){var _0x1baec0=this;return new Promise(function(_0x51fdce,_0x4d702d){return db[_0x0de1('0x14')][_0x0de1('0x15')]({'raw':_0x55a12a[_0x0de1('0x16')]?_0x55a12a['options'][_0x0de1('0x17')]===undefined?!![]:![]:!![],'where':_0x55a12a[_0x0de1('0x16')]?_0x55a12a[_0x0de1('0x16')][_0x0de1('0x18')]||null:null,'attributes':_0x55a12a[_0x0de1('0x16')]?_0x55a12a[_0x0de1('0x16')]['attributes']||null:null,'limit':_0x55a12a[_0x0de1('0x16')]?_0x55a12a['options'][_0x0de1('0x19')]||null:null,'include':_0x55a12a['options']?_0x55a12a[_0x0de1('0x16')][_0x0de1('0x1a')]?_['map'](_0x55a12a[_0x0de1('0x16')][_0x0de1('0x1a')],function(_0x26c24c){return{'model':db[_0x26c24c['model']],'as':_0x26c24c['as'],'attributes':_0x26c24c[_0x0de1('0x1b')],'include':_0x26c24c[_0x0de1('0x1a')]?_['map'](_0x26c24c[_0x0de1('0x1a')],function(_0x3ad07f){return{'model':db[_0x3ad07f[_0x0de1('0x1c')]],'as':_0x3ad07f['as'],'attributes':_0x3ad07f[_0x0de1('0x1b')],'include':_0x3ad07f[_0x0de1('0x1a')]?_[_0x0de1('0x1d')](_0x3ad07f['include'],function(_0x56cd91){return{'model':db[_0x56cd91[_0x0de1('0x1c')]],'as':_0x56cd91['as'],'attributes':_0x56cd91[_0x0de1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0de1('0x1e')](function(_0x273df8){logger[_0x0de1('0x11')]('GetVoiceCallReport',_0x55a12a);logger[_0x0de1('0xa')](_0x0de1('0x13'),_0x55a12a,JSON['stringify'](_0x273df8));_0x51fdce(_0x273df8);})[_0x0de1('0x12')](function(_0x3c29b4){logger[_0x0de1('0xe')](_0x0de1('0x13'),_0x3c29b4[_0x0de1('0x10')],_0x55a12a);_0x4d702d(_0x1baec0['error'](0x1f4,_0x3c29b4[_0x0de1('0x10')]));});});};exports[_0x0de1('0x1f')]=function(_0x1ccd48){var _0x5d7734=this;return new Promise(function(_0xa12cd4,_0xdabc6d){return db[_0x0de1('0x14')][_0x0de1('0x20')](_0x1ccd48[_0x0de1('0x21')],{'raw':_0x1ccd48[_0x0de1('0x16')]?_0x1ccd48['options'][_0x0de1('0x17')]===undefined?!![]:![]:!![]})[_0x0de1('0x1e')](function(_0x45178e){logger[_0x0de1('0x11')](_0x0de1('0x1f'),_0x1ccd48);logger[_0x0de1('0xa')](_0x0de1('0x1f'),_0x1ccd48,JSON['stringify'](_0x45178e));_0xa12cd4(_0x45178e);})['catch'](function(_0x227ce4){logger[_0x0de1('0xe')](_0x0de1('0x1f'),_0x227ce4[_0x0de1('0x10')],_0x1ccd48);_0xdabc6d(_0x5d7734[_0x0de1('0xe')](0x1f4,_0x227ce4[_0x0de1('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x2fb97a){var _0x32f5c5=this;return new Promise(function(_0x340173,_0xba76dd){return db[_0x0de1('0x14')]['update'](_0x2fb97a['body'],{'raw':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a[_0x0de1('0x16')][_0x0de1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a['options'][_0x0de1('0x18')]||null:null,'attributes':_0x2fb97a[_0x0de1('0x16')]?_0x2fb97a['options'][_0x0de1('0x1b')]||null:null,'limit':_0x2fb97a['options']?_0x2fb97a[_0x0de1('0x16')]['limit']||null:null})[_0x0de1('0x1e')](function(_0x3121fe){logger[_0x0de1('0x11')](_0x0de1('0x22'),_0x2fb97a);logger[_0x0de1('0xa')](_0x0de1('0x22'),_0x2fb97a,JSON[_0x0de1('0xd')](_0x3121fe));_0x340173(_0x3121fe);})[_0x0de1('0x12')](function(_0x33ea19){logger['error'](_0x0de1('0x22'),_0x33ea19[_0x0de1('0x10')],_0x2fb97a);_0xba76dd(_0x32f5c5['error'](0x1f4,_0x33ea19['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 5fa7577..2203e9e 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 _0xe127=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x442a27,_0x450968){var _0x24a0ed=function(_0x174b0d){while(--_0x174b0d){_0x442a27['push'](_0x442a27['shift']());}};_0x24a0ed(++_0x450968);}(_0xe127,0x19e));var _0x7e12=function(_0x24387f,_0x115d8e){_0x24387f=_0x24387f-0x0;var _0x4067f9=_0xe127[_0x24387f];return _0x4067f9;};'use strict';var multer=require('multer');var util=require(_0x7e12('0x0'));var path=require(_0x7e12('0x1'));var timeout=require(_0x7e12('0x2'));var express=require(_0x7e12('0x3'));var router=express['Router']();var fs_extra=require(_0x7e12('0x4'));var auth=require(_0x7e12('0x5'));var interaction=require(_0x7e12('0x6'));var config=require(_0x7e12('0x7'));var controller=require(_0x7e12('0x8'));router[_0x7e12('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e12('0xa')]);router['get'](_0x7e12('0xb'),auth[_0x7e12('0xc')](),controller[_0x7e12('0xd')]);router[_0x7e12('0xe')]('/',auth[_0x7e12('0xc')](),controller[_0x7e12('0xf')]);router['put'](_0x7e12('0xb'),auth['isAuthenticated'](),controller[_0x7e12('0x10')]);router[_0x7e12('0x11')]('/:id',auth[_0x7e12('0xc')](),controller[_0x7e12('0x12')]);module[_0x7e12('0x13')]=router; \ No newline at end of file +var _0xf151=['get','isAuthenticated','index','/:id','show','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2217ae,_0x102af2){var _0x4b9ced=function(_0x187f25){while(--_0x187f25){_0x2217ae['push'](_0x2217ae['shift']());}};_0x4b9ced(++_0x102af2);}(_0xf151,0x183));var _0x1f15=function(_0x3dc320,_0x51a587){_0x3dc320=_0x3dc320-0x0;var _0x5d8f4f=_0xf151[_0x3dc320];return _0x5d8f4f;};'use strict';var multer=require('multer');var util=require(_0x1f15('0x0'));var path=require(_0x1f15('0x1'));var timeout=require(_0x1f15('0x2'));var express=require(_0x1f15('0x3'));var router=express[_0x1f15('0x4')]();var fs_extra=require(_0x1f15('0x5'));var auth=require(_0x1f15('0x6'));var interaction=require(_0x1f15('0x7'));var config=require(_0x1f15('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x1f15('0x9')]('/',auth[_0x1f15('0xa')](),controller[_0x1f15('0xb')]);router[_0x1f15('0x9')](_0x1f15('0xc'),auth[_0x1f15('0xa')](),controller[_0x1f15('0xd')]);router['post']('/',auth[_0x1f15('0xa')](),controller['create']);router[_0x1f15('0xe')]('/:id',auth[_0x1f15('0xa')](),controller[_0x1f15('0xf')]);router['delete'](_0x1f15('0xc'),auth['isAuthenticated'](),controller[_0x1f15('0x10')]);module[_0x1f15('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index d903260..9748c4d 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 _0x8b2b=['STRING','name','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x59dea0,_0x5b17ee){var _0x5ceaa7=function(_0x475c64){while(--_0x475c64){_0x59dea0['push'](_0x59dea0['shift']());}};_0x5ceaa7(++_0x5b17ee);}(_0x8b2b,0xf7));var _0xb8b2=function(_0x597621,_0x18432d){_0x597621=_0x597621-0x0;var _0x4f95a6=_0x8b2b[_0x597621];return _0x4f95a6;};'use strict';var Sequelize=require(_0xb8b2('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8b2('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xb8b2('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xb8b2('0x1')],'set':function(_0x278cbf){this['setDataValue'](_0xb8b2('0x3'),_0x278cbf?_0x278cbf[_0xb8b2('0x4')](''):[]);},'get':function(){return this[_0xb8b2('0x5')]('options')?this['getDataValue'](_0xb8b2('0x3'))[_0xb8b2('0x6')](''):[];}},'auth':{'type':Sequelize[_0xb8b2('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xb8b2('0x1')]},'record':{'type':Sequelize[_0xb8b2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb8b2('0x1')]},'description':{'type':Sequelize[_0xb8b2('0x1')]}}; \ No newline at end of file +var _0xcb3e=['exports','STRING','name','setDataValue','getDataValue','options','split','BOOLEAN','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xcb3e,0x155));var _0xecb3=function(_0x148dff,_0x4d4a74){_0x148dff=_0x148dff-0x0;var _0x1019f5=_0xcb3e[_0x148dff];return _0x1019f5;};'use strict';var Sequelize=require(_0xecb3('0x0'));module[_0xecb3('0x1')]={'name':{'type':Sequelize[_0xecb3('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xecb3('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x384e17){this[_0xecb3('0x4')]('options',_0x384e17?_0x384e17['join'](''):[]);},'get':function(){return this[_0xecb3('0x5')]('options')?this[_0xecb3('0x5')](_0xecb3('0x6'))[_0xecb3('0x7')](''):[];}},'auth':{'type':Sequelize[_0xecb3('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xecb3('0x2')]},'record':{'type':Sequelize[_0xecb3('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xecb3('0x2')]},'description':{'type':Sequelize[_0xecb3('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7468f4f..41a54b7 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 _0x1b73=['map','VoiceChanSpy','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index'];(function(_0x4d7530,_0xdee31){var _0x1afc9e=function(_0x2a0c56){while(--_0x2a0c56){_0x4d7530['push'](_0x4d7530['shift']());}};_0x1afc9e(++_0xdee31);}(_0x1b73,0x1d5));var _0x31b7=function(_0x3423f1,_0x3326df){_0x3423f1=_0x3423f1-0x0;var _0x8aeeb=_0x1b73[_0x3423f1];return _0x8aeeb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){var _0x35a51f=_0x3b0eff[_0x31b7('0x28')]({'plain':!![]});var _0x2c993b='ChanSpies';return db[_0x31b7('0x29')]['destroy']({'where':{'type':_0x2c993b,'resourceId':_0x35a51f['id']}})[_0x31b7('0x27')](function(){return _0x3b0eff;});})[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0xffacb,_0x128865){return function(_0x21ab03){if(!_0x21ab03){_0xffacb[_0x31b7('0x1a')](0x194);}return _0x21ab03;};}function handleError(_0x4e58e5,_0x47ef33){_0x47ef33=_0x47ef33||0x1f4;return function(_0x503549){logger[_0x31b7('0x2a')](_0x503549[_0x31b7('0x2b')]);if(_0x503549[_0x31b7('0x2c')]){delete _0x503549['name'];}_0x4e58e5[_0x31b7('0x1b')](_0x47ef33)[_0x31b7('0x2d')](_0x503549);};}exports[_0x31b7('0x2e')]=function(_0x277273,_0x58a87e){var _0x5b0ed2={},_0x34c62a={},_0x4b5cf9={'count':0x0,'rows':[]};var _0x574dfe=_[_0x31b7('0x2f')](db[_0x31b7('0x30')][_0x31b7('0x31')],function(_0x35f83c){return{'name':_0x35f83c['fieldName'],'type':_0x35f83c['type'][_0x31b7('0x32')]};});_0x34c62a[_0x31b7('0x33')]=_[_0x31b7('0x2f')](_0x574dfe,_0x31b7('0x2c'));_0x34c62a[_0x31b7('0x34')]=_['keys'](_0x277273['query']);_0x34c62a[_0x31b7('0x35')]=_[_0x31b7('0x36')](_0x34c62a['model'],_0x34c62a[_0x31b7('0x34')]);_0x5b0ed2[_0x31b7('0x37')]=_['intersection'](_0x34c62a[_0x31b7('0x33')],qs[_0x31b7('0x38')](_0x277273[_0x31b7('0x34')][_0x31b7('0x38')]));_0x5b0ed2[_0x31b7('0x37')]=_0x5b0ed2[_0x31b7('0x37')][_0x31b7('0x39')]?_0x5b0ed2[_0x31b7('0x37')]:_0x34c62a[_0x31b7('0x33')];if(!_0x277273[_0x31b7('0x34')][_0x31b7('0x3a')](_0x31b7('0x3b'))){_0x5b0ed2[_0x31b7('0x1e')]=qs['limit'](_0x277273['query'][_0x31b7('0x1e')]);_0x5b0ed2[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x277273[_0x31b7('0x34')][_0x31b7('0x20')]);}_0x5b0ed2[_0x31b7('0x3c')]=qs[_0x31b7('0x3d')](_0x277273[_0x31b7('0x34')][_0x31b7('0x3d')]);_0x5b0ed2[_0x31b7('0x3e')]=qs['filters'](_[_0x31b7('0x3f')](_0x277273[_0x31b7('0x34')],_0x34c62a[_0x31b7('0x35')]),_0x574dfe);if(_0x277273[_0x31b7('0x34')]['filter']){_0x5b0ed2[_0x31b7('0x3e')]=_[_0x31b7('0x40')](_0x5b0ed2['where'],{'$or':_[_0x31b7('0x2f')](_0x574dfe,function(_0x5724fa){if(_0x5724fa['type']!==_0x31b7('0x41')){var _0x10e82c={};_0x10e82c[_0x5724fa[_0x31b7('0x2c')]]={'$like':'%'+_0x277273[_0x31b7('0x34')][_0x31b7('0x42')]+'%'};return _0x10e82c;}})});}_0x5b0ed2=_['merge']({},_0x5b0ed2,_0x277273[_0x31b7('0x43')]);var _0x5d01ee={'where':_0x5b0ed2['where']};return db['VoiceChanSpy'][_0x31b7('0x1f')](_0x5d01ee)[_0x31b7('0x27')](function(_0x1527b3){_0x4b5cf9[_0x31b7('0x1f')]=_0x1527b3;if(_0x277273[_0x31b7('0x34')]['includeAll']){_0x5b0ed2[_0x31b7('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x31b7('0x45')](_0x5b0ed2);})[_0x31b7('0x27')](function(_0x41c92e){_0x4b5cf9[_0x31b7('0x46')]=_0x41c92e;return _0x4b5cf9;})['then'](respondWithFilteredResult(_0x58a87e,_0x5b0ed2))[_0x31b7('0x47')](handleError(_0x58a87e,null));};exports[_0x31b7('0x48')]=function(_0x1046fb,_0x4b3d24){var _0x31fd89={'raw':![],'where':{'id':_0x1046fb[_0x31b7('0x49')]['id']}},_0x51918d={};_0x51918d[_0x31b7('0x33')]=_['keys'](db[_0x31b7('0x30')][_0x31b7('0x31')]);_0x51918d[_0x31b7('0x34')]=_[_0x31b7('0x4a')](_0x1046fb['query']);_0x51918d[_0x31b7('0x35')]=_['intersection'](_0x51918d['model'],_0x51918d[_0x31b7('0x34')]);_0x31fd89[_0x31b7('0x37')]=_[_0x31b7('0x36')](_0x51918d[_0x31b7('0x33')],qs['fields'](_0x1046fb[_0x31b7('0x34')][_0x31b7('0x38')]));_0x31fd89['attributes']=_0x31fd89[_0x31b7('0x37')][_0x31b7('0x39')]?_0x31fd89[_0x31b7('0x37')]:_0x51918d['model'];if(_0x1046fb[_0x31b7('0x34')][_0x31b7('0x4b')]){_0x31fd89[_0x31b7('0x44')]=[{'all':!![]}];}_0x31fd89=_[_0x31b7('0x40')]({},_0x31fd89,_0x1046fb[_0x31b7('0x43')]);return db[_0x31b7('0x30')][_0x31b7('0x4c')](_0x31fd89)[_0x31b7('0x27')](handleEntityNotFound(_0x4b3d24,null))['then'](respondWithResult(_0x4b3d24,null))[_0x31b7('0x47')](handleError(_0x4b3d24,null));};exports['create']=function(_0x5a72ee,_0x22cc77){return db[_0x31b7('0x30')][_0x31b7('0x4d')](_0x5a72ee[_0x31b7('0x4e')],{})['then'](function(_0x322798){var _0x18556b=_0x5a72ee[_0x31b7('0x4f')]['get']({'plain':!![]});if(!_0x18556b)throw new Error(_0x31b7('0x50'));if(_0x18556b[_0x31b7('0x51')]===_0x31b7('0x4f')){var _0x3b5868=_0x322798[_0x31b7('0x28')]({'plain':!![]});var _0x309077=_0x31b7('0x52');return db[_0x31b7('0x53')]['find']({'where':{'name':_0x309077,'userProfileId':_0x18556b['userProfileId']},'raw':!![]})[_0x31b7('0x27')](function(_0x1d55e6){if(_0x1d55e6&&_0x1d55e6[_0x31b7('0x54')]===0x0){return db[_0x31b7('0x29')]['create']({'name':_0x3b5868['name'],'resourceId':_0x3b5868['id'],'type':_0x1d55e6[_0x31b7('0x2c')],'sectionId':_0x1d55e6['id']},{})[_0x31b7('0x27')](function(){return _0x322798;});}else{return _0x322798;}})[_0x31b7('0x47')](function(_0x5ea605){logger[_0x31b7('0x2a')](_0x31b7('0x55'),_0x5ea605);throw _0x5ea605;});}return _0x322798;})[_0x31b7('0x27')](respondWithResult(_0x22cc77,0xc9))[_0x31b7('0x47')](handleError(_0x22cc77,null));};exports['update']=function(_0x535a3c,_0x43c1ee){if(_0x535a3c[_0x31b7('0x4e')]['id']){delete _0x535a3c[_0x31b7('0x4e')]['id'];}return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x535a3c[_0x31b7('0x49')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x43c1ee,null))[_0x31b7('0x27')](saveUpdates(_0x535a3c[_0x31b7('0x4e')],null))[_0x31b7('0x27')](respondWithResult(_0x43c1ee,null))['catch'](handleError(_0x43c1ee,null));};exports['destroy']=function(_0x4bd00d,_0x954c){return db[_0x31b7('0x30')][_0x31b7('0x4c')]({'where':{'id':_0x4bd00d['params']['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x954c,null))[_0x31b7('0x27')](removeEntity(_0x954c,null))[_0x31b7('0x47')](handleError(_0x954c,null));}; \ No newline at end of file +var _0x5bbd=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','filter','VIRTUAL','merge','VoiceChanSpy','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd5bb('0x0'));var rimraf=require(_0xd5bb('0x1'));var zipdir=require(_0xd5bb('0x2'));var jsonpatch=require(_0xd5bb('0x3'));var rp=require(_0xd5bb('0x4'));var moment=require(_0xd5bb('0x5'));var BPromise=require(_0xd5bb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd5bb('0x7'));var csv=require(_0xd5bb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5bb('0x9'));var squel=require('squel');var crypto=require(_0xd5bb('0xa'));var jsforce=require(_0xd5bb('0xb'));var deskjs=require(_0xd5bb('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd5bb('0xd'));var Redis=require(_0xd5bb('0xe'));var authService=require(_0xd5bb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd5bb('0x10'));var hardwareService=require(_0xd5bb('0x11'));var logger=require(_0xd5bb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd5bb('0x13'));var licenseUtil=require(_0xd5bb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1df75a,_0x4b1f1b){_0x4b1f1b=_0x4b1f1b||0xcc;return function(_0x16b13f){if(_0x16b13f){return _0x1df75a['sendStatus'](_0x4b1f1b);}return _0x1df75a[_0xd5bb('0x15')](_0x4b1f1b)[_0xd5bb('0x16')]();};}function respondWithResult(_0x57cdb0,_0x37bb78){_0x37bb78=_0x37bb78||0xc8;return function(_0x1f54eb){if(_0x1f54eb){return _0x57cdb0[_0xd5bb('0x15')](_0x37bb78)['json'](_0x1f54eb);}};}function respondWithFilteredResult(_0x48c60a,_0x7d2333){return function(_0xa014fe){if(_0xa014fe){var _0x516418=typeof _0x7d2333[_0xd5bb('0x17')]===_0xd5bb('0x18')&&typeof _0x7d2333[_0xd5bb('0x19')]===_0xd5bb('0x18');var _0x510d9b=_0xa014fe[_0xd5bb('0x1a')];var _0x41bc89=_0x516418?0x0:_0x7d2333[_0xd5bb('0x17')];var _0x3d312f=_0x516418?_0xa014fe[_0xd5bb('0x1a')]:_0x7d2333[_0xd5bb('0x17')]+_0x7d2333['limit'];var _0x3bb5ae;if(_0x3d312f>=_0x510d9b){_0x3d312f=_0x510d9b;_0x3bb5ae=0xc8;}else{_0x3bb5ae=0xce;}_0x48c60a[_0xd5bb('0x15')](_0x3bb5ae);return _0x48c60a[_0xd5bb('0x1b')](_0xd5bb('0x1c'),_0x41bc89+'-'+_0x3d312f+'/'+_0x510d9b)[_0xd5bb('0x1d')](_0xa014fe);}return null;};}function patchUpdates(_0x40112f){return function(_0x56a68c){try{jsonpatch[_0xd5bb('0x1e')](_0x56a68c,_0x40112f,!![]);}catch(_0x53b6fc){return BPromise['reject'](_0x53b6fc);}return _0x56a68c[_0xd5bb('0x1f')]();};}function saveUpdates(_0x4c82d3,_0x53f959){return function(_0x118e3d){if(_0x118e3d){return _0x118e3d[_0xd5bb('0x20')](_0x4c82d3)[_0xd5bb('0x21')](function(_0x44551e){return _0x44551e;});}return null;};}function removeEntity(_0x285609,_0x52383c){return function(_0x2685ad){if(_0x2685ad){return _0x2685ad[_0xd5bb('0x22')]()[_0xd5bb('0x21')](function(){var _0x6155c=_0x2685ad[_0xd5bb('0x23')]({'plain':!![]});var _0x48f15d='ChanSpies';return db[_0xd5bb('0x24')][_0xd5bb('0x22')]({'where':{'type':_0x48f15d,'resourceId':_0x6155c['id']}})[_0xd5bb('0x21')](function(){return _0x2685ad;});})[_0xd5bb('0x21')](function(){_0x285609[_0xd5bb('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11428a,_0x4f6ec6){return function(_0x30fa6d){if(!_0x30fa6d){_0x11428a[_0xd5bb('0x25')](0x194);}return _0x30fa6d;};}function handleError(_0x4698a8,_0x32a83e){_0x32a83e=_0x32a83e||0x1f4;return function(_0x10e5a6){logger[_0xd5bb('0x26')](_0x10e5a6[_0xd5bb('0x27')]);if(_0x10e5a6[_0xd5bb('0x28')]){delete _0x10e5a6[_0xd5bb('0x28')];}_0x4698a8[_0xd5bb('0x15')](_0x32a83e)[_0xd5bb('0x29')](_0x10e5a6);};}exports[_0xd5bb('0x2a')]=function(_0x408ada,_0x965a7f){var _0x12aeea={},_0x2a6a4a={},_0x4db50b={'count':0x0,'rows':[]};var _0x12fa21=_[_0xd5bb('0x2b')](db['VoiceChanSpy'][_0xd5bb('0x2c')],function(_0x425e8a){return{'name':_0x425e8a['fieldName'],'type':_0x425e8a[_0xd5bb('0x2d')][_0xd5bb('0x2e')]};});_0x2a6a4a[_0xd5bb('0x2f')]=_['map'](_0x12fa21,_0xd5bb('0x28'));_0x2a6a4a[_0xd5bb('0x30')]=_['keys'](_0x408ada['query']);_0x2a6a4a[_0xd5bb('0x31')]=_[_0xd5bb('0x32')](_0x2a6a4a['model'],_0x2a6a4a[_0xd5bb('0x30')]);_0x12aeea['attributes']=_[_0xd5bb('0x32')](_0x2a6a4a[_0xd5bb('0x2f')],qs['fields'](_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x33')]));_0x12aeea[_0xd5bb('0x34')]=_0x12aeea[_0xd5bb('0x34')][_0xd5bb('0x35')]?_0x12aeea[_0xd5bb('0x34')]:_0x2a6a4a['model'];if(!_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x36')]('nolimit')){_0x12aeea[_0xd5bb('0x19')]=qs[_0xd5bb('0x19')](_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x19')]);_0x12aeea[_0xd5bb('0x17')]=qs[_0xd5bb('0x17')](_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x17')]);}_0x12aeea['order']=qs['sort'](_0x408ada[_0xd5bb('0x30')]['sort']);_0x12aeea[_0xd5bb('0x37')]=qs['filters'](_['pick'](_0x408ada[_0xd5bb('0x30')],_0x2a6a4a[_0xd5bb('0x31')]),_0x12fa21);if(_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x38')]){_0x12aeea[_0xd5bb('0x37')]=_['merge'](_0x12aeea['where'],{'$or':_['map'](_0x12fa21,function(_0x278954){if(_0x278954[_0xd5bb('0x2d')]!==_0xd5bb('0x39')){var _0xb9eb13={};_0xb9eb13[_0x278954['name']]={'$like':'%'+_0x408ada[_0xd5bb('0x30')][_0xd5bb('0x38')]+'%'};return _0xb9eb13;}})});}_0x12aeea=_[_0xd5bb('0x3a')]({},_0x12aeea,_0x408ada['options']);var _0x3d11c9={'where':_0x12aeea['where']};return db[_0xd5bb('0x3b')]['count'](_0x3d11c9)['then'](function(_0x2e0e59){_0x4db50b['count']=_0x2e0e59;if(_0x408ada['query'][_0xd5bb('0x3c')]){_0x12aeea['include']=[{'all':!![]}];}return db[_0xd5bb('0x3b')][_0xd5bb('0x3d')](_0x12aeea);})[_0xd5bb('0x21')](function(_0x51d020){_0x4db50b[_0xd5bb('0x3e')]=_0x51d020;return _0x4db50b;})[_0xd5bb('0x21')](respondWithFilteredResult(_0x965a7f,_0x12aeea))[_0xd5bb('0x3f')](handleError(_0x965a7f,null));};exports[_0xd5bb('0x40')]=function(_0x4d392f,_0x56a1ba){var _0x47d1ee={'raw':![],'where':{'id':_0x4d392f[_0xd5bb('0x41')]['id']}},_0x30c47e={};_0x30c47e[_0xd5bb('0x2f')]=_[_0xd5bb('0x42')](db[_0xd5bb('0x3b')][_0xd5bb('0x2c')]);_0x30c47e[_0xd5bb('0x30')]=_['keys'](_0x4d392f[_0xd5bb('0x30')]);_0x30c47e[_0xd5bb('0x31')]=_[_0xd5bb('0x32')](_0x30c47e[_0xd5bb('0x2f')],_0x30c47e[_0xd5bb('0x30')]);_0x47d1ee[_0xd5bb('0x34')]=_['intersection'](_0x30c47e[_0xd5bb('0x2f')],qs[_0xd5bb('0x33')](_0x4d392f[_0xd5bb('0x30')][_0xd5bb('0x33')]));_0x47d1ee[_0xd5bb('0x34')]=_0x47d1ee['attributes']['length']?_0x47d1ee[_0xd5bb('0x34')]:_0x30c47e[_0xd5bb('0x2f')];if(_0x4d392f['query'][_0xd5bb('0x3c')]){_0x47d1ee[_0xd5bb('0x43')]=[{'all':!![]}];}_0x47d1ee=_['merge']({},_0x47d1ee,_0x4d392f[_0xd5bb('0x44')]);return db['VoiceChanSpy'][_0xd5bb('0x45')](_0x47d1ee)[_0xd5bb('0x21')](handleEntityNotFound(_0x56a1ba,null))[_0xd5bb('0x21')](respondWithResult(_0x56a1ba,null))[_0xd5bb('0x3f')](handleError(_0x56a1ba,null));};exports[_0xd5bb('0x46')]=function(_0x58553c,_0x1cbb68){return db['VoiceChanSpy'][_0xd5bb('0x46')](_0x58553c['body'],{})[_0xd5bb('0x21')](function(_0x505db8){var _0x4ea20b=_0x58553c[_0xd5bb('0x47')][_0xd5bb('0x23')]({'plain':!![]});if(!_0x4ea20b)throw new Error(_0xd5bb('0x48'));if(_0x4ea20b['role']===_0xd5bb('0x47')){var _0x26c882=_0x505db8[_0xd5bb('0x23')]({'plain':!![]});var _0x96e91e=_0xd5bb('0x49');return db[_0xd5bb('0x4a')][_0xd5bb('0x45')]({'where':{'name':_0x96e91e,'userProfileId':_0x4ea20b[_0xd5bb('0x4b')]},'raw':!![]})[_0xd5bb('0x21')](function(_0x2d8d82){if(_0x2d8d82&&_0x2d8d82[_0xd5bb('0x4c')]===0x0){return db['UserProfileResource'][_0xd5bb('0x46')]({'name':_0x26c882[_0xd5bb('0x28')],'resourceId':_0x26c882['id'],'type':_0x2d8d82[_0xd5bb('0x28')],'sectionId':_0x2d8d82['id']},{})[_0xd5bb('0x21')](function(){return _0x505db8;});}else{return _0x505db8;}})[_0xd5bb('0x3f')](function(_0x4d1dd4){logger['error'](_0xd5bb('0x4d'),_0x4d1dd4);throw _0x4d1dd4;});}return _0x505db8;})[_0xd5bb('0x21')](respondWithResult(_0x1cbb68,0xc9))[_0xd5bb('0x3f')](handleError(_0x1cbb68,null));};exports[_0xd5bb('0x20')]=function(_0x566322,_0x1abe56){if(_0x566322['body']['id']){delete _0x566322[_0xd5bb('0x4e')]['id'];}return db[_0xd5bb('0x3b')]['find']({'where':{'id':_0x566322[_0xd5bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x1abe56,null))['then'](saveUpdates(_0x566322[_0xd5bb('0x4e')],null))[_0xd5bb('0x21')](respondWithResult(_0x1abe56,null))[_0xd5bb('0x3f')](handleError(_0x1abe56,null));};exports[_0xd5bb('0x22')]=function(_0x11cc95,_0x1f7f76){return db[_0xd5bb('0x3b')][_0xd5bb('0x45')]({'where':{'id':_0x11cc95[_0xd5bb('0x41')]['id']}})[_0xd5bb('0x21')](handleEntityNotFound(_0x1f7f76,null))[_0xd5bb('0x21')](removeEntity(_0x1f7f76,null))[_0xd5bb('0x3f')](handleError(_0x1f7f76,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d070522..78ede60 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 _0xadaa=['push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','password','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','destroy','bulkCreate','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix'];(function(_0x26bbd1,_0xb274f3){var _0x26b1eb=function(_0x4cf794){while(--_0x4cf794){_0x26bbd1['push'](_0x26bbd1['shift']());}};_0x26b1eb(++_0xb274f3);}(_0xadaa,0x165));var _0xaada=function(_0x1cacba,_0x348d3f){_0x1cacba=_0x1cacba-0x0;var _0x22a27f=_0xadaa[_0x1cacba];return _0x22a27f;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xaada('0x0'));var attributes=require(_0xaada('0x1'));var getUserApplications=function(_0x172e12,_0x19a3c9,_0x284f29){var _0x1081b8=0x1;var _0x3d1973=[];var _0xe9ec7d={'context':_0x19a3c9[_0xaada('0x2')]||'from-sip','exten':util[_0xaada('0x3')](_0xaada('0x4'),_0x172e12[_0xaada('0x5')],_0x284f29),'type':'system','isApp':![],'ChanSpyId':_0x172e12['id'],'UserId':_0x19a3c9['id']};_0x3d1973[_0xaada('0x6')](_[_0xaada('0x7')]({'app':_0xaada('0x8'),'appdata':util[_0xaada('0x3')](_0xaada('0x9'),_0xaada('0xa')),'priority':_0x1081b8++},_0xe9ec7d));if(_0x172e12[_0xaada('0xb')]){_0x3d1973['push'](_['merge']({'app':'MixMonitor','appdata':util[_0xaada('0x3')](_0xaada('0xc'),_0x172e12[_0xaada('0xd')]),'priority':_0x1081b8++},_0xe9ec7d));}if(_0x172e12['auth']){_0x3d1973[_0xaada('0x6')](_['merge']({'app':'Authenticate','appdata':_0x172e12[_0xaada('0xe')],'priority':_0x1081b8++},_0xe9ec7d));}_0x3d1973[_0xaada('0x6')](_[_0xaada('0x7')]({'app':'ChanSpy','appdata':util[_0xaada('0x3')](_0xaada('0xf'),_0x19a3c9[_0xaada('0x10')],_0x172e12[_0xaada('0x11')]?_0x172e12[_0xaada('0x11')]['join'](''):''),'priority':_0x1081b8++},_0xe9ec7d));if(_0x172e12[_0xaada('0xb')]){_0x3d1973[_0xaada('0x6')](_[_0xaada('0x7')]({'app':_0xaada('0x12'),'priority':_0x1081b8++},_0xe9ec7d));}return _0x3d1973;};var getChanSpyApplications=function(_0x1c72ec,_0x50100d){var _0x2a3877=[];for(var _0xa7467c=0x0,_0x2b0d89=0x1;_0xa7467c<_0x50100d['length'];_0xa7467c++,_0x2b0d89=0x1){_0x2a3877=_0x2a3877[_0xaada('0x13')](getUserApplications(_0x1c72ec,_0x50100d[_0xa7467c],_0x50100d[_0xa7467c]['internal']));if(_0x50100d[_0xa7467c][_0xaada('0x14')]!=_0x50100d[_0xa7467c][_0xaada('0x10')]){_0x2a3877=_0x2a3877[_0xaada('0x13')](getUserApplications(_0x1c72ec,_0x50100d[_0xa7467c],_0x50100d[_0xa7467c]['name']));}}return _0x2a3877;};var getChanSpyPromise=function(_0x5ad417,_0x50ac0f){return new BPromise(function(_0x5bc141,_0x122676){return _0x5ad417['User']['findAll']({'attributes':['id',_0xaada('0x10'),_0xaada('0x14')],'where':{'role':_0xaada('0x15'),'chanspy':!![]},'raw':!![]})[_0xaada('0x16')](function(_0x1e7f9f){if(_0x1e7f9f){return _0x5bc141(getChanSpyApplications(_0x50ac0f,_0x1e7f9f));}return _0x5bc141([]);})[_0xaada('0x17')](function(_0x10d930){_0x122676(_0x10d930);});});};module[_0xaada('0x18')]=function(_0x8af9ba,_0x45665e){var _0x183695=_0x8af9ba[_0xaada('0x19')];return _0x8af9ba[_0xaada('0x1a')](_0xaada('0x1b'),attributes,{'tableName':_0xaada('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21fc8b,_0x4f2022,_0x17f647){return getChanSpyPromise(_0x183695,_0x21fc8b)[_0xaada('0x16')](function(_0x45fa0e){if(_0x45fa0e&&_0x45fa0e[_0xaada('0x1d')]){return _0x183695['VoiceExtension']['bulkCreate'](_0x45fa0e);}})[_0xaada('0x16')](function(){_0x17f647();})[_0xaada('0x17')](function(_0x2c7880){_0x17f647(_0x2c7880);});},'afterUpdate':function(_0x302f4c,_0x41d5fb,_0x17acbb){return _0x183695[_0xaada('0x1e')][_0xaada('0x1f')]({'where':{'ChanSpyId':_0x302f4c['id']}})[_0xaada('0x16')](function(){return getChanSpyPromise(_0x183695,_0x302f4c);})['then'](function(_0xdb3e33){if(_0xdb3e33&&_0xdb3e33[_0xaada('0x1d')]){return _0x183695[_0xaada('0x1e')][_0xaada('0x20')](_0xdb3e33);}})['then'](function(){_0x17acbb();})[_0xaada('0x17')](function(_0x2a4900){_0x17acbb(_0x2a4900);});},'afterDestroy':function(_0x5a8bf4,_0x5f9779,_0x157c2a){return _0x183695[_0xaada('0x1e')][_0xaada('0x1f')]({'where':{'ChanSpyId':_0x5a8bf4['id']}})[_0xaada('0x16')](function(){_0x157c2a();})[_0xaada('0x17')](function(_0x5690c8){_0x157c2a(_0x5690c8);});}}});}; \ No newline at end of file +var _0x8b0a=['recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','record','StopMixMonitor','concat','internal','name','agent','then','catch','exports','models','voice_chanspy','length','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','chanspy','merge','format','${UNIQUEID}.%s,a'];(function(_0x1275b7,_0x457830){var _0x38524b=function(_0x51df7e){while(--_0x51df7e){_0x1275b7['push'](_0x1275b7['shift']());}};_0x38524b(++_0x457830);}(_0x8b0a,0x1ad));var _0xa8b0=function(_0x453d74,_0x2dd33b){_0x453d74=_0x453d74-0x0;var _0x2a641a=_0x8b0a[_0x453d74];return _0x2a641a;};'use strict';var _=require(_0xa8b0('0x0'));var util=require(_0xa8b0('0x1'));var BPromise=require(_0xa8b0('0x2'));var attributes=require(_0xa8b0('0x3'));var getUserApplications=function(_0x457ac8,_0x29e730,_0x381e2d){var _0x2c22a9=0x1;var _0x1cb771=[];var _0x195130={'context':_0x29e730['context']||_0xa8b0('0x4'),'exten':util['format'](_0xa8b0('0x5'),_0x457ac8[_0xa8b0('0x6')],_0x381e2d),'type':_0xa8b0('0x7'),'isApp':![],'ChanSpyId':_0x457ac8['id'],'UserId':_0x29e730['id']};_0x1cb771[_0xa8b0('0x8')](_['merge']({'app':'Set','appdata':util['format']('CDR(type)=%s',_0xa8b0('0x9')),'priority':_0x2c22a9++},_0x195130));if(_0x457ac8['record']){_0x1cb771[_0xa8b0('0x8')](_[_0xa8b0('0xa')]({'app':'MixMonitor','appdata':util[_0xa8b0('0xb')](_0xa8b0('0xc'),_0x457ac8[_0xa8b0('0xd')]),'priority':_0x2c22a9++},_0x195130));}if(_0x457ac8[_0xa8b0('0xe')]){_0x1cb771[_0xa8b0('0x8')](_[_0xa8b0('0xa')]({'app':_0xa8b0('0xf'),'appdata':_0x457ac8['password'],'priority':_0x2c22a9++},_0x195130));}_0x1cb771['push'](_[_0xa8b0('0xa')]({'app':_0xa8b0('0x10'),'appdata':util[_0xa8b0('0xb')](_0xa8b0('0x11'),_0x29e730['name'],_0x457ac8[_0xa8b0('0x12')]?_0x457ac8[_0xa8b0('0x12')][_0xa8b0('0x13')](''):''),'priority':_0x2c22a9++},_0x195130));if(_0x457ac8[_0xa8b0('0x14')]){_0x1cb771[_0xa8b0('0x8')](_[_0xa8b0('0xa')]({'app':_0xa8b0('0x15'),'priority':_0x2c22a9++},_0x195130));}return _0x1cb771;};var getChanSpyApplications=function(_0x21efa4,_0x4a11ba){var _0x32267e=[];for(var _0x58d183=0x0,_0xcb548e=0x1;_0x58d183<_0x4a11ba['length'];_0x58d183++,_0xcb548e=0x1){_0x32267e=_0x32267e[_0xa8b0('0x16')](getUserApplications(_0x21efa4,_0x4a11ba[_0x58d183],_0x4a11ba[_0x58d183][_0xa8b0('0x17')]));if(_0x4a11ba[_0x58d183][_0xa8b0('0x17')]!=_0x4a11ba[_0x58d183][_0xa8b0('0x18')]){_0x32267e=_0x32267e[_0xa8b0('0x16')](getUserApplications(_0x21efa4,_0x4a11ba[_0x58d183],_0x4a11ba[_0x58d183][_0xa8b0('0x18')]));}}return _0x32267e;};var getChanSpyPromise=function(_0x55926e,_0x1acf81){return new BPromise(function(_0x54fac6,_0x2b1324){return _0x55926e['User']['findAll']({'attributes':['id',_0xa8b0('0x18'),'internal'],'where':{'role':_0xa8b0('0x19'),'chanspy':!![]},'raw':!![]})[_0xa8b0('0x1a')](function(_0x2ae6ed){if(_0x2ae6ed){return _0x54fac6(getChanSpyApplications(_0x1acf81,_0x2ae6ed));}return _0x54fac6([]);})[_0xa8b0('0x1b')](function(_0x4ba155){_0x2b1324(_0x4ba155);});});};module[_0xa8b0('0x1c')]=function(_0x4a3d86,_0x5bdea0){var _0x1ed606=_0x4a3d86[_0xa8b0('0x1d')];return _0x4a3d86['define']('VoiceChanSpy',attributes,{'tableName':_0xa8b0('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3489f2,_0x3f0901,_0x26794f){return getChanSpyPromise(_0x1ed606,_0x3489f2)[_0xa8b0('0x1a')](function(_0x271aeb){if(_0x271aeb&&_0x271aeb[_0xa8b0('0x1f')]){return _0x1ed606['VoiceExtension']['bulkCreate'](_0x271aeb);}})[_0xa8b0('0x1a')](function(){_0x26794f();})[_0xa8b0('0x1b')](function(_0x230ddf){_0x26794f(_0x230ddf);});},'afterUpdate':function(_0x2d7291,_0x42ebac,_0x18b0ee){return _0x1ed606[_0xa8b0('0x20')]['destroy']({'where':{'ChanSpyId':_0x2d7291['id']}})['then'](function(){return getChanSpyPromise(_0x1ed606,_0x2d7291);})[_0xa8b0('0x1a')](function(_0x579615){if(_0x579615&&_0x579615[_0xa8b0('0x1f')]){return _0x1ed606['VoiceExtension'][_0xa8b0('0x21')](_0x579615);}})['then'](function(){_0x18b0ee();})['catch'](function(_0x364883){_0x18b0ee(_0x364883);});},'afterDestroy':function(_0x337e25,_0x5399ad,_0x14d4dd){return _0x1ed606[_0xa8b0('0x20')]['destroy']({'where':{'ChanSpyId':_0x337e25['id']}})[_0xa8b0('0x1a')](function(){_0x14d4dd();})[_0xa8b0('0x1b')](function(_0x2bc424){_0x14d4dd(_0x2bc424);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 3729624..3e44b40 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 _0xfe57=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xfe57,0x195));var _0x7fe5=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xfe57[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7fe5('0x2'));var fs=require('fs');var Redis=require(_0x7fe5('0x3'));var db=require(_0x7fe5('0x4'))['db'];var utils=require(_0x7fe5('0x5'));var logger=require(_0x7fe5('0x6'))(_0x7fe5('0x7'));var config=require(_0x7fe5('0x8'));var jayson=require(_0x7fe5('0x9'));var client=jayson[_0x7fe5('0xa')][_0x7fe5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd6146b,_0x2632de,_0x36ff81){return new BPromise(function(_0x4ab081,_0x13b391){return client['request'](_0xd6146b,_0x36ff81)[_0x7fe5('0xc')](function(_0x2ae7f3){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x2632de,_0x7fe5('0xd'));logger[_0x7fe5('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2632de,_0x7fe5('0xd'),JSON['stringify'](_0x2ae7f3));if(_0x2ae7f3['error']){if(_0x2ae7f3[_0x7fe5('0xf')][_0x7fe5('0x10')]===0x1f4){logger[_0x7fe5('0xf')](_0x7fe5('0x11'),_0x2632de,_0x2ae7f3['error'][_0x7fe5('0x12')]);return _0x13b391(_0x2ae7f3[_0x7fe5('0xf')]['message']);}logger[_0x7fe5('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2632de,_0x2ae7f3[_0x7fe5('0xf')][_0x7fe5('0x12')]);return _0x4ab081(_0x2ae7f3['error'][_0x7fe5('0x12')]);}else{logger['info'](_0x7fe5('0x11'),_0x2632de,_0x7fe5('0xd'));_0x4ab081(_0x2ae7f3[_0x7fe5('0x13')][_0x7fe5('0x12')]);}})[_0x7fe5('0x14')](function(_0x104bc8){logger['error'](_0x7fe5('0x11'),_0x2632de,_0x104bc8);_0x13b391(_0x104bc8);});});} \ No newline at end of file +var _0x9c2c=['request\x20sent','stringify','code','error','message','info','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x4e4f67,_0x57dc0b){var _0x193c53=function(_0x401912){while(--_0x401912){_0x4e4f67['push'](_0x4e4f67['shift']());}};_0x193c53(++_0x57dc0b);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9c2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9c2('0x3'));var logger=require(_0xc9c2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc9c2('0x5'));var client=jayson['client'][_0xc9c2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x17b5e8,_0x711f3d,_0x18a815){return new BPromise(function(_0x270572,_0xd7fb27){return client[_0xc9c2('0x7')](_0x17b5e8,_0x18a815)[_0xc9c2('0x8')](function(_0x8614c4){logger['info'](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');logger[_0xc9c2('0xa')](_0xc9c2('0xb'),_0x711f3d,_0xc9c2('0xc'),JSON[_0xc9c2('0xd')](_0x8614c4));if(_0x8614c4['error']){if(_0x8614c4['error'][_0xc9c2('0xe')]===0x1f4){logger[_0xc9c2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0xd7fb27(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}logger[_0xc9c2('0xf')](_0xc9c2('0x9'),_0x711f3d,_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);return _0x270572(_0x8614c4[_0xc9c2('0xf')][_0xc9c2('0x10')]);}else{logger[_0xc9c2('0x11')](_0xc9c2('0x9'),_0x711f3d,'request\x20sent');_0x270572(_0x8614c4[_0xc9c2('0x12')][_0xc9c2('0x10')]);}})[_0xc9c2('0x13')](function(_0x240099){logger[_0xc9c2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x711f3d,_0x240099);_0xd7fb27(_0x240099);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 785c12a..979cb41 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 _0x411c=['../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2723be,_0xb5b6ce){var _0x497f87=function(_0x23ba52){while(--_0x23ba52){_0x2723be['push'](_0x2723be['shift']());}};_0x497f87(++_0xb5b6ce);}(_0x411c,0xda));var _0xc411=function(_0x274d2d,_0x321f28){_0x274d2d=_0x274d2d-0x0;var _0x18b4ec=_0x411c[_0x274d2d];return _0x18b4ec;};'use strict';var multer=require(_0xc411('0x0'));var util=require('util');var path=require(_0xc411('0x1'));var timeout=require(_0xc411('0x2'));var express=require(_0xc411('0x3'));var router=express[_0xc411('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc411('0x5'));var interaction=require(_0xc411('0x6'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc411('0x7')](_0xc411('0x8'),auth[_0xc411('0x9')](),controller[_0xc411('0xa')]);router[_0xc411('0xb')]('/',auth[_0xc411('0x9')](),controller[_0xc411('0xc')]);router[_0xc411('0xd')](_0xc411('0x8'),auth[_0xc411('0x9')](),controller['update']);router[_0xc411('0xe')](_0xc411('0x8'),auth[_0xc411('0x9')](),controller['destroy']);module[_0xc411('0xf')]=router; \ No newline at end of file +var _0x666e=['./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x528d58,_0xace04b){var _0x104222=function(_0x1bdc2f){while(--_0x1bdc2f){_0x528d58['push'](_0x528d58['shift']());}};_0x104222(++_0xace04b);}(_0x666e,0xf3));var _0xe666=function(_0x2ef1a5,_0x316aac){_0x2ef1a5=_0x2ef1a5-0x0;var _0x268769=_0x666e[_0x2ef1a5];return _0x268769;};'use strict';var multer=require('multer');var util=require(_0xe666('0x0'));var path=require(_0xe666('0x1'));var timeout=require(_0xe666('0x2'));var express=require(_0xe666('0x3'));var router=express[_0xe666('0x4')]();var fs_extra=require(_0xe666('0x5'));var auth=require(_0xe666('0x6'));var interaction=require(_0xe666('0x7'));var config=require(_0xe666('0x8'));var controller=require(_0xe666('0x9'));router[_0xe666('0xa')]('/',auth[_0xe666('0xb')](),controller[_0xe666('0xc')]);router[_0xe666('0xa')](_0xe666('0xd'),auth[_0xe666('0xb')](),controller[_0xe666('0xe')]);router[_0xe666('0xf')]('/',auth[_0xe666('0xb')](),controller[_0xe666('0x10')]);router[_0xe666('0x11')](_0xe666('0xd'),auth[_0xe666('0xb')](),controller[_0xe666('0x12')]);router['delete'](_0xe666('0xd'),auth['isAuthenticated'](),controller[_0xe666('0x13')]);module[_0xe666('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 8e32937..69a9787 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 _0x0417=['BOOLEAN','STRING','name'];(function(_0x24756b,_0x3aa816){var _0x2c2ac4=function(_0x3b6c1a){while(--_0x3b6c1a){_0x24756b['push'](_0x24756b['shift']());}};_0x2c2ac4(++_0x3aa816);}(_0x0417,0x181));var _0x7041=function(_0x9f8ee,_0x5174a2){_0x9f8ee=_0x9f8ee-0x0;var _0x3ae30c=_0x0417[_0x9f8ee];return _0x3ae30c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7041('0x0')],'unique':_0x7041('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7041('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c08=['BOOLEAN','exports','STRING'];(function(_0x1b6ad6,_0x26dce7){var _0x5c9c91=function(_0x6e0b22){while(--_0x6e0b22){_0x1b6ad6['push'](_0x1b6ad6['shift']());}};_0x5c9c91(++_0x26dce7);}(_0x3c08,0x136));var _0x83c0=function(_0x1f9e3a,_0x4b5298){_0x1f9e3a=_0x1f9e3a-0x0;var _0x3c9f64=_0x3c08[_0x1f9e3a];return _0x3c9f64;};'use strict';var Sequelize=require('sequelize');module[_0x83c0('0x0')]={'name':{'type':Sequelize[_0x83c0('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x83c0('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x83c0('0x2')],'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 9933a10..550c4dc 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 _0x9bcf=['order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9bcf,0xf6));var _0xf9bc=function(_0x217e8d,_0x6c599f){_0x217e8d=_0x217e8d-0x0;var _0x44d7e6=_0x9bcf[_0x217e8d];return _0x44d7e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9bc('0x0'));var zipdir=require(_0xf9bc('0x1'));var jsonpatch=require(_0xf9bc('0x2'));var rp=require('request-promise');var moment=require(_0xf9bc('0x3'));var BPromise=require(_0xf9bc('0x4'));var Mustache=require('mustache');var util=require(_0xf9bc('0x5'));var path=require('path');var sox=require(_0xf9bc('0x6'));var csv=require(_0xf9bc('0x7'));var ejs=require(_0xf9bc('0x8'));var fs=require('fs');var fs_extra=require(_0xf9bc('0x9'));var _=require(_0xf9bc('0xa'));var squel=require(_0xf9bc('0xb'));var crypto=require(_0xf9bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf9bc('0xd'));var toCsv=require(_0xf9bc('0x7'));var querystring=require(_0xf9bc('0xe'));var Papa=require(_0xf9bc('0xf'));var Redis=require(_0xf9bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9bc('0x11'));var as=require(_0xf9bc('0x12'));var hardwareService=require(_0xf9bc('0x13'));var logger=require(_0xf9bc('0x14'))(_0xf9bc('0x15'));var utils=require(_0xf9bc('0x16'));var config=require(_0xf9bc('0x17'));var licenseUtil=require(_0xf9bc('0x18'));var db=require(_0xf9bc('0x19'))['db'];var jayson=require(_0xf9bc('0x1a'));var client=jayson['client'][_0xf9bc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x6393bc,_0xb0a26,_0x1a042b,_0x1cb9eb){return new BPromise(function(_0xf31866,_0x3a3a1e){var _0x27b1e1=_0x1cb9eb||client;return _0x27b1e1[_0xf9bc('0x1c')](_0x6393bc,_0x1a042b)[_0xf9bc('0x1d')](function(_0x39860f){logger[_0xf9bc('0x1e')]('VoiceContext,\x20%s,\x20%s',_0xb0a26,'request\x20sent');logger[_0xf9bc('0x1f')](_0xf9bc('0x20'),_0xb0a26,_0xf9bc('0x21'),JSON['stringify'](_0x39860f));if(_0x39860f['error']){if(_0x39860f[_0xf9bc('0x22')][_0xf9bc('0x23')]===0x1f4){logger[_0xf9bc('0x22')](_0xf9bc('0x24'),_0xb0a26,_0x39860f['error'][_0xf9bc('0x25')]);return _0x3a3a1e(_0x39860f['error']['message']);}logger[_0xf9bc('0x22')](_0xf9bc('0x24'),_0xb0a26,_0x39860f[_0xf9bc('0x22')][_0xf9bc('0x25')]);return _0xf31866(_0x39860f[_0xf9bc('0x22')][_0xf9bc('0x25')]);}else{logger[_0xf9bc('0x1e')](_0xf9bc('0x24'),_0xb0a26,'request\x20sent');_0xf31866(_0x39860f[_0xf9bc('0x26')][_0xf9bc('0x25')]);}})[_0xf9bc('0x27')](function(_0x3045e0){logger['error'](_0xf9bc('0x24'),_0xb0a26,_0x3045e0);_0x3a3a1e(_0x3045e0);});});}function respondWithStatusCode(_0x4db8c2,_0x3c25b6){_0x3c25b6=_0x3c25b6||0xcc;return function(_0x404bc5){if(_0x404bc5){return _0x4db8c2[_0xf9bc('0x28')](_0x3c25b6);}return _0x4db8c2[_0xf9bc('0x29')](_0x3c25b6)[_0xf9bc('0x2a')]();};}function respondWithResult(_0x9644f7,_0x2e3b96){_0x2e3b96=_0x2e3b96||0xc8;return function(_0x601a8d){if(_0x601a8d){return _0x9644f7[_0xf9bc('0x29')](_0x2e3b96)[_0xf9bc('0x2b')](_0x601a8d);}};}function respondWithFilteredResult(_0x5cf0b3,_0x1edb10){return function(_0x4d298d){if(_0x4d298d){var _0x513c9c=typeof _0x1edb10['offset']===_0xf9bc('0x2c')&&typeof _0x1edb10[_0xf9bc('0x2d')]===_0xf9bc('0x2c');var _0x4b6990=_0x4d298d[_0xf9bc('0x2e')];var _0x107831=_0x513c9c?0x0:_0x1edb10[_0xf9bc('0x2f')];var _0x10342f=_0x513c9c?_0x4d298d[_0xf9bc('0x2e')]:_0x1edb10[_0xf9bc('0x2f')]+_0x1edb10[_0xf9bc('0x2d')];var _0x227374;if(_0x10342f>=_0x4b6990){_0x10342f=_0x4b6990;_0x227374=0xc8;}else{_0x227374=0xce;}_0x5cf0b3['status'](_0x227374);return _0x5cf0b3[_0xf9bc('0x30')](_0xf9bc('0x31'),_0x107831+'-'+_0x10342f+'/'+_0x4b6990)[_0xf9bc('0x2b')](_0x4d298d);}return null;};}function patchUpdates(_0x39f1b4){return function(_0x1250cc){try{jsonpatch['apply'](_0x1250cc,_0x39f1b4,!![]);}catch(_0x4ea561){return BPromise['reject'](_0x4ea561);}return _0x1250cc[_0xf9bc('0x32')]();};}function saveUpdates(_0x30aeb3,_0x21213c){return function(_0x394a8e){if(_0x394a8e){return _0x394a8e[_0xf9bc('0x33')](_0x30aeb3)['then'](function(_0xd9b7af){return _0xd9b7af;});}return null;};}function removeEntity(_0x5f1178,_0x5367f2){return function(_0x31ded4){if(_0x31ded4){return _0x31ded4[_0xf9bc('0x34')]()['then'](function(){var _0x21136b=_0x31ded4[_0xf9bc('0x35')]({'plain':!![]});var _0x4c136f=_0xf9bc('0x36');return db[_0xf9bc('0x37')]['destroy']({'where':{'type':_0x4c136f,'resourceId':_0x21136b['id']}})[_0xf9bc('0x1d')](function(){return _0x31ded4;});})[_0xf9bc('0x1d')](function(){_0x5f1178[_0xf9bc('0x29')](0xcc)[_0xf9bc('0x2a')]();});}};}function handleEntityNotFound(_0x29325b,_0x491f71){return function(_0x56b391){if(!_0x56b391){_0x29325b['sendStatus'](0x194);}return _0x56b391;};}function handleError(_0x17b183,_0x35874e){_0x35874e=_0x35874e||0x1f4;return function(_0x40e624){logger['error'](_0x40e624[_0xf9bc('0x38')]);if(_0x40e624[_0xf9bc('0x39')]){delete _0x40e624[_0xf9bc('0x39')];}_0x17b183[_0xf9bc('0x29')](_0x35874e)[_0xf9bc('0x3a')](_0x40e624);};}exports[_0xf9bc('0x3b')]=function(_0x431456,_0x34a055){var _0x51ffd7={},_0x15d35f={},_0x369369={'count':0x0,'rows':[]};var _0x469115=_['map'](db[_0xf9bc('0x3c')][_0xf9bc('0x3d')],function(_0x35ab40){return{'name':_0x35ab40['fieldName'],'type':_0x35ab40[_0xf9bc('0x3e')]['key']};});_0x15d35f[_0xf9bc('0x3f')]=_['map'](_0x469115,'name');_0x15d35f['query']=_[_0xf9bc('0x40')](_0x431456[_0xf9bc('0x41')]);_0x15d35f['filters']=_[_0xf9bc('0x42')](_0x15d35f['model'],_0x15d35f['query']);_0x51ffd7[_0xf9bc('0x43')]=_[_0xf9bc('0x42')](_0x15d35f[_0xf9bc('0x3f')],qs[_0xf9bc('0x44')](_0x431456['query'][_0xf9bc('0x44')]));_0x51ffd7[_0xf9bc('0x43')]=_0x51ffd7[_0xf9bc('0x43')][_0xf9bc('0x45')]?_0x51ffd7['attributes']:_0x15d35f[_0xf9bc('0x3f')];if(!_0x431456[_0xf9bc('0x41')][_0xf9bc('0x46')](_0xf9bc('0x47'))){_0x51ffd7[_0xf9bc('0x2d')]=qs[_0xf9bc('0x2d')](_0x431456[_0xf9bc('0x41')][_0xf9bc('0x2d')]);_0x51ffd7[_0xf9bc('0x2f')]=qs[_0xf9bc('0x2f')](_0x431456['query']['offset']);}_0x51ffd7[_0xf9bc('0x48')]=qs[_0xf9bc('0x49')](_0x431456[_0xf9bc('0x41')][_0xf9bc('0x49')]);_0x51ffd7[_0xf9bc('0x4a')]=qs[_0xf9bc('0x4b')](_['pick'](_0x431456[_0xf9bc('0x41')],_0x15d35f[_0xf9bc('0x4b')]),_0x469115);if(_0x431456[_0xf9bc('0x41')][_0xf9bc('0x4c')]){_0x51ffd7[_0xf9bc('0x4a')]=_[_0xf9bc('0x4d')](_0x51ffd7['where'],{'$or':_[_0xf9bc('0x4e')](_0x469115,function(_0x466d5c){if(_0x466d5c[_0xf9bc('0x3e')]!==_0xf9bc('0x4f')){var _0xb7b266={};_0xb7b266[_0x466d5c[_0xf9bc('0x39')]]={'$like':'%'+_0x431456[_0xf9bc('0x41')][_0xf9bc('0x4c')]+'%'};return _0xb7b266;}})});}_0x51ffd7=_[_0xf9bc('0x4d')]({},_0x51ffd7,_0x431456[_0xf9bc('0x50')]);var _0x2e4616={'where':_0x51ffd7[_0xf9bc('0x4a')]};return db[_0xf9bc('0x3c')][_0xf9bc('0x2e')](_0x2e4616)['then'](function(_0xbe7aba){_0x369369[_0xf9bc('0x2e')]=_0xbe7aba;if(_0x431456[_0xf9bc('0x41')][_0xf9bc('0x51')]){_0x51ffd7['include']=[{'all':!![]}];}return db[_0xf9bc('0x3c')][_0xf9bc('0x52')](_0x51ffd7);})[_0xf9bc('0x1d')](function(_0x704210){_0x369369[_0xf9bc('0x53')]=_0x704210;return _0x369369;})[_0xf9bc('0x1d')](respondWithFilteredResult(_0x34a055,_0x51ffd7))[_0xf9bc('0x27')](handleError(_0x34a055,null));};exports[_0xf9bc('0x54')]=function(_0x1108d9,_0x366718){var _0x4a31be={'raw':![],'where':{'id':_0x1108d9[_0xf9bc('0x55')]['id']}},_0xf4cc98={};_0xf4cc98['model']=_[_0xf9bc('0x40')](db[_0xf9bc('0x3c')][_0xf9bc('0x3d')]);_0xf4cc98[_0xf9bc('0x41')]=_[_0xf9bc('0x40')](_0x1108d9[_0xf9bc('0x41')]);_0xf4cc98[_0xf9bc('0x4b')]=_['intersection'](_0xf4cc98[_0xf9bc('0x3f')],_0xf4cc98[_0xf9bc('0x41')]);_0x4a31be[_0xf9bc('0x43')]=_[_0xf9bc('0x42')](_0xf4cc98[_0xf9bc('0x3f')],qs[_0xf9bc('0x44')](_0x1108d9[_0xf9bc('0x41')][_0xf9bc('0x44')]));_0x4a31be['attributes']=_0x4a31be[_0xf9bc('0x43')][_0xf9bc('0x45')]?_0x4a31be[_0xf9bc('0x43')]:_0xf4cc98['model'];if(_0x1108d9[_0xf9bc('0x41')]['includeAll']){_0x4a31be[_0xf9bc('0x56')]=[{'all':!![]}];}_0x4a31be=_[_0xf9bc('0x4d')]({},_0x4a31be,_0x1108d9[_0xf9bc('0x50')]);return db['VoiceContext'][_0xf9bc('0x57')](_0x4a31be)[_0xf9bc('0x1d')](handleEntityNotFound(_0x366718,null))[_0xf9bc('0x1d')](respondWithResult(_0x366718,null))[_0xf9bc('0x27')](handleError(_0x366718,null));};exports[_0xf9bc('0x58')]=function(_0x360ac2,_0x4d28f8,_0x5efb73){var _0xbfb77;return db[_0xf9bc('0x3c')][_0xf9bc('0x58')](_0x360ac2[_0xf9bc('0x59')],{'raw':!![]})[_0xf9bc('0x1d')](function(_0x3124d2){_0xbfb77=_0x3124d2;return db['VoiceContext'][_0xf9bc('0x52')]({'raw':!![]});})['then'](function(_0x7fd1e6){var _0x296747=fs[_0xf9bc('0x5a')](path[_0xf9bc('0x5b')](config[_0xf9bc('0x5c')],_0xf9bc('0x5d')),_0xf9bc('0x5e'));var _0x5597ca=ejs[_0xf9bc('0x5f')](_0x296747,{'contexts':_0x7fd1e6||[]});fs[_0xf9bc('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5597ca);})['then'](function(){return respondWithRpcPromise(_0xf9bc('0x61'),_0xf9bc('0x58'),{'module':_0xf9bc('0x62')});})['then'](function(){var _0x5ec299=_0x360ac2[_0xf9bc('0x63')][_0xf9bc('0x35')]({'plain':!![]});if(!_0x5ec299)throw new Error(_0xf9bc('0x64'));if(_0x5ec299['role']===_0xf9bc('0x63')){var _0x33a396=_0xbfb77[_0xf9bc('0x35')]({'plain':!![]});return db[_0xf9bc('0x65')][_0xf9bc('0x57')]({'where':{'name':_0xf9bc('0x36'),'userProfileId':_0x5ec299[_0xf9bc('0x66')]},'raw':!![]})[_0xf9bc('0x1d')](function(_0x426d40){if(_0x426d40&&_0x426d40[_0xf9bc('0x67')]===0x0){return db[_0xf9bc('0x37')][_0xf9bc('0x58')]({'name':_0x33a396[_0xf9bc('0x39')],'resourceId':_0x33a396['id'],'type':_0x426d40[_0xf9bc('0x39')],'sectionId':_0x426d40['id']},{})['then'](function(){return _0xbfb77;});}else{return _0xbfb77;}})[_0xf9bc('0x27')](function(_0x43beba){logger[_0xf9bc('0x22')](_0xf9bc('0x68'),_0x43beba);throw _0x43beba;});}return _0xbfb77;})['then'](respondWithResult(_0x4d28f8,0xc9))[_0xf9bc('0x27')](handleError(_0x4d28f8,null));};exports[_0xf9bc('0x33')]=function(_0x47fde8,_0x2201ba,_0x1ea36e){var _0x5693f2;return db[_0xf9bc('0x3c')][_0xf9bc('0x57')]({'where':{'id':_0x47fde8['params']['id']}})[_0xf9bc('0x1d')](handleEntityNotFound(_0x2201ba,null))[_0xf9bc('0x1d')](saveUpdates(_0x47fde8['body'],null))['then'](function(_0x4a6629){if(_0x4a6629){_0x5693f2=_0x4a6629;return db[_0xf9bc('0x3c')][_0xf9bc('0x52')]({'raw':!![]});}})[_0xf9bc('0x1d')](function(_0x254c58){var _0x557e53=fs[_0xf9bc('0x5a')](path[_0xf9bc('0x5b')](config['root'],_0xf9bc('0x5d')),'utf8');var _0x59df61=ejs[_0xf9bc('0x5f')](_0x557e53,{'contexts':_0x254c58||[]});fs['writeFileSync'](_0xf9bc('0x69'),_0x59df61);})[_0xf9bc('0x1d')](function(){return respondWithRpcPromise(_0xf9bc('0x61'),_0xf9bc('0x33'),{'module':_0xf9bc('0x62')});})['then'](function(){return _0x5693f2;})['then'](respondWithResult(_0x2201ba,null))[_0xf9bc('0x27')](handleError(_0x2201ba,null));};exports[_0xf9bc('0x34')]=function(_0x42d74b,_0x3ef3ba,_0x167753){var _0x25efa1;return db[_0xf9bc('0x3c')][_0xf9bc('0x57')]({'where':{'id':_0x42d74b[_0xf9bc('0x55')]['id']}})[_0xf9bc('0x1d')](handleEntityNotFound(_0x3ef3ba,null))[_0xf9bc('0x1d')](removeEntity(_0x3ef3ba,null))['then'](function(){return db['VoiceContext'][_0xf9bc('0x52')]({'raw':!![]});})['then'](function(_0x4bd9b3){var _0xe1a788=fs[_0xf9bc('0x5a')](path['join'](config[_0xf9bc('0x5c')],_0xf9bc('0x5d')),_0xf9bc('0x5e'));var _0x59cf23=ejs[_0xf9bc('0x5f')](_0xe1a788,{'contexts':_0x4bd9b3});fs[_0xf9bc('0x60')](_0xf9bc('0x69'),_0x59cf23);return respondWithRpcPromise('Reload',_0xf9bc('0x34'),{'module':_0xf9bc('0x62')});})[_0xf9bc('0x27')](handleError(_0x3ef3ba,null));}; \ No newline at end of file +var _0xd6c0=['info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','Contexts','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','client','request','then'];(function(_0x28a4a8,_0x151298){var _0x5a8c2d=function(_0x8ef80f){while(--_0x8ef80f){_0x28a4a8['push'](_0x28a4a8['shift']());}};_0x5a8c2d(++_0x151298);}(_0xd6c0,0x111));var _0x0d6c=function(_0x31f5d5,_0x5e8c3d){_0x31f5d5=_0x31f5d5-0x0;var _0x38f5ed=_0xd6c0[_0x31f5d5];return _0x38f5ed;};'use strict';var emlformat=require(_0x0d6c('0x0'));var rimraf=require(_0x0d6c('0x1'));var zipdir=require(_0x0d6c('0x2'));var jsonpatch=require(_0x0d6c('0x3'));var rp=require('request-promise');var moment=require(_0x0d6c('0x4'));var BPromise=require(_0x0d6c('0x5'));var Mustache=require('mustache');var util=require(_0x0d6c('0x6'));var path=require(_0x0d6c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d6c('0x8'));var fs=require('fs');var fs_extra=require(_0x0d6c('0x9'));var _=require('lodash');var squel=require(_0x0d6c('0xa'));var crypto=require(_0x0d6c('0xb'));var jsforce=require(_0x0d6c('0xc'));var deskjs=require(_0x0d6c('0xd'));var toCsv=require(_0x0d6c('0xe'));var querystring=require('querystring');var Papa=require(_0x0d6c('0xf'));var Redis=require(_0x0d6c('0x10'));var authService=require(_0x0d6c('0x11'));var qs=require(_0x0d6c('0x12'));var as=require(_0x0d6c('0x13'));var hardwareService=require(_0x0d6c('0x14'));var logger=require(_0x0d6c('0x15'))('api');var utils=require(_0x0d6c('0x16'));var config=require(_0x0d6c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0d6c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x550d6c,_0x592800,_0x1fec25,_0x4b934d){return new BPromise(function(_0x596512,_0x2fe10b){var _0x30f3cf=_0x4b934d||client;return _0x30f3cf[_0x0d6c('0x19')](_0x550d6c,_0x1fec25)[_0x0d6c('0x1a')](function(_0x33f252){logger[_0x0d6c('0x1b')](_0x0d6c('0x1c'),_0x592800,'request\x20sent');logger['debug'](_0x0d6c('0x1d'),_0x592800,_0x0d6c('0x1e'),JSON['stringify'](_0x33f252));if(_0x33f252[_0x0d6c('0x1f')]){if(_0x33f252['error']['code']===0x1f4){logger[_0x0d6c('0x1f')](_0x0d6c('0x1c'),_0x592800,_0x33f252[_0x0d6c('0x1f')][_0x0d6c('0x20')]);return _0x2fe10b(_0x33f252[_0x0d6c('0x1f')][_0x0d6c('0x20')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x592800,_0x33f252[_0x0d6c('0x1f')][_0x0d6c('0x20')]);return _0x596512(_0x33f252[_0x0d6c('0x1f')][_0x0d6c('0x20')]);}else{logger[_0x0d6c('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x592800,_0x0d6c('0x1e'));_0x596512(_0x33f252['result'][_0x0d6c('0x20')]);}})[_0x0d6c('0x21')](function(_0x328fe6){logger[_0x0d6c('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x592800,_0x328fe6);_0x2fe10b(_0x328fe6);});});}function respondWithStatusCode(_0x524d3d,_0xeeda15){_0xeeda15=_0xeeda15||0xcc;return function(_0x3d62d3){if(_0x3d62d3){return _0x524d3d['sendStatus'](_0xeeda15);}return _0x524d3d['status'](_0xeeda15)[_0x0d6c('0x22')]();};}function respondWithResult(_0xe029da,_0x459187){_0x459187=_0x459187||0xc8;return function(_0x5f0795){if(_0x5f0795){return _0xe029da[_0x0d6c('0x23')](_0x459187)[_0x0d6c('0x24')](_0x5f0795);}};}function respondWithFilteredResult(_0x1af7b6,_0x4198cb){return function(_0x53b78f){if(_0x53b78f){var _0x41edc4=typeof _0x4198cb[_0x0d6c('0x25')]===_0x0d6c('0x26')&&typeof _0x4198cb['limit']===_0x0d6c('0x26');var _0x4aa5c9=_0x53b78f[_0x0d6c('0x27')];var _0xd41bbd=_0x41edc4?0x0:_0x4198cb['offset'];var _0x9874ad=_0x41edc4?_0x53b78f[_0x0d6c('0x27')]:_0x4198cb[_0x0d6c('0x25')]+_0x4198cb[_0x0d6c('0x28')];var _0xa18f34;if(_0x9874ad>=_0x4aa5c9){_0x9874ad=_0x4aa5c9;_0xa18f34=0xc8;}else{_0xa18f34=0xce;}_0x1af7b6[_0x0d6c('0x23')](_0xa18f34);return _0x1af7b6[_0x0d6c('0x29')](_0x0d6c('0x2a'),_0xd41bbd+'-'+_0x9874ad+'/'+_0x4aa5c9)['json'](_0x53b78f);}return null;};}function patchUpdates(_0x35fa25){return function(_0x4b5e57){try{jsonpatch[_0x0d6c('0x2b')](_0x4b5e57,_0x35fa25,!![]);}catch(_0x3521c2){return BPromise[_0x0d6c('0x2c')](_0x3521c2);}return _0x4b5e57['save']();};}function saveUpdates(_0x25f9e0,_0x2d6403){return function(_0x4cb198){if(_0x4cb198){return _0x4cb198[_0x0d6c('0x2d')](_0x25f9e0)['then'](function(_0x17a3d4){return _0x17a3d4;});}return null;};}function removeEntity(_0x3e160d,_0x34f733){return function(_0x8029b5){if(_0x8029b5){return _0x8029b5[_0x0d6c('0x2e')]()[_0x0d6c('0x1a')](function(){var _0x5aec59=_0x8029b5['get']({'plain':!![]});var _0x1cbc4e=_0x0d6c('0x2f');return db[_0x0d6c('0x30')][_0x0d6c('0x2e')]({'where':{'type':_0x1cbc4e,'resourceId':_0x5aec59['id']}})[_0x0d6c('0x1a')](function(){return _0x8029b5;});})['then'](function(){_0x3e160d['status'](0xcc)[_0x0d6c('0x22')]();});}};}function handleEntityNotFound(_0x3f8c38,_0x32b7e7){return function(_0x5836bd){if(!_0x5836bd){_0x3f8c38[_0x0d6c('0x31')](0x194);}return _0x5836bd;};}function handleError(_0x547388,_0x573d6a){_0x573d6a=_0x573d6a||0x1f4;return function(_0x2bdec3){logger[_0x0d6c('0x1f')](_0x2bdec3[_0x0d6c('0x32')]);if(_0x2bdec3[_0x0d6c('0x33')]){delete _0x2bdec3['name'];}_0x547388[_0x0d6c('0x23')](_0x573d6a)[_0x0d6c('0x34')](_0x2bdec3);};}exports[_0x0d6c('0x35')]=function(_0x35809e,_0x578ba3){var _0x4fefd0={},_0x231053={},_0x5c382b={'count':0x0,'rows':[]};var _0x13b9a8=_[_0x0d6c('0x36')](db[_0x0d6c('0x37')][_0x0d6c('0x38')],function(_0x1e37d9){return{'name':_0x1e37d9[_0x0d6c('0x39')],'type':_0x1e37d9[_0x0d6c('0x3a')][_0x0d6c('0x3b')]};});_0x231053[_0x0d6c('0x3c')]=_[_0x0d6c('0x36')](_0x13b9a8,_0x0d6c('0x33'));_0x231053[_0x0d6c('0x3d')]=_['keys'](_0x35809e['query']);_0x231053[_0x0d6c('0x3e')]=_[_0x0d6c('0x3f')](_0x231053[_0x0d6c('0x3c')],_0x231053['query']);_0x4fefd0[_0x0d6c('0x40')]=_[_0x0d6c('0x3f')](_0x231053[_0x0d6c('0x3c')],qs['fields'](_0x35809e[_0x0d6c('0x3d')][_0x0d6c('0x41')]));_0x4fefd0[_0x0d6c('0x40')]=_0x4fefd0[_0x0d6c('0x40')][_0x0d6c('0x42')]?_0x4fefd0[_0x0d6c('0x40')]:_0x231053[_0x0d6c('0x3c')];if(!_0x35809e[_0x0d6c('0x3d')][_0x0d6c('0x43')](_0x0d6c('0x44'))){_0x4fefd0[_0x0d6c('0x28')]=qs[_0x0d6c('0x28')](_0x35809e[_0x0d6c('0x3d')]['limit']);_0x4fefd0['offset']=qs['offset'](_0x35809e[_0x0d6c('0x3d')][_0x0d6c('0x25')]);}_0x4fefd0[_0x0d6c('0x45')]=qs[_0x0d6c('0x46')](_0x35809e[_0x0d6c('0x3d')]['sort']);_0x4fefd0[_0x0d6c('0x47')]=qs[_0x0d6c('0x3e')](_[_0x0d6c('0x48')](_0x35809e[_0x0d6c('0x3d')],_0x231053['filters']),_0x13b9a8);if(_0x35809e[_0x0d6c('0x3d')][_0x0d6c('0x49')]){_0x4fefd0['where']=_[_0x0d6c('0x4a')](_0x4fefd0[_0x0d6c('0x47')],{'$or':_[_0x0d6c('0x36')](_0x13b9a8,function(_0x866954){if(_0x866954[_0x0d6c('0x3a')]!==_0x0d6c('0x4b')){var _0x68d88d={};_0x68d88d[_0x866954['name']]={'$like':'%'+_0x35809e['query'][_0x0d6c('0x49')]+'%'};return _0x68d88d;}})});}_0x4fefd0=_['merge']({},_0x4fefd0,_0x35809e[_0x0d6c('0x4c')]);var _0x8967e7={'where':_0x4fefd0['where']};return db[_0x0d6c('0x37')][_0x0d6c('0x27')](_0x8967e7)['then'](function(_0x486540){_0x5c382b[_0x0d6c('0x27')]=_0x486540;if(_0x35809e[_0x0d6c('0x3d')][_0x0d6c('0x4d')]){_0x4fefd0[_0x0d6c('0x4e')]=[{'all':!![]}];}return db[_0x0d6c('0x37')][_0x0d6c('0x4f')](_0x4fefd0);})[_0x0d6c('0x1a')](function(_0x5ee4ca){_0x5c382b['rows']=_0x5ee4ca;return _0x5c382b;})[_0x0d6c('0x1a')](respondWithFilteredResult(_0x578ba3,_0x4fefd0))[_0x0d6c('0x21')](handleError(_0x578ba3,null));};exports[_0x0d6c('0x50')]=function(_0x1c345c,_0x1312fb){var _0x26ebfd={'raw':![],'where':{'id':_0x1c345c[_0x0d6c('0x51')]['id']}},_0x68a942={};_0x68a942['model']=_[_0x0d6c('0x52')](db[_0x0d6c('0x37')]['rawAttributes']);_0x68a942[_0x0d6c('0x3d')]=_[_0x0d6c('0x52')](_0x1c345c[_0x0d6c('0x3d')]);_0x68a942[_0x0d6c('0x3e')]=_[_0x0d6c('0x3f')](_0x68a942[_0x0d6c('0x3c')],_0x68a942[_0x0d6c('0x3d')]);_0x26ebfd[_0x0d6c('0x40')]=_[_0x0d6c('0x3f')](_0x68a942['model'],qs[_0x0d6c('0x41')](_0x1c345c[_0x0d6c('0x3d')][_0x0d6c('0x41')]));_0x26ebfd[_0x0d6c('0x40')]=_0x26ebfd['attributes'][_0x0d6c('0x42')]?_0x26ebfd[_0x0d6c('0x40')]:_0x68a942[_0x0d6c('0x3c')];if(_0x1c345c[_0x0d6c('0x3d')][_0x0d6c('0x4d')]){_0x26ebfd['include']=[{'all':!![]}];}_0x26ebfd=_[_0x0d6c('0x4a')]({},_0x26ebfd,_0x1c345c[_0x0d6c('0x4c')]);return db[_0x0d6c('0x37')][_0x0d6c('0x53')](_0x26ebfd)[_0x0d6c('0x1a')](handleEntityNotFound(_0x1312fb,null))['then'](respondWithResult(_0x1312fb,null))['catch'](handleError(_0x1312fb,null));};exports['create']=function(_0x7b3cf6,_0x32494f,_0x536a3f){var _0x5281d0;return db['VoiceContext'][_0x0d6c('0x54')](_0x7b3cf6[_0x0d6c('0x55')],{'raw':!![]})[_0x0d6c('0x1a')](function(_0x4518e0){_0x5281d0=_0x4518e0;return db[_0x0d6c('0x37')][_0x0d6c('0x4f')]({'raw':!![]});})[_0x0d6c('0x1a')](function(_0x54d446){var _0x7dab25=fs[_0x0d6c('0x56')](path[_0x0d6c('0x57')](config[_0x0d6c('0x58')],'server/files/templates/context.ejs'),_0x0d6c('0x59'));var _0x2e85b5=ejs[_0x0d6c('0x5a')](_0x7dab25,{'contexts':_0x54d446||[]});fs[_0x0d6c('0x5b')](_0x0d6c('0x5c'),_0x2e85b5);})[_0x0d6c('0x1a')](function(){return respondWithRpcPromise(_0x0d6c('0x5d'),_0x0d6c('0x54'),{'module':_0x0d6c('0x5e')});})[_0x0d6c('0x1a')](function(){var _0xf87c33=_0x7b3cf6['user'][_0x0d6c('0x5f')]({'plain':!![]});if(!_0xf87c33)throw new Error(_0x0d6c('0x60'));if(_0xf87c33['role']==='user'){var _0x212f71=_0x5281d0['get']({'plain':!![]});return db[_0x0d6c('0x61')][_0x0d6c('0x53')]({'where':{'name':_0x0d6c('0x2f'),'userProfileId':_0xf87c33['userProfileId']},'raw':!![]})[_0x0d6c('0x1a')](function(_0x32a1ab){if(_0x32a1ab&&_0x32a1ab['autoAssociation']===0x0){return db[_0x0d6c('0x30')][_0x0d6c('0x54')]({'name':_0x212f71[_0x0d6c('0x33')],'resourceId':_0x212f71['id'],'type':_0x32a1ab[_0x0d6c('0x33')],'sectionId':_0x32a1ab['id']},{})[_0x0d6c('0x1a')](function(){return _0x5281d0;});}else{return _0x5281d0;}})[_0x0d6c('0x21')](function(_0x4ffdc2){logger['error'](_0x0d6c('0x62'),_0x4ffdc2);throw _0x4ffdc2;});}return _0x5281d0;})[_0x0d6c('0x1a')](respondWithResult(_0x32494f,0xc9))[_0x0d6c('0x21')](handleError(_0x32494f,null));};exports[_0x0d6c('0x2d')]=function(_0x6052df,_0x98e6a6,_0x3d8c24){var _0x5278fd;return db[_0x0d6c('0x37')][_0x0d6c('0x53')]({'where':{'id':_0x6052df[_0x0d6c('0x51')]['id']}})['then'](handleEntityNotFound(_0x98e6a6,null))[_0x0d6c('0x1a')](saveUpdates(_0x6052df[_0x0d6c('0x55')],null))[_0x0d6c('0x1a')](function(_0x1328e4){if(_0x1328e4){_0x5278fd=_0x1328e4;return db[_0x0d6c('0x37')]['findAll']({'raw':!![]});}})[_0x0d6c('0x1a')](function(_0x2feead){var _0x253b99=fs['readFileSync'](path[_0x0d6c('0x57')](config[_0x0d6c('0x58')],'server/files/templates/context.ejs'),_0x0d6c('0x59'));var _0x2890af=ejs[_0x0d6c('0x5a')](_0x253b99,{'contexts':_0x2feead||[]});fs[_0x0d6c('0x5b')](_0x0d6c('0x5c'),_0x2890af);})[_0x0d6c('0x1a')](function(){return respondWithRpcPromise(_0x0d6c('0x5d'),_0x0d6c('0x2d'),{'module':_0x0d6c('0x5e')});})[_0x0d6c('0x1a')](function(){return _0x5278fd;})[_0x0d6c('0x1a')](respondWithResult(_0x98e6a6,null))['catch'](handleError(_0x98e6a6,null));};exports[_0x0d6c('0x2e')]=function(_0x4b5c95,_0x1a078a,_0x2150d6){var _0x39f597;return db[_0x0d6c('0x37')][_0x0d6c('0x53')]({'where':{'id':_0x4b5c95[_0x0d6c('0x51')]['id']}})[_0x0d6c('0x1a')](handleEntityNotFound(_0x1a078a,null))['then'](removeEntity(_0x1a078a,null))[_0x0d6c('0x1a')](function(){return db[_0x0d6c('0x37')][_0x0d6c('0x4f')]({'raw':!![]});})[_0x0d6c('0x1a')](function(_0x441444){var _0x221ea2=fs[_0x0d6c('0x56')](path['join'](config[_0x0d6c('0x58')],_0x0d6c('0x63')),_0x0d6c('0x59'));var _0x1a53db=ejs[_0x0d6c('0x5a')](_0x221ea2,{'contexts':_0x441444});fs[_0x0d6c('0x5b')](_0x0d6c('0x5c'),_0x1a53db);return respondWithRpcPromise(_0x0d6c('0x5d'),_0x0d6c('0x2e'),{'module':'chan_sip.so'});})[_0x0d6c('0x21')](handleError(_0x1a078a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3323ac7..339aa5b 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 _0x0cf1=['voice_contexts','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0x0cf1,0xb0));var _0x10cf=function(_0x66c0ed,_0x1e0940){_0x66c0ed=_0x66c0ed-0x0;var _0x321ec7=_0x0cf1[_0x66c0ed];return _0x321ec7;};'use strict';var _=require(_0x10cf('0x0'));var util=require('util');var logger=require(_0x10cf('0x1'))(_0x10cf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x10cf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10cf('0x4'));var config=require(_0x10cf('0x5'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x5e84b3,_0x5097d8){return _0x5e84b3['define']('VoiceContext',attributes,{'tableName':_0x10cf('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf66b=['voice_contexts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define'];(function(_0x2384f6,_0x167775){var _0x370294=function(_0x8f68f4){while(--_0x8f68f4){_0x2384f6['push'](_0x2384f6['shift']());}};_0x370294(++_0x167775);}(_0xf66b,0x1ae));var _0xbf66=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf66b[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xbf66('0x0'));var util=require('util');var logger=require(_0xbf66('0x1'))(_0xbf66('0x2'));var moment=require(_0xbf66('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf66('0x4'));var fs=require('fs');var path=require(_0xbf66('0x5'));var rimraf=require(_0xbf66('0x6'));var config=require(_0xbf66('0x7'));var attributes=require(_0xbf66('0x8'));module['exports']=function(_0x5c14db,_0x2be054){return _0x5c14db[_0xbf66('0x9')]('VoiceContext',attributes,{'tableName':_0xbf66('0xa'),'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 266e187..9857e86 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 _0x63a5=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x409e6b,_0x5bc9d6){var _0x34f3ab=function(_0x2fe920){while(--_0x2fe920){_0x409e6b['push'](_0x409e6b['shift']());}};_0x34f3ab(++_0x5bc9d6);}(_0x63a5,0x18e));var _0x563a=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x63a5[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2662f7,_0x4f89b4,_0x4d71a0){return new BPromise(function(_0x543920,_0xff1f59){return client[_0x563a('0x9')](_0x2662f7,_0x4d71a0)[_0x563a('0xa')](function(_0x606235){logger[_0x563a('0xb')](_0x563a('0xc'),_0x4f89b4,_0x563a('0xd'));logger[_0x563a('0xe')](_0x563a('0xf'),_0x4f89b4,_0x563a('0xd'),JSON[_0x563a('0x10')](_0x606235));if(_0x606235[_0x563a('0x11')]){if(_0x606235[_0x563a('0x11')][_0x563a('0x12')]===0x1f4){logger['error'](_0x563a('0xc'),_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0xff1f59(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}logger[_0x563a('0x11')]('VoiceContext,\x20%s,\x20%s',_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0x543920(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x4f89b4,_0x563a('0xd'));_0x543920(_0x606235[_0x563a('0x14')]['message']);}})[_0x563a('0x15')](function(_0x43fb16){logger[_0x563a('0x11')](_0x563a('0xc'),_0x4f89b4,_0x43fb16);_0xff1f59(_0x43fb16);});});} \ No newline at end of file +var _0xeee9=['message','VoiceContext,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xc30c4,_0x5f1f5b){var _0x169e1d=function(_0x1bf26f){while(--_0x1bf26f){_0xc30c4['push'](_0xc30c4['shift']());}};_0x169e1d(++_0x5f1f5b);}(_0xeee9,0x153));var _0x9eee=function(_0x288e1b,_0x10a8cc){_0x288e1b=_0x288e1b-0x0;var _0x33cf43=_0xeee9[_0x288e1b];return _0x33cf43;};'use strict';var _=require('lodash');var util=require(_0x9eee('0x0'));var moment=require(_0x9eee('0x1'));var BPromise=require(_0x9eee('0x2'));var rs=require(_0x9eee('0x3'));var fs=require('fs');var Redis=require(_0x9eee('0x4'));var db=require(_0x9eee('0x5'))['db'];var utils=require(_0x9eee('0x6'));var logger=require(_0x9eee('0x7'))(_0x9eee('0x8'));var config=require('../../config/environment');var jayson=require(_0x9eee('0x9'));var client=jayson[_0x9eee('0xa')][_0x9eee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37a570,_0x13d7e7,_0x5aa5b4){return new BPromise(function(_0x44c3c3,_0xa5270e){return client[_0x9eee('0xc')](_0x37a570,_0x5aa5b4)[_0x9eee('0xd')](function(_0x173449){logger[_0x9eee('0xe')]('VoiceContext,\x20%s,\x20%s',_0x13d7e7,_0x9eee('0xf'));logger[_0x9eee('0x10')](_0x9eee('0x11'),_0x13d7e7,_0x9eee('0xf'),JSON[_0x9eee('0x12')](_0x173449));if(_0x173449[_0x9eee('0x13')]){if(_0x173449[_0x9eee('0x13')][_0x9eee('0x14')]===0x1f4){logger[_0x9eee('0x13')]('VoiceContext,\x20%s,\x20%s',_0x13d7e7,_0x173449[_0x9eee('0x13')][_0x9eee('0x15')]);return _0xa5270e(_0x173449[_0x9eee('0x13')][_0x9eee('0x15')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x13d7e7,_0x173449[_0x9eee('0x13')][_0x9eee('0x15')]);return _0x44c3c3(_0x173449[_0x9eee('0x13')][_0x9eee('0x15')]);}else{logger[_0x9eee('0xe')](_0x9eee('0x16'),_0x13d7e7,_0x9eee('0xf'));_0x44c3c3(_0x173449[_0x9eee('0x17')][_0x9eee('0x15')]);}})['catch'](function(_0x120ce5){logger['error'](_0x9eee('0x16'),_0x13d7e7,_0x120ce5);_0xa5270e(_0x120ce5);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8e79553..bd59978 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 _0x168b=['describe','/:id','show','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x250a95,_0x196c08){var _0x16c896=function(_0x45f993){while(--_0x45f993){_0x250a95['push'](_0x250a95['shift']());}};_0x16c896(++_0x196c08);}(_0x168b,0x9b));var _0xb168=function(_0x2bbfdf,_0x5db59d){_0x2bbfdf=_0x2bbfdf-0x0;var _0x5a9041=_0x168b[_0x2bbfdf];return _0x5a9041;};'use strict';var multer=require(_0xb168('0x0'));var util=require(_0xb168('0x1'));var path=require(_0xb168('0x2'));var timeout=require('connect-timeout');var express=require(_0xb168('0x3'));var router=express[_0xb168('0x4')]();var fs_extra=require(_0xb168('0x5'));var auth=require(_0xb168('0x6'));var interaction=require(_0xb168('0x7'));var config=require(_0xb168('0x8'));var controller=require('./voiceDialReport.controller');router[_0xb168('0x9')]('/',auth[_0xb168('0xa')](),controller[_0xb168('0xb')]);router['get'](_0xb168('0xc'),auth[_0xb168('0xa')](),controller[_0xb168('0xd')]);router[_0xb168('0x9')](_0xb168('0xe'),auth[_0xb168('0xa')](),controller[_0xb168('0xf')]);router[_0xb168('0x10')]('/',auth[_0xb168('0xa')](),controller[_0xb168('0x11')]);router[_0xb168('0x12')](_0xb168('0xe'),auth[_0xb168('0xa')](),controller['update']);router[_0xb168('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb168('0x14')]);module['exports']=router; \ No newline at end of file +var _0x0a21=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','get','describe','/:id','post','update','delete','destroy','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0a21,0x9f));var _0x10a2=function(_0x223aa9,_0x50f5e1){_0x223aa9=_0x223aa9-0x0;var _0x402858=_0x0a21[_0x223aa9];return _0x402858;};'use strict';var multer=require('multer');var util=require(_0x10a2('0x0'));var path=require('path');var timeout=require(_0x10a2('0x1'));var express=require(_0x10a2('0x2'));var router=express['Router']();var fs_extra=require(_0x10a2('0x3'));var auth=require(_0x10a2('0x4'));var interaction=require(_0x10a2('0x5'));var config=require(_0x10a2('0x6'));var controller=require(_0x10a2('0x7'));router['get']('/',auth[_0x10a2('0x8')](),controller['index']);router[_0x10a2('0x9')]('/describe',auth[_0x10a2('0x8')](),controller[_0x10a2('0xa')]);router[_0x10a2('0x9')](_0x10a2('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x10a2('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x10a2('0xb'),auth[_0x10a2('0x8')](),controller[_0x10a2('0xd')]);router[_0x10a2('0xe')](_0x10a2('0xb'),auth[_0x10a2('0x8')](),controller[_0x10a2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 4319625..d39dae9 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 _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x526424,_0x4373a1){var _0x54f2d4=function(_0x326877){while(--_0x326877){_0x526424['push'](_0x526424['shift']());}};_0x54f2d4(++_0x4373a1);}(_0xa41a,0x6b));var _0xaa41=function(_0xc38e6f,_0x525004){_0xc38e6f=_0xc38e6f-0x0;var _0x4e7bf5=_0xa41a[_0xc38e6f];return _0x4e7bf5;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x37804c,_0x351907){var _0x5e1a28=function(_0x62ff4f){while(--_0x62ff4f){_0x37804c['push'](_0x37804c['shift']());}};_0x5e1a28(++_0x351907);}(_0xe5b3,0x133));var _0x3e5b=function(_0x30b942,_0x5198f0){_0x30b942=_0x30b942-0x0;var _0x3d486d=_0xe5b3[_0x30b942];return _0x3d486d;};'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 diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 4bbb58f..ae7a649 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 _0x6e50=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','sendStatus','error','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','name','options','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1644ef,_0x4b4041){var _0x5c3967=function(_0x2198c6){while(--_0x2198c6){_0x1644ef['push'](_0x1644ef['shift']());}};_0x5c3967(++_0x4b4041);}(_0x6e50,0x1ab));var _0x06e5=function(_0x27d216,_0x3500dd){_0x27d216=_0x27d216-0x0;var _0x43f016=_0x6e50[_0x27d216];return _0x43f016;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x06e5('0x0'));var rp=require('request-promise');var moment=require(_0x06e5('0x1'));var BPromise=require(_0x06e5('0x2'));var Mustache=require(_0x06e5('0x3'));var util=require(_0x06e5('0x4'));var path=require(_0x06e5('0x5'));var sox=require(_0x06e5('0x6'));var csv=require(_0x06e5('0x7'));var ejs=require(_0x06e5('0x8'));var fs=require('fs');var fs_extra=require(_0x06e5('0x9'));var _=require(_0x06e5('0xa'));var squel=require(_0x06e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x06e5('0xc'));var deskjs=require(_0x06e5('0xd'));var toCsv=require(_0x06e5('0x7'));var querystring=require(_0x06e5('0xe'));var Papa=require(_0x06e5('0xf'));var Redis=require(_0x06e5('0x10'));var authService=require(_0x06e5('0x11'));var qs=require(_0x06e5('0x12'));var as=require(_0x06e5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x06e5('0x14'));var utils=require('../../config/utils');var config=require(_0x06e5('0x15'));var licenseUtil=require(_0x06e5('0x16'));var db=require(_0x06e5('0x17'))['db'];function respondWithStatusCode(_0x4e1e98,_0x474882){_0x474882=_0x474882||0xcc;return function(_0x1fd4ce){if(_0x1fd4ce){return _0x4e1e98['sendStatus'](_0x474882);}return _0x4e1e98['status'](_0x474882)[_0x06e5('0x18')]();};}function respondWithResult(_0x5b8746,_0x179108){_0x179108=_0x179108||0xc8;return function(_0x3a9d60){if(_0x3a9d60){return _0x5b8746[_0x06e5('0x19')](_0x179108)[_0x06e5('0x1a')](_0x3a9d60);}};}function respondWithFilteredResult(_0x24af62,_0x5eb1b2){return function(_0x24ae86){if(_0x24ae86){var _0xb6ec2f=typeof _0x5eb1b2['offset']===_0x06e5('0x1b')&&typeof _0x5eb1b2[_0x06e5('0x1c')]==='undefined';var _0x3caa13=_0x24ae86[_0x06e5('0x1d')];var _0x1d3553=_0xb6ec2f?0x0:_0x5eb1b2[_0x06e5('0x1e')];var _0x24493b=_0xb6ec2f?_0x24ae86['count']:_0x5eb1b2[_0x06e5('0x1e')]+_0x5eb1b2[_0x06e5('0x1c')];var _0xe8be71;if(_0x24493b>=_0x3caa13){_0x24493b=_0x3caa13;_0xe8be71=0xc8;}else{_0xe8be71=0xce;}_0x24af62['status'](_0xe8be71);return _0x24af62[_0x06e5('0x1f')](_0x06e5('0x20'),_0x1d3553+'-'+_0x24493b+'/'+_0x3caa13)[_0x06e5('0x1a')](_0x24ae86);}return null;};}function patchUpdates(_0x165c58){return function(_0x519a3e){try{jsonpatch[_0x06e5('0x21')](_0x519a3e,_0x165c58,!![]);}catch(_0x4a4210){return BPromise['reject'](_0x4a4210);}return _0x519a3e[_0x06e5('0x22')]();};}function saveUpdates(_0x3c7f07,_0x3f341f){return function(_0x115332){if(_0x115332){return _0x115332[_0x06e5('0x23')](_0x3c7f07)['then'](function(_0x29a608){return _0x29a608;});}return null;};}function removeEntity(_0x360a08,_0x1389e4){return function(_0x399a43){if(_0x399a43){return _0x399a43[_0x06e5('0x24')]()['then'](function(){_0x360a08[_0x06e5('0x19')](0xcc)[_0x06e5('0x18')]();});}};}function handleEntityNotFound(_0x926f30,_0x5b822b){return function(_0x5a59ca){if(!_0x5a59ca){_0x926f30[_0x06e5('0x25')](0x194);}return _0x5a59ca;};}function handleError(_0x3d234e,_0x21c8b1){_0x21c8b1=_0x21c8b1||0x1f4;return function(_0x154906){logger[_0x06e5('0x26')](_0x154906['stack']);if(_0x154906['name']){delete _0x154906['name'];}_0x3d234e[_0x06e5('0x19')](_0x21c8b1)['send'](_0x154906);};}exports['index']=function(_0x2e2ad2,_0x12ff33){var _0x3826e7={},_0x5c154f={},_0x75faf9={'count':0x0,'rows':[]};var _0x23fcd7=_[_0x06e5('0x27')](db[_0x06e5('0x28')][_0x06e5('0x29')],function(_0x5f11b6){return{'name':_0x5f11b6[_0x06e5('0x2a')],'type':_0x5f11b6[_0x06e5('0x2b')][_0x06e5('0x2c')]};});_0x5c154f[_0x06e5('0x2d')]=_[_0x06e5('0x27')](_0x23fcd7,'name');_0x5c154f[_0x06e5('0x2e')]=_[_0x06e5('0x2f')](_0x2e2ad2[_0x06e5('0x2e')]);_0x5c154f[_0x06e5('0x30')]=_['intersection'](_0x5c154f[_0x06e5('0x2d')],_0x5c154f[_0x06e5('0x2e')]);_0x3826e7['attributes']=_[_0x06e5('0x31')](_0x5c154f[_0x06e5('0x2d')],qs['fields'](_0x2e2ad2[_0x06e5('0x2e')][_0x06e5('0x32')]));_0x3826e7[_0x06e5('0x33')]=_0x3826e7[_0x06e5('0x33')][_0x06e5('0x34')]?_0x3826e7[_0x06e5('0x33')]:_0x5c154f[_0x06e5('0x2d')];if(!_0x2e2ad2['query'][_0x06e5('0x35')](_0x06e5('0x36'))){_0x3826e7['limit']=qs[_0x06e5('0x1c')](_0x2e2ad2[_0x06e5('0x2e')]['limit']);_0x3826e7['offset']=qs[_0x06e5('0x1e')](_0x2e2ad2[_0x06e5('0x2e')][_0x06e5('0x1e')]);}_0x3826e7[_0x06e5('0x37')]=qs['sort'](_0x2e2ad2[_0x06e5('0x2e')][_0x06e5('0x38')]);_0x3826e7['where']=qs[_0x06e5('0x30')](_['pick'](_0x2e2ad2[_0x06e5('0x2e')],_0x5c154f['filters']),_0x23fcd7);if(_0x2e2ad2[_0x06e5('0x2e')]['filter']){_0x3826e7[_0x06e5('0x39')]=_[_0x06e5('0x3a')](_0x3826e7[_0x06e5('0x39')],{'$or':_[_0x06e5('0x27')](_0x23fcd7,function(_0x43d9ea){if(_0x43d9ea[_0x06e5('0x2b')]!==_0x06e5('0x3b')){var _0x49cc4b={};_0x49cc4b[_0x43d9ea[_0x06e5('0x3c')]]={'$like':'%'+_0x2e2ad2[_0x06e5('0x2e')]['filter']+'%'};return _0x49cc4b;}})});}_0x3826e7=_[_0x06e5('0x3a')]({},_0x3826e7,_0x2e2ad2[_0x06e5('0x3d')]);var _0x195327={'where':_0x3826e7[_0x06e5('0x39')]};return db['VoiceDialReport'][_0x06e5('0x1d')](_0x195327)['then'](function(_0x3295d5){_0x75faf9[_0x06e5('0x1d')]=_0x3295d5;if(_0x2e2ad2[_0x06e5('0x2e')][_0x06e5('0x3e')]){_0x3826e7[_0x06e5('0x3f')]=[{'all':!![]}];}return db[_0x06e5('0x28')][_0x06e5('0x40')](_0x3826e7);})[_0x06e5('0x41')](function(_0x1c6764){_0x75faf9[_0x06e5('0x42')]=_0x1c6764;return _0x75faf9;})[_0x06e5('0x41')](respondWithFilteredResult(_0x12ff33,_0x3826e7))[_0x06e5('0x43')](handleError(_0x12ff33,null));};exports[_0x06e5('0x44')]=function(_0x3c64cb,_0x476c67){var _0x42a65f={'raw':!![],'where':{'id':_0x3c64cb[_0x06e5('0x45')]['id']}},_0x5cd683={};_0x5cd683['model']=_[_0x06e5('0x2f')](db[_0x06e5('0x28')][_0x06e5('0x29')]);_0x5cd683[_0x06e5('0x2e')]=_['keys'](_0x3c64cb[_0x06e5('0x2e')]);_0x5cd683[_0x06e5('0x30')]=_['intersection'](_0x5cd683[_0x06e5('0x2d')],_0x5cd683[_0x06e5('0x2e')]);_0x42a65f[_0x06e5('0x33')]=_[_0x06e5('0x31')](_0x5cd683[_0x06e5('0x2d')],qs[_0x06e5('0x32')](_0x3c64cb[_0x06e5('0x2e')][_0x06e5('0x32')]));_0x42a65f[_0x06e5('0x33')]=_0x42a65f[_0x06e5('0x33')][_0x06e5('0x34')]?_0x42a65f[_0x06e5('0x33')]:_0x5cd683['model'];if(_0x3c64cb[_0x06e5('0x2e')][_0x06e5('0x3e')]){_0x42a65f[_0x06e5('0x3f')]=[{'all':!![]}];}_0x42a65f=_[_0x06e5('0x3a')]({},_0x42a65f,_0x3c64cb[_0x06e5('0x3d')]);return db[_0x06e5('0x28')][_0x06e5('0x46')](_0x42a65f)[_0x06e5('0x41')](handleEntityNotFound(_0x476c67,null))[_0x06e5('0x41')](respondWithResult(_0x476c67,null))[_0x06e5('0x43')](handleError(_0x476c67,null));};exports['create']=function(_0xb83fc9,_0x33d04f){return db[_0x06e5('0x28')][_0x06e5('0x47')](_0xb83fc9[_0x06e5('0x48')],{})[_0x06e5('0x41')](respondWithResult(_0x33d04f,0xc9))['catch'](handleError(_0x33d04f,null));};exports[_0x06e5('0x23')]=function(_0x4b8a58,_0x48998a){if(_0x4b8a58['body']['id']){delete _0x4b8a58[_0x06e5('0x48')]['id'];}return db[_0x06e5('0x28')][_0x06e5('0x46')]({'where':{'id':_0x4b8a58[_0x06e5('0x45')]['id']}})[_0x06e5('0x41')](handleEntityNotFound(_0x48998a,null))[_0x06e5('0x41')](saveUpdates(_0x4b8a58['body'],null))[_0x06e5('0x41')](respondWithResult(_0x48998a,null))['catch'](handleError(_0x48998a,null));};exports['destroy']=function(_0x49eb4b,_0xacbe2d){return db[_0x06e5('0x28')][_0x06e5('0x46')]({'where':{'id':_0x49eb4b['params']['id']}})['then'](handleEntityNotFound(_0xacbe2d,null))[_0x06e5('0x41')](removeEntity(_0xacbe2d,null))[_0x06e5('0x43')](handleError(_0xacbe2d,null));};exports[_0x06e5('0x49')]=function(_0x1052b3,_0xdb5a7e){return db[_0x06e5('0x28')][_0x06e5('0x49')]()[_0x06e5('0x41')](respondWithResult(_0xdb5a7e,null))[_0x06e5('0x43')](handleError(_0xdb5a7e,null));}; \ No newline at end of file +var _0xa4ba=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VoiceDialReport','include','findAll','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','json','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model'];(function(_0x434f2e,_0x68493e){var _0x76c0b9=function(_0x7db698){while(--_0x7db698){_0x434f2e['push'](_0x434f2e['shift']());}};_0x76c0b9(++_0x68493e);}(_0xa4ba,0xa5));var _0xaa4b=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa4ba[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0xaa4b('0x0'));var rimraf=require(_0xaa4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa4b('0x2'));var rp=require(_0xaa4b('0x3'));var moment=require('moment');var BPromise=require(_0xaa4b('0x4'));var Mustache=require(_0xaa4b('0x5'));var util=require(_0xaa4b('0x6'));var path=require(_0xaa4b('0x7'));var sox=require('sox');var csv=require(_0xaa4b('0x8'));var ejs=require(_0xaa4b('0x9'));var fs=require('fs');var fs_extra=require(_0xaa4b('0xa'));var _=require('lodash');var squel=require(_0xaa4b('0xb'));var crypto=require(_0xaa4b('0xc'));var jsforce=require(_0xaa4b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaa4b('0xe'));var authService=require(_0xaa4b('0xf'));var qs=require(_0xaa4b('0x10'));var as=require(_0xaa4b('0x11'));var hardwareService=require(_0xaa4b('0x12'));var logger=require('../../config/logger')(_0xaa4b('0x13'));var utils=require('../../config/utils');var config=require(_0xaa4b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa4b('0x15'))['db'];function respondWithStatusCode(_0x3542d9,_0x330e81){_0x330e81=_0x330e81||0xcc;return function(_0x421f21){if(_0x421f21){return _0x3542d9['sendStatus'](_0x330e81);}return _0x3542d9[_0xaa4b('0x16')](_0x330e81)[_0xaa4b('0x17')]();};}function respondWithResult(_0x1a278e,_0x5bf953){_0x5bf953=_0x5bf953||0xc8;return function(_0x2826db){if(_0x2826db){return _0x1a278e[_0xaa4b('0x16')](_0x5bf953)['json'](_0x2826db);}};}function respondWithFilteredResult(_0x4a8e9e,_0x3decae){return function(_0x4218a8){if(_0x4218a8){var _0x5675a9=typeof _0x3decae[_0xaa4b('0x18')]===_0xaa4b('0x19')&&typeof _0x3decae[_0xaa4b('0x1a')]===_0xaa4b('0x19');var _0x18fd05=_0x4218a8[_0xaa4b('0x1b')];var _0x585858=_0x5675a9?0x0:_0x3decae['offset'];var _0x38b7e1=_0x5675a9?_0x4218a8[_0xaa4b('0x1b')]:_0x3decae[_0xaa4b('0x18')]+_0x3decae[_0xaa4b('0x1a')];var _0x372652;if(_0x38b7e1>=_0x18fd05){_0x38b7e1=_0x18fd05;_0x372652=0xc8;}else{_0x372652=0xce;}_0x4a8e9e[_0xaa4b('0x16')](_0x372652);return _0x4a8e9e['set']('Content-Range',_0x585858+'-'+_0x38b7e1+'/'+_0x18fd05)[_0xaa4b('0x1c')](_0x4218a8);}return null;};}function patchUpdates(_0x2a0bfe){return function(_0x4b88b3){try{jsonpatch['apply'](_0x4b88b3,_0x2a0bfe,!![]);}catch(_0x17b9e4){return BPromise['reject'](_0x17b9e4);}return _0x4b88b3[_0xaa4b('0x1d')]();};}function saveUpdates(_0xeeaa4f,_0x16ece1){return function(_0x1d8d8f){if(_0x1d8d8f){return _0x1d8d8f[_0xaa4b('0x1e')](_0xeeaa4f)[_0xaa4b('0x1f')](function(_0x7b35cb){return _0x7b35cb;});}return null;};}function removeEntity(_0x3e7f40,_0x29f020){return function(_0x508253){if(_0x508253){return _0x508253[_0xaa4b('0x20')]()['then'](function(){_0x3e7f40[_0xaa4b('0x16')](0xcc)[_0xaa4b('0x17')]();});}};}function handleEntityNotFound(_0x41d10d,_0x1cff74){return function(_0x2cec5e){if(!_0x2cec5e){_0x41d10d['sendStatus'](0x194);}return _0x2cec5e;};}function handleError(_0x8f527,_0x328ce5){_0x328ce5=_0x328ce5||0x1f4;return function(_0x4efe9f){logger['error'](_0x4efe9f[_0xaa4b('0x21')]);if(_0x4efe9f[_0xaa4b('0x22')]){delete _0x4efe9f[_0xaa4b('0x22')];}_0x8f527[_0xaa4b('0x16')](_0x328ce5)[_0xaa4b('0x23')](_0x4efe9f);};}exports['index']=function(_0x460855,_0x388d24){var _0x3283c7={},_0x12eb89={},_0x261ac3={'count':0x0,'rows':[]};var _0x21cf01=_[_0xaa4b('0x24')](db['VoiceDialReport'][_0xaa4b('0x25')],function(_0x4cefa3){return{'name':_0x4cefa3[_0xaa4b('0x26')],'type':_0x4cefa3[_0xaa4b('0x27')][_0xaa4b('0x28')]};});_0x12eb89[_0xaa4b('0x29')]=_[_0xaa4b('0x24')](_0x21cf01,'name');_0x12eb89[_0xaa4b('0x2a')]=_[_0xaa4b('0x2b')](_0x460855[_0xaa4b('0x2a')]);_0x12eb89[_0xaa4b('0x2c')]=_[_0xaa4b('0x2d')](_0x12eb89[_0xaa4b('0x29')],_0x12eb89['query']);_0x3283c7[_0xaa4b('0x2e')]=_[_0xaa4b('0x2d')](_0x12eb89[_0xaa4b('0x29')],qs['fields'](_0x460855[_0xaa4b('0x2a')][_0xaa4b('0x2f')]));_0x3283c7[_0xaa4b('0x2e')]=_0x3283c7[_0xaa4b('0x2e')][_0xaa4b('0x30')]?_0x3283c7[_0xaa4b('0x2e')]:_0x12eb89[_0xaa4b('0x29')];if(!_0x460855['query'][_0xaa4b('0x31')](_0xaa4b('0x32'))){_0x3283c7['limit']=qs[_0xaa4b('0x1a')](_0x460855['query'][_0xaa4b('0x1a')]);_0x3283c7[_0xaa4b('0x18')]=qs[_0xaa4b('0x18')](_0x460855[_0xaa4b('0x2a')]['offset']);}_0x3283c7[_0xaa4b('0x33')]=qs[_0xaa4b('0x34')](_0x460855[_0xaa4b('0x2a')][_0xaa4b('0x34')]);_0x3283c7['where']=qs[_0xaa4b('0x2c')](_[_0xaa4b('0x35')](_0x460855[_0xaa4b('0x2a')],_0x12eb89[_0xaa4b('0x2c')]),_0x21cf01);if(_0x460855[_0xaa4b('0x2a')][_0xaa4b('0x36')]){_0x3283c7[_0xaa4b('0x37')]=_[_0xaa4b('0x38')](_0x3283c7['where'],{'$or':_['map'](_0x21cf01,function(_0xcebf4d){if(_0xcebf4d[_0xaa4b('0x27')]!==_0xaa4b('0x39')){var _0x355d41={};_0x355d41[_0xcebf4d[_0xaa4b('0x22')]]={'$like':'%'+_0x460855[_0xaa4b('0x2a')]['filter']+'%'};return _0x355d41;}})});}_0x3283c7=_[_0xaa4b('0x38')]({},_0x3283c7,_0x460855['options']);var _0x29b1cf={'where':_0x3283c7[_0xaa4b('0x37')]};return db[_0xaa4b('0x3a')][_0xaa4b('0x1b')](_0x29b1cf)['then'](function(_0xfc51c8){_0x261ac3[_0xaa4b('0x1b')]=_0xfc51c8;if(_0x460855[_0xaa4b('0x2a')]['includeAll']){_0x3283c7[_0xaa4b('0x3b')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xaa4b('0x3c')](_0x3283c7);})[_0xaa4b('0x1f')](function(_0x5f179e){_0x261ac3['rows']=_0x5f179e;return _0x261ac3;})[_0xaa4b('0x1f')](respondWithFilteredResult(_0x388d24,_0x3283c7))[_0xaa4b('0x3d')](handleError(_0x388d24,null));};exports['show']=function(_0xdab3a9,_0x517bf9){var _0x4b6c39={'raw':!![],'where':{'id':_0xdab3a9[_0xaa4b('0x3e')]['id']}},_0x237056={};_0x237056[_0xaa4b('0x29')]=_['keys'](db['VoiceDialReport'][_0xaa4b('0x25')]);_0x237056[_0xaa4b('0x2a')]=_[_0xaa4b('0x2b')](_0xdab3a9[_0xaa4b('0x2a')]);_0x237056['filters']=_['intersection'](_0x237056[_0xaa4b('0x29')],_0x237056[_0xaa4b('0x2a')]);_0x4b6c39['attributes']=_[_0xaa4b('0x2d')](_0x237056[_0xaa4b('0x29')],qs[_0xaa4b('0x2f')](_0xdab3a9[_0xaa4b('0x2a')][_0xaa4b('0x2f')]));_0x4b6c39[_0xaa4b('0x2e')]=_0x4b6c39[_0xaa4b('0x2e')][_0xaa4b('0x30')]?_0x4b6c39['attributes']:_0x237056[_0xaa4b('0x29')];if(_0xdab3a9[_0xaa4b('0x2a')][_0xaa4b('0x3f')]){_0x4b6c39[_0xaa4b('0x3b')]=[{'all':!![]}];}_0x4b6c39=_['merge']({},_0x4b6c39,_0xdab3a9[_0xaa4b('0x40')]);return db['VoiceDialReport'][_0xaa4b('0x41')](_0x4b6c39)[_0xaa4b('0x1f')](handleEntityNotFound(_0x517bf9,null))[_0xaa4b('0x1f')](respondWithResult(_0x517bf9,null))[_0xaa4b('0x3d')](handleError(_0x517bf9,null));};exports[_0xaa4b('0x42')]=function(_0x4341ca,_0x562f71){return db[_0xaa4b('0x3a')]['create'](_0x4341ca[_0xaa4b('0x43')],{})[_0xaa4b('0x1f')](respondWithResult(_0x562f71,0xc9))[_0xaa4b('0x3d')](handleError(_0x562f71,null));};exports[_0xaa4b('0x1e')]=function(_0x3fe9fc,_0xbdc00c){if(_0x3fe9fc[_0xaa4b('0x43')]['id']){delete _0x3fe9fc[_0xaa4b('0x43')]['id'];}return db[_0xaa4b('0x3a')][_0xaa4b('0x41')]({'where':{'id':_0x3fe9fc['params']['id']}})['then'](handleEntityNotFound(_0xbdc00c,null))[_0xaa4b('0x1f')](saveUpdates(_0x3fe9fc['body'],null))[_0xaa4b('0x1f')](respondWithResult(_0xbdc00c,null))[_0xaa4b('0x3d')](handleError(_0xbdc00c,null));};exports[_0xaa4b('0x20')]=function(_0x26c05e,_0x1c71c0){return db[_0xaa4b('0x3a')]['find']({'where':{'id':_0x26c05e[_0xaa4b('0x3e')]['id']}})[_0xaa4b('0x1f')](handleEntityNotFound(_0x1c71c0,null))[_0xaa4b('0x1f')](removeEntity(_0x1c71c0,null))[_0xaa4b('0x3d')](handleError(_0x1c71c0,null));};exports[_0xaa4b('0x44')]=function(_0x51cb2a,_0x3ceb7e){return db['VoiceDialReport'][_0xaa4b('0x44')]()['then'](respondWithResult(_0x3ceb7e,null))[_0xaa4b('0x3d')](handleError(_0x3ceb7e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5a71800..e2114a0 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 _0x5947=['exports','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5947,0x16e));var _0x7594=function(_0x5089bd,_0x4f78e5){_0x5089bd=_0x5089bd-0x0;var _0x3585bd=_0x5947[_0x5089bd];return _0x3585bd;};'use strict';var _=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var logger=require(_0x7594('0x2'))(_0x7594('0x3'));var moment=require(_0x7594('0x4'));var BPromise=require(_0x7594('0x5'));var rp=require(_0x7594('0x6'));var fs=require('fs');var path=require(_0x7594('0x7'));var rimraf=require(_0x7594('0x8'));var config=require(_0x7594('0x9'));var attributes=require(_0x7594('0xa'));module[_0x7594('0xb')]=function(_0x1fac2e,_0x378695){return _0x1fac2e['define'](_0x7594('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee4=['request-promise','path','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment'];(function(_0x3d98fa,_0x119ed4){var _0x2575a0=function(_0x2f28bd){while(--_0x2f28bd){_0x3d98fa['push'](_0x3d98fa['shift']());}};_0x2575a0(++_0x119ed4);}(_0x7ee4,0xbc));var _0x47ee=function(_0x352fc5,_0xc25f36){_0x352fc5=_0x352fc5-0x0;var _0x47095f=_0x7ee4[_0x352fc5];return _0x47095f;};'use strict';var _=require(_0x47ee('0x0'));var util=require(_0x47ee('0x1'));var logger=require('../../config/logger')(_0x47ee('0x2'));var moment=require(_0x47ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x47ee('0x4'));var fs=require('fs');var path=require(_0x47ee('0x5'));var rimraf=require('rimraf');var config=require(_0x47ee('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x47ee('0x7')]=function(_0x9054da,_0x25d96e){return _0x9054da[_0x47ee('0x8')](_0x47ee('0x9'),attributes,{'tableName':_0x47ee('0xa'),'paranoid':![],'indexes':[{'fields':[_0x47ee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 2c68de8..229e2bf 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 _0xc013=['message','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0xc013,0x1bc));var _0x3c01=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0xc013[_0x58175c];return _0x55b88f;};'use strict';var _=require(_0x3c01('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c01('0x1'))['db'];var utils=require(_0x3c01('0x2'));var logger=require(_0x3c01('0x3'))(_0x3c01('0x4'));var config=require('../../config/environment');var jayson=require(_0x3c01('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x301572,_0x5abcbc,_0x2448fd){return new BPromise(function(_0x39300e,_0x562829){return client[_0x3c01('0x6')](_0x301572,_0x2448fd)[_0x3c01('0x7')](function(_0x1b337f){logger[_0x3c01('0x8')](_0x3c01('0x9'),_0x5abcbc,_0x3c01('0xa'));logger[_0x3c01('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5abcbc,'request\x20sent',JSON[_0x3c01('0xc')](_0x1b337f));if(_0x1b337f[_0x3c01('0xd')]){if(_0x1b337f[_0x3c01('0xd')][_0x3c01('0xe')]===0x1f4){logger[_0x3c01('0xd')](_0x3c01('0x9'),_0x5abcbc,_0x1b337f[_0x3c01('0xd')][_0x3c01('0xf')]);return _0x562829(_0x1b337f[_0x3c01('0xd')][_0x3c01('0xf')]);}logger[_0x3c01('0xd')](_0x3c01('0x9'),_0x5abcbc,_0x1b337f[_0x3c01('0xd')][_0x3c01('0xf')]);return _0x39300e(_0x1b337f['error'][_0x3c01('0xf')]);}else{logger['info'](_0x3c01('0x9'),_0x5abcbc,'request\x20sent');_0x39300e(_0x1b337f['result'][_0x3c01('0xf')]);}})[_0x3c01('0x10')](function(_0x49f962){logger[_0x3c01('0xd')](_0x3c01('0x9'),_0x5abcbc,_0x49f962);_0x562829(_0x49f962);});});}exports['CreateVoiceDialReport']=function(_0x59088f){var _0x2a7f7d=this;return new Promise(function(_0x112dbe,_0x16bbbc){return db[_0x3c01('0x11')][_0x3c01('0x12')](_0x59088f[_0x3c01('0x13')],{'raw':_0x59088f[_0x3c01('0x14')]?_0x59088f[_0x3c01('0x14')][_0x3c01('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x4fcea1){logger[_0x3c01('0x8')]('CreateVoiceDialReport',_0x59088f);logger[_0x3c01('0xb')](_0x3c01('0x16'),_0x59088f,JSON[_0x3c01('0xc')](_0x4fcea1));_0x112dbe(_0x4fcea1);})[_0x3c01('0x10')](function(_0x152434){logger[_0x3c01('0xd')]('CreateVoiceDialReport',_0x152434[_0x3c01('0xf')],_0x59088f);_0x16bbbc(_0x2a7f7d[_0x3c01('0xd')](0x1f4,_0x152434[_0x3c01('0xf')]));});});};exports[_0x3c01('0x17')]=function(_0xaabb9b){var _0x2353fd=this;return new Promise(function(_0x320a09,_0x16b4bc){return db[_0x3c01('0x11')][_0x3c01('0x18')](_0xaabb9b[_0x3c01('0x13')],{'raw':_0xaabb9b[_0x3c01('0x14')]?_0xaabb9b[_0x3c01('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaabb9b[_0x3c01('0x14')]?_0xaabb9b['options'][_0x3c01('0x19')]||null:null,'attributes':_0xaabb9b['options']?_0xaabb9b[_0x3c01('0x14')][_0x3c01('0x1a')]||null:null,'limit':_0xaabb9b[_0x3c01('0x14')]?_0xaabb9b[_0x3c01('0x14')]['limit']||null:null})[_0x3c01('0x7')](function(_0x1c8598){logger[_0x3c01('0x8')](_0x3c01('0x17'),_0xaabb9b);logger[_0x3c01('0xb')](_0x3c01('0x17'),_0xaabb9b,JSON[_0x3c01('0xc')](_0x1c8598));_0x320a09(_0x1c8598);})[_0x3c01('0x10')](function(_0x418ad5){logger[_0x3c01('0xd')](_0x3c01('0x17'),_0x418ad5[_0x3c01('0xf')],_0xaabb9b);_0x16b4bc(_0x2353fd[_0x3c01('0xd')](0x1f4,_0x418ad5[_0x3c01('0xf')]));});});}; \ No newline at end of file +var _0x00bb=['create','body','options','raw','stringify','catch','UpdateVoiceDialReport','VoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateVoiceDialReport'];(function(_0x5c0f90,_0xcbe32d){var _0x5375bf=function(_0x1e996d){while(--_0x1e996d){_0x5c0f90['push'](_0x5c0f90['shift']());}};_0x5375bf(++_0xcbe32d);}(_0x00bb,0x147));var _0xb00b=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00bb[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require(_0xb00b('0x3'));var rs=require(_0xb00b('0x4'));var fs=require('fs');var Redis=require(_0xb00b('0x5'));var db=require(_0xb00b('0x6'))['db'];var utils=require(_0xb00b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb00b('0x8'));var jayson=require(_0xb00b('0x9'));var client=jayson[_0xb00b('0xa')][_0xb00b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39b98c,_0x11a7ab,_0x183f9b){return new BPromise(function(_0x22bddd,_0x52e0a1){return client[_0xb00b('0xc')](_0x39b98c,_0x183f9b)[_0xb00b('0xd')](function(_0x3dcc83){logger[_0xb00b('0xe')](_0xb00b('0xf'),_0x11a7ab,_0xb00b('0x10'));logger[_0xb00b('0x11')](_0xb00b('0x12'),_0x11a7ab,'request\x20sent',JSON['stringify'](_0x3dcc83));if(_0x3dcc83[_0xb00b('0x13')]){if(_0x3dcc83[_0xb00b('0x13')][_0xb00b('0x14')]===0x1f4){logger[_0xb00b('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x11a7ab,_0x3dcc83['error']['message']);return _0x52e0a1(_0x3dcc83[_0xb00b('0x13')]['message']);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x11a7ab,_0x3dcc83[_0xb00b('0x13')][_0xb00b('0x15')]);return _0x22bddd(_0x3dcc83[_0xb00b('0x13')][_0xb00b('0x15')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x11a7ab,_0xb00b('0x10'));_0x22bddd(_0x3dcc83['result'][_0xb00b('0x15')]);}})['catch'](function(_0x3895ec){logger[_0xb00b('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x11a7ab,_0x3895ec);_0x52e0a1(_0x3895ec);});});}exports[_0xb00b('0x16')]=function(_0x4813a9){var _0x354ce2=this;return new Promise(function(_0x243f1e,_0xd2ac78){return db['VoiceDialReport'][_0xb00b('0x17')](_0x4813a9[_0xb00b('0x18')],{'raw':_0x4813a9[_0xb00b('0x19')]?_0x4813a9[_0xb00b('0x19')][_0xb00b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x53ff04){logger[_0xb00b('0xe')](_0xb00b('0x16'),_0x4813a9);logger[_0xb00b('0x11')](_0xb00b('0x16'),_0x4813a9,JSON[_0xb00b('0x1b')](_0x53ff04));_0x243f1e(_0x53ff04);})[_0xb00b('0x1c')](function(_0x555dd9){logger[_0xb00b('0x13')](_0xb00b('0x16'),_0x555dd9[_0xb00b('0x15')],_0x4813a9);_0xd2ac78(_0x354ce2[_0xb00b('0x13')](0x1f4,_0x555dd9['message']));});});};exports[_0xb00b('0x1d')]=function(_0x62faa2){var _0x5bd832=this;return new Promise(function(_0x440e1f,_0x2f6a47){return db[_0xb00b('0x1e')][_0xb00b('0x1f')](_0x62faa2['body'],{'raw':_0x62faa2[_0xb00b('0x19')]?_0x62faa2[_0xb00b('0x19')][_0xb00b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62faa2['options']?_0x62faa2['options'][_0xb00b('0x20')]||null:null,'attributes':_0x62faa2[_0xb00b('0x19')]?_0x62faa2[_0xb00b('0x19')][_0xb00b('0x21')]||null:null,'limit':_0x62faa2['options']?_0x62faa2[_0xb00b('0x19')][_0xb00b('0x22')]||null:null})[_0xb00b('0xd')](function(_0x3f9636){logger[_0xb00b('0xe')](_0xb00b('0x1d'),_0x62faa2);logger[_0xb00b('0x11')]('UpdateVoiceDialReport',_0x62faa2,JSON[_0xb00b('0x1b')](_0x3f9636));_0x440e1f(_0x3f9636);})[_0xb00b('0x1c')](function(_0x4f53fe){logger[_0xb00b('0x13')](_0xb00b('0x1d'),_0x4f53fe[_0xb00b('0x15')],_0x62faa2);_0x2f6a47(_0x5bd832['error'](0x1f4,_0x4f53fe[_0xb00b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 1f1643d..2b60a81 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 _0x4709=['../../components/auth/service','../../config/environment','./voiceExtension.controller','get','index','show','post','isAuthenticated','create','/:id/applications','addApplications','put','update','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0x4709,0xcc));var _0x9470=function(_0x136268,_0x2821a0){_0x136268=_0x136268-0x0;var _0x5279e1=_0x4709[_0x136268];return _0x5279e1;};'use strict';var multer=require(_0x9470('0x0'));var util=require(_0x9470('0x1'));var path=require('path');var timeout=require(_0x9470('0x2'));var express=require(_0x9470('0x3'));var router=express[_0x9470('0x4')]();var fs_extra=require(_0x9470('0x5'));var auth=require(_0x9470('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9470('0x7'));var controller=require(_0x9470('0x8'));router[_0x9470('0x9')]('/',auth['isAuthenticated'](),controller[_0x9470('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9470('0xb')]);router[_0x9470('0xc')]('/',auth[_0x9470('0xd')](),controller[_0x9470('0xe')]);router[_0x9470('0xc')](_0x9470('0xf'),auth['isAuthenticated'](),controller[_0x9470('0x10')]);router[_0x9470('0x11')]('/:id',auth[_0x9470('0xd')](),controller[_0x9470('0x12')]);router['delete'](_0x9470('0x13'),auth[_0x9470('0xd')](),controller[_0x9470('0x14')]);module['exports']=router; \ No newline at end of file +var _0x24c8=['show','post','create','/:id/applications','addApplications','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x24c8,0x13d));var _0x824c=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x24c8[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x824c('0x0'));var util=require(_0x824c('0x1'));var path=require(_0x824c('0x2'));var timeout=require('connect-timeout');var express=require(_0x824c('0x3'));var router=express[_0x824c('0x4')]();var fs_extra=require(_0x824c('0x5'));var auth=require(_0x824c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x824c('0x7'));var controller=require(_0x824c('0x8'));router[_0x824c('0x9')]('/',auth[_0x824c('0xa')](),controller[_0x824c('0xb')]);router[_0x824c('0x9')](_0x824c('0xc'),auth[_0x824c('0xa')](),controller[_0x824c('0xd')]);router[_0x824c('0xe')]('/',auth[_0x824c('0xa')](),controller[_0x824c('0xf')]);router['post'](_0x824c('0x10'),auth[_0x824c('0xa')](),controller[_0x824c('0x11')]);router[_0x824c('0x12')](_0x824c('0xc'),auth[_0x824c('0xa')](),controller[_0x824c('0x13')]);router[_0x824c('0x14')](_0x824c('0xc'),auth[_0x824c('0xa')](),controller['destroy']);module[_0x824c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 9bab703..241d343 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 _0xb0e4=['NoOp','ENUM','inbound','outbound','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xb0e4,0x164));var _0x4b0e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb0e4[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x4b0e('0x0'));module[_0x4b0e('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4b0e('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4b0e('0x3')],'allowNull':![],'unique':_0x4b0e('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x4b0e('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4b0e('0x3')],'allowNull':![],'defaultValue':_0x4b0e('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4b0e('0x5')](_0x4b0e('0x6'),_0x4b0e('0x7'),'internal','inbound-fax',_0x4b0e('0x8'),_0x4b0e('0x9'),_0x4b0e('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4b0e('0x3')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b0e('0xb')},'IntervalId':{'type':Sequelize[_0x4b0e('0xc')]},'isApp':{'type':Sequelize[_0x4b0e('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4b0e('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x4b0e('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x4b0e('0xe')},'answer':{'type':Sequelize[_0x4b0e('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4b0e('0xf')],'get':function(_0xc9c2ee){return this[_0x4b0e('0x10')](_0x4b0e('0x11'));}},'alias':{'type':Sequelize[_0x4b0e('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xd432=['BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','system'];(function(_0x41e873,_0x52156c){var _0x53d447=function(_0x58f43f){while(--_0x58f43f){_0x41e873['push'](_0x41e873['shift']());}};_0x53d447(++_0x52156c);}(_0xd432,0xc7));var _0x2d43=function(_0x11db22,_0xf42455){_0x11db22=_0x11db22-0x0;var _0x549259=_0xd432[_0x11db22];return _0x549259;};'use strict';var Sequelize=require(_0x2d43('0x0'));module[_0x2d43('0x1')]={'context':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'unique':_0x2d43('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'unique':_0x2d43('0x3')},'priority':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x2d43('0x3')},'tag':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'defaultValue':_0x2d43('0x4')},'appdata':{'type':Sequelize[_0x2d43('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2d43('0x5')](_0x2d43('0x6'),'outbound',_0x2d43('0x7'),'inbound-fax','outbound-fax',_0x2d43('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x2d43('0x2')]},'interval':{'type':Sequelize[_0x2d43('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2d43('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2d43('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x2d43('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x2d43('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x2d43('0xa')],'get':function(_0x48f458){return this[_0x2d43('0xb')](_0x2d43('0xc'));}},'alias':{'type':Sequelize[_0x2d43('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 7697903..b4a4228 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 _0xf481=['filter','ignore','map','type','find','value','name','UserProfileResource','then','sendStatus','stack','index','VoiceExtension','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','rows','show','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','inbound','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','context','params','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','destroy','get','OutboundRoutes','outbound','InternalRoutes','internal'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf481,0xff));var _0x1f48=function(_0x2d66a8,_0x1625a2){_0x2d66a8=_0x2d66a8-0x0;var _0x374b6e=_0xf481[_0x2d66a8];return _0x374b6e;};'use strict';var _=require(_0x1f48('0x0'));var Redis=require(_0x1f48('0x1'));var qs=require(_0x1f48('0x2'));var logger=require(_0x1f48('0x3'))(_0x1f48('0x4'));var config=require(_0x1f48('0x5'));var db=require(_0x1f48('0x6'))['db'];config[_0x1f48('0x7')]=_['defaults'](config[_0x1f48('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x1f48('0x8'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x1f48('0x9')](socket);function respondWithStatusCode(_0x1844b5,_0x6070b4){_0x6070b4=_0x6070b4||0xcc;return function(_0x4f08af){if(_0x4f08af){return _0x1844b5['sendStatus'](_0x6070b4);}return _0x1844b5[_0x1f48('0xa')](_0x6070b4)[_0x1f48('0xb')]();};}function respondWithResult(_0x84660a,_0x279365){_0x279365=_0x279365||0xc8;return function(_0x588f77){if(_0x588f77){return _0x84660a[_0x1f48('0xa')](_0x279365)[_0x1f48('0xc')](_0x588f77);}};}function respondWithFilteredResult(_0x1a0d35,_0xcc21a2){return function(_0x1daff7){if(_0x1daff7){var _0x494110=typeof _0xcc21a2[_0x1f48('0xd')]===_0x1f48('0xe')&&typeof _0xcc21a2[_0x1f48('0xf')]===_0x1f48('0xe');var _0xd0d282=_0x1daff7[_0x1f48('0x10')];var _0x4fd15c=_0x494110?0x0:_0xcc21a2[_0x1f48('0xd')];var _0x4169b0=_0x494110?_0x1daff7[_0x1f48('0x10')]:_0xcc21a2[_0x1f48('0xd')]+_0xcc21a2[_0x1f48('0xf')];var _0x3fd1ac;if(_0x4169b0>=_0xd0d282){_0x4169b0=_0xd0d282;_0x3fd1ac=0xc8;}else{_0x3fd1ac=0xce;}_0x1a0d35[_0x1f48('0xa')](_0x3fd1ac);return _0x1a0d35[_0x1f48('0x11')]('Content-Range',_0x4fd15c+'-'+_0x4169b0+'/'+_0xd0d282)[_0x1f48('0xc')](_0x1daff7);}return null;};}function removeEntity(_0x541116){return function(_0x4aff83){if(_0x4aff83){return _0x4aff83[_0x1f48('0x12')]()['then'](function(){var _0x369b2e=_0x4aff83[_0x1f48('0x13')]({'plain':!![]});var _0x359f91=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x1f48('0x14'),'value':_0x1f48('0x15'),'ignore':![]},{'name':_0x1f48('0x16'),'value':_0x1f48('0x17'),'ignore':![]}];var _0x3c061a=_(_0x359f91)[_0x1f48('0x18')](_0x1f48('0x19'))[_0x1f48('0x1a')]('value')['value']();if(_['includes'](_0x3c061a,_0x369b2e[_0x1f48('0x1b')])){return;}var _0x4dac84=_[_0x1f48('0x1c')](_0x359f91,[_0x1f48('0x1d'),_0x369b2e[_0x1f48('0x1b')]])[_0x1f48('0x1e')];return db[_0x1f48('0x1f')][_0x1f48('0x12')]({'where':{'type':_0x4dac84,'resourceId':_0x369b2e['id']}})[_0x1f48('0x20')](function(){return _0x4aff83;});})[_0x1f48('0x20')](function(){_0x541116[_0x1f48('0xa')](0xcc)[_0x1f48('0xb')]();});}};}function handleEntityNotFound(_0x268cb3){return function(_0x2ba766){if(!_0x2ba766){_0x268cb3[_0x1f48('0x21')](0x194);}return _0x2ba766;};}function handleError(_0x310b93,_0x10b3bf){_0x10b3bf=_0x10b3bf||0x1f4;return function(_0xe8f8ad){logger['error'](_0xe8f8ad[_0x1f48('0x22')]);if(_0xe8f8ad[_0x1f48('0x1e')]){delete _0xe8f8ad['name'];}_0x310b93['status'](_0x10b3bf)['send'](_0xe8f8ad);};}exports[_0x1f48('0x23')]=function(_0x103198,_0x52fb4f){var _0x11807b={},_0x2c2a33={},_0x14ad73={'count':0x0,'rows':[]};var _0x1fe1e2=_['map'](db[_0x1f48('0x24')][_0x1f48('0x25')],function(_0x426026){return{'name':_0x426026['fieldName'],'type':_0x426026['type']['key']};});_0x2c2a33['model']=_[_0x1f48('0x1a')](_0x1fe1e2,_0x1f48('0x1e'));_0x2c2a33[_0x1f48('0x26')]=_[_0x1f48('0x27')](_0x103198[_0x1f48('0x26')]);_0x2c2a33['filters']=_[_0x1f48('0x28')](_0x2c2a33[_0x1f48('0x29')],_0x2c2a33['query']);_0x11807b['attributes']=_[_0x1f48('0x28')](_0x2c2a33[_0x1f48('0x29')],qs[_0x1f48('0x2a')](_0x103198[_0x1f48('0x26')]['fields']));_0x11807b[_0x1f48('0x2b')]=_0x11807b[_0x1f48('0x2b')][_0x1f48('0x2c')]?_0x11807b[_0x1f48('0x2b')]:_0x2c2a33[_0x1f48('0x29')];if(!_0x103198[_0x1f48('0x26')][_0x1f48('0x2d')](_0x1f48('0x2e'))){_0x11807b['limit']=qs['limit'](_0x103198[_0x1f48('0x26')][_0x1f48('0xf')]);_0x11807b[_0x1f48('0xd')]=qs[_0x1f48('0xd')](_0x103198[_0x1f48('0x26')][_0x1f48('0xd')]);}_0x11807b[_0x1f48('0x2f')]=qs[_0x1f48('0x30')](_0x103198[_0x1f48('0x26')][_0x1f48('0x30')]);_0x11807b[_0x1f48('0x31')]=qs[_0x1f48('0x32')](_[_0x1f48('0x33')](_0x103198[_0x1f48('0x26')],_0x2c2a33[_0x1f48('0x32')]),_0x1fe1e2);if(_0x103198[_0x1f48('0x26')][_0x1f48('0x18')]){_0x11807b[_0x1f48('0x31')]=_['merge'](_0x11807b[_0x1f48('0x31')],{'$or':_[_0x1f48('0x1a')](_0x1fe1e2,function(_0x132cec){if(_0x132cec[_0x1f48('0x1b')]!==_0x1f48('0x34')){var _0x141d40={};_0x141d40[_0x132cec[_0x1f48('0x1e')]]={'$like':'%'+_0x103198['query']['filter']+'%'};return _0x141d40;}})});}_0x11807b=_[_0x1f48('0x35')]({},_0x11807b,_0x103198[_0x1f48('0x36')]);var _0x100857={'where':_0x11807b[_0x1f48('0x31')]};return db['VoiceExtension'][_0x1f48('0x10')](_0x100857)['then'](function(_0xcad32a){_0x14ad73[_0x1f48('0x10')]=_0xcad32a;if(_0x103198['query'][_0x1f48('0x37')]){_0x11807b[_0x1f48('0x38')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x11807b);})[_0x1f48('0x20')](function(_0x11bf55){_0x14ad73[_0x1f48('0x39')]=_0x11bf55;return _0x14ad73;})['then'](respondWithFilteredResult(_0x52fb4f,_0x11807b))['catch'](handleError(_0x52fb4f,null));};exports[_0x1f48('0x3a')]=function(_0x4e051,_0x21131c){var _0x278c2a={'raw':![],'where':{'id':_0x4e051['params']['id']}},_0xd2ae71={};_0xd2ae71[_0x1f48('0x29')]=_[_0x1f48('0x27')](db[_0x1f48('0x24')][_0x1f48('0x25')]);_0xd2ae71[_0x1f48('0x26')]=_[_0x1f48('0x27')](_0x4e051[_0x1f48('0x26')]);_0xd2ae71['filters']=_[_0x1f48('0x28')](_0xd2ae71[_0x1f48('0x29')],_0xd2ae71[_0x1f48('0x26')]);_0x278c2a['attributes']=_[_0x1f48('0x28')](_0xd2ae71[_0x1f48('0x29')],qs[_0x1f48('0x2a')](_0x4e051['query'][_0x1f48('0x2a')]));_0x278c2a[_0x1f48('0x2b')]=_0x278c2a[_0x1f48('0x2b')]['length']?_0x278c2a[_0x1f48('0x2b')]:_0xd2ae71[_0x1f48('0x29')];if(_0x4e051[_0x1f48('0x26')][_0x1f48('0x37')]){_0x278c2a[_0x1f48('0x38')]=[{'all':!![]}];}_0x278c2a=_[_0x1f48('0x35')]({},_0x278c2a,_0x4e051[_0x1f48('0x36')]);return db[_0x1f48('0x24')]['find'](_0x278c2a)['then'](handleEntityNotFound(_0x21131c,null))['then'](respondWithResult(_0x21131c,null))[_0x1f48('0x3b')](handleError(_0x21131c,null));};exports[_0x1f48('0x12')]=function(_0x5dd106,_0x5a92fe){return db[_0x1f48('0x24')]['find']({'where':{'id':_0x5dd106['params']['id']}})[_0x1f48('0x20')](handleEntityNotFound(_0x5a92fe,null))[_0x1f48('0x20')](removeEntity(_0x5a92fe,null))['catch'](handleError(_0x5a92fe,null));};exports[_0x1f48('0x3c')]=function(_0x1f7fe5,_0x2694d){if(_0x1f7fe5[_0x1f48('0x3d')][_0x1f48('0x1b')]===_0x1f48('0x15')&&!_[_0x1f48('0x3e')](_0x1f7fe5[_0x1f48('0x3d')][_0x1f48('0x3f')],'_')){_0x1f7fe5['body'][_0x1f48('0x3f')]='_'[_0x1f48('0x40')](_0x1f7fe5[_0x1f48('0x3d')][_0x1f48('0x3f')]);}return db[_0x1f48('0x24')][_0x1f48('0x3c')](_0x1f7fe5[_0x1f48('0x3d')],{'raw':![]})[_0x1f48('0x20')](function(_0x556e39){var _0x52d309=_0x1f7fe5[_0x1f48('0x41')][_0x1f48('0x13')]({'plain':!![]});if(!_0x52d309)throw new Error(_0x1f48('0x42'));if(_0x52d309['role']===_0x1f48('0x41')){var _0x4f9964=_0x556e39['get']({'plain':!![]});var _0x35eb8a=[{'name':_0x1f48('0x43'),'value':_0x1f48('0x44')},{'name':'OutboundRoutes','value':_0x1f48('0x15')},{'name':_0x1f48('0x16'),'value':_0x1f48('0x17')}];var _0x2d0029=_[_0x1f48('0x1c')](_0x35eb8a,['value',_0x4f9964[_0x1f48('0x1b')]])[_0x1f48('0x1e')];return db[_0x1f48('0x45')][_0x1f48('0x1c')]({'where':{'name':_0x2d0029,'userProfileId':_0x52d309['userProfileId']},'raw':!![]})[_0x1f48('0x20')](function(_0x5bf2b4){if(_0x5bf2b4&&_0x5bf2b4[_0x1f48('0x46')]===0x0){return db[_0x1f48('0x1f')]['create']({'name':_0x4f9964[_0x1f48('0x1e')],'resourceId':_0x4f9964['id'],'type':_0x5bf2b4[_0x1f48('0x1e')],'sectionId':_0x5bf2b4['id']},{})['then'](function(){return _0x556e39;});}else{return _0x556e39;}})['catch'](function(_0x311556){logger[_0x1f48('0x47')](_0x1f48('0x48'),_0x311556);throw _0x311556;});}return _0x556e39;})[_0x1f48('0x20')](respondWithResult(_0x2694d,0xc9))[_0x1f48('0x3b')](handleError(_0x2694d,null));};exports[_0x1f48('0x49')]=function(_0x34aac8,_0x3ad2f8){if(_0x34aac8[_0x1f48('0x3d')]['id']){delete _0x34aac8['body']['id'];}return db[_0x1f48('0x24')]['find']({'where':{'id':_0x34aac8['params']['id']}})[_0x1f48('0x20')](handleEntityNotFound(_0x3ad2f8,null))[_0x1f48('0x20')](function(_0x56ccb7){if(_0x56ccb7){return db[_0x1f48('0x24')][_0x1f48('0x49')](_[_0x1f48('0x33')](_0x34aac8[_0x1f48('0x3d')],[_0x1f48('0x3f'),'context',_0x1f48('0x4a'),_0x1f48('0x4b'),'cutdigits',_0x1f48('0x4c'),_0x1f48('0x4d')]),{'where':{'context':_0x56ccb7[_0x1f48('0x4e')],'exten':_0x56ccb7[_0x1f48('0x3f')]},'individualHooks':!![]})[_0x1f48('0x20')](function(_0x4a41b4){return _0x4a41b4;});}return null;})[_0x1f48('0x20')](respondWithStatusCode(_0x3ad2f8,null))[_0x1f48('0x3b')](handleError(_0x3ad2f8,null));};exports['addApplications']=function(_0x1a96dc,_0x12f978){var _0x5b302a=_0x1a96dc[_0x1f48('0x4f')]['id'];var _0x5e3ee1=_0x1a96dc['body'];var _0x3849e3=0xc8;var _0x1576bc=null;return db[_0x1f48('0x50')]['transaction']({'isolationLevel':db[_0x1f48('0x50')][_0x1f48('0x51')][_0x1f48('0x52')][_0x1f48('0x53')]},function(_0x126065){return db['VoiceExtension'][_0x1f48('0x54')]({'where':{'id':_0x5b302a},'transaction':_0x126065})['then'](function(_0xa1054a){if(_0xa1054a){return db[_0x1f48('0x24')]['destroy']({'where':{'VoiceExtensionId':_0x5b302a},'transaction':_0x126065})[_0x1f48('0x20')](function(){var _0x1674e3=_['map'](_0x5e3ee1,function(_0x582b0c){_0x582b0c[_0x1f48('0x55')]=_0x5b302a;_0x582b0c[_0x1f48('0x56')]=!![];return _0x582b0c;});return _0xa1054a[_0x1f48('0x57')](_0x1674e3);})[_0x1f48('0x20')](function(_0x506aa6){return db['VoiceExtension'][_0x1f48('0x58')](_0x506aa6,{'transaction':_0x126065});});}else{_0x3849e3=0x194;_0x1576bc=[];}});})['then'](function(){if(_0x3849e3!==0x194){return db[_0x1f48('0x24')][_0x1f48('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5b302a},'order':_0x1f48('0x5a')})[_0x1f48('0x20')](function(_0x1f5b23){_0x1576bc=_0x1f5b23;});}})[_0x1f48('0x3b')](function(_0x5477c4){_0x3849e3=0x1f4;logger[_0x1f48('0x47')](_0x5477c4['stack']);if(_0x5477c4[_0x1f48('0x1e')]){delete _0x5477c4[_0x1f48('0x1e')];}_0x1576bc=_0x5477c4;})[_0x1f48('0x5b')](function(){if(_0x1576bc===null){_0x12f978[_0x1f48('0x21')](_0x3849e3);}else{if(_0x3849e3===0x1f4){_0x12f978[_0x1f48('0xa')](_0x3849e3)[_0x1f48('0x5c')](_0x1576bc);}else{_0x12f978['status'](_0x3849e3)[_0x1f48('0xc')](_0x1576bc);}}});}; \ No newline at end of file +var _0xf715=['undefined','count','limit','set','Content-Range','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','destroy','then','stack','index','VoiceExtension','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','params','length','options','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','bulkCreate','findAndCountAll','send','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','sendStatus','status','end','json','offset'];(function(_0x18fbc1,_0x2e8bbc){var _0x3dd94e=function(_0x372a3d){while(--_0x372a3d){_0x18fbc1['push'](_0x18fbc1['shift']());}};_0x3dd94e(++_0x2e8bbc);}(_0xf715,0xa2));var _0x5f71=function(_0x464ac5,_0x3841cd){_0x464ac5=_0x464ac5-0x0;var _0x431e2b=_0xf715[_0x464ac5];return _0x431e2b;};'use strict';var _=require(_0x5f71('0x0'));var Redis=require(_0x5f71('0x1'));var qs=require(_0x5f71('0x2'));var logger=require('../../config/logger')('api');var config=require(_0x5f71('0x3'));var db=require(_0x5f71('0x4'))['db'];config[_0x5f71('0x5')]=_[_0x5f71('0x6')](config[_0x5f71('0x5')],{'host':_0x5f71('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f71('0x5')]));require(_0x5f71('0x8'))['register'](socket);function respondWithStatusCode(_0x1424f1,_0x397181){_0x397181=_0x397181||0xcc;return function(_0x2d5858){if(_0x2d5858){return _0x1424f1[_0x5f71('0x9')](_0x397181);}return _0x1424f1[_0x5f71('0xa')](_0x397181)[_0x5f71('0xb')]();};}function respondWithResult(_0x57bb13,_0xc54b6b){_0xc54b6b=_0xc54b6b||0xc8;return function(_0x5dda65){if(_0x5dda65){return _0x57bb13[_0x5f71('0xa')](_0xc54b6b)[_0x5f71('0xc')](_0x5dda65);}};}function respondWithFilteredResult(_0x1318a6,_0x443067){return function(_0xf78b7b){if(_0xf78b7b){var _0x86d4f=typeof _0x443067[_0x5f71('0xd')]===_0x5f71('0xe')&&typeof _0x443067['limit']==='undefined';var _0x440279=_0xf78b7b[_0x5f71('0xf')];var _0x488890=_0x86d4f?0x0:_0x443067[_0x5f71('0xd')];var _0x1fc1c3=_0x86d4f?_0xf78b7b['count']:_0x443067[_0x5f71('0xd')]+_0x443067[_0x5f71('0x10')];var _0x143910;if(_0x1fc1c3>=_0x440279){_0x1fc1c3=_0x440279;_0x143910=0xc8;}else{_0x143910=0xce;}_0x1318a6[_0x5f71('0xa')](_0x143910);return _0x1318a6[_0x5f71('0x11')](_0x5f71('0x12'),_0x488890+'-'+_0x1fc1c3+'/'+_0x440279)[_0x5f71('0xc')](_0xf78b7b);}return null;};}function removeEntity(_0xe4ad46){return function(_0x4f9ef0){if(_0x4f9ef0){return _0x4f9ef0['destroy']()['then'](function(){var _0x36437c=_0x4f9ef0[_0x5f71('0x13')]({'plain':!![]});var _0x224539=[{'name':_0x5f71('0x14'),'value':'inbound','ignore':![]},{'name':_0x5f71('0x15'),'value':_0x5f71('0x16'),'ignore':![]},{'name':_0x5f71('0x17'),'value':_0x5f71('0x18'),'ignore':![]}];var _0xd299ad=_(_0x224539)[_0x5f71('0x19')](_0x5f71('0x1a'))[_0x5f71('0x1b')](_0x5f71('0x1c'))[_0x5f71('0x1c')]();if(_[_0x5f71('0x1d')](_0xd299ad,_0x36437c[_0x5f71('0x1e')])){return;}var _0x1089c1=_[_0x5f71('0x1f')](_0x224539,['value',_0x36437c[_0x5f71('0x1e')]])[_0x5f71('0x20')];return db['UserProfileResource'][_0x5f71('0x21')]({'where':{'type':_0x1089c1,'resourceId':_0x36437c['id']}})[_0x5f71('0x22')](function(){return _0x4f9ef0;});})[_0x5f71('0x22')](function(){_0xe4ad46['status'](0xcc)[_0x5f71('0xb')]();});}};}function handleEntityNotFound(_0x2cacf7){return function(_0x3221e6){if(!_0x3221e6){_0x2cacf7[_0x5f71('0x9')](0x194);}return _0x3221e6;};}function handleError(_0x411520,_0x2fb1d5){_0x2fb1d5=_0x2fb1d5||0x1f4;return function(_0x2928d8){logger['error'](_0x2928d8[_0x5f71('0x23')]);if(_0x2928d8[_0x5f71('0x20')]){delete _0x2928d8[_0x5f71('0x20')];}_0x411520[_0x5f71('0xa')](_0x2fb1d5)['send'](_0x2928d8);};}exports[_0x5f71('0x24')]=function(_0x12baf9,_0x237a13){var _0x59d093={},_0x311f1d={},_0x52ff6={'count':0x0,'rows':[]};var _0x242bbf=_['map'](db[_0x5f71('0x25')][_0x5f71('0x26')],function(_0x2c2367){return{'name':_0x2c2367['fieldName'],'type':_0x2c2367['type'][_0x5f71('0x27')]};});_0x311f1d[_0x5f71('0x28')]=_[_0x5f71('0x1b')](_0x242bbf,_0x5f71('0x20'));_0x311f1d['query']=_[_0x5f71('0x29')](_0x12baf9[_0x5f71('0x2a')]);_0x311f1d[_0x5f71('0x2b')]=_[_0x5f71('0x2c')](_0x311f1d['model'],_0x311f1d[_0x5f71('0x2a')]);_0x59d093['attributes']=_[_0x5f71('0x2c')](_0x311f1d[_0x5f71('0x28')],qs[_0x5f71('0x2d')](_0x12baf9[_0x5f71('0x2a')][_0x5f71('0x2d')]));_0x59d093[_0x5f71('0x2e')]=_0x59d093['attributes']['length']?_0x59d093['attributes']:_0x311f1d['model'];if(!_0x12baf9[_0x5f71('0x2a')][_0x5f71('0x2f')]('nolimit')){_0x59d093[_0x5f71('0x10')]=qs[_0x5f71('0x10')](_0x12baf9['query']['limit']);_0x59d093[_0x5f71('0xd')]=qs[_0x5f71('0xd')](_0x12baf9[_0x5f71('0x2a')][_0x5f71('0xd')]);}_0x59d093[_0x5f71('0x30')]=qs['sort'](_0x12baf9[_0x5f71('0x2a')][_0x5f71('0x31')]);_0x59d093[_0x5f71('0x32')]=qs['filters'](_[_0x5f71('0x33')](_0x12baf9[_0x5f71('0x2a')],_0x311f1d['filters']),_0x242bbf);if(_0x12baf9[_0x5f71('0x2a')][_0x5f71('0x19')]){_0x59d093[_0x5f71('0x32')]=_[_0x5f71('0x34')](_0x59d093[_0x5f71('0x32')],{'$or':_[_0x5f71('0x1b')](_0x242bbf,function(_0x3931f6){if(_0x3931f6[_0x5f71('0x1e')]!==_0x5f71('0x35')){var _0x1ae72b={};_0x1ae72b[_0x3931f6['name']]={'$like':'%'+_0x12baf9[_0x5f71('0x2a')]['filter']+'%'};return _0x1ae72b;}})});}_0x59d093=_[_0x5f71('0x34')]({},_0x59d093,_0x12baf9['options']);var _0x10809f={'where':_0x59d093[_0x5f71('0x32')]};return db[_0x5f71('0x25')][_0x5f71('0xf')](_0x10809f)[_0x5f71('0x22')](function(_0x53583c){_0x52ff6[_0x5f71('0xf')]=_0x53583c;if(_0x12baf9[_0x5f71('0x2a')][_0x5f71('0x36')]){_0x59d093['include']=[{'all':!![]}];}return db[_0x5f71('0x25')][_0x5f71('0x37')](_0x59d093);})[_0x5f71('0x22')](function(_0x87267c){_0x52ff6[_0x5f71('0x38')]=_0x87267c;return _0x52ff6;})[_0x5f71('0x22')](respondWithFilteredResult(_0x237a13,_0x59d093))[_0x5f71('0x39')](handleError(_0x237a13,null));};exports['show']=function(_0x315916,_0x235676){var _0x2983d9={'raw':![],'where':{'id':_0x315916[_0x5f71('0x3a')]['id']}},_0x2fba4a={};_0x2fba4a[_0x5f71('0x28')]=_['keys'](db[_0x5f71('0x25')][_0x5f71('0x26')]);_0x2fba4a[_0x5f71('0x2a')]=_['keys'](_0x315916[_0x5f71('0x2a')]);_0x2fba4a[_0x5f71('0x2b')]=_[_0x5f71('0x2c')](_0x2fba4a[_0x5f71('0x28')],_0x2fba4a[_0x5f71('0x2a')]);_0x2983d9[_0x5f71('0x2e')]=_['intersection'](_0x2fba4a[_0x5f71('0x28')],qs[_0x5f71('0x2d')](_0x315916['query'][_0x5f71('0x2d')]));_0x2983d9[_0x5f71('0x2e')]=_0x2983d9[_0x5f71('0x2e')][_0x5f71('0x3b')]?_0x2983d9['attributes']:_0x2fba4a[_0x5f71('0x28')];if(_0x315916[_0x5f71('0x2a')][_0x5f71('0x36')]){_0x2983d9['include']=[{'all':!![]}];}_0x2983d9=_[_0x5f71('0x34')]({},_0x2983d9,_0x315916[_0x5f71('0x3c')]);return db[_0x5f71('0x25')][_0x5f71('0x1f')](_0x2983d9)[_0x5f71('0x22')](handleEntityNotFound(_0x235676,null))[_0x5f71('0x22')](respondWithResult(_0x235676,null))[_0x5f71('0x39')](handleError(_0x235676,null));};exports[_0x5f71('0x21')]=function(_0x2083ee,_0x5c6b75){return db[_0x5f71('0x25')][_0x5f71('0x1f')]({'where':{'id':_0x2083ee[_0x5f71('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5c6b75,null))[_0x5f71('0x22')](removeEntity(_0x5c6b75,null))['catch'](handleError(_0x5c6b75,null));};exports[_0x5f71('0x3d')]=function(_0x5b24be,_0x429c4e){if(_0x5b24be[_0x5f71('0x3e')]['type']==='outbound'&&!_[_0x5f71('0x3f')](_0x5b24be[_0x5f71('0x3e')]['exten'],'_')){_0x5b24be['body'][_0x5f71('0x40')]='_'['concat'](_0x5b24be[_0x5f71('0x3e')][_0x5f71('0x40')]);}return db[_0x5f71('0x25')][_0x5f71('0x3d')](_0x5b24be['body'],{'raw':![]})[_0x5f71('0x22')](function(_0xbc37a9){var _0x5e82f8=_0x5b24be[_0x5f71('0x41')][_0x5f71('0x13')]({'plain':!![]});if(!_0x5e82f8)throw new Error(_0x5f71('0x42'));if(_0x5e82f8['role']===_0x5f71('0x41')){var _0x55f309=_0xbc37a9[_0x5f71('0x13')]({'plain':!![]});var _0x1f8cf6=[{'name':'InboundRoutes','value':_0x5f71('0x43')},{'name':_0x5f71('0x15'),'value':_0x5f71('0x16')},{'name':_0x5f71('0x17'),'value':_0x5f71('0x18')}];var _0x4c815f=_['find'](_0x1f8cf6,[_0x5f71('0x1c'),_0x55f309[_0x5f71('0x1e')]])['name'];return db[_0x5f71('0x44')][_0x5f71('0x1f')]({'where':{'name':_0x4c815f,'userProfileId':_0x5e82f8[_0x5f71('0x45')]},'raw':!![]})[_0x5f71('0x22')](function(_0xdf4dfd){if(_0xdf4dfd&&_0xdf4dfd[_0x5f71('0x46')]===0x0){return db[_0x5f71('0x47')]['create']({'name':_0x55f309['name'],'resourceId':_0x55f309['id'],'type':_0xdf4dfd[_0x5f71('0x20')],'sectionId':_0xdf4dfd['id']},{})['then'](function(){return _0xbc37a9;});}else{return _0xbc37a9;}})['catch'](function(_0x2e4877){logger[_0x5f71('0x48')](_0x5f71('0x49'),_0x2e4877);throw _0x2e4877;});}return _0xbc37a9;})[_0x5f71('0x22')](respondWithResult(_0x429c4e,0xc9))[_0x5f71('0x39')](handleError(_0x429c4e,null));};exports[_0x5f71('0x4a')]=function(_0x445cf3,_0x8c316e){if(_0x445cf3['body']['id']){delete _0x445cf3[_0x5f71('0x3e')]['id'];}return db[_0x5f71('0x25')][_0x5f71('0x1f')]({'where':{'id':_0x445cf3['params']['id']}})['then'](handleEntityNotFound(_0x8c316e,null))[_0x5f71('0x22')](function(_0x58966f){if(_0x58966f){return db[_0x5f71('0x25')][_0x5f71('0x4a')](_[_0x5f71('0x33')](_0x445cf3[_0x5f71('0x3e')],[_0x5f71('0x40'),_0x5f71('0x4b'),'description',_0x5f71('0x4c'),'cutdigits',_0x5f71('0x4d'),_0x5f71('0x4e')]),{'where':{'context':_0x58966f[_0x5f71('0x4b')],'exten':_0x58966f[_0x5f71('0x40')]},'individualHooks':!![]})[_0x5f71('0x22')](function(_0xc9e2fa){return _0xc9e2fa;});}return null;})[_0x5f71('0x22')](respondWithStatusCode(_0x8c316e,null))[_0x5f71('0x39')](handleError(_0x8c316e,null));};exports[_0x5f71('0x4f')]=function(_0x3748f8,_0x18e701){var _0x4a5cde=_0x3748f8[_0x5f71('0x3a')]['id'];var _0x300740=_0x3748f8[_0x5f71('0x3e')];var _0x5bb901=0xc8;var _0x58b099=null;return db[_0x5f71('0x50')]['transaction']({'isolationLevel':db['sequelize'][_0x5f71('0x51')][_0x5f71('0x52')][_0x5f71('0x53')]},function(_0x3c3791){return db[_0x5f71('0x25')]['findOne']({'where':{'id':_0x4a5cde},'transaction':_0x3c3791})[_0x5f71('0x22')](function(_0x592221){if(_0x592221){return db['VoiceExtension'][_0x5f71('0x21')]({'where':{'VoiceExtensionId':_0x4a5cde},'transaction':_0x3c3791})[_0x5f71('0x22')](function(){var _0x1b8601=_[_0x5f71('0x1b')](_0x300740,function(_0x34c7d8){_0x34c7d8['VoiceExtensionId']=_0x4a5cde;_0x34c7d8[_0x5f71('0x54')]=!![];return _0x34c7d8;});return _0x592221['createRouting'](_0x1b8601);})['then'](function(_0xf1f794){return db[_0x5f71('0x25')][_0x5f71('0x55')](_0xf1f794,{'transaction':_0x3c3791});});}else{_0x5bb901=0x194;_0x58b099=[];}});})[_0x5f71('0x22')](function(){if(_0x5bb901!==0x194){return db[_0x5f71('0x25')][_0x5f71('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4a5cde},'order':'cast(priority\x20as\x20unsigned)'})[_0x5f71('0x22')](function(_0x1e94b7){_0x58b099=_0x1e94b7;});}})[_0x5f71('0x39')](function(_0x47a304){_0x5bb901=0x1f4;logger[_0x5f71('0x48')](_0x47a304['stack']);if(_0x47a304[_0x5f71('0x20')]){delete _0x47a304[_0x5f71('0x20')];}_0x58b099=_0x47a304;})['finally'](function(){if(_0x58b099===null){_0x18e701[_0x5f71('0x9')](_0x5bb901);}else{if(_0x5bb901===0x1f4){_0x18e701[_0x5f71('0xa')](_0x5bb901)[_0x5f71('0x57')](_0x58b099);}else{_0x18e701[_0x5f71('0xa')](_0x5bb901)['json'](_0x58b099);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 478c9dd..39338b7 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 _0x9eb4=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x9eb4,0x153));var _0x49eb=function(_0x229fa7,_0xcf12a5){_0x229fa7=_0x229fa7-0x0;var _0x26ee05=_0x9eb4[_0x229fa7];return _0x26ee05;};'use strict';var EventEmitter=require(_0x49eb('0x0'));var VoiceExtension=require(_0x49eb('0x1'))['db'][_0x49eb('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x49eb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x49eb('0x4'),'afterDestroy':_0x49eb('0x5')};function emitEvent(_0x607ccd){return function(_0x1c7592,_0x192aeb,_0x1ed16d){VoiceExtensionEvents[_0x49eb('0x6')](_0x607ccd+':'+_0x1c7592['id'],_0x1c7592);VoiceExtensionEvents['emit'](_0x607ccd,_0x1c7592);_0x1ed16d(null);};}for(var e in events){if(events[_0x49eb('0x7')](e)){var event=events[e];VoiceExtension[_0x49eb('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x2499=['../../mysqldb','setMaxListeners','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x1e44d2,_0x1f0458){var _0x14f8f4=function(_0x5904e3){while(--_0x5904e3){_0x1e44d2['push'](_0x1e44d2['shift']());}};_0x14f8f4(++_0x1f0458);}(_0x2499,0xff));var _0x9249=function(_0xc27c89,_0x198b53){_0xc27c89=_0xc27c89-0x0;var _0x27326f=_0x2499[_0xc27c89];return _0x27326f;};'use strict';var EventEmitter=require(_0x9249('0x0'));var VoiceExtension=require(_0x9249('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9249('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9249('0x3'),'afterDestroy':_0x9249('0x4')};function emitEvent(_0x64eb9f){return function(_0x354b19,_0x5886b6,_0x3afd6b){VoiceExtensionEvents['emit'](_0x64eb9f+':'+_0x354b19['id'],_0x354b19);VoiceExtensionEvents['emit'](_0x64eb9f,_0x354b19);_0x3afd6b(null);};}for(var e in events){if(events[_0x9249('0x5')](e)){var event=events[e];VoiceExtension[_0x9249('0x6')](e,emitEvent(event));}}module[_0x9249('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 ad2c153..42f7049 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 _0xfde6=['includes','app','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','catch','define','voice_extensions','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','NoOp','alias','CDR(routeAlias)=','exten','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','No\x20alias\x20set','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','name','phone','prefix','${EXTEN:','SIP','join','param','none','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback'];(function(_0x2d5ffd,_0x43d233){var _0x19c4bf=function(_0x801346){while(--_0x801346){_0x2d5ffd['push'](_0x2d5ffd['shift']());}};_0x19c4bf(++_0x43d233);}(_0xfde6,0xaf));var _0x6fde=function(_0x47df23,_0x4c34db){_0x47df23=_0x47df23-0x0;var _0xf4bf0e=_0xfde6[_0x47df23];return _0xf4bf0e;};'use strict';var _=require(_0x6fde('0x0'));var attributes=require(_0x6fde('0x1'));module['exports']=function(_0x347a83){var _0x4e85f3=_0x347a83[_0x6fde('0x2')];function _0x4c12d9(_0x1fac07){var _0x4adc56=0x2;var _0x4aa0f2=[{'type':_0x1fac07[_0x6fde('0x3')],'app':_0x6fde('0x4'),'appdata':_0x6fde('0x5')+_0x1fac07[_0x6fde('0x3')],'context':_0x1fac07[_0x6fde('0x6')],'exten':_0x1fac07['exten'],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']},{'type':_0x1fac07[_0x6fde('0x3')],'app':_0x1fac07['alias']?'Set':_0x6fde('0x7'),'appdata':_0x1fac07[_0x6fde('0x8')]?_0x6fde('0x9')+_0x1fac07[_0x6fde('0x8')]:'No\x20alias\x20set','context':_0x1fac07[_0x6fde('0x6')],'exten':_0x1fac07[_0x6fde('0xa')],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']}];if(_0x1fac07[_0x6fde('0x3')]==='inbound'){_0x4aa0f2['push']({'type':'inbound','app':_0x6fde('0x4'),'appdata':_0x6fde('0xb')+_0x1fac07['id'],'context':_0x1fac07['context'],'exten':_0x1fac07[_0x6fde('0xa')],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']});}_0x4aa0f2[_0x6fde('0xc')]({'type':_0x1fac07[_0x6fde('0x3')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1fac07[_0x6fde('0x6')],'exten':_0x1fac07[_0x6fde('0xa')],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']},{'type':_0x1fac07['type'],'app':_0x6fde('0x4'),'appdata':_0x6fde('0xd'),'context':_0x1fac07[_0x6fde('0x6')],'exten':_0x1fac07[_0x6fde('0xa')],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']},{'type':_0x1fac07['type'],'app':_0x6fde('0x4'),'appdata':_0x6fde('0xe'),'context':_0x1fac07['context'],'exten':_0x1fac07[_0x6fde('0xa')],'priority':_0x4adc56++,'VoiceExtensionId':_0x1fac07['id']});return _0x4aa0f2;}function _0xeecad0(_0x3e269b){var _0x4c93db=0x2;var _0x6d8012=[{'type':_0x6fde('0xf'),'app':_0x6fde('0x4'),'appdata':_0x6fde('0x10'),'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b['exten'],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':_0x3e269b[_0x6fde('0x8')]?_0x6fde('0x4'):'NoOp','appdata':_0x3e269b[_0x6fde('0x8')]?_0x6fde('0x9')+_0x3e269b[_0x6fde('0x8')]:_0x6fde('0x11'),'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b['exten'],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':_0x6fde('0x4'),'appdata':'CDR(destination)='+(_0x3e269b[_0x6fde('0x12')]?'${EXTEN:'+_0x3e269b[_0x6fde('0x12')]+'}':_0x6fde('0x13')),'context':_0x3e269b['context'],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':_0x6fde('0x4'),'appdata':_0x6fde('0xb')+_0x3e269b['id'],'context':_0x3e269b['context'],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':'outbound','app':_0x6fde('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4c93db+0x2)+_0x6fde('0x15')+(_0x4c93db+0x1)+')','context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b['exten'],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':_0x6fde('0x4'),'appdata':_0x3e269b[_0x6fde('0x12')]?_0x6fde('0x16')+_0x3e269b['cutdigits']+'}':_0x6fde('0x17'),'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':_0x6fde('0x4'),'appdata':_0x6fde('0x18'),'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':'Set','appdata':_0x6fde('0xd'),'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':'outbound','app':_0x6fde('0x4'),'appdata':_0x6fde('0xe'),'context':_0x3e269b['context'],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':'Set','appdata':_0x6fde('0x19')+_0x3e269b['id'],'context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']}];if(_0x3e269b[_0x6fde('0x1a')](_0x6fde('0x1b'))&&_0x3e269b[_0x6fde('0x1b')]!=='none'){_0x6d8012['push']({'type':_0x6fde('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3e269b[_0x6fde('0x6')],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']},{'type':_0x6fde('0xf'),'app':'Set','appdata':_0x6fde('0x1c')+_0x3e269b[_0x6fde('0x1b')]||_0x6fde('0x1d'),'context':_0x3e269b['context'],'exten':_0x3e269b[_0x6fde('0xa')],'priority':_0x4c93db++,'VoiceExtensionId':_0x3e269b['id']});}return _0x6d8012;}function _0x372463(_0x9bb8d0,_0x4b6b66){var _0x41dfdd=[{'name':_0x6fde('0x1e'),'param':0x0},{'name':_0x6fde('0x1f'),'param':0x1},{'name':_0x6fde('0x20'),'param':0x2},{'name':_0x6fde('0x21'),'param':0x3}];var _0x91a444={};var _0x896c8=_0x4b6b66[_0x6fde('0x22')](',');var _0x4665d0=[];for(var _0x33268f=0x0;_0x33268f<_0x41dfdd['length'];_0x33268f++){switch(_0x41dfdd[_0x33268f][_0x6fde('0x23')]){case _0x6fde('0x1e'):_0x91a444[_0x6fde('0x1e')]=_0x896c8[_0x41dfdd[_0x33268f]['param']]['split']('/')[0x1];_0x91a444[_0x6fde('0x24')]=_0x896c8[_0x41dfdd[_0x33268f]['param']][_0x6fde('0x22')]('/')[0x2];_0x91a444[_0x6fde('0x25')]=_0x91a444['phone']?_0x91a444[_0x6fde('0x24')][_0x6fde('0x22')]('$')[0x0]:undefined;_0x91a444[_0x6fde('0x24')]=_0x9bb8d0['cutdigits']?(_0x91a444[_0x6fde('0x25')]||'')+_0x6fde('0x26')+_0x9bb8d0[_0x6fde('0x12')]+'}':(_0x91a444['prefix']||'')+_0x6fde('0x13');_0x4665d0[_0x41dfdd[_0x33268f]['param']]=[_0x6fde('0x27'),_0x91a444['trunk'],_0x91a444['phone']][_0x6fde('0x28')]('/');break;case _0x6fde('0x20'):_0x91a444[_0x6fde('0x20')]=_0x896c8[_0x41dfdd[_0x33268f][_0x6fde('0x29')]];if(_0x9bb8d0[_0x6fde('0x1b')]!==_0x6fde('0x2a')){if(_0x91a444['options'][_0x6fde('0x2b')](_0x6fde('0x2c'))<0x0){_0x91a444[_0x6fde('0x20')]+=_0x6fde('0x2c');}}else{_0x91a444['options']=_0x91a444[_0x6fde('0x20')]['replace'](_0x6fde('0x2c'),'');}_0x4665d0[_0x41dfdd[_0x33268f]['param']]=_0x91a444[_0x6fde('0x20')];break;default:_0x4665d0[_0x41dfdd[_0x33268f][_0x6fde('0x29')]]=_0x896c8[_0x41dfdd[_0x33268f][_0x6fde('0x29')]];}}return _0x4665d0[_0x6fde('0x28')](',');}function _0x42b42c(_0x203439,_0x933853,_0x3e5733){return new Promise(function(_0x4c1024,_0x1ccc0b){var _0x428189=[];if(_['isEmpty'](_0x933853))return _0x4c1024(_0x428189);_0x4e85f3[_0x6fde('0x2d')][_0x6fde('0x2e')]({'attributes':['id',_0x6fde('0x2f'),_0x6fde('0x30')],'raw':!![]})[_0x6fde('0x31')](function(_0x24b7be){for(var _0x353b18=0x0,_0x1cc40b=0x0;_0x353b18<_0x933853[_0x6fde('0x32')];_0x353b18++,_0x1cc40b=0x0){var _0x2b79b8=_0x933853[_0x353b18];var _0x555c08=[];var _0x56308d=[];delete _0x2b79b8['id'];if(_0x2b79b8[_0x6fde('0x2f')]!==_0x6fde('0x33')){_0x2b79b8[_0x6fde('0x34')]=[_0x2b79b8[_0x6fde('0x2f')]];}else{_0x2b79b8[_0x6fde('0x34')]=_0x2b79b8[_0x6fde('0x30')]?_[_0x6fde('0x35')](_['filter'](_0x24b7be,{'IntervalId':_0x2b79b8[_0x6fde('0x30')]}),_0x6fde('0x2f')):[];}_0x2b79b8['context']=_0x203439[_0x6fde('0x6')];_0x2b79b8['exten']=_0x203439[_0x6fde('0xa')];if(_0x2b79b8['type'])_0x2b79b8[_0x6fde('0x3')]=_0x2b79b8['type'][_0x6fde('0x36')]();if(_0x203439['type']===_0x6fde('0xf')){if(_0x2b79b8[_0x6fde('0x1a')](_0x6fde('0x37'))&&_0x2b79b8[_0x6fde('0x37')]&&_0x2b79b8[_0x6fde('0x37')]!=='--'){_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8['type'][_0x6fde('0x36')](),'app':_0x6fde('0x4'),'appdata':'CDR(tag)='+_0x2b79b8[_0x6fde('0x37')],'context':_0x203439['context'],'exten':_0x203439['exten'],'priority':_0x2b79b8[_0x6fde('0x34')]['length']+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});}_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8[_0x6fde('0x3')][_0x6fde('0x36')](),'app':_0x6fde('0x14'),'appdata':_0x6fde('0x38')+(_0x2b79b8[_0x6fde('0x39')]?'Set(CALLERID(all)='+_0x2b79b8['callerID']+')':_0x6fde('0x3a')),'context':_0x203439[_0x6fde('0x6')],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')]['length']+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});}else{if(_0x2b79b8[_0x6fde('0x1a')](_0x6fde('0x3b'))){if([_0x6fde('0x3c'),_0x6fde('0x3d')][_0x6fde('0x3e')](_0x2b79b8[_0x6fde('0x3f')][_0x6fde('0x36')]())&&_0x2b79b8['appType']!==_0x6fde('0x40')){if(_0x2b79b8['answer']){_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8['type'][_0x6fde('0x36')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x203439[_0x6fde('0x6')],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8[_0x6fde('0x3')][_0x6fde('0x36')](),'app':_0x6fde('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x203439[_0x6fde('0x6')],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});}else{_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8['type']['toLowerCase'](),'app':_0x6fde('0x14'),'appdata':_0x6fde('0x41'),'context':_0x203439['context'],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8[_0x6fde('0x3')][_0x6fde('0x36')](),'app':'Set','appdata':_0x6fde('0x42'),'context':_0x203439['context'],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});}}}}for(var _0x39d6a2=0x0;_0x39d6a2<_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')];_0x39d6a2++){var _0x5bef9d=_0x3e5733+_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')];var _0x4a2cca=_0x39d6a2===_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]-0x1?_0x3e5733+_0x555c08[_0x6fde('0x32')]+_0x56308d[_0x6fde('0x32')]+0x2:_0x3e5733+_0x39d6a2+0x1;_0x555c08[_0x6fde('0x43')](_0x39d6a2,0x0,{'type':_0x203439['type'],'app':_0x6fde('0x44'),'appdata':_0x2b79b8[_0x6fde('0x34')][_0x39d6a2]+'?'+_0x203439[_0x6fde('0x6')]+_0x6fde('0x45')+_0x5bef9d+':'+_0x203439[_0x6fde('0x6')]+',${EXTEN},'+_0x4a2cca,'exten':_0x203439[_0x6fde('0xa')],'context':_0x203439['context'],'priority':_0x3e5733+_0x39d6a2,'VoiceExtensionId':_0x203439['id']});}if(_0x2b79b8['appType']==='outboundDial'){_0x2b79b8[_0x6fde('0x46')]=_0x372463(_0x203439,_0x2b79b8[_0x6fde('0x46')]);}if(_0x2b79b8['appType']===_0x6fde('0x47')){_0x555c08[_0x6fde('0xc')]({'type':_0x2b79b8[_0x6fde('0x3')][_0x6fde('0x36')](),'app':_0x6fde('0x4'),'appdata':_0x6fde('0x48'),'context':_0x203439['context'],'exten':_0x203439[_0x6fde('0xa')],'priority':_0x2b79b8[_0x6fde('0x34')][_0x6fde('0x32')]+_0x3e5733+_0x1cc40b++,'VoiceExtensionId':_0x203439['id']});}_0x2b79b8[_0x6fde('0x49')]=_0x555c08['length']?_['last'](_0x555c08)[_0x6fde('0x49')]+0x1:_0x3e5733;_0x428189=_[_0x6fde('0x4a')](_0x428189,_0x555c08,[_0x2b79b8],_0x56308d);_0x3e5733=_[_0x6fde('0x4b')](_0x428189)[_0x6fde('0x49')]+0x1;}return _0x4c1024(_0x428189);})[_0x6fde('0x4c')](function(_0x3c10d8){_0x1ccc0b(_0x3c10d8);});});}return _0x347a83[_0x6fde('0x4d')]('VoiceExtension',attributes,{'tableName':_0x6fde('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1d1af8){var _0x47149d=this['get']({'plain':!![]});var _0x17af03=_0x47149d[_0x6fde('0x3')]===_0x6fde('0xf')?_0xeecad0(_0x47149d):_0x4c12d9(_0x47149d);return _0x42b42c(_0x47149d,_0x1d1af8,_[_0x6fde('0x4b')](_0x17af03)[_0x6fde('0x49')]+0x1)[_0x6fde('0x31')](function(_0x49d17c){var _0x271578=_['concat'](_0x17af03,_0x49d17c);_0x271578[_0x6fde('0xc')]({'type':_0x47149d['type'],'app':'Hangup','exten':_0x47149d[_0x6fde('0xa')],'context':_0x47149d['context'],'priority':_[_0x6fde('0x4b')](_0x271578)[_0x6fde('0x49')]+0x1,'VoiceExtensionId':_0x47149d['id']});return _0x271578;});}}});}; \ No newline at end of file +var _0x1040=['hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','options','url','split','name','trunk','param','phone','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','length','interval','intervals','IntervalId','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','splice','GotoIfTime','appType','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','concat','catch','VoiceExtension','voice_extensions','get','then','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','context','type','alias','Set','NoOp','No\x20alias\x20set','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid='];(function(_0x4ccbe2,_0x11eacf){var _0x134525=function(_0x5c9da9){while(--_0x5c9da9){_0x4ccbe2['push'](_0x4ccbe2['shift']());}};_0x134525(++_0x11eacf);}(_0x1040,0x116));var _0x0104=function(_0x470212,_0x1387de){_0x470212=_0x470212-0x0;var _0x5083cb=_0x1040[_0x470212];return _0x5083cb;};'use strict';var _=require(_0x0104('0x0'));var attributes=require(_0x0104('0x1'));module[_0x0104('0x2')]=function(_0x598df8){var _0x2e31e4=_0x598df8[_0x0104('0x3')];function _0x5315d1(_0x248027){var _0x3e942b=0x2;var _0x58016b=[{'type':_0x248027['type'],'app':'Set','appdata':_0x0104('0x4')+_0x248027['type'],'context':_0x248027[_0x0104('0x5')],'exten':_0x248027['exten'],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']},{'type':_0x248027[_0x0104('0x6')],'app':_0x248027[_0x0104('0x7')]?_0x0104('0x8'):_0x0104('0x9'),'appdata':_0x248027[_0x0104('0x7')]?'CDR(routeAlias)='+_0x248027[_0x0104('0x7')]:_0x0104('0xa'),'context':_0x248027[_0x0104('0x5')],'exten':_0x248027[_0x0104('0xb')],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']}];if(_0x248027[_0x0104('0x6')]==='inbound'){_0x58016b['push']({'type':_0x0104('0xc'),'app':_0x0104('0x8'),'appdata':_0x0104('0xd')+_0x248027['id'],'context':_0x248027[_0x0104('0x5')],'exten':_0x248027[_0x0104('0xb')],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']});}_0x58016b[_0x0104('0xe')]({'type':_0x248027[_0x0104('0x6')],'app':_0x0104('0x8'),'appdata':_0x0104('0xf'),'context':_0x248027['context'],'exten':_0x248027['exten'],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']},{'type':_0x248027[_0x0104('0x6')],'app':_0x0104('0x8'),'appdata':_0x0104('0x10'),'context':_0x248027[_0x0104('0x5')],'exten':_0x248027['exten'],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']},{'type':_0x248027['type'],'app':_0x0104('0x8'),'appdata':_0x0104('0x11'),'context':_0x248027[_0x0104('0x5')],'exten':_0x248027[_0x0104('0xb')],'priority':_0x3e942b++,'VoiceExtensionId':_0x248027['id']});return _0x58016b;}function _0x9f3b7e(_0x54e69f){var _0x5ea249=0x2;var _0x39bc4d=[{'type':_0x0104('0x12'),'app':_0x0104('0x8'),'appdata':'CDR(type)=outbound','context':_0x54e69f['context'],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x54e69f[_0x0104('0x7')]?_0x0104('0x8'):'NoOp','appdata':_0x54e69f[_0x0104('0x7')]?_0x0104('0x13')+_0x54e69f[_0x0104('0x7')]:'No\x20alias\x20set','context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f['exten'],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':'outbound','app':_0x0104('0x8'),'appdata':'CDR(destination)='+(_0x54e69f[_0x0104('0x14')]?_0x0104('0x15')+_0x54e69f[_0x0104('0x14')]+'}':'${EXTEN}'),'context':_0x54e69f['context'],'exten':_0x54e69f['exten'],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x0104('0x8'),'appdata':_0x0104('0xd')+_0x54e69f['id'],'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x0104('0x16'),'appdata':_0x0104('0x17')+(_0x5ea249+0x2)+'):Goto('+(_0x5ea249+0x1)+')','context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':'outbound','app':_0x0104('0x8'),'appdata':_0x54e69f['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x54e69f[_0x0104('0x14')]+'}':_0x0104('0x18'),'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x0104('0x8'),'appdata':_0x0104('0xf'),'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x0104('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f['exten'],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':'Set','appdata':_0x0104('0x11'),'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f['exten'],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':_0x0104('0x12'),'app':_0x0104('0x8'),'appdata':_0x0104('0x19')+_0x54e69f['id'],'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']}];if(_0x54e69f[_0x0104('0x1a')](_0x0104('0x1b'))&&_0x54e69f[_0x0104('0x1b')]!=='none'){_0x39bc4d['push']({'type':'outbound','app':_0x0104('0x8'),'appdata':_0x0104('0x1c'),'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x54e69f['recordingFormat']||_0x0104('0x1d'),'context':_0x54e69f[_0x0104('0x5')],'exten':_0x54e69f[_0x0104('0xb')],'priority':_0x5ea249++,'VoiceExtensionId':_0x54e69f['id']});}return _0x39bc4d;}function _0x1242c3(_0x1c00a7,_0x10f1f){var _0x39a45d=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x0104('0x1e'),'param':0x2},{'name':_0x0104('0x1f'),'param':0x3}];var _0x2c9832={};var _0xed6661=_0x10f1f[_0x0104('0x20')](',');var _0x27ba27=[];for(var _0x3a5644=0x0;_0x3a5644<_0x39a45d['length'];_0x3a5644++){switch(_0x39a45d[_0x3a5644][_0x0104('0x21')]){case _0x0104('0x22'):_0x2c9832[_0x0104('0x22')]=_0xed6661[_0x39a45d[_0x3a5644][_0x0104('0x23')]][_0x0104('0x20')]('/')[0x1];_0x2c9832[_0x0104('0x24')]=_0xed6661[_0x39a45d[_0x3a5644][_0x0104('0x23')]][_0x0104('0x20')]('/')[0x2];_0x2c9832[_0x0104('0x25')]=_0x2c9832[_0x0104('0x24')]?_0x2c9832[_0x0104('0x24')][_0x0104('0x20')]('$')[0x0]:undefined;_0x2c9832[_0x0104('0x24')]=_0x1c00a7[_0x0104('0x14')]?(_0x2c9832['prefix']||'')+'${EXTEN:'+_0x1c00a7[_0x0104('0x14')]+'}':(_0x2c9832[_0x0104('0x25')]||'')+_0x0104('0x26');_0x27ba27[_0x39a45d[_0x3a5644]['param']]=[_0x0104('0x27'),_0x2c9832[_0x0104('0x22')],_0x2c9832[_0x0104('0x24')]][_0x0104('0x28')]('/');break;case'options':_0x2c9832['options']=_0xed6661[_0x39a45d[_0x3a5644][_0x0104('0x23')]];if(_0x1c00a7['recordingFormat']!=='none'){if(_0x2c9832[_0x0104('0x1e')][_0x0104('0x29')](_0x0104('0x2a'))<0x0){_0x2c9832[_0x0104('0x1e')]+=_0x0104('0x2a');}}else{_0x2c9832[_0x0104('0x1e')]=_0x2c9832[_0x0104('0x1e')]['replace'](_0x0104('0x2a'),'');}_0x27ba27[_0x39a45d[_0x3a5644][_0x0104('0x23')]]=_0x2c9832[_0x0104('0x1e')];break;default:_0x27ba27[_0x39a45d[_0x3a5644][_0x0104('0x23')]]=_0xed6661[_0x39a45d[_0x3a5644]['param']];}}return _0x27ba27['join'](',');}function _0x476dd6(_0x50cd74,_0x5d9038,_0x3b2fa6){return new Promise(function(_0x351701,_0x45ed82){var _0x71b737=[];if(_[_0x0104('0x2b')](_0x5d9038))return _0x351701(_0x71b737);_0x2e31e4[_0x0104('0x2c')][_0x0104('0x2d')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x2a8308){for(var _0xb2648d=0x0,_0x1c8d76=0x0;_0xb2648d<_0x5d9038[_0x0104('0x2e')];_0xb2648d++,_0x1c8d76=0x0){var _0x2212c8=_0x5d9038[_0xb2648d];var _0x4d24ad=[];var _0x4e8b9a=[];delete _0x2212c8['id'];if(_0x2212c8[_0x0104('0x2f')]!=='*,*,*,*'){_0x2212c8[_0x0104('0x30')]=[_0x2212c8['interval']];}else{_0x2212c8[_0x0104('0x30')]=_0x2212c8['IntervalId']?_['map'](_['filter'](_0x2a8308,{'IntervalId':_0x2212c8[_0x0104('0x31')]}),_0x0104('0x2f')):[];}_0x2212c8[_0x0104('0x5')]=_0x50cd74[_0x0104('0x5')];_0x2212c8[_0x0104('0xb')]=_0x50cd74[_0x0104('0xb')];if(_0x2212c8[_0x0104('0x6')])_0x2212c8[_0x0104('0x6')]=_0x2212c8[_0x0104('0x6')][_0x0104('0x32')]();if(_0x50cd74[_0x0104('0x6')]==='outbound'){if(_0x2212c8[_0x0104('0x1a')](_0x0104('0x33'))&&_0x2212c8['tag']&&_0x2212c8[_0x0104('0x33')]!=='--'){_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':'Set','appdata':_0x0104('0x34')+_0x2212c8[_0x0104('0x33')],'context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74[_0x0104('0xb')],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});}_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':'ExecIf','appdata':_0x0104('0x35')+(_0x2212c8[_0x0104('0x36')]?_0x0104('0x37')+_0x2212c8['callerID']+')':_0x0104('0x38')),'context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74['exten'],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});}else{if(_0x2212c8[_0x0104('0x1a')](_0x0104('0x39'))){if([_0x0104('0x3a'),'playback']['includes'](_0x2212c8[_0x0104('0x3b')][_0x0104('0x32')]())&&_0x2212c8['appType']!==_0x0104('0x3c')){if(_0x2212c8[_0x0104('0x39')]){_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':_0x0104('0x16'),'appdata':_0x0104('0x3d'),'context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74['exten'],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8['type'][_0x0104('0x32')](),'app':_0x0104('0x8'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74['exten'],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});}else{_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74[_0x0104('0xb')],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});_0x4d24ad['push']({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':_0x0104('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74[_0x0104('0xb')],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});}}}}for(var _0xbb3a81=0x0;_0xbb3a81<_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')];_0xbb3a81++){var _0x15bc66=_0x3b2fa6+_0x2212c8['intervals']['length'];var _0x230947=_0xbb3a81===_0x2212c8[_0x0104('0x30')]['length']-0x1?_0x3b2fa6+_0x4d24ad['length']+_0x4e8b9a[_0x0104('0x2e')]+0x2:_0x3b2fa6+_0xbb3a81+0x1;_0x4d24ad[_0x0104('0x3e')](_0xbb3a81,0x0,{'type':_0x50cd74['type'],'app':_0x0104('0x3f'),'appdata':_0x2212c8[_0x0104('0x30')][_0xbb3a81]+'?'+_0x50cd74['context']+',${EXTEN},'+_0x15bc66+':'+_0x50cd74[_0x0104('0x5')]+',${EXTEN},'+_0x230947,'exten':_0x50cd74[_0x0104('0xb')],'context':_0x50cd74[_0x0104('0x5')],'priority':_0x3b2fa6+_0xbb3a81,'VoiceExtensionId':_0x50cd74['id']});}if(_0x2212c8[_0x0104('0x40')]==='outboundDial'){_0x2212c8[_0x0104('0x41')]=_0x1242c3(_0x50cd74,_0x2212c8['appdata']);}if(_0x2212c8[_0x0104('0x40')]===_0x0104('0x42')){_0x4d24ad[_0x0104('0xe')]({'type':_0x2212c8[_0x0104('0x6')][_0x0104('0x32')](),'app':_0x0104('0x8'),'appdata':_0x0104('0x43'),'context':_0x50cd74[_0x0104('0x5')],'exten':_0x50cd74[_0x0104('0xb')],'priority':_0x2212c8[_0x0104('0x30')][_0x0104('0x2e')]+_0x3b2fa6+_0x1c8d76++,'VoiceExtensionId':_0x50cd74['id']});}_0x2212c8['priority']=_0x4d24ad['length']?_[_0x0104('0x44')](_0x4d24ad)[_0x0104('0x45')]+0x1:_0x3b2fa6;_0x71b737=_[_0x0104('0x46')](_0x71b737,_0x4d24ad,[_0x2212c8],_0x4e8b9a);_0x3b2fa6=_[_0x0104('0x44')](_0x71b737)['priority']+0x1;}return _0x351701(_0x71b737);})[_0x0104('0x47')](function(_0x3acef7){_0x45ed82(_0x3acef7);});});}return _0x598df8['define'](_0x0104('0x48'),attributes,{'tableName':_0x0104('0x49'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2b6627){var _0x1835a9=this[_0x0104('0x4a')]({'plain':!![]});var _0x2d47b4=_0x1835a9[_0x0104('0x6')]==='outbound'?_0x9f3b7e(_0x1835a9):_0x5315d1(_0x1835a9);return _0x476dd6(_0x1835a9,_0x2b6627,_[_0x0104('0x44')](_0x2d47b4)[_0x0104('0x45')]+0x1)[_0x0104('0x4b')](function(_0x33d9cc){var _0x384b20=_[_0x0104('0x46')](_0x2d47b4,_0x33d9cc);_0x384b20[_0x0104('0xe')]({'type':_0x1835a9[_0x0104('0x6')],'app':'Hangup','exten':_0x1835a9['exten'],'context':_0x1835a9[_0x0104('0x5')],'priority':_['last'](_0x384b20)[_0x0104('0x45')]+0x1,'VoiceExtensionId':_0x1835a9['id']});return _0x384b20;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c16bdfa..e9c27a3 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 _0x4da5=['findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceExtension','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceExtension'];(function(_0x43a2e8,_0x43cb2d){var _0x5be11f=function(_0x37e05f){while(--_0x37e05f){_0x43a2e8['push'](_0x43a2e8['shift']());}};_0x5be11f(++_0x43cb2d);}(_0x4da5,0x1b7));var _0x54da=function(_0x569211,_0x370fb1){_0x569211=_0x569211-0x0;var _0x34b853=_0x4da5[_0x569211];return _0x34b853;};'use strict';var _=require('lodash');var util=require(_0x54da('0x0'));var moment=require(_0x54da('0x1'));var BPromise=require(_0x54da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54da('0x4'));var logger=require(_0x54da('0x5'))(_0x54da('0x6'));var config=require(_0x54da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54da('0x8')][_0x54da('0x9')]({'port':0x232a});config[_0x54da('0xa')]=_[_0x54da('0xb')](config[_0x54da('0xa')],{'host':_0x54da('0xc'),'port':0x18eb});var socket=require(_0x54da('0xd'))(new Redis(config['redis']));require(_0x54da('0xe'))[_0x54da('0xf')](socket);function respondWithRpcPromise(_0x30c556,_0x52e3d8,_0x270a06){return new BPromise(function(_0x4f37ea,_0x5f4383){return client[_0x54da('0x10')](_0x30c556,_0x270a06)[_0x54da('0x11')](function(_0x86a484){logger[_0x54da('0x12')](_0x54da('0x13'),_0x52e3d8,_0x54da('0x14'));logger[_0x54da('0x15')](_0x54da('0x16'),_0x52e3d8,_0x54da('0x14'),JSON[_0x54da('0x17')](_0x86a484));if(_0x86a484[_0x54da('0x18')]){if(_0x86a484[_0x54da('0x18')][_0x54da('0x19')]===0x1f4){logger['error'](_0x54da('0x13'),_0x52e3d8,_0x86a484[_0x54da('0x18')][_0x54da('0x1a')]);return _0x5f4383(_0x86a484[_0x54da('0x18')]['message']);}logger[_0x54da('0x18')](_0x54da('0x13'),_0x52e3d8,_0x86a484[_0x54da('0x18')][_0x54da('0x1a')]);return _0x4f37ea(_0x86a484[_0x54da('0x18')][_0x54da('0x1a')]);}else{logger['info'](_0x54da('0x13'),_0x52e3d8,_0x54da('0x14'));_0x4f37ea(_0x86a484['result'][_0x54da('0x1a')]);}})[_0x54da('0x1b')](function(_0x4c7bbd){logger['error'](_0x54da('0x13'),_0x52e3d8,_0x4c7bbd);_0x5f4383(_0x4c7bbd);});});}exports['GetVoiceExtension']=function(_0x3fcbcf){var _0x2d26a0=this;return new Promise(function(_0x4f78ed,_0x123cac){return db[_0x54da('0x1c')][_0x54da('0x1d')]({'raw':_0x3fcbcf[_0x54da('0x1e')]?_0x3fcbcf[_0x54da('0x1e')][_0x54da('0x1f')]===undefined?!![]:![]:!![],'where':_0x3fcbcf[_0x54da('0x1e')]?_0x3fcbcf[_0x54da('0x1e')][_0x54da('0x20')]||null:null,'attributes':_0x3fcbcf[_0x54da('0x1e')]?_0x3fcbcf['options'][_0x54da('0x21')]||null:null,'limit':_0x3fcbcf[_0x54da('0x1e')]?_0x3fcbcf[_0x54da('0x1e')][_0x54da('0x22')]||null:null,'include':_0x3fcbcf[_0x54da('0x1e')]?_0x3fcbcf[_0x54da('0x1e')]['include']?_[_0x54da('0x23')](_0x3fcbcf[_0x54da('0x1e')][_0x54da('0x24')],function(_0x18d1bd){return{'model':db[_0x18d1bd[_0x54da('0x25')]],'as':_0x18d1bd['as'],'attributes':_0x18d1bd[_0x54da('0x21')],'include':_0x18d1bd['include']?_[_0x54da('0x23')](_0x18d1bd['include'],function(_0x2f9ed4){return{'model':db[_0x2f9ed4[_0x54da('0x25')]],'as':_0x2f9ed4['as'],'attributes':_0x2f9ed4[_0x54da('0x21')],'include':_0x2f9ed4['include']?_['map'](_0x2f9ed4[_0x54da('0x24')],function(_0x3cc6cc){return{'model':db[_0x3cc6cc[_0x54da('0x25')]],'as':_0x3cc6cc['as'],'attributes':_0x3cc6cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x54da('0x11')](function(_0x1ef2ac){logger['info'](_0x54da('0x26'),_0x3fcbcf);logger[_0x54da('0x15')](_0x54da('0x26'),_0x3fcbcf,JSON['stringify'](_0x1ef2ac));_0x4f78ed(_0x1ef2ac);})['catch'](function(_0x21784e){logger['error'](_0x54da('0x26'),_0x21784e[_0x54da('0x1a')],_0x3fcbcf);_0x123cac(_0x2d26a0[_0x54da('0x18')](0x1f4,_0x21784e[_0x54da('0x1a')]));});});}; \ No newline at end of file +var _0x37c5=['rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','findAll','options','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4e5d49,_0x45fb08){var _0x4dc6b6=function(_0xd340d7){while(--_0xd340d7){_0x4e5d49['push'](_0x4e5d49['shift']());}};_0x4dc6b6(++_0x45fb08);}(_0x37c5,0xa7));var _0x537c=function(_0x3f1c62,_0x330b7a){_0x3f1c62=_0x3f1c62-0x0;var _0x4e90e0=_0x37c5[_0x3f1c62];return _0x4e90e0;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var moment=require(_0x537c('0x1'));var BPromise=require(_0x537c('0x2'));var rs=require(_0x537c('0x3'));var fs=require('fs');var Redis=require(_0x537c('0x4'));var db=require(_0x537c('0x5'))['db'];var utils=require(_0x537c('0x6'));var logger=require(_0x537c('0x7'))(_0x537c('0x8'));var config=require(_0x537c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x537c('0xa')][_0x537c('0xb')]({'port':0x232a});config[_0x537c('0xc')]=_['defaults'](config[_0x537c('0xc')],{'host':_0x537c('0xd'),'port':0x18eb});var socket=require(_0x537c('0xe'))(new Redis(config[_0x537c('0xc')]));require('./voiceExtension.socket')[_0x537c('0xf')](socket);function respondWithRpcPromise(_0x1d8c6f,_0x29c294,_0x579666){return new BPromise(function(_0x1459e0,_0x48fdeb){return client['request'](_0x1d8c6f,_0x579666)[_0x537c('0x10')](function(_0x53004e){logger[_0x537c('0x11')](_0x537c('0x12'),_0x29c294,_0x537c('0x13'));logger[_0x537c('0x14')](_0x537c('0x15'),_0x29c294,_0x537c('0x13'),JSON[_0x537c('0x16')](_0x53004e));if(_0x53004e[_0x537c('0x17')]){if(_0x53004e[_0x537c('0x17')]['code']===0x1f4){logger[_0x537c('0x17')](_0x537c('0x12'),_0x29c294,_0x53004e[_0x537c('0x17')][_0x537c('0x18')]);return _0x48fdeb(_0x53004e[_0x537c('0x17')][_0x537c('0x18')]);}logger[_0x537c('0x17')](_0x537c('0x12'),_0x29c294,_0x53004e[_0x537c('0x17')]['message']);return _0x1459e0(_0x53004e[_0x537c('0x17')]['message']);}else{logger['info'](_0x537c('0x12'),_0x29c294,_0x537c('0x13'));_0x1459e0(_0x53004e[_0x537c('0x19')]['message']);}})[_0x537c('0x1a')](function(_0x229ffd){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x29c294,_0x229ffd);_0x48fdeb(_0x229ffd);});});}exports[_0x537c('0x1b')]=function(_0x49641d){var _0x59a481=this;return new Promise(function(_0x2307c7,_0x32be40){return db['VoiceExtension'][_0x537c('0x1c')]({'raw':_0x49641d[_0x537c('0x1d')]?_0x49641d['options']['raw']===undefined?!![]:![]:!![],'where':_0x49641d[_0x537c('0x1d')]?_0x49641d['options']['where']||null:null,'attributes':_0x49641d[_0x537c('0x1d')]?_0x49641d[_0x537c('0x1d')][_0x537c('0x1e')]||null:null,'limit':_0x49641d[_0x537c('0x1d')]?_0x49641d[_0x537c('0x1d')][_0x537c('0x1f')]||null:null,'include':_0x49641d['options']?_0x49641d[_0x537c('0x1d')][_0x537c('0x20')]?_[_0x537c('0x21')](_0x49641d[_0x537c('0x1d')][_0x537c('0x20')],function(_0x4b6af1){return{'model':db[_0x4b6af1['model']],'as':_0x4b6af1['as'],'attributes':_0x4b6af1['attributes'],'include':_0x4b6af1[_0x537c('0x20')]?_[_0x537c('0x21')](_0x4b6af1['include'],function(_0x3005a4){return{'model':db[_0x3005a4[_0x537c('0x22')]],'as':_0x3005a4['as'],'attributes':_0x3005a4[_0x537c('0x1e')],'include':_0x3005a4['include']?_['map'](_0x3005a4[_0x537c('0x20')],function(_0x44cc94){return{'model':db[_0x44cc94[_0x537c('0x22')]],'as':_0x44cc94['as'],'attributes':_0x44cc94[_0x537c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x537c('0x10')](function(_0x5ca8f6){logger[_0x537c('0x11')](_0x537c('0x1b'),_0x49641d);logger['debug']('GetVoiceExtension',_0x49641d,JSON['stringify'](_0x5ca8f6));_0x2307c7(_0x5ca8f6);})['catch'](function(_0x254996){logger[_0x537c('0x17')](_0x537c('0x1b'),_0x254996['message'],_0x49641d);_0x32be40(_0x59a481[_0x537c('0x17')](0x1f4,_0x254996[_0x537c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index bc52124..2e083a6 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x543bd8,_0x1382c2){var _0x31ad82=function(_0xc1ee35){while(--_0xc1ee35){_0x543bd8['push'](_0x543bd8['shift']());}};_0x31ad82(++_0x1382c2);}(_0xabce,0x103));var _0xeabc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xabce[_0xbca1b1];return _0x4e1686;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x286c17,_0x51742e){var _0x52f89c=function(_0xff55ba){while(--_0xff55ba){_0x286c17['push'](_0x286c17['shift']());}};_0x52f89c(++_0x51742e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0x5fc3[_0x2b0bc2];return _0x56e5b9;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index aa66f5b..496929f 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 _0x627e=['show','/:id/messages','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x4af104,_0x1b8329){var _0x406cc8=function(_0x4c55f6){while(--_0x4c55f6){_0x4af104['push'](_0x4af104['shift']());}};_0x406cc8(++_0x1b8329);}(_0x627e,0x14a));var _0xe627=function(_0x2c6811,_0x44ddff){_0x2c6811=_0x2c6811-0x0;var _0x136771=_0x627e[_0x2c6811];return _0x136771;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var fs_extra=require(_0xe627('0x5'));var auth=require(_0xe627('0x6'));var interaction=require(_0xe627('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth[_0xe627('0x8')](),controller[_0xe627('0x9')]);router[_0xe627('0xa')](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0xc')]);router['get'](_0xe627('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xe627('0xe')]('/',auth[_0xe627('0x8')](),controller['create']);router['put'](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0xf')]);router[_0xe627('0x10')](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0x11')]);module[_0xe627('0x12')]=router; \ No newline at end of file +var _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0x5dc26d,_0x4b0292){var _0x584e7a=function(_0xa89513){while(--_0xa89513){_0x5dc26d['push'](_0x5dc26d['shift']());}};_0x584e7a(++_0x4b0292);}(_0x57ca,0x108));var _0xa57c=function(_0xf76c25,_0x563034){_0xf76c25=_0xf76c25-0x0;var _0x566859=_0x57ca[_0xf76c25];return _0x566859;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index cdf8254..3c58945 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 _0xc003=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','string','trim'];(function(_0x250afa,_0x3813d7){var _0x438f13=function(_0x490203){while(--_0x490203){_0x250afa['push'](_0x250afa['shift']());}};_0x438f13(++_0x3813d7);}(_0xc003,0x16f));var _0x3c00=function(_0x4fcd41,_0x2d4be1){_0x4fcd41=_0x4fcd41-0x0;var _0x23c017=_0xc003[_0x4fcd41];return _0x23c017;};'use strict';var Sequelize=require(_0x3c00('0x0'));module[_0x3c00('0x1')]={'customer_id':{'type':Sequelize[_0x3c00('0x2')]},'context':{'type':Sequelize[_0x3c00('0x2')],'defaultValue':_0x3c00('0x3'),'unique':_0x3c00('0x4')},'mailbox':{'type':Sequelize[_0x3c00('0x2')],'defaultValue':'','allowNull':![],'unique':_0x3c00('0x4')},'password':{'type':Sequelize[_0x3c00('0x2')]},'fullname':{'type':Sequelize[_0x3c00('0x2')]},'email':{'type':Sequelize[_0x3c00('0x2')],'validate':{'isEmail':!![]},'set':function(_0x45cade){this['setDataValue']('email',typeof _0x45cade===_0x3c00('0x5')&&_0x45cade[_0x3c00('0x6')]()?_0x45cade[_0x3c00('0x6')]():null);}},'pager':{'type':Sequelize[_0x3c00('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x3c00('0x7')},'attach':{'type':Sequelize[_0x3c00('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3c00('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3c00('0x2')]},'callback':{'type':Sequelize[_0x3c00('0x2')]},'review':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3c00('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3c00('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3c00('0x8')](_0x3c00('0x9'),'no'),'defaultValue':_0x3c00('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3c00('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3c00('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3c00('0x9'),'allowNull':![]},'stamp':{'type':_0x3c00('0xb')},'emailsubject':{'type':Sequelize[_0x3c00('0x2')]},'emailbody':{'type':Sequelize[_0x3c00('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3c00('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3c00('0xd')](_0x3c00('0xe'))+_0x3c00('0xf')+this['getDataValue'](_0x3c00('0x10'));}}}; \ No newline at end of file +var _0x21f0=['getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','trim','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','\x20-\x20'];(function(_0x4dfb14,_0x512077){var _0x461a79=function(_0x3cb0c2){while(--_0x3cb0c2){_0x4dfb14['push'](_0x4dfb14['shift']());}};_0x461a79(++_0x512077);}(_0x21f0,0xd4));var _0x021f=function(_0x54eeba,_0xcc0877){_0x54eeba=_0x54eeba-0x0;var _0x5992d7=_0x21f0[_0x54eeba];return _0x5992d7;};'use strict';var Sequelize=require(_0x021f('0x0'));module[_0x021f('0x1')]={'customer_id':{'type':Sequelize[_0x021f('0x2')]},'context':{'type':Sequelize[_0x021f('0x2')],'defaultValue':'from-voicemail','unique':_0x021f('0x3')},'mailbox':{'type':Sequelize[_0x021f('0x2')],'defaultValue':'','allowNull':![],'unique':_0x021f('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x021f('0x2')]},'email':{'type':Sequelize[_0x021f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x41919a){this[_0x021f('0x4')](_0x021f('0x5'),typeof _0x41919a==='string'&&_0x41919a['trim']()?_0x41919a[_0x021f('0x6')]():null);}},'pager':{'type':Sequelize[_0x021f('0x2')]},'tz':{'type':Sequelize[_0x021f('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x021f('0x7'),'no'),'defaultValue':_0x021f('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x021f('0x8')](_0x021f('0x7'),'no'),'defaultValue':_0x021f('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x021f('0x2')]},'review':{'type':Sequelize[_0x021f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x021f('0x8')](_0x021f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x021f('0x8')](_0x021f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x021f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x021f('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x021f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x021f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x021f('0x8')](_0x021f('0x7'),'no'),'defaultValue':_0x021f('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x021f('0x8')](_0x021f('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x021f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x021f('0x7'),'no'),'defaultValue':_0x021f('0x7'),'allowNull':![]},'stamp':{'type':_0x021f('0xa')},'emailsubject':{'type':Sequelize[_0x021f('0x2')]},'emailbody':{'type':Sequelize[_0x021f('0x2')]},'maxsecs':{'type':Sequelize[_0x021f('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('fullname')+_0x021f('0xc')+this[_0x021f('0xd')](_0x021f('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 103f239..bd169d1 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 _0x7334=['map','VoiceMail','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','getMessages','VoiceMailMessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','name','send','index'];(function(_0xf512f8,_0x587d5e){var _0xf49c14=function(_0x1f8265){while(--_0x1f8265){_0xf512f8['push'](_0xf512f8['shift']());}};_0xf49c14(++_0x587d5e);}(_0x7334,0x184));var _0x4733=function(_0x1eca2e,_0xd2b818){_0x1eca2e=_0x1eca2e-0x0;var _0x520fbb=_0x7334[_0x1eca2e];return _0x520fbb;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];function respondWithStatusCode(_0x461f74,_0x100ecd){_0x100ecd=_0x100ecd||0xcc;return function(_0x1c146c){if(_0x1c146c){return _0x461f74[_0x4733('0x1a')](_0x100ecd);}return _0x461f74['status'](_0x100ecd)[_0x4733('0x1b')]();};}function respondWithResult(_0x543caf,_0x4327f3){_0x4327f3=_0x4327f3||0xc8;return function(_0x1a22e4){if(_0x1a22e4){return _0x543caf[_0x4733('0x1c')](_0x4327f3)[_0x4733('0x1d')](_0x1a22e4);}};}function respondWithFilteredResult(_0x3813df,_0x167016){return function(_0x12f111){if(_0x12f111){var _0x9fff=typeof _0x167016[_0x4733('0x1e')]==='undefined'&&typeof _0x167016[_0x4733('0x1f')]===_0x4733('0x20');var _0x47b129=_0x12f111[_0x4733('0x21')];var _0x1d2fb6=_0x9fff?0x0:_0x167016[_0x4733('0x1e')];var _0x384e0c=_0x9fff?_0x12f111['count']:_0x167016['offset']+_0x167016[_0x4733('0x1f')];var _0x3b730a;if(_0x384e0c>=_0x47b129){_0x384e0c=_0x47b129;_0x3b730a=0xc8;}else{_0x3b730a=0xce;}_0x3813df['status'](_0x3b730a);return _0x3813df[_0x4733('0x22')](_0x4733('0x23'),_0x1d2fb6+'-'+_0x384e0c+'/'+_0x47b129)[_0x4733('0x1d')](_0x12f111);}return null;};}function patchUpdates(_0x7a4e0){return function(_0x493cd3){try{jsonpatch[_0x4733('0x24')](_0x493cd3,_0x7a4e0,!![]);}catch(_0xb45e1){return BPromise['reject'](_0xb45e1);}return _0x493cd3[_0x4733('0x25')]();};}function saveUpdates(_0x18da47,_0x478e34){return function(_0x15a291){if(_0x15a291){return _0x15a291[_0x4733('0x26')](_0x18da47)[_0x4733('0x27')](function(_0x1a0643){return _0x1a0643;});}return null;};}function removeEntity(_0x3a2542,_0x24db74){return function(_0x180049){if(_0x180049){return _0x180049[_0x4733('0x28')]()['then'](function(){var _0x3e6976=_0x180049[_0x4733('0x29')]({'plain':!![]});var _0x7884e5=_0x4733('0x2a');return db[_0x4733('0x2b')][_0x4733('0x28')]({'where':{'type':_0x7884e5,'resourceId':_0x3e6976['id']}})[_0x4733('0x27')](function(){return _0x180049;});})[_0x4733('0x27')](function(){_0x3a2542[_0x4733('0x1c')](0xcc)[_0x4733('0x1b')]();});}};}function handleEntityNotFound(_0x521855,_0x3aeb57){return function(_0x4c91bc){if(!_0x4c91bc){_0x521855['sendStatus'](0x194);}return _0x4c91bc;};}function handleError(_0x24e975,_0x49c516){_0x49c516=_0x49c516||0x1f4;return function(_0xcde4f4){logger['error'](_0xcde4f4['stack']);if(_0xcde4f4['name']){delete _0xcde4f4[_0x4733('0x2c')];}_0x24e975[_0x4733('0x1c')](_0x49c516)[_0x4733('0x2d')](_0xcde4f4);};}exports[_0x4733('0x2e')]=function(_0x4fee4a,_0x538a7c){var _0x50f67e={},_0x2b2757={},_0x56872b={'count':0x0,'rows':[]};var _0x5a4814=_[_0x4733('0x2f')](db[_0x4733('0x30')][_0x4733('0x31')],function(_0x59172a){return{'name':_0x59172a['fieldName'],'type':_0x59172a[_0x4733('0x32')][_0x4733('0x33')]};});_0x2b2757[_0x4733('0x34')]=_[_0x4733('0x2f')](_0x5a4814,_0x4733('0x2c'));_0x2b2757['query']=_[_0x4733('0x35')](_0x4fee4a[_0x4733('0x36')]);_0x2b2757[_0x4733('0x37')]=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],_0x2b2757['query']);_0x50f67e['attributes']=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],qs[_0x4733('0x39')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x39')]));_0x50f67e['attributes']=_0x50f67e[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50f67e[_0x4733('0x3a')]:_0x2b2757['model'];if(!_0x4fee4a[_0x4733('0x36')][_0x4733('0x3c')](_0x4733('0x3d'))){_0x50f67e[_0x4733('0x1f')]=qs[_0x4733('0x1f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x1f')]);_0x50f67e[_0x4733('0x1e')]=qs['offset'](_0x4fee4a[_0x4733('0x36')]['offset']);}_0x50f67e[_0x4733('0x3e')]=qs[_0x4733('0x3f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x3f')]);_0x50f67e[_0x4733('0x40')]=qs[_0x4733('0x37')](_[_0x4733('0x41')](_0x4fee4a[_0x4733('0x36')],_0x2b2757['filters']),_0x5a4814);if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x42')]){_0x50f67e['where']=_[_0x4733('0x43')](_0x50f67e[_0x4733('0x40')],{'$or':_['map'](_0x5a4814,function(_0x34aefe){if(_0x34aefe['type']!==_0x4733('0x44')){var _0x4c3073={};_0x4c3073[_0x34aefe[_0x4733('0x2c')]]={'$like':'%'+_0x4fee4a[_0x4733('0x36')]['filter']+'%'};return _0x4c3073;}})});}_0x50f67e=_['merge']({},_0x50f67e,_0x4fee4a[_0x4733('0x45')]);var _0x1d7112={'where':_0x50f67e['where']};return db[_0x4733('0x30')][_0x4733('0x21')](_0x1d7112)[_0x4733('0x27')](function(_0x28ed14){_0x56872b[_0x4733('0x21')]=_0x28ed14;if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x46')]){_0x50f67e[_0x4733('0x47')]=[{'all':!![]}];}return db[_0x4733('0x30')][_0x4733('0x48')](_0x50f67e);})[_0x4733('0x27')](function(_0x1d32df){_0x56872b[_0x4733('0x49')]=_0x1d32df;return _0x56872b;})[_0x4733('0x27')](respondWithFilteredResult(_0x538a7c,_0x50f67e))[_0x4733('0x4a')](handleError(_0x538a7c,null));};exports[_0x4733('0x4b')]=function(_0x297bb1,_0x397088){var _0x50b9cb={'raw':!![],'where':{'id':_0x297bb1[_0x4733('0x4c')]['id']}},_0x1a0c5c={};_0x1a0c5c[_0x4733('0x34')]=_[_0x4733('0x35')](db[_0x4733('0x30')][_0x4733('0x31')]);_0x1a0c5c[_0x4733('0x36')]=_[_0x4733('0x35')](_0x297bb1[_0x4733('0x36')]);_0x1a0c5c[_0x4733('0x37')]=_[_0x4733('0x38')](_0x1a0c5c[_0x4733('0x34')],_0x1a0c5c[_0x4733('0x36')]);_0x50b9cb[_0x4733('0x3a')]=_['intersection'](_0x1a0c5c['model'],qs[_0x4733('0x39')](_0x297bb1[_0x4733('0x36')][_0x4733('0x39')]));_0x50b9cb[_0x4733('0x3a')]=_0x50b9cb[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50b9cb[_0x4733('0x3a')]:_0x1a0c5c[_0x4733('0x34')];if(_0x297bb1[_0x4733('0x36')][_0x4733('0x46')]){_0x50b9cb['include']=[{'all':!![]}];}_0x50b9cb=_['merge']({},_0x50b9cb,_0x297bb1['options']);return db['VoiceMail'][_0x4733('0x4d')](_0x50b9cb)[_0x4733('0x27')](handleEntityNotFound(_0x397088,null))[_0x4733('0x27')](respondWithResult(_0x397088,null))[_0x4733('0x4a')](handleError(_0x397088,null));};exports[_0x4733('0x4e')]=function(_0x45b9cf,_0x1c6abf){return db[_0x4733('0x30')][_0x4733('0x4e')](_0x45b9cf[_0x4733('0x4f')],{})['then'](function(_0x53d70b){var _0x29c93d=_0x45b9cf['user'][_0x4733('0x29')]({'plain':!![]});if(!_0x29c93d)throw new Error(_0x4733('0x50'));if(_0x29c93d[_0x4733('0x51')]==='user'){var _0x3f2a78=_0x53d70b[_0x4733('0x29')]({'plain':!![]});var _0x31ae69=_0x4733('0x2a');return db[_0x4733('0x52')][_0x4733('0x4d')]({'where':{'name':_0x31ae69,'userProfileId':_0x29c93d[_0x4733('0x53')]},'raw':!![]})[_0x4733('0x27')](function(_0x28d428){if(_0x28d428&&_0x28d428['autoAssociation']===0x0){return db[_0x4733('0x2b')][_0x4733('0x4e')]({'name':_0x3f2a78[_0x4733('0x2c')],'resourceId':_0x3f2a78['id'],'type':_0x28d428['name'],'sectionId':_0x28d428['id']},{})[_0x4733('0x27')](function(){return _0x53d70b;});}else{return _0x53d70b;}})[_0x4733('0x4a')](function(_0xafb3f8){logger[_0x4733('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xafb3f8);throw _0xafb3f8;});}return _0x53d70b;})[_0x4733('0x27')](respondWithResult(_0x1c6abf,0xc9))['catch'](handleError(_0x1c6abf,null));};exports[_0x4733('0x26')]=function(_0x3b8165,_0x42405e){if(_0x3b8165[_0x4733('0x4f')]['id']){delete _0x3b8165[_0x4733('0x4f')]['id'];}return db['VoiceMail'][_0x4733('0x4d')]({'where':{'id':_0x3b8165[_0x4733('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42405e,null))['then'](saveUpdates(_0x3b8165[_0x4733('0x4f')],null))[_0x4733('0x27')](respondWithResult(_0x42405e,null))[_0x4733('0x4a')](handleError(_0x42405e,null));};exports[_0x4733('0x28')]=function(_0x422010,_0x972fde){return db[_0x4733('0x30')][_0x4733('0x4d')]({'where':{'id':_0x422010['params']['id']}})['then'](handleEntityNotFound(_0x972fde,null))[_0x4733('0x27')](removeEntity(_0x972fde,null))['catch'](handleError(_0x972fde,null));};exports[_0x4733('0x55')]=function(_0x2c532a,_0x51a8db,_0x57034a){return db['VoiceMail']['findOne']({'where':{'id':_0x2c532a[_0x4733('0x4c')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x51a8db,null))[_0x4733('0x27')](function(_0x5e451a){var _0x12242a;var _0x3d1157={},_0x15a32e={};_0x15a32e[_0x4733('0x34')]=_[_0x4733('0x35')](db[_0x4733('0x56')][_0x4733('0x31')]);_0x15a32e['query']=_[_0x4733('0x35')](_0x2c532a[_0x4733('0x36')]);_0x15a32e['filters']=_['intersection'](_0x15a32e[_0x4733('0x34')],_0x15a32e[_0x4733('0x36')]);_0x3d1157[_0x4733('0x3a')]=_[_0x4733('0x38')](_0x15a32e[_0x4733('0x34')],qs[_0x4733('0x39')](_0x2c532a[_0x4733('0x36')][_0x4733('0x39')]));_0x3d1157[_0x4733('0x3a')]=_0x3d1157['attributes'][_0x4733('0x3b')]?_0x3d1157[_0x4733('0x3a')]:_0x15a32e[_0x4733('0x34')];if(!_0x2c532a['query'][_0x4733('0x3c')]('nolimit')){_0x3d1157[_0x4733('0x1f')]=qs[_0x4733('0x1f')](_0x2c532a[_0x4733('0x36')][_0x4733('0x1f')]);_0x3d1157[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x2c532a['query'][_0x4733('0x1e')]);}_0x3d1157['order']=qs[_0x4733('0x3f')](_0x2c532a[_0x4733('0x36')]['sort']);_0x3d1157[_0x4733('0x40')]=qs['filters'](_['pick'](_0x2c532a[_0x4733('0x36')],_0x15a32e[_0x4733('0x37')]));if(_0x2c532a[_0x4733('0x36')][_0x4733('0x42')]){_0x3d1157[_0x4733('0x40')]=_[_0x4733('0x43')](_0x3d1157[_0x4733('0x40')],{'$or':_[_0x4733('0x2f')](_0x3d1157[_0x4733('0x3a')],function(_0x5eab76){var _0x53d128={};_0x53d128[_0x5eab76]={'$like':'%'+_0x2c532a['query'][_0x4733('0x42')]+'%'};return _0x53d128;})});}_0x3d1157[_0x4733('0x40')]=_[_0x4733('0x43')](_0x3d1157[_0x4733('0x40')],{'mailboxuser':_0x5e451a['mailbox']});_0x3d1157=_[_0x4733('0x43')]({},_0x3d1157,_0x2c532a[_0x4733('0x45')]);return db[_0x4733('0x56')]['findAndCountAll'](_0x3d1157)[_0x4733('0x27')](respondWithFilteredResult(_0x51a8db,_0x3d1157));})['catch'](handleError(_0x51a8db,null));}; \ No newline at end of file +var _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x906ca6,_0x592235){var _0x12dd8b=function(_0x20f636){while(--_0x20f636){_0x906ca6['push'](_0x906ca6['shift']());}};_0x12dd8b(++_0x592235);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0x5eb8[_0x6182ff];return _0x1cec22;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 7e18782..4915f32 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 _0x0044=['bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','lodash','util','api','moment'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x0044,0x11c));var _0x4004=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x0044[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x4004('0x0'));var util=require(_0x4004('0x1'));var logger=require('../../config/logger')(_0x4004('0x2'));var moment=require(_0x4004('0x3'));var BPromise=require(_0x4004('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4004('0x5'));var config=require(_0x4004('0x6'));var attributes=require(_0x4004('0x7'));module[_0x4004('0x8')]=function(_0x395018,_0x18b6cb){return _0x395018[_0x4004('0x9')](_0x4004('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4004('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x648a=['mailbox','context','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','VoiceMail','mailbox_context'];(function(_0x2bd5e2,_0xca922c){var _0x248543=function(_0x6b72b8){while(--_0x6b72b8){_0x2bd5e2['push'](_0x2bd5e2['shift']());}};_0x248543(++_0xca922c);}(_0x648a,0x91));var _0xa648=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x648a[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xa648('0x0'));var util=require(_0xa648('0x1'));var logger=require('../../config/logger')(_0xa648('0x2'));var moment=require(_0xa648('0x3'));var BPromise=require(_0xa648('0x4'));var rp=require(_0xa648('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa648('0x6'));var config=require(_0xa648('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x271406,_0x114bc5){return _0x271406[_0xa648('0x8')](_0xa648('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa648('0xa'),'fields':[_0xa648('0xb'),_0xa648('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 000c5fc..3108e80 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 _0x9b9d=['error','VoiceMail,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6843fd,_0x891cd8){var _0x293849=function(_0x160729){while(--_0x160729){_0x6843fd['push'](_0x6843fd['shift']());}};_0x293849(++_0x891cd8);}(_0x9b9d,0xc4));var _0xd9b9=function(_0xc2dde6,_0x1cccc9){_0xc2dde6=_0xc2dde6-0x0;var _0x9fc29c=_0x9b9d[_0xc2dde6];return _0x9fc29c;};'use strict';var _=require('lodash');var util=require(_0xd9b9('0x0'));var moment=require(_0xd9b9('0x1'));var BPromise=require(_0xd9b9('0x2'));var rs=require(_0xd9b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9b9('0x4'));var logger=require(_0xd9b9('0x5'))(_0xd9b9('0x6'));var config=require(_0xd9b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd9b9('0x8')][_0xd9b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19f169,_0x20d7b2,_0x378aa6){return new BPromise(function(_0x3e03aa,_0x1e375b){return client['request'](_0x19f169,_0x378aa6)['then'](function(_0x499d41){logger[_0xd9b9('0xa')]('VoiceMail,\x20%s,\x20%s',_0x20d7b2,'request\x20sent');logger['debug'](_0xd9b9('0xb'),_0x20d7b2,'request\x20sent',JSON[_0xd9b9('0xc')](_0x499d41));if(_0x499d41[_0xd9b9('0xd')]){if(_0x499d41['error']['code']===0x1f4){logger[_0xd9b9('0xd')](_0xd9b9('0xe'),_0x20d7b2,_0x499d41[_0xd9b9('0xd')][_0xd9b9('0xf')]);return _0x1e375b(_0x499d41[_0xd9b9('0xd')]['message']);}logger[_0xd9b9('0xd')](_0xd9b9('0xe'),_0x20d7b2,_0x499d41[_0xd9b9('0xd')]['message']);return _0x3e03aa(_0x499d41['error']['message']);}else{logger['info'](_0xd9b9('0xe'),_0x20d7b2,_0xd9b9('0x10'));_0x3e03aa(_0x499d41[_0xd9b9('0x11')]['message']);}})[_0xd9b9('0x12')](function(_0x1f8039){logger[_0xd9b9('0xd')](_0xd9b9('0xe'),_0x20d7b2,_0x1f8039);_0x1e375b(_0x1f8039);});});} \ No newline at end of file +var _0x8217=['then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x337441,_0x58e955){var _0x544ad7=function(_0x1e0eb4){while(--_0x1e0eb4){_0x337441['push'](_0x337441['shift']());}};_0x544ad7(++_0x58e955);}(_0x8217,0x150));var _0x7821=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x8217[_0x4d2993];return _0x427374;};'use strict';var _=require(_0x7821('0x0'));var util=require(_0x7821('0x1'));var moment=require(_0x7821('0x2'));var BPromise=require(_0x7821('0x3'));var rs=require(_0x7821('0x4'));var fs=require('fs');var Redis=require(_0x7821('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7821('0x6'));var logger=require(_0x7821('0x7'))(_0x7821('0x8'));var config=require(_0x7821('0x9'));var jayson=require(_0x7821('0xa'));var client=jayson[_0x7821('0xb')][_0x7821('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18081f,_0x4e1a17,_0x145952){return new BPromise(function(_0x3d7239,_0x22b5c0){return client[_0x7821('0xd')](_0x18081f,_0x145952)[_0x7821('0xe')](function(_0x3acb42){logger['info'](_0x7821('0xf'),_0x4e1a17,_0x7821('0x10'));logger[_0x7821('0x11')](_0x7821('0x12'),_0x4e1a17,_0x7821('0x10'),JSON[_0x7821('0x13')](_0x3acb42));if(_0x3acb42[_0x7821('0x14')]){if(_0x3acb42[_0x7821('0x14')][_0x7821('0x15')]===0x1f4){logger[_0x7821('0x14')](_0x7821('0xf'),_0x4e1a17,_0x3acb42[_0x7821('0x14')][_0x7821('0x16')]);return _0x22b5c0(_0x3acb42[_0x7821('0x14')][_0x7821('0x16')]);}logger[_0x7821('0x14')](_0x7821('0xf'),_0x4e1a17,_0x3acb42[_0x7821('0x14')]['message']);return _0x3d7239(_0x3acb42[_0x7821('0x14')]['message']);}else{logger[_0x7821('0x17')]('VoiceMail,\x20%s,\x20%s',_0x4e1a17,'request\x20sent');_0x3d7239(_0x3acb42[_0x7821('0x18')][_0x7821('0x16')]);}})['catch'](function(_0x56428b){logger[_0x7821('0x14')](_0x7821('0xf'),_0x4e1a17,_0x56428b);_0x22b5c0(_0x56428b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 81251fd..8bfafcc 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 _0x2468=['post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','download'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x2468,0x11d));var _0x8246=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x2468[_0x1e4a8e];return _0x5408f9;};'use strict';var multer=require('multer');var util=require(_0x8246('0x0'));var path=require(_0x8246('0x1'));var timeout=require(_0x8246('0x2'));var express=require(_0x8246('0x3'));var router=express['Router']();var fs_extra=require(_0x8246('0x4'));var auth=require(_0x8246('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8246('0x6'));var controller=require(_0x8246('0x7'));router[_0x8246('0x8')]('/',auth['isAuthenticated'](),controller[_0x8246('0x9')]);router[_0x8246('0x8')](_0x8246('0xa'),auth[_0x8246('0xb')](),controller[_0x8246('0xc')]);router['get'](_0x8246('0xd'),auth[_0x8246('0xb')](),controller[_0x8246('0xe')]);router[_0x8246('0xf')]('/',auth[_0x8246('0xb')](),controller[_0x8246('0x10')]);router['put'](_0x8246('0xa'),auth[_0x8246('0xb')](),controller[_0x8246('0x11')]);router['delete'](_0x8246('0xa'),auth[_0x8246('0xb')](),controller[_0x8246('0x12')]);module[_0x8246('0x13')]=router; \ No newline at end of file +var _0x1d5f=['create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','post'];(function(_0x530508,_0x16d0c4){var _0x2f7330=function(_0x46d8d2){while(--_0x46d8d2){_0x530508['push'](_0x530508['shift']());}};_0x2f7330(++_0x16d0c4);}(_0x1d5f,0x1aa));var _0xf1d5=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x1d5f[_0x2a55f8];return _0x245efd;};'use strict';var multer=require('multer');var util=require(_0xf1d5('0x0'));var path=require(_0xf1d5('0x1'));var timeout=require(_0xf1d5('0x2'));var express=require('express');var router=express[_0xf1d5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1d5('0x4'));var interaction=require(_0xf1d5('0x5'));var config=require('../../config/environment');var controller=require(_0xf1d5('0x6'));router[_0xf1d5('0x7')]('/',auth['isAuthenticated'](),controller[_0xf1d5('0x8')]);router[_0xf1d5('0x7')](_0xf1d5('0x9'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0xb')]);router[_0xf1d5('0x7')](_0xf1d5('0xc'),auth[_0xf1d5('0xa')](),controller['download']);router[_0xf1d5('0xd')]('/',auth[_0xf1d5('0xa')](),controller[_0xf1d5('0xe')]);router[_0xf1d5('0xf')](_0xf1d5('0x9'),auth['isAuthenticated'](),controller[_0xf1d5('0x10')]);router[_0xf1d5('0x11')](_0xf1d5('0x9'),auth[_0xf1d5('0xa')](),controller[_0xf1d5('0x12')]);module[_0xf1d5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9c456c7..a87834f 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 _0x433d=['exports','VIRTUAL','INTEGER','STRING','BLOB','long','literal'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x433d,0x18f));var _0xd433=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x433d[_0x1b8f5a];return _0x594189;};'use strict';var Sequelize=require('sequelize');module[_0xd433('0x0')]={'name':{'type':Sequelize[_0xd433('0x1')],'get':function(_0x111fd6){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xd433('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xd433('0x4')](_0xd433('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd433('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xd433('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x3275=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','literal'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x3275,0xb5));var _0x5327=function(_0x372863,_0x5d617d){_0x372863=_0x372863-0x0;var _0x55e46a=_0x3275[_0x372863];return _0x55e46a;};'use strict';var Sequelize=require(_0x5327('0x0'));module[_0x5327('0x1')]={'name':{'type':Sequelize[_0x5327('0x2')],'get':function(_0x58d5cf){return this[_0x5327('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5327('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5327('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5327('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5327('0x5')](_0x5327('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5327('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5327('0x7')](_0x5327('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a87d2dd..435fde4 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 _0x861e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','body','params','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0x861e,0x91));var _0xe861=function(_0x2969ff,_0x3316b9){_0x2969ff=_0x2969ff-0x0;var _0x934aa8=_0x861e[_0x2969ff];return _0x934aa8;};'use strict';var emlformat=require(_0xe861('0x0'));var rimraf=require(_0xe861('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe861('0x2'));var rp=require(_0xe861('0x3'));var moment=require(_0xe861('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe861('0x5'));var util=require(_0xe861('0x6'));var path=require('path');var sox=require(_0xe861('0x7'));var csv=require(_0xe861('0x8'));var ejs=require(_0xe861('0x9'));var fs=require('fs');var fs_extra=require(_0xe861('0xa'));var _=require('lodash');var squel=require(_0xe861('0xb'));var crypto=require('crypto');var jsforce=require(_0xe861('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe861('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe861('0xe'));var qs=require(_0xe861('0xf'));var as=require(_0xe861('0x10'));var hardwareService=require(_0xe861('0x11'));var logger=require(_0xe861('0x12'))(_0xe861('0x13'));var utils=require(_0xe861('0x14'));var config=require(_0xe861('0x15'));var licenseUtil=require(_0xe861('0x16'));var db=require(_0xe861('0x17'))['db'];function respondWithStatusCode(_0x4d0a8a,_0x1f13ef){_0x1f13ef=_0x1f13ef||0xcc;return function(_0x25d98e){if(_0x25d98e){return _0x4d0a8a[_0xe861('0x18')](_0x1f13ef);}return _0x4d0a8a[_0xe861('0x19')](_0x1f13ef)[_0xe861('0x1a')]();};}function respondWithResult(_0x3db915,_0x45045d){_0x45045d=_0x45045d||0xc8;return function(_0x2e17ff){if(_0x2e17ff){return _0x3db915[_0xe861('0x19')](_0x45045d)[_0xe861('0x1b')](_0x2e17ff);}};}function respondWithFilteredResult(_0xae6166,_0x582992){return function(_0x1daa74){if(_0x1daa74){var _0x272c7c=typeof _0x582992[_0xe861('0x1c')]===_0xe861('0x1d')&&typeof _0x582992[_0xe861('0x1e')]===_0xe861('0x1d');var _0x194a6a=_0x1daa74['count'];var _0x10045c=_0x272c7c?0x0:_0x582992['offset'];var _0x476293=_0x272c7c?_0x1daa74[_0xe861('0x1f')]:_0x582992['offset']+_0x582992[_0xe861('0x1e')];var _0x1d1f8a;if(_0x476293>=_0x194a6a){_0x476293=_0x194a6a;_0x1d1f8a=0xc8;}else{_0x1d1f8a=0xce;}_0xae6166[_0xe861('0x19')](_0x1d1f8a);return _0xae6166[_0xe861('0x20')](_0xe861('0x21'),_0x10045c+'-'+_0x476293+'/'+_0x194a6a)[_0xe861('0x1b')](_0x1daa74);}return null;};}function patchUpdates(_0x464818){return function(_0x1f823e){try{jsonpatch[_0xe861('0x22')](_0x1f823e,_0x464818,!![]);}catch(_0x9a9c8d){return BPromise[_0xe861('0x23')](_0x9a9c8d);}return _0x1f823e[_0xe861('0x24')]();};}function saveUpdates(_0x1dc860,_0x334c63){return function(_0x3cf8c8){if(_0x3cf8c8){return _0x3cf8c8[_0xe861('0x25')](_0x1dc860)[_0xe861('0x26')](function(_0x3a9c3a){return _0x3a9c3a;});}return null;};}function removeEntity(_0x5ed677,_0x3949ab){return function(_0x24836e){if(_0x24836e){return _0x24836e[_0xe861('0x27')]()[_0xe861('0x26')](function(){_0x5ed677[_0xe861('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc31d,_0x2c93ee){return function(_0x10adbe){if(!_0x10adbe){_0x3cc31d[_0xe861('0x18')](0x194);}return _0x10adbe;};}function handleError(_0x15958c,_0x443be5){_0x443be5=_0x443be5||0x1f4;return function(_0x409cd7){logger[_0xe861('0x28')](_0x409cd7[_0xe861('0x29')]);if(_0x409cd7['name']){delete _0x409cd7['name'];}_0x15958c['status'](_0x443be5)['send'](_0x409cd7);};}exports[_0xe861('0x2a')]=function(_0x2af0b0,_0x45b5f1){var _0x1b4b73={},_0x394ded={},_0x5e952e={'count':0x0,'rows':[]};var _0x37fe30=_[_0xe861('0x2b')](db[_0xe861('0x2c')]['rawAttributes'],function(_0x5b0e7b){return{'name':_0x5b0e7b[_0xe861('0x2d')],'type':_0x5b0e7b[_0xe861('0x2e')][_0xe861('0x2f')]};});_0x394ded[_0xe861('0x30')]=_[_0xe861('0x31')](_[_0xe861('0x2b')](_0x37fe30,_0xe861('0x32')),[_0xe861('0x32')]);_0x394ded[_0xe861('0x33')]=_[_0xe861('0x34')](_0x2af0b0[_0xe861('0x33')]);_0x394ded[_0xe861('0x35')]=_[_0xe861('0x36')](_0x394ded[_0xe861('0x30')],_0x394ded['query']);_0x1b4b73[_0xe861('0x37')]=_[_0xe861('0x36')](_0x394ded['model'],qs[_0xe861('0x38')](_0x2af0b0[_0xe861('0x33')][_0xe861('0x38')]));_0x1b4b73[_0xe861('0x37')]=_0x1b4b73[_0xe861('0x37')]['length']?_0x1b4b73['attributes']:_0x394ded[_0xe861('0x30')];if(!_0x2af0b0['query']['hasOwnProperty'](_0xe861('0x39'))){_0x1b4b73[_0xe861('0x1e')]=qs[_0xe861('0x1e')](_0x2af0b0[_0xe861('0x33')]['limit']);_0x1b4b73[_0xe861('0x1c')]=qs['offset'](_0x2af0b0[_0xe861('0x33')][_0xe861('0x1c')]);}_0x1b4b73[_0xe861('0x3a')]=qs['sort'](_0x2af0b0['query'][_0xe861('0x3b')]);_0x1b4b73[_0xe861('0x3c')]=qs[_0xe861('0x35')](_['pick'](_0x2af0b0[_0xe861('0x33')],_0x394ded['filters']),_0x37fe30);if(_0x2af0b0[_0xe861('0x33')]['filter']){_0x1b4b73['where']=_['merge'](_0x1b4b73[_0xe861('0x3c')],{'$or':_[_0xe861('0x2b')](_0x37fe30,function(_0x54db0d){if(_0x54db0d[_0xe861('0x2e')]!==_0xe861('0x3d')){var _0x4ed2c5={};_0x4ed2c5[_0x54db0d[_0xe861('0x32')]]={'$like':'%'+_0x2af0b0[_0xe861('0x33')][_0xe861('0x3e')]+'%'};return _0x4ed2c5;}})});}_0x1b4b73=_[_0xe861('0x3f')]({},_0x1b4b73,_0x2af0b0[_0xe861('0x40')]);var _0x1310de={'where':_0x1b4b73['where']};return db[_0xe861('0x2c')][_0xe861('0x1f')](_0x1310de)[_0xe861('0x26')](function(_0x14ab9a){_0x5e952e[_0xe861('0x1f')]=_0x14ab9a;if(_0x2af0b0['query'][_0xe861('0x41')]){_0x1b4b73[_0xe861('0x42')]=[{'all':!![]}];}return db[_0xe861('0x2c')][_0xe861('0x43')](_0x1b4b73);})['then'](function(_0x47fc83){_0x5e952e[_0xe861('0x44')]=_0x47fc83;return _0x5e952e;})[_0xe861('0x26')](respondWithFilteredResult(_0x45b5f1,_0x1b4b73))[_0xe861('0x45')](handleError(_0x45b5f1,null));};exports['show']=function(_0x42de01,_0x8ebbf7){var _0x81166={'raw':!![],'where':{'id':_0x42de01['params']['id']}},_0xcd5356={};_0xcd5356['model']=_[_0xe861('0x34')](db[_0xe861('0x2c')][_0xe861('0x46')]);_0xcd5356[_0xe861('0x33')]=_[_0xe861('0x34')](_0x42de01[_0xe861('0x33')]);_0xcd5356[_0xe861('0x35')]=_[_0xe861('0x36')](_0xcd5356['model'],_0xcd5356[_0xe861('0x33')]);_0x81166[_0xe861('0x37')]=_[_0xe861('0x36')](_0xcd5356['model'],qs[_0xe861('0x38')](_0x42de01[_0xe861('0x33')][_0xe861('0x38')]));_0x81166['attributes']=_0x81166['attributes'][_0xe861('0x47')]?_0x81166[_0xe861('0x37')]:_0xcd5356[_0xe861('0x30')];if(_0x42de01[_0xe861('0x33')]['includeAll']){_0x81166[_0xe861('0x42')]=[{'all':!![]}];}_0x81166=_[_0xe861('0x3f')]({},_0x81166,_0x42de01[_0xe861('0x40')]);return db[_0xe861('0x2c')][_0xe861('0x48')](_0x81166)[_0xe861('0x26')](handleEntityNotFound(_0x8ebbf7,null))['then'](respondWithResult(_0x8ebbf7,null))[_0xe861('0x45')](handleError(_0x8ebbf7,null));};exports['create']=function(_0x681a4e,_0x1d0a67){return db[_0xe861('0x2c')]['create'](_0x681a4e[_0xe861('0x49')],{})[_0xe861('0x26')](respondWithResult(_0x1d0a67,0xc9))[_0xe861('0x45')](handleError(_0x1d0a67,null));};exports[_0xe861('0x25')]=function(_0x240138,_0x2655a8){if(_0x240138['body']['id']){delete _0x240138['body']['id'];}return db['VoiceMailMessage'][_0xe861('0x48')]({'where':{'id':_0x240138[_0xe861('0x4a')]['id']}})[_0xe861('0x26')](handleEntityNotFound(_0x2655a8,null))[_0xe861('0x26')](saveUpdates(_0x240138[_0xe861('0x49')],null))['then'](respondWithResult(_0x2655a8,null))[_0xe861('0x45')](handleError(_0x2655a8,null));};exports[_0xe861('0x27')]=function(_0x498d88,_0x5cf6dc){return db[_0xe861('0x2c')][_0xe861('0x48')]({'where':{'id':_0x498d88[_0xe861('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cf6dc,null))[_0xe861('0x26')](removeEntity(_0x5cf6dc,null))[_0xe861('0x45')](handleError(_0x5cf6dc,null));};exports[_0xe861('0x4b')]=function(_0x21bd3a,_0x118446,_0x1d3fab){return db[_0xe861('0x2c')][_0xe861('0x48')]({'where':{'id':_0x21bd3a[_0xe861('0x4a')]['id']},'attributes':['id',_0xe861('0x4c'),_0xe861('0x4d')]})['then'](handleEntityNotFound(_0x118446,null))[_0xe861('0x26')](function(_0x169a66){if(_0x169a66){if(!_0x169a66[_0xe861('0x4c')]){throw new db[(_0xe861('0x4e'))]['ValidationError'](_0xe861('0x4f'));}var _0x516a80={'Content-Type':'audio/wav','Content-Disposition':_0xe861('0x50')};if(_0x169a66[_0xe861('0x4d')]){_0x516a80[_0xe861('0x51')]='attachment;\x20filename=\x22'+_0x169a66[_0xe861('0x4d')]+_0xe861('0x52');}_0x118446['set'](_0x516a80);return _0x118446[_0xe861('0x53')](new Buffer(_0x169a66[_0xe861('0x4c')]));}})[_0xe861('0x45')](handleError(_0x118446,null));}; \ No newline at end of file +var _0xa649=['undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa649,0x95));var _0x9a64=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa649[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x9a64('0x0'));var rimraf=require(_0x9a64('0x1'));var zipdir=require(_0x9a64('0x2'));var jsonpatch=require(_0x9a64('0x3'));var rp=require(_0x9a64('0x4'));var moment=require(_0x9a64('0x5'));var BPromise=require(_0x9a64('0x6'));var Mustache=require(_0x9a64('0x7'));var util=require('util');var path=require(_0x9a64('0x8'));var sox=require(_0x9a64('0x9'));var csv=require('to-csv');var ejs=require(_0x9a64('0xa'));var fs=require('fs');var fs_extra=require(_0x9a64('0xb'));var _=require(_0x9a64('0xc'));var squel=require(_0x9a64('0xd'));var crypto=require(_0x9a64('0xe'));var jsforce=require(_0x9a64('0xf'));var deskjs=require(_0x9a64('0x10'));var toCsv=require(_0x9a64('0x11'));var querystring=require(_0x9a64('0x12'));var Papa=require('papaparse');var Redis=require(_0x9a64('0x13'));var authService=require(_0x9a64('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a64('0x15'));var logger=require(_0x9a64('0x16'))(_0x9a64('0x17'));var utils=require(_0x9a64('0x18'));var config=require(_0x9a64('0x19'));var licenseUtil=require(_0x9a64('0x1a'));var db=require(_0x9a64('0x1b'))['db'];function respondWithStatusCode(_0x861fc5,_0x57fb3f){_0x57fb3f=_0x57fb3f||0xcc;return function(_0x5ce9f9){if(_0x5ce9f9){return _0x861fc5[_0x9a64('0x1c')](_0x57fb3f);}return _0x861fc5[_0x9a64('0x1d')](_0x57fb3f)[_0x9a64('0x1e')]();};}function respondWithResult(_0x3a4fb0,_0x3cafa5){_0x3cafa5=_0x3cafa5||0xc8;return function(_0x3005f7){if(_0x3005f7){return _0x3a4fb0[_0x9a64('0x1d')](_0x3cafa5)[_0x9a64('0x1f')](_0x3005f7);}};}function respondWithFilteredResult(_0x27926f,_0x57fa65){return function(_0x4f0388){if(_0x4f0388){var _0x43cf01=typeof _0x57fa65[_0x9a64('0x20')]===_0x9a64('0x21')&&typeof _0x57fa65[_0x9a64('0x22')]===_0x9a64('0x21');var _0x4699a2=_0x4f0388[_0x9a64('0x23')];var _0x1cf4bf=_0x43cf01?0x0:_0x57fa65[_0x9a64('0x20')];var _0x1d9379=_0x43cf01?_0x4f0388[_0x9a64('0x23')]:_0x57fa65[_0x9a64('0x20')]+_0x57fa65['limit'];var _0x23817d;if(_0x1d9379>=_0x4699a2){_0x1d9379=_0x4699a2;_0x23817d=0xc8;}else{_0x23817d=0xce;}_0x27926f[_0x9a64('0x1d')](_0x23817d);return _0x27926f[_0x9a64('0x24')](_0x9a64('0x25'),_0x1cf4bf+'-'+_0x1d9379+'/'+_0x4699a2)['json'](_0x4f0388);}return null;};}function patchUpdates(_0x5bae29){return function(_0x5979f6){try{jsonpatch['apply'](_0x5979f6,_0x5bae29,!![]);}catch(_0x1548f1){return BPromise[_0x9a64('0x26')](_0x1548f1);}return _0x5979f6[_0x9a64('0x27')]();};}function saveUpdates(_0x5f3de7,_0x3f9c6b){return function(_0x5fa6f4){if(_0x5fa6f4){return _0x5fa6f4[_0x9a64('0x28')](_0x5f3de7)[_0x9a64('0x29')](function(_0x47379d){return _0x47379d;});}return null;};}function removeEntity(_0x3e9e73,_0xf80752){return function(_0x50fd52){if(_0x50fd52){return _0x50fd52[_0x9a64('0x2a')]()[_0x9a64('0x29')](function(){_0x3e9e73[_0x9a64('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3d22,_0x3b29e0){return function(_0x486fbc){if(!_0x486fbc){_0x1b3d22[_0x9a64('0x1c')](0x194);}return _0x486fbc;};}function handleError(_0x920efd,_0x447655){_0x447655=_0x447655||0x1f4;return function(_0x13cae2){logger[_0x9a64('0x2b')](_0x13cae2[_0x9a64('0x2c')]);if(_0x13cae2[_0x9a64('0x2d')]){delete _0x13cae2[_0x9a64('0x2d')];}_0x920efd[_0x9a64('0x1d')](_0x447655)[_0x9a64('0x2e')](_0x13cae2);};}exports[_0x9a64('0x2f')]=function(_0x53bab3,_0xdf72ab){var _0x11181d={},_0x3777a5={},_0x3811e5={'count':0x0,'rows':[]};var _0x26c0c1=_['map'](db[_0x9a64('0x30')][_0x9a64('0x31')],function(_0x234a0e){return{'name':_0x234a0e[_0x9a64('0x32')],'type':_0x234a0e[_0x9a64('0x33')][_0x9a64('0x34')]};});_0x3777a5[_0x9a64('0x35')]=_[_0x9a64('0x36')](_[_0x9a64('0x37')](_0x26c0c1,'name'),['name']);_0x3777a5['query']=_[_0x9a64('0x38')](_0x53bab3[_0x9a64('0x39')]);_0x3777a5[_0x9a64('0x3a')]=_[_0x9a64('0x3b')](_0x3777a5[_0x9a64('0x35')],_0x3777a5[_0x9a64('0x39')]);_0x11181d[_0x9a64('0x3c')]=_[_0x9a64('0x3b')](_0x3777a5[_0x9a64('0x35')],qs[_0x9a64('0x3d')](_0x53bab3[_0x9a64('0x39')][_0x9a64('0x3d')]));_0x11181d['attributes']=_0x11181d['attributes'][_0x9a64('0x3e')]?_0x11181d[_0x9a64('0x3c')]:_0x3777a5[_0x9a64('0x35')];if(!_0x53bab3['query'][_0x9a64('0x3f')](_0x9a64('0x40'))){_0x11181d[_0x9a64('0x22')]=qs[_0x9a64('0x22')](_0x53bab3['query'][_0x9a64('0x22')]);_0x11181d[_0x9a64('0x20')]=qs[_0x9a64('0x20')](_0x53bab3[_0x9a64('0x39')][_0x9a64('0x20')]);}_0x11181d[_0x9a64('0x41')]=qs['sort'](_0x53bab3[_0x9a64('0x39')][_0x9a64('0x42')]);_0x11181d[_0x9a64('0x43')]=qs[_0x9a64('0x3a')](_[_0x9a64('0x44')](_0x53bab3[_0x9a64('0x39')],_0x3777a5[_0x9a64('0x3a')]),_0x26c0c1);if(_0x53bab3[_0x9a64('0x39')][_0x9a64('0x45')]){_0x11181d[_0x9a64('0x43')]=_[_0x9a64('0x46')](_0x11181d['where'],{'$or':_[_0x9a64('0x37')](_0x26c0c1,function(_0x17582f){if(_0x17582f[_0x9a64('0x33')]!==_0x9a64('0x47')){var _0x33bd03={};_0x33bd03[_0x17582f[_0x9a64('0x2d')]]={'$like':'%'+_0x53bab3[_0x9a64('0x39')]['filter']+'%'};return _0x33bd03;}})});}_0x11181d=_[_0x9a64('0x46')]({},_0x11181d,_0x53bab3[_0x9a64('0x48')]);var _0x35ce98={'where':_0x11181d['where']};return db[_0x9a64('0x30')][_0x9a64('0x23')](_0x35ce98)['then'](function(_0x3334ab){_0x3811e5[_0x9a64('0x23')]=_0x3334ab;if(_0x53bab3[_0x9a64('0x39')][_0x9a64('0x49')]){_0x11181d[_0x9a64('0x4a')]=[{'all':!![]}];}return db[_0x9a64('0x30')]['findAll'](_0x11181d);})[_0x9a64('0x29')](function(_0xb1df12){_0x3811e5[_0x9a64('0x4b')]=_0xb1df12;return _0x3811e5;})['then'](respondWithFilteredResult(_0xdf72ab,_0x11181d))[_0x9a64('0x4c')](handleError(_0xdf72ab,null));};exports['show']=function(_0xa1ddec,_0x36f0e5){var _0x3e9feb={'raw':!![],'where':{'id':_0xa1ddec[_0x9a64('0x4d')]['id']}},_0x5c2516={};_0x5c2516['model']=_['keys'](db['VoiceMailMessage'][_0x9a64('0x31')]);_0x5c2516[_0x9a64('0x39')]=_[_0x9a64('0x38')](_0xa1ddec[_0x9a64('0x39')]);_0x5c2516[_0x9a64('0x3a')]=_[_0x9a64('0x3b')](_0x5c2516[_0x9a64('0x35')],_0x5c2516[_0x9a64('0x39')]);_0x3e9feb[_0x9a64('0x3c')]=_['intersection'](_0x5c2516[_0x9a64('0x35')],qs['fields'](_0xa1ddec[_0x9a64('0x39')][_0x9a64('0x3d')]));_0x3e9feb[_0x9a64('0x3c')]=_0x3e9feb[_0x9a64('0x3c')][_0x9a64('0x3e')]?_0x3e9feb[_0x9a64('0x3c')]:_0x5c2516[_0x9a64('0x35')];if(_0xa1ddec['query'][_0x9a64('0x49')]){_0x3e9feb['include']=[{'all':!![]}];}_0x3e9feb=_[_0x9a64('0x46')]({},_0x3e9feb,_0xa1ddec[_0x9a64('0x48')]);return db[_0x9a64('0x30')]['find'](_0x3e9feb)['then'](handleEntityNotFound(_0x36f0e5,null))[_0x9a64('0x29')](respondWithResult(_0x36f0e5,null))['catch'](handleError(_0x36f0e5,null));};exports[_0x9a64('0x4e')]=function(_0x5edf59,_0x2750cf){return db[_0x9a64('0x30')][_0x9a64('0x4e')](_0x5edf59['body'],{})[_0x9a64('0x29')](respondWithResult(_0x2750cf,0xc9))[_0x9a64('0x4c')](handleError(_0x2750cf,null));};exports['update']=function(_0x54e8c6,_0x340962){if(_0x54e8c6[_0x9a64('0x4f')]['id']){delete _0x54e8c6[_0x9a64('0x4f')]['id'];}return db['VoiceMailMessage'][_0x9a64('0x50')]({'where':{'id':_0x54e8c6[_0x9a64('0x4d')]['id']}})['then'](handleEntityNotFound(_0x340962,null))[_0x9a64('0x29')](saveUpdates(_0x54e8c6[_0x9a64('0x4f')],null))[_0x9a64('0x29')](respondWithResult(_0x340962,null))[_0x9a64('0x4c')](handleError(_0x340962,null));};exports[_0x9a64('0x2a')]=function(_0x2c771d,_0x127362){return db[_0x9a64('0x30')]['find']({'where':{'id':_0x2c771d['params']['id']}})['then'](handleEntityNotFound(_0x127362,null))[_0x9a64('0x29')](removeEntity(_0x127362,null))['catch'](handleError(_0x127362,null));};exports[_0x9a64('0x51')]=function(_0x446c23,_0x4f2987,_0x321e94){return db[_0x9a64('0x30')][_0x9a64('0x50')]({'where':{'id':_0x446c23['params']['id']},'attributes':['id',_0x9a64('0x52'),_0x9a64('0x53')]})['then'](handleEntityNotFound(_0x4f2987,null))['then'](function(_0x10c9a2){if(_0x10c9a2){if(!_0x10c9a2['recording']){throw new db[(_0x9a64('0x54'))][(_0x9a64('0x55'))](_0x9a64('0x56'));}var _0x474e1c={'Content-Type':_0x9a64('0x57'),'Content-Disposition':_0x9a64('0x58')};if(_0x10c9a2['msg_id']){_0x474e1c['Content-Disposition']=_0x9a64('0x59')+_0x10c9a2[_0x9a64('0x53')]+_0x9a64('0x5a');}_0x4f2987[_0x9a64('0x24')](_0x474e1c);return _0x4f2987[_0x9a64('0x2e')](new Buffer(_0x10c9a2[_0x9a64('0x52')]));}})[_0x9a64('0x4c')](handleError(_0x4f2987,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2aa54e5..2f4dbc9 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 _0xc627=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','dir','util'];(function(_0x89654c,_0x100d9a){var _0x2e689e=function(_0x4a5eb8){while(--_0x4a5eb8){_0x89654c['push'](_0x89654c['shift']());}};_0x2e689e(++_0x100d9a);}(_0xc627,0x1af));var _0x7c62=function(_0x5aea41,_0x5a72bf){_0x5aea41=_0x5aea41-0x0;var _0x12b4b5=_0xc627[_0x5aea41];return _0x12b4b5;};'use strict';var _=require('lodash');var util=require(_0x7c62('0x0'));var logger=require(_0x7c62('0x1'))(_0x7c62('0x2'));var moment=require('moment');var BPromise=require(_0x7c62('0x3'));var rp=require(_0x7c62('0x4'));var fs=require('fs');var path=require(_0x7c62('0x5'));var rimraf=require(_0x7c62('0x6'));var config=require(_0x7c62('0x7'));var attributes=require(_0x7c62('0x8'));module[_0x7c62('0x9')]=function(_0x51ef87,_0x89138e){return _0x51ef87[_0x7c62('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x7c62('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xac7f=['voice_voicemail_messages','dir','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define'];(function(_0x58a18a,_0x1d948a){var _0x504330=function(_0x2be3d2){while(--_0x2be3d2){_0x58a18a['push'](_0x58a18a['shift']());}};_0x504330(++_0x1d948a);}(_0xac7f,0x12e));var _0xfac7=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xac7f[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xfac7('0x0'));var util=require(_0xfac7('0x1'));var logger=require('../../config/logger')(_0xfac7('0x2'));var moment=require(_0xfac7('0x3'));var BPromise=require(_0xfac7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfac7('0x5'));var rimraf=require(_0xfac7('0x6'));var config=require(_0xfac7('0x7'));var attributes=require(_0xfac7('0x8'));module['exports']=function(_0x48be8f,_0x4d9971){return _0x48be8f[_0xfac7('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xfac7('0xa'),'paranoid':![],'indexes':[{'name':_0xfac7('0xb'),'fields':[_0xfac7('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index e519f83..e67d9cc 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 _0x4157=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x4157,0x1c0));var _0x7415=function(_0x1eb00c,_0x210ecc){_0x1eb00c=_0x1eb00c-0x0;var _0x5e0a49=_0x4157[_0x1eb00c];return _0x5e0a49;};'use strict';var _=require('lodash');var util=require(_0x7415('0x0'));var moment=require(_0x7415('0x1'));var BPromise=require(_0x7415('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7415('0x3'))['db'];var utils=require(_0x7415('0x4'));var logger=require('../../config/logger')(_0x7415('0x5'));var config=require(_0x7415('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7415('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5456f8,_0x50d735,_0x3d5cd){return new BPromise(function(_0x470060,_0x33c216){return client[_0x7415('0x8')](_0x5456f8,_0x3d5cd)[_0x7415('0x9')](function(_0x1153b4){logger[_0x7415('0xa')](_0x7415('0xb'),_0x50d735,_0x7415('0xc'));logger[_0x7415('0xd')](_0x7415('0xe'),_0x50d735,_0x7415('0xc'),JSON[_0x7415('0xf')](_0x1153b4));if(_0x1153b4['error']){if(_0x1153b4[_0x7415('0x10')][_0x7415('0x11')]===0x1f4){logger[_0x7415('0x10')](_0x7415('0xb'),_0x50d735,_0x1153b4[_0x7415('0x10')][_0x7415('0x12')]);return _0x33c216(_0x1153b4[_0x7415('0x10')][_0x7415('0x12')]);}logger['error'](_0x7415('0xb'),_0x50d735,_0x1153b4['error']['message']);return _0x470060(_0x1153b4[_0x7415('0x10')][_0x7415('0x12')]);}else{logger[_0x7415('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x50d735,_0x7415('0xc'));_0x470060(_0x1153b4[_0x7415('0x13')][_0x7415('0x12')]);}})[_0x7415('0x14')](function(_0x2908d8){logger[_0x7415('0x10')](_0x7415('0xb'),_0x50d735,_0x2908d8);_0x33c216(_0x2908d8);});});} \ No newline at end of file +var _0x6916=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6916,0x16e));var _0x6691=function(_0x216973,_0x5c3a3a){_0x216973=_0x216973-0x0;var _0x911f42=_0x6916[_0x216973];return _0x911f42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6691('0x0'));var BPromise=require(_0x6691('0x1'));var rs=require(_0x6691('0x2'));var fs=require('fs');var Redis=require(_0x6691('0x3'));var db=require(_0x6691('0x4'))['db'];var utils=require(_0x6691('0x5'));var logger=require(_0x6691('0x6'))(_0x6691('0x7'));var config=require(_0x6691('0x8'));var jayson=require(_0x6691('0x9'));var client=jayson[_0x6691('0xa')][_0x6691('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b8f9b,_0xdb5c1,_0x37ec41){return new BPromise(function(_0x320631,_0x4526ed){return client[_0x6691('0xc')](_0x4b8f9b,_0x37ec41)[_0x6691('0xd')](function(_0x261e45){logger[_0x6691('0xe')](_0x6691('0xf'),_0xdb5c1,_0x6691('0x10'));logger[_0x6691('0x11')](_0x6691('0x12'),_0xdb5c1,_0x6691('0x10'),JSON[_0x6691('0x13')](_0x261e45));if(_0x261e45[_0x6691('0x14')]){if(_0x261e45[_0x6691('0x14')]['code']===0x1f4){logger[_0x6691('0x14')](_0x6691('0xf'),_0xdb5c1,_0x261e45['error'][_0x6691('0x15')]);return _0x4526ed(_0x261e45[_0x6691('0x14')][_0x6691('0x15')]);}logger[_0x6691('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xdb5c1,_0x261e45[_0x6691('0x14')][_0x6691('0x15')]);return _0x320631(_0x261e45[_0x6691('0x14')][_0x6691('0x15')]);}else{logger['info'](_0x6691('0xf'),_0xdb5c1,_0x6691('0x10'));_0x320631(_0x261e45[_0x6691('0x16')]['message']);}})['catch'](function(_0x15d268){logger[_0x6691('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xdb5c1,_0x15d268);_0x4526ed(_0x15d268);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7a87525..34d0a29 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 _0xc7c6=['./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','Router','fs-extra','../../config/environment'];(function(_0x935478,_0x7f6768){var _0x3972d9=function(_0x176d5d){while(--_0x176d5d){_0x935478['push'](_0x935478['shift']());}};_0x3972d9(++_0x7f6768);}(_0xc7c6,0xed));var _0x6c7c=function(_0x3405ae,_0x4a92db){_0x3405ae=_0x3405ae-0x0;var _0x756295=_0xc7c6[_0x3405ae];return _0x756295;};'use strict';var multer=require(_0x6c7c('0x0'));var util=require(_0x6c7c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c7c('0x2')]();var fs_extra=require(_0x6c7c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c7c('0x4'));var controller=require(_0x6c7c('0x5'));router[_0x6c7c('0x6')]('/',auth[_0x6c7c('0x7')](),controller[_0x6c7c('0x8')]);router['get'](_0x6c7c('0x9'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0xa')]);router[_0x6c7c('0x6')](_0x6c7c('0xb'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0xc')]);router[_0x6c7c('0xd')]('/',auth[_0x6c7c('0x7')](),controller['create']);router['post'](_0x6c7c('0xb'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0xe')]);router[_0x6c7c('0xf')](_0x6c7c('0x9'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0x10')]);router['delete'](_0x6c7c('0x9'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0x11')]);router[_0x6c7c('0x12')](_0x6c7c('0x13'),auth[_0x6c7c('0x7')](),controller[_0x6c7c('0x14')]);module[_0x6c7c('0x15')]=router; \ No newline at end of file +var _0xe633=['show','/:id/sounds','getSounds','create','post','addSound','put','/:id','update','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','isAuthenticated'];(function(_0x91ddd,_0x3629cf){var _0x134ec9=function(_0x2dcdc8){while(--_0x2dcdc8){_0x91ddd['push'](_0x91ddd['shift']());}};_0x134ec9(++_0x3629cf);}(_0xe633,0x1e0));var _0x3e63=function(_0x54767d,_0x37cab7){_0x54767d=_0x54767d-0x0;var _0x22f8d7=_0xe633[_0x54767d];return _0x22f8d7;};'use strict';var multer=require(_0x3e63('0x0'));var util=require(_0x3e63('0x1'));var path=require(_0x3e63('0x2'));var timeout=require(_0x3e63('0x3'));var express=require(_0x3e63('0x4'));var router=express[_0x3e63('0x5')]();var fs_extra=require(_0x3e63('0x6'));var auth=require(_0x3e63('0x7'));var interaction=require(_0x3e63('0x8'));var config=require(_0x3e63('0x9'));var controller=require(_0x3e63('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e63('0xb')]);router[_0x3e63('0xc')]('/:id',auth[_0x3e63('0xd')](),controller[_0x3e63('0xe')]);router[_0x3e63('0xc')](_0x3e63('0xf'),auth[_0x3e63('0xd')](),controller[_0x3e63('0x10')]);router['post']('/',auth[_0x3e63('0xd')](),controller[_0x3e63('0x11')]);router[_0x3e63('0x12')]('/:id/sounds',auth[_0x3e63('0xd')](),controller[_0x3e63('0x13')]);router[_0x3e63('0x14')](_0x3e63('0x15'),auth[_0x3e63('0xd')](),controller[_0x3e63('0x16')]);router[_0x3e63('0x17')](_0x3e63('0x15'),auth['isAuthenticated'](),controller['destroy']);router[_0x3e63('0x17')](_0x3e63('0x18'),auth['isAuthenticated'](),controller[_0x3e63('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c8d7788..ad7e60d 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 _0x4cba=['files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x4cba,0x1c2));var _0xa4cb=function(_0x3e8e56,_0x307fa6){_0x3e8e56=_0x3e8e56-0x0;var _0x39ce34=_0x4cba[_0x3e8e56];return _0x39ce34;};'use strict';var Sequelize=require(_0xa4cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xa4cb('0x1')],'allowNull':![],'unique':_0xa4cb('0x2')},'mode':{'type':Sequelize[_0xa4cb('0x3')](_0xa4cb('0x4'),_0xa4cb('0x5'),_0xa4cb('0x6'),_0xa4cb('0x7'),_0xa4cb('0x8'),_0xa4cb('0x9')),'allowNull':!![],'defaultValue':_0xa4cb('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa4cb('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa4cb('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa4cb('0x1')],'allowNull':!![],'defaultValue':_0xa4cb('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xa4cb('0xb')},'defaultEntry':{'type':Sequelize[_0xa4cb('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa5c1=['quietmp3','mp3','alpha','TIMESTAMP','exports','STRING','name','ENUM','custom','files'];(function(_0x4c60f5,_0x2cf853){var _0x2e158a=function(_0x190f2f){while(--_0x190f2f){_0x4c60f5['push'](_0x4c60f5['shift']());}};_0x2e158a(++_0x2cf853);}(_0xa5c1,0x86));var _0x1a5c=function(_0x36b469,_0x59be55){_0x36b469=_0x36b469-0x0;var _0xea9354=_0xa5c1[_0x36b469];return _0xea9354;};'use strict';var Sequelize=require('sequelize');module[_0x1a5c('0x0')]={'name':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':![],'unique':_0x1a5c('0x2')},'mode':{'type':Sequelize[_0x1a5c('0x3')](_0x1a5c('0x4'),_0x1a5c('0x5'),'mp3nb','quietmp3nb',_0x1a5c('0x6'),_0x1a5c('0x7')),'allowNull':!![],'defaultValue':_0x1a5c('0x5')},'directory':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':!![],'defaultValue':_0x1a5c('0x8')},'format':{'type':Sequelize[_0x1a5c('0x1')],'allowNull':!![]},'stamp':{'type':_0x1a5c('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 82e2d3b..34a5415 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 _0x02e4=['type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','catch','body','find','create','sequelize','mode','files','root','server/files/moh','mkdirSync','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','rmdirSync','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','server/files/sounds/converted','basename','format','%s.%s','symlinkSync','ValidationError','removeSound','id2','Sequelize','getSounds','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','end','name','map','VoiceMusicOnHold','rawAttributes','fieldName'];(function(_0x3bec81,_0x4e1562){var _0x2d1336=function(_0x11f682){while(--_0x11f682){_0x3bec81['push'](_0x3bec81['shift']());}};_0x2d1336(++_0x4e1562);}(_0x02e4,0xb8));var _0x402e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x02e4[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x402e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x402e('0x1'));var jsonpatch=require(_0x402e('0x2'));var rp=require('request-promise');var moment=require(_0x402e('0x3'));var BPromise=require(_0x402e('0x4'));var Mustache=require('mustache');var util=require(_0x402e('0x5'));var path=require('path');var sox=require(_0x402e('0x6'));var csv=require(_0x402e('0x7'));var ejs=require(_0x402e('0x8'));var fs=require('fs');var fs_extra=require(_0x402e('0x9'));var _=require(_0x402e('0xa'));var squel=require(_0x402e('0xb'));var crypto=require(_0x402e('0xc'));var jsforce=require(_0x402e('0xd'));var deskjs=require(_0x402e('0xe'));var toCsv=require(_0x402e('0x7'));var querystring=require(_0x402e('0xf'));var Papa=require(_0x402e('0x10'));var Redis=require(_0x402e('0x11'));var authService=require(_0x402e('0x12'));var qs=require(_0x402e('0x13'));var as=require(_0x402e('0x14'));var hardwareService=require(_0x402e('0x15'));var logger=require(_0x402e('0x16'))('api');var utils=require(_0x402e('0x17'));var config=require(_0x402e('0x18'));var licenseUtil=require(_0x402e('0x19'));var db=require(_0x402e('0x1a'))['db'];function respondWithStatusCode(_0xc706ae,_0x3721a9){_0x3721a9=_0x3721a9||0xcc;return function(_0x30196e){if(_0x30196e){return _0xc706ae[_0x402e('0x1b')](_0x3721a9);}return _0xc706ae[_0x402e('0x1c')](_0x3721a9)['end']();};}function respondWithResult(_0x598361,_0x5384b6){_0x5384b6=_0x5384b6||0xc8;return function(_0x49e910){if(_0x49e910){return _0x598361[_0x402e('0x1c')](_0x5384b6)[_0x402e('0x1d')](_0x49e910);}};}function respondWithFilteredResult(_0x31c011,_0x43fca5){return function(_0x2cd074){if(_0x2cd074){var _0x44cb3f=typeof _0x43fca5[_0x402e('0x1e')]==='undefined'&&typeof _0x43fca5['limit']==='undefined';var _0x395725=_0x2cd074[_0x402e('0x1f')];var _0x5e586c=_0x44cb3f?0x0:_0x43fca5[_0x402e('0x1e')];var _0x2762e5=_0x44cb3f?_0x2cd074[_0x402e('0x1f')]:_0x43fca5[_0x402e('0x1e')]+_0x43fca5[_0x402e('0x20')];var _0x5575b2;if(_0x2762e5>=_0x395725){_0x2762e5=_0x395725;_0x5575b2=0xc8;}else{_0x5575b2=0xce;}_0x31c011[_0x402e('0x1c')](_0x5575b2);return _0x31c011[_0x402e('0x21')](_0x402e('0x22'),_0x5e586c+'-'+_0x2762e5+'/'+_0x395725)['json'](_0x2cd074);}return null;};}function patchUpdates(_0x21cbd0){return function(_0x3b93d9){try{jsonpatch[_0x402e('0x23')](_0x3b93d9,_0x21cbd0,!![]);}catch(_0x420843){return BPromise[_0x402e('0x24')](_0x420843);}return _0x3b93d9[_0x402e('0x25')]();};}function saveUpdates(_0x49adfa,_0x5bb2cf){return function(_0x4d8f2a){if(_0x4d8f2a){return _0x4d8f2a[_0x402e('0x26')](_0x49adfa)[_0x402e('0x27')](function(_0x41cc50){return _0x41cc50;});}return null;};}function removeEntity(_0x4fc780,_0x3886db){return function(_0x5105cb){if(_0x5105cb){return _0x5105cb['destroy']()[_0x402e('0x27')](function(){var _0x2770b9=_0x5105cb[_0x402e('0x28')]({'plain':!![]});var _0x28560e='MusicOnHolds';return db['UserProfileResource'][_0x402e('0x29')]({'where':{'type':_0x28560e,'resourceId':_0x2770b9['id']}})[_0x402e('0x27')](function(){return _0x5105cb;});})[_0x402e('0x27')](function(){_0x4fc780['status'](0xcc)[_0x402e('0x2a')]();});}};}function handleEntityNotFound(_0x33bfb3,_0x5c2751){return function(_0x384213){if(!_0x384213){_0x33bfb3[_0x402e('0x1b')](0x194);}return _0x384213;};}function handleError(_0x462fba,_0x241c2f){_0x241c2f=_0x241c2f||0x1f4;return function(_0x99ebeb){logger['error'](_0x99ebeb['stack']);if(_0x99ebeb[_0x402e('0x2b')]){delete _0x99ebeb[_0x402e('0x2b')];}_0x462fba['status'](_0x241c2f)['send'](_0x99ebeb);};}exports['index']=function(_0x3eb7fa,_0x5cb41d){var _0x35f62a={},_0x58ad99={},_0x367fc5={'count':0x0,'rows':[]};var _0x4ff388=_[_0x402e('0x2c')](db[_0x402e('0x2d')][_0x402e('0x2e')],function(_0x873b84){return{'name':_0x873b84[_0x402e('0x2f')],'type':_0x873b84[_0x402e('0x30')][_0x402e('0x31')]};});_0x58ad99['model']=_[_0x402e('0x2c')](_0x4ff388,_0x402e('0x2b'));_0x58ad99['query']=_[_0x402e('0x32')](_0x3eb7fa[_0x402e('0x33')]);_0x58ad99[_0x402e('0x34')]=_[_0x402e('0x35')](_0x58ad99['model'],_0x58ad99[_0x402e('0x33')]);_0x35f62a[_0x402e('0x36')]=_[_0x402e('0x35')](_0x58ad99[_0x402e('0x37')],qs[_0x402e('0x38')](_0x3eb7fa[_0x402e('0x33')][_0x402e('0x38')]));_0x35f62a[_0x402e('0x36')]=_0x35f62a['attributes'][_0x402e('0x39')]?_0x35f62a[_0x402e('0x36')]:_0x58ad99[_0x402e('0x37')];if(!_0x3eb7fa[_0x402e('0x33')][_0x402e('0x3a')]('nolimit')){_0x35f62a[_0x402e('0x20')]=qs[_0x402e('0x20')](_0x3eb7fa[_0x402e('0x33')]['limit']);_0x35f62a[_0x402e('0x1e')]=qs['offset'](_0x3eb7fa[_0x402e('0x33')][_0x402e('0x1e')]);}_0x35f62a['order']=qs[_0x402e('0x3b')](_0x3eb7fa[_0x402e('0x33')]['sort']);delete _0x3eb7fa[_0x402e('0x33')][_0x402e('0x3b')];_0x35f62a['where']=qs[_0x402e('0x34')](_[_0x402e('0x3c')](_0x3eb7fa[_0x402e('0x33')],_0x58ad99[_0x402e('0x34')]),_0x4ff388);if(_0x3eb7fa[_0x402e('0x33')][_0x402e('0x3d')]){_0x35f62a['where']=_['merge'](_0x35f62a[_0x402e('0x3e')],{'$or':_[_0x402e('0x2c')](_0x4ff388,function(_0x37f839){if(_0x37f839[_0x402e('0x30')]!==_0x402e('0x3f')){var _0x2ee826={};_0x2ee826[_0x37f839[_0x402e('0x2b')]]={'$like':'%'+_0x3eb7fa[_0x402e('0x33')][_0x402e('0x3d')]+'%'};return _0x2ee826;}})});}_0x35f62a=_[_0x402e('0x40')]({},_0x35f62a,_0x3eb7fa[_0x402e('0x41')]);var _0x45beea={'where':_0x35f62a['where']};return db['VoiceMusicOnHold'][_0x402e('0x1f')](_0x45beea)[_0x402e('0x27')](function(_0x26cfd0){_0x367fc5[_0x402e('0x1f')]=_0x26cfd0;if(_0x3eb7fa[_0x402e('0x33')]['includeAll']){_0x35f62a[_0x402e('0x42')]=[{'all':!![]}];}return db[_0x402e('0x2d')][_0x402e('0x43')](_0x35f62a);})[_0x402e('0x27')](function(_0x1fe342){_0x367fc5[_0x402e('0x44')]=_0x1fe342;return _0x367fc5;})[_0x402e('0x27')](respondWithFilteredResult(_0x5cb41d,_0x35f62a))['catch'](handleError(_0x5cb41d,null));};exports[_0x402e('0x45')]=function(_0x11dddc,_0x25b438){var _0x2f5b97={'raw':![],'where':{'id':_0x11dddc[_0x402e('0x46')]['id']}},_0x6d45b6={};_0x6d45b6['model']=_[_0x402e('0x32')](db[_0x402e('0x2d')][_0x402e('0x2e')]);_0x6d45b6['query']=_['keys'](_0x11dddc[_0x402e('0x33')]);_0x6d45b6['filters']=_[_0x402e('0x35')](_0x6d45b6[_0x402e('0x37')],_0x6d45b6[_0x402e('0x33')]);_0x2f5b97[_0x402e('0x36')]=_[_0x402e('0x35')](_0x6d45b6[_0x402e('0x37')],qs['fields'](_0x11dddc[_0x402e('0x33')][_0x402e('0x38')]));_0x2f5b97[_0x402e('0x36')]=_0x2f5b97[_0x402e('0x36')][_0x402e('0x39')]?_0x2f5b97[_0x402e('0x36')]:_0x6d45b6[_0x402e('0x37')];if(_0x11dddc[_0x402e('0x33')][_0x402e('0x47')]){_0x2f5b97[_0x402e('0x42')]=[{'all':!![]}];}_0x2f5b97=_[_0x402e('0x40')]({},_0x2f5b97,_0x11dddc[_0x402e('0x41')]);return db[_0x402e('0x2d')]['find'](_0x2f5b97)[_0x402e('0x27')](handleEntityNotFound(_0x25b438,null))[_0x402e('0x27')](respondWithResult(_0x25b438,null))[_0x402e('0x48')](handleError(_0x25b438,null));};exports['update']=function(_0x401411,_0x7f4f1c){if(_0x401411['body']['id']){delete _0x401411[_0x402e('0x49')]['id'];}return db[_0x402e('0x2d')][_0x402e('0x4a')]({'where':{'id':_0x401411[_0x402e('0x46')]['id']}})[_0x402e('0x27')](handleEntityNotFound(_0x7f4f1c,null))[_0x402e('0x27')](saveUpdates(_0x401411[_0x402e('0x49')],null))[_0x402e('0x27')](respondWithResult(_0x7f4f1c,null))['catch'](handleError(_0x7f4f1c,null));};exports[_0x402e('0x4b')]=function(_0x4f1c96,_0x533bc6,_0x1791e5){return db[_0x402e('0x4c')]['transaction'](function(_0x27f201){if(_0x4f1c96['body'][_0x402e('0x4d')]===_0x402e('0x4e')){_0x4f1c96[_0x402e('0x49')]['directory']=path['join'](config[_0x402e('0x4f')],_0x402e('0x50'),_0x4f1c96[_0x402e('0x49')][_0x402e('0x2b')]);}return db[_0x402e('0x2d')]['create'](_0x4f1c96[_0x402e('0x49')],{'transaction':_0x27f201})[_0x402e('0x27')](function(_0xb10e84){if(_0x4f1c96[_0x402e('0x49')]['mode']==='files'){fs[_0x402e('0x51')](_0xb10e84[_0x402e('0x52')],parseInt(_0x402e('0x53'),0x8));}var _0x119d80=_0x4f1c96['user'][_0x402e('0x28')]({'plain':!![]});if(!_0x119d80)throw new Error(_0x402e('0x54'));if(_0x119d80[_0x402e('0x55')]===_0x402e('0x56')){var _0x4d431b=_0xb10e84['get']({'plain':!![]});return db[_0x402e('0x57')]['find']({'where':{'name':_0x402e('0x58'),'userProfileId':_0x119d80[_0x402e('0x59')]},'raw':!![]})['then'](function(_0x37140e){if(_0x37140e&&_0x37140e[_0x402e('0x5a')]===0x0){return db[_0x402e('0x5b')]['create']({'name':_0x4d431b['name'],'resourceId':_0x4d431b['id'],'type':_0x37140e[_0x402e('0x2b')],'sectionId':_0x37140e['id']},{})['then'](function(){return _0xb10e84;});}else{return _0xb10e84;}})[_0x402e('0x48')](function(_0x110521){logger['error'](_0x402e('0x5c'),_0x110521);});}return _0xb10e84;});})[_0x402e('0x27')](respondWithResult(_0x533bc6,0xc9))[_0x402e('0x48')](handleError(_0x533bc6,null));};exports[_0x402e('0x29')]=function(_0x3cc531,_0x43233f,_0x597f15){var _0x352505;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3cc531['params']['id']}})[_0x402e('0x27')](function(_0x49ec2b){if(_0x49ec2b){return db[_0x402e('0x4c')][_0x402e('0x5d')](function(_0x495dc7){return _0x49ec2b['destroy']({'transaction':_0x495dc7,'raw':!![]})[_0x402e('0x27')](function(_0x25a178){if(_0x25a178[_0x402e('0x52')]){fs['readdirSync'](_0x25a178[_0x402e('0x52')])[_0x402e('0x5e')](function(_0x34da29){fs[_0x402e('0x5f')](path['join'](_0x25a178['directory'],_0x34da29));});fs[_0x402e('0x60')](_0x25a178[_0x402e('0x52')]);}return _0x25a178;});})[_0x402e('0x48')](function(_0x30fc69){throw new db['Sequelize']['ValidationError'](_0x30fc69[_0x402e('0x61')]);});}})[_0x402e('0x27')](handleEntityNotFound(_0x43233f,null))[_0x402e('0x27')](removeEntity(_0x43233f,null))[_0x402e('0x48')](handleError(_0x43233f,null));};exports[_0x402e('0x62')]=function(_0x9e48c2,_0x91b86,_0x38afa7){return db[_0x402e('0x4c')]['transaction'](function(_0x132f1b){var _0x4f4d17;return db[_0x402e('0x2d')][_0x402e('0x4a')]({'where':{'id':_0x9e48c2[_0x402e('0x46')]['id']}})[_0x402e('0x27')](function(_0x487e90){if(_0x487e90){_0x4f4d17=_0x487e90;return _0x487e90[_0x402e('0x62')](_0x9e48c2[_0x402e('0x49')]['id'],{'transaction':_0x132f1b});}})[_0x402e('0x27')](function(_0x997f2e){if(_0x997f2e){return db[_0x402e('0x63')][_0x402e('0x64')]({'where':{'id':_0x9e48c2[_0x402e('0x49')]['id']},'attributes':['id',_0x402e('0x2b'),_0x402e('0x65'),_0x402e('0x66'),_0x402e('0x67')],'raw':!![]});}})[_0x402e('0x27')](function(_0x4eec82){if(_0x4eec82){var _0x19fc40=path[_0x402e('0x68')](config[_0x402e('0x4f')],_0x402e('0x69'),util['format']('%s.%s',path[_0x402e('0x6a')](_0x4eec82[_0x402e('0x65')],path['extname'](_0x4eec82['save_name'])),_0x4eec82[_0x402e('0x66')]));var _0x4a7178=path[_0x402e('0x68')](config[_0x402e('0x4f')],_0x402e('0x50'),_0x4f4d17[_0x402e('0x2b')],util[_0x402e('0x6b')](_0x402e('0x6c'),_0x4eec82[_0x402e('0x2b')],_0x4eec82[_0x402e('0x66')]));fs[_0x402e('0x6d')](_0x19fc40,_0x4a7178);return _0x4eec82;}})[_0x402e('0x48')](function(_0x2795f5){throw new db['Sequelize'][(_0x402e('0x6e'))](_0x2795f5['message']);});})[_0x402e('0x27')](handleEntityNotFound(_0x91b86,null))[_0x402e('0x27')](respondWithResult(_0x91b86,0xc9))[_0x402e('0x48')](handleError(_0x91b86,null));};exports[_0x402e('0x6f')]=function(_0x1dd805,_0x5521e2,_0x107829){return db['sequelize']['transaction'](function(_0x7cb2d8){var _0x5634e8;return db[_0x402e('0x2d')][_0x402e('0x64')]({'where':{'id':_0x1dd805[_0x402e('0x46')]['id']}})['then'](handleEntityNotFound(_0x5521e2,null))[_0x402e('0x27')](function(_0x2fc454){if(_0x2fc454){_0x5634e8=_0x2fc454;return _0x2fc454[_0x402e('0x6f')](_0x1dd805[_0x402e('0x46')][_0x402e('0x70')]);}})[_0x402e('0x27')](function(_0x5382e9){if(_0x5382e9){return db[_0x402e('0x63')][_0x402e('0x64')]({'where':{'id':_0x1dd805[_0x402e('0x46')][_0x402e('0x70')]},'attributes':['id',_0x402e('0x2b'),_0x402e('0x65'),_0x402e('0x66'),_0x402e('0x67')],'raw':!![]});}})[_0x402e('0x27')](function(_0x1f97ef){if(_0x1f97ef){fs['unlinkSync'](path[_0x402e('0x68')](_0x5634e8[_0x402e('0x52')],util['format']('%s.%s',_0x1f97ef[_0x402e('0x2b')],_0x1f97ef[_0x402e('0x66')])));return _0x1f97ef;}})[_0x402e('0x48')](function(_0x120068){throw new db[(_0x402e('0x71'))][(_0x402e('0x6e'))](_0x120068[_0x402e('0x61')]);});})['then'](handleEntityNotFound(_0x5521e2,null))['then'](respondWithStatusCode(_0x5521e2,0xcc))[_0x402e('0x48')](handleError(_0x5521e2,null));};exports[_0x402e('0x72')]=function(_0x22686f,_0x21fc54,_0x2cc637){var _0x38817c={};var _0x4d7c18={};var _0x4b29ac;var _0x21a948;return db[_0x402e('0x2d')]['findOne']({'where':{'id':_0x22686f[_0x402e('0x46')]['id']}})[_0x402e('0x27')](handleEntityNotFound(_0x21fc54,null))[_0x402e('0x27')](function(_0x10a86c){if(_0x10a86c){_0x4b29ac=_0x10a86c;_0x4d7c18[_0x402e('0x37')]=_[_0x402e('0x32')](db[_0x402e('0x63')]['rawAttributes']);_0x4d7c18[_0x402e('0x33')]=_[_0x402e('0x32')](_0x22686f[_0x402e('0x33')]);_0x4d7c18[_0x402e('0x34')]=_[_0x402e('0x35')](_0x4d7c18[_0x402e('0x37')],_0x4d7c18['query']);_0x38817c[_0x402e('0x36')]=_[_0x402e('0x35')](_0x4d7c18[_0x402e('0x37')],qs[_0x402e('0x38')](_0x22686f['query'][_0x402e('0x38')]));_0x38817c[_0x402e('0x36')]=_0x38817c[_0x402e('0x36')][_0x402e('0x39')]?_0x38817c[_0x402e('0x36')]:_0x4d7c18[_0x402e('0x37')];_0x38817c['order']=qs[_0x402e('0x3b')](_0x22686f['query'][_0x402e('0x3b')]);_0x38817c['where']=qs[_0x402e('0x34')](_[_0x402e('0x3c')](_0x22686f[_0x402e('0x33')],_0x4d7c18[_0x402e('0x34')]));if(_0x22686f[_0x402e('0x33')][_0x402e('0x3d')]){_0x38817c[_0x402e('0x3e')]=_['merge'](_0x38817c[_0x402e('0x3e')],{'$or':_[_0x402e('0x2c')](_0x38817c[_0x402e('0x36')],function(_0x25347f){var _0x4ee376={};_0x4ee376[_0x25347f]={'$like':'%'+_0x22686f[_0x402e('0x33')]['filter']+'%'};return _0x4ee376;})});}_0x38817c=_[_0x402e('0x40')]({},_0x38817c,_0x22686f['options']);return _0x4b29ac['getSounds'](_0x38817c);}})[_0x402e('0x27')](function(_0x6bb619){if(_0x6bb619){_0x21a948=_0x6bb619['length'];if(!_0x22686f[_0x402e('0x33')][_0x402e('0x3a')](_0x402e('0x73'))){_0x38817c[_0x402e('0x20')]=qs[_0x402e('0x20')](_0x22686f[_0x402e('0x33')][_0x402e('0x20')]);_0x38817c['offset']=qs[_0x402e('0x1e')](_0x22686f[_0x402e('0x33')][_0x402e('0x1e')]);}return _0x4b29ac['getSounds'](_0x38817c);}})['then'](function(_0x3cb26f){if(_0x3cb26f){return _0x3cb26f?{'count':_0x21a948,'rows':_0x3cb26f}:null;}})[_0x402e('0x27')](respondWithResult(_0x21fc54,null))[_0x402e('0x48')](handleError(_0x21fc54,null));}; \ No newline at end of file +var _0x90e1=['rows','catch','show','params','fields','find','body','create','sequelize','transaction','mode','join','root','mkdirSync','directory','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','ValidationError','message','addSound','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','save_name','server/files/moh','%s.%s','Sequelize','id2','getSounds','Sound','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','MusicOnHolds','then','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll'];(function(_0x32da6e,_0x5245ea){var _0xb4bc=function(_0x3fabc0){while(--_0x3fabc0){_0x32da6e['push'](_0x32da6e['shift']());}};_0xb4bc(++_0x5245ea);}(_0x90e1,0x1d5));var _0x190e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x90e1[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x190e('0x0'));var rimraf=require(_0x190e('0x1'));var zipdir=require(_0x190e('0x2'));var jsonpatch=require(_0x190e('0x3'));var rp=require(_0x190e('0x4'));var moment=require(_0x190e('0x5'));var BPromise=require(_0x190e('0x6'));var Mustache=require(_0x190e('0x7'));var util=require(_0x190e('0x8'));var path=require(_0x190e('0x9'));var sox=require('sox');var csv=require(_0x190e('0xa'));var ejs=require(_0x190e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x190e('0xc'));var squel=require('squel');var crypto=require(_0x190e('0xd'));var jsforce=require(_0x190e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x190e('0xa'));var querystring=require(_0x190e('0xf'));var Papa=require(_0x190e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x190e('0x11'));var as=require(_0x190e('0x12'));var hardwareService=require(_0x190e('0x13'));var logger=require(_0x190e('0x14'))(_0x190e('0x15'));var utils=require(_0x190e('0x16'));var config=require(_0x190e('0x17'));var licenseUtil=require(_0x190e('0x18'));var db=require(_0x190e('0x19'))['db'];function respondWithStatusCode(_0x182dc6,_0x3a5a30){_0x3a5a30=_0x3a5a30||0xcc;return function(_0x34aafd){if(_0x34aafd){return _0x182dc6[_0x190e('0x1a')](_0x3a5a30);}return _0x182dc6[_0x190e('0x1b')](_0x3a5a30)[_0x190e('0x1c')]();};}function respondWithResult(_0x207b58,_0x9b37d9){_0x9b37d9=_0x9b37d9||0xc8;return function(_0xaec0b6){if(_0xaec0b6){return _0x207b58[_0x190e('0x1b')](_0x9b37d9)[_0x190e('0x1d')](_0xaec0b6);}};}function respondWithFilteredResult(_0x1a6072,_0x9b64a5){return function(_0x4e7877){if(_0x4e7877){var _0x5765f7=typeof _0x9b64a5[_0x190e('0x1e')]==='undefined'&&typeof _0x9b64a5[_0x190e('0x1f')]===_0x190e('0x20');var _0x55db84=_0x4e7877[_0x190e('0x21')];var _0x5efda4=_0x5765f7?0x0:_0x9b64a5[_0x190e('0x1e')];var _0x4d6bf0=_0x5765f7?_0x4e7877[_0x190e('0x21')]:_0x9b64a5[_0x190e('0x1e')]+_0x9b64a5[_0x190e('0x1f')];var _0x2175cc;if(_0x4d6bf0>=_0x55db84){_0x4d6bf0=_0x55db84;_0x2175cc=0xc8;}else{_0x2175cc=0xce;}_0x1a6072[_0x190e('0x1b')](_0x2175cc);return _0x1a6072[_0x190e('0x22')](_0x190e('0x23'),_0x5efda4+'-'+_0x4d6bf0+'/'+_0x55db84)['json'](_0x4e7877);}return null;};}function patchUpdates(_0x4e838d){return function(_0x48ecb1){try{jsonpatch['apply'](_0x48ecb1,_0x4e838d,!![]);}catch(_0x3737cd){return BPromise['reject'](_0x3737cd);}return _0x48ecb1['save']();};}function saveUpdates(_0x5cbb7c,_0x11340b){return function(_0x570727){if(_0x570727){return _0x570727['update'](_0x5cbb7c)['then'](function(_0x210a2d){return _0x210a2d;});}return null;};}function removeEntity(_0x4b4276,_0x540bf1){return function(_0x41972f){if(_0x41972f){return _0x41972f[_0x190e('0x24')]()['then'](function(){var _0x128fe9=_0x41972f['get']({'plain':!![]});var _0x133ed8=_0x190e('0x25');return db['UserProfileResource'][_0x190e('0x24')]({'where':{'type':_0x133ed8,'resourceId':_0x128fe9['id']}})[_0x190e('0x26')](function(){return _0x41972f;});})[_0x190e('0x26')](function(){_0x4b4276[_0x190e('0x1b')](0xcc)[_0x190e('0x1c')]();});}};}function handleEntityNotFound(_0x47c147,_0x120b25){return function(_0x287da9){if(!_0x287da9){_0x47c147[_0x190e('0x1a')](0x194);}return _0x287da9;};}function handleError(_0x304493,_0x10b7b2){_0x10b7b2=_0x10b7b2||0x1f4;return function(_0x19e0ad){logger[_0x190e('0x27')](_0x19e0ad[_0x190e('0x28')]);if(_0x19e0ad[_0x190e('0x29')]){delete _0x19e0ad[_0x190e('0x29')];}_0x304493['status'](_0x10b7b2)['send'](_0x19e0ad);};}exports[_0x190e('0x2a')]=function(_0x2b922e,_0x4f12de){var _0x2b4862={},_0x4b1217={},_0x56b6d6={'count':0x0,'rows':[]};var _0x33b202=_[_0x190e('0x2b')](db[_0x190e('0x2c')][_0x190e('0x2d')],function(_0x549e2f){return{'name':_0x549e2f['fieldName'],'type':_0x549e2f['type']['key']};});_0x4b1217[_0x190e('0x2e')]=_['map'](_0x33b202,_0x190e('0x29'));_0x4b1217['query']=_[_0x190e('0x2f')](_0x2b922e[_0x190e('0x30')]);_0x4b1217[_0x190e('0x31')]=_[_0x190e('0x32')](_0x4b1217[_0x190e('0x2e')],_0x4b1217[_0x190e('0x30')]);_0x2b4862[_0x190e('0x33')]=_['intersection'](_0x4b1217[_0x190e('0x2e')],qs['fields'](_0x2b922e[_0x190e('0x30')]['fields']));_0x2b4862[_0x190e('0x33')]=_0x2b4862[_0x190e('0x33')][_0x190e('0x34')]?_0x2b4862[_0x190e('0x33')]:_0x4b1217[_0x190e('0x2e')];if(!_0x2b922e[_0x190e('0x30')][_0x190e('0x35')](_0x190e('0x36'))){_0x2b4862[_0x190e('0x1f')]=qs[_0x190e('0x1f')](_0x2b922e[_0x190e('0x30')][_0x190e('0x1f')]);_0x2b4862[_0x190e('0x1e')]=qs[_0x190e('0x1e')](_0x2b922e[_0x190e('0x30')]['offset']);}_0x2b4862[_0x190e('0x37')]=qs['sort'](_0x2b922e[_0x190e('0x30')]['sort']);delete _0x2b922e['query'][_0x190e('0x38')];_0x2b4862[_0x190e('0x39')]=qs['filters'](_[_0x190e('0x3a')](_0x2b922e[_0x190e('0x30')],_0x4b1217['filters']),_0x33b202);if(_0x2b922e[_0x190e('0x30')][_0x190e('0x3b')]){_0x2b4862['where']=_['merge'](_0x2b4862[_0x190e('0x39')],{'$or':_['map'](_0x33b202,function(_0x4f18ca){if(_0x4f18ca[_0x190e('0x3c')]!==_0x190e('0x3d')){var _0xc859d6={};_0xc859d6[_0x4f18ca[_0x190e('0x29')]]={'$like':'%'+_0x2b922e[_0x190e('0x30')]['filter']+'%'};return _0xc859d6;}})});}_0x2b4862=_[_0x190e('0x3e')]({},_0x2b4862,_0x2b922e['options']);var _0x3c01df={'where':_0x2b4862['where']};return db[_0x190e('0x2c')][_0x190e('0x21')](_0x3c01df)[_0x190e('0x26')](function(_0x770402){_0x56b6d6[_0x190e('0x21')]=_0x770402;if(_0x2b922e['query'][_0x190e('0x3f')]){_0x2b4862[_0x190e('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x190e('0x41')](_0x2b4862);})['then'](function(_0x19aaa9){_0x56b6d6[_0x190e('0x42')]=_0x19aaa9;return _0x56b6d6;})[_0x190e('0x26')](respondWithFilteredResult(_0x4f12de,_0x2b4862))[_0x190e('0x43')](handleError(_0x4f12de,null));};exports[_0x190e('0x44')]=function(_0x16850a,_0x1264b4){var _0x52f081={'raw':![],'where':{'id':_0x16850a[_0x190e('0x45')]['id']}},_0x18d1d6={};_0x18d1d6['model']=_[_0x190e('0x2f')](db['VoiceMusicOnHold'][_0x190e('0x2d')]);_0x18d1d6[_0x190e('0x30')]=_[_0x190e('0x2f')](_0x16850a[_0x190e('0x30')]);_0x18d1d6[_0x190e('0x31')]=_[_0x190e('0x32')](_0x18d1d6[_0x190e('0x2e')],_0x18d1d6[_0x190e('0x30')]);_0x52f081[_0x190e('0x33')]=_[_0x190e('0x32')](_0x18d1d6[_0x190e('0x2e')],qs[_0x190e('0x46')](_0x16850a['query'][_0x190e('0x46')]));_0x52f081['attributes']=_0x52f081['attributes'][_0x190e('0x34')]?_0x52f081[_0x190e('0x33')]:_0x18d1d6[_0x190e('0x2e')];if(_0x16850a['query'][_0x190e('0x3f')]){_0x52f081[_0x190e('0x40')]=[{'all':!![]}];}_0x52f081=_['merge']({},_0x52f081,_0x16850a['options']);return db[_0x190e('0x2c')][_0x190e('0x47')](_0x52f081)[_0x190e('0x26')](handleEntityNotFound(_0x1264b4,null))['then'](respondWithResult(_0x1264b4,null))[_0x190e('0x43')](handleError(_0x1264b4,null));};exports['update']=function(_0x396977,_0x33c69f){if(_0x396977[_0x190e('0x48')]['id']){delete _0x396977[_0x190e('0x48')]['id'];}return db[_0x190e('0x2c')]['find']({'where':{'id':_0x396977[_0x190e('0x45')]['id']}})[_0x190e('0x26')](handleEntityNotFound(_0x33c69f,null))[_0x190e('0x26')](saveUpdates(_0x396977[_0x190e('0x48')],null))[_0x190e('0x26')](respondWithResult(_0x33c69f,null))[_0x190e('0x43')](handleError(_0x33c69f,null));};exports[_0x190e('0x49')]=function(_0x7bcb6c,_0x19359e,_0x51802c){return db[_0x190e('0x4a')][_0x190e('0x4b')](function(_0x12afb7){if(_0x7bcb6c[_0x190e('0x48')][_0x190e('0x4c')]==='files'){_0x7bcb6c['body']['directory']=path[_0x190e('0x4d')](config[_0x190e('0x4e')],'server/files/moh',_0x7bcb6c[_0x190e('0x48')][_0x190e('0x29')]);}return db[_0x190e('0x2c')][_0x190e('0x49')](_0x7bcb6c[_0x190e('0x48')],{'transaction':_0x12afb7})['then'](function(_0x4e3962){if(_0x7bcb6c[_0x190e('0x48')]['mode']==='files'){fs[_0x190e('0x4f')](_0x4e3962[_0x190e('0x50')],parseInt('0777',0x8));}var _0x1c0498=_0x7bcb6c[_0x190e('0x51')][_0x190e('0x52')]({'plain':!![]});if(!_0x1c0498)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c0498['role']===_0x190e('0x51')){var _0x485213=_0x4e3962[_0x190e('0x52')]({'plain':!![]});return db[_0x190e('0x53')][_0x190e('0x47')]({'where':{'name':_0x190e('0x25'),'userProfileId':_0x1c0498['userProfileId']},'raw':!![]})[_0x190e('0x26')](function(_0x4fef05){if(_0x4fef05&&_0x4fef05[_0x190e('0x54')]===0x0){return db[_0x190e('0x55')][_0x190e('0x49')]({'name':_0x485213['name'],'resourceId':_0x485213['id'],'type':_0x4fef05[_0x190e('0x29')],'sectionId':_0x4fef05['id']},{})[_0x190e('0x26')](function(){return _0x4e3962;});}else{return _0x4e3962;}})[_0x190e('0x43')](function(_0x1f793e){logger['error'](_0x190e('0x56'),_0x1f793e);});}return _0x4e3962;});})[_0x190e('0x26')](respondWithResult(_0x19359e,0xc9))[_0x190e('0x43')](handleError(_0x19359e,null));};exports[_0x190e('0x24')]=function(_0x1a09c5,_0x28e229,_0x130046){var _0x2796c4;return db[_0x190e('0x2c')][_0x190e('0x47')]({'where':{'id':_0x1a09c5[_0x190e('0x45')]['id']}})[_0x190e('0x26')](function(_0x2ed9b3){if(_0x2ed9b3){return db[_0x190e('0x4a')][_0x190e('0x4b')](function(_0x3c2636){return _0x2ed9b3['destroy']({'transaction':_0x3c2636,'raw':!![]})[_0x190e('0x26')](function(_0x26b7a3){if(_0x26b7a3[_0x190e('0x50')]){fs['readdirSync'](_0x26b7a3[_0x190e('0x50')])['forEach'](function(_0x3d1aab){fs[_0x190e('0x57')](path['join'](_0x26b7a3[_0x190e('0x50')],_0x3d1aab));});fs[_0x190e('0x58')](_0x26b7a3[_0x190e('0x50')]);}return _0x26b7a3;});})['catch'](function(_0x45f502){throw new db['Sequelize'][(_0x190e('0x59'))](_0x45f502[_0x190e('0x5a')]);});}})['then'](handleEntityNotFound(_0x28e229,null))[_0x190e('0x26')](removeEntity(_0x28e229,null))[_0x190e('0x43')](handleError(_0x28e229,null));};exports[_0x190e('0x5b')]=function(_0x14ba02,_0x5af7bc,_0x24b231){return db[_0x190e('0x4a')]['transaction'](function(_0x4b51c2){var _0x152e09;return db[_0x190e('0x2c')]['find']({'where':{'id':_0x14ba02[_0x190e('0x45')]['id']}})[_0x190e('0x26')](function(_0x1ba9cb){if(_0x1ba9cb){_0x152e09=_0x1ba9cb;return _0x1ba9cb[_0x190e('0x5b')](_0x14ba02[_0x190e('0x48')]['id'],{'transaction':_0x4b51c2});}})[_0x190e('0x26')](function(_0x95d0ac){if(_0x95d0ac){return db['Sound'][_0x190e('0x5c')]({'where':{'id':_0x14ba02[_0x190e('0x48')]['id']},'attributes':['id','name','save_name',_0x190e('0x5d'),_0x190e('0x5e')],'raw':!![]});}})[_0x190e('0x26')](function(_0x2d504b){if(_0x2d504b){var _0x2ab030=path[_0x190e('0x4d')](config[_0x190e('0x4e')],_0x190e('0x5f'),util[_0x190e('0x60')]('%s.%s',path[_0x190e('0x61')](_0x2d504b['save_name'],path[_0x190e('0x62')](_0x2d504b[_0x190e('0x63')])),_0x2d504b[_0x190e('0x5d')]));var _0x24e482=path[_0x190e('0x4d')](config[_0x190e('0x4e')],_0x190e('0x64'),_0x152e09[_0x190e('0x29')],util[_0x190e('0x60')](_0x190e('0x65'),_0x2d504b[_0x190e('0x29')],_0x2d504b[_0x190e('0x5d')]));fs['symlinkSync'](_0x2ab030,_0x24e482);return _0x2d504b;}})[_0x190e('0x43')](function(_0x3f5be){throw new db[(_0x190e('0x66'))][(_0x190e('0x59'))](_0x3f5be[_0x190e('0x5a')]);});})[_0x190e('0x26')](handleEntityNotFound(_0x5af7bc,null))[_0x190e('0x26')](respondWithResult(_0x5af7bc,0xc9))[_0x190e('0x43')](handleError(_0x5af7bc,null));};exports['removeSound']=function(_0x1d7d5e,_0x5d5cb1,_0x5c3e19){return db[_0x190e('0x4a')][_0x190e('0x4b')](function(_0x658145){var _0x56765c;return db['VoiceMusicOnHold'][_0x190e('0x5c')]({'where':{'id':_0x1d7d5e[_0x190e('0x45')]['id']}})[_0x190e('0x26')](handleEntityNotFound(_0x5d5cb1,null))[_0x190e('0x26')](function(_0x2834c9){if(_0x2834c9){_0x56765c=_0x2834c9;return _0x2834c9['removeSound'](_0x1d7d5e['params'][_0x190e('0x67')]);}})['then'](function(_0xc2bff6){if(_0xc2bff6){return db['Sound'][_0x190e('0x5c')]({'where':{'id':_0x1d7d5e['params'][_0x190e('0x67')]},'attributes':['id',_0x190e('0x29'),'save_name',_0x190e('0x5d'),_0x190e('0x5e')],'raw':!![]});}})['then'](function(_0x31670f){if(_0x31670f){fs[_0x190e('0x57')](path[_0x190e('0x4d')](_0x56765c['directory'],util[_0x190e('0x60')](_0x190e('0x65'),_0x31670f[_0x190e('0x29')],_0x31670f[_0x190e('0x5d')])));return _0x31670f;}})[_0x190e('0x43')](function(_0x118402){throw new db[(_0x190e('0x66'))][(_0x190e('0x59'))](_0x118402[_0x190e('0x5a')]);});})[_0x190e('0x26')](handleEntityNotFound(_0x5d5cb1,null))[_0x190e('0x26')](respondWithStatusCode(_0x5d5cb1,0xcc))['catch'](handleError(_0x5d5cb1,null));};exports[_0x190e('0x68')]=function(_0x5934ff,_0x419afe,_0x45cc8d){var _0x9b94f7={};var _0x4ab347={};var _0x24c303;var _0x5c4a9b;return db[_0x190e('0x2c')][_0x190e('0x5c')]({'where':{'id':_0x5934ff['params']['id']}})[_0x190e('0x26')](handleEntityNotFound(_0x419afe,null))[_0x190e('0x26')](function(_0x54d581){if(_0x54d581){_0x24c303=_0x54d581;_0x4ab347['model']=_[_0x190e('0x2f')](db[_0x190e('0x69')][_0x190e('0x2d')]);_0x4ab347[_0x190e('0x30')]=_['keys'](_0x5934ff[_0x190e('0x30')]);_0x4ab347[_0x190e('0x31')]=_[_0x190e('0x32')](_0x4ab347[_0x190e('0x2e')],_0x4ab347[_0x190e('0x30')]);_0x9b94f7[_0x190e('0x33')]=_[_0x190e('0x32')](_0x4ab347[_0x190e('0x2e')],qs[_0x190e('0x46')](_0x5934ff[_0x190e('0x30')][_0x190e('0x46')]));_0x9b94f7['attributes']=_0x9b94f7['attributes'][_0x190e('0x34')]?_0x9b94f7[_0x190e('0x33')]:_0x4ab347['model'];_0x9b94f7[_0x190e('0x37')]=qs['sort'](_0x5934ff['query']['sort']);_0x9b94f7['where']=qs[_0x190e('0x31')](_[_0x190e('0x3a')](_0x5934ff[_0x190e('0x30')],_0x4ab347[_0x190e('0x31')]));if(_0x5934ff[_0x190e('0x30')][_0x190e('0x3b')]){_0x9b94f7[_0x190e('0x39')]=_[_0x190e('0x3e')](_0x9b94f7[_0x190e('0x39')],{'$or':_[_0x190e('0x2b')](_0x9b94f7['attributes'],function(_0x54af64){var _0xbe6029={};_0xbe6029[_0x54af64]={'$like':'%'+_0x5934ff['query'][_0x190e('0x3b')]+'%'};return _0xbe6029;})});}_0x9b94f7=_[_0x190e('0x3e')]({},_0x9b94f7,_0x5934ff[_0x190e('0x6a')]);return _0x24c303[_0x190e('0x68')](_0x9b94f7);}})[_0x190e('0x26')](function(_0x72eb5e){if(_0x72eb5e){_0x5c4a9b=_0x72eb5e[_0x190e('0x34')];if(!_0x5934ff[_0x190e('0x30')][_0x190e('0x35')]('nolimit')){_0x9b94f7[_0x190e('0x1f')]=qs[_0x190e('0x1f')](_0x5934ff['query'][_0x190e('0x1f')]);_0x9b94f7[_0x190e('0x1e')]=qs[_0x190e('0x1e')](_0x5934ff['query'][_0x190e('0x1e')]);}return _0x24c303[_0x190e('0x68')](_0x9b94f7);}})[_0x190e('0x26')](function(_0x44e38d){if(_0x44e38d){return _0x44e38d?{'count':_0x5c4a9b,'rows':_0x44e38d}:null;}})[_0x190e('0x26')](respondWithResult(_0x419afe,null))[_0x190e('0x43')](handleError(_0x419afe,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 9368479..58946e3 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 _0x5dac=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5dac,0x1c7));var _0xc5da=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5dac[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xc5da('0x0'));var util=require(_0xc5da('0x1'));var logger=require(_0xc5da('0x2'))(_0xc5da('0x3'));var moment=require(_0xc5da('0x4'));var BPromise=require(_0xc5da('0x5'));var rp=require(_0xc5da('0x6'));var fs=require('fs');var path=require(_0xc5da('0x7'));var rimraf=require('rimraf');var config=require(_0xc5da('0x8'));var attributes=require(_0xc5da('0x9'));module[_0xc5da('0xa')]=function(_0x11865d,_0x51f7e8){return _0x11865d[_0xc5da('0xb')](_0xc5da('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04b5=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x3bad41,_0x1bb329){var _0x477b85=function(_0x2560e0){while(--_0x2560e0){_0x3bad41['push'](_0x3bad41['shift']());}};_0x477b85(++_0x1bb329);}(_0x04b5,0x19f));var _0x504b=function(_0x48bb48,_0x15562c){_0x48bb48=_0x48bb48-0x0;var _0x119c62=_0x04b5[_0x48bb48];return _0x119c62;};'use strict';var _=require(_0x504b('0x0'));var util=require(_0x504b('0x1'));var logger=require(_0x504b('0x2'))(_0x504b('0x3'));var moment=require(_0x504b('0x4'));var BPromise=require(_0x504b('0x5'));var rp=require(_0x504b('0x6'));var fs=require('fs');var path=require(_0x504b('0x7'));var rimraf=require(_0x504b('0x8'));var config=require(_0x504b('0x9'));var attributes=require(_0x504b('0xa'));module[_0x504b('0xb')]=function(_0x1e4350,_0x53ec16){return _0x1e4350[_0x504b('0xc')](_0x504b('0xd'),attributes,{'tableName':_0x504b('0xe'),'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 ba74a0a..ce6e697 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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x15ef38,_0x391bc5){var _0x3ebe00=function(_0x2638c9){while(--_0x2638c9){_0x15ef38['push'](_0x15ef38['shift']());}};_0x3ebe00(++_0x391bc5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x228f94,_0x2bc5d4){var _0x2f724a=function(_0x435b04){while(--_0x435b04){_0x228f94['push'](_0x228f94['shift']());}};_0x2f724a(++_0x2bc5d4);}(_0xe706,0xa3));var _0x6e70=function(_0x3faaf8,_0x16d9ae){_0x3faaf8=_0x3faaf8-0x0;var _0x1a3527=_0xe706[_0x3faaf8];return _0x1a3527;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 132e7fa..ee234fc 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 _0xf6d0=['update','delete','removeAgents','removeTeams','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id'];(function(_0x59ba26,_0x56d56){var _0x3e947b=function(_0x4c2a6d){while(--_0x4c2a6d){_0x59ba26['push'](_0x59ba26['shift']());}};_0x3e947b(++_0x56d56);}(_0xf6d0,0x163));var _0x0f6d=function(_0x2c2dba,_0x289d3b){_0x2c2dba=_0x2c2dba-0x0;var _0x1c14e4=_0xf6d0[_0x2c2dba];return _0x1c14e4;};'use strict';var multer=require(_0x0f6d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f6d('0x1'));var express=require(_0x0f6d('0x2'));var router=express[_0x0f6d('0x3')]();var fs_extra=require(_0x0f6d('0x4'));var auth=require(_0x0f6d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f6d('0x6'));var controller=require(_0x0f6d('0x7'));router[_0x0f6d('0x8')]('/',auth[_0x0f6d('0x9')](),controller[_0x0f6d('0xa')]);router[_0x0f6d('0x8')](_0x0f6d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0f6d('0x8')]('/:id',auth[_0x0f6d('0x9')](),controller['show']);router['get'](_0x0f6d('0xc'),auth[_0x0f6d('0x9')](),controller[_0x0f6d('0xd')]);router[_0x0f6d('0x8')]('/:id/teams',auth[_0x0f6d('0x9')](),controller['getTeams']);router[_0x0f6d('0xe')]('/',auth[_0x0f6d('0x9')](),controller[_0x0f6d('0xf')]);router['post'](_0x0f6d('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0f6d('0xe')](_0x0f6d('0x10'),auth[_0x0f6d('0x9')](),controller[_0x0f6d('0x11')]);router[_0x0f6d('0x12')](_0x0f6d('0x13'),auth['isAuthenticated'](),controller[_0x0f6d('0x14')]);router[_0x0f6d('0x15')](_0x0f6d('0x13'),auth[_0x0f6d('0x9')](),controller['destroy']);router[_0x0f6d('0x15')](_0x0f6d('0xc'),auth[_0x0f6d('0x9')](),controller[_0x0f6d('0x16')]);router[_0x0f6d('0x15')]('/:id/teams',auth[_0x0f6d('0x9')](),controller[_0x0f6d('0x17')]);module[_0x0f6d('0x18')]=router; \ No newline at end of file +var _0x782e=['getTeams','post','addAgents','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','/:id','show','/:id/users','getAgents','/:id/teams'];(function(_0x42a49e,_0x51c823){var _0x5982ac=function(_0x57233d){while(--_0x57233d){_0x42a49e['push'](_0x42a49e['shift']());}};_0x5982ac(++_0x51c823);}(_0x782e,0xb9));var _0xe782=function(_0x3dc6e4,_0x12bdb9){_0x3dc6e4=_0x3dc6e4-0x0;var _0xe7a2b0=_0x782e[_0x3dc6e4];return _0xe7a2b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe782('0x0'));var timeout=require(_0xe782('0x1'));var express=require('express');var router=express[_0xe782('0x2')]();var fs_extra=require(_0xe782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var controller=require(_0xe782('0x6'));router[_0xe782('0x7')]('/',auth['isAuthenticated'](),controller[_0xe782('0x8')]);router['get']('/describe',auth[_0xe782('0x9')](),controller['describe']);router[_0xe782('0x7')](_0xe782('0xa'),auth[_0xe782('0x9')](),controller[_0xe782('0xb')]);router[_0xe782('0x7')](_0xe782('0xc'),auth[_0xe782('0x9')](),controller[_0xe782('0xd')]);router[_0xe782('0x7')](_0xe782('0xe'),auth[_0xe782('0x9')](),controller[_0xe782('0xf')]);router[_0xe782('0x10')]('/',auth[_0xe782('0x9')](),controller['create']);router[_0xe782('0x10')]('/:id/users',auth[_0xe782('0x9')](),controller[_0xe782('0x11')]);router[_0xe782('0x10')](_0xe782('0xe'),auth[_0xe782('0x9')](),controller[_0xe782('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe782('0x13')]);router[_0xe782('0x14')]('/:id',auth[_0xe782('0x9')](),controller[_0xe782('0x15')]);router[_0xe782('0x14')](_0xe782('0xc'),auth[_0xe782('0x9')](),controller[_0xe782('0x16')]);router[_0xe782('0x14')](_0xe782('0xe'),auth[_0xe782('0x9')](),controller[_0xe782('0x17')]);module[_0xe782('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 30e2990..26b8af1 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 _0x738a=['sequelize','exports','STRING','name','VIRTUAL','getDataValue','INTEGER'];(function(_0x31d529,_0x1c419d){var _0x49970b=function(_0x140fdf){while(--_0x140fdf){_0x31d529['push'](_0x31d529['shift']());}};_0x49970b(++_0x1c419d);}(_0x738a,0x149));var _0xa738=function(_0x4d5d0a,_0x4148dd){_0x4d5d0a=_0x4d5d0a-0x0;var _0x502c59=_0x738a[_0x4d5d0a];return _0x502c59;};'use strict';var Sequelize=require(_0xa738('0x0'));module[_0xa738('0x1')]={'name':{'type':Sequelize[_0xa738('0x2')],'allowNull':![],'unique':_0xa738('0x3')},'prefix':{'type':Sequelize[_0xa738('0x4')],'get':function(_0x4bb101){return'system-'+this[_0xa738('0x5')](_0xa738('0x3'))+'-';}},'description':{'type':Sequelize[_0xa738('0x2')]},'callerIdAll':{'type':Sequelize[_0xa738('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xa738('0x6')]}}; \ No newline at end of file +var _0x87b6=['name','sequelize','exports','STRING'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0x87b6,0x175));var _0x687b=function(_0x653d7f,_0x4b9913){_0x653d7f=_0x653d7f-0x0;var _0x161752=_0x87b6[_0x653d7f];return _0x161752;};'use strict';var Sequelize=require(_0x687b('0x0'));module[_0x687b('0x1')]={'name':{'type':Sequelize[_0x687b('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2e67da){return'system-'+this['getDataValue'](_0x687b('0x3'))+'-';}},'description':{'type':Sequelize[_0x687b('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index ad5def2..1e2c774 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 _0x351d=['isEmpty','forEach','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','VoicePrefixes','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','VoicePrefix','findAll','catch','show','params','length','merge','options','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','get','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','CDR(prefix)=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','Team','getTeams','addTeams','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','removeTeams','Agents','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x351d,0x90));var _0xd351=function(_0x19b80b,_0x11126e){_0x19b80b=_0x19b80b-0x0;var _0x1539c8=_0x351d[_0x19b80b];return _0x1539c8;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd351('0x13')]=_[_0xd351('0x14')](config[_0xd351('0x13')],{'host':_0xd351('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd351('0x13')]));require(_0xd351('0x16'))['register'](socket);function respondWithStatusCode(_0xc5a145,_0xb106ef){_0xb106ef=_0xb106ef||0xcc;return function(_0x3c2299){if(_0x3c2299){return _0xc5a145[_0xd351('0x17')](_0xb106ef);}return _0xc5a145[_0xd351('0x18')](_0xb106ef)['end']();};}function respondWithResult(_0x9f790f,_0x49d8bb){_0x49d8bb=_0x49d8bb||0xc8;return function(_0x5bdc03){if(_0x5bdc03){return _0x9f790f[_0xd351('0x18')](_0x49d8bb)['json'](_0x5bdc03);}};}function respondWithFilteredResult(_0x21e591,_0x1de35f){return function(_0x4e0164){if(_0x4e0164){var _0x4c6693=typeof _0x1de35f[_0xd351('0x19')]===_0xd351('0x1a')&&typeof _0x1de35f[_0xd351('0x1b')]===_0xd351('0x1a');var _0x51f265=_0x4e0164[_0xd351('0x1c')];var _0x4abbed=_0x4c6693?0x0:_0x1de35f['offset'];var _0x37d3ac=_0x4c6693?_0x4e0164['count']:_0x1de35f[_0xd351('0x19')]+_0x1de35f[_0xd351('0x1b')];var _0x3634c9;if(_0x37d3ac>=_0x51f265){_0x37d3ac=_0x51f265;_0x3634c9=0xc8;}else{_0x3634c9=0xce;}_0x21e591[_0xd351('0x18')](_0x3634c9);return _0x21e591[_0xd351('0x1d')]('Content-Range',_0x4abbed+'-'+_0x37d3ac+'/'+_0x51f265)[_0xd351('0x1e')](_0x4e0164);}return null;};}function patchUpdates(_0xbbc58){return function(_0x241265){try{jsonpatch['apply'](_0x241265,_0xbbc58,!![]);}catch(_0x1ce7f7){return BPromise[_0xd351('0x1f')](_0x1ce7f7);}return _0x241265[_0xd351('0x20')]();};}function saveUpdates(_0x59fb6d,_0x1ce279){return function(_0x34a5cb){if(_0x34a5cb){return _0x34a5cb[_0xd351('0x21')](_0x59fb6d)[_0xd351('0x22')](function(_0x489c9a){return _0x489c9a;});}return null;};}function removeEntity(_0x40f7f3,_0x483c92){return function(_0x358bff){if(_0x358bff){return _0x358bff[_0xd351('0x23')]()['then'](function(){var _0x2648d0=_0x358bff['get']({'plain':!![]});var _0x50d67e=_0xd351('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x50d67e,'resourceId':_0x2648d0['id']}})[_0xd351('0x22')](function(){return _0x358bff;});})['then'](function(){_0x40f7f3[_0xd351('0x18')](0xcc)[_0xd351('0x25')]();});}};}function handleEntityNotFound(_0x407b50,_0x4d3f48){return function(_0x71ce9c){if(!_0x71ce9c){_0x407b50['sendStatus'](0x194);}return _0x71ce9c;};}function handleError(_0x1c826b,_0x50039b){_0x50039b=_0x50039b||0x1f4;return function(_0x5f07b1){logger[_0xd351('0x26')](_0x5f07b1[_0xd351('0x27')]);if(_0x5f07b1[_0xd351('0x28')]){delete _0x5f07b1[_0xd351('0x28')];}_0x1c826b['status'](_0x50039b)[_0xd351('0x29')](_0x5f07b1);};}exports[_0xd351('0x2a')]=function(_0x38023c,_0x41da60){var _0x140591={},_0x205c79={},_0x103a7b={'count':0x0,'rows':[]};var _0x898949=_[_0xd351('0x2b')](db['VoicePrefix'][_0xd351('0x2c')],function(_0x453270){return{'name':_0x453270[_0xd351('0x2d')],'type':_0x453270[_0xd351('0x2e')]['key']};});_0x205c79[_0xd351('0x2f')]=_[_0xd351('0x2b')](_0x898949,_0xd351('0x28'));_0x205c79[_0xd351('0x30')]=_[_0xd351('0x31')](_0x38023c[_0xd351('0x30')]);_0x205c79[_0xd351('0x32')]=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],_0x205c79['query']);_0x140591['attributes']=_[_0xd351('0x33')](_0x205c79[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x38023c[_0xd351('0x30')][_0xd351('0x34')]));_0x140591[_0xd351('0x35')]=_0x140591['attributes']['length']?_0x140591[_0xd351('0x35')]:_0x205c79['model'];if(!_0x38023c[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x140591[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x38023c[_0xd351('0x30')][_0xd351('0x1b')]);_0x140591[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x38023c[_0xd351('0x30')][_0xd351('0x19')]);}_0x140591['order']=qs[_0xd351('0x38')](_0x38023c['query'][_0xd351('0x38')]);_0x140591[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x38023c[_0xd351('0x30')],_0x205c79[_0xd351('0x32')]),_0x898949);if(_0x38023c['query'][_0xd351('0x3b')]){_0x140591[_0xd351('0x39')]=_['merge'](_0x140591[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x898949,function(_0x382f5b){if(_0x382f5b[_0xd351('0x2e')]!==_0xd351('0x3c')){var _0x5cc105={};_0x5cc105[_0x382f5b['name']]={'$like':'%'+_0x38023c[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x5cc105;}})});}_0x140591=_['merge']({},_0x140591,_0x38023c['options']);var _0x16677f={'where':_0x140591[_0xd351('0x39')]};return db['VoicePrefix']['count'](_0x16677f)[_0xd351('0x22')](function(_0x18f9d1){_0x103a7b[_0xd351('0x1c')]=_0x18f9d1;if(_0x38023c[_0xd351('0x30')][_0xd351('0x3d')]){_0x140591[_0xd351('0x3e')]=[{'all':!![]}];}return db[_0xd351('0x3f')][_0xd351('0x40')](_0x140591);})[_0xd351('0x22')](function(_0x553360){_0x103a7b['rows']=_0x553360;return _0x103a7b;})[_0xd351('0x22')](respondWithFilteredResult(_0x41da60,_0x140591))[_0xd351('0x41')](handleError(_0x41da60,null));};exports[_0xd351('0x42')]=function(_0x35f38f,_0x2bdd8f){var _0x4332e7={'raw':![],'where':{'id':_0x35f38f[_0xd351('0x43')]['id']}},_0xeaf4dc={};_0xeaf4dc[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x3f')][_0xd351('0x2c')]);_0xeaf4dc[_0xd351('0x30')]=_[_0xd351('0x31')](_0x35f38f[_0xd351('0x30')]);_0xeaf4dc[_0xd351('0x32')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],_0xeaf4dc[_0xd351('0x30')]);_0x4332e7[_0xd351('0x35')]=_['intersection'](_0xeaf4dc[_0xd351('0x2f')],qs[_0xd351('0x34')](_0x35f38f[_0xd351('0x30')][_0xd351('0x34')]));_0x4332e7[_0xd351('0x35')]=_0x4332e7['attributes'][_0xd351('0x44')]?_0x4332e7['attributes']:_0xeaf4dc[_0xd351('0x2f')];if(_0x35f38f[_0xd351('0x30')]['includeAll']){_0x4332e7['include']=[{'all':!![]}];}_0x4332e7=_[_0xd351('0x45')]({},_0x4332e7,_0x35f38f[_0xd351('0x46')]);return db[_0xd351('0x3f')]['find'](_0x4332e7)[_0xd351('0x22')](handleEntityNotFound(_0x2bdd8f,null))[_0xd351('0x22')](respondWithResult(_0x2bdd8f,null))['catch'](handleError(_0x2bdd8f,null));};exports[_0xd351('0x23')]=function(_0x53a2e8,_0x1eb5f3){return db[_0xd351('0x3f')]['find']({'where':{'id':_0x53a2e8['params']['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x1eb5f3,null))['then'](removeEntity(_0x1eb5f3,null))[_0xd351('0x41')](handleError(_0x1eb5f3,null));};exports[_0xd351('0x47')]=function(_0x9f1cd0,_0x4a27e3){return db[_0xd351('0x3f')]['describe']()['then'](respondWithResult(_0x4a27e3,null))['catch'](handleError(_0x4a27e3,null));};exports[_0xd351('0x48')]=function(_0x292af3,_0x334029){var _0x5a2e9b;return db['sequelize'][_0xd351('0x49')](function(_0x42f248){return db['VoicePrefix'][_0xd351('0x48')](_0x292af3[_0xd351('0x4a')],{'transaction':_0x42f248})['then'](function(_0x24ee0f){_0x5a2e9b=_0x24ee0f['get']({'plain':!![]});return db[_0xd351('0x4b')]['find']({'where':{'id':_0x5a2e9b[_0xd351('0x4c')]},'raw':!![]})[_0xd351('0x22')](function(_0x169ab1){return createVoicePrefixExtensions(_0x5a2e9b,_0x169ab1,_0x42f248);});});})[_0xd351('0x22')](function(){var _0xb5f3ee=_0x292af3[_0xd351('0x4d')][_0xd351('0x4e')]({'plain':!![]});if(!_0xb5f3ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb5f3ee['role']===_0xd351('0x4d')){var _0x624224=_0x5a2e9b;return db['UserProfileSection'][_0xd351('0x4f')]({'where':{'name':_0xd351('0x24'),'userProfileId':_0xb5f3ee[_0xd351('0x50')]},'raw':!![]})['then'](function(_0x169122){if(_0x169122&&_0x169122['autoAssociation']===0x0){return db['UserProfileResource'][_0xd351('0x48')]({'name':_0x624224[_0xd351('0x28')],'resourceId':_0x624224['id'],'type':_0x169122['name'],'sectionId':_0x169122['id']},{})[_0xd351('0x22')](function(){return _0x5a2e9b;});}else{return _0x5a2e9b;}})[_0xd351('0x41')](function(_0x2d9747){logger[_0xd351('0x26')](_0xd351('0x51'),_0x2d9747);throw _0x2d9747;});}return _0x5a2e9b;})[_0xd351('0x22')](respondWithResult(_0x334029,null))['catch'](handleError(_0x334029,null));};function Extension(_0x1e1173,_0x2a7390,_0x36fb5b,_0x8461b){this[_0xd351('0x52')]=_0xd351('0x53');this[_0xd351('0x54')]=_0x1e1173;this['app']=_0x36fb5b;this[_0xd351('0x2e')]='system';this[_0xd351('0x55')]=_0xd351('0x56');this[_0xd351('0x57')]=_0x2a7390;this[_0xd351('0x58')]=_0x8461b;}function createVoicePrefixExtensions(_0x70cdb,_0x4eaf18,_0x413931){return new BPromise(function(_0x4c8038,_0x4685fa){var _0x45bcc7=new Extension(formatPrefixName(_0x70cdb[_0xd351('0x59')]),0x1,_0xd351('0x5a'),_0xd351('0x5b'));_0x45bcc7['VoicePrefixId']=_0x70cdb['id'];return db['VoiceExtension'][_0xd351('0x48')](_0x45bcc7,{'transaction':_0x413931})[_0xd351('0x22')](function(_0x4b9367){var _0x2d2655=_0x4b9367[_0xd351('0x4e')]({'plain':!![]});var _0x2718e9=_['map'](addVoicePrefixExtensions(_0x70cdb,_0x4eaf18),function(_0x2b47ab){_0x2b47ab[_0xd351('0x4c')]=_0x2d2655['id'];_0x2b47ab[_0xd351('0x5c')]=_0x70cdb['id'];return _0x2b47ab;});return db[_0xd351('0x4b')]['bulkCreate'](_0x2718e9,{'transaction':_0x413931})['then'](function(_0x40c78b){if(!_0x40c78b){return _0x4685fa(_0xd351('0x5d'));}else{return _0x4c8038(_0x40c78b);}})[_0xd351('0x41')](function(_0xa000b4){return _0x4685fa(_0xa000b4);});});;});};function addVoicePrefixExtensions(_0x36b38f,_0x3b0993){var _0x2c83fe=[];var _0x5e2e06=formatPrefixName(_0x36b38f[_0xd351('0x59')]);_0x2c83fe['push'](new Extension(_0x5e2e06,0x2,'Set',_0xd351('0x5e')+_0x36b38f[_0xd351('0x28')]));if(_0x36b38f['callerIdAll']){_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,'Set','PREFIX-CALLERIDALL='+_0x36b38f['callerIdAll']));}else{_0x2c83fe[_0xd351('0x5f')](new Extension(_0x5e2e06,0x3,_0xd351('0x5a'),_0xd351('0x60')));}_0x2c83fe['push'](new Extension(_0x5e2e06,0x4,_0xd351('0x61'),_0x3b0993[_0xd351('0x52')]+','+_0xd351('0x62')+(0x8+_0x36b38f[_0xd351('0x28')][_0xd351('0x44')])+'}'+','+0x1));return _0x2c83fe;}function formatPrefixName(_0x475534){var _0x15fcab='_';for(var _0x6bf19c=0x0;_0x6bf19c<_0x475534[_0xd351('0x44')];_0x6bf19c++){if(_0x475534[_0xd351('0x63')](_0x6bf19c)=='-'){_0x15fcab+=_0x475534[_0xd351('0x63')](_0x6bf19c);}else{_0x15fcab+='['+_0x475534['charAt'](_0x6bf19c)+']';}}_0x15fcab+='.';return _0x15fcab;}exports[_0xd351('0x21')]=function(_0x2d59a5,_0x431e91,_0xcc7a10){var _0xf24a29=_0x2d59a5[_0xd351('0x4a')];_0xf24a29['prefix']=_0xd351('0x64')+_0xf24a29[_0xd351('0x28')]+'-';return db['sequelize']['transaction'](function(_0x436e1d){return db[_0xd351('0x3f')][_0xd351('0x21')](_0xf24a29,{'where':{'id':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x23')]({'where':{'VoicePrefixId':_0xf24a29['id']},'transaction':_0x436e1d})[_0xd351('0x22')](function(){return db[_0xd351('0x4b')][_0xd351('0x4f')]({'where':{'id':_0xf24a29['VoiceExtensionId']},'raw':!![]})[_0xd351('0x22')](function(_0x129623){return createVoicePrefixExtensions(_0xf24a29,_0x129623,_0x436e1d);});});});})['then'](function(){return db[_0xd351('0x3f')]['findById'](_0xf24a29['id']);})[_0xd351('0x22')](respondWithResult(_0x431e91,null))['catch'](handleError(_0x431e91,null));};exports[_0xd351('0x65')]=function(_0x406d8a,_0xbd31ca,_0x451445){return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x406d8a[_0xd351('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd31ca,null))[_0xd351('0x22')](function(_0x2558b4){if(_0x2558b4){return _0x2558b4[_0xd351('0x65')](_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')],_['omit'](_0x406d8a[_0xd351('0x4a')],[_0xd351('0x66'),'id'])||{})[_0xd351('0x67')](function(_0x54b38c){for(var _0x38a3ec=0x0;_0x38a3ec<_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0xd351('0x44')];_0x38a3ec+=0x1){socket[_0xd351('0x68')](_0xd351('0x69'),{'UserId':Number(_0x406d8a[_0xd351('0x4a')][_0xd351('0x66')][_0x38a3ec]),'VoicePrefixId':Number(_0x406d8a[_0xd351('0x43')]['id'])});}return _0x54b38c;});}})['then'](respondWithResult(_0xbd31ca,null))[_0xd351('0x41')](handleError(_0xbd31ca,null));};exports[_0xd351('0x6a')]=function(_0x5036e6,_0x44df63,_0x4c1468){return db['VoicePrefix']['find']({'where':{'id':_0x5036e6[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x44df63,null))[_0xd351('0x22')](function(_0x5b2bf9){if(_0x5b2bf9){return _0x5b2bf9[_0xd351('0x6a')](_0x5036e6['query'][_0xd351('0x66')])['then'](function(){if(_[_0xd351('0x6b')](_0x5036e6[_0xd351('0x30')][_0xd351('0x66')])){for(var _0x16dd16=0x0;_0x16dd16<_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0xd351('0x44')];_0x16dd16+=0x1){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')][_0x16dd16]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}}else{socket['emit'](_0xd351('0x6c'),{'UserId':Number(_0x5036e6[_0xd351('0x30')][_0xd351('0x66')]),'VoicePrefixId':Number(_0x5036e6[_0xd351('0x43')]['id'])});}});}})[_0xd351('0x22')](respondWithStatusCode(_0x44df63,null))['catch'](handleError(_0x44df63,null));};exports[_0xd351('0x6d')]=function(_0x1e6c85,_0x2adab4,_0x2a1ea4){var _0x4a4b25={};var _0x1fda25={};var _0x36bbee;var _0x48b5ee;return db[_0xd351('0x3f')][_0xd351('0x6e')]({'where':{'id':_0x1e6c85[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x2adab4,null))['then'](function(_0x523895){if(_0x523895){_0x36bbee=_0x523895;_0x1fda25[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x6f')][_0xd351('0x2c')]);_0x1fda25['query']=_[_0xd351('0x31')](_0x1e6c85[_0xd351('0x30')]);_0x1fda25[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1fda25[_0xd351('0x2f')],_0x1fda25['query']);_0x4a4b25[_0xd351('0x35')]=_[_0xd351('0x33')](_0x1fda25['model'],qs[_0xd351('0x34')](_0x1e6c85[_0xd351('0x30')]['fields']));_0x4a4b25[_0xd351('0x35')]=_0x4a4b25['attributes'][_0xd351('0x44')]?_0x4a4b25['attributes']:_0x1fda25[_0xd351('0x2f')];_0x4a4b25[_0xd351('0x70')]=qs[_0xd351('0x38')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x38')]);_0x4a4b25[_0xd351('0x39')]=qs[_0xd351('0x32')](_[_0xd351('0x3a')](_0x1e6c85[_0xd351('0x30')],_0x1fda25['filters']));if(_0x1e6c85[_0xd351('0x30')][_0xd351('0x3b')]){_0x4a4b25[_0xd351('0x39')]=_[_0xd351('0x45')](_0x4a4b25[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x4a4b25[_0xd351('0x35')],function(_0x54041b){var _0x56458b={};_0x56458b[_0x54041b]={'$like':'%'+_0x1e6c85[_0xd351('0x30')]['filter']+'%'};return _0x56458b;})});}_0x4a4b25=_[_0xd351('0x45')]({},_0x4a4b25,_0x1e6c85[_0xd351('0x46')]);return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x2d5e2b){if(_0x2d5e2b){_0x48b5ee=_0x2d5e2b['length'];if(!_0x1e6c85[_0xd351('0x30')][_0xd351('0x36')](_0xd351('0x37'))){_0x4a4b25[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x1b')]);_0x4a4b25[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x1e6c85[_0xd351('0x30')][_0xd351('0x19')]);}return _0x36bbee[_0xd351('0x6d')](_0x4a4b25);}})[_0xd351('0x22')](function(_0x4ddd65){if(_0x4ddd65){return _0x4ddd65?{'count':_0x48b5ee,'rows':_0x4ddd65}:null;}})['then'](respondWithResult(_0x2adab4,null))[_0xd351('0x41')](handleError(_0x2adab4,null));};exports['getTeams']=function(_0x5c202f,_0x426964,_0x4557ed){var _0x3f6826={};var _0x1a5e8e={};var _0x54fc9c;var _0x2443bd;return db['VoicePrefix']['findOne']({'where':{'id':_0x5c202f[_0xd351('0x43')]['id']}})[_0xd351('0x22')](handleEntityNotFound(_0x426964,null))[_0xd351('0x22')](function(_0x15690b){if(_0x15690b){_0x54fc9c=_0x15690b;_0x1a5e8e[_0xd351('0x2f')]=_[_0xd351('0x31')](db[_0xd351('0x71')]['rawAttributes']);_0x1a5e8e[_0xd351('0x30')]=_[_0xd351('0x31')](_0x5c202f[_0xd351('0x30')]);_0x1a5e8e[_0xd351('0x32')]=_[_0xd351('0x33')](_0x1a5e8e[_0xd351('0x2f')],_0x1a5e8e['query']);_0x3f6826['attributes']=_[_0xd351('0x33')](_0x1a5e8e['model'],qs[_0xd351('0x34')](_0x5c202f[_0xd351('0x30')]['fields']));_0x3f6826[_0xd351('0x35')]=_0x3f6826[_0xd351('0x35')][_0xd351('0x44')]?_0x3f6826[_0xd351('0x35')]:_0x1a5e8e[_0xd351('0x2f')];_0x3f6826['order']=qs[_0xd351('0x38')](_0x5c202f['query'][_0xd351('0x38')]);_0x3f6826[_0xd351('0x39')]=qs['filters'](_[_0xd351('0x3a')](_0x5c202f[_0xd351('0x30')],_0x1a5e8e[_0xd351('0x32')]));if(_0x5c202f[_0xd351('0x30')]['filter']){_0x3f6826['where']=_['merge'](_0x3f6826[_0xd351('0x39')],{'$or':_[_0xd351('0x2b')](_0x3f6826[_0xd351('0x35')],function(_0x40740e){var _0x3606b1={};_0x3606b1[_0x40740e]={'$like':'%'+_0x5c202f[_0xd351('0x30')][_0xd351('0x3b')]+'%'};return _0x3606b1;})});}_0x3f6826=_['merge']({},_0x3f6826,_0x5c202f[_0xd351('0x46')]);return _0x54fc9c['getTeams'](_0x3f6826);}})[_0xd351('0x22')](function(_0x55d564){if(_0x55d564){_0x2443bd=_0x55d564['length'];if(!_0x5c202f[_0xd351('0x30')]['hasOwnProperty'](_0xd351('0x37'))){_0x3f6826[_0xd351('0x1b')]=qs[_0xd351('0x1b')](_0x5c202f[_0xd351('0x30')][_0xd351('0x1b')]);_0x3f6826[_0xd351('0x19')]=qs['offset'](_0x5c202f['query'][_0xd351('0x19')]);}return _0x54fc9c[_0xd351('0x72')](_0x3f6826);}})['then'](function(_0x3d3cfa){if(_0x3d3cfa){return _0x3d3cfa?{'count':_0x2443bd,'rows':_0x3d3cfa}:null;}})['then'](respondWithResult(_0x426964,null))[_0xd351('0x41')](handleError(_0x426964,null));};exports[_0xd351('0x73')]=function(_0x6fd03b,_0x19d16a,_0x127bf9){var _0x4ab9b9=_0x6fd03b[_0xd351('0x4a')]['ids'];var _0x581e66;return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x4ab9b9},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':'Agents','attributes':['id','name',_0xd351('0x74'),_0xd351('0x75'),_0xd351('0x76')],'raw':!![]}]})[_0xd351('0x22')](function(_0x1ddacf){if(_0x1ddacf){_0x581e66=_0x1ddacf;var _0x4cadbe=_[_0xd351('0x77')](_0x1ddacf,function(_0x269bf6){var _0x3da123=_0x269bf6[_0xd351('0x4e')]({'plain':!![]});return _0x3da123['Agents'];});return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x6fd03b['params']['id']}})[_0xd351('0x22')](function(_0x46745f){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x37d882){return _0x46745f['addTeams'](_0x4ab9b9,{'transaction':_0x37d882})[_0xd351('0x22')](function(){return BPromise[_0xd351('0x79')](_0x581e66,function(_0x5ceda1){return db[_0xd351('0x7a')]['upsert']({'TeamId':_0x5ceda1['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},{'transaction':_0x37d882});});})[_0xd351('0x22')](function(){return BPromise['each'](_0x4cadbe,function(_0x1f0812){return db[_0xd351('0x7b')][_0xd351('0x7c')]({'where':{'UserId':_0x1f0812['id'],'VoicePrefixId':_0x6fd03b[_0xd351('0x43')]['id']},'transaction':_0x37d882});});})[_0xd351('0x22')](function(){_0x4cadbe['forEach'](function(_0x23b2fe){socket['emit'](_0xd351('0x69'),{'UserId':_0x23b2fe['id'],'VoicePrefixId':_0x46745f['id']});});});});});}})[_0xd351('0x22')](respondWithStatusCode(_0x19d16a,null))[_0xd351('0x41')](handleError(_0x19d16a,null));};exports[_0xd351('0x7d')]=function(_0x160102,_0x24ac40,_0x3b2690){return db[_0xd351('0x71')][_0xd351('0x40')]({'where':{'id':_0x160102['query'][_0xd351('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd351('0x6f')],'as':_0xd351('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xd351('0x22')](handleEntityNotFound(_0x24ac40,null))['then'](function(_0x280220){var _0x4f8f00=_[_0xd351('0x2b')](_0x280220,'id');var _0x107886=[];var _0x3a3633=[];var _0x403312=squel[_0xd351('0x7f')]();_0x403312['field'](_0xd351('0x80'))[_0xd351('0x81')]('team_has_voice_prefixes','tq')['join'](_0xd351('0x82'),'ut',_0xd351('0x83'))[_0xd351('0x39')](_0xd351('0x84'),_0x160102[_0xd351('0x43')]['id']);for(var _0x1373c0=0x0;_0x1373c0<_0x280220[_0xd351('0x44')];_0x1373c0+=0x1){let _0x78b55c=_0x280220[_0x1373c0];for(var _0x2de03c=0x0;_0x2de03c<_0x78b55c[_0xd351('0x7e')][_0xd351('0x44')];_0x2de03c+=0x1){let _0x6f4c1e=_0x78b55c[_0xd351('0x7e')][_0x2de03c];var _0x56b88b=_0x403312['clone']();_0x56b88b[_0xd351('0x39')]('ut.UserId\x20=\x20?',_0x6f4c1e['id']);_0x3a3633[_0xd351('0x5f')](db[_0xd351('0x78')][_0xd351('0x30')](_0x56b88b[_0xd351('0x85')](),{'type':db[_0xd351('0x78')][_0xd351('0x86')]['SELECT']})[_0xd351('0x22')](function(_0x2725c4){if(_0x2725c4['length']===0x1){return _0x6f4c1e['id'];}else{var _0x31c1dc=_['every'](_['map'](_0x2725c4,_0xd351('0x87')),function(_0x2f188b){return _['includes'](_0x4f8f00,_0x2f188b);});if(_0x31c1dc){return _0x6f4c1e['id'];}}}));}}return BPromise[_0xd351('0x88')](_0x3a3633)[_0xd351('0x22')](function(_0x5126a1){_0x107886=_(_0x107886)[_0xd351('0x89')](_0x5126a1)[_0xd351('0x8a')]()[_0xd351('0x8b')]();return db[_0xd351('0x3f')][_0xd351('0x4f')]({'where':{'id':_0x160102['params']['id']}})[_0xd351('0x22')](function(_0x1db9db){return db[_0xd351('0x78')][_0xd351('0x49')](function(_0x2ef116){return _0x1db9db[_0xd351('0x7d')](_0x160102[_0xd351('0x30')][_0xd351('0x66')],{'transaction':_0x2ef116})[_0xd351('0x22')](function(){if(!_[_0xd351('0x8c')](_0x107886)){return _0x1db9db[_0xd351('0x6a')](_0x107886,{'transaction':_0x2ef116});}})[_0xd351('0x22')](function(){_0x107886[_0xd351('0x8d')](function(_0x585e94){socket[_0xd351('0x68')](_0xd351('0x6c'),{'UserId':_0x585e94,'VoicePrefixId':_0x1db9db['id']});});});});});});})[_0xd351('0x22')](respondWithStatusCode(_0x24ac40,null))[_0xd351('0x41')](handleError(_0x24ac40,null));}; \ No newline at end of file +var _0x36ee=['show','params','find','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','body','findById','addAgents','spread','ids','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','User','nolimit','getTeams','findOne','Team','findAll','Agents','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','forEach','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','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','destroy','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x3804c3,_0x3a7c96){var _0x44d776=function(_0x2bfeaf){while(--_0x2bfeaf){_0x3804c3['push'](_0x3804c3['shift']());}};_0x44d776(++_0x3a7c96);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'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'];config['redis']=_[_0xe36e('0x19')](config[_0xe36e('0x1a')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require(_0xe36e('0x1c'))(new Redis(config['redis']));require(_0xe36e('0x1d'))['register'](socket);function respondWithStatusCode(_0x525155,_0x27ff47){_0x27ff47=_0x27ff47||0xcc;return function(_0x300f21){if(_0x300f21){return _0x525155[_0xe36e('0x1e')](_0x27ff47);}return _0x525155[_0xe36e('0x1f')](_0x27ff47)[_0xe36e('0x20')]();};}function respondWithResult(_0x924cd5,_0x2096f6){_0x2096f6=_0x2096f6||0xc8;return function(_0x39bae8){if(_0x39bae8){return _0x924cd5[_0xe36e('0x1f')](_0x2096f6)[_0xe36e('0x21')](_0x39bae8);}};}function respondWithFilteredResult(_0x5792e8,_0x333554){return function(_0x2184ae){if(_0x2184ae){var _0x56c019=typeof _0x333554[_0xe36e('0x22')]==='undefined'&&typeof _0x333554[_0xe36e('0x23')]===_0xe36e('0x24');var _0x5e15f5=_0x2184ae[_0xe36e('0x25')];var _0x6aa186=_0x56c019?0x0:_0x333554[_0xe36e('0x22')];var _0x597331=_0x56c019?_0x2184ae[_0xe36e('0x25')]:_0x333554[_0xe36e('0x22')]+_0x333554[_0xe36e('0x23')];var _0x3c4017;if(_0x597331>=_0x5e15f5){_0x597331=_0x5e15f5;_0x3c4017=0xc8;}else{_0x3c4017=0xce;}_0x5792e8[_0xe36e('0x1f')](_0x3c4017);return _0x5792e8[_0xe36e('0x26')]('Content-Range',_0x6aa186+'-'+_0x597331+'/'+_0x5e15f5)[_0xe36e('0x21')](_0x2184ae);}return null;};}function patchUpdates(_0x4f214a){return function(_0x23bcf3){try{jsonpatch[_0xe36e('0x27')](_0x23bcf3,_0x4f214a,!![]);}catch(_0x437f3f){return BPromise['reject'](_0x437f3f);}return _0x23bcf3['save']();};}function saveUpdates(_0x4749a8,_0x10818d){return function(_0xb0cd85){if(_0xb0cd85){return _0xb0cd85[_0xe36e('0x28')](_0x4749a8)[_0xe36e('0x29')](function(_0x1507f9){return _0x1507f9;});}return null;};}function removeEntity(_0x1a045c,_0x5ac484){return function(_0x3cafbf){if(_0x3cafbf){return _0x3cafbf[_0xe36e('0x2a')]()[_0xe36e('0x29')](function(){var _0x262caa=_0x3cafbf['get']({'plain':!![]});var _0x2d757c='VoicePrefixes';return db[_0xe36e('0x2b')]['destroy']({'where':{'type':_0x2d757c,'resourceId':_0x262caa['id']}})[_0xe36e('0x29')](function(){return _0x3cafbf;});})['then'](function(){_0x1a045c[_0xe36e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1045,_0x59548b){return function(_0x4bb75b){if(!_0x4bb75b){_0x3b1045['sendStatus'](0x194);}return _0x4bb75b;};}function handleError(_0x5b5d53,_0x203fa2){_0x203fa2=_0x203fa2||0x1f4;return function(_0x1fc639){logger['error'](_0x1fc639['stack']);if(_0x1fc639[_0xe36e('0x2c')]){delete _0x1fc639[_0xe36e('0x2c')];}_0x5b5d53[_0xe36e('0x1f')](_0x203fa2)[_0xe36e('0x2d')](_0x1fc639);};}exports[_0xe36e('0x2e')]=function(_0x4759b4,_0x57bb9b){var _0xb98e78={},_0x11c95d={},_0x57272f={'count':0x0,'rows':[]};var _0x87e595=_[_0xe36e('0x2f')](db[_0xe36e('0x30')][_0xe36e('0x31')],function(_0x21623e){return{'name':_0x21623e[_0xe36e('0x32')],'type':_0x21623e[_0xe36e('0x33')][_0xe36e('0x34')]};});_0x11c95d[_0xe36e('0x35')]=_[_0xe36e('0x2f')](_0x87e595,_0xe36e('0x2c'));_0x11c95d['query']=_[_0xe36e('0x36')](_0x4759b4['query']);_0x11c95d['filters']=_[_0xe36e('0x37')](_0x11c95d['model'],_0x11c95d[_0xe36e('0x38')]);_0xb98e78[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x11c95d[_0xe36e('0x35')],qs['fields'](_0x4759b4['query'][_0xe36e('0x3a')]));_0xb98e78[_0xe36e('0x39')]=_0xb98e78[_0xe36e('0x39')][_0xe36e('0x3b')]?_0xb98e78['attributes']:_0x11c95d[_0xe36e('0x35')];if(!_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0xb98e78[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x4759b4['query'][_0xe36e('0x23')]);_0xb98e78[_0xe36e('0x22')]=qs[_0xe36e('0x22')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x22')]);}_0xb98e78[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3e')]);_0xb98e78[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x4759b4[_0xe36e('0x38')],_0x11c95d['filters']),_0x87e595);if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]){_0xb98e78[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0xb98e78[_0xe36e('0x3f')],{'$or':_['map'](_0x87e595,function(_0x591e33){if(_0x591e33[_0xe36e('0x33')]!==_0xe36e('0x44')){var _0x1acc12={};_0x1acc12[_0x591e33[_0xe36e('0x2c')]]={'$like':'%'+_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]+'%'};return _0x1acc12;}})});}_0xb98e78=_[_0xe36e('0x43')]({},_0xb98e78,_0x4759b4[_0xe36e('0x45')]);var _0x48066c={'where':_0xb98e78[_0xe36e('0x3f')]};return db[_0xe36e('0x30')]['count'](_0x48066c)[_0xe36e('0x29')](function(_0x5ef3e4){_0x57272f[_0xe36e('0x25')]=_0x5ef3e4;if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x46')]){_0xb98e78[_0xe36e('0x47')]=[{'all':!![]}];}return db[_0xe36e('0x30')]['findAll'](_0xb98e78);})[_0xe36e('0x29')](function(_0x2961c9){_0x57272f[_0xe36e('0x48')]=_0x2961c9;return _0x57272f;})[_0xe36e('0x29')](respondWithFilteredResult(_0x57bb9b,_0xb98e78))[_0xe36e('0x49')](handleError(_0x57bb9b,null));};exports[_0xe36e('0x4a')]=function(_0x569809,_0x122704){var _0x134d71={'raw':![],'where':{'id':_0x569809[_0xe36e('0x4b')]['id']}},_0x2a6817={};_0x2a6817[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x30')][_0xe36e('0x31')]);_0x2a6817[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x569809[_0xe36e('0x38')]);_0x2a6817[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x2a6817[_0xe36e('0x35')],_0x2a6817[_0xe36e('0x38')]);_0x134d71['attributes']=_['intersection'](_0x2a6817[_0xe36e('0x35')],qs['fields'](_0x569809[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x134d71[_0xe36e('0x39')]=_0x134d71[_0xe36e('0x39')]['length']?_0x134d71[_0xe36e('0x39')]:_0x2a6817[_0xe36e('0x35')];if(_0x569809['query'][_0xe36e('0x46')]){_0x134d71[_0xe36e('0x47')]=[{'all':!![]}];}_0x134d71=_[_0xe36e('0x43')]({},_0x134d71,_0x569809[_0xe36e('0x45')]);return db[_0xe36e('0x30')][_0xe36e('0x4c')](_0x134d71)[_0xe36e('0x29')](handleEntityNotFound(_0x122704,null))[_0xe36e('0x29')](respondWithResult(_0x122704,null))[_0xe36e('0x49')](handleError(_0x122704,null));};exports[_0xe36e('0x2a')]=function(_0x7307bc,_0x13ccc5){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x7307bc[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13ccc5,null))[_0xe36e('0x29')](removeEntity(_0x13ccc5,null))['catch'](handleError(_0x13ccc5,null));};exports['describe']=function(_0x10b8ff,_0x3e8ccb){return db['VoicePrefix'][_0xe36e('0x4d')]()[_0xe36e('0x29')](respondWithResult(_0x3e8ccb,null))[_0xe36e('0x49')](handleError(_0x3e8ccb,null));};exports[_0xe36e('0x4e')]=function(_0xa4be24,_0x22788b){var _0x935e84;return db[_0xe36e('0x4f')][_0xe36e('0x50')](function(_0x55d190){return db[_0xe36e('0x30')][_0xe36e('0x4e')](_0xa4be24['body'],{'transaction':_0x55d190})[_0xe36e('0x29')](function(_0x1da952){_0x935e84=_0x1da952[_0xe36e('0x51')]({'plain':!![]});return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x935e84['VoiceExtensionId']},'raw':!![]})['then'](function(_0x56f5b6){return createVoicePrefixExtensions(_0x935e84,_0x56f5b6,_0x55d190);});});})['then'](function(){var _0x47605d=_0xa4be24[_0xe36e('0x53')][_0xe36e('0x51')]({'plain':!![]});if(!_0x47605d)throw new Error(_0xe36e('0x54'));if(_0x47605d[_0xe36e('0x55')]===_0xe36e('0x53')){var _0x7c3766=_0x935e84;return db[_0xe36e('0x56')][_0xe36e('0x4c')]({'where':{'name':'VoicePrefixes','userProfileId':_0x47605d[_0xe36e('0x57')]},'raw':!![]})[_0xe36e('0x29')](function(_0x5a058b){if(_0x5a058b&&_0x5a058b[_0xe36e('0x58')]===0x0){return db[_0xe36e('0x2b')][_0xe36e('0x4e')]({'name':_0x7c3766[_0xe36e('0x2c')],'resourceId':_0x7c3766['id'],'type':_0x5a058b[_0xe36e('0x2c')],'sectionId':_0x5a058b['id']},{})[_0xe36e('0x29')](function(){return _0x935e84;});}else{return _0x935e84;}})[_0xe36e('0x49')](function(_0x1a70d1){logger[_0xe36e('0x59')](_0xe36e('0x5a'),_0x1a70d1);throw _0x1a70d1;});}return _0x935e84;})[_0xe36e('0x29')](respondWithResult(_0x22788b,null))[_0xe36e('0x49')](handleError(_0x22788b,null));};function Extension(_0x389e91,_0x6f979f,_0x3512ec,_0x3e4860){this[_0xe36e('0x5b')]=_0xe36e('0x5c');this[_0xe36e('0x5d')]=_0x389e91;this[_0xe36e('0x5e')]=_0x3512ec;this[_0xe36e('0x33')]=_0xe36e('0x5f');this[_0xe36e('0x60')]=_0xe36e('0x61');this[_0xe36e('0x62')]=_0x6f979f;this['appdata']=_0x3e4860;}function createVoicePrefixExtensions(_0x429a01,_0xedaa96,_0x49336b){return new BPromise(function(_0xce5583,_0x41bad0){var _0x180dc3=new Extension(formatPrefixName(_0x429a01[_0xe36e('0x63')]),0x1,_0xe36e('0x64'),_0xe36e('0x65'));_0x180dc3['VoicePrefixId']=_0x429a01['id'];return db[_0xe36e('0x52')]['create'](_0x180dc3,{'transaction':_0x49336b})[_0xe36e('0x29')](function(_0x1fc1e5){var _0x2b0059=_0x1fc1e5[_0xe36e('0x51')]({'plain':!![]});var _0x2a767d=_[_0xe36e('0x2f')](addVoicePrefixExtensions(_0x429a01,_0xedaa96),function(_0x2ab6aa){_0x2ab6aa[_0xe36e('0x66')]=_0x2b0059['id'];_0x2ab6aa['VoicePrefixId']=_0x429a01['id'];return _0x2ab6aa;});return db[_0xe36e('0x52')][_0xe36e('0x67')](_0x2a767d,{'transaction':_0x49336b})['then'](function(_0x3068e1){if(!_0x3068e1){return _0x41bad0(_0xe36e('0x68'));}else{return _0xce5583(_0x3068e1);}})[_0xe36e('0x49')](function(_0x1e8943){return _0x41bad0(_0x1e8943);});});;});};function addVoicePrefixExtensions(_0x30786a,_0x3565cb){var _0x3d4874=[];var _0x48ff05=formatPrefixName(_0x30786a[_0xe36e('0x63')]);_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x2,_0xe36e('0x6a'),_0xe36e('0x6b')+_0x30786a[_0xe36e('0x2c')]));if(_0x30786a[_0xe36e('0x6c')]){_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,_0xe36e('0x6a'),_0xe36e('0x6d')+_0x30786a[_0xe36e('0x6c')]));}else{_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,'NoOp',_0xe36e('0x6e')));}_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x4,_0xe36e('0x6f'),_0x3565cb[_0xe36e('0x5b')]+','+'${EXTEN:'+(0x8+_0x30786a['name'][_0xe36e('0x3b')])+'}'+','+0x1));return _0x3d4874;}function formatPrefixName(_0x55911b){var _0x585bd5='_';for(var _0x59c454=0x0;_0x59c454<_0x55911b[_0xe36e('0x3b')];_0x59c454++){if(_0x55911b['charAt'](_0x59c454)=='-'){_0x585bd5+=_0x55911b[_0xe36e('0x70')](_0x59c454);}else{_0x585bd5+='['+_0x55911b[_0xe36e('0x70')](_0x59c454)+']';}}_0x585bd5+='.';return _0x585bd5;}exports[_0xe36e('0x28')]=function(_0x221a90,_0x1bd60d,_0x46f789){var _0x11e610=_0x221a90[_0xe36e('0x71')];_0x11e610[_0xe36e('0x63')]='system-'+_0x11e610[_0xe36e('0x2c')]+'-';return db['sequelize'][_0xe36e('0x50')](function(_0x517c2a){return db[_0xe36e('0x30')][_0xe36e('0x28')](_0x11e610,{'where':{'id':_0x11e610['id']},'transaction':_0x517c2a})[_0xe36e('0x29')](function(){return db[_0xe36e('0x52')]['destroy']({'where':{'VoicePrefixId':_0x11e610['id']},'transaction':_0x517c2a})['then'](function(){return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x11e610[_0xe36e('0x66')]},'raw':!![]})[_0xe36e('0x29')](function(_0x3be728){return createVoicePrefixExtensions(_0x11e610,_0x3be728,_0x517c2a);});});});})[_0xe36e('0x29')](function(){return db['VoicePrefix'][_0xe36e('0x72')](_0x11e610['id']);})[_0xe36e('0x29')](respondWithResult(_0x1bd60d,null))['catch'](handleError(_0x1bd60d,null));};exports[_0xe36e('0x73')]=function(_0x5eea4f,_0x45ebca,_0x421c28){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x5eea4f['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x45ebca,null))['then'](function(_0x49a74b){if(_0x49a74b){return _0x49a74b[_0xe36e('0x73')](_0x5eea4f[_0xe36e('0x71')]['ids'],_['omit'](_0x5eea4f[_0xe36e('0x71')],['ids','id'])||{})[_0xe36e('0x74')](function(_0x36ddc0){for(var _0x2c0ed5=0x0;_0x2c0ed5<_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x2c0ed5+=0x1){socket['emit'](_0xe36e('0x76'),{'UserId':Number(_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0x2c0ed5]),'VoicePrefixId':Number(_0x5eea4f[_0xe36e('0x4b')]['id'])});}return _0x36ddc0;});}})['then'](respondWithResult(_0x45ebca,null))[_0xe36e('0x49')](handleError(_0x45ebca,null));};exports[_0xe36e('0x77')]=function(_0x2eef73,_0x39c9fe,_0x5ee201){return db[_0xe36e('0x30')]['find']({'where':{'id':_0x2eef73[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39c9fe,null))[_0xe36e('0x29')](function(_0x522968){if(_0x522968){return _0x522968['removeAgents'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])[_0xe36e('0x29')](function(){if(_['isArray'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])){for(var _0x48e4f5=0x0;_0x48e4f5<_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x48e4f5+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0x48e4f5]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}}else{socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':Number(_0x2eef73['query'][_0xe36e('0x75')]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}});}})[_0xe36e('0x29')](respondWithStatusCode(_0x39c9fe,null))[_0xe36e('0x49')](handleError(_0x39c9fe,null));};exports[_0xe36e('0x7a')]=function(_0x5bdeea,_0x3712f6,_0x24fcf8){var _0x188dc9={};var _0x493d0f={};var _0x25e4eb;var _0x499f0a;return db[_0xe36e('0x30')]['findOne']({'where':{'id':_0x5bdeea[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x3712f6,null))['then'](function(_0x463355){if(_0x463355){_0x25e4eb=_0x463355;_0x493d0f['model']=_[_0xe36e('0x36')](db[_0xe36e('0x7b')][_0xe36e('0x31')]);_0x493d0f[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x5bdeea['query']);_0x493d0f[_0xe36e('0x40')]=_['intersection'](_0x493d0f[_0xe36e('0x35')],_0x493d0f[_0xe36e('0x38')]);_0x188dc9[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493d0f[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x5bdeea['query'][_0xe36e('0x3a')]));_0x188dc9[_0xe36e('0x39')]=_0x188dc9[_0xe36e('0x39')]['length']?_0x188dc9[_0xe36e('0x39')]:_0x493d0f[_0xe36e('0x35')];_0x188dc9[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x5bdeea['query'][_0xe36e('0x3e')]);_0x188dc9['where']=qs[_0xe36e('0x40')](_['pick'](_0x5bdeea[_0xe36e('0x38')],_0x493d0f[_0xe36e('0x40')]));if(_0x5bdeea[_0xe36e('0x38')]['filter']){_0x188dc9[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x188dc9['where'],{'$or':_[_0xe36e('0x2f')](_0x188dc9[_0xe36e('0x39')],function(_0x1f4dd2){var _0x531eac={};_0x531eac[_0x1f4dd2]={'$like':'%'+_0x5bdeea['query'][_0xe36e('0x42')]+'%'};return _0x531eac;})});}_0x188dc9=_[_0xe36e('0x43')]({},_0x188dc9,_0x5bdeea[_0xe36e('0x45')]);return _0x25e4eb[_0xe36e('0x7a')](_0x188dc9);}})[_0xe36e('0x29')](function(_0x5e62f1){if(_0x5e62f1){_0x499f0a=_0x5e62f1[_0xe36e('0x3b')];if(!_0x5bdeea[_0xe36e('0x38')][_0xe36e('0x3c')](_0xe36e('0x7c'))){_0x188dc9['limit']=qs[_0xe36e('0x23')](_0x5bdeea[_0xe36e('0x38')]['limit']);_0x188dc9['offset']=qs['offset'](_0x5bdeea[_0xe36e('0x38')]['offset']);}return _0x25e4eb['getAgents'](_0x188dc9);}})[_0xe36e('0x29')](function(_0x96f37a){if(_0x96f37a){return _0x96f37a?{'count':_0x499f0a,'rows':_0x96f37a}:null;}})[_0xe36e('0x29')](respondWithResult(_0x3712f6,null))[_0xe36e('0x49')](handleError(_0x3712f6,null));};exports[_0xe36e('0x7d')]=function(_0x378126,_0x48fbed,_0x2ebe8e){var _0x4f9354={};var _0x493692={};var _0x4451ec;var _0x21644d;return db[_0xe36e('0x30')][_0xe36e('0x7e')]({'where':{'id':_0x378126['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x48fbed,null))[_0xe36e('0x29')](function(_0x23e62d){if(_0x23e62d){_0x4451ec=_0x23e62d;_0x493692[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x7f')]['rawAttributes']);_0x493692[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x378126[_0xe36e('0x38')]);_0x493692[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x493692['model'],_0x493692[_0xe36e('0x38')]);_0x4f9354[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493692[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x378126[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x4f9354[_0xe36e('0x39')]=_0x4f9354[_0xe36e('0x39')][_0xe36e('0x3b')]?_0x4f9354[_0xe36e('0x39')]:_0x493692[_0xe36e('0x35')];_0x4f9354[_0xe36e('0x3d')]=qs['sort'](_0x378126['query']['sort']);_0x4f9354[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x378126[_0xe36e('0x38')],_0x493692['filters']));if(_0x378126[_0xe36e('0x38')][_0xe36e('0x42')]){_0x4f9354[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x4f9354['where'],{'$or':_[_0xe36e('0x2f')](_0x4f9354[_0xe36e('0x39')],function(_0xdd1816){var _0x18dd36={};_0x18dd36[_0xdd1816]={'$like':'%'+_0x378126['query']['filter']+'%'};return _0x18dd36;})});}_0x4f9354=_[_0xe36e('0x43')]({},_0x4f9354,_0x378126[_0xe36e('0x45')]);return _0x4451ec['getTeams'](_0x4f9354);}})['then'](function(_0x59bf4d){if(_0x59bf4d){_0x21644d=_0x59bf4d[_0xe36e('0x3b')];if(!_0x378126[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0x4f9354[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x378126[_0xe36e('0x38')][_0xe36e('0x23')]);_0x4f9354['offset']=qs[_0xe36e('0x22')](_0x378126[_0xe36e('0x38')][_0xe36e('0x22')]);}return _0x4451ec[_0xe36e('0x7d')](_0x4f9354);}})['then'](function(_0x3de53b){if(_0x3de53b){return _0x3de53b?{'count':_0x21644d,'rows':_0x3de53b}:null;}})['then'](respondWithResult(_0x48fbed,null))[_0xe36e('0x49')](handleError(_0x48fbed,null));};exports['addTeams']=function(_0x1c95cd,_0x2b3e81,_0x498822){var _0x2376b2=_0x1c95cd[_0xe36e('0x71')]['ids'];var _0x179b3f;return db[_0xe36e('0x7f')][_0xe36e('0x80')]({'where':{'id':_0x2376b2},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id',_0xe36e('0x2c'),'online',_0xe36e('0x82'),_0xe36e('0x83')],'raw':!![]}]})['then'](function(_0xda5f86){if(_0xda5f86){_0x179b3f=_0xda5f86;var _0x48e276=_[_0xe36e('0x84')](_0xda5f86,function(_0x7872d5){var _0x2aefd4=_0x7872d5[_0xe36e('0x51')]({'plain':!![]});return _0x2aefd4['Agents'];});return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x1c95cd[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](function(_0x43f149){return db['sequelize'][_0xe36e('0x50')](function(_0x25abc5){return _0x43f149['addTeams'](_0x2376b2,{'transaction':_0x25abc5})['then'](function(){return BPromise[_0xe36e('0x85')](_0x179b3f,function(_0x51c98c){return db[_0xe36e('0x86')][_0xe36e('0x87')]({'TeamId':_0x51c98c['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},{'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){return BPromise[_0xe36e('0x85')](_0x48e276,function(_0x3bd8e1){return db[_0xe36e('0x88')][_0xe36e('0x89')]({'where':{'UserId':_0x3bd8e1['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){_0x48e276['forEach'](function(_0xab0e50){socket['emit'](_0xe36e('0x76'),{'UserId':_0xab0e50['id'],'VoicePrefixId':_0x43f149['id']});});});});});}})[_0xe36e('0x29')](respondWithStatusCode(_0x2b3e81,null))[_0xe36e('0x49')](handleError(_0x2b3e81,null));};exports['removeTeams']=function(_0x3fc054,_0x947053,_0x51c758){return db[_0xe36e('0x7f')]['findAll']({'where':{'id':_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')]},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id'],'raw':!![]}]})[_0xe36e('0x29')](handleEntityNotFound(_0x947053,null))[_0xe36e('0x29')](function(_0x257b00){var _0x2056ed=_[_0xe36e('0x2f')](_0x257b00,'id');var _0x31ae71=[];var _0x166c22=[];var _0x47b082=squel['select']();_0x47b082[_0xe36e('0x8a')](_0xe36e('0x8b'))[_0xe36e('0x8c')](_0xe36e('0x8d'),'tq')['join'](_0xe36e('0x8e'),'ut',_0xe36e('0x8f'))['where'](_0xe36e('0x90'),_0x3fc054['params']['id']);for(var _0x260fff=0x0;_0x260fff<_0x257b00[_0xe36e('0x3b')];_0x260fff+=0x1){let _0x27d09b=_0x257b00[_0x260fff];for(var _0x5bc8b1=0x0;_0x5bc8b1<_0x27d09b[_0xe36e('0x81')][_0xe36e('0x3b')];_0x5bc8b1+=0x1){let _0x2e0e12=_0x27d09b[_0xe36e('0x81')][_0x5bc8b1];var _0x7a5d80=_0x47b082[_0xe36e('0x91')]();_0x7a5d80[_0xe36e('0x3f')]('ut.UserId\x20=\x20?',_0x2e0e12['id']);_0x166c22[_0xe36e('0x69')](db[_0xe36e('0x4f')][_0xe36e('0x38')](_0x7a5d80[_0xe36e('0x92')](),{'type':db[_0xe36e('0x4f')][_0xe36e('0x93')][_0xe36e('0x94')]})[_0xe36e('0x29')](function(_0xacc91e){if(_0xacc91e['length']===0x1){return _0x2e0e12['id'];}else{var _0x3e0dc9=_[_0xe36e('0x95')](_['map'](_0xacc91e,'TeamId'),function(_0x546461){return _[_0xe36e('0x96')](_0x2056ed,_0x546461);});if(_0x3e0dc9){return _0x2e0e12['id'];}}}));}}return BPromise[_0xe36e('0x97')](_0x166c22)['then'](function(_0x20208c){_0x31ae71=_(_0x31ae71)['union'](_0x20208c)['compact']()['value']();return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x3fc054['params']['id']}})[_0xe36e('0x29')](function(_0x2c9191){return db['sequelize'][_0xe36e('0x50')](function(_0x15b38e){return _0x2c9191['removeTeams'](_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')],{'transaction':_0x15b38e})['then'](function(){if(!_['isEmpty'](_0x31ae71)){return _0x2c9191[_0xe36e('0x77')](_0x31ae71,{'transaction':_0x15b38e});}})[_0xe36e('0x29')](function(){_0x31ae71[_0xe36e('0x98')](function(_0x3c7778){socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':_0x3c7778,'VoicePrefixId':_0x2c9191['id']});});});});});});})[_0xe36e('0x29')](respondWithStatusCode(_0x947053,null))[_0xe36e('0x49')](handleError(_0x947053,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a833c56..68d1376 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 _0x37d2=['VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5502a7,_0x325618){var _0x3946fa=function(_0x1c8383){while(--_0x1c8383){_0x5502a7['push'](_0x5502a7['shift']());}};_0x3946fa(++_0x325618);}(_0x37d2,0x148));var _0x237d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x37d2[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x237d('0x0'));var VoicePrefix=require(_0x237d('0x1'))['db'][_0x237d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x237d('0x3')](0x0);var events={'afterCreate':_0x237d('0x4'),'afterUpdate':'update','afterDestroy':_0x237d('0x5')};function emitEvent(_0x16ceee){return function(_0x492aa2,_0x400f11,_0x3489cd){VoicePrefixEvents['emit'](_0x16ceee+':'+_0x492aa2['id'],_0x492aa2);VoicePrefixEvents[_0x237d('0x6')](_0x16ceee,_0x492aa2);_0x3489cd(null);};}for(var e in events){if(events[_0x237d('0x7')](e)){var event=events[e];VoicePrefix[_0x237d('0x8')](e,emitEvent(event));}}module[_0x237d('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x3cb0=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0xdbfa98,_0x54d28c){var _0x12941f=function(_0x1eb451){while(--_0x1eb451){_0xdbfa98['push'](_0xdbfa98['shift']());}};_0x12941f(++_0x54d28c);}(_0x3cb0,0x1d1));var _0x03cb=function(_0x10af2c,_0x13760a){_0x10af2c=_0x10af2c-0x0;var _0x1e1d81=_0x3cb0[_0x10af2c];return _0x1e1d81;};'use strict';var EventEmitter=require(_0x03cb('0x0'));var VoicePrefix=require(_0x03cb('0x1'))['db'][_0x03cb('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x03cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x03cb('0x4'),'afterDestroy':_0x03cb('0x5')};function emitEvent(_0x4b504b){return function(_0x40ea70,_0x339920,_0x56dc67){VoicePrefixEvents['emit'](_0x4b504b+':'+_0x40ea70['id'],_0x40ea70);VoicePrefixEvents[_0x03cb('0x6')](_0x4b504b,_0x40ea70);_0x56dc67(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x03cb('0x7')](e,emitEvent(event));}}module[_0x03cb('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index dbde132..9ae10df 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 _0xf0db=['api','moment','request-promise','path','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0db,0x1ec));var _0xbf0d=function(_0x1cfee8,_0x5b9174){_0x1cfee8=_0x1cfee8-0x0;var _0x32e4c0=_0xf0db[_0x1cfee8];return _0x32e4c0;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var logger=require(_0xbf0d('0x2'))(_0xbf0d('0x3'));var moment=require(_0xbf0d('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf0d('0x5'));var fs=require('fs');var path=require(_0xbf0d('0x6'));var rimraf=require('rimraf');var config=require(_0xbf0d('0x7'));var attributes=require(_0xbf0d('0x8'));module['exports']=function(_0x1e1383,_0x2e966b){return _0x1e1383[_0xbf0d('0x9')](_0xbf0d('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x206c=['bluebird','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x323469,_0x65c556){var _0x4cf8b1=function(_0x845075){while(--_0x845075){_0x323469['push'](_0x323469['shift']());}};_0x4cf8b1(++_0x65c556);}(_0x206c,0x146));var _0xc206=function(_0x5001c4,_0x3b525c){_0x5001c4=_0x5001c4-0x0;var _0x3c558a=_0x206c[_0x5001c4];return _0x3c558a;};'use strict';var _=require(_0xc206('0x0'));var util=require(_0xc206('0x1'));var logger=require(_0xc206('0x2'))('api');var moment=require(_0xc206('0x3'));var BPromise=require(_0xc206('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc206('0x5'));var config=require(_0xc206('0x6'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x45627b,_0x2a22c7){return _0x45627b[_0xc206('0x7')](_0xc206('0x8'),attributes,{'tableName':_0xc206('0x9'),'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 5d58aac..dbc1767 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 _0x22b4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x228e84,_0x54e9ea){var _0x488e05=function(_0x2ba1f2){while(--_0x2ba1f2){_0x228e84['push'](_0x228e84['shift']());}};_0x488e05(++_0x54e9ea);}(_0x22b4,0x8b));var _0x422b=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x22b4[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x422b('0x0'));var util=require(_0x422b('0x1'));var moment=require(_0x422b('0x2'));var BPromise=require(_0x422b('0x3'));var rs=require(_0x422b('0x4'));var fs=require('fs');var Redis=require(_0x422b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x422b('0x6'));var logger=require(_0x422b('0x7'))('rpc');var config=require(_0x422b('0x8'));var jayson=require(_0x422b('0x9'));var client=jayson[_0x422b('0xa')][_0x422b('0xb')]({'port':0x232a});config[_0x422b('0xc')]=_[_0x422b('0xd')](config['redis'],{'host':_0x422b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x422b('0xc')]));require(_0x422b('0xf'))[_0x422b('0x10')](socket);function respondWithRpcPromise(_0x13e837,_0x2223a5,_0x42bcfa){return new BPromise(function(_0x552298,_0x3bfc9a){return client[_0x422b('0x11')](_0x13e837,_0x42bcfa)[_0x422b('0x12')](function(_0x419b65){logger[_0x422b('0x13')](_0x422b('0x14'),_0x2223a5,_0x422b('0x15'));logger[_0x422b('0x16')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2223a5,'request\x20sent',JSON[_0x422b('0x17')](_0x419b65));if(_0x419b65[_0x422b('0x18')]){if(_0x419b65[_0x422b('0x18')][_0x422b('0x19')]===0x1f4){logger[_0x422b('0x18')](_0x422b('0x14'),_0x2223a5,_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);return _0x3bfc9a(_0x419b65['error'][_0x422b('0x1a')]);}logger['error'](_0x422b('0x14'),_0x2223a5,_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);return _0x552298(_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);}else{logger[_0x422b('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x2223a5,_0x422b('0x15'));_0x552298(_0x419b65[_0x422b('0x1b')][_0x422b('0x1a')]);}})['catch'](function(_0x131330){logger[_0x422b('0x18')](_0x422b('0x14'),_0x2223a5,_0x131330);_0x3bfc9a(_0x131330);});});} \ No newline at end of file +var _0x9af6=['then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x1e6f48,_0x499c17){var _0xe3b642=function(_0x182d85){while(--_0x182d85){_0x1e6f48['push'](_0x1e6f48['shift']());}};_0xe3b642(++_0x499c17);}(_0x9af6,0x1d7));var _0x69af=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x9af6[_0x2e913b];return _0x173899;};'use strict';var _=require(_0x69af('0x0'));var util=require(_0x69af('0x1'));var moment=require(_0x69af('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69af('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x69af('0x4'))(_0x69af('0x5'));var config=require(_0x69af('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x69af('0x7')]['http']({'port':0x232a});config[_0x69af('0x8')]=_[_0x69af('0x9')](config[_0x69af('0x8')],{'host':_0x69af('0xa'),'port':0x18eb});var socket=require(_0x69af('0xb'))(new Redis(config[_0x69af('0x8')]));require(_0x69af('0xc'))[_0x69af('0xd')](socket);function respondWithRpcPromise(_0x59bc56,_0x5e42ea,_0x1dd1c2){return new BPromise(function(_0x19f2f7,_0x742a9c){return client[_0x69af('0xe')](_0x59bc56,_0x1dd1c2)[_0x69af('0xf')](function(_0x351143){logger[_0x69af('0x10')](_0x69af('0x11'),_0x5e42ea,'request\x20sent');logger[_0x69af('0x12')](_0x69af('0x13'),_0x5e42ea,_0x69af('0x14'),JSON[_0x69af('0x15')](_0x351143));if(_0x351143['error']){if(_0x351143[_0x69af('0x16')][_0x69af('0x17')]===0x1f4){logger[_0x69af('0x16')](_0x69af('0x11'),_0x5e42ea,_0x351143[_0x69af('0x16')][_0x69af('0x18')]);return _0x742a9c(_0x351143[_0x69af('0x16')][_0x69af('0x18')]);}logger['error'](_0x69af('0x11'),_0x5e42ea,_0x351143[_0x69af('0x16')][_0x69af('0x18')]);return _0x19f2f7(_0x351143[_0x69af('0x16')][_0x69af('0x18')]);}else{logger[_0x69af('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x5e42ea,_0x69af('0x14'));_0x19f2f7(_0x351143[_0x69af('0x19')][_0x69af('0x18')]);}})[_0x69af('0x1a')](function(_0x244594){logger[_0x69af('0x16')](_0x69af('0x11'),_0x5e42ea,_0x244594);_0x742a9c(_0x244594);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a93f2f1..83fe00d 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 _0x2bdb=['voicePrefix:','./voicePrefix.events','remove','removeListener','register'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x2bdb,0x105));var _0xb2bd=function(_0x48304d,_0x27d4a8){_0x48304d=_0x48304d-0x0;var _0x48660f=_0x2bdb[_0x48304d];return _0x48660f;};'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 +var _0x1948=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x1948,0x145));var _0x8194=function(_0x32c8bb,_0x200e4c){_0x32c8bb=_0x32c8bb-0x0;var _0x22f3ce=_0x1948[_0x32c8bb];return _0x22f3ce;};'use strict';var VoicePrefixEvents=require(_0x8194('0x0'));var events=[_0x8194('0x1'),_0x8194('0x2'),_0x8194('0x3')];function createListener(_0x196370,_0x4d5815){return function(_0x14a887){_0x4d5815[_0x8194('0x4')](_0x196370,_0x14a887);};}function removeListener(_0x152b72,_0x332d2f){return function(){VoicePrefixEvents[_0x8194('0x5')](_0x152b72,_0x332d2f);};}exports[_0x8194('0x6')]=function(_0x2a3372){for(var _0x23f556=0x0,_0x521ed0=events[_0x8194('0x7')];_0x23f556<_0x521ed0;_0x23f556++){var _0x104856=events[_0x23f556];var _0x4f32ce=createListener(_0x8194('0x8')+_0x104856,_0x2a3372);VoicePrefixEvents['on'](_0x104856,_0x4f32ce);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 72ee74d..89dc18f 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(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xb10b,0x12a));var _0xbb10=function(_0x40632e,_0x1f7f8f){_0x40632e=_0x40632e-0x0;var _0x3708c4=_0xb10b[_0x40632e];return _0x3708c4;};'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(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0xb10b,0x12a));var _0xbb10=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0xb10b[_0x35af23];return _0x340506;};'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 2806e78..934726c 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 _0x2c21=['yes','all','TEXT','setDataValue','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\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','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','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER'];(function(_0x1f3d10,_0x565566){var _0x261e8d=function(_0x49464c){while(--_0x49464c){_0x1f3d10['push'](_0x1f3d10['shift']());}};_0x261e8d(++_0x565566);}(_0x2c21,0xf0));var _0x12c2=function(_0x334524,_0x1fca82){_0x334524=_0x334524-0x0;var _0x870ae9=_0x2c21[_0x334524];return _0x870ae9;};'use strict';var Sequelize=require('sequelize');module[_0x12c2('0x0')]={'name':{'type':Sequelize[_0x12c2('0x1')],'allowNull':![],'unique':_0x12c2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x4'),_0x12c2('0x5')),'allowNull':![],'defaultValue':_0x12c2('0x4')},'musiconhold':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':_0x12c2('0x6')},'announce':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x12c2('0x3')]('rr',_0x12c2('0x7'),_0x12c2('0x8'),_0x12c2('0x9'),_0x12c2('0xa'),_0x12c2('0xb'),_0x12c2('0xc'),_0x12c2('0xd'),_0x12c2('0xe')),'allowNull':![],'defaultValue':_0x12c2('0x7'),'set':function(_0x4dbcab){this['setDataValue'](_0x12c2('0xf'),_0x4dbcab?_0x4dbcab:_0x12c2('0xb'));},'get':function(){var _0x3556ea=this[_0x12c2('0x10')](_0x12c2('0x11'));var _0x2f21c7=this['getDataValue'](_0x12c2('0x12'));var _0xd74148=this[_0x12c2('0x10')](_0x12c2('0xf'));if(_0x3556ea===_0x12c2('0x5')){if(_0x2f21c7===_0x12c2('0x13')){return null;}if(_0x2f21c7===_0x12c2('0x14')&&!['rrmemory',_0x12c2('0x15')][_0x12c2('0x16')](_0xd74148)){this['setDataValue'](_0x12c2('0xf'),_0x12c2('0xb'));}}return _0xd74148;}},'servicelevel':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x12c2('0x17')](0xb)},'timeout':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x12c2('0x1')]},'weight':{'type':Sequelize[_0x12c2('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x12c2('0x18'),'no'),'defaultValue':_0x12c2('0x18')},'autopause':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no',_0x12c2('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x12c2('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x12c2('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x12c2('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x12c2('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no'),'defaultValue':_0x12c2('0x18')},'announce_holdtime':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x12c2('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x12c2('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x12c2('0x1')]},'queue_youarenext':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x12c2('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x12c2('0x1')]},'queue_quantity1':{'type':Sequelize[_0x12c2('0x1')]},'queue_quantity2':{'type':Sequelize[_0x12c2('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x12c2('0x1')]},'queue_less_than':{'type':Sequelize[_0x12c2('0x1')]},'periodic_announce':{'type':Sequelize[_0x12c2('0x1a')],'set':function(_0x3dcf86){this[_0x12c2('0x1b')]('periodic_announce',_0x3dcf86?_0x3dcf86[_0x12c2('0x1c')](','):[]);},'get':function(){return this[_0x12c2('0x10')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0x12c2('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':_0x12c2('0x18'),'set':function(_0x46a57f){this['setDataValue'](_0x12c2('0x1e'),_0x46a57f?_0x46a57f[_0x12c2('0x1c')](','):undefined);},'get':function(){return this[_0x12c2('0x10')](_0x12c2('0x1e'))?this['getDataValue']('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':'no','set':function(_0x8eb187){this[_0x12c2('0x1b')](_0x12c2('0x1f'),_0x8eb187?_0x8eb187[_0x12c2('0x1c')](','):undefined);},'get':function(){return this[_0x12c2('0x10')](_0x12c2('0x1f'))?this[_0x12c2('0x10')](_0x12c2('0x1f'))[_0x12c2('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x12c2('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x12c2('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x12c2('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x12c2('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x12c2('0x1')]},'description':{'type':Sequelize[_0x12c2('0x1')]},'acw':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':0x0,'set':function(_0x12d53c){this['setDataValue'](_0x12c2('0x21'),_0x12d53c);if(_0x12d53c){if(this[_0x12c2('0x10')]('wrapuptime')<0x2){this[_0x12c2('0x1b')](_0x12c2('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x12c2('0x23')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x12c2('0x24'),_0x12c2('0x25'),'predictive','booked'),'defaultValue':_0x12c2('0x24'),'comment':_0x12c2('0x26')},'dialLimitChannel':{'type':Sequelize[_0x12c2('0x17')](0x4)[_0x12c2('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x12c2('0x28')},'dialLimitQueue':{'type':Sequelize[_0x12c2('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x12c2('0x29')},'dialPowerLevel':{'type':Sequelize[_0x12c2('0x2a')](0x2)[_0x12c2('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x12c2('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x2c'),'dropRate'),'defaultValue':_0x12c2('0x2d'),'comment':_0x12c2('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x12c2('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x12c2('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0x12c2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x12c2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x12c2('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x31')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x12c2('0x32'),'comment':_0x12c2('0x33')},'dialQueueTimeout':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x34')},'dialQueueProject':{'type':Sequelize[_0x12c2('0x1')],'comment':_0x12c2('0x35')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x36')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x37')},'dialBusyRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x38')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'comment':_0x12c2('0x39')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x3a')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x12c2('0x3b')},'dialTimezone':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':_0x12c2('0x3c')},'dialPrefix':{'type':Sequelize[_0x12c2('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x3d'),'never','onlyIfOpen'),'defaultValue':_0x12c2('0x3d')},'dialAMDActive':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':0x0,'comment':_0x12c2('0x3e')},'dialAMDInitialSilence':{'type':Sequelize[_0x12c2('0x17')](0x9)[_0x12c2('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x12c2('0x3f')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x12c2('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x12c2('0x40')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x12c2('0x17')](0x9)[_0x12c2('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x12c2('0x41')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x12c2('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x12c2('0x17')](0x9)[_0x12c2('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x12c2('0x43')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x12c2('0x17')](0x9)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x12c2('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x12c2('0x45')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x12c2('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x12c2('0x46')},'dialRecallMeTimeout':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x12c2('0x47')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x12c2('0x3')](_0x12c2('0x48'),_0x12c2('0x49')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x12c2('0x1')],'comment':_0x12c2('0x35')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x12c2('0x4a')},'dialCutDigit':{'type':Sequelize[_0x12c2('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x12c2('0x4b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x4c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x4d')},'dialDropMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x4e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x4f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x50')},'dialMachineMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x51')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x52')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x12c2('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x12c2('0x53')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x12c2('0x17')](0x5)[_0x12c2('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x12c2('0x54')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':![],'comment':_0x12c2('0x55'),'set':function(_0x20970e){if(!_0x20970e)this[_0x12c2('0x1b')](_0x12c2('0x56'),null);this['setDataValue'](_0x12c2('0x57'),_0x20970e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x12c2('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x12c2('0x17')](0x3)[_0x12c2('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x12c2('0x20')],'defaultValue':![]}}; \ No newline at end of file +var _0x3f14=['Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','inbound','default','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','strategy','type','dialMethod','getDataValue','outbound','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','all','once','periodic_announce','split','joinempty','leavewhenempty','acw','BOOLEAN','progressive','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'];(function(_0x37cbc3,_0x5a490d){var _0x171986=function(_0x281ce8){while(--_0x281ce8){_0x37cbc3['push'](_0x37cbc3['shift']());}};_0x171986(++_0x5a490d);}(_0x3f14,0x165));var _0x43f1=function(_0x284a24,_0xebce8f){_0x284a24=_0x284a24-0x0;var _0x2dfdad=_0x3f14[_0x284a24];return _0x2dfdad;};'use strict';var Sequelize=require(_0x43f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x43f1('0x1')],'allowNull':![],'unique':_0x43f1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x43f1('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x43f1('0x3')},'musiconhold':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':_0x43f1('0x4')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x43f1('0x5')]('rr',_0x43f1('0x6'),_0x43f1('0x7'),_0x43f1('0x8'),_0x43f1('0x9'),_0x43f1('0xa'),_0x43f1('0xb'),_0x43f1('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x43f1('0x6'),'set':function(_0x4cc793){this['setDataValue'](_0x43f1('0xd'),_0x4cc793?_0x4cc793:_0x43f1('0xa'));},'get':function(){var _0x4f15eb=this['getDataValue'](_0x43f1('0xe'));var _0x12a7a2=this['getDataValue'](_0x43f1('0xf'));var _0x4cca90=this[_0x43f1('0x10')](_0x43f1('0xd'));if(_0x4f15eb===_0x43f1('0x11')){if(_0x12a7a2===_0x43f1('0x12')){return null;}if(_0x12a7a2===_0x43f1('0x13')&&!['rrmemory',_0x43f1('0x14')][_0x43f1('0x15')](_0x4cca90)){this[_0x43f1('0x16')](_0x43f1('0xd'),'rrmemory');}}return _0x4cca90;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x43f1('0x17')](0xb)},'timeout':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x43f1('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no'),'defaultValue':_0x43f1('0x18')},'autopause':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no',_0x43f1('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x43f1('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x43f1('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x43f1('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x43f1('0x5')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no'),'defaultValue':_0x43f1('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no',_0x43f1('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x43f1('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x43f1('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x43f1('0x1')]},'queue_quantity1':{'type':Sequelize[_0x43f1('0x1')]},'queue_quantity2':{'type':Sequelize[_0x43f1('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x43f1('0x1')]},'queue_less_than':{'type':Sequelize[_0x43f1('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2caa74){this[_0x43f1('0x16')](_0x43f1('0x1b'),_0x2caa74?_0x2caa74['join'](','):[]);},'get':function(){return this[_0x43f1('0x10')](_0x43f1('0x1b'))?this['getDataValue']('periodic_announce')[_0x43f1('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':_0x43f1('0x18'),'set':function(_0x28c3e8){this[_0x43f1('0x16')]('joinempty',_0x28c3e8?_0x28c3e8['join'](','):undefined);},'get':function(){return this[_0x43f1('0x10')](_0x43f1('0x1d'))?this['getDataValue'](_0x43f1('0x1d'))[_0x43f1('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':'no','set':function(_0x11eb37){this['setDataValue'](_0x43f1('0x1e'),_0x11eb37?_0x11eb37['join'](','):undefined);},'get':function(){return this[_0x43f1('0x10')](_0x43f1('0x1e'))?this['getDataValue'](_0x43f1('0x1e'))[_0x43f1('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x43f1('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x43f1('0x1')]},'description':{'type':Sequelize[_0x43f1('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x4f5e6f){this[_0x43f1('0x16')](_0x43f1('0x1f'),_0x4f5e6f);if(_0x4f5e6f){if(this[_0x43f1('0x10')]('wrapuptime')<0x2){this[_0x43f1('0x16')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x43f1('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x12'),_0x43f1('0x21'),'power',_0x43f1('0x22'),_0x43f1('0x13')),'defaultValue':_0x43f1('0x21'),'comment':_0x43f1('0x23')},'dialLimitChannel':{'type':Sequelize[_0x43f1('0x17')](0x4)[_0x43f1('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x43f1('0x25')},'dialLimitQueue':{'type':Sequelize[_0x43f1('0x17')](0x4)[_0x43f1('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x43f1('0x26')},'dialPowerLevel':{'type':Sequelize[_0x43f1('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x43f1('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x43f1('0x29'),'dropRate'),'defaultValue':_0x43f1('0x2a'),'comment':_0x43f1('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x43f1('0x27')](0x2)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x43f1('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x43f1('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x43f1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x43f1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':_0x43f1('0x2e'),'comment':_0x43f1('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x43f1('0x30')},'dialQueueProject':{'type':Sequelize[_0x43f1('0x1')],'comment':_0x43f1('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x43f1('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x43f1('0x17')](0x5)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'comment':_0x43f1('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x43f1('0x17')](0x5)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x43f1('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':_0x43f1('0x37')},'dialPrefix':{'type':Sequelize[_0x43f1('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x38'),_0x43f1('0x39'),_0x43f1('0x3a')),'defaultValue':_0x43f1('0x38')},'dialAMDActive':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x43f1('0x17')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x43f1('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x43f1('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x43f1('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x43f1('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x43f1('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x43f1('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x43f1('0x17')](0x9)[_0x43f1('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x43f1('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x43f1('0x17')](0x5)[_0x43f1('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':0x0,'comment':_0x43f1('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x43f1('0x5')](_0x43f1('0x42'),_0x43f1('0x43')),'defaultValue':_0x43f1('0x42')},'dialQueueProject2':{'type':Sequelize[_0x43f1('0x1')],'comment':_0x43f1('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x43f1('0x44')},'dialCutDigit':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x43f1('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x43f1('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x43f1('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x43f1('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x43f1('0x17')](0x5)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x43f1('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x43f1('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x43f1('0x17')](0x5)[_0x43f1('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x43f1('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x43f1('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':![],'comment':_0x43f1('0x4d'),'set':function(_0x5b9e69){if(!_0x5b9e69)this[_0x43f1('0x16')](_0x43f1('0x4e'),null);this[_0x43f1('0x16')](_0x43f1('0x4f'),_0x5b9e69);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x43f1('0x17')](0x3)[_0x43f1('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x43f1('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x43f1('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 96156dc..1c6e356 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 _0x3e74=['phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','UserProfileResource','sendStatus','stack','name','status','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','clone','params','keys','omit','updatedAt','createdAt','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','sort','filters','pick','VoiceQueueId','options','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','phone','scheduledAt','field','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x2c2ffb,_0x4e0365){var _0x2dfbce=function(_0x2d45cc){while(--_0x2d45cc){_0x2c2ffb['push'](_0x2c2ffb['shift']());}};_0x2dfbce(++_0x4e0365);}(_0x3e74,0x175));var _0x43e7=function(_0x4cadc2,_0x139406){_0x4cadc2=_0x4cadc2-0x0;var _0x1fb838=_0x3e74[_0x4cadc2];return _0x1fb838;};'use strict';var moment=require(_0x43e7('0x0'));var BPromise=require('bluebird');var util=require(_0x43e7('0x1'));var _=require(_0x43e7('0x2'));var squel=require(_0x43e7('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0x4'))('api');var config=require(_0x43e7('0x5'));var db=require(_0x43e7('0x6'))['db'];config[_0x43e7('0x7')]=_[_0x43e7('0x8')](config[_0x43e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x43e7('0x9'))(new Redis(config[_0x43e7('0x7')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);function respondWithStatusCode(_0x21f491,_0x516b4d){_0x516b4d=_0x516b4d||0xcc;return function(_0x212c6c){if(_0x212c6c){return _0x21f491['sendStatus'](_0x516b4d);}return _0x21f491['status'](_0x516b4d)[_0x43e7('0xc')]();};}function respondWithResult(_0x4139c9,_0x5c34f4){_0x5c34f4=_0x5c34f4||0xc8;return function(_0x2803d9){if(_0x2803d9){return _0x4139c9['status'](_0x5c34f4)[_0x43e7('0xd')](_0x2803d9);}};}function respondWithFilteredResult(_0x37302c,_0x4ebc8e){return function(_0x3eb206){if(_0x3eb206){var _0xc960ea=typeof _0x4ebc8e[_0x43e7('0xe')]===_0x43e7('0xf')&&typeof _0x4ebc8e['limit']==='undefined';var _0x2fcb36=_0x3eb206[_0x43e7('0x10')];var _0x44b0bd=_0xc960ea?0x0:_0x4ebc8e['offset'];var _0x5e641c=_0xc960ea?_0x3eb206[_0x43e7('0x10')]:_0x4ebc8e[_0x43e7('0xe')]+_0x4ebc8e[_0x43e7('0x11')];var _0x328445;if(_0x5e641c>=_0x2fcb36){_0x5e641c=_0x2fcb36;_0x328445=0xc8;}else{_0x328445=0xce;}_0x37302c['status'](_0x328445);return _0x37302c['set'](_0x43e7('0x12'),_0x44b0bd+'-'+_0x5e641c+'/'+_0x2fcb36)[_0x43e7('0xd')](_0x3eb206);}return null;};}function saveUpdates(_0x273a32){return function(_0x5d346f){if(_0x5d346f){return _0x5d346f['update'](_0x273a32)[_0x43e7('0x13')](function(_0x1ca758){return _0x1ca758;});}return null;};}function removeEntity(_0x9037d3){return function(_0x140657){if(_0x140657){return _0x140657[_0x43e7('0x14')]()[_0x43e7('0x13')](function(){var _0x619236=_0x140657[_0x43e7('0x15')]({'plain':!![]});var _0x2377a3=[{'name':_0x43e7('0x16'),'value':_0x43e7('0x17'),'ignore':![]},{'name':_0x43e7('0x18'),'value':'outbound','ignore':![]}];var _0xef1a5a=_(_0x2377a3)[_0x43e7('0x19')]('ignore')[_0x43e7('0x1a')](_0x43e7('0x1b'))[_0x43e7('0x1b')]();if(_[_0x43e7('0x1c')](_0xef1a5a,_0x619236[_0x43e7('0x1d')])){return;}var _0x2f4cb4=_['find'](_0x2377a3,[_0x43e7('0x1b'),_0x619236['type']])['name'];return db[_0x43e7('0x1e')][_0x43e7('0x14')]({'where':{'type':_0x2f4cb4,'resourceId':_0x619236['id']}})['then'](function(){return _0x140657;});})[_0x43e7('0x13')](function(){_0x9037d3['status'](0xcc)[_0x43e7('0xc')]();});}};}function handleEntityNotFound(_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x5c5e67[_0x43e7('0x1f')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x20')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x21')];}_0x20888b[_0x43e7('0x22')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={};var _0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x1a')](db[_0x43e7('0x25')][_0x43e7('0x26')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x27')],'type':_0x31b2a6[_0x43e7('0x1d')][_0x43e7('0x28')]};});_0x4690a6=qs[_0x43e7('0x29')](_0x50f9f5,_0x5087d7);var _0x2bde44={'where':_0x4690a6[_0x43e7('0x2a')]};return db['VoiceQueue'][_0x43e7('0x10')](_0x2bde44)[_0x43e7('0x13')](function(_0x3b8f78){_0x45b675[_0x43e7('0x10')]=_0x3b8f78;_0x4690a6[_0x43e7('0x2b')]=qs['include'](_0x5087d7[_0x43e7('0x2c')]);return db[_0x43e7('0x25')][_0x43e7('0x2d')](_0x4690a6);})[_0x43e7('0x13')](function(_0x4c61b9){_0x45b675['rows']=_0x4c61b9;return _0x45b675;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x2e')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x2f')]=function(_0x117c07,_0x234fe6){var _0x108313={'raw':![],'where':{'id':_0x117c07['params']['id']}},_0xde7ed={};_0xde7ed['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0xde7ed['query']=_['keys'](_0x117c07[_0x43e7('0x2c')]);_0xde7ed['filters']=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],_0xde7ed[_0x43e7('0x2c')]);_0x108313[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x117c07['query']['fields']));_0x108313['attributes']=_0x108313[_0x43e7('0x32')][_0x43e7('0x34')]?_0x108313[_0x43e7('0x32')]:_0xde7ed[_0x43e7('0x31')];if(_0x117c07[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x108313[_0x43e7('0x2b')]=[{'all':!![]}];}_0x108313=_[_0x43e7('0x36')]({},_0x108313,_0x117c07['options']);return db[_0x43e7('0x25')][_0x43e7('0x37')](_0x108313)['then'](handleEntityNotFound(_0x234fe6,null))[_0x43e7('0x13')](respondWithResult(_0x234fe6,null))['catch'](handleError(_0x234fe6,null));};exports[_0x43e7('0x38')]=function(_0x2ad008,_0x1c6f45){return db[_0x43e7('0x25')][_0x43e7('0x38')](_0x2ad008[_0x43e7('0x39')],{})['then'](function(_0x574a93){var _0x30dfa9=_0x2ad008[_0x43e7('0x3a')][_0x43e7('0x15')]({'plain':!![]});if(!_0x30dfa9)throw new Error(_0x43e7('0x3b'));if(_0x30dfa9[_0x43e7('0x3c')]==='user'){var _0x32a451=_0x574a93[_0x43e7('0x15')]({'plain':!![]});var _0x575439=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':_0x43e7('0x18'),'value':'outbound'}];var _0x3d81ae=_[_0x43e7('0x37')](_0x575439,[_0x43e7('0x1b'),_0x32a451[_0x43e7('0x1d')]])['name'];return db['UserProfileSection'][_0x43e7('0x37')]({'where':{'name':_0x3d81ae,'userProfileId':_0x30dfa9[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x36b770){if(_0x36b770&&_0x36b770['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a451[_0x43e7('0x21')],'resourceId':_0x32a451['id'],'type':_0x36b770['name'],'sectionId':_0x36b770['id']},{})[_0x43e7('0x13')](function(){return _0x574a93;});}else{return _0x574a93;}})['catch'](function(_0x5b28db){logger[_0x43e7('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b28db);throw _0x5b28db;});}return _0x574a93;})[_0x43e7('0x13')](respondWithResult(_0x1c6f45,0xc9))[_0x43e7('0x2e')](handleError(_0x1c6f45,null));};exports[_0x43e7('0x3f')]=function(_0x99b9e1,_0x4fc5e8){var _0x91f1e4={'where':{'id':_0x99b9e1[_0x43e7('0x40')]['id']}},_0x2b9046={};_0x2b9046[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x25')]['rawAttributes']);_0x91f1e4['attributes']=_[_0x43e7('0x30')](_0x2b9046[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x99b9e1['query']['fields']));_0x91f1e4['attributes']=_0x91f1e4[_0x43e7('0x32')][_0x43e7('0x34')]?_0x91f1e4['attributes']:_0x2b9046[_0x43e7('0x31')];if(_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x91f1e4['include']=[{'all':!![]}];}_0x91f1e4=_['merge']({},_0x91f1e4,_0x99b9e1['options']);return db['VoiceQueue'][_0x43e7('0x37')](_0x91f1e4)[_0x43e7('0x13')](handleEntityNotFound(_0x4fc5e8,null))['then'](function(_0x23e7cb){if(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x15')]({'plain':!![]});_0x82d32f=qs[_0x43e7('0x42')](_0x82d32f,['id','createdAt',_0x43e7('0x43')]);_0x99b9e1['body']=_['omit'](_0x99b9e1[_0x43e7('0x39')],['id',_0x43e7('0x44'),_0x43e7('0x43')]);return db[_0x43e7('0x25')][_0x43e7('0x38')](_[_0x43e7('0x36')](_0x82d32f,_0x99b9e1[_0x43e7('0x39')]),{'include':_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]?[{'all':!![]}]:undefined})[_0x43e7('0x13')](function(_0x58dfd0){var _0x119d34=_0x99b9e1[_0x43e7('0x3a')]['get']({'plain':!![]});if(!_0x119d34)throw new Error(_0x43e7('0x3b'));if(_0x119d34['role']===_0x43e7('0x3a')){var _0x520857=_0x58dfd0[_0x43e7('0x15')]({'plain':!![]});var _0x1f561f=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43e7('0x45')}];var _0x2ab7ee=_[_0x43e7('0x37')](_0x1f561f,[_0x43e7('0x1b'),_0x520857[_0x43e7('0x1d')]])[_0x43e7('0x21')];return db[_0x43e7('0x46')][_0x43e7('0x37')]({'where':{'name':_0x2ab7ee,'userProfileId':_0x119d34[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x312306){if(_0x312306&&_0x312306['autoAssociation']===0x0){return db[_0x43e7('0x1e')][_0x43e7('0x38')]({'name':_0x520857['name'],'resourceId':_0x520857['id'],'type':_0x312306[_0x43e7('0x21')],'sectionId':_0x312306['id']},{})[_0x43e7('0x13')](function(){return _0x58dfd0;});}else{return _0x58dfd0;}})[_0x43e7('0x2e')](function(_0x558d54){logger['error'](_0x43e7('0x47'),_0x558d54);throw _0x558d54;});}return _0x58dfd0;});}})[_0x43e7('0x13')](respondWithResult(_0x4fc5e8,0xc9))['catch'](handleError(_0x4fc5e8,null));};exports[_0x43e7('0x48')]=function(_0x54506d,_0x49a6ce){if(_0x54506d[_0x43e7('0x39')]['id']){delete _0x54506d[_0x43e7('0x39')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x54506d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ce,null))[_0x43e7('0x13')](saveUpdates(_0x54506d[_0x43e7('0x39')],null))['then'](respondWithResult(_0x49a6ce,null))[_0x43e7('0x2e')](handleError(_0x49a6ce,null));};exports[_0x43e7('0x14')]=function(_0x296a0d,_0x5bb536){return db['VoiceQueue']['find']({'where':{'id':_0x296a0d[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x5bb536,null))[_0x43e7('0x13')](removeEntity(_0x5bb536,null))[_0x43e7('0x2e')](handleError(_0x5bb536,null));};exports['getHoppers']=function(_0x5a50fc,_0x1b27da){var _0x8b50bb={'raw':![],'where':{}};var _0x140438={};var _0x5dd349={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x5a50fc[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1b27da,null))[_0x43e7('0x13')](function(_0x3369b8){if(_0x3369b8){_0x140438[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x4a')][_0x43e7('0x26')]);_0x140438[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x5a50fc['query']);_0x140438['filters']=_[_0x43e7('0x30')](_0x140438['model'],_0x140438['query']);_0x8b50bb['attributes']=_[_0x43e7('0x30')](_0x140438[_0x43e7('0x31')],qs['fields'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x8b50bb[_0x43e7('0x32')]=_0x8b50bb['attributes'][_0x43e7('0x34')]?_0x8b50bb[_0x43e7('0x32')]:_0x140438[_0x43e7('0x31')];if(!_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x8b50bb[_0x43e7('0x11')]=qs['limit'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x8b50bb[_0x43e7('0xe')]=qs['offset'](_0x5a50fc['query'][_0x43e7('0xe')]);}_0x8b50bb['order']=qs['sort'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x8b50bb['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x5a50fc[_0x43e7('0x2c')],_0x140438[_0x43e7('0x4e')]));_0x8b50bb[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x3369b8['id'];if(_0x5a50fc[_0x43e7('0x2c')]['filter']){_0x8b50bb[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x8b50bb['where'],{'$or':_[_0x43e7('0x1a')](_0x8b50bb['attributes'],function(_0x26ee52){var _0x248936={};_0x248936[_0x26ee52]={'$like':'%'+_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x248936;})});}_0x8b50bb=_['merge']({},_0x8b50bb,_0x5a50fc[_0x43e7('0x51')]);return db[_0x43e7('0x4a')][_0x43e7('0x10')]({'where':_0x8b50bb['where']})[_0x43e7('0x13')](function(_0x38fa5b){_0x5dd349[_0x43e7('0x10')]=_0x38fa5b;if(_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x8b50bb['include']=[{'all':!![]}];}return db[_0x43e7('0x4a')][_0x43e7('0x2d')](_0x8b50bb);})[_0x43e7('0x13')](function(_0x2499ef){_0x5dd349[_0x43e7('0x52')]=_0x2499ef;return _0x5dd349;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x1b27da,_0x8b50bb))[_0x43e7('0x2e')](handleError(_0x1b27da,null));};exports['getHopperHistories']=function(_0x499ee9,_0x405faa){var _0x536477={'raw':!![],'where':{}};var _0x550036={};var _0x5b98bf={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x499ee9[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x13')](function(_0x1ae0c8){if(_0x1ae0c8){_0x550036['model']=_[_0x43e7('0x41')](db[_0x43e7('0x53')][_0x43e7('0x26')]);_0x550036['query']=_[_0x43e7('0x41')](_0x499ee9[_0x43e7('0x2c')]);_0x550036[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x550036[_0x43e7('0x31')],_0x550036[_0x43e7('0x2c')]);_0x536477[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x550036['model'],qs['fields'](_0x499ee9['query'][_0x43e7('0x33')]));_0x536477[_0x43e7('0x32')]=_0x536477['attributes'][_0x43e7('0x34')]?_0x536477[_0x43e7('0x32')]:_0x550036[_0x43e7('0x31')];if(!_0x499ee9[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x536477['limit']=qs[_0x43e7('0x11')](_0x499ee9[_0x43e7('0x2c')]['limit']);_0x536477['offset']=qs[_0x43e7('0xe')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x536477['order']=qs[_0x43e7('0x4d')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x536477[_0x43e7('0x2a')]=qs['filters'](_[_0x43e7('0x4f')](_0x499ee9['query'],_0x550036[_0x43e7('0x4e')]));_0x536477[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1ae0c8['id'];if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x536477[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x536477['where'],{'$or':_[_0x43e7('0x1a')](_0x536477[_0x43e7('0x32')],function(_0x1aea4e){var _0x6fb694={};_0x6fb694[_0x1aea4e]={'$like':'%'+_0x499ee9['query']['filter']+'%'};return _0x6fb694;})});}_0x536477=_['merge']({},_0x536477,_0x499ee9[_0x43e7('0x51')]);return db['CmHopperHistory'][_0x43e7('0x10')]({'where':_0x536477[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x7387f6){_0x5b98bf[_0x43e7('0x10')]=_0x7387f6;if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x536477[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x53')][_0x43e7('0x2d')](_0x536477);})[_0x43e7('0x13')](function(_0x5b3565){_0x5b98bf[_0x43e7('0x52')]=_0x5b3565;return _0x5b98bf;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x405faa,_0x536477))[_0x43e7('0x2e')](handleError(_0x405faa,null));};exports[_0x43e7('0x54')]=function(_0x206e54,_0x4ea4a9){var _0x5e04ec={'raw':!![],'where':{}};var _0x162a27={};var _0x3e3c82={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x206e54[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ea4a9,null))['then'](function(_0x1e869a){if(_0x1e869a){_0x162a27[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x55')][_0x43e7('0x26')]);_0x162a27['query']=_['keys'](_0x206e54[_0x43e7('0x2c')]);_0x162a27[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],_0x162a27['query']);_0x5e04ec[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x206e54['query'][_0x43e7('0x33')]));_0x5e04ec[_0x43e7('0x32')]=_0x5e04ec[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5e04ec[_0x43e7('0x32')]:_0x162a27['model'];if(!_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0x5e04ec[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5e04ec['offset']=qs[_0x43e7('0xe')](_0x206e54['query'][_0x43e7('0xe')]);}_0x5e04ec[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5e04ec[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x206e54[_0x43e7('0x2c')],_0x162a27['filters']));_0x5e04ec[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1e869a['id'];if(_0x206e54[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x5e04ec['where']=_['merge'](_0x5e04ec[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5e04ec[_0x43e7('0x32')],function(_0x4d30f7){var _0x12e7a8={};_0x12e7a8[_0x4d30f7]={'$like':'%'+_0x206e54['query']['filter']+'%'};return _0x12e7a8;})});}_0x5e04ec=_['merge']({},_0x5e04ec,_0x206e54[_0x43e7('0x51')]);return db['CmHopperFinal'][_0x43e7('0x10')]({'where':_0x5e04ec[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x2fea54){_0x3e3c82[_0x43e7('0x10')]=_0x2fea54;if(_0x206e54['query']['includeAll']){_0x5e04ec[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x55')]['findAll'](_0x5e04ec);})[_0x43e7('0x13')](function(_0x10fd28){_0x3e3c82[_0x43e7('0x52')]=_0x10fd28;return _0x3e3c82;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x4ea4a9,_0x5e04ec))[_0x43e7('0x2e')](handleError(_0x4ea4a9,null));};exports[_0x43e7('0x57')]=function(_0x399253,_0x32e698){var _0x39ce5e={'raw':!![],'where':{}};var _0x284617={};var _0x610819={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x399253[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x32e698,null))[_0x43e7('0x13')](function(_0x3286b1){if(_0x3286b1){_0x284617[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x58')][_0x43e7('0x26')]);_0x284617[_0x43e7('0x2c')]=_['keys'](_0x399253[_0x43e7('0x2c')]);_0x284617[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x284617[_0x43e7('0x31')],_0x284617['query']);_0x39ce5e[_0x43e7('0x32')]=_['intersection'](_0x284617[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x399253[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x39ce5e[_0x43e7('0x32')]=_0x39ce5e[_0x43e7('0x32')]['length']?_0x39ce5e[_0x43e7('0x32')]:_0x284617[_0x43e7('0x31')];if(!_0x399253[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x39ce5e['limit']=qs['limit'](_0x399253[_0x43e7('0x2c')]['limit']);_0x39ce5e[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x399253[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x39ce5e['order']=qs['sort'](_0x399253['query'][_0x43e7('0x4d')]);_0x39ce5e['where']=qs['filters'](_['pick'](_0x399253[_0x43e7('0x2c')],_0x284617[_0x43e7('0x4e')]));_0x39ce5e['where'][_0x43e7('0x50')]=_0x3286b1['id'];if(_0x399253['query'][_0x43e7('0x19')]){_0x39ce5e[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x39ce5e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x39ce5e['attributes'],function(_0x1f4162){var _0x449cb4={};_0x449cb4[_0x1f4162]={'$like':'%'+_0x399253[_0x43e7('0x2c')]['filter']+'%'};return _0x449cb4;})});}_0x39ce5e=_['merge']({},_0x39ce5e,_0x399253[_0x43e7('0x51')]);return db[_0x43e7('0x58')][_0x43e7('0x10')]({'where':_0x39ce5e[_0x43e7('0x2a')]})['then'](function(_0x385cc1){_0x610819[_0x43e7('0x10')]=_0x385cc1;if(_0x399253[_0x43e7('0x2c')]['includeAll']){_0x39ce5e[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x58')][_0x43e7('0x2d')](_0x39ce5e);})[_0x43e7('0x13')](function(_0x541ce8){_0x610819[_0x43e7('0x52')]=_0x541ce8;return _0x610819;});}})['then'](respondWithFilteredResult(_0x32e698,_0x39ce5e))[_0x43e7('0x2e')](handleError(_0x32e698,null));};exports[_0x43e7('0x59')]=function(_0x47f29f,_0x4e5484){var _0xc62dc9={};var _0x1480c6={};var _0x21d001;var _0x4600e5;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x47f29f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x4e5484,null))[_0x43e7('0x13')](function(_0xfc577b){if(_0xfc577b){_0x21d001=_0xfc577b;_0x1480c6[_0x43e7('0x31')]=_['keys'](db[_0x43e7('0x5a')]['rawAttributes']);_0x1480c6[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x47f29f[_0x43e7('0x2c')]);_0x1480c6['filters']=_[_0x43e7('0x30')](_0x1480c6[_0x43e7('0x31')],_0x1480c6[_0x43e7('0x2c')]);_0xc62dc9[_0x43e7('0x32')]=_['intersection'](_0x1480c6[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x47f29f['query']['fields']));_0xc62dc9['attributes']=_0xc62dc9[_0x43e7('0x32')][_0x43e7('0x34')]?_0xc62dc9[_0x43e7('0x32')]:_0x1480c6[_0x43e7('0x31')];_0xc62dc9[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0xc62dc9['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x47f29f[_0x43e7('0x2c')],_0x1480c6[_0x43e7('0x4e')]));if(_0x47f29f['query']['filter']){_0xc62dc9[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0xc62dc9[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0xc62dc9['attributes'],function(_0x2f529b){var _0x427cec={};_0x427cec[_0x2f529b]={'$like':'%'+_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x427cec;})});}_0xc62dc9=_[_0x43e7('0x36')]({},_0xc62dc9,_0x47f29f[_0x43e7('0x51')]);return _0x21d001['getTeams'](_0xc62dc9);}})[_0x43e7('0x13')](function(_0x52c974){if(_0x52c974){_0x4600e5=_0x52c974['length'];if(!_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0xc62dc9['limit']=qs[_0x43e7('0x11')](_0x47f29f[_0x43e7('0x2c')]['limit']);_0xc62dc9[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x21d001['getTeams'](_0xc62dc9);}})['then'](function(_0x2a084b){if(_0x2a084b){return _0x2a084b?{'count':_0x4600e5,'rows':_0x2a084b}:null;}})[_0x43e7('0x13')](respondWithResult(_0x4e5484,null))[_0x43e7('0x2e')](handleError(_0x4e5484,null));};exports['addTeams']=function(_0x49de67,_0x298239){var _0xf682ec=_0x49de67[_0x43e7('0x39')][_0x43e7('0x5b')];var _0x1e247f=_[_0x43e7('0x1a')](_0xf682ec,'id');return db[_0x43e7('0x5a')][_0x43e7('0x2d')]({'where':{'id':_0x1e247f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]}]})[_0x43e7('0x13')](function(_0x44fee0){if(_0x44fee0){var _0x41d130=_[_0x43e7('0x5e')](_0x44fee0,function(_0x5e87d6){var _0x21039a=_0x5e87d6[_0x43e7('0x15')]({'plain':!![]});_0x21039a[_0x43e7('0x5f')][_0x43e7('0x60')](function(_0x59f68a){_0x59f68a[_0x43e7('0x61')]=_[_0x43e7('0x37')](_0xf682ec,{'id':_0x21039a['id']})[_0x43e7('0x61')];});return _0x21039a[_0x43e7('0x5f')];});return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x49de67[_0x43e7('0x40')]['id']}})['then'](function(_0xc9356c){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0x3637d9){return _0xc9356c[_0x43e7('0x64')](_0x1e247f,{'transaction':_0x3637d9})['then'](function(){return BPromise[_0x43e7('0x65')](_0xf682ec,function(_0x25ddf8){return db['TeamVoiceQueue'][_0x43e7('0x66')]({'TeamId':_0x25ddf8['id'],'VoiceQueueId':_0x49de67[_0x43e7('0x40')]['id'],'penalty':_0x25ddf8['penalty']},{'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_0x41d130,function(_0x110154){return db[_0x43e7('0x67')][_0x43e7('0x68')]({'where':{'UserId':_0x110154['id'],'VoiceQueueId':_0x49de67['params']['id']},'defaults':{'penalty':_0x110154[_0x43e7('0x61')]},'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_['filter'](_0x41d130,{'online':!![]}),function(_0x32b788){return db[_0x43e7('0x69')]['upsert']({'membername':_0x32b788[_0x43e7('0x21')],'UserId':_0x32b788['id'],'queue_name':_0xc9356c[_0x43e7('0x21')],'VoiceQueueId':_0xc9356c['id'],'interface':_[_0x43e7('0x6a')](_0x32b788[_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x32b788['name']):_0x32b788[_0x43e7('0x5d')],'paused':_0x32b788[_0x43e7('0x6d')]||![],'penalty':_0x32b788[_0x43e7('0x61')]},{'transaction':_0x3637d9});});})['then'](function(){_0x41d130[_0x43e7('0x60')](function(_0x21901c){socket[_0x43e7('0x6e')](_0x43e7('0x6f'),{'UserId':_0x21901c['id'],'VoiceQueueId':_0xc9356c['id']});});});});});}})[_0x43e7('0x13')](respondWithStatusCode(_0x298239,null))[_0x43e7('0x2e')](handleError(_0x298239,null));};exports[_0x43e7('0x70')]=function(_0x1896b3,_0x4345a5){return db['Team'][_0x43e7('0x2d')]({'where':{'id':_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x43e7('0x72')],'as':_0x43e7('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x43e7('0x13')](handleEntityNotFound(_0x4345a5,null))[_0x43e7('0x13')](function(_0x3e8631){var _0x51e17c=_[_0x43e7('0x1a')](_0x3e8631,'id');var _0x6246c4=[];var _0xd0dca2=[];var _0xa721ba=squel[_0x43e7('0x73')]();_0xa721ba['field'](_0x43e7('0x74'))[_0x43e7('0x75')](_0x43e7('0x76'),'tq')[_0x43e7('0x77')](_0x43e7('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x1896b3[_0x43e7('0x40')]['id']);for(var _0x339826=0x0;_0x339826<_0x3e8631[_0x43e7('0x34')];_0x339826+=0x1){let _0xc28ac6=_0x3e8631[_0x339826];for(var _0x4b0abd=0x0;_0x4b0abd<_0xc28ac6[_0x43e7('0x5f')][_0x43e7('0x34')];_0x4b0abd+=0x1){let _0x41d636=_0xc28ac6[_0x43e7('0x5f')][_0x4b0abd];var _0x19bdf7=_0xa721ba[_0x43e7('0x3f')]();_0x19bdf7[_0x43e7('0x2a')](_0x43e7('0x79'),_0x41d636['id']);_0xd0dca2[_0x43e7('0x7a')](db[_0x43e7('0x62')][_0x43e7('0x2c')](_0x19bdf7['toString'](),{'type':db['sequelize'][_0x43e7('0x7b')]['SELECT']})['then'](function(_0x4a0d5d){if(_0x4a0d5d[_0x43e7('0x34')]===0x1){return _0x41d636['id'];}else{var _0x5eae45=_[_0x43e7('0x7c')](_['map'](_0x4a0d5d,'TeamId'),function(_0x55f1df){return _[_0x43e7('0x1c')](_0x51e17c,_0x55f1df);});if(_0x5eae45){return _0x41d636['id'];}}}));}}return BPromise[_0x43e7('0x7d')](_0xd0dca2)[_0x43e7('0x13')](function(_0xd6ebb0){_0x6246c4=_(_0x6246c4)[_0x43e7('0x7e')](_0xd6ebb0)[_0x43e7('0x7f')]()[_0x43e7('0x1b')]();return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1896b3[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](function(_0x2a1218){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0xe14e67){return _0x2a1218[_0x43e7('0x70')](_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')],{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){if(!_[_0x43e7('0x80')](_0x6246c4)){return _0x2a1218['removeAgents'](_0x6246c4,{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x1896b3[_0x43e7('0x40')]['id'],'UserId':_0x6246c4},'transaction':_0xe14e67});});}})[_0x43e7('0x13')](function(){_0x6246c4[_0x43e7('0x60')](function(_0x32b33c){socket['emit'](_0x43e7('0x81'),{'UserId':_0x32b33c,'VoiceQueueId':_0x2a1218['id']});});});});});});})[_0x43e7('0x13')](respondWithStatusCode(_0x4345a5,null))['catch'](handleError(_0x4345a5,null));};exports[_0x43e7('0x82')]=function(_0x1a520e,_0xb4cf23){var _0x559145,_0x22b824;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1a520e[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0xb4cf23,null))['then'](function(_0x33b63b){if(_0x33b63b){_0x22b824=_0x33b63b;return _0x33b63b[_0x43e7('0x82')](_0x1a520e['body'][_0x43e7('0x71')],_['omit'](_0x1a520e['body'],['ids','id'])||{})['spread'](function(_0x255113){for(var _0x451fb5=0x0;_0x451fb5<_0x1a520e[_0x43e7('0x39')][_0x43e7('0x71')]['length'];_0x451fb5+=0x1){socket['emit'](_0x43e7('0x6f'),{'UserId':Number(_0x1a520e['body'][_0x43e7('0x71')][_0x451fb5]),'VoiceQueueId':Number(_0x1a520e['params']['id'])});}return _0x255113;});}})[_0x43e7('0x13')](function(_0x4cf7e9){_0x559145=_0x4cf7e9||[];if(_0x22b824){return db['User']['findAll']({'where':{'id':_0x1a520e['body'][_0x43e7('0x71')]},'attributes':['id',_0x43e7('0x21'),_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]});}})[_0x43e7('0x13')](function(_0x517289){if(!_['isEmpty'](_0x517289)){var _0x25fd39=[];for(var _0xb2aca0=0x0;_0xb2aca0<_0x517289[_0x43e7('0x34')];_0xb2aca0++){if(_0x517289[_0xb2aca0][_0x43e7('0x5c')]){_0x25fd39['push'](db[_0x43e7('0x69')]['upsert']({'membername':_0x517289[_0xb2aca0][_0x43e7('0x21')],'UserId':_0x517289[_0xb2aca0]['id'],'queue_name':_0x22b824[_0x43e7('0x21')],'VoiceQueueId':_0x22b824['id'],'interface':_[_0x43e7('0x6a')](_0x517289[_0xb2aca0][_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x517289[_0xb2aca0][_0x43e7('0x21')]):_0x517289[_0xb2aca0]['interface'],'paused':_0x517289[_0xb2aca0][_0x43e7('0x6d')]||![],'penalty':_0x1a520e[_0x43e7('0x39')]['penalty']||0x0}));}}return BPromise[_0x43e7('0x7d')](_0x25fd39);}})[_0x43e7('0x13')](function(){return _0x559145;})[_0x43e7('0x13')](respondWithResult(_0xb4cf23,null))[_0x43e7('0x2e')](handleError(_0xb4cf23,null));};exports[_0x43e7('0x83')]=function(_0x4fd17e,_0x3fd573){return db['VoiceQueue'][_0x43e7('0x37')]({'where':{'id':_0x4fd17e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3fd573,null))[_0x43e7('0x13')](function(_0x4446cb){if(_0x4446cb){return _0x4446cb[_0x43e7('0x83')](_0x4fd17e[_0x43e7('0x2c')]['ids'])[_0x43e7('0x13')](function(){if(_['isArray'](_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')])){for(var _0x34d476=0x0;_0x34d476<_0x4fd17e['query'][_0x43e7('0x71')][_0x43e7('0x34')];_0x34d476+=0x1){socket[_0x43e7('0x6e')](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')]['ids'][_0x34d476]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}}else{socket['emit'](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}});}})[_0x43e7('0x13')](function(_0x34ed9e){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x4fd17e[_0x43e7('0x40')]['id'],'UserId':_0x4fd17e['query'][_0x43e7('0x71')]}})[_0x43e7('0x13')](function(){return _0x34ed9e;});})[_0x43e7('0x13')](respondWithStatusCode(_0x3fd573,null))[_0x43e7('0x2e')](handleError(_0x3fd573,null));};exports[_0x43e7('0x84')]=function(_0xf9178f,_0x3bb7ab){var _0x2be8c7={};var _0x2bb14d={};var _0x57f7ea;var _0x240478;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0xf9178f[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bb7ab,null))[_0x43e7('0x13')](function(_0x381e47){if(_0x381e47){_0x57f7ea=_0x381e47;_0x2bb14d['model']=_[_0x43e7('0x41')](db[_0x43e7('0x72')][_0x43e7('0x26')]);_0x2bb14d[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0xf9178f[_0x43e7('0x2c')]);_0x2bb14d[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2bb14d['model'],_0x2bb14d[_0x43e7('0x2c')]);_0x2be8c7[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2bb14d['model'],qs[_0x43e7('0x33')](_0xf9178f[_0x43e7('0x2c')]['fields']));_0x2be8c7[_0x43e7('0x32')]=_0x2be8c7[_0x43e7('0x32')]['length']?_0x2be8c7[_0x43e7('0x32')]:_0x2bb14d[_0x43e7('0x31')];_0x2be8c7[_0x43e7('0x56')]=qs['sort'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x2be8c7['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0xf9178f[_0x43e7('0x2c')],_0x2bb14d[_0x43e7('0x4e')]));if(_0xf9178f['query']['filter']){_0x2be8c7[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x2be8c7[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x2be8c7['attributes'],function(_0x1e6245){var _0x36860d={};_0x36860d[_0x1e6245]={'$like':'%'+_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x36860d;})});}_0x2be8c7=_['merge']({},_0x2be8c7,_0xf9178f[_0x43e7('0x51')]);return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x3ff5d6){if(_0x3ff5d6){_0x240478=_0x3ff5d6[_0x43e7('0x34')];if(!_0xf9178f['query']['hasOwnProperty']('nolimit')){_0x2be8c7[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0xf9178f[_0x43e7('0x2c')]['limit']);_0x2be8c7[_0x43e7('0xe')]=qs['offset'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x249a8d){if(_0x249a8d){return _0x249a8d?{'count':_0x240478,'rows':_0x249a8d}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3bb7ab,null))['catch'](handleError(_0x3bb7ab,null));};exports[_0x43e7('0x85')]=function(_0x202421,_0x12e4a3){var _0x16ca0e={};var _0x2f467b={};var _0x7f43b5;var _0x4637f6;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x202421[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x12e4a3,null))[_0x43e7('0x13')](function(_0x24e9a7){if(_0x24e9a7){_0x7f43b5=_0x24e9a7;_0x2f467b['model']=_[_0x43e7('0x41')](db[_0x43e7('0x69')]['rawAttributes']);_0x2f467b[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x202421['query']);_0x2f467b[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],_0x2f467b['query']);_0x16ca0e['attributes']=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x16ca0e[_0x43e7('0x32')]=_0x16ca0e[_0x43e7('0x32')][_0x43e7('0x34')]?_0x16ca0e['attributes']:_0x2f467b[_0x43e7('0x31')];_0x16ca0e[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x16ca0e[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x202421[_0x43e7('0x2c')],_0x2f467b[_0x43e7('0x4e')]));if(_0x202421[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x16ca0e['where']=_[_0x43e7('0x36')](_0x16ca0e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x16ca0e[_0x43e7('0x32')],function(_0x49f43c){var _0xad02f6={};_0xad02f6[_0x49f43c]={'$like':'%'+_0x202421['query'][_0x43e7('0x19')]+'%'};return _0xad02f6;})});}_0x16ca0e=_['merge']({},_0x16ca0e,_0x202421[_0x43e7('0x51')]);return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})[_0x43e7('0x13')](function(_0x4a500c){if(_0x4a500c){_0x4637f6=_0x4a500c[_0x43e7('0x34')];if(!_0x202421[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x16ca0e['limit']=qs[_0x43e7('0x11')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x16ca0e[_0x43e7('0xe')]=qs['offset'](_0x202421[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})['then'](function(_0x12c4f9){return _0x12c4f9?{'count':_0x4637f6,'rows':_0x12c4f9}:null;})[_0x43e7('0x13')](respondWithResult(_0x12e4a3,null))[_0x43e7('0x2e')](handleError(_0x12e4a3,null));};exports[_0x43e7('0x86')]=function(_0x77c2f,_0x1e4a25){var _0x5790b5={};var _0x3f057e={};var _0x505287;var _0x221938;return db[_0x43e7('0x25')]['findOne']({'where':{'id':_0x77c2f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1e4a25,null))['then'](function(_0x46aa47){if(_0x46aa47){_0x505287=_0x46aa47;_0x3f057e[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x87')]['rawAttributes']);_0x3f057e['query']=_[_0x43e7('0x41')](_0x77c2f[_0x43e7('0x2c')]);_0x3f057e[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x3f057e[_0x43e7('0x31')],_0x3f057e[_0x43e7('0x2c')]);_0x5790b5[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x3f057e['model'],qs[_0x43e7('0x33')](_0x77c2f[_0x43e7('0x2c')]['fields']));_0x5790b5[_0x43e7('0x32')]=_0x5790b5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5790b5[_0x43e7('0x32')]:_0x3f057e[_0x43e7('0x31')];_0x5790b5[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x77c2f['query'][_0x43e7('0x4d')]);_0x5790b5['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x77c2f['query'],_0x3f057e[_0x43e7('0x4e')]));if(_0x77c2f['query'][_0x43e7('0x19')]){_0x5790b5[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5790b5['where'],{'$or':_['map'](_0x5790b5[_0x43e7('0x32')],function(_0xcfecd2){var _0x4cd879={};_0x4cd879[_0xcfecd2]={'$like':'%'+_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x4cd879;})});}_0x5790b5=_[_0x43e7('0x36')]({},_0x5790b5,_0x77c2f['options']);return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0xb2eb62){if(_0xb2eb62){_0x221938=_0xb2eb62['length'];if(!_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x5790b5[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x77c2f[_0x43e7('0x2c')]['limit']);_0x5790b5[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x77c2f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0x34ab5a){if(_0x34ab5a){return _0x34ab5a?{'count':_0x221938,'rows':_0x34ab5a}:null;}})[_0x43e7('0x13')](respondWithResult(_0x1e4a25,null))[_0x43e7('0x2e')](handleError(_0x1e4a25,null));};exports[_0x43e7('0x88')]=function(_0x13133c,_0x288d6a){var _0x47ef9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x56598f,_0x280668;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x13133c[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x288d6a,null))[_0x43e7('0x13')](function(_0x51dc07){if(_0x51dc07){_0x280668=_0x51dc07;return _0x51dc07['addLists'](_0x13133c[_0x43e7('0x39')][_0x43e7('0x71')],_['omit'](_0x13133c['body'],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x58a783){var _0x3d6659;_0x56598f=_0x58a783||[];var _0x57bcab=[];if(_0x58a783){for(var _0x5f4023=0x0;_0x5f4023<_0x58a783[_0x43e7('0x34')];_0x5f4023+=0x1){var _0x2be66d=_0x58a783[_0x5f4023]['get']({'plain':!![]});_0x280668['dialCheckDuplicateType']=_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]?_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]:_0x280668['dialCheckDuplicateType'];switch(_0x280668[_0x43e7('0x8a')]){case _0x43e7('0x8b'):_0x3d6659=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8d'),'ContactId','ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')]('phone',_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))['field'](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')]['toString']())[_0x43e7('0x2a')]('phone\x20IS\x20NOT\x20NULL')[_0x43e7('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x43e7('0x73')]()['field'](_0x43e7('0x95'))[_0x43e7('0x75')](_0x43e7('0x96'))[_0x43e7('0x2a')](_0x43e7('0x97'),_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]()))[_0x43e7('0x2a')](_0x43e7('0x98'),squel[_0x43e7('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x43e7('0x99'))['where']('VoiceQueueId\x20=\x20?',_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;case _0x43e7('0x9a'):_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0x99'))[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),'ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel['select']()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))['field'](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))['where'](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e'))['where'](_0x43e7('0x98'),squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x9f'))['from']('cm_hopper')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x13133c['params']['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;default:_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper')[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),'createdAt','updatedAt'],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))['field']('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),'ListId')[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))[_0x43e7('0x75')]('cm_contacts')[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();}_0x57bcab['push'](db['sequelize'][_0x43e7('0x2c')](_0x3d6659));}return BPromise[_0x43e7('0x7d')](_0x57bcab);}})[_0x43e7('0x13')](function(){var _0x3ac223=[];var _0x486780=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0xa1'))[_0x43e7('0x9d')]([_0x43e7('0xa2'),_0x43e7('0x8c'),_0x43e7('0xa3'),'createdAt',_0x43e7('0x43')],squel['select']()['field']('h.id')[_0x43e7('0x8e')](_0x43e7('0xa4'))[_0x43e7('0x8e')](_0x43e7('0xa5'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0xa6'),'ci')['join'](_0x43e7('0x99'),'h',_0x43e7('0xa7'))[_0x43e7('0x2a')](_0x43e7('0xa8'),_0x47ef9d)['where']('ci.ItemClass=?',_0x43e7('0xa9')))[_0x43e7('0x91')]();_0x3ac223['push'](db['sequelize'][_0x43e7('0x2c')](_0x486780));return BPromise[_0x43e7('0x7d')](_0x3ac223);})[_0x43e7('0x13')](function(){return _0x56598f;})[_0x43e7('0x13')](respondWithResult(_0x288d6a,null))[_0x43e7('0x2e')](handleError(_0x288d6a,null));};exports[_0x43e7('0xaa')]=function(_0x71807e,_0x314259){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x71807e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x314259,null))[_0x43e7('0x13')](function(_0x2613fc){if(_0x2613fc){return _0x2613fc[_0x43e7('0xaa')](_0x71807e['query'][_0x43e7('0x71')]);}})['then'](function(_0x17b298){if(_0x17b298){return db[_0x43e7('0x4a')][_0x43e7('0x14')]({'where':{'ListId':_0x71807e[_0x43e7('0x2c')]['ids'],'VoiceQueueId':_0x71807e['params']['id']}})[_0x43e7('0x13')](function(){return _0x17b298;});}})['then'](respondWithStatusCode(_0x314259,null))[_0x43e7('0x2e')](handleError(_0x314259,null));};exports[_0x43e7('0xab')]=function(_0x44c536,_0x3a9550){var _0x5dcd3f={};var _0x2e7f00={};var _0x2627e2;var _0x591517;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x44c536[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3a9550,null))[_0x43e7('0x13')](function(_0x5e042f){if(_0x5e042f){_0x2627e2=_0x5e042f;_0x2e7f00['model']=_[_0x43e7('0x41')](db[_0x43e7('0x87')][_0x43e7('0x26')]);_0x2e7f00[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x44c536[_0x43e7('0x2c')]);_0x2e7f00[_0x43e7('0x4e')]=_['intersection'](_0x2e7f00[_0x43e7('0x31')],_0x2e7f00[_0x43e7('0x2c')]);_0x5dcd3f[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2e7f00[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x5dcd3f[_0x43e7('0x32')]=_0x5dcd3f[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5dcd3f[_0x43e7('0x32')]:_0x2e7f00[_0x43e7('0x31')];_0x5dcd3f[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5dcd3f['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x44c536[_0x43e7('0x2c')],_0x2e7f00[_0x43e7('0x4e')]));if(_0x44c536[_0x43e7('0x2c')]['filter']){_0x5dcd3f[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5dcd3f[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5dcd3f[_0x43e7('0x32')],function(_0x5278fd){var _0x84b4f4={};_0x84b4f4[_0x5278fd]={'$like':'%'+_0x44c536['query']['filter']+'%'};return _0x84b4f4;})});}_0x5dcd3f=_['merge']({},_0x5dcd3f,_0x44c536[_0x43e7('0x51')]);return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x4ee587){if(_0x4ee587){_0x591517=_0x4ee587[_0x43e7('0x34')];if(!_0x44c536[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x5dcd3f[_0x43e7('0x11')]=qs['limit'](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5dcd3f[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x44c536[_0x43e7('0x2c')]['offset']);}return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x3b641e){if(_0x3b641e){return _0x3b641e?{'count':_0x591517,'rows':_0x3b641e}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3a9550,null))[_0x43e7('0x2e')](handleError(_0x3a9550,null));};exports['addBlackLists']=function(_0x5b046d,_0x4a0427){var _0xc3460c;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x5b046d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a0427,null))[_0x43e7('0x13')](function(_0x19c1d2){if(_0x19c1d2){return _0x19c1d2[_0x43e7('0xac')](_0x5b046d['body'][_0x43e7('0x71')],_['omit'](_0x5b046d[_0x43e7('0x39')],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x40cc83){var _0x148d72;_0xc3460c=_0x40cc83||[];var _0x1ceb94=[];if(_0x40cc83){for(var _0x19c29b=0x0;_0x19c29b<_0x40cc83[_0x43e7('0x34')];_0x19c29b+=0x1){var _0x38a8db=_0x40cc83[_0x19c29b]['get']({'plain':!![]});_0x148d72=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper_black')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('id','ContactId')[_0x43e7('0x8e')](_0x38a8db['CmListId'][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x5b046d[_0x43e7('0x40')]['id']['toString'](),_0x43e7('0x50'))[_0x43e7('0x8e')]('NOW()',_0x43e7('0x44'))[_0x43e7('0x8e')](_0x43e7('0xad'),_0x43e7('0x43'))[_0x43e7('0x75')](_0x43e7('0x93'))[_0x43e7('0x2a')]('deletedAt\x20IS\x20NULL')[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x38a8db[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();_0x1ceb94[_0x43e7('0x7a')](db[_0x43e7('0x62')]['query'](_0x148d72));}return BPromise[_0x43e7('0x7d')](_0x1ceb94);}})['then'](function(){return _0xc3460c;})[_0x43e7('0x13')](respondWithResult(_0x4a0427,null))[_0x43e7('0x2e')](handleError(_0x4a0427,null));};exports[_0x43e7('0xae')]=function(_0x1dc579,_0x6d9fb){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1dc579['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x6d9fb,null))['then'](function(_0x59ca95){if(_0x59ca95){return _0x59ca95[_0x43e7('0xae')](_0x1dc579['query']['ids']);}})[_0x43e7('0x13')](function(_0x759eb5){if(_0x759eb5){return db[_0x43e7('0x58')][_0x43e7('0x14')]({'where':{'ListId':_0x1dc579['query'][_0x43e7('0x71')],'VoiceQueueId':_0x1dc579['params']['id']}})[_0x43e7('0x13')](function(){return _0x759eb5;});}})[_0x43e7('0x13')](respondWithStatusCode(_0x6d9fb,null))[_0x43e7('0x2e')](handleError(_0x6d9fb,null));}; \ No newline at end of file +var _0x5fc3=['redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','destroy','stack','name','index','VoiceQueue','fieldName','getOptions','where','include','findAll','rows','catch','show','params','model','keys','query','intersection','attributes','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','rawAttributes','fields','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','nolimit','order','sort','pick','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','emit','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','User','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x36f8a6,_0x24bff4){var _0x40e2bd=function(_0x534bbe){while(--_0x534bbe){_0x36f8a6['push'](_0x36f8a6['shift']());}};_0x40e2bd(++_0x24bff4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x5fc3[_0x256e32];return _0x464070;};'use strict';var moment=require(_0x35fc('0x0'));var BPromise=require(_0x35fc('0x1'));var util=require('util');var _=require(_0x35fc('0x2'));var squel=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var qs=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('api');var config=require(_0x35fc('0x7'));var db=require(_0x35fc('0x8'))['db'];config[_0x35fc('0x9')]=_['defaults'](config['redis'],{'host':_0x35fc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35fc('0x9')]));require(_0x35fc('0xb'))[_0x35fc('0xc')](socket);function respondWithStatusCode(_0x1e5f90,_0x34ff19){_0x34ff19=_0x34ff19||0xcc;return function(_0xf9d3a6){if(_0xf9d3a6){return _0x1e5f90[_0x35fc('0xd')](_0x34ff19);}return _0x1e5f90['status'](_0x34ff19)[_0x35fc('0xe')]();};}function respondWithResult(_0x2a1084,_0x4fdca1){_0x4fdca1=_0x4fdca1||0xc8;return function(_0x471549){if(_0x471549){return _0x2a1084[_0x35fc('0xf')](_0x4fdca1)['json'](_0x471549);}};}function respondWithFilteredResult(_0xda83fb,_0x1a9f2b){return function(_0x5469f5){if(_0x5469f5){var _0x4cbe74=typeof _0x1a9f2b[_0x35fc('0x10')]==='undefined'&&typeof _0x1a9f2b[_0x35fc('0x11')]===_0x35fc('0x12');var _0x2a6ad2=_0x5469f5[_0x35fc('0x13')];var _0x38d9f2=_0x4cbe74?0x0:_0x1a9f2b['offset'];var _0x59507a=_0x4cbe74?_0x5469f5['count']:_0x1a9f2b['offset']+_0x1a9f2b[_0x35fc('0x11')];var _0x229d56;if(_0x59507a>=_0x2a6ad2){_0x59507a=_0x2a6ad2;_0x229d56=0xc8;}else{_0x229d56=0xce;}_0xda83fb[_0x35fc('0xf')](_0x229d56);return _0xda83fb[_0x35fc('0x14')](_0x35fc('0x15'),_0x38d9f2+'-'+_0x59507a+'/'+_0x2a6ad2)[_0x35fc('0x16')](_0x5469f5);}return null;};}function saveUpdates(_0x480851){return function(_0x26ba54){if(_0x26ba54){return _0x26ba54[_0x35fc('0x17')](_0x480851)['then'](function(_0x41e165){return _0x41e165;});}return null;};}function removeEntity(_0x363e47){return function(_0x2e513b){if(_0x2e513b){return _0x2e513b['destroy']()[_0x35fc('0x18')](function(){var _0x3c58ea=_0x2e513b[_0x35fc('0x19')]({'plain':!![]});var _0x488234=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b'),'ignore':![]},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d'),'ignore':![]}];var _0x20ffde=_(_0x488234)[_0x35fc('0x1e')](_0x35fc('0x1f'))[_0x35fc('0x20')](_0x35fc('0x21'))[_0x35fc('0x21')]();if(_['includes'](_0x20ffde,_0x3c58ea[_0x35fc('0x22')])){return;}var _0xd5399f=_[_0x35fc('0x23')](_0x488234,[_0x35fc('0x21'),_0x3c58ea[_0x35fc('0x22')]])['name'];return db[_0x35fc('0x24')][_0x35fc('0x25')]({'where':{'type':_0xd5399f,'resourceId':_0x3c58ea['id']}})['then'](function(){return _0x2e513b;});})[_0x35fc('0x18')](function(){_0x363e47[_0x35fc('0xf')](0xcc)[_0x35fc('0xe')]();});}};}function handleEntityNotFound(_0x51cfec){return function(_0x4086e9){if(!_0x4086e9){_0x51cfec['sendStatus'](0x194);}return _0x4086e9;};}function handleError(_0x1bf180,_0xdfab9f){_0xdfab9f=_0xdfab9f||0x1f4;return function(_0x5cb986){logger['error'](_0x5cb986[_0x35fc('0x26')]);if(_0x5cb986['name']){delete _0x5cb986[_0x35fc('0x27')];}_0x1bf180[_0x35fc('0xf')](_0xdfab9f)['send'](_0x5cb986);};}exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={};var _0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x20')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x22')]['key']};});_0x9f3c8a=qs[_0x35fc('0x2b')](_0x134dfa,_0x645eac);var _0x16f067={'where':_0x9f3c8a[_0x35fc('0x2c')]};return db[_0x35fc('0x29')][_0x35fc('0x13')](_0x16f067)[_0x35fc('0x18')](function(_0x222ddb){_0x3735da[_0x35fc('0x13')]=_0x222ddb;_0x9f3c8a[_0x35fc('0x2d')]=qs[_0x35fc('0x2d')](_0x645eac['query']);return db['VoiceQueue'][_0x35fc('0x2e')](_0x9f3c8a);})['then'](function(_0x37b394){_0x3735da[_0x35fc('0x2f')]=_0x37b394;return _0x3735da;})[_0x35fc('0x18')](respondWithFilteredResult(_0x383837,_0x9f3c8a))[_0x35fc('0x30')](handleError(_0x383837,null));};exports[_0x35fc('0x31')]=function(_0x12e78f,_0x4e43b4){var _0x3fe193={'raw':![],'where':{'id':_0x12e78f[_0x35fc('0x32')]['id']}},_0x330a14={};_0x330a14[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x29')]['rawAttributes']);_0x330a14[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x12e78f[_0x35fc('0x35')]);_0x330a14['filters']=_[_0x35fc('0x36')](_0x330a14['model'],_0x330a14[_0x35fc('0x35')]);_0x3fe193[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x330a14[_0x35fc('0x33')],qs['fields'](_0x12e78f['query']['fields']));_0x3fe193[_0x35fc('0x37')]=_0x3fe193['attributes'][_0x35fc('0x38')]?_0x3fe193['attributes']:_0x330a14[_0x35fc('0x33')];if(_0x12e78f[_0x35fc('0x35')][_0x35fc('0x39')]){_0x3fe193[_0x35fc('0x2d')]=[{'all':!![]}];}_0x3fe193=_[_0x35fc('0x3a')]({},_0x3fe193,_0x12e78f[_0x35fc('0x3b')]);return db[_0x35fc('0x29')]['find'](_0x3fe193)[_0x35fc('0x18')](handleEntityNotFound(_0x4e43b4,null))[_0x35fc('0x18')](respondWithResult(_0x4e43b4,null))['catch'](handleError(_0x4e43b4,null));};exports[_0x35fc('0x3c')]=function(_0x1ccc41,_0x1aac67){return db[_0x35fc('0x29')][_0x35fc('0x3c')](_0x1ccc41[_0x35fc('0x3d')],{})['then'](function(_0x3f6480){var _0x267858=_0x1ccc41[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x267858)throw new Error(_0x35fc('0x3f'));if(_0x267858[_0x35fc('0x40')]==='user'){var _0x237548=_0x3f6480[_0x35fc('0x19')]({'plain':!![]});var _0x43b77c=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':_0x35fc('0x1c'),'value':_0x35fc('0x1d')}];var _0x3ec51f=_['find'](_0x43b77c,['value',_0x237548[_0x35fc('0x22')]])[_0x35fc('0x27')];return db['UserProfileSection']['find']({'where':{'name':_0x3ec51f,'userProfileId':_0x267858['userProfileId']},'raw':!![]})[_0x35fc('0x18')](function(_0x10f98b){if(_0x10f98b&&_0x10f98b['autoAssociation']===0x0){return db[_0x35fc('0x24')][_0x35fc('0x3c')]({'name':_0x237548[_0x35fc('0x27')],'resourceId':_0x237548['id'],'type':_0x10f98b[_0x35fc('0x27')],'sectionId':_0x10f98b['id']},{})['then'](function(){return _0x3f6480;});}else{return _0x3f6480;}})['catch'](function(_0x5bf2f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf2f4);throw _0x5bf2f4;});}return _0x3f6480;})[_0x35fc('0x18')](respondWithResult(_0x1aac67,0xc9))[_0x35fc('0x30')](handleError(_0x1aac67,null));};exports['clone']=function(_0x119925,_0x56cf1f){var _0x13d16c={'where':{'id':_0x119925[_0x35fc('0x32')]['id']}},_0x40797d={};_0x40797d[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['VoiceQueue'][_0x35fc('0x41')]);_0x13d16c[_0x35fc('0x37')]=_['intersection'](_0x40797d[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x119925[_0x35fc('0x35')][_0x35fc('0x42')]));_0x13d16c['attributes']=_0x13d16c[_0x35fc('0x37')]['length']?_0x13d16c['attributes']:_0x40797d[_0x35fc('0x33')];if(_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]){_0x13d16c[_0x35fc('0x2d')]=[{'all':!![]}];}_0x13d16c=_[_0x35fc('0x3a')]({},_0x13d16c,_0x119925[_0x35fc('0x3b')]);return db[_0x35fc('0x29')][_0x35fc('0x23')](_0x13d16c)['then'](handleEntityNotFound(_0x56cf1f,null))[_0x35fc('0x18')](function(_0x91d7c0){if(_0x91d7c0){var _0xeca02e=_0x91d7c0[_0x35fc('0x19')]({'plain':!![]});_0xeca02e=qs[_0x35fc('0x43')](_0xeca02e,['id',_0x35fc('0x44'),_0x35fc('0x45')]);_0x119925[_0x35fc('0x3d')]=_[_0x35fc('0x43')](_0x119925[_0x35fc('0x3d')],['id',_0x35fc('0x44'),_0x35fc('0x45')]);return db[_0x35fc('0x29')][_0x35fc('0x3c')](_['merge'](_0xeca02e,_0x119925['body']),{'include':_0x119925[_0x35fc('0x35')][_0x35fc('0x39')]?[{'all':!![]}]:undefined})[_0x35fc('0x18')](function(_0x2bf0b0){var _0x3ee296=_0x119925[_0x35fc('0x3e')]['get']({'plain':!![]});if(!_0x3ee296)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee296[_0x35fc('0x40')]===_0x35fc('0x3e')){var _0x395d63=_0x2bf0b0[_0x35fc('0x19')]({'plain':!![]});var _0x5b2595=[{'name':_0x35fc('0x1a'),'value':_0x35fc('0x1b')},{'name':'QueueCampaigns','value':_0x35fc('0x1d')}];var _0x2536d3=_['find'](_0x5b2595,[_0x35fc('0x21'),_0x395d63[_0x35fc('0x22')]])[_0x35fc('0x27')];return db[_0x35fc('0x46')]['find']({'where':{'name':_0x2536d3,'userProfileId':_0x3ee296['userProfileId']},'raw':!![]})['then'](function(_0x240338){if(_0x240338&&_0x240338[_0x35fc('0x47')]===0x0){return db['UserProfileResource'][_0x35fc('0x3c')]({'name':_0x395d63[_0x35fc('0x27')],'resourceId':_0x395d63['id'],'type':_0x240338[_0x35fc('0x27')],'sectionId':_0x240338['id']},{})[_0x35fc('0x18')](function(){return _0x2bf0b0;});}else{return _0x2bf0b0;}})[_0x35fc('0x30')](function(_0x538be0){logger[_0x35fc('0x48')](_0x35fc('0x49'),_0x538be0);throw _0x538be0;});}return _0x2bf0b0;});}})[_0x35fc('0x18')](respondWithResult(_0x56cf1f,0xc9))['catch'](handleError(_0x56cf1f,null));};exports[_0x35fc('0x17')]=function(_0x1dbf5a,_0x47fb1a){if(_0x1dbf5a[_0x35fc('0x3d')]['id']){delete _0x1dbf5a[_0x35fc('0x3d')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x1dbf5a[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x47fb1a,null))[_0x35fc('0x18')](saveUpdates(_0x1dbf5a[_0x35fc('0x3d')],null))['then'](respondWithResult(_0x47fb1a,null))[_0x35fc('0x30')](handleError(_0x47fb1a,null));};exports[_0x35fc('0x25')]=function(_0x303927,_0x4fabd4){return db[_0x35fc('0x29')]['find']({'where':{'id':_0x303927['params']['id']}})['then'](handleEntityNotFound(_0x4fabd4,null))[_0x35fc('0x18')](removeEntity(_0x4fabd4,null))[_0x35fc('0x30')](handleError(_0x4fabd4,null));};exports[_0x35fc('0x4a')]=function(_0x13901c,_0x3d06b8){var _0x4bbea0={'raw':![],'where':{}};var _0x579f5a={};var _0x5353ea={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x13901c[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3d06b8,null))[_0x35fc('0x18')](function(_0x3ef680){if(_0x3ef680){_0x579f5a['model']=_[_0x35fc('0x34')](db[_0x35fc('0x4b')][_0x35fc('0x41')]);_0x579f5a[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x13901c[_0x35fc('0x35')]);_0x579f5a[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x579f5a[_0x35fc('0x33')],_0x579f5a['query']);_0x4bbea0[_0x35fc('0x37')]=_['intersection'](_0x579f5a[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x13901c[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4bbea0['attributes']=_0x4bbea0[_0x35fc('0x37')]['length']?_0x4bbea0['attributes']:_0x579f5a['model'];if(!_0x13901c[_0x35fc('0x35')]['hasOwnProperty'](_0x35fc('0x4d'))){_0x4bbea0['limit']=qs[_0x35fc('0x11')](_0x13901c['query'][_0x35fc('0x11')]);_0x4bbea0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x13901c[_0x35fc('0x35')]['offset']);}_0x4bbea0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x13901c[_0x35fc('0x35')]['sort']);_0x4bbea0[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x13901c[_0x35fc('0x35')],_0x579f5a[_0x35fc('0x4c')]));_0x4bbea0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3ef680['id'];if(_0x13901c[_0x35fc('0x35')]['filter']){_0x4bbea0[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x4bbea0[_0x35fc('0x2c')],{'$or':_['map'](_0x4bbea0[_0x35fc('0x37')],function(_0x1b76f0){var _0x586729={};_0x586729[_0x1b76f0]={'$like':'%'+_0x13901c['query'][_0x35fc('0x1e')]+'%'};return _0x586729;})});}_0x4bbea0=_['merge']({},_0x4bbea0,_0x13901c[_0x35fc('0x3b')]);return db[_0x35fc('0x4b')][_0x35fc('0x13')]({'where':_0x4bbea0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x20ddc6){_0x5353ea[_0x35fc('0x13')]=_0x20ddc6;if(_0x13901c[_0x35fc('0x35')][_0x35fc('0x39')]){_0x4bbea0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x4b')][_0x35fc('0x2e')](_0x4bbea0);})[_0x35fc('0x18')](function(_0x9f034e){_0x5353ea[_0x35fc('0x2f')]=_0x9f034e;return _0x5353ea;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x3d06b8,_0x4bbea0))[_0x35fc('0x30')](handleError(_0x3d06b8,null));};exports[_0x35fc('0x52')]=function(_0x3b2160,_0x3f3f36){var _0x4ba1b0={'raw':!![],'where':{}};var _0x1797d0={};var _0x55cb69={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x3b2160[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x3f3f36,null))[_0x35fc('0x18')](function(_0x3f56f4){if(_0x3f56f4){_0x1797d0[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x54')][_0x35fc('0x41')]);_0x1797d0[_0x35fc('0x35')]=_['keys'](_0x3b2160[_0x35fc('0x35')]);_0x1797d0[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1797d0[_0x35fc('0x33')],_0x1797d0[_0x35fc('0x35')]);_0x4ba1b0[_0x35fc('0x37')]=_['intersection'](_0x1797d0[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x42')]));_0x4ba1b0[_0x35fc('0x37')]=_0x4ba1b0[_0x35fc('0x37')][_0x35fc('0x38')]?_0x4ba1b0[_0x35fc('0x37')]:_0x1797d0[_0x35fc('0x33')];if(!_0x3b2160['query'][_0x35fc('0x55')]('nolimit')){_0x4ba1b0[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x3b2160['query'][_0x35fc('0x11')]);_0x4ba1b0[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x4ba1b0[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x3b2160[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x4ba1b0['where']=qs['filters'](_['pick'](_0x3b2160['query'],_0x1797d0[_0x35fc('0x4c')]));_0x4ba1b0[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x3f56f4['id'];if(_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x4ba1b0['where']=_[_0x35fc('0x3a')](_0x4ba1b0[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x4ba1b0[_0x35fc('0x37')],function(_0x584a58){var _0x15e936={};_0x15e936[_0x584a58]={'$like':'%'+_0x3b2160[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x15e936;})});}_0x4ba1b0=_['merge']({},_0x4ba1b0,_0x3b2160[_0x35fc('0x3b')]);return db[_0x35fc('0x54')][_0x35fc('0x13')]({'where':_0x4ba1b0[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x31d276){_0x55cb69[_0x35fc('0x13')]=_0x31d276;if(_0x3b2160[_0x35fc('0x35')]['includeAll']){_0x4ba1b0[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x54')][_0x35fc('0x2e')](_0x4ba1b0);})[_0x35fc('0x18')](function(_0x221c5b){_0x55cb69[_0x35fc('0x2f')]=_0x221c5b;return _0x55cb69;});}})['then'](respondWithFilteredResult(_0x3f3f36,_0x4ba1b0))[_0x35fc('0x30')](handleError(_0x3f3f36,null));};exports['getHopperFinals']=function(_0x4855ee,_0x1a2da0){var _0x597670={'raw':!![],'where':{}};var _0x1246c7={};var _0x233b7d={'count':0x0,'rows':[]};return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x4855ee[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x1a2da0,null))[_0x35fc('0x18')](function(_0x1beb46){if(_0x1beb46){_0x1246c7[_0x35fc('0x33')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x1246c7[_0x35fc('0x35')]=_['keys'](_0x4855ee[_0x35fc('0x35')]);_0x1246c7[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],_0x1246c7['query']);_0x597670[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x1246c7[_0x35fc('0x33')],qs['fields'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x42')]));_0x597670[_0x35fc('0x37')]=_0x597670['attributes']['length']?_0x597670['attributes']:_0x1246c7[_0x35fc('0x33')];if(!_0x4855ee[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x597670['limit']=qs[_0x35fc('0x11')](_0x4855ee[_0x35fc('0x35')]['limit']);_0x597670['offset']=qs[_0x35fc('0x10')](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x597670['order']=qs['sort'](_0x4855ee[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x597670['where']=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4855ee[_0x35fc('0x35')],_0x1246c7['filters']));_0x597670[_0x35fc('0x2c')][_0x35fc('0x51')]=_0x1beb46['id'];if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x597670['where']=_[_0x35fc('0x3a')](_0x597670[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x597670['attributes'],function(_0x96dfc){var _0x26d242={};_0x26d242[_0x96dfc]={'$like':'%'+_0x4855ee[_0x35fc('0x35')]['filter']+'%'};return _0x26d242;})});}_0x597670=_[_0x35fc('0x3a')]({},_0x597670,_0x4855ee[_0x35fc('0x3b')]);return db['CmHopperFinal'][_0x35fc('0x13')]({'where':_0x597670[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x45eaae){_0x233b7d[_0x35fc('0x13')]=_0x45eaae;if(_0x4855ee[_0x35fc('0x35')][_0x35fc('0x39')]){_0x597670[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x56')]['findAll'](_0x597670);})[_0x35fc('0x18')](function(_0x3fc6cc){_0x233b7d[_0x35fc('0x2f')]=_0x3fc6cc;return _0x233b7d;});}})[_0x35fc('0x18')](respondWithFilteredResult(_0x1a2da0,_0x597670))['catch'](handleError(_0x1a2da0,null));};exports[_0x35fc('0x57')]=function(_0x1808a3,_0x209d7a){var _0x7b633a={'raw':!![],'where':{}};var _0x4684b6={};var _0x319998={'count':0x0,'rows':[]};return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x1808a3['params']['id']}})['then'](handleEntityNotFound(_0x209d7a,null))[_0x35fc('0x18')](function(_0xafa771){if(_0xafa771){_0x4684b6[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x58')][_0x35fc('0x41')]);_0x4684b6[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x1808a3['query']);_0x4684b6['filters']=_[_0x35fc('0x36')](_0x4684b6['model'],_0x4684b6[_0x35fc('0x35')]);_0x7b633a[_0x35fc('0x37')]=_['intersection'](_0x4684b6['model'],qs[_0x35fc('0x42')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x42')]));_0x7b633a['attributes']=_0x7b633a[_0x35fc('0x37')][_0x35fc('0x38')]?_0x7b633a[_0x35fc('0x37')]:_0x4684b6['model'];if(!_0x1808a3[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x7b633a[_0x35fc('0x11')]=qs['limit'](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x11')]);_0x7b633a[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x1808a3[_0x35fc('0x35')][_0x35fc('0x10')]);}_0x7b633a['order']=qs[_0x35fc('0x4f')](_0x1808a3[_0x35fc('0x35')]['sort']);_0x7b633a[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_['pick'](_0x1808a3[_0x35fc('0x35')],_0x4684b6[_0x35fc('0x4c')]));_0x7b633a[_0x35fc('0x2c')][_0x35fc('0x51')]=_0xafa771['id'];if(_0x1808a3[_0x35fc('0x35')]['filter']){_0x7b633a[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x7b633a[_0x35fc('0x2c')],{'$or':_['map'](_0x7b633a[_0x35fc('0x37')],function(_0x5a8641){var _0x58d3d5={};_0x58d3d5[_0x5a8641]={'$like':'%'+_0x1808a3[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x58d3d5;})});}_0x7b633a=_[_0x35fc('0x3a')]({},_0x7b633a,_0x1808a3[_0x35fc('0x3b')]);return db[_0x35fc('0x58')]['count']({'where':_0x7b633a[_0x35fc('0x2c')]})[_0x35fc('0x18')](function(_0x44683e){_0x319998['count']=_0x44683e;if(_0x1808a3[_0x35fc('0x35')][_0x35fc('0x39')]){_0x7b633a[_0x35fc('0x2d')]=[{'all':!![]}];}return db[_0x35fc('0x58')][_0x35fc('0x2e')](_0x7b633a);})['then'](function(_0x1a2d73){_0x319998[_0x35fc('0x2f')]=_0x1a2d73;return _0x319998;});}})['then'](respondWithFilteredResult(_0x209d7a,_0x7b633a))['catch'](handleError(_0x209d7a,null));};exports[_0x35fc('0x59')]=function(_0x44b356,_0x207336){var _0x2b16b2={};var _0x405a43={};var _0x2b2a87;var _0x8c80ca;return db['VoiceQueue']['findOne']({'where':{'id':_0x44b356[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x207336,null))[_0x35fc('0x18')](function(_0x1a92fa){if(_0x1a92fa){_0x2b2a87=_0x1a92fa;_0x405a43[_0x35fc('0x33')]=_['keys'](db['Team'][_0x35fc('0x41')]);_0x405a43[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x44b356[_0x35fc('0x35')]);_0x405a43['filters']=_['intersection'](_0x405a43[_0x35fc('0x33')],_0x405a43[_0x35fc('0x35')]);_0x2b16b2[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x405a43['model'],qs['fields'](_0x44b356[_0x35fc('0x35')][_0x35fc('0x42')]));_0x2b16b2['attributes']=_0x2b16b2[_0x35fc('0x37')][_0x35fc('0x38')]?_0x2b16b2[_0x35fc('0x37')]:_0x405a43[_0x35fc('0x33')];_0x2b16b2[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x44b356[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x2b16b2[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x44b356[_0x35fc('0x35')],_0x405a43[_0x35fc('0x4c')]));if(_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x2b16b2[_0x35fc('0x2c')]=_['merge'](_0x2b16b2[_0x35fc('0x2c')],{'$or':_['map'](_0x2b16b2[_0x35fc('0x37')],function(_0x5d677a){var _0x5aa072={};_0x5aa072[_0x5d677a]={'$like':'%'+_0x44b356[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x5aa072;})});}_0x2b16b2=_[_0x35fc('0x3a')]({},_0x2b16b2,_0x44b356['options']);return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})[_0x35fc('0x18')](function(_0xe9c7c2){if(_0xe9c7c2){_0x8c80ca=_0xe9c7c2[_0x35fc('0x38')];if(!_0x44b356[_0x35fc('0x35')][_0x35fc('0x55')]('nolimit')){_0x2b16b2['limit']=qs[_0x35fc('0x11')](_0x44b356['query']['limit']);_0x2b16b2[_0x35fc('0x10')]=qs['offset'](_0x44b356['query']['offset']);}return _0x2b2a87[_0x35fc('0x59')](_0x2b16b2);}})['then'](function(_0x355154){if(_0x355154){return _0x355154?{'count':_0x8c80ca,'rows':_0x355154}:null;}})[_0x35fc('0x18')](respondWithResult(_0x207336,null))[_0x35fc('0x30')](handleError(_0x207336,null));};exports[_0x35fc('0x5a')]=function(_0x392212,_0x201dfa){var _0x4ab6f9=_0x392212['body'][_0x35fc('0x5b')];var _0x5994ec=_[_0x35fc('0x20')](_0x4ab6f9,'id');return db[_0x35fc('0x5c')]['findAll']({'where':{'id':_0x5994ec},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]}]})[_0x35fc('0x18')](function(_0x28525f){if(_0x28525f){var _0x9116b1=_[_0x35fc('0x60')](_0x28525f,function(_0x4818ea){var _0x5436a3=_0x4818ea['get']({'plain':!![]});_0x5436a3['Agents'][_0x35fc('0x61')](function(_0x4c9c90){_0x4c9c90[_0x35fc('0x62')]=_['find'](_0x4ab6f9,{'id':_0x5436a3['id']})[_0x35fc('0x62')];});return _0x5436a3[_0x35fc('0x63')];});return db['VoiceQueue']['find']({'where':{'id':_0x392212[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x10ef95){return db[_0x35fc('0x64')][_0x35fc('0x65')](function(_0x4ff80c){return _0x10ef95['addTeams'](_0x5994ec,{'transaction':_0x4ff80c})[_0x35fc('0x18')](function(){return BPromise['each'](_0x4ab6f9,function(_0x15b6be){return db['TeamVoiceQueue'][_0x35fc('0x66')]({'TeamId':_0x15b6be['id'],'VoiceQueueId':_0x392212[_0x35fc('0x32')]['id'],'penalty':_0x15b6be[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_0x9116b1,function(_0x29a77a){return db['UserVoiceQueue'][_0x35fc('0x67')]({'where':{'UserId':_0x29a77a['id'],'VoiceQueueId':_0x392212['params']['id']},'defaults':{'penalty':_0x29a77a['penalty']},'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){return BPromise['each'](_[_0x35fc('0x1e')](_0x9116b1,{'online':!![]}),function(_0x2c8361){return db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x2c8361[_0x35fc('0x27')],'UserId':_0x2c8361['id'],'queue_name':_0x10ef95[_0x35fc('0x27')],'VoiceQueueId':_0x10ef95['id'],'interface':_[_0x35fc('0x69')](_0x2c8361[_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x2c8361[_0x35fc('0x27')]):_0x2c8361[_0x35fc('0x5f')],'paused':_0x2c8361[_0x35fc('0x5e')]||![],'penalty':_0x2c8361[_0x35fc('0x62')]},{'transaction':_0x4ff80c});});})[_0x35fc('0x18')](function(){_0x9116b1[_0x35fc('0x61')](function(_0x4020ae){socket[_0x35fc('0x6b')]('userVoiceQueue:save',{'UserId':_0x4020ae['id'],'VoiceQueueId':_0x10ef95['id']});});});});});}})['then'](respondWithStatusCode(_0x201dfa,null))['catch'](handleError(_0x201dfa,null));};exports['removeTeams']=function(_0x5c8419,_0x271087){return db[_0x35fc('0x5c')][_0x35fc('0x2e')]({'where':{'id':_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x35fc('0x63'),'attributes':['id'],'raw':!![]}]})[_0x35fc('0x18')](handleEntityNotFound(_0x271087,null))[_0x35fc('0x18')](function(_0x2f450e){var _0x370e99=_['map'](_0x2f450e,'id');var _0x195ca3=[];var _0x398359=[];var _0x4188bc=squel['select']();_0x4188bc[_0x35fc('0x6d')](_0x35fc('0x6e'))[_0x35fc('0x6f')](_0x35fc('0x70'),'tq')[_0x35fc('0x71')](_0x35fc('0x72'),'ut',_0x35fc('0x73'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0x5c8419[_0x35fc('0x32')]['id']);for(var _0x3aba1c=0x0;_0x3aba1c<_0x2f450e[_0x35fc('0x38')];_0x3aba1c+=0x1){let _0x225eb1=_0x2f450e[_0x3aba1c];for(var _0x206f0b=0x0;_0x206f0b<_0x225eb1[_0x35fc('0x63')]['length'];_0x206f0b+=0x1){let _0x4ae3d8=_0x225eb1[_0x35fc('0x63')][_0x206f0b];var _0x6a0c44=_0x4188bc[_0x35fc('0x75')]();_0x6a0c44[_0x35fc('0x2c')](_0x35fc('0x76'),_0x4ae3d8['id']);_0x398359[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x6a0c44[_0x35fc('0x78')](),{'type':db[_0x35fc('0x64')][_0x35fc('0x79')][_0x35fc('0x7a')]})[_0x35fc('0x18')](function(_0x336c4a){if(_0x336c4a[_0x35fc('0x38')]===0x1){return _0x4ae3d8['id'];}else{var _0x5824a0=_[_0x35fc('0x7b')](_[_0x35fc('0x20')](_0x336c4a,_0x35fc('0x7c')),function(_0x34e007){return _[_0x35fc('0x7d')](_0x370e99,_0x34e007);});if(_0x5824a0){return _0x4ae3d8['id'];}}}));}}return BPromise[_0x35fc('0x7e')](_0x398359)[_0x35fc('0x18')](function(_0xa4c51a){_0x195ca3=_(_0x195ca3)['union'](_0xa4c51a)['compact']()[_0x35fc('0x21')]();return db[_0x35fc('0x29')]['find']({'where':{'id':_0x5c8419[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(_0x43a794){return db[_0x35fc('0x64')]['transaction'](function(_0x42912c){return _0x43a794[_0x35fc('0x7f')](_0x5c8419[_0x35fc('0x35')][_0x35fc('0x6c')],{'transaction':_0x42912c})['then'](function(){if(!_[_0x35fc('0x80')](_0x195ca3)){return _0x43a794[_0x35fc('0x81')](_0x195ca3,{'transaction':_0x42912c})['then'](function(){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0x5c8419[_0x35fc('0x32')]['id'],'UserId':_0x195ca3},'transaction':_0x42912c});});}})['then'](function(){_0x195ca3[_0x35fc('0x61')](function(_0x4de072){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':_0x4de072,'VoiceQueueId':_0x43a794['id']});});});});});});})['then'](respondWithStatusCode(_0x271087,null))[_0x35fc('0x30')](handleError(_0x271087,null));};exports[_0x35fc('0x83')]=function(_0x139065,_0x25aedf){var _0x316d37,_0x3fd897;return db[_0x35fc('0x29')]['find']({'where':{'id':_0x139065['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x25aedf,null))[_0x35fc('0x18')](function(_0x2463dd){if(_0x2463dd){_0x3fd897=_0x2463dd;return _0x2463dd[_0x35fc('0x83')](_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x139065['body'],[_0x35fc('0x6c'),'id'])||{})[_0x35fc('0x84')](function(_0x46b9b6){for(var _0x4cdc31=0x0;_0x4cdc31<_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x35fc('0x38')];_0x4cdc31+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x85'),{'UserId':Number(_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')][_0x4cdc31]),'VoiceQueueId':Number(_0x139065[_0x35fc('0x32')]['id'])});}return _0x46b9b6;});}})[_0x35fc('0x18')](function(_0x14e414){_0x316d37=_0x14e414||[];if(_0x3fd897){return db[_0x35fc('0x86')][_0x35fc('0x2e')]({'where':{'id':_0x139065[_0x35fc('0x3d')][_0x35fc('0x6c')]},'attributes':['id',_0x35fc('0x27'),_0x35fc('0x5d'),_0x35fc('0x5e'),_0x35fc('0x5f')],'raw':!![]});}})[_0x35fc('0x18')](function(_0x4949ed){if(!_[_0x35fc('0x80')](_0x4949ed)){var _0x4f74ff=[];for(var _0x28cbc8=0x0;_0x28cbc8<_0x4949ed[_0x35fc('0x38')];_0x28cbc8++){if(_0x4949ed[_0x28cbc8]['online']){_0x4f74ff[_0x35fc('0x77')](db[_0x35fc('0x68')][_0x35fc('0x66')]({'membername':_0x4949ed[_0x28cbc8][_0x35fc('0x27')],'UserId':_0x4949ed[_0x28cbc8]['id'],'queue_name':_0x3fd897[_0x35fc('0x27')],'VoiceQueueId':_0x3fd897['id'],'interface':_[_0x35fc('0x69')](_0x4949ed[_0x28cbc8][_0x35fc('0x5f')])?util[_0x35fc('0x6a')]('SIP/%s',_0x4949ed[_0x28cbc8][_0x35fc('0x27')]):_0x4949ed[_0x28cbc8][_0x35fc('0x5f')],'paused':_0x4949ed[_0x28cbc8][_0x35fc('0x5e')]||![],'penalty':_0x139065[_0x35fc('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4f74ff);}})['then'](function(){return _0x316d37;})['then'](respondWithResult(_0x25aedf,null))[_0x35fc('0x30')](handleError(_0x25aedf,null));};exports['removeAgents']=function(_0xcbabdf,_0x2475d6){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0xcbabdf[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x2475d6,null))[_0x35fc('0x18')](function(_0x41cbaa){if(_0x41cbaa){return _0x41cbaa[_0x35fc('0x81')](_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')])[_0x35fc('0x18')](function(){if(_[_0x35fc('0x87')](_0xcbabdf['query'][_0x35fc('0x6c')])){for(var _0x3e8580=0x0;_0x3e8580<_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]['length'];_0x3e8580+=0x1){socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')][_0x3e8580]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}}else{socket[_0x35fc('0x6b')](_0x35fc('0x82'),{'UserId':Number(_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]),'VoiceQueueId':Number(_0xcbabdf[_0x35fc('0x32')]['id'])});}});}})[_0x35fc('0x18')](function(_0xa39c4c){return db[_0x35fc('0x68')][_0x35fc('0x25')]({'where':{'VoiceQueueId':_0xcbabdf[_0x35fc('0x32')]['id'],'UserId':_0xcbabdf[_0x35fc('0x35')][_0x35fc('0x6c')]}})[_0x35fc('0x18')](function(){return _0xa39c4c;});})[_0x35fc('0x18')](respondWithStatusCode(_0x2475d6,null))[_0x35fc('0x30')](handleError(_0x2475d6,null));};exports[_0x35fc('0x88')]=function(_0x11d0f4,_0x4f150a){var _0x12238e={};var _0x16b52f={};var _0x238242;var _0x452f30;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x11d0f4[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x4f150a,null))[_0x35fc('0x18')](function(_0x156c24){if(_0x156c24){_0x238242=_0x156c24;_0x16b52f[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x86')][_0x35fc('0x41')]);_0x16b52f[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x11d0f4[_0x35fc('0x35')]);_0x16b52f[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],_0x16b52f[_0x35fc('0x35')]);_0x12238e[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x16b52f[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x42')]));_0x12238e[_0x35fc('0x37')]=_0x12238e['attributes'][_0x35fc('0x38')]?_0x12238e[_0x35fc('0x37')]:_0x16b52f[_0x35fc('0x33')];_0x12238e['order']=qs[_0x35fc('0x4f')](_0x11d0f4[_0x35fc('0x35')]['sort']);_0x12238e['where']=qs['filters'](_[_0x35fc('0x50')](_0x11d0f4[_0x35fc('0x35')],_0x16b52f['filters']));if(_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x12238e[_0x35fc('0x2c')]=_[_0x35fc('0x3a')](_0x12238e[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x12238e['attributes'],function(_0x13534c){var _0x3be339={};_0x3be339[_0x13534c]={'$like':'%'+_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x3be339;})});}_0x12238e=_[_0x35fc('0x3a')]({},_0x12238e,_0x11d0f4['options']);return _0x238242[_0x35fc('0x88')](_0x12238e);}})[_0x35fc('0x18')](function(_0x52f355){if(_0x52f355){_0x452f30=_0x52f355[_0x35fc('0x38')];if(!_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x12238e[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x11')]);_0x12238e[_0x35fc('0x10')]=qs['offset'](_0x11d0f4[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x238242['getAgents'](_0x12238e);}})[_0x35fc('0x18')](function(_0x4ffbf9){if(_0x4ffbf9){return _0x4ffbf9?{'count':_0x452f30,'rows':_0x4ffbf9}:null;}})[_0x35fc('0x18')](respondWithResult(_0x4f150a,null))[_0x35fc('0x30')](handleError(_0x4f150a,null));};exports[_0x35fc('0x89')]=function(_0x206491,_0x536837){var _0x3cfbd4={};var _0x3ac7fb={};var _0x3916e7;var _0x4bcc53;return db[_0x35fc('0x29')]['findOne']({'where':{'id':_0x206491[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x536837,null))[_0x35fc('0x18')](function(_0x3da024){if(_0x3da024){_0x3916e7=_0x3da024;_0x3ac7fb[_0x35fc('0x33')]=_[_0x35fc('0x34')](db[_0x35fc('0x68')][_0x35fc('0x41')]);_0x3ac7fb[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x206491[_0x35fc('0x35')]);_0x3ac7fb[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],_0x3ac7fb[_0x35fc('0x35')]);_0x3cfbd4['attributes']=_[_0x35fc('0x36')](_0x3ac7fb[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x206491[_0x35fc('0x35')][_0x35fc('0x42')]));_0x3cfbd4[_0x35fc('0x37')]=_0x3cfbd4[_0x35fc('0x37')]['length']?_0x3cfbd4['attributes']:_0x3ac7fb['model'];_0x3cfbd4['order']=qs[_0x35fc('0x4f')](_0x206491['query'][_0x35fc('0x4f')]);_0x3cfbd4[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x206491[_0x35fc('0x35')],_0x3ac7fb[_0x35fc('0x4c')]));if(_0x206491['query'][_0x35fc('0x1e')]){_0x3cfbd4['where']=_[_0x35fc('0x3a')](_0x3cfbd4['where'],{'$or':_['map'](_0x3cfbd4[_0x35fc('0x37')],function(_0x472e13){var _0x2d0512={};_0x2d0512[_0x472e13]={'$like':'%'+_0x206491['query']['filter']+'%'};return _0x2d0512;})});}_0x3cfbd4=_['merge']({},_0x3cfbd4,_0x206491['options']);return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x131db6){if(_0x131db6){_0x4bcc53=_0x131db6[_0x35fc('0x38')];if(!_0x206491[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x3cfbd4[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x206491['query']['limit']);_0x3cfbd4[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x206491[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3916e7[_0x35fc('0x89')](_0x3cfbd4);}})[_0x35fc('0x18')](function(_0x4f4c68){return _0x4f4c68?{'count':_0x4bcc53,'rows':_0x4f4c68}:null;})[_0x35fc('0x18')](respondWithResult(_0x536837,null))[_0x35fc('0x30')](handleError(_0x536837,null));};exports[_0x35fc('0x8a')]=function(_0x4f9a00,_0x5c097d){var _0x11c117={};var _0x26b1cb={};var _0x84e749;var _0x4f9685;return db[_0x35fc('0x29')][_0x35fc('0x53')]({'where':{'id':_0x4f9a00[_0x35fc('0x32')]['id']}})['then'](handleEntityNotFound(_0x5c097d,null))[_0x35fc('0x18')](function(_0x546d2e){if(_0x546d2e){_0x84e749=_0x546d2e;_0x26b1cb[_0x35fc('0x33')]=_['keys'](db[_0x35fc('0x8b')][_0x35fc('0x41')]);_0x26b1cb['query']=_[_0x35fc('0x34')](_0x4f9a00[_0x35fc('0x35')]);_0x26b1cb['filters']=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],_0x26b1cb[_0x35fc('0x35')]);_0x11c117[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x26b1cb[_0x35fc('0x33')],qs['fields'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x42')]));_0x11c117[_0x35fc('0x37')]=_0x11c117[_0x35fc('0x37')][_0x35fc('0x38')]?_0x11c117['attributes']:_0x26b1cb[_0x35fc('0x33')];_0x11c117[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x11c117[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x4f9a00[_0x35fc('0x35')],_0x26b1cb['filters']));if(_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]){_0x11c117[_0x35fc('0x2c')]=_['merge'](_0x11c117[_0x35fc('0x2c')],{'$or':_['map'](_0x11c117[_0x35fc('0x37')],function(_0x413a4b){var _0x599121={};_0x599121[_0x413a4b]={'$like':'%'+_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x599121;})});}_0x11c117=_[_0x35fc('0x3a')]({},_0x11c117,_0x4f9a00[_0x35fc('0x3b')]);return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x411d09){if(_0x411d09){_0x4f9685=_0x411d09['length'];if(!_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x11c117['limit']=qs['limit'](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x11')]);_0x11c117[_0x35fc('0x10')]=qs[_0x35fc('0x10')](_0x4f9a00[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x84e749[_0x35fc('0x8a')](_0x11c117);}})[_0x35fc('0x18')](function(_0x214f01){if(_0x214f01){return _0x214f01?{'count':_0x4f9685,'rows':_0x214f01}:null;}})[_0x35fc('0x18')](respondWithResult(_0x5c097d,null))[_0x35fc('0x30')](handleError(_0x5c097d,null));};exports[_0x35fc('0x8c')]=function(_0xae43b4,_0x3c5524){var _0x2ceb04=moment()[_0x35fc('0x6a')](_0x35fc('0x8d'));var _0x605f3b,_0x43bb43;return db['VoiceQueue'][_0x35fc('0x23')]({'where':{'id':_0xae43b4['params']['id']}})['then'](handleEntityNotFound(_0x3c5524,null))[_0x35fc('0x18')](function(_0x1d7881){if(_0x1d7881){_0x43bb43=_0x1d7881;return _0x1d7881[_0x35fc('0x8c')](_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0xae43b4[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x3e0ebb){var _0x138fe5;_0x605f3b=_0x3e0ebb||[];var _0x3033a0=[];if(_0x3e0ebb){for(var _0x228bb9=0x0;_0x228bb9<_0x3e0ebb[_0x35fc('0x38')];_0x228bb9+=0x1){var _0x163afe=_0x3e0ebb[_0x228bb9][_0x35fc('0x19')]({'plain':!![]});_0x43bb43[_0x35fc('0x8e')]=_0xae43b4[_0x35fc('0x3d')][_0x35fc('0x8e')]?_0xae43b4[_0x35fc('0x3d')]['dialCheckDuplicateType']:_0x43bb43[_0x35fc('0x8e')];switch(_0x43bb43[_0x35fc('0x8e')]){case _0x35fc('0x8f'):_0x138fe5=squel['insert']()[_0x35fc('0x90')](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','scheduledAt')['field']('id','ContactId')[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())['where'](_0x35fc('0x9b'))['where'](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x9e'))[_0x35fc('0x6f')](_0x35fc('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0xae43b4['params']['id'][_0x35fc('0x78')]()))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel['select']()[_0x35fc('0x6d')](_0x35fc('0xa0'))[_0x35fc('0x6f')](_0x35fc('0x91'))[_0x35fc('0x2c')](_0x35fc('0x74'),_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;case _0x35fc('0xa1'):_0x138fe5=squel[_0x35fc('0xa2')]()['into'](_0x35fc('0x91'))[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),'ListId','VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))['field']('id',_0x35fc('0x94'))[_0x35fc('0x6d')](_0x163afe[_0x35fc('0x97')]['toString'](),_0x35fc('0x95'))['field'](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))['from']('cm_contacts')[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')]('ListId\x20=\x20?',_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b'))[_0x35fc('0x2c')](_0x35fc('0x9c'),squel[_0x35fc('0x9d')]()['field']('COALESCE(phone,\x27\x27)')[_0x35fc('0x6f')](_0x35fc('0x91'))['where'](_0x35fc('0x74'),_0xae43b4['params']['id'][_0x35fc('0x78')]())))[_0x35fc('0x78')]();break;default:_0x138fe5=squel[_0x35fc('0xa2')]()[_0x35fc('0x90')]('cm_hopper')[_0x35fc('0x92')](['phone',_0x35fc('0x93'),_0x35fc('0x94'),_0x35fc('0x95'),'VoiceQueueId',_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()[_0x35fc('0x6d')](_0x35fc('0x96'),_0x35fc('0x96'))['field']('\x27'+_0x2ceb04+'\x27',_0x35fc('0x93'))[_0x35fc('0x6d')]('id','ContactId')[_0x35fc('0x6d')](_0x163afe['CmListId']['toString'](),'ListId')[_0x35fc('0x6d')](_0xae43b4[_0x35fc('0x32')]['id'][_0x35fc('0x78')](),_0x35fc('0x51'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x45'))[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))['where'](_0x35fc('0x9a'),_0x163afe[_0x35fc('0x97')][_0x35fc('0x78')]())[_0x35fc('0x2c')](_0x35fc('0x9b')))[_0x35fc('0x78')]();}_0x3033a0[_0x35fc('0x77')](db['sequelize'][_0x35fc('0x35')](_0x138fe5));}return BPromise['all'](_0x3033a0);}})[_0x35fc('0x18')](function(){var _0x477d70=[];var _0x28533f=squel['insert']()[_0x35fc('0x90')](_0x35fc('0xa3'))[_0x35fc('0x92')]([_0x35fc('0xa4'),_0x35fc('0x96'),_0x35fc('0xa5'),'createdAt',_0x35fc('0x45')],squel['select']()[_0x35fc('0x6d')]('h.id')['field'](_0x35fc('0xa6'))[_0x35fc('0x6d')]('ci.OrderBy+1')[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27',_0x35fc('0x44'))[_0x35fc('0x6d')]('\x27'+_0x2ceb04+'\x27','updatedAt')[_0x35fc('0x6f')](_0x35fc('0xa7'),'ci')[_0x35fc('0x71')]('cm_hopper','h',_0x35fc('0xa8'))[_0x35fc('0x2c')](_0x35fc('0xa9'),_0x2ceb04)[_0x35fc('0x2c')](_0x35fc('0xaa'),_0x35fc('0xab')))[_0x35fc('0x78')]();_0x477d70[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x28533f));return BPromise[_0x35fc('0x7e')](_0x477d70);})[_0x35fc('0x18')](function(){return _0x605f3b;})[_0x35fc('0x18')](respondWithResult(_0x3c5524,null))[_0x35fc('0x30')](handleError(_0x3c5524,null));};exports['removeLists']=function(_0x57b3f1,_0x8fa3cf){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x8fa3cf,null))[_0x35fc('0x18')](function(_0x293c2d){if(_0x293c2d){return _0x293c2d[_0x35fc('0xac')](_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')]);}})['then'](function(_0x4860b4){if(_0x4860b4){return db[_0x35fc('0x4b')][_0x35fc('0x25')]({'where':{'ListId':_0x57b3f1[_0x35fc('0x35')][_0x35fc('0x6c')],'VoiceQueueId':_0x57b3f1[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x4860b4;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x8fa3cf,null))[_0x35fc('0x30')](handleError(_0x8fa3cf,null));};exports[_0x35fc('0xad')]=function(_0x55d140,_0x488cea){var _0x1a5f12={};var _0x4c40e5={};var _0x3afdf3;var _0x3b64de;return db['VoiceQueue'][_0x35fc('0x53')]({'where':{'id':_0x55d140['params']['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x488cea,null))[_0x35fc('0x18')](function(_0xa46452){if(_0xa46452){_0x3afdf3=_0xa46452;_0x4c40e5[_0x35fc('0x33')]=_[_0x35fc('0x34')](db['CmList'][_0x35fc('0x41')]);_0x4c40e5[_0x35fc('0x35')]=_[_0x35fc('0x34')](_0x55d140['query']);_0x4c40e5[_0x35fc('0x4c')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],_0x4c40e5['query']);_0x1a5f12[_0x35fc('0x37')]=_[_0x35fc('0x36')](_0x4c40e5[_0x35fc('0x33')],qs[_0x35fc('0x42')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x42')]));_0x1a5f12[_0x35fc('0x37')]=_0x1a5f12[_0x35fc('0x37')][_0x35fc('0x38')]?_0x1a5f12[_0x35fc('0x37')]:_0x4c40e5[_0x35fc('0x33')];_0x1a5f12[_0x35fc('0x4e')]=qs[_0x35fc('0x4f')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x4f')]);_0x1a5f12[_0x35fc('0x2c')]=qs[_0x35fc('0x4c')](_[_0x35fc('0x50')](_0x55d140[_0x35fc('0x35')],_0x4c40e5[_0x35fc('0x4c')]));if(_0x55d140['query'][_0x35fc('0x1e')]){_0x1a5f12[_0x35fc('0x2c')]=_['merge'](_0x1a5f12[_0x35fc('0x2c')],{'$or':_[_0x35fc('0x20')](_0x1a5f12[_0x35fc('0x37')],function(_0x55c126){var _0x9e7561={};_0x9e7561[_0x55c126]={'$like':'%'+_0x55d140[_0x35fc('0x35')][_0x35fc('0x1e')]+'%'};return _0x9e7561;})});}_0x1a5f12=_[_0x35fc('0x3a')]({},_0x1a5f12,_0x55d140[_0x35fc('0x3b')]);return _0x3afdf3[_0x35fc('0xad')](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x5545e9){if(_0x5545e9){_0x3b64de=_0x5545e9[_0x35fc('0x38')];if(!_0x55d140[_0x35fc('0x35')][_0x35fc('0x55')](_0x35fc('0x4d'))){_0x1a5f12[_0x35fc('0x11')]=qs[_0x35fc('0x11')](_0x55d140[_0x35fc('0x35')][_0x35fc('0x11')]);_0x1a5f12['offset']=qs['offset'](_0x55d140[_0x35fc('0x35')][_0x35fc('0x10')]);}return _0x3afdf3['getBlackLists'](_0x1a5f12);}})[_0x35fc('0x18')](function(_0x2c1181){if(_0x2c1181){return _0x2c1181?{'count':_0x3b64de,'rows':_0x2c1181}:null;}})[_0x35fc('0x18')](respondWithResult(_0x488cea,null))[_0x35fc('0x30')](handleError(_0x488cea,null));};exports[_0x35fc('0xae')]=function(_0x3f7fd7,_0x5e16f1){var _0xa46ffd;return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x3f7fd7[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](handleEntityNotFound(_0x5e16f1,null))[_0x35fc('0x18')](function(_0x4abeb5){if(_0x4abeb5){return _0x4abeb5[_0x35fc('0xae')](_0x3f7fd7[_0x35fc('0x3d')][_0x35fc('0x6c')],_[_0x35fc('0x43')](_0x3f7fd7[_0x35fc('0x3d')],[_0x35fc('0x6c'),'id'])||{});}return null;})[_0x35fc('0x84')](function(_0x4007f9){var _0x58d0b1;_0xa46ffd=_0x4007f9||[];var _0x4bf83e=[];if(_0x4007f9){for(var _0x1afe94=0x0;_0x1afe94<_0x4007f9[_0x35fc('0x38')];_0x1afe94+=0x1){var _0x108366=_0x4007f9[_0x1afe94][_0x35fc('0x19')]({'plain':!![]});_0x58d0b1=squel['insert']()[_0x35fc('0x90')]('cm_hopper_black')['fromQuery']([_0x35fc('0x96'),_0x35fc('0x94'),_0x35fc('0x95'),_0x35fc('0x51'),_0x35fc('0x44'),_0x35fc('0x45')],squel[_0x35fc('0x9d')]()['field'](_0x35fc('0x96'),_0x35fc('0x96'))[_0x35fc('0x6d')]('id',_0x35fc('0x94'))['field'](_0x108366[_0x35fc('0x97')][_0x35fc('0x78')](),_0x35fc('0x95'))[_0x35fc('0x6d')](_0x3f7fd7[_0x35fc('0x32')]['id']['toString'](),_0x35fc('0x51'))[_0x35fc('0x6d')](_0x35fc('0xaf'),_0x35fc('0x44'))[_0x35fc('0x6d')]('NOW()','updatedAt')[_0x35fc('0x6f')](_0x35fc('0x98'))[_0x35fc('0x2c')](_0x35fc('0x99'))[_0x35fc('0x2c')](_0x35fc('0x9a'),_0x108366[_0x35fc('0x97')]['toString']())[_0x35fc('0x2c')](_0x35fc('0x9b')))['toString']();_0x4bf83e[_0x35fc('0x77')](db[_0x35fc('0x64')][_0x35fc('0x35')](_0x58d0b1));}return BPromise[_0x35fc('0x7e')](_0x4bf83e);}})[_0x35fc('0x18')](function(){return _0xa46ffd;})[_0x35fc('0x18')](respondWithResult(_0x5e16f1,null))[_0x35fc('0x30')](handleError(_0x5e16f1,null));};exports[_0x35fc('0xb0')]=function(_0x4fd3d4,_0x2dff64){return db[_0x35fc('0x29')][_0x35fc('0x23')]({'where':{'id':_0x4fd3d4['params']['id']}})['then'](handleEntityNotFound(_0x2dff64,null))[_0x35fc('0x18')](function(_0x409a32){if(_0x409a32){return _0x409a32['removeBlackLists'](_0x4fd3d4[_0x35fc('0x35')][_0x35fc('0x6c')]);}})[_0x35fc('0x18')](function(_0x2c0bf5){if(_0x2c0bf5){return db['CmHopperBlack'][_0x35fc('0x25')]({'where':{'ListId':_0x4fd3d4['query']['ids'],'VoiceQueueId':_0x4fd3d4[_0x35fc('0x32')]['id']}})[_0x35fc('0x18')](function(){return _0x2c0bf5;});}})[_0x35fc('0x18')](respondWithStatusCode(_0x2dff64,null))[_0x35fc('0x30')](handleError(_0x2dff64,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index acc0634..656f8ca 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 _0x4a81=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x4a81,0x1c9));var _0x14a8=function(_0x1e888a,_0x602494){_0x1e888a=_0x1e888a-0x0;var _0x205865=_0x4a81[_0x1e888a];return _0x205865;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x14a8('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x14a8('0x1')](0x0);var events={'afterCreate':_0x14a8('0x2'),'afterUpdate':_0x14a8('0x3'),'afterDestroy':_0x14a8('0x4')};function emitEvent(_0xc9f88d){return function(_0x31a12b,_0x25f589,_0x29ecab){VoiceQueueEvents[_0x14a8('0x5')](_0xc9f88d+':'+_0x31a12b['id'],_0x31a12b);VoiceQueueEvents['emit'](_0xc9f88d,_0x31a12b);_0x29ecab(null);};}for(var e in events){if(events[_0x14a8('0x6')](e)){var event=events[e];VoiceQueue[_0x14a8('0x7')](e,emitEvent(event));}}module[_0x14a8('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x1747=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x1747,0x178));var _0x7174=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x1747[_0x9c2427];return _0x51984f;};'use strict';var EventEmitter=require(_0x7174('0x0'));var VoiceQueue=require(_0x7174('0x1'))['db'][_0x7174('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7174('0x3')](0x0);var events={'afterCreate':_0x7174('0x4'),'afterUpdate':_0x7174('0x5'),'afterDestroy':_0x7174('0x6')};function emitEvent(_0x482e16){return function(_0x523b52,_0x425e18,_0x4f966c){VoiceQueueEvents['emit'](_0x482e16+':'+_0x523b52['id'],_0x523b52);VoiceQueueEvents[_0x7174('0x7')](_0x482e16,_0x523b52);_0x4f966c(null);};}for(var e in events){if(events[_0x7174('0x8')](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 edede96..4232fec 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(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x70e0,0x17b));var _0x070e=function(_0x25e452,_0x54b127){_0x25e452=_0x25e452-0x0;var _0x1c6cf0=_0x70e0[_0x25e452];return _0x1c6cf0;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x5d68a2,_0x4304cf){var _0x5b3088=function(_0x25a360){while(--_0x25a360){_0x5d68a2['push'](_0x5d68a2['shift']());}};_0x5b3088(++_0x4304cf);}(_0x70e0,0x17b));var _0x070e=function(_0x4f4d8b,_0x5e424c){_0x4f4d8b=_0x4f4d8b-0x0;var _0x36e31e=_0x70e0[_0x4f4d8b];return _0x36e31e;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index be33e65..ebb62da 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 _0xa2a5=['map','catch','ShowVoiceQueue','find','where','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','attributes','include'];(function(_0x2c0bc2,_0x1410f9){var _0xc787af=function(_0x2af102){while(--_0x2af102){_0x2c0bc2['push'](_0x2c0bc2['shift']());}};_0xc787af(++_0x1410f9);}(_0xa2a5,0xa2));var _0x5a2a=function(_0x206307,_0x2d84d7){_0x206307=_0x206307-0x0;var _0x3e2258=_0xa2a5[_0x206307];return _0x3e2258;};'use strict';var _=require(_0x5a2a('0x0'));var util=require(_0x5a2a('0x1'));var moment=require(_0x5a2a('0x2'));var BPromise=require(_0x5a2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a2a('0x4'));var db=require(_0x5a2a('0x5'))['db'];var utils=require(_0x5a2a('0x6'));var logger=require(_0x5a2a('0x7'))(_0x5a2a('0x8'));var config=require(_0x5a2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5a2a('0xa')][_0x5a2a('0xb')]({'port':0x232a});config[_0x5a2a('0xc')]=_[_0x5a2a('0xd')](config[_0x5a2a('0xc')],{'host':_0x5a2a('0xe'),'port':0x18eb});var socket=require(_0x5a2a('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5edd3c,_0x5455df,_0x3a6f95){return new BPromise(function(_0x477174,_0x5885e8){return client['request'](_0x5edd3c,_0x3a6f95)[_0x5a2a('0x10')](function(_0x4f26f3){logger[_0x5a2a('0x11')](_0x5a2a('0x12'),_0x5455df,'request\x20sent');logger[_0x5a2a('0x13')](_0x5a2a('0x14'),_0x5455df,_0x5a2a('0x15'),JSON[_0x5a2a('0x16')](_0x4f26f3));if(_0x4f26f3[_0x5a2a('0x17')]){if(_0x4f26f3[_0x5a2a('0x17')][_0x5a2a('0x18')]===0x1f4){logger[_0x5a2a('0x17')](_0x5a2a('0x12'),_0x5455df,_0x4f26f3[_0x5a2a('0x17')][_0x5a2a('0x19')]);return _0x5885e8(_0x4f26f3[_0x5a2a('0x17')][_0x5a2a('0x19')]);}logger['error'](_0x5a2a('0x12'),_0x5455df,_0x4f26f3[_0x5a2a('0x17')][_0x5a2a('0x19')]);return _0x477174(_0x4f26f3['error'][_0x5a2a('0x19')]);}else{logger[_0x5a2a('0x11')](_0x5a2a('0x12'),_0x5455df,'request\x20sent');_0x477174(_0x4f26f3[_0x5a2a('0x1a')][_0x5a2a('0x19')]);}})['catch'](function(_0x3830b0){logger[_0x5a2a('0x17')](_0x5a2a('0x12'),_0x5455df,_0x3830b0);_0x5885e8(_0x3830b0);});});}exports[_0x5a2a('0x1b')]=function(_0x2c0b6a){var _0x5356fa=this;return new Promise(function(_0x393753,_0x280ff0){return db[_0x5a2a('0x1c')][_0x5a2a('0x1d')]({'raw':_0x2c0b6a[_0x5a2a('0x1e')]?_0x2c0b6a[_0x5a2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2c0b6a['options']?_0x2c0b6a[_0x5a2a('0x1e')]['where']||null:null,'attributes':_0x2c0b6a[_0x5a2a('0x1e')]?_0x2c0b6a[_0x5a2a('0x1e')][_0x5a2a('0x1f')]||null:null,'limit':_0x2c0b6a[_0x5a2a('0x1e')]?_0x2c0b6a[_0x5a2a('0x1e')]['limit']||null:null,'include':_0x2c0b6a[_0x5a2a('0x1e')]?_0x2c0b6a[_0x5a2a('0x1e')][_0x5a2a('0x20')]?_[_0x5a2a('0x21')](_0x2c0b6a[_0x5a2a('0x1e')][_0x5a2a('0x20')],function(_0x469faa){return{'model':db[_0x469faa['model']],'as':_0x469faa['as'],'attributes':_0x469faa[_0x5a2a('0x1f')],'include':_0x469faa[_0x5a2a('0x20')]?_[_0x5a2a('0x21')](_0x469faa[_0x5a2a('0x20')],function(_0x46d103){return{'model':db[_0x46d103['model']],'as':_0x46d103['as'],'attributes':_0x46d103[_0x5a2a('0x1f')],'include':_0x46d103[_0x5a2a('0x20')]?_['map'](_0x46d103[_0x5a2a('0x20')],function(_0x5467de){return{'model':db[_0x5467de['model']],'as':_0x5467de['as'],'attributes':_0x5467de['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ef106){logger['info'](_0x5a2a('0x1b'),_0x2c0b6a);logger[_0x5a2a('0x13')](_0x5a2a('0x1b'),_0x2c0b6a,JSON[_0x5a2a('0x16')](_0x4ef106));_0x393753(_0x4ef106);})[_0x5a2a('0x22')](function(_0x29a2e9){logger[_0x5a2a('0x17')]('GetVoiceQueue',_0x29a2e9[_0x5a2a('0x19')],_0x2c0b6a);_0x280ff0(_0x5356fa[_0x5a2a('0x17')](0x1f4,_0x29a2e9[_0x5a2a('0x19')]));});});};exports[_0x5a2a('0x23')]=function(_0x3a99dd){var _0x12ff62=this;return new Promise(function(_0x123b92,_0x1277eb){return db['VoiceQueue'][_0x5a2a('0x24')]({'raw':_0x3a99dd[_0x5a2a('0x1e')]?_0x3a99dd[_0x5a2a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3a99dd[_0x5a2a('0x1e')]?_0x3a99dd[_0x5a2a('0x1e')][_0x5a2a('0x25')]||null:null,'attributes':_0x3a99dd[_0x5a2a('0x1e')]?_0x3a99dd[_0x5a2a('0x1e')][_0x5a2a('0x1f')]||null:null,'include':_0x3a99dd[_0x5a2a('0x1e')]?_0x3a99dd[_0x5a2a('0x1e')][_0x5a2a('0x20')]?_[_0x5a2a('0x21')](_0x3a99dd[_0x5a2a('0x1e')][_0x5a2a('0x20')],function(_0x3dd888){return{'model':db[_0x3dd888[_0x5a2a('0x26')]],'as':_0x3dd888['as'],'attributes':_0x3dd888['attributes'],'include':_0x3dd888[_0x5a2a('0x20')]?_['map'](_0x3dd888[_0x5a2a('0x20')],function(_0x24bf80){return{'model':db[_0x24bf80[_0x5a2a('0x26')]],'as':_0x24bf80['as'],'attributes':_0x24bf80[_0x5a2a('0x1f')],'include':_0x24bf80[_0x5a2a('0x20')]?_[_0x5a2a('0x21')](_0x24bf80[_0x5a2a('0x20')],function(_0x3c953f){return{'model':db[_0x3c953f[_0x5a2a('0x26')]],'as':_0x3c953f['as'],'attributes':_0x3c953f[_0x5a2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5a2a('0x10')](function(_0x164f93){logger[_0x5a2a('0x11')](_0x5a2a('0x23'),_0x3a99dd);logger[_0x5a2a('0x13')](_0x5a2a('0x23'),_0x3a99dd,JSON[_0x5a2a('0x16')](_0x164f93));_0x123b92(_0x164f93);})[_0x5a2a('0x22')](function(_0x51196c){logger[_0x5a2a('0x17')]('ShowVoiceQueue',_0x51196c[_0x5a2a('0x19')],_0x3a99dd);_0x1277eb(_0x12ff62[_0x5a2a('0x17')](0x1f4,_0x51196c[_0x5a2a('0x19')]));});});}; \ No newline at end of file +var _0xe251=['info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','map','include','attributes','model','debug','ShowVoiceQueue','find','raw','where','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe251,0xae));var _0x1e25=function(_0x2947d1,_0x5e70b0){_0x2947d1=_0x2947d1-0x0;var _0x2b36a5=_0xe251[_0x2947d1];return _0x2b36a5;};'use strict';var _=require(_0x1e25('0x0'));var util=require(_0x1e25('0x1'));var moment=require(_0x1e25('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e25('0x3'));var fs=require('fs');var Redis=require(_0x1e25('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1e25('0x5'))(_0x1e25('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e25('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x1e25('0x8')]=_[_0x1e25('0x9')](config[_0x1e25('0x8')],{'host':_0x1e25('0xa'),'port':0x18eb});var socket=require(_0x1e25('0xb'))(new Redis(config[_0x1e25('0x8')]));require(_0x1e25('0xc'))[_0x1e25('0xd')](socket);function respondWithRpcPromise(_0x12ce4b,_0x5266f7,_0x580cfd){return new BPromise(function(_0x39643b,_0x2571f8){return client[_0x1e25('0xe')](_0x12ce4b,_0x580cfd)[_0x1e25('0xf')](function(_0x4c8535){logger[_0x1e25('0x10')](_0x1e25('0x11'),_0x5266f7,_0x1e25('0x12'));logger['debug'](_0x1e25('0x13'),_0x5266f7,_0x1e25('0x12'),JSON[_0x1e25('0x14')](_0x4c8535));if(_0x4c8535['error']){if(_0x4c8535['error']['code']===0x1f4){logger[_0x1e25('0x15')](_0x1e25('0x11'),_0x5266f7,_0x4c8535[_0x1e25('0x15')]['message']);return _0x2571f8(_0x4c8535[_0x1e25('0x15')][_0x1e25('0x16')]);}logger['error'](_0x1e25('0x11'),_0x5266f7,_0x4c8535[_0x1e25('0x15')][_0x1e25('0x16')]);return _0x39643b(_0x4c8535['error'][_0x1e25('0x16')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x5266f7,'request\x20sent');_0x39643b(_0x4c8535[_0x1e25('0x17')][_0x1e25('0x16')]);}})[_0x1e25('0x18')](function(_0x73c13){logger[_0x1e25('0x15')](_0x1e25('0x11'),_0x5266f7,_0x73c13);_0x2571f8(_0x73c13);});});}exports[_0x1e25('0x19')]=function(_0x564c57){var _0x4908d4=this;return new Promise(function(_0xb8b4df,_0x288cda){return db[_0x1e25('0x1a')][_0x1e25('0x1b')]({'raw':_0x564c57[_0x1e25('0x1c')]?_0x564c57[_0x1e25('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x564c57[_0x1e25('0x1c')]?_0x564c57[_0x1e25('0x1c')]['where']||null:null,'attributes':_0x564c57[_0x1e25('0x1c')]?_0x564c57[_0x1e25('0x1c')]['attributes']||null:null,'limit':_0x564c57[_0x1e25('0x1c')]?_0x564c57[_0x1e25('0x1c')]['limit']||null:null,'include':_0x564c57[_0x1e25('0x1c')]?_0x564c57[_0x1e25('0x1c')]['include']?_[_0x1e25('0x1d')](_0x564c57[_0x1e25('0x1c')][_0x1e25('0x1e')],function(_0x1c9f07){return{'model':db[_0x1c9f07['model']],'as':_0x1c9f07['as'],'attributes':_0x1c9f07[_0x1e25('0x1f')],'include':_0x1c9f07[_0x1e25('0x1e')]?_[_0x1e25('0x1d')](_0x1c9f07[_0x1e25('0x1e')],function(_0x5932d9){return{'model':db[_0x5932d9[_0x1e25('0x20')]],'as':_0x5932d9['as'],'attributes':_0x5932d9[_0x1e25('0x1f')],'include':_0x5932d9[_0x1e25('0x1e')]?_[_0x1e25('0x1d')](_0x5932d9[_0x1e25('0x1e')],function(_0x153840){return{'model':db[_0x153840['model']],'as':_0x153840['as'],'attributes':_0x153840['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e25('0xf')](function(_0x5f11d7){logger[_0x1e25('0x10')]('GetVoiceQueue',_0x564c57);logger[_0x1e25('0x21')](_0x1e25('0x19'),_0x564c57,JSON[_0x1e25('0x14')](_0x5f11d7));_0xb8b4df(_0x5f11d7);})[_0x1e25('0x18')](function(_0x4b9814){logger[_0x1e25('0x15')](_0x1e25('0x19'),_0x4b9814[_0x1e25('0x16')],_0x564c57);_0x288cda(_0x4908d4[_0x1e25('0x15')](0x1f4,_0x4b9814[_0x1e25('0x16')]));});});};exports[_0x1e25('0x22')]=function(_0x25e7c8){var _0x47a7d8=this;return new Promise(function(_0xd5b302,_0x39e12e){return db[_0x1e25('0x1a')][_0x1e25('0x23')]({'raw':_0x25e7c8[_0x1e25('0x1c')]?_0x25e7c8[_0x1e25('0x1c')][_0x1e25('0x24')]===undefined?!![]:![]:!![],'where':_0x25e7c8['options']?_0x25e7c8[_0x1e25('0x1c')][_0x1e25('0x25')]||null:null,'attributes':_0x25e7c8[_0x1e25('0x1c')]?_0x25e7c8[_0x1e25('0x1c')][_0x1e25('0x1f')]||null:null,'include':_0x25e7c8[_0x1e25('0x1c')]?_0x25e7c8[_0x1e25('0x1c')]['include']?_[_0x1e25('0x1d')](_0x25e7c8[_0x1e25('0x1c')][_0x1e25('0x1e')],function(_0x432a56){return{'model':db[_0x432a56[_0x1e25('0x20')]],'as':_0x432a56['as'],'attributes':_0x432a56[_0x1e25('0x1f')],'include':_0x432a56[_0x1e25('0x1e')]?_['map'](_0x432a56[_0x1e25('0x1e')],function(_0x1f179c){return{'model':db[_0x1f179c['model']],'as':_0x1f179c['as'],'attributes':_0x1f179c[_0x1e25('0x1f')],'include':_0x1f179c[_0x1e25('0x1e')]?_[_0x1e25('0x1d')](_0x1f179c[_0x1e25('0x1e')],function(_0x185cd2){return{'model':db[_0x185cd2[_0x1e25('0x20')]],'as':_0x185cd2['as'],'attributes':_0x185cd2[_0x1e25('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1e25('0xf')](function(_0x234cff){logger[_0x1e25('0x10')](_0x1e25('0x22'),_0x25e7c8);logger[_0x1e25('0x21')](_0x1e25('0x22'),_0x25e7c8,JSON['stringify'](_0x234cff));_0xd5b302(_0x234cff);})[_0x1e25('0x18')](function(_0x10b3f7){logger['error'](_0x1e25('0x22'),_0x10b3f7['message'],_0x25e7c8);_0x39e12e(_0x47a7d8[_0x1e25('0x15')](0x1f4,_0x10b3f7[_0x1e25('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index f34815c..8f4a618 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 _0x0a50=['register','length','voiceQueue:','./voiceQueue.events','save','remove','emit'];(function(_0x5d74a3,_0xb52baf){var _0x3f585d=function(_0x3ebe97){while(--_0x3ebe97){_0x5d74a3['push'](_0x5d74a3['shift']());}};_0x3f585d(++_0xb52baf);}(_0x0a50,0xc0));var _0x00a5=function(_0x11f24d,_0x58f26a){_0x11f24d=_0x11f24d-0x0;var _0x1a86e6=_0x0a50[_0x11f24d];return _0x1a86e6;};'use strict';var VoiceQueueEvents=require(_0x00a5('0x0'));var events=[_0x00a5('0x1'),_0x00a5('0x2'),'update'];function createListener(_0x4be0bf,_0x49148e){return function(_0x50c360){_0x49148e[_0x00a5('0x3')](_0x4be0bf,_0x50c360);};}function removeListener(_0x1778bb,_0x413bed){return function(){VoiceQueueEvents['removeListener'](_0x1778bb,_0x413bed);};}exports[_0x00a5('0x4')]=function(_0x252062){for(var _0x3d9d2d=0x0,_0x24db10=events[_0x00a5('0x5')];_0x3d9d2d<_0x24db10;_0x3d9d2d++){var _0x44d058=events[_0x3d9d2d];var _0x34415c=createListener(_0x00a5('0x6')+_0x44d058,_0x252062);VoiceQueueEvents['on'](_0x44d058,_0x34415c);}}; \ No newline at end of file +var _0x9f56=['save','update','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x9f56,0x119));var _0x69f5=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x9f56[_0x6e1239];return _0x418150;};'use strict';var VoiceQueueEvents=require(_0x69f5('0x0'));var events=[_0x69f5('0x1'),'remove',_0x69f5('0x2')];function createListener(_0x477dd4,_0x419b05){return function(_0x594f1e){_0x419b05['emit'](_0x477dd4,_0x594f1e);};}function removeListener(_0x20d58c,_0x1c395f){return function(){VoiceQueueEvents[_0x69f5('0x3')](_0x20d58c,_0x1c395f);};}exports[_0x69f5('0x4')]=function(_0x41da20){for(var _0x11b4fa=0x0,_0x4af219=events['length'];_0x11b4fa<_0x4af219;_0x11b4fa++){var _0x49e4d6=events[_0x11b4fa];var _0x1be371=createListener(_0x69f5('0x5')+_0x49e4d6,_0x41da20);VoiceQueueEvents['on'](_0x49e4d6,_0x1be371);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 2663098..7629e2f 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 _0x7e3d=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x7e3d,0x8a));var _0xd7e3=function(_0x16d09a,_0x4d863a){_0x16d09a=_0x16d09a-0x0;var _0x567bca=_0x7e3d[_0x16d09a];return _0x567bca;};'use strict';var multer=require(_0xd7e3('0x0'));var util=require(_0xd7e3('0x1'));var path=require(_0xd7e3('0x2'));var timeout=require(_0xd7e3('0x3'));var express=require(_0xd7e3('0x4'));var router=express[_0xd7e3('0x5')]();var fs_extra=require(_0xd7e3('0x6'));var auth=require(_0xd7e3('0x7'));var interaction=require(_0xd7e3('0x8'));var config=require(_0xd7e3('0x9'));var controller=require(_0xd7e3('0xa'));router[_0xd7e3('0xb')]('/',auth[_0xd7e3('0xc')](),controller['index']);router[_0xd7e3('0xb')]('/describe',auth[_0xd7e3('0xc')](),controller['describe']);router[_0xd7e3('0xb')]('/index',auth[_0xd7e3('0xc')](),controller['getVoiceQueuesReport']);router[_0xd7e3('0xb')](_0xd7e3('0xd'),auth['isAuthenticated'](),controller[_0xd7e3('0xe')]);router[_0xd7e3('0xf')]('/',auth[_0xd7e3('0xc')](),controller[_0xd7e3('0x10')]);router[_0xd7e3('0x11')](_0xd7e3('0xd'),auth[_0xd7e3('0xc')](),controller[_0xd7e3('0x12')]);router[_0xd7e3('0x13')](_0xd7e3('0xd'),auth[_0xd7e3('0xc')](),controller[_0xd7e3('0x14')]);module[_0xd7e3('0x15')]=router; \ No newline at end of file +var _0xe44e=['/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xc95742,_0xb1ef83){var _0x51c0fa=function(_0x52a12f){while(--_0x52a12f){_0xc95742['push'](_0xc95742['shift']());}};_0x51c0fa(++_0xb1ef83);}(_0xe44e,0x145));var _0xee44=function(_0x31b6b6,_0x3354aa){_0x31b6b6=_0x31b6b6-0x0;var _0x225ffe=_0xe44e[_0x31b6b6];return _0x225ffe;};'use strict';var multer=require(_0xee44('0x0'));var util=require(_0xee44('0x1'));var path=require(_0xee44('0x2'));var timeout=require(_0xee44('0x3'));var express=require('express');var router=express[_0xee44('0x4')]();var fs_extra=require(_0xee44('0x5'));var auth=require(_0xee44('0x6'));var interaction=require(_0xee44('0x7'));var config=require(_0xee44('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xee44('0x9')]('/',auth[_0xee44('0xa')](),controller['index']);router[_0xee44('0x9')](_0xee44('0xb'),auth[_0xee44('0xa')](),controller[_0xee44('0xc')]);router[_0xee44('0x9')](_0xee44('0xd'),auth[_0xee44('0xa')](),controller[_0xee44('0xe')]);router[_0xee44('0x9')](_0xee44('0xf'),auth['isAuthenticated'](),controller[_0xee44('0x10')]);router[_0xee44('0x11')]('/',auth['isAuthenticated'](),controller[_0xee44('0x12')]);router[_0xee44('0x13')]('/:id',auth[_0xee44('0xa')](),controller['update']);router['delete']('/:id',auth[_0xee44('0xa')](),controller[_0xee44('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index dc20465..2485bbc 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 _0x110d=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER'];(function(_0x535a20,_0x278ee4){var _0x13d870=function(_0x3ae1f0){while(--_0x3ae1f0){_0x535a20['push'](_0x535a20['shift']());}};_0x13d870(++_0x278ee4);}(_0x110d,0xc2));var _0xd110=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0x110d[_0xfb0cfd];return _0x2fd8aa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd110('0x0'));module[_0xd110('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd110('0x2')]},'calleridnum':{'type':Sequelize[_0xd110('0x2')]},'calleridname':{'type':Sequelize[_0xd110('0x2')]},'queue':{'type':Sequelize[_0xd110('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xd110('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xd110('0x3')],'set':function(_0x147d3f){var _0x5cd551=moment(_0x147d3f);var _0x221ccc=moment(this[_0xd110('0x4')]('queuecallerjoinAt'))['format'](_0xd110('0x5'));var _0x5d72ee=_0x5cd551[_0xd110('0x6')](_0x221ccc,'seconds');this[_0xd110('0x7')]('queuecallerleaveAt',_0x147d3f);this[_0xd110('0x7')](_0xd110('0x8'),_0x5d72ee||null);}},'position':{'type':Sequelize[_0xd110('0x9')]},'count':{'type':Sequelize[_0xd110('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xd110('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd110('0x3')]},'queuecallerexit':{'type':Sequelize[_0xd110('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xd110('0x2')],'comment':_0xd110('0xb')},'originalposition':{'type':Sequelize[_0xd110('0x9')]},'channel':{'type':Sequelize[_0xd110('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd110('0x2')]},'connectedlinename':{'type':Sequelize[_0xd110('0x2')]},'accountcode':{'type':Sequelize[_0xd110('0x2')]},'context':{'type':Sequelize[_0xd110('0x2')]},'exten':{'type':Sequelize[_0xd110('0x2')]},'priority':{'type':Sequelize[_0xd110('0x2')]},'holdtime':{'type':Sequelize[_0xd110('0x9')]},'mohtime':{'type':Sequelize[_0xd110('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd110('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd110('0x2')]},'transfer':{'type':Sequelize[_0xd110('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd110('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd110('0x2')]},'disposition':{'type':Sequelize[_0xd110('0x2')]},'secondDisposition':{'type':Sequelize[_0xd110('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd110('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdcec=['sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1ed7a0,_0x163e04){var _0x22108f=function(_0x4ed342){while(--_0x4ed342){_0x1ed7a0['push'](_0x1ed7a0['shift']());}};_0x22108f(++_0x163e04);}(_0xdcec,0xf0));var _0xcdce=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xdcec[_0x172ed7];return _0xfa8f61;};'use strict';var Sequelize=require(_0xcdce('0x0'));var moment=require('moment');module[_0xcdce('0x1')]={'type':{'type':Sequelize[_0xcdce('0x2')]},'uniqueid':{'type':Sequelize[_0xcdce('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xcdce('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xcdce('0x3')],'set':function(_0x2b26cb){var _0x4385dc=moment(_0x2b26cb);var _0x3e8cd9=moment(this[_0xcdce('0x4')]('queuecallerjoinAt'))[_0xcdce('0x5')](_0xcdce('0x6'));var _0x14726e=_0x4385dc[_0xcdce('0x7')](_0x3e8cd9,_0xcdce('0x8'));this[_0xcdce('0x9')](_0xcdce('0xa'),_0x2b26cb);this['setDataValue']('holdtime',_0x14726e||null);}},'position':{'type':Sequelize[_0xcdce('0xb')]},'count':{'type':Sequelize[_0xcdce('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xcdce('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xcdce('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcdce('0x3')]},'queuecallerexit':{'type':Sequelize[_0xcdce('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xcdce('0xd')},'originalposition':{'type':Sequelize[_0xcdce('0xb')]},'channel':{'type':Sequelize[_0xcdce('0x2')]},'connectedlinenum':{'type':Sequelize[_0xcdce('0x2')]},'connectedlinename':{'type':Sequelize[_0xcdce('0x2')]},'accountcode':{'type':Sequelize[_0xcdce('0x2')]},'context':{'type':Sequelize[_0xcdce('0x2')]},'exten':{'type':Sequelize[_0xcdce('0x2')]},'priority':{'type':Sequelize[_0xcdce('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xcdce('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcdce('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcdce('0x2')]},'transfer':{'type':Sequelize[_0xcdce('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcdce('0x2')],'comment':_0xcdce('0xe')},'transferexten':{'type':Sequelize[_0xcdce('0x2')]},'transferuniqueid':{'type':Sequelize[_0xcdce('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xcdce('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xcdce('0xb')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index f8f3d6e..bf5873f 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 _0x08c3=['fs-extra','squel','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','findAll','catch','show','keys','find','create','body','params','describe','getVoiceQueuesReport','length','pick','merge','include','rows','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4d48b7,_0x4da22c){var _0x1c1c57=function(_0x147f7c){while(--_0x147f7c){_0x4d48b7['push'](_0x4d48b7['shift']());}};_0x1c1c57(++_0x4da22c);}(_0x08c3,0xe2));var _0x308c=function(_0x374785,_0x4f71b8){_0x374785=_0x374785-0x0;var _0x572c40=_0x08c3[_0x374785];return _0x572c40;};'use strict';var emlformat=require(_0x308c('0x0'));var rimraf=require(_0x308c('0x1'));var zipdir=require(_0x308c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x308c('0x3'));var moment=require('moment');var BPromise=require(_0x308c('0x4'));var Mustache=require(_0x308c('0x5'));var util=require(_0x308c('0x6'));var path=require(_0x308c('0x7'));var sox=require(_0x308c('0x8'));var csv=require(_0x308c('0x9'));var ejs=require(_0x308c('0xa'));var fs=require('fs');var fs_extra=require(_0x308c('0xb'));var _=require('lodash');var squel=require(_0x308c('0xc'));var crypto=require('crypto');var jsforce=require(_0x308c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x308c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x308c('0xe'));var as=require(_0x308c('0xf'));var hardwareService=require(_0x308c('0x10'));var logger=require(_0x308c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x308c('0x12'));var licenseUtil=require(_0x308c('0x13'));var db=require(_0x308c('0x14'))['db'];config[_0x308c('0x15')]=_[_0x308c('0x16')](config[_0x308c('0x15')],{'host':_0x308c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x308c('0x18'))[_0x308c('0x19')](socket);function respondWithStatusCode(_0x2e9674,_0x4c30a5){_0x4c30a5=_0x4c30a5||0xcc;return function(_0x3a58cc){if(_0x3a58cc){return _0x2e9674[_0x308c('0x1a')](_0x4c30a5);}return _0x2e9674[_0x308c('0x1b')](_0x4c30a5)[_0x308c('0x1c')]();};}function respondWithResult(_0x56a1b7,_0x1cbfae){_0x1cbfae=_0x1cbfae||0xc8;return function(_0xde9d0c){if(_0xde9d0c){return _0x56a1b7[_0x308c('0x1b')](_0x1cbfae)[_0x308c('0x1d')](_0xde9d0c);}};}function respondWithFilteredResult(_0x2c7d34,_0x551e77){return function(_0x3b9d8c){if(_0x3b9d8c){var _0x55c363=typeof _0x551e77['offset']===_0x308c('0x1e')&&typeof _0x551e77[_0x308c('0x1f')]===_0x308c('0x1e');var _0x509dee=_0x3b9d8c[_0x308c('0x20')];var _0x3ad731=_0x55c363?0x0:_0x551e77[_0x308c('0x21')];var _0x56b495=_0x55c363?_0x3b9d8c[_0x308c('0x20')]:_0x551e77['offset']+_0x551e77['limit'];var _0x24bd9b;if(_0x56b495>=_0x509dee){_0x56b495=_0x509dee;_0x24bd9b=0xc8;}else{_0x24bd9b=0xce;}_0x2c7d34[_0x308c('0x1b')](_0x24bd9b);return _0x2c7d34[_0x308c('0x22')]('Content-Range',_0x3ad731+'-'+_0x56b495+'/'+_0x509dee)[_0x308c('0x1d')](_0x3b9d8c);}return null;};}function patchUpdates(_0x3ffcce){return function(_0x1abfdb){try{jsonpatch['apply'](_0x1abfdb,_0x3ffcce,!![]);}catch(_0x537be3){return BPromise[_0x308c('0x23')](_0x537be3);}return _0x1abfdb[_0x308c('0x24')]();};}function saveUpdates(_0x498e44,_0x42a833){return function(_0x47a5f9){if(_0x47a5f9){return _0x47a5f9[_0x308c('0x25')](_0x498e44)[_0x308c('0x26')](function(_0x3e18b1){return _0x3e18b1;});}return null;};}function removeEntity(_0x499eaf,_0x1bc34a){return function(_0x2bbe63){if(_0x2bbe63){return _0x2bbe63[_0x308c('0x27')]()['then'](function(){_0x499eaf['status'](0xcc)[_0x308c('0x1c')]();});}};}function handleEntityNotFound(_0x3dfe1e,_0x2b68bf){return function(_0x954bac){if(!_0x954bac){_0x3dfe1e['sendStatus'](0x194);}return _0x954bac;};}function handleError(_0x35ce5e,_0x72f758){_0x72f758=_0x72f758||0x1f4;return function(_0x5943a0){logger[_0x308c('0x28')](_0x5943a0[_0x308c('0x29')]);if(_0x5943a0[_0x308c('0x2a')]){delete _0x5943a0[_0x308c('0x2a')];}_0x35ce5e[_0x308c('0x1b')](_0x72f758)[_0x308c('0x2b')](_0x5943a0);};}exports[_0x308c('0x2c')]=function(_0x14315d,_0x1eade2){var _0x5c6756={},_0x2c7f80={},_0x296516={'count':0x0,'rows':[]};var _0x18a340=_[_0x308c('0x2d')](db[_0x308c('0x2e')][_0x308c('0x2f')],function(_0x1c8673){return{'name':_0x1c8673['fieldName'],'type':_0x1c8673[_0x308c('0x30')][_0x308c('0x31')]};});_0x2c7f80[_0x308c('0x32')]=_['map'](_0x18a340,'name');_0x2c7f80[_0x308c('0x33')]=_['keys'](_0x14315d[_0x308c('0x33')]);_0x2c7f80[_0x308c('0x34')]=_[_0x308c('0x35')](_0x2c7f80[_0x308c('0x32')],_0x2c7f80[_0x308c('0x33')]);_0x5c6756[_0x308c('0x36')]=_[_0x308c('0x35')](_0x2c7f80[_0x308c('0x32')],qs[_0x308c('0x37')](_0x14315d[_0x308c('0x33')][_0x308c('0x37')]));_0x5c6756[_0x308c('0x36')]=_0x5c6756['attributes']['length']?_0x5c6756[_0x308c('0x36')]:_0x2c7f80[_0x308c('0x32')];if(!_0x14315d[_0x308c('0x33')][_0x308c('0x38')](_0x308c('0x39'))){_0x5c6756[_0x308c('0x1f')]=qs[_0x308c('0x1f')](_0x14315d[_0x308c('0x33')][_0x308c('0x1f')]);_0x5c6756[_0x308c('0x21')]=qs['offset'](_0x14315d[_0x308c('0x33')]['offset']);}_0x5c6756['order']=qs[_0x308c('0x3a')](_0x14315d[_0x308c('0x33')][_0x308c('0x3a')]);_0x5c6756[_0x308c('0x3b')]=qs[_0x308c('0x34')](_['pick'](_0x14315d['query'],_0x2c7f80[_0x308c('0x34')]),_0x18a340);if(_0x14315d['query']['filter']){_0x5c6756['where']=_['merge'](_0x5c6756['where'],{'$or':_[_0x308c('0x2d')](_0x18a340,function(_0x1228fb){if(_0x1228fb[_0x308c('0x30')]!==_0x308c('0x3c')){var _0x3bc158={};_0x3bc158[_0x1228fb['name']]={'$like':'%'+_0x14315d['query'][_0x308c('0x3d')]+'%'};return _0x3bc158;}})});}_0x5c6756=_['merge']({},_0x5c6756,_0x14315d[_0x308c('0x3e')]);var _0x229091={'where':_0x5c6756[_0x308c('0x3b')]};return db[_0x308c('0x2e')][_0x308c('0x20')](_0x229091)[_0x308c('0x26')](function(_0x3645a4){_0x296516['count']=_0x3645a4;if(_0x14315d[_0x308c('0x33')][_0x308c('0x3f')]){_0x5c6756['include']=[{'all':!![]}];}return db[_0x308c('0x2e')][_0x308c('0x40')](_0x5c6756);})[_0x308c('0x26')](function(_0x381af1){_0x296516['rows']=_0x381af1;return _0x296516;})[_0x308c('0x26')](respondWithFilteredResult(_0x1eade2,_0x5c6756))[_0x308c('0x41')](handleError(_0x1eade2,null));};exports[_0x308c('0x42')]=function(_0x1348d3,_0x751bf6){var _0x57579e={'raw':![],'where':{'id':_0x1348d3['params']['id']}},_0xf75bc6={};_0xf75bc6[_0x308c('0x32')]=_[_0x308c('0x43')](db[_0x308c('0x2e')][_0x308c('0x2f')]);_0xf75bc6[_0x308c('0x33')]=_[_0x308c('0x43')](_0x1348d3['query']);_0xf75bc6[_0x308c('0x34')]=_[_0x308c('0x35')](_0xf75bc6[_0x308c('0x32')],_0xf75bc6[_0x308c('0x33')]);_0x57579e[_0x308c('0x36')]=_[_0x308c('0x35')](_0xf75bc6[_0x308c('0x32')],qs[_0x308c('0x37')](_0x1348d3[_0x308c('0x33')][_0x308c('0x37')]));_0x57579e[_0x308c('0x36')]=_0x57579e[_0x308c('0x36')]['length']?_0x57579e[_0x308c('0x36')]:_0xf75bc6[_0x308c('0x32')];if(_0x1348d3['query'][_0x308c('0x3f')]){_0x57579e['include']=[{'all':!![]}];}_0x57579e=_['merge']({},_0x57579e,_0x1348d3[_0x308c('0x3e')]);return db['VoiceQueueReport'][_0x308c('0x44')](_0x57579e)[_0x308c('0x26')](handleEntityNotFound(_0x751bf6,null))[_0x308c('0x26')](respondWithResult(_0x751bf6,null))[_0x308c('0x41')](handleError(_0x751bf6,null));};exports[_0x308c('0x45')]=function(_0x2343b2,_0x50025a){return db['VoiceQueueReport'][_0x308c('0x45')](_0x2343b2[_0x308c('0x46')],{})[_0x308c('0x26')](respondWithResult(_0x50025a,0xc9))['catch'](handleError(_0x50025a,null));};exports[_0x308c('0x25')]=function(_0x139957,_0x3237c1){if(_0x139957[_0x308c('0x46')]['id']){delete _0x139957['body']['id'];}return db[_0x308c('0x2e')][_0x308c('0x44')]({'where':{'id':_0x139957[_0x308c('0x47')]['id']}})[_0x308c('0x26')](handleEntityNotFound(_0x3237c1,null))[_0x308c('0x26')](saveUpdates(_0x139957[_0x308c('0x46')],null))[_0x308c('0x26')](respondWithResult(_0x3237c1,null))[_0x308c('0x41')](handleError(_0x3237c1,null));};exports[_0x308c('0x27')]=function(_0x598b9a,_0x393059){return db[_0x308c('0x2e')][_0x308c('0x44')]({'where':{'id':_0x598b9a[_0x308c('0x47')]['id']}})['then'](handleEntityNotFound(_0x393059,null))[_0x308c('0x26')](removeEntity(_0x393059,null))[_0x308c('0x41')](handleError(_0x393059,null));};exports[_0x308c('0x48')]=function(_0x589684,_0x507701){return db['VoiceQueueReport']['describe']()[_0x308c('0x26')](respondWithResult(_0x507701,null))[_0x308c('0x41')](handleError(_0x507701,null));};exports[_0x308c('0x49')]=function(_0x2bbb79,_0x4f72aa){var _0x1a2282={},_0x49c627={},_0x2f4698={'count':0x0,'rows':[]};_0x49c627[_0x308c('0x32')]=_[_0x308c('0x43')](db[_0x308c('0x2e')][_0x308c('0x2f')]);_0x49c627[_0x308c('0x33')]=_[_0x308c('0x43')](_0x2bbb79[_0x308c('0x33')]);_0x49c627[_0x308c('0x34')]=_[_0x308c('0x35')](_0x49c627['model'],_0x49c627[_0x308c('0x33')]);_0x1a2282[_0x308c('0x36')]=_[_0x308c('0x35')](_0x49c627[_0x308c('0x32')],qs[_0x308c('0x37')](_0x2bbb79['query'][_0x308c('0x37')]));_0x1a2282[_0x308c('0x36')]=_0x1a2282[_0x308c('0x36')][_0x308c('0x4a')]?_0x1a2282['attributes']:_0x49c627[_0x308c('0x32')];if(!_0x2bbb79['query'][_0x308c('0x38')](_0x308c('0x39'))){_0x1a2282[_0x308c('0x1f')]=qs[_0x308c('0x1f')](_0x2bbb79['query']['limit']);_0x1a2282[_0x308c('0x21')]=qs[_0x308c('0x21')](_0x2bbb79[_0x308c('0x33')][_0x308c('0x21')]);}_0x1a2282['order']=qs[_0x308c('0x3a')](_0x2bbb79[_0x308c('0x33')]['sort']);_0x1a2282[_0x308c('0x3b')]=qs[_0x308c('0x34')](_[_0x308c('0x4b')](_0x2bbb79['query'],_0x49c627[_0x308c('0x34')]));if(_0x2bbb79[_0x308c('0x33')]['filter']){_0x1a2282[_0x308c('0x3b')]=_[_0x308c('0x4c')](_0x1a2282[_0x308c('0x3b')],{'$or':_[_0x308c('0x2d')](_0x1a2282[_0x308c('0x36')],function(_0x4621c0){var _0x186e97={};_0x186e97[_0x4621c0]={'$like':'%'+_0x2bbb79[_0x308c('0x33')]['filter']+'%'};return _0x186e97;})});}_0x1a2282=_[_0x308c('0x4c')]({},_0x1a2282,_0x2bbb79[_0x308c('0x3e')]);var _0x1aa62d={'where':_0x1a2282['where']};return db['VoiceQueueReport'][_0x308c('0x20')](_0x1aa62d)[_0x308c('0x26')](function(_0x13afc9){_0x2f4698[_0x308c('0x20')]=_0x13afc9;if(_0x2bbb79['query']['includeAll']){_0x1a2282[_0x308c('0x4d')]=[{'all':!![]}];}return db[_0x308c('0x2e')][_0x308c('0x40')](_0x1a2282);})['then'](function(_0x87c46d){_0x2f4698[_0x308c('0x4e')]=_0x87c46d;return _0x2f4698;})['then'](respondWithFilteredResult(_0x4f72aa,_0x1a2282,'getVoiceQueuesReport'))[_0x308c('0x41')](handleError(_0x4f72aa,null,_0x308c('0x49')));}; \ No newline at end of file +var _0xc207=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','VoiceQueueReport','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','getVoiceQueuesReport','rows','eml-format','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring'];(function(_0x116bd6,_0x518d9b){var _0x4a179c=function(_0x4ce0af){while(--_0x4ce0af){_0x116bd6['push'](_0x116bd6['shift']());}};_0x4a179c(++_0x518d9b);}(_0xc207,0x1c7));var _0x7c20=function(_0x1afd3b,_0x212a08){_0x1afd3b=_0x1afd3b-0x0;var _0x21dd50=_0xc207[_0x1afd3b];return _0x21dd50;};'use strict';var emlformat=require(_0x7c20('0x0'));var rimraf=require(_0x7c20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7c20('0x2'));var BPromise=require(_0x7c20('0x3'));var Mustache=require(_0x7c20('0x4'));var util=require('util');var path=require(_0x7c20('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c20('0x6'));var fs=require('fs');var fs_extra=require(_0x7c20('0x7'));var _=require('lodash');var squel=require(_0x7c20('0x8'));var crypto=require(_0x7c20('0x9'));var jsforce=require(_0x7c20('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c20('0xb'));var querystring=require(_0x7c20('0xc'));var Papa=require(_0x7c20('0xd'));var Redis=require('ioredis');var authService=require(_0x7c20('0xe'));var qs=require(_0x7c20('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c20('0x10'))(_0x7c20('0x11'));var utils=require('../../config/utils');var config=require(_0x7c20('0x12'));var licenseUtil=require(_0x7c20('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7c20('0x14')](config[_0x7c20('0x15')],{'host':_0x7c20('0x16'),'port':0x18eb});var socket=require(_0x7c20('0x17'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x7c20('0x18')](socket);function respondWithStatusCode(_0x2ce950,_0x3feafa){_0x3feafa=_0x3feafa||0xcc;return function(_0x7ee2f8){if(_0x7ee2f8){return _0x2ce950[_0x7c20('0x19')](_0x3feafa);}return _0x2ce950[_0x7c20('0x1a')](_0x3feafa)[_0x7c20('0x1b')]();};}function respondWithResult(_0x2e1a01,_0x17d08e){_0x17d08e=_0x17d08e||0xc8;return function(_0x5281cd){if(_0x5281cd){return _0x2e1a01[_0x7c20('0x1a')](_0x17d08e)[_0x7c20('0x1c')](_0x5281cd);}};}function respondWithFilteredResult(_0x4efcd2,_0x24d6d6){return function(_0x47fc09){if(_0x47fc09){var _0x19cb42=typeof _0x24d6d6[_0x7c20('0x1d')]==='undefined'&&typeof _0x24d6d6[_0x7c20('0x1e')]===_0x7c20('0x1f');var _0x29fb93=_0x47fc09[_0x7c20('0x20')];var _0x5236e4=_0x19cb42?0x0:_0x24d6d6[_0x7c20('0x1d')];var _0x14b5e1=_0x19cb42?_0x47fc09[_0x7c20('0x20')]:_0x24d6d6[_0x7c20('0x1d')]+_0x24d6d6[_0x7c20('0x1e')];var _0x1cf591;if(_0x14b5e1>=_0x29fb93){_0x14b5e1=_0x29fb93;_0x1cf591=0xc8;}else{_0x1cf591=0xce;}_0x4efcd2[_0x7c20('0x1a')](_0x1cf591);return _0x4efcd2[_0x7c20('0x21')](_0x7c20('0x22'),_0x5236e4+'-'+_0x14b5e1+'/'+_0x29fb93)[_0x7c20('0x1c')](_0x47fc09);}return null;};}function patchUpdates(_0x26ba64){return function(_0x532f62){try{jsonpatch[_0x7c20('0x23')](_0x532f62,_0x26ba64,!![]);}catch(_0x2081e1){return BPromise['reject'](_0x2081e1);}return _0x532f62[_0x7c20('0x24')]();};}function saveUpdates(_0x1a9808,_0x3d8c09){return function(_0x2ad78d){if(_0x2ad78d){return _0x2ad78d[_0x7c20('0x25')](_0x1a9808)[_0x7c20('0x26')](function(_0x4b5065){return _0x4b5065;});}return null;};}function removeEntity(_0x3f8a46,_0x2f5801){return function(_0x55a691){if(_0x55a691){return _0x55a691['destroy']()[_0x7c20('0x26')](function(){_0x3f8a46[_0x7c20('0x1a')](0xcc)[_0x7c20('0x1b')]();});}};}function handleEntityNotFound(_0x2a7031,_0x5a2c2a){return function(_0x28a4e3){if(!_0x28a4e3){_0x2a7031['sendStatus'](0x194);}return _0x28a4e3;};}function handleError(_0x738a85,_0x498f71){_0x498f71=_0x498f71||0x1f4;return function(_0x45e7e8){logger[_0x7c20('0x27')](_0x45e7e8[_0x7c20('0x28')]);if(_0x45e7e8['name']){delete _0x45e7e8[_0x7c20('0x29')];}_0x738a85[_0x7c20('0x1a')](_0x498f71)[_0x7c20('0x2a')](_0x45e7e8);};}exports[_0x7c20('0x2b')]=function(_0x49c376,_0x1a4bce){var _0x1f5f4d={},_0x3a957f={},_0x283850={'count':0x0,'rows':[]};var _0x51f2de=_['map'](db[_0x7c20('0x2c')][_0x7c20('0x2d')],function(_0x31ba49){return{'name':_0x31ba49['fieldName'],'type':_0x31ba49[_0x7c20('0x2e')]['key']};});_0x3a957f[_0x7c20('0x2f')]=_[_0x7c20('0x30')](_0x51f2de,_0x7c20('0x29'));_0x3a957f[_0x7c20('0x31')]=_[_0x7c20('0x32')](_0x49c376[_0x7c20('0x31')]);_0x3a957f[_0x7c20('0x33')]=_[_0x7c20('0x34')](_0x3a957f[_0x7c20('0x2f')],_0x3a957f['query']);_0x1f5f4d[_0x7c20('0x35')]=_[_0x7c20('0x34')](_0x3a957f[_0x7c20('0x2f')],qs[_0x7c20('0x36')](_0x49c376['query'][_0x7c20('0x36')]));_0x1f5f4d[_0x7c20('0x35')]=_0x1f5f4d[_0x7c20('0x35')][_0x7c20('0x37')]?_0x1f5f4d['attributes']:_0x3a957f[_0x7c20('0x2f')];if(!_0x49c376[_0x7c20('0x31')][_0x7c20('0x38')](_0x7c20('0x39'))){_0x1f5f4d['limit']=qs[_0x7c20('0x1e')](_0x49c376['query']['limit']);_0x1f5f4d['offset']=qs[_0x7c20('0x1d')](_0x49c376[_0x7c20('0x31')][_0x7c20('0x1d')]);}_0x1f5f4d[_0x7c20('0x3a')]=qs['sort'](_0x49c376['query'][_0x7c20('0x3b')]);_0x1f5f4d[_0x7c20('0x3c')]=qs['filters'](_[_0x7c20('0x3d')](_0x49c376[_0x7c20('0x31')],_0x3a957f[_0x7c20('0x33')]),_0x51f2de);if(_0x49c376[_0x7c20('0x31')]['filter']){_0x1f5f4d['where']=_[_0x7c20('0x3e')](_0x1f5f4d[_0x7c20('0x3c')],{'$or':_[_0x7c20('0x30')](_0x51f2de,function(_0x4082e5){if(_0x4082e5[_0x7c20('0x2e')]!==_0x7c20('0x3f')){var _0x28b537={};_0x28b537[_0x4082e5[_0x7c20('0x29')]]={'$like':'%'+_0x49c376[_0x7c20('0x31')][_0x7c20('0x40')]+'%'};return _0x28b537;}})});}_0x1f5f4d=_['merge']({},_0x1f5f4d,_0x49c376[_0x7c20('0x41')]);var _0x529998={'where':_0x1f5f4d[_0x7c20('0x3c')]};return db[_0x7c20('0x2c')][_0x7c20('0x20')](_0x529998)['then'](function(_0x3b03cd){_0x283850[_0x7c20('0x20')]=_0x3b03cd;if(_0x49c376[_0x7c20('0x31')][_0x7c20('0x42')]){_0x1f5f4d[_0x7c20('0x43')]=[{'all':!![]}];}return db[_0x7c20('0x2c')][_0x7c20('0x44')](_0x1f5f4d);})[_0x7c20('0x26')](function(_0x3f7ccb){_0x283850['rows']=_0x3f7ccb;return _0x283850;})[_0x7c20('0x26')](respondWithFilteredResult(_0x1a4bce,_0x1f5f4d))[_0x7c20('0x45')](handleError(_0x1a4bce,null));};exports[_0x7c20('0x46')]=function(_0x1a3056,_0x1d2c89){var _0x47af5b={'raw':![],'where':{'id':_0x1a3056[_0x7c20('0x47')]['id']}},_0x5a9f38={};_0x5a9f38[_0x7c20('0x2f')]=_['keys'](db[_0x7c20('0x2c')][_0x7c20('0x2d')]);_0x5a9f38['query']=_[_0x7c20('0x32')](_0x1a3056[_0x7c20('0x31')]);_0x5a9f38[_0x7c20('0x33')]=_[_0x7c20('0x34')](_0x5a9f38['model'],_0x5a9f38[_0x7c20('0x31')]);_0x47af5b[_0x7c20('0x35')]=_[_0x7c20('0x34')](_0x5a9f38[_0x7c20('0x2f')],qs[_0x7c20('0x36')](_0x1a3056[_0x7c20('0x31')]['fields']));_0x47af5b[_0x7c20('0x35')]=_0x47af5b[_0x7c20('0x35')][_0x7c20('0x37')]?_0x47af5b['attributes']:_0x5a9f38['model'];if(_0x1a3056['query'][_0x7c20('0x42')]){_0x47af5b['include']=[{'all':!![]}];}_0x47af5b=_['merge']({},_0x47af5b,_0x1a3056['options']);return db[_0x7c20('0x2c')][_0x7c20('0x48')](_0x47af5b)[_0x7c20('0x26')](handleEntityNotFound(_0x1d2c89,null))[_0x7c20('0x26')](respondWithResult(_0x1d2c89,null))[_0x7c20('0x45')](handleError(_0x1d2c89,null));};exports['create']=function(_0x38dab4,_0x1a473e){return db['VoiceQueueReport'][_0x7c20('0x49')](_0x38dab4[_0x7c20('0x4a')],{})[_0x7c20('0x26')](respondWithResult(_0x1a473e,0xc9))[_0x7c20('0x45')](handleError(_0x1a473e,null));};exports[_0x7c20('0x25')]=function(_0x3cba2d,_0x1dff37){if(_0x3cba2d[_0x7c20('0x4a')]['id']){delete _0x3cba2d[_0x7c20('0x4a')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x3cba2d[_0x7c20('0x47')]['id']}})[_0x7c20('0x26')](handleEntityNotFound(_0x1dff37,null))[_0x7c20('0x26')](saveUpdates(_0x3cba2d[_0x7c20('0x4a')],null))[_0x7c20('0x26')](respondWithResult(_0x1dff37,null))['catch'](handleError(_0x1dff37,null));};exports['destroy']=function(_0x2c989a,_0x5155e3){return db[_0x7c20('0x2c')][_0x7c20('0x48')]({'where':{'id':_0x2c989a[_0x7c20('0x47')]['id']}})['then'](handleEntityNotFound(_0x5155e3,null))[_0x7c20('0x26')](removeEntity(_0x5155e3,null))['catch'](handleError(_0x5155e3,null));};exports[_0x7c20('0x4b')]=function(_0x4ae7c9,_0xfce831){return db[_0x7c20('0x2c')][_0x7c20('0x4b')]()[_0x7c20('0x26')](respondWithResult(_0xfce831,null))['catch'](handleError(_0xfce831,null));};exports[_0x7c20('0x4c')]=function(_0x2bdc8a,_0x205735){var _0x22bbed={},_0x2f0511={},_0x5ee025={'count':0x0,'rows':[]};_0x2f0511[_0x7c20('0x2f')]=_[_0x7c20('0x32')](db[_0x7c20('0x2c')][_0x7c20('0x2d')]);_0x2f0511['query']=_['keys'](_0x2bdc8a[_0x7c20('0x31')]);_0x2f0511[_0x7c20('0x33')]=_[_0x7c20('0x34')](_0x2f0511[_0x7c20('0x2f')],_0x2f0511[_0x7c20('0x31')]);_0x22bbed[_0x7c20('0x35')]=_[_0x7c20('0x34')](_0x2f0511[_0x7c20('0x2f')],qs[_0x7c20('0x36')](_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x36')]));_0x22bbed['attributes']=_0x22bbed[_0x7c20('0x35')]['length']?_0x22bbed[_0x7c20('0x35')]:_0x2f0511[_0x7c20('0x2f')];if(!_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x38')](_0x7c20('0x39'))){_0x22bbed['limit']=qs[_0x7c20('0x1e')](_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x1e')]);_0x22bbed[_0x7c20('0x1d')]=qs[_0x7c20('0x1d')](_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x1d')]);}_0x22bbed[_0x7c20('0x3a')]=qs['sort'](_0x2bdc8a['query'][_0x7c20('0x3b')]);_0x22bbed[_0x7c20('0x3c')]=qs[_0x7c20('0x33')](_[_0x7c20('0x3d')](_0x2bdc8a[_0x7c20('0x31')],_0x2f0511[_0x7c20('0x33')]));if(_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x40')]){_0x22bbed[_0x7c20('0x3c')]=_[_0x7c20('0x3e')](_0x22bbed['where'],{'$or':_[_0x7c20('0x30')](_0x22bbed[_0x7c20('0x35')],function(_0x41a93c){var _0x18a96a={};_0x18a96a[_0x41a93c]={'$like':'%'+_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x40')]+'%'};return _0x18a96a;})});}_0x22bbed=_['merge']({},_0x22bbed,_0x2bdc8a[_0x7c20('0x41')]);var _0x3b0602={'where':_0x22bbed[_0x7c20('0x3c')]};return db[_0x7c20('0x2c')]['count'](_0x3b0602)[_0x7c20('0x26')](function(_0x3f3594){_0x5ee025[_0x7c20('0x20')]=_0x3f3594;if(_0x2bdc8a[_0x7c20('0x31')][_0x7c20('0x42')]){_0x22bbed[_0x7c20('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7c20('0x44')](_0x22bbed);})[_0x7c20('0x26')](function(_0x152548){_0x5ee025[_0x7c20('0x4d')]=_0x152548;return _0x5ee025;})['then'](respondWithFilteredResult(_0x205735,_0x22bbed,_0x7c20('0x4c')))[_0x7c20('0x45')](handleError(_0x205735,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 483993e..842ddde 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 _0xbb11=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport'];(function(_0x32cc4d,_0x4a5e15){var _0xaa5ab0=function(_0x762a8d){while(--_0x762a8d){_0x32cc4d['push'](_0x32cc4d['shift']());}};_0xaa5ab0(++_0x4a5e15);}(_0xbb11,0x1d3));var _0x1bb1=function(_0x4d0e35,_0x3916de){_0x4d0e35=_0x4d0e35-0x0;var _0x2b22c3=_0xbb11[_0x4d0e35];return _0x2b22c3;};'use strict';var EventEmitter=require(_0x1bb1('0x0'));var VoiceQueueReport=require(_0x1bb1('0x1'))['db'][_0x1bb1('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1bb1('0x3')](0x0);var events={'afterCreate':_0x1bb1('0x4'),'afterUpdate':_0x1bb1('0x5'),'afterDestroy':_0x1bb1('0x6')};function emitEvent(_0x21e20c){return function(_0x5cb5dc,_0x58f51c,_0x5524b9){VoiceQueueReportEvents[_0x1bb1('0x7')](_0x21e20c+':'+_0x5cb5dc['id'],_0x5cb5dc);VoiceQueueReportEvents[_0x1bb1('0x7')](_0x21e20c,_0x5cb5dc);_0x5524b9(null);};}for(var e in events){if(events[_0x1bb1('0x8')](e)){var event=events[e];VoiceQueueReport[_0x1bb1('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x62a8=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x55b52a,_0x50d9d8){var _0x3a9c45=function(_0x5af7a1){while(--_0x5af7a1){_0x55b52a['push'](_0x55b52a['shift']());}};_0x3a9c45(++_0x50d9d8);}(_0x62a8,0x1c7));var _0x862a=function(_0x2bed44,_0x217bf1){_0x2bed44=_0x2bed44-0x0;var _0x11fc5c=_0x62a8[_0x2bed44];return _0x11fc5c;};'use strict';var EventEmitter=require(_0x862a('0x0'));var VoiceQueueReport=require(_0x862a('0x1'))['db'][_0x862a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x862a('0x3'),'afterUpdate':_0x862a('0x4'),'afterDestroy':_0x862a('0x5')};function emitEvent(_0x453857){return function(_0x294550,_0x527c87,_0x19bb92){VoiceQueueReportEvents['emit'](_0x453857+':'+_0x294550['id'],_0x294550);VoiceQueueReportEvents[_0x862a('0x6')](_0x453857,_0x294550);_0x19bb92(null);};}for(var e in events){if(events[_0x862a('0x7')](e)){var event=events[e];VoiceQueueReport[_0x862a('0x8')](e,emitEvent(event));}}module[_0x862a('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a28b210..7bba6e5 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 _0xe9fd=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue','calleridnum','lodash','../../config/logger','api','moment'];(function(_0x21b4cf,_0x4ffd5f){var _0x560093=function(_0x12ea2e){while(--_0x12ea2e){_0x21b4cf['push'](_0x21b4cf['shift']());}};_0x560093(++_0x4ffd5f);}(_0xe9fd,0x14e));var _0xde9f=function(_0x2aadb9,_0x4d0705){_0x2aadb9=_0x2aadb9-0x0;var _0x2dc9b6=_0xe9fd[_0x2aadb9];return _0x2dc9b6;};'use strict';var _=require(_0xde9f('0x0'));var util=require('util');var logger=require(_0xde9f('0x1'))(_0xde9f('0x2'));var moment=require(_0xde9f('0x3'));var BPromise=require(_0xde9f('0x4'));var rp=require(_0xde9f('0x5'));var fs=require('fs');var path=require(_0xde9f('0x6'));var rimraf=require(_0xde9f('0x7'));var config=require(_0xde9f('0x8'));var attributes=require(_0xde9f('0x9'));module['exports']=function(_0x478562,_0x22ec51){return _0x478562['define'](_0xde9f('0xa'),attributes,{'tableName':_0xde9f('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xde9f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98e8=['define','VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x132787,_0x49aebb){var _0x281428=function(_0x5e354e){while(--_0x5e354e){_0x132787['push'](_0x132787['shift']());}};_0x281428(++_0x49aebb);}(_0x98e8,0x10e));var _0x898e=function(_0x79221a,_0x588c19){_0x79221a=_0x79221a-0x0;var _0x323cee=_0x98e8[_0x79221a];return _0x323cee;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var logger=require(_0x898e('0x2'))(_0x898e('0x3'));var moment=require('moment');var BPromise=require(_0x898e('0x4'));var rp=require(_0x898e('0x5'));var fs=require('fs');var path=require(_0x898e('0x6'));var rimraf=require('rimraf');var config=require(_0x898e('0x7'));var attributes=require(_0x898e('0x8'));module[_0x898e('0x9')]=function(_0xa016de,_0x37bb10){return _0xa016de[_0x898e('0xa')](_0x898e('0xb'),attributes,{'tableName':_0x898e('0xc'),'paranoid':![],'indexes':[{'fields':[_0x898e('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 337da0b..3eb381f 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 _0x1f88=['localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','map','model','include','stringify','CreateVoiceQueueReport','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x4ee698,_0x4b588f){var _0x503343=function(_0x385a5){while(--_0x385a5){_0x4ee698['push'](_0x4ee698['shift']());}};_0x503343(++_0x4b588f);}(_0x1f88,0x1b6));var _0x81f8=function(_0x113c2a,_0x3a5d1e){_0x113c2a=_0x113c2a-0x0;var _0x34cea6=_0x1f88[_0x113c2a];return _0x34cea6;};'use strict';var _=require(_0x81f8('0x0'));var util=require(_0x81f8('0x1'));var moment=require(_0x81f8('0x2'));var BPromise=require(_0x81f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81f8('0x4'));var db=require(_0x81f8('0x5'))['db'];var utils=require(_0x81f8('0x6'));var logger=require(_0x81f8('0x7'))(_0x81f8('0x8'));var config=require(_0x81f8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81f8('0xa')][_0x81f8('0xb')]({'port':0x232a});config[_0x81f8('0xc')]=_['defaults'](config[_0x81f8('0xc')],{'host':_0x81f8('0xd'),'port':0x18eb});var socket=require(_0x81f8('0xe'))(new Redis(config[_0x81f8('0xc')]));require(_0x81f8('0xf'))[_0x81f8('0x10')](socket);function respondWithRpcPromise(_0x432829,_0xf4751b,_0x190823){return new BPromise(function(_0x1dd01a,_0x40f484){return client[_0x81f8('0x11')](_0x432829,_0x190823)[_0x81f8('0x12')](function(_0x2fe7ff){logger[_0x81f8('0x13')](_0x81f8('0x14'),_0xf4751b,_0x81f8('0x15'));logger[_0x81f8('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xf4751b,'request\x20sent',JSON['stringify'](_0x2fe7ff));if(_0x2fe7ff[_0x81f8('0x17')]){if(_0x2fe7ff[_0x81f8('0x17')]['code']===0x1f4){logger['error'](_0x81f8('0x14'),_0xf4751b,_0x2fe7ff[_0x81f8('0x17')][_0x81f8('0x18')]);return _0x40f484(_0x2fe7ff[_0x81f8('0x17')][_0x81f8('0x18')]);}logger[_0x81f8('0x17')](_0x81f8('0x14'),_0xf4751b,_0x2fe7ff[_0x81f8('0x17')]['message']);return _0x1dd01a(_0x2fe7ff[_0x81f8('0x17')]['message']);}else{logger[_0x81f8('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xf4751b,_0x81f8('0x15'));_0x1dd01a(_0x2fe7ff['result'][_0x81f8('0x18')]);}})[_0x81f8('0x19')](function(_0x58d89f){logger[_0x81f8('0x17')](_0x81f8('0x14'),_0xf4751b,_0x58d89f);_0x40f484(_0x58d89f);});});}exports[_0x81f8('0x1a')]=function(_0x5eef89){var _0x3f3b5f=this;return new Promise(function(_0x4aa6ee,_0x1f1607){return db[_0x81f8('0x1b')][_0x81f8('0x1c')]({'raw':_0x5eef89['options']?_0x5eef89[_0x81f8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5eef89[_0x81f8('0x1d')]?_0x5eef89[_0x81f8('0x1d')][_0x81f8('0x1e')]||null:null,'attributes':_0x5eef89[_0x81f8('0x1d')]?_0x5eef89[_0x81f8('0x1d')][_0x81f8('0x1f')]||null:null,'limit':_0x5eef89[_0x81f8('0x1d')]?_0x5eef89[_0x81f8('0x1d')][_0x81f8('0x20')]||null:null,'include':_0x5eef89['options']?_0x5eef89[_0x81f8('0x1d')]['include']?_[_0x81f8('0x21')](_0x5eef89['options']['include'],function(_0x399998){return{'model':db[_0x399998[_0x81f8('0x22')]],'as':_0x399998['as'],'attributes':_0x399998[_0x81f8('0x1f')],'include':_0x399998['include']?_[_0x81f8('0x21')](_0x399998[_0x81f8('0x23')],function(_0x23d1bd){return{'model':db[_0x23d1bd[_0x81f8('0x22')]],'as':_0x23d1bd['as'],'attributes':_0x23d1bd['attributes'],'include':_0x23d1bd[_0x81f8('0x23')]?_[_0x81f8('0x21')](_0x23d1bd['include'],function(_0xb58630){return{'model':db[_0xb58630[_0x81f8('0x22')]],'as':_0xb58630['as'],'attributes':_0xb58630[_0x81f8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x81f8('0x12')](function(_0x19614e){logger[_0x81f8('0x13')](_0x81f8('0x1a'),_0x5eef89);logger[_0x81f8('0x16')](_0x81f8('0x1a'),_0x5eef89,JSON[_0x81f8('0x24')](_0x19614e));_0x4aa6ee(_0x19614e);})['catch'](function(_0x33fe51){logger[_0x81f8('0x17')](_0x81f8('0x1a'),_0x33fe51[_0x81f8('0x18')],_0x5eef89);_0x1f1607(_0x3f3b5f[_0x81f8('0x17')](0x1f4,_0x33fe51[_0x81f8('0x18')]));});});};exports[_0x81f8('0x25')]=function(_0x114643){var _0x324f19=this;return new Promise(function(_0x16072f,_0x597a02){return db['VoiceQueueReport']['create'](_0x114643['body'],{'raw':_0x114643[_0x81f8('0x1d')]?_0x114643[_0x81f8('0x1d')][_0x81f8('0x26')]===undefined?!![]:![]:!![]})[_0x81f8('0x12')](function(_0x1da059){logger[_0x81f8('0x13')](_0x81f8('0x25'),_0x114643);logger[_0x81f8('0x16')](_0x81f8('0x25'),_0x114643,JSON['stringify'](_0x1da059));_0x16072f(_0x1da059);})['catch'](function(_0x43c043){logger[_0x81f8('0x17')](_0x81f8('0x25'),_0x43c043[_0x81f8('0x18')],_0x114643);_0x597a02(_0x324f19[_0x81f8('0x17')](0x1f4,_0x43c043[_0x81f8('0x18')]));});});};exports[_0x81f8('0x27')]=function(_0x4d40fd){var _0x38623f=this;return new Promise(function(_0x525721,_0x50476d){return db[_0x81f8('0x1b')][_0x81f8('0x28')](_0x4d40fd['body'],{'raw':_0x4d40fd[_0x81f8('0x1d')]?_0x4d40fd['options'][_0x81f8('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d40fd[_0x81f8('0x1d')]?_0x4d40fd[_0x81f8('0x1d')]['where']||null:null,'attributes':_0x4d40fd['options']?_0x4d40fd[_0x81f8('0x1d')][_0x81f8('0x1f')]||null:null,'limit':_0x4d40fd[_0x81f8('0x1d')]?_0x4d40fd[_0x81f8('0x1d')]['limit']||null:null})[_0x81f8('0x12')](function(_0xfafa61){logger[_0x81f8('0x13')](_0x81f8('0x27'),_0x4d40fd);logger[_0x81f8('0x16')](_0x81f8('0x27'),_0x4d40fd,JSON[_0x81f8('0x24')](_0xfafa61));_0x525721(_0xfafa61);})['catch'](function(_0x1874c7){logger['error'](_0x81f8('0x27'),_0x1874c7[_0x81f8('0x18')],_0x4d40fd);_0x50476d(_0x38623f[_0x81f8('0x17')](0x1f4,_0x1874c7[_0x81f8('0x18')]));});});}; \ No newline at end of file +var _0x308e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','GetVoiceQueueReport','VoiceQueueReport','options','attributes','limit','include','map','model','catch','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','where','util','moment','ioredis','../../mysqldb'];(function(_0x14dde2,_0x3ec312){var _0x31418c=function(_0x5aeed3){while(--_0x5aeed3){_0x14dde2['push'](_0x14dde2['shift']());}};_0x31418c(++_0x3ec312);}(_0x308e,0x1e8));var _0xe308=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x308e[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0xe308('0x0'));var moment=require(_0xe308('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe308('0x2'));var db=require(_0xe308('0x3'))['db'];var utils=require(_0xe308('0x4'));var logger=require(_0xe308('0x5'))(_0xe308('0x6'));var config=require(_0xe308('0x7'));var jayson=require(_0xe308('0x8'));var client=jayson[_0xe308('0x9')][_0xe308('0xa')]({'port':0x232a});config[_0xe308('0xb')]=_[_0xe308('0xc')](config[_0xe308('0xb')],{'host':_0xe308('0xd'),'port':0x18eb});var socket=require(_0xe308('0xe'))(new Redis(config[_0xe308('0xb')]));require(_0xe308('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e800e,_0x21a260,_0x54dcf7){return new BPromise(function(_0x3d067f,_0x27a045){return client['request'](_0x1e800e,_0x54dcf7)[_0xe308('0x10')](function(_0x590235){logger['info'](_0xe308('0x11'),_0x21a260,_0xe308('0x12'));logger[_0xe308('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x21a260,_0xe308('0x12'),JSON[_0xe308('0x14')](_0x590235));if(_0x590235[_0xe308('0x15')]){if(_0x590235[_0xe308('0x15')][_0xe308('0x16')]===0x1f4){logger[_0xe308('0x15')](_0xe308('0x11'),_0x21a260,_0x590235[_0xe308('0x15')]['message']);return _0x27a045(_0x590235[_0xe308('0x15')][_0xe308('0x17')]);}logger['error'](_0xe308('0x11'),_0x21a260,_0x590235[_0xe308('0x15')][_0xe308('0x17')]);return _0x3d067f(_0x590235[_0xe308('0x15')][_0xe308('0x17')]);}else{logger[_0xe308('0x18')](_0xe308('0x11'),_0x21a260,_0xe308('0x12'));_0x3d067f(_0x590235['result'][_0xe308('0x17')]);}})['catch'](function(_0x14fb77){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x21a260,_0x14fb77);_0x27a045(_0x14fb77);});});}exports[_0xe308('0x19')]=function(_0x49a574){var _0x1956eb=this;return new Promise(function(_0x2e008f,_0x4757ad){return db[_0xe308('0x1a')]['findAll']({'raw':_0x49a574[_0xe308('0x1b')]?_0x49a574[_0xe308('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x49a574[_0xe308('0x1b')]?_0x49a574[_0xe308('0x1b')]['where']||null:null,'attributes':_0x49a574[_0xe308('0x1b')]?_0x49a574['options'][_0xe308('0x1c')]||null:null,'limit':_0x49a574[_0xe308('0x1b')]?_0x49a574[_0xe308('0x1b')][_0xe308('0x1d')]||null:null,'include':_0x49a574[_0xe308('0x1b')]?_0x49a574['options'][_0xe308('0x1e')]?_[_0xe308('0x1f')](_0x49a574[_0xe308('0x1b')][_0xe308('0x1e')],function(_0x5da4a9){return{'model':db[_0x5da4a9[_0xe308('0x20')]],'as':_0x5da4a9['as'],'attributes':_0x5da4a9[_0xe308('0x1c')],'include':_0x5da4a9['include']?_[_0xe308('0x1f')](_0x5da4a9[_0xe308('0x1e')],function(_0x397154){return{'model':db[_0x397154[_0xe308('0x20')]],'as':_0x397154['as'],'attributes':_0x397154[_0xe308('0x1c')],'include':_0x397154[_0xe308('0x1e')]?_[_0xe308('0x1f')](_0x397154[_0xe308('0x1e')],function(_0x3ebac3){return{'model':db[_0x3ebac3['model']],'as':_0x3ebac3['as'],'attributes':_0x3ebac3['attributes']};}):[]};}):[]};}):[]:[]})[_0xe308('0x10')](function(_0x4e985d){logger[_0xe308('0x18')](_0xe308('0x19'),_0x49a574);logger[_0xe308('0x13')](_0xe308('0x19'),_0x49a574,JSON[_0xe308('0x14')](_0x4e985d));_0x2e008f(_0x4e985d);})[_0xe308('0x21')](function(_0x534d88){logger[_0xe308('0x15')]('GetVoiceQueueReport',_0x534d88[_0xe308('0x17')],_0x49a574);_0x4757ad(_0x1956eb[_0xe308('0x15')](0x1f4,_0x534d88[_0xe308('0x17')]));});});};exports[_0xe308('0x22')]=function(_0x2943d4){var _0x5dc1da=this;return new Promise(function(_0x392b00,_0x3821bb){return db[_0xe308('0x1a')][_0xe308('0x23')](_0x2943d4[_0xe308('0x24')],{'raw':_0x2943d4[_0xe308('0x1b')]?_0x2943d4['options'][_0xe308('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9431){logger[_0xe308('0x18')](_0xe308('0x22'),_0x2943d4);logger['debug'](_0xe308('0x22'),_0x2943d4,JSON[_0xe308('0x14')](_0x4e9431));_0x392b00(_0x4e9431);})[_0xe308('0x21')](function(_0x4b148b){logger[_0xe308('0x15')](_0xe308('0x22'),_0x4b148b[_0xe308('0x17')],_0x2943d4);_0x3821bb(_0x5dc1da['error'](0x1f4,_0x4b148b[_0xe308('0x17')]));});});};exports[_0xe308('0x26')]=function(_0x41f15c){var _0x183db8=this;return new Promise(function(_0x9ffd07,_0x422a41){return db[_0xe308('0x1a')][_0xe308('0x27')](_0x41f15c[_0xe308('0x24')],{'raw':_0x41f15c[_0xe308('0x1b')]?_0x41f15c[_0xe308('0x1b')][_0xe308('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f15c[_0xe308('0x1b')]?_0x41f15c[_0xe308('0x1b')][_0xe308('0x28')]||null:null,'attributes':_0x41f15c[_0xe308('0x1b')]?_0x41f15c['options'][_0xe308('0x1c')]||null:null,'limit':_0x41f15c[_0xe308('0x1b')]?_0x41f15c[_0xe308('0x1b')][_0xe308('0x1d')]||null:null})[_0xe308('0x10')](function(_0xb0ea0b){logger[_0xe308('0x18')](_0xe308('0x26'),_0x41f15c);logger['debug']('UpdateVoiceQueueReport',_0x41f15c,JSON[_0xe308('0x14')](_0xb0ea0b));_0x9ffd07(_0xb0ea0b);})[_0xe308('0x21')](function(_0x32cad9){logger['error'](_0xe308('0x26'),_0x32cad9[_0xe308('0x17')],_0x41f15c);_0x422a41(_0x183db8[_0xe308('0x15')](0x1f4,_0x32cad9[_0xe308('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index d5b74bd..e71a87d 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 _0x16a7=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x819b1,_0x25ca36){var _0x15aa26=function(_0x51cee8){while(--_0x51cee8){_0x819b1['push'](_0x819b1['shift']());}};_0x15aa26(++_0x25ca36);}(_0x16a7,0xa5));var _0x716a=function(_0x3fbc70,_0x2fd217){_0x3fbc70=_0x3fbc70-0x0;var _0x5d3e11=_0x16a7[_0x3fbc70];return _0x5d3e11;};'use strict';var VoiceQueueReportEvents=require(_0x716a('0x0'));var events=[_0x716a('0x1'),_0x716a('0x2'),_0x716a('0x3')];function createListener(_0x4aa23e,_0x4d0520){return function(_0x437ff8){_0x4d0520[_0x716a('0x4')](_0x4aa23e,_0x437ff8);};}function removeListener(_0x56d122,_0x128002){return function(){VoiceQueueReportEvents[_0x716a('0x5')](_0x56d122,_0x128002);};}exports[_0x716a('0x6')]=function(_0x68977a){for(var _0x22b026=0x0,_0x557d05=events[_0x716a('0x7')];_0x22b026<_0x557d05;_0x22b026++){var _0x1ee0e2=events[_0x22b026];var _0x724309=createListener(_0x716a('0x8')+_0x1ee0e2,_0x68977a);VoiceQueueReportEvents['on'](_0x1ee0e2,_0x724309);}}; \ No newline at end of file +var _0xa8c4=['save','remove','emit','removeListener','register','length','voiceQueueReport:'];(function(_0xf7e3ad,_0x205c01){var _0x1f2aae=function(_0x134e0d){while(--_0x134e0d){_0xf7e3ad['push'](_0xf7e3ad['shift']());}};_0x1f2aae(++_0x205c01);}(_0xa8c4,0x12d));var _0x4a8c=function(_0x3cfcb9,_0x23afe8){_0x3cfcb9=_0x3cfcb9-0x0;var _0x53435f=_0xa8c4[_0x3cfcb9];return _0x53435f;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x4a8c('0x0'),_0x4a8c('0x1'),'update'];function createListener(_0xcd762c,_0x467ef5){return function(_0x4ddf3b){_0x467ef5[_0x4a8c('0x2')](_0xcd762c,_0x4ddf3b);};}function removeListener(_0x402ceb,_0x3eb6cf){return function(){VoiceQueueReportEvents[_0x4a8c('0x3')](_0x402ceb,_0x3eb6cf);};}exports[_0x4a8c('0x4')]=function(_0x392c01){for(var _0x1e8a2d=0x0,_0x3d05e7=events[_0x4a8c('0x5')];_0x1e8a2d<_0x3d05e7;_0x1e8a2d++){var _0x455f94=events[_0x1e8a2d];var _0x59d4ec=createListener(_0x4a8c('0x6')+_0x455f94,_0x392c01);VoiceQueueReportEvents['on'](_0x455f94,_0x59d4ec);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index bad6603..caebbb1 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 _0xb37f=['util','path','Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','isAuthenticated','post','create','update','delete','destroy'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xb37f,0x1ef));var _0xfb37=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xb37f[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0xfb37('0x0'));var path=require(_0xfb37('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb37('0x2')]();var fs_extra=require(_0xfb37('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb37('0x4'));var controller=require(_0xfb37('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb37('0x6')]);router[_0xfb37('0x7')](_0xfb37('0x8'),auth[_0xfb37('0x9')](),controller['show']);router[_0xfb37('0xa')]('/',auth[_0xfb37('0x9')](),controller[_0xfb37('0xb')]);router['put'](_0xfb37('0x8'),auth[_0xfb37('0x9')](),controller[_0xfb37('0xc')]);router[_0xfb37('0xd')]('/:id',auth[_0xfb37('0x9')](),controller[_0xfb37('0xe')]);module['exports']=router; \ No newline at end of file +var _0x850f=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59b32a,_0x278c25){var _0x57483b=function(_0x3b4359){while(--_0x3b4359){_0x59b32a['push'](_0x59b32a['shift']());}};_0x57483b(++_0x278c25);}(_0x850f,0xff));var _0xf850=function(_0x3ab46e,_0x55e6f1){_0x3ab46e=_0x3ab46e-0x0;var _0x59ec21=_0x850f[_0x3ab46e];return _0x59ec21;};'use strict';var multer=require(_0xf850('0x0'));var util=require(_0xf850('0x1'));var path=require(_0xf850('0x2'));var timeout=require(_0xf850('0x3'));var express=require(_0xf850('0x4'));var router=express[_0xf850('0x5')]();var fs_extra=require(_0xf850('0x6'));var auth=require(_0xf850('0x7'));var interaction=require(_0xf850('0x8'));var config=require(_0xf850('0x9'));var controller=require(_0xf850('0xa'));router[_0xf850('0xb')]('/',auth[_0xf850('0xc')](),controller[_0xf850('0xd')]);router[_0xf850('0xb')](_0xf850('0xe'),auth[_0xf850('0xc')](),controller[_0xf850('0xf')]);router[_0xf850('0x10')]('/',auth['isAuthenticated'](),controller[_0xf850('0x11')]);router['put'](_0xf850('0xe'),auth['isAuthenticated'](),controller[_0xf850('0x12')]);router[_0xf850('0x13')](_0xf850('0xe'),auth[_0xf850('0xc')](),controller[_0xf850('0x14')]);module[_0xf850('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8b6b068..4aaf594 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 _0xb81c=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','literal'];(function(_0x483087,_0xf15c10){var _0x26ec35=function(_0x4e3d89){while(--_0x4e3d89){_0x483087['push'](_0x483087['shift']());}};_0x26ec35(++_0xf15c10);}(_0xb81c,0x79));var _0xcb81=function(_0x3c87f0,_0x2181d8){_0x3c87f0=_0x3c87f0-0x0;var _0x5213bb=_0xb81c[_0x3c87f0];return _0x5213bb;};'use strict';var Sequelize=require(_0xcb81('0x0'));var moment=require(_0xcb81('0x1'));module[_0xcb81('0x2')]={'time':{'type':Sequelize[_0xcb81('0x3')]},'callid':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xcb81('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xcb81('0x4')](_0xcb81('0x5'))}}; \ No newline at end of file +var _0x9e62=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','STRING','DATE'];(function(_0x1fdead,_0x241323){var _0x2d33d=function(_0x2ebc38){while(--_0x2ebc38){_0x1fdead['push'](_0x1fdead['shift']());}};_0x2d33d(++_0x241323);}(_0x9e62,0x17c));var _0x29e6=function(_0x5277f9,_0x300dfc){_0x5277f9=_0x5277f9-0x0;var _0x20c80f=_0x9e62[_0x5277f9];return _0x20c80f;};'use strict';var Sequelize=require(_0x29e6('0x0'));var moment=require(_0x29e6('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x29e6('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x29e6('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x29e6('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x29e6('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x29e6('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x29e6('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x29e6('0x4')](_0x29e6('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2d9ed9f..1b8c028 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 _0x7600=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','VoiceQueuesLog','includeAll','findAll','rows','show','params','rawAttributes','merge','catch','create','body','update','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4ba10c,_0x1607a4){var _0x19b640=function(_0x292638){while(--_0x292638){_0x4ba10c['push'](_0x4ba10c['shift']());}};_0x19b640(++_0x1607a4);}(_0x7600,0x8c));var _0x0760=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x7600[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x0760('0x0'));var rimraf=require(_0x0760('0x1'));var zipdir=require(_0x0760('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0760('0x3'));var moment=require(_0x0760('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0760('0x5'));var util=require(_0x0760('0x6'));var path=require(_0x0760('0x7'));var sox=require(_0x0760('0x8'));var csv=require(_0x0760('0x9'));var ejs=require(_0x0760('0xa'));var fs=require('fs');var fs_extra=require(_0x0760('0xb'));var _=require('lodash');var squel=require(_0x0760('0xc'));var crypto=require(_0x0760('0xd'));var jsforce=require(_0x0760('0xe'));var deskjs=require(_0x0760('0xf'));var toCsv=require(_0x0760('0x9'));var querystring=require(_0x0760('0x10'));var Papa=require(_0x0760('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0760('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0760('0x13'));var logger=require('../../config/logger')(_0x0760('0x14'));var utils=require(_0x0760('0x15'));var config=require(_0x0760('0x16'));var licenseUtil=require(_0x0760('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d148c,_0x4b6a3c){_0x4b6a3c=_0x4b6a3c||0xcc;return function(_0x45b25a){if(_0x45b25a){return _0x1d148c[_0x0760('0x18')](_0x4b6a3c);}return _0x1d148c[_0x0760('0x19')](_0x4b6a3c)[_0x0760('0x1a')]();};}function respondWithResult(_0x261d8d,_0x574a32){_0x574a32=_0x574a32||0xc8;return function(_0x55c7f4){if(_0x55c7f4){return _0x261d8d[_0x0760('0x19')](_0x574a32)[_0x0760('0x1b')](_0x55c7f4);}};}function respondWithFilteredResult(_0x23b443,_0x2818ad){return function(_0x127ab7){if(_0x127ab7){var _0x447ec6=typeof _0x2818ad['offset']===_0x0760('0x1c')&&typeof _0x2818ad['limit']===_0x0760('0x1c');var _0x46c933=_0x127ab7[_0x0760('0x1d')];var _0x1c04f8=_0x447ec6?0x0:_0x2818ad[_0x0760('0x1e')];var _0x30464f=_0x447ec6?_0x127ab7[_0x0760('0x1d')]:_0x2818ad[_0x0760('0x1e')]+_0x2818ad[_0x0760('0x1f')];var _0x50c6d6;if(_0x30464f>=_0x46c933){_0x30464f=_0x46c933;_0x50c6d6=0xc8;}else{_0x50c6d6=0xce;}_0x23b443[_0x0760('0x19')](_0x50c6d6);return _0x23b443[_0x0760('0x20')](_0x0760('0x21'),_0x1c04f8+'-'+_0x30464f+'/'+_0x46c933)['json'](_0x127ab7);}return null;};}function patchUpdates(_0x3fce75){return function(_0x37498c){try{jsonpatch[_0x0760('0x22')](_0x37498c,_0x3fce75,!![]);}catch(_0x4fc3df){return BPromise[_0x0760('0x23')](_0x4fc3df);}return _0x37498c[_0x0760('0x24')]();};}function saveUpdates(_0x13bc45,_0x4c45fa){return function(_0x402b28){if(_0x402b28){return _0x402b28['update'](_0x13bc45)[_0x0760('0x25')](function(_0x1518cf){return _0x1518cf;});}return null;};}function removeEntity(_0x1fc170,_0x10e24d){return function(_0x2327c0){if(_0x2327c0){return _0x2327c0[_0x0760('0x26')]()[_0x0760('0x25')](function(){_0x1fc170[_0x0760('0x19')](0xcc)[_0x0760('0x1a')]();});}};}function handleEntityNotFound(_0x25dc20,_0x364421){return function(_0x3a6dbf){if(!_0x3a6dbf){_0x25dc20[_0x0760('0x18')](0x194);}return _0x3a6dbf;};}function handleError(_0x1493e3,_0x5a6bac){_0x5a6bac=_0x5a6bac||0x1f4;return function(_0x4d2332){logger['error'](_0x4d2332[_0x0760('0x27')]);if(_0x4d2332[_0x0760('0x28')]){delete _0x4d2332[_0x0760('0x28')];}_0x1493e3[_0x0760('0x19')](_0x5a6bac)[_0x0760('0x29')](_0x4d2332);};}exports[_0x0760('0x2a')]=function(_0x2b11e7,_0xc3da14){var _0x1a5a25={},_0x78269e={},_0x130b10={'count':0x0,'rows':[]};var _0x3d18b1=_[_0x0760('0x2b')](db['VoiceQueuesLog']['rawAttributes'],function(_0x337ed9){return{'name':_0x337ed9[_0x0760('0x2c')],'type':_0x337ed9['type']['key']};});_0x78269e[_0x0760('0x2d')]=_[_0x0760('0x2b')](_0x3d18b1,_0x0760('0x28'));_0x78269e[_0x0760('0x2e')]=_[_0x0760('0x2f')](_0x2b11e7['query']);_0x78269e[_0x0760('0x30')]=_['intersection'](_0x78269e[_0x0760('0x2d')],_0x78269e[_0x0760('0x2e')]);_0x1a5a25[_0x0760('0x31')]=_[_0x0760('0x32')](_0x78269e[_0x0760('0x2d')],qs[_0x0760('0x33')](_0x2b11e7['query'][_0x0760('0x33')]));_0x1a5a25[_0x0760('0x31')]=_0x1a5a25[_0x0760('0x31')][_0x0760('0x34')]?_0x1a5a25['attributes']:_0x78269e[_0x0760('0x2d')];if(!_0x2b11e7[_0x0760('0x2e')][_0x0760('0x35')](_0x0760('0x36'))){_0x1a5a25[_0x0760('0x1f')]=qs[_0x0760('0x1f')](_0x2b11e7[_0x0760('0x2e')][_0x0760('0x1f')]);_0x1a5a25[_0x0760('0x1e')]=qs[_0x0760('0x1e')](_0x2b11e7['query'][_0x0760('0x1e')]);}_0x1a5a25[_0x0760('0x37')]=qs[_0x0760('0x38')](_0x2b11e7[_0x0760('0x2e')][_0x0760('0x38')]);_0x1a5a25[_0x0760('0x39')]=qs[_0x0760('0x30')](_[_0x0760('0x3a')](_0x2b11e7[_0x0760('0x2e')],_0x78269e['filters']),_0x3d18b1);if(_0x2b11e7[_0x0760('0x2e')][_0x0760('0x3b')]){_0x1a5a25[_0x0760('0x39')]=_['merge'](_0x1a5a25[_0x0760('0x39')],{'$or':_['map'](_0x3d18b1,function(_0x373c4f){if(_0x373c4f[_0x0760('0x3c')]!==_0x0760('0x3d')){var _0x1717a5={};_0x1717a5[_0x373c4f[_0x0760('0x28')]]={'$like':'%'+_0x2b11e7[_0x0760('0x2e')]['filter']+'%'};return _0x1717a5;}})});}_0x1a5a25=_['merge']({},_0x1a5a25,_0x2b11e7[_0x0760('0x3e')]);var _0x17eae7={'where':_0x1a5a25[_0x0760('0x39')]};return db[_0x0760('0x3f')][_0x0760('0x1d')](_0x17eae7)[_0x0760('0x25')](function(_0x529c87){_0x130b10[_0x0760('0x1d')]=_0x529c87;if(_0x2b11e7[_0x0760('0x2e')][_0x0760('0x40')]){_0x1a5a25['include']=[{'all':!![]}];}return db[_0x0760('0x3f')][_0x0760('0x41')](_0x1a5a25);})[_0x0760('0x25')](function(_0x26de31){_0x130b10[_0x0760('0x42')]=_0x26de31;return _0x130b10;})['then'](respondWithFilteredResult(_0xc3da14,_0x1a5a25))['catch'](handleError(_0xc3da14,null));};exports[_0x0760('0x43')]=function(_0x2e1548,_0x5904eb){var _0x552237={'raw':!![],'where':{'id':_0x2e1548[_0x0760('0x44')]['id']}},_0x184a25={};_0x184a25['model']=_['keys'](db['VoiceQueuesLog'][_0x0760('0x45')]);_0x184a25[_0x0760('0x2e')]=_[_0x0760('0x2f')](_0x2e1548[_0x0760('0x2e')]);_0x184a25[_0x0760('0x30')]=_[_0x0760('0x32')](_0x184a25[_0x0760('0x2d')],_0x184a25[_0x0760('0x2e')]);_0x552237[_0x0760('0x31')]=_[_0x0760('0x32')](_0x184a25[_0x0760('0x2d')],qs[_0x0760('0x33')](_0x2e1548['query']['fields']));_0x552237[_0x0760('0x31')]=_0x552237[_0x0760('0x31')][_0x0760('0x34')]?_0x552237[_0x0760('0x31')]:_0x184a25['model'];if(_0x2e1548[_0x0760('0x2e')][_0x0760('0x40')]){_0x552237['include']=[{'all':!![]}];}_0x552237=_[_0x0760('0x46')]({},_0x552237,_0x2e1548[_0x0760('0x3e')]);return db['VoiceQueuesLog']['find'](_0x552237)[_0x0760('0x25')](handleEntityNotFound(_0x5904eb,null))[_0x0760('0x25')](respondWithResult(_0x5904eb,null))[_0x0760('0x47')](handleError(_0x5904eb,null));};exports['create']=function(_0x444185,_0x535761){return db[_0x0760('0x3f')][_0x0760('0x48')](_0x444185[_0x0760('0x49')],{})[_0x0760('0x25')](respondWithResult(_0x535761,0xc9))[_0x0760('0x47')](handleError(_0x535761,null));};exports[_0x0760('0x4a')]=function(_0x2c543b,_0x42e2f8){if(_0x2c543b['body']['id']){delete _0x2c543b['body']['id'];}return db[_0x0760('0x3f')][_0x0760('0x4b')]({'where':{'id':_0x2c543b[_0x0760('0x44')]['id']}})['then'](handleEntityNotFound(_0x42e2f8,null))[_0x0760('0x25')](saveUpdates(_0x2c543b[_0x0760('0x49')],null))['then'](respondWithResult(_0x42e2f8,null))['catch'](handleError(_0x42e2f8,null));};exports['destroy']=function(_0x5c7aee,_0x3a61ec){return db[_0x0760('0x3f')][_0x0760('0x4b')]({'where':{'id':_0x5c7aee[_0x0760('0x44')]['id']}})[_0x0760('0x25')](handleEntityNotFound(_0x3a61ec,null))[_0x0760('0x25')](removeEntity(_0x3a61ec,null))[_0x0760('0x47')](handleError(_0x3a61ec,null));}; \ No newline at end of file +var _0x4591=['offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x4591,0x7a));var _0x1459=function(_0xf11cdf,_0x39ba33){_0xf11cdf=_0xf11cdf-0x0;var _0x1c3436=_0x4591[_0xf11cdf];return _0x1c3436;};'use strict';var emlformat=require(_0x1459('0x0'));var rimraf=require(_0x1459('0x1'));var zipdir=require(_0x1459('0x2'));var jsonpatch=require(_0x1459('0x3'));var rp=require('request-promise');var moment=require(_0x1459('0x4'));var BPromise=require(_0x1459('0x5'));var Mustache=require(_0x1459('0x6'));var util=require(_0x1459('0x7'));var path=require(_0x1459('0x8'));var sox=require(_0x1459('0x9'));var csv=require(_0x1459('0xa'));var ejs=require(_0x1459('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1459('0xc'));var crypto=require('crypto');var jsforce=require(_0x1459('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1459('0xe'));var Papa=require(_0x1459('0xf'));var Redis=require(_0x1459('0x10'));var authService=require(_0x1459('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1459('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1459('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1459('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358745,_0x1c363b){_0x1c363b=_0x1c363b||0xcc;return function(_0x4d4780){if(_0x4d4780){return _0x358745[_0x1459('0x15')](_0x1c363b);}return _0x358745[_0x1459('0x16')](_0x1c363b)[_0x1459('0x17')]();};}function respondWithResult(_0x2ca543,_0x350f0a){_0x350f0a=_0x350f0a||0xc8;return function(_0x3ec2d4){if(_0x3ec2d4){return _0x2ca543[_0x1459('0x16')](_0x350f0a)['json'](_0x3ec2d4);}};}function respondWithFilteredResult(_0x352465,_0xc5e3f7){return function(_0x353db4){if(_0x353db4){var _0x52781a=typeof _0xc5e3f7[_0x1459('0x18')]==='undefined'&&typeof _0xc5e3f7[_0x1459('0x19')]===_0x1459('0x1a');var _0x4944f3=_0x353db4[_0x1459('0x1b')];var _0x50e44f=_0x52781a?0x0:_0xc5e3f7[_0x1459('0x18')];var _0x54de5c=_0x52781a?_0x353db4[_0x1459('0x1b')]:_0xc5e3f7[_0x1459('0x18')]+_0xc5e3f7[_0x1459('0x19')];var _0x30ec70;if(_0x54de5c>=_0x4944f3){_0x54de5c=_0x4944f3;_0x30ec70=0xc8;}else{_0x30ec70=0xce;}_0x352465[_0x1459('0x16')](_0x30ec70);return _0x352465[_0x1459('0x1c')]('Content-Range',_0x50e44f+'-'+_0x54de5c+'/'+_0x4944f3)[_0x1459('0x1d')](_0x353db4);}return null;};}function patchUpdates(_0x139958){return function(_0x2acebe){try{jsonpatch[_0x1459('0x1e')](_0x2acebe,_0x139958,!![]);}catch(_0xcf6a4a){return BPromise[_0x1459('0x1f')](_0xcf6a4a);}return _0x2acebe[_0x1459('0x20')]();};}function saveUpdates(_0x3f522f,_0x3dd8d9){return function(_0x530ad6){if(_0x530ad6){return _0x530ad6[_0x1459('0x21')](_0x3f522f)['then'](function(_0x376a61){return _0x376a61;});}return null;};}function removeEntity(_0x2966ed,_0x238b38){return function(_0x7e6c1b){if(_0x7e6c1b){return _0x7e6c1b[_0x1459('0x22')]()['then'](function(){_0x2966ed[_0x1459('0x16')](0xcc)[_0x1459('0x17')]();});}};}function handleEntityNotFound(_0x378823,_0x4c8dc6){return function(_0x830862){if(!_0x830862){_0x378823[_0x1459('0x15')](0x194);}return _0x830862;};}function handleError(_0x56148d,_0xf7bc93){_0xf7bc93=_0xf7bc93||0x1f4;return function(_0x1350a8){logger[_0x1459('0x23')](_0x1350a8[_0x1459('0x24')]);if(_0x1350a8[_0x1459('0x25')]){delete _0x1350a8[_0x1459('0x25')];}_0x56148d[_0x1459('0x16')](_0xf7bc93)[_0x1459('0x26')](_0x1350a8);};}exports[_0x1459('0x27')]=function(_0x388ce0,_0x183a2b){var _0x230a5a={},_0x48a5b1={},_0x5dcb92={'count':0x0,'rows':[]};var _0x32062c=_['map'](db[_0x1459('0x28')][_0x1459('0x29')],function(_0x47c8f8){return{'name':_0x47c8f8[_0x1459('0x2a')],'type':_0x47c8f8[_0x1459('0x2b')][_0x1459('0x2c')]};});_0x48a5b1['model']=_[_0x1459('0x2d')](_0x32062c,_0x1459('0x25'));_0x48a5b1['query']=_[_0x1459('0x2e')](_0x388ce0[_0x1459('0x2f')]);_0x48a5b1[_0x1459('0x30')]=_[_0x1459('0x31')](_0x48a5b1[_0x1459('0x32')],_0x48a5b1[_0x1459('0x2f')]);_0x230a5a[_0x1459('0x33')]=_['intersection'](_0x48a5b1[_0x1459('0x32')],qs[_0x1459('0x34')](_0x388ce0[_0x1459('0x2f')][_0x1459('0x34')]));_0x230a5a['attributes']=_0x230a5a[_0x1459('0x33')][_0x1459('0x35')]?_0x230a5a['attributes']:_0x48a5b1[_0x1459('0x32')];if(!_0x388ce0['query'][_0x1459('0x36')](_0x1459('0x37'))){_0x230a5a[_0x1459('0x19')]=qs[_0x1459('0x19')](_0x388ce0[_0x1459('0x2f')][_0x1459('0x19')]);_0x230a5a[_0x1459('0x18')]=qs[_0x1459('0x18')](_0x388ce0[_0x1459('0x2f')][_0x1459('0x18')]);}_0x230a5a[_0x1459('0x38')]=qs[_0x1459('0x39')](_0x388ce0[_0x1459('0x2f')][_0x1459('0x39')]);_0x230a5a['where']=qs[_0x1459('0x30')](_[_0x1459('0x3a')](_0x388ce0[_0x1459('0x2f')],_0x48a5b1[_0x1459('0x30')]),_0x32062c);if(_0x388ce0['query'][_0x1459('0x3b')]){_0x230a5a[_0x1459('0x3c')]=_[_0x1459('0x3d')](_0x230a5a[_0x1459('0x3c')],{'$or':_[_0x1459('0x2d')](_0x32062c,function(_0x5630db){if(_0x5630db[_0x1459('0x2b')]!==_0x1459('0x3e')){var _0x499e16={};_0x499e16[_0x5630db[_0x1459('0x25')]]={'$like':'%'+_0x388ce0[_0x1459('0x2f')][_0x1459('0x3b')]+'%'};return _0x499e16;}})});}_0x230a5a=_[_0x1459('0x3d')]({},_0x230a5a,_0x388ce0[_0x1459('0x3f')]);var _0x25ba70={'where':_0x230a5a[_0x1459('0x3c')]};return db[_0x1459('0x28')][_0x1459('0x1b')](_0x25ba70)[_0x1459('0x40')](function(_0x4ccea6){_0x5dcb92[_0x1459('0x1b')]=_0x4ccea6;if(_0x388ce0[_0x1459('0x2f')][_0x1459('0x41')]){_0x230a5a['include']=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x230a5a);})['then'](function(_0x221d72){_0x5dcb92['rows']=_0x221d72;return _0x5dcb92;})[_0x1459('0x40')](respondWithFilteredResult(_0x183a2b,_0x230a5a))[_0x1459('0x42')](handleError(_0x183a2b,null));};exports[_0x1459('0x43')]=function(_0x4289b0,_0x11e42b){var _0x520166={'raw':!![],'where':{'id':_0x4289b0[_0x1459('0x44')]['id']}},_0x5a931c={};_0x5a931c['model']=_['keys'](db[_0x1459('0x28')][_0x1459('0x29')]);_0x5a931c['query']=_[_0x1459('0x2e')](_0x4289b0[_0x1459('0x2f')]);_0x5a931c[_0x1459('0x30')]=_[_0x1459('0x31')](_0x5a931c[_0x1459('0x32')],_0x5a931c['query']);_0x520166['attributes']=_[_0x1459('0x31')](_0x5a931c['model'],qs[_0x1459('0x34')](_0x4289b0[_0x1459('0x2f')]['fields']));_0x520166[_0x1459('0x33')]=_0x520166[_0x1459('0x33')]['length']?_0x520166['attributes']:_0x5a931c[_0x1459('0x32')];if(_0x4289b0[_0x1459('0x2f')][_0x1459('0x41')]){_0x520166[_0x1459('0x45')]=[{'all':!![]}];}_0x520166=_['merge']({},_0x520166,_0x4289b0['options']);return db[_0x1459('0x28')][_0x1459('0x46')](_0x520166)['then'](handleEntityNotFound(_0x11e42b,null))[_0x1459('0x40')](respondWithResult(_0x11e42b,null))[_0x1459('0x42')](handleError(_0x11e42b,null));};exports[_0x1459('0x47')]=function(_0x17de3c,_0x2eace4){return db[_0x1459('0x28')]['create'](_0x17de3c[_0x1459('0x48')],{})[_0x1459('0x40')](respondWithResult(_0x2eace4,0xc9))['catch'](handleError(_0x2eace4,null));};exports[_0x1459('0x21')]=function(_0x6877cc,_0x1f3623){if(_0x6877cc[_0x1459('0x48')]['id']){delete _0x6877cc['body']['id'];}return db[_0x1459('0x28')][_0x1459('0x46')]({'where':{'id':_0x6877cc['params']['id']}})[_0x1459('0x40')](handleEntityNotFound(_0x1f3623,null))[_0x1459('0x40')](saveUpdates(_0x6877cc[_0x1459('0x48')],null))[_0x1459('0x40')](respondWithResult(_0x1f3623,null))[_0x1459('0x42')](handleError(_0x1f3623,null));};exports['destroy']=function(_0x28c125,_0x1f979a){return db['VoiceQueuesLog'][_0x1459('0x46')]({'where':{'id':_0x28c125[_0x1459('0x44')]['id']}})[_0x1459('0x40')](handleEntityNotFound(_0x1f979a,null))[_0x1459('0x40')](removeEntity(_0x1f979a,null))['catch'](handleError(_0x1f979a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 952a35e..8327a35 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 _0x22c5=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event','dtm','../../config/logger','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22c5,0x6e));var _0x522c=function(_0x2900ec,_0x5ed034){_0x2900ec=_0x2900ec-0x0;var _0x2bdd61=_0x22c5[_0x2900ec];return _0x2bdd61;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x522c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x522c('0x1'));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(_0x522c('0x2'));module[_0x522c('0x3')]=function(_0x84e973,_0x3be57e){return _0x84e973[_0x522c('0x4')](_0x522c('0x5'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x522c('0x6'),_0x522c('0x7')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3379=['api','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger'];(function(_0x2f48e9,_0x1bd1b4){var _0x34d5bb=function(_0x399242){while(--_0x399242){_0x2f48e9['push'](_0x2f48e9['shift']());}};_0x34d5bb(++_0x1bd1b4);}(_0x3379,0x115));var _0x9337=function(_0x44c7d9,_0x26fc83){_0x44c7d9=_0x44c7d9-0x0;var _0x22bdd2=_0x3379[_0x44c7d9];return _0x22bdd2;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var logger=require(_0x9337('0x2'))(_0x9337('0x3'));var moment=require('moment');var BPromise=require(_0x9337('0x4'));var rp=require(_0x9337('0x5'));var fs=require('fs');var path=require(_0x9337('0x6'));var rimraf=require(_0x9337('0x7'));var config=require('../../config/environment');var attributes=require(_0x9337('0x8'));module[_0x9337('0x9')]=function(_0x390772,_0x677c38){return _0x390772['define'](_0x9337('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x9337('0xb'),'fields':[_0x9337('0xc'),_0x9337('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 a045cb7..04c9a8d 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 _0x500a=['client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x220fcd,_0x5cb397){var _0x4fef90=function(_0xc656e5){while(--_0xc656e5){_0x220fcd['push'](_0x220fcd['shift']());}};_0x4fef90(++_0x5cb397);}(_0x500a,0xd6));var _0xa500=function(_0x487361,_0x722b9d){_0x487361=_0x487361-0x0;var _0x1fc877=_0x500a[_0x487361];return _0x1fc877;};'use strict';var _=require('lodash');var util=require(_0xa500('0x0'));var moment=require('moment');var BPromise=require(_0xa500('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa500('0x2'))['db'];var utils=require(_0xa500('0x3'));var logger=require(_0xa500('0x4'))(_0xa500('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa500('0x6')][_0xa500('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3781b0,_0xfa3fea,_0x3b0aa0){return new BPromise(function(_0x4ca517,_0x54dbfc){return client[_0xa500('0x8')](_0x3781b0,_0x3b0aa0)[_0xa500('0x9')](function(_0x456376){logger[_0xa500('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfa3fea,_0xa500('0xb'));logger[_0xa500('0xc')](_0xa500('0xd'),_0xfa3fea,_0xa500('0xb'),JSON[_0xa500('0xe')](_0x456376));if(_0x456376[_0xa500('0xf')]){if(_0x456376[_0xa500('0xf')][_0xa500('0x10')]===0x1f4){logger[_0xa500('0xf')](_0xa500('0x11'),_0xfa3fea,_0x456376[_0xa500('0xf')][_0xa500('0x12')]);return _0x54dbfc(_0x456376[_0xa500('0xf')][_0xa500('0x12')]);}logger['error'](_0xa500('0x11'),_0xfa3fea,_0x456376[_0xa500('0xf')][_0xa500('0x12')]);return _0x4ca517(_0x456376[_0xa500('0xf')][_0xa500('0x12')]);}else{logger[_0xa500('0xa')](_0xa500('0x11'),_0xfa3fea,_0xa500('0xb'));_0x4ca517(_0x456376[_0xa500('0x13')]['message']);}})['catch'](function(_0x159ae0){logger[_0xa500('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfa3fea,_0x159ae0);_0x54dbfc(_0x159ae0);});});} \ No newline at end of file +var _0x9584=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5634d2,_0x40ec38){var _0x4150b5=function(_0x44ceef){while(--_0x44ceef){_0x5634d2['push'](_0x5634d2['shift']());}};_0x4150b5(++_0x40ec38);}(_0x9584,0x1b9));var _0x4958=function(_0x295b55,_0xf2dfc1){_0x295b55=_0x295b55-0x0;var _0x2c8885=_0x9584[_0x295b55];return _0x2c8885;};'use strict';var _=require(_0x4958('0x0'));var util=require(_0x4958('0x1'));var moment=require(_0x4958('0x2'));var BPromise=require('bluebird');var rs=require(_0x4958('0x3'));var fs=require('fs');var Redis=require(_0x4958('0x4'));var db=require(_0x4958('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4958('0x6'))(_0x4958('0x7'));var config=require(_0x4958('0x8'));var jayson=require(_0x4958('0x9'));var client=jayson[_0x4958('0xa')][_0x4958('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x527644,_0x1dfabd,_0x152103){return new BPromise(function(_0x27c0ff,_0x276ec8){return client[_0x4958('0xc')](_0x527644,_0x152103)[_0x4958('0xd')](function(_0xf399d6){logger[_0x4958('0xe')](_0x4958('0xf'),_0x1dfabd,_0x4958('0x10'));logger[_0x4958('0x11')](_0x4958('0x12'),_0x1dfabd,'request\x20sent',JSON[_0x4958('0x13')](_0xf399d6));if(_0xf399d6[_0x4958('0x14')]){if(_0xf399d6['error'][_0x4958('0x15')]===0x1f4){logger[_0x4958('0x14')](_0x4958('0xf'),_0x1dfabd,_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);return _0x276ec8(_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);}logger[_0x4958('0x14')](_0x4958('0xf'),_0x1dfabd,_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);return _0x27c0ff(_0xf399d6[_0x4958('0x14')][_0x4958('0x16')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1dfabd,_0x4958('0x10'));_0x27c0ff(_0xf399d6[_0x4958('0x17')]['message']);}})['catch'](function(_0x442552){logger[_0x4958('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1dfabd,_0x442552);_0x276ec8(_0x442552);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index eddb132..078606e 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 _0x8bbc=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','describe','get','/:id','download','downloads','/:id/transcribe','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x403c57,_0x280a51){var _0x35fa69=function(_0x13a356){while(--_0x13a356){_0x403c57['push'](_0x403c57['shift']());}};_0x35fa69(++_0x280a51);}(_0x8bbc,0x149));var _0xc8bb=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x8bbc[_0x199b1f];return _0x267ac9;};'use strict';var multer=require(_0xc8bb('0x0'));var util=require(_0xc8bb('0x1'));var path=require(_0xc8bb('0x2'));var timeout=require('connect-timeout');var express=require(_0xc8bb('0x3'));var router=express[_0xc8bb('0x4')]();var fs_extra=require(_0xc8bb('0x5'));var auth=require(_0xc8bb('0x6'));var interaction=require(_0xc8bb('0x7'));var config=require(_0xc8bb('0x8'));var controller=require(_0xc8bb('0x9'));router['get']('/',auth[_0xc8bb('0xa')](),controller[_0xc8bb('0xb')]);router['get']('/describe',auth[_0xc8bb('0xa')](),controller[_0xc8bb('0xc')]);router[_0xc8bb('0xd')](_0xc8bb('0xe'),auth[_0xc8bb('0xa')](),controller['show']);router[_0xc8bb('0xd')]('/:id/download',auth[_0xc8bb('0xa')](),controller[_0xc8bb('0xf')]);router[_0xc8bb('0xd')]('/:id/downloads',controller[_0xc8bb('0x10')]);router[_0xc8bb('0xd')](_0xc8bb('0x11'),auth[_0xc8bb('0xa')](),controller['downloadTranscribe']);router[_0xc8bb('0x12')]('/',auth[_0xc8bb('0xa')](),controller['create']);router[_0xc8bb('0x12')](_0xc8bb('0x11'),auth[_0xc8bb('0xa')](),controller['runTranscribe']);router[_0xc8bb('0x13')](_0xc8bb('0xe'),auth[_0xc8bb('0xa')](),controller[_0xc8bb('0x14')]);router[_0xc8bb('0x15')](_0xc8bb('0xe'),auth[_0xc8bb('0xa')](),controller[_0xc8bb('0x16')]);module[_0xc8bb('0x17')]=router; \ No newline at end of file +var _0xdfff=['index','/describe','describe','get','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x22d3b0,_0x2802db){var _0x3ed566=function(_0x54f3be){while(--_0x54f3be){_0x22d3b0['push'](_0x22d3b0['shift']());}};_0x3ed566(++_0x2802db);}(_0xdfff,0xfe));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xfdff('0x0'));var path=require('path');var timeout=require(_0xfdff('0x1'));var express=require(_0xfdff('0x2'));var router=express[_0xfdff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfdff('0x4'));var interaction=require(_0xfdff('0x5'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfdff('0x6')]);router['get'](_0xfdff('0x7'),auth['isAuthenticated'](),controller[_0xfdff('0x8')]);router[_0xfdff('0x9')](_0xfdff('0xa'),auth[_0xfdff('0xb')](),controller[_0xfdff('0xc')]);router[_0xfdff('0x9')](_0xfdff('0xd'),auth[_0xfdff('0xb')](),controller[_0xfdff('0xe')]);router[_0xfdff('0x9')](_0xfdff('0xf'),controller[_0xfdff('0x10')]);router[_0xfdff('0x9')](_0xfdff('0x11'),auth[_0xfdff('0xb')](),controller[_0xfdff('0x12')]);router[_0xfdff('0x13')]('/',auth[_0xfdff('0xb')](),controller[_0xfdff('0x14')]);router[_0xfdff('0x13')](_0xfdff('0x11'),auth[_0xfdff('0xb')](),controller[_0xfdff('0x15')]);router[_0xfdff('0x16')](_0xfdff('0xa'),auth[_0xfdff('0xb')](),controller[_0xfdff('0x17')]);router['delete'](_0xfdff('0xa'),auth['isAuthenticated'](),controller[_0xfdff('0x18')]);module[_0xfdff('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 97b8073..af7fa8f 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 e176134..1a9ada6 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 _0xfd1d=['existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','$and','push','extname','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','model','differenceBy','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','VoiceRecording','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','download','../../components/encryptor','uniqueid','format','%s.cypher'];(function(_0x5cfa4f,_0x4d8fe9){var _0x2e5acd=function(_0x474d1a){while(--_0x474d1a){_0x5cfa4f['push'](_0x5cfa4f['shift']());}};_0x2e5acd(++_0x4d8fe9);}(_0xfd1d,0x175));var _0xdfd1=function(_0x9160d8,_0x2c8959){_0x9160d8=_0x9160d8-0x0;var _0x4d61aa=_0xfd1d[_0x9160d8];return _0x4d61aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfd1('0x0'));var zipdir=require(_0xdfd1('0x1'));var jsonpatch=require(_0xdfd1('0x2'));var rp=require(_0xdfd1('0x3'));var moment=require('moment');var BPromise=require(_0xdfd1('0x4'));var Mustache=require('mustache');var util=require(_0xdfd1('0x5'));var path=require(_0xdfd1('0x6'));var sox=require(_0xdfd1('0x7'));var csv=require('to-csv');var ejs=require(_0xdfd1('0x8'));var fs=require('fs');var fs_extra=require(_0xdfd1('0x9'));var _=require(_0xdfd1('0xa'));var squel=require(_0xdfd1('0xb'));var crypto=require(_0xdfd1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdfd1('0xd'));var toCsv=require(_0xdfd1('0xe'));var querystring=require('querystring');var Papa=require(_0xdfd1('0xf'));var AWS=require(_0xdfd1('0x10'));var uuidv4=require(_0xdfd1('0x11'));var Redis=require(_0xdfd1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdfd1('0x13'));var as=require(_0xdfd1('0x14'));var hardwareService=require(_0xdfd1('0x15'));var logger=require('../../config/logger')(_0xdfd1('0x16'));var utils=require(_0xdfd1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3083c3,_0x1c9748){_0x1c9748=_0x1c9748||0xcc;return function(_0x5503a6){if(_0x5503a6){return _0x3083c3[_0xdfd1('0x18')](_0x1c9748);}return _0x3083c3[_0xdfd1('0x19')](_0x1c9748)[_0xdfd1('0x1a')]();};}function respondWithResult(_0x531056,_0xeee6f){_0xeee6f=_0xeee6f||0xc8;return function(_0xcb8bef){if(_0xcb8bef){return _0x531056[_0xdfd1('0x19')](_0xeee6f)['json'](_0xcb8bef);}};}function respondWithFilteredResult(_0x4e1328,_0x4ef3b9){return function(_0x4d6a8b){if(_0x4d6a8b){var _0x58cbc0=typeof _0x4ef3b9[_0xdfd1('0x1b')]===_0xdfd1('0x1c')&&typeof _0x4ef3b9['limit']==='undefined';var _0x393c15=_0x4d6a8b[_0xdfd1('0x1d')];var _0x2e1e06=_0x58cbc0?0x0:_0x4ef3b9[_0xdfd1('0x1b')];var _0x142307=_0x58cbc0?_0x4d6a8b[_0xdfd1('0x1d')]:_0x4ef3b9[_0xdfd1('0x1b')]+_0x4ef3b9[_0xdfd1('0x1e')];var _0x39893c;if(_0x142307>=_0x393c15){_0x142307=_0x393c15;_0x39893c=0xc8;}else{_0x39893c=0xce;}_0x4e1328['status'](_0x39893c);return _0x4e1328[_0xdfd1('0x1f')]('Content-Range',_0x2e1e06+'-'+_0x142307+'/'+_0x393c15)[_0xdfd1('0x20')](_0x4d6a8b);}return null;};}function patchUpdates(_0x4e82ae){return function(_0x49d9b0){try{jsonpatch[_0xdfd1('0x21')](_0x49d9b0,_0x4e82ae,!![]);}catch(_0x36b4bb){return BPromise['reject'](_0x36b4bb);}return _0x49d9b0[_0xdfd1('0x22')]();};}function saveUpdates(_0x681e2b,_0xe6d121){return function(_0x46672c){if(_0x46672c){return _0x46672c[_0xdfd1('0x23')](_0x681e2b)[_0xdfd1('0x24')](function(_0x788ab0){return _0x788ab0;});}return null;};}function removeEntity(_0x18f4dc,_0x1ebeda){return function(_0x3140cb){if(_0x3140cb){return _0x3140cb[_0xdfd1('0x25')]()['then'](function(){_0x18f4dc[_0xdfd1('0x19')](0xcc)[_0xdfd1('0x1a')]();});}};}function handleEntityNotFound(_0x3179a6,_0x4dad40){return function(_0x1d99ba){if(!_0x1d99ba){_0x3179a6['sendStatus'](0x194);}return _0x1d99ba;};}function handleError(_0x3ed5a0,_0x4a937b){_0x4a937b=_0x4a937b||0x1f4;return function(_0x4ff284){logger[_0xdfd1('0x26')](_0x4ff284[_0xdfd1('0x27')]);if(_0x4ff284[_0xdfd1('0x28')]){delete _0x4ff284['name'];}_0x3ed5a0[_0xdfd1('0x19')](_0x4a937b)[_0xdfd1('0x29')](_0x4ff284);};}exports[_0xdfd1('0x2a')]=function(_0x43bdad,_0x949b85){var _0x28903c={},_0x4cc53a={},_0x40ed5b={'count':0x0,'rows':[]};var _0x5c8eba=_[_0xdfd1('0x2b')](db['VoiceRecording']['rawAttributes'],function(_0x4a9e5c){return{'name':_0x4a9e5c[_0xdfd1('0x2c')],'type':_0x4a9e5c['type'][_0xdfd1('0x2d')]};});_0x4cc53a[_0xdfd1('0x2e')]=_[_0xdfd1('0x2f')](_[_0xdfd1('0x2b')](_0x5c8eba,_0xdfd1('0x28')),['format']);_0x4cc53a[_0xdfd1('0x30')]=_[_0xdfd1('0x31')](_0x43bdad[_0xdfd1('0x30')]);_0x4cc53a['filters']=_[_0xdfd1('0x32')](_0x4cc53a[_0xdfd1('0x2e')],_0x4cc53a[_0xdfd1('0x30')]);_0x28903c[_0xdfd1('0x33')]=_[_0xdfd1('0x32')](_0x4cc53a[_0xdfd1('0x2e')],qs['fields'](_0x43bdad[_0xdfd1('0x30')][_0xdfd1('0x34')]));_0x28903c['attributes']=_0x28903c[_0xdfd1('0x33')][_0xdfd1('0x35')]?_0x28903c[_0xdfd1('0x33')]:_0x4cc53a[_0xdfd1('0x2e')];if(!_0x43bdad[_0xdfd1('0x30')]['hasOwnProperty'](_0xdfd1('0x36'))){_0x28903c['limit']=qs[_0xdfd1('0x1e')](_0x43bdad[_0xdfd1('0x30')][_0xdfd1('0x1e')]);_0x28903c[_0xdfd1('0x1b')]=qs[_0xdfd1('0x1b')](_0x43bdad['query'][_0xdfd1('0x1b')]);}_0x28903c[_0xdfd1('0x37')]=qs[_0xdfd1('0x38')](_0x43bdad['query'][_0xdfd1('0x38')]);_0x28903c[_0xdfd1('0x39')]=qs[_0xdfd1('0x3a')](_[_0xdfd1('0x3b')](_0x43bdad['query'],_0x4cc53a[_0xdfd1('0x3a')]),_0x5c8eba);if(_0x43bdad['query'][_0xdfd1('0x3c')]){_0x28903c[_0xdfd1('0x39')]=_[_0xdfd1('0x3d')](_0x28903c[_0xdfd1('0x39')],{'$or':_[_0xdfd1('0x2b')](_0x5c8eba,function(_0x14c5a4){if(_0x14c5a4[_0xdfd1('0x3e')]!==_0xdfd1('0x3f')){var _0x2f2f34={};_0x2f2f34[_0x14c5a4[_0xdfd1('0x28')]]={'$like':'%'+_0x43bdad[_0xdfd1('0x30')][_0xdfd1('0x3c')]+'%'};return _0x2f2f34;}})});}_0x28903c=_[_0xdfd1('0x3d')]({},_0x28903c,_0x43bdad[_0xdfd1('0x40')]);var _0x4dbe6f={'where':_0x28903c[_0xdfd1('0x39')]};return db[_0xdfd1('0x41')][_0xdfd1('0x1d')](_0x4dbe6f)[_0xdfd1('0x24')](function(_0xfa35ff){_0x40ed5b[_0xdfd1('0x1d')]=_0xfa35ff;if(_0x43bdad[_0xdfd1('0x30')][_0xdfd1('0x42')]){_0x28903c[_0xdfd1('0x43')]=[{'all':!![]}];}return db[_0xdfd1('0x41')][_0xdfd1('0x44')](_0x28903c);})[_0xdfd1('0x24')](function(_0x2b3a41){_0x40ed5b[_0xdfd1('0x45')]=_0x2b3a41;return _0x40ed5b;})[_0xdfd1('0x24')](respondWithFilteredResult(_0x949b85,_0x28903c))[_0xdfd1('0x46')](handleError(_0x949b85,null));};exports[_0xdfd1('0x47')]=function(_0x292491,_0x3c3eec){var _0xb13ae={'raw':![],'where':{'id':_0x292491['params']['id']}},_0x4c320e={};_0x4c320e['model']=_[_0xdfd1('0x31')](db['VoiceRecording'][_0xdfd1('0x48')]);_0x4c320e[_0xdfd1('0x30')]=_[_0xdfd1('0x31')](_0x292491[_0xdfd1('0x30')]);_0x4c320e[_0xdfd1('0x3a')]=_[_0xdfd1('0x32')](_0x4c320e[_0xdfd1('0x2e')],_0x4c320e[_0xdfd1('0x30')]);_0xb13ae[_0xdfd1('0x33')]=_[_0xdfd1('0x32')](_0x4c320e[_0xdfd1('0x2e')],qs[_0xdfd1('0x34')](_0x292491[_0xdfd1('0x30')]['fields']));_0xb13ae[_0xdfd1('0x33')]=_0xb13ae[_0xdfd1('0x33')][_0xdfd1('0x35')]?_0xb13ae['attributes']:_0x4c320e[_0xdfd1('0x2e')];if(_0x292491[_0xdfd1('0x30')][_0xdfd1('0x42')]){_0xb13ae[_0xdfd1('0x43')]=[{'all':!![]}];}_0xb13ae=_['merge']({},_0xb13ae,_0x292491[_0xdfd1('0x40')]);return db[_0xdfd1('0x41')][_0xdfd1('0x49')](_0xb13ae)[_0xdfd1('0x24')](handleEntityNotFound(_0x3c3eec,null))[_0xdfd1('0x24')](respondWithResult(_0x3c3eec,null))[_0xdfd1('0x46')](handleError(_0x3c3eec,null));};exports[_0xdfd1('0x4a')]=function(_0xa654aa,_0x27ae2e){return db[_0xdfd1('0x41')]['create'](_0xa654aa[_0xdfd1('0x4b')],{})[_0xdfd1('0x24')](respondWithResult(_0x27ae2e,0xc9))[_0xdfd1('0x46')](handleError(_0x27ae2e,null));};exports[_0xdfd1('0x23')]=function(_0x4f69e3,_0x13f6a1){if(_0x4f69e3[_0xdfd1('0x4b')]['id']){delete _0x4f69e3[_0xdfd1('0x4b')]['id'];}return db['VoiceRecording'][_0xdfd1('0x49')]({'where':{'id':_0x4f69e3[_0xdfd1('0x4c')]['id']}})[_0xdfd1('0x24')](handleEntityNotFound(_0x13f6a1,null))[_0xdfd1('0x24')](saveUpdates(_0x4f69e3['body'],null))[_0xdfd1('0x24')](respondWithResult(_0x13f6a1,null))[_0xdfd1('0x46')](handleError(_0x13f6a1,null));};exports[_0xdfd1('0x4d')]=function(_0x52e02d,_0x26d615){return db[_0xdfd1('0x41')][_0xdfd1('0x4d')]()['then'](respondWithResult(_0x26d615,null))[_0xdfd1('0x46')](handleError(_0x26d615,null));};exports[_0xdfd1('0x4e')]=function(_0x5d066c,_0x19d6a5,_0x53892f){var _0x20b4ef=require(_0xdfd1('0x4f'));var _0x1caaa0=![];var _0x2e3aaa={};if(_0x5d066c[_0xdfd1('0x30')][_0xdfd1('0x3e')]&&_0x5d066c[_0xdfd1('0x30')][_0xdfd1('0x3e')]===_0xdfd1('0x50')){_0x2e3aaa[_0xdfd1('0x50')]=_0x5d066c[_0xdfd1('0x4c')]['id'];}else{_0x2e3aaa['id']=_0x5d066c[_0xdfd1('0x4c')]['id'];}return db['VoiceRecording'][_0xdfd1('0x49')]({'where':_0x2e3aaa,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x19d6a5,null))['then'](function(_0x157b2d){if(_0x157b2d){var _0x2e1451=_0x157b2d['value'];var _0x242a14=util[_0xdfd1('0x51')](_0xdfd1('0x52'),_0x2e1451);if(fs[_0xdfd1('0x53')](_0x242a14)){_0x1caaa0=!![];return _0x20b4ef[_0xdfd1('0x54')](_0x242a14,_0x2e1451,config[_0xdfd1('0x55')][_0xdfd1('0x56')])[_0xdfd1('0x24')](function(){return _0x157b2d;});}return _0x157b2d;}})[_0xdfd1('0x24')](function(_0x3e395a){if(_0x3e395a){var _0x3edd09=_0x3e395a[_0xdfd1('0x57')];if(!fs[_0xdfd1('0x53')](_0x3edd09)){throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))](_0xdfd1('0x5a'));}if(_0x3e395a[_0xdfd1('0x5b')]){return _0x19d6a5[_0xdfd1('0x4e')](_0x3edd09,_0x3e395a['filename']+path['extname'](_0x3edd09),function(){if(_0x1caaa0){fs[_0xdfd1('0x5c')](_0x3edd09);}});}else{return _0x19d6a5[_0xdfd1('0x4e')](_0x3edd09,function(_0x4d19e4){if(_0x1caaa0){fs[_0xdfd1('0x5c')](_0x3edd09);}});}}})[_0xdfd1('0x46')](function(_0x2cc842){if(_0x2cc842['message']===_0xdfd1('0x5a')){_0x19d6a5[_0xdfd1('0x19')](0x194)['send'](_0xdfd1('0x5d'));}else{return handleError(_0x19d6a5,null);}});};exports[_0xdfd1('0x5e')]=function(_0x5ae2e4,_0x42bf2c,_0x19a88c){var _0x79849a=require(_0xdfd1('0x4f'));var _0x5c5972=![];var _0x28a428={'$and':[db['sequelize'][_0xdfd1('0x39')](db[_0xdfd1('0x5f')]['fn'](_0xdfd1('0x60'),db[_0xdfd1('0x5f')][_0xdfd1('0x61')](_0xdfd1('0x50'))),_0x5ae2e4['query']['token'])]};if(_0x5ae2e4['query'][_0xdfd1('0x3e')]&&_0x5ae2e4[_0xdfd1('0x30')][_0xdfd1('0x3e')]===_0xdfd1('0x50')){_0x28a428[_0xdfd1('0x62')][_0xdfd1('0x63')]({'uniqueid':_0x5ae2e4[_0xdfd1('0x4c')]['id']});}else{_0x28a428[_0xdfd1('0x62')]['push']({'id':_0x5ae2e4['params']['id']});}return db['VoiceRecording'][_0xdfd1('0x49')]({'where':_0x28a428,'attributes':['id',_0xdfd1('0x57')],'raw':!![]})[_0xdfd1('0x24')](handleEntityNotFound(_0x42bf2c,null))[_0xdfd1('0x24')](function(_0x1b2de0){if(_0x1b2de0){var _0x345bc7=util[_0xdfd1('0x51')](_0xdfd1('0x52'),_0x1b2de0[_0xdfd1('0x57')]);if(fs[_0xdfd1('0x53')](_0x345bc7)){_0x5c5972=!![];return _0x79849a[_0xdfd1('0x54')](_0x345bc7,_0x1b2de0['value'],config[_0xdfd1('0x55')][_0xdfd1('0x56')])['then'](function(){return _0x1b2de0;});}return _0x1b2de0;}})[_0xdfd1('0x24')](function(_0x440162){if(_0x440162){if(!fs[_0xdfd1('0x53')](_0x440162[_0xdfd1('0x57')])){throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))](_0xdfd1('0x5a'));}if(_0x440162[_0xdfd1('0x5b')]){return _0x42bf2c[_0xdfd1('0x4e')](_0x440162['value'],_0x440162[_0xdfd1('0x5b')]+path[_0xdfd1('0x64')](_0x440162['value']),function(){if(_0x5c5972){fs[_0xdfd1('0x5c')](_0x440162['value']);}});}else{return _0x42bf2c['download'](_0x440162['value'],function(_0x384c5f){if(_0x5c5972){fs[_0xdfd1('0x5c')](_0x440162[_0xdfd1('0x57')]);}});}}})['catch'](handleError(_0x42bf2c,null));};exports[_0xdfd1('0x25')]=function(_0x5048f3,_0xacb470){return db[_0xdfd1('0x41')]['find']({'where':{'id':_0x5048f3['params']['id']}})['then'](function(_0x1626f5){if(_[_0xdfd1('0x65')](_0x1626f5)){throw new ReferenceError(_0xdfd1('0x66'));}return _0x1626f5;})[_0xdfd1('0x24')](function(_0x568430){var _0x47f375=_0x568430['value'];logger['info'](_0xdfd1('0x67'),_0x47f375);if(!_[_0xdfd1('0x65')](_0x568430['value'])&&fs[_0xdfd1('0x53')](_0x47f375)){logger[_0xdfd1('0x68')](_0xdfd1('0x69')+_0x47f375+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x47f375);}_0x47f375=_0x47f375+'.cypher';if(!_[_0xdfd1('0x65')](_0x568430[_0xdfd1('0x57')])&&fs[_0xdfd1('0x53')](_0x47f375)){logger[_0xdfd1('0x68')](_0xdfd1('0x69')+_0x47f375+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdfd1('0x6a')](_0x47f375);}return _0x568430;})['then'](function(_0x2ba534){if(!_0x2ba534)throw new InternalError();return _0x2ba534[_0xdfd1('0x25')]();})['then'](function(){_0xacb470[_0xdfd1('0x19')](0xcc)[_0xdfd1('0x1a')]();})[_0xdfd1('0x46')](handleError(_0xacb470,null));};function getBucketslist(_0x1e097d,_0x4d5b18,_0x4ca1b3){return new Promise(function(_0x13dab0,_0x5c0203){var _0x4bcddd=new AWS['S3']({'accessKeyId':_0x4d5b18,'secretAccessKey':_0x1e097d,'region':_0x4ca1b3});_0x4bcddd['listBuckets']({},function(_0x43dd32,_0x24c8de){if(_0x43dd32){return _0x5c0203(_0x43dd32);}else{return _0x13dab0(_0x24c8de);}});});}function createBucket(_0x4606ea,_0x431e30,_0x33206a,_0x35bbeb){return new Promise(function(_0x244e28,_0x4ee88c){var _0x49b342=new AWS['S3']({'accessKeyId':_0x431e30,'secretAccessKey':_0x4606ea,'region':_0x33206a});_0x49b342['createBucket']({'Bucket':_0x35bbeb},function(_0x5bfa98,_0x12fc0a){if(_0x5bfa98){return _0x4ee88c(_0x5bfa98);}else{return _0x244e28(_0x12fc0a);}});});}function uploadFile(_0x16900e,_0x198179,_0x3cbff1,_0x3f6746,_0x6fc395,_0x130226){return new Promise(function(_0x1e9551,_0x4fd109){var _0x369374=new AWS['S3']({'accessKeyId':_0x198179,'secretAccessKey':_0x16900e,'region':_0x3cbff1});_0x369374[_0xdfd1('0x6b')]({'Bucket':_0x3f6746,'Key':_0x6fc395,'Body':_0x130226},function(_0x2571f7,_0x370668){if(_0x2571f7){return _0x4fd109(_0x2571f7);}else{return _0x1e9551(_0x370668);}});});}function startTranscribe(_0x5668ef,_0x2fc631,_0x4d4645,_0x2e2505,_0x5b0653,_0x5d9677){return new Promise(function(_0x3a1e5c,_0x2f8def){var _0x13d49d=new AWS[(_0xdfd1('0x6c'))]({'accessKeyId':_0x2fc631,'secretAccessKey':_0x5668ef,'region':_0x4d4645});_0x13d49d[_0xdfd1('0x6d')]({'TranscriptionJobName':_0x2e2505,'LanguageCode':_0x5b0653,'Media':{'MediaFileUri':_0x5d9677}},function(_0x19cb46,_0x25a9a9){if(_0x19cb46){return _0x2f8def(_0x19cb46);}else{return _0x3a1e5c(_0x25a9a9);}});});}function transcribe(_0x1f2244,_0x45cdc6,_0x36e5f3,_0xf7419e,_0x2c5ee1,_0x29c37f,_0x12d17e){return new Promise(function(_0x47d6a2,_0x4742d9){var _0x56d853={};logger[_0xdfd1('0x68')](util[_0xdfd1('0x51')](_0xdfd1('0x6e'),_0x1f2244,_0x2c5ee1));return uploadFile(_0x45cdc6,_0x36e5f3,_0xf7419e,_0x2c5ee1,path[_0xdfd1('0x6f')](_0x29c37f),fs[_0xdfd1('0x70')](_0x29c37f))[_0xdfd1('0x24')](function(_0xc00f93){logger['info'](util[_0xdfd1('0x51')](_0xdfd1('0x71'),_0x1f2244,_0x2c5ee1,_0xc00f93[_0xdfd1('0x72')]));_0x56d853[_0xdfd1('0x73')]=_0xc00f93[_0xdfd1('0x74')];_0x56d853[_0xdfd1('0x75')]=_0xc00f93[_0xdfd1('0x72')];logger['info'](util[_0xdfd1('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x1f2244));return startTranscribe(_0x45cdc6,_0x36e5f3,_0xf7419e,uuidv4(),_0x12d17e,_0xc00f93[_0xdfd1('0x72')]);})[_0xdfd1('0x24')](function(_0x1ac964){logger['info'](util[_0xdfd1('0x51')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x1f2244,_0x1ac964['TranscriptionJob'][_0xdfd1('0x76')]));_0x56d853[_0xdfd1('0x77')]=_0x1ac964['TranscriptionJob'][_0xdfd1('0x76')];_0x56d853[_0xdfd1('0x78')]=_0x1ac964[_0xdfd1('0x79')][_0xdfd1('0x7a')];return _0x47d6a2(_0x56d853);})[_0xdfd1('0x46')](function(_0x2c9d09){return _0x4742d9(_0x2c9d09);});});}exports[_0xdfd1('0x7b')]=function(_0x3d1154,_0x37724a,_0x5c4c36){var _0x47b496;var _0x3503b8;var _0x1d6fc2;var _0x4eae59=require(_0xdfd1('0x4f'));return db[_0xdfd1('0x41')][_0xdfd1('0x7c')]({'where':{'id':_0x3d1154['params']['id']}})[_0xdfd1('0x24')](function(_0x3acbea){if(_0x3acbea){var _0x272738=util['format']('%s.cypher',_0x3acbea['value']);if(fs['existsSync'](_0x272738)){cypher=!![];return _0x4eae59[_0xdfd1('0x54')](_0x272738,_0x3acbea[_0xdfd1('0x57')],config[_0xdfd1('0x55')][_0xdfd1('0x56')])['then'](function(){return _0x3acbea;});}return _0x3acbea;}})[_0xdfd1('0x24')](function(_0x4c055e){if(!_0x4c055e){throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x3503b8=_0x4c055e;return db[_0xdfd1('0x7d')][_0xdfd1('0x7c')]({'where':{'id':0x1}});})[_0xdfd1('0x24')](handleEntityNotFound(_0x37724a,null))[_0xdfd1('0x24')](function(_0x3caa04){if(_0x3caa04){_0x47b496=_0x3caa04;if(!_0x47b496[_0xdfd1('0x7e')]||!_0x47b496[_0xdfd1('0x7f')]||!_0x47b496[_0xdfd1('0x80')]||!_0x47b496['language']||!_0x47b496[_0xdfd1('0x73')]){throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))](_0xdfd1('0x81'));}if(_0x3d1154[_0xdfd1('0x4b')][_0xdfd1('0x82')]&&(!_0x47b496[_0xdfd1('0x83')]||!_0x47b496[_0xdfd1('0x84')]||!_0x47b496['sentimentRegion']||!_0x47b496['language']||!_0x47b496[_0xdfd1('0x73')])){throw new db['Sequelize'][(_0xdfd1('0x59'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xdfd1('0x85')][_0xdfd1('0x7c')]({'where':{'id':_0x47b496['transcribeAccountId']}});}})[_0xdfd1('0x24')](function(_0x391448){if(!_0x391448){throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))](_0xdfd1('0x86'));}if(!_0x391448[_0xdfd1('0x87')]||!_0x391448[_0xdfd1('0x88')]){throw new db['Sequelize']['ValidationError'](_0xdfd1('0x89'));}_0x1d6fc2=_0x391448;return getBucketslist(_0x1d6fc2[_0xdfd1('0x87')],_0x1d6fc2[_0xdfd1('0x88')],_0x47b496['transcribeRegion']);})[_0xdfd1('0x24')](function(_0x3409e3){if(_0x3409e3&&_0x3409e3[_0xdfd1('0x8a')]){var _0x5c861f=_['find'](_0x3409e3['Buckets'],function(_0x5e9754){return _0x5e9754[_0xdfd1('0x8b')]===_0x47b496[_0xdfd1('0x73')];});if(!_0x5c861f){logger[_0xdfd1('0x68')](util['format'](_0xdfd1('0x8c'),_0x3d1154[_0xdfd1('0x4c')]['id'],_0x47b496[_0xdfd1('0x73')]));return createBucket(_0x1d6fc2[_0xdfd1('0x87')],_0x1d6fc2[_0xdfd1('0x88')],_0x47b496[_0xdfd1('0x80')],_0x47b496[_0xdfd1('0x73')]);}logger['info'](util[_0xdfd1('0x51')](_0xdfd1('0x8d'),_0x3d1154[_0xdfd1('0x4c')]['id'],_0x47b496[_0xdfd1('0x73')]));return;}})[_0xdfd1('0x24')](function(_0x558c7a){if(_0x3503b8[_0xdfd1('0x78')]==='NEW'){return transcribe(_0x3d1154[_0xdfd1('0x4c')]['id'],_0x1d6fc2[_0xdfd1('0x87')],_0x1d6fc2[_0xdfd1('0x88')],_0x47b496[_0xdfd1('0x80')],_0x47b496['bucket'],_0x3503b8[_0xdfd1('0x57')],_0x47b496[_0xdfd1('0x8e')]);}else{logger[_0xdfd1('0x68')](util[_0xdfd1('0x51')](_0xdfd1('0x8f'),_0x3d1154[_0xdfd1('0x4c')]['id']));return{'transcribeStatus':_0xdfd1('0x90')};}})['then'](function(_0x405cf4){if(_0x405cf4){_0x405cf4['tempSentiment']=_0x3d1154[_0xdfd1('0x4b')][_0xdfd1('0x82')];return _0x3503b8[_0xdfd1('0x91')](_0x405cf4);}})[_0xdfd1('0x24')](respondWithResult(_0x37724a,null))[_0xdfd1('0x46')](handleError(_0x37724a,null));};function writeFile(_0x4fab60,_0x23290c){return new Promise(function(_0x5b75d2,_0x36fc8f){fs[_0xdfd1('0x92')](_0x23290c,_0x4fab60,function(_0x17ae35,_0x180613){if(_0x17ae35){return _0x36fc8f(_0x17ae35);}else{return _0x5b75d2(_0x180613);}});});}exports[_0xdfd1('0x93')]=function(_0x3a9446,_0xc90d36,_0x3cec43){return db['VoiceRecording'][_0xdfd1('0x7c')]({'where':{'id':_0x3a9446[_0xdfd1('0x4c')]['id']}})[_0xdfd1('0x24')](handleEntityNotFound(_0xc90d36))[_0xdfd1('0x24')](function(_0x1a403f){if(_0x1a403f&&_0x1a403f[_0xdfd1('0x94')]){var _0x3f0157=_0x1a403f[_0xdfd1('0x94')];var _0x4d99c1=config[_0xdfd1('0x95')]+_0xdfd1('0x96')+_0x1a403f['id']+'.txt';if(fs[_0xdfd1('0x53')](_0x4d99c1)){return _0x4d99c1;}return writeFile(_0x3f0157,_0x4d99c1)[_0xdfd1('0x24')](function(){return _0x4d99c1;});}else{throw new db[(_0xdfd1('0x58'))][(_0xdfd1('0x59'))](_0xdfd1('0x97'));}})[_0xdfd1('0x24')](function(_0x31b220){return _0xc90d36[_0xdfd1('0x4e')](_0x31b220);})['catch'](handleError(_0xc90d36));}; \ No newline at end of file +var _0xd019=['count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','keys','filters','intersection','attributes','fields','length','hasOwnProperty','query','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','params','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','secrets','existsSync','Sequelize','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','col','token','push','$and','find','recording','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x521f8c,_0x592436){var _0x49e924=function(_0x4b0b06){while(--_0x4b0b06){_0x521f8c['push'](_0x521f8c['shift']());}};_0x49e924(++_0x592436);}(_0xd019,0x6d));var _0x9d01=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xd019[_0x31a576];return _0x30b1d3;};'use strict';var emlformat=require(_0x9d01('0x0'));var rimraf=require(_0x9d01('0x1'));var zipdir=require(_0x9d01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d01('0x3'));var BPromise=require(_0x9d01('0x4'));var Mustache=require(_0x9d01('0x5'));var util=require(_0x9d01('0x6'));var path=require(_0x9d01('0x7'));var sox=require('sox');var csv=require(_0x9d01('0x8'));var ejs=require(_0x9d01('0x9'));var fs=require('fs');var fs_extra=require(_0x9d01('0xa'));var _=require(_0x9d01('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d01('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9d01('0x8'));var querystring=require('querystring');var Papa=require(_0x9d01('0xd'));var AWS=require(_0x9d01('0xe'));var uuidv4=require(_0x9d01('0xf'));var Redis=require(_0x9d01('0x10'));var authService=require(_0x9d01('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d01('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d01('0x13'))(_0x9d01('0x14'));var utils=require(_0x9d01('0x15'));var config=require(_0x9d01('0x16'));var licenseUtil=require(_0x9d01('0x17'));var db=require(_0x9d01('0x18'))['db'];function respondWithStatusCode(_0x2369ac,_0x556eb9){_0x556eb9=_0x556eb9||0xcc;return function(_0x50410f){if(_0x50410f){return _0x2369ac[_0x9d01('0x19')](_0x556eb9);}return _0x2369ac[_0x9d01('0x1a')](_0x556eb9)[_0x9d01('0x1b')]();};}function respondWithResult(_0x1b1cc1,_0x480fd5){_0x480fd5=_0x480fd5||0xc8;return function(_0x34a5f3){if(_0x34a5f3){return _0x1b1cc1[_0x9d01('0x1a')](_0x480fd5)[_0x9d01('0x1c')](_0x34a5f3);}};}function respondWithFilteredResult(_0x34e3f9,_0x5df9fd){return function(_0x295852){if(_0x295852){var _0x32e38f=typeof _0x5df9fd[_0x9d01('0x1d')]===_0x9d01('0x1e')&&typeof _0x5df9fd[_0x9d01('0x1f')]===_0x9d01('0x1e');var _0xcc175a=_0x295852[_0x9d01('0x20')];var _0x281b05=_0x32e38f?0x0:_0x5df9fd[_0x9d01('0x1d')];var _0x37644b=_0x32e38f?_0x295852['count']:_0x5df9fd[_0x9d01('0x1d')]+_0x5df9fd['limit'];var _0x26370a;if(_0x37644b>=_0xcc175a){_0x37644b=_0xcc175a;_0x26370a=0xc8;}else{_0x26370a=0xce;}_0x34e3f9['status'](_0x26370a);return _0x34e3f9['set'](_0x9d01('0x21'),_0x281b05+'-'+_0x37644b+'/'+_0xcc175a)['json'](_0x295852);}return null;};}function patchUpdates(_0x292559){return function(_0x343789){try{jsonpatch[_0x9d01('0x22')](_0x343789,_0x292559,!![]);}catch(_0x14b213){return BPromise[_0x9d01('0x23')](_0x14b213);}return _0x343789[_0x9d01('0x24')]();};}function saveUpdates(_0x49eac8,_0x212583){return function(_0x5bd9b0){if(_0x5bd9b0){return _0x5bd9b0[_0x9d01('0x25')](_0x49eac8)['then'](function(_0x8a9047){return _0x8a9047;});}return null;};}function removeEntity(_0x50c7d7,_0x20a924){return function(_0x31af00){if(_0x31af00){return _0x31af00[_0x9d01('0x26')]()[_0x9d01('0x27')](function(){_0x50c7d7[_0x9d01('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340f88,_0xde6c08){return function(_0x3b866a){if(!_0x3b866a){_0x340f88[_0x9d01('0x19')](0x194);}return _0x3b866a;};}function handleError(_0x189208,_0x52d19a){_0x52d19a=_0x52d19a||0x1f4;return function(_0x4e1dc3){logger['error'](_0x4e1dc3[_0x9d01('0x28')]);if(_0x4e1dc3[_0x9d01('0x29')]){delete _0x4e1dc3['name'];}_0x189208[_0x9d01('0x1a')](_0x52d19a)[_0x9d01('0x2a')](_0x4e1dc3);};}exports[_0x9d01('0x2b')]=function(_0x35c309,_0x5926e4){var _0x3a299c={},_0x55059a={},_0x15c65f={'count':0x0,'rows':[]};var _0x53e57d=_[_0x9d01('0x2c')](db[_0x9d01('0x2d')][_0x9d01('0x2e')],function(_0x236989){return{'name':_0x236989['fieldName'],'type':_0x236989[_0x9d01('0x2f')][_0x9d01('0x30')]};});_0x55059a[_0x9d01('0x31')]=_[_0x9d01('0x32')](_[_0x9d01('0x2c')](_0x53e57d,'name'),[_0x9d01('0x33')]);_0x55059a['query']=_[_0x9d01('0x34')](_0x35c309['query']);_0x55059a[_0x9d01('0x35')]=_[_0x9d01('0x36')](_0x55059a[_0x9d01('0x31')],_0x55059a['query']);_0x3a299c[_0x9d01('0x37')]=_[_0x9d01('0x36')](_0x55059a['model'],qs[_0x9d01('0x38')](_0x35c309['query'][_0x9d01('0x38')]));_0x3a299c[_0x9d01('0x37')]=_0x3a299c[_0x9d01('0x37')][_0x9d01('0x39')]?_0x3a299c['attributes']:_0x55059a[_0x9d01('0x31')];if(!_0x35c309['query'][_0x9d01('0x3a')]('nolimit')){_0x3a299c[_0x9d01('0x1f')]=qs['limit'](_0x35c309[_0x9d01('0x3b')][_0x9d01('0x1f')]);_0x3a299c[_0x9d01('0x1d')]=qs[_0x9d01('0x1d')](_0x35c309[_0x9d01('0x3b')][_0x9d01('0x1d')]);}_0x3a299c[_0x9d01('0x3c')]=qs['sort'](_0x35c309['query'][_0x9d01('0x3d')]);_0x3a299c[_0x9d01('0x3e')]=qs['filters'](_['pick'](_0x35c309[_0x9d01('0x3b')],_0x55059a[_0x9d01('0x35')]),_0x53e57d);if(_0x35c309[_0x9d01('0x3b')][_0x9d01('0x3f')]){_0x3a299c[_0x9d01('0x3e')]=_[_0x9d01('0x40')](_0x3a299c[_0x9d01('0x3e')],{'$or':_['map'](_0x53e57d,function(_0x289e3e){if(_0x289e3e['type']!==_0x9d01('0x41')){var _0xd0de9e={};_0xd0de9e[_0x289e3e[_0x9d01('0x29')]]={'$like':'%'+_0x35c309[_0x9d01('0x3b')]['filter']+'%'};return _0xd0de9e;}})});}_0x3a299c=_[_0x9d01('0x40')]({},_0x3a299c,_0x35c309[_0x9d01('0x42')]);var _0x3b84d6={'where':_0x3a299c[_0x9d01('0x3e')]};return db[_0x9d01('0x2d')]['count'](_0x3b84d6)['then'](function(_0x5af9ef){_0x15c65f['count']=_0x5af9ef;if(_0x35c309[_0x9d01('0x3b')]['includeAll']){_0x3a299c[_0x9d01('0x43')]=[{'all':!![]}];}return db[_0x9d01('0x2d')][_0x9d01('0x44')](_0x3a299c);})[_0x9d01('0x27')](function(_0x505a32){_0x15c65f['rows']=_0x505a32;return _0x15c65f;})[_0x9d01('0x27')](respondWithFilteredResult(_0x5926e4,_0x3a299c))[_0x9d01('0x45')](handleError(_0x5926e4,null));};exports['show']=function(_0x1bc22e,_0x5964aa){var _0x133fe5={'raw':![],'where':{'id':_0x1bc22e[_0x9d01('0x46')]['id']}},_0x54b0e7={};_0x54b0e7[_0x9d01('0x31')]=_[_0x9d01('0x34')](db[_0x9d01('0x2d')][_0x9d01('0x2e')]);_0x54b0e7['query']=_['keys'](_0x1bc22e[_0x9d01('0x3b')]);_0x54b0e7['filters']=_[_0x9d01('0x36')](_0x54b0e7[_0x9d01('0x31')],_0x54b0e7[_0x9d01('0x3b')]);_0x133fe5['attributes']=_[_0x9d01('0x36')](_0x54b0e7[_0x9d01('0x31')],qs['fields'](_0x1bc22e[_0x9d01('0x3b')]['fields']));_0x133fe5[_0x9d01('0x37')]=_0x133fe5[_0x9d01('0x37')][_0x9d01('0x39')]?_0x133fe5['attributes']:_0x54b0e7[_0x9d01('0x31')];if(_0x1bc22e[_0x9d01('0x3b')]['includeAll']){_0x133fe5[_0x9d01('0x43')]=[{'all':!![]}];}_0x133fe5=_[_0x9d01('0x40')]({},_0x133fe5,_0x1bc22e[_0x9d01('0x42')]);return db[_0x9d01('0x2d')]['find'](_0x133fe5)[_0x9d01('0x27')](handleEntityNotFound(_0x5964aa,null))[_0x9d01('0x27')](respondWithResult(_0x5964aa,null))[_0x9d01('0x45')](handleError(_0x5964aa,null));};exports['create']=function(_0x43004c,_0x5670e4){return db['VoiceRecording'][_0x9d01('0x47')](_0x43004c[_0x9d01('0x48')],{})['then'](respondWithResult(_0x5670e4,0xc9))[_0x9d01('0x45')](handleError(_0x5670e4,null));};exports[_0x9d01('0x25')]=function(_0x55048e,_0x32cb78){if(_0x55048e[_0x9d01('0x48')]['id']){delete _0x55048e[_0x9d01('0x48')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x55048e[_0x9d01('0x46')]['id']}})[_0x9d01('0x27')](handleEntityNotFound(_0x32cb78,null))['then'](saveUpdates(_0x55048e[_0x9d01('0x48')],null))[_0x9d01('0x27')](respondWithResult(_0x32cb78,null))[_0x9d01('0x45')](handleError(_0x32cb78,null));};exports[_0x9d01('0x49')]=function(_0x5b7175,_0x4d111a){return db['VoiceRecording'][_0x9d01('0x49')]()['then'](respondWithResult(_0x4d111a,null))['catch'](handleError(_0x4d111a,null));};exports['download']=function(_0x369141,_0x560723,_0x506e8a){var _0x35b8ef=require(_0x9d01('0x4a'));var _0x134f15=![];var _0x273b7f={};if(_0x369141[_0x9d01('0x3b')]['type']&&_0x369141[_0x9d01('0x3b')]['type']===_0x9d01('0x4b')){_0x273b7f['uniqueid']=_0x369141['params']['id'];}else{_0x273b7f['id']=_0x369141[_0x9d01('0x46')]['id'];}return db['VoiceRecording']['find']({'where':_0x273b7f,'attributes':['id','value'],'raw':!![]})[_0x9d01('0x27')](handleEntityNotFound(_0x560723,null))[_0x9d01('0x27')](function(_0x319b43){if(_0x319b43){var _0x4d4a8f=_0x319b43[_0x9d01('0x4c')];var _0x269544=util[_0x9d01('0x33')](_0x9d01('0x4d'),_0x4d4a8f);if(fs['existsSync'](_0x269544)){_0x134f15=!![];return _0x35b8ef['decryptFile'](_0x269544,_0x4d4a8f,config[_0x9d01('0x4e')]['recording'])['then'](function(){return _0x319b43;});}return _0x319b43;}})['then'](function(_0x5569f3){if(_0x5569f3){var _0x3cce4e=_0x5569f3[_0x9d01('0x4c')];if(!fs[_0x9d01('0x4f')](_0x3cce4e)){throw new db[(_0x9d01('0x50'))][(_0x9d01('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x5569f3[_0x9d01('0x52')]){return _0x560723[_0x9d01('0x53')](_0x3cce4e,_0x5569f3[_0x9d01('0x52')]+path[_0x9d01('0x54')](_0x3cce4e),function(){if(_0x134f15){fs[_0x9d01('0x55')](_0x3cce4e);}});}else{return _0x560723[_0x9d01('0x53')](_0x3cce4e,function(_0x367a79){if(_0x134f15){fs[_0x9d01('0x55')](_0x3cce4e);}});}}})[_0x9d01('0x45')](function(_0x4c1408){if(_0x4c1408[_0x9d01('0x56')]===_0x9d01('0x57')){_0x560723[_0x9d01('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x560723,null);}});};exports[_0x9d01('0x58')]=function(_0x4a0cb5,_0x4b9ab3,_0x1f5dfb){var _0x520666=require(_0x9d01('0x4a'));var _0x2c8a93=![];var _0x4d5f7e={'$and':[db[_0x9d01('0x59')][_0x9d01('0x3e')](db[_0x9d01('0x59')]['fn']('MD5',db[_0x9d01('0x59')][_0x9d01('0x5a')]('uniqueid')),_0x4a0cb5[_0x9d01('0x3b')][_0x9d01('0x5b')])]};if(_0x4a0cb5['query'][_0x9d01('0x2f')]&&_0x4a0cb5['query'][_0x9d01('0x2f')]===_0x9d01('0x4b')){_0x4d5f7e['$and'][_0x9d01('0x5c')]({'uniqueid':_0x4a0cb5[_0x9d01('0x46')]['id']});}else{_0x4d5f7e[_0x9d01('0x5d')]['push']({'id':_0x4a0cb5[_0x9d01('0x46')]['id']});}return db[_0x9d01('0x2d')][_0x9d01('0x5e')]({'where':_0x4d5f7e,'attributes':['id',_0x9d01('0x4c')],'raw':!![]})[_0x9d01('0x27')](handleEntityNotFound(_0x4b9ab3,null))[_0x9d01('0x27')](function(_0x4c4981){if(_0x4c4981){var _0x137079=util[_0x9d01('0x33')](_0x9d01('0x4d'),_0x4c4981[_0x9d01('0x4c')]);if(fs[_0x9d01('0x4f')](_0x137079)){_0x2c8a93=!![];return _0x520666['decryptFile'](_0x137079,_0x4c4981['value'],config[_0x9d01('0x4e')][_0x9d01('0x5f')])[_0x9d01('0x27')](function(){return _0x4c4981;});}return _0x4c4981;}})[_0x9d01('0x27')](function(_0x2ff401){if(_0x2ff401){if(!fs['existsSync'](_0x2ff401[_0x9d01('0x4c')])){throw new db['Sequelize']['ValidationError'](_0x9d01('0x57'));}if(_0x2ff401[_0x9d01('0x52')]){return _0x4b9ab3[_0x9d01('0x53')](_0x2ff401['value'],_0x2ff401[_0x9d01('0x52')]+path[_0x9d01('0x54')](_0x2ff401[_0x9d01('0x4c')]),function(){if(_0x2c8a93){fs['unlink'](_0x2ff401[_0x9d01('0x4c')]);}});}else{return _0x4b9ab3[_0x9d01('0x53')](_0x2ff401[_0x9d01('0x4c')],function(_0x4f98c3){if(_0x2c8a93){fs[_0x9d01('0x55')](_0x2ff401[_0x9d01('0x4c')]);}});}}})[_0x9d01('0x45')](handleError(_0x4b9ab3,null));};exports[_0x9d01('0x26')]=function(_0x520bf2,_0x28c250){return db['VoiceRecording']['find']({'where':{'id':_0x520bf2[_0x9d01('0x46')]['id']}})[_0x9d01('0x27')](function(_0x2bc91a){if(_[_0x9d01('0x60')](_0x2bc91a)){throw new ReferenceError(_0x9d01('0x61'));}return _0x2bc91a;})[_0x9d01('0x27')](function(_0x3d0d37){var _0x2395a8=_0x3d0d37[_0x9d01('0x4c')];logger['info'](_0x9d01('0x62'),_0x2395a8);if(!_[_0x9d01('0x60')](_0x3d0d37['value'])&&fs[_0x9d01('0x4f')](_0x2395a8)){logger[_0x9d01('0x63')](_0x9d01('0x64')+_0x2395a8+_0x9d01('0x65'));fs['unlinkSync'](_0x2395a8);}_0x2395a8=_0x2395a8+'.cypher';if(!_[_0x9d01('0x60')](_0x3d0d37[_0x9d01('0x4c')])&&fs['existsSync'](_0x2395a8)){logger[_0x9d01('0x63')](_0x9d01('0x64')+_0x2395a8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9d01('0x66')](_0x2395a8);}return _0x3d0d37;})[_0x9d01('0x27')](function(_0x4733b0){if(!_0x4733b0)throw new InternalError();return _0x4733b0[_0x9d01('0x26')]();})[_0x9d01('0x27')](function(){_0x28c250[_0x9d01('0x1a')](0xcc)[_0x9d01('0x1b')]();})[_0x9d01('0x45')](handleError(_0x28c250,null));};function getBucketslist(_0x1b1669,_0x2abcf7,_0x5134b3){return new Promise(function(_0x5ca9fb,_0x2619fe){var _0x2256bf=new AWS['S3']({'accessKeyId':_0x2abcf7,'secretAccessKey':_0x1b1669,'region':_0x5134b3});_0x2256bf[_0x9d01('0x67')]({},function(_0x1163c3,_0x3275e1){if(_0x1163c3){return _0x2619fe(_0x1163c3);}else{return _0x5ca9fb(_0x3275e1);}});});}function createBucket(_0x21ae28,_0x36ee88,_0x280b74,_0xbdd3f){return new Promise(function(_0x1f5a8e,_0x1ca4c8){var _0x431603=new AWS['S3']({'accessKeyId':_0x36ee88,'secretAccessKey':_0x21ae28,'region':_0x280b74});_0x431603['createBucket']({'Bucket':_0xbdd3f},function(_0x54dfd5,_0x194fd8){if(_0x54dfd5){return _0x1ca4c8(_0x54dfd5);}else{return _0x1f5a8e(_0x194fd8);}});});}function uploadFile(_0x245449,_0x442cf2,_0x2c89f5,_0x460163,_0x31e577,_0xe65e6e){return new Promise(function(_0x23ca50,_0x478a96){var _0x595a68=new AWS['S3']({'accessKeyId':_0x442cf2,'secretAccessKey':_0x245449,'region':_0x2c89f5});_0x595a68['upload']({'Bucket':_0x460163,'Key':_0x31e577,'Body':_0xe65e6e},function(_0x5d169d,_0x2bd040){if(_0x5d169d){return _0x478a96(_0x5d169d);}else{return _0x23ca50(_0x2bd040);}});});}function startTranscribe(_0x22dbea,_0xa723fe,_0x428f66,_0x3af1d4,_0x4df487,_0x54ec26){return new Promise(function(_0x40bedc,_0x54feca){var _0xff3e2c=new AWS['TranscribeService']({'accessKeyId':_0xa723fe,'secretAccessKey':_0x22dbea,'region':_0x428f66});_0xff3e2c['startTranscriptionJob']({'TranscriptionJobName':_0x3af1d4,'LanguageCode':_0x4df487,'Media':{'MediaFileUri':_0x54ec26}},function(_0x1374e8,_0x480222){if(_0x1374e8){return _0x54feca(_0x1374e8);}else{return _0x40bedc(_0x480222);}});});}function transcribe(_0x946da3,_0x4000e3,_0x34ec89,_0x1ad37c,_0x2cfaee,_0xb9eed1,_0x55528b){return new Promise(function(_0x3924f5,_0x3887ad){var _0x4ffaf9={};logger[_0x9d01('0x63')](util[_0x9d01('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x946da3,_0x2cfaee));return uploadFile(_0x4000e3,_0x34ec89,_0x1ad37c,_0x2cfaee,path[_0x9d01('0x68')](_0xb9eed1),fs[_0x9d01('0x69')](_0xb9eed1))[_0x9d01('0x27')](function(_0x215d9a){logger[_0x9d01('0x63')](util[_0x9d01('0x33')](_0x9d01('0x6a'),_0x946da3,_0x2cfaee,_0x215d9a[_0x9d01('0x6b')]));_0x4ffaf9['bucket']=_0x215d9a['Bucket'];_0x4ffaf9['location']=_0x215d9a[_0x9d01('0x6b')];logger['info'](util[_0x9d01('0x33')](_0x9d01('0x6c'),_0x946da3));return startTranscribe(_0x4000e3,_0x34ec89,_0x1ad37c,uuidv4(),_0x55528b,_0x215d9a[_0x9d01('0x6b')]);})['then'](function(_0x3a3dc6){logger[_0x9d01('0x63')](util[_0x9d01('0x33')](_0x9d01('0x6d'),_0x946da3,_0x3a3dc6[_0x9d01('0x6e')][_0x9d01('0x6f')]));_0x4ffaf9[_0x9d01('0x70')]=_0x3a3dc6['TranscriptionJob'][_0x9d01('0x6f')];_0x4ffaf9['transcribeStatus']=_0x3a3dc6[_0x9d01('0x6e')]['TranscriptionJobStatus'];return _0x3924f5(_0x4ffaf9);})[_0x9d01('0x45')](function(_0x2ccec0){return _0x3887ad(_0x2ccec0);});});}exports[_0x9d01('0x71')]=function(_0xbf736e,_0x235900,_0x58b125){var _0x131f69;var _0x270ed3;var _0x52c970;var _0x2e79cb=require(_0x9d01('0x4a'));return db[_0x9d01('0x2d')][_0x9d01('0x72')]({'where':{'id':_0xbf736e[_0x9d01('0x46')]['id']}})['then'](function(_0x47fdc2){if(_0x47fdc2){var _0x5929fe=util[_0x9d01('0x33')](_0x9d01('0x4d'),_0x47fdc2['value']);if(fs[_0x9d01('0x4f')](_0x5929fe)){cypher=!![];return _0x2e79cb['decryptFile'](_0x5929fe,_0x47fdc2['value'],config[_0x9d01('0x4e')][_0x9d01('0x5f')])[_0x9d01('0x27')](function(){return _0x47fdc2;});}return _0x47fdc2;}})[_0x9d01('0x27')](function(_0x3cbb68){if(!_0x3cbb68){throw new db[(_0x9d01('0x50'))][(_0x9d01('0x51'))](_0x9d01('0x73'));}_0x270ed3=_0x3cbb68;return db['Setting'][_0x9d01('0x72')]({'where':{'id':0x1}});})[_0x9d01('0x27')](handleEntityNotFound(_0x235900,null))[_0x9d01('0x27')](function(_0x4bbdd8){if(_0x4bbdd8){_0x131f69=_0x4bbdd8;if(!_0x131f69['transcribe']||!_0x131f69[_0x9d01('0x74')]||!_0x131f69[_0x9d01('0x75')]||!_0x131f69[_0x9d01('0x76')]||!_0x131f69[_0x9d01('0x77')]){throw new db[(_0x9d01('0x50'))][(_0x9d01('0x51'))]('Transcribe\x20not\x20configured');}if(_0xbf736e['body'][_0x9d01('0x78')]&&(!_0x131f69[_0x9d01('0x79')]||!_0x131f69[_0x9d01('0x7a')]||!_0x131f69[_0x9d01('0x7b')]||!_0x131f69[_0x9d01('0x76')]||!_0x131f69[_0x9d01('0x77')])){throw new db[(_0x9d01('0x50'))][(_0x9d01('0x51'))](_0x9d01('0x7c'));}return db[_0x9d01('0x7d')][_0x9d01('0x72')]({'where':{'id':_0x131f69[_0x9d01('0x74')]}});}})[_0x9d01('0x27')](function(_0xceaafb){if(!_0xceaafb){throw new db[(_0x9d01('0x50'))]['ValidationError'](_0x9d01('0x7e'));}if(!_0xceaafb[_0x9d01('0x7f')]||!_0xceaafb[_0x9d01('0x80')]){throw new db['Sequelize'][(_0x9d01('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x52c970=_0xceaafb;return getBucketslist(_0x52c970[_0x9d01('0x7f')],_0x52c970[_0x9d01('0x80')],_0x131f69[_0x9d01('0x75')]);})[_0x9d01('0x27')](function(_0x38b44e){if(_0x38b44e&&_0x38b44e['Buckets']){var _0x4f7e45=_[_0x9d01('0x5e')](_0x38b44e['Buckets'],function(_0x3ef347){return _0x3ef347[_0x9d01('0x81')]===_0x131f69[_0x9d01('0x77')];});if(!_0x4f7e45){logger[_0x9d01('0x63')](util[_0x9d01('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xbf736e[_0x9d01('0x46')]['id'],_0x131f69['bucket']));return createBucket(_0x52c970[_0x9d01('0x7f')],_0x52c970[_0x9d01('0x80')],_0x131f69['transcribeRegion'],_0x131f69[_0x9d01('0x77')]);}logger['info'](util[_0x9d01('0x33')](_0x9d01('0x82'),_0xbf736e[_0x9d01('0x46')]['id'],_0x131f69['bucket']));return;}})[_0x9d01('0x27')](function(_0x4dc5b3){if(_0x270ed3['transcribeStatus']==='NEW'){return transcribe(_0xbf736e[_0x9d01('0x46')]['id'],_0x52c970[_0x9d01('0x7f')],_0x52c970[_0x9d01('0x80')],_0x131f69[_0x9d01('0x75')],_0x131f69[_0x9d01('0x77')],_0x270ed3['value'],_0x131f69[_0x9d01('0x76')]);}else{logger['info'](util[_0x9d01('0x33')](_0x9d01('0x83'),_0xbf736e[_0x9d01('0x46')]['id']));return{'transcribeStatus':_0x9d01('0x84')};}})[_0x9d01('0x27')](function(_0x2385a4){if(_0x2385a4){_0x2385a4[_0x9d01('0x85')]=_0xbf736e['body'][_0x9d01('0x78')];return _0x270ed3[_0x9d01('0x86')](_0x2385a4);}})['then'](respondWithResult(_0x235900,null))[_0x9d01('0x45')](handleError(_0x235900,null));};function writeFile(_0x124921,_0x41800f){return new Promise(function(_0x36fea4,_0x5daf02){fs[_0x9d01('0x87')](_0x41800f,_0x124921,function(_0x55ffbc,_0x4aea39){if(_0x55ffbc){return _0x5daf02(_0x55ffbc);}else{return _0x36fea4(_0x4aea39);}});});}exports[_0x9d01('0x88')]=function(_0x328ed0,_0x4a2abe,_0x5d497e){return db[_0x9d01('0x2d')][_0x9d01('0x72')]({'where':{'id':_0x328ed0[_0x9d01('0x46')]['id']}})[_0x9d01('0x27')](handleEntityNotFound(_0x4a2abe))[_0x9d01('0x27')](function(_0x34bcd1){if(_0x34bcd1&&_0x34bcd1['fileText']){var _0x50bfb3=_0x34bcd1[_0x9d01('0x89')];var _0x241ee9=config[_0x9d01('0x8a')]+_0x9d01('0x8b')+_0x34bcd1['id']+_0x9d01('0x8c');if(fs[_0x9d01('0x4f')](_0x241ee9)){return _0x241ee9;}return writeFile(_0x50bfb3,_0x241ee9)[_0x9d01('0x27')](function(){return _0x241ee9;});}else{throw new db[(_0x9d01('0x50'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x9d01('0x27')](function(_0x2efec6){return _0x4a2abe[_0x9d01('0x53')](_0x2efec6);})[_0x9d01('0x45')](handleError(_0x4a2abe));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 245ab8d..846a642 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 _0x5fc7=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x2230b6,_0xa8d79a){var _0x1dee6b=function(_0x3669a8){while(--_0x3669a8){_0x2230b6['push'](_0x2230b6['shift']());}};_0x1dee6b(++_0xa8d79a);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x5fc7[_0x58e469];return _0x4c01c5;};'use strict';var attributes=require(_0x75fc('0x0'));module[_0x75fc('0x1')]=function(_0x13ae0d,_0x2ea392){return _0x13ae0d[_0x75fc('0x2')](_0x75fc('0x3'),attributes,{'tableName':_0x75fc('0x4'),'paranoid':![],'indexes':[{'name':_0x75fc('0x5'),'fields':[_0x75fc('0x5')]},{'name':_0x75fc('0x6'),'fields':[_0x75fc('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5cd8=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','uniqueid'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x2bc73d,_0x11660e){_0x2bc73d=_0x2bc73d-0x0;var _0x5dd76e=_0x5cd8[_0x2bc73d];return _0x5dd76e;};'use strict';var attributes=require(_0x85cd('0x0'));module['exports']=function(_0x24bfe8,_0x32ee64){return _0x24bfe8[_0x85cd('0x1')](_0x85cd('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x85cd('0x3'),'fields':['uniqueid']},{'name':_0x85cd('0x4'),'fields':[_0x85cd('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 3df972e..6d5b214 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 _0x4991=['where','attributes','limit','catch','VoiceRecording','create','existsSync','value','%s.cypher','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x49f15e,_0xf21a58){var _0x2ecce3=function(_0x20803d){while(--_0x20803d){_0x49f15e['push'](_0x49f15e['shift']());}};_0x2ecce3(++_0xf21a58);}(_0x4991,0xf7));var _0x1499=function(_0x33e855,_0x15e4ab){_0x33e855=_0x33e855-0x0;var _0x277f04=_0x4991[_0x33e855];return _0x277f04;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['VoiceRecording'][_0x1499('0x16')](_0x1e45a9[_0x1499('0x17')],{'raw':_0x1e45a9['options']?_0x1e45a9[_0x1499('0x18')][_0x1499('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1a')]||null:null,'attributes':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1b')]||null:null,'limit':_0x1e45a9[_0x1499('0x18')]?_0x1e45a9[_0x1499('0x18')][_0x1499('0x1c')]||null:null})[_0x1499('0xc')](function(_0x223f4c){logger[_0x1499('0xd')](_0x1499('0x15'),_0x1e45a9);logger[_0x1499('0xf')](_0x1499('0x15'),_0x1e45a9,JSON['stringify'](_0x223f4c));_0x5b9859(_0x223f4c);})[_0x1499('0x1d')](function(_0xc79f69){logger[_0x1499('0x12')](_0x1499('0x15'),_0xc79f69[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533[_0x1499('0x12')](0x1f4,_0xc79f69['message']));});});};exports['CreateVoiceRecording']=function(_0x12739b){var _0x3c9aca=this;return new Promise(function(_0x3b9259,_0x50f0cc){var _0x32782a=require('../../components/encryptor');var _0x3e5ed1;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x1499('0xc')](function(_0x103efa){_0x3e5ed1=_0x103efa;return db[_0x1499('0x1e')][_0x1499('0x1f')](_0x12739b[_0x1499('0x17')]);})[_0x1499('0xc')](function(_0x3dd534){if(_0x3e5ed1['callRecordingEncryption']&&fs[_0x1499('0x20')](_0x3dd534[_0x1499('0x21')])){var _0x39995b=util['format'](_0x1499('0x22'),_0x3dd534[_0x1499('0x21')]);return _0x32782a['encryptFile'](_0x3dd534[_0x1499('0x21')],_0x39995b,config[_0x1499('0x23')]['recording'])[_0x1499('0xc')](function(){fs[_0x1499('0x24')](_0x3dd534[_0x1499('0x21')]);logger[_0x1499('0xd')](_0x1499('0x25'));return _0x3dd534;});}return _0x3dd534;})[_0x1499('0xc')](function(_0x7b4d75){logger[_0x1499('0xd')](_0x1499('0x26'),_0x12739b);logger[_0x1499('0xf')](_0x1499('0x26'),_0x12739b,JSON[_0x1499('0x11')](_0x7b4d75));_0x3b9259(_0x7b4d75);})[_0x1499('0x1d')](function(_0x3f4c1a){logger[_0x1499('0x12')](_0x1499('0x26'),_0x3f4c1a[_0x1499('0x13')],_0x12739b);_0x50f0cc(_0x3c9aca[_0x1499('0x12')](0x1f4,_0x3f4c1a[_0x1499('0x13')]));});});}; \ No newline at end of file +var _0xd7d1=['unlink','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x458b37,_0x3d5409){_0x458b37=_0x458b37-0x0;var _0x216144=_0xd7d1[_0x458b37];return _0x216144;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['VoiceRecording'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2['options'][_0x1d7d('0x1e')]||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['attributes']||null:null,'limit':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')]['limit']||null:null})['then'](function(_0x1dcaf2){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger['debug'](_0x1d7d('0x19'),_0x4db4f2,JSON[_0x1d7d('0x13')](_0x1dcaf2));_0x191024(_0x1dcaf2);})[_0x1d7d('0x18')](function(_0x21e59){logger['error'](_0x1d7d('0x19'),_0x21e59[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f['error'](0x1f4,_0x21e59['message']));});});};exports[_0x1d7d('0x1f')]=function(_0x52c618){var _0x38c323=this;return new Promise(function(_0x2d4de4,_0x3bc6e8){var _0x22c40d=require(_0x1d7d('0x20'));var _0x59f827;return db[_0x1d7d('0x21')][_0x1d7d('0x22')]({'attributes':['id',_0x1d7d('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x78adbe){_0x59f827=_0x78adbe;return db[_0x1d7d('0x24')][_0x1d7d('0x25')](_0x52c618['body']);})['then'](function(_0x53e25c){if(_0x59f827[_0x1d7d('0x23')]&&fs[_0x1d7d('0x26')](_0x53e25c['value'])){var _0x1ebcbc=util[_0x1d7d('0x27')](_0x1d7d('0x28'),_0x53e25c[_0x1d7d('0x29')]);return _0x22c40d[_0x1d7d('0x2a')](_0x53e25c[_0x1d7d('0x29')],_0x1ebcbc,config[_0x1d7d('0x2b')][_0x1d7d('0x2c')])[_0x1d7d('0xe')](function(){fs[_0x1d7d('0x2d')](_0x53e25c['value']);logger['info'](_0x1d7d('0x2e'));return _0x53e25c;});}return _0x53e25c;})[_0x1d7d('0xe')](function(_0x90e852){logger[_0x1d7d('0xf')](_0x1d7d('0x1f'),_0x52c618);logger[_0x1d7d('0x2f')](_0x1d7d('0x1f'),_0x52c618,JSON[_0x1d7d('0x13')](_0x90e852));_0x2d4de4(_0x90e852);})[_0x1d7d('0x18')](function(_0x47b6b2){logger[_0x1d7d('0x14')](_0x1d7d('0x1f'),_0x47b6b2[_0x1d7d('0x16')],_0x52c618);_0x3bc6e8(_0x38c323[_0x1d7d('0x14')](0x1f4,_0x47b6b2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 5feb4e1..4b53b18 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 _0x7149=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7149,0x1a1));var _0x9714=function(_0x247da7,_0x1ada31){_0x247da7=_0x247da7-0x0;var _0x470712=_0x7149[_0x247da7];return _0x470712;};'use strict';var multer=require(_0x9714('0x0'));var util=require(_0x9714('0x1'));var path=require(_0x9714('0x2'));var timeout=require('connect-timeout');var express=require(_0x9714('0x3'));var router=express[_0x9714('0x4')]();var fs_extra=require(_0x9714('0x5'));var auth=require(_0x9714('0x6'));var interaction=require(_0x9714('0x7'));var config=require(_0x9714('0x8'));var controller=require(_0x9714('0x9'));router[_0x9714('0xa')]('/',auth[_0x9714('0xb')](),controller[_0x9714('0xc')]);router['get'](_0x9714('0xd'),auth[_0x9714('0xb')](),controller[_0x9714('0xe')]);router['get'](_0x9714('0xf'),auth[_0x9714('0xb')](),controller[_0x9714('0x10')]);router[_0x9714('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9714('0x12')](_0x9714('0xf'),auth[_0x9714('0xb')](),controller[_0x9714('0x13')]);router[_0x9714('0x14')](_0x9714('0xf'),auth[_0x9714('0xb')](),controller[_0x9714('0x15')]);module[_0x9714('0x16')]=router; \ No newline at end of file +var _0xef65=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','delete','destroy','exports','util'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xef65,0x103));var _0x5ef6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef65[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5ef6('0x0'));var path=require(_0x5ef6('0x1'));var timeout=require(_0x5ef6('0x2'));var express=require(_0x5ef6('0x3'));var router=express[_0x5ef6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ef6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ef6('0x6'));var controller=require(_0x5ef6('0x7'));router[_0x5ef6('0x8')]('/',auth[_0x5ef6('0x9')](),controller[_0x5ef6('0xa')]);router[_0x5ef6('0x8')](_0x5ef6('0xb'),auth[_0x5ef6('0x9')](),controller[_0x5ef6('0xc')]);router[_0x5ef6('0x8')]('/:id',auth[_0x5ef6('0x9')](),controller[_0x5ef6('0xd')]);router[_0x5ef6('0xe')]('/',auth[_0x5ef6('0x9')](),controller['create']);router[_0x5ef6('0xf')](_0x5ef6('0x10'),auth[_0x5ef6('0x9')](),controller['update']);router[_0x5ef6('0x11')](_0x5ef6('0x10'),auth[_0x5ef6('0x9')](),controller[_0x5ef6('0x12')]);module[_0x5ef6('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 5f2c113..1b03e78 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 _0x3845=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0xbaeba7,_0x578dfa){var _0x4b42e7=function(_0x23bd26){while(--_0x23bd26){_0xbaeba7['push'](_0xbaeba7['shift']());}};_0x4b42e7(++_0x578dfa);}(_0x3845,0x136));var _0x5384=function(_0x12ec76,_0x45f3b4){_0x12ec76=_0x12ec76-0x0;var _0x586d4e=_0x3845[_0x12ec76];return _0x586d4e;};'use strict';var Sequelize=require(_0x5384('0x0'));var moment=require(_0x5384('0x1'));module[_0x5384('0x2')]={'type':{'type':Sequelize[_0x5384('0x3')](_0x5384('0x4'),_0x5384('0x5'))},'result':{'type':Sequelize[_0x5384('0x6')]},'transfererchannel':{'type':Sequelize[_0x5384('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x5384('0x6')]},'transferercalleridname':{'type':Sequelize[_0x5384('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5384('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x5384('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x5384('0x6')]},'transferercontext':{'type':Sequelize[_0x5384('0x6')]},'transfererexten':{'type':Sequelize[_0x5384('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x5384('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5384('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x5384('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5384('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5384('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x5384('0x6')]},'transfereeexten':{'type':Sequelize[_0x5384('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x5384('0x7'),'No')},'context':{'type':Sequelize[_0x5384('0x6')]},'extension':{'type':Sequelize[_0x5384('0x6')]}}; \ No newline at end of file +var _0x6d2e=['blind','attended','STRING','Yes','moment','exports','ENUM'];(function(_0x3a1f29,_0x413bfd){var _0x2f93d7=function(_0x291f88){while(--_0x291f88){_0x3a1f29['push'](_0x3a1f29['shift']());}};_0x2f93d7(++_0x413bfd);}(_0x6d2e,0x97));var _0xe6d2=function(_0x43caa2,_0x1ffb73){_0x43caa2=_0x43caa2-0x0;var _0x51b342=_0x6d2e[_0x43caa2];return _0x51b342;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe6d2('0x0'));module[_0xe6d2('0x1')]={'type':{'type':Sequelize[_0xe6d2('0x2')](_0xe6d2('0x3'),_0xe6d2('0x4'))},'result':{'type':Sequelize[_0xe6d2('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xe6d2('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xe6d2('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xe6d2('0x5')]},'transferercontext':{'type':Sequelize[_0xe6d2('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xe6d2('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xe6d2('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xe6d2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xe6d2('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xe6d2('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xe6d2('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xe6d2('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xe6d2('0x6'),'No')},'context':{'type':Sequelize[_0xe6d2('0x5')]},'extension':{'type':Sequelize[_0xe6d2('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d806454..1a26471 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 _0x39c3=['VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','name','send','index','map'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x39c3,0xb3));var _0x339c=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x39c3[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require(_0x339c('0x0'));var rimraf=require(_0x339c('0x1'));var zipdir=require(_0x339c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x339c('0x3'));var Mustache=require(_0x339c('0x4'));var util=require(_0x339c('0x5'));var path=require(_0x339c('0x6'));var sox=require(_0x339c('0x7'));var csv=require('to-csv');var ejs=require(_0x339c('0x8'));var fs=require('fs');var fs_extra=require(_0x339c('0x9'));var _=require(_0x339c('0xa'));var squel=require(_0x339c('0xb'));var crypto=require(_0x339c('0xc'));var jsforce=require(_0x339c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x339c('0xe'));var querystring=require(_0x339c('0xf'));var Papa=require('papaparse');var Redis=require(_0x339c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x339c('0x11'));var as=require(_0x339c('0x12'));var hardwareService=require(_0x339c('0x13'));var logger=require(_0x339c('0x14'))(_0x339c('0x15'));var utils=require('../../config/utils');var config=require(_0x339c('0x16'));var licenseUtil=require(_0x339c('0x17'));var db=require(_0x339c('0x18'))['db'];function respondWithStatusCode(_0x53afe3,_0x1f138b){_0x1f138b=_0x1f138b||0xcc;return function(_0x514127){if(_0x514127){return _0x53afe3[_0x339c('0x19')](_0x1f138b);}return _0x53afe3[_0x339c('0x1a')](_0x1f138b)[_0x339c('0x1b')]();};}function respondWithResult(_0x4df7c7,_0x27113){_0x27113=_0x27113||0xc8;return function(_0x314b87){if(_0x314b87){return _0x4df7c7[_0x339c('0x1a')](_0x27113)[_0x339c('0x1c')](_0x314b87);}};}function respondWithFilteredResult(_0x2c4f04,_0x55b6df){return function(_0x4c0dcb){if(_0x4c0dcb){var _0x2411ec=typeof _0x55b6df[_0x339c('0x1d')]===_0x339c('0x1e')&&typeof _0x55b6df['limit']===_0x339c('0x1e');var _0x1f50e3=_0x4c0dcb[_0x339c('0x1f')];var _0x5779d7=_0x2411ec?0x0:_0x55b6df[_0x339c('0x1d')];var _0x5b861b=_0x2411ec?_0x4c0dcb[_0x339c('0x1f')]:_0x55b6df['offset']+_0x55b6df[_0x339c('0x20')];var _0x2af1aa;if(_0x5b861b>=_0x1f50e3){_0x5b861b=_0x1f50e3;_0x2af1aa=0xc8;}else{_0x2af1aa=0xce;}_0x2c4f04[_0x339c('0x1a')](_0x2af1aa);return _0x2c4f04[_0x339c('0x21')](_0x339c('0x22'),_0x5779d7+'-'+_0x5b861b+'/'+_0x1f50e3)[_0x339c('0x1c')](_0x4c0dcb);}return null;};}function patchUpdates(_0x46163a){return function(_0x2af49c){try{jsonpatch['apply'](_0x2af49c,_0x46163a,!![]);}catch(_0x334642){return BPromise['reject'](_0x334642);}return _0x2af49c[_0x339c('0x23')]();};}function saveUpdates(_0x3a1f04,_0x185e06){return function(_0x9f0197){if(_0x9f0197){return _0x9f0197[_0x339c('0x24')](_0x3a1f04)[_0x339c('0x25')](function(_0x334b1b){return _0x334b1b;});}return null;};}function removeEntity(_0x52d543,_0x13abf7){return function(_0x241966){if(_0x241966){return _0x241966['destroy']()['then'](function(){_0x52d543[_0x339c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4867bb,_0x1a5310){return function(_0x114f56){if(!_0x114f56){_0x4867bb['sendStatus'](0x194);}return _0x114f56;};}function handleError(_0x56d712,_0x5ae06a){_0x5ae06a=_0x5ae06a||0x1f4;return function(_0x4347b8){logger[_0x339c('0x26')](_0x4347b8['stack']);if(_0x4347b8[_0x339c('0x27')]){delete _0x4347b8[_0x339c('0x27')];}_0x56d712[_0x339c('0x1a')](_0x5ae06a)[_0x339c('0x28')](_0x4347b8);};}exports[_0x339c('0x29')]=function(_0x35cd67,_0x1f8dca){var _0x52f998={},_0x270c4a={},_0xf00588={'count':0x0,'rows':[]};var _0x324917=_[_0x339c('0x2a')](db[_0x339c('0x2b')][_0x339c('0x2c')],function(_0x13234d){return{'name':_0x13234d[_0x339c('0x2d')],'type':_0x13234d[_0x339c('0x2e')][_0x339c('0x2f')]};});_0x270c4a[_0x339c('0x30')]=_['map'](_0x324917,_0x339c('0x27'));_0x270c4a['query']=_[_0x339c('0x31')](_0x35cd67['query']);_0x270c4a[_0x339c('0x32')]=_[_0x339c('0x33')](_0x270c4a[_0x339c('0x30')],_0x270c4a[_0x339c('0x34')]);_0x52f998[_0x339c('0x35')]=_[_0x339c('0x33')](_0x270c4a[_0x339c('0x30')],qs['fields'](_0x35cd67[_0x339c('0x34')][_0x339c('0x36')]));_0x52f998[_0x339c('0x35')]=_0x52f998[_0x339c('0x35')][_0x339c('0x37')]?_0x52f998[_0x339c('0x35')]:_0x270c4a[_0x339c('0x30')];if(!_0x35cd67[_0x339c('0x34')][_0x339c('0x38')](_0x339c('0x39'))){_0x52f998[_0x339c('0x20')]=qs[_0x339c('0x20')](_0x35cd67[_0x339c('0x34')]['limit']);_0x52f998[_0x339c('0x1d')]=qs[_0x339c('0x1d')](_0x35cd67[_0x339c('0x34')][_0x339c('0x1d')]);}_0x52f998[_0x339c('0x3a')]=qs[_0x339c('0x3b')](_0x35cd67[_0x339c('0x34')][_0x339c('0x3b')]);_0x52f998[_0x339c('0x3c')]=qs[_0x339c('0x32')](_['pick'](_0x35cd67[_0x339c('0x34')],_0x270c4a[_0x339c('0x32')]),_0x324917);if(_0x35cd67[_0x339c('0x34')][_0x339c('0x3d')]){_0x52f998['where']=_[_0x339c('0x3e')](_0x52f998[_0x339c('0x3c')],{'$or':_['map'](_0x324917,function(_0x16c36f){if(_0x16c36f[_0x339c('0x2e')]!==_0x339c('0x3f')){var _0x4a84c8={};_0x4a84c8[_0x16c36f[_0x339c('0x27')]]={'$like':'%'+_0x35cd67[_0x339c('0x34')]['filter']+'%'};return _0x4a84c8;}})});}_0x52f998=_[_0x339c('0x3e')]({},_0x52f998,_0x35cd67['options']);var _0x56fc1c={'where':_0x52f998[_0x339c('0x3c')]};return db[_0x339c('0x2b')][_0x339c('0x1f')](_0x56fc1c)[_0x339c('0x25')](function(_0x2b29ac){_0xf00588[_0x339c('0x1f')]=_0x2b29ac;if(_0x35cd67['query'][_0x339c('0x40')]){_0x52f998['include']=[{'all':!![]}];}return db[_0x339c('0x2b')][_0x339c('0x41')](_0x52f998);})[_0x339c('0x25')](function(_0x28c7b7){_0xf00588[_0x339c('0x42')]=_0x28c7b7;return _0xf00588;})['then'](respondWithFilteredResult(_0x1f8dca,_0x52f998))[_0x339c('0x43')](handleError(_0x1f8dca,null));};exports[_0x339c('0x44')]=function(_0x350b7c,_0x26f162){var _0x288669={'raw':!![],'where':{'id':_0x350b7c['params']['id']}},_0x10bb46={};_0x10bb46[_0x339c('0x30')]=_[_0x339c('0x31')](db[_0x339c('0x2b')][_0x339c('0x2c')]);_0x10bb46[_0x339c('0x34')]=_[_0x339c('0x31')](_0x350b7c[_0x339c('0x34')]);_0x10bb46[_0x339c('0x32')]=_[_0x339c('0x33')](_0x10bb46[_0x339c('0x30')],_0x10bb46[_0x339c('0x34')]);_0x288669[_0x339c('0x35')]=_[_0x339c('0x33')](_0x10bb46[_0x339c('0x30')],qs['fields'](_0x350b7c[_0x339c('0x34')]['fields']));_0x288669[_0x339c('0x35')]=_0x288669['attributes']['length']?_0x288669[_0x339c('0x35')]:_0x10bb46[_0x339c('0x30')];if(_0x350b7c[_0x339c('0x34')][_0x339c('0x40')]){_0x288669['include']=[{'all':!![]}];}_0x288669=_[_0x339c('0x3e')]({},_0x288669,_0x350b7c[_0x339c('0x45')]);return db['VoiceTransferReport'][_0x339c('0x46')](_0x288669)[_0x339c('0x25')](handleEntityNotFound(_0x26f162,null))[_0x339c('0x25')](respondWithResult(_0x26f162,null))[_0x339c('0x43')](handleError(_0x26f162,null));};exports[_0x339c('0x47')]=function(_0x433cfc,_0x3b2184){return db[_0x339c('0x2b')][_0x339c('0x47')](_0x433cfc[_0x339c('0x48')],{})[_0x339c('0x25')](respondWithResult(_0x3b2184,0xc9))[_0x339c('0x43')](handleError(_0x3b2184,null));};exports[_0x339c('0x24')]=function(_0x4c7dfc,_0x5219ca){if(_0x4c7dfc[_0x339c('0x48')]['id']){delete _0x4c7dfc['body']['id'];}return db[_0x339c('0x2b')][_0x339c('0x46')]({'where':{'id':_0x4c7dfc[_0x339c('0x49')]['id']}})[_0x339c('0x25')](handleEntityNotFound(_0x5219ca,null))[_0x339c('0x25')](saveUpdates(_0x4c7dfc['body'],null))[_0x339c('0x25')](respondWithResult(_0x5219ca,null))[_0x339c('0x43')](handleError(_0x5219ca,null));};exports['destroy']=function(_0x31c33a,_0x51cff9){return db['VoiceTransferReport'][_0x339c('0x46')]({'where':{'id':_0x31c33a['params']['id']}})[_0x339c('0x25')](handleEntityNotFound(_0x51cff9,null))[_0x339c('0x25')](removeEntity(_0x51cff9,null))[_0x339c('0x43')](handleError(_0x51cff9,null));};exports['describe']=function(_0x2d618f,_0x548232){return db[_0x339c('0x2b')]['describe']()[_0x339c('0x25')](respondWithResult(_0x548232,null))[_0x339c('0x43')](handleError(_0x548232,null));}; \ No newline at end of file +var _0xebc3=['reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x206053,_0x422374){var _0x39e8db=function(_0x4d3d4c){while(--_0x4d3d4c){_0x206053['push'](_0x206053['shift']());}};_0x39e8db(++_0x422374);}(_0xebc3,0x71));var _0x3ebc=function(_0x2f237e,_0x5a78ff){_0x2f237e=_0x2f237e-0x0;var _0x52b67f=_0xebc3[_0x2f237e];return _0x52b67f;};'use strict';var emlformat=require(_0x3ebc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ebc('0x1'));var jsonpatch=require(_0x3ebc('0x2'));var rp=require(_0x3ebc('0x3'));var moment=require(_0x3ebc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ebc('0x5'));var util=require(_0x3ebc('0x6'));var path=require(_0x3ebc('0x7'));var sox=require(_0x3ebc('0x8'));var csv=require(_0x3ebc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ebc('0xa'));var _=require(_0x3ebc('0xb'));var squel=require(_0x3ebc('0xc'));var crypto=require(_0x3ebc('0xd'));var jsforce=require(_0x3ebc('0xe'));var deskjs=require(_0x3ebc('0xf'));var toCsv=require(_0x3ebc('0x9'));var querystring=require('querystring');var Papa=require(_0x3ebc('0x10'));var Redis=require(_0x3ebc('0x11'));var authService=require(_0x3ebc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ebc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ebc('0x14'))('api');var utils=require(_0x3ebc('0x15'));var config=require(_0x3ebc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17e9ce,_0x82d457){_0x82d457=_0x82d457||0xcc;return function(_0x3f5f19){if(_0x3f5f19){return _0x17e9ce[_0x3ebc('0x17')](_0x82d457);}return _0x17e9ce[_0x3ebc('0x18')](_0x82d457)[_0x3ebc('0x19')]();};}function respondWithResult(_0x5c1fd6,_0x3ed237){_0x3ed237=_0x3ed237||0xc8;return function(_0x44f88c){if(_0x44f88c){return _0x5c1fd6[_0x3ebc('0x18')](_0x3ed237)[_0x3ebc('0x1a')](_0x44f88c);}};}function respondWithFilteredResult(_0x399011,_0x25a146){return function(_0x481116){if(_0x481116){var _0x3efdbe=typeof _0x25a146[_0x3ebc('0x1b')]===_0x3ebc('0x1c')&&typeof _0x25a146[_0x3ebc('0x1d')]===_0x3ebc('0x1c');var _0x26d6e1=_0x481116['count'];var _0x2d2e16=_0x3efdbe?0x0:_0x25a146[_0x3ebc('0x1b')];var _0x248cec=_0x3efdbe?_0x481116[_0x3ebc('0x1e')]:_0x25a146[_0x3ebc('0x1b')]+_0x25a146[_0x3ebc('0x1d')];var _0x4c0f13;if(_0x248cec>=_0x26d6e1){_0x248cec=_0x26d6e1;_0x4c0f13=0xc8;}else{_0x4c0f13=0xce;}_0x399011[_0x3ebc('0x18')](_0x4c0f13);return _0x399011[_0x3ebc('0x1f')]('Content-Range',_0x2d2e16+'-'+_0x248cec+'/'+_0x26d6e1)[_0x3ebc('0x1a')](_0x481116);}return null;};}function patchUpdates(_0x5cbf74){return function(_0x1eec94){try{jsonpatch[_0x3ebc('0x20')](_0x1eec94,_0x5cbf74,!![]);}catch(_0x3a1d89){return BPromise[_0x3ebc('0x21')](_0x3a1d89);}return _0x1eec94[_0x3ebc('0x22')]();};}function saveUpdates(_0x3b2118,_0x3938a0){return function(_0x3edcdb){if(_0x3edcdb){return _0x3edcdb[_0x3ebc('0x23')](_0x3b2118)[_0x3ebc('0x24')](function(_0xf6d7c8){return _0xf6d7c8;});}return null;};}function removeEntity(_0x17aada,_0x30b2ef){return function(_0x3780be){if(_0x3780be){return _0x3780be[_0x3ebc('0x25')]()[_0x3ebc('0x24')](function(){_0x17aada[_0x3ebc('0x18')](0xcc)[_0x3ebc('0x19')]();});}};}function handleEntityNotFound(_0x36429c,_0x412217){return function(_0x5c6efc){if(!_0x5c6efc){_0x36429c[_0x3ebc('0x17')](0x194);}return _0x5c6efc;};}function handleError(_0x377bde,_0x4c31a0){_0x4c31a0=_0x4c31a0||0x1f4;return function(_0x21c027){logger[_0x3ebc('0x26')](_0x21c027[_0x3ebc('0x27')]);if(_0x21c027[_0x3ebc('0x28')]){delete _0x21c027['name'];}_0x377bde[_0x3ebc('0x18')](_0x4c31a0)['send'](_0x21c027);};}exports[_0x3ebc('0x29')]=function(_0x4e848e,_0x563459){var _0x49ada3={},_0x3358c2={},_0x1e2959={'count':0x0,'rows':[]};var _0xba67e5=_[_0x3ebc('0x2a')](db[_0x3ebc('0x2b')][_0x3ebc('0x2c')],function(_0x3c13c0){return{'name':_0x3c13c0[_0x3ebc('0x2d')],'type':_0x3c13c0[_0x3ebc('0x2e')]['key']};});_0x3358c2[_0x3ebc('0x2f')]=_[_0x3ebc('0x2a')](_0xba67e5,_0x3ebc('0x28'));_0x3358c2[_0x3ebc('0x30')]=_[_0x3ebc('0x31')](_0x4e848e['query']);_0x3358c2['filters']=_[_0x3ebc('0x32')](_0x3358c2['model'],_0x3358c2['query']);_0x49ada3[_0x3ebc('0x33')]=_[_0x3ebc('0x32')](_0x3358c2['model'],qs[_0x3ebc('0x34')](_0x4e848e[_0x3ebc('0x30')][_0x3ebc('0x34')]));_0x49ada3[_0x3ebc('0x33')]=_0x49ada3['attributes']['length']?_0x49ada3[_0x3ebc('0x33')]:_0x3358c2['model'];if(!_0x4e848e[_0x3ebc('0x30')][_0x3ebc('0x35')](_0x3ebc('0x36'))){_0x49ada3[_0x3ebc('0x1d')]=qs[_0x3ebc('0x1d')](_0x4e848e[_0x3ebc('0x30')]['limit']);_0x49ada3['offset']=qs[_0x3ebc('0x1b')](_0x4e848e[_0x3ebc('0x30')][_0x3ebc('0x1b')]);}_0x49ada3['order']=qs[_0x3ebc('0x37')](_0x4e848e[_0x3ebc('0x30')][_0x3ebc('0x37')]);_0x49ada3[_0x3ebc('0x38')]=qs[_0x3ebc('0x39')](_[_0x3ebc('0x3a')](_0x4e848e[_0x3ebc('0x30')],_0x3358c2[_0x3ebc('0x39')]),_0xba67e5);if(_0x4e848e[_0x3ebc('0x30')]['filter']){_0x49ada3[_0x3ebc('0x38')]=_[_0x3ebc('0x3b')](_0x49ada3[_0x3ebc('0x38')],{'$or':_[_0x3ebc('0x2a')](_0xba67e5,function(_0x233b59){if(_0x233b59[_0x3ebc('0x2e')]!==_0x3ebc('0x3c')){var _0x383910={};_0x383910[_0x233b59[_0x3ebc('0x28')]]={'$like':'%'+_0x4e848e[_0x3ebc('0x30')]['filter']+'%'};return _0x383910;}})});}_0x49ada3=_[_0x3ebc('0x3b')]({},_0x49ada3,_0x4e848e['options']);var _0x2b401b={'where':_0x49ada3[_0x3ebc('0x38')]};return db['VoiceTransferReport'][_0x3ebc('0x1e')](_0x2b401b)[_0x3ebc('0x24')](function(_0x3085da){_0x1e2959[_0x3ebc('0x1e')]=_0x3085da;if(_0x4e848e['query'][_0x3ebc('0x3d')]){_0x49ada3['include']=[{'all':!![]}];}return db[_0x3ebc('0x2b')][_0x3ebc('0x3e')](_0x49ada3);})[_0x3ebc('0x24')](function(_0x42f1a0){_0x1e2959[_0x3ebc('0x3f')]=_0x42f1a0;return _0x1e2959;})[_0x3ebc('0x24')](respondWithFilteredResult(_0x563459,_0x49ada3))[_0x3ebc('0x40')](handleError(_0x563459,null));};exports[_0x3ebc('0x41')]=function(_0x58f09e,_0x38529d){var _0x1ecb51={'raw':!![],'where':{'id':_0x58f09e['params']['id']}},_0x485c36={};_0x485c36['model']=_[_0x3ebc('0x31')](db['VoiceTransferReport']['rawAttributes']);_0x485c36['query']=_[_0x3ebc('0x31')](_0x58f09e[_0x3ebc('0x30')]);_0x485c36['filters']=_[_0x3ebc('0x32')](_0x485c36[_0x3ebc('0x2f')],_0x485c36[_0x3ebc('0x30')]);_0x1ecb51[_0x3ebc('0x33')]=_[_0x3ebc('0x32')](_0x485c36[_0x3ebc('0x2f')],qs[_0x3ebc('0x34')](_0x58f09e['query'][_0x3ebc('0x34')]));_0x1ecb51[_0x3ebc('0x33')]=_0x1ecb51[_0x3ebc('0x33')]['length']?_0x1ecb51['attributes']:_0x485c36[_0x3ebc('0x2f')];if(_0x58f09e['query'][_0x3ebc('0x3d')]){_0x1ecb51[_0x3ebc('0x42')]=[{'all':!![]}];}_0x1ecb51=_[_0x3ebc('0x3b')]({},_0x1ecb51,_0x58f09e[_0x3ebc('0x43')]);return db['VoiceTransferReport'][_0x3ebc('0x44')](_0x1ecb51)[_0x3ebc('0x24')](handleEntityNotFound(_0x38529d,null))[_0x3ebc('0x24')](respondWithResult(_0x38529d,null))[_0x3ebc('0x40')](handleError(_0x38529d,null));};exports[_0x3ebc('0x45')]=function(_0x46a711,_0x56dc0d){return db['VoiceTransferReport'][_0x3ebc('0x45')](_0x46a711[_0x3ebc('0x46')],{})[_0x3ebc('0x24')](respondWithResult(_0x56dc0d,0xc9))[_0x3ebc('0x40')](handleError(_0x56dc0d,null));};exports[_0x3ebc('0x23')]=function(_0xf9ee4e,_0x41309c){if(_0xf9ee4e[_0x3ebc('0x46')]['id']){delete _0xf9ee4e['body']['id'];}return db[_0x3ebc('0x2b')][_0x3ebc('0x44')]({'where':{'id':_0xf9ee4e[_0x3ebc('0x47')]['id']}})['then'](handleEntityNotFound(_0x41309c,null))[_0x3ebc('0x24')](saveUpdates(_0xf9ee4e[_0x3ebc('0x46')],null))['then'](respondWithResult(_0x41309c,null))[_0x3ebc('0x40')](handleError(_0x41309c,null));};exports[_0x3ebc('0x25')]=function(_0x123df8,_0x3185c4){return db[_0x3ebc('0x2b')][_0x3ebc('0x44')]({'where':{'id':_0x123df8[_0x3ebc('0x47')]['id']}})[_0x3ebc('0x24')](handleEntityNotFound(_0x3185c4,null))['then'](removeEntity(_0x3185c4,null))[_0x3ebc('0x40')](handleError(_0x3185c4,null));};exports[_0x3ebc('0x48')]=function(_0x220fd8,_0x2f6541){return db[_0x3ebc('0x2b')]['describe']()['then'](respondWithResult(_0x2f6541,null))['catch'](handleError(_0x2f6541,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 7897a4b..b7bb2e7 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 _0x8134=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash','util'];(function(_0x508431,_0x23e7a4){var _0x44620e=function(_0x28e8d8){while(--_0x28e8d8){_0x508431['push'](_0x508431['shift']());}};_0x44620e(++_0x23e7a4);}(_0x8134,0x1ed));var _0x4813=function(_0x1b021c,_0x12257d){_0x1b021c=_0x1b021c-0x0;var _0x4290d3=_0x8134[_0x1b021c];return _0x4290d3;};'use strict';var _=require(_0x4813('0x0'));var util=require(_0x4813('0x1'));var logger=require(_0x4813('0x2'))(_0x4813('0x3'));var moment=require(_0x4813('0x4'));var BPromise=require(_0x4813('0x5'));var rp=require(_0x4813('0x6'));var fs=require('fs');var path=require(_0x4813('0x7'));var rimraf=require(_0x4813('0x8'));var config=require(_0x4813('0x9'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0xa1b054,_0xe12db7){return _0xa1b054[_0x4813('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6707=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','lodash'];(function(_0x2c5e3b,_0x237fb9){var _0xfd6239=function(_0x57c2f5){while(--_0x57c2f5){_0x2c5e3b['push'](_0x2c5e3b['shift']());}};_0xfd6239(++_0x237fb9);}(_0x6707,0xc5));var _0x7670=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x6707[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x7670('0x0'));var util=require(_0x7670('0x1'));var logger=require(_0x7670('0x2'))(_0x7670('0x3'));var moment=require(_0x7670('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7670('0x5'));var rimraf=require(_0x7670('0x6'));var config=require(_0x7670('0x7'));var attributes=require(_0x7670('0x8'));module[_0x7670('0x9')]=function(_0xad6fa1,_0x562196){return _0xad6fa1['define']('VoiceTransferReport',attributes,{'tableName':_0x7670('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 0d38f33..c8a0f8f 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 _0xdafd=['info','VoiceTransferReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x21156d,_0x4cbd72){var _0x358638=function(_0x235e05){while(--_0x235e05){_0x21156d['push'](_0x21156d['shift']());}};_0x358638(++_0x4cbd72);}(_0xdafd,0xb5));var _0xddaf=function(_0x37d5ca,_0x128df8){_0x37d5ca=_0x37d5ca-0x0;var _0xc993f4=_0xdafd[_0x37d5ca];return _0xc993f4;};'use strict';var _=require(_0xddaf('0x0'));var util=require(_0xddaf('0x1'));var moment=require(_0xddaf('0x2'));var BPromise=require(_0xddaf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddaf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xddaf('0x6'));var jayson=require(_0xddaf('0x7'));var client=jayson[_0xddaf('0x8')][_0xddaf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286d0c,_0x53a432,_0xd5b1ab){return new BPromise(function(_0x45edb7,_0x56af84){return client['request'](_0x286d0c,_0xd5b1ab)[_0xddaf('0xa')](function(_0xfe837e){logger[_0xddaf('0xb')](_0xddaf('0xc'),_0x53a432,'request\x20sent');logger[_0xddaf('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x53a432,'request\x20sent',JSON['stringify'](_0xfe837e));if(_0xfe837e[_0xddaf('0xe')]){if(_0xfe837e[_0xddaf('0xe')][_0xddaf('0xf')]===0x1f4){logger[_0xddaf('0xe')](_0xddaf('0xc'),_0x53a432,_0xfe837e[_0xddaf('0xe')][_0xddaf('0x10')]);return _0x56af84(_0xfe837e[_0xddaf('0xe')][_0xddaf('0x10')]);}logger[_0xddaf('0xe')](_0xddaf('0xc'),_0x53a432,_0xfe837e[_0xddaf('0xe')]['message']);return _0x45edb7(_0xfe837e['error'][_0xddaf('0x10')]);}else{logger[_0xddaf('0xb')](_0xddaf('0xc'),_0x53a432,_0xddaf('0x11'));_0x45edb7(_0xfe837e['result'][_0xddaf('0x10')]);}})[_0xddaf('0x12')](function(_0x1dbe17){logger[_0xddaf('0xe')](_0xddaf('0xc'),_0x53a432,_0x1dbe17);_0x56af84(_0x1dbe17);});});}exports[_0xddaf('0x13')]=function(_0x16e473){var _0x37ca43=this;return new Promise(function(_0x5ec901,_0x5590d5){return db[_0xddaf('0x14')][_0xddaf('0x15')](_0x16e473['body'],{'raw':_0x16e473['options']?_0x16e473[_0xddaf('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xddaf('0xa')](function(_0x104c08){logger[_0xddaf('0xb')](_0xddaf('0x13'),_0x16e473);logger['debug'](_0xddaf('0x13'),_0x16e473,JSON[_0xddaf('0x17')](_0x104c08));_0x5ec901(_0x104c08);})['catch'](function(_0x4b897e){logger['error'](_0xddaf('0x13'),_0x4b897e[_0xddaf('0x10')],_0x16e473);_0x5590d5(_0x37ca43['error'](0x1f4,_0x4b897e[_0xddaf('0x10')]));});});}; \ No newline at end of file +var _0xe3f9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','then','lodash','util'];(function(_0x377b66,_0x4bbfe7){var _0x19a8c6=function(_0x567a3f){while(--_0x567a3f){_0x377b66['push'](_0x377b66['shift']());}};_0x19a8c6(++_0x4bbfe7);}(_0xe3f9,0xc2));var _0x9e3f=function(_0x59eb02,_0xdba397){_0x59eb02=_0x59eb02-0x0;var _0x259391=_0xe3f9[_0x59eb02];return _0x259391;};'use strict';var _=require(_0x9e3f('0x0'));var util=require(_0x9e3f('0x1'));var moment=require(_0x9e3f('0x2'));var BPromise=require(_0x9e3f('0x3'));var rs=require(_0x9e3f('0x4'));var fs=require('fs');var Redis=require(_0x9e3f('0x5'));var db=require(_0x9e3f('0x6'))['db'];var utils=require(_0x9e3f('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e3f('0x8'));var jayson=require(_0x9e3f('0x9'));var client=jayson['client'][_0x9e3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cd95a,_0x8c579d,_0x271224){return new BPromise(function(_0x46f8aa,_0xea488){return client[_0x9e3f('0xb')](_0x4cd95a,_0x271224)['then'](function(_0x40f3b7){logger[_0x9e3f('0xc')](_0x9e3f('0xd'),_0x8c579d,_0x9e3f('0xe'));logger[_0x9e3f('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x8c579d,_0x9e3f('0xe'),JSON[_0x9e3f('0x10')](_0x40f3b7));if(_0x40f3b7[_0x9e3f('0x11')]){if(_0x40f3b7[_0x9e3f('0x11')][_0x9e3f('0x12')]===0x1f4){logger['error'](_0x9e3f('0xd'),_0x8c579d,_0x40f3b7[_0x9e3f('0x11')][_0x9e3f('0x13')]);return _0xea488(_0x40f3b7[_0x9e3f('0x11')][_0x9e3f('0x13')]);}logger[_0x9e3f('0x11')](_0x9e3f('0xd'),_0x8c579d,_0x40f3b7[_0x9e3f('0x11')]['message']);return _0x46f8aa(_0x40f3b7[_0x9e3f('0x11')][_0x9e3f('0x13')]);}else{logger['info'](_0x9e3f('0xd'),_0x8c579d,_0x9e3f('0xe'));_0x46f8aa(_0x40f3b7[_0x9e3f('0x14')][_0x9e3f('0x13')]);}})[_0x9e3f('0x15')](function(_0x4ed549){logger[_0x9e3f('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x8c579d,_0x4ed549);_0xea488(_0x4ed549);});});}exports[_0x9e3f('0x16')]=function(_0x255cd4){var _0x1727cd=this;return new Promise(function(_0x47b3d8,_0x49e776){return db[_0x9e3f('0x17')]['create'](_0x255cd4[_0x9e3f('0x18')],{'raw':_0x255cd4[_0x9e3f('0x19')]?_0x255cd4['options'][_0x9e3f('0x1a')]===undefined?!![]:![]:!![]})[_0x9e3f('0x1b')](function(_0x3d81a0){logger['info'](_0x9e3f('0x16'),_0x255cd4);logger[_0x9e3f('0xf')](_0x9e3f('0x16'),_0x255cd4,JSON[_0x9e3f('0x10')](_0x3d81a0));_0x47b3d8(_0x3d81a0);})[_0x9e3f('0x15')](function(_0x3fd2e5){logger[_0x9e3f('0x11')]('CreateVoiceTransferReport',_0x3fd2e5['message'],_0x255cd4);_0x49e776(_0x1727cd[_0x9e3f('0x11')](0x1f4,_0x3fd2e5['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 9ac592a..f2aefe8 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 _0x9bde=['Router','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','transfer'];(function(_0x4dbcd6,_0x34326c){var _0x541e55=function(_0x59eb00){while(--_0x59eb00){_0x4dbcd6['push'](_0x4dbcd6['shift']());}};_0x541e55(++_0x34326c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4927eb,_0x326497){_0x4927eb=_0x4927eb-0x0;var _0x248226=_0x9bde[_0x4927eb];return _0x248226;};'use strict';var express=require('express');var router=express[_0xe9bd('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe9bd('0x1'));router['post'](_0xe9bd('0x2'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0x5')]);router[_0xe9bd('0x6')](_0xe9bd('0x7'),auth[_0xe9bd('0x3')](),auth['isWebrtcLicence'](),controller[_0xe9bd('0x8')]);router[_0xe9bd('0x6')](_0xe9bd('0x9'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xa')]);router[_0xe9bd('0x6')](_0xe9bd('0xb'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['hold']);router['post'](_0xe9bd('0xc'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['unhold']);router[_0xe9bd('0x6')](_0xe9bd('0xd'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['calls']);router[_0xe9bd('0x6')]('/transfer',auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xe')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x5becd6,_0x13e651){var _0x3b7b78=function(_0x2193b3){while(--_0x2193b3){_0x5becd6['push'](_0x5becd6['shift']());}};_0x3b7b78(++_0x13e651);}(_0x34e8,0x12c));var _0x834e=function(_0x2a2c13,_0x320f5d){_0x2a2c13=_0x2a2c13-0x0;var _0x1aff40=_0x34e8[_0x2a2c13];return _0x1aff40;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index f572949..cce969b 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 _0x85b5=['emit','handleError:','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','userId','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls\x20fired:','filter','UserId','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','bluebird','http','webbarapi','ioredis','redis','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x85b5,0x7f));var _0x585b=function(_0x861c00,_0xca3ec){_0x861c00=_0x861c00-0x0;var _0x4c87cf=_0x85b5[_0x861c00];return _0x4c87cf;};'use strict';var path=require(_0x585b('0x0'));var fs=require('fs');var _=require(_0x585b('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x585b('0x2'));var util=require('util');var BPromise=require(_0x585b('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x585b('0x4')]({'port':0x232a});var logger=require('../../config/logger')(_0x585b('0x5'));var Redis=require(_0x585b('0x6'));config[_0x585b('0x7')]=_['defaults'](config[_0x585b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x585b('0x8'))(new Redis(config[_0x585b('0x7')]));var Schema=require(_0x585b('0x9'));var originateValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x585b('0xb'),'required':[!![],_0x585b('0xc')]},'callerId':{'type':_0x585b('0xb')},'callbackUrl':{'type':_0x585b('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],_0x585b('0xd')]},'sessionId':{'type':_0x585b('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x585b('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x585b('0xb'),'required':[!![],_0x585b('0xe')]},'transferNumber':{'type':_0x585b('0xb'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],_0x585b('0xd')]},'sessionId':{'type':_0x585b('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],_0x585b('0xd')]},'sessionId':{'type':_0x585b('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x585b('0xa'),'required':[!![],_0x585b('0xd')]}});function emit(_0x4c094e,_0x4e2a41,_0xd53614){logger['info'](_0x4c094e,_0x4e2a41,JSON['stringify'](_0xd53614));io['to'](_0x4c094e)[_0x585b('0xf')](_0x4e2a41,_0xd53614);}function handleError(_0x46a9b5){return function(_0x20c4ba){console['log'](_0x585b('0x10'),_0x20c4ba,_0x20c4ba instanceof RangeError);logger[_0x585b('0x11')](_0x20c4ba[_0x585b('0x12')]);if(_0x20c4ba instanceof RangeError){if(_0x20c4ba[_0x585b('0x13')]){delete _0x20c4ba['name'];}_0x46a9b5[_0x585b('0x14')](0x194)[_0x585b('0x15')](_0x20c4ba);}else{if(_0x20c4ba[_0x585b('0x13')]){delete _0x20c4ba['name'];}_0x46a9b5['status'](0x1f4)[_0x585b('0x15')](_0x20c4ba);}};}function checkError(){return function(_0x56d178){if(!_0x56d178){throw new RangeError('NotFound');}return _0x56d178;};}function respondWithRpcPromise(_0x29e033,_0xb8b33a){return new BPromise(function(_0x48d9f8,_0x183308){var _0x272a8d=amiClient;return _0x272a8d['request'](_0x29e033,_0xb8b33a)[_0x585b('0x16')](function(_0xe50751){if(_0xe50751[_0x585b('0x11')]){if(_0xe50751['error'][_0x585b('0x17')]===0x1f4){return _0x183308(_0xe50751['error'][_0x585b('0x18')]);}return _0x48d9f8(_0xe50751[_0x585b('0x11')][_0x585b('0x18')]);}else{_0x48d9f8(_0xe50751[_0x585b('0x19')]);}})[_0x585b('0x1a')](function(_0x1b1241){_0x183308(_0x1b1241);});});}function getAgent(_0xd6bf9b){return db[_0x585b('0x1b')][_0x585b('0x1c')]({'where':{'id':_0xd6bf9b,'role':_0x585b('0x1d')}})[_0x585b('0x16')](checkError());}function getAgentCheckSession(_0x35075c,_0x11dc56){return new BPromise(function(_0x476ed9,_0x183e75){var _0x554099=respondWithRpcPromise(_0x585b('0x1e'));var _0x205ffe=getAgent(_0x35075c);Promise[_0x585b('0x1f')]([_0x554099,_0x205ffe])[_0x585b('0x16')](function(_0x5dad9a){var _0x4e9fc8=_0x5dad9a[0x0];var _0xedf913=_0x5dad9a[0x1];var _0x29b168=_['filter'](_0x4e9fc8[_0x585b('0x20')],function(_0x112fb5){return _0x112fb5['UserId']==_0xedf913['id']&&_0x112fb5[_0x585b('0x21')]==_0x11dc56;});if(_0x29b168[_0x585b('0x22')]==0x1){_0x476ed9(_0xedf913);}else{_0x183e75(new RangeError(_0x585b('0x23')+_0x11dc56+_0x585b('0x24')));}});});}exports[_0x585b('0x25')]=function(_0x3d1433,_0x227149){logger[_0x585b('0x26')](_0x585b('0x27'),_0x3d1433[_0x585b('0x28')]);var _0x4d763c=originateValidation[_0x585b('0x9')](_0x3d1433[_0x585b('0x28')]);if(_0x4d763c[_0x585b('0x22')]>0x0){return _0x227149['status'](0x190)[_0x585b('0x29')](_0x4d763c);}var _0x65cefc=_0x3d1433[_0x585b('0x28')]['userId'];var _0x31c42c=_0x3d1433[_0x585b('0x28')][_0x585b('0x2a')];var _0x7d4cc3=_0x3d1433['body']['callerId'];var _0xa29269=_0x3d1433[_0x585b('0x28')][_0x585b('0x2b')];return getAgent(_0x65cefc)[_0x585b('0x16')](function(_0x179502){logger['info'](_0x585b('0x2c'),_0x179502[_0x585b('0x13')]);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x179502[_0x585b('0x13')]),'webbar:originate',{'callNumber':_0x31c42c,'callerId':_0x7d4cc3,'callbackUrl':_0xa29269});return _0x227149['status'](0xc8)['json']({'error':![],'message':_0x585b('0x2f')});})[_0x585b('0x1a')](handleError(_0x227149));};exports[_0x585b('0x30')]=function(_0x8ecc5f,_0x3e6943){logger[_0x585b('0x26')](_0x585b('0x31'),_0x8ecc5f[_0x585b('0x28')]);var _0x6cec28=hangupValidation['validate'](_0x8ecc5f[_0x585b('0x28')]);if(_0x6cec28[_0x585b('0x22')]>0x0){return _0x3e6943['status'](0x190)[_0x585b('0x29')](_0x6cec28);}var _0x3bf1bd=_0x8ecc5f[_0x585b('0x28')][_0x585b('0x32')];var _0xc82017=_0x8ecc5f[_0x585b('0x28')]['sessionId'];return getAgent(_0x3bf1bd)[_0x585b('0x16')](function(_0x3c10b2){logger[_0x585b('0x26')](_0x585b('0x2c'),_0x3c10b2[_0x585b('0x13')]);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x3c10b2[_0x585b('0x13')]),'webbar:hangup',{'sessionId':_0xc82017});return _0x3e6943[_0x585b('0x14')](0xc8)[_0x585b('0x29')]({'error':![],'message':_0x585b('0x33')});})['catch'](handleError(_0x3e6943));};exports[_0x585b('0x34')]=function(_0x698a0f,_0x2b6b1b){logger['info'](_0x585b('0x35'),_0x698a0f[_0x585b('0x28')]);var _0x5112f5=answerValidation['validate'](_0x698a0f[_0x585b('0x28')]);if(_0x5112f5['length']>0x0){return _0x2b6b1b[_0x585b('0x14')](0x190)['json'](_0x5112f5);}var _0x207d79=_0x698a0f[_0x585b('0x28')]['userId'];var _0xa26652=_0x698a0f['body']['sessionId'];return getAgent(_0x207d79)['then'](function(_0x2d07e4){logger['info'](_0x585b('0x2c'),_0x2d07e4[_0x585b('0x13')]);emit(util['format'](_0x585b('0x2e'),_0x2d07e4[_0x585b('0x13')]),_0x585b('0x36'),{'sessionId':_0xa26652});return _0x2b6b1b['status'](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x585b('0x1a')](handleError(_0x2b6b1b));};exports[_0x585b('0x37')]=function(_0xa008dc,_0xceec5f){logger['info'](_0x585b('0x38'),_0xa008dc[_0x585b('0x28')]);var _0x30bf1c=holdValidation[_0x585b('0x9')](_0xa008dc['body']);if(_0x30bf1c[_0x585b('0x22')]>0x0){return _0xceec5f[_0x585b('0x14')](0x190)[_0x585b('0x29')](_0x30bf1c);}var _0x5bf8b4=_0xa008dc[_0x585b('0x28')]['userId'];var _0x492f3f=_0xa008dc['body'][_0x585b('0x21')];return getAgent(_0x5bf8b4)['then'](function(_0x1f8ae0){logger['info']('entityFound:',_0x1f8ae0['name']);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x1f8ae0['name']),'webbar:hold',{'sessionId':_0x492f3f});return _0xceec5f[_0x585b('0x14')](0xc8)[_0x585b('0x29')]({'error':![],'message':_0x585b('0x39')});})['catch'](handleError(_0xceec5f));};exports[_0x585b('0x3a')]=function(_0x4ca120,_0x44234e){logger['info'](_0x585b('0x3b'),_0x4ca120['body']);var _0x3b96db=unholdValidation['validate'](_0x4ca120[_0x585b('0x28')]);if(_0x3b96db[_0x585b('0x22')]>0x0){return _0x44234e[_0x585b('0x14')](0x190)[_0x585b('0x29')](_0x3b96db);}var _0x2c5e45=_0x4ca120['body'][_0x585b('0x32')];var _0x2ef157=_0x4ca120[_0x585b('0x28')][_0x585b('0x21')];return getAgent(_0x2c5e45)[_0x585b('0x16')](function(_0x349a8f){logger['info'](_0x585b('0x2c'),_0x349a8f[_0x585b('0x13')]);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x349a8f['name']),_0x585b('0x3c'),{'sessionId':_0x2ef157});return _0x44234e[_0x585b('0x14')](0xc8)[_0x585b('0x29')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x44234e));};exports['calls']=function(_0x593c52,_0x4b4756){logger['info'](_0x585b('0x3d'),_0x4b4756[_0x585b('0x28')]);var _0x102733=callsValidation['validate'](_0x593c52[_0x585b('0x28')]);if(_0x102733[_0x585b('0x22')]>0x0){return _0x4b4756[_0x585b('0x14')](0x190)[_0x585b('0x29')](_0x102733);}var _0x53387b=_0x593c52[_0x585b('0x28')][_0x585b('0x32')];var _0x45b325=respondWithRpcPromise(_0x585b('0x1e'));var _0xe4f07b=getAgent(_0x53387b);return Promise[_0x585b('0x1f')]([_0x45b325,_0xe4f07b])[_0x585b('0x16')](function(_0x55828f){var _0x35b841=_0x55828f[0x0];var _0x3c4ee5=_0x55828f[0x1];var _0x1cb07a=_[_0x585b('0x3e')](_0x35b841[_0x585b('0x20')],function(_0x3c8073){return _0x3c8073[_0x585b('0x3f')]==_0x3c4ee5['id'];});return _0x4b4756[_0x585b('0x14')](0xc8)[_0x585b('0x29')]({'count':_0x1cb07a[_0x585b('0x22')],'rows':_0x1cb07a});})[_0x585b('0x1a')](handleError(_0x4b4756));};exports[_0x585b('0x40')]=function(_0x305064,_0x212d51){logger['info'](_0x585b('0x41'),_0x305064['body']);var _0x26c157=conferenceValidation[_0x585b('0x9')](_0x305064['body']);if(_0x26c157[_0x585b('0x22')]>0x0){return _0x212d51[_0x585b('0x14')](0x190)['json'](_0x26c157);}var _0x58d087=_0x305064['body']['userId'];return getAgent(_0x58d087)['then'](function(_0x477cfb){logger['info'](_0x585b('0x2c'),_0x477cfb[_0x585b('0x13')]);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x477cfb[_0x585b('0x13')]),_0x585b('0x42'));return _0x212d51['status'](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x585b('0x1a')](handleError(_0x212d51));};exports[_0x585b('0x43')]=function(_0x42e155,_0x117a66){logger[_0x585b('0x26')]('transfer\x20fired:',_0x42e155[_0x585b('0x28')]);var _0x14f0bd=transferValidation[_0x585b('0x9')](_0x42e155[_0x585b('0x28')]);if(_0x14f0bd[_0x585b('0x22')]>0x0){return _0x117a66['status'](0x190)[_0x585b('0x29')](_0x14f0bd);}var _0x35ca81=_0x42e155[_0x585b('0x28')][_0x585b('0x32')];var _0x1efdaa=_0x42e155['body'][_0x585b('0x21')];var _0x219ca8=_0x42e155[_0x585b('0x28')][_0x585b('0x44')];return getAgent(_0x35ca81)['then'](function(_0x3f7717){logger[_0x585b('0x26')](_0x585b('0x2c'),_0x3f7717[_0x585b('0x13')]);emit(util[_0x585b('0x2d')](_0x585b('0x2e'),_0x3f7717['name']),_0x585b('0x45'),{'sessionId':_0x1efdaa,'transferNumber':_0x219ca8});return _0x117a66[_0x585b('0x14')](0xc8)[_0x585b('0x29')]({'error':![],'message':_0x585b('0x46')});})[_0x585b('0x1a')](handleError(_0x117a66));}; \ No newline at end of file +var _0xa75b=['handleError:','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','string','number','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','log'];(function(_0x49876e,_0x52dfde){var _0x33f4d4=function(_0x42c022){while(--_0x42c022){_0x49876e['push'](_0x49876e['shift']());}};_0x33f4d4(++_0x52dfde);}(_0xa75b,0x170));var _0xba75=function(_0x3f508b,_0x415b89){_0x3f508b=_0x3f508b-0x0;var _0x57aa3d=_0xa75b[_0x3f508b];return _0x57aa3d;};'use strict';var path=require(_0xba75('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xba75('0x1'));var util=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var jayson=require(_0xba75('0x4'));var amiClient=jayson[_0xba75('0x5')][_0xba75('0x6')]({'port':0x232a});var logger=require(_0xba75('0x7'))(_0xba75('0x8'));var Redis=require(_0xba75('0x9'));config[_0xba75('0xa')]=_[_0xba75('0xb')](config[_0xba75('0xa')],{'host':_0xba75('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xba75('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xba75('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xba75('0xe')},'callbackUrl':{'type':_0xba75('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':[!![],_0xba75('0x11')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xba75('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]}});function emit(_0x4028f9,_0x41c9e5,_0x51112b){logger[_0xba75('0x12')](_0x4028f9,_0x41c9e5,JSON[_0xba75('0x13')](_0x51112b));io['to'](_0x4028f9)[_0xba75('0x14')](_0x41c9e5,_0x51112b);}function handleError(_0x47be93){return function(_0x2822af){console[_0xba75('0x15')](_0xba75('0x16'),_0x2822af,_0x2822af instanceof RangeError);logger[_0xba75('0x17')](_0x2822af[_0xba75('0x18')]);if(_0x2822af instanceof RangeError){if(_0x2822af[_0xba75('0x19')]){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x194)[_0xba75('0x1b')](_0x2822af);}else{if(_0x2822af['name']){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x1f4)[_0xba75('0x1b')](_0x2822af);}};}function checkError(){return function(_0x496cfc){if(!_0x496cfc){throw new RangeError('NotFound');}return _0x496cfc;};}function respondWithRpcPromise(_0x30f482,_0x4e79a9){return new BPromise(function(_0x1b8a36,_0x2ece41){var _0x19b2d7=amiClient;return _0x19b2d7['request'](_0x30f482,_0x4e79a9)[_0xba75('0x1c')](function(_0x221d5e){if(_0x221d5e[_0xba75('0x17')]){if(_0x221d5e[_0xba75('0x17')][_0xba75('0x1d')]===0x1f4){return _0x2ece41(_0x221d5e[_0xba75('0x17')]['message']);}return _0x1b8a36(_0x221d5e[_0xba75('0x17')][_0xba75('0x1e')]);}else{_0x1b8a36(_0x221d5e[_0xba75('0x1f')]);}})[_0xba75('0x20')](function(_0x1caa6){_0x2ece41(_0x1caa6);});});}function getAgent(_0x44b1d4){return db[_0xba75('0x21')][_0xba75('0x22')]({'where':{'id':_0x44b1d4,'role':_0xba75('0x23')}})[_0xba75('0x1c')](checkError());}function getAgentCheckSession(_0x47ddff,_0x4c8d02){return new BPromise(function(_0x4e1987,_0x240522){var _0x4856be=respondWithRpcPromise(_0xba75('0x24'));var _0x58ea2d=getAgent(_0x47ddff);Promise[_0xba75('0x25')]([_0x4856be,_0x58ea2d])[_0xba75('0x1c')](function(_0x20ac78){var _0x4edc2e=_0x20ac78[0x0];var _0x3a1fd3=_0x20ac78[0x1];var _0x62cf49=_[_0xba75('0x26')](_0x4edc2e[_0xba75('0x27')],function(_0x5d9f78){return _0x5d9f78['UserId']==_0x3a1fd3['id']&&_0x5d9f78[_0xba75('0x28')]==_0x4c8d02;});if(_0x62cf49['length']==0x1){_0x4e1987(_0x3a1fd3);}else{_0x240522(new RangeError(_0xba75('0x29')+_0x4c8d02+_0xba75('0x2a')));}});});}exports[_0xba75('0x2b')]=function(_0x32166a,_0x4b4d69){logger[_0xba75('0x12')](_0xba75('0x2c'),_0x32166a['body']);var _0x33a732=originateValidation[_0xba75('0xd')](_0x32166a[_0xba75('0x2d')]);if(_0x33a732[_0xba75('0x2e')]>0x0){return _0x4b4d69['status'](0x190)[_0xba75('0x2f')](_0x33a732);}var _0x3a1610=_0x32166a['body'][_0xba75('0x30')];var _0x6ea4fc=_0x32166a[_0xba75('0x2d')]['callNumber'];var _0x29334a=_0x32166a[_0xba75('0x2d')][_0xba75('0x31')];var _0x381cb=_0x32166a[_0xba75('0x2d')][_0xba75('0x32')];return getAgent(_0x3a1610)[_0xba75('0x1c')](function(_0x4c9fb2){logger['info'](_0xba75('0x33'),_0x4c9fb2[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x4c9fb2[_0xba75('0x19')]),_0xba75('0x35'),{'callNumber':_0x6ea4fc,'callerId':_0x29334a,'callbackUrl':_0x381cb});return _0x4b4d69['status'](0xc8)['json']({'error':![],'message':_0xba75('0x36')});})[_0xba75('0x20')](handleError(_0x4b4d69));};exports[_0xba75('0x37')]=function(_0x1243e8,_0x92882d){logger['info']('hangup\x20fired:',_0x1243e8[_0xba75('0x2d')]);var _0x22b335=hangupValidation[_0xba75('0xd')](_0x1243e8[_0xba75('0x2d')]);if(_0x22b335[_0xba75('0x2e')]>0x0){return _0x92882d[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x22b335);}var _0x5dad31=_0x1243e8[_0xba75('0x2d')][_0xba75('0x30')];var _0x5bec5f=_0x1243e8[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x5dad31)[_0xba75('0x1c')](function(_0x45d8cd){logger[_0xba75('0x12')](_0xba75('0x33'),_0x45d8cd[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x45d8cd['name']),_0xba75('0x39'),{'sessionId':_0x5bec5f});return _0x92882d['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x3a')});})[_0xba75('0x20')](handleError(_0x92882d));};exports[_0xba75('0x3b')]=function(_0x24d80b,_0x30338c){logger[_0xba75('0x12')](_0xba75('0x3c'),_0x24d80b[_0xba75('0x2d')]);var _0x5c7c7f=answerValidation[_0xba75('0xd')](_0x24d80b[_0xba75('0x2d')]);if(_0x5c7c7f['length']>0x0){return _0x30338c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x5c7c7f);}var _0x1130ac=_0x24d80b['body']['userId'];var _0x5c6491=_0x24d80b['body'][_0xba75('0x28')];return getAgent(_0x1130ac)['then'](function(_0x46e9b9){logger[_0xba75('0x12')](_0xba75('0x33'),_0x46e9b9[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x46e9b9['name']),_0xba75('0x3d'),{'sessionId':_0x5c6491});return _0x30338c['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0xba75('0x20')](handleError(_0x30338c));};exports[_0xba75('0x3e')]=function(_0x22e5b4,_0x3983dc){logger['info'](_0xba75('0x3f'),_0x22e5b4[_0xba75('0x2d')]);var _0x254dc7=holdValidation[_0xba75('0xd')](_0x22e5b4[_0xba75('0x2d')]);if(_0x254dc7[_0xba75('0x2e')]>0x0){return _0x3983dc[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x254dc7);}var _0x51cd22=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x30')];var _0x7c297b=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x51cd22)['then'](function(_0x2a1f84){logger[_0xba75('0x12')](_0xba75('0x33'),_0x2a1f84[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0x2a1f84[_0xba75('0x19')]),'webbar:hold',{'sessionId':_0x7c297b});return _0x3983dc[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x40')});})['catch'](handleError(_0x3983dc));};exports[_0xba75('0x41')]=function(_0x29b4fc,_0x559f6f){logger['info'](_0xba75('0x42'),_0x29b4fc['body']);var _0x49a4df=unholdValidation[_0xba75('0xd')](_0x29b4fc['body']);if(_0x49a4df[_0xba75('0x2e')]>0x0){return _0x559f6f[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x49a4df);}var _0x70474=_0x29b4fc[_0xba75('0x2d')]['userId'];var _0xfa79e6=_0x29b4fc[_0xba75('0x2d')]['sessionId'];return getAgent(_0x70474)[_0xba75('0x1c')](function(_0x19a08f){logger[_0xba75('0x12')](_0xba75('0x33'),_0x19a08f[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x19a08f[_0xba75('0x19')]),'webbar:unhold',{'sessionId':_0xfa79e6});return _0x559f6f[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x43')});})[_0xba75('0x20')](handleError(_0x559f6f));};exports[_0xba75('0x44')]=function(_0x3b6490,_0x49fb61){logger[_0xba75('0x12')](_0xba75('0x45'),_0x49fb61[_0xba75('0x2d')]);var _0x429e26=callsValidation[_0xba75('0xd')](_0x3b6490[_0xba75('0x2d')]);if(_0x429e26['length']>0x0){return _0x49fb61['status'](0x190)['json'](_0x429e26);}var _0x4cda26=_0x3b6490[_0xba75('0x2d')][_0xba75('0x30')];var _0x2991e5=respondWithRpcPromise(_0xba75('0x24'));var _0x3716c6=getAgent(_0x4cda26);return Promise[_0xba75('0x25')]([_0x2991e5,_0x3716c6])[_0xba75('0x1c')](function(_0x5cfedd){var _0x1c4707=_0x5cfedd[0x0];var _0x1e7500=_0x5cfedd[0x1];var _0x287f30=_[_0xba75('0x26')](_0x1c4707['rows'],function(_0xb7b3a4){return _0xb7b3a4[_0xba75('0x46')]==_0x1e7500['id'];});return _0x49fb61['status'](0xc8)[_0xba75('0x2f')]({'count':_0x287f30['length'],'rows':_0x287f30});})[_0xba75('0x20')](handleError(_0x49fb61));};exports[_0xba75('0x47')]=function(_0x57eceb,_0x276757){logger[_0xba75('0x12')]('conference\x20fired:',_0x57eceb['body']);var _0x3d9420=conferenceValidation['validate'](_0x57eceb[_0xba75('0x2d')]);if(_0x3d9420['length']>0x0){return _0x276757[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x3d9420);}var _0x46c43c=_0x57eceb[_0xba75('0x2d')][_0xba75('0x30')];return getAgent(_0x46c43c)['then'](function(_0xf02890){logger[_0xba75('0x12')]('entityFound:',_0xf02890[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0xf02890[_0xba75('0x19')]),_0xba75('0x48'));return _0x276757[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x49')});})[_0xba75('0x20')](handleError(_0x276757));};exports[_0xba75('0x4a')]=function(_0xa0a92,_0x9da35c){logger['info']('transfer\x20fired:',_0xa0a92[_0xba75('0x2d')]);var _0x31e3b6=transferValidation[_0xba75('0xd')](_0xa0a92[_0xba75('0x2d')]);if(_0x31e3b6[_0xba75('0x2e')]>0x0){return _0x9da35c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x31e3b6);}var _0x115798=_0xa0a92[_0xba75('0x2d')][_0xba75('0x30')];var _0x2b686e=_0xa0a92['body'][_0xba75('0x28')];var _0x5c1e1d=_0xa0a92[_0xba75('0x2d')][_0xba75('0x4b')];return getAgent(_0x115798)[_0xba75('0x1c')](function(_0x43b73b){logger[_0xba75('0x12')](_0xba75('0x33'),_0x43b73b['name']);emit(util[_0xba75('0x34')]('user:%s',_0x43b73b[_0xba75('0x19')]),_0xba75('0x4c'),{'sessionId':_0x2b686e,'transferNumber':_0x5c1e1d});return _0x9da35c['status'](0xc8)['json']({'error':![],'message':_0xba75('0x4d')});})[_0xba75('0x20')](handleError(_0x9da35c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 5850d85..a6f06a3 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 _0x90ba=['../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','send','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x90ba,0x147));var _0xa90b=function(_0x17e356,_0x42c4f0){_0x17e356=_0x17e356-0x0;var _0x2edf87=_0x90ba[_0x17e356];return _0x2edf87;};'use strict';var multer=require(_0xa90b('0x0'));var util=require(_0xa90b('0x1'));var path=require(_0xa90b('0x2'));var timeout=require(_0xa90b('0x3'));var express=require(_0xa90b('0x4'));var router=express[_0xa90b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa90b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa90b('0x7'));var controller=require(_0xa90b('0x8'));router[_0xa90b('0x9')]('/',auth[_0xa90b('0xa')](),controller[_0xa90b('0xb')]);router[_0xa90b('0x9')](_0xa90b('0xc'),auth[_0xa90b('0xa')](),controller['describe']);router[_0xa90b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xa90b('0xd'),auth[_0xa90b('0xa')](),controller[_0xa90b('0xe')]);router[_0xa90b('0x9')](_0xa90b('0xf'),auth['isAuthenticated'](),controller[_0xa90b('0x10')]);router[_0xa90b('0x9')](_0xa90b('0x11'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x12')]);router['get'](_0xa90b('0x13'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x14')]);router[_0xa90b('0x15')]('/',auth[_0xa90b('0xa')](),controller['create']);router[_0xa90b('0x15')](_0xa90b('0xd'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x16')]);router[_0xa90b('0x15')](_0xa90b('0xf'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x17')]);router['post'](_0xa90b('0x11'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x18')]);router[_0xa90b('0x15')](_0xa90b('0x13'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x19')]);router[_0xa90b('0x15')](_0xa90b('0x1a'),controller[_0xa90b('0x1b')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xa90b('0x1c')]);router['put'](_0xa90b('0x1d'),auth['isAuthenticated'](),controller[_0xa90b('0x1e')]);router[_0xa90b('0x1f')](_0xa90b('0x1d'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x20')]);router[_0xa90b('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa90b('0x21')]);router[_0xa90b('0x1f')](_0xa90b('0xf'),auth[_0xa90b('0xa')](),controller[_0xa90b('0x22')]);router[_0xa90b('0x1f')](_0xa90b('0x11'),auth['isAuthenticated'](),controller[_0xa90b('0x23')]);module[_0xa90b('0x24')]=router; \ No newline at end of file +var _0xd212=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','create','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify','notify','send','/:id','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x2a5447,_0x3780e6){var _0x186508=function(_0x68e312){while(--_0x68e312){_0x2a5447['push'](_0x2a5447['shift']());}};_0x186508(++_0x3780e6);}(_0xd212,0xfb));var _0x2d21=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xd212[_0x25d386];return _0x857f4a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d21('0x0'));var timeout=require('connect-timeout');var express=require(_0x2d21('0x1'));var router=express[_0x2d21('0x2')]();var fs_extra=require(_0x2d21('0x3'));var auth=require(_0x2d21('0x4'));var interaction=require(_0x2d21('0x5'));var config=require('../../config/environment');var controller=require(_0x2d21('0x6'));router[_0x2d21('0x7')]('/',auth[_0x2d21('0x8')](),controller[_0x2d21('0x9')]);router[_0x2d21('0x7')](_0x2d21('0xa'),auth['isAuthenticated'](),controller[_0x2d21('0xb')]);router[_0x2d21('0x7')]('/:id',auth[_0x2d21('0x8')](),controller[_0x2d21('0xc')]);router[_0x2d21('0x7')](_0x2d21('0xd'),auth[_0x2d21('0x8')](),controller[_0x2d21('0xe')]);router[_0x2d21('0x7')](_0x2d21('0xf'),auth[_0x2d21('0x8')](),controller[_0x2d21('0x10')]);router[_0x2d21('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x2d21('0x11')]);router[_0x2d21('0x7')](_0x2d21('0x12'),auth[_0x2d21('0x8')](),controller['getApplications']);router['post']('/',auth['isAuthenticated'](),controller[_0x2d21('0x13')]);router[_0x2d21('0x14')](_0x2d21('0xd'),auth[_0x2d21('0x8')](),controller[_0x2d21('0x15')]);router[_0x2d21('0x14')]('/:id/canned_answers',auth[_0x2d21('0x8')](),controller['addAnswer']);router[_0x2d21('0x14')](_0x2d21('0x16'),auth[_0x2d21('0x8')](),controller[_0x2d21('0x17')]);router[_0x2d21('0x14')]('/:id/applications',auth['isAuthenticated'](),controller[_0x2d21('0x18')]);router['post'](_0x2d21('0x19'),controller[_0x2d21('0x1a')]);router[_0x2d21('0x14')]('/:id/send',auth[_0x2d21('0x8')](),controller[_0x2d21('0x1b')]);router['put'](_0x2d21('0x1c'),auth[_0x2d21('0x8')](),controller[_0x2d21('0x1d')]);router[_0x2d21('0x1e')](_0x2d21('0x1c'),auth[_0x2d21('0x8')](),controller[_0x2d21('0x1f')]);router[_0x2d21('0x1e')](_0x2d21('0xd'),auth[_0x2d21('0x8')](),controller['removeDispositions']);router[_0x2d21('0x1e')](_0x2d21('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x2d21('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 902e61e..f027a1d 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 _0x325e=['STRING','name','generate','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0xad8706,_0x3f7662){var _0x4d1d6c=function(_0x3f5ad7){while(--_0x3f5ad7){_0xad8706['push'](_0xad8706['shift']());}};_0x4d1d6c(++_0x3f7662);}(_0x325e,0xc1));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe325('0x0'));var rs=require(_0xe325('0x1'));module['exports']={'name':{'type':Sequelize[_0xe325('0x2')],'unique':_0xe325('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xe325('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xe325('0x2')],'defaultValue':function(){return rs[_0xe325('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0xe325('0x5'))},'accountSid':{'type':Sequelize[_0xe325('0x2')]},'baseUrl':{'type':Sequelize[_0xe325('0x2')]},'authToken':{'type':Sequelize[_0xe325('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe325('0x6')],'defaultValue':function(){return _0xe325('0x7');}},'notificationSound':{'type':Sequelize[_0xe325('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe325('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe325('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe325('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe325('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe325('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe325('0x9')],'comment':_0xe325('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe325('0x8')],'defaultValue':![],'comment':_0xe325('0xb'),'set':function(_0x3217e4){if(!_0x3217e4){this[_0xe325('0xc')](_0xe325('0xd'),null);}this[_0xe325('0xc')](_0xe325('0xe'),_0x3217e4);}},'description':{'type':Sequelize[_0xe325('0x2')]}}; \ No newline at end of file +var _0x2cff=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','sinch','TEXT'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x2cff,0xa7));var _0xf2cf=function(_0x554651,_0x33b329){_0x554651=_0x554651-0x0;var _0x53fb5a=_0x2cff[_0x554651];return _0x53fb5a;};'use strict';var Sequelize=require(_0xf2cf('0x0'));var rs=require(_0xf2cf('0x1'));module[_0xf2cf('0x2')]={'name':{'type':Sequelize[_0xf2cf('0x3')],'unique':_0xf2cf('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xf2cf('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xf2cf('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xf2cf('0x3')],'defaultValue':function(){return rs[_0xf2cf('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xf2cf('0x6'),_0xf2cf('0x7'))},'accountSid':{'type':Sequelize[_0xf2cf('0x3')]},'baseUrl':{'type':Sequelize[_0xf2cf('0x3')]},'authToken':{'type':Sequelize[_0xf2cf('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf2cf('0x8')],'defaultValue':function(){return _0xf2cf('0x9');}},'notificationSound':{'type':Sequelize[_0xf2cf('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf2cf('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf2cf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf2cf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf2cf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf2cf('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf2cf('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf2cf('0xb')],'comment':_0xf2cf('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xf2cf('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xde0271){if(!_0xde0271){this[_0xf2cf('0xd')](_0xf2cf('0xe'),null);}this[_0xf2cf('0xd')](_0xf2cf('0xf'),_0xde0271);}},'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 1d7b49e..f746a47 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 _0x1902=['model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','pick','WhatsappAccountId','rows','removeDispositions','addAnswer','CannedAnswer','findOne','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','timestamp','message_id','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','notifications','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','applications','close','unmanaged','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key'];(function(_0x3d74d5,_0xcea1ed){var _0x408ad9=function(_0xdbc83b){while(--_0xdbc83b){_0x3d74d5['push'](_0x3d74d5['shift']());}};_0x408ad9(++_0xcea1ed);}(_0x1902,0x83));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2190('0x0'));var rimraf=require(_0x2190('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2190('0x2'));var rp=require(_0x2190('0x3'));var moment=require(_0x2190('0x4'));var BPromise=require(_0x2190('0x5'));var Mustache=require(_0x2190('0x6'));var util=require(_0x2190('0x7'));var path=require(_0x2190('0x8'));var sox=require('sox');var csv=require(_0x2190('0x9'));var ejs=require(_0x2190('0xa'));var fs=require('fs');var fs_extra=require(_0x2190('0xb'));var _=require(_0x2190('0xc'));var squel=require(_0x2190('0xd'));var crypto=require('crypto');var jsforce=require(_0x2190('0xe'));var deskjs=require(_0x2190('0xf'));var toCsv=require(_0x2190('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2190('0x10'));var authService=require(_0x2190('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2190('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2190('0x13'))('api');var utils=require(_0x2190('0x14'));var config=require(_0x2190('0x15'));var licenseUtil=require(_0x2190('0x16'));var db=require(_0x2190('0x17'))['db'];config[_0x2190('0x18')]=_[_0x2190('0x19')](config[_0x2190('0x18')],{'host':_0x2190('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x2190('0x1b')](socket);var jayson=require(_0x2190('0x1c'));var client=jayson[_0x2190('0x1d')][_0x2190('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5c6880,_0x22519f,_0x340cf3,_0x2dc7ce){return new BPromise(function(_0x23dd69,_0x632c77){var _0x553ae0=_0x2dc7ce||client;return _0x553ae0[_0x2190('0x1f')](_0x5c6880,_0x340cf3)[_0x2190('0x20')](function(_0x47e3c0){logger[_0x2190('0x21')](_0x2190('0x22'),_0x22519f,'request\x20sent');logger['debug'](_0x2190('0x23'),_0x22519f,'request\x20sent',JSON[_0x2190('0x24')](_0x47e3c0));if(_0x47e3c0['error']){if(_0x47e3c0[_0x2190('0x25')]['code']===0x1f4){logger['error'](_0x2190('0x22'),_0x22519f,_0x47e3c0[_0x2190('0x25')][_0x2190('0x26')]);return _0x632c77(_0x47e3c0[_0x2190('0x25')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x22519f,_0x47e3c0[_0x2190('0x25')][_0x2190('0x26')]);return _0x23dd69(_0x47e3c0[_0x2190('0x25')][_0x2190('0x26')]);}else{logger[_0x2190('0x21')](_0x2190('0x22'),_0x22519f,_0x2190('0x27'));_0x23dd69(_0x47e3c0[_0x2190('0x28')][_0x2190('0x26')]);}})[_0x2190('0x29')](function(_0x197a8b){logger[_0x2190('0x25')](_0x2190('0x22'),_0x22519f,_0x197a8b);_0x632c77(_0x197a8b);});});}function respondWithStatusCode(_0x1e3e00,_0x40ae20){_0x40ae20=_0x40ae20||0xcc;return function(_0x19fc77){if(_0x19fc77){return _0x1e3e00[_0x2190('0x2a')](_0x40ae20);}return _0x1e3e00['status'](_0x40ae20)['end']();};}function respondWithResult(_0x85621f,_0x1f2f41){_0x1f2f41=_0x1f2f41||0xc8;return function(_0x52e868){if(_0x52e868){return _0x85621f[_0x2190('0x2b')](_0x1f2f41)[_0x2190('0x2c')](_0x52e868);}};}function respondWithFilteredResult(_0x236392,_0x23e672){return function(_0x11259e){if(_0x11259e){var _0x1cafd0=typeof _0x23e672['offset']===_0x2190('0x2d')&&typeof _0x23e672[_0x2190('0x2e')]===_0x2190('0x2d');var _0x575d75=_0x11259e[_0x2190('0x2f')];var _0x459460=_0x1cafd0?0x0:_0x23e672[_0x2190('0x30')];var _0x52d558=_0x1cafd0?_0x11259e[_0x2190('0x2f')]:_0x23e672['offset']+_0x23e672['limit'];var _0x349bdd;if(_0x52d558>=_0x575d75){_0x52d558=_0x575d75;_0x349bdd=0xc8;}else{_0x349bdd=0xce;}_0x236392[_0x2190('0x2b')](_0x349bdd);return _0x236392['set']('Content-Range',_0x459460+'-'+_0x52d558+'/'+_0x575d75)[_0x2190('0x2c')](_0x11259e);}return null;};}function patchUpdates(_0xe36f31){return function(_0x467f9c){try{jsonpatch[_0x2190('0x31')](_0x467f9c,_0xe36f31,!![]);}catch(_0x531a74){return BPromise[_0x2190('0x32')](_0x531a74);}return _0x467f9c[_0x2190('0x33')]();};}function saveUpdates(_0x2607e4,_0x5d27f0){return function(_0x45e348){if(_0x45e348){return _0x45e348[_0x2190('0x34')](_0x2607e4)[_0x2190('0x20')](function(_0x3853d0){return _0x3853d0;});}return null;};}function removeEntity(_0x1a7bb7,_0x3e298c){return function(_0x37f378){if(_0x37f378){return _0x37f378[_0x2190('0x35')]()[_0x2190('0x20')](function(){var _0x34b896=_0x37f378[_0x2190('0x36')]({'plain':!![]});var _0x137b0e=_0x2190('0x37');return db[_0x2190('0x38')][_0x2190('0x35')]({'where':{'type':_0x137b0e,'resourceId':_0x34b896['id']}})['then'](function(){return _0x37f378;});})['then'](function(){_0x1a7bb7['status'](0xcc)[_0x2190('0x39')]();});}};}function handleEntityNotFound(_0x489f4c,_0x1e7e2d){return function(_0x289e9e){if(!_0x289e9e){_0x489f4c[_0x2190('0x2a')](0x194);}return _0x289e9e;};}function handleError(_0x3f7ef8,_0x43fd2f){_0x43fd2f=_0x43fd2f||0x1f4;return function(_0x3379f1){logger[_0x2190('0x25')](_0x3379f1[_0x2190('0x3a')]);if(_0x3379f1[_0x2190('0x3b')]){delete _0x3379f1[_0x2190('0x3b')];}_0x3f7ef8[_0x2190('0x2b')](_0x43fd2f)[_0x2190('0x3c')](_0x3379f1);};}exports['index']=function(_0x5bb9b9,_0x550c62){var _0x73f7c0={'include':[{'model':db[_0x2190('0x3d')],'as':_0x2190('0x3e')}]},_0x286ea4={},_0x5e0c76={'count':0x0,'rows':[]};var _0x31eb98=_[_0x2190('0x3f')](db[_0x2190('0x40')][_0x2190('0x41')],function(_0x25bbc3){return{'name':_0x25bbc3['fieldName'],'type':_0x25bbc3[_0x2190('0x42')][_0x2190('0x43')]};});_0x286ea4[_0x2190('0x44')]=_[_0x2190('0x3f')](_0x31eb98,'name');_0x286ea4[_0x2190('0x45')]=_[_0x2190('0x46')](_0x5bb9b9[_0x2190('0x45')]);_0x286ea4['filters']=_[_0x2190('0x47')](_0x286ea4['model'],_0x286ea4[_0x2190('0x45')]);_0x73f7c0['attributes']=_[_0x2190('0x47')](_0x286ea4[_0x2190('0x44')],qs[_0x2190('0x48')](_0x5bb9b9['query'][_0x2190('0x48')]));_0x73f7c0[_0x2190('0x49')]=_0x73f7c0[_0x2190('0x49')]['length']?_0x73f7c0[_0x2190('0x49')]:_0x286ea4['model'];if(!_0x5bb9b9[_0x2190('0x45')][_0x2190('0x4a')](_0x2190('0x4b'))){_0x73f7c0[_0x2190('0x2e')]=qs[_0x2190('0x2e')](_0x5bb9b9[_0x2190('0x45')]['limit']);_0x73f7c0['offset']=qs[_0x2190('0x30')](_0x5bb9b9[_0x2190('0x45')][_0x2190('0x30')]);}_0x73f7c0[_0x2190('0x4c')]=qs[_0x2190('0x4d')](_0x5bb9b9[_0x2190('0x45')][_0x2190('0x4d')]);_0x73f7c0['where']=qs[_0x2190('0x4e')](_['pick'](_0x5bb9b9[_0x2190('0x45')],_0x286ea4[_0x2190('0x4e')]),_0x31eb98);if(_0x5bb9b9[_0x2190('0x45')][_0x2190('0x4f')]){_0x73f7c0[_0x2190('0x50')]=_[_0x2190('0x51')](_0x73f7c0[_0x2190('0x50')],{'$or':_[_0x2190('0x3f')](_0x31eb98,function(_0x26d8d0){if(_0x26d8d0[_0x2190('0x42')]!==_0x2190('0x52')){var _0x42de21={};_0x42de21[_0x26d8d0['name']]={'$like':'%'+_0x5bb9b9[_0x2190('0x45')]['filter']+'%'};return _0x42de21;}})});}_0x73f7c0=_[_0x2190('0x51')]({},_0x73f7c0,_0x5bb9b9['options']);var _0xa81101={'where':_0x73f7c0['where']};return db['WhatsappAccount']['count'](_0xa81101)[_0x2190('0x20')](function(_0x4a7596){_0x5e0c76[_0x2190('0x2f')]=_0x4a7596;if(_0x5bb9b9['query'][_0x2190('0x53')]){_0x73f7c0[_0x2190('0x54')]=[{'all':!![]}];}return db[_0x2190('0x40')][_0x2190('0x55')](_0x73f7c0);})[_0x2190('0x20')](function(_0x5a4202){_0x5e0c76['rows']=_0x5a4202;return _0x5e0c76;})[_0x2190('0x20')](respondWithFilteredResult(_0x550c62,_0x73f7c0))['catch'](handleError(_0x550c62,null));};exports[_0x2190('0x56')]=function(_0x2400c9,_0x24fd54){var _0x3da0dc={'raw':![],'where':{'id':_0x2400c9[_0x2190('0x57')]['id']},'include':[{'model':db[_0x2190('0x3d')],'as':_0x2190('0x3e')}]},_0x48d815={};_0x48d815[_0x2190('0x44')]=_['keys'](db[_0x2190('0x40')]['rawAttributes']);_0x48d815[_0x2190('0x45')]=_[_0x2190('0x46')](_0x2400c9[_0x2190('0x45')]);_0x48d815['filters']=_[_0x2190('0x47')](_0x48d815[_0x2190('0x44')],_0x48d815[_0x2190('0x45')]);_0x3da0dc[_0x2190('0x49')]=_[_0x2190('0x47')](_0x48d815['model'],qs[_0x2190('0x48')](_0x2400c9[_0x2190('0x45')][_0x2190('0x48')]));_0x3da0dc[_0x2190('0x49')]=_0x3da0dc['attributes'][_0x2190('0x58')]?_0x3da0dc['attributes']:_0x48d815[_0x2190('0x44')];if(_0x2400c9[_0x2190('0x45')][_0x2190('0x53')]){_0x3da0dc[_0x2190('0x54')]=[{'all':!![]}];}_0x3da0dc=_['merge']({},_0x3da0dc,_0x2400c9[_0x2190('0x59')]);return db[_0x2190('0x40')][_0x2190('0x5a')](_0x3da0dc)[_0x2190('0x20')](handleEntityNotFound(_0x24fd54,null))[_0x2190('0x20')](respondWithResult(_0x24fd54,null))[_0x2190('0x29')](handleError(_0x24fd54,null));};exports[_0x2190('0x5b')]=function(_0x43a3fa,_0x1c9190){return db[_0x2190('0x40')][_0x2190('0x5b')](_0x43a3fa[_0x2190('0x5c')],{})[_0x2190('0x20')](function(_0x5dce01){var _0x125df8=_0x43a3fa[_0x2190('0x5d')][_0x2190('0x36')]({'plain':!![]});if(!_0x125df8)throw new Error(_0x2190('0x5e'));if(_0x125df8[_0x2190('0x5f')]===_0x2190('0x5d')){var _0x4a9422=_0x5dce01[_0x2190('0x36')]({'plain':!![]});var _0x11439a=_0x2190('0x37');return db[_0x2190('0x60')][_0x2190('0x5a')]({'where':{'name':_0x11439a,'userProfileId':_0x125df8[_0x2190('0x61')]},'raw':!![]})['then'](function(_0x3e8835){if(_0x3e8835&&_0x3e8835[_0x2190('0x62')]===0x0){return db[_0x2190('0x38')][_0x2190('0x5b')]({'name':_0x4a9422[_0x2190('0x3b')],'resourceId':_0x4a9422['id'],'type':_0x3e8835['name'],'sectionId':_0x3e8835['id']},{})[_0x2190('0x20')](function(){return _0x5dce01;});}else{return _0x5dce01;}})[_0x2190('0x29')](function(_0xa3c586){logger[_0x2190('0x25')](_0x2190('0x63'),_0xa3c586);throw _0xa3c586;});}return _0x5dce01;})[_0x2190('0x20')](respondWithResult(_0x1c9190,0xc9))[_0x2190('0x29')](handleError(_0x1c9190,null));};exports['update']=function(_0x1f67c0,_0x23fc5c){if(_0x1f67c0[_0x2190('0x5c')]['id']){delete _0x1f67c0[_0x2190('0x5c')]['id'];}return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x1f67c0[_0x2190('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x2190('0x3e')}]})['then'](handleEntityNotFound(_0x23fc5c,null))[_0x2190('0x20')](saveUpdates(_0x1f67c0[_0x2190('0x5c')],null))['then'](respondWithResult(_0x23fc5c,null))[_0x2190('0x29')](handleError(_0x23fc5c,null));};exports['destroy']=function(_0x32b447,_0x3970e0){return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x32b447['params']['id']}})['then'](handleEntityNotFound(_0x3970e0,null))[_0x2190('0x20')](removeEntity(_0x3970e0,null))['catch'](handleError(_0x3970e0,null));};exports[_0x2190('0x64')]=function(_0xcacde4,_0x2c2704){return db[_0x2190('0x40')][_0x2190('0x64')]()[_0x2190('0x20')](respondWithResult(_0x2c2704,null))[_0x2190('0x29')](handleError(_0x2c2704,null));};exports[_0x2190('0x65')]=function(_0x1bc3c0,_0x18ab6b,_0x577e50){if(_0x1bc3c0[_0x2190('0x5c')]['id']){delete _0x1bc3c0[_0x2190('0x5c')]['id'];}return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x1bc3c0[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x18ab6b,null))['then'](function(_0x1a3691){if(_0x1a3691){_0x1bc3c0[_0x2190('0x5c')]['WhatsappAccountId']=_0x1a3691['id'];return db[_0x2190('0x66')][_0x2190('0x5b')](_0x1bc3c0[_0x2190('0x5c')]);}})[_0x2190('0x20')](respondWithResult(_0x18ab6b,null))[_0x2190('0x29')](handleError(_0x18ab6b,null));};exports[_0x2190('0x67')]=function(_0x2363ab,_0x542896,_0x1cbb0d){var _0x544221={'raw':![],'where':{}};var _0x14d81f={};var _0x36cf18={'count':0x0,'rows':[]};return db[_0x2190('0x40')]['findOne']({'where':{'id':_0x2363ab[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x542896,null))[_0x2190('0x20')](function(_0x24b7e4){if(_0x24b7e4){_0x14d81f['model']=_[_0x2190('0x46')](db[_0x2190('0x66')]['rawAttributes']);_0x14d81f['query']=_[_0x2190('0x46')](_0x2363ab[_0x2190('0x45')]);_0x14d81f[_0x2190('0x4e')]=_[_0x2190('0x47')](_0x14d81f['model'],_0x14d81f['query']);_0x544221['attributes']=_[_0x2190('0x47')](_0x14d81f['model'],qs['fields'](_0x2363ab[_0x2190('0x45')]['fields']));_0x544221['attributes']=_0x544221[_0x2190('0x49')][_0x2190('0x58')]?_0x544221['attributes']:_0x14d81f[_0x2190('0x44')];if(!_0x2363ab[_0x2190('0x45')][_0x2190('0x4a')](_0x2190('0x4b'))){_0x544221[_0x2190('0x2e')]=qs[_0x2190('0x2e')](_0x2363ab[_0x2190('0x45')][_0x2190('0x2e')]);_0x544221['offset']=qs[_0x2190('0x30')](_0x2363ab[_0x2190('0x45')][_0x2190('0x30')]);}_0x544221[_0x2190('0x4c')]=qs['sort'](_0x2363ab[_0x2190('0x45')]['sort']);_0x544221['where']=qs[_0x2190('0x4e')](_[_0x2190('0x68')](_0x2363ab[_0x2190('0x45')],_0x14d81f[_0x2190('0x4e')]));_0x544221[_0x2190('0x50')][_0x2190('0x69')]=_0x24b7e4['id'];if(_0x2363ab[_0x2190('0x45')][_0x2190('0x4f')]){_0x544221['where']=_['merge'](_0x544221[_0x2190('0x50')],{'$or':_[_0x2190('0x3f')](_0x544221['attributes'],function(_0x3f0500){var _0x4cd00a={};_0x4cd00a[_0x3f0500]={'$like':'%'+_0x2363ab['query'][_0x2190('0x4f')]+'%'};return _0x4cd00a;})});}_0x544221=_[_0x2190('0x51')]({},_0x544221,_0x2363ab[_0x2190('0x59')]);return db[_0x2190('0x66')][_0x2190('0x2f')]({'where':_0x544221['where']})[_0x2190('0x20')](function(_0x11fcfd){_0x36cf18['count']=_0x11fcfd;if(_0x2363ab[_0x2190('0x45')][_0x2190('0x53')]){_0x544221['include']=[{'all':!![]}];}return db[_0x2190('0x66')][_0x2190('0x55')](_0x544221);})['then'](function(_0x40a69e){_0x36cf18[_0x2190('0x6a')]=_0x40a69e;return _0x36cf18;});}})[_0x2190('0x20')](respondWithFilteredResult(_0x542896,_0x544221))[_0x2190('0x29')](handleError(_0x542896,null));};exports[_0x2190('0x6b')]=function(_0x4eb23e,_0x1b4f60,_0x111541){return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x4eb23e[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x1b4f60,null))[_0x2190('0x20')](function(_0x9eb492){if(_0x9eb492){return _0x9eb492[_0x2190('0x6b')](_0x4eb23e[_0x2190('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x1b4f60,null))[_0x2190('0x29')](handleError(_0x1b4f60,null));};exports[_0x2190('0x6c')]=function(_0x3623e0,_0x571688,_0x5bb3c5){if(_0x3623e0['body']['id']){delete _0x3623e0[_0x2190('0x5c')]['id'];}return db['WhatsappAccount'][_0x2190('0x5a')]({'where':{'id':_0x3623e0[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x571688,null))[_0x2190('0x20')](function(_0x338a03){if(_0x338a03){_0x3623e0[_0x2190('0x5c')]['WhatsappAccountId']=_0x338a03['id'];return db[_0x2190('0x6d')]['create'](_0x3623e0['body']);}})[_0x2190('0x20')](respondWithResult(_0x571688,null))[_0x2190('0x29')](handleError(_0x571688,null));};exports['getAnswers']=function(_0x3e390f,_0x4486a7,_0x5a0b7b){var _0xd981dd={'raw':![],'where':{}};var _0xb5457={};var _0x5923c9={'count':0x0,'rows':[]};return db[_0x2190('0x40')][_0x2190('0x6e')]({'where':{'id':_0x3e390f[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x4486a7,null))['then'](function(_0x4739f6){if(_0x4739f6){_0xb5457[_0x2190('0x44')]=_[_0x2190('0x46')](db[_0x2190('0x6d')]['rawAttributes']);_0xb5457[_0x2190('0x45')]=_[_0x2190('0x46')](_0x3e390f[_0x2190('0x45')]);_0xb5457[_0x2190('0x4e')]=_[_0x2190('0x47')](_0xb5457[_0x2190('0x44')],_0xb5457[_0x2190('0x45')]);_0xd981dd[_0x2190('0x49')]=_[_0x2190('0x47')](_0xb5457[_0x2190('0x44')],qs[_0x2190('0x48')](_0x3e390f[_0x2190('0x45')][_0x2190('0x48')]));_0xd981dd[_0x2190('0x49')]=_0xd981dd['attributes'][_0x2190('0x58')]?_0xd981dd['attributes']:_0xb5457[_0x2190('0x44')];if(!_0x3e390f[_0x2190('0x45')][_0x2190('0x4a')](_0x2190('0x4b'))){_0xd981dd[_0x2190('0x2e')]=qs[_0x2190('0x2e')](_0x3e390f['query'][_0x2190('0x2e')]);_0xd981dd[_0x2190('0x30')]=qs['offset'](_0x3e390f[_0x2190('0x45')][_0x2190('0x30')]);}_0xd981dd[_0x2190('0x4c')]=qs['sort'](_0x3e390f['query'][_0x2190('0x4d')]);_0xd981dd['where']=qs[_0x2190('0x4e')](_[_0x2190('0x68')](_0x3e390f[_0x2190('0x45')],_0xb5457[_0x2190('0x4e')]));_0xd981dd[_0x2190('0x50')][_0x2190('0x69')]=_0x4739f6['id'];if(_0x3e390f['query'][_0x2190('0x4f')]){_0xd981dd[_0x2190('0x50')]=_[_0x2190('0x51')](_0xd981dd[_0x2190('0x50')],{'$or':_[_0x2190('0x3f')](_0xd981dd['attributes'],function(_0x51fe1b){var _0x1c63b0={};_0x1c63b0[_0x51fe1b]={'$like':'%'+_0x3e390f[_0x2190('0x45')]['filter']+'%'};return _0x1c63b0;})});}_0xd981dd=_['merge']({},_0xd981dd,_0x3e390f[_0x2190('0x59')]);return db['CannedAnswer']['count']({'where':_0xd981dd[_0x2190('0x50')]})[_0x2190('0x20')](function(_0x2447f2){_0x5923c9['count']=_0x2447f2;if(_0x3e390f[_0x2190('0x45')][_0x2190('0x53')]){_0xd981dd['include']=[{'all':!![]}];}return db[_0x2190('0x6d')][_0x2190('0x55')](_0xd981dd);})[_0x2190('0x20')](function(_0x235078){_0x5923c9[_0x2190('0x6a')]=_0x235078;return _0x5923c9;});}})[_0x2190('0x20')](respondWithFilteredResult(_0x4486a7,_0xd981dd))[_0x2190('0x29')](handleError(_0x4486a7,null));};exports['removeAnswers']=function(_0xe0cdee,_0x39aaf8,_0x416e90){return db[_0x2190('0x40')]['find']({'where':{'id':_0xe0cdee[_0x2190('0x57')]['id']}})['then'](handleEntityNotFound(_0x39aaf8,null))[_0x2190('0x20')](function(_0x364295){if(_0x364295){return _0x364295['removeAnswers'](_0xe0cdee[_0x2190('0x45')][_0x2190('0x6f')]);}})[_0x2190('0x20')](respondWithStatusCode(_0x39aaf8,null))[_0x2190('0x29')](handleError(_0x39aaf8,null));};exports[_0x2190('0x70')]=function(_0x411437,_0x449303,_0x284761){return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x411437[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x449303,null))[_0x2190('0x20')](function(_0x2f2722){if(_0x2f2722){return _0x2f2722['addAgents'](_0x411437['body'][_0x2190('0x6f')],_[_0x2190('0x71')](_0x411437[_0x2190('0x5c')],[_0x2190('0x6f'),'id'])||{})[_0x2190('0x72')](function(_0x5abc03){for(var _0x29a49b=0x0;_0x29a49b<_0x411437[_0x2190('0x5c')][_0x2190('0x6f')]['length'];_0x29a49b+=0x1){socket[_0x2190('0x73')](_0x2190('0x74'),{'UserId':Number(_0x411437[_0x2190('0x5c')][_0x2190('0x6f')][_0x29a49b]),'WhatsappAccountId':Number(_0x411437[_0x2190('0x57')]['id'])});}return _0x5abc03;});}})[_0x2190('0x20')](respondWithResult(_0x449303,null))[_0x2190('0x29')](handleError(_0x449303,null));};exports[_0x2190('0x75')]=function(_0x28b021,_0x100640,_0x776307){return db['WhatsappAccount'][_0x2190('0x5a')]({'where':{'id':_0x28b021[_0x2190('0x57')]['id']}})[_0x2190('0x20')](handleEntityNotFound(_0x100640,null))[_0x2190('0x20')](function(_0x5b6128){if(_0x5b6128){return _0x5b6128[_0x2190('0x75')](_0x28b021[_0x2190('0x45')][_0x2190('0x6f')])[_0x2190('0x20')](function(){if(_[_0x2190('0x76')](_0x28b021[_0x2190('0x45')][_0x2190('0x6f')])){for(var _0x2c9237=0x0;_0x2c9237<_0x28b021['query'][_0x2190('0x6f')][_0x2190('0x58')];_0x2c9237+=0x1){socket[_0x2190('0x73')](_0x2190('0x77'),{'UserId':Number(_0x28b021[_0x2190('0x45')]['ids'][_0x2c9237]),'WhatsappAccountId':Number(_0x28b021[_0x2190('0x57')]['id'])});}}else{socket[_0x2190('0x73')](_0x2190('0x77'),{'UserId':Number(_0x28b021[_0x2190('0x45')][_0x2190('0x6f')]),'WhatsappAccountId':Number(_0x28b021['params']['id'])});}});}})[_0x2190('0x20')](respondWithStatusCode(_0x100640,null))[_0x2190('0x29')](handleError(_0x100640,null));};exports[_0x2190('0x78')]=function(_0x12386e,_0x9643d3,_0x59fe0c){var _0x29a519={};var _0x411e7c={};var _0x10df0a;var _0x3a3059;return db[_0x2190('0x40')]['findOne']({'where':{'id':_0x12386e['params']['id']}})['then'](handleEntityNotFound(_0x9643d3,null))[_0x2190('0x20')](function(_0x50d581){if(_0x50d581){_0x10df0a=_0x50d581;_0x411e7c[_0x2190('0x44')]=_[_0x2190('0x46')](db['User'][_0x2190('0x41')]);_0x411e7c['query']=_[_0x2190('0x46')](_0x12386e[_0x2190('0x45')]);_0x411e7c[_0x2190('0x4e')]=_[_0x2190('0x47')](_0x411e7c[_0x2190('0x44')],_0x411e7c[_0x2190('0x45')]);_0x29a519[_0x2190('0x49')]=_[_0x2190('0x47')](_0x411e7c[_0x2190('0x44')],qs[_0x2190('0x48')](_0x12386e[_0x2190('0x45')][_0x2190('0x48')]));_0x29a519[_0x2190('0x49')]=_0x29a519[_0x2190('0x49')][_0x2190('0x58')]?_0x29a519[_0x2190('0x49')]:_0x411e7c[_0x2190('0x44')];_0x29a519[_0x2190('0x4c')]=qs[_0x2190('0x4d')](_0x12386e['query']['sort']);_0x29a519[_0x2190('0x50')]=qs[_0x2190('0x4e')](_['pick'](_0x12386e['query'],_0x411e7c['filters']));if(_0x12386e[_0x2190('0x45')][_0x2190('0x4f')]){_0x29a519[_0x2190('0x50')]=_['merge'](_0x29a519[_0x2190('0x50')],{'$or':_['map'](_0x29a519[_0x2190('0x49')],function(_0x442f07){var _0x195a75={};_0x195a75[_0x442f07]={'$like':'%'+_0x12386e[_0x2190('0x45')][_0x2190('0x4f')]+'%'};return _0x195a75;})});}_0x29a519=_[_0x2190('0x51')]({},_0x29a519,_0x12386e[_0x2190('0x59')]);return _0x10df0a[_0x2190('0x78')](_0x29a519);}})[_0x2190('0x20')](function(_0xee312d){if(_0xee312d){_0x3a3059=_0xee312d[_0x2190('0x58')];if(!_0x12386e[_0x2190('0x45')][_0x2190('0x4a')](_0x2190('0x4b'))){_0x29a519[_0x2190('0x2e')]=qs[_0x2190('0x2e')](_0x12386e['query']['limit']);_0x29a519[_0x2190('0x30')]=qs[_0x2190('0x30')](_0x12386e[_0x2190('0x45')][_0x2190('0x30')]);}return _0x10df0a[_0x2190('0x78')](_0x29a519);}})[_0x2190('0x20')](function(_0x16f058){if(_0x16f058){return _0x16f058?{'count':_0x3a3059,'rows':_0x16f058}:null;}})[_0x2190('0x20')](respondWithResult(_0x9643d3,null))[_0x2190('0x29')](handleError(_0x9643d3,null));};exports[_0x2190('0x79')]=function(_0x684d97,_0xebed97){var _0x4e42bf=_0x684d97['params']['id'];var _0x48e624=_0x684d97[_0x2190('0x5c')];var _0x3a8670=0xc8;var _0x1d242c=null;return db[_0x2190('0x7a')][_0x2190('0x7b')]({'isolationLevel':db[_0x2190('0x7a')][_0x2190('0x7c')][_0x2190('0x7d')][_0x2190('0x7e')]},function(_0x1db0ae){return db['WhatsappAccount'][_0x2190('0x6e')]({'where':{'id':_0x4e42bf},'transaction':_0x1db0ae})[_0x2190('0x20')](function(_0x28be00){if(_0x28be00){return db[_0x2190('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0x4e42bf},'transaction':_0x1db0ae})[_0x2190('0x20')](function(){var _0xe27845=_[_0x2190('0x3f')](_0x48e624,function(_0x991385){_0x991385['WhatsappAccountId']=_0x4e42bf;return _0x991385;});return db[_0x2190('0x7f')]['bulkCreate'](_0xe27845,{'transaction':_0x1db0ae});});}else{_0x3a8670=0x194;_0x1d242c=[];}});})[_0x2190('0x20')](function(){if(_0x3a8670!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x4e42bf},'order':'priority'})[_0x2190('0x20')](function(_0xdbcb76){_0x1d242c=_0xdbcb76;});}})[_0x2190('0x29')](function(_0x1a7def){_0x3a8670=0x1f4;logger['error'](_0x1a7def[_0x2190('0x3a')]);if(_0x1a7def[_0x2190('0x3b')]){delete _0x1a7def[_0x2190('0x3b')];}_0x1d242c=_0x1a7def;})[_0x2190('0x80')](function(){if(_0x1d242c===null){_0xebed97[_0x2190('0x2a')](_0x3a8670);}else{if(_0x3a8670===0x1f4){_0xebed97[_0x2190('0x2b')](_0x3a8670)[_0x2190('0x3c')](_0x1d242c);}else{_0xebed97[_0x2190('0x2b')](_0x3a8670)[_0x2190('0x2c')](_0x1d242c);}}});};exports[_0x2190('0x81')]=function(_0x5a7690,_0x256c3f,_0x100165){var _0x54e893={};var _0xcaffbb={};var _0xd05013;var _0x3c2806;return db[_0x2190('0x40')][_0x2190('0x6e')]({'where':{'id':_0x5a7690[_0x2190('0x57')]['id']}})['then'](handleEntityNotFound(_0x256c3f,null))[_0x2190('0x20')](function(_0x5ce078){if(_0x5ce078){_0xd05013=_0x5ce078;_0xcaffbb[_0x2190('0x44')]=_['keys'](db[_0x2190('0x7f')][_0x2190('0x41')]);_0xcaffbb[_0x2190('0x45')]=_[_0x2190('0x46')](_0x5a7690[_0x2190('0x45')]);_0xcaffbb['filters']=_['intersection'](_0xcaffbb['model'],_0xcaffbb[_0x2190('0x45')]);_0x54e893[_0x2190('0x49')]=_[_0x2190('0x47')](_0xcaffbb[_0x2190('0x44')],qs[_0x2190('0x48')](_0x5a7690[_0x2190('0x45')][_0x2190('0x48')]));_0x54e893[_0x2190('0x49')]=_0x54e893[_0x2190('0x49')]['length']?_0x54e893[_0x2190('0x49')]:_0xcaffbb[_0x2190('0x44')];_0x54e893[_0x2190('0x4c')]=qs[_0x2190('0x4d')](_0x5a7690[_0x2190('0x45')][_0x2190('0x4d')]);_0x54e893[_0x2190('0x50')]=qs[_0x2190('0x4e')](_['pick'](_0x5a7690['query'],_0xcaffbb['filters']));if(_0x5a7690[_0x2190('0x45')][_0x2190('0x4f')]){_0x54e893[_0x2190('0x50')]=_['merge'](_0x54e893[_0x2190('0x50')],{'$or':_[_0x2190('0x3f')](_0x54e893['attributes'],function(_0x12b77c){var _0x2cac73={};_0x2cac73[_0x12b77c]={'$like':'%'+_0x5a7690[_0x2190('0x45')]['filter']+'%'};return _0x2cac73;})});}_0x54e893=_[_0x2190('0x51')]({},_0x54e893,_0x5a7690[_0x2190('0x59')]);return _0xd05013[_0x2190('0x81')](_0x54e893);}})[_0x2190('0x20')](function(_0x2b8067){if(_0x2b8067){_0x3c2806=_0x2b8067['length'];if(!_0x5a7690['query'][_0x2190('0x4a')](_0x2190('0x4b'))){_0x54e893[_0x2190('0x2e')]=qs[_0x2190('0x2e')](_0x5a7690[_0x2190('0x45')][_0x2190('0x2e')]);_0x54e893['offset']=qs[_0x2190('0x30')](_0x5a7690[_0x2190('0x45')][_0x2190('0x30')]);}return _0xd05013[_0x2190('0x81')](_0x54e893);}})[_0x2190('0x20')](function(_0x325e72){if(_0x325e72){return _0x325e72?{'count':_0x3c2806,'rows':_0x325e72}:null;}})[_0x2190('0x20')](respondWithResult(_0x256c3f,null))[_0x2190('0x29')](handleError(_0x256c3f,null));};exports[_0x2190('0x82')]=function(_0x5b085a,_0x5631eb,_0x5895f5){var _0x308ecb={'channel':_0x2190('0x83')};var _0x569656=[];var _0x269679=[];var _0x20c852={};return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x5b085a[_0x2190('0x57')]['id']},'include':[{'model':db[_0x2190('0x7f')],'as':_0x2190('0x84')}]})[_0x2190('0x20')](handleEntityNotFound(_0x5631eb,null))['then'](function(_0xefbfb3){_0x308ecb[_0x2190('0x85')]=_0xefbfb3;if(_0x308ecb[_0x2190('0x85')]&&_0x308ecb[_0x2190('0x85')][_0x2190('0x42')]===_0x2190('0x86')&&_0x5b085a[_0x2190('0x5c')][_0x2190('0x87')]){if(_0x5b085a[_0x2190('0x5c')][_0x2190('0x87')][_0x2190('0x58')]===0x0)return;if(_0x5b085a[_0x2190('0x5c')][_0x2190('0x87')][0x0][_0x2190('0x88')]!=='read')return;return db['WhatsappMessage'][_0x2190('0x34')]({'read':!![],'readAt':_0x5b085a[_0x2190('0x5c')]['statuses'][0x0][_0x2190('0x89')]},{'where':{'messageId':_0x5b085a['body']['statuses'][0x0][_0x2190('0x8a')]},'individualHooks':!![]})[_0x2190('0x20')](function(_0x412c9d){return _0x5631eb[_0x2190('0x2b')](0xc8)[_0x2190('0x2c')](_0x412c9d);});}_0x308ecb['applications']=_[_0x2190('0x8b')](_0xefbfb3[_0x2190('0x84')],['priority'],[_0x2190('0x8c')]);if(_0x308ecb['account'][_0x2190('0x84')]){delete _0x308ecb[_0x2190('0x85')]['Applications'];}return db[_0x2190('0x8d')]['describe']()['then'](function(_0x35267d){if(!_0x35267d){throw new db['Sequelize'][(_0x2190('0x8e'))](_0x2190('0x8f'));}_0x569656=_[_0x2190('0x90')](_[_0x2190('0x46')](_0x35267d),[_0x2190('0x91'),_0x2190('0x92')]);_0x269679=_[_0x2190('0x90')](_[_0x2190('0x46')](_0x35267d),[_0x2190('0x91'),_0x2190('0x92'),_0x2190('0x93'),'ListId']);_0x308ecb['body']={'mapKey':_0x2190('0x94')};if(_0x308ecb['account']&&_0x308ecb[_0x2190('0x85')][_0x2190('0x42')]===_0x2190('0x95')){_0x308ecb[_0x2190('0x5c')][_0x2190('0x96')]=_0x5b085a[_0x2190('0x5c')][_0x2190('0x97')][_0x2190('0x98')](_0x2190('0x99'),'');_0x308ecb[_0x2190('0x5c')][_0x2190('0x5c')]=_0x5b085a[_0x2190('0x5c')][_0x2190('0x9a')];_0x308ecb[_0x2190('0x5c')]['messageId']=_0x5b085a[_0x2190('0x5c')]['MessageSid'];}if(_0x308ecb['account']&&_0x308ecb['account'][_0x2190('0x42')]==='sinch'){_0x308ecb[_0x2190('0x5c')][_0x2190('0x96')]=_0x5b085a[_0x2190('0x5c')]['notifications'][0x0]['from'];_0x308ecb[_0x2190('0x5c')]['body']=_0x5b085a[_0x2190('0x5c')][_0x2190('0x9b')][0x0][_0x2190('0x26')][_0x2190('0x5c')];_0x308ecb[_0x2190('0x5c')]['messageId']=_0x5b085a['body']['notifications'][0x0][_0x2190('0x8a')];}if(_0x308ecb['body']['id']){delete _0x308ecb[_0x2190('0x5c')]['id'];}if(_[_0x2190('0x9c')](_0x308ecb[_0x2190('0x5c')][_0x2190('0x96')])){throw new db[(_0x2190('0x9d'))]['ValidationError'](_0x2190('0x9e'));}if(_['isNil'](_0x308ecb[_0x2190('0x5c')]['body'])||_0x308ecb[_0x2190('0x5c')][_0x2190('0x5c')]===''){throw new db[(_0x2190('0x9d'))][(_0x2190('0x8e'))](_0x2190('0x9f'));}if(_['isNil'](_0x308ecb[_0x2190('0x5c')][_0x2190('0xa0')])){throw new db[(_0x2190('0x9d'))][(_0x2190('0x8e'))](_0x2190('0xa1')+_0x269679);}if(!_[_0x2190('0xa2')](_0x269679,_0x308ecb[_0x2190('0x5c')][_0x2190('0xa0')])){throw new db[(_0x2190('0x9d'))][(_0x2190('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x269679);}_0x20c852[_0x308ecb[_0x2190('0x5c')][_0x2190('0xa0')]]=_0x308ecb['body']['from'];return db['CmList'][_0x2190('0x5a')]({'where':{'id':_0x308ecb[_0x2190('0x85')][_0x2190('0xa3')]},'include':[{'model':db[_0x2190('0x8d')],'as':_0x2190('0xa4'),'where':_0x20c852,'limit':0x1,'order':[[_0x2190('0x92'),_0x2190('0xa5')]]}]});})[_0x2190('0x20')](handleEntityNotFound(_0x5631eb,null))[_0x2190('0x20')](function(_0x212bfc){if(_0x212bfc){_0x308ecb[_0x2190('0xa6')]=_[_0x2190('0x71')](_0x212bfc,['Contacts']);if(_0x212bfc[_0x2190('0xa4')][_0x2190('0x58')]){return _0x212bfc[_0x2190('0xa4')][0x0];}var _0x4f45eb=_[_0x2190('0x19')](_0x308ecb[_0x2190('0x5c')],{'firstName':_0x308ecb[_0x2190('0x5c')][_0x2190('0x96')],'ListId':_0x212bfc['id']});_0x4f45eb[_0x308ecb[_0x2190('0x5c')][_0x2190('0xa0')]]=_0x308ecb[_0x2190('0x5c')]['from'];return db[_0x2190('0x8d')][_0x2190('0x5b')](_0x4f45eb,{'fields':_0x569656,'raw':!![]});}})[_0x2190('0x20')](handleEntityNotFound(_0x5631eb,null))[_0x2190('0x20')](function(_0x14685a){if(_0x14685a){_0x308ecb['contact']=_0x14685a;var _0x46f04c={'ContactId':_0x14685a['id'],'phone':_0x308ecb[_0x2190('0x5c')]['from'],'WhatsappAccountId':_0x5b085a[_0x2190('0x57')]['id']};var _0x5c808b={'ContactId':_0x14685a['id'],'WhatsappAccountId':_0x5b085a['params']['id'],'closed':![]};return db[_0x2190('0xa7')][_0x2190('0x5a')]({'where':_0x5c808b})[_0x2190('0x20')](function(_0x2baa29){if(_0x2baa29){return[_0x2baa29,![]];}return db['WhatsappInteraction'][_0x2190('0x5b')](_0x46f04c)['then'](function(_0x1f7840){return[_0x1f7840,!![]];});});}})[_0x2190('0x72')](function(_0x18893e,_0xe84b4){_0x308ecb[_0x2190('0xa8')]=_0x18893e[_0x2190('0x36')]({'plain':!![]});_0x308ecb[_0x2190('0xa8')][_0x2190('0xa9')]=![];if(_0xe84b4){if(_0x308ecb['account'][_0x2190('0xaa')]){_0x308ecb['applications']['push']({'id':0x0,'priority':_0x308ecb[_0x2190('0xab')][_0x2190('0x58')]+0x1,'app':_0x2190('0xac'),'appdata':_0x2190('0xad'),'interval':'*,*,*,*'});}_0x308ecb['interaction'][_0x2190('0xa9')]=!![];}return db[_0x2190('0xae')][_0x2190('0x5b')]({'phone':_0x308ecb[_0x2190('0x5c')][_0x2190('0x96')],'messageId':_0x308ecb[_0x2190('0x5c')][_0x2190('0xaf')],'body':_0x308ecb[_0x2190('0x5c')][_0x2190('0x5c')],'WhatsappAccountId':_0x5b085a[_0x2190('0x57')]['id'],'WhatsappInteractionId':_0x18893e['id'],'direction':'in','ContactId':_0x18893e[_0x2190('0xb0')],'AttachmentId':_0x308ecb[_0x2190('0x5c')][_0x2190('0xb1')]});})['then'](function(_0x4b1f78){_0x308ecb['message']=_0x4b1f78;if(!_0x308ecb[_0x2190('0xa8')][_0x2190('0xb2')])return;return db['User']['find']({'attributes':['id',_0x2190('0x3b')],'where':{'id':_0x308ecb[_0x2190('0xa8')][_0x2190('0xb2')]}});})[_0x2190('0x20')](function(_0x47f6ff){if(_0x47f6ff){_0x308ecb[_0x2190('0xab')][_0x2190('0xb3')]({'id':0x0,'priority':0x0,'app':_0x2190('0xb4'),'appdata':_0x47f6ff['name']+','+(_0x308ecb['account'][_0x2190('0xb5')]||0xa),'interval':_0x2190('0xb6')});}if(!_0x308ecb['interaction'][_0x2190('0xb7')])return;return db[_0x2190('0xb8')][_0x2190('0x5a')]({'attributes':['id',_0x2190('0x3b')],'where':{'id':_0x308ecb[_0x2190('0xa8')][_0x2190('0xb7')]}});})['then'](function(_0x537787){if(_0x537787){_0x308ecb[_0x2190('0xab')][_0x2190('0xb3')]({'id':0x0,'priority':0x1,'app':_0x2190('0xb9'),'appdata':_0x537787[_0x2190('0x3b')]+','+(_0x308ecb[_0x2190('0x85')][_0x2190('0xba')]||0x12c),'interval':_0x2190('0xb6')});}return respondWithRpcPromise(_0x2190('0xbb'),_0x2190('0xbc'),_0x308ecb);})['then'](function(_0x585068){if(_0x585068){var _0x5de06f=0xc8;var _0x453b08=_0x2190('0xbd');logger[_0x2190('0x21')](_0x2190('0x23'),_0x453b08,_0x5de06f,'entity\x20found');logger[_0x2190('0xbe')](_0x2190('0xbf'),_0x453b08,_0x5de06f,'entity\x20found',JSON[_0x2190('0x24')](_0x585068));if(_0x308ecb['account'][_0x2190('0x42')]===_0x2190('0x95')){return _0x5631eb[_0x2190('0x2b')](_0x5de06f)['set'](_0x2190('0xc0'),'text/xml')[_0x2190('0x3c')](_0x2190('0xc1'));}else{return _0x5631eb[_0x2190('0x2b')](_0x5de06f)[_0x2190('0x2c')](_0x585068);}}});})['catch'](handleError(_0x5631eb,null));};exports[_0x2190('0x3c')]=function(_0x326a8d,_0x54552a,_0x42ad64){var _0x2c4a6e,_0x309f63,_0x4d92cd;if(_[_0x2190('0x9c')](_0x326a8d['body'][_0x2190('0x5c')])||_0x326a8d[_0x2190('0x5c')][_0x2190('0x5c')]===''){throw new db[(_0x2190('0x9d'))]['ValidationError'](_0x2190('0x9f'));}if(_[_0x2190('0x9c')](_0x326a8d[_0x2190('0x5c')]['to'])){throw new db[(_0x2190('0x9d'))][(_0x2190('0x8e'))](_0x2190('0xc2'));}_0x2c4a6e=_0x326a8d['body']['to'];return db[_0x2190('0x40')][_0x2190('0x5a')]({'where':{'id':_0x326a8d[_0x2190('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x2190('0xc3'),'include':[{'model':db['CmContact'],'as':_0x2190('0xa4'),'where':{'mobile':_0x2c4a6e},'limit':0x1,'order':[['updatedAt',_0x2190('0xa5')]]}]}]})[_0x2190('0x20')](handleEntityNotFound(_0x54552a,null))[_0x2190('0x20')](function(_0x38b27e){if(_0x38b27e&&_0x38b27e[_0x2190('0xc3')]){_0x309f63=_0x38b27e['get']({'plain':!![]});if(_0x309f63[_0x2190('0xc3')]&&_0x309f63['List'][_0x2190('0xa4')][_0x2190('0x58')]){return _0x309f63[_0x2190('0xc3')][_0x2190('0xa4')][0x0];}return db['CmContact'][_0x2190('0x5b')](_[_0x2190('0x19')](_0x326a8d[_0x2190('0x5c')],{'firstName':_0x2c4a6e,'mobile':_0x2c4a6e,'phone':_0x2c4a6e,'ListId':_0x309f63['ListId']}));}})[_0x2190('0x20')](handleEntityNotFound(_0x54552a,null))[_0x2190('0x20')](function(_0x5a15b4){if(_0x5a15b4){_0x4d92cd=_0x5a15b4;return db[_0x2190('0xa7')][_0x2190('0x5a')]({'where':{'ContactId':_0x4d92cd['id'],'closed':![],'WhatsappAccountId':_0x309f63['id']}})[_0x2190('0x20')](function(_0x4df62c){if(_0x4df62c){return[_0x4df62c,![]];}return db['WhatsappInteraction'][_0x2190('0x5b')]({'UserId':_0x326a8d[_0x2190('0x5d')]['id'],'ContactId':_0x4d92cd['id'],'WhatsappAccountId':_0x309f63['id'],'phone':_0x2c4a6e,'firstMsgDirection':_0x2190('0xc4'),'Messages':[_[_0x2190('0x51')](_0x326a8d[_0x2190('0x5c')],{'read':![],'body':_0x326a8d[_0x2190('0x5c')][_0x2190('0x5c')],'phone':_0x2c4a6e,'WhatsappAccountId':_0x309f63['id'],'UserId':_0x326a8d['user']['id'],'ContactId':_0x4d92cd['id']})]},{'include':[{'model':db[_0x2190('0xae')],'as':_0x2190('0xc5')}]})[_0x2190('0x20')](function(_0x29f8fa){return[_0x29f8fa,!![]];});});}})[_0x2190('0x72')](function(_0x2cafc4,_0x3d6615){if(_0x3d6615){return _0x2cafc4;}return db[_0x2190('0xae')]['create'](_[_0x2190('0x51')](_0x326a8d[_0x2190('0x5c')],{'read':![],'body':_0x326a8d[_0x2190('0x5c')][_0x2190('0x5c')],'phone':_0x2c4a6e,'WhatsappAccountId':_0x309f63['id'],'WhatsappInteractionId':_0x2cafc4['id'],'UserId':_0x326a8d[_0x2190('0x5d')]['id'],'ContactId':_0x4d92cd['id']}))[_0x2190('0x20')](function(_0x2550ff){_0x2cafc4[_0x2190('0xc6')][_0x2190('0xc5')]=[];_0x2cafc4[_0x2190('0xc6')][_0x2190('0xc5')]['push'](_0x2550ff[_0x2190('0xc6')]);return _0x2cafc4;});})[_0x2190('0x20')](respondWithResult(_0x54552a,null))[_0x2190('0x29')](handleError(_0x54552a,null));}; \ No newline at end of file +var _0xd4f4=['Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','findOne','Disposition','nolimit','order','pick','WhatsappAccountId','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','timestamp','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','twilio','From','whatsapp:','messageId','from','notifications','message_id','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','defaults','contact','WhatsappInteraction','spread','interaction','applications','push','close','created','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./whatsappAccount.socket','register','client','http','then','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','count','limit','set','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index'];(function(_0x208c6a,_0x2c5b5a){var _0x3843cb=function(_0x14a279){while(--_0x14a279){_0x208c6a['push'](_0x208c6a['shift']());}};_0x3843cb(++_0x2c5b5a);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x310f53,_0x391588){_0x310f53=_0x310f53-0x0;var _0x2a9621=_0xd4f4[_0x310f53];return _0x2a9621;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4d4f('0x1d')],{'host':_0x4d4f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x1d')]));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d4f('0x21')][_0x4d4f('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x1a9173,_0x4a3364,_0x59bfb5,_0x5e4ff5){return new BPromise(function(_0x18a528,_0x16f8e7){var _0x4170ca=_0x5e4ff5||client;return _0x4170ca['request'](_0x1a9173,_0x59bfb5)[_0x4d4f('0x23')](function(_0x17a437){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x4a3364,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a3364,_0x4d4f('0x24'),JSON[_0x4d4f('0x25')](_0x17a437));if(_0x17a437[_0x4d4f('0x26')]){if(_0x17a437[_0x4d4f('0x26')]['code']===0x1f4){logger['error'](_0x4d4f('0x27'),_0x4a3364,_0x17a437['error'][_0x4d4f('0x28')]);return _0x16f8e7(_0x17a437[_0x4d4f('0x26')][_0x4d4f('0x28')]);}logger[_0x4d4f('0x26')](_0x4d4f('0x27'),_0x4a3364,_0x17a437['error']['message']);return _0x18a528(_0x17a437[_0x4d4f('0x26')]['message']);}else{logger[_0x4d4f('0x29')](_0x4d4f('0x27'),_0x4a3364,_0x4d4f('0x24'));_0x18a528(_0x17a437[_0x4d4f('0x2a')][_0x4d4f('0x28')]);}})['catch'](function(_0x44bd2f){logger[_0x4d4f('0x26')](_0x4d4f('0x27'),_0x4a3364,_0x44bd2f);_0x16f8e7(_0x44bd2f);});});}function respondWithStatusCode(_0x28443b,_0x5cf9e7){_0x5cf9e7=_0x5cf9e7||0xcc;return function(_0x51a7c5){if(_0x51a7c5){return _0x28443b[_0x4d4f('0x2b')](_0x5cf9e7);}return _0x28443b[_0x4d4f('0x2c')](_0x5cf9e7)[_0x4d4f('0x2d')]();};}function respondWithResult(_0x1f79f9,_0x58acbe){_0x58acbe=_0x58acbe||0xc8;return function(_0x671c87){if(_0x671c87){return _0x1f79f9[_0x4d4f('0x2c')](_0x58acbe)[_0x4d4f('0x2e')](_0x671c87);}};}function respondWithFilteredResult(_0x2e91b2,_0x4effb1){return function(_0x338ba2){if(_0x338ba2){var _0x51cb3d=typeof _0x4effb1[_0x4d4f('0x2f')]===_0x4d4f('0x30')&&typeof _0x4effb1['limit']===_0x4d4f('0x30');var _0x123383=_0x338ba2[_0x4d4f('0x31')];var _0x3d7f14=_0x51cb3d?0x0:_0x4effb1[_0x4d4f('0x2f')];var _0x43a704=_0x51cb3d?_0x338ba2['count']:_0x4effb1[_0x4d4f('0x2f')]+_0x4effb1[_0x4d4f('0x32')];var _0x3894db;if(_0x43a704>=_0x123383){_0x43a704=_0x123383;_0x3894db=0xc8;}else{_0x3894db=0xce;}_0x2e91b2[_0x4d4f('0x2c')](_0x3894db);return _0x2e91b2[_0x4d4f('0x33')]('Content-Range',_0x3d7f14+'-'+_0x43a704+'/'+_0x123383)[_0x4d4f('0x2e')](_0x338ba2);}return null;};}function patchUpdates(_0x486e33){return function(_0x35f9e2){try{jsonpatch['apply'](_0x35f9e2,_0x486e33,!![]);}catch(_0x4c706b){return BPromise['reject'](_0x4c706b);}return _0x35f9e2[_0x4d4f('0x34')]();};}function saveUpdates(_0x57fc2b,_0x16ccd2){return function(_0x151132){if(_0x151132){return _0x151132[_0x4d4f('0x35')](_0x57fc2b)['then'](function(_0x8d18dc){return _0x8d18dc;});}return null;};}function removeEntity(_0x1ab7c4,_0x6baae8){return function(_0x4cac5d){if(_0x4cac5d){return _0x4cac5d[_0x4d4f('0x36')]()['then'](function(){var _0x3f9618=_0x4cac5d[_0x4d4f('0x37')]({'plain':!![]});var _0x1a7cb3=_0x4d4f('0x38');return db[_0x4d4f('0x39')][_0x4d4f('0x36')]({'where':{'type':_0x1a7cb3,'resourceId':_0x3f9618['id']}})[_0x4d4f('0x23')](function(){return _0x4cac5d;});})[_0x4d4f('0x23')](function(){_0x1ab7c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea027,_0x559441){return function(_0x4e2f63){if(!_0x4e2f63){_0x2ea027[_0x4d4f('0x2b')](0x194);}return _0x4e2f63;};}function handleError(_0x3317b5,_0x2be655){_0x2be655=_0x2be655||0x1f4;return function(_0x18ef52){logger[_0x4d4f('0x26')](_0x18ef52['stack']);if(_0x18ef52[_0x4d4f('0x3a')]){delete _0x18ef52[_0x4d4f('0x3a')];}_0x3317b5['status'](_0x2be655)[_0x4d4f('0x3b')](_0x18ef52);};}exports[_0x4d4f('0x3c')]=function(_0x336625,_0x42f9ed){var _0x18800e={'include':[{'model':db[_0x4d4f('0x3d')],'as':_0x4d4f('0x3e')}]},_0x19ebfe={},_0x20290e={'count':0x0,'rows':[]};var _0x4e54aa=_['map'](db[_0x4d4f('0x3f')][_0x4d4f('0x40')],function(_0x4b3ba1){return{'name':_0x4b3ba1[_0x4d4f('0x41')],'type':_0x4b3ba1['type']['key']};});_0x19ebfe[_0x4d4f('0x42')]=_[_0x4d4f('0x43')](_0x4e54aa,'name');_0x19ebfe['query']=_[_0x4d4f('0x44')](_0x336625[_0x4d4f('0x45')]);_0x19ebfe['filters']=_[_0x4d4f('0x46')](_0x19ebfe[_0x4d4f('0x42')],_0x19ebfe[_0x4d4f('0x45')]);_0x18800e[_0x4d4f('0x47')]=_[_0x4d4f('0x46')](_0x19ebfe['model'],qs[_0x4d4f('0x48')](_0x336625['query'][_0x4d4f('0x48')]));_0x18800e[_0x4d4f('0x47')]=_0x18800e['attributes'][_0x4d4f('0x49')]?_0x18800e[_0x4d4f('0x47')]:_0x19ebfe[_0x4d4f('0x42')];if(!_0x336625['query'][_0x4d4f('0x4a')]('nolimit')){_0x18800e[_0x4d4f('0x32')]=qs['limit'](_0x336625[_0x4d4f('0x45')][_0x4d4f('0x32')]);_0x18800e[_0x4d4f('0x2f')]=qs[_0x4d4f('0x2f')](_0x336625[_0x4d4f('0x45')]['offset']);}_0x18800e['order']=qs[_0x4d4f('0x4b')](_0x336625[_0x4d4f('0x45')][_0x4d4f('0x4b')]);_0x18800e[_0x4d4f('0x4c')]=qs['filters'](_['pick'](_0x336625['query'],_0x19ebfe[_0x4d4f('0x4d')]),_0x4e54aa);if(_0x336625[_0x4d4f('0x45')][_0x4d4f('0x4e')]){_0x18800e[_0x4d4f('0x4c')]=_[_0x4d4f('0x4f')](_0x18800e[_0x4d4f('0x4c')],{'$or':_[_0x4d4f('0x43')](_0x4e54aa,function(_0x437da9){if(_0x437da9[_0x4d4f('0x50')]!==_0x4d4f('0x51')){var _0x37745d={};_0x37745d[_0x437da9[_0x4d4f('0x3a')]]={'$like':'%'+_0x336625['query'][_0x4d4f('0x4e')]+'%'};return _0x37745d;}})});}_0x18800e=_[_0x4d4f('0x4f')]({},_0x18800e,_0x336625['options']);var _0xb0d5e8={'where':_0x18800e['where']};return db[_0x4d4f('0x3f')][_0x4d4f('0x31')](_0xb0d5e8)['then'](function(_0x67fc4b){_0x20290e[_0x4d4f('0x31')]=_0x67fc4b;if(_0x336625[_0x4d4f('0x45')][_0x4d4f('0x52')]){_0x18800e[_0x4d4f('0x53')]=[{'all':!![]}];}return db[_0x4d4f('0x3f')][_0x4d4f('0x54')](_0x18800e);})[_0x4d4f('0x23')](function(_0x27655c){_0x20290e[_0x4d4f('0x55')]=_0x27655c;return _0x20290e;})[_0x4d4f('0x23')](respondWithFilteredResult(_0x42f9ed,_0x18800e))[_0x4d4f('0x56')](handleError(_0x42f9ed,null));};exports['show']=function(_0x309ec2,_0x539088){var _0x59d245={'raw':![],'where':{'id':_0x309ec2[_0x4d4f('0x57')]['id']},'include':[{'model':db[_0x4d4f('0x3d')],'as':'mandatoryDispositionPause'}]},_0x57af44={};_0x57af44['model']=_[_0x4d4f('0x44')](db[_0x4d4f('0x3f')]['rawAttributes']);_0x57af44[_0x4d4f('0x45')]=_['keys'](_0x309ec2[_0x4d4f('0x45')]);_0x57af44[_0x4d4f('0x4d')]=_[_0x4d4f('0x46')](_0x57af44[_0x4d4f('0x42')],_0x57af44['query']);_0x59d245[_0x4d4f('0x47')]=_[_0x4d4f('0x46')](_0x57af44[_0x4d4f('0x42')],qs[_0x4d4f('0x48')](_0x309ec2[_0x4d4f('0x45')]['fields']));_0x59d245[_0x4d4f('0x47')]=_0x59d245['attributes'][_0x4d4f('0x49')]?_0x59d245['attributes']:_0x57af44[_0x4d4f('0x42')];if(_0x309ec2[_0x4d4f('0x45')]['includeAll']){_0x59d245[_0x4d4f('0x53')]=[{'all':!![]}];}_0x59d245=_[_0x4d4f('0x4f')]({},_0x59d245,_0x309ec2['options']);return db[_0x4d4f('0x3f')]['find'](_0x59d245)[_0x4d4f('0x23')](handleEntityNotFound(_0x539088,null))['then'](respondWithResult(_0x539088,null))['catch'](handleError(_0x539088,null));};exports[_0x4d4f('0x58')]=function(_0x333a24,_0x23bf8e){return db[_0x4d4f('0x3f')][_0x4d4f('0x58')](_0x333a24['body'],{})['then'](function(_0xeaccdd){var _0x52641a=_0x333a24[_0x4d4f('0x59')][_0x4d4f('0x37')]({'plain':!![]});if(!_0x52641a)throw new Error(_0x4d4f('0x5a'));if(_0x52641a[_0x4d4f('0x5b')]===_0x4d4f('0x59')){var _0x39ae15=_0xeaccdd['get']({'plain':!![]});var _0x1266ce=_0x4d4f('0x38');return db[_0x4d4f('0x5c')]['find']({'where':{'name':_0x1266ce,'userProfileId':_0x52641a[_0x4d4f('0x5d')]},'raw':!![]})[_0x4d4f('0x23')](function(_0x217ece){if(_0x217ece&&_0x217ece['autoAssociation']===0x0){return db[_0x4d4f('0x39')]['create']({'name':_0x39ae15[_0x4d4f('0x3a')],'resourceId':_0x39ae15['id'],'type':_0x217ece[_0x4d4f('0x3a')],'sectionId':_0x217ece['id']},{})[_0x4d4f('0x23')](function(){return _0xeaccdd;});}else{return _0xeaccdd;}})[_0x4d4f('0x56')](function(_0x1edb3d){logger[_0x4d4f('0x26')](_0x4d4f('0x5e'),_0x1edb3d);throw _0x1edb3d;});}return _0xeaccdd;})[_0x4d4f('0x23')](respondWithResult(_0x23bf8e,0xc9))[_0x4d4f('0x56')](handleError(_0x23bf8e,null));};exports['update']=function(_0x2f6e40,_0x255771){if(_0x2f6e40['body']['id']){delete _0x2f6e40[_0x4d4f('0x5f')]['id'];}return db[_0x4d4f('0x3f')][_0x4d4f('0x60')]({'where':{'id':_0x2f6e40[_0x4d4f('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x4d4f('0x3e')}]})[_0x4d4f('0x23')](handleEntityNotFound(_0x255771,null))['then'](saveUpdates(_0x2f6e40['body'],null))[_0x4d4f('0x23')](respondWithResult(_0x255771,null))[_0x4d4f('0x56')](handleError(_0x255771,null));};exports['destroy']=function(_0x4b9b15,_0x4d34fc){return db[_0x4d4f('0x3f')][_0x4d4f('0x60')]({'where':{'id':_0x4b9b15['params']['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x4d34fc,null))[_0x4d4f('0x23')](removeEntity(_0x4d34fc,null))[_0x4d4f('0x56')](handleError(_0x4d34fc,null));};exports[_0x4d4f('0x61')]=function(_0x1d9552,_0x3a0394){return db[_0x4d4f('0x3f')][_0x4d4f('0x61')]()['then'](respondWithResult(_0x3a0394,null))[_0x4d4f('0x56')](handleError(_0x3a0394,null));};exports['addDisposition']=function(_0x403cb2,_0x289653,_0x1567c3){if(_0x403cb2['body']['id']){delete _0x403cb2[_0x4d4f('0x5f')]['id'];}return db[_0x4d4f('0x3f')][_0x4d4f('0x60')]({'where':{'id':_0x403cb2[_0x4d4f('0x57')]['id']}})['then'](handleEntityNotFound(_0x289653,null))[_0x4d4f('0x23')](function(_0x4bf7bd){if(_0x4bf7bd){_0x403cb2[_0x4d4f('0x5f')]['WhatsappAccountId']=_0x4bf7bd['id'];return db['Disposition'][_0x4d4f('0x58')](_0x403cb2[_0x4d4f('0x5f')]);}})['then'](respondWithResult(_0x289653,null))[_0x4d4f('0x56')](handleError(_0x289653,null));};exports['getDispositions']=function(_0x41ffe7,_0x4420f0,_0x111c01){var _0x3ce5d8={'raw':![],'where':{}};var _0x575ad6={};var _0x4952f0={'count':0x0,'rows':[]};return db[_0x4d4f('0x3f')][_0x4d4f('0x62')]({'where':{'id':_0x41ffe7['params']['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x4420f0,null))[_0x4d4f('0x23')](function(_0x21046c){if(_0x21046c){_0x575ad6[_0x4d4f('0x42')]=_[_0x4d4f('0x44')](db[_0x4d4f('0x63')]['rawAttributes']);_0x575ad6['query']=_[_0x4d4f('0x44')](_0x41ffe7[_0x4d4f('0x45')]);_0x575ad6['filters']=_[_0x4d4f('0x46')](_0x575ad6[_0x4d4f('0x42')],_0x575ad6[_0x4d4f('0x45')]);_0x3ce5d8[_0x4d4f('0x47')]=_[_0x4d4f('0x46')](_0x575ad6[_0x4d4f('0x42')],qs[_0x4d4f('0x48')](_0x41ffe7[_0x4d4f('0x45')][_0x4d4f('0x48')]));_0x3ce5d8[_0x4d4f('0x47')]=_0x3ce5d8[_0x4d4f('0x47')][_0x4d4f('0x49')]?_0x3ce5d8[_0x4d4f('0x47')]:_0x575ad6[_0x4d4f('0x42')];if(!_0x41ffe7[_0x4d4f('0x45')]['hasOwnProperty'](_0x4d4f('0x64'))){_0x3ce5d8[_0x4d4f('0x32')]=qs[_0x4d4f('0x32')](_0x41ffe7[_0x4d4f('0x45')]['limit']);_0x3ce5d8['offset']=qs[_0x4d4f('0x2f')](_0x41ffe7[_0x4d4f('0x45')][_0x4d4f('0x2f')]);}_0x3ce5d8[_0x4d4f('0x65')]=qs[_0x4d4f('0x4b')](_0x41ffe7[_0x4d4f('0x45')][_0x4d4f('0x4b')]);_0x3ce5d8[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4d')](_[_0x4d4f('0x66')](_0x41ffe7['query'],_0x575ad6[_0x4d4f('0x4d')]));_0x3ce5d8[_0x4d4f('0x4c')][_0x4d4f('0x67')]=_0x21046c['id'];if(_0x41ffe7[_0x4d4f('0x45')]['filter']){_0x3ce5d8['where']=_['merge'](_0x3ce5d8[_0x4d4f('0x4c')],{'$or':_['map'](_0x3ce5d8[_0x4d4f('0x47')],function(_0xb72faf){var _0xa63721={};_0xa63721[_0xb72faf]={'$like':'%'+_0x41ffe7[_0x4d4f('0x45')][_0x4d4f('0x4e')]+'%'};return _0xa63721;})});}_0x3ce5d8=_[_0x4d4f('0x4f')]({},_0x3ce5d8,_0x41ffe7[_0x4d4f('0x68')]);return db[_0x4d4f('0x63')]['count']({'where':_0x3ce5d8['where']})[_0x4d4f('0x23')](function(_0x59a813){_0x4952f0[_0x4d4f('0x31')]=_0x59a813;if(_0x41ffe7[_0x4d4f('0x45')][_0x4d4f('0x52')]){_0x3ce5d8['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3ce5d8);})[_0x4d4f('0x23')](function(_0x519779){_0x4952f0[_0x4d4f('0x55')]=_0x519779;return _0x4952f0;});}})['then'](respondWithFilteredResult(_0x4420f0,_0x3ce5d8))[_0x4d4f('0x56')](handleError(_0x4420f0,null));};exports[_0x4d4f('0x69')]=function(_0x1e8b6f,_0x251614,_0x348438){return db[_0x4d4f('0x3f')]['find']({'where':{'id':_0x1e8b6f[_0x4d4f('0x57')]['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x251614,null))[_0x4d4f('0x23')](function(_0x1f62e0){if(_0x1f62e0){return _0x1f62e0[_0x4d4f('0x69')](_0x1e8b6f['query'][_0x4d4f('0x6a')]);}})['then'](respondWithStatusCode(_0x251614,null))[_0x4d4f('0x56')](handleError(_0x251614,null));};exports[_0x4d4f('0x6b')]=function(_0x2511c8,_0x1b4c7a,_0x46fd1a){if(_0x2511c8[_0x4d4f('0x5f')]['id']){delete _0x2511c8[_0x4d4f('0x5f')]['id'];}return db['WhatsappAccount'][_0x4d4f('0x60')]({'where':{'id':_0x2511c8[_0x4d4f('0x57')]['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x1b4c7a,null))['then'](function(_0x16ad7a){if(_0x16ad7a){_0x2511c8['body'][_0x4d4f('0x67')]=_0x16ad7a['id'];return db['CannedAnswer'][_0x4d4f('0x58')](_0x2511c8[_0x4d4f('0x5f')]);}})[_0x4d4f('0x23')](respondWithResult(_0x1b4c7a,null))['catch'](handleError(_0x1b4c7a,null));};exports[_0x4d4f('0x6c')]=function(_0x1067a5,_0x26b157,_0x521d24){var _0x4d2b81={'raw':![],'where':{}};var _0x3d3697={};var _0x40e725={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x4d4f('0x62')]({'where':{'id':_0x1067a5[_0x4d4f('0x57')]['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x26b157,null))[_0x4d4f('0x23')](function(_0x4de18a){if(_0x4de18a){_0x3d3697[_0x4d4f('0x42')]=_['keys'](db[_0x4d4f('0x6d')][_0x4d4f('0x40')]);_0x3d3697['query']=_[_0x4d4f('0x44')](_0x1067a5[_0x4d4f('0x45')]);_0x3d3697[_0x4d4f('0x4d')]=_[_0x4d4f('0x46')](_0x3d3697[_0x4d4f('0x42')],_0x3d3697[_0x4d4f('0x45')]);_0x4d2b81[_0x4d4f('0x47')]=_[_0x4d4f('0x46')](_0x3d3697['model'],qs[_0x4d4f('0x48')](_0x1067a5[_0x4d4f('0x45')]['fields']));_0x4d2b81[_0x4d4f('0x47')]=_0x4d2b81['attributes'][_0x4d4f('0x49')]?_0x4d2b81['attributes']:_0x3d3697[_0x4d4f('0x42')];if(!_0x1067a5[_0x4d4f('0x45')][_0x4d4f('0x4a')](_0x4d4f('0x64'))){_0x4d2b81[_0x4d4f('0x32')]=qs[_0x4d4f('0x32')](_0x1067a5[_0x4d4f('0x45')][_0x4d4f('0x32')]);_0x4d2b81[_0x4d4f('0x2f')]=qs[_0x4d4f('0x2f')](_0x1067a5[_0x4d4f('0x45')][_0x4d4f('0x2f')]);}_0x4d2b81['order']=qs['sort'](_0x1067a5[_0x4d4f('0x45')]['sort']);_0x4d2b81[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4d')](_['pick'](_0x1067a5['query'],_0x3d3697[_0x4d4f('0x4d')]));_0x4d2b81[_0x4d4f('0x4c')][_0x4d4f('0x67')]=_0x4de18a['id'];if(_0x1067a5['query']['filter']){_0x4d2b81[_0x4d4f('0x4c')]=_[_0x4d4f('0x4f')](_0x4d2b81[_0x4d4f('0x4c')],{'$or':_[_0x4d4f('0x43')](_0x4d2b81['attributes'],function(_0x165d86){var _0x35fb03={};_0x35fb03[_0x165d86]={'$like':'%'+_0x1067a5[_0x4d4f('0x45')]['filter']+'%'};return _0x35fb03;})});}_0x4d2b81=_['merge']({},_0x4d2b81,_0x1067a5[_0x4d4f('0x68')]);return db[_0x4d4f('0x6d')][_0x4d4f('0x31')]({'where':_0x4d2b81[_0x4d4f('0x4c')]})[_0x4d4f('0x23')](function(_0x5580ef){_0x40e725[_0x4d4f('0x31')]=_0x5580ef;if(_0x1067a5[_0x4d4f('0x45')][_0x4d4f('0x52')]){_0x4d2b81['include']=[{'all':!![]}];}return db[_0x4d4f('0x6d')]['findAll'](_0x4d2b81);})[_0x4d4f('0x23')](function(_0x2e4015){_0x40e725[_0x4d4f('0x55')]=_0x2e4015;return _0x40e725;});}})[_0x4d4f('0x23')](respondWithFilteredResult(_0x26b157,_0x4d2b81))[_0x4d4f('0x56')](handleError(_0x26b157,null));};exports['removeAnswers']=function(_0x45f38c,_0x3603b7,_0x3f0fc4){return db[_0x4d4f('0x3f')]['find']({'where':{'id':_0x45f38c[_0x4d4f('0x57')]['id']}})['then'](handleEntityNotFound(_0x3603b7,null))['then'](function(_0x2c4c00){if(_0x2c4c00){return _0x2c4c00[_0x4d4f('0x6e')](_0x45f38c['query'][_0x4d4f('0x6a')]);}})['then'](respondWithStatusCode(_0x3603b7,null))[_0x4d4f('0x56')](handleError(_0x3603b7,null));};exports[_0x4d4f('0x6f')]=function(_0x2b403b,_0x1c96ee,_0x144c00){return db[_0x4d4f('0x3f')][_0x4d4f('0x60')]({'where':{'id':_0x2b403b[_0x4d4f('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c96ee,null))[_0x4d4f('0x23')](function(_0x166615){if(_0x166615){return _0x166615['addAgents'](_0x2b403b[_0x4d4f('0x5f')]['ids'],_[_0x4d4f('0x70')](_0x2b403b[_0x4d4f('0x5f')],[_0x4d4f('0x6a'),'id'])||{})['spread'](function(_0x5825bf){for(var _0x482735=0x0;_0x482735<_0x2b403b[_0x4d4f('0x5f')]['ids'][_0x4d4f('0x49')];_0x482735+=0x1){socket[_0x4d4f('0x71')](_0x4d4f('0x72'),{'UserId':Number(_0x2b403b['body']['ids'][_0x482735]),'WhatsappAccountId':Number(_0x2b403b[_0x4d4f('0x57')]['id'])});}return _0x5825bf;});}})[_0x4d4f('0x23')](respondWithResult(_0x1c96ee,null))[_0x4d4f('0x56')](handleError(_0x1c96ee,null));};exports[_0x4d4f('0x73')]=function(_0x3f437c,_0x13279e,_0x576769){return db[_0x4d4f('0x3f')][_0x4d4f('0x60')]({'where':{'id':_0x3f437c[_0x4d4f('0x57')]['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x13279e,null))[_0x4d4f('0x23')](function(_0x1b8083){if(_0x1b8083){return _0x1b8083[_0x4d4f('0x73')](_0x3f437c[_0x4d4f('0x45')][_0x4d4f('0x6a')])[_0x4d4f('0x23')](function(){if(_[_0x4d4f('0x74')](_0x3f437c[_0x4d4f('0x45')][_0x4d4f('0x6a')])){for(var _0x175d1a=0x0;_0x175d1a<_0x3f437c['query'][_0x4d4f('0x6a')][_0x4d4f('0x49')];_0x175d1a+=0x1){socket[_0x4d4f('0x71')](_0x4d4f('0x75'),{'UserId':Number(_0x3f437c[_0x4d4f('0x45')][_0x4d4f('0x6a')][_0x175d1a]),'WhatsappAccountId':Number(_0x3f437c[_0x4d4f('0x57')]['id'])});}}else{socket[_0x4d4f('0x71')](_0x4d4f('0x75'),{'UserId':Number(_0x3f437c['query'][_0x4d4f('0x6a')]),'WhatsappAccountId':Number(_0x3f437c[_0x4d4f('0x57')]['id'])});}});}})[_0x4d4f('0x23')](respondWithStatusCode(_0x13279e,null))[_0x4d4f('0x56')](handleError(_0x13279e,null));};exports[_0x4d4f('0x76')]=function(_0xd22d78,_0x28c128,_0x28fd35){var _0x18206d={};var _0x2536e0={};var _0x5c3e11;var _0x5ea69b;return db[_0x4d4f('0x3f')][_0x4d4f('0x62')]({'where':{'id':_0xd22d78['params']['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x28c128,null))[_0x4d4f('0x23')](function(_0x61d008){if(_0x61d008){_0x5c3e11=_0x61d008;_0x2536e0[_0x4d4f('0x42')]=_[_0x4d4f('0x44')](db[_0x4d4f('0x77')][_0x4d4f('0x40')]);_0x2536e0[_0x4d4f('0x45')]=_[_0x4d4f('0x44')](_0xd22d78[_0x4d4f('0x45')]);_0x2536e0[_0x4d4f('0x4d')]=_[_0x4d4f('0x46')](_0x2536e0[_0x4d4f('0x42')],_0x2536e0[_0x4d4f('0x45')]);_0x18206d['attributes']=_[_0x4d4f('0x46')](_0x2536e0['model'],qs[_0x4d4f('0x48')](_0xd22d78[_0x4d4f('0x45')][_0x4d4f('0x48')]));_0x18206d[_0x4d4f('0x47')]=_0x18206d['attributes'][_0x4d4f('0x49')]?_0x18206d[_0x4d4f('0x47')]:_0x2536e0[_0x4d4f('0x42')];_0x18206d[_0x4d4f('0x65')]=qs[_0x4d4f('0x4b')](_0xd22d78[_0x4d4f('0x45')][_0x4d4f('0x4b')]);_0x18206d['where']=qs[_0x4d4f('0x4d')](_[_0x4d4f('0x66')](_0xd22d78[_0x4d4f('0x45')],_0x2536e0[_0x4d4f('0x4d')]));if(_0xd22d78[_0x4d4f('0x45')][_0x4d4f('0x4e')]){_0x18206d['where']=_['merge'](_0x18206d[_0x4d4f('0x4c')],{'$or':_['map'](_0x18206d[_0x4d4f('0x47')],function(_0x8be4b2){var _0x5df38e={};_0x5df38e[_0x8be4b2]={'$like':'%'+_0xd22d78[_0x4d4f('0x45')][_0x4d4f('0x4e')]+'%'};return _0x5df38e;})});}_0x18206d=_[_0x4d4f('0x4f')]({},_0x18206d,_0xd22d78[_0x4d4f('0x68')]);return _0x5c3e11[_0x4d4f('0x76')](_0x18206d);}})[_0x4d4f('0x23')](function(_0x94c7db){if(_0x94c7db){_0x5ea69b=_0x94c7db['length'];if(!_0xd22d78[_0x4d4f('0x45')]['hasOwnProperty'](_0x4d4f('0x64'))){_0x18206d[_0x4d4f('0x32')]=qs['limit'](_0xd22d78['query'][_0x4d4f('0x32')]);_0x18206d[_0x4d4f('0x2f')]=qs[_0x4d4f('0x2f')](_0xd22d78['query'][_0x4d4f('0x2f')]);}return _0x5c3e11[_0x4d4f('0x76')](_0x18206d);}})[_0x4d4f('0x23')](function(_0x3f21e7){if(_0x3f21e7){return _0x3f21e7?{'count':_0x5ea69b,'rows':_0x3f21e7}:null;}})[_0x4d4f('0x23')](respondWithResult(_0x28c128,null))[_0x4d4f('0x56')](handleError(_0x28c128,null));};exports[_0x4d4f('0x78')]=function(_0x175011,_0x27fd1e){var _0x51e70f=_0x175011[_0x4d4f('0x57')]['id'];var _0x46f316=_0x175011[_0x4d4f('0x5f')];var _0x148ecd=0xc8;var _0x501118=null;return db[_0x4d4f('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0x4d4f('0x7a')][_0x4d4f('0x7b')][_0x4d4f('0x7c')]},function(_0x3de9b3){return db[_0x4d4f('0x3f')][_0x4d4f('0x62')]({'where':{'id':_0x51e70f},'transaction':_0x3de9b3})[_0x4d4f('0x23')](function(_0x16001e){if(_0x16001e){return db[_0x4d4f('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x51e70f},'transaction':_0x3de9b3})[_0x4d4f('0x23')](function(){var _0x5683a0=_[_0x4d4f('0x43')](_0x46f316,function(_0x1a6e96){_0x1a6e96[_0x4d4f('0x67')]=_0x51e70f;return _0x1a6e96;});return db[_0x4d4f('0x7d')][_0x4d4f('0x7e')](_0x5683a0,{'transaction':_0x3de9b3});});}else{_0x148ecd=0x194;_0x501118=[];}});})[_0x4d4f('0x23')](function(){if(_0x148ecd!==0x194){return db[_0x4d4f('0x7d')][_0x4d4f('0x7f')]({'where':{'WhatsappAccountId':_0x51e70f},'order':_0x4d4f('0x80')})[_0x4d4f('0x23')](function(_0x1f30c8){_0x501118=_0x1f30c8;});}})['catch'](function(_0x1dad7e){_0x148ecd=0x1f4;logger[_0x4d4f('0x26')](_0x1dad7e['stack']);if(_0x1dad7e[_0x4d4f('0x3a')]){delete _0x1dad7e[_0x4d4f('0x3a')];}_0x501118=_0x1dad7e;})[_0x4d4f('0x81')](function(){if(_0x501118===null){_0x27fd1e[_0x4d4f('0x2b')](_0x148ecd);}else{if(_0x148ecd===0x1f4){_0x27fd1e[_0x4d4f('0x2c')](_0x148ecd)[_0x4d4f('0x3b')](_0x501118);}else{_0x27fd1e['status'](_0x148ecd)[_0x4d4f('0x2e')](_0x501118);}}});};exports[_0x4d4f('0x82')]=function(_0x25dde9,_0x4dc09d,_0x122b70){var _0x4306d2={};var _0x4b9102={};var _0x4f84f5;var _0x35768e;return db['WhatsappAccount'][_0x4d4f('0x62')]({'where':{'id':_0x25dde9[_0x4d4f('0x57')]['id']}})[_0x4d4f('0x23')](handleEntityNotFound(_0x4dc09d,null))[_0x4d4f('0x23')](function(_0x361da6){if(_0x361da6){_0x4f84f5=_0x361da6;_0x4b9102[_0x4d4f('0x42')]=_[_0x4d4f('0x44')](db['WhatsappApplication'][_0x4d4f('0x40')]);_0x4b9102['query']=_[_0x4d4f('0x44')](_0x25dde9[_0x4d4f('0x45')]);_0x4b9102['filters']=_['intersection'](_0x4b9102[_0x4d4f('0x42')],_0x4b9102['query']);_0x4306d2['attributes']=_['intersection'](_0x4b9102[_0x4d4f('0x42')],qs[_0x4d4f('0x48')](_0x25dde9['query']['fields']));_0x4306d2[_0x4d4f('0x47')]=_0x4306d2[_0x4d4f('0x47')][_0x4d4f('0x49')]?_0x4306d2[_0x4d4f('0x47')]:_0x4b9102[_0x4d4f('0x42')];_0x4306d2[_0x4d4f('0x65')]=qs[_0x4d4f('0x4b')](_0x25dde9[_0x4d4f('0x45')][_0x4d4f('0x4b')]);_0x4306d2[_0x4d4f('0x4c')]=qs[_0x4d4f('0x4d')](_[_0x4d4f('0x66')](_0x25dde9['query'],_0x4b9102[_0x4d4f('0x4d')]));if(_0x25dde9[_0x4d4f('0x45')][_0x4d4f('0x4e')]){_0x4306d2[_0x4d4f('0x4c')]=_[_0x4d4f('0x4f')](_0x4306d2['where'],{'$or':_['map'](_0x4306d2['attributes'],function(_0x1d34b9){var _0x57fb0d={};_0x57fb0d[_0x1d34b9]={'$like':'%'+_0x25dde9[_0x4d4f('0x45')][_0x4d4f('0x4e')]+'%'};return _0x57fb0d;})});}_0x4306d2=_[_0x4d4f('0x4f')]({},_0x4306d2,_0x25dde9[_0x4d4f('0x68')]);return _0x4f84f5[_0x4d4f('0x82')](_0x4306d2);}})[_0x4d4f('0x23')](function(_0x53f116){if(_0x53f116){_0x35768e=_0x53f116[_0x4d4f('0x49')];if(!_0x25dde9[_0x4d4f('0x45')][_0x4d4f('0x4a')](_0x4d4f('0x64'))){_0x4306d2[_0x4d4f('0x32')]=qs[_0x4d4f('0x32')](_0x25dde9['query']['limit']);_0x4306d2[_0x4d4f('0x2f')]=qs['offset'](_0x25dde9[_0x4d4f('0x45')][_0x4d4f('0x2f')]);}return _0x4f84f5[_0x4d4f('0x82')](_0x4306d2);}})[_0x4d4f('0x23')](function(_0x52996d){if(_0x52996d){return _0x52996d?{'count':_0x35768e,'rows':_0x52996d}:null;}})['then'](respondWithResult(_0x4dc09d,null))['catch'](handleError(_0x4dc09d,null));};exports[_0x4d4f('0x83')]=function(_0x5bd0fb,_0x3684ab,_0x42e132){var _0x5d9453={'channel':'whatsapp'};var _0x151346=[];var _0x33c4dd=[];var _0xfce03b={};return db[_0x4d4f('0x3f')]['find']({'where':{'id':_0x5bd0fb[_0x4d4f('0x57')]['id']},'include':[{'model':db[_0x4d4f('0x7d')],'as':'Applications'}]})[_0x4d4f('0x23')](handleEntityNotFound(_0x3684ab,null))[_0x4d4f('0x23')](function(_0x283a1a){_0x5d9453[_0x4d4f('0x84')]=_0x283a1a;if(_0x5d9453[_0x4d4f('0x84')]&&_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0x50')]===_0x4d4f('0x85')&&_0x5bd0fb['body']['statuses']){if(_0x5bd0fb[_0x4d4f('0x5f')][_0x4d4f('0x86')][_0x4d4f('0x49')]===0x0)return;if(_0x5bd0fb[_0x4d4f('0x5f')][_0x4d4f('0x86')][0x0][_0x4d4f('0x87')]!==_0x4d4f('0x88'))return;return db[_0x4d4f('0x89')][_0x4d4f('0x35')]({'read':!![],'readAt':_0x5bd0fb[_0x4d4f('0x5f')][_0x4d4f('0x86')][0x0][_0x4d4f('0x8a')]},{'where':{'messageId':_0x5bd0fb['body'][_0x4d4f('0x86')][0x0]['message_id']},'individualHooks':!![]})[_0x4d4f('0x23')](function(_0x169767){return _0x3684ab[_0x4d4f('0x2c')](0xc8)[_0x4d4f('0x2e')](_0x169767);});}_0x5d9453['applications']=_[_0x4d4f('0x8b')](_0x283a1a[_0x4d4f('0x8c')],['priority'],[_0x4d4f('0x8d')]);if(_0x5d9453['account'][_0x4d4f('0x8c')]){delete _0x5d9453[_0x4d4f('0x84')]['Applications'];}return db[_0x4d4f('0x8e')][_0x4d4f('0x61')]()[_0x4d4f('0x23')](function(_0x3cdc9f){if(!_0x3cdc9f){throw new db[(_0x4d4f('0x8f'))]['ValidationError'](_0x4d4f('0x90'));}_0x151346=_['difference'](_[_0x4d4f('0x44')](_0x3cdc9f),[_0x4d4f('0x91'),_0x4d4f('0x92')]);_0x33c4dd=_[_0x4d4f('0x93')](_[_0x4d4f('0x44')](_0x3cdc9f),[_0x4d4f('0x91'),'updatedAt',_0x4d4f('0x94'),'ListId']);_0x5d9453['body']={'mapKey':'mobile'};if(_0x5d9453[_0x4d4f('0x84')]&&_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0x50')]===_0x4d4f('0x95')){_0x5d9453['body']['from']=_0x5bd0fb['body'][_0x4d4f('0x96')]['replace'](_0x4d4f('0x97'),'');_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x5f')]=_0x5bd0fb['body']['Body'];_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x98')]=_0x5bd0fb[_0x4d4f('0x5f')]['MessageSid'];}if(_0x5d9453[_0x4d4f('0x84')]&&_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0x50')]===_0x4d4f('0x85')){_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x99')]=_0x5bd0fb['body'][_0x4d4f('0x9a')][0x0]['from'];_0x5d9453['body']['body']=_0x5bd0fb[_0x4d4f('0x5f')][_0x4d4f('0x9a')][0x0]['message'][_0x4d4f('0x5f')];_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x98')]=_0x5bd0fb[_0x4d4f('0x5f')][_0x4d4f('0x9a')][0x0][_0x4d4f('0x9b')];}if(_0x5d9453[_0x4d4f('0x5f')]['id']){delete _0x5d9453['body']['id'];}if(_[_0x4d4f('0x9c')](_0x5d9453[_0x4d4f('0x5f')]['from'])){throw new db[(_0x4d4f('0x8f'))][(_0x4d4f('0x9d'))](_0x4d4f('0x9e'));}if(_[_0x4d4f('0x9c')](_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x5f')])||_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x5f')]===''){throw new db['Sequelize'][(_0x4d4f('0x9d'))](_0x4d4f('0x9f'));}if(_[_0x4d4f('0x9c')](_0x5d9453[_0x4d4f('0x5f')]['mapKey'])){throw new db[(_0x4d4f('0x8f'))][(_0x4d4f('0x9d'))](_0x4d4f('0xa0')+_0x33c4dd);}if(!_[_0x4d4f('0xa1')](_0x33c4dd,_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0xa2')])){throw new db[(_0x4d4f('0x8f'))][(_0x4d4f('0x9d'))](_0x4d4f('0xa3')+_0x33c4dd);}_0xfce03b[_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0xa2')]]=_0x5d9453['body'][_0x4d4f('0x99')];return db[_0x4d4f('0xa4')][_0x4d4f('0x60')]({'where':{'id':_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0xa5')]},'include':[{'model':db[_0x4d4f('0x8e')],'as':_0x4d4f('0xa6'),'where':_0xfce03b,'limit':0x1,'order':[[_0x4d4f('0x92'),_0x4d4f('0xa7')]]}]});})[_0x4d4f('0x23')](handleEntityNotFound(_0x3684ab,null))[_0x4d4f('0x23')](function(_0x54b8c5){if(_0x54b8c5){_0x5d9453[_0x4d4f('0xa8')]=_[_0x4d4f('0x70')](_0x54b8c5,[_0x4d4f('0xa6')]);if(_0x54b8c5[_0x4d4f('0xa6')][_0x4d4f('0x49')]){return _0x54b8c5[_0x4d4f('0xa6')][0x0];}var _0x3a9b0f=_[_0x4d4f('0xa9')](_0x5d9453[_0x4d4f('0x5f')],{'firstName':_0x5d9453[_0x4d4f('0x5f')]['from'],'ListId':_0x54b8c5['id']});_0x3a9b0f[_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0xa2')]]=_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x99')];return db[_0x4d4f('0x8e')][_0x4d4f('0x58')](_0x3a9b0f,{'fields':_0x151346,'raw':!![]});}})['then'](handleEntityNotFound(_0x3684ab,null))[_0x4d4f('0x23')](function(_0x1dcfb5){if(_0x1dcfb5){_0x5d9453[_0x4d4f('0xaa')]=_0x1dcfb5;var _0x3109fe={'ContactId':_0x1dcfb5['id'],'phone':_0x5d9453[_0x4d4f('0x5f')]['from'],'WhatsappAccountId':_0x5bd0fb[_0x4d4f('0x57')]['id']};var _0x32a519={'ContactId':_0x1dcfb5['id'],'WhatsappAccountId':_0x5bd0fb[_0x4d4f('0x57')]['id'],'closed':![]};return db[_0x4d4f('0xab')][_0x4d4f('0x60')]({'where':_0x32a519})[_0x4d4f('0x23')](function(_0x3369fe){if(_0x3369fe){return[_0x3369fe,![]];}return db['WhatsappInteraction'][_0x4d4f('0x58')](_0x3109fe)[_0x4d4f('0x23')](function(_0x1e7cca){return[_0x1e7cca,!![]];});});}})[_0x4d4f('0xac')](function(_0x399c91,_0x314578){_0x5d9453[_0x4d4f('0xad')]=_0x399c91['get']({'plain':!![]});_0x5d9453[_0x4d4f('0xad')]['created']=![];if(_0x314578){if(_0x5d9453[_0x4d4f('0x84')]['autoclose']){_0x5d9453[_0x4d4f('0xae')][_0x4d4f('0xaf')]({'id':0x0,'priority':_0x5d9453[_0x4d4f('0xae')][_0x4d4f('0x49')]+0x1,'app':_0x4d4f('0xb0'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x5d9453[_0x4d4f('0xad')][_0x4d4f('0xb1')]=!![];}return db[_0x4d4f('0x89')][_0x4d4f('0x58')]({'phone':_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x99')],'messageId':_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x98')],'body':_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0x5f')],'WhatsappAccountId':_0x5bd0fb[_0x4d4f('0x57')]['id'],'WhatsappInteractionId':_0x399c91['id'],'direction':'in','ContactId':_0x399c91[_0x4d4f('0xb2')],'AttachmentId':_0x5d9453[_0x4d4f('0x5f')][_0x4d4f('0xb3')]});})['then'](function(_0x2127aa){_0x5d9453[_0x4d4f('0x28')]=_0x2127aa;if(!_0x5d9453[_0x4d4f('0xad')][_0x4d4f('0xb4')])return;return db[_0x4d4f('0x77')]['find']({'attributes':['id',_0x4d4f('0x3a')],'where':{'id':_0x5d9453['interaction']['UserId']}});})[_0x4d4f('0x23')](function(_0x16f456){if(_0x16f456){_0x5d9453[_0x4d4f('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x16f456[_0x4d4f('0x3a')]+','+(_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0xb5')]||0xa),'interval':_0x4d4f('0xb6')});}if(!_0x5d9453[_0x4d4f('0xad')][_0x4d4f('0xb7')])return;return db[_0x4d4f('0xb8')][_0x4d4f('0x60')]({'attributes':['id',_0x4d4f('0x3a')],'where':{'id':_0x5d9453[_0x4d4f('0xad')][_0x4d4f('0xb7')]}});})['then'](function(_0x2298c5){if(_0x2298c5){_0x5d9453[_0x4d4f('0xae')][_0x4d4f('0xb9')]({'id':0x0,'priority':0x1,'app':_0x4d4f('0xba'),'appdata':_0x2298c5[_0x4d4f('0x3a')]+','+(_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0xbb')]||0x12c),'interval':_0x4d4f('0xb6')});}return respondWithRpcPromise(_0x4d4f('0xbc'),_0x4d4f('0xbd'),_0x5d9453);})[_0x4d4f('0x23')](function(_0xbc16fd){if(_0xbc16fd){var _0x3951d6=0xc8;var _0x59b209='receiveMessage';logger[_0x4d4f('0x29')](_0x4d4f('0xbe'),_0x59b209,_0x3951d6,_0x4d4f('0xbf'));logger['debug'](_0x4d4f('0xc0'),_0x59b209,_0x3951d6,_0x4d4f('0xbf'),JSON[_0x4d4f('0x25')](_0xbc16fd));if(_0x5d9453[_0x4d4f('0x84')][_0x4d4f('0x50')]===_0x4d4f('0x95')){return _0x3684ab['status'](_0x3951d6)[_0x4d4f('0x33')](_0x4d4f('0xc1'),_0x4d4f('0xc2'))['send']('\x0a');}else{return _0x3684ab[_0x4d4f('0x2c')](_0x3951d6)[_0x4d4f('0x2e')](_0xbc16fd);}}});})['catch'](handleError(_0x3684ab,null));};exports['send']=function(_0x5d84b6,_0x17c57e,_0x314c4c){var _0x44ab3f,_0x115433,_0x59d897;if(_[_0x4d4f('0x9c')](_0x5d84b6['body'][_0x4d4f('0x5f')])||_0x5d84b6['body']['body']===''){throw new db[(_0x4d4f('0x8f'))]['ValidationError'](_0x4d4f('0x9f'));}if(_[_0x4d4f('0x9c')](_0x5d84b6[_0x4d4f('0x5f')]['to'])){throw new db[(_0x4d4f('0x8f'))][(_0x4d4f('0x9d'))](_0x4d4f('0xc3'));}_0x44ab3f=_0x5d84b6[_0x4d4f('0x5f')]['to'];return db[_0x4d4f('0x3f')]['find']({'where':{'id':_0x5d84b6[_0x4d4f('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x4d4f('0xc4'),'include':[{'model':db[_0x4d4f('0x8e')],'as':_0x4d4f('0xa6'),'where':{'mobile':_0x44ab3f},'limit':0x1,'order':[[_0x4d4f('0x92'),_0x4d4f('0xa7')]]}]}]})[_0x4d4f('0x23')](handleEntityNotFound(_0x17c57e,null))['then'](function(_0x47991d){if(_0x47991d&&_0x47991d[_0x4d4f('0xc4')]){_0x115433=_0x47991d[_0x4d4f('0x37')]({'plain':!![]});if(_0x115433[_0x4d4f('0xc4')]&&_0x115433[_0x4d4f('0xc4')]['Contacts'][_0x4d4f('0x49')]){return _0x115433[_0x4d4f('0xc4')][_0x4d4f('0xa6')][0x0];}return db['CmContact']['create'](_[_0x4d4f('0xa9')](_0x5d84b6[_0x4d4f('0x5f')],{'firstName':_0x44ab3f,'mobile':_0x44ab3f,'phone':_0x44ab3f,'ListId':_0x115433[_0x4d4f('0xa5')]}));}})[_0x4d4f('0x23')](handleEntityNotFound(_0x17c57e,null))['then'](function(_0x538cd7){if(_0x538cd7){_0x59d897=_0x538cd7;return db[_0x4d4f('0xab')]['find']({'where':{'ContactId':_0x59d897['id'],'closed':![],'WhatsappAccountId':_0x115433['id']}})[_0x4d4f('0x23')](function(_0x3f233c){if(_0x3f233c){return[_0x3f233c,![]];}return db[_0x4d4f('0xab')][_0x4d4f('0x58')]({'UserId':_0x5d84b6[_0x4d4f('0x59')]['id'],'ContactId':_0x59d897['id'],'WhatsappAccountId':_0x115433['id'],'phone':_0x44ab3f,'firstMsgDirection':_0x4d4f('0xc5'),'Messages':[_['merge'](_0x5d84b6[_0x4d4f('0x5f')],{'read':![],'body':_0x5d84b6[_0x4d4f('0x5f')]['body'],'phone':_0x44ab3f,'WhatsappAccountId':_0x115433['id'],'UserId':_0x5d84b6[_0x4d4f('0x59')]['id'],'ContactId':_0x59d897['id']})]},{'include':[{'model':db[_0x4d4f('0x89')],'as':'Messages'}]})[_0x4d4f('0x23')](function(_0x585842){return[_0x585842,!![]];});});}})[_0x4d4f('0xac')](function(_0x1b6539,_0x4cd4ac){if(_0x4cd4ac){return _0x1b6539;}return db[_0x4d4f('0x89')]['create'](_[_0x4d4f('0x4f')](_0x5d84b6[_0x4d4f('0x5f')],{'read':![],'body':_0x5d84b6['body'][_0x4d4f('0x5f')],'phone':_0x44ab3f,'WhatsappAccountId':_0x115433['id'],'WhatsappInteractionId':_0x1b6539['id'],'UserId':_0x5d84b6[_0x4d4f('0x59')]['id'],'ContactId':_0x59d897['id']}))['then'](function(_0x5ea5f9){_0x1b6539[_0x4d4f('0xc6')][_0x4d4f('0xc7')]=[];_0x1b6539[_0x4d4f('0xc6')]['Messages'][_0x4d4f('0xaf')](_0x5ea5f9[_0x4d4f('0xc6')]);return _0x1b6539;});})[_0x4d4f('0x23')](respondWithResult(_0x17c57e,null))[_0x4d4f('0x56')](handleError(_0x17c57e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 752a03a..64a55fb 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 _0x475a=['emit','hook','exports','events','../../mysqldb','WhatsappAccount','save','update'];(function(_0x43e199,_0x369b43){var _0x26c476=function(_0x3d157c){while(--_0x3d157c){_0x43e199['push'](_0x43e199['shift']());}};_0x26c476(++_0x369b43);}(_0x475a,0xbb));var _0xa475=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x475a[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xa475('0x0'));var WhatsappAccount=require(_0xa475('0x1'))['db'][_0xa475('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa475('0x3'),'afterUpdate':_0xa475('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5daa2c){return function(_0x19c83e,_0x4eda08,_0x33c119){WhatsappAccountEvents['emit'](_0x5daa2c+':'+_0x19c83e['id'],_0x19c83e);WhatsappAccountEvents[_0xa475('0x5')](_0x5daa2c,_0x19c83e);_0x33c119(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xa475('0x6')](e,emitEvent(event));}}module[_0xa475('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x15e2=['hasOwnProperty','hook','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x525308,_0x5898c9){var _0x5a6e40=function(_0x113c37){while(--_0x113c37){_0x525308['push'](_0x525308['shift']());}};_0x5a6e40(++_0x5898c9);}(_0x15e2,0xa2));var _0x215e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x15e2[_0x710815];return _0x5b3b89;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x215e('0x0'))['db'][_0x215e('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x215e('0x2')](0x0);var events={'afterCreate':_0x215e('0x3'),'afterUpdate':_0x215e('0x4'),'afterDestroy':_0x215e('0x5')};function emitEvent(_0x45c1de){return function(_0x29f9fd,_0x17c4f2,_0x2138f5){WhatsappAccountEvents['emit'](_0x45c1de+':'+_0x29f9fd['id'],_0x29f9fd);WhatsappAccountEvents['emit'](_0x45c1de,_0x29f9fd);_0x2138f5(null);};}for(var e in events){if(events[_0x215e('0x6')](e)){var event=events[e];WhatsappAccount[_0x215e('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index bc66f56..6d06ddc 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 _0x6944=['exports','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x25a136,_0x57320e){var _0x5b7159=function(_0x32c8f9){while(--_0x32c8f9){_0x25a136['push'](_0x25a136['shift']());}};_0x5b7159(++_0x57320e);}(_0x6944,0x153));var _0x4694=function(_0x4573bd,_0x19b9b5){_0x4573bd=_0x4573bd-0x0;var _0xc07bb9=_0x6944[_0x4573bd];return _0xc07bb9;};'use strict';var _=require(_0x4694('0x0'));var util=require(_0x4694('0x1'));var logger=require(_0x4694('0x2'))(_0x4694('0x3'));var moment=require(_0x4694('0x4'));var BPromise=require(_0x4694('0x5'));var rp=require(_0x4694('0x6'));var fs=require('fs');var path=require(_0x4694('0x7'));var rimraf=require(_0x4694('0x8'));var config=require(_0x4694('0x9'));var attributes=require(_0x4694('0xa'));module[_0x4694('0xb')]=function(_0x6540e5,_0x1f04f4){return _0x6540e5[_0x4694('0xc')]('WhatsappAccount',attributes,{'tableName':_0x4694('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c18=['path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','api','moment','bluebird','request-promise'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x4c18,0x146));var _0x84c1=function(_0x51f405,_0x1dfde2){_0x51f405=_0x51f405-0x0;var _0x21a247=_0x4c18[_0x51f405];return _0x21a247;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x84c1('0x0'));var moment=require(_0x84c1('0x1'));var BPromise=require(_0x84c1('0x2'));var rp=require(_0x84c1('0x3'));var fs=require('fs');var path=require(_0x84c1('0x4'));var rimraf=require(_0x84c1('0x5'));var config=require(_0x84c1('0x6'));var attributes=require(_0x84c1('0x7'));module[_0x84c1('0x8')]=function(_0x147e90,_0x198b29){return _0x147e90[_0x84c1('0x9')]('WhatsappAccount',attributes,{'tableName':_0x84c1('0xa'),'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 25e74c3..38ab6c4 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 _0xf3ca=['request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ShowWhatsappAccount','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','WhatsappAccount,\x20%s,\x20%s'];(function(_0x495d3e,_0x3480bf){var _0x361aa9=function(_0x1daeae){while(--_0x1daeae){_0x495d3e['push'](_0x495d3e['shift']());}};_0x361aa9(++_0x3480bf);}(_0xf3ca,0x1da));var _0xaf3c=function(_0x5daf8f,_0x307436){_0x5daf8f=_0x5daf8f-0x0;var _0x59a139=_0xf3ca[_0x5daf8f];return _0x59a139;};'use strict';var _=require(_0xaf3c('0x0'));var util=require(_0xaf3c('0x1'));var moment=require(_0xaf3c('0x2'));var BPromise=require(_0xaf3c('0x3'));var rs=require(_0xaf3c('0x4'));var fs=require('fs');var Redis=require(_0xaf3c('0x5'));var db=require(_0xaf3c('0x6'))['db'];var utils=require(_0xaf3c('0x7'));var logger=require(_0xaf3c('0x8'))(_0xaf3c('0x9'));var config=require(_0xaf3c('0xa'));var jayson=require(_0xaf3c('0xb'));var client=jayson[_0xaf3c('0xc')][_0xaf3c('0xd')]({'port':0x232a});config[_0xaf3c('0xe')]=_['defaults'](config['redis'],{'host':_0xaf3c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf3c('0xe')]));require('./whatsappAccount.socket')[_0xaf3c('0x10')](socket);function respondWithRpcPromise(_0x145d1f,_0x3004ef,_0x34bed8){return new BPromise(function(_0x7bf490,_0x57d61d){return client[_0xaf3c('0x11')](_0x145d1f,_0x34bed8)[_0xaf3c('0x12')](function(_0x5a7a9f){logger['info'](_0xaf3c('0x13'),_0x3004ef,_0xaf3c('0x14'));logger[_0xaf3c('0x15')](_0xaf3c('0x16'),_0x3004ef,'request\x20sent',JSON['stringify'](_0x5a7a9f));if(_0x5a7a9f[_0xaf3c('0x17')]){if(_0x5a7a9f[_0xaf3c('0x17')][_0xaf3c('0x18')]===0x1f4){logger[_0xaf3c('0x17')](_0xaf3c('0x13'),_0x3004ef,_0x5a7a9f['error'][_0xaf3c('0x19')]);return _0x57d61d(_0x5a7a9f[_0xaf3c('0x17')]['message']);}logger['error'](_0xaf3c('0x13'),_0x3004ef,_0x5a7a9f[_0xaf3c('0x17')][_0xaf3c('0x19')]);return _0x7bf490(_0x5a7a9f[_0xaf3c('0x17')][_0xaf3c('0x19')]);}else{logger[_0xaf3c('0x1a')](_0xaf3c('0x13'),_0x3004ef,_0xaf3c('0x14'));_0x7bf490(_0x5a7a9f[_0xaf3c('0x1b')][_0xaf3c('0x19')]);}})['catch'](function(_0x31c1cd){logger[_0xaf3c('0x17')](_0xaf3c('0x13'),_0x3004ef,_0x31c1cd);_0x57d61d(_0x31c1cd);});});}exports[_0xaf3c('0x1c')]=function(_0x30e292){var _0x42b440=this;return new Promise(function(_0x2d6041,_0x498198){return db['WhatsappAccount']['find']({'raw':_0x30e292[_0xaf3c('0x1d')]?_0x30e292[_0xaf3c('0x1d')][_0xaf3c('0x1e')]===undefined?!![]:![]:!![],'where':_0x30e292[_0xaf3c('0x1d')]?_0x30e292[_0xaf3c('0x1d')][_0xaf3c('0x1f')]||null:null,'attributes':_0x30e292['options']?_0x30e292[_0xaf3c('0x1d')][_0xaf3c('0x20')]||null:null,'include':_0x30e292[_0xaf3c('0x1d')]?_0x30e292[_0xaf3c('0x1d')][_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0x30e292[_0xaf3c('0x1d')][_0xaf3c('0x21')],function(_0x1dca88){return{'model':db[_0x1dca88[_0xaf3c('0x23')]],'as':_0x1dca88['as'],'attributes':_0x1dca88[_0xaf3c('0x20')],'include':_0x1dca88[_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0x1dca88[_0xaf3c('0x21')],function(_0x51513c){return{'model':db[_0x51513c[_0xaf3c('0x23')]],'as':_0x51513c['as'],'attributes':_0x51513c[_0xaf3c('0x20')],'include':_0x51513c[_0xaf3c('0x21')]?_[_0xaf3c('0x22')](_0x51513c['include'],function(_0x679d2c){return{'model':db[_0x679d2c[_0xaf3c('0x23')]],'as':_0x679d2c['as'],'attributes':_0x679d2c[_0xaf3c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29d50b){logger[_0xaf3c('0x1a')](_0xaf3c('0x1c'),_0x30e292);logger[_0xaf3c('0x15')](_0xaf3c('0x1c'),_0x30e292,JSON[_0xaf3c('0x24')](_0x29d50b));_0x2d6041(_0x29d50b);})[_0xaf3c('0x25')](function(_0x350359){logger['error'](_0xaf3c('0x1c'),_0x350359[_0xaf3c('0x19')],_0x30e292);_0x498198(_0x42b440[_0xaf3c('0x17')](0x1f4,_0x350359[_0xaf3c('0x19')]));});});}; \ No newline at end of file +var _0xc90c=['attributes','include','map','model','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','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','raw','where'];(function(_0x142a3a,_0x1a38de){var _0x162388=function(_0x9c7868){while(--_0x9c7868){_0x142a3a['push'](_0x142a3a['shift']());}};_0x162388(++_0x1a38de);}(_0xc90c,0x1a6));var _0xcc90=function(_0x48fc87,_0x86d924){_0x48fc87=_0x48fc87-0x0;var _0x3f873e=_0xc90c[_0x48fc87];return _0x3f873e;};'use strict';var _=require(_0xcc90('0x0'));var util=require(_0xcc90('0x1'));var moment=require(_0xcc90('0x2'));var BPromise=require(_0xcc90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc90('0x4'))(_0xcc90('0x5'));var config=require(_0xcc90('0x6'));var jayson=require(_0xcc90('0x7'));var client=jayson[_0xcc90('0x8')][_0xcc90('0x9')]({'port':0x232a});config[_0xcc90('0xa')]=_[_0xcc90('0xb')](config[_0xcc90('0xa')],{'host':_0xcc90('0xc'),'port':0x18eb});var socket=require(_0xcc90('0xd'))(new Redis(config[_0xcc90('0xa')]));require(_0xcc90('0xe'))['register'](socket);function respondWithRpcPromise(_0x4122d1,_0x1b07af,_0x2f8cbd){return new BPromise(function(_0x2e8116,_0x11a559){return client[_0xcc90('0xf')](_0x4122d1,_0x2f8cbd)[_0xcc90('0x10')](function(_0x27e717){logger[_0xcc90('0x11')](_0xcc90('0x12'),_0x1b07af,_0xcc90('0x13'));logger[_0xcc90('0x14')](_0xcc90('0x15'),_0x1b07af,_0xcc90('0x13'),JSON[_0xcc90('0x16')](_0x27e717));if(_0x27e717[_0xcc90('0x17')]){if(_0x27e717['error'][_0xcc90('0x18')]===0x1f4){logger['error'](_0xcc90('0x12'),_0x1b07af,_0x27e717[_0xcc90('0x17')]['message']);return _0x11a559(_0x27e717[_0xcc90('0x17')]['message']);}logger[_0xcc90('0x17')](_0xcc90('0x12'),_0x1b07af,_0x27e717['error']['message']);return _0x2e8116(_0x27e717[_0xcc90('0x17')][_0xcc90('0x19')]);}else{logger['info'](_0xcc90('0x12'),_0x1b07af,_0xcc90('0x13'));_0x2e8116(_0x27e717[_0xcc90('0x1a')]['message']);}})[_0xcc90('0x1b')](function(_0x3c6853){logger[_0xcc90('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x1b07af,_0x3c6853);_0x11a559(_0x3c6853);});});}exports[_0xcc90('0x1c')]=function(_0x35c24e){var _0x43661c=this;return new Promise(function(_0x3180e9,_0x1510d0){return db[_0xcc90('0x1d')][_0xcc90('0x1e')]({'raw':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x20')]===undefined?!![]:![]:!![],'where':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x21')]||null:null,'attributes':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e['options'][_0xcc90('0x22')]||null:null,'include':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x23')]?_[_0xcc90('0x24')](_0x35c24e[_0xcc90('0x1f')]['include'],function(_0x592956){return{'model':db[_0x592956[_0xcc90('0x25')]],'as':_0x592956['as'],'attributes':_0x592956['attributes'],'include':_0x592956[_0xcc90('0x23')]?_['map'](_0x592956[_0xcc90('0x23')],function(_0x49bdcc){return{'model':db[_0x49bdcc['model']],'as':_0x49bdcc['as'],'attributes':_0x49bdcc[_0xcc90('0x22')],'include':_0x49bdcc[_0xcc90('0x23')]?_[_0xcc90('0x24')](_0x49bdcc[_0xcc90('0x23')],function(_0x145c88){return{'model':db[_0x145c88['model']],'as':_0x145c88['as'],'attributes':_0x145c88[_0xcc90('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcc90('0x10')](function(_0x2cc917){logger[_0xcc90('0x11')](_0xcc90('0x1c'),_0x35c24e);logger['debug'](_0xcc90('0x1c'),_0x35c24e,JSON[_0xcc90('0x16')](_0x2cc917));_0x3180e9(_0x2cc917);})['catch'](function(_0x2e297c){logger['error'](_0xcc90('0x1c'),_0x2e297c[_0xcc90('0x19')],_0x35c24e);_0x1510d0(_0x43661c[_0xcc90('0x17')](0x1f4,_0x2e297c[_0xcc90('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 82593a3..781d986 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 _0x34ad=['save','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x34ad,0x197));var _0xd34a=function(_0x28b12e,_0x59f4f5){_0x28b12e=_0x28b12e-0x0;var _0x2c3bd1=_0x34ad[_0x28b12e];return _0x2c3bd1;};'use strict';var WhatsappAccountEvents=require(_0xd34a('0x0'));var events=[_0xd34a('0x1'),'remove',_0xd34a('0x2')];function createListener(_0x45e750,_0x126b5b){return function(_0x40d7c0){_0x126b5b[_0xd34a('0x3')](_0x45e750,_0x40d7c0);};}function removeListener(_0x49e412,_0x3b06d7){return function(){WhatsappAccountEvents[_0xd34a('0x4')](_0x49e412,_0x3b06d7);};}exports[_0xd34a('0x5')]=function(_0x5da70f){for(var _0x15b2a3=0x0,_0x47944d=events[_0xd34a('0x6')];_0x15b2a3<_0x47944d;_0x15b2a3++){var _0x4b6e68=events[_0x15b2a3];var _0x4d1685=createListener(_0xd34a('0x7')+_0x4b6e68,_0x5da70f);WhatsappAccountEvents['on'](_0x4b6e68,_0x4d1685);}}; \ No newline at end of file +var _0x26f8=['removeListener','length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x26f8,0x7b));var _0x826f=function(_0x46f62c,_0x49eb41){_0x46f62c=_0x46f62c-0x0;var _0x46d994=_0x26f8[_0x46f62c];return _0x46d994;};'use strict';var WhatsappAccountEvents=require(_0x826f('0x0'));var events=[_0x826f('0x1'),_0x826f('0x2'),_0x826f('0x3')];function createListener(_0x1e7785,_0x218c31){return function(_0x2dcc81){_0x218c31[_0x826f('0x4')](_0x1e7785,_0x2dcc81);};}function removeListener(_0x21bc21,_0x38b63a){return function(){WhatsappAccountEvents[_0x826f('0x5')](_0x21bc21,_0x38b63a);};}exports['register']=function(_0x12a02a){for(var _0x5bdf87=0x0,_0x5cc0a3=events[_0x826f('0x6')];_0x5bdf87<_0x5cc0a3;_0x5bdf87++){var _0x36b7f9=events[_0x5bdf87];var _0x4e8d15=createListener(_0x826f('0x7')+_0x36b7f9,_0x12a02a);WhatsappAccountEvents['on'](_0x36b7f9,_0x4e8d15);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index c57f1c7..14d2e3d 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 _0x84c9=['./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x340e1b,_0x2daf5f){var _0x28c8b3=function(_0x50089e){while(--_0x50089e){_0x340e1b['push'](_0x340e1b['shift']());}};_0x28c8b3(++_0x2daf5f);}(_0x84c9,0x1c5));var _0x984c=function(_0x5dc8c0,_0x223f5a){_0x5dc8c0=_0x5dc8c0-0x0;var _0x26f78e=_0x84c9[_0x5dc8c0];return _0x26f78e;};'use strict';var multer=require('multer');var util=require(_0x984c('0x0'));var path=require(_0x984c('0x1'));var timeout=require(_0x984c('0x2'));var express=require('express');var router=express[_0x984c('0x3')]();var fs_extra=require(_0x984c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x984c('0x5'));var controller=require(_0x984c('0x6'));router[_0x984c('0x7')]('/',auth[_0x984c('0x8')](),controller[_0x984c('0x9')]);router['get'](_0x984c('0xa'),auth[_0x984c('0x8')](),controller['show']);router[_0x984c('0xb')]('/',auth[_0x984c('0x8')](),controller[_0x984c('0xc')]);router['put'](_0x984c('0xa'),auth[_0x984c('0x8')](),controller[_0x984c('0xd')]);router[_0x984c('0xe')]('/:id',auth[_0x984c('0x8')](),controller[_0x984c('0xf')]);module[_0x984c('0x10')]=router; \ No newline at end of file +var _0x0103=['get','/:id','post','isAuthenticated','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','index'];(function(_0x439dea,_0x18f457){var _0x1e1192=function(_0x1ed100){while(--_0x1ed100){_0x439dea['push'](_0x439dea['shift']());}};_0x1e1192(++_0x18f457);}(_0x0103,0xb1));var _0x3010=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x0103[_0x215e65];return _0xa85842;};'use strict';var multer=require('multer');var util=require(_0x3010('0x0'));var path=require(_0x3010('0x1'));var timeout=require(_0x3010('0x2'));var express=require(_0x3010('0x3'));var router=express[_0x3010('0x4')]();var fs_extra=require(_0x3010('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3010('0x6'));var config=require(_0x3010('0x7'));var controller=require(_0x3010('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3010('0x9')]);router[_0x3010('0xa')](_0x3010('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3010('0xc')]('/',auth[_0x3010('0xd')](),controller['create']);router[_0x3010('0xe')](_0x3010('0xb'),auth[_0x3010('0xd')](),controller['update']);router[_0x3010('0xf')](_0x3010('0xb'),auth[_0x3010('0xd')](),controller['destroy']);module[_0x3010('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 7dcdcce..bfb45c1 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 _0x8897=['sequelize','exports','STRING','*,*,*,*'];(function(_0x48bcef,_0x257e9f){var _0x3ad72e=function(_0x4f35b8){while(--_0x4f35b8){_0x48bcef['push'](_0x48bcef['shift']());}};_0x3ad72e(++_0x257e9f);}(_0x8897,0x70));var _0x7889=function(_0x2cc280,_0x4680f0){_0x2cc280=_0x2cc280-0x0;var _0x2f365d=_0x8897[_0x2cc280];return _0x2f365d;};'use strict';var Sequelize=require(_0x7889('0x0'));module[_0x7889('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7889('0x2')],'defaultValue':_0x7889('0x3')}}; \ No newline at end of file +var _0x315b=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x28d990,_0xada35d){var _0x19180b=function(_0x153a81){while(--_0x153a81){_0x28d990['push'](_0x28d990['shift']());}};_0x19180b(++_0xada35d);}(_0x315b,0x14d));var _0xb315=function(_0x164be4,_0x38600b){_0x164be4=_0x164be4-0x0;var _0x51e0a4=_0x315b[_0x164be4];return _0x51e0a4;};'use strict';var Sequelize=require(_0xb315('0x0'));module[_0xb315('0x1')]={'priority':{'type':Sequelize[_0xb315('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb315('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb315('0x4')]()},'description':{'type':Sequelize[_0xb315('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb315('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 465d59c..a396256 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 _0x508a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','sendStatus','stack','name','index','WhatsappApplication','rawAttributes','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x508a,0x1aa));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa508('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa508('0x1'));var jsonpatch=require(_0xa508('0x2'));var rp=require(_0xa508('0x3'));var moment=require(_0xa508('0x4'));var BPromise=require(_0xa508('0x5'));var Mustache=require('mustache');var util=require(_0xa508('0x6'));var path=require(_0xa508('0x7'));var sox=require(_0xa508('0x8'));var csv=require('to-csv');var ejs=require(_0xa508('0x9'));var fs=require('fs');var fs_extra=require(_0xa508('0xa'));var _=require(_0xa508('0xb'));var squel=require('squel');var crypto=require(_0xa508('0xc'));var jsforce=require(_0xa508('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa508('0xe'));var querystring=require(_0xa508('0xf'));var Papa=require('papaparse');var Redis=require(_0xa508('0x10'));var authService=require(_0xa508('0x11'));var qs=require(_0xa508('0x12'));var as=require(_0xa508('0x13'));var hardwareService=require(_0xa508('0x14'));var logger=require('../../config/logger')(_0xa508('0x15'));var utils=require(_0xa508('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa508('0x17'));var db=require(_0xa508('0x18'))['db'];function respondWithStatusCode(_0x2012d6,_0x5e60fd){_0x5e60fd=_0x5e60fd||0xcc;return function(_0xc0511c){if(_0xc0511c){return _0x2012d6['sendStatus'](_0x5e60fd);}return _0x2012d6[_0xa508('0x19')](_0x5e60fd)[_0xa508('0x1a')]();};}function respondWithResult(_0x3085b2,_0x16927e){_0x16927e=_0x16927e||0xc8;return function(_0x5cd0ce){if(_0x5cd0ce){return _0x3085b2[_0xa508('0x19')](_0x16927e)[_0xa508('0x1b')](_0x5cd0ce);}};}function respondWithFilteredResult(_0x102adb,_0xb8b8f5){return function(_0x5e2d7d){if(_0x5e2d7d){var _0x15b852=typeof _0xb8b8f5[_0xa508('0x1c')]===_0xa508('0x1d')&&typeof _0xb8b8f5[_0xa508('0x1e')]==='undefined';var _0x1a366f=_0x5e2d7d[_0xa508('0x1f')];var _0x5e29a8=_0x15b852?0x0:_0xb8b8f5['offset'];var _0x1984ae=_0x15b852?_0x5e2d7d[_0xa508('0x1f')]:_0xb8b8f5[_0xa508('0x1c')]+_0xb8b8f5[_0xa508('0x1e')];var _0x421874;if(_0x1984ae>=_0x1a366f){_0x1984ae=_0x1a366f;_0x421874=0xc8;}else{_0x421874=0xce;}_0x102adb[_0xa508('0x19')](_0x421874);return _0x102adb[_0xa508('0x20')](_0xa508('0x21'),_0x5e29a8+'-'+_0x1984ae+'/'+_0x1a366f)['json'](_0x5e2d7d);}return null;};}function patchUpdates(_0x26291a){return function(_0x2fd9be){try{jsonpatch[_0xa508('0x22')](_0x2fd9be,_0x26291a,!![]);}catch(_0x45b284){return BPromise[_0xa508('0x23')](_0x45b284);}return _0x2fd9be['save']();};}function saveUpdates(_0x274804,_0x5712ad){return function(_0xf4f3f7){if(_0xf4f3f7){return _0xf4f3f7[_0xa508('0x24')](_0x274804)['then'](function(_0x3859c9){return _0x3859c9;});}return null;};}function removeEntity(_0x83b79b,_0x14ca1c){return function(_0x306b3c){if(_0x306b3c){return _0x306b3c['destroy']()['then'](function(){_0x83b79b['status'](0xcc)[_0xa508('0x1a')]();});}};}function handleEntityNotFound(_0x2cda06,_0x46af7f){return function(_0x1cfadf){if(!_0x1cfadf){_0x2cda06[_0xa508('0x25')](0x194);}return _0x1cfadf;};}function handleError(_0x350581,_0x2400ee){_0x2400ee=_0x2400ee||0x1f4;return function(_0x4be5bf){logger['error'](_0x4be5bf[_0xa508('0x26')]);if(_0x4be5bf[_0xa508('0x27')]){delete _0x4be5bf['name'];}_0x350581[_0xa508('0x19')](_0x2400ee)['send'](_0x4be5bf);};}exports[_0xa508('0x28')]=function(_0x44616a,_0x528ae9){var _0x370518={},_0x2ca53f={},_0x24f2b2={'count':0x0,'rows':[]};var _0x39189d=_['map'](db[_0xa508('0x29')][_0xa508('0x2a')],function(_0x3eb26c){return{'name':_0x3eb26c['fieldName'],'type':_0x3eb26c[_0xa508('0x2b')][_0xa508('0x2c')]};});_0x2ca53f['model']=_['map'](_0x39189d,_0xa508('0x27'));_0x2ca53f['query']=_['keys'](_0x44616a[_0xa508('0x2d')]);_0x2ca53f['filters']=_['intersection'](_0x2ca53f[_0xa508('0x2e')],_0x2ca53f[_0xa508('0x2d')]);_0x370518['attributes']=_[_0xa508('0x2f')](_0x2ca53f[_0xa508('0x2e')],qs[_0xa508('0x30')](_0x44616a['query']['fields']));_0x370518[_0xa508('0x31')]=_0x370518[_0xa508('0x31')][_0xa508('0x32')]?_0x370518[_0xa508('0x31')]:_0x2ca53f[_0xa508('0x2e')];if(!_0x44616a[_0xa508('0x2d')][_0xa508('0x33')](_0xa508('0x34'))){_0x370518[_0xa508('0x1e')]=qs[_0xa508('0x1e')](_0x44616a[_0xa508('0x2d')]['limit']);_0x370518[_0xa508('0x1c')]=qs[_0xa508('0x1c')](_0x44616a[_0xa508('0x2d')][_0xa508('0x1c')]);}_0x370518['order']=qs[_0xa508('0x35')](_0x44616a[_0xa508('0x2d')][_0xa508('0x35')]);_0x370518['where']=qs[_0xa508('0x36')](_[_0xa508('0x37')](_0x44616a[_0xa508('0x2d')],_0x2ca53f['filters']),_0x39189d);if(_0x44616a['query'][_0xa508('0x38')]){_0x370518[_0xa508('0x39')]=_[_0xa508('0x3a')](_0x370518[_0xa508('0x39')],{'$or':_['map'](_0x39189d,function(_0x2b8e1d){if(_0x2b8e1d[_0xa508('0x2b')]!==_0xa508('0x3b')){var _0x44f78={};_0x44f78[_0x2b8e1d[_0xa508('0x27')]]={'$like':'%'+_0x44616a[_0xa508('0x2d')][_0xa508('0x38')]+'%'};return _0x44f78;}})});}_0x370518=_[_0xa508('0x3a')]({},_0x370518,_0x44616a[_0xa508('0x3c')]);var _0x41c6f8={'where':_0x370518[_0xa508('0x39')]};return db[_0xa508('0x29')]['count'](_0x41c6f8)[_0xa508('0x3d')](function(_0x2f2379){_0x24f2b2[_0xa508('0x1f')]=_0x2f2379;if(_0x44616a[_0xa508('0x2d')]['includeAll']){_0x370518[_0xa508('0x3e')]=[{'all':!![]}];}return db[_0xa508('0x29')][_0xa508('0x3f')](_0x370518);})[_0xa508('0x3d')](function(_0x1aa7d8){_0x24f2b2[_0xa508('0x40')]=_0x1aa7d8;return _0x24f2b2;})[_0xa508('0x3d')](respondWithFilteredResult(_0x528ae9,_0x370518))[_0xa508('0x41')](handleError(_0x528ae9,null));};exports[_0xa508('0x42')]=function(_0xfbba67,_0x159351){var _0x24c3ec={'raw':!![],'where':{'id':_0xfbba67['params']['id']}},_0x7687ed={};_0x7687ed[_0xa508('0x2e')]=_['keys'](db[_0xa508('0x29')][_0xa508('0x2a')]);_0x7687ed[_0xa508('0x2d')]=_[_0xa508('0x43')](_0xfbba67[_0xa508('0x2d')]);_0x7687ed[_0xa508('0x36')]=_[_0xa508('0x2f')](_0x7687ed[_0xa508('0x2e')],_0x7687ed['query']);_0x24c3ec[_0xa508('0x31')]=_[_0xa508('0x2f')](_0x7687ed[_0xa508('0x2e')],qs[_0xa508('0x30')](_0xfbba67[_0xa508('0x2d')][_0xa508('0x30')]));_0x24c3ec[_0xa508('0x31')]=_0x24c3ec[_0xa508('0x31')][_0xa508('0x32')]?_0x24c3ec[_0xa508('0x31')]:_0x7687ed[_0xa508('0x2e')];if(_0xfbba67[_0xa508('0x2d')][_0xa508('0x44')]){_0x24c3ec[_0xa508('0x3e')]=[{'all':!![]}];}_0x24c3ec=_[_0xa508('0x3a')]({},_0x24c3ec,_0xfbba67[_0xa508('0x3c')]);return db[_0xa508('0x29')][_0xa508('0x45')](_0x24c3ec)[_0xa508('0x3d')](handleEntityNotFound(_0x159351,null))[_0xa508('0x3d')](respondWithResult(_0x159351,null))[_0xa508('0x41')](handleError(_0x159351,null));};exports[_0xa508('0x46')]=function(_0x259fc5,_0x2c64ff){return db[_0xa508('0x29')][_0xa508('0x46')](_0x259fc5['body'],{})[_0xa508('0x3d')](respondWithResult(_0x2c64ff,0xc9))[_0xa508('0x41')](handleError(_0x2c64ff,null));};exports[_0xa508('0x24')]=function(_0x11b73c,_0x390c1f){if(_0x11b73c['body']['id']){delete _0x11b73c[_0xa508('0x47')]['id'];}return db[_0xa508('0x29')][_0xa508('0x45')]({'where':{'id':_0x11b73c[_0xa508('0x48')]['id']}})[_0xa508('0x3d')](handleEntityNotFound(_0x390c1f,null))[_0xa508('0x3d')](saveUpdates(_0x11b73c[_0xa508('0x47')],null))['then'](respondWithResult(_0x390c1f,null))[_0xa508('0x41')](handleError(_0x390c1f,null));};exports[_0xa508('0x49')]=function(_0x83bc4f,_0x58fee8){return db[_0xa508('0x29')][_0xa508('0x45')]({'where':{'id':_0x83bc4f[_0xa508('0x48')]['id']}})[_0xa508('0x3d')](handleEntityNotFound(_0x58fee8,null))[_0xa508('0x3d')](removeEntity(_0x58fee8,null))[_0xa508('0x41')](handleError(_0x58fee8,null));}; \ No newline at end of file +var _0x8814=['name','send','index','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','count','includeAll','catch','show','params','keys','options','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','json','apply','reject','save','destroy','then','sendStatus','stack'];(function(_0x2335a5,_0x3b2daa){var _0x335ed2=function(_0x2b2c1e){while(--_0x2b2c1e){_0x2335a5['push'](_0x2335a5['shift']());}};_0x335ed2(++_0x3b2daa);}(_0x8814,0x1b8));var _0x4881=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x8814[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0x4881('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4881('0x1'));var rp=require('request-promise');var moment=require(_0x4881('0x2'));var BPromise=require(_0x4881('0x3'));var Mustache=require(_0x4881('0x4'));var util=require(_0x4881('0x5'));var path=require('path');var sox=require(_0x4881('0x6'));var csv=require(_0x4881('0x7'));var ejs=require(_0x4881('0x8'));var fs=require('fs');var fs_extra=require(_0x4881('0x9'));var _=require('lodash');var squel=require(_0x4881('0xa'));var crypto=require('crypto');var jsforce=require(_0x4881('0xb'));var deskjs=require(_0x4881('0xc'));var toCsv=require(_0x4881('0x7'));var querystring=require(_0x4881('0xd'));var Papa=require('papaparse');var Redis=require(_0x4881('0xe'));var authService=require(_0x4881('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4881('0x10'));var hardwareService=require(_0x4881('0x11'));var logger=require(_0x4881('0x12'))(_0x4881('0x13'));var utils=require(_0x4881('0x14'));var config=require(_0x4881('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4881('0x16'))['db'];function respondWithStatusCode(_0x1aa300,_0x42454b){_0x42454b=_0x42454b||0xcc;return function(_0x2794fe){if(_0x2794fe){return _0x1aa300['sendStatus'](_0x42454b);}return _0x1aa300[_0x4881('0x17')](_0x42454b)[_0x4881('0x18')]();};}function respondWithResult(_0x20357a,_0x44b25b){_0x44b25b=_0x44b25b||0xc8;return function(_0x1b409f){if(_0x1b409f){return _0x20357a[_0x4881('0x17')](_0x44b25b)['json'](_0x1b409f);}};}function respondWithFilteredResult(_0x4bdffa,_0x527762){return function(_0x5ad538){if(_0x5ad538){var _0x22df92=typeof _0x527762[_0x4881('0x19')]==='undefined'&&typeof _0x527762[_0x4881('0x1a')]===_0x4881('0x1b');var _0x3e1b6c=_0x5ad538['count'];var _0x4f7f4e=_0x22df92?0x0:_0x527762['offset'];var _0x333305=_0x22df92?_0x5ad538['count']:_0x527762[_0x4881('0x19')]+_0x527762[_0x4881('0x1a')];var _0x513bd1;if(_0x333305>=_0x3e1b6c){_0x333305=_0x3e1b6c;_0x513bd1=0xc8;}else{_0x513bd1=0xce;}_0x4bdffa['status'](_0x513bd1);return _0x4bdffa['set']('Content-Range',_0x4f7f4e+'-'+_0x333305+'/'+_0x3e1b6c)[_0x4881('0x1c')](_0x5ad538);}return null;};}function patchUpdates(_0x543c5e){return function(_0x4dc126){try{jsonpatch[_0x4881('0x1d')](_0x4dc126,_0x543c5e,!![]);}catch(_0x20bc72){return BPromise[_0x4881('0x1e')](_0x20bc72);}return _0x4dc126[_0x4881('0x1f')]();};}function saveUpdates(_0x347b35,_0x33b74a){return function(_0x5a514d){if(_0x5a514d){return _0x5a514d['update'](_0x347b35)['then'](function(_0x15aebc){return _0x15aebc;});}return null;};}function removeEntity(_0x2727c4,_0xb965c9){return function(_0x470df9){if(_0x470df9){return _0x470df9[_0x4881('0x20')]()[_0x4881('0x21')](function(){_0x2727c4['status'](0xcc)[_0x4881('0x18')]();});}};}function handleEntityNotFound(_0x383c70,_0x588578){return function(_0x221836){if(!_0x221836){_0x383c70[_0x4881('0x22')](0x194);}return _0x221836;};}function handleError(_0x2ca33e,_0x1cc477){_0x1cc477=_0x1cc477||0x1f4;return function(_0x1d3a30){logger['error'](_0x1d3a30[_0x4881('0x23')]);if(_0x1d3a30[_0x4881('0x24')]){delete _0x1d3a30[_0x4881('0x24')];}_0x2ca33e['status'](_0x1cc477)[_0x4881('0x25')](_0x1d3a30);};}exports[_0x4881('0x26')]=function(_0x5bcb74,_0x273995){var _0x1e61a={},_0x3096d1={},_0xe66a47={'count':0x0,'rows':[]};var _0x3889e8=_['map'](db[_0x4881('0x27')][_0x4881('0x28')],function(_0x373c7e){return{'name':_0x373c7e[_0x4881('0x29')],'type':_0x373c7e[_0x4881('0x2a')][_0x4881('0x2b')]};});_0x3096d1[_0x4881('0x2c')]=_[_0x4881('0x2d')](_0x3889e8,_0x4881('0x24'));_0x3096d1['query']=_['keys'](_0x5bcb74[_0x4881('0x2e')]);_0x3096d1[_0x4881('0x2f')]=_['intersection'](_0x3096d1[_0x4881('0x2c')],_0x3096d1[_0x4881('0x2e')]);_0x1e61a['attributes']=_[_0x4881('0x30')](_0x3096d1[_0x4881('0x2c')],qs[_0x4881('0x31')](_0x5bcb74['query']['fields']));_0x1e61a[_0x4881('0x32')]=_0x1e61a[_0x4881('0x32')][_0x4881('0x33')]?_0x1e61a['attributes']:_0x3096d1[_0x4881('0x2c')];if(!_0x5bcb74[_0x4881('0x2e')][_0x4881('0x34')]('nolimit')){_0x1e61a[_0x4881('0x1a')]=qs[_0x4881('0x1a')](_0x5bcb74[_0x4881('0x2e')][_0x4881('0x1a')]);_0x1e61a[_0x4881('0x19')]=qs['offset'](_0x5bcb74[_0x4881('0x2e')][_0x4881('0x19')]);}_0x1e61a['order']=qs[_0x4881('0x35')](_0x5bcb74[_0x4881('0x2e')][_0x4881('0x35')]);_0x1e61a[_0x4881('0x36')]=qs[_0x4881('0x2f')](_['pick'](_0x5bcb74[_0x4881('0x2e')],_0x3096d1[_0x4881('0x2f')]),_0x3889e8);if(_0x5bcb74['query'][_0x4881('0x37')]){_0x1e61a[_0x4881('0x36')]=_[_0x4881('0x38')](_0x1e61a['where'],{'$or':_[_0x4881('0x2d')](_0x3889e8,function(_0x24c61c){if(_0x24c61c[_0x4881('0x2a')]!==_0x4881('0x39')){var _0x2a84fd={};_0x2a84fd[_0x24c61c['name']]={'$like':'%'+_0x5bcb74[_0x4881('0x2e')][_0x4881('0x37')]+'%'};return _0x2a84fd;}})});}_0x1e61a=_['merge']({},_0x1e61a,_0x5bcb74['options']);var _0x571cde={'where':_0x1e61a[_0x4881('0x36')]};return db['WhatsappApplication'][_0x4881('0x3a')](_0x571cde)['then'](function(_0x2aecef){_0xe66a47[_0x4881('0x3a')]=_0x2aecef;if(_0x5bcb74[_0x4881('0x2e')][_0x4881('0x3b')]){_0x1e61a['include']=[{'all':!![]}];}return db[_0x4881('0x27')]['findAll'](_0x1e61a);})[_0x4881('0x21')](function(_0x497baa){_0xe66a47['rows']=_0x497baa;return _0xe66a47;})[_0x4881('0x21')](respondWithFilteredResult(_0x273995,_0x1e61a))[_0x4881('0x3c')](handleError(_0x273995,null));};exports[_0x4881('0x3d')]=function(_0x2003c9,_0x262fd1){var _0x3f26c9={'raw':!![],'where':{'id':_0x2003c9[_0x4881('0x3e')]['id']}},_0x3b06ad={};_0x3b06ad[_0x4881('0x2c')]=_['keys'](db[_0x4881('0x27')][_0x4881('0x28')]);_0x3b06ad[_0x4881('0x2e')]=_[_0x4881('0x3f')](_0x2003c9[_0x4881('0x2e')]);_0x3b06ad['filters']=_[_0x4881('0x30')](_0x3b06ad['model'],_0x3b06ad[_0x4881('0x2e')]);_0x3f26c9['attributes']=_['intersection'](_0x3b06ad[_0x4881('0x2c')],qs[_0x4881('0x31')](_0x2003c9[_0x4881('0x2e')][_0x4881('0x31')]));_0x3f26c9[_0x4881('0x32')]=_0x3f26c9[_0x4881('0x32')][_0x4881('0x33')]?_0x3f26c9['attributes']:_0x3b06ad['model'];if(_0x2003c9[_0x4881('0x2e')]['includeAll']){_0x3f26c9['include']=[{'all':!![]}];}_0x3f26c9=_[_0x4881('0x38')]({},_0x3f26c9,_0x2003c9[_0x4881('0x40')]);return db['WhatsappApplication'][_0x4881('0x41')](_0x3f26c9)[_0x4881('0x21')](handleEntityNotFound(_0x262fd1,null))[_0x4881('0x21')](respondWithResult(_0x262fd1,null))[_0x4881('0x3c')](handleError(_0x262fd1,null));};exports[_0x4881('0x42')]=function(_0x1b1024,_0x515e9d){return db[_0x4881('0x27')]['create'](_0x1b1024[_0x4881('0x43')],{})[_0x4881('0x21')](respondWithResult(_0x515e9d,0xc9))['catch'](handleError(_0x515e9d,null));};exports['update']=function(_0x18bb78,_0x58f9ac){if(_0x18bb78[_0x4881('0x43')]['id']){delete _0x18bb78[_0x4881('0x43')]['id'];}return db[_0x4881('0x27')][_0x4881('0x41')]({'where':{'id':_0x18bb78[_0x4881('0x3e')]['id']}})[_0x4881('0x21')](handleEntityNotFound(_0x58f9ac,null))[_0x4881('0x21')](saveUpdates(_0x18bb78[_0x4881('0x43')],null))[_0x4881('0x21')](respondWithResult(_0x58f9ac,null))[_0x4881('0x3c')](handleError(_0x58f9ac,null));};exports[_0x4881('0x20')]=function(_0x4186bb,_0x3b0bda){return db[_0x4881('0x27')][_0x4881('0x41')]({'where':{'id':_0x4186bb['params']['id']}})[_0x4881('0x21')](handleEntityNotFound(_0x3b0bda,null))[_0x4881('0x21')](removeEntity(_0x3b0bda,null))['catch'](handleError(_0x3b0bda,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 3e9da09..fa359e2 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 _0x5089=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash'];(function(_0x3d7b19,_0x32af0f){var _0x37c6fc=function(_0x11a147){while(--_0x11a147){_0x3d7b19['push'](_0x3d7b19['shift']());}};_0x37c6fc(++_0x32af0f);}(_0x5089,0x1bb));var _0x9508=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x5089[_0x162780];return _0x1ea2dc;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9508('0xb')});}; \ No newline at end of file +var _0x1a8f=['request-promise','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3ba10f,_0x12be2e){var _0xcbaec2=function(_0x393436){while(--_0x393436){_0x3ba10f['push'](_0x3ba10f['shift']());}};_0xcbaec2(++_0x12be2e);}(_0x1a8f,0x87));var _0xf1a8=function(_0x1cb825,_0x909dc6){_0x1cb825=_0x1cb825-0x0;var _0x596088=_0x1a8f[_0x1cb825];return _0x596088;};'use strict';var _=require(_0xf1a8('0x0'));var util=require('util');var logger=require(_0xf1a8('0x1'))(_0xf1a8('0x2'));var moment=require(_0xf1a8('0x3'));var BPromise=require(_0xf1a8('0x4'));var rp=require(_0xf1a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0xf1a8('0x6')]=function(_0x515ff3,_0x29dc33){return _0x515ff3['define'](_0xf1a8('0x7'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1a8('0x8'),'collate':_0xf1a8('0x9')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1189894..cededec 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 _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x25333f,_0x261098){var _0x275c8f=function(_0x4f727f){while(--_0x4f727f){_0x25333f['push'](_0x25333f['shift']());}};_0x275c8f(++_0x261098);}(_0x668b,0x140));var _0xb668=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x668b[_0x30faec];return _0x29484f;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file +var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5636,0x102));var _0x6563=function(_0x4c5956,_0x336679){_0x4c5956=_0x4c5956-0x0;var _0x36b634=_0x5636[_0x4c5956];return _0x36b634;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index bc8fdbb..5ee028b 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 _0x8b8e=['whatsappinteraction:destroy','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','put','/:id','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x3a1287,_0xb1f80){var _0x3d6a2d=function(_0x2f26e6){while(--_0x2f26e6){_0x3a1287['push'](_0x3a1287['shift']());}};_0x3d6a2d(++_0xb1f80);}(_0x8b8e,0x108));var _0xe8b8=function(_0x3165c5,_0x569d7a){_0x3165c5=_0x3165c5-0x0;var _0x57808c=_0x8b8e[_0x3165c5];return _0x57808c;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['describe']);router[_0xe8b8('0x7')]('/:id',auth[_0xe8b8('0x8')](),controller['show']);router['get'](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller['getMessages']);router['get'](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router[_0xe8b8('0xe')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xf')]);router[_0xe8b8('0xe')](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x10')]);router[_0xe8b8('0xe')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')]('whatsapp',_0xe8b8('0x13')),controller['addTags']);router[_0xe8b8('0x14')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')](_0xe8b8('0x16'),_0xe8b8('0x17')),controller[_0xe8b8('0x18')]);router[_0xe8b8('0x19')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction['tracked'](_0xe8b8('0x16'),_0xe8b8('0x1a')),controller['destroy']);router[_0xe8b8('0x19')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x1b')]);module[_0xe8b8('0x1c')]=router; \ No newline at end of file +var _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x32a228,_0x2fc322){var _0x5da9ba=function(_0x42c8bb){while(--_0x42c8bb){_0x32a228['push'](_0x32a228['shift']());}};_0x5da9ba(++_0x2fc322);}(_0x85d0,0x164));var _0x085d=function(_0x30160c,_0x2c6abd){_0x30160c=_0x30160c-0x0;var _0x56a4d4=_0x85d0[_0x30160c];return _0x56a4d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0x6')](_0x085d('0xd'),auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router['get'](_0x085d('0xf'),auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')]('/',auth['isAuthenticated'](),controller[_0x085d('0x12')]);router[_0x085d('0x11')]('/:id/messages',auth[_0x085d('0xb')](),controller[_0x085d('0x13')]);router[_0x085d('0x11')](_0x085d('0x14'),auth['isAuthenticated'](),interaction[_0x085d('0x15')](_0x085d('0x16'),'whatsappinteraction:addtags'),controller['addTags']);router[_0x085d('0x17')](_0x085d('0xa'),auth[_0x085d('0xb')](),interaction[_0x085d('0x15')](_0x085d('0x16'),'whatsappinteraction:update'),controller[_0x085d('0x18')]);router[_0x085d('0x19')](_0x085d('0xa'),auth[_0x085d('0xb')](),interaction[_0x085d('0x15')](_0x085d('0x16'),_0x085d('0x1a')),controller[_0x085d('0x1b')]);router[_0x085d('0x19')]('/:id/tags',auth[_0x085d('0xb')](),controller[_0x085d('0x1c')]);module[_0x085d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 6aff2b0..c717b2b 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 _0x1a37=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x1a37,0xb4));var _0x71a3=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x1a37[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0x71a3('0x0'));var moment=require(_0x71a3('0x1'));module[_0x71a3('0x2')]={'closed':{'type':Sequelize[_0x71a3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71a3('0x4')]},'disposition':{'type':Sequelize[_0x71a3('0x5')]},'secondDisposition':{'type':Sequelize[_0x71a3('0x5')]},'thirdDisposition':{'type':Sequelize[_0x71a3('0x5')]},'note':{'type':Sequelize[_0x71a3('0x5')]},'phone':{'type':Sequelize[_0x71a3('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x71a3('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x71a3('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x71a3('0x6')]('in',_0x71a3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x71a3('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7be1=['DATE','STRING','out','BOOLEAN','INTEGER','sequelize','moment','exports'];(function(_0x1a27c9,_0x36595a){var _0x2b1015=function(_0x31454a){while(--_0x31454a){_0x1a27c9['push'](_0x1a27c9['shift']());}};_0x2b1015(++_0x36595a);}(_0x7be1,0x165));var _0x17be=function(_0x203451,_0x36cdd9){_0x203451=_0x203451-0x0;var _0x23dc34=_0x7be1[_0x203451];return _0x23dc34;};'use strict';var Sequelize=require(_0x17be('0x0'));var moment=require(_0x17be('0x1'));module[_0x17be('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x17be('0x3')]},'disposition':{'type':Sequelize[_0x17be('0x4')]},'secondDisposition':{'type':Sequelize[_0x17be('0x4')]},'thirdDisposition':{'type':Sequelize[_0x17be('0x4')]},'note':{'type':Sequelize[_0x17be('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x17be('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x17be('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x17be('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x17be('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x17be('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 8e748c4..65ad4b8 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 _0x4f81=['util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','then','name','send','index','WhatsappInteraction','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','attributes','intersection','fields','include','find','create','body','update','destroy','catch','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','filters','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','spread','Tag','emit','removeTags','download','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','closedAt','toString','disposition','map','basename','existsSync','createReadStream','pipe','createWriteStream','out','firstName','lastName','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','moment'];(function(_0x43ffba,_0x8b7ceb){var _0x33acd7=function(_0x3c8ef8){while(--_0x3c8ef8){_0x43ffba['push'](_0x43ffba['shift']());}};_0x33acd7(++_0x8b7ceb);}(_0x4f81,0x1e3));var _0x14f8=function(_0x448e71,_0x3d4caf){_0x448e71=_0x448e71-0x0;var _0x471f72=_0x4f81[_0x448e71];return _0x471f72;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x14f8('0x0'));var BPromise=require('bluebird');var util=require(_0x14f8('0x1'));var path=require(_0x14f8('0x2'));var ejs=require(_0x14f8('0x3'));var fs=require('fs');var _=require(_0x14f8('0x4'));var Redis=require(_0x14f8('0x5'));var interaction=require(_0x14f8('0x6'));var qs=require(_0x14f8('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x14f8('0x8'))('api');var config=require(_0x14f8('0x9'));var db=require(_0x14f8('0xa'))['db'];config['redis']=_[_0x14f8('0xb')](config[_0x14f8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x14f8('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x14f8('0xe')](socket);function respondWithStatusCode(_0x40a43d,_0xbfbf2a){_0xbfbf2a=_0xbfbf2a||0xcc;return function(_0xd10497){if(_0xd10497){return _0x40a43d[_0x14f8('0xf')](_0xbfbf2a);}return _0x40a43d[_0x14f8('0x10')](_0xbfbf2a)[_0x14f8('0x11')]();};}function respondWithResult(_0xd41009,_0x3828e8){_0x3828e8=_0x3828e8||0xc8;return function(_0x1e849a){if(_0x1e849a){return _0xd41009[_0x14f8('0x10')](_0x3828e8)[_0x14f8('0x12')](_0x1e849a);}};}function respondWithFilteredResult(_0x5f2843,_0x315ed3){return function(_0x3b6ecb){if(_0x3b6ecb){var _0x235f92=typeof _0x315ed3[_0x14f8('0x13')]===_0x14f8('0x14')&&typeof _0x315ed3[_0x14f8('0x15')]===_0x14f8('0x14');var _0x37e020=_0x3b6ecb[_0x14f8('0x16')];var _0x1216e8=_0x235f92?0x0:_0x315ed3['offset'];var _0x3481a1=_0x235f92?_0x3b6ecb[_0x14f8('0x16')]:_0x315ed3[_0x14f8('0x13')]+_0x315ed3[_0x14f8('0x15')];var _0x2a3019;if(_0x3481a1>=_0x37e020){_0x3481a1=_0x37e020;_0x2a3019=0xc8;}else{_0x2a3019=0xce;}_0x5f2843[_0x14f8('0x10')](_0x2a3019);return _0x5f2843[_0x14f8('0x17')]('Content-Range',_0x1216e8+'-'+_0x3481a1+'/'+_0x37e020)[_0x14f8('0x12')](_0x3b6ecb);}return null;};}function saveUpdates(_0x4495de){return function(_0x4c9dc9){if(_0x4c9dc9){return _0x4c9dc9['update'](_0x4495de)['then'](function(_0x3e62a1){return _0x3e62a1;});}return null;};}function removeEntity(_0x471a81){return function(_0x261596){if(_0x261596){return _0x261596['destroy']()[_0x14f8('0x18')](function(){_0x471a81[_0x14f8('0x10')](0xcc)[_0x14f8('0x11')]();});}};}function handleEntityNotFound(_0x504a1e){return function(_0x3526e5){if(!_0x3526e5){_0x504a1e['sendStatus'](0x194);}return _0x3526e5;};}function handleError(_0x313775,_0x14fa31){_0x14fa31=_0x14fa31||0x1f4;return function(_0x4bfacd){logger['error'](_0x4bfacd['stack']);if(_0x4bfacd['name']){delete _0x4bfacd[_0x14f8('0x19')];}_0x313775[_0x14f8('0x10')](_0x14fa31)[_0x14f8('0x1a')](_0x4bfacd);};}exports[_0x14f8('0x1b')]=function(_0x12122d,_0x18350e){var _0x527632={};var _0x4193a2=_['map'](db[_0x14f8('0x1c')][_0x14f8('0x1d')],function(_0x1e938b){return{'name':_0x1e938b['fieldName'],'type':_0x1e938b[_0x14f8('0x1e')]['key']};});_0x527632=qs[_0x14f8('0x1f')](_0x4193a2,_0x12122d);return interaction[_0x14f8('0x20')]('whatsapp',_0x12122d[_0x14f8('0x21')],_0x12122d[_0x14f8('0x22')],_0x527632,_0x4193a2)[_0x14f8('0x18')](respondWithFilteredResult(_0x18350e,_0x527632))['catch'](handleError(_0x18350e,null));};exports[_0x14f8('0x23')]=function(_0x43bb3d,_0x23aa31){var _0x58ba3b={'raw':![],'where':{'id':_0x43bb3d[_0x14f8('0x24')]['id']}},_0x3e1d02={};_0x3e1d02[_0x14f8('0x25')]=_[_0x14f8('0x26')](db[_0x14f8('0x1c')][_0x14f8('0x1d')]);_0x3e1d02[_0x14f8('0x21')]=_['keys'](_0x43bb3d[_0x14f8('0x21')]);_0x3e1d02['filters']=_['intersection'](_0x3e1d02[_0x14f8('0x25')],_0x3e1d02['query']);_0x58ba3b[_0x14f8('0x27')]=_[_0x14f8('0x28')](_0x3e1d02[_0x14f8('0x25')],qs[_0x14f8('0x29')](_0x43bb3d[_0x14f8('0x21')]['fields']));_0x58ba3b[_0x14f8('0x27')]=_0x58ba3b[_0x14f8('0x27')]['length']?_0x58ba3b['attributes']:_0x3e1d02[_0x14f8('0x25')];if(_0x43bb3d[_0x14f8('0x21')]['includeAll']){_0x58ba3b[_0x14f8('0x2a')]=[{'all':!![]}];}_0x58ba3b=_['merge']({},_0x58ba3b,_0x43bb3d['options']);return db['WhatsappInteraction'][_0x14f8('0x2b')](_0x58ba3b)[_0x14f8('0x18')](handleEntityNotFound(_0x23aa31,null))[_0x14f8('0x18')](respondWithResult(_0x23aa31,null))['catch'](handleError(_0x23aa31,null));};exports[_0x14f8('0x2c')]=function(_0x4ac7b0,_0x296cd5){return db[_0x14f8('0x1c')]['create'](_0x4ac7b0[_0x14f8('0x2d')],{})[_0x14f8('0x18')](respondWithResult(_0x296cd5,0xc9))['catch'](handleError(_0x296cd5,null));};exports[_0x14f8('0x2e')]=function(_0x1a98fb,_0x253986){if(_0x1a98fb[_0x14f8('0x2d')]['id']){delete _0x1a98fb[_0x14f8('0x2d')]['id'];}return db[_0x14f8('0x1c')]['find']({'where':{'id':_0x1a98fb[_0x14f8('0x24')]['id']}})['then'](handleEntityNotFound(_0x253986,null))['then'](saveUpdates(_0x1a98fb[_0x14f8('0x2d')],null))['then'](respondWithResult(_0x253986,null))['catch'](handleError(_0x253986,null));};exports[_0x14f8('0x2f')]=function(_0x107497,_0x12fc5c){return db['WhatsappInteraction']['find']({'where':{'id':_0x107497['params']['id']}})[_0x14f8('0x18')](handleEntityNotFound(_0x12fc5c,null))[_0x14f8('0x18')](removeEntity(_0x12fc5c,null))[_0x14f8('0x30')](handleError(_0x12fc5c,null));};exports[_0x14f8('0x31')]=function(_0xc941a9,_0x329cf2){return db[_0x14f8('0x1c')][_0x14f8('0x31')]()[_0x14f8('0x18')](respondWithResult(_0x329cf2,null))['catch'](handleError(_0x329cf2,null));};exports['addMessage']=function(_0x181451,_0x1e5e75){return db[_0x14f8('0x32')][_0x14f8('0x2b')]({'where':{'id':_0x181451[_0x14f8('0x24')]['id']}})['then'](handleEntityNotFound(_0x1e5e75,null))[_0x14f8('0x18')](function(_0x431500){if(_0x431500){return _0x431500[_0x14f8('0x33')](_0x181451[_0x14f8('0x2d')][_0x14f8('0x34')],_['omit'](_0x181451[_0x14f8('0x2d')],[_0x14f8('0x34'),'id'])||{});}})['then'](respondWithResult(_0x1e5e75,null))[_0x14f8('0x30')](handleError(_0x1e5e75,null));};exports[_0x14f8('0x35')]=function(_0x4def67,_0x415976){var _0x2445db={'raw':![],'where':{}};var _0x2aefb4={};var _0x45d702={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x14f8('0x36')]({'where':{'id':_0x4def67['params']['id']}})[_0x14f8('0x18')](handleEntityNotFound(_0x415976,null))[_0x14f8('0x18')](function(_0x275b37){if(_0x275b37){_0x2aefb4[_0x14f8('0x25')]=_[_0x14f8('0x26')](db['WhatsappMessage'][_0x14f8('0x1d')]);_0x2aefb4[_0x14f8('0x21')]=_[_0x14f8('0x26')](_0x4def67[_0x14f8('0x21')]);_0x2aefb4[_0x14f8('0x37')]=_[_0x14f8('0x28')](_0x2aefb4[_0x14f8('0x25')],_0x2aefb4[_0x14f8('0x21')]);_0x2445db[_0x14f8('0x27')]=_[_0x14f8('0x28')](_0x2aefb4[_0x14f8('0x25')],qs[_0x14f8('0x29')](_0x4def67['query'][_0x14f8('0x29')]));_0x2445db['attributes']=_0x2445db[_0x14f8('0x27')][_0x14f8('0x38')]?_0x2445db['attributes']:_0x2aefb4[_0x14f8('0x25')];if(!_0x4def67[_0x14f8('0x21')][_0x14f8('0x39')](_0x14f8('0x3a'))){_0x2445db['limit']=qs[_0x14f8('0x15')](_0x4def67['query'][_0x14f8('0x15')]);_0x2445db[_0x14f8('0x13')]=qs['offset'](_0x4def67['query'][_0x14f8('0x13')]);}_0x2445db[_0x14f8('0x3b')]=qs[_0x14f8('0x3c')](_0x4def67[_0x14f8('0x21')][_0x14f8('0x3c')]);_0x2445db[_0x14f8('0x3d')]=qs['filters'](_[_0x14f8('0x3e')](_0x4def67[_0x14f8('0x21')],_0x2aefb4[_0x14f8('0x37')]));_0x2445db['where']['WhatsappInteractionId']=_0x275b37['id'];if(_0x4def67[_0x14f8('0x21')][_0x14f8('0x3f')]){_0x2445db[_0x14f8('0x3d')]=_[_0x14f8('0x40')](_0x2445db[_0x14f8('0x3d')],{'$or':_['map'](_0x2445db[_0x14f8('0x27')],function(_0x2da3c6){var _0x1550bd={};_0x1550bd[_0x2da3c6]={'$like':'%'+_0x4def67[_0x14f8('0x21')][_0x14f8('0x3f')]+'%'};return _0x1550bd;})});}if(_0x4def67['query']['$gte']){var _0x2d8741=_0x4def67[_0x14f8('0x21')][_0x14f8('0x41')][_0x14f8('0x42')](',');var _0x48ba53={};_0x48ba53[_0x2d8741[0x0]]={'$gte':moment(_0x2d8741[0x1])[_0x14f8('0x43')](_0x14f8('0x44'))};_0x2445db[_0x14f8('0x3d')]=_[_0x14f8('0x40')](_0x2445db['where'],_0x48ba53);}_0x2445db=_[_0x14f8('0x40')]({},_0x2445db,_0x4def67['options']);return db['WhatsappMessage']['count']({'where':_0x2445db[_0x14f8('0x3d')]})[_0x14f8('0x18')](function(_0x270ba6){_0x45d702[_0x14f8('0x16')]=_0x270ba6;if(_0x4def67[_0x14f8('0x21')][_0x14f8('0x45')]){_0x2445db[_0x14f8('0x2a')]=[{'all':!![]}];}return db[_0x14f8('0x32')][_0x14f8('0x20')](_0x2445db);})['then'](function(_0x3e79cf){_0x45d702['rows']=_0x3e79cf;return _0x45d702;});}})[_0x14f8('0x18')](respondWithFilteredResult(_0x415976,_0x2445db))[_0x14f8('0x30')](handleError(_0x415976,null));};exports[_0x14f8('0x46')]=function(_0x5ba6fa,_0x3f0dbd){return db['WhatsappInteraction']['find']({'where':{'id':_0x5ba6fa['params']['id']}})[_0x14f8('0x18')](handleEntityNotFound(_0x3f0dbd,null))[_0x14f8('0x18')](function(_0x56c202){if(_0x56c202){return _0x56c202['setTags'](_0x5ba6fa[_0x14f8('0x2d')]['ids'],_['omit'](_0x5ba6fa[_0x14f8('0x2d')],[_0x14f8('0x34'),'id'])||{})[_0x14f8('0x47')](function(){return db[_0x14f8('0x48')][_0x14f8('0x20')]({'attributes':['id',_0x14f8('0x19'),'color'],'where':{'id':_0x5ba6fa[_0x14f8('0x2d')][_0x14f8('0x34')]}});})['then'](function(_0x5a6aff){socket[_0x14f8('0x49')]('whatsappInteractionTags:save',{'id':Number(_0x5ba6fa[_0x14f8('0x24')]['id']),'tags':_0x5a6aff||[]});return{'id':Number(_0x5ba6fa['params']['id']),'tags':_0x5a6aff||[]};});}})[_0x14f8('0x18')](respondWithResult(_0x3f0dbd,null))[_0x14f8('0x30')](handleError(_0x3f0dbd,null));};exports[_0x14f8('0x4a')]=function(_0xb8dfe1,_0x27a0d2){return db[_0x14f8('0x1c')][_0x14f8('0x2b')]({'where':{'id':_0xb8dfe1[_0x14f8('0x24')]['id']}})[_0x14f8('0x18')](handleEntityNotFound(_0x27a0d2,null))[_0x14f8('0x18')](function(_0x59a8bf){if(_0x59a8bf){return _0x59a8bf[_0x14f8('0x4a')](_0xb8dfe1[_0x14f8('0x21')][_0x14f8('0x34')]);}})[_0x14f8('0x18')](respondWithStatusCode(_0x27a0d2,null))['catch'](handleError(_0x27a0d2,null));};exports[_0x14f8('0x4b')]=function(_0x38018a,_0x34e190){var _0xe461db=moment()['unix']()['toString']();var _0x313484=path[_0x14f8('0x4c')](config[_0x14f8('0x4d')],'server','files',_0x14f8('0x4e'));var _0x7c6863=path[_0x14f8('0x4c')](config[_0x14f8('0x4d')],_0x14f8('0x4f'),_0x14f8('0x50'),_0x14f8('0x51'));var _0x4a3a60=path['join'](_0x313484,_0xe461db);var _0x1c1eaf=util[_0x14f8('0x43')](_0x14f8('0x52'),_0x38018a[_0x14f8('0x24')]['id'],_0xe461db);var _0x3db1df=path[_0x14f8('0x4c')](_0x313484,_0x1c1eaf);var _0x4dd33c=[];_0x4dd33c[_0x14f8('0x53')]({'model':db[_0x14f8('0x54')],'as':_0x14f8('0x54'),'attributes':['id',_0x14f8('0x55')],'raw':!![]});_0x4dd33c[_0x14f8('0x53')]({'model':db[_0x14f8('0x56')],'as':_0x14f8('0x57'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x38018a[_0x14f8('0x21')]['attachments']){_0x4dd33c[_0x14f8('0x53')]({'model':db[_0x14f8('0x58')],'as':_0x14f8('0x58'),'raw':!![]});}var _0x7d2c41=[{'model':db['WhatsappMessage'],'as':_0x14f8('0x59'),'attributes':['id',_0x14f8('0x2d'),_0x14f8('0x5a'),_0x14f8('0x5b'),_0x14f8('0x5c'),_0x14f8('0x5d')],'include':_0x4dd33c}];_0x7d2c41['push']({'model':db[_0x14f8('0x5e')],'as':_0x14f8('0x5f'),'attributes':['id',_0x14f8('0x19')]});_0x7d2c41[_0x14f8('0x53')]({'model':db[_0x14f8('0x54')],'as':_0x14f8('0x60'),'attributes':['id','fullname']});return db[_0x14f8('0x1c')][_0x14f8('0x2b')]({'where':{'id':_0x38018a[_0x14f8('0x24')]['id']},'include':_0x7d2c41})['then'](handleEntityNotFound(_0x34e190,null))[_0x14f8('0x18')](function(_0x334daa){if(_0x334daa){var _0x893143=_0x334daa[_0x14f8('0x61')]({'plain':!![]});fs['mkdirSync'](_0x4a3a60);var _0x58d0c2={'channel':_0x14f8('0x62'),'account':_0x893143[_0x14f8('0x5f')][_0x14f8('0x19')],'agent':_0x893143[_0x14f8('0x60')]?_0x893143['Owner'][_0x14f8('0x55')]:_0x14f8('0x63'),'createdAt':moment(_0x893143[_0x14f8('0x5a')])['format'](_0x14f8('0x44'))['toString'](),'closedAt':_0x893143['closed']?moment(_0x893143[_0x14f8('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x14f8('0x65')]():'','disposition':_0x893143[_0x14f8('0x66')],'messages':_(_0x893143[_0x14f8('0x59')])[_0x14f8('0x3f')]({'secret':![]})[_0x14f8('0x67')](function(_0x45b816){if(_0x45b816[_0x14f8('0x58')]){var _0x1a68d4=path[_0x14f8('0x4c')](_0x7c6863,_0x45b816['Attachment'][_0x14f8('0x68')]);if(fs[_0x14f8('0x69')](_0x1a68d4)){fs[_0x14f8('0x6a')](_0x1a68d4)[_0x14f8('0x6b')](fs[_0x14f8('0x6c')](path['join'](_0x4a3a60,_0x45b816[_0x14f8('0x58')][_0x14f8('0x68')])));}}return{'date':moment(_0x45b816['createdAt'])['format'](_0x14f8('0x44'))[_0x14f8('0x65')](),'sender':_0x45b816[_0x14f8('0x5b')]===_0x14f8('0x6d')?_0x45b816[_0x14f8('0x54')]?_0x45b816[_0x14f8('0x54')][_0x14f8('0x55')]:'System':_0x45b816[_0x14f8('0x57')][_0x14f8('0x6e')]+(_0x45b816[_0x14f8('0x57')][_0x14f8('0x6f')]?'\x20'+_0x45b816['Contact']['lastName']:''),'body':_0x45b816['Attachment']?_0x45b816[_0x14f8('0x58')][_0x14f8('0x68')]:_0x45b816[_0x14f8('0x2d')],'direction':_0x45b816[_0x14f8('0x5b')]===_0x14f8('0x6d')?'A':'C','secret':_0x45b816[_0x14f8('0x5c')],'read':_0x45b816[_0x14f8('0x5d')],'attachment':_0x45b816[_0x14f8('0x58')]};})[_0x14f8('0x70')]()};return ejs[_0x14f8('0x71')](path[_0x14f8('0x4c')](config[_0x14f8('0x4d')],_0x14f8('0x4f'),_0x14f8('0x72'),'downloadInteraction.ejs'),{'interaction':_0x58d0c2})[_0x14f8('0x18')](function(_0x58992){var _0x4bb412=path[_0x14f8('0x4c')](_0x4a3a60,_0x14f8('0x73')+_0x893143['id']+'-'+_0xe461db+_0x14f8('0x74'));var _0x21c421={'path':_0x4bb412,'channel':_0x14f8('0x62'),'interactionId':_0x893143['id']};return pdf[_0x14f8('0x75')](_0x58992,_0x21c421);})[_0x14f8('0x18')](function(){return new BPromise(function(_0x5527d4,_0x198e6f){zipdir(_0x4a3a60,{'saveTo':_0x3db1df},function(_0x42e49f,_0x128eb7){if(_0x42e49f)return _0x198e6f(_0x42e49f);return _0x5527d4(_0x128eb7);});})[_0x14f8('0x18')](function(){return new BPromise(function(_0xb38904,_0x455044){rimraf(_0x4a3a60,function(_0x4007b6){if(_0x4007b6)_0x455044(_0x4007b6);return _0xb38904();});});})['then'](function(){return _0x34e190[_0x14f8('0x4b')](_0x3db1df,_0x1c1eaf,function(_0x21a6c1){if(_0x21a6c1){console[_0x14f8('0x76')](_0x14f8('0x77'),_0x21a6c1);}else{fs[_0x14f8('0x78')](_0x3db1df);}});});});}else{return _0x34e190[_0x14f8('0xf')](0xc8);}})['catch'](handleError(_0x34e190,null));}; \ No newline at end of file +var _0x7caa=['stack','name','send','map','key','getOptions','findAll','query','user','then','catch','show','params','model','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','WhatsappInteraction','find','create','body','describe','addMessage','WhatsappMessage','ids','findOne','keys','hasOwnProperty','nolimit','order','sort','WhatsappInteractionId','filter','where','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','format','closed','closedAt','basename','existsSync','createReadStream','pipe','direction','out','System','Contact','renderFile','views','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','error'];(function(_0x59df15,_0x3637e7){var _0x1e79ad=function(_0x2047da){while(--_0x2047da){_0x59df15['push'](_0x59df15['shift']());}};_0x1e79ad(++_0x3637e7);}(_0x7caa,0xdc));var _0xa7ca=function(_0x1f3739,_0x3db463){_0x1f3739=_0x1f3739-0x0;var _0x37f487=_0x7caa[_0x1f3739];return _0x37f487;};'use strict';var rimraf=require(_0xa7ca('0x0'));var zipdir=require(_0xa7ca('0x1'));var moment=require('moment');var BPromise=require(_0xa7ca('0x2'));var util=require(_0xa7ca('0x3'));var path=require(_0xa7ca('0x4'));var ejs=require(_0xa7ca('0x5'));var fs=require('fs');var _=require(_0xa7ca('0x6'));var Redis=require(_0xa7ca('0x7'));var interaction=require(_0xa7ca('0x8'));var qs=require(_0xa7ca('0x9'));var pdf=require(_0xa7ca('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xa7ca('0xb'))['db'];config[_0xa7ca('0xc')]=_[_0xa7ca('0xd')](config[_0xa7ca('0xc')],{'host':_0xa7ca('0xe'),'port':0x18eb});var socket=require(_0xa7ca('0xf'))(new Redis(config[_0xa7ca('0xc')]));require(_0xa7ca('0x10'))['register'](socket);function respondWithStatusCode(_0x480f9a,_0x23493f){_0x23493f=_0x23493f||0xcc;return function(_0x31bb49){if(_0x31bb49){return _0x480f9a[_0xa7ca('0x11')](_0x23493f);}return _0x480f9a[_0xa7ca('0x12')](_0x23493f)[_0xa7ca('0x13')]();};}function respondWithResult(_0x4e4ce4,_0x1e8ce7){_0x1e8ce7=_0x1e8ce7||0xc8;return function(_0x5928df){if(_0x5928df){return _0x4e4ce4[_0xa7ca('0x12')](_0x1e8ce7)[_0xa7ca('0x14')](_0x5928df);}};}function respondWithFilteredResult(_0x4f2df8,_0x135f14){return function(_0x401820){if(_0x401820){var _0x4cf47e=typeof _0x135f14[_0xa7ca('0x15')]===_0xa7ca('0x16')&&typeof _0x135f14['limit']===_0xa7ca('0x16');var _0x22e65e=_0x401820[_0xa7ca('0x17')];var _0x2c7195=_0x4cf47e?0x0:_0x135f14[_0xa7ca('0x15')];var _0x43e480=_0x4cf47e?_0x401820[_0xa7ca('0x17')]:_0x135f14[_0xa7ca('0x15')]+_0x135f14[_0xa7ca('0x18')];var _0x1ef9ac;if(_0x43e480>=_0x22e65e){_0x43e480=_0x22e65e;_0x1ef9ac=0xc8;}else{_0x1ef9ac=0xce;}_0x4f2df8[_0xa7ca('0x12')](_0x1ef9ac);return _0x4f2df8[_0xa7ca('0x19')](_0xa7ca('0x1a'),_0x2c7195+'-'+_0x43e480+'/'+_0x22e65e)[_0xa7ca('0x14')](_0x401820);}return null;};}function saveUpdates(_0x31f281){return function(_0x2b3442){if(_0x2b3442){return _0x2b3442[_0xa7ca('0x1b')](_0x31f281)['then'](function(_0x120d71){return _0x120d71;});}return null;};}function removeEntity(_0x3a72bc){return function(_0x2535d1){if(_0x2535d1){return _0x2535d1[_0xa7ca('0x1c')]()['then'](function(){_0x3a72bc['status'](0xcc)[_0xa7ca('0x13')]();});}};}function handleEntityNotFound(_0x50911f){return function(_0xc14a7){if(!_0xc14a7){_0x50911f['sendStatus'](0x194);}return _0xc14a7;};}function handleError(_0x32c247,_0x10cc8f){_0x10cc8f=_0x10cc8f||0x1f4;return function(_0x521a0f){logger[_0xa7ca('0x1d')](_0x521a0f[_0xa7ca('0x1e')]);if(_0x521a0f[_0xa7ca('0x1f')]){delete _0x521a0f[_0xa7ca('0x1f')];}_0x32c247['status'](_0x10cc8f)[_0xa7ca('0x20')](_0x521a0f);};}exports['index']=function(_0x48057a,_0x27bc3c){var _0x23e338={};var _0x18e803=_[_0xa7ca('0x21')](db['WhatsappInteraction']['rawAttributes'],function(_0x411390){return{'name':_0x411390['fieldName'],'type':_0x411390['type'][_0xa7ca('0x22')]};});_0x23e338=qs[_0xa7ca('0x23')](_0x18e803,_0x48057a);return interaction[_0xa7ca('0x24')]('whatsapp',_0x48057a[_0xa7ca('0x25')],_0x48057a[_0xa7ca('0x26')],_0x23e338,_0x18e803)[_0xa7ca('0x27')](respondWithFilteredResult(_0x27bc3c,_0x23e338))[_0xa7ca('0x28')](handleError(_0x27bc3c,null));};exports[_0xa7ca('0x29')]=function(_0x2eecfc,_0x1ea31f){var _0x13f93f={'raw':![],'where':{'id':_0x2eecfc[_0xa7ca('0x2a')]['id']}},_0x3ac6f3={};_0x3ac6f3[_0xa7ca('0x2b')]=_['keys'](db['WhatsappInteraction'][_0xa7ca('0x2c')]);_0x3ac6f3['query']=_['keys'](_0x2eecfc[_0xa7ca('0x25')]);_0x3ac6f3[_0xa7ca('0x2d')]=_[_0xa7ca('0x2e')](_0x3ac6f3[_0xa7ca('0x2b')],_0x3ac6f3[_0xa7ca('0x25')]);_0x13f93f[_0xa7ca('0x2f')]=_[_0xa7ca('0x2e')](_0x3ac6f3[_0xa7ca('0x2b')],qs['fields'](_0x2eecfc[_0xa7ca('0x25')][_0xa7ca('0x30')]));_0x13f93f[_0xa7ca('0x2f')]=_0x13f93f['attributes'][_0xa7ca('0x31')]?_0x13f93f[_0xa7ca('0x2f')]:_0x3ac6f3[_0xa7ca('0x2b')];if(_0x2eecfc[_0xa7ca('0x25')][_0xa7ca('0x32')]){_0x13f93f['include']=[{'all':!![]}];}_0x13f93f=_[_0xa7ca('0x33')]({},_0x13f93f,_0x2eecfc['options']);return db[_0xa7ca('0x34')][_0xa7ca('0x35')](_0x13f93f)[_0xa7ca('0x27')](handleEntityNotFound(_0x1ea31f,null))[_0xa7ca('0x27')](respondWithResult(_0x1ea31f,null))[_0xa7ca('0x28')](handleError(_0x1ea31f,null));};exports['create']=function(_0x5407c3,_0xa645a2){return db[_0xa7ca('0x34')][_0xa7ca('0x36')](_0x5407c3[_0xa7ca('0x37')],{})[_0xa7ca('0x27')](respondWithResult(_0xa645a2,0xc9))[_0xa7ca('0x28')](handleError(_0xa645a2,null));};exports[_0xa7ca('0x1b')]=function(_0x371191,_0x1d215b){if(_0x371191[_0xa7ca('0x37')]['id']){delete _0x371191[_0xa7ca('0x37')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x371191[_0xa7ca('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1d215b,null))[_0xa7ca('0x27')](saveUpdates(_0x371191[_0xa7ca('0x37')],null))[_0xa7ca('0x27')](respondWithResult(_0x1d215b,null))[_0xa7ca('0x28')](handleError(_0x1d215b,null));};exports[_0xa7ca('0x1c')]=function(_0xaf1706,_0x3fa799){return db['WhatsappInteraction'][_0xa7ca('0x35')]({'where':{'id':_0xaf1706[_0xa7ca('0x2a')]['id']}})[_0xa7ca('0x27')](handleEntityNotFound(_0x3fa799,null))[_0xa7ca('0x27')](removeEntity(_0x3fa799,null))[_0xa7ca('0x28')](handleError(_0x3fa799,null));};exports[_0xa7ca('0x38')]=function(_0x2f7305,_0x1eacdc){return db[_0xa7ca('0x34')][_0xa7ca('0x38')]()['then'](respondWithResult(_0x1eacdc,null))[_0xa7ca('0x28')](handleError(_0x1eacdc,null));};exports[_0xa7ca('0x39')]=function(_0x93e1c9,_0x23a7a9){return db[_0xa7ca('0x3a')]['find']({'where':{'id':_0x93e1c9['params']['id']}})[_0xa7ca('0x27')](handleEntityNotFound(_0x23a7a9,null))[_0xa7ca('0x27')](function(_0xf9a52d){if(_0xf9a52d){return _0xf9a52d[_0xa7ca('0x39')](_0x93e1c9[_0xa7ca('0x37')][_0xa7ca('0x3b')],_['omit'](_0x93e1c9['body'],[_0xa7ca('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x23a7a9,null))[_0xa7ca('0x28')](handleError(_0x23a7a9,null));};exports['getMessages']=function(_0xcd055f,_0x29f9be){var _0x2e0994={'raw':![],'where':{}};var _0x94d549={};var _0x4fc6ac={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xa7ca('0x3c')]({'where':{'id':_0xcd055f['params']['id']}})[_0xa7ca('0x27')](handleEntityNotFound(_0x29f9be,null))[_0xa7ca('0x27')](function(_0x1ada96){if(_0x1ada96){_0x94d549[_0xa7ca('0x2b')]=_['keys'](db[_0xa7ca('0x3a')][_0xa7ca('0x2c')]);_0x94d549[_0xa7ca('0x25')]=_[_0xa7ca('0x3d')](_0xcd055f['query']);_0x94d549[_0xa7ca('0x2d')]=_['intersection'](_0x94d549[_0xa7ca('0x2b')],_0x94d549[_0xa7ca('0x25')]);_0x2e0994[_0xa7ca('0x2f')]=_[_0xa7ca('0x2e')](_0x94d549[_0xa7ca('0x2b')],qs[_0xa7ca('0x30')](_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x30')]));_0x2e0994['attributes']=_0x2e0994['attributes'][_0xa7ca('0x31')]?_0x2e0994[_0xa7ca('0x2f')]:_0x94d549[_0xa7ca('0x2b')];if(!_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x3e')](_0xa7ca('0x3f'))){_0x2e0994[_0xa7ca('0x18')]=qs[_0xa7ca('0x18')](_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x18')]);_0x2e0994[_0xa7ca('0x15')]=qs[_0xa7ca('0x15')](_0xcd055f['query']['offset']);}_0x2e0994[_0xa7ca('0x40')]=qs['sort'](_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x41')]);_0x2e0994['where']=qs[_0xa7ca('0x2d')](_['pick'](_0xcd055f[_0xa7ca('0x25')],_0x94d549[_0xa7ca('0x2d')]));_0x2e0994['where'][_0xa7ca('0x42')]=_0x1ada96['id'];if(_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x43')]){_0x2e0994['where']=_['merge'](_0x2e0994[_0xa7ca('0x44')],{'$or':_[_0xa7ca('0x21')](_0x2e0994[_0xa7ca('0x2f')],function(_0x55e98f){var _0xe1ff73={};_0xe1ff73[_0x55e98f]={'$like':'%'+_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x43')]+'%'};return _0xe1ff73;})});}if(_0xcd055f[_0xa7ca('0x25')][_0xa7ca('0x45')]){var _0x1c9710=_0xcd055f[_0xa7ca('0x25')]['$gte']['split'](',');var _0x15b985={};_0x15b985[_0x1c9710[0x0]]={'$gte':moment(_0x1c9710[0x1])['format'](_0xa7ca('0x46'))};_0x2e0994['where']=_[_0xa7ca('0x33')](_0x2e0994[_0xa7ca('0x44')],_0x15b985);}_0x2e0994=_['merge']({},_0x2e0994,_0xcd055f['options']);return db[_0xa7ca('0x3a')]['count']({'where':_0x2e0994[_0xa7ca('0x44')]})[_0xa7ca('0x27')](function(_0x238724){_0x4fc6ac[_0xa7ca('0x17')]=_0x238724;if(_0xcd055f['query']['includeAll']){_0x2e0994[_0xa7ca('0x47')]=[{'all':!![]}];}return db[_0xa7ca('0x3a')][_0xa7ca('0x24')](_0x2e0994);})[_0xa7ca('0x27')](function(_0x288fc2){_0x4fc6ac[_0xa7ca('0x48')]=_0x288fc2;return _0x4fc6ac;});}})[_0xa7ca('0x27')](respondWithFilteredResult(_0x29f9be,_0x2e0994))[_0xa7ca('0x28')](handleError(_0x29f9be,null));};exports[_0xa7ca('0x49')]=function(_0x580c94,_0x1530ef){return db[_0xa7ca('0x34')][_0xa7ca('0x35')]({'where':{'id':_0x580c94[_0xa7ca('0x2a')]['id']}})[_0xa7ca('0x27')](handleEntityNotFound(_0x1530ef,null))[_0xa7ca('0x27')](function(_0x4ee80d){if(_0x4ee80d){return _0x4ee80d['setTags'](_0x580c94[_0xa7ca('0x37')][_0xa7ca('0x3b')],_[_0xa7ca('0x4a')](_0x580c94[_0xa7ca('0x37')],[_0xa7ca('0x3b'),'id'])||{})[_0xa7ca('0x4b')](function(){return db[_0xa7ca('0x4c')][_0xa7ca('0x24')]({'attributes':['id',_0xa7ca('0x1f'),_0xa7ca('0x4d')],'where':{'id':_0x580c94['body'][_0xa7ca('0x3b')]}});})[_0xa7ca('0x27')](function(_0x361f4e){socket[_0xa7ca('0x4e')](_0xa7ca('0x4f'),{'id':Number(_0x580c94['params']['id']),'tags':_0x361f4e||[]});return{'id':Number(_0x580c94[_0xa7ca('0x2a')]['id']),'tags':_0x361f4e||[]};});}})[_0xa7ca('0x27')](respondWithResult(_0x1530ef,null))[_0xa7ca('0x28')](handleError(_0x1530ef,null));};exports[_0xa7ca('0x50')]=function(_0x5b70e8,_0x5179e1){return db[_0xa7ca('0x34')][_0xa7ca('0x35')]({'where':{'id':_0x5b70e8['params']['id']}})[_0xa7ca('0x27')](handleEntityNotFound(_0x5179e1,null))[_0xa7ca('0x27')](function(_0x3b8697){if(_0x3b8697){return _0x3b8697[_0xa7ca('0x50')](_0x5b70e8['query'][_0xa7ca('0x3b')]);}})[_0xa7ca('0x27')](respondWithStatusCode(_0x5179e1,null))[_0xa7ca('0x28')](handleError(_0x5179e1,null));};exports['download']=function(_0xbf3c83,_0x176439){var _0x486bbd=moment()[_0xa7ca('0x51')]()[_0xa7ca('0x52')]();var _0xd47033=path[_0xa7ca('0x53')](config[_0xa7ca('0x54')],_0xa7ca('0x55'),'files','tmp');var _0x55c652=path['join'](config[_0xa7ca('0x54')],_0xa7ca('0x55'),_0xa7ca('0x56'),_0xa7ca('0x57'));var _0x195b9d=path[_0xa7ca('0x53')](_0xd47033,_0x486bbd);var _0x4e1b1a=util['format'](_0xa7ca('0x58'),_0xbf3c83[_0xa7ca('0x2a')]['id'],_0x486bbd);var _0x346a29=path[_0xa7ca('0x53')](_0xd47033,_0x4e1b1a);var _0x463c85=[];_0x463c85[_0xa7ca('0x59')]({'model':db['User'],'as':_0xa7ca('0x5a'),'attributes':['id',_0xa7ca('0x5b')],'raw':!![]});_0x463c85[_0xa7ca('0x59')]({'model':db[_0xa7ca('0x5c')],'as':'Contact','attributes':['id',_0xa7ca('0x5d'),_0xa7ca('0x5e')],'raw':!![]});if(_0xbf3c83[_0xa7ca('0x25')][_0xa7ca('0x57')]){_0x463c85[_0xa7ca('0x59')]({'model':db[_0xa7ca('0x5f')],'as':_0xa7ca('0x5f'),'raw':!![]});}var _0x24c8f2=[{'model':db[_0xa7ca('0x3a')],'as':_0xa7ca('0x60'),'attributes':['id',_0xa7ca('0x37'),_0xa7ca('0x61'),'direction',_0xa7ca('0x62'),_0xa7ca('0x63')],'include':_0x463c85}];_0x24c8f2['push']({'model':db[_0xa7ca('0x64')],'as':'Account','attributes':['id',_0xa7ca('0x1f')]});_0x24c8f2[_0xa7ca('0x59')]({'model':db[_0xa7ca('0x5a')],'as':_0xa7ca('0x65'),'attributes':['id','fullname']});return db[_0xa7ca('0x34')]['find']({'where':{'id':_0xbf3c83[_0xa7ca('0x2a')]['id']},'include':_0x24c8f2})[_0xa7ca('0x27')](handleEntityNotFound(_0x176439,null))[_0xa7ca('0x27')](function(_0x5946a0){if(_0x5946a0){var _0x314ded=_0x5946a0[_0xa7ca('0x66')]({'plain':!![]});fs[_0xa7ca('0x67')](_0x195b9d);var _0x242fd2={'channel':_0xa7ca('0x68'),'account':_0x314ded[_0xa7ca('0x69')][_0xa7ca('0x1f')],'agent':_0x314ded[_0xa7ca('0x65')]?_0x314ded[_0xa7ca('0x65')][_0xa7ca('0x5b')]:'N.A.','createdAt':moment(_0x314ded[_0xa7ca('0x61')])[_0xa7ca('0x6a')](_0xa7ca('0x46'))[_0xa7ca('0x52')](),'closedAt':_0x314ded[_0xa7ca('0x6b')]?moment(_0x314ded[_0xa7ca('0x6c')])[_0xa7ca('0x6a')](_0xa7ca('0x46'))[_0xa7ca('0x52')]():'','disposition':_0x314ded['disposition'],'messages':_(_0x314ded[_0xa7ca('0x60')])[_0xa7ca('0x43')]({'secret':![]})[_0xa7ca('0x21')](function(_0x110f5d){if(_0x110f5d['Attachment']){var _0x25dc43=path['join'](_0x55c652,_0x110f5d[_0xa7ca('0x5f')][_0xa7ca('0x6d')]);if(fs[_0xa7ca('0x6e')](_0x25dc43)){fs[_0xa7ca('0x6f')](_0x25dc43)[_0xa7ca('0x70')](fs['createWriteStream'](path[_0xa7ca('0x53')](_0x195b9d,_0x110f5d['Attachment'][_0xa7ca('0x6d')])));}}return{'date':moment(_0x110f5d['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa7ca('0x52')](),'sender':_0x110f5d[_0xa7ca('0x71')]===_0xa7ca('0x72')?_0x110f5d['User']?_0x110f5d[_0xa7ca('0x5a')][_0xa7ca('0x5b')]:_0xa7ca('0x73'):_0x110f5d[_0xa7ca('0x74')][_0xa7ca('0x5d')]+(_0x110f5d[_0xa7ca('0x74')][_0xa7ca('0x5e')]?'\x20'+_0x110f5d[_0xa7ca('0x74')]['lastName']:''),'body':_0x110f5d[_0xa7ca('0x5f')]?_0x110f5d[_0xa7ca('0x5f')][_0xa7ca('0x6d')]:_0x110f5d[_0xa7ca('0x37')],'direction':_0x110f5d['direction']===_0xa7ca('0x72')?'A':'C','secret':_0x110f5d[_0xa7ca('0x62')],'read':_0x110f5d[_0xa7ca('0x63')],'attachment':_0x110f5d[_0xa7ca('0x5f')]};})['value']()};return ejs[_0xa7ca('0x75')](path[_0xa7ca('0x53')](config[_0xa7ca('0x54')],_0xa7ca('0x55'),_0xa7ca('0x76'),'downloadInteraction.ejs'),{'interaction':_0x242fd2})[_0xa7ca('0x27')](function(_0x2a60e2){var _0x1f65a1=path['join'](_0x195b9d,'transcript-'+_0x314ded['id']+'-'+_0x486bbd+_0xa7ca('0x77'));var _0x2d9dd1={'path':_0x1f65a1,'channel':_0xa7ca('0x68'),'interactionId':_0x314ded['id']};return pdf[_0xa7ca('0x78')](_0x2a60e2,_0x2d9dd1);})['then'](function(){return new BPromise(function(_0x4b9fc1,_0xb4a612){zipdir(_0x195b9d,{'saveTo':_0x346a29},function(_0x3588fb,_0x185430){if(_0x3588fb)return _0xb4a612(_0x3588fb);return _0x4b9fc1(_0x185430);});})['then'](function(){return new BPromise(function(_0x4fcd1e,_0x1c6b68){rimraf(_0x195b9d,function(_0x20694f){if(_0x20694f)_0x1c6b68(_0x20694f);return _0x4fcd1e();});});})[_0xa7ca('0x27')](function(){return _0x176439[_0xa7ca('0x79')](_0x346a29,_0x4e1b1a,function(_0x48bfd7){if(_0x48bfd7){console[_0xa7ca('0x7a')](_0xa7ca('0x7b'),_0x48bfd7);}else{fs[_0xa7ca('0x7c')](_0x346a29);}});});});}else{return _0x176439[_0xa7ca('0x11')](0xc8);}})['catch'](handleError(_0x176439,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 2626e59..6954315 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 _0x2182=['events','../../mysqldb','WhatsappInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x495e95,_0xbe3624){var _0x42881e=function(_0x30d012){while(--_0x30d012){_0x495e95['push'](_0x495e95['shift']());}};_0x42881e(++_0xbe3624);}(_0x2182,0xea));var _0x2218=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2182[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x2218('0x0'));var WhatsappInteraction=require(_0x2218('0x1'))['db'][_0x2218('0x2')];var WhatsappMessage=require(_0x2218('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2218('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2218('0x4'),'afterDestroy':_0x2218('0x5')};function emitEvent(_0x3348af){return function(_0x6fd30,_0xf3271d,_0x1e2df1){_0x6fd30[_0x2218('0x6')]({'attributes':['id'],'raw':!![]})[_0x2218('0x7')](function(_0x142d1d){_0x6fd30[_0x2218('0x8')]('Users',_0x142d1d[_0x2218('0x9')](function(_0xed1f79){return{'id':_0xed1f79['id']};}));return WhatsappMessage[_0x2218('0xa')]({'where':{'WhatsappInteractionId':_0x6fd30['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2218('0x7')](function(_0x49df16){_0x6fd30[_0x2218('0x8')](_0x2218('0xb'),_0x49df16[_0x2218('0xc')]);WhatsappInteractionEvents[_0x2218('0xd')](_0x3348af+':'+_0x6fd30['id'],_0x6fd30);WhatsappInteractionEvents['emit'](_0x3348af,_0x6fd30);_0x1e2df1(null);})[_0x2218('0xe')](_0x1e2df1(null));};}for(var e in events){if(events[_0x2218('0xf')](e)){var event=events[e];WhatsappInteraction[_0x2218('0x10')](e,emitEvent(event));}}module[_0x2218('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x4584=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','update','remove','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x4584,0x1cf));var _0x4458=function(_0x1ee04b,_0x554b3d){_0x1ee04b=_0x1ee04b-0x0;var _0x412848=_0x4584[_0x1ee04b];return _0x412848;};'use strict';var EventEmitter=require(_0x4458('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x4458('0x1')];var WhatsappMessage=require(_0x4458('0x2'))['db'][_0x4458('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4458('0x4'),'afterDestroy':_0x4458('0x5')};function emitEvent(_0x37118c){return function(_0x3d12ec,_0x380085,_0xbf85ca){_0x3d12ec[_0x4458('0x6')]({'attributes':['id'],'raw':!![]})[_0x4458('0x7')](function(_0x102b5f){_0x3d12ec['setDataValue'](_0x4458('0x8'),_0x102b5f[_0x4458('0x9')](function(_0x107f1c){return{'id':_0x107f1c['id']};}));return WhatsappMessage[_0x4458('0xa')]({'where':{'WhatsappInteractionId':_0x3d12ec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4458('0x7')](function(_0xfccdb6){_0x3d12ec[_0x4458('0xb')](_0x4458('0xc'),_0xfccdb6[_0x4458('0xd')]);WhatsappInteractionEvents['emit'](_0x37118c+':'+_0x3d12ec['id'],_0x3d12ec);WhatsappInteractionEvents[_0x4458('0xe')](_0x37118c,_0x3d12ec);_0xbf85ca(null);})[_0x4458('0xf')](_0xbf85ca(null));};}for(var e in events){if(events[_0x4458('0x10')](e)){var event=events[e];WhatsappInteraction[_0x4458('0x11')](e,emitEvent(event));}}module[_0x4458('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 9aafdd4..5011ddd 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 _0x9edb=['closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x11b99e,_0x1e19a8){var _0xb61540=function(_0x2dae53){while(--_0x2dae53){_0x11b99e['push'](_0x11b99e['shift']());}};_0xb61540(++_0x1e19a8);}(_0x9edb,0x7b));var _0xb9ed=function(_0x2e99bb,_0x494bda){_0x2e99bb=_0x2e99bb-0x0;var _0x306fe1=_0x9edb[_0x2e99bb];return _0x306fe1;};'use strict';var _=require(_0xb9ed('0x0'));var util=require(_0xb9ed('0x1'));var logger=require(_0xb9ed('0x2'))('api');var moment=require(_0xb9ed('0x3'));var BPromise=require(_0xb9ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9ed('0x5'));var rimraf=require('rimraf');var config=require(_0xb9ed('0x6'));var attributes=require(_0xb9ed('0x7'));module[_0xb9ed('0x8')]=function(_0x2fe40f,_0x563164){return _0x2fe40f[_0xb9ed('0x9')](_0xb9ed('0xa'),attributes,{'tableName':_0xb9ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ef36e,_0x24ebf3,_0x128b1c){if(_0x3ef36e['changed'](_0xb9ed('0xc'))){_0x3ef36e[_0xb9ed('0xd')]=moment()[_0xb9ed('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x128b1c(null,_0x3ef36e);}}});}; \ No newline at end of file +var _0xeae4=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46fd1f,_0x488f41){var _0x53d507=function(_0x27ebc5){while(--_0x27ebc5){_0x46fd1f['push'](_0x46fd1f['shift']());}};_0x53d507(++_0x488f41);}(_0xeae4,0xe8));var _0x4eae=function(_0x5e14cc,_0x2f0ae2){_0x5e14cc=_0x5e14cc-0x0;var _0x4cb34c=_0xeae4[_0x5e14cc];return _0x4cb34c;};'use strict';var _=require(_0x4eae('0x0'));var util=require(_0x4eae('0x1'));var logger=require(_0x4eae('0x2'))(_0x4eae('0x3'));var moment=require(_0x4eae('0x4'));var BPromise=require(_0x4eae('0x5'));var rp=require(_0x4eae('0x6'));var fs=require('fs');var path=require(_0x4eae('0x7'));var rimraf=require(_0x4eae('0x8'));var config=require(_0x4eae('0x9'));var attributes=require('./whatsappInteraction.attributes');module[_0x4eae('0xa')]=function(_0x59cc97,_0x2e5d79){return _0x59cc97[_0x4eae('0xb')](_0x4eae('0xc'),attributes,{'tableName':_0x4eae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c8b35,_0x1c8370,_0x4f7adc){if(_0x4c8b35[_0x4eae('0xe')](_0x4eae('0xf'))){_0x4c8b35['closedAt']=moment()[_0x4eae('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4f7adc(null,_0x4c8b35);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 70ea0fe..8c40a02 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 _0x3b30=['UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','limit','AddTagsToWhatsappInteraction','find','where','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x5672a1,_0x5b303c){var _0x366d06=function(_0x493b34){while(--_0x493b34){_0x5672a1['push'](_0x5672a1['shift']());}};_0x366d06(++_0x5b303c);}(_0x3b30,0x12b));var _0x03b3=function(_0x330d5b,_0x50d6d4){_0x330d5b=_0x330d5b-0x0;var _0x278a10=_0x3b30[_0x330d5b];return _0x278a10;};'use strict';var _=require(_0x03b3('0x0'));var util=require(_0x03b3('0x1'));var moment=require(_0x03b3('0x2'));var BPromise=require(_0x03b3('0x3'));var rs=require(_0x03b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x03b3('0x6'))(_0x03b3('0x7'));var config=require(_0x03b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x03b3('0x9')][_0x03b3('0xa')]({'port':0x232a});config[_0x03b3('0xb')]=_[_0x03b3('0xc')](config[_0x03b3('0xb')],{'host':_0x03b3('0xd'),'port':0x18eb});var socket=require(_0x03b3('0xe'))(new Redis(config[_0x03b3('0xb')]));require(_0x03b3('0xf'))[_0x03b3('0x10')](socket);function respondWithRpcPromise(_0x108b5d,_0x107ad6,_0x36743e){return new BPromise(function(_0x282c7b,_0x159a09){return client[_0x03b3('0x11')](_0x108b5d,_0x36743e)[_0x03b3('0x12')](function(_0x5ed5cd){logger['info'](_0x03b3('0x13'),_0x107ad6,_0x03b3('0x14'));logger[_0x03b3('0x15')](_0x03b3('0x16'),_0x107ad6,'request\x20sent',JSON[_0x03b3('0x17')](_0x5ed5cd));if(_0x5ed5cd[_0x03b3('0x18')]){if(_0x5ed5cd['error']['code']===0x1f4){logger['error'](_0x03b3('0x13'),_0x107ad6,_0x5ed5cd[_0x03b3('0x18')][_0x03b3('0x19')]);return _0x159a09(_0x5ed5cd[_0x03b3('0x18')][_0x03b3('0x19')]);}logger[_0x03b3('0x18')](_0x03b3('0x13'),_0x107ad6,_0x5ed5cd[_0x03b3('0x18')]['message']);return _0x282c7b(_0x5ed5cd[_0x03b3('0x18')]['message']);}else{logger[_0x03b3('0x1a')](_0x03b3('0x13'),_0x107ad6,'request\x20sent');_0x282c7b(_0x5ed5cd[_0x03b3('0x1b')]['message']);}})[_0x03b3('0x1c')](function(_0xecc7e2){logger[_0x03b3('0x18')](_0x03b3('0x13'),_0x107ad6,_0xecc7e2);_0x159a09(_0xecc7e2);});});}exports[_0x03b3('0x1d')]=function(_0x17942b){var _0x377682=this;return new Promise(function(_0x5324a9,_0x4231c3){return db[_0x03b3('0x1e')][_0x03b3('0x1f')](_0x17942b['body'],{'raw':_0x17942b['options']?_0x17942b[_0x03b3('0x20')][_0x03b3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17942b[_0x03b3('0x20')]?_0x17942b[_0x03b3('0x20')]['where']||null:null,'attributes':_0x17942b['options']?_0x17942b[_0x03b3('0x20')]['attributes']||null:null,'limit':_0x17942b[_0x03b3('0x20')]?_0x17942b[_0x03b3('0x20')][_0x03b3('0x22')]||null:null})[_0x03b3('0x12')](function(_0x2e2bb7){logger[_0x03b3('0x1a')](_0x03b3('0x1d'),_0x17942b);logger[_0x03b3('0x15')](_0x03b3('0x1d'),_0x17942b,JSON['stringify'](_0x2e2bb7));_0x5324a9(_0x2e2bb7);})[_0x03b3('0x1c')](function(_0x2df433){logger[_0x03b3('0x18')]('UpdateWhatsappInteraction',_0x2df433[_0x03b3('0x19')],_0x17942b);_0x4231c3(_0x377682[_0x03b3('0x18')](0x1f4,_0x2df433[_0x03b3('0x19')]));});});};exports[_0x03b3('0x23')]=function(_0x192d20){return new Promise(function(_0x5a4197,_0xb0cb33){return db[_0x03b3('0x1e')][_0x03b3('0x24')]({'where':_0x192d20['options']?_0x192d20['options'][_0x03b3('0x25')]||null:null})['then'](function(_0x4d41be){if(_0x4d41be){return _0x4d41be['addTags'](_0x192d20['body'][_0x03b3('0x26')],_[_0x03b3('0x27')](_0x192d20['body'],[_0x03b3('0x26'),'id'])||{});}})['spread'](function(_0x1ea230){logger[_0x03b3('0x1a')](_0x03b3('0x28'),_0x192d20);logger['debug']('AddTags',_0x192d20,JSON['stringify'](_0x1ea230));_0x5a4197(_0x1ea230);})[_0x03b3('0x1c')](function(_0x42f647){logger[_0x03b3('0x18')](_0x03b3('0x28'),_0x42f647['message'],_0x192d20);_0xb0cb33(_this[_0x03b3('0x18')](0x1f4,_0x42f647[_0x03b3('0x19')]));});});}; \ No newline at end of file +var _0x6ae6=['./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','raw','options','attributes','limit','find','where','addTags','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x157085,_0x59346a){var _0x3180c8=function(_0x25a0a0){while(--_0x25a0a0){_0x157085['push'](_0x157085['shift']());}};_0x3180c8(++_0x59346a);}(_0x6ae6,0x1c0));var _0x66ae=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6ae6[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x66ae('0x0'));var moment=require(_0x66ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x66ae('0x2'));var fs=require('fs');var Redis=require(_0x66ae('0x3'));var db=require(_0x66ae('0x4'))['db'];var utils=require(_0x66ae('0x5'));var logger=require(_0x66ae('0x6'))('rpc');var config=require(_0x66ae('0x7'));var jayson=require(_0x66ae('0x8'));var client=jayson[_0x66ae('0x9')][_0x66ae('0xa')]({'port':0x232a});config[_0x66ae('0xb')]=_[_0x66ae('0xc')](config[_0x66ae('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x66ae('0xd'))(new Redis(config[_0x66ae('0xb')]));require(_0x66ae('0xe'))['register'](socket);function respondWithRpcPromise(_0x32a029,_0x1743e1,_0x1ddfd9){return new BPromise(function(_0x412531,_0x2af4ff){return client[_0x66ae('0xf')](_0x32a029,_0x1ddfd9)[_0x66ae('0x10')](function(_0x4f47e3){logger[_0x66ae('0x11')](_0x66ae('0x12'),_0x1743e1,_0x66ae('0x13'));logger[_0x66ae('0x14')](_0x66ae('0x15'),_0x1743e1,_0x66ae('0x13'),JSON[_0x66ae('0x16')](_0x4f47e3));if(_0x4f47e3[_0x66ae('0x17')]){if(_0x4f47e3[_0x66ae('0x17')][_0x66ae('0x18')]===0x1f4){logger['error'](_0x66ae('0x12'),_0x1743e1,_0x4f47e3[_0x66ae('0x17')]['message']);return _0x2af4ff(_0x4f47e3['error'][_0x66ae('0x19')]);}logger[_0x66ae('0x17')](_0x66ae('0x12'),_0x1743e1,_0x4f47e3[_0x66ae('0x17')][_0x66ae('0x19')]);return _0x412531(_0x4f47e3['error'][_0x66ae('0x19')]);}else{logger[_0x66ae('0x11')](_0x66ae('0x12'),_0x1743e1,_0x66ae('0x13'));_0x412531(_0x4f47e3[_0x66ae('0x1a')][_0x66ae('0x19')]);}})[_0x66ae('0x1b')](function(_0x46b6ae){logger[_0x66ae('0x17')](_0x66ae('0x12'),_0x1743e1,_0x46b6ae);_0x2af4ff(_0x46b6ae);});});}exports[_0x66ae('0x1c')]=function(_0x1e121f){var _0x5e746e=this;return new Promise(function(_0x5a9ab3,_0x2ac3b7){return db[_0x66ae('0x1d')]['update'](_0x1e121f[_0x66ae('0x1e')],{'raw':_0x1e121f['options']?_0x1e121f['options'][_0x66ae('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e121f[_0x66ae('0x20')]?_0x1e121f[_0x66ae('0x20')]['where']||null:null,'attributes':_0x1e121f['options']?_0x1e121f[_0x66ae('0x20')][_0x66ae('0x21')]||null:null,'limit':_0x1e121f[_0x66ae('0x20')]?_0x1e121f[_0x66ae('0x20')][_0x66ae('0x22')]||null:null})[_0x66ae('0x10')](function(_0x37c5e4){logger[_0x66ae('0x11')]('UpdateWhatsappInteraction',_0x1e121f);logger[_0x66ae('0x14')](_0x66ae('0x1c'),_0x1e121f,JSON[_0x66ae('0x16')](_0x37c5e4));_0x5a9ab3(_0x37c5e4);})[_0x66ae('0x1b')](function(_0x41f512){logger[_0x66ae('0x17')](_0x66ae('0x1c'),_0x41f512[_0x66ae('0x19')],_0x1e121f);_0x2ac3b7(_0x5e746e[_0x66ae('0x17')](0x1f4,_0x41f512[_0x66ae('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x12753e){return new Promise(function(_0xf480e4,_0x21e88f){return db[_0x66ae('0x1d')][_0x66ae('0x23')]({'where':_0x12753e[_0x66ae('0x20')]?_0x12753e[_0x66ae('0x20')][_0x66ae('0x24')]||null:null})['then'](function(_0x45234d){if(_0x45234d){return _0x45234d[_0x66ae('0x25')](_0x12753e[_0x66ae('0x1e')][_0x66ae('0x26')],_[_0x66ae('0x27')](_0x12753e['body'],[_0x66ae('0x26'),'id'])||{});}})[_0x66ae('0x28')](function(_0x3a4630){logger[_0x66ae('0x11')](_0x66ae('0x29'),_0x12753e);logger[_0x66ae('0x14')]('AddTags',_0x12753e,JSON[_0x66ae('0x16')](_0x3a4630));_0xf480e4(_0x3a4630);})[_0x66ae('0x1b')](function(_0x355486){logger[_0x66ae('0x17')](_0x66ae('0x29'),_0x355486['message'],_0x12753e);_0x21e88f(_this[_0x66ae('0x17')](0x1f4,_0x355486[_0x66ae('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 1ac2c61..660846e 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 _0x1ce0=['save','remove','update','emit','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x547e27,_0x43f4ad){var _0x4b0697=function(_0xa16261){while(--_0xa16261){_0x547e27['push'](_0x547e27['shift']());}};_0x4b0697(++_0x43f4ad);}(_0x1ce0,0x76));var _0x01ce=function(_0x584f66,_0x39a037){_0x584f66=_0x584f66-0x0;var _0x3908b4=_0x1ce0[_0x584f66];return _0x3908b4;};'use strict';var WhatsappInteractionEvents=require(_0x01ce('0x0'));var events=[_0x01ce('0x1'),_0x01ce('0x2'),_0x01ce('0x3')];function createListener(_0x1b027e,_0x25bd0b){return function(_0xc58ab1){_0x25bd0b[_0x01ce('0x4')](_0x1b027e,_0xc58ab1);};}function removeListener(_0x39eb0d,_0x3c04a9){return function(){WhatsappInteractionEvents['removeListener'](_0x39eb0d,_0x3c04a9);};}exports[_0x01ce('0x5')]=function(_0x5079db){for(var _0x1c033c=0x0,_0x4fa15a=events['length'];_0x1c033c<_0x4fa15a;_0x1c033c++){var _0x5af07c=events[_0x1c033c];var _0x180e19=createListener(_0x01ce('0x6')+_0x5af07c,_0x5079db);WhatsappInteractionEvents['on'](_0x5af07c,_0x180e19);}}; \ No newline at end of file +var _0x55ca=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5e59c2,_0x2ec577){var _0x56625f=function(_0x27c50d){while(--_0x27c50d){_0x5e59c2['push'](_0x5e59c2['shift']());}};_0x56625f(++_0x2ec577);}(_0x55ca,0xe1));var _0xa55c=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x55ca[_0x9cbfe0];return _0x1f1534;};'use strict';var WhatsappInteractionEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),_0xa55c('0x2'),_0xa55c('0x3')];function createListener(_0x50a011,_0x2febec){return function(_0x1a2186){_0x2febec[_0xa55c('0x4')](_0x50a011,_0x1a2186);};}function removeListener(_0x133bb2,_0xb2f47a){return function(){WhatsappInteractionEvents[_0xa55c('0x5')](_0x133bb2,_0xb2f47a);};}exports[_0xa55c('0x6')]=function(_0x18a251){for(var _0x46d179=0x0,_0x2af7e7=events['length'];_0x46d179<_0x2af7e7;_0x46d179++){var _0x287272=events[_0x46d179];var _0x6d61fc=createListener(_0xa55c('0x7')+_0x287272,_0x18a251);WhatsappInteractionEvents['on'](_0x287272,_0x6d61fc);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index cdd4e7a..b4ac6f4 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 _0xac42=['whatsapp','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','express','Router','fs-extra','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0x1e8326,_0x4791d8){var _0x5417e5=function(_0x294ce7){while(--_0x294ce7){_0x1e8326['push'](_0x1e8326['shift']());}};_0x5417e5(++_0x4791d8);}(_0xac42,0x1e7));var _0x2ac4=function(_0x58eed6,_0x49a046){_0x58eed6=_0x58eed6-0x0;var _0x381fa7=_0xac42[_0x58eed6];return _0x381fa7;};'use strict';var multer=require(_0x2ac4('0x0'));var util=require('util');var path=require(_0x2ac4('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ac4('0x2'));var router=express[_0x2ac4('0x3')]();var fs_extra=require(_0x2ac4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x2ac4('0x5')]('/',auth[_0x2ac4('0x6')](),controller['index']);router[_0x2ac4('0x5')](_0x2ac4('0x7'),auth['isAuthenticated'](),controller[_0x2ac4('0x8')]);router[_0x2ac4('0x5')](_0x2ac4('0x9'),auth['isAuthenticated'](),controller[_0x2ac4('0xa')]);router[_0x2ac4('0xb')]('/',auth['isAuthenticated'](),interaction[_0x2ac4('0xc')](_0x2ac4('0xd'),'whatsappmessage:create'),controller[_0x2ac4('0xe')]);router[_0x2ac4('0xb')](_0x2ac4('0xf'),controller[_0x2ac4('0x10')]);router[_0x2ac4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2ac4('0x12')]);router['put'](_0x2ac4('0x13'),auth[_0x2ac4('0x6')](),controller[_0x2ac4('0x14')]);router[_0x2ac4('0x11')](_0x2ac4('0x15'),auth[_0x2ac4('0x6')](),controller[_0x2ac4('0x16')]);router[_0x2ac4('0x17')](_0x2ac4('0x9'),auth[_0x2ac4('0x6')](),controller['destroy']);module[_0x2ac4('0x18')]=router; \ No newline at end of file +var _0xa46e=['/:id','show','tracked','whatsapp','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe'];(function(_0x1118f2,_0x5ca780){var _0xa34d18=function(_0x780911){while(--_0x780911){_0x1118f2['push'](_0x1118f2['shift']());}};_0xa34d18(++_0x5ca780);}(_0xa46e,0x65));var _0xea46=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0xa46e[_0x3cf4d3];return _0x4e547b;};'use strict';var multer=require(_0xea46('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea46('0x1'));var express=require(_0xea46('0x2'));var router=express[_0xea46('0x3')]();var fs_extra=require(_0xea46('0x4'));var auth=require(_0xea46('0x5'));var interaction=require(_0xea46('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xea46('0x7')]('/',auth[_0xea46('0x8')](),controller['index']);router[_0xea46('0x7')](_0xea46('0x9'),auth[_0xea46('0x8')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x8')](),controller[_0xea46('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xea46('0xd')](_0xea46('0xe'),'whatsappmessage:create'),controller[_0xea46('0xf')]);router[_0xea46('0x10')](_0xea46('0x11'),controller[_0xea46('0x12')]);router[_0xea46('0x13')](_0xea46('0xb'),auth[_0xea46('0x8')](),controller[_0xea46('0x14')]);router['put'](_0xea46('0x15'),auth['isAuthenticated'](),controller[_0xea46('0x16')]);router[_0xea46('0x13')](_0xea46('0x17'),auth[_0xea46('0x8')](),controller[_0xea46('0x18')]);router[_0xea46('0x19')](_0xea46('0xb'),auth[_0xea46('0x8')](),controller[_0xea46('0x1a')]);module[_0xea46('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 688ab8e..bcd23fa 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 _0x323e=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x5f0d20,_0x106de6){var _0x5be8ba=function(_0x2d2b6a){while(--_0x2d2b6a){_0x5f0d20['push'](_0x5f0d20['shift']());}};_0x5be8ba(++_0x106de6);}(_0x323e,0x188));var _0xe323=function(_0xcae6c9,_0x47c380){_0xcae6c9=_0xcae6c9-0x0;var _0x4d98d7=_0x323e[_0xcae6c9];return _0x4d98d7;};'use strict';var Sequelize=require(_0xe323('0x0'));module[_0xe323('0x1')]={'body':{'type':Sequelize[_0xe323('0x2')](_0xe323('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe323('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe323('0x5')]('in',_0xe323('0x6')),'defaultValue':_0xe323('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe323('0x7')](0xbe)},'phone':{'type':Sequelize[_0xe323('0x7')]},'readAt':{'type':Sequelize[_0xe323('0x8')]},'secret':{'type':Sequelize[_0xe323('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xe323('0x2')]}}; \ No newline at end of file +var _0xa600=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x8ccd7f,_0x34e1ff){var _0x44a3c6=function(_0x154647){while(--_0x154647){_0x8ccd7f['push'](_0x8ccd7f['shift']());}};_0x44a3c6(++_0x34e1ff);}(_0xa600,0x1c7));var _0x0a60=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xa600[_0x5ecadc];return _0x565037;};'use strict';var Sequelize=require(_0x0a60('0x0'));module[_0x0a60('0x1')]={'body':{'type':Sequelize[_0x0a60('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0a60('0x4')]('in',_0x0a60('0x5')),'defaultValue':_0x0a60('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0a60('0x6')]},'readAt':{'type':Sequelize[_0x0a60('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0a60('0x6')]},'providerResponse':{'type':Sequelize[_0x0a60('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7262d23..d57b897 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 _0x9a9d=['SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','redis','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','WhatsappMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','create','body','params','destroy','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual'];(function(_0x3c2958,_0x26bbfb){var _0x39b1cb=function(_0x686e81){while(--_0x686e81){_0x3c2958['push'](_0x3c2958['shift']());}};_0x39b1cb(++_0x26bbfb);}(_0x9a9d,0x1b7));var _0xd9a9=function(_0x36e057,_0x52b965){_0x36e057=_0x36e057-0x0;var _0x4cbac8=_0x9a9d[_0x36e057];return _0x4cbac8;};'use strict';var emlformat=require(_0xd9a9('0x0'));var rimraf=require(_0xd9a9('0x1'));var zipdir=require(_0xd9a9('0x2'));var jsonpatch=require(_0xd9a9('0x3'));var rp=require(_0xd9a9('0x4'));var moment=require('moment');var BPromise=require(_0xd9a9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd9a9('0x6'));var ejs=require(_0xd9a9('0x7'));var fs=require('fs');var fs_extra=require(_0xd9a9('0x8'));var _=require(_0xd9a9('0x9'));var squel=require(_0xd9a9('0xa'));var crypto=require(_0xd9a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd9a9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd9a9('0xd'));var Papa=require(_0xd9a9('0xe'));var Redis=require(_0xd9a9('0xf'));var authService=require(_0xd9a9('0x10'));var qs=require(_0xd9a9('0x11'));var as=require(_0xd9a9('0x12'));var hardwareService=require(_0xd9a9('0x13'));var logger=require('../../config/logger')(_0xd9a9('0x14'));var utils=require(_0xd9a9('0x15'));var config=require(_0xd9a9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd9a9('0x17')]));require(_0xd9a9('0x18'))[_0xd9a9('0x19')](socket);var jayson=require(_0xd9a9('0x1a'));var client=jayson[_0xd9a9('0x1b')][_0xd9a9('0x1c')]({'port':0x232c});var client9002=jayson[_0xd9a9('0x1b')][_0xd9a9('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x319c20,_0x32f04e,_0x40db1b,_0x551395){return new BPromise(function(_0x49e508,_0x4bea4a){var _0x2ad849=_0x551395||client;return _0x2ad849[_0xd9a9('0x1d')](_0x319c20,_0x40db1b)['then'](function(_0x45273c){logger[_0xd9a9('0x1e')](_0xd9a9('0x1f'),_0x32f04e,_0xd9a9('0x20'));logger[_0xd9a9('0x21')](_0xd9a9('0x22'),_0x32f04e,_0xd9a9('0x20'),JSON['stringify'](_0x45273c));if(_0x45273c['error']){if(_0x45273c['error'][_0xd9a9('0x23')]===0x1f4){logger[_0xd9a9('0x24')](_0xd9a9('0x1f'),_0x32f04e,_0x45273c['error'][_0xd9a9('0x25')]);return _0x4bea4a(_0x45273c[_0xd9a9('0x24')][_0xd9a9('0x25')]);}logger[_0xd9a9('0x24')](_0xd9a9('0x1f'),_0x32f04e,_0x45273c[_0xd9a9('0x24')][_0xd9a9('0x25')]);return _0x49e508(_0x45273c[_0xd9a9('0x24')][_0xd9a9('0x25')]);}else{logger['info'](_0xd9a9('0x1f'),_0x32f04e,'request\x20sent');_0x49e508(_0x45273c[_0xd9a9('0x26')][_0xd9a9('0x25')]);}})[_0xd9a9('0x27')](function(_0x3f1638){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x32f04e,_0x3f1638);_0x4bea4a(_0x3f1638);});});}function respondWithStatusCode(_0x16eeb0,_0x4f5b8a){_0x4f5b8a=_0x4f5b8a||0xcc;return function(_0x2b0e61){if(_0x2b0e61){return _0x16eeb0[_0xd9a9('0x28')](_0x4f5b8a);}return _0x16eeb0[_0xd9a9('0x29')](_0x4f5b8a)[_0xd9a9('0x2a')]();};}function respondWithResult(_0x47833a,_0x18457f){_0x18457f=_0x18457f||0xc8;return function(_0x31311e){if(_0x31311e){return _0x47833a['status'](_0x18457f)['json'](_0x31311e);}};}function respondWithFilteredResult(_0x5d6c1d,_0x2b8ee6){return function(_0x3e5968){if(_0x3e5968){var _0xc968b0=typeof _0x2b8ee6['offset']===_0xd9a9('0x2b')&&typeof _0x2b8ee6[_0xd9a9('0x2c')]==='undefined';var _0x16488f=_0x3e5968['count'];var _0x43fead=_0xc968b0?0x0:_0x2b8ee6[_0xd9a9('0x2d')];var _0x4f32aa=_0xc968b0?_0x3e5968[_0xd9a9('0x2e')]:_0x2b8ee6['offset']+_0x2b8ee6[_0xd9a9('0x2c')];var _0x3aa9e5;if(_0x4f32aa>=_0x16488f){_0x4f32aa=_0x16488f;_0x3aa9e5=0xc8;}else{_0x3aa9e5=0xce;}_0x5d6c1d[_0xd9a9('0x29')](_0x3aa9e5);return _0x5d6c1d['set'](_0xd9a9('0x2f'),_0x43fead+'-'+_0x4f32aa+'/'+_0x16488f)[_0xd9a9('0x30')](_0x3e5968);}return null;};}function patchUpdates(_0x272203){return function(_0x3fbb5a){try{jsonpatch[_0xd9a9('0x31')](_0x3fbb5a,_0x272203,!![]);}catch(_0x3b71b7){return BPromise[_0xd9a9('0x32')](_0x3b71b7);}return _0x3fbb5a[_0xd9a9('0x33')]();};}function saveUpdates(_0x360b9c,_0x35de36){return function(_0x43c43e){if(_0x43c43e){return _0x43c43e[_0xd9a9('0x34')](_0x360b9c)[_0xd9a9('0x35')](function(_0x2853c4){return _0x2853c4;});}return null;};}function removeEntity(_0x5764ef,_0x282832){return function(_0x1912cd){if(_0x1912cd){return _0x1912cd['destroy']()['then'](function(){_0x5764ef[_0xd9a9('0x29')](0xcc)[_0xd9a9('0x2a')]();});}};}function handleEntityNotFound(_0x3b8086,_0x334edb){return function(_0x1f82af){if(!_0x1f82af){_0x3b8086[_0xd9a9('0x28')](0x194);}return _0x1f82af;};}function handleError(_0x31d4b4,_0xe153cc){_0xe153cc=_0xe153cc||0x1f4;return function(_0x1236e4){logger[_0xd9a9('0x24')](_0x1236e4[_0xd9a9('0x36')]);if(_0x1236e4[_0xd9a9('0x37')]){delete _0x1236e4['name'];}_0x31d4b4[_0xd9a9('0x29')](_0xe153cc)[_0xd9a9('0x38')](_0x1236e4);};}exports['index']=function(_0x58c005,_0x529e51){var _0x33283d={},_0x1dce4b={},_0x4d5e2c={'count':0x0,'rows':[]};var _0x575951=_[_0xd9a9('0x39')](db[_0xd9a9('0x3a')][_0xd9a9('0x3b')],function(_0x50bb2b){return{'name':_0x50bb2b['fieldName'],'type':_0x50bb2b[_0xd9a9('0x3c')][_0xd9a9('0x3d')]};});_0x1dce4b['model']=_[_0xd9a9('0x39')](_0x575951,_0xd9a9('0x37'));_0x1dce4b[_0xd9a9('0x3e')]=_[_0xd9a9('0x3f')](_0x58c005['query']);_0x1dce4b[_0xd9a9('0x40')]=_[_0xd9a9('0x41')](_0x1dce4b[_0xd9a9('0x42')],_0x1dce4b[_0xd9a9('0x3e')]);_0x33283d[_0xd9a9('0x43')]=_[_0xd9a9('0x41')](_0x1dce4b[_0xd9a9('0x42')],qs[_0xd9a9('0x44')](_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x44')]));_0x33283d[_0xd9a9('0x43')]=_0x33283d[_0xd9a9('0x43')]['length']?_0x33283d['attributes']:_0x1dce4b[_0xd9a9('0x42')];if(!_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x45')]('nolimit')){_0x33283d[_0xd9a9('0x2c')]=qs[_0xd9a9('0x2c')](_0x58c005['query'][_0xd9a9('0x2c')]);_0x33283d[_0xd9a9('0x2d')]=qs[_0xd9a9('0x2d')](_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x2d')]);}_0x33283d['order']=qs[_0xd9a9('0x46')](_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x46')]);_0x33283d[_0xd9a9('0x47')]=qs['filters'](_['pick'](_0x58c005[_0xd9a9('0x3e')],_0x1dce4b[_0xd9a9('0x40')]),_0x575951);if(_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x48')]){_0x33283d[_0xd9a9('0x47')]=_[_0xd9a9('0x49')](_0x33283d[_0xd9a9('0x47')],{'$or':_[_0xd9a9('0x39')](_0x575951,function(_0x56c85e){if(_0x56c85e[_0xd9a9('0x3c')]!==_0xd9a9('0x4a')){var _0x574a17={};_0x574a17[_0x56c85e[_0xd9a9('0x37')]]={'$like':'%'+_0x58c005[_0xd9a9('0x3e')][_0xd9a9('0x48')]+'%'};return _0x574a17;}})});}_0x33283d=_[_0xd9a9('0x49')]({},_0x33283d,_0x58c005['options']);var _0x2e9b6e={'where':_0x33283d[_0xd9a9('0x47')]};return db[_0xd9a9('0x3a')][_0xd9a9('0x2e')](_0x2e9b6e)[_0xd9a9('0x35')](function(_0x12b1ad){_0x4d5e2c['count']=_0x12b1ad;if(_0x58c005['query'][_0xd9a9('0x4b')]){_0x33283d[_0xd9a9('0x4c')]=[{'all':!![]}];}return db[_0xd9a9('0x3a')][_0xd9a9('0x4d')](_0x33283d);})['then'](function(_0x4c40ed){_0x4d5e2c[_0xd9a9('0x4e')]=_0x4c40ed;return _0x4d5e2c;})[_0xd9a9('0x35')](respondWithFilteredResult(_0x529e51,_0x33283d))[_0xd9a9('0x27')](handleError(_0x529e51,null));};exports[_0xd9a9('0x4f')]=function(_0x1bc521,_0x5b1f7a){var _0x36f471={'raw':!![],'where':{'id':_0x1bc521['params']['id']}},_0x412ce5={};_0x412ce5['model']=_[_0xd9a9('0x3f')](db[_0xd9a9('0x3a')]['rawAttributes']);_0x412ce5['query']=_['keys'](_0x1bc521[_0xd9a9('0x3e')]);_0x412ce5[_0xd9a9('0x40')]=_[_0xd9a9('0x41')](_0x412ce5[_0xd9a9('0x42')],_0x412ce5[_0xd9a9('0x3e')]);_0x36f471[_0xd9a9('0x43')]=_[_0xd9a9('0x41')](_0x412ce5[_0xd9a9('0x42')],qs['fields'](_0x1bc521[_0xd9a9('0x3e')][_0xd9a9('0x44')]));_0x36f471[_0xd9a9('0x43')]=_0x36f471[_0xd9a9('0x43')]['length']?_0x36f471[_0xd9a9('0x43')]:_0x412ce5['model'];if(_0x1bc521['query'][_0xd9a9('0x4b')]){_0x36f471[_0xd9a9('0x4c')]=[{'all':!![]}];}_0x36f471=_[_0xd9a9('0x49')]({},_0x36f471,_0x1bc521[_0xd9a9('0x50')]);return db[_0xd9a9('0x3a')][_0xd9a9('0x51')](_0x36f471)[_0xd9a9('0x35')](handleEntityNotFound(_0x5b1f7a,null))[_0xd9a9('0x35')](respondWithResult(_0x5b1f7a,null))[_0xd9a9('0x27')](handleError(_0x5b1f7a,null));};exports[_0xd9a9('0x52')]=function(_0x421105,_0x4a8f04){return db['WhatsappMessage'][_0xd9a9('0x52')](_0x421105[_0xd9a9('0x53')],{})['then'](respondWithResult(_0x4a8f04,0xc9))['catch'](handleError(_0x4a8f04,null));};exports[_0xd9a9('0x34')]=function(_0x32d92d,_0x1cf01e){if(_0x32d92d[_0xd9a9('0x53')]['id']){delete _0x32d92d[_0xd9a9('0x53')]['id'];}return db[_0xd9a9('0x3a')][_0xd9a9('0x51')]({'where':{'id':_0x32d92d[_0xd9a9('0x54')]['id']}})[_0xd9a9('0x35')](handleEntityNotFound(_0x1cf01e,null))[_0xd9a9('0x35')](saveUpdates(_0x32d92d[_0xd9a9('0x53')],null))['then'](respondWithResult(_0x1cf01e,null))['catch'](handleError(_0x1cf01e,null));};exports[_0xd9a9('0x55')]=function(_0x1ca4bc,_0xcb655a){return db[_0xd9a9('0x3a')]['find']({'where':{'id':_0x1ca4bc[_0xd9a9('0x54')]['id']}})[_0xd9a9('0x35')](handleEntityNotFound(_0xcb655a,null))[_0xd9a9('0x35')](removeEntity(_0xcb655a,null))[_0xd9a9('0x27')](handleError(_0xcb655a,null));};exports[_0xd9a9('0x56')]=function(_0x104e75,_0x2c11d0){return db[_0xd9a9('0x3a')][_0xd9a9('0x56')]()[_0xd9a9('0x35')](respondWithResult(_0x2c11d0,null))[_0xd9a9('0x27')](handleError(_0x2c11d0,null));};var interaction_log=require(_0xd9a9('0x57'))(_0xd9a9('0x58'));exports[_0xd9a9('0x59')]=function(_0x3c16a9,_0xa0b1fd,_0x33f73e){var _0x5dc133={'agent':{},'channel':_0xd9a9('0x5a')};if(_0x3c16a9['body']['id']){delete _0x3c16a9['body']['id'];}_0x3c16a9[_0xd9a9('0x53')][_0xd9a9('0x5b')]=!![];_0x3c16a9[_0xd9a9('0x53')][_0xd9a9('0x5c')]=moment()[_0xd9a9('0x5d')](_0xd9a9('0x5e'));_0x3c16a9[_0xd9a9('0x53')][_0xd9a9('0x5f')]=_0x3c16a9[_0xd9a9('0x53')]['UserId']||_0x3c16a9['user']['id'];_0x5dc133[_0xd9a9('0x60')]['id']=_0x3c16a9['body']['UserId'];return db[_0xd9a9('0x3a')][_0xd9a9('0x51')]({'where':{'id':_0x3c16a9['params']['id'],'UserId':null}})[_0xd9a9('0x35')](handleEntityNotFound(_0xa0b1fd,null))[_0xd9a9('0x35')](saveUpdates(_0x3c16a9[_0xd9a9('0x53')],null))['then'](function(_0x35309f){if(_0x35309f){_0x5dc133[_0xd9a9('0x25')]=_0x35309f['get']({'plain':!![]});return db[_0xd9a9('0x61')][_0xd9a9('0x51')]({'where':{'id':_0x35309f['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xa0b1fd,null))[_0xd9a9('0x35')](function(_0x568205){if(_0x568205){return _0x568205[_0xd9a9('0x34')]({'UserId':_0x3c16a9[_0xd9a9('0x53')][_0xd9a9('0x5f')],'read1stAt':_[_0xd9a9('0x62')](_0x568205[_0xd9a9('0x63')])?moment()[_0xd9a9('0x5d')](_0xd9a9('0x5e')):undefined});}return null;})[_0xd9a9('0x35')](function(_0xc75c55){if(_0xc75c55){_0x5dc133[_0xd9a9('0x64')]=_0xc75c55[_0xd9a9('0x65')]({'plain':!![]});interaction_log['info'](_0xd9a9('0x66'),_0x3c16a9[_0xd9a9('0x67')]['id'],_0x3c16a9['user']['name'],_0x3c16a9[_0xd9a9('0x67')][_0xd9a9('0x68')],_0x5dc133['interaction']['id'],_0x3c16a9[_0xd9a9('0x53')]?JSON['stringify'](_0x3c16a9[_0xd9a9('0x53')]):_0xd9a9('0x69'));return respondWithRpcPromise(_0xd9a9('0x6a'),_0xd9a9('0x6b'),_0x5dc133);}return null;})['then'](function(_0x62082a){var _0x532338='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x62082a[_0xd9a9('0x25')][_0xd9a9('0x6c')];return db[_0xd9a9('0x6d')][_0xd9a9('0x3e')](_0x532338,{'type':db[_0xd9a9('0x6e')][_0xd9a9('0x6f')][_0xd9a9('0x70')],'raw':!![]})[_0xd9a9('0x35')](function(_0x4bc62e){return _0x4bc62e;});})[_0xd9a9('0x35')](function(_0x458613){if(_0x458613){_0x5dc133[_0xd9a9('0x25')][_0xd9a9('0x71')]=_0x458613[0x0];if(!_0x3c16a9[_0xd9a9('0x53')]['UserId'])return;return db[_0xd9a9('0x72')][_0xd9a9('0x51')]({'where':{'id':_0x3c16a9[_0xd9a9('0x53')]['UserId'],'role':_0xd9a9('0x60')},'attributes':['id',_0xd9a9('0x37'),'fullname',_0xd9a9('0x73'),'internal'],'raw':!![]});}return null;})[_0xd9a9('0x35')](function(_0x57d815){if(!_0x57d815)return null;_0x5dc133[_0xd9a9('0x25')][_0xd9a9('0x60')]=_0x57d815;return _0x5dc133;})[_0xd9a9('0x35')](function(_0x14a35f){if(_0x14a35f){if(_0x3c16a9[_0xd9a9('0x53')][_0xd9a9('0x74')]){_0x5dc133[_0xd9a9('0x25')]['interface']=util[_0xd9a9('0x5d')](_0xd9a9('0x75'),_0x3c16a9['user'][_0xd9a9('0x37')]);_0x5dc133['message'][_0xd9a9('0x76')]=_0x5dc133['channel'];_0x5dc133['message'][_0xd9a9('0x77')]=_0x5dc133[_0xd9a9('0x76')];_0x5dc133['message'][_0xd9a9('0x78')]=_0xd9a9('0x59');return respondWithRpcPromise('EventManager',_0xd9a9('0x79'),{'event':_0xd9a9('0x7a'),'message':_0x5dc133['message']},client9002)[_0xd9a9('0x35')](function(){return _0x5dc133;});}return _0x5dc133;}return null;})['then'](respondWithResult(_0xa0b1fd,null))['catch'](handleError(_0xa0b1fd,null));};var interaction_log=require(_0xd9a9('0x57'))('whatsapp-interactions');exports[_0xd9a9('0x32')]=function(_0xe6a685,_0x2944a7,_0x1c79b8){var _0x132db9={'agent':{},'channel':_0xd9a9('0x5a')};if(_0xe6a685['body']['id']){delete _0xe6a685[_0xd9a9('0x53')]['id'];}_0xe6a685[_0xd9a9('0x53')]['UserId']=_0xe6a685['body']['UserId']||_0xe6a685[_0xd9a9('0x67')]['id'];_0x132db9['agent']['id']=_0xe6a685[_0xd9a9('0x53')][_0xd9a9('0x5f')];return db['WhatsappMessage'][_0xd9a9('0x51')]({'where':{'id':_0xe6a685[_0xd9a9('0x54')]['id'],'UserId':null}})[_0xd9a9('0x35')](handleEntityNotFound(_0x2944a7,null))['then'](function(_0x29c6f0){if(_0x29c6f0){_0x132db9[_0xd9a9('0x25')]=_0x29c6f0['get']({'plain':!![]});return db[_0xd9a9('0x61')][_0xd9a9('0x51')]({'where':{'id':_0x29c6f0[_0xd9a9('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x2944a7,null))[_0xd9a9('0x35')](function(_0x260dcc){if(_0x260dcc){_0x132db9['interaction']=_0x260dcc['get']({'plain':!![]});interaction_log[_0xd9a9('0x1e')](_0xd9a9('0x7c'),_0xe6a685[_0xd9a9('0x67')]['id'],_0xe6a685[_0xd9a9('0x67')][_0xd9a9('0x37')],_0xe6a685['user'][_0xd9a9('0x68')],_0x132db9[_0xd9a9('0x64')]['id'],_0xe6a685[_0xd9a9('0x53')]?JSON[_0xd9a9('0x7d')](_0xe6a685[_0xd9a9('0x53')]):_0xd9a9('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x132db9);}return null;})[_0xd9a9('0x35')](function(_0x30d3d1){var _0x7261b5=_0xd9a9('0x7e')+_0x30d3d1[_0xd9a9('0x25')][_0xd9a9('0x6c')];return db[_0xd9a9('0x6d')][_0xd9a9('0x3e')](_0x7261b5,{'type':db[_0xd9a9('0x6e')][_0xd9a9('0x6f')]['SELECT'],'raw':!![]})[_0xd9a9('0x35')](function(_0x763436){return _0x763436;});})[_0xd9a9('0x35')](function(_0x795a1c){if(_0x795a1c){_0x132db9[_0xd9a9('0x25')]['contact']=_0x795a1c[0x0];if(!_0xe6a685[_0xd9a9('0x53')]['UserId'])return;return db[_0xd9a9('0x72')][_0xd9a9('0x51')]({'where':{'id':_0xe6a685[_0xd9a9('0x53')]['UserId'],'role':_0xd9a9('0x60')},'attributes':['id',_0xd9a9('0x37'),'fullname',_0xd9a9('0x73'),_0xd9a9('0x7f')],'raw':!![]});}return null;})[_0xd9a9('0x35')](function(_0x47996d){if(!_0x47996d)return null;_0x132db9['message'][_0xd9a9('0x60')]=_0x47996d;return _0x132db9;})['then'](function(_0x238bc9){if(_0x238bc9){_0x238bc9[_0xd9a9('0x25')][_0xd9a9('0x80')]=util[_0xd9a9('0x5d')](_0xd9a9('0x75'),_0xe6a685[_0xd9a9('0x67')][_0xd9a9('0x37')]);_0x238bc9['message']['channel']=_0x132db9[_0xd9a9('0x76')];_0x238bc9[_0xd9a9('0x25')][_0xd9a9('0x77')]=_0x132db9[_0xd9a9('0x76')];_0x238bc9[_0xd9a9('0x25')][_0xd9a9('0x78')]=_0xd9a9('0x32');respondWithRpcPromise(_0xd9a9('0x79'),_0xd9a9('0x79'),{'event':'rejectmessage','message':_0x238bc9[_0xd9a9('0x25')]},client9002);return _0x132db9;}return null;})['then'](respondWithResult(_0x2944a7,null))[_0xd9a9('0x27')](handleError(_0x2944a7,null));};exports['status']=function(_0x217532,_0x373904,_0x1e8813){if(_0x217532['body']['id']){delete _0x217532[_0xd9a9('0x53')]['id'];}var _0x39f4b6;return db[_0xd9a9('0x3a')][_0xd9a9('0x51')]({'where':{'id':_0x217532[_0xd9a9('0x54')]['id']}})[_0xd9a9('0x35')](handleEntityNotFound(_0x373904,null))[_0xd9a9('0x35')](function(_0x94fc2d){if(_0x94fc2d){_0x39f4b6=_0x94fc2d;return db[_0xd9a9('0x81')][_0xd9a9('0x51')]({'where':{'id':_0x94fc2d[_0xd9a9('0x82')]}});}})[_0xd9a9('0x35')](handleEntityNotFound(_0x373904,null))[_0xd9a9('0x35')](function(_0x4bc02a){if(_0x4bc02a){logger[_0xd9a9('0x21')](_0xd9a9('0x83'),'status',_0xd9a9('0x84'),_0x4bc02a[_0xd9a9('0x3c')],util[_0xd9a9('0x85')](_0x217532['body'],{'showHidden':![],'depth':null}));switch(_0x4bc02a['type']){case _0xd9a9('0x86'):if(_0x217532['body'][_0xd9a9('0x87')]&&_0x217532[_0xd9a9('0x53')][_0xd9a9('0x87')]===_0x39f4b6[_0xd9a9('0x88')]&&_0x217532[_0xd9a9('0x53')][_0xd9a9('0x89')]&&_0x217532['body']['MessageStatus']==='read'){return _0x39f4b6[_0xd9a9('0x34')]({'read':!![]});}else{logger[_0xd9a9('0x24')](_0xd9a9('0x8a'),_0xd9a9('0x29'),_0xd9a9('0x86'),util[_0xd9a9('0x85')](_0x217532[_0xd9a9('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x39f4b6;}})[_0xd9a9('0x35')](respondWithResult(_0x373904,null))[_0xd9a9('0x27')](handleError(_0x373904,null));}; \ No newline at end of file +var _0xe3d6=['WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','destroy','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','contact','User','WhatsappAccount','WhatsappAccountId','debug'];(function(_0x116e08,_0x2d12f1){var _0x2eb229=function(_0x579c4e){while(--_0x579c4e){_0x116e08['push'](_0x116e08['shift']());}};_0x2eb229(++_0x2d12f1);}(_0xe3d6,0x12b));var _0x6e3d=function(_0x3cd293,_0x46a982){_0x3cd293=_0x3cd293-0x0;var _0x3ef69f=_0xe3d6[_0x3cd293];return _0x3ef69f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e3d('0x0'));var zipdir=require(_0x6e3d('0x1'));var jsonpatch=require(_0x6e3d('0x2'));var rp=require(_0x6e3d('0x3'));var moment=require(_0x6e3d('0x4'));var BPromise=require(_0x6e3d('0x5'));var Mustache=require(_0x6e3d('0x6'));var util=require(_0x6e3d('0x7'));var path=require('path');var sox=require(_0x6e3d('0x8'));var csv=require(_0x6e3d('0x9'));var ejs=require(_0x6e3d('0xa'));var fs=require('fs');var fs_extra=require(_0x6e3d('0xb'));var _=require(_0x6e3d('0xc'));var squel=require('squel');var crypto=require(_0x6e3d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6e3d('0xe'));var toCsv=require(_0x6e3d('0x9'));var querystring=require(_0x6e3d('0xf'));var Papa=require(_0x6e3d('0x10'));var Redis=require(_0x6e3d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e3d('0x12'));var hardwareService=require(_0x6e3d('0x13'));var logger=require(_0x6e3d('0x14'))(_0x6e3d('0x15'));var utils=require(_0x6e3d('0x16'));var config=require(_0x6e3d('0x17'));var licenseUtil=require(_0x6e3d('0x18'));var db=require(_0x6e3d('0x19'))['db'];config[_0x6e3d('0x1a')]=_[_0x6e3d('0x1b')](config[_0x6e3d('0x1a')],{'host':_0x6e3d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e3d('0x1a')]));require(_0x6e3d('0x1d'))[_0x6e3d('0x1e')](socket);var jayson=require(_0x6e3d('0x1f'));var client=jayson[_0x6e3d('0x20')][_0x6e3d('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x273a5c,_0x3cdc6d,_0x1c5660,_0x45aee8){return new BPromise(function(_0x4f2dda,_0x2880e7){var _0x2ea6d8=_0x45aee8||client;return _0x2ea6d8[_0x6e3d('0x22')](_0x273a5c,_0x1c5660)[_0x6e3d('0x23')](function(_0x40eda0){logger[_0x6e3d('0x24')](_0x6e3d('0x25'),_0x3cdc6d,_0x6e3d('0x26'));logger['debug'](_0x6e3d('0x27'),_0x3cdc6d,_0x6e3d('0x26'),JSON[_0x6e3d('0x28')](_0x40eda0));if(_0x40eda0[_0x6e3d('0x29')]){if(_0x40eda0[_0x6e3d('0x29')][_0x6e3d('0x2a')]===0x1f4){logger[_0x6e3d('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x3cdc6d,_0x40eda0['error'][_0x6e3d('0x2b')]);return _0x2880e7(_0x40eda0[_0x6e3d('0x29')]['message']);}logger[_0x6e3d('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x3cdc6d,_0x40eda0[_0x6e3d('0x29')]['message']);return _0x4f2dda(_0x40eda0[_0x6e3d('0x29')][_0x6e3d('0x2b')]);}else{logger[_0x6e3d('0x24')](_0x6e3d('0x25'),_0x3cdc6d,_0x6e3d('0x26'));_0x4f2dda(_0x40eda0['result'][_0x6e3d('0x2b')]);}})[_0x6e3d('0x2c')](function(_0x46b709){logger[_0x6e3d('0x29')](_0x6e3d('0x25'),_0x3cdc6d,_0x46b709);_0x2880e7(_0x46b709);});});}function respondWithStatusCode(_0x3aa64a,_0x57c2aa){_0x57c2aa=_0x57c2aa||0xcc;return function(_0x59ef51){if(_0x59ef51){return _0x3aa64a[_0x6e3d('0x2d')](_0x57c2aa);}return _0x3aa64a[_0x6e3d('0x2e')](_0x57c2aa)[_0x6e3d('0x2f')]();};}function respondWithResult(_0x430178,_0x211d43){_0x211d43=_0x211d43||0xc8;return function(_0x434165){if(_0x434165){return _0x430178[_0x6e3d('0x2e')](_0x211d43)['json'](_0x434165);}};}function respondWithFilteredResult(_0x56e757,_0xb19e0e){return function(_0x13f4b3){if(_0x13f4b3){var _0x1862f7=typeof _0xb19e0e[_0x6e3d('0x30')]===_0x6e3d('0x31')&&typeof _0xb19e0e[_0x6e3d('0x32')]===_0x6e3d('0x31');var _0x352b34=_0x13f4b3[_0x6e3d('0x33')];var _0xfd2ffe=_0x1862f7?0x0:_0xb19e0e[_0x6e3d('0x30')];var _0x3fe1ce=_0x1862f7?_0x13f4b3[_0x6e3d('0x33')]:_0xb19e0e[_0x6e3d('0x30')]+_0xb19e0e['limit'];var _0x24aeed;if(_0x3fe1ce>=_0x352b34){_0x3fe1ce=_0x352b34;_0x24aeed=0xc8;}else{_0x24aeed=0xce;}_0x56e757[_0x6e3d('0x2e')](_0x24aeed);return _0x56e757[_0x6e3d('0x34')](_0x6e3d('0x35'),_0xfd2ffe+'-'+_0x3fe1ce+'/'+_0x352b34)[_0x6e3d('0x36')](_0x13f4b3);}return null;};}function patchUpdates(_0x24af7f){return function(_0x37e630){try{jsonpatch[_0x6e3d('0x37')](_0x37e630,_0x24af7f,!![]);}catch(_0xc0320e){return BPromise['reject'](_0xc0320e);}return _0x37e630[_0x6e3d('0x38')]();};}function saveUpdates(_0x18d658,_0x29ae11){return function(_0x991f3d){if(_0x991f3d){return _0x991f3d[_0x6e3d('0x39')](_0x18d658)[_0x6e3d('0x23')](function(_0x2f2827){return _0x2f2827;});}return null;};}function removeEntity(_0x2e6ffd,_0xd23c7a){return function(_0x2fe52d){if(_0x2fe52d){return _0x2fe52d['destroy']()[_0x6e3d('0x23')](function(){_0x2e6ffd['status'](0xcc)[_0x6e3d('0x2f')]();});}};}function handleEntityNotFound(_0x5379fd,_0x1632e7){return function(_0xb9dd74){if(!_0xb9dd74){_0x5379fd[_0x6e3d('0x2d')](0x194);}return _0xb9dd74;};}function handleError(_0x222780,_0x400a7d){_0x400a7d=_0x400a7d||0x1f4;return function(_0x232dc6){logger[_0x6e3d('0x29')](_0x232dc6[_0x6e3d('0x3a')]);if(_0x232dc6[_0x6e3d('0x3b')]){delete _0x232dc6[_0x6e3d('0x3b')];}_0x222780[_0x6e3d('0x2e')](_0x400a7d)[_0x6e3d('0x3c')](_0x232dc6);};}exports[_0x6e3d('0x3d')]=function(_0x2238ae,_0x1eda4f){var _0xe94c9={},_0x6f4f0b={},_0x50b92c={'count':0x0,'rows':[]};var _0x1a7719=_['map'](db[_0x6e3d('0x3e')][_0x6e3d('0x3f')],function(_0x394ba3){return{'name':_0x394ba3[_0x6e3d('0x40')],'type':_0x394ba3[_0x6e3d('0x41')][_0x6e3d('0x42')]};});_0x6f4f0b[_0x6e3d('0x43')]=_[_0x6e3d('0x44')](_0x1a7719,_0x6e3d('0x3b'));_0x6f4f0b[_0x6e3d('0x45')]=_[_0x6e3d('0x46')](_0x2238ae['query']);_0x6f4f0b[_0x6e3d('0x47')]=_[_0x6e3d('0x48')](_0x6f4f0b[_0x6e3d('0x43')],_0x6f4f0b['query']);_0xe94c9[_0x6e3d('0x49')]=_['intersection'](_0x6f4f0b[_0x6e3d('0x43')],qs[_0x6e3d('0x4a')](_0x2238ae['query'][_0x6e3d('0x4a')]));_0xe94c9[_0x6e3d('0x49')]=_0xe94c9[_0x6e3d('0x49')][_0x6e3d('0x4b')]?_0xe94c9['attributes']:_0x6f4f0b[_0x6e3d('0x43')];if(!_0x2238ae[_0x6e3d('0x45')][_0x6e3d('0x4c')](_0x6e3d('0x4d'))){_0xe94c9[_0x6e3d('0x32')]=qs[_0x6e3d('0x32')](_0x2238ae[_0x6e3d('0x45')]['limit']);_0xe94c9[_0x6e3d('0x30')]=qs['offset'](_0x2238ae[_0x6e3d('0x45')][_0x6e3d('0x30')]);}_0xe94c9['order']=qs[_0x6e3d('0x4e')](_0x2238ae[_0x6e3d('0x45')][_0x6e3d('0x4e')]);_0xe94c9[_0x6e3d('0x4f')]=qs[_0x6e3d('0x47')](_[_0x6e3d('0x50')](_0x2238ae[_0x6e3d('0x45')],_0x6f4f0b[_0x6e3d('0x47')]),_0x1a7719);if(_0x2238ae[_0x6e3d('0x45')][_0x6e3d('0x51')]){_0xe94c9[_0x6e3d('0x4f')]=_[_0x6e3d('0x52')](_0xe94c9[_0x6e3d('0x4f')],{'$or':_['map'](_0x1a7719,function(_0x2ece3c){if(_0x2ece3c[_0x6e3d('0x41')]!==_0x6e3d('0x53')){var _0x4e8f62={};_0x4e8f62[_0x2ece3c[_0x6e3d('0x3b')]]={'$like':'%'+_0x2238ae['query'][_0x6e3d('0x51')]+'%'};return _0x4e8f62;}})});}_0xe94c9=_['merge']({},_0xe94c9,_0x2238ae[_0x6e3d('0x54')]);var _0x535272={'where':_0xe94c9['where']};return db[_0x6e3d('0x3e')][_0x6e3d('0x33')](_0x535272)[_0x6e3d('0x23')](function(_0x350883){_0x50b92c[_0x6e3d('0x33')]=_0x350883;if(_0x2238ae[_0x6e3d('0x45')][_0x6e3d('0x55')]){_0xe94c9[_0x6e3d('0x56')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x6e3d('0x57')](_0xe94c9);})[_0x6e3d('0x23')](function(_0x193eed){_0x50b92c[_0x6e3d('0x58')]=_0x193eed;return _0x50b92c;})['then'](respondWithFilteredResult(_0x1eda4f,_0xe94c9))[_0x6e3d('0x2c')](handleError(_0x1eda4f,null));};exports[_0x6e3d('0x59')]=function(_0x3bee82,_0x4459f3){var _0x178d03={'raw':!![],'where':{'id':_0x3bee82[_0x6e3d('0x5a')]['id']}},_0x8b86cf={};_0x8b86cf[_0x6e3d('0x43')]=_[_0x6e3d('0x46')](db[_0x6e3d('0x3e')][_0x6e3d('0x3f')]);_0x8b86cf[_0x6e3d('0x45')]=_[_0x6e3d('0x46')](_0x3bee82[_0x6e3d('0x45')]);_0x8b86cf[_0x6e3d('0x47')]=_['intersection'](_0x8b86cf[_0x6e3d('0x43')],_0x8b86cf[_0x6e3d('0x45')]);_0x178d03[_0x6e3d('0x49')]=_['intersection'](_0x8b86cf[_0x6e3d('0x43')],qs['fields'](_0x3bee82[_0x6e3d('0x45')][_0x6e3d('0x4a')]));_0x178d03[_0x6e3d('0x49')]=_0x178d03[_0x6e3d('0x49')][_0x6e3d('0x4b')]?_0x178d03[_0x6e3d('0x49')]:_0x8b86cf[_0x6e3d('0x43')];if(_0x3bee82['query'][_0x6e3d('0x55')]){_0x178d03[_0x6e3d('0x56')]=[{'all':!![]}];}_0x178d03=_[_0x6e3d('0x52')]({},_0x178d03,_0x3bee82[_0x6e3d('0x54')]);return db[_0x6e3d('0x3e')]['find'](_0x178d03)[_0x6e3d('0x23')](handleEntityNotFound(_0x4459f3,null))['then'](respondWithResult(_0x4459f3,null))[_0x6e3d('0x2c')](handleError(_0x4459f3,null));};exports[_0x6e3d('0x5b')]=function(_0x56b978,_0x285585){return db[_0x6e3d('0x3e')][_0x6e3d('0x5b')](_0x56b978[_0x6e3d('0x5c')],{})[_0x6e3d('0x23')](respondWithResult(_0x285585,0xc9))[_0x6e3d('0x2c')](handleError(_0x285585,null));};exports[_0x6e3d('0x39')]=function(_0x544d5d,_0xde8b52){if(_0x544d5d[_0x6e3d('0x5c')]['id']){delete _0x544d5d[_0x6e3d('0x5c')]['id'];}return db[_0x6e3d('0x3e')]['find']({'where':{'id':_0x544d5d[_0x6e3d('0x5a')]['id']}})[_0x6e3d('0x23')](handleEntityNotFound(_0xde8b52,null))[_0x6e3d('0x23')](saveUpdates(_0x544d5d[_0x6e3d('0x5c')],null))['then'](respondWithResult(_0xde8b52,null))['catch'](handleError(_0xde8b52,null));};exports[_0x6e3d('0x5d')]=function(_0x4a8535,_0x149ea0){return db[_0x6e3d('0x3e')][_0x6e3d('0x5e')]({'where':{'id':_0x4a8535[_0x6e3d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x149ea0,null))['then'](removeEntity(_0x149ea0,null))[_0x6e3d('0x2c')](handleError(_0x149ea0,null));};exports[_0x6e3d('0x5f')]=function(_0x324dff,_0xe638c0){return db[_0x6e3d('0x3e')]['describe']()[_0x6e3d('0x23')](respondWithResult(_0xe638c0,null))['catch'](handleError(_0xe638c0,null));};var interaction_log=require('../../config/logger')(_0x6e3d('0x60'));exports[_0x6e3d('0x61')]=function(_0x316b65,_0x276046,_0x14e820){var _0x218574={'agent':{},'channel':_0x6e3d('0x62')};if(_0x316b65[_0x6e3d('0x5c')]['id']){delete _0x316b65[_0x6e3d('0x5c')]['id'];}_0x316b65['body'][_0x6e3d('0x63')]=!![];_0x316b65[_0x6e3d('0x5c')][_0x6e3d('0x64')]=moment()[_0x6e3d('0x65')](_0x6e3d('0x66'));_0x316b65[_0x6e3d('0x5c')][_0x6e3d('0x67')]=_0x316b65[_0x6e3d('0x5c')][_0x6e3d('0x67')]||_0x316b65['user']['id'];_0x218574[_0x6e3d('0x68')]['id']=_0x316b65[_0x6e3d('0x5c')][_0x6e3d('0x67')];return db[_0x6e3d('0x3e')][_0x6e3d('0x5e')]({'where':{'id':_0x316b65[_0x6e3d('0x5a')]['id'],'UserId':null}})[_0x6e3d('0x23')](handleEntityNotFound(_0x276046,null))['then'](saveUpdates(_0x316b65[_0x6e3d('0x5c')],null))[_0x6e3d('0x23')](function(_0x4d1003){if(_0x4d1003){_0x218574['message']=_0x4d1003[_0x6e3d('0x69')]({'plain':!![]});return db[_0x6e3d('0x6a')][_0x6e3d('0x5e')]({'where':{'id':_0x4d1003[_0x6e3d('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x276046,null))['then'](function(_0x23a3e1){if(_0x23a3e1){return _0x23a3e1[_0x6e3d('0x39')]({'UserId':_0x316b65['body']['UserId'],'read1stAt':_['isNil'](_0x23a3e1['read1stAt'])?moment()[_0x6e3d('0x65')](_0x6e3d('0x66')):undefined});}return null;})[_0x6e3d('0x23')](function(_0x3074f3){if(_0x3074f3){_0x218574['interaction']=_0x3074f3['get']({'plain':!![]});interaction_log[_0x6e3d('0x24')](_0x6e3d('0x6c'),_0x316b65['user']['id'],_0x316b65[_0x6e3d('0x6d')][_0x6e3d('0x3b')],_0x316b65[_0x6e3d('0x6d')][_0x6e3d('0x6e')],_0x218574[_0x6e3d('0x6f')]['id'],_0x316b65[_0x6e3d('0x5c')]?JSON['stringify'](_0x316b65[_0x6e3d('0x5c')]):'null');return respondWithRpcPromise(_0x6e3d('0x70'),_0x6e3d('0x71'),_0x218574);}return null;})[_0x6e3d('0x23')](function(_0x104a44){var _0x40a985=_0x6e3d('0x72')+_0x104a44[_0x6e3d('0x2b')][_0x6e3d('0x73')];return db[_0x6e3d('0x74')]['query'](_0x40a985,{'type':db[_0x6e3d('0x75')][_0x6e3d('0x76')][_0x6e3d('0x77')],'raw':!![]})[_0x6e3d('0x23')](function(_0x26f46b){return _0x26f46b;});})[_0x6e3d('0x23')](function(_0x9d8cb8){if(_0x9d8cb8){_0x218574[_0x6e3d('0x2b')]['contact']=_0x9d8cb8[0x0];if(!_0x316b65[_0x6e3d('0x5c')][_0x6e3d('0x67')])return;return db['User'][_0x6e3d('0x5e')]({'where':{'id':_0x316b65['body'][_0x6e3d('0x67')],'role':_0x6e3d('0x68')},'attributes':['id',_0x6e3d('0x3b'),_0x6e3d('0x78'),_0x6e3d('0x79'),'internal'],'raw':!![]});}return null;})[_0x6e3d('0x23')](function(_0xab2eee){if(!_0xab2eee)return null;_0x218574['message']['agent']=_0xab2eee;return _0x218574;})['then'](function(_0x1d9fca){if(_0x1d9fca){if(_0x316b65[_0x6e3d('0x5c')]['manual']){_0x218574['message'][_0x6e3d('0x7a')]=util[_0x6e3d('0x65')](_0x6e3d('0x7b'),_0x316b65[_0x6e3d('0x6d')]['name']);_0x218574['message'][_0x6e3d('0x7c')]=_0x218574[_0x6e3d('0x7c')];_0x218574['message'][_0x6e3d('0x7d')]=_0x218574['channel'];_0x218574[_0x6e3d('0x2b')][_0x6e3d('0x7e')]=_0x6e3d('0x61');return respondWithRpcPromise(_0x6e3d('0x7f'),'EventManager',{'event':_0x6e3d('0x80'),'message':_0x218574['message']},client9002)[_0x6e3d('0x23')](function(){return _0x218574;});}return _0x218574;}return null;})['then'](respondWithResult(_0x276046,null))['catch'](handleError(_0x276046,null));};var interaction_log=require(_0x6e3d('0x14'))(_0x6e3d('0x60'));exports[_0x6e3d('0x81')]=function(_0x1087fb,_0x45c983,_0x34fa2c){var _0x56d31e={'agent':{},'channel':_0x6e3d('0x62')};if(_0x1087fb[_0x6e3d('0x5c')]['id']){delete _0x1087fb[_0x6e3d('0x5c')]['id'];}_0x1087fb[_0x6e3d('0x5c')][_0x6e3d('0x67')]=_0x1087fb['body'][_0x6e3d('0x67')]||_0x1087fb[_0x6e3d('0x6d')]['id'];_0x56d31e[_0x6e3d('0x68')]['id']=_0x1087fb[_0x6e3d('0x5c')][_0x6e3d('0x67')];return db[_0x6e3d('0x3e')][_0x6e3d('0x5e')]({'where':{'id':_0x1087fb[_0x6e3d('0x5a')]['id'],'UserId':null}})[_0x6e3d('0x23')](handleEntityNotFound(_0x45c983,null))[_0x6e3d('0x23')](function(_0x30daf3){if(_0x30daf3){_0x56d31e[_0x6e3d('0x2b')]=_0x30daf3[_0x6e3d('0x69')]({'plain':!![]});return db[_0x6e3d('0x6a')]['find']({'where':{'id':_0x30daf3[_0x6e3d('0x6b')]}});}return null;})[_0x6e3d('0x23')](handleEntityNotFound(_0x45c983,null))[_0x6e3d('0x23')](function(_0x2a4fc5){if(_0x2a4fc5){_0x56d31e[_0x6e3d('0x6f')]=_0x2a4fc5[_0x6e3d('0x69')]({'plain':!![]});interaction_log[_0x6e3d('0x24')](_0x6e3d('0x82'),_0x1087fb[_0x6e3d('0x6d')]['id'],_0x1087fb[_0x6e3d('0x6d')][_0x6e3d('0x3b')],_0x1087fb['user'][_0x6e3d('0x6e')],_0x56d31e['interaction']['id'],_0x1087fb['body']?JSON[_0x6e3d('0x28')](_0x1087fb[_0x6e3d('0x5c')]):_0x6e3d('0x83'));return respondWithRpcPromise(_0x6e3d('0x84'),_0x6e3d('0x85'),_0x56d31e);}return null;})[_0x6e3d('0x23')](function(_0x1315f7){var _0x32cf5f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1315f7['message'][_0x6e3d('0x73')];return db[_0x6e3d('0x74')][_0x6e3d('0x45')](_0x32cf5f,{'type':db['Sequelize'][_0x6e3d('0x76')][_0x6e3d('0x77')],'raw':!![]})[_0x6e3d('0x23')](function(_0x368bba){return _0x368bba;});})[_0x6e3d('0x23')](function(_0x581b12){if(_0x581b12){_0x56d31e[_0x6e3d('0x2b')][_0x6e3d('0x86')]=_0x581b12[0x0];if(!_0x1087fb[_0x6e3d('0x5c')][_0x6e3d('0x67')])return;return db[_0x6e3d('0x87')]['find']({'where':{'id':_0x1087fb[_0x6e3d('0x5c')][_0x6e3d('0x67')],'role':_0x6e3d('0x68')},'attributes':['id',_0x6e3d('0x3b'),_0x6e3d('0x78'),_0x6e3d('0x79'),'internal'],'raw':!![]});}return null;})[_0x6e3d('0x23')](function(_0x3299be){if(!_0x3299be)return null;_0x56d31e[_0x6e3d('0x2b')][_0x6e3d('0x68')]=_0x3299be;return _0x56d31e;})['then'](function(_0x2a31a4){if(_0x2a31a4){_0x2a31a4[_0x6e3d('0x2b')][_0x6e3d('0x7a')]=util[_0x6e3d('0x65')](_0x6e3d('0x7b'),_0x1087fb[_0x6e3d('0x6d')]['name']);_0x2a31a4[_0x6e3d('0x2b')][_0x6e3d('0x7c')]=_0x56d31e['channel'];_0x2a31a4[_0x6e3d('0x2b')][_0x6e3d('0x7d')]=_0x56d31e[_0x6e3d('0x7c')];_0x2a31a4['message'][_0x6e3d('0x7e')]=_0x6e3d('0x81');respondWithRpcPromise(_0x6e3d('0x7f'),'EventManager',{'event':'rejectmessage','message':_0x2a31a4[_0x6e3d('0x2b')]},client9002);return _0x56d31e;}return null;})[_0x6e3d('0x23')](respondWithResult(_0x45c983,null))[_0x6e3d('0x2c')](handleError(_0x45c983,null));};exports[_0x6e3d('0x2e')]=function(_0x193018,_0x4b67cf,_0x2efde2){if(_0x193018[_0x6e3d('0x5c')]['id']){delete _0x193018[_0x6e3d('0x5c')]['id'];}var _0x1db4c1;return db['WhatsappMessage'][_0x6e3d('0x5e')]({'where':{'id':_0x193018[_0x6e3d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b67cf,null))[_0x6e3d('0x23')](function(_0x5a284b){if(_0x5a284b){_0x1db4c1=_0x5a284b;return db[_0x6e3d('0x88')][_0x6e3d('0x5e')]({'where':{'id':_0x5a284b[_0x6e3d('0x89')]}});}})[_0x6e3d('0x23')](handleEntityNotFound(_0x4b67cf,null))[_0x6e3d('0x23')](function(_0x228487){if(_0x228487){logger[_0x6e3d('0x8a')](_0x6e3d('0x8b'),'status',_0x6e3d('0x8c'),_0x228487['type'],util[_0x6e3d('0x8d')](_0x193018[_0x6e3d('0x5c')],{'showHidden':![],'depth':null}));switch(_0x228487[_0x6e3d('0x41')]){case _0x6e3d('0x8e'):if(_0x193018['body']['MessageSid']&&_0x193018[_0x6e3d('0x5c')][_0x6e3d('0x8f')]===_0x1db4c1[_0x6e3d('0x90')]&&_0x193018[_0x6e3d('0x5c')][_0x6e3d('0x91')]&&_0x193018[_0x6e3d('0x5c')]['MessageStatus']===_0x6e3d('0x63')){return _0x1db4c1['update']({'read':!![]});}else{logger[_0x6e3d('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x6e3d('0x2e'),_0x6e3d('0x8e'),util[_0x6e3d('0x8d')](_0x193018[_0x6e3d('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x1db4c1;}})[_0x6e3d('0x23')](respondWithResult(_0x4b67cf,null))[_0x6e3d('0x2c')](handleError(_0x4b67cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index be11734..3481a0b 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 _0xed3c=['WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x1d5497,_0x2c3c3f){var _0x21bc32=function(_0x18e3cc){while(--_0x18e3cc){_0x1d5497['push'](_0x1d5497['shift']());}};_0x21bc32(++_0x2c3c3f);}(_0xed3c,0x1a6));var _0xced3=function(_0x3460e3,_0x23d874){_0x3460e3=_0x3460e3-0x0;var _0x22a450=_0xed3c[_0x3460e3];return _0x22a450;};'use strict';var EventEmitter=require(_0xced3('0x0'));var WhatsappMessage=require(_0xced3('0x1'))['db'][_0xced3('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xced3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xced3('0x4'),'afterDestroy':_0xced3('0x5')};function emitEvent(_0x14488e){return function(_0x5f03e0,_0x51e500,_0x3d3aa0){WhatsappMessageEvents[_0xced3('0x6')](_0x14488e+':'+_0x5f03e0['id'],_0x5f03e0);WhatsappMessageEvents[_0xced3('0x6')](_0x14488e,_0x5f03e0);_0x3d3aa0(null);};}for(var e in events){if(events[_0xced3('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x04b8=['exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3480f2,_0x4947fa){var _0x1e4899=function(_0x4a884f){while(--_0x4a884f){_0x3480f2['push'](_0x3480f2['shift']());}};_0x1e4899(++_0x4947fa);}(_0x04b8,0x159));var _0x804b=function(_0x294c42,_0xbd23ad){_0x294c42=_0x294c42-0x0;var _0x4c73d9=_0x04b8[_0x294c42];return _0x4c73d9;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x804b('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x804b('0x1')](0x0);var events={'afterCreate':_0x804b('0x2'),'afterUpdate':'update','afterDestroy':_0x804b('0x3')};function emitEvent(_0x1cd188){return function(_0x5857dc,_0x3530f6,_0x1c3474){WhatsappMessageEvents[_0x804b('0x4')](_0x1cd188+':'+_0x5857dc['id'],_0x5857dc);WhatsappMessageEvents['emit'](_0x1cd188,_0x5857dc);_0x1c3474(null);};}for(var e in events){if(events[_0x804b('0x5')](e)){var event=events[e];WhatsappMessage[_0x804b('0x6')](e,emitEvent(event));}}module[_0x804b('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 5743a07..2c15a1c 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 _0x7c24=['../../config/logger','api','bluebird','request-promise','node-fetch','path','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','catch','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','err','finally','lodash','util'];(function(_0x2ee712,_0x5a2179){var _0x2e8783=function(_0x1857d3){while(--_0x1857d3){_0x2ee712['push'](_0x2ee712['shift']());}};_0x2e8783(++_0x5a2179);}(_0x7c24,0x186));var _0x47c2=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x7c24[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x47c2('0x0'));var util=require(_0x47c2('0x1'));var logger=require(_0x47c2('0x2'))(_0x47c2('0x3'));var moment=require('moment');var BPromise=require(_0x47c2('0x4'));var rp=require(_0x47c2('0x5'));var fetch=require(_0x47c2('0x6'));var fs=require('fs');var path=require(_0x47c2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x47c2('0x8'));module[_0x47c2('0x9')]=function(_0x5f292f,_0x280b64){return _0x5f292f[_0x47c2('0xa')](_0x47c2('0xb'),attributes,{'tableName':_0x47c2('0xc'),'paranoid':![],'indexes':[{'name':_0x47c2('0xd'),'fields':['messageId']},{'name':_0x47c2('0xe'),'fields':[_0x47c2('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b9e0f,_0x4b8311,_0x1d238a){var _0x515dc0=_0x5f292f[_0x47c2('0x10')];var _0x3ef5c8=_0x1b9e0f[_0x47c2('0x11')]({'plain':!![]});if(_0x3ef5c8[_0x47c2('0x12')][_0x47c2('0x13')]()==='in'||_0x3ef5c8[_0x47c2('0x12')]['toLowerCase']()===_0x47c2('0x14')&&!_0x3ef5c8[_0x47c2('0x15')]&&!_['isNil'](_0x3ef5c8['UserId'])){_0x515dc0[_0x47c2('0x16')][_0x47c2('0x17')]({'where':{'id':_0x3ef5c8[_0x47c2('0x18')]}})['then'](function(_0x5e8787){if(_0x5e8787){_0x5e8787['update']({'lastMsgAt':_0x3ef5c8[_0x47c2('0x19')],'lastMsgDirection':_0x3ef5c8['direction'][_0x47c2('0x13')]()});}})[_0x47c2('0x1a')](function(_0x2010d6){console[_0x47c2('0x1b')](_0x2010d6);});}if(_0x3ef5c8['direction']==='out'&&!_0x3ef5c8['secret']){var _0x49af84;_0x515dc0[_0x47c2('0x1c')][_0x47c2('0x1d')]({'where':{'id':_0x3ef5c8['WhatsappAccountId']},'raw':!![]})['then'](function(_0x1233a1){_0x49af84=_0x1233a1;if(_0x49af84&&_0x49af84[_0x47c2('0x1e')]){switch(_0x49af84['type']){case _0x47c2('0x1f'):var _0xbb554f=require(_0x47c2('0x1f'));if(_0x49af84[_0x47c2('0x20')]&&_0x49af84[_0x47c2('0x21')]&&_0x49af84[_0x47c2('0x22')]){var _0x5b0722=new _0xbb554f(_0x49af84[_0x47c2('0x20')],_0x49af84['authToken']);_0x5b0722['messages']['create']({'body':_0x3ef5c8[_0x47c2('0xf')],'to':_0x47c2('0x23')+_0x3ef5c8['phone'],'from':_0x47c2('0x23')+_0x49af84[_0x47c2('0x22')],'statusCallback':_0x49af84[_0x47c2('0x24')]+_0x47c2('0x25')+_0x3ef5c8['id']+_0x47c2('0x26')+_0x49af84[_0x47c2('0x27')]})[_0x47c2('0x28')](function(_0x5b1ce8){if(_0x5b1ce8[_0x47c2('0x29')]){return _0x1b9e0f[_0x47c2('0x2a')]({'messageId':_0x5b1ce8[_0x47c2('0x29')]});}})[_0x47c2('0x1a')](function(_0x5d3424){logger[_0x47c2('0x1b')](_0x47c2('0x2b'),_0x47c2('0x2c'),'twilio',util[_0x47c2('0x2d')](_0x5d3424,{'showHidden':![],'depth':null}));});}else{logger[_0x47c2('0x1b')](_0x47c2('0x2b'),'afterCreate',_0x47c2('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x47c2('0x2e'):var _0x274e2b=_0x49af84[_0x47c2('0x20')];var _0x47e217=_0x49af84[_0x47c2('0x21')];var _0x2f25e0=_0x49af84[_0x47c2('0x2f')]+_0x47c2('0x30')+_0x274e2b+_0x47c2('0x31');var _0x5e379b={'to':[_0x3ef5c8[_0x47c2('0x22')]],'message':{'type':_0x47c2('0x32'),'text':_0x3ef5c8[_0x47c2('0xf')]}};var _0x2f1f7c={'method':_0x47c2('0x33'),'uri':_0x2f25e0,'headers':{'Authorization':'Bearer\x20'+_0x47e217,'Content-Type':_0x47c2('0x34')},'body':_0x5e379b,'json':!![]};rp(_0x2f1f7c)[_0x47c2('0x28')](function(_0x240afa){if(_0x240afa['statuses'][0x0]['message_id']){return _0x1b9e0f[_0x47c2('0x2a')]({'messageId':_0x240afa[_0x47c2('0x35')][0x0]['message_id']});}})[_0x47c2('0x1a')](function(_0x51433a){logger[_0x47c2('0x36')]('WhatsappMessage,\x20%s',_0x51433a);});break;}}})[_0x47c2('0x37')](function(){_0x1d238a();});}else{_0x1d238a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd720=['whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','err','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','authToken','phone','accountSid','create'];(function(_0x3996b6,_0x5862a3){var _0x5c9807=function(_0x364549){while(--_0x364549){_0x3996b6['push'](_0x3996b6['shift']());}};_0x5c9807(++_0x5862a3);}(_0xd720,0x8f));var _0x0d72=function(_0x1c1798,_0x24812b){_0x1c1798=_0x1c1798-0x0;var _0x4f235e=_0xd720[_0x1c1798];return _0x4f235e;};'use strict';var _=require('lodash');var util=require(_0x0d72('0x0'));var logger=require(_0x0d72('0x1'))(_0x0d72('0x2'));var moment=require(_0x0d72('0x3'));var BPromise=require(_0x0d72('0x4'));var rp=require('request-promise');var fetch=require(_0x0d72('0x5'));var fs=require('fs');var path=require(_0x0d72('0x6'));var rimraf=require(_0x0d72('0x7'));var config=require(_0x0d72('0x8'));var attributes=require(_0x0d72('0x9'));module[_0x0d72('0xa')]=function(_0x5035ea,_0x203605){return _0x5035ea[_0x0d72('0xb')](_0x0d72('0xc'),attributes,{'tableName':_0x0d72('0xd'),'paranoid':![],'indexes':[{'name':_0x0d72('0xe'),'fields':[_0x0d72('0xe')]},{'name':_0x0d72('0xf'),'fields':[_0x0d72('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59e501,_0x31fcda,_0x1fa3cf){var _0x36ce1a=_0x5035ea[_0x0d72('0x11')];var _0x13ab54=_0x59e501['get']({'plain':!![]});if(_0x13ab54[_0x0d72('0x12')]['toLowerCase']()==='in'||_0x13ab54[_0x0d72('0x12')][_0x0d72('0x13')]()===_0x0d72('0x14')&&!_0x13ab54['secret']&&!_[_0x0d72('0x15')](_0x13ab54[_0x0d72('0x16')])){_0x36ce1a[_0x0d72('0x17')][_0x0d72('0x18')]({'where':{'id':_0x13ab54[_0x0d72('0x19')]}})['then'](function(_0x3947a7){if(_0x3947a7){_0x3947a7['update']({'lastMsgAt':_0x13ab54[_0x0d72('0x1a')],'lastMsgDirection':_0x13ab54[_0x0d72('0x12')]['toLowerCase']()});}})[_0x0d72('0x1b')](function(_0x276a21){console[_0x0d72('0x1c')](_0x276a21);});}if(_0x13ab54[_0x0d72('0x12')]==='out'&&!_0x13ab54[_0x0d72('0x1d')]){var _0x1a76a6;_0x36ce1a[_0x0d72('0x1e')][_0x0d72('0x1f')]({'where':{'id':_0x13ab54[_0x0d72('0x20')]},'raw':!![]})[_0x0d72('0x21')](function(_0x92142f){_0x1a76a6=_0x92142f;if(_0x1a76a6&&_0x1a76a6['type']){switch(_0x1a76a6[_0x0d72('0x22')]){case _0x0d72('0x23'):var _0x59b850=require('twilio');if(_0x1a76a6['accountSid']&&_0x1a76a6[_0x0d72('0x24')]&&_0x1a76a6[_0x0d72('0x25')]){var _0x537a4f=new _0x59b850(_0x1a76a6[_0x0d72('0x26')],_0x1a76a6['authToken']);_0x537a4f['messages'][_0x0d72('0x27')]({'body':_0x13ab54['body'],'to':_0x0d72('0x28')+_0x13ab54[_0x0d72('0x25')],'from':_0x0d72('0x28')+_0x1a76a6[_0x0d72('0x25')],'statusCallback':_0x1a76a6[_0x0d72('0x29')]+_0x0d72('0x2a')+_0x13ab54['id']+'/status?token='+_0x1a76a6[_0x0d72('0x2b')]})[_0x0d72('0x21')](function(_0x442c9a){if(_0x442c9a[_0x0d72('0x2c')]){return _0x59e501[_0x0d72('0x2d')]({'messageId':_0x442c9a[_0x0d72('0x2c')]});}})['catch'](function(_0x16f1ac){logger[_0x0d72('0x1c')](_0x0d72('0x2e'),_0x0d72('0x2f'),_0x0d72('0x23'),util[_0x0d72('0x30')](_0x16f1ac,{'showHidden':![],'depth':null}));});}else{logger[_0x0d72('0x1c')](_0x0d72('0x2e'),_0x0d72('0x2f'),_0x0d72('0x23'),_0x0d72('0x31'));}break;case'sinch':var _0x1b70f0=_0x1a76a6[_0x0d72('0x26')];var _0x35dd49=_0x1a76a6[_0x0d72('0x24')];var _0x4a674b=_0x1a76a6[_0x0d72('0x32')]+_0x0d72('0x33')+_0x1b70f0+_0x0d72('0x34');var _0x453126={'to':[_0x13ab54[_0x0d72('0x25')]],'message':{'type':_0x0d72('0x35'),'text':_0x13ab54['body']}};var _0x1e6b43={'method':_0x0d72('0x36'),'uri':_0x4a674b,'headers':{'Authorization':_0x0d72('0x37')+_0x35dd49,'Content-Type':_0x0d72('0x38')},'body':_0x453126,'json':!![]};rp(_0x1e6b43)[_0x0d72('0x21')](function(_0x41fb6d){if(_0x41fb6d[_0x0d72('0x39')][0x0]['message_id']){return _0x59e501[_0x0d72('0x2d')]({'messageId':_0x41fb6d[_0x0d72('0x39')][0x0]['message_id']});}})[_0x0d72('0x1b')](function(_0x23c93d){logger[_0x0d72('0x3a')]('WhatsappMessage,\x20%s',_0x23c93d);});break;}}})[_0x0d72('0x3b')](function(){_0x1fa3cf();});}else{_0x1fa3cf();}}},'charset':'utf8mb4','collate':_0x0d72('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 299dcd9..fba39fd 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 _0xf50d=['CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4a092d,_0x2e38e0){var _0x3cab90=function(_0x5e10a3){while(--_0x5e10a3){_0x4a092d['push'](_0x4a092d['shift']());}};_0x3cab90(++_0x2e38e0);}(_0xf50d,0xb0));var _0xdf50=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xf50d[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xdf50('0x0'));var util=require('util');var moment=require(_0xdf50('0x1'));var BPromise=require(_0xdf50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf50('0x3'));var db=require(_0xdf50('0x4'))['db'];var utils=require(_0xdf50('0x5'));var logger=require('../../config/logger')(_0xdf50('0x6'));var config=require(_0xdf50('0x7'));var jayson=require(_0xdf50('0x8'));var client=jayson[_0xdf50('0x9')][_0xdf50('0xa')]({'port':0x232a});config[_0xdf50('0xb')]=_[_0xdf50('0xc')](config['redis'],{'host':_0xdf50('0xd'),'port':0x18eb});var socket=require(_0xdf50('0xe'))(new Redis(config[_0xdf50('0xb')]));require(_0xdf50('0xf'))[_0xdf50('0x10')](socket);function respondWithRpcPromise(_0x571738,_0x33504a,_0x45927c){return new BPromise(function(_0x22699c,_0xd8f6b0){return client[_0xdf50('0x11')](_0x571738,_0x45927c)[_0xdf50('0x12')](function(_0x29e1a6){logger[_0xdf50('0x13')](_0xdf50('0x14'),_0x33504a,_0xdf50('0x15'));logger[_0xdf50('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x33504a,_0xdf50('0x15'),JSON[_0xdf50('0x17')](_0x29e1a6));if(_0x29e1a6[_0xdf50('0x18')]){if(_0x29e1a6[_0xdf50('0x18')][_0xdf50('0x19')]===0x1f4){logger[_0xdf50('0x18')](_0xdf50('0x14'),_0x33504a,_0x29e1a6['error'][_0xdf50('0x1a')]);return _0xd8f6b0(_0x29e1a6[_0xdf50('0x18')][_0xdf50('0x1a')]);}logger[_0xdf50('0x18')](_0xdf50('0x14'),_0x33504a,_0x29e1a6[_0xdf50('0x18')]['message']);return _0x22699c(_0x29e1a6[_0xdf50('0x18')][_0xdf50('0x1a')]);}else{logger[_0xdf50('0x13')](_0xdf50('0x14'),_0x33504a,_0xdf50('0x15'));_0x22699c(_0x29e1a6[_0xdf50('0x1b')][_0xdf50('0x1a')]);}})['catch'](function(_0x4d657b){logger[_0xdf50('0x18')](_0xdf50('0x14'),_0x33504a,_0x4d657b);_0xd8f6b0(_0x4d657b);});});}exports[_0xdf50('0x1c')]=function(_0x42492a){var _0x20e437=this;return new Promise(function(_0xada8cb,_0x1ed022){return db[_0xdf50('0x1d')][_0xdf50('0x1e')](_0x42492a['body'],{'raw':_0x42492a[_0xdf50('0x1f')]?_0x42492a[_0xdf50('0x1f')][_0xdf50('0x20')]===undefined?!![]:![]:!![]})[_0xdf50('0x12')](function(_0x6b5c5a){logger[_0xdf50('0x13')](_0xdf50('0x1c'),_0x42492a);logger[_0xdf50('0x16')](_0xdf50('0x1c'),_0x42492a,JSON[_0xdf50('0x17')](_0x6b5c5a));_0xada8cb(_0x6b5c5a);})[_0xdf50('0x21')](function(_0x296da0){logger[_0xdf50('0x18')](_0xdf50('0x1c'),_0x296da0[_0xdf50('0x1a')],_0x42492a);_0x1ed022(_0x20e437[_0xdf50('0x18')](0x1f4,_0x296da0['message']));});});}; \ No newline at end of file +var _0xd584=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','options','CreateWhatsappMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d93c9,_0x444c92){var _0x636d5f=function(_0x1efb83){while(--_0x1efb83){_0x2d93c9['push'](_0x2d93c9['shift']());}};_0x636d5f(++_0x444c92);}(_0xd584,0xe1));var _0x4d58=function(_0x3d3647,_0x42ed9f){_0x3d3647=_0x3d3647-0x0;var _0x404cc7=_0xd584[_0x3d3647];return _0x404cc7;};'use strict';var _=require('lodash');var util=require(_0x4d58('0x0'));var moment=require(_0x4d58('0x1'));var BPromise=require(_0x4d58('0x2'));var rs=require(_0x4d58('0x3'));var fs=require('fs');var Redis=require(_0x4d58('0x4'));var db=require(_0x4d58('0x5'))['db'];var utils=require(_0x4d58('0x6'));var logger=require(_0x4d58('0x7'))(_0x4d58('0x8'));var config=require(_0x4d58('0x9'));var jayson=require(_0x4d58('0xa'));var client=jayson['client'][_0x4d58('0xb')]({'port':0x232a});config[_0x4d58('0xc')]=_[_0x4d58('0xd')](config['redis'],{'host':_0x4d58('0xe'),'port':0x18eb});var socket=require(_0x4d58('0xf'))(new Redis(config[_0x4d58('0xc')]));require(_0x4d58('0x10'))[_0x4d58('0x11')](socket);function respondWithRpcPromise(_0x185688,_0x4976d8,_0x3ed3af){return new BPromise(function(_0x301cec,_0x3b5b75){return client[_0x4d58('0x12')](_0x185688,_0x3ed3af)[_0x4d58('0x13')](function(_0x5c92df){logger[_0x4d58('0x14')](_0x4d58('0x15'),_0x4976d8,_0x4d58('0x16'));logger[_0x4d58('0x17')](_0x4d58('0x18'),_0x4976d8,_0x4d58('0x16'),JSON[_0x4d58('0x19')](_0x5c92df));if(_0x5c92df[_0x4d58('0x1a')]){if(_0x5c92df[_0x4d58('0x1a')]['code']===0x1f4){logger['error'](_0x4d58('0x15'),_0x4976d8,_0x5c92df[_0x4d58('0x1a')]['message']);return _0x3b5b75(_0x5c92df[_0x4d58('0x1a')][_0x4d58('0x1b')]);}logger[_0x4d58('0x1a')]('WhatsappMessage,\x20%s,\x20%s',_0x4976d8,_0x5c92df['error'][_0x4d58('0x1b')]);return _0x301cec(_0x5c92df[_0x4d58('0x1a')]['message']);}else{logger[_0x4d58('0x14')](_0x4d58('0x15'),_0x4976d8,'request\x20sent');_0x301cec(_0x5c92df[_0x4d58('0x1c')][_0x4d58('0x1b')]);}})[_0x4d58('0x1d')](function(_0x4127e5){logger[_0x4d58('0x1a')]('WhatsappMessage,\x20%s,\x20%s',_0x4976d8,_0x4127e5);_0x3b5b75(_0x4127e5);});});}exports['CreateWhatsappMessage']=function(_0xbef87d){var _0x42db14=this;return new Promise(function(_0x9abe63,_0x4b1be3){return db['WhatsappMessage']['create'](_0xbef87d[_0x4d58('0x1e')],{'raw':_0xbef87d[_0x4d58('0x1f')]?_0xbef87d[_0x4d58('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4d58('0x13')](function(_0x3e9c44){logger['info'](_0x4d58('0x20'),_0xbef87d);logger[_0x4d58('0x17')](_0x4d58('0x20'),_0xbef87d,JSON[_0x4d58('0x19')](_0x3e9c44));_0x9abe63(_0x3e9c44);})['catch'](function(_0x4d9414){logger[_0x4d58('0x1a')](_0x4d58('0x20'),_0x4d9414['message'],_0xbef87d);_0x4b1be3(_0x42db14['error'](0x1f4,_0x4d9414[_0x4d58('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 860cdb0..10d0710 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 _0x126c=['update','emit','register','length','whatsappMessage:','remove'];(function(_0x266408,_0x5d9ffc){var _0x1769e3=function(_0x182fa4){while(--_0x182fa4){_0x266408['push'](_0x266408['shift']());}};_0x1769e3(++_0x5d9ffc);}(_0x126c,0x1c1));var _0xc126=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x126c[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xc126('0x0'),_0xc126('0x1')];function createListener(_0x5d0f60,_0x35b130){return function(_0x466b98){_0x35b130[_0xc126('0x2')](_0x5d0f60,_0x466b98);};}function removeListener(_0x4652a1,_0x1533ad){return function(){WhatsappMessageEvents['removeListener'](_0x4652a1,_0x1533ad);};}exports[_0xc126('0x3')]=function(_0x2a0930){for(var _0x59ec7f=0x0,_0x294985=events[_0xc126('0x4')];_0x59ec7f<_0x294985;_0x59ec7f++){var _0x3d3e4f=events[_0x59ec7f];var _0x3fd32b=createListener(_0xc126('0x5')+_0x3d3e4f,_0x2a0930);WhatsappMessageEvents['on'](_0x3d3e4f,_0x3fd32b);}}; \ No newline at end of file +var _0xdc57=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc57,0xfe));var _0x7dc5=function(_0x2c59a6,_0x106f5d){_0x2c59a6=_0x2c59a6-0x0;var _0x5b543f=_0xdc57[_0x2c59a6];return _0x5b543f;};'use strict';var WhatsappMessageEvents=require(_0x7dc5('0x0'));var events=[_0x7dc5('0x1'),_0x7dc5('0x2'),_0x7dc5('0x3')];function createListener(_0x4e1b56,_0x479d99){return function(_0xfac14f){_0x479d99[_0x7dc5('0x4')](_0x4e1b56,_0xfac14f);};}function removeListener(_0x5170e0,_0x529270){return function(){WhatsappMessageEvents[_0x7dc5('0x5')](_0x5170e0,_0x529270);};}exports[_0x7dc5('0x6')]=function(_0x459d89){for(var _0x5ae5fb=0x0,_0x5c9a65=events[_0x7dc5('0x7')];_0x5ae5fb<_0x5c9a65;_0x5ae5fb++){var _0x4389d7=events[_0x5ae5fb];var _0x1b1270=createListener(_0x7dc5('0x8')+_0x4389d7,_0x459d89);WhatsappMessageEvents['on'](_0x4389d7,_0x1b1270);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3f044e3..f6f495c 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 _0x33bf=['/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams'];(function(_0x5208fa,_0x2e0115){var _0x340255=function(_0x243db1){while(--_0x243db1){_0x5208fa['push'](_0x5208fa['shift']());}};_0x340255(++_0x2e0115);}(_0x33bf,0xfb));var _0xf33b=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0x33bf[_0x21b706];return _0x13b94a;};'use strict';var multer=require(_0xf33b('0x0'));var util=require(_0xf33b('0x1'));var path=require(_0xf33b('0x2'));var timeout=require(_0xf33b('0x3'));var express=require(_0xf33b('0x4'));var router=express['Router']();var fs_extra=require(_0xf33b('0x5'));var auth=require(_0xf33b('0x6'));var interaction=require(_0xf33b('0x7'));var config=require(_0xf33b('0x8'));var controller=require(_0xf33b('0x9'));router[_0xf33b('0xa')]('/',auth[_0xf33b('0xb')](),controller[_0xf33b('0xc')]);router['get'](_0xf33b('0xd'),auth[_0xf33b('0xb')](),controller[_0xf33b('0xe')]);router[_0xf33b('0xa')](_0xf33b('0xf'),auth[_0xf33b('0xb')](),controller[_0xf33b('0x10')]);router['get']('/:id/members',auth[_0xf33b('0xb')](),controller[_0xf33b('0x11')]);router['get']('/:id/teams',auth[_0xf33b('0xb')](),controller[_0xf33b('0x12')]);router[_0xf33b('0xa')](_0xf33b('0x13'),auth[_0xf33b('0xb')](),controller[_0xf33b('0x14')]);router[_0xf33b('0x15')]('/',auth[_0xf33b('0xb')](),controller[_0xf33b('0x16')]);router[_0xf33b('0x15')](_0xf33b('0x17'),auth['isAuthenticated'](),controller[_0xf33b('0x18')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xf33b('0x19')]);router['put'](_0xf33b('0xf'),auth[_0xf33b('0xb')](),controller[_0xf33b('0x1a')]);router['delete'](_0xf33b('0xf'),auth[_0xf33b('0xb')](),controller['destroy']);router[_0xf33b('0x1b')]('/:id/teams',auth[_0xf33b('0xb')](),controller['removeTeams']);router['delete'](_0xf33b('0x13'),auth[_0xf33b('0xb')](),controller[_0xf33b('0x1c')]);module[_0xf33b('0x1d')]=router; \ No newline at end of file +var _0x7a82=['addAgents','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post'];(function(_0x1d219c,_0x50820a){var _0x3d9fde=function(_0x2e5b62){while(--_0x2e5b62){_0x1d219c['push'](_0x1d219c['shift']());}};_0x3d9fde(++_0x50820a);}(_0x7a82,0x17d));var _0x27a8=function(_0x93ba08,_0x3fc6a5){_0x93ba08=_0x93ba08-0x0;var _0x50df7c=_0x7a82[_0x93ba08];return _0x50df7c;};'use strict';var multer=require('multer');var util=require(_0x27a8('0x0'));var path=require(_0x27a8('0x1'));var timeout=require(_0x27a8('0x2'));var express=require(_0x27a8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x27a8('0x4'));var interaction=require(_0x27a8('0x5'));var config=require(_0x27a8('0x6'));var controller=require('./whatsappQueue.controller');router[_0x27a8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x27a8('0x7')]('/describe',auth[_0x27a8('0x8')](),controller['describe']);router['get'](_0x27a8('0x9'),auth['isAuthenticated'](),controller[_0x27a8('0xa')]);router[_0x27a8('0x7')](_0x27a8('0xb'),auth[_0x27a8('0x8')](),controller[_0x27a8('0xc')]);router[_0x27a8('0x7')](_0x27a8('0xd'),auth[_0x27a8('0x8')](),controller[_0x27a8('0xe')]);router[_0x27a8('0x7')](_0x27a8('0xf'),auth['isAuthenticated'](),controller[_0x27a8('0x10')]);router['post']('/',auth[_0x27a8('0x8')](),controller[_0x27a8('0x11')]);router[_0x27a8('0x12')](_0x27a8('0xd'),auth[_0x27a8('0x8')](),controller['addTeams']);router[_0x27a8('0x12')](_0x27a8('0xf'),auth[_0x27a8('0x8')](),controller[_0x27a8('0x13')]);router['put']('/:id',auth[_0x27a8('0x8')](),controller[_0x27a8('0x14')]);router[_0x27a8('0x15')]('/:id',auth[_0x27a8('0x8')](),controller[_0x27a8('0x16')]);router['delete'](_0x27a8('0xd'),auth[_0x27a8('0x8')](),controller['removeTeams']);router['delete'](_0x27a8('0xf'),auth[_0x27a8('0x8')](),controller[_0x27a8('0x17')]);module[_0x27a8('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0377ef6..27f09df 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 _0x1d5b=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x45447d,_0x591ec6){_0x45447d=_0x45447d-0x0;var _0x2962ac=_0x1d5b[_0x45447d];return _0x2962ac;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module[_0xb1d5('0x1')]={'name':{'type':Sequelize[_0xb1d5('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb1d5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb1d5('0x4'),_0xb1d5('0x5'),_0xb1d5('0x6'))},'description':{'type':Sequelize[_0xb1d5('0x2')]}}; \ No newline at end of file +var _0xb0b9=['beepall','roundrobin','STRING','sequelize','name','INTEGER','ENUM','rrmemory'];(function(_0x1c321e,_0x250d74){var _0x3b4359=function(_0xfbb33){while(--_0xfbb33){_0x1c321e['push'](_0x1c321e['shift']());}};_0x3b4359(++_0x250d74);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x4d09ca,_0x300adc){_0x4d09ca=_0x4d09ca-0x0;var _0x2d7d77=_0xb0b9[_0x4d09ca];return _0x2d7d77;};'use strict';var Sequelize=require(_0x9b0b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9b0b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9b0b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b0b('0x3')](_0x9b0b('0x4'),_0x9b0b('0x5'),_0x9b0b('0x6'))},'description':{'type':Sequelize[_0x9b0b('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index f53850b..c749351 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 _0x3bc7=['removeTeams','Agents','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','limit','count','Content-Range','then','destroy','get','UserProfileResource','end','sendStatus','error','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','attributes','intersection','fields','length','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','update','body','describe','getMembers','findOne','nolimit','order','pick','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','map','format','%s/%s','whatsappPause','getTeams','Team','sort','hasOwnProperty','ids','online','interface','flatMap','transaction','addTeams','each','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save'];(function(_0x153083,_0xa97d87){var _0x2396d5=function(_0x282cb4){while(--_0x282cb4){_0x153083['push'](_0x153083['shift']());}};_0x2396d5(++_0xa97d87);}(_0x3bc7,0x99));var _0x73bc=function(_0x2df13f,_0x3a3921){_0x2df13f=_0x2df13f-0x0;var _0x5c8a3f=_0x3bc7[_0x2df13f];return _0x5c8a3f;};'use strict';var BPromise=require(_0x73bc('0x0'));var util=require(_0x73bc('0x1'));var _=require(_0x73bc('0x2'));var squel=require(_0x73bc('0x3'));var Redis=require('ioredis');var qs=require(_0x73bc('0x4'));var logger=require(_0x73bc('0x5'))(_0x73bc('0x6'));var config=require(_0x73bc('0x7'));var db=require(_0x73bc('0x8'))['db'];config['redis']=_[_0x73bc('0x9')](config[_0x73bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x73bc('0xb'))(new Redis(config[_0x73bc('0xa')]));require(_0x73bc('0xc'))[_0x73bc('0xd')](socket);function respondWithStatusCode(_0x56c845,_0x35f845){_0x35f845=_0x35f845||0xcc;return function(_0xbe5c36){if(_0xbe5c36){return _0x56c845['sendStatus'](_0x35f845);}return _0x56c845[_0x73bc('0xe')](_0x35f845)['end']();};}function respondWithResult(_0x47c165,_0x2aaff0){_0x2aaff0=_0x2aaff0||0xc8;return function(_0xc6e5ee){if(_0xc6e5ee){return _0x47c165[_0x73bc('0xe')](_0x2aaff0)[_0x73bc('0xf')](_0xc6e5ee);}};}function respondWithFilteredResult(_0x45dd26,_0x503e9a){return function(_0xd2a31c){if(_0xd2a31c){var _0xe48743=typeof _0x503e9a[_0x73bc('0x10')]===_0x73bc('0x11')&&typeof _0x503e9a[_0x73bc('0x12')]===_0x73bc('0x11');var _0x4294fc=_0xd2a31c[_0x73bc('0x13')];var _0x55d3f8=_0xe48743?0x0:_0x503e9a['offset'];var _0x1f2e6c=_0xe48743?_0xd2a31c[_0x73bc('0x13')]:_0x503e9a[_0x73bc('0x10')]+_0x503e9a[_0x73bc('0x12')];var _0x2ebf02;if(_0x1f2e6c>=_0x4294fc){_0x1f2e6c=_0x4294fc;_0x2ebf02=0xc8;}else{_0x2ebf02=0xce;}_0x45dd26[_0x73bc('0xe')](_0x2ebf02);return _0x45dd26['set'](_0x73bc('0x14'),_0x55d3f8+'-'+_0x1f2e6c+'/'+_0x4294fc)[_0x73bc('0xf')](_0xd2a31c);}return null;};}function saveUpdates(_0x4cd0d5){return function(_0x12f955){if(_0x12f955){return _0x12f955['update'](_0x4cd0d5)[_0x73bc('0x15')](function(_0x5a1ef4){return _0x5a1ef4;});}return null;};}function removeEntity(_0x5affd5){return function(_0x21a616){if(_0x21a616){return _0x21a616[_0x73bc('0x16')]()[_0x73bc('0x15')](function(){var _0x47a8a3=_0x21a616[_0x73bc('0x17')]({'plain':!![]});var _0x4e335b='WhatsappQueues';return db[_0x73bc('0x18')]['destroy']({'where':{'type':_0x4e335b,'resourceId':_0x47a8a3['id']}})['then'](function(){return _0x21a616;});})[_0x73bc('0x15')](function(){_0x5affd5[_0x73bc('0xe')](0xcc)[_0x73bc('0x19')]();});}};}function handleEntityNotFound(_0x402a87){return function(_0x3766ca){if(!_0x3766ca){_0x402a87[_0x73bc('0x1a')](0x194);}return _0x3766ca;};}function handleError(_0x3e1d6f,_0x1672fe){_0x1672fe=_0x1672fe||0x1f4;return function(_0x36ab71){logger[_0x73bc('0x1b')](_0x36ab71['stack']);if(_0x36ab71[_0x73bc('0x1c')]){delete _0x36ab71[_0x73bc('0x1c')];}_0x3e1d6f['status'](_0x1672fe)[_0x73bc('0x1d')](_0x36ab71);};}exports[_0x73bc('0x1e')]=function(_0x4cd5f7,_0x5d6368){var _0x54930c={};var _0x487dc6={'count':0x0,'rows':[]};var _0x175b29=_['map'](db[_0x73bc('0x1f')][_0x73bc('0x20')],function(_0x344a4e){return{'name':_0x344a4e[_0x73bc('0x21')],'type':_0x344a4e[_0x73bc('0x22')]['key']};});_0x54930c=qs[_0x73bc('0x23')](_0x175b29,_0x4cd5f7);var _0x14aa94={'where':_0x54930c[_0x73bc('0x24')]};return db[_0x73bc('0x1f')]['count'](_0x14aa94)[_0x73bc('0x15')](function(_0x4846ca){_0x487dc6['count']=_0x4846ca;_0x54930c['include']=qs[_0x73bc('0x25')](_0x4cd5f7[_0x73bc('0x26')]);return db[_0x73bc('0x1f')][_0x73bc('0x27')](_0x54930c);})['then'](function(_0x2b2b5b){_0x487dc6[_0x73bc('0x28')]=_0x2b2b5b;return _0x487dc6;})[_0x73bc('0x15')](respondWithFilteredResult(_0x5d6368,_0x54930c))[_0x73bc('0x29')](handleError(_0x5d6368,null));};exports[_0x73bc('0x2a')]=function(_0x42cc69,_0x27ddbf){var _0x51217a={'raw':!![],'where':{'id':_0x42cc69[_0x73bc('0x2b')]['id']}},_0x290363={};_0x290363[_0x73bc('0x2c')]=_['keys'](db[_0x73bc('0x1f')]['rawAttributes']);_0x290363['query']=_[_0x73bc('0x2d')](_0x42cc69['query']);_0x290363[_0x73bc('0x2e')]=_['intersection'](_0x290363[_0x73bc('0x2c')],_0x290363['query']);_0x51217a[_0x73bc('0x2f')]=_[_0x73bc('0x30')](_0x290363[_0x73bc('0x2c')],qs[_0x73bc('0x31')](_0x42cc69[_0x73bc('0x26')][_0x73bc('0x31')]));_0x51217a[_0x73bc('0x2f')]=_0x51217a[_0x73bc('0x2f')][_0x73bc('0x32')]?_0x51217a[_0x73bc('0x2f')]:_0x290363['model'];if(_0x42cc69[_0x73bc('0x26')]['includeAll']){_0x51217a[_0x73bc('0x25')]=[{'all':!![]}];}_0x51217a=_[_0x73bc('0x33')]({},_0x51217a,_0x42cc69[_0x73bc('0x34')]);return db[_0x73bc('0x1f')][_0x73bc('0x35')](_0x51217a)[_0x73bc('0x15')](handleEntityNotFound(_0x27ddbf,null))['then'](respondWithResult(_0x27ddbf,null))[_0x73bc('0x29')](handleError(_0x27ddbf,null));};exports[_0x73bc('0x36')]=function(_0x45a7c2,_0x28ec73){return db[_0x73bc('0x1f')]['create'](_0x45a7c2['body'],{})[_0x73bc('0x15')](function(_0x287706){var _0x171f53=_0x45a7c2['user'][_0x73bc('0x17')]({'plain':!![]});if(!_0x171f53)throw new Error(_0x73bc('0x37'));if(_0x171f53[_0x73bc('0x38')]===_0x73bc('0x39')){var _0x4aabac=_0x287706[_0x73bc('0x17')]({'plain':!![]});var _0x13a0ca='WhatsappQueues';return db[_0x73bc('0x3a')][_0x73bc('0x35')]({'where':{'name':_0x13a0ca,'userProfileId':_0x171f53['userProfileId']},'raw':!![]})[_0x73bc('0x15')](function(_0x246f34){if(_0x246f34&&_0x246f34[_0x73bc('0x3b')]===0x0){return db[_0x73bc('0x18')][_0x73bc('0x36')]({'name':_0x4aabac[_0x73bc('0x1c')],'resourceId':_0x4aabac['id'],'type':_0x246f34[_0x73bc('0x1c')],'sectionId':_0x246f34['id']},{})[_0x73bc('0x15')](function(){return _0x287706;});}else{return _0x287706;}})[_0x73bc('0x29')](function(_0x2cbd12){logger[_0x73bc('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cbd12);throw _0x2cbd12;});}return _0x287706;})['then'](respondWithResult(_0x28ec73,0xc9))[_0x73bc('0x29')](handleError(_0x28ec73,null));};exports[_0x73bc('0x3c')]=function(_0x27ee67,_0x1325e4){if(_0x27ee67[_0x73bc('0x3d')]['id']){delete _0x27ee67[_0x73bc('0x3d')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x27ee67[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x1325e4,null))[_0x73bc('0x15')](saveUpdates(_0x27ee67[_0x73bc('0x3d')],null))['then'](respondWithResult(_0x1325e4,null))['catch'](handleError(_0x1325e4,null));};exports['destroy']=function(_0x158ca6,_0x1642ed){return db[_0x73bc('0x1f')]['find']({'where':{'id':_0x158ca6[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x1642ed,null))[_0x73bc('0x15')](removeEntity(_0x1642ed,null))[_0x73bc('0x29')](handleError(_0x1642ed,null));};exports[_0x73bc('0x3e')]=function(_0x8beac,_0x22073b){return db[_0x73bc('0x1f')][_0x73bc('0x3e')]()[_0x73bc('0x15')](respondWithResult(_0x22073b,null))[_0x73bc('0x29')](handleError(_0x22073b,null));};exports[_0x73bc('0x3f')]=function(_0x4e05d3,_0x2982cb){var _0x29196c={'raw':!![],'where':{}},_0x4e1b4e={},_0x280f60;return db[_0x73bc('0x1f')][_0x73bc('0x40')]({'where':{'id':_0x4e05d3[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x2982cb,null))[_0x73bc('0x15')](function(_0x419dec){if(_0x419dec){_0x280f60=_0x419dec[_0x73bc('0x17')]({'plain':!![]});_0x4e1b4e[_0x73bc('0x2c')]=_[_0x73bc('0x2d')](db['UserWhatsappQueue'][_0x73bc('0x20')]);_0x4e1b4e[_0x73bc('0x26')]=_[_0x73bc('0x2d')](_0x4e05d3[_0x73bc('0x26')]);_0x4e1b4e[_0x73bc('0x2e')]=_[_0x73bc('0x30')](_0x4e1b4e['model'],_0x4e1b4e[_0x73bc('0x26')]);_0x29196c[_0x73bc('0x2f')]=_[_0x73bc('0x30')](_0x4e1b4e[_0x73bc('0x2c')],qs['fields'](_0x4e05d3['query']['fields']));_0x29196c[_0x73bc('0x2f')]=_0x29196c[_0x73bc('0x2f')][_0x73bc('0x32')]?_0x29196c[_0x73bc('0x2f')]:_0x4e1b4e[_0x73bc('0x2c')];if(!_0x4e05d3[_0x73bc('0x26')]['hasOwnProperty'](_0x73bc('0x41'))){_0x29196c[_0x73bc('0x12')]=qs[_0x73bc('0x12')](_0x4e05d3[_0x73bc('0x26')][_0x73bc('0x12')]);_0x29196c[_0x73bc('0x10')]=qs[_0x73bc('0x10')](_0x4e05d3[_0x73bc('0x26')][_0x73bc('0x10')]);}_0x29196c[_0x73bc('0x42')]=qs['sort'](_0x4e05d3[_0x73bc('0x26')]['sort']);_0x29196c['where']=qs['filters'](_[_0x73bc('0x43')](_0x4e05d3[_0x73bc('0x26')],_0x4e1b4e[_0x73bc('0x2e')]));_0x29196c[_0x73bc('0x24')]['WhatsappQueueId']=_0x419dec['id'];if(_0x4e05d3[_0x73bc('0x26')][_0x73bc('0x44')]){_0x29196c[_0x73bc('0x24')]=_[_0x73bc('0x33')](_0x29196c[_0x73bc('0x24')],{'$or':_['map'](_0x29196c[_0x73bc('0x2f')],function(_0x56fe71){var _0x11ea91={};_0x11ea91[_0x56fe71]={'$like':'%'+_0x4e05d3[_0x73bc('0x26')][_0x73bc('0x44')]+'%'};return _0x11ea91;})});}_0x29196c=_[_0x73bc('0x33')]({},_0x29196c,_0x4e05d3[_0x73bc('0x34')]);return db['UserWhatsappQueue'][_0x73bc('0x27')](_0x29196c);}})[_0x73bc('0x15')](function(_0x2a9eee){if(_0x2a9eee){return db[_0x73bc('0x45')][_0x73bc('0x46')]({'where':{'id':_['map'](_0x2a9eee,_0x73bc('0x47')),'role':_0x73bc('0x48')},'attributes':['id',_0x73bc('0x1c'),'whatsappPause',_0x73bc('0x49'),_0x73bc('0x4a')]});}})[_0x73bc('0x15')](function(_0x20fb4f){if(_0x20fb4f){return{'count':_0x20fb4f['count'],'rows':_[_0x73bc('0x4b')](_0x20fb4f[_0x73bc('0x28')],function(_0x1e3fb5){return{'membername':_0x1e3fb5[_0x73bc('0x1c')],'UserId':_0x1e3fb5['id'],'queue_name':_0x280f60[_0x73bc('0x1c')],'WhatsappQueueId':_0x280f60['id'],'interface':util[_0x73bc('0x4c')](_0x73bc('0x4d'),'SIP',_0x1e3fb5[_0x73bc('0x1c')]),'penalty':0x0,'paused':_0x1e3fb5[_0x73bc('0x4e')],'createdAt':_0x1e3fb5[_0x73bc('0x4a')],'updatedAt':_0x1e3fb5[_0x73bc('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x73bc('0x15')](respondWithFilteredResult(_0x2982cb,_0x29196c))[_0x73bc('0x29')](handleError(_0x2982cb,null));};exports[_0x73bc('0x4f')]=function(_0x151c46,_0x1e3e81){var _0x3b44d6={};var _0x548b52={};var _0x2b4456;var _0x474ca4;return db[_0x73bc('0x1f')][_0x73bc('0x40')]({'where':{'id':_0x151c46[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x1e3e81,null))['then'](function(_0x13c9b1){if(_0x13c9b1){_0x2b4456=_0x13c9b1;_0x548b52[_0x73bc('0x2c')]=_[_0x73bc('0x2d')](db[_0x73bc('0x50')][_0x73bc('0x20')]);_0x548b52[_0x73bc('0x26')]=_['keys'](_0x151c46[_0x73bc('0x26')]);_0x548b52[_0x73bc('0x2e')]=_['intersection'](_0x548b52[_0x73bc('0x2c')],_0x548b52[_0x73bc('0x26')]);_0x3b44d6[_0x73bc('0x2f')]=_['intersection'](_0x548b52['model'],qs[_0x73bc('0x31')](_0x151c46[_0x73bc('0x26')][_0x73bc('0x31')]));_0x3b44d6[_0x73bc('0x2f')]=_0x3b44d6[_0x73bc('0x2f')]['length']?_0x3b44d6[_0x73bc('0x2f')]:_0x548b52[_0x73bc('0x2c')];_0x3b44d6[_0x73bc('0x42')]=qs[_0x73bc('0x51')](_0x151c46['query'][_0x73bc('0x51')]);_0x3b44d6[_0x73bc('0x24')]=qs[_0x73bc('0x2e')](_['pick'](_0x151c46[_0x73bc('0x26')],_0x548b52['filters']));if(_0x151c46['query']['filter']){_0x3b44d6['where']=_[_0x73bc('0x33')](_0x3b44d6[_0x73bc('0x24')],{'$or':_[_0x73bc('0x4b')](_0x3b44d6['attributes'],function(_0x421ba6){var _0x2dff87={};_0x2dff87[_0x421ba6]={'$like':'%'+_0x151c46['query'][_0x73bc('0x44')]+'%'};return _0x2dff87;})});}_0x3b44d6=_[_0x73bc('0x33')]({},_0x3b44d6,_0x151c46[_0x73bc('0x34')]);return _0x2b4456[_0x73bc('0x4f')](_0x3b44d6);}})[_0x73bc('0x15')](function(_0x2f04bd){if(_0x2f04bd){_0x474ca4=_0x2f04bd['length'];if(!_0x151c46[_0x73bc('0x26')][_0x73bc('0x52')](_0x73bc('0x41'))){_0x3b44d6[_0x73bc('0x12')]=qs[_0x73bc('0x12')](_0x151c46[_0x73bc('0x26')][_0x73bc('0x12')]);_0x3b44d6[_0x73bc('0x10')]=qs['offset'](_0x151c46[_0x73bc('0x26')]['offset']);}return _0x2b4456['getTeams'](_0x3b44d6);}})[_0x73bc('0x15')](function(_0x5adc56){if(_0x5adc56){return _0x5adc56?{'count':_0x474ca4,'rows':_0x5adc56}:null;}})[_0x73bc('0x15')](respondWithResult(_0x1e3e81,null))[_0x73bc('0x29')](handleError(_0x1e3e81,null));};exports['addTeams']=function(_0x2271f5,_0x44e38f){var _0x4b62c4=_0x2271f5[_0x73bc('0x3d')][_0x73bc('0x53')];return db[_0x73bc('0x50')][_0x73bc('0x27')]({'where':{'id':_0x4b62c4},'attributes':['id'],'include':[{'model':db[_0x73bc('0x45')],'as':'Agents','attributes':['id',_0x73bc('0x1c'),_0x73bc('0x54'),'voicePause',_0x73bc('0x55')],'raw':!![]}]})[_0x73bc('0x15')](function(_0x2d280b){if(_0x2d280b){var _0x433b79=_[_0x73bc('0x56')](_0x2d280b,function(_0x5c97d0){var _0x462664=_0x5c97d0[_0x73bc('0x17')]({'plain':!![]});return _0x462664['Agents'];});return db[_0x73bc('0x1f')][_0x73bc('0x35')]({'where':{'id':_0x2271f5['params']['id']}})['then'](function(_0x3d327d){return db['sequelize'][_0x73bc('0x57')](function(_0x36f71b){return _0x3d327d[_0x73bc('0x58')](_0x4b62c4,{'transaction':_0x36f71b})[_0x73bc('0x15')](function(){return BPromise[_0x73bc('0x59')](_0x433b79,function(_0x3cf870){return db[_0x73bc('0x5a')][_0x73bc('0x5b')]({'where':{'UserId':_0x3cf870['id'],'WhatsappQueueId':_0x2271f5[_0x73bc('0x2b')]['id']},'transaction':_0x36f71b});});})['then'](function(){_0x433b79[_0x73bc('0x5c')](function(_0x5179c8){socket[_0x73bc('0x5d')](_0x73bc('0x5e'),{'UserId':_0x5179c8['id'],'WhatsappQueueId':_0x3d327d['id']});});});});});}})[_0x73bc('0x15')](respondWithStatusCode(_0x44e38f,null))[_0x73bc('0x29')](handleError(_0x44e38f,null));};exports[_0x73bc('0x5f')]=function(_0x33caa8,_0x2e433d){return db['Team'][_0x73bc('0x27')]({'where':{'id':_0x33caa8[_0x73bc('0x26')][_0x73bc('0x53')]},'attributes':['id'],'include':[{'model':db[_0x73bc('0x45')],'as':_0x73bc('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e433d,null))['then'](function(_0x2ec66){var _0x16ba66=_[_0x73bc('0x4b')](_0x2ec66,'id');var _0x1185a2=[];var _0x4dff94=[];var _0x42604b=squel[_0x73bc('0x61')]();_0x42604b['field'](_0x73bc('0x62'))[_0x73bc('0x63')](_0x73bc('0x64'),'tq')[_0x73bc('0x65')](_0x73bc('0x66'),'ut',_0x73bc('0x67'))[_0x73bc('0x24')](_0x73bc('0x68'),_0x33caa8[_0x73bc('0x2b')]['id']);for(var _0x133908=0x0;_0x133908<_0x2ec66[_0x73bc('0x32')];_0x133908+=0x1){let _0x36790f=_0x2ec66[_0x133908];for(var _0x4f7bd9=0x0;_0x4f7bd9<_0x36790f[_0x73bc('0x60')][_0x73bc('0x32')];_0x4f7bd9+=0x1){let _0x1f5a93=_0x36790f[_0x73bc('0x60')][_0x4f7bd9];var _0x490a9c=_0x42604b[_0x73bc('0x69')]();_0x490a9c[_0x73bc('0x24')](_0x73bc('0x6a'),_0x1f5a93['id']);_0x4dff94[_0x73bc('0x6b')](db[_0x73bc('0x6c')][_0x73bc('0x26')](_0x490a9c['toString'](),{'type':db[_0x73bc('0x6c')][_0x73bc('0x6d')][_0x73bc('0x6e')]})['then'](function(_0x35a94b){if(_0x35a94b['length']===0x1){return _0x1f5a93['id'];}else{var _0x3229a0=_[_0x73bc('0x6f')](_[_0x73bc('0x4b')](_0x35a94b,_0x73bc('0x70')),function(_0x423603){return _['includes'](_0x16ba66,_0x423603);});if(_0x3229a0){return _0x1f5a93['id'];}}}));}}return BPromise[_0x73bc('0x71')](_0x4dff94)[_0x73bc('0x15')](function(_0x31ce8b){_0x1185a2=_(_0x1185a2)[_0x73bc('0x72')](_0x31ce8b)['compact']()[_0x73bc('0x73')]();return db[_0x73bc('0x1f')][_0x73bc('0x35')]({'where':{'id':_0x33caa8[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](function(_0x132ab3){return db[_0x73bc('0x6c')][_0x73bc('0x57')](function(_0x24d95b){return _0x132ab3['removeTeams'](_0x33caa8[_0x73bc('0x26')][_0x73bc('0x53')],{'transaction':_0x24d95b})['then'](function(){if(!_[_0x73bc('0x74')](_0x1185a2)){return _0x132ab3[_0x73bc('0x75')](_0x1185a2,{'transaction':_0x24d95b});}})['then'](function(){_0x1185a2[_0x73bc('0x5c')](function(_0x3ac12d){socket[_0x73bc('0x5d')]('userWhatsappQueue:remove',{'UserId':_0x3ac12d,'WhatsappQueueId':_0x132ab3['id']});});});});});});})[_0x73bc('0x15')](respondWithStatusCode(_0x2e433d,null))['catch'](handleError(_0x2e433d,null));};exports['addAgents']=function(_0x305736,_0xa413f4){return db[_0x73bc('0x1f')][_0x73bc('0x35')]({'where':{'id':_0x305736[_0x73bc('0x2b')]['id']}})['then'](handleEntityNotFound(_0xa413f4,null))[_0x73bc('0x15')](function(_0x470f95){if(_0x470f95){return _0x470f95[_0x73bc('0x76')](_0x305736[_0x73bc('0x3d')][_0x73bc('0x53')],_[_0x73bc('0x77')](_0x305736[_0x73bc('0x3d')],[_0x73bc('0x53'),'id'])||{})[_0x73bc('0x78')](function(_0x1bad62){for(var _0x438364=0x0;_0x438364<_0x305736['body'][_0x73bc('0x53')][_0x73bc('0x32')];_0x438364+=0x1){socket[_0x73bc('0x5d')]('userWhatsappQueue:save',{'UserId':Number(_0x305736['body'][_0x73bc('0x53')][_0x438364]),'WhatsappQueueId':Number(_0x305736[_0x73bc('0x2b')]['id'])});}return _0x1bad62;});}})[_0x73bc('0x15')](respondWithResult(_0xa413f4,null))[_0x73bc('0x29')](handleError(_0xa413f4,null));};exports[_0x73bc('0x75')]=function(_0x31ba78,_0x541790){return db[_0x73bc('0x1f')][_0x73bc('0x35')]({'where':{'id':_0x31ba78[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x541790,null))[_0x73bc('0x15')](function(_0x4b9df1){if(_0x4b9df1){return _0x4b9df1[_0x73bc('0x75')](_0x31ba78[_0x73bc('0x26')][_0x73bc('0x53')])[_0x73bc('0x15')](function(){if(_[_0x73bc('0x79')](_0x31ba78[_0x73bc('0x26')][_0x73bc('0x53')])){for(var _0x31a6c5=0x0;_0x31a6c5<_0x31ba78['query'][_0x73bc('0x53')]['length'];_0x31a6c5+=0x1){socket[_0x73bc('0x5d')](_0x73bc('0x7a'),{'UserId':Number(_0x31ba78[_0x73bc('0x26')]['ids'][_0x31a6c5]),'WhatsappQueueId':Number(_0x31ba78['params']['id'])});}}else{socket[_0x73bc('0x5d')]('userWhatsappQueue:remove',{'UserId':Number(_0x31ba78[_0x73bc('0x26')][_0x73bc('0x53')]),'WhatsappQueueId':Number(_0x31ba78[_0x73bc('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x541790,null))[_0x73bc('0x29')](handleError(_0x541790,null));};exports['getAgents']=function(_0x367f17,_0x3eda2b){var _0x2c1fc0={};var _0x48b49f={};var _0x1c723d;var _0x21b9fc;return db['WhatsappQueue'][_0x73bc('0x40')]({'where':{'id':_0x367f17[_0x73bc('0x2b')]['id']}})[_0x73bc('0x15')](handleEntityNotFound(_0x3eda2b,null))[_0x73bc('0x15')](function(_0x410a35){if(_0x410a35){_0x1c723d=_0x410a35;_0x48b49f[_0x73bc('0x2c')]=_[_0x73bc('0x2d')](db[_0x73bc('0x45')]['rawAttributes']);_0x48b49f['query']=_[_0x73bc('0x2d')](_0x367f17[_0x73bc('0x26')]);_0x48b49f[_0x73bc('0x2e')]=_[_0x73bc('0x30')](_0x48b49f[_0x73bc('0x2c')],_0x48b49f['query']);_0x2c1fc0[_0x73bc('0x2f')]=_['intersection'](_0x48b49f[_0x73bc('0x2c')],qs[_0x73bc('0x31')](_0x367f17[_0x73bc('0x26')][_0x73bc('0x31')]));_0x2c1fc0[_0x73bc('0x2f')]=_0x2c1fc0[_0x73bc('0x2f')]['length']?_0x2c1fc0[_0x73bc('0x2f')]:_0x48b49f[_0x73bc('0x2c')];_0x2c1fc0[_0x73bc('0x42')]=qs[_0x73bc('0x51')](_0x367f17[_0x73bc('0x26')]['sort']);_0x2c1fc0[_0x73bc('0x24')]=qs['filters'](_[_0x73bc('0x43')](_0x367f17[_0x73bc('0x26')],_0x48b49f[_0x73bc('0x2e')]));if(_0x367f17[_0x73bc('0x26')][_0x73bc('0x44')]){_0x2c1fc0[_0x73bc('0x24')]=_[_0x73bc('0x33')](_0x2c1fc0[_0x73bc('0x24')],{'$or':_[_0x73bc('0x4b')](_0x2c1fc0[_0x73bc('0x2f')],function(_0x52ebdd){var _0x359958={};_0x359958[_0x52ebdd]={'$like':'%'+_0x367f17['query'][_0x73bc('0x44')]+'%'};return _0x359958;})});}_0x2c1fc0=_[_0x73bc('0x33')]({},_0x2c1fc0,_0x367f17[_0x73bc('0x34')]);return _0x1c723d[_0x73bc('0x7b')](_0x2c1fc0);}})[_0x73bc('0x15')](function(_0xa05f78){if(_0xa05f78){_0x21b9fc=_0xa05f78[_0x73bc('0x32')];if(!_0x367f17[_0x73bc('0x26')][_0x73bc('0x52')]('nolimit')){_0x2c1fc0[_0x73bc('0x12')]=qs[_0x73bc('0x12')](_0x367f17[_0x73bc('0x26')][_0x73bc('0x12')]);_0x2c1fc0[_0x73bc('0x10')]=qs['offset'](_0x367f17[_0x73bc('0x26')][_0x73bc('0x10')]);}return _0x1c723d['getAgents'](_0x2c1fc0);}})['then'](function(_0x2771a2){if(_0x2771a2){return _0x2771a2?{'count':_0x21b9fc,'rows':_0x2771a2}:null;}})[_0x73bc('0x15')](respondWithResult(_0x3eda2b,null))['catch'](handleError(_0x3eda2b,null));}; \ No newline at end of file +var _0xd540=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','end','json','offset','undefined','limit','count','status','Content-Range','update','then','get','WhatsappQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','WhatsappQueue','type','getOptions','where','include','query','findAll','rows','catch','show','model','rawAttributes','keys','filters','intersection','attributes','fields','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserWhatsappQueue','nolimit','order','sort','pick','WhatsappQueueId','filter','merge','User','findAndCountAll','UserId','whatsappPause','createdAt','format','SIP','Team','length','getTeams','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','union','compact','removeTeams','removeAgents','addAgents','isArray','userWhatsappQueue:remove','getAgents','util'];(function(_0x24a6df,_0x9a121c){var _0x3a730b=function(_0x4c8e2a){while(--_0x4c8e2a){_0x24a6df['push'](_0x24a6df['shift']());}};_0x3a730b(++_0x9a121c);}(_0xd540,0xdd));var _0x0d54=function(_0x4e0a44,_0xbadb96){_0x4e0a44=_0x4e0a44-0x0;var _0x45ed17=_0xd540[_0x4e0a44];return _0x45ed17;};'use strict';var BPromise=require('bluebird');var util=require(_0x0d54('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x0d54('0x1'));var qs=require(_0x0d54('0x2'));var logger=require(_0x0d54('0x3'))(_0x0d54('0x4'));var config=require(_0x0d54('0x5'));var db=require(_0x0d54('0x6'))['db'];config[_0x0d54('0x7')]=_['defaults'](config[_0x0d54('0x7')],{'host':_0x0d54('0x8'),'port':0x18eb});var socket=require(_0x0d54('0x9'))(new Redis(config[_0x0d54('0x7')]));require('./whatsappQueue.socket')[_0x0d54('0xa')](socket);function respondWithStatusCode(_0x4f6582,_0x73bc40){_0x73bc40=_0x73bc40||0xcc;return function(_0x1e1cab){if(_0x1e1cab){return _0x4f6582['sendStatus'](_0x73bc40);}return _0x4f6582['status'](_0x73bc40)[_0x0d54('0xb')]();};}function respondWithResult(_0xc1a36d,_0xf5fa4a){_0xf5fa4a=_0xf5fa4a||0xc8;return function(_0x4d28cb){if(_0x4d28cb){return _0xc1a36d['status'](_0xf5fa4a)[_0x0d54('0xc')](_0x4d28cb);}};}function respondWithFilteredResult(_0x4e9134,_0xbc3775){return function(_0x347a90){if(_0x347a90){var _0x3fef9b=typeof _0xbc3775[_0x0d54('0xd')]===_0x0d54('0xe')&&typeof _0xbc3775[_0x0d54('0xf')]===_0x0d54('0xe');var _0x2aaa34=_0x347a90[_0x0d54('0x10')];var _0xceec33=_0x3fef9b?0x0:_0xbc3775[_0x0d54('0xd')];var _0xf2a2d=_0x3fef9b?_0x347a90[_0x0d54('0x10')]:_0xbc3775[_0x0d54('0xd')]+_0xbc3775[_0x0d54('0xf')];var _0x18d766;if(_0xf2a2d>=_0x2aaa34){_0xf2a2d=_0x2aaa34;_0x18d766=0xc8;}else{_0x18d766=0xce;}_0x4e9134[_0x0d54('0x11')](_0x18d766);return _0x4e9134['set'](_0x0d54('0x12'),_0xceec33+'-'+_0xf2a2d+'/'+_0x2aaa34)[_0x0d54('0xc')](_0x347a90);}return null;};}function saveUpdates(_0x22ff8b){return function(_0x311f00){if(_0x311f00){return _0x311f00[_0x0d54('0x13')](_0x22ff8b)[_0x0d54('0x14')](function(_0x21fc0f){return _0x21fc0f;});}return null;};}function removeEntity(_0x35d620){return function(_0x4bd494){if(_0x4bd494){return _0x4bd494['destroy']()[_0x0d54('0x14')](function(){var _0x4400f5=_0x4bd494[_0x0d54('0x15')]({'plain':!![]});var _0x351dd6=_0x0d54('0x16');return db[_0x0d54('0x17')][_0x0d54('0x18')]({'where':{'type':_0x351dd6,'resourceId':_0x4400f5['id']}})[_0x0d54('0x14')](function(){return _0x4bd494;});})[_0x0d54('0x14')](function(){_0x35d620[_0x0d54('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e91ee){return function(_0x5eeb8b){if(!_0x5eeb8b){_0x2e91ee[_0x0d54('0x19')](0x194);}return _0x5eeb8b;};}function handleError(_0x39bade,_0x694209){_0x694209=_0x694209||0x1f4;return function(_0x5c6a29){logger[_0x0d54('0x1a')](_0x5c6a29[_0x0d54('0x1b')]);if(_0x5c6a29[_0x0d54('0x1c')]){delete _0x5c6a29[_0x0d54('0x1c')];}_0x39bade[_0x0d54('0x11')](_0x694209)[_0x0d54('0x1d')](_0x5c6a29);};}exports[_0x0d54('0x1e')]=function(_0x382a4e,_0x5ecd06){var _0x41d965={};var _0x632ac6={'count':0x0,'rows':[]};var _0x15c7f3=_[_0x0d54('0x1f')](db[_0x0d54('0x20')]['rawAttributes'],function(_0x2c3763){return{'name':_0x2c3763['fieldName'],'type':_0x2c3763[_0x0d54('0x21')]['key']};});_0x41d965=qs[_0x0d54('0x22')](_0x15c7f3,_0x382a4e);var _0x331aac={'where':_0x41d965[_0x0d54('0x23')]};return db[_0x0d54('0x20')]['count'](_0x331aac)[_0x0d54('0x14')](function(_0x183813){_0x632ac6['count']=_0x183813;_0x41d965[_0x0d54('0x24')]=qs[_0x0d54('0x24')](_0x382a4e[_0x0d54('0x25')]);return db[_0x0d54('0x20')][_0x0d54('0x26')](_0x41d965);})['then'](function(_0x4fc568){_0x632ac6[_0x0d54('0x27')]=_0x4fc568;return _0x632ac6;})['then'](respondWithFilteredResult(_0x5ecd06,_0x41d965))[_0x0d54('0x28')](handleError(_0x5ecd06,null));};exports[_0x0d54('0x29')]=function(_0x25733a,_0x32db73){var _0x35d17a={'raw':!![],'where':{'id':_0x25733a['params']['id']}},_0x55921f={};_0x55921f[_0x0d54('0x2a')]=_['keys'](db['WhatsappQueue'][_0x0d54('0x2b')]);_0x55921f[_0x0d54('0x25')]=_[_0x0d54('0x2c')](_0x25733a['query']);_0x55921f[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x55921f['model'],_0x55921f['query']);_0x35d17a[_0x0d54('0x2f')]=_[_0x0d54('0x2e')](_0x55921f['model'],qs[_0x0d54('0x30')](_0x25733a[_0x0d54('0x25')][_0x0d54('0x30')]));_0x35d17a[_0x0d54('0x2f')]=_0x35d17a['attributes']['length']?_0x35d17a[_0x0d54('0x2f')]:_0x55921f[_0x0d54('0x2a')];if(_0x25733a[_0x0d54('0x25')]['includeAll']){_0x35d17a['include']=[{'all':!![]}];}_0x35d17a=_['merge']({},_0x35d17a,_0x25733a[_0x0d54('0x31')]);return db[_0x0d54('0x20')]['find'](_0x35d17a)[_0x0d54('0x14')](handleEntityNotFound(_0x32db73,null))[_0x0d54('0x14')](respondWithResult(_0x32db73,null))[_0x0d54('0x28')](handleError(_0x32db73,null));};exports[_0x0d54('0x32')]=function(_0x6fbd21,_0x5c5061){return db[_0x0d54('0x20')][_0x0d54('0x32')](_0x6fbd21[_0x0d54('0x33')],{})[_0x0d54('0x14')](function(_0x195429){var _0x232e0f=_0x6fbd21[_0x0d54('0x34')][_0x0d54('0x15')]({'plain':!![]});if(!_0x232e0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x232e0f['role']===_0x0d54('0x34')){var _0x4128df=_0x195429[_0x0d54('0x15')]({'plain':!![]});var _0xc4cc4f=_0x0d54('0x16');return db[_0x0d54('0x35')][_0x0d54('0x36')]({'where':{'name':_0xc4cc4f,'userProfileId':_0x232e0f[_0x0d54('0x37')]},'raw':!![]})[_0x0d54('0x14')](function(_0x89388c){if(_0x89388c&&_0x89388c[_0x0d54('0x38')]===0x0){return db[_0x0d54('0x17')][_0x0d54('0x32')]({'name':_0x4128df[_0x0d54('0x1c')],'resourceId':_0x4128df['id'],'type':_0x89388c['name'],'sectionId':_0x89388c['id']},{})['then'](function(){return _0x195429;});}else{return _0x195429;}})[_0x0d54('0x28')](function(_0x2798d3){logger[_0x0d54('0x1a')](_0x0d54('0x39'),_0x2798d3);throw _0x2798d3;});}return _0x195429;})[_0x0d54('0x14')](respondWithResult(_0x5c5061,0xc9))[_0x0d54('0x28')](handleError(_0x5c5061,null));};exports[_0x0d54('0x13')]=function(_0xb11f74,_0x3d924b){if(_0xb11f74[_0x0d54('0x33')]['id']){delete _0xb11f74[_0x0d54('0x33')]['id'];}return db[_0x0d54('0x20')][_0x0d54('0x36')]({'where':{'id':_0xb11f74['params']['id']}})[_0x0d54('0x14')](handleEntityNotFound(_0x3d924b,null))[_0x0d54('0x14')](saveUpdates(_0xb11f74[_0x0d54('0x33')],null))['then'](respondWithResult(_0x3d924b,null))[_0x0d54('0x28')](handleError(_0x3d924b,null));};exports['destroy']=function(_0x336efc,_0x51757d){return db['WhatsappQueue']['find']({'where':{'id':_0x336efc[_0x0d54('0x3a')]['id']}})[_0x0d54('0x14')](handleEntityNotFound(_0x51757d,null))['then'](removeEntity(_0x51757d,null))['catch'](handleError(_0x51757d,null));};exports[_0x0d54('0x3b')]=function(_0x2f5901,_0x1d45c4){return db[_0x0d54('0x20')][_0x0d54('0x3b')]()[_0x0d54('0x14')](respondWithResult(_0x1d45c4,null))['catch'](handleError(_0x1d45c4,null));};exports['getMembers']=function(_0x1c9c02,_0x47ffe0){var _0x71cd5e={'raw':!![],'where':{}},_0x1e5f97={},_0x2242c4;return db['WhatsappQueue'][_0x0d54('0x3c')]({'where':{'id':_0x1c9c02[_0x0d54('0x3a')]['id']}})[_0x0d54('0x14')](handleEntityNotFound(_0x47ffe0,null))['then'](function(_0x3dfe89){if(_0x3dfe89){_0x2242c4=_0x3dfe89[_0x0d54('0x15')]({'plain':!![]});_0x1e5f97['model']=_[_0x0d54('0x2c')](db[_0x0d54('0x3d')][_0x0d54('0x2b')]);_0x1e5f97[_0x0d54('0x25')]=_[_0x0d54('0x2c')](_0x1c9c02[_0x0d54('0x25')]);_0x1e5f97[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x1e5f97[_0x0d54('0x2a')],_0x1e5f97[_0x0d54('0x25')]);_0x71cd5e[_0x0d54('0x2f')]=_[_0x0d54('0x2e')](_0x1e5f97[_0x0d54('0x2a')],qs[_0x0d54('0x30')](_0x1c9c02[_0x0d54('0x25')][_0x0d54('0x30')]));_0x71cd5e[_0x0d54('0x2f')]=_0x71cd5e[_0x0d54('0x2f')]['length']?_0x71cd5e[_0x0d54('0x2f')]:_0x1e5f97[_0x0d54('0x2a')];if(!_0x1c9c02[_0x0d54('0x25')]['hasOwnProperty'](_0x0d54('0x3e'))){_0x71cd5e[_0x0d54('0xf')]=qs[_0x0d54('0xf')](_0x1c9c02[_0x0d54('0x25')][_0x0d54('0xf')]);_0x71cd5e[_0x0d54('0xd')]=qs[_0x0d54('0xd')](_0x1c9c02[_0x0d54('0x25')][_0x0d54('0xd')]);}_0x71cd5e[_0x0d54('0x3f')]=qs[_0x0d54('0x40')](_0x1c9c02[_0x0d54('0x25')]['sort']);_0x71cd5e[_0x0d54('0x23')]=qs[_0x0d54('0x2d')](_[_0x0d54('0x41')](_0x1c9c02[_0x0d54('0x25')],_0x1e5f97[_0x0d54('0x2d')]));_0x71cd5e[_0x0d54('0x23')][_0x0d54('0x42')]=_0x3dfe89['id'];if(_0x1c9c02[_0x0d54('0x25')][_0x0d54('0x43')]){_0x71cd5e[_0x0d54('0x23')]=_[_0x0d54('0x44')](_0x71cd5e['where'],{'$or':_[_0x0d54('0x1f')](_0x71cd5e[_0x0d54('0x2f')],function(_0x5a3fc6){var _0x5bf8d4={};_0x5bf8d4[_0x5a3fc6]={'$like':'%'+_0x1c9c02[_0x0d54('0x25')][_0x0d54('0x43')]+'%'};return _0x5bf8d4;})});}_0x71cd5e=_[_0x0d54('0x44')]({},_0x71cd5e,_0x1c9c02['options']);return db['UserWhatsappQueue']['findAll'](_0x71cd5e);}})[_0x0d54('0x14')](function(_0x231b7b){if(_0x231b7b){return db[_0x0d54('0x45')][_0x0d54('0x46')]({'where':{'id':_[_0x0d54('0x1f')](_0x231b7b,_0x0d54('0x47')),'role':'agent'},'attributes':['id',_0x0d54('0x1c'),_0x0d54('0x48'),'updatedAt',_0x0d54('0x49')]});}})[_0x0d54('0x14')](function(_0x3fe713){if(_0x3fe713){return{'count':_0x3fe713[_0x0d54('0x10')],'rows':_['map'](_0x3fe713['rows'],function(_0x39cecd){return{'membername':_0x39cecd[_0x0d54('0x1c')],'UserId':_0x39cecd['id'],'queue_name':_0x2242c4[_0x0d54('0x1c')],'WhatsappQueueId':_0x2242c4['id'],'interface':util[_0x0d54('0x4a')]('%s/%s',_0x0d54('0x4b'),_0x39cecd['name']),'penalty':0x0,'paused':_0x39cecd[_0x0d54('0x48')],'createdAt':_0x39cecd[_0x0d54('0x49')],'updatedAt':_0x39cecd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d54('0x14')](respondWithFilteredResult(_0x47ffe0,_0x71cd5e))['catch'](handleError(_0x47ffe0,null));};exports['getTeams']=function(_0x18f237,_0x4da476){var _0xd4c7b9={};var _0x145d70={};var _0x5c1c46;var _0x5d0dcf;return db[_0x0d54('0x20')]['findOne']({'where':{'id':_0x18f237[_0x0d54('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4da476,null))[_0x0d54('0x14')](function(_0x3fc679){if(_0x3fc679){_0x5c1c46=_0x3fc679;_0x145d70[_0x0d54('0x2a')]=_[_0x0d54('0x2c')](db[_0x0d54('0x4c')]['rawAttributes']);_0x145d70['query']=_[_0x0d54('0x2c')](_0x18f237[_0x0d54('0x25')]);_0x145d70[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x145d70['model'],_0x145d70['query']);_0xd4c7b9['attributes']=_[_0x0d54('0x2e')](_0x145d70['model'],qs['fields'](_0x18f237[_0x0d54('0x25')][_0x0d54('0x30')]));_0xd4c7b9['attributes']=_0xd4c7b9['attributes'][_0x0d54('0x4d')]?_0xd4c7b9[_0x0d54('0x2f')]:_0x145d70[_0x0d54('0x2a')];_0xd4c7b9[_0x0d54('0x3f')]=qs[_0x0d54('0x40')](_0x18f237['query']['sort']);_0xd4c7b9[_0x0d54('0x23')]=qs[_0x0d54('0x2d')](_[_0x0d54('0x41')](_0x18f237[_0x0d54('0x25')],_0x145d70[_0x0d54('0x2d')]));if(_0x18f237['query'][_0x0d54('0x43')]){_0xd4c7b9[_0x0d54('0x23')]=_['merge'](_0xd4c7b9[_0x0d54('0x23')],{'$or':_[_0x0d54('0x1f')](_0xd4c7b9[_0x0d54('0x2f')],function(_0x8a4110){var _0x355ef3={};_0x355ef3[_0x8a4110]={'$like':'%'+_0x18f237[_0x0d54('0x25')][_0x0d54('0x43')]+'%'};return _0x355ef3;})});}_0xd4c7b9=_[_0x0d54('0x44')]({},_0xd4c7b9,_0x18f237['options']);return _0x5c1c46[_0x0d54('0x4e')](_0xd4c7b9);}})[_0x0d54('0x14')](function(_0x55092e){if(_0x55092e){_0x5d0dcf=_0x55092e[_0x0d54('0x4d')];if(!_0x18f237[_0x0d54('0x25')][_0x0d54('0x4f')](_0x0d54('0x3e'))){_0xd4c7b9['limit']=qs[_0x0d54('0xf')](_0x18f237['query']['limit']);_0xd4c7b9['offset']=qs[_0x0d54('0xd')](_0x18f237[_0x0d54('0x25')][_0x0d54('0xd')]);}return _0x5c1c46[_0x0d54('0x4e')](_0xd4c7b9);}})['then'](function(_0x41b80a){if(_0x41b80a){return _0x41b80a?{'count':_0x5d0dcf,'rows':_0x41b80a}:null;}})[_0x0d54('0x14')](respondWithResult(_0x4da476,null))[_0x0d54('0x28')](handleError(_0x4da476,null));};exports[_0x0d54('0x50')]=function(_0x2a5f4a,_0x2edf6e){var _0x31f338=_0x2a5f4a['body'][_0x0d54('0x51')];return db[_0x0d54('0x4c')][_0x0d54('0x26')]({'where':{'id':_0x31f338},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d54('0x52'),'attributes':['id',_0x0d54('0x1c'),_0x0d54('0x53'),_0x0d54('0x54'),_0x0d54('0x55')],'raw':!![]}]})[_0x0d54('0x14')](function(_0x2cd861){if(_0x2cd861){var _0x255f26=_['flatMap'](_0x2cd861,function(_0x1a951f){var _0x1a7208=_0x1a951f[_0x0d54('0x15')]({'plain':!![]});return _0x1a7208[_0x0d54('0x52')];});return db[_0x0d54('0x20')][_0x0d54('0x36')]({'where':{'id':_0x2a5f4a[_0x0d54('0x3a')]['id']}})[_0x0d54('0x14')](function(_0xaeced2){return db[_0x0d54('0x56')][_0x0d54('0x57')](function(_0xdfaa34){return _0xaeced2[_0x0d54('0x50')](_0x31f338,{'transaction':_0xdfaa34})[_0x0d54('0x14')](function(){return BPromise['each'](_0x255f26,function(_0x1a7269){return db[_0x0d54('0x3d')][_0x0d54('0x58')]({'where':{'UserId':_0x1a7269['id'],'WhatsappQueueId':_0x2a5f4a['params']['id']},'transaction':_0xdfaa34});});})[_0x0d54('0x14')](function(){_0x255f26[_0x0d54('0x59')](function(_0x264f09){socket[_0x0d54('0x5a')]('userWhatsappQueue:save',{'UserId':_0x264f09['id'],'WhatsappQueueId':_0xaeced2['id']});});});});});}})[_0x0d54('0x14')](respondWithStatusCode(_0x2edf6e,null))['catch'](handleError(_0x2edf6e,null));};exports['removeTeams']=function(_0x1d4548,_0x3c17d6){return db['Team'][_0x0d54('0x26')]({'where':{'id':_0x1d4548[_0x0d54('0x25')][_0x0d54('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d54('0x52'),'attributes':['id'],'raw':!![]}]})[_0x0d54('0x14')](handleEntityNotFound(_0x3c17d6,null))[_0x0d54('0x14')](function(_0x4614e9){var _0x5276ef=_[_0x0d54('0x1f')](_0x4614e9,'id');var _0x57f53e=[];var _0x303d60=[];var _0x58db37=squel[_0x0d54('0x5b')]();_0x58db37[_0x0d54('0x5c')](_0x0d54('0x5d'))['from'](_0x0d54('0x5e'),'tq')['join'](_0x0d54('0x5f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0d54('0x23')](_0x0d54('0x60'),_0x1d4548[_0x0d54('0x3a')]['id']);for(var _0x31deff=0x0;_0x31deff<_0x4614e9[_0x0d54('0x4d')];_0x31deff+=0x1){let _0x5cd57d=_0x4614e9[_0x31deff];for(var _0x3c7ed1=0x0;_0x3c7ed1<_0x5cd57d[_0x0d54('0x52')][_0x0d54('0x4d')];_0x3c7ed1+=0x1){let _0x134f00=_0x5cd57d['Agents'][_0x3c7ed1];var _0x1c42ab=_0x58db37[_0x0d54('0x61')]();_0x1c42ab[_0x0d54('0x23')](_0x0d54('0x62'),_0x134f00['id']);_0x303d60[_0x0d54('0x63')](db[_0x0d54('0x56')][_0x0d54('0x25')](_0x1c42ab['toString'](),{'type':db['sequelize']['QueryTypes'][_0x0d54('0x64')]})[_0x0d54('0x14')](function(_0x4ca566){if(_0x4ca566[_0x0d54('0x4d')]===0x1){return _0x134f00['id'];}else{var _0x35446a=_[_0x0d54('0x65')](_['map'](_0x4ca566,_0x0d54('0x66')),function(_0x422077){return _['includes'](_0x5276ef,_0x422077);});if(_0x35446a){return _0x134f00['id'];}}}));}}return BPromise['all'](_0x303d60)[_0x0d54('0x14')](function(_0x3b634e){_0x57f53e=_(_0x57f53e)[_0x0d54('0x67')](_0x3b634e)[_0x0d54('0x68')]()['value']();return db[_0x0d54('0x20')][_0x0d54('0x36')]({'where':{'id':_0x1d4548[_0x0d54('0x3a')]['id']}})[_0x0d54('0x14')](function(_0x3298fd){return db[_0x0d54('0x56')]['transaction'](function(_0x180ed0){return _0x3298fd[_0x0d54('0x69')](_0x1d4548[_0x0d54('0x25')][_0x0d54('0x51')],{'transaction':_0x180ed0})[_0x0d54('0x14')](function(){if(!_['isEmpty'](_0x57f53e)){return _0x3298fd[_0x0d54('0x6a')](_0x57f53e,{'transaction':_0x180ed0});}})['then'](function(){_0x57f53e[_0x0d54('0x59')](function(_0x21b59e){socket[_0x0d54('0x5a')]('userWhatsappQueue:remove',{'UserId':_0x21b59e,'WhatsappQueueId':_0x3298fd['id']});});});});});});})[_0x0d54('0x14')](respondWithStatusCode(_0x3c17d6,null))['catch'](handleError(_0x3c17d6,null));};exports['addAgents']=function(_0x119e2a,_0x465809){return db[_0x0d54('0x20')]['find']({'where':{'id':_0x119e2a[_0x0d54('0x3a')]['id']}})['then'](handleEntityNotFound(_0x465809,null))[_0x0d54('0x14')](function(_0x1bbcaf){if(_0x1bbcaf){return _0x1bbcaf[_0x0d54('0x6b')](_0x119e2a[_0x0d54('0x33')][_0x0d54('0x51')],_['omit'](_0x119e2a[_0x0d54('0x33')],[_0x0d54('0x51'),'id'])||{})['spread'](function(_0x207d77){for(var _0x309786=0x0;_0x309786<_0x119e2a[_0x0d54('0x33')][_0x0d54('0x51')]['length'];_0x309786+=0x1){socket[_0x0d54('0x5a')]('userWhatsappQueue:save',{'UserId':Number(_0x119e2a[_0x0d54('0x33')][_0x0d54('0x51')][_0x309786]),'WhatsappQueueId':Number(_0x119e2a[_0x0d54('0x3a')]['id'])});}return _0x207d77;});}})[_0x0d54('0x14')](respondWithResult(_0x465809,null))[_0x0d54('0x28')](handleError(_0x465809,null));};exports[_0x0d54('0x6a')]=function(_0x988ac4,_0x57092e){return db[_0x0d54('0x20')][_0x0d54('0x36')]({'where':{'id':_0x988ac4[_0x0d54('0x3a')]['id']}})[_0x0d54('0x14')](handleEntityNotFound(_0x57092e,null))[_0x0d54('0x14')](function(_0x19365d){if(_0x19365d){return _0x19365d[_0x0d54('0x6a')](_0x988ac4['query'][_0x0d54('0x51')])['then'](function(){if(_[_0x0d54('0x6c')](_0x988ac4[_0x0d54('0x25')][_0x0d54('0x51')])){for(var _0x11029b=0x0;_0x11029b<_0x988ac4[_0x0d54('0x25')][_0x0d54('0x51')][_0x0d54('0x4d')];_0x11029b+=0x1){socket[_0x0d54('0x5a')](_0x0d54('0x6d'),{'UserId':Number(_0x988ac4[_0x0d54('0x25')][_0x0d54('0x51')][_0x11029b]),'WhatsappQueueId':Number(_0x988ac4[_0x0d54('0x3a')]['id'])});}}else{socket[_0x0d54('0x5a')]('userWhatsappQueue:remove',{'UserId':Number(_0x988ac4[_0x0d54('0x25')]['ids']),'WhatsappQueueId':Number(_0x988ac4[_0x0d54('0x3a')]['id'])});}});}})[_0x0d54('0x14')](respondWithStatusCode(_0x57092e,null))['catch'](handleError(_0x57092e,null));};exports[_0x0d54('0x6e')]=function(_0x3e7b3c,_0x305997){var _0x4a334b={};var _0x2e9f12={};var _0x4eb471;var _0x1ed9eb;return db['WhatsappQueue'][_0x0d54('0x3c')]({'where':{'id':_0x3e7b3c[_0x0d54('0x3a')]['id']}})['then'](handleEntityNotFound(_0x305997,null))['then'](function(_0x4ab58f){if(_0x4ab58f){_0x4eb471=_0x4ab58f;_0x2e9f12[_0x0d54('0x2a')]=_['keys'](db['User'][_0x0d54('0x2b')]);_0x2e9f12[_0x0d54('0x25')]=_[_0x0d54('0x2c')](_0x3e7b3c[_0x0d54('0x25')]);_0x2e9f12['filters']=_[_0x0d54('0x2e')](_0x2e9f12[_0x0d54('0x2a')],_0x2e9f12[_0x0d54('0x25')]);_0x4a334b[_0x0d54('0x2f')]=_['intersection'](_0x2e9f12[_0x0d54('0x2a')],qs[_0x0d54('0x30')](_0x3e7b3c[_0x0d54('0x25')]['fields']));_0x4a334b[_0x0d54('0x2f')]=_0x4a334b[_0x0d54('0x2f')]['length']?_0x4a334b[_0x0d54('0x2f')]:_0x2e9f12[_0x0d54('0x2a')];_0x4a334b[_0x0d54('0x3f')]=qs[_0x0d54('0x40')](_0x3e7b3c[_0x0d54('0x25')]['sort']);_0x4a334b[_0x0d54('0x23')]=qs['filters'](_[_0x0d54('0x41')](_0x3e7b3c[_0x0d54('0x25')],_0x2e9f12[_0x0d54('0x2d')]));if(_0x3e7b3c['query'][_0x0d54('0x43')]){_0x4a334b[_0x0d54('0x23')]=_[_0x0d54('0x44')](_0x4a334b['where'],{'$or':_['map'](_0x4a334b[_0x0d54('0x2f')],function(_0x38410a){var _0x21bf61={};_0x21bf61[_0x38410a]={'$like':'%'+_0x3e7b3c[_0x0d54('0x25')][_0x0d54('0x43')]+'%'};return _0x21bf61;})});}_0x4a334b=_[_0x0d54('0x44')]({},_0x4a334b,_0x3e7b3c[_0x0d54('0x31')]);return _0x4eb471[_0x0d54('0x6e')](_0x4a334b);}})[_0x0d54('0x14')](function(_0xba82fe){if(_0xba82fe){_0x1ed9eb=_0xba82fe[_0x0d54('0x4d')];if(!_0x3e7b3c[_0x0d54('0x25')]['hasOwnProperty'](_0x0d54('0x3e'))){_0x4a334b[_0x0d54('0xf')]=qs[_0x0d54('0xf')](_0x3e7b3c['query'][_0x0d54('0xf')]);_0x4a334b[_0x0d54('0xd')]=qs['offset'](_0x3e7b3c[_0x0d54('0x25')][_0x0d54('0xd')]);}return _0x4eb471[_0x0d54('0x6e')](_0x4a334b);}})[_0x0d54('0x14')](function(_0x2848eb){if(_0x2848eb){return _0x2848eb?{'count':_0x1ed9eb,'rows':_0x2848eb}:null;}})[_0x0d54('0x14')](respondWithResult(_0x305997,null))['catch'](handleError(_0x305997,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 7fa5a59..3bde229 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 _0x8b40=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x148316,_0x6c9dc){var _0xdbe95d=function(_0x138a9f){while(--_0x138a9f){_0x148316['push'](_0x148316['shift']());}};_0xdbe95d(++_0x6c9dc);}(_0x8b40,0x1db));var _0x08b4=function(_0x5f3378,_0x55b77a){_0x5f3378=_0x5f3378-0x0;var _0x2d8566=_0x8b40[_0x5f3378];return _0x2d8566;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x08b4('0x0'))['db'][_0x08b4('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x08b4('0x2')](0x0);var events={'afterCreate':_0x08b4('0x3'),'afterUpdate':_0x08b4('0x4'),'afterDestroy':_0x08b4('0x5')};function emitEvent(_0x159884){return function(_0xdfb6c9,_0x397ab8,_0x55b8f8){WhatsappQueueEvents['emit'](_0x159884+':'+_0xdfb6c9['id'],_0xdfb6c9);WhatsappQueueEvents[_0x08b4('0x6')](_0x159884,_0xdfb6c9);_0x55b8f8(null);};}for(var e in events){if(events[_0x08b4('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x08b4('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x100b=['hook','exports','events','WhatsappQueue','save','update','emit','hasOwnProperty'];(function(_0x5c0950,_0x397d43){var _0x642db9=function(_0x357952){while(--_0x357952){_0x5c0950['push'](_0x5c0950['shift']());}};_0x642db9(++_0x397d43);}(_0x100b,0x19a));var _0xb100=function(_0x451352,_0x2b585c){_0x451352=_0x451352-0x0;var _0x443373=_0x100b[_0x451352];return _0x443373;};'use strict';var EventEmitter=require(_0xb100('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xb100('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb100('0x2'),'afterUpdate':_0xb100('0x3'),'afterDestroy':'remove'};function emitEvent(_0x22bcc2){return function(_0x312fc3,_0xa29598,_0x224901){WhatsappQueueEvents[_0xb100('0x4')](_0x22bcc2+':'+_0x312fc3['id'],_0x312fc3);WhatsappQueueEvents['emit'](_0x22bcc2,_0x312fc3);_0x224901(null);};}for(var e in events){if(events[_0xb100('0x5')](e)){var event=events[e];WhatsappQueue[_0xb100('0x6')](e,emitEvent(event));}}module[_0xb100('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 39a6b50..9dce56b 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 _0xfbce=['whatsapp_queues','util','api','bluebird','request-promise','path','rimraf'];(function(_0x32ebb2,_0x5760fd){var _0x3ec997=function(_0x1ef87e){while(--_0x1ef87e){_0x32ebb2['push'](_0x32ebb2['shift']());}};_0x3ec997(++_0x5760fd);}(_0xfbce,0x1ac));var _0xefbc=function(_0x31c0d2,_0x3f0c53){_0x31c0d2=_0x31c0d2-0x0;var _0xf003dd=_0xfbce[_0x31c0d2];return _0xf003dd;};'use strict';var _=require('lodash');var util=require(_0xefbc('0x0'));var logger=require('../../config/logger')(_0xefbc('0x1'));var moment=require('moment');var BPromise=require(_0xefbc('0x2'));var rp=require(_0xefbc('0x3'));var fs=require('fs');var path=require(_0xefbc('0x4'));var rimraf=require(_0xefbc('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x2aefbc,_0x350e31){return _0x2aefbc['define']('WhatsappQueue',attributes,{'tableName':_0xefbc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83f6=['./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x1ba07c,_0x5dff4f){var _0x2c0a4b=function(_0x4abbb3){while(--_0x4abbb3){_0x1ba07c['push'](_0x1ba07c['shift']());}};_0x2c0a4b(++_0x5dff4f);}(_0x83f6,0x1e8));var _0x683f=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x83f6[_0x57da0a];return _0x3145d5;};'use strict';var _=require(_0x683f('0x0'));var util=require(_0x683f('0x1'));var logger=require('../../config/logger')(_0x683f('0x2'));var moment=require('moment');var BPromise=require(_0x683f('0x3'));var rp=require(_0x683f('0x4'));var fs=require('fs');var path=require(_0x683f('0x5'));var rimraf=require(_0x683f('0x6'));var config=require('../../config/environment');var attributes=require(_0x683f('0x7'));module[_0x683f('0x8')]=function(_0x556c95,_0xbdea52){return _0x556c95[_0x683f('0x9')](_0x683f('0xa'),attributes,{'tableName':'whatsapp_queues','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 7360ebf..4351863 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 _0x6548=['debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','WhatsappQueue','options','where','attributes','limit','include','model','map','GetWhatsappQueue','catch','ShowWhatsappQueue','raw','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x6548,0x1cf));var _0x8654=function(_0x4e0964,_0x4c179b){_0x4e0964=_0x4e0964-0x0;var _0x34eadf=_0x6548[_0x4e0964];return _0x34eadf;};'use strict';var _=require('lodash');var util=require(_0x8654('0x0'));var moment=require(_0x8654('0x1'));var BPromise=require('bluebird');var rs=require(_0x8654('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8654('0x3'))(_0x8654('0x4'));var config=require(_0x8654('0x5'));var jayson=require(_0x8654('0x6'));var client=jayson[_0x8654('0x7')][_0x8654('0x8')]({'port':0x232a});config[_0x8654('0x9')]=_[_0x8654('0xa')](config[_0x8654('0x9')],{'host':_0x8654('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8654('0xc')](socket);function respondWithRpcPromise(_0x27b98a,_0xff0ae1,_0xc356d2){return new BPromise(function(_0x50fef0,_0x1d22c8){return client[_0x8654('0xd')](_0x27b98a,_0xc356d2)[_0x8654('0xe')](function(_0x2dd9e8){logger[_0x8654('0xf')](_0x8654('0x10'),_0xff0ae1,_0x8654('0x11'));logger[_0x8654('0x12')](_0x8654('0x13'),_0xff0ae1,_0x8654('0x11'),JSON[_0x8654('0x14')](_0x2dd9e8));if(_0x2dd9e8['error']){if(_0x2dd9e8['error'][_0x8654('0x15')]===0x1f4){logger[_0x8654('0x16')](_0x8654('0x10'),_0xff0ae1,_0x2dd9e8['error'][_0x8654('0x17')]);return _0x1d22c8(_0x2dd9e8['error']['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0xff0ae1,_0x2dd9e8[_0x8654('0x16')][_0x8654('0x17')]);return _0x50fef0(_0x2dd9e8['error'][_0x8654('0x17')]);}else{logger['info'](_0x8654('0x10'),_0xff0ae1,_0x8654('0x11'));_0x50fef0(_0x2dd9e8[_0x8654('0x18')][_0x8654('0x17')]);}})['catch'](function(_0xeef876){logger[_0x8654('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0xff0ae1,_0xeef876);_0x1d22c8(_0xeef876);});});}exports['GetWhatsappQueue']=function(_0x57fdd1){var _0x2ec4d7=this;return new Promise(function(_0x2bb1da,_0xd8a5f8){return db[_0x8654('0x19')]['findAll']({'raw':_0x57fdd1[_0x8654('0x1a')]?_0x57fdd1[_0x8654('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x57fdd1[_0x8654('0x1a')]?_0x57fdd1['options'][_0x8654('0x1b')]||null:null,'attributes':_0x57fdd1[_0x8654('0x1a')]?_0x57fdd1['options'][_0x8654('0x1c')]||null:null,'limit':_0x57fdd1[_0x8654('0x1a')]?_0x57fdd1[_0x8654('0x1a')][_0x8654('0x1d')]||null:null,'include':_0x57fdd1['options']?_0x57fdd1[_0x8654('0x1a')][_0x8654('0x1e')]?_['map'](_0x57fdd1[_0x8654('0x1a')]['include'],function(_0x5a5efb){return{'model':db[_0x5a5efb[_0x8654('0x1f')]],'as':_0x5a5efb['as'],'attributes':_0x5a5efb[_0x8654('0x1c')],'include':_0x5a5efb[_0x8654('0x1e')]?_[_0x8654('0x20')](_0x5a5efb[_0x8654('0x1e')],function(_0x44be76){return{'model':db[_0x44be76[_0x8654('0x1f')]],'as':_0x44be76['as'],'attributes':_0x44be76['attributes'],'include':_0x44be76[_0x8654('0x1e')]?_[_0x8654('0x20')](_0x44be76['include'],function(_0x101fd2){return{'model':db[_0x101fd2['model']],'as':_0x101fd2['as'],'attributes':_0x101fd2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da203){logger[_0x8654('0xf')](_0x8654('0x21'),_0x57fdd1);logger[_0x8654('0x12')](_0x8654('0x21'),_0x57fdd1,JSON[_0x8654('0x14')](_0x3da203));_0x2bb1da(_0x3da203);})[_0x8654('0x22')](function(_0x590727){logger['error'](_0x8654('0x21'),_0x590727[_0x8654('0x17')],_0x57fdd1);_0xd8a5f8(_0x2ec4d7[_0x8654('0x16')](0x1f4,_0x590727[_0x8654('0x17')]));});});};exports[_0x8654('0x23')]=function(_0x5e2549){var _0x5c8bc8=this;return new Promise(function(_0xa0a3fa,_0x482ec2){return db[_0x8654('0x19')]['find']({'raw':_0x5e2549[_0x8654('0x1a')]?_0x5e2549[_0x8654('0x1a')][_0x8654('0x24')]===undefined?!![]:![]:!![],'where':_0x5e2549[_0x8654('0x1a')]?_0x5e2549[_0x8654('0x1a')]['where']||null:null,'attributes':_0x5e2549['options']?_0x5e2549['options'][_0x8654('0x1c')]||null:null,'include':_0x5e2549[_0x8654('0x1a')]?_0x5e2549[_0x8654('0x1a')][_0x8654('0x1e')]?_[_0x8654('0x20')](_0x5e2549[_0x8654('0x1a')][_0x8654('0x1e')],function(_0x893f7){return{'model':db[_0x893f7[_0x8654('0x1f')]],'as':_0x893f7['as'],'attributes':_0x893f7[_0x8654('0x1c')],'include':_0x893f7[_0x8654('0x1e')]?_['map'](_0x893f7[_0x8654('0x1e')],function(_0x228440){return{'model':db[_0x228440[_0x8654('0x1f')]],'as':_0x228440['as'],'attributes':_0x228440[_0x8654('0x1c')],'include':_0x228440[_0x8654('0x1e')]?_[_0x8654('0x20')](_0x228440['include'],function(_0xc34b7a){return{'model':db[_0xc34b7a[_0x8654('0x1f')]],'as':_0xc34b7a['as'],'attributes':_0xc34b7a[_0x8654('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8654('0xe')](function(_0x14b248){logger[_0x8654('0xf')](_0x8654('0x23'),_0x5e2549);logger[_0x8654('0x12')]('ShowWhatsappQueue',_0x5e2549,JSON['stringify'](_0x14b248));_0xa0a3fa(_0x14b248);})['catch'](function(_0x12fdef){logger[_0x8654('0x16')](_0x8654('0x23'),_0x12fdef[_0x8654('0x17')],_0x5e2549);_0x482ec2(_0x5c8bc8[_0x8654('0x16')](0x1f4,_0x12fdef[_0x8654('0x17')]));});});}; \ No newline at end of file +var _0x0b44=['../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x19a423,_0xa2bc5a){var _0x7ad695=function(_0x1c1773){while(--_0x1c1773){_0x19a423['push'](_0x19a423['shift']());}};_0x7ad695(++_0xa2bc5a);}(_0x0b44,0x17b));var _0x40b4=function(_0x58dfda,_0x1b4a1c){_0x58dfda=_0x58dfda-0x0;var _0x305e00=_0x0b44[_0x58dfda];return _0x305e00;};'use strict';var _=require(_0x40b4('0x0'));var util=require(_0x40b4('0x1'));var moment=require(_0x40b4('0x2'));var BPromise=require(_0x40b4('0x3'));var rs=require(_0x40b4('0x4'));var fs=require('fs');var Redis=require(_0x40b4('0x5'));var db=require(_0x40b4('0x6'))['db'];var utils=require(_0x40b4('0x7'));var logger=require(_0x40b4('0x8'))(_0x40b4('0x9'));var config=require('../../config/environment');var jayson=require(_0x40b4('0xa'));var client=jayson['client'][_0x40b4('0xb')]({'port':0x232a});config[_0x40b4('0xc')]=_[_0x40b4('0xd')](config[_0x40b4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x40b4('0xe'))(new Redis(config[_0x40b4('0xc')]));require(_0x40b4('0xf'))[_0x40b4('0x10')](socket);function respondWithRpcPromise(_0x5c202f,_0x40f8a1,_0x3a09dc){return new BPromise(function(_0x495ea9,_0xf329b2){return client[_0x40b4('0x11')](_0x5c202f,_0x3a09dc)[_0x40b4('0x12')](function(_0x599d87){logger[_0x40b4('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x40f8a1,_0x40b4('0x14'));logger[_0x40b4('0x15')](_0x40b4('0x16'),_0x40f8a1,_0x40b4('0x14'),JSON[_0x40b4('0x17')](_0x599d87));if(_0x599d87[_0x40b4('0x18')]){if(_0x599d87[_0x40b4('0x18')][_0x40b4('0x19')]===0x1f4){logger[_0x40b4('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x40f8a1,_0x599d87['error'][_0x40b4('0x1a')]);return _0xf329b2(_0x599d87[_0x40b4('0x18')]['message']);}logger[_0x40b4('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x40f8a1,_0x599d87[_0x40b4('0x18')]['message']);return _0x495ea9(_0x599d87[_0x40b4('0x18')][_0x40b4('0x1a')]);}else{logger[_0x40b4('0x13')](_0x40b4('0x1b'),_0x40f8a1,_0x40b4('0x14'));_0x495ea9(_0x599d87[_0x40b4('0x1c')][_0x40b4('0x1a')]);}})[_0x40b4('0x1d')](function(_0x580dfa){logger[_0x40b4('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x40f8a1,_0x580dfa);_0xf329b2(_0x580dfa);});});}exports[_0x40b4('0x1e')]=function(_0x6de1d1){var _0x569181=this;return new Promise(function(_0x4e0706,_0x8048e1){return db[_0x40b4('0x1f')][_0x40b4('0x20')]({'raw':_0x6de1d1[_0x40b4('0x21')]?_0x6de1d1[_0x40b4('0x21')][_0x40b4('0x22')]===undefined?!![]:![]:!![],'where':_0x6de1d1['options']?_0x6de1d1['options'][_0x40b4('0x23')]||null:null,'attributes':_0x6de1d1[_0x40b4('0x21')]?_0x6de1d1[_0x40b4('0x21')][_0x40b4('0x24')]||null:null,'limit':_0x6de1d1[_0x40b4('0x21')]?_0x6de1d1[_0x40b4('0x21')][_0x40b4('0x25')]||null:null,'include':_0x6de1d1[_0x40b4('0x21')]?_0x6de1d1[_0x40b4('0x21')]['include']?_[_0x40b4('0x26')](_0x6de1d1[_0x40b4('0x21')][_0x40b4('0x27')],function(_0x57593d){return{'model':db[_0x57593d[_0x40b4('0x28')]],'as':_0x57593d['as'],'attributes':_0x57593d['attributes'],'include':_0x57593d[_0x40b4('0x27')]?_[_0x40b4('0x26')](_0x57593d[_0x40b4('0x27')],function(_0x53d243){return{'model':db[_0x53d243['model']],'as':_0x53d243['as'],'attributes':_0x53d243[_0x40b4('0x24')],'include':_0x53d243[_0x40b4('0x27')]?_[_0x40b4('0x26')](_0x53d243[_0x40b4('0x27')],function(_0x369ff0){return{'model':db[_0x369ff0[_0x40b4('0x28')]],'as':_0x369ff0['as'],'attributes':_0x369ff0[_0x40b4('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x191c12){logger[_0x40b4('0x13')](_0x40b4('0x1e'),_0x6de1d1);logger['debug'](_0x40b4('0x1e'),_0x6de1d1,JSON[_0x40b4('0x17')](_0x191c12));_0x4e0706(_0x191c12);})[_0x40b4('0x1d')](function(_0x21b816){logger['error']('GetWhatsappQueue',_0x21b816['message'],_0x6de1d1);_0x8048e1(_0x569181[_0x40b4('0x18')](0x1f4,_0x21b816[_0x40b4('0x1a')]));});});};exports[_0x40b4('0x29')]=function(_0x2a2a5f){var _0x4a3e87=this;return new Promise(function(_0xca0fdf,_0x3a11df){return db[_0x40b4('0x1f')][_0x40b4('0x2a')]({'raw':_0x2a2a5f[_0x40b4('0x21')]?_0x2a2a5f['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a2a5f['options']?_0x2a2a5f[_0x40b4('0x21')][_0x40b4('0x23')]||null:null,'attributes':_0x2a2a5f[_0x40b4('0x21')]?_0x2a2a5f[_0x40b4('0x21')][_0x40b4('0x24')]||null:null,'include':_0x2a2a5f[_0x40b4('0x21')]?_0x2a2a5f[_0x40b4('0x21')][_0x40b4('0x27')]?_['map'](_0x2a2a5f['options']['include'],function(_0x348193){return{'model':db[_0x348193[_0x40b4('0x28')]],'as':_0x348193['as'],'attributes':_0x348193[_0x40b4('0x24')],'include':_0x348193[_0x40b4('0x27')]?_[_0x40b4('0x26')](_0x348193[_0x40b4('0x27')],function(_0x572076){return{'model':db[_0x572076[_0x40b4('0x28')]],'as':_0x572076['as'],'attributes':_0x572076[_0x40b4('0x24')],'include':_0x572076[_0x40b4('0x27')]?_[_0x40b4('0x26')](_0x572076[_0x40b4('0x27')],function(_0x572187){return{'model':db[_0x572187[_0x40b4('0x28')]],'as':_0x572187['as'],'attributes':_0x572187[_0x40b4('0x24')]};}):[]};}):[]};}):[]:[]})[_0x40b4('0x12')](function(_0x1c8675){logger[_0x40b4('0x13')](_0x40b4('0x29'),_0x2a2a5f);logger[_0x40b4('0x15')]('ShowWhatsappQueue',_0x2a2a5f,JSON['stringify'](_0x1c8675));_0xca0fdf(_0x1c8675);})[_0x40b4('0x1d')](function(_0x205a46){logger[_0x40b4('0x18')](_0x40b4('0x29'),_0x205a46[_0x40b4('0x1a')],_0x2a2a5f);_0x3a11df(_0x4a3e87['error'](0x1f4,_0x205a46[_0x40b4('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0aa6505..b702658 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 _0x6b29=['remove','register','whatsappQueue:'];(function(_0x26676e,_0x204553){var _0x221b46=function(_0x26f626){while(--_0x26f626){_0x26676e['push'](_0x26676e['shift']());}};_0x221b46(++_0x204553);}(_0x6b29,0xea));var _0x96b2=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x6b29[_0x20fdc1];return _0x25397c;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x96b2('0x0'),'update'];function createListener(_0x2819a9,_0x32c1f7){return function(_0x3c97ca){_0x32c1f7['emit'](_0x2819a9,_0x3c97ca);};}function removeListener(_0x4630a5,_0x436c6a){return function(){WhatsappQueueEvents['removeListener'](_0x4630a5,_0x436c6a);};}exports[_0x96b2('0x1')]=function(_0x594b89){for(var _0x394574=0x0,_0x463276=events['length'];_0x394574<_0x463276;_0x394574++){var _0x25c859=events[_0x394574];var _0x210773=createListener(_0x96b2('0x2')+_0x25c859,_0x594b89);WhatsappQueueEvents['on'](_0x25c859,_0x210773);}}; \ No newline at end of file +var _0x8120=['whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','register','length'];(function(_0x26ba8c,_0x5c3dc9){var _0x5dc5a7=function(_0x5b0721){while(--_0x5b0721){_0x26ba8c['push'](_0x26ba8c['shift']());}};_0x5dc5a7(++_0x5c3dc9);}(_0x8120,0x81));var _0x0812=function(_0x344931,_0x524b6c){_0x344931=_0x344931-0x0;var _0x5baf73=_0x8120[_0x344931];return _0x5baf73;};'use strict';var WhatsappQueueEvents=require(_0x0812('0x0'));var events=['save',_0x0812('0x1'),_0x0812('0x2')];function createListener(_0x2415c1,_0x1db65f){return function(_0x58f41f){_0x1db65f[_0x0812('0x3')](_0x2415c1,_0x58f41f);};}function removeListener(_0x552c58,_0x3ebe9b){return function(){WhatsappQueueEvents[_0x0812('0x4')](_0x552c58,_0x3ebe9b);};}exports[_0x0812('0x5')]=function(_0x4ce0cb){for(var _0x44142e=0x0,_0xdaeb1a=events[_0x0812('0x6')];_0x44142e<_0xdaeb1a;_0x44142e++){var _0x34111f=events[_0x44142e];var _0x3af460=createListener(_0x0812('0x7')+_0x34111f,_0x4ce0cb);WhatsappQueueEvents['on'](_0x34111f,_0x3af460);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 585110e..3a9694a 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 _0x399f=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x6cf756,_0x3daec7){var _0x552797=function(_0x2bff8c){while(--_0x2bff8c){_0x6cf756['push'](_0x6cf756['shift']());}};_0x552797(++_0x3daec7);}(_0x399f,0x11d));var _0xf399=function(_0x392c62,_0x543c09){_0x392c62=_0x392c62-0x0;var _0x5ce269=_0x399f[_0x392c62];return _0x5ce269;};'use strict';var multer=require(_0xf399('0x0'));var util=require(_0xf399('0x1'));var path=require(_0xf399('0x2'));var timeout=require('connect-timeout');var express=require(_0xf399('0x3'));var router=express[_0xf399('0x4')]();var fs_extra=require(_0xf399('0x5'));var auth=require(_0xf399('0x6'));var interaction=require(_0xf399('0x7'));var config=require(_0xf399('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xf399('0x9')]('/',auth['isAuthenticated'](),controller[_0xf399('0xa')]);router[_0xf399('0x9')](_0xf399('0xb'),auth[_0xf399('0xc')](),controller['describe']);router['get'](_0xf399('0xd'),auth[_0xf399('0xc')](),controller[_0xf399('0xe')]);router[_0xf399('0xf')]('/',auth[_0xf399('0xc')](),controller[_0xf399('0x10')]);router[_0xf399('0x11')](_0xf399('0xd'),auth['isAuthenticated'](),controller[_0xf399('0x12')]);router[_0xf399('0x13')](_0xf399('0xd'),auth[_0xf399('0xc')](),controller[_0xf399('0x14')]);module[_0xf399('0x15')]=router; \ No newline at end of file +var _0x9a44=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','/describe','describe','/:id'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x9a44,0x196));var _0x49a4=function(_0x59ad79,_0x3b5c5d){_0x59ad79=_0x59ad79-0x0;var _0x1324a6=_0x9a44[_0x59ad79];return _0x1324a6;};'use strict';var multer=require(_0x49a4('0x0'));var util=require(_0x49a4('0x1'));var path=require(_0x49a4('0x2'));var timeout=require(_0x49a4('0x3'));var express=require(_0x49a4('0x4'));var router=express[_0x49a4('0x5')]();var fs_extra=require(_0x49a4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x49a4('0x7'));var config=require(_0x49a4('0x8'));var controller=require(_0x49a4('0x9'));router['get']('/',auth[_0x49a4('0xa')](),controller['index']);router['get'](_0x49a4('0xb'),auth['isAuthenticated'](),controller[_0x49a4('0xc')]);router['get'](_0x49a4('0xd'),auth['isAuthenticated'](),controller[_0x49a4('0xe')]);router[_0x49a4('0xf')]('/',auth[_0x49a4('0xa')](),controller[_0x49a4('0x10')]);router[_0x49a4('0x11')](_0x49a4('0xd'),auth[_0x49a4('0xa')](),controller['update']);router[_0x49a4('0x12')](_0x49a4('0xd'),auth[_0x49a4('0xa')](),controller['destroy']);module[_0x49a4('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 233d95d..5d0248e 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3c78f0,_0x37d445){var _0xb6e55e=function(_0x2253e7){while(--_0x2253e7){_0x3c78f0['push'](_0x3c78f0['shift']());}};_0xb6e55e(++_0x37d445);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1ad36d,_0x2ba53b){var _0x3aafc1=function(_0x6511b5){while(--_0x6511b5){_0x1ad36d['push'](_0x1ad36d['shift']());}};_0x3aafc1(++_0x2ba53b);}(_0x7a54,0x106));var _0x47a5=function(_0x344d7b,_0x4293fb){_0x344d7b=_0x344d7b-0x0;var _0x376c40=_0x7a54[_0x344d7b];return _0x376c40;};'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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 75bd4ff..b8e7ad8 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','destroy','describe','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','map','key','model','query','keys','filters','intersection','attributes'];(function(_0x379a73,_0x5d0978){var _0x19d384=function(_0x586297){while(--_0x586297){_0x379a73['push'](_0x379a73['shift']());}};_0x19d384(++_0x5d0978);}(_0xda3f,0xec));var _0xfda3=function(_0x5a3b0b,_0x3acf39){_0x5a3b0b=_0x5a3b0b-0x0;var _0x149c2a=_0xda3f[_0x5a3b0b];return _0x149c2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['index']=function(_0x3c1549,_0x4101b1){var _0x301509={},_0x474992={},_0xe21ec6={'count':0x0,'rows':[]};var _0x3cfeb2=_[_0xfda3('0x28')](db['WhatsappQueueReport']['rawAttributes'],function(_0x3aef3c){return{'name':_0x3aef3c['fieldName'],'type':_0x3aef3c['type'][_0xfda3('0x29')]};});_0x474992[_0xfda3('0x2a')]=_[_0xfda3('0x28')](_0x3cfeb2,_0xfda3('0x26'));_0x474992[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x3c1549[_0xfda3('0x2b')]);_0x474992[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x474992['model'],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2f')]=_[_0xfda3('0x2e')](_0x474992[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x301509[_0xfda3('0x2f')]=_0x301509[_0xfda3('0x2f')]['length']?_0x301509['attributes']:_0x474992[_0xfda3('0x2a')];if(!_0x3c1549[_0xfda3('0x2b')]['hasOwnProperty'](_0xfda3('0x31'))){_0x301509[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3c1549['query'][_0xfda3('0x1b')]);_0x301509[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x19')]);}_0x301509['order']=qs[_0xfda3('0x32')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x32')]);_0x301509['where']=qs[_0xfda3('0x2d')](_['pick'](_0x3c1549[_0xfda3('0x2b')],_0x474992[_0xfda3('0x2d')]),_0x3cfeb2);if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x33')]){_0x301509[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x301509[_0xfda3('0x34')],{'$or':_[_0xfda3('0x28')](_0x3cfeb2,function(_0x577be8){if(_0x577be8[_0xfda3('0x36')]!==_0xfda3('0x37')){var _0xd2dde0={};_0xd2dde0[_0x577be8[_0xfda3('0x26')]]={'$like':'%'+_0x3c1549['query'][_0xfda3('0x33')]+'%'};return _0xd2dde0;}})});}_0x301509=_[_0xfda3('0x35')]({},_0x301509,_0x3c1549[_0xfda3('0x38')]);var _0x5bad90={'where':_0x301509['where']};return db[_0xfda3('0x39')][_0xfda3('0x1c')](_0x5bad90)[_0xfda3('0x23')](function(_0x1aaa6c){_0xe21ec6[_0xfda3('0x1c')]=_0x1aaa6c;if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x301509[_0xfda3('0x3b')]=[{'all':!![]}];}return db[_0xfda3('0x39')][_0xfda3('0x3c')](_0x301509);})['then'](function(_0x27200f){_0xe21ec6[_0xfda3('0x3d')]=_0x27200f;return _0xe21ec6;})['then'](respondWithFilteredResult(_0x4101b1,_0x301509))[_0xfda3('0x3e')](handleError(_0x4101b1,null));};exports['show']=function(_0x51a314,_0x4e6886){var _0x2208bc={'raw':!![],'where':{'id':_0x51a314[_0xfda3('0x3f')]['id']}},_0x107fb1={};_0x107fb1[_0xfda3('0x2a')]=_['keys'](db[_0xfda3('0x39')][_0xfda3('0x40')]);_0x107fb1[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x51a314['query']);_0x107fb1[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],_0x107fb1['query']);_0x2208bc['attributes']=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x51a314[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x2208bc[_0xfda3('0x2f')]=_0x2208bc[_0xfda3('0x2f')][_0xfda3('0x41')]?_0x2208bc[_0xfda3('0x2f')]:_0x107fb1[_0xfda3('0x2a')];if(_0x51a314[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x2208bc[_0xfda3('0x3b')]=[{'all':!![]}];}_0x2208bc=_[_0xfda3('0x35')]({},_0x2208bc,_0x51a314['options']);return db['WhatsappQueueReport'][_0xfda3('0x42')](_0x2208bc)[_0xfda3('0x23')](handleEntityNotFound(_0x4e6886,null))[_0xfda3('0x23')](respondWithResult(_0x4e6886,null))[_0xfda3('0x3e')](handleError(_0x4e6886,null));};exports[_0xfda3('0x43')]=function(_0x60a89d,_0x192133){return db[_0xfda3('0x39')][_0xfda3('0x43')](_0x60a89d[_0xfda3('0x44')],{})['then'](respondWithResult(_0x192133,0xc9))[_0xfda3('0x3e')](handleError(_0x192133,null));};exports[_0xfda3('0x22')]=function(_0x481356,_0x36aa3a){if(_0x481356[_0xfda3('0x44')]['id']){delete _0x481356['body']['id'];}return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x481356[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x23')](saveUpdates(_0x481356[_0xfda3('0x44')],null))[_0xfda3('0x23')](respondWithResult(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x45')]=function(_0x33565d,_0x2f54eb){return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x33565d['params']['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2f54eb,null))['then'](removeEntity(_0x2f54eb,null))[_0xfda3('0x3e')](handleError(_0x2f54eb,null));};exports['describe']=function(_0x1b5e89,_0x6447){return db[_0xfda3('0x39')][_0xfda3('0x46')]()['then'](respondWithResult(_0x6447,null))[_0xfda3('0x3e')](handleError(_0x6447,null));}; \ No newline at end of file +var _0x5423=['params','describe','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','then','rows','catch','show','WhatsappQueueReport','find','create','body','update'];(function(_0x16d490,_0x144575){var _0x44f384=function(_0x554768){while(--_0x554768){_0x16d490['push'](_0x16d490['shift']());}};_0x44f384(++_0x144575);}(_0x5423,0xe3));var _0x3542=function(_0x49fbbd,_0x4e92cd){_0x49fbbd=_0x49fbbd-0x0;var _0x109918=_0x5423[_0x49fbbd];return _0x109918;};'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'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0x1e0723,_0x2f2e63){return function(_0x298763){if(!_0x298763){_0x1e0723[_0x3542('0x18')](0x194);}return _0x298763;};}function handleError(_0x412184,_0x1e156e){_0x1e156e=_0x1e156e||0x1f4;return function(_0x18dc6c){logger[_0x3542('0x24')](_0x18dc6c[_0x3542('0x25')]);if(_0x18dc6c[_0x3542('0x26')]){delete _0x18dc6c[_0x3542('0x26')];}_0x412184[_0x3542('0x19')](_0x1e156e)[_0x3542('0x27')](_0x18dc6c);};}exports[_0x3542('0x28')]=function(_0x303412,_0x20eda1){var _0x3bd666={},_0x5590a2={},_0x31ad47={'count':0x0,'rows':[]};var _0x35bbc9=_[_0x3542('0x29')](db['WhatsappQueueReport'][_0x3542('0x2a')],function(_0xc6f23b){return{'name':_0xc6f23b[_0x3542('0x2b')],'type':_0xc6f23b[_0x3542('0x2c')]['key']};});_0x5590a2['model']=_[_0x3542('0x29')](_0x35bbc9,_0x3542('0x26'));_0x5590a2[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x303412[_0x3542('0x2d')]);_0x5590a2[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5590a2['model'],_0x5590a2['query']);_0x3bd666[_0x3542('0x31')]=_['intersection'](_0x5590a2['model'],qs[_0x3542('0x32')](_0x303412['query']['fields']));_0x3bd666[_0x3542('0x31')]=_0x3bd666[_0x3542('0x31')][_0x3542('0x33')]?_0x3bd666['attributes']:_0x5590a2[_0x3542('0x34')];if(!_0x303412['query'][_0x3542('0x35')](_0x3542('0x36'))){_0x3bd666['limit']=qs[_0x3542('0x1f')](_0x303412['query'][_0x3542('0x1f')]);_0x3bd666[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x303412['query'][_0x3542('0x1c')]);}_0x3bd666['order']=qs[_0x3542('0x37')](_0x303412[_0x3542('0x2d')][_0x3542('0x37')]);_0x3bd666[_0x3542('0x38')]=qs[_0x3542('0x2f')](_[_0x3542('0x39')](_0x303412[_0x3542('0x2d')],_0x5590a2[_0x3542('0x2f')]),_0x35bbc9);if(_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]){_0x3bd666[_0x3542('0x38')]=_[_0x3542('0x3b')](_0x3bd666[_0x3542('0x38')],{'$or':_['map'](_0x35bbc9,function(_0x62429){if(_0x62429['type']!=='VIRTUAL'){var _0x2782f2={};_0x2782f2[_0x62429[_0x3542('0x26')]]={'$like':'%'+_0x303412[_0x3542('0x2d')][_0x3542('0x3a')]+'%'};return _0x2782f2;}})});}_0x3bd666=_[_0x3542('0x3b')]({},_0x3bd666,_0x303412[_0x3542('0x3c')]);var _0xc7f13c={'where':_0x3bd666[_0x3542('0x38')]};return db['WhatsappQueueReport'][_0x3542('0x1e')](_0xc7f13c)['then'](function(_0x1c8855){_0x31ad47[_0x3542('0x1e')]=_0x1c8855;if(_0x303412['query'][_0x3542('0x3d')]){_0x3bd666[_0x3542('0x3e')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x3542('0x3f')](_0x3bd666);})[_0x3542('0x40')](function(_0x5e1b29){_0x31ad47[_0x3542('0x41')]=_0x5e1b29;return _0x31ad47;})[_0x3542('0x40')](respondWithFilteredResult(_0x20eda1,_0x3bd666))[_0x3542('0x42')](handleError(_0x20eda1,null));};exports[_0x3542('0x43')]=function(_0x290c7c,_0xb12441){var _0x2b54b9={'raw':!![],'where':{'id':_0x290c7c['params']['id']}},_0x4bf45a={};_0x4bf45a[_0x3542('0x34')]=_[_0x3542('0x2e')](db[_0x3542('0x44')][_0x3542('0x2a')]);_0x4bf45a[_0x3542('0x2d')]=_['keys'](_0x290c7c[_0x3542('0x2d')]);_0x4bf45a['filters']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],_0x4bf45a[_0x3542('0x2d')]);_0x2b54b9['attributes']=_[_0x3542('0x30')](_0x4bf45a[_0x3542('0x34')],qs['fields'](_0x290c7c[_0x3542('0x2d')][_0x3542('0x32')]));_0x2b54b9[_0x3542('0x31')]=_0x2b54b9[_0x3542('0x31')][_0x3542('0x33')]?_0x2b54b9[_0x3542('0x31')]:_0x4bf45a[_0x3542('0x34')];if(_0x290c7c[_0x3542('0x2d')]['includeAll']){_0x2b54b9['include']=[{'all':!![]}];}_0x2b54b9=_['merge']({},_0x2b54b9,_0x290c7c[_0x3542('0x3c')]);return db[_0x3542('0x44')][_0x3542('0x45')](_0x2b54b9)[_0x3542('0x40')](handleEntityNotFound(_0xb12441,null))[_0x3542('0x40')](respondWithResult(_0xb12441,null))[_0x3542('0x42')](handleError(_0xb12441,null));};exports[_0x3542('0x46')]=function(_0x5adf34,_0x157683){return db[_0x3542('0x44')][_0x3542('0x46')](_0x5adf34[_0x3542('0x47')],{})['then'](respondWithResult(_0x157683,0xc9))[_0x3542('0x42')](handleError(_0x157683,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){if(_0x55b43a[_0x3542('0x47')]['id']){delete _0x55b43a[_0x3542('0x47')]['id'];}return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x55b43a[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x528f8c,null))[_0x3542('0x40')](saveUpdates(_0x55b43a['body'],null))[_0x3542('0x40')](respondWithResult(_0x528f8c,null))[_0x3542('0x42')](handleError(_0x528f8c,null));};exports[_0x3542('0x23')]=function(_0x392c6e,_0x1ebc82){return db[_0x3542('0x44')][_0x3542('0x45')]({'where':{'id':_0x392c6e[_0x3542('0x49')]['id']}})[_0x3542('0x40')](handleEntityNotFound(_0x1ebc82,null))['then'](removeEntity(_0x1ebc82,null))['catch'](handleError(_0x1ebc82,null));};exports[_0x3542('0x4a')]=function(_0x4b406b,_0x5a798a){return db['WhatsappQueueReport'][_0x3542('0x4a')]()[_0x3542('0x40')](respondWithResult(_0x5a798a,null))[_0x3542('0x42')](handleError(_0x5a798a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ba4e976..d3df047 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 _0x773a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x1a8324,_0x54cd51){var _0x41aa57=function(_0x458306){while(--_0x458306){_0x1a8324['push'](_0x1a8324['shift']());}};_0x41aa57(++_0x54cd51);}(_0x773a,0x1cc));var _0xa773=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x773a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa773('0x0'));var util=require(_0xa773('0x1'));var logger=require(_0xa773('0x2'))('api');var moment=require(_0xa773('0x3'));var BPromise=require(_0xa773('0x4'));var rp=require(_0xa773('0x5'));var fs=require('fs');var path=require(_0xa773('0x6'));var rimraf=require(_0xa773('0x7'));var config=require(_0xa773('0x8'));var attributes=require(_0xa773('0x9'));module[_0xa773('0xa')]=function(_0x58628c,_0x4a1e07){return _0x58628c[_0xa773('0xb')]('WhatsappQueueReport',attributes,{'tableName':_0xa773('0xc'),'paranoid':![],'indexes':[{'name':_0xa773('0xd'),'fields':[_0xa773('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f30=['../../config/environment','define','WhatsappQueueReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2064a1,_0x4023e1){var _0x38aa5a=function(_0x342abc){while(--_0x342abc){_0x2064a1['push'](_0x2064a1['shift']());}};_0x38aa5a(++_0x4023e1);}(_0x6f30,0x1a8));var _0x06f3=function(_0x59b533,_0x59fdcc){_0x59b533=_0x59b533-0x0;var _0x2beced=_0x6f30[_0x59b533];return _0x2beced;};'use strict';var _=require('lodash');var util=require(_0x06f3('0x0'));var logger=require(_0x06f3('0x1'))(_0x06f3('0x2'));var moment=require(_0x06f3('0x3'));var BPromise=require(_0x06f3('0x4'));var rp=require(_0x06f3('0x5'));var fs=require('fs');var path=require(_0x06f3('0x6'));var rimraf=require(_0x06f3('0x7'));var config=require(_0x06f3('0x8'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x502539,_0x2fc7a9){return _0x502539[_0x06f3('0x9')](_0x06f3('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x06f3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 35ce237..7c3b866 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 _0xa6fb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','result','WhatsappQueueReport','create','options','raw','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','where','attributes','limit','lodash','moment','bluebird','../../mysqldb'];(function(_0x2f1171,_0x128d87){var _0x561e07=function(_0x1957d8){while(--_0x1957d8){_0x2f1171['push'](_0x2f1171['shift']());}};_0x561e07(++_0x128d87);}(_0xa6fb,0x132));var _0xba6f=function(_0x5ce513,_0x32ca3f){_0x5ce513=_0x5ce513-0x0;var _0x2d18df=_0xa6fb[_0x5ce513];return _0x2d18df;};'use strict';var _=require(_0xba6f('0x0'));var util=require('util');var moment=require(_0xba6f('0x1'));var BPromise=require(_0xba6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xba6f('0x4'))(_0xba6f('0x5'));var config=require(_0xba6f('0x6'));var jayson=require(_0xba6f('0x7'));var client=jayson[_0xba6f('0x8')][_0xba6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f49af,_0x5c5a1d,_0x53b7e8){return new BPromise(function(_0x28a04c,_0x278b08){return client[_0xba6f('0xa')](_0x1f49af,_0x53b7e8)[_0xba6f('0xb')](function(_0x4d5aeb){logger[_0xba6f('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5c5a1d,_0xba6f('0xd'));logger[_0xba6f('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5c5a1d,_0xba6f('0xd'),JSON[_0xba6f('0xf')](_0x4d5aeb));if(_0x4d5aeb[_0xba6f('0x10')]){if(_0x4d5aeb[_0xba6f('0x10')][_0xba6f('0x11')]===0x1f4){logger[_0xba6f('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5c5a1d,_0x4d5aeb[_0xba6f('0x10')][_0xba6f('0x12')]);return _0x278b08(_0x4d5aeb['error']['message']);}logger['error'](_0xba6f('0x13'),_0x5c5a1d,_0x4d5aeb[_0xba6f('0x10')]['message']);return _0x28a04c(_0x4d5aeb['error'][_0xba6f('0x12')]);}else{logger[_0xba6f('0xc')](_0xba6f('0x13'),_0x5c5a1d,_0xba6f('0xd'));_0x28a04c(_0x4d5aeb[_0xba6f('0x14')]['message']);}})['catch'](function(_0xc41aea){logger[_0xba6f('0x10')](_0xba6f('0x13'),_0x5c5a1d,_0xc41aea);_0x278b08(_0xc41aea);});});}exports['CreateWhatsappQueueReport']=function(_0x2169ec){var _0x36448d=this;return new Promise(function(_0x193b8a,_0x16212e){return db[_0xba6f('0x15')][_0xba6f('0x16')](_0x2169ec['body'],{'raw':_0x2169ec['options']?_0x2169ec[_0xba6f('0x17')][_0xba6f('0x18')]===undefined?!![]:![]:!![]})[_0xba6f('0xb')](function(_0x398a95){logger['info'](_0xba6f('0x19'),_0x2169ec);logger[_0xba6f('0xe')]('CreateWhatsappQueueReport',_0x2169ec,JSON[_0xba6f('0xf')](_0x398a95));_0x193b8a(_0x398a95);})[_0xba6f('0x1a')](function(_0xd69d2e){logger[_0xba6f('0x10')](_0xba6f('0x19'),_0xd69d2e[_0xba6f('0x12')],_0x2169ec);_0x16212e(_0x36448d[_0xba6f('0x10')](0x1f4,_0xd69d2e[_0xba6f('0x12')]));});});};exports[_0xba6f('0x1b')]=function(_0x10f715){var _0x3f4d7f=this;return new Promise(function(_0x2ec262,_0x9b214b){return db['WhatsappQueueReport']['update'](_0x10f715['body'],{'raw':_0x10f715['options']?_0x10f715[_0xba6f('0x17')][_0xba6f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10f715[_0xba6f('0x17')]?_0x10f715[_0xba6f('0x17')][_0xba6f('0x1c')]||null:null,'attributes':_0x10f715[_0xba6f('0x17')]?_0x10f715[_0xba6f('0x17')][_0xba6f('0x1d')]||null:null,'limit':_0x10f715[_0xba6f('0x17')]?_0x10f715['options'][_0xba6f('0x1e')]||null:null})[_0xba6f('0xb')](function(_0x582f6a){logger[_0xba6f('0xc')](_0xba6f('0x1b'),_0x10f715);logger[_0xba6f('0xe')](_0xba6f('0x1b'),_0x10f715,JSON['stringify'](_0x582f6a));_0x2ec262(_0x582f6a);})[_0xba6f('0x1a')](function(_0x4cc59c){logger['error']('UpdateWhatsappQueueReport',_0x4cc59c[_0xba6f('0x12')],_0x10f715);_0x9b214b(_0x3f4d7f[_0xba6f('0x10')](0x1f4,_0x4cc59c[_0xba6f('0x12')]));});});}; \ No newline at end of file +var _0x6a11=['catch','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','WhatsappQueueReport','options','raw','CreateWhatsappQueueReport'];(function(_0x50c0e2,_0x375c07){var _0x4e13a0=function(_0x1600a6){while(--_0x1600a6){_0x50c0e2['push'](_0x50c0e2['shift']());}};_0x4e13a0(++_0x375c07);}(_0x6a11,0xc0));var _0x16a1=function(_0x14a241,_0x32451a){_0x14a241=_0x14a241-0x0;var _0x397aad=_0x6a11[_0x14a241];return _0x397aad;};'use strict';var _=require(_0x16a1('0x0'));var util=require('util');var moment=require(_0x16a1('0x1'));var BPromise=require(_0x16a1('0x2'));var rs=require(_0x16a1('0x3'));var fs=require('fs');var Redis=require(_0x16a1('0x4'));var db=require(_0x16a1('0x5'))['db'];var utils=require(_0x16a1('0x6'));var logger=require(_0x16a1('0x7'))(_0x16a1('0x8'));var config=require('../../config/environment');var jayson=require(_0x16a1('0x9'));var client=jayson[_0x16a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2037b7,_0x330a11,_0xa32296){return new BPromise(function(_0x2f8f51,_0x3835e9){return client['request'](_0x2037b7,_0xa32296)[_0x16a1('0xb')](function(_0x593fe){logger[_0x16a1('0xc')](_0x16a1('0xd'),_0x330a11,'request\x20sent');logger[_0x16a1('0xe')](_0x16a1('0xf'),_0x330a11,_0x16a1('0x10'),JSON[_0x16a1('0x11')](_0x593fe));if(_0x593fe['error']){if(_0x593fe['error'][_0x16a1('0x12')]===0x1f4){logger[_0x16a1('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x330a11,_0x593fe[_0x16a1('0x13')][_0x16a1('0x14')]);return _0x3835e9(_0x593fe[_0x16a1('0x13')][_0x16a1('0x14')]);}logger['error'](_0x16a1('0xd'),_0x330a11,_0x593fe[_0x16a1('0x13')][_0x16a1('0x14')]);return _0x2f8f51(_0x593fe['error'][_0x16a1('0x14')]);}else{logger[_0x16a1('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x330a11,_0x16a1('0x10'));_0x2f8f51(_0x593fe['result']['message']);}})['catch'](function(_0x4f2dd7){logger[_0x16a1('0x13')](_0x16a1('0xd'),_0x330a11,_0x4f2dd7);_0x3835e9(_0x4f2dd7);});});}exports['CreateWhatsappQueueReport']=function(_0x4d4ee6){var _0x1b9d4b=this;return new Promise(function(_0x3513d0,_0x1982d5){return db[_0x16a1('0x15')]['create'](_0x4d4ee6['body'],{'raw':_0x4d4ee6['options']?_0x4d4ee6[_0x16a1('0x16')][_0x16a1('0x17')]===undefined?!![]:![]:!![]})[_0x16a1('0xb')](function(_0x4a9a94){logger[_0x16a1('0xc')]('CreateWhatsappQueueReport',_0x4d4ee6);logger[_0x16a1('0xe')](_0x16a1('0x18'),_0x4d4ee6,JSON['stringify'](_0x4a9a94));_0x3513d0(_0x4a9a94);})[_0x16a1('0x19')](function(_0x380710){logger[_0x16a1('0x13')](_0x16a1('0x18'),_0x380710['message'],_0x4d4ee6);_0x1982d5(_0x1b9d4b[_0x16a1('0x13')](0x1f4,_0x380710[_0x16a1('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x4a0514){var _0x50dba8=this;return new Promise(function(_0x10fa42,_0x87a268){return db[_0x16a1('0x15')][_0x16a1('0x1a')](_0x4a0514['body'],{'raw':_0x4a0514['options']?_0x4a0514[_0x16a1('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0514['options']?_0x4a0514['options'][_0x16a1('0x1b')]||null:null,'attributes':_0x4a0514[_0x16a1('0x16')]?_0x4a0514[_0x16a1('0x16')][_0x16a1('0x1c')]||null:null,'limit':_0x4a0514[_0x16a1('0x16')]?_0x4a0514[_0x16a1('0x16')][_0x16a1('0x1d')]||null:null})[_0x16a1('0xb')](function(_0x4c53e7){logger[_0x16a1('0xc')](_0x16a1('0x1e'),_0x4a0514);logger[_0x16a1('0xe')](_0x16a1('0x1e'),_0x4a0514,JSON[_0x16a1('0x11')](_0x4c53e7));_0x10fa42(_0x4c53e7);})[_0x16a1('0x19')](function(_0x247035){logger[_0x16a1('0x13')]('UpdateWhatsappQueueReport',_0x247035[_0x16a1('0x14')],_0x4a0514);_0x87a268(_0x50dba8['error'](0x1f4,_0x247035[_0x16a1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 30ab6f0..d94bb6b 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 _0x662b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x42aa30,_0x28f4f4){var _0x3980d0=function(_0x5dc09d){while(--_0x5dc09d){_0x42aa30['push'](_0x42aa30['shift']());}};_0x3980d0(++_0x28f4f4);}(_0x662b,0x7d));var _0xb662=function(_0x191a30,_0x386f7e){_0x191a30=_0x191a30-0x0;var _0x39361f=_0x662b[_0x191a30];return _0x39361f;};'use strict';var multer=require(_0xb662('0x0'));var util=require(_0xb662('0x1'));var path=require(_0xb662('0x2'));var timeout=require(_0xb662('0x3'));var express=require(_0xb662('0x4'));var router=express[_0xb662('0x5')]();var fs_extra=require(_0xb662('0x6'));var auth=require(_0xb662('0x7'));var interaction=require(_0xb662('0x8'));var config=require(_0xb662('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0xb662('0xa')]('/',auth[_0xb662('0xb')](),controller[_0xb662('0xc')]);router['get']('/describe',auth[_0xb662('0xb')](),controller[_0xb662('0xd')]);router[_0xb662('0xa')]('/:id',auth[_0xb662('0xb')](),controller[_0xb662('0xe')]);router[_0xb662('0xf')]('/',auth['isAuthenticated'](),controller[_0xb662('0x10')]);router[_0xb662('0x11')]('/:id',auth[_0xb662('0xb')](),controller[_0xb662('0x12')]);router[_0xb662('0x13')](_0xb662('0x14'),auth[_0xb662('0xb')](),controller[_0xb662('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0fb3=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3f7013,_0x538582){var _0x1f86e9=function(_0x5c64cd){while(--_0x5c64cd){_0x3f7013['push'](_0x3f7013['shift']());}};_0x1f86e9(++_0x538582);}(_0x0fb3,0x175));var _0x30fb=function(_0x57805e,_0x41acc9){_0x57805e=_0x57805e-0x0;var _0x1c7c04=_0x0fb3[_0x57805e];return _0x1c7c04;};'use strict';var multer=require(_0x30fb('0x0'));var util=require('util');var path=require(_0x30fb('0x1'));var timeout=require(_0x30fb('0x2'));var express=require('express');var router=express[_0x30fb('0x3')]();var fs_extra=require(_0x30fb('0x4'));var auth=require(_0x30fb('0x5'));var interaction=require(_0x30fb('0x6'));var config=require(_0x30fb('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x30fb('0x8')]('/',auth[_0x30fb('0x9')](),controller[_0x30fb('0xa')]);router[_0x30fb('0x8')]('/describe',auth[_0x30fb('0x9')](),controller['describe']);router['get'](_0x30fb('0xb'),auth['isAuthenticated'](),controller[_0x30fb('0xc')]);router[_0x30fb('0xd')]('/',auth[_0x30fb('0x9')](),controller[_0x30fb('0xe')]);router[_0x30fb('0xf')](_0x30fb('0xb'),auth[_0x30fb('0x9')](),controller['update']);router[_0x30fb('0x10')](_0x30fb('0xb'),auth[_0x30fb('0x9')](),controller[_0x30fb('0x11')]);module[_0x30fb('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 fc5ac28..fb4fbb4 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 _0x8ba6=['DATE','sequelize','STRING','account','agent','queue'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x8ba6,0x11b));var _0x68ba=function(_0x1105d4,_0x259e80){_0x1105d4=_0x1105d4-0x0;var _0x5da0c2=_0x8ba6[_0x1105d4];return _0x5da0c2;};'use strict';var Sequelize=require(_0x68ba('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x68ba('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x68ba('0x2'),_0x68ba('0x3'),_0x68ba('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x68ba('0x5')]}}; \ No newline at end of file +var _0x5eed=['queue','DATE','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x2109a8,_0x3a7797){var _0x522094=function(_0x545aa1){while(--_0x545aa1){_0x2109a8['push'](_0x2109a8['shift']());}};_0x522094(++_0x3a7797);}(_0x5eed,0x10a));var _0xd5ee=function(_0x5a9a4d,_0x2cd678){_0x5a9a4d=_0x5a9a4d-0x0;var _0x23947e=_0x5eed[_0x5a9a4d];return _0x23947e;};'use strict';var Sequelize=require(_0xd5ee('0x0'));module[_0xd5ee('0x1')]={'uniqueid':{'type':Sequelize[_0xd5ee('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd5ee('0x3')](_0xd5ee('0x4'),_0xd5ee('0x5'),_0xd5ee('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd5ee('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f2cae66..2b3ef15 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 _0x1943=['create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','apply','save','update','destroy','then','error','stack','name','send','map','WhatsappTransferReport','fieldName','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','length','options','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1943,0x124));var _0x3194=function(_0x2ee7c3,_0x1753a5){_0x2ee7c3=_0x2ee7c3-0x0;var _0x3a1259=_0x1943[_0x2ee7c3];return _0x3a1259;};'use strict';var emlformat=require(_0x3194('0x0'));var rimraf=require(_0x3194('0x1'));var zipdir=require(_0x3194('0x2'));var jsonpatch=require(_0x3194('0x3'));var rp=require('request-promise');var moment=require(_0x3194('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3194('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3194('0x6'));var csv=require(_0x3194('0x7'));var ejs=require(_0x3194('0x8'));var fs=require('fs');var fs_extra=require(_0x3194('0x9'));var _=require(_0x3194('0xa'));var squel=require(_0x3194('0xb'));var crypto=require(_0x3194('0xc'));var jsforce=require(_0x3194('0xd'));var deskjs=require(_0x3194('0xe'));var toCsv=require(_0x3194('0x7'));var querystring=require(_0x3194('0xf'));var Papa=require('papaparse');var Redis=require(_0x3194('0x10'));var authService=require(_0x3194('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3194('0x12'))(_0x3194('0x13'));var utils=require(_0x3194('0x14'));var config=require(_0x3194('0x15'));var licenseUtil=require(_0x3194('0x16'));var db=require(_0x3194('0x17'))['db'];function respondWithStatusCode(_0x44b87c,_0xa2d324){_0xa2d324=_0xa2d324||0xcc;return function(_0x3a51fa){if(_0x3a51fa){return _0x44b87c[_0x3194('0x18')](_0xa2d324);}return _0x44b87c[_0x3194('0x19')](_0xa2d324)['end']();};}function respondWithResult(_0x41b24d,_0xc2b36e){_0xc2b36e=_0xc2b36e||0xc8;return function(_0x5dc0f8){if(_0x5dc0f8){return _0x41b24d['status'](_0xc2b36e)['json'](_0x5dc0f8);}};}function respondWithFilteredResult(_0x1a5fbc,_0x9be198){return function(_0x34e3f5){if(_0x34e3f5){var _0x176933=typeof _0x9be198[_0x3194('0x1a')]==='undefined'&&typeof _0x9be198[_0x3194('0x1b')]===_0x3194('0x1c');var _0x186a37=_0x34e3f5[_0x3194('0x1d')];var _0x305b2a=_0x176933?0x0:_0x9be198[_0x3194('0x1a')];var _0x4646b0=_0x176933?_0x34e3f5[_0x3194('0x1d')]:_0x9be198[_0x3194('0x1a')]+_0x9be198['limit'];var _0x234091;if(_0x4646b0>=_0x186a37){_0x4646b0=_0x186a37;_0x234091=0xc8;}else{_0x234091=0xce;}_0x1a5fbc[_0x3194('0x19')](_0x234091);return _0x1a5fbc[_0x3194('0x1e')]('Content-Range',_0x305b2a+'-'+_0x4646b0+'/'+_0x186a37)['json'](_0x34e3f5);}return null;};}function patchUpdates(_0x51c388){return function(_0x45a0d0){try{jsonpatch[_0x3194('0x1f')](_0x45a0d0,_0x51c388,!![]);}catch(_0x1bcb1e){return BPromise['reject'](_0x1bcb1e);}return _0x45a0d0[_0x3194('0x20')]();};}function saveUpdates(_0x198a30,_0x7322ea){return function(_0x547173){if(_0x547173){return _0x547173[_0x3194('0x21')](_0x198a30)['then'](function(_0x351fd5){return _0x351fd5;});}return null;};}function removeEntity(_0x497521,_0x1607ae){return function(_0x8f2683){if(_0x8f2683){return _0x8f2683[_0x3194('0x22')]()[_0x3194('0x23')](function(){_0x497521[_0x3194('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfaa419,_0x2e912d){return function(_0xd71bc3){if(!_0xd71bc3){_0xfaa419[_0x3194('0x18')](0x194);}return _0xd71bc3;};}function handleError(_0x5348b6,_0x5440a9){_0x5440a9=_0x5440a9||0x1f4;return function(_0x3bef62){logger[_0x3194('0x24')](_0x3bef62[_0x3194('0x25')]);if(_0x3bef62[_0x3194('0x26')]){delete _0x3bef62['name'];}_0x5348b6['status'](_0x5440a9)[_0x3194('0x27')](_0x3bef62);};}exports['index']=function(_0x11ae63,_0x2233ef){var _0x3b5d9c={},_0x463bf5={},_0x4dd6f8={'count':0x0,'rows':[]};var _0x5f0172=_[_0x3194('0x28')](db[_0x3194('0x29')]['rawAttributes'],function(_0x9baf7d){return{'name':_0x9baf7d[_0x3194('0x2a')],'type':_0x9baf7d['type'][_0x3194('0x2b')]};});_0x463bf5[_0x3194('0x2c')]=_[_0x3194('0x28')](_0x5f0172,_0x3194('0x26'));_0x463bf5['query']=_[_0x3194('0x2d')](_0x11ae63['query']);_0x463bf5[_0x3194('0x2e')]=_[_0x3194('0x2f')](_0x463bf5[_0x3194('0x2c')],_0x463bf5[_0x3194('0x30')]);_0x3b5d9c['attributes']=_['intersection'](_0x463bf5['model'],qs['fields'](_0x11ae63[_0x3194('0x30')][_0x3194('0x31')]));_0x3b5d9c[_0x3194('0x32')]=_0x3b5d9c['attributes']['length']?_0x3b5d9c[_0x3194('0x32')]:_0x463bf5[_0x3194('0x2c')];if(!_0x11ae63[_0x3194('0x30')][_0x3194('0x33')]('nolimit')){_0x3b5d9c[_0x3194('0x1b')]=qs[_0x3194('0x1b')](_0x11ae63['query'][_0x3194('0x1b')]);_0x3b5d9c[_0x3194('0x1a')]=qs[_0x3194('0x1a')](_0x11ae63[_0x3194('0x30')][_0x3194('0x1a')]);}_0x3b5d9c[_0x3194('0x34')]=qs[_0x3194('0x35')](_0x11ae63[_0x3194('0x30')][_0x3194('0x35')]);_0x3b5d9c[_0x3194('0x36')]=qs['filters'](_[_0x3194('0x37')](_0x11ae63[_0x3194('0x30')],_0x463bf5[_0x3194('0x2e')]),_0x5f0172);if(_0x11ae63['query'][_0x3194('0x38')]){_0x3b5d9c[_0x3194('0x36')]=_[_0x3194('0x39')](_0x3b5d9c[_0x3194('0x36')],{'$or':_['map'](_0x5f0172,function(_0x33a965){if(_0x33a965['type']!==_0x3194('0x3a')){var _0x5fce94={};_0x5fce94[_0x33a965[_0x3194('0x26')]]={'$like':'%'+_0x11ae63[_0x3194('0x30')][_0x3194('0x38')]+'%'};return _0x5fce94;}})});}_0x3b5d9c=_[_0x3194('0x39')]({},_0x3b5d9c,_0x11ae63['options']);var _0x5bc6cc={'where':_0x3b5d9c[_0x3194('0x36')]};return db[_0x3194('0x29')]['count'](_0x5bc6cc)['then'](function(_0x1462ba){_0x4dd6f8[_0x3194('0x1d')]=_0x1462ba;if(_0x11ae63['query'][_0x3194('0x3b')]){_0x3b5d9c[_0x3194('0x3c')]=[{'all':!![]}];}return db[_0x3194('0x29')][_0x3194('0x3d')](_0x3b5d9c);})[_0x3194('0x23')](function(_0x45fe78){_0x4dd6f8['rows']=_0x45fe78;return _0x4dd6f8;})[_0x3194('0x23')](respondWithFilteredResult(_0x2233ef,_0x3b5d9c))['catch'](handleError(_0x2233ef,null));};exports[_0x3194('0x3e')]=function(_0x1dc9a8,_0x18d034){var _0x9629f={'raw':!![],'where':{'id':_0x1dc9a8[_0x3194('0x3f')]['id']}},_0x5e6f49={};_0x5e6f49[_0x3194('0x2c')]=_[_0x3194('0x2d')](db[_0x3194('0x29')][_0x3194('0x40')]);_0x5e6f49[_0x3194('0x30')]=_[_0x3194('0x2d')](_0x1dc9a8[_0x3194('0x30')]);_0x5e6f49[_0x3194('0x2e')]=_[_0x3194('0x2f')](_0x5e6f49[_0x3194('0x2c')],_0x5e6f49[_0x3194('0x30')]);_0x9629f['attributes']=_['intersection'](_0x5e6f49[_0x3194('0x2c')],qs[_0x3194('0x31')](_0x1dc9a8['query'][_0x3194('0x31')]));_0x9629f[_0x3194('0x32')]=_0x9629f['attributes'][_0x3194('0x41')]?_0x9629f[_0x3194('0x32')]:_0x5e6f49['model'];if(_0x1dc9a8[_0x3194('0x30')]['includeAll']){_0x9629f[_0x3194('0x3c')]=[{'all':!![]}];}_0x9629f=_[_0x3194('0x39')]({},_0x9629f,_0x1dc9a8[_0x3194('0x42')]);return db[_0x3194('0x29')]['find'](_0x9629f)[_0x3194('0x23')](handleEntityNotFound(_0x18d034,null))[_0x3194('0x23')](respondWithResult(_0x18d034,null))[_0x3194('0x43')](handleError(_0x18d034,null));};exports[_0x3194('0x44')]=function(_0x448b06,_0x27dfff){return db[_0x3194('0x29')][_0x3194('0x44')](_0x448b06[_0x3194('0x45')],{})[_0x3194('0x23')](respondWithResult(_0x27dfff,0xc9))[_0x3194('0x43')](handleError(_0x27dfff,null));};exports[_0x3194('0x21')]=function(_0x31a7c5,_0x45b1cb){if(_0x31a7c5[_0x3194('0x45')]['id']){delete _0x31a7c5['body']['id'];}return db['WhatsappTransferReport'][_0x3194('0x46')]({'where':{'id':_0x31a7c5[_0x3194('0x3f')]['id']}})['then'](handleEntityNotFound(_0x45b1cb,null))[_0x3194('0x23')](saveUpdates(_0x31a7c5[_0x3194('0x45')],null))[_0x3194('0x23')](respondWithResult(_0x45b1cb,null))['catch'](handleError(_0x45b1cb,null));};exports['destroy']=function(_0x9b06f2,_0x53816e){return db[_0x3194('0x29')][_0x3194('0x46')]({'where':{'id':_0x9b06f2[_0x3194('0x3f')]['id']}})[_0x3194('0x23')](handleEntityNotFound(_0x53816e,null))['then'](removeEntity(_0x53816e,null))[_0x3194('0x43')](handleError(_0x53816e,null));};exports[_0x3194('0x47')]=function(_0x41e0a7,_0x3b83b9){return db[_0x3194('0x29')][_0x3194('0x47')]()[_0x3194('0x23')](respondWithResult(_0x3b83b9,null))[_0x3194('0x43')](handleError(_0x3b83b9,null));}; \ No newline at end of file +var _0xeec0=['params','intersection','find','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x536d9b,_0x133726){var _0x28f6a6=function(_0x3449d1){while(--_0x3449d1){_0x536d9b['push'](_0x536d9b['shift']());}};_0x28f6a6(++_0x133726);}(_0xeec0,0x98));var _0x0eec=function(_0x5621d9,_0x19650b){_0x5621d9=_0x5621d9-0x0;var _0x1c8cfb=_0xeec0[_0x5621d9];return _0x1c8cfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0eec('0x0'));var zipdir=require(_0x0eec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0eec('0x2'));var BPromise=require(_0x0eec('0x3'));var Mustache=require(_0x0eec('0x4'));var util=require(_0x0eec('0x5'));var path=require(_0x0eec('0x6'));var sox=require('sox');var csv=require(_0x0eec('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0eec('0x8'));var _=require(_0x0eec('0x9'));var squel=require(_0x0eec('0xa'));var crypto=require(_0x0eec('0xb'));var jsforce=require(_0x0eec('0xc'));var deskjs=require(_0x0eec('0xd'));var toCsv=require(_0x0eec('0x7'));var querystring=require(_0x0eec('0xe'));var Papa=require(_0x0eec('0xf'));var Redis=require(_0x0eec('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0eec('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0eec('0x12'))(_0x0eec('0x13'));var utils=require(_0x0eec('0x14'));var config=require(_0x0eec('0x15'));var licenseUtil=require(_0x0eec('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207513,_0x6b29a6){_0x6b29a6=_0x6b29a6||0xcc;return function(_0x464661){if(_0x464661){return _0x207513[_0x0eec('0x17')](_0x6b29a6);}return _0x207513['status'](_0x6b29a6)['end']();};}function respondWithResult(_0x5f0d3f,_0x376e02){_0x376e02=_0x376e02||0xc8;return function(_0xb45dbe){if(_0xb45dbe){return _0x5f0d3f[_0x0eec('0x18')](_0x376e02)[_0x0eec('0x19')](_0xb45dbe);}};}function respondWithFilteredResult(_0x1e14bc,_0x5d5b82){return function(_0x33896d){if(_0x33896d){var _0x2f0c16=typeof _0x5d5b82[_0x0eec('0x1a')]===_0x0eec('0x1b')&&typeof _0x5d5b82[_0x0eec('0x1c')]===_0x0eec('0x1b');var _0xed3eca=_0x33896d[_0x0eec('0x1d')];var _0x1712fc=_0x2f0c16?0x0:_0x5d5b82[_0x0eec('0x1a')];var _0x54a481=_0x2f0c16?_0x33896d[_0x0eec('0x1d')]:_0x5d5b82[_0x0eec('0x1a')]+_0x5d5b82[_0x0eec('0x1c')];var _0x56722b;if(_0x54a481>=_0xed3eca){_0x54a481=_0xed3eca;_0x56722b=0xc8;}else{_0x56722b=0xce;}_0x1e14bc[_0x0eec('0x18')](_0x56722b);return _0x1e14bc['set'](_0x0eec('0x1e'),_0x1712fc+'-'+_0x54a481+'/'+_0xed3eca)[_0x0eec('0x19')](_0x33896d);}return null;};}function patchUpdates(_0x130f05){return function(_0xc49c57){try{jsonpatch[_0x0eec('0x1f')](_0xc49c57,_0x130f05,!![]);}catch(_0x38f3f4){return BPromise[_0x0eec('0x20')](_0x38f3f4);}return _0xc49c57[_0x0eec('0x21')]();};}function saveUpdates(_0x155c70,_0x3ae7ed){return function(_0x255b8e){if(_0x255b8e){return _0x255b8e[_0x0eec('0x22')](_0x155c70)[_0x0eec('0x23')](function(_0x22bada){return _0x22bada;});}return null;};}function removeEntity(_0x16d1c0,_0x175e3d){return function(_0x2aa446){if(_0x2aa446){return _0x2aa446[_0x0eec('0x24')]()['then'](function(){_0x16d1c0[_0x0eec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x448707,_0x56c82d){return function(_0x133c65){if(!_0x133c65){_0x448707[_0x0eec('0x17')](0x194);}return _0x133c65;};}function handleError(_0x56388d,_0x383d6a){_0x383d6a=_0x383d6a||0x1f4;return function(_0x129f74){logger['error'](_0x129f74['stack']);if(_0x129f74[_0x0eec('0x25')]){delete _0x129f74[_0x0eec('0x25')];}_0x56388d['status'](_0x383d6a)[_0x0eec('0x26')](_0x129f74);};}exports[_0x0eec('0x27')]=function(_0x33f647,_0x31d293){var _0x254da9={},_0x196502={},_0xe47e96={'count':0x0,'rows':[]};var _0x55fc81=_[_0x0eec('0x28')](db[_0x0eec('0x29')][_0x0eec('0x2a')],function(_0x337107){return{'name':_0x337107['fieldName'],'type':_0x337107[_0x0eec('0x2b')][_0x0eec('0x2c')]};});_0x196502['model']=_['map'](_0x55fc81,'name');_0x196502[_0x0eec('0x2d')]=_[_0x0eec('0x2e')](_0x33f647[_0x0eec('0x2d')]);_0x196502[_0x0eec('0x2f')]=_['intersection'](_0x196502['model'],_0x196502[_0x0eec('0x2d')]);_0x254da9[_0x0eec('0x30')]=_['intersection'](_0x196502['model'],qs[_0x0eec('0x31')](_0x33f647[_0x0eec('0x2d')][_0x0eec('0x31')]));_0x254da9[_0x0eec('0x30')]=_0x254da9[_0x0eec('0x30')][_0x0eec('0x32')]?_0x254da9['attributes']:_0x196502[_0x0eec('0x33')];if(!_0x33f647[_0x0eec('0x2d')][_0x0eec('0x34')](_0x0eec('0x35'))){_0x254da9[_0x0eec('0x1c')]=qs[_0x0eec('0x1c')](_0x33f647[_0x0eec('0x2d')]['limit']);_0x254da9[_0x0eec('0x1a')]=qs[_0x0eec('0x1a')](_0x33f647['query'][_0x0eec('0x1a')]);}_0x254da9[_0x0eec('0x36')]=qs[_0x0eec('0x37')](_0x33f647[_0x0eec('0x2d')]['sort']);_0x254da9['where']=qs[_0x0eec('0x2f')](_[_0x0eec('0x38')](_0x33f647['query'],_0x196502[_0x0eec('0x2f')]),_0x55fc81);if(_0x33f647[_0x0eec('0x2d')][_0x0eec('0x39')]){_0x254da9[_0x0eec('0x3a')]=_[_0x0eec('0x3b')](_0x254da9[_0x0eec('0x3a')],{'$or':_[_0x0eec('0x28')](_0x55fc81,function(_0x44ce84){if(_0x44ce84[_0x0eec('0x2b')]!==_0x0eec('0x3c')){var _0x45669={};_0x45669[_0x44ce84[_0x0eec('0x25')]]={'$like':'%'+_0x33f647[_0x0eec('0x2d')]['filter']+'%'};return _0x45669;}})});}_0x254da9=_['merge']({},_0x254da9,_0x33f647[_0x0eec('0x3d')]);var _0x139672={'where':_0x254da9[_0x0eec('0x3a')]};return db[_0x0eec('0x29')]['count'](_0x139672)[_0x0eec('0x23')](function(_0x19128e){_0xe47e96['count']=_0x19128e;if(_0x33f647['query'][_0x0eec('0x3e')]){_0x254da9[_0x0eec('0x3f')]=[{'all':!![]}];}return db[_0x0eec('0x29')][_0x0eec('0x40')](_0x254da9);})['then'](function(_0x26f9eb){_0xe47e96[_0x0eec('0x41')]=_0x26f9eb;return _0xe47e96;})[_0x0eec('0x23')](respondWithFilteredResult(_0x31d293,_0x254da9))[_0x0eec('0x42')](handleError(_0x31d293,null));};exports['show']=function(_0x531737,_0x2dd9be){var _0x51acb1={'raw':!![],'where':{'id':_0x531737[_0x0eec('0x43')]['id']}},_0x1682a9={};_0x1682a9[_0x0eec('0x33')]=_['keys'](db[_0x0eec('0x29')][_0x0eec('0x2a')]);_0x1682a9[_0x0eec('0x2d')]=_[_0x0eec('0x2e')](_0x531737[_0x0eec('0x2d')]);_0x1682a9[_0x0eec('0x2f')]=_[_0x0eec('0x44')](_0x1682a9[_0x0eec('0x33')],_0x1682a9[_0x0eec('0x2d')]);_0x51acb1['attributes']=_[_0x0eec('0x44')](_0x1682a9[_0x0eec('0x33')],qs[_0x0eec('0x31')](_0x531737[_0x0eec('0x2d')][_0x0eec('0x31')]));_0x51acb1[_0x0eec('0x30')]=_0x51acb1['attributes'][_0x0eec('0x32')]?_0x51acb1['attributes']:_0x1682a9[_0x0eec('0x33')];if(_0x531737[_0x0eec('0x2d')][_0x0eec('0x3e')]){_0x51acb1[_0x0eec('0x3f')]=[{'all':!![]}];}_0x51acb1=_[_0x0eec('0x3b')]({},_0x51acb1,_0x531737['options']);return db['WhatsappTransferReport'][_0x0eec('0x45')](_0x51acb1)['then'](handleEntityNotFound(_0x2dd9be,null))['then'](respondWithResult(_0x2dd9be,null))[_0x0eec('0x42')](handleError(_0x2dd9be,null));};exports[_0x0eec('0x46')]=function(_0x29ebf5,_0x4d1671){return db[_0x0eec('0x29')][_0x0eec('0x46')](_0x29ebf5['body'],{})[_0x0eec('0x23')](respondWithResult(_0x4d1671,0xc9))[_0x0eec('0x42')](handleError(_0x4d1671,null));};exports[_0x0eec('0x22')]=function(_0x45cdc5,_0x26c112){if(_0x45cdc5[_0x0eec('0x47')]['id']){delete _0x45cdc5[_0x0eec('0x47')]['id'];}return db[_0x0eec('0x29')][_0x0eec('0x45')]({'where':{'id':_0x45cdc5['params']['id']}})['then'](handleEntityNotFound(_0x26c112,null))[_0x0eec('0x23')](saveUpdates(_0x45cdc5[_0x0eec('0x47')],null))[_0x0eec('0x23')](respondWithResult(_0x26c112,null))[_0x0eec('0x42')](handleError(_0x26c112,null));};exports['destroy']=function(_0x4e0e49,_0x3620c0){return db[_0x0eec('0x29')][_0x0eec('0x45')]({'where':{'id':_0x4e0e49[_0x0eec('0x43')]['id']}})[_0x0eec('0x23')](handleEntityNotFound(_0x3620c0,null))[_0x0eec('0x23')](removeEntity(_0x3620c0,null))[_0x0eec('0x42')](handleError(_0x3620c0,null));};exports[_0x0eec('0x48')]=function(_0x125c8e,_0x277edb){return db[_0x0eec('0x29')][_0x0eec('0x48')]()['then'](respondWithResult(_0x277edb,null))['catch'](handleError(_0x277edb,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 03fda71..2a595fb 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 _0x3ddf=['rimraf','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x3ddf,0x174));var _0xf3dd=function(_0x268c6e,_0x3510ae){_0x268c6e=_0x268c6e-0x0;var _0x5b6d25=_0x3ddf[_0x268c6e];return _0x5b6d25;};'use strict';var _=require(_0xf3dd('0x0'));var util=require(_0xf3dd('0x1'));var logger=require(_0xf3dd('0x2'))('api');var moment=require(_0xf3dd('0x3'));var BPromise=require(_0xf3dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3dd('0x5'));var rimraf=require(_0xf3dd('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x44f374,_0x5bf3e3){return _0x44f374['define'](_0xf3dd('0x7'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf3dd('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6fe4=['exports','define','WhatsappTransferReport','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x362cdb,_0x51f87c){var _0x363637=function(_0xe6afcc){while(--_0xe6afcc){_0x362cdb['push'](_0x362cdb['shift']());}};_0x363637(++_0x51f87c);}(_0x6fe4,0x90));var _0x46fe=function(_0x370fac,_0xde950){_0x370fac=_0x370fac-0x0;var _0x4792b3=_0x6fe4[_0x370fac];return _0x4792b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x46fe('0x0'))('api');var moment=require(_0x46fe('0x1'));var BPromise=require(_0x46fe('0x2'));var rp=require(_0x46fe('0x3'));var fs=require('fs');var path=require(_0x46fe('0x4'));var rimraf=require(_0x46fe('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x46fe('0x6')]=function(_0x519c27,_0x23e693){return _0x519c27[_0x46fe('0x7')](_0x46fe('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x46fe('0x9'),'fields':[_0x46fe('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b217e31..23c8fe3 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 _0x69e3=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring'];(function(_0x49b48b,_0x313a85){var _0x398600=function(_0x15d493){while(--_0x15d493){_0x49b48b['push'](_0x49b48b['shift']());}};_0x398600(++_0x313a85);}(_0x69e3,0x1d0));var _0x369e=function(_0x444a37,_0x593852){_0x444a37=_0x444a37-0x0;var _0x4573c8=_0x69e3[_0x444a37];return _0x4573c8;};'use strict';var _=require(_0x369e('0x0'));var util=require(_0x369e('0x1'));var moment=require(_0x369e('0x2'));var BPromise=require('bluebird');var rs=require(_0x369e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x369e('0x4'))['db'];var utils=require(_0x369e('0x5'));var logger=require('../../config/logger')(_0x369e('0x6'));var config=require(_0x369e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x369e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489332,_0x32a93a,_0x4cea41){return new BPromise(function(_0x4dea4f,_0x55d742){return client['request'](_0x489332,_0x4cea41)['then'](function(_0x4a7b60){logger['info'](_0x369e('0x9'),_0x32a93a,_0x369e('0xa'));logger[_0x369e('0xb')](_0x369e('0xc'),_0x32a93a,'request\x20sent',JSON['stringify'](_0x4a7b60));if(_0x4a7b60[_0x369e('0xd')]){if(_0x4a7b60[_0x369e('0xd')][_0x369e('0xe')]===0x1f4){logger[_0x369e('0xd')](_0x369e('0x9'),_0x32a93a,_0x4a7b60['error'][_0x369e('0xf')]);return _0x55d742(_0x4a7b60[_0x369e('0xd')][_0x369e('0xf')]);}logger[_0x369e('0xd')](_0x369e('0x9'),_0x32a93a,_0x4a7b60['error'][_0x369e('0xf')]);return _0x4dea4f(_0x4a7b60['error'][_0x369e('0xf')]);}else{logger[_0x369e('0x10')](_0x369e('0x9'),_0x32a93a,_0x369e('0xa'));_0x4dea4f(_0x4a7b60['result'][_0x369e('0xf')]);}})[_0x369e('0x11')](function(_0x1433d7){logger[_0x369e('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x32a93a,_0x1433d7);_0x55d742(_0x1433d7);});});} \ No newline at end of file +var _0x14f6=['rpc','../../config/environment','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x14f6,0xa4));var _0x614f=function(_0x125186,_0x241937){_0x125186=_0x125186-0x0;var _0x3a79e3=_0x14f6[_0x125186];return _0x3a79e3;};'use strict';var _=require(_0x614f('0x0'));var util=require(_0x614f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x614f('0x2'));var fs=require('fs');var Redis=require(_0x614f('0x3'));var db=require(_0x614f('0x4'))['db'];var utils=require(_0x614f('0x5'));var logger=require(_0x614f('0x6'))(_0x614f('0x7'));var config=require(_0x614f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x614f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eefe7,_0x26ade8,_0x31adb0){return new BPromise(function(_0x4a4aa9,_0x3c2f1a){return client[_0x614f('0xa')](_0x2eefe7,_0x31adb0)['then'](function(_0x8197c1){logger[_0x614f('0xb')](_0x614f('0xc'),_0x26ade8,_0x614f('0xd'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x26ade8,'request\x20sent',JSON[_0x614f('0xe')](_0x8197c1));if(_0x8197c1['error']){if(_0x8197c1[_0x614f('0xf')][_0x614f('0x10')]===0x1f4){logger[_0x614f('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x26ade8,_0x8197c1[_0x614f('0xf')]['message']);return _0x3c2f1a(_0x8197c1['error'][_0x614f('0x11')]);}logger[_0x614f('0xf')](_0x614f('0xc'),_0x26ade8,_0x8197c1[_0x614f('0xf')][_0x614f('0x11')]);return _0x4a4aa9(_0x8197c1['error']['message']);}else{logger['info'](_0x614f('0xc'),_0x26ade8,_0x614f('0xd'));_0x4a4aa9(_0x8197c1[_0x614f('0x12')][_0x614f('0x11')]);}})['catch'](function(_0x75b6e5){logger[_0x614f('0xf')](_0x614f('0xc'),_0x26ade8,_0x75b6e5);_0x3c2f1a(_0x75b6e5);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 612cbb7..90c4a84 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0048=['exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter'];(function(_0x40b645,_0x12ab5b){var _0x23cf9e=function(_0x4bcbe5){while(--_0x4bcbe5){_0x40b645['push'](_0x40b645['shift']());}};_0x23cf9e(++_0x12ab5b);}(_0x0048,0x129));var _0x8004=function(_0xbccf,_0x5f3f74){_0xbccf=_0xbccf-0x0;var _0x24c504=_0x0048[_0xbccf];return _0x24c504;};'use strict';var _=require('lodash');var db=require(_0x8004('0x0'))['db'];var seedDb=require(_0x8004('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x8004('0x2'));var config=require(_0x8004('0x3'));var logger=require('./config/logger')(_0x8004('0x4'));var pm2=require(_0x8004('0x5'));var pm2Config=require(_0x8004('0x6'));var schedule=require(_0x8004('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x8004('0x8'));var provider=require(_0x8004('0x9'));function main(){return db[_0x8004('0xa')]['sync']()[_0x8004('0xb')](function(){if(config[_0x8004('0xc')]){return seedDb[_0x8004('0xd')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x8004('0xe')]();})['then'](function(_0x59ea76){logger[_0x8004('0xf')](_0x59ea76);return chat[_0x8004('0x10')]();})['then'](function(){return whatsapp['start']();})[_0x8004('0xb')](function(){return schedule[_0x8004('0x10')]();})[_0x8004('0xb')](function(){return transcribe[_0x8004('0x10')]();})[_0x8004('0xb')](function(){return provider[_0x8004('0x10')]();})[_0x8004('0xb')](function(_0x5d9972){logger[_0x8004('0xf')](_0x5d9972);return pm2[_0x8004('0x10')](pm2Config);})[_0x8004('0xb')](function(_0xeaeac3){var _0x235819=_0xeaeac3[_0x8004('0x11')](function(_0x2b63fc){return typeof _0x2b63fc[_0x8004('0x12')]===_0x8004('0x13')&&_0x2b63fc[_0x8004('0x12')]>=0x0;});if(_0x235819[_0x8004('0x14')]>0x0){throw new Error(_0x235819[_0x8004('0x14')]+_0x8004('0x15')+_[_0x8004('0x16')](_0x235819,function(_0x205ff9){return'\x22'+_0x205ff9[_0x8004('0x17')][_0x8004('0x18')]+'\x22';}));}logger[_0x8004('0xf')](_0x8004('0x19'),_['map'](_[_0x8004('0x11')](_0xeaeac3,{'status':_0x8004('0x1a')}),'name')[_0x8004('0x1b')]());logger[_0x8004('0xf')](_0x8004('0x1c'),_[_0x8004('0x16')](_[_0x8004('0x11')](_0xeaeac3,function(_0x1c5c21){return _0x1c5c21[_0x8004('0x1d')]!==_0x8004('0x1a');}),_0x8004('0x18'))[_0x8004('0x1b')]()||'None');console['log']('App\x20Ready!');})[_0x8004('0x1e')](function(_0x24e5a7){console['log'](_0x8004('0x1f'),_0x24e5a7);logger[_0x8004('0x20')](_0x8004('0x21'),_0x24e5a7);process[_0x8004('0x22')](0x1);});}main(); \ No newline at end of file +var _0xa647=['status','join','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','name','Online\x20apps:','online','Offline\x20apps:','map'];(function(_0x375072,_0x1ad2ed){var _0x3e82e7=function(_0x2a03ec){while(--_0x2a03ec){_0x375072['push'](_0x375072['shift']());}};_0x3e82e7(++_0x1ad2ed);}(_0xa647,0x81));var _0x7a64=function(_0x49fe23,_0x2d0612){_0x49fe23=_0x49fe23-0x0;var _0x14ea5f=_0xa647[_0x49fe23];return _0x14ea5f;};'use strict';var _=require(_0x7a64('0x0'));var db=require(_0x7a64('0x1'))['db'];var seedDb=require(_0x7a64('0x2'));var checkLicense=require(_0x7a64('0x3'));var rpc=require(_0x7a64('0x4'));var config=require(_0x7a64('0x5'));var logger=require(_0x7a64('0x6'))(_0x7a64('0x7'));var pm2=require(_0x7a64('0x8'));var pm2Config=require(_0x7a64('0x9'));var schedule=require(_0x7a64('0xa'));var chat=require(_0x7a64('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x7a64('0xc'));var provider=require(_0x7a64('0xd'));function main(){return db['sequelize'][_0x7a64('0xe')]()[_0x7a64('0xf')](function(){if(config[_0x7a64('0x10')]){return seedDb[_0x7a64('0x11')]();}})[_0x7a64('0xf')](function(){return checkLicense[_0x7a64('0x11')]();})[_0x7a64('0xf')](function(){return rpc[_0x7a64('0x12')]();})[_0x7a64('0xf')](function(_0x2896c4){logger[_0x7a64('0x13')](_0x2896c4);return chat[_0x7a64('0x14')]();})[_0x7a64('0xf')](function(){return whatsapp['start']();})[_0x7a64('0xf')](function(){return schedule[_0x7a64('0x14')]();})['then'](function(){return transcribe[_0x7a64('0x14')]();})[_0x7a64('0xf')](function(){return provider[_0x7a64('0x14')]();})['then'](function(_0x20fb93){logger[_0x7a64('0x13')](_0x20fb93);return pm2[_0x7a64('0x14')](pm2Config);})[_0x7a64('0xf')](function(_0x24f0e3){var _0x105010=_0x24f0e3[_0x7a64('0x15')](function(_0x4829f8){return typeof _0x4829f8[_0x7a64('0x16')]===_0x7a64('0x17')&&_0x4829f8['exitCode']>=0x0;});if(_0x105010[_0x7a64('0x18')]>0x0){throw new Error(_0x105010[_0x7a64('0x18')]+_0x7a64('0x19')+_['map'](_0x105010,function(_0x126eef){return'\x22'+_0x126eef['pm2_env'][_0x7a64('0x1a')]+'\x22';}));}logger['info'](_0x7a64('0x1b'),_['map'](_[_0x7a64('0x15')](_0x24f0e3,{'status':_0x7a64('0x1c')}),'name')['join']());logger['info'](_0x7a64('0x1d'),_[_0x7a64('0x1e')](_['filter'](_0x24f0e3,function(_0x57fa06){return _0x57fa06[_0x7a64('0x1f')]!=='online';}),_0x7a64('0x1a'))[_0x7a64('0x20')]()||_0x7a64('0x21'));console[_0x7a64('0x22')]('App\x20Ready!');})[_0x7a64('0x23')](function(_0x895b5b){console['log'](_0x7a64('0x24'),_0x895b5b);logger[_0x7a64('0x25')](_0x7a64('0x26'),_0x895b5b);process[_0x7a64('0x27')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 37a3d88..51d9995 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 _0x8603=['moment','secrets','session','role','email','userpic','md5secret','voicePause','mailPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','closed','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','then','authenticate','pass','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','length','splice','promisify','payload','options','verify','randomBytes','toString','hex','floor','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','jsonwebtoken','express-jwt','composable-middleware','crypto','util'];(function(_0x353df7,_0x2bea6a){var _0x4cce74=function(_0x156ed3){while(--_0x156ed3){_0x353df7['push'](_0x353df7['shift']());}};_0x4cce74(++_0x2bea6a);}(_0x8603,0x190));var _0x3860=function(_0x1bbdc0,_0x1d9d11){_0x1bbdc0=_0x1bbdc0-0x0;var _0x5da71c=_0x8603[_0x1bbdc0];return _0x5da71c;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x3860('0x0'));var hardwareConf=require(_0x3860('0x1'));var licenseUtil=require(_0x3860('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x3860('0x3'));var expressJwt=require(_0x3860('0x4'));var compose=require(_0x3860('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x3860('0x6'));var BPromise=require('bluebird');var util=require(_0x3860('0x7'));var moment=require(_0x3860('0x8'));var validateJwt=expressJwt({'secret':config[_0x3860('0x9')][_0x3860('0xa')]});var userAttributes=['id',_0x3860('0xb'),'fullname','name','internal',_0x3860('0xc'),_0x3860('0xd'),'permissions',_0x3860('0xe'),_0x3860('0xf'),'chatPause',_0x3860('0x10'),_0x3860('0x11'),'smsPause',_0x3860('0x12'),_0x3860('0x13'),'showWebBar',_0x3860('0x14'),_0x3860('0x15'),_0x3860('0x16'),_0x3860('0x17'),_0x3860('0x18'),_0x3860('0x19'),_0x3860('0x1a'),_0x3860('0x1b'),_0x3860('0x1c'),_0x3860('0x1d'),'phoneBarEnableDtmfTone',_0x3860('0x1e'),_0x3860('0x1f'),_0x3860('0x20'),_0x3860('0x21'),_0x3860('0x22'),_0x3860('0x23'),_0x3860('0x24'),_0x3860('0x25'),_0x3860('0x26'),_0x3860('0x27'),_0x3860('0x28'),_0x3860('0x29'),'downloadOmnichannelInteractions','downloadAttachments',_0x3860('0x2a'),_0x3860('0x2b'),_0x3860('0x2c'),'chatAutoanswerDelay',_0x3860('0x2d'),_0x3860('0x2e'),_0x3860('0x2f'),_0x3860('0x30'),_0x3860('0x31'),_0x3860('0x32'),_0x3860('0x33'),_0x3860('0x34'),_0x3860('0x35'),_0x3860('0x36'),_0x3860('0x37')];exports[_0x3860('0x38')]=function(){return this[_0x3860('0x39')](!![])[_0x3860('0x3a')](function(_0xd33a51,_0x564efd,_0xfc10a5){if(_0xd33a51[_0x3860('0x3b')]){_0xfc10a5();}else{return db[_0x3860('0x3c')][_0x3860('0x3d')]({'where':{'id':_0xd33a51[_0x3860('0x3e')]['id']},'attributes':['id','closed',_0x3860('0x3f')],'raw':!![]})['then'](function(_0x577750){if(_0x577750&&_0x577750[_0x3860('0x40')]){return _0x564efd[_0x3860('0x41')](_0x577750['disposition']==='unmanaged'?0x195:0x193)['json']({'message':_0x577750[_0x3860('0x3f')]===_0x3860('0x42')?_0x3860('0x43'):_0x3860('0x44')});}else{_0xfc10a5();}})[_0x3860('0x45')](function(_0x228d34){_0xfc10a5(_0x228d34);});}});};exports['isAuthenticated']=function isAuthenticated(_0x4c4314){return compose()[_0x3860('0x3a')](function(_0x1f1809,_0x5a9af2,_0x2551f4){var _0x3d5143;if(_0x1f1809[_0x3860('0x46')][_0x3860('0x47')]){if(_[_0x3860('0x48')](_0x1f1809['headers'][_0x3860('0x47')],_0x3860('0x49'))){var _0x367b14=basicAuth(_0x1f1809);db['User'][_0x3860('0x4a')]({'where':{'name':_0x367b14['name']}})[_0x3860('0x4b')](function(_0x4825f0){if(!_0x4825f0||!_0x4825f0[_0x3860('0x4c')](_0x367b14[_0x3860('0x4d')])){return _0x5a9af2[_0x3860('0x41')](0x191)['json']({'message':_0x3860('0x4e')});}_0x1f1809[_0x3860('0x3b')]={'id':_0x4825f0['id']};_0x2551f4();})['catch'](function(_0x1c94cc){_0x2551f4(_0x1c94cc);});}else if(_['startsWith'](_0x1f1809[_0x3860('0x46')][_0x3860('0x47')],_0x3860('0x4f'))){validateJwt(_0x1f1809,_0x5a9af2,_0x2551f4);}else{if(_0x4c4314){_0x2551f4();}else{return _0x5a9af2[_0x3860('0x41')](0x193)[_0x3860('0x50')]({'message':_0x3860('0x51')});}}}else if(_0x1f1809[_0x3860('0x52')]['apikey']){try{var _0x1a48b6={'audience':hardwareConf[_0x3860('0x53')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1f1809[_0x3860('0x52')][_0x3860('0x54')],_0x1a48b6)[_0x3860('0x4b')](function(_0x5af661){return db['User'][_0x3860('0x4a')]({'where':{'id':_0x5af661[_0x3860('0x55')]}})[_0x3860('0x4b')](function(_0xa921ed){_0x3d5143=_0xa921ed;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x3860('0x56'),_0x3860('0x57')],'raw':!![]});})[_0x3860('0x4b')](function(_0x1fa847){if(!_0x3d5143||!_[_0x3860('0x58')](_0x3d5143['apiKeyNonce'],_0x5af661[_0x3860('0x59')])){return _0x5a9af2[_0x3860('0x41')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3d5143[_0x3860('0x5a')]){return _0x5a9af2[_0x3860('0x41')](0x191)[_0x3860('0x50')]({'message':_0x3860('0x5b')});}if(_0x3d5143[_0x3860('0x5c')]){if(_0x1fa847['blockDuration']>0x0){if(moment(_0x3d5143[_0x3860('0x5d')])['add'](_0x1fa847[_0x3860('0x57')],_0x3860('0x5e'))>moment()){return _0x5a9af2['status'](0x191)[_0x3860('0x50')]({'message':_0x3860('0x5b')});}}else{return _0x5a9af2['status'](0x191)[_0x3860('0x50')]({'message':_0x3860('0x5b')});}}_0x1f1809[_0x3860('0x3b')]={'id':_0x3d5143['id']};_0x2551f4();});})[_0x3860('0x45')](function(){return _0x5a9af2['status'](0x191)[_0x3860('0x50')]({'message':_0x3860('0x5b')});});}catch(_0xd3896f){_0x2551f4(_0xd3896f);}}else if(_0x4c4314){_0x2551f4();}else{return _0x5a9af2['status'](0x193)[_0x3860('0x50')]({'message':'Unknown\x20authorization\x20format'});}})[_0x3860('0x3a')](function(_0x424801,_0x405bfc,_0x3f613f){if(_0x424801[_0x3860('0x3b')]){db[_0x3860('0x5f')]['find']({'where':{'id':_0x424801[_0x3860('0x3b')]['id']},'attributes':userAttributes})[_0x3860('0x4b')](function(_0x5dc78f){if(!_0x5dc78f){return _0x405bfc['status'](0x194)[_0x3860('0x50')]({'message':_0x3860('0x60')});}_0x424801['user']=_0x5dc78f;_0x3f613f();})[_0x3860('0x45')](function(_0x30d8eb){_0x3f613f(_0x30d8eb);});}else if(_0x4c4314){_0x3f613f();}else{return _0x405bfc['status'](0x194)[_0x3860('0x50')]({'message':_0x3860('0x61')});}});};exports[_0x3860('0x62')]=function canUpdate(){return compose()[_0x3860('0x3a')](function(_0x14f5b2,_0x3fa282,_0x3c06e7){return licenseUtil[_0x3860('0x63')]()[_0x3860('0x4b')](function(_0x6feca3){if(_0x6feca3[_0x3860('0x64')]){_0x3c06e7();}else{return _0x3fa282[_0x3860('0x41')](0x193)[_0x3860('0x50')]({'message':'Forbidden'});}})[_0x3860('0x45')](function(_0x516f88){_0x3c06e7(_0x516f88);});});};exports[_0x3860('0x65')]=function isWebrtcLicence(){return compose()[_0x3860('0x3a')](function(_0x202c92,_0xbad34b,_0x39e2cb){return licenseUtil[_0x3860('0x63')]()[_0x3860('0x4b')](function(_0x27ef92){if(_0x27ef92['webrtc']){_0x39e2cb();}else{return _0xbad34b[_0x3860('0x41')](0x193)[_0x3860('0x50')]({'message':_0x3860('0x66')});}})['catch'](function(_0x9b8ab0){_0x39e2cb(_0x9b8ab0);});});};exports[_0x3860('0x67')]=function(_0x188883,_0x3dc957,_0x5ed2db){_0x188883['isMiddleware']=!![];return _0x5ed2db();};exports[_0x3860('0x68')]=function signToken(_0x480a08){return signJwt(_0x480a08);};exports[_0x3860('0x69')]=function(_0x4226da,_0x410dab){if(!_0x4226da['user']){return _0x410dab[_0x3860('0x41')](0x194)['json']({'message':_0x3860('0x6a')});}var _0x517fe6={'payload':{'id':_0x4226da[_0x3860('0x3b')]['id'],'role':_0x4226da[_0x3860('0x3b')][_0x3860('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x517fe6)['then'](function(_0x4876ab){_0x410dab[_0x3860('0x6b')](_0x3860('0x6c'),_0x4876ab);_0x410dab['redirect'](_0x3860('0x6d'));})['catch'](function(_0x3b3bfe){return _0x410dab[_0x3860('0x41')](0x1f4)[_0x3860('0x6e')](_0x3b3bfe);});};exports[_0x3860('0x6f')]=function(_0x426497){if(_[_0x3860('0x70')](_0x426497[_0x3860('0x71')])||_['isNil'](_0x426497[_0x3860('0x72')])){return null;}else{return createJwt(_0x426497);}};exports[_0x3860('0x73')]=function(_0x3367ce){_0x3367ce[_0x3860('0x71')]=generateNonce();_0x3367ce[_0x3860('0x72')]=generateIssuedAt();return createJwt(_0x3367ce);};exports[_0x3860('0x74')]=function(_0x47ff99,_0x2cf48c){var _0x3ed276=_0x47ff99[_0x3860('0x52')][_0x3860('0x54')];if(_0x3ed276){var _0x3a55e7={'nonce':_0x2cf48c[_0x3860('0x71')],'iat':_0x2cf48c[_0x3860('0x72')],'audience':hardwareConf[_0x3860('0x53')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3ed276,_0x3a55e7)[_0x3860('0x4b')](function(){return generateApiKey(_0x2cf48c);});}else{throw{'message':_0x3860('0x75')};}};exports['validatePasswordPattern']=function(_0x1fe680){var _0x275df2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x275df2[_0x3860('0x76')](_0x1fe680))throw new db['Sequelize'][(_0x3860('0x77'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x3860('0x78')]=function(_0x214a19,_0x13b978,_0x2cc119){var _0x27a853=encryptor[_0x3860('0x79')](_0x13b978)[_0x3860('0x7a')](',');for(var _0x2c7218=0x0;_0x2c7218<_0x2cc119;_0x2c7218++){if(!_0x27a853[_0x2c7218])break;if(_0x214a19[_0x3860('0x7b')]()===_0x27a853[_0x2c7218][_0x3860('0x7b')]()){var _0x3ba9a1=util[_0x3860('0x7c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x2cc119);if(_0x2cc119===0x1){_0x3ba9a1='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x3860('0x77'))](_0x3ba9a1);}}return;};exports['updatePasswordsHistory']=function(_0x5a2c1c,_0xc2bd40){var _0x412e0f=_0xc2bd40?encryptor[_0x3860('0x79')](_0xc2bd40)[_0x3860('0x7a')](','):[];if(_0x412e0f[_0x3860('0x7d')]===0x5){_0x412e0f[_0x3860('0x7e')](-0x1,0x1);}_0x412e0f['unshift'](_0x5a2c1c);return encryptor['encryptString'](_0x412e0f['join'](','));};function signJwt(_0x1d6c70){var _0x1c1da4=BPromise[_0x3860('0x7f')](jwt['sign'],{'context':jwt});var _0xf875e4=_0x1d6c70['secret']||config[_0x3860('0x9')][_0x3860('0xa')];return new BPromise(function(_0x5176ff,_0x3345e1){_0x1c1da4(_0x1d6c70[_0x3860('0x80')],_0xf875e4,_0x1d6c70[_0x3860('0x81')])[_0x3860('0x4b')](function(_0x4c5c97){_0x5176ff(_0x4c5c97);})[_0x3860('0x45')](function(_0x38a52f){_0x3345e1(_0x38a52f);});});}function verifyJwt(_0x17f248,_0x508208,_0x552fdc){var _0x26e54b=BPromise[_0x3860('0x7f')](jwt[_0x3860('0x82')],{'context':jwt});var _0x1ca0e7=_0x552fdc||config[_0x3860('0x9')][_0x3860('0xa')];return new BPromise(function(_0x5d0210,_0x2d916a){_0x26e54b(_0x17f248,_0x1ca0e7,_0x508208)[_0x3860('0x4b')](function(_0x5db8f9){_0x5d0210(_0x5db8f9);})[_0x3860('0x45')](function(_0x2afdde){_0x2d916a(_0x2afdde);});});}function generateNonce(){return crypto[_0x3860('0x83')](0x10)[_0x3860('0x84')](_0x3860('0x85'));}function generateIssuedAt(){return Math[_0x3860('0x86')](Date['now']()/0x3e8)[_0x3860('0x84')]();}function createJwt(_0x2aa239){var _0x2aa22f={'payload':{'iat':_0x2aa239[_0x3860('0x72')],'nonce':_0x2aa239[_0x3860('0x71')]},'options':{'algorithm':_0x3860('0x87'),'subject':_0x2aa239['id']['toString'](),'issuer':hardwareConf[_0x3860('0x53')](),'audience':hardwareConf[_0x3860('0x53')]()}};return signJwt(_0x2aa22f)[_0x3860('0x4b')](function(_0x5ebf70){return{'iat':_0x2aa239['apiKeyIat'],'nonce':_0x2aa239[_0x3860('0x71')],'token':_0x5ebf70};});} \ No newline at end of file +var _0x8e3f=['blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','test','validatePasswordHistory','decryptString','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.','Sequelize','ValidationError','updatePasswordsHistory','split','length','splice','encryptString','join','promisify','sign','secret','payload','options','session','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','startsWith','authorization','Basic','User','find','authenticate','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','blockDuration','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var db=require(_0xf8e3('0x0'))['db'];var config=require(_0xf8e3('0x1'));var hardwareConf=require(_0xf8e3('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf8e3('0x3'));var _=require(_0xf8e3('0x4'));var jwt=require(_0xf8e3('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xf8e3('0x6'));var basicAuth=require(_0xf8e3('0x7'));var crypto=require('crypto');var BPromise=require(_0xf8e3('0x8'));var util=require(_0xf8e3('0x9'));var moment=require(_0xf8e3('0xa'));var validateJwt=expressJwt({'secret':config[_0xf8e3('0xb')]['session']});var userAttributes=['id',_0xf8e3('0xc'),_0xf8e3('0xd'),_0xf8e3('0xe'),_0xf8e3('0xf'),_0xf8e3('0x10'),_0xf8e3('0x11'),_0xf8e3('0x12'),_0xf8e3('0x13'),_0xf8e3('0x14'),_0xf8e3('0x15'),_0xf8e3('0x16'),_0xf8e3('0x17'),'smsPause',_0xf8e3('0x18'),_0xf8e3('0x19'),_0xf8e3('0x1a'),'lastLoginAt',_0xf8e3('0x1b'),_0xf8e3('0x1c'),_0xf8e3('0x1d'),_0xf8e3('0x1e'),'alias',_0xf8e3('0x1f'),_0xf8e3('0x20'),_0xf8e3('0x21'),'phoneBarEnableRecording',_0xf8e3('0x22'),'phoneBarEnableSettings',_0xf8e3('0x23'),_0xf8e3('0x24'),_0xf8e3('0x25'),'phoneBarRemoteControlPort','hotdesk',_0xf8e3('0x26'),_0xf8e3('0x27'),_0xf8e3('0x28'),_0xf8e3('0x29'),_0xf8e3('0x2a'),_0xf8e3('0x2b'),_0xf8e3('0x2c'),_0xf8e3('0x2d'),_0xf8e3('0x2e'),_0xf8e3('0x2f'),'chatAutoanswer',_0xf8e3('0x30'),_0xf8e3('0x31'),_0xf8e3('0x32'),_0xf8e3('0x33'),_0xf8e3('0x34'),_0xf8e3('0x35'),_0xf8e3('0x36'),_0xf8e3('0x37'),'faxAutoanswerDelay',_0xf8e3('0x38'),_0xf8e3('0x39'),_0xf8e3('0x3a')];exports[_0xf8e3('0x3b')]=function(){return this['isAuthenticated'](!![])[_0xf8e3('0x3c')](function(_0x4b3705,_0x286059,_0x225a1b){if(_0x4b3705[_0xf8e3('0x3d')]){_0x225a1b();}else{return db[_0xf8e3('0x3e')][_0xf8e3('0x3f')]({'where':{'id':_0x4b3705[_0xf8e3('0x40')]['id']},'attributes':['id','closed',_0xf8e3('0x41')],'raw':!![]})[_0xf8e3('0x42')](function(_0x3373ca){if(_0x3373ca&&_0x3373ca[_0xf8e3('0x43')]){return _0x286059[_0xf8e3('0x44')](_0x3373ca[_0xf8e3('0x41')]===_0xf8e3('0x45')?0x195:0x193)[_0xf8e3('0x46')]({'message':_0x3373ca['disposition']===_0xf8e3('0x45')?_0xf8e3('0x47'):_0xf8e3('0x48')});}else{_0x225a1b();}})[_0xf8e3('0x49')](function(_0x15b28c){_0x225a1b(_0x15b28c);});}});};exports[_0xf8e3('0x4a')]=function isAuthenticated(_0x16485e){return compose()[_0xf8e3('0x3c')](function(_0x4f2ae9,_0x21e1c0,_0x243e28){var _0x492694;if(_0x4f2ae9[_0xf8e3('0x4b')]['authorization']){if(_[_0xf8e3('0x4c')](_0x4f2ae9[_0xf8e3('0x4b')][_0xf8e3('0x4d')],_0xf8e3('0x4e'))){var _0x33f208=basicAuth(_0x4f2ae9);db[_0xf8e3('0x4f')][_0xf8e3('0x50')]({'where':{'name':_0x33f208[_0xf8e3('0xe')]}})['then'](function(_0x2c07bf){if(!_0x2c07bf||!_0x2c07bf[_0xf8e3('0x51')](_0x33f208['pass'])){return _0x21e1c0['status'](0x191)['json']({'message':_0xf8e3('0x52')});}_0x4f2ae9['user']={'id':_0x2c07bf['id']};_0x243e28();})[_0xf8e3('0x49')](function(_0x41faaa){_0x243e28(_0x41faaa);});}else if(_[_0xf8e3('0x4c')](_0x4f2ae9[_0xf8e3('0x4b')]['authorization'],'Bearer')){validateJwt(_0x4f2ae9,_0x21e1c0,_0x243e28);}else{if(_0x16485e){_0x243e28();}else{return _0x21e1c0[_0xf8e3('0x44')](0x193)[_0xf8e3('0x46')]({'message':_0xf8e3('0x53')});}}}else if(_0x4f2ae9[_0xf8e3('0x54')][_0xf8e3('0x55')]){try{var _0x24a037={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xf8e3('0x56')]()};verifyJwt(_0x4f2ae9['query']['apikey'],_0x24a037)[_0xf8e3('0x42')](function(_0x1e8878){return db[_0xf8e3('0x4f')][_0xf8e3('0x50')]({'where':{'id':_0x1e8878['sub']}})['then'](function(_0x41138f){_0x492694=_0x41138f;return db[_0xf8e3('0x57')]['findOne']({'where':{'id':0x1},'attributes':[_0xf8e3('0x58'),_0xf8e3('0x59')],'raw':!![]});})[_0xf8e3('0x42')](function(_0x18303e){if(!_0x492694||!_['isEqual'](_0x492694['apiKeyNonce'],_0x1e8878['nonce'])){return _0x21e1c0[_0xf8e3('0x44')](0x191)[_0xf8e3('0x46')]({'message':_0xf8e3('0x5a')});}if(_0x492694[_0xf8e3('0x5b')]){return _0x21e1c0['status'](0x191)[_0xf8e3('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x492694[_0xf8e3('0x5c')]){if(_0x18303e[_0xf8e3('0x59')]>0x0){if(moment(_0x492694[_0xf8e3('0x5d')])[_0xf8e3('0x5e')](_0x18303e[_0xf8e3('0x59')],_0xf8e3('0x5f'))>moment()){return _0x21e1c0[_0xf8e3('0x44')](0x191)[_0xf8e3('0x46')]({'message':_0xf8e3('0x60')});}}else{return _0x21e1c0['status'](0x191)[_0xf8e3('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x4f2ae9[_0xf8e3('0x3d')]={'id':_0x492694['id']};_0x243e28();});})[_0xf8e3('0x49')](function(){return _0x21e1c0[_0xf8e3('0x44')](0x191)[_0xf8e3('0x46')]({'message':_0xf8e3('0x60')});});}catch(_0x114a31){_0x243e28(_0x114a31);}}else if(_0x16485e){_0x243e28();}else{return _0x21e1c0[_0xf8e3('0x44')](0x193)[_0xf8e3('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf8e3('0x3c')](function(_0x108b81,_0x403173,_0x382dbb){if(_0x108b81[_0xf8e3('0x3d')]){db[_0xf8e3('0x4f')][_0xf8e3('0x50')]({'where':{'id':_0x108b81[_0xf8e3('0x3d')]['id']},'attributes':userAttributes})['then'](function(_0x57bba5){if(!_0x57bba5){return _0x403173['status'](0x194)[_0xf8e3('0x46')]({'message':_0xf8e3('0x61')});}_0x108b81['user']=_0x57bba5;_0x382dbb();})[_0xf8e3('0x49')](function(_0x489f20){_0x382dbb(_0x489f20);});}else if(_0x16485e){_0x382dbb();}else{return _0x403173[_0xf8e3('0x44')](0x194)[_0xf8e3('0x46')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xf8e3('0x62')]=function canUpdate(){return compose()['use'](function(_0x679519,_0x6875a6,_0x4b873e){return licenseUtil[_0xf8e3('0x63')]()[_0xf8e3('0x42')](function(_0x38e3d5){if(_0x38e3d5[_0xf8e3('0x64')]){_0x4b873e();}else{return _0x6875a6['status'](0x193)['json']({'message':'Forbidden'});}})[_0xf8e3('0x49')](function(_0xc1f803){_0x4b873e(_0xc1f803);});});};exports[_0xf8e3('0x65')]=function isWebrtcLicence(){return compose()['use'](function(_0x3258ef,_0x4bced6,_0x173b2b){return licenseUtil[_0xf8e3('0x63')]()['then'](function(_0x4a5aff){if(_0x4a5aff[_0xf8e3('0x66')]){_0x173b2b();}else{return _0x4bced6[_0xf8e3('0x44')](0x193)[_0xf8e3('0x46')]({'message':_0xf8e3('0x67')});}})[_0xf8e3('0x49')](function(_0x1fc2a6){_0x173b2b(_0x1fc2a6);});});};exports[_0xf8e3('0x68')]=function(_0x2a58e2,_0xdc2430,_0x81898e){_0x2a58e2[_0xf8e3('0x68')]=!![];return _0x81898e();};exports['signToken']=function signToken(_0x2104ea){return signJwt(_0x2104ea);};exports[_0xf8e3('0x69')]=function(_0x20195b,_0x458188){if(!_0x20195b[_0xf8e3('0x3d')]){return _0x458188[_0xf8e3('0x44')](0x194)['json']({'message':_0xf8e3('0x6a')});}var _0x3534f0={'payload':{'id':_0x20195b[_0xf8e3('0x3d')]['id'],'role':_0x20195b[_0xf8e3('0x3d')][_0xf8e3('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3534f0)[_0xf8e3('0x42')](function(_0x5855f2){_0x458188[_0xf8e3('0x6b')](_0xf8e3('0x6c'),_0x5855f2);_0x458188[_0xf8e3('0x6d')](_0xf8e3('0x6e'));})[_0xf8e3('0x49')](function(_0x2fef16){return _0x458188['status'](0x1f4)[_0xf8e3('0x6f')](_0x2fef16);});};exports[_0xf8e3('0x70')]=function(_0x1bb0c1){if(_[_0xf8e3('0x71')](_0x1bb0c1[_0xf8e3('0x72')])||_['isNil'](_0x1bb0c1[_0xf8e3('0x73')])){return null;}else{return createJwt(_0x1bb0c1);}};exports[_0xf8e3('0x74')]=function(_0x40561e){_0x40561e['apiKeyNonce']=generateNonce();_0x40561e['apiKeyIat']=generateIssuedAt();return createJwt(_0x40561e);};exports[_0xf8e3('0x75')]=function(_0x3886dc,_0x2a0c85){var _0x3ad7f1=_0x3886dc['query'][_0xf8e3('0x55')];if(_0x3ad7f1){var _0x16bddb={'nonce':_0x2a0c85['apiKeyNonce'],'iat':_0x2a0c85['apiKeyIat'],'audience':hardwareConf[_0xf8e3('0x56')](),'issuer':hardwareConf[_0xf8e3('0x56')]()};return verifyJwt(_0x3ad7f1,_0x16bddb)[_0xf8e3('0x42')](function(){return generateApiKey(_0x2a0c85);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x4892e9){var _0x182e9b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x182e9b[_0xf8e3('0x76')](_0x4892e9))throw new db['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~!@#$%^&-_=+[{]}.');return;};exports[_0xf8e3('0x77')]=function(_0x51ff7c,_0x5368a8,_0x3c3775){var _0x21cd28=encryptor[_0xf8e3('0x78')](_0x5368a8)['split'](',');for(var _0x57561f=0x0;_0x57561f<_0x3c3775;_0x57561f++){if(!_0x21cd28[_0x57561f])break;if(_0x51ff7c['toLowerCase']()===_0x21cd28[_0x57561f]['toLowerCase']()){var _0x3390a1=util[_0xf8e3('0x79')](_0xf8e3('0x7a'),_0x3c3775);if(_0x3c3775===0x1){_0x3390a1=_0xf8e3('0x7b');}throw new db[(_0xf8e3('0x7c'))][(_0xf8e3('0x7d'))](_0x3390a1);}}return;};exports[_0xf8e3('0x7e')]=function(_0x5f5ee4,_0x1ffcaa){var _0x5d5d91=_0x1ffcaa?encryptor['decryptString'](_0x1ffcaa)[_0xf8e3('0x7f')](','):[];if(_0x5d5d91[_0xf8e3('0x80')]===0x5){_0x5d5d91[_0xf8e3('0x81')](-0x1,0x1);}_0x5d5d91['unshift'](_0x5f5ee4);return encryptor[_0xf8e3('0x82')](_0x5d5d91[_0xf8e3('0x83')](','));};function signJwt(_0x4879c7){var _0x48bb3f=BPromise[_0xf8e3('0x84')](jwt[_0xf8e3('0x85')],{'context':jwt});var _0x2c2aa6=_0x4879c7[_0xf8e3('0x86')]||config['secrets']['session'];return new BPromise(function(_0x37751e,_0x3276f3){_0x48bb3f(_0x4879c7[_0xf8e3('0x87')],_0x2c2aa6,_0x4879c7[_0xf8e3('0x88')])['then'](function(_0x572c15){_0x37751e(_0x572c15);})[_0xf8e3('0x49')](function(_0x413073){_0x3276f3(_0x413073);});});}function verifyJwt(_0x56a07e,_0x266f16,_0x263eb6){var _0x44282b=BPromise[_0xf8e3('0x84')](jwt['verify'],{'context':jwt});var _0x11ebb2=_0x263eb6||config['secrets'][_0xf8e3('0x89')];return new BPromise(function(_0x1cad38,_0x5cbdc6){_0x44282b(_0x56a07e,_0x11ebb2,_0x266f16)[_0xf8e3('0x42')](function(_0x31568b){_0x1cad38(_0x31568b);})['catch'](function(_0x232d83){_0x5cbdc6(_0x232d83);});});}function generateNonce(){return crypto[_0xf8e3('0x8a')](0x10)[_0xf8e3('0x8b')](_0xf8e3('0x8c'));}function generateIssuedAt(){return Math['floor'](Date[_0xf8e3('0x8d')]()/0x3e8)[_0xf8e3('0x8b')]();}function createJwt(_0x76033b){var _0x3c214f={'payload':{'iat':_0x76033b[_0xf8e3('0x73')],'nonce':_0x76033b[_0xf8e3('0x72')]},'options':{'algorithm':_0xf8e3('0x8e'),'subject':_0x76033b['id'][_0xf8e3('0x8b')](),'issuer':hardwareConf[_0xf8e3('0x56')](),'audience':hardwareConf[_0xf8e3('0x56')]()}};return signJwt(_0x3c214f)[_0xf8e3('0x42')](function(_0x21d922){return{'iat':_0x76033b['apiKeyIat'],'nonce':_0x76033b['apiKeyNonce'],'token':_0x21d922};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 25645a6..ef9674f 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x706d=['clause','getFilteredContacts','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter','tags','user','ids','tag','countFilteredContacts','count','buildContactsQuery'];(function(_0x28a5ad,_0x520afa){var _0x176b8a=function(_0x3d71b){while(--_0x3d71b){_0x28a5ad['push'](_0x28a5ad['shift']());}};_0x176b8a(++_0x520afa);}(_0x706d,0x7c));var _0xd706=function(_0x282e8c,_0x1db8cf){_0x282e8c=_0x282e8c-0x0;var _0x48095f=_0x706d[_0x282e8c];return _0x48095f;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0xd706('0x0'))['db'];exports[_0xd706('0x1')]=function(_0x20795f,_0x207021,_0x3605ba,_0x220c18){var _0x42a9ad={'count':0x0,'rows':[]};var _0x48fbb2=sqlUtils[_0xd706('0x2')](_0x207021,_0x20795f);if(_0x48fbb2){return Promise[_0xd706('0x3')](_0x42a9ad);}var _0x3868c0=sqlUtils[_0xd706('0x4')]();var _0x256082={};var _0x12cb0c=![];var _0x525e40=![];return Promise['resolve']()[_0xd706('0x5')](function(){if(_0x20795f[_0xd706('0x6')]){return sqlUtils[_0xd706('0x7')](_0x20795f[_0xd706('0x6')],_0x220c18);}else{return sqlUtils[_0xd706('0x8')](_0x20795f,_0x220c18);}})[_0xd706('0x5')](function(_0x4bd032){_0x3868c0['where'](_0x4bd032[_0xd706('0x9')]);_0x3868c0[_0xd706('0xa')](_0x4bd032[_0xd706('0xb')]);_0x3868c0[_0xd706('0xa')](_0x4bd032[_0xd706('0xc')]);_0x3868c0[_0xd706('0xa')](_0x4bd032['user']['clause']);_0x256082=_0x4bd032[_0xd706('0xd')];_0x525e40=_0x4bd032[_0xd706('0xe')]['skip'];return sqlUtils['checkListsRestrictions'](_0x207021,_0x20795f,_0x525e40);})['then'](function(_0x393290){_0x3868c0[_0xd706('0xa')](_0x393290);var _0xc63a87=_0x20795f['search']?_0x256082[_0xd706('0xf')]:_0x20795f[_0xd706('0x10')];_0x12cb0c=_0xc63a87?!![]:![];return sqlUtils[_0xd706('0x11')](_0x3868c0,_0xc63a87);})[_0xd706('0x5')](function(_0x4df5ec){_0x42a9ad['count']=_0x4df5ec;if(_0x42a9ad[_0xd706('0x12')]===0x0){return;}if(_0x20795f['User']){_0x525e40=!![];}return sqlUtils[_0xd706('0x13')](_0x3868c0,_0x20795f[_0xd706('0xb')],_0x3605ba,_0x12cb0c,_0x256082[_0xd706('0x14')],_0x525e40);})[_0xd706('0x5')](function(_0x419708){if(!_0x419708){return[];}return sqlUtils[_0xd706('0x15')](_0x419708,_0x20795f,_0x3605ba);})['then'](function(_0x167b44){_0x42a9ad['rows']=_0x167b44;return _0x42a9ad;})[_0xd706('0x16')](function(_0x1177fc){throw _0x1177fc;});};exports[_0xd706('0x17')]=function(){var _0x4c596d={};var _0x15901a=[];return db[_0xd706('0x18')]['describe']()[_0xd706('0x5')](function(_0x22dbe5){_0x4c596d=_0x22dbe5;var _0x2de2cb=Object[_0xd706('0x19')](_0x4c596d)['filter'](function(_0x58be6d){return _[_0xd706('0x1a')](_0x58be6d,_0xd706('0x1b'))?_0x58be6d:undefined;});var _0x504d9f=_0x2de2cb[_0xd706('0x1c')](function(_0x2c1f0b){return db[_0xd706('0x1d')][_0xd706('0x1e')]({'where':{'id':_0x2c1f0b[_0xd706('0x1f')](0x3)},'raw':!![]});});return Promise[_0xd706('0x20')](_0x504d9f);})[_0xd706('0x5')](function(_0x2936f2){for(var _0x163713=0x0;_0x163713<_0x2936f2[_0xd706('0x21')];_0x163713++){if(_0x2936f2[_0x163713]){var _0x3e4cfd='cf_'+_0x2936f2[_0x163713]['id'];_0x4c596d[_0x3e4cfd][_0xd706('0x22')]=_0x2936f2[_0x163713][_0xd706('0x23')];}}_0x15901a=_[_0xd706('0x1c')](Object[_0xd706('0x19')](_0x4c596d),function(_0x22bdfd){return{'name':_0x22bdfd,'type':_0x4c596d[_0x22bdfd][_0xd706('0x23')]};});return _0x15901a;})['catch'](function(_0x430fab){throw _0x430fab;});}; \ No newline at end of file +var _0x7f6e=['resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','getFilteredContacts','CmContact','describe','keys','startsWith','cf_','CmCustomField','findOne','slice','all','length','fieldType','type','map','catch','./sql-utils','findAll','skipContactsQuery'];(function(_0x47b67e,_0x50181a){var _0xe3b207=function(_0x4c9665){while(--_0x4c9665){_0x47b67e['push'](_0x47b67e['shift']());}};_0xe3b207(++_0x50181a);}(_0x7f6e,0xcf));var _0xe7f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x7f6e[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var sqlUtils=require(_0xe7f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0xe7f6('0x1')]=function(_0x4883bb,_0x1c5fe2,_0x33f298,_0x5829ce){var _0x4340f2={'count':0x0,'rows':[]};var _0x12f079=sqlUtils[_0xe7f6('0x2')](_0x1c5fe2,_0x4883bb);if(_0x12f079){return Promise[_0xe7f6('0x3')](_0x4340f2);}var _0x58b027=sqlUtils[_0xe7f6('0x4')]();var _0x46a3a9={};var _0x1d6571=![];var _0x3cbc52=![];return Promise[_0xe7f6('0x3')]()[_0xe7f6('0x5')](function(){if(_0x4883bb[_0xe7f6('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x4883bb[_0xe7f6('0x6')],_0x5829ce);}else{return sqlUtils[_0xe7f6('0x7')](_0x4883bb,_0x5829ce);}})[_0xe7f6('0x5')](function(_0xc627f2){_0x58b027['where'](_0xc627f2['default']);_0x58b027[_0xe7f6('0x8')](_0xc627f2[_0xe7f6('0x9')]);_0x58b027[_0xe7f6('0x8')](_0xc627f2[_0xe7f6('0xa')]);_0x58b027[_0xe7f6('0x8')](_0xc627f2[_0xe7f6('0xb')][_0xe7f6('0xc')]);_0x46a3a9=_0xc627f2[_0xe7f6('0xd')];_0x3cbc52=_0xc627f2['user'][_0xe7f6('0xe')];return sqlUtils[_0xe7f6('0xf')](_0x1c5fe2,_0x4883bb,_0x3cbc52);})[_0xe7f6('0x5')](function(_0x12fb5c){_0x58b027[_0xe7f6('0x8')](_0x12fb5c);var _0x1bf907=_0x4883bb[_0xe7f6('0x6')]?_0x46a3a9[_0xe7f6('0x10')]:_0x4883bb[_0xe7f6('0x11')];_0x1d6571=_0x1bf907?!![]:![];return sqlUtils[_0xe7f6('0x12')](_0x58b027,_0x1bf907);})[_0xe7f6('0x5')](function(_0x185f3c){_0x4340f2[_0xe7f6('0x13')]=_0x185f3c;if(_0x4340f2[_0xe7f6('0x13')]===0x0){return;}if(_0x4883bb['User']){_0x3cbc52=!![];}return sqlUtils['buildContactsQuery'](_0x58b027,_0x4883bb[_0xe7f6('0x9')],_0x33f298,_0x1d6571,_0x46a3a9['clause'],_0x3cbc52);})[_0xe7f6('0x5')](function(_0x53b620){if(!_0x53b620){return[];}return sqlUtils[_0xe7f6('0x14')](_0x53b620,_0x4883bb,_0x33f298);})[_0xe7f6('0x5')](function(_0x5cdd53){_0x4340f2['rows']=_0x5cdd53;return _0x4340f2;})['catch'](function(_0x361214){throw _0x361214;});};exports['describe']=function(){var _0x21897e={};var _0x53c74f=[];return db[_0xe7f6('0x15')][_0xe7f6('0x16')]()['then'](function(_0x4fc536){_0x21897e=_0x4fc536;var _0x1ed62d=Object[_0xe7f6('0x17')](_0x21897e)['filter'](function(_0x130748){return _[_0xe7f6('0x18')](_0x130748,_0xe7f6('0x19'))?_0x130748:undefined;});var _0x5b7576=_0x1ed62d['map'](function(_0x225536){return db[_0xe7f6('0x1a')][_0xe7f6('0x1b')]({'where':{'id':_0x225536[_0xe7f6('0x1c')](0x3)},'raw':!![]});});return Promise[_0xe7f6('0x1d')](_0x5b7576);})['then'](function(_0x9ff81d){for(var _0xcbc364=0x0;_0xcbc364<_0x9ff81d[_0xe7f6('0x1e')];_0xcbc364++){if(_0x9ff81d[_0xcbc364]){var _0x352457=_0xe7f6('0x19')+_0x9ff81d[_0xcbc364]['id'];_0x21897e[_0x352457][_0xe7f6('0x1f')]=_0x9ff81d[_0xcbc364][_0xe7f6('0x20')];}}_0x53c74f=_[_0xe7f6('0x21')](Object[_0xe7f6('0x17')](_0x21897e),function(_0x38e8ef){return{'name':_0x38e8ef,'type':_0x21897e[_0x38e8ef]['type']};});return _0x53c74f;})[_0xe7f6('0x22')](function(_0x4fbfd7){throw _0x4fbfd7;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index d086047..683fb29 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90fb=['push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','length','conditions','name','datetime','castTo','DATE','type','default','value','start','end','Tag','map','and','tags','ids','User','user','clause','uc.UserId\x20=\x20?','skip','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','select','c.id','limit','offset','group','having','order','DESC','subqry.','color','keyBy','Sequelize','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','sequelize','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x90fb,0xb1));var _0xb90f=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x90fb[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var squel=require(_0xb90f('0x0'));var as=require(_0xb90f('0x1'));var qs=require(_0xb90f('0x2'));var utils=require(_0xb90f('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x20cb88,_0x1883a1){var _0x25b10a=![];if(_0x20cb88[_0xb90f('0x4')]===_0xb90f('0x5')&&!_0x1883a1[_0xb90f('0x6')]&&!_0x1883a1[_0xb90f('0x7')]&&_0x1883a1[_0xb90f('0x8')]!==_0xb90f('0x9')){_0x25b10a=!![];}return _0x25b10a;}function getContactsSubquery(){return squel['select']()[_0xb90f('0xa')](_0xb90f('0xb'),'c')[_0xb90f('0xc')](_0xb90f('0xd'));}function applyJoinClauses(_0x516833,_0x134d27){var _0x1b058b=_0x134d27?'c':'subqry';_0x516833[_0xb90f('0xe')](_0xb90f('0xf'),'uc',_0xb90f('0x10')+_0x1b058b+_0xb90f('0x11'))[_0xb90f('0xe')](_0xb90f('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x1b058b+_0xb90f('0x11'))[_0xb90f('0xe')](_0xb90f('0x13'),'t',_0xb90f('0x14'));return _0x516833;}function addFieldsToQuery(_0x567177,_0x392c1c,_0x2d70f6,_0x51f7fb,_0x5e9281){var _0x4d69ea=_0x5e9281?'c':_0xb90f('0x15');if(!_0x392c1c){_0x392c1c=['id',_0xb90f('0x16'),'lastName','phone',_0xb90f('0x17'),_0xb90f('0x18'),_0xb90f('0x19'),_0xb90f('0x7'),_0xb90f('0x1a'),_0xb90f('0x1b'),_0xb90f('0x1c'),_0xb90f('0x1d'),'TagIds'];}else if(!_0x392c1c[_0xb90f('0x1e')]('id')){_0x392c1c[_0xb90f('0x1f')]('id');}var _0x37d658=_0x2d70f6&&_0x5e9281||!_0x2d70f6&&!_0x5e9281;if(_0x51f7fb){_0x37d658=_0x51f7fb&&_0x5e9281||!_0x51f7fb&&!_0x5e9281;}_0x392c1c[_0xb90f('0x20')](function(_0x5ce543){if(_0x5ce543===_0xb90f('0x21')){if(_0x37d658){_0x567177[_0xb90f('0x22')](_0xb90f('0x23'),_0x5ce543);}else if(_0x2d70f6||_0x51f7fb){_0x567177[_0xb90f('0x22')](_0x4d69ea+'.'+_0x5ce543);}}else{_0x567177[_0xb90f('0x22')](_0x4d69ea+'.'+_0x5ce543);}});return _0x567177;}function getSqlClauses(){var _0x295edb={'default':squel[_0xb90f('0x24')](),'fields':squel[_0xb90f('0x24')](),'filter':squel[_0xb90f('0x24')](),'tags':{'clause':squel[_0xb90f('0x24')](),'ids':null},'user':{'clause':squel[_0xb90f('0x24')](),'skip':![]}};return _0x295edb;}function parseTagParameter(_0x3708ec){var _0x288891=squel[_0xb90f('0x24')]();if(_0x3708ec){var _0x4bb9e5=utils['getSelectedTags'](_0x3708ec);_0x4bb9e5[_0xb90f('0x20')](function(_0x143f11){_0x288891['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x143f11+',%');});}return _0x288891;}function parseSearchFilter(_0x4ccad5){var _0x501625=squel[_0xb90f('0x24')]();if(_0x4ccad5){var _0x5a2c4d=_0x4ccad5['replace']('\x5c','\x5c\x5c')[_0xb90f('0x25')](/'/g,'\x27\x27');if(_0x5a2c4d[_0xb90f('0x26')]('\x20')['length']>0x1){_0x501625['or'](_0xb90f('0x27'),qs[_0xb90f('0x28')](_0x5a2c4d,!![]),null);}else{if(qs[_0xb90f('0x29')](_0x5a2c4d)){_0x501625['or'](_0xb90f('0x2a'),_0x5a2c4d+'%');_0x501625['or']('c.phone\x20LIKE\x20?',_0x5a2c4d+'%');_0x501625['or'](_0xb90f('0x2b'),_0x5a2c4d+'%');_0x501625['or']('c.fax\x20LIKE\x20?',_0x5a2c4d+'%');}else if(qs[_0xb90f('0x2c')](_0x5a2c4d)){_0x501625['or'](_0xb90f('0x2d'),_0x5a2c4d+'%');}else{_0x501625['or'](_0xb90f('0x2e'),'%'+_0x5a2c4d+'%');_0x501625['or']('c.lastName\x20LIKE\x20?','%'+_0x5a2c4d+'%');_0x501625['or'](_0xb90f('0x2d'),'%'+_0x5a2c4d+'%');}}}return _0x501625;}function parseAdvancedSearchFilter(_0x200140,_0x1fa2e4){var _0x4237af=getSqlClauses();var _0x2473b0=as[_0xb90f('0x2f')](_0x200140);var _0x41b9fb=_0x2473b0[_0xb90f('0x30')];for(var _0x3cf7d1=0x0;_0x3cf7d1<_0x2473b0['conditions'][_0xb90f('0x31')];_0x3cf7d1++){var _0xca4211=_0x2473b0[_0xb90f('0x32')][_0x3cf7d1];var _0x5ad475='c';var _0x1a186f=_['find'](_0x1fa2e4,[_0xb90f('0x33'),_0xca4211['field']]);if(_0x1a186f){if(_0xca4211[_0xb90f('0x22')]==='dateOfBirth'||_0x1a186f['fieldType']===_0xb90f('0x34')){_0xca4211[_0xb90f('0x35')]=_0xb90f('0x36');}var _0x5d2039=as['buildExpression'](_0x5ad475,_0x1a186f[_0xb90f('0x37')],_0xca4211);_0x4237af[_0xb90f('0x38')][_0x41b9fb](_0x5d2039['text'],_0x5d2039[_0xb90f('0x39')][_0xb90f('0x3a')],_0x5d2039[_0xb90f('0x39')][_0xb90f('0x3b')]);}else{if(_0xca4211[_0xb90f('0x22')]===_0xb90f('0x3c')){var _0x1cdd74=_0xca4211[_0xb90f('0x39')][_0xb90f('0x26')](',')[_0xb90f('0x3d')](function(_0x3a6115){return Number(_0x3a6115);});var _0x49d2c=parseTagParameter(_0x1cdd74);_0x4237af['tags']['clause'][_0xb90f('0x3e')](_0x49d2c);_0x4237af[_0xb90f('0x3f')][_0xb90f('0x40')]=_0x1cdd74;}else if(_0xca4211['field']===_0xb90f('0x41')){_0x4237af[_0xb90f('0x42')][_0xb90f('0x43')][_0xb90f('0x3e')](_0xb90f('0x44'),_0xca4211[_0xb90f('0x39')]);_0x4237af['user'][_0xb90f('0x45')]=!![];}}}return _0x4237af;}function parseModelFields(_0x211403,_0x4e4e7){var _0x161c95=squel[_0xb90f('0x24')]();var _0x2d5b52=_(_0x211403)['keys']()[_0xb90f('0x3d')](function(_0x684dde){return _[_0xb90f('0x46')](_0x4e4e7,[_0xb90f('0x33'),_0x684dde])?_0x684dde:undefined;})[_0xb90f('0x47')]()[_0xb90f('0x39')]();if(_0x211403[_0xb90f('0x48')]){_0x2d5b52['push'](_0xb90f('0x48'));}if(_0x211403[_0xb90f('0x41')]){_0x2d5b52['push']('User');}if(_0x2d5b52[_0xb90f('0x31')]>0x0){_0x2d5b52[_0xb90f('0x20')](function(_0x49bb2b){if(_0x49bb2b===_0xb90f('0x7')){_0x161c95[_0xb90f('0x3e')](_0xb90f('0x49'),[][_0xb90f('0x4a')](_0x211403[_0x49bb2b]));}else if(_0x49bb2b===_0xb90f('0x48')){var _0x373e5a='%'+_0x211403[_0x49bb2b]+'%';_0x161c95[_0xb90f('0x3e')](_0xb90f('0x4b'),_0x373e5a);}else if(_0x49bb2b===_0xb90f('0x41')){_0x161c95[_0xb90f('0x3e')](_0xb90f('0x44'),_0x211403[_0x49bb2b]);}else{_0x161c95['and']('c.'+_0x49bb2b+'\x20=\x20?',_0x211403[_0x49bb2b]);}});}return _0x161c95;}function parseQueryParameters(_0x547c80,_0x3ae815){var _0x5298dc=getSqlClauses();return Promise[_0xb90f('0x4c')]()[_0xb90f('0x4d')](function(){return parseModelFields(_0x547c80,_0x3ae815);})[_0xb90f('0x4d')](function(_0x8dcef0){_0x5298dc[_0xb90f('0x4e')]['and'](_0x8dcef0);return parseTagParameter(_0x547c80[_0xb90f('0x4f')]);})['then'](function(_0x4c9bd7){_0x5298dc[_0xb90f('0x3f')][_0xb90f('0x43')]['and'](_0x4c9bd7);return parseSearchFilter(_0x547c80['filter']);})[_0xb90f('0x4d')](function(_0x1e5794){_0x5298dc[_0xb90f('0x50')]=_0x1e5794;return _0x5298dc;});}function checkListsRestrictions(_0x22209d,_0x4f958f,_0x2b7779){var _0x44acdf=squel['expr']();return Promise[_0xb90f('0x4c')]()[_0xb90f('0x4d')](function(){if(_0x4f958f[_0xb90f('0x6')]&&_0x22209d[_0xb90f('0x4')]==='agent'&&!_0x2b7779){return _0x22209d['getLists']({'attributes':['id'],'raw':!![]});}})[_0xb90f('0x4d')](function(_0x1c30ee){if(_0x1c30ee){if(_0x1c30ee[_0xb90f('0x31')]===0x0){_0x44acdf[_0xb90f('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x44acdf[_0xb90f('0x3e')](_0xb90f('0x49'),_[_0xb90f('0x3d')](_0x1c30ee,'id'));}}})['then'](function(){return _0x44acdf;});}function buildContactsQuery(_0x54a01e,_0xfcbbd,_0x539d18,_0x334bd8,_0x58a7be,_0x4acd4c){if(_0xfcbbd){_0xfcbbd=_0x539d18['attributes'];}_0x54a01e=addFieldsToQuery(_0x54a01e,_0xfcbbd,_0x334bd8,_0x4acd4c,!![]);var _0x30facc=squel[_0xb90f('0x51')]();_0x30facc=addFieldsToQuery(_0x30facc,_0xfcbbd,_0x334bd8,_0x4acd4c,![]);if(_0x334bd8||_0x4acd4c){_0x54a01e=applyJoinClauses(_0x54a01e,!![]);_0x54a01e['group'](_0xb90f('0x52'));if(_0x539d18['limit']){_0x30facc[_0xb90f('0x53')](_0x539d18['limit']);}if(_0x539d18['offset']){_0x30facc['offset'](_0x539d18[_0xb90f('0x54')]);}}else{_0x30facc=applyJoinClauses(_0x30facc,![]);_0x30facc[_0xb90f('0x55')]('subqry.id');if(_0x539d18[_0xb90f('0x53')]){_0x54a01e[_0xb90f('0x53')](_0x539d18[_0xb90f('0x53')]);}if(_0x539d18[_0xb90f('0x54')]){_0x54a01e[_0xb90f('0x54')](_0x539d18['offset']);}}_0x30facc[_0xb90f('0x56')](_0x58a7be);if(_0x539d18[_0xb90f('0x57')]){_0x539d18[_0xb90f('0x57')]['forEach'](function(_0x253111){_0x54a01e[_0xb90f('0x57')]('c.'+_0x253111[0x0],_0x253111[0x1]===_0xb90f('0x58')?![]:!![]);_0x30facc[_0xb90f('0x57')](_0xb90f('0x59')+_0x253111[0x0],_0x253111[0x1]==='DESC'?![]:!![]);});}_0x30facc[_0xb90f('0xa')](_0x54a01e,_0xb90f('0x15'));return _0x30facc;}function getFilteredContacts(_0x3ef0ab){var _0x5c9b70=[];return db[_0xb90f('0x3c')]['findAll']({'attributes':['id','name',_0xb90f('0x5a')],'raw':!![]})[_0xb90f('0x4d')](function(_0x3f841f){_0x5c9b70=_[_0xb90f('0x5b')](_0x3f841f,'id');var _0x898668={'type':db[_0xb90f('0x5c')]['QueryTypes'][_0xb90f('0x5d')],'model':db[_0xb90f('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xb90f('0x5f')](_0x3ef0ab[_0xb90f('0x60')](),_0x898668);})['then'](function(_0x57d31c){_0x57d31c[_0xb90f('0x20')](function(_0x39a052){if(_0x39a052[_0xb90f('0x21')]){_0x39a052[_0xb90f('0x61')]=[];_0x39a052['TagIds'][_0xb90f('0x26')](',')[_0xb90f('0x20')](function(_0xdc8e20){_0x39a052[_0xb90f('0x61')][_0xb90f('0x1f')](_0x5c9b70[_0xdc8e20]);});}delete _0x39a052[_0xb90f('0x21')];});return _0x57d31c;});}function countFilteredContacts(_0x1f44fb,_0x237062){var _0x232501=_0x1f44fb[_0xb90f('0x62')]();_0x232501['field'](_0xb90f('0x63'));_0x232501=applyJoinClauses(_0x232501,!![]);_0x1f44fb['group'](_0xb90f('0x52'));var _0x44187e=utils['getSelectedTags'](_0x237062);if(!_[_0xb90f('0x64')](_0x44187e)){_0x232501[_0xb90f('0xc')](_0xb90f('0x65'),_0x44187e);}var _0x25606f={'type':db[_0xb90f('0x5c')][_0xb90f('0x66')][_0xb90f('0x5d')],'raw':!![]};return db[_0xb90f('0x67')][_0xb90f('0x5f')](_0x232501[_0xb90f('0x60')](),_0x25606f)[_0xb90f('0x4d')](function(_0x2213e0){return _0x2213e0[0x0][_0xb90f('0x63')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xd247=['getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','conditions','find','name','dateOfBirth','fieldType','datetime','buildExpression','type','text','value','start','end','Tag','clause','ids','User','user','and','uc.UserId\x20=\x20?','skip','map','Contact','c.ListId\x20IN\x20?','\x20=\x20?','resolve','then','fields','tags','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','QueryTypes','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','agent','search','ListId','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','email','createdAt','updatedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd247,0x173));var _0x7d24=function(_0x4c4a8b,_0x402020){_0x4c4a8b=_0x4c4a8b-0x0;var _0x20fa14=_0xd247[_0x4c4a8b];return _0x20fa14;};'use strict';var _=require('lodash');var squel=require(_0x7d24('0x0'));var as=require(_0x7d24('0x1'));var qs=require('../parsers/qs');var utils=require(_0x7d24('0x2'));var db=require(_0x7d24('0x3'))['db'];function skipContactsQuery(_0x5b5e14,_0xe517e1){var _0x54b9fe=![];if(_0x5b5e14['role']===_0x7d24('0x4')&&!_0xe517e1[_0x7d24('0x5')]&&!_0xe517e1[_0x7d24('0x6')]&&_0xe517e1['autocomplete']!=='true'){_0x54b9fe=!![];}return _0x54b9fe;}function getContactsSubquery(){return squel[_0x7d24('0x7')]()['from'](_0x7d24('0x8'),'c')[_0x7d24('0x9')](_0x7d24('0xa'));}function applyJoinClauses(_0x5ea173,_0x352de6){var _0x487458=_0x352de6?'c':_0x7d24('0xb');_0x5ea173[_0x7d24('0xc')](_0x7d24('0xd'),'uc',_0x7d24('0xe')+_0x487458+_0x7d24('0xf'))['left_join'](_0x7d24('0x10'),'ct',_0x7d24('0x11')+_0x487458+'.id')[_0x7d24('0xc')](_0x7d24('0x12'),'t',_0x7d24('0x13'));return _0x5ea173;}function addFieldsToQuery(_0x5e0e61,_0x3b484b,_0x2c53e9,_0x51eb80,_0x1fc31e){var _0x32bef9=_0x1fc31e?'c':_0x7d24('0xb');if(!_0x3b484b){_0x3b484b=['id','firstName',_0x7d24('0x14'),_0x7d24('0x15'),_0x7d24('0x16'),'fax',_0x7d24('0x17'),_0x7d24('0x6'),'CompanyId',_0x7d24('0x18'),_0x7d24('0x19'),'deletedAt','TagIds'];}else if(!_0x3b484b[_0x7d24('0x1a')]('id')){_0x3b484b[_0x7d24('0x1b')]('id');}var _0xbf13ca=_0x2c53e9&&_0x1fc31e||!_0x2c53e9&&!_0x1fc31e;if(_0x51eb80){_0xbf13ca=_0x51eb80&&_0x1fc31e||!_0x51eb80&&!_0x1fc31e;}_0x3b484b[_0x7d24('0x1c')](function(_0x1fc619){if(_0x1fc619===_0x7d24('0x1d')){if(_0xbf13ca){_0x5e0e61[_0x7d24('0x1e')](_0x7d24('0x1f'),_0x1fc619);}else if(_0x2c53e9||_0x51eb80){_0x5e0e61[_0x7d24('0x1e')](_0x32bef9+'.'+_0x1fc619);}}else{_0x5e0e61[_0x7d24('0x1e')](_0x32bef9+'.'+_0x1fc619);}});return _0x5e0e61;}function getSqlClauses(){var _0x134a84={'default':squel[_0x7d24('0x20')](),'fields':squel[_0x7d24('0x20')](),'filter':squel[_0x7d24('0x20')](),'tags':{'clause':squel[_0x7d24('0x20')](),'ids':null},'user':{'clause':squel[_0x7d24('0x20')](),'skip':![]}};return _0x134a84;}function parseTagParameter(_0x5cef07){var _0x44eea1=squel[_0x7d24('0x20')]();if(_0x5cef07){var _0x494cf3=utils[_0x7d24('0x21')](_0x5cef07);_0x494cf3['forEach'](function(_0x3e5c36){_0x44eea1['or'](_0x7d24('0x22'),'%,'+_0x3e5c36+',%');});}return _0x44eea1;}function parseSearchFilter(_0x55ea5f){var _0x4db6d0=squel[_0x7d24('0x20')]();if(_0x55ea5f){var _0x34e8c5=_0x55ea5f[_0x7d24('0x23')]('\x5c','\x5c\x5c')[_0x7d24('0x23')](/'/g,'\x27\x27');if(_0x34e8c5[_0x7d24('0x24')]('\x20')[_0x7d24('0x25')]>0x1){_0x4db6d0['or'](_0x7d24('0x26'),qs[_0x7d24('0x27')](_0x34e8c5,!![]),null);}else{if(qs[_0x7d24('0x28')](_0x34e8c5)){_0x4db6d0['or'](_0x7d24('0x29'),_0x34e8c5+'%');_0x4db6d0['or'](_0x7d24('0x2a'),_0x34e8c5+'%');_0x4db6d0['or'](_0x7d24('0x2b'),_0x34e8c5+'%');_0x4db6d0['or']('c.fax\x20LIKE\x20?',_0x34e8c5+'%');}else if(qs[_0x7d24('0x2c')](_0x34e8c5)){_0x4db6d0['or'](_0x7d24('0x2d'),_0x34e8c5+'%');}else{_0x4db6d0['or'](_0x7d24('0x2e'),'%'+_0x34e8c5+'%');_0x4db6d0['or']('c.lastName\x20LIKE\x20?','%'+_0x34e8c5+'%');_0x4db6d0['or'](_0x7d24('0x2d'),'%'+_0x34e8c5+'%');}}}return _0x4db6d0;}function parseAdvancedSearchFilter(_0x4e3e8d,_0x125cdb){var _0x1300ca=getSqlClauses();var _0x33e78d=as[_0x7d24('0x2f')](_0x4e3e8d);var _0x350302=_0x33e78d['sqlOperator'];for(var _0x42676b=0x0;_0x42676b<_0x33e78d[_0x7d24('0x30')]['length'];_0x42676b++){var _0x15830c=_0x33e78d['conditions'][_0x42676b];var _0x1e6bef='c';var _0x2f00bd=_[_0x7d24('0x31')](_0x125cdb,[_0x7d24('0x32'),_0x15830c[_0x7d24('0x1e')]]);if(_0x2f00bd){if(_0x15830c[_0x7d24('0x1e')]===_0x7d24('0x33')||_0x2f00bd[_0x7d24('0x34')]===_0x7d24('0x35')){_0x15830c['castTo']='DATE';}var _0x5b8db2=as[_0x7d24('0x36')](_0x1e6bef,_0x2f00bd[_0x7d24('0x37')],_0x15830c);_0x1300ca['default'][_0x350302](_0x5b8db2[_0x7d24('0x38')],_0x5b8db2[_0x7d24('0x39')][_0x7d24('0x3a')],_0x5b8db2[_0x7d24('0x39')][_0x7d24('0x3b')]);}else{if(_0x15830c[_0x7d24('0x1e')]===_0x7d24('0x3c')){var _0x365a59=_0x15830c['value'][_0x7d24('0x24')](',')['map'](function(_0xb24b23){return Number(_0xb24b23);});var _0x18885d=parseTagParameter(_0x365a59);_0x1300ca['tags'][_0x7d24('0x3d')]['and'](_0x18885d);_0x1300ca['tags'][_0x7d24('0x3e')]=_0x365a59;}else if(_0x15830c['field']===_0x7d24('0x3f')){_0x1300ca[_0x7d24('0x40')][_0x7d24('0x3d')][_0x7d24('0x41')](_0x7d24('0x42'),_0x15830c[_0x7d24('0x39')]);_0x1300ca[_0x7d24('0x40')][_0x7d24('0x43')]=!![];}}}return _0x1300ca;}function parseModelFields(_0xa9b599,_0xdc38a0){var _0x454ddd=squel['expr']();var _0x831b64=_(_0xa9b599)['keys']()[_0x7d24('0x44')](function(_0x5bfb37){return _['some'](_0xdc38a0,[_0x7d24('0x32'),_0x5bfb37])?_0x5bfb37:undefined;})['compact']()[_0x7d24('0x39')]();if(_0xa9b599[_0x7d24('0x45')]){_0x831b64[_0x7d24('0x1b')]('Contact');}if(_0xa9b599['User']){_0x831b64[_0x7d24('0x1b')](_0x7d24('0x3f'));}if(_0x831b64[_0x7d24('0x25')]>0x0){_0x831b64[_0x7d24('0x1c')](function(_0x307eb8){if(_0x307eb8===_0x7d24('0x6')){_0x454ddd[_0x7d24('0x41')](_0x7d24('0x46'),[]['concat'](_0xa9b599[_0x307eb8]));}else if(_0x307eb8===_0x7d24('0x45')){var _0x5873a5='%'+_0xa9b599[_0x307eb8]+'%';_0x454ddd[_0x7d24('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5873a5);}else if(_0x307eb8===_0x7d24('0x3f')){_0x454ddd[_0x7d24('0x41')](_0x7d24('0x42'),_0xa9b599[_0x307eb8]);}else{_0x454ddd['and']('c.'+_0x307eb8+_0x7d24('0x47'),_0xa9b599[_0x307eb8]);}});}return _0x454ddd;}function parseQueryParameters(_0x59c072,_0x454c4d){var _0x474e68=getSqlClauses();return Promise[_0x7d24('0x48')]()[_0x7d24('0x49')](function(){return parseModelFields(_0x59c072,_0x454c4d);})[_0x7d24('0x49')](function(_0x21aba4){_0x474e68[_0x7d24('0x4a')][_0x7d24('0x41')](_0x21aba4);return parseTagParameter(_0x59c072['tag']);})[_0x7d24('0x49')](function(_0xec60db){_0x474e68[_0x7d24('0x4b')][_0x7d24('0x3d')][_0x7d24('0x41')](_0xec60db);return parseSearchFilter(_0x59c072['filter']);})['then'](function(_0x20c40e){_0x474e68['filter']=_0x20c40e;return _0x474e68;});}function checkListsRestrictions(_0x34eec9,_0x2f0bde,_0x46f10a){var _0x4697f0=squel[_0x7d24('0x20')]();return Promise['resolve']()[_0x7d24('0x49')](function(){if(_0x2f0bde[_0x7d24('0x5')]&&_0x34eec9['role']===_0x7d24('0x4')&&!_0x46f10a){return _0x34eec9[_0x7d24('0x4c')]({'attributes':['id'],'raw':!![]});}})[_0x7d24('0x49')](function(_0xb5dd68){if(_0xb5dd68){if(_0xb5dd68[_0x7d24('0x25')]===0x0){_0x4697f0['and'](_0x7d24('0x4d'));}else{_0x4697f0['and']('c.ListId\x20IN\x20?',_[_0x7d24('0x44')](_0xb5dd68,'id'));}}})[_0x7d24('0x49')](function(){return _0x4697f0;});}function buildContactsQuery(_0x361267,_0x13e152,_0x259ed8,_0x406a5a,_0x3ef3f4,_0x5cd35c){if(_0x13e152){_0x13e152=_0x259ed8[_0x7d24('0x4e')];}_0x361267=addFieldsToQuery(_0x361267,_0x13e152,_0x406a5a,_0x5cd35c,!![]);var _0xf4a912=squel[_0x7d24('0x7')]();_0xf4a912=addFieldsToQuery(_0xf4a912,_0x13e152,_0x406a5a,_0x5cd35c,![]);if(_0x406a5a||_0x5cd35c){_0x361267=applyJoinClauses(_0x361267,!![]);_0x361267[_0x7d24('0x4f')](_0x7d24('0x50'));if(_0x259ed8[_0x7d24('0x51')]){_0xf4a912['limit'](_0x259ed8[_0x7d24('0x51')]);}if(_0x259ed8['offset']){_0xf4a912[_0x7d24('0x52')](_0x259ed8[_0x7d24('0x52')]);}}else{_0xf4a912=applyJoinClauses(_0xf4a912,![]);_0xf4a912['group'](_0x7d24('0x53'));if(_0x259ed8[_0x7d24('0x51')]){_0x361267[_0x7d24('0x51')](_0x259ed8[_0x7d24('0x51')]);}if(_0x259ed8['offset']){_0x361267[_0x7d24('0x52')](_0x259ed8[_0x7d24('0x52')]);}}_0xf4a912[_0x7d24('0x54')](_0x3ef3f4);if(_0x259ed8[_0x7d24('0x55')]){_0x259ed8[_0x7d24('0x55')][_0x7d24('0x1c')](function(_0x2986de){_0x361267['order']('c.'+_0x2986de[0x0],_0x2986de[0x1]===_0x7d24('0x56')?![]:!![]);_0xf4a912[_0x7d24('0x55')]('subqry.'+_0x2986de[0x0],_0x2986de[0x1]===_0x7d24('0x56')?![]:!![]);});}_0xf4a912['from'](_0x361267,_0x7d24('0xb'));return _0xf4a912;}function getFilteredContacts(_0x3185ad){var _0x24c64c=[];return db[_0x7d24('0x3c')]['findAll']({'attributes':['id',_0x7d24('0x32'),_0x7d24('0x57')],'raw':!![]})[_0x7d24('0x49')](function(_0x7c4785){_0x24c64c=_[_0x7d24('0x58')](_0x7c4785,'id');var _0x2dfa50={'type':db[_0x7d24('0x59')]['QueryTypes'][_0x7d24('0x5a')],'model':db[_0x7d24('0x5b')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x7d24('0x5c')][_0x7d24('0x5d')](_0x3185ad[_0x7d24('0x5e')](),_0x2dfa50);})[_0x7d24('0x49')](function(_0x32780){_0x32780['forEach'](function(_0x42cff7){if(_0x42cff7[_0x7d24('0x1d')]){_0x42cff7[_0x7d24('0x5f')]=[];_0x42cff7[_0x7d24('0x1d')][_0x7d24('0x24')](',')['forEach'](function(_0x30829f){_0x42cff7[_0x7d24('0x5f')][_0x7d24('0x1b')](_0x24c64c[_0x30829f]);});}delete _0x42cff7[_0x7d24('0x1d')];});return _0x32780;});}function countFilteredContacts(_0x4619e7,_0x582a93){var _0x182532=_0x4619e7[_0x7d24('0x60')]();_0x182532['field'](_0x7d24('0x61'));_0x182532=applyJoinClauses(_0x182532,!![]);_0x4619e7['group'](_0x7d24('0x50'));var _0x2214c3=utils[_0x7d24('0x21')](_0x582a93);if(!_[_0x7d24('0x62')](_0x2214c3)){_0x182532['where']('t.id\x20IN\x20?',_0x2214c3);}var _0x2fa726={'type':db[_0x7d24('0x59')][_0x7d24('0x63')][_0x7d24('0x5a')],'raw':!![]};return db[_0x7d24('0x5c')][_0x7d24('0x5d')](_0x182532[_0x7d24('0x5e')](),_0x2fa726)['then'](function(_0x270fed){return _0x270fed[0x0][_0x7d24('0x61')];});}module[_0x7d24('0x64')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index aee1eb3..4f1759d 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 _0x2e68=['update','binary','write','end','final','close','decryptFile','createDecipher','data','unlink','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','createWriteStream','createCipher'];(function(_0x2dd264,_0x4a1627){var _0x1a659d=function(_0x2f6f44){while(--_0x2f6f44){_0x2dd264['push'](_0x2dd264['shift']());}};_0x1a659d(++_0x4a1627);}(_0x2e68,0x78));var _0x82e6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2e68[_0xbca1b1];return _0x4e1686;};'use strict';var crypto=require(_0x82e6('0x0'));var fs=require('fs');var BPromise=require(_0x82e6('0x1'));var _=require('lodash');var config=require(_0x82e6('0x2'));var logger=require(_0x82e6('0x3'))(_0x82e6('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x82e6('0x5')][_0x82e6('0x6')],'algorithm':_0x82e6('0x7')};const fileOptions={'algorithm':_0x82e6('0x8')};if(config[_0x82e6('0x9')]&&config[_0x82e6('0x9')][_0x82e6('0xa')]){var isSupported=isAlgorithmSupported(config[_0x82e6('0x9')][_0x82e6('0xa')]);if(isSupported){fileOptions[_0x82e6('0xa')]=config[_0x82e6('0x9')][_0x82e6('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x82e6('0xb')](',\x20');logger[_0x82e6('0xc')](config[_0x82e6('0x9')][_0x82e6('0xa')],_0x82e6('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x4cad82){return AES_SUPPORTED_RX[_0x82e6('0xe')](_0x4cad82);}function getSupportedCiphers(){return crypto[_0x82e6('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x2a2fbe){return getSupportedCiphers()[_0x82e6('0x10')](_0x2a2fbe)>-0x1;}function combineOptions(_0x51da1b){var _0x2e99bc={};for(var _0x3fc034 in fileOptions){if(fileOptions[_0x82e6('0x11')](_0x3fc034)){_0x2e99bc[_0x3fc034]=fileOptions[_0x3fc034];}}if(_0x51da1b){for(var _0x11c9a9 in _0x51da1b){if(_0x51da1b[_0x82e6('0x11')](_0x11c9a9)){_0x2e99bc[_0x11c9a9]=_0x51da1b[_0x11c9a9];}}}return _0x2e99bc;}exports['encryptFile']=function(_0x1ba429,_0x4f900c,_0x53fdc3,_0x1b077e){return new BPromise(function(_0x3f7fb8,_0xbcd7de){_0x1b077e=combineOptions(_0x1b077e);var _0x28065a=new Buffer(_0x53fdc3);var _0x362173=fs['createReadStream'](_0x1ba429);var _0x37b453=fs[_0x82e6('0x12')](_0x4f900c);var _0x452a0c=crypto[_0x82e6('0x13')](_0x1b077e[_0x82e6('0xa')],_0x28065a);_0x362173['on']('data',function(_0x4ea427){var _0x14d1c2=new Buffer(_0x452a0c[_0x82e6('0x14')](_0x4ea427),_0x82e6('0x15'));_0x37b453[_0x82e6('0x16')](_0x14d1c2);});_0x362173['on'](_0x82e6('0x17'),function(){try{var _0x225728=new Buffer(_0x452a0c[_0x82e6('0x18')](_0x82e6('0x15')),_0x82e6('0x15'));_0x37b453[_0x82e6('0x16')](_0x225728);_0x37b453['end']();_0x37b453['on'](_0x82e6('0x19'),function(){return _0x3f7fb8(_0x4f900c);});}catch(_0x1fba2d){fs['unlink'](_0x4f900c);return _0xbcd7de(_0x1fba2d);}});});};exports[_0x82e6('0x1a')]=function(_0x1cd68a,_0x35f48c,_0x3c96d1,_0x837fc){return new BPromise(function(_0x4e686b,_0x4c6340){_0x837fc=combineOptions(_0x837fc);var _0x87feb1=new Buffer(_0x3c96d1);var _0x5027a9=fs['createReadStream'](_0x1cd68a);var _0x4ea7ef=fs[_0x82e6('0x12')](_0x35f48c);var _0x1ff0ed=crypto[_0x82e6('0x1b')](_0x837fc[_0x82e6('0xa')],_0x87feb1);_0x5027a9['on'](_0x82e6('0x1c'),function(_0x5805cf){var _0x82f11b=new Buffer(_0x1ff0ed[_0x82e6('0x14')](_0x5805cf),'binary');_0x4ea7ef['write'](_0x82f11b);});_0x5027a9['on'](_0x82e6('0x17'),function(){try{var _0x2866ef=new Buffer(_0x1ff0ed['final'](_0x82e6('0x15')),_0x82e6('0x15'));_0x4ea7ef[_0x82e6('0x16')](_0x2866ef);_0x4ea7ef['end']();_0x4ea7ef['on'](_0x82e6('0x19'),function(){return _0x4e686b(_0x35f48c);});}catch(_0xe95409){fs[_0x82e6('0x1d')](_0x35f48c);return _0x4c6340(_0xe95409);}});});};exports[_0x82e6('0x1e')]=function(_0x7f784b,_0x40b04c,_0x5a3bd4){var _0x5c3722=_0x5a3bd4||stringOptions[_0x82e6('0xa')];var _0x13e748=_0x40b04c||stringOptions[_0x82e6('0x1f')];var _0x474732=crypto[_0x82e6('0x13')](_0x5c3722,_0x13e748);var _0x197043=_0x474732[_0x82e6('0x14')](_0x7f784b,_0x82e6('0x20'),_0x82e6('0x21'));_0x197043+=_0x474732[_0x82e6('0x18')](_0x82e6('0x21'));return _0x197043;};exports[_0x82e6('0x22')]=function(_0x5624f5,_0x2712da,_0x1f8b0a){var _0x487faa=_0x1f8b0a||stringOptions[_0x82e6('0xa')];var _0x4d585a=_0x2712da||stringOptions['secret'];var _0x5b033b=crypto[_0x82e6('0x1b')](_0x487faa,_0x4d585a);var _0x493bf8=_0x5b033b['update'](_0x5624f5,_0x82e6('0x21'),_0x82e6('0x20'));_0x493bf8+=_0x5b033b[_0x82e6('0x18')]('utf8');return _0x493bf8;}; \ No newline at end of file +var _0x7ac9=['binary','write','end','final','close','unlink','decryptFile','createDecipher','data','encryptString','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','update'];(function(_0x31d5ef,_0x1ee41a){var _0x50e022=function(_0x49362e){while(--_0x49362e){_0x31d5ef['push'](_0x31d5ef['shift']());}};_0x50e022(++_0x1ee41a);}(_0x7ac9,0x13f));var _0x97ac=function(_0x5ef6e0,_0x523f9a){_0x5ef6e0=_0x5ef6e0-0x0;var _0x531094=_0x7ac9[_0x5ef6e0];return _0x531094;};'use strict';var crypto=require(_0x97ac('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x97ac('0x1'));var config=require(_0x97ac('0x2'));var logger=require(_0x97ac('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x97ac('0x4')],'algorithm':_0x97ac('0x5')};const fileOptions={'algorithm':_0x97ac('0x6')};if(config['encrypt']&&config[_0x97ac('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x97ac('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x97ac('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x97ac('0x9')](',\x20');logger[_0x97ac('0xa')](config[_0x97ac('0x7')][_0x97ac('0x8')],_0x97ac('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x422bce){return AES_SUPPORTED_RX[_0x97ac('0xc')](_0x422bce);}function getSupportedCiphers(){return crypto[_0x97ac('0xd')]()[_0x97ac('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x31f071){return getSupportedCiphers()[_0x97ac('0xf')](_0x31f071)>-0x1;}function combineOptions(_0x30dd05){var _0x259665={};for(var _0x3a4187 in fileOptions){if(fileOptions[_0x97ac('0x10')](_0x3a4187)){_0x259665[_0x3a4187]=fileOptions[_0x3a4187];}}if(_0x30dd05){for(var _0x585049 in _0x30dd05){if(_0x30dd05[_0x97ac('0x10')](_0x585049)){_0x259665[_0x585049]=_0x30dd05[_0x585049];}}}return _0x259665;}exports[_0x97ac('0x11')]=function(_0x368894,_0x1853c9,_0x4a2504,_0x4328d6){return new BPromise(function(_0x2f5e40,_0x5d4016){_0x4328d6=combineOptions(_0x4328d6);var _0x4b6a53=new Buffer(_0x4a2504);var _0x211a9a=fs[_0x97ac('0x12')](_0x368894);var _0x181cb8=fs[_0x97ac('0x13')](_0x1853c9);var _0x5146da=crypto['createCipher'](_0x4328d6['algorithm'],_0x4b6a53);_0x211a9a['on']('data',function(_0x9c5155){var _0x496c66=new Buffer(_0x5146da[_0x97ac('0x14')](_0x9c5155),_0x97ac('0x15'));_0x181cb8[_0x97ac('0x16')](_0x496c66);});_0x211a9a['on'](_0x97ac('0x17'),function(){try{var _0x56260c=new Buffer(_0x5146da[_0x97ac('0x18')](_0x97ac('0x15')),_0x97ac('0x15'));_0x181cb8[_0x97ac('0x16')](_0x56260c);_0x181cb8['end']();_0x181cb8['on'](_0x97ac('0x19'),function(){return _0x2f5e40(_0x1853c9);});}catch(_0x30c6ad){fs[_0x97ac('0x1a')](_0x1853c9);return _0x5d4016(_0x30c6ad);}});});};exports[_0x97ac('0x1b')]=function(_0x19bc54,_0x2793bc,_0x12043f,_0x2bf0ef){return new BPromise(function(_0x3cff07,_0x363c75){_0x2bf0ef=combineOptions(_0x2bf0ef);var _0x284a77=new Buffer(_0x12043f);var _0x6bb5f9=fs['createReadStream'](_0x19bc54);var _0x498ea7=fs[_0x97ac('0x13')](_0x2793bc);var _0x160681=crypto[_0x97ac('0x1c')](_0x2bf0ef[_0x97ac('0x8')],_0x284a77);_0x6bb5f9['on'](_0x97ac('0x1d'),function(_0x2bb29d){var _0x392bf5=new Buffer(_0x160681[_0x97ac('0x14')](_0x2bb29d),_0x97ac('0x15'));_0x498ea7[_0x97ac('0x16')](_0x392bf5);});_0x6bb5f9['on'](_0x97ac('0x17'),function(){try{var _0x169c07=new Buffer(_0x160681[_0x97ac('0x18')]('binary'),_0x97ac('0x15'));_0x498ea7[_0x97ac('0x16')](_0x169c07);_0x498ea7[_0x97ac('0x17')]();_0x498ea7['on']('close',function(){return _0x3cff07(_0x2793bc);});}catch(_0x2d101c){fs[_0x97ac('0x1a')](_0x2793bc);return _0x363c75(_0x2d101c);}});});};exports[_0x97ac('0x1e')]=function(_0x401b65,_0x717a8d,_0x5e0e2e){var _0x4012c8=_0x5e0e2e||stringOptions[_0x97ac('0x8')];var _0x83af29=_0x717a8d||stringOptions['secret'];var _0x395cc3=crypto['createCipher'](_0x4012c8,_0x83af29);var _0x150f74=_0x395cc3[_0x97ac('0x14')](_0x401b65,_0x97ac('0x1f'),'base64');_0x150f74+=_0x395cc3[_0x97ac('0x18')](_0x97ac('0x20'));return _0x150f74;};exports[_0x97ac('0x21')]=function(_0x24a2bd,_0x54b4e8,_0x396545){var _0x5a5c7e=_0x396545||stringOptions[_0x97ac('0x8')];var _0x520ebd=_0x54b4e8||stringOptions['secret'];var _0x574fd1=crypto[_0x97ac('0x1c')](_0x5a5c7e,_0x520ebd);var _0xcc6712=_0x574fd1[_0x97ac('0x14')](_0x24a2bd,'base64',_0x97ac('0x1f'));_0xcc6712+=_0x574fd1['final']('utf8');return _0xcc6712;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7ce2948..af7b55d 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 _0x6211=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','basename','.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','util','path','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x6211,0xe8));var _0x1621=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6211[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x1621('0x0'));var path=require(_0x1621('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x1621('0x2'));var zipdir=require(_0x1621('0x3'));var rimraf=require(_0x1621('0x4'));var db=require(_0x1621('0x5'))['db'];var dbH=require(_0x1621('0x5'))[_0x1621('0x6')];var logger=require(_0x1621('0x7'))(_0x1621('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x1621('0x9')][0x2]);var QUERY=process[_0x1621('0x9')][0x3];var PATH=process[_0x1621('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4cc5b8,_0x24b7f9){var _0x1ceacb={'status':_0x4cc5b8};var _0x2644a4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24b7f9){_0x1ceacb[_0x1621('0xa')]=_0x24b7f9;}return db[_0x1621('0xb')][_0x1621('0xc')](_0x1ceacb,_0x2644a4);}function main(){var _0x500016=0x1388;var _0x34d249;logger[_0x1621('0xd')](util[_0x1621('0xe')](_0x1621('0xf'),EXTRACTED_REPORT_ID,_0x1621('0x10')));return db[_0x1621('0x11')][_0x1621('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1621('0x13'),_0x1621('0x14')]})['then'](function(_0x3c3267){if(_0x3c3267){_0x34d249=_0x3c3267;_0x500016=_0x34d249[_0x1621('0x14')]||0x1388;}})[_0x1621('0x15')](function(){return dbH[_0x1621('0x16')]['query'](util['format'](_0x1621('0x17'),QUERY),{'type':dbH[_0x1621('0x16')][_0x1621('0x18')][_0x1621('0x19')]});})[_0x1621('0x15')](function(_0x206485){if(!_0x206485[0x0][_0x1621('0x1a')]){return analyticExtractedReport(_0x1621('0x1b'));}var _0x28cb28=[];var _0x3e8f08=0x0;if(_0x34d249['split']){if(_0x206485&&_0x206485[_0x1621('0x1c')]){var _0x165db0=_[_0x1621('0x1d')](_0x206485[0x0][_0x1621('0x1a')]/_0x500016);var _0x10af87=Number[_0x1621('0x1e')](_0x206485[0x0][_0x1621('0x1a')]/_0x500016)?_0x206485[0x0][_0x1621('0x1a')]%_0x500016:0x0;_0x165db0['forEach'](function(_0x11c403){if(_0x11c403>0x0){_0x3e8f08+=_0x500016;}_0x28cb28[_0x1621('0x1f')](dbH['sequelize']['query'](util['format'](_0x1621('0x20'),QUERY,_0x500016,_0x3e8f08),{'type':dbH[_0x1621('0x16')][_0x1621('0x18')][_0x1621('0x19')]}));});if(_0x10af87>0x0){_0x3e8f08+=_0x500016;_0x28cb28[_0x1621('0x1f')](dbH[_0x1621('0x16')]['query'](util[_0x1621('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x10af87,_0x3e8f08),{'type':dbH[_0x1621('0x16')][_0x1621('0x18')][_0x1621('0x19')]}));}}}else{_0x28cb28[_0x1621('0x1f')](dbH[_0x1621('0x16')][_0x1621('0x21')](QUERY,{'type':dbH[_0x1621('0x16')][_0x1621('0x18')]['SELECT']}));}var _0x47a7d4=path['dirname'](PATH);var _0x4852b3=path[_0x1621('0x22')](PATH,_0x1621('0x23'));var _0x49e572=_0x34d249[_0x1621('0x13')]&&_0x28cb28[_0x1621('0x1c')]>0x1;var _0x19861f=[];if(!fs['existsSync'](path[_0x1621('0x24')](_0x47a7d4,_0x4852b3))&&_0x49e572){fs[_0x1621('0x25')](path[_0x1621('0x24')](_0x47a7d4,_0x4852b3));}return BPromise[_0x1621('0x26')](_0x28cb28,function(_0x3dfc10){_0x19861f['push'](_0x3dfc10);})['then'](function(){for(var _0x25e5f0=0x0;_0x25e5f0<_0x19861f[_0x1621('0x1c')];_0x25e5f0+=0x1){var _0x33d1d0;var _0x3856f7=_0x19861f[_0x25e5f0];if(_0x49e572){_0x33d1d0=path[_0x1621('0x24')](_0x47a7d4,_0x4852b3,util[_0x1621('0xe')](_0x1621('0x27'),_0x4852b3,_0x25e5f0,_0x1621('0x28')));}else{_0x33d1d0=path[_0x1621('0x24')](_0x47a7d4,util[_0x1621('0xe')](_0x1621('0x29'),_0x4852b3,_0x1621('0x28')));}fs[_0x1621('0x2a')](_0x33d1d0,csv(_0x3856f7));}})[_0x1621('0x15')](function(){if(_0x49e572){return new Promise(function(_0x2d436e){zipdir(path[_0x1621('0x24')](_0x47a7d4,_0x4852b3),{'saveTo':path[_0x1621('0x24')](_0x47a7d4,util[_0x1621('0xe')]('%s.%s',_0x4852b3,_0x1621('0x2b')))},function(_0x47aff8,_0x27242a){rimraf(path['join'](_0x47a7d4,_0x4852b3),function(){});_0x2d436e(_0x1621('0x2c'));});});}})[_0x1621('0x15')](function(){logger['info'](util[_0x1621('0xe')](_0x1621('0x2d'),EXTRACTED_REPORT_ID,_0x1621('0x10')));return analyticExtractedReport(_0x1621('0x2e'),_0x49e572?util[_0x1621('0xe')]('%s.%s',_0x4852b3,_0x49e572?_0x1621('0x2b'):_0x1621('0x28')):null);});})[_0x1621('0x2f')](function(_0x5233a2){logger[_0x1621('0xd')](util[_0x1621('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1621('0x10')),util[_0x1621('0x30')](_0x5233a2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1621('0x31'));})[_0x1621('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x17d3=['Setting','find','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info'];(function(_0x3b0a84,_0x418c04){var _0x3099dd=function(_0x393ff6){while(--_0x393ff6){_0x3b0a84['push'](_0x3b0a84['shift']());}};_0x3099dd(++_0x418c04);}(_0x17d3,0xb9));var _0x317d=function(_0x49e02a,_0xd68211){_0x49e02a=_0x49e02a-0x0;var _0x1b923d=_0x17d3[_0x49e02a];return _0x1b923d;};'use strict';var util=require('util');var path=require('path');var _=require(_0x317d('0x0'));var csv=require(_0x317d('0x1'));var fs=require('fs');var BPromise=require(_0x317d('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x317d('0x3'));var db=require(_0x317d('0x4'))['db'];var dbH=require(_0x317d('0x4'))[_0x317d('0x5')];var logger=require(_0x317d('0x6'))(_0x317d('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x317d('0x8')][0x2]);var QUERY=process[_0x317d('0x8')][0x3];var PATH=process[_0x317d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18a950,_0x2718a6){var _0x317ad1={'status':_0x18a950};var _0x38a5e1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2718a6){_0x317ad1['savename']=_0x2718a6;}return db[_0x317d('0x9')]['update'](_0x317ad1,_0x38a5e1);}function main(){var _0x474da6=0x1388;var _0x4be897;logger[_0x317d('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x317d('0xb')][_0x317d('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x317d('0xd'),_0x317d('0xe')]})[_0x317d('0xf')](function(_0x5540e4){if(_0x5540e4){_0x4be897=_0x5540e4;_0x474da6=_0x4be897[_0x317d('0xe')]||0x1388;}})[_0x317d('0xf')](function(){return dbH['sequelize'][_0x317d('0x10')](util[_0x317d('0x11')](_0x317d('0x12'),QUERY),{'type':dbH[_0x317d('0x13')][_0x317d('0x14')][_0x317d('0x15')]});})[_0x317d('0xf')](function(_0x153b2f){if(!_0x153b2f[0x0][_0x317d('0x16')]){return analyticExtractedReport('Empty');}var _0x2e96ba=[];var _0x5ab7a8=0x0;if(_0x4be897['split']){if(_0x153b2f&&_0x153b2f['length']){var _0x2abced=_[_0x317d('0x17')](_0x153b2f[0x0][_0x317d('0x16')]/_0x474da6);var _0x9b4c1a=Number[_0x317d('0x18')](_0x153b2f[0x0][_0x317d('0x16')]/_0x474da6)?_0x153b2f[0x0][_0x317d('0x16')]%_0x474da6:0x0;_0x2abced[_0x317d('0x19')](function(_0x35d8de){if(_0x35d8de>0x0){_0x5ab7a8+=_0x474da6;}_0x2e96ba[_0x317d('0x1a')](dbH['sequelize'][_0x317d('0x10')](util[_0x317d('0x11')](_0x317d('0x1b'),QUERY,_0x474da6,_0x5ab7a8),{'type':dbH[_0x317d('0x13')]['QueryTypes'][_0x317d('0x15')]}));});if(_0x9b4c1a>0x0){_0x5ab7a8+=_0x474da6;_0x2e96ba['push'](dbH['sequelize'][_0x317d('0x10')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x9b4c1a,_0x5ab7a8),{'type':dbH[_0x317d('0x13')][_0x317d('0x14')][_0x317d('0x15')]}));}}}else{_0x2e96ba['push'](dbH[_0x317d('0x13')][_0x317d('0x10')](QUERY,{'type':dbH[_0x317d('0x13')][_0x317d('0x14')][_0x317d('0x15')]}));}var _0x539f92=path[_0x317d('0x1c')](PATH);var _0x2593f9=path[_0x317d('0x1d')](PATH,_0x317d('0x1e'));var _0x2eb005=_0x4be897[_0x317d('0xd')]&&_0x2e96ba[_0x317d('0x1f')]>0x1;var _0x177569=[];if(!fs[_0x317d('0x20')](path[_0x317d('0x21')](_0x539f92,_0x2593f9))&&_0x2eb005){fs[_0x317d('0x22')](path[_0x317d('0x21')](_0x539f92,_0x2593f9));}return BPromise[_0x317d('0x23')](_0x2e96ba,function(_0x15ee3f){_0x177569[_0x317d('0x1a')](_0x15ee3f);})['then'](function(){for(var _0x522eab=0x0;_0x522eab<_0x177569['length'];_0x522eab+=0x1){var _0x421b4e;var _0x1cc78b=_0x177569[_0x522eab];if(_0x2eb005){_0x421b4e=path[_0x317d('0x21')](_0x539f92,_0x2593f9,util[_0x317d('0x11')](_0x317d('0x24'),_0x2593f9,_0x522eab,_0x317d('0x25')));}else{_0x421b4e=path[_0x317d('0x21')](_0x539f92,util[_0x317d('0x11')](_0x317d('0x26'),_0x2593f9,'csv'));}fs[_0x317d('0x27')](_0x421b4e,csv(_0x1cc78b));}})['then'](function(){if(_0x2eb005){return new Promise(function(_0xad6148){zipdir(path[_0x317d('0x21')](_0x539f92,_0x2593f9),{'saveTo':path[_0x317d('0x21')](_0x539f92,util[_0x317d('0x11')](_0x317d('0x26'),_0x2593f9,_0x317d('0x28')))},function(_0x1c8a5c,_0x15844a){rimraf(path[_0x317d('0x21')](_0x539f92,_0x2593f9),function(){});_0xad6148(_0x317d('0x29'));});});}})[_0x317d('0xf')](function(){logger[_0x317d('0xa')](util['format'](_0x317d('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x317d('0x2b'),_0x2eb005?util[_0x317d('0x11')]('%s.%s',_0x2593f9,_0x2eb005?_0x317d('0x28'):_0x317d('0x25')):null);});})[_0x317d('0x2c')](function(_0x1f770c){logger[_0x317d('0xa')](util[_0x317d('0x11')](_0x317d('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0x317d('0x2e')](_0x1f770c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x317d('0x2f'));})[_0x317d('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c14d3da..47540ab 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 _0x8861=['JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','savename','tableHeader','map','toString','value','fill','length','auto','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','push','header','before','landscape','\x20/\x20','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom'];(function(_0x4c32d8,_0x4c3af2){var _0x5d205c=function(_0x5812eb){while(--_0x5812eb){_0x4c32d8['push'](_0x4c32d8['shift']());}};_0x5d205c(++_0x4c3af2);}(_0x8861,0x106));var _0x1886=function(_0x7220f4,_0x5ac632){_0x7220f4=_0x7220f4-0x0;var _0x5e4f9f=_0x8861[_0x7220f4];return _0x5e4f9f;};'use strict';var _=require(_0x1886('0x0'));var fs=require('fs');var util=require(_0x1886('0x1'));var path=require(_0x1886('0x2'));var moment=require(_0x1886('0x3'));var htmlToPdfmake=require(_0x1886('0x4'));var PdfPrinter=require(_0x1886('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x1886('0x6'));var JSDOM=require(_0x1886('0x7'))[_0x1886('0x8')];var window=new JSDOM('')[_0x1886('0x9')];var BPromise=require(_0x1886('0xa'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x1886('0xb')];var logger=require(_0x1886('0xc'))(_0x1886('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x1886('0xe')][0x2]);var QUERY=process[_0x1886('0xe')][0x3];var PATH=process[_0x1886('0xe')][0x4];var NAME=process[_0x1886('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d190c,_0x4a7082){var _0x5b738a={'status':_0x5d190c};var _0x2b7224={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a7082){_0x5b738a[_0x1886('0xf')]=_0x4a7082;}return db['AnalyticExtractedReport']['update'](_0x5b738a,_0x2b7224);}function getHeaders(_0x585dde){return _['map'](_0x585dde,function(_0x53befe){return{'text':_0x53befe,'style':_0x1886('0x10')};});}function getRows(_0x80fc41,_0x236f65){return _[_0x1886('0x11')](_0x236f65,function(_0x555734){return _(_0x555734)['pick'](_0x80fc41)['map'](function(_0x593dd4){return _0x593dd4?_[_0x1886('0x12')](_0x593dd4):'';})[_0x1886('0x13')]();});}function createTable(_0x3e8255,_0x422d33){var _0x1f8caf={'widths':_[_0x1886('0x14')](Array(_0x3e8255[_0x1886('0x15')]),0x91),'heights':function(_0x374274){return _0x374274===0x0?_0x1886('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2de372=getHeaders(_0x3e8255);_0x1f8caf[_0x1886('0x17')]['push'](_0x2de372);var _0xa42190=getRows(_0x3e8255,_0x422d33);_0x1f8caf[_0x1886('0x17')]=_0x1f8caf[_0x1886('0x17')]['concat'](_0xa42190);return _0x1f8caf;}function createTables(_0x2677e7){var _0x481640=[];var _0x4a4d6a=_['chunk'](Object[_0x1886('0x18')](_0x2677e7[0x0]),0x5);_0x4a4d6a[_0x1886('0x19')](function(_0x45c316){_0x481640['push'](createTable(_0x45c316,_0x2677e7));});return _0x481640;}function getPDFDocDefinition(_0x327363){var _0x272ada=util[_0x1886('0x1a')](_0x1886('0x1b'),NAME,EXTRACTED_REPORT[_0x1886('0x1c')],moment(EXTRACTED_REPORT[_0x1886('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x1886('0x1e')])[_0x1886('0x1a')](FORMAT));var _0x23453f=[];for(var _0x41ed71=0x0;_0x41ed71<_0x327363[_0x1886('0x15')];_0x41ed71++){var _0x2e3bde=[];if(_0x41ed71===0x0){_0x2e3bde[_0x1886('0x1f')]({'text':_0x272ada,'style':_0x1886('0x20')});}var _0x184c94={'table':_0x327363[_0x41ed71]};if(_0x41ed71>0x0){_0x184c94['pageBreak']=_0x1886('0x21');_0x184c94['margin']=[0x0,0x46,0x0,0x0];}_0x2e3bde['push'](_0x184c94);_0x23453f[_0x1886('0x1f')](_0x2e3bde);}return{'pageSize':'A4','pageOrientation':_0x1886('0x22'),'content':_0x23453f,'footer':function(_0x29a3ad,_0x4111e6){return{'text':_0x29a3ad[_0x1886('0x12')]()+_0x1886('0x23')+_0x4111e6,'style':'footer'};},'defaultStyle':{'font':_0x1886('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x1886('0x25')},'footer':{'alignment':_0x1886('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4b2ba8){var _0x395066=0x1388;var _0x3a2cfe;if(!_0x4b2ba8[0x0][_0x1886('0x27')]){return analyticExtractedReport(_0x1886('0x28'));}return db[_0x1886('0x29')][_0x1886('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1886('0x2b'),_0x1886('0x2c')]})[_0x1886('0x2d')](function(_0x5d81c5){if(_0x5d81c5){_0x3a2cfe=_0x5d81c5;_0x395066=_0x3a2cfe[_0x1886('0x2c')]||0x3e8;}})[_0x1886('0x2d')](function(){var _0x19e3d9=[];var _0x3a402c=0x0;if(_0x3a2cfe[_0x1886('0x2b')]){if(_0x4b2ba8&&_0x4b2ba8[_0x1886('0x15')]){var _0x451a7f=_['range'](_0x4b2ba8[0x0][_0x1886('0x27')]/_0x395066);var _0x1384b6=Number[_0x1886('0x2e')](_0x4b2ba8[0x0][_0x1886('0x27')]/_0x395066)?_0x4b2ba8[0x0][_0x1886('0x27')]%_0x395066:0x0;_0x451a7f[_0x1886('0x19')](function(_0x53a971){if(_0x53a971>0x0){_0x3a402c+=_0x395066;}_0x19e3d9['push'](dbH[_0x1886('0x2f')][_0x1886('0x30')](util[_0x1886('0x1a')](_0x1886('0x31'),QUERY,_0x395066,_0x3a402c),{'type':dbH['sequelize'][_0x1886('0x32')]['SELECT']}));});if(_0x1384b6>0x0){_0x3a402c+=_0x395066;_0x19e3d9[_0x1886('0x1f')](dbH[_0x1886('0x2f')][_0x1886('0x30')](util[_0x1886('0x1a')](_0x1886('0x31'),QUERY,_0x1384b6,_0x3a402c),{'type':dbH['sequelize'][_0x1886('0x32')][_0x1886('0x33')]}));}}}else{_0x19e3d9[_0x1886('0x1f')](dbH['sequelize'][_0x1886('0x30')](QUERY,{'type':dbH[_0x1886('0x2f')][_0x1886('0x32')]['SELECT']}));}var _0x540a82=path[_0x1886('0x34')](PATH);var _0x4f7f9b=path[_0x1886('0x35')](PATH,'.pdf');var _0x5836b3=_0x3a2cfe['split']&&_0x19e3d9['length']>0x1;var _0xd4b4a5=[];if(!fs['existsSync'](path[_0x1886('0x36')](_0x540a82,_0x4f7f9b))&&_0x5836b3){fs[_0x1886('0x37')](path[_0x1886('0x36')](_0x540a82,_0x4f7f9b));}return BPromise[_0x1886('0x38')](_0x19e3d9,function(_0x1ee407){_0xd4b4a5['push'](_0x1ee407);})[_0x1886('0x2d')](function(){var _0x2c3c6c=[];for(var _0xefe8f7=0x0;_0xefe8f7<_0xd4b4a5['length'];_0xefe8f7+=0x1){var _0x4b0fc8=_0xd4b4a5[_0xefe8f7];var _0xa5403d=createTables(_[_0x1886('0x39')](_0x4b0fc8));var _0x5c379a;var _0x1be73f=getPDFDocDefinition(_0xa5403d);var _0xab37e8=getPDFPrinter();var _0x570ec0=_0xab37e8['createPdfKitDocument'](_0x1be73f);if(_0x5836b3){_0x5c379a=path[_0x1886('0x36')](_0x540a82,_0x4f7f9b,util['format'](_0x1886('0x3a'),_0x4f7f9b,_0xefe8f7,_0x1886('0x3b')));}else{_0x5c379a=path[_0x1886('0x36')](_0x540a82,util[_0x1886('0x1a')](_0x1886('0x3c'),_0x4f7f9b,_0x1886('0x3b')));}_0x2c3c6c['push'](writePDFDocument(_0x570ec0,_0x5c379a));}return Promise['all'](_0x2c3c6c);})[_0x1886('0x2d')](function(){if(_0x5836b3){return new Promise(function(_0x35bd2a){zipdir(path[_0x1886('0x36')](_0x540a82,_0x4f7f9b),{'saveTo':path[_0x1886('0x36')](_0x540a82,util[_0x1886('0x1a')](_0x1886('0x3c'),_0x4f7f9b,'zip'))},function(){rimraf(path[_0x1886('0x36')](_0x540a82,_0x4f7f9b),function(){});_0x35bd2a(_0x1886('0x3d'));});});}})[_0x1886('0x2d')](function(){if(!_0x5836b3)return;rimraf(path[_0x1886('0x36')](_0x540a82,_0x4f7f9b),function(){});})[_0x1886('0x2d')](function(){logger[_0x1886('0x3e')](util[_0x1886('0x1a')](_0x1886('0x3f'),EXTRACTED_REPORT_ID,_0x1886('0x40')));return analyticExtractedReport('Completed',_0x5836b3?util[_0x1886('0x1a')](_0x1886('0x3c'),_0x4f7f9b,_0x5836b3?_0x1886('0x41'):_0x1886('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1886('0x3e')](util[_0x1886('0x1a')](_0x1886('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x1886('0x43')][_0x1886('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1886('0x2d')](function(_0x5175b){EXTRACTED_REPORT=_0x5175b;return dbH[_0x1886('0x2f')][_0x1886('0x30')](util[_0x1886('0x1a')](_0x1886('0x45'),QUERY),{'type':dbH[_0x1886('0x2f')]['QueryTypes'][_0x1886('0x33')]});})[_0x1886('0x2d')](extractReport)[_0x1886('0x46')](function(_0x380774){logger[_0x1886('0x3e')](util[_0x1886('0x1a')](_0x1886('0x47'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x380774,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1886('0x48'));})[_0x1886('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x20dc9e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x1886('0x4a'),'italics':__dirname+_0x1886('0x4b'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x20dc9e;}function getPDFDocDefinitionFromHTML(_0x3b9a23,_0x20b1ab){var _0x36844b=util[_0x1886('0x1a')]('%s\x20#%d',_0x20b1ab[_0x1886('0x4c')],_0x20b1ab[_0x1886('0x4d')]);var _0x478a44=moment()[_0x1886('0x1a')](_0x1886('0x4e'))[_0x1886('0x12')]();var _0x382e6b=htmlToPdfmake(_0x3b9a23,{'window':window,'tableAutoSize':!![]});return{'content':[_0x382e6b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1886('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x1886('0x50'),'style':_0x1886('0x20')}];},'footer':function(_0x3bc7fb,_0x27212b){return[{'text':util[_0x1886('0x1a')](_0x1886('0x51'),_0x36844b,_0x3bc7fb,_0x27212b,_0x478a44),'style':_0x1886('0x52')}];}};}function writePDFDocument(_0x29d452,_0x565bbf){return new Promise(function(_0x22c8ad,_0x32960c){var _0x5b59de=_0x29d452[_0x1886('0x53')](fs[_0x1886('0x54')](_0x565bbf));_0x5b59de['on'](_0x1886('0x55'),function(){_0x22c8ad(_0x1886('0x55'));});_0x5b59de['on'](_0x1886('0x56'),function(_0x53df91){_0x32960c(_0x53df91);});_0x29d452[_0x1886('0x57')]();});}exports[_0x1886('0x58')]=function(_0x2a56ae,_0x4fec73){var _0x30bbf7=getPDFPrinter();var _0x139c86=getPDFDocDefinitionFromHTML(_0x2a56ae,_0x4fec73);var _0x146095=_0x30bbf7[_0x1886('0x59')](_0x139c86);return writePDFDocument(_0x146095,_0x4fec73[_0x1886('0x2')])[_0x1886('0x46')](function(_0x35da14){throw _0x35da14;});}; \ No newline at end of file +var _0x78c6=['PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','util','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','value','auto','body','push','chunk','keys','forEach','format','name','startDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','sequelize','dirname','basename','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info'];(function(_0x23b1a1,_0x2a13a2){var _0x59a1a1=function(_0x36a067){while(--_0x36a067){_0x23b1a1['push'](_0x23b1a1['shift']());}};_0x59a1a1(++_0x2a13a2);}(_0x78c6,0x77));var _0x678c=function(_0x357adf,_0x2a365a){_0x357adf=_0x357adf-0x0;var _0x1dc55d=_0x78c6[_0x357adf];return _0x1dc55d;};'use strict';var _=require(_0x678c('0x0'));var fs=require('fs');var util=require(_0x678c('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x678c('0x2'));var zipdir=require(_0x678c('0x3'));var rimraf=require(_0x678c('0x4'));var JSDOM=require('jsdom')[_0x678c('0x5')];var window=new JSDOM('')[_0x678c('0x6')];var BPromise=require(_0x678c('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0x678c('0x8'))[_0x678c('0x9')];var logger=require(_0x678c('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x678c('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x678c('0xb')][0x5];var FORMAT=_0x678c('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x36442e,_0x2ce773){var _0x2bd81c={'status':_0x36442e};var _0x131489={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ce773){_0x2bd81c[_0x678c('0xd')]=_0x2ce773;}return db[_0x678c('0xe')][_0x678c('0xf')](_0x2bd81c,_0x131489);}function getHeaders(_0x4882a3){return _[_0x678c('0x10')](_0x4882a3,function(_0x2fbd88){return{'text':_0x2fbd88,'style':_0x678c('0x11')};});}function getRows(_0x234eb2,_0x33f5ea){return _['map'](_0x33f5ea,function(_0x1399bf){return _(_0x1399bf)['pick'](_0x234eb2)[_0x678c('0x10')](function(_0x1c89bb){return _0x1c89bb?_['toString'](_0x1c89bb):'';})[_0x678c('0x12')]();});}function createTable(_0x5707b5,_0x4490b5){var _0x589e0d={'widths':_['fill'](Array(_0x5707b5['length']),0x91),'heights':function(_0x3e954a){return _0x3e954a===0x0?_0x678c('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x107326=getHeaders(_0x5707b5);_0x589e0d[_0x678c('0x14')][_0x678c('0x15')](_0x107326);var _0x33662b=getRows(_0x5707b5,_0x4490b5);_0x589e0d[_0x678c('0x14')]=_0x589e0d[_0x678c('0x14')]['concat'](_0x33662b);return _0x589e0d;}function createTables(_0x408248){var _0x48d405=[];var _0x4c2026=_[_0x678c('0x16')](Object[_0x678c('0x17')](_0x408248[0x0]),0x5);_0x4c2026[_0x678c('0x18')](function(_0x4cbd3c){_0x48d405[_0x678c('0x15')](createTable(_0x4cbd3c,_0x408248));});return _0x48d405;}function getPDFDocDefinition(_0x3d7654){var _0x2bb23d=util[_0x678c('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x678c('0x1a')],moment(EXTRACTED_REPORT[_0x678c('0x1b')])[_0x678c('0x19')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x176707=[];for(var _0x34216c=0x0;_0x34216c<_0x3d7654['length'];_0x34216c++){var _0x3c71f4=[];if(_0x34216c===0x0){_0x3c71f4[_0x678c('0x15')]({'text':_0x2bb23d,'style':_0x678c('0x1c')});}var _0x4baf5b={'table':_0x3d7654[_0x34216c]};if(_0x34216c>0x0){_0x4baf5b[_0x678c('0x1d')]=_0x678c('0x1e');_0x4baf5b[_0x678c('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3c71f4[_0x678c('0x15')](_0x4baf5b);_0x176707[_0x678c('0x15')](_0x3c71f4);}return{'pageSize':'A4','pageOrientation':_0x678c('0x20'),'content':_0x176707,'footer':function(_0x31f335,_0x1ff3db){return{'text':_0x31f335[_0x678c('0x21')]()+_0x678c('0x22')+_0x1ff3db,'style':_0x678c('0x23')};},'defaultStyle':{'font':_0x678c('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x678c('0x25')},'footer':{'alignment':_0x678c('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x58430b){var _0x17605b=0x1388;var _0x47b1c2;if(!_0x58430b[0x0][_0x678c('0x27')]){return analyticExtractedReport(_0x678c('0x28'));}return db[_0x678c('0x29')][_0x678c('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x678c('0x2b'),_0x678c('0x2c')]})['then'](function(_0x1d6d9b){if(_0x1d6d9b){_0x47b1c2=_0x1d6d9b;_0x17605b=_0x47b1c2[_0x678c('0x2c')]||0x3e8;}})[_0x678c('0x2d')](function(){var _0x1761d8=[];var _0x3aebca=0x0;if(_0x47b1c2[_0x678c('0x2b')]){if(_0x58430b&&_0x58430b[_0x678c('0x2e')]){var _0x3f5192=_[_0x678c('0x2f')](_0x58430b[0x0][_0x678c('0x27')]/_0x17605b);var _0x2a6eea=Number[_0x678c('0x30')](_0x58430b[0x0][_0x678c('0x27')]/_0x17605b)?_0x58430b[0x0][_0x678c('0x27')]%_0x17605b:0x0;_0x3f5192[_0x678c('0x18')](function(_0x323ebd){if(_0x323ebd>0x0){_0x3aebca+=_0x17605b;}_0x1761d8[_0x678c('0x15')](dbH['sequelize']['query'](util['format'](_0x678c('0x31'),QUERY,_0x17605b,_0x3aebca),{'type':dbH['sequelize'][_0x678c('0x32')][_0x678c('0x33')]}));});if(_0x2a6eea>0x0){_0x3aebca+=_0x17605b;_0x1761d8[_0x678c('0x15')](dbH['sequelize'][_0x678c('0x34')](util[_0x678c('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2a6eea,_0x3aebca),{'type':dbH[_0x678c('0x35')][_0x678c('0x32')][_0x678c('0x33')]}));}}}else{_0x1761d8[_0x678c('0x15')](dbH[_0x678c('0x35')][_0x678c('0x34')](QUERY,{'type':dbH[_0x678c('0x35')][_0x678c('0x32')][_0x678c('0x33')]}));}var _0x2b32d3=path[_0x678c('0x36')](PATH);var _0x1c5175=path[_0x678c('0x37')](PATH,'.pdf');var _0x3b898a=_0x47b1c2[_0x678c('0x2b')]&&_0x1761d8['length']>0x1;var _0x17c9af=[];if(!fs[_0x678c('0x38')](path[_0x678c('0x39')](_0x2b32d3,_0x1c5175))&&_0x3b898a){fs[_0x678c('0x3a')](path[_0x678c('0x39')](_0x2b32d3,_0x1c5175));}return BPromise[_0x678c('0x3b')](_0x1761d8,function(_0x2e42b5){_0x17c9af['push'](_0x2e42b5);})['then'](function(){var _0x4c01f5=[];for(var _0x303e7b=0x0;_0x303e7b<_0x17c9af[_0x678c('0x2e')];_0x303e7b+=0x1){var _0x2ae233=_0x17c9af[_0x303e7b];var _0x59a3f0=createTables(_[_0x678c('0x3c')](_0x2ae233));var _0xbfb9d6;var _0x2d3070=getPDFDocDefinition(_0x59a3f0);var _0x3cf5fa=getPDFPrinter();var _0x33d7c6=_0x3cf5fa[_0x678c('0x3d')](_0x2d3070);if(_0x3b898a){_0xbfb9d6=path['join'](_0x2b32d3,_0x1c5175,util[_0x678c('0x19')](_0x678c('0x3e'),_0x1c5175,_0x303e7b,_0x678c('0x3f')));}else{_0xbfb9d6=path[_0x678c('0x39')](_0x2b32d3,util['format']('%s.%s',_0x1c5175,'pdf'));}_0x4c01f5[_0x678c('0x15')](writePDFDocument(_0x33d7c6,_0xbfb9d6));}return Promise[_0x678c('0x40')](_0x4c01f5);})[_0x678c('0x2d')](function(){if(_0x3b898a){return new Promise(function(_0x4fa99f){zipdir(path['join'](_0x2b32d3,_0x1c5175),{'saveTo':path[_0x678c('0x39')](_0x2b32d3,util[_0x678c('0x19')](_0x678c('0x41'),_0x1c5175,_0x678c('0x42')))},function(){rimraf(path[_0x678c('0x39')](_0x2b32d3,_0x1c5175),function(){});_0x4fa99f(_0x678c('0x43'));});});}})['then'](function(){if(!_0x3b898a)return;rimraf(path['join'](_0x2b32d3,_0x1c5175),function(){});})[_0x678c('0x2d')](function(){logger[_0x678c('0x44')](util[_0x678c('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x678c('0x45')));return analyticExtractedReport('Completed',_0x3b898a?util['format']('%s.%s',_0x1c5175,_0x3b898a?'zip':_0x678c('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x678c('0x44')](util[_0x678c('0x19')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x678c('0x45')));return db[_0x678c('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x678c('0x2d')](function(_0x17dbb1){EXTRACTED_REPORT=_0x17dbb1;return dbH[_0x678c('0x35')][_0x678c('0x34')](util[_0x678c('0x19')](_0x678c('0x46'),QUERY),{'type':dbH['sequelize'][_0x678c('0x32')][_0x678c('0x33')]});})['then'](extractReport)[_0x678c('0x47')](function(_0x281d45){logger[_0x678c('0x44')](util[_0x678c('0x19')](_0x678c('0x48'),EXTRACTED_REPORT_ID,_0x678c('0x45')),util[_0x678c('0x49')](_0x281d45,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x678c('0x4a'));})[_0x678c('0x4b')](function(){process[_0x678c('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x515ca2=new PdfPrinter({'Arial':{'normal':__dirname+_0x678c('0x4d'),'bold':__dirname+_0x678c('0x4e'),'italics':__dirname+_0x678c('0x4f'),'bolditalics':__dirname+_0x678c('0x50')}});return _0x515ca2;}function getPDFDocDefinitionFromHTML(_0x366dbb,_0x2c8340){var _0xf4c0d5=util[_0x678c('0x19')](_0x678c('0x51'),_0x2c8340[_0x678c('0x52')],_0x2c8340[_0x678c('0x53')]);var _0x28549f=moment()['format'](_0x678c('0x54'))[_0x678c('0x21')]();var _0x5dfb83=htmlToPdfmake(_0x366dbb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5dfb83],'defaultStyle':{'font':_0x678c('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x678c('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x678c('0x55')}},'header':function(){return[{'text':_0x678c('0x56'),'style':_0x678c('0x1c')}];},'footer':function(_0x5e8c15,_0x5a833b){return[{'text':util[_0x678c('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0xf4c0d5,_0x5e8c15,_0x5a833b,_0x28549f),'style':_0x678c('0x23')}];}};}function writePDFDocument(_0x37426,_0x516d95){return new Promise(function(_0x3b8dcd,_0x459b1d){var _0x3e1922=_0x37426[_0x678c('0x57')](fs[_0x678c('0x58')](_0x516d95));_0x3e1922['on']('finish',function(){_0x3b8dcd(_0x678c('0x59'));});_0x3e1922['on'](_0x678c('0x5a'),function(_0x4389a9){_0x459b1d(_0x4389a9);});_0x37426[_0x678c('0x5b')]();});}exports[_0x678c('0x5c')]=function(_0x11a570,_0x30c715){var _0xe43df1=getPDFPrinter();var _0x1aa02e=getPDFDocDefinitionFromHTML(_0x11a570,_0x30c715);var _0x598c8b=_0xe43df1[_0x678c('0x3d')](_0x1aa02e);return writePDFDocument(_0x598c8b,_0x30c715[_0x678c('0x5d')])[_0x678c('0x47')](function(_0x49e2d0){throw _0x49e2d0;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4b6ad33..93530e5 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 _0xde4d=['xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util','path','lodash','json2xls','bluebird','zip-dir','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each'];(function(_0x290604,_0x13bb2a){var _0x3893aa=function(_0x397639){while(--_0x397639){_0x290604['push'](_0x290604['shift']());}};_0x3893aa(++_0x13bb2a);}(_0xde4d,0xf1));var _0xdde4=function(_0x4865da,_0x1b3507){_0x4865da=_0x4865da-0x0;var _0x410de8=_0xde4d[_0x4865da];return _0x410de8;};'use strict';var util=require(_0xdde4('0x0'));var path=require(_0xdde4('0x1'));var _=require(_0xdde4('0x2'));var fs=require('fs');var json2xls=require(_0xdde4('0x3'));var BPromise=require(_0xdde4('0x4'));var zipdir=require(_0xdde4('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xdde4('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xdde4('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa7be0e,_0x130f05){var _0x3b998e={'status':_0xa7be0e};var _0x29f975={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x130f05){_0x3b998e[_0xdde4('0x8')]=_0x130f05;}return db['AnalyticExtractedReport'][_0xdde4('0x9')](_0x3b998e,_0x29f975);}function main(){var _0x507d62=0x1388;var _0x3a9894;logger[_0xdde4('0xa')](util[_0xdde4('0xb')](_0xdde4('0xc'),EXTRACTED_REPORT_ID,_0xdde4('0xd')));return db['Setting'][_0xdde4('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdde4('0xf')]})[_0xdde4('0x10')](function(_0x119922){if(_0x119922){_0x3a9894=_0x119922;_0x507d62=_0x3a9894[_0xdde4('0xf')]||0x1388;}})[_0xdde4('0x10')](function(){return dbH[_0xdde4('0x11')][_0xdde4('0x12')](util[_0xdde4('0xb')](_0xdde4('0x13'),QUERY),{'type':dbH[_0xdde4('0x11')][_0xdde4('0x14')][_0xdde4('0x15')]});})['then'](function(_0x31ba17){if(!_0x31ba17[0x0][_0xdde4('0x16')]){return analyticExtractedReport('Empty');}var _0x5e0bac=[];var _0x28dc6b=0x0;if(_0x3a9894[_0xdde4('0x17')]){if(_0x31ba17&&_0x31ba17[_0xdde4('0x18')]){var _0x1e2e78=_['range'](_0x31ba17[0x0][_0xdde4('0x16')]/_0x507d62);var _0x1e6d89=Number[_0xdde4('0x19')](_0x31ba17[0x0]['num']/_0x507d62)?_0x31ba17[0x0][_0xdde4('0x16')]%_0x507d62:0x0;_0x1e2e78['forEach'](function(_0x212ac8){if(_0x212ac8>0x0){_0x28dc6b+=_0x507d62;}_0x5e0bac[_0xdde4('0x1a')](dbH[_0xdde4('0x11')][_0xdde4('0x12')](util['format'](_0xdde4('0x1b'),QUERY,_0x507d62,_0x28dc6b),{'type':dbH['sequelize'][_0xdde4('0x14')][_0xdde4('0x15')]}));});if(_0x1e6d89>0x0){_0x28dc6b+=_0x507d62;_0x5e0bac[_0xdde4('0x1a')](dbH['sequelize'][_0xdde4('0x12')](util[_0xdde4('0xb')](_0xdde4('0x1b'),QUERY,_0x1e6d89,_0x28dc6b),{'type':dbH[_0xdde4('0x11')][_0xdde4('0x14')][_0xdde4('0x15')]}));}}}else{_0x5e0bac['push'](dbH['sequelize'][_0xdde4('0x12')](QUERY,{'type':dbH['sequelize'][_0xdde4('0x14')][_0xdde4('0x15')]}));}var _0x1c1fe9=path[_0xdde4('0x1c')](PATH);var _0x277d2c=path[_0xdde4('0x1d')](PATH,_0xdde4('0x1e'));var _0x53f398=_0x3a9894[_0xdde4('0x17')]&&_0x5e0bac[_0xdde4('0x18')]>0x1;var _0x4a95ed=[];if(!fs[_0xdde4('0x1f')](path[_0xdde4('0x20')](_0x1c1fe9,_0x277d2c))&&_0x53f398){fs[_0xdde4('0x21')](path[_0xdde4('0x20')](_0x1c1fe9,_0x277d2c));}return BPromise[_0xdde4('0x22')](_0x5e0bac,function(_0x3e704c){_0x4a95ed[_0xdde4('0x1a')](_0x3e704c);})[_0xdde4('0x10')](function(){for(var _0x1890b3=0x0;_0x1890b3<_0x4a95ed['length'];_0x1890b3+=0x1){var _0x1037cc;var _0x46199d=_0x4a95ed[_0x1890b3];if(_0x53f398){_0x1037cc=path['join'](_0x1c1fe9,_0x277d2c,util[_0xdde4('0xb')]('%s%d.%s',_0x277d2c,_0x1890b3,'xlsx'));}else{_0x1037cc=path[_0xdde4('0x20')](_0x1c1fe9,util[_0xdde4('0xb')]('%s.%s',_0x277d2c,_0xdde4('0x23')));}fs[_0xdde4('0x24')](_0x1037cc,json2xls(_0x46199d),_0xdde4('0x25'));}})['then'](function(){if(_0x53f398){return new Promise(function(_0xc5d122){zipdir(path[_0xdde4('0x20')](_0x1c1fe9,_0x277d2c),{'saveTo':path['join'](_0x1c1fe9,util[_0xdde4('0xb')](_0xdde4('0x26'),_0x277d2c,_0xdde4('0x27')))},function(_0x3d9968,_0x1605b3){rimraf(path[_0xdde4('0x20')](_0x1c1fe9,_0x277d2c),function(){});_0xc5d122(_0xdde4('0x28'));});});}})[_0xdde4('0x10')](function(){logger[_0xdde4('0xa')](util['format'](_0xdde4('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xdde4('0x2a'),_0x53f398?util['format'](_0xdde4('0x26'),_0x277d2c,_0x53f398?'zip':_0xdde4('0x23')):null);});})[_0xdde4('0x2b')](function(_0x20caab){logger['info'](util[_0xdde4('0xb')](_0xdde4('0x2c'),EXTRACTED_REPORT_ID,_0xdde4('0xd')),util['inspect'](_0x20caab,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xdde4('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8580=['dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','range','forEach','push','query','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','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','path','json2xls','rimraf','../../mysqldb'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x8580,0x1c7));var _0x0858=function(_0x23f12c,_0x4692e0){_0x23f12c=_0x23f12c-0x0;var _0x22f722=_0x8580[_0x23f12c];return _0x22f722;};'use strict';var util=require('util');var path=require(_0x0858('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x0858('0x1'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x0858('0x2'));var db=require(_0x0858('0x3'))['db'];var dbH=require('../../mysqldb')[_0x0858('0x4')];var logger=require(_0x0858('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0858('0x6')][0x2]);var QUERY=process[_0x0858('0x6')][0x3];var PATH=process[_0x0858('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38e3f7,_0x4981a7){var _0x9c611c={'status':_0x38e3f7};var _0x3ae92b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4981a7){_0x9c611c[_0x0858('0x7')]=_0x4981a7;}return db['AnalyticExtractedReport']['update'](_0x9c611c,_0x3ae92b);}function main(){var _0x470459=0x1388;var _0x4b5072;logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0xa'),EXTRACTED_REPORT_ID,_0x0858('0xb')));return db[_0x0858('0xc')][_0x0858('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0858('0xe'),_0x0858('0xf')]})['then'](function(_0x49eb34){if(_0x49eb34){_0x4b5072=_0x49eb34;_0x470459=_0x4b5072[_0x0858('0xf')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x0858('0x9')](_0x0858('0x10'),QUERY),{'type':dbH['sequelize'][_0x0858('0x11')][_0x0858('0x12')]});})[_0x0858('0x13')](function(_0x44e3ac){if(!_0x44e3ac[0x0][_0x0858('0x14')]){return analyticExtractedReport(_0x0858('0x15'));}var _0xca6a95=[];var _0x2ed26b=0x0;if(_0x4b5072[_0x0858('0xe')]){if(_0x44e3ac&&_0x44e3ac[_0x0858('0x16')]){var _0x163a6e=_[_0x0858('0x17')](_0x44e3ac[0x0]['num']/_0x470459);var _0x2b73c2=Number['isInteger'](_0x44e3ac[0x0][_0x0858('0x14')]/_0x470459)?_0x44e3ac[0x0][_0x0858('0x14')]%_0x470459:0x0;_0x163a6e[_0x0858('0x18')](function(_0x725295){if(_0x725295>0x0){_0x2ed26b+=_0x470459;}_0xca6a95[_0x0858('0x19')](dbH['sequelize'][_0x0858('0x1a')](util[_0x0858('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x470459,_0x2ed26b),{'type':dbH[_0x0858('0x1b')]['QueryTypes']['SELECT']}));});if(_0x2b73c2>0x0){_0x2ed26b+=_0x470459;_0xca6a95[_0x0858('0x19')](dbH[_0x0858('0x1b')][_0x0858('0x1a')](util[_0x0858('0x9')](_0x0858('0x1c'),QUERY,_0x2b73c2,_0x2ed26b),{'type':dbH['sequelize'][_0x0858('0x11')]['SELECT']}));}}}else{_0xca6a95[_0x0858('0x19')](dbH['sequelize'][_0x0858('0x1a')](QUERY,{'type':dbH[_0x0858('0x1b')][_0x0858('0x11')][_0x0858('0x12')]}));}var _0x4fe016=path[_0x0858('0x1d')](PATH);var _0x34dca9=path[_0x0858('0x1e')](PATH,_0x0858('0x1f'));var _0x14f05c=_0x4b5072[_0x0858('0xe')]&&_0xca6a95[_0x0858('0x16')]>0x1;var _0x83f104=[];if(!fs[_0x0858('0x20')](path[_0x0858('0x21')](_0x4fe016,_0x34dca9))&&_0x14f05c){fs[_0x0858('0x22')](path[_0x0858('0x21')](_0x4fe016,_0x34dca9));}return BPromise[_0x0858('0x23')](_0xca6a95,function(_0x73fb56){_0x83f104[_0x0858('0x19')](_0x73fb56);})[_0x0858('0x13')](function(){for(var _0x2607c1=0x0;_0x2607c1<_0x83f104[_0x0858('0x16')];_0x2607c1+=0x1){var _0x5630be;var _0x102cfc=_0x83f104[_0x2607c1];if(_0x14f05c){_0x5630be=path[_0x0858('0x21')](_0x4fe016,_0x34dca9,util[_0x0858('0x9')](_0x0858('0x24'),_0x34dca9,_0x2607c1,_0x0858('0x25')));}else{_0x5630be=path[_0x0858('0x21')](_0x4fe016,util[_0x0858('0x9')](_0x0858('0x26'),_0x34dca9,'xlsx'));}fs[_0x0858('0x27')](_0x5630be,json2xls(_0x102cfc),_0x0858('0x28'));}})[_0x0858('0x13')](function(){if(_0x14f05c){return new Promise(function(_0x2ab544){zipdir(path['join'](_0x4fe016,_0x34dca9),{'saveTo':path[_0x0858('0x21')](_0x4fe016,util[_0x0858('0x9')]('%s.%s',_0x34dca9,_0x0858('0x29')))},function(_0x1cdf5b,_0x49f259){rimraf(path[_0x0858('0x21')](_0x4fe016,_0x34dca9),function(){});_0x2ab544(_0x0858('0x2a'));});});}})[_0x0858('0x13')](function(){logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0x2b'),EXTRACTED_REPORT_ID,_0x0858('0xb')));return analyticExtractedReport(_0x0858('0x2c'),_0x14f05c?util[_0x0858('0x9')]('%s.%s',_0x34dca9,_0x14f05c?'zip':_0x0858('0x25')):null);});})[_0x0858('0x2d')](function(_0x270055){logger[_0x0858('0x8')](util[_0x0858('0x9')](_0x0858('0x2e'),EXTRACTED_REPORT_ID,_0x0858('0xb')),util[_0x0858('0x2f')](_0x270055,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0858('0x30'));})[_0x0858('0x31')](function(){process[_0x0858('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index bcda71d..75322b4 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 _0xa9e8=['rewrite','util','Interval','findAll','then','models','VoiceExtension','IntervalId','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','priority','extensions','extension','push','type','format','CDR(type)=%s','VoiceExtensionId','inbound','Set','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','map','hasOwnProperty','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','sortBy','catch','error'];(function(_0xfa7612,_0x1a7e52){var _0x1a3fdb=function(_0x2ef7b4){while(--_0x2ef7b4){_0xfa7612['push'](_0xfa7612['shift']());}};_0x1a3fdb(++_0x1a7e52);}(_0xa9e8,0x89));var _0x8a9e=function(_0x41e78a,_0x162772){_0x41e78a=_0x41e78a-0x0;var _0x9402c0=_0xa9e8[_0x41e78a];return _0x9402c0;};'use strict';var _=require('lodash');var util=require(_0x8a9e('0x0'));function rewrite(_0x2cbcaf,_0x1ee520){var _0x3e9d16=this;return _0x2cbcaf['models'][_0x8a9e('0x1')][_0x8a9e('0x2')]({'raw':!![]})[_0x8a9e('0x3')](function(_0x37bff7){_0x3e9d16['intervals']=_0x37bff7;return _0x2cbcaf[_0x8a9e('0x4')][_0x8a9e('0x5')][_0x8a9e('0x2')]({'where':{'IntervalId':_0x1ee520[_0x8a9e('0x6')]},'raw':!![]});})[_0x8a9e('0x3')](function(_0x13377a){return _0x2cbcaf['models'][_0x8a9e('0x5')][_0x8a9e('0x2')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x13377a,'exten'))}},'order':[{'raw':_0x8a9e('0x7')}],'raw':!![]});})['then'](function(_0x18fc66){var _0xc59739=_[_0x8a9e('0x8')](_0x18fc66,{'priority':'1'});var _0x59fb73=_[_0x8a9e('0x8')](_0x18fc66,{'isApp':0x1});var _0x401285=_[_0x8a9e('0x9')](_0x59fb73,_0x8a9e('0xa'));var _0x43a18e=[_0x8a9e('0xb'),'playback'];var _0x575451=[];var _0x47d908=[];for(var _0x10bb48 in _0x401285){if(_0x401285['hasOwnProperty'](_0x10bb48)){_0x3e9d16[_0x8a9e('0xc')]=0x2;_0x3e9d16[_0x8a9e('0xd')]=[];_0x3e9d16[_0x8a9e('0xe')]=_['find'](_0xc59739,{'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')]});_0x3e9d16[_0x8a9e('0xd')][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':'Set','appdata':util[_0x8a9e('0x11')](_0x8a9e('0x12'),_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')]),'context':_0x401285[_0x10bb48][0x0]['context'],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});if(_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')]===_0x8a9e('0x14')){_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':_0x8a9e('0x16')+_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')],'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16['priority']++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});}else if(_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')]===_0x8a9e('0x18')){if(_0x3e9d16[_0x8a9e('0xe')]){_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0]['type'],'app':'Set','appdata':_0x8a9e('0x19')+(_0x3e9d16[_0x8a9e('0xe')][_0x8a9e('0x1a')]?_0x8a9e('0x1b')+_0x3e9d16['extension'][_0x8a9e('0x1a')]+'}':_0x8a9e('0x1c')),'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0]['exten'],'priority':_0x3e9d16['priority']++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});}_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':'CDR(routeid)='+_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')],'context':_0x401285[_0x10bb48][0x0]['context'],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0]['VoiceExtensionId']});var _0x4723de=_0x3e9d16[_0x8a9e('0xc')]++;_0x3e9d16[_0x8a9e('0xd')][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x1d'),'appdata':_0x8a9e('0x1e')+(_0x4723de+0x2)+_0x8a9e('0x1f')+(_0x4723de+0x1)+')','context':_0x401285[_0x10bb48][0x0]['context'],'exten':_0x401285[_0x10bb48][0x0]['exten'],'priority':_0x4723de,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});if(_0x3e9d16[_0x8a9e('0xe')]){_0x3e9d16[_0x8a9e('0xd')]['push']({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':_0x3e9d16[_0x8a9e('0xe')][_0x8a9e('0x1a')]?_0x8a9e('0x20')+_0x3e9d16[_0x8a9e('0xe')][_0x8a9e('0x1a')]+'}':_0x8a9e('0x21'),'context':_0x401285[_0x10bb48][0x0]['context'],'exten':_0x401285[_0x10bb48][0x0]['exten'],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});}_0x3e9d16[_0x8a9e('0xd')][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0]['type'],'app':'Set','appdata':_0x8a9e('0x22')+_0x401285[_0x10bb48][0x0]['VoiceExtensionId'],'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});if(_0x3e9d16[_0x8a9e('0xe')]&&_0x3e9d16[_0x8a9e('0xe')]['hasOwnProperty'](_0x8a9e('0x23'))&&_0x3e9d16[_0x8a9e('0xe')][_0x8a9e('0x23')]!==_0x8a9e('0x24')){_0x3e9d16[_0x8a9e('0xd')][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':_0x8a9e('0x25'),'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16['priority']++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});_0x3e9d16[_0x8a9e('0xd')]['push']({'type':_0x401285[_0x10bb48][0x0]['type'],'app':_0x8a9e('0x15'),'appdata':_0x8a9e('0x26')+_0x3e9d16[_0x8a9e('0xe')][_0x8a9e('0x23')]||_0x8a9e('0x27'),'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0]['VoiceExtensionId']});}}_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0]['type'],'app':_0x8a9e('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0]['VoiceExtensionId']});_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':_0x8a9e('0x28'),'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16['priority']++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});_0x3e9d16['extensions'][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0][_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x401285[_0x10bb48][0x0]['context'],'exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'priority':_0x3e9d16[_0x8a9e('0xc')]++,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});for(var _0x27ee90=0x0,_0x2471b7=0x0;_0x27ee90<_0x401285[_0x10bb48]['length'];_0x27ee90+=0x1,_0x2471b7=0x0){var _0xe0cf1=_0x401285[_0x10bb48][_0x27ee90];if(_0xe0cf1['type']){_0xe0cf1[_0x8a9e('0x10')]=_0xe0cf1[_0x8a9e('0x10')][_0x8a9e('0x29')]();}var _0x31ef32=[];var _0x40eace=[];delete _0xe0cf1['id'];delete _0xe0cf1[_0x8a9e('0x2a')];delete _0xe0cf1[_0x8a9e('0x2b')];var _0x3fd861=_0xe0cf1['interval']!==_0x8a9e('0x2c')?[_0xe0cf1[_0x8a9e('0x2d')]]:_0xe0cf1[_0x8a9e('0x6')]?_[_0x8a9e('0x2e')](_[_0x8a9e('0x8')](_0x3e9d16['intervals'],{'IntervalId':_0xe0cf1['IntervalId']}),_0x8a9e('0x2d')):[];if(_0xe0cf1[_0x8a9e('0x2f')]('tag')){if(_0xe0cf1[_0x8a9e('0x30')]&&_0xe0cf1['tag']!=='--'){_0x31ef32[_0x8a9e('0xf')]({'type':_0xe0cf1['type'],'app':_0x8a9e('0x15'),'appdata':'CDR(tag)='+_0xe0cf1[_0x8a9e('0x30')],'context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1['exten'],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16[_0x8a9e('0xc')]+_0x2471b7++,'VoiceExtensionId':_0xe0cf1[_0x8a9e('0x13')]});}}if(_0xe0cf1[_0x8a9e('0x10')]===_0x8a9e('0x18')&&_0xe0cf1['hasOwnProperty'](_0x8a9e('0x32'))){if(_0xe0cf1[_0x8a9e('0x32')]){_0x31ef32['push']({'type':_0xe0cf1[_0x8a9e('0x10')],'app':_0x8a9e('0x1d'),'appdata':_0x8a9e('0x33')+_0xe0cf1['callerID']+')','context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1[_0x8a9e('0xa')],'priority':_0x3fd861['length']+_0x3e9d16['priority']+_0x2471b7++,'VoiceExtensionId':_0xe0cf1[_0x8a9e('0x13')]});}else{_0x31ef32[_0x8a9e('0xf')]({'type':_0xe0cf1[_0x8a9e('0x10')],'app':_0x8a9e('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1['exten'],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16['priority']+_0x2471b7++,'VoiceExtensionId':_0xe0cf1[_0x8a9e('0x13')]});}}if(_0xe0cf1['hasOwnProperty'](_0x8a9e('0x34'))){if(_0x43a18e[_0x8a9e('0x35')](_0xe0cf1[_0x8a9e('0x36')][_0x8a9e('0x29')]())>=0x0&&_0xe0cf1[_0x8a9e('0x37')]!==_0x8a9e('0x38')){if(_0xe0cf1['answer']){_0x31ef32[_0x8a9e('0xf')]({'type':_0xe0cf1[_0x8a9e('0x10')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1['exten'],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16[_0x8a9e('0xc')]+_0x2471b7++,'VoiceExtensionId':_0xe0cf1['VoiceExtensionId']});_0x31ef32[_0x8a9e('0xf')]({'type':_0xe0cf1[_0x8a9e('0x10')],'app':_0x8a9e('0x15'),'appdata':_0x8a9e('0x39'),'context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1[_0x8a9e('0xa')],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16['priority']+_0x2471b7++,'VoiceExtensionId':_0xe0cf1['VoiceExtensionId']});}else{_0x31ef32['push']({'type':_0xe0cf1[_0x8a9e('0x10')],'app':_0x8a9e('0x1d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xe0cf1['context'],'exten':_0xe0cf1[_0x8a9e('0xa')],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16[_0x8a9e('0xc')]+_0x2471b7++,'VoiceExtensionId':_0xe0cf1['VoiceExtensionId']});_0x31ef32[_0x8a9e('0xf')]({'type':_0xe0cf1['type'],'app':'Set','appdata':_0x8a9e('0x3a'),'context':_0xe0cf1[_0x8a9e('0x17')],'exten':_0xe0cf1[_0x8a9e('0xa')],'priority':_0x3fd861[_0x8a9e('0x31')]+_0x3e9d16['priority']+_0x2471b7++,'VoiceExtensionId':_0xe0cf1[_0x8a9e('0x13')]});}}}for(var _0x5ac718=0x0;_0x5ac718<_0x3fd861[_0x8a9e('0x31')];_0x5ac718+=0x1){var _0x34d9d4=_0x3e9d16[_0x8a9e('0xc')]+_0x3fd861[_0x8a9e('0x31')];var _0x4fdfed=_0x5ac718===_0x3fd861[_0x8a9e('0x31')]-0x1?_0x3e9d16['priority']+_0x31ef32[_0x8a9e('0x31')]+_0x40eace[_0x8a9e('0x31')]+0x2:_0x3e9d16[_0x8a9e('0xc')]+_0x5ac718+0x1;_0x31ef32['splice'](_0x5ac718,0x0,{'type':_0xe0cf1[_0x8a9e('0x10')],'app':_0x8a9e('0x3b'),'appdata':_0x3fd861[_0x5ac718]+'?'+_0xe0cf1[_0x8a9e('0x17')]+_0x8a9e('0x3c')+_0x34d9d4+':'+_0xe0cf1[_0x8a9e('0x17')]+_0x8a9e('0x3c')+_0x4fdfed,'exten':_0xe0cf1[_0x8a9e('0xa')],'context':_0xe0cf1[_0x8a9e('0x17')],'priority':_0x3e9d16[_0x8a9e('0xc')]+_0x5ac718,'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});}_0xe0cf1['priority']=_0x31ef32['length']?_[_0x8a9e('0x3d')](_0x31ef32)['priority']+0x1:_0x3e9d16[_0x8a9e('0xc')];_0x3e9d16['priority']=(_0x40eace[_0x8a9e('0x31')]?_[_0x8a9e('0x3d')](_0x40eace)[_0x8a9e('0xc')]:_0xe0cf1[_0x8a9e('0xc')])+0x1;_0x3e9d16[_0x8a9e('0xd')]=_[_0x8a9e('0x3e')](_0x3e9d16[_0x8a9e('0xd')],_0x31ef32,[_0xe0cf1],_0x40eace);}_0x3e9d16[_0x8a9e('0xd')][_0x8a9e('0xf')]({'type':_0x401285[_0x10bb48][0x0]['type'],'app':'Hangup','exten':_0x401285[_0x10bb48][0x0][_0x8a9e('0xa')],'context':_0x401285[_0x10bb48][0x0][_0x8a9e('0x17')],'priority':_0x3e9d16[_0x8a9e('0xc')],'VoiceExtensionId':_0x401285[_0x10bb48][0x0][_0x8a9e('0x13')]});_0x575451[_0x8a9e('0xf')](_0x401285[_0x10bb48][0x0]['VoiceExtensionId']);_0x47d908=_[_0x8a9e('0x3e')](_0x47d908,_0x3e9d16[_0x8a9e('0xd')]);}}return _0x2cbcaf['transaction'](function(_0x5da1dc){return _0x2cbcaf[_0x8a9e('0x4')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x575451}},'transaction':_0x5da1dc})[_0x8a9e('0x3')](function(_0x2868be){return _0x2cbcaf[_0x8a9e('0x4')][_0x8a9e('0x5')][_0x8a9e('0x3f')](_[_0x8a9e('0x40')](_0x47d908,_0x8a9e('0xc')),{'transaction':_0x5da1dc});});});})[_0x8a9e('0x41')](function(_0x500658){console[_0x8a9e('0x42')](_0x500658);});}exports[_0x8a9e('0x43')]=rewrite; \ No newline at end of file +var _0xcf11=['inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','):Goto(','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','interval','IntervalId','tag','CDR(tag)=','callerID','indexOf','app','appType','custom','answer','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','VoiceExtension','bulkCreate','sortBy','catch','error','lodash','models','intervals','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','CDR(type)=%s','context'];(function(_0x19077e,_0x1ae7cd){var _0x440fc3=function(_0x31a1fe){while(--_0x31a1fe){_0x19077e['push'](_0x19077e['shift']());}};_0x440fc3(++_0x1ae7cd);}(_0xcf11,0x1c5));var _0x1cf1=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0xcf11[_0x3f1710];return _0x528458;};'use strict';var _=require(_0x1cf1('0x0'));var util=require('util');function rewrite(_0x1b22ac,_0x558a25){var _0x5ccec6=this;return _0x1b22ac[_0x1cf1('0x1')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x5b1029){_0x5ccec6[_0x1cf1('0x2')]=_0x5b1029;return _0x1b22ac[_0x1cf1('0x1')]['VoiceExtension'][_0x1cf1('0x3')]({'where':{'IntervalId':_0x558a25['IntervalId']},'raw':!![]});})['then'](function(_0x5b30a0){return _0x1b22ac[_0x1cf1('0x1')]['VoiceExtension'][_0x1cf1('0x3')]({'where':{'exten':{'$in':_[_0x1cf1('0x4')](_[_0x1cf1('0x5')](_0x5b30a0,_0x1cf1('0x6')))}},'order':[{'raw':_0x1cf1('0x7')}],'raw':!![]});})[_0x1cf1('0x8')](function(_0x180d3e){var _0x41c640=_['filter'](_0x180d3e,{'priority':'1'});var _0xbdadb6=_[_0x1cf1('0x9')](_0x180d3e,{'isApp':0x1});var _0x5067fa=_['groupBy'](_0xbdadb6,_0x1cf1('0x6'));var _0x465b63=[_0x1cf1('0xa'),_0x1cf1('0xb')];var _0x5b4d6a=[];var _0x86918e=[];for(var _0x3d1e62 in _0x5067fa){if(_0x5067fa[_0x1cf1('0xc')](_0x3d1e62)){_0x5ccec6[_0x1cf1('0xd')]=0x2;_0x5ccec6['extensions']=[];_0x5ccec6[_0x1cf1('0xe')]=_[_0x1cf1('0xf')](_0x41c640,{'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')]});_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':util[_0x1cf1('0x14')](_0x1cf1('0x15'),_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')]),'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6['priority']++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId']});if(_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')]===_0x1cf1('0x17')){_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x18')+_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')],'context':_0x5067fa[_0x3d1e62][0x0]['context'],'exten':_0x5067fa[_0x3d1e62][0x0]['exten'],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId']});}else if(_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')]===_0x1cf1('0x1a')){if(_0x5ccec6[_0x1cf1('0xe')]){_0x5ccec6['extensions'][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':'Set','appdata':_0x1cf1('0x1b')+(_0x5ccec6[_0x1cf1('0xe')]['cutdigits']?_0x1cf1('0x1c')+_0x5ccec6[_0x1cf1('0xe')]['cutdigits']+'}':_0x1cf1('0x1d')),'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6['priority']++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});}_0x5ccec6[_0x1cf1('0x10')]['push']({'type':_0x5067fa[_0x3d1e62][0x0]['type'],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x18')+_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId'],'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0]['exten'],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});var _0x47e256=_0x5ccec6[_0x1cf1('0xd')]++;_0x5ccec6[_0x1cf1('0x10')]['push']({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x47e256+0x2)+_0x1cf1('0x1e')+(_0x47e256+0x1)+')','context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x47e256,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId']});if(_0x5ccec6[_0x1cf1('0xe')]){_0x5ccec6['extensions'][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x5ccec6[_0x1cf1('0xe')][_0x1cf1('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x5ccec6['extension'][_0x1cf1('0x1f')]+'}':_0x1cf1('0x20'),'context':_0x5067fa[_0x3d1e62][0x0]['context'],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});}_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x21')+_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')],'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId']});if(_0x5ccec6[_0x1cf1('0xe')]&&_0x5ccec6[_0x1cf1('0xe')][_0x1cf1('0xc')](_0x1cf1('0x22'))&&_0x5ccec6[_0x1cf1('0xe')][_0x1cf1('0x22')]!=='none'){_0x5ccec6['extensions'][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x23'),'context':_0x5067fa[_0x3d1e62][0x0]['context'],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6['priority']++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0]['VoiceExtensionId']});_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x24')+_0x5ccec6[_0x1cf1('0xe')][_0x1cf1('0x22')]||'wav','context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});}}_0x5ccec6[_0x1cf1('0x10')]['push']({'type':_0x5067fa[_0x3d1e62][0x0]['type'],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x25'),'context':_0x5067fa[_0x3d1e62][0x0]['context'],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});_0x5ccec6[_0x1cf1('0x10')]['push']({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x26'),'context':_0x5067fa[_0x3d1e62][0x0]['context'],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':_0x1cf1('0x13'),'appdata':_0x1cf1('0x27'),'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'priority':_0x5ccec6[_0x1cf1('0xd')]++,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});for(var _0x8bd793=0x0,_0x244c26=0x0;_0x8bd793<_0x5067fa[_0x3d1e62][_0x1cf1('0x28')];_0x8bd793+=0x1,_0x244c26=0x0){var _0x53895e=_0x5067fa[_0x3d1e62][_0x8bd793];if(_0x53895e[_0x1cf1('0x12')]){_0x53895e['type']=_0x53895e[_0x1cf1('0x12')]['toLowerCase']();}var _0x4fd0ef=[];var _0x1cd58e=[];delete _0x53895e['id'];delete _0x53895e[_0x1cf1('0x29')];delete _0x53895e[_0x1cf1('0x2a')];var _0x365a3e=_0x53895e['interval']!==_0x1cf1('0x2b')?[_0x53895e[_0x1cf1('0x2c')]]:_0x53895e[_0x1cf1('0x2d')]?_[_0x1cf1('0x5')](_[_0x1cf1('0x9')](_0x5ccec6[_0x1cf1('0x2')],{'IntervalId':_0x53895e['IntervalId']}),_0x1cf1('0x2c')):[];if(_0x53895e['hasOwnProperty']('tag')){if(_0x53895e[_0x1cf1('0x2e')]&&_0x53895e[_0x1cf1('0x2e')]!=='--'){_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e[_0x1cf1('0x12')],'app':'Set','appdata':_0x1cf1('0x2f')+_0x53895e['tag'],'context':_0x53895e['context'],'exten':_0x53895e['exten'],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});}}if(_0x53895e[_0x1cf1('0x12')]===_0x1cf1('0x1a')&&_0x53895e[_0x1cf1('0xc')]('callerID')){if(_0x53895e[_0x1cf1('0x30')]){_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e[_0x1cf1('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x53895e[_0x1cf1('0x30')]+')','context':_0x53895e['context'],'exten':_0x53895e[_0x1cf1('0x6')],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6['priority']+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});}else{_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x53895e[_0x1cf1('0x16')],'exten':_0x53895e[_0x1cf1('0x6')],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});}}if(_0x53895e[_0x1cf1('0xc')]('answer')){if(_0x465b63[_0x1cf1('0x31')](_0x53895e[_0x1cf1('0x32')]['toLowerCase']())>=0x0&&_0x53895e[_0x1cf1('0x33')]!==_0x1cf1('0x34')){if(_0x53895e[_0x1cf1('0x35')]){_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e['type'],'app':_0x1cf1('0x36'),'appdata':_0x1cf1('0x37'),'context':_0x53895e['context'],'exten':_0x53895e['exten'],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});_0x4fd0ef['push']({'type':_0x53895e['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x53895e[_0x1cf1('0x16')],'exten':_0x53895e[_0x1cf1('0x6')],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});}else{_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e[_0x1cf1('0x12')],'app':_0x1cf1('0x36'),'appdata':_0x1cf1('0x38'),'context':_0x53895e[_0x1cf1('0x16')],'exten':_0x53895e[_0x1cf1('0x6')],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});_0x4fd0ef[_0x1cf1('0x11')]({'type':_0x53895e[_0x1cf1('0x12')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x53895e[_0x1cf1('0x16')],'exten':_0x53895e[_0x1cf1('0x6')],'priority':_0x365a3e[_0x1cf1('0x28')]+_0x5ccec6[_0x1cf1('0xd')]+_0x244c26++,'VoiceExtensionId':_0x53895e[_0x1cf1('0x19')]});}}}for(var _0x8e7cdd=0x0;_0x8e7cdd<_0x365a3e['length'];_0x8e7cdd+=0x1){var _0x55e480=_0x5ccec6[_0x1cf1('0xd')]+_0x365a3e[_0x1cf1('0x28')];var _0x577a45=_0x8e7cdd===_0x365a3e[_0x1cf1('0x28')]-0x1?_0x5ccec6['priority']+_0x4fd0ef['length']+_0x1cd58e[_0x1cf1('0x28')]+0x2:_0x5ccec6[_0x1cf1('0xd')]+_0x8e7cdd+0x1;_0x4fd0ef['splice'](_0x8e7cdd,0x0,{'type':_0x53895e[_0x1cf1('0x12')],'app':_0x1cf1('0x39'),'appdata':_0x365a3e[_0x8e7cdd]+'?'+_0x53895e[_0x1cf1('0x16')]+',${EXTEN},'+_0x55e480+':'+_0x53895e[_0x1cf1('0x16')]+_0x1cf1('0x3a')+_0x577a45,'exten':_0x53895e['exten'],'context':_0x53895e[_0x1cf1('0x16')],'priority':_0x5ccec6[_0x1cf1('0xd')]+_0x8e7cdd,'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});}_0x53895e[_0x1cf1('0xd')]=_0x4fd0ef['length']?_[_0x1cf1('0x3b')](_0x4fd0ef)[_0x1cf1('0xd')]+0x1:_0x5ccec6[_0x1cf1('0xd')];_0x5ccec6[_0x1cf1('0xd')]=(_0x1cd58e[_0x1cf1('0x28')]?_[_0x1cf1('0x3b')](_0x1cd58e)[_0x1cf1('0xd')]:_0x53895e[_0x1cf1('0xd')])+0x1;_0x5ccec6[_0x1cf1('0x10')]=_[_0x1cf1('0x3c')](_0x5ccec6['extensions'],_0x4fd0ef,[_0x53895e],_0x1cd58e);}_0x5ccec6[_0x1cf1('0x10')][_0x1cf1('0x11')]({'type':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x12')],'app':'Hangup','exten':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x6')],'context':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x16')],'priority':_0x5ccec6[_0x1cf1('0xd')],'VoiceExtensionId':_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]});_0x5b4d6a['push'](_0x5067fa[_0x3d1e62][0x0][_0x1cf1('0x19')]);_0x86918e=_[_0x1cf1('0x3c')](_0x86918e,_0x5ccec6[_0x1cf1('0x10')]);}}return _0x1b22ac[_0x1cf1('0x3d')](function(_0x5ced72){return _0x1b22ac[_0x1cf1('0x1')]['VoiceExtension'][_0x1cf1('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x5b4d6a}},'transaction':_0x5ced72})[_0x1cf1('0x8')](function(_0x215f86){return _0x1b22ac[_0x1cf1('0x1')][_0x1cf1('0x3f')][_0x1cf1('0x40')](_[_0x1cf1('0x41')](_0x86918e,'priority'),{'transaction':_0x5ced72});});});})[_0x1cf1('0x42')](function(_0x1fb9d1){console[_0x1cf1('0x43')](_0x1fb9d1);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e2e1c91..e421077 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 _0xbffa=['createdAt','field','NOW()','scheduledAt','toString','updatedAt','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','select','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','query','BlackLists','all','Campaign','CmList','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../config/logger','api','redis','socket.io-emitter','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId'];(function(_0x3a7066,_0x2ded9e){var _0x137504=function(_0x76a370){while(--_0x76a370){_0x3a7066['push'](_0x3a7066['shift']());}};_0x137504(++_0x2ded9e);}(_0xbffa,0x118));var _0xabff=function(_0x593822,_0x43d0b){_0x593822=_0x593822-0x0;var _0x58c413=_0xbffa[_0x593822];return _0x58c413;};'use strict';var BPromise=require(_0xabff('0x0'));var util=require(_0xabff('0x1'));var _=require(_0xabff('0x2'));var fs=require('fs');var squel=require(_0xabff('0x3'));var Papa=require('papaparse');var Redis=require(_0xabff('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xabff('0x5'))(_0xabff('0x6'));config[_0xabff('0x7')]=_['defaults'](config[_0xabff('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xabff('0x8'))(new Redis(config[_0xabff('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0xabff('0x9')](socket);try{if(!process[_0xabff('0xa')][0x2]||process[_0xabff('0xa')][0x2]==='undefined'||process['argv'][0x2]===_0xabff('0xb')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xabff('0xa')][0x2];if(!process[_0xabff('0xa')][0x3]||process[_0xabff('0xa')][0x3]===_0xabff('0xc')||process[_0xabff('0xa')][0x3]===_0xabff('0xb')||!process['argv'][0x4]||process[_0xabff('0xa')][0x4]===_0xabff('0xc')||process[_0xabff('0xa')][0x4]===_0xabff('0xb')){throw new Error(_0xabff('0xd'));}var FIELDS=_[_0xabff('0xe')](process[_0xabff('0xa')][0x3][_0xabff('0xf')](','),process[_0xabff('0xa')][0x4][_0xabff('0xf')](','));if(!process[_0xabff('0xa')][0x5]||process[_0xabff('0xa')][0x5]==='undefined'||process['argv'][0x5]===_0xabff('0xb')){throw new Error(_0xabff('0x10'));}var LISTID=process[_0xabff('0xa')][0x5];var COMPANYID=process[_0xabff('0xa')][0x6]&&process[_0xabff('0xa')][0x6]!=='undefined'&&process[_0xabff('0xa')][0x6]!==_0xabff('0xb')?process[_0xabff('0xa')][0x6]:null;var DUPLICATES=process[_0xabff('0xa')][0x7]&&process[_0xabff('0xa')][0x7]!==_0xabff('0xc')&&process['argv'][0x7]!==_0xabff('0xb')?process[_0xabff('0xa')][0x7]:null;if(!process['argv'][0x8]||process[_0xabff('0xa')][0x8]===_0xabff('0xc')||process[_0xabff('0xa')][0x8]===_0xabff('0xb')){throw new Error(_0xabff('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xe79d04){logger[_0xabff('0x12')](_0xe79d04);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(_0x5d4f5a,_0x1f8059,_0x320df3,_0x23ea48){var _0x1b35d8={'message':_0x1f8059};_0x1b35d8[_0x5d4f5a]=!![];if(_0x320df3){_0x1b35d8[_0xabff('0x13')]=_0x320df3;}if(_0x23ea48){_0x1b35d8['index']=_0x23ea48;}return _0x1b35d8;}function isEmail(_0x49c7f8){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))*$/[_0xabff('0x14')](_0x49c7f8);}function checkRow(_0x40b91f,_0x2debb2,_0x5f5d87){return new BPromise(function(_0x347c19,_0x364c48){if(_[_0xabff('0x15')](_0x40b91f)){return _0x364c48(handleCheckRowError(_0xabff('0x12'),_0xabff('0x16'),null,_0x5f5d87));}if(_0x40b91f[_0xabff('0x17')]&&_0x40b91f[_0xabff('0x17')][_0xabff('0x18')]){var _0x1871cb=_[_0xabff('0x19')](_0x40b91f[_0xabff('0x17')],_0xabff('0x1a'))[_0xabff('0x1b')](';');return _0x364c48(handleCheckRowError('error',_0x1871cb,null,_0x5f5d87));}var _0x2bb78a={};for(var _0x3fbcf8 in FIELDS){if(FIELDS[_0xabff('0x1c')](_0x3fbcf8)&&FIELDS[_0x3fbcf8]){_0x2bb78a[_0x3fbcf8]=_0x40b91f[_0xabff('0x1d')][0x0][FIELDS[_0x3fbcf8]]||_0x40b91f['data'][0x0]['\ufeff'+FIELDS[_0x3fbcf8]];}}if(!_0x2bb78a['firstName']){return _0x364c48(handleCheckRowError(_0xabff('0x12'),_0xabff('0x1e'),null,_0x5f5d87));}if(!_0x2bb78a[_0xabff('0x1f')]){return _0x364c48(handleCheckRowError(_0xabff('0x12'),_0xabff('0x20'),null,_0x5f5d87));}if(_0x2bb78a[_0xabff('0x21')]){var _0x2ddb40=moment(_0x2bb78a[_0xabff('0x21')],'YYYY-MM-DD');if(!_0x2ddb40[_0xabff('0x22')]()){return _0x364c48(handleCheckRowError(_0xabff('0x12'),_0xabff('0x23'),null,_0x5f5d87));}}if(_0x2bb78a[_0xabff('0x24')]){if(!isEmail(_0x2bb78a[_0xabff('0x24')])){return _0x364c48(handleCheckRowError('error',_0xabff('0x25'),null,_0x5f5d87));}}_0x2bb78a[_0xabff('0x26')]=LISTID;_0x2bb78a['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xabff('0x18')]&&_0x2debb2){var _0x1fb907={};for(var _0x60eda5=0x0,_0x310476=DUPLICATES[_0xabff('0x18')];_0x60eda5<_0x310476;_0x60eda5+=0x1){_0x1fb907[DUPLICATES[_0x60eda5]]=_0x2bb78a[DUPLICATES[_0x60eda5]];}var _0x433bc5=_[_0xabff('0x27')](_0x2debb2,_0x1fb907);if(_0x433bc5){return _0x364c48(handleCheckRowError('duplicate',_0xabff('0x28'),_0x433bc5,_0x5f5d87));}}return db[_0xabff('0x29')][_0xabff('0x2a')](_0x2bb78a,{'raw':!![],'hooks':![],'fields':_[_0xabff('0x2b')](_0x2bb78a)})[_0xabff('0x2c')](function(_0x541e58){if(DUPLICATES&&DUPLICATES[_0xabff('0x18')]&&_0x2debb2){_0x2debb2['push'](_[_0xabff('0x2d')](_0x2bb78a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x541e58['id'];return _0x347c19();})[_0xabff('0x2e')](function(_0x4a64bc){return _0x364c48(handleCheckRowError(_0xabff('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x4a64bc['message']||JSON[_0xabff('0x2f')](_0x4a64bc)),null,_0x5f5d87));});});}function checkHopper(){function _0x345312(){return function(_0x323f3f){logger[_0xabff('0x12')](_0xabff('0x30'),_0xabff('0x31'),util[_0xabff('0x32')](_0x323f3f,{'showHidden':![],'depth':null}));};}var _0x448ca7=function(_0x44a268,_0x1b51c7){var _0x2aa5fd=squel[_0xabff('0x33')]()[_0xabff('0x34')](_0xabff('0x35'))[_0xabff('0x36')]([_0xabff('0x1f'),'scheduledAt',_0xabff('0x37'),_0xabff('0x26'),_0x1b51c7,_0xabff('0x38'),'updatedAt'],squel['select']()[_0xabff('0x39')](_0xabff('0x1f'),_0xabff('0x1f'))[_0xabff('0x39')](_0xabff('0x3a'),_0xabff('0x3b'))['field']('id',_0xabff('0x37'))[_0xabff('0x39')](LISTID[_0xabff('0x3c')](),_0xabff('0x26'))[_0xabff('0x39')](_0x44a268['id'][_0xabff('0x3c')](),_0x1b51c7)['field'](_0xabff('0x3a'),_0xabff('0x38'))[_0xabff('0x39')]('NOW()',_0xabff('0x3d'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xabff('0x3e')]('ListId\x20=\x20?',LISTID[_0xabff('0x3c')]())[_0xabff('0x3e')](_0xabff('0x3f'))[_0xabff('0x3e')](_0xabff('0x40'),squel['select']()[_0xabff('0x39')](_0xabff('0x1f'))[_0xabff('0x41')]('cm_hopper')['where'](_0x1b51c7+_0xabff('0x42'),_0x44a268['id']['toString']())))[_0xabff('0x3c')]();return _0x2aa5fd;};var _0x3b4563=function(_0x411b76,_0x336a74){var _0x4881e6=squel[_0xabff('0x33')]()[_0xabff('0x34')](_0xabff('0x35'))[_0xabff('0x36')](['phone',_0xabff('0x3b'),_0xabff('0x37'),_0xabff('0x26'),_0x336a74,_0xabff('0x38'),_0xabff('0x3d')],squel[_0xabff('0x43')]()[_0xabff('0x39')]('phone',_0xabff('0x1f'))[_0xabff('0x39')](_0xabff('0x3a'),_0xabff('0x3b'))['field']('id',_0xabff('0x37'))['field'](LISTID[_0xabff('0x3c')](),'ListId')[_0xabff('0x39')](_0x411b76['id']['toString'](),_0x336a74)['field']('NOW()','createdAt')[_0xabff('0x39')](_0xabff('0x3a'),_0xabff('0x3d'))[_0xabff('0x41')](_0xabff('0x44'))['where'](_0xabff('0x45'))[_0xabff('0x3e')](_0xabff('0x46'),LISTID[_0xabff('0x3c')]())['where'](_0xabff('0x47'),squel[_0xabff('0x48')](hopperContacts))[_0xabff('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xabff('0x3e')](_0xabff('0x40'),squel[_0xabff('0x43')]()[_0xabff('0x39')](_0xabff('0x49'))[_0xabff('0x41')](_0xabff('0x4a'))[_0xabff('0x3e')](_0x336a74+_0xabff('0x42'),_0x411b76['id'][_0xabff('0x3c')]()))[_0xabff('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xabff('0x43')]()['field']('phone')['from']('cm_hopper')[_0xabff('0x3e')](_0x336a74+_0xabff('0x42'),_0x411b76['id']['toString']())))[_0xabff('0x3c')]();return _0x4881e6;};function _0x2f8024(_0x5c0dcd,_0x2ddf86){var _0x232c49=squel[_0xabff('0x33')]()[_0xabff('0x34')](_0xabff('0x35'))['fromQuery']([_0xabff('0x1f'),'scheduledAt','ContactId','ListId',_0x2ddf86,_0xabff('0x38'),_0xabff('0x3d')],squel['select']()['field']('phone',_0xabff('0x1f'))[_0xabff('0x39')](_0xabff('0x3a'),_0xabff('0x3b'))[_0xabff('0x39')]('id',_0xabff('0x37'))['field'](LISTID['toString'](),'ListId')['field'](_0x5c0dcd['id'][_0xabff('0x3c')](),_0x2ddf86)[_0xabff('0x39')]('NOW()',_0xabff('0x38'))['field'](_0xabff('0x3a'),'updatedAt')[_0xabff('0x41')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xabff('0x3e')](_0xabff('0x46'),LISTID[_0xabff('0x3c')]())[_0xabff('0x3e')](_0xabff('0x47'),squel[_0xabff('0x48')](hopperContacts))['where'](_0xabff('0x3f')))[_0xabff('0x3c')]();return _0x232c49;}function _0x547aa9(_0x2b0588,_0x33c0c6){var _0x5d28f1=squel[_0xabff('0x33')]()['into'](_0xabff('0x4b'))['fromQuery']([_0xabff('0x1f'),_0xabff('0x37'),_0xabff('0x26'),_0x33c0c6,_0xabff('0x38'),_0xabff('0x3d')],squel[_0xabff('0x43')]()[_0xabff('0x39')](_0xabff('0x1f'),'phone')[_0xabff('0x39')]('id',_0xabff('0x37'))[_0xabff('0x39')](LISTID[_0xabff('0x3c')](),_0xabff('0x26'))[_0xabff('0x39')](_0x2b0588['id'][_0xabff('0x3c')](),_0x33c0c6)['field']('NOW()',_0xabff('0x38'))[_0xabff('0x39')](_0xabff('0x3a'),_0xabff('0x3d'))[_0xabff('0x41')](_0xabff('0x44'))[_0xabff('0x3e')](_0xabff('0x45'))[_0xabff('0x3e')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0xabff('0x47'),squel[_0xabff('0x48')](hopperContacts))[_0xabff('0x3e')](_0xabff('0x3f')))[_0xabff('0x3c')]();return _0x5d28f1;}return db[_0xabff('0x4c')][_0xabff('0x4d')]({'where':{'type':_0xabff('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xabff('0x4f'),'where':{'id':LISTID}}]})[_0xabff('0x2c')](function(_0x4dc607){var _0x44279b=[];if(_0x4dc607){var _0x100a48;for(var _0x5b41df=0x0,_0x36759a;_0x5b41df<_0x4dc607[_0xabff('0x18')];_0x5b41df+=0x1){_0x36759a=_0x4dc607[_0x5b41df][_0xabff('0x50')]({'plain':!![]});switch(_0x36759a[_0xabff('0x51')]){case _0xabff('0x52'):_0x44279b[_0xabff('0x53')](db[_0xabff('0x54')]['query'](_0x3b4563(_0x36759a,_0xabff('0x55')))[_0xabff('0x2c')](function(){})[_0xabff('0x2e')](_0x345312()));break;case'onlyIfOpen':_0x44279b[_0xabff('0x53')](db['sequelize'][_0xabff('0x56')](_0x448ca7(_0x36759a,_0xabff('0x55')))['then'](function(){})['catch'](_0x345312()));break;default:_0x44279b['push'](db[_0xabff('0x54')][_0xabff('0x56')](_0x2f8024(_0x36759a,_0xabff('0x55')))[_0xabff('0x2c')](function(){})[_0xabff('0x2e')](_0x345312()));}}}return _0x44279b;})['all']()[_0xabff('0x2c')](function(){return db[_0xabff('0x4c')][_0xabff('0x4d')]({'where':{'type':_0xabff('0x4e')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xabff('0x57'),'where':{'id':LISTID}}]})[_0xabff('0x2c')](function(_0x5dfb2c){var _0x4ef4d1=[];if(_0x5dfb2c){var _0x3452a0;for(var _0x29b478=0x0,_0x4c3894;_0x29b478<_0x5dfb2c[_0xabff('0x18')];_0x29b478+=0x1){_0x4c3894=_0x5dfb2c[_0x29b478][_0xabff('0x50')]({'plain':!![]});_0x4ef4d1[_0xabff('0x53')](db[_0xabff('0x54')]['query'](_0x547aa9(_0x4c3894,_0xabff('0x55')))[_0xabff('0x2c')](function(){})[_0xabff('0x2e')](_0x345312()));}}return _0x4ef4d1;})[_0xabff('0x58')]();})[_0xabff('0x2c')](function(){return db[_0xabff('0x59')]['findAll']({'attributes':['id',_0xabff('0x51')],'include':[{'model':db[_0xabff('0x5a')],'as':'Lists','where':{'id':LISTID}}]})[_0xabff('0x2c')](function(_0x5773ec){var _0x1eaeb=[];if(_0x5773ec){for(var _0x2a52f9=0x0,_0x14e7e2;_0x2a52f9<_0x5773ec['length'];_0x2a52f9+=0x1){_0x14e7e2=_0x5773ec[_0x2a52f9][_0xabff('0x50')]({'plain':!![]});switch(_0x14e7e2['dialCheckDuplicateType']){case'always':_0x1eaeb['push'](db['sequelize'][_0xabff('0x56')](_0x3b4563(_0x14e7e2,_0xabff('0x5b')))[_0xabff('0x2c')](function(){})[_0xabff('0x2e')](_0x345312()));break;case _0xabff('0x5c'):_0x1eaeb[_0xabff('0x53')](db[_0xabff('0x54')][_0xabff('0x56')](_0x448ca7(_0x14e7e2,_0xabff('0x5b')))[_0xabff('0x2c')](function(){})['catch'](_0x345312()));break;default:_0x1eaeb[_0xabff('0x53')](db[_0xabff('0x54')][_0xabff('0x56')](_0x2f8024(_0x14e7e2,_0xabff('0x5b')))['then'](function(){})[_0xabff('0x2e')](_0x345312()));}}}return _0x1eaeb;})['all']();})[_0xabff('0x2c')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xabff('0x57'),'where':{'id':LISTID}}]})[_0xabff('0x2c')](function(_0x166437){var _0x5381ae=[];if(_0x166437){for(var _0x2f2941=0x0,_0x25d50d;_0x2f2941<_0x166437[_0xabff('0x18')];_0x2f2941+=0x1){_0x25d50d=_0x166437[_0x2f2941]['get']({'plain':!![]});_0x5381ae[_0xabff('0x53')](db[_0xabff('0x54')]['query'](_0x547aa9(_0x25d50d,_0xabff('0x5b')))[_0xabff('0x2c')](function(){})[_0xabff('0x2e')](_0x345312()));}}return _0x5381ae;})['all']();})[_0xabff('0x2e')](function(_0x2bf67b){logger[_0xabff('0x12')](_0xabff('0x5d'),_0xabff('0x5e'),_0x2bf67b[_0xabff('0x1a')]);});}var processPromises=function(_0x14f94d){return BPromise[_0xabff('0x58')](promises)[_0xabff('0x2c')](function(_0x2148a0){})[_0xabff('0x2e')](function(_0x1e4d19){logger[_0xabff('0x12')](_0xabff('0x5f'),JSON[_0xabff('0x2f')](_0x1e4d19));})[_0xabff('0x60')](function(){socket[_0xabff('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x14f94d){return _0x14f94d[_0xabff('0x62')]();}});};var endCsv=function(){return BPromise[_0xabff('0x63')]()[_0xabff('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xabff('0x2c')](function(){socket[_0xabff('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xabff('0x64')](FILEPATH);}catch(_0x5e1fd4){logger[_0xabff('0x12')](_0xabff('0x65'),JSON[_0xabff('0x2f')](_0x5e1fd4));}finally{process[_0xabff('0x66')](0x0);}});};process['on'](_0xabff('0x67'),function(){logger['info'](_0xabff('0x68'));endCsv();});function main(){return BPromise[_0xabff('0x63')]()[_0xabff('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xabff('0xf')](',');return db[_0xabff('0x29')][_0xabff('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x30348d){var _0x14af44=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xabff('0x69')](_0x14af44,{'header':!![],'skipEmptyLines':!![],'step':function(_0xc0ffc,_0x3b87bb){total+=0x1;var _0x37f35f=total;promises[_0xabff('0x53')](checkRow(_0xc0ffc,_0x30348d,_0x37f35f)[_0xabff('0x2c')](function(){success+=0x1;})[_0xabff('0x2e')](function(_0xfbc561){if(_0xfbc561[_0xabff('0x12')]){errors+=0x1;delete _0xfbc561[_0xabff('0x12')];}else if(_0xfbc561[_0xabff('0x6a')]){duplicates+=0x1;delete _0xfbc561['duplicate'];}rows[_0xabff('0x53')](_0xfbc561);}));if(total%0xc8===0x0){_0x3b87bb[_0xabff('0x6b')]();return processPromises(_0x3b87bb);}},'complete':function(){return processPromises()[_0xabff('0x2c')](function(){logger[_0xabff('0x6c')](_0xabff('0x6d'));endCsv();});},'error':function(_0x400d02,_0x3756d3){logger[_0xabff('0x6c')](_0xabff('0x6e'),JSON['stringify'](_0x400d02));endCsv();}});})['catch'](function(_0x12eeae){logger[_0xabff('0x12')](_0xabff('0x6f'),JSON[_0xabff('0x2f')](_0x12eeae));});}main(); \ No newline at end of file +var _0x65c6=['id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','VoiceQueue','findAll','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','outbound','CmList','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','register','undefined','argv','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','ListId','CompanyId','find','duplicate','CmContact','create','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','insert'];(function(_0x22ab0c,_0x3f3645){var _0x614230=function(_0x563f4f){while(--_0x563f4f){_0x22ab0c['push'](_0x22ab0c['shift']());}};_0x614230(++_0x3f3645);}(_0x65c6,0xed));var _0x665c=function(_0x2bd6f3,_0x40d5f1){_0x2bd6f3=_0x2bd6f3-0x0;var _0x2a0bc3=_0x65c6[_0x2bd6f3];return _0x2a0bc3;};'use strict';var BPromise=require(_0x665c('0x0'));var util=require('util');var _=require(_0x665c('0x1'));var fs=require('fs');var squel=require(_0x665c('0x2'));var Papa=require(_0x665c('0x3'));var Redis=require(_0x665c('0x4'));var db=require(_0x665c('0x5'))['db'];var config=require(_0x665c('0x6'));var logger=require(_0x665c('0x7'))('api');config[_0x665c('0x8')]=_[_0x665c('0x9')](config[_0x665c('0x8')],{'host':_0x665c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x665c('0xb')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x665c('0xc')||process[_0x665c('0xd')][0x2]===_0x665c('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x665c('0xd')][0x2];if(!process['argv'][0x3]||process[_0x665c('0xd')][0x3]===_0x665c('0xc')||process[_0x665c('0xd')][0x3]===_0x665c('0xe')||!process[_0x665c('0xd')][0x4]||process['argv'][0x4]===_0x665c('0xc')||process[_0x665c('0xd')][0x4]==='null'){throw new Error(_0x665c('0xf'));}var FIELDS=_[_0x665c('0x10')](process[_0x665c('0xd')][0x3]['split'](','),process[_0x665c('0xd')][0x4][_0x665c('0x11')](','));if(!process[_0x665c('0xd')][0x5]||process[_0x665c('0xd')][0x5]===_0x665c('0xc')||process[_0x665c('0xd')][0x5]===_0x665c('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x665c('0xc')&&process[_0x665c('0xd')][0x6]!==_0x665c('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x665c('0xd')][0x7]&&process[_0x665c('0xd')][0x7]!==_0x665c('0xc')&&process['argv'][0x7]!==_0x665c('0xe')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x665c('0xc')||process[_0x665c('0xd')][0x8]===_0x665c('0xe')){throw new Error(_0x665c('0x12'));}var SOCKET_TIMESTAMP=process[_0x665c('0xd')][0x8];}catch(_0x1835c7){logger[_0x665c('0x13')](_0x1835c7);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(_0x25e04c,_0x469ca0,_0x40f80e,_0x4cd17b){var _0xd33265={'message':_0x469ca0};_0xd33265[_0x25e04c]=!![];if(_0x40f80e){_0xd33265[_0x665c('0x14')]=_0x40f80e;}if(_0x4cd17b){_0xd33265['index']=_0x4cd17b;}return _0xd33265;}function isEmail(_0x9fb1e6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x9fb1e6);}function checkRow(_0x332fac,_0x4eb1a6,_0x59ed2f){return new BPromise(function(_0x3cecc3,_0x2f465c){if(_['isNil'](_0x332fac)){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),_0x665c('0x15'),null,_0x59ed2f));}if(_0x332fac[_0x665c('0x16')]&&_0x332fac[_0x665c('0x16')][_0x665c('0x17')]){var _0x1208ed=_[_0x665c('0x18')](_0x332fac[_0x665c('0x16')],_0x665c('0x19'))['join'](';');return _0x2f465c(handleCheckRowError(_0x665c('0x13'),_0x1208ed,null,_0x59ed2f));}var _0x402f7c={};for(var _0x5d9838 in FIELDS){if(FIELDS[_0x665c('0x1a')](_0x5d9838)&&FIELDS[_0x5d9838]){_0x402f7c[_0x5d9838]=_0x332fac[_0x665c('0x1b')][0x0][FIELDS[_0x5d9838]]||_0x332fac[_0x665c('0x1b')][0x0]['\ufeff'+FIELDS[_0x5d9838]];}}if(!_0x402f7c[_0x665c('0x1c')]){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),_0x665c('0x1d'),null,_0x59ed2f));}if(!_0x402f7c[_0x665c('0x1e')]){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),_0x665c('0x1f'),null,_0x59ed2f));}if(_0x402f7c[_0x665c('0x20')]){var _0x51ef9e=moment(_0x402f7c[_0x665c('0x20')],_0x665c('0x21'));if(!_0x51ef9e[_0x665c('0x22')]()){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x59ed2f));}}if(_0x402f7c[_0x665c('0x23')]){if(!isEmail(_0x402f7c[_0x665c('0x23')])){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x59ed2f));}}_0x402f7c[_0x665c('0x24')]=LISTID;_0x402f7c[_0x665c('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x4eb1a6){var _0x4a80c2={};for(var _0xe33e92=0x0,_0x32d47c=DUPLICATES[_0x665c('0x17')];_0xe33e92<_0x32d47c;_0xe33e92+=0x1){_0x4a80c2[DUPLICATES[_0xe33e92]]=_0x402f7c[DUPLICATES[_0xe33e92]];}var _0x2eed3c=_[_0x665c('0x26')](_0x4eb1a6,_0x4a80c2);if(_0x2eed3c){return _0x2f465c(handleCheckRowError(_0x665c('0x27'),'Duplicate\x20Contact',_0x2eed3c,_0x59ed2f));}}return db[_0x665c('0x28')][_0x665c('0x29')](_0x402f7c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x402f7c)})[_0x665c('0x2a')](function(_0x1f3a76){if(DUPLICATES&&DUPLICATES['length']&&_0x4eb1a6){_0x4eb1a6[_0x665c('0x2b')](_['pick'](_0x402f7c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1f3a76['id'];return _0x3cecc3();})[_0x665c('0x2c')](function(_0x2d5eb5){return _0x2f465c(handleCheckRowError(_0x665c('0x13'),_0x665c('0x2d')+(_0x2d5eb5['message']||JSON[_0x665c('0x2e')](_0x2d5eb5)),null,_0x59ed2f));});});}function checkHopper(){function _0x5e82b6(){return function(_0x3e1c0b){logger[_0x665c('0x13')](_0x665c('0x2f'),'checkHopper',util[_0x665c('0x30')](_0x3e1c0b,{'showHidden':![],'depth':null}));};}var _0xe52377=function(_0x318a31,_0xd41054){var _0x666e79=squel['insert']()[_0x665c('0x31')](_0x665c('0x32'))[_0x665c('0x33')](['phone',_0x665c('0x34'),_0x665c('0x35'),_0x665c('0x24'),_0xd41054,_0x665c('0x36'),_0x665c('0x37')],squel[_0x665c('0x38')]()['field'](_0x665c('0x1e'),_0x665c('0x1e'))[_0x665c('0x39')](_0x665c('0x3a'),_0x665c('0x34'))[_0x665c('0x39')]('id',_0x665c('0x35'))[_0x665c('0x39')](LISTID['toString'](),_0x665c('0x24'))[_0x665c('0x39')](_0x318a31['id'][_0x665c('0x3b')](),_0xd41054)[_0x665c('0x39')](_0x665c('0x3a'),_0x665c('0x36'))[_0x665c('0x39')](_0x665c('0x3a'),_0x665c('0x37'))[_0x665c('0x3c')](_0x665c('0x3d'))[_0x665c('0x3e')](_0x665c('0x3f'))[_0x665c('0x3e')]('ListId\x20=\x20?',LISTID[_0x665c('0x3b')]())[_0x665c('0x3e')](_0x665c('0x40'))[_0x665c('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x665c('0x38')]()[_0x665c('0x39')]('phone')[_0x665c('0x3c')](_0x665c('0x32'))[_0x665c('0x3e')](_0xd41054+'\x20=\x20?',_0x318a31['id'][_0x665c('0x3b')]())))['toString']();return _0x666e79;};var _0x3d3c43=function(_0x13c5db,_0x57bd96){var _0x54cb45=squel[_0x665c('0x41')]()['into'](_0x665c('0x32'))[_0x665c('0x33')]([_0x665c('0x1e'),_0x665c('0x34'),_0x665c('0x35'),_0x665c('0x24'),_0x57bd96,_0x665c('0x36'),_0x665c('0x37')],squel[_0x665c('0x38')]()[_0x665c('0x39')](_0x665c('0x1e'),_0x665c('0x1e'))['field']('NOW()',_0x665c('0x34'))[_0x665c('0x39')]('id',_0x665c('0x35'))[_0x665c('0x39')](LISTID[_0x665c('0x3b')](),_0x665c('0x24'))['field'](_0x13c5db['id'][_0x665c('0x3b')](),_0x57bd96)[_0x665c('0x39')](_0x665c('0x3a'),'createdAt')['field']('NOW()',_0x665c('0x37'))[_0x665c('0x3c')]('cm_contacts')['where'](_0x665c('0x3f'))[_0x665c('0x3e')]('ListId\x20=\x20?',LISTID[_0x665c('0x3b')]())[_0x665c('0x3e')](_0x665c('0x42'),squel[_0x665c('0x43')](hopperContacts))[_0x665c('0x3e')](_0x665c('0x40'))[_0x665c('0x3e')](_0x665c('0x44'),squel[_0x665c('0x38')]()[_0x665c('0x39')]('calleridnum')[_0x665c('0x3c')](_0x665c('0x45'))['where'](_0x57bd96+_0x665c('0x46'),_0x13c5db['id'][_0x665c('0x3b')]()))[_0x665c('0x3e')](_0x665c('0x44'),squel[_0x665c('0x38')]()['field'](_0x665c('0x1e'))[_0x665c('0x3c')](_0x665c('0x32'))['where'](_0x57bd96+_0x665c('0x46'),_0x13c5db['id']['toString']())))[_0x665c('0x3b')]();return _0x54cb45;};function _0x32109b(_0x1ecb6b,_0x572f6d){var _0x19dfe6=squel[_0x665c('0x41')]()[_0x665c('0x31')]('cm_hopper')[_0x665c('0x33')]([_0x665c('0x1e'),_0x665c('0x34'),_0x665c('0x35'),_0x665c('0x24'),_0x572f6d,'createdAt',_0x665c('0x37')],squel[_0x665c('0x38')]()['field']('phone',_0x665c('0x1e'))[_0x665c('0x39')](_0x665c('0x3a'),_0x665c('0x34'))[_0x665c('0x39')]('id',_0x665c('0x35'))[_0x665c('0x39')](LISTID['toString'](),_0x665c('0x24'))[_0x665c('0x39')](_0x1ecb6b['id']['toString'](),_0x572f6d)[_0x665c('0x39')](_0x665c('0x3a'),'createdAt')[_0x665c('0x39')](_0x665c('0x3a'),_0x665c('0x37'))[_0x665c('0x3c')](_0x665c('0x3d'))[_0x665c('0x3e')](_0x665c('0x3f'))[_0x665c('0x3e')]('ListId\x20=\x20?',LISTID[_0x665c('0x3b')]())[_0x665c('0x3e')]('id\x20IN\x20?',squel[_0x665c('0x43')](hopperContacts))[_0x665c('0x3e')](_0x665c('0x40')))[_0x665c('0x3b')]();return _0x19dfe6;}function _0x55162f(_0x2dbac2,_0x21d444){var _0x443659=squel[_0x665c('0x41')]()[_0x665c('0x31')](_0x665c('0x47'))[_0x665c('0x33')]([_0x665c('0x1e'),_0x665c('0x35'),'ListId',_0x21d444,'createdAt',_0x665c('0x37')],squel[_0x665c('0x38')]()[_0x665c('0x39')](_0x665c('0x1e'),'phone')[_0x665c('0x39')]('id',_0x665c('0x35'))['field'](LISTID[_0x665c('0x3b')](),_0x665c('0x24'))[_0x665c('0x39')](_0x2dbac2['id'][_0x665c('0x3b')](),_0x21d444)['field'](_0x665c('0x3a'),_0x665c('0x36'))[_0x665c('0x39')]('NOW()',_0x665c('0x37'))[_0x665c('0x3c')](_0x665c('0x3d'))['where'](_0x665c('0x3f'))[_0x665c('0x3e')](_0x665c('0x48'),LISTID[_0x665c('0x3b')]())[_0x665c('0x3e')](_0x665c('0x42'),squel['str'](hopperContacts))[_0x665c('0x3e')](_0x665c('0x40')))[_0x665c('0x3b')]();return _0x443659;}return db[_0x665c('0x49')][_0x665c('0x4a')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x665c('0x4b'),'where':{'id':LISTID}}]})[_0x665c('0x2a')](function(_0x369a7e){var _0x376e22=[];if(_0x369a7e){var _0x45d90b;for(var _0x1e344b=0x0,_0x4a4bfe;_0x1e344b<_0x369a7e['length'];_0x1e344b+=0x1){_0x4a4bfe=_0x369a7e[_0x1e344b][_0x665c('0x4c')]({'plain':!![]});switch(_0x4a4bfe[_0x665c('0x4d')]){case _0x665c('0x4e'):_0x376e22[_0x665c('0x2b')](db[_0x665c('0x4f')][_0x665c('0x50')](_0x3d3c43(_0x4a4bfe,_0x665c('0x51')))[_0x665c('0x2a')](function(){})[_0x665c('0x2c')](_0x5e82b6()));break;case _0x665c('0x52'):_0x376e22[_0x665c('0x2b')](db[_0x665c('0x4f')]['query'](_0xe52377(_0x4a4bfe,_0x665c('0x51')))[_0x665c('0x2a')](function(){})[_0x665c('0x2c')](_0x5e82b6()));break;default:_0x376e22[_0x665c('0x2b')](db[_0x665c('0x4f')]['query'](_0x32109b(_0x4a4bfe,'VoiceQueueId'))[_0x665c('0x2a')](function(){})[_0x665c('0x2c')](_0x5e82b6()));}}}return _0x376e22;})['all']()[_0x665c('0x2a')](function(){return db[_0x665c('0x49')][_0x665c('0x4a')]({'where':{'type':_0x665c('0x53')},'attributes':['id'],'include':[{'model':db[_0x665c('0x54')],'as':_0x665c('0x55'),'where':{'id':LISTID}}]})[_0x665c('0x2a')](function(_0x2b452f){var _0x47eb9b=[];if(_0x2b452f){var _0x11ffd1;for(var _0x3158ba=0x0,_0x10e4fc;_0x3158ba<_0x2b452f[_0x665c('0x17')];_0x3158ba+=0x1){_0x10e4fc=_0x2b452f[_0x3158ba][_0x665c('0x4c')]({'plain':!![]});_0x47eb9b['push'](db[_0x665c('0x4f')][_0x665c('0x50')](_0x55162f(_0x10e4fc,_0x665c('0x51')))['then'](function(){})[_0x665c('0x2c')](_0x5e82b6()));}}return _0x47eb9b;})[_0x665c('0x56')]();})['then'](function(){return db[_0x665c('0x57')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x665c('0x54')],'as':_0x665c('0x4b'),'where':{'id':LISTID}}]})[_0x665c('0x2a')](function(_0x17764c){var _0x78715f=[];if(_0x17764c){for(var _0x24103c=0x0,_0x380490;_0x24103c<_0x17764c[_0x665c('0x17')];_0x24103c+=0x1){_0x380490=_0x17764c[_0x24103c][_0x665c('0x4c')]({'plain':!![]});switch(_0x380490[_0x665c('0x4d')]){case'always':_0x78715f[_0x665c('0x2b')](db['sequelize'][_0x665c('0x50')](_0x3d3c43(_0x380490,_0x665c('0x58')))['then'](function(){})[_0x665c('0x2c')](_0x5e82b6()));break;case'onlyIfOpen':_0x78715f[_0x665c('0x2b')](db[_0x665c('0x4f')][_0x665c('0x50')](_0xe52377(_0x380490,'CampaignId'))[_0x665c('0x2a')](function(){})['catch'](_0x5e82b6()));break;default:_0x78715f['push'](db[_0x665c('0x4f')][_0x665c('0x50')](_0x32109b(_0x380490,'CampaignId'))[_0x665c('0x2a')](function(){})['catch'](_0x5e82b6()));}}}return _0x78715f;})[_0x665c('0x56')]();})[_0x665c('0x2a')](function(){return db[_0x665c('0x57')][_0x665c('0x4a')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x665c('0x55'),'where':{'id':LISTID}}]})[_0x665c('0x2a')](function(_0x4cca59){var _0x10c201=[];if(_0x4cca59){for(var _0x4f01bc=0x0,_0x2284cc;_0x4f01bc<_0x4cca59['length'];_0x4f01bc+=0x1){_0x2284cc=_0x4cca59[_0x4f01bc][_0x665c('0x4c')]({'plain':!![]});_0x10c201[_0x665c('0x2b')](db['sequelize'][_0x665c('0x50')](_0x55162f(_0x2284cc,_0x665c('0x58')))[_0x665c('0x2a')](function(){})[_0x665c('0x2c')](_0x5e82b6()));}}return _0x10c201;})[_0x665c('0x56')]();})[_0x665c('0x2c')](function(_0x3911b4){logger[_0x665c('0x13')](_0x665c('0x59'),'generalCheckHopper',_0x3911b4[_0x665c('0x19')]);});}var processPromises=function(_0x3cccb4){return BPromise[_0x665c('0x56')](promises)[_0x665c('0x2a')](function(_0x5dfffc){})[_0x665c('0x2c')](function(_0x478f78){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x665c('0x2e')](_0x478f78));})['finally'](function(){socket[_0x665c('0x5a')](_0x665c('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3cccb4){return _0x3cccb4['resume']();}});};var endCsv=function(){return BPromise[_0x665c('0x5c')]()[_0x665c('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x665c('0x2a')](function(){socket[_0x665c('0x5a')](_0x665c('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3fdad0){logger['error'](_0x665c('0x5d'),JSON[_0x665c('0x2e')](_0x3fdad0));}finally{process['exit'](0x0);}});};process['on'](_0x665c('0x5e'),function(){logger[_0x665c('0x5f')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x665c('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x665c('0x11')](',');return db[_0x665c('0x28')][_0x665c('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x665c('0x2a')](function(_0x109af1){var _0x3302f8=fs[_0x665c('0x60')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x665c('0x61')](_0x3302f8,{'header':!![],'skipEmptyLines':!![],'step':function(_0x149ff6,_0x1dccd3){total+=0x1;var _0x168a6b=total;promises[_0x665c('0x2b')](checkRow(_0x149ff6,_0x109af1,_0x168a6b)[_0x665c('0x2a')](function(){success+=0x1;})[_0x665c('0x2c')](function(_0x31e534){if(_0x31e534[_0x665c('0x13')]){errors+=0x1;delete _0x31e534[_0x665c('0x13')];}else if(_0x31e534[_0x665c('0x27')]){duplicates+=0x1;delete _0x31e534[_0x665c('0x27')];}rows[_0x665c('0x2b')](_0x31e534);}));if(total%0xc8===0x0){_0x1dccd3[_0x665c('0x62')]();return processPromises(_0x1dccd3);}},'complete':function(){return processPromises()[_0x665c('0x2a')](function(){logger[_0x665c('0x5f')](_0x665c('0x63'));endCsv();});},'error':function(_0x57e7be,_0x317b7b){logger[_0x665c('0x5f')]('CSV\x20parse\x20error',JSON[_0x665c('0x2e')](_0x57e7be));endCsv();}});})[_0x665c('0x2c')](function(_0x757d5a){logger[_0x665c('0x13')](_0x665c('0x64'),JSON['stringify'](_0x757d5a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 45dcfc1..64d8dd2 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 _0xfe0a=['writeFileSync','parse','rows','data','find','trim','replace','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','AdditionalPhones','then','length','push','all','split','isNil','filter','findOne','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','into','cm_hopper_black','updatedAt','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.UserId','recallme','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','errors','code','message','query','spread','error','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','catch','timezones','dialTimezone','set','offset','info','stringify','send','start','clone','root','server/files/tmp','header','ContactItemType','findAll','name','_description'];(function(_0x3a902a,_0xca8442){var _0x24f2d5=function(_0xb6799a){while(--_0xb6799a){_0x3a902a['push'](_0x3a902a['shift']());}};_0x24f2d5(++_0xca8442);}(_0xfe0a,0x1a8));var _0xafe0=function(_0x4d9a42,_0x4baeaa){_0x4d9a42=_0x4d9a42-0x0;var _0x5833d3=_0xfe0a[_0x4d9a42];return _0x5833d3;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xafe0('0x0'));var Papa=require(_0xafe0('0x1'));var util=require(_0xafe0('0x2'));var BPromise=require(_0xafe0('0x3'));var moment=require('moment');var squel=require(_0xafe0('0x4'));var Redis=require(_0xafe0('0x5'));var db=require(_0xafe0('0x6'))['db'];var config=require(_0xafe0('0x7'));var shared=require(_0xafe0('0x8'));var logger=require(_0xafe0('0x9'))(_0xafe0('0xa'));config[_0xafe0('0xb')]=_[_0xafe0('0xc')](config[_0xafe0('0xb')],{'host':_0xafe0('0xd'),'port':0x18eb});var socket=require(_0xafe0('0xe'))(new Redis(config[_0xafe0('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xafe0('0xf')](_0xafe0('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xafe0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1db188){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1db188);}function selectNotIn(_0x3b7703,_0x2294e3,_0x4a7fac,_0x123b76,_0x52fc9a){return squel[_0xafe0('0x11')]()[_0xafe0('0x12')](_0xafe0('0x13'))[_0xafe0('0x14')](_0x123b76)[_0xafe0('0x15')](_0x2294e3,null,_0x2294e3+_0xafe0('0x16')+_0x123b76+'.'+_0x4a7fac)['where'](_0x123b76+'.'+_0x4a7fac+_0xafe0('0x17')+_0x3b7703+'.'+_0x4a7fac)[_0xafe0('0x18')](_0x2294e3+_0xafe0('0x19')+_0x52fc9a['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x491c7e,_0x25f52d){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0xafe0('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xafe0('0x1b')](function(_0x2ef880){if(_0x2ef880!==null){var _0x5ee615=[];for(var _0x3381f2=0x0;_0x3381f2<_0x2ef880[_0xafe0('0x1c')];_0x3381f2++){var _0x427ec4=_0x2ef880[_0x3381f2];_0x5ee615[_0xafe0('0x1d')](insertAdditionalPhones(_0x427ec4));}}Promise[_0xafe0('0x1e')](_0x5ee615)[_0xafe0('0x1b')](function(){_0x491c7e({'val':0x1});});});});}function insertAdditionalPhones(_0x13427c){return new Promise(function(_0x4da788,_0x4476b3){var _0x469dae=_0x13427c[_0xafe0('0x1a')];var _0x112820=_0x469dae[_0xafe0('0x1f')](';');var _0xdac6f3=[];orderBy=0x0;for(var _0x22593c=0x0;_0x22593c<_0x112820[_0xafe0('0x1c')];_0x22593c++){_0xdac6f3['push'](splitAdditionalPhone(_0x13427c['id'],_0x112820[_0x22593c]));}Promise[_0xafe0('0x1e')](_0xdac6f3)[_0xafe0('0x1b')](function(){_0x4da788({'val':_0x112820['length']});});});}function splitAdditionalPhone(_0x5363e7,_0x3754a6){return new Promise(function(_0xc0b088,_0x314889){var _0x417ab2=_0x3754a6[_0xafe0('0x1f')](':');var _0x20bcef=_0x417ab2[0x0];var _0x4cb245=_0x417ab2[0x1];if(!_[_0xafe0('0x20')](_0x4cb245)){var _0x486b69=_0x4cb245[_0xafe0('0x1f')]('|');var _0x46a36e=[];for(var _0x35fbac=0x0;_0x35fbac<_0x486b69[_0xafe0('0x1c')];_0x35fbac++){if(_0x486b69[_0x35fbac]!==''){var _0x4d5abc=_[_0xafe0('0x21')](promisesAdditionalPhones,{'contactId':_0x5363e7,'phone':_0x486b69[_0x35fbac]});if(_0x4d5abc[_0xafe0('0x1c')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x5363e7,'contactTypeId':_0x20bcef,'phone':_0x486b69[_0x35fbac],'orderBy':orderBy});}}}_0xc0b088({'ok':0x1});}else _0xc0b088({'res':0x0});});}function createAdditionalPhone(_0x4228c9,_0x554cfc,_0x59b201,_0xb2bfb4){var _0x54c8ff='';var _0x1925c3='';var _0x5efa41=_0x59b201[_0xafe0('0x1f')]('§');_0x54c8ff=_0x5efa41[0x0];if(_0x5efa41[_0xafe0('0x1c')]==0x2)_0x1925c3=_0x5efa41[0x1];return new Promise(function(_0x4b986d,_0x17f253){return db['CmContactHasItem'][_0xafe0('0x22')]({'where':{'CmContactId':_0x4228c9,'item':_0x54c8ff}})[_0xafe0('0x1b')](function(_0x3d3570){if(_0x3d3570){return db['CmContactHasItem']['update']({'ItemTypeId':_0x554cfc,'description':_0x1925c3,'OrderBy':_0xb2bfb4},{'where':{'CmContactId':_0x4228c9,'item':_0x54c8ff}})['then'](function(_0x2ad5fc){_0x4b986d({'res':'updated'});});}else{return db[_0xafe0('0x23')][_0xafe0('0x24')]({'CmContactId':_0x4228c9,'item':_0x54c8ff,'description':_0x1925c3,'ItemTypeId':_0x554cfc,'OrderBy':_0xb2bfb4,'ItemClass':_0xafe0('0x25')})[_0xafe0('0x1b')](function(_0x2cdd7b){_0x4b986d({'res':_0xafe0('0x26')});});}});});}function insertCmHopper(_0x262ec3,_0x2e3da3,_0x338675,_0x5d479b,_0x586d3e){var _0xf751d1=[_0xafe0('0x27'),'cm_contacts.scheduledat','cm_contacts.id',_0xafe0('0x28'),_0x2e3da3+'.'+_0x5d479b,_0xafe0('0x29'),_0xafe0('0x2a'),_0xafe0('0x2b'),'cm_contacts.UserId','\x22'+_0x586d3e+'\x22'];return squel[_0xafe0('0x2c')]()['into']('cm_hopper')[_0xafe0('0x2d')]([_0xafe0('0x13'),_0xafe0('0x2e'),_0xafe0('0x2f'),_0xafe0('0x30'),_0x5d479b,_0xafe0('0x31'),'updatedAt',_0xafe0('0x32'),_0xafe0('0x33'),'recallme'],squel['select']()[_0xafe0('0x34')](_0xf751d1)['from'](_0x2e3da3)['join'](_0xafe0('0x35'),null,_0xafe0('0x36')+_0x2e3da3+'.CmListId')[_0xafe0('0x15')](_0x338675,null,_0x338675+_0xafe0('0x16')+_0x2e3da3+'.'+_0x5d479b)[_0xafe0('0x18')](_0x2e3da3+_0xafe0('0x37'),_0x262ec3)[_0xafe0('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xafe0('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e3da3,_0x338675,_0x5d479b,_0xafe0('0x38'),[_0xafe0('0x39'),_0xafe0('0x3a')]))[_0xafe0('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e3da3,_0x338675,_0x5d479b,'cm_hopper',[_0xafe0('0x39')])))[_0xafe0('0x3b')]();}function insertCmHopperBlack(_0x18adcc,_0x1834e7,_0x780fa7,_0x344413){var _0xbfe15f=[_0xafe0('0x27'),_0xafe0('0x3c'),_0xafe0('0x28'),_0x1834e7+'.'+_0x344413,_0xafe0('0x29'),'cm_contacts.updatedAt'];return squel['insert']()[_0xafe0('0x3d')](_0xafe0('0x3e'))['fromQuery']([_0xafe0('0x13'),_0xafe0('0x2f'),_0xafe0('0x30'),_0x344413,'createdAt',_0xafe0('0x3f')],squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0xbfe15f)[_0xafe0('0x14')](_0x1834e7)[_0xafe0('0x15')](_0xafe0('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x1834e7+_0xafe0('0x40'))[_0xafe0('0x15')](_0x780fa7,null,_0x780fa7+_0xafe0('0x16')+_0x1834e7+'.'+_0x344413)[_0xafe0('0x18')](_0x1834e7+'.CmListId\x20=\x20?',_0x18adcc)[_0xafe0('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xafe0('0x41'),squel[_0xafe0('0x11')]()[_0xafe0('0x12')](_0xafe0('0x13'))[_0xafe0('0x14')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x18adcc)[_0xafe0('0x18')](_0x344413+_0xafe0('0x17')+_0x1834e7+'.'+_0x344413)))[_0xafe0('0x3b')]();}function insertTzCmHopper(_0x8b05b9,_0x54cbb2,_0xa57277,_0x5cd9aa,_0x526c0d,_0x361b15){var _0x4eae31=[_0xafe0('0x27'),_0xafe0('0x42')+_0x361b15+'.offset-cm_contacts.utcOffset\x20minute)',_0xafe0('0x3c'),'cm_contacts.ListId',_0x54cbb2+'.'+_0x5cd9aa,_0xafe0('0x29'),_0xafe0('0x2a'),_0xafe0('0x2b'),_0xafe0('0x43'),'\x22'+_0x526c0d+'\x22'];var _0x542753=squel[_0xafe0('0x2c')]()[_0xafe0('0x3d')](_0xafe0('0x38'))[_0xafe0('0x2d')]([_0xafe0('0x13'),_0xafe0('0x2e'),_0xafe0('0x2f'),'ListId',_0x5cd9aa,'createdAt',_0xafe0('0x3f'),_0xafe0('0x32'),'UserId',_0xafe0('0x44')],squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0x4eae31)['from'](_0x54cbb2)[_0xafe0('0x15')](_0xafe0('0x35'),null,_0xafe0('0x36')+_0x54cbb2+_0xafe0('0x40'))[_0xafe0('0x15')](_0xa57277,null,_0xa57277+_0xafe0('0x16')+_0x54cbb2+'.'+_0x5cd9aa)[_0xafe0('0x15')](_0x361b15,null,_0x361b15+_0xafe0('0x16')+_0x54cbb2+'.'+_0x5cd9aa)[_0xafe0('0x18')](_0x54cbb2+_0xafe0('0x37'),_0x8b05b9)[_0xafe0('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xafe0('0x18')](_0xafe0('0x41'),selectNotIn(_0x54cbb2,_0xa57277,_0x5cd9aa,_0xafe0('0x38'),[_0xafe0('0x39'),_0xafe0('0x3a')]))['where'](_0xafe0('0x41'),selectNotIn(_0x54cbb2,_0xa57277,_0x5cd9aa,_0xafe0('0x38'),[_0xafe0('0x39')])))[_0xafe0('0x3b')]();return _0x542753;}function insertTzCmHopperBlack(_0x1b5299,_0x78888b,_0x4086d0,_0xa481a8){var _0x23868c=[_0xafe0('0x27'),'cm_contacts.id',_0xafe0('0x28'),_0x78888b+'.'+_0xa481a8,'cm_contacts.createdAt',_0xafe0('0x2a')];return squel[_0xafe0('0x2c')]()['into'](_0xafe0('0x3e'))[_0xafe0('0x2d')](['phone',_0xafe0('0x2f'),_0xafe0('0x30'),_0xa481a8,_0xafe0('0x31'),_0xafe0('0x3f')],squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0x23868c)[_0xafe0('0x14')](_0x78888b)['join']('cm_contacts',null,_0xafe0('0x36')+_0x78888b+_0xafe0('0x40'))['join'](_0x4086d0,null,_0x4086d0+'.id\x20=\x20'+_0x78888b+'.'+_0xa481a8)['where'](_0x78888b+'.CmListId\x20=\x20?',_0x1b5299)['where'](_0xafe0('0x45'),NOW)[_0xafe0('0x18')](_0xafe0('0x41'),squel[_0xafe0('0x11')]()[_0xafe0('0x12')](_0xafe0('0x13'))['from']('cm_hopper_black')['where'](_0xafe0('0x46'),_0x1b5299)[_0xafe0('0x18')](_0xa481a8+'\x20=\x20'+_0x78888b+'.'+_0xa481a8)))[_0xafe0('0x3b')]();}function insertCmHopperAdditionalPhones(_0x2f3f89){var _0x2f3063=[_0xafe0('0x47'),_0xafe0('0x48'),'cm_contact_has_items.OrderBy',_0xafe0('0x49'),_0xafe0('0x4a')];return squel[_0xafe0('0x2c')]()[_0xafe0('0x3d')](_0xafe0('0x4b'))['fromQuery']([_0xafe0('0x4c'),_0xafe0('0x13'),_0xafe0('0x4d'),_0xafe0('0x31'),'updatedAt'],squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0x2f3063)[_0xafe0('0x14')]('cm_hopper')['join'](_0xafe0('0x35'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xafe0('0x15')](_0xafe0('0x4e'),null,_0xafe0('0x4f'))[_0xafe0('0x18')](_0xafe0('0x50'),_0x2f3f89)[_0xafe0('0x18')](_0xafe0('0x45'),NOW))['toString']();}function insertCmContact(_0x3d662a,_0x527875,_0x39e596,_0x50168a){var _0x2a163d=_[_0xafe0('0x51')](_[_0xafe0('0x52')](_0x50168a),[_0xafe0('0x30'),_0xafe0('0x53'),_0xafe0('0x31'),'updatedAt',_0xafe0('0x54')]);return squel[_0xafe0('0x2c')]()['into']('cm_contacts')[_0xafe0('0x2d')](_0x2a163d,squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0x2a163d)['from'](_0x527875)['where']('('+_0x39e596[_0xafe0('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0xafe0('0x11')]()[_0xafe0('0x34')](_0x39e596)[_0xafe0('0x14')]('cm_contacts')[_0xafe0('0x18')]('ListId\x20=\x20?',_0x3d662a)[_0xafe0('0x18')](_0xafe0('0x55')))[_0xafe0('0x18')](_0xafe0('0x56'),squel[_0xafe0('0x11')]()['field'](_0xafe0('0x57'),'min_id')[_0xafe0('0x14')](_0x527875)[_0xafe0('0x58')](_0x39e596[_0xafe0('0x15')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x436724){logger['error'](_0x436724['message']);process['exit'](0x1);}function handleError(_0xf86506,_0x5e7d51){stats[_0xafe0('0x59')][_0xafe0('0x1d')]({'name':_0x5e7d51[_0xafe0('0x5a')],'message':_0x5e7d51[_0xafe0('0x5b')],'row':_0xf86506});}function handleQuery(_0x16d0db){logger['info'](_0x16d0db);return db['sequelize'][_0xafe0('0x5c')](_0x16d0db)[_0xafe0('0x5d')](function(_0x3edcd1){results[_0xafe0('0x1d')](_0x3edcd1);})['catch'](function(_0xc4854c){logger[_0xafe0('0x5e')](_0xc4854c['message']);});}function updateTzCampaigns(_0x75ce86){return new Promise(function(_0x163527,_0x51eb4f){var _0x5a2be5=squel[_0xafe0('0x11')]()['fields']([_0xafe0('0x5f'),'campaigns.dialTimezone'])[_0xafe0('0x14')](_0xafe0('0x60'))['join'](_0xafe0('0x61'),null,_0xafe0('0x62'))[_0xafe0('0x18')]('campaigns_has_cm_lists.CmListId='+_0x75ce86);db['sequelize'][_0xafe0('0x5c')](_0x5a2be5[_0xafe0('0x3b')]())['spread'](function(_0x4f41a9){var _0x1cceb8=[];for(var _0x5b4f28=0x0;_0x5b4f28<_0x4f41a9[_0xafe0('0x1c')];_0x5b4f28++){_0x1cceb8['push'](getTimezoneData(_0x4f41a9[_0x5b4f28],tmp_campaigns));}BPromise[_0xafe0('0x1e')](_0x1cceb8)[_0xafe0('0x1b')](function(){_0x163527({'val':0x1});});})['catch'](function(_0x5bb816){logger[_0xafe0('0x5e')](_0x5bb816[_0xafe0('0x5b')]);_0x163527({'val':0x0});});});}function updateTzVoiceQueues(_0x280c91){return new Promise(function(_0x2cace9,_0x592686){var _0x2fc4f9=squel[_0xafe0('0x11')]()['fields']([_0xafe0('0x63'),_0xafe0('0x64')])[_0xafe0('0x14')](_0xafe0('0x65'))['join']('voice_queues_has_cm_lists',null,_0xafe0('0x66'))[_0xafe0('0x18')](_0xafe0('0x67')+_0x280c91);db[_0xafe0('0x68')][_0xafe0('0x5c')](_0x2fc4f9[_0xafe0('0x3b')]())[_0xafe0('0x5d')](function(_0x2988b8){var _0x3587e1=[];for(var _0x53a095=0x0;_0x53a095<_0x2988b8[_0xafe0('0x1c')];_0x53a095++){_0x3587e1[_0xafe0('0x1d')](getTimezoneData(_0x2988b8[_0x53a095],tmp_voice_queues));}BPromise[_0xafe0('0x1e')](_0x3587e1)[_0xafe0('0x1b')](function(){_0x2cace9({'val':0x1});});})[_0xafe0('0x69')](function(_0x23a8cc){logger[_0xafe0('0x5e')](_0x23a8cc[_0xafe0('0x5b')]);_0x2cace9({'val':0x0});});});}function getTimezoneData(_0x537211,_0xcda4ff){return new Promise(function(_0x4c854d,_0xf7503e){var _0x486ddf=shared[_0xafe0('0x6a')];var _0x31557e=_0x486ddf[_0x537211[_0xafe0('0x6b')]];if(_[_0xafe0('0x20')](_0x31557e)){_0x4c854d({'ret':0x1});}else{var _0x2e8edb=_0x31557e['utcOffset'];var _0x58d171=squel[_0xafe0('0x2c')]()[_0xafe0('0x3d')](_0xcda4ff)['set']('id',_0x537211['id'])[_0xafe0('0x6c')](_0xafe0('0x6d'),_0x2e8edb)['set']('dialTimezone',_0x537211['dialTimezone'])[_0xafe0('0x3b')]();return db[_0xafe0('0x68')][_0xafe0('0x5c')](_0x58d171)[_0xafe0('0x5d')](function(_0x270af1){_0x4c854d({'ret':0x1});})[_0xafe0('0x69')](function(_0x49a1a9){logger[_0xafe0('0x5e')](_0x49a1a9[_0xafe0('0x5b')]);_0xf7503e({'ret':0x1});});}});}function handleTZQuery(_0x2b796a){logger[_0xafe0('0x6e')](_0x2b796a);return db[_0xafe0('0x68')]['query'](_0x2b796a)[_0xafe0('0x5d')](function(_0x3cde7d){})['catch'](function(_0x55b8f2){logger[_0xafe0('0x5e')](_0x55b8f2[_0xafe0('0x5b')]);});}function main(_0x1147c5,_0x3c94d5,_0x2908af,_0x353594){logger[_0xafe0('0x6e')]('main',_0x1147c5,JSON[_0xafe0('0x6f')](_0x3c94d5));process[_0xafe0('0x70')](_0xafe0('0x71'));var _0x29db3d=_0x3c94d5['binding'];var _0x2f385c=_[_0xafe0('0x72')](_0x29db3d);var _0x1b1860=_0x3c94d5['socket_timestamp'];var _0x555b87=path[_0xafe0('0x15')](config[_0xafe0('0x73')],_0xafe0('0x74'),_0x1b1860+'.csv');hasTZ=_[_0xafe0('0x52')](_0x29db3d)['includes'](_0xafe0('0x6b'));var _0x21bec5=_[_0xafe0('0x52')](_0x29db3d)[_0xafe0('0x15')]();logger[_0xafe0('0x6e')](_0xafe0('0x75'),_0x21bec5);db[_0xafe0('0x76')][_0xafe0('0x77')]({'raw':!![],'attributes':['id','name']})[_0xafe0('0x1b')](function(_0x3b8a8b){for(var _0x292b15=0x0;_0x292b15<_0x3b8a8b[_0xafe0('0x1c')];_0x292b15++){if(_0x3b8a8b[_0x292b15][_0xafe0('0x78')]in _0x29db3d){contactItemTypes['push'](_0x3b8a8b[_0x292b15]);delete _0x2f385c[_0x3b8a8b[_0x292b15][_0xafe0('0x78')]];hasAdditionalPhones=!![];}for(var _0x12b989 in _0x29db3d){if(_0x3b8a8b[_0x292b15][_0xafe0('0x78')]+_0xafe0('0x79')===_0x12b989){phoneDescriptions[_0xafe0('0x1d')]({'itemTypeId':_0x3b8a8b[_0x292b15]['id'],'description':_0x12b989});delete _0x2f385c[_0x12b989];}}}if(hasAdditionalPhones)_0x2f385c[_0xafe0('0x1a')]='';var _0x3e0207=_[_0xafe0('0x52')](_0x2f385c)['join']();logger[_0xafe0('0x6e')](_0xafe0('0x75'),_0x3e0207);fs[_0xafe0('0x7a')](_0x555b87,_0x3e0207+'\x0a');Papa[_0xafe0('0x7b')](fs['createReadStream'](_0x1147c5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x352488,_0x5ac340){try{for(var _0x23231a=0x0,_0x32b2ba=[];_0x23231a<_0x352488['data'][_0xafe0('0x1c')];_0x23231a++){stats[_0xafe0('0x7c')]+=0x1;if(_0x352488[_0xafe0('0x59')][_0x23231a]){handleError(_0x352488[_0xafe0('0x7d')][_0x23231a],_0x352488[_0xafe0('0x59')][_0x23231a]);}else{var _0x37c935=[];var _0x329fa8=[];var _0x440c93={};for(var _0x1c571a in _0x29db3d){let _0x463622=contactItemTypes[_0xafe0('0x7e')](_0x485539=>_0x485539['name']===_0x1c571a);let _0x50357e=contactItemTypes['find'](_0x12e22d=>_0x12e22d['name']+_0xafe0('0x79')===_0x1c571a);if(_['isNil'](_0x463622)&&_[_0xafe0('0x20')](_0x50357e)){if(_0x29db3d['hasOwnProperty'](_0x1c571a)){if(_0x352488['data'][_0x23231a][_0x29db3d[_0x1c571a]]){var _0x19773f=_[_0xafe0('0x7f')](_0x352488[_0xafe0('0x7d')][_0x23231a][_0x29db3d[_0x1c571a]][_0xafe0('0x80')](/"/g,'\x27'));switch(_0x1c571a){case _0xafe0('0x2e'):var _0x2f3892=moment(_0x19773f,_0xafe0('0x10'),!![]);if(_0x2f3892['isValid']()){_0x32b2ba['push']('\x22'+_0x19773f+'\x22');}else{_0x37c935[_0xafe0('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xafe0('0x32'):var _0x3178d2=parseInt(_0x19773f);_0x19773f=_[_0xafe0('0x81')](_0x3178d2)||_0x3178d2<0x0||_0x3178d2>0x4?_0x353594?0x3:0x2:_0x3178d2;_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x19773f+'\x22');break;case _0xafe0('0x33'):var _0x547295=parseInt(_0x19773f);if(_[_0xafe0('0x82')](_0x547295)&&_[_0xafe0('0x83')](_0x2908af,_0x547295)){_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x547295+'\x22');}else{_0x37c935['push'](_0xafe0('0x84'));}break;case _0xafe0('0x85'):if(isEmail(_0x19773f)){_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x19773f+'\x22');}else{_0x37c935[_0xafe0('0x1d')](_0xafe0('0x86'));}break;case _0xafe0('0x87'):var _0x1b96b7=moment(_0x19773f,'YYYY-MM-DD',!![]);if(_0x1b96b7[_0xafe0('0x88')]()){_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x19773f+'\x22');}else{_0x37c935['push'](_0xafe0('0x89'));}break;case'dialTimezone':var _0x577936=shared[_0xafe0('0x6a')];var _0x191921=_0x577936[_0x19773f];if(!_[_0xafe0('0x20')](_0x191921)){var _0x427199=_0x191921['utcOffset'];_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x19773f+'\x22');_0x32b2ba['push']('\x22'+_0x427199+'\x22');}break;default:_0x32b2ba['push']('\x22'+_0x19773f+'\x22');}}else{switch(_0x1c571a){case _0xafe0('0x8a'):case _0xafe0('0x13'):_0x37c935[_0xafe0('0x1d')](_0x1c571a+_0xafe0('0x8b'));break;default:_0x32b2ba[_0xafe0('0x1d')]('\x22\x22');}}}}else{var _0x32cc76='';if(!_[_0xafe0('0x20')](_0x463622)){if(!_0x440c93[_0xafe0('0x8c')](_0x463622['id'])){if(!_[_0xafe0('0x20')](_0x352488[_0xafe0('0x7d')][_0x23231a][_0x29db3d[_0x1c571a]])){var _0x19773f=_[_0xafe0('0x7f')](_0x352488[_0xafe0('0x7d')][_0x23231a][_0x29db3d[_0x1c571a]][_0xafe0('0x80')](/"/g,'\x27'));var _0x3d9321=phoneDescriptions[_0xafe0('0x7e')](_0x452a61=>_0x452a61[_0xafe0('0x8d')]===_0x463622['id']);if(!_[_0xafe0('0x20')](_0x3d9321)){var _0x2d3382=_[_0xafe0('0x7f')](_0x352488[_0xafe0('0x7d')][_0x23231a][_0x29db3d[_0x3d9321[_0xafe0('0x8e')]]][_0xafe0('0x80')](/"/g,'\x27'));if(!_[_0xafe0('0x20')](_0x2d3382))_0x19773f=_0x19773f+'§'+_0x2d3382;}if(_0x32cc76=='')_0x32cc76=_0x19773f;else _0x32cc76+='|'+_0x19773f;}_0x329fa8['push'](_0x463622['id']+':'+_0x32cc76);_0x440c93[_0x463622['id']]=0x1;}}}}if(hasAdditionalPhones){_0x32b2ba[_0xafe0('0x1d')]('\x22'+_0x329fa8[_0xafe0('0x15')](';')+'\x22');}if(_0x37c935[_0xafe0('0x1c')]){handleError(_0x352488[_0xafe0('0x7d')][_0x23231a],{'code':_0xafe0('0x8f'),'message':_0x37c935[_0xafe0('0x15')]()});}else{fs['appendFileSync'](_0x555b87,_0x32b2ba[_0xafe0('0x15')]()+'\x0a');}_0x32b2ba=[];}if(!(stats[_0xafe0('0x7c')]%0xc8)){socket[_0xafe0('0x90')](_0xafe0('0x91')+_0x1b1860,stats);stats[_0xafe0('0x59')]=[];}}if(stopped){logger['info'](_0xafe0('0x92'));_0x5ac340[_0xafe0('0x93')]();}}catch(_0x1f1812){handleError(_0x352488[_0xafe0('0x7d')][_0x23231a],{'code':_0xafe0('0x94'),'message':_0x1f1812[_0xafe0('0x5b')]});logger[_0xafe0('0x5e')](_0xafe0('0x95'),_0x1f1812[_0xafe0('0x5b')]);}},'complete':function(){try{var _0x2c1138=[];var _0x43ea7d=[];var _0x594f9b=_0xafe0('0x35');if(_0x3c94d5[_0xafe0('0x96')]&&_0x3c94d5[_0xafe0('0x96')][_0xafe0('0x1c')]){_0x594f9b='cm_contacts_'+_0x1b1860;_0x2c1138['push'](_0xafe0('0x97')+_0x594f9b+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xafe0('0x98')+_0x1b1860;tmp_voice_queues='voice_queues_'+_0x1b1860;_0x43ea7d[_0xafe0('0x1d')](_0xafe0('0x97')+tmp_campaigns+_0xafe0('0x99'));_0x43ea7d[_0xafe0('0x1d')](_0xafe0('0x97')+tmp_voice_queues+_0xafe0('0x99'));BPromise[_0xafe0('0x9a')](_0x43ea7d,handleTZQuery)['then'](function(_0x3cbbee){updateTzCampaigns(_0x3c94d5[_0xafe0('0x30')])[_0xafe0('0x1b')](function(_0x2355b3){updateTzVoiceQueues(_0x3c94d5[_0xafe0('0x30')])[_0xafe0('0x1b')](function(_0x2f912a){if(hasTZ)_0x3e0207=_0x3e0207['replace'](_0xafe0('0x6b'),_0xafe0('0x9b'));var _0x5de21d=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',_0x555b87,_0x594f9b,_0x3e0207,_0x3c94d5['ListId'],_0x3c94d5[_0xafe0('0x53')]||null,NOW,NOW);if(_[_0xafe0('0x20')](_0x29db3d['scheduledat'])){_0x5de21d+=_0xafe0('0x9c');}_0x2c1138[_0xafe0('0x1d')](_0x5de21d);if(_0x3c94d5[_0xafe0('0x96')]&&_0x3c94d5[_0xafe0('0x96')][_0xafe0('0x1c')]){_0x2c1138[_0xafe0('0x1d')](insertCmContact(_0x3c94d5[_0xafe0('0x30')],_0x594f9b,_0x3c94d5[_0xafe0('0x96')],_0x29db3d));_0x2c1138[_0xafe0('0x1d')]('DROP\x20TABLE\x20'+_0x594f9b+';');}BPromise['each'](_0x2c1138,handleQuery)[_0xafe0('0x1b')](function(_0x2a3539){BPromise[_0xafe0('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x2c1138=[];for(var _0x382068=0x0;_0x382068\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test'];(function(_0x1adea2,_0x301398){var _0x3e4b85=function(_0x1c3c68){while(--_0x1c3c68){_0x1adea2['push'](_0x1adea2['shift']());}};_0x3e4b85(++_0x301398);}(_0xe531,0x155));var _0x1e53=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0xe531[_0x8a2dae];return _0x308f20;};'use strict';var fs=require('fs');var path=require(_0x1e53('0x0'));var _=require(_0x1e53('0x1'));var Papa=require('papaparse');var util=require(_0x1e53('0x2'));var BPromise=require('bluebird');var moment=require(_0x1e53('0x3'));var squel=require(_0x1e53('0x4'));var Redis=require(_0x1e53('0x5'));var db=require(_0x1e53('0x6'))['db'];var config=require(_0x1e53('0x7'));var shared=require(_0x1e53('0x8'));var logger=require(_0x1e53('0x9'))('import');config[_0x1e53('0xa')]=_[_0x1e53('0xb')](config[_0x1e53('0xa')],{'host':_0x1e53('0xc'),'port':0x18eb});var socket=require(_0x1e53('0xd'))(new Redis(config[_0x1e53('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x1e53('0xe')](_0x1e53('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x1e53('0xe')](_0x1e53('0xf'));function isEmail(_0x557973){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))*$/[_0x1e53('0x10')](_0x557973);}function selectNotIn(_0x39f6dd,_0x228a42,_0x5436e2,_0x3bb8df,_0xed5b4d){return squel[_0x1e53('0x11')]()[_0x1e53('0x12')]('phone')[_0x1e53('0x13')](_0x3bb8df)[_0x1e53('0x14')](_0x228a42,null,_0x228a42+_0x1e53('0x15')+_0x3bb8df+'.'+_0x5436e2)[_0x1e53('0x16')](_0x3bb8df+'.'+_0x5436e2+_0x1e53('0x17')+_0x39f6dd+'.'+_0x5436e2)[_0x1e53('0x16')](_0x228a42+'.dialCheckDuplicateType\x20IN\x20('+_0xed5b4d[_0x1e53('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xdc2223,_0x4ae574){promisesAdditionalPhones=[];return db['CmContact'][_0x1e53('0x18')]({'raw':!![],'attributes':['id',_0x1e53('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x816c06){if(_0x816c06!==null){var _0x385472=[];for(var _0x3fd947=0x0;_0x3fd947<_0x816c06[_0x1e53('0x1a')];_0x3fd947++){var _0x3d504c=_0x816c06[_0x3fd947];_0x385472[_0x1e53('0x1b')](insertAdditionalPhones(_0x3d504c));}}Promise[_0x1e53('0x1c')](_0x385472)[_0x1e53('0x1d')](function(){_0xdc2223({'val':0x1});});});});}function insertAdditionalPhones(_0x3f42ab){return new Promise(function(_0x1bf03f,_0x4ae716){var _0x1be8fa=_0x3f42ab[_0x1e53('0x19')];var _0x2e5fc7=_0x1be8fa[_0x1e53('0x1e')](';');var _0x13ee70=[];orderBy=0x0;for(var _0x2aef1c=0x0;_0x2aef1c<_0x2e5fc7['length'];_0x2aef1c++){_0x13ee70[_0x1e53('0x1b')](splitAdditionalPhone(_0x3f42ab['id'],_0x2e5fc7[_0x2aef1c]));}Promise['all'](_0x13ee70)['then'](function(){_0x1bf03f({'val':_0x2e5fc7[_0x1e53('0x1a')]});});});}function splitAdditionalPhone(_0x32ef88,_0x255ac0){return new Promise(function(_0x3c9c35,_0x2333d2){var _0x2b5692=_0x255ac0[_0x1e53('0x1e')](':');var _0x3be56a=_0x2b5692[0x0];var _0x12da13=_0x2b5692[0x1];if(!_[_0x1e53('0x1f')](_0x12da13)){var _0x45e782=_0x12da13[_0x1e53('0x1e')]('|');var _0x234ee2=[];for(var _0x5019a0=0x0;_0x5019a0<_0x45e782['length'];_0x5019a0++){if(_0x45e782[_0x5019a0]!==''){var _0x3f02a7=_['filter'](promisesAdditionalPhones,{'contactId':_0x32ef88,'phone':_0x45e782[_0x5019a0]});if(_0x3f02a7[_0x1e53('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x32ef88,'contactTypeId':_0x3be56a,'phone':_0x45e782[_0x5019a0],'orderBy':orderBy});}}}_0x3c9c35({'ok':0x1});}else _0x3c9c35({'res':0x0});});}function createAdditionalPhone(_0x2bda1a,_0x27ebce,_0x52bacd,_0x118829){var _0x156e2c='';var _0x2574ce='';var _0x3230ab=_0x52bacd[_0x1e53('0x1e')]('§');_0x156e2c=_0x3230ab[0x0];if(_0x3230ab['length']==0x2)_0x2574ce=_0x3230ab[0x1];return new Promise(function(_0x12a9c4,_0x34bd78){return db[_0x1e53('0x20')][_0x1e53('0x21')]({'where':{'CmContactId':_0x2bda1a,'item':_0x156e2c}})[_0x1e53('0x1d')](function(_0x21c069){if(_0x21c069){return db[_0x1e53('0x20')][_0x1e53('0x22')]({'ItemTypeId':_0x27ebce,'description':_0x2574ce,'OrderBy':_0x118829},{'where':{'CmContactId':_0x2bda1a,'item':_0x156e2c}})['then'](function(_0x5148d0){_0x12a9c4({'res':_0x1e53('0x23')});});}else{return db[_0x1e53('0x20')][_0x1e53('0x24')]({'CmContactId':_0x2bda1a,'item':_0x156e2c,'description':_0x2574ce,'ItemTypeId':_0x27ebce,'OrderBy':_0x118829,'ItemClass':'PHONE'})[_0x1e53('0x1d')](function(_0xe9be19){_0x12a9c4({'res':'inserted'});});}});});}function insertCmHopper(_0x4bb487,_0x357055,_0x62f1b7,_0x31b0c9,_0x529189){var _0x10efc7=[_0x1e53('0x25'),_0x1e53('0x26'),'cm_contacts.id','cm_contacts.ListId',_0x357055+'.'+_0x31b0c9,'cm_contacts.createdAt',_0x1e53('0x27'),_0x1e53('0x28'),_0x1e53('0x29'),'\x22'+_0x529189+'\x22'];return squel['insert']()[_0x1e53('0x2a')](_0x1e53('0x2b'))[_0x1e53('0x2c')]([_0x1e53('0x2d'),_0x1e53('0x2e'),_0x1e53('0x2f'),_0x1e53('0x30'),_0x31b0c9,_0x1e53('0x31'),_0x1e53('0x32'),'priority',_0x1e53('0x33'),_0x1e53('0x34')],squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x10efc7)[_0x1e53('0x13')](_0x357055)[_0x1e53('0x14')](_0x1e53('0x36'),null,_0x1e53('0x37')+_0x357055+'.CmListId')['join'](_0x62f1b7,null,_0x62f1b7+'.id\x20=\x20'+_0x357055+'.'+_0x31b0c9)[_0x1e53('0x16')](_0x357055+_0x1e53('0x38'),_0x4bb487)[_0x1e53('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x1e53('0x39'),selectNotIn(_0x357055,_0x62f1b7,_0x31b0c9,_0x1e53('0x2b'),[_0x1e53('0x3a'),_0x1e53('0x3b')]))[_0x1e53('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x357055,_0x62f1b7,_0x31b0c9,_0x1e53('0x2b'),[_0x1e53('0x3a')])))[_0x1e53('0x3c')]();}function insertCmHopperBlack(_0x43c273,_0x392564,_0x3d9b05,_0x1125e1){var _0x5614e4=[_0x1e53('0x25'),_0x1e53('0x3d'),_0x1e53('0x3e'),_0x392564+'.'+_0x1125e1,'cm_contacts.createdAt',_0x1e53('0x27')];return squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')](_0x1e53('0x40'))[_0x1e53('0x2c')]([_0x1e53('0x2d'),'ContactId','ListId',_0x1125e1,_0x1e53('0x31'),_0x1e53('0x32')],squel[_0x1e53('0x11')]()['fields'](_0x5614e4)[_0x1e53('0x13')](_0x392564)['join'](_0x1e53('0x36'),null,_0x1e53('0x37')+_0x392564+_0x1e53('0x41'))['join'](_0x3d9b05,null,_0x3d9b05+'.id\x20=\x20'+_0x392564+'.'+_0x1125e1)[_0x1e53('0x16')](_0x392564+'.CmListId\x20=\x20?',_0x43c273)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1e53('0x16')](_0x1e53('0x39'),squel[_0x1e53('0x11')]()[_0x1e53('0x12')](_0x1e53('0x2d'))[_0x1e53('0x13')](_0x1e53('0x40'))[_0x1e53('0x16')](_0x1e53('0x42'),_0x43c273)[_0x1e53('0x16')](_0x1125e1+_0x1e53('0x17')+_0x392564+'.'+_0x1125e1)))['toString']();}function insertTzCmHopper(_0x21a570,_0x49d020,_0x2fdffc,_0x19b4a8,_0x3b200b,_0x1d8b2f){var _0x408128=[_0x1e53('0x25'),_0x1e53('0x43')+_0x1d8b2f+_0x1e53('0x44'),_0x1e53('0x3d'),'cm_contacts.ListId',_0x49d020+'.'+_0x19b4a8,_0x1e53('0x45'),_0x1e53('0x27'),_0x1e53('0x28'),_0x1e53('0x29'),'\x22'+_0x3b200b+'\x22'];var _0x297898=squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')](_0x1e53('0x2b'))[_0x1e53('0x2c')]([_0x1e53('0x2d'),_0x1e53('0x2e'),_0x1e53('0x2f'),_0x1e53('0x30'),_0x19b4a8,_0x1e53('0x31'),_0x1e53('0x32'),'priority',_0x1e53('0x33'),_0x1e53('0x34')],squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x408128)['from'](_0x49d020)[_0x1e53('0x14')]('cm_contacts',null,_0x1e53('0x37')+_0x49d020+'.CmListId')[_0x1e53('0x14')](_0x2fdffc,null,_0x2fdffc+'.id\x20=\x20'+_0x49d020+'.'+_0x19b4a8)[_0x1e53('0x14')](_0x1d8b2f,null,_0x1d8b2f+'.id\x20=\x20'+_0x49d020+'.'+_0x19b4a8)[_0x1e53('0x16')](_0x49d020+_0x1e53('0x38'),_0x21a570)[_0x1e53('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1e53('0x16')](_0x1e53('0x39'),selectNotIn(_0x49d020,_0x2fdffc,_0x19b4a8,'cm_hopper',['\x22always\x22',_0x1e53('0x3b')]))[_0x1e53('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x49d020,_0x2fdffc,_0x19b4a8,_0x1e53('0x2b'),[_0x1e53('0x3a')])))[_0x1e53('0x3c')]();return _0x297898;}function insertTzCmHopperBlack(_0x5ebe62,_0x374c29,_0x11c6f1,_0x5c9bf4){var _0x252851=[_0x1e53('0x25'),'cm_contacts.id',_0x1e53('0x3e'),_0x374c29+'.'+_0x5c9bf4,_0x1e53('0x45'),_0x1e53('0x27')];return squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')](_0x1e53('0x40'))[_0x1e53('0x2c')](['phone','ContactId',_0x1e53('0x30'),_0x5c9bf4,_0x1e53('0x31'),_0x1e53('0x32')],squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x252851)[_0x1e53('0x13')](_0x374c29)[_0x1e53('0x14')]('cm_contacts',null,_0x1e53('0x37')+_0x374c29+_0x1e53('0x41'))['join'](_0x11c6f1,null,_0x11c6f1+_0x1e53('0x15')+_0x374c29+'.'+_0x5c9bf4)[_0x1e53('0x16')](_0x374c29+_0x1e53('0x38'),_0x5ebe62)[_0x1e53('0x16')](_0x1e53('0x46'),NOW)['where'](_0x1e53('0x39'),squel[_0x1e53('0x11')]()[_0x1e53('0x12')](_0x1e53('0x2d'))[_0x1e53('0x13')](_0x1e53('0x40'))[_0x1e53('0x16')](_0x1e53('0x42'),_0x5ebe62)[_0x1e53('0x16')](_0x5c9bf4+_0x1e53('0x17')+_0x374c29+'.'+_0x5c9bf4)))[_0x1e53('0x3c')]();}function insertCmHopperAdditionalPhones(_0x2df4db){var _0x58b879=[_0x1e53('0x47'),_0x1e53('0x48'),_0x1e53('0x49'),'cm_contact_has_items.createdAt',_0x1e53('0x4a')];return squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')](_0x1e53('0x4b'))[_0x1e53('0x2c')](['CmHopperId','phone',_0x1e53('0x4c'),_0x1e53('0x31'),_0x1e53('0x32')],squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x58b879)[_0x1e53('0x13')]('cm_hopper')[_0x1e53('0x14')](_0x1e53('0x36'),null,_0x1e53('0x4d'))[_0x1e53('0x14')](_0x1e53('0x4e'),null,_0x1e53('0x4f'))[_0x1e53('0x16')](_0x1e53('0x50'),_0x2df4db)[_0x1e53('0x16')](_0x1e53('0x46'),NOW))[_0x1e53('0x3c')]();}function insertCmContact(_0xcdb569,_0x17a956,_0x4929d0,_0x5c0fe5){var _0x19978e=_[_0x1e53('0x51')](_[_0x1e53('0x52')](_0x5c0fe5),[_0x1e53('0x30'),_0x1e53('0x53'),'createdAt','updatedAt','scheduledAt']);return squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')]('cm_contacts')['fromQuery'](_0x19978e,squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x19978e)[_0x1e53('0x13')](_0x17a956)['where']('('+_0x4929d0['join'](',')+_0x1e53('0x54'),squel[_0x1e53('0x11')]()[_0x1e53('0x35')](_0x4929d0)[_0x1e53('0x13')](_0x1e53('0x36'))[_0x1e53('0x16')]('ListId\x20=\x20?',_0xcdb569)['where'](_0x1e53('0x55')))['where'](_0x1e53('0x56'),squel[_0x1e53('0x11')]()[_0x1e53('0x12')](_0x1e53('0x57'),_0x1e53('0x58'))['from'](_0x17a956)[_0x1e53('0x59')](_0x4929d0[_0x1e53('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x1e53('0x5a'));stopped=!![];}function handleUncaughtException(_0x1d5c0a){logger[_0x1e53('0x5b')](_0x1d5c0a[_0x1e53('0x5c')]);process[_0x1e53('0x5d')](0x1);}function handleError(_0x54d3f9,_0x345ab5){stats[_0x1e53('0x5e')][_0x1e53('0x1b')]({'name':_0x345ab5[_0x1e53('0x5f')],'message':_0x345ab5[_0x1e53('0x5c')],'row':_0x54d3f9});}function handleQuery(_0x237beb){logger['info'](_0x237beb);return db[_0x1e53('0x60')][_0x1e53('0x61')](_0x237beb)[_0x1e53('0x62')](function(_0x6c0352){results[_0x1e53('0x1b')](_0x6c0352);})[_0x1e53('0x63')](function(_0x598ff8){logger[_0x1e53('0x5b')](_0x598ff8[_0x1e53('0x5c')]);});}function updateTzCampaigns(_0xc53441){return new Promise(function(_0x5a65cf,_0x202d80){var _0xfa2037=squel[_0x1e53('0x11')]()[_0x1e53('0x35')](['campaigns.id',_0x1e53('0x64')])[_0x1e53('0x13')]('campaigns')['join'](_0x1e53('0x65'),null,_0x1e53('0x66'))[_0x1e53('0x16')](_0x1e53('0x67')+_0xc53441);db[_0x1e53('0x60')][_0x1e53('0x61')](_0xfa2037[_0x1e53('0x3c')]())['spread'](function(_0x586b19){var _0x580a81=[];for(var _0xe877fa=0x0;_0xe877fa<_0x586b19[_0x1e53('0x1a')];_0xe877fa++){_0x580a81['push'](getTimezoneData(_0x586b19[_0xe877fa],tmp_campaigns));}BPromise['all'](_0x580a81)['then'](function(){_0x5a65cf({'val':0x1});});})[_0x1e53('0x63')](function(_0x243e7a){logger[_0x1e53('0x5b')](_0x243e7a[_0x1e53('0x5c')]);_0x5a65cf({'val':0x0});});});}function updateTzVoiceQueues(_0x42fb9f){return new Promise(function(_0x59d81d,_0x34ce23){var _0x5597b4=squel[_0x1e53('0x11')]()[_0x1e53('0x35')]([_0x1e53('0x68'),'voice_queues.dialTimezone'])['from']('voice_queues')['join'](_0x1e53('0x69'),null,_0x1e53('0x6a'))[_0x1e53('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x42fb9f);db[_0x1e53('0x60')][_0x1e53('0x61')](_0x5597b4['toString']())['spread'](function(_0x40eaab){var _0x129c9f=[];for(var _0x3ce4dd=0x0;_0x3ce4dd<_0x40eaab[_0x1e53('0x1a')];_0x3ce4dd++){_0x129c9f[_0x1e53('0x1b')](getTimezoneData(_0x40eaab[_0x3ce4dd],tmp_voice_queues));}BPromise['all'](_0x129c9f)[_0x1e53('0x1d')](function(){_0x59d81d({'val':0x1});});})[_0x1e53('0x63')](function(_0x1b2d0e){logger[_0x1e53('0x5b')](_0x1b2d0e[_0x1e53('0x5c')]);_0x59d81d({'val':0x0});});});}function getTimezoneData(_0x52ba16,_0x28c5f7){return new Promise(function(_0x10193e,_0x348479){var _0xe0cb66=shared[_0x1e53('0x6b')];var _0x299bc1=_0xe0cb66[_0x52ba16[_0x1e53('0x6c')]];if(_['isNil'](_0x299bc1)){_0x10193e({'ret':0x1});}else{var _0x476e31=_0x299bc1[_0x1e53('0x6d')];var _0x56c8f5=squel[_0x1e53('0x3f')]()[_0x1e53('0x2a')](_0x28c5f7)[_0x1e53('0x6e')]('id',_0x52ba16['id'])[_0x1e53('0x6e')](_0x1e53('0x6f'),_0x476e31)[_0x1e53('0x6e')](_0x1e53('0x6c'),_0x52ba16[_0x1e53('0x6c')])['toString']();return db[_0x1e53('0x60')][_0x1e53('0x61')](_0x56c8f5)[_0x1e53('0x62')](function(_0x4762db){_0x10193e({'ret':0x1});})['catch'](function(_0x167e6d){logger[_0x1e53('0x5b')](_0x167e6d[_0x1e53('0x5c')]);_0x348479({'ret':0x1});});}});}function handleTZQuery(_0x5061ce){logger[_0x1e53('0x70')](_0x5061ce);return db[_0x1e53('0x60')][_0x1e53('0x61')](_0x5061ce)[_0x1e53('0x62')](function(_0xc61c22){})['catch'](function(_0x5b88dd){logger['error'](_0x5b88dd['message']);});}function main(_0x3b5204,_0x414c20,_0x54ddc3,_0x41ff7c){logger[_0x1e53('0x70')](_0x1e53('0x71'),_0x3b5204,JSON[_0x1e53('0x72')](_0x414c20));process[_0x1e53('0x73')](_0x1e53('0x74'));var _0x443db1=_0x414c20[_0x1e53('0x75')];var _0xeaad60=_[_0x1e53('0x76')](_0x443db1);var _0xd10349=_0x414c20[_0x1e53('0x77')];var _0x28098e=path[_0x1e53('0x14')](config[_0x1e53('0x78')],_0x1e53('0x79'),_0xd10349+_0x1e53('0x7a'));hasTZ=_[_0x1e53('0x52')](_0x443db1)[_0x1e53('0x7b')](_0x1e53('0x6c'));var _0x4420ac=_['keys'](_0x443db1)[_0x1e53('0x14')]();logger[_0x1e53('0x70')](_0x1e53('0x7c'),_0x4420ac);db[_0x1e53('0x7d')][_0x1e53('0x18')]({'raw':!![],'attributes':['id','name']})[_0x1e53('0x1d')](function(_0x408f4c){for(var _0x3dc673=0x0;_0x3dc673<_0x408f4c[_0x1e53('0x1a')];_0x3dc673++){if(_0x408f4c[_0x3dc673][_0x1e53('0x7e')]in _0x443db1){contactItemTypes[_0x1e53('0x1b')](_0x408f4c[_0x3dc673]);delete _0xeaad60[_0x408f4c[_0x3dc673][_0x1e53('0x7e')]];hasAdditionalPhones=!![];}for(var _0x37f709 in _0x443db1){if(_0x408f4c[_0x3dc673]['name']+_0x1e53('0x7f')===_0x37f709){phoneDescriptions[_0x1e53('0x1b')]({'itemTypeId':_0x408f4c[_0x3dc673]['id'],'description':_0x37f709});delete _0xeaad60[_0x37f709];}}}if(hasAdditionalPhones)_0xeaad60[_0x1e53('0x19')]='';var _0x2c97ff=_[_0x1e53('0x52')](_0xeaad60)[_0x1e53('0x14')]();logger[_0x1e53('0x70')](_0x1e53('0x7c'),_0x2c97ff);fs['writeFileSync'](_0x28098e,_0x2c97ff+'\x0a');Papa['parse'](fs['createReadStream'](_0x3b5204),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a3f61,_0x495576){try{for(var _0x139d95=0x0,_0x5d5ec7=[];_0x139d95<_0x3a3f61['data'][_0x1e53('0x1a')];_0x139d95++){stats[_0x1e53('0x80')]+=0x1;if(_0x3a3f61[_0x1e53('0x5e')][_0x139d95]){handleError(_0x3a3f61[_0x1e53('0x81')][_0x139d95],_0x3a3f61['errors'][_0x139d95]);}else{var _0x5f24de=[];var _0x335d4e=[];var _0x1ace75={};for(var _0x4e8f23 in _0x443db1){let _0x92da55=contactItemTypes[_0x1e53('0x82')](_0x55c78a=>_0x55c78a[_0x1e53('0x7e')]===_0x4e8f23);let _0xb0e1f4=contactItemTypes[_0x1e53('0x82')](_0x22dbe4=>_0x22dbe4[_0x1e53('0x7e')]+_0x1e53('0x7f')===_0x4e8f23);if(_[_0x1e53('0x1f')](_0x92da55)&&_[_0x1e53('0x1f')](_0xb0e1f4)){if(_0x443db1['hasOwnProperty'](_0x4e8f23)){if(_0x3a3f61[_0x1e53('0x81')][_0x139d95][_0x443db1[_0x4e8f23]]){var _0x11285f=_[_0x1e53('0x83')](_0x3a3f61[_0x1e53('0x81')][_0x139d95][_0x443db1[_0x4e8f23]][_0x1e53('0x84')](/"/g,'\x27'));switch(_0x4e8f23){case'scheduledat':var _0x3ac30d=moment(_0x11285f,_0x1e53('0xf'),!![]);if(_0x3ac30d[_0x1e53('0x85')]()){_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');}else{_0x5f24de[_0x1e53('0x1b')](_0x1e53('0x86'));}break;case _0x1e53('0x87'):var _0x4eca84=parseInt(_0x11285f);_0x11285f=_['isNaN'](_0x4eca84)||_0x4eca84<0x0||_0x4eca84>0x4?_0x41ff7c?0x3:0x2:_0x4eca84;_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');break;case _0x1e53('0x33'):var _0x3bb35f=parseInt(_0x11285f);if(_['isNumber'](_0x3bb35f)&&_['includes'](_0x54ddc3,_0x3bb35f)){_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x3bb35f+'\x22');}else{_0x5f24de['push']('agent\x20not\x20exists');}break;case _0x1e53('0x88'):if(isEmail(_0x11285f)){_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');}else{_0x5f24de[_0x1e53('0x1b')]('email\x20wrong\x20format');}break;case _0x1e53('0x89'):var _0x415105=moment(_0x11285f,_0x1e53('0x8a'),!![]);if(_0x415105[_0x1e53('0x85')]()){_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');}else{_0x5f24de[_0x1e53('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x1e53('0x6c'):var _0x5b33c6=shared[_0x1e53('0x6b')];var _0x2cb69f=_0x5b33c6[_0x11285f];if(!_[_0x1e53('0x1f')](_0x2cb69f)){var _0x1b8b7c=_0x2cb69f['utcOffset'];_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x1b8b7c+'\x22');}break;default:_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x11285f+'\x22');}}else{switch(_0x4e8f23){case _0x1e53('0x8b'):case'phone':_0x5f24de[_0x1e53('0x1b')](_0x4e8f23+_0x1e53('0x8c'));break;default:_0x5d5ec7[_0x1e53('0x1b')]('\x22\x22');}}}}else{var _0x39d8fa='';if(!_[_0x1e53('0x1f')](_0x92da55)){if(!_0x1ace75[_0x1e53('0x8d')](_0x92da55['id'])){if(!_[_0x1e53('0x1f')](_0x3a3f61[_0x1e53('0x81')][_0x139d95][_0x443db1[_0x4e8f23]])){var _0x11285f=_[_0x1e53('0x83')](_0x3a3f61[_0x1e53('0x81')][_0x139d95][_0x443db1[_0x4e8f23]][_0x1e53('0x84')](/"/g,'\x27'));var _0x36aa48=phoneDescriptions[_0x1e53('0x82')](_0x1615ba=>_0x1615ba[_0x1e53('0x8e')]===_0x92da55['id']);if(!_[_0x1e53('0x1f')](_0x36aa48)){var _0x5c77ee=_[_0x1e53('0x83')](_0x3a3f61[_0x1e53('0x81')][_0x139d95][_0x443db1[_0x36aa48[_0x1e53('0x8f')]]][_0x1e53('0x84')](/"/g,'\x27'));if(!_['isNil'](_0x5c77ee))_0x11285f=_0x11285f+'§'+_0x5c77ee;}if(_0x39d8fa=='')_0x39d8fa=_0x11285f;else _0x39d8fa+='|'+_0x11285f;}_0x335d4e[_0x1e53('0x1b')](_0x92da55['id']+':'+_0x39d8fa);_0x1ace75[_0x92da55['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5d5ec7[_0x1e53('0x1b')]('\x22'+_0x335d4e[_0x1e53('0x14')](';')+'\x22');}if(_0x5f24de[_0x1e53('0x1a')]){handleError(_0x3a3f61[_0x1e53('0x81')][_0x139d95],{'code':'SystemRow','message':_0x5f24de[_0x1e53('0x14')]()});}else{fs[_0x1e53('0x90')](_0x28098e,_0x5d5ec7[_0x1e53('0x14')]()+'\x0a');}_0x5d5ec7=[];}if(!(stats['rows']%0xc8)){socket[_0x1e53('0x91')](_0x1e53('0x92')+_0xd10349,stats);stats['errors']=[];}}if(stopped){logger[_0x1e53('0x70')](_0x1e53('0x93'));_0x495576['abort']();}}catch(_0x2d5be8){handleError(_0x3a3f61['data'][_0x139d95],{'code':_0x1e53('0x94'),'message':_0x2d5be8[_0x1e53('0x5c')]});logger[_0x1e53('0x5b')]('step',_0x2d5be8[_0x1e53('0x5c')]);}},'complete':function(){try{var _0x151874=[];var _0x38a3a8=[];var _0x4424c5=_0x1e53('0x36');if(_0x414c20[_0x1e53('0x95')]&&_0x414c20[_0x1e53('0x95')][_0x1e53('0x1a')]){_0x4424c5='cm_contacts_'+_0xd10349;_0x151874[_0x1e53('0x1b')](_0x1e53('0x96')+_0x4424c5+_0x1e53('0x97'));}tmp_campaigns=_0x1e53('0x98')+_0xd10349;tmp_voice_queues='voice_queues_'+_0xd10349;_0x38a3a8[_0x1e53('0x1b')](_0x1e53('0x96')+tmp_campaigns+_0x1e53('0x99'));_0x38a3a8['push'](_0x1e53('0x96')+tmp_voice_queues+_0x1e53('0x99'));BPromise[_0x1e53('0x9a')](_0x38a3a8,handleTZQuery)[_0x1e53('0x1d')](function(_0xaf1179){updateTzCampaigns(_0x414c20[_0x1e53('0x30')])[_0x1e53('0x1d')](function(_0x149508){updateTzVoiceQueues(_0x414c20[_0x1e53('0x30')])[_0x1e53('0x1d')](function(_0x1a55ba){if(hasTZ)_0x2c97ff=_0x2c97ff['replace']('dialTimezone','dialTimezone,utcOffset');var _0x85e7d7=util[_0x1e53('0xe')]('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',_0x28098e,_0x4424c5,_0x2c97ff,_0x414c20[_0x1e53('0x30')],_0x414c20[_0x1e53('0x53')]||null,NOW,NOW);if(_['isNil'](_0x443db1[_0x1e53('0x2e')])){_0x85e7d7+=',\x20scheduledAt\x20=\x20NOW()';}_0x151874[_0x1e53('0x1b')](_0x85e7d7);if(_0x414c20[_0x1e53('0x95')]&&_0x414c20[_0x1e53('0x95')][_0x1e53('0x1a')]){_0x151874[_0x1e53('0x1b')](insertCmContact(_0x414c20[_0x1e53('0x30')],_0x4424c5,_0x414c20[_0x1e53('0x95')],_0x443db1));_0x151874[_0x1e53('0x1b')](_0x1e53('0x9b')+_0x4424c5+';');}BPromise['each'](_0x151874,handleQuery)[_0x1e53('0x1d')](function(_0x1c7358){BPromise[_0x1e53('0x1c')]([handleAdditionalPhones()])[_0x1e53('0x1d')](function(){_0x151874=[];for(var _0xae3fc=0x0;_0xae3fc\x20\x20','root'];(function(_0x31db75,_0x373337){var _0x76b89c=function(_0x954b72){while(--_0x954b72){_0x31db75['push'](_0x31db75['shift']());}};_0x76b89c(++_0x373337);}(_0x2b4f,0x142));var _0xf2b4=function(_0x3fb704,_0x568894){_0x3fb704=_0x3fb704-0x0;var _0x4214a9=_0x2b4f[_0x3fb704];return _0x4214a9;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xf2b4('0x0'));var Papa=require('papaparse');var util=require(_0xf2b4('0x1'));var BPromise=require(_0xf2b4('0x2'));var moment=require(_0xf2b4('0x3'));var squel=require(_0xf2b4('0x4'));var Redis=require(_0xf2b4('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xf2b4('0x6'));var logger=require(_0xf2b4('0x7'))(_0xf2b4('0x8'));config[_0xf2b4('0x9')]=_['defaults'](config[_0xf2b4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2b4('0xa'))(new Redis(config[_0xf2b4('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xf2b4('0xb')](_0xf2b4('0xc'));var tempTableName=_0xf2b4('0xd')+moment()[_0xf2b4('0xb')](_0xf2b4('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2a470a){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))*$/[_0xf2b4('0xf')](_0x2a470a);}function selectNotIn(_0x23812d,_0x1ded8a,_0x194675,_0x3d792a,_0x1f3f68){return squel[_0xf2b4('0x10')]()['field'](_0xf2b4('0x11'))[_0xf2b4('0x12')](_0x3d792a)[_0xf2b4('0x13')](_0x1ded8a,null,_0x1ded8a+_0xf2b4('0x14')+_0x3d792a+'.'+_0x194675)['where'](_0x3d792a+'.'+_0x194675+'\x20=\x20'+_0x23812d+'.'+_0x194675)[_0xf2b4('0x15')](_0x1ded8a+'.dialCheckDuplicateType\x20IN\x20('+_0x1f3f68[_0xf2b4('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1f5b60,_0x266683){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0xf2b4('0x16')+tempTableName)[_0xf2b4('0x17')](function(_0x3daaf6){if(_0x3daaf6!==null){var _0x323f7b=[];for(var _0x562ab8=0x0;_0x562ab8<_0x3daaf6[_0xf2b4('0x18')];_0x562ab8++){var _0x4d2a47=_0x3daaf6[_0x562ab8];if(!_[_0xf2b4('0x19')](_0x4d2a47[_0xf2b4('0x11')])){if(!_[_0xf2b4('0x19')](_0x4d2a47[_0xf2b4('0x1a')]))_0x323f7b[_0xf2b4('0x1b')](insertAdditionalPhones(_0x4d2a47));promisesContact[_0xf2b4('0x1b')]({'contact':_0x4d2a47});}}}Promise[_0xf2b4('0x1c')](_0x323f7b)[_0xf2b4('0x1d')](function(){_0x1f5b60({'val':0x1});});})['catch'](function(_0x32fe54){logger[_0xf2b4('0x1e')](_0x32fe54[_0xf2b4('0x1f')]);});});}function insertAdditionalPhones(_0x4642bc){return new Promise(function(_0x38afe7,_0x305fa0){var _0x15dcd6=_0x4642bc['AdditionalPhones'];if(_[_0xf2b4('0x19')](_0x15dcd6))_0x305fa0({'val':0x0});else{var _0x12f1c0=_0x15dcd6[_0xf2b4('0x20')](';');var _0x5fc66e=[];orderBy=0x0;for(var _0x51330b=0x0;_0x51330b<_0x12f1c0['length'];_0x51330b++){_0x5fc66e[_0xf2b4('0x1b')](splitAdditionalPhone(_0x4642bc['id'],_0x12f1c0[_0x51330b]));}Promise[_0xf2b4('0x1c')](_0x5fc66e)[_0xf2b4('0x1d')](function(){_0x38afe7({'val':_0x12f1c0[_0xf2b4('0x18')]});});}});}function splitAdditionalPhone(_0x7daac1,_0x4561d7){return new Promise(function(_0x390c94,_0x4346c1){var _0x2ee93b=_0x4561d7[_0xf2b4('0x20')](':');var _0x53a6e6=_0x2ee93b[0x0];var _0x500e28=_0x2ee93b[0x1];if(_0x500e28!==''){var _0x3de06e=_0x500e28[_0xf2b4('0x20')]('|');var _0x57370b=[];for(var _0x27bec0=0x0;_0x27bec0<_0x3de06e[_0xf2b4('0x18')];_0x27bec0++){if(_0x3de06e[_0x27bec0]!==''){var _0x3007eb=_[_0xf2b4('0x21')](promisesAdditionalPhones,{'contactId':_0x7daac1,'phone':_0x3de06e[_0x27bec0]});if(_0x3007eb[_0xf2b4('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0xf2b4('0x1b')]({'contactId':_0x7daac1,'contactTypeId':_0x53a6e6,'phone':_0x3de06e[_0x27bec0],'orderBy':orderBy});}}}_0x390c94({'ok':0x1});}else _0x390c94({'res':0x0});});}function createAdditionalPhone(_0xcff709,_0x444875,_0x506bab,_0x456055){var _0x463fb5='';var _0xe7971a='';var _0x534445=_0x506bab[_0xf2b4('0x20')]('§');_0x463fb5=_0x534445[0x0];if(_0x534445['length']==0x2)_0xe7971a=_0x534445[0x1];return new Promise(function(_0x449d39,_0x128658){return db[_0xf2b4('0x22')]['findOne']({'where':{'CmContactId':_0xcff709,'item':_0x463fb5}})['then'](function(_0x15ebd9){if(_0x15ebd9){return db['CmContactHasItem']['update']({'ItemTypeId':_0x444875,'description':_0xe7971a,'OrderBy':_0x456055},{'where':{'CmContactId':_0xcff709,'item':_0x463fb5}})['then'](function(_0x788e7c){_0x449d39({'res':_0xf2b4('0x23')});});}else{return db[_0xf2b4('0x22')][_0xf2b4('0x24')]({'CmContactId':_0xcff709,'item':_0x463fb5,'ItemTypeId':_0x444875,'description':_0xe7971a,'OrderBy':_0x456055,'ItemClass':'PHONE'})[_0xf2b4('0x1d')](function(_0x4e456b){_0x449d39({'res':_0xf2b4('0x25')});});}});});}function updateContact(_0x2e0148){return new Promise(function(_0x5a61ca,_0x53b441){var _0x13427d=_0x2e0148['id'];delete _0x2e0148['id'];return db[_0xf2b4('0x26')][_0xf2b4('0x27')](_0x2e0148,{'where':{'id':_0x13427d}})[_0xf2b4('0x1d')](function(_0x8342bf){updatedRows+=0x1;return db[_0xf2b4('0x28')][_0xf2b4('0x27')]({'phone':_0x2e0148['phone']},{'where':{'ContactId':_0x13427d}})[_0xf2b4('0x1d')](function(_0x5f45b7){_0x5a61ca({'ret':'OK'});});});});}function insertCmHopper(_0x223a9b,_0x313275,_0x229d24,_0x4712b6,_0x566391){var _0x136a95=[_0xf2b4('0x29'),'cm_contacts.scheduledat',_0xf2b4('0x2a'),_0xf2b4('0x2b'),_0x313275+'.'+_0x4712b6,'cm_contacts.createdAt',_0xf2b4('0x2c'),_0xf2b4('0x2d'),_0xf2b4('0x2e'),'\x22'+_0x566391+'\x22'];return squel[_0xf2b4('0x2f')]()[_0xf2b4('0x30')](_0xf2b4('0x31'))[_0xf2b4('0x32')](['phone',_0xf2b4('0x33'),_0xf2b4('0x34'),_0xf2b4('0x35'),_0x4712b6,_0xf2b4('0x36'),_0xf2b4('0x37'),_0xf2b4('0x38'),_0xf2b4('0x39'),_0xf2b4('0x3a')],squel[_0xf2b4('0x10')]()[_0xf2b4('0x3b')](_0x136a95)['from'](_0x313275)['join'](_0xf2b4('0x3c'),null,_0xf2b4('0x3d')+_0x313275+_0xf2b4('0x3e'))[_0xf2b4('0x13')](_0x229d24,null,_0x229d24+'.id\x20=\x20'+_0x313275+'.'+_0x4712b6)[_0xf2b4('0x15')](_0x313275+_0xf2b4('0x3f'),_0x223a9b)[_0xf2b4('0x15')](_0xf2b4('0x40'),NOW)[_0xf2b4('0x15')](_0xf2b4('0x41'),selectNotIn(_0x313275,_0x229d24,_0x4712b6,'cm_hopper',[_0xf2b4('0x42'),_0xf2b4('0x43')]))[_0xf2b4('0x15')](_0xf2b4('0x41'),selectNotIn(_0x313275,_0x229d24,_0x4712b6,_0xf2b4('0x31'),[_0xf2b4('0x42')])))[_0xf2b4('0x44')]();}function insertCmHopperBlack(_0xa32ed7,_0x59f73e,_0x55726c,_0x42e154){var _0x3f4a22=['cm_contacts.phone',_0xf2b4('0x2a'),_0xf2b4('0x2b'),_0x59f73e+'.'+_0x42e154,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xf2b4('0x2f')]()[_0xf2b4('0x30')](_0xf2b4('0x45'))[_0xf2b4('0x32')]([_0xf2b4('0x11'),_0xf2b4('0x34'),_0xf2b4('0x35'),_0x42e154,_0xf2b4('0x36'),_0xf2b4('0x37')],squel[_0xf2b4('0x10')]()[_0xf2b4('0x3b')](_0x3f4a22)['from'](_0x59f73e)[_0xf2b4('0x13')]('cm_contacts',null,_0xf2b4('0x3d')+_0x59f73e+_0xf2b4('0x3e'))['join'](_0x55726c,null,_0x55726c+_0xf2b4('0x14')+_0x59f73e+'.'+_0x42e154)[_0xf2b4('0x15')](_0x59f73e+_0xf2b4('0x3f'),_0xa32ed7)[_0xf2b4('0x15')](_0xf2b4('0x40'),NOW)[_0xf2b4('0x15')](_0xf2b4('0x41'),squel['select']()['field'](_0xf2b4('0x11'))[_0xf2b4('0x12')](_0xf2b4('0x45'))[_0xf2b4('0x15')](_0xf2b4('0x46'),_0xa32ed7)[_0xf2b4('0x15')](_0x42e154+_0xf2b4('0x47'),_0x59f73e+'.'+_0x42e154)))['toString']();}function insertCmHopperAdditionalPhones(_0x516f59){var _0x157f1c=[_0xf2b4('0x48'),_0xf2b4('0x49'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xf2b4('0x4a')];return squel['insert']()[_0xf2b4('0x30')](_0xf2b4('0x4b'))[_0xf2b4('0x32')]([_0xf2b4('0x4c'),_0xf2b4('0x11'),'OrderBy','createdAt',_0xf2b4('0x37')],squel[_0xf2b4('0x10')]()[_0xf2b4('0x3b')](_0x157f1c)[_0xf2b4('0x12')](_0xf2b4('0x31'))[_0xf2b4('0x13')](_0xf2b4('0x3c'),null,_0xf2b4('0x4d'))[_0xf2b4('0x13')]('cm_contact_has_items',null,_0xf2b4('0x4e'))['where'](_0xf2b4('0x4f'),_0x516f59)[_0xf2b4('0x15')](_0xf2b4('0x40'),NOW))[_0xf2b4('0x44')]();}function insertCmContact(_0x3aca99,_0x175bc9,_0x22ce63,_0x36e357){var _0x142692=_[_0xf2b4('0x50')](_[_0xf2b4('0x51')](_0x36e357),[_0xf2b4('0x35'),_0xf2b4('0x52'),_0xf2b4('0x36'),_0xf2b4('0x37')]);return squel[_0xf2b4('0x2f')]()['into'](_0xf2b4('0x3c'))['fromQuery'](_0x142692,squel[_0xf2b4('0x10')]()[_0xf2b4('0x3b')](_0x142692)['from'](_0x175bc9)[_0xf2b4('0x15')]('('+_0x22ce63[_0xf2b4('0x13')](',')+_0xf2b4('0x53'),squel[_0xf2b4('0x10')]()[_0xf2b4('0x3b')](_0x22ce63)[_0xf2b4('0x12')](_0xf2b4('0x3c'))[_0xf2b4('0x15')](_0xf2b4('0x46'),_0x3aca99))['where'](_0xf2b4('0x54'),squel['select']()[_0xf2b4('0x55')](_0xf2b4('0x56'),_0xf2b4('0x57'))[_0xf2b4('0x12')](_0x175bc9)[_0xf2b4('0x58')](_0x22ce63[_0xf2b4('0x13')](','))))[_0xf2b4('0x44')]();}function handleStop(){logger[_0xf2b4('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x197f86){logger[_0xf2b4('0x1e')](_0x197f86['message']);process[_0xf2b4('0x5a')](0x1);}function handleError(_0x182ef6,_0x302805){stats['errors'][_0xf2b4('0x1b')]({'name':_0x302805[_0xf2b4('0x5b')],'message':_0x302805[_0xf2b4('0x1f')],'row':_0x182ef6});}function handleQuery(_0x4bbac7){logger[_0xf2b4('0x59')](_0x4bbac7);return db[_0xf2b4('0x5c')]['query'](_0x4bbac7)[_0xf2b4('0x17')](function(_0xc5097e){results[_0xf2b4('0x1b')](_0xc5097e);})[_0xf2b4('0x5d')](function(_0x1b7d09){logger['error'](_0x1b7d09[_0xf2b4('0x1f')]);});}function main(_0x3a775d,_0x2d2a36,_0x557717,_0x12f19c){logger[_0xf2b4('0x59')](_0xf2b4('0x5e'),_0x3a775d,JSON[_0xf2b4('0x5f')](_0x2d2a36));process[_0xf2b4('0x60')](_0xf2b4('0x61'));var _0x33132d=_0x2d2a36[_0xf2b4('0x62')];var _0x157abd=_['clone'](_0x33132d);var _0x2c3720=_0x2d2a36[_0xf2b4('0x63')];var _0x25cfa7=path[_0xf2b4('0x13')](config['root'],'server/files/tmp',_0x2c3720+_0xf2b4('0x64'));logger[_0xf2b4('0x59')]('body',_0x2d2a36);db['ContactItemType'][_0xf2b4('0x65')]({'raw':!![],'attributes':['id',_0xf2b4('0x66')]})[_0xf2b4('0x1d')](function(_0xb0c873){for(var _0x2065d1=0x0;_0x2065d1<_0xb0c873[_0xf2b4('0x18')];_0x2065d1++){if(_0xb0c873[_0x2065d1][_0xf2b4('0x66')]in _0x33132d){contactItemTypes['push'](_0xb0c873[_0x2065d1]);delete _0x157abd[_0xb0c873[_0x2065d1]['name']];hasAdditionalPhones=!![];}for(var _0x302983 in _0x33132d){if(_0xb0c873[_0x2065d1][_0xf2b4('0x66')]+_0xf2b4('0x67')===_0x302983){phoneDescriptions['push']({'itemTypeId':_0xb0c873[_0x2065d1]['id'],'description':_0x302983});delete _0x157abd[_0x302983];}}}if(hasAdditionalPhones)_0x157abd[_0xf2b4('0x1a')]='';var _0x316e2b=_['keys'](_0x157abd)[_0xf2b4('0x13')]();logger[_0xf2b4('0x59')](_0xf2b4('0x68'),_0x316e2b);fs[_0xf2b4('0x69')](_0x25cfa7,_0x316e2b+'\x0a');Papa['parse'](fs[_0xf2b4('0x6a')](_0x3a775d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x454fd3,_0x2cda30){try{for(var _0x1f6537=0x0,_0x987c09=[];_0x1f6537<_0x454fd3[_0xf2b4('0x6b')]['length'];_0x1f6537++){stats[_0xf2b4('0x6c')]+=0x1;if(_0x454fd3['errors'][_0x1f6537]){handleError(_0x454fd3[_0xf2b4('0x6b')][_0x1f6537],_0x454fd3[_0xf2b4('0x6d')][_0x1f6537]);}else{var _0x42608c=[];var _0x5c69b2=[];var _0x221d29={};for(var _0x1d101d in _0x33132d){let _0x154069=contactItemTypes[_0xf2b4('0x6e')](_0x1f2f33=>_0x1f2f33['name']===_0x1d101d);let _0x5ac2e9=contactItemTypes[_0xf2b4('0x6e')](_0x4a66c4=>_0x4a66c4[_0xf2b4('0x66')]+_0xf2b4('0x67')===_0x1d101d);if(_['isNil'](_0x154069)&&_[_0xf2b4('0x19')](_0x5ac2e9)){if(_0x33132d[_0xf2b4('0x6f')](_0x1d101d)){if(_0x454fd3[_0xf2b4('0x6b')][_0x1f6537][_0x33132d[_0x1d101d]]){var _0x20e866=_[_0xf2b4('0x70')](_0x454fd3['data'][_0x1f6537][_0x33132d[_0x1d101d]][_0xf2b4('0x71')](/"/g,'\x27'));switch(_0x1d101d){case'scheduledat':var _0x34fecd=moment(_0x20e866,_0xf2b4('0xc'),!![]);if(_0x34fecd['isValid']()){_0x987c09[_0xf2b4('0x1b')]('\x22'+_0x20e866+'\x22');}else{_0x42608c[_0xf2b4('0x1b')](_0xf2b4('0x72'));}break;case _0xf2b4('0x38'):var _0x27d812=parseInt(_0x20e866);_0x20e866=_[_0xf2b4('0x73')](_0x27d812)||_0x27d812<0x0||_0x27d812>0x4?_0x12f19c?0x3:0x2:_0x27d812;_0x987c09[_0xf2b4('0x1b')]('\x22'+_0x20e866+'\x22');break;case _0xf2b4('0x39'):var _0x67cf8=parseInt(_0x20e866);if(_[_0xf2b4('0x74')](_0x67cf8)&&_[_0xf2b4('0x75')](_0x557717,_0x67cf8)){_0x987c09['push']('\x22'+_0x67cf8+'\x22');}else{_0x42608c[_0xf2b4('0x1b')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x20e866)){_0x987c09[_0xf2b4('0x1b')]('\x22'+_0x20e866+'\x22');}else{_0x42608c[_0xf2b4('0x1b')](_0xf2b4('0x76'));}break;case'dateOfBirth':var _0x37ba0f=moment(_0x20e866,_0xf2b4('0x77'),!![]);if(_0x37ba0f[_0xf2b4('0x78')]()){_0x987c09[_0xf2b4('0x1b')]('\x22'+_0x20e866+'\x22');}else{_0x42608c[_0xf2b4('0x1b')](_0xf2b4('0x79'));}break;default:_0x987c09[_0xf2b4('0x1b')]('\x22'+_0x20e866+'\x22');}}else{switch(_0x1d101d){case'firstName':case _0xf2b4('0x11'):_0x42608c['push'](_0x1d101d+'\x20not\x20specified');break;default:_0x987c09['push']('\x22\x22');}}}}else{var _0x362785='';if(!_[_0xf2b4('0x19')](_0x154069)){if(!_0x221d29[_0xf2b4('0x6f')](_0x154069['id'])){for(var _0x40b8c6=0x0;_0x40b8c6<_0x33132d[_0x1d101d][_0xf2b4('0x18')];_0x40b8c6++){var _0x20e866=_[_0xf2b4('0x70')](_0x454fd3[_0xf2b4('0x6b')][_0x1f6537][_0x33132d[_0x1d101d][_0x40b8c6]][_0xf2b4('0x71')](/"/g,'\x27'));var _0x36d827=phoneDescriptions[_0xf2b4('0x6e')](_0x497b01=>_0x497b01[_0xf2b4('0x7a')]===_0x154069['id']);if(!_[_0xf2b4('0x19')](_0x36d827)){var _0x13d46c=_['trim'](_0x454fd3[_0xf2b4('0x6b')][_0x1f6537][_0x33132d[_0x36d827[_0xf2b4('0x7b')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xf2b4('0x19')](_0x13d46c))_0x20e866=_0x20e866+'§'+_0x13d46c;}if(_0x362785=='')_0x362785=_0x20e866;else _0x362785+='|'+_0x20e866;}_0x5c69b2[_0xf2b4('0x1b')](_0x154069['id']+':'+_0x362785);_0x221d29[_0x154069['id']]=0x1;}}}}if(hasAdditionalPhones){_0x987c09['push']('\x22'+_0x5c69b2[_0xf2b4('0x13')](';')+'\x22');}if(_0x42608c[_0xf2b4('0x18')]){handleError(_0x454fd3[_0xf2b4('0x6b')][_0x1f6537],{'code':_0xf2b4('0x7c'),'message':_0x42608c['join']()});}else{fs[_0xf2b4('0x7d')](_0x25cfa7,_0x987c09[_0xf2b4('0x13')]()+'\x0a');}_0x987c09=[];}if(!(stats[_0xf2b4('0x6c')]%0xc8)){socket[_0xf2b4('0x7e')]('contact:import:'+_0x2c3720,stats);stats[_0xf2b4('0x6d')]=[];}}if(stopped){logger['info'](_0xf2b4('0x7f'));_0x2cda30[_0xf2b4('0x80')]();}}catch(_0x11ce4c){handleError(_0x454fd3['data'][_0x1f6537],{'code':_0xf2b4('0x81'),'message':_0x11ce4c[_0xf2b4('0x1f')]});logger[_0xf2b4('0x1e')](_0xf2b4('0x82'),_0x11ce4c[_0xf2b4('0x1f')]);}},'complete':function(){try{var _0x566f3f=[];var _0x1f21e8=tempTableName;_0x566f3f[_0xf2b4('0x1b')](_0xf2b4('0x83')+_0x1f21e8+_0xf2b4('0x84'));logger[_0xf2b4('0x59')](_0xf2b4('0x85'),contactItemTypes[_0xf2b4('0x18')]);var _0x3c0c1a=util[_0xf2b4('0xb')](_0xf2b4('0x86'),_0x25cfa7,_0x1f21e8,_0x316e2b,_0x2d2a36[_0xf2b4('0x35')],_0x2d2a36[_0xf2b4('0x52')]||null,NOW,NOW);if(_['isNil'](_0x33132d[_0xf2b4('0x33')])){_0x3c0c1a+=_0xf2b4('0x87');}_0x566f3f[_0xf2b4('0x1b')](_0x3c0c1a);BPromise[_0xf2b4('0x88')](_0x566f3f,handleQuery)[_0xf2b4('0x1d')](function(_0x462128){BPromise[_0xf2b4('0x1c')]([handleAdditionalPhones()])[_0xf2b4('0x1d')](function(){_0x566f3f=[];for(var _0x19e84f=0x0;_0x19e84f\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','select','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','query','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','all','split','CmContactHasItem','findOne','update','updated','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','priority','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','insert','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','createdAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','field','MIN(id)','min_id','Received\x20SIGINT','exit','errors'];(function(_0x3fd3de,_0x573a06){var _0x4f9c2a=function(_0x256184){while(--_0x256184){_0x3fd3de['push'](_0x3fd3de['shift']());}};_0x4f9c2a(++_0x573a06);}(_0x45d8,0x174));var _0x845d=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x45d8[_0x2d344f];return _0x2e796b;};'use strict';var fs=require('fs');var path=require(_0x845d('0x0'));var _=require(_0x845d('0x1'));var Papa=require(_0x845d('0x2'));var util=require(_0x845d('0x3'));var BPromise=require(_0x845d('0x4'));var moment=require(_0x845d('0x5'));var squel=require('squel');var Redis=require(_0x845d('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x845d('0x7'));var logger=require(_0x845d('0x8'))('import');config['redis']=_[_0x845d('0x9')](config['redis'],{'host':_0x845d('0xa'),'port':0x18eb});var socket=require(_0x845d('0xb'))(new Redis(config[_0x845d('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x845d('0xd')](_0x845d('0xe'));var tempTableName=_0x845d('0xf')+moment()['format'](_0x845d('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x234efb){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x234efb);}function selectNotIn(_0x5d4128,_0x1a2afb,_0x4600cc,_0x3cf082,_0x10deb0){return squel[_0x845d('0x11')]()['field'](_0x845d('0x12'))[_0x845d('0x13')](_0x3cf082)[_0x845d('0x14')](_0x1a2afb,null,_0x1a2afb+_0x845d('0x15')+_0x3cf082+'.'+_0x4600cc)['where'](_0x3cf082+'.'+_0x4600cc+'\x20=\x20'+_0x5d4128+'.'+_0x4600cc)[_0x845d('0x16')](_0x1a2afb+_0x845d('0x17')+_0x10deb0[_0x845d('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5d70ea,_0x112f9f){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x845d('0x18')]('select\x20*\x20from\x20'+tempTableName)[_0x845d('0x19')](function(_0x25df3e){if(_0x25df3e!==null){var _0xbf78ce=[];for(var _0x2f9425=0x0;_0x2f9425<_0x25df3e[_0x845d('0x1a')];_0x2f9425++){var _0x53463a=_0x25df3e[_0x2f9425];if(!_['isNil'](_0x53463a[_0x845d('0x12')])){if(!_[_0x845d('0x1b')](_0x53463a[_0x845d('0x1c')]))_0xbf78ce[_0x845d('0x1d')](insertAdditionalPhones(_0x53463a));promisesContact[_0x845d('0x1d')]({'contact':_0x53463a});}}}Promise['all'](_0xbf78ce)[_0x845d('0x1e')](function(){_0x5d70ea({'val':0x1});});})[_0x845d('0x1f')](function(_0x2c7399){logger[_0x845d('0x20')](_0x2c7399[_0x845d('0x21')]);});});}function insertAdditionalPhones(_0x4a500a){return new Promise(function(_0xe5768b,_0x3edf07){var _0x42439b=_0x4a500a[_0x845d('0x1c')];if(_[_0x845d('0x1b')](_0x42439b))_0x3edf07({'val':0x0});else{var _0x389a57=_0x42439b['split'](';');var _0x17afd1=[];orderBy=0x0;for(var _0x2feec0=0x0;_0x2feec0<_0x389a57[_0x845d('0x1a')];_0x2feec0++){_0x17afd1['push'](splitAdditionalPhone(_0x4a500a['id'],_0x389a57[_0x2feec0]));}Promise[_0x845d('0x22')](_0x17afd1)[_0x845d('0x1e')](function(){_0xe5768b({'val':_0x389a57[_0x845d('0x1a')]});});}});}function splitAdditionalPhone(_0x332e59,_0x358429){return new Promise(function(_0x5e894d,_0x2a96ea){var _0x4e1236=_0x358429[_0x845d('0x23')](':');var _0x2fb69f=_0x4e1236[0x0];var _0x5716cd=_0x4e1236[0x1];if(_0x5716cd!==''){var _0x5d5e33=_0x5716cd[_0x845d('0x23')]('|');var _0x44ffef=[];for(var _0x311b64=0x0;_0x311b64<_0x5d5e33[_0x845d('0x1a')];_0x311b64++){if(_0x5d5e33[_0x311b64]!==''){var _0x1ea3a2=_['filter'](promisesAdditionalPhones,{'contactId':_0x332e59,'phone':_0x5d5e33[_0x311b64]});if(_0x1ea3a2[_0x845d('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x845d('0x1d')]({'contactId':_0x332e59,'contactTypeId':_0x2fb69f,'phone':_0x5d5e33[_0x311b64],'orderBy':orderBy});}}}_0x5e894d({'ok':0x1});}else _0x5e894d({'res':0x0});});}function createAdditionalPhone(_0x4ca32b,_0x48d4cd,_0x4c60c8,_0x357f37){var _0x4ee648='';var _0x4a8e6f='';var _0x1f6d5b=_0x4c60c8[_0x845d('0x23')]('§');_0x4ee648=_0x1f6d5b[0x0];if(_0x1f6d5b[_0x845d('0x1a')]==0x2)_0x4a8e6f=_0x1f6d5b[0x1];return new Promise(function(_0x4e0add,_0x28c2b8){return db[_0x845d('0x24')][_0x845d('0x25')]({'where':{'CmContactId':_0x4ca32b,'item':_0x4ee648}})['then'](function(_0x18de28){if(_0x18de28){return db['CmContactHasItem'][_0x845d('0x26')]({'ItemTypeId':_0x48d4cd,'description':_0x4a8e6f,'OrderBy':_0x357f37},{'where':{'CmContactId':_0x4ca32b,'item':_0x4ee648}})[_0x845d('0x1e')](function(_0x37aa2c){_0x4e0add({'res':_0x845d('0x27')});});}else{return db[_0x845d('0x24')]['create']({'CmContactId':_0x4ca32b,'item':_0x4ee648,'ItemTypeId':_0x48d4cd,'description':_0x4a8e6f,'OrderBy':_0x357f37,'ItemClass':'PHONE'})[_0x845d('0x1e')](function(_0xb1bace){_0x4e0add({'res':_0x845d('0x28')});});}});});}function updateContact(_0x2c747e){return new Promise(function(_0x544b65,_0x4fb2bd){var _0x2cb0f9=_0x2c747e['id'];delete _0x2c747e['id'];return db['CmContact'][_0x845d('0x26')](_0x2c747e,{'where':{'id':_0x2cb0f9}})['then'](function(_0x2e8f69){updatedRows+=0x1;return db[_0x845d('0x29')][_0x845d('0x26')]({'phone':_0x2c747e['phone']},{'where':{'ContactId':_0x2cb0f9}})[_0x845d('0x1e')](function(_0x7aef0c){_0x544b65({'ret':'OK'});});});});}function insertCmHopper(_0x4ade0d,_0x40be23,_0xcedad,_0x4718e9,_0x22d62a){var _0x2f6fe3=[_0x845d('0x2a'),'cm_contacts.scheduledat',_0x845d('0x2b'),'cm_contacts.ListId',_0x40be23+'.'+_0x4718e9,_0x845d('0x2c'),_0x845d('0x2d'),_0x845d('0x2e'),_0x845d('0x2f'),'\x22'+_0x22d62a+'\x22'];return squel['insert']()[_0x845d('0x30')](_0x845d('0x31'))[_0x845d('0x32')]([_0x845d('0x12'),_0x845d('0x33'),_0x845d('0x34'),_0x845d('0x35'),_0x4718e9,'createdAt','updatedAt',_0x845d('0x36'),'UserId','recallme'],squel[_0x845d('0x11')]()[_0x845d('0x37')](_0x2f6fe3)[_0x845d('0x13')](_0x40be23)[_0x845d('0x14')](_0x845d('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x40be23+'.CmListId')[_0x845d('0x14')](_0xcedad,null,_0xcedad+_0x845d('0x15')+_0x40be23+'.'+_0x4718e9)[_0x845d('0x16')](_0x40be23+_0x845d('0x39'),_0x4ade0d)[_0x845d('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x845d('0x3a'),selectNotIn(_0x40be23,_0xcedad,_0x4718e9,_0x845d('0x31'),[_0x845d('0x3b'),_0x845d('0x3c')]))[_0x845d('0x16')](_0x845d('0x3a'),selectNotIn(_0x40be23,_0xcedad,_0x4718e9,_0x845d('0x31'),[_0x845d('0x3b')])))[_0x845d('0x3d')]();}function insertCmHopperBlack(_0x3cced4,_0x2fbbf0,_0x2f5f47,_0x55aef4){var _0x183835=['cm_contacts.phone',_0x845d('0x2b'),_0x845d('0x3e'),_0x2fbbf0+'.'+_0x55aef4,_0x845d('0x2c'),_0x845d('0x2d')];return squel[_0x845d('0x3f')]()['into'](_0x845d('0x40'))[_0x845d('0x32')]([_0x845d('0x12'),'ContactId','ListId',_0x55aef4,'createdAt',_0x845d('0x41')],squel[_0x845d('0x11')]()[_0x845d('0x37')](_0x183835)[_0x845d('0x13')](_0x2fbbf0)[_0x845d('0x14')]('cm_contacts',null,_0x845d('0x42')+_0x2fbbf0+_0x845d('0x43'))[_0x845d('0x14')](_0x2f5f47,null,_0x2f5f47+_0x845d('0x15')+_0x2fbbf0+'.'+_0x55aef4)[_0x845d('0x16')](_0x2fbbf0+'.CmListId\x20=\x20?',_0x3cced4)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x845d('0x3a'),squel['select']()['field'](_0x845d('0x12'))['from'](_0x845d('0x40'))[_0x845d('0x16')]('ListId\x20=\x20?',_0x3cced4)[_0x845d('0x16')](_0x55aef4+_0x845d('0x44'),_0x2fbbf0+'.'+_0x55aef4)))[_0x845d('0x3d')]();}function insertCmHopperAdditionalPhones(_0x5ab1cb){var _0x36945d=[_0x845d('0x45'),'cm_contact_has_items.item',_0x845d('0x46'),_0x845d('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x845d('0x3f')]()[_0x845d('0x30')](_0x845d('0x48'))[_0x845d('0x32')]([_0x845d('0x49'),_0x845d('0x12'),_0x845d('0x4a'),_0x845d('0x4b'),_0x845d('0x41')],squel['select']()['fields'](_0x36945d)[_0x845d('0x13')](_0x845d('0x31'))[_0x845d('0x14')]('cm_contacts',null,_0x845d('0x4c'))[_0x845d('0x14')](_0x845d('0x4d'),null,_0x845d('0x4e'))[_0x845d('0x16')]('cm_hopper.ListId\x20=\x20?',_0x5ab1cb)[_0x845d('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x845d('0x3d')]();}function insertCmContact(_0x176050,_0x368a8c,_0x4de065,_0x27b087){var _0x2ec7cc=_[_0x845d('0x4f')](_['keys'](_0x27b087),[_0x845d('0x35'),_0x845d('0x50'),'createdAt','updatedAt']);return squel[_0x845d('0x3f')]()['into'](_0x845d('0x38'))['fromQuery'](_0x2ec7cc,squel['select']()[_0x845d('0x37')](_0x2ec7cc)[_0x845d('0x13')](_0x368a8c)[_0x845d('0x16')]('('+_0x4de065[_0x845d('0x14')](',')+_0x845d('0x51'),squel[_0x845d('0x11')]()[_0x845d('0x37')](_0x4de065)[_0x845d('0x13')](_0x845d('0x38'))[_0x845d('0x16')](_0x845d('0x52'),_0x176050))[_0x845d('0x16')](_0x845d('0x53'),squel['select']()[_0x845d('0x54')](_0x845d('0x55'),_0x845d('0x56'))[_0x845d('0x13')](_0x368a8c)['group'](_0x4de065[_0x845d('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x845d('0x57'));stopped=!![];}function handleUncaughtException(_0x150b6e){logger[_0x845d('0x20')](_0x150b6e[_0x845d('0x21')]);process[_0x845d('0x58')](0x1);}function handleError(_0x26b9be,_0x2ad073){stats[_0x845d('0x59')][_0x845d('0x1d')]({'name':_0x2ad073[_0x845d('0x5a')],'message':_0x2ad073[_0x845d('0x21')],'row':_0x26b9be});}function handleQuery(_0x16410f){logger[_0x845d('0x5b')](_0x16410f);return db[_0x845d('0x5c')]['query'](_0x16410f)['spread'](function(_0x2b4696){results[_0x845d('0x1d')](_0x2b4696);})[_0x845d('0x1f')](function(_0xb8ddc2){logger[_0x845d('0x20')](_0xb8ddc2[_0x845d('0x21')]);});}function main(_0xfc9903,_0x20f69d,_0x567278,_0x3f3a9d){logger[_0x845d('0x5b')]('main',_0xfc9903,JSON[_0x845d('0x5d')](_0x20f69d));process[_0x845d('0x5e')](_0x845d('0x5f'));var _0x8d2f1e=_0x20f69d[_0x845d('0x60')];var _0x1e295d=_[_0x845d('0x61')](_0x8d2f1e);var _0x4aa2a0=_0x20f69d[_0x845d('0x62')];var _0x59cdb7=path[_0x845d('0x14')](config[_0x845d('0x63')],_0x845d('0x64'),_0x4aa2a0+_0x845d('0x65'));logger[_0x845d('0x5b')]('body',_0x20f69d);db[_0x845d('0x66')][_0x845d('0x67')]({'raw':!![],'attributes':['id','name']})[_0x845d('0x1e')](function(_0x29faec){for(var _0x4882ba=0x0;_0x4882ba<_0x29faec[_0x845d('0x1a')];_0x4882ba++){if(_0x29faec[_0x4882ba][_0x845d('0x68')]in _0x8d2f1e){contactItemTypes[_0x845d('0x1d')](_0x29faec[_0x4882ba]);delete _0x1e295d[_0x29faec[_0x4882ba]['name']];hasAdditionalPhones=!![];}for(var _0x36badb in _0x8d2f1e){if(_0x29faec[_0x4882ba][_0x845d('0x68')]+_0x845d('0x69')===_0x36badb){phoneDescriptions['push']({'itemTypeId':_0x29faec[_0x4882ba]['id'],'description':_0x36badb});delete _0x1e295d[_0x36badb];}}}if(hasAdditionalPhones)_0x1e295d[_0x845d('0x1c')]='';var _0x537206=_['keys'](_0x1e295d)['join']();logger[_0x845d('0x5b')]('header',_0x537206);fs[_0x845d('0x6a')](_0x59cdb7,_0x537206+'\x0a');Papa[_0x845d('0x6b')](fs[_0x845d('0x6c')](_0xfc9903),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2e8422,_0x2fa788){try{for(var _0x5282e6=0x0,_0x519a9d=[];_0x5282e6<_0x2e8422['data']['length'];_0x5282e6++){stats['rows']+=0x1;if(_0x2e8422[_0x845d('0x59')][_0x5282e6]){handleError(_0x2e8422[_0x845d('0x6d')][_0x5282e6],_0x2e8422[_0x845d('0x59')][_0x5282e6]);}else{var _0x5c6d12=[];var _0x29e998=[];var _0x31db49={};for(var _0x2f8529 in _0x8d2f1e){let _0x49a770=contactItemTypes[_0x845d('0x6e')](_0x37379a=>_0x37379a['name']===_0x2f8529);let _0x299de6=contactItemTypes[_0x845d('0x6e')](_0x1bd1f6=>_0x1bd1f6[_0x845d('0x68')]+'_description'===_0x2f8529);if(_['isNil'](_0x49a770)&&_[_0x845d('0x1b')](_0x299de6)){if(_0x8d2f1e[_0x845d('0x6f')](_0x2f8529)){if(_0x2e8422['data'][_0x5282e6][_0x8d2f1e[_0x2f8529]]){var _0x4678f3=_[_0x845d('0x70')](_0x2e8422['data'][_0x5282e6][_0x8d2f1e[_0x2f8529]][_0x845d('0x71')](/"/g,'\x27'));switch(_0x2f8529){case'scheduledat':var _0x23872e=moment(_0x4678f3,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x23872e[_0x845d('0x72')]()){_0x519a9d[_0x845d('0x1d')]('\x22'+_0x4678f3+'\x22');}else{_0x5c6d12[_0x845d('0x1d')](_0x845d('0x73'));}break;case _0x845d('0x36'):var _0x5cc5e9=parseInt(_0x4678f3);_0x4678f3=_['isNaN'](_0x5cc5e9)||_0x5cc5e9<0x0||_0x5cc5e9>0x4?_0x3f3a9d?0x3:0x2:_0x5cc5e9;_0x519a9d[_0x845d('0x1d')]('\x22'+_0x4678f3+'\x22');break;case _0x845d('0x74'):var _0x4f52a5=parseInt(_0x4678f3);if(_[_0x845d('0x75')](_0x4f52a5)&&_[_0x845d('0x76')](_0x567278,_0x4f52a5)){_0x519a9d['push']('\x22'+_0x4f52a5+'\x22');}else{_0x5c6d12[_0x845d('0x1d')](_0x845d('0x77'));}break;case'email':if(isEmail(_0x4678f3)){_0x519a9d[_0x845d('0x1d')]('\x22'+_0x4678f3+'\x22');}else{_0x5c6d12[_0x845d('0x1d')]('email\x20wrong\x20format');}break;case _0x845d('0x78'):var _0x1c7077=moment(_0x4678f3,'YYYY-MM-DD',!![]);if(_0x1c7077['isValid']()){_0x519a9d[_0x845d('0x1d')]('\x22'+_0x4678f3+'\x22');}else{_0x5c6d12['push'](_0x845d('0x79'));}break;default:_0x519a9d[_0x845d('0x1d')]('\x22'+_0x4678f3+'\x22');}}else{switch(_0x2f8529){case'firstName':case _0x845d('0x12'):_0x5c6d12[_0x845d('0x1d')](_0x2f8529+_0x845d('0x7a'));break;default:_0x519a9d[_0x845d('0x1d')]('\x22\x22');}}}}else{var _0x5352b4='';if(!_['isNil'](_0x49a770)){if(!_0x31db49[_0x845d('0x6f')](_0x49a770['id'])){for(var _0x2fde09=0x0;_0x2fde09<_0x8d2f1e[_0x2f8529][_0x845d('0x1a')];_0x2fde09++){var _0x4678f3=_[_0x845d('0x70')](_0x2e8422[_0x845d('0x6d')][_0x5282e6][_0x8d2f1e[_0x2f8529][_0x2fde09]][_0x845d('0x71')](/"/g,'\x27'));var _0x22c152=phoneDescriptions['find'](_0x21c8e5=>_0x21c8e5[_0x845d('0x7b')]===_0x49a770['id']);if(!_['isNil'](_0x22c152)){var _0x2634c4=_[_0x845d('0x70')](_0x2e8422[_0x845d('0x6d')][_0x5282e6][_0x8d2f1e[_0x22c152[_0x845d('0x7c')]][0x0]][_0x845d('0x71')](/"/g,'\x27'));if(!_[_0x845d('0x1b')](_0x2634c4))_0x4678f3=_0x4678f3+'§'+_0x2634c4;}if(_0x5352b4=='')_0x5352b4=_0x4678f3;else _0x5352b4+='|'+_0x4678f3;}_0x29e998['push'](_0x49a770['id']+':'+_0x5352b4);_0x31db49[_0x49a770['id']]=0x1;}}}}if(hasAdditionalPhones){_0x519a9d[_0x845d('0x1d')]('\x22'+_0x29e998['join'](';')+'\x22');}if(_0x5c6d12[_0x845d('0x1a')]){handleError(_0x2e8422['data'][_0x5282e6],{'code':_0x845d('0x7d'),'message':_0x5c6d12[_0x845d('0x14')]()});}else{fs['appendFileSync'](_0x59cdb7,_0x519a9d[_0x845d('0x14')]()+'\x0a');}_0x519a9d=[];}if(!(stats[_0x845d('0x7e')]%0xc8)){socket['emit'](_0x845d('0x7f')+_0x4aa2a0,stats);stats[_0x845d('0x59')]=[];}}if(stopped){logger[_0x845d('0x5b')](_0x845d('0x80'));_0x2fa788[_0x845d('0x81')]();}}catch(_0x5d8f2d){handleError(_0x2e8422[_0x845d('0x6d')][_0x5282e6],{'code':'SystemError','message':_0x5d8f2d[_0x845d('0x21')]});logger[_0x845d('0x20')]('step',_0x5d8f2d[_0x845d('0x21')]);}},'complete':function(){try{var _0xb82b42=[];var _0x2ef6e4=tempTableName;_0xb82b42['push'](_0x845d('0x82')+_0x2ef6e4+_0x845d('0x83'));logger[_0x845d('0x5b')]('CIS\x20len',contactItemTypes['length']);var _0x279544=util[_0x845d('0xd')](_0x845d('0x84'),_0x59cdb7,_0x2ef6e4,_0x537206,_0x20f69d[_0x845d('0x35')],_0x20f69d[_0x845d('0x50')]||null,NOW,NOW);if(_[_0x845d('0x1b')](_0x8d2f1e['scheduledat'])){_0x279544+=_0x845d('0x85');}_0xb82b42[_0x845d('0x1d')](_0x279544);BPromise['each'](_0xb82b42,handleQuery)['then'](function(_0x3eddbf){BPromise[_0x845d('0x22')]([handleAdditionalPhones()])[_0x845d('0x1e')](function(){_0xb82b42=[];for(var _0x39b6b9=0x0;_0x39b6b9\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','role','agent','select','field','color','from','tools_tags','user_has_','_interactions','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getAccountFK','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','name','buildExpression','type','default','text','value','unreadMessages','read','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','end','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','forEach','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.to','i.MailAccountId'];(function(_0xcad01d,_0xef9abc){var _0x76a4a6=function(_0x15b2a4){while(--_0x15b2a4){_0xcad01d['push'](_0xcad01d['shift']());}};_0x76a4a6(++_0xef9abc);}(_0x2739,0x16f));var _0x9273=function(_0x5b732a,_0x48ea3b){_0x5b732a=_0x5b732a-0x0;var _0x3e418d=_0x2739[_0x5b732a];return _0x3e418d;};'use strict';var _=require(_0x9273('0x0'));var squel=require(_0x9273('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x9273('0x2'));var updateInteraction=require('./update-interaction')[_0x9273('0x3')];var utils=require(_0x9273('0x4'));var db=require(_0x9273('0x5'))['db'];function skipInteractionsQuery(_0xd6f70c,_0x115a2d,_0xb34724){var _0xa3f38e=![];var _0x1c6434=utils['getAccountFK'](_0xd6f70c);if(_0x115a2d[_0x9273('0x6')]===_0x9273('0x7')&&!_0xb34724['search']&&!_0xb34724[_0x1c6434]){_0xa3f38e=!![];}return _0xa3f38e;}function getTagsQuery(){return squel[_0x9273('0x8')]()[_0x9273('0x9')]('id')['field']('name')[_0x9273('0x9')](_0x9273('0xa'))[_0x9273('0xb')](_0x9273('0xc'));}function getUsersQuery(_0x57b60a,_0x2a52d7){var _0x391c80=utils['getInteractionFK'](_0x57b60a);var _0x3e49f1=_0x9273('0xd')+_0x57b60a+_0x9273('0xe');var _0x346b16=squel[_0x9273('0x8')]()[_0x9273('0x9')](_0x9273('0xf'))['field'](_0x9273('0x10'))['field'](_0x9273('0x11')+_0x391c80)['from'](_0x3e49f1,'ui')[_0x9273('0x12')]('users','u',_0x9273('0x13'));if(_0x2a52d7[_0x9273('0x14')]>0x0){_0x346b16[_0x9273('0x15')](_0x9273('0x11')+_0x391c80+_0x9273('0x16'),_[_0x9273('0x17')](_0x2a52d7,'id'));}return _0x346b16;}function getInteractionsQuery(_0x86c726){var _0x2525df=utils['getInteractionsTables'](_0x86c726);var _0x42198f=utils[_0x9273('0x18')](_0x86c726);var _0x560679=utils[_0x9273('0x19')](_0x86c726);return squel[_0x9273('0x8')]()['from'](_0x2525df[_0x9273('0x1a')],'i')[_0x9273('0x12')](_0x9273('0x1b'),'c',_0x9273('0x1c'))[_0x9273('0x12')](_0x9273('0x1d'),'o',_0x9273('0x1e'))['left_join'](_0x2525df[_0x9273('0x1f')],'a',_0x9273('0x20')+_0x42198f)[_0x9273('0x12')](_0x2525df[_0x9273('0x21')],'me','me.'+_0x560679+_0x9273('0x22'))[_0x9273('0x12')](_0x2525df[_0x9273('0x23')],'it',_0x9273('0x24')+_0x560679+_0x9273('0x22'))[_0x9273('0x12')]('tools_tags','t',_0x9273('0x25'));}function getSqlClauses(){var _0x2a4050={'body':squel[_0x9273('0x26')](),'contact':squel['expr'](),'default':squel[_0x9273('0x26')](),'fields':squel[_0x9273('0x26')](),'filter':squel['expr'](),'read':squel[_0x9273('0x26')](),'tags':{'clause':squel[_0x9273('0x26')](),'ids':null},'user':squel['expr']()};return _0x2a4050;}function parseTagParameter(_0x2e2b39){var _0x2a47b7=squel[_0x9273('0x26')]();if(_0x2e2b39){var _0x1c75e6=utils[_0x9273('0x27')](_0x2e2b39);_0x1c75e6['forEach'](function(_0x1f89a3){_0x2a47b7['or'](_0x9273('0x28'),'%,'+_0x1f89a3+',%');});}return _0x2a47b7;}function parseReadParameter(_0xf25571){var _0x302188='';if(_0xf25571){_0x302188=_0x9273('0x29');if(_0xf25571==='1'){_0x302188=_0x302188[_0x9273('0x2a')](_0x9273('0x2b'),'=');}else{_0x302188=_0x302188['replace']('{OPERATOR}','>');}}return _0x302188;}function parseSearchFilter(_0x412044,_0x5dcdd9){var _0x127464=squel[_0x9273('0x26')]();if(_0x5dcdd9){var _0x2c6594=_0x5dcdd9['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9273('0x2c')](_0x2c6594)){_0x127464['or'](_0x9273('0x2d'),_0x2c6594+'%');if([_0x9273('0x2e'),_0x9273('0x2f')][_0x9273('0x30')](_0x412044)){_0x127464['or'](_0x9273('0x31'),_0x2c6594+'%');}else if(_0x412044===_0x9273('0x32')){_0x127464['or']('i.fax\x20LIKE\x20?',_0x2c6594+'%');}else if(_0x412044==='openchannel'){_0x127464['or']('i.from\x20LIKE\x20?',_0x2c6594+'%');}}else if(_0x412044===_0x9273('0x33')&&qs[_0x9273('0x34')](_0x2c6594)){_0x127464['or'](_0x9273('0x35'),_0x2c6594+'%');}else{if(_0x412044===_0x9273('0x33')){_0x127464['or'](_0x9273('0x36'),qs[_0x9273('0x37')](_0x2c6594,!![]))['or'](_0x9273('0x38'),qs[_0x9273('0x37')](_0x2c6594));}else if(_0x412044!=='fax'){_0x127464['or'](_0x9273('0x39'),qs[_0x9273('0x37')](_0x2c6594));}_0x127464['or'](_0x9273('0x3a'),qs[_0x9273('0x37')](_0x2c6594,!![]),null);}}return _0x127464;}function parseAdvancedSearchFilter(_0x4e54d9,_0xe21435){var _0xa7362b=getSqlClauses();var _0x596a53=as['parseSearch'](_0x4e54d9);var _0x1575d4=_0x596a53[_0x9273('0x3b')];for(var _0x50a206=0x0;_0x50a206<_0x596a53[_0x9273('0x3c')][_0x9273('0x14')];_0x50a206++){var _0x1bd031=_0x596a53['conditions'][_0x50a206];var _0xb6097='i';var _0x4f671c=_[_0x9273('0x3d')](_0xe21435,[_0x9273('0x3e'),_0x1bd031['field']]);if(_0x4f671c){var _0x4740c5=as[_0x9273('0x3f')](_0xb6097,_0x4f671c[_0x9273('0x40')],_0x1bd031);_0xa7362b[_0x9273('0x41')][_0x1575d4](_0x4740c5[_0x9273('0x42')],_0x4740c5[_0x9273('0x43')]['start'],_0x4740c5[_0x9273('0x43')]['end']);}else{switch(_0x1bd031[_0x9273('0x9')]){case _0x9273('0x44'):var _0x485df5=parseReadParameter(_0x1bd031[_0x9273('0x43')]);_0xa7362b[_0x9273('0x45')][_0x9273('0x46')](_0x485df5);break;case _0x9273('0x47'):if(_0x1bd031[_0x9273('0x48')]===_0x9273('0x49')){if(_0x1bd031[_0x9273('0x43')][_0x9273('0x4a')]('\x20')['length']>0x1){_0xa7362b[_0x9273('0x4b')][_0x1575d4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9273('0x37')](_0x1bd031['value'],!![]),null);}else{var _0x23a7fb='%'+_0x1bd031[_0x9273('0x43')]+'%';_0xa7362b['contact'][_0x1575d4](_0x9273('0x4c'),_0x23a7fb,_0x23a7fb,_0x23a7fb);}}else{_0x4f671c=_[_0x9273('0x3d')](_0xe21435,[_0x9273('0x3e'),_0x9273('0x4d')]);_0x1bd031['field']=_0x9273('0x4d');_0x4740c5=as['buildExpression'](_0xb6097,_0x4f671c[_0x9273('0x40')],_0x1bd031);_0xa7362b['contact'][_0x1575d4](_0x4740c5['text'],_0x4740c5[_0x9273('0x43')][_0x9273('0x4e')],_0x4740c5[_0x9273('0x43')][_0x9273('0x4f')]);}break;case _0x9273('0x50'):var _0xbee5e0=_0x1bd031[_0x9273('0x43')][_0x9273('0x4a')](',')[_0x9273('0x17')](function(_0x31a6a1){return Number(_0x31a6a1);});var _0x4c2e94=parseTagParameter(_0xbee5e0);_0xa7362b[_0x9273('0x51')][_0x9273('0x52')][_0x9273('0x46')](_0x4c2e94);_0xa7362b[_0x9273('0x51')][_0x9273('0x53')]=_0xbee5e0;break;case _0x9273('0x54'):if(_0x1bd031['operator']==='$substring'){_0xa7362b[_0x9273('0x55')][_0x1575d4](_0x9273('0x56'),'%'+_0x1bd031['value']+'%',null);}else{_0x4f671c=_[_0x9273('0x3d')](_0xe21435,[_0x9273('0x3e'),_0x9273('0x57')]);_0x1bd031[_0x9273('0x9')]=_0x9273('0x57');_0x4740c5=as[_0x9273('0x3f')](_0xb6097,_0x4f671c['type'],_0x1bd031);_0xa7362b['user'][_0x1575d4](_0x4740c5[_0x9273('0x42')],_0x4740c5['value'][_0x9273('0x4e')],_0x4740c5['value'][_0x9273('0x4f')]);}break;case _0x9273('0x58'):case _0x9273('0x59'):_0x4740c5=as[_0x9273('0x3f')]('me',null,_0x1bd031);_0xa7362b[_0x9273('0x58')][_0x1575d4](_0x4740c5[_0x9273('0x42')],_0x4740c5[_0x9273('0x43')][_0x9273('0x4e')],_0x4740c5[_0x9273('0x43')][_0x9273('0x4f')]);break;}}}return _0xa7362b;}function parseModelFields(_0x309864,_0x10b077,_0x18f6ce){var _0x1c1a97=utils['getAccountFK'](_0x309864);var _0x353442=squel[_0x9273('0x26')]();var _0x366c83=_(_0x10b077)[_0x9273('0x5a')]()[_0x9273('0x17')](function(_0x4e5f70){return _[_0x9273('0x5b')](_0x18f6ce,['name',_0x4e5f70])?_0x4e5f70:undefined;})[_0x9273('0x5c')]()[_0x9273('0x43')]();if(_0x366c83[_0x9273('0x14')]>0x0){_0x366c83[_0x9273('0x5d')](function(_0xb3978a){if(_0xb3978a===_0x1c1a97){_0x353442['and']('i.'+_0x1c1a97+_0x9273('0x16'),[]['concat'](_0x10b077[_0xb3978a]));}else if(_0xb3978a===_0x9273('0x5e')){var _0x5384cc=JSON[_0x9273('0x5f')](_0x10b077[_0xb3978a])[_0x9273('0x60')];var _0x25a710=JSON['parse'](_0x10b077[_0xb3978a])['$lte'];_0x353442['and'](_0x9273('0x61'),_0x5384cc,_0x25a710);}else{if(_0x10b077[_0xb3978a]===_0x9273('0x62')){_0x353442[_0x9273('0x46')]('i.'+_0xb3978a+_0x9273('0x63'));}else{_0x353442[_0x9273('0x46')]('i.'+_0xb3978a+_0x9273('0x64'),_0x10b077[_0xb3978a]);}}});}return _0x353442;}function parseQueryParameters(_0x65ee77,_0x2b60cb,_0x5bd26b){var _0x4724e1=getSqlClauses();return Promise[_0x9273('0x65')]()[_0x9273('0x66')](function(){return parseModelFields(_0x65ee77,_0x2b60cb,_0x5bd26b);})[_0x9273('0x66')](function(_0x2979ed){_0x4724e1[_0x9273('0x67')]['and'](_0x2979ed);return parseReadParameter(_0x2b60cb['read']);})['then'](function(_0x35e1ee){_0x4724e1[_0x9273('0x45')][_0x9273('0x46')](_0x35e1ee);return parseTagParameter(_0x2b60cb[_0x9273('0x68')]);})[_0x9273('0x66')](function(_0x451991){_0x4724e1[_0x9273('0x51')][_0x9273('0x52')][_0x9273('0x46')](_0x451991);return parseSearchFilter(_0x65ee77,_0x2b60cb[_0x9273('0x69')]);})[_0x9273('0x66')](function(_0x535a08){_0x4724e1[_0x9273('0x69')]=_0x535a08;return _0x4724e1;});}function checkAccountsRestrictions(_0x449f3d,_0x4357df,_0x5c498a){var _0x3e11aa=utils['getAccountFK'](_0x449f3d);var _0x324f8b=_0x9273('0x6a')+_[_0x9273('0x6b')](_0x449f3d)+(_0x449f3d===_0x9273('0x6c')?_0x9273('0x6d'):_0x9273('0x6e'));var _0x360775=squel[_0x9273('0x26')]();return Promise[_0x9273('0x65')]()[_0x9273('0x66')](function(){if(_0x5c498a['search']&&_0x4357df[_0x9273('0x6')]===_0x9273('0x7')){return _0x4357df[_0x324f8b]({'attributes':['id'],'raw':!![]});}})[_0x9273('0x66')](function(_0x2936d8){if(_0x2936d8){if(_0x2936d8[_0x9273('0x14')]===0x0){_0x360775[_0x9273('0x46')]('i.'+_0x3e11aa+_0x9273('0x63'));}else{_0x360775[_0x9273('0x46')]('i.'+_0x3e11aa+'\x20IN\x20?',_['map'](_0x2936d8,'id'));}}else if(!_0x5c498a[_0x3e11aa]){_0x360775['and']('i.'+_0x3e11aa+_0x9273('0x6f'));}})[_0x9273('0x66')](function(){return _0x360775;});}function getClosedOrderClause(_0x448e45,_0x55c1fb){var _0xad716e='';var _0x564514=[_0x9273('0x70'),'i.secondDisposition',_0x9273('0x71')];if(_0x448e45==='mail'){_0x564514[_0x9273('0x72')](_0x9273('0x73'));}if(_0x55c1fb[_0x9273('0x74')]==='0'&&_0x448e45===_0x9273('0x33')){_0xad716e=_0x9273('0x73');}else{if(_0x55c1fb[_0x9273('0x74')]==='1'){_0x564514[_0x9273('0x75')]();}_0xad716e=_0x9273('0x76')+_0x564514[_0x9273('0x77')](',\x20')+')';}return _0xad716e;}function getFilteredInteractions(_0x32ad66,_0x4b0b79,_0x4637d9,_0x512617){var _0x351b17=utils[_0x9273('0x19')](_0x32ad66);var _0x263a75=_[_0x9273('0x6b')](_0x32ad66)+_0x9273('0x78');var _0x3c93eb=[];var _0x10719c=getTagsQuery();var _0x51daab={'type':db[_0x9273('0x79')][_0x9273('0x7a')][_0x9273('0x7b')],'raw':!![]};var _0x5d6efb=[];var _0x1d5f72=[];return db[_0x9273('0x7c')]['query'](_0x10719c[_0x9273('0x7d')](),_0x51daab)[_0x9273('0x66')](function(_0x26ca22){_0x3c93eb=_[_0x9273('0x7e')](_0x26ca22,'id');_0x51daab=_[_0x9273('0x7f')](_0x51daab,{'model':db[_0x263a75],'mapToModel':!![],'nest':!![]});if(_0x4637d9[_0x9273('0x67')]){_0x512617[_0x9273('0x80')][_0x9273('0x5d')](function(_0x29c5ea){_0x4b0b79[_0x9273('0x9')]('i.'+_0x29c5ea);});}else{_0x4b0b79[_0x9273('0x9')](_0x9273('0x81'),_0x9273('0x44'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x82'),'Account.key');_0x4b0b79[_0x9273('0x9')]('a.mandatoryDisposition',_0x9273('0x83'));if(_0x32ad66===_0x9273('0x33')){_0x4b0b79['field'](_0x9273('0x84'),_0x9273('0x85'));_0x4b0b79['field'](_0x9273('0x86'),_0x9273('0x87'));_0x4b0b79['field'](_0x9273('0x88'));_0x4b0b79['field'](_0x9273('0x89'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x8a'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x8b'));_0x4b0b79[_0x9273('0x9')]('i.closedAt');_0x4b0b79['field'](_0x9273('0x8c'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x8d'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x8e'));_0x4b0b79[_0x9273('0x9')]('i.subject');_0x4b0b79[_0x9273('0x9')]('i.disposition');_0x4b0b79[_0x9273('0x9')](_0x9273('0x8f'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x70'));_0x4b0b79['field'](_0x9273('0x73'));_0x4b0b79['field'](_0x9273('0x90'));_0x4b0b79[_0x9273('0x9')]('i.ContactId');_0x4b0b79[_0x9273('0x9')](_0x9273('0x91'));_0x4b0b79[_0x9273('0x9')]('i.UserId');}else if(_0x32ad66==='openchannel'){_0x4b0b79['field'](_0x9273('0x92'),'contactName');}else{_0x4b0b79[_0x9273('0x9')]('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',_0x9273('0x87'));}if(_0x32ad66!=='mail'){_0x4b0b79[_0x9273('0x9')]('i.*');}_0x4b0b79[_0x9273('0x9')](_0x9273('0x93'),_0x9273('0x94'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x95'),'Contact.lastName');_0x4b0b79[_0x9273('0x9')]('c.email',_0x9273('0x96'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x97'),'Contact.phone');_0x4b0b79[_0x9273('0x9')](_0x9273('0x98'),_0x9273('0x99'));_0x4b0b79['field'](_0x9273('0x9a'),_0x9273('0x9b'));_0x4b0b79['field'](_0x9273('0x9c'),'Owner.fullname');_0x4b0b79['field']('o.internal',_0x9273('0x9d'));_0x4b0b79[_0x9273('0x9')](_0x9273('0x9e'),_0x9273('0x9f'));}if(_0x512617[_0x9273('0xa0')]){_0x4b0b79[_0x9273('0xa0')](_0x512617['limit']);}if(_0x512617['offset']){_0x4b0b79[_0x9273('0xa1')](_0x512617[_0x9273('0xa1')]);}return db['sequelize'][_0x9273('0xa2')](_0x4b0b79['toString'](),_0x51daab);})['then'](function(_0x141312){_0x5d6efb=_0x141312;var _0x28a47f=getUsersQuery(_0x32ad66,_0x5d6efb);return db['sequelize']['query'](_0x28a47f['toString'](),_0x51daab);})[_0x9273('0x66')](function(_0x4f4b2c){_0x1d5f72=_[_0x9273('0xa3')](_0x4f4b2c,_0x351b17);if(_0x32ad66===_0x9273('0x33')){return db['Setting'][_0x9273('0xa4')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x9273('0x66')](function(_0x16d658){var _0x39e8dc=_0x16d658?_0x16d658[_0x9273('0xa5')]:undefined;var _0x550544=_0x5d6efb[_0x9273('0x17')](function(_0x31044b){return updateInteraction(_0x31044b,_0x3c93eb,_0x1d5f72,_0x39e8dc);});return Promise[_0x9273('0xa6')](_0x550544);});}function countFilteredInteractions(_0x216cc4,_0x35298e){var _0x327932=_0x216cc4[_0x9273('0xa7')]();_0x327932[_0x9273('0x9')](_0x9273('0xa8'));_0x327932[_0x9273('0x9')](_0x9273('0x81'),_0x9273('0x44'));var _0x34227c=utils[_0x9273('0x27')](_0x35298e);if(!_[_0x9273('0xa9')](_0x34227c)){_0x327932[_0x9273('0x15')]('t.id\x20IN\x20?',_0x34227c);}var _0x15834e={'type':db[_0x9273('0x79')][_0x9273('0x7a')][_0x9273('0x7b')],'raw':!![]};return db['sequelize']['query'](_0x327932[_0x9273('0x7d')](),_0x15834e);}module[_0x9273('0xaa')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0199=['i.createdAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','TagIds','limit','offset','groupBy','Setting','findOne','all','COUNT(*)','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','agent','search','select','field','name','color','tools_tags','u.fullname','from','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','map','getInteractionsTables','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','interactionsTags','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','buildExpression','type','default','text','start','value','end','unreadMessages','read','and','Contact','operator','$substring','ContactId','Tag','split','tags','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','get','capitalize','chat','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Interaction','Sequelize','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id'];(function(_0x37c8ca,_0x104b95){var _0x33fd32=function(_0x2124f9){while(--_0x2124f9){_0x37c8ca['push'](_0x37c8ca['shift']());}};_0x33fd32(++_0x104b95);}(_0x0199,0xc3));var _0x9019=function(_0xed33c7,_0x24ef1d){_0xed33c7=_0xed33c7-0x0;var _0x1eea2f=_0x0199[_0xed33c7];return _0x1eea2f;};'use strict';var _=require(_0x9019('0x0'));var squel=require(_0x9019('0x1'));var as=require(_0x9019('0x2'));var qs=require(_0x9019('0x3'));var updateInteraction=require(_0x9019('0x4'))[_0x9019('0x5')];var utils=require(_0x9019('0x6'));var db=require(_0x9019('0x7'))['db'];function skipInteractionsQuery(_0x176def,_0x2a579a,_0x493f4a){var _0x533bdb=![];var _0x2a1bca=utils[_0x9019('0x8')](_0x176def);if(_0x2a579a['role']===_0x9019('0x9')&&!_0x493f4a[_0x9019('0xa')]&&!_0x493f4a[_0x2a1bca]){_0x533bdb=!![];}return _0x533bdb;}function getTagsQuery(){return squel[_0x9019('0xb')]()[_0x9019('0xc')]('id')['field'](_0x9019('0xd'))[_0x9019('0xc')](_0x9019('0xe'))['from'](_0x9019('0xf'));}function getUsersQuery(_0x4f309a,_0x4d80a0){var _0x327895=utils['getInteractionFK'](_0x4f309a);var _0x49786a='user_has_'+_0x4f309a+'_interactions';var _0x29d9fc=squel[_0x9019('0xb')]()['field']('u.id')[_0x9019('0xc')](_0x9019('0x10'))[_0x9019('0xc')]('ui.'+_0x327895)[_0x9019('0x11')](_0x49786a,'ui')[_0x9019('0x12')](_0x9019('0x13'),'u',_0x9019('0x14'));if(_0x4d80a0[_0x9019('0x15')]>0x0){_0x29d9fc[_0x9019('0x16')](_0x9019('0x17')+_0x327895+'\x20IN\x20?',_[_0x9019('0x18')](_0x4d80a0,'id'));}return _0x29d9fc;}function getInteractionsQuery(_0x5131d8){var _0xaafedf=utils[_0x9019('0x19')](_0x5131d8);var _0x10a789=utils[_0x9019('0x8')](_0x5131d8);var _0x280bc9=utils[_0x9019('0x1a')](_0x5131d8);return squel[_0x9019('0xb')]()[_0x9019('0x11')](_0xaafedf[_0x9019('0x1b')],'i')['left_join'](_0x9019('0x1c'),'c',_0x9019('0x1d'))[_0x9019('0x12')](_0x9019('0x13'),'o',_0x9019('0x1e'))[_0x9019('0x12')](_0xaafedf['accounts'],'a',_0x9019('0x1f')+_0x10a789)[_0x9019('0x12')](_0xaafedf[_0x9019('0x20')],'me',_0x9019('0x21')+_0x280bc9+'\x20=\x20i.id')[_0x9019('0x12')](_0xaafedf[_0x9019('0x22')],'it','it.'+_0x280bc9+_0x9019('0x23'))[_0x9019('0x12')](_0x9019('0xf'),'t',_0x9019('0x24'));}function getSqlClauses(){var _0x5755ca={'body':squel['expr'](),'contact':squel[_0x9019('0x25')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x9019('0x25')](),'read':squel[_0x9019('0x25')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x9019('0x25')]()};return _0x5755ca;}function parseTagParameter(_0x5e8da2){var _0x2e6de9=squel[_0x9019('0x25')]();if(_0x5e8da2){var _0x3733f8=utils[_0x9019('0x26')](_0x5e8da2);_0x3733f8[_0x9019('0x27')](function(_0x19dd31){_0x2e6de9['or'](_0x9019('0x28'),'%,'+_0x19dd31+',%');});}return _0x2e6de9;}function parseReadParameter(_0x3d167b){var _0x86edd9='';if(_0x3d167b){_0x86edd9=_0x9019('0x29');if(_0x3d167b==='1'){_0x86edd9=_0x86edd9[_0x9019('0x2a')]('{OPERATOR}','=');}else{_0x86edd9=_0x86edd9[_0x9019('0x2a')](_0x9019('0x2b'),'>');}}return _0x86edd9;}function parseSearchFilter(_0x103b34,_0x4dd63e){var _0x29691f=squel['expr']();if(_0x4dd63e){var _0x15f7e6=_0x4dd63e['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x15f7e6)){_0x29691f['or'](_0x9019('0x2c'),_0x15f7e6+'%');if([_0x9019('0x2d'),_0x9019('0x2e')][_0x9019('0x2f')](_0x103b34)){_0x29691f['or']('i.phone\x20LIKE\x20?',_0x15f7e6+'%');}else if(_0x103b34===_0x9019('0x30')){_0x29691f['or'](_0x9019('0x31'),_0x15f7e6+'%');}else if(_0x103b34==='openchannel'){_0x29691f['or'](_0x9019('0x32'),_0x15f7e6+'%');}}else if(_0x103b34===_0x9019('0x33')&&qs['isEmail'](_0x15f7e6)){_0x29691f['or']('c.email\x20LIKE\x20?',_0x15f7e6+'%');}else{if(_0x103b34===_0x9019('0x33')){_0x29691f['or'](_0x9019('0x34'),qs[_0x9019('0x35')](_0x15f7e6,!![]))['or'](_0x9019('0x36'),qs['getFullTextValue'](_0x15f7e6));}else if(_0x103b34!==_0x9019('0x30')){_0x29691f['or'](_0x9019('0x37'),qs[_0x9019('0x35')](_0x15f7e6));}_0x29691f['or'](_0x9019('0x38'),qs[_0x9019('0x35')](_0x15f7e6,!![]),null);}}return _0x29691f;}function parseAdvancedSearchFilter(_0x2862d7,_0x3093c3){var _0x5149ff=getSqlClauses();var _0x5926d0=as['parseSearch'](_0x2862d7);var _0x1bb010=_0x5926d0[_0x9019('0x39')];for(var _0x5969b1=0x0;_0x5969b1<_0x5926d0[_0x9019('0x3a')][_0x9019('0x15')];_0x5969b1++){var _0x3969e1=_0x5926d0['conditions'][_0x5969b1];var _0x781241='i';var _0x42631d=_[_0x9019('0x3b')](_0x3093c3,[_0x9019('0xd'),_0x3969e1['field']]);if(_0x42631d){var _0x11b3ce=as[_0x9019('0x3c')](_0x781241,_0x42631d[_0x9019('0x3d')],_0x3969e1);_0x5149ff[_0x9019('0x3e')][_0x1bb010](_0x11b3ce[_0x9019('0x3f')],_0x11b3ce['value'][_0x9019('0x40')],_0x11b3ce[_0x9019('0x41')][_0x9019('0x42')]);}else{switch(_0x3969e1[_0x9019('0xc')]){case _0x9019('0x43'):var _0x562ef5=parseReadParameter(_0x3969e1['value']);_0x5149ff[_0x9019('0x44')][_0x9019('0x45')](_0x562ef5);break;case _0x9019('0x46'):if(_0x3969e1[_0x9019('0x47')]===_0x9019('0x48')){if(_0x3969e1[_0x9019('0x41')]['split']('\x20')[_0x9019('0x15')]>0x1){_0x5149ff['contact'][_0x1bb010]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9019('0x35')](_0x3969e1[_0x9019('0x41')],!![]),null);}else{var _0x2ddc8b='%'+_0x3969e1[_0x9019('0x41')]+'%';_0x5149ff['contact'][_0x1bb010]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2ddc8b,_0x2ddc8b,_0x2ddc8b);}}else{_0x42631d=_[_0x9019('0x3b')](_0x3093c3,[_0x9019('0xd'),'ContactId']);_0x3969e1[_0x9019('0xc')]=_0x9019('0x49');_0x11b3ce=as[_0x9019('0x3c')](_0x781241,_0x42631d[_0x9019('0x3d')],_0x3969e1);_0x5149ff['contact'][_0x1bb010](_0x11b3ce[_0x9019('0x3f')],_0x11b3ce[_0x9019('0x41')][_0x9019('0x40')],_0x11b3ce['value'][_0x9019('0x42')]);}break;case _0x9019('0x4a'):var _0x5ea0ad=_0x3969e1[_0x9019('0x41')][_0x9019('0x4b')](',')[_0x9019('0x18')](function(_0x3294cb){return Number(_0x3294cb);});var _0x5c1e94=parseTagParameter(_0x5ea0ad);_0x5149ff['tags']['clause'][_0x9019('0x45')](_0x5c1e94);_0x5149ff[_0x9019('0x4c')][_0x9019('0x4d')]=_0x5ea0ad;break;case _0x9019('0x4e'):if(_0x3969e1[_0x9019('0x47')]===_0x9019('0x48')){_0x5149ff[_0x9019('0x4f')][_0x1bb010](_0x9019('0x50'),'%'+_0x3969e1[_0x9019('0x41')]+'%',null);}else{_0x42631d=_[_0x9019('0x3b')](_0x3093c3,[_0x9019('0xd'),_0x9019('0x51')]);_0x3969e1[_0x9019('0xc')]=_0x9019('0x51');_0x11b3ce=as[_0x9019('0x3c')](_0x781241,_0x42631d['type'],_0x3969e1);_0x5149ff[_0x9019('0x4f')][_0x1bb010](_0x11b3ce[_0x9019('0x3f')],_0x11b3ce['value'][_0x9019('0x40')],_0x11b3ce[_0x9019('0x41')][_0x9019('0x42')]);}break;case _0x9019('0x52'):case'plainBody':_0x11b3ce=as[_0x9019('0x3c')]('me',null,_0x3969e1);_0x5149ff[_0x9019('0x52')][_0x1bb010](_0x11b3ce[_0x9019('0x3f')],_0x11b3ce[_0x9019('0x41')][_0x9019('0x40')],_0x11b3ce[_0x9019('0x41')]['end']);break;}}}return _0x5149ff;}function parseModelFields(_0x5e05c9,_0x23e12d,_0x409444){var _0xaa59a2=utils[_0x9019('0x8')](_0x5e05c9);var _0x586c14=squel[_0x9019('0x25')]();var _0x2b6ae4=_(_0x23e12d)['keys']()[_0x9019('0x18')](function(_0x1c9dd9){return _[_0x9019('0x53')](_0x409444,[_0x9019('0xd'),_0x1c9dd9])?_0x1c9dd9:undefined;})[_0x9019('0x54')]()[_0x9019('0x41')]();if(_0x2b6ae4[_0x9019('0x15')]>0x0){_0x2b6ae4[_0x9019('0x27')](function(_0x5748f8){if(_0x5748f8===_0xaa59a2){_0x586c14['and']('i.'+_0xaa59a2+_0x9019('0x55'),[]['concat'](_0x23e12d[_0x5748f8]));}else if(_0x5748f8===_0x9019('0x56')){var _0x5715e6=JSON[_0x9019('0x57')](_0x23e12d[_0x5748f8])[_0x9019('0x58')];var _0x2f74b4=JSON[_0x9019('0x57')](_0x23e12d[_0x5748f8])['$lte'];_0x586c14['and'](_0x9019('0x59'),_0x5715e6,_0x2f74b4);}else{if(_0x23e12d[_0x5748f8]===_0x9019('0x5a')){_0x586c14[_0x9019('0x45')]('i.'+_0x5748f8+_0x9019('0x5b'));}else{_0x586c14['and']('i.'+_0x5748f8+_0x9019('0x5c'),_0x23e12d[_0x5748f8]);}}});}return _0x586c14;}function parseQueryParameters(_0x41d6bb,_0x4bf2cf,_0x165588){var _0x1b13f0=getSqlClauses();return Promise[_0x9019('0x5d')]()[_0x9019('0x5e')](function(){return parseModelFields(_0x41d6bb,_0x4bf2cf,_0x165588);})[_0x9019('0x5e')](function(_0x1ad190){_0x1b13f0['fields'][_0x9019('0x45')](_0x1ad190);return parseReadParameter(_0x4bf2cf[_0x9019('0x44')]);})[_0x9019('0x5e')](function(_0x291d9f){_0x1b13f0[_0x9019('0x44')]['and'](_0x291d9f);return parseTagParameter(_0x4bf2cf[_0x9019('0x5f')]);})[_0x9019('0x5e')](function(_0x122be4){_0x1b13f0[_0x9019('0x4c')]['clause'][_0x9019('0x45')](_0x122be4);return parseSearchFilter(_0x41d6bb,_0x4bf2cf[_0x9019('0x60')]);})['then'](function(_0x463ef6){_0x1b13f0[_0x9019('0x60')]=_0x463ef6;return _0x1b13f0;});}function checkAccountsRestrictions(_0x1bff98,_0xa1b93d,_0x184e60){var _0x1436d1=utils[_0x9019('0x8')](_0x1bff98);var _0x3548e0=_0x9019('0x61')+_[_0x9019('0x62')](_0x1bff98)+(_0x1bff98===_0x9019('0x63')?'Websites':_0x9019('0x64'));var _0x371765=squel['expr']();return Promise[_0x9019('0x5d')]()['then'](function(){if(_0x184e60[_0x9019('0xa')]&&_0xa1b93d['role']===_0x9019('0x9')){return _0xa1b93d[_0x3548e0]({'attributes':['id'],'raw':!![]});}})[_0x9019('0x5e')](function(_0x43649b){if(_0x43649b){if(_0x43649b[_0x9019('0x15')]===0x0){_0x371765['and']('i.'+_0x1436d1+_0x9019('0x5b'));}else{_0x371765[_0x9019('0x45')]('i.'+_0x1436d1+_0x9019('0x55'),_[_0x9019('0x18')](_0x43649b,'id'));}}else if(!_0x184e60[_0x1436d1]){_0x371765[_0x9019('0x45')]('i.'+_0x1436d1+_0x9019('0x65'));}})[_0x9019('0x5e')](function(){return _0x371765;});}function getClosedOrderClause(_0x2f6fb7,_0x48c4dc){var _0x3bd4be='';var _0x2dda07=['i.thirdDisposition',_0x9019('0x66'),_0x9019('0x67')];if(_0x2f6fb7==='mail'){_0x2dda07[_0x9019('0x68')](_0x9019('0x69'));}if(_0x48c4dc[_0x9019('0x6a')]==='0'&&_0x2f6fb7==='mail'){_0x3bd4be=_0x9019('0x69');}else{if(_0x48c4dc['closed']==='1'){_0x2dda07[_0x9019('0x6b')]();}_0x3bd4be='CONCAT_WS(\x27\x27,\x20'+_0x2dda07[_0x9019('0x6c')](',\x20')+')';}return _0x3bd4be;}function getFilteredInteractions(_0x4db900,_0x55fa67,_0x528588,_0x38ca23){var _0x3a9dc5=utils[_0x9019('0x1a')](_0x4db900);var _0x21bf4c=_[_0x9019('0x62')](_0x4db900)+_0x9019('0x6d');var _0x3cc0f8=[];var _0x447bf2=getTagsQuery();var _0x68151b={'type':db[_0x9019('0x6e')]['QueryTypes'][_0x9019('0x6f')],'raw':!![]};var _0x3af8b8=[];var _0xab27b7=[];return db[_0x9019('0x70')][_0x9019('0x71')](_0x447bf2[_0x9019('0x72')](),_0x68151b)[_0x9019('0x5e')](function(_0x39dc16){_0x3cc0f8=_[_0x9019('0x73')](_0x39dc16,'id');_0x68151b=_[_0x9019('0x74')](_0x68151b,{'model':db[_0x21bf4c],'mapToModel':!![],'nest':!![]});if(_0x528588['fields']){_0x38ca23[_0x9019('0x75')][_0x9019('0x27')](function(_0x398205){_0x55fa67['field']('i.'+_0x398205);});}else{_0x55fa67[_0x9019('0xc')](_0x9019('0x76'),_0x9019('0x43'));_0x55fa67[_0x9019('0xc')]('a.key','Account.key');_0x55fa67[_0x9019('0xc')](_0x9019('0x77'),'Account.mandatoryDisposition');if(_0x4db900==='mail'){_0x55fa67['field'](_0x9019('0x78'),_0x9019('0x79'));_0x55fa67[_0x9019('0xc')](_0x9019('0x7a'),_0x9019('0x7b'));_0x55fa67[_0x9019('0xc')](_0x9019('0x7c'));_0x55fa67[_0x9019('0xc')](_0x9019('0x7d'));_0x55fa67[_0x9019('0xc')]('i.updatedAt');_0x55fa67[_0x9019('0xc')]('i.closed');_0x55fa67[_0x9019('0xc')](_0x9019('0x7e'));_0x55fa67[_0x9019('0xc')]('i.attach');_0x55fa67['field'](_0x9019('0x7f'));_0x55fa67['field'](_0x9019('0x80'));_0x55fa67[_0x9019('0xc')](_0x9019('0x81'));_0x55fa67[_0x9019('0xc')](_0x9019('0x67'));_0x55fa67[_0x9019('0xc')](_0x9019('0x66'));_0x55fa67['field'](_0x9019('0x82'));_0x55fa67['field'](_0x9019('0x69'));_0x55fa67[_0x9019('0xc')](_0x9019('0x83'));_0x55fa67[_0x9019('0xc')](_0x9019('0x84'));_0x55fa67[_0x9019('0xc')](_0x9019('0x85'));_0x55fa67['field']('i.UserId');}else if(_0x4db900===_0x9019('0x86')){_0x55fa67['field'](_0x9019('0x87'),_0x9019('0x7b'));}else{_0x55fa67[_0x9019('0xc')](_0x9019('0x88'),_0x9019('0x7b'));}if(_0x4db900!=='mail'){_0x55fa67[_0x9019('0xc')](_0x9019('0x89'));}_0x55fa67[_0x9019('0xc')](_0x9019('0x8a'),_0x9019('0x8b'));_0x55fa67[_0x9019('0xc')]('c.lastName',_0x9019('0x8c'));_0x55fa67[_0x9019('0xc')]('c.email',_0x9019('0x8d'));_0x55fa67[_0x9019('0xc')](_0x9019('0x8e'),'Contact.phone');_0x55fa67[_0x9019('0xc')](_0x9019('0x8f'),_0x9019('0x90'));_0x55fa67[_0x9019('0xc')](_0x9019('0x91'),_0x9019('0x92'));_0x55fa67[_0x9019('0xc')]('o.fullname',_0x9019('0x93'));_0x55fa67['field']('o.internal',_0x9019('0x94'));_0x55fa67[_0x9019('0xc')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9019('0x95'));}if(_0x38ca23[_0x9019('0x96')]){_0x55fa67[_0x9019('0x96')](_0x38ca23[_0x9019('0x96')]);}if(_0x38ca23[_0x9019('0x97')]){_0x55fa67[_0x9019('0x97')](_0x38ca23[_0x9019('0x97')]);}return db['sequelize']['query'](_0x55fa67['toString'](),_0x68151b);})[_0x9019('0x5e')](function(_0x4c2d4d){_0x3af8b8=_0x4c2d4d;var _0x18340f=getUsersQuery(_0x4db900,_0x3af8b8);return db[_0x9019('0x70')][_0x9019('0x71')](_0x18340f[_0x9019('0x72')](),_0x68151b);})[_0x9019('0x5e')](function(_0x3e6b67){_0xab27b7=_[_0x9019('0x98')](_0x3e6b67,_0x3a9dc5);if(_0x4db900===_0x9019('0x33')){return db[_0x9019('0x99')][_0x9019('0x9a')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x9019('0x5e')](function(_0x52525c){var _0x36a930=_0x52525c?_0x52525c['enableEmailPreview']:undefined;var _0x3a133a=_0x3af8b8[_0x9019('0x18')](function(_0x2637a0){return updateInteraction(_0x2637a0,_0x3cc0f8,_0xab27b7,_0x36a930);});return Promise[_0x9019('0x9b')](_0x3a133a);});}function countFilteredInteractions(_0x492093,_0x1e133e){var _0x5ab0dd=_0x492093['clone']();_0x5ab0dd['field'](_0x9019('0x9c'));_0x5ab0dd[_0x9019('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9019('0x43'));var _0x5a029a=utils[_0x9019('0x26')](_0x1e133e);if(!_['isEmpty'](_0x5a029a)){_0x5ab0dd[_0x9019('0x16')](_0x9019('0x9d'),_0x5a029a);}var _0x3711cf={'type':db[_0x9019('0x6e')][_0x9019('0x9e')][_0x9019('0x6f')],'raw':!![]};return db[_0x9019('0x70')][_0x9019('0x71')](_0x5ab0dd[_0x9019('0x72')](),_0x3711cf);}module[_0x9019('0x9f')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 40ed74c..4e2d743 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e27=['UserId','answered','unmanaged','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','abandoned','total','closed'];(function(_0x88edb2,_0x4574e8){var _0x5d3c69=function(_0x1f0023){while(--_0x1f0023){_0x88edb2['push'](_0x88edb2['shift']());}};_0x5d3c69(++_0x4574e8);}(_0x8e27,0xb1));var _0x78e2=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x8e27[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x78e2('0x0'));var db=require(_0x78e2('0x1'))['db'];function getInteractionUsers(_0x4e0ec1,_0x2b6532){return new Promise(function(_0x2ccb23,_0x55fe8a){try{var _0x1d2fbc=[];if(_0x2b6532[_0x4e0ec1]){_0x1d2fbc=_0x2b6532[_0x4e0ec1][_0x78e2('0x2')](function(_0x540aba){return{'id':_0x540aba['id'],'fullname':_0x540aba[_0x78e2('0x3')]};});}return _0x2ccb23(_0x1d2fbc);}catch(_0x3437a0){_0x55fe8a(_0x3437a0);}});}function getInteractionTags(_0x4316f6,_0xebbf4d){var _0x3a4d67=[];if(_0x4316f6){_0x4316f6[_0x78e2('0x4')](',')[_0x78e2('0x5')](function(_0x114b8d){_0x3a4d67[_0x78e2('0x6')](_0xebbf4d[_0x114b8d]);});}return _0x3a4d67;}function updateWaitingCounter(_0x196542){if(_0x196542[_0x78e2('0x7')]){_0x196542['waiting']-=0x1;}}function updateInteractionCounters(_0x1f5039){_0x1f5039[_0x78e2('0x7')]=0x0;_0x1f5039[_0x78e2('0x8')]=0x0;_0x1f5039['answered']=0x0;_0x1f5039['unmanaged']=0x0;_0x1f5039[_0x78e2('0x9')]=0x0;_0x1f5039[_0x78e2('0xa')]=0x0;if(_0x1f5039[_0x78e2('0xb')]){if(_0x1f5039['disposition']==='abandoned'){_0x1f5039['abandoned']+=0x1;updateWaitingCounter(_0x1f5039);}if(_0x1f5039[_0x78e2('0xc')]){_0x1f5039[_0x78e2('0xd')]+=0x1;if(_0x1f5039[_0x78e2('0x8')]){_0x1f5039[_0x78e2('0x8')]-=0x1;}}else{if(_0x1f5039['disposition']){_0x1f5039[_0x78e2('0xe')]+=0x1;updateWaitingCounter(_0x1f5039);}}}else{if(!_0x1f5039[_0x78e2('0xc')]){_0x1f5039['waiting']+=0x1;}if(_0x1f5039[_0x78e2('0xc')]){_0x1f5039[_0x78e2('0x8')]+=0x1;updateWaitingCounter(_0x1f5039);}}_0x1f5039[_0x78e2('0xa')]+=0x1;return _0x1f5039;}function getLastMessageText(_0x5d72d6){return db[_0x78e2('0xf')][_0x78e2('0x10')]({'where':{'$and':[{'MailInteractionId':_0x5d72d6['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x78e2('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x78e2('0x12')],'order':_0x78e2('0x13'),'raw':!![]})[_0x78e2('0x14')](function(_0x47368d){if(_0x47368d&&_0x47368d['plainBody']){_0x5d72d6[_0x78e2('0x15')]=_[_0x78e2('0x16')](_0x47368d['plainBody']);}return _0x5d72d6;})[_0x78e2('0x17')](function(_0x4b5ec0){throw _0x4b5ec0;});}exports[_0x78e2('0x18')]=function(_0x24620e,_0x4ab351,_0x27128f,_0x30c1b6){return new Promise(function(_0x339250,_0x515a35){return getInteractionUsers(_0x24620e['id'],_0x27128f)[_0x78e2('0x14')](function(_0x2075b7){_0x24620e[_0x78e2('0x19')]=_0x2075b7;return getInteractionTags(_0x24620e[_0x78e2('0x1a')],_0x4ab351);})[_0x78e2('0x14')](function(_0x4fd6d4){_0x24620e['Tags']=_0x4fd6d4;delete _0x24620e[_0x78e2('0x1a')];return updateInteractionCounters(_0x24620e);})[_0x78e2('0x14')](function(_0x471b47){if(_0x30c1b6){return getLastMessageText(_0x471b47);}else{return _0x471b47;}})[_0x78e2('0x14')](function(_0x5c7237){_0x339250(_0x5c7237);})['catch'](function(_0x319a67){_0x515a35(_0x319a67);});});}; \ No newline at end of file +var _0x46d8=['disposition','UserId','talking','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','TagIds','lodash','../../mysqldb','map','fullname','split','push','waiting','answered','unmanaged','abandoned','total','closed'];(function(_0xa9b067,_0x2047eb){var _0x492156=function(_0x32a056){while(--_0x32a056){_0xa9b067['push'](_0xa9b067['shift']());}};_0x492156(++_0x2047eb);}(_0x46d8,0xee));var _0x846d=function(_0x51472d,_0x592b0b){_0x51472d=_0x51472d-0x0;var _0x5f00f1=_0x46d8[_0x51472d];return _0x5f00f1;};'use strict';var _=require(_0x846d('0x0'));var db=require(_0x846d('0x1'))['db'];function getInteractionUsers(_0x5f1e78,_0x355c52){return new Promise(function(_0x2db092,_0x24d9a6){try{var _0x1aacc8=[];if(_0x355c52[_0x5f1e78]){_0x1aacc8=_0x355c52[_0x5f1e78][_0x846d('0x2')](function(_0x56a8df){return{'id':_0x56a8df['id'],'fullname':_0x56a8df[_0x846d('0x3')]};});}return _0x2db092(_0x1aacc8);}catch(_0x12048c){_0x24d9a6(_0x12048c);}});}function getInteractionTags(_0x3161a1,_0x23b7d0){var _0x27767f=[];if(_0x3161a1){_0x3161a1[_0x846d('0x4')](',')['forEach'](function(_0x408eec){_0x27767f[_0x846d('0x5')](_0x23b7d0[_0x408eec]);});}return _0x27767f;}function updateWaitingCounter(_0x401694){if(_0x401694['waiting']){_0x401694[_0x846d('0x6')]-=0x1;}}function updateInteractionCounters(_0x3fb4c8){_0x3fb4c8['waiting']=0x0;_0x3fb4c8['talking']=0x0;_0x3fb4c8[_0x846d('0x7')]=0x0;_0x3fb4c8[_0x846d('0x8')]=0x0;_0x3fb4c8[_0x846d('0x9')]=0x0;_0x3fb4c8[_0x846d('0xa')]=0x0;if(_0x3fb4c8[_0x846d('0xb')]){if(_0x3fb4c8[_0x846d('0xc')]==='abandoned'){_0x3fb4c8[_0x846d('0x9')]+=0x1;updateWaitingCounter(_0x3fb4c8);}if(_0x3fb4c8[_0x846d('0xd')]){_0x3fb4c8[_0x846d('0x7')]+=0x1;if(_0x3fb4c8['talking']){_0x3fb4c8[_0x846d('0xe')]-=0x1;}}else{if(_0x3fb4c8['disposition']){_0x3fb4c8[_0x846d('0x8')]+=0x1;updateWaitingCounter(_0x3fb4c8);}}}else{if(!_0x3fb4c8[_0x846d('0xd')]){_0x3fb4c8[_0x846d('0x6')]+=0x1;}if(_0x3fb4c8['UserId']){_0x3fb4c8[_0x846d('0xe')]+=0x1;updateWaitingCounter(_0x3fb4c8);}}_0x3fb4c8['total']+=0x1;return _0x3fb4c8;}function getLastMessageText(_0x50a387){return db[_0x846d('0xf')][_0x846d('0x10')]({'where':{'$and':[{'MailInteractionId':_0x50a387['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x846d('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x846d('0x12')],'order':_0x846d('0x13'),'raw':!![]})[_0x846d('0x14')](function(_0x1213a4){if(_0x1213a4&&_0x1213a4[_0x846d('0x12')]){_0x50a387[_0x846d('0x15')]=_[_0x846d('0x16')](_0x1213a4[_0x846d('0x12')]);}return _0x50a387;})[_0x846d('0x17')](function(_0x5a55c6){throw _0x5a55c6;});}exports['updateInteraction']=function(_0x388c14,_0x46a80f,_0x30bd84,_0x4c8190){return new Promise(function(_0x4454e2,_0x1d0e82){return getInteractionUsers(_0x388c14['id'],_0x30bd84)['then'](function(_0x5687a4){_0x388c14['Users']=_0x5687a4;return getInteractionTags(_0x388c14[_0x846d('0x18')],_0x46a80f);})[_0x846d('0x14')](function(_0x390cc7){_0x388c14['Tags']=_0x390cc7;delete _0x388c14[_0x846d('0x18')];return updateInteractionCounters(_0x388c14);})[_0x846d('0x14')](function(_0x35a218){if(_0x4c8190){return getLastMessageText(_0x35a218);}else{return _0x35a218;}})[_0x846d('0x14')](function(_0x5746b9){_0x4454e2(_0x5746b9);})[_0x846d('0x17')](function(_0x12807e){_0x1d0e82(_0x12807e);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 8049d3d..18ca75e 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8b3=['_interaction_has_tags','_messages','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','Interaction','then','info','catch','error','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','accounts','_interactions'];(function(_0x3e15ee,_0x2ebf1a){var _0xe15522=function(_0x461333){while(--_0x461333){_0x3e15ee['push'](_0x3e15ee['shift']());}};_0xe15522(++_0x2ebf1a);}(_0xc8b3,0x1b1));var _0x3c8b=function(_0x4aaaef,_0x4cd2d0){_0x4aaaef=_0x4aaaef-0x0;var _0xbe59a=_0xc8b3[_0x4aaaef];return _0xbe59a;};'use strict';var _=require(_0x3c8b('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x3c8b('0x1'))(_0x3c8b('0x2')),'mail':require(_0x3c8b('0x1'))(_0x3c8b('0x3')),'fax':require(_0x3c8b('0x1'))(_0x3c8b('0x4')),'sms':require(_0x3c8b('0x1'))('sms-interactions'),'chat':require(_0x3c8b('0x1'))(_0x3c8b('0x5')),'whatsapp':require(_0x3c8b('0x1'))(_0x3c8b('0x6'))};function getAccountFK(_0x223392){return _[_0x3c8b('0x7')](_0x223392)+(_0x223392==='chat'?_0x3c8b('0x8'):_0x3c8b('0x9'))+'Id';}function getInteractionFK(_0x22c785){return _[_0x3c8b('0x7')](_0x22c785)+_0x3c8b('0xa');}function getInteractionId(_0x218ef9,_0x557168,_0x26b27f){if(_0x218ef9&&_0x218ef9[_[_0x3c8b('0xb')](_0x26b27f)+_0x3c8b('0xa')]){return _0x218ef9[_[_0x3c8b('0xb')](_0x26b27f)+_0x3c8b('0xa')];}else if(_0x218ef9&&_0x218ef9['id']){return _0x218ef9['id'];}else if(_0x557168&&_0x557168['id']){return _0x557168['id'];}else{return _0x3c8b('0xc');}}function getInteractionsTables(_0x4d291c){return{'accounts':_0x4d291c+'_'+(_0x4d291c===_0x3c8b('0xd')?_0x3c8b('0xe'):_0x3c8b('0xf')),'interactions':_0x4d291c+_0x3c8b('0x10'),'interactionsTags':_0x4d291c+_0x3c8b('0x11'),'messages':_0x4d291c+_0x3c8b('0x12'),'userInteractions':_0x3c8b('0x13')+_0x4d291c+_0x3c8b('0x10')};}function getSelectedTags(_0x2f0d8b){var _0x2ba1d7=[];if(_0x2f0d8b){_0x2ba1d7=Array['isArray'](_0x2f0d8b)?_0x2f0d8b:[_0x2f0d8b];}return _0x2ba1d7;}function log(_0x5b3e4f,_0x335e8b,_0x541a1e,_0x555b8d,_0x1892e5,_0x5dc75c){loggers[_0x1892e5['toLowerCase']()][_0x5b3e4f](_0x3c8b('0x14'),_0x5dc75c[_0x3c8b('0x15')](),_0x335e8b?_0x335e8b['id']:null,_0x335e8b?_0x335e8b['name']:null,_0x335e8b?_0x335e8b[_0x3c8b('0x16')]:null,getInteractionId(_0x541a1e,_0x555b8d,_0x1892e5),_0x541a1e?JSON[_0x3c8b('0x17')](_0x541a1e):'null');}function updateUser(_0x1ad8f7,_0xda2b80,_0x321274,_0x4b2cbe,_0x3d940f){db[_[_0x3c8b('0xb')](_0x4b2cbe)+_0x3c8b('0x18')]['findOne']({'where':{'id':getInteractionId(_0xda2b80,_0x321274,_0x4b2cbe)}})[_0x3c8b('0x19')](function(_0x5daece){if(_0x5daece){return _0x5daece['update']({'UserId':_0x1ad8f7?_0x1ad8f7['id']:null});}})[_0x3c8b('0x19')](function(_0x56a5e5){if(_0x56a5e5){log(_0x3c8b('0x1a'),_0x1ad8f7,_0xda2b80,_0x321274,_0x4b2cbe,_0x3d940f);}})[_0x3c8b('0x1b')](function(){log(_0x3c8b('0x1c'),_0x1ad8f7,_0xda2b80,_0x321274,_0x4b2cbe,_0x3d940f);});}module[_0x3c8b('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x2ae1=['isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','Interaction','findOne','then','update','info','catch','exports','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','_interactions'];(function(_0x2bd104,_0xa585f2){var _0x223e88=function(_0x10b7d9){while(--_0x10b7d9){_0x2bd104['push'](_0x2bd104['shift']());}};_0x223e88(++_0xa585f2);}(_0x2ae1,0x138));var _0x12ae=function(_0xf90e07,_0x133b5c){_0xf90e07=_0xf90e07-0x0;var _0x4376bd=_0x2ae1[_0xf90e07];return _0x4376bd;};'use strict';var _=require('lodash');var db=require(_0x12ae('0x0'))['db'];var loggers={'openchannel':require(_0x12ae('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x12ae('0x2')),'fax':require(_0x12ae('0x1'))('fax-interactions'),'sms':require(_0x12ae('0x1'))(_0x12ae('0x3')),'chat':require(_0x12ae('0x1'))(_0x12ae('0x4')),'whatsapp':require(_0x12ae('0x1'))(_0x12ae('0x5'))};function getAccountFK(_0x43661f){return _[_0x12ae('0x6')](_0x43661f)+(_0x43661f===_0x12ae('0x7')?_0x12ae('0x8'):_0x12ae('0x9'))+'Id';}function getInteractionFK(_0xe6c322){return _['capitalize'](_0xe6c322)+_0x12ae('0xa');}function getInteractionId(_0x515441,_0x4fe021,_0xbb95){if(_0x515441&&_0x515441[_[_0x12ae('0xb')](_0xbb95)+'InteractionId']){return _0x515441[_[_0x12ae('0xb')](_0xbb95)+_0x12ae('0xa')];}else if(_0x515441&&_0x515441['id']){return _0x515441['id'];}else if(_0x4fe021&&_0x4fe021['id']){return _0x4fe021['id'];}else{return _0x12ae('0xc');}}function getInteractionsTables(_0x3b7264){return{'accounts':_0x3b7264+'_'+(_0x3b7264===_0x12ae('0x7')?_0x12ae('0xd'):_0x12ae('0xe')),'interactions':_0x3b7264+'_interactions','interactionsTags':_0x3b7264+_0x12ae('0xf'),'messages':_0x3b7264+_0x12ae('0x10'),'userInteractions':'user_has_'+_0x3b7264+_0x12ae('0x11')};}function getSelectedTags(_0x2055d4){var _0x595875=[];if(_0x2055d4){_0x595875=Array[_0x12ae('0x12')](_0x2055d4)?_0x2055d4:[_0x2055d4];}return _0x595875;}function log(_0x18449a,_0x143bfe,_0x2575c4,_0x5abc5d,_0x5483c9,_0x2123b9){loggers[_0x5483c9[_0x12ae('0x13')]()][_0x18449a](_0x12ae('0x14'),_0x2123b9['toUpperCase'](),_0x143bfe?_0x143bfe['id']:null,_0x143bfe?_0x143bfe['name']:null,_0x143bfe?_0x143bfe['role']:null,getInteractionId(_0x2575c4,_0x5abc5d,_0x5483c9),_0x2575c4?JSON[_0x12ae('0x15')](_0x2575c4):_0x12ae('0x16'));}function updateUser(_0xe40dd7,_0x4f6806,_0x59ad47,_0x1ae555,_0x3b5c78){db[_[_0x12ae('0xb')](_0x1ae555)+_0x12ae('0x17')][_0x12ae('0x18')]({'where':{'id':getInteractionId(_0x4f6806,_0x59ad47,_0x1ae555)}})[_0x12ae('0x19')](function(_0xe59494){if(_0xe59494){return _0xe59494[_0x12ae('0x1a')]({'UserId':_0xe40dd7?_0xe40dd7['id']:null});}})[_0x12ae('0x19')](function(_0x16eb10){if(_0x16eb10){log(_0x12ae('0x1b'),_0xe40dd7,_0x4f6806,_0x59ad47,_0x1ae555,_0x3b5c78);}})[_0x12ae('0x1c')](function(){log('error',_0xe40dd7,_0x4f6806,_0x59ad47,_0x1ae555,_0x3b5c78);});}module[_0x12ae('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 9c0afe0..545447f 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 _0xa2e0=['../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','composable-middleware'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xa2e0,0x1e4));var _0x0a2e=function(_0x3e9e5d,_0x64cedc){_0x3e9e5d=_0x3e9e5d-0x0;var _0x14b6c0=_0xa2e0[_0x3e9e5d];return _0x14b6c0;};'use strict';var crypto=require(_0x0a2e('0x0'));var util=require('util');var compose=require(_0x0a2e('0x1'));var db=require(_0x0a2e('0x2'))['db'];var config=require(_0x0a2e('0x3'));function getValueFromLicense(_0x1386cc,_0xca3657){if(_0x1386cc&&_0xca3657){if(_0xca3657[_0x0a2e('0x4')]&&_0xca3657[_0x0a2e('0x5')]){var _0x5a39a6=_0xca3657[_0x0a2e('0x4')];var _0x4a712f=_0xca3657[_0x0a2e('0x5')];var _0x4e14a4=_0x5a39a6['split']('-')[0x4];var _0x123f5a=_0x5a39a6[_0x0a2e('0x6')]('-')[0x0];var _0x20f934=crypto[_0x0a2e('0x7')](_0x0a2e('0x8'),util[_0x0a2e('0x9')](_0x0a2e('0xa'),_0x4e14a4,_0x5a39a6,_0x123f5a));var _0x3de42b=_0x20f934[_0x0a2e('0xb')](_0x4a712f,'base64',_0x0a2e('0xc'));_0x3de42b+=_0x20f934[_0x0a2e('0xd')](_0x0a2e('0xc'));var _0x2adbc4=JSON[_0x0a2e('0xe')](_0x3de42b);return _0x2adbc4[_0x0a2e('0xf')](_0x1386cc)?_0x2adbc4[_0x1386cc]:null;}}return null;}function isLimit(_0x58a6a9,_0x134aba,_0xf9c733,_0x4a095d){var _0x45be9b=_0x134aba;return compose()[_0x0a2e('0x10')](function(_0x484ea6,_0x3a6619,_0x51ee34){return db[_0x0a2e('0x11')][_0x0a2e('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x0a2e('0x13')](function(_0x1b0cd7){var _0x1a5ed1=getValueFromLicense(_0x58a6a9,_0x1b0cd7);return _0x1a5ed1?_0x1a5ed1:_0x45be9b;})[_0x0a2e('0x13')](function(_0x2b1ed8){_0x45be9b=_0x2b1ed8;return _0xf9c733['count'](_0x4a095d);})['then'](function(_0x473326){if(_0x473326>=_0x45be9b){return _0x3a6619[_0x0a2e('0x14')](0x193)['json']({'message':util[_0x0a2e('0x9')](_0x0a2e('0x15'),_0x58a6a9)});}_0x51ee34();})[_0x0a2e('0x16')](function(_0xf58d){_0x51ee34(_0xf58d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0a2e('0x17')],{'where':{'$or':[{'role':_0x0a2e('0x18')},{'role':_0x0a2e('0x19')}]}});}exports[_0x0a2e('0x1a')]=isUserLimit; \ No newline at end of file +var _0x80f5=['util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto'];(function(_0x2a8999,_0x54ad7d){var _0x800974=function(_0x477e42){while(--_0x477e42){_0x2a8999['push'](_0x2a8999['shift']());}};_0x800974(++_0x54ad7d);}(_0x80f5,0x95));var _0x580f=function(_0x2064c8,_0x168039){_0x2064c8=_0x2064c8-0x0;var _0x23af73=_0x80f5[_0x2064c8];return _0x23af73;};'use strict';var crypto=require(_0x580f('0x0'));var util=require(_0x580f('0x1'));var compose=require(_0x580f('0x2'));var db=require(_0x580f('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x469475,_0x111e7f){if(_0x469475&&_0x111e7f){if(_0x111e7f[_0x580f('0x4')]&&_0x111e7f[_0x580f('0x5')]){var _0x5b02ec=_0x111e7f[_0x580f('0x4')];var _0x45e5b9=_0x111e7f[_0x580f('0x5')];var _0x18eb26=_0x5b02ec[_0x580f('0x6')]('-')[0x4];var _0x3b4df2=_0x5b02ec['split']('-')[0x0];var _0x319d2=crypto[_0x580f('0x7')](_0x580f('0x8'),util[_0x580f('0x9')](_0x580f('0xa'),_0x18eb26,_0x5b02ec,_0x3b4df2));var _0x3379e5=_0x319d2[_0x580f('0xb')](_0x45e5b9,_0x580f('0xc'),_0x580f('0xd'));_0x3379e5+=_0x319d2['final'](_0x580f('0xd'));var _0x3880c4=JSON[_0x580f('0xe')](_0x3379e5);return _0x3880c4['hasOwnProperty'](_0x469475)?_0x3880c4[_0x469475]:null;}}return null;}function isLimit(_0x1b7811,_0x18c95c,_0x5c51f3,_0x17bc4f){var _0x29367c=_0x18c95c;return compose()['use'](function(_0x1e664a,_0x3977d1,_0xeef296){return db[_0x580f('0xf')][_0x580f('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1af93f){var _0x3f8773=getValueFromLicense(_0x1b7811,_0x1af93f);return _0x3f8773?_0x3f8773:_0x29367c;})[_0x580f('0x11')](function(_0x357096){_0x29367c=_0x357096;return _0x5c51f3[_0x580f('0x12')](_0x17bc4f);})['then'](function(_0x164540){if(_0x164540>=_0x29367c){return _0x3977d1[_0x580f('0x13')](0x193)['json']({'message':util[_0x580f('0x9')](_0x580f('0x14'),_0x1b7811)});}_0xeef296();})['catch'](function(_0x547e2e){_0xeef296(_0x547e2e);});});}function isUserLimit(){return isLimit(_0x580f('0x15'),0x1,db[_0x580f('0x16')],{'where':{'$or':[{'role':_0x580f('0x17')},{'role':'user'}]}});}exports[_0x580f('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 2a61962..c33d6dc 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 _0x0ff9=['CAST(','field','castTo','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gte','>=\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','format','text'];(function(_0x15dbe8,_0x23a090){var _0x1158a2=function(_0x20d61a){while(--_0x20d61a){_0x15dbe8['push'](_0x15dbe8['shift']());}};_0x1158a2(++_0x23a090);}(_0x0ff9,0x126));var _0x90ff=function(_0x5ae834,_0x409bb4){_0x5ae834=_0x5ae834-0x0;var _0x50e0f0=_0x0ff9[_0x5ae834];return _0x50e0f0;};'use strict';var _=require(_0x90ff('0x0'));var moment=require(_0x90ff('0x1'));exports[_0x90ff('0x2')]=function(_0x568947){var _0x49b082={'conditions':[]};_0x49b082[_0x90ff('0x3')]=_[_0x90ff('0x4')](_0x568947,_0x90ff('0x5'))?'or':_0x90ff('0x6');var _0x51942b=_0x568947[_0x90ff('0x7')](_0x90ff('0x8'),'')[_0x90ff('0x7')](_0x90ff('0x5'),'')[_0x90ff('0x9')]('||');for(var _0x24b242=0x0;_0x24b242<_0x51942b[_0x90ff('0xa')];_0x24b242++){var _0x10a59b=_0x51942b[_0x24b242]['split'](':=');var _0x28ae0f=_0x10a59b[0x0];var _0x25e302=_0x10a59b[_0x90ff('0xb')](0x1);_0x25e302[_0x90ff('0xc')](function(_0xd5cd3d){var _0x53ba2c=_0xd5cd3d[_0x90ff('0x9')]('[')[_0x90ff('0xd')]();var _0x11bf7e=_0xd5cd3d[_0x90ff('0xe')](/\[(.*?)\]/g);_0x11bf7e[_0x90ff('0xc')](function(_0x420f48){var _0x219b64=_0x420f48[_0x90ff('0x9')]('[')[_0x90ff('0xf')](function(_0xea40a8){return _0xea40a8[_0x90ff('0x10')](']')>-0x1;})[_0x90ff('0x11')](function(_0x29fc75){return _0x29fc75['split'](']')[0x0];})[0x0];_0x49b082['conditions']['push']({'field':_0x28ae0f,'operator':_0x53ba2c,'value':_0x219b64});});});}return _0x49b082;};exports[_0x90ff('0x12')]=function(_0x10a0ab,_0x5d883f,_0x394c05){var _0x23a725={};if(_0x5d883f===_0x90ff('0x13')){if(_0x394c05[_0x90ff('0x14')]===_0x90ff('0x15')){_0x394c05[_0x90ff('0x14')]=_0x90ff('0x16');_0x394c05[_0x90ff('0x17')]+=','+_0x394c05[_0x90ff('0x17')];}else if(_[_0x90ff('0x18')]([_0x90ff('0x19'),'$lte'],_0x394c05[_0x90ff('0x14')])){_0x394c05[_0x90ff('0x17')]=moment(_0x394c05[_0x90ff('0x17')])[_0x90ff('0x1a')](0x1,_0x90ff('0x1b'))[_0x90ff('0x1c')]('YYYY-MM-DD');}}if(_0x394c05['castTo']){_0x5d883f=_0x394c05['castTo'];_0x23a725[_0x90ff('0x1d')]=_0x90ff('0x1e')+_0x10a0ab+'.'+_0x394c05[_0x90ff('0x1f')]+'\x20AS\x20'+_0x394c05[_0x90ff('0x20')]+')\x20'+parseOperator(_0x394c05['operator']);}else{_0x23a725[_0x90ff('0x1d')]=_0x10a0ab+'.'+_0x394c05[_0x90ff('0x1f')]+'\x20'+parseOperator(_0x394c05[_0x90ff('0x14')]);}if(_['includes']([_0x90ff('0x21'),_0x90ff('0x22')],_0x394c05[_0x90ff('0x14')]))_0x23a725[_0x90ff('0x1d')]='('+_0x23a725[_0x90ff('0x1d')]+_0x90ff('0x23')+_0x10a0ab+'.'+_0x394c05[_0x90ff('0x1f')]+'\x20IS\x20NULL)';_0x23a725['value']=parseValue(_0x5d883f,_0x394c05['operator'],_0x394c05[_0x90ff('0x17')]);return _0x23a725;};function parseOperator(_0x36a484){var _0x4aa3d5;switch(_0x36a484){case'$in':_0x4aa3d5=_0x90ff('0x24');break;case _0x90ff('0x22'):_0x4aa3d5=_0x90ff('0x25');break;case _0x90ff('0x15'):_0x4aa3d5=_0x90ff('0x26');break;case'$ne':_0x4aa3d5=_0x90ff('0x27');break;case _0x90ff('0x28'):case _0x90ff('0x29'):case _0x90ff('0x2a'):_0x4aa3d5=_0x90ff('0x2b');break;case _0x90ff('0x2c'):_0x4aa3d5=_0x90ff('0x2d');break;case'$gt':_0x4aa3d5='>\x20?';break;case'$lte':_0x4aa3d5='<=\x20?';break;case _0x90ff('0x2e'):_0x4aa3d5=_0x90ff('0x2f');break;case _0x90ff('0x16'):_0x4aa3d5='BETWEEN\x20?\x20AND\x20?';break;}return _0x4aa3d5;}function parseValue(_0x4f6110,_0x53758f,_0x24facc){var _0x1ab740={'start':undefined,'end':undefined};switch(_0x53758f){case'$in':case _0x90ff('0x22'):_0x1ab740[_0x90ff('0x30')]=_0x24facc[_0x90ff('0x9')](',');break;case _0x90ff('0x28'):_0x1ab740[_0x90ff('0x30')]='%'+_0x24facc+'%';break;case _0x90ff('0x29'):_0x1ab740[_0x90ff('0x30')]=_0x24facc+'%';break;case _0x90ff('0x2a'):_0x1ab740[_0x90ff('0x30')]='%'+_0x24facc;break;case _0x90ff('0x16'):var _0x376e0f=_0x24facc['split'](',');var _0x24facc=_0x376e0f[_0x90ff('0xd')]();var _0x3b3123=_0x376e0f[_0x90ff('0x31')]();if(_0x4f6110===_0x90ff('0x13')){_0x24facc=moment(_0x24facc)[_0x90ff('0x32')](0x0,!![])[_0x90ff('0x1c')]();_0x3b3123=moment(_0x3b3123)[_0x90ff('0x32')](0x0,!![])[_0x90ff('0x1a')](0x17,_0x90ff('0x33'))[_0x90ff('0x1a')](0x3b,_0x90ff('0x34'))[_0x90ff('0x1a')](0x3b,_0x90ff('0x35'))[_0x90ff('0x1c')]();}_0x1ab740={'start':_0x24facc,'end':_0x3b3123};break;default:_0x1ab740['start']=_0x24facc;break;}return _0x1ab740;} \ No newline at end of file +var _0x4105=['split','slice','forEach','match','filter','indexOf','map','conditions','buildExpression','DATE','$eq','value','includes','$gt','$lte','operator','add','days','format','castTo','CAST(','\x20AS\x20','text','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','shift','pop','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','and','[$and]','replace'];(function(_0x1cb27a,_0x3d24cd){var _0x2fefe6=function(_0x4f5b11){while(--_0x4f5b11){_0x1cb27a['push'](_0x1cb27a['shift']());}};_0x2fefe6(++_0x3d24cd);}(_0x4105,0x9b));var _0x5410=function(_0xb4e458,_0x57952c){_0xb4e458=_0xb4e458-0x0;var _0x57b35e=_0x4105[_0xb4e458];return _0x57b35e;};'use strict';var _=require(_0x5410('0x0'));var moment=require('moment');exports[_0x5410('0x1')]=function(_0x5ee771){var _0x56657c={'conditions':[]};_0x56657c[_0x5410('0x2')]=_['startsWith'](_0x5ee771,_0x5410('0x3'))?'or':_0x5410('0x4');var _0x48af13=_0x5ee771['replace'](_0x5410('0x5'),'')[_0x5410('0x6')](_0x5410('0x3'),'')[_0x5410('0x7')]('||');for(var _0x4211b0=0x0;_0x4211b0<_0x48af13['length'];_0x4211b0++){var _0x3b0321=_0x48af13[_0x4211b0][_0x5410('0x7')](':=');var _0x5cf655=_0x3b0321[0x0];var _0x299764=_0x3b0321[_0x5410('0x8')](0x1);_0x299764[_0x5410('0x9')](function(_0x56a6e5){var _0x3cfc90=_0x56a6e5[_0x5410('0x7')]('[')['shift']();var _0x7fb829=_0x56a6e5[_0x5410('0xa')](/\[(.*?)\]/g);_0x7fb829[_0x5410('0x9')](function(_0x28a61a){var _0xc75387=_0x28a61a['split']('[')[_0x5410('0xb')](function(_0x413f02){return _0x413f02[_0x5410('0xc')](']')>-0x1;})[_0x5410('0xd')](function(_0x5bc335){return _0x5bc335[_0x5410('0x7')](']')[0x0];})[0x0];_0x56657c[_0x5410('0xe')]['push']({'field':_0x5cf655,'operator':_0x3cfc90,'value':_0xc75387});});});}return _0x56657c;};exports[_0x5410('0xf')]=function(_0x467231,_0x1b178a,_0x37db00){var _0xb63177={};if(_0x1b178a===_0x5410('0x10')){if(_0x37db00['operator']===_0x5410('0x11')){_0x37db00['operator']='$between';_0x37db00['value']+=','+_0x37db00[_0x5410('0x12')];}else if(_[_0x5410('0x13')]([_0x5410('0x14'),_0x5410('0x15')],_0x37db00[_0x5410('0x16')])){_0x37db00[_0x5410('0x12')]=moment(_0x37db00[_0x5410('0x12')])[_0x5410('0x17')](0x1,_0x5410('0x18'))[_0x5410('0x19')]('YYYY-MM-DD');}}if(_0x37db00['castTo']){_0x1b178a=_0x37db00[_0x5410('0x1a')];_0xb63177['text']=_0x5410('0x1b')+_0x467231+'.'+_0x37db00['field']+_0x5410('0x1c')+_0x37db00[_0x5410('0x1a')]+')\x20'+parseOperator(_0x37db00[_0x5410('0x16')]);}else{_0xb63177[_0x5410('0x1d')]=_0x467231+'.'+_0x37db00[_0x5410('0x1e')]+'\x20'+parseOperator(_0x37db00[_0x5410('0x16')]);}if(_['includes']([_0x5410('0x1f'),_0x5410('0x20')],_0x37db00[_0x5410('0x16')]))_0xb63177[_0x5410('0x1d')]='('+_0xb63177[_0x5410('0x1d')]+_0x5410('0x21')+_0x467231+'.'+_0x37db00[_0x5410('0x1e')]+_0x5410('0x22');_0xb63177[_0x5410('0x12')]=parseValue(_0x1b178a,_0x37db00['operator'],_0x37db00[_0x5410('0x12')]);return _0xb63177;};function parseOperator(_0x107eb0){var _0x4ab42e;switch(_0x107eb0){case'$in':_0x4ab42e=_0x5410('0x23');break;case _0x5410('0x20'):_0x4ab42e=_0x5410('0x24');break;case _0x5410('0x11'):_0x4ab42e=_0x5410('0x25');break;case _0x5410('0x1f'):_0x4ab42e=_0x5410('0x26');break;case _0x5410('0x27'):case _0x5410('0x28'):case _0x5410('0x29'):_0x4ab42e=_0x5410('0x2a');break;case _0x5410('0x2b'):_0x4ab42e='<\x20?';break;case _0x5410('0x14'):_0x4ab42e=_0x5410('0x2c');break;case _0x5410('0x15'):_0x4ab42e='<=\x20?';break;case'$gte':_0x4ab42e='>=\x20?';break;case _0x5410('0x2d'):_0x4ab42e=_0x5410('0x2e');break;}return _0x4ab42e;}function parseValue(_0x39d71e,_0x402d17,_0x24166c){var _0x1932d5={'start':undefined,'end':undefined};switch(_0x402d17){case _0x5410('0x2f'):case'$notIn':_0x1932d5[_0x5410('0x30')]=_0x24166c[_0x5410('0x7')](',');break;case _0x5410('0x27'):_0x1932d5['start']='%'+_0x24166c+'%';break;case'$startsWith':_0x1932d5[_0x5410('0x30')]=_0x24166c+'%';break;case _0x5410('0x29'):_0x1932d5[_0x5410('0x30')]='%'+_0x24166c;break;case _0x5410('0x2d'):var _0x46d950=_0x24166c[_0x5410('0x7')](',');var _0x24166c=_0x46d950[_0x5410('0x31')]();var _0x177572=_0x46d950[_0x5410('0x32')]();if(_0x39d71e==='DATE'){_0x24166c=moment(_0x24166c)[_0x5410('0x33')](0x0,!![])[_0x5410('0x19')]();_0x177572=moment(_0x177572)[_0x5410('0x33')](0x0,!![])[_0x5410('0x17')](0x17,'hours')[_0x5410('0x17')](0x3b,_0x5410('0x34'))[_0x5410('0x17')](0x3b,_0x5410('0x35'))[_0x5410('0x19')]();}_0x1932d5={'start':_0x24166c,'end':_0x177572};break;default:_0x1932d5[_0x5410('0x30')]=_0x24166c;break;}return _0x1932d5;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ee1df16..90a3e89 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 _0x73a0=['object','columns','value','merge','map','type','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','alias','raw','fields','isEmpty','forOwn','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','isArray','split','limit','offset','col','priority','unsigned','substr','DESC','cast','ASC','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','name','filters','intersection','attributes','length','nolimit','order','sort','where','filter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x73a0,0x1bb));var _0x073a=function(_0xc2ecc6,_0x121488){_0xc2ecc6=_0xc2ecc6-0x0;var _0x306e05=_0x73a0[_0xc2ecc6];return _0x306e05;};'use strict';var _=require(_0x073a('0x0'));var sequelize=require(_0x073a('0x1'));var moment=require(_0x073a('0x2'));var db=require(_0x073a('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x38cd79){var _0x236ddd=['ne'];try{var _0x588086=JSON[_0x073a('0x4')](_0x38cd79);var _0x33639e=Object[_0x073a('0x5')](_0x588086)[0x0];return _0x236ddd[_0x073a('0x6')](_0x33639e);}catch(_0x42aab6){return![];}}function getOperatorValue(_0x5a54bb){var _0x2d5233=JSON[_0x073a('0x4')](_0x5a54bb);var _0x524347=Object[_0x073a('0x5')](_0x2d5233)[0x0];var _0x2a64e8=_0x2d5233[_0x524347];return{['$'+_0x524347]:_0x2a64e8};}function parseIncludeModel(_0x454fbc){var _0x4f550f=JSON[_0x073a('0x4')](_0x454fbc);return{'model':db[_0x4f550f['model']],'as':_0x4f550f[_0x073a('0x7')],'attributes':_0x4f550f['fields'],'raw':_0x4f550f[_0x073a('0x8')]};}exports[_0x073a('0x9')]=function(_0xb9d1c4){var _0x29b4fe=null;if(_0xb9d1c4){_0x29b4fe=_0xb9d1c4['split'](',');}return _0x29b4fe;};exports['filters']=function(_0x1389b2,_0x59ec15){var _0x4803ca={};if(!_[_0x073a('0xa')](_0x1389b2)){_[_0x073a('0xb')](_0x1389b2,function(_0x420cdd,_0x4e0d1d){try{if(_0x59ec15){var _0xdf1c29=_['find'](_0x59ec15,{'name':_0x4e0d1d})||{};if(hasSequelizeOperator(_0x420cdd)){_0x4803ca[_0x4e0d1d]=getOperatorValue(_0x420cdd);}else if(_0xdf1c29['type']===_0x073a('0xc')&&_[_0x073a('0xd')](_0x420cdd)){var _0x2b7ef6=JSON[_0x073a('0x4')](_0x420cdd);var _0x33e6a8={'$gte':moment(moment(_0x2b7ef6[_0x073a('0xe')])['format']('YYYY-MM-DD'))['utc']()[_0x073a('0xf')](),'$lte':moment(moment(_0x2b7ef6[_0x073a('0x10')])[_0x073a('0xf')](_0x073a('0x11')))[_0x073a('0x12')]()[_0x073a('0x13')](0x1,'s')[_0x073a('0xf')]()};_0x4803ca[_0x4e0d1d]=_0x33e6a8;}else if(_0xdf1c29['name']==='uniqueid'){_0x4803ca[_0x4e0d1d]=_0x420cdd;}else{_0x4803ca[_0x4e0d1d]=_[_0x073a('0x14')](_0x420cdd)?_0x420cdd:JSON['parse'](_0x420cdd);}}else{_0x4803ca[_0x4e0d1d]=_[_0x073a('0x14')](_0x420cdd)?_0x420cdd:JSON[_0x073a('0x4')](_0x420cdd);}}catch(_0x21bb80){_0x4803ca[_0x4e0d1d]=_0x420cdd[_0x073a('0x15')](',');}});}return _0x4803ca;};exports[_0x073a('0x16')]=function(_0x68da27){_0x68da27=parseInt(_0x68da27,0xa);if(!_0x68da27||_0x68da27<0x0){_0x68da27=LIMIT_VALUE;}return _0x68da27;};exports[_0x073a('0x17')]=function(_0x4e8042){_0x4e8042=parseInt(_0x4e8042,0xa);if(!_0x4e8042||_0x4e8042<0x0){_0x4e8042=0x0;}return _0x4e8042;};exports['sort']=function(_0x33b345){var _0xee7bda,_0xdf37cc=null;if(_0x33b345){_0xee7bda=_0x33b345[_0x073a('0x15')](',');_0xdf37cc=_['map'](_0xee7bda,function(_0x3e22ea){if(_0x3e22ea['indexOf']('-')===0x0){return[_0x3e22ea==='priority'?sequelize['cast'](sequelize[_0x073a('0x18')](_0x073a('0x19')),_0x073a('0x1a')):_0x3e22ea[_0x073a('0x1b')](0x1),_0x073a('0x1c')];}else{return[_0x3e22ea===_0x073a('0x19')?sequelize[_0x073a('0x1d')](sequelize[_0x073a('0x18')]('priority'),_0x073a('0x1a')):_0x3e22ea,_0x073a('0x1e')];}});}return _0xdf37cc;};exports['omit']=function(_0x220b9f,_0x5b0574){if(_[_0x073a('0xa')](_0x220b9f)){return _0x220b9f;}if(_[_0x073a('0x14')](_0x220b9f)){for(var _0x252b68=0x0;_0x252b68<_0x220b9f['length'];_0x252b68+=0x1){_0x220b9f[_0x252b68]=this[_0x073a('0x1f')](_0x220b9f[_0x252b68],_0x5b0574);}return _0x220b9f;}if(!_[_0x073a('0x20')](_0x220b9f)){return _0x220b9f;}if(_[_0x073a('0x21')](_0x5b0574)){_0x5b0574=[_0x5b0574];}if(!_[_0x073a('0x14')](_0x5b0574)){return _0x220b9f;}for(var _0x1d2d3b=0x0;_0x1d2d3b<_0x5b0574['length'];_0x1d2d3b+=0x1){_[_0x073a('0x22')](_0x220b9f,_0x5b0574[_0x1d2d3b]);}for(var _0x26c7fb in _0x220b9f){if(_0x220b9f[_0x073a('0x23')](_0x26c7fb)){_0x220b9f[_0x26c7fb]=this[_0x073a('0x1f')](_0x220b9f[_0x26c7fb],_0x5b0574);}}return _0x220b9f;};exports[_0x073a('0x24')]=function(_0xcaf796){return _0xcaf796[_0x073a('0x25')](RegExp(_0x073a('0x26')))?!![]:![];};exports[_0x073a('0x27')]=function(_0x676902){return _0x676902['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x073a('0x28')]=function(_0x340206,_0x2894d7){var _0x31bbc4=[];var _0x163578=/[ `!@#$%^&*()_\-?~]/;var _0x25af85=_0x2894d7?_0x073a('0x29'):_0x073a('0x2a');_0x340206[_0x073a('0x15')](/[ ,]+/)[_0x073a('0x2b')](function(_0x5533a2){_0x5533a2=_0x5533a2[_0x073a('0x2c')](/([^:]")"+/g,'$1');_0x5533a2='+'+_0x5533a2+'*';var _0x27e8e3=_0x5533a2['match'](_0x163578);if(_0x27e8e3){_0x5533a2='\x22'+_0x5533a2+'\x22';}_0x31bbc4[_0x073a('0x2d')](_0x5533a2);});_0x25af85=_0x25af85[_0x073a('0x2c')](_0x073a('0x2a'),_0x31bbc4[_0x073a('0x2e')]('\x20'));return _0x25af85;};exports[_0x073a('0x2f')]=function(_0x3490dd,_0x99afc4,_0x9f8c94){var _0x342fbc={},_0x4e5ed0={};if(_0x99afc4[_0x073a('0x30')][_0x073a('0x31')]){_0x99afc4[_0x073a('0x30')]['id']=_0x99afc4[_0x073a('0x30')][_0x073a('0x31')];delete _0x99afc4[_0x073a('0x30')]['$id'];}_0x342fbc[_0x073a('0x32')]=_['map'](_0x3490dd,_0x073a('0x33'));_0x342fbc[_0x073a('0x30')]=_[_0x073a('0x5')](_0x99afc4[_0x073a('0x30')]);_0x342fbc[_0x073a('0x34')]=_[_0x073a('0x35')](_0x342fbc[_0x073a('0x32')],_0x342fbc[_0x073a('0x30')]);_0x4e5ed0['attributes']=_[_0x073a('0x35')](_0x342fbc[_0x073a('0x32')],this[_0x073a('0x9')](_0x99afc4[_0x073a('0x30')][_0x073a('0x9')]));_0x4e5ed0[_0x073a('0x36')]=_0x4e5ed0['attributes'][_0x073a('0x37')]?_0x4e5ed0['attributes']:_0x342fbc[_0x073a('0x32')];if(!_0x99afc4[_0x073a('0x30')][_0x073a('0x23')](_0x073a('0x38'))){_0x4e5ed0['limit']=this[_0x073a('0x16')](_0x99afc4[_0x073a('0x30')][_0x073a('0x16')]);_0x4e5ed0[_0x073a('0x17')]=this[_0x073a('0x17')](_0x99afc4[_0x073a('0x30')][_0x073a('0x17')]);}_0x4e5ed0[_0x073a('0x39')]=this[_0x073a('0x3a')](_0x99afc4[_0x073a('0x30')][_0x073a('0x3a')]);_0x4e5ed0[_0x073a('0x3b')]=this[_0x073a('0x34')](_['pick'](_0x99afc4[_0x073a('0x30')],_0x342fbc[_0x073a('0x34')]),_0x3490dd);if(_0x99afc4[_0x073a('0x30')]['filter']){var _0x435bb1=_0x3490dd;var _0x331d89=_0x99afc4[_0x073a('0x30')][_0x073a('0x3c')];if(typeof _0x331d89===_0x073a('0x3d')){_0x435bb1=_[_0x073a('0x3c')](_0x3490dd,function(_0x1003d5){return _[_0x073a('0x6')](_0x331d89[_0x073a('0x3e')],_0x1003d5[_0x073a('0x33')]);});_0x331d89=_0x331d89[_0x073a('0x3f')];}_0x4e5ed0[_0x073a('0x3b')]=_[_0x073a('0x40')](_0x4e5ed0[_0x073a('0x3b')],{'$or':_[_0x073a('0x41')](_0x435bb1,function(_0x5eeb25){if(_0x5eeb25[_0x073a('0x42')]!==_0x073a('0x43')){if(_0x9f8c94){return sequelize[_0x073a('0x3b')](sequelize['fn']('lower',sequelize[_0x073a('0x18')](_0x5eeb25[_0x073a('0x33')])),{'$like':sequelize['fn'](_0x073a('0x44'),'%'+_0x99afc4[_0x073a('0x30')][_0x073a('0x3c')]+'%')});}else{var _0x511d08={};_0x511d08[_0x5eeb25[_0x073a('0x33')]]={'$like':'%'+_0x99afc4['query']['filter']+'%'};return _0x511d08;}}})});}_0x4e5ed0=_[_0x073a('0x40')]({},_0x4e5ed0,_0x99afc4[_0x073a('0x45')]);return _0x4e5ed0;};exports[_0x073a('0x46')]=function(_0x41e6c1){var _0x29cdb4=[];if(_0x41e6c1[_0x073a('0x47')]){_0x29cdb4[_0x073a('0x2d')]({'all':!![]});}else if(_0x41e6c1[_0x073a('0x46')]){if(Array[_0x073a('0x14')](_0x41e6c1['include'])){_0x29cdb4=Object[_0x073a('0x5')](_0x41e6c1[_0x073a('0x46')])[_0x073a('0x41')](function(_0x4eeefc){return parseIncludeModel(_0x41e6c1[_0x073a('0x46')][_0x4eeefc]);});}else{var _0x2e4d9b=parseIncludeModel(_0x41e6c1[_0x073a('0x46')]);_0x29cdb4[_0x073a('0x2d')](_0x2e4d9b);}}return _0x29cdb4;}; \ No newline at end of file +var _0xa210=['omit','isString','hasOwnProperty','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','intersection','attributes','length','nolimit','offset','order','sort','pick','filter','columns','value','where','merge','VIRTUAL','lower','options','include','lodash','../../mysqldb','parse','keys','includes','model','alias','fields','filters','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','split','limit','map','indexOf','priority','cast','col','unsigned','substr','ASC','isEmpty'];(function(_0xe0e53,_0x581f2a){var _0x4ebb51=function(_0x3a696e){while(--_0x3a696e){_0xe0e53['push'](_0xe0e53['shift']());}};_0x4ebb51(++_0x581f2a);}(_0xa210,0x1d8));var _0x0a21=function(_0x512065,_0x69a4d4){_0x512065=_0x512065-0x0;var _0x39ad9e=_0xa210[_0x512065];return _0x39ad9e;};'use strict';var _=require(_0x0a21('0x0'));var sequelize=require('sequelize');var moment=require('moment');var db=require(_0x0a21('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x100064){var _0x2ead70=['ne'];try{var _0x51e7cc=JSON[_0x0a21('0x2')](_0x100064);var _0x47618f=Object[_0x0a21('0x3')](_0x51e7cc)[0x0];return _0x2ead70[_0x0a21('0x4')](_0x47618f);}catch(_0x16b4f8){return![];}}function getOperatorValue(_0xe5fd91){var _0x39c1c7=JSON['parse'](_0xe5fd91);var _0x53138f=Object[_0x0a21('0x3')](_0x39c1c7)[0x0];var _0x422223=_0x39c1c7[_0x53138f];return{['$'+_0x53138f]:_0x422223};}function parseIncludeModel(_0x22cfb2){var _0x1b7ec5=JSON[_0x0a21('0x2')](_0x22cfb2);return{'model':db[_0x1b7ec5[_0x0a21('0x5')]],'as':_0x1b7ec5[_0x0a21('0x6')],'attributes':_0x1b7ec5[_0x0a21('0x7')],'raw':_0x1b7ec5['raw']};}exports[_0x0a21('0x7')]=function(_0x27eaeb){var _0x14168c=null;if(_0x27eaeb){_0x14168c=_0x27eaeb['split'](',');}return _0x14168c;};exports[_0x0a21('0x8')]=function(_0x2b1a5d,_0x7fc550){var _0xdd84de={};if(!_['isEmpty'](_0x2b1a5d)){_[_0x0a21('0x9')](_0x2b1a5d,function(_0x1a05a2,_0x347dc5){try{if(_0x7fc550){var _0xbe9a3e=_['find'](_0x7fc550,{'name':_0x347dc5})||{};if(hasSequelizeOperator(_0x1a05a2)){_0xdd84de[_0x347dc5]=getOperatorValue(_0x1a05a2);}else if(_0xbe9a3e[_0x0a21('0xa')]===_0x0a21('0xb')&&_[_0x0a21('0xc')](_0x1a05a2)){var _0x200181=JSON['parse'](_0x1a05a2);var _0x16347f={'$gte':moment(moment(_0x200181[_0x0a21('0xd')])[_0x0a21('0xe')](_0x0a21('0xf')))[_0x0a21('0x10')]()[_0x0a21('0xe')](),'$lte':moment(moment(_0x200181['$lte'])[_0x0a21('0xe')](_0x0a21('0xf')))['utc']()[_0x0a21('0x11')](0x1,'s')[_0x0a21('0xe')]()};_0xdd84de[_0x347dc5]=_0x16347f;}else if(_0xbe9a3e[_0x0a21('0x12')]===_0x0a21('0x13')){_0xdd84de[_0x347dc5]=_0x1a05a2;}else{_0xdd84de[_0x347dc5]=_[_0x0a21('0x14')](_0x1a05a2)?_0x1a05a2:JSON[_0x0a21('0x2')](_0x1a05a2);}}else{_0xdd84de[_0x347dc5]=_['isArray'](_0x1a05a2)?_0x1a05a2:JSON[_0x0a21('0x2')](_0x1a05a2);}}catch(_0x3fab9b){_0xdd84de[_0x347dc5]=_0x1a05a2[_0x0a21('0x15')](',');}});}return _0xdd84de;};exports[_0x0a21('0x16')]=function(_0x4cfd97){_0x4cfd97=parseInt(_0x4cfd97,0xa);if(!_0x4cfd97||_0x4cfd97<0x0){_0x4cfd97=LIMIT_VALUE;}return _0x4cfd97;};exports['offset']=function(_0x34b118){_0x34b118=parseInt(_0x34b118,0xa);if(!_0x34b118||_0x34b118<0x0){_0x34b118=0x0;}return _0x34b118;};exports['sort']=function(_0x2a393f){var _0x176cb6,_0x34a8f4=null;if(_0x2a393f){_0x176cb6=_0x2a393f['split'](',');_0x34a8f4=_[_0x0a21('0x17')](_0x176cb6,function(_0x5bd5cd){if(_0x5bd5cd[_0x0a21('0x18')]('-')===0x0){return[_0x5bd5cd===_0x0a21('0x19')?sequelize[_0x0a21('0x1a')](sequelize[_0x0a21('0x1b')]('priority'),_0x0a21('0x1c')):_0x5bd5cd[_0x0a21('0x1d')](0x1),'DESC'];}else{return[_0x5bd5cd===_0x0a21('0x19')?sequelize[_0x0a21('0x1a')](sequelize['col'](_0x0a21('0x19')),'unsigned'):_0x5bd5cd,_0x0a21('0x1e')];}});}return _0x34a8f4;};exports['omit']=function(_0x466cc7,_0x4a13c6){if(_[_0x0a21('0x1f')](_0x466cc7)){return _0x466cc7;}if(_[_0x0a21('0x14')](_0x466cc7)){for(var _0x3e101f=0x0;_0x3e101f<_0x466cc7['length'];_0x3e101f+=0x1){_0x466cc7[_0x3e101f]=this[_0x0a21('0x20')](_0x466cc7[_0x3e101f],_0x4a13c6);}return _0x466cc7;}if(!_['isObject'](_0x466cc7)){return _0x466cc7;}if(_[_0x0a21('0x21')](_0x4a13c6)){_0x4a13c6=[_0x4a13c6];}if(!_['isArray'](_0x4a13c6)){return _0x466cc7;}for(var _0x954120=0x0;_0x954120<_0x4a13c6['length'];_0x954120+=0x1){_['unset'](_0x466cc7,_0x4a13c6[_0x954120]);}for(var _0x32aa2a in _0x466cc7){if(_0x466cc7[_0x0a21('0x22')](_0x32aa2a)){_0x466cc7[_0x32aa2a]=this[_0x0a21('0x20')](_0x466cc7[_0x32aa2a],_0x4a13c6);}}return _0x466cc7;};exports['isNumeric']=function(_0x457f2a){return _0x457f2a[_0x0a21('0x23')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x240b15){return _0x240b15['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x0a21('0x24')]=function(_0x30b220,_0x2e1f53){var _0x21668f=[];var _0x2c1030=/[ `!@#$%^&*()_\-?~]/;var _0x311afd=_0x2e1f53?_0x0a21('0x25'):_0x0a21('0x26');_0x30b220[_0x0a21('0x15')](/[ ,]+/)[_0x0a21('0x27')](function(_0x251f91){_0x251f91=_0x251f91[_0x0a21('0x28')](/([^:]")"+/g,'$1');_0x251f91='+'+_0x251f91+'*';var _0x3e36c0=_0x251f91[_0x0a21('0x23')](_0x2c1030);if(_0x3e36c0){_0x251f91='\x22'+_0x251f91+'\x22';}_0x21668f[_0x0a21('0x29')](_0x251f91);});_0x311afd=_0x311afd[_0x0a21('0x28')](_0x0a21('0x26'),_0x21668f[_0x0a21('0x2a')]('\x20'));return _0x311afd;};exports[_0x0a21('0x2b')]=function(_0x1e0916,_0x131877,_0x2c8c60){var _0x533302={},_0x52140c={};if(_0x131877[_0x0a21('0x2c')][_0x0a21('0x2d')]){_0x131877[_0x0a21('0x2c')]['id']=_0x131877['query'][_0x0a21('0x2d')];delete _0x131877[_0x0a21('0x2c')][_0x0a21('0x2d')];}_0x533302[_0x0a21('0x5')]=_[_0x0a21('0x17')](_0x1e0916,_0x0a21('0x12'));_0x533302[_0x0a21('0x2c')]=_[_0x0a21('0x3')](_0x131877['query']);_0x533302[_0x0a21('0x8')]=_[_0x0a21('0x2e')](_0x533302[_0x0a21('0x5')],_0x533302['query']);_0x52140c[_0x0a21('0x2f')]=_['intersection'](_0x533302['model'],this[_0x0a21('0x7')](_0x131877['query'][_0x0a21('0x7')]));_0x52140c['attributes']=_0x52140c[_0x0a21('0x2f')][_0x0a21('0x30')]?_0x52140c[_0x0a21('0x2f')]:_0x533302['model'];if(!_0x131877['query'][_0x0a21('0x22')](_0x0a21('0x31'))){_0x52140c[_0x0a21('0x16')]=this['limit'](_0x131877[_0x0a21('0x2c')][_0x0a21('0x16')]);_0x52140c[_0x0a21('0x32')]=this[_0x0a21('0x32')](_0x131877[_0x0a21('0x2c')]['offset']);}_0x52140c[_0x0a21('0x33')]=this[_0x0a21('0x34')](_0x131877[_0x0a21('0x2c')][_0x0a21('0x34')]);_0x52140c['where']=this[_0x0a21('0x8')](_[_0x0a21('0x35')](_0x131877['query'],_0x533302[_0x0a21('0x8')]),_0x1e0916);if(_0x131877['query'][_0x0a21('0x36')]){var _0x23f6ec=_0x1e0916;var _0x4ac85b=_0x131877[_0x0a21('0x2c')][_0x0a21('0x36')];if(typeof _0x4ac85b==='object'){_0x23f6ec=_[_0x0a21('0x36')](_0x1e0916,function(_0x37e14c){return _[_0x0a21('0x4')](_0x4ac85b[_0x0a21('0x37')],_0x37e14c['name']);});_0x4ac85b=_0x4ac85b[_0x0a21('0x38')];}_0x52140c[_0x0a21('0x39')]=_[_0x0a21('0x3a')](_0x52140c[_0x0a21('0x39')],{'$or':_['map'](_0x23f6ec,function(_0x533884){if(_0x533884['type']!==_0x0a21('0x3b')){if(_0x2c8c60){return sequelize['where'](sequelize['fn'](_0x0a21('0x3c'),sequelize[_0x0a21('0x1b')](_0x533884[_0x0a21('0x12')])),{'$like':sequelize['fn'](_0x0a21('0x3c'),'%'+_0x131877[_0x0a21('0x2c')][_0x0a21('0x36')]+'%')});}else{var _0x396b5f={};_0x396b5f[_0x533884['name']]={'$like':'%'+_0x131877[_0x0a21('0x2c')][_0x0a21('0x36')]+'%'};return _0x396b5f;}}})});}_0x52140c=_[_0x0a21('0x3a')]({},_0x52140c,_0x131877[_0x0a21('0x3d')]);return _0x52140c;};exports[_0x0a21('0x3e')]=function(_0x119583){var _0x543dd1=[];if(_0x119583['includeAll']){_0x543dd1[_0x0a21('0x29')]({'all':!![]});}else if(_0x119583[_0x0a21('0x3e')]){if(Array[_0x0a21('0x14')](_0x119583['include'])){_0x543dd1=Object['keys'](_0x119583['include'])[_0x0a21('0x17')](function(_0x5182c3){return parseIncludeModel(_0x119583[_0x0a21('0x3e')][_0x5182c3]);});}else{var _0x44849f=parseIncludeModel(_0x119583[_0x0a21('0x3e')]);_0x543dd1['push'](_0x44849f);}}return _0x543dd1;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 417f3c9..4c930d0 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','role','userpic','voiceStatusTime','mailCapacity','phoneBarEnableScreenRecordingByAgent','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','http','chatPause','faxPause','mailPause','smsPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','isArray','Queue','map','findOne','uniq','getAgentIdsByQueues','includes','resolve','name','openchannelPause','voicePause','whatsappPause','pauseType','find','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','toLowerCase','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus'];(function(_0x1b925b,_0x1ab3c9){var _0x275f07=function(_0x2ffbe4){while(--_0x2ffbe4){_0x1b925b['push'](_0x1b925b['shift']());}};_0x275f07(++_0x1ab3c9);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2fb691,_0x1cc9dd){_0x2fb691=_0x2fb691-0x0;var _0x4e8b64=_0xdc97[_0x2fb691];return _0x4e8b64;};'use strict';var _=require(_0x7dc9('0x0'));var jayson=require(_0x7dc9('0x1'));var db=require(_0x7dc9('0x2'))['db'];var amiClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x7dc9('0x3')]({'port':0x232c});function isAgentPaused(_0x2b86da,_0x478a95){var _0x2a77c1=[_0x2b86da[_0x7dc9('0x4')],_0x2b86da[_0x7dc9('0x5')],_0x2b86da[_0x7dc9('0x6')],_0x2b86da['openchannelPause'],_0x2b86da[_0x7dc9('0x7')],_0x2b86da['voicePause'],_0x2b86da['whatsappPause']];if(!_0x478a95)return _[_0x7dc9('0x8')](_0x2a77c1);var _0x23737d=_[_0x7dc9('0x9')](_0x2a77c1);return _0x23737d[_0x7dc9('0xa')]>0x0&&_0x23737d[_0x7dc9('0xa')]<_0x2a77c1['length']?!![]:![];}function isIdle(_0xb2fa2a){return _0xb2fa2a===_0x7dc9('0xb')||_0xb2fa2a===_0x7dc9('0xc')||_0xb2fa2a===_0x7dc9('0xd')||_0xb2fa2a===_0x7dc9('0xe')||_[_0x7dc9('0xf')](_0xb2fa2a);}function isAgentIdle(_0x1e336a){if(_0x1e336a['voiceStatus']!=='idle'&&_0x1e336a['voicePause']){_0x1e336a['voiceStatus']=_0x7dc9('0x10');return![];}return _[_0x7dc9('0x8')]([_0x1e336a['chatStatus'],_0x1e336a[_0x7dc9('0x11')],_0x1e336a[_0x7dc9('0x12')],_0x1e336a[_0x7dc9('0x13')],_0x1e336a[_0x7dc9('0x14')],_0x1e336a[_0x7dc9('0x15')],_0x1e336a[_0x7dc9('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x7dc9('0x17'),{})[_0x7dc9('0x18')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0x19')]){throw new Error(_0x7dc9('0x1a'));}var _0xbe0437=_0x1b0aa1[_0x7dc9('0x1b')];return routingClient[_0x7dc9('0x1c')](_0x7dc9('0x17'),{})['then'](function(_0x22577e){if(_0x22577e['error']){throw new Error(_0x7dc9('0x1d'));}var _0x1cc237=_0x22577e['result'];return _[_0x7dc9('0x1e')]({},_0xbe0437,_0x1cc237);});})[_0x7dc9('0x1f')](function(_0x12f08d){throw _0x12f08d;});}exports[_0x7dc9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x43ec33){var _0x184bfd=_0x7dc9('0xc');if(isAgentPaused(_0x43ec33))_0x184bfd=_0x7dc9('0x10');else if(isAgentPaused(_0x43ec33,!![]))_0x184bfd=_0x7dc9('0x21');else if(isAgentIdle(_0x43ec33))_0x184bfd=_0x7dc9('0xb');else _0x184bfd='busy';return _0x184bfd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x12954f,_0x5981e2){var _0x596e0f=_[_0x7dc9('0x22')](_0x12954f)?_0x12954f:[_0x12954f];var _0x27f7fa=_['startCase'](_0x5981e2)+_0x7dc9('0x23');var _0x43d31f=_[_0x7dc9('0x24')](_0x596e0f,function(_0x4906b1){return db[_0x27f7fa][_0x7dc9('0x25')]({'where':{'id':_0x4906b1}})[_0x7dc9('0x18')](function(_0xf95336){if(!_0xf95336)return[];return _0xf95336['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x43d31f)['then'](function(_0x25b383){var _0x32d032=_(_0x25b383)['flatten']()['map']('id')[_0x7dc9('0x26')]()['value']();return _0x32d032;});}exports[_0x7dc9('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1c690b,_0x3a74a0,_0x3e4102){try{if(_0x3a74a0[_0x7dc9('0xa')]>0x0){_0x1c690b=_0x1c690b[_0x7dc9('0x9')](function(_0x236d42){return _0x3a74a0[_0x7dc9('0x28')](_0x236d42['id']);});}var _0x1fcf0e=_0x1c690b[_0x7dc9('0x9')](function(_0x14083d){var _0x2a456c='busy';if(isAgentIdle(_0x14083d)){_0x2a456c='idle';}return _0x2a456c===_0x3e4102;});return _['map'](_0x1fcf0e,'id');}catch(_0x49a4a5){throw _0x49a4a5;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x553a03,_0x58c4e8,_0x59f5d8){return Promise[_0x7dc9('0x29')]()[_0x7dc9('0x18')](function(){if(_0x58c4e8[_0x7dc9('0xa')]>0x0){_0x553a03=_0x553a03[_0x7dc9('0x9')](function(_0x3300ff){return _0x58c4e8[_0x7dc9('0x28')](_0x3300ff['id']);});}return _0x553a03;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0x7dc9('0x2a'),'fullname',_0x7dc9('0x4'),_0x7dc9('0x5'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),_0x7dc9('0x2d'),_0x7dc9('0x2e')],'where':{'id':{'$in':_['map'](_0x553a03,'id')}},'raw':!![]});})[_0x7dc9('0x18')](function(_0x4cdec4){return _0x4cdec4[_0x7dc9('0x24')](function(_0x16431a){var _0x3dc8e0=_[_0x7dc9('0x2f')](_0x553a03,['id',_0x16431a['id']]);var _0x48d9b2=filterAgentAttributes(_0x3dc8e0);_[_0x7dc9('0x1e')](_0x16431a,_0x48d9b2);_0x16431a['globalStatus']=getAgentStatus(_0x16431a);return _0x16431a;});})[_0x7dc9('0x18')](function(_0x4f47af){var _0x590bed=sortAgentsByStatus(_0x4f47af,_0x59f5d8);return _[_0x7dc9('0x24')](_0x590bed,'id');})[_0x7dc9('0x1f')](function(_0x21e036){throw _0x21e036;});}exports[_0x7dc9('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5dac5b){var _0x9376a5={'fields':[],'order':null};var _0x183d87=_0x5dac5b[_0x7dc9('0x31')](',');_0x9376a5[_0x7dc9('0x32')]=_[_0x7dc9('0x9')](_0x183d87,function(_0x21faa6){if(!_0x21faa6[_0x7dc9('0x28')](_0x7dc9('0x33'))){return!![];}_0x9376a5[_0x7dc9('0x34')]=_[_0x7dc9('0x35')](_0x21faa6,'-')?_0x7dc9('0x36'):_0x7dc9('0x37');return![];});return _0x9376a5;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x34b5c9){if(!_0x34b5c9){_0x34b5c9=_0x7dc9('0x38');}if(_0x34b5c9[_0x7dc9('0x28')](_0x7dc9('0x39'))&&!_0x34b5c9['includes'](_0x7dc9('0x3a'))){var _0x89db0e=_0x34b5c9[_0x7dc9('0x3b')](0x0,_0x34b5c9[_0x7dc9('0x3c')](_0x7dc9('0x39')));_0x34b5c9+=','+_0x89db0e+_0x7dc9('0x3a');}return _0x34b5c9;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x553230,_0x3ef9fd){var _0x36a965=_0x553230['sort'](function(_0x3a705c,_0x4a37ec){if(_0x3a705c[_0x7dc9('0x33')]===_0x4a37ec[_0x7dc9('0x33')]){if(_0x3a705c[_0x7dc9('0x33')]==='pause'){if(_0x3ef9fd===_0x7dc9('0x36')){return(_0x3a705c[_0x7dc9('0x2e')]||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return(_0x3a705c['pauseType']||'')<(_0x4a37ec[_0x7dc9('0x2e')]||'')||_0x3a705c['fullname']['toLowerCase']()>_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?-0x1:0x1;}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec[_0x7dc9('0x39')][_0x7dc9('0x3d')]()?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x39')][_0x7dc9('0x3d')]()<_0x4a37ec['fullname'][_0x7dc9('0x3d')]()?-0x1:0x1;}}}else{if(_0x3ef9fd===_0x7dc9('0x36')){return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?0x1:-0x1;}else{return _0x3a705c[_0x7dc9('0x33')]<_0x4a37ec[_0x7dc9('0x33')]?-0x1:0x1;}}});return _0x36a965;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x3774cb){var _0x42e110=['userpic',_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),'pauseType',_0x7dc9('0x40'),'internal','address',_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause','whatsappPause',_0x7dc9('0x5'),'voicePause',_0x7dc9('0x41'),_0x7dc9('0x42'),'mailCapacity',_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x45'),_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x4b'),_0x7dc9('0x4c'),_0x7dc9('0x13'),_0x7dc9('0x12'),_0x7dc9('0x14'),'whatsappStatus',_0x7dc9('0x11'),'voiceStatus','chatStatusTime',_0x7dc9('0x4d'),_0x7dc9('0x4e'),_0x7dc9('0x4f'),_0x7dc9('0x50'),_0x7dc9('0x51'),'voiceStatusTime',_0x7dc9('0x52'),_0x7dc9('0x53'),_0x7dc9('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x7dc9('0x55'),_0x7dc9('0x56')];var _0x2cf133=[_0x7dc9('0x4'),_0x7dc9('0x2b'),_0x7dc9('0x6'),'smsPause',_0x7dc9('0x2d'),_0x7dc9('0x5'),_0x7dc9('0x2c'),_0x7dc9('0x3e')];var _0x877a67=_(_0x3774cb)[_0x7dc9('0x57')](_0x2cf133)[_0x7dc9('0x58')](_0x42e110)[_0x7dc9('0x59')]();return _0x877a67;}exports[_0x7dc9('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x7dc9('0x2a'),_0x7dc9('0x39'),_0x7dc9('0x5b'),'internal',_0x7dc9('0x3e'),_0x7dc9('0x33'),_0x7dc9('0x5c'),_0x7dc9('0x3f'),_0x7dc9('0x2e'),'lastPauseAt',_0x7dc9('0x5'),_0x7dc9('0x4'),_0x7dc9('0x6'),_0x7dc9('0x2b'),_0x7dc9('0x7'),_0x7dc9('0x2c'),'whatsappPause','chatStatus','faxStatus',_0x7dc9('0x12'),_0x7dc9('0x13'),_0x7dc9('0x14'),_0x7dc9('0x15'),'whatsappStatus','chatStatusTime',_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x4d'),_0x7dc9('0x4f'),_0x7dc9('0x5d'),_0x7dc9('0x50'),_0x7dc9('0x41'),'faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),_0x7dc9('0x46'),'faxCurrentCapacity',_0x7dc9('0x48'),_0x7dc9('0x47'),_0x7dc9('0x49'),_0x7dc9('0x4a'),_0x7dc9('0x5f'),_0x7dc9('0x55'),_0x7dc9('0x53'),_0x7dc9('0x60'),_0x7dc9('0x52'),_0x7dc9('0x56'),_0x7dc9('0x54')];}exports[_0x7dc9('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x814b=['mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','openchannelStatusTime','voiceStatusTime','faxCapacity','chatCurrentCapacity','phoneBarEnableScreenRecordingByAgent','onhold','routealias','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','fullname,internal','indexOf','internal','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity'];(function(_0x14b708,_0x62c81c){var _0x6d280=function(_0x5c5a24){while(--_0x5c5a24){_0x14b708['push'](_0x14b708['shift']());}};_0x6d280(++_0x62c81c);}(_0x814b,0x1a2));var _0xb814=function(_0x300860,_0x509371){_0x300860=_0x300860-0x0;var _0x2094ad=_0x814b[_0x300860];return _0x2094ad;};'use strict';var _=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var db=require(_0xb814('0x2'))['db'];var amiClient=jayson[_0xb814('0x3')][_0xb814('0x4')]({'port':0x232a});var routingClient=jayson[_0xb814('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x38c21a,_0x3e1e9){var _0x258866=[_0x38c21a[_0xb814('0x5')],_0x38c21a[_0xb814('0x6')],_0x38c21a[_0xb814('0x7')],_0x38c21a['openchannelPause'],_0x38c21a[_0xb814('0x8')],_0x38c21a[_0xb814('0x9')],_0x38c21a['whatsappPause']];if(!_0x3e1e9)return _[_0xb814('0xa')](_0x258866);var _0x2913a6=_[_0xb814('0xb')](_0x258866);return _0x2913a6[_0xb814('0xc')]>0x0&&_0x2913a6[_0xb814('0xc')]<_0x258866[_0xb814('0xc')]?!![]:![];}function isIdle(_0x1086f8){return _0x1086f8===_0xb814('0xd')||_0x1086f8===_0xb814('0xe')||_0x1086f8===_0xb814('0xf')||_0x1086f8===_0xb814('0x10')||_['isNil'](_0x1086f8);}function isAgentIdle(_0x43dfe6){if(_0x43dfe6['voiceStatus']!==_0xb814('0xd')&&_0x43dfe6[_0xb814('0x9')]){_0x43dfe6[_0xb814('0x11')]=_0xb814('0x12');return![];}return _[_0xb814('0xa')]([_0x43dfe6[_0xb814('0x13')],_0x43dfe6[_0xb814('0x14')],_0x43dfe6[_0xb814('0x15')],_0x43dfe6[_0xb814('0x16')],_0x43dfe6[_0xb814('0x17')],_0x43dfe6[_0xb814('0x11')],_0x43dfe6[_0xb814('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb814('0x19')](_0xb814('0x1a'),{})[_0xb814('0x1b')](function(_0x3a71d6){if(_0x3a71d6[_0xb814('0x1c')]){throw new Error(_0xb814('0x1d'));}var _0x125ce2=_0x3a71d6[_0xb814('0x1e')];return routingClient[_0xb814('0x19')]('Agents',{})[_0xb814('0x1b')](function(_0x55ba16){if(_0x55ba16[_0xb814('0x1c')]){throw new Error(_0xb814('0x1f'));}var _0x4c3007=_0x55ba16['result'];return _['merge']({},_0x125ce2,_0x4c3007);});})[_0xb814('0x20')](function(_0x4d5276){throw _0x4d5276;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xb684ea){var _0x24211d=_0xb814('0xe');if(isAgentPaused(_0xb684ea))_0x24211d='pause';else if(isAgentPaused(_0xb684ea,!![]))_0x24211d=_0xb814('0x21');else if(isAgentIdle(_0xb684ea))_0x24211d='idle';else _0x24211d=_0xb814('0x22');return _0x24211d;}exports[_0xb814('0x23')]=getAgentStatus;function getAgentIdsByQueues(_0x3b267e,_0x470e81){var _0x27352e=_[_0xb814('0x24')](_0x3b267e)?_0x3b267e:[_0x3b267e];var _0x1f5d40=_['startCase'](_0x470e81)+_0xb814('0x25');var _0x52b7a3=_[_0xb814('0x26')](_0x27352e,function(_0x457dac){return db[_0x1f5d40][_0xb814('0x27')]({'where':{'id':_0x457dac}})[_0xb814('0x1b')](function(_0x1c8a2e){if(!_0x1c8a2e)return[];return _0x1c8a2e[_0xb814('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb814('0x29')](_0x52b7a3)['then'](function(_0x392222){var _0xc0ef66=_(_0x392222)[_0xb814('0x2a')]()[_0xb814('0x26')]('id')[_0xb814('0x2b')]()[_0xb814('0x2c')]();return _0xc0ef66;});}exports[_0xb814('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e4e89,_0x5a6291,_0x271aa8){try{if(_0x5a6291[_0xb814('0xc')]>0x0){_0x1e4e89=_0x1e4e89['filter'](function(_0x9008b2){return _0x5a6291[_0xb814('0x2e')](_0x9008b2['id']);});}var _0x530744=_0x1e4e89['filter'](function(_0x20577b){var _0x2051d0='busy';if(isAgentIdle(_0x20577b)){_0x2051d0=_0xb814('0xd');}return _0x2051d0===_0x271aa8;});return _['map'](_0x530744,'id');}catch(_0x6efe9a){throw _0x6efe9a;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4cfc58,_0x419cd9,_0x4a4f27){return Promise[_0xb814('0x2f')]()[_0xb814('0x1b')](function(){if(_0x419cd9[_0xb814('0xc')]>0x0){_0x4cfc58=_0x4cfc58['filter'](function(_0x51d5ae){return _0x419cd9[_0xb814('0x2e')](_0x51d5ae['id']);});}return _0x4cfc58;})[_0xb814('0x1b')](function(){return db['User'][_0xb814('0x30')]({'attributes':['id',_0xb814('0x31'),_0xb814('0x32'),_0xb814('0x5'),_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),_0xb814('0x35')],'where':{'id':{'$in':_[_0xb814('0x26')](_0x4cfc58,'id')}},'raw':!![]});})[_0xb814('0x1b')](function(_0x4ff31a){return _0x4ff31a[_0xb814('0x26')](function(_0x57e6e6){var _0x43db67=_[_0xb814('0x36')](_0x4cfc58,['id',_0x57e6e6['id']]);var _0xe0f509=filterAgentAttributes(_0x43db67);_['merge'](_0x57e6e6,_0xe0f509);_0x57e6e6[_0xb814('0x37')]=getAgentStatus(_0x57e6e6);return _0x57e6e6;});})[_0xb814('0x1b')](function(_0x4ea6f8){var _0x2fcd92=sortAgentsByStatus(_0x4ea6f8,_0x4a4f27);return _[_0xb814('0x26')](_0x2fcd92,'id');})[_0xb814('0x20')](function(_0x1f7cd8){throw _0x1f7cd8;});}exports[_0xb814('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x467cf9){var _0x4d81eb={'fields':[],'order':null};var _0xa6ce87=_0x467cf9['split'](',');_0x4d81eb[_0xb814('0x39')]=_['filter'](_0xa6ce87,function(_0x4492ef){if(!_0x4492ef['includes'](_0xb814('0x37'))){return!![];}_0x4d81eb[_0xb814('0x3a')]=_['startsWith'](_0x4492ef,'-')?'DESC':'ASC';return![];});return _0x4d81eb;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x17549e){if(!_0x17549e){_0x17549e=_0xb814('0x3b');}if(_0x17549e[_0xb814('0x2e')](_0xb814('0x32'))&&!_0x17549e['includes']('internal')){var _0x6f15d3=_0x17549e['substring'](0x0,_0x17549e[_0xb814('0x3c')](_0xb814('0x32')));_0x17549e+=','+_0x6f15d3+_0xb814('0x3d');}return _0x17549e;}exports[_0xb814('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x42653f,_0x37369f){var _0x3b7f5a=_0x42653f[_0xb814('0x3f')](function(_0x31989d,_0x4b6ff8){if(_0x31989d['globalStatus']===_0x4b6ff8['globalStatus']){if(_0x31989d[_0xb814('0x37')]==='pause'){if(_0x37369f===_0xb814('0x40')){return(_0x31989d['pauseType']||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x31989d[_0xb814('0x35')]||'')<(_0x4b6ff8[_0xb814('0x35')]||'')||_0x31989d[_0xb814('0x32')][_0xb814('0x41')]()>_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?-0x1:0x1;}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')][_0xb814('0x41')]()?0x1:-0x1;}else{return _0x31989d[_0xb814('0x32')][_0xb814('0x41')]()<_0x4b6ff8[_0xb814('0x32')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x37369f==='DESC'){return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?0x1:-0x1;}else{return _0x31989d[_0xb814('0x37')]<_0x4b6ff8[_0xb814('0x37')]?-0x1:0x1;}}});return _0x3b7f5a;}exports[_0xb814('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x40e627){var _0x24b697=[_0xb814('0x43'),_0xb814('0x44'),_0xb814('0x45'),_0xb814('0x46'),'pauseType',_0xb814('0x46'),_0xb814('0x3d'),'address',_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x34'),_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x47'),_0xb814('0x48'),_0xb814('0x49'),_0xb814('0x4a'),_0xb814('0x4b'),'faxCapacity','chatCurrentCapacity',_0xb814('0x4c'),_0xb814('0x4d'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x50'),_0xb814('0x13'),_0xb814('0x16'),'mailStatus',_0xb814('0x17'),_0xb814('0x18'),_0xb814('0x14'),'voiceStatus',_0xb814('0x51'),'openchannelStatusTime',_0xb814('0x52'),'smsStatusTime',_0xb814('0x53'),_0xb814('0x54'),'voiceStatusTime',_0xb814('0x55'),_0xb814('0x56'),_0xb814('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xb814('0x58'),'routealias'];var _0x13bdcf=[_0xb814('0x5'),'openchannelPause',_0xb814('0x7'),'smsPause','whatsappPause',_0xb814('0x6'),_0xb814('0x9'),_0xb814('0x44')];var _0x47a814=_(_0x40e627)[_0xb814('0x59')](_0x13bdcf)['pick'](_0x24b697)[_0xb814('0x2c')]();return _0x47a814;}exports[_0xb814('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name',_0xb814('0x32'),'role',_0xb814('0x3d'),_0xb814('0x44'),_0xb814('0x37'),_0xb814('0x43'),_0xb814('0x45'),_0xb814('0x35'),_0xb814('0x46'),_0xb814('0x6'),'chatPause',_0xb814('0x7'),_0xb814('0x33'),'smsPause',_0xb814('0x9'),_0xb814('0x34'),'chatStatus',_0xb814('0x14'),'mailStatus','openchannelStatus',_0xb814('0x17'),'voiceStatus',_0xb814('0x18'),_0xb814('0x51'),_0xb814('0x54'),'mailStatusTime',_0xb814('0x5b'),'smsStatusTime',_0xb814('0x5c'),_0xb814('0x53'),_0xb814('0x47'),_0xb814('0x5d'),_0xb814('0x49'),_0xb814('0x48'),_0xb814('0x4a'),_0xb814('0x4b'),_0xb814('0x5e'),'faxCurrentCapacity',_0xb814('0x4d'),_0xb814('0x4c'),_0xb814('0x4e'),_0xb814('0x4f'),_0xb814('0x5f'),_0xb814('0x58'),'destconnectedlinenum',_0xb814('0x60'),'queue',_0xb814('0x61'),_0xb814('0x57')];}exports[_0xb814('0x62')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 631264b..cea784d 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf26=['startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','inbound','outbound','concat','map','get','busy','pTalking','find','merge','pick','lodash','util','client','http','available','loggedIn','paused','waiting','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','request'];(function(_0x39316c,_0x4bc4c1){var _0x1a0099=function(_0x2c5187){while(--_0x2c5187){_0x39316c['push'](_0x39316c['shift']());}};_0x1a0099(++_0x4bc4c1);}(_0xbf26,0x1a9));var _0x6bf2=function(_0x152260,_0x2c8e7d){_0x152260=_0x152260-0x0;var _0x4df0c9=_0xbf26[_0x152260];return _0x4df0c9;};'use strict';var _=require(_0x6bf2('0x0'));var jayson=require('jayson/promise');var util=require(_0x6bf2('0x1'));var amiClient=jayson[_0x6bf2('0x2')][_0x6bf2('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x6bf2('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6bf2('0x4'),_0x6bf2('0x5'),_0x6bf2('0x6'),_0x6bf2('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x6bf2('0x8'),_0x6bf2('0x9'),_0x6bf2('0xa'),_0x6bf2('0xb'),'ringing',_0x6bf2('0xc'),_0x6bf2('0xd'),_0x6bf2('0xe'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x6bf2('0xf'),_0x6bf2('0x10'),_0x6bf2('0x11'),_0x6bf2('0x12'),_0x6bf2('0x13'),_0x6bf2('0x14'),_0x6bf2('0x15'),_0x6bf2('0x16'),_0x6bf2('0x17'),_0x6bf2('0x18'),'erlangAbandonmentRate',_0x6bf2('0x19'),'dialPredictiveInterval',_0x6bf2('0x1a'),_0x6bf2('0x1b'),'predictiveIntervalAvailable',_0x6bf2('0x1c'),_0x6bf2('0x1d'),'predictiveIntervalDroppedCallsTimeout',_0x6bf2('0x1e'),_0x6bf2('0x1f'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x241635,_0x4f8e8c){var _0x34db39=_0x4f8e8c===_0x6bf2('0x20')?amiClient:routingClient;return _0x34db39[_0x6bf2('0x21')](_[_0x6bf2('0x22')](_0x4f8e8c)+_0x6bf2('0x23'),_0x241635)[_0x6bf2('0x24')](function(_0x467ab1){if(_0x467ab1[_0x6bf2('0x25')])throw new Error(util[_0x6bf2('0x26')](_0x6bf2('0x27'),_0x4f8e8c));return _0x467ab1[_0x6bf2('0x28')];})['catch'](function(_0x3271ca){throw _0x3271ca;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x4d0bb8,_0x3bc047,_0x4481a9,_0x16e9d8){var _0x7a99b9=DEFAULT_QUEUE_ATTRIBUTES;if(_0x4481a9===_0x6bf2('0x20')){if(_0x16e9d8===_0x6bf2('0x29')){_0x7a99b9=_0x7a99b9['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x16e9d8===_0x6bf2('0x2a')){_0x7a99b9=_0x7a99b9[_0x6bf2('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4d0bb8[_0x6bf2('0x2c')](function(_0x1aa466){var _0x1cd71d=_0x1aa466[_0x6bf2('0x2d')]({'plain':!![]});_0x1cd71d[_0x6bf2('0x6')]=0x0;_0x1cd71d[_0x6bf2('0x9')]=0x0;_0x1cd71d[_0x6bf2('0x5')]=0x0;_0x1cd71d[_0x6bf2('0x4')]=0x0;_0x1cd71d[_0x6bf2('0x7')]=0x0;if(_0x4481a9===_0x6bf2('0x20')){_0x1cd71d['talking']=0x0;_0x1cd71d[_0x6bf2('0x2e')]=0x0;if(_0x16e9d8==='outbound'){_0x1cd71d[_0x6bf2('0x2f')]=0x0;_0x1cd71d['originated']=0x0;}}var _0x2a62ed=_[_0x6bf2('0x30')](_0x3bc047,['id',_0x1cd71d['id']]);if(_0x2a62ed){_[_0x6bf2('0x31')](_0x1cd71d,_[_0x6bf2('0x32')](_0x2a62ed,_0x7a99b9));}return _0x1cd71d;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x8c5f=['request','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','voice','inbound','concat','map','talking','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','paused','waiting','busy','loggedInDb','notInUse','onHold','ringing','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime'];(function(_0x5a3d49,_0x24b21a){var _0x4d5c23=function(_0x4f62b0){while(--_0x4f62b0){_0x5a3d49['push'](_0x5a3d49['shift']());}};_0x4d5c23(++_0x24b21a);}(_0x8c5f,0xaa));var _0xf8c5=function(_0x6053e6,_0x5467ed){_0x6053e6=_0x6053e6-0x0;var _0xd0824b=_0x8c5f[_0x6053e6];return _0xd0824b;};'use strict';var _=require(_0xf8c5('0x0'));var jayson=require(_0xf8c5('0x1'));var util=require(_0xf8c5('0x2'));var amiClient=jayson[_0xf8c5('0x3')]['http']({'port':0x232a});var routingClient=jayson['client'][_0xf8c5('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xf8c5('0x5'),_0xf8c5('0x6'),_0xf8c5('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xf8c5('0x8'),'inUse','invalid',_0xf8c5('0x9'),_0xf8c5('0xa'),_0xf8c5('0xb'),_0xf8c5('0xc'),'ringInUse','talking',_0xf8c5('0xd'),_0xf8c5('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xf8c5('0xf'),_0xf8c5('0x10'),_0xf8c5('0x11'),_0xf8c5('0x12'),_0xf8c5('0x13'),_0xf8c5('0x14'),_0xf8c5('0x15'),_0xf8c5('0x16'),'startProgressive',_0xf8c5('0x17'),_0xf8c5('0x18'),_0xf8c5('0x19'),'erlangBusyFactor',_0xf8c5('0x1a'),_0xf8c5('0x1b'),_0xf8c5('0x1c'),_0xf8c5('0x1d'),'predictiveIntervalTotalCalls',_0xf8c5('0x1e'),_0xf8c5('0x1f'),_0xf8c5('0x20'),_0xf8c5('0x21'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x16911f,_0x3596c3){var _0x15822c=_0x3596c3==='voice'?amiClient:routingClient;return _0x15822c[_0xf8c5('0x22')](_['startCase'](_0x3596c3)+_0xf8c5('0x23'),_0x16911f)['then'](function(_0x2fdfc4){if(_0x2fdfc4[_0xf8c5('0x24')])throw new Error(util[_0xf8c5('0x25')](_0xf8c5('0x26'),_0x3596c3));return _0x2fdfc4[_0xf8c5('0x27')];})['catch'](function(_0x3f1a75){throw _0x3f1a75;});}exports[_0xf8c5('0x28')]=getRealtimeQueues;function initializeQueues(_0x8805e3,_0x35fcb2,_0x180240,_0x7b294){var _0x404e07=DEFAULT_QUEUE_ATTRIBUTES;if(_0x180240===_0xf8c5('0x29')){if(_0x7b294===_0xf8c5('0x2a')){_0x404e07=_0x404e07[_0xf8c5('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x7b294==='outbound'){_0x404e07=_0x404e07[_0xf8c5('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x8805e3[_0xf8c5('0x2c')](function(_0x2a9a7d){var _0x43d9ae=_0x2a9a7d['get']({'plain':!![]});_0x43d9ae[_0xf8c5('0x6')]=0x0;_0x43d9ae[_0xf8c5('0x9')]=0x0;_0x43d9ae['loggedIn']=0x0;_0x43d9ae['available']=0x0;_0x43d9ae['waiting']=0x0;if(_0x180240==='voice'){_0x43d9ae[_0xf8c5('0x2d')]=0x0;_0x43d9ae['busy']=0x0;if(_0x7b294===_0xf8c5('0x2e')){_0x43d9ae['pTalking']=0x0;_0x43d9ae[_0xf8c5('0x10')]=0x0;}}var _0x5bb534=_[_0xf8c5('0x2f')](_0x35fcb2,['id',_0x43d9ae['id']]);if(_0x5bb534){_[_0xf8c5('0x30')](_0x43d9ae,_[_0xf8c5('0x31')](_0x5bb534,_0x404e07));}return _0x43d9ae;});}exports[_0xf8c5('0x32')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9310f00..dc37e1a 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(_0x260097,_0xfd77f9){var _0x4380de=function(_0x403901){while(--_0x403901){_0x260097['push'](_0x260097['shift']());}};_0x4380de(++_0xfd77f9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x708c47,_0x6eaa1f){var _0x52a470=function(_0x14a750){while(--_0x14a750){_0x708c47['push'](_0x708c47['shift']());}};_0x52a470(++_0x6eaa1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ffa64ed..180377f 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 _0x4b6c=['getFirstInterface','map','model','createHash','md5','digest','getUuid','platform','licenseToken','test','utf8','replace','hostname','macAddress','ipAddress','update','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys','length','filter','IPv4','concat','head','address','127.0.0.1'];(function(_0x197853,_0x24487b){var _0x1cbb30=function(_0x53bab3){while(--_0x53bab3){_0x197853['push'](_0x197853['shift']());}};_0x1cbb30(++_0x24487b);}(_0x4b6c,0x11a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b6('0x0'));var os=require('os');var crypto=require(_0xc4b6('0x1'));var machine=require(_0xc4b6('0x2'));var exec=require(_0xc4b6('0x3'))[_0xc4b6('0x4')];var config=require(_0xc4b6('0x5'));function getInterfaces(){var _0x4246b1=[];var _0x510589=os['networkInterfaces']();var _0x3276cc=_[_0xc4b6('0x6')](_[_0xc4b6('0x7')](_0x510589));for(var _0x40d63c=0x0;_0x40d63c<_0x3276cc[_0xc4b6('0x8')];_0x40d63c++){var _0x16d2f6=_0x510589[_0x3276cc[_0x40d63c]][_0xc4b6('0x9')](function(_0x3f040c){return _0x3f040c['family']===_0xc4b6('0xa')&&_0x3f040c['internal']===![];});_0x4246b1=_0x4246b1[_0xc4b6('0xb')](_0x16d2f6);}return _0x4246b1;}function getFirstInterface(){var _0x3ad095=_[_0xc4b6('0xc')](getInterfaces());return{'macAddress':_0x3ad095&&_0x3ad095['mac']?_0x3ad095['mac']:'00:00:00:00:00:00','ipAddress':_0x3ad095&&_0x3ad095[_0xc4b6('0xd')]?_0x3ad095[_0xc4b6('0xd')]:_0xc4b6('0xe')};}exports[_0xc4b6('0xf')]=getFirstInterface;function getCPUhash(){var _0x436a1d=_['orderBy'](os['cpus']()[_0xc4b6('0x10')](function(_0x5d669f){return _0x5d669f[_0xc4b6('0x11')];}))['join'](':');return crypto[_0xc4b6('0x12')](_0xc4b6('0x13'))['update'](_0x436a1d)[_0xc4b6('0x14')]('hex');}exports[_0xc4b6('0x15')]=function(){var _0x5e0641=os[_0xc4b6('0x16')]();var _0x4483b6=/[0-9a-f-]{36}/;if(config[_0xc4b6('0x17')]&&_0x4483b6[_0xc4b6('0x18')](config[_0xc4b6('0x17')])){return config[_0xc4b6('0x17')];}else if(_0x5e0641==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc4b6('0x19')})[_0xc4b6('0x1a')]('\x0d\x0a','');}else{var _0x5392c7=getFirstInterface();var _0x5703a7=getCPUhash();var _0x59734d=_0x5703a7+'|'+os[_0xc4b6('0x1b')]()+'|'+_0x5392c7[_0xc4b6('0x1c')]+'|'+_0x5392c7[_0xc4b6('0x1d')];var _0x2b749f=crypto[_0xc4b6('0x12')](_0xc4b6('0x13'))[_0xc4b6('0x1e')](_0x59734d)[_0xc4b6('0x14')](_0xc4b6('0x1f'));return _0x2b749f['substring'](0x0,0x8)+'-'+_0x2b749f[_0xc4b6('0x20')](0x8,0xc)+'-'+_0x2b749f['substring'](0xc,0x10)+'-'+_0x2b749f[_0xc4b6('0x20')](0x10,0x14)+'-'+_0x2b749f[_0xc4b6('0x20')](0x14);}}; \ No newline at end of file +var _0x9f9e=['macAddress','hex','substring','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','cpus','model','join','createHash','md5','update','digest','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x9f9e,0x1d4));var _0xe9f9=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x9f9e[_0x3d34da];return _0xcf6af8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xe9f9('0x0'));var machine=require(_0xe9f9('0x1'));var exec=require('child_process')[_0xe9f9('0x2')];var config=require(_0xe9f9('0x3'));function getInterfaces(){var _0x541afc=[];var _0x28e984=os[_0xe9f9('0x4')]();var _0x344d0a=_[_0xe9f9('0x5')](_['keys'](_0x28e984));for(var _0x2063e2=0x0;_0x2063e2<_0x344d0a[_0xe9f9('0x6')];_0x2063e2++){var _0x47999c=_0x28e984[_0x344d0a[_0x2063e2]][_0xe9f9('0x7')](function(_0x27ac7e){return _0x27ac7e[_0xe9f9('0x8')]===_0xe9f9('0x9')&&_0x27ac7e[_0xe9f9('0xa')]===![];});_0x541afc=_0x541afc[_0xe9f9('0xb')](_0x47999c);}return _0x541afc;}function getFirstInterface(){var _0x158eed=_[_0xe9f9('0xc')](getInterfaces());return{'macAddress':_0x158eed&&_0x158eed[_0xe9f9('0xd')]?_0x158eed[_0xe9f9('0xd')]:_0xe9f9('0xe'),'ipAddress':_0x158eed&&_0x158eed[_0xe9f9('0xf')]?_0x158eed[_0xe9f9('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x2032a6=_[_0xe9f9('0x5')](os[_0xe9f9('0x10')]()['map'](function(_0x3ea02d){return _0x3ea02d[_0xe9f9('0x11')];}))[_0xe9f9('0x12')](':');return crypto[_0xe9f9('0x13')](_0xe9f9('0x14'))[_0xe9f9('0x15')](_0x2032a6)[_0xe9f9('0x16')]('hex');}exports['getUuid']=function(){var _0x57a9d0=os['platform']();var _0x2cd50f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2cd50f[_0xe9f9('0x17')](config['licenseToken'])){return config['licenseToken'];}else if(_0x57a9d0==='win32'){return exec(_0xe9f9('0x18'),{'encoding':_0xe9f9('0x19')})[_0xe9f9('0x1a')]('\x0d\x0a','');}else{var _0x4536b8=getFirstInterface();var _0x2bc8ea=getCPUhash();var _0x7bc655=_0x2bc8ea+'|'+os[_0xe9f9('0x1b')]()+'|'+_0x4536b8[_0xe9f9('0x1c')]+'|'+_0x4536b8['ipAddress'];var _0x1274e5=crypto['createHash'](_0xe9f9('0x14'))['update'](_0x7bc655)[_0xe9f9('0x16')](_0xe9f9('0x1d'));return _0x1274e5['substring'](0x0,0x8)+'-'+_0x1274e5[_0xe9f9('0x1e')](0x8,0xc)+'-'+_0x1274e5['substring'](0xc,0x10)+'-'+_0x1274e5['substring'](0x10,0x14)+'-'+_0x1274e5[_0xe9f9('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index bd006ee..6ebbaf1 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 _0xcf2b=['./hardware','../logger','license','https://www.xcallymotion.com','format','exports','then','get','data1','data2','active','info','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','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xcf2b,0xbb));var _0xbcf2=function(_0x438434,_0x36f21f){_0x438434=_0x438434-0x0;var _0x3b97c9=_0xcf2b[_0x438434];return _0x3b97c9;};'use strict';var util=require(_0xbcf2('0x0'));var moment=require(_0xbcf2('0x1'));var rp=require(_0xbcf2('0x2'));var BPromise=require(_0xbcf2('0x3'));var pkginfo=require(_0xbcf2('0x4'))(module,_0xbcf2('0x5'));var db=require(_0xbcf2('0x6'))['db'];var encryptor=require(_0xbcf2('0x7'));var hardware=require(_0xbcf2('0x8'));var logger=require(_0xbcf2('0x9'))(_0xbcf2('0xa'));var HOST=_0xbcf2('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x264654){return new BPromise(function(_0x270966,_0xc2fde6){var _0x1e8a23=util[_0xbcf2('0xc')]('%s/api/servers/%s/check?version=%s',HOST,_0x264654,module['exports'][_0xbcf2('0x5')]);if(oldToken){_0x1e8a23=util[_0xbcf2('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x264654,module[_0xbcf2('0xd')][_0xbcf2('0x5')],oldToken);}var _0xdde7ad={'uri':_0x1e8a23,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xdde7ad)[_0xbcf2('0xe')](function(_0x41559a){_0x270966(_0x41559a);})['catch'](function(_0x7ad223){_0xc2fde6(_0x7ad223);});});}function manageLicense(_0x579224,_0x11f941){var _0x44d8ac=_0x11f941[_0xbcf2('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x44d8ac[_0xbcf2('0x10')]!==_0x579224&&!_0x44d8ac[_0xbcf2('0x11')]){oldToken=_0x44d8ac[_0xbcf2('0x10')];}httpRequest(_0x579224)['then'](function(_0x3db924){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3db924[_0xbcf2('0x12')]){isOldTokenSent=![];if(!_0x44d8ac[_0xbcf2('0xa')]&&_0x44d8ac[_0xbcf2('0xa')]!=_0x3db924[_0xbcf2('0xa')]||_0x44d8ac['license']&&_0x44d8ac[_0xbcf2('0x11')]){logger[_0xbcf2('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x44d8ac[_0xbcf2('0xa')]&&!_0x44d8ac[_0xbcf2('0x11')]&&_0x44d8ac[_0xbcf2('0xa')]!=_0x3db924[_0xbcf2('0xa')]){logger[_0xbcf2('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x44d8ac[_0xbcf2('0xa')]&&!_0x44d8ac[_0xbcf2('0x11')]&&_0x44d8ac[_0xbcf2('0xa')]==_0x3db924['license']){return _0x11f941;}return _0x11f941[_0xbcf2('0x14')]({'data1':_0x579224,'data2':null,'license':_0x3db924['license']});}else{if(_0x3db924['license']||_0x44d8ac[_0xbcf2('0xa')]){if(!_0x44d8ac[_0xbcf2('0x11')]){if(_0x44d8ac[_0xbcf2('0x10')]==_0x579224){GRAY_PERIOD_REASON=_0xbcf2('0x15');logger[_0xbcf2('0x13')](_0xbcf2('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xbcf2('0x13')](_0xbcf2('0x17'),_0x44d8ac['data1'],_0x579224);}logger[_0xbcf2('0x13')](_0xbcf2('0x18'),GRAY_PERIOD_REASON[_0xbcf2('0x19')](),moment()[_0xbcf2('0xc')](_0xbcf2('0x1a')));return _0x11f941[_0xbcf2('0x14')]({'data2':encryptor['encryptString'](moment()[_0xbcf2('0xc')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0xbcf2('0x1b')](_0x44d8ac[_0xbcf2('0x11')]),_0xbcf2('0x1c'))>DAYS){logger[_0xbcf2('0x13')](_0xbcf2('0x1d'),moment()['format'](_0xbcf2('0x1a')));isOldTokenSent=![];return _0x11f941['update']({'data1':_0x579224,'data2':null,'license':null});}}}else{if(_0x44d8ac[_0xbcf2('0x10')]!=_0x579224){logger[_0xbcf2('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x44d8ac['data1'],_0x579224);return _0x11f941[_0xbcf2('0x14')]({'data1':_0x579224,'data2':null,'license':null});}}}return _0x11f941;})[_0xbcf2('0xe')](function(_0x15243f){_0x11f941=_0x15243f;})[_0xbcf2('0x1e')](function(_0x5a4d94){logger['error'](_0x5a4d94[_0xbcf2('0x1f')]);})[_0xbcf2('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xbcf2('0x21')](),_0x11f941);},TIME);});}function defaultLicense(){var _0x2de35a=hardware[_0xbcf2('0x21')]();if(_0x2de35a){return db['License'][_0xbcf2('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x2de35a}})[_0xbcf2('0x23')](function(_0x675259,_0x117119){logger['info'](_0xbcf2('0x24'),_0x2de35a);manageLicense(_0x2de35a,_0x675259);})[_0xbcf2('0x1e')](function(_0x3d5582){logger[_0xbcf2('0x25')](_0x3d5582[_0xbcf2('0x1f')]);});}}exports[_0xbcf2('0x26')]=defaultLicense; \ No newline at end of file +var _0xfe76=['active','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1'];(function(_0x9bc911,_0x41b12a){var _0x1464be=function(_0x3a7b40){while(--_0x3a7b40){_0x9bc911['push'](_0x9bc911['shift']());}};_0x1464be(++_0x41b12a);}(_0xfe76,0x1b2));var _0x6fe7=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0xfe76[_0x2bcddb];return _0x12a9e8;};'use strict';var util=require('util');var moment=require(_0x6fe7('0x0'));var rp=require(_0x6fe7('0x1'));var BPromise=require(_0x6fe7('0x2'));var pkginfo=require(_0x6fe7('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x6fe7('0x4'));var hardware=require(_0x6fe7('0x5'));var logger=require(_0x6fe7('0x6'))('license');var HOST=_0x6fe7('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4587eb){return new BPromise(function(_0x31a621,_0x1af27e){var _0x1b35ef=util[_0x6fe7('0x8')](_0x6fe7('0x9'),HOST,_0x4587eb,module[_0x6fe7('0xa')][_0x6fe7('0xb')]);if(oldToken){_0x1b35ef=util[_0x6fe7('0x8')](_0x6fe7('0xc'),HOST,_0x4587eb,module[_0x6fe7('0xa')][_0x6fe7('0xb')],oldToken);}var _0x4d0107={'uri':_0x1b35ef,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4d0107)[_0x6fe7('0xd')](function(_0x153c2f){_0x31a621(_0x153c2f);})[_0x6fe7('0xe')](function(_0x4f945c){_0x1af27e(_0x4f945c);});});}function manageLicense(_0x4b0524,_0x3f3757){var _0x16bf2c=_0x3f3757[_0x6fe7('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x16bf2c[_0x6fe7('0x10')]!==_0x4b0524&&!_0x16bf2c['data2']){oldToken=_0x16bf2c[_0x6fe7('0x10')];}httpRequest(_0x4b0524)[_0x6fe7('0xd')](function(_0x258e7f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x258e7f[_0x6fe7('0x11')]){isOldTokenSent=![];if(!_0x16bf2c['license']&&_0x16bf2c[_0x6fe7('0x12')]!=_0x258e7f[_0x6fe7('0x12')]||_0x16bf2c[_0x6fe7('0x12')]&&_0x16bf2c[_0x6fe7('0x13')]){logger['info'](_0x6fe7('0x14'));}if(_0x16bf2c[_0x6fe7('0x12')]&&!_0x16bf2c[_0x6fe7('0x13')]&&_0x16bf2c[_0x6fe7('0x12')]!=_0x258e7f[_0x6fe7('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x16bf2c[_0x6fe7('0x12')]&&!_0x16bf2c[_0x6fe7('0x13')]&&_0x16bf2c[_0x6fe7('0x12')]==_0x258e7f[_0x6fe7('0x12')]){return _0x3f3757;}return _0x3f3757[_0x6fe7('0x15')]({'data1':_0x4b0524,'data2':null,'license':_0x258e7f[_0x6fe7('0x12')]});}else{if(_0x258e7f[_0x6fe7('0x12')]||_0x16bf2c[_0x6fe7('0x12')]){if(!_0x16bf2c['data2']){if(_0x16bf2c[_0x6fe7('0x10')]==_0x4b0524){GRAY_PERIOD_REASON='Disabled';logger[_0x6fe7('0x16')](_0x6fe7('0x17'));}else{GRAY_PERIOD_REASON=_0x6fe7('0x18');logger['info'](_0x6fe7('0x19'),_0x16bf2c['data1'],_0x4b0524);}logger[_0x6fe7('0x16')](_0x6fe7('0x1a'),GRAY_PERIOD_REASON[_0x6fe7('0x1b')](),moment()[_0x6fe7('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x3f3757[_0x6fe7('0x15')]({'data2':encryptor[_0x6fe7('0x1c')](moment()['format'](_0x6fe7('0x1d')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x16bf2c[_0x6fe7('0x13')]),_0x6fe7('0x1e'))>DAYS){logger['info'](_0x6fe7('0x1f'),moment()[_0x6fe7('0x8')](_0x6fe7('0x1d')));isOldTokenSent=![];return _0x3f3757[_0x6fe7('0x15')]({'data1':_0x4b0524,'data2':null,'license':null});}}}else{if(_0x16bf2c[_0x6fe7('0x10')]!=_0x4b0524){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x16bf2c[_0x6fe7('0x10')],_0x4b0524);return _0x3f3757[_0x6fe7('0x15')]({'data1':_0x4b0524,'data2':null,'license':null});}}}return _0x3f3757;})['then'](function(_0x28040a){_0x3f3757=_0x28040a;})[_0x6fe7('0xe')](function(_0x239aa1){logger['error'](_0x239aa1[_0x6fe7('0x20')]);})[_0x6fe7('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3f3757);},TIME);});}function defaultLicense(){var _0x5d858f=hardware[_0x6fe7('0x22')]();if(_0x5d858f){return db[_0x6fe7('0x23')][_0x6fe7('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5d858f}})[_0x6fe7('0x25')](function(_0x21d584,_0xc052fd){logger['info'](_0x6fe7('0x26'),_0x5d858f);manageLicense(_0x5d858f,_0x21d584);})[_0x6fe7('0xe')](function(_0x2a0945){logger[_0x6fe7('0x27')](_0x2a0945[_0x6fe7('0x20')]);});}}exports[_0x6fe7('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 3ad9667..590b32e 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 _0x3387=['telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','parse','demo','gray','add','days','grayReason','machineUuid','disabled','uuid','message','User','findAll','role','sequelize','COUNT','count','admin','user','telephone','users'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x3387,0x1ad));var _0x7338=function(_0x292bb4,_0x155a99){_0x292bb4=_0x292bb4-0x0;var _0x75f1cf=_0x3387[_0x292bb4];return _0x75f1cf;};'use strict';var util=require(_0x7338('0x0'));var _=require('lodash');var moment=require(_0x7338('0x1'));var BPromise=require(_0x7338('0x2'));var hardware=require(_0x7338('0x3'));var encryptor=require(_0x7338('0x4'));var db=require(_0x7338('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7338('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x7338('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7338('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7338('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1f0829){return new BPromise(function(_0x223a21,_0x45d131){return db[_0x7338('0x9')][_0x7338('0xa')](_[_0x7338('0xb')](_0x1f0829,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x27d054){return checkLicense(_0x27d054,null);})[_0x7338('0xc')](function(_0x138c57){_0x223a21(_0x138c57);return;})[_0x7338('0xd')](function(_0x157698){_0x45d131(_0x157698);});});}function checkLicense(_0x595c91,_0x4c36c6){if(!_0x595c91){demoLicense['uuid']=_0x595c91['data1'];return demoLicense;}try{var _0x1d9881=_0x4c36c6||_0x595c91['license'];if(_[_0x7338('0xe')](_0x1d9881)){throw new Error(_0x7338('0xf'));}var _0x4a7e5a=_0x595c91[_0x7338('0x10')];var _0x27a917=_0x595c91[_0x7338('0x11')];var _0x1b9040=_0x4a7e5a[_0x7338('0x12')]('-')[0x4];var _0x460c5d=_0x4a7e5a[_0x7338('0x12')]('-')[0x0];var _0xaf71ff=encryptor[_0x7338('0x13')](_0x1d9881,util[_0x7338('0x14')]('%s:%s:%s',_0x1b9040,_0x4a7e5a,_0x460c5d));var _0x22caf2=JSON[_0x7338('0x15')](_0xaf71ff);_0x22caf2[_0x7338('0x16')]=![];_0x22caf2['uuid']=_0x4a7e5a;_0x22caf2['machineUuid']=hardware[_0x7338('0x7')]();if(_0x27a917){var _0x3240d0=encryptor[_0x7338('0x13')](_0x27a917);_0x22caf2[_0x7338('0x17')]=_0x3240d0;_0x22caf2['deadline']=moment(_0x3240d0)[_0x7338('0x18')](0x7,_0x7338('0x19'))[_0x7338('0x14')]();_0x22caf2[_0x7338('0x1a')]=_0x22caf2['uuid']!=_0x22caf2[_0x7338('0x1b')]?'changed':_0x7338('0x1c');}return _0x22caf2;}catch(_0x2879fb){breakingLicense[_0x7338('0x1d')]=_0x595c91['data1'];breakingLicense[_0x7338('0x1e')]=_0x2879fb[_0x7338('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5ab460,_0x5111b3){getLicense()['then'](function(_0x475961){return db[_0x7338('0x1f')][_0x7338('0x20')]({'attributes':[_0x7338('0x21'),[db[_0x7338('0x22')]['fn'](_0x7338('0x23'),db['sequelize']['col']('role')),_0x7338('0x24')]],'group':'role','where':{'role':{'$or':[_0x7338('0x25'),_0x7338('0x26'),_0x7338('0x27')]}},'raw':!![]})[_0x7338('0xc')](function(_0x38febb){var _0x10957a={'user':_0x475961[_0x7338('0x28')]||0x0,'telephone':_0x475961[_0x7338('0x29')]||0x0};_0x38febb[_0x7338('0x2a')](function(_0x47ae45){var _0x355de4=_0x47ae45[_0x7338('0x21')]==='admin'?'user':_0x47ae45[_0x7338('0x21')];_0x10957a[_0x355de4]-=_0x47ae45['count'];if(_0x10957a[_0x355de4]<0x0)_0x10957a[_0x355de4]=0x0;});_0x5ab460(_0x10957a);return;});})[_0x7338('0xd')](function(_0x51833e){_0x5111b3(_0x51833e);});});}function checkUserLimits(_0x15b65c){return new BPromise(function(_0x2e4320,_0x57f183){getLimits()[_0x7338('0xc')](function(_0x53da96){var _0x43b247=_[_0x7338('0x2b')](_[_0x7338('0x2c')](_0x15b65c,_0x7338('0x21')),[_0x7338('0x25'),_0x7338('0x26'),_0x7338('0x27')]);var _0x3d667a=(_0x43b247['admin']||0x0)+(_0x43b247[_0x7338('0x26')]||0x0);var _0x102b16=_0x43b247['telephone']||0x0;if(_0x3d667a>_0x53da96[_0x7338('0x26')])return _0x57f183(_0x7338('0x2d'));if(_0x102b16>_0x53da96[_0x7338('0x27')])return _0x57f183(_0x7338('0x2e'));return _0x2e4320();})['catch'](function(_0xa2d231){_0x57f183(_0xa2d231);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xac1e=['lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','License','find','defaults','then','uuid','data1','license','License\x20key\x20value\x20not\x20found','split','format','%s:%s:%s','parse','demo','gray','deadline','add','days','machineUuid','changed','disabled','message','sequelize','COUNT','col','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','exports','util'];(function(_0x497967,_0x104711){var _0x2fc6f1=function(_0xc180fb){while(--_0xc180fb){_0x497967['push'](_0x497967['shift']());}};_0x2fc6f1(++_0x104711);}(_0xac1e,0x113));var _0xeac1=function(_0x9e541,_0x11053c){_0x9e541=_0x9e541-0x0;var _0x92caab=_0xac1e[_0x9e541];return _0x92caab;};'use strict';var util=require(_0xeac1('0x0'));var _=require(_0xeac1('0x1'));var moment=require(_0xeac1('0x2'));var BPromise=require(_0xeac1('0x3'));var hardware=require(_0xeac1('0x4'));var encryptor=require(_0xeac1('0x5'));var db=require(_0xeac1('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xeac1('0x7'),'machineUuid':hardware[_0xeac1('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2801be){return new BPromise(function(_0x2c10b6,_0x21acd5){return db[_0xeac1('0x9')][_0xeac1('0xa')](_[_0xeac1('0xb')](_0x2801be,{'raw':!![],'where':{'id':0x1}}))[_0xeac1('0xc')](function(_0x582d05){return checkLicense(_0x582d05,null);})[_0xeac1('0xc')](function(_0x6c5450){_0x2c10b6(_0x6c5450);return;})['catch'](function(_0x25c66d){_0x21acd5(_0x25c66d);});});}function checkLicense(_0x524700,_0x4cf76f){if(!_0x524700){demoLicense[_0xeac1('0xd')]=_0x524700[_0xeac1('0xe')];return demoLicense;}try{var _0x43a730=_0x4cf76f||_0x524700[_0xeac1('0xf')];if(_['isEmpty'](_0x43a730)){throw new Error(_0xeac1('0x10'));}var _0x7b3c5=_0x524700[_0xeac1('0xe')];var _0x413705=_0x524700['data2'];var _0x2df7ff=_0x7b3c5[_0xeac1('0x11')]('-')[0x4];var _0x2d4374=_0x7b3c5[_0xeac1('0x11')]('-')[0x0];var _0x3e8b6e=encryptor['decryptString'](_0x43a730,util[_0xeac1('0x12')](_0xeac1('0x13'),_0x2df7ff,_0x7b3c5,_0x2d4374));var _0x4683f4=JSON[_0xeac1('0x14')](_0x3e8b6e);_0x4683f4[_0xeac1('0x15')]=![];_0x4683f4[_0xeac1('0xd')]=_0x7b3c5;_0x4683f4['machineUuid']=hardware[_0xeac1('0x8')]();if(_0x413705){var _0x404f72=encryptor['decryptString'](_0x413705);_0x4683f4[_0xeac1('0x16')]=_0x404f72;_0x4683f4[_0xeac1('0x17')]=moment(_0x404f72)[_0xeac1('0x18')](0x7,_0xeac1('0x19'))[_0xeac1('0x12')]();_0x4683f4['grayReason']=_0x4683f4[_0xeac1('0xd')]!=_0x4683f4[_0xeac1('0x1a')]?_0xeac1('0x1b'):_0xeac1('0x1c');}return _0x4683f4;}catch(_0x2e0997){breakingLicense[_0xeac1('0xd')]=_0x524700[_0xeac1('0xe')];breakingLicense[_0xeac1('0x1d')]=_0x2e0997[_0xeac1('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xbeadcd,_0x4f4031){getLicense()[_0xeac1('0xc')](function(_0x4109a9){return db['User']['findAll']({'attributes':['role',[db[_0xeac1('0x1e')]['fn'](_0xeac1('0x1f'),db[_0xeac1('0x1e')][_0xeac1('0x20')](_0xeac1('0x21'))),_0xeac1('0x22')]],'group':_0xeac1('0x21'),'where':{'role':{'$or':[_0xeac1('0x23'),_0xeac1('0x24'),_0xeac1('0x25')]}},'raw':!![]})[_0xeac1('0xc')](function(_0x175c40){var _0xedb9b9={'user':_0x4109a9[_0xeac1('0x26')]||0x0,'telephone':_0x4109a9[_0xeac1('0x27')]||0x0};_0x175c40[_0xeac1('0x28')](function(_0x1a0976){var _0xb55080=_0x1a0976[_0xeac1('0x21')]==='admin'?'user':_0x1a0976[_0xeac1('0x21')];_0xedb9b9[_0xb55080]-=_0x1a0976[_0xeac1('0x22')];if(_0xedb9b9[_0xb55080]<0x0)_0xedb9b9[_0xb55080]=0x0;});_0xbeadcd(_0xedb9b9);return;});})['catch'](function(_0x3af788){_0x4f4031(_0x3af788);});});}function checkUserLimits(_0x2dc1b9){return new BPromise(function(_0x27c52b,_0x3c1cb8){getLimits()[_0xeac1('0xc')](function(_0x261ed2){var _0x1a0a1d=_['pick'](_[_0xeac1('0x29')](_0x2dc1b9,_0xeac1('0x21')),[_0xeac1('0x23'),_0xeac1('0x24'),_0xeac1('0x25')]);var _0xcd9a4b=(_0x1a0a1d[_0xeac1('0x23')]||0x0)+(_0x1a0a1d[_0xeac1('0x24')]||0x0);var _0x3aa889=_0x1a0a1d[_0xeac1('0x25')]||0x0;if(_0xcd9a4b>_0x261ed2[_0xeac1('0x24')])return _0x3c1cb8(_0xeac1('0x2a'));if(_0x3aa889>_0x261ed2['telephone'])return _0x3c1cb8(_0xeac1('0x2b'));return _0x27c52b();})[_0xeac1('0x2c')](function(_0x537a18){_0x3c1cb8(_0x537a18);});});}module[_0xeac1('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index c95cc22..c18f6d8 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 _0xb03e=['myappanuglar-secret','app-id','secret','http://localhost:9000'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1763d6,_0x5444e2){_0x1763d6=_0x1763d6-0x0;var _0x1e6398=_0xb03e[_0x1763d6];return _0x1e6398;};'use strict';module['exports']={'DOMAIN':_0xeb03('0x0'),'SESSION_SECRET':_0xeb03('0x1'),'GOOGLE_ID':_0xeb03('0x2'),'GOOGLE_SECRET':_0xeb03('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xfef3=['secret','exports','myappanuglar-secret'];(function(_0x127f21,_0xc7f762){var _0x270ffb=function(_0xe0f1d){while(--_0xe0f1d){_0x127f21['push'](_0x127f21['shift']());}};_0x270ffb(++_0xc7f762);}(_0xfef3,0x118));var _0x3fef=function(_0x3ccc5f,_0x17ba72){_0x3ccc5f=_0x3ccc5f-0x0;var _0x15de37=_0xfef3[_0x3ccc5f];return _0x15de37;};'use strict';module[_0x3fef('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3fef('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x3fef('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 919477d..f6a6966 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x469a=['exports','../utils/loggers','fileLogger'];(function(_0x4f4ef3,_0x46d544){var _0x8820e9=function(_0x3a2254){while(--_0x3a2254){_0x4f4ef3['push'](_0x4f4ef3['shift']());}};_0x8820e9(++_0x46d544);}(_0x469a,0x157));var _0xa469=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x469a[_0x5317b5];return _0x3b7ce2;};'use strict';var fileLogger=require(_0xa469('0x0'))[_0xa469('0x1')];module[_0xa469('0x2')]=fileLogger; \ No newline at end of file +var _0x118e=['fileLogger','exports','../utils/loggers'];(function(_0x21a08c,_0x5272f2){var _0x2da17a=function(_0x3173d6){while(--_0x3173d6){_0x21a08c['push'](_0x21a08c['shift']());}};_0x2da17a(++_0x5272f2);}(_0x118e,0xe0));var _0xe118=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x118e[_0x3a0ebd];return _0x51a660;};'use strict';var fileLogger=require(_0xe118('0x0'))[_0xe118('0x1')];module[_0xe118('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a9e404b..60025bf 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 _0x55c6=['path','../../config/environment','resolve','express','join','../../services/express/index.js','ami','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55c6,0x90));var _0x655c=function(_0x43dd6d,_0x35c792){_0x43dd6d=_0x43dd6d-0x0;var _0x2b9859=_0x55c6[_0x43dd6d];return _0x2b9859;};'use strict';var path=require(_0x655c('0x0'));var cfg=require(_0x655c('0x1'));var env={'NODE_PATH':path[_0x655c('0x2')](path['join'](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':_0x655c('0x3'),'script':path[_0x655c('0x4')](__dirname,_0x655c('0x5')),'env':env},{'name':_0x655c('0x6'),'script':path[_0x655c('0x4')](__dirname,'../../services/ami/index.js'),'env':env},{'name':'agi','script':path[_0x655c('0x4')](__dirname,'../../services/agi/index.js'),'env':env},{'name':'email','script':path[_0x655c('0x4')](__dirname,_0x655c('0x7')),'env':env},{'name':_0x655c('0x8'),'script':path[_0x655c('0x4')](__dirname,_0x655c('0x9')),'env':env},{'name':_0x655c('0xa'),'script':path[_0x655c('0x4')](__dirname,_0x655c('0xb')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xaa9f=['../../services/xdr/index.js','exports','../../config/environment','resolve','join','root','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js'];(function(_0x3bca4d,_0x2cd671){var _0x3487db=function(_0x2cb883){while(--_0x2cb883){_0x3bca4d['push'](_0x3bca4d['shift']());}};_0x3487db(++_0x2cd671);}(_0xaa9f,0x16a));var _0xfaa9=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0xaa9f[_0x9307ea];return _0x295554;};'use strict';var path=require('path');var cfg=require(_0xfaa9('0x0'));var env={'NODE_PATH':path[_0xfaa9('0x1')](path[_0xfaa9('0x2')](cfg[_0xfaa9('0x3')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xfaa9('0x4'),'script':path[_0xfaa9('0x2')](__dirname,_0xfaa9('0x5')),'env':env},{'name':_0xfaa9('0x6'),'script':path[_0xfaa9('0x2')](__dirname,_0xfaa9('0x7')),'env':env},{'name':_0xfaa9('0x8'),'script':path[_0xfaa9('0x2')](__dirname,_0xfaa9('0x9')),'env':env},{'name':_0xfaa9('0xa'),'script':path[_0xfaa9('0x2')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xfaa9('0xb'),'script':path[_0xfaa9('0x2')](__dirname,_0xfaa9('0xc')),'env':env},{'name':'xdr','script':path['join'](__dirname,_0xfaa9('0xd')),'env':env}]};module[_0xfaa9('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2a4aeb6..71be61e 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 _0xadf9=['describe','delete','dump','saved','pm2','bluebird','connect','connected','then','start','disconnect','stop','restart','list'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xadf9,0x11c));var _0x9adf=function(_0x5f48c4,_0x1298b6){_0x5f48c4=_0x5f48c4-0x0;var _0x25fec6=_0xadf9[_0x5f48c4];return _0x25fec6;};'use strict';var pm2=require(_0x9adf('0x0'));var BPromise=require(_0x9adf('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x3c9d3e,_0x50fac3){return pm2[_0x9adf('0x2')](function(_0x2a3fb5){if(_0x2a3fb5){return _0x50fac3(_0x2a3fb5);}return _0x3c9d3e(_0x9adf('0x3'));});});};exports['start']=function(_0x178803){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x2de93c,_0x1cdd93){return pm2[_0x9adf('0x5')](_0x178803,function(_0x21ebce,_0x2da3f1){if(_0x21ebce){return _0x1cdd93(_0x21ebce);}pm2[_0x9adf('0x6')]();return _0x2de93c(_0x2da3f1);});});});};exports['stop']=function(_0x1b0a85){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x3493c3,_0x149030){return pm2[_0x9adf('0x7')](_0x1b0a85,function(_0x3edeb6,_0x103fea){if(_0x3edeb6){return _0x149030(_0x3edeb6);}pm2[_0x9adf('0x6')]();return _0x3493c3(_0x103fea);});});});};exports[_0x9adf('0x8')]=function(_0x2159ff){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x466dcd,_0xb6f271){return pm2[_0x9adf('0x8')](_0x2159ff,function(_0x5f1b56,_0x2453cf){if(_0x5f1b56){return _0xb6f271(_0x5f1b56);}pm2[_0x9adf('0x6')]();return _0x466dcd(_0x2453cf);});});});};exports[_0x9adf('0x9')]=function(){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x2d9187,_0x26abc6){return pm2['list'](function(_0xcd0d70,_0x6ab0d9){if(_0xcd0d70){return _0x26abc6(_0xcd0d70);}pm2[_0x9adf('0x6')]();return _0x2d9187(_0x6ab0d9);});});});};exports['describe']=function(_0x40cfe7){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x30de8b,_0x2962f9){return pm2[_0x9adf('0xa')](_0x40cfe7,function(_0x458826,_0x3e1541){if(_0x458826){return _0x2962f9(_0x458826);}pm2[_0x9adf('0x6')]();return _0x30de8b(_0x3e1541);});});});};exports[_0x9adf('0xb')]=function(_0x3a23f8){return connect()[_0x9adf('0x4')](function(){return new BPromise(function(_0x20bd20,_0x5512d){return pm2[_0x9adf('0xb')](_0x3a23f8,function(_0x5b71e9,_0xcbbfef){if(_0x5b71e9){return _0x5512d(_0x5b71e9);}pm2[_0x9adf('0x6')]();return _0x20bd20(_0xcbbfef);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x4b1fc7,_0x4b3fc4){return pm2[_0x9adf('0xc')](function(_0x1e31a3){if(_0x1e31a3){return _0x4b3fc4(_0x1e31a3);}return _0x4b1fc7(_0x9adf('0xd'));});});});}; \ No newline at end of file +var _0xd0c2=['bluebird','./config','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x50b30c,_0x559df3){var _0x450521=function(_0x46d094){while(--_0x46d094){_0x50b30c['push'](_0x50b30c['shift']());}};_0x450521(++_0x559df3);}(_0xd0c2,0x7d));var _0x2d0c=function(_0x7f1405,_0x30610b){_0x7f1405=_0x7f1405-0x0;var _0x1093b5=_0xd0c2[_0x7f1405];return _0x1093b5;};'use strict';var pm2=require(_0x2d0c('0x0'));var BPromise=require(_0x2d0c('0x1'));var config=require(_0x2d0c('0x2'));function connect(){return new BPromise(function(_0x11adae,_0x1eb62e){return pm2['connect'](function(_0x1177d9){if(_0x1177d9){return _0x1eb62e(_0x1177d9);}return _0x11adae(_0x2d0c('0x3'));});});};exports[_0x2d0c('0x4')]=function(_0x2f6ec3){return connect()[_0x2d0c('0x5')](function(){return new BPromise(function(_0x452248,_0xc11db4){return pm2[_0x2d0c('0x4')](_0x2f6ec3,function(_0x4cba65,_0x281330){if(_0x4cba65){return _0xc11db4(_0x4cba65);}pm2[_0x2d0c('0x6')]();return _0x452248(_0x281330);});});});};exports[_0x2d0c('0x7')]=function(_0x8b897d){return connect()[_0x2d0c('0x5')](function(){return new BPromise(function(_0x13bff3,_0x1b1ff0){return pm2['stop'](_0x8b897d,function(_0x599cdd,_0x4301f7){if(_0x599cdd){return _0x1b1ff0(_0x599cdd);}pm2[_0x2d0c('0x6')]();return _0x13bff3(_0x4301f7);});});});};exports['restart']=function(_0x461b02){return connect()[_0x2d0c('0x5')](function(){return new BPromise(function(_0x324aef,_0x39dcf8){return pm2[_0x2d0c('0x8')](_0x461b02,function(_0x57d532,_0x4687c){if(_0x57d532){return _0x39dcf8(_0x57d532);}pm2[_0x2d0c('0x6')]();return _0x324aef(_0x4687c);});});});};exports[_0x2d0c('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x565618,_0x2a749c){return pm2['list'](function(_0x858821,_0x90338e){if(_0x858821){return _0x2a749c(_0x858821);}pm2[_0x2d0c('0x6')]();return _0x565618(_0x90338e);});});});};exports[_0x2d0c('0xa')]=function(_0x4924fa){return connect()[_0x2d0c('0x5')](function(){return new BPromise(function(_0x4caa8d,_0x524995){return pm2[_0x2d0c('0xa')](_0x4924fa,function(_0x114b4f,_0x462f64){if(_0x114b4f){return _0x524995(_0x114b4f);}pm2[_0x2d0c('0x6')]();return _0x4caa8d(_0x462f64);});});});};exports[_0x2d0c('0xb')]=function(_0x44a751){return connect()[_0x2d0c('0x5')](function(){return new BPromise(function(_0x25aff7,_0x44e397){return pm2[_0x2d0c('0xb')](_0x44a751,function(_0x53fa8a,_0x2af2c7){if(_0x53fa8a){return _0x44e397(_0x53fa8a);}pm2[_0x2d0c('0x6')]();return _0x25aff7(_0x2af2c7);});});});};exports[_0x2d0c('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x6115d2,_0x27fc08){return pm2[_0x2d0c('0xc')](function(_0x23c44b){if(_0x23c44b){return _0x27fc08(_0x23c44b);}return _0x6115d2(_0x2d0c('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 9311fc5..5aac550 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 _0xbc84=['localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis','defaults'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xbc84,0xa2));var _0x4bc8=function(_0x57c0ee,_0x2af491){_0x57c0ee=_0x57c0ee-0x0;var _0x610aa=_0xbc84[_0x57c0ee];return _0x610aa;};'use strict';var _=require(_0x4bc8('0x0'));var moment=require(_0x4bc8('0x1'));var Redis=require(_0x4bc8('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x4bc8('0x3'))['db'];var logger=require(_0x4bc8('0x4'))(_0x4bc8('0x5'));config[_0x4bc8('0x6')]=_[_0x4bc8('0x7')](config['redis'],{'host':_0x4bc8('0x8'),'port':0x18eb});var io=require(_0x4bc8('0x9'))(new Redis(config[_0x4bc8('0x6')]));function closeInteractions(){var _0x59741b=0x0;var _0x9b6cb=[];return db[_0x4bc8('0xa')][_0x4bc8('0xb')]({'raw':!![],'attributes':['id',_0x4bc8('0xc')],'where':{'id':0x1}})[_0x4bc8('0xd')](function(_0x43bef2){_0x59741b=_0x43bef2[_0x4bc8('0xc')];if(_0x59741b){return db[_0x4bc8('0xe')][_0x4bc8('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4bc8('0x10')](_0x43bef2[_0x4bc8('0xc')],_0x4bc8('0x11'))}}});}else{return[];}})[_0x4bc8('0xd')](function(_0x34a34d){if(_0x34a34d&&_0x34a34d[_0x4bc8('0x12')]){_0x9b6cb=_[_0x4bc8('0x13')](_0x34a34d||[],'id');logger[_0x4bc8('0x14')](_0x4bc8('0x15'),_0x9b6cb['join']());return db[_0x4bc8('0xe')][_0x4bc8('0x16')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x4bc8('0x17')](_0x4bc8('0x18'))},{'where':{'id':_0x9b6cb}});}})[_0x4bc8('0xd')](function(){if(_0x9b6cb&&_0x9b6cb[_0x4bc8('0x12')]){logger[_0x4bc8('0x14')](_0x4bc8('0x19'),_0x9b6cb[_0x4bc8('0x1a')]());for(var _0x2cbf30=0x0;_0x2cbf30<_0x9b6cb[_0x4bc8('0x12')];_0x2cbf30++){io[_0x4bc8('0x1b')](_0x4bc8('0x1c'),{'id':_0x9b6cb[_0x2cbf30],'closed':!![]});}}})[_0x4bc8('0x1d')](function(_0x267fff){logger[_0x4bc8('0x1e')](_0x4bc8('0x1f'),_0x267fff?util[_0x4bc8('0x20')](_0x267fff,{'showHidden':![],'depth':null}):'');});}exports[_0x4bc8('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3537=['defaults','find','then','chatTimeout','lastMsgAt','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','schedule','redis'];(function(_0x4dfead,_0x54db03){var _0x5da818=function(_0x217ce3){while(--_0x217ce3){_0x4dfead['push'](_0x4dfead['shift']());}};_0x5da818(++_0x54db03);}(_0x3537,0x1df));var _0x7353=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x3537[_0x3e6729];return _0x535bcd;};'use strict';var _=require(_0x7353('0x0'));var moment=require(_0x7353('0x1'));var Redis=require(_0x7353('0x2'));var util=require(_0x7353('0x3'));var config=require(_0x7353('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x7353('0x5'));config[_0x7353('0x6')]=_[_0x7353('0x7')](config[_0x7353('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x44af72=0x0;var _0x3e9bc3=[];return db['Setting'][_0x7353('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x7353('0x9')](function(_0x425331){_0x44af72=_0x425331[_0x7353('0xa')];if(_0x44af72){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x7353('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x425331[_0x7353('0xa')],_0x7353('0xc'))}}});}else{return[];}})['then'](function(_0x518b6d){if(_0x518b6d&&_0x518b6d[_0x7353('0xd')]){_0x3e9bc3=_[_0x7353('0xe')](_0x518b6d||[],'id');logger[_0x7353('0xf')](_0x7353('0x10'),_0x3e9bc3['join']());return db['ChatInteraction'][_0x7353('0x11')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x7353('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3e9bc3}});}})[_0x7353('0x9')](function(){if(_0x3e9bc3&&_0x3e9bc3['length']){logger[_0x7353('0xf')](_0x7353('0x13'),_0x3e9bc3[_0x7353('0x14')]());for(var _0x311db1=0x0;_0x311db1<_0x3e9bc3[_0x7353('0xd')];_0x311db1++){io[_0x7353('0x15')](_0x7353('0x16'),{'id':_0x3e9bc3[_0x311db1],'closed':!![]});}}})[_0x7353('0x17')](function(_0x446e8f){logger[_0x7353('0x18')](_0x7353('0x19'),_0x446e8f?util[_0x7353('0x1a')](_0x446e8f,{'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 9d7204a..47b22b3 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 _0x9537=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3b4ee5,_0x573fc6){var _0x474303=function(_0x3ce0e4){while(--_0x3ce0e4){_0x3b4ee5['push'](_0x3b4ee5['shift']());}};_0x474303(++_0x573fc6);}(_0x9537,0x1b1));var _0x7953=function(_0x4f83ea,_0x4b484e){_0x4f83ea=_0x4f83ea-0x0;var _0x3e41f6=_0x9537[_0x4f83ea];return _0x3e41f6;};'use strict';function start(){var _0x2c5eed=require(_0x7953('0x0'));return _0x2c5eed[_0x7953('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xd737=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x160eb5,_0x191ca9){var _0x33d9f5=function(_0x349d40){while(--_0x349d40){_0x160eb5['push'](_0x160eb5['shift']());}};_0x33d9f5(++_0x191ca9);}(_0xd737,0x144));var _0x7d73=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0xd737[_0xe6f4ef];return _0x4f3447;};'use strict';function start(){var _0x5957e0=require(_0x7d73('0x0'));return _0x5957e0['startAllRefreshIntervals']();}module[_0x7d73('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 4ea63ad..a882c5f 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 _0xe64c=['keys','jobs','map','toString','keyBy','difference','intersection','length','exists','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop','startAt','update\x20cron','stop\x20cron','path','moment','bluebird','../logger','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','join','%s.%s','basename','savename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','request','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xe64c,0x10c));var _0xce64=function(_0x206afd,_0xddc2de){_0x206afd=_0x206afd-0x0;var _0x4311b7=_0xe64c[_0x206afd];return _0x4311b7;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xce64('0x0'));var _=require('lodash');var moment=require(_0xce64('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xce64('0x2'));var logger=require(_0xce64('0x3'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xce64('0x4')][_0xce64('0x5')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x49981c,_0x139e34){return function(){logger[_0xce64('0x6')](_0xce64('0x7'),_0x49981c[_0xce64('0x8')]);var _0x492db0=!![];var _0x4cf446=_0x49981c['MailAccount'][_0xce64('0x9')]();var _0x3788a9={'account':_0x4cf446,'message':{'from':util['format'](_0xce64('0xa'),_0x49981c[_0xce64('0xb')][_0xce64('0xc')],_0x49981c['MailAccount']['email']||_0x49981c[_0xce64('0xb')][_0xce64('0xd')][_0xce64('0xe')]),'to':_0x49981c[_0xce64('0x8')],'cc':_0x49981c['cc'],'bcc':_0x49981c[_0xce64('0xf')],'subject':util[_0xce64('0x10')](_0xce64('0x11'),_0x139e34['name'],_0x49981c['subtractNumber'],_0x49981c['subtractUnit'])}};var _0x583315=path[_0xce64('0x12')](__dirname,'../../files/reports');var _0x2de4d2=_0x139e34['savename'];var _0x117331=util[_0xce64('0x10')](_0xce64('0x13'),path[_0xce64('0x14')](_0x139e34['savename'],path['extname'](_0x139e34[_0xce64('0x15')])),_0xce64('0x16'));var _0x346663=path['join'](_0x583315,_0x2de4d2);var _0x4206b3=path[_0xce64('0x12')](_0x583315,_0x117331);if(fs[_0xce64('0x17')](_0x346663)){_0x139e34[_0xce64('0x18')]=_0xce64('0x19');_0x3788a9[_0xce64('0x1a')][_0xce64('0x1b')]=[{'filename':_0x2de4d2,'path':_0x346663}];_0x3788a9['message'][_0xce64('0x1c')]=util[_0xce64('0x10')](_0xce64('0x1d'),JSON[_0xce64('0x1e')](_0x139e34,null,0x2));}else if(fs[_0xce64('0x17')](_0x4206b3)){_0x139e34[_0xce64('0x18')]=_0xce64('0x19');_0x3788a9[_0xce64('0x1a')]['attachments']=[{'filename':_0x117331,'path':_0x4206b3}];}else{_0x3788a9[_0xce64('0x1a')][_0xce64('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x49981c[_0xce64('0x1f')]){_0x492db0=![];logger[_0xce64('0x6')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x492db0){return client[_0xce64('0x20')](_0xce64('0x21'),_0x3788a9)[_0xce64('0x22')](function(_0x1c6ca8){if(_0x1c6ca8[_0xce64('0x23')]){return logger['error']('error\x20mail',JSON[_0xce64('0x1e')](_0x1c6ca8));}return logger[_0xce64('0x6')]('email\x20sent');})[_0xce64('0x24')](function(_0x103e62){return logger['error'](_0xce64('0x25'),JSON['stringify'](_0x103e62));});}};}function handleError(){return function(_0x6aabf0){return logger[_0xce64('0x23')](JSON[_0xce64('0x1e')](_0x6aabf0));};}function handleResult(_0x47c2d5){return function(_0x2510d4){logger['info'](_0xce64('0x26'),JSON[_0xce64('0x1e')](_0x2510d4));if(_0x47c2d5[_0xce64('0xb')]&&_0x47c2d5['MailAccount'][_0xce64('0xd')]&&!_[_0xce64('0x27')](_0x47c2d5[_0xce64('0x8')])){setTimeout(handleSendEmail(_0x47c2d5,_0x2510d4),0x3c*0x3e8);}};}function handleJob(_0x35ac1d){return function(){try{if(_[_0xce64('0x27')](_0x35ac1d[_0xce64('0x28')])){return logger[_0xce64('0x6')](_0xce64('0x29'));}if(_[_0xce64('0x27')](_0x35ac1d['subtractUnit'])){return logger['info'](_0xce64('0x2a'));}var _0x18ab62={'startDate':moment()[_0xce64('0x2b')](_0x35ac1d[_0xce64('0x28')],_0x35ac1d['subtractUnit'])['format'](_0xce64('0x2c')),'endDate':moment()[_0xce64('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x35ac1d[_0xce64('0x2d')],'name':_0x35ac1d[_0xce64('0xc')]};if(!_[_0xce64('0x27')](_0x35ac1d[_0xce64('0x2e')])){logger[_0xce64('0x6')](_0xce64('0x2f'),_0x35ac1d[_0xce64('0x2e')]);return analyticDefaultReportController[_0xce64('0x30')]({'id':_0x35ac1d[_0xce64('0x2e')]},_0x18ab62)[_0xce64('0x22')](handleResult(_0x35ac1d))[_0xce64('0x24')](handleError());}if(!_[_0xce64('0x27')](_0x35ac1d[_0xce64('0x31')])){logger[_0xce64('0x6')](_0xce64('0x32'),_0x35ac1d[_0xce64('0x31')]);return analyticCustomReportController[_0xce64('0x30')]({'id':_0x35ac1d[_0xce64('0x31')]},_0x18ab62)[_0xce64('0x22')](handleResult(_0x35ac1d))['catch'](handleError());}}catch(_0x10518c){logger[_0xce64('0x23')](JSON['stringify'](_0x10518c));}return logger['info'](_0xce64('0x33'));};}function getJobs(_0x1ff8ae){var _0x248a74={};if(_0x1ff8ae){_0x248a74['id']=_0x1ff8ae;}return db[_0xce64('0x34')][_0xce64('0x35')]({'where':_0x248a74,'include':[{'model':db[_0xce64('0xb')],'attributes':['id',_0xce64('0xc'),_0xce64('0x8')],'include':[{'model':db[_0xce64('0x36')],'as':_0xce64('0xd'),'include':[{'model':db['CloudProvider'],'as':_0xce64('0x37')}]}]}]})[_0xce64('0x22')](function(_0x16c030){var _0x1ec901=_[_0xce64('0x38')](manager[_0xce64('0x39')]);var _0x1abede=_[_0xce64('0x3a')](_0x16c030,function(_0x9205a4){return _0x9205a4['id'][_0xce64('0x3b')]();});var _0x37da52=_[_0xce64('0x3c')](_0x16c030,function(_0x2655b2){return _0x2655b2['id'][_0xce64('0x3b')]();});var _0x43a11d=_0x1ff8ae?_0x1abede:_[_0xce64('0x3d')](_0x1abede,_0x1ec901);var _0x2faafc=_[_0xce64('0x3e')](_0x1abede,_0x1ec901);var _0x3a86e0=_[_0xce64('0x3d')](_0x1ec901,_0x1abede);var _0x34d773;var _0x2d0c7b;for(_0x34d773=0x0;_0x34d773<_0x3a86e0[_0xce64('0x3f')]&&!_0x1ff8ae;_0x34d773+=0x1){_0x2d0c7b=_0x3a86e0[_0x34d773][_0xce64('0x3b')]();if(manager[_0xce64('0x40')](_0x2d0c7b)){manager['stop'](_0x2d0c7b);manager['deleteJob'](_0x2d0c7b);logger[_0xce64('0x6')](_0xce64('0x41'),_0x2d0c7b);}}logger['info'](_0xce64('0x42'),JSON[_0xce64('0x1e')](_0x43a11d));for(_0x34d773=0x0;_0x34d773<_0x43a11d['length'];_0x34d773+=0x1){_0x2d0c7b=_0x43a11d[_0x34d773][_0xce64('0x3b')]();logger[_0xce64('0x6')](_0xce64('0x43'),_0x2d0c7b);if(_0x1ff8ae){logger[_0xce64('0x6')]('my\x20id',_0x1ff8ae);logger['info'](JSON[_0xce64('0x1e')](_0x37da52[_0x2d0c7b]));BPromise[_0xce64('0x44')]()[_0xce64('0x22')](handleJob(_0x37da52[_0x2d0c7b]));logger[_0xce64('0x6')](_0xce64('0x45'),_0x37da52[_0x2d0c7b][_0xce64('0xc')],_0x37da52[_0x2d0c7b][_0xce64('0x46')]);}else if(_0x37da52[_0x2d0c7b]['cron']&&_0x37da52[_0x2d0c7b][_0xce64('0x47')]&&moment()[_0xce64('0x48')](_0x37da52[_0x2d0c7b]['startAt'],_0x37da52[_0x2d0c7b][_0xce64('0x49')])){manager[_0xce64('0x4a')](_0x2d0c7b,_0x37da52[_0x2d0c7b][_0xce64('0x46')],handleJob(_0x37da52[_0x2d0c7b]));manager[_0xce64('0x4b')](_0x2d0c7b);logger['info'](_0xce64('0x4c'),_0x37da52[_0x2d0c7b][_0xce64('0xc')],_0x37da52[_0x2d0c7b][_0xce64('0x46')]);}else if(manager['exists'](_0x2d0c7b)){manager[_0xce64('0x4d')](_0x2d0c7b);manager['deleteJob'](_0x2d0c7b);logger['info']('stop\x20cron',_0x37da52[_0x2d0c7b]['name'],_0x37da52[_0x2d0c7b][_0xce64('0x46')]);}}for(_0x34d773=0x0,_0x2d0c7b;_0x34d773<_0x2faafc['length']&&!_0x1ff8ae;_0x34d773+=0x1){_0x2d0c7b=_0x2faafc[_0x34d773]['toString']();if(manager['exists'](_0x2d0c7b)){if(_0x37da52[_0x2d0c7b][_0xce64('0x46')]&&_0x37da52[_0x2d0c7b][_0xce64('0x47')]&&moment()['isBetween'](_0x37da52[_0x2d0c7b][_0xce64('0x4e')],_0x37da52[_0x2d0c7b]['endAt'])){manager['update'](_0x2d0c7b,_0x37da52[_0x2d0c7b][_0xce64('0x46')],handleJob(_0x37da52[_0x2d0c7b]));logger['info'](_0xce64('0x4f'),_0x37da52[_0x2d0c7b][_0xce64('0xc')],_0x37da52[_0x2d0c7b][_0xce64('0x46')]);}else{manager['stop'](_0x2d0c7b);manager['deleteJob'](_0x2d0c7b);logger[_0xce64('0x6')](_0xce64('0x50'),_0x37da52[_0x2d0c7b][_0xce64('0xc')],_0x37da52[_0x2d0c7b][_0xce64('0x46')]);}}}})[_0xce64('0x24')](function(_0x26dd36){logger[_0xce64('0x23')](JSON[_0xce64('0x1e')](_0x26dd36));});}exports['run']=function(_0x3e3920){return getJobs(_0x3e3920);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x6005=['MailAccount','getSmtpOptions','format','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','sendIfEmpty','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','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','stop','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','startAt','endAt','add','start','exists','isBetween','update\x20cron','deleteJob','stop\x20cron','run','path','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0x6005,0xee));var _0x5600=function(_0x281f90,_0x1b6082){_0x281f90=_0x281f90-0x0;var _0x1fc23c=_0x6005[_0x281f90];return _0x1fc23c;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x5600('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x5600('0x1'));var BPromise=require(_0x5600('0x2'));var logger=require(_0x5600('0x3'))(_0x5600('0x4'));var db=require(_0x5600('0x5'))['db'];var analyticCustomReportController=require(_0x5600('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x5600('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x23f92f,_0x1a4518){return function(){logger[_0x5600('0x8')](_0x5600('0x9'),_0x23f92f[_0x5600('0xa')]);var _0x4caed3=!![];var _0x275586=_0x23f92f[_0x5600('0xb')][_0x5600('0xc')]();var _0x538a2a={'account':_0x275586,'message':{'from':util[_0x5600('0xd')]('\x22%s\x22\x20<%s>',_0x23f92f[_0x5600('0xb')][_0x5600('0xe')],_0x23f92f['MailAccount'][_0x5600('0xa')]||_0x23f92f[_0x5600('0xb')][_0x5600('0xf')][_0x5600('0x10')]),'to':_0x23f92f[_0x5600('0xa')],'cc':_0x23f92f['cc'],'bcc':_0x23f92f['bcc'],'subject':util[_0x5600('0xd')](_0x5600('0x11'),_0x1a4518[_0x5600('0xe')],_0x23f92f[_0x5600('0x12')],_0x23f92f[_0x5600('0x13')])}};var _0x4e2164=path[_0x5600('0x14')](__dirname,_0x5600('0x15'));var _0x23adbf=_0x1a4518[_0x5600('0x16')];var _0x2f8640=util['format'](_0x5600('0x17'),path[_0x5600('0x18')](_0x1a4518[_0x5600('0x16')],path[_0x5600('0x19')](_0x1a4518[_0x5600('0x16')])),_0x5600('0x1a'));var _0x425502=path[_0x5600('0x14')](_0x4e2164,_0x23adbf);var _0x48cca0=path[_0x5600('0x14')](_0x4e2164,_0x2f8640);if(fs[_0x5600('0x1b')](_0x425502)){_0x1a4518['status']=_0x5600('0x1c');_0x538a2a['message'][_0x5600('0x1d')]=[{'filename':_0x23adbf,'path':_0x425502}];_0x538a2a[_0x5600('0x1e')][_0x5600('0x1f')]=util[_0x5600('0xd')](_0x5600('0x20'),JSON[_0x5600('0x21')](_0x1a4518,null,0x2));}else if(fs[_0x5600('0x1b')](_0x48cca0)){_0x1a4518[_0x5600('0x22')]='Sent';_0x538a2a['message'][_0x5600('0x1d')]=[{'filename':_0x2f8640,'path':_0x48cca0}];}else{_0x538a2a[_0x5600('0x1e')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x23f92f[_0x5600('0x23')]){_0x4caed3=![];logger[_0x5600('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x4caed3){return client[_0x5600('0x24')](_0x5600('0x25'),_0x538a2a)[_0x5600('0x26')](function(_0x53fca7){if(_0x53fca7[_0x5600('0x27')]){return logger[_0x5600('0x27')]('error\x20mail',JSON[_0x5600('0x21')](_0x53fca7));}return logger[_0x5600('0x8')]('email\x20sent');})[_0x5600('0x28')](function(_0x475f00){return logger[_0x5600('0x27')](_0x5600('0x29'),JSON[_0x5600('0x21')](_0x475f00));});}};}function handleError(){return function(_0x400ba5){return logger[_0x5600('0x27')](JSON['stringify'](_0x400ba5));};}function handleResult(_0x4467d6){return function(_0xccb6a1){logger[_0x5600('0x8')](_0x5600('0x2a'),JSON[_0x5600('0x21')](_0xccb6a1));if(_0x4467d6[_0x5600('0xb')]&&_0x4467d6['MailAccount'][_0x5600('0xf')]&&!_['isNil'](_0x4467d6[_0x5600('0xa')])){setTimeout(handleSendEmail(_0x4467d6,_0xccb6a1),0x3c*0x3e8);}};}function handleJob(_0x30185b){return function(){try{if(_[_0x5600('0x2b')](_0x30185b[_0x5600('0x12')])){return logger[_0x5600('0x8')](_0x5600('0x2c'));}if(_[_0x5600('0x2b')](_0x30185b[_0x5600('0x13')])){return logger[_0x5600('0x8')](_0x5600('0x2d'));}var _0x39977b={'startDate':moment()[_0x5600('0x2e')](_0x30185b[_0x5600('0x12')],_0x30185b[_0x5600('0x13')])[_0x5600('0xd')](_0x5600('0x2f')),'endDate':moment()[_0x5600('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5600('0x30'),'output':_0x30185b[_0x5600('0x31')],'name':_0x30185b[_0x5600('0xe')]};if(!_[_0x5600('0x2b')](_0x30185b[_0x5600('0x32')])){logger[_0x5600('0x8')](_0x5600('0x33'),_0x30185b[_0x5600('0x32')]);return analyticDefaultReportController[_0x5600('0x34')]({'id':_0x30185b[_0x5600('0x32')]},_0x39977b)['then'](handleResult(_0x30185b))[_0x5600('0x28')](handleError());}if(!_[_0x5600('0x2b')](_0x30185b[_0x5600('0x35')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x30185b[_0x5600('0x35')]);return analyticCustomReportController[_0x5600('0x34')]({'id':_0x30185b[_0x5600('0x35')]},_0x39977b)[_0x5600('0x26')](handleResult(_0x30185b))['catch'](handleError());}}catch(_0x515b37){logger[_0x5600('0x27')](JSON[_0x5600('0x21')](_0x515b37));}return logger[_0x5600('0x8')](_0x5600('0x36'));};}function getJobs(_0x2aa2e7){var _0x3f87dd={};if(_0x2aa2e7){_0x3f87dd['id']=_0x2aa2e7;}return db['Schedule'][_0x5600('0x37')]({'where':_0x3f87dd,'include':[{'model':db['MailAccount'],'attributes':['id',_0x5600('0xe'),'email'],'include':[{'model':db[_0x5600('0x38')],'as':_0x5600('0xf'),'include':[{'model':db['CloudProvider'],'as':_0x5600('0x39')}]}]}]})[_0x5600('0x26')](function(_0x303cd8){var _0x240ed7=_[_0x5600('0x3a')](manager[_0x5600('0x3b')]);var _0x38e7de=_[_0x5600('0x3c')](_0x303cd8,function(_0x130797){return _0x130797['id'][_0x5600('0x3d')]();});var _0x309c17=_[_0x5600('0x3e')](_0x303cd8,function(_0x2499e1){return _0x2499e1['id'][_0x5600('0x3d')]();});var _0x3bf855=_0x2aa2e7?_0x38e7de:_['difference'](_0x38e7de,_0x240ed7);var _0x1128e0=_['intersection'](_0x38e7de,_0x240ed7);var _0x440dc8=_[_0x5600('0x3f')](_0x240ed7,_0x38e7de);var _0x4c862a;var _0x55c526;for(_0x4c862a=0x0;_0x4c862a<_0x440dc8[_0x5600('0x40')]&&!_0x2aa2e7;_0x4c862a+=0x1){_0x55c526=_0x440dc8[_0x4c862a][_0x5600('0x3d')]();if(manager['exists'](_0x55c526)){manager[_0x5600('0x41')](_0x55c526);manager['deleteJob'](_0x55c526);logger[_0x5600('0x8')](_0x5600('0x42'),_0x55c526);}}logger[_0x5600('0x8')](_0x5600('0x43'),JSON[_0x5600('0x21')](_0x3bf855));for(_0x4c862a=0x0;_0x4c862a<_0x3bf855['length'];_0x4c862a+=0x1){_0x55c526=_0x3bf855[_0x4c862a]['toString']();logger[_0x5600('0x8')](_0x5600('0x44'),_0x55c526);if(_0x2aa2e7){logger['info'](_0x5600('0x45'),_0x2aa2e7);logger[_0x5600('0x8')](JSON['stringify'](_0x309c17[_0x55c526]));BPromise['resolve']()[_0x5600('0x26')](handleJob(_0x309c17[_0x55c526]));logger[_0x5600('0x8')](_0x5600('0x46'),_0x309c17[_0x55c526][_0x5600('0xe')],_0x309c17[_0x55c526][_0x5600('0x47')]);}else if(_0x309c17[_0x55c526][_0x5600('0x47')]&&_0x309c17[_0x55c526][_0x5600('0x48')]&&moment()['isBetween'](_0x309c17[_0x55c526][_0x5600('0x49')],_0x309c17[_0x55c526][_0x5600('0x4a')])){manager[_0x5600('0x4b')](_0x55c526,_0x309c17[_0x55c526][_0x5600('0x47')],handleJob(_0x309c17[_0x55c526]));manager[_0x5600('0x4c')](_0x55c526);logger[_0x5600('0x8')]('add\x20cron',_0x309c17[_0x55c526][_0x5600('0xe')],_0x309c17[_0x55c526]['cron']);}else if(manager[_0x5600('0x4d')](_0x55c526)){manager['stop'](_0x55c526);manager['deleteJob'](_0x55c526);logger[_0x5600('0x8')]('stop\x20cron',_0x309c17[_0x55c526]['name'],_0x309c17[_0x55c526][_0x5600('0x47')]);}}for(_0x4c862a=0x0,_0x55c526;_0x4c862a<_0x1128e0[_0x5600('0x40')]&&!_0x2aa2e7;_0x4c862a+=0x1){_0x55c526=_0x1128e0[_0x4c862a][_0x5600('0x3d')]();if(manager[_0x5600('0x4d')](_0x55c526)){if(_0x309c17[_0x55c526][_0x5600('0x47')]&&_0x309c17[_0x55c526][_0x5600('0x48')]&&moment()[_0x5600('0x4e')](_0x309c17[_0x55c526][_0x5600('0x49')],_0x309c17[_0x55c526]['endAt'])){manager['update'](_0x55c526,_0x309c17[_0x55c526][_0x5600('0x47')],handleJob(_0x309c17[_0x55c526]));logger[_0x5600('0x8')](_0x5600('0x4f'),_0x309c17[_0x55c526][_0x5600('0xe')],_0x309c17[_0x55c526][_0x5600('0x47')]);}else{manager[_0x5600('0x41')](_0x55c526);manager[_0x5600('0x50')](_0x55c526);logger['info'](_0x5600('0x51'),_0x309c17[_0x55c526][_0x5600('0xe')],_0x309c17[_0x55c526]['cron']);}}}})[_0x5600('0x28')](function(_0x3c71c6){logger[_0x5600('0x27')](JSON['stringify'](_0x3c71c6));});}exports[_0x5600('0x52')]=function(_0x4510fe){return getJobs(_0x4510fe);};exports[_0x5600('0x4c')]=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 23003f4..42a1055 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 _0x0e21=['Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','sentiment','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','all','SequelizeValidationError','inspect','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','format','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Transcript\x20not\x20available','CloudProvider','findOne','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','update','Sentiment','SentimentScore','Positive'];(function(_0x1afa61,_0x4aaf01){var _0x58ea74=function(_0x4ea3d3){while(--_0x4ea3d3){_0x1afa61['push'](_0x1afa61['shift']());}};_0x58ea74(++_0x4aaf01);}(_0x0e21,0xe8));var _0x10e2=function(_0x1f336a,_0x55f30f){_0x1f336a=_0x1f336a-0x0;var _0x3adb12=_0x0e21[_0x1f336a];return _0x3adb12;};var _=require('lodash');var AWS=require(_0x10e2('0x0'));var rp=require(_0x10e2('0x1'));var util=require(_0x10e2('0x2'));var BPromise=require('bluebird');var db=require(_0x10e2('0x3'))['db'];var logger=require(_0x10e2('0x4'))(_0x10e2('0x5'));function getTranscriptionJob(_0x4861d5,_0x4b6911,_0x263df,_0x340513){return new Promise(function(_0x2fb9e4,_0x44e30e){var _0x4e1687=new AWS[(_0x10e2('0x6'))]({'accessKeyId':_0x4b6911,'secretAccessKey':_0x4861d5,'region':_0x263df});_0x4e1687[_0x10e2('0x7')]({'TranscriptionJobName':_0x340513},function(_0x48ab5b,_0x375bbc){if(_0x48ab5b){return _0x44e30e(_0x48ab5b);}else{return _0x2fb9e4(_0x375bbc);}});});}function sentiment(_0x50c758,_0x3594c4,_0x52ef03,_0x559b78,_0x5ac29c){return new Promise(function(_0xe4451a,_0x13c32a){var _0x5c6925=new AWS[(_0x10e2('0x8'))]({'accessKeyId':_0x3594c4,'secretAccessKey':_0x50c758,'region':_0x52ef03});_0x5c6925['detectSentiment']({'Text':_0x559b78,'LanguageCode':_0x5ac29c[_0x10e2('0x9')](0x0,0x2)},function(_0x435c67,_0x26b7dd){if(_0x435c67){return _0x13c32a(_0x435c67);}else{return _0xe4451a(_0x26b7dd);}});});}function checkTranscribeJob(_0x56db90,_0x37dafd,_0x4072f4){var _0x411688;return new BPromise(function(_0x4e584f,_0x4d8533){logger['info'](util['format'](_0x10e2('0xa'),_0x56db90['id'],_0x56db90[_0x10e2('0xb')]));return getTranscriptionJob(_0x4072f4[_0x10e2('0xc')],_0x4072f4['data2'],_0x37dafd[_0x10e2('0xd')],_0x56db90[_0x10e2('0xb')])[_0x10e2('0xe')](function(_0x40c5bc){logger[_0x10e2('0xf')](util[_0x10e2('0x10')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x56db90['id'],_0x56db90[_0x10e2('0xb')],_0x40c5bc[_0x10e2('0x11')][_0x10e2('0x12')]));if(!_0x56db90[_0x10e2('0x13')]){switch(_0x40c5bc[_0x10e2('0x11')][_0x10e2('0x12')]){case _0x10e2('0x14'):var _0x1a8f8d={'transcribeStatus':_0x40c5bc['TranscriptionJob'][_0x10e2('0x12')],'fileUri':_0x40c5bc[_0x10e2('0x11')][_0x10e2('0x15')][_0x10e2('0x16')]};logger['info'](util['format'](_0x10e2('0x17'),_0x56db90['id']));return rp({'uri':_0x40c5bc[_0x10e2('0x11')][_0x10e2('0x15')][_0x10e2('0x16')],'json':!![]})['then'](function(_0x54ef4f){logger[_0x10e2('0xf')](util[_0x10e2('0x10')](_0x10e2('0x18'),_0x56db90['id']));if(_0x54ef4f&&_0x54ef4f[_0x10e2('0x19')]&&_0x54ef4f[_0x10e2('0x19')][_0x10e2('0x1a')]&&_0x54ef4f['results'][_0x10e2('0x1a')][_0x10e2('0x1b')]){_0x1a8f8d[_0x10e2('0x13')]='';for(var _0x46ae73=0x0;_0x46ae73<_0x54ef4f[_0x10e2('0x19')][_0x10e2('0x1a')]['length'];_0x46ae73++){_0x1a8f8d[_0x10e2('0x13')]+=_0x54ef4f['results']['transcripts'][_0x46ae73]['transcript']+'';}}return _0x56db90['update'](_0x1a8f8d);})['then'](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x56db90['id']));if(!_0x56db90['tempSentiment']){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))](_0x10e2('0x1e'));}if(!_0x37dafd['sentiment']||!_0x37dafd[_0x10e2('0x1f')]||!_0x37dafd[_0x10e2('0x20')]||!_0x37dafd[_0x10e2('0x21')]||!_0x37dafd[_0x10e2('0x22')]){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1a8f8d['fileText']){throw new Error(_0x10e2('0x23'));}if(_0x37dafd[_0x10e2('0x1f')]===_0x4072f4['id']){return _0x4072f4;}else{return db[_0x10e2('0x24')][_0x10e2('0x25')]({'where':{'id':_settings[_0x10e2('0x1f')]}});}})[_0x10e2('0xe')](function(_0x45a3a0){if(!_0x45a3a0){throw new db[(_0x10e2('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x45a3a0[_0x10e2('0xc')]||!_0x45a3a0[_0x10e2('0x26')]){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x411688=_0x45a3a0;logger['info'](util[_0x10e2('0x10')](_0x10e2('0x27'),_0x56db90['id']));return sentiment(_0x411688[_0x10e2('0xc')],_0x411688[_0x10e2('0x26')],_0x37dafd[_0x10e2('0x20')],_0x1a8f8d[_0x10e2('0x13')],_0x37dafd['language']);})[_0x10e2('0xe')](function(_0x45590f){logger[_0x10e2('0xf')](util[_0x10e2('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x56db90['id']));return _0x56db90[_0x10e2('0x28')]({'sentiment':_0x45590f[_0x10e2('0x29')],'sPositive':_0x45590f[_0x10e2('0x2a')][_0x10e2('0x2b')],'sNegative':_0x45590f[_0x10e2('0x2a')][_0x10e2('0x2c')],'sMixed':_0x45590f['SentimentScore'][_0x10e2('0x2d')],'sNeutral':_0x45590f[_0x10e2('0x2a')][_0x10e2('0x2e')]});})[_0x10e2('0xe')](function(){logger[_0x10e2('0xf')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x56db90['id']));_0x4e584f();});case'FAILED':return _0x56db90['update']({'transcribeStatus':_0x10e2('0x2f'),'failureReason':_0x40c5bc['TranscriptionJob'][_0x10e2('0x30')]})[_0x10e2('0xe')](function(){logger[_0x10e2('0xf')](util[_0x10e2('0x10')](_0x10e2('0x31'),_0x56db90['id']));_0x4e584f();});default:logger[_0x10e2('0xf')](util[_0x10e2('0x10')](_0x10e2('0x32'),_0x56db90['id']));break;}}else{return BPromise['resolve']()[_0x10e2('0xe')](function(){if(!_0x56db90[_0x10e2('0x33')]){throw new db['Sequelize'][(_0x10e2('0x1d'))](_0x10e2('0x1e'));}if(!_0x37dafd[_0x10e2('0x34')]||!_0x37dafd[_0x10e2('0x1f')]||!_0x37dafd[_0x10e2('0x20')]||!_0x37dafd['language']||!_0x37dafd[_0x10e2('0x22')]){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x56db90['fileText']){throw new Error(_0x10e2('0x23'));}if(_0x37dafd[_0x10e2('0x1f')]===_0x4072f4['id']){return _0x4072f4;}else{return db[_0x10e2('0x24')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x6836d4){if(!_0x6836d4){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))](_0x10e2('0x35'));}if(!_0x6836d4[_0x10e2('0xc')]||!_0x6836d4[_0x10e2('0x26')]){throw new db[(_0x10e2('0x1c'))]['ValidationError'](_0x10e2('0x36'));}_0x411688=_0x6836d4;logger[_0x10e2('0xf')](util[_0x10e2('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x56db90['id']));return sentiment(_0x411688[_0x10e2('0xc')],_0x411688[_0x10e2('0x26')],_0x37dafd[_0x10e2('0x20')],_0x56db90[_0x10e2('0x13')],_0x37dafd[_0x10e2('0x21')]);})[_0x10e2('0xe')](function(_0x518ee5){logger[_0x10e2('0xf')](util[_0x10e2('0x10')](_0x10e2('0x37'),_0x56db90['id']));return _0x56db90[_0x10e2('0x28')]({'sentiment':_0x518ee5[_0x10e2('0x29')],'sPositive':_0x518ee5[_0x10e2('0x2a')][_0x10e2('0x2b')],'sNegative':_0x518ee5[_0x10e2('0x2a')][_0x10e2('0x2c')],'sMixed':_0x518ee5['SentimentScore']['Mixed'],'sNeutral':_0x518ee5[_0x10e2('0x2a')][_0x10e2('0x2e')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x10e2('0xf')](util[_0x10e2('0x10')](_0x10e2('0x31'),_0x56db90['id']));_0x4e584f();});}})[_0x10e2('0x38')](function(_0x12a1f0){if(_0x12a1f0){if(!_0x12a1f0['name']||_0x12a1f0[_0x10e2('0x39')]!=='SequelizeValidationError'){logger[_0x10e2('0x3a')](util[_0x10e2('0x10')](_0x10e2('0x3b'),_0x56db90['id']),util['inspect'](_0x12a1f0,{'showHidden':![],'depth':null}));}}_0x4e584f();});});}function checkTranscribe(){var _0x53af61;var _0x2b94e6;var _0x34e2fe;return db[_0x10e2('0x3c')][_0x10e2('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x512d4d){if(!_0x512d4d||!_0x512d4d[_0x10e2('0x1b')]){throw new db[(_0x10e2('0x1c'))][(_0x10e2('0x1d'))]('No\x20transcribe\x20job\x20to\x20check');}_0x53af61=_0x512d4d;return db[_0x10e2('0x3e')][_0x10e2('0x25')]({'where':{'id':0x1}});})[_0x10e2('0xe')](function(_0x4bd9e6){if(!_0x4bd9e6){throw new db['Sequelize'][(_0x10e2('0x1d'))](_0x10e2('0x3f'));}_0x2b94e6=_0x4bd9e6;if(!_0x2b94e6['transcribe']||!_0x2b94e6['transcribeAccountId']||!_0x2b94e6[_0x10e2('0xd')]||!_0x2b94e6[_0x10e2('0x21')]||!_0x2b94e6['bucket']){throw new db['Sequelize'][(_0x10e2('0x1d'))]('Transcribe\x20not\x20configured');}return db[_0x10e2('0x24')]['findOne']({'where':{'id':_0x2b94e6[_0x10e2('0x40')]}});})['then'](function(_0xf21188){if(!_0xf21188){throw new db[(_0x10e2('0x1c'))]['ValidationError'](_0x10e2('0x35'));}if(!_0xf21188[_0x10e2('0xc')]||!_0xf21188[_0x10e2('0x26')]){throw new db[(_0x10e2('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x34e2fe=_0xf21188;var _0xa9f14f=[];_0x53af61['forEach'](function(_0x3dba83){_0xa9f14f['push'](checkTranscribeJob(_0x3dba83,_0x2b94e6,_0x34e2fe));});return BPromise[_0x10e2('0x41')](_0xa9f14f);})[_0x10e2('0x38')](function(_0x3226bc){if(_0x3226bc){if(!_0x3226bc['name']||_0x3226bc[_0x10e2('0x39')]!==_0x10e2('0x42')){logger[_0x10e2('0x3a')](util[_0x10e2('0x43')](_0x3226bc,{'showHidden':![],'depth':null}));}}});}exports[_0x10e2('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x9e0d=['Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','push','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','format','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','Transcript','info','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','then','results','length','transcripts','transcript','update','tempSentiment','Sequelize','ValidationError'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x4961d6,_0x597061){_0x4961d6=_0x4961d6-0x0;var _0x56409e=_0x9e0d[_0x4961d6];return _0x56409e;};var _=require(_0xd9e0('0x0'));var AWS=require(_0xd9e0('0x1'));var rp=require(_0xd9e0('0x2'));var util=require(_0xd9e0('0x3'));var BPromise=require('bluebird');var db=require(_0xd9e0('0x4'))['db'];var logger=require(_0xd9e0('0x5'))(_0xd9e0('0x6'));function getTranscriptionJob(_0x1c83df,_0x296774,_0x36a691,_0x4d2247){return new Promise(function(_0x570a07,_0x22e726){var _0x28ce1e=new AWS[(_0xd9e0('0x7'))]({'accessKeyId':_0x296774,'secretAccessKey':_0x1c83df,'region':_0x36a691});_0x28ce1e[_0xd9e0('0x8')]({'TranscriptionJobName':_0x4d2247},function(_0x256df0,_0x3315d8){if(_0x256df0){return _0x22e726(_0x256df0);}else{return _0x570a07(_0x3315d8);}});});}function sentiment(_0x5747eb,_0x312d21,_0x36e6e7,_0x57763b,_0x5bd6ad){return new Promise(function(_0x1fc11b,_0x912d1e){var _0x28f8be=new AWS['Comprehend']({'accessKeyId':_0x312d21,'secretAccessKey':_0x5747eb,'region':_0x36e6e7});_0x28f8be[_0xd9e0('0x9')]({'Text':_0x57763b,'LanguageCode':_0x5bd6ad[_0xd9e0('0xa')](0x0,0x2)},function(_0x4b8f8d,_0x7dfd11){if(_0x4b8f8d){return _0x912d1e(_0x4b8f8d);}else{return _0x1fc11b(_0x7dfd11);}});});}function checkTranscribeJob(_0x2b0528,_0x418d84,_0x1fb454){var _0x18fdf2;return new BPromise(function(_0x555652,_0x3ab6e2){logger['info'](util[_0xd9e0('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x2b0528['id'],_0x2b0528[_0xd9e0('0xc')]));return getTranscriptionJob(_0x1fb454[_0xd9e0('0xd')],_0x1fb454[_0xd9e0('0xe')],_0x418d84[_0xd9e0('0xf')],_0x2b0528[_0xd9e0('0xc')])['then'](function(_0x58d44c){logger['info'](util[_0xd9e0('0xb')](_0xd9e0('0x10'),_0x2b0528['id'],_0x2b0528[_0xd9e0('0xc')],_0x58d44c[_0xd9e0('0x11')]['TranscriptionJobStatus']));if(!_0x2b0528[_0xd9e0('0x12')]){switch(_0x58d44c['TranscriptionJob']['TranscriptionJobStatus']){case _0xd9e0('0x13'):var _0x30a342={'transcribeStatus':_0x58d44c['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x58d44c[_0xd9e0('0x11')][_0xd9e0('0x14')]['TranscriptFileUri']};logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x16'),_0x2b0528['id']));return rp({'uri':_0x58d44c[_0xd9e0('0x11')][_0xd9e0('0x14')][_0xd9e0('0x17')],'json':!![]})[_0xd9e0('0x18')](function(_0x5711a1){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x2b0528['id']));if(_0x5711a1&&_0x5711a1[_0xd9e0('0x19')]&&_0x5711a1[_0xd9e0('0x19')]['transcripts']&&_0x5711a1[_0xd9e0('0x19')]['transcripts'][_0xd9e0('0x1a')]){_0x30a342[_0xd9e0('0x12')]='';for(var _0x48dbf9=0x0;_0x48dbf9<_0x5711a1[_0xd9e0('0x19')]['transcripts']['length'];_0x48dbf9++){_0x30a342['fileText']+=_0x5711a1[_0xd9e0('0x19')][_0xd9e0('0x1b')][_0x48dbf9][_0xd9e0('0x1c')]+'';}}return _0x2b0528[_0xd9e0('0x1d')](_0x30a342);})[_0xd9e0('0x18')](function(){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2b0528['id']));if(!_0x2b0528[_0xd9e0('0x1e')]){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x21'));}if(!_0x418d84[_0xd9e0('0x22')]||!_0x418d84['sentimentAccountId']||!_0x418d84['sentimentRegion']||!_0x418d84['language']||!_0x418d84[_0xd9e0('0x23')]){throw new db[(_0xd9e0('0x1f'))]['ValidationError'](_0xd9e0('0x24'));}if(!_0x30a342[_0xd9e0('0x12')]){throw new Error(_0xd9e0('0x25'));}if(_0x418d84[_0xd9e0('0x26')]===_0x1fb454['id']){return _0x1fb454;}else{return db[_0xd9e0('0x27')][_0xd9e0('0x28')]({'where':{'id':_settings[_0xd9e0('0x26')]}});}})['then'](function(_0x189c6a){if(!_0x189c6a){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x29'));}if(!_0x189c6a[_0xd9e0('0xd')]||!_0x189c6a[_0xd9e0('0xe')]){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x2a'));}_0x18fdf2=_0x189c6a;logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x2b'),_0x2b0528['id']));return sentiment(_0x18fdf2['data1'],_0x18fdf2[_0xd9e0('0xe')],_0x418d84[_0xd9e0('0x2c')],_0x30a342[_0xd9e0('0x12')],_0x418d84[_0xd9e0('0x2d')]);})[_0xd9e0('0x18')](function(_0x514069){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x2e'),_0x2b0528['id']));return _0x2b0528[_0xd9e0('0x1d')]({'sentiment':_0x514069['Sentiment'],'sPositive':_0x514069[_0xd9e0('0x2f')]['Positive'],'sNegative':_0x514069[_0xd9e0('0x2f')][_0xd9e0('0x30')],'sMixed':_0x514069[_0xd9e0('0x2f')][_0xd9e0('0x31')],'sNeutral':_0x514069[_0xd9e0('0x2f')][_0xd9e0('0x32')]});})[_0xd9e0('0x18')](function(){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2b0528['id']));_0x555652();});case _0xd9e0('0x33'):return _0x2b0528[_0xd9e0('0x1d')]({'transcribeStatus':_0xd9e0('0x33'),'failureReason':_0x58d44c[_0xd9e0('0x11')]['FailureReason']})[_0xd9e0('0x18')](function(){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x34'),_0x2b0528['id']));_0x555652();});default:logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x35'),_0x2b0528['id']));break;}}else{return BPromise[_0xd9e0('0x36')]()[_0xd9e0('0x18')](function(){if(!_0x2b0528[_0xd9e0('0x1e')]){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x21'));}if(!_0x418d84[_0xd9e0('0x22')]||!_0x418d84[_0xd9e0('0x26')]||!_0x418d84[_0xd9e0('0x2c')]||!_0x418d84['language']||!_0x418d84[_0xd9e0('0x23')]){throw new db[(_0xd9e0('0x1f'))]['ValidationError'](_0xd9e0('0x24'));}if(!_0x2b0528['fileText']){throw new Error(_0xd9e0('0x25'));}if(_0x418d84[_0xd9e0('0x26')]===_0x1fb454['id']){return _0x1fb454;}else{return db[_0xd9e0('0x27')][_0xd9e0('0x28')]({'where':{'id':_settings[_0xd9e0('0x26')]}});}})[_0xd9e0('0x18')](function(_0x51a616){if(!_0x51a616){throw new db['Sequelize'][(_0xd9e0('0x20'))](_0xd9e0('0x29'));}if(!_0x51a616[_0xd9e0('0xd')]||!_0x51a616[_0xd9e0('0xe')]){throw new db[(_0xd9e0('0x1f'))]['ValidationError'](_0xd9e0('0x2a'));}_0x18fdf2=_0x51a616;logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x2b'),_0x2b0528['id']));return sentiment(_0x18fdf2['data1'],_0x18fdf2[_0xd9e0('0xe')],_0x418d84[_0xd9e0('0x2c')],_0x2b0528[_0xd9e0('0x12')],_0x418d84['language']);})['then'](function(_0xc28075){logger[_0xd9e0('0x15')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2b0528['id']));return _0x2b0528[_0xd9e0('0x1d')]({'sentiment':_0xc28075[_0xd9e0('0x37')],'sPositive':_0xc28075[_0xd9e0('0x2f')][_0xd9e0('0x38')],'sNegative':_0xc28075[_0xd9e0('0x2f')][_0xd9e0('0x30')],'sMixed':_0xc28075[_0xd9e0('0x2f')][_0xd9e0('0x31')],'sNeutral':_0xc28075['SentimentScore'][_0xd9e0('0x32')],'transcribeStatus':_0xd9e0('0x13')});})['then'](function(){logger[_0xd9e0('0x15')](util[_0xd9e0('0xb')](_0xd9e0('0x34'),_0x2b0528['id']));_0x555652();});}})[_0xd9e0('0x39')](function(_0x2a1a1e){if(_0x2a1a1e){if(!_0x2a1a1e[_0xd9e0('0x3a')]||_0x2a1a1e[_0xd9e0('0x3a')]!==_0xd9e0('0x3b')){logger[_0xd9e0('0x3c')](util[_0xd9e0('0xb')](_0xd9e0('0x3d'),_0x2b0528['id']),util[_0xd9e0('0x3e')](_0x2a1a1e,{'showHidden':![],'depth':null}));}}_0x555652();});});}function checkTranscribe(){var _0x5c2927;var _0x373663;var _0x23d7fb;return db['VoiceRecording'][_0xd9e0('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xd9e0('0x18')](function(_0x1de37a){if(!_0x1de37a||!_0x1de37a[_0xd9e0('0x1a')]){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x40'));}_0x5c2927=_0x1de37a;return db[_0xd9e0('0x41')]['findOne']({'where':{'id':0x1}});})[_0xd9e0('0x18')](function(_0xc2b731){if(!_0xc2b731){throw new db[(_0xd9e0('0x1f'))][(_0xd9e0('0x20'))](_0xd9e0('0x42'));}_0x373663=_0xc2b731;if(!_0x373663['transcribe']||!_0x373663['transcribeAccountId']||!_0x373663[_0xd9e0('0xf')]||!_0x373663['language']||!_0x373663[_0xd9e0('0x23')]){throw new db[(_0xd9e0('0x1f'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xd9e0('0x27')][_0xd9e0('0x28')]({'where':{'id':_0x373663[_0xd9e0('0x43')]}});})['then'](function(_0x328d1a){if(!_0x328d1a){throw new db['Sequelize'][(_0xd9e0('0x20'))](_0xd9e0('0x29'));}if(!_0x328d1a[_0xd9e0('0xd')]||!_0x328d1a['data2']){throw new db[(_0xd9e0('0x1f'))]['ValidationError'](_0xd9e0('0x2a'));}_0x23d7fb=_0x328d1a;var _0x84b71d=[];_0x5c2927['forEach'](function(_0x38af96){_0x84b71d[_0xd9e0('0x44')](checkTranscribeJob(_0x38af96,_0x373663,_0x23d7fb));});return BPromise['all'](_0x84b71d);})[_0xd9e0('0x39')](function(_0x35247f){if(_0x35247f){if(!_0x35247f['name']||_0x35247f[_0xd9e0('0x3a')]!==_0xd9e0('0x3b')){logger['error'](util[_0xd9e0('0x3e')](_0x35247f,{'showHidden':![],'depth':null}));}}});}exports[_0xd9e0('0x45')]=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 f32d7c4..e640d4c 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 _0xb1b4=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','length','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','then','map','info'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0xb1b4,0x175));var _0x4b1b=function(_0x625492,_0x1cd944){_0x625492=_0x625492-0x0;var _0x296b94=_0xb1b4[_0x625492];return _0x296b94;};'use strict';var _=require(_0x4b1b('0x0'));var moment=require(_0x4b1b('0x1'));var Redis=require(_0x4b1b('0x2'));var util=require('util');var config=require(_0x4b1b('0x3'));var db=require(_0x4b1b('0x4'))['db'];var logger=require(_0x4b1b('0x5'))(_0x4b1b('0x6'));config[_0x4b1b('0x7')]=_[_0x4b1b('0x8')](config['redis'],{'host':_0x4b1b('0x9'),'port':0x18eb});var io=require(_0x4b1b('0xa'))(new Redis(config[_0x4b1b('0x7')]));function closeInteractions(){var _0x22018d=[];return db[_0x4b1b('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x4b1b('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4b1b('0xd')](0x18,'hours')}}})[_0x4b1b('0xe')](function(_0x37c350){if(_0x37c350&&_0x37c350['length']){_0x22018d=_[_0x4b1b('0xf')](_0x37c350||[],'id');logger[_0x4b1b('0x10')](_0x4b1b('0x11'),_0x22018d[_0x4b1b('0x12')]());return db[_0x4b1b('0xb')][_0x4b1b('0x13')]({'closeReason':_0x4b1b('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4b1b('0x15')](_0x4b1b('0x16'))},{'where':{'id':_0x22018d}});}})['then'](function(){if(_0x22018d&&_0x22018d['length']){logger[_0x4b1b('0x10')](_0x4b1b('0x17'),_0x22018d[_0x4b1b('0x12')]());for(var _0x2fbb01=0x0;_0x2fbb01<_0x22018d[_0x4b1b('0x18')];_0x2fbb01++){io[_0x4b1b('0x19')](_0x4b1b('0x1a'),{'id':_0x22018d[_0x2fbb01],'closed':!![]});}}})['catch'](function(_0x19ab70){logger['error'](_0x4b1b('0x1b'),_0x19ab70?util[_0x4b1b('0x1c')](_0x19ab70,{'showHidden':![],'depth':null}):'');});}exports[_0x4b1b('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcac2=['util','../../config/environment','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis'];(function(_0x53260f,_0x533d76){var _0x19e85b=function(_0x4ae9f4){while(--_0x4ae9f4){_0x53260f['push'](_0x53260f['shift']());}};_0x19e85b(++_0x533d76);}(_0xcac2,0x8e));var _0x2cac=function(_0x17e0a0,_0x39b799){_0x17e0a0=_0x17e0a0-0x0;var _0x1baa60=_0xcac2[_0x17e0a0];return _0x1baa60;};'use strict';var _=require(_0x2cac('0x0'));var moment=require(_0x2cac('0x1'));var Redis=require(_0x2cac('0x2'));var util=require(_0x2cac('0x3'));var config=require(_0x2cac('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x2cac('0x5'))(_0x2cac('0x6'));config['redis']=_['defaults'](config[_0x2cac('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2cac('0x8'))(new Redis(config[_0x2cac('0x7')]));function closeInteractions(){var _0x4a60d0=[];return db[_0x2cac('0x9')][_0x2cac('0xa')]({'raw':!![],'attributes':['id',_0x2cac('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2cac('0xc')](0x18,_0x2cac('0xd'))}}})[_0x2cac('0xe')](function(_0x2671e2){if(_0x2671e2&&_0x2671e2[_0x2cac('0xf')]){_0x4a60d0=_[_0x2cac('0x10')](_0x2671e2||[],'id');logger[_0x2cac('0x11')](_0x2cac('0x12'),_0x4a60d0[_0x2cac('0x13')]());return db[_0x2cac('0x9')]['update']({'closeReason':_0x2cac('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x2cac('0x15')](_0x2cac('0x16'))},{'where':{'id':_0x4a60d0}});}})['then'](function(){if(_0x4a60d0&&_0x4a60d0[_0x2cac('0xf')]){logger[_0x2cac('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4a60d0[_0x2cac('0x13')]());for(var _0x4ffd5c=0x0;_0x4ffd5c<_0x4a60d0[_0x2cac('0xf')];_0x4ffd5c++){io[_0x2cac('0x17')](_0x2cac('0x18'),{'id':_0x4a60d0[_0x4ffd5c],'closed':!![]});}}})[_0x2cac('0x19')](function(_0x694d60){logger[_0x2cac('0x1a')](_0x2cac('0x1b'),_0x694d60?util['inspect'](_0x694d60,{'showHidden':![],'depth':null}):'');});}exports[_0x2cac('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 84d5fd9..0f96a85 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28cc=['log','finished\x20populating','contacts1','CmHopper','util','../mysqldb','push','Innocenzo','innocenzo.biondo','now','Biondo','@xcally.com','CmContact','destroy','then','bulkCreate'];(function(_0x4c6a04,_0x1e4f56){var _0x582ffd=function(_0x35ba32){while(--_0x35ba32){_0x4c6a04['push'](_0x4c6a04['shift']());}};_0x582ffd(++_0x1e4f56);}(_0x28cc,0x124));var _0xc28c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x28cc[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xc28c('0x0'));var db=require(_0xc28c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc28c('0x2')]({'id':i,'firstName':_0xc28c('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc28c('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xc28c('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xc28c('0x3')+i,'lastName':_0xc28c('0x6')+i,'phone':0xf879fb460+i,'email':_0xc28c('0x4')+i+_0xc28c('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xc28c('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc28c('0x5')](),'updatedAt':Date[_0xc28c('0x5')]()});}db[_0xc28c('0x8')][_0xc28c('0x9')]({'where':{}})[_0xc28c('0xa')](function(){return db[_0xc28c('0x8')][_0xc28c('0xb')](contacts);})[_0xc28c('0xa')](function(){console[_0xc28c('0xc')](_0xc28c('0xd'),_0xc28c('0xe'));return db[_0xc28c('0xf')][_0xc28c('0x9')]({'where':{}});})[_0xc28c('0xa')](function(){return db[_0xc28c('0xf')][_0xc28c('0xb')](hopper);})[_0xc28c('0xa')](function(){console[_0xc28c('0xc')](_0xc28c('0xd'),'hopper1');return db[_0xc28c('0x8')][_0xc28c('0xb')](contacts2);})[_0xc28c('0xa')](function(){console[_0xc28c('0xc')](_0xc28c('0xd'),'contacts2');return db['CmHopper'][_0xc28c('0xb')](hopper2);})[_0xc28c('0xa')](function(){console[_0xc28c('0xc')](_0xc28c('0xd'),'hopper2');})['catch'](function(_0x1083c5){console['log'](_0x1083c5);}); \ No newline at end of file +var _0x98da=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','CmContact'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x98da,0xd4));var _0xa98d=function(_0x704f7d,_0x380ba3){_0x704f7d=_0x704f7d-0x0;var _0x58d47e=_0x98da[_0x704f7d];return _0x58d47e;};'use strict';var util=require(_0xa98d('0x0'));var db=require(_0xa98d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa98d('0x2')]({'id':i,'firstName':_0xa98d('0x3')+i,'lastName':_0xa98d('0x4')+i,'phone':0xf879fb460+i,'email':_0xa98d('0x5')+i+_0xa98d('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa98d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa98d('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xa98d('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa98d('0x2')]({'id':i,'firstName':_0xa98d('0x3')+i,'lastName':_0xa98d('0x4')+i,'phone':0xf879fb460+i,'email':_0xa98d('0x5')+i+_0xa98d('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa98d('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa98d('0x7')](),'updatedAt':Date['now']()});}db['CmContact'][_0xa98d('0x8')]({'where':{}})[_0xa98d('0x9')](function(){return db['CmContact'][_0xa98d('0xa')](contacts);})[_0xa98d('0x9')](function(){console[_0xa98d('0xb')](_0xa98d('0xc'),_0xa98d('0xd'));return db['CmHopper'][_0xa98d('0x8')]({'where':{}});})['then'](function(){return db[_0xa98d('0xe')][_0xa98d('0xa')](hopper);})[_0xa98d('0x9')](function(){console[_0xa98d('0xb')](_0xa98d('0xc'),'hopper1');return db[_0xa98d('0xf')][_0xa98d('0xa')](contacts2);})[_0xa98d('0x9')](function(){console['log'](_0xa98d('0xc'),_0xa98d('0x10'));return db['CmHopper'][_0xa98d('0xa')](hopper2);})[_0xa98d('0x9')](function(){console[_0xa98d('0xb')](_0xa98d('0xc'),_0xa98d('0x11'));})[_0xa98d('0x12')](function(_0x15d51f){console[_0xa98d('0xb')](_0x15d51f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 438015f..3293dce 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fe5=['format','%s%s@xcally.com','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','%s%s','agent'];(function(_0x532685,_0x1a38c2){var _0x21426a=function(_0xa48343){while(--_0xa48343){_0x532685['push'](_0x532685['shift']());}};_0x21426a(++_0x1a38c2);}(_0x2fe5,0x68));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0x52fe('0x0'));var db=require(_0x52fe('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x52fe('0x2'),_0x52fe('0x3'),i),'fullname':util[_0x52fe('0x4')](_0x52fe('0x2'),'agent',i),'email':util['format'](_0x52fe('0x5'),_0x52fe('0x3'),i),'role':_0x52fe('0x3'),'password':'password','internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x52fe('0x6')],'disallow':[_0x52fe('0x7')],'allow':['ulaw'],'defaultuser':util['format'](_0x52fe('0x2'),_0x52fe('0x3'),i),'encryption':_0x52fe('0x8'),'avpf':_0x52fe('0x8'),'force_avp':_0x52fe('0x8'),'icesupport':_0x52fe('0x8'),'dtlsenable':_0x52fe('0x8'),'dtlsverify':'no','dtlscertfile':_0x52fe('0x9'),'dtlsprivatekey':_0x52fe('0xa'),'dtlssetup':'actpass','callerid':util[_0x52fe('0x4')](_0x52fe('0xb'),util[_0x52fe('0x4')](_0x52fe('0x2'),_0x52fe('0x3'),i),0xfa0+i)});}db[_0x52fe('0xc')][_0x52fe('0xd')](users)[_0x52fe('0xe')](function(){console[_0x52fe('0xf')](_0x52fe('0x10'));})[_0x52fe('0x11')](function(_0x214464){console[_0x52fe('0xf')](_0x214464);}); \ No newline at end of file +var _0xc4ff=['format','%s%s','agent','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','then','log','catch','util','../mysqldb','push'];(function(_0x38183a,_0x333650){var _0x51ab39=function(_0x1ee955){while(--_0x1ee955){_0x38183a['push'](_0x38183a['shift']());}};_0x51ab39(++_0x333650);}(_0xc4ff,0xda));var _0xfc4f=function(_0x561b98,_0x418921){_0x561b98=_0x561b98-0x0;var _0x522c16=_0xc4ff[_0x561b98];return _0x522c16;};'use strict';var util=require(_0xfc4f('0x0'));var db=require(_0xfc4f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xfc4f('0x2')]({'name':util[_0xfc4f('0x3')](_0xfc4f('0x4'),_0xfc4f('0x5'),i),'fullname':util['format']('%s%s','agent',i),'email':util[_0xfc4f('0x3')]('%s%s@xcally.com','agent',i),'role':_0xfc4f('0x5'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xfc4f('0x6'),'ws','wss'],'disallow':[_0xfc4f('0x7')],'allow':[_0xfc4f('0x8')],'defaultuser':util[_0xfc4f('0x3')](_0xfc4f('0x4'),'agent',i),'encryption':'yes','avpf':_0xfc4f('0x9'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0xfc4f('0x9'),'dtlsverify':'no','dtlscertfile':_0xfc4f('0xa'),'dtlsprivatekey':_0xfc4f('0xb'),'dtlssetup':_0xfc4f('0xc'),'callerid':util['format'](_0xfc4f('0xd'),util[_0xfc4f('0x3')]('%s%s',_0xfc4f('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xfc4f('0xe')](function(){console[_0xfc4f('0xf')]('add\x20user');})[_0xfc4f('0x10')](function(_0xd8a3c2){console['log'](_0xd8a3c2);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7318915..c6b27d6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b20=['map','where','type','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','WhatsappQueue','user','OpenchannelQueues','Trunk','IvrCampaigns','Campaign','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4b20,0x116));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x04b2('0x0'));var util=require(_0x04b2('0x1'));var BPromise=require(_0x04b2('0x2'));var db=require(_0x04b2('0x3'))['db'];var config=require(_0x04b2('0x4'));var queryQueues={'attributes':['id',_0x04b2('0x5')],'include':[{'as':_0x04b2('0x6'),'model':db[_0x04b2('0x7')],'attributes':['id',_0x04b2('0x5'),_0x04b2('0x8')],'raw':!![],'where':{'role':_0x04b2('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04b2('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x04b2('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04b2('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x04b2('0x5'),'type'],'where':{'type':_0x04b2('0xb')}};function getAssociatedResources(_0x53212e,_0x291e02,_0x48387f){return db[_0x04b2('0xc')]['findOne']({'where':{'name':_0x53212e,'userProfileId':_0x291e02},'raw':!![]})[_0x04b2('0xd')](function(_0x28a212){if(_0x28a212){if(_0x28a212[_0x04b2('0xe')]){switch(_0x53212e){case _0x04b2('0xf'):case _0x04b2('0x10'):case'FaxQueues':case _0x04b2('0x11'):case _0x04b2('0x12'):case'OpenchannelQueues':case _0x04b2('0x13'):return db[_0x48387f]['findAll'](queryQueues);case _0x04b2('0x14'):return db[_0x48387f][_0x04b2('0x15')](queryTelephones);case _0x04b2('0x16'):return db[_0x48387f][_0x04b2('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x48387f][_0x04b2('0x15')](queryCampaigns);}}else{return db[_0x04b2('0x17')]['findAll']({'attributes':[_0x04b2('0x18')],'where':{'sectionId':_0x28a212['id']},'raw':!![]})[_0x04b2('0xd')](function(_0x181c2d){if(_0x181c2d){var _0x49c773={'where':{'id':_[_0x04b2('0x19')](_0x181c2d,_0x04b2('0x18'))},'raw':!![]};switch(_0x48387f){case _0x04b2('0x7'):_0x49c773[_0x04b2('0x1a')][_0x04b2('0x8')]=_0x04b2('0xa');break;case'Campaign':_0x49c773['where'][_0x04b2('0x1b')]=_0x04b2('0xb');break;}return db[_0x48387f][_0x04b2('0x15')](_0x49c773);}else{return[];}});}}else{return[];}})[_0x04b2('0xd')](function(_0x24e5ff){return _0x24e5ff;});}function joinOrLeaveQueues(_0x6dc675,_0x1f6d1c,_0x11210c,_0x311b94){_0x6dc675[_0x1f6d1c](util[_0x04b2('0x1c')](_0x04b2('0x1d'),_0x11210c,_0x311b94[_0x04b2('0x5')]));if(_0x311b94['Agents']){for(var _0x3cbdd8=0x0;_0x3cbdd8<_0x311b94[_0x04b2('0x6')][_0x04b2('0x1e')];_0x3cbdd8+=0x1){_0x6dc675[_0x1f6d1c](util[_0x04b2('0x1c')](_0x04b2('0x1f'),_0x311b94[_0x04b2('0x6')][_0x3cbdd8][_0x04b2('0x5')]));}}}function joinOrLeave(_0x5599ec,_0x17a70a,_0x4eb4e3){var _0x1432b8;if(_0x5599ec[_0x04b2('0x20')][_0x04b2('0x21')]['id']){db['User'][_0x04b2('0x22')]({'attributes':['id',_0x04b2('0x5'),'role',_0x04b2('0x23')],'where':{'id':_0x5599ec[_0x04b2('0x20')][_0x04b2('0x21')]['id']},'include':[{'model':db[_0x04b2('0x24')],'as':_0x04b2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x27')],'as':_0x04b2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x2a')],'as':_0x04b2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x2c')],'as':_0x04b2('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x04b2('0xd')](function(_0x1f07c4){if(_0x1f07c4){_0x1432b8=_0x1f07c4;_0x5599ec[_0x17a70a](util['format']('user:%s',_0x1f07c4['name']));var _0x5228bf=[];switch(_0x1f07c4[_0x04b2('0x8')]){case _0x04b2('0x2e'):_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a](_0x04b2('0x30'));if(queryQueues[_0x04b2('0x31')]('include')){delete queryQueues[_0x04b2('0x32')];}_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x34')]['findAll'](queryQueues));_0x5228bf['push'](db['ChatQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['FaxQueue']['findAll'](queryQueues));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x35')][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['MailQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf['push'](db['OpenchannelQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf['push'](db[_0x04b2('0x36')][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['User'][_0x04b2('0x15')](queryTelephones));_0x5228bf['push'](db['Trunk']['findAll'](queryTrunks));_0x5228bf[_0x04b2('0x33')](db['Campaign']['findAll'](queryCampaigns));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x7')]['findAll'](queryAgents));break;case _0x04b2('0x37'):_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a]('voice:outbound');_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0xf'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x34')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x10'),_0x1f07c4['userProfileId'],'ChatQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources('FaxQueues',_0x1f07c4[_0x04b2('0x23')],'FaxQueue'));_0x5228bf['push'](getAssociatedResources(_0x04b2('0x11'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x35')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x12'),_0x1f07c4[_0x04b2('0x23')],'MailQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x38'),_0x1f07c4[_0x04b2('0x23')],'OpenchannelQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources('WhatsappQueues',_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x36')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x14'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x7')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x16'),_0x1f07c4['userProfileId'],_0x04b2('0x39')));_0x5228bf['push'](getAssociatedResources(_0x04b2('0x3a'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x3b')));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x7')][_0x04b2('0x15')](queryAgents));break;case'agent':_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a](_0x04b2('0x30'));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3c')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3d')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4['getFaxQueues']({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3e')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3f')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x40')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x41')]({'attributes':['id',_0x04b2('0x5')]}));break;}return BPromise[_0x04b2('0x42')](_0x5228bf);}})[_0x04b2('0xd')](function(_0x9a90f6){if(_0x9a90f6&&_0x9a90f6[_0x04b2('0x1e')]){for(var _0x4016f5=0x0;_0x4016f5<_0x9a90f6[_0x04b2('0x1e')];_0x4016f5+=0x1){for(var _0x3b5d26=0x0;_0x3b5d26<_0x9a90f6[_0x4016f5]['length'];_0x3b5d26+=0x1){switch(_0x4016f5){case 0x0:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x43'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x1:joinOrLeaveQueues(_0x5599ec,_0x17a70a,'chat',_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x2:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x44'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x3:joinOrLeaveQueues(_0x5599ec,_0x17a70a,'sms',_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x4:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x45'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x5:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x46'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x6:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x47'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x7:if(_0x1432b8['role']!==_0x04b2('0x9'))_0x5599ec[_0x17a70a](util[_0x04b2('0x1c')](_0x04b2('0x48'),_0x9a90f6[_0x4016f5][_0x3b5d26]['name']));break;case 0x8:if(_0x1432b8[_0x04b2('0x8')]!=='agent')_0x5599ec[_0x17a70a](util['format']('trunk:%s',_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x5')]));break;case 0x9:if(_0x1432b8[_0x04b2('0x8')]!=='agent')_0x5599ec[_0x17a70a](util['format'](_0x04b2('0x49'),_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x1b')],_0x9a90f6[_0x4016f5][_0x3b5d26]['name']));break;case 0xa:_0x5599ec[_0x17a70a](util['format'](_0x04b2('0x1f'),_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x5')]));break;}}}}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0xe053a0=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x25')],'id');return _0x1432b8[_0x04b2('0x4b')](_0xe053a0)['then'](function(){for(var _0x6a8903=0x0;_0x6a8903<_0xe053a0[_0x04b2('0x1e')];_0x6a8903+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x4d'),{'ChatInteractionId':Number(_0xe053a0[_0x6a8903]),'UserId':Number(_0x1432b8['id'])});}});}})['then'](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x2412d5=_['map'](_0x1432b8['MailInteractions'],'id');return _0x1432b8['removeMailInteractions'](_0x2412d5)[_0x04b2('0xd')](function(){for(var _0x1e347b=0x0;_0x1e347b<_0x2412d5[_0x04b2('0x1e')];_0x1e347b+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x4e'),{'MailInteractionId':Number(_0x2412d5[_0x1e347b]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x2655ad=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x28')],'id');return _0x1432b8[_0x04b2('0x4f')](_0x2655ad)[_0x04b2('0xd')](function(){for(var _0x2b1bf1=0x0;_0x2b1bf1<_0x2655ad['length'];_0x2b1bf1+=0x1){_0x4eb4e3['emit'](_0x04b2('0x50'),{'FaxInteractionId':Number(_0x2655ad[_0x2b1bf1]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0xd55a40=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x51')],'id');return _0x1432b8[_0x04b2('0x52')](_0xd55a40)[_0x04b2('0xd')](function(){for(var _0x22caf3=0x0;_0x22caf3<_0xd55a40['length'];_0x22caf3+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x53'),{'SmsInteractionId':Number(_0xd55a40[_0x22caf3]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a==='leave'){var _0x7eefb=_['map'](_0x1432b8['OpenchannelInteractions'],'id');return _0x1432b8[_0x04b2('0x54')](_0x7eefb)[_0x04b2('0xd')](function(){for(var _0x147c01=0x0;_0x147c01<_0x7eefb['length'];_0x147c01+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x55'),{'OpenchannelInteractionId':Number(_0x7eefb[_0x147c01]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x4dd7cf=_['map'](_0x1432b8[_0x04b2('0x2d')],'id');return _0x1432b8[_0x04b2('0x56')](_0x4dd7cf)[_0x04b2('0xd')](function(){for(var _0x3d110d=0x0;_0x3d110d<_0x4dd7cf[_0x04b2('0x1e')];_0x3d110d+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x57'),{'WhatsappInteractionId':Number(_0x4dd7cf[_0x3d110d]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0x58')](function(_0x410a9d){_0x5599ec[_0x04b2('0x59')](_0x410a9d);});}}function onDisconnect(_0x16f422,_0x233fa1){joinOrLeave(_0x16f422,_0x04b2('0x4a'),_0x233fa1);}function onConnect(_0x455ad4){joinOrLeave(_0x455ad4,_0x04b2('0x5a'));}exports[_0x04b2('0x5b')]=function(_0x476065){_0x476065['on'](_0x04b2('0x5c'),function(_0x15f479){_0x15f479['setMaxListeners'](0x0);_0x15f479[_0x04b2('0x5d')]=_0x15f479[_0x04b2('0x5e')][_0x04b2('0x5c')][_0x04b2('0x5f')]+':'+_0x15f479[_0x04b2('0x5e')][_0x04b2('0x5c')][_0x04b2('0x60')];_0x15f479[_0x04b2('0x61')]=new Date();_0x15f479[_0x04b2('0x59')]=function(_0x11c53c){console[_0x04b2('0x59')](_0x04b2('0x62')+_0x15f479[_0x04b2('0x63')][_0x04b2('0x5')]+'['+_0x15f479[_0x04b2('0x5d')]+']',_0x11c53c);};_0x15f479['on'](_0x04b2('0x64'),function(){onDisconnect(_0x15f479,_0x476065);_0x15f479[_0x04b2('0x59')]('DISCONNECTED');});onConnect(_0x15f479);_0x15f479[_0x04b2('0x59')]('CONNECTED');});}; \ No newline at end of file +var _0x3c04=['role','agent','type','UserProfileSection','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','ivr','then','format','%s:queue:%s','length','user:%s','handshake','query','find','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','Campaign','user','voice:inbound','userProfileId','SmsQueues','SmsQueue','OpenchannelQueue','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','../mysqldb','./environment','name','Agents','User'];(function(_0x1578a6,_0x5da5f5){var _0x5c5ff2=function(_0x33a033){while(--_0x33a033){_0x1578a6['push'](_0x1578a6['shift']());}};_0x5c5ff2(++_0x5da5f5);}(_0x3c04,0x192));var _0x43c0=function(_0x54bdf6,_0xb6273){_0x54bdf6=_0x54bdf6-0x0;var _0x10eae6=_0x3c04[_0x54bdf6];return _0x10eae6;};'use strict';var _=require('lodash');var util=require(_0x43c0('0x0'));var BPromise=require('bluebird');var db=require(_0x43c0('0x1'))['db'];var config=require(_0x43c0('0x2'));var queryQueues={'attributes':['id',_0x43c0('0x3')],'include':[{'as':_0x43c0('0x4'),'model':db[_0x43c0('0x5')],'attributes':['id',_0x43c0('0x3'),_0x43c0('0x6')],'raw':!![],'where':{'role':_0x43c0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x43c0('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x43c0('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x43c0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x43c0('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x100fb8,_0x3efc14,_0x1b54f2){return db[_0x43c0('0x9')]['findOne']({'where':{'name':_0x100fb8,'userProfileId':_0x3efc14},'raw':!![]})['then'](function(_0x2c4153){if(_0x2c4153){if(_0x2c4153['autoAssociation']){switch(_0x100fb8){case _0x43c0('0xa'):case _0x43c0('0xb'):case _0x43c0('0xc'):case'SmsQueues':case _0x43c0('0xd'):case _0x43c0('0xe'):case _0x43c0('0xf'):return db[_0x1b54f2][_0x43c0('0x10')](queryQueues);case _0x43c0('0x11'):return db[_0x1b54f2]['findAll'](queryTelephones);case _0x43c0('0x12'):return db[_0x1b54f2][_0x43c0('0x10')](queryTrunks);case _0x43c0('0x13'):return db[_0x1b54f2][_0x43c0('0x10')](queryCampaigns);}}else{return db[_0x43c0('0x14')]['findAll']({'attributes':[_0x43c0('0x15')],'where':{'sectionId':_0x2c4153['id']},'raw':!![]})['then'](function(_0x1e35d0){if(_0x1e35d0){var _0x47aade={'where':{'id':_[_0x43c0('0x16')](_0x1e35d0,_0x43c0('0x15'))},'raw':!![]};switch(_0x1b54f2){case _0x43c0('0x5'):_0x47aade[_0x43c0('0x17')][_0x43c0('0x6')]='telephone';break;case'Campaign':_0x47aade['where'][_0x43c0('0x8')]=_0x43c0('0x18');break;}return db[_0x1b54f2][_0x43c0('0x10')](_0x47aade);}else{return[];}});}}else{return[];}})[_0x43c0('0x19')](function(_0x333f60){return _0x333f60;});}function joinOrLeaveQueues(_0x31aa65,_0x5c3c68,_0xe1e717,_0x2aed3d){_0x31aa65[_0x5c3c68](util[_0x43c0('0x1a')](_0x43c0('0x1b'),_0xe1e717,_0x2aed3d[_0x43c0('0x3')]));if(_0x2aed3d[_0x43c0('0x4')]){for(var _0x3d5aad=0x0;_0x3d5aad<_0x2aed3d[_0x43c0('0x4')][_0x43c0('0x1c')];_0x3d5aad+=0x1){_0x31aa65[_0x5c3c68](util[_0x43c0('0x1a')](_0x43c0('0x1d'),_0x2aed3d[_0x43c0('0x4')][_0x3d5aad][_0x43c0('0x3')]));}}}function joinOrLeave(_0x115395,_0x4a3723,_0xf3ff3e){var _0x4aab88;if(_0x115395[_0x43c0('0x1e')][_0x43c0('0x1f')]['id']){db[_0x43c0('0x5')][_0x43c0('0x20')]({'attributes':['id','name',_0x43c0('0x6'),'userProfileId'],'where':{'id':_0x115395[_0x43c0('0x1e')][_0x43c0('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x43c0('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x43c0('0x22')],'as':_0x43c0('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x43c0('0x24')],'as':_0x43c0('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x43c0('0x26')],'as':_0x43c0('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x43c0('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x43c0('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x43c0('0x19')](function(_0x34530e){if(_0x34530e){_0x4aab88=_0x34530e;_0x115395[_0x4a3723](util[_0x43c0('0x1a')](_0x43c0('0x1d'),_0x34530e[_0x43c0('0x3')]));var _0x7dfd38=[];switch(_0x34530e['role']){case _0x43c0('0x2a'):_0x115395[_0x4a3723]('voice:inbound');_0x115395[_0x4a3723](_0x43c0('0x2b'));if(queryQueues[_0x43c0('0x2c')](_0x43c0('0x2d'))){delete queryQueues['include'];}_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x2f')]['findAll'](queryQueues));_0x7dfd38['push'](db[_0x43c0('0x30')][_0x43c0('0x10')](queryQueues));_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x31')][_0x43c0('0x10')](queryQueues));_0x7dfd38[_0x43c0('0x2e')](db['SmsQueue'][_0x43c0('0x10')](queryQueues));_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x32')][_0x43c0('0x10')](queryQueues));_0x7dfd38['push'](db['OpenchannelQueue'][_0x43c0('0x10')](queryQueues));_0x7dfd38['push'](db[_0x43c0('0x33')]['findAll'](queryQueues));_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x5')][_0x43c0('0x10')](queryTelephones));_0x7dfd38['push'](db['Trunk'][_0x43c0('0x10')](queryTrunks));_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x34')][_0x43c0('0x10')](queryCampaigns));_0x7dfd38['push'](db[_0x43c0('0x5')][_0x43c0('0x10')](queryAgents));break;case _0x43c0('0x35'):_0x115395[_0x4a3723](_0x43c0('0x36'));_0x115395[_0x4a3723](_0x43c0('0x2b'));_0x7dfd38['push'](getAssociatedResources(_0x43c0('0xa'),_0x34530e[_0x43c0('0x37')],_0x43c0('0x2f')));_0x7dfd38[_0x43c0('0x2e')](getAssociatedResources(_0x43c0('0xb'),_0x34530e[_0x43c0('0x37')],_0x43c0('0x30')));_0x7dfd38['push'](getAssociatedResources(_0x43c0('0xc'),_0x34530e['userProfileId'],_0x43c0('0x31')));_0x7dfd38['push'](getAssociatedResources(_0x43c0('0x38'),_0x34530e['userProfileId'],_0x43c0('0x39')));_0x7dfd38[_0x43c0('0x2e')](getAssociatedResources(_0x43c0('0xd'),_0x34530e[_0x43c0('0x37')],_0x43c0('0x32')));_0x7dfd38[_0x43c0('0x2e')](getAssociatedResources(_0x43c0('0xe'),_0x34530e[_0x43c0('0x37')],_0x43c0('0x3a')));_0x7dfd38[_0x43c0('0x2e')](getAssociatedResources('WhatsappQueues',_0x34530e['userProfileId'],_0x43c0('0x33')));_0x7dfd38['push'](getAssociatedResources('Telephones',_0x34530e[_0x43c0('0x37')],_0x43c0('0x5')));_0x7dfd38['push'](getAssociatedResources(_0x43c0('0x12'),_0x34530e['userProfileId'],_0x43c0('0x3b')));_0x7dfd38[_0x43c0('0x2e')](getAssociatedResources(_0x43c0('0x13'),_0x34530e[_0x43c0('0x37')],_0x43c0('0x34')));_0x7dfd38[_0x43c0('0x2e')](db[_0x43c0('0x5')][_0x43c0('0x10')](queryAgents));break;case _0x43c0('0x7'):_0x115395[_0x4a3723](_0x43c0('0x36'));_0x115395[_0x4a3723](_0x43c0('0x2b'));_0x7dfd38[_0x43c0('0x2e')](_0x34530e[_0x43c0('0x3c')]({'attributes':['id','name']}));_0x7dfd38[_0x43c0('0x2e')](_0x34530e[_0x43c0('0x3d')]({'attributes':['id',_0x43c0('0x3')]}));_0x7dfd38[_0x43c0('0x2e')](_0x34530e['getFaxQueues']({'attributes':['id',_0x43c0('0x3')]}));_0x7dfd38['push'](_0x34530e[_0x43c0('0x3e')]({'attributes':['id','name']}));_0x7dfd38[_0x43c0('0x2e')](_0x34530e[_0x43c0('0x3f')]({'attributes':['id',_0x43c0('0x3')]}));_0x7dfd38['push'](_0x34530e[_0x43c0('0x40')]({'attributes':['id',_0x43c0('0x3')]}));_0x7dfd38[_0x43c0('0x2e')](_0x34530e[_0x43c0('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0x43c0('0x42')](_0x7dfd38);}})[_0x43c0('0x19')](function(_0xea2cc2){if(_0xea2cc2&&_0xea2cc2['length']){for(var _0x195961=0x0;_0x195961<_0xea2cc2[_0x43c0('0x1c')];_0x195961+=0x1){for(var _0x496f84=0x0;_0x496f84<_0xea2cc2[_0x195961][_0x43c0('0x1c')];_0x496f84+=0x1){switch(_0x195961){case 0x0:joinOrLeaveQueues(_0x115395,_0x4a3723,_0x43c0('0x43'),_0xea2cc2[_0x195961][_0x496f84]);break;case 0x1:joinOrLeaveQueues(_0x115395,_0x4a3723,'chat',_0xea2cc2[_0x195961][_0x496f84]);break;case 0x2:joinOrLeaveQueues(_0x115395,_0x4a3723,'fax',_0xea2cc2[_0x195961][_0x496f84]);break;case 0x3:joinOrLeaveQueues(_0x115395,_0x4a3723,'sms',_0xea2cc2[_0x195961][_0x496f84]);break;case 0x4:joinOrLeaveQueues(_0x115395,_0x4a3723,_0x43c0('0x44'),_0xea2cc2[_0x195961][_0x496f84]);break;case 0x5:joinOrLeaveQueues(_0x115395,_0x4a3723,_0x43c0('0x45'),_0xea2cc2[_0x195961][_0x496f84]);break;case 0x6:joinOrLeaveQueues(_0x115395,_0x4a3723,_0x43c0('0x46'),_0xea2cc2[_0x195961][_0x496f84]);break;case 0x7:if(_0x4aab88['role']!==_0x43c0('0x7'))_0x115395[_0x4a3723](util[_0x43c0('0x1a')](_0x43c0('0x47'),_0xea2cc2[_0x195961][_0x496f84][_0x43c0('0x3')]));break;case 0x8:if(_0x4aab88[_0x43c0('0x6')]!==_0x43c0('0x7'))_0x115395[_0x4a3723](util[_0x43c0('0x1a')](_0x43c0('0x48'),_0xea2cc2[_0x195961][_0x496f84][_0x43c0('0x3')]));break;case 0x9:if(_0x4aab88[_0x43c0('0x6')]!==_0x43c0('0x7'))_0x115395[_0x4a3723](util[_0x43c0('0x1a')](_0x43c0('0x49'),_0xea2cc2[_0x195961][_0x496f84][_0x43c0('0x8')],_0xea2cc2[_0x195961][_0x496f84]['name']));break;case 0xa:_0x115395[_0x4a3723](util[_0x43c0('0x1a')](_0x43c0('0x1d'),_0xea2cc2[_0x195961][_0x496f84]['name']));break;}}}}})['then'](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0x54fe69=_[_0x43c0('0x16')](_0x4aab88[_0x43c0('0x21')],'id');return _0x4aab88[_0x43c0('0x4b')](_0x54fe69)['then'](function(){for(var _0x5aa2c3=0x0;_0x5aa2c3<_0x54fe69[_0x43c0('0x1c')];_0x5aa2c3+=0x1){_0xf3ff3e[_0x43c0('0x4c')](_0x43c0('0x4d'),{'ChatInteractionId':Number(_0x54fe69[_0x5aa2c3]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x19')](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0xc2fdfc=_[_0x43c0('0x16')](_0x4aab88['MailInteractions'],'id');return _0x4aab88['removeMailInteractions'](_0xc2fdfc)[_0x43c0('0x19')](function(){for(var _0x516680=0x0;_0x516680<_0xc2fdfc[_0x43c0('0x1c')];_0x516680+=0x1){_0xf3ff3e[_0x43c0('0x4c')](_0x43c0('0x4e'),{'MailInteractionId':Number(_0xc2fdfc[_0x516680]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x19')](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0x4689da=_[_0x43c0('0x16')](_0x4aab88[_0x43c0('0x25')],'id');return _0x4aab88[_0x43c0('0x4f')](_0x4689da)[_0x43c0('0x19')](function(){for(var _0x5954b5=0x0;_0x5954b5<_0x4689da[_0x43c0('0x1c')];_0x5954b5+=0x1){_0xf3ff3e[_0x43c0('0x4c')](_0x43c0('0x50'),{'FaxInteractionId':Number(_0x4689da[_0x5954b5]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x19')](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0x34344d=_[_0x43c0('0x16')](_0x4aab88[_0x43c0('0x27')],'id');return _0x4aab88[_0x43c0('0x51')](_0x34344d)[_0x43c0('0x19')](function(){for(var _0x523c25=0x0;_0x523c25<_0x34344d['length'];_0x523c25+=0x1){_0xf3ff3e[_0x43c0('0x4c')](_0x43c0('0x52'),{'SmsInteractionId':Number(_0x34344d[_0x523c25]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x19')](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0x551ed5=_['map'](_0x4aab88[_0x43c0('0x53')],'id');return _0x4aab88[_0x43c0('0x54')](_0x551ed5)[_0x43c0('0x19')](function(){for(var _0x12f98e=0x0;_0x12f98e<_0x551ed5[_0x43c0('0x1c')];_0x12f98e+=0x1){_0xf3ff3e[_0x43c0('0x4c')](_0x43c0('0x55'),{'OpenchannelInteractionId':Number(_0x551ed5[_0x12f98e]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x19')](function(){if(_0x4a3723===_0x43c0('0x4a')){var _0x54e773=_[_0x43c0('0x16')](_0x4aab88['WhatsappInteractions'],'id');return _0x4aab88[_0x43c0('0x56')](_0x54e773)[_0x43c0('0x19')](function(){for(var _0x43d9c2=0x0;_0x43d9c2<_0x54e773[_0x43c0('0x1c')];_0x43d9c2+=0x1){_0xf3ff3e[_0x43c0('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x54e773[_0x43d9c2]),'UserId':Number(_0x4aab88['id'])});}});}})[_0x43c0('0x57')](function(_0x27b84a){_0x115395[_0x43c0('0x58')](_0x27b84a);});}}function onDisconnect(_0x2b0545,_0x3599de){joinOrLeave(_0x2b0545,'leave',_0x3599de);}function onConnect(_0x3b174a){joinOrLeave(_0x3b174a,_0x43c0('0x59'));}exports[_0x43c0('0x5a')]=function(_0xca6361){_0xca6361['on'](_0x43c0('0x5b'),function(_0x222a93){_0x222a93[_0x43c0('0x5c')](0x0);_0x222a93[_0x43c0('0x5d')]=_0x222a93[_0x43c0('0x5e')][_0x43c0('0x5b')][_0x43c0('0x5f')]+':'+_0x222a93['request'][_0x43c0('0x5b')][_0x43c0('0x60')];_0x222a93['connectedAt']=new Date();_0x222a93['log']=function(_0x480886){console[_0x43c0('0x58')](_0x43c0('0x61')+_0x222a93[_0x43c0('0x62')][_0x43c0('0x3')]+'['+_0x222a93[_0x43c0('0x5d')]+']',_0x480886);};_0x222a93['on'](_0x43c0('0x63'),function(){onDisconnect(_0x222a93,_0xca6361);_0x222a93[_0x43c0('0x58')](_0x43c0('0x64'));});onConnect(_0x222a93);_0x222a93['log'](_0x43c0('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 74bf6b9..1e04dfe 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 _0xbd1e=['SIP/%s','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','name','AfterCreate','closed','substatus','AfterUpdate','User','find','fullname','internal','default','length','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','ChatInteraction','afterCreate','afterUpdate','closedinteraction','Chat','ChatMessage','ChatOfflineMessage','newmessage','SmsInteraction','newinteraction','Sms','SmsMessage','Whatsapp','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format'];(function(_0x2d0f87,_0x23395a){var _0x47bea0=function(_0x55e3eb){while(--_0x55e3eb){_0x2d0f87['push'](_0x2d0f87['shift']());}};_0x47bea0(++_0x23395a);}(_0xbd1e,0xa8));var _0xebd1=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0xbd1e[_0xf4666e];return _0x1853f1;};'use strict';var util=require(_0xebd1('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xebd1('0x1'));var logger=require(_0xebd1('0x2'))(_0xebd1('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xebd1('0x4'),'event':_0xebd1('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0xebd1('0x6'),'condition':_0xebd1('0x7'),'callback':afterUpdate},{'channel':_0xebd1('0x8'),'model':_0xebd1('0x9'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xebd1('0x8'),'model':_0xebd1('0xa'),'event':'afterCreate','condition':_0xebd1('0xb'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xebd1('0xc'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xd'),'callback':afterCreate},{'channel':_0xebd1('0xe'),'model':_0xebd1('0xc'),'event':_0xebd1('0x6'),'condition':_0xebd1('0x7'),'callback':afterUpdate},{'channel':'Sms','model':_0xebd1('0xf'),'event':'afterCreate','condition':_0xebd1('0xb'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xebd1('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xebd1('0x10'),'model':'WhatsappInteraction','event':_0xebd1('0x6'),'condition':_0xebd1('0x7'),'callback':afterUpdate},{'channel':_0xebd1('0x10'),'model':'WhatsappMessage','event':_0xebd1('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xebd1('0x11'),'model':_0xebd1('0x12'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xd'),'callback':afterCreate},{'channel':_0xebd1('0x11'),'model':_0xebd1('0x12'),'event':_0xebd1('0x6'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0xebd1('0x5'),'condition':_0xebd1('0xb'),'callback':afterCreateMessage},{'channel':_0xebd1('0x13'),'model':_0xebd1('0x14'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xd'),'callback':afterCreate},{'channel':_0xebd1('0x13'),'model':_0xebd1('0x14'),'event':_0xebd1('0x6'),'condition':_0xebd1('0x7'),'callback':afterUpdate},{'channel':_0xebd1('0x13'),'model':_0xebd1('0x15'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xb'),'callback':afterCreateMessage},{'channel':_0xebd1('0x16'),'model':_0xebd1('0x17'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xd'),'callback':afterCreate},{'channel':_0xebd1('0x16'),'model':_0xebd1('0x17'),'event':'afterUpdate','condition':_0xebd1('0x7'),'callback':afterUpdate},{'channel':_0xebd1('0x16'),'model':_0xebd1('0x18'),'event':_0xebd1('0x5'),'condition':_0xebd1('0xb'),'callback':afterCreateMessage}];function request(_0x3a8a04){return client[_0xebd1('0x19')](_0xebd1('0x1a'),_0x3a8a04)[_0xebd1('0x1b')](function(_0x1fe7b0){logger[_0xebd1('0x1c')]('Trigger,\x20%s',_0xebd1('0x1a'),_0x1fe7b0);if(_0x1fe7b0[_0xebd1('0x1d')]){if(_0x1fe7b0[_0xebd1('0x1d')][_0xebd1('0x1e')]===0x1f4){logger[_0xebd1('0x1d')](_0xebd1('0x1f'),_0xebd1('0x1a'),_0x1fe7b0[_0xebd1('0x1d')]);}}})[_0xebd1('0x20')](function(_0x60d49c){logger['error']('Trigger,\x20%s',_0xebd1('0x1a'),_0x60d49c);});}function afterCreateMessage(_0x3acc0e){return function(_0x284a95){_0x284a95=_0x284a95[_0xebd1('0x21')]({'plain':!![]});_0x284a95[_0xebd1('0x22')]=_0x3acc0e;_0x284a95[_0xebd1('0x23')]=_0x3acc0e;_0x284a95[_0xebd1('0x24')]=_0x284a95[_0xebd1('0x25')];Promise[_0xebd1('0x26')]()[_0xebd1('0x1b')](function(){if(typeof _0x284a95[_0xebd1('0x27')]===_0xebd1('0x28'))return null;var _0x490893=_0xebd1('0x29')+_0x284a95[_0xebd1('0x27')];return db[_0xebd1('0x2a')][_0xebd1('0x2b')](_0x490893,{'type':db[_0xebd1('0x2c')][_0xebd1('0x2d')][_0xebd1('0x2e')],'raw':!![]});})['then'](function(_0x4cba20){if(_0x4cba20){_0x284a95[_0xebd1('0x2f')]=_0x4cba20[0x0];}if(typeof _0x284a95[_0xebd1('0x30')]===_0xebd1('0x28'))return;return getAgent(_0x284a95[_0xebd1('0x30')]);})[_0xebd1('0x1b')](function(_0x4ff2d4){if(_0x4ff2d4){_0x284a95[_0xebd1('0x31')]=util[_0xebd1('0x32')](_0xebd1('0x33'),_0x4ff2d4['name']);_0x284a95[_0xebd1('0x34')]=_0x4ff2d4;_0x284a95[_0xebd1('0x22')]=_0x3acc0e;return request({'event':_0xebd1('0x35'),'message':_0x284a95});}else{return request({'event':_0xebd1('0x36'),'message':_0x284a95});}})[_0xebd1('0x20')](function(_0xb9fca7){logger[_0xebd1('0x1d')](_0xebd1('0x1f'),_0xebd1('0x37'),_0xb9fca7);});};}function afterCreateOfflineMessage(_0x2e056f){return function(_0x477f02){_0x477f02=_0x477f02[_0xebd1('0x21')]({'plain':!![]});_0x477f02[_0xebd1('0x22')]=_0x2e056f;_0x477f02[_0xebd1('0x23')]=_0x2e056f;_0x477f02[_0xebd1('0x24')]=_0xebd1('0x38');return request({'event':_0x477f02[_0xebd1('0x24')],'message':_0x477f02});};}function afterCreate(_0x42f986,_0x2759fa){return function(_0x5c4fb5){_0x5c4fb5=_0x5c4fb5[_0xebd1('0x21')]({'plain':!![]});_0x5c4fb5[_0xebd1('0x22')]=_0x42f986;_0x5c4fb5[_0xebd1('0x23')]=_0x42f986;_0x5c4fb5[_0xebd1('0x24')]='opened';Promise['resolve']()[_0xebd1('0x1b')](function(){var _0x5b0447=_0xebd1('0x29')+_0x5c4fb5['ContactId'];return db['sequelize'][_0xebd1('0x2b')](_0x5b0447,{'type':db[_0xebd1('0x2c')]['QueryTypes'][_0xebd1('0x2e')],'raw':!![]});})['then'](function(_0xa3250b){if(_0xa3250b){_0x5c4fb5['contact']=_0xa3250b[0x0];}if(typeof _0x5c4fb5[_0xebd1('0x30')]===_0xebd1('0x28'))return;return getAgent(_0x5c4fb5[_0xebd1('0x30')]);})[_0xebd1('0x1b')](function(_0x50882e){if(_0x50882e){_0x5c4fb5[_0xebd1('0x31')]=util[_0xebd1('0x32')](_0xebd1('0x33'),_0x50882e[_0xebd1('0x39')]);_0x5c4fb5[_0xebd1('0x34')]=_0x50882e;}return request({'event':_0x2759fa,'message':_0x5c4fb5});})[_0xebd1('0x20')](function(_0x2a413b){logger[_0xebd1('0x1d')]('Trigger,\x20%s',_0xebd1('0x3a'),_0x2a413b);});};}function afterUpdate(_0x8969cd){return function(_0x1c0a3c){var _0x2d26f3=_0x1c0a3c['changed'](_0xebd1('0x3b'))&&_0x1c0a3c[_0xebd1('0x3b')];var _0x540ecf=_0x1c0a3c['changed'](_0xebd1('0x3c'));if(_0x2d26f3||_0x540ecf){var _0x30cf9d=_0x2d26f3?_0xebd1('0x7'):_0xebd1('0x3c');var _0x152ec2=_0x1c0a3c[_0xebd1('0x21')]({'plain':!![]});_0x152ec2['channel']=_0x8969cd;_0x152ec2[_0xebd1('0x23')]=_0x8969cd;_0x152ec2[_0xebd1('0x24')]=_0x2d26f3?_0xebd1('0x3b'):_0xebd1('0x3c');var _0x843663='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x152ec2[_0xebd1('0x27')];return db[_0xebd1('0x2a')][_0xebd1('0x2b')](_0x843663,{'type':db[_0xebd1('0x2c')][_0xebd1('0x2d')][_0xebd1('0x2e')],'raw':!![]})[_0xebd1('0x1b')](function(_0x1550c2){if(_0x1550c2){_0x152ec2[_0xebd1('0x2f')]=_0x1550c2[0x0];}if(typeof _0x152ec2['UserId']===_0xebd1('0x28'))return;return getAgent(_0x152ec2[_0xebd1('0x30')]);})[_0xebd1('0x1b')](function(_0x3783a1){if(_0x3783a1){_0x152ec2[_0xebd1('0x31')]=util['format']('SIP/%s',_0x3783a1[_0xebd1('0x39')]);_0x152ec2[_0xebd1('0x34')]=_0x3783a1;}return request({'event':_0x30cf9d,'message':_0x152ec2});})['catch'](function(_0x257ff5){logger[_0xebd1('0x1d')](_0xebd1('0x1f'),_0xebd1('0x3d'),_0x257ff5);});}};}function getAgent(_0x40f306){return db[_0xebd1('0x3e')][_0xebd1('0x3f')]({'where':{'id':_0x40f306},'attributes':['id','name',_0xebd1('0x40'),'email',_0xebd1('0x41')],'raw':!![]})[_0xebd1('0x1b')](function(_0x4b2441){return _0x4b2441;});}exports[_0xebd1('0x42')]=function(){for(var _0x2dec65=0x0;_0x2dec65=_0x1c7ec4[_0x07f0('0x14')]){throw Error(_0x07f0('0x15'));}_0x59c5df(_0x46363c);})[_0x07f0('0x16')](function(_0x147b78){_0x3048f1(_0x147b78);});});}; \ No newline at end of file +var _0x85d4=['catch','lodash','bluebird','./license/util','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x207057,_0x23081d){var _0x1e9a2d=function(_0x4d5c4a){while(--_0x4d5c4a){_0x207057['push'](_0x207057['shift']());}};_0x1e9a2d(++_0x23081d);}(_0x85d4,0x12d));var _0x485d=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x85d4[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x485d('0x0'));var BPromise=require(_0x485d('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x485d('0x2'));var channels=['voice','mail',_0x485d('0x3'),_0x485d('0x4'),_0x485d('0x5'),_0x485d('0x6'),_0x485d('0x7')];exports[_0x485d('0x8')]=function(){return channels;};exports[_0x485d('0x9')]=function(_0x44507f){_0x44507f=_0x44507f[_0x485d('0xa')]();return _[_0x485d('0xb')](channels,_0x44507f);};exports[_0x485d('0xc')]=function(_0x2713fe,_0x133f9e,_0x8ff355,_0xece4ce){var _0x44f25f={'loginAttempts':_0x133f9e,'blocked':_0x8ff355};if(!_[_0x485d('0xd')](_0xece4ce)){_0x44f25f[_0x485d('0xe')]=_0xece4ce;}return _0x2713fe[_0x485d('0xf')](_0x44f25f);};exports[_0x485d('0x10')]=function(_0x51ec6d){return new BPromise(function(_0xa91511,_0x339087){var _0x439603=0x0;if(_0x51ec6d[_0x485d('0x11')]!==_0x485d('0x12')){_0xa91511(_0x51ec6d);}db[_0x485d('0x13')][_0x485d('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x51ec6d['id']}}})[_0x485d('0x15')](function(_0x26b546){_0x439603=_0x26b546;return util[_0x485d('0x10')]();})[_0x485d('0x15')](function(_0x14433e){if(_0x14433e&&_0x14433e['agents']&&_0x439603>=_0x14433e[_0x485d('0x16')]){throw Error(_0x485d('0x17'));}_0xa91511(_0x51ec6d);})[_0x485d('0x18')](function(_0x26e018){_0x339087(_0x26e018);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 3067909..4336a2e 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x4ad937,_0x3b1001){var _0x360227=function(_0x3e9522){while(--_0x3e9522){_0x4ad937['push'](_0x4ad937['shift']());}};_0x360227(++_0x3b1001);}(_0xadb5,0xad));var _0x5adb=function(_0x24bb84,_0xe4f79a){_0x24bb84=_0x24bb84-0x0;var _0x1dca24=_0xadb5[_0x24bb84];return _0x1dca24;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x6dc0=['name','inherits','Bad\x20Request','Entity\x20not\x20found','Out\x20Of\x20Interval','code','details','error','stack','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error'];(function(_0x4e7e31,_0x4018ba){var _0x56fcca=function(_0x1d6e67){while(--_0x1d6e67){_0x4e7e31['push'](_0x4e7e31['shift']());}};_0x56fcca(++_0x4018ba);}(_0x6dc0,0xb6));var _0x06dc=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x6dc0[_0x43371b];return _0x19cd26;};'use strict';var util=require(_0x06dc('0x0'));var logger=require(_0x06dc('0x1'))(_0x06dc('0x2'));var APIError=function(_0x4aec20,_0x2277fa){this[_0x06dc('0x3')]=_0x4aec20||_0x06dc('0x4');this[_0x06dc('0x5')]=_0x2277fa||'Error';util[_0x06dc('0x6')](APIError,Error);};var APIBadRequestError=function(_0x30437f){this['message']=_0x30437f||_0x06dc('0x7');this['name']=_0x06dc('0x7');util[_0x06dc('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x14c15b){this[_0x06dc('0x3')]=_0x14c15b||_0x06dc('0x8');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x128ea7){this[_0x06dc('0x3')]=_0x128ea7||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x06dc('0x5')]=_0x06dc('0x9');this[_0x06dc('0xa')]=0x193;this[_0x06dc('0xb')]={'type':'OutOfInterval'};util[_0x06dc('0x6')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x2f6fb2){switch(_0x2f6fb2){case'Bad\x20Request':return 0x190;case'Forbidden','Out\x20Of\x20Interval':return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x1888ed){if(_0x1888ed==='Out\x20Of\x20Interval')return _0x1888ed;return null;}function handleError(_0x57d3e3){return function(_0x4874ce){logger[_0x06dc('0xc')](_0x4874ce[_0x06dc('0xd')]);var _0x165d1e=getStatusCode(_0x4874ce['name']);var _0x183302=getCustomStatusMessage(_0x4874ce[_0x06dc('0x5')]);if(_0x4874ce[_0x06dc('0x5')]){delete _0x4874ce[_0x06dc('0x5')];}if(_0x183302){_0x57d3e3['statusMessage']=_0x183302;}return _0x57d3e3[_0x06dc('0xe')](_0x165d1e)[_0x06dc('0xf')](_0x4874ce);};}module[_0x06dc('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c780693..5d75f44 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x40b6=['render','send','exports','404','status'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0x40b6,0xf7));var _0x640b=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x40b6[_0xef8146];return _0x5a6cb0;};'use strict';module[_0x640b('0x0')][0x194]=function pageNotFound(_0x484dc5,_0x2c7a0d){var _0x339b4a=_0x640b('0x1');var _0x282298=0x194;var _0x380b64={'status':_0x282298};_0x2c7a0d[_0x640b('0x2')](_0x380b64[_0x640b('0x2')]);_0x2c7a0d[_0x640b('0x3')](_0x339b4a,{},function(_0x1235d6,_0x207d57){if(_0x1235d6){return _0x2c7a0d['status'](_0x380b64['status'])['json'](_0x380b64);}_0x2c7a0d[_0x640b('0x4')](_0x207d57);});}; \ No newline at end of file +var _0xb7f1=['status','json','send','404'];(function(_0x37f0f5,_0xcc3e59){var _0x42932f=function(_0x41f229){while(--_0x41f229){_0x37f0f5['push'](_0x37f0f5['shift']());}};_0x42932f(++_0xcc3e59);}(_0xb7f1,0xa3));var _0x1b7f=function(_0xfbc535,_0x5229c3){_0xfbc535=_0xfbc535-0x0;var _0x359ccb=_0xb7f1[_0xfbc535];return _0x359ccb;};'use strict';module['exports'][0x194]=function pageNotFound(_0x490829,_0x2b1613){var _0x17fa45=_0x1b7f('0x0');var _0x52aaf0=0x194;var _0x340fed={'status':_0x52aaf0};_0x2b1613['status'](_0x340fed['status']);_0x2b1613['render'](_0x17fa45,{},function(_0x534ebb,_0x4c49e5){if(_0x534ebb){return _0x2b1613[_0x1b7f('0x1')](_0x340fed['status'])[_0x1b7f('0x2')](_0x340fed);}_0x2b1613[_0x1b7f('0x3')](_0x4c49e5);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index cf28584..9587eec 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','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','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','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','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 117a84b..c5ddb5d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/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/dashboards','/api/dashboards/items','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./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/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/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/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./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/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','/api/migrations','./api/migration','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','./api/user-setting','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','snippet','3.5.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings'];(function(_0x523ff9,_0xca72de){var _0x2f5f1f=function(_0x6d3feb){while(--_0x6d3feb){_0x523ff9['push'](_0x523ff9['shift']());}};_0x2f5f1f(++_0xca72de);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3cf053,_0x7a9947){_0x3cf053=_0x3cf053-0x0;var _0x3b55a0=_0xf3cd[_0x3cf053];return _0x3b55a0;};'use strict';var path=require(_0xdf3c('0x0'));var express=require(_0xdf3c('0x1'));var errors=require(_0xdf3c('0x2'));var config=require(_0xdf3c('0x3'));var setupLoggers=require(_0xdf3c('0x4'))[_0xdf3c('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0xdf3c('0x6')]=function(_0x71b446){return setupLoggers(_0x71b446)[_0xdf3c('0x7')](function(){_0x71b446['use'](_0xdf3c('0x8'),require(_0xdf3c('0x9')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xb'),require(_0xdf3c('0xc')));_0x71b446[_0xdf3c('0xa')]('/api/voice/contexts',require(_0xdf3c('0xd')));_0x71b446['use']('/api/voice/extensions',require(_0xdf3c('0xe')));_0x71b446[_0xdf3c('0xa')]('/api/voice/mohs',require(_0xdf3c('0xf')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x10'),require(_0xdf3c('0x11')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x12'),require(_0xdf3c('0x13')));_0x71b446[_0xdf3c('0xa')]('/api/screen/recordings',require(_0xdf3c('0x14')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x15'),require(_0xdf3c('0x16')));_0x71b446['use'](_0xdf3c('0x17'),require(_0xdf3c('0x18')));_0x71b446[_0xdf3c('0xa')]('/api/voice/calls/reports',require(_0xdf3c('0x19')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x1a'),require(_0xdf3c('0x1b')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x1c'),require(_0xdf3c('0x1d')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x1e'),require(_0xdf3c('0x1f')));_0x71b446['use'](_0xdf3c('0x20'),require(_0xdf3c('0x21')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x22'),require(_0xdf3c('0x23')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x24'),require(_0xdf3c('0x25')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x26'),require(_0xdf3c('0x27')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x28'),require('./api/mailAccount'));_0x71b446['use'](_0xdf3c('0x29'),require('./api/mailQueue'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x2a'),require(_0xdf3c('0x2b')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x2c'),require(_0xdf3c('0x2d')));_0x71b446['use'](_0xdf3c('0x2e'),require(_0xdf3c('0x2f')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x30'),require(_0xdf3c('0x31')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x32'),require(_0xdf3c('0x33')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x34'),require('./api/dashboard'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x35'),require('./api/dashboardItem'));_0x71b446[_0xdf3c('0xa')]('/api/fax/accounts',require('./api/faxAccount'));_0x71b446['use'](_0xdf3c('0x36'),require(_0xdf3c('0x37')));_0x71b446['use']('/api/fax/interactions',require(_0xdf3c('0x38')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x39'),require(_0xdf3c('0x3a')));_0x71b446['use'](_0xdf3c('0x3b'),require(_0xdf3c('0x3c')));_0x71b446['use']('/api/fax/reports/queue',require(_0xdf3c('0x3d')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x3e'),require('./api/smsAccount'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x3f'),require(_0xdf3c('0x40')));_0x71b446[_0xdf3c('0xa')]('/api/sms/interactions',require(_0xdf3c('0x41')));_0x71b446[_0xdf3c('0xa')]('/api/sms/messages',require(_0xdf3c('0x42')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x43'),require(_0xdf3c('0x44')));_0x71b446['use'](_0xdf3c('0x45'),require(_0xdf3c('0x46')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x47'),require('./api/openchannelApplication'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x48'),require('./api/openchannelInteraction'));_0x71b446['use'](_0xdf3c('0x49'),require('./api/openchannelMessage'));_0x71b446[_0xdf3c('0xa')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x71b446['use'](_0xdf3c('0x4a'),require(_0xdf3c('0x4b')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x4c'),require('./api/openchannelQueueReport'));_0x71b446['use'](_0xdf3c('0x4d'),require('./api/chatApplication'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x4e'),require(_0xdf3c('0x4f')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x50'),require(_0xdf3c('0x51')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x52'),require(_0xdf3c('0x53')));_0x71b446['use'](_0xdf3c('0x54'),require('./api/chatQueue'));_0x71b446['use'](_0xdf3c('0x55'),require('./api/chatGroup'));_0x71b446[_0xdf3c('0xa')]('/api/chat/proactive_actions',require(_0xdf3c('0x56')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x57'),require(_0xdf3c('0x58')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x59'),require(_0xdf3c('0x5a')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x5b'),require(_0xdf3c('0x5c')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x5d'),require('./api/cmHopperBlack'));_0x71b446['use'](_0xdf3c('0x5e'),require('./api/cmHopperFinal'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x5f'),require(_0xdf3c('0x60')));_0x71b446[_0xdf3c('0xa')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x61'),require(_0xdf3c('0x62')));_0x71b446['use'](_0xdf3c('0x63'),require(_0xdf3c('0x64')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x65'),require('./api/cannedAnswer'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x66'),require(_0xdf3c('0x67')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x68'),require('./api/condition'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x69'),require(_0xdf3c('0x6a')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x6b'),require(_0xdf3c('0x6c')));_0x71b446['use']('/api/cdr',require(_0xdf3c('0x6d')));_0x71b446[_0xdf3c('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x6e'),require(_0xdf3c('0x6f')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x70'),require(_0xdf3c('0x71')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x72'),require(_0xdf3c('0x73')));_0x71b446['use'](_0xdf3c('0x74'),require(_0xdf3c('0x75')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x76'),require(_0xdf3c('0x77')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x78'),require('./api/cmHopperAdditionalPhone'));_0x71b446[_0xdf3c('0xa')]('/api/templates',require(_0xdf3c('0x79')));_0x71b446['use'](_0xdf3c('0x7a'),require(_0xdf3c('0x7b')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x7c'),require('./api/variable'));_0x71b446['use']('/api/integrations',require(_0xdf3c('0x7d')));_0x71b446['use'](_0xdf3c('0x7e'),require(_0xdf3c('0x7f')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x80'),require(_0xdf3c('0x81')));_0x71b446['use']('/api/analytics/default_reports',require(_0xdf3c('0x82')));_0x71b446[_0xdf3c('0xa')]('/api/analytics/extracted_reports',require(_0xdf3c('0x83')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x84'),require(_0xdf3c('0x85')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x86'),require(_0xdf3c('0x87')));_0x71b446['use']('/api/analytics/tree_reports',require(_0xdf3c('0x88')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x89'),require(_0xdf3c('0x8a')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x8b'),require(_0xdf3c('0x8c')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x8d'),require(_0xdf3c('0x8e')));_0x71b446[_0xdf3c('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xdf3c('0x8f')));_0x71b446['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x71b446['use']('/api/integrations/sugarcrm/fields',require(_0xdf3c('0x90')));_0x71b446[_0xdf3c('0xa')]('/api/integrations/desk/accounts',require(_0xdf3c('0x91')));_0x71b446[_0xdf3c('0xa')]('/api/integrations/desk/configurations',require(_0xdf3c('0x92')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x93'),require(_0xdf3c('0x94')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x95'),require(_0xdf3c('0x96')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x97'),require(_0xdf3c('0x98')));_0x71b446[_0xdf3c('0xa')]('/api/integrations/zoho/fields',require(_0xdf3c('0x99')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x9a'),require('./api/intZendeskAccount'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x9b'),require(_0xdf3c('0x9c')));_0x71b446['use'](_0xdf3c('0x9d'),require(_0xdf3c('0x9e')));_0x71b446['use'](_0xdf3c('0x9f'),require('./api/intFreshdeskAccount'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xa0'),require(_0xdf3c('0xa1')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xa2'),require(_0xdf3c('0xa3')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xa4'),require(_0xdf3c('0xa5')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xa6'),require(_0xdf3c('0xa7')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xa8'),require(_0xdf3c('0xa9')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xaa'),require('./api/intServicenowAccount'));_0x71b446['use'](_0xdf3c('0xab'),require(_0xdf3c('0xac')));_0x71b446[_0xdf3c('0xa')]('/api/integrations/servicenow/fields',require(_0xdf3c('0xad')));_0x71b446['use']('/api/integrations/dynamics365/accounts',require(_0xdf3c('0xae')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xaf'),require(_0xdf3c('0xb0')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xb1'),require(_0xdf3c('0xb2')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xb3'),require(_0xdf3c('0xb4')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xb5'),require(_0xdf3c('0xb6')));_0x71b446['use'](_0xdf3c('0xb7'),require(_0xdf3c('0xb8')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xb9'),require(_0xdf3c('0xba')));_0x71b446['use'](_0xdf3c('0xbb'),require(_0xdf3c('0xbc')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xbd'),require(_0xdf3c('0xbe')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xbf'),require(_0xdf3c('0xc0')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xc1'),require('./api/jscriptyQuestionReport'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xc2'),require(_0xdf3c('0xc3')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xc4'),require(_0xdf3c('0xc5')));_0x71b446[_0xdf3c('0xa')]('/api/square/reports',require(_0xdf3c('0xc6')));_0x71b446[_0xdf3c('0xa')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xc7'),require(_0xdf3c('0xc8')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xc9'),require(_0xdf3c('0xca')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xcb'),require('./api/squareOdbc'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xcc'),require(_0xdf3c('0xcd')));_0x71b446['use'](_0xdf3c('0xce'),require(_0xdf3c('0xcf')));_0x71b446[_0xdf3c('0xa')]('/api/square/messages',require(_0xdf3c('0xd0')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xd1'),require(_0xdf3c('0xd2')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xd3'),require('./api/license'));_0x71b446['use']('/api/campaigns',require('./api/campaign'));_0x71b446['use'](_0xdf3c('0xd4'),require(_0xdf3c('0xd5')));_0x71b446[_0xdf3c('0xa')]('/api/attachments',require(_0xdf3c('0xd6')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xd7'),require('./api/plugin'));_0x71b446['use'](_0xdf3c('0xd8'),require('./api/mailTransferReport'));_0x71b446[_0xdf3c('0xa')]('/api/chat/reports/transfer',require(_0xdf3c('0xd9')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xda'),require(_0xdf3c('0xdb')));_0x71b446['use']('/api/openchannel/reports/transfer',require(_0xdf3c('0xdc')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xdd'),require(_0xdf3c('0xde')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xdf'),require('./api/cmList'));_0x71b446[_0xdf3c('0xa')]('/api/voice/prefixes',require(_0xdf3c('0xe0')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xe1'),require(_0xdf3c('0xe2')));_0x71b446[_0xdf3c('0xa')]('/api/userProfile/sections',require(_0xdf3c('0xe3')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xe4'),require('./api/userProfileResource'));_0x71b446['use']('/api/userNotifications',require('./api/userNotification'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xe5'),require(_0xdf3c('0xe6')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xe7'),require(_0xdf3c('0xe8')));_0x71b446['use'](_0xdf3c('0xe9'),require('./api/whatsappInteraction'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xea'),require(_0xdf3c('0xeb')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xec'),require(_0xdf3c('0xed')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xee'),require(_0xdf3c('0xef')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf0'),require(_0xdf3c('0xf1')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf2'),require('./api/cloudProvider'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf3'),require(_0xdf3c('0xf4')));_0x71b446[_0xdf3c('0xa')]('/api/user-settings',require(_0xdf3c('0xf5')));_0x71b446[_0xdf3c('0xa')]('/api/auth/local',require('./api/authLocal'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf6'),require(_0xdf3c('0xf7')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf8'),require('./api/authActiveDirectory'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xf9'),require(_0xdf3c('0xfa')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xfb'),require(_0xdf3c('0xfc')));_0x71b446['use'](_0xdf3c('0xfd'),require(_0xdf3c('0xfe')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0xff'),require(_0xdf3c('0x100')));_0x71b446['use']('/api/pm2',require('./api/pm2'));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x101'),require(_0xdf3c('0x102')));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x103'),clientSideLogs);_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x104'),express[_0xdf3c('0x105')](path['join'](config[_0xdf3c('0x106')],_0xdf3c('0x104'))));_0x71b446[_0xdf3c('0xa')](_0xdf3c('0x107'),express[_0xdf3c('0x105')](path[_0xdf3c('0x108')](config['root'],_0xdf3c('0x107'))));_0x71b446[_0xdf3c('0xa')]('/demo',express['static'](path[_0xdf3c('0x108')](config['root'],_0xdf3c('0x109'))));_0x71b446[_0xdf3c('0xa')]('/snippet',express[_0xdf3c('0x105')](path[_0xdf3c('0x108')](config[_0xdf3c('0x106')],_0xdf3c('0x10a'),_0xdf3c('0x10b'))));_0x71b446[_0xdf3c('0xa')]('/plugins',express[_0xdf3c('0x105')](path[_0xdf3c('0x108')](config[_0xdf3c('0x106')],_0xdf3c('0x10c'))));_0x71b446[_0xdf3c('0x10d')](_0xdf3c('0x10e'))[_0xdf3c('0x10f')](errors[0x194]);_0x71b446['route']('/*')['get'](function(_0x1745fd,_0x259249){_0x259249[_0xdf3c('0x110')](path['resolve'](_0x71b446[_0xdf3c('0x10f')]('appPath')+'/index.html'));});return _0x71b446;});}; \ No newline at end of file +var _0x0205=['/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/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/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/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/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_hopper_additional_phones','/api/templates','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','join','root','/apidoc','/www','/snippet','static','snippet','3.8.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport'];(function(_0x487110,_0x4803d4){var _0x48531c=function(_0x37f3b0){while(--_0x37f3b0){_0x487110['push'](_0x487110['shift']());}};_0x48531c(++_0x4803d4);}(_0x0205,0xf8));var _0x5020=function(_0x1ec552,_0x380a41){_0x1ec552=_0x1ec552-0x0;var _0x38b552=_0x0205[_0x1ec552];return _0x38b552;};'use strict';var path=require('path');var express=require('express');var errors=require(_0x5020('0x0'));var config=require(_0x5020('0x1'));var setupLoggers=require(_0x5020('0x2'))[_0x5020('0x3')];var clientSideLogs=require(_0x5020('0x4'));exports['default']=function(_0x105d09){return setupLoggers(_0x105d09)[_0x5020('0x5')](function(){_0x105d09['use']('/api/users',require(_0x5020('0x6')));_0x105d09[_0x5020('0x7')](_0x5020('0x8'),require(_0x5020('0x9')));_0x105d09[_0x5020('0x7')](_0x5020('0xa'),require(_0x5020('0xb')));_0x105d09['use'](_0x5020('0xc'),require('./api/voiceExtension'));_0x105d09[_0x5020('0x7')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x105d09['use'](_0x5020('0xd'),require(_0x5020('0xe')));_0x105d09[_0x5020('0x7')](_0x5020('0xf'),require(_0x5020('0x10')));_0x105d09[_0x5020('0x7')](_0x5020('0x11'),require(_0x5020('0x12')));_0x105d09['use'](_0x5020('0x13'),require(_0x5020('0x14')));_0x105d09[_0x5020('0x7')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x105d09[_0x5020('0x7')](_0x5020('0x15'),require(_0x5020('0x16')));_0x105d09['use'](_0x5020('0x17'),require(_0x5020('0x18')));_0x105d09[_0x5020('0x7')](_0x5020('0x19'),require('./api/voiceAgentReport'));_0x105d09[_0x5020('0x7')]('/api/voice/queues/reports',require(_0x5020('0x1a')));_0x105d09[_0x5020('0x7')](_0x5020('0x1b'),require(_0x5020('0x1c')));_0x105d09['use'](_0x5020('0x1d'),require(_0x5020('0x1e')));_0x105d09[_0x5020('0x7')]('/api/voice/transfers/reports',require(_0x5020('0x1f')));_0x105d09[_0x5020('0x7')]('/api/mail/out_servers',require(_0x5020('0x20')));_0x105d09[_0x5020('0x7')](_0x5020('0x21'),require(_0x5020('0x22')));_0x105d09[_0x5020('0x7')]('/api/mail/queues',require('./api/mailQueue'));_0x105d09[_0x5020('0x7')](_0x5020('0x23'),require(_0x5020('0x24')));_0x105d09[_0x5020('0x7')](_0x5020('0x25'),require(_0x5020('0x26')));_0x105d09[_0x5020('0x7')](_0x5020('0x27'),require(_0x5020('0x28')));_0x105d09[_0x5020('0x7')](_0x5020('0x29'),require(_0x5020('0x2a')));_0x105d09['use'](_0x5020('0x2b'),require('./api/mailQueueReport'));_0x105d09[_0x5020('0x7')]('/api/dashboards',require(_0x5020('0x2c')));_0x105d09['use'](_0x5020('0x2d'),require(_0x5020('0x2e')));_0x105d09[_0x5020('0x7')](_0x5020('0x2f'),require(_0x5020('0x30')));_0x105d09[_0x5020('0x7')](_0x5020('0x31'),require(_0x5020('0x32')));_0x105d09[_0x5020('0x7')](_0x5020('0x33'),require(_0x5020('0x34')));_0x105d09[_0x5020('0x7')](_0x5020('0x35'),require(_0x5020('0x36')));_0x105d09['use'](_0x5020('0x37'),require(_0x5020('0x38')));_0x105d09[_0x5020('0x7')]('/api/fax/reports/queue',require(_0x5020('0x39')));_0x105d09[_0x5020('0x7')](_0x5020('0x3a'),require(_0x5020('0x3b')));_0x105d09['use']('/api/sms/applications',require(_0x5020('0x3c')));_0x105d09['use'](_0x5020('0x3d'),require(_0x5020('0x3e')));_0x105d09[_0x5020('0x7')](_0x5020('0x3f'),require('./api/smsMessage'));_0x105d09[_0x5020('0x7')](_0x5020('0x40'),require(_0x5020('0x41')));_0x105d09[_0x5020('0x7')](_0x5020('0x42'),require(_0x5020('0x43')));_0x105d09[_0x5020('0x7')](_0x5020('0x44'),require('./api/openchannelApplication'));_0x105d09[_0x5020('0x7')](_0x5020('0x45'),require(_0x5020('0x46')));_0x105d09[_0x5020('0x7')](_0x5020('0x47'),require(_0x5020('0x48')));_0x105d09[_0x5020('0x7')](_0x5020('0x49'),require(_0x5020('0x4a')));_0x105d09['use'](_0x5020('0x4b'),require('./api/chatWebsite'));_0x105d09[_0x5020('0x7')]('/api/openchannel/reports/queue',require(_0x5020('0x4c')));_0x105d09['use'](_0x5020('0x4d'),require(_0x5020('0x4e')));_0x105d09[_0x5020('0x7')](_0x5020('0x4f'),require(_0x5020('0x50')));_0x105d09[_0x5020('0x7')]('/api/chat/messages',require(_0x5020('0x51')));_0x105d09[_0x5020('0x7')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x105d09[_0x5020('0x7')](_0x5020('0x52'),require(_0x5020('0x53')));_0x105d09['use'](_0x5020('0x54'),require(_0x5020('0x55')));_0x105d09[_0x5020('0x7')](_0x5020('0x56'),require(_0x5020('0x57')));_0x105d09[_0x5020('0x7')](_0x5020('0x58'),require(_0x5020('0x59')));_0x105d09[_0x5020('0x7')](_0x5020('0x5a'),require(_0x5020('0x5b')));_0x105d09[_0x5020('0x7')](_0x5020('0x5c'),require('./api/cmHopper'));_0x105d09[_0x5020('0x7')]('/api/cm/hopper_black',require(_0x5020('0x5d')));_0x105d09[_0x5020('0x7')](_0x5020('0x5e'),require(_0x5020('0x5f')));_0x105d09['use'](_0x5020('0x60'),require(_0x5020('0x61')));_0x105d09[_0x5020('0x7')](_0x5020('0x62'),require(_0x5020('0x63')));_0x105d09[_0x5020('0x7')](_0x5020('0x64'),require(_0x5020('0x65')));_0x105d09[_0x5020('0x7')](_0x5020('0x66'),require(_0x5020('0x67')));_0x105d09[_0x5020('0x7')](_0x5020('0x68'),require(_0x5020('0x69')));_0x105d09[_0x5020('0x7')](_0x5020('0x6a'),require(_0x5020('0x6b')));_0x105d09[_0x5020('0x7')](_0x5020('0x6c'),require(_0x5020('0x6d')));_0x105d09[_0x5020('0x7')](_0x5020('0x6e'),require('./api/interval'));_0x105d09[_0x5020('0x7')](_0x5020('0x6f'),require(_0x5020('0x70')));_0x105d09['use'](_0x5020('0x71'),require('./api/cdr'));_0x105d09[_0x5020('0x7')](_0x5020('0x72'),require(_0x5020('0x73')));_0x105d09[_0x5020('0x7')](_0x5020('0x74'),require(_0x5020('0x75')));_0x105d09['use'](_0x5020('0x76'),require(_0x5020('0x77')));_0x105d09[_0x5020('0x7')](_0x5020('0x78'),require(_0x5020('0x79')));_0x105d09[_0x5020('0x7')](_0x5020('0x7a'),require('./api/contactItemType'));_0x105d09[_0x5020('0x7')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x105d09['use'](_0x5020('0x7b'),require('./api/cmHopperAdditionalPhone'));_0x105d09['use'](_0x5020('0x7c'),require('./api/template'));_0x105d09[_0x5020('0x7')]('/api/triggers',require('./api/trigger'));_0x105d09[_0x5020('0x7')]('/api/variables',require(_0x5020('0x7d')));_0x105d09[_0x5020('0x7')](_0x5020('0x7e'),require(_0x5020('0x7f')));_0x105d09[_0x5020('0x7')]('/api/integrations/reports',require(_0x5020('0x80')));_0x105d09[_0x5020('0x7')](_0x5020('0x81'),require('./api/analyticCustomReport'));_0x105d09[_0x5020('0x7')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x105d09['use'](_0x5020('0x82'),require('./api/analyticExtractedReport'));_0x105d09[_0x5020('0x7')](_0x5020('0x83'),require(_0x5020('0x84')));_0x105d09[_0x5020('0x7')](_0x5020('0x85'),require(_0x5020('0x86')));_0x105d09['use'](_0x5020('0x87'),require(_0x5020('0x88')));_0x105d09[_0x5020('0x7')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x105d09['use']('/api/integrations/salesforce/configurations',require(_0x5020('0x89')));_0x105d09[_0x5020('0x7')](_0x5020('0x8a'),require(_0x5020('0x8b')));_0x105d09[_0x5020('0x7')](_0x5020('0x8c'),require(_0x5020('0x8d')));_0x105d09[_0x5020('0x7')](_0x5020('0x8e'),require('./api/intSugarcrmConfiguration'));_0x105d09[_0x5020('0x7')]('/api/integrations/sugarcrm/fields',require(_0x5020('0x8f')));_0x105d09[_0x5020('0x7')]('/api/integrations/desk/accounts',require(_0x5020('0x90')));_0x105d09[_0x5020('0x7')](_0x5020('0x91'),require(_0x5020('0x92')));_0x105d09[_0x5020('0x7')]('/api/integrations/desk/fields',require(_0x5020('0x93')));_0x105d09['use'](_0x5020('0x94'),require(_0x5020('0x95')));_0x105d09[_0x5020('0x7')](_0x5020('0x96'),require(_0x5020('0x97')));_0x105d09[_0x5020('0x7')]('/api/integrations/zoho/fields',require(_0x5020('0x98')));_0x105d09['use'](_0x5020('0x99'),require('./api/intZendeskAccount'));_0x105d09[_0x5020('0x7')](_0x5020('0x9a'),require(_0x5020('0x9b')));_0x105d09['use'](_0x5020('0x9c'),require(_0x5020('0x9d')));_0x105d09[_0x5020('0x7')](_0x5020('0x9e'),require(_0x5020('0x9f')));_0x105d09[_0x5020('0x7')](_0x5020('0xa0'),require('./api/intFreshdeskConfiguration'));_0x105d09[_0x5020('0x7')](_0x5020('0xa1'),require(_0x5020('0xa2')));_0x105d09[_0x5020('0x7')](_0x5020('0xa3'),require(_0x5020('0xa4')));_0x105d09[_0x5020('0x7')]('/api/integrations/vtiger/configurations',require(_0x5020('0xa5')));_0x105d09[_0x5020('0x7')](_0x5020('0xa6'),require('./api/intVtigerField'));_0x105d09['use'](_0x5020('0xa7'),require(_0x5020('0xa8')));_0x105d09['use'](_0x5020('0xa9'),require(_0x5020('0xaa')));_0x105d09[_0x5020('0x7')]('/api/integrations/servicenow/fields',require(_0x5020('0xab')));_0x105d09['use'](_0x5020('0xac'),require(_0x5020('0xad')));_0x105d09[_0x5020('0x7')](_0x5020('0xae'),require(_0x5020('0xaf')));_0x105d09[_0x5020('0x7')](_0x5020('0xb0'),require(_0x5020('0xb1')));_0x105d09[_0x5020('0x7')](_0x5020('0xb2'),require('./api/intFreshsalesAccount'));_0x105d09[_0x5020('0x7')](_0x5020('0xb3'),require(_0x5020('0xb4')));_0x105d09['use']('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x105d09['use'](_0x5020('0xb5'),require('./api/network'));_0x105d09[_0x5020('0x7')](_0x5020('0xb6'),require(_0x5020('0xb7')));_0x105d09['use'](_0x5020('0xb8'),require(_0x5020('0xb9')));_0x105d09[_0x5020('0x7')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x105d09['use'](_0x5020('0xba'),require('./api/jscriptyQuestionReport'));_0x105d09[_0x5020('0x7')]('/api/jscripty/sessions/reports',require(_0x5020('0xbb')));_0x105d09[_0x5020('0x7')](_0x5020('0xbc'),require(_0x5020('0xbd')));_0x105d09[_0x5020('0x7')]('/api/square/reports',require(_0x5020('0xbe')));_0x105d09[_0x5020('0x7')](_0x5020('0xbf'),require(_0x5020('0xc0')));_0x105d09[_0x5020('0x7')](_0x5020('0xc1'),require('./api/jscriptyProject'));_0x105d09[_0x5020('0x7')](_0x5020('0xc2'),require('./api/setting'));_0x105d09[_0x5020('0x7')]('/api/square/odbc',require(_0x5020('0xc3')));_0x105d09[_0x5020('0x7')](_0x5020('0xc4'),require('./api/squareProject'));_0x105d09[_0x5020('0x7')](_0x5020('0xc5'),require(_0x5020('0xc6')));_0x105d09[_0x5020('0x7')]('/api/square/messages',require(_0x5020('0xc7')));_0x105d09[_0x5020('0x7')]('/api/teams',require(_0x5020('0xc8')));_0x105d09['use'](_0x5020('0xc9'),require(_0x5020('0xca')));_0x105d09['use']('/api/campaigns',require(_0x5020('0xcb')));_0x105d09[_0x5020('0x7')]('/api/migrations',require(_0x5020('0xcc')));_0x105d09[_0x5020('0x7')]('/api/attachments',require('./api/attachment'));_0x105d09['use'](_0x5020('0xcd'),require(_0x5020('0xce')));_0x105d09['use'](_0x5020('0xcf'),require(_0x5020('0xd0')));_0x105d09[_0x5020('0x7')](_0x5020('0xd1'),require(_0x5020('0xd2')));_0x105d09[_0x5020('0x7')](_0x5020('0xd3'),require('./api/faxTransferReport'));_0x105d09[_0x5020('0x7')](_0x5020('0xd4'),require('./api/openchannelTransferReport'));_0x105d09[_0x5020('0x7')](_0x5020('0xd5'),require(_0x5020('0xd6')));_0x105d09['use']('/api/cm/lists',require(_0x5020('0xd7')));_0x105d09[_0x5020('0x7')](_0x5020('0xd8'),require(_0x5020('0xd9')));_0x105d09[_0x5020('0x7')](_0x5020('0xda'),require(_0x5020('0xdb')));_0x105d09[_0x5020('0x7')](_0x5020('0xdc'),require('./api/userProfileSection'));_0x105d09['use'](_0x5020('0xdd'),require(_0x5020('0xde')));_0x105d09['use'](_0x5020('0xdf'),require(_0x5020('0xe0')));_0x105d09['use'](_0x5020('0xe1'),require('./api/whatsappAccount'));_0x105d09[_0x5020('0x7')](_0x5020('0xe2'),require(_0x5020('0xe3')));_0x105d09[_0x5020('0x7')](_0x5020('0xe4'),require(_0x5020('0xe5')));_0x105d09[_0x5020('0x7')](_0x5020('0xe6'),require(_0x5020('0xe7')));_0x105d09[_0x5020('0x7')](_0x5020('0xe8'),require('./api/whatsappQueueReport'));_0x105d09[_0x5020('0x7')](_0x5020('0xe9'),require('./api/whatsappTransferReport'));_0x105d09[_0x5020('0x7')]('/api/whatsapp/queues',require(_0x5020('0xea')));_0x105d09[_0x5020('0x7')](_0x5020('0xeb'),require(_0x5020('0xec')));_0x105d09['use'](_0x5020('0xed'),require('./api/realtime'));_0x105d09[_0x5020('0x7')](_0x5020('0xee'),require(_0x5020('0xef')));_0x105d09[_0x5020('0x7')](_0x5020('0xf0'),require(_0x5020('0xf1')));_0x105d09[_0x5020('0x7')](_0x5020('0xf2'),require(_0x5020('0xf3')));_0x105d09['use'](_0x5020('0xf4'),require(_0x5020('0xf5')));_0x105d09[_0x5020('0x7')]('/api/jira',require(_0x5020('0xf6')));_0x105d09['use'](_0x5020('0xf7'),require('./api/rpc'));_0x105d09[_0x5020('0x7')]('/api/version',require(_0x5020('0xf8')));_0x105d09[_0x5020('0x7')](_0x5020('0xf9'),require(_0x5020('0xfa')));_0x105d09[_0x5020('0x7')](_0x5020('0xfb'),require(_0x5020('0xfc')));_0x105d09[_0x5020('0x7')](_0x5020('0xfd'),require(_0x5020('0xfe')));_0x105d09[_0x5020('0x7')](_0x5020('0xff'),clientSideLogs);_0x105d09[_0x5020('0x7')]('/apidoc',express['static'](path[_0x5020('0x100')](config[_0x5020('0x101')],_0x5020('0x102'))));_0x105d09[_0x5020('0x7')](_0x5020('0x103'),express['static'](path['join'](config[_0x5020('0x101')],_0x5020('0x103'))));_0x105d09[_0x5020('0x7')]('/demo',express['static'](path[_0x5020('0x100')](config[_0x5020('0x101')],'/demo')));_0x105d09[_0x5020('0x7')](_0x5020('0x104'),express[_0x5020('0x105')](path[_0x5020('0x100')](config[_0x5020('0x101')],_0x5020('0x106'),_0x5020('0x107'))));_0x105d09[_0x5020('0x7')](_0x5020('0x108'),express['static'](path[_0x5020('0x100')](config['root'],_0x5020('0x109'))));_0x105d09[_0x5020('0x10a')](_0x5020('0x10b'))[_0x5020('0x10c')](errors[0x194]);_0x105d09[_0x5020('0x10a')]('/*')['get'](function(_0x3ecdff,_0x9b3c96){_0x9b3c96[_0x5020('0x10d')](path[_0x5020('0x10e')](_0x105d09[_0x5020('0x10c')](_0x5020('0x10f'))+_0x5020('0x110')));});return _0x105d09;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 4e1565a..d95af1a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x700c=['localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.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/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.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/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port'];(function(_0x2663be,_0x15b25e){var _0x1204a3=function(_0x17dfa7){while(--_0x17dfa7){_0x2663be['push'](_0x2663be['shift']());}};_0x1204a3(++_0x15b25e);}(_0x700c,0x127));var _0xc700=function(_0x3bc537,_0x4ac5e7){_0x3bc537=_0x3bc537-0x0;var _0x2da5fc=_0x700c[_0x3bc537];return _0x2da5fc;};'use strict';var jayson=require('jayson/promise');var _=require(_0xc700('0x0'));var config=require(_0xc700('0x1'));exports[_0xc700('0x2')]=function(){return new Promise(function(_0x2adb93,_0x24ef03){var _0x2b1d08={};_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x4')));_0x2b1d08=_['merge'](_0x2b1d08,require('../api/voiceExtension/voiceExtension.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/voiceQueue/voiceQueue.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x5')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x6')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x7')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x8')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x9')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0xa')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0xb')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0xc')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0xd')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/mailAccount/mailAccount.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0xe')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0xf')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x10')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x11')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x12')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x13')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/faxApplication/faxApplication.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/faxInteraction/faxInteraction.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x14')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x15')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x16')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x17')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x18')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x19')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/smsQueue/smsQueue.rpc'));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x1a')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x1b')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x1c')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x1d')));_0x2b1d08=_['merge'](_0x2b1d08,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x1e')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x1f')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x20')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x21')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x22')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x23')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x24')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x25')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x26')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x27')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x28')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x29')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x2a')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x2b')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x2c')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x2d')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x2e')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x2f')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x30')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x31')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x32')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/squareReport/squareReport.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x33')));_0x2b1d08=_['merge'](_0x2b1d08,require(_0xc700('0x34')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x35')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x36')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x37')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x38')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x39')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x3a')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require('../api/plugin/plugin.rpc'));_0x2b1d08=_['merge'](_0x2b1d08,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x3b')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x3c')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x3d')));_0x2b1d08=_[_0xc700('0x3')](_0x2b1d08,require(_0xc700('0x3e')));var _0x4eb0c9=jayson[_0xc700('0x3f')](_0x2b1d08)['http']();var _0x1e0227=config['rpc'][_0xc700('0x40')]||config[_0xc700('0x40')]+0x1;var _0x4295da=config['rpc']['ip']||_0xc700('0x41');_0x4eb0c9['on'](_0xc700('0x42'),function(_0x397776){return _0x24ef03(_0x397776);});_0x4eb0c9['listen'](_0x1e0227,_0x4295da,function(){console[_0xc700('0x43')](_0xc700('0x44'),_0x4295da,_0x1e0227);require(_0xc700('0x45'))[_0xc700('0x46')]();return _0x2adb93(_0xc700('0x47')+_0x4295da+':'+_0x1e0227);});});}; \ No newline at end of file +var _0x6916=['../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxMessage/faxMessage.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/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc'];(function(_0x5b7a4a,_0x54c362){var _0x5feaf9=function(_0x221637){while(--_0x221637){_0x5b7a4a['push'](_0x5b7a4a['shift']());}};_0x5feaf9(++_0x54c362);}(_0x6916,0x1bb));var _0x6691=function(_0x1007cd,_0x158405){_0x1007cd=_0x1007cd-0x0;var _0x58551e=_0x6916[_0x1007cd];return _0x58551e;};'use strict';var jayson=require('jayson/promise');var _=require(_0x6691('0x0'));var config=require(_0x6691('0x1'));exports[_0x6691('0x2')]=function(){return new Promise(function(_0x5dda90,_0x4cf519){var _0x5c6e7b={};_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x4')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/voiceExtension/voiceExtension.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/voiceQueue/voiceQueue.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x5')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x6')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x7')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x8')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x9')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0xa')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/trunk/trunk.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0xb')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0xc')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0xd')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/mailAccount/mailAccount.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0xe')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0xf')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/mailMessage/mailMessage.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x10')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x11')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x12')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/faxApplication/faxApplication.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/faxInteraction/faxInteraction.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x13')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/faxQueue/faxQueue.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x14')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x15')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x16')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x17')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x18')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x19')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x1a')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x1b')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/chatMessage/chatMessage.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/chatQueue/chatQueue.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x1c')));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x1d')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x1e')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x1f')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x20')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/pause/pause.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x21')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x22')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x23')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x24')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/variable/variable.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x25')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x26')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x27')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x28')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x29')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x2a')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x2b')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/squareReport/squareReport.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x2c')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x2d')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x2e')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/squareProject/squareProject.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x2f')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x30')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/campaign/campaign.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/attachment/attachment.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/plugin/plugin.rpc'));_0x5c6e7b=_['merge'](_0x5c6e7b,require(_0x6691('0x31')));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x32')));_0x5c6e7b=_['merge'](_0x5c6e7b,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5c6e7b=_[_0x6691('0x3')](_0x5c6e7b,require(_0x6691('0x33')));var _0x40bcfa=jayson['server'](_0x5c6e7b)['http']();var _0x3a5ac7=config[_0x6691('0x34')][_0x6691('0x35')]||config[_0x6691('0x35')]+0x1;var _0x33b89d=config[_0x6691('0x34')]['ip']||_0x6691('0x36');_0x40bcfa['on'](_0x6691('0x37'),function(_0x34a509){return _0x4cf519(_0x34a509);});_0x40bcfa[_0x6691('0x2')](_0x3a5ac7,_0x33b89d,function(){console[_0x6691('0x38')](_0x6691('0x39'),_0x33b89d,_0x3a5ac7);require(_0x6691('0x3a'))[_0x6691('0x3b')]();return _0x5dda90(_0x6691('0x3c')+_0x33b89d+':'+_0x3a5ac7);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 39b84f2..310fedf 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 _0x9269=['destroy','inherits','prototype','sendRequest','answer','ANSWER','getData','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','events','EventEmitter','./reply','call','setEncoding','utf8','headers','emit','line','hangup','substring','520-Invalid','function','no\x20code','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','command','write'];(function(_0x2e1af3,_0x2a077b){var _0x4150cd=function(_0x1e08f3){while(--_0x1e08f3){_0x2e1af3['push'](_0x2e1af3['shift']());}};_0x4150cd(++_0x2a077b);}(_0x9269,0x147));var _0x9926=function(_0x146979,_0x4dfc32){_0x146979=_0x146979-0x0;var _0x103856=_0x9269[_0x146979];return _0x103856;};'use strict';var util=require(_0x9926('0x0'));var _=require('lodash');var EventEmitter=require(_0x9926('0x1'))[_0x9926('0x2')];var AGIReply=require(_0x9926('0x3'));var AGIError=require('./error');function AGIChannel(_0x596e44){var _0x5dd517=this,_0x417cbf=new AGIReply(),_0x196e8f=![],_0x3056c3={};EventEmitter[_0x9926('0x4')](_0x5dd517);_0x596e44[_0x9926('0x5')](_0x9926('0x6'));_0x596e44['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x417cbf[_0x9926('0x5')](_0x9926('0x6'));_0x417cbf['on'](_0x9926('0x7'),function(_0xe67af7){for(var _0xd433fe in _0xe67af7){_0x5dd517[_0xd433fe]=_0xe67af7[_0xd433fe];}_0x5dd517[_0x9926('0x8')]('ready');});_0x417cbf['on'](_0x9926('0x9'),function(_0x99de72){if(_0x99de72['toLowerCase']()=='hangup'){_0x5dd517[_0x9926('0x8')](_0x9926('0xa'));return;}if(_0x99de72[_0x9926('0xb')](0x0,0xb)==_0x9926('0xc')){_0x196e8f=!![];}if(_0x196e8f){_0x3056c3['rx']+=_0x99de72+'\x0a';if(_0x99de72['search']('520\x20End\x20of\x20proper')!=-0x1){_0x196e8f=![];}}else{_0x3056c3['rx']=_0x99de72;}if(_0x196e8f){return;}if(typeof _0x3056c3['cb']==_0x9926('0xd')){var _0x40bb2e=_0x3056c3['rx']['substring'](0x0,0x3),_0x43412b=null,_0x182de2=null;_0x40bb2e=parseInt(_0x40bb2e);if(isNaN(_0x40bb2e)){_0x3056c3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9926('0xe')});return;}if(_0x40bb2e!=0xc8){_0x3056c3['cb'](null,{'code':_0x40bb2e,'result':-0x1,'extra':'KO'});return;}_0x43412b=_0x3056c3['rx'][_0x9926('0xb')](0x4)['replace']('result=','');if(_0x43412b[_0x9926('0xf')]('\x20')!=-0x1){_0x43412b=_0x43412b['substr'](0x0,_0x43412b[_0x9926('0xf')]('\x20'));}if(_[_0x9926('0x10')](_0x43412b,'-1')){_0x43412b=parseInt(_0x43412b);}_0x182de2=_0x3056c3['rx'][_0x9926('0x11')]('\x20');if(_0x182de2['length']==0x3){_0x182de2=_0x182de2[0x2][_0x9926('0xb')](0x1,_0x182de2[0x2][_0x9926('0x12')]-0x1);}else if(_0x182de2[_0x9926('0x12')]>0x3){var _0x1b2924=/\((.+)\)/;var _0x1f195d=_0x3056c3['rx'][_0x9926('0x13')](_0x1b2924);if(_0x1f195d){_0x182de2=_0x1f195d[0x1];}else{_0x182de2=null;}}else{_0x182de2=null;}_0x3056c3['cb'](null,{'code':_0x40bb2e,'result':_0x43412b,'extra':_0x182de2});}});_0x596e44['on'](_0x9926('0x14'),function(_0x1fbfae){_0x5dd517['emit']('error',new AGIError(_0x9926('0x15'),_0x1fbfae[_0x9926('0x16')]));});_0x596e44['on'](_0x9926('0x17'),function(){_0x5dd517[_0x9926('0x8')](_0x9926('0x17'),new AGIError(_0x9926('0x18')));});_0x596e44['on']('timeout',function(){_0x5dd517['emit'](_0x9926('0x19'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x596e44['destroy']();});_0x596e44['pipe'](_0x417cbf);this[_0x9926('0x1a')]=function(_0x25036e,_0x9c88ad){var _0x25036e=_0x25036e||'',_0x9c88ad=typeof _0x9c88ad==_0x9926('0xd')?_0x9c88ad:new Function();_0x3056c3={'tx':_0x25036e,'rx':'','cb':_0x9c88ad};_0x596e44[_0x9926('0x1b')](_0x25036e+'\x0a');},this[_0x9926('0x17')]=function(){_0x596e44[_0x9926('0x1c')]();};}util[_0x9926('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0x9926('0x1e')][_0x9926('0x1f')]=function(_0x358af4){return this['command']['sync'](this,_0x358af4);};AGIChannel['prototype'][_0x9926('0x20')]=function(){return this[_0x9926('0x1f')](_0x9926('0x21'));};AGIChannel[_0x9926('0x1e')][_0x9926('0x22')]=function(_0x37a9b7,_0x34607f,_0x2fb84b){_0x37a9b7=_0x37a9b7===undefined?'beep':_0x37a9b7;_0x34607f=_0x34607f===undefined?'5':_0x34607f;_0x2fb84b=_0x2fb84b===undefined?'1':_0x2fb84b;return this[_0x9926('0x1f')](util[_0x9926('0x23')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x37a9b7,_0x34607f*0x3e8,_0x2fb84b));};AGIChannel[_0x9926('0x1e')][_0x9926('0x24')]=function(_0x515d91){_0x515d91=_0x515d91||_0x9926('0x25');return this[_0x9926('0x1f')](util[_0x9926('0x23')](_0x9926('0x26'),_0x515d91));};AGIChannel[_0x9926('0x1e')][_0x9926('0x27')]=function(_0x589bf4,_0x40065c){if(_['isArray'](_0x40065c)){return this[_0x9926('0x1f')](util['format'](_0x9926('0x28'),_0x589bf4,_0x40065c[_0x9926('0x29')](',')));}return this[_0x9926('0x1f')](util['format'](_0x9926('0x28'),_0x589bf4,_0x40065c));};AGIChannel['prototype'][_0x9926('0x2a')]=function(_0x460198){return this['sendRequest'](util[_0x9926('0x23')]('SET\x20CONTEXT\x20%s',_0x460198));};AGIChannel[_0x9926('0x1e')]['setExtension']=function(_0x638f43){return this[_0x9926('0x1f')](util[_0x9926('0x23')]('SET\x20EXTENSION\x20%s',_0x638f43));};AGIChannel[_0x9926('0x1e')][_0x9926('0x2b')]=function(_0x534bbb){return this[_0x9926('0x1f')](util[_0x9926('0x23')](_0x9926('0x2c'),_0x534bbb));};AGIChannel[_0x9926('0x1e')][_0x9926('0xa')]=function(){return this[_0x9926('0x1f')](_0x9926('0x2d'));};AGIChannel[_0x9926('0x1e')][_0x9926('0x2e')]=function(_0x1ce0f7,_0x1cb564){var _0x1fb76b=_[_0x9926('0x2f')](_0x1cb564)||_[_0x9926('0x30')](_0x1cb564)?_0x1cb564[_0x9926('0x31')]():_0x1cb564;return this['sendRequest'](util[_0x9926('0x23')](_0x9926('0x32'),_0x1ce0f7,_0x1fb76b?_0x1fb76b['toString']()[_0x9926('0x33')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9926('0x1e')][_0x9926('0x34')]=function(_0x2518e1,_0xdbe40c){return this[_0x9926('0x1f')](util[_0x9926('0x23')]('SAY\x20NUMBER\x20%s\x20%s',_0x2518e1,_0xdbe40c));};AGIChannel[_0x9926('0x1e')]['sayDigits']=function(_0x3659f7,_0x15f5bc){return this['sendRequest'](util[_0x9926('0x23')](_0x9926('0x35'),_0x3659f7,_0x15f5bc));};AGIChannel[_0x9926('0x1e')][_0x9926('0x36')]=function(_0x189225,_0x2fe543){return this[_0x9926('0x1f')](util[_0x9926('0x23')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x189225,_0x2fe543));};AGIChannel['prototype'][_0x9926('0x37')]=function(_0x3e4bad,_0x428381,_0x413a40){_0x428381=_0x428381||this['extension'];_0x413a40=_0x413a40||0x1;this['setContext'](_0x3e4bad);this[_0x9926('0x38')](_0x428381);this[_0x9926('0x2b')](_0x413a40);return this[_0x9926('0x24')](util[_0x9926('0x23')](_0x9926('0x39'),_0x3e4bad,_0x428381,_0x413a40));};AGIChannel['prototype'][_0x9926('0x3a')]=function(_0xb05e1e){return this[_0x9926('0x1f')](util[_0x9926('0x23')](_0x9926('0x3b'),_0xb05e1e));};AGIChannel['prototype']['recordFile']=function(_0x92ab41,_0x5cdc6c,_0x463011,_0x2c4528,_0xc19100,_0x139649){_0x5cdc6c=_0x5cdc6c||_0x9926('0x3c');_0x463011=_0x463011||'';_0x2c4528=_0x2c4528===undefined?-0x1:_0x2c4528==='-1'?-0x1:_0x2c4528*0x3e8;_0xc19100=_0xc19100===undefined?'':'s='+_0xc19100;_0x139649=_0x139649?_0x9926('0x3d'):'';return this[_0x9926('0x1f')](util[_0x9926('0x23')](_0x9926('0x3e'),_0x92ab41,_0x5cdc6c,_0x463011,_0x2c4528,_0x139649,_0xc19100));};AGIChannel[_0x9926('0x1e')][_0x9926('0x3f')]=function(_0x1eb890,_0x100fb7){_0x100fb7=_0x100fb7||'';return this['sendRequest'](util[_0x9926('0x23')](_0x9926('0x40'),_0x1eb890,_0x100fb7));};AGIChannel[_0x9926('0x1e')][_0x9926('0x41')]=function(_0x348f37){return this['exec'](_0x9926('0x42'),_0x348f37);};AGIChannel[_0x9926('0x1e')][_0x9926('0x43')]=function(_0x2db753){return this[_0x9926('0x27')](_0x9926('0x44'),_0x2db753);};AGIChannel['prototype'][_0x9926('0x14')]=function(_0x3f93c7,_0x3a127c){this['noop'](util[_0x9926('0x23')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3f93c7['id'],_0x3f93c7[_0x9926('0x45')],_0x3a127c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9926('0x46')]=AGIChannel; \ No newline at end of file +var _0x9261=['sayPhonetic','continueAt','setExtension','setPriority','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','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','call','utf8','setEncoding','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','sync','prototype','answer','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s'];(function(_0x5caebe,_0x477a11){var _0x346dc4=function(_0x1dae1a){while(--_0x1dae1a){_0x5caebe['push'](_0x5caebe['shift']());}};_0x346dc4(++_0x477a11);}(_0x9261,0x1de));var _0x1926=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0x9261[_0x446f11];return _0x385cb5;};'use strict';var util=require(_0x1926('0x0'));var _=require(_0x1926('0x1'));var EventEmitter=require('events')[_0x1926('0x2')];var AGIReply=require(_0x1926('0x3'));var AGIError=require(_0x1926('0x4'));function AGIChannel(_0x585b7e){var _0x1b2b33=this,_0x2fb805=new AGIReply(),_0x269cb1=![],_0x31eef2={};EventEmitter[_0x1926('0x5')](_0x1b2b33);_0x585b7e['setEncoding'](_0x1926('0x6'));_0x585b7e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2fb805[_0x1926('0x7')](_0x1926('0x6'));_0x2fb805['on']('headers',function(_0x37affe){for(var _0x2fb92c in _0x37affe){_0x1b2b33[_0x2fb92c]=_0x37affe[_0x2fb92c];}_0x1b2b33[_0x1926('0x8')](_0x1926('0x9'));});_0x2fb805['on'](_0x1926('0xa'),function(_0x3231ba){if(_0x3231ba[_0x1926('0xb')]()==_0x1926('0xc')){_0x1b2b33[_0x1926('0x8')](_0x1926('0xc'));return;}if(_0x3231ba[_0x1926('0xd')](0x0,0xb)==_0x1926('0xe')){_0x269cb1=!![];}if(_0x269cb1){_0x31eef2['rx']+=_0x3231ba+'\x0a';if(_0x3231ba[_0x1926('0xf')](_0x1926('0x10'))!=-0x1){_0x269cb1=![];}}else{_0x31eef2['rx']=_0x3231ba;}if(_0x269cb1){return;}if(typeof _0x31eef2['cb']==_0x1926('0x11')){var _0x3d4817=_0x31eef2['rx'][_0x1926('0xd')](0x0,0x3),_0x10a758=null,_0x41f84d=null;_0x3d4817=parseInt(_0x3d4817);if(isNaN(_0x3d4817)){_0x31eef2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1926('0x12')});return;}if(_0x3d4817!=0xc8){_0x31eef2['cb'](null,{'code':_0x3d4817,'result':-0x1,'extra':'KO'});return;}_0x10a758=_0x31eef2['rx'][_0x1926('0xd')](0x4)[_0x1926('0x13')](_0x1926('0x14'),'');if(_0x10a758[_0x1926('0x15')]('\x20')!=-0x1){_0x10a758=_0x10a758[_0x1926('0x16')](0x0,_0x10a758[_0x1926('0x15')]('\x20'));}if(_['startsWith'](_0x10a758,'-1')){_0x10a758=parseInt(_0x10a758);}_0x41f84d=_0x31eef2['rx'][_0x1926('0x17')]('\x20');if(_0x41f84d[_0x1926('0x18')]==0x3){_0x41f84d=_0x41f84d[0x2][_0x1926('0xd')](0x1,_0x41f84d[0x2]['length']-0x1);}else if(_0x41f84d[_0x1926('0x18')]>0x3){var _0x202e33=/\((.+)\)/;var _0x50da1e=_0x31eef2['rx'][_0x1926('0x19')](_0x202e33);if(_0x50da1e){_0x41f84d=_0x50da1e[0x1];}else{_0x41f84d=null;}}else{_0x41f84d=null;}_0x31eef2['cb'](null,{'code':_0x3d4817,'result':_0x10a758,'extra':_0x41f84d});}});_0x585b7e['on'](_0x1926('0x1a'),function(_0xdfa757){_0x1b2b33[_0x1926('0x8')](_0x1926('0x1a'),new AGIError(_0x1926('0x1b'),_0xdfa757[_0x1926('0x1c')]));});_0x585b7e['on'](_0x1926('0x1d'),function(){_0x1b2b33[_0x1926('0x8')](_0x1926('0x1d'),new AGIError(_0x1926('0x1e')));});_0x585b7e['on'](_0x1926('0x1f'),function(){_0x1b2b33[_0x1926('0x8')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x585b7e[_0x1926('0x20')]();});_0x585b7e[_0x1926('0x21')](_0x2fb805);this[_0x1926('0x22')]=function(_0x3ba584,_0x2361e2){var _0x3ba584=_0x3ba584||'',_0x2361e2=typeof _0x2361e2==_0x1926('0x11')?_0x2361e2:new Function();_0x31eef2={'tx':_0x3ba584,'rx':'','cb':_0x2361e2};_0x585b7e[_0x1926('0x23')](_0x3ba584+'\x0a');},this[_0x1926('0x1d')]=function(){_0x585b7e[_0x1926('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5634a9){return this[_0x1926('0x22')][_0x1926('0x24')](this,_0x5634a9);};AGIChannel[_0x1926('0x25')][_0x1926('0x26')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype'][_0x1926('0x27')]=function(_0x142f45,_0x55385a,_0x1c0d63){_0x142f45=_0x142f45===undefined?_0x1926('0x28'):_0x142f45;_0x55385a=_0x55385a===undefined?'5':_0x55385a;_0x1c0d63=_0x1c0d63===undefined?'1':_0x1c0d63;return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x2b'),_0x142f45,_0x55385a*0x3e8,_0x1c0d63));};AGIChannel[_0x1926('0x25')][_0x1926('0x2c')]=function(_0xd60129){_0xd60129=_0xd60129||_0x1926('0x2d');return this['sendRequest'](util[_0x1926('0x2a')](_0x1926('0x2e'),_0xd60129));};AGIChannel[_0x1926('0x25')][_0x1926('0x2f')]=function(_0x486a2e,_0x391915){if(_[_0x1926('0x30')](_0x391915)){return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x31'),_0x486a2e,_0x391915['join'](',')));}return this[_0x1926('0x29')](util['format'](_0x1926('0x31'),_0x486a2e,_0x391915));};AGIChannel[_0x1926('0x25')][_0x1926('0x32')]=function(_0x33d4a4){return this['sendRequest'](util[_0x1926('0x2a')](_0x1926('0x33'),_0x33d4a4));};AGIChannel[_0x1926('0x25')]['setExtension']=function(_0x9495cd){return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x34'),_0x9495cd));};AGIChannel[_0x1926('0x25')]['setPriority']=function(_0x51cdce){return this[_0x1926('0x29')](util['format']('SET\x20PRIORITY\x20%s',_0x51cdce));};AGIChannel[_0x1926('0x25')]['hangup']=function(){return this[_0x1926('0x29')](_0x1926('0x35'));};AGIChannel[_0x1926('0x25')]['setVariable']=function(_0x6502b,_0x318945){var _0x514886=_['isBoolean'](_0x318945)||_[_0x1926('0x36')](_0x318945)?_0x318945[_0x1926('0x37')]():_0x318945;return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x38'),_0x6502b,_0x514886?_0x514886['toString']()[_0x1926('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1926('0x25')][_0x1926('0x39')]=function(_0x5bb3c0,_0x3b1be0){return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x3a'),_0x5bb3c0,_0x3b1be0));};AGIChannel[_0x1926('0x25')][_0x1926('0x3b')]=function(_0x3535fc,_0x436ed7){return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x3c'),_0x3535fc,_0x436ed7));};AGIChannel[_0x1926('0x25')][_0x1926('0x3d')]=function(_0x372204,_0x2018ae){return this[_0x1926('0x29')](util[_0x1926('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x372204,_0x2018ae));};AGIChannel[_0x1926('0x25')][_0x1926('0x3e')]=function(_0x514674,_0xd36832,_0x2fc34c){_0xd36832=_0xd36832||this['extension'];_0x2fc34c=_0x2fc34c||0x1;this[_0x1926('0x32')](_0x514674);this[_0x1926('0x3f')](_0xd36832);this[_0x1926('0x40')](_0x2fc34c);return this[_0x1926('0x2c')](util[_0x1926('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x514674,_0xd36832,_0x2fc34c));};AGIChannel[_0x1926('0x25')][_0x1926('0x41')]=function(_0x54efec){return this[_0x1926('0x29')](util['format'](_0x1926('0x42'),_0x54efec));};AGIChannel['prototype'][_0x1926('0x43')]=function(_0x2a5c8c,_0x5249b2,_0x3ca2a3,_0x45b072,_0x492d33,_0x3f601e){_0x5249b2=_0x5249b2||_0x1926('0x44');_0x3ca2a3=_0x3ca2a3||'';_0x45b072=_0x45b072===undefined?-0x1:_0x45b072==='-1'?-0x1:_0x45b072*0x3e8;_0x492d33=_0x492d33===undefined?'':'s='+_0x492d33;_0x3f601e=_0x3f601e?_0x1926('0x45'):'';return this[_0x1926('0x29')](util[_0x1926('0x2a')](_0x1926('0x46'),_0x2a5c8c,_0x5249b2,_0x3ca2a3,_0x45b072,_0x3f601e,_0x492d33));};AGIChannel[_0x1926('0x25')][_0x1926('0x47')]=function(_0x3397ae,_0x5cdba8){_0x5cdba8=_0x5cdba8||'';return this['sendRequest'](util[_0x1926('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3397ae,_0x5cdba8));};AGIChannel[_0x1926('0x25')]['agi']=function(_0x3bfd0a){return this[_0x1926('0x2f')](_0x1926('0x48'),_0x3bfd0a);};AGIChannel[_0x1926('0x25')]['wait']=function(_0x26f47b){return this[_0x1926('0x2f')](_0x1926('0x49'),_0x26f47b);};AGIChannel[_0x1926('0x25')][_0x1926('0x1a')]=function(_0x16ed18,_0x503e40){this[_0x1926('0x2c')](util['format'](_0x1926('0x4a'),_0x16ed18['id'],_0x16ed18[_0x1926('0x4b')],_0x503e40));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1926('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index b8eb1cd..f07d7ea 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 _0xf7f2=['push','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf7f2,0x112));var _0x2f7f=function(_0x1301aa,_0x4da5c4){_0x1301aa=_0x1301aa-0x0;var _0x5146a1=_0xf7f2[_0x1301aa];return _0x5146a1;};'use strict';var util=require(_0x2f7f('0x0'));var error={'E_AGI_UNDEFINED':_0x2f7f('0x1'),'E_AGI_ARGUMENT_PORT':_0x2f7f('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x2f7f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x2f7f('0x4'),'E_AGI_SOCKET_CLOSE':_0x2f7f('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x2f7f('0x6'),'E_AGI_COMMAND_EMPTY':_0x2f7f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2f7f('0x8'),'E_AGI_IVR_ENTRY':_0x2f7f('0x9')};function AGIError(_0x58295f){var _0x58295f=_0x58295f||null,_0x348336=_0x348336||[],_0x56ccef=0x1,_0x52f851='';if(!error[_0x58295f]){_0x58295f=_0x2f7f('0xa');}_0x348336[_0x2f7f('0xb')](error[_0x58295f]);while(arguments[_0x56ccef]){_0x348336[_0x2f7f('0xb')](arguments[_0x56ccef]);_0x56ccef++;}_0x52f851=util['format'][_0x2f7f('0xc')](util,_0x348336);this[_0x2f7f('0xd')]=_0x52f851;this[_0x2f7f('0xe')]=_0x58295f;}module['exports']=AGIError; \ No newline at end of file +var _0x9893=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x5bdbfd,_0x3aaf24){var _0x5711c0=function(_0x14b3ac){while(--_0x14b3ac){_0x5bdbfd['push'](_0x5bdbfd['shift']());}};_0x5711c0(++_0x3aaf24);}(_0x9893,0x1cd));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x3989('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x3989('0x1'),'E_AGI_SERVER_ERROR':_0x3989('0x2'),'E_AGI_SERVER_CLOSE':_0x3989('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x3989('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x3989('0x5'),'E_AGI_SOCKET_ERROR':_0x3989('0x6'),'E_AGI_SOCKET_CLOSE':_0x3989('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3989('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3989('0x9'),'E_AGI_IVR_ENTRY':_0x3989('0xa')};function AGIError(_0x4ba7d2){var _0x4ba7d2=_0x4ba7d2||null,_0x21ffcc=_0x21ffcc||[],_0xfb4b97=0x1,_0x198dd7='';if(!error[_0x4ba7d2]){_0x4ba7d2=_0x3989('0xb');}_0x21ffcc[_0x3989('0xc')](error[_0x4ba7d2]);while(arguments[_0xfb4b97]){_0x21ffcc['push'](arguments[_0xfb4b97]);_0xfb4b97++;}_0x198dd7=util[_0x3989('0xd')][_0x3989('0xe')](util,_0x21ffcc);this['message']=_0x198dd7;this[_0x3989('0xf')]=_0x4ba7d2;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index af70447..ff2f030 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x593b=['emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','agi'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x593b,0x8f));var _0xb593=function(_0x3ec030,_0x1dba95){_0x3ec030=_0x3ec030-0x0;var _0xe14165=_0x593b[_0x3ec030];return _0xe14165;};'use strict';var _=require(_0xb593('0x0'));var EventEmitter=require(_0xb593('0x1'))[_0xb593('0x2')];var Redis=require(_0xb593('0x3'));var AGIError=require(_0xb593('0x4'));var config=require(_0xb593('0x5'));config[_0xb593('0x6')]=_[_0xb593('0x7')](config[_0xb593('0x6')],{'host':_0xb593('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb593('0x6')]);sub['subscribe'](_0xb593('0x9'),function(_0x4f0ed7){if(_0x4f0ed7)return eventEmitter[_0xb593('0xa')]('error',new AGIError(_0xb593('0xb'),_0x4f0ed7));});sub['on'](_0xb593('0xc'),function(_0x4d0a34,_0x1bd9a4){if(_0x4d0a34!=='agi')return;try{var _0x57a478=JSON[_0xb593('0xd')](_0x1bd9a4);eventEmitter[_0xb593('0xa')](_0xb593('0xe'),_0x57a478);}catch(_0x4737a2){eventEmitter[_0xb593('0xa')](_0xb593('0xf'),new AGIError('E_AGI_SERVER_ERROR',_0x4737a2));}});module[_0xb593('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x0b1d=['../../config/environment','redis','subscribe','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','emit','exports','lodash','ioredis','./error'];(function(_0x10dfdf,_0xd11233){var _0x2ff0c7=function(_0x3b3d32){while(--_0x3b3d32){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x2ff0c7(++_0xd11233);}(_0x0b1d,0x19d));var _0xd0b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0b1('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0xd0b1('0x1'));var AGIError=require(_0xd0b1('0x2'));var config=require(_0xd0b1('0x3'));config[_0xd0b1('0x4')]=_['defaults'](config[_0xd0b1('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xd0b1('0x4')]);sub[_0xd0b1('0x5')]('agi',function(_0x48e8c8){if(_0x48e8c8)return eventEmitter['emit'](_0xd0b1('0x6'),new AGIError(_0xd0b1('0x7'),_0x48e8c8));});sub['on'](_0xd0b1('0x8'),function(_0x337aa6,_0x33adab){if(_0x337aa6!=='agi')return;try{var _0xb0d16=JSON[_0xd0b1('0x9')](_0x33adab);eventEmitter['emit'](_0xd0b1('0xa'),_0xb0d16);}catch(_0xd1b06c){eventEmitter[_0xd0b1('0xb')](_0xd0b1('0x6'),new AGIError(_0xd0b1('0x7'),_0xd1b06c));}});module[_0xd0b1('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index cb8a41e..2743778 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 _0xd882=['traverseBFS','info','stop\x20traverse','condition','split','length','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','getdigits','edges','numberOfEdges','prototype','vertices','addEdge','push','relations','getVertex'];(function(_0x1ceb07,_0x405a36){var _0x5e8906=function(_0x514375){while(--_0x514375){_0x1ceb07['push'](_0x1ceb07['shift']());}};_0x5e8906(++_0x405a36);}(_0xd882,0xf8));var _0x2d88=function(_0x44f9c0,_0x391085){_0x44f9c0=_0x44f9c0-0x0;var _0x241aa7=_0xd882[_0x44f9c0];return _0x241aa7;};'use strict';var _=require(_0x2d88('0x0'));var logger=require(_0x2d88('0x1'))(_0x2d88('0x2'));var verticesWithRetry=['menu',_0x2d88('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x2d88('0x4')]={};this[_0x2d88('0x5')]=0x0;};Graph[_0x2d88('0x6')]['addVertex']=function(_0x5eeda3){this[_0x2d88('0x7')][_0x5eeda3['id']]=_0x5eeda3;this[_0x2d88('0x4')][_0x5eeda3['id']]=[];};Graph['prototype'][_0x2d88('0x8')]=function(_0x2dff60,_0x2fe562,_0x24c44c){this['edges'][_0x2dff60][_0x2d88('0x9')]({'target':_0x2fe562,'condition':_0x24c44c});this['numberOfEdges']+=0x1;};Graph[_0x2d88('0x6')]['size']=function(){return _['size'](this[_0x2d88('0x7')]);};Graph[_0x2d88('0x6')][_0x2d88('0xa')]=function(){return this[_0x2d88('0x5')];};Graph[_0x2d88('0x6')][_0x2d88('0xb')]=function(_0x30ac04){return this['vertices'][_0x30ac04];};Graph[_0x2d88('0x6')][_0x2d88('0xc')]=function(_0x437963,_0x108f21){if(!this[_0x2d88('0x7')][_0x437963]){return logger[_0x2d88('0xd')]('no\x20vertex\x20found');}var _0x1ecc83=_0x108f21(this[_0x2d88('0x7')][_0x437963]);if(!_0x1ecc83){return logger[_0x2d88('0xd')](_0x2d88('0xe'));}if(this[_0x2d88('0x4')][_0x437963]['length']===0x0){return logger[_0x2d88('0xd')]('no\x20edge/s\x20available');}for(var _0x1779fe=0x0,_0x4db316=[],_0xf7dcd5=![];_0x1779fe\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense'];(function(_0x3c2cf7,_0x189dc6){var _0x5c219d=function(_0x23c32a){while(--_0x23c32a){_0x3c2cf7['push'](_0x3c2cf7['shift']());}};_0x5c219d(++_0x189dc6);}(_0x0b75,0x1ca));var _0x50b7=function(_0x43d47b,_0x21e7b8){_0x43d47b=_0x43d47b-0x0;var _0x468fb3=_0x0b75[_0x43d47b];return _0x468fb3;};'use strict';var _=require(_0x50b7('0x0'));var syncho=require(_0x50b7('0x1'));var util=require(_0x50b7('0x2'));var config=require(_0x50b7('0x3'));var logger=require(_0x50b7('0x4'))(_0x50b7('0x5'));var utilLicense=require(_0x50b7('0x6'));var rpc=require(_0x50b7('0x7'));var Project=require('./project');var AGIEmitter=require('./events')[_0x50b7('0x8')];var projects=[];config[_0x50b7('0x5')]=_[_0x50b7('0x9')](config['agi'],{'ip':_0x50b7('0xa'),'port':0x11dd});AGIEmitter['on'](_0x50b7('0xb'),projectUpdateHandler);function connectionHandler(_0x391181){process[_0x50b7('0xc')](function(){syncho(function(){try{setChannelVariables(_0x391181);agiHandler(_0x391181);}catch(_0x53072d){logger[_0x50b7('0xd')](_0x53072d[_0x50b7('0xe')]);}});});}function projectUpdateHandler(_0x2320f6){try{var _0x4f12a6=_[_0x50b7('0xf')](projects,['id',_0x2320f6['id']]);if(_0x4f12a6>-0x1){if(_0x2320f6[_0x50b7('0x10')]===!![]){projects['splice'](_0x4f12a6,0x1);}else{projects[_0x4f12a6]=_0x2320f6;}}else{projects[_0x50b7('0x11')](_0x2320f6);}}catch(_0x429bf3){logger[_0x50b7('0xd')](_0x429bf3['stack']);}}function listeningHandler(){console[_0x50b7('0x12')](_0x50b7('0x13'),config[_0x50b7('0x5')][_0x50b7('0x14')]);logger[_0x50b7('0x15')](util[_0x50b7('0x16')](_0x50b7('0x17'),config[_0x50b7('0x5')]['ip'],config[_0x50b7('0x5')][_0x50b7('0x14')]));}function errorHandler(_0x12de44){if(_0x12de44&&_0x12de44['name']&&_0x12de44['message']){logger[_0x50b7('0xd')](util['format'](_0x50b7('0x18'),_0x12de44[_0x50b7('0x19')],_0x12de44[_0x50b7('0x1a')]));}else{logger[_0x50b7('0xd')](util[_0x50b7('0x16')]('[ERROR]\x20%s',_0x12de44['stack']));}}function closeHandler(){logger[_0x50b7('0x15')](util[_0x50b7('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x50b7('0x1b')],this[_0x50b7('0x1c')],this[_0x50b7('0x1d')],this[_0x50b7('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1f6eb8){logger[_0x50b7('0xd')](_0x1f6eb8[_0x50b7('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x50b7('0x16')](_0x50b7('0x1f'),this[_0x50b7('0x1b')],this[_0x50b7('0x1c')],this[_0x50b7('0x1d')],this[_0x50b7('0x1e')],this[_0x50b7('0x20')]));}function hangupHandler(){logger[_0x50b7('0x15')](util[_0x50b7('0x16')](_0x50b7('0x21'),this[_0x50b7('0x1b')],this[_0x50b7('0x1c')],this['callerid'],this[_0x50b7('0x1e')],this[_0x50b7('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x2a400b,_0x240fdf){rpc[_0x50b7('0x22')](_0x2a400b)[_0x50b7('0x23')](function(_0x114b6e){if(_0x240fdf){_0x240fdf(null,_0x114b6e);}})[_0x50b7('0x24')](function(_0xe2e2fc){if(_0x240fdf){_0x240fdf(null,_0xe2e2fc);}});}function setChannelVariables(_0x40da6d){for(var _0x108bd4 in _0x40da6d){if(_0x40da6d[_0x50b7('0x25')](_0x108bd4)){if(_0x108bd4[_0x50b7('0x26')](_0x50b7('0x27'))===0x0){_0x40da6d[_0x108bd4[_0x50b7('0x28')](0x4)]=_0x40da6d[_0x108bd4];delete _0x40da6d[_0x108bd4];}}}}function agiHandler(_0x54f462){logger[_0x50b7('0x29')](_0x50b7('0x2a'),JSON[_0x50b7('0x2b')](_0x54f462,null,0x2));logger['info'](util[_0x50b7('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x54f462[_0x50b7('0x1b')],_0x54f462[_0x50b7('0x1c')],_0x54f462['callerid'],_0x54f462[_0x50b7('0x1e')],_0x54f462[_0x50b7('0x20')]));_0x54f462['on'](_0x50b7('0xd'),errorHandler);_0x54f462['on'](_0x50b7('0x2c'),closeHandler);_0x54f462['on'](_0x50b7('0x2d'),timeoutHandler);_0x54f462[_0x50b7('0x2e')]=![];_0x54f462['on'](_0x50b7('0x2f'),hangupHandler);var _0x3e7df7=_[_0x50b7('0x30')](projects,[_0x50b7('0x19'),_0x54f462[_0x50b7('0x1b')]]);if(!_0x3e7df7)return Project[_0x50b7('0x31')](_0x54f462);if(!_0x3e7df7[_0x50b7('0x32')])return Project[_0x50b7('0x33')](_0x54f462);return Project[_0x50b7('0x34')](_0x3e7df7,_0x54f462);}function main(){var _0x12bba0;return utilLicense[_0x50b7('0x35')]()['then'](function(_0x303613){if(!_0x303613)return;if(_0x303613[_0x50b7('0x36')]){if(_0x303613[_0x50b7('0x37')]&&_0x303613[_0x50b7('0x37')]>0x0){logger[_0x50b7('0x15')](util['format'](_0x50b7('0x38'),_0x303613[_0x50b7('0x37')]));_0x12bba0=_0x303613[_0x50b7('0x37')];}else{logger['info'](_0x50b7('0x39'));}}else{logger[_0x50b7('0x15')](_0x50b7('0x3a'));_0x12bba0=-0x1;}})['then'](function(){return Project[_0x50b7('0x3b')]();})[_0x50b7('0x23')](function(_0x5b59cf){projects=_0x5b59cf;return;})[_0x50b7('0x24')](function(_0x33e3e2){logger[_0x50b7('0xd')](_0x50b7('0x3c'),_0x33e3e2[_0x50b7('0xe')]);})[_0x50b7('0x3d')](function(){var _0x5027f0=require('./server')(config[_0x50b7('0x5')]['port'],config[_0x50b7('0x5')]['ip'],_0x12bba0);_0x5027f0['on']('error',errorHandler);_0x5027f0['on'](_0x50b7('0x3e'),listeningHandler);_0x5027f0['on'](_0x50b7('0x3f'),connectionHandler);_0x5027f0['on'](_0x50b7('0x2c'),closeHandler);});}main(); \ No newline at end of file +var _0x8449=['handleNotFound','production','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','finally','./server','port','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','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','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','substring','debug','variables','evtHangup','find'];(function(_0x2ceba7,_0x451ce4){var _0x5348eb=function(_0x3596fc){while(--_0x3596fc){_0x2ceba7['push'](_0x2ceba7['shift']());}};_0x5348eb(++_0x451ce4);}(_0x8449,0x170));var _0x9844=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8449[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x9844('0x0'));var syncho=require(_0x9844('0x1'));var util=require(_0x9844('0x2'));var config=require(_0x9844('0x3'));var logger=require(_0x9844('0x4'))(_0x9844('0x5'));var utilLicense=require(_0x9844('0x6'));var rpc=require(_0x9844('0x7'));var Project=require(_0x9844('0x8'));var AGIEmitter=require(_0x9844('0x9'))[_0x9844('0xa')];var projects=[];config['agi']=_[_0x9844('0xb')](config[_0x9844('0x5')],{'ip':_0x9844('0xc'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x2d8277){process[_0x9844('0xd')](function(){syncho(function(){try{setChannelVariables(_0x2d8277);agiHandler(_0x2d8277);}catch(_0x163898){logger[_0x9844('0xe')](_0x163898[_0x9844('0xf')]);}});});}function projectUpdateHandler(_0x2f1eb4){try{var _0x2fc7e1=_[_0x9844('0x10')](projects,['id',_0x2f1eb4['id']]);if(_0x2fc7e1>-0x1){if(_0x2f1eb4[_0x9844('0x11')]===!![]){projects['splice'](_0x2fc7e1,0x1);}else{projects[_0x2fc7e1]=_0x2f1eb4;}}else{projects['push'](_0x2f1eb4);}}catch(_0xfb393c){logger[_0x9844('0xe')](_0xfb393c['stack']);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9844('0x5')]['port']);logger[_0x9844('0x12')](util[_0x9844('0x13')](_0x9844('0x14'),config[_0x9844('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x54d07a){if(_0x54d07a&&_0x54d07a[_0x9844('0x15')]&&_0x54d07a[_0x9844('0x16')]){logger[_0x9844('0xe')](util['format'](_0x9844('0x17'),_0x54d07a[_0x9844('0x15')],_0x54d07a['message']));}else{logger[_0x9844('0xe')](util[_0x9844('0x13')](_0x9844('0x18'),_0x54d07a[_0x9844('0xf')]));}}function closeHandler(){logger[_0x9844('0x12')](util[_0x9844('0x13')](_0x9844('0x19'),this[_0x9844('0x1a')],this[_0x9844('0x1b')],this[_0x9844('0x1c')],this[_0x9844('0x1d')],this[_0x9844('0x1e')]));try{createSquareReport(this);}catch(_0x2588d0){logger['error'](_0x2588d0[_0x9844('0xf')]);}}function timeoutHandler(){logger[_0x9844('0x12')](util[_0x9844('0x13')](_0x9844('0x1f'),this[_0x9844('0x1a')],this[_0x9844('0x1b')],this[_0x9844('0x1c')],this['dnid'],this[_0x9844('0x1e')]));}function hangupHandler(){logger[_0x9844('0x12')](util['format'](_0x9844('0x20'),this['arg_1'],this[_0x9844('0x1b')],this['callerid'],this[_0x9844('0x1d')],this[_0x9844('0x1e')]));this['evtHangup']=!![];}function createSquareReport(_0x2f68a7,_0x3097d8){rpc[_0x9844('0x21')](_0x2f68a7)[_0x9844('0x22')](function(_0x1a7fbf){if(_0x3097d8){_0x3097d8(null,_0x1a7fbf);}})['catch'](function(_0x1239ef){if(_0x3097d8){_0x3097d8(null,_0x1239ef);}});}function setChannelVariables(_0x3da72a){for(var _0x2c9faa in _0x3da72a){if(_0x3da72a['hasOwnProperty'](_0x2c9faa)){if(_0x2c9faa['indexOf']('agi_')===0x0){_0x3da72a[_0x2c9faa[_0x9844('0x23')](0x4)]=_0x3da72a[_0x2c9faa];delete _0x3da72a[_0x2c9faa];}}}}function agiHandler(_0x1ee68d){logger[_0x9844('0x24')](_0x9844('0x25'),JSON['stringify'](_0x1ee68d,null,0x2));logger[_0x9844('0x12')](util[_0x9844('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1ee68d[_0x9844('0x1a')],_0x1ee68d['calleridname'],_0x1ee68d[_0x9844('0x1c')],_0x1ee68d[_0x9844('0x1d')],_0x1ee68d[_0x9844('0x1e')]));_0x1ee68d['on']('error',errorHandler);_0x1ee68d['on']('close',closeHandler);_0x1ee68d['on']('timeout',timeoutHandler);_0x1ee68d[_0x9844('0x26')]=![];_0x1ee68d['on']('hangup',hangupHandler);var _0xc1f1af=_[_0x9844('0x27')](projects,[_0x9844('0x15'),_0x1ee68d['arg_1']]);if(!_0xc1f1af)return Project[_0x9844('0x28')](_0x1ee68d);if(!_0xc1f1af[_0x9844('0x29')])return Project['handleUnpublished'](_0x1ee68d);return Project[_0x9844('0x2a')](_0xc1f1af,_0x1ee68d);}function main(){var _0x486a6e;return utilLicense['getLicense']()[_0x9844('0x22')](function(_0x415981){if(!_0x415981)return;if(_0x415981[_0x9844('0x2b')]){if(_0x415981[_0x9844('0x2c')]&&_0x415981[_0x9844('0x2c')]>0x0){logger[_0x9844('0x12')](util['format'](_0x9844('0x2d'),_0x415981[_0x9844('0x2c')]));_0x486a6e=_0x415981['callysquare'];}else{logger[_0x9844('0x12')](_0x9844('0x2e'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x486a6e=-0x1;}})[_0x9844('0x22')](function(){return Project['getAll']();})[_0x9844('0x22')](function(_0x20c285){projects=_0x20c285;return;})['catch'](function(_0x33ae64){logger[_0x9844('0xe')]('[LICENSE]',_0x33ae64[_0x9844('0xf')]);})[_0x9844('0x2f')](function(){var _0x84898=require(_0x9844('0x30'))(config[_0x9844('0x5')][_0x9844('0x31')],config[_0x9844('0x5')]['ip'],_0x486a6e);_0x84898['on'](_0x9844('0xe'),errorHandler);_0x84898['on']('listening',listeningHandler);_0x84898['on'](_0x9844('0x32'),connectionHandler);_0x84898['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 f2bccee..9f2168a 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 _0xb739=['SendMail','jayson/promise','client','http','request','then','error','message','result','sendMailMessage'];(function(_0x5a832a,_0x3687e9){var _0x16dff3=function(_0x207163){while(--_0x207163){_0x5a832a['push'](_0x5a832a['shift']());}};_0x16dff3(++_0x3687e9);}(_0xb739,0x8d));var _0x9b73=function(_0x40ee01,_0x485b90){_0x40ee01=_0x40ee01-0x0;var _0x4ea3e7=_0xb739[_0x40ee01];return _0x4ea3e7;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9b73('0x0'));var client=jayson[_0x9b73('0x1')][_0x9b73('0x2')]({'port':0x232b});function request(_0x142fa3,_0x5099d0){return new BPromise(function(_0x18b60c,_0x4464ba){return client[_0x9b73('0x3')](_0x142fa3,_0x5099d0)[_0x9b73('0x4')](function(_0x579575){if(_0x579575[_0x9b73('0x5')]){return _0x4464ba(_0x579575['error'][_0x9b73('0x6')]);}else{return _0x18b60c(_0x579575[_0x9b73('0x7')]);}})['catch'](function(_0x5ba80a){return _0x4464ba(_0x5ba80a);});});}exports[_0x9b73('0x8')]=function(_0x19734a,_0x3f8677){return request(_0x9b73('0x9'),{'account':_0x19734a,'message':_0x3f8677});}; \ No newline at end of file +var _0x5410=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','then','error','message','result'];(function(_0x5b70e6,_0x266e34){var _0xb4f734=function(_0x532fad){while(--_0x532fad){_0x5b70e6['push'](_0x5b70e6['shift']());}};_0xb4f734(++_0x266e34);}(_0x5410,0x175));var _0x0541=function(_0x357308,_0x5d488d){_0x357308=_0x357308-0x0;var _0x84b112=_0x5410[_0x357308];return _0x84b112;};'use strict';var BPromise=require(_0x0541('0x0'));var jayson=require(_0x0541('0x1'));var client=jayson['client'][_0x0541('0x2')]({'port':0x232b});function request(_0x3c795f,_0x22707b){return new BPromise(function(_0x2e00ed,_0x4e5f0f){return client['request'](_0x3c795f,_0x22707b)[_0x0541('0x3')](function(_0x3d3513){if(_0x3d3513[_0x0541('0x4')]){return _0x4e5f0f(_0x3d3513['error'][_0x0541('0x5')]);}else{return _0x2e00ed(_0x3d3513[_0x0541('0x6')]);}})[_0x0541('0x7')](function(_0x1b6811){return _0x4e5f0f(_0x1b6811);});});}exports[_0x0541('0x8')]=function(_0x26f08c,_0x3978c0){return request(_0x0541('0x9'),{'account':_0x26f08c,'message':_0x3978c0});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 088abc0..84677bf 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf057=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','../../config/logger','./vertices','getSquareProjects','error','stack','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','addEdge','target','value','toJson','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','traverseBFS','clear','debug','context','priority','agicommand','info','response','code','result','isUndefined','toString','agicommand\x20not\x20found'];(function(_0x9b6ca9,_0x1b0f67){var _0x5b32d9=function(_0x46b5c8){while(--_0x46b5c8){_0x9b6ca9['push'](_0x9b6ca9['shift']());}};_0x5b32d9(++_0x1b0f67);}(_0xf057,0x133));var _0x7f05=function(_0x3494e3,_0xb66350){_0x3494e3=_0x3494e3-0x0;var _0xbd00a0=_0xf057[_0x3494e3];return _0xbd00a0;};'use strict';var _=require('lodash');var moment=require(_0x7f05('0x0'));var parser=require(_0x7f05('0x1'));var util=require(_0x7f05('0x2'));var logger=require(_0x7f05('0x3'))('agi');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x7f05('0x4'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7f05('0x5')]()['catch'](function(_0x6586b5){logger[_0x7f05('0x6')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x6586b5[_0x7f05('0x7')]);return[];});}function addVertex(_0x544ff,_0x312232,_0x1104ad){_0x312232['agicommand']=_0x1104ad;if(_0x312232[_0x7f05('0x8')](_0x7f05('0x9'))){_0x312232[_0x7f05('0xa')]=parseInt(_0x312232[_0x7f05('0x9')],0xa);}_0x544ff[_0x7f05('0xb')](_['omit'](_0x312232,'mxCell'));}function initGraph(_0x15c231,_0x5f0144){var _0x3b96cc=new Graph();for(var _0x3e3e6e in _0x15c231){if(_0x15c231['hasOwnProperty'](_0x3e3e6e)){if(_[_0x7f05('0xc')](_0x15c231[_0x3e3e6e])){for(var _0x5de644=0x0;_0x5de644<_0x15c231[_0x3e3e6e][_0x7f05('0xd')];_0x5de644+=0x1){addVertex(_0x3b96cc,_0x15c231[_0x3e3e6e][_0x5de644],_0x3e3e6e);}}else{addVertex(_0x3b96cc,_0x15c231[_0x3e3e6e],_0x3e3e6e);}}}for(var _0x5f21d5=0x0;_0x5f21d5<_0x5f0144[_0x7f05('0xd')];_0x5f21d5+=0x1){if(_0x5f0144[_0x5f21d5][_0x7f05('0xe')]&&_0x5f0144[_0x5f21d5]['target']){_0x3b96cc[_0x7f05('0xf')](_0x5f0144[_0x5f21d5][_0x7f05('0xe')],_0x5f0144[_0x5f21d5][_0x7f05('0x10')],_0x5f0144[_0x5f21d5][_0x7f05('0x11')]);}}return _0x3b96cc;}function getRoot(_0x285a41){return parser[_0x7f05('0x12')](_0x285a41,{'object':!![]})[_0x7f05('0x13')][_0x7f05('0x14')];}function inspect(_0x1e1409){return util[_0x7f05('0x15')](_0x1e1409,{'showHidden':![],'depth':null});}function initialize(_0x48eb39,_0x1ffd25){var _0x41b264=getRoot(_0x48eb39[_0x7f05('0x16')]);if(!_0x41b264||!_0x41b264[_0x7f05('0x17')])return;var _0x50bf81,_0x4106eb,_0x40534f;logger['debug']('root',JSON[_0x7f05('0x18')](_0x41b264,null,0x2));_0x1ffd25[_0x7f05('0x19')]=moment()[_0x7f05('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x50bf81=initGraph(_[_0x7f05('0x1b')](_0x41b264,_0x7f05('0x1c')),_0x41b264[_0x7f05('0x1c')]);_0x4106eb=new Vertices(_0x1ffd25,rpc,mailRpc);logger['info'](util[_0x7f05('0x1a')](_0x7f05('0x1d'),_0x1ffd25[_0x7f05('0x1e')],_0x1ffd25[_0x7f05('0x1f')],_0x1ffd25[_0x7f05('0x20')],_0x1ffd25[_0x7f05('0x21')],_0x1ffd25['uniqueid']));_0x50bf81[_0x7f05('0x22')](_0x41b264['start']['id'],function(_0x39322e){try{_0x39322e=_0x4106eb[_0x7f05('0x23')](_0x39322e);logger[_0x7f05('0x24')]('vertex',JSON[_0x7f05('0x18')](_0x39322e,null,0x2));if(_0x39322e['agicommand']==='gotoc'){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1ffd25[_0x7f05('0x25')]=_0x39322e[_0x7f05('0x25')]||_0x1ffd25['context'];_0x1ffd25['extension']=_0x39322e['extension'];_0x1ffd25[_0x7f05('0x26')]=_0x39322e[_0x7f05('0x26')]?_0x39322e[_0x7f05('0x26')]-0x1:0x1;return null;}else if(_0x39322e&&_0x4106eb[_0x39322e[_0x7f05('0x27')]]){_0x40534f=_0x4106eb[_0x39322e['agicommand']](_0x39322e);logger[_0x7f05('0x28')](_0x7f05('0x29'),JSON[_0x7f05('0x18')](_0x40534f,null,0x2));if(_0x40534f&&_0x40534f[_0x7f05('0x2a')]===AGI_CODE_SUCCESS&&_0x40534f[_0x7f05('0x2b')]!==AGI_RESULT_ERROR&&!_0x1ffd25['evtHangup']){logger[_0x7f05('0x24')]('response',inspect(_0x40534f));return _[_0x7f05('0x2c')](_0x40534f[_0x7f05('0x2b')])?null:_0x40534f[_0x7f05('0x2b')][_0x7f05('0x2d')]();}else{logger[_0x7f05('0x6')](_0x7f05('0x29'),inspect(_0x40534f));return null;}}else{logger[_0x7f05('0x6')](_0x7f05('0x2e'));return null;}}catch(_0x9e0d59){logger[_0x7f05('0x6')](_0x9e0d59['stack']);return null;}});if(_0x41b264[_0x7f05('0x2f')]){logger['info'](util[_0x7f05('0x1a')](_0x7f05('0x30'),_0x1ffd25[_0x7f05('0x1e')],_0x1ffd25[_0x7f05('0x1f')],_0x1ffd25[_0x7f05('0x20')],_0x1ffd25[_0x7f05('0x21')],_0x1ffd25[_0x7f05('0x31')]));_0x50bf81[_0x7f05('0x22')](_0x41b264[_0x7f05('0x2f')]['id'],function(_0x522694){try{_0x522694=_0x4106eb[_0x7f05('0x23')](_0x522694);logger['debug'](_0x7f05('0x32'),JSON[_0x7f05('0x18')](_0x522694,null,0x2));if(_0x522694&&_0x4106eb[_0x522694[_0x7f05('0x27')]]){_0x40534f=_0x4106eb[_0x522694[_0x7f05('0x27')]](_0x522694);if(_0x40534f){logger[_0x7f05('0x24')]('response',inspect(_0x40534f));return _['isUndefined'](_0x40534f[_0x7f05('0x2b')])?null:_0x40534f[_0x7f05('0x2b')][_0x7f05('0x2d')]();}else{logger[_0x7f05('0x6')](_0x7f05('0x29'),inspect(_0x40534f));return null;}}else{logger[_0x7f05('0x6')]('agicommand\x20not\x20found');return null;}}catch(_0x10c969){logger[_0x7f05('0x6')](_0x10c969[_0x7f05('0x7')]);return null;}});}logger['info'](util[_0x7f05('0x1a')](_0x7f05('0x33'),_0x1ffd25[_0x7f05('0x1e')],_0x1ffd25['calleridname'],_0x1ffd25[_0x7f05('0x20')],_0x1ffd25[_0x7f05('0x21')],_0x1ffd25[_0x7f05('0x31')]));logger[_0x7f05('0x28')](util[_0x7f05('0x1a')](_0x7f05('0x34'),_0x1ffd25['context'],_0x1ffd25[_0x7f05('0x35')],parseInt(_0x1ffd25['priority'],0xa)+0x1));_0x1ffd25[_0x7f05('0x36')](_0x1ffd25['context'],_0x1ffd25[_0x7f05('0x35')],parseInt(_0x1ffd25[_0x7f05('0x26')],0xa)+0x1);_0x1ffd25[_0x7f05('0x37')]();}function handleNotFound(_0x7f45b6){logger[_0x7f05('0x6')](util['format'](_0x7f05('0x38'),_0x7f45b6[_0x7f05('0x1e')]));_0x7f45b6['continueAt'](_0x7f45b6['context'],_0x7f45b6[_0x7f05('0x35')],parseInt(_0x7f45b6[_0x7f05('0x26')],0xa)+0x1);_0x7f45b6[_0x7f05('0x37')]();}function handleUnpublished(_0x939def){logger['error'](util[_0x7f05('0x1a')](_0x7f05('0x39'),_0x939def[_0x7f05('0x1e')]));_0x939def[_0x7f05('0x36')](_0x939def[_0x7f05('0x25')],_0x939def[_0x7f05('0x35')],parseInt(_0x939def['priority'],0xa)+0x1);_0x939def[_0x7f05('0x37')]();}module[_0x7f05('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x768e=['length','source','target','addEdge','value','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','traverseBFS','clear','debug','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray'];(function(_0x191f7e,_0x424162){var _0x33572a=function(_0x1ec94a){while(--_0x1ec94a){_0x191f7e['push'](_0x191f7e['shift']());}};_0x33572a(++_0x424162);}(_0x768e,0x12a));var _0xe768=function(_0x467606,_0xf67815){_0x467606=_0x467606-0x0;var _0x32987e=_0x768e[_0x467606];return _0x32987e;};'use strict';var _=require(_0xe768('0x0'));var moment=require(_0xe768('0x1'));var parser=require(_0xe768('0x2'));var util=require('util');var logger=require(_0xe768('0x3'))(_0xe768('0x4'));var rpc=require(_0xe768('0x5'));var mailRpc=require(_0xe768('0x6'));var Graph=require(_0xe768('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x2430ce){logger[_0xe768('0x8')](_0xe768('0x9'),_0x2430ce['stack']);return[];});}function addVertex(_0x2debc0,_0x1c9c80,_0x4957cf){_0x1c9c80[_0xe768('0xa')]=_0x4957cf;if(_0x1c9c80[_0xe768('0xb')]('retry')){_0x1c9c80[_0xe768('0xc')]=parseInt(_0x1c9c80[_0xe768('0xd')],0xa);}_0x2debc0['addVertex'](_[_0xe768('0xe')](_0x1c9c80,_0xe768('0xf')));}function initGraph(_0x2d342d,_0x26e569){var _0x1ed8e0=new Graph();for(var _0x377506 in _0x2d342d){if(_0x2d342d[_0xe768('0xb')](_0x377506)){if(_[_0xe768('0x10')](_0x2d342d[_0x377506])){for(var _0x448cb2=0x0;_0x448cb2<_0x2d342d[_0x377506][_0xe768('0x11')];_0x448cb2+=0x1){addVertex(_0x1ed8e0,_0x2d342d[_0x377506][_0x448cb2],_0x377506);}}else{addVertex(_0x1ed8e0,_0x2d342d[_0x377506],_0x377506);}}}for(var _0x263621=0x0;_0x263621<_0x26e569[_0xe768('0x11')];_0x263621+=0x1){if(_0x26e569[_0x263621][_0xe768('0x12')]&&_0x26e569[_0x263621][_0xe768('0x13')]){_0x1ed8e0[_0xe768('0x14')](_0x26e569[_0x263621][_0xe768('0x12')],_0x26e569[_0x263621][_0xe768('0x13')],_0x26e569[_0x263621][_0xe768('0x15')]);}}return _0x1ed8e0;}function getRoot(_0x217f17){return parser['toJson'](_0x217f17,{'object':!![]})[_0xe768('0x16')][_0xe768('0x17')];}function inspect(_0x569049){return util[_0xe768('0x18')](_0x569049,{'showHidden':![],'depth':null});}function initialize(_0x239dd1,_0x18c1da){var _0x562056=getRoot(_0x239dd1[_0xe768('0x19')]);if(!_0x562056||!_0x562056[_0xe768('0x1a')])return;var _0x13f12f,_0x2b7b4d,_0x12560e;logger['debug']('root',JSON[_0xe768('0x1b')](_0x562056,null,0x2));_0x18c1da[_0xe768('0x1c')]=moment()[_0xe768('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');_0x13f12f=initGraph(_[_0xe768('0xe')](_0x562056,_0xe768('0xf')),_0x562056['mxCell']);_0x2b7b4d=new Vertices(_0x18c1da,rpc,mailRpc);logger[_0xe768('0x1e')](util[_0xe768('0x1d')](_0xe768('0x1f'),_0x18c1da['arg_1'],_0x18c1da['calleridname'],_0x18c1da[_0xe768('0x20')],_0x18c1da['dnid'],_0x18c1da[_0xe768('0x21')]));_0x13f12f[_0xe768('0x22')](_0x562056[_0xe768('0x1a')]['id'],function(_0x4d63e6){try{_0x4d63e6=_0x2b7b4d[_0xe768('0x23')](_0x4d63e6);logger[_0xe768('0x24')]('vertex',JSON[_0xe768('0x1b')](_0x4d63e6,null,0x2));if(_0x4d63e6[_0xe768('0xa')]===_0xe768('0x25')){logger[_0xe768('0x1e')](_0xe768('0x26'));_0x18c1da[_0xe768('0x27')]=_0x4d63e6[_0xe768('0x27')]||_0x18c1da[_0xe768('0x27')];_0x18c1da['extension']=_0x4d63e6[_0xe768('0x28')];_0x18c1da[_0xe768('0x29')]=_0x4d63e6[_0xe768('0x29')]?_0x4d63e6[_0xe768('0x29')]-0x1:0x1;return null;}else if(_0x4d63e6&&_0x2b7b4d[_0x4d63e6['agicommand']]){_0x12560e=_0x2b7b4d[_0x4d63e6['agicommand']](_0x4d63e6);logger[_0xe768('0x1e')](_0xe768('0x2a'),JSON[_0xe768('0x1b')](_0x12560e,null,0x2));if(_0x12560e&&_0x12560e[_0xe768('0x2b')]===AGI_CODE_SUCCESS&&_0x12560e[_0xe768('0x2c')]!==AGI_RESULT_ERROR&&!_0x18c1da[_0xe768('0x2d')]){logger['debug'](_0xe768('0x2a'),inspect(_0x12560e));return _[_0xe768('0x2e')](_0x12560e[_0xe768('0x2c')])?null:_0x12560e[_0xe768('0x2c')][_0xe768('0x2f')]();}else{logger[_0xe768('0x8')](_0xe768('0x2a'),inspect(_0x12560e));return null;}}else{logger['error'](_0xe768('0x30'));return null;}}catch(_0x4d6603){logger['error'](_0x4d6603[_0xe768('0x31')]);return null;}});if(_0x562056[_0xe768('0x32')]){logger[_0xe768('0x1e')](util[_0xe768('0x1d')](_0xe768('0x33'),_0x18c1da[_0xe768('0x34')],_0x18c1da[_0xe768('0x35')],_0x18c1da[_0xe768('0x20')],_0x18c1da[_0xe768('0x36')],_0x18c1da[_0xe768('0x21')]));_0x13f12f[_0xe768('0x22')](_0x562056[_0xe768('0x32')]['id'],function(_0xc453cb){try{_0xc453cb=_0x2b7b4d[_0xe768('0x23')](_0xc453cb);logger[_0xe768('0x24')](_0xe768('0x37'),JSON['stringify'](_0xc453cb,null,0x2));if(_0xc453cb&&_0x2b7b4d[_0xc453cb[_0xe768('0xa')]]){_0x12560e=_0x2b7b4d[_0xc453cb['agicommand']](_0xc453cb);if(_0x12560e){logger['debug'](_0xe768('0x2a'),inspect(_0x12560e));return _['isUndefined'](_0x12560e[_0xe768('0x2c')])?null:_0x12560e['result'][_0xe768('0x2f')]();}else{logger[_0xe768('0x8')](_0xe768('0x2a'),inspect(_0x12560e));return null;}}else{logger[_0xe768('0x8')](_0xe768('0x30'));return null;}}catch(_0x4b4ab7){logger['error'](_0x4b4ab7[_0xe768('0x31')]);return null;}});}logger[_0xe768('0x1e')](util[_0xe768('0x1d')](_0xe768('0x38'),_0x18c1da[_0xe768('0x34')],_0x18c1da[_0xe768('0x35')],_0x18c1da[_0xe768('0x20')],_0x18c1da[_0xe768('0x36')],_0x18c1da[_0xe768('0x21')]));logger[_0xe768('0x1e')](util['format'](_0xe768('0x39'),_0x18c1da[_0xe768('0x27')],_0x18c1da['extension'],parseInt(_0x18c1da['priority'],0xa)+0x1));_0x18c1da[_0xe768('0x3a')](_0x18c1da['context'],_0x18c1da['extension'],parseInt(_0x18c1da[_0xe768('0x29')],0xa)+0x1);_0x18c1da[_0xe768('0x3b')]();}function handleNotFound(_0x36f636){logger[_0xe768('0x8')](util[_0xe768('0x1d')](_0xe768('0x3c'),_0x36f636['arg_1']));_0x36f636[_0xe768('0x3a')](_0x36f636['context'],_0x36f636[_0xe768('0x28')],parseInt(_0x36f636[_0xe768('0x29')],0xa)+0x1);_0x36f636[_0xe768('0x3b')]();}function handleUnpublished(_0xff5937){logger[_0xe768('0x8')](util[_0xe768('0x1d')](_0xe768('0x3d'),_0xff5937[_0xe768('0x34')]));_0xff5937[_0xe768('0x3a')](_0xff5937[_0xe768('0x27')],_0xff5937[_0xe768('0x28')],parseInt(_0xff5937[_0xe768('0x29')],0xa)+0x1);_0xff5937[_0xe768('0x3b')]();}module[_0xe768('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 787d9df..575238e 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 _0x1663=['trim','slice','emit','line','exports','stream','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length'];(function(_0xfb9baf,_0x5501b1){var _0x500948=function(_0xa4f100){while(--_0xa4f100){_0xfb9baf['push'](_0xfb9baf['shift']());}};_0x500948(++_0x5501b1);}(_0x1663,0x95));var _0x3166=function(_0x49d7cb,_0x35104a){_0x49d7cb=_0x49d7cb-0x0;var _0x1b4dca=_0x1663[_0x49d7cb];return _0x1b4dca;};'use strict';var util=require('util');var Transform=require(_0x3166('0x0'))['Transform'];function AGIReply(_0xe38fbb){Transform['call'](this,_0xe38fbb);this[_0x3166('0x1')]='';this[_0x3166('0x2')]=![];}util[_0x3166('0x3')](AGIReply,Transform);AGIReply[_0x3166('0x4')][_0x3166('0x5')]=function(_0x3b9b14,_0x1d0f2c,_0x2fddaa){var _0x26923d='\x0a',_0x338308=['\x0a\x0a',_0x3166('0x6')],_0x256a56=-0x1,_0x2c7d74=-0x1,_0x4ac68e='',_0x492c9f=0x0,_0xf39012='',_0x210003='';this['_localBuffer']+=_0x3b9b14[_0x3166('0x7')]();_0xf39012=this[_0x3166('0x1')];if(!this[_0x3166('0x2')]){_0x492c9f=0x0;while(_0x338308[_0x492c9f]){while((_0x2c7d74=_0xf39012[_0x3166('0x8')](_0x338308[_0x492c9f]))!=-0x1){_0x4ac68e=_0x338308[_0x492c9f];_0x210003=_0xf39012['substring'](0x0,_0x2c7d74);_0xf39012=_0xf39012[_0x3166('0x9')](_0x2c7d74+_0x4ac68e[_0x3166('0xa')]);var _0x5db0c4=_0x210003['split'](_0x26923d),_0x4e754a=0x0,_0x38ace9={},_0x2a371e='',_0x3f0c99='',_0x591087=-0x1;while(_0x5db0c4[_0x4e754a]){_0x591087=_0x5db0c4[_0x4e754a][_0x3166('0x8')](':');if(_0x591087!=-0x1){_0x2a371e=_0x5db0c4[_0x4e754a]['slice'](0x0,_0x591087)[_0x3166('0xb')]();_0x3f0c99=_0x5db0c4[_0x4e754a][_0x3166('0xc')](_0x591087+0x1)['trim']();if(_0x2a371e[_0x3166('0xa')]>0x0){_0x38ace9[_0x2a371e]=_0x3f0c99;}}else{}_0x4e754a++;}this[_0x3166('0xd')]('headers',_0x38ace9);this[_0x3166('0x2')]=!![];}_0x492c9f++;}this[_0x3166('0x1')]=_0xf39012;}else{while((_0x256a56=_0xf39012['indexOf'](_0x26923d))!=-0x1){_0x210003=_0xf39012['substring'](0x0,_0x256a56);this['emit'](_0x3166('0xe'),_0x210003);_0xf39012=_0xf39012['substring'](_0x256a56+_0x26923d[_0x3166('0xa')]);}this[_0x3166('0x1')]=_0xf39012;}_0x2fddaa();};module[_0x3166('0xf')]=AGIReply; \ No newline at end of file +var _0x2fee=['_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','trim','slice','headers','util','Transform','call'];(function(_0x146750,_0x1f8532){var _0x477c26=function(_0x4baa68){while(--_0x4baa68){_0x146750['push'](_0x146750['shift']());}};_0x477c26(++_0x1f8532);}(_0x2fee,0x11a));var _0xe2fe=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x2fee[_0x1ae8ab];return _0x1ad705;};'use strict';var util=require(_0xe2fe('0x0'));var Transform=require('stream')[_0xe2fe('0x1')];function AGIReply(_0x527fbd){Transform[_0xe2fe('0x2')](this,_0x527fbd);this['_localBuffer']='';this[_0xe2fe('0x3')]=![];}util[_0xe2fe('0x4')](AGIReply,Transform);AGIReply['prototype'][_0xe2fe('0x5')]=function(_0x2676cd,_0x128ac4,_0x4d4ac4){var _0x20d031='\x0a',_0x361d40=['\x0a\x0a',_0xe2fe('0x6')],_0x1a103d=-0x1,_0xe0f512=-0x1,_0x39a31c='',_0x2e0fc1=0x0,_0x51d97f='',_0x2168c8='';this['_localBuffer']+=_0x2676cd[_0xe2fe('0x7')]();_0x51d97f=this[_0xe2fe('0x8')];if(!this[_0xe2fe('0x3')]){_0x2e0fc1=0x0;while(_0x361d40[_0x2e0fc1]){while((_0xe0f512=_0x51d97f[_0xe2fe('0x9')](_0x361d40[_0x2e0fc1]))!=-0x1){_0x39a31c=_0x361d40[_0x2e0fc1];_0x2168c8=_0x51d97f[_0xe2fe('0xa')](0x0,_0xe0f512);_0x51d97f=_0x51d97f[_0xe2fe('0xa')](_0xe0f512+_0x39a31c[_0xe2fe('0xb')]);var _0x42a6c0=_0x2168c8['split'](_0x20d031),_0xaf14b1=0x0,_0x5713de={},_0x2d4b18='',_0x580e98='',_0x3b2753=-0x1;while(_0x42a6c0[_0xaf14b1]){_0x3b2753=_0x42a6c0[_0xaf14b1][_0xe2fe('0x9')](':');if(_0x3b2753!=-0x1){_0x2d4b18=_0x42a6c0[_0xaf14b1]['slice'](0x0,_0x3b2753)[_0xe2fe('0xc')]();_0x580e98=_0x42a6c0[_0xaf14b1][_0xe2fe('0xd')](_0x3b2753+0x1)[_0xe2fe('0xc')]();if(_0x2d4b18[_0xe2fe('0xb')]>0x0){_0x5713de[_0x2d4b18]=_0x580e98;}}else{}_0xaf14b1++;}this['emit'](_0xe2fe('0xe'),_0x5713de);this[_0xe2fe('0x3')]=!![];}_0x2e0fc1++;}this['_localBuffer']=_0x51d97f;}else{while((_0x1a103d=_0x51d97f['indexOf'](_0x20d031))!=-0x1){_0x2168c8=_0x51d97f[_0xe2fe('0xa')](0x0,_0x1a103d);this['emit']('line',_0x2168c8);_0x51d97f=_0x51d97f[_0xe2fe('0xa')](_0x1a103d+_0x20d031['length']);}this[_0xe2fe('0x8')]=_0x51d97f;}_0x4d4ac4();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a685fef..3aa17ff 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 _0x54ef=['getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createCmContact','ShowCmHopper','ListId','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','then','error','message','result','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x54ef,0x112));var _0xf54e=function(_0x4a1f57,_0x347544){_0x4a1f57=_0x4a1f57-0x0;var _0x2f00e7=_0x54ef[_0x4a1f57];return _0x2f00e7;};'use strict';var _=require(_0xf54e('0x0'));var moment=require(_0xf54e('0x1'));var jayson=require(_0xf54e('0x2'));var client=jayson['client'][_0xf54e('0x3')]({'port':0x2329});function request(_0x18b7d6,_0x18b1cf){return new Promise(function(_0x42b9b2,_0x8b6bb6){return client[_0xf54e('0x4')](_0x18b7d6,_0x18b1cf)[_0xf54e('0x5')](function(_0x4c3022){if(_0x4c3022['error']){return _0x8b6bb6(_0x4c3022[_0xf54e('0x6')][_0xf54e('0x7')]);}else{return _0x42b9b2(_0x4c3022[_0xf54e('0x8')]);}})['catch'](function(_0x27e69b){return _0x8b6bb6(_0x27e69b);});});}exports['getSquareProjects']=function(){return request(_0xf54e('0x9'),{'options':{'raw':![],'attributes':['id',_0xf54e('0xa'),'production']}});};exports[_0xf54e('0xb')]=function(_0xefa1c0){return request(_0xf54e('0xc'),{'options':{'raw':![],'where':{'name':_0xefa1c0},'attributes':[_0xf54e('0xd')]}});};exports['getMailAccountById']=function(_0x558502){return request(_0xf54e('0xe'),{'options':{'raw':![],'where':{'id':_0x558502},'include':[{'model':_0xf54e('0xf'),'as':_0xf54e('0x10'),'include':[{'model':'CloudProvider','as':_0xf54e('0x11')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0xf54e('0x12')]=function(_0x2033e9){return request(_0xf54e('0xc'),{'options':{'where':{'id':_0x2033e9},'attributes':[_0xf54e('0xa')]}});};exports['getVoiceQueueById']=function(_0x331732){return request(_0xf54e('0x13'),{'options':{'where':{'id':_0x331732},'attributes':[_0xf54e('0xa')]}});};exports[_0xf54e('0x14')]=function(_0x56828e){return request(_0xf54e('0x15'),{'options':{'where':{'id':_0x56828e},'attributes':[_0xf54e('0xa')]}});};exports[_0xf54e('0x16')]=function(_0x5c5d00){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5c5d00},'attributes':[_0xf54e('0x17')]}});};exports[_0xf54e('0x18')]=function(_0x1c02e7){return request(_0xf54e('0x19'),{'options':{'where':{'id':_0x1c02e7},'attributes':[_0xf54e('0xa')]}});};exports[_0xf54e('0x1a')]=function(_0x2e27b6){return request(_0xf54e('0x1b'),{'options':{'where':{'phone':_0x2e27b6[_0xf54e('0x1c')]},'attributes':['id']}});};exports[_0xf54e('0x1d')]=function(_0x226c96){return request('ShowTrunk',{'options':{'where':{'id':_0x226c96},'attributes':['name']}});};exports[_0xf54e('0x1e')]=function(_0x59f338){return request(_0xf54e('0x1f'),{'options':{'where':{'id':_0x59f338},'attributes':[_0xf54e('0x20')]}});};exports[_0xf54e('0x21')]=function(_0x9903fc){return request(_0xf54e('0x22'),{'options':{'raw':![],'where':{'id':_0x9903fc},'include':[{'model':_0xf54e('0x23'),'as':_0xf54e('0x24')}]}});};exports[_0xf54e('0x25')]=function(_0x3c0169){return request(_0xf54e('0x26'),{'options':{'where':{'id':_0x3c0169},'attributes':['id',_0xf54e('0xa')]}});};exports['createSmsMessage']=function(_0x6f6d29){return request('CreateSmsMessage',{'body':_0x6f6d29});};exports[_0xf54e('0x27')]=function(_0x272df6){return request(_0xf54e('0x28'),{'body':_0x272df6});};exports[_0xf54e('0x29')]=function(_0x3805a7){return request(_0xf54e('0x2a'),{'body':_[_0xf54e('0x2b')](_0x3805a7,{'project_name':_0x3805a7[_0xf54e('0x2c')],'prev_project_name':_0x3805a7[_0xf54e('0x2d')]||'','is_subproject':_0x3805a7[_0xf54e('0x2d')]?!![]:![],'leaveAt':moment()[_0xf54e('0x2e')](_0xf54e('0x2f'))})});};exports[_0xf54e('0x30')]=function(_0x5390b8){return request(_0xf54e('0x31'),{'body':_0x5390b8});};exports['createSquareMessage']=function(_0x282c63){return request('CreateSquareMessage',{'body':_0x282c63});};exports[_0xf54e('0x32')]=function(_0x269f47){return request(_0xf54e('0x33'),{'options':{'raw':![],'where':{'phone':_0x269f47[_0xf54e('0x1c')],'ListId':_0x269f47[_0xf54e('0x34')]}}})[_0xf54e('0x5')](function(_0x36f985){if(_0x36f985){return _0x36f985;}return request('CreateCmContact',{'body':_0x269f47});});};exports['getPauseById']=function(_0x2f96b1){return request(_0xf54e('0x35'),{'options':{'where':{'id':_0x2f96b1},'attributes':[_0xf54e('0xa')]}});};exports[_0xf54e('0x36')]=function(_0xb2d4c4,_0x133cd7){return request(_0xf54e('0x37'),{'body':{'interface':_0x133cd7},'options':{'where':_0xb2d4c4}});};exports[_0xf54e('0x38')]=function(_0x3ae704,_0x12edc3,_0x5ea0cc){return request('PauseUser',{'body':{'type':_0x12edc3,'uniqueid':_0x5ea0cc},'options':{'where':_0x3ae704}});};exports[_0xf54e('0x39')]=function(_0x3169dd){return request('UnpauseUser',{'body':{},'options':{'where':_0x3169dd}});};exports[_0xf54e('0x3a')]=function(_0x82e313){return request(_0xf54e('0x3b'),{'body':{},'options':{'where':_0x82e313}});}; \ No newline at end of file +var _0x3fec=['CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','lodash','client','http','request','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','ShowSound','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','createSquareRecording'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var moment=require('moment');var jayson=require('jayson/promise');var client=jayson[_0xc3fe('0x1')][_0xc3fe('0x2')]({'port':0x2329});function request(_0x5adb4c,_0x3e2547){return new Promise(function(_0x4f85a4,_0x53a208){return client[_0xc3fe('0x3')](_0x5adb4c,_0x3e2547)['then'](function(_0x2157db){if(_0x2157db[_0xc3fe('0x4')]){return _0x53a208(_0x2157db[_0xc3fe('0x4')][_0xc3fe('0x5')]);}else{return _0x4f85a4(_0x2157db[_0xc3fe('0x6')]);}})[_0xc3fe('0x7')](function(_0x1e532e){return _0x53a208(_0x1e532e);});});}exports[_0xc3fe('0x8')]=function(){return request(_0xc3fe('0x9'),{'options':{'raw':![],'attributes':['id',_0xc3fe('0xa'),_0xc3fe('0xb')]}});};exports[_0xc3fe('0xc')]=function(_0x2852c9){return request(_0xc3fe('0xd'),{'options':{'raw':![],'where':{'name':_0x2852c9},'attributes':[_0xc3fe('0xb')]}});};exports[_0xc3fe('0xe')]=function(_0x5b166d){return request(_0xc3fe('0xf'),{'options':{'raw':![],'where':{'id':_0x5b166d},'include':[{'model':_0xc3fe('0x10'),'as':'Smtp','include':[{'model':_0xc3fe('0x11'),'as':_0xc3fe('0x11')}]}],'attributes':['id',_0xc3fe('0xa'),_0xc3fe('0x12')],'smtp':!![]}});};exports[_0xc3fe('0x13')]=function(_0x1b560f){return request(_0xc3fe('0xd'),{'options':{'where':{'id':_0x1b560f},'attributes':[_0xc3fe('0xa')]}});};exports[_0xc3fe('0x14')]=function(_0x432539){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x432539},'attributes':[_0xc3fe('0xa')]}});};exports['getVariableById']=function(_0x10091c){return request(_0xc3fe('0x15'),{'options':{'where':{'id':_0x10091c},'attributes':[_0xc3fe('0xa')]}});};exports[_0xc3fe('0x16')]=function(_0x17edb6){return request(_0xc3fe('0x17'),{'options':{'where':{'id':_0x17edb6},'attributes':[_0xc3fe('0x18')]}});};exports[_0xc3fe('0x19')]=function(_0x3405dc){return request(_0xc3fe('0x1a'),{'options':{'where':{'id':_0x3405dc},'attributes':[_0xc3fe('0xa')]}});};exports[_0xc3fe('0x1b')]=function(_0x423447){return request(_0xc3fe('0x1c'),{'options':{'where':{'phone':_0x423447[_0xc3fe('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x2ce44e){return request(_0xc3fe('0x1e'),{'options':{'where':{'id':_0x2ce44e},'attributes':[_0xc3fe('0xa')]}});};exports['getSoundById']=function(_0x1e3242){return request(_0xc3fe('0x1f'),{'options':{'where':{'id':_0x1e3242},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x3333ad){return request(_0xc3fe('0x20'),{'options':{'raw':![],'where':{'id':_0x3333ad},'include':[{'model':_0xc3fe('0x21'),'as':'Intervals'}]}});};exports[_0xc3fe('0x22')]=function(_0x15706a){return request(_0xc3fe('0x23'),{'options':{'where':{'id':_0x15706a},'attributes':['id',_0xc3fe('0xa')]}});};exports[_0xc3fe('0x24')]=function(_0x474195){return request(_0xc3fe('0x25'),{'body':_0x474195});};exports[_0xc3fe('0x26')]=function(_0x2c4727){return request(_0xc3fe('0x27'),{'body':_0x2c4727});};exports[_0xc3fe('0x28')]=function(_0x2999e7){return request('CreateSquareReport',{'body':_[_0xc3fe('0x29')](_0x2999e7,{'project_name':_0x2999e7[_0xc3fe('0x2a')],'prev_project_name':_0x2999e7[_0xc3fe('0x2b')]||'','is_subproject':_0x2999e7[_0xc3fe('0x2b')]?!![]:![],'leaveAt':moment()[_0xc3fe('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xc3fe('0x2d')]=function(_0x431594){return request(_0xc3fe('0x2e'),{'body':_0x431594});};exports[_0xc3fe('0x2f')]=function(_0x820b7f){return request(_0xc3fe('0x30'),{'body':_0x820b7f});};exports[_0xc3fe('0x31')]=function(_0x267b89){return request(_0xc3fe('0x32'),{'options':{'raw':![],'where':{'phone':_0x267b89[_0xc3fe('0x1d')],'ListId':_0x267b89[_0xc3fe('0x33')]}}})[_0xc3fe('0x34')](function(_0x18dbc0){if(_0x18dbc0){return _0x18dbc0;}return request(_0xc3fe('0x35'),{'body':_0x267b89});});};exports[_0xc3fe('0x36')]=function(_0x1339e7){return request(_0xc3fe('0x37'),{'options':{'where':{'id':_0x1339e7},'attributes':[_0xc3fe('0xa')]}});};exports['agentLogin']=function(_0x1e8a38,_0x19d353){return request(_0xc3fe('0x38'),{'body':{'interface':_0x19d353},'options':{'where':_0x1e8a38}});};exports[_0xc3fe('0x39')]=function(_0x11a44e,_0x293999,_0x3f4573){return request(_0xc3fe('0x3a'),{'body':{'type':_0x293999,'uniqueid':_0x3f4573},'options':{'where':_0x11a44e}});};exports[_0xc3fe('0x3b')]=function(_0x357db9){return request(_0xc3fe('0x3c'),{'body':{},'options':{'where':_0x357db9}});};exports['agentLogout']=function(_0x5b6151){return request('LogoutUser',{'body':{},'options':{'where':_0x5b6151}});}; \ 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 1b04a9d..3b8fd69 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 _0xbea5=['./lex','./polly'];(function(_0x57f775,_0x3a11dc){var _0x44d721=function(_0x5a55fa){while(--_0x5a55fa){_0x57f775['push'](_0x57f775['shift']());}};_0x44d721(++_0x3a11dc);}(_0xbea5,0x177));var _0x5bea=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xbea5[_0x258fb0];return _0x4d1afe;};var polly=require(_0x5bea('0x0'));var lex=require(_0x5bea('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x44e8=['./polly'];(function(_0x1c3c71,_0x34015a){var _0x1a759a=function(_0x3fa435){while(--_0x3fa435){_0x1c3c71['push'](_0x1c3c71['shift']());}};_0x1a759a(++_0x34015a);}(_0x44e8,0xd7));var _0x844e=function(_0x103e66,_0x249ed3){_0x103e66=_0x103e66-0x0;var _0x15d641=_0x44e8[_0x103e66];return _0x15d641;};var polly=require(_0x844e('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1c673af..ea65b42 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 _0x13f6=['./lib/api','exports'];(function(_0x5835ab,_0x57cdd7){var _0x343d8e=function(_0x53e139){while(--_0x53e139){_0x5835ab['push'](_0x5835ab['shift']());}};_0x343d8e(++_0x57cdd7);}(_0x13f6,0x124));var _0x613f=function(_0x548af6,_0x57dfde){_0x548af6=_0x548af6-0x0;var _0x120cf2=_0x13f6[_0x548af6];return _0x120cf2;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);}; \ No newline at end of file +var _0xe706=['exports','./lib/api'];(function(_0x37b112,_0x48bead){var _0x7425be=function(_0x2d5105){while(--_0x2d5105){_0x37b112['push'](_0x37b112['shift']());}};_0x7425be(++_0x48bead);}(_0xe706,0xa3));var _0x6e70=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xe706[_0x5da048];return _0x13dfc5;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ 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 837093a..2e91b87 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(_0x160c61,_0x183400){var _0x459829=function(_0x1bba37){while(--_0x1bba37){_0x160c61['push'](_0x160c61['shift']());}};_0x459829(++_0x183400);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x38ea85,_0x44112e){var _0x31b7dc=function(_0x8df24e){while(--_0x8df24e){_0x38ea85['push'](_0x38ea85['shift']());}};_0x31b7dc(++_0x44112e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 ecbab83..1aebc28 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 _0xdf76=['./lib/api','exports'];(function(_0x3c3705,_0xe26696){var _0x44a55d=function(_0x9a6ba1){while(--_0x9a6ba1){_0x3c3705['push'](_0x3c3705['shift']());}};_0x44a55d(++_0xe26696);}(_0xdf76,0x134));var _0x6df7=function(_0xbce261,_0x5bf87e){_0xbce261=_0xbce261-0x0;var _0x23848f=_0xdf76[_0xbce261];return _0x23848f;};'use strict';var polly=require(_0x6df7('0x0'));module[_0x6df7('0x1')]=function(_0x362caf,_0xe0c382,_0x2f5cf1,_0x4fd722,_0x142afc,_0x160280,_0x4bdfd4){return polly(_0x362caf,_0xe0c382,_0x2f5cf1,_0x4fd722,_0x142afc,_0x160280,_0x4bdfd4);}; \ No newline at end of file +var _0x2f28=['exports','./lib/api'];(function(_0x386cb0,_0x597bfe){var _0x3d8379=function(_0x12cc6b){while(--_0x12cc6b){_0x386cb0['push'](_0x386cb0['shift']());}};_0x3d8379(++_0x597bfe);}(_0x2f28,0x15f));var _0x82f2=function(_0x2c1c4a,_0x26b5b2){_0x2c1c4a=_0x2c1c4a-0x0;var _0x2b7391=_0x2f28[_0x2c1c4a];return _0x2b7391;};'use strict';var polly=require(_0x82f2('0x0'));module[_0x82f2('0x1')]=function(_0x3613db,_0x59938d,_0xd30ae5,_0x5b21d7,_0xc6cd80,_0x30629a,_0x4e4ae0){return polly(_0x3613db,_0x59938d,_0xd30ae5,_0x5b21d7,_0xc6cd80,_0x30629a,_0x4e4ae0);}; \ 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 4e822af..419ac48 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 _0x9d0b=['randomstring','aws-sdk','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d0b,0x73));var _0xb9d0=function(_0x2573ba,_0x15eb34){_0x2573ba=_0x2573ba-0x0;var _0x56b673=_0x9d0b[_0x2573ba];return _0x56b673;};'use strict';var fs=require('fs');var path=require(_0xb9d0('0x0'));var BPromise=require(_0xb9d0('0x1'));var rs=require(_0xb9d0('0x2'));var AWS=require(_0xb9d0('0x3'));function pollyResult(_0x599df7,_0x8cc42f,_0x27c5b4){return new BPromise(function(_0x51edd7,_0x41b7f2){_0x599df7['synthesizeSpeech'](_0x8cc42f,function(_0x585e07,_0x4f4cb8){if(_0x585e07){_0x41b7f2(_0x585e07);}else if(_0x4f4cb8){if(_0x4f4cb8[_0xb9d0('0x4')]instanceof Buffer){fs['writeFile'](_0x27c5b4,_0x4f4cb8[_0xb9d0('0x4')],function(_0x225cb4){if(_0x225cb4){_0x41b7f2(_0x225cb4);}else{_0x51edd7();}});}else{_0x41b7f2(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x41b7f2(new Error(_0xb9d0('0x5')));}});});}module[_0xb9d0('0x6')]=function(_0x376493,_0x4fb320,_0x2d0e04,_0x3a60d7,_0x407786,_0x492128,_0x530909){var _0x219cfa=new AWS[(_0xb9d0('0x7'))]({'accessKeyId':_0x376493,'secretAccessKey':_0x4fb320,'region':_0x2d0e04});var _0x2a9c7f={'Text':_0x407786,'TextType':_0x492128||'text','OutputFormat':_0xb9d0('0x8'),'VoiceId':_0x3a60d7};return pollyResult(_0x219cfa,_0x2a9c7f,_0x530909);}; \ No newline at end of file +var _0x1432=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1432,0x1be));var _0x2143=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1432[_0x2be8c2];return _0x97f531;};'use strict';var fs=require('fs');var path=require(_0x2143('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x2143('0x1'));function pollyResult(_0x43079b,_0x20dc83,_0x68a3b0){return new BPromise(function(_0x26b2a0,_0x42560a){_0x43079b[_0x2143('0x2')](_0x20dc83,function(_0x54e3d8,_0x48c050){if(_0x54e3d8){_0x42560a(_0x54e3d8);}else if(_0x48c050){if(_0x48c050[_0x2143('0x3')]instanceof Buffer){fs[_0x2143('0x4')](_0x68a3b0,_0x48c050['AudioStream'],function(_0x26eedb){if(_0x26eedb){_0x42560a(_0x26eedb);}else{_0x26b2a0();}});}else{_0x42560a(new Error(_0x2143('0x5')));}}else{_0x42560a(new Error(_0x2143('0x6')));}});});}module[_0x2143('0x7')]=function(_0xcaae24,_0x3712c6,_0x1d6103,_0x195083,_0x3d6fa8,_0x56f9de,_0x55c3b6){var _0x3703e3=new AWS['Polly']({'accessKeyId':_0xcaae24,'secretAccessKey':_0x3712c6,'region':_0x1d6103});var _0x1122f3={'Text':_0x3d6fa8,'TextType':_0x56f9de||_0x2143('0x8'),'OutputFormat':_0x2143('0x9'),'VoiceId':_0x195083};return pollyResult(_0x3703e3,_0x1122f3,_0x55c3b6);}; \ 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 aa08264..3defc7f 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x196dee,_0x5b37e2,_0x499c71,_0x199bbc){return asr(_0x196dee,_0x5b37e2,_0x499c71);}; \ No newline at end of file +var _0x0e75=['./lib/api','exports'];(function(_0x3bf40f,_0x429f3a){var _0x1377a3=function(_0x54bf68){while(--_0x54bf68){_0x3bf40f['push'](_0x3bf40f['shift']());}};_0x1377a3(++_0x429f3a);}(_0x0e75,0x140));var _0x50e7=function(_0x452901,_0x1e2e7d){_0x452901=_0x452901-0x0;var _0x5639c6=_0x0e75[_0x452901];return _0x5639c6;};'use strict';var asr=require(_0x50e7('0x0'));module[_0x50e7('0x1')]=function(_0x312c72,_0x571ae6,_0x4541bc,_0x2a2351){return asr(_0x312c72,_0x571ae6,_0x4541bc);}; \ 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 fae52ad..11104ed 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 _0x1ba2=['url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x539d03,_0x4b316c){var _0xe8112=function(_0x27db3b){while(--_0x27db3b){_0x539d03['push'](_0x539d03['shift']());}};_0xe8112(++_0x4b316c);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var url=require(_0x21ba('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x21ba('0x1');module['exports']=function(_0x31494a,_0x349a68,_0x46eb26){return new BPromise(function(_0xface0a,_0x3661dd){var _0x527ad5;if(typeof _0x31494a!==_0x21ba('0x2')||_0x31494a[_0x21ba('0x3')]===0x0){return _0x3661dd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x349a68!==_0x21ba('0x2')||_0x349a68['length']===0x0){return _0x3661dd(_0x21ba('0x4'));}if(typeof _0x46eb26!==_0x21ba('0x5')&&(typeof _0x46eb26!=='string'||_0x46eb26[_0x21ba('0x3')]===0x0)){return _0x3661dd('lang\x20should\x20be\x20a\x20string');}try{_0x527ad5=fs[_0x21ba('0x6')](_0x31494a)[_0x21ba('0x7')]('base64');}catch(_0x3063e9){return _0x3661dd(_0x3063e9);}return _0xface0a({'method':_0x21ba('0x8'),'uri':host+_0x21ba('0x9')+_0x349a68,'body':{'config':{'encoding':_0x21ba('0xa'),'sampleRateHertz':_0x21ba('0xb'),'languageCode':_0x46eb26},'audio':{'content':_0x527ad5}},'json':!![]});});}; \ No newline at end of file +var _0x544a=['undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x21b94c,_0xb98409){var _0x549792=function(_0x27de0){while(--_0x27de0){_0x21b94c['push'](_0x21b94c['shift']());}};_0x549792(++_0xb98409);}(_0x544a,0xbd));var _0xa544=function(_0x4d24ea,_0x21cd57){_0x4d24ea=_0x4d24ea-0x0;var _0x48bb37=_0x544a[_0x4d24ea];return _0x48bb37;};'use strict';var url=require(_0xa544('0x0'));var BPromise=require(_0xa544('0x1'));var fs=require('fs');var host=_0xa544('0x2');module['exports']=function(_0x544b38,_0x46d7b6,_0x5026f6){return new BPromise(function(_0x42b8f1,_0xdca212){var _0x556528;if(typeof _0x544b38!==_0xa544('0x3')||_0x544b38[_0xa544('0x4')]===0x0){return _0xdca212(_0xa544('0x5'));}if(typeof _0x46d7b6!==_0xa544('0x3')||_0x46d7b6[_0xa544('0x4')]===0x0){return _0xdca212('key\x20should\x20be\x20a\x20string');}if(typeof _0x5026f6!==_0xa544('0x6')&&(typeof _0x5026f6!=='string'||_0x5026f6[_0xa544('0x4')]===0x0)){return _0xdca212(_0xa544('0x7'));}try{_0x556528=fs['readFileSync'](_0x544b38)[_0xa544('0x8')](_0xa544('0x9'));}catch(_0x4766a8){return _0xdca212(_0x4766a8);}return _0x42b8f1({'method':_0xa544('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x46d7b6,'body':{'config':{'encoding':_0xa544('0xb'),'sampleRateHertz':_0xa544('0xc'),'languageCode':_0x5026f6},'audio':{'content':_0x556528}},'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 8681891..911c043 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 _0xa79f=['./asr','exports'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0xa79f,0x1c8));var _0xfa79=function(_0x4d0d1b,_0x96cc39){_0x4d0d1b=_0x4d0d1b-0x0;var _0x3d1c6a=_0xa79f[_0x4d0d1b];return _0x3d1c6a;};var asr=require(_0xfa79('0x0'));module[_0xfa79('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3656=['exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3656,0xda));var _0x6365=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3656[_0x4a9fb1];return _0x348672;};var asr=require('./asr');module[_0x6365('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 7aeee7d..63f941c 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 _0x5c6a=['SessionsClient','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','dirName','bluebird','http','https','md5','path','randomstring','sox','google-tts-api','url','./aws','./sestek','./tilde','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','base64','then','chmodSync','split','toString','googleCloudTTS','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','from','777','info','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x5c6a,0x197));var _0xa5c6=function(_0x43c1c2,_0x3ec409){_0x43c1c2=_0x43c1c2-0x0;var _0x233420=_0x5c6a[_0x43c1c2];return _0x233420;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xa5c6('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xa5c6('0x1'));var https=require(_0xa5c6('0x2'));var md5=require(_0xa5c6('0x3'));var path=require(_0xa5c6('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xa5c6('0x5'));var sox=require(_0xa5c6('0x6'));var tts=require(_0xa5c6('0x7'));var urlParse=require(_0xa5c6('0x8'))['parse'];var util=require('util');var aws=require(_0xa5c6('0x9'));var google=require('./google');var sestek=require(_0xa5c6('0xa'));var tilde=require(_0xa5c6('0xb'));var logger=require('../../../config/logger')(_0xa5c6('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x41d957,_0x484d8a){return new BPromise(function(_0x46854f,_0x5d3841){var _0x2b4e11=urlParse(_0x41d957);var _0x2f1ef8=_0x2b4e11[_0xa5c6('0xd')]===_0xa5c6('0xe')?https:http;var _0x565bd7={'host':_0x2b4e11[_0xa5c6('0xf')],'path':_0x2b4e11[_0xa5c6('0x4')],'headers':{'user-agent':_0xa5c6('0x10')}};_0x2f1ef8[_0xa5c6('0x11')](_0x565bd7,function(_0x578f33){if(_0x578f33[_0xa5c6('0x12')]!==0xc8){logger[_0xa5c6('0x13')](_0xa5c6('0x14')+_0x41d957+'\x20failed,\x20status\x20code\x20=\x20'+_0x578f33[_0xa5c6('0x12')]+'\x20('+_0x578f33['statusMessage']+')');_0x5d3841(new Error('request\x20to\x20'+_0x41d957+_0xa5c6('0x15')+_0x578f33[_0xa5c6('0x12')]+'\x20('+_0x578f33['statusMessage']+')'));return;}var _0x24995d=fs[_0xa5c6('0x16')](_0x484d8a);_0x24995d['on'](_0xa5c6('0x17'),function(){logger['info']('finish\x20download\x20file');_0x24995d['close'](_0x46854f);});_0x24995d['on'](_0xa5c6('0x13'),function(_0x7b9a90){fs[_0xa5c6('0x18')](_0x484d8a);logger[_0xa5c6('0x13')]('download\x20error',_0x7b9a90);_0x5d3841(_0x7b9a90);});_0x578f33[_0xa5c6('0x19')](_0x24995d);})['on'](_0xa5c6('0x13'),function(_0x4ba05d){logger[_0xa5c6('0x13')](_0x4ba05d);_0x5d3841(_0x4ba05d);})[_0xa5c6('0x1a')]();});}function uploadFile(_0x5939b0){return new BPromise(function(_0x1e56b1,_0x415d60){var _0xe73a4c=urlParse(_0x5939b0);var _0x44b98e=_0xe73a4c[_0xa5c6('0xd')]===_0xa5c6('0xe')?https:http;var _0x5971b9={'host':_0xe73a4c[_0xa5c6('0xf')],'path':_0xe73a4c[_0xa5c6('0x4')],'headers':{'user-agent':_0xa5c6('0x10')}};_0x44b98e[_0xa5c6('0x11')](_0x5971b9,function(_0x5c90b6){if(_0x5c90b6[_0xa5c6('0x12')]!==0xc8){_0x415d60(new Error(_0xa5c6('0x14')+_0x5939b0+_0xa5c6('0x15')+_0x5c90b6[_0xa5c6('0x12')]+'\x20('+_0x5c90b6['statusMessage']+')'));return;}var _0x48cf9e='';_0x5c90b6['on'](_0xa5c6('0x1b'),function(_0x14cd0c){_0x48cf9e+=_0x14cd0c;});_0x5c90b6['on'](_0xa5c6('0x1a'),function(){_0x1e56b1(_0x48cf9e);});})['on'](_0xa5c6('0x13'),function(_0x42554a){_0x415d60(_0x42554a);})['end']();});}function convertFile(_0x4b717b,_0x305e35){return new BPromise(function(_0x357bab,_0x15502f){var _0x2993f6=sox[_0xa5c6('0x1c')](_0x4b717b,_0x305e35,{'sampleRate':0x1f40,'format':_0xa5c6('0x1d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2993f6['on'](_0xa5c6('0x13'),function(_0x146087){logger[_0xa5c6('0x13')](_0xa5c6('0x1e'),_0x146087);_0x15502f(_0x146087);});_0x2993f6['on'](_0xa5c6('0x1a'),function(){logger['info'](_0xa5c6('0x1f'));_0x357bab();});_0x2993f6[_0xa5c6('0x20')]();});}function base64Decode(_0x5ec0ca,_0x56092e){var _0x189c4d=path['resolve'](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x23'));fs['writeFileSync'](_0x189c4d,_0x5ec0ca,_0xa5c6('0x24'));return convertFile(_0x189c4d,_0x56092e)[_0xa5c6('0x25')](function(){try{fs[_0xa5c6('0x18')](_0x189c4d);fs[_0xa5c6('0x26')](_0x56092e,'777');}catch(_0x42927d){logger[_0xa5c6('0x13')](_0x42927d);}return _0x56092e[_0xa5c6('0x27')]('.')[0x0];});}function base64Encode(_0x211f61){var _0x20ded6=fs['readFileSync'](_0x211f61);return new Buffer(_0x20ded6)[_0xa5c6('0x28')](_0xa5c6('0x24'));}exports[_0xa5c6('0x29')]=function(_0x33c02a,_0x4384eb,_0xd997d1,_0x37292d,_0x104b35,_0x367a53){var _0x25fe76,_0x374041;var _0xd661c6='https://texttospeech.googleapis.com/v1/';var _0x2aa6dc=_0xa5c6('0x2a')+_0x33c02a;var _0x1dbd7f={};if(_0x4384eb==='ssml'){_0x1dbd7f['input']={'ssml':_0xd997d1};}else{_0x1dbd7f[_0xa5c6('0x2b')]={'text':_0xd997d1};};_0x1dbd7f[_0xa5c6('0x2c')]={'languageCode':_0x37292d,'ssmlGender':_0x104b35};_0x1dbd7f[_0xa5c6('0x2d')]={'audioEncoding':_0xa5c6('0x2e'),'sampleRateHertz':0x1f40};var _0x434e4c={'url':_0xd661c6+_0xa5c6('0x2f')+_0x2aa6dc,'method':_0xa5c6('0x30'),'json':!![],'body':_0x1dbd7f};return rp(_0x434e4c)['then'](function(_0x5124d4){return new BPromise(function(_0x39bb82,_0x383488){_0x25fe76=path[_0xa5c6('0x31')](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x32'));var _0x44fa27=Buffer[_0xa5c6('0x33')](_0x5124d4['audioContent'],_0xa5c6('0x24'));return fs['writeFile'](_0x25fe76,_0x44fa27,function(_0x4913e7){_0x383488(_0x4913e7);},function(_0x150733){fs[_0xa5c6('0x26')](_0x25fe76,_0xa5c6('0x34'));_0x39bb82(_0x150733);});});})[_0xa5c6('0x25')](function(_0x37bd1d){_0x374041=path[_0xa5c6('0x31')](__dirname,_0xa5c6('0x21'),rs['generate'](0x4)+_0xa5c6('0x23'));return convertFile(_0x25fe76,_0x374041);})[_0xa5c6('0x25')](function(){try{fs[_0xa5c6('0x18')](_0x25fe76);fs[_0xa5c6('0x26')](_0x374041,'777');}catch(_0x53e50f){logger[_0xa5c6('0x13')](_0x53e50f);}logger[_0xa5c6('0x35')](_0xa5c6('0x36'),_0x374041['split']('.')[0x0]);return _0x374041['split']('.')[0x0];});};exports[_0xa5c6('0x37')]=function(_0x496dce,_0x1f1448){var _0x5cae02='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0xe27c18,_0x89a707;var _0x3d2b1c;var _0x307606={'encoding':_0xa5c6('0x38'),'method':_0xa5c6('0x30'),'timeout':0x2710,'url':_0x5cae02,'headers':{'Content-Type':_0xa5c6('0x39')},'body':'f.req='+encodeURIComponent(JSON[_0xa5c6('0x3a')]([[[_0xa5c6('0x3b'),JSON[_0xa5c6('0x3a')]([_0x496dce,_0x1f1448||'en',![],'null']),null,_0xa5c6('0x3c')]]]))};return rp(_0x307606)[_0xa5c6('0x25')](function(_0x3f11df){try{_0x3d2b1c=eval(_0x3f11df[_0xa5c6('0x3d')](0x5))[0x0][0x2];}catch(_0x527af4){throw new Error(_0xa5c6('0x3e')+_0x3f11df[_0xa5c6('0x1b')]);}if(!_0x3d2b1c){if(_0x496dce[_0xa5c6('0x3f')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xa5c6('0x40')+_0x1f1448+_0xa5c6('0x41'));}}try{_0x3d2b1c=eval(_0x3d2b1c)[0x0];}catch(_0x371f56){throw new Error(_0xa5c6('0x3e')+res[_0xa5c6('0x1b')]);}const _0x21a342=_0x3d2b1c;_0xe27c18=path['resolve'](__dirname,'tmp',rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x32'));fs[_0xa5c6('0x42')](_0xe27c18,_0x3d2b1c,{'encoding':_0xa5c6('0x24')});_0x89a707=path[_0xa5c6('0x31')](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+'.wav');return convertFile(_0xe27c18,_0x89a707);})[_0xa5c6('0x25')](function(){try{fs[_0xa5c6('0x18')](_0xe27c18);fs[_0xa5c6('0x26')](_0x89a707,'777');}catch(_0x1def9b){logger[_0xa5c6('0x13')](_0x1def9b);}logger[_0xa5c6('0x35')](_0xa5c6('0x43'),_0x89a707[_0xa5c6('0x27')]('.')[0x0]);return _0x89a707[_0xa5c6('0x27')]('.')[0x0];});};exports['googleASR']=function(_0x2b67b7,_0x12cd8c,_0x3c36ad){return google[_0xa5c6('0x44')](_0x2b67b7,_0x12cd8c,_0x3c36ad)[_0xa5c6('0x25')](function(_0x4ca5aa){logger[_0xa5c6('0x35')](_0x4ca5aa[_0xa5c6('0x45')]);return rp(_0x4ca5aa);})[_0xa5c6('0x25')](function(_0x5478f4){var _0x33a639='';var _0x40d816=0x0;try{fs[_0xa5c6('0x18')](_0x2b67b7);}catch(_0x23bbdf){logger[_0xa5c6('0x13')](_0x23bbdf);}if(_0x5478f4&&_0x5478f4[_0xa5c6('0x46')]){_0x33a639=_0x5478f4[_0xa5c6('0x46')]['map'](function(_0x281b55){return _0x281b55&&_0x281b55[_0xa5c6('0x47')][0x0]&&_0x281b55['alternatives'][0x0][_0xa5c6('0x48')]?_0x281b55['alternatives'][0x0][_0xa5c6('0x48')]:'';})[_0xa5c6('0x49')]('\x0a');_0x40d816=_0x5478f4[_0xa5c6('0x46')]['map'](function(_0x332b56){return _0x332b56&&_0x332b56[_0xa5c6('0x47')][0x0]&&_0x332b56[_0xa5c6('0x47')][0x0][_0xa5c6('0x4a')]?_0x332b56['alternatives'][0x0][_0xa5c6('0x4a')]:0x0;})['join']('\x0a');}logger[_0xa5c6('0x35')]('googleASR\x20transcription',_0x33a639);logger[_0xa5c6('0x35')](_0xa5c6('0x4b'),_0x40d816);return{'transcript':_0x33a639,'confidence':_0x40d816};})['catch'](function(_0x4b14d2){logger['error'](_0xa5c6('0x4c'),_0x4b14d2[_0xa5c6('0x12')],_0x4b14d2[_0xa5c6('0x4d')],_0x4b14d2[_0xa5c6('0x4e')]);});};exports[_0xa5c6('0x4f')]=function(_0x3076f4,_0x361d0a,_0xa892ed,_0xc82bb9){var _0x25083c=apiai(_0x361d0a,{'language':_0xc82bb9||'en'});return _0x25083c[_0xa5c6('0x50')](_0xa892ed,{'sessionId':md5(_0x3076f4)})['then'](function(_0xcf9932){logger[_0xa5c6('0x35')](JSON[_0xa5c6('0x3a')](_0xcf9932));return{'source':_0xcf9932[_0xa5c6('0x51')]['source'],'resolvedQuery':_0xcf9932[_0xa5c6('0x51')]['resolvedQuery'],'action':_0xcf9932[_0xa5c6('0x51')][_0xa5c6('0x52')],'actionIncomplete':_0xcf9932[_0xa5c6('0x51')]['actionIncomplete'],'speech':_0xcf9932['result'][_0xa5c6('0x53')][_0xa5c6('0x54')],'score':_0xcf9932[_0xa5c6('0x51')][_0xa5c6('0x55')],'statusCode':_0xcf9932[_0xa5c6('0x56')][_0xa5c6('0x57')],'endConversation':_0xcf9932[_0xa5c6('0x51')][_0xa5c6('0x58')][_0xa5c6('0x59')]||![],'isFallbackIntent':_0xcf9932[_0xa5c6('0x51')][_0xa5c6('0x58')][_0xa5c6('0x5a')]};});};exports[_0xa5c6('0x5b')]=function(_0x2f6210,_0x34e260,_0x7cb48b,_0x5db6f2,_0x395381,_0x34f3dd){var _0x183d39=_0x5db6f2[_0xa5c6('0x5c')](/\\n/g,'\x0a');var _0x43c156={'credentials':{'private_key':_0x183d39,'client_email':_0x7cb48b}};var _0x5ea6d5=new dialogflow[(_0xa5c6('0x5d'))](_0x43c156);var _0x343ec1=_0x5ea6d5['sessionPath'](_0x34e260,md5(_0x2f6210));var _0x488b0f={'session':_0x343ec1,'queryInput':{'text':{'text':_0x395381,'languageCode':_0x34f3dd}}};return _0x5ea6d5['detectIntent'](_0x488b0f)[_0xa5c6('0x25')](function(_0x3e17e3){if(_0x3e17e3&&_0x3e17e3['length']){logger[_0xa5c6('0x35')](_0xa5c6('0x5e'),JSON['stringify'](_0x3e17e3));var _0x455295=_0x3e17e3[0x0];if(_0x455295){var _0x476956={'action':_0x455295['queryResult'][_0xa5c6('0x52')],'allRequiredParamsPresent':_0x455295['queryResult'][_0xa5c6('0x5f')],'endConversation':_0x455295[_0xa5c6('0x60')][_0xa5c6('0x61')]&&_0x455295[_0xa5c6('0x60')]['diagnosticInfo']['fields']?_0x455295[_0xa5c6('0x60')][_0xa5c6('0x61')][_0xa5c6('0x62')][_0xa5c6('0x63')]['boolValue']:![],'fulfillmentText':_0x455295[_0xa5c6('0x60')][_0xa5c6('0x64')],'intentName':_0x455295[_0xa5c6('0x60')][_0xa5c6('0x65')][_0xa5c6('0x4d')],'intentDisplayName':_0x455295[_0xa5c6('0x60')]['intent'][_0xa5c6('0x66')],'isFallbackIntent':_0x455295[_0xa5c6('0x60')]['intent'][_0xa5c6('0x67')],'languageCode':_0x455295[_0xa5c6('0x60')]['languageCode'],'queryText':_0x455295[_0xa5c6('0x60')]['queryText'],'responseId':_0x455295[_0xa5c6('0x68')],'score':_0x455295[_0xa5c6('0x60')][_0xa5c6('0x69')],'speech':_0x455295['queryResult'][_0xa5c6('0x64')],'providerResponse':JSON[_0xa5c6('0x3a')](_0x3e17e3)};return _0x476956;}}});};exports[_0xa5c6('0x6a')]=function(_0x21ee1c,_0x26315f,_0x21ca88,_0x473f65){return tilde[_0xa5c6('0x44')](_0x21ee1c,_0x26315f,_0x21ca88,_0x473f65)[_0xa5c6('0x25')](function(_0x36c2b6){try{fs[_0xa5c6('0x18')](_0x21ee1c);}catch(_0xac8b92){logger[_0xa5c6('0x13')](_0xac8b92);}logger[_0xa5c6('0x35')](_0xa5c6('0x6b'),_0x36c2b6[_0xa5c6('0x48')]);logger[_0xa5c6('0x35')](_0xa5c6('0x6c'),_0x36c2b6['confidence']);return _0x36c2b6;});};exports[_0xa5c6('0x6d')]=function(_0x36fce3,_0xb6ed98,_0x54d1ea,_0x23566e,_0x398fdc,_0x9fafa2){var _0xeb19f=path[_0xa5c6('0x31')](__dirname,'tmp',rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x32'));var _0x2b81b6;return aws['polly'](_0x36fce3,_0xb6ed98,_0x54d1ea,_0x23566e,_0x398fdc,_0x9fafa2,_0xeb19f)[_0xa5c6('0x25')](function(){_0x2b81b6=path[_0xa5c6('0x31')](__dirname,'tmp',rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x23'));return convertFile(_0xeb19f,_0x2b81b6);})[_0xa5c6('0x25')](function(){try{fs['unlink'](_0xeb19f);fs['chmodSync'](_0x2b81b6,_0xa5c6('0x34'));}catch(_0x1bf74c){logger[_0xa5c6('0x13')](_0x1bf74c);}return _0x2b81b6['split']('.')[0x0];});};exports[_0xa5c6('0x6e')]=function(_0x218a84,_0x2f0d92,_0xb9d3a4,_0x5988eb,_0x4eccc4,_0x1911cd){return aws[_0xa5c6('0x6f')](_0x218a84,_0x2f0d92,_0xb9d3a4,_0x5988eb,_0x4eccc4,_0x1911cd)[_0xa5c6('0x25')](function(_0xbd55eb){logger[_0xa5c6('0x35')](JSON[_0xa5c6('0x3a')](_0xbd55eb));return _0xbd55eb;});};exports['ispeechTTS']=function(_0x1ad6e8,_0x4b1988,_0x52d8bc,_0x28e5ff){var _0x1654ad=util[_0xa5c6('0x70')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1ad6e8,encodeURIComponent(_0x4b1988),_0x52d8bc,_0x28e5ff);var _0x3df0be=path[_0xa5c6('0x31')](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x32'));var _0x4183ef;return downloadFile(_0x1654ad,_0x3df0be)[_0xa5c6('0x25')](function(){_0x4183ef=path['resolve'](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x23'));return convertFile(_0x3df0be,_0x4183ef);})['then'](function(){try{fs[_0xa5c6('0x18')](_0x3df0be);fs[_0xa5c6('0x26')](_0x4183ef,_0xa5c6('0x34'));}catch(_0xe786ec){logger['error'](_0xe786ec);}return _0x4183ef[_0xa5c6('0x27')]('.')[0x0];});};exports['ispeechASR']=function(_0x31dd7e,_0x21df20,_0x5320f0,_0x575a64){var _0x3bf93d=util['format'](_0xa5c6('0x71'),ISPEECH_API,_0x21df20,_0x5320f0,base64Encode(_0x31dd7e),_0x575a64?util[_0xa5c6('0x70')](_0xa5c6('0x72'),encodeURIComponent(_0x575a64)):_0xa5c6('0x73'));return uploadFile(_0x3bf93d)['then'](function(_0x430249){return querystring[_0xa5c6('0x74')](_0x430249);});};exports[_0xa5c6('0x75')]=function(_0x3c7ff5,_0x4c32b5){return sestek[_0xa5c6('0x76')](_0x3c7ff5,_0x4c32b5)[_0xa5c6('0x25')](function(_0x4446dc){logger[_0xa5c6('0x35')](JSON['stringify'](_0x4446dc));var _0x12d4ec={'speech':_0x4446dc[_0xa5c6('0x77')],'action':_0x4446dc[_0xa5c6('0x78')]?_0x4446dc[_0xa5c6('0x78')][_0xa5c6('0x79')]:undefined,'actiondata':_0x4446dc[_0xa5c6('0x78')]?_0x4446dc[_0xa5c6('0x78')]['CustomActionData']:undefined};if(_0x4446dc[_0xa5c6('0x78')]&&_0x4446dc[_0xa5c6('0x78')][_0xa5c6('0x7a')]){return base64Decode(_0x4446dc[_0xa5c6('0x78')]['AudioFromTts'][_0xa5c6('0x7b')],path[_0xa5c6('0x31')](__dirname,_0xa5c6('0x21'),rs[_0xa5c6('0x22')](0x4)+_0xa5c6('0x23')))[_0xa5c6('0x25')](function(_0x4fac51){_0x12d4ec['audiofile']=_0x4fac51;return _0x12d4ec;});}return _0x12d4ec;});};exports[_0xa5c6('0x7c')]=function(){return __dirname;}; \ No newline at end of file +var _0xbc3e=['result','source','resolvedQuery','action','fulfillment','speech','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','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','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','util','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','\x20failed,\x20status\x20code\x20=\x20','data','error\x20convert','finish\x20to\x20convert','start','tmp','generate','writeFileSync','then','unlink','chmodSync','777','split','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','POST','.mp3','audioContent','resolve','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow'];(function(_0x40c7b5,_0x50720d){var _0x2fa6bd=function(_0xd067f1){while(--_0xd067f1){_0x40c7b5['push'](_0x40c7b5['shift']());}};_0x2fa6bd(++_0x50720d);}(_0xbc3e,0x1c1));var _0xebc3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbc3e[_0x53ccf2];return _0x5a2964;};'use strict';var apiai=require(_0xebc3('0x0'));var BPromise=require(_0xebc3('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xebc3('0x2'));var https=require(_0xebc3('0x3'));var md5=require(_0xebc3('0x4'));var path=require(_0xebc3('0x5'));var querystring=require(_0xebc3('0x6'));var rp=require('request-promise');var rs=require(_0xebc3('0x7'));var sox=require(_0xebc3('0x8'));var tts=require(_0xebc3('0x9'));var urlParse=require(_0xebc3('0xa'))['parse'];var util=require(_0xebc3('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0xebc3('0xc'));var tilde=require('./tilde');var logger=require(_0xebc3('0xd'))(_0xebc3('0xe'));var ISPEECH_API=_0xebc3('0xf');function downloadFile(_0x322f37,_0x5ce2c8){return new BPromise(function(_0x300182,_0x2b7f14){var _0x556963=urlParse(_0x322f37);var _0x39bb42=_0x556963[_0xebc3('0x10')]===_0xebc3('0x11')?https:http;var _0x13b565={'host':_0x556963['host'],'path':_0x556963['path'],'headers':{'user-agent':_0xebc3('0x12')}};_0x39bb42[_0xebc3('0x13')](_0x13b565,function(_0x55b4fb){if(_0x55b4fb[_0xebc3('0x14')]!==0xc8){logger[_0xebc3('0x15')](_0xebc3('0x16')+_0x322f37+'\x20failed,\x20status\x20code\x20=\x20'+_0x55b4fb[_0xebc3('0x14')]+'\x20('+_0x55b4fb[_0xebc3('0x17')]+')');_0x2b7f14(new Error(_0xebc3('0x16')+_0x322f37+'\x20failed,\x20status\x20code\x20=\x20'+_0x55b4fb[_0xebc3('0x14')]+'\x20('+_0x55b4fb[_0xebc3('0x17')]+')'));return;}var _0x559f07=fs[_0xebc3('0x18')](_0x5ce2c8);_0x559f07['on'](_0xebc3('0x19'),function(){logger[_0xebc3('0x1a')](_0xebc3('0x1b'));_0x559f07[_0xebc3('0x1c')](_0x300182);});_0x559f07['on'](_0xebc3('0x15'),function(_0x29a4dd){fs['unlink'](_0x5ce2c8);logger[_0xebc3('0x15')](_0xebc3('0x1d'),_0x29a4dd);_0x2b7f14(_0x29a4dd);});_0x55b4fb[_0xebc3('0x1e')](_0x559f07);})['on'](_0xebc3('0x15'),function(_0x3d95bc){logger[_0xebc3('0x15')](_0x3d95bc);_0x2b7f14(_0x3d95bc);})[_0xebc3('0x1f')]();});}function uploadFile(_0x5b2de3){return new BPromise(function(_0x47dd8c,_0x1419d6){var _0xa6f74c=urlParse(_0x5b2de3);var _0xf80eac=_0xa6f74c['protocol']===_0xebc3('0x11')?https:http;var _0x39e5c7={'host':_0xa6f74c['host'],'path':_0xa6f74c[_0xebc3('0x5')],'headers':{'user-agent':_0xebc3('0x12')}};_0xf80eac['get'](_0x39e5c7,function(_0x2ca054){if(_0x2ca054['statusCode']!==0xc8){_0x1419d6(new Error('request\x20to\x20'+_0x5b2de3+_0xebc3('0x20')+_0x2ca054[_0xebc3('0x14')]+'\x20('+_0x2ca054[_0xebc3('0x17')]+')'));return;}var _0x309722='';_0x2ca054['on'](_0xebc3('0x21'),function(_0x4d07a3){_0x309722+=_0x4d07a3;});_0x2ca054['on']('end',function(){_0x47dd8c(_0x309722);});})['on'](_0xebc3('0x15'),function(_0xa2e894){_0x1419d6(_0xa2e894);})[_0xebc3('0x1f')]();});}function convertFile(_0x316bc8,_0x14c3a4){return new BPromise(function(_0x5e527f,_0x294a88){var _0x2b01e6=sox['transcode'](_0x316bc8,_0x14c3a4,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b01e6['on'](_0xebc3('0x15'),function(_0x42c076){logger[_0xebc3('0x15')](_0xebc3('0x22'),_0x42c076);_0x294a88(_0x42c076);});_0x2b01e6['on'](_0xebc3('0x1f'),function(){logger['info'](_0xebc3('0x23'));_0x5e527f();});_0x2b01e6[_0xebc3('0x24')]();});}function base64Decode(_0x1876fc,_0x17ca58){var _0xec78e1=path['resolve'](__dirname,_0xebc3('0x25'),rs[_0xebc3('0x26')](0x4)+'.wav');fs[_0xebc3('0x27')](_0xec78e1,_0x1876fc,'base64');return convertFile(_0xec78e1,_0x17ca58)[_0xebc3('0x28')](function(){try{fs[_0xebc3('0x29')](_0xec78e1);fs[_0xebc3('0x2a')](_0x17ca58,_0xebc3('0x2b'));}catch(_0x402ff4){logger['error'](_0x402ff4);}return _0x17ca58[_0xebc3('0x2c')]('.')[0x0];});}function base64Encode(_0x5ea3ea){var _0x2f6a8d=fs['readFileSync'](_0x5ea3ea);return new Buffer(_0x2f6a8d)[_0xebc3('0x2d')](_0xebc3('0x2e'));}exports[_0xebc3('0x2f')]=function(_0x16efdc,_0x505881,_0x35279f,_0x4e9d4e,_0xf080b7,_0x7a02c1){var _0x46e14d,_0x4f44e5;var _0x101f85=_0xebc3('0x30');var _0x4cabe2=_0xebc3('0x31')+_0x16efdc;var _0xbae5c6={};if(_0x505881===_0xebc3('0x32')){_0xbae5c6[_0xebc3('0x33')]={'ssml':_0x35279f};}else{_0xbae5c6['input']={'text':_0x35279f};};_0xbae5c6['voice']={'languageCode':_0x4e9d4e,'ssmlGender':_0xf080b7};_0xbae5c6['audioConfig']={'audioEncoding':_0xebc3('0x34'),'sampleRateHertz':0x1f40};var _0x492e8f={'url':_0x101f85+_0xebc3('0x35')+_0x4cabe2,'method':_0xebc3('0x36'),'json':!![],'body':_0xbae5c6};return rp(_0x492e8f)[_0xebc3('0x28')](function(_0x422c89){return new BPromise(function(_0x4e79dc,_0x5d17b0){_0x46e14d=path['resolve'](__dirname,_0xebc3('0x25'),rs['generate'](0x4)+_0xebc3('0x37'));var _0x26e247=Buffer['from'](_0x422c89[_0xebc3('0x38')],'base64');return fs['writeFile'](_0x46e14d,_0x26e247,function(_0x3be531){_0x5d17b0(_0x3be531);},function(_0x59b63a){fs['chmodSync'](_0x46e14d,_0xebc3('0x2b'));_0x4e79dc(_0x59b63a);});});})[_0xebc3('0x28')](function(_0x11b34c){_0x4f44e5=path[_0xebc3('0x39')](__dirname,_0xebc3('0x25'),rs[_0xebc3('0x26')](0x4)+_0xebc3('0x3a'));return convertFile(_0x46e14d,_0x4f44e5);})[_0xebc3('0x28')](function(){try{fs['unlink'](_0x46e14d);fs[_0xebc3('0x2a')](_0x4f44e5,'777');}catch(_0x8e353e){logger['error'](_0x8e353e);}logger[_0xebc3('0x1a')](_0xebc3('0x3b'),_0x4f44e5[_0xebc3('0x2c')]('.')[0x0]);return _0x4f44e5[_0xebc3('0x2c')]('.')[0x0];});};exports[_0xebc3('0x3c')]=function(_0x2aaea5,_0x34cade){var _0x2496d0=_0xebc3('0x3d');var _0x183051,_0x8d70e1;var _0x4e8a05;var _0x8e7f2a={'encoding':_0xebc3('0x3e'),'method':'POST','timeout':0x2710,'url':_0x2496d0,'headers':{'Content-Type':_0xebc3('0x3f')},'body':_0xebc3('0x40')+encodeURIComponent(JSON['stringify']([[[_0xebc3('0x41'),JSON[_0xebc3('0x42')]([_0x2aaea5,_0x34cade||'en',![],_0xebc3('0x43')]),null,_0xebc3('0x44')]]]))};return rp(_0x8e7f2a)[_0xebc3('0x28')](function(_0x3755fa){try{_0x4e8a05=eval(_0x3755fa['slice'](0x5))[0x0][0x2];}catch(_0x39c0bb){throw new Error(_0xebc3('0x45')+_0x3755fa[_0xebc3('0x21')]);}if(!_0x4e8a05){if(_0x2aaea5[_0xebc3('0x46')]>0xc8){throw new Error(_0xebc3('0x47'));}else{throw new Error('lang\x20\x22'+_0x34cade+_0xebc3('0x48'));}}try{_0x4e8a05=eval(_0x4e8a05)[0x0];}catch(_0x490ac6){throw new Error(_0xebc3('0x45')+res[_0xebc3('0x21')]);}const _0x3c0b8f=_0x4e8a05;_0x183051=path[_0xebc3('0x39')](__dirname,_0xebc3('0x25'),rs[_0xebc3('0x26')](0x4)+_0xebc3('0x37'));fs[_0xebc3('0x27')](_0x183051,_0x4e8a05,{'encoding':_0xebc3('0x2e')});_0x8d70e1=path[_0xebc3('0x39')](__dirname,_0xebc3('0x25'),rs[_0xebc3('0x26')](0x4)+_0xebc3('0x3a'));return convertFile(_0x183051,_0x8d70e1);})[_0xebc3('0x28')](function(){try{fs[_0xebc3('0x29')](_0x183051);fs[_0xebc3('0x2a')](_0x8d70e1,'777');}catch(_0x4b5809){logger[_0xebc3('0x15')](_0x4b5809);}logger[_0xebc3('0x1a')]('goggleTTS\x20path',_0x8d70e1[_0xebc3('0x2c')]('.')[0x0]);return _0x8d70e1[_0xebc3('0x2c')]('.')[0x0];});};exports[_0xebc3('0x49')]=function(_0x5955b1,_0x353951,_0x493da5){return google[_0xebc3('0x4a')](_0x5955b1,_0x353951,_0x493da5)['then'](function(_0x1e4633){logger['info'](_0x1e4633[_0xebc3('0x4b')]);return rp(_0x1e4633);})[_0xebc3('0x28')](function(_0x3ffa04){var _0x3f61c5='';var _0x2ebabc=0x0;try{fs['unlink'](_0x5955b1);}catch(_0x1dc6ed){logger['error'](_0x1dc6ed);}if(_0x3ffa04&&_0x3ffa04['results']){_0x3f61c5=_0x3ffa04[_0xebc3('0x4c')]['map'](function(_0x4d1177){return _0x4d1177&&_0x4d1177[_0xebc3('0x4d')][0x0]&&_0x4d1177['alternatives'][0x0][_0xebc3('0x4e')]?_0x4d1177[_0xebc3('0x4d')][0x0][_0xebc3('0x4e')]:'';})[_0xebc3('0x4f')]('\x0a');_0x2ebabc=_0x3ffa04[_0xebc3('0x4c')]['map'](function(_0x6a2e58){return _0x6a2e58&&_0x6a2e58[_0xebc3('0x4d')][0x0]&&_0x6a2e58[_0xebc3('0x4d')][0x0][_0xebc3('0x50')]?_0x6a2e58['alternatives'][0x0][_0xebc3('0x50')]:0x0;})[_0xebc3('0x4f')]('\x0a');}logger[_0xebc3('0x1a')](_0xebc3('0x51'),_0x3f61c5);logger[_0xebc3('0x1a')](_0xebc3('0x52'),_0x2ebabc);return{'transcript':_0x3f61c5,'confidence':_0x2ebabc};})[_0xebc3('0x53')](function(_0xa91427){logger[_0xebc3('0x15')]('[%s]\x20%s:%s',_0xa91427[_0xebc3('0x14')],_0xa91427[_0xebc3('0x54')],_0xa91427[_0xebc3('0x55')]);});};exports[_0xebc3('0x56')]=function(_0x171eac,_0x286e54,_0x1c65b8,_0x1a2b2b){var _0x202d86=apiai(_0x286e54,{'language':_0x1a2b2b||'en'});return _0x202d86['textRequest'](_0x1c65b8,{'sessionId':md5(_0x171eac)})[_0xebc3('0x28')](function(_0x5d5db3){logger[_0xebc3('0x1a')](JSON['stringify'](_0x5d5db3));return{'source':_0x5d5db3[_0xebc3('0x57')][_0xebc3('0x58')],'resolvedQuery':_0x5d5db3[_0xebc3('0x57')][_0xebc3('0x59')],'action':_0x5d5db3[_0xebc3('0x57')][_0xebc3('0x5a')],'actionIncomplete':_0x5d5db3[_0xebc3('0x57')]['actionIncomplete'],'speech':_0x5d5db3[_0xebc3('0x57')][_0xebc3('0x5b')][_0xebc3('0x5c')],'score':_0x5d5db3[_0xebc3('0x57')]['score'],'statusCode':_0x5d5db3['status'][_0xebc3('0x5d')],'endConversation':_0x5d5db3[_0xebc3('0x57')][_0xebc3('0x5e')][_0xebc3('0x5f')]||![],'isFallbackIntent':_0x5d5db3[_0xebc3('0x57')]['metadata'][_0xebc3('0x60')]};});};exports['googleDialogflowV2']=function(_0x53cf3c,_0x7100c3,_0x50bcf5,_0x1d2780,_0x3891d8,_0x3d3a64){var _0x3028c8=_0x1d2780[_0xebc3('0x61')](/\\n/g,'\x0a');var _0xddfca7={'credentials':{'private_key':_0x3028c8,'client_email':_0x50bcf5}};var _0xe76f38=new dialogflow[(_0xebc3('0x62'))](_0xddfca7);var _0x4d7282=_0xe76f38[_0xebc3('0x63')](_0x7100c3,md5(_0x53cf3c));var _0x4666a2={'session':_0x4d7282,'queryInput':{'text':{'text':_0x3891d8,'languageCode':_0x3d3a64}}};return _0xe76f38[_0xebc3('0x64')](_0x4666a2)[_0xebc3('0x28')](function(_0x54f7aa){if(_0x54f7aa&&_0x54f7aa[_0xebc3('0x46')]){logger[_0xebc3('0x1a')](_0xebc3('0x65'),JSON['stringify'](_0x54f7aa));var _0x4f6379=_0x54f7aa[0x0];if(_0x4f6379){var _0x26bfaf={'action':_0x4f6379[_0xebc3('0x66')][_0xebc3('0x5a')],'allRequiredParamsPresent':_0x4f6379[_0xebc3('0x66')]['allRequiredParamsPresent'],'endConversation':_0x4f6379[_0xebc3('0x66')]['diagnosticInfo']&&_0x4f6379[_0xebc3('0x66')][_0xebc3('0x67')][_0xebc3('0x68')]?_0x4f6379['queryResult'][_0xebc3('0x67')][_0xebc3('0x68')][_0xebc3('0x69')]['boolValue']:![],'fulfillmentText':_0x4f6379['queryResult'][_0xebc3('0x6a')],'intentName':_0x4f6379['queryResult'][_0xebc3('0x6b')][_0xebc3('0x54')],'intentDisplayName':_0x4f6379['queryResult'][_0xebc3('0x6b')][_0xebc3('0x6c')],'isFallbackIntent':_0x4f6379[_0xebc3('0x66')]['intent']['isFallback'],'languageCode':_0x4f6379[_0xebc3('0x66')]['languageCode'],'queryText':_0x4f6379[_0xebc3('0x66')][_0xebc3('0x6d')],'responseId':_0x4f6379[_0xebc3('0x6e')],'score':_0x4f6379['queryResult'][_0xebc3('0x6f')],'speech':_0x4f6379[_0xebc3('0x66')][_0xebc3('0x6a')],'providerResponse':JSON['stringify'](_0x54f7aa)};return _0x26bfaf;}}});};exports[_0xebc3('0x70')]=function(_0x5f4492,_0x36316a,_0x25c144,_0x14367c){return tilde[_0xebc3('0x4a')](_0x5f4492,_0x36316a,_0x25c144,_0x14367c)[_0xebc3('0x28')](function(_0x84ab54){try{fs['unlink'](_0x5f4492);}catch(_0x1a8ecb){logger['error'](_0x1a8ecb);}logger['info'](_0xebc3('0x71'),_0x84ab54[_0xebc3('0x4e')]);logger[_0xebc3('0x1a')](_0xebc3('0x72'),_0x84ab54[_0xebc3('0x50')]);return _0x84ab54;});};exports[_0xebc3('0x73')]=function(_0x1e4c13,_0x31594c,_0xf7bdcc,_0x268738,_0x43530a,_0x2e30a9){var _0x2dd96b=path[_0xebc3('0x39')](__dirname,_0xebc3('0x25'),rs['generate'](0x4)+_0xebc3('0x37'));var _0x461f23;return aws['polly'](_0x1e4c13,_0x31594c,_0xf7bdcc,_0x268738,_0x43530a,_0x2e30a9,_0x2dd96b)['then'](function(){_0x461f23=path['resolve'](__dirname,'tmp',rs[_0xebc3('0x26')](0x4)+_0xebc3('0x3a'));return convertFile(_0x2dd96b,_0x461f23);})['then'](function(){try{fs[_0xebc3('0x29')](_0x2dd96b);fs['chmodSync'](_0x461f23,_0xebc3('0x2b'));}catch(_0x20525a){logger[_0xebc3('0x15')](_0x20525a);}return _0x461f23['split']('.')[0x0];});};exports[_0xebc3('0x74')]=function(_0x2d5b80,_0x591b64,_0x5d6243,_0x5d95ee,_0xc10323,_0x31a330){return aws[_0xebc3('0x75')](_0x2d5b80,_0x591b64,_0x5d6243,_0x5d95ee,_0xc10323,_0x31a330)[_0xebc3('0x28')](function(_0x8bf10c){logger[_0xebc3('0x1a')](JSON['stringify'](_0x8bf10c));return _0x8bf10c;});};exports[_0xebc3('0x76')]=function(_0x223606,_0x5c8d15,_0x10a8f8,_0x355541){var _0x114b02=util[_0xebc3('0x77')](_0xebc3('0x78'),ISPEECH_API,_0x223606,encodeURIComponent(_0x5c8d15),_0x10a8f8,_0x355541);var _0xcec51b=path[_0xebc3('0x39')](__dirname,'tmp',rs['generate'](0x4)+_0xebc3('0x37'));var _0x21d0bb;return downloadFile(_0x114b02,_0xcec51b)[_0xebc3('0x28')](function(){_0x21d0bb=path[_0xebc3('0x39')](__dirname,_0xebc3('0x25'),rs[_0xebc3('0x26')](0x4)+_0xebc3('0x3a'));return convertFile(_0xcec51b,_0x21d0bb);})[_0xebc3('0x28')](function(){try{fs[_0xebc3('0x29')](_0xcec51b);fs[_0xebc3('0x2a')](_0x21d0bb,_0xebc3('0x2b'));}catch(_0x282593){logger[_0xebc3('0x15')](_0x282593);}return _0x21d0bb[_0xebc3('0x2c')]('.')[0x0];});};exports[_0xebc3('0x79')]=function(_0x3d57f8,_0x3d5b1c,_0xaf7080,_0x464d07){var _0x214745=util[_0xebc3('0x77')](_0xebc3('0x7a'),ISPEECH_API,_0x3d5b1c,_0xaf7080,base64Encode(_0x3d57f8),_0x464d07?util[_0xebc3('0x77')]('model=%s',encodeURIComponent(_0x464d07)):_0xebc3('0x7b'));return uploadFile(_0x214745)[_0xebc3('0x28')](function(_0x30a2dd){return querystring[_0xebc3('0x7c')](_0x30a2dd);});};exports[_0xebc3('0x7d')]=function(_0x26aedb,_0x88ed38){return sestek[_0xebc3('0x7e')](_0x26aedb,_0x88ed38)[_0xebc3('0x28')](function(_0x2d2759){logger[_0xebc3('0x1a')](JSON[_0xebc3('0x42')](_0x2d2759));var _0x3ebc3a={'speech':_0x2d2759[_0xebc3('0x7f')],'action':_0x2d2759[_0xebc3('0x80')]?_0x2d2759[_0xebc3('0x80')][_0xebc3('0x81')]:undefined,'actiondata':_0x2d2759[_0xebc3('0x80')]?_0x2d2759[_0xebc3('0x80')][_0xebc3('0x82')]:undefined};if(_0x2d2759[_0xebc3('0x80')]&&_0x2d2759[_0xebc3('0x80')]['AudioFromTts']){return base64Decode(_0x2d2759[_0xebc3('0x80')][_0xebc3('0x83')]['Data'],path[_0xebc3('0x39')](__dirname,'tmp',rs[_0xebc3('0x26')](0x4)+_0xebc3('0x3a')))['then'](function(_0x4e13df){_0x3ebc3a[_0xebc3('0x84')]=_0x4e13df;return _0x3ebc3a;});}return _0x3ebc3a;});};exports[_0xebc3('0x85')]=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 f350dfa..aafd8bd 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 _0x49d6=['exports'];(function(_0xbf0b04,_0x2dedc1){var _0x25c3a1=function(_0x131a6e){while(--_0x131a6e){_0xbf0b04['push'](_0xbf0b04['shift']());}};_0x25c3a1(++_0x2dedc1);}(_0x49d6,0x178));var _0x649d=function(_0x2b7f81,_0x596907){_0x2b7f81=_0x2b7f81-0x0;var _0x3c1ad9=_0x49d6[_0x2b7f81];return _0x3c1ad9;};var nda=require('./nda');module[_0x649d('0x0')]={'nda':nda}; \ No newline at end of file +var _0x56fc=['./nda','exports'];(function(_0x56f3d4,_0xfc65dd){var _0x2c7ef0=function(_0x587024){while(--_0x587024){_0x56f3d4['push'](_0x56f3d4['shift']());}};_0x2c7ef0(++_0xfc65dd);}(_0x56fc,0x1be));var _0xc56f=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x56fc[_0x42245d];return _0x4b211a;};var nda=require(_0xc56f('0x0'));module[_0xc56f('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 785fdc0..143e236 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 _0x3667=['Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x7366('0x0'));var url=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));module[_0x7366('0x4')]=function(_0x5d1072,_0x27a90d){var _0x1cfcc9={'method':'POST','uri':url[_0x7366('0x5')](_0x27a90d[_0x7366('0x6')],_0x7366('0x7')),'form':{'grant_type':_0x7366('0x8'),'username':_0x27a90d[_0x7366('0x9')],'password':_0x27a90d['password']},'json':!![]};return rp(_0x1cfcc9)[_0x7366('0xa')](function(_0xa1a3c5){var _0x2dd32b={'method':_0x7366('0xb'),'uri':url[_0x7366('0x5')](_0x27a90d[_0x7366('0xc')],_0x7366('0xd')),'body':{'type':_0x27a90d[_0x7366('0xe')]||_0x7366('0xf'),'channelId':_0x7366('0x10'),'conversation':{'id':_0x5d1072[_0x7366('0x11')]},'from':{'id':_0x5d1072[_0x7366('0x12')],'name':_0x5d1072[_0x7366('0x13')]},'recipient':{'id':_0x5d1072[_0x7366('0x14')],'name':_0x5d1072[_0x7366('0x15')]},'text':_0x27a90d[_0x7366('0x16')],'channelData':{}},'headers':{'Authorization':_0x7366('0x17')+_0xa1a3c5[_0x7366('0x18')]},'json':!![]};if(_0x27a90d[_0x7366('0x19')]){_0x2dd32b[_0x7366('0x1a')][_0x7366('0x1b')][_0x7366('0x1c')]=_0x27a90d[_0x7366('0x19')];}if(_0x27a90d[_0x7366('0x1d')]=='1'){_0x2dd32b[_0x7366('0x1a')][_0x7366('0x1b')][_0x7366('0x1e')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7366('0x1f')};}if(_0x27a90d['custom_action']){_0x2dd32b[_0x7366('0x1a')][_0x7366('0x1b')][_0x7366('0x20')]=_0x27a90d[_0x7366('0x21')];if(_0x27a90d[_0x7366('0x22')]){_0x2dd32b[_0x7366('0x1a')][_0x7366('0x1b')][_0x7366('0x23')]=_0x27a90d[_0x7366('0x22')];}}logger[_0x7366('0x24')](JSON[_0x7366('0x25')](_0x2dd32b));return rp(_0x2dd32b);});}; \ No newline at end of file +var _0xbdeb=['project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action_data','info','url','agi','POST','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','access_token','body','ProjectName'];(function(_0x5539af,_0x34c417){var _0x4f3952=function(_0xc8d93b){while(--_0xc8d93b){_0x5539af['push'](_0x5539af['shift']());}};_0x4f3952(++_0x34c417);}(_0xbdeb,0x6f));var _0xbbde=function(_0x4c39f8,_0x46242e){_0x4c39f8=_0x4c39f8-0x0;var _0x5a9aad=_0xbdeb[_0x4c39f8];return _0x5a9aad;};'use strict';var rp=require('request-promise');var url=require(_0xbbde('0x0'));var logger=require('../../../../../config/logger')(_0xbbde('0x1'));module['exports']=function(_0x1279b0,_0x365857){var _0x20d4f0={'method':_0xbbde('0x2'),'uri':url['resolve'](_0x365857['ndauth_url'],_0xbbde('0x3')),'form':{'grant_type':_0xbbde('0x4'),'username':_0x365857[_0xbbde('0x5')],'password':_0x365857[_0xbbde('0x4')]},'json':!![]};return rp(_0x20d4f0)['then'](function(_0x49966c){var _0x3215c9={'method':_0xbbde('0x2'),'uri':url['resolve'](_0x365857[_0xbbde('0x6')],_0xbbde('0x7')),'body':{'type':_0x365857[_0xbbde('0x8')]||_0xbbde('0x9'),'channelId':_0xbbde('0xa'),'conversation':{'id':_0x1279b0[_0xbbde('0xb')]},'from':{'id':_0x1279b0[_0xbbde('0xc')],'name':_0x1279b0[_0xbbde('0xd')]},'recipient':{'id':_0x1279b0[_0xbbde('0xe')],'name':_0x1279b0[_0xbbde('0xf')]},'text':_0x365857['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x49966c[_0xbbde('0x10')]},'json':!![]};if(_0x365857['project']){_0x3215c9[_0xbbde('0x11')]['channelData'][_0xbbde('0x12')]=_0x365857[_0xbbde('0x13')];}if(_0x365857[_0xbbde('0x14')]=='1'){_0x3215c9[_0xbbde('0x11')][_0xbbde('0x15')][_0xbbde('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xbbde('0x17')};}if(_0x365857['custom_action']){_0x3215c9[_0xbbde('0x11')][_0xbbde('0x15')]['CustomAction']=_0x365857['custom_action'];if(_0x365857[_0xbbde('0x18')]){_0x3215c9['body'][_0xbbde('0x15')]['CustomActionData']=_0x365857[_0xbbde('0x18')];}}logger[_0xbbde('0x19')](JSON['stringify'](_0x3215c9));return rp(_0x3215c9);});}; \ 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 38b39b7..c53a863 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 _0xeeb2=['exports','./lib/api'];(function(_0x45e769,_0x4a93bd){var _0x1fcf2e=function(_0x2071cb){while(--_0x2071cb){_0x45e769['push'](_0x45e769['shift']());}};_0x1fcf2e(++_0x4a93bd);}(_0xeeb2,0x117));var _0x2eeb=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0xeeb2[_0x37ae26];return _0x1b1902;};'use strict';var asr=require(_0x2eeb('0x0'));module[_0x2eeb('0x1')]=function(_0x285c2e,_0x5037cf,_0x3f45dd,_0x43134c){return asr(_0x285c2e,_0x5037cf,_0x3f45dd,_0x43134c);}; \ No newline at end of file +var _0xd446=['./lib/api','exports'];(function(_0x20738b,_0x1f3b41){var _0x5326ba=function(_0x532039){while(--_0x532039){_0x20738b['push'](_0x20738b['shift']());}};_0x5326ba(++_0x1f3b41);}(_0xd446,0x80));var _0x6d44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd446[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0x6d44('0x0'));module[_0x6d44('0x1')]=function(_0x4e5939,_0x3390ee,_0x3356b5,_0x359998){return asr(_0x4e5939,_0x3390ee,_0x3356b5,_0x359998);}; \ 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 9709b2c..a47d1f8 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 _0x593f=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','lodash','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','data','EOS','stringify','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','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.','error','Close\x20Tilde\x20ASR\x20socket'];(function(_0xdb12f4,_0x321b9e){var _0xaaff62=function(_0x13d445){while(--_0x13d445){_0xdb12f4['push'](_0xdb12f4['shift']());}};_0xaaff62(++_0x321b9e);}(_0x593f,0x153));var _0xf593=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x593f[_0x18ab2a];return _0x16dcee;};'use strict';var BPromise=require('bluebird');var _=require(_0xf593('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf593('0x1'));var logger=require('../../../../../../config/logger')(_0xf593('0x2'));module[_0xf593('0x3')]=function(_0x5a6299,_0xfde75e,_0x384a11,_0x5f42ae){return new BPromise(function(_0x101c31,_0x166507){logger[_0xf593('0x4')](_0xf593('0x5'),_0x5f42ae||_0xf593('0x6'));var _0x2224e4=new WebSocket(_0x5f42ae||_0xf593('0x6'),{'perMessageDeflate':![]});var _0x4de711='';var _0x4b5a89='0';var _0xd12197='1';var _0x5cf8ad=_0xf593('0x7');function _0x1a6175(_0x294e6d){var _0x1c7cf5=crypto[_0xf593('0x8')](_0xf593('0x9'));_0x1c7cf5[_0xf593('0xa')](_0x294e6d);return _0x1c7cf5['digest'](_0xf593('0xb'));}function _0x38c51c(){try{logger[_0xf593('0x4')](_0xf593('0xc'));var _0x4dc0fe=moment()[_0xf593('0xd')]();var _0x3e7261=_0x1a6175(_0x4dc0fe+_0xfde75e+_0x384a11);_0x2224e4[_0xf593('0xe')](JSON['stringify']({'appID':_0xfde75e,'timestamp':_0x4dc0fe,'appKey':_0x3e7261}));var _0x312d34=fs['createReadStream'](_0x5a6299);_0x312d34['on'](_0xf593('0xf'),function(_0x24b1a4){_0x2224e4[_0xf593('0xe')](_0x24b1a4);});_0x312d34['on']('close',function(){_0x2224e4[_0xf593('0xe')](_0xf593('0x10'));});}catch(_0x41f062){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0xf593('0x11')](_0x41f062));_0x2224e4[_0xf593('0x12')]();}}function _0x35d18f(_0x385875){try{if(_0x385875){var _0x3656d6=JSON[_0xf593('0x13')](_0x385875);switch(_0x3656d6[_0xf593('0x14')]){case 0x0:if(_0x3656d6[_0xf593('0x15')]){if(_0x3656d6[_0xf593('0x15')]['final']){logger[_0xf593('0x4')](_0xf593('0x16'),JSON[_0xf593('0x11')](_0x3656d6[_0xf593('0x15')]['hypotheses']));_0x4de711=_0x3656d6[_0xf593('0x15')][_0xf593('0x17')][0x0]['transcript'];_0x4b5a89=_0x3656d6['result']['hypotheses'][0x0]['likelihood'];_0xd12197='0';_0x5cf8ad=_0xf593('0x18');_0x2224e4[_0xf593('0x12')]();}}break;case 0x1:logger[_0xf593('0x4')](_0xf593('0x7'));_0xd12197='1';_0x5cf8ad=_0xf593('0x7');break;case 0x2:logger[_0xf593('0x4')](_0xf593('0x19'));_0xd12197='2';_0x5cf8ad=_0xf593('0x19');break;case 0x9:logger['info'](_0xf593('0x1a'));_0xd12197='9';_0x5cf8ad=_0xf593('0x1a');break;case 0xa:logger[_0xf593('0x4')](_0xf593('0x1b'));_0xd12197='10';_0x5cf8ad=_0xf593('0x1b');break;case 0xb:logger[_0xf593('0x4')](_0xf593('0x1c'));_0xd12197='11';_0x5cf8ad=_0xf593('0x1c');}}}catch(_0x46c4fc){logger[_0xf593('0x1d')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xf593('0x11')](_0x46c4fc));_0x2224e4[_0xf593('0x12')]();}}function _0x52dbe2(){logger['info'](_0xf593('0x1e'));_0x101c31({'transcript':_0x4de711,'confidence':_0x4b5a89,'status':_0xd12197,'status_message':_0x5cf8ad});}function _0x3963ff(_0x545d7d){logger['error'](_0xf593('0x1f'));if(!_[_0xf593('0x20')](_0x545d7d)){logger['error'](_[_0xf593('0x21')](_0x545d7d)?JSON[_0xf593('0x11')](_0x545d7d):_0x545d7d);}}_0x2224e4['on'](_0xf593('0x22'),_0x38c51c);_0x2224e4['on'](_0xf593('0x23'),_0x35d18f);_0x2224e4['on'](_0xf593('0x24'),_0x52dbe2);_0x2224e4['on'](_0xf593('0x1d'),_0x3963ff);});}; \ No newline at end of file +var _0x547a=['bluebird','lodash','moment','crypto','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','hypotheses','result','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x547a,0x171));var _0xa547=function(_0xa142ba,_0x18a88e){_0xa142ba=_0xa142ba-0x0;var _0x5c2c30=_0x547a[_0xa142ba];return _0x5c2c30;};'use strict';var BPromise=require(_0xa547('0x0'));var _=require(_0xa547('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa547('0x2'));var crypto=require(_0xa547('0x3'));var logger=require('../../../../../../config/logger')('agi');module[_0xa547('0x4')]=function(_0x1c66c6,_0x402a00,_0x470ffb,_0x160a49){return new BPromise(function(_0x281e93,_0x430ab){logger[_0xa547('0x5')](_0xa547('0x6'),_0x160a49||_0xa547('0x7'));var _0x18c35c=new WebSocket(_0x160a49||_0xa547('0x7'),{'perMessageDeflate':![]});var _0xb007e1='';var _0x5de19a='0';var _0x1a7c6c='1';var _0x184ed4=_0xa547('0x8');function _0x1afc60(_0x263519){var _0x4e4bd2=crypto[_0xa547('0x9')]('sha1');_0x4e4bd2[_0xa547('0xa')](_0x263519);return _0x4e4bd2['digest'](_0xa547('0xb'));}function _0x45e0e7(){try{logger[_0xa547('0x5')](_0xa547('0xc'));var _0x40e1a4=moment()[_0xa547('0xd')]();var _0x51e605=_0x1afc60(_0x40e1a4+_0x402a00+_0x470ffb);_0x18c35c[_0xa547('0xe')](JSON[_0xa547('0xf')]({'appID':_0x402a00,'timestamp':_0x40e1a4,'appKey':_0x51e605}));var _0x61131c=fs['createReadStream'](_0x1c66c6);_0x61131c['on'](_0xa547('0x10'),function(_0x200b9d){_0x18c35c['send'](_0x200b9d);});_0x61131c['on'](_0xa547('0x11'),function(){_0x18c35c[_0xa547('0xe')](_0xa547('0x12'));});}catch(_0x122cea){logger['error'](_0xa547('0x13'),JSON[_0xa547('0xf')](_0x122cea));_0x18c35c[_0xa547('0x14')]();}}function _0x2eb930(_0x27583a){try{if(_0x27583a){var _0x490335=JSON[_0xa547('0x15')](_0x27583a);switch(_0x490335[_0xa547('0x16')]){case 0x0:if(_0x490335['result']){if(_0x490335['result'][_0xa547('0x17')]){logger[_0xa547('0x5')](_0xa547('0x18'),JSON[_0xa547('0xf')](_0x490335['result'][_0xa547('0x19')]));_0xb007e1=_0x490335[_0xa547('0x1a')][_0xa547('0x19')][0x0]['transcript'];_0x5de19a=_0x490335[_0xa547('0x1a')][_0xa547('0x19')][0x0][_0xa547('0x1b')];_0x1a7c6c='0';_0x184ed4=_0xa547('0x1c');_0x18c35c[_0xa547('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1a7c6c='1';_0x184ed4=_0xa547('0x8');break;case 0x2:logger[_0xa547('0x5')](_0xa547('0x1d'));_0x1a7c6c='2';_0x184ed4=_0xa547('0x1d');break;case 0x9:logger[_0xa547('0x5')](_0xa547('0x1e'));_0x1a7c6c='9';_0x184ed4=_0xa547('0x1e');break;case 0xa:logger[_0xa547('0x5')](_0xa547('0x1f'));_0x1a7c6c='10';_0x184ed4='Authentication\x20failed.';break;case 0xb:logger[_0xa547('0x5')](_0xa547('0x20'));_0x1a7c6c='11';_0x184ed4='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x418719){logger['error'](_0xa547('0x21'),JSON['stringify'](_0x418719));_0x18c35c[_0xa547('0x14')]();}}function _0xf03b68(){logger['info'](_0xa547('0x22'));_0x281e93({'transcript':_0xb007e1,'confidence':_0x5de19a,'status':_0x1a7c6c,'status_message':_0x184ed4});}function _0x137764(_0x36fd4b){logger[_0xa547('0x23')](_0xa547('0x24'));if(!_[_0xa547('0x25')](_0x36fd4b)){logger['error'](_[_0xa547('0x26')](_0x36fd4b)?JSON[_0xa547('0xf')](_0x36fd4b):_0x36fd4b);}}_0x18c35c['on'](_0xa547('0x27'),_0x45e0e7);_0x18c35c['on'](_0xa547('0x28'),_0x2eb930);_0x18c35c['on'](_0xa547('0x11'),_0xf03b68);_0x18c35c['on'](_0xa547('0x23'),_0x137764);});}; \ 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 1b49122..903d087 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 _0x4c19=['exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4c19,0x19c));var _0x94c1=function(_0x52c3c3,_0x5af662){_0x52c3c3=_0x52c3c3-0x0;var _0x34389a=_0x4c19[_0x52c3c3];return _0x34389a;};var asr=require('./asr');module[_0x94c1('0x0')]={'asr':asr}; \ No newline at end of file +var _0x6299=['exports'];(function(_0x8460f5,_0x161340){var _0x3fd88f=function(_0x2b085e){while(--_0x2b085e){_0x8460f5['push'](_0x8460f5['shift']());}};_0x3fd88f(++_0x161340);}(_0x6299,0x1ef));var _0x9629=function(_0xf55b9d,_0x34c660){_0xf55b9d=_0xf55b9d-0x0;var _0x258e22=_0x6299[_0xf55b9d];return _0x258e22;};var asr=require('./asr');module[_0x9629('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index fc8fd65..1f49fd8 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xe706,0xa3));var _0x6e70=function(_0x631aa1,_0x2f7d83){_0x631aa1=_0x631aa1-0x0;var _0x319a1b=_0xe706[_0x631aa1];return _0x319a1b;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2b6e785..2bb6a8a 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 _0x3c94=['out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','speech','sesteknda','audiofile','streamFile','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','Enter\x20in\x20NOOP\x20(%s)\x20block','output','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','yes','Answer','Skipped\x20Answer','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','catch','getVoiceQueue','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','createSquareRecording','callerid','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','MALE','audioEncoding','googleTTS','method','timeout','includes','POST','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','computedVariables','sync','uri','render','url','stringify','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','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','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase'];(function(_0x4427c4,_0x28bd26){var _0x1e568d=function(_0x7e56fb){while(--_0x7e56fb){_0x4427c4['push'](_0x4427c4['shift']());}};_0x1e568d(++_0x28bd26);}(_0x3c94,0xcd));var _0x43c9=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x3c94[_0x4d82ea];return _0x257f4a;};'use strict';var fs=require('fs');var util=require(_0x43c9('0x0'));var _=require(_0x43c9('0x1'));var sh=require(_0x43c9('0x2'));var odbc=require(_0x43c9('0x3'))();var rs=require(_0x43c9('0x4'));var moment=require(_0x43c9('0x5'));var Mustache=require(_0x43c9('0x6'));var rp=require(_0x43c9('0x7'));var logger=require(_0x43c9('0x8'))(_0x43c9('0x9'));var config=require(_0x43c9('0xa'));var scripts=require(_0x43c9('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x43c9('0xc'),_0x43c9('0xd')];var verticesWithRetry=[_0x43c9('0xe'),_0x43c9('0xf'),_0x43c9('0x10')];var AGIVertices=function(_0x7a0f6b,_0x28aa11,_0x4725aa){this[_0x43c9('0x11')]=_0x7a0f6b;this['rpc']=_0x28aa11;this[_0x43c9('0x12')]=_0x4725aa;};AGIVertices[_0x43c9('0x13')][_0x43c9('0x14')]=function(_0x3b21f5,_0x27ad97){this[_0x43c9('0x15')][_0x43c9('0x16')](_0x3b21f5)[_0x43c9('0x17')](function(_0x41f338){_0x27ad97(null,_0x41f338?_0x41f338[_0x43c9('0x18')]:![]);})[_0x43c9('0x19')](function(_0x31faa1){_0x27ad97(_0x31faa1);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x1a')]=function(_0xa98d2f,_0x45546d){this[_0x43c9('0x15')]['getVoiceQueueById'](_0xa98d2f)[_0x43c9('0x17')](function(_0x1c7fd9){_0x45546d(null,_0x1c7fd9?_0x1c7fd9[_0x43c9('0x18')]:![]);})[_0x43c9('0x19')](function(_0x3f908d){_0x45546d(_0x3f908d);});};AGIVertices['prototype']['getSquareProject']=function(_0x425238,_0x9a0f50){this[_0x43c9('0x15')][_0x43c9('0x1b')](_0x425238)['then'](function(_0x1d63cf){_0x9a0f50(null,_0x1d63cf?_0x1d63cf[_0x43c9('0x18')]:![]);})[_0x43c9('0x19')](function(_0x22bf3d){_0x9a0f50(_0x22bf3d);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x1c')]=function(_0x24db4e,_0x1e3996){this[_0x43c9('0x15')][_0x43c9('0x1d')](_0x24db4e)[_0x43c9('0x17')](function(_0x4847b2){_0x1e3996(null,_0x4847b2?_0x4847b2[_0x43c9('0x1e')]:![]);})[_0x43c9('0x19')](function(_0x31248d){_0x1e3996(_0x31248d);});};AGIVertices['prototype'][_0x43c9('0x1f')]=function(_0x5e477,_0x2ef8d9){this['rpc'][_0x43c9('0x20')](_0x5e477)[_0x43c9('0x17')](function(_0x460f53){_0x2ef8d9(null,_0x460f53?_0x460f53['name']:![]);})['catch'](function(_0x2a40f4){_0x2ef8d9(_0x2a40f4);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x21')]=function(_0x59110e,_0x3bc245){this[_0x43c9('0x15')][_0x43c9('0x22')](_0x59110e)[_0x43c9('0x17')](function(_0x2c69af){_0x3bc245(null,_0x2c69af?_0x2c69af['name']:![]);})[_0x43c9('0x19')](function(_0x3b5c47){_0x3bc245(_0x3b5c47);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x23')]=function(_0x4633cc,_0xf5b835){var _0x40345f=this;this[_0x43c9('0x15')][_0x43c9('0x24')](_0x4633cc)[_0x43c9('0x17')](function(_0x4eb970){_0xf5b835(null,_0x4eb970?_0x40345f[_0x43c9('0x25')](_0x4eb970[_0x43c9('0x26')]):![]);})[_0x43c9('0x19')](function(_0x519e2c){_0xf5b835(_0x519e2c);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x27')]=function(_0x4ccda7,_0x2cb41c){this['rpc'][_0x43c9('0x28')](_0x4ccda7)[_0x43c9('0x17')](function(_0x496b67){_0x2cb41c(null,_0x496b67?_0x496b67:![]);})[_0x43c9('0x19')](function(_0x4b835f){_0x2cb41c(_0x4b835f);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x29')]=function(_0x17dd62,_0x526741,_0x1350c8){this['mailRpc'][_0x43c9('0x29')](_0x17dd62,_0x526741)[_0x43c9('0x17')](function(){_0x1350c8(null);})[_0x43c9('0x19')](function(_0x3cd1db){_0x1350c8(_0x3cd1db);});};AGIVertices['prototype'][_0x43c9('0x2a')]=function(_0x469769,_0x465116){this[_0x43c9('0x15')]['getIntervalById'](_0x469769)[_0x43c9('0x17')](function(_0x197aff){if(_0x197aff){if(_0x197aff[_0x43c9('0x2b')]){_0x465116(null,[_0x197aff[_0x43c9('0x2c')]]);}else{_0x465116(null,_[_0x43c9('0x2d')](_0x197aff[_0x43c9('0x2e')],_0x43c9('0x2c')));}}else{_0x465116(null,![]);}})[_0x43c9('0x19')](function(_0x4d5d8e){_0x465116(_0x4d5d8e);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x25')]=function(_0x84d661){return util[_0x43c9('0x2f')](_0x43c9('0x30'),FILES_PATH,_0x84d661);};AGIVertices[_0x43c9('0x13')][_0x43c9('0x31')]=function(_0x358202,_0x45d2d4,_0x4a62b2){odbc[_0x43c9('0x32')](_0x358202,function(_0x51c8c7){if(_0x51c8c7){logger[_0x43c9('0x33')](_0x43c9('0x34'),_0x51c8c7);_0x4a62b2(_0x51c8c7);}else{logger[_0x43c9('0x35')](_0x43c9('0x36'));odbc[_0x43c9('0x37')](_0x45d2d4,function(_0x787b76,_0x42dacb){if(_0x787b76){logger[_0x43c9('0x35')](_0x43c9('0x38'),_0x45d2d4);_0x4a62b2(_0x787b76);}else{logger['info'](_0x43c9('0x39'),_0x45d2d4);odbc[_0x43c9('0x3a')](function(_0x585bb3){if(_0x585bb3){logger[_0x43c9('0x33')](_0x43c9('0x3b'),_0x585bb3);}_0x4a62b2(null,_0x42dacb);});}});}});};AGIVertices[_0x43c9('0x13')]['getSmsAccount']=function(_0xb01a6e,_0x33f293){this[_0x43c9('0x15')][_0x43c9('0x3c')](_0xb01a6e)[_0x43c9('0x17')](function(_0x39601e){_0x33f293(null,_0x39601e?_0x39601e:![]);})[_0x43c9('0x19')](function(_0x3a68d8){_0x33f293(_0x3a68d8);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x3d')]=function(_0x470a66,_0x40d8cc){this['rpc'][_0x43c9('0x3d')](_0x470a66)[_0x43c9('0x17')](function(_0xaecaf5){_0x40d8cc(null,_0xaecaf5);})[_0x43c9('0x19')](function(_0x4d6eee){_0x40d8cc(_0x4d6eee);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x3e')]=function(_0x5ce14f,_0x2a8f7d,_0x395b1f){this[_0x43c9('0x15')][_0x43c9('0x3e')]({'uniqueid':this[_0x43c9('0x11')][_0x43c9('0x3f')],'node':_0x5ce14f[_0x43c9('0x40')],'application':_0x5ce14f[_0x43c9('0x41')],'data':_0x2a8f7d||null,'project_name':this[_0x43c9('0x11')]['arg_1'],'callerid':this[_0x43c9('0x11')]['callerid']})[_0x43c9('0x17')](function(_0x3fdf47){if(_0x395b1f){_0x395b1f(null,_0x3fdf47);}})[_0x43c9('0x19')](function(_0x45de19){if(_0x395b1f){_0x395b1f(_0x45de19);}});};AGIVertices['prototype'][_0x43c9('0x42')]=function(_0x34c118,_0x53cb85,_0x1d40e4,_0x272c94){this['rpc'][_0x43c9('0x42')]({'uniqueid':this[_0x43c9('0x11')][_0x43c9('0x3f')],'callerid':this['channel'][_0x43c9('0x43')],'calleridname':this['channel']['calleridname'],'context':this[_0x43c9('0x11')][_0x43c9('0x44')],'extension':this[_0x43c9('0x11')][_0x43c9('0x45')],'priority':this[_0x43c9('0x11')][_0x43c9('0x46')],'accountcode':this[_0x43c9('0x11')][_0x43c9('0x47')],'dnid':this[_0x43c9('0x11')][_0x43c9('0x48')],'projectName':this[_0x43c9('0x11')][_0x43c9('0x49')],'saveName':_0x53cb85,'filename':_0x34c118[_0x43c9('0x4a')]||_0x53cb85,'savePath':_0x1d40e4})['then'](function(_0xc57086){_0x272c94(null,_0xc57086);})[_0x43c9('0x19')](function(_0x4deed0){_0x272c94(_0x4deed0);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x4b')]=function(_0x43f96d,_0x2057a8,_0x246b9c,_0x2e763c,_0x21adfe){this[_0x43c9('0x15')][_0x43c9('0x4b')]({'uniqueid':this['channel'][_0x43c9('0x3f')],'body':_0x43f96d,'direction':_0x2057a8,'providerName':_0x246b9c,'providerResponse':_0x2e763c})[_0x43c9('0x17')](function(_0x4353b1){if(_0x21adfe){_0x21adfe(null,_0x4353b1);}})[_0x43c9('0x19')](function(_0x22e48d){if(_0x21adfe){_0x21adfe(_0x22e48d);}});};AGIVertices[_0x43c9('0x13')]['createCmContact']=function(_0x37b747,_0x1bc3b5){this[_0x43c9('0x15')][_0x43c9('0x4c')]({'firstName':_[_0x43c9('0x4d')](_0x37b747[_0x43c9('0x18')])||_[_0x43c9('0x4e')](_0x37b747[_0x43c9('0x18')])?'callback_'+Math[_0x43c9('0x4f')]():_0x37b747['name'],'lastName':_[_0x43c9('0x4d')](_0x37b747[_0x43c9('0x50')])||_[_0x43c9('0x4e')](_0x37b747[_0x43c9('0x50')])?null:_0x37b747['lastName'],'phone':_0x37b747['phone'],'ListId':_0x37b747['list_id'],'scheduledat':_0x37b747[_0x43c9('0x51')],'callbackUniqueid':this[_0x43c9('0x11')][_0x43c9('0x3f')],'tags':_0x43c9('0x52'),'description':_0x43c9('0x53')+_0x37b747[_0x43c9('0x51')][_0x43c9('0x54')](),'priority':_0x37b747[_0x43c9('0x55')]})['then'](function(_0x4ffc86){_0x1bc3b5(null,_0x4ffc86);})[_0x43c9('0x19')](function(_0x14d9ec){_0x1bc3b5(_0x14d9ec);});};AGIVertices['prototype']['getPause']=function(_0x352844,_0xf98590){this[_0x43c9('0x15')]['getPauseById'](_0x352844)[_0x43c9('0x17')](function(_0x113cc8){_0xf98590(null,_0x113cc8?_0x113cc8[_0x43c9('0x18')]:![]);})[_0x43c9('0x19')](function(_0x223cac){_0xf98590(_0x223cac);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x56')]=function(_0x1b5a91,_0x45d639,_0x474d58){var _0x50f1dc={'role':_0x43c9('0x57')};_0x50f1dc[_0x1b5a91]=this[_0x43c9('0x11')][_0x43c9('0x43')];this[_0x43c9('0x15')][_0x43c9('0x56')](_0x50f1dc,_0x45d639,this[_0x43c9('0x11')]['uniqueid'])[_0x43c9('0x17')](function(_0x40c8cc){_0x474d58(null,_[_0x43c9('0x4e')](_0x40c8cc)?![]:!![]);})[_0x43c9('0x19')](function(_0x3d7287){logger[_0x43c9('0x33')](_0x3d7287);_0x474d58(null,![]);});};AGIVertices[_0x43c9('0x13')]['agentUnpause']=function(_0xd7f56b,_0x4d4bf4){var _0xf38f9f={'role':_0x43c9('0x57')};_0xf38f9f[_0xd7f56b]=this[_0x43c9('0x11')]['callerid'];this['rpc'][_0x43c9('0x58')](_0xf38f9f)[_0x43c9('0x17')](function(_0x3d47a7){_0x4d4bf4(null,_['isNil'](_0x3d47a7)?![]:!![]);})[_0x43c9('0x19')](function(_0x5225a4){logger[_0x43c9('0x33')](_0x5225a4);_0x4d4bf4(null,![]);});};AGIVertices[_0x43c9('0x13')]['agentLogout']=function(_0x34831c,_0x5c7957){var _0x186038={'role':_0x43c9('0x57')};_0x186038[_0x34831c]=this[_0x43c9('0x11')]['callerid'];this['rpc']['agentLogout'](_0x186038)[_0x43c9('0x17')](function(_0x1b4b27){_0x5c7957(null,_[_0x43c9('0x4e')](_0x1b4b27)?![]:!![]);})[_0x43c9('0x19')](function(_0x431570){logger[_0x43c9('0x33')](_0x431570);_0x5c7957(null,![]);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x59')]=function(_0x33be1b,_0x49635c){var _0x27d4d4={'role':'agent'};_0x27d4d4[_0x33be1b]=this[_0x43c9('0x11')][_0x43c9('0x43')];var _0x11b73d=_0x33be1b!=_0x43c9('0x5a')?util[_0x43c9('0x2f')](_0x43c9('0x5b'),_0x43c9('0x5c'),this[_0x43c9('0x11')][_0x43c9('0x43')]):undefined;this[_0x43c9('0x15')][_0x43c9('0x59')](_0x27d4d4,_0x11b73d)[_0x43c9('0x17')](function(_0x574f31){_0x49635c(null,_[_0x43c9('0x4e')](_0x574f31)?![]:!![]);})[_0x43c9('0x19')](function(_0x3f743a){logger[_0x43c9('0x33')](_0x3f743a);_0x49635c(null,![]);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x5d')]=function(_0x9c973e,_0x5cbf81){sh[_0x43c9('0x5e')](_[_0x43c9('0x5f')](_0x9c973e),function(_0x5b00f5,_0x28a9af){var _0x16ce92=_0x28a9af[_0x43c9('0x60')](/(\r\n|\n|\r)/gm,'');_0x5cbf81(null,_0x16ce92);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x61')]=function(_0x85d3f6,_0x6551fd){scripts[_0x43c9('0x61')](_0x85d3f6['apiKey'],_0x85d3f6[_0x43c9('0x62')]||_0x43c9('0x63'),_0x85d3f6[_0x43c9('0x63')],_0x85d3f6['languageCode']||'en-US',_0x85d3f6['ssmlGender']||_0x43c9('0x64'),_0x85d3f6[_0x43c9('0x65')]||'MP3')[_0x43c9('0x17')](function(_0x526360){_0x6551fd(null,_0x526360);})[_0x43c9('0x19')](function(_0x1bfe9d){_0x6551fd(_0x1bfe9d);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x66')]=function(_0x27900f,_0x29540b){scripts[_0x43c9('0x66')](_0x27900f[_0x43c9('0x63')],_0x27900f['google_tts_language']||'en',0x1)[_0x43c9('0x17')](function(_0x79934e){_0x29540b(null,_0x79934e);})[_0x43c9('0x19')](function(_0x4d2a19){_0x29540b(_0x4d2a19);});};AGIVertices[_0x43c9('0x13')]['restAPI']=function(_0x566b51,_0x3df13b){var _0x40151f={'uri':_0x566b51['url'],'method':_0x566b51[_0x43c9('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x566b51['timeout'])==='number'&&parseInt(_0x566b51[_0x43c9('0x68')])>=0x1?parseInt(_0x566b51['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x43c9('0x69')]([_0x43c9('0x6a'),'PUT'],_0x40151f[_0x43c9('0x67')]['toUpperCase']())){try{_0x40151f[_0x43c9('0x6b')]=_0x566b51[_0x43c9('0xd')]?JSON['parse'](_0x566b51['rawBody']):{};}catch(_0x5a4d1b){logger[_0x43c9('0x33')](_0x43c9('0x6c'),_0x5a4d1b);}}try{_0x40151f[_0x43c9('0x6d')]=_0x566b51[_0x43c9('0xc')]?JSON[_0x43c9('0x6e')](_0x566b51['rawHeaders']):{};}catch(_0x1e930f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1e930f);}if(_0x566b51['computedVariables']){try{var _0x3e23e0=require(_0x566b51[_0x43c9('0x6f')])[_0x43c9('0x70')](this,_0x40151f);_0x40151f[_0x43c9('0x71')]=Mustache[_0x43c9('0x72')](_0x566b51[_0x43c9('0x73')],_0x3e23e0,{},['$$','$$']);if(_0x40151f[_0x43c9('0x6d')]){_0x40151f['headers']=JSON['parse'](Mustache[_0x43c9('0x72')](JSON[_0x43c9('0x74')](_0x40151f[_0x43c9('0x6d')]),_0x3e23e0,{},['$$','$$']));}if(_0x40151f[_0x43c9('0x6b')]){_0x40151f[_0x43c9('0x6b')]=JSON[_0x43c9('0x6e')](Mustache[_0x43c9('0x72')](JSON[_0x43c9('0x74')](_0x40151f[_0x43c9('0x6b')]),_0x3e23e0,{},['$$','$$']));}}catch(_0x341f60){logger[_0x43c9('0x33')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x341f60);}}rp(_0x40151f)[_0x43c9('0x17')](function(_0x1db11e){var _0x1cb3a3={'statusCode':_0x1db11e['statusCode']||0xc8,'statusMessage':_0x1db11e[_0x43c9('0x75')]||'OK','headers':_0x1db11e[_0x43c9('0x6d')]||{},'body':_0x1db11e[_0x43c9('0x6b')]||{}};_0x3df13b(null,_0x1cb3a3);})['catch'](function(_0x1058b6){var _0x373d05={'statusCode':_0x1058b6[_0x43c9('0x76')]||0x1f4,'statusMessage':_0x1058b6[_0x43c9('0x77')]||_0x43c9('0x78'),'headers':_0x1058b6[_0x43c9('0x79')][_0x43c9('0x6d')]||{},'body':_0x1058b6['options'][_0x43c9('0x6b')]||{}};_0x3df13b(null,_0x373d05);});};AGIVertices['prototype']['googleDialogflow']=function(_0x3a99c7,_0x5e5cc2){scripts[_0x43c9('0x7a')](this[_0x43c9('0x11')][_0x43c9('0x3f')],_0x3a99c7['key'],_0x3a99c7[_0x43c9('0x63')],_0x3a99c7['dialogflow_language']||'en')[_0x43c9('0x17')](function(_0x28b907){_0x5e5cc2(null,_0x28b907);})[_0x43c9('0x19')](function(_0x2bfc87){_0x5e5cc2(_0x2bfc87);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x7b')]=function(_0x28e816,_0x1ecfbe){scripts[_0x43c9('0x7b')](this[_0x43c9('0x11')][_0x43c9('0x3f')],_0x28e816[_0x43c9('0x7c')],_0x28e816[_0x43c9('0x7d')],_0x28e816[_0x43c9('0x7e')],_0x28e816[_0x43c9('0x63')],_0x28e816[_0x43c9('0x7f')]||'en')[_0x43c9('0x17')](function(_0x13deef){_0x1ecfbe(null,_0x13deef);})[_0x43c9('0x19')](function(_0xd61d2b){_0x1ecfbe(_0xd61d2b);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x80')]=function(_0x1f67cc,_0x8f3482){scripts[_0x43c9('0x80')](this[_0x43c9('0x11')],_0x1f67cc)[_0x43c9('0x17')](function(_0x1d9f1a){_0x8f3482(null,_0x1d9f1a);})[_0x43c9('0x19')](function(_0x3e1557){_0x8f3482(_0x3e1557);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x81')]=function(_0x4110c3,_0x15eb1e){scripts[_0x43c9('0x81')](_0x4110c3[_0x43c9('0x82')],_0x4110c3[_0x43c9('0x63')],_0x4110c3[_0x43c9('0x83')]||_0x43c9('0x84'),_0x4110c3[_0x43c9('0x85')])[_0x43c9('0x17')](function(_0x1e1402){_0x15eb1e(null,_0x1e1402);})[_0x43c9('0x19')](function(_0x3e9eb1){_0x15eb1e(_0x3e9eb1);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x86')]=function(_0x21011d,_0x14cb0c,_0x10522e){scripts['ispeechASR'](_0x14cb0c,_0x21011d[_0x43c9('0x82')],_0x21011d[_0x43c9('0x87')]||_0x43c9('0x84'),this[_0x43c9('0x88')](_0x21011d[_0x43c9('0x89')])?_0x21011d[_0x43c9('0x89')]:undefined)['then'](function(_0x296d48){_0x10522e(null,_0x296d48);})['catch'](function(_0x2d0ead){_0x10522e(_0x2d0ead);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x8a')]=function(_0x10f6f8,_0x36e8e5){scripts[_0x43c9('0x8a')](_0x10f6f8['aws_access_key_id'],_0x10f6f8[_0x43c9('0x8b')],_0x10f6f8[_0x43c9('0x8c')],_0x10f6f8[_0x43c9('0x8d')]||_0x43c9('0x8e'),_0x10f6f8[_0x43c9('0x63')],_0x10f6f8[_0x43c9('0x8f')]||_0x43c9('0x63'))[_0x43c9('0x17')](function(_0x345593){_0x36e8e5(null,_0x345593);})[_0x43c9('0x19')](function(_0x1a210c){_0x36e8e5(_0x1a210c);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x90')]=function(_0x813549,_0x505d6b){scripts['awsLex'](this[_0x43c9('0x11')][_0x43c9('0x3f')],_0x813549[_0x43c9('0x91')],_0x813549['aws_secret_access_key'],_0x813549[_0x43c9('0x92')],_0x813549[_0x43c9('0x63')],_0x813549[_0x43c9('0x93')])['then'](function(_0x3c3c4f){_0x505d6b(null,_0x3c3c4f);})['catch'](function(_0x1a23f4){_0x505d6b(_0x1a23f4);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x94')]=function(_0x1884c0,_0x41adea,_0x209670){scripts[_0x43c9('0x94')](_0x41adea,_0x1884c0[_0x43c9('0x82')],_0x1884c0['google_asr_language']||_0x43c9('0x84'))[_0x43c9('0x17')](function(_0x4a69cf){_0x209670(null,_0x4a69cf);})['catch'](function(_0x53dfd1){_0x209670(_0x53dfd1);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x95')]=function(_0x3b52e4,_0x49bd0a,_0x1d4c49){scripts[_0x43c9('0x95')](_0x49bd0a,_0x3b52e4[_0x43c9('0x96')],_0x3b52e4[_0x43c9('0x97')],_0x3b52e4[_0x43c9('0x71')])['then'](function(_0x3ceb38){_0x1d4c49(null,_0x3ceb38);})[_0x43c9('0x19')](function(_0x5ce23a){_0x1d4c49(_0x5ce23a);});};AGIVertices[_0x43c9('0x13')][_0x43c9('0x98')]=function(_0x5d5987){var _0x41348f=_[_0x43c9('0x69')](verticesWithRetry,_0x5d5987[_0x43c9('0x41')])?_0x5d5987:_[_0x43c9('0x99')](_0x5d5987);for(var _0x2fcca2 in _0x41348f){if(_0x41348f[_0x43c9('0x9a')](_0x2fcca2)){if(_0x41348f[_0x2fcca2]&&_[_0x43c9('0x9b')](_0x41348f[_0x2fcca2])){if(_[_0x43c9('0x69')](recursiveMapAttributes,_0x2fcca2)){_0x41348f[_0x2fcca2]=this[_0x43c9('0x9c')](_0x41348f[_0x2fcca2]);}else{_0x41348f[_0x2fcca2]=this[_0x43c9('0x9d')](_0x41348f[_0x2fcca2]);}}}}return _0x41348f;};AGIVertices[_0x43c9('0x13')][_0x43c9('0x9e')]=function(_0x2772db){for(var _0x529593 in _0x2772db){if(_0x2772db[_0x43c9('0x9a')](_0x529593)){if(_[_0x43c9('0x9f')](_0x2772db[_0x529593])){this[_0x43c9('0x9e')](_0x2772db[_0x529593]);}else if(_['isArray'](_0x2772db[_0x529593])){for(var _0x55e332=0x0;_0x55e332<_0x2772db[_0x529593][_0x43c9('0xa0')];_0x55e332++){this['recursiveNodeIndex'](_0x2772db[_0x529593][_0x55e332]);}}else if(_[_0x43c9('0x9b')](_0x2772db[_0x529593])){_0x2772db[_0x529593]=this[_0x43c9('0x9d')](_0x2772db[_0x529593]);}}}};AGIVertices[_0x43c9('0x13')]['saveRestApiResult']=function(_0x496840,_0x5555ad){for(var _0x4bce95 in _0x496840){if(_0x496840[_0x43c9('0x9a')](_0x4bce95)){if(_[_0x43c9('0x9f')](_0x496840[_0x4bce95])){if(!_['isEmpty'](_0x496840[_0x4bce95])){this[_0x43c9('0xa1')](_0x496840[_0x4bce95],util[_0x43c9('0x2f')](_0x43c9('0xa2'),_0x5555ad,_0x4bce95));}}else if(_['isArray'](_0x496840[_0x4bce95])){for(var _0xbae8d0=0x0;_0xbae8d0<_0x496840[_0x4bce95]['length'];_0xbae8d0++){this['saveRestApiResult'](_0x496840[_0x4bce95][_0xbae8d0],util[_0x43c9('0x2f')](_0x43c9('0xa2'),_0x5555ad,_0x4bce95+'['+_0xbae8d0+']'));}}else{if(!_['isNil'](_0x496840[_0x4bce95])){this[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')](_0x43c9('0xa2'),_0x5555ad,_0x4bce95),_0x496840[_0x4bce95]);}}}}};AGIVertices[_0x43c9('0x13')][_0x43c9('0x9c')]=function(_0x4707cc){try{var _0x540cf3=JSON[_0x43c9('0x6e')](_0x4707cc);this[_0x43c9('0x9e')](_0x540cf3);return JSON['stringify'](_0x540cf3);}catch(_0x57fa47){return this[_0x43c9('0x9d')](_0x4707cc);}};AGIVertices['prototype'][_0x43c9('0x9d')]=function(_0x48a18f){var _0x7e5beb=_0x48a18f[_0x43c9('0xa4')]('{');for(var _0x5dbf8d=0x1;_0x5dbf8d<_0x7e5beb['length'];_0x5dbf8d+=0x1){var _0x432fff=_0x7e5beb[_0x5dbf8d][_0x43c9('0xa4')]('}');if(_0x432fff[_0x43c9('0xa0')]>0x1){_0x48a18f=_0x48a18f[_0x43c9('0xa5')]('{'+_0x432fff[0x0]+'}',this[_0x43c9('0x11')][_0x43c9('0x14')](_0x432fff[0x0])[_0x43c9('0xa6')]||_0x432fff[0x0]);}}if(_0x7e5beb[_0x43c9('0xa0')]===0x1){return _0x48a18f[_0x43c9('0x54')]();}return this[_0x43c9('0x9d')](_0x48a18f);};AGIVertices['prototype'][_0x43c9('0xa7')]=function(_0x547578,_0xffbefb){var _0x5697c3=this[_0x43c9('0x11')][_0x43c9('0x14')](_0x547578);if(_0x5697c3[_0x43c9('0xa8')]===-0x1){return _0x5697c3;}logger[_0x43c9('0x35')](util['format'](_0x43c9('0xa9'),_0xffbefb,_0x5697c3[_0x43c9('0xa6')]));return this[_0x43c9('0x11')][_0x43c9('0xa3')](_0xffbefb,_0x5697c3[_0x43c9('0xa6')]);};AGIVertices[_0x43c9('0x13')][_0x43c9('0x88')]=function(_0x50a00e){return _0x50a00e&&_0x50a00e!=='0'&&_0x50a00e!=='-1'&&_0x50a00e!=='';};AGIVertices[_0x43c9('0x13')]['maxRetry']=function(_0x7ea24b){this['createSquareDetailsReport'][_0x43c9('0x70')](this,_0x7ea24b,'-');_0x7ea24b[_0x43c9('0xaa')]=_0x7ea24b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x43c9('0x13')][_0x43c9('0xab')]=function(_0x12157d){logger['info'](util[_0x43c9('0x2f')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x12157d[_0x43c9('0x40')]));if(!this['isConfigured'](_0x12157d[_0x43c9('0x63')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xad'));}var _0x94966d='\x22'+_0x12157d[_0x43c9('0x63')]+'\x22';if(this['isConfigured'](_0x12157d[_0x43c9('0x79')])){_0x94966d+=','+_0x12157d[_0x43c9('0x79')];}var _0x56bc3d=this['channel'][_0x43c9('0x5e')](_0x43c9('0xae'),_0x94966d);if(_0x56bc3d[_0x43c9('0xa8')]===-0x1){return _0x56bc3d;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xaf'),_0x94966d));};AGIVertices[_0x43c9('0x13')]['mrcprecog']=function(_0x19d2e2){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xb0'),_0x19d2e2['label']));if(!this['isConfigured'](_0x19d2e2['grammar'])){return this[_0x43c9('0x11')]['noop'](_0x43c9('0xb1'));}var _0x461ad9=_0x19d2e2['grammar'];if(this[_0x43c9('0x88')](_0x19d2e2[_0x43c9('0x79')])){_0x461ad9+=','+_0x19d2e2[_0x43c9('0x79')];}var _0x1ef01b=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xb2'),_0x461ad9);if(_0x1ef01b['result']===-0x1){return _0x1ef01b;}var _0x3d5f9a=this[_0x43c9('0xa7')](_0x43c9('0xb3'),_0x43c9('0xb4'));if(_0x3d5f9a['result']===-0x1){return _0x3d5f9a;}var _0x380859=this[_0x43c9('0xa7')]('RECOG_INPUT()',_0x43c9('0xb5'));if(_0x380859[_0x43c9('0xa8')]===-0x1){return _0x380859;}var _0x20857b=this[_0x43c9('0xa7')](_0x43c9('0xb6'),_0x43c9('0xb7'));if(_0x20857b[_0x43c9('0xa8')]===-0x1){return _0x20857b;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('Executed\x20command\x20MRCPRecog\x20%s',_0x461ad9));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x9')]=function(_0x52317a){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xb8'),_0x52317a[_0x43c9('0x40')]));return this[_0x43c9('0x11')][_0x43c9('0x9')]([_0x52317a[_0x43c9('0xb9')],_0x52317a[_0x43c9('0xba')]]);};AGIVertices[_0x43c9('0x13')][_0x43c9('0xbb')]=function(_0x232f01){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xbc'),_0x232f01['label']));if(this[_0x43c9('0x88')](_0x232f01['timeout'])){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x232f01[_0x43c9('0x68')]));var _0x132e9d=this[_0x43c9('0x11')][_0x43c9('0xbd')](_0x232f01[_0x43c9('0x68')]);if(_0x132e9d[_0x43c9('0xa8')]===-0x1){return _0x132e9d;}}return this[_0x43c9('0x11')][_0x43c9('0xbb')]();};AGIVertices[_0x43c9('0x13')]['callback']=function(_0x6eec7a){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xbe'),_0x6eec7a[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x6eec7a[_0x43c9('0xbf')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x6eec7a,_0x43c9('0xc0'));}_0x6eec7a[_0x43c9('0x51')]=moment();if(this[_0x43c9('0x88')](_0x6eec7a[_0x43c9('0xc1')])){_0x6eec7a[_0x43c9('0x51')]=moment()['add'](_0x6eec7a[_0x43c9('0xc1')],_0x43c9('0xc2'));}if(!this[_0x43c9('0x88')](_0x6eec7a[_0x43c9('0x55')])){_0x6eec7a[_0x43c9('0x55')]=0x2;}this[_0x43c9('0x4c')][_0x43c9('0x70')](this,_0x6eec7a);return this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0xc3'),_0x6eec7a[_0x43c9('0xc4')],_0x6eec7a[_0x43c9('0xbf')],_0x6eec7a[_0x43c9('0x51')]));};AGIVertices[_0x43c9('0x13')]['custom_app']=function(_0x5b3587){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0xc5'),_0x5b3587['label']));var _0x3ba284=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x5b3587[_0x43c9('0xc6')],_0x5b3587[_0x43c9('0x79')]);if(_0x3ba284[_0x43c9('0xa8')]===-0x1){return _0x3ba284;}return this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xc7'),_0x5b3587[_0x43c9('0xc6')],_0x5b3587[_0x43c9('0x79')]));};AGIVertices[_0x43c9('0x13')]['lumenvoxtts']=function(_0x3d1b8b){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xc8'),_0x3d1b8b[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x3d1b8b[_0x43c9('0x63')])){return this['channel'][_0x43c9('0xac')]('no\x20text\x20configured');}var _0x4c9e8a='\x22'+_0x3d1b8b[_0x43c9('0x63')]+'\x22';if(this[_0x43c9('0x88')](_0x3d1b8b[_0x43c9('0x79')])){_0x4c9e8a+=','+_0x3d1b8b[_0x43c9('0x79')];}var _0xa6bd14=this[_0x43c9('0x11')]['exec']('MRCPSynth',_0x4c9e8a);if(_0xa6bd14[_0x43c9('0xa8')]===-0x1){return _0xa6bd14;}return this['channel']['noop'](util['format'](_0x43c9('0xaf'),_0x4c9e8a));};AGIVertices['prototype'][_0x43c9('0xc9')]=function(_0x3cf418){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xca'),_0x3cf418[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x3cf418[_0x43c9('0x63')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xad'));}var _0x211c7c='\x22'+_0x3cf418[_0x43c9('0x63')]+'\x22';if(this[_0x43c9('0x88')](_0x3cf418[_0x43c9('0x79')])){_0x211c7c+=','+_0x3cf418['options'];}var _0x17e536=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xae'),_0x211c7c);if(_0x17e536[_0x43c9('0xa8')]===-0x1){return _0x17e536;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xaf'),_0x211c7c));};AGIVertices['prototype'][_0x43c9('0xcb')]=function(_0x19a349){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xcc'),_0x19a349[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x19a349['grammar'])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xb1'));}var _0x4df281=_0x19a349[_0x43c9('0xcd')];if(this[_0x43c9('0x88')](_0x19a349[_0x43c9('0x79')])){_0x4df281+=','+_0x19a349[_0x43c9('0x79')];}var _0x295f9c=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xb2'),_0x4df281);if(_0x295f9c[_0x43c9('0xa8')]===-0x1){return _0x295f9c;}var _0xabbc1e=this[_0x43c9('0xa7')](_0x43c9('0xb3'),_0x43c9('0xce'));if(_0xabbc1e[_0x43c9('0xa8')]===-0x1){return _0xabbc1e;}var _0x8c6f0e=this[_0x43c9('0xa7')](_0x43c9('0xcf'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x8c6f0e[_0x43c9('0xa8')]===-0x1){return _0x8c6f0e;}var _0x94b2c6=this[_0x43c9('0xa7')]('RECOG_INSTANCE()',_0x43c9('0xd0'));if(_0x94b2c6[_0x43c9('0xa8')]===-0x1){return _0x94b2c6;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xd1'),_0x4df281));};AGIVertices[_0x43c9('0x13')]['sestekasr']=function(_0x39d05d){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xd2'),_0x39d05d[_0x43c9('0x40')]));if(!this['isConfigured'](_0x39d05d[_0x43c9('0xcd')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xb1'));}var _0x3198dc=_0x39d05d[_0x43c9('0xcd')];if(this['isConfigured'](_0x39d05d[_0x43c9('0x79')])){_0x3198dc+=','+_0x39d05d[_0x43c9('0x79')];}var _0x11577b=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xb2'),_0x3198dc);if(_0x11577b['result']===-0x1){return _0x11577b;}var _0x398e85=this[_0x43c9('0xa7')](_0x43c9('0xb3'),_0x43c9('0xd3'));if(_0x398e85[_0x43c9('0xa8')]===-0x1){return _0x398e85;}var _0x1bd8db=this[_0x43c9('0xa7')]('RECOG_INPUT()',_0x43c9('0xd4'));if(_0x1bd8db[_0x43c9('0xa8')]===-0x1){return _0x1bd8db;}var _0x1d58f2=this[_0x43c9('0xa7')](_0x43c9('0xb6'),_0x43c9('0xd5'));if(_0x1d58f2[_0x43c9('0xa8')]===-0x1){return _0x1d58f2;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xd1'),_0x3198dc));};AGIVertices[_0x43c9('0x13')][_0x43c9('0xd6')]=function(_0x5cd9d0){logger[_0x43c9('0x35')](util['format'](_0x43c9('0xd7'),_0x5cd9d0[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x5cd9d0[_0x43c9('0xd8')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x5cd9d0,_0x43c9('0xd9'));}var _0x48bbb5=this[_0x43c9('0x1c')][_0x43c9('0x70')](this,_0x5cd9d0[_0x43c9('0xd8')]);if(!_0x48bbb5){return this['channel'][_0x43c9('0x33')](_0x5cd9d0,_0x43c9('0xda'));}if(!this[_0x43c9('0x88')](_0x5cd9d0[_0x43c9('0x37')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x5cd9d0,_0x43c9('0xdb'));}var _0x21509a=_0x5cd9d0[_0x43c9('0x37')][_0x43c9('0x60')](/(\r\n|\n|\r)/gm,'\x20');this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xdc'),_0x21509a));var _0x3c1b51=this['getQueryOdbc'][_0x43c9('0x70')](this,_0x48bbb5,_0x21509a);this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x5cd9d0,_0x21509a);if(!this[_0x43c9('0x88')](_0x5cd9d0[_0x43c9('0xdd')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xde'));}var _0x4b003c=this[_0x43c9('0x14')][_0x43c9('0x70')](this,_0x5cd9d0['variable_id']);if(!_0x4b003c){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x5cd9d0,'no\x20variable\x20found');}var _0x513f34=this;_0x3c1b51['forEach'](function(_0x556f0a,_0xb6bdfe){Object[_0x43c9('0xdf')](_0x556f0a)[_0x43c9('0xe0')](function(_0x354801){_0x513f34[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')]('%s[%s][%s]',_0x4b003c,_0xb6bdfe,_0x354801),_0x556f0a[_0x354801]);});});this[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')](_0x43c9('0xe1'),_0x4b003c),_0x3c1b51['length']);return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('variable\x20%s\x20set',_0x4b003c));};AGIVertices[_0x43c9('0x13')][_0x43c9('0xe2')]=function(_0x4b96f3){logger[_0x43c9('0xe3')](util[_0x43c9('0x2f')](_0x43c9('0xe4'),_0x4b96f3[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x4b96f3['sip_id'])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x4b96f3,_0x43c9('0xe5'));}var _0x171c84=this[_0x43c9('0x1f')]['sync'](this,_0x4b96f3[_0x43c9('0xe6')]);if(!_0x171c84){return this['channel'][_0x43c9('0x33')](_0x4b96f3,_0x43c9('0xe7'));}var _0x1f9006=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xe8'),[util[_0x43c9('0x2f')](_0x43c9('0xe9'),_0x171c84),_0x4b96f3[_0x43c9('0x68')],_0x4b96f3[_0x43c9('0xea')],_0x4b96f3[_0x43c9('0x73')]]);if(_0x1f9006['result']===-0x1){return _0x1f9006;}return this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')]('Executed\x20command\x20%s',_0x43c9('0xe8')));};AGIVertices['prototype']['dialogflow']=function(_0x58309d){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0xeb'),_0x58309d['label']));if(!this[_0x43c9('0x88')](_0x58309d['key'])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xec'));}if(!this[_0x43c9('0x88')](_0x58309d[_0x43c9('0x63')])){return this['channel'][_0x43c9('0xac')]('no\x20text\x20configured');}this[_0x43c9('0x11')][_0x43c9('0xed')]=!![];this[_0x43c9('0x3e')](_0x58309d);this[_0x43c9('0x4b')](_0x58309d[_0x43c9('0x63')],'in','','');this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0xee'),_0x58309d[_0x43c9('0x63')]));var _0x4303b6=this['googleDialogflow'][_0x43c9('0x70')](this,_0x58309d);if(_0x4303b6){for(var _0x10e9a1 in _0x4303b6){if(_0x4303b6[_0x43c9('0x9a')](_0x10e9a1)){this[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')]('DIALOGFLOW_%s',_0x10e9a1[_0x43c9('0xef')]()),_0x4303b6[_0x10e9a1]);}}this[_0x43c9('0x4b')](_0x4303b6['speech'],_0x43c9('0xf0'),'dialogflow','');return this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')]('Dialogflow\x20Result\x20%s',_0x4303b6['speech']));}return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x58309d,_0x43c9('0xf1'));};AGIVertices[_0x43c9('0x13')][_0x43c9('0xf2')]=function(_0x31f5a2){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x31f5a2[_0x43c9('0x40')]));if(!this['isConfigured'](_0x31f5a2[_0x43c9('0x7c')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xf3'));}if(!this['isConfigured'](_0x31f5a2[_0x43c9('0x7d')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xf4'));}if(!this[_0x43c9('0x88')](_0x31f5a2[_0x43c9('0x7e')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xf5'));}if(!this[_0x43c9('0x88')](_0x31f5a2[_0x43c9('0x7f')])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xf6'));}if(!this[_0x43c9('0x88')](_0x31f5a2['text'])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xad'));}this[_0x43c9('0x11')]['bot']=!![];this[_0x43c9('0x3e')](_0x31f5a2);this[_0x43c9('0x4b')](_0x31f5a2[_0x43c9('0x63')],'in','','');this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0xf7'),_0x31f5a2['text']));var _0x2bd129=this[_0x43c9('0x7b')]['sync'](this,_0x31f5a2);if(_0x2bd129){for(var _0x33acf1 in _0x2bd129){if(_0x2bd129[_0x43c9('0x9a')](_0x33acf1)){if(_0x33acf1!==_0x43c9('0xf8')){this[_0x43c9('0x11')]['setVariable'](util['format'](_0x43c9('0xf9'),_0x33acf1[_0x43c9('0xef')]()),_0x2bd129[_0x33acf1]);}}}this[_0x43c9('0x4b')](_0x2bd129['speech'],_0x43c9('0xf0'),_0x43c9('0xf2'),_0x2bd129['providerResponse']);return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0xfa'),_0x2bd129['speech']));}return this['channel'][_0x43c9('0x33')](_0x31f5a2,_0x43c9('0xfb'));};AGIVertices['prototype']['sesteknda']=function(_0x292038){logger['info'](util[_0x43c9('0x2f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x292038[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x292038[_0x43c9('0xfc')])){return this[_0x43c9('0x11')]['noop'](_0x43c9('0xfd'));}if(!this[_0x43c9('0x88')](_0x292038['username'])){return this['channel']['noop']('no\x20username\x20configured');}if(!this[_0x43c9('0x88')](_0x292038['password'])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xfe'));}if(!this[_0x43c9('0x88')](_0x292038[_0x43c9('0xff')])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xad'));}this['channel'][_0x43c9('0xed')]=!![];this[_0x43c9('0x3e')](_0x292038);this[_0x43c9('0x4b')](_0x292038[_0x43c9('0x63')],'in','','');this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x100'),_0x292038[_0x43c9('0x63')]));var _0x1947c0=this['sestekNDA'][_0x43c9('0x70')](this,_0x292038);if(_0x1947c0){for(var _0x3614ea in _0x1947c0){if(_0x1947c0['hasOwnProperty'](_0x3614ea)){this[_0x43c9('0x11')][_0x43c9('0xa3')](util['format']('SESTEK_NDA_%s',_0x3614ea[_0x43c9('0xef')]()),_0x1947c0[_0x3614ea]);}}this[_0x43c9('0x4b')](_0x1947c0[_0x43c9('0x101')],'out',_0x43c9('0x102'),'');if(_0x1947c0[_0x43c9('0x103')]){this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1947c0[_0x43c9('0x103')]));var _0x425cbf=this[_0x43c9('0x11')][_0x43c9('0x104')](_0x1947c0['audiofile']);try{fs['unlink'](_0x1947c0[_0x43c9('0x103')]+_0x43c9('0x105'));}catch(_0xd8e0a6){logger[_0x43c9('0x33')](_0xd8e0a6);}return _0x425cbf;}else{return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('SestekNDA\x20Result\x20%s',_0x1947c0[_0x43c9('0x101')]));}}return this[_0x43c9('0x11')]['error'](_0x292038,_0x43c9('0x106'));};AGIVertices[_0x43c9('0x13')]['end']=function(_0x411dce){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x107'),_0x411dce[_0x43c9('0x40')]));return this[_0x43c9('0x11')]['noop'](_0x43c9('0x108'));};AGIVertices['prototype'][_0x43c9('0x109')]=function(_0x10af39){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x10af39['label']));var _0x8ad6ba='';if(_0x10af39[_0x43c9('0x10a')]){if(!this[_0x43c9('0x88')](_0x10af39[_0x43c9('0x10a')])){return this[_0x43c9('0x11')]['error'](_0x10af39,_0x43c9('0x10b'));}else{var _0x5c9a24=parseInt(_0x10af39[_0x43c9('0x10a')],0xa);if(isNaN(_0x5c9a24)){_0x8ad6ba=_0x10af39[_0x43c9('0x10a')];}else{_0x8ad6ba=this[_0x43c9('0x21')][_0x43c9('0x70')](this,_0x10af39[_0x43c9('0x10a')]);if(!_0x8ad6ba){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x10af39,_0x43c9('0x10c'));}}}}else if(_0x10af39[_0x43c9('0x10d')]){_0x8ad6ba=_0x10af39[_0x43c9('0x10d')];}else{return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x10af39,_0x43c9('0x10b'));}var _0x2bcba7=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0xe8'),[util[_0x43c9('0x2f')]('SIP/%s/%s',_0x8ad6ba,_0x10af39['phone']),_0x10af39['timeout'],_0x10af39[_0x43c9('0xea')],_0x10af39[_0x43c9('0x73')]]);if(_0x2bcba7[_0x43c9('0xa8')]===-0x1){return _0x2bcba7;}return this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x10e'),_0x43c9('0xe8')));};AGIVertices['prototype']['finally']=function(_0x321c66){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x10f'),_0x321c66[_0x43c9('0x40')]));return this[_0x43c9('0x11')][_0x43c9('0xac')]('finally');};AGIVertices['prototype'][_0x43c9('0xf')]=function(_0xdf5fd6){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0xdf5fd6[_0x43c9('0x40')]));if(_0xdf5fd6[_0x43c9('0xaa')]===0x0){return this[_0x43c9('0x110')](_0xdf5fd6);}_0xdf5fd6[_0x43c9('0xaa')]-=0x1;if(!this['isConfigured'](_0xdf5fd6[_0x43c9('0x111')])){return this[_0x43c9('0x11')]['error'](_0xdf5fd6,_0x43c9('0x112'));}var _0x4870eb=this[_0x43c9('0x23')][_0x43c9('0x70')](this,_0xdf5fd6[_0x43c9('0x111')]);if(!_0x4870eb){return this['channel'][_0x43c9('0x33')](_0xdf5fd6,_0x43c9('0x113'));}if(!this[_0x43c9('0x88')](_0xdf5fd6[_0x43c9('0xdd')])){return this[_0x43c9('0x11')][_0x43c9('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1513fc=this[_0x43c9('0x11')][_0x43c9('0x114')](_0x4870eb,_0xdf5fd6[_0x43c9('0x115')],_0xdf5fd6[_0x43c9('0x116')]);var _0x59d091=_0x1513fc[_0x43c9('0xa8')]?_0x1513fc[_0x43c9('0xa8')][_0x43c9('0x54')]():'';logger[_0x43c9('0x35')](_0x43c9('0x117'),JSON[_0x43c9('0x74')](_0x1513fc));if(_0x1513fc['result']===-0x1){this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0xdf5fd6,_0x59d091);return _0x1513fc;}else if(_0x1513fc[_0x43c9('0xa6')]===_0x43c9('0x68')){_0x1513fc[_0x43c9('0xa8')]=_0x59d091[_0x43c9('0xa0')]>=parseInt(_0xdf5fd6['mindigit'])?'x':'i';}else{_0x1513fc[_0x43c9('0xa8')]=_0x59d091['length']>=parseInt(_0xdf5fd6[_0x43c9('0x118')])&&_0x59d091[_0x43c9('0xa0')]<=parseInt(_0xdf5fd6['maxdigit'])?'x':'i';}var _0x5092e4=this[_0x43c9('0x14')][_0x43c9('0x70')](this,_0xdf5fd6[_0x43c9('0xdd')]);if(!_0x5092e4){return this['channel'][_0x43c9('0x33')](_0xdf5fd6,_0x43c9('0x119'));}this[_0x43c9('0x11')][_0x43c9('0xa3')](_0x5092e4,_0x59d091);if(this[_0x43c9('0x88')](_0xdf5fd6[_0x43c9('0x11a')])){var _0x404836=parseInt(_0xdf5fd6[_0x43c9('0x11a')],0xa);var _0x5ab352=rs[_0x43c9('0x11b')]({'charset':'*','length':_0x404836});var _0x3de3ee=_0x59d091[_0x43c9('0xa0')];if(_0x3de3ee>0x0){if(_0x3de3ee>_0x404836){this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0xdf5fd6,_0xdf5fd6[_0x43c9('0x11c')]==='first'?_0x5ab352+_0x59d091['substr'](_0x404836):_0x59d091['substr'](0x0,_0x3de3ee-_0x404836)+_0x5ab352);}else{this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0xdf5fd6,rs[_0x43c9('0x11b')]({'charset':'*','length':_0x3de3ee}));}}else{this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0xdf5fd6,'');}}else{this[_0x43c9('0x3e')]['sync'](this,_0xdf5fd6,_0x59d091);}return _0x1513fc;};AGIVertices[_0x43c9('0x13')]['getsecretdigits']=function(_0x5bbbed){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5bbbed[_0x43c9('0x40')]));return this['getdigits'](_0x5bbbed);};AGIVertices[_0x43c9('0x13')]['goal']=function(_0x354a24){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x11d'),_0x354a24[_0x43c9('0x40')]));this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x354a24,_0x354a24[_0x43c9('0x11e')]);return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x11f'),_0x354a24['goalname']));};AGIVertices['prototype'][_0x43c9('0x120')]=function(_0x28cc04){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x121'),_0x28cc04[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x28cc04[_0x43c9('0x91')])||!this[_0x43c9('0x88')](_0x28cc04[_0x43c9('0x8b')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x122'));}if(!this['isConfigured'](_0x28cc04[_0x43c9('0x63')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xad'));}this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('Trying\x20aws\x20Polly\x20%s',_0x28cc04[_0x43c9('0x63')]));var _0x414d14=this[_0x43c9('0x8a')][_0x43c9('0x70')](this,_0x28cc04);if(_0x414d14){this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')]('aws\x20Polly\x20%s\x20file\x20created',_0x414d14));var _0x5ee70e=this[_0x43c9('0x11')][_0x43c9('0x104')](_0x414d14);try{fs['unlink'](_0x414d14+_0x43c9('0x105'));}catch(_0x3aa8a7){logger['error'](_0x3aa8a7);}return _0x5ee70e;}return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x28cc04,_0x43c9('0x123'));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x124')]=function(_0x5e2226){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x125'),_0x5e2226[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x5e2226['aws_access_key_id'])||!this[_0x43c9('0x88')](_0x5e2226[_0x43c9('0x8b')])){return this['channel']['noop'](_0x43c9('0x122'));}if(!this['isConfigured'](_0x5e2226[_0x43c9('0x93')])){return this[_0x43c9('0x11')]['noop'](_0x43c9('0x126'));}if(!this[_0x43c9('0x88')](_0x5e2226[_0x43c9('0x63')])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xad'));}this['channel'][_0x43c9('0xed')]=!![];this[_0x43c9('0x3e')](_0x5e2226);this[_0x43c9('0x4b')](_0x5e2226[_0x43c9('0x63')],'in','','');this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x127'),_0x5e2226[_0x43c9('0x63')]));var _0x4e4a98=this[_0x43c9('0x90')][_0x43c9('0x70')](this,_0x5e2226);if(_0x4e4a98){for(var _0x1a155e in _0x4e4a98){if(_0x4e4a98[_0x43c9('0x9a')](_0x1a155e)&&_['isString'](_0x4e4a98[_0x1a155e])){this[_0x43c9('0x11')]['setVariable'](util[_0x43c9('0x2f')]('AWS_LEX_%s',_0x1a155e[_0x43c9('0xef')]()),_0x4e4a98[_0x1a155e]);}}if(_['isNil'](_0x4e4a98[_0x43c9('0x77')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x128'));}else{this[_0x43c9('0x4b')](_0x4e4a98['message'],_0x43c9('0xf0'),_0x43c9('0x129'),'');return this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0x12a'),_0x4e4a98[_0x43c9('0x77')]));}}return this[_0x43c9('0x11')]['error'](_0x5e2226,_0x43c9('0x12b'));};AGIVertices['prototype'][_0x43c9('0x12c')]=function(_0x2074c6){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x2074c6[_0x43c9('0x40')],_0x2074c6[_0x43c9('0x68')]));if(!this['isConfigured'](_0x2074c6['key'])){return this[_0x43c9('0x11')][_0x43c9('0xac')]('no\x20key\x20configured');}var _0x170c3d=_0x43c9('0x12d');var _0x26a4e7=util[_0x43c9('0x2f')](_0x43c9('0x12e'),FILES_PATH,rs[_0x43c9('0x11b')](0x4));var _0x10a3c2=util['format'](_0x43c9('0xa2'),_0x26a4e7,_0x170c3d);var _0x14dd4c=!![];if(_0x2074c6[_0x43c9('0x12f')]===_0x43c9('0x130')){_0x14dd4c=![];}var _0x5c2489=this[_0x43c9('0x11')][_0x43c9('0x131')](_0x26a4e7,_0x170c3d,_0x2074c6['intKey'],_0x2074c6[_0x43c9('0x68')],undefined,_0x14dd4c);if(_0x5c2489[_0x43c9('0xa8')]!==-0x1){this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0x132'),_0x10a3c2));var _0x1797b3=this[_0x43c9('0x94')][_0x43c9('0x70')](this,_0x2074c6,_0x10a3c2);if(_0x1797b3){for(var _0x2e64ac in _0x1797b3){if(_0x1797b3[_0x43c9('0x9a')](_0x2e64ac)){this[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')](_0x43c9('0x133'),_0x2e64ac[_0x43c9('0xef')]()),_0x1797b3[_0x2e64ac]);}}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x134'),JSON['stringify'](_0x1797b3)));}}return _0x5c2489;};AGIVertices[_0x43c9('0x13')][_0x43c9('0x135')]=function(_0x46435d){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x136'),_0x46435d['label']));if(!this['isConfigured'](_0x46435d[_0x43c9('0x96')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x137'));}if(!this[_0x43c9('0x88')](_0x46435d[_0x43c9('0x97')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x138'));}var _0x5b2fe5=_0x43c9('0x12d');var _0x35c4e7=util['format'](_0x43c9('0x12e'),FILES_PATH,rs[_0x43c9('0x11b')](0x4));var _0x255f2e=util['format'](_0x43c9('0xa2'),_0x35c4e7,_0x5b2fe5);var _0x40317d=!![];if(_0x46435d[_0x43c9('0x12f')]==='NOBEEP'){_0x40317d=![];}var _0x1baa04=this[_0x43c9('0x11')]['recordFile'](_0x35c4e7,_0x5b2fe5,_0x46435d[_0x43c9('0x139')],_0x46435d[_0x43c9('0x68')],undefined,_0x40317d);if(_0x1baa04[_0x43c9('0xa8')]!==-0x1){this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x13a'),_0x255f2e));var _0x3f4b4f=this[_0x43c9('0x95')]['sync'](this,_0x46435d,_0x255f2e);if(_0x3f4b4f){for(var _0x2968fa in _0x3f4b4f){if(_0x3f4b4f[_0x43c9('0x9a')](_0x2968fa)){this[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')](_0x43c9('0x13b'),_0x2968fa['toUpperCase']()),_0x3f4b4f[_0x2968fa]);}}return this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x13c'),JSON[_0x43c9('0x74')](_0x3f4b4f)));}}return _0x1baa04;};AGIVertices[_0x43c9('0x13')][_0x43c9('0x13d')]=function(_0x32ebb0){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x32ebb0['label']));return this[_0x43c9('0x11')]['continueAt'](_0x32ebb0[_0x43c9('0x44')],_0x32ebb0[_0x43c9('0x45')],_0x32ebb0[_0x43c9('0x46')]);};AGIVertices[_0x43c9('0x13')][_0x43c9('0x13e')]=function(_0x4f15d4){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x13f'),_0x4f15d4['label']));if(!this[_0x43c9('0x88')](_0x4f15d4[_0x43c9('0x140')])){return this[_0x43c9('0x11')]['error'](_0x4f15d4,_0x43c9('0x141'));}try{var _0x33d3dc=eval(_0x4f15d4[_0x43c9('0x140')])?_0x43c9('0x142'):_0x43c9('0x143');this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x144'),_0x4f15d4[_0x43c9('0x140')],_0x33d3dc));return{'code':0xc8,'result':_0x33d3dc};}catch(_0x10f9e1){return{'code':0xc8,'result':_0x43c9('0x143')};}};AGIVertices[_0x43c9('0x13')][_0x43c9('0x145')]=function(_0x57bd28){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x57bd28[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x57bd28['interval_id'])){return this['channel'][_0x43c9('0x33')](_0x57bd28,_0x43c9('0x146'));}var _0x366456=this[_0x43c9('0x2a')][_0x43c9('0x70')](this,_0x57bd28['interval_id']);if(!_0x366456){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x57bd28,_0x43c9('0x147'));}for(var _0x38f9b5=0x0;_0x38f9b5<_0x366456[_0x43c9('0xa0')];_0x38f9b5+=0x1){var _0x402f1b=this[_0x43c9('0x11')]['getVariable'](util[_0x43c9('0x2f')]('IFTIME(%s?true:false)',_0x366456[_0x38f9b5]));if(_0x402f1b['result']===-0x1){return _0x402f1b;}logger['info'](util['format'](_0x43c9('0x148'),_0x366456[_0x38f9b5],_0x402f1b['extra']));if(_0x402f1b[_0x43c9('0xa6')]===_0x43c9('0x142')){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x148'),_0x366456[_0x38f9b5],'true'));this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x148'),_0x366456[_0x38f9b5],_0x43c9('0x142')));return{'code':0xc8,'result':'true'};}else{logger[_0x43c9('0x35')](util['format'](_0x43c9('0x148'),_0x366456[_0x38f9b5],_0x43c9('0x143')));this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0x148'),_0x366456[_0x38f9b5],_0x43c9('0x143')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x43c9('0x13')]['hangup']=function(_0x403d1e){logger['info'](util[_0x43c9('0x2f')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x403d1e[_0x43c9('0x40')]));return this[_0x43c9('0x11')]['hangup']();};AGIVertices[_0x43c9('0x13')]['ispeechasr']=function(_0x1ee0c0){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1ee0c0['label']));if(!this[_0x43c9('0x88')](_0x1ee0c0[_0x43c9('0x82')])){return this[_0x43c9('0x11')][_0x43c9('0xac')]('no\x20key\x20configured');}var _0x40ee57=_0x43c9('0x12d');var _0x39290d=util[_0x43c9('0x2f')](_0x43c9('0x12e'),FILES_PATH,rs[_0x43c9('0x11b')](0x4));var _0x2ce0ae=util[_0x43c9('0x2f')](_0x43c9('0xa2'),_0x39290d,_0x40ee57);var _0x46149c=!![];if(_0x1ee0c0[_0x43c9('0x12f')]===_0x43c9('0x130')){_0x46149c=![];}var _0x18cb87=this[_0x43c9('0x11')][_0x43c9('0x131')](_0x39290d,_0x40ee57,_0x1ee0c0[_0x43c9('0x139')],_0x1ee0c0[_0x43c9('0x68')],undefined,_0x46149c);if(_0x18cb87[_0x43c9('0xa8')]!==-0x1){this['channel']['noop'](util['format'](_0x43c9('0x149'),_0x2ce0ae));var _0x2aa8be=this[_0x43c9('0x86')][_0x43c9('0x70')](this,_0x1ee0c0,_0x2ce0ae);if(_0x2aa8be){for(var _0x8f10b2 in _0x2aa8be){if(_0x2aa8be['hasOwnProperty'](_0x8f10b2)){this[_0x43c9('0x11')][_0x43c9('0xa3')](util['format']('ISPEECH_ASR_%s',_0x8f10b2[_0x43c9('0xef')]()),_0x2aa8be[_0x8f10b2]);}}return this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0x14a'),JSON[_0x43c9('0x74')](_0x2aa8be)));}}return _0x18cb87;};AGIVertices[_0x43c9('0x13')]['ispeechtts']=function(_0x4a4b02){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x14b'),_0x4a4b02[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x4a4b02[_0x43c9('0x82')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xec'));}if(!this[_0x43c9('0x88')](_0x4a4b02[_0x43c9('0x63')])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0xad'));}this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('Trying\x20ispeech\x20TTS\x20%s',_0x4a4b02[_0x43c9('0x63')]));var _0x56249d=this[_0x43c9('0x81')][_0x43c9('0x70')](this,_0x4a4b02);if(_0x56249d){this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x149'),_0x56249d));var _0x32ef08=this['channel']['streamFile'](_0x56249d,_0x4a4b02['intKey']);try{fs[_0x43c9('0x14c')](_0x56249d+_0x43c9('0x105'));}catch(_0x5f0069){logger[_0x43c9('0x33')](_0x5f0069);}return _0x32ef08;}return this[_0x43c9('0x11')]['error'](_0x4a4b02,_0x43c9('0x14d'));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x14e')]=function(_0xda555b){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x14f'),_0xda555b[_0x43c9('0x40')]));if(!this['isConfigured'](_0xda555b['findBy'])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0xda555b,_0x43c9('0x150'));}logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x151'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0xda555b[_0x43c9('0x152')]));var _0x5b89e9=this[_0x43c9('0x59')]['sync'](this,_0xda555b['findBy']);if(_0x5b89e9){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x153'),this['channel'][_0x43c9('0x43')],_0xda555b[_0x43c9('0x152')]));this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x43c9('0x43')],_0xda555b[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x154')};}else{logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x155'),this[_0x43c9('0x11')]['callerid'],_0xda555b[_0x43c9('0x152')]));this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0x155'),this[_0x43c9('0x11')]['callerid'],_0xda555b[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x156')};}};AGIVertices[_0x43c9('0x13')][_0x43c9('0x157')]=function(_0x286040){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x158'),_0x286040[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x286040[_0x43c9('0x152')])){return this['channel'][_0x43c9('0x33')](_0x286040,_0x43c9('0x150'));}logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x151'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x286040['findBy']));var _0x5255c0=this['agentLogout'][_0x43c9('0x70')](this,_0x286040[_0x43c9('0x152')]);if(_0x5255c0){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x153'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x286040['findBy']));this[_0x43c9('0x11')][_0x43c9('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x43c9('0x11')][_0x43c9('0x43')],_0x286040[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x154')};}else{logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x155'),this['channel'][_0x43c9('0x43')],_0x286040[_0x43c9('0x152')]));this[_0x43c9('0x11')][_0x43c9('0xac')](util['format'](_0x43c9('0x155'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x286040[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x156')};}};AGIVertices['prototype'][_0x43c9('0x159')]=function(_0x3dcab5){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x15a'),_0x3dcab5[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x3dcab5[_0x43c9('0x15b')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x3dcab5,_0x43c9('0x15c'));}this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0x15d'),_0x3dcab5[_0x43c9('0x15b')]));var _0x4bc89c=eval(_0x3dcab5[_0x43c9('0x15b')]);if(!this[_0x43c9('0x88')](_0x3dcab5[_0x43c9('0xdd')])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xde'));}var _0x4dd8d2=this[_0x43c9('0x14')][_0x43c9('0x70')](this,_0x3dcab5[_0x43c9('0xdd')]);if(!_0x4dd8d2){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x3dcab5,_0x43c9('0x119'));}if(_[_0x43c9('0x15e')](_0x4bc89c)){var _0xb5fb0c=this;_0x4bc89c['forEach'](function(_0x40a178,_0x367086){_0xb5fb0c[_0x43c9('0x11')][_0x43c9('0xa3')](util[_0x43c9('0x2f')]('%s[%s]',_0x4dd8d2,_0x367086),_0x40a178);});return this[_0x43c9('0x11')]['noop'](util['format']('variable\x20%s[key]\x20set',_0x4dd8d2));}else{return this[_0x43c9('0x11')][_0x43c9('0xa3')](_0x4dd8d2,_0x4bc89c);}};AGIVertices['prototype'][_0x43c9('0xe')]=function(_0x382691){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x382691[_0x43c9('0x40')]));if(_0x382691[_0x43c9('0xaa')]===0x0){return this[_0x43c9('0x110')](_0x382691);}_0x382691[_0x43c9('0xaa')]-=0x1;if(!this[_0x43c9('0x88')](_0x382691[_0x43c9('0x111')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x382691,_0x43c9('0x112'));}var _0x327e9d=this['getSound'][_0x43c9('0x70')](this,_0x382691[_0x43c9('0x111')]);if(!_0x327e9d){return this['channel'][_0x43c9('0x33')](_0x382691,'no\x20file\x20audio\x20found');}var _0x3270b5=this['channel'][_0x43c9('0x114')](_0x327e9d,_0x382691['response'],_0x382691['digit']);var _0xb7000d=_0x3270b5[_0x43c9('0xa8')];if(_0x3270b5['result']===-0x1){this['createSquareDetailsReport'][_0x43c9('0x70')](this,_0x382691,'-1');return _0x3270b5;}else if(_0x3270b5[_0x43c9('0xa6')]===_0x43c9('0x68')){_0x3270b5[_0x43c9('0xa8')]=_0x3270b5[_0x43c9('0xa8')]['length']>0x0?_0x3270b5[_0x43c9('0xa8')]:'t';}else if(_[_0x43c9('0x4d')](_0x3270b5['result'])){_0x3270b5[_0x43c9('0xa8')]='#';_0xb7000d='#';}if(!this['isConfigured'](_0x382691['variable_id'])){this['channel'][_0x43c9('0xac')](_0x43c9('0xde'));}else{var _0x2463a4=this[_0x43c9('0x14')][_0x43c9('0x70')](this,_0x382691[_0x43c9('0xdd')]);if(!_0x2463a4){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x382691,_0x43c9('0x119'));}this[_0x43c9('0x11')][_0x43c9('0xa3')](_0x2463a4,_0xb7000d);}this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x382691,_0xb7000d);return _0x3270b5;};AGIVertices['prototype'][_0x43c9('0xac')]=function(_0x3b8dfb){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x15f'),_0x3b8dfb[_0x43c9('0x40')]));return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x3b8dfb[_0x43c9('0x160')]||_0x3b8dfb['label']);};AGIVertices[_0x43c9('0x13')]['pause']=function(_0x306bc2){logger[_0x43c9('0x35')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x306bc2[_0x43c9('0x40')]));if(!this['isConfigured'](_0x306bc2[_0x43c9('0x152')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x306bc2,_0x43c9('0x150'));}logger[_0x43c9('0x35')](util['format'](_0x43c9('0x151'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x306bc2[_0x43c9('0x152')]));var _0x355dac=this[_0x43c9('0x161')][_0x43c9('0x70')](this,_0x306bc2[_0x43c9('0x162')]);var _0x413235=this[_0x43c9('0x56')][_0x43c9('0x70')](this,_0x306bc2[_0x43c9('0x152')],_0x355dac);if(_0x413235){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x153'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x306bc2[_0x43c9('0x152')]));this['channel']['noop'](util['format'](_0x43c9('0x153'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x306bc2[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x154')};}else{logger[_0x43c9('0x35')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x43c9('0x11')][_0x43c9('0x43')],_0x306bc2[_0x43c9('0x152')]));this[_0x43c9('0x11')]['noop'](util['format'](_0x43c9('0x153'),this['channel']['callerid'],_0x306bc2[_0x43c9('0x152')]));return{'code':0xc8,'result':_0x43c9('0x156')};}};AGIVertices[_0x43c9('0x13')][_0x43c9('0x163')]=function(_0x156d60){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x164'),_0x156d60[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x156d60[_0x43c9('0x111')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x156d60,'no\x20file\x20audio\x20selected');}var _0x7a8807=this[_0x43c9('0x23')][_0x43c9('0x70')](this,_0x156d60[_0x43c9('0x111')]);if(!_0x7a8807){return this[_0x43c9('0x11')]['error'](_0x156d60,_0x43c9('0x113'));}var _0xe6fbf0=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0x165'),[_0x7a8807,_0x156d60[_0x43c9('0xea')]]);if(_0xe6fbf0[_0x43c9('0xa8')]===-0x1){return _0xe6fbf0;}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x7a8807));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x166')]=function(_0x239ca1){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x167'),_0x239ca1[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x239ca1[_0x43c9('0x168')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x239ca1,_0x43c9('0x169'));}var _0x49f5d7='';var _0x22e56d=parseInt(_0x239ca1[_0x43c9('0x168')],0xa);if(isNaN(_0x22e56d)){_0x49f5d7=_0x239ca1['queue_id'];}else{_0x49f5d7=this[_0x43c9('0x1a')][_0x43c9('0x70')](this,_0x239ca1['queue_id']);if(!_0x49f5d7){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x239ca1,_0x43c9('0x16a'));}}var _0x397683='';if(this[_0x43c9('0x88')](_0x239ca1[_0x43c9('0x111')])){var _0x4d9a76=this[_0x43c9('0x23')][_0x43c9('0x70')](this,_0x239ca1[_0x43c9('0x111')]);if(_0x4d9a76){_0x397683=_0x4d9a76;}}this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x239ca1,_0x49f5d7);if(_0x239ca1[_0x43c9('0xea')][_0x43c9('0x16b')]('x')<0x0){_0x239ca1[_0x43c9('0xea')]+='x';}if(_0x239ca1[_0x43c9('0xea')][_0x43c9('0x16b')]('X')<0x0){_0x239ca1['opts']+='X';}this[_0x43c9('0x11')][_0x43c9('0xa3')]('XMCS-QUEUE',_0x49f5d7?_0x49f5d7[_0x43c9('0x16c')]():'');var _0x2560f1=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0x16d'),[_0x49f5d7,_0x239ca1[_0x43c9('0xea')],_0x239ca1['url'],_0x397683,_0x239ca1[_0x43c9('0x68')],_0x239ca1[_0x43c9('0x9')],_0x239ca1[_0x43c9('0x16e')],_0x239ca1[_0x43c9('0x16f')],'',_0x239ca1[_0x43c9('0x170')]]);if(_0x2560f1[_0x43c9('0xa8')]===-0x1){return _0x2560f1;}return this['channel'][_0x43c9('0xac')](util['format'](_0x43c9('0xc7'),_0x43c9('0x16d'),_0x49f5d7));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x171')]=function(_0x4144aa){logger[_0x43c9('0x35')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4144aa['label']));var _0x3206b2=_0x4144aa[_0x43c9('0x172')]||_0x43c9('0x12d');var _0x35416a=util[_0x43c9('0x2f')](_0x43c9('0x173'),this['channel'][_0x43c9('0x3f')],rs[_0x43c9('0x11b')](0x5));var _0x48c20b=util['format'](_0x43c9('0x174'),FILES_PATH,_0x35416a,_0x3206b2);var _0x39641c=util['format'](_0x43c9('0x12e'),FILES_PATH,_0x35416a);this['createSquareRecording'][_0x43c9('0x70')](this,_0x4144aa,_0x35416a,_0x48c20b);this[_0x43c9('0x11')][_0x43c9('0xa3')](_0x43c9('0x175'),_0x35416a);logger['info'](_0x43c9('0x176'),_0x39641c,_0x3206b2,_0x4144aa[_0x43c9('0x177')],_0x4144aa[_0x43c9('0x68')]);return this[_0x43c9('0x11')]['recordFile'](_0x39641c,_0x3206b2,_0x4144aa[_0x43c9('0x177')],_0x4144aa[_0x43c9('0x68')],undefined,!![]);};AGIVertices[_0x43c9('0x13')][_0x43c9('0x178')]=function(_0x27060a){logger[_0x43c9('0x35')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x27060a['label']));if(!this[_0x43c9('0x88')](_0x27060a['url'])){return this[_0x43c9('0x11')]['noop'](_0x43c9('0x179'));}var _0x1c5b10=this[_0x43c9('0x17a')][_0x43c9('0x70')](this,_0x27060a);logger['info'](util['format'](_0x43c9('0x17b'),util[_0x43c9('0x17c')](_0x1c5b10,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x27060a['variable_id'])){return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x17d'));}var _0x5df611=this[_0x43c9('0x14')]['sync'](this,_0x27060a[_0x43c9('0xdd')]);if(!_0x5df611){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x27060a,_0x43c9('0x119'));}this[_0x43c9('0x11')]['setVariable'](util['format']('%s_STATUS_CODE',_0x5df611),_0x1c5b10[_0x43c9('0x76')]?_0x1c5b10[_0x43c9('0x76')]:_0x43c9('0x17e'));this[_0x43c9('0x11')][_0x43c9('0xa3')](util['format']('%s_STATUS_MESSAGE',_0x5df611),_0x1c5b10['statusMessage']?_0x1c5b10['statusMessage']:'OK');if(_0x1c5b10['body']){try{this[_0x43c9('0xa1')](_0x1c5b10['body'],_0x5df611);}catch(_0x48377e){logger[_0x43c9('0x33')](util[_0x43c9('0x2f')](_0x43c9('0x17f'),_0x5df611));}}return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')]('variable\x20%s\x20set',_0x5df611));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x180')]=function(_0x158fac){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x181'),_0x158fac[_0x43c9('0x40')]));return this[_0x43c9('0x11')][_0x43c9('0x182')](_0x158fac[_0x43c9('0x183')][_0x43c9('0x60')](/\s+/g,''),_0x158fac[_0x43c9('0x177')]);};AGIVertices[_0x43c9('0x13')]['saynumber']=function(_0x4c3969){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4c3969['label']));return this['channel']['sayNumber'](_0x4c3969['number'][_0x43c9('0x60')](/\s+/g,''),_0x4c3969[_0x43c9('0x177')]);};AGIVertices[_0x43c9('0x13')][_0x43c9('0x184')]=function(_0x4ddeb6){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x185'),_0x4ddeb6[_0x43c9('0x40')]));return this[_0x43c9('0x11')][_0x43c9('0x186')](_0x4ddeb6[_0x43c9('0x63')],_0x4ddeb6['escape_digits']);};AGIVertices[_0x43c9('0x13')]['sendMail']=function(_0x3c1c34){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3c1c34[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x3c1c34['account_id'])){return this[_0x43c9('0x11')][_0x43c9('0xac')]('no\x20mail\x20account\x20configured');}var _0x3e86a0=this[_0x43c9('0x27')][_0x43c9('0x70')](this,_0x3c1c34[_0x43c9('0x187')]);if(!_0x3e86a0||!_0x3e86a0[_0x43c9('0x188')]){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x3c1c34,_0x43c9('0x189'));}var _0x39a156={'from':util[_0x43c9('0x2f')](_0x43c9('0x18a'),_0x3e86a0[_0x43c9('0x18')],_0x3e86a0[_0x43c9('0x18b')]||_0x3e86a0[_0x43c9('0x188')]['user']),'to':_0x3c1c34['to']||'','cc':_0x3c1c34['cc']||'','bcc':_0x3c1c34['bcc']||'','subject':_0x3c1c34[_0x43c9('0x18c')],'html':_0x3c1c34['text'],'text':_0x3c1c34[_0x43c9('0x63')]};if(this[_0x43c9('0x88')](_0x3c1c34[_0x43c9('0x18d')])){}logger[_0x43c9('0xe3')](_0x43c9('0x18e'),JSON[_0x43c9('0x74')](_0x39a156));this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x3c1c34,_0x3c1c34['account_id']);this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x18f'),_0x3e86a0[_0x43c9('0x18')]));this[_0x43c9('0x29')][_0x43c9('0x70')](this,_0x3e86a0[_0x43c9('0x190')],_0x39a156);return this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x191'));};AGIVertices['prototype'][_0x43c9('0x192')]=function(_0x5d192c){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x193'),_0x5d192c[_0x43c9('0x40')]));return this[_0x43c9('0x11')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x43c9('0x13')][_0x43c9('0x194')]=function(_0x3beb3c){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x195'),_0x3beb3c['label']));if(!this[_0x43c9('0x88')](_0x3beb3c[_0x43c9('0x196')])){return this['channel'][_0x43c9('0xac')]('no\x20sms\x20account\x20configured');}var _0x3c379a=this[_0x43c9('0x197')][_0x43c9('0x70')](this,_0x3beb3c[_0x43c9('0x196')]);if(!_0x3c379a){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x3beb3c,_0x43c9('0x198'));}var _0x5124b7={'body':_0x3beb3c[_0x43c9('0x199')],'phone':_0x3beb3c['to']||'','SmsAccountId':_0x3c379a['id']};logger[_0x43c9('0xe3')](_0x43c9('0x19a'),JSON['stringify'](_0x5124b7));this['createSquareDetailsReport'][_0x43c9('0x70')](this,_0x3beb3c,_0x3beb3c['sms_account_id']);this[_0x43c9('0x11')][_0x43c9('0xac')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3c379a[_0x43c9('0x18')]));this['createSmsMessage'][_0x43c9('0x70')](this,_0x5124b7);return this['channel'][_0x43c9('0xac')](_0x43c9('0x19b'));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x19c')]=function(_0xa725cb){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x19d'),_0xa725cb[_0x43c9('0x40')]));if(!this['isConfigured'](_0xa725cb[_0x43c9('0xdd')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0xa725cb,_0x43c9('0x19e'));}var _0x2f94dc=this['getVariable'][_0x43c9('0x70')](this,_0xa725cb[_0x43c9('0xdd')]);if(!_0x2f94dc){return this['channel']['error'](_0xa725cb,_0x43c9('0x119'));}return this['channel'][_0x43c9('0xa3')](_0x2f94dc,_0xa725cb[_0x43c9('0x19f')]);};AGIVertices['prototype'][_0x43c9('0x1a0')]=function(_0x1974f5){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')]('Enter\x20in\x20START\x20(%s)\x20block',_0x1974f5['label']));this['channel'][_0x43c9('0xac')]('START\x20CALLY\x20SQUARE');var _0x4c69c3=this['channel']['getVariable']('XMCS-UNIQUEID');if(!_[_0x43c9('0x4d')](_0x4c69c3[_0x43c9('0xa6')])){this[_0x43c9('0x11')][_0x43c9('0x3f')]=_0x4c69c3[_0x43c9('0xa6')];}if(_0x1974f5[_0x43c9('0xbb')]===_0x43c9('0x1a1')){this[_0x43c9('0x11')][_0x43c9('0xac')](_0x43c9('0x1a2'));return this[_0x43c9('0x11')][_0x43c9('0xbb')]();}return this[_0x43c9('0x11')]['noop'](_0x43c9('0x1a3'));};AGIVertices[_0x43c9('0x13')]['subproject']=function(_0x2a6d98){logger['info'](util[_0x43c9('0x2f')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x2a6d98[_0x43c9('0x40')]));if(!this['isConfigured'](_0x2a6d98[_0x43c9('0x1a4')])){return this['channel']['error'](_0x2a6d98,'no\x20subproject\x20selected');}var _0x9a09b6=this['getSquareProject'][_0x43c9('0x70')](this,_0x2a6d98[_0x43c9('0x1a4')]);if(!this['isConfigured'](_0x9a09b6)){return this['channel']['error'](_0x2a6d98,util[_0x43c9('0x2f')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2a6d98[_0x43c9('0x1a4')]));}if(_0x9a09b6===this[_0x43c9('0x11')][_0x43c9('0x49')]){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x2a6d98,_0x43c9('0x1a5'));}this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0x2a6d98,_0x9a09b6);var _0x7971da=this[_0x43c9('0x11')]['exec'](_0x43c9('0x1a6'),util[_0x43c9('0x2f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x43c9('0x9')][_0x43c9('0x1a7')]||'127.0.0.1',_0x9a09b6,this[_0x43c9('0x11')]['arg_1']));if(_0x7971da[_0x43c9('0xa8')]===-0x1){return _0x7971da;}return this['channel']['noop'](util['format'](_0x43c9('0xc7'),'AGI',_0x9a09b6));};AGIVertices[_0x43c9('0x13')]['system']=function(_0xac6b11){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x1a8'),_0xac6b11[_0x43c9('0x40')]));var _0x34081f=this[_0x43c9('0x5d')][_0x43c9('0x70')](this,_0xac6b11[_0x43c9('0xb9')]);this[_0x43c9('0x3e')][_0x43c9('0x70')](this,_0xac6b11,_0xac6b11[_0x43c9('0xb9')]);if(this[_0x43c9('0x88')](_0xac6b11[_0x43c9('0xdd')])){var _0x495159=this['getVariable'][_0x43c9('0x70')](this,_0xac6b11[_0x43c9('0xdd')]);if(_0x495159){this[_0x43c9('0x11')]['setVariable'](_0x495159,_0x34081f);return this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x1a9'),_0xac6b11[_0x43c9('0xb9')],_0x495159));}}return this['channel']['noop'](util[_0x43c9('0x2f')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0xac6b11['command']));};AGIVertices[_0x43c9('0x13')]['google_cloud_tts']=function(_0x4d8636){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x1aa'),_0x4d8636['label']));_0x4d8636[_0x43c9('0x63')]=_0x4d8636['text'][_0x43c9('0x60')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4d8636[_0x43c9('0x1ab')])){return this[_0x43c9('0x11')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x43c9('0x88')](_0x4d8636['text'])){return this['channel'][_0x43c9('0xac')](_0x43c9('0xad'));}this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0x1ac'),_0x4d8636[_0x43c9('0x63')]));var _0xcefa92=this[_0x43c9('0x61')][_0x43c9('0x70')](this,_0x4d8636);if(_0xcefa92){this['channel'][_0x43c9('0xac')](util['format'](_0x43c9('0x1ad'),_0xcefa92));var _0x47e757=this['channel'][_0x43c9('0x104')](_0xcefa92);try{fs[_0x43c9('0x14c')](_0xcefa92+_0x43c9('0x105'));}catch(_0x385c22){logger[_0x43c9('0x33')](_0x385c22);}return _0x47e757;}return this[_0x43c9('0x11')]['error'](_0x4d8636,_0x43c9('0x1ae'));};AGIVertices[_0x43c9('0x13')][_0x43c9('0x1af')]=function(_0x3d772c){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x1b0'),_0x3d772c[_0x43c9('0x40')]));_0x3d772c['text']=_0x3d772c[_0x43c9('0x63')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3d772c[_0x43c9('0x63')])){return this[_0x43c9('0x11')]['noop'](_0x43c9('0xad'));}this[_0x43c9('0x11')][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x1b1'),_0x3d772c[_0x43c9('0x63')]));var _0x12e24b=this[_0x43c9('0x66')][_0x43c9('0x70')](this,_0x3d772c);if(_0x12e24b){this[_0x43c9('0x11')]['noop'](util[_0x43c9('0x2f')](_0x43c9('0x1b2'),_0x12e24b));var _0x5f2c13=this[_0x43c9('0x11')]['streamFile'](_0x12e24b);try{fs['unlink'](_0x12e24b+_0x43c9('0x105'));}catch(_0x282e0a){logger[_0x43c9('0x33')](_0x282e0a);}return _0x5f2c13;}return this['channel']['error'](_0x3d772c,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x43c9('0x13')][_0x43c9('0x1b3')]=function(_0x3b1193){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x1b4'),_0x3b1193[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x3b1193[_0x43c9('0x152')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x3b1193,_0x43c9('0x150'));}logger['info'](util['format'](_0x43c9('0x151'),this['channel'][_0x43c9('0x43')],_0x3b1193[_0x43c9('0x152')]));var _0x7b9148=this[_0x43c9('0x58')][_0x43c9('0x70')](this,_0x3b1193['findBy']);if(_0x7b9148){logger[_0x43c9('0x35')](util['format'](_0x43c9('0x153'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x3b1193[_0x43c9('0x152')]));this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')](_0x43c9('0x153'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x3b1193[_0x43c9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x155'),this[_0x43c9('0x11')][_0x43c9('0x43')],_0x3b1193[_0x43c9('0x152')]));this['channel'][_0x43c9('0xac')](util[_0x43c9('0x2f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x43c9('0x43')],_0x3b1193['findBy']));return{'code':0xc8,'result':_0x43c9('0x156')};}};AGIVertices[_0x43c9('0x13')][_0x43c9('0x1b5')]=function(_0x33b639){logger[_0x43c9('0x35')](util[_0x43c9('0x2f')](_0x43c9('0x1b6'),_0x33b639[_0x43c9('0x40')]));var _0x484d61=this[_0x43c9('0x11')][_0x43c9('0x5e')](_0x43c9('0x1b7'),[_0x33b639[_0x43c9('0x1b8')],_0x33b639[_0x43c9('0x79')]]);if(_0x484d61[_0x43c9('0xa8')]===-0x1){return _0x484d61;}return this['channel'][_0x43c9('0xac')](util['format'](_0x43c9('0xc7'),'VOICEMAIL',_0x33b639['mailbox']));};AGIVertices['prototype'][_0x43c9('0x1b9')]=function(_0x17f694){logger['info'](util[_0x43c9('0x2f')](_0x43c9('0x1ba'),_0x17f694[_0x43c9('0x40')]));if(!this[_0x43c9('0x88')](_0x17f694[_0x43c9('0xdd')])){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x17f694,_0x43c9('0x19e'));}var _0x24b021=this[_0x43c9('0x14')][_0x43c9('0x70')](this,_0x17f694[_0x43c9('0xdd')]);if(!_0x24b021){return this[_0x43c9('0x11')][_0x43c9('0x33')](_0x17f694,'no\x20variable\x20found');}var _0x8acab6=this[_0x43c9('0x11')]['getVariable'](_0x24b021);return{'code':0xc8,'result':_0x8acab6[_0x43c9('0xa6')]?_0x8acab6[_0x43c9('0xa6')]:'-'};};String[_0x43c9('0x13')][_0x43c9('0xa5')]=function(_0x5ec2f4,_0x4a9eb1){return this[_0x43c9('0xa4')](_0x5ec2f4)[_0x43c9('0x1bb')](_0x4a9eb1);};module[_0x43c9('0x1bc')]=AGIVertices; \ No newline at end of file +var _0xa7e6=['success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','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','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','variable\x20%s\x20set','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','shellCommand','command','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','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareOdbcById','dsn','getUser','getUserById','prototype','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','mailRpc','IntervalId','interval','map','Intervals','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','dnid','file','createCmContact','isEmpty','isNil','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','format','%s/%s@from-sip/n','LOCAL','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','computedVariables','sync','uri','headers','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','google_asr_language','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','result','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','minutes','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','MRCPSynth','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','createSquareMessage','speech','out','dialogflow','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','getVariable','no\x20variable\x20found','hiddendigitsnum','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','streamFile','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7e6,0x74));var _0x6a7e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa7e6[_0x2c91e9];return _0x13f0ff;};'use strict';var fs=require('fs');var util=require(_0x6a7e('0x0'));var _=require(_0x6a7e('0x1'));var sh=require(_0x6a7e('0x2'));var odbc=require(_0x6a7e('0x3'))();var rs=require(_0x6a7e('0x4'));var moment=require(_0x6a7e('0x5'));var Mustache=require('mustache');var rp=require(_0x6a7e('0x6'));var logger=require(_0x6a7e('0x7'))(_0x6a7e('0x8'));var config=require(_0x6a7e('0x9'));var scripts=require(_0x6a7e('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x6a7e('0xb'),_0x6a7e('0xc')];var verticesWithRetry=[_0x6a7e('0xd'),_0x6a7e('0xe'),_0x6a7e('0xf')];var AGIVertices=function(_0x3f3f2f,_0x23b5d6,_0x403962){this[_0x6a7e('0x10')]=_0x3f3f2f;this['rpc']=_0x23b5d6;this['mailRpc']=_0x403962;};AGIVertices['prototype']['getVariable']=function(_0x40d60f,_0x19ea13){this[_0x6a7e('0x11')][_0x6a7e('0x12')](_0x40d60f)[_0x6a7e('0x13')](function(_0x546ac8){_0x19ea13(null,_0x546ac8?_0x546ac8[_0x6a7e('0x14')]:![]);})[_0x6a7e('0x15')](function(_0x5c0c74){_0x19ea13(_0x5c0c74);});};AGIVertices['prototype'][_0x6a7e('0x16')]=function(_0x122b35,_0x1ac6da){this[_0x6a7e('0x11')]['getVoiceQueueById'](_0x122b35)[_0x6a7e('0x13')](function(_0x21369e){_0x1ac6da(null,_0x21369e?_0x21369e[_0x6a7e('0x14')]:![]);})[_0x6a7e('0x15')](function(_0x465566){_0x1ac6da(_0x465566);});};AGIVertices['prototype'][_0x6a7e('0x17')]=function(_0x49ee02,_0x5c757f){this[_0x6a7e('0x11')]['getSquareProjectById'](_0x49ee02)[_0x6a7e('0x13')](function(_0x195761){_0x5c757f(null,_0x195761?_0x195761[_0x6a7e('0x14')]:![]);})[_0x6a7e('0x15')](function(_0x20e90a){_0x5c757f(_0x20e90a);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x5254ff,_0x102e83){this[_0x6a7e('0x11')][_0x6a7e('0x18')](_0x5254ff)[_0x6a7e('0x13')](function(_0x300957){_0x102e83(null,_0x300957?_0x300957[_0x6a7e('0x19')]:![]);})[_0x6a7e('0x15')](function(_0x3f8279){_0x102e83(_0x3f8279);});};AGIVertices['prototype'][_0x6a7e('0x1a')]=function(_0x35c94d,_0x4f53c5){this[_0x6a7e('0x11')][_0x6a7e('0x1b')](_0x35c94d)[_0x6a7e('0x13')](function(_0x5e2fa3){_0x4f53c5(null,_0x5e2fa3?_0x5e2fa3[_0x6a7e('0x14')]:![]);})[_0x6a7e('0x15')](function(_0x4ee914){_0x4f53c5(_0x4ee914);});};AGIVertices[_0x6a7e('0x1c')]['getTrunk']=function(_0x1c4b77,_0x277949){this['rpc'][_0x6a7e('0x1d')](_0x1c4b77)[_0x6a7e('0x13')](function(_0x46a15f){_0x277949(null,_0x46a15f?_0x46a15f[_0x6a7e('0x14')]:![]);})[_0x6a7e('0x15')](function(_0x380f2f){_0x277949(_0x380f2f);});};AGIVertices['prototype'][_0x6a7e('0x1e')]=function(_0x1089b3,_0x43b214){var _0x31b3ca=this;this[_0x6a7e('0x11')]['getSoundById'](_0x1089b3)['then'](function(_0x8b0439){_0x43b214(null,_0x8b0439?_0x31b3ca[_0x6a7e('0x1f')](_0x8b0439[_0x6a7e('0x20')]):![]);})['catch'](function(_0xa324d0){_0x43b214(_0xa324d0);});};AGIVertices['prototype'][_0x6a7e('0x21')]=function(_0x48f5ac,_0x55e347){this[_0x6a7e('0x11')]['getMailAccountById'](_0x48f5ac)[_0x6a7e('0x13')](function(_0x4a18c7){_0x55e347(null,_0x4a18c7?_0x4a18c7:![]);})['catch'](function(_0x25783c){_0x55e347(_0x25783c);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x22')]=function(_0x106af8,_0x2b1788,_0x2f5deb){this[_0x6a7e('0x23')][_0x6a7e('0x22')](_0x106af8,_0x2b1788)[_0x6a7e('0x13')](function(){_0x2f5deb(null);})[_0x6a7e('0x15')](function(_0x16c05c){_0x2f5deb(_0x16c05c);});};AGIVertices[_0x6a7e('0x1c')]['getIntervals']=function(_0x1d5bc1,_0x3f4764){this[_0x6a7e('0x11')]['getIntervalById'](_0x1d5bc1)[_0x6a7e('0x13')](function(_0x3b7678){if(_0x3b7678){if(_0x3b7678[_0x6a7e('0x24')]){_0x3f4764(null,[_0x3b7678[_0x6a7e('0x25')]]);}else{_0x3f4764(null,_[_0x6a7e('0x26')](_0x3b7678[_0x6a7e('0x27')],'interval'));}}else{_0x3f4764(null,![]);}})['catch'](function(_0x292f43){_0x3f4764(_0x292f43);});};AGIVertices['prototype'][_0x6a7e('0x1f')]=function(_0x3d29fb){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x3d29fb);};AGIVertices['prototype'][_0x6a7e('0x28')]=function(_0x58066a,_0x575a79,_0x512430){odbc['open'](_0x58066a,function(_0x46c48c){if(_0x46c48c){logger['error'](_0x6a7e('0x29'),_0x46c48c);_0x512430(_0x46c48c);}else{logger[_0x6a7e('0x2a')](_0x6a7e('0x2b'));odbc[_0x6a7e('0x2c')](_0x575a79,function(_0x243126,_0x50bcf7){if(_0x243126){logger[_0x6a7e('0x2a')](_0x6a7e('0x2d'),_0x575a79);_0x512430(_0x243126);}else{logger['info'](_0x6a7e('0x2e'),_0x575a79);odbc[_0x6a7e('0x2f')](function(_0x4a2523){if(_0x4a2523){logger[_0x6a7e('0x30')](_0x6a7e('0x31'),_0x4a2523);}_0x512430(null,_0x50bcf7);});}});}});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x32')]=function(_0x2827f7,_0x28a62e){this[_0x6a7e('0x11')][_0x6a7e('0x33')](_0x2827f7)[_0x6a7e('0x13')](function(_0x27434a){_0x28a62e(null,_0x27434a?_0x27434a:![]);})[_0x6a7e('0x15')](function(_0x5c0d31){_0x28a62e(_0x5c0d31);});};AGIVertices['prototype'][_0x6a7e('0x34')]=function(_0x733cbe,_0x4f1119){this[_0x6a7e('0x11')][_0x6a7e('0x34')](_0x733cbe)[_0x6a7e('0x13')](function(_0x361c9e){_0x4f1119(null,_0x361c9e);})[_0x6a7e('0x15')](function(_0x475ac9){_0x4f1119(_0x475ac9);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x35')]=function(_0x2a3d31,_0x247efb,_0x114d53){this[_0x6a7e('0x11')][_0x6a7e('0x35')]({'uniqueid':this[_0x6a7e('0x10')]['uniqueid'],'node':_0x2a3d31['label'],'application':_0x2a3d31[_0x6a7e('0x36')],'data':_0x247efb||null,'project_name':this[_0x6a7e('0x10')][_0x6a7e('0x37')],'callerid':this[_0x6a7e('0x10')][_0x6a7e('0x38')]})[_0x6a7e('0x13')](function(_0x30b55c){if(_0x114d53){_0x114d53(null,_0x30b55c);}})[_0x6a7e('0x15')](function(_0x5cdd48){if(_0x114d53){_0x114d53(_0x5cdd48);}});};AGIVertices[_0x6a7e('0x1c')]['createSquareRecording']=function(_0x247a4b,_0x2f87ea,_0x2b15d9,_0x3f4f40){this['rpc'][_0x6a7e('0x39')]({'uniqueid':this[_0x6a7e('0x10')][_0x6a7e('0x3a')],'callerid':this['channel'][_0x6a7e('0x38')],'calleridname':this['channel'][_0x6a7e('0x3b')],'context':this[_0x6a7e('0x10')][_0x6a7e('0x3c')],'extension':this[_0x6a7e('0x10')]['extension'],'priority':this[_0x6a7e('0x10')][_0x6a7e('0x3d')],'accountcode':this[_0x6a7e('0x10')][_0x6a7e('0x3e')],'dnid':this['channel'][_0x6a7e('0x3f')],'projectName':this['channel'][_0x6a7e('0x37')],'saveName':_0x2f87ea,'filename':_0x247a4b[_0x6a7e('0x40')]||_0x2f87ea,'savePath':_0x2b15d9})[_0x6a7e('0x13')](function(_0x4a7465){_0x3f4f40(null,_0x4a7465);})[_0x6a7e('0x15')](function(_0x58f58b){_0x3f4f40(_0x58f58b);});};AGIVertices[_0x6a7e('0x1c')]['createSquareMessage']=function(_0xf124ce,_0x22e4f7,_0x2887d9,_0x1dd8c3,_0x2f2874){this[_0x6a7e('0x11')]['createSquareMessage']({'uniqueid':this[_0x6a7e('0x10')][_0x6a7e('0x3a')],'body':_0xf124ce,'direction':_0x22e4f7,'providerName':_0x2887d9,'providerResponse':_0x1dd8c3})[_0x6a7e('0x13')](function(_0x22965d){if(_0x2f2874){_0x2f2874(null,_0x22965d);}})['catch'](function(_0x4aecc8){if(_0x2f2874){_0x2f2874(_0x4aecc8);}});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x41')]=function(_0x231114,_0x251076){this[_0x6a7e('0x11')]['createCmContact']({'firstName':_[_0x6a7e('0x42')](_0x231114[_0x6a7e('0x14')])||_[_0x6a7e('0x43')](_0x231114[_0x6a7e('0x14')])?'callback_'+Math['random']():_0x231114[_0x6a7e('0x14')],'lastName':_[_0x6a7e('0x42')](_0x231114['lastName'])||_[_0x6a7e('0x43')](_0x231114[_0x6a7e('0x44')])?null:_0x231114[_0x6a7e('0x44')],'phone':_0x231114[_0x6a7e('0x45')],'ListId':_0x231114[_0x6a7e('0x46')],'scheduledat':_0x231114[_0x6a7e('0x47')],'callbackUniqueid':this[_0x6a7e('0x10')][_0x6a7e('0x3a')],'tags':'callback','description':_0x6a7e('0x48')+_0x231114[_0x6a7e('0x47')][_0x6a7e('0x49')](),'priority':_0x231114[_0x6a7e('0x4a')]})[_0x6a7e('0x13')](function(_0x563995){_0x251076(null,_0x563995);})[_0x6a7e('0x15')](function(_0xee25e0){_0x251076(_0xee25e0);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x4b')]=function(_0x338a58,_0x4fb944){this[_0x6a7e('0x11')][_0x6a7e('0x4c')](_0x338a58)[_0x6a7e('0x13')](function(_0x3fe7a1){_0x4fb944(null,_0x3fe7a1?_0x3fe7a1['name']:![]);})[_0x6a7e('0x15')](function(_0x240abe){_0x4fb944(_0x240abe);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x4d')]=function(_0x3e2cb8,_0x3a0c9d,_0x5ce7d9){var _0x13209f={'role':_0x6a7e('0x4e')};_0x13209f[_0x3e2cb8]=this[_0x6a7e('0x10')][_0x6a7e('0x38')];this[_0x6a7e('0x11')]['agentPause'](_0x13209f,_0x3a0c9d,this[_0x6a7e('0x10')][_0x6a7e('0x3a')])[_0x6a7e('0x13')](function(_0x37b7aa){_0x5ce7d9(null,_['isNil'](_0x37b7aa)?![]:!![]);})[_0x6a7e('0x15')](function(_0x4a47b7){logger['error'](_0x4a47b7);_0x5ce7d9(null,![]);});};AGIVertices['prototype'][_0x6a7e('0x4f')]=function(_0x3374c7,_0x5dc96c){var _0x330366={'role':_0x6a7e('0x4e')};_0x330366[_0x3374c7]=this[_0x6a7e('0x10')]['callerid'];this[_0x6a7e('0x11')][_0x6a7e('0x4f')](_0x330366)[_0x6a7e('0x13')](function(_0x8a9bd2){_0x5dc96c(null,_[_0x6a7e('0x43')](_0x8a9bd2)?![]:!![]);})[_0x6a7e('0x15')](function(_0x4b84c5){logger[_0x6a7e('0x30')](_0x4b84c5);_0x5dc96c(null,![]);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x50')]=function(_0x50cd4d,_0x5559e6){var _0x13e653={'role':_0x6a7e('0x4e')};_0x13e653[_0x50cd4d]=this[_0x6a7e('0x10')]['callerid'];this['rpc'][_0x6a7e('0x50')](_0x13e653)[_0x6a7e('0x13')](function(_0x3e166d){_0x5559e6(null,_[_0x6a7e('0x43')](_0x3e166d)?![]:!![]);})[_0x6a7e('0x15')](function(_0x1afd39){logger[_0x6a7e('0x30')](_0x1afd39);_0x5559e6(null,![]);});};AGIVertices[_0x6a7e('0x1c')]['agentLogin']=function(_0xaafc4a,_0x5340e9){var _0x20c47c={'role':'agent'};_0x20c47c[_0xaafc4a]=this['channel']['callerid'];var _0x3a4aa2=_0xaafc4a!='internal'?util[_0x6a7e('0x51')](_0x6a7e('0x52'),_0x6a7e('0x53'),this[_0x6a7e('0x10')][_0x6a7e('0x38')]):undefined;this[_0x6a7e('0x11')][_0x6a7e('0x54')](_0x20c47c,_0x3a4aa2)[_0x6a7e('0x13')](function(_0x36c556){_0x5340e9(null,_['isNil'](_0x36c556)?![]:!![]);})[_0x6a7e('0x15')](function(_0x5cae08){logger[_0x6a7e('0x30')](_0x5cae08);_0x5340e9(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x1d98be,_0xa859f5){sh[_0x6a7e('0x55')](_[_0x6a7e('0x56')](_0x1d98be),function(_0x26a11b,_0x434dae){var _0x1fb019=_0x434dae[_0x6a7e('0x57')](/(\r\n|\n|\r)/gm,'');_0xa859f5(null,_0x1fb019);});};AGIVertices['prototype'][_0x6a7e('0x58')]=function(_0x5ba94e,_0x15d83b){scripts['googleCloudTTS'](_0x5ba94e[_0x6a7e('0x59')],_0x5ba94e[_0x6a7e('0x5a')]||_0x6a7e('0x5b'),_0x5ba94e[_0x6a7e('0x5b')],_0x5ba94e[_0x6a7e('0x5c')]||_0x6a7e('0x5d'),_0x5ba94e[_0x6a7e('0x5e')]||_0x6a7e('0x5f'),_0x5ba94e[_0x6a7e('0x60')]||'MP3')['then'](function(_0x533a78){_0x15d83b(null,_0x533a78);})[_0x6a7e('0x15')](function(_0x21efe8){_0x15d83b(_0x21efe8);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x61')]=function(_0x262ca5,_0x5e72){scripts[_0x6a7e('0x61')](_0x262ca5[_0x6a7e('0x5b')],_0x262ca5[_0x6a7e('0x62')]||'en',0x1)[_0x6a7e('0x13')](function(_0x5533b1){_0x5e72(null,_0x5533b1);})[_0x6a7e('0x15')](function(_0x12edd8){_0x5e72(_0x12edd8);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x63')]=function(_0x1e278b,_0x51bc53){var _0x1d4a2d={'uri':_0x1e278b[_0x6a7e('0x64')],'method':_0x1e278b[_0x6a7e('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1e278b[_0x6a7e('0x66')])===_0x6a7e('0x67')&&parseInt(_0x1e278b[_0x6a7e('0x66')])>=0x1?parseInt(_0x1e278b['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x6a7e('0x68')]([_0x6a7e('0x69'),_0x6a7e('0x6a')],_0x1d4a2d[_0x6a7e('0x65')][_0x6a7e('0x6b')]())){try{_0x1d4a2d[_0x6a7e('0x6c')]=_0x1e278b['rawBody']?JSON[_0x6a7e('0x6d')](_0x1e278b[_0x6a7e('0xc')]):{};}catch(_0x46686e){logger[_0x6a7e('0x30')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x46686e);}}try{_0x1d4a2d['headers']=_0x1e278b[_0x6a7e('0xb')]?JSON['parse'](_0x1e278b[_0x6a7e('0xb')]):{};}catch(_0x6a5c27){logger[_0x6a7e('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x6a5c27);}if(_0x1e278b[_0x6a7e('0x6e')]){try{var _0x11fbb1=require(_0x1e278b[_0x6a7e('0x6e')])[_0x6a7e('0x6f')](this,_0x1d4a2d);_0x1d4a2d[_0x6a7e('0x70')]=Mustache['render'](_0x1e278b[_0x6a7e('0x64')],_0x11fbb1,{},['$$','$$']);if(_0x1d4a2d['headers']){_0x1d4a2d[_0x6a7e('0x71')]=JSON[_0x6a7e('0x6d')](Mustache[_0x6a7e('0x72')](JSON[_0x6a7e('0x73')](_0x1d4a2d['headers']),_0x11fbb1,{},['$$','$$']));}if(_0x1d4a2d[_0x6a7e('0x6c')]){_0x1d4a2d[_0x6a7e('0x6c')]=JSON[_0x6a7e('0x6d')](Mustache['render'](JSON['stringify'](_0x1d4a2d[_0x6a7e('0x6c')]),_0x11fbb1,{},['$$','$$']));}}catch(_0xcf4ba4){logger[_0x6a7e('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xcf4ba4);}}rp(_0x1d4a2d)['then'](function(_0x53de09){var _0x2d11ee={'statusCode':_0x53de09[_0x6a7e('0x74')]||0xc8,'statusMessage':_0x53de09[_0x6a7e('0x75')]||'OK','headers':_0x53de09[_0x6a7e('0x71')]||{},'body':_0x53de09[_0x6a7e('0x6c')]||{}};_0x51bc53(null,_0x2d11ee);})[_0x6a7e('0x15')](function(_0x24ebae){var _0x129542={'statusCode':_0x24ebae[_0x6a7e('0x74')]||0x1f4,'statusMessage':_0x24ebae[_0x6a7e('0x76')]||_0x6a7e('0x77'),'headers':_0x24ebae['options'][_0x6a7e('0x71')]||{},'body':_0x24ebae[_0x6a7e('0x78')][_0x6a7e('0x6c')]||{}};_0x51bc53(null,_0x129542);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x79')]=function(_0x540998,_0x340e63){scripts['googleDialogflow'](this[_0x6a7e('0x10')]['uniqueid'],_0x540998[_0x6a7e('0x7a')],_0x540998[_0x6a7e('0x5b')],_0x540998[_0x6a7e('0x7b')]||'en')[_0x6a7e('0x13')](function(_0x80e68b){_0x340e63(null,_0x80e68b);})[_0x6a7e('0x15')](function(_0x5f3e7a){_0x340e63(_0x5f3e7a);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x7c')]=function(_0x4ee0de,_0x481c8b){scripts[_0x6a7e('0x7c')](this[_0x6a7e('0x10')][_0x6a7e('0x3a')],_0x4ee0de[_0x6a7e('0x7d')],_0x4ee0de['client_email'],_0x4ee0de[_0x6a7e('0x7e')],_0x4ee0de['text'],_0x4ee0de['dialogflowV2_language']||'en')[_0x6a7e('0x13')](function(_0x78abd7){_0x481c8b(null,_0x78abd7);})['catch'](function(_0x1db7af){_0x481c8b(_0x1db7af);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x7f')]=function(_0x283a75,_0x4b45d0){scripts['sestekNDA'](this[_0x6a7e('0x10')],_0x283a75)[_0x6a7e('0x13')](function(_0xcc8f32){_0x4b45d0(null,_0xcc8f32);})[_0x6a7e('0x15')](function(_0x39352d){_0x4b45d0(_0x39352d);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x80')]=function(_0x162baf,_0x5d0921){scripts[_0x6a7e('0x80')](_0x162baf[_0x6a7e('0x7a')],_0x162baf[_0x6a7e('0x5b')],_0x162baf[_0x6a7e('0x81')]||'en-US',_0x162baf['speed'])['then'](function(_0x20b7e8){_0x5d0921(null,_0x20b7e8);})['catch'](function(_0x5a7196){_0x5d0921(_0x5a7196);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x82')]=function(_0x1d63e9,_0x672bd7,_0x350c56){scripts['ispeechASR'](_0x672bd7,_0x1d63e9[_0x6a7e('0x7a')],_0x1d63e9[_0x6a7e('0x83')]||_0x6a7e('0x5d'),this[_0x6a7e('0x84')](_0x1d63e9['model'])?_0x1d63e9['model']:undefined)['then'](function(_0x2b8f1b){_0x350c56(null,_0x2b8f1b);})[_0x6a7e('0x15')](function(_0x132c2f){_0x350c56(_0x132c2f);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x85')]=function(_0x1c38b0,_0x55e10e){scripts['awsPolly'](_0x1c38b0[_0x6a7e('0x86')],_0x1c38b0['aws_secret_access_key'],_0x1c38b0[_0x6a7e('0x87')],_0x1c38b0[_0x6a7e('0x88')]||_0x6a7e('0x89'),_0x1c38b0[_0x6a7e('0x5b')],_0x1c38b0[_0x6a7e('0x8a')]||'text')['then'](function(_0x1313e6){_0x55e10e(null,_0x1313e6);})[_0x6a7e('0x15')](function(_0x199737){_0x55e10e(_0x199737);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x8b')]=function(_0xa8ca22,_0x284f5a){scripts['awsLex'](this[_0x6a7e('0x10')]['uniqueid'],_0xa8ca22[_0x6a7e('0x86')],_0xa8ca22[_0x6a7e('0x8c')],_0xa8ca22[_0x6a7e('0x8d')],_0xa8ca22[_0x6a7e('0x5b')],_0xa8ca22[_0x6a7e('0x8e')])[_0x6a7e('0x13')](function(_0x508219){_0x284f5a(null,_0x508219);})[_0x6a7e('0x15')](function(_0x59315b){_0x284f5a(_0x59315b);});};AGIVertices['prototype']['googleASR']=function(_0x41178c,_0x589d8b,_0x8aec8){scripts['googleASR'](_0x589d8b,_0x41178c[_0x6a7e('0x7a')],_0x41178c[_0x6a7e('0x8f')]||_0x6a7e('0x5d'))[_0x6a7e('0x13')](function(_0x40f9b7){_0x8aec8(null,_0x40f9b7);})[_0x6a7e('0x15')](function(_0x2bf02d){_0x8aec8(_0x2bf02d);});};AGIVertices[_0x6a7e('0x1c')]['tildeASR']=function(_0x24312f,_0x13dccc,_0x22c68b){scripts['tildeASR'](_0x13dccc,_0x24312f[_0x6a7e('0x90')],_0x24312f[_0x6a7e('0x91')],_0x24312f[_0x6a7e('0x70')])[_0x6a7e('0x13')](function(_0x49f138){_0x22c68b(null,_0x49f138);})[_0x6a7e('0x15')](function(_0x1059f3){_0x22c68b(_0x1059f3);});};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x92')]=function(_0x466fb1){var _0x3cedd0=_['includes'](verticesWithRetry,_0x466fb1['agicommand'])?_0x466fb1:_[_0x6a7e('0x93')](_0x466fb1);for(var _0x3d8c6e in _0x3cedd0){if(_0x3cedd0['hasOwnProperty'](_0x3d8c6e)){if(_0x3cedd0[_0x3d8c6e]&&_[_0x6a7e('0x94')](_0x3cedd0[_0x3d8c6e])){if(_[_0x6a7e('0x68')](recursiveMapAttributes,_0x3d8c6e)){_0x3cedd0[_0x3d8c6e]=this[_0x6a7e('0x95')](_0x3cedd0[_0x3d8c6e]);}else{_0x3cedd0[_0x3d8c6e]=this['replaceAllVariables'](_0x3cedd0[_0x3d8c6e]);}}}}return _0x3cedd0;};AGIVertices[_0x6a7e('0x1c')]['recursiveNodeIndex']=function(_0x139bf2){for(var _0x3e14ed in _0x139bf2){if(_0x139bf2[_0x6a7e('0x96')](_0x3e14ed)){if(_[_0x6a7e('0x97')](_0x139bf2[_0x3e14ed])){this[_0x6a7e('0x98')](_0x139bf2[_0x3e14ed]);}else if(_[_0x6a7e('0x99')](_0x139bf2[_0x3e14ed])){for(var _0x2ddc8d=0x0;_0x2ddc8d<_0x139bf2[_0x3e14ed][_0x6a7e('0x9a')];_0x2ddc8d++){this[_0x6a7e('0x98')](_0x139bf2[_0x3e14ed][_0x2ddc8d]);}}else if(_[_0x6a7e('0x94')](_0x139bf2[_0x3e14ed])){_0x139bf2[_0x3e14ed]=this[_0x6a7e('0x9b')](_0x139bf2[_0x3e14ed]);}}}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x9c')]=function(_0x495080,_0x545147){for(var _0x57f5e2 in _0x495080){if(_0x495080[_0x6a7e('0x96')](_0x57f5e2)){if(_[_0x6a7e('0x97')](_0x495080[_0x57f5e2])){if(!_[_0x6a7e('0x42')](_0x495080[_0x57f5e2])){this[_0x6a7e('0x9c')](_0x495080[_0x57f5e2],util[_0x6a7e('0x51')](_0x6a7e('0x9d'),_0x545147,_0x57f5e2));}}else if(_[_0x6a7e('0x99')](_0x495080[_0x57f5e2])){for(var _0xc3f843=0x0;_0xc3f843<_0x495080[_0x57f5e2][_0x6a7e('0x9a')];_0xc3f843++){this[_0x6a7e('0x9c')](_0x495080[_0x57f5e2][_0xc3f843],util[_0x6a7e('0x51')](_0x6a7e('0x9d'),_0x545147,_0x57f5e2+'['+_0xc3f843+']'));}}else{if(!_[_0x6a7e('0x43')](_0x495080[_0x57f5e2])){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0x9d'),_0x545147,_0x57f5e2),_0x495080[_0x57f5e2]);}}}}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x95')]=function(_0x3936f3){try{var _0x99ac36=JSON['parse'](_0x3936f3);this[_0x6a7e('0x98')](_0x99ac36);return JSON[_0x6a7e('0x73')](_0x99ac36);}catch(_0x32aab6){return this[_0x6a7e('0x9b')](_0x3936f3);}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x9b')]=function(_0x1fcf47){var _0x298d57=_0x1fcf47[_0x6a7e('0x9f')]('{');for(var _0x11e160=0x1;_0x11e160<_0x298d57[_0x6a7e('0x9a')];_0x11e160+=0x1){var _0x1230f8=_0x298d57[_0x11e160][_0x6a7e('0x9f')]('}');if(_0x1230f8['length']>0x1){_0x1fcf47=_0x1fcf47['replaceAll']('{'+_0x1230f8[0x0]+'}',this[_0x6a7e('0x10')]['getVariable'](_0x1230f8[0x0])[_0x6a7e('0xa0')]||_0x1230f8[0x0]);}}if(_0x298d57[_0x6a7e('0x9a')]===0x1){return _0x1fcf47[_0x6a7e('0x49')]();}return this[_0x6a7e('0x9b')](_0x1fcf47);};AGIVertices['prototype'][_0x6a7e('0xa1')]=function(_0x35753b,_0x1f737e){var _0x1482fb=this[_0x6a7e('0x10')]['getVariable'](_0x35753b);if(_0x1482fb['result']===-0x1){return _0x1482fb;}logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0xa2'),_0x1f737e,_0x1482fb[_0x6a7e('0xa0')]));return this[_0x6a7e('0x10')]['setVariable'](_0x1f737e,_0x1482fb[_0x6a7e('0xa0')]);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x84')]=function(_0x3d49d9){return _0x3d49d9&&_0x3d49d9!=='0'&&_0x3d49d9!=='-1'&&_0x3d49d9!=='';};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xa3')]=function(_0x47fcf5){this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x47fcf5,'-');_0x47fcf5[_0x6a7e('0xa4')]=_0x47fcf5['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x6fd887){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0xa5'),_0x6fd887[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x6fd887[_0x6a7e('0x5b')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0xa7'));}var _0x39f519='\x22'+_0x6fd887[_0x6a7e('0x5b')]+'\x22';if(this[_0x6a7e('0x84')](_0x6fd887['options'])){_0x39f519+=','+_0x6fd887['options'];}var _0x47736f=this[_0x6a7e('0x10')][_0x6a7e('0x55')]('MRCPSynth',_0x39f519);if(_0x47736f[_0x6a7e('0xa8')]===-0x1){return _0x47736f;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('Executed\x20command\x20MRCPSynth\x20%s',_0x39f519));};AGIVertices['prototype'][_0x6a7e('0xaa')]=function(_0x4367b9){logger['info'](util['format'](_0x6a7e('0xab'),_0x4367b9[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x4367b9['grammar'])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xac'));}var _0x5208a0=_0x4367b9[_0x6a7e('0xad')];if(this[_0x6a7e('0x84')](_0x4367b9[_0x6a7e('0x78')])){_0x5208a0+=','+_0x4367b9[_0x6a7e('0x78')];}var _0x92b076=this[_0x6a7e('0x10')]['exec'](_0x6a7e('0xae'),_0x5208a0);if(_0x92b076[_0x6a7e('0xa8')]===-0x1){return _0x92b076;}var _0x196fb4=this[_0x6a7e('0xa1')](_0x6a7e('0xaf'),_0x6a7e('0xb0'));if(_0x196fb4['result']===-0x1){return _0x196fb4;}var _0xf7129b=this[_0x6a7e('0xa1')](_0x6a7e('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0xf7129b[_0x6a7e('0xa8')]===-0x1){return _0xf7129b;}var _0x336af2=this['getAndSetVariable'](_0x6a7e('0xb2'),_0x6a7e('0xb3'));if(_0x336af2[_0x6a7e('0xa8')]===-0x1){return _0x336af2;}return this['channel'][_0x6a7e('0xa9')](util['format'](_0x6a7e('0xb4'),_0x5208a0));};AGIVertices['prototype'][_0x6a7e('0x8')]=function(_0x33b64f){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0xb5'),_0x33b64f[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')]['agi']([_0x33b64f['command'],_0x33b64f[_0x6a7e('0xb6')]]);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xb7')]=function(_0x22c997){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0xb8'),_0x22c997['label']));if(this[_0x6a7e('0x84')](_0x22c997['timeout'])){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0xb9'),_0x22c997['timeout']));var _0x27e636=this['channel'][_0x6a7e('0xba')](_0x22c997[_0x6a7e('0x66')]);if(_0x27e636['result']===-0x1){return _0x27e636;}}return this[_0x6a7e('0x10')][_0x6a7e('0xb7')]();};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xbb')]=function(_0x2b9cca){logger['info'](util[_0x6a7e('0x51')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2b9cca[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x2b9cca[_0x6a7e('0x46')])){return this['channel'][_0x6a7e('0x30')](_0x2b9cca,_0x6a7e('0xbc'));}_0x2b9cca[_0x6a7e('0x47')]=moment();if(this[_0x6a7e('0x84')](_0x2b9cca[_0x6a7e('0xbd')])){_0x2b9cca[_0x6a7e('0x47')]=moment()[_0x6a7e('0xbe')](_0x2b9cca[_0x6a7e('0xbd')],_0x6a7e('0xbf'));}if(!this['isConfigured'](_0x2b9cca[_0x6a7e('0x4a')])){_0x2b9cca[_0x6a7e('0x4a')]=0x2;}this[_0x6a7e('0x41')][_0x6a7e('0x6f')](this,_0x2b9cca);return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2b9cca[_0x6a7e('0x45')],_0x2b9cca[_0x6a7e('0x46')],_0x2b9cca[_0x6a7e('0x47')]));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xc0')]=function(_0x406052){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x406052[_0x6a7e('0xa6')]));var _0xd3f2d=this[_0x6a7e('0x10')][_0x6a7e('0x55')](_0x406052[_0x6a7e('0xc1')],_0x406052['options']);if(_0xd3f2d[_0x6a7e('0xa8')]===-0x1){return _0xd3f2d;}return this[_0x6a7e('0x10')]['noop'](util['format'](_0x6a7e('0xc2'),_0x406052[_0x6a7e('0xc1')],_0x406052[_0x6a7e('0x78')]));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xc3')]=function(_0x34c17e){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0xc4'),_0x34c17e[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x34c17e[_0x6a7e('0x5b')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}var _0x416cf1='\x22'+_0x34c17e[_0x6a7e('0x5b')]+'\x22';if(this[_0x6a7e('0x84')](_0x34c17e[_0x6a7e('0x78')])){_0x416cf1+=','+_0x34c17e[_0x6a7e('0x78')];}var _0x8401ef=this['channel'][_0x6a7e('0x55')]('MRCPSynth',_0x416cf1);if(_0x8401ef[_0x6a7e('0xa8')]===-0x1){return _0x8401ef;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x416cf1));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xc5')]=function(_0x6cb27c){logger['info'](util[_0x6a7e('0x51')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x6cb27c[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x6cb27c[_0x6a7e('0x5b')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}var _0x4c4f5c='\x22'+_0x6cb27c['text']+'\x22';if(this[_0x6a7e('0x84')](_0x6cb27c[_0x6a7e('0x78')])){_0x4c4f5c+=','+_0x6cb27c[_0x6a7e('0x78')];}var _0x1cd448=this['channel'][_0x6a7e('0x55')](_0x6a7e('0xc6'),_0x4c4f5c);if(_0x1cd448['result']===-0x1){return _0x1cd448;}return this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4c4f5c));};AGIVertices[_0x6a7e('0x1c')]['lumenvoxasr']=function(_0x460199){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0xc7'),_0x460199[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x460199[_0x6a7e('0xad')])){return this['channel'][_0x6a7e('0xa9')]('no\x20grammar\x20configured');}var _0x288136=_0x460199[_0x6a7e('0xad')];if(this['isConfigured'](_0x460199[_0x6a7e('0x78')])){_0x288136+=','+_0x460199[_0x6a7e('0x78')];}var _0x343dd5=this[_0x6a7e('0x10')]['exec']('MRCPRecog',_0x288136);if(_0x343dd5['result']===-0x1){return _0x343dd5;}var _0xb82632=this['getAndSetVariable'](_0x6a7e('0xaf'),'LUMENVOX_ASR_CONFIDENCE');if(_0xb82632[_0x6a7e('0xa8')]===-0x1){return _0xb82632;}var _0x3867df=this[_0x6a7e('0xa1')](_0x6a7e('0xb1'),_0x6a7e('0xc8'));if(_0x3867df[_0x6a7e('0xa8')]===-0x1){return _0x3867df;}var _0x43795d=this[_0x6a7e('0xa1')](_0x6a7e('0xb2'),'LUMENVOX_ASR_INSTANCE');if(_0x43795d[_0x6a7e('0xa8')]===-0x1){return _0x43795d;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xb4'),_0x288136));};AGIVertices[_0x6a7e('0x1c')]['sestekasr']=function(_0x51cbfb){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0xc9'),_0x51cbfb[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x51cbfb[_0x6a7e('0xad')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xac'));}var _0x3d1100=_0x51cbfb[_0x6a7e('0xad')];if(this[_0x6a7e('0x84')](_0x51cbfb['options'])){_0x3d1100+=','+_0x51cbfb['options'];}var _0x19dc67=this['channel']['exec'](_0x6a7e('0xae'),_0x3d1100);if(_0x19dc67[_0x6a7e('0xa8')]===-0x1){return _0x19dc67;}var _0x462dc7=this[_0x6a7e('0xa1')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x462dc7['result']===-0x1){return _0x462dc7;}var _0x3ee192=this[_0x6a7e('0xa1')]('RECOG_INPUT()',_0x6a7e('0xca'));if(_0x3ee192['result']===-0x1){return _0x3ee192;}var _0x23b7b4=this[_0x6a7e('0xa1')](_0x6a7e('0xb2'),'SESTEK_ASR_INSTANCE');if(_0x23b7b4[_0x6a7e('0xa8')]===-0x1){return _0x23b7b4;}return this['channel']['noop'](util[_0x6a7e('0x51')](_0x6a7e('0xb4'),_0x3d1100));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xcb')]=function(_0x412ade){logger[_0x6a7e('0x2a')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x412ade[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x412ade['odbc_id'])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x412ade,'no\x20database\x20selected');}var _0x24ca62=this[_0x6a7e('0xcc')][_0x6a7e('0x6f')](this,_0x412ade[_0x6a7e('0xcd')]);if(!_0x24ca62){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x412ade,_0x6a7e('0xce'));}if(!this[_0x6a7e('0x84')](_0x412ade['query'])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x412ade,'no\x20query\x20configured');}var _0x4ac896=_0x412ade[_0x6a7e('0x2c')][_0x6a7e('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xcf'),_0x4ac896));var _0x58f304=this[_0x6a7e('0x28')][_0x6a7e('0x6f')](this,_0x24ca62,_0x4ac896);this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x412ade,_0x4ac896);if(!this[_0x6a7e('0x84')](_0x412ade[_0x6a7e('0xd0')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0xd1'));}var _0x22e6d7=this['getVariable'][_0x6a7e('0x6f')](this,_0x412ade[_0x6a7e('0xd0')]);if(!_0x22e6d7){return this['channel']['error'](_0x412ade,'no\x20variable\x20found');}var _0xc896c1=this;_0x58f304[_0x6a7e('0xd2')](function(_0x3f001e,_0x251b21){Object[_0x6a7e('0xd3')](_0x3f001e)[_0x6a7e('0xd2')](function(_0x1643a9){_0xc896c1[_0x6a7e('0x10')][_0x6a7e('0x9e')](util['format'](_0x6a7e('0xd4'),_0x22e6d7,_0x251b21,_0x1643a9),_0x3f001e[_0x1643a9]);});});this[_0x6a7e('0x10')]['setVariable'](util[_0x6a7e('0x51')](_0x6a7e('0xd5'),_0x22e6d7),_0x58f304[_0x6a7e('0x9a')]);return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format']('variable\x20%s\x20set',_0x22e6d7));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xd6')]=function(_0x49c933){logger[_0x6a7e('0xd7')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x49c933[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x49c933[_0x6a7e('0xd8')])){return this['channel'][_0x6a7e('0x30')](_0x49c933,_0x6a7e('0xd9'));}var _0x387cff=this[_0x6a7e('0x1a')][_0x6a7e('0x6f')](this,_0x49c933[_0x6a7e('0xd8')]);if(!_0x387cff){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x49c933,_0x6a7e('0xda'));}var _0x1389d8=this[_0x6a7e('0x10')][_0x6a7e('0x55')](_0x6a7e('0xdb'),[util[_0x6a7e('0x51')](_0x6a7e('0xdc'),_0x387cff),_0x49c933[_0x6a7e('0x66')],_0x49c933['opts'],_0x49c933['url']]);if(_0x1389d8[_0x6a7e('0xa8')]===-0x1){return _0x1389d8;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xdd'),_0x6a7e('0xdb')));};AGIVertices[_0x6a7e('0x1c')]['dialogflow']=function(_0x49f02a){logger['info'](util['format'](_0x6a7e('0xde'),_0x49f02a[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x49f02a['key'])){return this['channel'][_0x6a7e('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x49f02a['text'])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')]['bot']=!![];this[_0x6a7e('0x35')](_0x49f02a);this['createSquareMessage'](_0x49f02a['text'],'in','','');this[_0x6a7e('0x10')]['noop'](util['format'](_0x6a7e('0xdf'),_0x49f02a[_0x6a7e('0x5b')]));var _0x1ad781=this[_0x6a7e('0x79')][_0x6a7e('0x6f')](this,_0x49f02a);if(_0x1ad781){for(var _0x56f7e2 in _0x1ad781){if(_0x1ad781['hasOwnProperty'](_0x56f7e2)){this['channel'][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0xe0'),_0x56f7e2[_0x6a7e('0x6b')]()),_0x1ad781[_0x56f7e2]);}}this[_0x6a7e('0xe1')](_0x1ad781[_0x6a7e('0xe2')],_0x6a7e('0xe3'),_0x6a7e('0xe4'),'');return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('Dialogflow\x20Result\x20%s',_0x1ad781['speech']));}return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x49f02a,_0x6a7e('0xe5'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xe6')]=function(_0xcf1abd){logger['info'](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xcf1abd['label']));if(!this[_0x6a7e('0x84')](_0xcf1abd[_0x6a7e('0x7d')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xe7'));}if(!this[_0x6a7e('0x84')](_0xcf1abd[_0x6a7e('0xe8')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0xe9'));}if(!this[_0x6a7e('0x84')](_0xcf1abd['private_key'])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xea'));}if(!this[_0x6a7e('0x84')](_0xcf1abd[_0x6a7e('0xeb')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xec'));}if(!this[_0x6a7e('0x84')](_0xcf1abd[_0x6a7e('0x5b')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')][_0x6a7e('0xed')]=!![];this[_0x6a7e('0x35')](_0xcf1abd);this['createSquareMessage'](_0xcf1abd['text'],'in','','');this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format'](_0x6a7e('0xee'),_0xcf1abd[_0x6a7e('0x5b')]));var _0x219f7d=this[_0x6a7e('0x7c')][_0x6a7e('0x6f')](this,_0xcf1abd);if(_0x219f7d){for(var _0x3d5c4c in _0x219f7d){if(_0x219f7d[_0x6a7e('0x96')](_0x3d5c4c)){if(_0x3d5c4c!=='providerResponse'){this['channel'][_0x6a7e('0x9e')](util['format'](_0x6a7e('0xe0'),_0x3d5c4c[_0x6a7e('0x6b')]()),_0x219f7d[_0x3d5c4c]);}}}this['createSquareMessage'](_0x219f7d['speech'],_0x6a7e('0xe3'),'dialogflowV2',_0x219f7d[_0x6a7e('0xef')]);return this['channel'][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xf0'),_0x219f7d[_0x6a7e('0xe2')]));}return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0xcf1abd,_0x6a7e('0xf1'));};AGIVertices[_0x6a7e('0x1c')]['sesteknda']=function(_0x1300be){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0xf2'),_0x1300be[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x1300be[_0x6a7e('0xf3')])){return this['channel']['noop'](_0x6a7e('0xf4'));}if(!this['isConfigured'](_0x1300be['username'])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')]('no\x20username\x20configured');}if(!this[_0x6a7e('0x84')](_0x1300be[_0x6a7e('0xf5')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0xf6'));}if(!this[_0x6a7e('0x84')](_0x1300be[_0x6a7e('0xf7')])){return this['channel']['noop'](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')]['bot']=!![];this[_0x6a7e('0x35')](_0x1300be);this[_0x6a7e('0xe1')](_0x1300be[_0x6a7e('0x5b')],'in','','');this['channel'][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('Trying\x20SestekNDA:\x20%s',_0x1300be[_0x6a7e('0x5b')]));var _0x1be1bc=this['sestekNDA']['sync'](this,_0x1300be);if(_0x1be1bc){for(var _0x18ebfd in _0x1be1bc){if(_0x1be1bc[_0x6a7e('0x96')](_0x18ebfd)){this['channel'][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0xf8'),_0x18ebfd[_0x6a7e('0x6b')]()),_0x1be1bc[_0x18ebfd]);}}this[_0x6a7e('0xe1')](_0x1be1bc[_0x6a7e('0xe2')],_0x6a7e('0xe3'),_0x6a7e('0xf9'),'');if(_0x1be1bc[_0x6a7e('0xfa')]){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xfb'),_0x1be1bc[_0x6a7e('0xfa')]));var _0x263284=this[_0x6a7e('0x10')]['streamFile'](_0x1be1bc[_0x6a7e('0xfa')]);try{fs[_0x6a7e('0xfc')](_0x1be1bc[_0x6a7e('0xfa')]+_0x6a7e('0xfd'));}catch(_0x43629f){logger[_0x6a7e('0x30')](_0x43629f);}return _0x263284;}else{return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xfe'),_0x1be1bc[_0x6a7e('0xe2')]));}}return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x1300be,_0x6a7e('0xff'));};AGIVertices['prototype'][_0x6a7e('0x100')]=function(_0x39b8e7){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x101'),_0x39b8e7['label']));return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x100'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x102')]=function(_0x4b8060){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4b8060[_0x6a7e('0xa6')]));var _0x4520a1='';if(_0x4b8060[_0x6a7e('0x103')]){if(!this['isConfigured'](_0x4b8060[_0x6a7e('0x103')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x4b8060,_0x6a7e('0x104'));}else{var _0x43c7fb=parseInt(_0x4b8060[_0x6a7e('0x103')],0xa);if(isNaN(_0x43c7fb)){_0x4520a1=_0x4b8060['trunk_id'];}else{_0x4520a1=this[_0x6a7e('0x105')][_0x6a7e('0x6f')](this,_0x4b8060[_0x6a7e('0x103')]);if(!_0x4520a1){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x4b8060,_0x6a7e('0x106'));}}}}else if(_0x4b8060[_0x6a7e('0x107')]){_0x4520a1=_0x4b8060[_0x6a7e('0x107')];}else{return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x4b8060,'no\x20trunk\x20selected');}var _0x51556d=this[_0x6a7e('0x10')][_0x6a7e('0x55')]('DIAL',[util[_0x6a7e('0x51')](_0x6a7e('0x108'),_0x4520a1,_0x4b8060[_0x6a7e('0x45')]),_0x4b8060[_0x6a7e('0x66')],_0x4b8060[_0x6a7e('0x109')],_0x4b8060[_0x6a7e('0x64')]]);if(_0x51556d[_0x6a7e('0xa8')]===-0x1){return _0x51556d;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xdd'),_0x6a7e('0xdb')));};AGIVertices['prototype'][_0x6a7e('0x10a')]=function(_0x37de2d){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x10b'),_0x37de2d[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x10a'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xe')]=function(_0x1a1a86){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x10c'),_0x1a1a86['label']));if(_0x1a1a86['retry']===0x0){return this[_0x6a7e('0xa3')](_0x1a1a86);}_0x1a1a86[_0x6a7e('0xa4')]-=0x1;if(!this[_0x6a7e('0x84')](_0x1a1a86[_0x6a7e('0x10d')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x1a1a86,_0x6a7e('0x10e'));}var _0x349050=this[_0x6a7e('0x1e')][_0x6a7e('0x6f')](this,_0x1a1a86[_0x6a7e('0x10d')]);if(!_0x349050){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x1a1a86,'no\x20file\x20audio\x20found');}if(!this[_0x6a7e('0x84')](_0x1a1a86['variable_id'])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x6a7e('0xd1'));}var _0x55c6aa=this[_0x6a7e('0x10')][_0x6a7e('0x10f')](_0x349050,_0x1a1a86['response'],_0x1a1a86[_0x6a7e('0x110')]);var _0xf15fab=_0x55c6aa[_0x6a7e('0xa8')]?_0x55c6aa[_0x6a7e('0xa8')]['toString']():'';logger[_0x6a7e('0x2a')](_0x6a7e('0x111'),JSON[_0x6a7e('0x73')](_0x55c6aa));if(_0x55c6aa[_0x6a7e('0xa8')]===-0x1){this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x1a1a86,_0xf15fab);return _0x55c6aa;}else if(_0x55c6aa['extra']==='timeout'){_0x55c6aa[_0x6a7e('0xa8')]=_0xf15fab[_0x6a7e('0x9a')]>=parseInt(_0x1a1a86[_0x6a7e('0x112')])?'x':'i';}else{_0x55c6aa[_0x6a7e('0xa8')]=_0xf15fab[_0x6a7e('0x9a')]>=parseInt(_0x1a1a86[_0x6a7e('0x112')])&&_0xf15fab['length']<=parseInt(_0x1a1a86['maxdigit'])?'x':'i';}var _0x102f08=this[_0x6a7e('0x113')][_0x6a7e('0x6f')](this,_0x1a1a86[_0x6a7e('0xd0')]);if(!_0x102f08){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x1a1a86,_0x6a7e('0x114'));}this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x102f08,_0xf15fab);if(this[_0x6a7e('0x84')](_0x1a1a86['hiddendigitsnum'])){var _0x24edee=parseInt(_0x1a1a86[_0x6a7e('0x115')],0xa);var _0x1bb007=rs['generate']({'charset':'*','length':_0x24edee});var _0x53fb06=_0xf15fab[_0x6a7e('0x9a')];if(_0x53fb06>0x0){if(_0x53fb06>_0x24edee){this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x1a1a86,_0x1a1a86['hiddendigitspos']==='first'?_0x1bb007+_0xf15fab[_0x6a7e('0x116')](_0x24edee):_0xf15fab[_0x6a7e('0x116')](0x0,_0x53fb06-_0x24edee)+_0x1bb007);}else{this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x1a1a86,rs[_0x6a7e('0x117')]({'charset':'*','length':_0x53fb06}));}}else{this['createSquareDetailsReport'][_0x6a7e('0x6f')](this,_0x1a1a86,'');}}else{this[_0x6a7e('0x35')]['sync'](this,_0x1a1a86,_0xf15fab);}return _0x55c6aa;};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xf')]=function(_0xdd0c0c){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x118'),_0xdd0c0c['label']));return this['getdigits'](_0xdd0c0c);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x119')]=function(_0x5b0532){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x5b0532[_0x6a7e('0xa6')]));this[_0x6a7e('0x35')]['sync'](this,_0x5b0532,_0x5b0532['goalname']);return this[_0x6a7e('0x10')]['noop'](util['format'](_0x6a7e('0x11a'),_0x5b0532[_0x6a7e('0x11b')]));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x11c')]=function(_0x5a59d7){logger[_0x6a7e('0x2a')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5a59d7['label']));if(!this[_0x6a7e('0x84')](_0x5a59d7[_0x6a7e('0x86')])||!this[_0x6a7e('0x84')](_0x5a59d7[_0x6a7e('0x8c')])){return this['channel'][_0x6a7e('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x5a59d7['text'])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')]('no\x20text\x20configured');}this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x11d'),_0x5a59d7[_0x6a7e('0x5b')]));var _0x10789c=this[_0x6a7e('0x85')][_0x6a7e('0x6f')](this,_0x5a59d7);if(_0x10789c){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x10789c));var _0x146a53=this[_0x6a7e('0x10')][_0x6a7e('0x11e')](_0x10789c);try{fs[_0x6a7e('0xfc')](_0x10789c+_0x6a7e('0xfd'));}catch(_0x5829f9){logger[_0x6a7e('0x30')](_0x5829f9);}return _0x146a53;}return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x5a59d7,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x11f')]=function(_0x539150){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x539150['label']));if(!this[_0x6a7e('0x84')](_0x539150[_0x6a7e('0x86')])||!this[_0x6a7e('0x84')](_0x539150[_0x6a7e('0x8c')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0x120'));}if(!this[_0x6a7e('0x84')](_0x539150[_0x6a7e('0x8e')])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0x121'));}if(!this[_0x6a7e('0x84')](_0x539150[_0x6a7e('0x5b')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')][_0x6a7e('0xed')]=!![];this[_0x6a7e('0x35')](_0x539150);this[_0x6a7e('0xe1')](_0x539150[_0x6a7e('0x5b')],'in','','');this['channel'][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x122'),_0x539150[_0x6a7e('0x5b')]));var _0x443030=this[_0x6a7e('0x8b')][_0x6a7e('0x6f')](this,_0x539150);if(_0x443030){for(var _0x2ddb90 in _0x443030){if(_0x443030['hasOwnProperty'](_0x2ddb90)&&_[_0x6a7e('0x94')](_0x443030[_0x2ddb90])){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0x123'),_0x2ddb90[_0x6a7e('0x6b')]()),_0x443030[_0x2ddb90]);}}if(_[_0x6a7e('0x43')](_0x443030[_0x6a7e('0x76')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x124'));}else{this[_0x6a7e('0xe1')](_0x443030[_0x6a7e('0x76')],_0x6a7e('0xe3'),'amazonlex','');return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('Amazon\x20Lex\x20Result\x20%s',_0x443030[_0x6a7e('0x76')]));}}return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x539150,_0x6a7e('0x125'));};AGIVertices[_0x6a7e('0x1c')]['googleasr']=function(_0x2d3291){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x126'),_0x2d3291[_0x6a7e('0xa6')],_0x2d3291[_0x6a7e('0x66')]));if(!this[_0x6a7e('0x84')](_0x2d3291[_0x6a7e('0x7a')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x127'));}var _0x82320e='wav';var _0x1af7c5=util[_0x6a7e('0x51')](_0x6a7e('0x128'),FILES_PATH,rs[_0x6a7e('0x117')](0x4));var _0xd8d25e=util[_0x6a7e('0x51')]('%s.%s',_0x1af7c5,_0x82320e);var _0x48af61=!![];if(_0x2d3291[_0x6a7e('0x129')]===_0x6a7e('0x12a')){_0x48af61=![];}var _0x53932f=this[_0x6a7e('0x10')][_0x6a7e('0x12b')](_0x1af7c5,_0x82320e,_0x2d3291[_0x6a7e('0x12c')],_0x2d3291['timeout'],undefined,_0x48af61);if(_0x53932f[_0x6a7e('0xa8')]!==-0x1){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format'](_0x6a7e('0x12d'),_0xd8d25e));var _0x586384=this[_0x6a7e('0x12e')][_0x6a7e('0x6f')](this,_0x2d3291,_0xd8d25e);if(_0x586384){for(var _0x3180b8 in _0x586384){if(_0x586384[_0x6a7e('0x96')](_0x3180b8)){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util['format'](_0x6a7e('0x12f'),_0x3180b8[_0x6a7e('0x6b')]()),_0x586384[_0x3180b8]);}}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x130'),JSON['stringify'](_0x586384)));}}return _0x53932f;};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x131')]=function(_0x23274a){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x132'),_0x23274a[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x23274a['appid'])){return this[_0x6a7e('0x10')]['noop'](_0x6a7e('0x133'));}if(!this[_0x6a7e('0x84')](_0x23274a[_0x6a7e('0x91')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x134'));}var _0x21c6db=_0x6a7e('0x135');var _0x5145c9=util[_0x6a7e('0x51')](_0x6a7e('0x128'),FILES_PATH,rs[_0x6a7e('0x117')](0x4));var _0x2568f7=util[_0x6a7e('0x51')](_0x6a7e('0x9d'),_0x5145c9,_0x21c6db);var _0x18a132=!![];if(_0x23274a[_0x6a7e('0x129')]===_0x6a7e('0x12a')){_0x18a132=![];}var _0x4b03e6=this[_0x6a7e('0x10')][_0x6a7e('0x12b')](_0x5145c9,_0x21c6db,_0x23274a[_0x6a7e('0x12c')],_0x23274a['timeout'],undefined,_0x18a132);if(_0x4b03e6['result']!==-0x1){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x136'),_0x2568f7));var _0x4b04c=this[_0x6a7e('0x137')][_0x6a7e('0x6f')](this,_0x23274a,_0x2568f7);if(_0x4b04c){for(var _0x2bfd95 in _0x4b04c){if(_0x4b04c[_0x6a7e('0x96')](_0x2bfd95)){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0x138'),_0x2bfd95['toUpperCase']()),_0x4b04c[_0x2bfd95]);}}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x139'),JSON[_0x6a7e('0x73')](_0x4b04c)));}}return _0x4b03e6;};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x13a')]=function(_0x4cbe8f){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x13b'),_0x4cbe8f[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')][_0x6a7e('0x13c')](_0x4cbe8f[_0x6a7e('0x3c')],_0x4cbe8f[_0x6a7e('0x13d')],_0x4cbe8f[_0x6a7e('0x3d')]);};AGIVertices['prototype'][_0x6a7e('0x13e')]=function(_0x1b4c41){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x13f'),_0x1b4c41[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x1b4c41['condition'])){return this[_0x6a7e('0x10')]['error'](_0x1b4c41,'no\x20condition\x20configured');}try{var _0x4d348b=eval(_0x1b4c41[_0x6a7e('0x140')])?_0x6a7e('0x141'):_0x6a7e('0x142');this['channel']['noop'](util['format'](_0x6a7e('0x143'),_0x1b4c41['condition'],_0x4d348b));return{'code':0xc8,'result':_0x4d348b};}catch(_0x4f440c){return{'code':0xc8,'result':_0x6a7e('0x142')};}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x144')]=function(_0x558157){logger[_0x6a7e('0x2a')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x558157['label']));if(!this[_0x6a7e('0x84')](_0x558157[_0x6a7e('0x145')])){return this['channel'][_0x6a7e('0x30')](_0x558157,_0x6a7e('0x146'));}var _0x48f9b6=this[_0x6a7e('0x147')][_0x6a7e('0x6f')](this,_0x558157[_0x6a7e('0x145')]);if(!_0x48f9b6){return this['channel']['error'](_0x558157,_0x6a7e('0x148'));}for(var _0x1356b4=0x0;_0x1356b4<_0x48f9b6[_0x6a7e('0x9a')];_0x1356b4+=0x1){var _0x1235ec=this['channel'][_0x6a7e('0x113')](util['format']('IFTIME(%s?true:false)',_0x48f9b6[_0x1356b4]));if(_0x1235ec[_0x6a7e('0xa8')]===-0x1){return _0x1235ec;}logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x149'),_0x48f9b6[_0x1356b4],_0x1235ec[_0x6a7e('0xa0')]));if(_0x1235ec['extra']===_0x6a7e('0x141')){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x149'),_0x48f9b6[_0x1356b4],_0x6a7e('0x141')));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('IFTIME\x20%s\x20%s',_0x48f9b6[_0x1356b4],_0x6a7e('0x141')));return{'code':0xc8,'result':_0x6a7e('0x141')};}else{logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('IFTIME\x20%s\x20%s',_0x48f9b6[_0x1356b4],_0x6a7e('0x142')));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format'](_0x6a7e('0x149'),_0x48f9b6[_0x1356b4],_0x6a7e('0x142')));}}return{'code':0xc8,'result':_0x6a7e('0x142')};};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x14a')]=function(_0xd6b47a){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x14b'),_0xd6b47a[_0x6a7e('0xa6')]));return this['channel'][_0x6a7e('0x14a')]();};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x14c')]=function(_0x459cf5){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x14d'),_0x459cf5[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x459cf5[_0x6a7e('0x7a')])){return this[_0x6a7e('0x10')]['noop']('no\x20key\x20configured');}var _0xf94e9d=_0x6a7e('0x135');var _0x15ae8b=util[_0x6a7e('0x51')]('%s/recordings/%s',FILES_PATH,rs[_0x6a7e('0x117')](0x4));var _0x23e33b=util['format']('%s.%s',_0x15ae8b,_0xf94e9d);var _0x2db8d7=!![];if(_0x459cf5[_0x6a7e('0x129')]===_0x6a7e('0x12a')){_0x2db8d7=![];}var _0x1a4516=this['channel'][_0x6a7e('0x12b')](_0x15ae8b,_0xf94e9d,_0x459cf5[_0x6a7e('0x12c')],_0x459cf5[_0x6a7e('0x66')],undefined,_0x2db8d7);if(_0x1a4516[_0x6a7e('0xa8')]!==-0x1){this['channel'][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x14e'),_0x23e33b));var _0x180bb1=this[_0x6a7e('0x82')]['sync'](this,_0x459cf5,_0x23e33b);if(_0x180bb1){for(var _0xdcadc0 in _0x180bb1){if(_0x180bb1[_0x6a7e('0x96')](_0xdcadc0)){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util[_0x6a7e('0x51')](_0x6a7e('0x14f'),_0xdcadc0[_0x6a7e('0x6b')]()),_0x180bb1[_0xdcadc0]);}}return this['channel']['noop'](util[_0x6a7e('0x51')](_0x6a7e('0x150'),JSON[_0x6a7e('0x73')](_0x180bb1)));}}return _0x1a4516;};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x151')]=function(_0x3cef12){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3cef12[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x3cef12[_0x6a7e('0x7a')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')]('no\x20key\x20configured');}if(!this[_0x6a7e('0x84')](_0x3cef12[_0x6a7e('0x5b')])){return this[_0x6a7e('0x10')]['noop']('no\x20text\x20configured');}this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format'](_0x6a7e('0x152'),_0x3cef12[_0x6a7e('0x5b')]));var _0x495574=this[_0x6a7e('0x80')][_0x6a7e('0x6f')](this,_0x3cef12);if(_0x495574){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x14e'),_0x495574));var _0x3d8c3b=this[_0x6a7e('0x10')][_0x6a7e('0x11e')](_0x495574,_0x3cef12[_0x6a7e('0x12c')]);try{fs['unlink'](_0x495574+'.wav');}catch(_0x3e68ef){logger[_0x6a7e('0x30')](_0x3e68ef);}return _0x3d8c3b;}return this[_0x6a7e('0x10')]['error'](_0x3cef12,_0x6a7e('0x153'));};AGIVertices['prototype'][_0x6a7e('0x154')]=function(_0x3fc67a){logger['info'](util['format'](_0x6a7e('0x155'),_0x3fc67a[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x3fc67a[_0x6a7e('0x156')])){return this['channel']['error'](_0x3fc67a,_0x6a7e('0x157'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x3fc67a['findBy']));var _0x523c62=this[_0x6a7e('0x54')][_0x6a7e('0x6f')](this,_0x3fc67a[_0x6a7e('0x156')]);if(_0x523c62){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x158'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x3fc67a[_0x6a7e('0x156')]));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x158'),this['channel'][_0x6a7e('0x38')],_0x3fc67a['findBy']));return{'code':0xc8,'result':_0x6a7e('0x159')};}else{logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x15a'),this[_0x6a7e('0x10')]['callerid'],_0x3fc67a[_0x6a7e('0x156')]));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x15a'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x3fc67a[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x15b')};}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x15c')]=function(_0x533b28){logger['info'](util[_0x6a7e('0x51')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x533b28[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x533b28['findBy'])){return this[_0x6a7e('0x10')]['error'](_0x533b28,_0x6a7e('0x157'));}logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x15d'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x533b28[_0x6a7e('0x156')]));var _0x238b06=this['agentLogout'][_0x6a7e('0x6f')](this,_0x533b28[_0x6a7e('0x156')]);if(_0x238b06){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a7e('0x10')]['callerid'],_0x533b28['findBy']));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x158'),this[_0x6a7e('0x10')]['callerid'],_0x533b28[_0x6a7e('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x15a'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x533b28[_0x6a7e('0x156')]));this['channel'][_0x6a7e('0xa9')](util['format'](_0x6a7e('0x15a'),this[_0x6a7e('0x10')]['callerid'],_0x533b28[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x15b')};}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x15e')]=function(_0x52f42c){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x15f'),_0x52f42c[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x52f42c[_0x6a7e('0x160')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x52f42c,_0x6a7e('0x161'));}this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')](_0x6a7e('0x162'),_0x52f42c['operation']));var _0x274e42=eval(_0x52f42c[_0x6a7e('0x160')]);if(!this['isConfigured'](_0x52f42c[_0x6a7e('0xd0')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xd1'));}var _0x5c0bec=this[_0x6a7e('0x113')]['sync'](this,_0x52f42c[_0x6a7e('0xd0')]);if(!_0x5c0bec){return this['channel'][_0x6a7e('0x30')](_0x52f42c,'no\x20variable\x20found');}if(_[_0x6a7e('0x99')](_0x274e42)){var _0x5b2e22=this;_0x274e42[_0x6a7e('0xd2')](function(_0x660086,_0x9f46aa){_0x5b2e22['channel']['setVariable'](util[_0x6a7e('0x51')](_0x6a7e('0x163'),_0x5c0bec,_0x9f46aa),_0x660086);});return this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')](_0x6a7e('0x164'),_0x5c0bec));}else{return this[_0x6a7e('0x10')]['setVariable'](_0x5c0bec,_0x274e42);}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xd')]=function(_0x1540b9){logger['info'](util[_0x6a7e('0x51')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1540b9['label']));if(_0x1540b9[_0x6a7e('0xa4')]===0x0){return this[_0x6a7e('0xa3')](_0x1540b9);}_0x1540b9[_0x6a7e('0xa4')]-=0x1;if(!this[_0x6a7e('0x84')](_0x1540b9[_0x6a7e('0x10d')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x1540b9,_0x6a7e('0x10e'));}var _0xe1d6d4=this[_0x6a7e('0x1e')][_0x6a7e('0x6f')](this,_0x1540b9[_0x6a7e('0x10d')]);if(!_0xe1d6d4){return this[_0x6a7e('0x10')]['error'](_0x1540b9,_0x6a7e('0x165'));}var _0x5f02d3=this[_0x6a7e('0x10')][_0x6a7e('0x10f')](_0xe1d6d4,_0x1540b9[_0x6a7e('0x166')],_0x1540b9[_0x6a7e('0x167')]);var _0x4f90f9=_0x5f02d3[_0x6a7e('0xa8')];if(_0x5f02d3[_0x6a7e('0xa8')]===-0x1){this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x1540b9,'-1');return _0x5f02d3;}else if(_0x5f02d3[_0x6a7e('0xa0')]===_0x6a7e('0x66')){_0x5f02d3[_0x6a7e('0xa8')]=_0x5f02d3['result'][_0x6a7e('0x9a')]>0x0?_0x5f02d3[_0x6a7e('0xa8')]:'t';}else if(_['isEmpty'](_0x5f02d3[_0x6a7e('0xa8')])){_0x5f02d3[_0x6a7e('0xa8')]='#';_0x4f90f9='#';}if(!this[_0x6a7e('0x84')](_0x1540b9[_0x6a7e('0xd0')])){this[_0x6a7e('0x10')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x38e8ff=this[_0x6a7e('0x113')]['sync'](this,_0x1540b9[_0x6a7e('0xd0')]);if(!_0x38e8ff){return this['channel']['error'](_0x1540b9,_0x6a7e('0x114'));}this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x38e8ff,_0x4f90f9);}this['createSquareDetailsReport'][_0x6a7e('0x6f')](this,_0x1540b9,_0x4f90f9);return _0x5f02d3;};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0xa9')]=function(_0x548bd0){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x168'),_0x548bd0[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x548bd0[_0x6a7e('0x169')]||_0x548bd0['label']);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x16a')]=function(_0x47958c){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x16b'),_0x47958c['label']));if(!this[_0x6a7e('0x84')](_0x47958c['findBy'])){return this[_0x6a7e('0x10')]['error'](_0x47958c,_0x6a7e('0x157'));}logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x15d'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x47958c[_0x6a7e('0x156')]));var _0xfdb437=this[_0x6a7e('0x4b')][_0x6a7e('0x6f')](this,_0x47958c[_0x6a7e('0x16c')]);var _0x11ddff=this[_0x6a7e('0x4d')][_0x6a7e('0x6f')](this,_0x47958c[_0x6a7e('0x156')],_0xfdb437);if(_0x11ddff){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x158'),this['channel']['callerid'],_0x47958c[_0x6a7e('0x156')]));this['channel']['noop'](util[_0x6a7e('0x51')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a7e('0x10')]['callerid'],_0x47958c[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x159')};}else{logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x15a'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x47958c['findBy']));this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x158'),this['channel'][_0x6a7e('0x38')],_0x47958c[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x15b')};}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x16d')]=function(_0x45daff){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x16e'),_0x45daff[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x45daff[_0x6a7e('0x10d')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x45daff,_0x6a7e('0x10e'));}var _0x4897fd=this['getSound'][_0x6a7e('0x6f')](this,_0x45daff['file_id']);if(!_0x4897fd){return this['channel'][_0x6a7e('0x30')](_0x45daff,'no\x20file\x20audio\x20found');}var _0x5ed6fb=this[_0x6a7e('0x10')]['exec'](_0x6a7e('0x16f'),[_0x4897fd,_0x45daff[_0x6a7e('0x109')]]);if(_0x5ed6fb[_0x6a7e('0xa8')]===-0x1){return _0x5ed6fb;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xc2'),_0x6a7e('0x16f'),_0x4897fd));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x170')]=function(_0xeb7224){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x171'),_0xeb7224[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0xeb7224[_0x6a7e('0x172')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0xeb7224,_0x6a7e('0x173'));}var _0x8e2df0='';var _0x58de25=parseInt(_0xeb7224[_0x6a7e('0x172')],0xa);if(isNaN(_0x58de25)){_0x8e2df0=_0xeb7224[_0x6a7e('0x172')];}else{_0x8e2df0=this[_0x6a7e('0x16')][_0x6a7e('0x6f')](this,_0xeb7224[_0x6a7e('0x172')]);if(!_0x8e2df0){return this['channel'][_0x6a7e('0x30')](_0xeb7224,'no\x20queue\x20found');}}var _0x1ee507='';if(this['isConfigured'](_0xeb7224[_0x6a7e('0x10d')])){var _0x2dadba=this[_0x6a7e('0x1e')][_0x6a7e('0x6f')](this,_0xeb7224[_0x6a7e('0x10d')]);if(_0x2dadba){_0x1ee507=_0x2dadba;}}this[_0x6a7e('0x35')]['sync'](this,_0xeb7224,_0x8e2df0);if(_0xeb7224[_0x6a7e('0x109')][_0x6a7e('0x174')]('x')<0x0){_0xeb7224[_0x6a7e('0x109')]+='x';}if(_0xeb7224['opts'][_0x6a7e('0x174')]('X')<0x0){_0xeb7224[_0x6a7e('0x109')]+='X';}this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x6a7e('0x175'),_0x8e2df0?_0x8e2df0[_0x6a7e('0x176')]():'');var _0x169a5c=this[_0x6a7e('0x10')]['exec'](_0x6a7e('0x177'),[_0x8e2df0,_0xeb7224[_0x6a7e('0x109')],_0xeb7224[_0x6a7e('0x64')],_0x1ee507,_0xeb7224[_0x6a7e('0x66')],_0xeb7224[_0x6a7e('0x8')],_0xeb7224[_0x6a7e('0x178')],_0xeb7224[_0x6a7e('0x179')],'',_0xeb7224[_0x6a7e('0x17a')]]);if(_0x169a5c[_0x6a7e('0xa8')]===-0x1){return _0x169a5c;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0xc2'),_0x6a7e('0x177'),_0x8e2df0));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x17b')]=function(_0x48c4f0){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x17c'),_0x48c4f0[_0x6a7e('0xa6')]));var _0x2fc87b=_0x48c4f0[_0x6a7e('0x17d')]||_0x6a7e('0x135');var _0x1c4ed5=util['format'](_0x6a7e('0x17e'),this[_0x6a7e('0x10')]['uniqueid'],rs[_0x6a7e('0x117')](0x5));var _0x353256=util[_0x6a7e('0x51')](_0x6a7e('0x17f'),FILES_PATH,_0x1c4ed5,_0x2fc87b);var _0x4cbb6a=util[_0x6a7e('0x51')]('%s/recordings/%s',FILES_PATH,_0x1c4ed5);this[_0x6a7e('0x39')][_0x6a7e('0x6f')](this,_0x48c4f0,_0x1c4ed5,_0x353256);this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x6a7e('0x180'),_0x1c4ed5);logger['info'](_0x6a7e('0x181'),_0x4cbb6a,_0x2fc87b,_0x48c4f0[_0x6a7e('0x182')],_0x48c4f0[_0x6a7e('0x66')]);return this[_0x6a7e('0x10')][_0x6a7e('0x12b')](_0x4cbb6a,_0x2fc87b,_0x48c4f0['escape_digits'],_0x48c4f0[_0x6a7e('0x66')],undefined,!![]);};AGIVertices[_0x6a7e('0x1c')]['restapi']=function(_0x3dc183){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x183'),_0x3dc183[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x3dc183[_0x6a7e('0x64')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0x184'));}var _0x5e35b4=this[_0x6a7e('0x63')][_0x6a7e('0x6f')](this,_0x3dc183);logger['info'](util[_0x6a7e('0x51')]('Response:',util[_0x6a7e('0x185')](_0x5e35b4,{'showHidden':![],'depth':null})));if(!this[_0x6a7e('0x84')](_0x3dc183['variable_id'])){return this['channel'][_0x6a7e('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x2bbe3a=this[_0x6a7e('0x113')][_0x6a7e('0x6f')](this,_0x3dc183[_0x6a7e('0xd0')]);if(!_0x2bbe3a){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x3dc183,_0x6a7e('0x114'));}this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util['format'](_0x6a7e('0x186'),_0x2bbe3a),_0x5e35b4['statusCode']?_0x5e35b4['statusCode']:_0x6a7e('0x187'));this[_0x6a7e('0x10')][_0x6a7e('0x9e')](util[_0x6a7e('0x51')]('%s_STATUS_MESSAGE',_0x2bbe3a),_0x5e35b4[_0x6a7e('0x75')]?_0x5e35b4['statusMessage']:'OK');if(_0x5e35b4[_0x6a7e('0x6c')]){try{this[_0x6a7e('0x9c')](_0x5e35b4[_0x6a7e('0x6c')],_0x2bbe3a);}catch(_0x5b8217){logger[_0x6a7e('0x30')](util[_0x6a7e('0x51')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2bbe3a));}}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x188'),_0x2bbe3a));};AGIVertices['prototype'][_0x6a7e('0x189')]=function(_0x201e5c){logger['info'](util[_0x6a7e('0x51')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x201e5c[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')][_0x6a7e('0x18a')](_0x201e5c[_0x6a7e('0x18b')][_0x6a7e('0x57')](/\s+/g,''),_0x201e5c['escape_digits']);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x18c')]=function(_0x283fbc){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x18d'),_0x283fbc[_0x6a7e('0xa6')]));return this['channel'][_0x6a7e('0x18e')](_0x283fbc[_0x6a7e('0x67')]['replace'](/\s+/g,''),_0x283fbc[_0x6a7e('0x182')]);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x18f')]=function(_0x29dc24){logger[_0x6a7e('0x2a')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x29dc24[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')]['sayPhonetic'](_0x29dc24[_0x6a7e('0x5b')],_0x29dc24[_0x6a7e('0x182')]);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x190')]=function(_0x24cd52){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x191'),_0x24cd52['label']));if(!this[_0x6a7e('0x84')](_0x24cd52[_0x6a7e('0x192')])){return this[_0x6a7e('0x10')]['noop']('no\x20mail\x20account\x20configured');}var _0x5af9d7=this[_0x6a7e('0x21')]['sync'](this,_0x24cd52[_0x6a7e('0x192')]);if(!_0x5af9d7||!_0x5af9d7[_0x6a7e('0x193')]){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x24cd52,_0x6a7e('0x194'));}var _0x54bfc4={'from':util[_0x6a7e('0x51')](_0x6a7e('0x195'),_0x5af9d7[_0x6a7e('0x14')],_0x5af9d7[_0x6a7e('0x196')]||_0x5af9d7[_0x6a7e('0x193')]['user']),'to':_0x24cd52['to']||'','cc':_0x24cd52['cc']||'','bcc':_0x24cd52[_0x6a7e('0x197')]||'','subject':_0x24cd52[_0x6a7e('0x198')],'html':_0x24cd52['text'],'text':_0x24cd52[_0x6a7e('0x5b')]};if(this['isConfigured'](_0x24cd52['template_id'])){}logger[_0x6a7e('0xd7')]('sendMail\x20message',JSON[_0x6a7e('0x73')](_0x54bfc4));this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x24cd52,_0x24cd52[_0x6a7e('0x192')]);this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x199'),_0x5af9d7[_0x6a7e('0x14')]));this['sendMailMessage'][_0x6a7e('0x6f')](this,_0x5af9d7['smtpOptions'],_0x54bfc4);return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x19a'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x19b')]=function(_0x31eaef){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x19c'),_0x31eaef[_0x6a7e('0xa6')]));return this[_0x6a7e('0x10')][_0x6a7e('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x19d')]=function(_0x4b8dbc){logger[_0x6a7e('0x2a')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4b8dbc[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0x4b8dbc[_0x6a7e('0x19e')])){return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x19f'));}var _0x124700=this['getSmsAccount'][_0x6a7e('0x6f')](this,_0x4b8dbc[_0x6a7e('0x19e')]);if(!_0x124700){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x4b8dbc,_0x6a7e('0x1a0'));}var _0x4604df={'body':_0x4b8dbc[_0x6a7e('0x1a1')],'phone':_0x4b8dbc['to']||'','SmsAccountId':_0x124700['id']};logger[_0x6a7e('0xd7')](_0x6a7e('0x1a2'),JSON[_0x6a7e('0x73')](_0x4604df));this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x4b8dbc,_0x4b8dbc[_0x6a7e('0x19e')]);this['channel'][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x1a3'),_0x124700[_0x6a7e('0x14')]));this[_0x6a7e('0x34')][_0x6a7e('0x6f')](this,_0x4604df);return this[_0x6a7e('0x10')][_0x6a7e('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x6a7e('0x1a4')]=function(_0x327604){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x1a5'),_0x327604[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x327604[_0x6a7e('0xd0')])){return this['channel'][_0x6a7e('0x30')](_0x327604,_0x6a7e('0x1a6'));}var _0x5a5f76=this['getVariable']['sync'](this,_0x327604['variable_id']);if(!_0x5a5f76){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x327604,_0x6a7e('0x114'));}return this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x5a5f76,_0x327604[_0x6a7e('0x1a7')]);};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1a8')]=function(_0x20c355){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x1a9'),_0x20c355[_0x6a7e('0xa6')]));this[_0x6a7e('0x10')]['noop'](_0x6a7e('0x1aa'));var _0x4c8f5e=this[_0x6a7e('0x10')][_0x6a7e('0x113')](_0x6a7e('0x1ab'));if(!_[_0x6a7e('0x42')](_0x4c8f5e['extra'])){this[_0x6a7e('0x10')]['uniqueid']=_0x4c8f5e[_0x6a7e('0xa0')];}if(_0x20c355[_0x6a7e('0xb7')]==='yes'){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x1ac'));return this[_0x6a7e('0x10')][_0x6a7e('0xb7')]();}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](_0x6a7e('0x1ad'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1ae')]=function(_0x2f63de){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x1af'),_0x2f63de['label']));if(!this[_0x6a7e('0x84')](_0x2f63de[_0x6a7e('0x1b0')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x2f63de,_0x6a7e('0x1b1'));}var _0x4782b9=this['getSquareProject'][_0x6a7e('0x6f')](this,_0x2f63de['project_id']);if(!this[_0x6a7e('0x84')](_0x4782b9)){return this[_0x6a7e('0x10')]['error'](_0x2f63de,util[_0x6a7e('0x51')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2f63de['project_id']));}if(_0x4782b9===this['channel'][_0x6a7e('0x37')]){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x2f63de,_0x6a7e('0x1b2'));}this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x2f63de,_0x4782b9);var _0x177433=this[_0x6a7e('0x10')][_0x6a7e('0x55')](_0x6a7e('0x1b3'),util[_0x6a7e('0x51')](_0x6a7e('0x1b4'),config[_0x6a7e('0x8')][_0x6a7e('0x1b5')]||_0x6a7e('0x1b6'),_0x4782b9,this[_0x6a7e('0x10')]['arg_1']));if(_0x177433[_0x6a7e('0xa8')]===-0x1){return _0x177433;}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util['format'](_0x6a7e('0xc2'),'AGI',_0x4782b9));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1b7')]=function(_0x27b369){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x27b369[_0x6a7e('0xa6')]));var _0x7156a6=this[_0x6a7e('0x1b8')][_0x6a7e('0x6f')](this,_0x27b369[_0x6a7e('0x1b9')]);this[_0x6a7e('0x35')][_0x6a7e('0x6f')](this,_0x27b369,_0x27b369[_0x6a7e('0x1b9')]);if(this[_0x6a7e('0x84')](_0x27b369[_0x6a7e('0xd0')])){var _0x1217d9=this[_0x6a7e('0x113')][_0x6a7e('0x6f')](this,_0x27b369[_0x6a7e('0xd0')]);if(_0x1217d9){this[_0x6a7e('0x10')][_0x6a7e('0x9e')](_0x1217d9,_0x7156a6);return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x1ba'),_0x27b369[_0x6a7e('0x1b9')],_0x1217d9));}}return this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')](_0x6a7e('0x1bb'),_0x27b369['command']));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1bc')]=function(_0x80a549){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x1bd'),_0x80a549[_0x6a7e('0xa6')]));_0x80a549[_0x6a7e('0x5b')]=_0x80a549[_0x6a7e('0x5b')][_0x6a7e('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6a7e('0x84')](_0x80a549['apiKey'])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0x1be'));}if(!this['isConfigured'](_0x80a549[_0x6a7e('0x5b')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x80a549[_0x6a7e('0x5b')]));var _0xcf8e76=this[_0x6a7e('0x58')]['sync'](this,_0x80a549);if(_0xcf8e76){this[_0x6a7e('0x10')][_0x6a7e('0xa9')](util[_0x6a7e('0x51')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xcf8e76));var _0x5c4638=this[_0x6a7e('0x10')]['streamFile'](_0xcf8e76);try{fs[_0x6a7e('0xfc')](_0xcf8e76+_0x6a7e('0xfd'));}catch(_0x26fd71){logger[_0x6a7e('0x30')](_0x26fd71);}return _0x5c4638;}return this['channel'][_0x6a7e('0x30')](_0x80a549,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1bf')]=function(_0x3b5aa2){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x1c0'),_0x3b5aa2['label']));_0x3b5aa2[_0x6a7e('0x5b')]=_0x3b5aa2[_0x6a7e('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6a7e('0x84')](_0x3b5aa2[_0x6a7e('0x5b')])){return this['channel'][_0x6a7e('0xa9')](_0x6a7e('0xa7'));}this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')](_0x6a7e('0x1c1'),_0x3b5aa2[_0x6a7e('0x5b')]));var _0x4afcd0=this[_0x6a7e('0x61')][_0x6a7e('0x6f')](this,_0x3b5aa2);if(_0x4afcd0){this['channel']['noop'](util[_0x6a7e('0x51')]('Google\x20TTS\x20%s\x20file\x20created',_0x4afcd0));var _0x27fd60=this[_0x6a7e('0x10')][_0x6a7e('0x11e')](_0x4afcd0);try{fs[_0x6a7e('0xfc')](_0x4afcd0+_0x6a7e('0xfd'));}catch(_0x3c5ff8){logger[_0x6a7e('0x30')](_0x3c5ff8);}return _0x27fd60;}return this['channel'][_0x6a7e('0x30')](_0x3b5aa2,_0x6a7e('0x1c2'));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1c3')]=function(_0x5111){logger['info'](util['format'](_0x6a7e('0x1c4'),_0x5111[_0x6a7e('0xa6')]));if(!this[_0x6a7e('0x84')](_0x5111[_0x6a7e('0x156')])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0x5111,_0x6a7e('0x157'));}logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x15d'),this['channel'][_0x6a7e('0x38')],_0x5111[_0x6a7e('0x156')]));var _0x5736a4=this['agentUnpause'][_0x6a7e('0x6f')](this,_0x5111[_0x6a7e('0x156')]);if(_0x5736a4){logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x158'),this['channel'][_0x6a7e('0x38')],_0x5111['findBy']));this['channel'][_0x6a7e('0xa9')](util['format'](_0x6a7e('0x158'),this['channel'][_0x6a7e('0x38')],_0x5111[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x159')};}else{logger[_0x6a7e('0x2a')](util['format'](_0x6a7e('0x15a'),this[_0x6a7e('0x10')][_0x6a7e('0x38')],_0x5111['findBy']));this[_0x6a7e('0x10')]['noop'](util[_0x6a7e('0x51')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x6a7e('0x38')],_0x5111[_0x6a7e('0x156')]));return{'code':0xc8,'result':_0x6a7e('0x15b')};}};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1c5')]=function(_0x1d6691){logger[_0x6a7e('0x2a')](util[_0x6a7e('0x51')](_0x6a7e('0x1c6'),_0x1d6691[_0x6a7e('0xa6')]));var _0x2517d8=this[_0x6a7e('0x10')]['exec'](_0x6a7e('0x1c7'),[_0x1d6691[_0x6a7e('0x1c8')],_0x1d6691[_0x6a7e('0x78')]]);if(_0x2517d8[_0x6a7e('0xa8')]===-0x1){return _0x2517d8;}return this['channel'][_0x6a7e('0xa9')](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x1d6691['mailbox']));};AGIVertices[_0x6a7e('0x1c')][_0x6a7e('0x1c9')]=function(_0xfe7599){logger['info'](util[_0x6a7e('0x51')](_0x6a7e('0x1ca'),_0xfe7599[_0x6a7e('0xa6')]));if(!this['isConfigured'](_0xfe7599['variable_id'])){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0xfe7599,_0x6a7e('0x1a6'));}var _0x5e945d=this[_0x6a7e('0x113')]['sync'](this,_0xfe7599[_0x6a7e('0xd0')]);if(!_0x5e945d){return this[_0x6a7e('0x10')][_0x6a7e('0x30')](_0xfe7599,'no\x20variable\x20found');}var _0x591657=this['channel'][_0x6a7e('0x113')](_0x5e945d);return{'code':0xc8,'result':_0x591657[_0x6a7e('0xa0')]?_0x591657[_0x6a7e('0xa0')]:'-'};};String[_0x6a7e('0x1c')][_0x6a7e('0x1cb')]=function(_0x12599a,_0x52d8b3){return this[_0x6a7e('0x9f')](_0x12599a)[_0x6a7e('0x1cc')](_0x52d8b3);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 90a7c89..265e0b5 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 _0x6ba8=['[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','getAgent','pauseType','ACW','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','voicePause'];(function(_0x374075,_0x59ffb7){var _0x1fd0d3=function(_0xc73480){while(--_0xc73480){_0x374075['push'](_0x374075['shift']());}};_0x1fd0d3(++_0x59ffb7);}(_0x6ba8,0x1c4));var _0x86ba=function(_0x2e067e,_0x8d7faf){_0x2e067e=_0x2e067e-0x0;var _0x4a0076=_0x6ba8[_0x2e067e];return _0x4a0076;};'use strict';var _=require(_0x86ba('0x0'));var moment=require(_0x86ba('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x86ba('0x2'));var RpcUser=require(_0x86ba('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3ec3c9){this[_0x86ba('0x4')]=_0x3ec3c9['voiceQueues'];this['agents']=_0x3ec3c9[_0x86ba('0x5')];this[_0x86ba('0x6')]=_0x3ec3c9[_0x86ba('0x6')];this[_0x86ba('0x7')]={};ami['on'](_0x86ba('0x8'),this['syncAgentConnect'][_0x86ba('0x9')](this));ami['on'](_0x86ba('0xa'),this[_0x86ba('0xb')]['bind'](this));ami['on'](_0x86ba('0xc'),this[_0x86ba('0xd')]['bind'](this));ami['on']('agentringnoanswer',this[_0x86ba('0xe')][_0x86ba('0x9')](this));ami['on'](_0x86ba('0xf'),this[_0x86ba('0x10')][_0x86ba('0x9')](this));ami['on'](_0x86ba('0x11'),this[_0x86ba('0x12')][_0x86ba('0x9')](this));ami['on'](_0x86ba('0x13'),this[_0x86ba('0x14')][_0x86ba('0x9')](this));}function getDiff(_0xabf33e){var _0x2563bb=moment()[_0x86ba('0x15')](0x0);var _0x3e0712=moment(_0xabf33e)[_0x86ba('0x15')](0x0);return _0x2563bb[_0x86ba('0x16')](_0x3e0712,_0x86ba('0x17'));}Acw[_0x86ba('0x18')]['updateAcw']=function(_0x975101,_0x2eb322){var _0x639691=this;var _0x3cf2ae=getDiff(_0x639691['timers'][_0x975101][_0x86ba('0x19')]);clearTimeout(_0x639691['timers'][_0x975101]['timer']);_0x639691[_0x86ba('0x6')][_0x975101][_0x86ba('0x1a')]=![];return RpcVoiceAgentReport[_0x86ba('0x1b')]({'acwtime':_0x3cf2ae},_0x639691[_0x86ba('0x6')][_0x975101][_0x86ba('0x1c')],_0x975101)[_0x86ba('0x1d')](function(_0xb4a77c){logger[_0x86ba('0x1e')](_0x86ba('0x1f'),_0x2eb322,_0x3cf2ae,_0xb4a77c);})[_0x86ba('0x20')](function(_0x1e3b68){logger[_0x86ba('0x21')](_0x86ba('0x22'),_0x2eb322,_0x1e3b68);})[_0x86ba('0x23')](function(){delete _0x639691[_0x86ba('0x6')][_0x975101];});};Acw[_0x86ba('0x18')][_0x86ba('0x24')]=function(_0x1d4066){try{var _0x8e6b81=this;var _0x3001fb=this[_0x86ba('0x7')][_0x1d4066][_0x86ba('0x25')];var _0x8c0613=this['channels'][_0x1d4066][_0x86ba('0x26')];var _0x6061ed=this[_0x86ba('0x4')][_0x8c0613];var _0x3ec21a=![];var _0x29283f='ACW';if(_0x6061ed['mandatoryDisposition']&&_0x6061ed['mandatoryDispositionPause']['name']){_0x3ec21a=!![];_0x29283f=_0x6061ed['mandatoryDispositionPause']['name'];}if(!_0x8e6b81[_0x86ba('0x5')][_0x3001fb]){return Promise['resolve']();}return RpcUser['getAgent'](_0x8e6b81['agents'][_0x3001fb]['id'])[_0x86ba('0x1d')](function(_0x3d5e37){if(!_0x3d5e37||_0x3d5e37[_0x86ba('0x27')]){logger[_0x86ba('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x1d4066,_0x3001fb,_0x8c0613);return;}logger[_0x86ba('0x1e')](_0x86ba('0x28'),_0x1d4066,_0x3001fb,_0x8c0613);var _0x4fdf08=_0x8e6b81[_0x86ba('0x7')][_0x1d4066][_0x86ba('0x29')]&&_0x8e6b81[_0x86ba('0x7')][_0x1d4066][_0x86ba('0x2a')]?_0x8e6b81[_0x86ba('0x7')][_0x1d4066][_0x86ba('0x2a')]:_0x1d4066;return RpcUser['savePause'](_0x8e6b81['agents'][_0x3001fb],_0x29283f,_0x4fdf08)[_0x86ba('0x1d')](function(_0x3f52c1){_0x8e6b81[_0x86ba('0x4')][_0x8c0613]['available']-=0x1;_0x8e6b81[_0x86ba('0x4')][_0x8c0613][_0x86ba('0x2b')]+=0x1;return _0x3f52c1;});})[_0x86ba('0x1d')](function(_0x17c739){if(_0x3ec21a||!_0x17c739){return;}_0x8e6b81[_0x86ba('0x6')][_0x3001fb]={};logger[_0x86ba('0x1e')](_0x86ba('0x2c'),_0x1d4066,_0x8e6b81[_0x86ba('0x4')][_0x8c0613][_0x86ba('0x2d')],_0x3001fb,_0x8c0613);_0x8e6b81[_0x86ba('0x6')][_0x3001fb][_0x86ba('0x1a')]=setTimeout(_0x8e6b81[_0x86ba('0x2e')][_0x86ba('0x9')](_0x8e6b81,_0x3001fb),_0x8e6b81['voiceQueues'][_0x8c0613][_0x86ba('0x2d')]*0x3e8);_0x8e6b81[_0x86ba('0x6')][_0x3001fb]['lastPauseAt']=moment()[_0x86ba('0x2f')](_0x86ba('0x30'));_0x8e6b81[_0x86ba('0x6')][_0x3001fb][_0x86ba('0x1c')]=_0x1d4066;_0x8e6b81['timers'][_0x3001fb]['queue']=_0x8c0613;_0x8e6b81[_0x86ba('0x6')][_0x3001fb][_0x86ba('0x31')]=_0x8e6b81[_0x86ba('0x31')][_0x86ba('0x9')](_0x8e6b81,_0x3001fb,_0x1d4066);})[_0x86ba('0x20')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1d4066,_0x8e6b81[_0x86ba('0x4')][_0x8c0613]['acwTimeout'],_0x3001fb,_0x8c0613);})[_0x86ba('0x23')](function(){delete _0x8e6b81[_0x86ba('0x7')][_0x1d4066];});}catch(_0x2fb5fe){logger[_0x86ba('0x21')](_0x86ba('0x32'),_0x2fb5fe[_0x86ba('0x33')]);}};Acw[_0x86ba('0x18')]['stopAcw']=function(_0x155a34){try{var _0x32fc3b=this;if(_0x32fc3b[_0x86ba('0x6')][_0x155a34]){_0x32fc3b[_0x86ba('0x6')][_0x155a34][_0x86ba('0x1a')]=![];var _0xff27e8=_0x32fc3b['timers'][_0x155a34][_0x86ba('0x1c')];var _0x39f435=_0x32fc3b[_0x86ba('0x6')][_0x155a34]['queue'];var _0x13b979=_0x32fc3b['voiceQueues'][_0x39f435][_0x86ba('0x2d')];logger['info'](_0x86ba('0x34'),_0xff27e8,_0x155a34);RpcUser[_0x86ba('0x35')](this[_0x86ba('0x5')][_0x155a34]['id'])[_0x86ba('0x1d')](function(_0x270f78){if(_0x270f78[_0x86ba('0x36')]===_0x86ba('0x37')){return RpcUser[_0x86ba('0x38')](_0x32fc3b['agents'][_0x155a34]);}});RpcVoiceAgentReport[_0x86ba('0x1b')]({'acwtime':_0x13b979,'agentacw':!![]},_0xff27e8,_0x155a34)[_0x86ba('0x1d')](function(_0x3563fb){logger[_0x86ba('0x1e')](_0x86ba('0x1f'),_0xff27e8,_0x13b979,_0x3563fb);})['catch'](function(_0x260019){logger[_0x86ba('0x21')](_0x86ba('0x22'),_0xff27e8,_0x260019);});}else{logger[_0x86ba('0x21')](_0x86ba('0x39'),_0x155a34);if(_0x32fc3b['timers']){logger[_0x86ba('0x1e')](_0x86ba('0x3a'),JSON['stringify'](_0x32fc3b[_0x86ba('0x6')]));}}}catch(_0x49a99e){logger['error'](_0x86ba('0x3b'),_0x49a99e['message']);}};Acw[_0x86ba('0x18')][_0x86ba('0x3c')]=function(_0x2c4f5b){try{if(this['voiceQueues'][_0x2c4f5b['queue']]&&(this[_0x86ba('0x4')][_0x2c4f5b[_0x86ba('0x26')]][_0x86ba('0x2')]||this[_0x86ba('0x4')][_0x2c4f5b[_0x86ba('0x26')]]['mandatoryDisposition'])){if(this[_0x86ba('0x5')][_0x2c4f5b['interface']]){this['channels'][_0x2c4f5b[_0x86ba('0x1c')]]={'queue':_0x2c4f5b[_0x86ba('0x26')],'interface':_0x2c4f5b[_0x86ba('0x25')],'destlinkedid':_0x2c4f5b['destlinkedid']};}}}catch(_0x2b60d4){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x2b60d4['message']);}};Acw['prototype'][_0x86ba('0x14')]=function(_0x156f78){try{if(this['voiceQueues'][_0x156f78[_0x86ba('0x26')]]&&(this[_0x86ba('0x4')][_0x156f78[_0x86ba('0x26')]][_0x86ba('0x2')]||this[_0x86ba('0x4')][_0x156f78[_0x86ba('0x26')]]['mandatoryDisposition'])){if(this[_0x86ba('0x5')][_0x156f78[_0x86ba('0x25')]]){this[_0x86ba('0x7')][_0x156f78[_0x86ba('0x1c')]]={'queue':_0x156f78[_0x86ba('0x26')],'interface':_0x156f78[_0x86ba('0x25')]};}}}catch(_0x5ccd2d){logger[_0x86ba('0x21')]('[ACW][syncAgentConnectPreview]\x20%s',_0x5ccd2d[_0x86ba('0x33')]);}};Acw[_0x86ba('0x18')][_0x86ba('0xb')]=function(_0x2aad16){try{if(this['channels'][_0x2aad16['uniqueid']]&&_['isUndefined'](this[_0x86ba('0x7')][_0x2aad16[_0x86ba('0x1c')]][_0x86ba('0x29')])){logger[_0x86ba('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x2aad16[_0x86ba('0x1c')]);this[_0x86ba('0x24')](_0x2aad16[_0x86ba('0x1c')]);}else if(this[_0x86ba('0x7')][_0x2aad16[_0x86ba('0x3d')]]&&_['isUndefined'](this[_0x86ba('0x7')][_0x2aad16[_0x86ba('0x3d')]][_0x86ba('0x29')])){logger['info'](_0x86ba('0x3e'),_0x2aad16['linkedid']);this[_0x86ba('0x24')](_0x2aad16[_0x86ba('0x3d')]);}}catch(_0x248479){logger[_0x86ba('0x21')]('[ACW][syncHangupRequest]\x20%s',_0x248479[_0x86ba('0x33')]);}};Acw[_0x86ba('0x18')][_0x86ba('0xd')]=function(_0x3cbefc){try{if(this[_0x86ba('0x7')][_0x3cbefc[_0x86ba('0x1c')]]&&this[_0x86ba('0x7')][_0x3cbefc[_0x86ba('0x1c')]][_0x86ba('0x29')]){logger[_0x86ba('0x1e')](_0x86ba('0x3f'),_0x3cbefc[_0x86ba('0x1c')]);this[_0x86ba('0x24')](_0x3cbefc[_0x86ba('0x1c')]);}else if(this[_0x86ba('0x7')][_0x3cbefc['linkedid']]&&this['channels'][_0x3cbefc[_0x86ba('0x3d')]]['attended']){logger[_0x86ba('0x1e')](_0x86ba('0x40'),_0x3cbefc['linkedid']);this[_0x86ba('0x24')](_0x3cbefc[_0x86ba('0x3d')]);}}catch(_0x437c38){logger[_0x86ba('0x21')]('[ACW][syncHangup]\x20%s',_0x437c38[_0x86ba('0x33')]);}};Acw[_0x86ba('0x18')][_0x86ba('0x10')]=function(_0x2131f7){try{if(!_[_0x86ba('0x41')](this[_0x86ba('0x7')][_0x2131f7['transfereeuniqueid']])){this['startAcw'](_0x2131f7['transfereeuniqueid']);if(this['channels'][_0x2131f7[_0x86ba('0x42')]]){this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x42')]][_0x86ba('0x29')]=!![];this['channels'][_0x2131f7[_0x86ba('0x43')]]=this[_0x86ba('0x7')][_0x2131f7['secondtransfereruniqueid']];delete this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x42')]];}}else if(!_[_0x86ba('0x41')](this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x43')]])){this[_0x86ba('0x24')](_0x2131f7['transfertargetuniqueid']);if(this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x44')]]){this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x44')]][_0x86ba('0x29')]=!![];this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x45')]]=this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x44')]];delete this[_0x86ba('0x7')][_0x2131f7[_0x86ba('0x44')]];}}}catch(_0x52fed2){logger['error'](_0x86ba('0x46'),_0x52fed2[_0x86ba('0x33')]);}};Acw[_0x86ba('0x18')][_0x86ba('0x12')]=function(_0x39955d){try{if(this['channels'][_0x39955d[_0x86ba('0x47')]]){logger[_0x86ba('0x1e')](_0x86ba('0x48'),JSON[_0x86ba('0x49')](_0x39955d[_0x86ba('0x47')]));this['startAcw'](_0x39955d[_0x86ba('0x47')]);}else if(this[_0x86ba('0x7')][_0x39955d[_0x86ba('0x4a')]]){logger[_0x86ba('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x86ba('0x49')](_0x39955d['transfererlinkedid']));this[_0x86ba('0x24')](_0x39955d[_0x86ba('0x4a')]);}}catch(_0x23ab76){logger['error'](_0x86ba('0x4b'),_0x23ab76['message']);}};Acw[_0x86ba('0x18')][_0x86ba('0xe')]=function(_0x16041a){try{if(this['voiceQueues'][_0x16041a['queue']]&&this[_0x86ba('0x4')][_0x16041a[_0x86ba('0x26')]]['autopause']===_0x86ba('0x4c')){if(this[_0x86ba('0x5')][_0x16041a[_0x86ba('0x25')]]){logger['info'](_0x86ba('0x4d'),_0x16041a[_0x86ba('0x1c')],_0x16041a['interface'],_0x16041a[_0x86ba('0x26')]);return RpcUser[_0x86ba('0x4e')](this['agents'][_0x16041a[_0x86ba('0x25')]],_0x86ba('0x4f'),_0x16041a[_0x86ba('0x1c')]);}}}catch(_0x3745dd){logger[_0x86ba('0x21')](_0x86ba('0x50'),_0x3745dd[_0x86ba('0x33')]);}};module[_0x86ba('0x51')]=Acw; \ No newline at end of file +var _0xa90a=['[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','available','paused','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','linkedid','attended','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','seconds','updateAcw','lastPauseAt','timer','uniqueid','then','info'];(function(_0x2e2fd8,_0x130a97){var _0x1c5dbf=function(_0x502b5a){while(--_0x502b5a){_0x2e2fd8['push'](_0x2e2fd8['shift']());}};_0x1c5dbf(++_0x130a97);}(_0xa90a,0x1f4));var _0xaa90=function(_0x127f4a,_0x396d33){_0x127f4a=_0x127f4a-0x0;var _0x338fcd=_0xa90a[_0x127f4a];return _0x338fcd;};'use strict';var _=require(_0xaa90('0x0'));var moment=require(_0xaa90('0x1'));var ami=require(_0xaa90('0x2'));var logger=require(_0xaa90('0x3'))(_0xaa90('0x4'));var RpcUser=require(_0xaa90('0x5'));var RpcVoiceAgentReport=require(_0xaa90('0x6'));function Acw(_0x465e95){this[_0xaa90('0x7')]=_0x465e95[_0xaa90('0x7')];this[_0xaa90('0x8')]=_0x465e95[_0xaa90('0x8')];this[_0xaa90('0x9')]=_0x465e95[_0xaa90('0x9')];this[_0xaa90('0xa')]={};ami['on'](_0xaa90('0xb'),this['syncAgentConnect']['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xaa90('0xc')](this));ami['on']('hangup',this[_0xaa90('0xd')]['bind'](this));ami['on'](_0xaa90('0xe'),this['syncAgentRingNoAnswer'][_0xaa90('0xc')](this));ami['on'](_0xaa90('0xf'),this[_0xaa90('0x10')][_0xaa90('0xc')](this));ami['on'](_0xaa90('0x11'),this['syncBlindTransfer'][_0xaa90('0xc')](this));ami['on'](_0xaa90('0x12'),this['syncAgentConnectPreview'][_0xaa90('0xc')](this));}function getDiff(_0x213874){var _0x2c12ad=moment()['milliseconds'](0x0);var _0x35a353=moment(_0x213874)[_0xaa90('0x13')](0x0);return _0x2c12ad[_0xaa90('0x14')](_0x35a353,_0xaa90('0x15'));}Acw['prototype'][_0xaa90('0x16')]=function(_0x1c5a95,_0x82ff6f){var _0x409e57=this;var _0x15a62e=getDiff(_0x409e57['timers'][_0x1c5a95][_0xaa90('0x17')]);clearTimeout(_0x409e57[_0xaa90('0x9')][_0x1c5a95][_0xaa90('0x18')]);_0x409e57[_0xaa90('0x9')][_0x1c5a95][_0xaa90('0x18')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x15a62e},_0x409e57['timers'][_0x1c5a95][_0xaa90('0x19')],_0x1c5a95)[_0xaa90('0x1a')](function(_0x1b6cc8){logger[_0xaa90('0x1b')](_0xaa90('0x1c'),_0x82ff6f,_0x15a62e,_0x1b6cc8);})[_0xaa90('0x1d')](function(_0x4ec77b){logger[_0xaa90('0x1e')](_0xaa90('0x1f'),_0x82ff6f,_0x4ec77b);})[_0xaa90('0x20')](function(){delete _0x409e57['timers'][_0x1c5a95];});};Acw[_0xaa90('0x21')][_0xaa90('0x22')]=function(_0x53bfc1){try{var _0x2709f9=this;var _0x319b3a=this[_0xaa90('0xa')][_0x53bfc1][_0xaa90('0x23')];var _0x3a5209=this[_0xaa90('0xa')][_0x53bfc1][_0xaa90('0x24')];var _0x46de74=this['voiceQueues'][_0x3a5209];var _0x2843f3=![];var _0x37e46d=_0xaa90('0x25');if(_0x46de74[_0xaa90('0x26')]&&_0x46de74[_0xaa90('0x27')][_0xaa90('0x28')]){_0x2843f3=!![];_0x37e46d=_0x46de74[_0xaa90('0x27')][_0xaa90('0x28')];}if(!_0x2709f9[_0xaa90('0x8')][_0x319b3a]){return Promise['resolve']();}return RpcUser[_0xaa90('0x29')](_0x2709f9[_0xaa90('0x8')][_0x319b3a]['id'])['then'](function(_0x4e98c3){if(!_0x4e98c3||_0x4e98c3[_0xaa90('0x2a')]){logger[_0xaa90('0x1b')](_0xaa90('0x2b'),_0x53bfc1,_0x319b3a,_0x3a5209);return;}logger[_0xaa90('0x1b')](_0xaa90('0x2c'),_0x53bfc1,_0x319b3a,_0x3a5209);var _0x3d2c54=_0x2709f9[_0xaa90('0xa')][_0x53bfc1]['attended']&&_0x2709f9[_0xaa90('0xa')][_0x53bfc1][_0xaa90('0x2d')]?_0x2709f9['channels'][_0x53bfc1]['destlinkedid']:_0x53bfc1;return RpcUser['savePause'](_0x2709f9[_0xaa90('0x8')][_0x319b3a],_0x37e46d,_0x3d2c54)[_0xaa90('0x1a')](function(_0x4cc4d2){_0x2709f9['voiceQueues'][_0x3a5209][_0xaa90('0x2e')]-=0x1;_0x2709f9['voiceQueues'][_0x3a5209][_0xaa90('0x2f')]+=0x1;return _0x4cc4d2;});})[_0xaa90('0x1a')](function(_0x308778){if(_0x2843f3||!_0x308778){return;}_0x2709f9['timers'][_0x319b3a]={};logger[_0xaa90('0x1b')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x53bfc1,_0x2709f9['voiceQueues'][_0x3a5209][_0xaa90('0x30')],_0x319b3a,_0x3a5209);_0x2709f9[_0xaa90('0x9')][_0x319b3a][_0xaa90('0x18')]=setTimeout(_0x2709f9[_0xaa90('0x31')][_0xaa90('0xc')](_0x2709f9,_0x319b3a),_0x2709f9[_0xaa90('0x7')][_0x3a5209][_0xaa90('0x30')]*0x3e8);_0x2709f9[_0xaa90('0x9')][_0x319b3a]['lastPauseAt']=moment()['format'](_0xaa90('0x32'));_0x2709f9[_0xaa90('0x9')][_0x319b3a][_0xaa90('0x19')]=_0x53bfc1;_0x2709f9[_0xaa90('0x9')][_0x319b3a][_0xaa90('0x24')]=_0x3a5209;_0x2709f9[_0xaa90('0x9')][_0x319b3a][_0xaa90('0x16')]=_0x2709f9[_0xaa90('0x16')][_0xaa90('0xc')](_0x2709f9,_0x319b3a,_0x53bfc1);})['catch'](function(){logger[_0xaa90('0x1e')](_0xaa90('0x33'),_0x53bfc1,_0x2709f9[_0xaa90('0x7')][_0x3a5209][_0xaa90('0x30')],_0x319b3a,_0x3a5209);})[_0xaa90('0x20')](function(){delete _0x2709f9[_0xaa90('0xa')][_0x53bfc1];});}catch(_0x1d74ff){logger[_0xaa90('0x1e')](_0xaa90('0x34'),_0x1d74ff[_0xaa90('0x35')]);}};Acw['prototype'][_0xaa90('0x31')]=function(_0x37bbd2){try{var _0xa1788f=this;if(_0xa1788f[_0xaa90('0x9')][_0x37bbd2]){_0xa1788f[_0xaa90('0x9')][_0x37bbd2][_0xaa90('0x18')]=![];var _0x23c9f6=_0xa1788f[_0xaa90('0x9')][_0x37bbd2][_0xaa90('0x19')];var _0x56daa3=_0xa1788f[_0xaa90('0x9')][_0x37bbd2]['queue'];var _0x1fb39b=_0xa1788f[_0xaa90('0x7')][_0x56daa3][_0xaa90('0x30')];logger['info'](_0xaa90('0x36'),_0x23c9f6,_0x37bbd2);RpcUser[_0xaa90('0x29')](this['agents'][_0x37bbd2]['id'])[_0xaa90('0x1a')](function(_0x2d62f6){if(_0x2d62f6['pauseType']===_0xaa90('0x25')){return RpcUser['saveUnpause'](_0xa1788f['agents'][_0x37bbd2]);}});RpcVoiceAgentReport[_0xaa90('0x37')]({'acwtime':_0x1fb39b,'agentacw':!![]},_0x23c9f6,_0x37bbd2)[_0xaa90('0x1a')](function(_0x3f74bc){logger[_0xaa90('0x1b')](_0xaa90('0x1c'),_0x23c9f6,_0x1fb39b,_0x3f74bc);})[_0xaa90('0x1d')](function(_0x5e657a){logger[_0xaa90('0x1e')]('[%s][UPDATE][ERRORS:%s]',_0x23c9f6,_0x5e657a);});}else{logger[_0xaa90('0x1e')](_0xaa90('0x38'),_0x37bbd2);if(_0xa1788f[_0xaa90('0x9')]){logger['info'](_0xaa90('0x39'),JSON[_0xaa90('0x3a')](_0xa1788f[_0xaa90('0x9')]));}}}catch(_0x59eaf9){logger[_0xaa90('0x1e')](_0xaa90('0x3b'),_0x59eaf9[_0xaa90('0x35')]);}};Acw['prototype'][_0xaa90('0x3c')]=function(_0x496420){try{if(this['voiceQueues'][_0x496420[_0xaa90('0x24')]]&&(this['voiceQueues'][_0x496420[_0xaa90('0x24')]][_0xaa90('0x4')]||this[_0xaa90('0x7')][_0x496420[_0xaa90('0x24')]][_0xaa90('0x26')])){if(this[_0xaa90('0x8')][_0x496420[_0xaa90('0x23')]]){this[_0xaa90('0xa')][_0x496420[_0xaa90('0x19')]]={'queue':_0x496420[_0xaa90('0x24')],'interface':_0x496420[_0xaa90('0x23')],'destlinkedid':_0x496420[_0xaa90('0x2d')]};}}}catch(_0x9d87de){logger[_0xaa90('0x1e')](_0xaa90('0x3d'),_0x9d87de[_0xaa90('0x35')]);}};Acw['prototype'][_0xaa90('0x3e')]=function(_0xe291a9){try{if(this['voiceQueues'][_0xe291a9[_0xaa90('0x24')]]&&(this[_0xaa90('0x7')][_0xe291a9['queue']]['acw']||this[_0xaa90('0x7')][_0xe291a9[_0xaa90('0x24')]][_0xaa90('0x26')])){if(this[_0xaa90('0x8')][_0xe291a9[_0xaa90('0x23')]]){this['channels'][_0xe291a9[_0xaa90('0x19')]]={'queue':_0xe291a9[_0xaa90('0x24')],'interface':_0xe291a9[_0xaa90('0x23')]};}}}catch(_0x4aed04){logger[_0xaa90('0x1e')](_0xaa90('0x3f'),_0x4aed04['message']);}};Acw[_0xaa90('0x21')][_0xaa90('0x40')]=function(_0x3a1f59){try{if(this[_0xaa90('0xa')][_0x3a1f59[_0xaa90('0x19')]]&&_[_0xaa90('0x41')](this[_0xaa90('0xa')][_0x3a1f59[_0xaa90('0x19')]]['attended'])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x3a1f59[_0xaa90('0x19')]);this[_0xaa90('0x22')](_0x3a1f59[_0xaa90('0x19')]);}else if(this[_0xaa90('0xa')][_0x3a1f59[_0xaa90('0x42')]]&&_['isUndefined'](this[_0xaa90('0xa')][_0x3a1f59[_0xaa90('0x42')]][_0xaa90('0x43')])){logger[_0xaa90('0x1b')](_0xaa90('0x44'),_0x3a1f59[_0xaa90('0x42')]);this[_0xaa90('0x22')](_0x3a1f59[_0xaa90('0x42')]);}}catch(_0x32bd09){logger[_0xaa90('0x1e')]('[ACW][syncHangupRequest]\x20%s',_0x32bd09['message']);}};Acw[_0xaa90('0x21')][_0xaa90('0xd')]=function(_0x1adb8f){try{if(this['channels'][_0x1adb8f[_0xaa90('0x19')]]&&this[_0xaa90('0xa')][_0x1adb8f['uniqueid']][_0xaa90('0x43')]){logger[_0xaa90('0x1b')](_0xaa90('0x45'),_0x1adb8f[_0xaa90('0x19')]);this[_0xaa90('0x22')](_0x1adb8f[_0xaa90('0x19')]);}else if(this[_0xaa90('0xa')][_0x1adb8f[_0xaa90('0x42')]]&&this['channels'][_0x1adb8f[_0xaa90('0x42')]][_0xaa90('0x43')]){logger[_0xaa90('0x1b')](_0xaa90('0x46'),_0x1adb8f[_0xaa90('0x42')]);this['startAcw'](_0x1adb8f[_0xaa90('0x42')]);}}catch(_0x16f7b1){logger['error'](_0xaa90('0x47'),_0x16f7b1[_0xaa90('0x35')]);}};Acw[_0xaa90('0x21')][_0xaa90('0x10')]=function(_0x5a281a){try{if(!_[_0xaa90('0x48')](this['channels'][_0x5a281a[_0xaa90('0x49')]])){this[_0xaa90('0x22')](_0x5a281a[_0xaa90('0x49')]);if(this[_0xaa90('0xa')][_0x5a281a['secondtransfereruniqueid']]){this[_0xaa90('0xa')][_0x5a281a[_0xaa90('0x4a')]]['attended']=!![];this[_0xaa90('0xa')][_0x5a281a['transfertargetuniqueid']]=this['channels'][_0x5a281a['secondtransfereruniqueid']];delete this[_0xaa90('0xa')][_0x5a281a[_0xaa90('0x4a')]];}}else if(!_['isNil'](this[_0xaa90('0xa')][_0x5a281a[_0xaa90('0x4b')]])){this[_0xaa90('0x22')](_0x5a281a['transfertargetuniqueid']);if(this['channels'][_0x5a281a[_0xaa90('0x4c')]]){this[_0xaa90('0xa')][_0x5a281a[_0xaa90('0x4c')]][_0xaa90('0x43')]=!![];this[_0xaa90('0xa')][_0x5a281a['transfereeuniqueid']]=this[_0xaa90('0xa')][_0x5a281a['origtransfereruniqueid']];delete this[_0xaa90('0xa')][_0x5a281a[_0xaa90('0x4c')]];}}}catch(_0x768fc7){logger['error'](_0xaa90('0x4d'),_0x768fc7[_0xaa90('0x35')]);}};Acw[_0xaa90('0x21')]['syncBlindTransfer']=function(_0x401721){try{if(this['channels'][_0x401721[_0xaa90('0x4e')]]){logger['info'](_0xaa90('0x4f'),JSON[_0xaa90('0x3a')](_0x401721['transfereruniqueid']));this[_0xaa90('0x22')](_0x401721[_0xaa90('0x4e')]);}else if(this[_0xaa90('0xa')][_0x401721['transfererlinkedid']]){logger[_0xaa90('0x1b')](_0xaa90('0x50'),JSON[_0xaa90('0x3a')](_0x401721[_0xaa90('0x51')]));this[_0xaa90('0x22')](_0x401721[_0xaa90('0x51')]);}}catch(_0x4e7b01){logger[_0xaa90('0x1e')](_0xaa90('0x52'),_0x4e7b01[_0xaa90('0x35')]);}};Acw['prototype'][_0xaa90('0x53')]=function(_0x5db8d2){try{if(this[_0xaa90('0x7')][_0x5db8d2[_0xaa90('0x24')]]&&this['voiceQueues'][_0x5db8d2[_0xaa90('0x24')]][_0xaa90('0x54')]==='all'){if(this[_0xaa90('0x8')][_0x5db8d2[_0xaa90('0x23')]]){logger[_0xaa90('0x1b')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5db8d2[_0xaa90('0x19')],_0x5db8d2[_0xaa90('0x23')],_0x5db8d2[_0xaa90('0x24')]);return RpcUser[_0xaa90('0x55')](this[_0xaa90('0x8')][_0x5db8d2[_0xaa90('0x23')]],_0xaa90('0x56'),_0x5db8d2[_0xaa90('0x19')]);}}}catch(_0x3c0eb3){logger[_0xaa90('0x1e')](_0xaa90('0x57'),_0x3c0eb3[_0xaa90('0x35')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e566d9b..8687738 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 _0x494f=['fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','format','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionSipPeerStatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0xf08e89,_0x1b9466){var _0x4042da=function(_0x2df606){while(--_0x2df606){_0xf08e89['push'](_0xf08e89['shift']());}};_0x4042da(++_0x1b9466);}(_0x494f,0x13a));var _0xf494=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x494f[_0x2d2258];return _0x18e155;};'use strict';var Manager=require(_0xf494('0x0'));var BPromise=require(_0xf494('0x1'));var util=require(_0xf494('0x2'));var logger=require('../../config/logger')('ami');var config=require(_0xf494('0x3'));var ami=new Manager(config[_0xf494('0x4')][_0xf494('0x5')],config[_0xf494('0x4')]['ip'],config[_0xf494('0x4')]['username'],config['asterisk'][_0xf494('0x6')],!![]);ami[_0xf494('0x7')]();ami[_0xf494('0x8')]=BPromise[_0xf494('0x9')](ami[_0xf494('0xa')]);function error(_0x5a9a4f){logger['error'](util[_0xf494('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xf494('0x4')][_0xf494('0xc')],config['asterisk']['ip'],config[_0xf494('0x4')][_0xf494('0x5')],util[_0xf494('0xd')](_0x5a9a4f,![],null)));}function close(){logger[_0xf494('0xe')](util[_0xf494('0xb')](_0xf494('0xf'),config[_0xf494('0x4')][_0xf494('0xc')],config[_0xf494('0x4')]['ip'],config[_0xf494('0x4')][_0xf494('0x5')]));}ami[_0xf494('0x10')]=function(){return function(){return ami[_0xf494('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0xf494('0x11')]=function(){return function(){return ami[_0xf494('0x8')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xf494('0x8')]({'action':_0xf494('0x12')});};};ami[_0xf494('0x13')]=function(){return function(){return ami[_0xf494('0x8')]({'action':'coreshowchannels'});};};function connect(){logger[_0xf494('0x14')](util['format'](_0xf494('0x15'),config[_0xf494('0x4')][_0xf494('0xc')],config['asterisk']['ip'],config[_0xf494('0x4')]['port']));ami['once'](_0xf494('0xe'),error);ami[_0xf494('0x16')](_0xf494('0x17'),close);}ami['on'](_0xf494('0x18'),connect);ami['on']('shutdown',function(_0x1d7c47){logger[_0xf494('0x14')](util['format'](_0xf494('0x19'),config[_0xf494('0x4')][_0xf494('0xc')],config[_0xf494('0x4')]['ip'],config['asterisk'][_0xf494('0x5')],util['inspect'](_0x1d7c47,![],null)));});ami['on'](_0xf494('0x1a'),function(){logger['info'](util['format'](_0xf494('0x1b'),config[_0xf494('0x4')]['username'],config['asterisk']['ip'],config[_0xf494('0x4')]['port']));return Promise[_0xf494('0x1c')]()[_0xf494('0x1d')](ami[_0xf494('0x10')]())[_0xf494('0x1d')](ami['actionDeviceStateList']())[_0xf494('0x1d')](ami[_0xf494('0x11')]())[_0xf494('0x1d')](ami[_0xf494('0x1e')]())[_0xf494('0x1d')](ami[_0xf494('0x13')]())[_0xf494('0x1f')](function(_0x1e6cd9){logger[_0xf494('0xe')](_0xf494('0x20'),util['inspect'](_0x1e6cd9,{'showHidden':![],'depth':null}));});});ami[_0xf494('0x16')](_0xf494('0xe'),error);ami[_0xf494('0x16')]('close',close);module[_0xf494('0x21')]=ami; \ No newline at end of file +var _0x62f2=['promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','actionDeviceStateList','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','username','once','close','fullybooted','resolve','then','actionSipPeerStatus','actionQueueSummary','catch','exports','asterisk-manager','util','ami','../../config/environment','asterisk','port','password','Action'];(function(_0xb6878a,_0x53d104){var _0xf11fd9=function(_0x193926){while(--_0x193926){_0xb6878a['push'](_0xb6878a['shift']());}};_0xf11fd9(++_0x53d104);}(_0x62f2,0x93));var _0x262f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x62f2[_0x4cf98e];return _0x1623ac;};'use strict';var Manager=require(_0x262f('0x0'));var BPromise=require('bluebird');var util=require(_0x262f('0x1'));var logger=require('../../config/logger')(_0x262f('0x2'));var config=require(_0x262f('0x3'));var ami=new Manager(config[_0x262f('0x4')][_0x262f('0x5')],config[_0x262f('0x4')]['ip'],config[_0x262f('0x4')]['username'],config[_0x262f('0x4')][_0x262f('0x6')],!![]);ami['keepConnected']();ami[_0x262f('0x7')]=BPromise[_0x262f('0x8')](ami['action']);function error(_0x2d61d3){logger[_0x262f('0x9')](util[_0x262f('0xa')](_0x262f('0xb'),config[_0x262f('0x4')]['username'],config[_0x262f('0x4')]['ip'],config[_0x262f('0x4')][_0x262f('0x5')],util[_0x262f('0xc')](_0x2d61d3,![],null)));}function close(){logger['error'](util[_0x262f('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x262f('0x4')]['username'],config[_0x262f('0x4')]['ip'],config['asterisk'][_0x262f('0x5')]));}ami[_0x262f('0xd')]=function(){return function(){return ami[_0x262f('0x7')]({'action':'sipshowregistry'});};};ami[_0x262f('0xe')]=function(){return function(){return ami[_0x262f('0x7')]({'action':_0x262f('0xf')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x262f('0x7')]({'action':_0x262f('0x10')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x262f('0x7')]({'action':_0x262f('0x11')});};};ami[_0x262f('0x12')]=function(){return function(){return ami[_0x262f('0x7')]({'action':_0x262f('0x13')});};};function connect(){logger[_0x262f('0x14')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x262f('0x4')][_0x262f('0x15')],config['asterisk']['ip'],config[_0x262f('0x4')][_0x262f('0x5')]));ami[_0x262f('0x16')](_0x262f('0x9'),error);ami[_0x262f('0x16')](_0x262f('0x17'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x49b524){logger[_0x262f('0x14')](util[_0x262f('0xa')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x262f('0x4')][_0x262f('0x15')],config[_0x262f('0x4')]['ip'],config[_0x262f('0x4')][_0x262f('0x5')],util[_0x262f('0xc')](_0x49b524,![],null)));});ami['on'](_0x262f('0x18'),function(){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x262f('0x4')][_0x262f('0x15')],config[_0x262f('0x4')]['ip'],config[_0x262f('0x4')][_0x262f('0x5')]));return Promise[_0x262f('0x19')]()[_0x262f('0x1a')](ami[_0x262f('0xd')]())[_0x262f('0x1a')](ami[_0x262f('0xe')]())[_0x262f('0x1a')](ami[_0x262f('0x1b')]())[_0x262f('0x1a')](ami[_0x262f('0x1c')]())[_0x262f('0x1a')](ami[_0x262f('0x12')]())[_0x262f('0x1d')](function(_0x458a82){logger[_0x262f('0x9')]('[ami.js][fullybooted]',util[_0x262f('0xc')](_0x458a82,{'showHidden':![],'depth':null}));});});ami[_0x262f('0x16')](_0x262f('0x9'),error);ami[_0x262f('0x16')]('close',close);module[_0x262f('0x1e')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d738d39..ba8cf3f 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0xe706,0xa3));var _0x6e70=function(_0x2ba9ac,_0xa1fdc4){_0x2ba9ac=_0x2ba9ac-0x0;var _0x1b0fc9=_0xe706[_0x2ba9ac];return _0x1b0fc9;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'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 diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f77a795..6c0f09a 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 _0x1ece=['[syncAgentComplete]','getSeconds','droptime','predictiveIntervalErlangCallsDroppedCalls','state','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','add','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','isNil','locked','paused','stateinterface','rrmemory','idHopper','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','VoiceQueueId','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','responsetime','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countbusyretry','countcongestionretry','reason19\x20machine....','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','running','getQueueCampaignStatusMessage','startProgressive','statusMessage','talking','[syncQueueSummary]','assign','throttle','dialPreviewRecallmeReminder','online','reachable','map','user:%s','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','getVoiceQueueRtPauses','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','erlangAbandonmentRate','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','loggedIn','predictiveIntervalPauses','busyFactor','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialMethod','dialLimitQueue','pTalking','not_inuse','getContactDialer','ACTIVE','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[countReScheduled]\x20','[actionOriginatePredictive]\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','util','uuid','ioredis','./utils/hopper','../preview/util/util','../../../config/logger','predictive','predictiveCalls','../ami','redis','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','queueBooked','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','emit','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','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','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','name','startProgressive\x20value\x20cleared','debug','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','\x20INTERVAL_IS_NULL','Interval','NULL_INTERVAL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','content','indexOf','true','catch','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','syncCampaigns','undefined','isIVRCampaign','resolve','dialGlobalInterval','dialTimezone','checkDialMethod','progressive','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','type','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','queue','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer'];(function(_0x4ce6fa,_0x26a348){var _0xcd00be=function(_0x2d29e4){while(--_0x2d29e4){_0x4ce6fa['push'](_0x4ce6fa['shift']());}};_0xcd00be(++_0x26a348);}(_0x1ece,0x14f));var _0xe1ec=function(_0x44888f,_0x1b1bea){_0x44888f=_0x44888f-0x0;var _0x526924=_0x1ece[_0x44888f];return _0x526924;};'use strict';var util=require(_0xe1ec('0x0'));var _=require('lodash');var uuid=require(_0xe1ec('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0xe1ec('0x2'));var utils=require('./utils');var hopperUtils=require(_0xe1ec('0x3'));var ut=require(_0xe1ec('0x4'));var config=require('../../../config/environment/');var logger=require(_0xe1ec('0x5'))('dialer');var loggerBooked=require(_0xe1ec('0x5'))('booked');var loggerPredictive=require(_0xe1ec('0x5'))(_0xe1ec('0x6'));var loggerPredictiveCalls=require(_0xe1ec('0x5'))(_0xe1ec('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xe1ec('0x8'));config[_0xe1ec('0x9')]=_['defaults'](config['redis'],{'host':_0xe1ec('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe1ec('0x9')]));var cmHopper=require(_0xe1ec('0xb'));var voiceQueueRt=require(_0xe1ec('0xc'));var RpcSetting=require(_0xe1ec('0xd'));var Interval=require(_0xe1ec('0xe'));var Action=require('./models/action');var History=require(_0xe1ec('0xf'));var Final=require(_0xe1ec('0x10'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xe1ec('0x11');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xe1ec('0x12')]['enqueue']=function(_0x4d9a55){this[_0xe1ec('0x13')]=this[_0xe1ec('0x13')]?this[_0xe1ec('0x13')][_0xe1ec('0x14')](_0x4d9a55):_0x4d9a55();};function Dialer(_0x2b0657,_0x3ea2d4){this[_0xe1ec('0x15')]=new Sequence();this[_0xe1ec('0x16')]=_0x3ea2d4;this['voiceQueues']=_0x2b0657[_0xe1ec('0x17')];this['campaigns']=_0x2b0657[_0xe1ec('0x18')];this[_0xe1ec('0x19')]=_0x2b0657[_0xe1ec('0x19')];this[_0xe1ec('0x1a')]=_0x2b0657[_0xe1ec('0x1a')];this[_0xe1ec('0x1b')]=config[_0xe1ec('0x1b')]||0x2;this['channels']={};this[_0xe1ec('0x1c')]={};this[_0xe1ec('0x1d')]={};this[_0xe1ec('0x1e')]={};this['optionPredictive']={};this[_0xe1ec('0x1f')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xe1ec('0x20')]={};this['queueBookedRR']={};this[_0xe1ec('0x21')]={};ami['on'](_0xe1ec('0x22'),this[_0xe1ec('0x23')][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x25'),this[_0xe1ec('0x26')][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x27'),this[_0xe1ec('0x28')][_0xe1ec('0x24')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x29'),this[_0xe1ec('0x2a')][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x2b'),this[_0xe1ec('0x2c')][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x2d'),this[_0xe1ec('0x2e')]['bind'](this));ami['on'](_0xe1ec('0x2f'),this[_0xe1ec('0x30')][_0xe1ec('0x24')](this));ami['on'](_0xe1ec('0x31'),this[_0xe1ec('0x32')][_0xe1ec('0x24')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0xe1ec('0x33'),this[_0xe1ec('0x34')]['bind'](this));this[_0xe1ec('0x35')]();this[_0xe1ec('0x36')]();RpcSetting['getSettings']()[_0xe1ec('0x37')](function(_0x3b15d7){previewRecallmeReminderInterval=_0x3b15d7[_0xe1ec('0x38')];});}function isNotNull(_0xc46dc7){return _0xc46dc7!==null&&!_['isUndefined'](_0xc46dc7);}function msgResponse(_0x3ee53b,_0x9d2a35,_0x3b4344){return{'action':_0x3ee53b,'response':_0x9d2a35,'message':_0x3b4344,'stack':_0x3b4344};}function emit(_0x23d57b,_0x49a3ac,_0x907fcc){io['to'](_0x23d57b)[_0xe1ec('0x39')](_0x49a3ac,_0x907fcc);}function emitOutboundVoiceQueueSummary(_0x2f141f){if(_0x2f141f['type']==='outbound'){logger['debug'](_0xe1ec('0x3a'),util[_0xe1ec('0x3b')](_0x2f141f,{'showHidden':![],'depth':null}));emit(util['format'](_0xe1ec('0x3c'),_0x2f141f['name']),_0xe1ec('0x3d'),_0x2f141f);}}function checkGetDataPredictive(_0x3e828a){if(isNotNull(_0x3e828a)&&!_[_0xe1ec('0x3e')](_0x3e828a)){loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x40'));loggerPredictive[_0xe1ec('0x3f')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e828a[_0xe1ec('0x41')]);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x42'),_0x3e828a[_0xe1ec('0x43')]);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x44'),_0x3e828a[_0xe1ec('0x45')]);loggerPredictive['info'](_0xe1ec('0x46'),_0x3e828a[_0xe1ec('0x47')]);loggerPredictive['info'](_0xe1ec('0x48'),_0x3e828a[_0xe1ec('0x49')]);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x4a'),_0x3e828a[_0xe1ec('0x4b')]);loggerPredictive[_0xe1ec('0x3f')]('---------------------------');if(_0x3e828a[_0xe1ec('0x41')]>0x0){if(!_['isUndefined'](_0x3e828a[_0xe1ec('0x4b')])&&_0x3e828a['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x4c'));if(!_[_0xe1ec('0x4d')](_0x3e828a[_0xe1ec('0x49')])&&_0x3e828a[_0xe1ec('0x49')]>0x0){return!![];}loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x4e'));}else{loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x4f'));}}else{loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x50'));}return![];}function mergeDataErlangB(_0x29628f){return function(_0x3d34c4){loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x51'));loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x52'),_0x3d34c4[_0xe1ec('0x53')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d34c4[_0xe1ec('0x54')]);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x55'),_0x3d34c4['erlangAbandonmentRate']);loggerPredictive['info'](_0xe1ec('0x56'),_0x3d34c4['erlangBusyFactor']);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x55'),_0x3d34c4['erlangAbandonmentRate']);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x57'));_[_0xe1ec('0x58')](_0x29628f,_0x3d34c4);};}function ifInterval(_0xdd1d83,_0x53e8d1){if(_[_0xe1ec('0x4d')](_0x53e8d1)){return![];}return utils['getSeconds'](undefined,_0x53e8d1)<_0xdd1d83*0x3c;}function clearPredictiveAttributes(_0x6d034){if(_0x6d034['startProgressive']){_0x6d034['startProgressive']=undefined;loggerPredictive['debug'](_0x6d034[_0xe1ec('0x59')],_0xe1ec('0x5a'));}if(_0x6d034[_0xe1ec('0x1f')]){_0x6d034[_0xe1ec('0x1f')]=undefined;loggerPredictive[_0xe1ec('0x5b')](_0x6d034['name'],_0xe1ec('0x5c'));}if(_0x6d034['handlePredictive']){clearInterval(_0x6d034[_0xe1ec('0x5d')]);_0x6d034[_0xe1ec('0x5d')]=undefined;loggerPredictive['debug'](_0x6d034['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x11db91,_0x549d60){return function(_0x4b4e22){loggerPredictive[_0xe1ec('0x5e')](_0x549d60['name'],_0x11db91);loggerPredictive[_0xe1ec('0x5e')](_0x4b4e22[_0xe1ec('0x5f')]);clearPredictiveAttributes(_0x549d60);};}function loggerCatch(_0x1017e4){return function(_0x36a9c1){logger['error'](_0x1017e4,util[_0xe1ec('0x3b')](_0x36a9c1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4d94a4,_0x2265cc,_0x5c3a44){return function(_0x55d4c0){utils[_0xe1ec('0x60')](_0x2265cc,_0x5c3a44,0x0);_0x2265cc[_0xe1ec('0x61')]=0x0;logger['error'](_0x4d94a4,util[_0xe1ec('0x3b')](_0x55d4c0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xdb3b69){return function(_0x4ba55e){if(isNotNull(_0x4ba55e)&&isNotNull(_0x4ba55e[0x0])){if(_0x4ba55e[0x0][_0xe1ec('0x62')]>0x0){_0xdb3b69[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x65')];logger[_0xe1ec('0x3f')](_0xe1ec('0x66')+_0xdb3b69[_0xe1ec('0x59')],_0x4ba55e[0x0][_0xe1ec('0x62')],_0xe1ec('0x67'));}else{_0xdb3b69[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x68')];logger[_0xe1ec('0x3f')]('[getContactDialer2][Empty]'+_0xdb3b69['name']);}}};}function createObjHistory(_0x3f36ce,_0x54d70b,_0x90a0ec,_0xcd82cc,_0x420f3a){_0x3f36ce['message']=_0x90a0ec;var _0x46794c=new Action(_0x3f36ce,_0x54d70b);var _0x3bd2d1=new History(_0x46794c);_0x3bd2d1['state']=_0xcd82cc;_0x3bd2d1[_0xe1ec('0x69')]=_0x420f3a;_0x3bd2d1[_0xe1ec('0x6a')]=_0x46794c[_0xe1ec('0x6b')];return _0x3bd2d1;}function unlockQueueStatus(_0x4aa17f,_0x3d778a){setTimeout(function(){if(_[_0xe1ec('0x4d')](_0x4aa17f[_0xe1ec('0x6c')])){loggerBooked[_0xe1ec('0x5e')](_0xe1ec('0x6d'),_0x3d778a);}_0x4aa17f[_0xe1ec('0x6c')]=!![];loggerBooked[_0xe1ec('0x3f')](_0xe1ec('0x6e'),_0x3d778a,JSON[_0xe1ec('0x6f')](_[_0xe1ec('0x70')](_0x4aa17f,[_0xe1ec('0x59'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x4a9f33){return function(){if(!isNotNull(_0x4a9f33['Interval'])){_0x4a9f33[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')]['NULL_INTERVAL'];throw _0x4a9f33[_0xe1ec('0x59')]+_0xe1ec('0x71');}if(!isNotNull(_0x4a9f33[_0xe1ec('0x72')]['Intervals'])){_0x4a9f33[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x73')];throw _0x4a9f33[_0xe1ec('0x59')]+_0xe1ec('0x71');}if(!isNotNull(_['isEmpty'](_0x4a9f33[_0xe1ec('0x72')][_0xe1ec('0x74')]))){_0x4a9f33[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')]['NULL_INTERVAL'];throw _0x4a9f33[_0xe1ec('0x59')]+_0xe1ec('0x71');}};}function checkIsIVRCampaignActive(_0x57136a){return function(){if(!utils[_0xe1ec('0x75')](_0x57136a)){_0x57136a['message']=utils[_0xe1ec('0x64')][_0xe1ec('0x76')];throw _0x57136a[_0xe1ec('0x59')]+_0xe1ec('0x77');}};}function emitCampaignSummary(_0x3a842f){if(utils['isIVRCampaign'](_0x3a842f)){emit(util[_0xe1ec('0x78')](_0xe1ec('0x79'),_0x3a842f[_0xe1ec('0x59')]),_0xe1ec('0x7a'),_0x3a842f);}}function loggerCatchQueueSummary(_0x475fbd,_0x321ecc){return function(_0x5aad1f){clearPredictiveAttributes(_0x321ecc);emitCampaignSummary(_0x321ecc);loggerSyncQueueSummary[_0xe1ec('0x5b')](_0x475fbd,util[_0xe1ec('0x3b')](_0x5aad1f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2733df){if(_0x2733df[_0xe1ec('0x7b')]){if(_0x2733df[_0xe1ec('0x7c')]===0x0){_0x2733df[_0xe1ec('0x7b')]=![];_0x2733df[_0xe1ec('0x63')]=utils['CAMPAIGN_STATUS']['INACTIVE'];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2733df[_0xe1ec('0x59')],_0xe1ec('0x7d'));}else{_0x2733df['message']=utils[_0xe1ec('0x64')][_0xe1ec('0x7e')];loggerSyncQueueSummary[_0xe1ec('0x5b')](_0xe1ec('0x7f'),_0x2733df[_0xe1ec('0x59')],_0xe1ec('0x80'));}emitCampaignSummary(_0x2733df);}}function myreject(_0x413e6e){return function(_0xba161d){return _0x413e6e(msgResponse(_0xe1ec('0x81'),_0xe1ec('0x82'),JSON[_0xe1ec('0x6f')](_0xba161d)));};}Dialer[_0xe1ec('0x12')][_0xe1ec('0x83')]=function(_0xb60c1b){return!_[_0xe1ec('0x4d')](_0xb60c1b)&&_0xb60c1b&&!_[_0xe1ec('0x4d')](_0xb60c1b[_0xe1ec('0x59')])&&!_[_0xe1ec('0x4d')](_0xb60c1b[_0xe1ec('0x84')])&&_0xb60c1b[_0xe1ec('0x84')]&&(this[_0xe1ec('0x1a')][util['format'](_0xe1ec('0x85'),_0xb60c1b[_0xe1ec('0x59')])]['status']==='reachable'||this['trunks'][util[_0xe1ec('0x78')](_0xe1ec('0x85'),_0xb60c1b[_0xe1ec('0x59')])][_0xe1ec('0x86')]===_0xe1ec('0x87'));};Dialer['prototype'][_0xe1ec('0x88')]=function(_0x1c9894){var _0x58fb47=this;return function(){if(!_0x58fb47['isTrunkReachable'](_0x1c9894[_0xe1ec('0x89')])){if(!_0x58fb47['isTrunkReachable'](_0x1c9894[_0xe1ec('0x8a')])){_0x1c9894[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')]['TRUNK_NOT_REACHABLE'];throw _0x1c9894[_0xe1ec('0x59')]+_0xe1ec('0x8b');}}};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x8c')]=function(_0x1e9851,_0x8c3de4,_0x1364ca,_0x31190c){var _0x38ee4b=this;return function(){var _0x5a0a51=!![];return _0x38ee4b[_0xe1ec('0x8d')](_0x1e9851,_0x8c3de4,_0x1364ca,_0x31190c,_0x5a0a51);};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x8e')]=function(_0x8d1452,_0x39b68f,_0x2fb17a,_0x22e411){var _0x30bf17=this;return function(){var _0x45868f=![];return _0x30bf17['ifTimeIvr'](_0x8d1452[_0xe1ec('0x74')],_0x39b68f,_0x2fb17a,_0x22e411,_0x45868f);};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x8d')]=function(_0x4f901b,_0x4890a1,_0x3b8738,_0x17dcce,_0x4bc22c){var _0x747f37=[];return new Promise(function(_0x5948ef,_0x2eddb8){if(!isNotNull(_0x4f901b)){_0x17dcce[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x73')];return _0x2eddb8(msgResponse(_0xe1ec('0x8f'),_0xe1ec('0x90'),_0x3b8738+_0xe1ec('0x91')));}if(_[_0xe1ec('0x3e')](_0x4f901b)){_0x17dcce['message']=utils[_0xe1ec('0x64')][_0xe1ec('0x92')];return _0x2eddb8(msgResponse(_0xe1ec('0x8f'),'Failure',_0x3b8738+_0xe1ec('0x93')));}if(_0x4890a1&&_[_0xe1ec('0x4d')](config[_0xe1ec('0x94')][_0x4890a1])){_0x17dcce[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')]['UNKNOWN_TIMEZONE'];return _0x2eddb8(msgResponse('ifTime',_0xe1ec('0x90'),_0x3b8738+_0xe1ec('0x95')+_0x4890a1));}if(_[_0xe1ec('0x96')](_0x4f901b)){for(var _0x543cdf=0x0;_0x543cdf<_0x4f901b[_0xe1ec('0x97')];_0x543cdf+=0x1){_0x747f37[_0xe1ec('0x98')](ami[_0xe1ec('0x99')]({'action':_0xe1ec('0x9a'),'command':util[_0xe1ec('0x78')](_0xe1ec('0x9b'),_0x4f901b[_0x543cdf]['interval'],!_[_0xe1ec('0x4d')](config[_0xe1ec('0x94')][_0x4890a1])?_0x4890a1:'')})[_0xe1ec('0x37')](function(_0x2cdc6e){return _0x2cdc6e[_0xe1ec('0x9c')][_0xe1ec('0x9d')](_0xe1ec('0x9e'))>=0x0;})[_0xe1ec('0x9f')](myreject(_0x2eddb8)));}}else{_0x747f37[_0xe1ec('0x98')](ami['Action']({'action':_0xe1ec('0x9a'),'command':util['format']('iftime\x20%s,%s',_0x4f901b,!_['isUndefined'](config[_0xe1ec('0x94')][_0x4890a1])?_0x4890a1:'')})['then'](function(_0x585c49){return _0x585c49[_0xe1ec('0x9c')]['indexOf']('true')>=0x0;})[_0xe1ec('0x9f')](myreject(_0x2eddb8)));}Promise[_0xe1ec('0xa0')](_0x747f37)[_0xe1ec('0x37')](function(_0xdd2737){var _0x53232e=_[_0xe1ec('0xa1')](_0xdd2737);if(_0x53232e){return _0x5948ef(_0x53232e);}else{_0x17dcce[_0xe1ec('0x63')]=_0x4bc22c?utils[_0xe1ec('0x64')][_0xe1ec('0xa2')]:utils['CAMPAIGN_STATUS'][_0xe1ec('0xa3')];return _0x2eddb8(msgResponse('[ifTime][promiseAll]',_0xe1ec('0x90'),_0xe1ec('0xa4')+_0x4bc22c+'\x20'+_0x3b8738+_0xe1ec('0xa5')+util[_0xe1ec('0x3b')](_0x4f901b,{'showHidden':![],'depth':null})+_0xe1ec('0xa6')+_0x4890a1));}})[_0xe1ec('0x9f')](function(_0x1a6210){return _0x2eddb8(msgResponse(_0xe1ec('0x8f'),'Failure',JSON[_0xe1ec('0x6f')](_0x1a6210)));});});};Dialer[_0xe1ec('0x12')]['loopCampaigns']=function(){var _0x1e819c=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0xe1ec('0x37')](function(){setInterval(function(){_0x1e819c[_0xe1ec('0xa7')]();},0x3e8);});};Dialer[_0xe1ec('0x12')][_0xe1ec('0xa7')]=function(){var _0x1d450f=this;var _0x2843b9;for(var _0xfb1991 in this['campaigns']){if(typeof this[_0xe1ec('0x18')][_0xfb1991]!==_0xe1ec('0xa8')){_0x2843b9=this[_0xe1ec('0x18')][_0xfb1991];if(utils[_0xe1ec('0xa9')](_0x2843b9)&&utils[_0xe1ec('0x75')](_0x2843b9)){_0x2843b9[_0xe1ec('0x7b')]=!![];Promise[_0xe1ec('0xaa')]()[_0xe1ec('0x37')](checkIsIVRCampaignActive(_0x2843b9))[_0xe1ec('0x37')](checkInterval(_0x2843b9))[_0xe1ec('0x37')](_0x1d450f['checkIsTrunkReachable'](_0x2843b9))[_0xe1ec('0x37')](_0x1d450f[_0xe1ec('0x8c')](_0x2843b9[_0xe1ec('0xab')],_0x2843b9[_0xe1ec('0xac')],_0x2843b9[_0xe1ec('0x59')],_0x2843b9))[_0xe1ec('0x37')](_0x1d450f[_0xe1ec('0x8e')](_0x2843b9[_0xe1ec('0x72')],_0x2843b9[_0xe1ec('0xac')],_0x2843b9['name'],_0x2843b9))['then'](_0x1d450f['launchHandleIvr'](_0x2843b9))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2843b9));}else{notSendMessagesCampaign(_0x2843b9);}}}};Dialer[_0xe1ec('0x12')][_0xe1ec('0xad')]=function(_0x2bedb2){if(_0x2bedb2['dialMethod']!==_0xe1ec('0x6')){clearPredictiveAttributes(_0x2bedb2);}switch(_0x2bedb2['dialMethod']){case _0xe1ec('0xae'):this[_0xe1ec('0xaf')](_0x2bedb2,0x1);break;case'power':this[_0xe1ec('0xaf')](_0x2bedb2,_0x2bedb2[_0xe1ec('0xb0')]);break;case'predictive':this[_0xe1ec('0x6')](_0x2bedb2);break;case _0xe1ec('0xb1'):this[_0xe1ec('0xaf')](_0x2bedb2,0x1);break;default:logger[_0xe1ec('0x5e')](_0xe1ec('0xb2'),_0x2bedb2['name'],_0xe1ec('0xb3'));}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x8f')]=function(_0x888434,_0x10ae53){var _0x7db1dd=_0x888434[_0xe1ec('0xac')];var _0x559d70=_0x10ae53?_0x888434['dialGlobalInterval']:_0x888434['Interval'][_0xe1ec('0x74')];logger[_0xe1ec('0xb4')]('Dialer::ifTime()',_0x559d70,_0x7db1dd,_0x888434[_0xe1ec('0x59')],util[_0xe1ec('0x78')](_0xe1ec('0xb5'),_0x888434['name'],_0x888434['id']));var _0x762232=null;return Interval[_0xe1ec('0xb6')](_0x559d70,_0x7db1dd)['then'](function(_0xb220a4){if(_0xb220a4===!![]){return _0xb220a4;}else{_0x888434['message']=_0x10ae53?utils[_0xe1ec('0x64')][_0xe1ec('0xa2')]:utils[_0xe1ec('0x64')]['OVERTIME_INTERVAL'];_0x762232=msgResponse(_0xe1ec('0xb7'),_0xe1ec('0x90'),_0xe1ec('0xa4')+_0x10ae53+'\x20'+_0x888434['name']+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x559d70,{'showHidden':![],'depth':null})+_0xe1ec('0xa6')+_0x7db1dd);}if(_0x762232!==null){logger[_0xe1ec('0xb4')](_0xe1ec('0xb8'),_0x762232);_0x762232[_0xe1ec('0xb9')]=_0x10ae53;throw _0x762232;}})[_0xe1ec('0x9f')](function(_0x15ca5d){logger[_0xe1ec('0x5e')](_0xe1ec('0xba'),_0x15ca5d);throw msgResponse('[ifTime][Action]',_0xe1ec('0x82'),util[_0xe1ec('0x3b')](_0x15ca5d,{'showHidden':![],'depth':null}));});};Dialer[_0xe1ec('0x12')][_0xe1ec('0x23')]=function(_0x186d4f){if(this[_0xe1ec('0x17')][_0x186d4f['queue']]){if(this[_0xe1ec('0x1e')][_0x186d4f[_0xe1ec('0xbb')]]&&this['uniqueId'][_0x186d4f[_0xe1ec('0xbb')]][_0xe1ec('0xbc')]!=='ivr'){this[_0xe1ec('0xbd')](this[_0xe1ec('0x17')][_0x186d4f['queue']]);this['uniqueId'][_0x186d4f[_0xe1ec('0xbb')]][_0xe1ec('0xbe')]=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));}}};Dialer[_0xe1ec('0x12')][_0xe1ec('0xc0')]=function(_0x4f1854){var _0x24b026=this['uniqueId'][_0x4f1854[_0xe1ec('0xbb')]];if(this[_0xe1ec('0x17')][_0x4f1854[_0xe1ec('0xc1')]]){if(_0x24b026&&_0x24b026[_0xe1ec('0xbc')]!==_0xe1ec('0xc2')){delete this[_0xe1ec('0x1e')][_0x4f1854[_0xe1ec('0xbb')]];this[_0xe1ec('0x17')][_0x4f1854[_0xe1ec('0xc1')]][_0xe1ec('0xc3')]+=0x1;var _0x1f53b7=new AgentComplete(_0x24b026,_0x4f1854);if(_0x4f1854[_0xe1ec('0xc4')]===_0xe1ec('0xc5')){_0x1f53b7[_0xe1ec('0xc6')]=this[_0xe1ec('0x17')][_0x4f1854[_0xe1ec('0xc1')]][_0xe1ec('0xc7')]&&this[_0xe1ec('0x17')][_0x4f1854['queue']][_0xe1ec('0xc8')]?moment()[_0xe1ec('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xe1ec('0xc9')](_0x1f53b7)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xca')));hopperUtils[_0xe1ec('0xcb')](_0x1f53b7)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xcc')));}}};Dialer[_0xe1ec('0x12')]['syncQueueCallerAbandon']=function(_0x31baee){var _0x174d9e=this[_0xe1ec('0x1e')][_0x31baee[_0xe1ec('0xbb')]];var _0x485d91=this;var _0x1b6bb0=![];var _0x38056e;var _0x209a83;if(this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]]){if(_0x174d9e&&_0x174d9e[_0xe1ec('0xbc')]!==_0xe1ec('0xc2')){delete this[_0xe1ec('0x1e')][_0x31baee['uniqueid']];this['updateOriginated'](this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]]);_0x174d9e['droptime']=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));var _0x1be75e=new QueueCallerAbandon(_0x174d9e,_0x31baee);if(utils[_0xe1ec('0xcd')](_0x174d9e[_0xe1ec('0xce')],_0x174d9e['responsetime'])>=_0x174d9e['dialQueueTimeout']){this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0x45')]+=0x1;this['voiceQueues'][_0x31baee[_0xe1ec('0xc1')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xcf')]+=0x1;_0x1be75e[_0xe1ec('0xd0')]=0xa;_0x1be75e[_0xe1ec('0x69')]='Drop';_0x1be75e[_0xe1ec('0xd1')]=_0xe1ec('0xd2');_0x1be75e[_0xe1ec('0xc6')]=this[_0xe1ec('0x17')][_0x31baee['queue']][_0xe1ec('0xc7')]?moment()['format'](_0xe1ec('0xbf')):undefined;_0x1be75e[_0xe1ec('0xd3')]+=0x1;_0x1be75e[_0xe1ec('0xd4')]+=0x1;_0x38056e=this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xd5')];_0x209a83=this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x1be75e,_0x1be75e[_0xe1ec('0xd0')],_0x174d9e[_0xe1ec('0xd6')])['then'](function(_0x479931){_0x1b6bb0=_0x479931[_0xe1ec('0xd7')]==0x1;if(_0x1be75e['countdropretry']>=_0x485d91[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xd8')]){_0x485d91[_0xe1ec('0xd9')](_0x1be75e,_0x479931[_0xe1ec('0xd7')]);}else{hopperUtils[_0xe1ec('0xda')]({'active':![],'countdropretry':_0x1be75e[_0xe1ec('0xd3')],'scheduledat':moment()['add'](_0x485d91[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xd5')],'minutes')['format'](_0xe1ec('0xbf')),'ContactId':_0x174d9e[_0xe1ec('0xdb')],'ListId':_0x174d9e[_0xe1ec('0xdc')],'VoiceQueueId':_0x174d9e['VoiceQueueId']||undefined,'CampaignId':_0x174d9e[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xde')));var _0x56f3ea=new History(_0x1be75e);_0x56f3ea[_0xe1ec('0xd0')]=0xa;_0x56f3ea['statedesc']='Drop';_0x56f3ea['starttime']=moment()['format'](_0xe1ec('0xbf'));_0x56f3ea[_0xe1ec('0x6a')]=_0x56f3ea['starttime'];_0x56f3ea[_0xe1ec('0xdf')]=_0x1be75e[_0xe1ec('0xdf')];_0x56f3ea[_0xe1ec('0xe0')]=_0x1be75e['calleridnum'];hopperUtils[_0xe1ec('0xc9')](_0x56f3ea)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xe1ec('0x37')](function(){if(_0x1b6bb0)hopperUtils[_0xe1ec('0xe1')](_0x1be75e,_0x38056e,_0x209a83)[_0xe1ec('0x37')](function(){return 0x1;});});}else{this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe1ec('0x17')][_0x31baee['queue']][_0xe1ec('0xe2')]+=0x1;_0x1be75e[_0xe1ec('0xd0')]=0xb;_0x1be75e[_0xe1ec('0x69')]=_0xe1ec('0xe3');_0x1be75e[_0xe1ec('0xd1')]=_0xe1ec('0xe4');_0x1be75e[_0xe1ec('0xe5')]+=0x1;_0x1be75e[_0xe1ec('0xd4')]+=0x1;_0x38056e=this[_0xe1ec('0x17')][_0x31baee['queue']]['dialAbandonedRetryFrequency'];_0x209a83=this[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xe6')];hopperUtils[_0xe1ec('0xe7')](_0x1be75e,_0x1be75e[_0xe1ec('0xd0')],_0x174d9e['voiceQueue'])[_0xe1ec('0x37')](function(_0x334f42){if(_0x1be75e[_0xe1ec('0xe5')]>=_0x485d91[_0xe1ec('0x17')][_0x31baee[_0xe1ec('0xc1')]]['dialAbandonedMaxRetry']){_0x485d91[_0xe1ec('0xd9')](_0x1be75e,_0x334f42[_0xe1ec('0xd7')]);}else{hopperUtils[_0xe1ec('0xda')]({'active':![],'countabandonedretry':_0x1be75e[_0xe1ec('0xe5')],'scheduledat':moment()[_0xe1ec('0xe8')](_0x485d91['voiceQueues'][_0x31baee[_0xe1ec('0xc1')]][_0xe1ec('0xe9')],_0xe1ec('0xea'))[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x174d9e[_0xe1ec('0xdb')],'ListId':_0x174d9e['ListId'],'VoiceQueueId':_0x174d9e['VoiceQueueId']||undefined,'CampaignId':_0x174d9e[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xeb')));var _0x5c647c=new History(_0x1be75e);_0x5c647c['state']=0xb;_0x5c647c[_0xe1ec('0x69')]=_0xe1ec('0xe3');_0x5c647c['starttime']=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));_0x5c647c['endtime']=_0x5c647c[_0xe1ec('0x6b')];_0x5c647c[_0xe1ec('0xdf')]=_0x1be75e['calleridname'];_0x5c647c[_0xe1ec('0xe0')]=_0x1be75e[_0xe1ec('0xe0')];hopperUtils[_0xe1ec('0xc9')](_0x5c647c)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xec')));}})[_0xe1ec('0x37')](function(){if(_0x1b6bb0)hopperUtils[_0xe1ec('0xe1')](_0x1be75e,_0x38056e,_0x209a83)[_0xe1ec('0x37')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xe1ec('0x30')]=function(_0x47cb18){if(this[_0xe1ec('0x1c')][_0x47cb18[_0xe1ec('0xbb')]]){this[_0xe1ec('0x1c')][_0x47cb18[_0xe1ec('0xbb')]][_0xe1ec('0xed')]=_0x47cb18[_0xe1ec('0xed')];}if(this['uniqueId'][_0x47cb18[_0xe1ec('0xbb')]]){this[_0xe1ec('0x1e')][_0x47cb18[_0xe1ec('0xbb')]]['channel']=_0x47cb18[_0xe1ec('0xed')];}};Dialer[_0xe1ec('0x12')][_0xe1ec('0xee')]=function(_0x30f6e2){if(!this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]]){return;}var _0x160fa7=this[_0xe1ec('0x17')][this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]][_0xe1ec('0xc1')]][_0xe1ec('0xf0')]||'rrmemory';if(_0x160fa7==='roundrobin'){if(this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]]&&_[_0xe1ec('0xf1')](this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]][_0xe1ec('0xf2')])&&_0x30f6e2[_0xe1ec('0x86')]==='1'&&_0x30f6e2[_0xe1ec('0xf3')]==='0'){if(this[_0xe1ec('0x19')][_0x30f6e2[_0xe1ec('0xf4')]]){if(!this['agents'][_0x30f6e2[_0xe1ec('0xf4')]][_0xe1ec('0xf2')]){this['agents'][_0x30f6e2[_0xe1ec('0xf4')]][_0xe1ec('0xf2')]=!![];this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]][_0xe1ec('0xf2')]=!![];this['actions'][_0x30f6e2['actionid']][_0xe1ec('0xf4')]=_0x30f6e2[_0xe1ec('0xf4')];}}}}else if(_0x160fa7===_0xe1ec('0xf5')){if(this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]]){if(this['agents'][_0x30f6e2['stateinterface']]){this['actions'][_0x30f6e2[_0xe1ec('0xef')]][_0xe1ec('0xf4')]=_0x30f6e2[_0xe1ec('0xf4')];if(_[_0xe1ec('0xf1')](this[_0xe1ec('0x20')][this['actions'][_0x30f6e2['actionid']][_0xe1ec('0xc1')]])){this[_0xe1ec('0x20')][this[_0xe1ec('0x1c')][_0x30f6e2[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]=[];}this[_0xe1ec('0x20')][this['actions'][_0x30f6e2[_0xe1ec('0xef')]]['queue']]['push'](_[_0xe1ec('0x58')](_[_0xe1ec('0x70')](this['actions'][_0x30f6e2[_0xe1ec('0xef')]],[_0xe1ec('0xf6'),_0xe1ec('0xf4')]),{'status':_0x30f6e2['status'],'paused':_0x30f6e2['paused']}));}}}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x34')]=function(_0x5e95a3){if(!this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]){return;}var _0x312e1c=this;var _0x49f2f1=this[_0xe1ec('0x17')][this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]['queue']];var _0xa22dfd=_0x49f2f1[_0xe1ec('0xf0')]||'rrmemory';if(_0xa22dfd===_0xe1ec('0xf7')){if(this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]&&this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]['stateinterface']){this[_0xe1ec('0x16')][_0xe1ec('0xf8')](this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xf6')],this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xf4')])[_0xe1ec('0x9f')](function(_0x98d437){logger['error'](_0xe1ec('0xf9'),util['inspect'](_0x98d437,{'showHidden':![],'depth':null}));})[_0xe1ec('0x14')](function(){_0x312e1c[_0xe1ec('0xbd')](_0x312e1c[_0xe1ec('0x17')][_0x312e1c[_0xe1ec('0x1c')][_0x5e95a3['actionid']]['queue']]);_0x312e1c[_0xe1ec('0x19')][_0x312e1c['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xf4')]][_0xe1ec('0xf2')]=![];delete _0x312e1c['actions'][_0x5e95a3[_0xe1ec('0xef')]];unlockQueueStatus(_0x49f2f1);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]);hopperUtils[_0xe1ec('0xda')]({'active':![],'ContactId':this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xdb')],'ListId':this['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xdc')],'VoiceQueueId':this['actions'][_0x5e95a3[_0xe1ec('0xef')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xfa')));delete this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]];unlockQueueStatus(_0x49f2f1);}}else if(_0xa22dfd==='rrmemory'){var _0x579e5b;if(this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]&&!_['isEmpty'](this[_0xe1ec('0x20')][this['actions'][_0x5e95a3['actionid']][_0xe1ec('0xc1')]])){if(this[_0xe1ec('0xfb')][_0x312e1c['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]){this['queueBookedRR'][_0x312e1c['actions'][_0x5e95a3['actionid']][_0xe1ec('0xc1')]]=this[_0xe1ec('0xfb')][this['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]?this[_0xe1ec('0xfb')][this['actions'][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]:this[_0xe1ec('0x20')][this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]]?this[_0xe1ec('0x20')][this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]]['queue']][_0xe1ec('0xfc')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x5e95a3['actionid']][_0xe1ec('0xc1')]]['_rr']=this[_0xe1ec('0xfb')][this[_0xe1ec('0x1c')][_0x5e95a3[_0xe1ec('0xef')]][_0xe1ec('0xc1')]];for(var _0x4be4ef=0x0;_0x4be4ef=_0x3d975e[_0xe1ec('0x120')]){_0x33b7ac[_0xe1ec('0x121')](_0x3de54a,_0x36d1bb,_0x21293a,'reason19\x20machine....');}else{if(_0x3de54a['countmachineretry']>=_0x3d975e[_0xe1ec('0x122')]){_0x33b7ac['createStateFinal'](_0x3de54a,_0x36d1bb,_0x21293a,_0xe1ec('0x123'));}else{hopperUtils[_0xe1ec('0xda')]({'active':![],'countmachineretry':_0x3de54a[_0xe1ec('0x11b')],'scheduledat':moment()[_0xe1ec('0xe8')](_0x3d975e[_0xe1ec('0x124')],_0xe1ec('0xea'))[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3de54a[_0xe1ec('0xdb')],'ListId':_0x3de54a[_0xe1ec('0xdc')],'VoiceQueueId':_0x3de54a[_0xe1ec('0x103')]||undefined,'CampaignId':_0x3de54a['CampaignId']||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x125')));_0x36d1bb({'reschedule':0x1});}}});}if(_0x17d56e[_0xe1ec('0xbc')]===_0xe1ec('0xc2')&&this[_0xe1ec('0x18')][_0x17d56e[_0xe1ec('0xc1')]][_0xe1ec('0x10e')]&&_0x3964ca[_0xe1ec('0x10f')]===_0xe1ec('0x110')){delete this['uniqueId'][_0x3964ca[_0xe1ec('0xbb')]];this[_0xe1ec('0xbd')](this['campaigns'][_0x17d56e[_0xe1ec('0xc1')]]);_0x407fcd=new Hangup(_0x17d56e,_0x3964ca);_0x407fcd[_0xe1ec('0xd0')]=0x12;_0x407fcd[_0xe1ec('0x69')]=_0xe1ec('0x111');_0x407fcd[_0xe1ec('0x112')]=_0xe1ec('0x113');ami[_0xe1ec('0x39')](_0xe1ec('0x114'),ut[_0xe1ec('0x126')](_0x407fcd,'amd'));this[_0xe1ec('0x116')](_0x407fcd,_0xe1ec('0x127'),_0xe1ec('0x128'));}if(_0x17d56e[_0xe1ec('0xbc')]===_0xe1ec('0xc2')&&this[_0xe1ec('0x18')][_0x17d56e[_0xe1ec('0xc1')]]['dialAMDActive']&&_0x3964ca[_0xe1ec('0x10f')]===_0xe1ec('0x119')){return new Promise(function(_0xfe15ae,_0x43847b){delete _0x33b7ac[_0xe1ec('0x1e')][_0x3964ca[_0xe1ec('0xbb')]];_0x33b7ac[_0xe1ec('0xbd')](_0x33b7ac[_0xe1ec('0x18')][_0x17d56e[_0xe1ec('0xc1')]]);_0x33b7ac[_0xe1ec('0x18')][_0x17d56e['queue']][_0xe1ec('0xc3')]+=0x1;_0x33b7ac[_0xe1ec('0x18')][_0x17d56e[_0xe1ec('0xc1')]][_0xe1ec('0x129')]+=0x1;var _0x433638=_0x33b7ac[_0xe1ec('0x18')][_0x17d56e[_0xe1ec('0xc1')]];var _0x596543=new Hangup(_0x17d56e,_0x3964ca);_0x596543[_0xe1ec('0xd0')]=0x13;_0x596543[_0xe1ec('0x69')]='Machine';_0x596543[_0xe1ec('0x112')]=_0xe1ec('0x113');_0x596543[_0xe1ec('0x11b')]+=0x1;_0x596543[_0xe1ec('0xd4')]+=0x1;_0x596543[_0xe1ec('0x115')]=!![];ami['emit']('custom:amd',ut[_0xe1ec('0x126')](_0x596543,_0xe1ec('0x115')));hopperUtils[_0xe1ec('0xc9')](_0x596543)['catch'](loggerCatch(_0xe1ec('0x11c')));if(_0x596543[_0xe1ec('0x12a')]+_0x596543[_0xe1ec('0x12b')]+_0x596543[_0xe1ec('0x11d')]+_0x596543[_0xe1ec('0x11e')]+_0x596543['countdropretry']+_0x596543[_0xe1ec('0xe5')]+_0x596543[_0xe1ec('0x11b')]+_0x596543[_0xe1ec('0x11f')]>=_0x433638[_0xe1ec('0x120')]){_0x33b7ac['stateGlobal'](_0x596543,_0xfe15ae,_0x43847b,_0xe1ec('0x12c'));}else{if(_0x596543[_0xe1ec('0x11b')]>=_0x433638[_0xe1ec('0x122')]){_0x33b7ac[_0xe1ec('0x12d')](_0x596543,_0xfe15ae,_0x43847b,_0xe1ec('0x123'));}else{hopperUtils[_0xe1ec('0xda')]({'active':![],'countmachineretry':_0x596543[_0xe1ec('0x11b')],'scheduledat':moment()[_0xe1ec('0xe8')](_0x433638[_0xe1ec('0x124')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x596543[_0xe1ec('0xdb')],'ListId':_0x596543['ListId'],'VoiceQueueId':_0x596543[_0xe1ec('0x103')]||undefined,'CampaignId':_0x596543['CampaignId']||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x125')));_0xfe15ae({'reschedule':0x1});}}});}}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x2e')]=function(_0x1c4c65){var _0x3fef76=this[_0xe1ec('0x1e')][_0x1c4c65['uniqueid']];var _0x4fe333;if(_0x3fef76&&_0x3fef76[_0xe1ec('0xbc')]==='ivr'){delete this[_0xe1ec('0x1e')][_0x1c4c65['uniqueid']];this[_0xe1ec('0xbd')](this[_0xe1ec('0x18')][_0x3fef76['queue']]);this[_0xe1ec('0x18')][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0x12e')]+=0x1;_0x4fe333=new Hangup(_0x3fef76,_0x1c4c65);hopperUtils['createHistory'](_0x4fe333)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x12f')));hopperUtils['moveContactManagedDialer'](_0x4fe333)['catch'](loggerCatch(_0xe1ec('0x130')));}if(_0x3fef76&&_0x3fef76[_0xe1ec('0xbc')]!==_0xe1ec('0xc2')&&isNotNull(this[_0xe1ec('0x17')][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0x131')])){delete this['uniqueId'][_0x1c4c65[_0xe1ec('0xbb')]];this[_0xe1ec('0xbd')](this[_0xe1ec('0x17')][_0x3fef76[_0xe1ec('0xc1')]]);this['voiceQueues'][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0xc3')]+=0x1;this[_0xe1ec('0x17')][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0x129')]+=0x1;_0x4fe333=new Hangup(_0x3fef76,_0x1c4c65);_0x4fe333[_0xe1ec('0xd0')]=0x10;_0x4fe333[_0xe1ec('0x69')]=_0xe1ec('0x132');_0x4fe333[_0xe1ec('0x112')]=_0xe1ec('0x133');hopperUtils[_0xe1ec('0xc9')](_0x4fe333)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x12f')));hopperUtils[_0xe1ec('0xcb')](_0x4fe333)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x130')));}if(_0x3fef76&&_0x3fef76[_0xe1ec('0xbc')]!==_0xe1ec('0xc2')&&!isNotNull(this[_0xe1ec('0x17')][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0x131')])){delete this[_0xe1ec('0x1e')][_0x1c4c65['uniqueid']];this[_0xe1ec('0xbd')](this['voiceQueues'][_0x3fef76[_0xe1ec('0xc1')]]);this[_0xe1ec('0x17')][_0x3fef76[_0xe1ec('0xc1')]][_0xe1ec('0x134')]+=0x1;_0x4fe333=new Hangup(_0x3fef76,_0x1c4c65);_0x4fe333['state']=0xc;_0x4fe333[_0xe1ec('0x69')]=_0x1c4c65[_0xe1ec('0x135')];_0x4fe333[_0xe1ec('0x112')]='Unknow';hopperUtils['createHistory'](_0x4fe333)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x12f')));hopperUtils[_0xe1ec('0xcb')](_0x4fe333)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x130')));}};Dialer['prototype'][_0xe1ec('0x2a')]=function(_0xa1196d){var _0x287da1=this;if(!_0x287da1[_0xe1ec('0x21')][_0xa1196d[_0xe1ec('0x59')]]){_0x287da1[_0xe1ec('0x21')][_0xa1196d['name']]={'running':![]};}else if(_0x287da1[_0xe1ec('0x21')][_0xa1196d['name']]['running']===!![]){return;}else if(_0x287da1[_0xe1ec('0x21')][_0xa1196d['name']][_0xe1ec('0x136')]===![]){_0x287da1[_0xe1ec('0x21')][_0xa1196d[_0xe1ec('0x59')]]['running']=!![];}var _0x313752=_0x287da1['voiceQueues'][_0xa1196d[_0xe1ec('0x59')]];var _0xbe5a11=_0x313752['message']!==utils[_0xe1ec('0x64')][_0xe1ec('0x76')];var _0x105b34=utils['isPreviewCampaign'](_0x313752);_0x313752['statusMessage']=utils[_0xe1ec('0x137')](_0x313752,_0x287da1[_0xe1ec('0x1a')]);Promise[_0xe1ec('0xaa')]()[_0xe1ec('0x37')](function(){if(_0x313752['statusMessage']===utils['CAMPAIGN_STATUS'][_0xe1ec('0x76')]){if(_0xbe5a11){clearPredictiveAttributes(_0x313752);_0xa1196d['startPredictive']=undefined;_0xa1196d[_0xe1ec('0x138')]=undefined;}if(_0x313752[_0xe1ec('0x139')]===utils[_0xe1ec('0x64')][_0xe1ec('0x76')]){_0xa1196d['available']=0x0;_0xa1196d['paused']=0x0;_0xa1196d['inUse']=0x0;_0xa1196d[_0xe1ec('0x13a')]=0x0;_0xa1196d['pTalking']=0x0;}}else if(_0x313752['statusMessage']===utils[_0xe1ec('0x64')]['ACTIVE']&&!_0x105b34){return _0x287da1[_0xe1ec('0x8f')](_0x313752,!![])[_0xe1ec('0x37')](function(){return _0x287da1[_0xe1ec('0x8f')](_0x313752,![]);})[_0xe1ec('0x37')](function(){return _0x287da1[_0xe1ec('0xad')](_0x313752);})[_0xe1ec('0x9f')](function(_0x19e9f9){loggerSyncQueueSummary[_0xe1ec('0x5b')](_0xe1ec('0x13b'),util[_0xe1ec('0x3b')](_0x19e9f9,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x313752);});}else{clearPredictiveAttributes(_0x313752);}})[_0xe1ec('0x37')](function(){var _0x4dc5c1=_0xa1196d['compareToOutboundQueue'](_0x313752);if(_0x4dc5c1||_0x313752['queueSummaryCountersUpdated']){_0x313752['queueSummaryCountersUpdated']=![];_0xa1196d['updateReportFromOutboundQueue'](_0x313752);Object[_0xe1ec('0x13c')](_0x313752,_0xa1196d);emitOutboundVoiceQueueSummary(_0xa1196d);}_0x287da1[_0xe1ec('0x21')][_0x313752['name']][_0xe1ec('0x136')]=![];})[_0xe1ec('0x9f')](function(_0x529fb3){logger['error'](_0xe1ec('0x13b'),util[_0xe1ec('0x3b')](_0x529fb3,{'showHidden':![],'depth':null}));_0x287da1[_0xe1ec('0x21')][_0x313752['name']][_0xe1ec('0x136')]=![];});};Dialer[_0xe1ec('0x12')][_0xe1ec('0x2c')]=_[_0xe1ec('0x13d')](function(){var _0x17597d=_['filter'](this[_0xe1ec('0x17')],function(_0x3cffeb){return _0x3cffeb[_0xe1ec('0x13e')];});var _0xe9009d=_['filter'](this[_0xe1ec('0x19')],function(_0x56d2d9){return _0x56d2d9[_0xe1ec('0x13f')]&&_0x56d2d9[_0xe1ec('0x86')]===_0xe1ec('0x140');});if(_0x17597d['length']>0x0&&_0xe9009d[_0xe1ec('0x97')]>0x0){return Promise[_0xe1ec('0xaa')]()[_0xe1ec('0x37')](cmHopper['handlePreviewRecallNotifications'](_[_0xe1ec('0x141')](_0x17597d,'id'),previewRecallmeReminderInterval,_['map'](_0xe9009d,'id')))['then'](function(_0x94a32e){for(var _0x5efcbd=0x0;_0x5efcbd<_0x94a32e[_0xe1ec('0x97')];_0x5efcbd++){var _0x1c8787=_0x94a32e[_0x5efcbd]['Agent'][_0xe1ec('0x59')];if(_0x1c8787)io['to'](util[_0xe1ec('0x78')](_0xe1ec('0x142'),_0x1c8787))[_0xe1ec('0x39')](_0xe1ec('0x143'),{'hopper':_0x94a32e[_0x5efcbd]});}})[_0xe1ec('0x9f')](function(_0x1ca322){logger[_0xe1ec('0x5e')]('checkPreviewRecallReminder',_0x1ca322);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xe1ec('0x12')][_0xe1ec('0x36')]=function(){var _0x5147b3=this;setInterval(function(){_0x5147b3['clearZombieChannels'](_0x5147b3[_0xe1ec('0x1e')],_0xe1ec('0x144'));_0x5147b3[_0xe1ec('0x145')](_0x5147b3['actions'],_0xe1ec('0x146'));},0x32c8);};Dialer[_0xe1ec('0x12')][_0xe1ec('0x145')]=function(_0x419ada,_0x539fe4){var _0x116e5c=this;for(var _0xe99f25 in _0x419ada){if(typeof _0x419ada[_0xe99f25]!==_0xe1ec('0xa8')){this[_0xe1ec('0x15')][_0xe1ec('0x147')](function(){if(!_['isNil'](_0x419ada[_0xe99f25])){return ami['Action']({'action':_0xe1ec('0x86'),'channel':_0x419ada[_0xe99f25][_0xe1ec('0xed')]})[_0xe1ec('0x9f')](function(_0x48985e){if(_0x48985e[_0xe1ec('0x63')]===_0xe1ec('0x148')){setTimeout(function(){if(_0x419ada[_0xe99f25]&&_0x419ada[_0xe99f25][_0xe1ec('0xbc')]!==_0xe1ec('0xc2')){_0x116e5c[_0xe1ec('0xbd')](_0x116e5c['voiceQueues'][_0x419ada[_0xe99f25][_0xe1ec('0xc1')]]);logger[_0xe1ec('0x5e')]('[Dialer][checkChannel]',_0x539fe4,_0xe99f25,_0x419ada[_0xe99f25][_0xe1ec('0xc1')]);delete _0x419ada[_0xe99f25];}if(_0x419ada[_0xe99f25]&&_0x419ada[_0xe99f25][_0xe1ec('0xbc')]===_0xe1ec('0xc2')){_0x116e5c[_0xe1ec('0xbd')](_0x116e5c[_0xe1ec('0x18')][_0x419ada[_0xe99f25]['queue']]);logger[_0xe1ec('0x5e')]('[Dialer][checkChannel][ivr]',_0x539fe4,_0xe99f25,_0x419ada[_0xe99f25][_0xe1ec('0xc1')]);delete _0x419ada[_0xe99f25];}},0x2328);}});}});}}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x149')]=function(_0x1778cd){return Promise[_0xe1ec('0xaa')]()['then'](voiceQueueRt[_0xe1ec('0x149')](_0x1778cd))[_0xe1ec('0x9f')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe1ec('0x12')][_0xe1ec('0xbd')]=function(_0x466230){if(!_[_0xe1ec('0x4d')](_0x466230)&&_0x466230!==null){if(typeof _0x466230[_0xe1ec('0x7c')]!=='undefined'){if(_0x466230[_0xe1ec('0x7c')]>0x0){_0x466230[_0xe1ec('0x7c')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xe1ec('0x5e')](_0xe1ec('0x14a'));}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x14b')]=function(_0x353b04,_0x4b8c08){var _0x3adae9=this;return function(_0x26005b){_0x3adae9[_0xe1ec('0xbd')](_0x4b8c08);logger[_0xe1ec('0x5e')](_0x353b04,util[_0xe1ec('0x3b')](_0x26005b,{'showHidden':![],'depth':null}));};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x14c')]=function(_0x239989,_0x2d62d8,_0x16abe9){var _0x19895e={'state':0x19,'statedesc':_0xe1ec('0x14d')};this['updateOriginated'](_0x2d62d8);this[_0xe1ec('0x116')](_[_0xe1ec('0x58')](_0x19895e,_[_0xe1ec('0x70')](_0x16abe9,[_0xe1ec('0xdb'),'ListId',_0xe1ec('0x14e'),_0xe1ec('0x103'),_0xe1ec('0xdd')])),_0xe1ec('0x14f'),_0xe1ec('0x150'));logger[_0xe1ec('0x5e')](_0x239989);};Dialer[_0xe1ec('0x12')][_0xe1ec('0x116')]=function(_0x4fe77c,_0x5e2b5f,_0xb66a16){hopperUtils[_0xe1ec('0xc9')](_0x4fe77c)[_0xe1ec('0x9f')](loggerCatch(_0x5e2b5f));hopperUtils[_0xe1ec('0xcb')](_0x4fe77c)[_0xe1ec('0x9f')](loggerCatch(_0xb66a16));};Dialer['prototype'][_0xe1ec('0xd9')]=function(_0x15b235,_0x3cbfd7){hopperUtils['createHistory'](_0x15b235)[_0xe1ec('0x9f')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3cbfd7==0x0){hopperUtils[_0xe1ec('0xcb')](_0x15b235)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x151')));}};Dialer['prototype'][_0xe1ec('0x152')]=function(_0x40eb84){return Promise[_0xe1ec('0xaa')]()[_0xe1ec('0x37')](cmHopper[_0xe1ec('0x153')](_0x40eb84['id'],previewRecallmeReminderInterval))[_0xe1ec('0x37')](function(_0x45de41){for(var _0x15d680=0x0;_0x15d680<_0x45de41[_0xe1ec('0x97')];_0x15d680++){var _0x1783ec=_0x45de41[_0x15d680][_0xe1ec('0x154')][_0xe1ec('0x59')];if(_0x1783ec)io['to'](util[_0xe1ec('0x78')]('user:%s',_0x1783ec))[_0xe1ec('0x39')](_0xe1ec('0x143'),{'hopper':_0x45de41[_0x15d680]});}})[_0xe1ec('0x9f')](function(){});};Dialer[_0xe1ec('0x12')][_0xe1ec('0x155')]=function(_0xd774e5){var _0x1ad9a1=this;return function(){_0x1ad9a1[_0xe1ec('0x156')](_0xd774e5);};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x157')]=function(_0xe68197,_0x2434be){var _0x423175=this;var _0x552c1b=uuid['v4']();this[_0xe1ec('0x1c')][_0x552c1b]=new Action(_0xe68197,_0x2434be,_0x552c1b);return new Promise(function(_0x19eadc,_0x43c558){if(_[_0xe1ec('0x4d')](_0xe68197)&&typeof _0xe68197!==_0xe1ec('0x158')){return _0x43c558(msgResponse('originate',_0xe1ec('0x90'),_0xe1ec('0x159')));}if(_[_0xe1ec('0x4d')](_0x2434be[_0xe1ec('0x15a')])||_0x2434be[_0xe1ec('0x15a')]===null){return _0x43c558(msgResponse(_0xe1ec('0x15b'),_0xe1ec('0x90'),_0xe1ec('0x15c')));}var _0x44bc95={'XMD-CALLERID':_0x423175[_0xe1ec('0x1c')][_0x552c1b][_0xe1ec('0x15d')](),'XMD-AGI':_0xe68197['dialQueueProject']?util['format'](_0xe1ec('0x15e'),ipAgi,_0xe68197['dialQueueProject']):_0xe1ec('0x15f'),'XMD-AGIAFTER':_0xe68197[_0xe1ec('0xc7')]?util[_0xe1ec('0x78')](_0xe1ec('0x15e'),ipAgi,_0xe68197[_0xe1ec('0xc7')]):_0xe1ec('0x15f'),'XMD-QUEUE':utils[_0xe1ec('0x160')](_0xe68197)?util[_0xe1ec('0x78')](_0xe1ec('0x161'),_0xe68197[_0xe1ec('0x59')],_0xe68197[_0xe1ec('0x162')]||'',_0xe68197['dialAgiAfterHangupAgent']?'c':'',_0xe68197['dialQueueTimeout']||0x3):_0xe1ec('0x15f'),'XMD-CONTACTID':_0x2434be['ContactId'],'XMD-CDRTYPE':_0xe1ec('0x163'),'CALLERID(all)':_0x423175[_0xe1ec('0x1c')][_0x552c1b][_0xe1ec('0x15d')](),'XMD-AMD':_0xe68197[_0xe1ec('0x10e')]?'ACTIVE':_0xe1ec('0x15f'),'XMD-DESTINATION':_0xe1ec('0x10d')};if(_0xe68197['dialAMDActive']){_0x44bc95['XMD-AMDINITIALSILENCE']=_0xe68197[_0xe1ec('0x164')]||0x9c4;_0x44bc95[_0xe1ec('0x165')]=_0xe68197[_0xe1ec('0x166')]||0x5dc;_0x44bc95[_0xe1ec('0x167')]=_0xe68197[_0xe1ec('0x168')]||0x320;_0x44bc95['XMD-AMDTOTALANALYSISTIME']=_0xe68197['dialAMDTotalAnalysisTime']||0x1388;_0x44bc95[_0xe1ec('0x169')]=_0xe68197[_0xe1ec('0x16a')]||0x64;_0x44bc95[_0xe1ec('0x16b')]=_0xe68197[_0xe1ec('0x16c')]||0x32;_0x44bc95[_0xe1ec('0x16d')]=_0xe68197[_0xe1ec('0x16e')]||0x3;_0x44bc95[_0xe1ec('0x16f')]=_0xe68197[_0xe1ec('0x170')]||0x100;_0x44bc95[_0xe1ec('0x171')]=_0xe68197[_0xe1ec('0x172')]||0x1388;}if(utils[_0xe1ec('0x160')](_0xe68197)){_0x44bc95[_0xe1ec('0x173')]=_0x2434be['VoiceQueueId'];}else{_0x44bc95[_0xe1ec('0x174')]=_0x2434be['CampaignId'];}var _0x5c1023=utils[_0xe1ec('0x175')](_0x2434be[_0xe1ec('0x176')]);Object['assign'](_0x44bc95,_0x5c1023);var _0xbf42b5=_0x423175['isTrunkReachable'](_0xe68197[_0xe1ec('0x89')])?utils[_0xe1ec('0x177')](_0xe68197[_0xe1ec('0x89')][_0xe1ec('0x178')],_0xe68197[_0xe1ec('0x179')],_0xe68197[_0xe1ec('0x17a')]>0x0?utils[_0xe1ec('0x17b')](_0xe68197[_0xe1ec('0x17c')],_0xe68197[_0xe1ec('0x17a')]):_0xe68197[_0xe1ec('0x17c')]):utils[_0xe1ec('0x177')](_[_0xe1ec('0xf1')](_0xe68197[_0xe1ec('0x8a')])?_0xe68197[_0xe1ec('0x89')][_0xe1ec('0x178')]:_0xe68197[_0xe1ec('0x8a')]['callerid'],_0xe68197[_0xe1ec('0x179')],_0xe68197[_0xe1ec('0x17a')]>0x0?utils[_0xe1ec('0x17b')](_0xe68197[_0xe1ec('0x17c')],_0xe68197[_0xe1ec('0x17a')]):_0xe68197[_0xe1ec('0x17c')]);if(_0xbf42b5){_0x44bc95['XMD-ORIGINATECALLERIDNAME']=_0x423175[_0xe1ec('0x1c')][_0x552c1b][_0xe1ec('0x17d')]=utils[_0xe1ec('0x17e')](_0xbf42b5);_0x44bc95[_0xe1ec('0x17f')]=_0x2434be[_0xe1ec('0x15a')];}_0xe68197['variables']=_0x44bc95;return ami[_0xe1ec('0x99')]({'actionid':_0x552c1b,'action':_0xe1ec('0x15b'),'channel':_0x423175['isTrunkReachable'](_0xe68197['Trunk'])?util[_0xe1ec('0x78')](_0xe1ec('0x180'),_0xe68197[_0xe1ec('0x89')]['name'],isNotNull(_0xe68197[_0xe1ec('0x181')])?_0xe68197['dialPrefix']['trim']()||'':'',_0xe68197[_0xe1ec('0x182')]>0x0?_0x2434be[_0xe1ec('0x15a')][_0xe1ec('0x183')](_0xe68197['dialCutDigit']):_0x2434be[_0xe1ec('0x15a')]):util['format'](_0xe1ec('0x180'),_[_0xe1ec('0xf1')](_0xe68197[_0xe1ec('0x8a')])?_0xe68197['Trunk'][_0xe1ec('0x59')]:_0xe68197['TrunkBackup'][_0xe1ec('0x59')],isNotNull(_0xe68197[_0xe1ec('0x181')])?_0xe68197[_0xe1ec('0x181')][_0xe1ec('0x184')]()||'':'',_0xe68197[_0xe1ec('0x182')]>0x0?_0x2434be[_0xe1ec('0x15a')]['substring'](_0xe68197['dialCutDigit']):_0x2434be[_0xe1ec('0x15a')]),'callerid':_0xbf42b5,'Exten':_0xe1ec('0x10d'),'Context':_0xe1ec('0x185'),'Priority':'1','variable':_0x44bc95,'timeout':(_0xe68197['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x552c1b})['then'](function(_0x895986){return _0x19eadc(_0x895986);})[_0xe1ec('0x9f')](function(_0x2ac661){_0xe68197[_0xe1ec('0x186')]+=0x1;var _0x5865ee=new History(_0x423175[_0xe1ec('0x1c')][_0x552c1b]);logger['error'](util[_0xe1ec('0x78')](_0xe1ec('0x187'),JSON['stringify'](_0x2ac661)));_0x5865ee[_0xe1ec('0xd0')]=0xe;_0x5865ee[_0xe1ec('0x69')]=_0xe1ec('0x188');_0x5865ee[_0xe1ec('0x6b')]=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));_0x5865ee[_0xe1ec('0x6a')]=_0x5865ee[_0xe1ec('0x6b')];hopperUtils[_0xe1ec('0xc9')](_0x5865ee)['catch'](loggerCatch(_0xe1ec('0x189')));_0x423175[_0xe1ec('0xcb')](_0x5865ee)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x189')))['finally'](function(){delete _0x423175[_0xe1ec('0x1c')][_0x552c1b];return _0x43c558(msgResponse(_0xe1ec('0x15b'),_0xe1ec('0x82'),_0xe1ec('0x18a')));});});});};Dialer['prototype'][_0xe1ec('0x18b')]=function(_0x13522f,_0xa3fab4,_0x3c990d){var _0x3afc72=new History(_0xa3fab4);if(_0x3afc72[_0xe1ec('0x12a')]+_0x3afc72['countcongestionretry']+_0x3afc72[_0xe1ec('0x11d')]+_0x3afc72[_0xe1ec('0x11e')]+_0x3afc72['countdropretry']+_0x3afc72[_0xe1ec('0xe5')]+_0x3afc72[_0xe1ec('0x11b')]+_0x3afc72[_0xe1ec('0x11f')]>=_0x3c990d[_0xe1ec('0x120')]-0x1){return!![];}switch(_0x13522f){case 0x3:if(_0x3afc72[_0xe1ec('0x11d')]>=_0x3c990d[_0xe1ec('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x3afc72['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d[_0xe1ec('0x18d')],_0xe1ec('0xea'))['format'](_0xe1ec('0xbf')),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72['VoiceQueueId']||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x18e')));break;case 0x5:if(_0x3afc72[_0xe1ec('0x12a')]>=_0x3c990d['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xe1ec('0xda')]({'active':![],'countbusyretry':_0x3afc72[_0xe1ec('0x12a')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d[_0xe1ec('0x18f')],_0xe1ec('0xea'))['format'](_0xe1ec('0xbf')),'ContactId':_0x3afc72['ContactId'],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72[_0xe1ec('0x103')]||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})['catch'](loggerCatch(_0xe1ec('0x190')));break;case 0x8:if(_0x3afc72[_0xe1ec('0x12b')]>=_0x3c990d[_0xe1ec('0x191')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x3afc72['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x3c990d[_0xe1ec('0x192')],'minutes')[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72['VoiceQueueId']||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3afc72[_0xe1ec('0x11e')]>=_0x3c990d[_0xe1ec('0x193')]-0x1){return!![];}else{hopperUtils[_0xe1ec('0xda')]({'active':![],'countnosuchnumberretry':_0x3afc72[_0xe1ec('0x11e')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d[_0xe1ec('0x194')],'minutes')[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72[_0xe1ec('0x103')]||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3afc72['countdropretry']>=_0x3c990d[_0xe1ec('0xd8')]-0x1){return!![];}hopperUtils[_0xe1ec('0xda')]({'active':![],'countdropretry':_0x3afc72[_0xe1ec('0xd3')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d[_0xe1ec('0xd5')],_0xe1ec('0xea'))[_0xe1ec('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72[_0xe1ec('0x103')]||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})['catch'](loggerCatch(_0xe1ec('0xde')));break;case 0xb:if(_0x3afc72[_0xe1ec('0xe5')]>=_0x3c990d[_0xe1ec('0x195')]-0x1){return!![];}hopperUtils[_0xe1ec('0xda')]({'active':![],'countabandonedretry':_0x3afc72[_0xe1ec('0xe5')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d[_0xe1ec('0xe9')],_0xe1ec('0xea'))[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3afc72['ContactId'],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72[_0xe1ec('0x103')]||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x3afc72['countmachineretry']>=_0x3c990d[_0xe1ec('0x122')]-0x1){return!![];}hopperUtils[_0xe1ec('0xda')]({'active':![],'countmachineretry':_0x3afc72[_0xe1ec('0x11b')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d['dialMachineRetryFrequency'],_0xe1ec('0xea'))[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72['VoiceQueueId']||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3afc72['countagentrejectretry']>=_0x3c990d[_0xe1ec('0x196')]-0x1){return!![];}hopperUtils[_0xe1ec('0xda')]({'active':![],'countagentrejectretry':_0x3afc72[_0xe1ec('0x11f')]+=0x1,'scheduledat':moment()[_0xe1ec('0xe8')](_0x3c990d['dialAgentRejectRetryFrequency'],_0xe1ec('0xea'))[_0xe1ec('0x78')](_0xe1ec('0xbf')),'ContactId':_0x3afc72[_0xe1ec('0xdb')],'ListId':_0x3afc72[_0xe1ec('0xdc')],'VoiceQueueId':_0x3afc72['VoiceQueueId']||undefined,'CampaignId':_0x3afc72[_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xe1ec('0x197')]=function(_0x434148,_0x2576d3,_0x5ce695){var _0x401808=this;var _0xd2ce2a=new History(_0x434148);var _0x1e652b=![];var _0xfaac03;var _0x3d2d35;return new Promise(function(_0x27bf27,_0x5baf10){if(_['isUndefined'](_0x2576d3)&&typeof _0x2576d3!==_0xe1ec('0x158')){return _0x5baf10(msgResponse(_0xe1ec('0x198'),'Failure',_0xe1ec('0x199')));}if(_[_0xe1ec('0x4d')](_0x5ce695)&&typeof _0x5ce695!==_0xe1ec('0x158')){return _0x5baf10(msgResponse(_0xe1ec('0x198'),_0xe1ec('0x90'),_0xe1ec('0x19a')));}hopperUtils[_0xe1ec('0xe7')](_0xd2ce2a,_0x5ce695[_0xe1ec('0xc4')],_0x2576d3)[_0xe1ec('0x37')](function(_0x154cd7){if(_0x154cd7['additional']==0x1)_0x1e652b=!![];switch(_0x5ce695[_0xe1ec('0xc4')]){case'0':_0x2576d3[_0xe1ec('0x19b')]+=0x1;_0xd2ce2a['state']=0x0;_0xd2ce2a[_0xe1ec('0x69')]=_0xe1ec('0x19c');_0xd2ce2a['countnosuchnumberretry']+=0x1;_0xd2ce2a[_0xe1ec('0xd4')]+=0x1;ami[_0xe1ec('0x39')](_0xe1ec('0x19d'),ut[_0xe1ec('0x126')](_0x434148,_0xe1ec('0x19e')));_0xfaac03=_0x2576d3[_0xe1ec('0x194')];_0x3d2d35=_0x2576d3[_0xe1ec('0xe6')];hopperUtils[_0xe1ec('0xc9')](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x11c')));if(_0x401808[_0xe1ec('0x18b')](0x0,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a[_0xe1ec('0x11e')]>=_0x2576d3[_0xe1ec('0x193')]){_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x19f'));}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x19f'));}}break;case'3':_0x2576d3['outboundNoAnswerCallsDay']+=0x1;_0xd2ce2a[_0xe1ec('0xd0')]=0x3;_0xd2ce2a[_0xe1ec('0x69')]=_0xe1ec('0x1a0');_0xd2ce2a[_0xe1ec('0x11d')]+=0x1;_0xd2ce2a[_0xe1ec('0xd4')]+=0x1;var _0x5623a8=ut['buildNoAnswerEventPayload'](_0x434148,_0x2576d3);ami['emit'](_0xe1ec('0x1a1'),_0x5623a8);_0xfaac03=_0x2576d3[_0xe1ec('0x18d')];_0x3d2d35=_0x2576d3['callAdditionalPhoneAfterMin'];hopperUtils[_0xe1ec('0xc9')](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x401808['checkRetriveMax'](0x3,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a[_0xe1ec('0x11d')]>=_0x2576d3[_0xe1ec('0x18c')]){_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1a2'));}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1a2'));}}break;case'5':_0x2576d3[_0xe1ec('0x1a3')]+=0x1;_0xd2ce2a['state']=0x5;_0xd2ce2a[_0xe1ec('0x69')]=_0xe1ec('0x1a4');_0xd2ce2a['countbusyretry']+=0x1;_0xd2ce2a[_0xe1ec('0xd4')]+=0x1;ami[_0xe1ec('0x39')](_0xe1ec('0x1a5'),ut['buildObj'](_0x434148,_0xe1ec('0x1a6')));_0xfaac03=_0x2576d3['dialBusyRetryFrequency'];_0x3d2d35=_0x2576d3[_0xe1ec('0xe6')];hopperUtils[_0xe1ec('0xc9')](_0xd2ce2a)['catch'](loggerCatch(_0xe1ec('0x1a7')));if(_0x401808[_0xe1ec('0x18b')](0x5,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a[_0xe1ec('0x12a')]>=_0x2576d3[_0xe1ec('0x1a8')]){_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1a9'));}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1a9'));}}break;case'8':_0x2576d3[_0xe1ec('0x1aa')]+=0x1;_0xd2ce2a[_0xe1ec('0xd0')]=0x8;_0xd2ce2a[_0xe1ec('0x69')]='Congestion';_0xd2ce2a[_0xe1ec('0x12b')]+=0x1;_0xd2ce2a[_0xe1ec('0xd4')]+=0x1;_0xfaac03=_0x2576d3['dialCongestionRetryFrequency'];_0x3d2d35=_0x2576d3['callAdditionalPhoneAfterMin'];ami[_0xe1ec('0x39')]('custom:agentcongestion',ut[_0xe1ec('0x126')](_0x434148,_0xe1ec('0x1ab')));hopperUtils['createHistory'](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x401808[_0xe1ec('0x18b')](0x8,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a[_0xe1ec('0x12b')]>=_0x2576d3[_0xe1ec('0x191')]){_0x401808['createStateFinal'](_0xd2ce2a,_0x27bf27,_0x5baf10,'reason\x208\x20congestion');}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1ac'));}}break;case'11':_0x2576d3['outboundAbandonedCallsDay']+=0x1;_0xd2ce2a[_0xe1ec('0xd0')]=0xb;_0xd2ce2a[_0xe1ec('0x69')]='Abandoned';_0xd2ce2a['countabandonedretry']+=0x1;_0xd2ce2a[_0xe1ec('0xd4')]+=0x1;_0xfaac03=_0x2576d3['dialAbandonedRetryFrequency'];_0x3d2d35=_0x2576d3[_0xe1ec('0xe6')];hopperUtils[_0xe1ec('0xc9')](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0xec')));if(_0x401808[_0xe1ec('0x18b')](0xb,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a[_0xe1ec('0xe5')]>=_0x2576d3[_0xe1ec('0x195')]){_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1ad'));}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1ad'));}}break;case'20':_0x2576d3['outboundRejectCallsDay']+=0x1;_0xd2ce2a[_0xe1ec('0xd0')]=0x14;_0xd2ce2a[_0xe1ec('0x69')]='AgentReject';_0xd2ce2a[_0xe1ec('0x11f')]+=0x1;_0xd2ce2a['countglobal']+=0x1;_0xfaac03=_0x2576d3[_0xe1ec('0x1ae')];_0x3d2d35=_0x2576d3[_0xe1ec('0xe6')];ami[_0xe1ec('0x39')](_0xe1ec('0x1af'),ut[_0xe1ec('0x126')](_0x434148,_0xe1ec('0x1b0')));hopperUtils[_0xe1ec('0xc9')](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1b1')));if(_0x401808[_0xe1ec('0x18b')](0x14,_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a['countagentrejectretry']>=_0x2576d3[_0xe1ec('0x196')]){_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1b2'));}else{_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0xe1ec('0x1b2'));}}break;default:_0x2576d3['outboundUnknownCallsDay']+=0x1;_0xd2ce2a['state']=0xc;_0xd2ce2a[_0xe1ec('0x69')]=_0x5ce695[_0xe1ec('0xc4')];_0xfaac03=_0x2576d3[_0xe1ec('0x1ae')];_0x3d2d35=_0x2576d3['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xd2ce2a)[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1b3')));if(_0x401808[_0xe1ec('0x18b')](_0x5ce695['reason'],_0x434148,_0x2576d3)&&!_0x1e652b){if(_0xd2ce2a['countbusyretry']+_0xd2ce2a[_0xe1ec('0x12b')]+_0xd2ce2a[_0xe1ec('0x11d')]+_0xd2ce2a[_0xe1ec('0x11e')]+_0xd2ce2a['countdropretry']+_0xd2ce2a[_0xe1ec('0xe5')]+_0xd2ce2a[_0xe1ec('0x11b')]+_0xd2ce2a[_0xe1ec('0x11f')]>=_0x2576d3[_0xe1ec('0x120')]){_0x401808[_0xe1ec('0x121')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0x5ce695[_0xe1ec('0xc4')]);}else{_0x401808[_0xe1ec('0x12d')](_0xd2ce2a,_0x27bf27,_0x5baf10,_0x5ce695[_0xe1ec('0xc4')]);}}}})[_0xe1ec('0x37')](function(){if(_0x1e652b){hopperUtils[_0xe1ec('0xe1')](_0xd2ce2a,_0xfaac03,_0x3d2d35)[_0xe1ec('0x37')](function(){return _0x27bf27(0x1);});}});});};Dialer[_0xe1ec('0x12')][_0xe1ec('0x121')]=function(_0x1513e9,_0x35b0fa,_0xbd4cd8,_0x3211c5){var _0x38c8be=new Final(_0x1513e9);_0x38c8be[_0xe1ec('0xd0')]=0xf;_0x38c8be[_0xe1ec('0x69')]=_0xe1ec('0x1b4');this[_0xe1ec('0x12d')](_0x38c8be,_0x35b0fa,_0xbd4cd8,_0x3211c5);};Dialer[_0xe1ec('0x12')][_0xe1ec('0x12d')]=function(_0x442e85,_0x5ae7d5,_0x390121,_0x1c8084){hopperUtils[_0xe1ec('0xcb')](_0x442e85)['then'](function(){return _0x5ae7d5(msgResponse('[callProgressDetecting]','Success',_0x1c8084));})['catch'](function(){return _0x390121(msgResponse(_0xe1ec('0x1b5'),_0xe1ec('0x90'),_0xe1ec('0x1b6')));});};Dialer[_0xe1ec('0x12')][_0xe1ec('0x6')]=function(_0x560904){var _0x4bc286=_0x560904[_0xe1ec('0x1b7')]/0x64;var _0x4ca757=_0x560904[_0xe1ec('0x1b8')]/(_0x560904[_0xe1ec('0x1b8')]+_0x560904[_0xe1ec('0xc3')]);var _0x4b14e7=Math[_0xe1ec('0x1b9')](_0x560904[_0xe1ec('0x1ba')]*(_0x560904[_0xe1ec('0x1bb')]/0x64));var _0x4e5444=Math[_0xe1ec('0x1b9')](_0x560904['predictiveIntervalAvailable']*(_0x560904[_0xe1ec('0x1bc')]/0x64));var _0x3ca408=_0x560904[_0xe1ec('0x1bd')]+_0x560904[_0xe1ec('0x13a')];var _0x52b70a=Math[_0xe1ec('0x1be')](_0x560904['erlangCalls']*_0x560904[_0xe1ec('0x1bf')]*_0x560904[_0xe1ec('0x1c0')]*_0x560904['predictiveIntervalMultiplicativeFactor']);if(_[_0xe1ec('0x4d')](_0x560904['startProgressive'])){if(!_[_0xe1ec('0x4d')](_0x560904[_0xe1ec('0x1f')])){_0x560904[_0xe1ec('0x1f')]=undefined;loggerPredictive['error'](_0xe1ec('0x1c1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xe1ec('0x4d')](_0x560904[_0xe1ec('0x5d')])){loggerPredictive[_0xe1ec('0x5e')](_0xe1ec('0x1c1'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x560904['handlePredictive']);_0x560904[_0xe1ec('0x5d')]=undefined;}_0x560904[_0xe1ec('0x138')]=moment()[_0xe1ec('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xe1ec('0x3f')](_0x560904[_0xe1ec('0x59')],_0xe1ec('0x1c2'),_0x560904[_0xe1ec('0x138')]);this['handlePower'](_0x560904,0x1);}else if(ifInterval(_0x560904[_0xe1ec('0x1c3')],_0x560904[_0xe1ec('0x138')])){this[_0xe1ec('0xaf')](_0x560904,0x1);loggerPredictiveCalls[_0xe1ec('0x3f')]('[startMethodPredictive][StartProgressive][Loop]',_0x560904[_0xe1ec('0x138')],_0x560904[_0xe1ec('0x59')]);_0x560904[_0xe1ec('0x53')]=0x0;_0x560904['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4bc286<_0x4ca757&&_0x560904['dialPredictiveOptimization']===_0xe1ec('0x1c4')){clearPredictiveAttributes(_0x560904);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x1c5'),_0xe1ec('0x1c6'),_0x4ca757,_0xe1ec('0x138'),_0x560904['name']);}else if(_0x52b70a<_0x560904[_0xe1ec('0xcf')]&&_0x560904['dialPredictiveOptimization']===_0xe1ec('0x1c4')){clearPredictiveAttributes(_0x560904);loggerPredictive['info'](_0xe1ec('0x1c7'),_0xe1ec('0x1c8'),_0x52b70a,_0xe1ec('0x1c9'),_0x560904[_0xe1ec('0xcf')],_0xe1ec('0x138'),_0x560904[_0xe1ec('0x59')]);}else if(!ifInterval(_0x560904['dialPredictiveInterval'],_0x560904['startProgressive'])&&_[_0xe1ec('0x4d')](_0x560904[_0xe1ec('0x1f')])&&!_[_0xe1ec('0x4d')](_0x560904[_0xe1ec('0x138')])){_0x560904[_0xe1ec('0x1f')]=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));loggerPredictive[_0xe1ec('0x3f')](_0x560904[_0xe1ec('0x59')],'started\x20in\x20predictive\x20at',_0x560904['startPredictive']);hopperUtils[_0xe1ec('0x1ca')](_0x560904['dialPredictiveInterval'])[_0xe1ec('0x37')](this[_0xe1ec('0x1cb')](_0x560904))[_0xe1ec('0x37')](mergeDataErlangB(_0x560904))['then'](this['startMethodPredictive'](_0x560904))[_0xe1ec('0x9f')](loggerCatchPredictive(_0xe1ec('0x1cc'),_0x560904));}else if(!ifInterval(_0x560904[_0xe1ec('0x1c3')],_0x560904[_0xe1ec('0x1f')])){_0x560904['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x560904[_0xe1ec('0x1f')]=moment()[_0xe1ec('0x78')](_0xe1ec('0xbf'));loggerPredictive[_0xe1ec('0x3f')](_0x560904[_0xe1ec('0x59')],'recalculate\x20predictive\x20at',_0x560904[_0xe1ec('0x1f')]);clearInterval(_0x560904['handlePredictive']);_0x560904['handlePredictive']=undefined;hopperUtils[_0xe1ec('0x1ca')](_0x560904[_0xe1ec('0x1c3')])[_0xe1ec('0x37')](this[_0xe1ec('0x1cb')](_0x560904))['then'](mergeDataErlangB(_0x560904))[_0xe1ec('0x37')](this[_0xe1ec('0x1cd')](_0x560904))['catch'](loggerCatchPredictive(_0xe1ec('0x1ce'),_0x560904));}else if(_0x560904[_0xe1ec('0x1ba')]&&_0x3ca408<_0x560904[_0xe1ec('0x1ba')]-_0x4e5444){clearPredictiveAttributes(_0x560904);loggerPredictive['info'](_0x560904[_0xe1ec('0x59')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3ca408,_0xe1ec('0x1cf'),_0x560904[_0xe1ec('0x1ba')],'-',_0x4e5444,'=',_0x560904[_0xe1ec('0x1ba')]-_0x4e5444,')');}else if(_0x560904[_0xe1ec('0x1ba')]&&_0x3ca408>_0x560904[_0xe1ec('0x1ba')]+_0x4b14e7){clearPredictiveAttributes(_0x560904);loggerPredictive['info'](_0x560904[_0xe1ec('0x59')],_0xe1ec('0x1d0'),_0x3ca408,_0xe1ec('0x1d1'),_0x560904[_0xe1ec('0x1ba')],'+',_0x4b14e7,'=',_0x560904[_0xe1ec('0x1ba')]+_0x4b14e7,')');}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x1cb')]=function(_0x3a7d8f){var _0x791845=this;return function(_0x2ce876){return new Promise(function(_0x208394,_0x2d671e){_[_0xe1ec('0x58')](_0x3a7d8f,_0x2ce876[0x0]);if(checkGetDataPredictive(_0x2ce876[0x0])){var _0x5db7f5=_0x3a7d8f[_0xe1ec('0x1ba')]=_0x3a7d8f[_0xe1ec('0x13a')]+_0x3a7d8f[_0xe1ec('0x1bd')];var _0x514e63=_0x3a7d8f[_0xe1ec('0x1c3')]*0x3c;var _0x23655f=_0x2ce876[0x0][_0xe1ec('0x4b')]+_0x2ce876[0x0][_0xe1ec('0x49')];var _0x3ffa3c=(_0x2ce876[0x0][_0xe1ec('0x43')]+_0x2ce876[0x0][_0xe1ec('0x45')]+_0x2ce876[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2ce876[0x0][_0xe1ec('0x41')];_0x3a7d8f['predictiveIntervalHitRate']=_0x3ffa3c>0x0?_0x3ffa3c:0x1;switch(_0x3a7d8f[_0xe1ec('0x1d2')]){case'dropRate':var _0x49c388=_0x3a7d8f[_0xe1ec('0x1b7')]/0x64;return _0x791845[_0xe1ec('0x1d3')](_0x5db7f5,_0x514e63,_0x23655f,_0x3ffa3c,_0x49c388)[_0xe1ec('0x37')](function(_0x6a6c7c){return _0x208394(_0x6a6c7c);});case _0xe1ec('0x1d4'):var _0x392d10=_0x3a7d8f[_0xe1ec('0x1b7')]/0x64;return _0x791845['busyFactor'](_0x5db7f5,_0x514e63,_0x23655f,_0x3ffa3c,_0x392d10)[_0xe1ec('0x37')](function(_0x4842b1){return _0x208394(_0x4842b1);});default:return _0x2d671e(msgResponse(_0xe1ec('0x1d5'),_0xe1ec('0x90'),'Unknown\x20Predictive'));}}else{return _0x2d671e(msgResponse('[getDataPredictive]',_0xe1ec('0x90'),_0xe1ec('0x1d6')));}});};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x1d7')]=function(_0x5ae109){var _0x1895b8=this;return function(_0x1dd130){return new Promise(function(_0x474a8c,_0x55eb84){_[_0xe1ec('0x58')](_0x5ae109,_0x1dd130[0x0]);if(checkGetDataPredictive(_0x1dd130[0x0])){loggerPredictive[_0xe1ec('0x3f')](JSON[_0xe1ec('0x6f')](_0x1dd130[0x0]));if(_0x5ae109[_0xe1ec('0x1d2')]===_0xe1ec('0x1c4')){return _0x1895b8[_0xe1ec('0x149')](_0x5ae109['id'])[_0xe1ec('0x37')](function(_0x87320e){var _0x2c8617=_0x5ae109['loggedIn']-_0x87320e[0x0][_0xe1ec('0x1d8')];var _0x454387=_0x5ae109[_0xe1ec('0x1c3')]*0x3c;var _0x2780a4=_0x1dd130[0x0]['predictiveIntervalAvgTalktime']+_0x1dd130[0x0][_0xe1ec('0x49')];var _0x211ba9=(_0x1dd130[0x0][_0xe1ec('0x43')]+_0x1dd130[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1dd130[0x0][_0xe1ec('0x47')])/_0x1dd130[0x0][_0xe1ec('0x41')];var _0x4b4839=_0x5ae109[_0xe1ec('0x1b7')]/0x64;_0x5ae109['predictiveIntervalPauses']=_0x87320e[0x0][_0xe1ec('0x1d8')]||0x0;_0x5ae109[_0xe1ec('0x1c0')]=_0x211ba9>0x0?_0x211ba9:0x1;return _0x1895b8['abandonmentRate'](_0x2c8617,_0x454387,_0x2780a4,_0x211ba9,_0x4b4839);})[_0xe1ec('0x37')](function(_0xc3b0c4){return _0x474a8c(_0xc3b0c4);})[_0xe1ec('0x9f')](function(_0x37d5a8){return _0x55eb84(msgResponse('[CatchErlangB]',_0xe1ec('0x90'),JSON[_0xe1ec('0x6f')](_0x37d5a8)));});}if(_0x5ae109[_0xe1ec('0x1d2')]===_0xe1ec('0x1d4')){return _0x1895b8[_0xe1ec('0x149')](_0x5ae109['id'])[_0xe1ec('0x37')](function(_0x2574dd){var _0x3f7362=_0x5ae109[_0xe1ec('0x1d9')]-_0x2574dd[0x0]['outboundQueuePauses'];var _0x34cffb=_0x5ae109[_0xe1ec('0x1c3')]*0x3c;var _0x3832d2=_0x1dd130[0x0]['predictiveIntervalAvgTalktime']+_0x1dd130[0x0][_0xe1ec('0x49')];var _0x327ea5=(_0x1dd130[0x0]['predictiveIntervalAnsweredCalls']+_0x1dd130[0x0][_0xe1ec('0x45')]+_0x1dd130[0x0][_0xe1ec('0x47')])/_0x1dd130[0x0][_0xe1ec('0x41')];var _0x120f9b=_0x5ae109['dialPredictiveOptimizationPercentage']/0x64;_0x5ae109[_0xe1ec('0x1da')]=_0x2574dd[0x0][_0xe1ec('0x1d8')]||0x0;_0x5ae109[_0xe1ec('0x1c0')]=_0x327ea5>0x0?_0x327ea5:0x1;return _0x1895b8[_0xe1ec('0x1db')](_0x3f7362,_0x34cffb,_0x3832d2,_0x327ea5,_0x120f9b);})['then'](function(_0x1c3295){return _0x474a8c(_0x1c3295);})[_0xe1ec('0x9f')](function(_0x1faeff){return _0x55eb84(msgResponse('[CatchErlangB]',_0xe1ec('0x90'),JSON[_0xe1ec('0x6f')](_0x1faeff)));});}}else{return _0x55eb84(msgResponse(_0xe1ec('0x1d5'),'Failure','check\x20failure'));}});};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x1cd')]=function(_0xf2a13d){var _0x3273bd=this;return function(){var _0x56b040=0x0;var _0x119a59=Math[_0xe1ec('0x1be')](_0xf2a13d[_0xe1ec('0x54')]*0x3e8);if(_0x119a59>0x0){_0x119a59=_0x119a59<0x64?0x64:_0x119a59;loggerPredictive[_0xe1ec('0x3f')](_0xf2a13d[_0xe1ec('0x59')],_0xe1ec('0x1dc'),_0x119a59,_0xe1ec('0x1dd'));_0xf2a13d[_0xe1ec('0x5d')]=setInterval(function(){_0x3273bd[_0xe1ec('0x5d')](_0xf2a13d);loggerPredictiveCalls[_0xe1ec('0x3f')](_0xe1ec('0x1de'),_0x56b040+=0x1);},_0x119a59);}else{loggerPredictive['info'](_0xf2a13d[_0xe1ec('0x59')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x1df')]=function(_0x4bbc90,_0x5c8756){var _0x48ce9a=this;return function(_0x4069c9){if(_[_0xe1ec('0x3e')](_0x4069c9)){if(_[_0xe1ec('0xf1')](_0x5c8756['UserId'])||!_0x5c8756[_0xe1ec('0x1e0')]){if(_0x4bbc90['dialMethod']===_0xe1ec('0xb1')){_0x4bbc90[_0xe1ec('0x6c')]=_[_0xe1ec('0x4d')](_0x4bbc90['queueStatusComplete'])?!![]:_0x4bbc90[_0xe1ec('0x6c')];var _0x194a3b=uuid['v4']();_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b]=new Action(_0x4bbc90,_0x5c8756,_0x194a3b);loggerBooked['info']('[booked][checkContactBlack]',_0x194a3b,_0xe1ec('0x1e1'),JSON[_0xe1ec('0x6f')](_0x4bbc90[_0xe1ec('0x6c')]),_0xe1ec('0x1e2'),_0x4bbc90[_0xe1ec('0x59')]);if(_0x4bbc90['queueStatusComplete']){_0x4bbc90[_0xe1ec('0x6c')]=![];_0x48ce9a[_0xe1ec('0x20')][_0x48ce9a['actions'][_0x194a3b]['queue']]=[];ami[_0xe1ec('0x99')]({'actionid':_0x194a3b,'action':'queuestatus','queue':_0x4bbc90[_0xe1ec('0x59')]})[_0xe1ec('0x9f')](function(){_0x48ce9a[_0xe1ec('0xbd')](_0x4bbc90);hopperUtils[_0xe1ec('0xda')]({'active':![],'ContactId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0xdb')],'ListId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0xdc')],'VoiceQueueId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0x103')]||undefined,'CampaignId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1e3')));delete _0x48ce9a[_0xe1ec('0x1c')][_0x194a3b];});}else{loggerBooked[_0xe1ec('0x3f')](_0xe1ec('0x1e4'),JSON[_0xe1ec('0x6f')](_0x4bbc90[_0xe1ec('0x6c')]),_0xe1ec('0x1e2'),_0x4bbc90[_0xe1ec('0x59')]);_0x48ce9a[_0xe1ec('0xbd')](_0x4bbc90);hopperUtils[_0xe1ec('0xda')]({'active':![],'ContactId':_0x48ce9a['actions'][_0x194a3b][_0xe1ec('0xdb')],'ListId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b]['ListId'],'VoiceQueueId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0x103')]||undefined,'CampaignId':_0x48ce9a[_0xe1ec('0x1c')][_0x194a3b][_0xe1ec('0xdd')]||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1e3')));delete _0x48ce9a[_0xe1ec('0x1c')][_0x194a3b];}}else{return _0x48ce9a[_0xe1ec('0x157')](_0x4bbc90,_0x5c8756);}}else{if(utils[_0xe1ec('0xcd')](undefined,_0x5c8756[_0xe1ec('0x1e5')])<_0x4bbc90[_0xe1ec('0x1e6')]*0x3c){if(_0x5c8756[_0xe1ec('0x154')]&&!_0x5c8756[_0xe1ec('0x154')]['voicePause']){_0x48ce9a[_0xe1ec('0x16')][_0xe1ec('0xf8')](_0x5c8756['id'])[_0xe1ec('0x14')](function(){_0x48ce9a[_0xe1ec('0xbd')](_0x4bbc90);});}else{hopperUtils['unlockContact']({'active':![]},_0x5c8756['id'],0x1)[_0xe1ec('0x14')](function(){_0x48ce9a[_0xe1ec('0xbd')](_0x4bbc90);});}}else{_0x4bbc90[_0xe1ec('0x1e7')]+=0x1;_0x48ce9a[_0xe1ec('0xbd')](_0x4bbc90);if(_0x4bbc90['dialRecallInQueue']){hopperUtils[_0xe1ec('0xda')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5c8756[_0xe1ec('0xdb')],'ListId':_0x5c8756[_0xe1ec('0xdc')],'VoiceQueueId':_0x5c8756[_0xe1ec('0x103')]||undefined,'CampaignId':_0x5c8756['CampaignId']||undefined})[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1e8')));hopperUtils['createHistory'](createObjHistory(_0x4bbc90,_0x5c8756,utils['CAMPAIGN_STATUS'][_0xe1ec('0x1e9')],0x17,_0xe1ec('0x1ea')))[_0xe1ec('0x9f')](loggerCatch(_0xe1ec('0x1eb')));}else{_0x48ce9a[_0xe1ec('0x116')](createObjHistory(_0x4bbc90,_0x5c8756,utils[_0xe1ec('0x64')][_0xe1ec('0x1ec')],0x16,_0xe1ec('0x1ed')),_0xe1ec('0x1ee'),'[Originate][HistoryRecallClose]');}}}}else{_0x4bbc90[_0xe1ec('0x1ef')]+=0x1;_0x48ce9a[_0xe1ec('0x116')](createObjHistory(_0x4bbc90,_0x5c8756,utils[_0xe1ec('0x64')][_0xe1ec('0x1f0')],0xd,_0xe1ec('0x1f1')),_0xe1ec('0x1f2'),_0xe1ec('0x1f3'));throw _0xe1ec('0x1f4');}};};Dialer[_0xe1ec('0x12')][_0xe1ec('0x156')]=function(_0x40f97e){var _0x5cbd98=this;var _0x324bc4=_0x40f97e['limitCalls']-_0x40f97e[_0xe1ec('0x7c')];emitCampaignSummary(_0x40f97e);if(_0x324bc4>0x0&&_0x40f97e[_0xe1ec('0x61')]==0x0){if(_0x324bc4>this[_0xe1ec('0x1b')]){_0x324bc4=this[_0xe1ec('0x1b')];}_0x40f97e['temp']=0x1;hopperUtils[_0xe1ec('0x1f5')](_0x40f97e,_0x324bc4)['then'](function(_0x4c6651){_0x40f97e['temp']=0x0;if(_0x4c6651){if(!utils[_0xe1ec('0x1f6')](_0x4c6651)){_0x40f97e[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x68')];logger['info'](_0xe1ec('0x1f7')+_0x40f97e['name']);}else{_0x40f97e[_0xe1ec('0x7c')]+=_0x4c6651[_0xe1ec('0x97')];_0x40f97e[_0xe1ec('0x63')]=utils['CAMPAIGN_STATUS'][_0xe1ec('0x1f8')];for(var _0x309009=0x0;_0x309009<_0x4c6651[_0xe1ec('0x97')];_0x309009+=0x1){_0x40f97e[_0xe1ec('0x1f9')]+=0x1;if(_[_0xe1ec('0xf1')](_0x4c6651[_0x309009])||_[_0xe1ec('0xf1')](_0x4c6651[_0x309009][_0xe1ec('0x176')])||_['isNil'](_0x4c6651[_0x309009][_0xe1ec('0x15a')])){_0x5cbd98[_0xe1ec('0x14c')]('[actionOriginate]\x20',_0x40f97e,_0x4c6651[_0x309009]);}else{hopperUtils[_0xe1ec('0x1fa')](_[_0xe1ec('0x70')](_0x4c6651[_0x309009],['CampaignId',_0xe1ec('0x15a')]))[_0xe1ec('0x37')](_0x5cbd98[_0xe1ec('0x1df')](_0x40f97e,_0x4c6651[_0x309009]))['catch'](_0x5cbd98[_0xe1ec('0x14b')](_0xe1ec('0x1fb'),_0x40f97e));}}}}})[_0xe1ec('0x9f')](loggerGetContactDialer(_0xe1ec('0x1fc'),_0x40f97e,_0x324bc4));}};Dialer[_0xe1ec('0x12')][_0xe1ec('0xaf')]=function(_0x46cb78,_0x251a27){var _0x4a003a=this;var _0x41ffac=[];if(_0x251a27<0x1||_0x46cb78[_0xe1ec('0x1fd')]===_0xe1ec('0xb1')){_0x251a27=0x1;}var _0x530df1=Math[_0xe1ec('0x1be')](_0x46cb78[_0xe1ec('0x1bd')]*_0x251a27)-_0x46cb78[_0xe1ec('0x7c')];if(_0x46cb78[_0xe1ec('0x1fe')]>0x0){var _0x41533f=_0x46cb78[_0xe1ec('0x1fe')]-_0x46cb78[_0xe1ec('0x7c')]-_0x46cb78['talking']-_0x46cb78[_0xe1ec('0x1ff')];if(_0x530df1>_0x41533f){_0x530df1=_0x41533f;}}if(_0x530df1>0x0&&_0x46cb78[_0xe1ec('0x61')]==0x0){if(_0x46cb78['dialMethod']==='booked'){_0x530df1=0x1;}if(_0x530df1>this['maxNumberOriginate']){_0x530df1=this[_0xe1ec('0x1b')];}for(var _0x3e180e in this[_0xe1ec('0x19')]){if(typeof this[_0xe1ec('0x19')][_0x3e180e]!=='undefined'){if(this[_0xe1ec('0x19')][_0x3e180e][_0xe1ec('0xd0')]===_0xe1ec('0x200')&&this[_0xe1ec('0x19')][_0x3e180e][_0xe1ec('0x86')]===_0xe1ec('0x140')){_0x41ffac[_0xe1ec('0x98')](this[_0xe1ec('0x19')][_0x3e180e]['id']);}}}_0x46cb78[_0xe1ec('0x61')]=0x1;hopperUtils[_0xe1ec('0x201')](_0x46cb78,_0x41ffac,_0x530df1)[_0xe1ec('0x37')](function(_0x1920f2){_0x46cb78['temp']=0x0;if(_0x1920f2){if(!utils['checkContactEmpty'](_0x1920f2)){hopperUtils['countReScheduled'](_0x46cb78)[_0xe1ec('0x37')](sendMessageReschedule(_0x46cb78))[_0xe1ec('0x9f')](loggerCatch('[countReScheduled]\x20'));}else{_0x46cb78[_0xe1ec('0x7c')]+=_0x1920f2[_0xe1ec('0x97')];_0x46cb78[_0xe1ec('0x63')]=_0x46cb78[_0xe1ec('0x1fd')]==='booked'?utils['CAMPAIGN_STATUS'][_0xe1ec('0x202')]:utils[_0xe1ec('0x64')][_0xe1ec('0x1f8')];for(var _0x4a4a58=0x0;_0x4a4a58<_0x1920f2['length'];_0x4a4a58+=0x1){if(_[_0xe1ec('0xf1')](_0x1920f2[_0x4a4a58])||_['isNil'](_0x1920f2[_0x4a4a58][_0xe1ec('0x176')])||_[_0xe1ec('0xf1')](_0x1920f2[_0x4a4a58][_0xe1ec('0x15a')])){_0x4a003a[_0xe1ec('0x14c')]('[actionOriginate]\x20',_0x46cb78,_0x1920f2[_0x4a4a58]);}else{hopperUtils[_0xe1ec('0x203')](_[_0xe1ec('0x70')](_0x1920f2[_0x4a4a58],[_0xe1ec('0x103'),_0xe1ec('0x15a')]))[_0xe1ec('0x37')](_0x4a003a['checkContactBlack'](_0x46cb78,_0x1920f2[_0x4a4a58]))[_0xe1ec('0x9f')](_0x4a003a[_0xe1ec('0x14b')](_0xe1ec('0x204'),_0x46cb78));}}}}})[_0xe1ec('0x9f')](loggerGetContactDialer(_0xe1ec('0x205'),_0x46cb78,_0x530df1));}};Dialer[_0xe1ec('0x12')][_0xe1ec('0x5d')]=function(_0x84bf03){if(_0x84bf03[_0xe1ec('0x1fe')]>0x0){var _0xeca092=_0x84bf03['dialLimitQueue']-_0x84bf03[_0xe1ec('0x7c')]-_0x84bf03[_0xe1ec('0x13a')];if(_0xeca092>0x0&&_0x84bf03[_0xe1ec('0x61')]==0x0){this[_0xe1ec('0x206')](_0x84bf03);}else{loggerPredictiveCalls[_0xe1ec('0x3f')](_0xe1ec('0x207'));}}else{this[_0xe1ec('0x206')](_0x84bf03);}};Dialer[_0xe1ec('0x12')]['tryOriginatePredictive']=function(_0x210aa8){var _0x3581a7=this;var _0x2890c8=[];_0x210aa8['originated']+=0x1;for(var _0x67a4cb in this[_0xe1ec('0x19')]){if(typeof this['agents'][_0x67a4cb]!==_0xe1ec('0xa8')){if(this[_0xe1ec('0x19')][_0x67a4cb][_0xe1ec('0xd0')]===_0xe1ec('0x200')&&this[_0xe1ec('0x19')][_0x67a4cb]['status']===_0xe1ec('0x140')){_0x2890c8[_0xe1ec('0x98')](this[_0xe1ec('0x19')][_0x67a4cb]['id']);}}}_0x210aa8[_0xe1ec('0x61')]=0x1;return this['getContactDialer'](_0x210aa8['id'],_0x2890c8,0x1,_0x210aa8[_0xe1ec('0x208')],_0x210aa8)[_0xe1ec('0x37')](function(_0x43a2e6){_0x210aa8[_0xe1ec('0x61')]=0x1;if(_0x43a2e6){if(!utils['checkContactEmpty'](_0x43a2e6)){utils[_0xe1ec('0x60')](_0x210aa8,0x1,0x0);return hopperUtils[_0xe1ec('0x209')](_0x210aa8)[_0xe1ec('0x37')](sendMessageReschedule(_0x210aa8))['catch'](loggerCatch(_0xe1ec('0x20a')));}else{_0x210aa8[_0xe1ec('0x63')]=utils[_0xe1ec('0x64')][_0xe1ec('0x1f8')];if(_[_0xe1ec('0xf1')](_0x43a2e6[0x0])||_[_0xe1ec('0xf1')](_0x43a2e6[0x0]['Contact'])||_[_0xe1ec('0xf1')](_0x43a2e6[0x0][_0xe1ec('0x15a')])){_0x3581a7[_0xe1ec('0x14c')]('[actionOriginate]\x20',_0x210aa8,_0x43a2e6[0x0]);}else{return hopperUtils[_0xe1ec('0x203')](_[_0xe1ec('0x70')](_0x43a2e6[0x0],[_0xe1ec('0x103'),'phone']))['then'](_0x3581a7[_0xe1ec('0x1df')](_0x210aa8,_0x43a2e6[0x0]))['catch'](_0x3581a7[_0xe1ec('0x14b')](_0xe1ec('0x20b'),_0x210aa8));}}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x210aa8,0x1));};Dialer[_0xe1ec('0x12')]['abandonmentRate']=function(_0x3a84fb,_0x35a557,_0x3de8e0,_0x17acf3,_0x13139e,_0x3c0217){loggerPredictive[_0xe1ec('0x3f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe1ec('0x3f')]('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',_0x3a84fb);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x20c'),_0x35a557);loggerPredictive['info'](_0xe1ec('0x20d'),_0x3de8e0);loggerPredictive[_0xe1ec('0x3f')]('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',_0x17acf3);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x20e'),_0x13139e);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x57'));return new Promise(function(_0x1e0973,_0x29f203){if(_0x3a84fb<=0x0||isNaN(_0x3a84fb)){return _0x29f203(msgResponse(_0xe1ec('0x20f'),_0xe1ec('0x82'),_0xe1ec('0x210')+_0x3a84fb));}if(_0x3de8e0<=0x0||isNaN(_0x3de8e0)){return _0x29f203(msgResponse(_0xe1ec('0x20f'),_0xe1ec('0x82'),_0xe1ec('0x211')+_0x3de8e0));}if(_0x17acf3<=0x0||isNaN(_0x17acf3)){return _0x29f203(msgResponse('[abandonmentRate]',_0xe1ec('0x82'),_0xe1ec('0x212')+_0x17acf3));}if(_0x35a557<=0x0||isNaN(_0x35a557)){return _0x29f203(msgResponse(_0xe1ec('0x20f'),'Error','interval\x20=\x20'+_0x35a557));}if(_0x13139e<=0x0||isNaN(_0x13139e)){return _0x29f203(msgResponse(_0xe1ec('0x20f'),_0xe1ec('0x82'),_0xe1ec('0x213')+_0x13139e));}_0x3c0217=_0x3c0217||0x0;var _0x46c527=0x1/_0x3de8e0;var _0x55c541=0x0;var _0x16ef14=0x0;var _0x28dc56=0x0;var _0x5a26a3=0x0;for(var _0x27c6c5=0x0;_0x28dc56<_0x13139e;_0x27c6c5+=0x1){_0x16ef14=_0x27c6c5/_0x35a557;_0x55c541=(_0x17acf3*_0x16ef14+_0x3c0217)/_0x46c527;_0x28dc56=utils['erlangb'](_0x55c541,_0x3a84fb);_0x5a26a3=_0x55c541/_0x3a84fb*(0x1-utils[_0xe1ec('0x214')](_0x55c541,_0x3a84fb));}return _0x1e0973({'erlangCalls':_0x27c6c5,'erlangCallToSecond':_0x35a557/_0x27c6c5,'erlangAbandonmentRate':_0x28dc56,'erlangBusyFactor':_0x5a26a3});});};Dialer['prototype'][_0xe1ec('0x1db')]=function(_0x5ed188,_0xc8ed3c,_0x2858f5,_0x3a229,_0x2f61c5,_0x4d1d15){loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x215'));loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x216'),_0x5ed188);loggerPredictive[_0xe1ec('0x3f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc8ed3c);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x20d'),_0x2858f5);loggerPredictive[_0xe1ec('0x3f')]('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',_0x3a229);loggerPredictive[_0xe1ec('0x3f')](_0xe1ec('0x217'),_0x2f61c5);loggerPredictive['info'](_0xe1ec('0x57'));return new Promise(function(_0x49f8c5,_0x39697d){if(_0x5ed188<=0x0||isNaN(_0x5ed188)){return _0x39697d(msgResponse('[busyFactor]',_0xe1ec('0x82'),'m\x20=\x20'+_0x5ed188));}if(_0x2858f5<=0x0||isNaN(_0x2858f5)){return _0x39697d(msgResponse(_0xe1ec('0x218'),_0xe1ec('0x82'),_0xe1ec('0x211')+_0x2858f5));}if(_0x3a229<=0x0||isNaN(_0x3a229)){return _0x39697d(msgResponse(_0xe1ec('0x218'),_0xe1ec('0x82'),_0xe1ec('0x212')+_0x3a229));}if(_0xc8ed3c<=0x0||isNaN(_0xc8ed3c)){return _0x39697d(msgResponse(_0xe1ec('0x218'),_0xe1ec('0x82'),_0xe1ec('0x219')+_0xc8ed3c));}if(_0x2f61c5<=0x0||isNaN(_0x2f61c5)){return _0x39697d(msgResponse(_0xe1ec('0x218'),'Error','Umin\x20=\x20'+_0x2f61c5));}_0x4d1d15=_0x4d1d15||0x0;var _0x379714=0x1/_0x2858f5;var _0x412002=0x0;var _0xe267d6=0x0;var _0x4cdb6b=0x0;var _0x36f5e7=0x0;for(var _0x18b76f=0x0;_0x36f5e7<_0x2f61c5;_0x18b76f+=0x1){_0xe267d6=_0x18b76f/_0xc8ed3c;_0x412002=(_0x3a229*_0xe267d6+_0x4d1d15)/_0x379714;_0x4cdb6b=utils[_0xe1ec('0x214')](_0x412002,_0x5ed188);_0x36f5e7=_0x412002/_0x5ed188*(0x1-utils[_0xe1ec('0x214')](_0x412002,_0x5ed188));}return _0x49f8c5({'erlangCalls':_0x18b76f,'erlangCallToSecond':_0xc8ed3c/_0x18b76f,'erlangAbandonmentRate':_0x4cdb6b,'erlangBusyFactor':_0x36f5e7});});};module[_0xe1ec('0x21a')]=Dialer; \ No newline at end of file +var _0x074c=['dialTimezone','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','type','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','callAdditionalPhoneAfterMin','countdropretry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','CampaignId','Drop','endtime','calleridname','calleridnum','createHistory','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','countglobal','verifyAdditionalPhones','voiceQueue','dialAbandonedMaxRetry','additional','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','roundrobin','isNil','locked','paused','stateinterface','rrmemory','queueBooked','idHopper','preview','run','rescheduleContact','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','AMD','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','stateGlobal','dialMachineMaxRetry','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','queuesSummary','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','checkPreviewRecallReminder','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','isOutboundQueue','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','getCallerId','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnoanswerretry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','getDataPredictive','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','checkContactEmpty','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[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','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]','Ts\x20=\x20','p\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','interval\x20=\x20','exports','util','lodash','uuid','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','newexten','syncNewExten','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','prototype','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','then','true','command','content','indexOf','catch','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','undefined','isIVRCampaignActive','resolve','[syncCampaigns]','dialMethod','progressive','power','handlePower','dialPowerLevel','method\x20not\x20recognized'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x074c,0x164));var _0xc074=function(_0x4bdd56,_0x219c46){_0x4bdd56=_0x4bdd56-0x0;var _0x5c1151=_0x074c[_0x4bdd56];return _0x5c1151;};'use strict';var util=require(_0xc074('0x0'));var _=require(_0xc074('0x1'));var uuid=require(_0xc074('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require(_0xc074('0x3'));var utils=require(_0xc074('0x4'));var hopperUtils=require(_0xc074('0x5'));var ut=require(_0xc074('0x6'));var config=require(_0xc074('0x7'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xc074('0x8'))(_0xc074('0x9'));var loggerPredictive=require(_0xc074('0x8'))(_0xc074('0xa'));var loggerPredictiveCalls=require(_0xc074('0x8'))(_0xc074('0xb'));var loggerSyncQueueSummary=require(_0xc074('0x8'))(_0xc074('0xc'));var ami=require('../ami');config[_0xc074('0xd')]=_[_0xc074('0xe')](config[_0xc074('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xc074('0xf'))(new Redis(config[_0xc074('0xd')]));var cmHopper=require(_0xc074('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0xc074('0x11'));var Action=require(_0xc074('0x12'));var History=require(_0xc074('0x13'));var Final=require(_0xc074('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xc074('0x15'));var Hangup=require(_0xc074('0x16'));var ipAgi=process[_0xc074('0x17')]['XCALLY_IP_AGI']||_0xc074('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xc074('0x19')]=function(_0x11d0c){this[_0xc074('0x1a')]=this[_0xc074('0x1a')]?this[_0xc074('0x1a')][_0xc074('0x1b')](_0x11d0c):_0x11d0c();};function Dialer(_0x3a17a4,_0x267db6){this[_0xc074('0x1c')]=new Sequence();this['preview']=_0x267db6;this[_0xc074('0x1d')]=_0x3a17a4[_0xc074('0x1d')];this[_0xc074('0x1e')]=_0x3a17a4[_0xc074('0x1e')];this[_0xc074('0x1f')]=_0x3a17a4[_0xc074('0x1f')];this[_0xc074('0x20')]=_0x3a17a4['trunks'];this[_0xc074('0x21')]=config[_0xc074('0x21')]||0x2;this[_0xc074('0x22')]={};this[_0xc074('0x23')]={};this[_0xc074('0x24')]={};this[_0xc074('0x25')]={};this[_0xc074('0x26')]={};this[_0xc074('0x27')]={};this[_0xc074('0x28')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xc074('0x29')]={};this['queuesSummary']={};ami['on'](_0xc074('0x2a'),this[_0xc074('0x2b')][_0xc074('0x2c')](this));ami['on']('queuecallerabandon',this[_0xc074('0x2d')]['bind'](this));ami['on'](_0xc074('0x2e'),this['syncOriginateResponse'][_0xc074('0x2c')](this));ami['on']('agentcomplete',this[_0xc074('0x2f')][_0xc074('0x2c')](this));ami['on'](_0xc074('0x30'),this[_0xc074('0xc')][_0xc074('0x2c')](this));ami['on'](_0xc074('0x31'),this['syncQueueSummaryComplete'][_0xc074('0x2c')](this));ami['on']('hangup',this[_0xc074('0x32')][_0xc074('0x2c')](this));ami['on'](_0xc074('0x33'),this[_0xc074('0x34')][_0xc074('0x2c')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xc074('0x35'),this['syncQueueMember']['bind'](this));ami['on'](_0xc074('0x36'),this[_0xc074('0x37')][_0xc074('0x2c')](this));this[_0xc074('0x38')]();this[_0xc074('0x39')]();RpcSetting[_0xc074('0x3a')]()['then'](function(_0x386267){previewRecallmeReminderInterval=_0x386267[_0xc074('0x3b')];});}function isNotNull(_0x27ea85){return _0x27ea85!==null&&!_[_0xc074('0x3c')](_0x27ea85);}function msgResponse(_0x3e099a,_0xb1894d,_0x49a7d1){return{'action':_0x3e099a,'response':_0xb1894d,'message':_0x49a7d1,'stack':_0x49a7d1};}function emit(_0x3ad4f7,_0x454446,_0x3f7f9d){io['to'](_0x3ad4f7)[_0xc074('0x3d')](_0x454446,_0x3f7f9d);}function emitOutboundVoiceQueueSummary(_0x2d1f47){if(_0x2d1f47['type']===_0xc074('0x3e')){logger[_0xc074('0x3f')](_0xc074('0x40'),util['inspect'](_0x2d1f47,{'showHidden':![],'depth':null}));emit(util['format'](_0xc074('0x41'),_0x2d1f47['name']),_0xc074('0x42'),_0x2d1f47);}}function checkGetDataPredictive(_0x2aeca7){if(isNotNull(_0x2aeca7)&&!_[_0xc074('0x43')](_0x2aeca7)){loggerPredictive[_0xc074('0x44')](_0xc074('0x45'));loggerPredictive[_0xc074('0x44')](_0xc074('0x46'),_0x2aeca7[_0xc074('0x47')]);loggerPredictive[_0xc074('0x44')](_0xc074('0x48'),_0x2aeca7[_0xc074('0x49')]);loggerPredictive[_0xc074('0x44')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2aeca7[_0xc074('0x4a')]);loggerPredictive[_0xc074('0x44')](_0xc074('0x4b'),_0x2aeca7[_0xc074('0x4c')]);loggerPredictive[_0xc074('0x44')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2aeca7[_0xc074('0x4d')]);loggerPredictive[_0xc074('0x44')](_0xc074('0x4e'),_0x2aeca7['predictiveIntervalAvgTalktime']);loggerPredictive[_0xc074('0x44')](_0xc074('0x4f'));if(_0x2aeca7[_0xc074('0x47')]>0x0){if(!_[_0xc074('0x3c')](_0x2aeca7['predictiveIntervalAvgTalktime'])&&_0x2aeca7[_0xc074('0x50')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xc074('0x3c')](_0x2aeca7[_0xc074('0x4d')])&&_0x2aeca7['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xc074('0x44')](_0xc074('0x51'));}else{loggerPredictive[_0xc074('0x44')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc074('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x46e776){return function(_0x53faa2){loggerPredictive[_0xc074('0x44')](_0xc074('0x52'));loggerPredictive[_0xc074('0x44')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53faa2[_0xc074('0x53')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53faa2[_0xc074('0x54')]);loggerPredictive[_0xc074('0x44')](_0xc074('0x55'),_0x53faa2[_0xc074('0x56')]);loggerPredictive[_0xc074('0x44')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53faa2[_0xc074('0x57')]);loggerPredictive[_0xc074('0x44')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x53faa2[_0xc074('0x56')]);loggerPredictive['info'](_0xc074('0x4f'));_[_0xc074('0x58')](_0x46e776,_0x53faa2);};}function ifInterval(_0x4fe396,_0x4249b7){if(_[_0xc074('0x3c')](_0x4249b7)){return![];}return utils[_0xc074('0x59')](undefined,_0x4249b7)<_0x4fe396*0x3c;}function clearPredictiveAttributes(_0x1bce8f){if(_0x1bce8f[_0xc074('0x28')]){_0x1bce8f[_0xc074('0x28')]=undefined;loggerPredictive[_0xc074('0x3f')](_0x1bce8f[_0xc074('0x5a')],_0xc074('0x5b'));}if(_0x1bce8f['startPredictive']){_0x1bce8f[_0xc074('0x27')]=undefined;loggerPredictive[_0xc074('0x3f')](_0x1bce8f['name'],'startPredictive\x20value\x20cleared');}if(_0x1bce8f[_0xc074('0x5c')]){clearInterval(_0x1bce8f['handlePredictive']);_0x1bce8f[_0xc074('0x5c')]=undefined;loggerPredictive['debug'](_0x1bce8f[_0xc074('0x5a')],_0xc074('0x5d'));}}function loggerCatchPredictive(_0x5f57e9,_0x217fbe){return function(_0x2904a7){loggerPredictive['error'](_0x217fbe[_0xc074('0x5a')],_0x5f57e9);loggerPredictive[_0xc074('0x5e')](_0x2904a7['stack']);clearPredictiveAttributes(_0x217fbe);};}function loggerCatch(_0x466ad5){return function(_0x1c7eca){logger[_0xc074('0x5e')](_0x466ad5,util['inspect'](_0x1c7eca,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4ee832,_0x568bd5,_0x523882){return function(_0x3c7db8){utils[_0xc074('0x5f')](_0x568bd5,_0x523882,0x0);_0x568bd5[_0xc074('0x60')]=0x0;logger[_0xc074('0x5e')](_0x4ee832,util[_0xc074('0x61')](_0x3c7db8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x233f1f){return function(_0x5ce9c6){if(isNotNull(_0x5ce9c6)&&isNotNull(_0x5ce9c6[0x0])){if(_0x5ce9c6[0x0][_0xc074('0x62')]>0x0){_0x233f1f[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x65')];logger[_0xc074('0x44')](_0xc074('0x66')+_0x233f1f['name'],_0x5ce9c6[0x0][_0xc074('0x62')],_0xc074('0x67'));}else{_0x233f1f['message']=utils[_0xc074('0x64')][_0xc074('0x68')];logger[_0xc074('0x44')]('[getContactDialer2][Empty]'+_0x233f1f[_0xc074('0x5a')]);}}};}function createObjHistory(_0x1cceea,_0x386e36,_0x558481,_0x4d222f,_0x3faab3){_0x1cceea[_0xc074('0x63')]=_0x558481;var _0xa4cc3=new Action(_0x1cceea,_0x386e36);var _0x4c6881=new History(_0xa4cc3);_0x4c6881[_0xc074('0x69')]=_0x4d222f;_0x4c6881[_0xc074('0x6a')]=_0x3faab3;_0x4c6881['endtime']=_0xa4cc3[_0xc074('0x6b')];return _0x4c6881;}function unlockQueueStatus(_0x28deab,_0x55e141){setTimeout(function(){if(_['isUndefined'](_0x28deab[_0xc074('0x6c')])){loggerBooked[_0xc074('0x5e')](_0xc074('0x6d'),_0x55e141);}_0x28deab[_0xc074('0x6c')]=!![];loggerBooked[_0xc074('0x44')](_0xc074('0x6e'),_0x55e141,JSON[_0xc074('0x6f')](_[_0xc074('0x70')](_0x28deab,[_0xc074('0x5a'),_0xc074('0x6c')])));},0x1f3);}function checkInterval(_0x2a613a){return function(){if(!isNotNull(_0x2a613a['Interval'])){_0x2a613a[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x71')];throw _0x2a613a[_0xc074('0x5a')]+_0xc074('0x72');}if(!isNotNull(_0x2a613a[_0xc074('0x73')][_0xc074('0x74')])){_0x2a613a[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x71')];throw _0x2a613a['name']+_0xc074('0x72');}if(!isNotNull(_['isEmpty'](_0x2a613a['Interval'][_0xc074('0x74')]))){_0x2a613a['message']=utils[_0xc074('0x64')]['NULL_INTERVAL'];throw _0x2a613a['name']+_0xc074('0x72');}};}function checkIsIVRCampaignActive(_0x4e7755){return function(){if(!utils['isIVRCampaignActive'](_0x4e7755)){_0x4e7755[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x75')];throw _0x4e7755[_0xc074('0x5a')]+_0xc074('0x76');}};}function emitCampaignSummary(_0x2f0f12){if(utils[_0xc074('0x77')](_0x2f0f12)){emit(util[_0xc074('0x78')](_0xc074('0x79'),_0x2f0f12['name']),_0xc074('0x7a'),_0x2f0f12);}}function loggerCatchQueueSummary(_0x41ebcf,_0x16311e){return function(_0x8cc421){clearPredictiveAttributes(_0x16311e);emitCampaignSummary(_0x16311e);loggerSyncQueueSummary['debug'](_0x41ebcf,util['inspect'](_0x8cc421,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x21172a){if(_0x21172a['sendMessageOneNotActive']){if(_0x21172a[_0xc074('0x7b')]===0x0){_0x21172a[_0xc074('0x7c')]=![];_0x21172a[_0xc074('0x63')]=utils['CAMPAIGN_STATUS'][_0xc074('0x75')];loggerSyncQueueSummary[_0xc074('0x3f')](_0xc074('0x7d'),_0x21172a[_0xc074('0x5a')],'is\x20not\x20active');}else{_0x21172a[_0xc074('0x63')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0xc074('0x3f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x21172a[_0xc074('0x5a')],_0xc074('0x7e'));}emitCampaignSummary(_0x21172a);}}function myreject(_0x18b71a){return function(_0x11bd8a){return _0x18b71a(msgResponse(_0xc074('0x7f'),_0xc074('0x80'),JSON['stringify'](_0x11bd8a)));};}Dialer['prototype'][_0xc074('0x81')]=function(_0x583c07){return!_[_0xc074('0x3c')](_0x583c07)&&_0x583c07&&!_[_0xc074('0x3c')](_0x583c07[_0xc074('0x5a')])&&!_['isUndefined'](_0x583c07[_0xc074('0x82')])&&_0x583c07[_0xc074('0x82')]&&(this[_0xc074('0x20')][util[_0xc074('0x78')]('SIP/%s',_0x583c07[_0xc074('0x5a')])][_0xc074('0x83')]===_0xc074('0x84')||this[_0xc074('0x20')][util[_0xc074('0x78')](_0xc074('0x85'),_0x583c07[_0xc074('0x5a')])][_0xc074('0x83')]===_0xc074('0x86'));};Dialer[_0xc074('0x87')][_0xc074('0x88')]=function(_0x2f4f3a){var _0x281340=this;return function(){if(!_0x281340[_0xc074('0x81')](_0x2f4f3a['Trunk'])){if(!_0x281340[_0xc074('0x81')](_0x2f4f3a[_0xc074('0x89')])){_0x2f4f3a[_0xc074('0x63')]=utils['CAMPAIGN_STATUS'][_0xc074('0x8a')];throw _0x2f4f3a[_0xc074('0x5a')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xc074('0x87')][_0xc074('0x8b')]=function(_0x4c5b6f,_0xada509,_0x54ea82,_0x1880aa){var _0x361dc0=this;return function(){var _0x1ca0ca=!![];return _0x361dc0['ifTimeIvr'](_0x4c5b6f,_0xada509,_0x54ea82,_0x1880aa,_0x1ca0ca);};};Dialer[_0xc074('0x87')][_0xc074('0x8c')]=function(_0x49f29f,_0x5fc0df,_0x15ca28,_0x42af1f){var _0x56643f=this;return function(){var _0x435219=![];return _0x56643f['ifTimeIvr'](_0x49f29f[_0xc074('0x74')],_0x5fc0df,_0x15ca28,_0x42af1f,_0x435219);};};Dialer[_0xc074('0x87')]['ifTimeIvr']=function(_0x2558fc,_0x13e857,_0x5044c,_0x2a8ae2,_0x48c2ef){var _0x3a0712=[];return new Promise(function(_0x5f14e8,_0x5a626b){if(!isNotNull(_0x2558fc)){_0x2a8ae2[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x71')];return _0x5a626b(msgResponse(_0xc074('0x8d'),_0xc074('0x8e'),_0x5044c+_0xc074('0x8f')));}if(_[_0xc074('0x43')](_0x2558fc)){_0x2a8ae2[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x90')];return _0x5a626b(msgResponse(_0xc074('0x8d'),_0xc074('0x8e'),_0x5044c+'\x20Intervals\x20is\x20empty\x20'));}if(_0x13e857&&_[_0xc074('0x3c')](config[_0xc074('0x91')][_0x13e857])){_0x2a8ae2[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x92')];return _0x5a626b(msgResponse(_0xc074('0x8d'),'Failure',_0x5044c+_0xc074('0x93')+_0x13e857));}if(_[_0xc074('0x94')](_0x2558fc)){for(var _0x349696=0x0;_0x349696<_0x2558fc[_0xc074('0x95')];_0x349696+=0x1){_0x3a0712[_0xc074('0x96')](ami[_0xc074('0x97')]({'action':'command','command':util[_0xc074('0x78')](_0xc074('0x98'),_0x2558fc[_0x349696]['interval'],!_[_0xc074('0x3c')](config[_0xc074('0x91')][_0x13e857])?_0x13e857:'')})[_0xc074('0x99')](function(_0x2a1b9b){return _0x2a1b9b['content']['indexOf'](_0xc074('0x9a'))>=0x0;})['catch'](myreject(_0x5a626b)));}}else{_0x3a0712['push'](ami[_0xc074('0x97')]({'action':_0xc074('0x9b'),'command':util[_0xc074('0x78')](_0xc074('0x98'),_0x2558fc,!_[_0xc074('0x3c')](config[_0xc074('0x91')][_0x13e857])?_0x13e857:'')})[_0xc074('0x99')](function(_0x3ec5af){return _0x3ec5af[_0xc074('0x9c')][_0xc074('0x9d')]('true')>=0x0;})[_0xc074('0x9e')](myreject(_0x5a626b)));}Promise[_0xc074('0x9f')](_0x3a0712)[_0xc074('0x99')](function(_0x1a5082){var _0x47fa0b=_[_0xc074('0xa0')](_0x1a5082);if(_0x47fa0b){return _0x5f14e8(_0x47fa0b);}else{_0x2a8ae2[_0xc074('0x63')]=_0x48c2ef?utils['CAMPAIGN_STATUS'][_0xc074('0xa1')]:utils[_0xc074('0x64')]['OVERTIME_INTERVAL'];return _0x5a626b(msgResponse(_0xc074('0xa2'),_0xc074('0x8e'),_0xc074('0xa3')+_0x48c2ef+'\x20'+_0x5044c+_0xc074('0xa4')+util[_0xc074('0x61')](_0x2558fc,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x13e857));}})[_0xc074('0x9e')](function(_0x2e9fe0){return _0x5a626b(msgResponse(_0xc074('0x8d'),_0xc074('0x8e'),JSON[_0xc074('0x6f')](_0x2e9fe0)));});});};Dialer[_0xc074('0x87')][_0xc074('0x38')]=function(){var _0x2cf293=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x2cf293[_0xc074('0xa5')]();},0x3e8);});};Dialer[_0xc074('0x87')][_0xc074('0xa5')]=function(){var _0x4e97fa=this;var _0x2aa98b;for(var _0x26d334 in this[_0xc074('0x1e')]){if(typeof this[_0xc074('0x1e')][_0x26d334]!==_0xc074('0xa6')){_0x2aa98b=this[_0xc074('0x1e')][_0x26d334];if(utils['isIVRCampaign'](_0x2aa98b)&&utils[_0xc074('0xa7')](_0x2aa98b)){_0x2aa98b[_0xc074('0x7c')]=!![];Promise[_0xc074('0xa8')]()[_0xc074('0x99')](checkIsIVRCampaignActive(_0x2aa98b))['then'](checkInterval(_0x2aa98b))['then'](_0x4e97fa[_0xc074('0x88')](_0x2aa98b))[_0xc074('0x99')](_0x4e97fa[_0xc074('0x8b')](_0x2aa98b['dialGlobalInterval'],_0x2aa98b['dialTimezone'],_0x2aa98b[_0xc074('0x5a')],_0x2aa98b))['then'](_0x4e97fa[_0xc074('0x8c')](_0x2aa98b['Interval'],_0x2aa98b['dialTimezone'],_0x2aa98b[_0xc074('0x5a')],_0x2aa98b))[_0xc074('0x99')](_0x4e97fa['launchHandleIvr'](_0x2aa98b))[_0xc074('0x9e')](loggerCatchQueueSummary(_0xc074('0xa9'),_0x2aa98b));}else{notSendMessagesCampaign(_0x2aa98b);}}}};Dialer['prototype']['checkDialMethod']=function(_0x354cd5){if(_0x354cd5[_0xc074('0xaa')]!=='predictive'){clearPredictiveAttributes(_0x354cd5);}switch(_0x354cd5[_0xc074('0xaa')]){case _0xc074('0xab'):this['handlePower'](_0x354cd5,0x1);break;case _0xc074('0xac'):this[_0xc074('0xad')](_0x354cd5,_0x354cd5[_0xc074('0xae')]);break;case _0xc074('0xa'):this[_0xc074('0xa')](_0x354cd5);break;case _0xc074('0x9'):this['handlePower'](_0x354cd5,0x1);break;default:logger[_0xc074('0x5e')]('Queue',_0x354cd5['name'],_0xc074('0xaf'));}};Dialer[_0xc074('0x87')]['ifTime']=function(_0x3a95a0,_0x16df9c){var _0x18144c=_0x3a95a0[_0xc074('0xb0')];var _0x56559a=_0x16df9c?_0x3a95a0[_0xc074('0xb1')]:_0x3a95a0[_0xc074('0x73')][_0xc074('0x74')];logger[_0xc074('0xb2')](_0xc074('0xb3'),_0x56559a,_0x18144c,_0x3a95a0[_0xc074('0x5a')],util['format'](_0xc074('0xb4'),_0x3a95a0[_0xc074('0x5a')],_0x3a95a0['id']));var _0x17b091=null;return Interval[_0xc074('0xb5')](_0x56559a,_0x18144c)[_0xc074('0x99')](function(_0x2a16af){if(_0x2a16af===!![]){return _0x2a16af;}else{_0x3a95a0[_0xc074('0x63')]=_0x16df9c?utils[_0xc074('0x64')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xc074('0x64')]['OVERTIME_INTERVAL'];_0x17b091=msgResponse(_0xc074('0xa2'),_0xc074('0x8e'),'Global:\x20'+_0x16df9c+'\x20'+_0x3a95a0['name']+_0xc074('0xa4')+util['inspect'](_0x56559a,{'showHidden':![],'depth':null})+_0xc074('0xb6')+_0x18144c);}if(_0x17b091!==null){logger[_0xc074('0xb2')](_0xc074('0xb7'),_0x17b091);_0x17b091[_0xc074('0xb8')]=_0x16df9c;throw _0x17b091;}})[_0xc074('0x9e')](function(_0x55471a){logger['error'](_0xc074('0xb9'),_0x55471a);throw msgResponse(_0xc074('0x7f'),_0xc074('0x80'),util[_0xc074('0x61')](_0x55471a,{'showHidden':![],'depth':null}));});};Dialer[_0xc074('0x87')][_0xc074('0x2b')]=function(_0x1ffb1c){if(this[_0xc074('0x1d')][_0x1ffb1c[_0xc074('0xba')]]){if(this[_0xc074('0x25')][_0x1ffb1c[_0xc074('0xbb')]]&&this[_0xc074('0x25')][_0x1ffb1c[_0xc074('0xbb')]][_0xc074('0xbc')]!==_0xc074('0xbd')){this[_0xc074('0xbe')](this['voiceQueues'][_0x1ffb1c[_0xc074('0xba')]]);this[_0xc074('0x25')][_0x1ffb1c[_0xc074('0xbb')]][_0xc074('0xbf')]=moment()[_0xc074('0x78')](_0xc074('0xc0'));}}};Dialer[_0xc074('0x87')][_0xc074('0x2f')]=function(_0x5111db){var _0x56e0a2=this[_0xc074('0x25')][_0x5111db[_0xc074('0xbb')]];if(this[_0xc074('0x1d')][_0x5111db[_0xc074('0xba')]]){if(_0x56e0a2&&_0x56e0a2[_0xc074('0xbc')]!==_0xc074('0xbd')){delete this[_0xc074('0x25')][_0x5111db['uniqueid']];this[_0xc074('0x1d')][_0x5111db['queue']][_0xc074('0xc1')]+=0x1;var _0x569f3f=new AgentComplete(_0x56e0a2,_0x5111db);if(_0x5111db['reason']===_0xc074('0xc2')){_0x569f3f[_0xc074('0xc3')]=this[_0xc074('0x1d')][_0x5111db[_0xc074('0xba')]]['dialQueueProject2']&&this[_0xc074('0x1d')][_0x5111db[_0xc074('0xba')]][_0xc074('0xc4')]?moment()[_0xc074('0x78')](_0xc074('0xc0')):undefined;}hopperUtils['createHistory'](_0x569f3f)[_0xc074('0x9e')](loggerCatch(_0xc074('0xc5')));hopperUtils[_0xc074('0xc6')](_0x569f3f)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xc074('0x87')][_0xc074('0x2d')]=function(_0x2c0f6b){var _0x3e90d7=this[_0xc074('0x25')][_0x2c0f6b[_0xc074('0xbb')]];var _0x330536=this;var _0x192056=![];var _0x308a73;var _0x4dd727;if(this[_0xc074('0x1d')][_0x2c0f6b['queue']]){if(_0x3e90d7&&_0x3e90d7[_0xc074('0xbc')]!==_0xc074('0xbd')){delete this[_0xc074('0x25')][_0x2c0f6b[_0xc074('0xbb')]];this[_0xc074('0xbe')](this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]]);_0x3e90d7[_0xc074('0xc7')]=moment()['format'](_0xc074('0xc0'));var _0x1ae168=new QueueCallerAbandon(_0x3e90d7,_0x2c0f6b);if(utils[_0xc074('0x59')](_0x3e90d7[_0xc074('0xc7')],_0x3e90d7['responsetime'])>=_0x3e90d7[_0xc074('0xc8')]){this['voiceQueues'][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0x4a')]+=0x1;this[_0xc074('0x1d')][_0x2c0f6b['queue']][_0xc074('0xc9')]+=0x1;this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1ae168[_0xc074('0x69')]=0xa;_0x1ae168[_0xc074('0x6a')]='Drop';_0x1ae168[_0xc074('0xca')]='TIMEOUT';_0x1ae168['agiafterat']=this['voiceQueues'][_0x2c0f6b[_0xc074('0xba')]]['dialQueueProject2']?moment()[_0xc074('0x78')](_0xc074('0xc0')):undefined;_0x1ae168['countdropretry']+=0x1;_0x1ae168['countglobal']+=0x1;_0x308a73=this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]]['dialDropRetryFrequency'];_0x4dd727=this['voiceQueues'][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0xcb')];hopperUtils['verifyAdditionalPhones'](_0x1ae168,_0x1ae168[_0xc074('0x69')],_0x3e90d7['voiceQueue'])[_0xc074('0x99')](function(_0x7addf9){_0x192056=_0x7addf9['additional']==0x1;if(_0x1ae168[_0xc074('0xcc')]>=_0x330536['voiceQueues'][_0x2c0f6b[_0xc074('0xba')]]['dialDropMaxRetry']){_0x330536[_0xc074('0xcd')](_0x1ae168,_0x7addf9['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1ae168[_0xc074('0xcc')],'scheduledat':moment()[_0xc074('0xce')](_0x330536['voiceQueues'][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0xcf')],'minutes')[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x3e90d7[_0xc074('0xd0')],'ListId':_0x3e90d7[_0xc074('0xd1')],'VoiceQueueId':_0x3e90d7[_0xc074('0xd2')]||undefined,'CampaignId':_0x3e90d7[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch('[rescheduleContact][Drop]'));var _0x19f3a9=new History(_0x1ae168);_0x19f3a9['state']=0xa;_0x19f3a9[_0xc074('0x6a')]=_0xc074('0xd4');_0x19f3a9[_0xc074('0x6b')]=moment()['format'](_0xc074('0xc0'));_0x19f3a9[_0xc074('0xd5')]=_0x19f3a9[_0xc074('0x6b')];_0x19f3a9[_0xc074('0xd6')]=_0x1ae168[_0xc074('0xd6')];_0x19f3a9['calleridnum']=_0x1ae168[_0xc074('0xd7')];hopperUtils[_0xc074('0xd8')](_0x19f3a9)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc074('0x99')](function(){if(_0x192056)hopperUtils[_0xc074('0xd9')](_0x1ae168,_0x308a73,_0x4dd727)[_0xc074('0x99')](function(){return 0x1;});});}else{this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0x4c')]+=0x1;this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0xda')]+=0x1;_0x1ae168[_0xc074('0x69')]=0xb;_0x1ae168['statedesc']=_0xc074('0xdb');_0x1ae168[_0xc074('0xca')]='CALLEREXIT';_0x1ae168[_0xc074('0xdc')]+=0x1;_0x1ae168[_0xc074('0xdd')]+=0x1;_0x308a73=this['voiceQueues'][_0x2c0f6b['queue']]['dialAbandonedRetryFrequency'];_0x4dd727=this[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xc074('0xde')](_0x1ae168,_0x1ae168[_0xc074('0x69')],_0x3e90d7[_0xc074('0xdf')])[_0xc074('0x99')](function(_0x3d0a69){if(_0x1ae168[_0xc074('0xdc')]>=_0x330536[_0xc074('0x1d')][_0x2c0f6b[_0xc074('0xba')]][_0xc074('0xe0')]){_0x330536[_0xc074('0xcd')](_0x1ae168,_0x3d0a69[_0xc074('0xe1')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1ae168[_0xc074('0xdc')],'scheduledat':moment()[_0xc074('0xce')](_0x330536[_0xc074('0x1d')][_0x2c0f6b['queue']][_0xc074('0xe2')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x3e90d7[_0xc074('0xd0')],'ListId':_0x3e90d7[_0xc074('0xd1')],'VoiceQueueId':_0x3e90d7['VoiceQueueId']||undefined,'CampaignId':_0x3e90d7['CampaignId']||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0xe4')));var _0x20b337=new History(_0x1ae168);_0x20b337[_0xc074('0x69')]=0xb;_0x20b337[_0xc074('0x6a')]=_0xc074('0xdb');_0x20b337['starttime']=moment()[_0xc074('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x20b337[_0xc074('0xd5')]=_0x20b337[_0xc074('0x6b')];_0x20b337['calleridname']=_0x1ae168['calleridname'];_0x20b337[_0xc074('0xd7')]=_0x1ae168[_0xc074('0xd7')];hopperUtils[_0xc074('0xd8')](_0x20b337)['catch'](loggerCatch(_0xc074('0xe5')));}})[_0xc074('0x99')](function(){if(_0x192056)hopperUtils['swapAdditionalPhones'](_0x1ae168,_0x308a73,_0x4dd727)['then'](function(){return 0x1;});});}}}};Dialer[_0xc074('0x87')][_0xc074('0x34')]=function(_0x43f68d){if(this['actions'][_0x43f68d[_0xc074('0xbb')]]){this[_0xc074('0x23')][_0x43f68d['uniqueid']][_0xc074('0xe6')]=_0x43f68d[_0xc074('0xe6')];}if(this['uniqueId'][_0x43f68d['uniqueid']]){this[_0xc074('0x25')][_0x43f68d[_0xc074('0xbb')]][_0xc074('0xe6')]=_0x43f68d[_0xc074('0xe6')];}};Dialer['prototype']['syncQueueMember']=function(_0x3c3f58){if(!this['actions'][_0x3c3f58[_0xc074('0xe7')]]){return;}var _0x21ed75=this[_0xc074('0x1d')][this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]]['queue']]['strategy']||'rrmemory';if(_0x21ed75===_0xc074('0xe8')){if(this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]]&&_[_0xc074('0xe9')](this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]][_0xc074('0xea')])&&_0x3c3f58[_0xc074('0x83')]==='1'&&_0x3c3f58[_0xc074('0xeb')]==='0'){if(this[_0xc074('0x1f')][_0x3c3f58['stateinterface']]){if(!this[_0xc074('0x1f')][_0x3c3f58[_0xc074('0xec')]][_0xc074('0xea')]){this[_0xc074('0x1f')][_0x3c3f58[_0xc074('0xec')]][_0xc074('0xea')]=!![];this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]][_0xc074('0xea')]=!![];this[_0xc074('0x23')][_0x3c3f58['actionid']][_0xc074('0xec')]=_0x3c3f58[_0xc074('0xec')];}}}}else if(_0x21ed75===_0xc074('0xed')){if(this[_0xc074('0x23')][_0x3c3f58['actionid']]){if(this[_0xc074('0x1f')][_0x3c3f58[_0xc074('0xec')]]){this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]]['stateinterface']=_0x3c3f58['stateinterface'];if(_[_0xc074('0xe9')](this[_0xc074('0xee')][this['actions'][_0x3c3f58['actionid']][_0xc074('0xba')]])){this[_0xc074('0xee')][this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]][_0xc074('0xba')]]=[];}this['queueBooked'][this['actions'][_0x3c3f58[_0xc074('0xe7')]][_0xc074('0xba')]][_0xc074('0x96')](_[_0xc074('0x58')](_[_0xc074('0x70')](this[_0xc074('0x23')][_0x3c3f58[_0xc074('0xe7')]],[_0xc074('0xef'),'stateinterface']),{'status':_0x3c3f58[_0xc074('0x83')],'paused':_0x3c3f58[_0xc074('0xeb')]}));}}}};Dialer[_0xc074('0x87')][_0xc074('0x37')]=function(_0x591c60){if(!this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]]){return;}var _0x375256=this;var _0x31a62e=this['voiceQueues'][this[_0xc074('0x23')][_0x591c60['actionid']][_0xc074('0xba')]];var _0x1e3e1a=_0x31a62e['strategy']||'rrmemory';if(_0x1e3e1a===_0xc074('0xe8')){if(this['actions'][_0x591c60['actionid']]&&this['actions'][_0x591c60[_0xc074('0xe7')]][_0xc074('0xec')]){this[_0xc074('0xf0')][_0xc074('0xf1')](this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]][_0xc074('0xef')],this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]]['stateinterface'])[_0xc074('0x9e')](function(_0x7dd0c0){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xc074('0x61')](_0x7dd0c0,{'showHidden':![],'depth':null}));})[_0xc074('0x1b')](function(){_0x375256[_0xc074('0xbe')](_0x375256['voiceQueues'][_0x375256[_0xc074('0x23')][_0x591c60['actionid']][_0xc074('0xba')]]);_0x375256[_0xc074('0x1f')][_0x375256[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]][_0xc074('0xec')]][_0xc074('0xea')]=![];delete _0x375256['actions'][_0x591c60[_0xc074('0xe7')]];unlockQueueStatus(_0x31a62e);});}else{this[_0xc074('0xbe')](this[_0xc074('0x1d')][this['actions'][_0x591c60[_0xc074('0xe7')]]['queue']]);hopperUtils[_0xc074('0xf2')]({'active':![],'ContactId':this['actions'][_0x591c60[_0xc074('0xe7')]][_0xc074('0xd0')],'ListId':this['actions'][_0x591c60[_0xc074('0xe7')]][_0xc074('0xd1')],'VoiceQueueId':this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]][_0xc074('0xd3')]||undefined})['catch'](loggerCatch(_0xc074('0xf3')));delete this['actions'][_0x591c60[_0xc074('0xe7')]];unlockQueueStatus(_0x31a62e);}}else if(_0x1e3e1a===_0xc074('0xed')){var _0x4a3a8a;if(this['actions'][_0x591c60[_0xc074('0xe7')]]&&!_[_0xc074('0x43')](this[_0xc074('0xee')][this['actions'][_0x591c60[_0xc074('0xe7')]][_0xc074('0xba')]])){if(this[_0xc074('0x29')][_0x375256[_0xc074('0x23')][_0x591c60['actionid']][_0xc074('0xba')]]){this[_0xc074('0x29')][_0x375256[_0xc074('0x23')][_0x591c60['actionid']][_0xc074('0xba')]]=this[_0xc074('0x29')][this['actions'][_0x591c60[_0xc074('0xe7')]][_0xc074('0xba')]]?this[_0xc074('0x29')][this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]][_0xc074('0xba')]]:this['queueBooked'][this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]]['queue']]?this[_0xc074('0xee')][this[_0xc074('0x23')][_0x591c60[_0xc074('0xe7')]][_0xc074('0xba')]][_0xc074('0xf4')]||0x0:0x0;}this['queueBooked'][this[_0xc074('0x23')][_0x591c60['actionid']][_0xc074('0xba')]][_0xc074('0xf4')]=this['queueBookedRR'][this['actions'][_0x591c60['actionid']][_0xc074('0xba')]];for(var _0x416bdc=0x0;_0x416bdc=_0x2fdcf8[_0xc074('0x11a')]){_0x545986['stateGlobal'](_0x16a7ee,_0x5ebca2,_0x2d6c05,_0xc074('0x11b'));}else{if(_0x16a7ee[_0xc074('0x114')]>=_0x2fdcf8['dialMachineMaxRetry']){_0x545986[_0xc074('0x11c')](_0x16a7ee,_0x5ebca2,_0x2d6c05,_0xc074('0x11d'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x16a7ee['countmachineretry'],'scheduledat':moment()[_0xc074('0xce')](_0x2fdcf8[_0xc074('0x11e')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x16a7ee[_0xc074('0xd0')],'ListId':_0x16a7ee[_0xc074('0xd1')],'VoiceQueueId':_0x16a7ee[_0xc074('0xd2')]||undefined,'CampaignId':_0x16a7ee[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0x5ebca2({'reschedule':0x1});}}});}if(_0x311b4a[_0xc074('0xbc')]==='ivr'&&this[_0xc074('0x1e')][_0x311b4a[_0xc074('0xba')]][_0xc074('0x109')]&&_0x59e46a[_0xc074('0x10a')]===_0xc074('0x11f')){delete this[_0xc074('0x25')][_0x59e46a[_0xc074('0xbb')]];this[_0xc074('0xbe')](this[_0xc074('0x1e')][_0x311b4a[_0xc074('0xba')]]);_0x7b7f05=new Hangup(_0x311b4a,_0x59e46a);_0x7b7f05[_0xc074('0x69')]=0x12;_0x7b7f05[_0xc074('0x6a')]=_0xc074('0x10c');_0x7b7f05['membername']=_0xc074('0x10d');ami[_0xc074('0x3d')](_0xc074('0x115'),ut[_0xc074('0x10e')](_0x7b7f05,_0xc074('0x10f')));this[_0xc074('0x110')](_0x7b7f05,'[syncHangupInAMDIvr][createHistory]',_0xc074('0x120'));}if(_0x311b4a[_0xc074('0xbc')]===_0xc074('0xbd')&&this['campaigns'][_0x311b4a[_0xc074('0xba')]]['dialAMDActive']&&_0x59e46a['value']==='MACHINE'){return new Promise(function(_0x4f55dd,_0x2182f6){delete _0x545986[_0xc074('0x25')][_0x59e46a[_0xc074('0xbb')]];_0x545986[_0xc074('0xbe')](_0x545986[_0xc074('0x1e')][_0x311b4a[_0xc074('0xba')]]);_0x545986[_0xc074('0x1e')][_0x311b4a['queue']]['outboundAnswerCallsDay']+=0x1;_0x545986['campaigns'][_0x311b4a['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x43fcd5=_0x545986['campaigns'][_0x311b4a[_0xc074('0xba')]];var _0x1a4578=new Hangup(_0x311b4a,_0x59e46a);_0x1a4578['state']=0x13;_0x1a4578[_0xc074('0x6a')]=_0xc074('0x113');_0x1a4578['membername']=_0xc074('0x10d');_0x1a4578[_0xc074('0x114')]+=0x1;_0x1a4578[_0xc074('0xdd')]+=0x1;_0x1a4578[_0xc074('0x10f')]=!![];ami['emit'](_0xc074('0x115'),ut[_0xc074('0x10e')](_0x1a4578,'amd'));hopperUtils[_0xc074('0xd8')](_0x1a4578)[_0xc074('0x9e')](loggerCatch(_0xc074('0x121')));if(_0x1a4578[_0xc074('0x116')]+_0x1a4578['countcongestionretry']+_0x1a4578['countnoanswerretry']+_0x1a4578['countnosuchnumberretry']+_0x1a4578['countdropretry']+_0x1a4578[_0xc074('0xdc')]+_0x1a4578['countmachineretry']+_0x1a4578[_0xc074('0x119')]>=_0x43fcd5[_0xc074('0x11a')]){_0x545986[_0xc074('0x122')](_0x1a4578,_0x4f55dd,_0x2182f6,_0xc074('0x11b'));}else{if(_0x1a4578['countmachineretry']>=_0x43fcd5[_0xc074('0x123')]){_0x545986[_0xc074('0x11c')](_0x1a4578,_0x4f55dd,_0x2182f6,'reason\x2019\x20machine....');}else{hopperUtils[_0xc074('0xf2')]({'active':![],'countmachineretry':_0x1a4578[_0xc074('0x114')],'scheduledat':moment()[_0xc074('0xce')](_0x43fcd5[_0xc074('0x11e')],'minutes')[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x1a4578['ContactId'],'ListId':_0x1a4578['ListId'],'VoiceQueueId':_0x1a4578[_0xc074('0xd2')]||undefined,'CampaignId':_0x1a4578['CampaignId']||undefined})[_0xc074('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0x4f55dd({'reschedule':0x1});}}});}}};Dialer[_0xc074('0x87')][_0xc074('0x32')]=function(_0x218615){var _0x444a79=this['uniqueId'][_0x218615[_0xc074('0xbb')]];var _0x486768;if(_0x444a79&&_0x444a79['type']===_0xc074('0xbd')){delete this['uniqueId'][_0x218615[_0xc074('0xbb')]];this[_0xc074('0xbe')](this[_0xc074('0x1e')][_0x444a79[_0xc074('0xba')]]);this[_0xc074('0x1e')][_0x444a79['queue']]['ivrAnswerCallsDay']+=0x1;_0x486768=new Hangup(_0x444a79,_0x218615);hopperUtils[_0xc074('0xd8')](_0x486768)[_0xc074('0x9e')](loggerCatch(_0xc074('0x124')));hopperUtils['moveContactManagedDialer'](_0x486768)['catch'](loggerCatch(_0xc074('0x125')));}if(_0x444a79&&_0x444a79['type']!=='ivr'&&isNotNull(this[_0xc074('0x1d')][_0x444a79['queue']][_0xc074('0x126')])){delete this[_0xc074('0x25')][_0x218615[_0xc074('0xbb')]];this[_0xc074('0xbe')](this['voiceQueues'][_0x444a79[_0xc074('0xba')]]);this[_0xc074('0x1d')][_0x444a79[_0xc074('0xba')]][_0xc074('0xc1')]+=0x1;this[_0xc074('0x1d')][_0x444a79['queue']][_0xc074('0x10b')]+=0x1;_0x486768=new Hangup(_0x444a79,_0x218615);_0x486768[_0xc074('0x69')]=0x10;_0x486768[_0xc074('0x6a')]='AnswerAGI';_0x486768['membername']=_0xc074('0x127');hopperUtils['createHistory'](_0x486768)[_0xc074('0x9e')](loggerCatch(_0xc074('0x124')));hopperUtils[_0xc074('0xc6')](_0x486768)[_0xc074('0x9e')](loggerCatch(_0xc074('0x125')));}if(_0x444a79&&_0x444a79[_0xc074('0xbc')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x444a79[_0xc074('0xba')]][_0xc074('0x126')])){delete this[_0xc074('0x25')][_0x218615[_0xc074('0xbb')]];this[_0xc074('0xbe')](this[_0xc074('0x1d')][_0x444a79[_0xc074('0xba')]]);this[_0xc074('0x1d')][_0x444a79[_0xc074('0xba')]]['outboundUnknownCallsDay']+=0x1;_0x486768=new Hangup(_0x444a79,_0x218615);_0x486768[_0xc074('0x69')]=0xc;_0x486768['statedesc']=_0x218615[_0xc074('0x128')];_0x486768['membername']=_0xc074('0x129');hopperUtils[_0xc074('0xd8')](_0x486768)['catch'](loggerCatch(_0xc074('0x124')));hopperUtils[_0xc074('0xc6')](_0x486768)[_0xc074('0x9e')](loggerCatch(_0xc074('0x125')));}};Dialer[_0xc074('0x87')]['syncQueueSummary']=function(_0x23a1c2){var _0xcec23a=this;if(!_0xcec23a['queuesSummary'][_0x23a1c2['name']]){_0xcec23a[_0xc074('0x12a')][_0x23a1c2[_0xc074('0x5a')]]={'running':![]};}else if(_0xcec23a[_0xc074('0x12a')][_0x23a1c2[_0xc074('0x5a')]][_0xc074('0x12b')]===!![]){return;}else if(_0xcec23a[_0xc074('0x12a')][_0x23a1c2[_0xc074('0x5a')]][_0xc074('0x12b')]===![]){_0xcec23a['queuesSummary'][_0x23a1c2['name']]['running']=!![];}var _0x472198=_0xcec23a[_0xc074('0x1d')][_0x23a1c2[_0xc074('0x5a')]];var _0x9697b7=_0x472198[_0xc074('0x63')]!==utils[_0xc074('0x64')][_0xc074('0x75')];var _0x59a2d9=utils[_0xc074('0x12c')](_0x472198);_0x472198[_0xc074('0x12d')]=utils[_0xc074('0x12e')](_0x472198,_0xcec23a[_0xc074('0x20')]);Promise[_0xc074('0xa8')]()['then'](function(){if(_0x472198[_0xc074('0x12d')]===utils[_0xc074('0x64')][_0xc074('0x75')]){if(_0x9697b7){clearPredictiveAttributes(_0x472198);_0x23a1c2[_0xc074('0x27')]=undefined;_0x23a1c2[_0xc074('0x28')]=undefined;}if(_0x472198[_0xc074('0x12d')]===utils[_0xc074('0x64')][_0xc074('0x75')]){_0x23a1c2[_0xc074('0x12f')]=0x0;_0x23a1c2[_0xc074('0xeb')]=0x0;_0x23a1c2[_0xc074('0x130')]=0x0;_0x23a1c2[_0xc074('0x131')]=0x0;_0x23a1c2['pTalking']=0x0;}}else if(_0x472198['statusMessage']===utils[_0xc074('0x64')][_0xc074('0x132')]&&!_0x59a2d9){return _0xcec23a[_0xc074('0x8d')](_0x472198,!![])['then'](function(){return _0xcec23a[_0xc074('0x8d')](_0x472198,![]);})[_0xc074('0x99')](function(){return _0xcec23a['checkDialMethod'](_0x472198);})[_0xc074('0x9e')](function(_0x2cb698){loggerSyncQueueSummary[_0xc074('0x3f')](_0xc074('0x133'),util['inspect'](_0x2cb698,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x472198);});}else{clearPredictiveAttributes(_0x472198);}})[_0xc074('0x99')](function(){var _0x9e5c7b=_0x23a1c2[_0xc074('0x134')](_0x472198);if(_0x9e5c7b||_0x472198[_0xc074('0x135')]){_0x472198[_0xc074('0x135')]=![];_0x23a1c2[_0xc074('0x136')](_0x472198);Object[_0xc074('0x137')](_0x472198,_0x23a1c2);emitOutboundVoiceQueueSummary(_0x23a1c2);}_0xcec23a[_0xc074('0x12a')][_0x472198['name']][_0xc074('0x12b')]=![];})[_0xc074('0x9e')](function(_0x260eac){logger[_0xc074('0x5e')](_0xc074('0x133'),util[_0xc074('0x61')](_0x260eac,{'showHidden':![],'depth':null}));_0xcec23a[_0xc074('0x12a')][_0x472198[_0xc074('0x5a')]][_0xc074('0x12b')]=![];});};Dialer[_0xc074('0x87')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x3e6794=_['filter'](this[_0xc074('0x1d')],function(_0x395c23){return _0x395c23[_0xc074('0x138')];});var _0x5f436=_[_0xc074('0x139')](this[_0xc074('0x1f')],function(_0x87e589){return _0x87e589[_0xc074('0x13a')]&&_0x87e589[_0xc074('0x83')]===_0xc074('0x84');});if(_0x3e6794[_0xc074('0x95')]>0x0&&_0x5f436[_0xc074('0x95')]>0x0){return Promise['resolve']()[_0xc074('0x99')](cmHopper[_0xc074('0x13b')](_[_0xc074('0x13c')](_0x3e6794,'id'),previewRecallmeReminderInterval,_['map'](_0x5f436,'id')))[_0xc074('0x99')](function(_0x538803){for(var _0x57f04a=0x0;_0x57f04a<_0x538803[_0xc074('0x95')];_0x57f04a++){var _0x120a92=_0x538803[_0x57f04a][_0xc074('0x13d')]['name'];if(_0x120a92)io['to'](util[_0xc074('0x78')]('user:%s',_0x120a92))[_0xc074('0x3d')]('user:dialPreviewRecallReminder',{'hopper':_0x538803[_0x57f04a]});}})[_0xc074('0x9e')](function(_0x15bdcb){logger[_0xc074('0x5e')](_0xc074('0x13e'),_0x15bdcb);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xc074('0x87')][_0xc074('0x39')]=function(){var _0x268c76=this;setInterval(function(){_0x268c76[_0xc074('0x13f')](_0x268c76[_0xc074('0x25')],'[uniqueid]');_0x268c76['clearZombieChannels'](_0x268c76[_0xc074('0x23')],'[actions]');},0x32c8);};Dialer['prototype'][_0xc074('0x13f')]=function(_0x3264f3,_0x4dbbad){var _0x397452=this;for(var _0x32c4a6 in _0x3264f3){if(typeof _0x3264f3[_0x32c4a6]!==_0xc074('0xa6')){this['sequence'][_0xc074('0x19')](function(){if(!_[_0xc074('0xe9')](_0x3264f3[_0x32c4a6])){return ami['Action']({'action':_0xc074('0x83'),'channel':_0x3264f3[_0x32c4a6]['channel']})[_0xc074('0x9e')](function(_0x11bbd7){if(_0x11bbd7[_0xc074('0x63')]===_0xc074('0x140')){setTimeout(function(){if(_0x3264f3[_0x32c4a6]&&_0x3264f3[_0x32c4a6]['type']!==_0xc074('0xbd')){_0x397452[_0xc074('0xbe')](_0x397452[_0xc074('0x1d')][_0x3264f3[_0x32c4a6]['queue']]);logger[_0xc074('0x5e')](_0xc074('0x141'),_0x4dbbad,_0x32c4a6,_0x3264f3[_0x32c4a6]['queue']);delete _0x3264f3[_0x32c4a6];}if(_0x3264f3[_0x32c4a6]&&_0x3264f3[_0x32c4a6][_0xc074('0xbc')]==='ivr'){_0x397452[_0xc074('0xbe')](_0x397452['campaigns'][_0x3264f3[_0x32c4a6][_0xc074('0xba')]]);logger[_0xc074('0x5e')]('[Dialer][checkChannel][ivr]',_0x4dbbad,_0x32c4a6,_0x3264f3[_0x32c4a6][_0xc074('0xba')]);delete _0x3264f3[_0x32c4a6];}},0x2328);}});}});}}};Dialer['prototype'][_0xc074('0x142')]=function(_0x2b5881){return Promise[_0xc074('0xa8')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x2b5881))['catch'](loggerCatch(_0xc074('0x143')));};Dialer[_0xc074('0x87')]['updateOriginated']=function(_0x3d09b7){if(!_['isUndefined'](_0x3d09b7)&&_0x3d09b7!==null){if(typeof _0x3d09b7[_0xc074('0x7b')]!==_0xc074('0xa6')){if(_0x3d09b7[_0xc074('0x7b')]>0x0){_0x3d09b7[_0xc074('0x7b')]-=0x1;}else{logger['error'](_0xc074('0x144'));}}}else{logger[_0xc074('0x5e')](_0xc074('0x145'));}};Dialer[_0xc074('0x87')][_0xc074('0x146')]=function(_0xd81664,_0x18c726){var _0x35ecfe=this;return function(_0x5bab47){_0x35ecfe[_0xc074('0xbe')](_0x18c726);logger['error'](_0xd81664,util[_0xc074('0x61')](_0x5bab47,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x20ad3c,_0x48a989,_0x59a3c4){var _0xc131e={'state':0x19,'statedesc':_0xc074('0x147')};this[_0xc074('0xbe')](_0x48a989);this['saveInDb'](_[_0xc074('0x58')](_0xc131e,_[_0xc074('0x70')](_0x59a3c4,['ContactId','ListId',_0xc074('0x148'),_0xc074('0xd2'),_0xc074('0xd3')])),_0xc074('0x149'),'[emptyContact]');logger[_0xc074('0x5e')](_0x20ad3c);};Dialer[_0xc074('0x87')][_0xc074('0x110')]=function(_0xb736c8,_0x14dd67,_0x33888a){hopperUtils[_0xc074('0xd8')](_0xb736c8)[_0xc074('0x9e')](loggerCatch(_0x14dd67));hopperUtils[_0xc074('0xc6')](_0xb736c8)[_0xc074('0x9e')](loggerCatch(_0x33888a));};Dialer[_0xc074('0x87')]['queueCallerAbandonCreateState']=function(_0x38a589,_0xa0b9e4){hopperUtils['createHistory'](_0x38a589)[_0xc074('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0xa0b9e4==0x0){hopperUtils[_0xc074('0xc6')](_0x38a589)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xc074('0x87')][_0xc074('0x13e')]=function(_0x43cf3b){return Promise[_0xc074('0xa8')]()[_0xc074('0x99')](cmHopper[_0xc074('0x13b')](_0x43cf3b['id'],previewRecallmeReminderInterval))['then'](function(_0x388e2c){for(var _0x46787e=0x0;_0x46787e<_0x388e2c[_0xc074('0x95')];_0x46787e++){var _0x1a2238=_0x388e2c[_0x46787e][_0xc074('0x13d')][_0xc074('0x5a')];if(_0x1a2238)io['to'](util[_0xc074('0x78')]('user:%s',_0x1a2238))[_0xc074('0x3d')](_0xc074('0x14a'),{'hopper':_0x388e2c[_0x46787e]});}})[_0xc074('0x9e')](function(){});};Dialer['prototype'][_0xc074('0x14b')]=function(_0x1a2a2c){var _0x18f094=this;return function(){_0x18f094[_0xc074('0x14c')](_0x1a2a2c);};};Dialer[_0xc074('0x87')][_0xc074('0x14d')]=function(_0x4f92cc,_0x5e75b6){var _0x3e3ee6=this;var _0x6e462f=uuid['v4']();this[_0xc074('0x23')][_0x6e462f]=new Action(_0x4f92cc,_0x5e75b6,_0x6e462f);return new Promise(function(_0x235be3,_0x56dbc7){if(_[_0xc074('0x3c')](_0x4f92cc)&&typeof _0x4f92cc!==_0xc074('0x14e')){return _0x56dbc7(msgResponse('originate',_0xc074('0x8e'),_0xc074('0x14f')));}if(_[_0xc074('0x3c')](_0x5e75b6['phone'])||_0x5e75b6[_0xc074('0x150')]===null){return _0x56dbc7(msgResponse(_0xc074('0x151'),_0xc074('0x8e'),_0xc074('0x152')));}var _0x77c91={'XMD-CALLERID':_0x3e3ee6['actions'][_0x6e462f][_0xc074('0x153')](),'XMD-AGI':_0x4f92cc[_0xc074('0x126')]?util['format'](_0xc074('0x154'),ipAgi,_0x4f92cc[_0xc074('0x126')]):_0xc074('0x155'),'XMD-AGIAFTER':_0x4f92cc[_0xc074('0x156')]?util['format'](_0xc074('0x154'),ipAgi,_0x4f92cc['dialQueueProject2']):_0xc074('0x155'),'XMD-QUEUE':utils[_0xc074('0x157')](_0x4f92cc)?util[_0xc074('0x78')]('\x22%s,%s%s,,,%s\x22',_0x4f92cc['name'],_0x4f92cc[_0xc074('0x158')]||'',_0x4f92cc[_0xc074('0xc4')]?'c':'',_0x4f92cc[_0xc074('0xc8')]||0x3):_0xc074('0x155'),'XMD-CONTACTID':_0x5e75b6['ContactId'],'XMD-CDRTYPE':_0xc074('0x159'),'CALLERID(all)':_0x3e3ee6[_0xc074('0x23')][_0x6e462f][_0xc074('0x153')](),'XMD-AMD':_0x4f92cc[_0xc074('0x109')]?'ACTIVE':_0xc074('0x155'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4f92cc[_0xc074('0x109')]){_0x77c91[_0xc074('0x15a')]=_0x4f92cc[_0xc074('0x15b')]||0x9c4;_0x77c91['XMD-AMDGREETING']=_0x4f92cc[_0xc074('0x15c')]||0x5dc;_0x77c91['XMD-AMDAFTERGREETINGSILENCE']=_0x4f92cc[_0xc074('0x15d')]||0x320;_0x77c91[_0xc074('0x15e')]=_0x4f92cc[_0xc074('0x15f')]||0x1388;_0x77c91[_0xc074('0x160')]=_0x4f92cc[_0xc074('0x161')]||0x64;_0x77c91['XMD-AMDBETWEENWORDSSILENCE']=_0x4f92cc[_0xc074('0x162')]||0x32;_0x77c91[_0xc074('0x163')]=_0x4f92cc[_0xc074('0x164')]||0x3;_0x77c91[_0xc074('0x165')]=_0x4f92cc[_0xc074('0x166')]||0x100;_0x77c91[_0xc074('0x167')]=_0x4f92cc[_0xc074('0x168')]||0x1388;}if(utils[_0xc074('0x157')](_0x4f92cc)){_0x77c91[_0xc074('0x169')]=_0x5e75b6[_0xc074('0xd2')];}else{_0x77c91['XMD-CAMPAIGNID']=_0x5e75b6[_0xc074('0xd3')];}var _0x304cbb=utils[_0xc074('0x16a')](_0x5e75b6[_0xc074('0x16b')]);Object[_0xc074('0x137')](_0x77c91,_0x304cbb);var _0x29d093=_0x3e3ee6[_0xc074('0x81')](_0x4f92cc['Trunk'])?utils[_0xc074('0x16c')](_0x4f92cc[_0xc074('0x16d')][_0xc074('0x16e')],_0x4f92cc[_0xc074('0x16f')],_0x4f92cc[_0xc074('0x170')]>0x0?utils['getCallerIdRandom'](_0x4f92cc[_0xc074('0x171')],_0x4f92cc[_0xc074('0x170')]):_0x4f92cc['dialOriginateCallerIdNumber']):utils[_0xc074('0x16c')](_[_0xc074('0xe9')](_0x4f92cc['TrunkBackup'])?_0x4f92cc[_0xc074('0x16d')][_0xc074('0x16e')]:_0x4f92cc[_0xc074('0x89')][_0xc074('0x16e')],_0x4f92cc[_0xc074('0x16f')],_0x4f92cc[_0xc074('0x170')]>0x0?utils[_0xc074('0x172')](_0x4f92cc[_0xc074('0x171')],_0x4f92cc[_0xc074('0x170')]):_0x4f92cc[_0xc074('0x171')]);if(_0x29d093){_0x77c91['XMD-ORIGINATECALLERIDNAME']=_0x3e3ee6[_0xc074('0x23')][_0x6e462f][_0xc074('0x173')]=utils[_0xc074('0x174')](_0x29d093);_0x77c91[_0xc074('0x175')]=_0x5e75b6[_0xc074('0x150')];}_0x4f92cc[_0xc074('0x176')]=_0x77c91;return ami[_0xc074('0x97')]({'actionid':_0x6e462f,'action':'originate','channel':_0x3e3ee6[_0xc074('0x81')](_0x4f92cc[_0xc074('0x16d')])?util[_0xc074('0x78')](_0xc074('0x177'),_0x4f92cc[_0xc074('0x16d')][_0xc074('0x5a')],isNotNull(_0x4f92cc[_0xc074('0x178')])?_0x4f92cc['dialPrefix'][_0xc074('0x179')]()||'':'',_0x4f92cc[_0xc074('0x17a')]>0x0?_0x5e75b6['phone']['substring'](_0x4f92cc[_0xc074('0x17a')]):_0x5e75b6[_0xc074('0x150')]):util[_0xc074('0x78')]('SIP/%s/%s%s',_[_0xc074('0xe9')](_0x4f92cc[_0xc074('0x89')])?_0x4f92cc['Trunk'][_0xc074('0x5a')]:_0x4f92cc['TrunkBackup']['name'],isNotNull(_0x4f92cc[_0xc074('0x178')])?_0x4f92cc[_0xc074('0x178')][_0xc074('0x179')]()||'':'',_0x4f92cc[_0xc074('0x17a')]>0x0?_0x5e75b6[_0xc074('0x150')]['substring'](_0x4f92cc[_0xc074('0x17a')]):_0x5e75b6['phone']),'callerid':_0x29d093,'Exten':_0xc074('0x108'),'Context':_0xc074('0x17b'),'Priority':'1','variable':_0x77c91,'timeout':(_0x4f92cc[_0xc074('0x17c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x6e462f})['then'](function(_0x3e956f){return _0x235be3(_0x3e956f);})[_0xc074('0x9e')](function(_0x29a35c){_0x4f92cc[_0xc074('0x17d')]+=0x1;var _0x339ffa=new History(_0x3e3ee6[_0xc074('0x23')][_0x6e462f]);logger['error'](util[_0xc074('0x78')](_0xc074('0x17e'),JSON[_0xc074('0x6f')](_0x29a35c)));_0x339ffa[_0xc074('0x69')]=0xe;_0x339ffa[_0xc074('0x6a')]=_0xc074('0x17f');_0x339ffa['starttime']=moment()[_0xc074('0x78')](_0xc074('0xc0'));_0x339ffa[_0xc074('0xd5')]=_0x339ffa[_0xc074('0x6b')];hopperUtils[_0xc074('0xd8')](_0x339ffa)[_0xc074('0x9e')](loggerCatch(_0xc074('0x180')));_0x3e3ee6['moveContactManagedDialer'](_0x339ffa)[_0xc074('0x9e')](loggerCatch('[originate][error]'))[_0xc074('0x1b')](function(){delete _0x3e3ee6[_0xc074('0x23')][_0x6e462f];return _0x56dbc7(msgResponse(_0xc074('0x151'),_0xc074('0x80'),_0xc074('0x181')));});});});};Dialer[_0xc074('0x87')][_0xc074('0x182')]=function(_0x11fe48,_0x255e2f,_0x498cbd){var _0x518149=new History(_0x255e2f);if(_0x518149[_0xc074('0x116')]+_0x518149[_0xc074('0x117')]+_0x518149['countnoanswerretry']+_0x518149[_0xc074('0x118')]+_0x518149[_0xc074('0xcc')]+_0x518149[_0xc074('0xdc')]+_0x518149[_0xc074('0x114')]+_0x518149['countagentrejectretry']>=_0x498cbd[_0xc074('0x11a')]-0x1){return!![];}switch(_0x11fe48){case 0x3:if(_0x518149[_0xc074('0x183')]>=_0x498cbd['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x518149[_0xc074('0x183')]+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd['dialNoAnswerRetryFrequency'],'minutes')[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149['VoiceQueueId']||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x184')));break;case 0x5:if(_0x518149[_0xc074('0x116')]>=_0x498cbd[_0xc074('0x185')]-0x1){return!![];}hopperUtils[_0xc074('0xf2')]({'active':![],'countbusyretry':_0x518149['countbusyretry']+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0x186')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149[_0xc074('0xd2')]||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x187')));break;case 0x8:if(_0x518149[_0xc074('0x117')]>=_0x498cbd['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xc074('0xf2')]({'active':![],'countcongestionretry':_0x518149['countcongestionretry']+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0x188')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149['ContactId'],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149[_0xc074('0xd2')]||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x518149[_0xc074('0x118')]>=_0x498cbd[_0xc074('0x189')]-0x1){return!![];}else{hopperUtils[_0xc074('0xf2')]({'active':![],'countnosuchnumberretry':_0x518149['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0x18a')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149['ListId'],'VoiceQueueId':_0x518149[_0xc074('0xd2')]||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x18b')));}break;case 0xa:if(_0x518149[_0xc074('0xcc')]>=_0x498cbd[_0xc074('0x18c')]-0x1){return!![];}hopperUtils[_0xc074('0xf2')]({'active':![],'countdropretry':_0x518149['countdropretry']+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0xcf')],_0xc074('0xe3'))[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149['ListId'],'VoiceQueueId':_0x518149['VoiceQueueId']||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x18d')));break;case 0xb:if(_0x518149[_0xc074('0xdc')]>=_0x498cbd[_0xc074('0xe0')]-0x1){return!![];}hopperUtils[_0xc074('0xf2')]({'active':![],'countabandonedretry':_0x518149[_0xc074('0xdc')]+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0xe2')],'minutes')['format'](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149['VoiceQueueId']||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})['catch'](loggerCatch(_0xc074('0xe4')));break;case 0x13:if(_0x518149['countmachineretry']>=_0x498cbd[_0xc074('0x123')]-0x1){return!![];}hopperUtils[_0xc074('0xf2')]({'active':![],'countmachineretry':_0x518149['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x498cbd['dialMachineRetryFrequency'],_0xc074('0xe3'))['format'](_0xc074('0xc0')),'ContactId':_0x518149['ContactId'],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149[_0xc074('0xd2')]||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x18e')));break;case 0x14:if(_0x518149[_0xc074('0x119')]>=_0x498cbd[_0xc074('0x18f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x518149[_0xc074('0x119')]+=0x1,'scheduledat':moment()[_0xc074('0xce')](_0x498cbd[_0xc074('0x190')],'minutes')[_0xc074('0x78')](_0xc074('0xc0')),'ContactId':_0x518149[_0xc074('0xd0')],'ListId':_0x518149[_0xc074('0xd1')],'VoiceQueueId':_0x518149[_0xc074('0xd2')]||undefined,'CampaignId':_0x518149[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xc074('0x87')][_0xc074('0x102')]=function(_0x50ad87,_0x3659cb,_0xde037f){var _0x1ad068=this;var _0x577343=new History(_0x50ad87);var _0x1e394f=![];var _0x2b176f;var _0x3aaf86;return new Promise(function(_0x334215,_0x2625e4){if(_[_0xc074('0x3c')](_0x3659cb)&&typeof _0x3659cb!=='object'){return _0x2625e4(msgResponse('[callProgressDetecting]',_0xc074('0x8e'),_0xc074('0x191')));}if(_[_0xc074('0x3c')](_0xde037f)&&typeof _0xde037f!==_0xc074('0x14e')){return _0x2625e4(msgResponse(_0xc074('0x192'),_0xc074('0x8e'),_0xc074('0x193')));}hopperUtils['verifyAdditionalPhones'](_0x577343,_0xde037f[_0xc074('0x194')],_0x3659cb)['then'](function(_0x1d3be5){if(_0x1d3be5[_0xc074('0xe1')]==0x1)_0x1e394f=!![];switch(_0xde037f[_0xc074('0x194')]){case'0':_0x3659cb[_0xc074('0x195')]+=0x1;_0x577343[_0xc074('0x69')]=0x0;_0x577343['statedesc']='NoSuchNumber';_0x577343[_0xc074('0x118')]+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;ami[_0xc074('0x3d')](_0xc074('0x196'),ut[_0xc074('0x10e')](_0x50ad87,'nosuchnumber'));_0x2b176f=_0x3659cb['dialNoSuchNumberRetryFrequency'];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];hopperUtils[_0xc074('0xd8')](_0x577343)[_0xc074('0x9e')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1ad068[_0xc074('0x182')](0x0,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0x118')]>=_0x3659cb['dialNoSuchNumberMaxRetry']){_0x1ad068['createStateFinal'](_0x577343,_0x334215,_0x2625e4,_0xc074('0x197'));}else{_0x1ad068[_0xc074('0x122')](_0x577343,_0x334215,_0x2625e4,_0xc074('0x197'));}}break;case'3':_0x3659cb[_0xc074('0x198')]+=0x1;_0x577343[_0xc074('0x69')]=0x3;_0x577343[_0xc074('0x6a')]='NoAnswer';_0x577343[_0xc074('0x183')]+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;var _0x2b9717=ut['buildNoAnswerEventPayload'](_0x50ad87,_0x3659cb);ami[_0xc074('0x3d')]('custom:agentnoanswer',_0x2b9717);_0x2b176f=_0x3659cb[_0xc074('0x199')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];hopperUtils['createHistory'](_0x577343)[_0xc074('0x9e')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1ad068[_0xc074('0x182')](0x3,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0x183')]>=_0x3659cb[_0xc074('0x19a')]){_0x1ad068['createStateFinal'](_0x577343,_0x334215,_0x2625e4,_0xc074('0x19b'));}else{_0x1ad068[_0xc074('0x122')](_0x577343,_0x334215,_0x2625e4,_0xc074('0x19b'));}}break;case'5':_0x3659cb[_0xc074('0x19c')]+=0x1;_0x577343[_0xc074('0x69')]=0x5;_0x577343[_0xc074('0x6a')]=_0xc074('0x19d');_0x577343[_0xc074('0x116')]+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;ami[_0xc074('0x3d')]('custom:agentbusy',ut['buildObj'](_0x50ad87,_0xc074('0x19e')));_0x2b176f=_0x3659cb[_0xc074('0x186')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];hopperUtils[_0xc074('0xd8')](_0x577343)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1ad068['checkRetriveMax'](0x5,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343['countbusyretry']>=_0x3659cb[_0xc074('0x185')]){_0x1ad068[_0xc074('0x11c')](_0x577343,_0x334215,_0x2625e4,_0xc074('0x19f'));}else{_0x1ad068[_0xc074('0x122')](_0x577343,_0x334215,_0x2625e4,_0xc074('0x19f'));}}break;case'8':_0x3659cb[_0xc074('0x1a0')]+=0x1;_0x577343[_0xc074('0x69')]=0x8;_0x577343[_0xc074('0x6a')]=_0xc074('0x1a1');_0x577343['countcongestionretry']+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;_0x2b176f=_0x3659cb[_0xc074('0x188')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];ami[_0xc074('0x3d')](_0xc074('0x1a2'),ut[_0xc074('0x10e')](_0x50ad87,'congestion'));hopperUtils['createHistory'](_0x577343)[_0xc074('0x9e')](loggerCatch(_0xc074('0x1a3')));if(_0x1ad068[_0xc074('0x182')](0x8,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0x117')]>=_0x3659cb[_0xc074('0x1a4')]){_0x1ad068[_0xc074('0x11c')](_0x577343,_0x334215,_0x2625e4,'reason\x208\x20congestion');}else{_0x1ad068['stateGlobal'](_0x577343,_0x334215,_0x2625e4,_0xc074('0x1a5'));}}break;case'11':_0x3659cb[_0xc074('0x1a6')]+=0x1;_0x577343[_0xc074('0x69')]=0xb;_0x577343[_0xc074('0x6a')]=_0xc074('0xdb');_0x577343[_0xc074('0xdc')]+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;_0x2b176f=_0x3659cb[_0xc074('0xe2')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];hopperUtils[_0xc074('0xd8')](_0x577343)[_0xc074('0x9e')](loggerCatch(_0xc074('0xe5')));if(_0x1ad068[_0xc074('0x182')](0xb,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0xdc')]>=_0x3659cb[_0xc074('0xe0')]){_0x1ad068['createStateFinal'](_0x577343,_0x334215,_0x2625e4,_0xc074('0x1a7'));}else{_0x1ad068[_0xc074('0x122')](_0x577343,_0x334215,_0x2625e4,_0xc074('0x1a7'));}}break;case'20':_0x3659cb[_0xc074('0x1a8')]+=0x1;_0x577343[_0xc074('0x69')]=0x14;_0x577343[_0xc074('0x6a')]=_0xc074('0x1a9');_0x577343[_0xc074('0x119')]+=0x1;_0x577343[_0xc074('0xdd')]+=0x1;_0x2b176f=_0x3659cb[_0xc074('0x190')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];ami[_0xc074('0x3d')](_0xc074('0x1aa'),ut[_0xc074('0x10e')](_0x50ad87,_0xc074('0x1ab')));hopperUtils[_0xc074('0xd8')](_0x577343)['catch'](loggerCatch(_0xc074('0x1ac')));if(_0x1ad068[_0xc074('0x182')](0x14,_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0x119')]>=_0x3659cb[_0xc074('0x18f')]){_0x1ad068[_0xc074('0x11c')](_0x577343,_0x334215,_0x2625e4,'reason\x2020\x20agentreject');}else{_0x1ad068['stateGlobal'](_0x577343,_0x334215,_0x2625e4,_0xc074('0x1ad'));}}break;default:_0x3659cb[_0xc074('0x1ae')]+=0x1;_0x577343[_0xc074('0x69')]=0xc;_0x577343[_0xc074('0x6a')]=_0xde037f[_0xc074('0x194')];_0x2b176f=_0x3659cb[_0xc074('0x190')];_0x3aaf86=_0x3659cb[_0xc074('0xcb')];hopperUtils['createHistory'](_0x577343)['catch'](loggerCatch(_0xc074('0x1af')));if(_0x1ad068['checkRetriveMax'](_0xde037f[_0xc074('0x194')],_0x50ad87,_0x3659cb)&&!_0x1e394f){if(_0x577343[_0xc074('0x116')]+_0x577343[_0xc074('0x117')]+_0x577343[_0xc074('0x183')]+_0x577343['countnosuchnumberretry']+_0x577343[_0xc074('0xcc')]+_0x577343[_0xc074('0xdc')]+_0x577343[_0xc074('0x114')]+_0x577343[_0xc074('0x119')]>=_0x3659cb[_0xc074('0x11a')]){_0x1ad068[_0xc074('0x122')](_0x577343,_0x334215,_0x2625e4,_0xde037f['reason']);}else{_0x1ad068[_0xc074('0x11c')](_0x577343,_0x334215,_0x2625e4,_0xde037f[_0xc074('0x194')]);}}}})[_0xc074('0x99')](function(){if(_0x1e394f){hopperUtils[_0xc074('0xd9')](_0x577343,_0x2b176f,_0x3aaf86)[_0xc074('0x99')](function(){return _0x334215(0x1);});}});});};Dialer[_0xc074('0x87')][_0xc074('0x122')]=function(_0x28d8ac,_0xfb6702,_0x4ff1cb,_0x2b5855){var _0xb1d775=new Final(_0x28d8ac);_0xb1d775['state']=0xf;_0xb1d775[_0xc074('0x6a')]=_0xc074('0x1b0');this[_0xc074('0x11c')](_0xb1d775,_0xfb6702,_0x4ff1cb,_0x2b5855);};Dialer[_0xc074('0x87')][_0xc074('0x11c')]=function(_0x59fb0b,_0x391018,_0x6b3755,_0xc4941){hopperUtils[_0xc074('0xc6')](_0x59fb0b)[_0xc074('0x99')](function(){return _0x391018(msgResponse(_0xc074('0x192'),_0xc074('0x101'),_0xc4941));})[_0xc074('0x9e')](function(){return _0x6b3755(msgResponse(_0xc074('0x1b1'),_0xc074('0x8e'),_0xc074('0x1b2')));});};Dialer[_0xc074('0x87')][_0xc074('0xa')]=function(_0x2d8818){var _0x47613f=_0x2d8818[_0xc074('0x1b3')]/0x64;var _0x3032f1=_0x2d8818[_0xc074('0xc9')]/(_0x2d8818['outboundDropCallsDayTimeout']+_0x2d8818[_0xc074('0xc1')]);var _0x2c4747=Math[_0xc074('0x1b4')](_0x2d8818[_0xc074('0x1b5')]*(_0x2d8818[_0xc074('0x1b6')]/0x64));var _0x280c98=Math[_0xc074('0x1b4')](_0x2d8818['predictiveIntervalAvailable']*(_0x2d8818[_0xc074('0x1b7')]/0x64));var _0x31547a=_0x2d8818[_0xc074('0x12f')]+_0x2d8818[_0xc074('0x131')];var _0x1c77d4=Math['floor'](_0x2d8818[_0xc074('0x53')]*_0x2d8818[_0xc074('0x56')]*_0x2d8818[_0xc074('0x1b8')]*_0x2d8818['predictiveIntervalMultiplicativeFactor']);if(_[_0xc074('0x3c')](_0x2d8818[_0xc074('0x28')])){if(!_[_0xc074('0x3c')](_0x2d8818['startPredictive'])){_0x2d8818[_0xc074('0x27')]=undefined;loggerPredictive[_0xc074('0x5e')](_0xc074('0x1b9'),_0xc074('0x1ba'));}if(!_[_0xc074('0x3c')](_0x2d8818[_0xc074('0x5c')])){loggerPredictive[_0xc074('0x5e')](_0xc074('0x1b9'),_0xc074('0x1bb'));clearInterval(_0x2d8818[_0xc074('0x5c')]);_0x2d8818['handlePredictive']=undefined;}_0x2d8818[_0xc074('0x28')]=moment()[_0xc074('0x78')](_0xc074('0xc0'));loggerPredictive[_0xc074('0x44')](_0x2d8818[_0xc074('0x5a')],_0xc074('0x1bc'),_0x2d8818['startProgressive']);this[_0xc074('0xad')](_0x2d8818,0x1);}else if(ifInterval(_0x2d8818[_0xc074('0x1bd')],_0x2d8818['startProgressive'])){this[_0xc074('0xad')](_0x2d8818,0x1);loggerPredictiveCalls['info'](_0xc074('0x1be'),_0x2d8818['startProgressive'],_0x2d8818['name']);_0x2d8818[_0xc074('0x53')]=0x0;_0x2d8818[_0xc074('0x1bf')]=0x0;}else if(_0x47613f<_0x3032f1&&_0x2d8818[_0xc074('0x1c0')]===_0xc074('0x1c1')){clearPredictiveAttributes(_0x2d8818);loggerPredictive[_0xc074('0x44')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc074('0x1c2'),_0x3032f1,_0xc074('0x28'),_0x2d8818[_0xc074('0x5a')]);}else if(_0x1c77d4<_0x2d8818[_0xc074('0x1bf')]&&_0x2d8818[_0xc074('0x1c0')]===_0xc074('0x1c1')){clearPredictiveAttributes(_0x2d8818);loggerPredictive[_0xc074('0x44')](_0xc074('0x1c3'),_0xc074('0x1c4'),_0x1c77d4,'Drop\x20in\x20this\x20interval',_0x2d8818[_0xc074('0x1bf')],_0xc074('0x28'),_0x2d8818['name']);}else if(!ifInterval(_0x2d8818[_0xc074('0x1bd')],_0x2d8818['startProgressive'])&&_[_0xc074('0x3c')](_0x2d8818[_0xc074('0x27')])&&!_[_0xc074('0x3c')](_0x2d8818[_0xc074('0x28')])){_0x2d8818[_0xc074('0x27')]=moment()[_0xc074('0x78')](_0xc074('0xc0'));loggerPredictive[_0xc074('0x44')](_0x2d8818[_0xc074('0x5a')],_0xc074('0x1c5'),_0x2d8818[_0xc074('0x27')]);hopperUtils[_0xc074('0x1c6')](_0x2d8818[_0xc074('0x1bd')])['then'](this['getDataPredictive'](_0x2d8818))[_0xc074('0x99')](mergeDataErlangB(_0x2d8818))[_0xc074('0x99')](this['startMethodPredictive'](_0x2d8818))[_0xc074('0x9e')](loggerCatchPredictive(_0xc074('0x1c7'),_0x2d8818));}else if(!ifInterval(_0x2d8818['dialPredictiveInterval'],_0x2d8818[_0xc074('0x27')])){_0x2d8818['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2d8818[_0xc074('0x27')]=moment()[_0xc074('0x78')](_0xc074('0xc0'));loggerPredictive['info'](_0x2d8818[_0xc074('0x5a')],_0xc074('0x1c8'),_0x2d8818['startPredictive']);clearInterval(_0x2d8818['handlePredictive']);_0x2d8818[_0xc074('0x5c')]=undefined;hopperUtils[_0xc074('0x1c6')](_0x2d8818['dialPredictiveInterval'])[_0xc074('0x99')](this['getDataPredictive'](_0x2d8818))[_0xc074('0x99')](mergeDataErlangB(_0x2d8818))[_0xc074('0x99')](this[_0xc074('0x1c9')](_0x2d8818))['catch'](loggerCatchPredictive(_0xc074('0x1ca'),_0x2d8818));}else if(_0x2d8818[_0xc074('0x1b5')]&&_0x31547a<_0x2d8818['predictiveIntervalAvailable']-_0x280c98){clearPredictiveAttributes(_0x2d8818);loggerPredictive['info'](_0x2d8818['name'],_0xc074('0x1cb'),_0x31547a,')\x20are\x20less\x20than\x20threshold\x20(',_0x2d8818[_0xc074('0x1b5')],'-',_0x280c98,'=',_0x2d8818[_0xc074('0x1b5')]-_0x280c98,')');}else if(_0x2d8818[_0xc074('0x1b5')]&&_0x31547a>_0x2d8818[_0xc074('0x1b5')]+_0x2c4747){clearPredictiveAttributes(_0x2d8818);loggerPredictive[_0xc074('0x44')](_0x2d8818['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x31547a,')\x20are\x20more\x20than\x20threshold\x20(',_0x2d8818[_0xc074('0x1b5')],'+',_0x2c4747,'=',_0x2d8818[_0xc074('0x1b5')]+_0x2c4747,')');}};Dialer[_0xc074('0x87')][_0xc074('0x1cc')]=function(_0x11d5cc){var _0xf7ebfd=this;return function(_0x18b2d2){return new Promise(function(_0x58cbcc,_0x9d3269){_[_0xc074('0x58')](_0x11d5cc,_0x18b2d2[0x0]);if(checkGetDataPredictive(_0x18b2d2[0x0])){var _0x21c283=_0x11d5cc[_0xc074('0x1b5')]=_0x11d5cc[_0xc074('0x131')]+_0x11d5cc[_0xc074('0x12f')];var _0x3b3914=_0x11d5cc[_0xc074('0x1bd')]*0x3c;var _0x3f7f4c=_0x18b2d2[0x0][_0xc074('0x50')]+_0x18b2d2[0x0]['predictiveIntervalAvgHoldtime'];var _0xcfc30c=(_0x18b2d2[0x0]['predictiveIntervalAnsweredCalls']+_0x18b2d2[0x0][_0xc074('0x4a')]+_0x18b2d2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x18b2d2[0x0][_0xc074('0x47')];_0x11d5cc[_0xc074('0x1b8')]=_0xcfc30c>0x0?_0xcfc30c:0x1;switch(_0x11d5cc[_0xc074('0x1c0')]){case _0xc074('0x1c1'):var _0x5aef0b=_0x11d5cc['dialPredictiveOptimizationPercentage']/0x64;return _0xf7ebfd[_0xc074('0x1cd')](_0x21c283,_0x3b3914,_0x3f7f4c,_0xcfc30c,_0x5aef0b)[_0xc074('0x99')](function(_0x48d948){return _0x58cbcc(_0x48d948);});case _0xc074('0x1ce'):var _0x153532=_0x11d5cc[_0xc074('0x1b3')]/0x64;return _0xf7ebfd[_0xc074('0x1cf')](_0x21c283,_0x3b3914,_0x3f7f4c,_0xcfc30c,_0x153532)[_0xc074('0x99')](function(_0x110421){return _0x58cbcc(_0x110421);});default:return _0x9d3269(msgResponse(_0xc074('0x1d0'),_0xc074('0x8e'),_0xc074('0x1d1')));}}else{return _0x9d3269(msgResponse(_0xc074('0x1d0'),_0xc074('0x8e'),_0xc074('0x1d2')));}});};};Dialer[_0xc074('0x87')][_0xc074('0x1d3')]=function(_0x4497ef){var _0x30d572=this;return function(_0x1878c6){return new Promise(function(_0x5e97f8,_0x456cb3){_[_0xc074('0x58')](_0x4497ef,_0x1878c6[0x0]);if(checkGetDataPredictive(_0x1878c6[0x0])){loggerPredictive[_0xc074('0x44')](JSON[_0xc074('0x6f')](_0x1878c6[0x0]));if(_0x4497ef[_0xc074('0x1c0')]==='dropRate'){return _0x30d572[_0xc074('0x142')](_0x4497ef['id'])[_0xc074('0x99')](function(_0x3b872c){var _0x540c90=_0x4497ef[_0xc074('0x1d4')]-_0x3b872c[0x0][_0xc074('0x1d5')];var _0x34097c=_0x4497ef[_0xc074('0x1bd')]*0x3c;var _0x2a41cf=_0x1878c6[0x0][_0xc074('0x50')]+_0x1878c6[0x0][_0xc074('0x4d')];var _0x49f5ba=(_0x1878c6[0x0][_0xc074('0x49')]+_0x1878c6[0x0][_0xc074('0x4a')]+_0x1878c6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1878c6[0x0][_0xc074('0x47')];var _0x5286d8=_0x4497ef[_0xc074('0x1b3')]/0x64;_0x4497ef[_0xc074('0x1d6')]=_0x3b872c[0x0][_0xc074('0x1d5')]||0x0;_0x4497ef['predictiveIntervalHitRate']=_0x49f5ba>0x0?_0x49f5ba:0x1;return _0x30d572[_0xc074('0x1cd')](_0x540c90,_0x34097c,_0x2a41cf,_0x49f5ba,_0x5286d8);})[_0xc074('0x99')](function(_0x55c86d){return _0x5e97f8(_0x55c86d);})[_0xc074('0x9e')](function(_0x2fd6bc){return _0x456cb3(msgResponse(_0xc074('0x1d7'),_0xc074('0x8e'),JSON[_0xc074('0x6f')](_0x2fd6bc)));});}if(_0x4497ef['dialPredictiveOptimization']===_0xc074('0x1ce')){return _0x30d572['getVoiceQueueRtPauses'](_0x4497ef['id'])['then'](function(_0x3b8ea8){var _0x240fe5=_0x4497ef[_0xc074('0x1d4')]-_0x3b8ea8[0x0][_0xc074('0x1d5')];var _0x5a531b=_0x4497ef[_0xc074('0x1bd')]*0x3c;var _0x1ed7d1=_0x1878c6[0x0][_0xc074('0x50')]+_0x1878c6[0x0][_0xc074('0x4d')];var _0xb52570=(_0x1878c6[0x0]['predictiveIntervalAnsweredCalls']+_0x1878c6[0x0][_0xc074('0x4a')]+_0x1878c6[0x0][_0xc074('0x4c')])/_0x1878c6[0x0][_0xc074('0x47')];var _0x42c303=_0x4497ef[_0xc074('0x1b3')]/0x64;_0x4497ef['predictiveIntervalPauses']=_0x3b8ea8[0x0][_0xc074('0x1d5')]||0x0;_0x4497ef['predictiveIntervalHitRate']=_0xb52570>0x0?_0xb52570:0x1;return _0x30d572[_0xc074('0x1cf')](_0x240fe5,_0x5a531b,_0x1ed7d1,_0xb52570,_0x42c303);})['then'](function(_0x386e1d){return _0x5e97f8(_0x386e1d);})[_0xc074('0x9e')](function(_0x1cb4de){return _0x456cb3(msgResponse('[CatchErlangB]',_0xc074('0x8e'),JSON[_0xc074('0x6f')](_0x1cb4de)));});}}else{return _0x456cb3(msgResponse(_0xc074('0x1d0'),_0xc074('0x8e'),_0xc074('0x1d2')));}});};};Dialer[_0xc074('0x87')][_0xc074('0x1c9')]=function(_0x4a49e9){var _0xf8e449=this;return function(){var _0x2b0b1b=0x0;var _0x2be968=Math['floor'](_0x4a49e9[_0xc074('0x54')]*0x3e8);if(_0x2be968>0x0){_0x2be968=_0x2be968<0x64?0x64:_0x2be968;loggerPredictive[_0xc074('0x44')](_0x4a49e9[_0xc074('0x5a')],_0xc074('0x1d8'),_0x2be968,_0xc074('0x1d9'));_0x4a49e9[_0xc074('0x5c')]=setInterval(function(){_0xf8e449[_0xc074('0x5c')](_0x4a49e9);loggerPredictiveCalls[_0xc074('0x44')](_0xc074('0x1da'),_0x2b0b1b+=0x1);},_0x2be968);}else{loggerPredictive['info'](_0x4a49e9[_0xc074('0x5a')],_0xc074('0x1db'));}};};Dialer[_0xc074('0x87')][_0xc074('0x1dc')]=function(_0x52ae80,_0x5e8f4a){var _0xf3be01=this;return function(_0xab50e1){if(_['isEmpty'](_0xab50e1)){if(_['isNil'](_0x5e8f4a['UserId'])||!_0x5e8f4a[_0xc074('0x1dd')]){if(_0x52ae80[_0xc074('0xaa')]==='booked'){_0x52ae80[_0xc074('0x6c')]=_[_0xc074('0x3c')](_0x52ae80[_0xc074('0x6c')])?!![]:_0x52ae80['queueStatusComplete'];var _0x5a6930=uuid['v4']();_0xf3be01[_0xc074('0x23')][_0x5a6930]=new Action(_0x52ae80,_0x5e8f4a,_0x5a6930);loggerBooked[_0xc074('0x44')](_0xc074('0x1de'),_0x5a6930,_0xc074('0x1df'),JSON[_0xc074('0x6f')](_0x52ae80['queueStatusComplete']),'Queue:\x20',_0x52ae80[_0xc074('0x5a')]);if(_0x52ae80[_0xc074('0x6c')]){_0x52ae80[_0xc074('0x6c')]=![];_0xf3be01[_0xc074('0xee')][_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xba')]]=[];ami[_0xc074('0x97')]({'actionid':_0x5a6930,'action':_0xc074('0x1e0'),'queue':_0x52ae80[_0xc074('0x5a')]})[_0xc074('0x9e')](function(){_0xf3be01[_0xc074('0xbe')](_0x52ae80);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0xf3be01['actions'][_0x5a6930][_0xc074('0xd0')],'ListId':_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xd1')],'VoiceQueueId':_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xd2')]||undefined,'CampaignId':_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xd3')]||undefined})['catch'](loggerCatch(_0xc074('0x1e1')));delete _0xf3be01[_0xc074('0x23')][_0x5a6930];});}else{loggerBooked['info'](_0xc074('0x1e2'),JSON[_0xc074('0x6f')](_0x52ae80[_0xc074('0x6c')]),_0xc074('0x1e3'),_0x52ae80['name']);_0xf3be01[_0xc074('0xbe')](_0x52ae80);hopperUtils[_0xc074('0xf2')]({'active':![],'ContactId':_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xd0')],'ListId':_0xf3be01['actions'][_0x5a6930]['ListId'],'VoiceQueueId':_0xf3be01[_0xc074('0x23')][_0x5a6930][_0xc074('0xd2')]||undefined,'CampaignId':_0xf3be01[_0xc074('0x23')][_0x5a6930]['CampaignId']||undefined})['catch'](loggerCatch(_0xc074('0x1e1')));delete _0xf3be01[_0xc074('0x23')][_0x5a6930];}}else{return _0xf3be01[_0xc074('0x14d')](_0x52ae80,_0x5e8f4a);}}else{if(utils[_0xc074('0x59')](undefined,_0x5e8f4a[_0xc074('0x1e4')])<_0x52ae80[_0xc074('0x1e5')]*0x3c){if(_0x5e8f4a['Agent']&&!_0x5e8f4a[_0xc074('0x13d')]['voicePause']){_0xf3be01[_0xc074('0xf0')]['run'](_0x5e8f4a['id'])[_0xc074('0x1b')](function(){_0xf3be01[_0xc074('0xbe')](_0x52ae80);});}else{hopperUtils['unlockContact']({'active':![]},_0x5e8f4a['id'],0x1)[_0xc074('0x1b')](function(){_0xf3be01['updateOriginated'](_0x52ae80);});}}else{_0x52ae80[_0xc074('0x1e6')]+=0x1;_0xf3be01[_0xc074('0xbe')](_0x52ae80);if(_0x52ae80[_0xc074('0x1e7')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e8f4a[_0xc074('0xd0')],'ListId':_0x5e8f4a[_0xc074('0xd1')],'VoiceQueueId':_0x5e8f4a['VoiceQueueId']||undefined,'CampaignId':_0x5e8f4a[_0xc074('0xd3')]||undefined})[_0xc074('0x9e')](loggerCatch(_0xc074('0x1e8')));hopperUtils[_0xc074('0xd8')](createObjHistory(_0x52ae80,_0x5e8f4a,utils[_0xc074('0x64')][_0xc074('0x1e9')],0x17,_0xc074('0x1ea')))[_0xc074('0x9e')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xf3be01[_0xc074('0x110')](createObjHistory(_0x52ae80,_0x5e8f4a,utils[_0xc074('0x64')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0xc074('0x1eb'),_0xc074('0x1ec'));}}}}else{_0x52ae80[_0xc074('0x1ed')]+=0x1;_0xf3be01[_0xc074('0x110')](createObjHistory(_0x52ae80,_0x5e8f4a,utils[_0xc074('0x64')][_0xc074('0x1ee')],0xd,_0xc074('0x1ef')),_0xc074('0x1f0'),_0xc074('0x1f1'));throw'inBlackList';}};};Dialer['prototype'][_0xc074('0x14c')]=function(_0xaa2344){var _0x221aba=this;var _0x101ab3=_0xaa2344[_0xc074('0x1f2')]-_0xaa2344[_0xc074('0x7b')];emitCampaignSummary(_0xaa2344);if(_0x101ab3>0x0&&_0xaa2344[_0xc074('0x60')]==0x0){if(_0x101ab3>this[_0xc074('0x21')]){_0x101ab3=this[_0xc074('0x21')];}_0xaa2344[_0xc074('0x60')]=0x1;hopperUtils[_0xc074('0x1f3')](_0xaa2344,_0x101ab3)[_0xc074('0x99')](function(_0x48c639){_0xaa2344['temp']=0x0;if(_0x48c639){if(!utils['checkContactEmpty'](_0x48c639)){_0xaa2344['message']=utils['CAMPAIGN_STATUS'][_0xc074('0x68')];logger[_0xc074('0x44')](_0xc074('0x1f4')+_0xaa2344[_0xc074('0x5a')]);}else{_0xaa2344[_0xc074('0x7b')]+=_0x48c639['length'];_0xaa2344[_0xc074('0x63')]=utils['CAMPAIGN_STATUS'][_0xc074('0x1f5')];for(var _0x3395fd=0x0;_0x3395fd<_0x48c639[_0xc074('0x95')];_0x3395fd+=0x1){_0xaa2344['ivrTotalCallsDays']+=0x1;if(_[_0xc074('0xe9')](_0x48c639[_0x3395fd])||_['isNil'](_0x48c639[_0x3395fd]['Contact'])||_['isNil'](_0x48c639[_0x3395fd][_0xc074('0x150')])){_0x221aba[_0xc074('0x1f6')](_0xc074('0x1f7'),_0xaa2344,_0x48c639[_0x3395fd]);}else{hopperUtils[_0xc074('0x1f8')](_[_0xc074('0x70')](_0x48c639[_0x3395fd],['CampaignId','phone']))[_0xc074('0x99')](_0x221aba['checkContactBlack'](_0xaa2344,_0x48c639[_0x3395fd]))['catch'](_0x221aba[_0xc074('0x146')]('[actionOriginateIvr]\x20',_0xaa2344));}}}}})['catch'](loggerGetContactDialer(_0xc074('0x1f9'),_0xaa2344,_0x101ab3));}};Dialer[_0xc074('0x87')]['handlePower']=function(_0x4abec1,_0x3c1622){var _0x1556ba=this;var _0x2cc190=[];if(_0x3c1622<0x1||_0x4abec1['dialMethod']===_0xc074('0x9')){_0x3c1622=0x1;}var _0x2f56b7=Math['floor'](_0x4abec1[_0xc074('0x12f')]*_0x3c1622)-_0x4abec1[_0xc074('0x7b')];if(_0x4abec1[_0xc074('0x1fa')]>0x0){var _0x386ab1=_0x4abec1[_0xc074('0x1fa')]-_0x4abec1[_0xc074('0x7b')]-_0x4abec1[_0xc074('0x131')]-_0x4abec1[_0xc074('0x1fb')];if(_0x2f56b7>_0x386ab1){_0x2f56b7=_0x386ab1;}}if(_0x2f56b7>0x0&&_0x4abec1[_0xc074('0x60')]==0x0){if(_0x4abec1[_0xc074('0xaa')]===_0xc074('0x9')){_0x2f56b7=0x1;}if(_0x2f56b7>this['maxNumberOriginate']){_0x2f56b7=this[_0xc074('0x21')];}for(var _0x14b803 in this['agents']){if(typeof this[_0xc074('0x1f')][_0x14b803]!=='undefined'){if(this[_0xc074('0x1f')][_0x14b803]['state']===_0xc074('0x1fc')&&this[_0xc074('0x1f')][_0x14b803][_0xc074('0x83')]===_0xc074('0x84')){_0x2cc190[_0xc074('0x96')](this[_0xc074('0x1f')][_0x14b803]['id']);}}}_0x4abec1['temp']=0x1;hopperUtils[_0xc074('0x1fd')](_0x4abec1,_0x2cc190,_0x2f56b7)['then'](function(_0x234cf7){_0x4abec1[_0xc074('0x60')]=0x0;if(_0x234cf7){if(!utils[_0xc074('0x1fe')](_0x234cf7)){hopperUtils['countReScheduled'](_0x4abec1)[_0xc074('0x99')](sendMessageReschedule(_0x4abec1))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x4abec1[_0xc074('0x7b')]+=_0x234cf7[_0xc074('0x95')];_0x4abec1[_0xc074('0x63')]=_0x4abec1[_0xc074('0xaa')]===_0xc074('0x9')?utils['CAMPAIGN_STATUS'][_0xc074('0x132')]:utils[_0xc074('0x64')]['RUNNING'];for(var _0x3165bc=0x0;_0x3165bc<_0x234cf7[_0xc074('0x95')];_0x3165bc+=0x1){if(_[_0xc074('0xe9')](_0x234cf7[_0x3165bc])||_[_0xc074('0xe9')](_0x234cf7[_0x3165bc][_0xc074('0x16b')])||_[_0xc074('0xe9')](_0x234cf7[_0x3165bc][_0xc074('0x150')])){_0x1556ba[_0xc074('0x1f6')](_0xc074('0x1f7'),_0x4abec1,_0x234cf7[_0x3165bc]);}else{hopperUtils['checkIsBlackList'](_[_0xc074('0x70')](_0x234cf7[_0x3165bc],['VoiceQueueId',_0xc074('0x150')]))[_0xc074('0x99')](_0x1556ba[_0xc074('0x1dc')](_0x4abec1,_0x234cf7[_0x3165bc]))[_0xc074('0x9e')](_0x1556ba[_0xc074('0x146')](_0xc074('0x1f7'),_0x4abec1));}}}}})[_0xc074('0x9e')](loggerGetContactDialer('[getContactDialer2]',_0x4abec1,_0x2f56b7));}};Dialer[_0xc074('0x87')]['handlePredictive']=function(_0x2098aa){if(_0x2098aa[_0xc074('0x1fa')]>0x0){var _0x5f2eb3=_0x2098aa[_0xc074('0x1fa')]-_0x2098aa['originated']-_0x2098aa[_0xc074('0x131')];if(_0x5f2eb3>0x0&&_0x2098aa[_0xc074('0x60')]==0x0){this[_0xc074('0x1ff')](_0x2098aa);}else{loggerPredictiveCalls[_0xc074('0x44')](_0xc074('0x200'));}}else{this['tryOriginatePredictive'](_0x2098aa);}};Dialer[_0xc074('0x87')][_0xc074('0x1ff')]=function(_0x5cd5d0){var _0x1fffae=this;var _0x6214b5=[];_0x5cd5d0[_0xc074('0x7b')]+=0x1;for(var _0x102b11 in this[_0xc074('0x1f')]){if(typeof this[_0xc074('0x1f')][_0x102b11]!==_0xc074('0xa6')){if(this[_0xc074('0x1f')][_0x102b11][_0xc074('0x69')]==='not_inuse'&&this[_0xc074('0x1f')][_0x102b11]['status']===_0xc074('0x84')){_0x6214b5[_0xc074('0x96')](this[_0xc074('0x1f')][_0x102b11]['id']);}}}_0x5cd5d0[_0xc074('0x60')]=0x1;return this[_0xc074('0x1fd')](_0x5cd5d0['id'],_0x6214b5,0x1,_0x5cd5d0[_0xc074('0x201')],_0x5cd5d0)[_0xc074('0x99')](function(_0x32cfce){_0x5cd5d0[_0xc074('0x60')]=0x1;if(_0x32cfce){if(!utils[_0xc074('0x1fe')](_0x32cfce)){utils['checkContactLowerLimitOriginate'](_0x5cd5d0,0x1,0x0);return hopperUtils[_0xc074('0x202')](_0x5cd5d0)[_0xc074('0x99')](sendMessageReschedule(_0x5cd5d0))[_0xc074('0x9e')](loggerCatch(_0xc074('0x203')));}else{_0x5cd5d0[_0xc074('0x63')]=utils[_0xc074('0x64')][_0xc074('0x1f5')];if(_[_0xc074('0xe9')](_0x32cfce[0x0])||_[_0xc074('0xe9')](_0x32cfce[0x0][_0xc074('0x16b')])||_[_0xc074('0xe9')](_0x32cfce[0x0][_0xc074('0x150')])){_0x1fffae[_0xc074('0x1f6')](_0xc074('0x1f7'),_0x5cd5d0,_0x32cfce[0x0]);}else{return hopperUtils[_0xc074('0x204')](_['pick'](_0x32cfce[0x0],[_0xc074('0xd2'),'phone']))['then'](_0x1fffae[_0xc074('0x1dc')](_0x5cd5d0,_0x32cfce[0x0]))[_0xc074('0x9e')](_0x1fffae[_0xc074('0x146')]('[actionOriginatePredictive]\x20',_0x5cd5d0));}}}})[_0xc074('0x9e')](loggerGetContactDialer(_0xc074('0x205'),_0x5cd5d0,0x1));};Dialer[_0xc074('0x87')][_0xc074('0x1cd')]=function(_0x2a67eb,_0x1a0dc1,_0x2b956c,_0x767c0e,_0x50848a,_0x547d6f){loggerPredictive['info'](_0xc074('0x206'));loggerPredictive[_0xc074('0x44')](_0xc074('0x207'),_0x2a67eb);loggerPredictive[_0xc074('0x44')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a0dc1);loggerPredictive[_0xc074('0x44')]('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',_0x2b956c);loggerPredictive['info'](_0xc074('0x208'),_0x767c0e);loggerPredictive[_0xc074('0x44')](_0xc074('0x209'),_0x50848a);loggerPredictive['info'](_0xc074('0x4f'));return new Promise(function(_0x2e2277,_0x29d68a){if(_0x2a67eb<=0x0||isNaN(_0x2a67eb)){return _0x29d68a(msgResponse(_0xc074('0x20a'),_0xc074('0x80'),'m\x20=\x20'+_0x2a67eb));}if(_0x2b956c<=0x0||isNaN(_0x2b956c)){return _0x29d68a(msgResponse(_0xc074('0x20a'),'Error',_0xc074('0x20b')+_0x2b956c));}if(_0x767c0e<=0x0||isNaN(_0x767c0e)){return _0x29d68a(msgResponse('[abandonmentRate]',_0xc074('0x80'),_0xc074('0x20c')+_0x767c0e));}if(_0x1a0dc1<=0x0||isNaN(_0x1a0dc1)){return _0x29d68a(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x1a0dc1));}if(_0x50848a<=0x0||isNaN(_0x50848a)){return _0x29d68a(msgResponse(_0xc074('0x20a'),_0xc074('0x80'),'Amax\x20=\x20'+_0x50848a));}_0x547d6f=_0x547d6f||0x0;var _0x12a360=0x1/_0x2b956c;var _0x456af2=0x0;var _0x4c51c6=0x0;var _0x5907ab=0x0;var _0x48c672=0x0;for(var _0x456c9c=0x0;_0x5907ab<_0x50848a;_0x456c9c+=0x1){_0x4c51c6=_0x456c9c/_0x1a0dc1;_0x456af2=(_0x767c0e*_0x4c51c6+_0x547d6f)/_0x12a360;_0x5907ab=utils['erlangb'](_0x456af2,_0x2a67eb);_0x48c672=_0x456af2/_0x2a67eb*(0x1-utils[_0xc074('0x20d')](_0x456af2,_0x2a67eb));}return _0x2e2277({'erlangCalls':_0x456c9c,'erlangCallToSecond':_0x1a0dc1/_0x456c9c,'erlangAbandonmentRate':_0x5907ab,'erlangBusyFactor':_0x48c672});});};Dialer[_0xc074('0x87')][_0xc074('0x1cf')]=function(_0x34adb8,_0x505961,_0x5eab89,_0x14e13b,_0x3c72cf,_0x1042af){loggerPredictive[_0xc074('0x44')](_0xc074('0x20e'));loggerPredictive['info'](_0xc074('0x207'),_0x34adb8);loggerPredictive[_0xc074('0x44')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x505961);loggerPredictive[_0xc074('0x44')]('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',_0x5eab89);loggerPredictive[_0xc074('0x44')](_0xc074('0x208'),_0x14e13b);loggerPredictive['info'](_0xc074('0x20f'),_0x3c72cf);loggerPredictive[_0xc074('0x44')](_0xc074('0x4f'));return new Promise(function(_0x4bb542,_0x5c807d){if(_0x34adb8<=0x0||isNaN(_0x34adb8)){return _0x5c807d(msgResponse(_0xc074('0x210'),_0xc074('0x80'),_0xc074('0x211')+_0x34adb8));}if(_0x5eab89<=0x0||isNaN(_0x5eab89)){return _0x5c807d(msgResponse(_0xc074('0x210'),_0xc074('0x80'),_0xc074('0x20b')+_0x5eab89));}if(_0x14e13b<=0x0||isNaN(_0x14e13b)){return _0x5c807d(msgResponse(_0xc074('0x210'),_0xc074('0x80'),_0xc074('0x20c')+_0x14e13b));}if(_0x505961<=0x0||isNaN(_0x505961)){return _0x5c807d(msgResponse(_0xc074('0x210'),'Error',_0xc074('0x212')+_0x505961));}if(_0x3c72cf<=0x0||isNaN(_0x3c72cf)){return _0x5c807d(msgResponse(_0xc074('0x210'),_0xc074('0x80'),'Umin\x20=\x20'+_0x3c72cf));}_0x1042af=_0x1042af||0x0;var _0x30023c=0x1/_0x5eab89;var _0xd3bbb1=0x0;var _0x689603=0x0;var _0x252e58=0x0;var _0x3ce747=0x0;for(var _0x44b98f=0x0;_0x3ce747<_0x3c72cf;_0x44b98f+=0x1){_0x689603=_0x44b98f/_0x505961;_0xd3bbb1=(_0x14e13b*_0x689603+_0x1042af)/_0x30023c;_0x252e58=utils[_0xc074('0x20d')](_0xd3bbb1,_0x34adb8);_0x3ce747=_0xd3bbb1/_0x34adb8*(0x1-utils[_0xc074('0x20d')](_0xd3bbb1,_0x34adb8));}return _0x4bb542({'erlangCalls':_0x44b98f,'erlangCallToSecond':_0x505961/_0x44b98f,'erlangAbandonmentRate':_0x252e58,'erlangBusyFactor':_0x3ce747});});};module[_0xc074('0x213')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 851272a..82b59ef 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0440=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName'];(function(_0x4f9522,_0x399e9f){var _0x5a89a7=function(_0x853a9a){while(--_0x853a9a){_0x4f9522['push'](_0x4f9522['shift']());}};_0x5a89a7(++_0x399e9f);}(_0x0440,0x11c));var _0x0044=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x0440[_0x28407a];return _0x8bd6ef;};'use strict';var util=require(_0x0044('0x0'));var _=require(_0x0044('0x1'));var moment=require(_0x0044('0x2'));function checkNameSurname(_0x35a188,_0x30a823,_0x2423e1){var _0x4d52b1='';if(!_[_0x0044('0x3')](_0x30a823)&&_0x0044('0x4')===typeof _0x30a823){_0x4d52b1+=_0x30a823;}if(!_[_0x0044('0x3')](_0x2423e1)&&_0x0044('0x4')===typeof _0x2423e1){_0x4d52b1+='\x20'+_0x2423e1;}if(_0x4d52b1!==''){return _0x4d52b1;}return _0x35a188;}function Action(_0x31929e,_0x5ba8e9,_0x296efd){this[_0x0044('0x5')]=_0x31929e;this[_0x0044('0x6')]=_0x296efd||undefined;this[_0x0044('0x7')]=checkNameSurname(_0x5ba8e9[_0x0044('0x8')]['phone'],_0x5ba8e9[_0x0044('0x8')][_0x0044('0x9')],_0x5ba8e9['Contact']['lastName']);this[_0x0044('0xa')]=_0x5ba8e9[_0x0044('0xb')];this[_0x0044('0xc')]=_0x31929e[_0x0044('0x7')];this[_0x0044('0xd')]=_0x5ba8e9[_0x0044('0xd')]||![];this['type']=_0x31929e[_0x0044('0xe')];this[_0x0044('0xf')]=_0x31929e['dialQueueTimeout']||0x3;this[_0x0044('0x10')]=_0x5ba8e9[_0x0044('0x10')];this[_0x0044('0x11')]=_0x5ba8e9[_0x0044('0x11')];this[_0x0044('0x12')]=_0x5ba8e9[_0x0044('0x12')];this[_0x0044('0x13')]=_0x5ba8e9[_0x0044('0x13')];this[_0x0044('0x14')]=_0x5ba8e9[_0x0044('0x14')];this['countdropretry']=_0x5ba8e9[_0x0044('0x15')];this[_0x0044('0x16')]=_0x5ba8e9[_0x0044('0x16')];this[_0x0044('0x17')]=_0x5ba8e9[_0x0044('0x17')];this[_0x0044('0x18')]=_0x5ba8e9['countagentrejectretry'];this['ContactId']=_0x5ba8e9[_0x0044('0x19')];this[_0x0044('0x1a')]=_0x5ba8e9[_0x0044('0x1a')];this[_0x0044('0x1b')]=_0x5ba8e9[_0x0044('0x1b')];this[_0x0044('0x1c')]=_0x5ba8e9[_0x0044('0x1c')];this[_0x0044('0x1d')]=_0x5ba8e9[_0x0044('0x1d')];this['idHopper']=_0x5ba8e9['id'];this[_0x0044('0x1e')]=_0x5ba8e9[_0x0044('0x8')][_0x0044('0x9')]||'';this[_0x0044('0x1f')]=moment()[_0x0044('0x20')](_0x0044('0x21'));this['callback']=_0x5ba8e9[_0x0044('0x22')];this[_0x0044('0x23')]=_0x5ba8e9[_0x0044('0x23')];this[_0x0044('0x24')]=_0x5ba8e9[_0x0044('0x24')];this[_0x0044('0x25')]=_0x5ba8e9['recallme'];this[_0x0044('0x26')]='';this[_0x0044('0x27')]='';}Action[_0x0044('0x28')][_0x0044('0x29')]=function(){return util[_0x0044('0x20')]('\x22%s\x22\x20<%s>',this[_0x0044('0x7')],this[_0x0044('0x5')][_0x0044('0x2a')]>0x0?this['number']['substring'](this[_0x0044('0x5')][_0x0044('0x2a')]):this[_0x0044('0xa')]);};Action[_0x0044('0x28')][_0x0044('0x2b')]=function(){return this[_0x0044('0xc')];};module[_0x0044('0x2c')]=Action; \ No newline at end of file +var _0xd192=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','lodash','moment','isNil','string','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x3ce1e5,_0xe26af3){var _0x2740e6=function(_0x30e1bc){while(--_0x30e1bc){_0x3ce1e5['push'](_0x3ce1e5['shift']());}};_0x2740e6(++_0xe26af3);}(_0xd192,0x1ce));var _0x2d19=function(_0x2faae8,_0x1a4b74){_0x2faae8=_0x2faae8-0x0;var _0x18b35f=_0xd192[_0x2faae8];return _0x18b35f;};'use strict';var util=require('util');var _=require(_0x2d19('0x0'));var moment=require(_0x2d19('0x1'));function checkNameSurname(_0x1f1077,_0x1ea705,_0x162891){var _0x355ecb='';if(!_[_0x2d19('0x2')](_0x1ea705)&&_0x2d19('0x3')===typeof _0x1ea705){_0x355ecb+=_0x1ea705;}if(!_[_0x2d19('0x2')](_0x162891)&&_0x2d19('0x3')===typeof _0x162891){_0x355ecb+='\x20'+_0x162891;}if(_0x355ecb!==''){return _0x355ecb;}return _0x1f1077;}function Action(_0x2db803,_0x28d9ac,_0x4bd8a7){this['voiceQueue']=_0x2db803;this['uniqueid']=_0x4bd8a7||undefined;this[_0x2d19('0x4')]=checkNameSurname(_0x28d9ac['Contact'][_0x2d19('0x5')],_0x28d9ac[_0x2d19('0x6')][_0x2d19('0x7')],_0x28d9ac[_0x2d19('0x6')][_0x2d19('0x8')]);this[_0x2d19('0x9')]=_0x28d9ac[_0x2d19('0x5')];this[_0x2d19('0xa')]=_0x2db803[_0x2d19('0x4')];this[_0x2d19('0xb')]=_0x28d9ac[_0x2d19('0xb')]||![];this[_0x2d19('0xc')]=_0x2db803[_0x2d19('0xc')];this[_0x2d19('0xd')]=_0x2db803['dialQueueTimeout']||0x3;this[_0x2d19('0xe')]=_0x28d9ac['scheduledat'];this['countbusyretry']=_0x28d9ac[_0x2d19('0xf')];this[_0x2d19('0x10')]=_0x28d9ac[_0x2d19('0x10')];this['countnoanswerretry']=_0x28d9ac[_0x2d19('0x11')];this[_0x2d19('0x12')]=_0x28d9ac[_0x2d19('0x12')];this['countdropretry']=_0x28d9ac[_0x2d19('0x13')];this[_0x2d19('0x14')]=_0x28d9ac['countabandonedretry'];this['countmachineretry']=_0x28d9ac[_0x2d19('0x15')];this[_0x2d19('0x16')]=_0x28d9ac[_0x2d19('0x16')];this[_0x2d19('0x17')]=_0x28d9ac['ContactId'];this['ListId']=_0x28d9ac[_0x2d19('0x18')];this[_0x2d19('0x19')]=_0x28d9ac[_0x2d19('0x19')];this[_0x2d19('0x1a')]=_0x28d9ac[_0x2d19('0x1a')];this[_0x2d19('0x1b')]=_0x28d9ac['CampaignId'];this['idHopper']=_0x28d9ac['id'];this['ContactFirstName']=_0x28d9ac[_0x2d19('0x6')][_0x2d19('0x7')]||'';this[_0x2d19('0x1c')]=moment()[_0x2d19('0x1d')](_0x2d19('0x1e'));this[_0x2d19('0x1f')]=_0x28d9ac[_0x2d19('0x1f')];this[_0x2d19('0x20')]=_0x28d9ac[_0x2d19('0x20')];this[_0x2d19('0x21')]=_0x28d9ac[_0x2d19('0x21')];this[_0x2d19('0x22')]=_0x28d9ac['recallme'];this[_0x2d19('0x23')]='';this[_0x2d19('0x24')]='';}Action[_0x2d19('0x25')]['getCaller']=function(){return util['format'](_0x2d19('0x26'),this['name'],this[_0x2d19('0x27')][_0x2d19('0x28')]>0x0?this['number'][_0x2d19('0x29')](this['voiceQueue'][_0x2d19('0x28')]):this['number']);};Action[_0x2d19('0x25')][_0x2d19('0x2a')]=function(){return this[_0x2d19('0xa')];};module[_0x2d19('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 29a3453..5e71222 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde42=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','starttime','holdtime','talktime','queue','membername'];(function(_0x79c410,_0x5785ee){var _0x11ec20=function(_0x4b937e){while(--_0x4b937e){_0x79c410['push'](_0x79c410['shift']());}};_0x11ec20(++_0x5785ee);}(_0xde42,0x1c6));var _0x2de4=function(_0x3a6bdc,_0x1b8897){_0x3a6bdc=_0x3a6bdc-0x0;var _0x4b27d7=_0xde42[_0x3a6bdc];return _0x4b27d7;};'use strict';var moment=require(_0x2de4('0x0'));var utils=require(_0x2de4('0x1'));function AgentComplete(_0x4c6b57,_0x262ebc){this[_0x2de4('0x2')]=0x4;this['statedesc']='Answer';this[_0x2de4('0x3')]=_0x4c6b57[_0x2de4('0x3')];this[_0x2de4('0x4')]=_0x4c6b57[_0x2de4('0x4')];this['campaigntype']=_0x4c6b57['type']==='outbound'?'queue':_0x4c6b57[_0x2de4('0x4')];this[_0x2de4('0x5')]=_0x4c6b57[_0x2de4('0x5')];this[_0x2de4('0x6')]=_0x4c6b57[_0x2de4('0x6')];this['countnoanswerretry']=_0x4c6b57[_0x2de4('0x7')];this[_0x2de4('0x8')]=_0x4c6b57['countbusyretry']+_0x4c6b57[_0x2de4('0x6')]+_0x4c6b57[_0x2de4('0x7')]+_0x4c6b57[_0x2de4('0x9')]+_0x4c6b57[_0x2de4('0xa')]+_0x4c6b57[_0x2de4('0xb')]+_0x4c6b57[_0x2de4('0xc')]+_0x4c6b57['countagentrejectretry'];this[_0x2de4('0x9')]=_0x4c6b57[_0x2de4('0x9')];this['countdropretry']=_0x4c6b57[_0x2de4('0xa')];this[_0x2de4('0xb')]=_0x4c6b57[_0x2de4('0xb')];this[_0x2de4('0xc')]=_0x4c6b57[_0x2de4('0xc')];this[_0x2de4('0xd')]=_0x4c6b57[_0x2de4('0xd')];this[_0x2de4('0xe')]=_0x262ebc[_0x2de4('0xe')];this['calleridname']=_0x4c6b57[_0x2de4('0xf')];this[_0x2de4('0x10')]=_0x4c6b57[_0x2de4('0x11')];this['starttime']=_0x4c6b57['starttime'];this['responsetime']=_0x4c6b57[_0x2de4('0x12')];this[_0x2de4('0x13')]=_0x4c6b57[_0x2de4('0x13')];this[_0x2de4('0x14')]=moment()[_0x2de4('0x15')](_0x2de4('0x16'));this[_0x2de4('0x17')]=utils[_0x2de4('0x18')](_0x4c6b57[_0x2de4('0x12')],_0x4c6b57[_0x2de4('0x19')]);this[_0x2de4('0x1a')]=utils[_0x2de4('0x18')](_0x4c6b57[_0x2de4('0x13')],_0x4c6b57[_0x2de4('0x12')]);this[_0x2de4('0x1b')]=utils[_0x2de4('0x18')](this[_0x2de4('0x14')],_0x4c6b57[_0x2de4('0x13')]);this[_0x2de4('0x1c')]=_0x262ebc['queue'];this[_0x2de4('0x1d')]=_0x262ebc[_0x2de4('0x1d')];this[_0x2de4('0x1e')]=_0x262ebc[_0x2de4('0x1e')];this[_0x2de4('0x1f')]=_0x4c6b57[_0x2de4('0x1f')];this[_0x2de4('0x20')]=_0x4c6b57[_0x2de4('0x20')];this['callbackat']=_0x4c6b57[_0x2de4('0x21')];this['recallme']=_0x4c6b57[_0x2de4('0x22')];this[_0x2de4('0x23')]=_0x4c6b57[_0x2de4('0x23')];this['ListId']=_0x4c6b57[_0x2de4('0x24')];this[_0x2de4('0x25')]=_0x4c6b57[_0x2de4('0x25')];this[_0x2de4('0x26')]=_0x4c6b57['VoiceQueueId'];this[_0x2de4('0x27')]=_0x4c6b57['CampaignId'];this['originatecalleridnum']=_0x4c6b57[_0x2de4('0x28')]||'';this[_0x2de4('0x29')]=_0x4c6b57['originatecalleridname']||'';this[_0x2de4('0x2a')]=_0x4c6b57['agiafterat'];}module[_0x2de4('0x2b')]=AgentComplete; \ No newline at end of file +var _0x98cc=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','format','ringtime','holdtime','getSeconds','answertime','talktime','endtime','membername','callback','callbackuniqueid'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x98cc,0x1a0));var _0xc98c=function(_0x48b724,_0x5a8e26){_0x48b724=_0x48b724-0x0;var _0x4d38b3=_0x98cc[_0x48b724];return _0x4d38b3;};'use strict';var moment=require(_0xc98c('0x0'));var utils=require(_0xc98c('0x1'));function AgentComplete(_0x3b2895,_0x5e268b){this[_0xc98c('0x2')]=0x4;this['statedesc']=_0xc98c('0x3');this[_0xc98c('0x4')]=_0x3b2895[_0xc98c('0x4')];this[_0xc98c('0x5')]=_0x3b2895[_0xc98c('0x5')];this[_0xc98c('0x6')]=_0x3b2895[_0xc98c('0x5')]===_0xc98c('0x7')?_0xc98c('0x8'):_0x3b2895[_0xc98c('0x5')];this[_0xc98c('0x9')]=_0x3b2895[_0xc98c('0x9')];this[_0xc98c('0xa')]=_0x3b2895[_0xc98c('0xa')];this[_0xc98c('0xb')]=_0x3b2895[_0xc98c('0xb')];this[_0xc98c('0xc')]=_0x3b2895[_0xc98c('0x9')]+_0x3b2895[_0xc98c('0xa')]+_0x3b2895[_0xc98c('0xb')]+_0x3b2895[_0xc98c('0xd')]+_0x3b2895[_0xc98c('0xe')]+_0x3b2895[_0xc98c('0xf')]+_0x3b2895[_0xc98c('0x10')]+_0x3b2895[_0xc98c('0x11')];this[_0xc98c('0xd')]=_0x3b2895['countnosuchnumberretry'];this[_0xc98c('0xe')]=_0x3b2895[_0xc98c('0xe')];this[_0xc98c('0xf')]=_0x3b2895[_0xc98c('0xf')];this[_0xc98c('0x10')]=_0x3b2895[_0xc98c('0x10')];this[_0xc98c('0x11')]=_0x3b2895[_0xc98c('0x11')];this[_0xc98c('0x12')]=_0x5e268b[_0xc98c('0x12')];this[_0xc98c('0x13')]=_0x3b2895[_0xc98c('0x14')];this['calleridnum']=_0x3b2895[_0xc98c('0x15')];this[_0xc98c('0x16')]=_0x3b2895['starttime'];this[_0xc98c('0x17')]=_0x3b2895['responsetime'];this['answertime']=_0x3b2895['answertime'];this['endtime']=moment()[_0xc98c('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc98c('0x19')]=utils['getSeconds'](_0x3b2895[_0xc98c('0x17')],_0x3b2895[_0xc98c('0x16')]);this[_0xc98c('0x1a')]=utils[_0xc98c('0x1b')](_0x3b2895[_0xc98c('0x1c')],_0x3b2895[_0xc98c('0x17')]);this[_0xc98c('0x1d')]=utils['getSeconds'](this[_0xc98c('0x1e')],_0x3b2895[_0xc98c('0x1c')]);this[_0xc98c('0x8')]=_0x5e268b[_0xc98c('0x8')];this['membername']=_0x5e268b[_0xc98c('0x1f')];this['reason']=_0x5e268b['reason'];this[_0xc98c('0x20')]=_0x3b2895[_0xc98c('0x20')];this[_0xc98c('0x21')]=_0x3b2895[_0xc98c('0x21')];this['callbackat']=_0x3b2895[_0xc98c('0x22')];this['recallme']=_0x3b2895[_0xc98c('0x23')];this[_0xc98c('0x24')]=_0x3b2895[_0xc98c('0x24')];this[_0xc98c('0x25')]=_0x3b2895[_0xc98c('0x25')];this[_0xc98c('0x26')]=_0x3b2895[_0xc98c('0x26')];this[_0xc98c('0x27')]=_0x3b2895[_0xc98c('0x27')];this[_0xc98c('0x28')]=_0x3b2895[_0xc98c('0x28')];this['originatecalleridnum']=_0x3b2895[_0xc98c('0x29')]||'';this[_0xc98c('0x2a')]=_0x3b2895['originatecalleridname']||'';this[_0xc98c('0x2b')]=_0x3b2895['agiafterat'];}module[_0xc98c('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index c34707a..a919bf1 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80f2=['outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype'];(function(_0x22d0ee,_0x253a7a){var _0x566cf6=function(_0x5378d8){while(--_0x5378d8){_0x22d0ee['push'](_0x22d0ee['shift']());}};_0x566cf6(++_0x253a7a);}(_0x80f2,0x1ac));var _0x280f=function(_0x5902a3,_0x3219ee){_0x5902a3=_0x5902a3-0x0;var _0x3c68cc=_0x80f2[_0x5902a3];return _0x3c68cc;};'use strict';function Final(_0x6a286){this[_0x280f('0x0')]=_0x6a286[_0x280f('0x0')];this['scheduledat']=_0x6a286[_0x280f('0x1')];this[_0x280f('0x2')]=_0x6a286[_0x280f('0x2')];this[_0x280f('0x3')]=_0x6a286[_0x280f('0x2')]===_0x280f('0x4')?_0x280f('0x5'):_0x6a286[_0x280f('0x2')];this['countbusyretry']=_0x6a286[_0x280f('0x6')];this['countcongestionretry']=_0x6a286['countcongestionretry'];this[_0x280f('0x7')]=_0x6a286[_0x280f('0x7')];this[_0x280f('0x8')]=_0x6a286[_0x280f('0x6')]+_0x6a286[_0x280f('0x9')]+_0x6a286[_0x280f('0x7')]+_0x6a286[_0x280f('0xa')]+_0x6a286['countdropretry']+_0x6a286[_0x280f('0xb')]+_0x6a286[_0x280f('0xc')]+_0x6a286[_0x280f('0xd')];this['countnosuchnumberretry']=_0x6a286[_0x280f('0xa')];this[_0x280f('0xe')]=_0x6a286[_0x280f('0xe')];this[_0x280f('0xb')]=_0x6a286[_0x280f('0xb')];this[_0x280f('0xc')]=_0x6a286[_0x280f('0xc')];this[_0x280f('0xd')]=_0x6a286[_0x280f('0xd')];this['queue']=_0x6a286[_0x280f('0x5')];this[_0x280f('0xf')]=_0x6a286[_0x280f('0xf')];this[_0x280f('0x10')]=_0x6a286[_0x280f('0x10')];this[_0x280f('0x11')]=_0x6a286[_0x280f('0x11')];this[_0x280f('0x12')]=_0x6a286['responsetime'];this[_0x280f('0x13')]=_0x6a286['responsetime'];this[_0x280f('0x14')]=_0x6a286[_0x280f('0x14')]||0x0;this[_0x280f('0x15')]=_0x6a286['holdtime']||0x0;this[_0x280f('0x16')]=_0x6a286[_0x280f('0x16')]||0x0;this[_0x280f('0x17')]=_0x6a286[_0x280f('0x17')];this[_0x280f('0x18')]=_0x6a286[_0x280f('0x18')];this[_0x280f('0x19')]=_0x6a286[_0x280f('0x19')];this[_0x280f('0x1a')]=_0x6a286['recallme'];this['ContactId']=_0x6a286[_0x280f('0x1b')];this['ListId']=_0x6a286['ListId'];this[_0x280f('0x1c')]=_0x6a286['UserId'];this[_0x280f('0x1d')]=_0x6a286[_0x280f('0x1d')];this[_0x280f('0x1e')]=_0x6a286['CampaignId'];this[_0x280f('0x1f')]=_0x6a286[_0x280f('0x1f')]||'';this[_0x280f('0x20')]=_0x6a286[_0x280f('0x20')]||'';this[_0x280f('0x21')]=_0x6a286[_0x280f('0x21')];this[_0x280f('0x22')]=_0x6a286[_0x280f('0x22')];}module[_0x280f('0x23')]=Final; \ No newline at end of file +var _0x50f7=['countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x50f7,0x1a5));var _0x750f=function(_0x8850fa,_0x488ebe){_0x8850fa=_0x8850fa-0x0;var _0x31ef8f=_0x50f7[_0x8850fa];return _0x31ef8f;};'use strict';function Final(_0x5c6724){this[_0x750f('0x0')]=_0x5c6724[_0x750f('0x0')];this[_0x750f('0x1')]=_0x5c6724['scheduledat'];this[_0x750f('0x2')]=_0x5c6724[_0x750f('0x2')];this[_0x750f('0x3')]=_0x5c6724['type']===_0x750f('0x4')?'queue':_0x5c6724[_0x750f('0x2')];this[_0x750f('0x5')]=_0x5c6724[_0x750f('0x5')];this[_0x750f('0x6')]=_0x5c6724['countcongestionretry'];this[_0x750f('0x7')]=_0x5c6724[_0x750f('0x7')];this['countglobal']=_0x5c6724[_0x750f('0x5')]+_0x5c6724[_0x750f('0x6')]+_0x5c6724[_0x750f('0x7')]+_0x5c6724[_0x750f('0x8')]+_0x5c6724['countdropretry']+_0x5c6724[_0x750f('0x9')]+_0x5c6724['countmachineretry']+_0x5c6724['countagentrejectretry'];this[_0x750f('0x8')]=_0x5c6724[_0x750f('0x8')];this[_0x750f('0xa')]=_0x5c6724[_0x750f('0xa')];this[_0x750f('0x9')]=_0x5c6724[_0x750f('0x9')];this[_0x750f('0xb')]=_0x5c6724[_0x750f('0xb')];this[_0x750f('0xc')]=_0x5c6724[_0x750f('0xc')];this[_0x750f('0xd')]=_0x5c6724['queue'];this[_0x750f('0xe')]=_0x5c6724['calleridname'];this[_0x750f('0xf')]=_0x5c6724[_0x750f('0xf')];this[_0x750f('0x10')]=_0x5c6724['starttime'];this[_0x750f('0x11')]=_0x5c6724['responsetime'];this['endtime']=_0x5c6724[_0x750f('0x11')];this[_0x750f('0x12')]=_0x5c6724[_0x750f('0x12')]||0x0;this['holdtime']=_0x5c6724[_0x750f('0x13')]||0x0;this[_0x750f('0x14')]=_0x5c6724[_0x750f('0x14')]||0x0;this['callback']=_0x5c6724[_0x750f('0x15')];this[_0x750f('0x16')]=_0x5c6724[_0x750f('0x16')];this[_0x750f('0x17')]=_0x5c6724[_0x750f('0x17')];this['recallme']=_0x5c6724[_0x750f('0x18')];this['ContactId']=_0x5c6724[_0x750f('0x19')];this[_0x750f('0x1a')]=_0x5c6724['ListId'];this['UserId']=_0x5c6724[_0x750f('0x1b')];this['VoiceQueueId']=_0x5c6724[_0x750f('0x1c')];this[_0x750f('0x1d')]=_0x5c6724[_0x750f('0x1d')];this['originatecalleridnum']=_0x5c6724['originatecalleridnum']||'';this[_0x750f('0x1e')]=_0x5c6724[_0x750f('0x1e')]||'';this[_0x750f('0x1f')]=_0x5c6724[_0x750f('0x1f')];this[_0x750f('0x20')]=_0x5c6724[_0x750f('0x20')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 6d0494f..4ab6382 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bc3=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','scheduledat','type','queue','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','IVR'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x9bc3,0xe2));var _0x39bc=function(_0x3d6135,_0x256136){_0x3d6135=_0x3d6135-0x0;var _0x16f3c1=_0x9bc3[_0x3d6135];return _0x16f3c1;};'use strict';var moment=require(_0x39bc('0x0'));var utils=require(_0x39bc('0x1'));function Hangup(_0xe623f0,_0x322f0c){this[_0x39bc('0x2')]=0x4;this['statedesc']='Answer';this[_0x39bc('0x3')]=_0xe623f0[_0x39bc('0x3')];this[_0x39bc('0x4')]=_0xe623f0[_0x39bc('0x4')];this['campaigntype']=_0xe623f0[_0x39bc('0x4')]==='outbound'?_0x39bc('0x5'):_0xe623f0[_0x39bc('0x4')];this[_0x39bc('0x6')]=_0xe623f0[_0x39bc('0x6')]||![];this[_0x39bc('0x7')]=_0xe623f0['countbusyretry'];this['countcongestionretry']=_0xe623f0['countcongestionretry'];this[_0x39bc('0x8')]=_0xe623f0[_0x39bc('0x8')];this[_0x39bc('0x9')]=_0xe623f0['countbusyretry']+_0xe623f0[_0x39bc('0xa')]+_0xe623f0[_0x39bc('0x8')]+_0xe623f0[_0x39bc('0xb')]+_0xe623f0[_0x39bc('0xc')]+_0xe623f0[_0x39bc('0xd')]+_0xe623f0[_0x39bc('0xe')]+_0xe623f0[_0x39bc('0xf')];this[_0x39bc('0xb')]=_0xe623f0[_0x39bc('0xb')];this[_0x39bc('0xc')]=_0xe623f0[_0x39bc('0xc')];this[_0x39bc('0xd')]=_0xe623f0[_0x39bc('0xd')];this['countmachineretry']=_0xe623f0[_0x39bc('0xe')];this['countagentrejectretry']=_0xe623f0['countagentrejectretry'];this[_0x39bc('0x10')]=_0x322f0c[_0x39bc('0x10')];this[_0x39bc('0x11')]=_0xe623f0[_0x39bc('0x12')];this[_0x39bc('0x13')]=_0xe623f0[_0x39bc('0x14')];this[_0x39bc('0x15')]=_0xe623f0[_0x39bc('0x15')];this[_0x39bc('0x16')]=_0xe623f0[_0x39bc('0x16')];this['endtime']=moment()[_0x39bc('0x17')](_0x39bc('0x18'));this[_0x39bc('0x19')]=utils[_0x39bc('0x1a')](_0xe623f0[_0x39bc('0x16')],_0xe623f0[_0x39bc('0x15')]);this[_0x39bc('0x1b')]=0x0;this[_0x39bc('0x1c')]=utils['getSeconds'](this[_0x39bc('0x1d')],_0xe623f0['responsetime']);this[_0x39bc('0x5')]=_0xe623f0[_0x39bc('0x5')];this[_0x39bc('0x1e')]=_0x39bc('0x1f');this['reason']=_0x322f0c[_0x39bc('0x20')];this[_0x39bc('0x21')]=_0xe623f0[_0x39bc('0x21')];this[_0x39bc('0x22')]=_0xe623f0[_0x39bc('0x22')];this['callbackat']=_0xe623f0[_0x39bc('0x23')];this[_0x39bc('0x24')]=_0xe623f0[_0x39bc('0x24')];this['ContactId']=_0xe623f0[_0x39bc('0x25')];this[_0x39bc('0x26')]=_0xe623f0['ListId'];this['UserId']=_0xe623f0[_0x39bc('0x27')];this[_0x39bc('0x28')]=_0xe623f0[_0x39bc('0x28')];this[_0x39bc('0x29')]=_0xe623f0[_0x39bc('0x29')];}module[_0x39bc('0x2a')]=Hangup; \ No newline at end of file +var _0x8515=['membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','queue'];(function(_0x3bf4f0,_0x316456){var _0x2c6a5c=function(_0x412cf){while(--_0x412cf){_0x3bf4f0['push'](_0x3bf4f0['shift']());}};_0x2c6a5c(++_0x316456);}(_0x8515,0x95));var _0x5851=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x8515[_0x172ed7];return _0xfa8f61;};'use strict';var moment=require(_0x5851('0x0'));var utils=require(_0x5851('0x1'));function Hangup(_0x3ee09f,_0x5e2910){this['state']=0x4;this[_0x5851('0x2')]=_0x5851('0x3');this[_0x5851('0x4')]=_0x3ee09f['scheduledat'];this[_0x5851('0x5')]=_0x3ee09f[_0x5851('0x5')];this[_0x5851('0x6')]=_0x3ee09f[_0x5851('0x5')]===_0x5851('0x7')?'queue':_0x3ee09f[_0x5851('0x5')];this['amd']=_0x3ee09f[_0x5851('0x8')]||![];this[_0x5851('0x9')]=_0x3ee09f[_0x5851('0x9')];this['countcongestionretry']=_0x3ee09f[_0x5851('0xa')];this['countnoanswerretry']=_0x3ee09f[_0x5851('0xb')];this[_0x5851('0xc')]=_0x3ee09f[_0x5851('0x9')]+_0x3ee09f[_0x5851('0xa')]+_0x3ee09f[_0x5851('0xb')]+_0x3ee09f['countnosuchnumberretry']+_0x3ee09f[_0x5851('0xd')]+_0x3ee09f['countabandonedretry']+_0x3ee09f[_0x5851('0xe')]+_0x3ee09f[_0x5851('0xf')];this[_0x5851('0x10')]=_0x3ee09f['countnosuchnumberretry'];this['countdropretry']=_0x3ee09f[_0x5851('0xd')];this[_0x5851('0x11')]=_0x3ee09f[_0x5851('0x11')];this[_0x5851('0xe')]=_0x3ee09f[_0x5851('0xe')];this[_0x5851('0xf')]=_0x3ee09f[_0x5851('0xf')];this[_0x5851('0x12')]=_0x5e2910[_0x5851('0x12')];this[_0x5851('0x13')]=_0x3ee09f['name'];this[_0x5851('0x14')]=_0x3ee09f[_0x5851('0x15')];this['starttime']=_0x3ee09f[_0x5851('0x16')];this[_0x5851('0x17')]=_0x3ee09f[_0x5851('0x17')];this[_0x5851('0x18')]=moment()[_0x5851('0x19')](_0x5851('0x1a'));this['ringtime']=utils[_0x5851('0x1b')](_0x3ee09f[_0x5851('0x17')],_0x3ee09f[_0x5851('0x16')]);this[_0x5851('0x1c')]=0x0;this[_0x5851('0x1d')]=utils['getSeconds'](this[_0x5851('0x18')],_0x3ee09f[_0x5851('0x17')]);this[_0x5851('0x1e')]=_0x3ee09f[_0x5851('0x1e')];this[_0x5851('0x1f')]=_0x5851('0x20');this[_0x5851('0x21')]=_0x5e2910[_0x5851('0x22')];this[_0x5851('0x23')]=_0x3ee09f[_0x5851('0x23')];this[_0x5851('0x24')]=_0x3ee09f[_0x5851('0x24')];this['callbackat']=_0x3ee09f[_0x5851('0x25')];this[_0x5851('0x26')]=_0x3ee09f[_0x5851('0x26')];this['ContactId']=_0x3ee09f[_0x5851('0x27')];this[_0x5851('0x28')]=_0x3ee09f[_0x5851('0x28')];this[_0x5851('0x29')]=_0x3ee09f['UserId'];this['VoiceQueueId']=_0x3ee09f[_0x5851('0x2a')];this[_0x5851('0x2b')]=_0x3ee09f[_0x5851('0x2b')];}module[_0x5851('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 977cd5e..e2f4fa8 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb33=['uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','queue','name','calleridnum','number','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils'];(function(_0x512c45,_0x36f294){var _0x53de78=function(_0x4382b7){while(--_0x4382b7){_0x512c45['push'](_0x512c45['shift']());}};_0x53de78(++_0x36f294);}(_0xcb33,0x1e0));var _0x3cb3=function(_0x5b4f00,_0x473dee){_0x5b4f00=_0x5b4f00-0x0;var _0x2fbd88=_0xcb33[_0x5b4f00];return _0x2fbd88;};'use strict';var utils=require(_0x3cb3('0x0'));function History(_0x8a6642){this[_0x3cb3('0x1')]=_0x8a6642['uniqueid'];this[_0x3cb3('0x2')]=_0x8a6642[_0x3cb3('0x2')]||undefined;this[_0x3cb3('0x3')]=_0x8a6642[_0x3cb3('0x3')];this[_0x3cb3('0x4')]=_0x8a6642[_0x3cb3('0x3')]==='outbound'?'queue':_0x8a6642[_0x3cb3('0x3')];this['countbusyretry']=_0x8a6642[_0x3cb3('0x5')];this[_0x3cb3('0x6')]=_0x8a6642[_0x3cb3('0x6')];this[_0x3cb3('0x7')]=_0x8a6642[_0x3cb3('0x7')];this[_0x3cb3('0x8')]=_0x8a6642[_0x3cb3('0x5')]+_0x8a6642[_0x3cb3('0x6')]+_0x8a6642[_0x3cb3('0x7')]+_0x8a6642[_0x3cb3('0x9')]+_0x8a6642[_0x3cb3('0xa')]+_0x8a6642['countabandonedretry']+_0x8a6642['countmachineretry']+_0x8a6642[_0x3cb3('0xb')];this[_0x3cb3('0x9')]=_0x8a6642['countnosuchnumberretry'];this[_0x3cb3('0xa')]=_0x8a6642[_0x3cb3('0xa')];this[_0x3cb3('0xc')]=_0x8a6642[_0x3cb3('0xc')];this[_0x3cb3('0xd')]=_0x8a6642[_0x3cb3('0xd')];this[_0x3cb3('0xb')]=_0x8a6642[_0x3cb3('0xb')];this[_0x3cb3('0xe')]=_0x8a6642[_0x3cb3('0xe')];this['calleridname']=_0x8a6642[_0x3cb3('0xf')];this[_0x3cb3('0x10')]=_0x8a6642[_0x3cb3('0x11')];this[_0x3cb3('0x12')]=_0x8a6642[_0x3cb3('0x12')];this['responsetime']=_0x8a6642[_0x3cb3('0x13')];this['endtime']=_0x8a6642['responsetime'];this[_0x3cb3('0x14')]=utils[_0x3cb3('0x15')](_0x8a6642[_0x3cb3('0x13')],_0x8a6642[_0x3cb3('0x12')]);this[_0x3cb3('0x16')]=0x0;this[_0x3cb3('0x17')]=0x0;this[_0x3cb3('0x18')]=_0x8a6642[_0x3cb3('0x18')];this[_0x3cb3('0x19')]=_0x8a6642[_0x3cb3('0x19')];this[_0x3cb3('0x1a')]=_0x8a6642[_0x3cb3('0x1a')];this[_0x3cb3('0x1b')]=_0x8a6642['recallme'];this['ContactId']=_0x8a6642['ContactId'];this['ListId']=_0x8a6642[_0x3cb3('0x1c')];this[_0x3cb3('0x1d')]=_0x8a6642[_0x3cb3('0x1d')];this[_0x3cb3('0x1e')]=_0x8a6642[_0x3cb3('0x1e')];this[_0x3cb3('0x1f')]=_0x8a6642['CampaignId'];this[_0x3cb3('0x20')]=_0x8a6642['originatecalleridnum']||'';this[_0x3cb3('0x21')]=_0x8a6642[_0x3cb3('0x21')]||'';this[_0x3cb3('0x22')]=_0x8a6642[_0x3cb3('0x22')];this['statedesc']=_0x8a6642[_0x3cb3('0x23')];}module[_0x3cb3('0x24')]=History; \ No newline at end of file +var _0xe300=['number','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','uniqueid','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','name','calleridnum'];(function(_0x313fbe,_0x49e818){var _0x143e80=function(_0x29bfb7){while(--_0x29bfb7){_0x313fbe['push'](_0x313fbe['shift']());}};_0x143e80(++_0x49e818);}(_0xe300,0xdf));var _0x0e30=function(_0x126f2e,_0x52c090){_0x126f2e=_0x126f2e-0x0;var _0x1d68a0=_0xe300[_0x126f2e];return _0x1d68a0;};'use strict';var utils=require('../utils');function History(_0x2a155e){this[_0x0e30('0x0')]=_0x2a155e[_0x0e30('0x0')];this['scheduledat']=_0x2a155e['scheduledat']||undefined;this[_0x0e30('0x1')]=_0x2a155e[_0x0e30('0x1')];this[_0x0e30('0x2')]=_0x2a155e['type']===_0x0e30('0x3')?_0x0e30('0x4'):_0x2a155e['type'];this['countbusyretry']=_0x2a155e['countbusyretry'];this['countcongestionretry']=_0x2a155e[_0x0e30('0x5')];this['countnoanswerretry']=_0x2a155e[_0x0e30('0x6')];this[_0x0e30('0x7')]=_0x2a155e['countbusyretry']+_0x2a155e[_0x0e30('0x5')]+_0x2a155e[_0x0e30('0x6')]+_0x2a155e[_0x0e30('0x8')]+_0x2a155e['countdropretry']+_0x2a155e[_0x0e30('0x9')]+_0x2a155e['countmachineretry']+_0x2a155e[_0x0e30('0xa')];this[_0x0e30('0x8')]=_0x2a155e[_0x0e30('0x8')];this[_0x0e30('0xb')]=_0x2a155e[_0x0e30('0xb')];this[_0x0e30('0x9')]=_0x2a155e['countabandonedretry'];this[_0x0e30('0xc')]=_0x2a155e[_0x0e30('0xc')];this[_0x0e30('0xa')]=_0x2a155e[_0x0e30('0xa')];this['queue']=_0x2a155e[_0x0e30('0x4')];this['calleridname']=_0x2a155e[_0x0e30('0xd')];this[_0x0e30('0xe')]=_0x2a155e[_0x0e30('0xf')];this[_0x0e30('0x10')]=_0x2a155e['starttime'];this[_0x0e30('0x11')]=_0x2a155e[_0x0e30('0x11')];this['endtime']=_0x2a155e[_0x0e30('0x11')];this[_0x0e30('0x12')]=utils[_0x0e30('0x13')](_0x2a155e['responsetime'],_0x2a155e['starttime']);this[_0x0e30('0x14')]=0x0;this[_0x0e30('0x15')]=0x0;this[_0x0e30('0x16')]=_0x2a155e[_0x0e30('0x16')];this[_0x0e30('0x17')]=_0x2a155e[_0x0e30('0x17')];this[_0x0e30('0x18')]=_0x2a155e[_0x0e30('0x18')];this[_0x0e30('0x19')]=_0x2a155e[_0x0e30('0x19')];this['ContactId']=_0x2a155e['ContactId'];this['ListId']=_0x2a155e[_0x0e30('0x1a')];this[_0x0e30('0x1b')]=_0x2a155e[_0x0e30('0x1b')];this[_0x0e30('0x1c')]=_0x2a155e[_0x0e30('0x1c')];this[_0x0e30('0x1d')]=_0x2a155e[_0x0e30('0x1d')];this[_0x0e30('0x1e')]=_0x2a155e['originatecalleridnum']||'';this['originatecalleridname']=_0x2a155e['originatecalleridname']||'';this[_0x0e30('0x1f')]=_0x2a155e[_0x0e30('0x1f')];this[_0x0e30('0x20')]=_0x2a155e[_0x0e30('0x20')];}module[_0x0e30('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index c3ba7e6..5a5863a 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16be=['originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x20db6c,_0x4ff24a){var _0x30b5d3=function(_0x1ba9f0){while(--_0x1ba9f0){_0x20db6c['push'](_0x20db6c['shift']());}};_0x30b5d3(++_0x4ff24a);}(_0x16be,0x15c));var _0xe16b=function(_0x4783c0,_0x3276cc){_0x4783c0=_0x4783c0-0x0;var _0x2d547e=_0x16be[_0x4783c0];return _0x2d547e;};'use strict';var utils=require(_0xe16b('0x0'));function QueueCallerAbandon(_0x3e83a2,_0x3ee61f){this[_0xe16b('0x1')]=_0x3e83a2[_0xe16b('0x1')];this[_0xe16b('0x2')]=_0x3e83a2[_0xe16b('0x2')];this[_0xe16b('0x3')]=_0x3e83a2['type']===_0xe16b('0x4')?_0xe16b('0x5'):_0x3e83a2[_0xe16b('0x2')];this[_0xe16b('0x6')]=_0x3e83a2[_0xe16b('0x6')];this[_0xe16b('0x7')]=_0x3e83a2[_0xe16b('0x7')];this[_0xe16b('0x8')]=_0x3e83a2[_0xe16b('0x8')];this[_0xe16b('0x9')]=_0x3e83a2[_0xe16b('0x6')]+_0x3e83a2[_0xe16b('0x7')]+_0x3e83a2[_0xe16b('0x8')]+_0x3e83a2['countnosuchnumberretry']+_0x3e83a2[_0xe16b('0xa')]+_0x3e83a2['countabandonedretry']+_0x3e83a2[_0xe16b('0xb')]+_0x3e83a2[_0xe16b('0xc')];this[_0xe16b('0xd')]=_0x3e83a2['countnosuchnumberretry'];this[_0xe16b('0xa')]=_0x3e83a2[_0xe16b('0xa')];this[_0xe16b('0xe')]=_0x3e83a2[_0xe16b('0xe')];this['countmachineretry']=_0x3e83a2[_0xe16b('0xb')];this[_0xe16b('0xc')]=_0x3e83a2[_0xe16b('0xc')];this[_0xe16b('0xf')]=_0x3ee61f[_0xe16b('0xf')];this[_0xe16b('0x10')]=_0x3e83a2[_0xe16b('0x11')];this['calleridnum']=_0x3e83a2[_0xe16b('0x12')];this[_0xe16b('0x13')]=_0x3e83a2[_0xe16b('0x13')];this[_0xe16b('0x14')]=_0x3e83a2[_0xe16b('0x14')];this['droptime']=_0x3e83a2[_0xe16b('0x15')];this['dropreason']=_0x3e83a2[_0xe16b('0x16')];this[_0xe16b('0x17')]=this[_0xe16b('0x15')];this[_0xe16b('0x18')]=utils[_0xe16b('0x19')](_0x3e83a2['responsetime'],_0x3e83a2['starttime']);this[_0xe16b('0x1a')]=utils[_0xe16b('0x19')](this[_0xe16b('0x15')],_0x3e83a2['responsetime']);this['talktime']=0x0;this[_0xe16b('0x5')]=_0x3ee61f[_0xe16b('0x5')];this[_0xe16b('0x1b')]=_0x3ee61f[_0xe16b('0x1c')];this[_0xe16b('0x1d')]=_0x3ee61f['reason'];this[_0xe16b('0x1e')]=_0x3e83a2[_0xe16b('0x1e')];this[_0xe16b('0x1f')]=_0x3e83a2[_0xe16b('0x1f')];this[_0xe16b('0x20')]=_0x3e83a2[_0xe16b('0x20')];this[_0xe16b('0x21')]=_0x3e83a2['recallme'];this['ContactId']=_0x3e83a2['ContactId'];this[_0xe16b('0x22')]=_0x3e83a2[_0xe16b('0x22')];this[_0xe16b('0x23')]=_0x3e83a2[_0xe16b('0x23')];this[_0xe16b('0x24')]=_0x3e83a2[_0xe16b('0x24')];this['CampaignId']=_0x3e83a2[_0xe16b('0x25')];this[_0xe16b('0x26')]=_0x3e83a2[_0xe16b('0x26')]||'';this[_0xe16b('0x27')]=_0x3e83a2[_0xe16b('0x27')]||'';this['agiafterat']=_0x3e83a2['agiafterat'];this[_0xe16b('0x28')]=_0x3e83a2[_0xe16b('0x28')];this[_0xe16b('0x29')]=_0x3e83a2['statedesc'];}module[_0xe16b('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x0c7b=['CampaignId','originatecalleridnum','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x21fdc8,_0x644c4d){var _0x719c94=function(_0x8d1fca){while(--_0x8d1fca){_0x21fdc8['push'](_0x21fdc8['shift']());}};_0x719c94(++_0x644c4d);}(_0x0c7b,0x156));var _0xb0c7=function(_0x1e1f85,_0x2711e3){_0x1e1f85=_0x1e1f85-0x0;var _0x2ebda7=_0x0c7b[_0x1e1f85];return _0x2ebda7;};'use strict';var utils=require(_0xb0c7('0x0'));function QueueCallerAbandon(_0x46e2be,_0x1fb962){this[_0xb0c7('0x1')]=_0x46e2be[_0xb0c7('0x1')];this[_0xb0c7('0x2')]=_0x46e2be[_0xb0c7('0x2')];this[_0xb0c7('0x3')]=_0x46e2be[_0xb0c7('0x2')]==='outbound'?_0xb0c7('0x4'):_0x46e2be['type'];this['countbusyretry']=_0x46e2be['countbusyretry'];this['countcongestionretry']=_0x46e2be[_0xb0c7('0x5')];this[_0xb0c7('0x6')]=_0x46e2be[_0xb0c7('0x6')];this[_0xb0c7('0x7')]=_0x46e2be[_0xb0c7('0x8')]+_0x46e2be['countcongestionretry']+_0x46e2be[_0xb0c7('0x6')]+_0x46e2be['countnosuchnumberretry']+_0x46e2be[_0xb0c7('0x9')]+_0x46e2be[_0xb0c7('0xa')]+_0x46e2be['countmachineretry']+_0x46e2be[_0xb0c7('0xb')];this[_0xb0c7('0xc')]=_0x46e2be[_0xb0c7('0xc')];this[_0xb0c7('0x9')]=_0x46e2be['countdropretry'];this['countabandonedretry']=_0x46e2be[_0xb0c7('0xa')];this['countmachineretry']=_0x46e2be[_0xb0c7('0xd')];this['countagentrejectretry']=_0x46e2be[_0xb0c7('0xb')];this[_0xb0c7('0xe')]=_0x1fb962[_0xb0c7('0xe')];this[_0xb0c7('0xf')]=_0x46e2be[_0xb0c7('0x10')];this['calleridnum']=_0x46e2be[_0xb0c7('0x11')];this[_0xb0c7('0x12')]=_0x46e2be[_0xb0c7('0x12')];this[_0xb0c7('0x13')]=_0x46e2be[_0xb0c7('0x13')];this[_0xb0c7('0x14')]=_0x46e2be['droptime'];this[_0xb0c7('0x15')]=_0x46e2be[_0xb0c7('0x15')];this[_0xb0c7('0x16')]=this[_0xb0c7('0x14')];this[_0xb0c7('0x17')]=utils[_0xb0c7('0x18')](_0x46e2be['responsetime'],_0x46e2be['starttime']);this[_0xb0c7('0x19')]=utils[_0xb0c7('0x18')](this[_0xb0c7('0x14')],_0x46e2be[_0xb0c7('0x13')]);this[_0xb0c7('0x1a')]=0x0;this['queue']=_0x1fb962[_0xb0c7('0x4')];this[_0xb0c7('0x1b')]=_0x1fb962['connectedlinename'];this[_0xb0c7('0x1c')]=_0x1fb962['reason'];this[_0xb0c7('0x1d')]=_0x46e2be[_0xb0c7('0x1d')];this[_0xb0c7('0x1e')]=_0x46e2be[_0xb0c7('0x1e')];this['callbackat']=_0x46e2be['callbackat'];this[_0xb0c7('0x1f')]=_0x46e2be[_0xb0c7('0x1f')];this[_0xb0c7('0x20')]=_0x46e2be[_0xb0c7('0x20')];this[_0xb0c7('0x21')]=_0x46e2be['ListId'];this[_0xb0c7('0x22')]=_0x46e2be[_0xb0c7('0x22')];this[_0xb0c7('0x23')]=_0x46e2be[_0xb0c7('0x23')];this[_0xb0c7('0x24')]=_0x46e2be['CampaignId'];this['originatecalleridnum']=_0x46e2be[_0xb0c7('0x25')]||'';this['originatecalleridname']=_0x46e2be['originatecalleridname']||'';this[_0xb0c7('0x26')]=_0x46e2be[_0xb0c7('0x26')];this['state']=_0x46e2be[_0xb0c7('0x27')];this[_0xb0c7('0x28')]=_0x46e2be[_0xb0c7('0x28')];}module[_0xb0c7('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 03954b8..ad2d441 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8fb=['[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','inspect','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialerIvr','temp','countReScheduled','[countReScheduled]','rescheduleContact','catch','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime'];(function(_0x21ed96,_0x5ec9d0){var _0x18b7f0=function(_0x2e2366){while(--_0x2e2366){_0x21ed96['push'](_0x21ed96['shift']());}};_0x18b7f0(++_0x5ec9d0);}(_0xd8fb,0x99));var _0xbd8f=function(_0x26b50e,_0x4d944d){_0x26b50e=_0x26b50e-0x0;var _0xa1b48d=_0xd8fb[_0x26b50e];return _0xa1b48d;};'use strict';var util=require(_0xbd8f('0x0'));var logger=require(_0xbd8f('0x1'))(_0xbd8f('0x2'));var cmHopper=require(_0xbd8f('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x455a12){return util[_0xbd8f('0x4')](_0x455a12,{'showHidden':![],'depth':null});}function getContactDialer(_0x53cccc,_0x400dfb,_0x2343bf){return cmHopper['getContactDialer'](_0x53cccc['id'],_0x400dfb,_0x2343bf,_0x53cccc[_0xbd8f('0x5')])['catch'](function(_0xf503c4){_0x53cccc['temp']=0x0;logger[_0xbd8f('0x6')](_0xbd8f('0x7'),inspectError(_0xf503c4));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x5697bd,_0x3caa93){return cmHopper[_0xbd8f('0x8')](_0x5697bd['id'],_0x3caa93,_0x5697bd[_0xbd8f('0x5')])['catch'](function(_0x255af3){_0x5697bd[_0xbd8f('0x9')]=0x0;logger['error']('[getContactDialerIvr]',inspectError(_0x255af3));});}exports[_0xbd8f('0x8')]=getContactDialerIvr;function countReScheduled(_0x40a5bc){return cmHopper[_0xbd8f('0xa')](_0x40a5bc)['catch'](function(_0x230988){logger[_0xbd8f('0x6')](_0xbd8f('0xb'),inspectError(_0x230988));});}exports[_0xbd8f('0xa')]=countReScheduled;function rescheduleContact(_0x8bc054){return cmHopper[_0xbd8f('0xc')](_0x8bc054)[_0xbd8f('0xd')](function(_0x29ffe8){logger[_0xbd8f('0x6')]('[rescheduleContact]',inspectError(_0x29ffe8));});}exports[_0xbd8f('0xc')]=rescheduleContact;function unlockContact(_0x829fb2,_0xa57e91,_0x10d72e){return cmHopper['unlockContact'](_0x829fb2,_0xa57e91,_0x10d72e)[_0xbd8f('0xd')](function(_0x63db18){logger['error'](_0xbd8f('0xe'),inspectError(_0x63db18));});}exports[_0xbd8f('0xf')]=unlockContact;function moveContactManagedDialer(_0x504adb){return cmHopper[_0xbd8f('0x10')](_0x504adb)[_0xbd8f('0xd')](function(_0x47d317){logger['error'](_0xbd8f('0x11'),inspectError(_0x47d317));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x5705c5){return cmHopperBlack[_0xbd8f('0x12')](_0x5705c5)['catch'](function(_0xd706bc){logger[_0xbd8f('0x6')](_0xbd8f('0x13'),inspectError(_0xd706bc));});}exports[_0xbd8f('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0xdc11cc){return cmHopperBlack[_0xbd8f('0x14')](_0xdc11cc)[_0xbd8f('0xd')](function(_0x90eff8){logger[_0xbd8f('0x6')](_0xbd8f('0x15'),inspectError(_0x90eff8));});}exports[_0xbd8f('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1628f5,_0x2f7c45,_0x15c4a9){return cmHopperAdditionalPhone[_0xbd8f('0x16')](_0x1628f5,_0x2f7c45,_0x15c4a9)[_0xbd8f('0xd')](function(_0x395b1b){logger['error'](_0xbd8f('0x17'),inspectError(_0x395b1b));});}exports[_0xbd8f('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x1f9fcc,_0x2f3df7,_0xa88414){return cmHopperAdditionalPhone[_0xbd8f('0x18')](_0x1f9fcc,_0x2f3df7,_0xa88414)[_0xbd8f('0xd')](function(_0x264e62){logger['error'](_0xbd8f('0x19'),inspectError(_0x264e62));});}exports[_0xbd8f('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x5a3a8c){return cmHopperHistory[_0xbd8f('0x1a')](_0x5a3a8c)['catch'](function(_0x41b2a6){logger[_0xbd8f('0x6')](_0xbd8f('0x1b'),inspectError(_0x41b2a6));});}exports[_0xbd8f('0x1a')]=avgHandleTime;function createHistory(_0x2aefa2){return cmHopperHistory[_0xbd8f('0x1c')](_0x2aefa2)['catch'](function(_0x166de7){logger[_0xbd8f('0x6')](_0xbd8f('0x1d'),inspectError(_0x166de7));});}exports[_0xbd8f('0x1c')]=createHistory; \ No newline at end of file +var _0xd101=['createHistory','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]'];(function(_0x3a8fe5,_0x3194b5){var _0x525997=function(_0x5befef){while(--_0x5befef){_0x3a8fe5['push'](_0x3a8fe5['shift']());}};_0x525997(++_0x3194b5);}(_0xd101,0xc1));var _0x1d10=function(_0x17797f,_0x5d3b05){_0x17797f=_0x17797f-0x0;var _0x187a1f=_0xd101[_0x17797f];return _0x187a1f;};'use strict';var util=require(_0x1d10('0x0'));var logger=require('../../../../config/logger')(_0x1d10('0x1'));var cmHopper=require(_0x1d10('0x2'));var cmHopperAdditionalPhone=require(_0x1d10('0x3'));var cmHopperBlack=require(_0x1d10('0x4'));var cmHopperHistory=require(_0x1d10('0x5'));function inspectError(_0x25b425){return util[_0x1d10('0x6')](_0x25b425,{'showHidden':![],'depth':null});}function getContactDialer(_0x1e83e0,_0x5c5c42,_0x42b6d2){return cmHopper[_0x1d10('0x7')](_0x1e83e0['id'],_0x5c5c42,_0x42b6d2,_0x1e83e0[_0x1d10('0x8')])[_0x1d10('0x9')](function(_0xb9e08){_0x1e83e0[_0x1d10('0xa')]=0x0;logger[_0x1d10('0xb')](_0x1d10('0xc'),inspectError(_0xb9e08));});}exports[_0x1d10('0x7')]=getContactDialer;function getContactDialerIvr(_0x182c87,_0xf7926b){return cmHopper[_0x1d10('0xd')](_0x182c87['id'],_0xf7926b,_0x182c87[_0x1d10('0x8')])[_0x1d10('0x9')](function(_0x42efad){_0x182c87[_0x1d10('0xa')]=0x0;logger[_0x1d10('0xb')]('[getContactDialerIvr]',inspectError(_0x42efad));});}exports[_0x1d10('0xd')]=getContactDialerIvr;function countReScheduled(_0x93cb59){return cmHopper[_0x1d10('0xe')](_0x93cb59)[_0x1d10('0x9')](function(_0x268506){logger['error'](_0x1d10('0xf'),inspectError(_0x268506));});}exports[_0x1d10('0xe')]=countReScheduled;function rescheduleContact(_0x1a6586){return cmHopper[_0x1d10('0x10')](_0x1a6586)[_0x1d10('0x9')](function(_0x183bc4){logger['error'](_0x1d10('0x11'),inspectError(_0x183bc4));});}exports[_0x1d10('0x10')]=rescheduleContact;function unlockContact(_0x306953,_0x2ad3c0,_0x4f014a){return cmHopper[_0x1d10('0x12')](_0x306953,_0x2ad3c0,_0x4f014a)[_0x1d10('0x9')](function(_0x41152c){logger[_0x1d10('0xb')](_0x1d10('0x13'),inspectError(_0x41152c));});}exports[_0x1d10('0x12')]=unlockContact;function moveContactManagedDialer(_0x4528a6){return cmHopper['moveContactManagedDialer'](_0x4528a6)[_0x1d10('0x9')](function(_0x1163dd){logger[_0x1d10('0xb')](_0x1d10('0x14'),inspectError(_0x1163dd));});}exports[_0x1d10('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x5e61f8){return cmHopperBlack['checkIsBlackList'](_0x5e61f8)[_0x1d10('0x9')](function(_0x57ec1c){logger['error']('[checkIsBlackList]',inspectError(_0x57ec1c));});}exports[_0x1d10('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x2496bc){return cmHopperBlack[_0x1d10('0x17')](_0x2496bc)[_0x1d10('0x9')](function(_0x4ce84a){logger['error'](_0x1d10('0x18'),inspectError(_0x4ce84a));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x68b09,_0x474321,_0x160802){return cmHopperAdditionalPhone[_0x1d10('0x19')](_0x68b09,_0x474321,_0x160802)[_0x1d10('0x9')](function(_0x3601ba){logger[_0x1d10('0xb')](_0x1d10('0x1a'),inspectError(_0x3601ba));});}exports[_0x1d10('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x84055f,_0xf1e4c8,_0x5abc58){return cmHopperAdditionalPhone[_0x1d10('0x1b')](_0x84055f,_0xf1e4c8,_0x5abc58)[_0x1d10('0x9')](function(_0x475934){logger[_0x1d10('0xb')](_0x1d10('0x1c'),inspectError(_0x475934));});}exports[_0x1d10('0x1b')]=swapAdditionalPhones;function avgHandleTime(_0x38f583){return cmHopperHistory[_0x1d10('0x1d')](_0x38f583)['catch'](function(_0x355e10){logger[_0x1d10('0xb')]('[avgHandleTime]',inspectError(_0x355e10));});}exports[_0x1d10('0x1d')]=avgHandleTime;function createHistory(_0x52d514){return cmHopperHistory['createHistory'](_0x52d514)[_0x1d10('0x9')](function(_0x597aea){logger[_0x1d10('0xb')](_0x1d10('0x1e'),inspectError(_0x597aea));});}exports[_0x1d10('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 25c24ed..4d557ed 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61e3=['%s%s','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','originated','Trunk','name','active','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x61e3,0x1c5));var _0x361e=function(_0x8c642b,_0x5b822e){_0x8c642b=_0x8c642b-0x0;var _0x483870=_0x61e3[_0x8c642b];return _0x483870;};'use strict';var _=require(_0x361e('0x0'));var moment=require(_0x361e('0x1'));var util=require(_0x361e('0x2'));var logger=require(_0x361e('0x3'))(_0x361e('0x4'));var timezones=require(_0x361e('0x5'))[_0x361e('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x361e('0x7'),'BLACKLIST':_0x361e('0x8'),'CONTACTS_RESCHEDULED':_0x361e('0x9'),'DEACTIVATED':_0x361e('0xa'),'DISACTIVED':_0x361e('0xb'),'EMPTY_INTERVAL':_0x361e('0xc'),'INACTIVE':_0x361e('0xd'),'NO_AGENTS_LOGGED':_0x361e('0xe'),'NO_AVAILABLE_CONTACTS':_0x361e('0xf'),'NULL_INTERVAL':_0x361e('0x10'),'OVERTIME_INTERVAL':_0x361e('0x11'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x361e('0x12'),'RECALL_TIMEOUT':_0x361e('0x13'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x361e('0x14'),'UNREACHABLE_TRUNK':_0x361e('0x15')};exports[_0x361e('0x16')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x530db9){return _0x530db9[_0x361e('0x17')]===_0x361e('0x18');}exports[_0x361e('0x19')]=isPreviewCampaign;function isIVRCampaign(_0x2d241e){return _0x2d241e[_0x361e('0x1a')]==='ivr';}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x487cb6){return _0x487cb6[_0x361e('0x1a')]===_0x361e('0x1b');}exports[_0x361e('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x1e1c20){return _0x1e1c20[_0x361e('0x1d')];}exports[_0x361e('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x540466){return _0x540466['active'];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x462850,_0x5889eb){var _0x476407=moment(_0x462850)['milliseconds'](0x0);var _0x3a4f14=moment(_0x5889eb)[_0x361e('0x1f')](0x0);return _0x476407[_0x361e('0x20')](_0x3a4f14,'seconds');}exports[_0x361e('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x35b099,_0x4c3765){var _0x3b0525=![];var _0x237140=_0x35b099[_0x361e('0x17')]!==_0x4c3765['dialMethod']||_0x35b099[_0x361e('0x1d')]!==_0x4c3765[_0x361e('0x1d')]||_0x35b099[_0x361e('0x22')]!==_0x4c3765[_0x361e('0x22')];var _0x1e7e97=_0x35b099[_0x361e('0x23')]!==_0x4c3765['available']||_0x35b099[_0x361e('0x24')]!==_0x4c3765[_0x361e('0x24')]||_0x35b099[_0x361e('0x25')]!==_0x4c3765[_0x361e('0x25')]||_0x35b099[_0x361e('0x26')]!==_0x4c3765[_0x361e('0x26')]||_0x35b099[_0x361e('0x27')]!==_0x4c3765[_0x361e('0x27')]||_0x35b099[_0x361e('0x28')]!==_0x4c3765[_0x361e('0x28')]||_0x35b099[_0x361e('0x29')]!==_0x4c3765[_0x361e('0x29')]||_0x35b099['inUse']!==_0x4c3765['inUse']||_0x35b099[_0x361e('0x2a')]!==_0x4c3765[_0x361e('0x2a')];if(_0x35b099['Trunk']&&_0x4c3765[_0x361e('0x2b')]){_0x3b0525=_0x35b099['Trunk'][_0x361e('0x2c')]!==_0x4c3765[_0x361e('0x2b')][_0x361e('0x2c')]||_0x35b099[_0x361e('0x2b')][_0x361e('0x2d')]!==_0x4c3765[_0x361e('0x2b')][_0x361e('0x2d')];}return _0x237140||_0x1e7e97||_0x3b0525;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4d102c){var _0x5bc9a7=null;var _0x4779fd=_0x4d102c['dialTimezone'];if(_['isNil'](_0x4d102c[_0x361e('0x2e')])||_[_0x361e('0x2f')](_0x4d102c['Interval'])||_['isNil'](_0x4d102c[_0x361e('0x30')][_0x361e('0x31')])){_0x5bc9a7=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x361e('0x32')](_0x4d102c[_0x361e('0x2e')])||_[_0x361e('0x32')](_0x4d102c['Interval']['Intervals'])){_0x5bc9a7=CAMPAIGN_STATUS[_0x361e('0x33')];}else if(_0x4779fd&&!timezones[_0x4779fd]){_0x5bc9a7=CAMPAIGN_STATUS[_0x361e('0x34')];}return _0x5bc9a7;}function checkAnyValidTrunk(_0x23aaaa,_0x26196e){var _0x3d4c9e=null;var _0x2b0b1e=_0x361e('0x35');var _0x34ef64=[_0x361e('0x36'),_0x361e('0x37')];var _0x51f381=!![];if(_0x23aaaa[_0x361e('0x2b')]&&_0x23aaaa[_0x361e('0x2b')]['active']){_0x2b0b1e+=_0x23aaaa['Trunk'][_0x361e('0x2c')];_0x3d4c9e=_0x26196e[_0x2b0b1e];_0x51f381=_0x34ef64[_0x361e('0x38')](_0x3d4c9e[_0x361e('0x39')]);}else if(_0x23aaaa['TrunkBackup']&&_0x23aaaa[_0x361e('0x3a')]['active']){_0x2b0b1e+=_0x23aaaa[_0x361e('0x3a')]['name'];_0x3d4c9e=_0x26196e[_0x2b0b1e];_0x51f381=_0x34ef64['includes'](_0x3d4c9e[_0x361e('0x39')]);}return _0x51f381;}function getQueueCampaignStatusMessage(_0x47c209,_0x318aa3){var _0xb4d297=CAMPAIGN_STATUS[_0x361e('0x7')];var _0x2b67b8=isPreviewCampaign(_0x47c209);if(!isQueueCampaignActive(_0x47c209)){if(_0x2b67b8){_0xb4d297=CAMPAIGN_STATUS[_0x361e('0x3b')];}else{if(_0x47c209[_0x361e('0x2a')]===0x0&&_0x47c209[_0x361e('0x27')]===0x0&&_0x47c209[_0x361e('0x29')]===0x0&&(_0x47c209['pTalking']||0x0)===0x0){_0xb4d297=CAMPAIGN_STATUS[_0x361e('0x3b')];}else{_0xb4d297=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x47c209['loggedIn']===0x0){_0xb4d297=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x47c209,_0x318aa3)){_0xb4d297=CAMPAIGN_STATUS[_0x361e('0x3c')];}else if(!isPreviewCampaign(_0x47c209)){var _0x28faba=checkAnyValidQueueCampaignInterval(_0x47c209);if(_0x28faba){_0xb4d297=_0x28faba;}}return _0xb4d297;}exports[_0x361e('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x42641c){var _0x3f3c91=CAMPAIGN_STATUS[_0x361e('0x3e')];if(_0x42641c[_0x361e('0x2a')]===0x0&&_0x42641c[_0x361e('0x27')]===0x0&&_0x42641c[_0x361e('0x29')]===0x0&&(_0x42641c[_0x361e('0x28')]||0x0)===0x0){_0x3f3c91=CAMPAIGN_STATUS['INACTIVE'];}return _0x3f3c91;}exports[_0x361e('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x298f75){var _0x15892b=_0x298f75[_0x361e('0x40')](/"(.*?)"/);return _0x15892b?_0x15892b[0x1]:_0x298f75;}exports[_0x361e('0x41')]=extractCalleridName;function getCallerId(_0x5dafdd,_0x191eb6,_0x769e9f){if(!_[_0x361e('0x42')](_0x769e9f)&&typeof _0x769e9f==='string'&&!_['isEmpty'](_0x769e9f)){if(!_[_0x361e('0x42')](_0x191eb6)&&typeof _0x191eb6===_0x361e('0x43')&&!_[_0x361e('0x32')](_0x191eb6)){return util[_0x361e('0x44')](_0x361e('0x45'),_0x191eb6,_0x769e9f);}return util[_0x361e('0x44')](_0x361e('0x45'),_0x769e9f,_0x769e9f);}if(!_['isUndefined'](_0x5dafdd)&&typeof _0x5dafdd===_0x361e('0x43')&&!_[_0x361e('0x32')](_0x5dafdd)){return _0x5dafdd;}return'\x22\x22\x20<>';}exports[_0x361e('0x46')]=getCallerId;function getCallerIdRandom(_0x1a7a84,_0x3f6b19){var _0x40b44b;var _0x12230e;var _0x554bba;if(_0x3f6b19<=0x0){_0x3f6b19=0x1;}_0x40b44b=new RegExp(_0x361e('0x47')+_0x3f6b19+'}$');_0x12230e=Math[_0x361e('0x48')](0xa,_0x3f6b19-0x1);_0x554bba=Math[_0x361e('0x48')](0xa,_0x3f6b19)-0x1;return util[_0x361e('0x44')]('%s',_[_0x361e('0x49')](_0x1a7a84,_0x40b44b,_[_0x361e('0x4a')](_0x12230e,_0x554bba)[_0x361e('0x4b')]()));}exports[_0x361e('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x31d8f){if(_0x31d8f[_0x361e('0x2a')]&&_0x31d8f['originated']>0x0){_0x31d8f['originated']-=0x1;}else{logger[_0x361e('0x4d')](_0x361e('0x4e'));}}exports[_0x361e('0x4f')]=decrementOriginate;function checkContactEmpty(_0x28ed36){return _0x28ed36&&_0x28ed36['length']>0x0;}exports[_0x361e('0x50')]=checkContactEmpty;function erlangb(_0x354ea2,_0x28211a){if(_0x28211a===0x0){return 0x0;}var _0x21b0f8=0x1;for(var _0x35fc2f=0x1;_0x35fc2f<=_0x28211a;_0x35fc2f+=0x1){_0x21b0f8=0x1+_0x21b0f8*_0x35fc2f/_0x354ea2;}return 0x1/_0x21b0f8;}exports[_0x361e('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x1b9813,_0x41dc73,_0x3b2ad6){if(_0x41dc73>_0x3b2ad6){for(var _0xb99fd9=0x0;_0xb99fd9<_0x41dc73-_0x3b2ad6;_0xb99fd9+=0x1){decrementOriginate(_0x1b9813);}}}exports[_0x361e('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xd80912){var _0x5e9ebc={};var _0x36df99=['id',_0x361e('0x53'),_0x361e('0x54'),_0x361e('0x55'),_0x361e('0x56')];if(_0xd80912){for(var _0x2a4705 in _0xd80912){if(typeof _0xd80912[_0x2a4705]!=='undefined'){if(!_[_0x361e('0x2f')](_0xd80912[_0x2a4705])&&!_0x36df99[_0x361e('0x38')](_0x2a4705)){_0x5e9ebc[util['format'](_0x361e('0x57'),'XMD-',_0x2a4705[_0x361e('0x58')]())]=_0xd80912[_0x2a4705];}}}}return _0x5e9ebc;}exports[_0x361e('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0xbdba=['TrunkBackup','includes','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','tags','updatedAt','undefined','%s%s','XMD-','moment','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','name','Trunk','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','SIP/','unmonitored','status'];(function(_0x51044d,_0x2e4ced){var _0x2badbb=function(_0x429b1e){while(--_0x429b1e){_0x51044d['push'](_0x51044d['shift']());}};_0x2badbb(++_0x2e4ced);}(_0xbdba,0x10e));var _0xabdb=function(_0x32a04a,_0x53a6f0){_0x32a04a=_0x32a04a-0x0;var _0x525cf8=_0xbdba[_0x32a04a];return _0x525cf8;};'use strict';var _=require('lodash');var moment=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var timezones=require(_0xabdb('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xabdb('0x4'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xabdb('0x5'),'DEACTIVATED':_0xabdb('0x6'),'DISACTIVED':_0xabdb('0x7'),'EMPTY_INTERVAL':_0xabdb('0x8'),'INACTIVE':_0xabdb('0x9'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xabdb('0xa'),'NULL_INTERVAL':_0xabdb('0xb'),'OVERTIME_INTERVAL':_0xabdb('0xc'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0xabdb('0xd'),'RECALL_TIMEOUT':_0xabdb('0xe'),'RUNNING':_0xabdb('0xf'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x494d95){return _0x494d95[_0xabdb('0x10')]===_0xabdb('0x11');}exports[_0xabdb('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x1c353b){return _0x1c353b[_0xabdb('0x13')]===_0xabdb('0x14');}exports[_0xabdb('0x15')]=isIVRCampaign;function isOutboundQueue(_0x2ff970){return _0x2ff970[_0xabdb('0x13')]===_0xabdb('0x16');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x4bf685){return _0x4bf685[_0xabdb('0x17')];}exports[_0xabdb('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x21a96a){return _0x21a96a[_0xabdb('0x19')];}exports[_0xabdb('0x1a')]=isIVRCampaignActive;function getSeconds(_0x557c23,_0x1c9ee9){var _0x5d221d=moment(_0x557c23)['milliseconds'](0x0);var _0x22ea4b=moment(_0x1c9ee9)[_0xabdb('0x1b')](0x0);return _0x5d221d['diff'](_0x22ea4b,_0xabdb('0x1c'));}exports[_0xabdb('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x554305,_0x91741c){var _0xca4de=![];var _0x186442=_0x554305['dialMethod']!==_0x91741c['dialMethod']||_0x554305['dialActive']!==_0x91741c['dialActive']||_0x554305[_0xabdb('0x1e')]!==_0x91741c['message'];var _0x2e2c3e=_0x554305[_0xabdb('0x1f')]!==_0x91741c[_0xabdb('0x1f')]||_0x554305['loggedIn']!==_0x91741c[_0xabdb('0x20')]||_0x554305[_0xabdb('0x21')]!==_0x91741c[_0xabdb('0x21')]||_0x554305[_0xabdb('0x22')]!==_0x91741c[_0xabdb('0x22')]||_0x554305[_0xabdb('0x23')]!==_0x91741c['talking']||_0x554305[_0xabdb('0x24')]!==_0x91741c[_0xabdb('0x24')]||_0x554305[_0xabdb('0x25')]!==_0x91741c['waiting']||_0x554305[_0xabdb('0x26')]!==_0x91741c['inUse']||_0x554305[_0xabdb('0x27')]!==_0x91741c[_0xabdb('0x27')];if(_0x554305['Trunk']&&_0x91741c['Trunk']){_0xca4de=_0x554305['Trunk'][_0xabdb('0x28')]!==_0x91741c[_0xabdb('0x29')][_0xabdb('0x28')]||_0x554305[_0xabdb('0x29')][_0xabdb('0x19')]!==_0x91741c['Trunk']['active'];}return _0x186442||_0x2e2c3e||_0xca4de;}exports[_0xabdb('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5ebed5){var _0x2247fd=null;var _0x50965c=_0x5ebed5[_0xabdb('0x2b')];if(_[_0xabdb('0x2c')](_0x5ebed5[_0xabdb('0x2d')])||_['isNil'](_0x5ebed5[_0xabdb('0x2e')])||_[_0xabdb('0x2c')](_0x5ebed5['Interval']['Intervals'])){_0x2247fd=CAMPAIGN_STATUS[_0xabdb('0x2f')];}else if(_[_0xabdb('0x30')](_0x5ebed5['dialGlobalInterval'])||_[_0xabdb('0x30')](_0x5ebed5['Interval'][_0xabdb('0x31')])){_0x2247fd=CAMPAIGN_STATUS[_0xabdb('0x32')];}else if(_0x50965c&&!timezones[_0x50965c]){_0x2247fd=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x2247fd;}function checkAnyValidTrunk(_0x5c8e22,_0x59c008){var _0x1b6fb4=null;var _0xd2137d=_0xabdb('0x33');var _0x46aca6=['reachable',_0xabdb('0x34')];var _0x46267b=!![];if(_0x5c8e22[_0xabdb('0x29')]&&_0x5c8e22[_0xabdb('0x29')][_0xabdb('0x19')]){_0xd2137d+=_0x5c8e22[_0xabdb('0x29')][_0xabdb('0x28')];_0x1b6fb4=_0x59c008[_0xd2137d];_0x46267b=_0x46aca6['includes'](_0x1b6fb4[_0xabdb('0x35')]);}else if(_0x5c8e22['TrunkBackup']&&_0x5c8e22['TrunkBackup'][_0xabdb('0x19')]){_0xd2137d+=_0x5c8e22[_0xabdb('0x36')]['name'];_0x1b6fb4=_0x59c008[_0xd2137d];_0x46267b=_0x46aca6[_0xabdb('0x37')](_0x1b6fb4['status']);}return _0x46267b;}function getQueueCampaignStatusMessage(_0x4fdfc3,_0x3fc594){var _0x1c064a=CAMPAIGN_STATUS[_0xabdb('0x4')];var _0x12bead=isPreviewCampaign(_0x4fdfc3);if(!isQueueCampaignActive(_0x4fdfc3)){if(_0x12bead){_0x1c064a=CAMPAIGN_STATUS[_0xabdb('0x38')];}else{if(_0x4fdfc3[_0xabdb('0x27')]===0x0&&_0x4fdfc3[_0xabdb('0x23')]===0x0&&_0x4fdfc3[_0xabdb('0x25')]===0x0&&(_0x4fdfc3['pTalking']||0x0)===0x0){_0x1c064a=CAMPAIGN_STATUS[_0xabdb('0x38')];}else{_0x1c064a=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x4fdfc3['loggedIn']===0x0){_0x1c064a=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x4fdfc3,_0x3fc594)){_0x1c064a=CAMPAIGN_STATUS[_0xabdb('0x39')];}else if(!isPreviewCampaign(_0x4fdfc3)){var _0x48cc9b=checkAnyValidQueueCampaignInterval(_0x4fdfc3);if(_0x48cc9b){_0x1c064a=_0x48cc9b;}}return _0x1c064a;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xb4dc56){var _0x1947ed=CAMPAIGN_STATUS['DISACTIVED'];if(_0xb4dc56['originated']===0x0&&_0xb4dc56['talking']===0x0&&_0xb4dc56[_0xabdb('0x25')]===0x0&&(_0xb4dc56[_0xabdb('0x24')]||0x0)===0x0){_0x1947ed=CAMPAIGN_STATUS['INACTIVE'];}return _0x1947ed;}exports[_0xabdb('0x3a')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x220cb0){var _0x4effca=_0x220cb0[_0xabdb('0x3b')](/"(.*?)"/);return _0x4effca?_0x4effca[0x1]:_0x220cb0;}exports[_0xabdb('0x3c')]=extractCalleridName;function getCallerId(_0x2cace6,_0x4dd351,_0x5a9033){if(!_[_0xabdb('0x3d')](_0x5a9033)&&typeof _0x5a9033===_0xabdb('0x3e')&&!_[_0xabdb('0x30')](_0x5a9033)){if(!_[_0xabdb('0x3d')](_0x4dd351)&&typeof _0x4dd351===_0xabdb('0x3e')&&!_[_0xabdb('0x30')](_0x4dd351)){return util[_0xabdb('0x3f')](_0xabdb('0x40'),_0x4dd351,_0x5a9033);}return util['format'](_0xabdb('0x40'),_0x5a9033,_0x5a9033);}if(!_['isUndefined'](_0x2cace6)&&typeof _0x2cace6===_0xabdb('0x3e')&&!_['isEmpty'](_0x2cace6)){return _0x2cace6;}return'\x22\x22\x20<>';}exports[_0xabdb('0x41')]=getCallerId;function getCallerIdRandom(_0x101a7f,_0x3c5d70){var _0x18ed06;var _0x17df7d;var _0x2215c3;if(_0x3c5d70<=0x0){_0x3c5d70=0x1;}_0x18ed06=new RegExp(_0xabdb('0x42')+_0x3c5d70+'}$');_0x17df7d=Math[_0xabdb('0x43')](0xa,_0x3c5d70-0x1);_0x2215c3=Math['pow'](0xa,_0x3c5d70)-0x1;return util[_0xabdb('0x3f')]('%s',_[_0xabdb('0x44')](_0x101a7f,_0x18ed06,_['random'](_0x17df7d,_0x2215c3)[_0xabdb('0x45')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x52cd32){if(_0x52cd32[_0xabdb('0x27')]&&_0x52cd32[_0xabdb('0x27')]>0x0){_0x52cd32[_0xabdb('0x27')]-=0x1;}else{logger[_0xabdb('0x46')](_0xabdb('0x47'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x1c608c){return _0x1c608c&&_0x1c608c[_0xabdb('0x48')]>0x0;}exports[_0xabdb('0x49')]=checkContactEmpty;function erlangb(_0x1881ab,_0x3e6788){if(_0x3e6788===0x0){return 0x0;}var _0x4c80a0=0x1;for(var _0x33cff4=0x1;_0x33cff4<=_0x3e6788;_0x33cff4+=0x1){_0x4c80a0=0x1+_0x4c80a0*_0x33cff4/_0x1881ab;}return 0x1/_0x4c80a0;}exports[_0xabdb('0x4a')]=erlangb;function checkContactLowerLimitOriginate(_0x33ae42,_0x2c095d,_0x36ab81){if(_0x2c095d>_0x36ab81){for(var _0x32f84e=0x0;_0x32f84e<_0x2c095d-_0x36ab81;_0x32f84e+=0x1){decrementOriginate(_0x33ae42);}}}exports[_0xabdb('0x4b')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1b51b0){var _0x31040b={};var _0x1fcd77=['id','createdAt','description',_0xabdb('0x4c'),_0xabdb('0x4d')];if(_0x1b51b0){for(var _0x16a58a in _0x1b51b0){if(typeof _0x1b51b0[_0x16a58a]!==_0xabdb('0x4e')){if(!_[_0xabdb('0x2c')](_0x1b51b0[_0x16a58a])&&!_0x1fcd77[_0xabdb('0x37')](_0x16a58a)){_0x31040b[util[_0xabdb('0x3f')](_0xabdb('0x4f'),_0xabdb('0x50'),_0x16a58a['toUpperCase']())]=_0x1b51b0[_0x16a58a];}}}}return _0x31040b;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0878409..5ffc68d 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(_0x32a3a6,_0x27dde5){var _0x4133cf=function(_0x568860){while(--_0x568860){_0x32a3a6['push'](_0x32a3a6['shift']());}};_0x4133cf(++_0x27dde5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0xa29023,_0x24a4d7){var _0x3ba311=function(_0x3f5d36){while(--_0x3f5d36){_0xa29023['push'](_0xa29023['shift']());}};_0x3ba311(++_0x24a4d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 cfe1e41..473ee64 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 _0x3d48=['../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','lodash','bluebird','moment','path','./util/gs','../ami','./channel','./action'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0x3d48,0x151));var _0x83d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3d48[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var _=require(_0x83d4('0x0'));var BPromise=require(_0x83d4('0x1'));var uuid=require('uuid');var moment=require(_0x83d4('0x2'));var path=require(_0x83d4('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x83d4('0x4'));var logger=require('../../../config/logger')('fax');var ami=require(_0x83d4('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0x83d4('0x6'));var ut=require('./util/util');var Action=require(_0x83d4('0x7'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x83d4('0x8'));var faxMessage=require(_0x83d4('0x9'));function Fax(_0x15d55f){this[_0x83d4('0xa')]={};this['faxAccounts']=_0x15d55f[_0x83d4('0xb')];this[_0x83d4('0xc')]=_0x15d55f[_0x83d4('0xc')];this[_0x83d4('0xd')]={};ami['on']('newchannel',this[_0x83d4('0xe')][_0x83d4('0xf')](this));ami['on']('varset',this[_0x83d4('0x10')]['bind'](this));ami['on'](_0x83d4('0x11'),this[_0x83d4('0x12')]['bind'](this));ami['on']('newexten',this[_0x83d4('0x13')][_0x83d4('0xf')](this));ami['on'](_0x83d4('0x14'),this[_0x83d4('0x15')][_0x83d4('0xf')](this));ami['on']('receivefax',this[_0x83d4('0x16')]['bind'](this));ami['on'](_0x83d4('0x17'),this[_0x83d4('0x18')]['bind'](this));ami['on'](_0x83d4('0x19'),this['syncOriginateResponse'][_0x83d4('0xf')](this));}Fax[_0x83d4('0x1a')]['syncNewchannel']=function(_0x4eef29){if(_0x4eef29[_0x83d4('0x1b')]===_0x83d4('0x1c')){for(var _0x14ea66 in this[_0x83d4('0xb')]){if(this['faxAccounts'][_0x83d4('0x1d')](_0x14ea66)){if(_0x4eef29['exten']===this[_0x83d4('0xb')][_0x14ea66][_0x83d4('0x1e')]){this[_0x83d4('0xa')][_0x4eef29[_0x83d4('0x1f')]]={};this[_0x83d4('0xa')][_0x4eef29[_0x83d4('0x1f')]]['channel']=_0x4eef29[_0x83d4('0x20')];this['channels'][_0x4eef29['uniqueid']]['id']=this[_0x83d4('0xb')][_0x14ea66]['id'];this['channels'][_0x4eef29[_0x83d4('0x1f')]][_0x83d4('0x21')]=this[_0x83d4('0xb')][_0x14ea66][_0x83d4('0x21')];logger[_0x83d4('0x22')](_0x4eef29[_0x83d4('0x1f')],_0x83d4('0x23'));}}}}if(this[_0x83d4('0xd')][_0x4eef29['uniqueid']]){this[_0x83d4('0xa')][_0x4eef29[_0x83d4('0x1f')]]={};this[_0x83d4('0xa')][_0x4eef29[_0x83d4('0x1f')]]['channel']=_0x4eef29[_0x83d4('0x20')];logger[_0x83d4('0x22')](_0x4eef29[_0x83d4('0x1f')],_0x83d4('0x23'));}};Fax[_0x83d4('0x1a')]['syncVarSet']=function(_0x55db39){if(this[_0x83d4('0xa')][_0x55db39[_0x83d4('0x1f')]]){for(var _0x41865f in _0x55db39[_0x83d4('0x24')]){if(_0x55db39[_0x83d4('0x24')][_0x83d4('0x1d')](_0x41865f)){this['channels'][_0x55db39[_0x83d4('0x1f')]][_0x41865f]=_0x55db39['value'];}}}};Fax[_0x83d4('0x1a')][_0x83d4('0x12')]=function(_0xc21d19){if(this[_0x83d4('0xa')][_0xc21d19[_0x83d4('0x1f')]]){this[_0x83d4('0xa')][_0xc21d19[_0x83d4('0x1f')]]['channelstate']=_0xc21d19[_0x83d4('0x25')];this[_0x83d4('0xa')][_0xc21d19['uniqueid']][_0x83d4('0x26')]=_0xc21d19[_0x83d4('0x26')];}};Fax[_0x83d4('0x1a')][_0x83d4('0x13')]=function(_0x584e9a){if(this['channels'][_0x584e9a[_0x83d4('0x1f')]]){for(var _0x6f3236 in _0x584e9a[_0x83d4('0x24')]){if(_0x584e9a['variable']['hasOwnProperty'](_0x6f3236)){this[_0x83d4('0xa')][_0x584e9a['uniqueid']][_0x6f3236]=_0x584e9a['value'];}}}};Fax[_0x83d4('0x1a')][_0x83d4('0x15')]=function(_0x247d4a){if(this[_0x83d4('0xa')][_0x247d4a['uniqueid']]){this[_0x83d4('0xa')][_0x247d4a['uniqueid']][_0x83d4('0x27')]=_0x247d4a[_0x83d4('0x27')];this['channels'][_0x247d4a[_0x83d4('0x1f')]]['status']=_0x247d4a[_0x83d4('0x28')];this['channels'][_0x247d4a[_0x83d4('0x1f')]][_0x83d4('0x1e')]=_0x247d4a['localstationid'];this[_0x83d4('0xa')][_0x247d4a['uniqueid']][_0x83d4('0x29')]=_0x247d4a[_0x83d4('0x29')];logger['info'](_0x247d4a[_0x83d4('0x1f')],_0x83d4('0x2a'));}};Fax[_0x83d4('0x1a')][_0x83d4('0x16')]=function(_0x4f4bd5){var _0x29cbb3=this;if(this['channels'][_0x4f4bd5[_0x83d4('0x1f')]]){var _0x42afc1=this[_0x83d4('0xa')][_0x4f4bd5[_0x83d4('0x1f')]]['id'];this[_0x83d4('0xa')][_0x4f4bd5[_0x83d4('0x1f')]][_0x83d4('0x2b')]=_0x4f4bd5[_0x83d4('0x2b')];this[_0x83d4('0xa')][_0x4f4bd5['uniqueid']][_0x83d4('0x2c')]=_0x4f4bd5[_0x83d4('0x2c')];this[_0x83d4('0xa')][_0x4f4bd5[_0x83d4('0x1f')]][_0x83d4('0x1e')]=_0x4f4bd5[_0x83d4('0x1e')];this['channels'][_0x4f4bd5['uniqueid']][_0x83d4('0x2d')]=_0x4f4bd5[_0x83d4('0x2d')];this[_0x83d4('0xa')][_0x4f4bd5['uniqueid']][_0x83d4('0x2e')]=_0x4f4bd5['transferrate'];this[_0x83d4('0xa')][_0x4f4bd5['uniqueid']][_0x83d4('0x29')]=_0x4f4bd5[_0x83d4('0x29')];this[_0x83d4('0xa')][_0x4f4bd5['uniqueid']][_0x83d4('0x2f')]=_0x4f4bd5['calleridnum'];if(this['channels'][_0x4f4bd5[_0x83d4('0x1f')]][_0x83d4('0x2c')]>0x0){tiff2pdf(_0x4f4bd5['filename'],_0x83d4('0x30'),function(_0x213b87){logger['info'](_0x4f4bd5[_0x83d4('0x1f')],_0x83d4('0x31'),_0x213b87[_0x83d4('0x32')]);attachment[_0x83d4('0x33')]({'name':path['parse'](_0x4f4bd5[_0x83d4('0x29')])[_0x83d4('0x21')],'basename':path[_0x83d4('0x34')](_0x4f4bd5[_0x83d4('0x29')])[_0x83d4('0x21')]+_0x83d4('0x35'),'type':_0x83d4('0x36')})['then'](function(_0x5c6519){faxAccount[_0x83d4('0x37')](_0x42afc1,{'from':_0x4f4bd5[_0x83d4('0x2f')],'mapKey':_0x83d4('0x38'),'body':path[_0x83d4('0x34')](_0x4f4bd5[_0x83d4('0x29')])[_0x83d4('0x21')]+_0x83d4('0x35'),'AttachmentId':_0x5c6519['id']})[_0x83d4('0x39')](function(_0x162c00){logger[_0x83d4('0x3a')](_0x4f4bd5[_0x83d4('0x1f')],_0x83d4('0x3b'),JSON[_0x83d4('0x3c')](_0x162c00));});})[_0x83d4('0x39')](function(_0x3b1f83){logger[_0x83d4('0x3a')](_0x4f4bd5['uniqueid'],'\x20receiveFax\x20',JSON['stringify'](_0x3b1f83));});});}logger[_0x83d4('0x22')](_0x4f4bd5[_0x83d4('0x1f')],_0x83d4('0x3d'));}};Fax['prototype'][_0x83d4('0x3e')]=function(_0x5a91bd){if(this[_0x83d4('0xd')][_0x5a91bd[_0x83d4('0x1f')]]){_[_0x83d4('0x3f')](this[_0x83d4('0xa')][_0x5a91bd['uniqueid']],_[_0x83d4('0x40')](_0x5a91bd,[_0x83d4('0x41'),_0x83d4('0x42')]));}};function updateStatus(_0x5bb0ab){if(_0x5bb0ab[_0x83d4('0x43')]){faxMessage['update'](_0x5bb0ab[_0x83d4('0x43')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x83d4('0x44')](function(_0x163032){ut[_0x83d4('0x45')](_0x83d4('0x46'),_0x163032);})['catch'](function(_0x131772){ut['logger'](_0x83d4('0x47'),_0x131772);});}else{ut[_0x83d4('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x83d4('0x48')]=function(_0x27a5a0,_0x471a84,_0x100613){var _0x1a8b47=this;var _0x37226e={};if(_0x471a84){_0x37226e={'read':_0x471a84};}else{_0x37226e={'failMessage':_0x100613};}if(this[_0x83d4('0xd')][_0x27a5a0][_0x83d4('0x43')]){faxMessage[_0x83d4('0x49')](this[_0x83d4('0xd')][_0x27a5a0][_0x83d4('0x43')],_0x37226e)[_0x83d4('0x44')](function(_0x47999c){ut['logger'](_0x83d4('0x4a'),_0x47999c);})[_0x83d4('0x39')](function(_0x2b9b15){ut['logger'](_0x83d4('0x4b'),_0x2b9b15);})[_0x83d4('0x4c')](function(){delete _0x1a8b47[_0x83d4('0xa')][_0x27a5a0];delete _0x1a8b47[_0x83d4('0xd')][_0x27a5a0];});}else{ut[_0x83d4('0x45')](_0x83d4('0x4d'));delete this[_0x83d4('0xa')][_0x27a5a0];delete this['actions'][_0x27a5a0];}};Fax[_0x83d4('0x1a')][_0x83d4('0x18')]=function(_0x5e08f1){var _0x289316=this;if(this[_0x83d4('0xa')][_0x5e08f1['uniqueid']]){if(this['actions'][_0x5e08f1[_0x83d4('0x1f')]]){this[_0x83d4('0xa')][_0x5e08f1[_0x83d4('0x1f')]]['id']=this['actions'][_0x5e08f1[_0x83d4('0x1f')]]['id'];this[_0x83d4('0xa')][_0x5e08f1[_0x83d4('0x1f')]][_0x83d4('0x21')]=this[_0x83d4('0xd')][_0x5e08f1['uniqueid']][_0x83d4('0x21')];}logger[_0x83d4('0x22')](_0x5e08f1[_0x83d4('0x1f')],this['actions'][_0x5e08f1[_0x83d4('0x1f')]]?'\x20hangup\x20sendFile\x20':_0x83d4('0x4e'),JSON[_0x83d4('0x3c')](this[_0x83d4('0xa')][_0x5e08f1['uniqueid']]));if(this['actions'][_0x5e08f1[_0x83d4('0x1f')]]){if(this[_0x83d4('0xa')][_0x5e08f1['uniqueid']]['faxpages']>0x0&&this[_0x83d4('0xa')][_0x5e08f1[_0x83d4('0x1f')]][_0x83d4('0x14')]===_0x83d4('0x4f')){this['updateStatus'](_0x5e08f1[_0x83d4('0x1f')],!![]);}else{this[_0x83d4('0x48')](_0x5e08f1[_0x83d4('0x1f')],![],this[_0x83d4('0xa')][_0x5e08f1['uniqueid']][_0x83d4('0x50')]?'SENDING\x20FAILED:\x20'+this[_0x83d4('0xa')][_0x5e08f1[_0x83d4('0x1f')]]['faxstatusstring']:_0x83d4('0x51'));}}}};Fax[_0x83d4('0x1a')][_0x83d4('0x52')]=function(_0x3449e1){var _0x481cc3=this;return new BPromise(function(_0x14608e,_0x2d8558){_0x481cc3[_0x83d4('0x53')](_0x3449e1,_0x481cc3[_0x83d4('0xb')][_0x3449e1[_0x83d4('0x54')]])[_0x83d4('0x44')](function(_0x473aa6){ut['logger'](_0x83d4('0x55'),_0x473aa6);_0x14608e(ut[_0x83d4('0x32')](_0x83d4('0x56')));})[_0x83d4('0x39')](function(_0x44f565){ut[_0x83d4('0x45')](_0x83d4('0x57'),_0x44f565);updateStatus(_0x3449e1);_0x2d8558(ut[_0x83d4('0x32')](_0x83d4('0x58')));});});};Fax[_0x83d4('0x1a')][_0x83d4('0x59')]=function(_0x491775){var _0x325397=this;return new BPromise(function(_0xd3a13c,_0x49ad06){var _0xf9d48c=_0x325397['checkTrunk'](_0x325397[_0x83d4('0xb')][_0x491775[_0x83d4('0x54')]][_0x83d4('0x5a')],_0x491775);if(_0xf9d48c[_0x83d4('0x5b')]){_0xd3a13c(ut['message'](_0x83d4('0x5c')));}else{_0x49ad06(ut[_0x83d4('0x32')](_0xf9d48c[_0x83d4('0x32')]));}});};function originate(_0x3ba5a7,_0x57db4a,_0x25d769){return new BPromise(function(_0x10fc6b,_0x1c11ac){if(_0x25d769){var _0x1818ac=util[_0x83d4('0x5d')](_0x83d4('0x5e'),path['parse'](_0x3ba5a7[_0x83d4('0x3')])['name'],_0x3ba5a7[_0x83d4('0x3')]);gs[_0x83d4('0x5f')](_0x1818ac)[_0x83d4('0x44')](function(){_0x3ba5a7[_0x83d4('0x3')]=util[_0x83d4('0x5d')](_0x83d4('0x60'),path[_0x83d4('0x34')](_0x3ba5a7['path'])['dir'],path[_0x83d4('0x34')](_0x3ba5a7[_0x83d4('0x3')])[_0x83d4('0x21')]);_0x57db4a['XMF-PATH']=_0x3ba5a7[_0x83d4('0x3')];ut[_0x83d4('0x45')](_0x83d4('0x61'),'');ami[_0x83d4('0x62')](ut[_0x83d4('0x63')](_0x3ba5a7,_0x57db4a))[_0x83d4('0x44')](function(_0x7e1789){_0x10fc6b(_0x7e1789);})['catch'](function(_0x179068){_0x1c11ac(_0x179068);});})[_0x83d4('0x39')](function(_0x59209f){_0x1c11ac(_0x59209f);});}else{ami[_0x83d4('0x62')](ut[_0x83d4('0x63')](_0x3ba5a7,_0x57db4a))[_0x83d4('0x44')](function(_0x46c64d){_0x10fc6b(_0x46c64d);})[_0x83d4('0x39')](function(_0x34d5a){_0x1c11ac(_0x34d5a);});}});}Fax[_0x83d4('0x1a')][_0x83d4('0x53')]=function(_0x5c2f68,_0x191ccc){var _0xc7f152=this;return new BPromise(function(_0x3bc3d1,_0x31b920){var _0x58b9fc=uuid['v4']();var _0x4cba19=ut[_0x83d4('0x64')](_0x5c2f68,_0x191ccc);_0xc7f152[_0x83d4('0xd')][_0x58b9fc]=new Action(_0x58b9fc,_0x191ccc,_0x5c2f68);var _0x49362a=_0xc7f152[_0x83d4('0xd')][_0x58b9fc];if(path[_0x83d4('0x34')](_0x5c2f68[_0x83d4('0x3')])[_0x83d4('0x65')]===_0x83d4('0x35')){originate(_0x49362a,_0x4cba19,!![])[_0x83d4('0x44')](function(_0x345d33){_0x3bc3d1(_0x345d33);})[_0x83d4('0x39')](function(_0x42fd2c){_0x31b920(_0x42fd2c);});}else{originate(_0x49362a,_0x4cba19,![])['then'](function(_0x288cb2){_0x3bc3d1(_0x288cb2);})[_0x83d4('0x39')](function(_0x4bd2e1){_0x31b920(_0x4bd2e1);});}});};Fax[_0x83d4('0x1a')][_0x83d4('0x66')]=function(_0x4631ae){return!_[_0x83d4('0x67')](_0x4631ae)&&!_[_0x83d4('0x67')](_0x4631ae[_0x83d4('0x21')])&&!_[_0x83d4('0x67')](_0x4631ae['active'])&&_0x4631ae[_0x83d4('0x68')]&&!_[_0x83d4('0x67')](this[_0x83d4('0xc')][util['format'](_0x83d4('0x69'),_0x4631ae['name'])])&&!_['isNil'](this[_0x83d4('0xc')][util['format'](_0x83d4('0x69'),_0x4631ae[_0x83d4('0x21')])]['status'])&&(this[_0x83d4('0xc')][util['format'](_0x83d4('0x69'),_0x4631ae[_0x83d4('0x21')])][_0x83d4('0x28')]===_0x83d4('0x6a')||this[_0x83d4('0xc')][util['format'](_0x83d4('0x69'),_0x4631ae[_0x83d4('0x21')])]['status']===_0x83d4('0x6b'));};Fax['prototype']['checkTrunk']=function(_0x585aef,_0x50e6ab){if(!this[_0x83d4('0x66')](_0x585aef)){ut['logger'](_0x83d4('0x6c'),_[_0x83d4('0x67')](_0x585aef)?'':_0x585aef[_0x83d4('0x21')]+_0x83d4('0x6d'));return{'isValid':![],'message':_0x83d4('0x6e')};}if(_[_0x83d4('0x67')](_0x50e6ab[_0x83d4('0x38')])){ut[_0x83d4('0x45')](_0x83d4('0x6f'),JSON[_0x83d4('0x3c')](_0x50e6ab));return{'isValid':![],'message':_0x83d4('0x70')};}if(_[_0x83d4('0x67')](_0x50e6ab[_0x83d4('0x3')])){ut[_0x83d4('0x45')](_0x83d4('0x71'),JSON[_0x83d4('0x3c')](_0x50e6ab));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x83d4('0x72')]=Fax; \ No newline at end of file +var _0x4133=['gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','newstate','syncNewState','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','catch','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','stringify','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','format'];(function(_0x30986c,_0x39ce58){var _0x57c209=function(_0x557c36){while(--_0x557c36){_0x30986c['push'](_0x30986c['shift']());}};_0x57c209(++_0x39ce58);}(_0x4133,0x17a));var _0x3413=function(_0x3e7a9c,_0x2585eb){_0x3e7a9c=_0x3e7a9c-0x0;var _0x250efc=_0x4133[_0x3e7a9c];return _0x250efc;};'use strict';var util=require(_0x3413('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x3413('0x1'));var moment=require(_0x3413('0x2'));var path=require(_0x3413('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3413('0x4'));var logger=require(_0x3413('0x5'))(_0x3413('0x6'));var ami=require(_0x3413('0x7'));var rpcDb=require(_0x3413('0x8'));var Channel=require(_0x3413('0x9'));var ut=require(_0x3413('0xa'));var Action=require(_0x3413('0xb'));var faxAccount=require(_0x3413('0xc'));var attachment=require(_0x3413('0xd'));var faxMessage=require(_0x3413('0xe'));function Fax(_0x10b6cd){this[_0x3413('0xf')]={};this[_0x3413('0x10')]=_0x10b6cd[_0x3413('0x10')];this[_0x3413('0x11')]=_0x10b6cd[_0x3413('0x11')];this[_0x3413('0x12')]={};ami['on']('newchannel',this[_0x3413('0x13')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x3413('0x14')](this));ami['on'](_0x3413('0x15'),this[_0x3413('0x16')][_0x3413('0x14')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x3413('0x17')][_0x3413('0x14')](this));ami['on'](_0x3413('0x18'),this[_0x3413('0x19')]['bind'](this));ami['on']('hangup',this[_0x3413('0x1a')]['bind'](this));ami['on'](_0x3413('0x1b'),this['syncOriginateResponse'][_0x3413('0x14')](this));}Fax[_0x3413('0x1c')][_0x3413('0x13')]=function(_0x336f6e){if(_0x336f6e[_0x3413('0x1d')]===_0x3413('0x1e')){for(var _0x2643c1 in this[_0x3413('0x10')]){if(this[_0x3413('0x10')]['hasOwnProperty'](_0x2643c1)){if(_0x336f6e[_0x3413('0x1f')]===this[_0x3413('0x10')][_0x2643c1][_0x3413('0x20')]){this[_0x3413('0xf')][_0x336f6e['uniqueid']]={};this['channels'][_0x336f6e[_0x3413('0x21')]][_0x3413('0x22')]=_0x336f6e['channel'];this[_0x3413('0xf')][_0x336f6e['uniqueid']]['id']=this['faxAccounts'][_0x2643c1]['id'];this[_0x3413('0xf')][_0x336f6e[_0x3413('0x21')]]['name']=this['faxAccounts'][_0x2643c1]['name'];logger[_0x3413('0x23')](_0x336f6e['uniqueid'],_0x3413('0x24'));}}}}if(this[_0x3413('0x12')][_0x336f6e[_0x3413('0x21')]]){this[_0x3413('0xf')][_0x336f6e['uniqueid']]={};this[_0x3413('0xf')][_0x336f6e[_0x3413('0x21')]][_0x3413('0x22')]=_0x336f6e[_0x3413('0x22')];logger[_0x3413('0x23')](_0x336f6e[_0x3413('0x21')],_0x3413('0x24'));}};Fax['prototype'][_0x3413('0x25')]=function(_0x52af1a){if(this[_0x3413('0xf')][_0x52af1a[_0x3413('0x21')]]){for(var _0x4cb8c7 in _0x52af1a[_0x3413('0x26')]){if(_0x52af1a[_0x3413('0x26')][_0x3413('0x27')](_0x4cb8c7)){this[_0x3413('0xf')][_0x52af1a[_0x3413('0x21')]][_0x4cb8c7]=_0x52af1a[_0x3413('0x28')];}}}};Fax[_0x3413('0x1c')]['syncNewState']=function(_0x4039aa){if(this[_0x3413('0xf')][_0x4039aa[_0x3413('0x21')]]){this[_0x3413('0xf')][_0x4039aa[_0x3413('0x21')]][_0x3413('0x29')]=_0x4039aa[_0x3413('0x29')];this[_0x3413('0xf')][_0x4039aa[_0x3413('0x21')]][_0x3413('0x2a')]=_0x4039aa[_0x3413('0x2a')];}};Fax[_0x3413('0x1c')][_0x3413('0x2b')]=function(_0x331151){if(this[_0x3413('0xf')][_0x331151[_0x3413('0x21')]]){for(var _0x405b10 in _0x331151[_0x3413('0x26')]){if(_0x331151[_0x3413('0x26')]['hasOwnProperty'](_0x405b10)){this[_0x3413('0xf')][_0x331151['uniqueid']][_0x405b10]=_0x331151['value'];}}}};Fax['prototype'][_0x3413('0x17')]=function(_0x5a8dbb){if(this[_0x3413('0xf')][_0x5a8dbb[_0x3413('0x21')]]){this['channels'][_0x5a8dbb[_0x3413('0x21')]]['operation']=_0x5a8dbb[_0x3413('0x2c')];this['channels'][_0x5a8dbb[_0x3413('0x21')]][_0x3413('0x2d')]=_0x5a8dbb[_0x3413('0x2d')];this['channels'][_0x5a8dbb['uniqueid']][_0x3413('0x20')]=_0x5a8dbb[_0x3413('0x20')];this['channels'][_0x5a8dbb[_0x3413('0x21')]][_0x3413('0x2e')]=_0x5a8dbb[_0x3413('0x2e')];logger[_0x3413('0x23')](_0x5a8dbb[_0x3413('0x21')],_0x3413('0x2f'));}};Fax[_0x3413('0x1c')][_0x3413('0x19')]=function(_0xf6560a){var _0x4da8ed=this;if(this['channels'][_0xf6560a['uniqueid']]){var _0x18f42a=this[_0x3413('0xf')][_0xf6560a['uniqueid']]['id'];this['channels'][_0xf6560a[_0x3413('0x21')]]['remotestationid']=_0xf6560a['remotestationid'];this[_0x3413('0xf')][_0xf6560a[_0x3413('0x21')]][_0x3413('0x30')]=_0xf6560a['pagestransferred'];this[_0x3413('0xf')][_0xf6560a[_0x3413('0x21')]]['localstationid']=_0xf6560a[_0x3413('0x20')];this[_0x3413('0xf')][_0xf6560a['uniqueid']][_0x3413('0x31')]=_0xf6560a['resolution'];this[_0x3413('0xf')][_0xf6560a[_0x3413('0x21')]][_0x3413('0x32')]=_0xf6560a[_0x3413('0x32')];this['channels'][_0xf6560a[_0x3413('0x21')]][_0x3413('0x2e')]=_0xf6560a[_0x3413('0x2e')];this[_0x3413('0xf')][_0xf6560a[_0x3413('0x21')]][_0x3413('0x33')]=_0xf6560a[_0x3413('0x33')];if(this[_0x3413('0xf')][_0xf6560a[_0x3413('0x21')]][_0x3413('0x30')]>0x0){tiff2pdf(_0xf6560a[_0x3413('0x2e')],_0x3413('0x34'),function(_0x28d652){logger[_0x3413('0x23')](_0xf6560a[_0x3413('0x21')],_0x3413('0x35'),_0x28d652[_0x3413('0x36')]);attachment[_0x3413('0x37')]({'name':path[_0x3413('0x38')](_0xf6560a['filename'])[_0x3413('0x39')],'basename':path[_0x3413('0x38')](_0xf6560a[_0x3413('0x2e')])['name']+_0x3413('0x3a'),'type':_0x3413('0x3b')})['then'](function(_0x395711){faxAccount['notify'](_0x18f42a,{'from':_0xf6560a[_0x3413('0x33')],'mapKey':_0x3413('0x6'),'body':path['parse'](_0xf6560a[_0x3413('0x2e')])[_0x3413('0x39')]+'.pdf','AttachmentId':_0x395711['id']})[_0x3413('0x3c')](function(_0xdd330c){logger['error'](_0xf6560a[_0x3413('0x21')],'\x20notify\x20',JSON['stringify'](_0xdd330c));});})[_0x3413('0x3c')](function(_0x3d015e){logger[_0x3413('0x3d')](_0xf6560a[_0x3413('0x21')],_0x3413('0x3e'),JSON['stringify'](_0x3d015e));});});}logger[_0x3413('0x23')](_0xf6560a[_0x3413('0x21')],_0x3413('0x3e'));}};Fax[_0x3413('0x1c')]['syncOriginateResponse']=function(_0xd3f0a1){if(this[_0x3413('0x12')][_0xd3f0a1[_0x3413('0x21')]]){_[_0x3413('0x3f')](this['channels'][_0xd3f0a1[_0x3413('0x21')]],_[_0x3413('0x40')](_0xd3f0a1,[_0x3413('0x41'),_0x3413('0x42')]));}};function updateStatus(_0x1e036f){if(_0x1e036f[_0x3413('0x43')]){faxMessage['update'](_0x1e036f['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x3413('0x44')](function(_0x56dbbd){ut[_0x3413('0x45')](_0x3413('0x46'),_0x56dbbd);})['catch'](function(_0x1be531){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x1be531);});}else{ut[_0x3413('0x45')](_0x3413('0x47'));}}Fax[_0x3413('0x1c')][_0x3413('0x48')]=function(_0x1bf34a,_0x1c3af8,_0xcc6a36){var _0x501710=this;var _0x48f146={};if(_0x1c3af8){_0x48f146={'read':_0x1c3af8};}else{_0x48f146={'failMessage':_0xcc6a36};}if(this[_0x3413('0x12')][_0x1bf34a][_0x3413('0x43')]){faxMessage[_0x3413('0x49')](this[_0x3413('0x12')][_0x1bf34a][_0x3413('0x43')],_0x48f146)[_0x3413('0x44')](function(_0x58cea7){ut[_0x3413('0x45')](_0x3413('0x4a'),_0x58cea7);})[_0x3413('0x3c')](function(_0x36e3e8){ut['logger'](_0x3413('0x4b'),_0x36e3e8);})[_0x3413('0x4c')](function(){delete _0x501710[_0x3413('0xf')][_0x1bf34a];delete _0x501710[_0x3413('0x12')][_0x1bf34a];});}else{ut[_0x3413('0x45')](_0x3413('0x4d'));delete this[_0x3413('0xf')][_0x1bf34a];delete this[_0x3413('0x12')][_0x1bf34a];}};Fax[_0x3413('0x1c')][_0x3413('0x1a')]=function(_0x14b951){var _0x3ff59a=this;if(this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]]){if(this[_0x3413('0x12')][_0x14b951[_0x3413('0x21')]]){this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]]['id']=this[_0x3413('0x12')][_0x14b951[_0x3413('0x21')]]['id'];this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]][_0x3413('0x39')]=this[_0x3413('0x12')][_0x14b951[_0x3413('0x21')]][_0x3413('0x39')];}logger[_0x3413('0x23')](_0x14b951['uniqueid'],this[_0x3413('0x12')][_0x14b951['uniqueid']]?_0x3413('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x3413('0x4f')](this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]]));if(this[_0x3413('0x12')][_0x14b951[_0x3413('0x21')]]){if(this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]][_0x3413('0x50')]>0x0&&this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]][_0x3413('0x51')]===_0x3413('0x52')){this['updateStatus'](_0x14b951[_0x3413('0x21')],!![]);}else{this['updateStatus'](_0x14b951['uniqueid'],![],this[_0x3413('0xf')][_0x14b951[_0x3413('0x21')]][_0x3413('0x53')]?_0x3413('0x54')+this['channels'][_0x14b951[_0x3413('0x21')]][_0x3413('0x53')]:_0x3413('0x55'));}}}};Fax['prototype']['send']=function(_0x5580b9){var _0x325c73=this;return new BPromise(function(_0x5d819b,_0x50d8eb){_0x325c73['execOriginate'](_0x5580b9,_0x325c73[_0x3413('0x10')][_0x5580b9[_0x3413('0x56')]])[_0x3413('0x44')](function(_0x457efb){ut[_0x3413('0x45')]('[Fax][execOriginate][success]',_0x457efb);_0x5d819b(ut['message'](_0x3413('0x57')));})[_0x3413('0x3c')](function(_0x52ce63){ut[_0x3413('0x45')](_0x3413('0x58'),_0x52ce63);updateStatus(_0x5580b9);_0x50d8eb(ut[_0x3413('0x36')](_0x3413('0x59')));});});};Fax['prototype'][_0x3413('0x5a')]=function(_0xa1caea){var _0x7a6ecc=this;return new BPromise(function(_0x337573,_0x56a765){var _0x1ae1ba=_0x7a6ecc[_0x3413('0x5b')](_0x7a6ecc[_0x3413('0x10')][_0xa1caea[_0x3413('0x56')]]['Trunk'],_0xa1caea);if(_0x1ae1ba[_0x3413('0x5c')]){_0x337573(ut['message']('Trunk\x20Reachable'));}else{_0x56a765(ut[_0x3413('0x36')](_0x1ae1ba[_0x3413('0x36')]));}});};function originate(_0x2fb58c,_0x5e9344,_0x178d6c){return new BPromise(function(_0x1b13c8,_0x2c177d){if(_0x178d6c){var _0x11529e=util[_0x3413('0x5d')](_0x3413('0x5e'),path[_0x3413('0x38')](_0x2fb58c[_0x3413('0x3')])[_0x3413('0x39')],_0x2fb58c[_0x3413('0x3')]);gs[_0x3413('0x5f')](_0x11529e)['then'](function(){_0x2fb58c[_0x3413('0x3')]=util[_0x3413('0x5d')](_0x3413('0x60'),path['parse'](_0x2fb58c[_0x3413('0x3')])[_0x3413('0x61')],path['parse'](_0x2fb58c[_0x3413('0x3')])[_0x3413('0x39')]);_0x5e9344[_0x3413('0x62')]=_0x2fb58c[_0x3413('0x3')];ut[_0x3413('0x45')](_0x3413('0x63'),'');ami[_0x3413('0x64')](ut[_0x3413('0x65')](_0x2fb58c,_0x5e9344))[_0x3413('0x44')](function(_0x2300a2){_0x1b13c8(_0x2300a2);})[_0x3413('0x3c')](function(_0x3f228c){_0x2c177d(_0x3f228c);});})['catch'](function(_0x2edec5){_0x2c177d(_0x2edec5);});}else{ami['Action'](ut[_0x3413('0x65')](_0x2fb58c,_0x5e9344))[_0x3413('0x44')](function(_0x35d954){_0x1b13c8(_0x35d954);})[_0x3413('0x3c')](function(_0x3971b3){_0x2c177d(_0x3971b3);});}});}Fax[_0x3413('0x1c')][_0x3413('0x66')]=function(_0x47d2e1,_0x5382a5){var _0x327321=this;return new BPromise(function(_0x12fec1,_0x2a1a34){var _0x105943=uuid['v4']();var _0x549776=ut['addVariables'](_0x47d2e1,_0x5382a5);_0x327321[_0x3413('0x12')][_0x105943]=new Action(_0x105943,_0x5382a5,_0x47d2e1);var _0x5196c4=_0x327321[_0x3413('0x12')][_0x105943];if(path[_0x3413('0x38')](_0x47d2e1['path'])[_0x3413('0x67')]===_0x3413('0x3a')){originate(_0x5196c4,_0x549776,!![])['then'](function(_0x35d2ca){_0x12fec1(_0x35d2ca);})['catch'](function(_0x20ec6e){_0x2a1a34(_0x20ec6e);});}else{originate(_0x5196c4,_0x549776,![])[_0x3413('0x44')](function(_0x4164f2){_0x12fec1(_0x4164f2);})['catch'](function(_0x248fae){_0x2a1a34(_0x248fae);});}});};Fax[_0x3413('0x1c')][_0x3413('0x68')]=function(_0x382395){return!_['isNil'](_0x382395)&&!_[_0x3413('0x69')](_0x382395['name'])&&!_[_0x3413('0x69')](_0x382395[_0x3413('0x6a')])&&_0x382395[_0x3413('0x6a')]&&!_[_0x3413('0x69')](this[_0x3413('0x11')][util[_0x3413('0x5d')](_0x3413('0x6b'),_0x382395[_0x3413('0x39')])])&&!_['isNil'](this[_0x3413('0x11')][util[_0x3413('0x5d')](_0x3413('0x6b'),_0x382395[_0x3413('0x39')])][_0x3413('0x2d')])&&(this['trunks'][util[_0x3413('0x5d')]('SIP/%s',_0x382395[_0x3413('0x39')])][_0x3413('0x2d')]===_0x3413('0x6c')||this[_0x3413('0x11')][util[_0x3413('0x5d')](_0x3413('0x6b'),_0x382395['name'])][_0x3413('0x2d')]===_0x3413('0x6d'));};Fax[_0x3413('0x1c')][_0x3413('0x5b')]=function(_0x248b00,_0x3a4f8b){if(!this[_0x3413('0x68')](_0x248b00)){ut[_0x3413('0x45')](_0x3413('0x6e'),_[_0x3413('0x69')](_0x248b00)?'':_0x248b00[_0x3413('0x39')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3413('0x6f')};}if(_['isNil'](_0x3a4f8b['fax'])){ut[_0x3413('0x45')](_0x3413('0x70'),JSON[_0x3413('0x4f')](_0x3a4f8b));return{'isValid':![],'message':_0x3413('0x71')};}if(_['isNil'](_0x3a4f8b['path'])){ut[_0x3413('0x45')](_0x3413('0x72'),JSON[_0x3413('0x4f')](_0x3a4f8b));return{'isValid':![],'message':_0x3413('0x73')};}return{'isValid':!![],'message':_0x3413('0x74')};};module[_0x3413('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4c38757..4d1cab6 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 _0xf1a8=['notify','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','resolve','then'];(function(_0x10d66f,_0x492453){var _0x410c1d=function(_0x802237){while(--_0x802237){_0x10d66f['push'](_0x10d66f['shift']());}};_0x410c1d(++_0x492453);}(_0xf1a8,0x147));var _0x8f1a=function(_0x1a670a,_0x379766){_0x1a670a=_0x1a670a-0x0;var _0x5c2c26=_0xf1a8[_0x1a670a];return _0x5c2c26;};'use strict';var util=require('util');var BPromise=require(_0x8f1a('0x0'));var logger=require(_0x8f1a('0x1'))(_0x8f1a('0x2'));var _=require(_0x8f1a('0x3'));var faxAccount=require(_0x8f1a('0x4'));function loggerCatch(_0x308673){return function(_0x30202b){logger[_0x8f1a('0x5')](_0x308673,util[_0x8f1a('0x6')](_0x30202b,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x38e054,_0x1c1576){return BPromise[_0x8f1a('0x7')]()[_0x8f1a('0x8')](faxAccount[_0x8f1a('0x9')](_0x38e054,_0x1c1576))[_0x8f1a('0xa')](loggerCatch(_0x8f1a('0xb')));}; \ No newline at end of file +var _0x7839=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','then','notify','catch','[Notify]\x20'];(function(_0x2bc956,_0x14ceed){var _0x537775=function(_0x50946f){while(--_0x50946f){_0x2bc956['push'](_0x2bc956['shift']());}};_0x537775(++_0x14ceed);}(_0x7839,0x1bc));var _0x9783=function(_0x367894,_0x480759){_0x367894=_0x367894-0x0;var _0x5db8ce=_0x7839[_0x367894];return _0x5db8ce;};'use strict';var util=require(_0x9783('0x0'));var BPromise=require(_0x9783('0x1'));var logger=require(_0x9783('0x2'))(_0x9783('0x3'));var _=require(_0x9783('0x4'));var faxAccount=require(_0x9783('0x5'));function loggerCatch(_0x1c01b4){return function(_0x140c55){logger[_0x9783('0x6')](_0x1c01b4,util[_0x9783('0x7')](_0x140c55,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x175888,_0x4f3684){return BPromise['resolve']()[_0x9783('0x8')](faxAccount[_0x9783('0x9')](_0x175888,_0x4f3684))[_0x9783('0xa')](loggerCatch(_0x9783('0xb')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ba70184..d052444 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 _0x6ca1=['util','../../../../config/logger','fax','bluebird','exec','Exec\x20gs','info','\x20Error\x20:'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x6ca1,0x1f0));var _0x16ca=function(_0x3abe51,_0x3ae0c6){_0x3abe51=_0x3abe51-0x0;var _0x11bce4=_0x6ca1[_0x3abe51];return _0x11bce4;};'use strict';var util=require(_0x16ca('0x0'));var logger=require(_0x16ca('0x1'))(_0x16ca('0x2'));var BPromise=require(_0x16ca('0x3'));var exec=require('child_process')[_0x16ca('0x4')];exports['execute']=function(_0x2d78ff){return new BPromise(function(_0x5714fa,_0x3487ae){exec(_0x2d78ff,function(_0x48f8ad,_0xe51e95,_0x5599d6){logger['info'](_0x16ca('0x5'),_0xe51e95);if(_0x48f8ad){logger[_0x16ca('0x6')](_0x16ca('0x5'),_0x16ca('0x7'),util['inspect'](_0x48f8ad,{'showHidden':![],'depth':null}),_0xe51e95,_0x5599d6);_0x3487ae(_0x48f8ad);}_0x5714fa(_0xe51e95);});});}; \ No newline at end of file +var _0xdead=['bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0xa099dc,_0x20f4d1){var _0x5db1cf=function(_0x16f249){while(--_0x16f249){_0xa099dc['push'](_0xa099dc['shift']());}};_0x5db1cf(++_0x20f4d1);}(_0xdead,0x11f));var _0xddea=function(_0x395361,_0x318b82){_0x395361=_0x395361-0x0;var _0x47d106=_0xdead[_0x395361];return _0x47d106;};'use strict';var util=require(_0xddea('0x0'));var logger=require(_0xddea('0x1'))(_0xddea('0x2'));var BPromise=require(_0xddea('0x3'));var exec=require(_0xddea('0x4'))['exec'];exports[_0xddea('0x5')]=function(_0x1e9a2a){return new BPromise(function(_0x4d091a,_0x4e3a46){exec(_0x1e9a2a,function(_0xb5268a,_0x36d913,_0x2e8bd4){logger[_0xddea('0x6')](_0xddea('0x7'),_0x36d913);if(_0xb5268a){logger[_0xddea('0x6')](_0xddea('0x7'),_0xddea('0x8'),util[_0xddea('0x9')](_0xb5268a,{'showHidden':![],'depth':null}),_0x36d913,_0x2e8bd4);_0x4e3a46(_0xb5268a);}_0x4d091a(_0x36d913);});});}; \ 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 a81e5ff..417c02a 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 _0xa992=['\x22%s\x22\x20<%s>','headerinfo','util','../../../../config/logger','message','logger','info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip'];(function(_0x33c425,_0x162116){var _0x4049f4=function(_0x36ab6e){while(--_0x36ab6e){_0x33c425['push'](_0x33c425['shift']());}};_0x4049f4(++_0x162116);}(_0xa992,0x144));var _0x2a99=function(_0x12444a,_0x388e42){_0x12444a=_0x12444a-0x0;var _0x4853a3=_0xa992[_0x12444a];return _0x4853a3;};'use strict';var util=require(_0x2a99('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2a99('0x1'))('fax');exports[_0x2a99('0x2')]=function(_0x53da70){return{'message':_0x53da70};};exports[_0x2a99('0x3')]=function(_0x59f5e8,_0x48ce2f){logger[_0x2a99('0x4')](_0x59f5e8,util[_0x2a99('0x5')](_0x48ce2f,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1bce69,_0x177b4e){var _0x187257={'XMF-ECM':_0x177b4e[_0x2a99('0x6')],'XMF-HEADERINFO':_0x177b4e['headerinfo'],'XMF-MINRATE':_0x177b4e[_0x2a99('0x7')],'XMF-MAXRATE':_0x177b4e[_0x2a99('0x8')],'XMF-MODEM':util[_0x2a99('0x9')](_0x2a99('0xa'),_0x177b4e[_0x2a99('0xb')]),'XMF-GATEWAY':_0x177b4e[_0x2a99('0xc')],'XMF-FAXDETECT':_0x177b4e[_0x2a99('0xd')],'XMF-T38TIMEOUT':_0x177b4e['t38timeout'],'XMF-LOCALSTATIONID':_0x177b4e[_0x2a99('0xe')],'XMF-PATH':_0x1bce69[_0x2a99('0xf')]};return _0x187257;};exports[_0x2a99('0x10')]=function(_0x526342,_0x5c9ed7){return{'actionid':_0x526342[_0x2a99('0x11')],'action':'originate','channel':_0x526342[_0x2a99('0x12')],'Exten':_0x2a99('0x13'),'Context':_0x2a99('0x14'),'Priority':'1','callerid':util[_0x2a99('0x9')](_0x2a99('0x15'),_0x526342['headerinfo']?_0x526342[_0x2a99('0x16')]:'',_0x526342[_0x2a99('0xe')]),'variable':_0x5c9ed7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x526342[_0x2a99('0x11')]};}; \ No newline at end of file +var _0xcea0=['addVariables','ecm','minrate','maxrate','format','gateway','faxdetect','t38timeout','path','variablesAction','originate','channel','from-sip','headerinfo','util','moment','../../../../config/logger','fax','message','info','inspect'];(function(_0x2c0a57,_0x14ea07){var _0x2936ee=function(_0x3a72f5){while(--_0x3a72f5){_0x2c0a57['push'](_0x2c0a57['shift']());}};_0x2936ee(++_0x14ea07);}(_0xcea0,0x11f));var _0x0cea=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xcea0[_0xaa1b3e];return _0x454d7d;};'use strict';var util=require(_0x0cea('0x0'));var _=require('lodash');var moment=require(_0x0cea('0x1'));var logger=require(_0x0cea('0x2'))(_0x0cea('0x3'));exports[_0x0cea('0x4')]=function(_0x7b1c78){return{'message':_0x7b1c78};};exports['logger']=function(_0x4dc1ed,_0x4ebd5e){logger[_0x0cea('0x5')](_0x4dc1ed,util[_0x0cea('0x6')](_0x4ebd5e,{'showHidden':![],'depth':null}));};exports[_0x0cea('0x7')]=function(_0x2d2701,_0x1fddb2){var _0x5202c1={'XMF-ECM':_0x1fddb2[_0x0cea('0x8')],'XMF-HEADERINFO':_0x1fddb2['headerinfo'],'XMF-MINRATE':_0x1fddb2[_0x0cea('0x9')],'XMF-MAXRATE':_0x1fddb2[_0x0cea('0xa')],'XMF-MODEM':util[_0x0cea('0xb')]('\x22%s\x22',_0x1fddb2['modem']),'XMF-GATEWAY':_0x1fddb2[_0x0cea('0xc')],'XMF-FAXDETECT':_0x1fddb2[_0x0cea('0xd')],'XMF-T38TIMEOUT':_0x1fddb2[_0x0cea('0xe')],'XMF-LOCALSTATIONID':_0x1fddb2['localstationid'],'XMF-PATH':_0x2d2701[_0x0cea('0xf')]};return _0x5202c1;};exports[_0x0cea('0x10')]=function(_0x1fc31d,_0x1675ee){return{'actionid':_0x1fc31d['uniqueid'],'action':_0x0cea('0x11'),'channel':_0x1fc31d[_0x0cea('0x12')],'Exten':'xcally-motion-fax','Context':_0x0cea('0x13'),'Priority':'1','callerid':util[_0x0cea('0xb')]('\x22%s\x22\x20<%s>',_0x1fc31d[_0x0cea('0x14')]?_0x1fc31d[_0x0cea('0x14')]:'',_0x1fc31d['localstationid']),'variable':_0x1675ee,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1fc31d['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1991a48..5b9c8b0 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 _0xb378=['./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales'];(function(_0xc61a4f,_0xec3751){var _0x2ae80c=function(_0x2715c2){while(--_0x2715c2){_0xc61a4f['push'](_0xc61a4f['shift']());}};_0x2ae80c(++_0xec3751);}(_0xb378,0xcd));var _0x8b37=function(_0x2f90e4,_0x2df97d){_0x2f90e4=_0x2f90e4-0x0;var _0x40d7d1=_0xb378[_0x2f90e4];return _0x40d7d1;};'use strict';var util=require(_0x8b37('0x0'));var moment=require(_0x8b37('0x1'));var server=require(_0x8b37('0x2'));var Realtime=require(_0x8b37('0x3'));var Report=require(_0x8b37('0x4'));var Acw=require(_0x8b37('0x5'));var Trigger=require(_0x8b37('0x6'));var Dialer=require(_0x8b37('0x7'));var Preview=require(_0x8b37('0x8'));var Fax=require(_0x8b37('0x9'));var user=require(_0x8b37('0xa'));var voiceQueue=require(_0x8b37('0xb'));var voiceQueueReport=require(_0x8b37('0xc'));var voiceCallReport=require(_0x8b37('0xd'));var trunk=require(_0x8b37('0xe'));var trigger=require(_0x8b37('0xf'));var template=require(_0x8b37('0x10'));var cmHopperHistory=require(_0x8b37('0x11'));var campaign=require(_0x8b37('0x12'));var voiceExtension=require(_0x8b37('0x13'));var faxAccount=require(_0x8b37('0x14'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x8b37('0x15'));var sugarcrm=require(_0x8b37('0x16'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8b37('0x17'));var zoho=require(_0x8b37('0x18'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x8b37('0x19'));var servicenow=require(_0x8b37('0x1a'));var dynamics365=require(_0x8b37('0x1b'));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(_0x8b37('0x1c'))(_0x8b37('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8b37('0x1e')](_0x8b37('0x1f'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x8b37('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x8b37('0x20')](user[_0x8b37('0x21')]())['then'](realtime[_0x8b37('0x22')]())[_0x8b37('0x20')](user[_0x8b37('0x23')]())[_0x8b37('0x20')](realtime[_0x8b37('0x24')]())[_0x8b37('0x20')](trunk[_0x8b37('0x25')]())[_0x8b37('0x20')](realtime['initTrunks']())[_0x8b37('0x20')](voiceQueue['getVoiceQueues']())[_0x8b37('0x20')](realtime[_0x8b37('0x26')]())['then'](trigger[_0x8b37('0x27')]())[_0x8b37('0x20')](realtime[_0x8b37('0x28')]())['then'](template[_0x8b37('0x29')]())[_0x8b37('0x20')](realtime[_0x8b37('0x2a')]())[_0x8b37('0x20')](zendesk[_0x8b37('0x2b')]())['then'](realtime[_0x8b37('0x2c')]())[_0x8b37('0x20')](salesforce[_0x8b37('0x2d')]())['then'](realtime[_0x8b37('0x2e')]())[_0x8b37('0x20')](sugarcrm[_0x8b37('0x2f')]())[_0x8b37('0x20')](realtime[_0x8b37('0x30')]())[_0x8b37('0x20')](freshdesk[_0x8b37('0x31')]())[_0x8b37('0x20')](realtime[_0x8b37('0x32')]())[_0x8b37('0x20')](desk[_0x8b37('0x33')]())[_0x8b37('0x20')](realtime['initDeskAccounts']())['then'](zoho[_0x8b37('0x34')]())[_0x8b37('0x20')](realtime[_0x8b37('0x35')]())[_0x8b37('0x20')](vtiger[_0x8b37('0x36')]())[_0x8b37('0x20')](realtime['initVtigerAccounts']())['then'](freshsales[_0x8b37('0x37')]())[_0x8b37('0x20')](realtime[_0x8b37('0x38')]())[_0x8b37('0x20')](servicenow['getServicenowAccounts']())['then'](realtime[_0x8b37('0x39')]())['then'](dynamics365['getDynamics365Accounts']())[_0x8b37('0x20')](realtime[_0x8b37('0x3a')]())['then'](campaign[_0x8b37('0x3b')]())[_0x8b37('0x20')](realtime['initCampaigns']())[_0x8b37('0x20')](voiceExtension[_0x8b37('0x3c')]())['then'](realtime['initVoiceExtensions']())[_0x8b37('0x20')](faxAccount[_0x8b37('0x3d')]())[_0x8b37('0x20')](realtime[_0x8b37('0x3e')]())[_0x8b37('0x20')](function(){return realtime;});}function initParams(){return Promise[_0x8b37('0x3f')]()[_0x8b37('0x20')](voiceQueueReport[_0x8b37('0x40')]())[_0x8b37('0x20')](realtime[_0x8b37('0x41')]())[_0x8b37('0x20')](cmHopperHistory[_0x8b37('0x42')]())[_0x8b37('0x20')](realtime[_0x8b37('0x43')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x8b37('0x20')](realtime[_0x8b37('0x44')]())[_0x8b37('0x20')](voiceCallReport[_0x8b37('0x45')]())[_0x8b37('0x20')](realtime[_0x8b37('0x46')]())[_0x8b37('0x47')](function(_0x14702e){logger[_0x8b37('0x48')](_0x8b37('0x49'),util['inspect'](_0x14702e,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8b37('0x4a')](realtime,preview,fax)[_0x8b37('0x20')](function(){return initRealtime();})[_0x8b37('0x20')](function(){return initParams();})[_0x8b37('0x20')](function(){report[_0x8b37('0x4b')]();setInterval(initRealtime,0x1388);})[_0x8b37('0x47')](function(_0x94fa0){logger['error'](_0x8b37('0x4c'),util['inspect'](_0x94fa0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x874f=['./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','util','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/voiceCallReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk'];(function(_0x58ac9b,_0x34477f){var _0x523cfe=function(_0x2cdad4){while(--_0x2cdad4){_0x58ac9b['push'](_0x58ac9b['shift']());}};_0x523cfe(++_0x34477f);}(_0x874f,0x1ba));var _0xf874=function(_0x47d493,_0x3bedfb){_0x47d493=_0x47d493-0x0;var _0x50242a=_0x874f[_0x47d493];return _0x50242a;};'use strict';var util=require(_0xf874('0x0'));var moment=require('moment');var server=require(_0xf874('0x1'));var Realtime=require(_0xf874('0x2'));var Report=require(_0xf874('0x3'));var Acw=require('./acw');var Trigger=require(_0xf874('0x4'));var Dialer=require(_0xf874('0x5'));var Preview=require(_0xf874('0x6'));var Fax=require(_0xf874('0x7'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xf874('0x8'));var trunk=require(_0xf874('0x9'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xf874('0xa'));var voiceExtension=require(_0xf874('0xb'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xf874('0xc'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xf874('0xd'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xf874('0xe'));var zoho=require(_0xf874('0xf'));var vtiger=require(_0xf874('0x10'));var freshsales=require(_0xf874('0x11'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xf874('0x12'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xf874('0x13'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf874('0x14')](_0xf874('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xf874('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xf874('0x16')]()[_0xf874('0x17')](user['getAgents']())[_0xf874('0x17')](realtime['initAgents']())[_0xf874('0x17')](user[_0xf874('0x18')]())[_0xf874('0x17')](realtime['initTelephones']())[_0xf874('0x17')](trunk[_0xf874('0x19')]())[_0xf874('0x17')](realtime['initTrunks']())['then'](voiceQueue[_0xf874('0x1a')]())['then'](realtime[_0xf874('0x1b')]())['then'](trigger[_0xf874('0x1c')]())[_0xf874('0x17')](realtime['initTriggers']())[_0xf874('0x17')](template[_0xf874('0x1d')]())['then'](realtime[_0xf874('0x1e')]())['then'](zendesk[_0xf874('0x1f')]())['then'](realtime[_0xf874('0x20')]())[_0xf874('0x17')](salesforce[_0xf874('0x21')]())[_0xf874('0x17')](realtime[_0xf874('0x22')]())[_0xf874('0x17')](sugarcrm[_0xf874('0x23')]())[_0xf874('0x17')](realtime[_0xf874('0x24')]())['then'](freshdesk[_0xf874('0x25')]())['then'](realtime[_0xf874('0x26')]())[_0xf874('0x17')](desk[_0xf874('0x27')]())['then'](realtime[_0xf874('0x28')]())['then'](zoho[_0xf874('0x29')]())[_0xf874('0x17')](realtime['initZohoAccounts']())[_0xf874('0x17')](vtiger[_0xf874('0x2a')]())[_0xf874('0x17')](realtime[_0xf874('0x2b')]())[_0xf874('0x17')](freshsales[_0xf874('0x2c')]())[_0xf874('0x17')](realtime[_0xf874('0x2d')]())[_0xf874('0x17')](servicenow[_0xf874('0x2e')]())['then'](realtime[_0xf874('0x2f')]())[_0xf874('0x17')](dynamics365['getDynamics365Accounts']())[_0xf874('0x17')](realtime[_0xf874('0x30')]())['then'](campaign[_0xf874('0x31')]())[_0xf874('0x17')](realtime['initCampaigns']())['then'](voiceExtension[_0xf874('0x32')]())[_0xf874('0x17')](realtime[_0xf874('0x33')]())[_0xf874('0x17')](faxAccount[_0xf874('0x34')]())[_0xf874('0x17')](realtime[_0xf874('0x35')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xf874('0x16')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0xf874('0x17')](cmHopperHistory[_0xf874('0x36')]())[_0xf874('0x17')](realtime[_0xf874('0x37')]())[_0xf874('0x17')](cmHopperHistory[_0xf874('0x38')]())[_0xf874('0x17')](realtime[_0xf874('0x39')]())[_0xf874('0x17')](voiceCallReport[_0xf874('0x3a')]())[_0xf874('0x17')](realtime['initVoiceCallReports']())[_0xf874('0x3b')](function(_0x49832d){logger['error'](_0xf874('0x3c'),util[_0xf874('0x3d')](_0x49832d,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf874('0x3e')](realtime,preview,fax)[_0xf874('0x17')](function(){return initRealtime();})[_0xf874('0x17')](function(){return initParams();})[_0xf874('0x17')](function(){report[_0xf874('0x3f')]();setInterval(initRealtime,0x1388);})[_0xf874('0x3b')](function(_0x97507e){logger[_0xf874('0x40')]('[index.js][main]',util['inspect'](_0x97507e,{'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 d45f7d6..260e8d7 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 _0x134f=['inuse','talking','voiceStatus','statePause','toNumber','format','accountcode','online','user:%s','user:ami:update','emit','user:presence','lodash','util','moment','md5','ioredis','redis','defaults','localhost','name','email','fullname','state','status','unknown','address','phone','mobile','interface','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','idle'];(function(_0x54aad7,_0x5d7078){var _0x3c0b0b=function(_0x400ea0){while(--_0x400ea0){_0x54aad7['push'](_0x54aad7['shift']());}};_0x3c0b0b(++_0x5d7078);}(_0x134f,0x188));var _0xf134=function(_0x2c5790,_0x46cb39){_0x2c5790=_0x2c5790-0x0;var _0x21e80d=_0x134f[_0x2c5790];return _0x21e80d;};'use strict';var _=require(_0xf134('0x0'));var util=require(_0xf134('0x1'));var moment=require(_0xf134('0x2'));var md5=require(_0xf134('0x3'));var Redis=require(_0xf134('0x4'));var config=require('../../../config/environment');config[_0xf134('0x5')]=_[_0xf134('0x6')](config[_0xf134('0x5')],{'host':_0xf134('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf134('0x5')]));function Agent(_0x1df934){this['id']=_0x1df934['id']||0x0;this[_0xf134('0x8')]=_0x1df934[_0xf134('0x8')]||'';this[_0xf134('0x9')]=_0x1df934[_0xf134('0x9')]||'';this['accountcode']=_0x1df934['accountcode']||'';this[_0xf134('0xa')]=_0x1df934[_0xf134('0xa')]||'';this[_0xf134('0xb')]='unknown';this['stateTime']=0x0;this[_0xf134('0xc')]=_0xf134('0xd');this[_0xf134('0xe')]='';this[_0xf134('0xf')]='';this[_0xf134('0x10')]='';this[_0xf134('0x11')]='';this['online']=_0x1df934['online']||![];this['voiceStatus']=_0xf134('0xd');this[_0xf134('0x12')]=0x0;this[_0xf134('0x13')]='';this[_0xf134('0x14')]='';this[_0xf134('0x15')]=![];this[_0xf134('0x16')]=![];this[_0xf134('0x3')]='';}Agent['prototype'][_0xf134('0x17')]=function(_0x27c5b8){var _0x5c17f1;if(_0x27c5b8&&_0x27c5b8[_0xf134('0xb')]){_0x5c17f1=_0x27c5b8[_0xf134('0xb')][_0xf134('0x18')]();switch(_0x5c17f1){case'not_inuse':_0x5c17f1=_0xf134('0x19');break;case _0xf134('0x1a'):_0x5c17f1=_0xf134('0x1b');break;}}if(_0x5c17f1&&this[_0xf134('0x1c')]!==_0x5c17f1||_0x27c5b8[_0xf134('0x1d')]){this[_0xf134('0x12')]=_[_0xf134('0x1e')](moment()[_0xf134('0x1f')]('x'));}if(_0x5c17f1){this[_0xf134('0x1c')]=_0x5c17f1;}var _0x2632cb={'id':this['id'],'name':this[_0xf134('0x8')],'email':this['email'],'accountcode':this[_0xf134('0x20')],'fullname':this[_0xf134('0xa')],'state':this[_0xf134('0xb')],'stateTime':this['stateTime'],'status':this[_0xf134('0xc')],'address':this['address'],'online':this[_0xf134('0x21')],'voiceStatus':this[_0xf134('0x1c')],'voiceStatusTime':this[_0xf134('0x12')],'voiceStatusCallerIdNumber':this[_0xf134('0x13')],'voiceStatusQueue':this[_0xf134('0x14')],'interface':this[_0xf134('0x11')],'onhold':this[_0xf134('0x15')]};var _0x394e85=md5(JSON['stringify'](_0x2632cb));if(this[_0xf134('0x3')]!==_0x394e85){this[_0xf134('0x3')]=_0x394e85;io['to'](util[_0xf134('0x1f')](_0xf134('0x22'),_0x2632cb['name']))['emit'](_0xf134('0x23'),_['omit'](_0x2632cb,[_0xf134('0x21')]));io[_0xf134('0x24')](_0xf134('0x25'),_0x2632cb);}};module['exports']=Agent; \ No newline at end of file +var _0x1aa6=['omit','exports','lodash','util','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','interface','online','voiceStatus','voiceStatusTime','onhold','local','prototype','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','format','voiceStatusQueue','stringify','user:%s','user:ami:update'];(function(_0x414304,_0x4dd89d){var _0x153543=function(_0x5ae7fd){while(--_0x5ae7fd){_0x414304['push'](_0x414304['shift']());}};_0x153543(++_0x4dd89d);}(_0x1aa6,0x1b2));var _0x61aa=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x1aa6[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x61aa('0x0'));var util=require(_0x61aa('0x1'));var moment=require('moment');var md5=require(_0x61aa('0x2'));var Redis=require(_0x61aa('0x3'));var config=require(_0x61aa('0x4'));config[_0x61aa('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x61aa('0x6'))(new Redis(config[_0x61aa('0x5')]));function Agent(_0x477e59){this['id']=_0x477e59['id']||0x0;this[_0x61aa('0x7')]=_0x477e59[_0x61aa('0x7')]||'';this[_0x61aa('0x8')]=_0x477e59[_0x61aa('0x8')]||'';this[_0x61aa('0x9')]=_0x477e59[_0x61aa('0x9')]||'';this[_0x61aa('0xa')]=_0x477e59[_0x61aa('0xa')]||'';this[_0x61aa('0xb')]=_0x61aa('0xc');this[_0x61aa('0xd')]=0x0;this[_0x61aa('0xe')]=_0x61aa('0xc');this['address']='';this[_0x61aa('0xf')]='';this['mobile']='';this[_0x61aa('0x10')]='';this[_0x61aa('0x11')]=_0x477e59[_0x61aa('0x11')]||![];this[_0x61aa('0x12')]=_0x61aa('0xc');this[_0x61aa('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0x61aa('0x14')]=![];this[_0x61aa('0x15')]=![];this['md5']='';}Agent[_0x61aa('0x16')]['updateStatusRealtime']=function(_0x46212a){var _0x35a07e;if(_0x46212a&&_0x46212a[_0x61aa('0xb')]){_0x35a07e=_0x46212a[_0x61aa('0xb')][_0x61aa('0x17')]();switch(_0x35a07e){case _0x61aa('0x18'):_0x35a07e='idle';break;case _0x61aa('0x19'):_0x35a07e=_0x61aa('0x1a');break;}}if(_0x35a07e&&this[_0x61aa('0x12')]!==_0x35a07e||_0x46212a[_0x61aa('0x1b')]){this[_0x61aa('0x13')]=_[_0x61aa('0x1c')](moment()[_0x61aa('0x1d')]('x'));}if(_0x35a07e){this[_0x61aa('0x12')]=_0x35a07e;}var _0x277975={'id':this['id'],'name':this[_0x61aa('0x7')],'email':this[_0x61aa('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x61aa('0xa')],'state':this['state'],'stateTime':this[_0x61aa('0xd')],'status':this['status'],'address':this['address'],'online':this[_0x61aa('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x61aa('0x13')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x61aa('0x1e')],'interface':this[_0x61aa('0x10')],'onhold':this[_0x61aa('0x14')]};var _0x5f3942=md5(JSON[_0x61aa('0x1f')](_0x277975));if(this[_0x61aa('0x2')]!==_0x5f3942){this[_0x61aa('0x2')]=_0x5f3942;io['to'](util[_0x61aa('0x1d')](_0x61aa('0x20'),_0x277975[_0x61aa('0x7')]))['emit'](_0x61aa('0x21'),_[_0x61aa('0x22')](_0x277975,[_0x61aa('0x11')]));io['emit']('user:presence',_0x277975);}};module[_0x61aa('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3abaa8f..30becc4 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 _0xcf95=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x69b193,_0x571a6c){var _0x593f23=function(_0x1274db){while(--_0x1274db){_0x69b193['push'](_0x69b193['shift']());}};_0x593f23(++_0x571a6c);}(_0xcf95,0xd0));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x420ff5){this['id']=_0x420ff5['id']||0x0;this[_0x5cf9('0x0')]=_0x420ff5['name']||'';this[_0x5cf9('0x1')]=_0x420ff5[_0x5cf9('0x1')]||_0x5cf9('0x2');this[_0x5cf9('0x3')]=0x0;this[_0x5cf9('0x4')]=0x0;this[_0x5cf9('0x5')]=0x0;this[_0x5cf9('0x6')]=0x0;this['message']='';this[_0x5cf9('0x7')]=!![];this[_0x5cf9('0x8')]=_0x420ff5[_0x5cf9('0x8')];this['limitCalls']=_0x420ff5[_0x5cf9('0x9')];this[_0x5cf9('0xa')]=_0x420ff5['dialTimezone']||null;this[_0x5cf9('0xb')]=_0x420ff5[_0x5cf9('0xb')]?_0x420ff5['dialGlobalInterval']:null;this[_0x5cf9('0xc')]=_0x420ff5[_0x5cf9('0xc')];this[_0x5cf9('0xd')]=_0x420ff5[_0x5cf9('0xd')];this[_0x5cf9('0xe')]=_0x420ff5[_0x5cf9('0xe')]||0x1e;this[_0x5cf9('0xf')]=_0x420ff5['dialCongestionMaxRetry'];this[_0x5cf9('0x10')]=_0x420ff5[_0x5cf9('0x10')];this[_0x5cf9('0x11')]=_0x420ff5[_0x5cf9('0x11')];this['dialBusyRetryFrequency']=_0x420ff5['dialBusyRetryFrequency'];this[_0x5cf9('0x12')]=_0x420ff5['dialNoAnswerMaxRetry'];this[_0x5cf9('0x13')]=_0x420ff5['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x420ff5[_0x5cf9('0x14')];this['dialNoSuchNumberMaxRetry']=_0x420ff5[_0x5cf9('0x15')]||0x3;this[_0x5cf9('0x16')]=_0x420ff5['dialNoSuchNumberRetryFrequency']||0x96;this[_0x5cf9('0x17')]=_0x420ff5[_0x5cf9('0x17')]||0x3;this[_0x5cf9('0x18')]=_0x420ff5['dialDropRetryFrequency']||0x96;this[_0x5cf9('0x19')]=_0x420ff5[_0x5cf9('0x19')]||0x3;this[_0x5cf9('0x1a')]=_0x420ff5[_0x5cf9('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x420ff5[_0x5cf9('0x1b')]||0x3;this[_0x5cf9('0x1c')]=_0x420ff5['dialMachineRetryFrequency']||0x96;this[_0x5cf9('0x1d')]=_0x420ff5[_0x5cf9('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x420ff5[_0x5cf9('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x420ff5['dialOrderByScheduledAt']||_0x5cf9('0x1f');this[_0x5cf9('0x20')]=_0x420ff5[_0x5cf9('0x20')]||undefined;this[_0x5cf9('0x21')]=_0x420ff5[_0x5cf9('0x21')]||undefined;this[_0x5cf9('0x22')]=_0x420ff5['dialCutDigit']||undefined;this['TrunkBackup']=_0x420ff5[_0x5cf9('0x23')]?_0x420ff5['TrunkBackup']:undefined;this[_0x5cf9('0x24')]=_0x420ff5[_0x5cf9('0x24')]?_0x420ff5[_0x5cf9('0x24')]:undefined;this['Interval']=_0x420ff5[_0x5cf9('0x25')]?_0x420ff5[_0x5cf9('0x25')]:undefined;this[_0x5cf9('0x26')]=_0x420ff5[_0x5cf9('0x26')]?_0x420ff5['SquareProject']:undefined;this[_0x5cf9('0x27')]=_0x420ff5['SquareProject']?_0x420ff5['SquareProject'][_0x5cf9('0x0')]:undefined;this[_0x5cf9('0x28')]=_0x420ff5[_0x5cf9('0x28')]||![];this[_0x5cf9('0x29')]=_0x420ff5[_0x5cf9('0x29')];this[_0x5cf9('0x2a')]=_0x420ff5[_0x5cf9('0x2a')];this['dialAMDAfterGreetingSilence']=_0x420ff5[_0x5cf9('0x2b')];this[_0x5cf9('0x2c')]=_0x420ff5[_0x5cf9('0x2c')];this[_0x5cf9('0x2d')]=_0x420ff5['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x420ff5[_0x5cf9('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x420ff5[_0x5cf9('0x2f')];this[_0x5cf9('0x30')]=_0x420ff5[_0x5cf9('0x30')];this[_0x5cf9('0x31')]=_0x420ff5[_0x5cf9('0x31')];}module[_0x5cf9('0x32')]=Campaign; \ No newline at end of file +var _0x4bb3=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x4bb3,0x126));var _0x34bb=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x4bb3[_0x2e04ef];return _0x5722b0;};'use strict';function Campaign(_0x4b8b4a){this['id']=_0x4b8b4a['id']||0x0;this[_0x34bb('0x0')]=_0x4b8b4a['name']||'';this[_0x34bb('0x1')]=_0x4b8b4a['type']||_0x34bb('0x2');this[_0x34bb('0x3')]=0x0;this['temp']=0x0;this[_0x34bb('0x4')]=0x0;this[_0x34bb('0x5')]=0x0;this[_0x34bb('0x6')]='';this[_0x34bb('0x7')]=!![];this['active']=_0x4b8b4a[_0x34bb('0x8')];this[_0x34bb('0x9')]=_0x4b8b4a[_0x34bb('0x9')];this[_0x34bb('0xa')]=_0x4b8b4a['dialTimezone']||null;this[_0x34bb('0xb')]=_0x4b8b4a['dialGlobalInterval']?_0x4b8b4a[_0x34bb('0xb')]:null;this[_0x34bb('0xc')]=_0x4b8b4a[_0x34bb('0xc')];this['dialOriginateCallerIdNumber']=_0x4b8b4a['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x4b8b4a[_0x34bb('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x4b8b4a[_0x34bb('0xe')];this[_0x34bb('0xf')]=_0x4b8b4a[_0x34bb('0xf')];this[_0x34bb('0x10')]=_0x4b8b4a['dialBusyMaxRetry'];this[_0x34bb('0x11')]=_0x4b8b4a[_0x34bb('0x11')];this['dialNoAnswerMaxRetry']=_0x4b8b4a[_0x34bb('0x12')];this[_0x34bb('0x13')]=_0x4b8b4a['dialNoAnswerRetryFrequency'];this[_0x34bb('0x14')]=_0x4b8b4a[_0x34bb('0x14')];this['dialNoSuchNumberMaxRetry']=_0x4b8b4a[_0x34bb('0x15')]||0x3;this[_0x34bb('0x16')]=_0x4b8b4a[_0x34bb('0x16')]||0x96;this['dialDropMaxRetry']=_0x4b8b4a['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4b8b4a[_0x34bb('0x17')]||0x96;this[_0x34bb('0x18')]=_0x4b8b4a['dialAbandonedMaxRetry']||0x3;this[_0x34bb('0x19')]=_0x4b8b4a[_0x34bb('0x19')]||0x96;this[_0x34bb('0x1a')]=_0x4b8b4a[_0x34bb('0x1a')]||0x3;this[_0x34bb('0x1b')]=_0x4b8b4a[_0x34bb('0x1b')]||0x96;this[_0x34bb('0x1c')]=_0x4b8b4a[_0x34bb('0x1c')]||0x3;this[_0x34bb('0x1d')]=_0x4b8b4a[_0x34bb('0x1d')]||0x96;this[_0x34bb('0x1e')]=_0x4b8b4a['dialOrderByScheduledAt']||'DESC';this[_0x34bb('0x1f')]=_0x4b8b4a[_0x34bb('0x1f')]||undefined;this[_0x34bb('0x20')]=_0x4b8b4a[_0x34bb('0x20')]||undefined;this[_0x34bb('0x21')]=_0x4b8b4a['dialCutDigit']||undefined;this['TrunkBackup']=_0x4b8b4a['TrunkBackup']?_0x4b8b4a[_0x34bb('0x22')]:undefined;this[_0x34bb('0x23')]=_0x4b8b4a[_0x34bb('0x23')]?_0x4b8b4a['Trunk']:undefined;this[_0x34bb('0x24')]=_0x4b8b4a['Interval']?_0x4b8b4a[_0x34bb('0x24')]:undefined;this[_0x34bb('0x25')]=_0x4b8b4a[_0x34bb('0x25')]?_0x4b8b4a[_0x34bb('0x25')]:undefined;this['dialQueueProject']=_0x4b8b4a[_0x34bb('0x25')]?_0x4b8b4a['SquareProject'][_0x34bb('0x0')]:undefined;this['dialAMDActive']=_0x4b8b4a[_0x34bb('0x26')]||![];this[_0x34bb('0x27')]=_0x4b8b4a['dialAMDInitialSilence'];this[_0x34bb('0x28')]=_0x4b8b4a[_0x34bb('0x28')];this[_0x34bb('0x29')]=_0x4b8b4a[_0x34bb('0x29')];this['dialAMDTotalAnalysisTime']=_0x4b8b4a[_0x34bb('0x2a')];this[_0x34bb('0x2b')]=_0x4b8b4a[_0x34bb('0x2b')];this['dialAMDBetweenWordsSilence']=_0x4b8b4a['dialAMDBetweenWordsSilence'];this[_0x34bb('0x2c')]=_0x4b8b4a[_0x34bb('0x2c')];this['dialAMDSilenceThreshold']=_0x4b8b4a[_0x34bb('0x2d')];this[_0x34bb('0x2e')]=_0x4b8b4a['dialAMDMaximumWordLength'];}module[_0x34bb('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1fa8c9c..6d1ccda 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 _0xb846=['mohtime','exports','starttime','calleridnum','calleridname','connectedlinenum','connectedlinename','uniqueid','linkedid','exten','answered','answertime','abandoned','lastdata','duration','tag','disposition','monitor','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x3a8b7c,_0x3e5db2){var _0x40eb80=function(_0x8db6a3){while(--_0x8db6a3){_0x3a8b7c['push'](_0x3a8b7c['shift']());}};_0x40eb80(++_0x3e5db2);}(_0xb846,0x1d0));var _0x6b84=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb846[_0x126558];return _0x1f6d14;};'use strict';function Channel(){this[_0x6b84('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x6b84('0x1')]=0x0;this[_0x6b84('0x2')]='';this[_0x6b84('0x3')]=undefined;this[_0x6b84('0x4')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x6b84('0x5')]=0x0;this[_0x6b84('0x6')]=0x0;this[_0x6b84('0x7')]=0x0;this[_0x6b84('0x8')]=![];this[_0x6b84('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this[_0x6b84('0xa')]=![];this['lastapplication']='';this[_0x6b84('0xb')]='';this[_0x6b84('0xc')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this[_0x6b84('0xd')]=null;this[_0x6b84('0xe')]=null;this[_0x6b84('0xf')]=![];this['monitorFilename']=null;this['queue']=null;this['monitors']=[];this[_0x6b84('0x10')]=undefined;this[_0x6b84('0x11')]=undefined;this[_0x6b84('0x12')]=undefined;this[_0x6b84('0x13')]=0x0;}module[_0x6b84('0x14')]=Channel; \ No newline at end of file +var _0x2b10=['endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','exten','answered','answertime'];(function(_0x221231,_0xb42a6a){var _0x22fd0b=function(_0x1ef4b2){while(--_0x1ef4b2){_0x221231['push'](_0x221231['shift']());}};_0x22fd0b(++_0xb42a6a);}(_0x2b10,0x114));var _0x02b1=function(_0x3b4fe1,_0x47059e){_0x3b4fe1=_0x3b4fe1-0x0;var _0x2f3a08=_0x2b10[_0x3b4fe1];return _0x2f3a08;};'use strict';function Channel(){this[_0x02b1('0x0')]=null;this['channel']='';this[_0x02b1('0x1')]='';this[_0x02b1('0x2')]=0x0;this[_0x02b1('0x3')]='';this[_0x02b1('0x4')]=undefined;this[_0x02b1('0x5')]=undefined;this['accountcode']=0x0;this[_0x02b1('0x6')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x02b1('0x7')]=0x0;this[_0x02b1('0x8')]=![];this[_0x02b1('0x9')]=null;this[_0x02b1('0xa')]=null;this['unmanaged']=![];this[_0x02b1('0xb')]=![];this[_0x02b1('0xc')]='';this[_0x02b1('0xd')]='';this[_0x02b1('0xe')]=0x0;this[_0x02b1('0xf')]=0x0;this[_0x02b1('0x10')]=0x0;this[_0x02b1('0x11')]=null;this['tag']=null;this['disposition']=null;this[_0x02b1('0x12')]=![];this[_0x02b1('0x13')]=null;this[_0x02b1('0x14')]=null;this['monitors']=[];this[_0x02b1('0x15')]=undefined;this[_0x02b1('0x16')]=undefined;this[_0x02b1('0x17')]=undefined;this[_0x02b1('0x18')]=0x0;}module[_0x02b1('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a77c17f..3c3a624 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 _0xb112=['name','username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xb112,0x1c8));var _0x2b11=function(_0x1fc1ff,_0x2289b3){_0x1fc1ff=_0x1fc1ff-0x0;var _0x2199b9=_0xb112[_0x1fc1ff];return _0x2199b9;};'use strict';function DeskAccount(_0x239a02){this['id']=_0x239a02['id']||0x0;this[_0x2b11('0x0')]=_0x239a02[_0x2b11('0x0')]||'';this[_0x2b11('0x1')]=_0x239a02['username']||'';this[_0x2b11('0x2')]=_0x239a02[_0x2b11('0x2')]||'';this[_0x2b11('0x3')]=_0x239a02[_0x2b11('0x3')]||'';this[_0x2b11('0x4')]=_0x239a02['password']||'';this['consumerKey']=_0x239a02['consumerKey']||'';this['consumerSecret']=_0x239a02[_0x2b11('0x5')]||'';this[_0x2b11('0x6')]=_0x239a02['token']||'';this[_0x2b11('0x7')]=_0x239a02[_0x2b11('0x7')]||'';this[_0x2b11('0x8')]=_0x239a02['type']||'';this[_0x2b11('0x9')]=_0x239a02[_0x2b11('0x9')]||'';this[_0x2b11('0xa')]=_0x239a02[_0x2b11('0xa')]||{};}module[_0x2b11('0xb')]=DeskAccount; \ No newline at end of file +var _0x0a3a=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x4207d1,_0x451e8f){var _0xfc0422=function(_0x8e2d0d){while(--_0x8e2d0d){_0x4207d1['push'](_0x4207d1['shift']());}};_0xfc0422(++_0x451e8f);}(_0x0a3a,0x1d5));var _0xa0a3=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x0a3a[_0x786e9];return _0x1f891b;};'use strict';function DeskAccount(_0x2b4451){this['id']=_0x2b4451['id']||0x0;this[_0xa0a3('0x0')]=_0x2b4451[_0xa0a3('0x0')]||'';this[_0xa0a3('0x1')]=_0x2b4451[_0xa0a3('0x1')]||'';this['remoteUri']=_0x2b4451[_0xa0a3('0x2')]||'';this[_0xa0a3('0x3')]=_0x2b4451['authType']||'';this[_0xa0a3('0x4')]=_0x2b4451['password']||'';this[_0xa0a3('0x5')]=_0x2b4451[_0xa0a3('0x5')]||'';this[_0xa0a3('0x6')]=_0x2b4451['consumerSecret']||'';this['token']=_0x2b4451[_0xa0a3('0x7')]||'';this['tokenSecret']=_0x2b4451[_0xa0a3('0x8')]||'';this[_0xa0a3('0x9')]=_0x2b4451['type']||'';this[_0xa0a3('0xa')]=_0x2b4451[_0xa0a3('0xa')]||'';this[_0xa0a3('0xb')]=_0x2b4451[_0xa0a3('0xb')]||{};}module[_0xa0a3('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c24a850..4b0ffe6 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 _0x3deb=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x3deb,0xc8));var _0xb3de=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3deb[_0x8c43de];return _0xa6591b;};'use strict';function Dynamics365Account(_0x30bc8a){this['id']=_0x30bc8a['id']||0x0;this[_0xb3de('0x0')]=_0x30bc8a[_0xb3de('0x0')]||'';this['username']=_0x30bc8a[_0xb3de('0x1')]||'';this[_0xb3de('0x2')]=_0x30bc8a[_0xb3de('0x2')]||'';this[_0xb3de('0x3')]=_0x30bc8a['remoteUri']||'';this[_0xb3de('0x4')]=_0x30bc8a['tenantId']||'';this['clientId']=_0x30bc8a[_0xb3de('0x5')]||'';this['clientSecret']=_0x30bc8a[_0xb3de('0x6')]||{};this[_0xb3de('0x7')]=_0x30bc8a['serverUrl']||'';this['modernAuthentication']=_0x30bc8a['modernAuthentication']||![];this[_0xb3de('0x8')]=_0x30bc8a[_0xb3de('0x8')]||{};this[_0xb3de('0x9')]=_0x30bc8a[_0xb3de('0x9')]||{};}module[_0xb3de('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x6a82=['Configurations','CloudProvider','exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x141026,_0x5f5839){var _0x442a3f=function(_0x278a55){while(--_0x278a55){_0x141026['push'](_0x141026['shift']());}};_0x442a3f(++_0x5f5839);}(_0x6a82,0x1c6));var _0x26a8=function(_0x52206f,_0x3fa60e){_0x52206f=_0x52206f-0x0;var _0x3ab962=_0x6a82[_0x52206f];return _0x3ab962;};'use strict';function Dynamics365Account(_0x3048a3){this['id']=_0x3048a3['id']||0x0;this[_0x26a8('0x0')]=_0x3048a3[_0x26a8('0x0')]||'';this['username']=_0x3048a3['username']||'';this[_0x26a8('0x1')]=_0x3048a3[_0x26a8('0x1')]||'';this[_0x26a8('0x2')]=_0x3048a3[_0x26a8('0x2')]||'';this[_0x26a8('0x3')]=_0x3048a3['tenantId']||'';this[_0x26a8('0x4')]=_0x3048a3[_0x26a8('0x4')]||'';this[_0x26a8('0x5')]=_0x3048a3['clientSecret']||{};this[_0x26a8('0x6')]=_0x3048a3[_0x26a8('0x6')]||'';this[_0x26a8('0x7')]=_0x3048a3[_0x26a8('0x7')]||![];this[_0x26a8('0x8')]=_0x3048a3[_0x26a8('0x8')]||{};this[_0x26a8('0x9')]=_0x3048a3[_0x26a8('0x9')]||{};}module[_0x26a8('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9b758d9..a6d221d 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 _0xa72c=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x250029,_0x2d37ca){var _0x278597=function(_0x348079){while(--_0x348079){_0x250029['push'](_0x250029['shift']());}};_0x278597(++_0x2d37ca);}(_0xa72c,0xea));var _0xca72=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0xa72c[_0x5c72ee];return _0x231876;};'use strict';function FaxAccount(_0x594df7){this['id']=_0x594df7['id']||0x0;this['name']=_0x594df7[_0xca72('0x0')]||'';this[_0xca72('0x1')]=_0x594df7[_0xca72('0x1')];this[_0xca72('0x2')]=_0x594df7[_0xca72('0x2')];this[_0xca72('0x3')]=_0x594df7[_0xca72('0x3')];this[_0xca72('0x4')]=_0x594df7[_0xca72('0x4')];this[_0xca72('0x5')]=_0x594df7['minrate']||0x960;this[_0xca72('0x6')]=_0x594df7['maxrate']||0x3840;this[_0xca72('0x7')]=_0x594df7[_0xca72('0x7')]||_0xca72('0x8');this['gateway']=_0x594df7[_0xca72('0x9')]||'no';this[_0xca72('0xa')]=_0x594df7[_0xca72('0xa')]||'no';this[_0xca72('0xb')]=_0x594df7[_0xca72('0xb')]||0x1388;this['tech']=_0x594df7[_0xca72('0xc')]||_0xca72('0xd');this['Trunk']=_0x594df7[_0xca72('0xe')]?_0x594df7[_0xca72('0xe')]:undefined;this[_0xca72('0xf')]=_0x594df7[_0xca72('0xf')];this[_0xca72('0x10')]=_0x594df7[_0xca72('0x10')];}module[_0xca72('0x11')]=FaxAccount; \ No newline at end of file +var _0xf4d7=['tech','SIP','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x57a5af,_0x360142){var _0x5287f6=function(_0x368327){while(--_0x368327){_0x57a5af['push'](_0x57a5af['shift']());}};_0x5287f6(++_0x360142);}(_0xf4d7,0x7c));var _0x7f4d=function(_0x595b4f,_0x48cd3a){_0x595b4f=_0x595b4f-0x0;var _0x54fab5=_0xf4d7[_0x595b4f];return _0x54fab5;};'use strict';function FaxAccount(_0x2151ab){this['id']=_0x2151ab['id']||0x0;this[_0x7f4d('0x0')]=_0x2151ab[_0x7f4d('0x0')]||'';this[_0x7f4d('0x1')]=_0x2151ab[_0x7f4d('0x1')];this[_0x7f4d('0x2')]=_0x2151ab['ecm'];this[_0x7f4d('0x3')]=_0x2151ab[_0x7f4d('0x3')];this[_0x7f4d('0x4')]=_0x2151ab['localstationid'];this[_0x7f4d('0x5')]=_0x2151ab['minrate']||0x960;this[_0x7f4d('0x6')]=_0x2151ab['maxrate']||0x3840;this[_0x7f4d('0x7')]=_0x2151ab['modem']||_0x7f4d('0x8');this[_0x7f4d('0x9')]=_0x2151ab[_0x7f4d('0x9')]||'no';this[_0x7f4d('0xa')]=_0x2151ab[_0x7f4d('0xa')]||'no';this['t38timeout']=_0x2151ab[_0x7f4d('0xb')]||0x1388;this[_0x7f4d('0xc')]=_0x2151ab[_0x7f4d('0xc')]||_0x7f4d('0xd');this['Trunk']=_0x2151ab['Trunk']?_0x2151ab['Trunk']:undefined;this['ListId']=_0x2151ab[_0x7f4d('0xe')];this[_0x7f4d('0xf')]=_0x2151ab['key'];}module[_0x7f4d('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index dcf8eb7..12e1e2d 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 _0x2eac=['Configurations','exports','username','token','remoteUri','serverUrl'];(function(_0x56fc1b,_0x1035fd){var _0x452549=function(_0x417ba8){while(--_0x417ba8){_0x56fc1b['push'](_0x56fc1b['shift']());}};_0x452549(++_0x1035fd);}(_0x2eac,0xaa));var _0xc2ea=function(_0x2e5b2e,_0x5ea0bf){_0x2e5b2e=_0x2e5b2e-0x0;var _0x258724=_0x2eac[_0x2e5b2e];return _0x258724;};'use strict';function FreshdeskAccount(_0x19b7c0){this['id']=_0x19b7c0['id']||0x0;this['name']=_0x19b7c0['name']||'';this['username']=_0x19b7c0[_0xc2ea('0x0')]||'';this['apiKey']=_0x19b7c0[_0xc2ea('0x1')]||'';this[_0xc2ea('0x2')]=_0x19b7c0[_0xc2ea('0x2')]||'';this[_0xc2ea('0x3')]=_0x19b7c0[_0xc2ea('0x3')]||'';this[_0xc2ea('0x4')]=_0x19b7c0['Configurations']||{};}module[_0xc2ea('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xeb3f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1024f8,_0x2db966){var _0x59ce85=function(_0x168611){while(--_0x168611){_0x1024f8['push'](_0x1024f8['shift']());}};_0x59ce85(++_0x2db966);}(_0xeb3f,0xae));var _0xfeb3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xeb3f[_0x17d9e3];return _0x14192d;};'use strict';function FreshdeskAccount(_0x7d20f5){this['id']=_0x7d20f5['id']||0x0;this['name']=_0x7d20f5[_0xfeb3('0x0')]||'';this['username']=_0x7d20f5[_0xfeb3('0x1')]||'';this[_0xfeb3('0x2')]=_0x7d20f5[_0xfeb3('0x3')]||'';this['remoteUri']=_0x7d20f5[_0xfeb3('0x4')]||'';this[_0xfeb3('0x5')]=_0x7d20f5['serverUrl']||'';this['Configurations']=_0x7d20f5[_0xfeb3('0x6')]||{};}module[_0xfeb3('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 ddb51e2..b1e303c 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 _0x5db2=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x5db2,0xf3));var _0x25db=function(_0x3f55af,_0xa5177a){_0x3f55af=_0x3f55af-0x0;var _0x396e7e=_0x5db2[_0x3f55af];return _0x396e7e;};'use strict';function FreshsalesAccount(_0x52acb7){this['id']=_0x52acb7['id']||0x0;this[_0x25db('0x0')]=_0x52acb7[_0x25db('0x0')]||'';this['username']=_0x52acb7[_0x25db('0x1')]||'';this[_0x25db('0x2')]=_0x52acb7[_0x25db('0x3')]||'';this[_0x25db('0x4')]=_0x52acb7[_0x25db('0x4')]||'';this[_0x25db('0x5')]=_0x52acb7[_0x25db('0x5')]||'';this[_0x25db('0x6')]=_0x52acb7[_0x25db('0x6')]||{};}module[_0x25db('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x9305=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0x9305,0x1e2));var _0x5930=function(_0x788c48,_0x5c0e5e){_0x788c48=_0x788c48-0x0;var _0x299c14=_0x9305[_0x788c48];return _0x299c14;};'use strict';function FreshsalesAccount(_0x2a1952){this['id']=_0x2a1952['id']||0x0;this[_0x5930('0x0')]=_0x2a1952[_0x5930('0x0')]||'';this[_0x5930('0x1')]=_0x2a1952['username']||'';this[_0x5930('0x2')]=_0x2a1952[_0x5930('0x3')]||'';this[_0x5930('0x4')]=_0x2a1952[_0x5930('0x4')]||'';this['serverUrl']=_0x2a1952[_0x5930('0x5')]||'';this[_0x5930('0x6')]=_0x2a1952[_0x5930('0x6')]||{};}module[_0x5930('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 43100a9..42a22dd 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 _0x64e5=['voice','routealias','mohtime','variables','type','calleridname','queue','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','motionChannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64e5,0x149));var _0x564e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x64e5[_0x5783f4];return _0x28e380;};'use strict';function QueueReport(){this[_0x564e('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x564e('0x1')]='';this[_0x564e('0x2')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x564e('0x3')]=0x1;this[_0x564e('0x4')]=0x1;this['queuecallerabandon']=![];this[_0x564e('0x5')]=null;this[_0x564e('0x6')]=![];this[_0x564e('0x7')]=null;this[_0x564e('0x8')]=![];this[_0x564e('0x9')]=null;this[_0x564e('0xa')]=0x1;this[_0x564e('0xb')]='';this[_0x564e('0xc')]='';this[_0x564e('0xd')]='';this[_0x564e('0xe')]='';this[_0x564e('0xf')]='';this[_0x564e('0x10')]='';this[_0x564e('0x11')]='';this[_0x564e('0x12')]=0x0;this[_0x564e('0x13')]=![];this['lastAssignedTo']='';this[_0x564e('0x14')]=_0x564e('0x15');this[_0x564e('0x16')]=null;this[_0x564e('0x17')]=0x0;this[_0x564e('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x83dc=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x2b5e59,_0xd3e0dc){var _0x2e759e=function(_0x508dcf){while(--_0x508dcf){_0x2b5e59['push'](_0x2b5e59['shift']());}};_0x2e759e(++_0xd3e0dc);}(_0x83dc,0x7d));var _0xc83d=function(_0x32c5bf,_0x4b2b6a){_0x32c5bf=_0x32c5bf-0x0;var _0x5c7c8a=_0x83dc[_0x32c5bf];return _0x5c7c8a;};'use strict';function QueueReport(){this[_0xc83d('0x0')]=_0xc83d('0x1');this[_0xc83d('0x2')]='';this[_0xc83d('0x3')]='';this['calleridname']='';this[_0xc83d('0x4')]='';this[_0xc83d('0x5')]=null;this[_0xc83d('0x6')]=null;this[_0xc83d('0x7')]=0x1;this[_0xc83d('0x8')]=0x1;this[_0xc83d('0x9')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xc83d('0xa')]=null;this[_0xc83d('0xb')]=![];this[_0xc83d('0xc')]=null;this[_0xc83d('0xd')]=0x1;this[_0xc83d('0xe')]='';this[_0xc83d('0xf')]='';this[_0xc83d('0x10')]='';this[_0xc83d('0x11')]='';this[_0xc83d('0x12')]='';this['exten']='';this[_0xc83d('0x13')]='';this[_0xc83d('0x14')]=0x0;this['assigned']=![];this[_0xc83d('0x15')]='';this[_0xc83d('0x16')]=_0xc83d('0x17');this[_0xc83d('0x18')]=null;this[_0xc83d('0x19')]=0x0;this[_0xc83d('0x1a')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 94130df..6f948fe 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 _0x5432=['serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5432,0xc8));var _0x2543=function(_0xa61fb7,_0x29f8ba){_0xa61fb7=_0xa61fb7-0x0;var _0x237ea1=_0x5432[_0xa61fb7];return _0x237ea1;};'use strict';function SalesforceAccount(_0x4e3f0f){this['id']=_0x4e3f0f['id']||0x0;this[_0x2543('0x0')]=_0x4e3f0f[_0x2543('0x0')]||'';this[_0x2543('0x1')]=_0x4e3f0f[_0x2543('0x1')]||'';this[_0x2543('0x2')]=_0x4e3f0f[_0x2543('0x2')]||'';this[_0x2543('0x3')]=_0x4e3f0f[_0x2543('0x3')]||'';this[_0x2543('0x4')]=_0x4e3f0f[_0x2543('0x4')]||'';this[_0x2543('0x5')]=_0x4e3f0f[_0x2543('0x5')]||'';this['securityToken']=_0x4e3f0f[_0x2543('0x6')]||'';this[_0x2543('0x7')]=_0x4e3f0f[_0x2543('0x7')]||_0x2543('0x8');this[_0x2543('0x9')]=_0x4e3f0f[_0x2543('0x9')]||'';this[_0x2543('0xa')]=_0x4e3f0f[_0x2543('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x85dd=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x972082,_0x193ff0){var _0x124db6=function(_0x34948c){while(--_0x34948c){_0x972082['push'](_0x972082['shift']());}};_0x124db6(++_0x193ff0);}(_0x85dd,0x122));var _0xd85d=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x85dd[_0x49ca18];return _0x145d54;};'use strict';function SalesforceAccount(_0x2ca735){this['id']=_0x2ca735['id']||0x0;this['name']=_0x2ca735[_0xd85d('0x0')]||'';this['username']=_0x2ca735[_0xd85d('0x1')]||'';this[_0xd85d('0x2')]=_0x2ca735[_0xd85d('0x2')]||'';this[_0xd85d('0x3')]=_0x2ca735[_0xd85d('0x3')]||'';this[_0xd85d('0x4')]=_0x2ca735[_0xd85d('0x4')]||'';this[_0xd85d('0x5')]=_0x2ca735['clientSecret']||'';this[_0xd85d('0x6')]=_0x2ca735['securityToken']||'';this[_0xd85d('0x7')]=_0x2ca735[_0xd85d('0x7')]||_0xd85d('0x8');this[_0xd85d('0x9')]=_0x2ca735[_0xd85d('0x9')]||'';this[_0xd85d('0xa')]=_0x2ca735[_0xd85d('0xa')]||{};}module[_0xd85d('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 ec29d15..14d9231 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 _0xc515=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x8962d6,_0x503ed6){var _0x566f25=function(_0x56b0f0){while(--_0x56b0f0){_0x8962d6['push'](_0x8962d6['shift']());}};_0x566f25(++_0x503ed6);}(_0xc515,0x139));var _0x5c51=function(_0x12df55,_0x24a2cf){_0x12df55=_0x12df55-0x0;var _0x2e2b72=_0xc515[_0x12df55];return _0x2e2b72;};'use strict';function ServicenowAccount(_0x5600cc){this['id']=_0x5600cc['id']||0x0;this[_0x5c51('0x0')]=_0x5600cc[_0x5c51('0x0')]||'';this[_0x5c51('0x1')]=_0x5600cc['username']||'';this[_0x5c51('0x2')]=_0x5600cc[_0x5c51('0x2')]||'';this[_0x5c51('0x3')]=_0x5600cc['remoteUri']||'';this[_0x5c51('0x4')]=_0x5600cc['serverUrl']||'';this[_0x5c51('0x5')]=_0x5600cc[_0x5c51('0x5')]||{};}module[_0x5c51('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x2592=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x58fcda,_0x1c3d13){var _0x8e4b88=function(_0x1da88a){while(--_0x1da88a){_0x58fcda['push'](_0x58fcda['shift']());}};_0x8e4b88(++_0x1c3d13);}(_0x2592,0x119));var _0x2259=function(_0x2876a0,_0x5a09e3){_0x2876a0=_0x2876a0-0x0;var _0x5c4aae=_0x2592[_0x2876a0];return _0x5c4aae;};'use strict';function ServicenowAccount(_0x30132b){this['id']=_0x30132b['id']||0x0;this['name']=_0x30132b['name']||'';this[_0x2259('0x0')]=_0x30132b[_0x2259('0x0')]||'';this[_0x2259('0x1')]=_0x30132b[_0x2259('0x1')]||'';this[_0x2259('0x2')]=_0x30132b[_0x2259('0x2')]||'';this['serverUrl']=_0x30132b[_0x2259('0x3')]||'';this['Configurations']=_0x30132b[_0x2259('0x4')]||{};}module[_0x2259('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 37ac51a..16a32a2 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 _0xf0aa=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x45c717,_0x3a1664){var _0x40456a=function(_0x58b6f7){while(--_0x58b6f7){_0x45c717['push'](_0x45c717['shift']());}};_0x40456a(++_0x3a1664);}(_0xf0aa,0x16e));var _0xaf0a=function(_0x535fef,_0x432ad6){_0x535fef=_0x535fef-0x0;var _0x5a8b97=_0xf0aa[_0x535fef];return _0x5a8b97;};'use strict';function SugarcrmAccount(_0x128e0f){this['id']=_0x128e0f['id']||0x0;this['name']=_0x128e0f[_0xaf0a('0x0')]||'';this[_0xaf0a('0x1')]=_0x128e0f[_0xaf0a('0x1')]||'';this[_0xaf0a('0x2')]=_0x128e0f[_0xaf0a('0x2')]||'';this[_0xaf0a('0x3')]=_0x128e0f[_0xaf0a('0x3')]||'';this[_0xaf0a('0x4')]=_0x128e0f[_0xaf0a('0x4')]||'';this[_0xaf0a('0x5')]=_0x128e0f['Configurations']||{};}module[_0xaf0a('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xf20d=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x453ff8,_0x11ff7d){var _0x22aa85=function(_0x344ecf){while(--_0x344ecf){_0x453ff8['push'](_0x453ff8['shift']());}};_0x22aa85(++_0x11ff7d);}(_0xf20d,0x193));var _0xdf20=function(_0x46f942,_0x55012b){_0x46f942=_0x46f942-0x0;var _0x3fafb5=_0xf20d[_0x46f942];return _0x3fafb5;};'use strict';function SugarcrmAccount(_0xf882c9){this['id']=_0xf882c9['id']||0x0;this[_0xdf20('0x0')]=_0xf882c9[_0xdf20('0x0')]||'';this[_0xdf20('0x1')]=_0xf882c9[_0xdf20('0x1')]||'';this[_0xdf20('0x2')]=_0xf882c9[_0xdf20('0x2')]||'';this[_0xdf20('0x3')]=_0xf882c9['remoteUri']||'';this['serverUrl']=_0xf882c9[_0xdf20('0x4')]||'';this[_0xdf20('0x5')]=_0xf882c9['Configurations']||{};}module[_0xdf20('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f095a02..348c1d8 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 _0x9809=['state','unknown','stateTime','status','address','name','accountcode'];(function(_0x3a2f50,_0x350213){var _0x12f3a9=function(_0x5cc12f){while(--_0x5cc12f){_0x3a2f50['push'](_0x3a2f50['shift']());}};_0x12f3a9(++_0x350213);}(_0x9809,0x1da));var _0x9980=function(_0xbdf7b7,_0x4ad095){_0xbdf7b7=_0xbdf7b7-0x0;var _0x2578ff=_0x9809[_0xbdf7b7];return _0x2578ff;};'use strict';function Telephone(_0x28f126){this['id']=_0x28f126['id']||0x0;this[_0x9980('0x0')]=_0x28f126[_0x9980('0x0')]||'';this[_0x9980('0x1')]=_0x28f126[_0x9980('0x1')]||'';this[_0x9980('0x2')]=_0x9980('0x3');this[_0x9980('0x4')]=0x0;this[_0x9980('0x5')]=_0x9980('0x3');this[_0x9980('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x40be=['exports','name','unknown','status'];(function(_0x40f3fc,_0x233d19){var _0x2d0aa2=function(_0x9bdcd3){while(--_0x9bdcd3){_0x40f3fc['push'](_0x40f3fc['shift']());}};_0x2d0aa2(++_0x233d19);}(_0x40be,0x14d));var _0xe40b=function(_0x3e8c42,_0x590fc4){_0x3e8c42=_0x3e8c42-0x0;var _0x356097=_0x40be[_0x3e8c42];return _0x356097;};'use strict';function Telephone(_0x64e207){this['id']=_0x64e207['id']||0x0;this['name']=_0x64e207[_0xe40b('0x0')]||'';this['accountcode']=_0x64e207['accountcode']||'';this['state']=_0xe40b('0x1');this['stateTime']=0x0;this[_0xe40b('0x2')]=_0xe40b('0x1');this['address']='';}module[_0xe40b('0x3')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 56aa321..4ffa548 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(_0x27974b,_0xceb48){var _0x1a12df=function(_0x5922b2){while(--_0x5922b2){_0x27974b['push'](_0x27974b['shift']());}};_0x1a12df(++_0xceb48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 _0xb10b=['name','html'];(function(_0x32c307,_0x128a7e){var _0x290b24=function(_0x5e2ac3){while(--_0x5e2ac3){_0x32c307['push'](_0x32c307['shift']());}};_0x290b24(++_0x128a7e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a123f,_0x14cb93){_0x5a123f=_0x5a123f-0x0;var _0x40f3e8=_0xb10b[_0x5a123f];return _0x40f3e8;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index bdfb74a..a02ca25 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19409d,_0xf48905){_0x19409d=_0x19409d-0x0;var _0x5de146=_0x5eb8[_0x19409d];return _0x5de146;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x34cd1e,_0xaab8c0){var _0x26fe59=function(_0x23acd6){while(--_0x23acd6){_0x34cd1e['push'](_0x34cd1e['shift']());}};_0x26fe59(++_0xaab8c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xb10b[_0x3bab09];return _0x164376;};'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 bb9a43a..fbdc2de 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 _0xf09a=['port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','registry','indexOf','split'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xf09a,0x143));var _0xaf09=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0xf09a[_0x3bcf9e];return _0x1bb37c;};'use strict';function Trunk(_0x30a67c){this['id']=_0x30a67c['id']||0x0;this[_0xaf09('0x0')]=_0x30a67c[_0xaf09('0x0')]||![];this[_0xaf09('0x1')]=_0x30a67c[_0xaf09('0x1')]||'';this['state']=_0xaf09('0x2');this[_0xaf09('0x3')]=0x0;this['status']='unknown';this[_0xaf09('0x4')]=_0x30a67c[_0xaf09('0x4')]&&_0x30a67c['registry'][_0xaf09('0x5')](':')?_0x30a67c[_0xaf09('0x4')][_0xaf09('0x6')](':')[0x0]:'';this['host']='';this[_0xaf09('0x7')]='';this[_0xaf09('0x8')]='';this[_0xaf09('0x9')]='';this['refresh']='';this[_0xaf09('0xa')]=_0xaf09('0x2');this[_0xaf09('0xb')]='';this[_0xaf09('0xc')]='';this[_0xaf09('0xd')]=_0x30a67c['defaultuser']||'';}module[_0xaf09('0xe')]=Trunk; \ No newline at end of file +var _0x3137=['address','defaultuser','exports','active','name','unknown','status','registry','indexOf','split','host','port','domain','domainport','refresh'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x3137,0xd5));var _0x7313=function(_0x44ccbb,_0x2ea95a){_0x44ccbb=_0x44ccbb-0x0;var _0x2121bd=_0x3137[_0x44ccbb];return _0x2121bd;};'use strict';function Trunk(_0x40737c){this['id']=_0x40737c['id']||0x0;this[_0x7313('0x0')]=_0x40737c[_0x7313('0x0')]||![];this['name']=_0x40737c[_0x7313('0x1')]||'';this['state']=_0x7313('0x2');this['stateTime']=0x0;this[_0x7313('0x3')]='unknown';this[_0x7313('0x4')]=_0x40737c['registry']&&_0x40737c[_0x7313('0x4')][_0x7313('0x5')](':')?_0x40737c[_0x7313('0x4')][_0x7313('0x6')](':')[0x0]:'';this[_0x7313('0x7')]='';this[_0x7313('0x8')]='';this[_0x7313('0x9')]='';this[_0x7313('0xa')]='';this[_0x7313('0xb')]='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0x7313('0xc')]='';this[_0x7313('0xd')]=_0x40737c[_0x7313('0xd')]||'';}module[_0x7313('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 b6f6a0a..9fa9f4f 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 _0x28a3=['none','mandatoryDisposition','exports','exten'];(function(_0x3cd846,_0x488086){var _0x4e89e4=function(_0x125408){while(--_0x125408){_0x3cd846['push'](_0x3cd846['shift']());}};_0x4e89e4(++_0x488086);}(_0x28a3,0x1c7));var _0x328a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x28a3[_0x42cae2];return _0x5f256f;};'use strict';function voiceExtension(_0x3c38d0){this['id']=_0x3c38d0['id']||0x0;this[_0x328a('0x0')]=_0x3c38d0['exten']||'';this['recordingFormat']=_0x3c38d0['recordingFormat']||_0x328a('0x1');this[_0x328a('0x2')]=_0x3c38d0[_0x328a('0x2')]||![];}module[_0x328a('0x3')]=voiceExtension; \ No newline at end of file +var _0x9a91=['recordingFormat','mandatoryDisposition','exten'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x9a91,0x1df));var _0x19a9=function(_0x1ab0c3,_0x1b3507){_0x1ab0c3=_0x1ab0c3-0x0;var _0x413960=_0x9a91[_0x1ab0c3];return _0x413960;};'use strict';function voiceExtension(_0x1d7325){this['id']=_0x1d7325['id']||0x0;this['exten']=_0x1d7325[_0x19a9('0x0')]||'';this[_0x19a9('0x1')]=_0x1d7325[_0x19a9('0x1')]||'none';this['mandatoryDisposition']=_0x1d7325[_0x19a9('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 5660dac..cea32cc 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 _0xfcd2=['dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','wrandom','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','sumBillable','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0x3aaeda,_0x268877){var _0x2b2922=function(_0x218a62){while(--_0x218a62){_0x3aaeda['push'](_0x3aaeda['shift']());}};_0x2b2922(++_0x268877);}(_0xfcd2,0x13f));var _0x2fcd=function(_0x463a3f,_0x511234){_0x463a3f=_0x463a3f-0x0;var _0x323ace=_0xfcd2[_0x463a3f];return _0x323ace;};'use strict';var monitorFormat={'wav':_0x2fcd('0x0'),'wav49':_0x2fcd('0x1'),'gsm':_0x2fcd('0x2')};var strategy={'fewestcalls':_0x2fcd('0x3'),'leastrecent':_0x2fcd('0x4'),'linear':_0x2fcd('0x5'),'random':'random','ringall':_0x2fcd('0x6'),'rr':_0x2fcd('0x7'),'rrmemory':_0x2fcd('0x8'),'rrordered':'rrordered','wrandom':_0x2fcd('0x9')};function VoiceQueue(_0x565777){this['id']=_0x565777['id']||0x0;this[_0x2fcd('0xa')]=_0x565777['name']||'';this[_0x2fcd('0xb')]=_0x565777[_0x2fcd('0xb')]||'';this[_0x2fcd('0xc')]=_0x565777['type']||_0x2fcd('0xd');this['waiting']=0x0;this[_0x2fcd('0xe')]=0x0;this['answered']=0x0;this[_0x2fcd('0xf')]=0x0;this[_0x2fcd('0x10')]=0x0;this[_0x2fcd('0x11')]=0x0;this['unmanaged']=0x0;this[_0x2fcd('0x12')]=0x0;this[_0x2fcd('0x13')]=0x0;this[_0x2fcd('0x14')]=0x0;this[_0x2fcd('0x15')]=0x0;this[_0x2fcd('0x16')]=0x0;this[_0x2fcd('0x17')]=0x0;this[_0x2fcd('0x18')]=0x0;this['onHold']=0x0;this[_0x2fcd('0x19')]=0x0;this[_0x2fcd('0x1a')]=0x0;this[_0x2fcd('0x1b')]=0x0;this['talking']=0x0;this[_0x2fcd('0x1c')]=0x0;this[_0x2fcd('0x1d')]=0x0;this[_0x2fcd('0x1e')]=_0x565777[_0x2fcd('0x1e')]||![];this[_0x2fcd('0x1f')]=_0x565777[_0x2fcd('0x1f')]||0xa;this[_0x2fcd('0x20')]=_0x565777[_0x2fcd('0x20')]||'no';this[_0x2fcd('0x21')]=!![];this[_0x2fcd('0x22')]='';this[_0x2fcd('0x23')]='';this['originated']=0x0;this[_0x2fcd('0x24')]=0x0;this['dialTimezone']=_0x565777[_0x2fcd('0x25')]||null;this[_0x2fcd('0x26')]=_0x565777[_0x2fcd('0x26')]?_0x565777[_0x2fcd('0x26')]:null;this['dialActive']=_0x565777[_0x2fcd('0x27')];this['dialMethod']=_0x565777[_0x2fcd('0x28')]||_0x2fcd('0x29');this[_0x2fcd('0x2a')]=_0x565777[_0x2fcd('0x2a')]||0x0;this[_0x2fcd('0x2b')]=_0x565777['dialLimitQueue']||0x0;this[_0x2fcd('0x2c')]=_0x565777[_0x2fcd('0x2c')]||0x1;this['dialPredictiveOptimization']=_0x565777['dialPredictiveOptimization']||_0x2fcd('0x2d');this[_0x2fcd('0x2e')]=_0x565777[_0x2fcd('0x2e')]||0.03;this[_0x2fcd('0x2f')]=_0x565777[_0x2fcd('0x2f')]||0x258;this['dialOriginateCallerIdName']=_0x565777[_0x2fcd('0x30')]||_0x2fcd('0x31');this['dialOriginateCallerIdNumber']=_0x565777[_0x2fcd('0x32')]||_0x2fcd('0x31');this[_0x2fcd('0x33')]=_0x565777['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x565777['dialQueueOptions']||_0x2fcd('0x34');this[_0x2fcd('0x35')]=_0x565777[_0x2fcd('0x35')]||0x3;this[_0x2fcd('0x36')]=_0x565777[_0x2fcd('0x36')]||undefined;this[_0x2fcd('0x37')]=_0x565777[_0x2fcd('0x37')]||0x3;this['dialCongestionRetryFrequency']=_0x565777[_0x2fcd('0x38')]||0x96;this[_0x2fcd('0x39')]=_0x565777[_0x2fcd('0x39')]||0x3;this['dialBusyRetryFrequency']=_0x565777['dialBusyRetryFrequency']||0x96;this[_0x2fcd('0x3a')]=_0x565777['dialNoAnswerMaxRetry']||0x3;this[_0x2fcd('0x3b')]=_0x565777[_0x2fcd('0x3b')]||0x96;this[_0x2fcd('0x3c')]=_0x565777[_0x2fcd('0x3c')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x565777[_0x2fcd('0x3d')]||0x96;this[_0x2fcd('0x3e')]=_0x565777[_0x2fcd('0x3e')]||0x3;this[_0x2fcd('0x3f')]=_0x565777['dialDropRetryFrequency']||0x96;this[_0x2fcd('0x40')]=_0x565777[_0x2fcd('0x40')]||0x3;this['dialAbandonedRetryFrequency']=_0x565777['dialAbandonedRetryFrequency']||0x96;this[_0x2fcd('0x41')]=_0x565777[_0x2fcd('0x41')]||0x3;this[_0x2fcd('0x42')]=_0x565777[_0x2fcd('0x42')]||0x96;this[_0x2fcd('0x43')]=_0x565777['dialAgentRejectMaxRetry']||0x3;this[_0x2fcd('0x44')]=_0x565777[_0x2fcd('0x44')]||0x96;this[_0x2fcd('0x45')]=_0x565777['callAdditionalPhoneAfterMin']||0x3;this[_0x2fcd('0x46')]=_0x565777[_0x2fcd('0x46')]||0x4;this[_0x2fcd('0x47')]=_0x565777[_0x2fcd('0x47')]?_0x565777[_0x2fcd('0x47')]:undefined;this[_0x2fcd('0x48')]=_0x565777[_0x2fcd('0x48')]?_0x565777['TrunkBackup']:undefined;this[_0x2fcd('0x49')]=_0x565777['dialPrefix']||undefined;this[_0x2fcd('0x4a')]=_0x565777[_0x2fcd('0x4a')]?_0x565777[_0x2fcd('0x4a')]:undefined;this[_0x2fcd('0x4b')]=_0x565777[_0x2fcd('0x4b')]||'DESC';this[_0x2fcd('0x4c')]=_0x565777[_0x2fcd('0x4c')]||undefined;this[_0x2fcd('0x4d')]=_0x565777[_0x2fcd('0x4d')]||undefined;this[_0x2fcd('0x4e')]=strategy[_0x565777[_0x2fcd('0x4e')]];this[_0x2fcd('0x4f')]=!![];this[_0x2fcd('0x50')]=_0x565777[_0x2fcd('0x50')]||![];this[_0x2fcd('0x51')]=_0x565777['dialAMDInitialSilence'];this[_0x2fcd('0x52')]=_0x565777[_0x2fcd('0x52')];this[_0x2fcd('0x53')]=_0x565777['dialAMDAfterGreetingSilence'];this[_0x2fcd('0x54')]=_0x565777[_0x2fcd('0x54')];this[_0x2fcd('0x55')]=_0x565777[_0x2fcd('0x55')];this[_0x2fcd('0x56')]=_0x565777[_0x2fcd('0x56')];this[_0x2fcd('0x57')]=_0x565777[_0x2fcd('0x57')];this[_0x2fcd('0x58')]=_0x565777[_0x2fcd('0x58')];this[_0x2fcd('0x59')]=_0x565777['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x2fcd('0x5a')]=0x0;this[_0x2fcd('0x5b')]=_0x565777['timeout'];this[_0x2fcd('0x5c')]=0x0;this[_0x2fcd('0x5d')]=0x0;this[_0x2fcd('0x5e')]=0x0;this[_0x2fcd('0x5f')]=0x0;this[_0x2fcd('0x60')]=0x0;this[_0x2fcd('0x61')]=0x0;this[_0x2fcd('0x62')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x2fcd('0x63')]=0x0;this[_0x2fcd('0x64')]=0x0;this[_0x2fcd('0x65')]=0x0;this[_0x2fcd('0x66')]=0x0;this[_0x2fcd('0x67')]=0x0;this[_0x2fcd('0x68')]=0x0;this[_0x2fcd('0x69')]=undefined;this['startPredictive']=undefined;this[_0x2fcd('0x6a')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x2fcd('0x6b')]=0x0;this[_0x2fcd('0x6c')]=0x0;this[_0x2fcd('0x6d')]=0x0;this[_0x2fcd('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x2fcd('0x6f')]=0x0;this[_0x2fcd('0x70')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x2fcd('0x71')]=_0x565777[_0x2fcd('0x72')]||0x14;this[_0x2fcd('0x73')]=_0x565777['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x2fcd('0x74')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x2fcd('0x75')]=0x0;this[_0x2fcd('0x76')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x2fcd('0x77')]=0x0;this[_0x2fcd('0x78')]=_0x565777['dialRecallMeTimeout']||0x1e;this[_0x2fcd('0x79')]=_0x565777[_0x2fcd('0x79')]||![];this[_0x2fcd('0x7a')]=!!_0x565777[_0x2fcd('0x7a')]||![];this[_0x2fcd('0x7b')]=!!_0x565777[_0x2fcd('0x7b')]||![];this[_0x2fcd('0x7c')]=_0x565777[_0x2fcd('0x7c')]||undefined;this['dialAgiAfterHangupClient']=_0x565777['dialAgiAfterHangupClient']||![];this[_0x2fcd('0x7d')]=_0x565777[_0x2fcd('0x7d')]||![];this['monitor_format']=monitorFormat[_0x565777[_0x2fcd('0xb')]]?monitorFormat[_0x565777[_0x2fcd('0xb')]]:undefined;this['mandatoryDisposition']=_0x565777[_0x2fcd('0x7e')]||![];this[_0x2fcd('0x7f')]=_0x565777[_0x2fcd('0x7f')]?_0x565777[_0x2fcd('0x7f')]:undefined;this[_0x2fcd('0x80')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x0578=['TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','random','ringall','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','unmanaged','abandoned','available','busy','inUse','invalid','notInUse','onHold','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk'];(function(_0x8ca736,_0x3fc494){var _0x5f2e02=function(_0x295856){while(--_0x295856){_0x8ca736['push'](_0x8ca736['shift']());}};_0x5f2e02(++_0x3fc494);}(_0x0578,0x1b8));var _0x8057=function(_0x42facb,_0x168820){_0x42facb=_0x42facb-0x0;var _0x4d8c9e=_0x0578[_0x42facb];return _0x4d8c9e;};'use strict';var monitorFormat={'wav':_0x8057('0x0'),'wav49':_0x8057('0x1'),'gsm':_0x8057('0x2')};var strategy={'fewestcalls':_0x8057('0x3'),'leastrecent':_0x8057('0x4'),'linear':'linear','random':_0x8057('0x5'),'ringall':_0x8057('0x6'),'rr':'roundrobin','rrmemory':_0x8057('0x7'),'rrordered':_0x8057('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0x1b142e){this['id']=_0x1b142e['id']||0x0;this['name']=_0x1b142e[_0x8057('0x9')]||'';this[_0x8057('0xa')]=_0x1b142e['monitor_format']||'';this[_0x8057('0xb')]=_0x1b142e['type']||_0x8057('0xc');this[_0x8057('0xd')]=0x0;this[_0x8057('0xe')]=0x0;this[_0x8057('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x8057('0x10')]=0x0;this[_0x8057('0x11')]=0x0;this[_0x8057('0x12')]=0x0;this[_0x8057('0x13')]=0x0;this[_0x8057('0x14')]=0x0;this[_0x8057('0x15')]=0x0;this['loggedIn']=0x0;this[_0x8057('0x16')]=0x0;this[_0x8057('0x17')]=0x0;this['paused']=0x0;this[_0x8057('0x18')]=0x0;this[_0x8057('0x19')]=0x0;this['talking']=0x0;this[_0x8057('0x1a')]=0x0;this[_0x8057('0x1b')]=0x0;this['acw']=_0x1b142e[_0x8057('0x1c')]||![];this[_0x8057('0x1d')]=_0x1b142e[_0x8057('0x1d')]||0xa;this['autopause']=_0x1b142e[_0x8057('0x1e')]||'no';this[_0x8057('0x1f')]=!![];this[_0x8057('0x20')]='';this[_0x8057('0x21')]='';this[_0x8057('0x22')]=0x0;this[_0x8057('0x23')]=0x0;this[_0x8057('0x24')]=_0x1b142e[_0x8057('0x24')]||null;this[_0x8057('0x25')]=_0x1b142e[_0x8057('0x25')]?_0x1b142e['dialGlobalInterval']:null;this[_0x8057('0x26')]=_0x1b142e[_0x8057('0x26')];this[_0x8057('0x27')]=_0x1b142e[_0x8057('0x27')]||'progressive';this[_0x8057('0x28')]=_0x1b142e[_0x8057('0x28')]||0x0;this[_0x8057('0x29')]=_0x1b142e[_0x8057('0x29')]||0x0;this[_0x8057('0x2a')]=_0x1b142e[_0x8057('0x2a')]||0x1;this[_0x8057('0x2b')]=_0x1b142e[_0x8057('0x2b')]||_0x8057('0x2c');this[_0x8057('0x2d')]=_0x1b142e[_0x8057('0x2d')]||0.03;this[_0x8057('0x2e')]=_0x1b142e['dialPredictiveInterval']||0x258;this[_0x8057('0x2f')]=_0x1b142e[_0x8057('0x2f')]||'anonymous';this[_0x8057('0x30')]=_0x1b142e[_0x8057('0x30')]||'anonymous';this[_0x8057('0x31')]=_0x1b142e[_0x8057('0x31')]||0x1e;this['dialQueueOptions']=_0x1b142e[_0x8057('0x32')]||_0x8057('0x33');this['dialQueueTimeout']=_0x1b142e[_0x8057('0x34')]||0x3;this[_0x8057('0x35')]=_0x1b142e[_0x8057('0x35')]||undefined;this[_0x8057('0x36')]=_0x1b142e[_0x8057('0x36')]||0x3;this[_0x8057('0x37')]=_0x1b142e['dialCongestionRetryFrequency']||0x96;this[_0x8057('0x38')]=_0x1b142e[_0x8057('0x38')]||0x3;this[_0x8057('0x39')]=_0x1b142e['dialBusyRetryFrequency']||0x96;this[_0x8057('0x3a')]=_0x1b142e[_0x8057('0x3a')]||0x3;this[_0x8057('0x3b')]=_0x1b142e['dialNoAnswerRetryFrequency']||0x96;this[_0x8057('0x3c')]=_0x1b142e['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1b142e[_0x8057('0x3d')]||0x96;this['dialDropMaxRetry']=_0x1b142e['dialDropMaxRetry']||0x3;this[_0x8057('0x3e')]=_0x1b142e['dialDropRetryFrequency']||0x96;this[_0x8057('0x3f')]=_0x1b142e['dialAbandonedMaxRetry']||0x3;this[_0x8057('0x40')]=_0x1b142e['dialAbandonedRetryFrequency']||0x96;this[_0x8057('0x41')]=_0x1b142e[_0x8057('0x41')]||0x3;this[_0x8057('0x42')]=_0x1b142e[_0x8057('0x42')]||0x96;this[_0x8057('0x43')]=_0x1b142e[_0x8057('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1b142e[_0x8057('0x44')]||0x96;this[_0x8057('0x45')]=_0x1b142e[_0x8057('0x45')]||0x3;this['dialGlobalMaxRetry']=_0x1b142e[_0x8057('0x46')]||0x4;this[_0x8057('0x47')]=_0x1b142e[_0x8057('0x47')]?_0x1b142e['Trunk']:undefined;this[_0x8057('0x48')]=_0x1b142e[_0x8057('0x48')]?_0x1b142e['TrunkBackup']:undefined;this['dialPrefix']=_0x1b142e[_0x8057('0x49')]||undefined;this[_0x8057('0x4a')]=_0x1b142e[_0x8057('0x4a')]?_0x1b142e[_0x8057('0x4a')]:undefined;this[_0x8057('0x4b')]=_0x1b142e[_0x8057('0x4b')]||_0x8057('0x4c');this[_0x8057('0x4d')]=_0x1b142e[_0x8057('0x4d')]||undefined;this[_0x8057('0x4e')]=_0x1b142e[_0x8057('0x4e')]||undefined;this[_0x8057('0x4f')]=strategy[_0x1b142e['strategy']];this[_0x8057('0x50')]=!![];this[_0x8057('0x51')]=_0x1b142e[_0x8057('0x51')]||![];this[_0x8057('0x52')]=_0x1b142e[_0x8057('0x52')];this[_0x8057('0x53')]=_0x1b142e[_0x8057('0x53')];this[_0x8057('0x54')]=_0x1b142e[_0x8057('0x54')];this[_0x8057('0x55')]=_0x1b142e[_0x8057('0x55')];this['dialAMDMinWordLength']=_0x1b142e[_0x8057('0x56')];this[_0x8057('0x57')]=_0x1b142e['dialAMDBetweenWordsSilence'];this[_0x8057('0x58')]=_0x1b142e[_0x8057('0x58')];this[_0x8057('0x59')]=_0x1b142e[_0x8057('0x59')];this[_0x8057('0x5a')]=_0x1b142e['dialAMDMaximumWordLength'];this[_0x8057('0x5b')]=0x0;this['pTalking']=0x0;this['timeout']=_0x1b142e['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x8057('0x5c')]=0x0;this[_0x8057('0x5d')]=0x0;this[_0x8057('0x5e')]=0x0;this[_0x8057('0x5f')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x8057('0x60')]=0x0;this[_0x8057('0x61')]=0x0;this[_0x8057('0x62')]=0x0;this[_0x8057('0x63')]=0x0;this[_0x8057('0x64')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x8057('0x65')]=undefined;this[_0x8057('0x66')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x8057('0x67')]=0x0;this[_0x8057('0x68')]=0x0;this[_0x8057('0x69')]=0x0;this[_0x8057('0x6a')]=0x0;this[_0x8057('0x6b')]=0x0;this[_0x8057('0x6c')]=0x0;this[_0x8057('0x6d')]=0x0;this[_0x8057('0x6e')]=0x0;this[_0x8057('0x6f')]=_0x1b142e[_0x8057('0x70')]||0x14;this[_0x8057('0x71')]=_0x1b142e[_0x8057('0x70')]||0xa;this[_0x8057('0x72')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x8057('0x73')]=0x1;this[_0x8057('0x74')]=0x0;this[_0x8057('0x75')]=0x0;this[_0x8057('0x76')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1b142e['dialRecallMeTimeout']||0x1e;this[_0x8057('0x77')]=_0x1b142e['dialRecallInQueue']||![];this[_0x8057('0x78')]=!!_0x1b142e['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x1b142e[_0x8057('0x79')]||![];this[_0x8057('0x7a')]=_0x1b142e['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x1b142e[_0x8057('0x7b')]||![];this['dialAgiAfterHangupAgent']=_0x1b142e['dialAgiAfterHangupAgent']||![];this[_0x8057('0xa')]=monitorFormat[_0x1b142e[_0x8057('0xa')]]?monitorFormat[_0x1b142e['monitor_format']]:undefined;this[_0x8057('0x7c')]=_0x1b142e[_0x8057('0x7c')]||![];this[_0x8057('0x7d')]=_0x1b142e[_0x8057('0x7d')]?_0x1b142e[_0x8057('0x7d')]:undefined;this[_0x8057('0x7e')]=![];}module[_0x8057('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index f5675be..ef8e93b 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x565f=['loggedin','length','SIP/','online','incall','includes','booked','queue','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','preview','exports','loggedIn','loggedInDb','paused','talking','waiting','available','answered','inUse','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','prototype','createReport'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x565f,0x68));var _0xf565=function(_0xf562ec,_0xfbc235){_0xf562ec=_0xf562ec-0x0;var _0x297e4d=_0x565f[_0xf562ec];return _0x297e4d;};'use strict';var INBOUND_COUNTERS=['available',_0xf565('0x0'),_0xf565('0x1'),_0xf565('0x2'),'ringing',_0xf565('0x3'),_0xf565('0x4')];var OUTBOUND_COUNTERS=[_0xf565('0x5'),_0xf565('0x6'),_0xf565('0x7'),'loggedIn','loggedInDb','originated',_0xf565('0x8'),'outboundAnswerCallsDay',_0xf565('0x9'),_0xf565('0xa'),_0xf565('0xb'),'outboundNoAnswerCallsDay',_0xf565('0xc'),'outboundReCallsDay',_0xf565('0xd'),'outboundUnknownCallsDay',_0xf565('0x2'),_0xf565('0xe'),_0xf565('0x3'),_0xf565('0xf'),_0xf565('0x10'),_0xf565('0x11'),'waiting'];function VoiceQueueSummary(_0x4cb8e1){this['id']=_0x4cb8e1['id'];this[_0xf565('0x12')]=_0x4cb8e1[_0xf565('0x12')];this[_0xf565('0x13')]=_0x4cb8e1[_0xf565('0x13')];this[_0xf565('0x14')]=_0x4cb8e1[_0xf565('0x14')]||0x0;this[_0xf565('0x6')]=_0x4cb8e1[_0xf565('0x6')]||0x0;this[_0xf565('0x5')]=_0x4cb8e1[_0xf565('0x5')]||0x0;this['busy']=_0x4cb8e1[_0xf565('0x15')]||0x0;this[_0xf565('0x7')]=_0x4cb8e1['inUse']||0x0;this[_0xf565('0x16')]=_0x4cb8e1[_0xf565('0x16')]||0x0;this[_0xf565('0x0')]=_0x4cb8e1[_0xf565('0x0')]||0x0;this[_0xf565('0x1')]=_0x4cb8e1['loggedInDb']||0x0;this[_0xf565('0x17')]=_0x4cb8e1['onHold']||0x0;this['notInUse']=_0x4cb8e1[_0xf565('0x18')]||0x0;this[_0xf565('0x2')]=_0x4cb8e1['paused']||0x0;this['ringing']=_0x4cb8e1[_0xf565('0x19')]||0x0;this['ringInUse']=_0x4cb8e1[_0xf565('0x1a')];this[_0xf565('0xf')]=_0x4cb8e1[_0xf565('0xf')];this['sumDuration']=_0x4cb8e1['sumDuration'];this[_0xf565('0x1b')]=_0x4cb8e1[_0xf565('0x1b')]||0x0;this[_0xf565('0x3')]=_0x4cb8e1[_0xf565('0x3')]||0x0;this[_0xf565('0x11')]=_0x4cb8e1['total']||0x0;this[_0xf565('0x1c')]=_0x4cb8e1[_0xf565('0x1c')];this[_0xf565('0x1d')]=_0x4cb8e1[_0xf565('0x1d')]||0x0;this[_0xf565('0x1e')]=_0x4cb8e1[_0xf565('0x1e')]||0x0;this[_0xf565('0x1f')]=_0x4cb8e1[_0xf565('0x1f')]||0x0;this[_0xf565('0x4')]=_0x4cb8e1[_0xf565('0x4')]||0x0;if(_0x4cb8e1['type']===_0xf565('0x20')){this['pTalking']=_0x4cb8e1[_0xf565('0xe')]||0x0;this[_0xf565('0x21')]=_0x4cb8e1['dialActive'];this[_0xf565('0x22')]=_0x4cb8e1[_0xf565('0x22')];this[_0xf565('0x23')]=_0x4cb8e1[_0xf565('0x23')];this[_0xf565('0x24')]=_0x4cb8e1[_0xf565('0x24')];this[_0xf565('0x25')]=_0x4cb8e1[_0xf565('0x25')];this['dialPrefix']=_0x4cb8e1[_0xf565('0x26')];this[_0xf565('0x27')]=_0x4cb8e1[_0xf565('0x27')];this[_0xf565('0x28')]=_0x4cb8e1[_0xf565('0x28')];this['outboundAnswerCallsDay']=_0x4cb8e1[_0xf565('0x29')];this[_0xf565('0x9')]=_0x4cb8e1[_0xf565('0x9')];this[_0xf565('0xa')]=_0x4cb8e1[_0xf565('0xa')];this['outboundCongestionCallsDay']=_0x4cb8e1[_0xf565('0xb')];this[_0xf565('0x2a')]=_0x4cb8e1[_0xf565('0x2a')];this[_0xf565('0x2b')]=_0x4cb8e1[_0xf565('0x2b')];this[_0xf565('0x2c')]=_0x4cb8e1['outboundDropCallsDayTimeout'];this[_0xf565('0x2d')]=_0x4cb8e1[_0xf565('0x2d')];this['outboundNoSuchCallsDay']=_0x4cb8e1[_0xf565('0xc')];this[_0xf565('0x2e')]=_0x4cb8e1[_0xf565('0x2e')];this[_0xf565('0x2f')]=_0x4cb8e1[_0xf565('0x2f')];this[_0xf565('0xd')]=_0x4cb8e1[_0xf565('0xd')];this[_0xf565('0x30')]=_0x4cb8e1['outboundUnknownCallsDay'];this[_0xf565('0x31')]=_0x4cb8e1[_0xf565('0x31')];this[_0xf565('0x32')]=_0x4cb8e1['predictiveIntervalAvgHoldtime'];this[_0xf565('0x33')]=_0x4cb8e1[_0xf565('0x33')];this[_0xf565('0x34')]=_0x4cb8e1[_0xf565('0x34')];this[_0xf565('0x35')]=_0x4cb8e1['predictiveIntervalDroppedCallsTimeout'];this[_0xf565('0x36')]=_0x4cb8e1['predictiveIntervalErlangCalls'];this[_0xf565('0x37')]=_0x4cb8e1[_0xf565('0x37')];this['predictiveIntervalHitRate']=_0x4cb8e1['predictiveIntervalHitRate'];this[_0xf565('0x38')]=_0x4cb8e1[_0xf565('0x38')];this['predictiveIntervalPauses']=_0x4cb8e1[_0xf565('0x39')];this['predictiveIntervalAvailable']=_0x4cb8e1['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x4cb8e1['predictiveIntervalTotalCalls'];this[_0xf565('0x3a')]=_0x4cb8e1[_0xf565('0x3a')];this[_0xf565('0x3b')]=_0x4cb8e1['erlangCalls'];this[_0xf565('0x3c')]=_0x4cb8e1[_0xf565('0x3c')];this[_0xf565('0x3d')]=_0x4cb8e1['erlangAbandonmentRate'];this[_0xf565('0x3e')]=_0x4cb8e1['erlangBusyFactor'];this[_0xf565('0x3f')]=_0x4cb8e1[_0xf565('0x3f')];this[_0xf565('0x40')]=_0x4cb8e1['startProgressive'];this[_0xf565('0x41')]=_0x4cb8e1['message'];this[_0xf565('0x42')]=_0x4cb8e1['statusMessage'];}if(_0x4cb8e1[_0xf565('0x43')]){this[_0xf565('0x43')]={'id':_0x4cb8e1['Trunk']['id'],'name':_0x4cb8e1[_0xf565('0x43')][_0xf565('0x12')],'active':_0x4cb8e1[_0xf565('0x43')]['active'],'callerid':_0x4cb8e1[_0xf565('0x43')]['callerid']};}}VoiceQueueSummary[_0xf565('0x44')][_0xf565('0x45')]=function(_0x3c43ff,_0x45cde0,_0xf9e659,_0x2321f5){this['loggedInDb']=0x0;this['talking']=0x0;this[_0xf565('0x2')]=0x0;this[_0xf565('0x1e')]=0x0;this[_0xf565('0x18')]=0x0;this[_0xf565('0x7')]=0x0;this[_0xf565('0x15')]=0x0;this['invalid']=0x0;this[_0xf565('0x1d')]=0x0;this[_0xf565('0x19')]=0x0;this[_0xf565('0x1a')]=0x0;this[_0xf565('0x17')]=0x0;if(_0xf9e659){if(_0xf9e659['available']){this[_0xf565('0x5')]=Number(_0xf9e659['available']);}if(_0xf9e659['loggedin']){this[_0xf565('0x0')]=Number(_0xf9e659[_0xf565('0x46')]);}if(_0xf9e659['callers']){this['waiting']=Number(_0xf9e659['callers']);}}for(var _0x307cc7=0x0;_0x307cc7<_0x3c43ff[_0xf565('0x47')];_0x307cc7++){var _0x2b602f=_0x45cde0[_0xf565('0x48')+_0x3c43ff[_0x307cc7][_0xf565('0x12')]];if(_0x2b602f&&_0x2b602f[_0xf565('0x49')]){this[_0xf565('0x1')]+=0x1;}if(_0x3c43ff[_0x307cc7][_0xf565('0x4a')]==='1'){this[_0xf565('0x3')]+=0x1;}if(_0x3c43ff[_0x307cc7][_0xf565('0x2')]==='1'&&!['2','7','8'][_0xf565('0x4b')](_0x3c43ff[_0x307cc7]['status'])){this['paused']+=0x1;}switch(_0x3c43ff[_0x307cc7]['status']){case'0':this[_0xf565('0x1e')]+=0x1;break;case'1':this[_0xf565('0x18')]+=0x1;break;case'2':this[_0xf565('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xf565('0x1d')]+=0x1;break;case'6':this[_0xf565('0x19')]+=0x1;break;case'7':this[_0xf565('0x1a')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xf565('0x22')]===_0xf565('0x4c')){var _0x1bd9f4=Object['keys'](_0x2321f5);for(var _0x5b6cbb=0x0;_0x5b6cbb<_0x1bd9f4[_0xf565('0x47')];_0x5b6cbb++){var _0x4ed6f5=_0x1bd9f4[_0x5b6cbb];var _0x3ee900=_0x2321f5[_0x4ed6f5];if(_0x3ee900[_0xf565('0x4d')]===this[_0xf565('0x12')]&&_0x3ee900[_0xf565('0x1c')]===_0xf565('0x4e')&&_0x3ee900[_0xf565('0x4f')]===_0xf565('0x50')){this[_0xf565('0x3')]+=0x1;}}if(this[_0xf565('0x3')]>this[_0xf565('0x7')]){this[_0xf565('0x3')]=this[_0xf565('0x7')];}this[_0xf565('0xe')]=0x0;}return this;};VoiceQueueSummary[_0xf565('0x44')]['compareToInboundQueue']=function(_0x4a49de){var _0x3deb88=![];if(_0x4a49de){_0x3deb88=INBOUND_COUNTERS[_0xf565('0x51')](function(_0x567c8e){return this[_0x567c8e]!==_0x4a49de[_0x567c8e];},this);}return _0x3deb88;};VoiceQueueSummary[_0xf565('0x44')][_0xf565('0x52')]=function(_0x52998f){var _0x4b60ae=![];var _0x13296f=![];var _0x1b1741=![];if(_0x52998f){_0x4b60ae=this[_0xf565('0x22')]!==_0x52998f[_0xf565('0x22')]||this[_0xf565('0x21')]!==_0x52998f[_0xf565('0x21')]||this[_0xf565('0x41')]!==_0x52998f[_0xf565('0x41')]||this['statusMessage']!==_0x52998f[_0xf565('0x42')];_0x13296f=OUTBOUND_COUNTERS['some'](function(_0x46a1b8){return this[_0x46a1b8]!==_0x52998f[_0x46a1b8];},this);if(this[_0xf565('0x43')]&&_0x52998f['Trunk']){_0x1b1741=this['Trunk'][_0xf565('0x12')]!==_0x52998f[_0xf565('0x43')][_0xf565('0x12')]||this[_0xf565('0x43')]['active']!==_0x52998f[_0xf565('0x43')][_0xf565('0x53')];}}return _0x4b60ae||_0x13296f||_0x1b1741;};VoiceQueueSummary[_0xf565('0x44')][_0xf565('0x54')]=function(_0x400021){this['answered']=_0x400021[_0xf565('0x6')];this['message']=_0x400021[_0xf565('0x41')];this['statusMessage']=_0x400021['statusMessage'];this[_0xf565('0x3a')]=_0x400021[_0xf565('0x3a')];this[_0xf565('0x8')]=_0x400021[_0xf565('0x8')];this[_0xf565('0x29')]=_0x400021[_0xf565('0x29')];this['outboundBlacklistCallsDay']=_0x400021['outboundBlacklistCallsDay'];this[_0xf565('0xa')]=_0x400021[_0xf565('0xa')];this['outboundCongestionCallsDay']=_0x400021['outboundCongestionCallsDay'];this[_0xf565('0x2d')]=_0x400021[_0xf565('0x2d')];this[_0xf565('0xc')]=_0x400021['outboundNoSuchCallsDay'];this[_0xf565('0x2f')]=_0x400021[_0xf565('0x2f')];this[_0xf565('0xd')]=_0x400021[_0xf565('0xd')];this['outboundUnknownCallsDay']=_0x400021[_0xf565('0x30')];this[_0xf565('0xf')]=_0x400021['sumBillable'];this[_0xf565('0x10')]=_0x400021[_0xf565('0x10')];this['total']=_0x400021[_0xf565('0x11')];if(this['dialMethod']===_0xf565('0x55')){this[_0xf565('0xe')]=_0x400021['pTalking'];}};module[_0xf565('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0x9b8e=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','invalid','loggedIn','onHold','notInUse','ringing','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','busy','callers','length','SIP/','online','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','some','compareToOutboundQueue','active','updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','waiting','answered','inUse','originated','outboundAbandonedCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b8e,0x158));var _0xe9b8=function(_0x568278,_0x683957){_0x568278=_0x568278-0x0;var _0x101437=_0x9b8e[_0x568278];return _0x101437;};'use strict';var INBOUND_COUNTERS=[_0xe9b8('0x0'),'loggedIn',_0xe9b8('0x1'),_0xe9b8('0x2'),'ringing','talking',_0xe9b8('0x3')];var OUTBOUND_COUNTERS=['available',_0xe9b8('0x4'),_0xe9b8('0x5'),'loggedIn',_0xe9b8('0x1'),_0xe9b8('0x6'),_0xe9b8('0x7'),_0xe9b8('0x8'),_0xe9b8('0x9'),_0xe9b8('0xa'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xe9b8('0xb'),_0xe9b8('0xc'),_0xe9b8('0xd'),_0xe9b8('0xe'),'paused',_0xe9b8('0xf'),'talking',_0xe9b8('0x10'),_0xe9b8('0x11'),_0xe9b8('0x12'),_0xe9b8('0x3')];function VoiceQueueSummary(_0x1fa429){this['id']=_0x1fa429['id'];this[_0xe9b8('0x13')]=_0x1fa429[_0xe9b8('0x13')];this[_0xe9b8('0x14')]=_0x1fa429[_0xe9b8('0x14')];this[_0xe9b8('0x15')]=_0x1fa429[_0xe9b8('0x15')]||0x0;this[_0xe9b8('0x4')]=_0x1fa429[_0xe9b8('0x4')]||0x0;this['available']=_0x1fa429['available']||0x0;this['busy']=_0x1fa429['busy']||0x0;this[_0xe9b8('0x5')]=_0x1fa429['inUse']||0x0;this['invalid']=_0x1fa429[_0xe9b8('0x16')]||0x0;this[_0xe9b8('0x17')]=_0x1fa429[_0xe9b8('0x17')]||0x0;this[_0xe9b8('0x1')]=_0x1fa429[_0xe9b8('0x1')]||0x0;this[_0xe9b8('0x18')]=_0x1fa429['onHold']||0x0;this[_0xe9b8('0x19')]=_0x1fa429[_0xe9b8('0x19')]||0x0;this[_0xe9b8('0x2')]=_0x1fa429[_0xe9b8('0x2')]||0x0;this[_0xe9b8('0x1a')]=_0x1fa429[_0xe9b8('0x1a')]||0x0;this['ringInUse']=_0x1fa429[_0xe9b8('0x1b')];this['sumBillable']=_0x1fa429[_0xe9b8('0x10')];this[_0xe9b8('0x11')]=_0x1fa429[_0xe9b8('0x11')];this['sumHoldTime']=_0x1fa429[_0xe9b8('0x1c')]||0x0;this[_0xe9b8('0x1d')]=_0x1fa429[_0xe9b8('0x1d')]||0x0;this[_0xe9b8('0x12')]=_0x1fa429[_0xe9b8('0x12')]||0x0;this['type']=_0x1fa429[_0xe9b8('0x1e')];this['unavailable']=_0x1fa429[_0xe9b8('0x1f')]||0x0;this[_0xe9b8('0x20')]=_0x1fa429[_0xe9b8('0x20')]||0x0;this[_0xe9b8('0x21')]=_0x1fa429[_0xe9b8('0x21')]||0x0;this['waiting']=_0x1fa429['waiting']||0x0;if(_0x1fa429[_0xe9b8('0x1e')]===_0xe9b8('0x22')){this[_0xe9b8('0xf')]=_0x1fa429['pTalking']||0x0;this['dialActive']=_0x1fa429[_0xe9b8('0x23')];this['dialMethod']=_0x1fa429[_0xe9b8('0x24')];this['dialOriginateCallerIdName']=_0x1fa429[_0xe9b8('0x25')];this[_0xe9b8('0x26')]=_0x1fa429[_0xe9b8('0x26')];this['dialOriginateTimeout']=_0x1fa429[_0xe9b8('0x27')];this['dialPrefix']=_0x1fa429[_0xe9b8('0x28')];this['temp']=_0x1fa429[_0xe9b8('0x29')];this[_0xe9b8('0x2a')]=_0x1fa429[_0xe9b8('0x2a')];this[_0xe9b8('0x8')]=_0x1fa429[_0xe9b8('0x8')];this[_0xe9b8('0x9')]=_0x1fa429[_0xe9b8('0x9')];this[_0xe9b8('0xa')]=_0x1fa429['outboundBusyCallsDay'];this[_0xe9b8('0x2b')]=_0x1fa429[_0xe9b8('0x2b')];this[_0xe9b8('0x2c')]=_0x1fa429[_0xe9b8('0x2c')];this[_0xe9b8('0x2d')]=_0x1fa429['outboundDropCallsDayCallersExit'];this[_0xe9b8('0x2e')]=_0x1fa429[_0xe9b8('0x2e')];this[_0xe9b8('0x2f')]=_0x1fa429[_0xe9b8('0x2f')];this[_0xe9b8('0xb')]=_0x1fa429[_0xe9b8('0xb')];this['outboundOriginateFailureCallsDay']=_0x1fa429['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x1fa429['outboundReCallsDay'];this[_0xe9b8('0xd')]=_0x1fa429[_0xe9b8('0xd')];this[_0xe9b8('0xe')]=_0x1fa429['outboundUnknownCallsDay'];this[_0xe9b8('0x30')]=_0x1fa429['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x1fa429[_0xe9b8('0x31')];this[_0xe9b8('0x32')]=_0x1fa429['predictiveIntervalAvgTalktime'];this[_0xe9b8('0x33')]=_0x1fa429[_0xe9b8('0x33')];this[_0xe9b8('0x34')]=_0x1fa429[_0xe9b8('0x34')];this[_0xe9b8('0x35')]=_0x1fa429['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x1fa429[_0xe9b8('0x36')];this['predictiveIntervalHitRate']=_0x1fa429[_0xe9b8('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x1fa429['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x1fa429[_0xe9b8('0x38')];this['predictiveIntervalAvailable']=_0x1fa429[_0xe9b8('0x39')];this['predictiveIntervalTotalCalls']=_0x1fa429['predictiveIntervalTotalCalls'];this['originated']=_0x1fa429[_0xe9b8('0x6')];this[_0xe9b8('0x3a')]=_0x1fa429[_0xe9b8('0x3a')];this[_0xe9b8('0x3b')]=_0x1fa429[_0xe9b8('0x3b')];this[_0xe9b8('0x3c')]=_0x1fa429[_0xe9b8('0x3c')];this[_0xe9b8('0x3d')]=_0x1fa429[_0xe9b8('0x3d')];this['startPredictive']=_0x1fa429['startPredictive'];this[_0xe9b8('0x3e')]=_0x1fa429['startProgressive'];this[_0xe9b8('0x3f')]=_0x1fa429[_0xe9b8('0x3f')];this[_0xe9b8('0x40')]=_0x1fa429[_0xe9b8('0x40')];}if(_0x1fa429[_0xe9b8('0x41')]){this[_0xe9b8('0x41')]={'id':_0x1fa429[_0xe9b8('0x41')]['id'],'name':_0x1fa429[_0xe9b8('0x41')][_0xe9b8('0x13')],'active':_0x1fa429[_0xe9b8('0x41')]['active'],'callerid':_0x1fa429[_0xe9b8('0x41')][_0xe9b8('0x42')]};}}VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x44')]=function(_0x2d7a6e,_0xef13b5,_0x4fa923,_0x5da168){this[_0xe9b8('0x1')]=0x0;this['talking']=0x0;this[_0xe9b8('0x2')]=0x0;this[_0xe9b8('0x20')]=0x0;this[_0xe9b8('0x19')]=0x0;this[_0xe9b8('0x5')]=0x0;this[_0xe9b8('0x45')]=0x0;this['invalid']=0x0;this[_0xe9b8('0x1f')]=0x0;this[_0xe9b8('0x1a')]=0x0;this['ringInUse']=0x0;this[_0xe9b8('0x18')]=0x0;if(_0x4fa923){if(_0x4fa923[_0xe9b8('0x0')]){this[_0xe9b8('0x0')]=Number(_0x4fa923['available']);}if(_0x4fa923['loggedin']){this[_0xe9b8('0x17')]=Number(_0x4fa923['loggedin']);}if(_0x4fa923[_0xe9b8('0x46')]){this['waiting']=Number(_0x4fa923[_0xe9b8('0x46')]);}}for(var _0x36ba36=0x0;_0x36ba36<_0x2d7a6e[_0xe9b8('0x47')];_0x36ba36++){var _0x56147c=_0xef13b5[_0xe9b8('0x48')+_0x2d7a6e[_0x36ba36]['name']];if(_0x56147c&&_0x56147c[_0xe9b8('0x49')]){this['loggedInDb']+=0x1;}if(_0x2d7a6e[_0x36ba36][_0xe9b8('0x4a')]==='1'){this[_0xe9b8('0x1d')]+=0x1;}if(_0x2d7a6e[_0x36ba36]['paused']==='1'&&!['2','7','8'][_0xe9b8('0x4b')](_0x2d7a6e[_0x36ba36][_0xe9b8('0x4c')])){this[_0xe9b8('0x2')]+=0x1;}switch(_0x2d7a6e[_0x36ba36][_0xe9b8('0x4c')]){case'0':this[_0xe9b8('0x20')]+=0x1;break;case'1':this[_0xe9b8('0x19')]+=0x1;break;case'2':this[_0xe9b8('0x5')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xe9b8('0x16')]+=0x1;break;case'5':this[_0xe9b8('0x1f')]+=0x1;break;case'6':this[_0xe9b8('0x1a')]+=0x1;break;case'7':this[_0xe9b8('0x1b')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xe9b8('0x24')]===_0xe9b8('0x4d')){var _0x3459ab=Object[_0xe9b8('0x4e')](_0x5da168);for(var _0x30adfc=0x0;_0x30adfc<_0x3459ab[_0xe9b8('0x47')];_0x30adfc++){var _0x5dc32e=_0x3459ab[_0x30adfc];var _0x6a32ea=_0x5da168[_0x5dc32e];if(_0x6a32ea['queue']===this[_0xe9b8('0x13')]&&_0x6a32ea[_0xe9b8('0x1e')]===_0xe9b8('0x4f')&&_0x6a32ea[_0xe9b8('0x50')]===_0xe9b8('0x51')){this['talking']+=0x1;}}if(this[_0xe9b8('0x1d')]>this[_0xe9b8('0x5')]){this[_0xe9b8('0x1d')]=this[_0xe9b8('0x5')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xe9b8('0x43')]['compareToInboundQueue']=function(_0x125306){var _0x390f90=![];if(_0x125306){_0x390f90=INBOUND_COUNTERS[_0xe9b8('0x52')](function(_0x399d57){return this[_0x399d57]!==_0x125306[_0x399d57];},this);}return _0x390f90;};VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x53')]=function(_0x58bbcc){var _0x307fa8=![];var _0x18997a=![];var _0x4d208a=![];if(_0x58bbcc){_0x307fa8=this[_0xe9b8('0x24')]!==_0x58bbcc['dialMethod']||this[_0xe9b8('0x23')]!==_0x58bbcc['dialActive']||this[_0xe9b8('0x3f')]!==_0x58bbcc['message']||this[_0xe9b8('0x40')]!==_0x58bbcc[_0xe9b8('0x40')];_0x18997a=OUTBOUND_COUNTERS[_0xe9b8('0x52')](function(_0x1a600a){return this[_0x1a600a]!==_0x58bbcc[_0x1a600a];},this);if(this[_0xe9b8('0x41')]&&_0x58bbcc[_0xe9b8('0x41')]){_0x4d208a=this['Trunk']['name']!==_0x58bbcc[_0xe9b8('0x41')][_0xe9b8('0x13')]||this[_0xe9b8('0x41')][_0xe9b8('0x54')]!==_0x58bbcc[_0xe9b8('0x41')]['active'];}}return _0x307fa8||_0x18997a||_0x4d208a;};VoiceQueueSummary[_0xe9b8('0x43')][_0xe9b8('0x55')]=function(_0x5aa621){this[_0xe9b8('0x4')]=_0x5aa621['answered'];this[_0xe9b8('0x3f')]=_0x5aa621[_0xe9b8('0x3f')];this[_0xe9b8('0x40')]=_0x5aa621[_0xe9b8('0x40')];this[_0xe9b8('0x6')]=_0x5aa621['originated'];this['outboundAbandonedCallsDay']=_0x5aa621['outboundAbandonedCallsDay'];this[_0xe9b8('0x8')]=_0x5aa621[_0xe9b8('0x8')];this[_0xe9b8('0x9')]=_0x5aa621[_0xe9b8('0x9')];this['outboundBusyCallsDay']=_0x5aa621[_0xe9b8('0xa')];this[_0xe9b8('0x2b')]=_0x5aa621[_0xe9b8('0x2b')];this['outboundNoAnswerCallsDay']=_0x5aa621[_0xe9b8('0x2f')];this[_0xe9b8('0xb')]=_0x5aa621[_0xe9b8('0xb')];this[_0xe9b8('0xc')]=_0x5aa621['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x5aa621[_0xe9b8('0xd')];this[_0xe9b8('0xe')]=_0x5aa621[_0xe9b8('0xe')];this[_0xe9b8('0x10')]=_0x5aa621[_0xe9b8('0x10')];this['sumDuration']=_0x5aa621[_0xe9b8('0x11')];this[_0xe9b8('0x12')]=_0x5aa621[_0xe9b8('0x12')];if(this['dialMethod']===_0xe9b8('0x56')){this['pTalking']=_0x5aa621[_0xe9b8('0xf')];}};module[_0xe9b8('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6f2b506..8998017 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 _0x6bb7=['serverUrl','Configurations','username','accessKey','remoteUri'];(function(_0x2ed04c,_0x331357){var _0x5a0f96=function(_0x194c0d){while(--_0x194c0d){_0x2ed04c['push'](_0x2ed04c['shift']());}};_0x5a0f96(++_0x331357);}(_0x6bb7,0x18d));var _0x76bb=function(_0x11471c,_0x4859cd){_0x11471c=_0x11471c-0x0;var _0x54fd83=_0x6bb7[_0x11471c];return _0x54fd83;};'use strict';function VtigerAccount(_0x933b58){this['id']=_0x933b58['id']||0x0;this['name']=_0x933b58['name']||'';this['username']=_0x933b58[_0x76bb('0x0')]||'';this[_0x76bb('0x1')]=_0x933b58['accessKey']||'';this[_0x76bb('0x2')]=_0x933b58['remoteUri']||'';this[_0x76bb('0x3')]=_0x933b58['serverUrl']||'';this['Configurations']=_0x933b58[_0x76bb('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x22c3=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22c3,0xf4));var _0x322c=function(_0x2cc626,_0x5a5c33){_0x2cc626=_0x2cc626-0x0;var _0x3cb6fe=_0x22c3[_0x2cc626];return _0x3cb6fe;};'use strict';function VtigerAccount(_0x19157c){this['id']=_0x19157c['id']||0x0;this[_0x322c('0x0')]=_0x19157c['name']||'';this[_0x322c('0x1')]=_0x19157c[_0x322c('0x1')]||'';this['accessKey']=_0x19157c['accessKey']||'';this['remoteUri']=_0x19157c[_0x322c('0x2')]||'';this[_0x322c('0x3')]=_0x19157c['serverUrl']||'';this[_0x322c('0x4')]=_0x19157c['Configurations']||{};}module[_0x322c('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 8897e94..a87c329 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 _0x2f10=['name','username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2f10,0x1ae));var _0x02f1=function(_0x315307,_0x4beb3b){_0x315307=_0x315307-0x0;var _0xab1924=_0x2f10[_0x315307];return _0xab1924;};'use strict';function ZendeskAccount(_0x2a0f4f){this['id']=_0x2a0f4f['id']||0x0;this['name']=_0x2a0f4f[_0x02f1('0x0')]||'';this[_0x02f1('0x1')]=_0x2a0f4f[_0x02f1('0x1')]||'';this[_0x02f1('0x2')]=_0x2a0f4f[_0x02f1('0x2')]||'';this[_0x02f1('0x3')]=_0x2a0f4f[_0x02f1('0x3')]||'';this[_0x02f1('0x4')]=_0x2a0f4f[_0x02f1('0x4')]||'';this[_0x02f1('0x5')]=_0x2a0f4f[_0x02f1('0x5')]||'';this['type']=_0x2a0f4f[_0x02f1('0x6')]||'integrationTab';this['serverUrl']=_0x2a0f4f[_0x02f1('0x7')]||'';this[_0x02f1('0x8')]=_0x2a0f4f[_0x02f1('0x8')]||{};}module[_0x02f1('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x153d=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0xf4d05,_0x5e601f){var _0x47c971=function(_0x17aae3){while(--_0x17aae3){_0xf4d05['push'](_0xf4d05['shift']());}};_0x47c971(++_0x5e601f);}(_0x153d,0x136));var _0xd153=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x153d[_0x13b02f];return _0x12e9a6;};'use strict';function ZendeskAccount(_0x5100ae){this['id']=_0x5100ae['id']||0x0;this[_0xd153('0x0')]=_0x5100ae[_0xd153('0x0')]||'';this[_0xd153('0x1')]=_0x5100ae['username']||'';this[_0xd153('0x2')]=_0x5100ae[_0xd153('0x2')]||'';this['token']=_0x5100ae[_0xd153('0x3')]||'';this['remoteUri']=_0x5100ae[_0xd153('0x4')]||'';this[_0xd153('0x5')]=_0x5100ae[_0xd153('0x5')]||'';this[_0xd153('0x6')]=_0x5100ae[_0xd153('0x6')]||_0xd153('0x7');this[_0xd153('0x8')]=_0x5100ae[_0xd153('0x8')]||'';this[_0xd153('0x9')]=_0x5100ae[_0xd153('0x9')]||{};}module[_0xd153('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 5a57691..90b6c6a 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 _0x05d9=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x4c7f40,_0x5dc8a6){var _0x326e1f=function(_0x169687){while(--_0x169687){_0x4c7f40['push'](_0x4c7f40['shift']());}};_0x326e1f(++_0x5dc8a6);}(_0x05d9,0x1bc));var _0x905d=function(_0x249d4f,_0x1bc421){_0x249d4f=_0x249d4f-0x0;var _0x36b88c=_0x05d9[_0x249d4f];return _0x36b88c;};'use strict';function ZohoAccount(_0x3d1231){this['id']=_0x3d1231['id']||0x0;this[_0x905d('0x0')]=_0x3d1231[_0x905d('0x0')]||'';this['description']=_0x3d1231[_0x905d('0x1')]||'';this[_0x905d('0x2')]=_0x3d1231['host']||'';this[_0x905d('0x3')]=_0x3d1231[_0x905d('0x3')]||'';this['clientId']=_0x3d1231[_0x905d('0x4')]||'';this[_0x905d('0x5')]=_0x3d1231[_0x905d('0x5')]||'';this[_0x905d('0x6')]=_0x3d1231[_0x905d('0x6')]||'';this[_0x905d('0x7')]=_0x3d1231[_0x905d('0x7')]||'';this[_0x905d('0x8')]=_0x3d1231[_0x905d('0x8')]||'';this[_0x905d('0x9')]=_0x3d1231[_0x905d('0x9')]||{};}module[_0x905d('0xa')]=ZohoAccount; \ No newline at end of file +var _0xc2b9=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc2b9,0x137));var _0x9c2b=function(_0x49f01b,_0x6b061){_0x49f01b=_0x49f01b-0x0;var _0x2d5820=_0xc2b9[_0x49f01b];return _0x2d5820;};'use strict';function ZohoAccount(_0x17422b){this['id']=_0x17422b['id']||0x0;this[_0x9c2b('0x0')]=_0x17422b[_0x9c2b('0x0')]||'';this[_0x9c2b('0x1')]=_0x17422b['description']||'';this[_0x9c2b('0x2')]=_0x17422b[_0x9c2b('0x2')]||'';this[_0x9c2b('0x3')]=_0x17422b[_0x9c2b('0x3')]||'';this[_0x9c2b('0x4')]=_0x17422b['clientId']||'';this[_0x9c2b('0x5')]=_0x17422b[_0x9c2b('0x5')]||'';this['serverUrl']=_0x17422b[_0x9c2b('0x6')]||'';this['code']=_0x17422b[_0x9c2b('0x7')]||'';this[_0x9c2b('0x8')]=_0x17422b[_0x9c2b('0x8')]||'';this['Configurations']=_0x17422b[_0x9c2b('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 16a91a6..b2fb24e 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 _0x5f2f=['phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','membername','Agent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum'];(function(_0xa0dab4,_0x21d6ce){var _0xc4dc72=function(_0x321c11){while(--_0x321c11){_0xa0dab4['push'](_0xa0dab4['shift']());}};_0xc4dc72(++_0x21d6ce);}(_0x5f2f,0x73));var _0xf5f2=function(_0xdeece,_0x9a85f7){_0xdeece=_0xdeece-0x0;var _0x3ee945=_0x5f2f[_0xdeece];return _0x3ee945;};'use strict';var util=require(_0xf5f2('0x0'));var _=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));function checkNameSurname(_0x1a7be1,_0x1172dd,_0x174bc7){var _0x3c72ee='';if(!_[_0xf5f2('0x3')](_0x1172dd)&&'string'===typeof _0x1172dd){_0x3c72ee+=_0x1172dd;}if(!_['isNil'](_0x174bc7)&&_0xf5f2('0x4')===typeof _0x174bc7){_0x3c72ee+='\x20'+_0x174bc7;}if(_0x3c72ee!==''){return _0x3c72ee;}return _0x1a7be1;}function Action(_0x192215,_0xad7f65,_0x3eebf6,_0x3133bc,_0x473100){this['uniqueid']=_0x3eebf6||undefined;this[_0xf5f2('0x5')]=_0x192215['id'];this[_0xf5f2('0x6')]=_0xad7f65[_0xf5f2('0x7')];this['type']=_0xad7f65[_0xf5f2('0x8')];this[_0xf5f2('0x9')]=_0xf5f2('0x6');this['dialAnswer']=![];this[_0xf5f2('0xa')]=_['isNil'](_0x192215['Agent'])?undefined:_0x192215[_0xf5f2('0xb')][_0xf5f2('0x7')];this['channelAgent']=this[_0xf5f2('0xa')]?util[_0xf5f2('0xc')](_0xf5f2('0xd'),this[_0xf5f2('0xa')]):_0x3133bc||undefined;this[_0xf5f2('0xe')]=checkNameSurname(_0x192215[_0xf5f2('0xf')]['phone'],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x10')],_0x192215[_0xf5f2('0xf')][_0xf5f2('0x11')]);this[_0xf5f2('0x12')]=_0x192215['active']||![];this[_0xf5f2('0x13')]=_0x192215[_0xf5f2('0x14')];this[_0xf5f2('0x15')]=_0x192215[_0xf5f2('0x15')];this[_0xf5f2('0x16')]=_0x192215[_0xf5f2('0x16')]||0x0;this[_0xf5f2('0x17')]=_0x192215[_0xf5f2('0x17')]||0x0;this[_0xf5f2('0x18')]=_0x192215[_0xf5f2('0x18')]||0x0;this[_0xf5f2('0x19')]=(_0x192215[_0xf5f2('0x16')]||0x0)+(_0x192215[_0xf5f2('0x17')]||0x0)+(_0x192215[_0xf5f2('0x18')]||0x0)+(_0x192215[_0xf5f2('0x1a')]||0x0)+(_0x192215[_0xf5f2('0x1b')]||0x0)+(_0x192215[_0xf5f2('0x1c')]||0x0)+(_0x192215['countmachineretry']||0x0)+(_0x192215[_0xf5f2('0x1d')]||0x0);this[_0xf5f2('0x1a')]=_0x192215['countnosuchnumberretry']||0x0;this['countdropretry']=_0x192215[_0xf5f2('0x1b')]||0x0;this[_0xf5f2('0x1c')]=_0x192215['countabandonedretry']||0x0;this[_0xf5f2('0x1e')]=_0x192215[_0xf5f2('0x1e')]||0x0;this[_0xf5f2('0x1d')]=_0x192215[_0xf5f2('0x1d')]||0x0;this[_0xf5f2('0x1f')]=_0x192215['callback'];this[_0xf5f2('0x20')]=_0x192215[_0xf5f2('0x20')];this[_0xf5f2('0x21')]=_0x192215[_0xf5f2('0x21')];this[_0xf5f2('0x22')]=_0x192215['recallme'];this['ContactId']=_0x192215[_0xf5f2('0x23')];this[_0xf5f2('0x24')]=_0x192215[_0xf5f2('0x24')];this[_0xf5f2('0x25')]=_[_0xf5f2('0x3')](_0x192215[_0xf5f2('0xb')])?_0x192215[_0xf5f2('0x25')]:_0x192215[_0xf5f2('0xb')]['id'];this[_0xf5f2('0x26')]=_0x192215['VoiceQueueId'];this[_0xf5f2('0x27')]='';this[_0xf5f2('0x28')]='';}Action[_0xf5f2('0x29')][_0xf5f2('0x2a')]=function(){return util[_0xf5f2('0xc')](_0xf5f2('0x2b'),this['calleridname'],this['number']);};module[_0xf5f2('0x2c')]=Action; \ No newline at end of file +var _0x8603=['prototype','getCaller','number','exports','lodash','moment','isNil','string','uniqueid','type','queue','dialAnswer','Agent','name','channelAgent','format','SIP/%s','membername','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0xfcfb40,_0x47b9a0){var _0x16627c=function(_0x588e95){while(--_0x588e95){_0xfcfb40['push'](_0xfcfb40['shift']());}};_0x16627c(++_0x47b9a0);}(_0x8603,0x190));var _0x3860=function(_0x35b558,_0xeb7d5c){_0x35b558=_0x35b558-0x0;var _0x481909=_0x8603[_0x35b558];return _0x481909;};'use strict';var util=require('util');var _=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));function checkNameSurname(_0x96d2bc,_0x51bfda,_0x4961d6){var _0x2ebe8b='';if(!_[_0x3860('0x2')](_0x51bfda)&&_0x3860('0x3')===typeof _0x51bfda){_0x2ebe8b+=_0x51bfda;}if(!_['isNil'](_0x4961d6)&&_0x3860('0x3')===typeof _0x4961d6){_0x2ebe8b+='\x20'+_0x4961d6;}if(_0x2ebe8b!==''){return _0x2ebe8b;}return _0x96d2bc;}function Action(_0x56f8c5,_0xb0fc24,_0x40739b,_0x1eca44,_0xd3ce26){this[_0x3860('0x4')]=_0x40739b||undefined;this['idContact']=_0x56f8c5['id'];this['queue']=_0xb0fc24['name'];this[_0x3860('0x5')]=_0xb0fc24[_0x3860('0x5')];this['campaigntype']=_0x3860('0x6');this[_0x3860('0x7')]=![];this['membername']=_[_0x3860('0x2')](_0x56f8c5[_0x3860('0x8')])?undefined:_0x56f8c5['Agent'][_0x3860('0x9')];this[_0x3860('0xa')]=this['membername']?util[_0x3860('0xb')](_0x3860('0xc'),this[_0x3860('0xd')]):_0x1eca44||undefined;this[_0x3860('0xe')]=checkNameSurname(_0x56f8c5[_0x3860('0xf')][_0x3860('0x10')],_0x56f8c5[_0x3860('0xf')][_0x3860('0x11')],_0x56f8c5[_0x3860('0xf')][_0x3860('0x12')]);this['active']=_0x56f8c5[_0x3860('0x13')]||![];this[_0x3860('0x14')]=_0x56f8c5[_0x3860('0x10')];this[_0x3860('0x15')]=_0x56f8c5[_0x3860('0x15')];this[_0x3860('0x16')]=_0x56f8c5[_0x3860('0x16')]||0x0;this[_0x3860('0x17')]=_0x56f8c5[_0x3860('0x17')]||0x0;this[_0x3860('0x18')]=_0x56f8c5[_0x3860('0x18')]||0x0;this[_0x3860('0x19')]=(_0x56f8c5['countbusyretry']||0x0)+(_0x56f8c5['countcongestionretry']||0x0)+(_0x56f8c5[_0x3860('0x18')]||0x0)+(_0x56f8c5[_0x3860('0x1a')]||0x0)+(_0x56f8c5[_0x3860('0x1b')]||0x0)+(_0x56f8c5['countabandonedretry']||0x0)+(_0x56f8c5[_0x3860('0x1c')]||0x0)+(_0x56f8c5[_0x3860('0x1d')]||0x0);this[_0x3860('0x1a')]=_0x56f8c5[_0x3860('0x1a')]||0x0;this[_0x3860('0x1b')]=_0x56f8c5[_0x3860('0x1b')]||0x0;this[_0x3860('0x1e')]=_0x56f8c5[_0x3860('0x1e')]||0x0;this[_0x3860('0x1c')]=_0x56f8c5[_0x3860('0x1c')]||0x0;this[_0x3860('0x1d')]=_0x56f8c5[_0x3860('0x1d')]||0x0;this[_0x3860('0x1f')]=_0x56f8c5[_0x3860('0x1f')];this[_0x3860('0x20')]=_0x56f8c5['callbackuniqueid'];this[_0x3860('0x21')]=_0x56f8c5[_0x3860('0x21')];this[_0x3860('0x22')]=_0x56f8c5[_0x3860('0x22')];this[_0x3860('0x23')]=_0x56f8c5['ContactId'];this[_0x3860('0x24')]=_0x56f8c5['ListId'];this['UserId']=_[_0x3860('0x2')](_0x56f8c5[_0x3860('0x8')])?_0x56f8c5['UserId']:_0x56f8c5['Agent']['id'];this['VoiceQueueId']=_0x56f8c5[_0x3860('0x25')];this[_0x3860('0x26')]='';this[_0x3860('0x27')]='';}Action[_0x3860('0x28')][_0x3860('0x29')]=function(){return util[_0x3860('0xb')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x3860('0x2a')]);};module[_0x3860('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 65ac968..f59095b 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x28fd80,_0x257023){var _0x2ae8f8=function(_0x5a143d){while(--_0x5a143d){_0x28fd80['push'](_0x28fd80['shift']());}};_0x2ae8f8(++_0x257023);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x45878e,_0x21e33d){var _0x3e490f=function(_0x48de4){while(--_0x48de4){_0x45878e['push'](_0x45878e['shift']());}};_0x3e490f(++_0x21e33d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index b8e0b18..610e033 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 _0x7a85=['from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x7a85,0x15a));var _0x57a8=function(_0x72b4d2,_0x336804){_0x72b4d2=_0x72b4d2-0x0;var _0x504617=_0x7a85[_0x72b4d2];return _0x504617;};'use strict';var util=require('util');var BPromise=require(_0x57a8('0x0'));var logger=require(_0x57a8('0x1'))('preview');var cmHopper=require(_0x57a8('0x2'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x57a8('0x3'));var agentReportPreview=require(_0x57a8('0x4'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x9ed6cf){return function(_0x4ddd6c){logger['error'](_0x9ed6cf,util['inspect'](_0x4ddd6c,{'showHidden':![],'depth':null}));};}function create(_0x5ce5ef){return cmHopperHistory[_0x57a8('0x5')](_0x5ce5ef)[_0x57a8('0x6')](loggerCatch(_0x57a8('0x7')));}function createAgent(_0x5d1eb0){return BPromise['resolve']()[_0x57a8('0x8')](agentReportPreview['createHistory'](_0x5d1eb0))[_0x57a8('0x6')](loggerCatch(_0x57a8('0x7')));}function moveContact(_0x266184){return cmHopper[_0x57a8('0x9')](_0x266184,!![])[_0x57a8('0x6')](loggerCatch(_0x57a8('0xa')));}exports[_0x57a8('0xb')]=function(_0x42b691){return cmHopperBlack[_0x57a8('0xb')](_0x42b691)[_0x57a8('0x6')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x57a8('0xc')]=function(_0x342b75){return BPromise[_0x57a8('0xd')]()[_0x57a8('0x8')](cmHopper[_0x57a8('0xc')](_0x342b75))[_0x57a8('0x6')](loggerCatch(_0x57a8('0xe')));};exports[_0x57a8('0x5')]=function(_0x5c7480,_0x92579e){create(_0x5c7480)[_0x57a8('0x6')](loggerCatch(_0x92579e));moveContact(_0x5c7480)[_0x57a8('0x6')](loggerCatch(_0x92579e));};exports[_0x57a8('0xf')]=function(_0x460d1a,_0x1c2ae4){createAgent(_0x460d1a)[_0x57a8('0x6')](loggerCatch(_0x1c2ae4));};exports[_0x57a8('0x10')]=function(_0x1fc4c6,_0x1be606){create(_0x1fc4c6)['catch'](loggerCatch(_0x1be606));};exports['createCustomerFinal']=function(_0x34ee44,_0x49f76c){moveContact(_0x34ee44)[_0x57a8('0x6')](loggerCatch(_0x49f76c));};exports['rescheduleContact']=function(_0x49b0c3,_0x568480,_0xf4c0cf){if(_0x568480){_0x49b0c3[_0x57a8('0x11')]=null;}if(_0xf4c0cf){_0x49b0c3['active']=![];}return cmHopper[_0x57a8('0x12')](_0x49b0c3)['catch'](loggerCatch(_0x57a8('0x13')));};exports[_0x57a8('0x14')]=function(_0x164f9c){return cmHopper[_0x57a8('0x14')](_0x164f9c)[_0x57a8('0x6')](loggerCatch('[countReScheduled]\x20'));};exports[_0x57a8('0x15')]=function(_0x37137b){return cmHopper['unlockContact']({'UserId':null},_0x37137b,0x1)['catch'](loggerCatch(_0x57a8('0x16')));};exports[_0x57a8('0x17')]=function(_0x42e4ba){return cmHopper[_0x57a8('0x15')]({'active':![]},_0x42e4ba,0x1)[_0x57a8('0x6')](loggerCatch('[activeContact]\x20'));};exports[_0x57a8('0x18')]=function(_0x438e92){var _0x5ef82f={};_0x5ef82f[_0x57a8('0x19')]=_0x438e92[_0x57a8('0x19')];_0x5ef82f[_0x57a8('0x1a')]=_0x438e92['uniqueid'];_0x5ef82f[_0x57a8('0x1b')]=_0x438e92[_0x57a8('0x1b')];_0x5ef82f[_0x57a8('0x1c')]=_0x438e92[_0x57a8('0x1c')];_0x5ef82f[_0x57a8('0x1d')]=_0x438e92[_0x57a8('0x1d')];_0x5ef82f[_0x57a8('0x1e')]=_0x438e92[_0x57a8('0x1f')];_0x5ef82f[_0x57a8('0x20')]=_0x438e92[_0x57a8('0x1f')];_0x5ef82f[_0x57a8('0x21')]=0x1;_0x5ef82f[_0x57a8('0x22')]=_0x438e92[_0x57a8('0x23')];_0x5ef82f[_0x57a8('0x24')]=_0x438e92['membername'];_0x5ef82f[_0x57a8('0x25')]=_0x57a8('0x26');_0x5ef82f['exten']=_0x57a8('0x27');_0x5ef82f[_0x57a8('0x28')]=0x0;_0x5ef82f['assigned']=0x1;_0x5ef82f[_0x57a8('0x29')]=_0x438e92['membername'];_0x5ef82f[_0x57a8('0x2a')]=_0x57a8('0x2b');return BPromise[_0x57a8('0xd')]()['then'](voiceQueueReport['create'](_0x5ef82f))[_0x57a8('0x6')](loggerCatch(_0x57a8('0x2c')));};exports[_0x57a8('0x2d')]=function(_0x142733,_0x4cddcc){return BPromise[_0x57a8('0xd')]()['then'](cmHopper[_0x57a8('0x2d')](_0x142733,_0x4cddcc))[_0x57a8('0x6')](loggerCatch(_0x57a8('0x2e')));};exports['rescheduleContactInQueue']=function(_0x8be3dd){return cmHopper['rescheduleContact'](_0x8be3dd,!![],!![])[_0x57a8('0x6')](loggerCatch(_0x57a8('0x2f')));}; \ No newline at end of file +var _0x6f9b=['createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','then','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory'];(function(_0x16e4a2,_0x448a3d){var _0x430bd8=function(_0x1112d1){while(--_0x1112d1){_0x16e4a2['push'](_0x16e4a2['shift']());}};_0x430bd8(++_0x448a3d);}(_0x6f9b,0x181));var _0xb6f9=function(_0x2ec6b2,_0x5c3288){_0x2ec6b2=_0x2ec6b2-0x0;var _0x52c5f8=_0x6f9b[_0x2ec6b2];return _0x52c5f8;};'use strict';var util=require(_0xb6f9('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb6f9('0x1'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xb6f9('0x2'));var voiceQueueReport=require(_0xb6f9('0x3'));function loggerCatch(_0x52ca4c){return function(_0xb50e6b){logger[_0xb6f9('0x4')](_0x52ca4c,util[_0xb6f9('0x5')](_0xb50e6b,{'showHidden':![],'depth':null}));};}function create(_0x66e516){return cmHopperHistory[_0xb6f9('0x6')](_0x66e516)[_0xb6f9('0x7')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x147344){return BPromise['resolve']()['then'](agentReportPreview[_0xb6f9('0x6')](_0x147344))[_0xb6f9('0x7')](loggerCatch(_0xb6f9('0x8')));}function moveContact(_0x9abf2a){return cmHopper[_0xb6f9('0x9')](_0x9abf2a,!![])[_0xb6f9('0x7')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xb6f9('0xa')]=function(_0x34d98b){return cmHopperBlack['checkIsBlackList'](_0x34d98b)[_0xb6f9('0x7')](loggerCatch(_0xb6f9('0xb')));};exports[_0xb6f9('0xc')]=function(_0x381fd2){return BPromise['resolve']()['then'](cmHopper[_0xb6f9('0xc')](_0x381fd2))['catch'](loggerCatch(_0xb6f9('0xd')));};exports[_0xb6f9('0x6')]=function(_0x305924,_0x1dba99){create(_0x305924)[_0xb6f9('0x7')](loggerCatch(_0x1dba99));moveContact(_0x305924)[_0xb6f9('0x7')](loggerCatch(_0x1dba99));};exports[_0xb6f9('0xe')]=function(_0x362d6b,_0x1c8728){createAgent(_0x362d6b)[_0xb6f9('0x7')](loggerCatch(_0x1c8728));};exports[_0xb6f9('0xf')]=function(_0x346efc,_0x43c7e9){create(_0x346efc)['catch'](loggerCatch(_0x43c7e9));};exports[_0xb6f9('0x10')]=function(_0x18a8cd,_0x2e1024){moveContact(_0x18a8cd)[_0xb6f9('0x7')](loggerCatch(_0x2e1024));};exports[_0xb6f9('0x11')]=function(_0x5dbfc2,_0x271d81,_0x7eba35){if(_0x271d81){_0x5dbfc2[_0xb6f9('0x12')]=null;}if(_0x7eba35){_0x5dbfc2[_0xb6f9('0x13')]=![];}return cmHopper[_0xb6f9('0x11')](_0x5dbfc2)[_0xb6f9('0x7')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x4f1502){return cmHopper[_0xb6f9('0x14')](_0x4f1502)[_0xb6f9('0x7')](loggerCatch('[countReScheduled]\x20'));};exports[_0xb6f9('0x15')]=function(_0x241de1){return cmHopper[_0xb6f9('0x15')]({'UserId':null},_0x241de1,0x1)['catch'](loggerCatch(_0xb6f9('0x16')));};exports['disableContact']=function(_0x23dbb7){return cmHopper[_0xb6f9('0x15')]({'active':![]},_0x23dbb7,0x1)[_0xb6f9('0x7')](loggerCatch(_0xb6f9('0x17')));};exports[_0xb6f9('0x18')]=function(_0x2fcf99){var _0x1a0567={};_0x1a0567[_0xb6f9('0x19')]=_0x2fcf99[_0xb6f9('0x19')];_0x1a0567[_0xb6f9('0x1a')]=_0x2fcf99[_0xb6f9('0x1a')];_0x1a0567[_0xb6f9('0x1b')]=_0x2fcf99[_0xb6f9('0x1b')];_0x1a0567[_0xb6f9('0x1c')]=_0x2fcf99[_0xb6f9('0x1c')];_0x1a0567[_0xb6f9('0x1d')]=_0x2fcf99[_0xb6f9('0x1d')];_0x1a0567[_0xb6f9('0x1e')]=_0x2fcf99[_0xb6f9('0x1f')];_0x1a0567['queuecallerleaveAt']=_0x2fcf99[_0xb6f9('0x1f')];_0x1a0567[_0xb6f9('0x20')]=0x1;_0x1a0567[_0xb6f9('0x21')]=_0x2fcf99[_0xb6f9('0x22')];_0x1a0567[_0xb6f9('0x23')]=_0x2fcf99[_0xb6f9('0x24')];_0x1a0567[_0xb6f9('0x25')]=_0xb6f9('0x26');_0x1a0567[_0xb6f9('0x27')]=_0xb6f9('0x28');_0x1a0567[_0xb6f9('0x29')]=0x0;_0x1a0567['assigned']=0x1;_0x1a0567[_0xb6f9('0x2a')]=_0x2fcf99[_0xb6f9('0x24')];_0x1a0567[_0xb6f9('0x2b')]=_0xb6f9('0x2c');return BPromise['resolve']()[_0xb6f9('0x2d')](voiceQueueReport[_0xb6f9('0x2e')](_0x1a0567))[_0xb6f9('0x7')](loggerCatch(_0xb6f9('0x2f')));};exports[_0xb6f9('0x30')]=function(_0xa529aa,_0x2babda){return BPromise['resolve']()[_0xb6f9('0x2d')](cmHopper[_0xb6f9('0x30')](_0xa529aa,_0x2babda))[_0xb6f9('0x7')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x42b508){return cmHopper[_0xb6f9('0x11')](_0x42b508,!![],!![])['catch'](loggerCatch(_0xb6f9('0x31')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index f7c5c66..fde8c00 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 _0xe408=['logger','info','loggerError','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','statedesc','responsetime','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','isFailure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect'];(function(_0x4e0546,_0x1ea6a){var _0x280b16=function(_0x2d2329){while(--_0x2d2329){_0x4e0546['push'](_0x4e0546['shift']());}};_0x280b16(++_0x1ea6a);}(_0xe408,0x19d));var _0x8e40=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe408[_0x2be8c2];return _0x97f531;};'use strict';var util=require(_0x8e40('0x0'));var _=require(_0x8e40('0x1'));var moment=require(_0x8e40('0x2'));var logger=require(_0x8e40('0x3'))('preview');var ipAgi=process[_0x8e40('0x4')][_0x8e40('0x5')]||'127.0.0.1';var utils=require(_0x8e40('0x6'));exports[_0x8e40('0x7')]=function(_0x1f9cbf){return function(_0x5e4f15){logger[_0x8e40('0x8')](_0x1f9cbf,util[_0x8e40('0x9')](_0x5e4f15,{'showHidden':![],'depth':null}));};};exports[_0x8e40('0xa')]=function(_0x41c57e,_0x29cfb0){logger[_0x8e40('0xb')](_0x41c57e,util[_0x8e40('0x9')](_0x29cfb0,{'showHidden':![],'depth':null}));};exports[_0x8e40('0xc')]=function(_0xc36340,_0x3d83c2){logger[_0x8e40('0x8')](_0xc36340,util[_0x8e40('0x9')](_0x3d83c2,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2a41c6){return function(_0x9936fc){logger['info'](_0x2a41c6,util['inspect'](_0x9936fc,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x181b91,_0x11de41,_0x5819fe){return{'message':_0x181b91,'unlock':_0x11de41,'active':_0x5819fe};};exports[_0x8e40('0xd')]=function(_0x43a3cb,_0x2b6519,_0x534975){if(!_[_0x8e40('0xe')](_0x534975)&&_0x8e40('0xf')===typeof _0x534975&&!_[_0x8e40('0x10')](_0x534975)){if(!_[_0x8e40('0xe')](_0x2b6519)&&_0x8e40('0xf')===typeof _0x2b6519&&!_[_0x8e40('0x10')](_0x2b6519)){return util[_0x8e40('0x11')]('\x22%s\x22\x20<%s>',_0x2b6519,_0x534975);}return util['format'](_0x8e40('0x12'),_0x534975,_0x534975);}if(!_['isUndefined'](_0x43a3cb)&&_0x8e40('0xf')===typeof _0x43a3cb&&!_[_0x8e40('0x10')](_0x43a3cb)){return _0x43a3cb;}return _0x8e40('0x13');};exports['isActive']=function(_0x87259c){if(_[_0x8e40('0x14')](_0x87259c)){return![];}return _0x87259c;};exports[_0x8e40('0x15')]=function(_0x3e3401,_0x31f3e9,_0x50167d,_0x27ddf2,_0x4eadc1,_0x5caba0){var _0x3b5ca4={'XMD-QUEUE':_0x31f3e9[_0x8e40('0x16')]?_0x31f3e9[_0x8e40('0x16')][_0x8e40('0x17')]:'','XMD-CALLERID':_0x27ddf2,'XMD-CALLERID-PREVIEW':_0x5caba0?util['format'](_0x8e40('0x12'),_0x5caba0[_0x8e40('0x18')],_0x5caba0[_0x8e40('0x19')]):_0x27ddf2,'XMD-DIALID':_0x4eadc1,'XMD-CONTACTID':_0x31f3e9[_0x8e40('0x1a')],'XMD-CDRTYPE':_0x8e40('0x1b'),'CALLERID(all)':_0x27ddf2,'XMD-VOICEQUEUEID':_0x31f3e9[_0x8e40('0x1c')],'XMD-DIALCHANNEL':_0x50167d,'XMD-DIALTIMEOUT':_0x3e3401['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x8e40('0x11')](_0x8e40('0x1d'),_0x3e3401[_0x8e40('0x1e')]?'g':'',_['isEmpty'](_0x3e3401[_0x8e40('0x1f')])?'':_0x8e40('0x20')),'XMD-DIALURL':_0x3e3401[_0x8e40('0x21')]||'','XMD-AGI':_0x3e3401[_0x8e40('0x22')]?util[_0x8e40('0x11')](_0x8e40('0x23'),ipAgi,_0x3e3401[_0x8e40('0x22')]):_0x8e40('0x24'),'XMD-AGIAFTER':_0x3e3401['dialQueueProject2']?util[_0x8e40('0x11')](_0x8e40('0x23'),ipAgi,_0x3e3401['dialQueueProject2']):_0x8e40('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x5caba0?_0x5caba0['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5caba0?_0x5caba0[_0x8e40('0x25')]:'','XMD-DESTINATION':_0x8e40('0x26'),'SIPADDHEADER':_0x8e40('0x27')};if(!_[_0x8e40('0x10')](_0x3e3401[_0x8e40('0x1f')])){_0x3b5ca4[util['format']('%s',_0x8e40('0x28'))]=_0x3e3401[_0x8e40('0x1f')];_0x3b5ca4[util[_0x8e40('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4eadc1;}return _0x3b5ca4;};exports[_0x8e40('0x29')]=function(_0x332ffd){var _0x314eee={};for(var _0x5c35f6 in _0x332ffd){if(_0x332ffd['hasOwnProperty'](_0x5c35f6)){_0x314eee[util[_0x8e40('0x11')]('%s',_[_0x8e40('0x2a')](_0x5c35f6))]=_0x332ffd[_0x5c35f6];}}return{'variables':_0x314eee};};exports[_0x8e40('0x2b')]=function(_0xe4702d,_0x139a7b){if(!_[_0x8e40('0x14')](_0xe4702d)){if(_0xe4702d['hasOwnProperty'](_0x8e40('0x2c'))){if(_0xe4702d[_0x8e40('0x2c')]>0x0){_0xe4702d['originated']-=0x1;}else{logger[_0x8e40('0x8')](_0x8e40('0x2d'),_0x139a7b);}}}else{logger[_0x8e40('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x139a7b);}};exports[_0x8e40('0x2e')]=function(_0x240da7){var _0x8eb03=moment()[_0x8e40('0x11')](_0x8e40('0x2f'));_0x240da7[_0x8e40('0x30')]=0xd;_0x240da7['statedesc']=_0x8e40('0x31');_0x240da7['starttime']=_0x8eb03;_0x240da7['responsetime']=_0x8eb03;_0x240da7['endtime']=_0x8eb03;};exports['logAgent']=function(_0x2b634f,_0x269356,_0x4ee519){var _0x2e885a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b634f[_0x8e40('0x30')]=_0x269356;_0x2b634f[_0x8e40('0x32')]=_0x4ee519;_0x2b634f[_0x8e40('0x33')]=_0x2e885a;_0x2b634f[_0x8e40('0x34')]=utils[_0x8e40('0x35')](_0x2b634f['responsetime'],_0x2b634f[_0x8e40('0x36')]);};exports[_0x8e40('0x37')]=function(_0x3353ea,_0x4faeca,_0x52b9d1){_0x3353ea[_0x8e40('0x38')]=_0x4faeca;_0x3353ea[_0x8e40('0x39')]=_0x52b9d1;};exports[_0x8e40('0x3a')]=function(_0x22de98,_0x4c3fc9,_0x412ba9){var _0x4751e2=moment()[_0x8e40('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x22de98[_0x8e40('0x30')]=_0x4c3fc9;_0x22de98[_0x8e40('0x32')]=_0x412ba9;_0x22de98['responsetime']=_0x22de98[_0x8e40('0x33')]?_0x22de98[_0x8e40('0x33')]:_0x4751e2;_0x22de98['endtime']=_0x22de98['endtime']?_0x22de98[_0x8e40('0x3b')]:_0x4751e2;_0x22de98[_0x8e40('0x34')]=utils[_0x8e40('0x35')](_0x22de98['responsetime']||0x0,_0x22de98[_0x8e40('0x36')]||0x0);_0x22de98['talktime']=_0x22de98[_0x8e40('0x3c')]?utils[_0x8e40('0x35')](_0x22de98['endtime'],_0x22de98[_0x8e40('0x3c')]):0x0;};exports[_0x8e40('0x3d')]=function(_0x362ab3){return _0x362ab3==='Failure';};exports['variablesAction']=function(_0x1e1fb2,_0x48cbbe,_0x4a103b,_0xa836de,_0x21eff3){var _0x4eed2e=_0xa836de?_0x8e40('0x3e'):_0x1e1fb2[_0x8e40('0x18')];_0x4eed2e=_0x21eff3?_0x8e40('0x3f'):_0x4eed2e;return{'actionid':_0x1e1fb2[_0x8e40('0x40')],'action':_0x8e40('0x41'),'channel':_0x1e1fb2[_0x8e40('0x42')],'callerid':util[_0x8e40('0x11')](_0x8e40('0x12'),_0x4eed2e,_0x1e1fb2[_0x8e40('0x19')]),'Exten':_0x8e40('0x26'),'Context':_0x8e40('0x43'),'Priority':'1','variable':_0x4a103b,'timeout':(_0x48cbbe[_0x8e40('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1e1fb2[_0x8e40('0x40')]};};exports[_0x8e40('0x45')]=function(_0x574e4d){return _0x574e4d[_0x8e40('0x46')]+_0x574e4d[_0x8e40('0x47')]+_0x574e4d['countnoanswerretry']+_0x574e4d['countagentrejectretry']+_0x574e4d[_0x8e40('0x48')];};exports[_0x8e40('0x49')]=function(_0x5e5b15){var _0x34ad6d=_[_0x8e40('0x4a')](_0x5e5b15);_0x34ad6d[_0x8e40('0x30')]=0xf;_0x34ad6d[_0x8e40('0x32')]=_0x8e40('0x4b');return _0x34ad6d;};exports[_0x8e40('0x4c')]=function(_0x5ab680,_0x3c1b55,_0x5944cf){var _0xc16357={};_0xc16357[_0x3c1b55]=_0x5ab680[_0x3c1b55];_0xc16357[_0x8e40('0x4d')]=![];_0xc16357[_0x8e40('0x4e')]=moment()[_0x8e40('0x4f')](_0x5944cf,_0x8e40('0x50'))[_0x8e40('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0xc16357[_0x8e40('0x1a')]=_0x5ab680[_0x8e40('0x1a')];_0xc16357[_0x8e40('0x51')]=_0x5ab680['ListId'];_0xc16357[_0x8e40('0x1c')]=_0x5ab680['VoiceQueueId']||undefined;return _0xc16357;};exports['decrementTalkink']=function(_0x523193,_0x4e2646){if(!_[_0x8e40('0x14')](_0x523193)){if(_0x523193[_0x8e40('0x52')]>0x0){_0x523193[_0x8e40('0x52')]-=0x1;}else{logger[_0x8e40('0x8')](_0x4e2646,_0x8e40('0x53'));}}else{logger[_0x8e40('0x8')](_0x4e2646,_0x8e40('0x54'));}};exports[_0x8e40('0x55')]=function(_0x5a21de){if(_0x5a21de<=0x0){return!![];}return![];};function buildObj(_0x5bd1e5,_0x3c33e6,_0x3f224d){_0x5bd1e5['lastevent']=_0x3c33e6;_0x5bd1e5[_0x8e40('0x17')]=_0x5bd1e5[_0x8e40('0x56')];_0x5bd1e5[_0x8e40('0x57')]=_0x5bd1e5['channelAgent'];_0x5bd1e5['motionChannel']=_0x8e40('0x58');if(_0x3f224d){_0x5bd1e5[_0x8e40('0x59')]=_0x3f224d['mandatoryDisposition'];}return _0x5bd1e5;}exports['buildObj']=buildObj;exports[_0x8e40('0x5a')]=function(_0x3dd6dd){var _0x4003c8=[];for(var _0x2c9240 in _0x3dd6dd){if(_0x3dd6dd['hasOwnProperty'](_0x2c9240)){if(!_[_0x8e40('0x14')](_0x3dd6dd[_0x2c9240])&&_0x3dd6dd[_0x2c9240]['state']===_0x8e40('0x5b')&&_0x3dd6dd[_0x2c9240][_0x8e40('0x5c')]==='reachable'){_0x4003c8[_0x8e40('0x5d')](_0x3dd6dd[_0x2c9240]['id']);}}}return _0x4003c8;};exports[_0x8e40('0x5e')]=function(_0x499ed1){var _0x147cad=moment()[_0x8e40('0x5f')](0x0);var _0x5c9b2a=moment(_0x499ed1)[_0x8e40('0x5f')](0x0);return _0x147cad[_0x8e40('0x60')](_0x5c9b2a,'seconds');};exports['createBody']=function(_0x397d43){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x397d43['ContactId'],'ListId':_0x397d43[_0x8e40('0x51')],'VoiceQueueId':_0x397d43['VoiceQueueId']||undefined,'CampaignId':_0x397d43['CampaignId']||undefined};};exports[_0x8e40('0x61')]=function(_0xabd70c){if(_0xabd70c==='uniqueid'||_0xabd70c===_0x8e40('0x62')||_0xabd70c===_0x8e40('0x56')||_0xabd70c===_0x8e40('0x63')||_0xabd70c===_0x8e40('0x64')||_0xabd70c===_0x8e40('0x65')||_0xabd70c===_0x8e40('0x38')||_0xabd70c===_0x8e40('0x42')||_0xabd70c===_0x8e40('0x18')||_0xabd70c===_0x8e40('0x4d')||_0xabd70c==='calleridnum'||_0xabd70c===_0x8e40('0x4e')||_0xabd70c===_0x8e40('0x46')||_0xabd70c===_0x8e40('0x47')||_0xabd70c===_0x8e40('0x66')||_0xabd70c===_0x8e40('0x67')||_0xabd70c===_0x8e40('0x68')||_0xabd70c===_0x8e40('0x69')||_0xabd70c===_0x8e40('0x6a')||_0xabd70c==='recallme'||_0xabd70c==='ContactId'||_0xabd70c===_0x8e40('0x51')||_0xabd70c===_0x8e40('0x39')||_0xabd70c===_0x8e40('0x1c')||_0xabd70c===_0x8e40('0x6b')||_0xabd70c===_0x8e40('0x6c')||_0xabd70c===_0x8e40('0x6d')||_0xabd70c==='xmd-phone'||_0xabd70c===_0x8e40('0x6e')||_0xabd70c===_0x8e40('0x6f')||_0xabd70c===_0x8e40('0x70')||_0xabd70c===_0x8e40('0x71')||_0xabd70c===_0x8e40('0x72')||_0xabd70c==='xmd-dialchannel'||_0xabd70c===_0x8e40('0x73')||_0xabd70c===_0x8e40('0x74')||_0xabd70c===_0x8e40('0x75')||_0xabd70c===_0x8e40('0x76')||_0xabd70c===_0x8e40('0x77')||_0xabd70c===_0x8e40('0x78')||_0xabd70c==='rtpaudioqosbridged'||_0xabd70c===_0x8e40('0x79')||_0xabd70c===_0x8e40('0x7a')||_0xabd70c===_0x8e40('0x7b')||_0xabd70c===_0x8e40('0x7c')||_0xabd70c===_0x8e40('0x7d')||_0xabd70c===_0x8e40('0x7e')||_0xabd70c==='rtpaudioqos'||_0xabd70c==='rtpaudioqosbridged'||_0xabd70c===_0x8e40('0x79')||_0xabd70c===_0x8e40('0x7a')||_0xabd70c==='rtpaudioqosloss'||_0xabd70c==='rtpaudioqoslossbridged'||_0xabd70c==='rtpaudioqosrtt'||_0xabd70c==='rtpaudioqosrttbridged'||_0xabd70c===_0x8e40('0x7f')||_0xabd70c===_0x8e40('0x80')||_0xabd70c===_0x8e40('0x30')||_0xabd70c==='statedesc'){return![];}return!![];};exports[_0x8e40('0x81')]=function(_0x5d1601,_0xe6031){var _0x35298a,_0x380117,_0xedc30e;if(_0xe6031<=0x0){_0xe6031=0x1;}_0x35298a=new RegExp(_0x8e40('0x82')+_0xe6031+'}$');_0x380117=Math[_0x8e40('0x83')](0xa,_0xe6031-0x1);_0xedc30e=Math[_0x8e40('0x83')](0xa,_0xe6031)-0x1;return util[_0x8e40('0x11')]('%s',_['replace'](_0x5d1601,_0x35298a,_[_0x8e40('0x84')](_0x380117,_0xedc30e)));};exports[_0x8e40('0x85')]=function(_0x1487fc){var _0x3cf860=_0x1487fc[_0x8e40('0x86')](/"(.*?)"/);return _0x3cf860?_0x3cf860[0x1]:_0x1487fc;};exports['extractCalleridNumber']=function(_0x433b88){var _0x1ffb4f=_0x433b88[_0x8e40('0x86')](/<(.*?)>/);return _0x1ffb4f?_0x1ffb4f[0x1]:_0x433b88;};function buildNoAnswerEventPayload(_0x503d77,_0x866d2){var _0x3f658c=buildObj(_0x503d77,_0x8e40('0x87'));if(!_[_0x8e40('0x10')](_0x866d2[_0x8e40('0x88')])){Object[_0x8e40('0x89')](_0x866d2[_0x8e40('0x88')])[_0x8e40('0x8a')](function(_0x5695f6){_0x3f658c[_0x5695f6[_0x8e40('0x8b')]()]=_0x866d2[_0x8e40('0x88')][_0x5695f6];});}return _0x3f658c;}exports[_0x8e40('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8f31=['getDiff','milliseconds','diff','seconds','CampaignId','idContact','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','info','inspect','loggerError','logger2','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','isNil','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','statedesc','getSeconds','logLookAgent','membername','UserId','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','clone','scheduledAt','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','mandatoryDisposition','not_inuse','status','reachable','push'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f31,0x1b3));var _0x18f3=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x8f31[_0x41e8c4];return _0x54ffbe;};'use strict';var util=require(_0x18f3('0x0'));var _=require(_0x18f3('0x1'));var moment=require(_0x18f3('0x2'));var logger=require(_0x18f3('0x3'))('preview');var ipAgi=process[_0x18f3('0x4')][_0x18f3('0x5')]||_0x18f3('0x6');var utils=require(_0x18f3('0x7'));exports[_0x18f3('0x8')]=function(_0x1bbe0e){return function(_0x306781){logger[_0x18f3('0x9')](_0x1bbe0e,util['inspect'](_0x306781,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4e2f1d,_0x39681b){logger[_0x18f3('0xa')](_0x4e2f1d,util[_0x18f3('0xb')](_0x39681b,{'showHidden':![],'depth':null}));};exports[_0x18f3('0xc')]=function(_0x1b0b94,_0x178e8c){logger[_0x18f3('0x9')](_0x1b0b94,util['inspect'](_0x178e8c,{'showHidden':![],'depth':null}));};exports[_0x18f3('0xd')]=function(_0x40af96){return function(_0x82671f){logger['info'](_0x40af96,util[_0x18f3('0xb')](_0x82671f,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x290f19,_0x1dc732,_0x513d11){return{'message':_0x290f19,'unlock':_0x1dc732,'active':_0x513d11};};exports['getCallerId']=function(_0x330d2f,_0x38b7ff,_0xeba8ce){if(!_[_0x18f3('0xe')](_0xeba8ce)&&'string'===typeof _0xeba8ce&&!_[_0x18f3('0xf')](_0xeba8ce)){if(!_[_0x18f3('0xe')](_0x38b7ff)&&_0x18f3('0x10')===typeof _0x38b7ff&&!_[_0x18f3('0xf')](_0x38b7ff)){return util['format']('\x22%s\x22\x20<%s>',_0x38b7ff,_0xeba8ce);}return util['format'](_0x18f3('0x11'),_0xeba8ce,_0xeba8ce);}if(!_['isUndefined'](_0x330d2f)&&_0x18f3('0x10')===typeof _0x330d2f&&!_['isEmpty'](_0x330d2f)){return _0x330d2f;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x140033){if(_[_0x18f3('0x12')](_0x140033)){return![];}return _0x140033;};exports['addVariables']=function(_0x322a88,_0x51a436,_0x2c984e,_0xca3af5,_0x2f2e47,_0x39db5c){var _0x3e411c={'XMD-QUEUE':_0x51a436[_0x18f3('0x13')]?_0x51a436[_0x18f3('0x13')][_0x18f3('0x14')]:'','XMD-CALLERID':_0xca3af5,'XMD-CALLERID-PREVIEW':_0x39db5c?util[_0x18f3('0x15')](_0x18f3('0x11'),_0x39db5c[_0x18f3('0x16')],_0x39db5c[_0x18f3('0x17')]):_0xca3af5,'XMD-DIALID':_0x2f2e47,'XMD-CONTACTID':_0x51a436[_0x18f3('0x18')],'XMD-CDRTYPE':_0x18f3('0x19'),'CALLERID(all)':_0xca3af5,'XMD-VOICEQUEUEID':_0x51a436[_0x18f3('0x1a')],'XMD-DIALCHANNEL':_0x2c984e,'XMD-DIALTIMEOUT':_0x322a88[_0x18f3('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x18f3('0x15')]('\x22rtTxX%s%s\x22',_0x322a88[_0x18f3('0x1c')]?'g':'',_['isEmpty'](_0x322a88[_0x18f3('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x322a88['dialPreviewUrl']||'','XMD-AGI':_0x322a88[_0x18f3('0x1e')]?util[_0x18f3('0x15')](_0x18f3('0x1f'),ipAgi,_0x322a88['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x322a88['dialQueueProject2']?util[_0x18f3('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x322a88[_0x18f3('0x1c')]):_0x18f3('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x39db5c?_0x39db5c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x39db5c?_0x39db5c['originatecalleridname']:'','XMD-DESTINATION':_0x18f3('0x21'),'SIPADDHEADER':_0x18f3('0x22')};if(!_[_0x18f3('0xf')](_0x322a88[_0x18f3('0x1d')])){_0x3e411c[util[_0x18f3('0x15')]('%s',_0x18f3('0x23'))]=_0x322a88[_0x18f3('0x1d')];_0x3e411c[util[_0x18f3('0x15')]('%s',_0x18f3('0x24'))]=_0x2f2e47;}return _0x3e411c;};exports[_0x18f3('0x25')]=function(_0x440994){var _0xf373a3={};for(var _0x5d2b6d in _0x440994){if(_0x440994[_0x18f3('0x26')](_0x5d2b6d)){_0xf373a3[util[_0x18f3('0x15')]('%s',_[_0x18f3('0x27')](_0x5d2b6d))]=_0x440994[_0x5d2b6d];}}return{'variables':_0xf373a3};};exports['updateOriginated']=function(_0x104122,_0x442b79){if(!_[_0x18f3('0x12')](_0x104122)){if(_0x104122[_0x18f3('0x26')](_0x18f3('0x28'))){if(_0x104122[_0x18f3('0x28')]>0x0){_0x104122[_0x18f3('0x28')]-=0x1;}else{logger[_0x18f3('0x9')](_0x18f3('0x29'),_0x442b79);}}}else{logger[_0x18f3('0x9')](_0x18f3('0x2a'),_0x442b79);}};exports[_0x18f3('0x2b')]=function(_0x3bae03){var _0xd18c9=moment()['format'](_0x18f3('0x2c'));_0x3bae03[_0x18f3('0x2d')]=0xd;_0x3bae03['statedesc']='Blacklist';_0x3bae03[_0x18f3('0x2e')]=_0xd18c9;_0x3bae03[_0x18f3('0x2f')]=_0xd18c9;_0x3bae03[_0x18f3('0x30')]=_0xd18c9;};exports['logAgent']=function(_0x541c07,_0x5eeb88,_0x33719f){var _0x9009c8=moment()['format'](_0x18f3('0x2c'));_0x541c07[_0x18f3('0x2d')]=_0x5eeb88;_0x541c07[_0x18f3('0x31')]=_0x33719f;_0x541c07[_0x18f3('0x2f')]=_0x9009c8;_0x541c07['ringtime']=utils[_0x18f3('0x32')](_0x541c07[_0x18f3('0x2f')],_0x541c07[_0x18f3('0x2e')]);};exports[_0x18f3('0x33')]=function(_0x5ee1df,_0x3988af,_0x616995){_0x5ee1df[_0x18f3('0x34')]=_0x3988af;_0x5ee1df[_0x18f3('0x35')]=_0x616995;};exports['logCustomer']=function(_0x122f87,_0x18fb4c,_0x1780d8){var _0x10bb72=moment()[_0x18f3('0x15')](_0x18f3('0x2c'));_0x122f87[_0x18f3('0x2d')]=_0x18fb4c;_0x122f87[_0x18f3('0x31')]=_0x1780d8;_0x122f87[_0x18f3('0x2f')]=_0x122f87[_0x18f3('0x2f')]?_0x122f87[_0x18f3('0x2f')]:_0x10bb72;_0x122f87[_0x18f3('0x30')]=_0x122f87['endtime']?_0x122f87[_0x18f3('0x30')]:_0x10bb72;_0x122f87[_0x18f3('0x36')]=utils[_0x18f3('0x32')](_0x122f87[_0x18f3('0x2f')]||0x0,_0x122f87[_0x18f3('0x2e')]||0x0);_0x122f87[_0x18f3('0x37')]=_0x122f87['answertime']?utils[_0x18f3('0x32')](_0x122f87[_0x18f3('0x30')],_0x122f87[_0x18f3('0x38')]):0x0;};exports['isFailure']=function(_0x3c0293){return _0x3c0293===_0x18f3('0x39');};exports[_0x18f3('0x3a')]=function(_0x3753d7,_0x45ad22,_0x57c02e,_0x746675,_0x3b52d0){var _0x118e95=_0x746675?_0x18f3('0x3b'):_0x3753d7[_0x18f3('0x16')];_0x118e95=_0x3b52d0?_0x18f3('0x3c'):_0x118e95;return{'actionid':_0x3753d7[_0x18f3('0x3d')],'action':_0x18f3('0x3e'),'channel':_0x3753d7[_0x18f3('0x3f')],'callerid':util[_0x18f3('0x15')](_0x18f3('0x11'),_0x118e95,_0x3753d7[_0x18f3('0x17')]),'Exten':'xcally-motion-preview','Context':_0x18f3('0x40'),'Priority':'1','variable':_0x57c02e,'timeout':(_0x45ad22['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3753d7[_0x18f3('0x3d')]};};exports[_0x18f3('0x41')]=function(_0x498863){return _0x498863['countbusyretry']+_0x498863[_0x18f3('0x42')]+_0x498863[_0x18f3('0x43')]+_0x498863['countagentrejectretry']+_0x498863['countnosuchnumberretry'];};exports['cloneAction']=function(_0x2d31d3){var _0x6bb3ec=_[_0x18f3('0x44')](_0x2d31d3);_0x6bb3ec[_0x18f3('0x2d')]=0xf;_0x6bb3ec[_0x18f3('0x31')]='Global';return _0x6bb3ec;};exports[_0x18f3('0x45')]=function(_0xf7a8c0,_0x1e3fcb,_0x47dc8e){var _0x3c7231={};_0x3c7231[_0x1e3fcb]=_0xf7a8c0[_0x1e3fcb];_0x3c7231['active']=![];_0x3c7231[_0x18f3('0x46')]=moment()['add'](_0x47dc8e,_0x18f3('0x47'))[_0x18f3('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c7231[_0x18f3('0x18')]=_0xf7a8c0[_0x18f3('0x18')];_0x3c7231[_0x18f3('0x48')]=_0xf7a8c0[_0x18f3('0x48')];_0x3c7231['VoiceQueueId']=_0xf7a8c0['VoiceQueueId']||undefined;return _0x3c7231;};exports[_0x18f3('0x49')]=function(_0x173957,_0x542078){if(!_[_0x18f3('0x12')](_0x173957)){if(_0x173957[_0x18f3('0x4a')]>0x0){_0x173957[_0x18f3('0x4a')]-=0x1;}else{logger[_0x18f3('0x9')](_0x542078,_0x18f3('0x4b'));}}else{logger[_0x18f3('0x9')](_0x542078,_0x18f3('0x4c'));}};exports[_0x18f3('0x4d')]=function(_0x57a646){if(_0x57a646<=0x0){return!![];}return![];};function buildObj(_0x1f1567,_0x3ae1c8,_0x24a49d){_0x1f1567[_0x18f3('0x4e')]=_0x3ae1c8;_0x1f1567[_0x18f3('0x14')]=_0x1f1567[_0x18f3('0x4f')];_0x1f1567['interface']=_0x1f1567[_0x18f3('0x3f')];_0x1f1567['motionChannel']='voice';if(_0x24a49d){_0x1f1567[_0x18f3('0x50')]=_0x24a49d[_0x18f3('0x50')];}return _0x1f1567;}exports['buildObj']=buildObj;exports['agentReadyId']=function(_0x1c3de6){var _0x5220cc=[];for(var _0x27594d in _0x1c3de6){if(_0x1c3de6[_0x18f3('0x26')](_0x27594d)){if(!_[_0x18f3('0x12')](_0x1c3de6[_0x27594d])&&_0x1c3de6[_0x27594d]['state']===_0x18f3('0x51')&&_0x1c3de6[_0x27594d][_0x18f3('0x52')]===_0x18f3('0x53')){_0x5220cc[_0x18f3('0x54')](_0x1c3de6[_0x27594d]['id']);}}}return _0x5220cc;};exports[_0x18f3('0x55')]=function(_0xed1124){var _0x1ceef8=moment()[_0x18f3('0x56')](0x0);var _0x4ccbfa=moment(_0xed1124)['milliseconds'](0x0);return _0x1ceef8[_0x18f3('0x57')](_0x4ccbfa,_0x18f3('0x58'));};exports['createBody']=function(_0x4a5b78){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a5b78[_0x18f3('0x18')],'ListId':_0x4a5b78[_0x18f3('0x48')],'VoiceQueueId':_0x4a5b78[_0x18f3('0x1a')]||undefined,'CampaignId':_0x4a5b78[_0x18f3('0x59')]||undefined};};exports['filterKey']=function(_0x19e7dd){if(_0x19e7dd==='uniqueid'||_0x19e7dd===_0x18f3('0x5a')||_0x19e7dd===_0x18f3('0x4f')||_0x19e7dd==='type'||_0x19e7dd===_0x18f3('0x5b')||_0x19e7dd===_0x18f3('0x5c')||_0x19e7dd===_0x18f3('0x34')||_0x19e7dd==='channelAgent'||_0x19e7dd===_0x18f3('0x16')||_0x19e7dd==='active'||_0x19e7dd==='calleridnum'||_0x19e7dd===_0x18f3('0x46')||_0x19e7dd==='countbusyretry'||_0x19e7dd===_0x18f3('0x42')||_0x19e7dd===_0x18f3('0x43')||_0x19e7dd===_0x18f3('0x5d')||_0x19e7dd==='callback'||_0x19e7dd===_0x18f3('0x5e')||_0x19e7dd===_0x18f3('0x5f')||_0x19e7dd===_0x18f3('0x60')||_0x19e7dd===_0x18f3('0x18')||_0x19e7dd===_0x18f3('0x48')||_0x19e7dd===_0x18f3('0x35')||_0x19e7dd===_0x18f3('0x1a')||_0x19e7dd===_0x18f3('0x61')||_0x19e7dd===_0x18f3('0x62')||_0x19e7dd===_0x18f3('0x63')||_0x19e7dd===_0x18f3('0x64')||_0x19e7dd===_0x18f3('0x65')||_0x19e7dd===_0x18f3('0x66')||_0x19e7dd===_0x18f3('0x67')||_0x19e7dd===_0x18f3('0x68')||_0x19e7dd===_0x18f3('0x69')||_0x19e7dd==='xmd-dialchannel'||_0x19e7dd===_0x18f3('0x6a')||_0x19e7dd===_0x18f3('0x6b')||_0x19e7dd==='xmd-callerid'||_0x19e7dd===_0x18f3('0x6c')||_0x19e7dd===_0x18f3('0x6d')||_0x19e7dd==='rtpaudioqos'||_0x19e7dd===_0x18f3('0x6e')||_0x19e7dd===_0x18f3('0x6f')||_0x19e7dd===_0x18f3('0x70')||_0x19e7dd===_0x18f3('0x71')||_0x19e7dd===_0x18f3('0x72')||_0x19e7dd==='rtpaudioqosrtt'||_0x19e7dd===_0x18f3('0x73')||_0x19e7dd==='rtpaudioqos'||_0x19e7dd===_0x18f3('0x6e')||_0x19e7dd==='rtpaudioqosjitter'||_0x19e7dd===_0x18f3('0x70')||_0x19e7dd===_0x18f3('0x71')||_0x19e7dd===_0x18f3('0x72')||_0x19e7dd===_0x18f3('0x74')||_0x19e7dd==='rtpaudioqosrttbridged'||_0x19e7dd===_0x18f3('0x75')||_0x19e7dd==='bridgepvtcallid'||_0x19e7dd===_0x18f3('0x2d')||_0x19e7dd===_0x18f3('0x31')){return![];}return!![];};exports[_0x18f3('0x76')]=function(_0xb53619,_0x206320){var _0x4379a4,_0xba1d80,_0x4c141e;if(_0x206320<=0x0){_0x206320=0x1;}_0x4379a4=new RegExp(_0x18f3('0x77')+_0x206320+'}$');_0xba1d80=Math[_0x18f3('0x78')](0xa,_0x206320-0x1);_0x4c141e=Math[_0x18f3('0x78')](0xa,_0x206320)-0x1;return util['format']('%s',_[_0x18f3('0x79')](_0xb53619,_0x4379a4,_['random'](_0xba1d80,_0x4c141e)));};exports[_0x18f3('0x7a')]=function(_0x4277b9){var _0x4ff694=_0x4277b9[_0x18f3('0x7b')](/"(.*?)"/);return _0x4ff694?_0x4ff694[0x1]:_0x4277b9;};exports['extractCalleridNumber']=function(_0x18b2d9){var _0xadada=_0x18b2d9['match'](/<(.*?)>/);return _0xadada?_0xadada[0x1]:_0x18b2d9;};function buildNoAnswerEventPayload(_0x366725,_0x2c0300){var _0x24e35b=buildObj(_0x366725,_0x18f3('0x7c'));if(!_[_0x18f3('0xf')](_0x2c0300[_0x18f3('0x7d')])){Object[_0x18f3('0x7e')](_0x2c0300[_0x18f3('0x7d')])[_0x18f3('0x7f')](function(_0xe7ee31){_0x24e35b[_0xe7ee31[_0x18f3('0x80')]()]=_0x2c0300[_0x18f3('0x7d')][_0xe7ee31];});}return _0x24e35b;}exports[_0x18f3('0x81')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 35eeb11..c746bf7 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 _0x12c2=['queueadd','string','queueremove','boolean','voicequeuechannel','voicechannel','voicequeuechannelredirect'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x12c2,0x1b9));var _0x212c=function(_0x51ed22,_0x5e3fb4){_0x51ed22=_0x51ed22-0x0;var _0x3330f8=_0x12c2[_0x51ed22];return _0x3330f8;};'use strict';exports[_0x212c('0x0')]={'queue':{'type':_0x212c('0x1'),'required':!![]},'interface':{'type':_0x212c('0x1'),'required':!![]},'membername':{'type':_0x212c('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x212c('0x2')]={'queue':{'type':_0x212c('0x1'),'required':!![]},'interface':{'type':_0x212c('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x212c('0x1'),'required':!![]},'paused':{'type':_0x212c('0x3')},'reason':{'type':_0x212c('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x212c('0x1'),'required':![]}};exports[_0x212c('0x4')]={'uniqueid':{'type':_0x212c('0x1'),'required':!![]}};exports[_0x212c('0x5')]={'uniqueid':{'type':_0x212c('0x1'),'required':!![]},'filename':{'type':_0x212c('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x212c('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x212c('0x1'),'required':!![]}};exports[_0x212c('0x6')]={'uniqueid':{'type':_0x212c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xd0cb=['reload','voicechannel','string','number','boolean','queuepause'];(function(_0x561a85,_0x36d66a){var _0x1520a3=function(_0x3e4b5c){while(--_0x3e4b5c){_0x561a85['push'](_0x561a85['shift']());}};_0x1520a3(++_0x36d66a);}(_0xd0cb,0x16a));var _0xbd0c=function(_0x10babf,_0x3cadc0){_0x10babf=_0x10babf-0x0;var _0x1d1fbd=_0xd0cb[_0x10babf];return _0x1d1fbd;};'use strict';exports['queueadd']={'queue':{'type':_0xbd0c('0x0'),'required':!![]},'interface':{'type':_0xbd0c('0x0'),'required':!![]},'membername':{'type':_0xbd0c('0x0'),'required':!![]},'penalty':{'type':_0xbd0c('0x1'),'required':![]},'paused':{'type':_0xbd0c('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xbd0c('0x3')]={'interface':{'type':_0xbd0c('0x0'),'required':!![]},'paused':{'type':_0xbd0c('0x2')},'reason':{'type':'string','required':![]}};exports[_0xbd0c('0x4')]={'module':{'type':_0xbd0c('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbd0c('0x0'),'required':!![]}};exports[_0xbd0c('0x5')]={'uniqueid':{'type':_0xbd0c('0x0'),'required':!![]},'filename':{'type':_0xbd0c('0x0')},'format':{'type':_0xbd0c('0x0')},'mixmonitorid':{'type':_0xbd0c('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xbd0c('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xbd0c('0x0'),'required':!![]},'exten':{'type':_0xbd0c('0x0'),'required':!![]},'context':{'type':_0xbd0c('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 159f8a6..5dda014 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x29d47e,_0x5f329a){var _0x28ce5d=function(_0xbf55a8){while(--_0xbf55a8){_0x29d47e['push'](_0x29d47e['shift']());}};_0x28ce5d(++_0x5f329a);}(_0xadb5,0xad));var _0x5adb=function(_0x56fec6,_0x4d65b2){_0x56fec6=_0x56fec6-0x0;var _0x10b033=_0xadb5[_0x56fec6];return _0x10b033;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x59df07,_0xfef2a8){var _0x4c796f=function(_0x1f378c){while(--_0x1f378c){_0x59df07['push'](_0x59df07['shift']());}};_0x4c796f(++_0xfef2a8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f7ff14c..42511a1 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbba8=['assign'];(function(_0x508e89,_0x2e4573){var _0x1a460a=function(_0x101f45){while(--_0x101f45){_0x508e89['push'](_0x508e89['shift']());}};_0x1a460a(++_0x2e4573);}(_0xbba8,0x7f));var _0x8bba=function(_0x4ec038,_0xa49018){_0x4ec038=_0x4ec038-0x0;var _0x277dab=_0xbba8[_0x4ec038];return _0x277dab;};'use strict';function mergeDBDataToRealtime(_0x354ead,_0x3cb1b8){var _0x3084cb=Object[_0x8bba('0x0')]({},_0x354ead);for(var _0x36a4ea in _0x3cb1b8){if(_0x3084cb['hasOwnProperty'](_0x36a4ea)){_0x3084cb[_0x36a4ea]=_0x3cb1b8[_0x36a4ea];}}return _0x3084cb;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x7c6d=['assign','mergeDBDataToRealtime'];(function(_0x550500,_0x8dd443){var _0x113660=function(_0x4d97d3){while(--_0x4d97d3){_0x550500['push'](_0x550500['shift']());}};_0x113660(++_0x8dd443);}(_0x7c6d,0x18e));var _0xd7c6=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x7c6d[_0x13ce0c];return _0x4388fb;};'use strict';function mergeDBDataToRealtime(_0x2c3bc0,_0xe655f0){var _0x4ce533=Object[_0xd7c6('0x0')]({},_0x2c3bc0);for(var _0x1bc7c9 in _0xe655f0){if(_0x4ce533['hasOwnProperty'](_0x1bc7c9)){_0x4ce533[_0x1bc7c9]=_0xe655f0[_0x1bc7c9];}}return _0x4ce533;}exports[_0xd7c6('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0cfd757..c0cd3cd 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 _0xe7b5=['calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','monitorFilename','filename','createdAt','connectedlinenum','connectedlinename','membername','xcally-motion-dialer','create','isArray','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','isNil','accountcode','name','format','SIP/%s','length','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','destination','exten','type','dialer','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED'];(function(_0x57344a,_0x2d979a){var _0x3d0ff9=function(_0x2d69f4){while(--_0x2d69f4){_0x57344a['push'](_0x57344a['shift']());}};_0x3d0ff9(++_0x2d979a);}(_0xe7b5,0xd0));var _0x5e7b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe7b5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5e7b('0x0'));var moment=require(_0x5e7b('0x1'));var util=require(_0x5e7b('0x2'));var config=require(_0x5e7b('0x3'));var ami=require(_0x5e7b('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x5e7b('0x5'));var RpcVoiceDialReport=require(_0x5e7b('0x6'));var RpcMemberReport=require(_0x5e7b('0x7'));var RpcVoiceQueueReport=require(_0x5e7b('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x5e7b('0x9'));var VoiceQueueReport=require(_0x5e7b('0xa'));var VoiceCallReport=require(_0x5e7b('0xb'));var VoiceAgentReport=require(_0x5e7b('0xc'));var VoiceDialReport=require(_0x5e7b('0xd'));var UserReport=require(_0x5e7b('0xe'));function Report(_0x536625){this[_0x5e7b('0xf')]=_0x536625;this[_0x5e7b('0x10')]=_0x536625[_0x5e7b('0x10')];this[_0x5e7b('0x11')]=_0x536625['telephones'];}Report['prototype'][_0x5e7b('0x12')]=function(_0x408fe7){var _0x31653d=new VoiceQueueReport(this['realtime']);var _0x18e40b=new VoiceAgentReport(this['realtime']);var _0x3f9047=new VoiceDialReport(this[_0x5e7b('0xf')]);var _0x2d4ee2=new VoiceCallReport(this[_0x5e7b('0xf')]);var _0x1286f7=new UserReport(this[_0x5e7b('0xf')]);if(config[_0x5e7b('0x13')]&&config[_0x5e7b('0x13')][_0x5e7b('0x14')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x5e7b('0x15')](this));ami['on'](_0x5e7b('0x16'),this[_0x5e7b('0x17')][_0x5e7b('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0x5e7b('0x18')][_0x5e7b('0x15')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x5e7b('0x15')](this));ami['on']('blindtransfer',this[_0x5e7b('0x19')][_0x5e7b('0x15')](this));ami['on'](_0x5e7b('0x1a'),this[_0x5e7b('0x1b')]['bind'](this));}};Report[_0x5e7b('0x1c')][_0x5e7b('0x1d')]=function(_0x4adc84){var _0x5ef48b;_0x5ef48b=_[_0x5e7b('0x1e')](this['agents'],function(_0x3265dc){return _0x3265dc['accountcode']==_0x4adc84||_0x3265dc['name']==_0x4adc84;});if(_[_0x5e7b('0x1f')](_0x5ef48b)){var _0x4b3ec6=_[_0x5e7b('0x1e')](this[_0x5e7b('0x11')],function(_0x54e022){return _0x54e022[_0x5e7b('0x20')]==_0x4adc84||_0x54e022[_0x5e7b('0x21')]==_0x4adc84;});if(_0x4b3ec6){_0x5ef48b=_['find'](this[_0x5e7b('0x10')],function(_0x5b1a2e){return _0x5b1a2e['interface']==util[_0x5e7b('0x22')](_0x5e7b('0x23'),_0x4b3ec6[_0x5e7b('0x21')]);});}}return _0x5ef48b;};Report[_0x5e7b('0x1c')]['voiceQueueReport']=function(_0x32c1c5){for(var _0x3ef845=0x0;_0x3ef845<_0x32c1c5[_0x5e7b('0x24')];_0x3ef845+=0x1){var _0x2160a3=this[_0x5e7b('0x1d')](_0x32c1c5[_0x3ef845]['connectedlinenum']);if(_0x2160a3){_0x32c1c5[_0x3ef845][_0x5e7b('0x20')]=_0x2160a3[_0x5e7b('0x20')];_0x32c1c5[_0x3ef845][_0x5e7b('0x25')]=!![];_0x32c1c5[_0x3ef845][_0x5e7b('0x26')]=_0x2160a3['name'];_0x32c1c5[_0x3ef845][_0x5e7b('0x27')]=_['isNil'](_0x2160a3[_0x5e7b('0x27')])?util[_0x5e7b('0x22')]('SIP/%s',_0x2160a3[_0x5e7b('0x21')]):_0x2160a3[_0x5e7b('0x27')];if(_0x32c1c5[_0x3ef845][_0x5e7b('0x28')]){_0x32c1c5[_0x3ef845]['queuecallercompleteAt']=moment()[_0x5e7b('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x32c1c5[_0x3ef845][_0x5e7b('0x29')]){_0x32c1c5[_0x3ef845][_0x5e7b('0x2a')]=moment()[_0x5e7b('0x22')](_0x5e7b('0x2b'));}RpcMemberReport[_0x5e7b('0x2c')](_0x32c1c5[_0x3ef845]);}RpcVoiceQueueReport['create'](_0x32c1c5[_0x3ef845]);}};function extractCalleridNumber(_0x567d00){var _0x53f42b=_0x567d00[_0x5e7b('0x2d')](/<(.*?)>/);return _0x53f42b?_0x53f42b[0x1]:_0x567d00;}Report[_0x5e7b('0x1c')][_0x5e7b('0x2e')]=function(_0x101972){for(var _0x307edb=0x0;_0x307edb',_0x1f7b99[_0x5e7b('0x44')],_0x1f7b99[_0x5e7b('0x33')]);}if(RpcVoiceTransferReport[_0x5e7b('0x45')][_0x1f7b99[_0x5e7b('0x46')]]){var _0x28131c=RpcVoiceTransferReport[_0x5e7b('0x45')][_0x1f7b99['linkedid']];_0x28131c[_0x5e7b('0x47')]=_0x1f7b99[_0x5e7b('0x48')];RpcVoiceTransferReport[_0x5e7b('0x19')](_0x28131c);delete RpcVoiceTransferReport[_0x5e7b('0x45')][_0x1f7b99[_0x5e7b('0x46')]];}if(_[_0x5e7b('0x1f')](_0x1f7b99[_0x5e7b('0x37')])){_0x1f7b99[_0x5e7b('0x37')]=this[_0x5e7b('0x30')](_0x1f7b99);}if(_[_0x5e7b('0x1f')](_0x1f7b99[_0x5e7b('0x49')])){var _0x288a68=_0x1f7b99[_0x5e7b('0x31')]['split']('-')[0x0];var _0x286709=this['agents'][_0x288a68];if(!_0x286709)_0x286709=this[_0x5e7b('0x2e')](_0x1f7b99['accountcode']);if(_0x286709){_0x1f7b99[_0x5e7b('0x49')]=_0x286709['id'];_0x1f7b99['membername']=_0x286709[_0x5e7b('0x21')];}}RpcVoiceCallReport['create'](_0x1f7b99);if(_0x1f7b99['monitor']){for(var _0x2872ab=0x0;_0x2872ab<_0x1f7b99['monitors'][_0x5e7b('0x24')];_0x2872ab+=0x1){_0x1f7b99[_0x5e7b('0x4a')]=_0x1f7b99['monitors'][_0x2872ab][_0x5e7b('0x4b')];_0x1f7b99[_0x5e7b('0x4c')]=_0x1f7b99['monitors'][_0x2872ab][_0x5e7b('0x4c')];if(_0x1f7b99['exten']==_0x5e7b('0x3e')){_0x1f7b99[_0x5e7b('0x33')]=_0x1f7b99[_0x5e7b('0x4d')];_0x1f7b99[_0x5e7b('0x44')]=_0x1f7b99['connectedlinename'];_0x1f7b99[_0x5e7b('0x4d')]=_0x1f7b99[_0x5e7b('0x20')];_0x1f7b99[_0x5e7b('0x4e')]=_0x1f7b99[_0x5e7b('0x4f')];_0x1f7b99[_0x5e7b('0x36')]=_0x1f7b99[_0x5e7b('0x40')];}else if(_0x1f7b99[_0x5e7b('0x36')]==_0x5e7b('0x50')){_0x1f7b99[_0x5e7b('0x33')]=_0x1f7b99[_0x5e7b('0x35')];_0x1f7b99['exten']=_0x1f7b99['originatecalleridnum'];}RpcVoiceRecording[_0x5e7b('0x51')](_0x1f7b99);}}};Report['prototype'][_0x5e7b('0x18')]=function(_0x3fc826){if(_[_0x5e7b('0x52')](_0x3fc826)){_0x3fc826[_0x5e7b('0x53')](function(_0x5e7931){RpcVoiceAgentReport[_0x5e7b('0x51')](_0x5e7931);});}else{RpcVoiceAgentReport[_0x5e7b('0x51')](_0x3fc826);}};Report[_0x5e7b('0x1c')][_0x5e7b('0x54')]=function(_0x33eb86){RpcVoiceDialReport[_0x5e7b('0x51')](_0x33eb86);var _0x531c55;var _0x4fe55d;var _0x175d08=_0x33eb86[_0x5e7b('0x31')];if(_[_0x5e7b('0x55')](_0x175d08,'Local')){_0x4fe55d=_0x175d08[_0x5e7b('0x56')](_0x175d08[_0x5e7b('0x57')]('/')+0x1,_0x175d08[_0x5e7b('0x57')]('@'));_0x531c55=_['find'](this[_0x5e7b('0x10')],function(_0xb77253){return _0xb77253[_0x5e7b('0x58')]==_0x4fe55d||_0xb77253[_0x5e7b('0x59')]==_0x4fe55d||_0xb77253[_0x5e7b('0x20')]==_0x4fe55d;});}else{_0x4fe55d=_0x175d08[_0x5e7b('0x56')](_0x175d08['indexOf']('/')+0x1,_0x175d08['lastIndexOf']('-'));_0x531c55=this[_0x5e7b('0x1d')](_0x4fe55d);}if(_0x531c55){_0x33eb86['interface']=_[_0x5e7b('0x1f')](_0x531c55[_0x5e7b('0x27')])?util[_0x5e7b('0x22')]('SIP/%s',_0x531c55[_0x5e7b('0x21')]):_0x531c55[_0x5e7b('0x27')];_0x33eb86[_0x5e7b('0x4f')]=_0x531c55['name'];_0x33eb86[_0x5e7b('0x20')]=_0x531c55[_0x5e7b('0x20')];RpcMemberReport['voiceDialReport'](_0x33eb86);}};Report['prototype'][_0x5e7b('0x19')]=function(_0x3e249f){RpcVoiceTransferReport[_0x5e7b('0x45')][_0x3e249f[_0x5e7b('0x5a')]]=_0x3e249f;};Report['prototype']['attendedTransfer']=function(_0xfdb0eb){RpcVoiceTransferReport[_0x5e7b('0x1b')](_0xfdb0eb);};module[_0x5e7b('0x5b')]=Report; \ No newline at end of file +var _0x681c=['uniqueid','blindTransfer','getCallType','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','voiceDialReport','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','split','calleridnum','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','channel','destinationchannel','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid'];(function(_0x40a4ee,_0x515400){var _0x57c3cc=function(_0x4ba215){while(--_0x4ba215){_0x40a4ee['push'](_0x40a4ee['shift']());}};_0x57c3cc(++_0x515400);}(_0x681c,0x138));var _0xc681=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x681c[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xc681('0x0'));var moment=require(_0xc681('0x1'));var util=require(_0xc681('0x2'));var config=require(_0xc681('0x3'));var ami=require(_0xc681('0x4'));var RpcVoiceAgentReport=require(_0xc681('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xc681('0x6'));var RpcMemberReport=require(_0xc681('0x7'));var RpcVoiceQueueReport=require(_0xc681('0x8'));var RpcVoiceRecording=require(_0xc681('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xc681('0xa'));var VoiceCallReport=require(_0xc681('0xb'));var VoiceAgentReport=require(_0xc681('0xc'));var VoiceDialReport=require(_0xc681('0xd'));var UserReport=require(_0xc681('0xe'));function Report(_0x26d5e7){this[_0xc681('0xf')]=_0x26d5e7;this[_0xc681('0x10')]=_0x26d5e7[_0xc681('0x10')];this['telephones']=_0x26d5e7['telephones'];}Report[_0xc681('0x11')][_0xc681('0x12')]=function(_0x28b708){var _0x3cad5a=new VoiceQueueReport(this[_0xc681('0xf')]);var _0x5b3536=new VoiceAgentReport(this[_0xc681('0xf')]);var _0x11867f=new VoiceDialReport(this[_0xc681('0xf')]);var _0x18bbff=new VoiceCallReport(this['realtime']);var _0x3ae399=new UserReport(this[_0xc681('0xf')]);if(config[_0xc681('0x13')]&&config['xdr'][_0xc681('0x14')]){ami['on'](_0xc681('0x15'),this[_0xc681('0x16')][_0xc681('0x17')](this));ami['on']('custom:voiceCallReport',this[_0xc681('0x18')][_0xc681('0x17')](this));ami['on'](_0xc681('0x19'),this[_0xc681('0x1a')][_0xc681('0x17')](this));ami['on'](_0xc681('0x1b'),this['voiceDialReport']['bind'](this));ami['on'](_0xc681('0x1c'),this['blindTransfer'][_0xc681('0x17')](this));ami['on'](_0xc681('0x1d'),this[_0xc681('0x1e')][_0xc681('0x17')](this));}};Report[_0xc681('0x11')]['findAgent']=function(_0x31fca9){var _0x480461;_0x480461=_[_0xc681('0x1f')](this[_0xc681('0x10')],function(_0x3692f4){return _0x3692f4[_0xc681('0x20')]==_0x31fca9||_0x3692f4[_0xc681('0x21')]==_0x31fca9;});if(_['isNil'](_0x480461)){var _0x2d950f=_[_0xc681('0x1f')](this['telephones'],function(_0x5a4976){return _0x5a4976[_0xc681('0x20')]==_0x31fca9||_0x5a4976[_0xc681('0x21')]==_0x31fca9;});if(_0x2d950f){_0x480461=_['find'](this[_0xc681('0x10')],function(_0x5b82da){return _0x5b82da[_0xc681('0x22')]==util[_0xc681('0x23')](_0xc681('0x24'),_0x2d950f[_0xc681('0x21')]);});}}return _0x480461;};Report[_0xc681('0x11')]['voiceQueueReport']=function(_0x169da7){for(var _0x49110a=0x0;_0x49110a<_0x169da7[_0xc681('0x25')];_0x49110a+=0x1){var _0x2e71a0=this[_0xc681('0x26')](_0x169da7[_0x49110a][_0xc681('0x27')]);if(_0x2e71a0){_0x169da7[_0x49110a][_0xc681('0x20')]=_0x2e71a0['accountcode'];_0x169da7[_0x49110a][_0xc681('0x28')]=!![];_0x169da7[_0x49110a][_0xc681('0x29')]=_0x2e71a0[_0xc681('0x21')];_0x169da7[_0x49110a][_0xc681('0x22')]=_[_0xc681('0x2a')](_0x2e71a0[_0xc681('0x22')])?util[_0xc681('0x23')](_0xc681('0x24'),_0x2e71a0['name']):_0x2e71a0['interface'];if(_0x169da7[_0x49110a][_0xc681('0x2b')]){_0x169da7[_0x49110a][_0xc681('0x2c')]=moment()[_0xc681('0x23')](_0xc681('0x2d'));}if(_0x169da7[_0x49110a][_0xc681('0x2e')]){_0x169da7[_0x49110a][_0xc681('0x2f')]=moment()['format'](_0xc681('0x2d'));}RpcMemberReport[_0xc681('0x16')](_0x169da7[_0x49110a]);}RpcVoiceQueueReport[_0xc681('0x30')](_0x169da7[_0x49110a]);}};function extractCalleridNumber(_0x498b3d){var _0x137514=_0x498b3d[_0xc681('0x31')](/<(.*?)>/);return _0x137514?_0x137514[0x1]:_0x498b3d;}Report[_0xc681('0x11')][_0xc681('0x32')]=function(_0x45f2e7){for(var _0x24b09e=0x0;_0x24b09e0x0?!![]:![];if(!_0x3897c8){return this['syncQueueSummaryComplete'](this[_0xfe16('0x14')][_0xfe16('0x69')]);}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x6a')]=function(_0x3e8f4c){var _0x5539e5=this['summary']['id'];if(this[_0xfe16('0x14')]['queuestatus'][_0x5539e5]&&this['summary'][_0xfe16('0x5c')][_0x5539e5][_0x3e8f4c[_0xfe16('0x5d')]]){this[_0xfe16('0x14')][_0xfe16('0x5c')][_0x5539e5][_0x3e8f4c[_0xfe16('0x5d')]][_0xfe16('0xf')]['push'](_0x3e8f4c);}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x17')]=function(_0x3e0fb4){var _0x104899=this;try{if(this[_0xfe16('0x57')](_0x3e0fb4)&&this['isNotNull'](_0x3e0fb4['queue'])){logger[_0xfe16('0x47')](_0xfe16('0x6b'),util[_0xfe16('0x3e')](_0x3e0fb4,{'showHidden':![],'depth':null}));var _0xf684d=this[_0xfe16('0x12')][_0x3e0fb4[_0xfe16('0x4d')]];if(_0xf684d){logger[_0xfe16('0x47')](_0xfe16('0x6c'),_0xf684d[_0xfe16('0x55')]);this[_0xfe16('0x14')]['queues'][_0xf684d[_0xfe16('0x55')]]={'summaryEvent':_0x3e0fb4};this[_0xfe16('0x14')][_0xfe16('0x68')]+=0x1;return ami[_0xfe16('0x59')]({'action':'queuestatus','queue':_0xf684d[_0xfe16('0x55')]})[_0xfe16('0x5b')](function(_0x2d54ba){if(!_0x104899[_0xfe16('0x14')]['queuestatus'][_0x3e0fb4['actionid']]){_0x104899[_0xfe16('0x14')]['queuestatus'][_0x3e0fb4[_0xfe16('0x5d')]]={};}_0x104899[_0xfe16('0x14')]['queuestatus'][_0x3e0fb4[_0xfe16('0x5d')]][_0x2d54ba[_0xfe16('0x5d')]]={'queue':_0xf684d[_0xfe16('0x55')],'agents':[]};})[_0xfe16('0x39')](function(_0x1014f2){throw _0x1014f2;});}}}catch(_0x7f1cfa){logger[_0xfe16('0x3c')](_0xfe16('0x5e'),util[_0xfe16('0x3e')](_0x7f1cfa,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfe16('0x6d')]=function(_0x2b702e){if(this[_0xfe16('0x14')][_0xfe16('0x68')]>0x0){this[_0xfe16('0x14')]['completeEvent']=_0x2b702e;return;}logger[_0xfe16('0x47')](_0xfe16('0x6e'),util['inspect'](_0x2b702e,{'showHidden':![],'depth':null}));this[_0xfe16('0x14')]=initializeSummary();ami[_0xfe16('0x45')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x1d')]=function(_0x2f57ad){try{if(this[_0xfe16('0x57')](_0x2f57ad)){logger[_0xfe16('0x47')](_0xfe16('0x6f'),_0x2f57ad['uniqueid'],util[_0xfe16('0x3e')](_0x2f57ad,{'showHidden':![],'depth':null}));if(_[_0xfe16('0x58')](this['queueReports'][_0x2f57ad[_0xfe16('0x4a')]])){this[_0xfe16('0xe')][_0x2f57ad[_0xfe16('0x4a')]]=[];}if(_[_0xfe16('0x58')](this[_0xfe16('0x10')][_0x2f57ad[_0xfe16('0x4a')]])){this[_0xfe16('0x10')][_0x2f57ad[_0xfe16('0x4a')]]={};}var _0x23fcab=new QueueReport();_0x23fcab['queue']=_0x2f57ad[_0xfe16('0x4d')];_0x23fcab['type']=this['voiceQueues'][_0x23fcab[_0xfe16('0x4d')]]&&this[_0xfe16('0x12')][_0x23fcab[_0xfe16('0x4d')]][_0xfe16('0x66')]?this[_0xfe16('0x12')][_0x23fcab[_0xfe16('0x4d')]][_0xfe16('0x66')]||_0xfe16('0x54'):_0xfe16('0x54');_0x23fcab[_0xfe16('0x70')]=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));_0x23fcab[_0xfe16('0x72')]=_0x2f57ad[_0xfe16('0x72')];_0x23fcab['count']=_0x2f57ad['count'];_0x23fcab[_0xfe16('0x4a')]=_0x2f57ad[_0xfe16('0x4a')];_0x23fcab[_0xfe16('0x73')]=this['channels'][_0x2f57ad[_0xfe16('0x4a')]]['routealias'];logger[_0xfe16('0x74')](_0xfe16('0x75'),_0x23fcab[_0xfe16('0x4d')],_0x23fcab['type']);Object[_0xfe16('0x65')](_0x23fcab,_[_0xfe16('0x76')](_0x2f57ad,_['keys'](_0x23fcab)));this[_0xfe16('0xe')][_0x2f57ad[_0xfe16('0x4a')]][_0xfe16('0x77')](_0x23fcab);this[_0xfe16('0x10')][_0x2f57ad['uniqueid']]=_0x23fcab;this[_0xfe16('0x46')](_0x23fcab,'queuecallerjoin');}}catch(_0x1a8f7f){logger[_0xfe16('0x3c')](_0xfe16('0x6f'),_0x2f57ad['uniqueid'],util['inspect'](_0x1a8f7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x1f')]=function(_0x41b86f){try{if(this[_0xfe16('0x57')](_0x41b86f)){logger[_0xfe16('0x47')](_0xfe16('0x78'),_0x41b86f[_0xfe16('0x4a')],util['inspect'](_0x41b86f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x41b86f['uniqueid']]){var _0x313d55=_['last'](this['queueReports'][_0x41b86f[_0xfe16('0x4a')]]);_0x313d55[_0xfe16('0x34')]=![];_0x313d55[_0xfe16('0x79')]=null;_0x313d55[_0xfe16('0x7a')]=_0x41b86f['holdtime'];_0x313d55['originalposition']=_0x41b86f['originalposition'];_0x313d55[_0xfe16('0x1e')]=!![];_0x313d55['queuecallerabandonAt']=moment()[_0xfe16('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x313d55[_0xfe16('0x50')]='ABANDONED';_0x313d55[_0xfe16('0x7b')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x313d55['queue'],_0x313d55[_0xfe16('0x66')]);this['channels'][_0x41b86f[_0xfe16('0x4a')]]=_0x313d55;this[_0xfe16('0x43')](_0x313d55,'queuecallerabandon');}}}catch(_0x57ba02){logger[_0xfe16('0x3c')](_0xfe16('0x78'),_0x41b86f[_0xfe16('0x4a')],util[_0xfe16('0x3e')](_0x57ba02,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x21')]=function(_0xbfeae1){try{if(this[_0xfe16('0x57')](_0xbfeae1)){logger[_0xfe16('0x47')](_0xfe16('0x7c'),_0xbfeae1[_0xfe16('0x4a')],util['inspect'](_0xbfeae1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xbfeae1[_0xfe16('0x4a')]]){var _0x93f626=_[_0xfe16('0x7d')](this[_0xfe16('0xe')][_0xbfeae1[_0xfe16('0x4a')]]);_0x93f626[_0xfe16('0x7e')]=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));_0x93f626[_0xfe16('0x7f')]=_0xbfeae1[_0xfe16('0x7f')];_0x93f626[_0xfe16('0x80')]=_0xbfeae1['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x93f626['queue'],_0x93f626[_0xfe16('0x66')],_0xbfeae1[_0xfe16('0x7f')],_0xbfeae1['connectedlinename']);this[_0xfe16('0x10')][_0xbfeae1[_0xfe16('0x4a')]]=_0x93f626;this['emitVoiceQueueChannelSave'](_0x93f626,_0xfe16('0x20'));}}}catch(_0x791c30){logger[_0xfe16('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0xbfeae1[_0xfe16('0x4a')],util['inspect'](_0x791c30,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x24')]=function(_0x31b146){try{if(this[_0xfe16('0x57')](_0x31b146)){logger['debug'](_0xfe16('0x81'),_0x31b146[_0xfe16('0x4a')],util[_0xfe16('0x3e')](_0x31b146,{'showHidden':![],'depth':null}));if(this[_0xfe16('0xe')][_0x31b146[_0xfe16('0x4a')]]){var _0x4b7258=_[_0xfe16('0x7d')](this['queueReports'][_0x31b146[_0xfe16('0x4a')]]);_0x4b7258[_0xfe16('0x34')]=!![];_0x4b7258[_0xfe16('0x50')]=_0xfe16('0x82');logger[_0xfe16('0x74')](_0xfe16('0x83'),_0x4b7258['queue'],_0x4b7258[_0xfe16('0x66')]);}}}catch(_0x5e6063){logger[_0xfe16('0x3c')](_0xfe16('0x81'),_0x31b146['uniqueid'],util['inspect'](_0x5e6063,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfe16('0x23')]=function(_0x183118){try{if(this[_0xfe16('0x57')](_0x183118)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x183118[_0xfe16('0x4a')],util[_0xfe16('0x3e')](_0x183118,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x183118[_0xfe16('0x4a')]]){var _0x5cf935=_[_0xfe16('0x7d')](this[_0xfe16('0xe')][_0x183118[_0xfe16('0x4a')]]);_0x5cf935[_0xfe16('0x1e')]=![];_0x5cf935[_0xfe16('0x84')]=null;_0x5cf935[_0xfe16('0x85')]=!![];_0x5cf935[_0xfe16('0x7b')]=_0x183118[_0xfe16('0x86')];_0x5cf935[_0xfe16('0x7a')]=_0x183118['holdtime'];_0x5cf935[_0xfe16('0x34')]=!![];_0x5cf935[_0xfe16('0x33')]=![];_0x5cf935[_0xfe16('0x87')]=null;if(!_0x5cf935[_0xfe16('0x88')]){if(_0x183118[_0xfe16('0x89')]==_0xfe16('0x88')){_0x5cf935[_0xfe16('0x50')]=_0xfe16('0x8a');logger[_0xfe16('0x74')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5cf935[_0xfe16('0x4d')],_0x5cf935[_0xfe16('0x66')]);}else{if(_[_0xfe16('0x8b')](_0x183118['channel']['toLowerCase'](),'local/')){if(this['queueReports'][_0x183118[_0xfe16('0x8c')]]){var _0x14f3ef=_[_0xfe16('0x7d')](this[_0xfe16('0xe')][_0x183118[_0xfe16('0x8c')]]);_0x14f3ef[_0xfe16('0x34')]=![];_0x14f3ef[_0xfe16('0x33')]=!![];_0x14f3ef[_0xfe16('0x87')]=moment(_0x5cf935[_0xfe16('0x70')])['add'](_0x183118['holdtime'],_0xfe16('0x8d'))[_0xfe16('0x4b')](_0xfe16('0x71'));_0x14f3ef['queuecallerexitreason']='FORWARDTRANSFER';_0x14f3ef[_0xfe16('0x88')]=!![];_0x14f3ef[_0xfe16('0x8e')]=_0xfe16('0x8f');_0x14f3ef[_0xfe16('0x90')]=_0x183118[_0xfe16('0x91')];_0x14f3ef[_0xfe16('0x92')]=_0x183118[_0xfe16('0x4a')];logger['info'](_0xfe16('0x93'),_0x14f3ef[_0xfe16('0x4d')],_0x14f3ef['type']);var _0x551886=this[_0xfe16('0xe')][_0x183118['linkedid']];this['queueReports'][_0x183118[_0xfe16('0x8c')]]=this[_0xfe16('0xe')][_0x183118[_0xfe16('0x4a')]];this[_0xfe16('0xe')][_0x183118['uniqueid']]=_0x551886;}}else{_0x5cf935[_0xfe16('0x50')]=_0xfe16('0x94')+_0x183118['reason']['toUpperCase']();logger[_0xfe16('0x74')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5cf935['queue'],_0x5cf935[_0xfe16('0x66')],_0x5cf935[_0xfe16('0x50')]);}}}this[_0xfe16('0x10')][_0x183118['uniqueid']]=_0x5cf935;}}}catch(_0x160828){logger[_0xfe16('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x183118['uniqueid'],util[_0xfe16('0x3e')](_0x160828,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfe16('0x95')]=function(_0x69d513){try{if(this[_0xfe16('0x57')](_0x69d513)){logger[_0xfe16('0x47')](_0xfe16('0x96'),_0x69d513[_0xfe16('0x4a')],util[_0xfe16('0x3e')](_0x69d513,{'showHidden':![],'depth':null}));this[_0xfe16('0x97')](_0x69d513[_0xfe16('0x4a')],_[_0xfe16('0x98')](_0x69d513[_0xfe16('0x99')])[0x0],_0x69d513['value']);if(this[_0xfe16('0xe')][_0x69d513[_0xfe16('0x4a')]]){var _0xecf7f3=_[_0xfe16('0x7d')](this[_0xfe16('0xe')][_0x69d513[_0xfe16('0x4a')]]);if(_0xecf7f3){if(this[_0xfe16('0x57')](_0x69d513['variable'])&&this[_0xfe16('0x57')](_0x69d513[_0xfe16('0x99')][_0xfe16('0x5c')])){switch(_0x69d513['value']){case _0xfe16('0x9a'):_0xecf7f3[_0xfe16('0x33')]=![];_0xecf7f3['queuecallerexitAt']=null;break;case'TIMEOUT':_0xecf7f3[_0xfe16('0x9b')]=_0xfe16('0x9c');_0xecf7f3[_0xfe16('0x33')]=!![];_0xecf7f3[_0xfe16('0x87')]=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));_0xecf7f3['queuecallerleaveAt']=moment()[_0xfe16('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xfe16('0x47')](_0xfe16('0x9d'),_0x69d513[_0xfe16('0x4a')],util[_0xfe16('0x3e')](_0xecf7f3,{'showHidden':![],'depth':null}));ami['emit'](_0xfe16('0x9e'),_0xecf7f3);break;default:_0xecf7f3[_0xfe16('0x33')]=!![];_0xecf7f3[_0xfe16('0x87')]=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));_0xecf7f3[_0xfe16('0x7e')]=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));}_0xecf7f3['queuecallerabandon']=![];_0xecf7f3[_0xfe16('0x84')]=null;_0xecf7f3['queuecallerexitreason']=_0x69d513[_0xfe16('0x9f')];this[_0xfe16('0x10')][_0x69d513[_0xfe16('0x4a')]]=_0xecf7f3;this[_0xfe16('0x43')](_0xecf7f3,_0xfe16('0xa0'));}else if(this[_0xfe16('0x57')](_0x69d513[_0xfe16('0x99')])&&this[_0xfe16('0x57')](_0x69d513[_0xfe16('0x99')]['queueposition'])){if(!_0xecf7f3[_0xfe16('0x1e')]){_0xecf7f3[_0xfe16('0x33')]=!![];_0xecf7f3[_0xfe16('0x87')]=moment()[_0xfe16('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0xecf7f3[_0xfe16('0x50')]='EXITWITHKEY';_0xecf7f3['queuecallerleaveAt']=moment()[_0xfe16('0x4b')](_0xfe16('0x71'));this[_0xfe16('0x10')][_0x69d513['uniqueid']]=_0xecf7f3;}}logger[_0xfe16('0x74')](_0xfe16('0xa1'),_0x69d513[_0xfe16('0x4a')],_0xecf7f3['queue'],_0xecf7f3['type'],_[_0xfe16('0x98')](_0x69d513[_0xfe16('0x99')])[0x0],_0x69d513['value']);_0xecf7f3[_0xfe16('0x15')]=this[_0xfe16('0x15')][_0x69d513[_0xfe16('0x4a')]];}}}}catch(_0x1a9f3f){logger[_0xfe16('0x3c')](_0xfe16('0x96'),_0x69d513[_0xfe16('0x4a')],util['inspect'](_0x1a9f3f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe16('0xb')][_0xfe16('0x97')]=function(_0x3390f9,_0x5ae23f,_0x85ec90){var _0x441efb=['rtpaudioqos',_0xfe16('0xa2'),'rtpaudioqosjitter',_0xfe16('0xa3'),_0xfe16('0xa4'),_0xfe16('0xa5'),_0xfe16('0xa6'),_0xfe16('0xa7'),_0xfe16('0xa8'),'sipuri','bridgepeer',_0xfe16('0xa9'),'membercalls',_0xfe16('0xaa'),'memberinterface',_0xfe16('0xab'),_0xfe16('0x86'),_0xfe16('0xac'),'memberrealtime'];if(!_[_0xfe16('0x37')](_0x5ae23f)&&!_[_0xfe16('0xad')](_0x441efb,_0x5ae23f)){if(_[_0xfe16('0x58')](this[_0xfe16('0x15')][_0x3390f9])){this[_0xfe16('0x15')][_0x3390f9]={};}this[_0xfe16('0x15')][_0x3390f9][_0x5ae23f]=_0x85ec90;}};VoiceQueueReport[_0xfe16('0xb')]['handleHangup']=function(_0x5ed238,_0x56771b,_0x19e52a){try{var _0x520faa={};if(this[_0xfe16('0xe')][_0x5ed238]){for(var _0x13930a=0x0;_0x13930a0x0?!![]:![];if(!_0x310299){return this[_0x44d9('0x6c')](this[_0x44d9('0x13')][_0x44d9('0x6d')]);}};VoiceQueueReport[_0x44d9('0x47')][_0x44d9('0x1a')]=function(_0x20b217){var _0x3da919=this['summary']['id'];if(this[_0x44d9('0x13')][_0x44d9('0x63')][_0x3da919]&&this[_0x44d9('0x13')][_0x44d9('0x63')][_0x3da919][_0x20b217[_0x44d9('0x61')]]){this[_0x44d9('0x13')][_0x44d9('0x63')][_0x3da919][_0x20b217[_0x44d9('0x61')]][_0x44d9('0xe')][_0x44d9('0x6e')](_0x20b217);}};VoiceQueueReport[_0x44d9('0x47')][_0x44d9('0x16')]=function(_0x21b3de){var _0x240452=this;try{if(this[_0x44d9('0x5b')](_0x21b3de)&&this[_0x44d9('0x5b')](_0x21b3de['queue'])){logger[_0x44d9('0x4c')](_0x44d9('0x6f'),util['inspect'](_0x21b3de,{'showHidden':![],'depth':null}));var _0x54d9b8=this[_0x44d9('0x11')][_0x21b3de['queue']];if(_0x54d9b8){logger[_0x44d9('0x4c')](_0x44d9('0x70'),_0x54d9b8[_0x44d9('0x59')]);this[_0x44d9('0x13')][_0x44d9('0x5f')][_0x54d9b8[_0x44d9('0x59')]]={'summaryEvent':_0x21b3de};this[_0x44d9('0x13')]['statusRequests']+=0x1;return ami[_0x44d9('0x3d')]({'action':'queuestatus','queue':_0x54d9b8[_0x44d9('0x59')]})[_0x44d9('0x60')](function(_0x51d15e){if(!_0x240452[_0x44d9('0x13')][_0x44d9('0x63')][_0x21b3de[_0x44d9('0x61')]]){_0x240452[_0x44d9('0x13')][_0x44d9('0x63')][_0x21b3de[_0x44d9('0x61')]]={};}_0x240452[_0x44d9('0x13')][_0x44d9('0x63')][_0x21b3de[_0x44d9('0x61')]][_0x51d15e[_0x44d9('0x61')]]={'queue':_0x54d9b8[_0x44d9('0x59')],'agents':[]};})[_0x44d9('0x3f')](function(_0x5166cc){throw _0x5166cc;});}}}catch(_0x9865ec){logger[_0x44d9('0x41')]('[voiceQueueReport][queuesummary]',util[_0x44d9('0x43')](_0x9865ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44d9('0x47')]['syncQueueSummaryComplete']=function(_0xf683b6){if(this[_0x44d9('0x13')][_0x44d9('0x6b')]>0x0){this[_0x44d9('0x13')][_0x44d9('0x6d')]=_0xf683b6;return;}logger[_0x44d9('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x44d9('0x43')](_0xf683b6,{'showHidden':![],'depth':null}));this[_0x44d9('0x13')]=initializeSummary();ami[_0x44d9('0x4a')](_0x44d9('0x71'),{});};VoiceQueueReport[_0x44d9('0x47')][_0x44d9('0x1e')]=function(_0x560122){try{if(this[_0x44d9('0x5b')](_0x560122)){logger[_0x44d9('0x4c')](_0x44d9('0x72'),_0x560122[_0x44d9('0x52')],util['inspect'](_0x560122,{'showHidden':![],'depth':null}));if(_[_0x44d9('0x5c')](this[_0x44d9('0xc')][_0x560122[_0x44d9('0x52')]])){this[_0x44d9('0xc')][_0x560122[_0x44d9('0x52')]]=[];}if(_[_0x44d9('0x5c')](this[_0x44d9('0xf')][_0x560122[_0x44d9('0x52')]])){this[_0x44d9('0xf')][_0x560122['uniqueid']]={};}var _0x2be749=new QueueReport();_0x2be749[_0x44d9('0x54')]=_0x560122['queue'];_0x2be749[_0x44d9('0x57')]=this[_0x44d9('0x11')][_0x2be749[_0x44d9('0x54')]]&&this[_0x44d9('0x11')][_0x2be749[_0x44d9('0x54')]]['type']?this['voiceQueues'][_0x2be749[_0x44d9('0x54')]][_0x44d9('0x57')]||_0x44d9('0x58'):_0x44d9('0x58');_0x2be749[_0x44d9('0x73')]=moment()['format'](_0x44d9('0x74'));_0x2be749[_0x44d9('0x75')]=_0x560122[_0x44d9('0x75')];_0x2be749[_0x44d9('0x76')]=_0x560122[_0x44d9('0x76')];_0x2be749[_0x44d9('0x52')]=_0x560122[_0x44d9('0x52')];_0x2be749[_0x44d9('0x77')]=this[_0x44d9('0xf')][_0x560122[_0x44d9('0x52')]][_0x44d9('0x77')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2be749[_0x44d9('0x54')],_0x2be749[_0x44d9('0x57')]);Object[_0x44d9('0x69')](_0x2be749,_[_0x44d9('0x78')](_0x560122,_[_0x44d9('0x79')](_0x2be749)));this[_0x44d9('0xc')][_0x560122[_0x44d9('0x52')]][_0x44d9('0x6e')](_0x2be749);this['channels'][_0x560122[_0x44d9('0x52')]]=_0x2be749;this[_0x44d9('0x4b')](_0x2be749,_0x44d9('0x1d'));}}catch(_0x3a535c){logger[_0x44d9('0x41')](_0x44d9('0x72'),_0x560122['uniqueid'],util[_0x44d9('0x43')](_0x3a535c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44d9('0x20')]=function(_0x583f69){try{if(this[_0x44d9('0x5b')](_0x583f69)){logger[_0x44d9('0x4c')]('[%s][voiceQueueReport][queuecallerabandon]',_0x583f69[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x583f69,{'showHidden':![],'depth':null}));if(this[_0x44d9('0xc')][_0x583f69[_0x44d9('0x52')]]){var _0x9a22b3=_[_0x44d9('0x7a')](this[_0x44d9('0xc')][_0x583f69['uniqueid']]);_0x9a22b3['queuecallercomplete']=![];_0x9a22b3['queuecallercompleteAt']=null;_0x9a22b3[_0x44d9('0x7b')]=_0x583f69[_0x44d9('0x7b')];_0x9a22b3[_0x44d9('0x7c')]=_0x583f69['originalposition'];_0x9a22b3[_0x44d9('0x1f')]=!![];_0x9a22b3['queuecallerabandonAt']=moment()[_0x44d9('0x53')](_0x44d9('0x74'));_0x9a22b3[_0x44d9('0x7d')]='ABANDONED';_0x9a22b3['lastAssignedTo']=null;logger['info'](_0x44d9('0x7e'),_0x9a22b3['queue'],_0x9a22b3['type']);this['channels'][_0x583f69[_0x44d9('0x52')]]=_0x9a22b3;this[_0x44d9('0x48')](_0x9a22b3,'queuecallerabandon');}}}catch(_0xa42bfa){logger[_0x44d9('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x583f69['uniqueid'],util[_0x44d9('0x43')](_0xa42bfa,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44d9('0x22')]=function(_0x56f039){try{if(this['isNotNull'](_0x56f039)){logger[_0x44d9('0x4c')](_0x44d9('0x7f'),_0x56f039[_0x44d9('0x52')],util['inspect'](_0x56f039,{'showHidden':![],'depth':null}));if(this[_0x44d9('0xc')][_0x56f039[_0x44d9('0x52')]]){var _0x4be4c9=_['last'](this[_0x44d9('0xc')][_0x56f039[_0x44d9('0x52')]]);_0x4be4c9['queuecallerleaveAt']=moment()[_0x44d9('0x53')](_0x44d9('0x74'));_0x4be4c9[_0x44d9('0x80')]=_0x56f039['connectedlinenum'];_0x4be4c9['connectedlinename']=_0x56f039[_0x44d9('0x81')];logger['info'](_0x44d9('0x82'),_0x4be4c9[_0x44d9('0x54')],_0x4be4c9[_0x44d9('0x57')],_0x56f039[_0x44d9('0x80')],_0x56f039[_0x44d9('0x81')]);this[_0x44d9('0xf')][_0x56f039['uniqueid']]=_0x4be4c9;this['emitVoiceQueueChannelSave'](_0x4be4c9,'queuecallerleave');}}}catch(_0x50129f){logger[_0x44d9('0x41')](_0x44d9('0x7f'),_0x56f039[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x50129f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44d9('0x25')]=function(_0x5d2a57){try{if(this[_0x44d9('0x5b')](_0x5d2a57)){logger['debug'](_0x44d9('0x83'),_0x5d2a57[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x5d2a57,{'showHidden':![],'depth':null}));if(this[_0x44d9('0xc')][_0x5d2a57['uniqueid']]){var _0x110bcd=_['last'](this[_0x44d9('0xc')][_0x5d2a57[_0x44d9('0x52')]]);_0x110bcd['queuecallercomplete']=!![];_0x110bcd[_0x44d9('0x7d')]=_0x44d9('0x84');logger['info'](_0x44d9('0x85'),_0x110bcd[_0x44d9('0x54')],_0x110bcd[_0x44d9('0x57')]);}}}catch(_0x12bd97){logger[_0x44d9('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x5d2a57[_0x44d9('0x52')],util['inspect'](_0x12bd97,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44d9('0x86')]=function(_0x18be2a){try{if(this[_0x44d9('0x5b')](_0x18be2a)){logger[_0x44d9('0x4c')](_0x44d9('0x87'),_0x18be2a[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x18be2a,{'showHidden':![],'depth':null}));if(this[_0x44d9('0xc')][_0x18be2a[_0x44d9('0x52')]]){var _0x2aec72=_[_0x44d9('0x7a')](this['queueReports'][_0x18be2a['uniqueid']]);_0x2aec72[_0x44d9('0x1f')]=![];_0x2aec72[_0x44d9('0x88')]=null;_0x2aec72['assigned']=!![];_0x2aec72[_0x44d9('0x89')]=_0x18be2a[_0x44d9('0x8a')];_0x2aec72[_0x44d9('0x7b')]=_0x18be2a[_0x44d9('0x7b')];_0x2aec72[_0x44d9('0x39')]=!![];_0x2aec72[_0x44d9('0x38')]=![];_0x2aec72[_0x44d9('0x8b')]=null;if(!_0x2aec72[_0x44d9('0x8c')]){if(_0x18be2a['reason']=='transfer'){_0x2aec72[_0x44d9('0x7d')]=_0x44d9('0x8d');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2aec72['queue'],_0x2aec72['type']);}else{if(_['startsWith'](_0x18be2a['channel'][_0x44d9('0x8e')](),_0x44d9('0x8f'))){if(this[_0x44d9('0xc')][_0x18be2a[_0x44d9('0x90')]]){var _0x1f08fd=_[_0x44d9('0x7a')](this['queueReports'][_0x18be2a[_0x44d9('0x90')]]);_0x1f08fd[_0x44d9('0x39')]=![];_0x1f08fd[_0x44d9('0x38')]=!![];_0x1f08fd[_0x44d9('0x8b')]=moment(_0x2aec72[_0x44d9('0x73')])[_0x44d9('0x91')](_0x18be2a[_0x44d9('0x7b')],_0x44d9('0x92'))[_0x44d9('0x53')](_0x44d9('0x74'));_0x1f08fd['queuecallerexitreason']='FORWARDTRANSFER';_0x1f08fd[_0x44d9('0x8c')]=!![];_0x1f08fd[_0x44d9('0x93')]=_0x44d9('0x94');_0x1f08fd[_0x44d9('0x95')]=_0x18be2a[_0x44d9('0x96')];_0x1f08fd[_0x44d9('0x97')]=_0x18be2a[_0x44d9('0x52')];logger['info'](_0x44d9('0x98'),_0x1f08fd[_0x44d9('0x54')],_0x1f08fd[_0x44d9('0x57')]);var _0x5a25cd=this[_0x44d9('0xc')][_0x18be2a['linkedid']];this[_0x44d9('0xc')][_0x18be2a[_0x44d9('0x90')]]=this[_0x44d9('0xc')][_0x18be2a['uniqueid']];this['queueReports'][_0x18be2a[_0x44d9('0x52')]]=_0x5a25cd;}}else{_0x2aec72[_0x44d9('0x7d')]='COMPLETEDBY'+_0x18be2a[_0x44d9('0x99')][_0x44d9('0x9a')]();logger['info'](_0x44d9('0x9b'),_0x2aec72[_0x44d9('0x54')],_0x2aec72[_0x44d9('0x57')],_0x2aec72[_0x44d9('0x7d')]);}}}this['channels'][_0x18be2a[_0x44d9('0x52')]]=_0x2aec72;}}}catch(_0x575532){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x18be2a[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x575532,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44d9('0x47')][_0x44d9('0x27')]=function(_0x1b1136){try{if(this[_0x44d9('0x5b')](_0x1b1136)){logger[_0x44d9('0x4c')](_0x44d9('0x9c'),_0x1b1136[_0x44d9('0x52')],util[_0x44d9('0x43')](_0x1b1136,{'showHidden':![],'depth':null}));this[_0x44d9('0x9d')](_0x1b1136['uniqueid'],_[_0x44d9('0x79')](_0x1b1136[_0x44d9('0x9e')])[0x0],_0x1b1136[_0x44d9('0x9f')]);if(this[_0x44d9('0xc')][_0x1b1136[_0x44d9('0x52')]]){var _0x192234=_['last'](this[_0x44d9('0xc')][_0x1b1136[_0x44d9('0x52')]]);if(_0x192234){if(this[_0x44d9('0x5b')](_0x1b1136[_0x44d9('0x9e')])&&this['isNotNull'](_0x1b1136[_0x44d9('0x9e')][_0x44d9('0x63')])){switch(_0x1b1136['value']){case _0x44d9('0xa0'):_0x192234[_0x44d9('0x38')]=![];_0x192234[_0x44d9('0x8b')]=null;break;case'TIMEOUT':_0x192234[_0x44d9('0xa1')]=_0x44d9('0xa2');_0x192234['queuecallerexit']=!![];_0x192234[_0x44d9('0x8b')]=moment()[_0x44d9('0x53')](_0x44d9('0x74'));_0x192234[_0x44d9('0xa3')]=moment()[_0x44d9('0x53')](_0x44d9('0x74'));logger[_0x44d9('0x4c')](_0x44d9('0xa4'),_0x1b1136['uniqueid'],util['inspect'](_0x192234,{'showHidden':![],'depth':null}));ami[_0x44d9('0x4a')](_0x44d9('0xa5'),_0x192234);break;default:_0x192234[_0x44d9('0x38')]=!![];_0x192234[_0x44d9('0x8b')]=moment()[_0x44d9('0x53')](_0x44d9('0x74'));_0x192234[_0x44d9('0xa3')]=moment()['format'](_0x44d9('0x74'));}_0x192234[_0x44d9('0x1f')]=![];_0x192234['queuecallerabandonAt']=null;_0x192234[_0x44d9('0x7d')]=_0x1b1136['value'];this[_0x44d9('0xf')][_0x1b1136[_0x44d9('0x52')]]=_0x192234;this[_0x44d9('0x48')](_0x192234,_0x44d9('0x26'));}else if(this[_0x44d9('0x5b')](_0x1b1136[_0x44d9('0x9e')])&&this[_0x44d9('0x5b')](_0x1b1136['variable'][_0x44d9('0xa6')])){if(!_0x192234[_0x44d9('0x1f')]){_0x192234[_0x44d9('0x38')]=!![];_0x192234['queuecallerexitAt']=moment()['format'](_0x44d9('0x74'));_0x192234[_0x44d9('0x7d')]=_0x44d9('0xa7');_0x192234[_0x44d9('0xa3')]=moment()[_0x44d9('0x53')](_0x44d9('0x74'));this[_0x44d9('0xf')][_0x1b1136[_0x44d9('0x52')]]=_0x192234;}}logger['info'](_0x44d9('0xa8'),_0x1b1136[_0x44d9('0x52')],_0x192234[_0x44d9('0x54')],_0x192234[_0x44d9('0x57')],_[_0x44d9('0x79')](_0x1b1136[_0x44d9('0x9e')])[0x0],_0x1b1136[_0x44d9('0x9f')]);_0x192234[_0x44d9('0x14')]=this[_0x44d9('0x14')][_0x1b1136[_0x44d9('0x52')]];}}}}catch(_0x45407c){logger[_0x44d9('0x41')](_0x44d9('0x9c'),_0x1b1136['uniqueid'],util[_0x44d9('0x43')](_0x45407c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44d9('0x47')][_0x44d9('0x9d')]=function(_0x497f9a,_0x3ef57c,_0x1e9a6e){var _0x4c9230=['rtpaudioqos',_0x44d9('0xa9'),_0x44d9('0xaa'),_0x44d9('0xab'),'rtpaudioqosloss',_0x44d9('0xac'),_0x44d9('0xad'),_0x44d9('0xae'),_0x44d9('0xaf'),_0x44d9('0xb0'),_0x44d9('0xb1'),_0x44d9('0xb2'),_0x44d9('0xb3'),_0x44d9('0xb4'),_0x44d9('0xb5'),_0x44d9('0xb6'),_0x44d9('0x8a'),_0x44d9('0xb7'),_0x44d9('0xb8')];if(!_[_0x44d9('0x3c')](_0x3ef57c)&&!_['includes'](_0x4c9230,_0x3ef57c)){if(_[_0x44d9('0x5c')](this[_0x44d9('0x14')][_0x497f9a])){this[_0x44d9('0x14')][_0x497f9a]={};}this['variables'][_0x497f9a][_0x3ef57c]=_0x1e9a6e;}};VoiceQueueReport['prototype'][_0x44d9('0xb9')]=function(_0x1130b6,_0x2dcc71,_0x3823b6){try{var _0x44be8f={};if(this[_0x44d9('0xc')][_0x1130b6]){for(var _0x21ed60=0x0;_0x21ed60=0x0?moment(_0x30d54c[_0x62dc('0x1a')])[_0x62dc('0xe')](_0x30d54c[_0x62dc('0x19')],_0x62dc('0x10')):null,'data1':_0x62dc('0x1b'),'data2':_0x30d54c[_0x62dc('0x15')],'data3':_0x30d54c[_0x62dc('0x12')],'data4':_0x30d54c[_0x62dc('0x1c')]||null,'role':_0x62dc('0x14'),'internal':_0x30d54c[_0x62dc('0x15')]?_[_0x62dc('0x1d')](_0x30d54c['accountcode']):undefined,'uniqueid':_0x30d54c[_0x62dc('0x16')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xe1a9=['lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voice','membername','TALKING','starttime','endtime','outbound','dialstring'];(function(_0x53b40d,_0x8d5ec5){var _0x4d5048=function(_0x5ab2e4){while(--_0x5ab2e4){_0x53b40d['push'](_0x53b40d['shift']());}};_0x4d5048(++_0x8d5ec5);}(_0xe1a9,0x195));var _0x9e1a=function(_0x54028e,_0x179cdc){_0x54028e=_0x54028e-0x0;var _0x13aafb=_0xe1a9[_0x54028e];return _0x13aafb;};'use strict';var moment=require('moment');var _=require(_0x9e1a('0x0'));var util=require('util');var client=require(_0x9e1a('0x1'));exports[_0x9e1a('0x2')]=function(_0x414757){var _0x2733b0=_0x414757[_0x9e1a('0x3')]||_0x414757[_0x9e1a('0x4')];return client[_0x9e1a('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x414757[_0x9e1a('0x6')],'interface':_['isNil'](_0x414757[_0x9e1a('0x7')])?util[_0x9e1a('0x8')](_0x9e1a('0x9'),_0x414757[_0x9e1a('0x6')]):_0x414757[_0x9e1a('0x7')],'type':'TALKING','enterAt':_0x414757[_0x9e1a('0xa')],'exitAt':_0x2733b0,'duration':moment(_0x2733b0)[_0x9e1a('0xb')](_0x414757[_0x9e1a('0xa')],_0x9e1a('0xc')),'data1':_0x9e1a('0xd'),'data2':_0x414757['calleridnum'],'data3':_0x414757[_0x9e1a('0xe')],'data4':null,'data5':_0x414757['queue'],'role':_0x9e1a('0xf'),'internal':_0x414757[_0x9e1a('0x10')]?_[_0x9e1a('0x11')](_0x414757[_0x9e1a('0x10')]):undefined,'uniqueid':_0x414757[_0x9e1a('0x12')]},'log':_0x9e1a('0x13')});};exports['voiceDialReport']=function(_0xe8b76c){return client[_0x9e1a('0x5')](_0x9e1a('0x13'),{'body':{'channel':_0x9e1a('0x14'),'membername':_0xe8b76c[_0x9e1a('0x15')],'interface':_0xe8b76c[_0x9e1a('0x7')],'type':_0x9e1a('0x16'),'enterAt':_0xe8b76c[_0x9e1a('0x17')],'exitAt':_0xe8b76c[_0x9e1a('0x18')],'duration':moment(_0xe8b76c['endtime'])[_0x9e1a('0xb')](_0xe8b76c[_0x9e1a('0x17')],_0x9e1a('0xc'))>=0x0?moment(_0xe8b76c[_0x9e1a('0x18')])[_0x9e1a('0xb')](_0xe8b76c[_0x9e1a('0x17')],_0x9e1a('0xc')):null,'data1':_0x9e1a('0x19'),'data2':_0xe8b76c[_0x9e1a('0x10')],'data3':_0xe8b76c['exten'],'data4':_0xe8b76c[_0x9e1a('0x1a')]||null,'role':_0x9e1a('0xf'),'internal':_0xe8b76c[_0x9e1a('0x10')]?_['toNumber'](_0xe8b76c[_0x9e1a('0x10')]):undefined,'uniqueid':_0xe8b76c['uniqueid']},'log':_0x9e1a('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d4b1cd5..78e8bcc 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 _0xe495=['Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x6b4f52,_0x4a17d1){var _0xa387e5=function(_0x2643b8){while(--_0x2643b8){_0x6b4f52['push'](_0x6b4f52['shift']());}};_0xa387e5(++_0x4a17d1);}(_0xe495,0xfe));var _0x5e49=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xe495[_0x3070dc];return _0x431489;};'use strict';var client=require(_0x5e49('0x0'));exports['getSettings']=function(){return client[_0x5e49('0x1')](_0x5e49('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x5e49('0x3')]},'log':_0x5e49('0x4')});}; \ No newline at end of file +var _0x1b0e=['../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x53741a,_0x1e6831){var _0x4c6e3d=function(_0x565310){while(--_0x565310){_0x53741a['push'](_0x53741a['shift']());}};_0x4c6e3d(++_0x1e6831);}(_0x1b0e,0x132));var _0xe1b0=function(_0x595d58,_0x125702){_0x595d58=_0x595d58-0x0;var _0xd8ced9=_0x1b0e[_0x595d58];return _0xd8ced9;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe1b0('0x4'),_0xe1b0('0x5')]},'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 fc3776e..cc39eba 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 _0x1d3a=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x4afaa5,_0x423280){var _0xdbfce2=function(_0x27ef1a){while(--_0x27ef1a){_0x4afaa5['push'](_0x4afaa5['shift']());}};_0xdbfce2(++_0x423280);}(_0x1d3a,0xa2));var _0xa1d3=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x1d3a[_0x3fba9f];return _0x192cf1;};'use strict';var client=require(_0xa1d3('0x0'));exports[_0xa1d3('0x1')]=function(_0x304300){return function(_0x2c16e2){return client[_0xa1d3('0x2')](_0xa1d3('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa1d3('0x4'),_0xa1d3('0x5')]},'log':_0xa1d3('0x3')});};}; \ No newline at end of file +var _0x406f=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x4064be,_0x1bdc00){var _0x4a28ca=function(_0x22e5a6){while(--_0x22e5a6){_0x4064be['push'](_0x4064be['shift']());}};_0x4a28ca(++_0x1bdc00);}(_0x406f,0x6f));var _0xf406=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x406f[_0x9dfc10];return _0x4f938a;};'use strict';var client=require(_0xf406('0x0'));exports[_0xf406('0x1')]=function(_0x4a30e5){return function(_0x34d7ff){return client[_0xf406('0x2')](_0xf406('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf406('0x4'),_0xf406('0x5')]},'log':_0xf406('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ad501da..46b6508 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 _0x6710=['data6','data7','GetTrigger','../client','getTriggers','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data2','data3','data4','data5'];(function(_0x5a709c,_0x1e6cfe){var _0x719025=function(_0x1ddba3){while(--_0x1ddba3){_0x5a709c['push'](_0x5a709c['shift']());}};_0x719025(++_0x1e6cfe);}(_0x6710,0x81));var _0x0671=function(_0x16bbb3,_0xe01e8f){_0x16bbb3=_0x16bbb3-0x0;var _0x296af5=_0x6710[_0x16bbb3];return _0x296af5;};'use strict';var client=require(_0x0671('0x0'));exports[_0x0671('0x1')]=function(_0x4c38a4){return function(_0x2ab1f8){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel',_0x0671('0x2')],'include':[{'model':_0x0671('0x3'),'as':_0x0671('0x4'),'attributes':['id',_0x0671('0x5'),_0x0671('0x6'),_0x0671('0x7')]},{'model':'Condition','as':_0x0671('0x8'),'attributes':['id',_0x0671('0x5'),_0x0671('0x6'),_0x0671('0x7')]},{'model':_0x0671('0x9'),'as':_0x0671('0xa'),'attributes':['id','action','data1',_0x0671('0xb'),_0x0671('0xc'),_0x0671('0xd'),_0x0671('0xe'),_0x0671('0xf'),_0x0671('0x10')]}]},'log':_0x0671('0x11')});};}; \ No newline at end of file +var _0x27a9=['AnyConditions','field','operator','Action','data1','data2','data3','data4','data7','../client','getTriggers','Request','GetTrigger','name','status','Condition','value'];(function(_0x21be3e,_0x4b68fa){var _0xe51680=function(_0x31ba21){while(--_0x31ba21){_0x21be3e['push'](_0x21be3e['shift']());}};_0xe51680(++_0x4b68fa);}(_0x27a9,0xc4));var _0x927a=function(_0x12fb2,_0xec17fa){_0x12fb2=_0x12fb2-0x0;var _0x3dd956=_0x27a9[_0x12fb2];return _0x3dd956;};'use strict';var client=require(_0x927a('0x0'));exports[_0x927a('0x1')]=function(_0x518b5c){return function(_0x2a86ca){return client[_0x927a('0x2')](_0x927a('0x3'),{'options':{'raw':![],'attributes':['id',_0x927a('0x4'),'channel',_0x927a('0x5')],'include':[{'model':_0x927a('0x6'),'as':'AllConditions','attributes':['id','field','operator',_0x927a('0x7')]},{'model':_0x927a('0x6'),'as':_0x927a('0x8'),'attributes':['id',_0x927a('0x9'),_0x927a('0xa'),_0x927a('0x7')]},{'model':_0x927a('0xb'),'as':'Actions','attributes':['id','action',_0x927a('0xc'),_0x927a('0xd'),_0x927a('0xe'),_0x927a('0xf'),'data5','data6',_0x927a('0x10')]}]},'log':_0x927a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index cdb662b..bf1e10d 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 _0x1793=['../client','getTrunks','GetTrunk','name','registry','defaultuser'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x1793,0x1ce));var _0x3179=function(_0x4512f2,_0x44be54){_0x4512f2=_0x4512f2-0x0;var _0x4b9a13=_0x1793[_0x4512f2];return _0x4b9a13;};'use strict';var client=require(_0x3179('0x0'));exports[_0x3179('0x1')]=function(_0x14f11d){return function(_0x44fb16){return client['Request'](_0x3179('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3179('0x3'),_0x3179('0x4'),_0x3179('0x5')]},'log':_0x3179('0x2')});};}; \ No newline at end of file +var _0x756e=['Request','GetTrunk','name','registry','../client','getTrunks'];(function(_0x3fbbe9,_0x2e3107){var _0xa5d90=function(_0x19c9bb){while(--_0x19c9bb){_0x3fbbe9['push'](_0x3fbbe9['shift']());}};_0xa5d90(++_0x2e3107);}(_0x756e,0x94));var _0xe756=function(_0x39a477,_0x1516c0){_0x39a477=_0x39a477-0x0;var _0x4e0a09=_0x756e[_0x39a477];return _0x4e0a09;};'use strict';var client=require(_0xe756('0x0'));exports[_0xe756('0x1')]=function(_0x31ae8f){return function(_0x312fc2){return client[_0xe756('0x2')](_0xe756('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe756('0x4'),_0xe756('0x5'),'defaultuser']},'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 20f2bc6..e629e10 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(_0x5edee8,_0x3fcca5){var _0x4ee39e=function(_0x56a9cb){while(--_0x56a9cb){_0x5edee8['push'](_0x5edee8['shift']());}};_0x4ee39e(++_0x3fcca5);}(_0xedd9,0xfc));var _0x9edd=function(_0x2526a3,_0x4db386){_0x2526a3=_0x2526a3-0x0;var _0x165c8d=_0xedd9[_0x2526a3];return _0x165c8d;};'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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6ae1971..92c1fa1 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 _0x9aa8=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9aa8,0xdb));var _0x89aa=function(_0x5fcec4,_0x1f4113){_0x5fcec4=_0x5fcec4-0x0;var _0x144816=_0x9aa8[_0x5fcec4];return _0x144816;};'use strict';var client=require('../client');exports[_0x89aa('0x0')]=function(_0x31bdc7){return client[_0x89aa('0x1')](_0x89aa('0x2'),{'body':_0x31bdc7,'log':_0x89aa('0x2')});};exports[_0x89aa('0x3')]=function(_0x22e1e9,_0x2ce9af,_0x1f3c5d){return client[_0x89aa('0x1')]('UpdateVoiceAgentReport',{'body':_0x22e1e9,'options':{'where':{'uniqueid':_0x2ce9af,'interface':_0x1f3c5d,'agentcomplete':!![]}},'log':_0x89aa('0x4')});}; \ No newline at end of file +var _0x72c9=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x3df9d1,_0x15ee66){var _0x52b480=function(_0xe0ad5c){while(--_0xe0ad5c){_0x3df9d1['push'](_0x3df9d1['shift']());}};_0x52b480(++_0x15ee66);}(_0x72c9,0xfd));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x972c('0x0'));exports[_0x972c('0x1')]=function(_0x51dbb0){return client[_0x972c('0x2')](_0x972c('0x3'),{'body':_0x51dbb0,'log':'CreateVoiceAgentReport'});};exports[_0x972c('0x4')]=function(_0x5d4b3a,_0x2bf1a,_0x1ba52c){return client[_0x972c('0x2')](_0x972c('0x5'),{'body':_0x5d4b3a,'options':{'where':{'uniqueid':_0x2bf1a,'interface':_0x1ba52c,'agentcomplete':!![]}},'log':_0x972c('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 3f53a8c..c708439 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 _0xd2c0=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','context','getVoiceCallReports','Request','GetVoiceCallReport'];(function(_0x1e0e3c,_0x524bd7){var _0x6ec019=function(_0x38fc42){while(--_0x38fc42){_0x1e0e3c['push'](_0x1e0e3c['shift']());}};_0x6ec019(++_0x524bd7);}(_0xd2c0,0x118));var _0x0d2c=function(_0x1474f5,_0x343679){_0x1474f5=_0x1474f5-0x0;var _0x3c901f=_0xd2c0[_0x1474f5];return _0x3c901f;};'use strict';var moment=require(_0x0d2c('0x0'));var util=require(_0x0d2c('0x1'));var _=require(_0x0d2c('0x2'));var client=require('../client');exports[_0x0d2c('0x3')]=function(_0x276318){return client['Request'](_0x0d2c('0x4'),{'body':_['merge'](_0x276318,{'source':_0x276318['calleridnum'],'destinationcontext':_0x276318[_0x0d2c('0x5')],'callerid':_0x276318['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x0d2c('0x4')});};exports[_0x0d2c('0x6')]=function(){return function(){return client[_0x0d2c('0x7')](_0x0d2c('0x8'),{'options':{'where':{'type':[_0x0d2c('0x9')],'createdAt':{'$between':[moment()[_0x0d2c('0xa')](_0x0d2c('0xb'))[_0x0d2c('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x0d2c('0xc')](_0x0d2c('0xd'))]}},'attributes':[_0x0d2c('0xe'),'disposition','duration',_0x0d2c('0xf')]},'log':_0x0d2c('0x10')});};}; \ No newline at end of file +var _0xcb65=['getVoiceCallReports','GetVoiceCallReport','YYYY-MM-DD\x20HH:mm:ss','endOf','day','disposition','duration','moment','util','create','Request','merge','calleridnum','context','callerid'];(function(_0x14482c,_0x2672cf){var _0x88ccdc=function(_0xc08c7f){while(--_0xc08c7f){_0x14482c['push'](_0x14482c['shift']());}};_0x88ccdc(++_0x2672cf);}(_0xcb65,0x18d));var _0x5cb6=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xcb65[_0x4b12ae];return _0x16957b;};'use strict';var moment=require(_0x5cb6('0x0'));var util=require(_0x5cb6('0x1'));var _=require('lodash');var client=require('../client');exports[_0x5cb6('0x2')]=function(_0x46a041){return client[_0x5cb6('0x3')]('CreateVoiceCallReport',{'body':_[_0x5cb6('0x4')](_0x46a041,{'source':_0x46a041[_0x5cb6('0x5')],'destinationcontext':_0x46a041[_0x5cb6('0x6')],'callerid':_0x46a041[_0x5cb6('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x5cb6('0x8')]=function(){return function(){return client[_0x5cb6('0x3')](_0x5cb6('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')['format'](_0x5cb6('0xa')),moment()[_0x5cb6('0xb')](_0x5cb6('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x5cb6('0xd'),_0x5cb6('0xe'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 5793271..6b60506 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 _0x6098=['CreateVoiceDialReport','Request'];(function(_0x16e385,_0x4e8db2){var _0x78c03e=function(_0x2db5ad){while(--_0x2db5ad){_0x16e385['push'](_0x16e385['shift']());}};_0x78c03e(++_0x4e8db2);}(_0x6098,0x17d));var _0x8609=function(_0x45bd84,_0x4a61bb){_0x45bd84=_0x45bd84-0x0;var _0x551b62=_0x6098[_0x45bd84];return _0x551b62;};'use strict';var client=require('../client');exports['create']=function(_0x97d941){return client[_0x8609('0x0')](_0x8609('0x1'),{'body':_0x97d941,'log':_0x8609('0x1')});}; \ No newline at end of file +var _0x482b=['Request','CreateVoiceDialReport','create'];(function(_0x77add,_0x2016b8){var _0xa1b62d=function(_0x2d3d57){while(--_0x2d3d57){_0x77add['push'](_0x77add['shift']());}};_0xa1b62d(++_0x2016b8);}(_0x482b,0x6e));var _0xb482=function(_0x25ddd6,_0x3785e2){_0x25ddd6=_0x25ddd6-0x0;var _0x49b1b1=_0x482b[_0x25ddd6];return _0x49b1b1;};'use strict';var client=require('../client');exports[_0xb482('0x0')]=function(_0x26b09a){return client[_0xb482('0x1')]('CreateVoiceDialReport',{'body':_0x26b09a,'log':_0xb482('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2fd519d..f9b2b3f 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 _0x8868=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3ef09b,_0x5fa6d8){var _0x446c88=function(_0x3c5548){while(--_0x3c5548){_0x3ef09b['push'](_0x3ef09b['shift']());}};_0x446c88(++_0x5fa6d8);}(_0x8868,0x1ca));var _0x8886=function(_0x59b207,_0x4a2c19){_0x59b207=_0x59b207-0x0;var _0x435f2a=_0x8868[_0x59b207];return _0x435f2a;};'use strict';var client=require(_0x8886('0x0'));exports[_0x8886('0x1')]=function(){return function(){return client[_0x8886('0x2')](_0x8886('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8886('0x4'),_0x8886('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x8886('0x1')});};}; \ No newline at end of file +var _0xcd60=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x38813c,_0x561563){var _0x52183e=function(_0x3fadb2){while(--_0x3fadb2){_0x38813c['push'](_0x38813c['shift']());}};_0x52183e(++_0x561563);}(_0xcd60,0xf0));var _0x0cd6=function(_0xd3b91b,_0xe6d0d8){_0xd3b91b=_0xd3b91b-0x0;var _0xa38119=_0xcd60[_0xd3b91b];return _0xa38119;};'use strict';var client=require(_0x0cd6('0x0'));exports[_0x0cd6('0x1')]=function(){return function(){return client[_0x0cd6('0x2')](_0x0cd6('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0cd6('0x4'),_0x0cd6('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x0cd6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c385770..a056a7d 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 _0xd9c0=['dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0xd9c0,0x1c7));var _0x0d9c=function(_0x26bdc4,_0x2ddff4){_0x26bdc4=_0x26bdc4-0x0;var _0xd85a81=_0xd9c0[_0x26bdc4];return _0xd85a81;};'use strict';var client=require(_0x0d9c('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x0d9c('0x1')](_0x0d9c('0x2'),{'options':{'raw':![],'attributes':['id',_0x0d9c('0x3'),_0x0d9c('0x4'),_0x0d9c('0x5'),_0x0d9c('0x6'),_0x0d9c('0x7'),'type',_0x0d9c('0x8'),_0x0d9c('0x9'),'dialLimitChannel',_0x0d9c('0xa'),'dialPowerLevel',_0x0d9c('0xb'),_0x0d9c('0xc'),_0x0d9c('0xd'),_0x0d9c('0xe'),'dialOriginateCallerIdNumber',_0x0d9c('0xf'),'dialQueueOptions','dialQueueTimeout','dialQueueProject',_0x0d9c('0x10'),_0x0d9c('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x0d9c('0x12'),'dialNoAnswerRetryFrequency',_0x0d9c('0x13'),_0x0d9c('0x14'),_0x0d9c('0x15'),_0x0d9c('0x16'),_0x0d9c('0x17'),_0x0d9c('0x18'),'dialAMDInitialSilence',_0x0d9c('0x19'),'dialAMDAfterGreetingSilence',_0x0d9c('0x1a'),'dialAMDMinWordLength',_0x0d9c('0x1b'),_0x0d9c('0x1c'),_0x0d9c('0x1d'),'dialAMDMaximumWordLength',_0x0d9c('0x1e'),_0x0d9c('0x1f'),_0x0d9c('0x20'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x0d9c('0x21'),'dialQueueProject2',_0x0d9c('0x7'),_0x0d9c('0x22'),_0x0d9c('0x23'),_0x0d9c('0x24'),_0x0d9c('0x25'),_0x0d9c('0x26'),'dialDropMaxRetry',_0x0d9c('0x27'),_0x0d9c('0x28'),'dialAbandonedRetryFrequency',_0x0d9c('0x29'),_0x0d9c('0x2a'),_0x0d9c('0x2b'),_0x0d9c('0x2c'),_0x0d9c('0x2d'),_0x0d9c('0x2e'),_0x0d9c('0x2f'),_0x0d9c('0x30'),_0x0d9c('0x31')],'include':[{'model':_0x0d9c('0x32'),'as':_0x0d9c('0x32'),'attributes':['id',_0x0d9c('0x3'),_0x0d9c('0x33'),_0x0d9c('0x34')]},{'model':_0x0d9c('0x35'),'as':_0x0d9c('0x36'),'attributes':['id',_0x0d9c('0x3')]},{'model':_0x0d9c('0x32'),'as':_0x0d9c('0x37'),'attributes':['id',_0x0d9c('0x3'),_0x0d9c('0x33'),_0x0d9c('0x34')]},{'model':'Interval','as':_0x0d9c('0x38'),'attributes':['id','name'],'include':[{'model':_0x0d9c('0x38'),'as':_0x0d9c('0x39'),'attributes':['id',_0x0d9c('0x3'),_0x0d9c('0x3a')]}]}]},'log':_0x0d9c('0x3b')});};}; \ No newline at end of file +var _0x183c=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','getVoiceQueues','../client','Request','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x183c,0x9b));var _0xc183=function(_0x1207df,_0x4ecb5b){_0x1207df=_0x1207df-0x0;var _0x305c81=_0x183c[_0x1207df];return _0x305c81;};'use strict';var client=require(_0xc183('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xc183('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xc183('0x2'),_0xc183('0x3'),'acwTimeout',_0xc183('0x4'),_0xc183('0x5'),_0xc183('0x6'),_0xc183('0x7'),_0xc183('0x8'),_0xc183('0x9'),'dialLimitQueue',_0xc183('0xa'),_0xc183('0xb'),_0xc183('0xc'),_0xc183('0xd'),_0xc183('0xe'),_0xc183('0xf'),_0xc183('0x10'),_0xc183('0x11'),_0xc183('0x12'),_0xc183('0x13'),_0xc183('0x14'),_0xc183('0x15'),_0xc183('0x16'),_0xc183('0x17'),_0xc183('0x18'),_0xc183('0x19'),'dialGlobalMaxRetry',_0xc183('0x1a'),_0xc183('0x1b'),'dialPrefix','dialCheckDuplicateType',_0xc183('0x1c'),_0xc183('0x1d'),_0xc183('0x1e'),_0xc183('0x1f'),_0xc183('0x20'),_0xc183('0x21'),_0xc183('0x22'),_0xc183('0x23'),_0xc183('0x24'),_0xc183('0x25'),_0xc183('0x26'),_0xc183('0x27'),_0xc183('0x28'),_0xc183('0x29'),_0xc183('0x2a'),_0xc183('0x2b'),_0xc183('0x2c'),_0xc183('0x5'),'strategy','dialRandomLastDigitCallerIdNumber',_0xc183('0x2d'),_0xc183('0x2e'),_0xc183('0x2f'),_0xc183('0x30'),_0xc183('0x31'),_0xc183('0x32'),_0xc183('0x33'),_0xc183('0x34'),_0xc183('0x35'),_0xc183('0x36'),_0xc183('0x37'),_0xc183('0x38'),_0xc183('0x39'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0xc183('0x3a')],'include':[{'model':_0xc183('0x3b'),'as':'Trunk','attributes':['id',_0xc183('0x2'),_0xc183('0x3c'),_0xc183('0x3d')]},{'model':_0xc183('0x3e'),'as':_0xc183('0x3f'),'attributes':['id','name']},{'model':'Trunk','as':_0xc183('0x40'),'attributes':['id',_0xc183('0x2'),_0xc183('0x3c'),'active']},{'model':'Interval','as':_0xc183('0x41'),'attributes':['id','name'],'include':[{'model':_0xc183('0x41'),'as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0xc183('0x42')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 815b0bf..18e2f9d 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(_0xdd7c81,_0x49e9b1){var _0xaf68dc=function(_0xfbdf07){while(--_0xfbdf07){_0xdd7c81['push'](_0xdd7c81['shift']());}};_0xaf68dc(++_0x49e9b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x23f32c,_0x5e10f3){var _0xc67f86=function(_0x51d4d3){while(--_0x51d4d3){_0x23f32c['push'](_0x23f32c['shift']());}};_0xc67f86(++_0x5e10f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 ca9d3f2..03f429e 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 _0x4682=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4682,0x16d));var _0x2468=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x4682[_0x10d34b];return _0x92b0bf;};'use strict';var client=require(_0x2468('0x0'));exports[_0x2468('0x1')]=function(_0x346962){return function(){return client[_0x2468('0x2')](_0x2468('0x3'),{'options':{'where':{'VoiceQueueId':_0x346962,'paused':!![]},'raw':!![]},'log':_0x2468('0x1')});};}; \ No newline at end of file +var _0xbab4=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x294e1f,_0x13e987){var _0x580c6e=function(_0x2a3184){while(--_0x2a3184){_0x294e1f['push'](_0x294e1f['shift']());}};_0x580c6e(++_0x13e987);}(_0xbab4,0x148));var _0x4bab=function(_0x3c4e86,_0x55c4b8){_0x3c4e86=_0x3c4e86-0x0;var _0x5c5cd6=_0xbab4[_0x3c4e86];return _0x5c5cd6;};'use strict';var client=require(_0x4bab('0x0'));exports[_0x4bab('0x1')]=function(_0x329920){return function(){return client[_0x4bab('0x2')](_0x4bab('0x3'),{'options':{'where':{'VoiceQueueId':_0x329920,'paused':!![]},'raw':!![]},'log':_0x4bab('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 4c73102..e0b73ab 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x341ff7,_0x558689){var _0x1f5fb9=function(_0x5c6dc9){while(--_0x5c6dc9){_0x341ff7['push'](_0x341ff7['shift']());}};_0x1f5fb9(++_0x558689);}(_0x7a54,0x106));var _0x47a5=function(_0x3c346a,_0x2949dc){_0x3c346a=_0x3c346a-0x0;var _0x829a92=_0x7a54[_0x3c346a];return _0x829a92;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xffe753,_0x5288c7){var _0x28516c=function(_0x142b9c){while(--_0x142b9c){_0xffe753['push'](_0xffe753['shift']());}};_0x28516c(++_0x5288c7);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 37b903c..19f39fc 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 _0x5068=['secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x1c69b4,_0x306679){var _0x35bb79=function(_0x541c93){while(--_0x541c93){_0x1c69b4['push'](_0x1c69b4['shift']());}};_0x35bb79(++_0x306679);}(_0x5068,0x9b));var _0x8506=function(_0x40f23b,_0x485132){_0x40f23b=_0x40f23b-0x0;var _0x7b4cad=_0x5068[_0x40f23b];return _0x7b4cad;};'use strict';var client=require(_0x8506('0x0'));exports[_0x8506('0x1')]={};exports[_0x8506('0x2')]=function(_0x4bb276){return client[_0x8506('0x3')](_0x8506('0x4'),{'body':{'result':_0x4bb276[_0x8506('0x5')],'transfererchannel':_0x4bb276['transfererchannel'],'transferercalleridnum':_0x4bb276['transferercalleridnum'],'transferercalleridname':_0x4bb276[_0x8506('0x6')],'transfererconnectedlinenum':_0x4bb276[_0x8506('0x7')],'transfererconnectedlinename':_0x4bb276['transfererconnectedlinename'],'transfereraccountcode':_0x4bb276[_0x8506('0x8')],'transferercontext':_0x4bb276[_0x8506('0x9')],'transfererexten':_0x4bb276[_0x8506('0xa')],'transfererlinkedid':_0x4bb276['transfererlinkedid'],'transfereechannel':_0x4bb276[_0x8506('0xb')],'transfereecalleridnum':_0x4bb276[_0x8506('0xc')],'transfereecalleridname':_0x4bb276[_0x8506('0xd')],'transfereeconnectedlinenum':_0x4bb276['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4bb276[_0x8506('0xe')],'transfereeaccountcode':_0x4bb276[_0x8506('0xf')],'transfereecontext':_0x4bb276[_0x8506('0x10')],'transfereeexten':_0x4bb276[_0x8506('0x11')],'transfereelinkedid':_0x4bb276[_0x8506('0x12')],'isexternal':_0x4bb276[_0x8506('0x13')],'context':_0x4bb276['context'],'extension':_0x4bb276[_0x8506('0x14')],'type':'blind'},'log':_0x8506('0x4')});};exports['attendedTransfer']=function(_0x1a3526){return client[_0x8506('0x3')](_0x8506('0x4'),{'body':{'result':_0x1a3526['result'],'transfererchannel':_0x1a3526[_0x8506('0x15')],'transferercalleridnum':_0x1a3526['origtransferercalleridnum'],'transferercalleridname':_0x1a3526[_0x8506('0x16')],'transfererconnectedlinenum':_0x1a3526['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1a3526[_0x8506('0x17')],'transfereraccountcode':_0x1a3526[_0x8506('0x18')],'transferercontext':_0x1a3526['secondtransferercontext'],'transfererexten':_0x1a3526[_0x8506('0x19')],'transfererlinkedid':_0x1a3526[_0x8506('0x1a')],'transfereechannel':_0x1a3526[_0x8506('0x1b')],'transfereecalleridnum':_0x1a3526[_0x8506('0x1c')],'transfereecalleridname':_0x1a3526['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1a3526[_0x8506('0x1d')],'transfereeconnectedlinename':_0x1a3526[_0x8506('0x1e')],'transfereeaccountcode':_0x1a3526['transfertargetaccountcode'],'transfereecontext':_0x1a3526['transfertargetcontext'],'transfereeexten':_0x1a3526[_0x8506('0x1f')],'transfereelinkedid':_0x1a3526[_0x8506('0x20')],'isexternal':_0x1a3526[_0x8506('0x13')],'context':_0x1a3526[_0x8506('0x21')],'extension':_0x1a3526[_0x8506('0x22')],'type':_0x8506('0x23')},'log':_0x8506('0x4')});}; \ No newline at end of file +var _0xc672=['secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfereecalleridnum','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xc672,0x6e));var _0x2c67=function(_0x2179d7,_0x291a0e){_0x2179d7=_0x2179d7-0x0;var _0x575901=_0xc672[_0x2179d7];return _0x575901;};'use strict';var client=require(_0x2c67('0x0'));exports['transfers']={};exports[_0x2c67('0x1')]=function(_0x384044){return client['Request'](_0x2c67('0x2'),{'body':{'result':_0x384044['result'],'transfererchannel':_0x384044['transfererchannel'],'transferercalleridnum':_0x384044[_0x2c67('0x3')],'transferercalleridname':_0x384044[_0x2c67('0x4')],'transfererconnectedlinenum':_0x384044['transfererconnectedlinenum'],'transfererconnectedlinename':_0x384044[_0x2c67('0x5')],'transfereraccountcode':_0x384044['transfereraccountcode'],'transferercontext':_0x384044[_0x2c67('0x6')],'transfererexten':_0x384044[_0x2c67('0x7')],'transfererlinkedid':_0x384044['transfererlinkedid'],'transfereechannel':_0x384044['transfereechannel'],'transfereecalleridnum':_0x384044[_0x2c67('0x8')],'transfereecalleridname':_0x384044['transfereecalleridname'],'transfereeconnectedlinenum':_0x384044['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x384044['transfereeconnectedlinename'],'transfereeaccountcode':_0x384044[_0x2c67('0x9')],'transfereecontext':_0x384044[_0x2c67('0xa')],'transfereeexten':_0x384044['transfereeexten'],'transfereelinkedid':_0x384044[_0x2c67('0xb')],'isexternal':_0x384044[_0x2c67('0xc')],'context':_0x384044['context'],'extension':_0x384044[_0x2c67('0xd')],'type':_0x2c67('0xe')},'log':'CreateVoiceTransferReport'});};exports[_0x2c67('0xf')]=function(_0x9861e2){return client[_0x2c67('0x10')](_0x2c67('0x2'),{'body':{'result':_0x9861e2[_0x2c67('0x11')],'transfererchannel':_0x9861e2[_0x2c67('0x12')],'transferercalleridnum':_0x9861e2[_0x2c67('0x13')],'transferercalleridname':_0x9861e2['origtransferercalleridname'],'transfererconnectedlinenum':_0x9861e2[_0x2c67('0x14')],'transfererconnectedlinename':_0x9861e2[_0x2c67('0x15')],'transfereraccountcode':_0x9861e2['origtransfereraccountcode'],'transferercontext':_0x9861e2['secondtransferercontext'],'transfererexten':_0x9861e2[_0x2c67('0x16')],'transfererlinkedid':_0x9861e2[_0x2c67('0x17')],'transfereechannel':_0x9861e2[_0x2c67('0x18')],'transfereecalleridnum':_0x9861e2[_0x2c67('0x19')],'transfereecalleridname':_0x9861e2[_0x2c67('0x1a')],'transfereeconnectedlinenum':_0x9861e2['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x9861e2[_0x2c67('0x1b')],'transfereeaccountcode':_0x9861e2[_0x2c67('0x1c')],'transfereecontext':_0x9861e2['transfertargetcontext'],'transfereeexten':_0x9861e2['transfertargetexten'],'transfereelinkedid':_0x9861e2[_0x2c67('0x1d')],'isexternal':_0x9861e2[_0x2c67('0xc')],'context':_0x9861e2[_0x2c67('0x1e')],'extension':_0x9861e2[_0x2c67('0x1f')],'type':_0x2c67('0x20')},'log':_0x2c67('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 274e07f..eb637e1 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x1fbdd3,_0x5aef1c){var _0x5bdb44=function(_0x5a103f){while(--_0x5a103f){_0x1fbdd3['push'](_0x1fbdd3['shift']());}};_0x5bdb44(++_0x5aef1c);}(_0x7a54,0x106));var _0x47a5=function(_0x308076,_0x504fef){_0x308076=_0x308076-0x0;var _0x4364e4=_0x7a54[_0x308076];return _0x4364e4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x3ad1a9,_0x1c7d37){var _0x2e6c59=function(_0x29c25c){while(--_0x29c25c){_0x3ad1a9['push'](_0x3ad1a9['shift']());}};_0x2e6c59(++_0x1c7d37);}(_0x7a54,0x106));var _0x47a5=function(_0x304439,_0xbfec4a){_0x304439=_0x304439-0x0;var _0x29f84f=_0x7a54[_0x304439];return _0x29f84f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 18a0540..e30315d 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 _0x53ce=['uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','name','action','toLowerCase','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','ListId','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s'];(function(_0x1c66f1,_0x53c85c){var _0x682d89=function(_0x2e0036){while(--_0x2e0036){_0x1c66f1['push'](_0x1c66f1['shift']());}};_0x682d89(++_0x53c85c);}(_0x53ce,0x12e));var _0xe53c=function(_0x564d22,_0x5db59b){_0x564d22=_0x564d22-0x0;var _0x23d8c0=_0x53ce[_0x564d22];return _0x23d8c0;};'use strict';var _=require(_0xe53c('0x0'));var BPromise=require('bluebird');var Redis=require(_0xe53c('0x1'));var util=require(_0xe53c('0x2'));var config=require(_0xe53c('0x3'));var logger=require(_0xe53c('0x4'))(_0xe53c('0x5'));var cmContactRpc=require(_0xe53c('0x6'));config['redis']=_[_0xe53c('0x7')](config[_0xe53c('0x8')],{'host':_0xe53c('0x9'),'port':0x18eb});var io=require(_0xe53c('0xa'))(new Redis(config['redis']));function emit(_0x257911,_0x10a3bd,_0x21475d,_0x474445,_0x44da10){logger[_0xe53c('0xb')](_0xe53c('0xc'),_0x257911,_0x10a3bd['id'],_0x21475d,_0x474445,JSON[_0xe53c('0xd')](_0x44da10));io['to'](_0x21475d)['emit'](_0x474445,_0x44da10);}exports['exec']=function(_0x53f68c,_0x1bb36e,_0x39573f,_0x8d2000){var _0x4cc417,_0x1fd9ca;var _0x13cc1f={};var _0x1a95f8;var _0x463aaf=Number(_0x39573f[_0xe53c('0xe')]);var _0x16ebdd=_0x39573f[_0xe53c('0xf')]?Boolean(Number(_0x39573f[_0xe53c('0xf')])):![];var _0x1c0d7b;var _0x17e325=![];if(!_[_0xe53c('0x10')](_0x39573f[_0xe53c('0x11')])){if(_0x39573f[_0xe53c('0x11')]=='1')_0x17e325=!![];}if(!_0x17e325){if(_0x8d2000[_0xe53c('0x12')]){_0x13cc1f['id']=_0x8d2000['xmd-contactid'];}}if(!_0x13cc1f['id']){_0x13cc1f['ListId']=_0x463aaf;_0x1c0d7b=_0x39573f[_0xe53c('0x13')]&&_0x39573f['data3']!=='0'?_0x39573f[_0xe53c('0x13')][_0xe53c('0x14')](','):[_0xe53c('0x15')];_0x13cc1f[_0xe53c('0x16')]=_[_0xe53c('0x17')](_0x1c0d7b,function(_0x207f38){var _0xa11b75={};_0xa11b75[_0x207f38]=_0x8d2000[_0xe53c('0x18')]?_0x8d2000['destcalleridnum']:_0x8d2000[_0xe53c('0x19')];return _0xa11b75;});_0x1a95f8=_0x8d2000[_0xe53c('0x18')]?_0x8d2000[_0xe53c('0x1a')]:_0x8d2000[_0xe53c('0x19')];}var _0x232c69=['id',_0xe53c('0x1b'),_0xe53c('0x1c'),'phone',_0xe53c('0x1d'),'fax',_0xe53c('0x1e'),_0xe53c('0x1f'),'scheduledAt',_0xe53c('0x20')];var _0x1b69e8=_[_0xe53c('0x21')](_0x232c69,_0x1c0d7b);BPromise[_0xe53c('0x22')]()[_0xe53c('0x23')](cmContactRpc[_0xe53c('0x24')]({'attributes':_0x1b69e8,'where':_0x13cc1f,'phone':_0x1a95f8}))[_0xe53c('0x23')](function(_0x2017a0){_0x1fd9ca=_0x2017a0;if(!_[_0xe53c('0x25')](_0x1fd9ca)){if(_0x1fd9ca[_0xe53c('0x26')]===0x1){_0x4cc417=_0x1fd9ca[0x0];logger['info'](_0xe53c('0x27'),_0x8d2000[_0xe53c('0x28')],_0x1bb36e['id'],_0x4cc417['id']);}else{logger[_0xe53c('0xb')](_0xe53c('0x29'),_0x8d2000[_0xe53c('0x28')],_0x1bb36e['id'],_[_0xe53c('0x17')](_0x1fd9ca,'id')[_0xe53c('0x2a')](','));}return;}else{logger['info'](_0xe53c('0x2b'),_0x8d2000[_0xe53c('0x28')],_0x1bb36e['id']);var _0x37d554={'ListId':_0x463aaf};var _0xfc85b2=_0x39573f[_0xe53c('0x2c')]&&_0x39573f[_0xe53c('0x2c')]!=='0'?_0x39573f[_0xe53c('0x2c')]:_0xe53c('0x15');if(_0x16ebdd){logger[_0xe53c('0xb')](_0xe53c('0x2d'),_0x8d2000[_0xe53c('0x28')],_0x1bb36e['id']);_0x37d554[_0xfc85b2]=_[_0xe53c('0x10')](_0x8d2000[_0xe53c('0x18')])?_0x8d2000[_0xe53c('0x19')]:_0x8d2000['destcalleridnum'];if(_[_0xe53c('0x10')](_0x8d2000[_0xe53c('0x18')])){_0x37d554['firstName']=_0x8d2000[_0xe53c('0x2e')]&&_0x8d2000['calleridname']!==_0xe53c('0x2f')?_0x8d2000[_0xe53c('0x2e')]:_0xe53c('0x30');}else{_0x37d554[_0xe53c('0x1b')]=_0x8d2000['destcalleridname']&&_0x8d2000[_0xe53c('0x31')]!==''?_0x8d2000[_0xe53c('0x31')]:_0xe53c('0x30');}return BPromise[_0xe53c('0x22')]()['then'](cmContactRpc[_0xe53c('0x32')](_0x37d554))[_0xe53c('0x23')](function(_0x1da349){_0x4cc417=_0x1da349;_0x1fd9ca[_0xe53c('0x33')](_0x1da349);if(_0x4cc417){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x8d2000['uniqueid'],_0x1bb36e['id'],_0x4cc417['id']);}return;});}else{logger[_0xe53c('0xb')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x8d2000['uniqueid'],_0x1bb36e['id']);_0x37d554[_0xfc85b2]=_[_0xe53c('0x10')](_0x8d2000[_0xe53c('0x18')])?_0x8d2000[_0xe53c('0x19')]:_0x8d2000['destcalleridnum'];if(_['isNil'](_0x8d2000['routeId'])){_0x37d554['firstName']=_0x8d2000[_0xe53c('0x2e')]&&_0x8d2000[_0xe53c('0x2e')]!==_0xe53c('0x2f')?_0x8d2000[_0xe53c('0x2e')]:_0xe53c('0x30');}else{_0x37d554[_0xe53c('0x1b')]=_0x8d2000[_0xe53c('0x31')]&&_0x8d2000['destcalleridname']!==''?_0x8d2000[_0xe53c('0x31')]:'Unknown';}_0x4cc417=_0x37d554;_0x1fd9ca[_0xe53c('0x33')](_0x37d554);return;}}})[_0xe53c('0x23')](function(){if(_0x53f68c){emit(_0x8d2000['uniqueid'],_0x1bb36e,util[_0xe53c('0x34')](_0xe53c('0x35'),_0x53f68c[_0xe53c('0x36')]),util[_0xe53c('0x34')]('trigger:%s',_0x39573f[_0xe53c('0x37')][_0xe53c('0x38')]()),{'evt':_['merge'](_0x8d2000,{'autoCreate':_0x16ebdd}),'contact':_0x4cc417===undefined?{}:_0x4cc417,'contacts':_0x1fd9ca[_0xe53c('0x26')]===0x0?undefined:_0x1fd9ca});}});}; \ No newline at end of file +var _0xabc8=['data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','trigger:%s','action','toLowerCase','lodash','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','data3','split','phone','map','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','ListId','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x5dafbf,_0x217b99){var _0x158a49=function(_0x3abfa3){while(--_0x3abfa3){_0x5dafbf['push'](_0x5dafbf['shift']());}};_0x158a49(++_0x217b99);}(_0xabc8,0x7a));var _0x8abc=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xabc8[_0x10004e];return _0x5af990;};'use strict';var _=require(_0x8abc('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x8abc('0x1'));var config=require(_0x8abc('0x2'));var logger=require(_0x8abc('0x3'))(_0x8abc('0x4'));var cmContactRpc=require(_0x8abc('0x5'));config['redis']=_[_0x8abc('0x6')](config[_0x8abc('0x7')],{'host':_0x8abc('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x36cb5c,_0x314245,_0x3eeea9,_0x42b1f2,_0x30fb10){logger[_0x8abc('0x9')](_0x8abc('0xa'),_0x36cb5c,_0x314245['id'],_0x3eeea9,_0x42b1f2,JSON[_0x8abc('0xb')](_0x30fb10));io['to'](_0x3eeea9)[_0x8abc('0xc')](_0x42b1f2,_0x30fb10);}exports[_0x8abc('0xd')]=function(_0x7c3a8d,_0x4db109,_0x306073,_0xb23a91){var _0x52a0bb,_0x34bdc4;var _0x3f0b82={};var _0x20a0e8;var _0x29b936=Number(_0x306073[_0x8abc('0xe')]);var _0x5cdc9a=_0x306073[_0x8abc('0xf')]?Boolean(Number(_0x306073[_0x8abc('0xf')])):![];var _0x3d719a;var _0x53e5d7=![];if(!_['isNil'](_0x306073['data5'])){if(_0x306073[_0x8abc('0x10')]=='1')_0x53e5d7=!![];}if(!_0x53e5d7){if(_0xb23a91['xmd-contactid']){_0x3f0b82['id']=_0xb23a91['xmd-contactid'];}}if(!_0x3f0b82['id']){_0x3f0b82['ListId']=_0x29b936;_0x3d719a=_0x306073['data3']&&_0x306073[_0x8abc('0x11')]!=='0'?_0x306073[_0x8abc('0x11')][_0x8abc('0x12')](','):[_0x8abc('0x13')];_0x3f0b82['$or']=_[_0x8abc('0x14')](_0x3d719a,function(_0x279bee){var _0x4ea9ae={};_0x4ea9ae[_0x279bee]=_0xb23a91[_0x8abc('0x15')]?_0xb23a91['destcalleridnum']:_0xb23a91[_0x8abc('0x16')];return _0x4ea9ae;});_0x20a0e8=_0xb23a91[_0x8abc('0x15')]?_0xb23a91[_0x8abc('0x17')]:_0xb23a91[_0x8abc('0x16')];}var _0x3f5e5a=['id',_0x8abc('0x18'),'lastName',_0x8abc('0x13'),_0x8abc('0x19'),_0x8abc('0x1a'),_0x8abc('0x1b'),'createdAt',_0x8abc('0x1c'),_0x8abc('0x1d')];var _0x1068de=_[_0x8abc('0x1e')](_0x3f5e5a,_0x3d719a);BPromise[_0x8abc('0x1f')]()[_0x8abc('0x20')](cmContactRpc[_0x8abc('0x21')]({'attributes':_0x1068de,'where':_0x3f0b82,'phone':_0x20a0e8}))[_0x8abc('0x20')](function(_0x49dff3){_0x34bdc4=_0x49dff3;if(!_[_0x8abc('0x22')](_0x34bdc4)){if(_0x34bdc4[_0x8abc('0x23')]===0x1){_0x52a0bb=_0x34bdc4[0x0];logger[_0x8abc('0x9')](_0x8abc('0x24'),_0xb23a91[_0x8abc('0x25')],_0x4db109['id'],_0x52a0bb['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xb23a91['uniqueid'],_0x4db109['id'],_['map'](_0x34bdc4,'id')[_0x8abc('0x26')](','));}return;}else{logger[_0x8abc('0x9')](_0x8abc('0x27'),_0xb23a91[_0x8abc('0x25')],_0x4db109['id']);var _0x5d5811={'ListId':_0x29b936};var _0x4a6b69=_0x306073['data4']&&_0x306073[_0x8abc('0x28')]!=='0'?_0x306073[_0x8abc('0x28')]:_0x8abc('0x13');if(_0x5cdc9a){logger[_0x8abc('0x9')](_0x8abc('0x29'),_0xb23a91['uniqueid'],_0x4db109['id']);_0x5d5811[_0x4a6b69]=_[_0x8abc('0x2a')](_0xb23a91['routeId'])?_0xb23a91['calleridnum']:_0xb23a91[_0x8abc('0x17')];if(_['isNil'](_0xb23a91['routeId'])){_0x5d5811[_0x8abc('0x18')]=_0xb23a91[_0x8abc('0x2b')]&&_0xb23a91[_0x8abc('0x2b')]!==_0x8abc('0x2c')?_0xb23a91['calleridname']:_0x8abc('0x2d');}else{_0x5d5811[_0x8abc('0x18')]=_0xb23a91[_0x8abc('0x2e')]&&_0xb23a91[_0x8abc('0x2e')]!==''?_0xb23a91[_0x8abc('0x2e')]:'Unknown';}return BPromise['resolve']()[_0x8abc('0x20')](cmContactRpc[_0x8abc('0x2f')](_0x5d5811))[_0x8abc('0x20')](function(_0x363a21){_0x52a0bb=_0x363a21;_0x34bdc4[_0x8abc('0x30')](_0x363a21);if(_0x52a0bb){logger['info'](_0x8abc('0x31'),_0xb23a91[_0x8abc('0x25')],_0x4db109['id'],_0x52a0bb['id']);}return;});}else{logger[_0x8abc('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xb23a91['uniqueid'],_0x4db109['id']);_0x5d5811[_0x4a6b69]=_[_0x8abc('0x2a')](_0xb23a91[_0x8abc('0x15')])?_0xb23a91[_0x8abc('0x16')]:_0xb23a91['destcalleridnum'];if(_['isNil'](_0xb23a91[_0x8abc('0x15')])){_0x5d5811[_0x8abc('0x18')]=_0xb23a91['calleridname']&&_0xb23a91[_0x8abc('0x2b')]!==_0x8abc('0x2c')?_0xb23a91['calleridname']:_0x8abc('0x2d');}else{_0x5d5811[_0x8abc('0x18')]=_0xb23a91[_0x8abc('0x2e')]&&_0xb23a91[_0x8abc('0x2e')]!==''?_0xb23a91[_0x8abc('0x2e')]:'Unknown';}_0x52a0bb=_0x5d5811;_0x34bdc4[_0x8abc('0x30')](_0x5d5811);return;}}})['then'](function(){if(_0x7c3a8d){emit(_0xb23a91[_0x8abc('0x25')],_0x4db109,util[_0x8abc('0x32')]('user:%s',_0x7c3a8d['name']),util[_0x8abc('0x32')](_0x8abc('0x33'),_0x306073[_0x8abc('0x34')][_0x8abc('0x35')]()),{'evt':_['merge'](_0xb23a91,{'autoCreate':_0x5cdc9a}),'contact':_0x52a0bb===undefined?{}:_0x52a0bb,'contacts':_0x34bdc4['length']===0x0?undefined:_0x34bdc4});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5f549b0..154ae67 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 _0x4af0=['custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winArguments','data3','trigger:%s:%s','action','jscripty','format','user:%s','name','trigger:%s','exec','integration','routeId','urlforward','parse','query','search','replace','channel','AllConditions','every','some','checkConditions','evt','field','account','chat','ChatWebsiteId','operator','upperFirst','value','message','event','queue','agent','membername','lastevent','null','substatus','offlineMessage','created','exports','url','ioredis','./cmContact','../../../config/environment','../../../config/logger','trigger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial'];(function(_0x5b26d4,_0x572bc8){var _0x56e498=function(_0x1080c3){while(--_0x1080c3){_0x5b26d4['push'](_0x5b26d4['shift']());}};_0x56e498(++_0x572bc8);}(_0x4af0,0x15b));var _0x04af=function(_0x473ed3,_0x36b961){_0x473ed3=_0x473ed3-0x0;var _0x597269=_0x4af0[_0x473ed3];return _0x597269;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x04af('0x0'));var Mustache=require('mustache');var Redis=require(_0x04af('0x1'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x04af('0x2'));var script=require('./script');var config=require(_0x04af('0x3'));var logger=require(_0x04af('0x4'))(_0x04af('0x5'));var ami=require('../ami');config[_0x04af('0x6')]=_[_0x04af('0x7')](config[_0x04af('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x04af('0x8'))(new Redis(config[_0x04af('0x6')]));var operators={'equals':function(_0xe7c88f,_0x1342a4){return _0xe7c88f==_0x1342a4;},'not_equals':function(_0x2bad5f,_0x33ea75){return _0x2bad5f!=_0x33ea75;}};var barAndWebActions=[_0x04af('0x9'),_0x04af('0x0'),_0x04af('0xa')];function Trigger(_0x387dcf){this['triggers']=_0x387dcf[_0x04af('0xb')];this[_0x04af('0xc')]=_0x387dcf[_0x04af('0xc')];this[_0x04af('0xd')]=_0x387dcf[_0x04af('0xd')];this[_0x04af('0xe')]=_0x387dcf[_0x04af('0xe')];this['voiceExtensions']=_0x387dcf['voiceExtensions'];this[_0x04af('0xf')]=_0x387dcf[_0x04af('0xf')];this[_0x04af('0x10')]=_0x387dcf[_0x04af('0x10')];this[_0x04af('0x11')]=_0x387dcf['salesforceAccounts'];this[_0x04af('0x12')]=_0x387dcf[_0x04af('0x12')];this[_0x04af('0x13')]=_0x387dcf[_0x04af('0x13')];this[_0x04af('0x14')]=_0x387dcf[_0x04af('0x14')];this[_0x04af('0x15')]=_0x387dcf[_0x04af('0x15')];this['servicenowAccounts']=_0x387dcf[_0x04af('0x16')];this['dynamics365Accounts']=_0x387dcf[_0x04af('0x17')];this[_0x04af('0x18')]=_0x387dcf[_0x04af('0x18')];this[_0x04af('0x19')]={'zendesk':this[_0x04af('0xf')],'salesforce':this[_0x04af('0x11')],'freshdesk':this[_0x04af('0x10')],'sugarcrm':this[_0x04af('0x12')],'zoho':this[_0x04af('0x13')],'desk':this['deskAccounts'],'vtiger':this[_0x04af('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x04af('0x18')],'servicenow':this[_0x04af('0x16')]};ami['on'](_0x04af('0x1a'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on']('custom:agentconnect',this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x1d'),this[_0x04af('0x1b')]['bind'](this));ami['on'](_0x04af('0x1e'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x1f'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x20'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x21'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x22'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on']('custom:agentreject',this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x23'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x24'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x25'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x26'),this[_0x04af('0x27')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x28'),this[_0x04af('0x27')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x29'),this[_0x04af('0x27')]['bind'](this));ami['on'](_0x04af('0x2a'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x2b'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x2c'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x2d'),this[_0x04af('0x1b')]['bind'](this));ami['on'](_0x04af('0x2e'),this['syncCustomEvent'][_0x04af('0x1c')](this));ami['on'](_0x04af('0x2f'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x30'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));ami['on'](_0x04af('0x31'),this[_0x04af('0x1b')][_0x04af('0x1c')](this));}Trigger['prototype'][_0x04af('0x32')]=function(_0xee1e0b,_0x2f25e2,_0x5ab627){logger[_0x04af('0x33')](_0xee1e0b,_0x2f25e2,JSON[_0x04af('0x34')](_0x5ab627));io['to'](_0xee1e0b)[_0x04af('0x32')](_0x2f25e2,_0x5ab627);};Trigger[_0x04af('0x35')]['syncCustomEvent']=function(_0x1867f5){var _0xe76491=_[_0x04af('0x36')](_0x1867f5);if(typeof _0xe76491[_0x04af('0x37')]===_0x04af('0x38')){_0xe76491['motionChannel']=_0x04af('0x39');}logger[_0x04af('0x3a')](_0x04af('0x1b'),util[_0x04af('0x3b')](_0xe76491,{'showHidden':!![],'depth':null}));this[_0x04af('0x3c')](_0xe76491);};Trigger['prototype'][_0x04af('0x27')]=function(_0x33b521){if(this[_0x04af('0xc')][_0x33b521[_0x04af('0x3d')]]){this[_0x04af('0x1b')](_0x33b521);}};Trigger[_0x04af('0x35')][_0x04af('0x3c')]=function(_0x3bdae8){var _0x30ab43;for(var _0xba42f8 in this[_0x04af('0xb')]){if(this['triggers']['hasOwnProperty'](_0xba42f8)){if(this[_0x04af('0xb')][_0xba42f8][_0x04af('0x3e')]){_0x30ab43=this[_0x04af('0x3f')](this[_0x04af('0xb')][_0xba42f8],_0x3bdae8);if(_0x30ab43){_[_0x04af('0x40')](_0x3bdae8,_0x3bdae8[_0x04af('0x41')]);for(var _0x568c21=0x0,_0x2b3b3c,_0x3fe70b,_0x4b7e61;_0x568c210x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x11969a,_0x36532f){var _0x30c243=function(_0x518195){while(--_0x518195){_0x11969a['push'](_0x11969a['shift']());}};_0x30c243(++_0x36532f);}(_0x3e74,0x175));var _0x43e7=function(_0xd5892c,_0x4abe7c){_0xd5892c=_0xd5892c-0x0;var _0x266bc7=_0x3e74[_0xd5892c];return _0x266bc7;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ 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 8e43bb3..721dc50 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 _0x997a=[']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','data5','POST','clientId','username','access_token','catch','error',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','odata-entityid','substring','lastIndexOf','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27',']\x20Enduser\x20created!','enduserId','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:'];(function(_0x47e7ae,_0x3c357b){var _0xb7c680=function(_0x4b2e09){while(--_0x4b2e09){_0x47e7ae['push'](_0x47e7ae['shift']());}};_0xb7c680(++_0x3c357b);}(_0x997a,0x78));var _0xa997=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x997a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa997('0x0'));var rp=require('request-promise');var util=require(_0xa997('0x1'));var intUtil=require(_0xa997('0x2'));var md5=require(_0xa997('0x3'));var Redis=require(_0xa997('0x4'));var logger=require('../../../../config/logger')(_0xa997('0x5'));var config=require('../../../../config/environment');config[_0xa997('0x6')]=_['defaults'](config[_0xa997('0x6')],{'host':_0xa997('0x7'),'port':0x18eb});var io=require(_0xa997('0x8'))(new Redis(config['redis']));function getAuthToken(_0x5ac87c,_0x17f175,_0x27d253){if(_0x5ac87c[_0xa997('0x9')]){_0x5ac87c[_0xa997('0xa')]=_0x5ac87c[_0xa997('0xb')][_0xa997('0xc')];_0x5ac87c[_0xa997('0xd')]=_0x5ac87c[_0xa997('0xb')][_0xa997('0xe')];return Promise['resolve'](_0x5ac87c['CloudProvider'][_0xa997('0xf')]);}var _0x4a6072={'method':_0xa997('0x10'),'uri':_0x17f175,'form':{'client_id':_0x5ac87c[_0xa997('0x11')],'resource':_0x5ac87c[_0xa997('0xa')],'username':_0x5ac87c[_0xa997('0x12')],'password':_0x5ac87c['password'],'grant_type':'password','client_secret':_0x5ac87c['clientSecret']},'json':!![]};return rp(_0x4a6072)['then'](function(_0x374a3a){return _0x374a3a[_0xa997('0x13')];})[_0xa997('0x14')](function(_0x6ec0e3){logger[_0xa997('0x15')]('['+[_0x27d253['toUpperCase']()]+_0xa997('0x16'));return _0x6ec0e3[_0xa997('0x17')];});}function getUser(_0x3e8d11,_0x8eef38,_0x17af7a,_0x4fbf75,_0x648f9f,_0x171c04){return new Promise(function(_0x183017,_0x370652){return getAuthToken(_0x8eef38,_0x4fbf75,_0x171c04)[_0xa997('0x18')](function(_0x5b4fb5){var _0x478c05={'method':'GET','uri':_0x648f9f+_0xa997('0x19'),'headers':{'Authorization':_0xa997('0x1a')+_0x5b4fb5,'OData-Version':_0xa997('0x1b')},'json':!![]};return rp(_0x478c05);})[_0xa997('0x18')](function(_0x20c142){var _0x43235e=_0x20c142[_0xa997('0x1c')];var _0x3326ca=![];var _0x6e3199=null;if(!_['isNil'](_0x17af7a)){if(intUtil[_0xa997('0x1d')](_0x17af7a[_0xa997('0x1e')])){_0x3e8d11[_0xa997('0x1f')]=_0x17af7a['email'];for(_0x6e3199=0x0;_0x6e3199<_0x43235e['length'];_0x6e3199++){if(_0x43235e[_0x6e3199][_0xa997('0x20')]===_0x17af7a['email']&&!_0x43235e[_0x6e3199]['isdisabled']){_0x3326ca=!![];logger[_0xa997('0x21')]('['+[_0x171c04[_0xa997('0x22')]()]+_0xa997('0x23')+_0x43235e[_0x6e3199][_0xa997('0x24')]+'!');_0x3e8d11[_0xa997('0x25')]=_0x43235e[_0x6e3199][_0xa997('0x24')];}}}}if(!_0x3326ca){logger[_0xa997('0x21')]('['+[_0x171c04[_0xa997('0x22')]()]+_0xa997('0x26'));_0x3e8d11[_0xa997('0x1f')]=_0x8eef38[_0xa997('0x12')];for(_0x6e3199=0x0;_0x6e3199<_0x43235e[_0xa997('0x27')];_0x6e3199++){if(_0x43235e[_0x6e3199]['internalemailaddress']===_0x8eef38['username']){_0x3e8d11[_0xa997('0x25')]=_0x43235e[_0x6e3199][_0xa997('0x24')];}}}_0x183017(_0x3e8d11);})[_0xa997('0x14')](function(_0x5e85a9){_0x370652(_0x5e85a9[_0xa997('0x17')]);});});}function createEndUser(_0x3c078c,_0x1c10d2,_0x4da4e6,_0x365b1a,_0x110cb1,_0x1a3069,_0x2ec31d){return new Promise(function(_0x22ce09,_0x47961a){return getAuthToken(_0x1c10d2,_0x4da4e6,_0x1a3069)[_0xa997('0x18')](function(_0x3cadcb){var _0x575889=_0x1a3069[_0xa997('0x28')]()===_0xa997('0x29')?_0x110cb1[_0xa997('0x2a')]:_0x110cb1[_0xa997('0x2b')];var _0xa51709={'method':_0xa997('0x10'),'uri':_0x365b1a+_0xa997('0x2c'),'body':{'fullname':_0x575889,'firstname':_0x575889,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3c078c[_0xa997('0x25')]+')'},'headers':{'Authorization':_0xa997('0x1a')+_0x3cadcb,'OData-Version':_0xa997('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0xa51709[_0xa997('0x2d')][_0x2ec31d]=_0x575889;return rp(_0xa51709);})[_0xa997('0x18')](function(_0x4feb00){var _0x1f715f=_0x4feb00[_0xa997('0x2e')][_0xa997('0x2f')];var _0x6bcc68=_0x1f715f[_0xa997('0x30')](_0x1f715f[_0xa997('0x31')]('(')+0x1,_0x1f715f[_0xa997('0x31')](')'));_0x3c078c['enduserId']=_0x6bcc68;_0x22ce09(_0x3c078c);})[_0xa997('0x14')](function(_0x464bc9){_0x47961a(_0x464bc9[_0xa997('0x17')]);});});}function getEndUser(_0x2ff0e4,_0x4ec78e,_0x30ee89,_0x278ce4,_0x27b7e4,_0x60c2ec,_0x1d38d6,_0x361e36){var _0x23cdce=_0x60c2ec[_0xa997('0x28')]()===_0xa997('0x29')?_0x27b7e4[_0xa997('0x2a')]:_0x27b7e4[_0xa997('0x2b')];return getAuthToken(_0x4ec78e,_0x30ee89,_0x60c2ec)[_0xa997('0x18')](function(_0x5e73bb){_0x361e36=_0x361e36?_0x361e36:_0xa997('0x32');var _0x3a93cd={'method':_0xa997('0x33'),'uri':_0x278ce4+_0xa997('0x34')+_0x361e36+_0xa997('0x35')+_0x361e36+_0xa997('0x36')+_0x23cdce['replace']('+','%2b')+'\x27','headers':{'Authorization':_0xa997('0x1a')+_0x5e73bb,'If-None-Match':null,'OData-Version':_0xa997('0x1b')},'json':!![]};return rp(_0x3a93cd);})['then'](function(_0x35ff7e){var _0x184ad6=![];if(!_0x35ff7e)return _0x184ad6;var _0x144961=_0x35ff7e[_0xa997('0x1c')];for(var _0xa61637=0x0;_0xa61637<_0x144961[_0xa997('0x27')];_0xa61637++){if(_0x144961[_0xa61637][_0x361e36]===_0x23cdce){_0x184ad6=!![];_0x2ff0e4['enduserId']=_0x144961[_0xa61637]['contactid'];}}return _0x184ad6;})[_0xa997('0x18')](function(_0x41435a){if(_0x41435a)return _0x2ff0e4;if(_0x1d38d6==='nothing'){logger[_0xa997('0x21')]('['+[_0x60c2ec[_0xa997('0x22')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x2ff0e4;}return createEndUser(_0x2ff0e4,_0x4ec78e,_0x30ee89,_0x278ce4,_0x27b7e4,_0x60c2ec,_0x361e36)[_0xa997('0x18')](function(_0x5902ec){logger['info']('['+[_0x60c2ec[_0xa997('0x22')]()]+_0xa997('0x37'),_0x5902ec[_0xa997('0x38')]);return _0x5902ec;});});}function getCustomFields(_0x28ccaa,_0xb19ad6,_0x3c8993){var _0x1d8b5e={};if(_0x28ccaa['length']>0x0){_[_0xa997('0x39')](_0x28ccaa,function(_0x493f81){if(_[_0xa997('0x3a')]([_0xa997('0x3b'),_0xa997('0x3c')],_0x493f81[_0xa997('0x3d')])&&_0x493f81[_0xa997('0x3e')]&&!_0x493f81[_0xa997('0x3f')]){var _0x55fbb0=_0x493f81[_0xa997('0x40')]['toLowerCase']();var _0x241622=_0x55fbb0[_0xa997('0x30')](0x0,_0x55fbb0['indexOf']('_'));var _0x15da7a=_0x55fbb0[_0xa997('0x30')](_0x55fbb0[_0xa997('0x41')]('_')+0x1);if(_0x241622===_0x3c8993){_0x1d8b5e[_0x15da7a]=_0x493f81[_0xa997('0x42')];}}});}return _0x1d8b5e;}function getTicket(_0x1f3d1d,_0x1e3c58,_0x464b18,_0x4b9545,_0x494b46,_0x4718f9,_0x16e71c){return new Promise(function(_0x236ffa,_0x14069b){var _0x1e4638;return getAuthToken(_0x1e3c58,_0x464b18,_0x16e71c)[_0xa997('0x18')](function(_0x1f69c3){if(_0x4718f9['ticketType']===_0xa997('0x43')){_0x1e4638={'method':_0xa997('0x10'),'uri':_0x4b9545+_0xa997('0x44'),'body':Object[_0xa997('0x45')]({},{'title':intUtil[_0xa997('0x46')](_0x4718f9[_0xa997('0x47')],_0x494b46,'\x20'),'description':intUtil['getString'](_0x4718f9[_0xa997('0x48')],_0x494b46,'\x0a'),'customerid_contact@odata.bind':_0x1f3d1d[_0xa997('0x38')]?_0xa997('0x49')+_0x1f3d1d['enduserId']+')':undefined,'ownerid@odata.bind':_0xa997('0x4a')+_0x1f3d1d[_0xa997('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x4718f9[_0xa997('0x4b')],_0x494b46,_0x4718f9[_0xa997('0x4c')])),'headers':{'Authorization':_0xa997('0x1a')+_0x1f69c3,'OData-Version':_0xa997('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4718f9[_0xa997('0x4c')]===_0xa997('0x4d')){var _0x1cb263=_0x1f3d1d[_0xa997('0x38')]?[{'partyid_systemuser@odata.bind':_0xa997('0x4a')+_0x1f3d1d[_0xa997('0x25')]+')','participationtypemask':_0x1f3d1d[_0xa997('0x4e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xa997('0x49')+_0x1f3d1d[_0xa997('0x38')]+')','participationtypemask':_0x1f3d1d[_0xa997('0x4e')]===_0xa997('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xa997('0x4a')+_0x1f3d1d[_0xa997('0x25')]+')','participationtypemask':_0x1f3d1d[_0xa997('0x4e')]===_0xa997('0x4f')?0x2:0x1}];_0x1e4638={'method':_0xa997('0x10'),'uri':_0x4b9545+_0xa997('0x50'),'body':Object['assign']({},{'subject':intUtil[_0xa997('0x46')](_0x4718f9[_0xa997('0x47')],_0x494b46,'\x20'),'phonenumber':String(_0x494b46[_0xa997('0x2b')]),'description':intUtil['getString'](_0x4718f9[_0xa997('0x48')],_0x494b46,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1f3d1d[_0xa997('0x38')]?'/contacts('+_0x1f3d1d[_0xa997('0x38')]+')':undefined,'ownerid@odata.bind':_0xa997('0x4a')+_0x1f3d1d[_0xa997('0x25')]+')','directioncode':_0x1f3d1d[_0xa997('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1cb263},getCustomFields(_0x4718f9[_0xa997('0x4b')],_0x494b46,_0x4718f9[_0xa997('0x4c')])),'headers':{'Authorization':_0xa997('0x1a')+_0x1f69c3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1e4638);})[_0xa997('0x18')](function(_0x3b4e3b){var _0x249f87=_0x3b4e3b[_0xa997('0x2e')][_0xa997('0x2f')];var _0x1bb173=_0x249f87[_0xa997('0x30')](_0x249f87[_0xa997('0x31')]('(')+0x1,_0x249f87[_0xa997('0x31')](')'));_0x1f3d1d['ticketId']=_0x1bb173;_0x236ffa(_0x1f3d1d);})[_0xa997('0x14')](function(_0x366a0a){_0x14069b(_0x366a0a[_0xa997('0x17')]);});});}function emit(_0x59fa7d,_0x567885,_0xe375c0,_0x952945){var _0x1fc7c9={'uri':util[_0xa997('0x51')](_0xa997('0x52'),_0x59fa7d,_0xe375c0,_0x952945)};io['to'](util[_0xa997('0x51')](_0xa997('0x53'),_0x567885))[_0xa997('0x54')](_0xa997('0x55'),_0x1fc7c9);}exports['cs']=function(_0x262acd,_0x5918d5,_0x2710e6,_0x68f9e,_0x5535a5,_0x276ecc,_0x2508bd,_0x5cf015){var _0x50d15c={};_0x276ecc[_0xa997('0xa')]=_0x276ecc[_0xa997('0x9')]?intUtil[_0xa997('0x56')](_0x276ecc['CloudProvider'][_0xa997('0xc')]):intUtil[_0xa997('0x56')](_0x276ecc[_0xa997('0xa')]);_0x276ecc[_0xa997('0x57')]=intUtil['stripTrailingSlash'](_0x276ecc['serverUrl']);_0x50d15c[_0xa997('0x4e')]=_0x5cf015==='queue'||_0x5cf015===_0xa997('0x58')?'queue':_0xa997('0x29');var _0x1d21ba=_0x276ecc[_0xa997('0x9')]?util[_0xa997('0x51')](_0xa997('0x59'),_0x276ecc[_0xa997('0xb')][_0xa997('0xc')]):util['format']('%s/api/data/v9.0/',_0x276ecc[_0xa997('0xa')]);var _0x413425=util[_0xa997('0x51')](_0xa997('0x5a'),_0x276ecc['tenantId']);var _0x26bc8d=util[_0xa997('0x51')](_0xa997('0x5b'),_0x276ecc[_0xa997('0x57')],_0x5918d5[_0xa997('0x5c')],md5(_0x5918d5[_0xa997('0x5c')]));if(_0x5535a5&&_0x5535a5['monitor_format']){logger[_0xa997('0x21')](_0xa997('0x5d'),_0xa997('0x5e'));_0x5918d5['recordingURL']=_0x26bc8d;}else if(_0x2508bd&&_0x2508bd[_0xa997('0x5f')]&&_0x2508bd[_0xa997('0x5f')]!==_0xa997('0x60')){logger[_0xa997('0x21')](_0xa997('0x61'),_0xa997('0x5e'));_0x5918d5['recordingURL']=_0x26bc8d;}else{_0x5918d5[_0xa997('0x62')]='';}return getUser(_0x50d15c,_0x276ecc,_0x68f9e,_0x413425,_0x1d21ba,_0x5cf015)[_0xa997('0x18')](function(_0x553d73){logger[_0xa997('0x21')]('['+_0x5cf015[_0xa997('0x22')]()+_0xa997('0x63'),_0x553d73[_0xa997('0x25')]);logger[_0xa997('0x21')]('['+_0x5cf015['toUpperCase']()+_0xa997('0x64'),_0x553d73[_0xa997('0x1f')]);return getEndUser(_0x553d73,_0x276ecc,_0x413425,_0x1d21ba,_0x5918d5,_0x5cf015,_0x2710e6[_0xa997('0x65')],_0x2710e6[_0xa997('0x66')]);})['then'](function(_0x31d1e4){logger[_0xa997('0x21')]('['+_0x5cf015[_0xa997('0x22')]()+_0xa997('0x67'),_0x31d1e4[_0xa997('0x38')]);logger[_0xa997('0x21')]('['+_0x5cf015[_0xa997('0x22')]()+_0xa997('0x68'),_0x5918d5['calleridnum']);return getTicket(_0x31d1e4,_0x276ecc,_0x413425,_0x1d21ba,_0x5918d5,_0x2710e6,_0x5cf015);})['then'](function(_0x1999c8){logger[_0xa997('0x21')](util['format']('['+_0x5cf015[_0xa997('0x22')]()+_0xa997('0x69'),_0x2710e6[_0xa997('0x4c')],_0x1999c8['ticketId']));logger[_0xa997('0x21')](util['format']('['+_0x5cf015[_0xa997('0x22')]()+']\x20Call\x20direction:\x20%s',_0x5cf015));if(_0x5cf015!==_0xa997('0x58')&&_0x2710e6[_0xa997('0x6a')]){logger['info']('['+_0x5cf015[_0xa997('0x22')]()+']',_0xa997('0x6b'));emit(_0x276ecc[_0xa997('0xa')],_0x68f9e[_0xa997('0x6c')],_0x2710e6[_0xa997('0x4c')],_0x1999c8[_0xa997('0x6d')]);}})[_0xa997('0x14')](function(_0x3074ce){logger[_0xa997('0x15')]('['+_0x5cf015['toUpperCase']()+_0xa997('0x6e'),_0x3074ce[_0xa997('0x17')]);console['error'](_0xa997('0x6f'),_0x3074ce);});}; \ No newline at end of file +var _0xcc48=['ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','defaults','redis','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','data5','clientId','username','password','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','body','odata-entityid','substring','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','length','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','Subjects','getString','Descriptions','phonecall','queue','/contacts(','callDirection','phonecalls','Fields','headers','lastIndexOf'];(function(_0x191fde,_0x3fb6e8){var _0x3b2a6b=function(_0x140ae0){while(--_0x140ae0){_0x191fde['push'](_0x191fde['shift']());}};_0x3b2a6b(++_0x3fb6e8);}(_0xcc48,0x89));var _0x8cc4=function(_0x37306a,_0x435902){_0x37306a=_0x37306a-0x0;var _0x552039=_0xcc48[_0x37306a];return _0x552039;};'use strict';var _=require(_0x8cc4('0x0'));var rp=require(_0x8cc4('0x1'));var util=require(_0x8cc4('0x2'));var intUtil=require(_0x8cc4('0x3'));var md5=require(_0x8cc4('0x4'));var Redis=require(_0x8cc4('0x5'));var logger=require(_0x8cc4('0x6'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_[_0x8cc4('0x7')](config[_0x8cc4('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x8cc4('0x9'))(new Redis(config[_0x8cc4('0x8')]));function getAuthToken(_0x4a9f41,_0x41e953,_0x9675d){if(_0x4a9f41[_0x8cc4('0xa')]){_0x4a9f41[_0x8cc4('0xb')]=_0x4a9f41['CloudProvider'][_0x8cc4('0xc')];_0x4a9f41[_0x8cc4('0xd')]=_0x4a9f41[_0x8cc4('0xe')]['data2'];return Promise['resolve'](_0x4a9f41[_0x8cc4('0xe')][_0x8cc4('0xf')]);}var _0x4d1e9d={'method':'POST','uri':_0x41e953,'form':{'client_id':_0x4a9f41[_0x8cc4('0x10')],'resource':_0x4a9f41[_0x8cc4('0xb')],'username':_0x4a9f41[_0x8cc4('0x11')],'password':_0x4a9f41['password'],'grant_type':_0x8cc4('0x12'),'client_secret':_0x4a9f41['clientSecret']},'json':!![]};return rp(_0x4d1e9d)[_0x8cc4('0x13')](function(_0x4672a5){return _0x4672a5['access_token'];})[_0x8cc4('0x14')](function(_0x4f218b){logger[_0x8cc4('0x15')]('['+[_0x9675d[_0x8cc4('0x16')]()]+_0x8cc4('0x17'));return _0x4f218b[_0x8cc4('0x18')];});}function getUser(_0x12178c,_0x49cc3a,_0x34a00e,_0x347d47,_0x2ee0a7,_0x313733){return new Promise(function(_0x4a95bb,_0x3e447e){return getAuthToken(_0x49cc3a,_0x347d47,_0x313733)['then'](function(_0x35a04d){var _0x3b6f07={'method':_0x8cc4('0x19'),'uri':_0x2ee0a7+_0x8cc4('0x1a'),'headers':{'Authorization':_0x8cc4('0x1b')+_0x35a04d,'OData-Version':_0x8cc4('0x1c')},'json':!![]};return rp(_0x3b6f07);})[_0x8cc4('0x13')](function(_0x786471){var _0x3d7f40=_0x786471[_0x8cc4('0x1d')];var _0x5e2902=![];var _0x27bc1d=null;if(!_[_0x8cc4('0x1e')](_0x34a00e)){if(intUtil[_0x8cc4('0x1f')](_0x34a00e[_0x8cc4('0x20')])){_0x12178c[_0x8cc4('0x21')]=_0x34a00e[_0x8cc4('0x20')];for(_0x27bc1d=0x0;_0x27bc1d<_0x3d7f40['length'];_0x27bc1d++){if(_0x3d7f40[_0x27bc1d][_0x8cc4('0x22')]===_0x34a00e[_0x8cc4('0x20')]&&!_0x3d7f40[_0x27bc1d][_0x8cc4('0x23')]){_0x5e2902=!![];logger[_0x8cc4('0x24')]('['+[_0x313733['toUpperCase']()]+_0x8cc4('0x25')+_0x3d7f40[_0x27bc1d][_0x8cc4('0x26')]+'!');_0x12178c['userId']=_0x3d7f40[_0x27bc1d][_0x8cc4('0x26')];}}}}if(!_0x5e2902){logger[_0x8cc4('0x24')]('['+[_0x313733[_0x8cc4('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x12178c['userEmail']=_0x49cc3a[_0x8cc4('0x11')];for(_0x27bc1d=0x0;_0x27bc1d<_0x3d7f40['length'];_0x27bc1d++){if(_0x3d7f40[_0x27bc1d][_0x8cc4('0x22')]===_0x49cc3a[_0x8cc4('0x11')]){_0x12178c[_0x8cc4('0x27')]=_0x3d7f40[_0x27bc1d][_0x8cc4('0x26')];}}}_0x4a95bb(_0x12178c);})['catch'](function(_0x41df5f){_0x3e447e(_0x41df5f[_0x8cc4('0x18')]);});});}function createEndUser(_0x20ee6f,_0x371b3a,_0x563b10,_0x362ecc,_0x5bbbfa,_0x1d81cc,_0x5767a3){return new Promise(function(_0xe74fa1,_0x50b03b){return getAuthToken(_0x371b3a,_0x563b10,_0x1d81cc)[_0x8cc4('0x13')](function(_0x9c68da){var _0x33b81b=_0x1d81cc[_0x8cc4('0x28')]()===_0x8cc4('0x29')?_0x5bbbfa[_0x8cc4('0x2a')]:_0x5bbbfa[_0x8cc4('0x2b')];var _0x35850d={'method':_0x8cc4('0x2c'),'uri':_0x362ecc+_0x8cc4('0x2d'),'body':{'fullname':_0x33b81b,'firstname':_0x33b81b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8cc4('0x2e')+_0x20ee6f[_0x8cc4('0x27')]+')'},'headers':{'Authorization':_0x8cc4('0x1b')+_0x9c68da,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x35850d[_0x8cc4('0x2f')][_0x5767a3]=_0x33b81b;return rp(_0x35850d);})['then'](function(_0x23d0c7){var _0x45c41b=_0x23d0c7['headers'][_0x8cc4('0x30')];var _0x4df812=_0x45c41b[_0x8cc4('0x31')](_0x45c41b['lastIndexOf']('(')+0x1,_0x45c41b['lastIndexOf'](')'));_0x20ee6f[_0x8cc4('0x32')]=_0x4df812;_0xe74fa1(_0x20ee6f);})[_0x8cc4('0x14')](function(_0x10725d){_0x50b03b(_0x10725d[_0x8cc4('0x18')]);});});}function getEndUser(_0x3fb1af,_0x1bfd8e,_0x284d1d,_0x33f581,_0x4fd99e,_0x1ac69d,_0x552992,_0x54cfc4){var _0x36f9b3=_0x1ac69d[_0x8cc4('0x28')]()==='outbound'?_0x4fd99e[_0x8cc4('0x2a')]:_0x4fd99e[_0x8cc4('0x2b')];return getAuthToken(_0x1bfd8e,_0x284d1d,_0x1ac69d)['then'](function(_0x58e9d7){_0x54cfc4=_0x54cfc4?_0x54cfc4:_0x8cc4('0x33');var _0x7b8544={'method':'GET','uri':_0x33f581+_0x8cc4('0x34')+_0x54cfc4+_0x8cc4('0x35')+_0x54cfc4+'\x20eq\x20\x27'+_0x36f9b3[_0x8cc4('0x36')]('+',_0x8cc4('0x37'))+'\x27','headers':{'Authorization':_0x8cc4('0x1b')+_0x58e9d7,'If-None-Match':null,'OData-Version':_0x8cc4('0x1c')},'json':!![]};return rp(_0x7b8544);})['then'](function(_0x79ea99){var _0x4f4cde=![];if(!_0x79ea99)return _0x4f4cde;var _0x2535ec=_0x79ea99[_0x8cc4('0x1d')];for(var _0x14aae1=0x0;_0x14aae1<_0x2535ec['length'];_0x14aae1++){if(_0x2535ec[_0x14aae1][_0x54cfc4]===_0x36f9b3){_0x4f4cde=!![];_0x3fb1af['enduserId']=_0x2535ec[_0x14aae1]['contactid'];}}return _0x4f4cde;})['then'](function(_0x464249){if(_0x464249)return _0x3fb1af;if(_0x552992===_0x8cc4('0x38')){logger['info']('['+[_0x1ac69d['toUpperCase']()]+_0x8cc4('0x39'));return _0x3fb1af;}return createEndUser(_0x3fb1af,_0x1bfd8e,_0x284d1d,_0x33f581,_0x4fd99e,_0x1ac69d,_0x54cfc4)['then'](function(_0x10650f){logger[_0x8cc4('0x24')]('['+[_0x1ac69d['toUpperCase']()]+_0x8cc4('0x3a'),_0x10650f['enduserId']);return _0x10650f;});});}function getCustomFields(_0x22a093,_0x1bb852,_0x21baf8){var _0x12b12e={};if(_0x22a093[_0x8cc4('0x3b')]>0x0){_[_0x8cc4('0x3c')](_0x22a093,function(_0x5529a5){if(_[_0x8cc4('0x3d')](['string',_0x8cc4('0x3e')],_0x5529a5[_0x8cc4('0x3f')])&&_0x5529a5[_0x8cc4('0x40')]&&!_0x5529a5[_0x8cc4('0x41')]){var _0x4f8a76=_0x5529a5[_0x8cc4('0x42')]['toLowerCase']();var _0x319883=_0x4f8a76[_0x8cc4('0x31')](0x0,_0x4f8a76[_0x8cc4('0x43')]('_'));var _0x170823=_0x4f8a76[_0x8cc4('0x31')](_0x4f8a76['indexOf']('_')+0x1);if(_0x319883===_0x21baf8){_0x12b12e[_0x170823]=_0x5529a5[_0x8cc4('0x44')];}}});}return _0x12b12e;}function getTicket(_0x20dd0d,_0x50f276,_0x48684b,_0x14b9a3,_0x436d53,_0x1ada2b,_0xb1761a){return new Promise(function(_0x3eda7b,_0x3f8aa1){var _0x261d10;return getAuthToken(_0x50f276,_0x48684b,_0xb1761a)[_0x8cc4('0x13')](function(_0x2a830e){if(_0x1ada2b[_0x8cc4('0x45')]==='incident'){_0x261d10={'method':_0x8cc4('0x2c'),'uri':_0x14b9a3+_0x8cc4('0x46'),'body':Object[_0x8cc4('0x47')]({},{'title':intUtil['getString'](_0x1ada2b[_0x8cc4('0x48')],_0x436d53,'\x20'),'description':intUtil[_0x8cc4('0x49')](_0x1ada2b[_0x8cc4('0x4a')],_0x436d53,'\x0a'),'customerid_contact@odata.bind':_0x20dd0d['enduserId']?'/contacts('+_0x20dd0d[_0x8cc4('0x32')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x20dd0d[_0x8cc4('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x1ada2b['Fields'],_0x436d53,_0x1ada2b['ticketType'])),'headers':{'Authorization':_0x8cc4('0x1b')+_0x2a830e,'OData-Version':_0x8cc4('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1ada2b[_0x8cc4('0x45')]===_0x8cc4('0x4b')){var _0x1574a1=_0x20dd0d[_0x8cc4('0x32')]?[{'partyid_systemuser@odata.bind':_0x8cc4('0x2e')+_0x20dd0d['userId']+')','participationtypemask':_0x20dd0d['callDirection']===_0x8cc4('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x8cc4('0x4d')+_0x20dd0d['enduserId']+')','participationtypemask':_0x20dd0d['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x20dd0d[_0x8cc4('0x27')]+')','participationtypemask':_0x20dd0d[_0x8cc4('0x4e')]==='queue'?0x2:0x1}];_0x261d10={'method':'POST','uri':_0x14b9a3+_0x8cc4('0x4f'),'body':Object[_0x8cc4('0x47')]({},{'subject':intUtil[_0x8cc4('0x49')](_0x1ada2b[_0x8cc4('0x48')],_0x436d53,'\x20'),'phonenumber':String(_0x436d53[_0x8cc4('0x2b')]),'description':intUtil[_0x8cc4('0x49')](_0x1ada2b[_0x8cc4('0x4a')],_0x436d53,'\x0a'),'regardingobjectid_contact@odata.bind':_0x20dd0d['enduserId']?_0x8cc4('0x4d')+_0x20dd0d[_0x8cc4('0x32')]+')':undefined,'ownerid@odata.bind':_0x8cc4('0x2e')+_0x20dd0d[_0x8cc4('0x27')]+')','directioncode':_0x20dd0d[_0x8cc4('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1574a1},getCustomFields(_0x1ada2b[_0x8cc4('0x50')],_0x436d53,_0x1ada2b[_0x8cc4('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x2a830e,'OData-Version':_0x8cc4('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x261d10);})['then'](function(_0x3d3e31){var _0x2174eb=_0x3d3e31[_0x8cc4('0x51')][_0x8cc4('0x30')];var _0x15a43b=_0x2174eb['substring'](_0x2174eb['lastIndexOf']('(')+0x1,_0x2174eb[_0x8cc4('0x52')](')'));_0x20dd0d[_0x8cc4('0x53')]=_0x15a43b;_0x3eda7b(_0x20dd0d);})[_0x8cc4('0x14')](function(_0x245960){_0x3f8aa1(_0x245960[_0x8cc4('0x18')]);});});}function emit(_0x32d2eb,_0xad0fe1,_0x1a25d5,_0xdec154){var _0x4e9c2c={'uri':util[_0x8cc4('0x54')](_0x8cc4('0x55'),_0x32d2eb,_0x1a25d5,_0xdec154)};io['to'](util[_0x8cc4('0x54')](_0x8cc4('0x56'),_0xad0fe1))[_0x8cc4('0x57')](_0x8cc4('0x58'),_0x4e9c2c);}exports['cs']=function(_0x1e9af,_0x32e644,_0x436711,_0xdf8234,_0x5e3e69,_0x588ed0,_0x52c4f8,_0x3d3451){var _0x23f8bb={};_0x588ed0['remoteUri']=_0x588ed0[_0x8cc4('0xa')]?intUtil['stripTrailingSlash'](_0x588ed0[_0x8cc4('0xe')][_0x8cc4('0xc')]):intUtil['stripTrailingSlash'](_0x588ed0[_0x8cc4('0xb')]);_0x588ed0[_0x8cc4('0x59')]=intUtil[_0x8cc4('0x5a')](_0x588ed0['serverUrl']);_0x23f8bb[_0x8cc4('0x4e')]=_0x3d3451==='queue'||_0x3d3451===_0x8cc4('0x5b')?_0x8cc4('0x4c'):_0x8cc4('0x29');var _0x12f2c2=_0x588ed0['modernAuthentication']?util[_0x8cc4('0x54')](_0x8cc4('0x5c'),_0x588ed0[_0x8cc4('0xe')][_0x8cc4('0xc')]):util[_0x8cc4('0x54')](_0x8cc4('0x5c'),_0x588ed0[_0x8cc4('0xb')]);var _0x1b98e4=util[_0x8cc4('0x54')](_0x8cc4('0x5d'),_0x588ed0[_0x8cc4('0xd')]);var _0x556f8b=util[_0x8cc4('0x54')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x588ed0[_0x8cc4('0x59')],_0x32e644[_0x8cc4('0x5e')],md5(_0x32e644[_0x8cc4('0x5e')]));if(_0x5e3e69&&_0x5e3e69[_0x8cc4('0x5f')]){logger[_0x8cc4('0x24')]('[QUEUE]',_0x8cc4('0x60'));_0x32e644[_0x8cc4('0x61')]=_0x556f8b;}else if(_0x52c4f8&&_0x52c4f8['recordingFormat']&&_0x52c4f8['recordingFormat']!==_0x8cc4('0x62')){logger[_0x8cc4('0x24')](_0x8cc4('0x63'),'Recording\x20is\x20enabled!');_0x32e644[_0x8cc4('0x61')]=_0x556f8b;}else{_0x32e644[_0x8cc4('0x61')]='';}return getUser(_0x23f8bb,_0x588ed0,_0xdf8234,_0x1b98e4,_0x12f2c2,_0x3d3451)[_0x8cc4('0x13')](function(_0x3e72c9){logger[_0x8cc4('0x24')]('['+_0x3d3451[_0x8cc4('0x16')]()+_0x8cc4('0x64'),_0x3e72c9[_0x8cc4('0x27')]);logger[_0x8cc4('0x24')]('['+_0x3d3451[_0x8cc4('0x16')]()+_0x8cc4('0x65'),_0x3e72c9['userEmail']);return getEndUser(_0x3e72c9,_0x588ed0,_0x1b98e4,_0x12f2c2,_0x32e644,_0x3d3451,_0x436711[_0x8cc4('0x66')],_0x436711[_0x8cc4('0x67')]);})['then'](function(_0x58b279){logger[_0x8cc4('0x24')]('['+_0x3d3451['toUpperCase']()+_0x8cc4('0x68'),_0x58b279[_0x8cc4('0x32')]);logger[_0x8cc4('0x24')]('['+_0x3d3451[_0x8cc4('0x16')]()+_0x8cc4('0x69'),_0x32e644[_0x8cc4('0x2b')]);return getTicket(_0x58b279,_0x588ed0,_0x1b98e4,_0x12f2c2,_0x32e644,_0x436711,_0x3d3451);})[_0x8cc4('0x13')](function(_0x454ed9){logger[_0x8cc4('0x24')](util['format']('['+_0x3d3451[_0x8cc4('0x16')]()+_0x8cc4('0x6a'),_0x436711[_0x8cc4('0x45')],_0x454ed9[_0x8cc4('0x53')]));logger[_0x8cc4('0x24')](util[_0x8cc4('0x54')]('['+_0x3d3451['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x3d3451));if(_0x3d3451!==_0x8cc4('0x5b')&&_0x436711[_0x8cc4('0x6b')]){logger['info']('['+_0x3d3451[_0x8cc4('0x16')]()+']',_0x8cc4('0x6c'));emit(_0x588ed0[_0x8cc4('0xb')],_0xdf8234['name'],_0x436711['ticketType'],_0x454ed9[_0x8cc4('0x53')]);}})[_0x8cc4('0x14')](function(_0x598ba3){logger[_0x8cc4('0x15')]('['+_0x3d3451['toUpperCase']()+_0x8cc4('0x6d'),_0x598ba3[_0x8cc4('0x18')]);console[_0x8cc4('0x15')]('Error\x20running\x20Dynamics365\x20integration',_0x598ba3);});}; \ 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 07f1d73..2f13336 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 _0x4382=['destcalleridnum','Ticket\x20created!','%s/helpdesk/tickets/%d','error','unmanaged','monitor_format','lastevent','Recording\x20is\x20enabled!','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','info','calleridname','calleridnum','getString','Subjects','
','name','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','POST','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','nameField','customField','content','idField','push','variable','variableName','toString','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','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','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname'];(function(_0x23c27a,_0x31cd89){var _0x2aa7f1=function(_0x1d0aa5){while(--_0x1d0aa5){_0x23c27a['push'](_0x23c27a['shift']());}};_0x2aa7f1(++_0x31cd89);}(_0x4382,0x1df));var _0x2438=function(_0x5b3fb9,_0x71d8cc){_0x5b3fb9=_0x5b3fb9-0x0;var _0x4528ce=_0x4382[_0x5b3fb9];return _0x4528ce;};'use strict';var _=require(_0x2438('0x0'));var rp=require('request-promise');var md5=require(_0x2438('0x1'));var util=require(_0x2438('0x2'));var Redis=require(_0x2438('0x3'));var intUtil=require(_0x2438('0x4'));var config=require('../../../../config/environment');var logger=require(_0x2438('0x5'))(_0x2438('0x6'));config[_0x2438('0x7')]=_[_0x2438('0x8')](config[_0x2438('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2438('0x9'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0x2438('0xa')};function emit(_0x551a8f,_0x5a8420,_0x283f81){io['to'](_0x551a8f)['emit'](_0x5a8420,_0x283f81);}function getTicket(_0x116fc8,_0xe50bfd,_0x3f9f9d,_0x50dfaa,_0x51e62b){logger[_0x2438('0xb')]('Creating\x20new\x20ticket...');var _0x1aebbe=_['merge']({'responder_id':_0xe50bfd['id'],'requester_id':_0x3f9f9d['id'],'name':util['format']('Caller\x20-\x20%s',_0x51e62b[_0x2438('0xc')]),'phone':_0x51e62b[_0x2438('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2438('0xe')](_0x50dfaa[_0x2438('0xf')],_0x51e62b,'\x20'),'description':intUtil[_0x2438('0xe')](_0x50dfaa['Descriptions'],_0x51e62b,_0x2438('0x10')),'tags':getTags(_0x50dfaa['Tags'],_0x2438('0x11'))},getCustomFields(_0x50dfaa[_0x2438('0x12')],_0x51e62b));_0x1aebbe[_0x2438('0x13')]=_[_0x2438('0x14')](_['keyBy'](_0x1aebbe[_0x2438('0x13')],'id'),_0x2438('0x15'));return request({'uri':util[_0x2438('0x16')](_0x2438('0x17'),_0x116fc8['remoteUri']),'method':_0x2438('0x18'),'body':_0x1aebbe})['then'](function(_0x269ea1){logger[_0x2438('0xb')]('Ticket\x20created!');return _0x269ea1;});}function getUser(_0x414a79,_0x11a661){if(intUtil[_0x2438('0x19')](_0x11a661)){return request({'uri':util['format'](_0x2438('0x1a'),_0x414a79[_0x2438('0x1b')]),'qs':{'email':_0x11a661}})[_0x2438('0x1c')](function(_0x6e42eb){if(_0x6e42eb[_0x2438('0x1d')]){logger[_0x2438('0xb')](_0x2438('0x1e'));return _[_0x2438('0x1f')](_0x6e42eb,function(_0x4b17dc){return _0x4b17dc[_0x2438('0x20')]['email']===_0x11a661;});}else{logger[_0x2438('0xb')](_0x2438('0x21'));return request({'uri':util[_0x2438('0x16')]('%s/api/v2/agents/me',_0x414a79[_0x2438('0x1b')])})[_0x2438('0x1c')](function(_0x222187){logger[_0x2438('0xb')]('Admin\x20account\x20selected.');return _0x222187;});}});}else{logger[_0x2438('0xb')](_0x2438('0x22'));return request({'uri':util[_0x2438('0x16')](_0x2438('0x23'),_0x414a79[_0x2438('0x1b')])})['then'](function(_0x282ef2){logger[_0x2438('0xb')](_0x2438('0x24'));return _0x282ef2;});}}function getEndUser(_0x20a766,_0x4186db,_0x2cc377){logger['info'](_0x2438('0x25'),_0x2cc377);return request({'uri':util['format'](_0x2438('0x26'),_0x20a766[_0x2438('0x1b')]),'qs':{'phone':_0x2cc377}})[_0x2438('0x1c')](function(_0x499868){if(_0x499868[_0x2438('0x1d')]){logger[_0x2438('0xb')](_0x2438('0x27'));return _[_0x2438('0x1f')](_0x499868,{'phone':_0x2cc377});}else{logger[_0x2438('0xb')](_0x2438('0x28'));return request({'uri':util['format'](_0x2438('0x26'),_0x20a766[_0x2438('0x1b')]),'method':_0x2438('0x18'),'body':{'name':_0x4186db,'phone':_0x2cc377}})[_0x2438('0x1c')](function(_0x1c694a){logger[_0x2438('0xb')](_0x2438('0x29'));return _0x1c694a;});}});}function getAuth(_0x21f643){return util[_0x2438('0x16')]('Basic\x20%s',new Buffer(_0x21f643[_0x2438('0x2a')]+':X')['toString'](_0x2438('0x2b')));}function request(_0x2d686e){logger[_0x2438('0x2c')](_0x2438('0x2d'),JSON[_0x2438('0x2e')](_0x2d686e));return rp(_[_0x2438('0x8')](_0x2d686e,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5b01ed,_0x5225c0){var _0x338f4e=[];if(_0x5b01ed&&_0x5b01ed[_0x2438('0x1d')]>0x0){_0x338f4e=_[_0x2438('0x2f')](_0x5b01ed,_0x5225c0);}return _0x338f4e;}function getCustomFields(_0x49d119,_0x314549){var _0x21b019=[];var _0x495434={'custom_fields':[]};if(_0x49d119[_0x2438('0x1d')]>0x0){_[_0x2438('0x30')](_0x49d119,function(_0x38c68e){if(_[_0x2438('0x31')]([_0x2438('0x32'),_0x2438('0x33')],_0x38c68e[_0x2438('0x34')])&&_0x38c68e[_0x2438('0x35')]&&!_0x38c68e[_0x2438('0x36')]){_0x495434[_0x38c68e[_0x2438('0x35')]['toLowerCase']()]=_0x38c68e[_0x2438('0x37')]['toString']();}else if(_[_0x2438('0x31')](['string','picklist'],_0x38c68e[_0x2438('0x34')])&&_0x38c68e[_0x2438('0x38')]&&_0x38c68e[_0x2438('0x36')]){_0x495434[_0x2438('0x13')][_0x2438('0x39')]({'id':_0x38c68e[_0x2438('0x38')],'value':_0x38c68e[_0x2438('0x37')]['toString']()});}else if(_0x38c68e[_0x2438('0x34')]===_0x2438('0x3a')&&_0x38c68e[_0x2438('0x3b')]&&_0x38c68e[_0x2438('0x38')]&&_0x38c68e[_0x2438('0x36')]){_0x314549[_0x38c68e[_0x2438('0x3b')]]&&_0x495434['custom_fields'][_0x2438('0x39')]({'id':_0x38c68e[_0x2438('0x38')],'value':_0x314549[_0x38c68e[_0x2438('0x3b')]][_0x2438('0x3c')]()});}else if(_0x38c68e[_0x2438('0x34')]===_0x2438('0x3d')&&_0x38c68e['Variable']&&_0x38c68e[_0x2438('0x3e')]['name']&&_0x38c68e[_0x2438('0x38')]&&_0x38c68e[_0x2438('0x36')]){_0x314549[_0x38c68e[_0x2438('0x3e')][_0x2438('0x11')][_0x2438('0x3f')]()]&&_0x495434[_0x2438('0x13')]['push']({'id':_0x38c68e[_0x2438('0x38')],'value':_0x314549[_0x38c68e[_0x2438('0x3e')][_0x2438('0x11')][_0x2438('0x3f')]()][_0x2438('0x3c')]()});}});}return _0x495434;}exports[_0x2438('0x40')]=function(_0x5ce581,_0x52fc87,_0x5767fe,_0x2e6b36,_0x3f3479,_0x28aa86){var _0x45472,_0x3b0551;_0x28aa86[_0x2438('0x1b')]=intUtil[_0x2438('0x41')](_0x28aa86[_0x2438('0x1b')]);_0x28aa86[_0x2438('0x42')]=intUtil['stripTrailingSlash'](_0x28aa86[_0x2438('0x42')]);if(_0x3f3479&&_0x3f3479['monitor_format']){logger[_0x2438('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x52fc87[_0x2438('0x43')]=util[_0x2438('0x16')](_0x2438('0x44'),_0x28aa86[_0x2438('0x42')],_0x52fc87[_0x2438('0x45')],md5(_0x52fc87[_0x2438('0x45')]));}else{_0x52fc87[_0x2438('0x43')]='';}headers[_0x2438('0x46')]=getAuth(_0x28aa86);return getUser(_0x28aa86,_0x2e6b36[_0x2438('0x47')])['then'](function(_0x311a6f){_0x45472=_0x311a6f;logger[_0x2438('0xb')](_0x2438('0x48'),_0x45472['id']);return getEndUser(_0x28aa86,_0x52fc87[_0x2438('0xc')],_0x52fc87['calleridnum']);})[_0x2438('0x1c')](function(_0xc69e13){_0x3b0551=_0xc69e13;logger[_0x2438('0xb')](_0x2438('0x49'),_0x3b0551['id']);return getTicket(_0x28aa86,_0x45472,_0x3b0551,_0x5767fe,_0x52fc87);})[_0x2438('0x1c')](function(_0x25b9ae){if(_0x25b9ae&&_0x25b9ae['id']){logger['info']('Ticket\x20created!');logger[_0x2438('0xb')](_0x2438('0x4a'),_0x25b9ae['id']);logger['info']('[QUEUE]',_0x2438('0x4b'));emit(util[_0x2438('0x16')](_0x2438('0x4c'),_0x2e6b36[_0x2438('0x11')]),_0x2438('0x4d'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x28aa86[_0x2438('0x1b')],_0x25b9ae['id'])});}})[_0x2438('0x4e')](function(_0x75c7e0){logger['error'](_0x2438('0x4f'),JSON[_0x2438('0x2e')](_0x75c7e0));});};exports[_0x2438('0x50')]=function(_0x5a1d88,_0x914847,_0x243a7e,_0x549623,_0x514c9d,_0x322562,_0x1160a2){var _0x23f3f3,_0x55db7a;_0x322562[_0x2438('0x1b')]=intUtil[_0x2438('0x41')](_0x322562[_0x2438('0x1b')]);_0x322562['serverUrl']=intUtil[_0x2438('0x41')](_0x322562[_0x2438('0x42')]);if(_0x1160a2&&_0x1160a2[_0x2438('0x51')]&&_0x1160a2[_0x2438('0x51')]!==_0x2438('0x52')){logger['info'](_0x2438('0x53'),'Recording\x20is\x20enabled!');_0x914847[_0x2438('0x43')]=util[_0x2438('0x16')](_0x2438('0x44'),_0x322562['serverUrl'],_0x914847[_0x2438('0x45')],md5(_0x914847[_0x2438('0x45')]));}headers[_0x2438('0x46')]=getAuth(_0x322562);return getUser(_0x322562,_0x549623[_0x2438('0x47')])['then'](function(_0x4d846c){_0x23f3f3=_0x4d846c;logger['info'](_0x2438('0x48'),_0x23f3f3['id']);return getEndUser(_0x322562,_0x914847[_0x2438('0x54')],_0x914847[_0x2438('0x55')]);})[_0x2438('0x1c')](function(_0x4285b9){_0x55db7a=_0x4285b9;logger[_0x2438('0xb')](_0x2438('0x49'),_0x55db7a['id']);return getTicket(_0x322562,_0x23f3f3,_0x55db7a,_0x243a7e,_0x914847);})[_0x2438('0x1c')](function(_0x322c02){if(_0x322c02&&_0x322c02['id']){logger[_0x2438('0xb')](_0x2438('0x56'));logger[_0x2438('0xb')](_0x2438('0x4a'),_0x322c02['id']);logger[_0x2438('0xb')](_0x2438('0x53'),_0x2438('0x4b'));emit(util['format']('user:%s',_0x549623['name']),_0x2438('0x4d'),{'uri':util[_0x2438('0x16')](_0x2438('0x57'),_0x322562[_0x2438('0x1b')],_0x322c02['id'])});}})[_0x2438('0x4e')](function(_0x2bde1f){logger[_0x2438('0x58')](_0x2438('0x53'),JSON[_0x2438('0x2e')](_0x2bde1f));});};exports[_0x2438('0x59')]=function(_0x43f1ca,_0x3d2c0d,_0x2267fb,_0x446490,_0x349180,_0x4b1df8){var _0x96942f,_0x271a5d;_0x4b1df8[_0x2438('0x1b')]=intUtil['stripTrailingSlash'](_0x4b1df8[_0x2438('0x1b')]);_0x4b1df8['serverUrl']=intUtil[_0x2438('0x41')](_0x4b1df8['serverUrl']);if(_0x349180&&_0x349180[_0x2438('0x5a')]){logger[_0x2438('0xb')]('['+_0x3d2c0d[_0x2438('0x5b')]['toUpperCase']()+']',_0x2438('0x5c'));_0x3d2c0d[_0x2438('0x43')]=util[_0x2438('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b1df8[_0x2438('0x42')],_0x3d2c0d['uniqueid'],md5(_0x3d2c0d[_0x2438('0x45')]));}else{_0x3d2c0d['recordingURL']='';}headers['Authorization']=getAuth(_0x4b1df8);return getUser(_0x4b1df8,'')[_0x2438('0x1c')](function(_0x3845dd){_0x96942f=_0x3845dd;logger[_0x2438('0xb')]('The\x20User\x20ID\x20is:',_0x96942f['id']);return getEndUser(_0x4b1df8,_0x3d2c0d[_0x2438('0xc')],_0x3d2c0d['calleridnum']);})['then'](function(_0x52c6ff){_0x271a5d=_0x52c6ff;logger[_0x2438('0xb')]('The\x20Enduser\x20ID\x20is:',_0x271a5d['id']);return getTicket(_0x4b1df8,_0x96942f,_0x271a5d,_0x2267fb,_0x3d2c0d);})['then'](function(_0x136f8b){if(_0x136f8b){logger[_0x2438('0xb')](_0x2438('0x56'));logger[_0x2438('0xb')](_0x2438('0x4a'),_0x136f8b['id']);}})['catch'](function(_0x527620){logger[_0x2438('0x58')]('['+_0x3d2c0d[_0x2438('0x5b')][_0x2438('0x5d')]()+']',JSON[_0x2438('0x2e')](_0x527620));});}; \ No newline at end of file +var _0x16bd=['%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','length','map','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','toString','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','find','contact','email'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x16bd,0x1ae));var _0xd16b=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x16bd[_0x45b29d];return _0x32d74;};'use strict';var _=require('lodash');var rp=require(_0xd16b('0x0'));var md5=require(_0xd16b('0x1'));var util=require(_0xd16b('0x2'));var Redis=require(_0xd16b('0x3'));var intUtil=require(_0xd16b('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd16b('0x5'))(_0xd16b('0x6'));config[_0xd16b('0x7')]=_[_0xd16b('0x8')](config[_0xd16b('0x7')],{'host':_0xd16b('0x9'),'port':0x18eb});var io=require(_0xd16b('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xd16b('0xb'),'Accept':_0xd16b('0xb')};function emit(_0x393d72,_0x56a202,_0x3a5c89){io['to'](_0x393d72)[_0xd16b('0xc')](_0x56a202,_0x3a5c89);}function getTicket(_0xfde866,_0xc61dab,_0x4267b7,_0x8707f5,_0x55f8d0){logger[_0xd16b('0xd')](_0xd16b('0xe'));var _0x477605=_[_0xd16b('0xf')]({'responder_id':_0xc61dab['id'],'requester_id':_0x4267b7['id'],'name':util[_0xd16b('0x10')](_0xd16b('0x11'),_0x55f8d0[_0xd16b('0x12')]),'phone':_0x55f8d0[_0xd16b('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd16b('0x14')](_0x8707f5['Subjects'],_0x55f8d0,'\x20'),'description':intUtil[_0xd16b('0x14')](_0x8707f5[_0xd16b('0x15')],_0x55f8d0,'
'),'tags':getTags(_0x8707f5['Tags'],_0xd16b('0x16'))},getCustomFields(_0x8707f5[_0xd16b('0x17')],_0x55f8d0));_0x477605[_0xd16b('0x18')]=_[_0xd16b('0x19')](_[_0xd16b('0x1a')](_0x477605[_0xd16b('0x18')],'id'),_0xd16b('0x1b'));return request({'uri':util[_0xd16b('0x10')](_0xd16b('0x1c'),_0xfde866[_0xd16b('0x1d')]),'method':_0xd16b('0x1e'),'body':_0x477605})[_0xd16b('0x1f')](function(_0x1d8fd2){logger[_0xd16b('0xd')]('Ticket\x20created!');return _0x1d8fd2;});}function getUser(_0x42ba48,_0x17796c){if(intUtil['validateEmail'](_0x17796c)){return request({'uri':util[_0xd16b('0x10')]('%s/api/v2/agents',_0x42ba48[_0xd16b('0x1d')]),'qs':{'email':_0x17796c}})[_0xd16b('0x1f')](function(_0x5b3b66){if(_0x5b3b66['length']){logger[_0xd16b('0xd')]('Agent\x20found!');return _[_0xd16b('0x20')](_0x5b3b66,function(_0x25ac73){return _0x25ac73[_0xd16b('0x21')][_0xd16b('0x22')]===_0x17796c;});}else{logger[_0xd16b('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd16b('0x10')](_0xd16b('0x23'),_0x42ba48['remoteUri'])})['then'](function(_0x2bbe4c){logger[_0xd16b('0xd')](_0xd16b('0x24'));return _0x2bbe4c;});}});}else{logger[_0xd16b('0xd')](_0xd16b('0x25'));return request({'uri':util[_0xd16b('0x10')](_0xd16b('0x23'),_0x42ba48[_0xd16b('0x1d')])})[_0xd16b('0x1f')](function(_0x586b4c){logger['info'](_0xd16b('0x24'));return _0x586b4c;});}}function getEndUser(_0x38ad4f,_0x29c46b,_0x35c243){logger[_0xd16b('0xd')](_0xd16b('0x26'),_0x35c243);return request({'uri':util[_0xd16b('0x10')](_0xd16b('0x27'),_0x38ad4f[_0xd16b('0x1d')]),'qs':{'phone':_0x35c243}})['then'](function(_0x2a43ff){if(_0x2a43ff['length']){logger[_0xd16b('0xd')](_0xd16b('0x28'));return _[_0xd16b('0x20')](_0x2a43ff,{'phone':_0x35c243});}else{logger[_0xd16b('0xd')](_0xd16b('0x29'));return request({'uri':util[_0xd16b('0x10')]('%s/api/v2/contacts',_0x38ad4f[_0xd16b('0x1d')]),'method':_0xd16b('0x1e'),'body':{'name':_0x29c46b,'phone':_0x35c243}})[_0xd16b('0x1f')](function(_0x1e2e77){logger[_0xd16b('0xd')](_0xd16b('0x2a'));return _0x1e2e77;});}});}function getAuth(_0x1c215d){return util[_0xd16b('0x10')](_0xd16b('0x2b'),new Buffer(_0x1c215d[_0xd16b('0x2c')]+':X')['toString'](_0xd16b('0x2d')));}function request(_0x2d84c5){logger[_0xd16b('0x2e')](_0xd16b('0x2f'),JSON[_0xd16b('0x30')](_0x2d84c5));return rp(_[_0xd16b('0x8')](_0x2d84c5,{'method':_0xd16b('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3b2481,_0x115529){var _0x27d017=[];if(_0x3b2481&&_0x3b2481[_0xd16b('0x32')]>0x0){_0x27d017=_[_0xd16b('0x33')](_0x3b2481,_0x115529);}return _0x27d017;}function getCustomFields(_0x466825,_0x35121c){var _0xef6d80=[];var _0x913c36={'custom_fields':[]};if(_0x466825[_0xd16b('0x32')]>0x0){_['forEach'](_0x466825,function(_0x2d1604){if(_[_0xd16b('0x34')]([_0xd16b('0x35'),_0xd16b('0x36')],_0x2d1604['type'])&&_0x2d1604[_0xd16b('0x37')]&&!_0x2d1604[_0xd16b('0x38')]){_0x913c36[_0x2d1604[_0xd16b('0x37')][_0xd16b('0x39')]()]=_0x2d1604[_0xd16b('0x3a')]['toString']();}else if(_[_0xd16b('0x34')]([_0xd16b('0x35'),_0xd16b('0x36')],_0x2d1604[_0xd16b('0x3b')])&&_0x2d1604[_0xd16b('0x3c')]&&_0x2d1604[_0xd16b('0x38')]){_0x913c36[_0xd16b('0x18')][_0xd16b('0x3d')]({'id':_0x2d1604[_0xd16b('0x3c')],'value':_0x2d1604[_0xd16b('0x3a')][_0xd16b('0x3e')]()});}else if(_0x2d1604[_0xd16b('0x3b')]===_0xd16b('0x3f')&&_0x2d1604[_0xd16b('0x40')]&&_0x2d1604['idField']&&_0x2d1604[_0xd16b('0x38')]){_0x35121c[_0x2d1604[_0xd16b('0x40')]]&&_0x913c36[_0xd16b('0x18')]['push']({'id':_0x2d1604[_0xd16b('0x3c')],'value':_0x35121c[_0x2d1604[_0xd16b('0x40')]]['toString']()});}else if(_0x2d1604[_0xd16b('0x3b')]===_0xd16b('0x41')&&_0x2d1604['Variable']&&_0x2d1604[_0xd16b('0x42')][_0xd16b('0x16')]&&_0x2d1604['idField']&&_0x2d1604[_0xd16b('0x38')]){_0x35121c[_0x2d1604[_0xd16b('0x42')][_0xd16b('0x16')][_0xd16b('0x39')]()]&&_0x913c36[_0xd16b('0x18')]['push']({'id':_0x2d1604[_0xd16b('0x3c')],'value':_0x35121c[_0x2d1604[_0xd16b('0x42')]['name'][_0xd16b('0x39')]()]['toString']()});}});}return _0x913c36;}exports[_0xd16b('0x43')]=function(_0x11dc37,_0x42797f,_0x4170ae,_0x2d6285,_0x56c0d8,_0x54ce3b){var _0x34a0b2,_0x263236;_0x54ce3b[_0xd16b('0x1d')]=intUtil[_0xd16b('0x44')](_0x54ce3b['remoteUri']);_0x54ce3b['serverUrl']=intUtil[_0xd16b('0x44')](_0x54ce3b[_0xd16b('0x45')]);if(_0x56c0d8&&_0x56c0d8[_0xd16b('0x46')]){logger[_0xd16b('0xd')](_0xd16b('0x47'),'Recording\x20is\x20enabled!');_0x42797f[_0xd16b('0x48')]=util[_0xd16b('0x10')](_0xd16b('0x49'),_0x54ce3b[_0xd16b('0x45')],_0x42797f[_0xd16b('0x4a')],md5(_0x42797f[_0xd16b('0x4a')]));}else{_0x42797f[_0xd16b('0x48')]='';}headers[_0xd16b('0x4b')]=getAuth(_0x54ce3b);return getUser(_0x54ce3b,_0x2d6285[_0xd16b('0x22')])[_0xd16b('0x1f')](function(_0x3c4794){_0x34a0b2=_0x3c4794;logger['info'](_0xd16b('0x4c'),_0x34a0b2['id']);return getEndUser(_0x54ce3b,_0x42797f[_0xd16b('0x12')],_0x42797f[_0xd16b('0x13')]);})[_0xd16b('0x1f')](function(_0x93dc4b){_0x263236=_0x93dc4b;logger[_0xd16b('0xd')]('The\x20Enduser\x20ID\x20is:',_0x263236['id']);return getTicket(_0x54ce3b,_0x34a0b2,_0x263236,_0x4170ae,_0x42797f);})[_0xd16b('0x1f')](function(_0x4ef0ba){if(_0x4ef0ba&&_0x4ef0ba['id']){logger['info'](_0xd16b('0x4d'));logger[_0xd16b('0xd')](_0xd16b('0x4e'),_0x4ef0ba['id']);logger[_0xd16b('0xd')](_0xd16b('0x47'),_0xd16b('0x4f'));emit(util[_0xd16b('0x10')](_0xd16b('0x50'),_0x2d6285['name']),'trigger:browser:url',{'uri':util[_0xd16b('0x10')]('%s/helpdesk/tickets/%d',_0x54ce3b['remoteUri'],_0x4ef0ba['id'])});}})[_0xd16b('0x51')](function(_0x2a5dac){logger[_0xd16b('0x52')](_0xd16b('0x47'),JSON[_0xd16b('0x30')](_0x2a5dac));});};exports[_0xd16b('0x53')]=function(_0x36a64c,_0x47a703,_0x2a4459,_0x360285,_0x3045a3,_0x4fb3c1,_0x1d36a3){var _0x1d620a,_0x41523a;_0x4fb3c1[_0xd16b('0x1d')]=intUtil[_0xd16b('0x44')](_0x4fb3c1['remoteUri']);_0x4fb3c1[_0xd16b('0x45')]=intUtil[_0xd16b('0x44')](_0x4fb3c1[_0xd16b('0x45')]);if(_0x1d36a3&&_0x1d36a3['recordingFormat']&&_0x1d36a3[_0xd16b('0x54')]!==_0xd16b('0x55')){logger[_0xd16b('0xd')](_0xd16b('0x56'),_0xd16b('0x57'));_0x47a703[_0xd16b('0x48')]=util[_0xd16b('0x10')](_0xd16b('0x49'),_0x4fb3c1[_0xd16b('0x45')],_0x47a703[_0xd16b('0x4a')],md5(_0x47a703[_0xd16b('0x4a')]));}headers[_0xd16b('0x4b')]=getAuth(_0x4fb3c1);return getUser(_0x4fb3c1,_0x360285['email'])[_0xd16b('0x1f')](function(_0x458da1){_0x1d620a=_0x458da1;logger[_0xd16b('0xd')](_0xd16b('0x4c'),_0x1d620a['id']);return getEndUser(_0x4fb3c1,_0x47a703['destcalleridname'],_0x47a703[_0xd16b('0x58')]);})[_0xd16b('0x1f')](function(_0x1ed2a8){_0x41523a=_0x1ed2a8;logger[_0xd16b('0xd')](_0xd16b('0x59'),_0x41523a['id']);return getTicket(_0x4fb3c1,_0x1d620a,_0x41523a,_0x2a4459,_0x47a703);})[_0xd16b('0x1f')](function(_0x337598){if(_0x337598&&_0x337598['id']){logger['info'](_0xd16b('0x4d'));logger[_0xd16b('0xd')]('The\x20Ticket\x20ID\x20is:',_0x337598['id']);logger['info'](_0xd16b('0x56'),_0xd16b('0x4f'));emit(util[_0xd16b('0x10')]('user:%s',_0x360285[_0xd16b('0x16')]),'trigger:browser:url',{'uri':util[_0xd16b('0x10')]('%s/helpdesk/tickets/%d',_0x4fb3c1[_0xd16b('0x1d')],_0x337598['id'])});}})[_0xd16b('0x51')](function(_0x2b9691){logger['error']('[OUTBOUND]',JSON[_0xd16b('0x30')](_0x2b9691));});};exports[_0xd16b('0x5a')]=function(_0x9284a0,_0x1b6f54,_0x722d5e,_0x401d8a,_0x1fb05a,_0x125c91){var _0x2d60f8,_0x36b147;_0x125c91[_0xd16b('0x1d')]=intUtil[_0xd16b('0x44')](_0x125c91[_0xd16b('0x1d')]);_0x125c91[_0xd16b('0x45')]=intUtil[_0xd16b('0x44')](_0x125c91[_0xd16b('0x45')]);if(_0x1fb05a&&_0x1fb05a[_0xd16b('0x46')]){logger[_0xd16b('0xd')]('['+_0x1b6f54['lastevent']['toUpperCase']()+']',_0xd16b('0x57'));_0x1b6f54[_0xd16b('0x48')]=util[_0xd16b('0x10')](_0xd16b('0x49'),_0x125c91['serverUrl'],_0x1b6f54[_0xd16b('0x4a')],md5(_0x1b6f54[_0xd16b('0x4a')]));}else{_0x1b6f54['recordingURL']='';}headers['Authorization']=getAuth(_0x125c91);return getUser(_0x125c91,'')[_0xd16b('0x1f')](function(_0x201b10){_0x2d60f8=_0x201b10;logger[_0xd16b('0xd')]('The\x20User\x20ID\x20is:',_0x2d60f8['id']);return getEndUser(_0x125c91,_0x1b6f54['calleridname'],_0x1b6f54['calleridnum']);})[_0xd16b('0x1f')](function(_0x2b5eac){_0x36b147=_0x2b5eac;logger[_0xd16b('0xd')]('The\x20Enduser\x20ID\x20is:',_0x36b147['id']);return getTicket(_0x125c91,_0x2d60f8,_0x36b147,_0x722d5e,_0x1b6f54);})['then'](function(_0x716fbd){if(_0x716fbd){logger[_0xd16b('0xd')](_0xd16b('0x4d'));logger[_0xd16b('0xd')](_0xd16b('0x4e'),_0x716fbd['id']);}})[_0xd16b('0x51')](function(_0xb71324){logger['error']('['+_0x1b6f54[_0xd16b('0x5b')][_0xd16b('0x5c')]()+']',JSON[_0xd16b('0x30')](_0xb71324));});}; \ 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 ec3f714..9ee7f7f 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 _0x1375=['username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','users','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x407481,_0xa676fe){var _0x44e323=function(_0x2eb700){while(--_0x2eb700){_0x407481['push'](_0x407481['shift']());}};_0x44e323(++_0xa676fe);}(_0x1375,0x1b0));var _0x5137=function(_0x46bbc5,_0x30b3c5){_0x46bbc5=_0x46bbc5-0x0;var _0x2f97bd=_0x1375[_0x46bbc5];return _0x2f97bd;};'use strict';var _=require(_0x5137('0x0'));var rp=require(_0x5137('0x1'));var md5=require(_0x5137('0x2'));var util=require(_0x5137('0x3'));var moment=require('moment');var Promise=require(_0x5137('0x4'));var Redis=require(_0x5137('0x5'));var intUtil=require(_0x5137('0x6'));var config=require(_0x5137('0x7'));var logger=require('../../../../config/logger')('freshsales');config[_0x5137('0x8')]=_[_0x5137('0x9')](config[_0x5137('0x8')],{'host':_0x5137('0xa'),'port':0x18eb});var io=require(_0x5137('0xb'))(new Redis(config['redis']));function getAdminId(_0x112697,_0x546e9a,_0x292dff,_0x2e4433){return new Promise(function(_0x421b62,_0x2090f4){var _0x4ba68b=![];var _0x419200={'method':_0x5137('0xc'),'uri':_0x2e4433+_0x5137('0xd'),'json':!![]};_0x419200['headers']=_0x292dff;logger[_0x5137('0xe')](_0x5137('0xf'));return rp(_0x419200)[_0x5137('0x10')](function(_0x4108b){if(_0x4108b){var _0xc63e54=_0x4108b['users'];var _0x595bb3=null;for(_0x595bb3=0x0;_0x595bb3<_0xc63e54[_0x5137('0x11')];_0x595bb3++){if(_0xc63e54[_0x595bb3][_0x5137('0x12')]===_0x112697[_0x5137('0x13')]){_0x112697[_0x5137('0x14')]=_0xc63e54[_0x595bb3]['id'];_0x4ba68b=!![];}}if(_0x4ba68b){logger[_0x5137('0xe')](_0x5137('0x15'),_0x112697[_0x5137('0x14')]);_0x421b62(_0x112697);}else{_0x2090f4({'statusCode':0x194,'message':_0x5137('0x16')});}}else{_0x2090f4({'statusCode':0x194,'message':_0x5137('0x16')});}})[_0x5137('0x17')](function(_0x43d34b){logger[_0x5137('0x18')]('['+[_0x546e9a[_0x5137('0x19')]()]+']',_0x43d34b[_0x5137('0x1a')]);_0x2090f4(_0x43d34b);});});}function getUser(_0x434a6d,_0xe575f2,_0x52a955){return function(_0xabf11c){return new Promise(function(_0x3646ab,_0xf603fd){var _0xdd6271={'method':'GET','uri':_0x52a955+_0x5137('0xd'),'json':!![]};_0xdd6271['headers']=_0xe575f2;logger[_0x5137('0xe')]('Getting\x20user\x20list');return rp(_0xdd6271)[_0x5137('0x10')](function(_0x5d851e){if(_0x5d851e){var _0x2acf2b=_0x5d851e[_0x5137('0x1b')];var _0x321685=![];var _0x21bb1b=null;if(_0xabf11c[_0x5137('0x1c')]!==null){logger[_0x5137('0xe')]('Getting\x20user\x20with\x20email',_0xabf11c['agentEmail']);_0xabf11c[_0x5137('0x1d')]=_0xabf11c[_0x5137('0x1c')];for(_0x21bb1b=0x0;_0x21bb1b<_0x2acf2b['length'];_0x21bb1b++){if(_0x2acf2b[_0x21bb1b][_0x5137('0x12')]===_0xabf11c[_0x5137('0x1c')]){_0x321685=!![];_0xabf11c[_0x5137('0x1e')]=_0x2acf2b[_0x21bb1b]['id'];logger[_0x5137('0xe')](_0x5137('0x1f'),_0xabf11c[_0x5137('0x1e')]);}}}if(!_0x321685){logger[_0x5137('0xe')](_0x5137('0x20'));_0xabf11c[_0x5137('0x1d')]=_0xabf11c['adminEmail'];_0xabf11c[_0x5137('0x1e')]=_0xabf11c[_0x5137('0x14')];_0x321685=!![];}if(_0x321685){_0x3646ab(_0xabf11c);}else{_0xf603fd({'statusCode':0x194,'message':_0x5137('0x16')});}}else{_0xf603fd({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x5137('0x17')](function(_0x24804e){logger[_0x5137('0x18')]('['+[_0x434a6d[_0x5137('0x19')]()]+']',_0x24804e['message']);_0xf603fd(_0x24804e);});});};}function searchContact(_0x37bf68,_0x28d40e,_0x35cfe2,_0x50d968){return new Promise(function(_0x12af2b,_0x54e03b){var _0x500951={'method':_0x5137('0xc'),'headers':_0x28d40e,'uri':_0x37bf68+_0x5137('0x21')+_0x50d968+'&f='+_0x35cfe2+_0x5137('0x22'),'json':!![]};rp(_0x500951)[_0x5137('0x10')](function(_0x11010){var _0x3b7d4b=_['find'](_0x11010['contacts'][_0x5137('0x23')],[_0x35cfe2,_0x50d968]);_0x12af2b(_0x3b7d4b);})[_0x5137('0x17')](function(_0x31dcfb){_0x54e03b(_0x31dcfb);});});}function getEndUser(_0x3e2a31,_0x20ba36,_0x4d3bf7){return function(_0x1ac56d){return new Promise(function(_0x361ffb,_0x20adca){logger[_0x5137('0xe')](util[_0x5137('0x24')](_0x5137('0x25'),_0x1ac56d[_0x5137('0x26')]));searchContact(_0x4d3bf7,_0x20ba36,_0x5137('0x27'),_0x1ac56d[_0x5137('0x26')])[_0x5137('0x10')](function(_0x2cddf0){if(_0x2cddf0){_0x1ac56d[_0x5137('0x28')]=_0x2cddf0['id'];logger[_0x5137('0xe')](_0x5137('0x29'),_0x1ac56d[_0x5137('0x28')]);return _0x361ffb(_0x1ac56d);}searchContact(_0x4d3bf7,_0x20ba36,_0x5137('0x2a'),_0x1ac56d['contactNumber'])[_0x5137('0x10')](function(_0x31c813){if(_0x31c813){_0x1ac56d['endUserId']=_0x31c813['id'];logger['info']('Contact\x20found\x20work_number:',_0x1ac56d[_0x5137('0x28')]);return _0x361ffb(_0x1ac56d);}createEndUser(_0x1ac56d,_0x3e2a31,_0x20ba36,_0x4d3bf7)[_0x5137('0x10')](function(_0x1b4b4e){logger[_0x5137('0xe')](_0x5137('0x2b'),_0x1b4b4e['endUserId']);return _0x361ffb(_0x1b4b4e);});});})['catch'](function(_0xae1166){_0x20adca(_0xae1166);});});};}function createEndUser(_0x2dde3d,_0x2d6ffb,_0x4a1d66,_0x3c9007){return new Promise(function(_0x3cbaf7,_0x3403f2){var _0x1c3e5c=moment();var _0x40cb2f={'method':_0x5137('0x2c'),'uri':_0x3c9007+_0x5137('0x2d'),'body':{'contact':{'last_name':_0x2dde3d[_0x5137('0x26')],'work_number':_0x2dde3d[_0x5137('0x26')],'mobile_number':_0x2dde3d[_0x5137('0x26')],'owner_id':_0x2dde3d[_0x5137('0x1e')],'created_at':_0x1c3e5c[_0x5137('0x24')](_0x5137('0x2e'))}},'json':!![]};_0x40cb2f[_0x5137('0x2f')]=_0x4a1d66;logger['info'](_0x5137('0x30'));return rp(_0x40cb2f)['then'](function(_0x42b611){_0x2dde3d[_0x5137('0x28')]=_0x42b611[_0x5137('0x31')]['id'];_0x3cbaf7(_0x2dde3d);})[_0x5137('0x17')](function(_0x10d492){logger[_0x5137('0x18')]('['+[_0x2d6ffb[_0x5137('0x19')]()]+']',_0x10d492['message']);_0x3403f2(_0x10d492['message']);});});}function getTicket(_0x2c2940,_0x23d5e6,_0x2cd689,_0x49d585,_0x3ee5c1){return function(_0x30444d){logger[_0x5137('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x6a5c3f,_0x4cbe3f){var _0x1b9398=moment();var _0x1fd683={'method':_0x5137('0x2c'),'uri':_0x2cd689+_0x5137('0x32'),'body':{'title':intUtil[_0x5137('0x33')](_0x49d585[_0x5137('0x34')],_0x3ee5c1,'\x20'),'description':intUtil[_0x5137('0x33')](_0x49d585['Descriptions'],_0x3ee5c1,'\x0a'),'owner_id':_0x30444d[_0x5137('0x1e')],'creater_id':_0x30444d['adminId'],'targetable_id':_0x30444d[_0x5137('0x28')],'targetable_type':_0x5137('0x35'),'created_at':_0x1b9398[_0x5137('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b9398[_0x5137('0x36')](0x1e,'m')[_0x5137('0x24')](_0x5137('0x2e'))},'json':!![]};_0x1fd683[_0x5137('0x2f')]=_0x23d5e6;return rp(_0x1fd683)[_0x5137('0x10')](function(_0x400ebd){_0x30444d[_0x5137('0x37')]=_0x400ebd[_0x5137('0x38')]['id'];logger[_0x5137('0xe')](_0x5137('0x39'),_0x30444d[_0x5137('0x37')]);_0x6a5c3f(_0x30444d);})['catch'](function(_0x57d3c9){logger[_0x5137('0x18')]('['+[_0x2c2940[_0x5137('0x19')]()]+']',_0x57d3c9[_0x5137('0x1a')]);_0x4cbe3f(_0x57d3c9['message']);});});};}function emit(_0x3e2105,_0x43d2bd,_0x297fea){var _0x216db7={'uri':_0x3e2105+'/contacts/'+_0x297fea};io['to'](util[_0x5137('0x24')](_0x5137('0x3a'),_0x43d2bd))[_0x5137('0x3b')](_0x5137('0x3c'),_0x216db7);}exports['cs']=function(_0x442143,_0x148222,_0x36515a,_0x5377f1,_0x4dd253,_0x249eac,_0x406a71,_0xd14f5d){var _0x39f873={};var _0x5aa7e1={'Authorization':_0x5137('0x3d')+_0x249eac[_0x5137('0x3e')]};_0x249eac[_0x5137('0x3f')]=intUtil[_0x5137('0x40')](_0x249eac[_0x5137('0x3f')]);_0x249eac[_0x5137('0x41')]=intUtil[_0x5137('0x40')](_0x249eac[_0x5137('0x41')]);var _0x2eac68=_0x249eac['remoteUri'];_0x39f873[_0x5137('0x13')]=_0x249eac[_0x5137('0x42')];_0x39f873['contactNumber']=_0xd14f5d[_0x5137('0x43')]()===_0x5137('0x44')?_0x148222[_0x5137('0x45')]:_0x148222['calleridnum'];_0x39f873[_0x5137('0x46')]=_0xd14f5d===_0x5137('0x47')||_0xd14f5d===_0x5137('0x48')?_0x5137('0x47'):_0x5137('0x44');if(_0x5377f1){_0x39f873['agentEmail']=_0x5377f1[_0x5137('0x12')];}var _0x259eba=util['format'](_0x5137('0x49'),_0x249eac['serverUrl'],_0x148222[_0x5137('0x4a')],md5(_0x148222[_0x5137('0x4a')]));if(_0x4dd253&&_0x4dd253[_0x5137('0x4b')]){logger['info'](_0x5137('0x4c'),_0x5137('0x4d'));_0x148222['recordingURL']=_0x259eba;}else if(_0x406a71&&_0x406a71['recordingFormat']&&_0x406a71['recordingFormat']!=='none'){logger[_0x5137('0xe')]('[OUTBOUND]',_0x5137('0x4d'));_0x148222[_0x5137('0x4e')]=_0x259eba;}else{_0x148222[_0x5137('0x4e')]='';}return getAdminId(_0x39f873,_0xd14f5d,_0x5aa7e1,_0x2eac68)[_0x5137('0x10')](getUser(_0xd14f5d,_0x5aa7e1,_0x2eac68))[_0x5137('0x10')](getEndUser(_0xd14f5d,_0x5aa7e1,_0x2eac68))[_0x5137('0x10')](getTicket(_0xd14f5d,_0x5aa7e1,_0x2eac68,_0x36515a,_0x148222))[_0x5137('0x10')](function(_0x97cb08){logger[_0x5137('0xe')](util[_0x5137('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x97cb08[_0x5137('0x37')]));if(_0xd14f5d!==_0x5137('0x48')){logger[_0x5137('0xe')]('['+[_0xd14f5d[_0x5137('0x19')]()]+']',_0x5137('0x4f'));emit(_0x2eac68,_0x5377f1[_0x5137('0x50')],_0x97cb08[_0x5137('0x28')]);}})[_0x5137('0x17')](function(_0x157ad0){logger['error']('['+[_0xd14f5d['toUpperCase']()]+_0x5137('0x51'),util[_0x5137('0x52')](_0x157ad0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6fbd=['userId','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','Subjects','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','toLowerCase','outbound','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail'];(function(_0x2e49d5,_0x4635b6){var _0x29b739=function(_0x399442){while(--_0x399442){_0x2e49d5['push'](_0x2e49d5['shift']());}};_0x29b739(++_0x4635b6);}(_0x6fbd,0xe3));var _0xd6fb=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x6fbd[_0x4cce65];return _0x4d1b45;};'use strict';var _=require(_0xd6fb('0x0'));var rp=require(_0xd6fb('0x1'));var md5=require('md5');var util=require(_0xd6fb('0x2'));var moment=require('moment');var Promise=require(_0xd6fb('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd6fb('0x4'));var config=require(_0xd6fb('0x5'));var logger=require(_0xd6fb('0x6'))(_0xd6fb('0x7'));config[_0xd6fb('0x8')]=_[_0xd6fb('0x9')](config[_0xd6fb('0x8')],{'host':_0xd6fb('0xa'),'port':0x18eb});var io=require(_0xd6fb('0xb'))(new Redis(config[_0xd6fb('0x8')]));function getAdminId(_0x2e0ba2,_0x35a78c,_0x52f76e,_0x1982a0){return new Promise(function(_0x360f24,_0x5ba57a){var _0x543ac4=![];var _0x40d519={'method':'GET','uri':_0x1982a0+_0xd6fb('0xc'),'json':!![]};_0x40d519[_0xd6fb('0xd')]=_0x52f76e;logger[_0xd6fb('0xe')](_0xd6fb('0xf'));return rp(_0x40d519)[_0xd6fb('0x10')](function(_0x9b2339){if(_0x9b2339){var _0x32cad6=_0x9b2339[_0xd6fb('0x11')];var _0x5c7934=null;for(_0x5c7934=0x0;_0x5c7934<_0x32cad6[_0xd6fb('0x12')];_0x5c7934++){if(_0x32cad6[_0x5c7934][_0xd6fb('0x13')]===_0x2e0ba2['adminEmail']){_0x2e0ba2[_0xd6fb('0x14')]=_0x32cad6[_0x5c7934]['id'];_0x543ac4=!![];}}if(_0x543ac4){logger[_0xd6fb('0xe')](_0xd6fb('0x15'),_0x2e0ba2[_0xd6fb('0x14')]);_0x360f24(_0x2e0ba2);}else{_0x5ba57a({'statusCode':0x194,'message':_0xd6fb('0x16')});}}else{_0x5ba57a({'statusCode':0x194,'message':_0xd6fb('0x16')});}})[_0xd6fb('0x17')](function(_0x35ba45){logger['error']('['+[_0x35a78c[_0xd6fb('0x18')]()]+']',_0x35ba45[_0xd6fb('0x19')]);_0x5ba57a(_0x35ba45);});});}function getUser(_0x234cf0,_0x2a98a3,_0x3adacc){return function(_0x3a9944){return new Promise(function(_0xdf83c2,_0x497ff2){var _0x515663={'method':_0xd6fb('0x1a'),'uri':_0x3adacc+_0xd6fb('0xc'),'json':!![]};_0x515663[_0xd6fb('0xd')]=_0x2a98a3;logger[_0xd6fb('0xe')](_0xd6fb('0x1b'));return rp(_0x515663)['then'](function(_0x3aea8a){if(_0x3aea8a){var _0x3e3367=_0x3aea8a[_0xd6fb('0x11')];var _0x19bc2d=![];var _0x2ca38e=null;if(_0x3a9944[_0xd6fb('0x1c')]!==null){logger[_0xd6fb('0xe')](_0xd6fb('0x1d'),_0x3a9944[_0xd6fb('0x1c')]);_0x3a9944[_0xd6fb('0x1e')]=_0x3a9944[_0xd6fb('0x1c')];for(_0x2ca38e=0x0;_0x2ca38e<_0x3e3367[_0xd6fb('0x12')];_0x2ca38e++){if(_0x3e3367[_0x2ca38e]['email']===_0x3a9944[_0xd6fb('0x1c')]){_0x19bc2d=!![];_0x3a9944[_0xd6fb('0x1f')]=_0x3e3367[_0x2ca38e]['id'];logger[_0xd6fb('0xe')]('User\x20found:',_0x3a9944['userId']);}}}if(!_0x19bc2d){logger[_0xd6fb('0xe')](_0xd6fb('0x20'));_0x3a9944['userEmail']=_0x3a9944['adminEmail'];_0x3a9944[_0xd6fb('0x1f')]=_0x3a9944[_0xd6fb('0x14')];_0x19bc2d=!![];}if(_0x19bc2d){_0xdf83c2(_0x3a9944);}else{_0x497ff2({'statusCode':0x194,'message':_0xd6fb('0x16')});}}else{_0x497ff2({'statusCode':0x194,'message':_0xd6fb('0x16')});}})[_0xd6fb('0x17')](function(_0x1b9314){logger[_0xd6fb('0x21')]('['+[_0x234cf0[_0xd6fb('0x18')]()]+']',_0x1b9314[_0xd6fb('0x19')]);_0x497ff2(_0x1b9314);});});};}function searchContact(_0x2799f6,_0x5bcc7c,_0x4ba39e,_0x69d831){return new Promise(function(_0x5eeaab,_0x13b32d){var _0xffb3b7={'method':_0xd6fb('0x1a'),'headers':_0x5bcc7c,'uri':_0x2799f6+_0xd6fb('0x22')+_0x69d831+_0xd6fb('0x23')+_0x4ba39e+_0xd6fb('0x24'),'json':!![]};rp(_0xffb3b7)[_0xd6fb('0x10')](function(_0x18445b){var _0x56a0a8=_[_0xd6fb('0x25')](_0x18445b['contacts']['contacts'],[_0x4ba39e,_0x69d831]);_0x5eeaab(_0x56a0a8);})[_0xd6fb('0x17')](function(_0x13dc13){_0x13b32d(_0x13dc13);});});}function getEndUser(_0x4ca584,_0x1f644a,_0x229ae5){return function(_0x3e0a63){return new Promise(function(_0x22222e,_0x2d8768){logger['info'](util[_0xd6fb('0x26')](_0xd6fb('0x27'),_0x3e0a63[_0xd6fb('0x28')]));searchContact(_0x229ae5,_0x1f644a,_0xd6fb('0x29'),_0x3e0a63[_0xd6fb('0x28')])[_0xd6fb('0x10')](function(_0x46ed92){if(_0x46ed92){_0x3e0a63['endUserId']=_0x46ed92['id'];logger[_0xd6fb('0xe')](_0xd6fb('0x2a'),_0x3e0a63['endUserId']);return _0x22222e(_0x3e0a63);}searchContact(_0x229ae5,_0x1f644a,_0xd6fb('0x2b'),_0x3e0a63['contactNumber'])[_0xd6fb('0x10')](function(_0x5d930a){if(_0x5d930a){_0x3e0a63[_0xd6fb('0x2c')]=_0x5d930a['id'];logger[_0xd6fb('0xe')](_0xd6fb('0x2d'),_0x3e0a63[_0xd6fb('0x2c')]);return _0x22222e(_0x3e0a63);}createEndUser(_0x3e0a63,_0x4ca584,_0x1f644a,_0x229ae5)[_0xd6fb('0x10')](function(_0x5f4f3a){logger[_0xd6fb('0xe')](_0xd6fb('0x2e'),_0x5f4f3a['endUserId']);return _0x22222e(_0x5f4f3a);});});})[_0xd6fb('0x17')](function(_0x495223){_0x2d8768(_0x495223);});});};}function createEndUser(_0x21bc28,_0x91872b,_0x49eab4,_0x1ef92e){return new Promise(function(_0x139b3e,_0x141bfa){var _0x1342c2=moment();var _0x2eab22={'method':_0xd6fb('0x2f'),'uri':_0x1ef92e+_0xd6fb('0x30'),'body':{'contact':{'last_name':_0x21bc28['contactNumber'],'work_number':_0x21bc28['contactNumber'],'mobile_number':_0x21bc28[_0xd6fb('0x28')],'owner_id':_0x21bc28[_0xd6fb('0x1f')],'created_at':_0x1342c2[_0xd6fb('0x26')](_0xd6fb('0x31'))}},'json':!![]};_0x2eab22[_0xd6fb('0xd')]=_0x49eab4;logger[_0xd6fb('0xe')](_0xd6fb('0x32'));return rp(_0x2eab22)[_0xd6fb('0x10')](function(_0x320119){_0x21bc28[_0xd6fb('0x2c')]=_0x320119['contact']['id'];_0x139b3e(_0x21bc28);})[_0xd6fb('0x17')](function(_0x5ca792){logger[_0xd6fb('0x21')]('['+[_0x91872b['toUpperCase']()]+']',_0x5ca792[_0xd6fb('0x19')]);_0x141bfa(_0x5ca792[_0xd6fb('0x19')]);});});}function getTicket(_0x15255e,_0x55eb57,_0x457f52,_0x8b30f4,_0x51e5b9){return function(_0x1e5c91){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x335eef,_0x3b6827){var _0x4f015e=moment();var _0x3a6869={'method':_0xd6fb('0x2f'),'uri':_0x457f52+_0xd6fb('0x33'),'body':{'title':intUtil['getString'](_0x8b30f4[_0xd6fb('0x34')],_0x51e5b9,'\x20'),'description':intUtil[_0xd6fb('0x35')](_0x8b30f4[_0xd6fb('0x36')],_0x51e5b9,'\x0a'),'owner_id':_0x1e5c91[_0xd6fb('0x1f')],'creater_id':_0x1e5c91[_0xd6fb('0x14')],'targetable_id':_0x1e5c91[_0xd6fb('0x2c')],'targetable_type':_0xd6fb('0x37'),'created_at':_0x4f015e[_0xd6fb('0x26')](_0xd6fb('0x31')),'due_date':_0x4f015e[_0xd6fb('0x38')](0x1e,'m')['format'](_0xd6fb('0x31'))},'json':!![]};_0x3a6869['headers']=_0x55eb57;return rp(_0x3a6869)['then'](function(_0x5da1e0){_0x1e5c91[_0xd6fb('0x39')]=_0x5da1e0[_0xd6fb('0x3a')]['id'];logger[_0xd6fb('0xe')](_0xd6fb('0x3b'),_0x1e5c91['ticketId']);_0x335eef(_0x1e5c91);})[_0xd6fb('0x17')](function(_0x3ad051){logger[_0xd6fb('0x21')]('['+[_0x15255e[_0xd6fb('0x18')]()]+']',_0x3ad051[_0xd6fb('0x19')]);_0x3b6827(_0x3ad051['message']);});});};}function emit(_0x487299,_0x5afd14,_0x169119){var _0xc57d96={'uri':_0x487299+'/contacts/'+_0x169119};io['to'](util[_0xd6fb('0x26')](_0xd6fb('0x3c'),_0x5afd14))[_0xd6fb('0x3d')](_0xd6fb('0x3e'),_0xc57d96);}exports['cs']=function(_0x493535,_0x55a74b,_0x9ab4e4,_0x6fb234,_0x11ea24,_0x31834e,_0x4e2b5f,_0x487b5e){var _0x432558={};var _0x1495d7={'Authorization':_0xd6fb('0x3f')+_0x31834e[_0xd6fb('0x40')]};_0x31834e[_0xd6fb('0x41')]=intUtil[_0xd6fb('0x42')](_0x31834e[_0xd6fb('0x41')]);_0x31834e[_0xd6fb('0x43')]=intUtil[_0xd6fb('0x42')](_0x31834e[_0xd6fb('0x43')]);var _0x41e962=_0x31834e[_0xd6fb('0x41')];_0x432558[_0xd6fb('0x44')]=_0x31834e['username'];_0x432558[_0xd6fb('0x28')]=_0x487b5e[_0xd6fb('0x45')]()===_0xd6fb('0x46')?_0x55a74b['destcalleridnum']:_0x55a74b[_0xd6fb('0x47')];_0x432558[_0xd6fb('0x48')]=_0x487b5e==='queue'||_0x487b5e===_0xd6fb('0x49')?'queue':_0xd6fb('0x46');if(_0x6fb234){_0x432558[_0xd6fb('0x1c')]=_0x6fb234[_0xd6fb('0x13')];}var _0x15da36=util[_0xd6fb('0x26')](_0xd6fb('0x4a'),_0x31834e[_0xd6fb('0x43')],_0x55a74b[_0xd6fb('0x4b')],md5(_0x55a74b[_0xd6fb('0x4b')]));if(_0x11ea24&&_0x11ea24[_0xd6fb('0x4c')]){logger['info'](_0xd6fb('0x4d'),_0xd6fb('0x4e'));_0x55a74b[_0xd6fb('0x4f')]=_0x15da36;}else if(_0x4e2b5f&&_0x4e2b5f[_0xd6fb('0x50')]&&_0x4e2b5f[_0xd6fb('0x50')]!=='none'){logger['info'](_0xd6fb('0x51'),_0xd6fb('0x4e'));_0x55a74b[_0xd6fb('0x4f')]=_0x15da36;}else{_0x55a74b['recordingURL']='';}return getAdminId(_0x432558,_0x487b5e,_0x1495d7,_0x41e962)['then'](getUser(_0x487b5e,_0x1495d7,_0x41e962))[_0xd6fb('0x10')](getEndUser(_0x487b5e,_0x1495d7,_0x41e962))['then'](getTicket(_0x487b5e,_0x1495d7,_0x41e962,_0x9ab4e4,_0x55a74b))[_0xd6fb('0x10')](function(_0x252cd7){logger[_0xd6fb('0xe')](util[_0xd6fb('0x26')](_0xd6fb('0x52'),_0x252cd7[_0xd6fb('0x39')]));if(_0x487b5e!==_0xd6fb('0x49')){logger[_0xd6fb('0xe')]('['+[_0x487b5e['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x41e962,_0x6fb234[_0xd6fb('0x53')],_0x252cd7[_0xd6fb('0x2c')]);}})[_0xd6fb('0x17')](function(_0x4c804){logger[_0xd6fb('0x21')]('['+[_0x487b5e[_0xd6fb('0x18')]()]+_0xd6fb('0x54'),util[_0xd6fb('0x55')](_0x4c804,{'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 583efe1..2789e35 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 _0x32a3=['routeId','EVENT\x20UNKNOWN','unmanaged','salesforce','log','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue'];(function(_0x49fe8d,_0x44ab0f){var _0x23e887=function(_0x5b5ca1){while(--_0x5b5ca1){_0x49fe8d['push'](_0x49fe8d['shift']());}};_0x23e887(++_0x44ab0f);}(_0x32a3,0xb9));var _0x332a=function(_0x1768f6,_0x153a7d){_0x1768f6=_0x1768f6-0x0;var _0xf1ab5f=_0x32a3[_0x1768f6];return _0xf1ab5f;};'use strict';var _=require('lodash');var util=require(_0x332a('0x0'));var zendesk=require(_0x332a('0x1'));var salesforce=require(_0x332a('0x2'));var sugarcrm=require(_0x332a('0x3'));var freshdesk=require(_0x332a('0x4'));var zoho=require('./zoho');var desk=require(_0x332a('0x5'));var vtiger=require(_0x332a('0x6'));var servicenow=require(_0x332a('0x7'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x332a('0x8'),'salesforce',_0x332a('0x9'),_0x332a('0xa'),_0x332a('0xb'),_0x332a('0xc'),_0x332a('0xd'),_0x332a('0xe'),_0x332a('0xf'),_0x332a('0x10')];exports[_0x332a('0x11')]=function(_0x3cd836,_0x2e9eee,_0x4757f1,_0x2e8d66,_0x1b60fc,_0x15f7f2){if(_0x4757f1){if(_[_0x332a('0x12')](integrations,_0x3cd836[_0x332a('0x13')]['toLowerCase']())){try{var _0x538d52=null;var _0x487887='';var _0x53c5a2=_0x4757f1[_0x3cd836['data1'][_0x332a('0x14')]()];if(_0x53c5a2){var _0x381585=_0x53c5a2[_0x3cd836[_0x332a('0x15')]];if(_0x381585){var _0x5ac758=_[_0x332a('0x16')](_0x381585[_0x332a('0x17')],{'id':parseInt(_0x3cd836['data3'],0xa)});if(_0x5ac758){if(_0x2e8d66){if(_0x1b60fc&&_0x2e9eee[_0x332a('0x18')]){_0x487887='queue';}else if(_0x2e9eee[_0x332a('0x19')]){_0x487887='outbound';}else{console['log'](_0x332a('0x1a'),_0x2e9eee);}}else{_0x487887=_0x332a('0x1b');}switch(_0x3cd836[_0x332a('0x13')][_0x332a('0x14')]()){case _0x332a('0x8'):zendesk[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0x1c'):salesforce[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0x9'):sugarcrm[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0xa'):freshdesk[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0xb'):zoho[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0xc'):desk[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0xd'):vtiger[_0x487887](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2);break;case _0x332a('0xf'):freshsales['cs'](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2,_0x487887);break;case'servicenow':servicenow['cs'](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2,_0x487887);break;case'dynamics365':dynamics365['cs'](_0x3cd836,_0x2e9eee,_0x5ac758,_0x2e8d66,_0x1b60fc,_0x381585,_0x15f7f2,_0x487887);break;default:console[_0x332a('0x1d')](_0x332a('0x1e'));}}else{_0x538d52=require('../../../../config/logger')(_0x3cd836['data1']['toLowerCase']());_0x538d52[_0x332a('0x1f')](_0x332a('0x20'),util[_0x332a('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3cd836[_0x332a('0x13')]['toLowerCase'](),_0x3cd836['data3']));}}else{_0x538d52=require(_0x332a('0x22'))(_0x3cd836['data1'][_0x332a('0x14')]());_0x538d52[_0x332a('0x1f')](_0x332a('0x20'),util[_0x332a('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x3cd836[_0x332a('0x13')][_0x332a('0x14')](),_0x3cd836['data2']));}}else{}}catch(_0x29f8df){console['error'](_0x29f8df);}}}}; \ No newline at end of file +var _0x4969=['./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','freshsales','servicenow','exec','includes','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','freshdesk','vtiger','unknown\x20integration','data1','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365'];(function(_0x1c6045,_0x46d59f){var _0x257e28=function(_0x3b64d4){while(--_0x3b64d4){_0x1c6045['push'](_0x1c6045['shift']());}};_0x257e28(++_0x46d59f);}(_0x4969,0x69));var _0x9496=function(_0x53d9a7,_0x44c4a3){_0x53d9a7=_0x53d9a7-0x0;var _0x1c8958=_0x4969[_0x53d9a7];return _0x1c8958;};'use strict';var _=require(_0x9496('0x0'));var util=require('util');var zendesk=require(_0x9496('0x1'));var salesforce=require(_0x9496('0x2'));var sugarcrm=require(_0x9496('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x9496('0x4'));var desk=require(_0x9496('0x5'));var vtiger=require(_0x9496('0x6'));var servicenow=require(_0x9496('0x7'));var dynamics365=require(_0x9496('0x8'));var freshsales=require(_0x9496('0x9'));var integrations=[_0x9496('0xa'),_0x9496('0xb'),_0x9496('0xc'),'freshdesk',_0x9496('0xd'),_0x9496('0xe'),'vtiger','dynamics365',_0x9496('0xf'),_0x9496('0x10')];exports[_0x9496('0x11')]=function(_0x517763,_0x1f55ca,_0x575f5c,_0x33347f,_0x4d68e9,_0x2a5cb8){if(_0x575f5c){if(_[_0x9496('0x12')](integrations,_0x517763['data1']['toLowerCase']())){try{var _0x34f7ca=null;var _0x255cc6='';var _0x3fb93f=_0x575f5c[_0x517763['data1'][_0x9496('0x13')]()];if(_0x3fb93f){var _0x23a6cb=_0x3fb93f[_0x517763[_0x9496('0x14')]];if(_0x23a6cb){var _0x5daf75=_[_0x9496('0x15')](_0x23a6cb[_0x9496('0x16')],{'id':parseInt(_0x517763[_0x9496('0x17')],0xa)});if(_0x5daf75){if(_0x33347f){if(_0x4d68e9&&_0x1f55ca[_0x9496('0x18')]){_0x255cc6=_0x9496('0x18');}else if(_0x1f55ca['routeId']){_0x255cc6=_0x9496('0x19');}else{console[_0x9496('0x1a')](_0x9496('0x1b'),_0x1f55ca);}}else{_0x255cc6='unmanaged';}switch(_0x517763['data1'][_0x9496('0x13')]()){case _0x9496('0xa'):zendesk[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0xb'):salesforce[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case'sugarcrm':sugarcrm[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0x1c'):freshdesk[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0xd'):zoho[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0xe'):desk[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0x1d'):vtiger[_0x255cc6](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8);break;case _0x9496('0xf'):freshsales['cs'](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8,_0x255cc6);break;case _0x9496('0x10'):servicenow['cs'](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8,_0x255cc6);break;case'dynamics365':dynamics365['cs'](_0x517763,_0x1f55ca,_0x5daf75,_0x33347f,_0x4d68e9,_0x23a6cb,_0x2a5cb8,_0x255cc6);break;default:console[_0x9496('0x1a')](_0x9496('0x1e'));}}else{_0x34f7ca=require('../../../../config/logger')(_0x517763[_0x9496('0x1f')][_0x9496('0x13')]());_0x34f7ca[_0x9496('0x20')](_0x9496('0x21'),util[_0x9496('0x22')](_0x9496('0x23'),_0x517763[_0x9496('0x1f')][_0x9496('0x13')](),_0x517763[_0x9496('0x17')]));}}else{_0x34f7ca=require(_0x9496('0x24'))(_0x517763['data1'][_0x9496('0x13')]());_0x34f7ca[_0x9496('0x20')]('[EXEC]',util[_0x9496('0x22')](_0x9496('0x25'),_0x517763[_0x9496('0x1f')]['toLowerCase'](),_0x517763[_0x9496('0x14')]));}}else{}}catch(_0x4c0853){console['error'](_0x4c0853);}}}}; \ 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 be0cb26..6dd23aa 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 _0x19d2=['execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','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.','format','Caller\x20-\x20%s','lead','','Company','No\x20Company','upperFirst','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','catch','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','emit','assign','getString','Descriptions','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhatId','ticketType','Case','ContactId','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find'];(function(_0x3e2baa,_0x507e45){var _0x266f61=function(_0x168259){while(--_0x168259){_0x3e2baa['push'](_0x3e2baa['shift']());}};_0x266f61(++_0x507e45);}(_0x19d2,0x1ec));var _0x219d=function(_0x2b2c09,_0x35ef00){_0x2b2c09=_0x2b2c09-0x0;var _0x5c0db8=_0x19d2[_0x2b2c09];return _0x5c0db8;};'use strict';var _=require('lodash');var rp=require(_0x219d('0x0'));var moment=require(_0x219d('0x1'));var BPromise=require(_0x219d('0x2'));var md5=require(_0x219d('0x3'));var jsforce=require(_0x219d('0x4'));var util=require(_0x219d('0x5'));var Redis=require(_0x219d('0x6'));var intUtil=require(_0x219d('0x7'));var config=require(_0x219d('0x8'));var logger=require(_0x219d('0x9'))(_0x219d('0xa'));config[_0x219d('0xb')]=_['defaults'](config[_0x219d('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x219d('0xc'))(new Redis(config['redis']));function emit(_0x1b695f,_0x20f5be,_0x461d35){io['to'](_0x1b695f)[_0x219d('0xd')](_0x20f5be,_0x461d35);}function getTicket(_0x287ee8,_0x427d1c,_0x12d21a,_0x2f40e6,_0x437c12,_0x2b427e,_0x4b2c01,_0x17abc7){var _0x122742=Object[_0x219d('0xe')]({},{'OwnerId':_0x427d1c['id'],'Subject':intUtil[_0x219d('0xf')](_0x2f40e6['Subjects'],_0x437c12,'\x20'),'Description':intUtil['getString'](_0x2f40e6[_0x219d('0x10')],_0x437c12,'\x0a')},getCustomFields(_0x2b427e,_0x437c12));if(_0x12d21a){if(_0x2f40e6['ticketType']==='Task'){_0x122742[_0x219d('0x11')]=moment['utc']();_0x122742[_0x219d('0x12')]=![];_0x122742[_0x219d('0x13')]=![];if(_0x12d21a[_0x219d('0x14')]===_0x219d('0x15')||_0x12d21a[_0x219d('0x14')]==='lead'){_0x122742['WhoId']=_0x12d21a['id'];}else if(_0x12d21a[_0x219d('0x14')]==='account'){_0x122742[_0x219d('0x16')]=_0x12d21a['id'];}}else if(_0x2f40e6[_0x219d('0x17')]===_0x219d('0x18')){if(_0x12d21a[_0x219d('0x14')]===_0x219d('0x15')){_0x122742[_0x219d('0x19')]=_0x12d21a['id'];}else if(_0x12d21a[_0x219d('0x14')]===_0x219d('0x1a')){_0x122742['AccountId']=_0x12d21a['id'];}else if(_0x12d21a['endUserType']==='lead'&&_0x2f40e6[_0x219d('0x1b')]){_0x122742[_0x2f40e6[_0x219d('0x1b')]]=_0x12d21a['id'];}else{logger[_0x219d('0x1c')](_0x219d('0x1d'));}}}return _0x4b2c01[_0x219d('0x1e')](_0x2f40e6[_0x219d('0x17')])[_0x219d('0x1f')](_0x122742);}function getUser(_0x15fb5c,_0x15e471,_0xcdebda){if(!_[_0x219d('0x20')](_0x15e471)&&intUtil[_0x219d('0x21')](_0x15e471)){var _0x3a0b59={'Email':_0x15e471};var _0x1ca1f5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xcdebda['sobject'](_0x219d('0x22'))[_0x219d('0x23')](_0x3a0b59,_0x1ca1f5)[_0x219d('0x24')]()[_0x219d('0x25')](function(_0x11eea0){if(_0x11eea0[_0x219d('0x26')]){var _0x366298=_['find'](_0x11eea0,function(_0x4bb53a){return _0x4bb53a[_0x219d('0x27')]===_0x15e471;});if(_0x366298){logger[_0x219d('0x1c')](_0x219d('0x28'),_0x15e471);return BPromise[_0x219d('0x29')]({'id':_0x366298['Id'],'name':_0x366298[_0x219d('0x2a')]});}}else{logger[_0x219d('0x1c')](_0x219d('0x2b'),_0x15e471);return _0xcdebda[_0x219d('0x2c')]()[_0x219d('0x25')](function(_0x23c319){return BPromise[_0x219d('0x29')]({'id':_0x23c319[_0x219d('0x2d')],'name':_0x23c319[_0x219d('0x2e')]});});}});}else{logger[_0x219d('0x1c')](_0x219d('0x2b'),_0x15e471);return _0xcdebda[_0x219d('0x2c')]()[_0x219d('0x25')](function(_0x5097af){return BPromise[_0x219d('0x29')]({'id':_0x5097af[_0x219d('0x2d')],'name':_0x5097af['display_name']});});}}function getEndUser(_0x4fe8d6,_0x4c0acc,_0x5cb00c,_0x2bb415,_0x2f0274){var _0x5b05ee={'$or':{'Phone':_0x2bb415}};var _0x26e1a8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x219d('0x29')]()['then'](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x2bb415,_0x4c0acc['moduleSearch']);switch(_0x4c0acc[_0x219d('0x2f')]){case _0x219d('0x30'):var _0x2eeb02=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc[_0x219d('0x32')]){var _0x3ead2a={};_0x3ead2a[_0x4c0acc[_0x219d('0x32')]]=_0x2bb415;_[_0x219d('0x33')](_0x2eeb02[_0x219d('0x34')],_0x3ead2a);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x35'))[_0x219d('0x23')](_0x2eeb02,_0x26e1a8)[_0x219d('0x24')]()[_0x219d('0x25')](function(_0x46117e){if(_0x46117e&&_0x46117e[_0x219d('0x26')]){return _0x46117e;}else{var _0x2d11eb=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc[_0x219d('0x36')]){var _0x4c3462={};_0x4c3462[_0x4c0acc['additionalSearchLead']]=_0x2bb415;_['merge'](_0x2d11eb[_0x219d('0x34')],_0x4c3462);}return _0x2f0274['sobject'](_0x219d('0x37'))[_0x219d('0x23')](_0x2d11eb,_0x26e1a8);}});case _0x219d('0x38'):var _0x3ad71f=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc[_0x219d('0x39')]){var _0x3ead2a={};_0x3ead2a[_0x4c0acc[_0x219d('0x39')]]=_0x2bb415;_[_0x219d('0x33')](_0x3ad71f[_0x219d('0x34')],_0x3ead2a);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x3a'))[_0x219d('0x23')](_0x3ad71f,_0x26e1a8)[_0x219d('0x24')]()['then'](function(_0x184079){if(_0x184079&&_0x184079[_0x219d('0x26')]){return _0x184079;}else{var _0x3a3862=_['cloneDeep'](_0x5b05ee);if(_0x4c0acc[_0x219d('0x32')]){var _0x11e1c0={};_0x11e1c0[_0x4c0acc['additionalSearchContact']]=_0x2bb415;_[_0x219d('0x33')](_0x3a3862[_0x219d('0x34')],_0x11e1c0);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x35'))['find'](_0x3a3862,_0x26e1a8)[_0x219d('0x25')](function(_0x32c727){if(_0x32c727&&_0x32c727['length']){return _0x32c727;}else{var _0x2e9181=_['cloneDeep'](_0x5b05ee);if(_0x4c0acc[_0x219d('0x36')]){var _0x3ff7ce={};_0x3ff7ce[_0x4c0acc['additionalSearchLead']]=_0x2bb415;_['merge'](_0x2e9181[_0x219d('0x34')],_0x3ff7ce);}return _0x2f0274[_0x219d('0x1e')]('Lead')[_0x219d('0x23')](_0x2e9181,_0x26e1a8);}});}});case'contact':var _0x2eeb02=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc['additionalSearchContact']){var _0x3ead2a={};_0x3ead2a[_0x4c0acc[_0x219d('0x32')]]=_0x2bb415;_[_0x219d('0x33')](_0x2eeb02[_0x219d('0x34')],_0x3ead2a);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x35'))[_0x219d('0x23')](_0x2eeb02,_0x26e1a8)[_0x219d('0x24')]();case'lead':var _0xf8bfe0=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc[_0x219d('0x36')]){var _0x3ead2a={};_0x3ead2a[_0x4c0acc[_0x219d('0x36')]]=_0x2bb415;_[_0x219d('0x33')](_0xf8bfe0[_0x219d('0x34')],_0x3ead2a);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x37'))['find'](_0xf8bfe0,_0x26e1a8);case _0x219d('0x1a'):var _0x3ad71f=_[_0x219d('0x31')](_0x5b05ee);if(_0x4c0acc[_0x219d('0x39')]){var _0x3ead2a={};_0x3ead2a[_0x4c0acc['additionalSearchAccount']]=_0x2bb415;_['merge'](_0x3ad71f[_0x219d('0x34')],_0x3ead2a);}return _0x2f0274[_0x219d('0x1e')](_0x219d('0x3a'))[_0x219d('0x23')](_0x3ad71f,_0x26e1a8);default:return null;}})[_0x219d('0x25')](function(_0xd7f722){if(_0xd7f722&&_0xd7f722['length']){var _0x248363=_[_0x219d('0x3b')](_0xd7f722);if(_0x248363){return BPromise[_0x219d('0x29')]({'id':_0x248363['Id'],'name':_0x248363['Name'],'phone':_0x248363['Phone'],'endUserType':_0x248363[_0x219d('0x3c')]['type'][_0x219d('0x3d')]()});}}})[_0x219d('0x25')](function(_0x472032){if(_0x472032){logger[_0x219d('0x1c')](_0x219d('0x3e'),_0x472032[_0x219d('0x14')],_0x2bb415);return BPromise['resolve'](_0x472032);}else{logger['info'](_0x219d('0x3f'),_0x2bb415);var _0x1b4643={'Phone':_0x2bb415};if(_0x4c0acc[_0x219d('0x40')]){if(_0x4c0acc[_0x219d('0x40')]===_0x219d('0x15')){logger[_0x219d('0x1c')](_0x219d('0x41'),_0x2bb415,_0x4c0acc[_0x219d('0x40')]);_0x1b4643['LastName']=_0x5cb00c!==''?_0x5cb00c:util[_0x219d('0x42')](_0x219d('0x43'),_0x2bb415);}else if(_0x4c0acc[_0x219d('0x40')]===_0x219d('0x44')){logger[_0x219d('0x1c')](_0x219d('0x41'),_0x2bb415,_0x4c0acc['moduleCreate']);_0x1b4643['LastName']=_0x5cb00c!==_0x219d('0x45')?_0x5cb00c:util[_0x219d('0x42')](_0x219d('0x43'),_0x2bb415);_0x1b4643[_0x219d('0x46')]=_0x219d('0x47');}else if(_0x4c0acc[_0x219d('0x40')]===_0x219d('0x1a')){logger[_0x219d('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2bb415,_0x4c0acc[_0x219d('0x40')]);_0x1b4643[_0x219d('0x2a')]=_0x5cb00c!==_0x219d('0x45')?_0x5cb00c:util[_0x219d('0x42')](_0x219d('0x43'),_0x2bb415);}else{return null;}}return _0x2f0274[_0x219d('0x1e')](_[_0x219d('0x48')](_0x4c0acc[_0x219d('0x40')]))[_0x219d('0x1f')](_0x1b4643)['then'](function(_0x5d2fc4){return BPromise[_0x219d('0x29')]({'id':_0x5d2fc4['id'],'endUserType':_0x4c0acc[_0x219d('0x40')]});});}});}function getCustomFields(_0xe823a9,_0x27cf7b){var _0x1a0fa1={};if(_0xe823a9['length']>0x0){_[_0x219d('0x49')](_0xe823a9,function(_0xd436e7){if(_['includes']([_0x219d('0x4a'),_0x219d('0x4b')],_0xd436e7[_0x219d('0x4c')])&&_0xd436e7['idField']){_0x1a0fa1[_0xd436e7[_0x219d('0x4d')]]=_0xd436e7[_0x219d('0x4e')][_0x219d('0x4f')]();}else if(_0xd436e7[_0x219d('0x4c')]===_0x219d('0x50')&&_0xd436e7[_0x219d('0x51')]&&_0xd436e7[_0x219d('0x4d')]){_0x27cf7b[_0xd436e7['variableName']]&&(_0x1a0fa1[_0xd436e7[_0x219d('0x4d')]]=_0x27cf7b[_0xd436e7[_0x219d('0x51')]]['toString']());}else if(_0xd436e7[_0x219d('0x4c')]===_0x219d('0x52')&&_0xd436e7[_0x219d('0x53')]&&_0xd436e7[_0x219d('0x53')][_0x219d('0x54')]&&_0xd436e7[_0x219d('0x4d')]){_0x27cf7b[_0xd436e7['Variable']['name'][_0x219d('0x3d')]()]&&(_0x1a0fa1[_0xd436e7['idField']]=_0x27cf7b[_0xd436e7[_0x219d('0x53')][_0x219d('0x54')]['toLowerCase']()][_0x219d('0x4f')]());}});}return _0x1a0fa1;}function getConnection(_0x2e680d){var _0x18b5d9=_0x2e680d[_0x219d('0x55')][_0x219d('0x56')](_0x2e680d[_0x219d('0x57')]);var _0x3614be=new jsforce[(_0x219d('0x58'))]({'oauth2':{'loginUrl':_0x2e680d[_0x219d('0x59')]||_0x219d('0x5a'),'clientId':_0x2e680d[_0x219d('0x5b')],'clientSecret':_0x2e680d[_0x219d('0x5c')]}});return _0x3614be[_0x219d('0x5d')](_0x2e680d[_0x219d('0x5e')],_0x18b5d9)[_0x219d('0x25')](function(){logger['info'](_0x219d('0x5f'));return _0x3614be;});}exports[_0x219d('0x60')]=function(_0x1f1c52,_0x5962e9,_0x39cbb7,_0x11935c,_0x5a17e4,_0xd3c373){var _0x1f6211,_0x346680,_0x498c87,_0x28f3a3;_0xd3c373[_0x219d('0x61')]=intUtil[_0x219d('0x62')](_0xd3c373['serverUrl']);_0xd3c373[_0x219d('0x59')]=intUtil[_0x219d('0x62')](_0xd3c373['remoteUri']);if(_0x5a17e4&&_0x5a17e4[_0x219d('0x63')]){logger['info'](_0x219d('0x64'),_0x219d('0x65'));_0x5962e9['recordingURL']=util[_0x219d('0x42')](_0x219d('0x66'),_0xd3c373['serverUrl'],_0x5962e9[_0x219d('0x67')],md5(_0x5962e9[_0x219d('0x67')]));}else{_0x5962e9[_0x219d('0x68')]='';}return getConnection(_0xd3c373)[_0x219d('0x25')](function(_0x229836){_0x28f3a3=_0x229836;return getUser(_0xd3c373,_0x11935c[_0x219d('0x69')],_0x28f3a3);})[_0x219d('0x25')](function(_0x518814){_0x1f6211=_0x518814;return getEndUser(_0xd3c373,_0x39cbb7,_0x5962e9[_0x219d('0x6a')],_0x5962e9[_0x219d('0x6b')],_0x28f3a3);})[_0x219d('0x25')](function(_0x1c9b0e){_0x346680=_0x1c9b0e;return getTicket(_0xd3c373,_0x1f6211,_0x346680,_0x39cbb7,_0x5962e9,_0x39cbb7[_0x219d('0x6c')],_0x28f3a3,'queue');})[_0x219d('0x25')](function(_0x3ab732){_0x498c87=_0x3ab732;logger[_0x219d('0x1c')](_0x219d('0x6d'),_0x498c87['id']);logger[_0x219d('0x1c')](_0x219d('0x6e'),_0x498c87['id'],_0x11935c[_0x219d('0x54')],_0xd3c373[_0x219d('0x4c')]);switch(_0xd3c373[_0x219d('0x4c')]){case _0x219d('0x6f'):emit(util[_0x219d('0x42')](_0x219d('0x70'),_0x11935c[_0x219d('0x54')]),'trigger:salesforce:display',{'recordId':_0x498c87['id']});break;case _0x219d('0x71'):emit(util[_0x219d('0x42')](_0x219d('0x70'),_0x11935c[_0x219d('0x54')]),_0x219d('0x72'),{'uri':util[_0x219d('0x42')](_0x219d('0x73'),_0x28f3a3[_0x219d('0x74')],_0x498c87['id'])});break;default:logger[_0x219d('0x75')](_0x219d('0x76'));}})['catch'](function(_0xc59130){logger[_0x219d('0x75')](_0x219d('0x64'),_0xc59130);});};exports[_0x219d('0x77')]=function(_0x5c5149,_0x18912a,_0x4c17fc,_0x1e4957,_0x40a9a6,_0x391e46,_0x5722e5){var _0x508b77,_0x20d8ec,_0x306cda,_0x4d4daa;_0x391e46['serverUrl']=intUtil[_0x219d('0x62')](_0x391e46[_0x219d('0x61')]);_0x391e46['remoteUri']=intUtil['stripTrailingSlash'](_0x391e46[_0x219d('0x59')]);if(_0x5722e5&&_0x5722e5[_0x219d('0x78')]&&_0x5722e5[_0x219d('0x78')]!==_0x219d('0x79')){logger[_0x219d('0x1c')]('[OUTBOUND]',_0x219d('0x65'));_0x18912a[_0x219d('0x68')]=util[_0x219d('0x42')](_0x219d('0x66'),_0x391e46[_0x219d('0x61')],_0x18912a[_0x219d('0x67')],md5(_0x18912a[_0x219d('0x67')]));}return getConnection(_0x391e46)[_0x219d('0x25')](function(_0x457fb2){_0x4d4daa=_0x457fb2;return getUser(_0x391e46,_0x1e4957[_0x219d('0x69')],_0x4d4daa);})[_0x219d('0x25')](function(_0x16413b){_0x508b77=_0x16413b;return getEndUser(_0x391e46,_0x4c17fc,_0x18912a['destcalleridname'],_0x18912a['destcalleridnum'],_0x4d4daa);})[_0x219d('0x25')](function(_0x5273b1){_0x20d8ec=_0x5273b1;return getTicket(_0x391e46,_0x508b77,_0x20d8ec,_0x4c17fc,_0x18912a,_0x4c17fc[_0x219d('0x6c')],_0x4d4daa,_0x219d('0x77'));})[_0x219d('0x25')](function(_0x1c83d8){_0x306cda=_0x1c83d8;logger['info'](_0x219d('0x7a'),_0x306cda['id']);logger['info'](_0x219d('0x7b'),_0x306cda['id'],_0x1e4957[_0x219d('0x54')],_0x391e46[_0x219d('0x4c')]);switch(_0x391e46['type']){case _0x219d('0x6f'):emit(util[_0x219d('0x42')](_0x219d('0x70'),_0x1e4957[_0x219d('0x54')]),'trigger:salesforce:display',{'recordId':_0x306cda['id']});break;case _0x219d('0x71'):emit(util[_0x219d('0x42')](_0x219d('0x70'),_0x1e4957[_0x219d('0x54')]),_0x219d('0x72'),{'uri':util[_0x219d('0x42')](_0x219d('0x73'),_0x4d4daa[_0x219d('0x74')],_0x306cda['id'])});break;default:logger['error']('[OUTBOUND]',_0x219d('0x7c'));}})['catch'](function(_0x118dd4){logger['error'](_0x219d('0x7d'),_0x118dd4);});};exports[_0x219d('0x7e')]=function(_0x421f0c,_0xbb53b2,_0x2ef633,_0x2f52b5,_0x27ca1a,_0x261437){var _0xa2bd04,_0xa29dd2,_0x14da16,_0x59d59f;_0x261437[_0x219d('0x61')]=intUtil[_0x219d('0x62')](_0x261437['serverUrl']);_0x261437['remoteUri']=intUtil['stripTrailingSlash'](_0x261437[_0x219d('0x59')]);if(_0x27ca1a&&_0x27ca1a[_0x219d('0x63')]){logger[_0x219d('0x1c')]('['+_0xbb53b2[_0x219d('0x7f')][_0x219d('0x80')]()+']',_0x219d('0x65'));_0xbb53b2[_0x219d('0x68')]=util['format'](_0x219d('0x66'),_0x261437[_0x219d('0x61')],_0xbb53b2[_0x219d('0x67')],md5(_0xbb53b2[_0x219d('0x67')]));}else{_0xbb53b2[_0x219d('0x68')]='';}return getConnection(_0x261437)['then'](function(_0x5b74ce){_0x59d59f=_0x5b74ce;if(!_[_0x219d('0x20')](_0x2f52b5)){return getUser(_0x261437,_0x2f52b5['name'],_0x59d59f);}else{return getUser(_0x261437,null,_0x59d59f);}})[_0x219d('0x25')](function(_0x3f4c54){_0xa2bd04=_0x3f4c54;return getEndUser(_0x261437,_0x2ef633,_0xbb53b2[_0x219d('0x6a')],_0xbb53b2[_0x219d('0x6b')],_0x59d59f);})['then'](function(_0x1bf932){_0xa29dd2=_0x1bf932;return getTicket(_0x261437,_0xa2bd04,_0xa29dd2,_0x2ef633,_0xbb53b2,_0x2ef633[_0x219d('0x6c')],_0x59d59f);})[_0x219d('0x25')](function(_0x4118c0){_0x14da16=_0x4118c0;logger[_0x219d('0x1c')]('['+_0xbb53b2['lastevent'][_0x219d('0x80')]()+_0x219d('0x81'),_0x14da16['id']);logger[_0x219d('0x1c')]('['+_0xbb53b2[_0x219d('0x7f')][_0x219d('0x80')]()+_0x219d('0x82'),_0x261437[_0x219d('0x4c')]);})[_0x219d('0x83')](function(_0x41359){logger[_0x219d('0x75')]('['+_0xbb53b2[_0x219d('0x7f')][_0x219d('0x80')]()+']',_0x41359);});}; \ No newline at end of file +var _0xfa50=['type','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','','No\x20Company','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','toUpperCase','isNil','calleridname','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','contact','endUserType','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','find','execute','then','length','Email','info','Name','identity','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes'];(function(_0x171f91,_0x1a5d03){var _0x3d5650=function(_0x306458){while(--_0x306458){_0x171f91['push'](_0x171f91['shift']());}};_0x3d5650(++_0x1a5d03);}(_0xfa50,0x1b9));var _0x0fa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0fa5('0x0'));var rp=require(_0x0fa5('0x1'));var moment=require(_0x0fa5('0x2'));var BPromise=require(_0x0fa5('0x3'));var md5=require(_0x0fa5('0x4'));var jsforce=require(_0x0fa5('0x5'));var util=require('util');var Redis=require(_0x0fa5('0x6'));var intUtil=require(_0x0fa5('0x7'));var config=require(_0x0fa5('0x8'));var logger=require(_0x0fa5('0x9'))(_0x0fa5('0xa'));config[_0x0fa5('0xb')]=_[_0x0fa5('0xc')](config[_0x0fa5('0xb')],{'host':_0x0fa5('0xd'),'port':0x18eb});var io=require(_0x0fa5('0xe'))(new Redis(config[_0x0fa5('0xb')]));function emit(_0x1c306d,_0x1772cf,_0x28f22b){io['to'](_0x1c306d)[_0x0fa5('0xf')](_0x1772cf,_0x28f22b);}function getTicket(_0x255773,_0x1fd10a,_0x4a2aba,_0x3a12e6,_0x5e90be,_0xee468d,_0x2792bb,_0x527b71){var _0x2a8533=Object['assign']({},{'OwnerId':_0x1fd10a['id'],'Subject':intUtil[_0x0fa5('0x10')](_0x3a12e6['Subjects'],_0x5e90be,'\x20'),'Description':intUtil[_0x0fa5('0x10')](_0x3a12e6[_0x0fa5('0x11')],_0x5e90be,'\x0a')},getCustomFields(_0xee468d,_0x5e90be));if(_0x4a2aba){if(_0x3a12e6[_0x0fa5('0x12')]===_0x0fa5('0x13')){_0x2a8533[_0x0fa5('0x14')]=moment[_0x0fa5('0x15')]();_0x2a8533[_0x0fa5('0x16')]=![];_0x2a8533['IsRecurrence']=![];if(_0x4a2aba['endUserType']===_0x0fa5('0x17')||_0x4a2aba[_0x0fa5('0x18')]===_0x0fa5('0x19')){_0x2a8533[_0x0fa5('0x1a')]=_0x4a2aba['id'];}else if(_0x4a2aba[_0x0fa5('0x18')]==='account'){_0x2a8533[_0x0fa5('0x1b')]=_0x4a2aba['id'];}}else if(_0x3a12e6[_0x0fa5('0x12')]===_0x0fa5('0x1c')){if(_0x4a2aba[_0x0fa5('0x18')]===_0x0fa5('0x17')){_0x2a8533[_0x0fa5('0x1d')]=_0x4a2aba['id'];}else if(_0x4a2aba[_0x0fa5('0x18')]===_0x0fa5('0x1e')){_0x2a8533[_0x0fa5('0x1f')]=_0x4a2aba['id'];}else if(_0x4a2aba[_0x0fa5('0x18')]==='lead'&&_0x3a12e6[_0x0fa5('0x20')]){_0x2a8533[_0x3a12e6['leadId']]=_0x4a2aba['id'];}else{logger['info'](_0x0fa5('0x21'));}}}return _0x2792bb[_0x0fa5('0x22')](_0x3a12e6['ticketType'])[_0x0fa5('0x23')](_0x2a8533);}function getUser(_0x81708f,_0x2615b9,_0xa9104b){if(!_['isNil'](_0x2615b9)&&intUtil['validateEmail'](_0x2615b9)){var _0x416ad2={'Email':_0x2615b9};var _0x2e10c6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xa9104b[_0x0fa5('0x22')]('User')[_0x0fa5('0x24')](_0x416ad2,_0x2e10c6)[_0x0fa5('0x25')]()[_0x0fa5('0x26')](function(_0x3744fe){if(_0x3744fe[_0x0fa5('0x27')]){var _0x3e2ab3=_['find'](_0x3744fe,function(_0x482439){return _0x482439[_0x0fa5('0x28')]===_0x2615b9;});if(_0x3e2ab3){logger[_0x0fa5('0x29')]('Agent\x20%s\x20found.',_0x2615b9);return BPromise['resolve']({'id':_0x3e2ab3['Id'],'name':_0x3e2ab3[_0x0fa5('0x2a')]});}}else{logger[_0x0fa5('0x29')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2615b9);return _0xa9104b[_0x0fa5('0x2b')]()[_0x0fa5('0x26')](function(_0x524bd3){return BPromise['resolve']({'id':_0x524bd3['user_id'],'name':_0x524bd3[_0x0fa5('0x2c')]});});}});}else{logger[_0x0fa5('0x29')](_0x0fa5('0x2d'),_0x2615b9);return _0xa9104b[_0x0fa5('0x2b')]()[_0x0fa5('0x26')](function(_0x3354e7){return BPromise[_0x0fa5('0x2e')]({'id':_0x3354e7[_0x0fa5('0x2f')],'name':_0x3354e7['display_name']});});}}function getEndUser(_0x220e5c,_0x397bf9,_0x51ac6e,_0x535ab1,_0x6ee068){var _0x273aa7={'$or':{'Phone':_0x535ab1}};var _0x18f86e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0fa5('0x2e')]()[_0x0fa5('0x26')](function(){logger[_0x0fa5('0x29')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x535ab1,_0x397bf9['moduleSearch']);switch(_0x397bf9[_0x0fa5('0x30')]){case _0x0fa5('0x31'):var _0x4d8f79=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x33')]){var _0x5ec854={};_0x5ec854[_0x397bf9[_0x0fa5('0x33')]]=_0x535ab1;_[_0x0fa5('0x34')](_0x4d8f79[_0x0fa5('0x35')],_0x5ec854);}return _0x6ee068['sobject']('Contact')[_0x0fa5('0x24')](_0x4d8f79,_0x18f86e)[_0x0fa5('0x25')]()[_0x0fa5('0x26')](function(_0x58fbc1){if(_0x58fbc1&&_0x58fbc1['length']){return _0x58fbc1;}else{var _0x38d88b=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x36')]){var _0x59692a={};_0x59692a[_0x397bf9[_0x0fa5('0x36')]]=_0x535ab1;_['merge'](_0x38d88b[_0x0fa5('0x35')],_0x59692a);}return _0x6ee068[_0x0fa5('0x22')](_0x0fa5('0x37'))['find'](_0x38d88b,_0x18f86e);}});case _0x0fa5('0x38'):var _0xaa44ff=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x39')]){var _0x5ec854={};_0x5ec854[_0x397bf9[_0x0fa5('0x39')]]=_0x535ab1;_['merge'](_0xaa44ff[_0x0fa5('0x35')],_0x5ec854);}return _0x6ee068[_0x0fa5('0x22')](_0x0fa5('0x3a'))['find'](_0xaa44ff,_0x18f86e)['execute']()[_0x0fa5('0x26')](function(_0x7afa4c){if(_0x7afa4c&&_0x7afa4c[_0x0fa5('0x27')]){return _0x7afa4c;}else{var _0x5dd680=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9['additionalSearchContact']){var _0x4834d4={};_0x4834d4[_0x397bf9[_0x0fa5('0x33')]]=_0x535ab1;_['merge'](_0x5dd680[_0x0fa5('0x35')],_0x4834d4);}return _0x6ee068['sobject'](_0x0fa5('0x3b'))[_0x0fa5('0x24')](_0x5dd680,_0x18f86e)['then'](function(_0x54423a){if(_0x54423a&&_0x54423a['length']){return _0x54423a;}else{var _0x2d2a2c=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x36')]){var _0xd2255e={};_0xd2255e[_0x397bf9[_0x0fa5('0x36')]]=_0x535ab1;_[_0x0fa5('0x34')](_0x2d2a2c[_0x0fa5('0x35')],_0xd2255e);}return _0x6ee068['sobject'](_0x0fa5('0x37'))[_0x0fa5('0x24')](_0x2d2a2c,_0x18f86e);}});}});case _0x0fa5('0x17'):var _0x4d8f79=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x33')]){var _0x5ec854={};_0x5ec854[_0x397bf9['additionalSearchContact']]=_0x535ab1;_[_0x0fa5('0x34')](_0x4d8f79['$or'],_0x5ec854);}return _0x6ee068[_0x0fa5('0x22')](_0x0fa5('0x3b'))[_0x0fa5('0x24')](_0x4d8f79,_0x18f86e)[_0x0fa5('0x25')]();case'lead':var _0x3f640b=_['cloneDeep'](_0x273aa7);if(_0x397bf9[_0x0fa5('0x36')]){var _0x5ec854={};_0x5ec854[_0x397bf9[_0x0fa5('0x36')]]=_0x535ab1;_['merge'](_0x3f640b[_0x0fa5('0x35')],_0x5ec854);}return _0x6ee068[_0x0fa5('0x22')](_0x0fa5('0x37'))[_0x0fa5('0x24')](_0x3f640b,_0x18f86e);case _0x0fa5('0x1e'):var _0xaa44ff=_[_0x0fa5('0x32')](_0x273aa7);if(_0x397bf9[_0x0fa5('0x39')]){var _0x5ec854={};_0x5ec854[_0x397bf9[_0x0fa5('0x39')]]=_0x535ab1;_[_0x0fa5('0x34')](_0xaa44ff[_0x0fa5('0x35')],_0x5ec854);}return _0x6ee068[_0x0fa5('0x22')](_0x0fa5('0x3a'))[_0x0fa5('0x24')](_0xaa44ff,_0x18f86e);default:return null;}})[_0x0fa5('0x26')](function(_0x3f0b7d){if(_0x3f0b7d&&_0x3f0b7d['length']){var _0x172dff=_[_0x0fa5('0x3c')](_0x3f0b7d);if(_0x172dff){return BPromise[_0x0fa5('0x2e')]({'id':_0x172dff['Id'],'name':_0x172dff[_0x0fa5('0x2a')],'phone':_0x172dff[_0x0fa5('0x3d')],'endUserType':_0x172dff[_0x0fa5('0x3e')][_0x0fa5('0x3f')]['toLowerCase']()});}}})['then'](function(_0x3b8a70){if(_0x3b8a70){logger[_0x0fa5('0x29')](_0x0fa5('0x40'),_0x3b8a70['endUserType'],_0x535ab1);return BPromise[_0x0fa5('0x2e')](_0x3b8a70);}else{logger[_0x0fa5('0x29')](_0x0fa5('0x41'),_0x535ab1);var _0x227952={'Phone':_0x535ab1};if(_0x397bf9[_0x0fa5('0x42')]){if(_0x397bf9[_0x0fa5('0x42')]===_0x0fa5('0x17')){logger[_0x0fa5('0x29')](_0x0fa5('0x43'),_0x535ab1,_0x397bf9[_0x0fa5('0x42')]);_0x227952[_0x0fa5('0x44')]=_0x51ac6e!==''?_0x51ac6e:util[_0x0fa5('0x45')](_0x0fa5('0x46'),_0x535ab1);}else if(_0x397bf9[_0x0fa5('0x42')]===_0x0fa5('0x19')){logger[_0x0fa5('0x29')](_0x0fa5('0x43'),_0x535ab1,_0x397bf9[_0x0fa5('0x42')]);_0x227952[_0x0fa5('0x44')]=_0x51ac6e!==_0x0fa5('0x47')?_0x51ac6e:util[_0x0fa5('0x45')](_0x0fa5('0x46'),_0x535ab1);_0x227952['Company']=_0x0fa5('0x48');}else if(_0x397bf9['moduleCreate']===_0x0fa5('0x1e')){logger[_0x0fa5('0x29')](_0x0fa5('0x43'),_0x535ab1,_0x397bf9[_0x0fa5('0x42')]);_0x227952[_0x0fa5('0x2a')]=_0x51ac6e!==_0x0fa5('0x47')?_0x51ac6e:util[_0x0fa5('0x45')](_0x0fa5('0x46'),_0x535ab1);}else{return null;}}return _0x6ee068[_0x0fa5('0x22')](_['upperFirst'](_0x397bf9['moduleCreate']))[_0x0fa5('0x23')](_0x227952)[_0x0fa5('0x26')](function(_0x805147){return BPromise[_0x0fa5('0x2e')]({'id':_0x805147['id'],'endUserType':_0x397bf9[_0x0fa5('0x42')]});});}});}function getCustomFields(_0xa0de85,_0x38bdaa){var _0x26a863={};if(_0xa0de85[_0x0fa5('0x27')]>0x0){_[_0x0fa5('0x49')](_0xa0de85,function(_0x1a4d6c){if(_['includes']([_0x0fa5('0x4a'),_0x0fa5('0x4b')],_0x1a4d6c[_0x0fa5('0x3f')])&&_0x1a4d6c[_0x0fa5('0x4c')]){_0x26a863[_0x1a4d6c[_0x0fa5('0x4c')]]=_0x1a4d6c[_0x0fa5('0x4d')][_0x0fa5('0x4e')]();}else if(_0x1a4d6c[_0x0fa5('0x3f')]===_0x0fa5('0x4f')&&_0x1a4d6c[_0x0fa5('0x50')]&&_0x1a4d6c[_0x0fa5('0x4c')]){_0x38bdaa[_0x1a4d6c['variableName']]&&(_0x26a863[_0x1a4d6c[_0x0fa5('0x4c')]]=_0x38bdaa[_0x1a4d6c[_0x0fa5('0x50')]][_0x0fa5('0x4e')]());}else if(_0x1a4d6c[_0x0fa5('0x3f')]===_0x0fa5('0x51')&&_0x1a4d6c[_0x0fa5('0x52')]&&_0x1a4d6c['Variable'][_0x0fa5('0x53')]&&_0x1a4d6c['idField']){_0x38bdaa[_0x1a4d6c[_0x0fa5('0x52')][_0x0fa5('0x53')]['toLowerCase']()]&&(_0x26a863[_0x1a4d6c[_0x0fa5('0x4c')]]=_0x38bdaa[_0x1a4d6c['Variable']['name'][_0x0fa5('0x54')]()][_0x0fa5('0x4e')]());}});}return _0x26a863;}function getConnection(_0x41ad75){var _0x14e160=_0x41ad75[_0x0fa5('0x55')]['concat'](_0x41ad75[_0x0fa5('0x56')]);var _0x51f957=new jsforce[(_0x0fa5('0x57'))]({'oauth2':{'loginUrl':_0x41ad75[_0x0fa5('0x58')]||'https://login.salesforce.com','clientId':_0x41ad75['clientId'],'clientSecret':_0x41ad75['clientSecret']}});return _0x51f957[_0x0fa5('0x59')](_0x41ad75[_0x0fa5('0x5a')],_0x14e160)[_0x0fa5('0x26')](function(){logger[_0x0fa5('0x29')]('Connection\x20established.');return _0x51f957;});}exports[_0x0fa5('0x5b')]=function(_0x468a65,_0x2b6d60,_0x1d5662,_0x5b08ba,_0x37aa1c,_0x361910){var _0x3f9c92,_0x599d7a,_0x1926e5,_0x83285d;_0x361910['serverUrl']=intUtil[_0x0fa5('0x5c')](_0x361910[_0x0fa5('0x5d')]);_0x361910[_0x0fa5('0x58')]=intUtil['stripTrailingSlash'](_0x361910[_0x0fa5('0x58')]);if(_0x37aa1c&&_0x37aa1c[_0x0fa5('0x5e')]){logger['info'](_0x0fa5('0x5f'),_0x0fa5('0x60'));_0x2b6d60[_0x0fa5('0x61')]=util[_0x0fa5('0x45')](_0x0fa5('0x62'),_0x361910[_0x0fa5('0x5d')],_0x2b6d60[_0x0fa5('0x63')],md5(_0x2b6d60[_0x0fa5('0x63')]));}else{_0x2b6d60[_0x0fa5('0x61')]='';}return getConnection(_0x361910)['then'](function(_0x2636af){_0x83285d=_0x2636af;return getUser(_0x361910,_0x5b08ba[_0x0fa5('0x64')],_0x83285d);})[_0x0fa5('0x26')](function(_0x17e919){_0x3f9c92=_0x17e919;return getEndUser(_0x361910,_0x1d5662,_0x2b6d60['calleridname'],_0x2b6d60[_0x0fa5('0x65')],_0x83285d);})[_0x0fa5('0x26')](function(_0x5df1ad){_0x599d7a=_0x5df1ad;return getTicket(_0x361910,_0x3f9c92,_0x599d7a,_0x1d5662,_0x2b6d60,_0x1d5662['Fields'],_0x83285d,_0x0fa5('0x5b'));})[_0x0fa5('0x26')](function(_0x3a64d3){_0x1926e5=_0x3a64d3;logger[_0x0fa5('0x29')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x1926e5['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1926e5['id'],_0x5b08ba['name'],_0x361910[_0x0fa5('0x3f')]);switch(_0x361910[_0x0fa5('0x3f')]){case _0x0fa5('0x66'):emit(util[_0x0fa5('0x45')](_0x0fa5('0x67'),_0x5b08ba[_0x0fa5('0x53')]),_0x0fa5('0x68'),{'recordId':_0x1926e5['id']});break;case'newTab':emit(util[_0x0fa5('0x45')](_0x0fa5('0x67'),_0x5b08ba['name']),_0x0fa5('0x69'),{'uri':util['format'](_0x0fa5('0x6a'),_0x83285d['instanceUrl'],_0x1926e5['id'])});break;default:logger[_0x0fa5('0x6b')](_0x0fa5('0x6c'));}})['catch'](function(_0x5cd0f0){logger[_0x0fa5('0x6b')](_0x0fa5('0x5f'),_0x5cd0f0);});};exports[_0x0fa5('0x6d')]=function(_0x52d9e1,_0x28dc60,_0xc3694f,_0x84d823,_0xeae698,_0x42424f,_0xbb520b){var _0x1b1f55,_0x57b6fb,_0x4908d8,_0x209eb0;_0x42424f[_0x0fa5('0x5d')]=intUtil[_0x0fa5('0x5c')](_0x42424f[_0x0fa5('0x5d')]);_0x42424f['remoteUri']=intUtil[_0x0fa5('0x5c')](_0x42424f[_0x0fa5('0x58')]);if(_0xbb520b&&_0xbb520b['recordingFormat']&&_0xbb520b[_0x0fa5('0x6e')]!=='none'){logger[_0x0fa5('0x29')](_0x0fa5('0x6f'),_0x0fa5('0x60'));_0x28dc60['recordingURL']=util[_0x0fa5('0x45')](_0x0fa5('0x62'),_0x42424f[_0x0fa5('0x5d')],_0x28dc60[_0x0fa5('0x63')],md5(_0x28dc60[_0x0fa5('0x63')]));}return getConnection(_0x42424f)[_0x0fa5('0x26')](function(_0x3e3927){_0x209eb0=_0x3e3927;return getUser(_0x42424f,_0x84d823[_0x0fa5('0x64')],_0x209eb0);})['then'](function(_0x5b950e){_0x1b1f55=_0x5b950e;return getEndUser(_0x42424f,_0xc3694f,_0x28dc60[_0x0fa5('0x70')],_0x28dc60[_0x0fa5('0x71')],_0x209eb0);})['then'](function(_0x45b917){_0x57b6fb=_0x45b917;return getTicket(_0x42424f,_0x1b1f55,_0x57b6fb,_0xc3694f,_0x28dc60,_0xc3694f[_0x0fa5('0x72')],_0x209eb0,'outbound');})[_0x0fa5('0x26')](function(_0x37189a){_0x4908d8=_0x37189a;logger[_0x0fa5('0x29')](_0x0fa5('0x73'),_0x4908d8['id']);logger[_0x0fa5('0x29')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4908d8['id'],_0x84d823[_0x0fa5('0x53')],_0x42424f[_0x0fa5('0x3f')]);switch(_0x42424f[_0x0fa5('0x3f')]){case _0x0fa5('0x66'):emit(util[_0x0fa5('0x45')]('user:%s',_0x84d823[_0x0fa5('0x53')]),_0x0fa5('0x68'),{'recordId':_0x4908d8['id']});break;case _0x0fa5('0x74'):emit(util[_0x0fa5('0x45')](_0x0fa5('0x67'),_0x84d823[_0x0fa5('0x53')]),'trigger:browser:url',{'uri':util[_0x0fa5('0x45')](_0x0fa5('0x6a'),_0x209eb0['instanceUrl'],_0x4908d8['id'])});break;default:logger['error']('[OUTBOUND]',_0x0fa5('0x75'));}})[_0x0fa5('0x76')](function(_0x1846be){logger['error']('[OUTBOUND]',_0x1846be);});};exports[_0x0fa5('0x77')]=function(_0x53f936,_0x3fd45f,_0x31df78,_0x1b6377,_0x4351a2,_0x11409f){var _0x2c6ded,_0x365dc7,_0x355b98,_0x13b2c3;_0x11409f[_0x0fa5('0x5d')]=intUtil[_0x0fa5('0x5c')](_0x11409f[_0x0fa5('0x5d')]);_0x11409f[_0x0fa5('0x58')]=intUtil['stripTrailingSlash'](_0x11409f[_0x0fa5('0x58')]);if(_0x4351a2&&_0x4351a2['monitor_format']){logger['info']('['+_0x3fd45f['lastevent'][_0x0fa5('0x78')]()+']','Recording\x20is\x20enabled!');_0x3fd45f[_0x0fa5('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x11409f['serverUrl'],_0x3fd45f[_0x0fa5('0x63')],md5(_0x3fd45f[_0x0fa5('0x63')]));}else{_0x3fd45f['recordingURL']='';}return getConnection(_0x11409f)[_0x0fa5('0x26')](function(_0x15bebb){_0x13b2c3=_0x15bebb;if(!_[_0x0fa5('0x79')](_0x1b6377)){return getUser(_0x11409f,_0x1b6377[_0x0fa5('0x53')],_0x13b2c3);}else{return getUser(_0x11409f,null,_0x13b2c3);}})['then'](function(_0x189082){_0x2c6ded=_0x189082;return getEndUser(_0x11409f,_0x31df78,_0x3fd45f[_0x0fa5('0x7a')],_0x3fd45f[_0x0fa5('0x65')],_0x13b2c3);})[_0x0fa5('0x26')](function(_0x41c3d7){_0x365dc7=_0x41c3d7;return getTicket(_0x11409f,_0x2c6ded,_0x365dc7,_0x31df78,_0x3fd45f,_0x31df78[_0x0fa5('0x72')],_0x13b2c3);})[_0x0fa5('0x26')](function(_0x366326){_0x355b98=_0x366326;logger[_0x0fa5('0x29')]('['+_0x3fd45f[_0x0fa5('0x7b')][_0x0fa5('0x78')]()+_0x0fa5('0x7c'),_0x355b98['id']);logger[_0x0fa5('0x29')]('['+_0x3fd45f['lastevent']['toUpperCase']()+_0x0fa5('0x7d'),_0x11409f[_0x0fa5('0x3f')]);})['catch'](function(_0x383c52){logger[_0x0fa5('0x6b')]('['+_0x3fd45f[_0x0fa5('0x7b')][_0x0fa5('0x78')]()+']',_0x383c52);});}; \ 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 42651d9..3cedaf1 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 _0x31b4=['Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','length','adminId','sys_id','info','catch','error','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','result','active','userId','adminEmail','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','true','endUserNumber','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','customField','nameField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString'];(function(_0x47dca0,_0x2cc988){var _0x38bcbf=function(_0x1865f1){while(--_0x1865f1){_0x47dca0['push'](_0x47dca0['shift']());}};_0x38bcbf(++_0x2cc988);}(_0x31b4,0x174));var _0x431b=function(_0x506500,_0x2a0c11){_0x506500=_0x506500-0x0;var _0x1d790d=_0x31b4[_0x506500];return _0x1d790d;};'use strict';var _=require(_0x431b('0x0'));var Promise=require(_0x431b('0x1'));var rp=require(_0x431b('0x2'));var util=require(_0x431b('0x3'));var md5=require('md5');var Redis=require(_0x431b('0x4'));var intUtil=require('./util');var config=require(_0x431b('0x5'));var logger=require(_0x431b('0x6'))(_0x431b('0x7'));config[_0x431b('0x8')]=_[_0x431b('0x9')](config[_0x431b('0x8')],{'host':_0x431b('0xa'),'port':0x18eb});var io=require(_0x431b('0xb'))(new Redis(config['redis']));function getAdminUser(_0x4263a9,_0x49da27,_0x23711a,_0x7a50b7,_0x193f3b,_0x1deca4){return new Promise(function(_0x1379cf,_0x335052){var _0x3738f2={'method':_0x431b('0xc'),'uri':_0x7a50b7+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x193f3b+'&'+_0x1deca4,'auth':_0x49da27,'json':!![]};return rp(_0x3738f2)['then'](function(_0x1bb1c1){if(_0x1bb1c1['result'][_0x431b('0xd')]>0x0){_0x23711a[_0x431b('0xe')]=_0x1bb1c1['result'][0x0][_0x431b('0xf')];}logger[_0x431b('0x10')]('['+[_0x4263a9['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x23711a);_0x1379cf(_0x23711a);})[_0x431b('0x11')](function(_0x4135e3){logger[_0x431b('0x12')]('['+[_0x4263a9['toUpperCase']()]+']',_0x4135e3['message']);_0x335052(_0x4135e3['message']);});});}function getUser(_0x19a3ca,_0x177437,_0x3a07df,_0x53d0d1,_0x233ec8){return function(_0x1e630a){logger[_0x431b('0x10')]('['+[_0x19a3ca[_0x431b('0x13')]()]+_0x431b('0x14'),_0x1e630a);return new Promise(function(_0x3a9d57,_0x23d1e8){if(intUtil[_0x431b('0x15')](_0x1e630a[_0x431b('0x16')])){var _0x2eb918={'method':_0x431b('0xc'),'uri':_0x3a07df+_0x431b('0x17')+_0x1e630a[_0x431b('0x16')]+'&'+_0x53d0d1+'&'+_0x233ec8,'auth':_0x177437,'json':!![]};logger[_0x431b('0x10')]('['+[_0x19a3ca['toUpperCase']()]+_0x431b('0x18'),_0x2eb918);return rp(_0x2eb918)[_0x431b('0x19')](function(_0x2e59dc){logger['info']('['+[_0x19a3ca[_0x431b('0x13')]()]+'],\x20getUser\x20entity',_0x2e59dc);if(_0x2e59dc['result'][_0x431b('0xd')]>0x0&&String(_0x2e59dc[_0x431b('0x1a')][0x0][_0x431b('0x1b')])==='true'){_0x1e630a[_0x431b('0x1c')]=_0x2e59dc['result'][0x0][_0x431b('0xf')];}else{_0x1e630a['userId']=_0x1e630a['adminId'];_0x1e630a[_0x431b('0x16')]=_0x1e630a[_0x431b('0x1d')];}logger[_0x431b('0x10')]('['+[_0x19a3ca['toUpperCase']()]+'],\x20getUser\x20crm',_0x1e630a);_0x3a9d57(_0x1e630a);})[_0x431b('0x11')](function(_0x43f0f3){logger[_0x431b('0x12')]('['+[_0x19a3ca[_0x431b('0x13')]()]+']',_0x43f0f3['message']);_0x23d1e8(_0x43f0f3[_0x431b('0x1e')]);});}else{logger[_0x431b('0x10')]('['+[_0x19a3ca['toUpperCase']()]+_0x431b('0x1f'));_0x1e630a[_0x431b('0x1c')]=_0x1e630a[_0x431b('0xe')];_0x1e630a[_0x431b('0x16')]=_0x1e630a['adminEmail'];_0x3a9d57(_0x1e630a);}});};}function createEndUser(_0x683db5,_0x24a44d,_0x1d5035,_0x47e528,_0x5f374a){logger[_0x431b('0x10')]('['+[_0x683db5['toUpperCase']()]+_0x431b('0x20'),_0x1d5035);return new Promise(function(_0x4feaf7,_0x239d1c){var _0x59d1f1={'method':_0x431b('0x21'),'uri':_0x47e528+_0x431b('0x22')+_0x5f374a,'body':{'user_name':_0x1d5035['endUserNumber'],'roles':_0x431b('0x23'),'first_name':_0x1d5035['endUserNumber'],'active':_0x431b('0x24'),'date_format':'System','phone':_0x1d5035[_0x431b('0x25')]},'auth':_0x24a44d,'json':!![]};return rp(_0x59d1f1)['then'](function(_0x41d2d8){logger[_0x431b('0x10')]('['+[_0x683db5[_0x431b('0x13')]()]+_0x431b('0x26'),_0x41d2d8[_0x431b('0x1a')]);_0x1d5035['endUserId']=_0x41d2d8[_0x431b('0x1a')][_0x431b('0xf')];_0x4feaf7(_0x1d5035);})[_0x431b('0x11')](function(_0x35b359){logger[_0x431b('0x12')]('['+[_0x683db5[_0x431b('0x13')]()]+']',_0x35b359[_0x431b('0x1e')]);_0x239d1c(_0x35b359['message']);});});}function getEndUser(_0x13502d,_0x51a4c6,_0x45f000,_0x1dc971,_0x7c09f0){return function(_0xc74b24){logger[_0x431b('0x10')]('['+[_0x13502d['toUpperCase']()]+_0x431b('0x27'),_0xc74b24);return new Promise(function(_0x956e09,_0x300c63){var _0x2776bc={'method':_0x431b('0xc'),'uri':_0x45f000+_0x431b('0x28')+_0xc74b24[_0x431b('0x25')]+'&'+_0x1dc971+'&'+_0x7c09f0,'auth':_0x51a4c6,'json':!![]};return rp(_0x2776bc)[_0x431b('0x19')](function(_0x488e6f){if(_0x488e6f[_0x431b('0x1a')]['length']>0x0){_0xc74b24[_0x431b('0x29')]=_0x488e6f[_0x431b('0x1a')][0x0][_0x431b('0xf')];logger['info']('['+[_0x13502d[_0x431b('0x13')]()]+_0x431b('0x2a'),_0xc74b24);_0x956e09(_0xc74b24);}else{return createEndUser(_0x13502d,_0x51a4c6,_0xc74b24,_0x45f000,_0x1dc971)[_0x431b('0x19')](function(_0x410873){logger[_0x431b('0x10')]('['+[_0x13502d[_0x431b('0x13')]()]+_0x431b('0x2b'),_0x410873);_0x956e09(_0x410873);});}})['catch'](function(_0x4c5ea9){logger[_0x431b('0x12')]('['+[_0x13502d[_0x431b('0x13')]()]+']',_0x4c5ea9[_0x431b('0x1e')]);_0x300c63(_0x4c5ea9['message']);});});};}function getCustomFields(_0x51782d,_0x4709c1){var _0x380bc8={};if(_0x51782d[_0x431b('0xd')]>0x0){_[_0x431b('0x2c')](_0x51782d,function(_0x1990f6){if(_['includes']([_0x431b('0x2d'),_0x431b('0x2e')],_0x1990f6[_0x431b('0x2f')])&&_0x1990f6['nameField']&&!_0x1990f6[_0x431b('0x30')]){_0x380bc8[_0x1990f6[_0x431b('0x31')][_0x431b('0x32')]()]=_0x1990f6[_0x431b('0x33')][_0x431b('0x34')]();}else if(_[_0x431b('0x35')](['string','picklist'],_0x1990f6[_0x431b('0x2f')])&&_0x1990f6['idField']&&_0x1990f6[_0x431b('0x30')]){_0x380bc8[_0x1990f6[_0x431b('0x36')][_0x431b('0x32')]()]=_0x1990f6[_0x431b('0x33')][_0x431b('0x34')]();}else if(_0x1990f6[_0x431b('0x2f')]===_0x431b('0x37')&&_0x1990f6[_0x431b('0x38')]&&_0x1990f6[_0x431b('0x36')]&&_0x1990f6[_0x431b('0x30')]){_0x380bc8[_0x1990f6['idField'][_0x431b('0x32')]()]=_0x4709c1[_0x1990f6['variableName']][_0x431b('0x34')]();}else if(_0x1990f6[_0x431b('0x2f')]===_0x431b('0x39')&&_0x1990f6[_0x431b('0x3a')]&&_0x1990f6[_0x431b('0x3a')]['name']&&_0x1990f6[_0x431b('0x36')]&&_0x1990f6[_0x431b('0x30')]){_0x380bc8[_0x1990f6[_0x431b('0x36')][_0x431b('0x32')]()]=_0x4709c1[_0x1990f6[_0x431b('0x3a')][_0x431b('0x3b')]['toLowerCase']()][_0x431b('0x34')]();}});}return _0x380bc8;}function getTicket(_0x29f18b,_0x50ebab,_0x2c6eb8,_0x270393,_0xc5698c,_0x2718c1){return function(_0x7d45ae){logger[_0x431b('0x10')]('['+[_0x29f18b['toUpperCase']()]+_0x431b('0x3c'),_0x7d45ae);return new Promise(function(_0x5a67d6,_0x3909fb){var _0x14b7a7=_0x29f18b[_0x431b('0x32')]()==='outbound'?_0x7d45ae[_0x431b('0x1c')]:_0x7d45ae['endUserId'];var _0x2cc9ef={'method':_0x431b('0x21'),'uri':_0x2c6eb8+_0x431b('0x3d')+'?'+_0x2718c1,'body':Object[_0x431b('0x3e')]({},{'active':_0x431b('0x24'),'caller_id':_0x14b7a7,'assigned_to':_0x7d45ae[_0x431b('0x1c')],'short_description':intUtil[_0x431b('0x3f')](_0x270393['Subjects'],_0xc5698c,'\x20'),'description':intUtil[_0x431b('0x3f')](_0x270393[_0x431b('0x40')],_0xc5698c,'\x0a')},getCustomFields(_0x270393[_0x431b('0x41')],_0xc5698c)),'auth':_0x50ebab,'json':!![]};return rp(_0x2cc9ef)['then'](function(_0x396b76){logger[_0x431b('0x10')]('['+[_0x29f18b['toUpperCase']()]+_0x431b('0x42'),_0x396b76[_0x431b('0x1a')]);_0x7d45ae[_0x431b('0x43')]=_0x396b76['result'][_0x431b('0xf')];_0x7d45ae[_0x431b('0x44')]=_0x396b76['result'][_0x431b('0x45')];logger[_0x431b('0x10')]('['+[_0x29f18b[_0x431b('0x13')]()]+_0x431b('0x46'),_0x7d45ae);_0x5a67d6(_0x7d45ae);})[_0x431b('0x11')](function(_0x30e69d){logger[_0x431b('0x12')]('['+[_0x29f18b[_0x431b('0x13')]()]+']',_0x30e69d[_0x431b('0x1e')]);_0x3909fb(_0x30e69d[_0x431b('0x1e')]);});});};}function createRemoteTag(_0x5be822,_0x5c958f,_0x56d522,_0x1df52b){return new Promise(function(_0x32218d,_0x51af01){var _0xd91132={'method':_0x431b('0x21'),'uri':_0x56d522+_0x431b('0x47')+'?'+_0x1df52b,'body':{'short_description':_0x5be822,'global':!![],'active':!![],'name':_0x5be822},'auth':_0x5c958f,'json':!![]};return rp(_0xd91132)[_0x431b('0x19')](function(_0x45e240){var _0x5b646a=_0x45e240['result'][_0x431b('0xf')];_0x32218d(_0x5b646a);});});}function getRemoteTag(_0x28983d,_0x2a4785,_0x11cd7b,_0x4b1825,_0x3fb78d){return new Promise(function(_0x28eaa2,_0x36dbe3){var _0x3eb3e4={'method':'GET','uri':_0x11cd7b+_0x431b('0x47')+'?sysparm_query=name%3D'+_0x28983d+'&'+_0x4b1825,'auth':_0x2a4785,'json':!![]};return rp(_0x3eb3e4)[_0x431b('0x19')](function(_0x5a20e9){if(_0x5a20e9[_0x431b('0x1a')][_0x431b('0xd')]>0x0){var _0x20eb3c=_0x5a20e9[_0x431b('0x1a')][0x0][_0x431b('0xf')];_0x28eaa2(_0x20eb3c);}else{return createRemoteTag(_0x28983d,_0x2a4785,_0x11cd7b,_0x4b1825)[_0x431b('0x19')](function(_0x2691e3){_0x28eaa2(_0x2691e3);});}});});}function assignTagToIncident(_0x214aa9,_0x26d120,_0x15168b,_0x47a36b,_0x170f54){return new Promise(function(_0x225b29,_0x36edf7){var _0x32bcf5={'method':_0x431b('0x21'),'uri':_0x15168b+_0x431b('0x48')+'?'+_0x170f54,'body':{'label':_0x214aa9,'table':'incident','id_type':'Incident','table_key':_0x47a36b[_0x431b('0x43')],'title':_0x431b('0x49')+_0x47a36b[_0x431b('0x44')],'id_display':_0x47a36b[_0x431b('0x44')]},'auth':_0x26d120,'json':!![]};return rp(_0x32bcf5)[_0x431b('0x19')](function(_0x536a5e){_0x225b29();})[_0x431b('0x11')](function(){_0x225b29();});});}function manageTags(_0x50f30f,_0x58569c,_0x194e2d,_0x200dad,_0x3b0c70,_0x356d61,_0x5b28b1){return new Promise(function(_0x6cc0a6,_0x28bac7){var _0x2600e3=[];_0x58569c[_0x431b('0x2c')](function(_0x3264ad){_0x2600e3[_0x431b('0x4a')](getRemoteTag(_0x3264ad,_0x194e2d,_0x200dad,_0x356d61,_0x5b28b1));});return Promise[_0x431b('0x4b')](_0x2600e3)[_0x431b('0x19')](function(_0x2bab7e){if(_0x2bab7e['length']){logger['info']('['+[_0x50f30f['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2bab7e);var _0x34299f=[];_0x2bab7e[_0x431b('0x2c')](function(_0x92cfa9){_0x34299f[_0x431b('0x4a')](assignTagToIncident(_0x92cfa9,_0x194e2d,_0x200dad,_0x3b0c70,_0x356d61));});return Promise[_0x431b('0x4b')](_0x34299f)[_0x431b('0x19')](function(){_0x6cc0a6();})[_0x431b('0x11')](function(){_0x6cc0a6();});}else{_0x6cc0a6();}});});}function getTags(_0x4bba87,_0xd2816,_0x2b1143,_0xa92e91,_0x43a182,_0x445ffc){return function(_0x41953f){return new Promise(function(_0x5c2428,_0x39512){var _0x6260dd=[];var _0x41caf1=_0xa92e91[_0x431b('0x4c')];if(_0x41caf1&&_0x41caf1[_0x431b('0xd')]>0x0){_0x6260dd=_[_0x431b('0x4d')](_0x41caf1,_0x431b('0x3b'));}if(_0x6260dd['length']>0x0){return manageTags(_0x4bba87,_0x6260dd,_0xd2816,_0x2b1143,_0x41953f,_0x43a182,_0x445ffc)['then'](function(){_0x5c2428(_0x41953f);});}else{_0x5c2428(_0x41953f);}});};}function emit(_0x5788c0,_0x554ae3,_0x1ec65f){var _0x2c0b7f='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x431b('0x4e')+_0x431b('0x4f');var _0x4368db={'uri':_0x5788c0+_0x431b('0x50')+_0x1ec65f+_0x2c0b7f};io['to'](util['format'](_0x431b('0x51'),_0x554ae3))[_0x431b('0x52')](_0x431b('0x53'),_0x4368db);}exports['cs']=function(_0x4f746,_0x4f8fee,_0x3fc6c9,_0x1df655,_0x4e3eca,_0x1f2218,_0x4a8959,_0x2cf9ba){var _0x2ae4a9={};var _0x1160e2={'user':_0x1f2218['username'],'pass':_0x1f2218[_0x431b('0x54')]};var _0x31eb7d='sysparm_limit=1';var _0x33864c=_0x431b('0x55');_0x1f2218[_0x431b('0x56')]=intUtil[_0x431b('0x57')](_0x1f2218[_0x431b('0x56')]);_0x1f2218[_0x431b('0x58')]=intUtil['stripTrailingSlash'](_0x1f2218[_0x431b('0x58')]);var _0x5a35ba=util[_0x431b('0x59')](_0x431b('0x5a'),_0x1f2218['remoteUri']);_0x2ae4a9[_0x431b('0x16')]=!_['isNil'](_0x1df655)?_0x1df655[_0x431b('0x5b')]:null;_0x2ae4a9['adminEmail']=_0x1f2218[_0x431b('0x5b')];_0x2ae4a9[_0x431b('0x25')]=_0x2cf9ba['toLowerCase']()===_0x431b('0x5c')?_0x4f8fee[_0x431b('0x5d')]:_0x4f8fee[_0x431b('0x5e')];_0x2ae4a9[_0x431b('0x5f')]=_0x2cf9ba===_0x431b('0x60')||_0x2cf9ba===_0x431b('0x61')?_0x431b('0x60'):_0x431b('0x5c');var _0x37b9fe=util[_0x431b('0x59')](_0x431b('0x62'),_0x1f2218[_0x431b('0x58')],_0x4f8fee[_0x431b('0x63')],md5(_0x4f8fee[_0x431b('0x63')]));if(_0x4e3eca&&_0x4e3eca[_0x431b('0x64')]){logger[_0x431b('0x10')](_0x431b('0x65'),'Recording\x20is\x20enabled!');_0x4f8fee[_0x431b('0x66')]=_0x37b9fe;}else if(_0x4a8959&&_0x4a8959[_0x431b('0x67')]&&_0x4a8959[_0x431b('0x67')]!==_0x431b('0x68')){logger[_0x431b('0x10')]('[OUTBOUND]',_0x431b('0x69'));_0x4f8fee['recordingURL']=_0x37b9fe;}else{_0x4f8fee['recordingURL']='';}return getAdminUser(_0x2cf9ba,_0x1160e2,_0x2ae4a9,_0x5a35ba,_0x33864c,_0x31eb7d)[_0x431b('0x19')](getUser(_0x2cf9ba,_0x1160e2,_0x5a35ba,_0x33864c,_0x31eb7d))[_0x431b('0x19')](getEndUser(_0x2cf9ba,_0x1160e2,_0x5a35ba,_0x33864c,_0x31eb7d))[_0x431b('0x19')](getTicket(_0x2cf9ba,_0x1160e2,_0x5a35ba,_0x3fc6c9,_0x4f8fee,_0x33864c))[_0x431b('0x19')](function(_0x112bcb){logger[_0x431b('0x10')](util[_0x431b('0x59')]('The\x20ticket\x20ID\x20is:\x20%s',_0x112bcb['ticketId']));logger[_0x431b('0x10')](util[_0x431b('0x59')](_0x431b('0x6a'),_0x2cf9ba));if(_0x2cf9ba!=='unmanaged'){logger[_0x431b('0x10')]('['+[_0x2cf9ba[_0x431b('0x13')]()]+']',_0x431b('0x6b'));emit(_0x1f2218[_0x431b('0x56')],_0x1df655[_0x431b('0x3b')],_0x112bcb[_0x431b('0x43')]);}})[_0x431b('0x11')](function(_0x155947){logger[_0x431b('0x12')]('['+[_0x2cf9ba[_0x431b('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x431b('0x6c')](_0x155947,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3bc3=['%s/api/now/table/','isNil','email','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','active','true','userId','adminId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','picklist','type','customField','toLowerCase','toString','string','content','variableName','idField','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl'];(function(_0x45bd7f,_0x324d30){var _0x4335e0=function(_0x484733){while(--_0x484733){_0x45bd7f['push'](_0x45bd7f['shift']());}};_0x4335e0(++_0x324d30);}(_0x3bc3,0x80));var _0x33bc=function(_0x12cf3a,_0x50d495){_0x12cf3a=_0x12cf3a-0x0;var _0x4bbcaf=_0x3bc3[_0x12cf3a];return _0x4bbcaf;};'use strict';var _=require(_0x33bc('0x0'));var Promise=require(_0x33bc('0x1'));var rp=require(_0x33bc('0x2'));var util=require(_0x33bc('0x3'));var md5=require(_0x33bc('0x4'));var Redis=require(_0x33bc('0x5'));var intUtil=require(_0x33bc('0x6'));var config=require(_0x33bc('0x7'));var logger=require(_0x33bc('0x8'))('servicenow');config[_0x33bc('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x33bc('0xa'))(new Redis(config[_0x33bc('0x9')]));function getAdminUser(_0x5bb94,_0x23211d,_0x5e3ec0,_0x323802,_0x2addd0,_0x5c81d1){return new Promise(function(_0x460fde,_0x4cda5c){var _0x2d128b={'method':_0x33bc('0xb'),'uri':_0x323802+_0x33bc('0xc')+'&'+_0x2addd0+'&'+_0x5c81d1,'auth':_0x23211d,'json':!![]};return rp(_0x2d128b)['then'](function(_0x2c9032){if(_0x2c9032[_0x33bc('0xd')][_0x33bc('0xe')]>0x0){_0x5e3ec0['adminId']=_0x2c9032[_0x33bc('0xd')][0x0][_0x33bc('0xf')];}logger[_0x33bc('0x10')]('['+[_0x5bb94[_0x33bc('0x11')]()]+_0x33bc('0x12'),_0x5e3ec0);_0x460fde(_0x5e3ec0);})[_0x33bc('0x13')](function(_0x2677af){logger[_0x33bc('0x14')]('['+[_0x5bb94[_0x33bc('0x11')]()]+']',_0x2677af['message']);_0x4cda5c(_0x2677af[_0x33bc('0x15')]);});});}function getUser(_0x209384,_0x4dc84b,_0x186278,_0x1207a4,_0x2d5db3){return function(_0x229011){logger[_0x33bc('0x10')]('['+[_0x209384['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x229011);return new Promise(function(_0x257c79,_0x948b92){if(intUtil[_0x33bc('0x16')](_0x229011[_0x33bc('0x17')])){var _0x25d8e3={'method':_0x33bc('0xb'),'uri':_0x186278+_0x33bc('0x18')+_0x229011[_0x33bc('0x17')]+'&'+_0x1207a4+'&'+_0x2d5db3,'auth':_0x4dc84b,'json':!![]};logger[_0x33bc('0x10')]('['+[_0x209384[_0x33bc('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x25d8e3);return rp(_0x25d8e3)[_0x33bc('0x19')](function(_0x2a148b){logger[_0x33bc('0x10')]('['+[_0x209384['toUpperCase']()]+'],\x20getUser\x20entity',_0x2a148b);if(_0x2a148b[_0x33bc('0xd')][_0x33bc('0xe')]>0x0&&String(_0x2a148b['result'][0x0][_0x33bc('0x1a')])===_0x33bc('0x1b')){_0x229011[_0x33bc('0x1c')]=_0x2a148b[_0x33bc('0xd')][0x0][_0x33bc('0xf')];}else{_0x229011[_0x33bc('0x1c')]=_0x229011[_0x33bc('0x1d')];_0x229011[_0x33bc('0x17')]=_0x229011['adminEmail'];}logger[_0x33bc('0x10')]('['+[_0x209384[_0x33bc('0x11')]()]+_0x33bc('0x1e'),_0x229011);_0x257c79(_0x229011);})[_0x33bc('0x13')](function(_0x2793ee){logger[_0x33bc('0x14')]('['+[_0x209384[_0x33bc('0x11')]()]+']',_0x2793ee['message']);_0x948b92(_0x2793ee[_0x33bc('0x15')]);});}else{logger['info']('['+[_0x209384[_0x33bc('0x11')]()]+_0x33bc('0x1f'));_0x229011[_0x33bc('0x1c')]=_0x229011[_0x33bc('0x1d')];_0x229011['userEmail']=_0x229011[_0x33bc('0x20')];_0x257c79(_0x229011);}});};}function createEndUser(_0x20094c,_0x2526af,_0x9a2ed1,_0x23498d,_0x5b78f5){logger[_0x33bc('0x10')]('['+[_0x20094c[_0x33bc('0x11')]()]+_0x33bc('0x21'),_0x9a2ed1);return new Promise(function(_0x4cc30b,_0x43089c){var _0x275d5e={'method':'POST','uri':_0x23498d+_0x33bc('0x22')+_0x5b78f5,'body':{'user_name':_0x9a2ed1[_0x33bc('0x23')],'roles':_0x33bc('0x24'),'first_name':_0x9a2ed1[_0x33bc('0x23')],'active':_0x33bc('0x1b'),'date_format':_0x33bc('0x25'),'phone':_0x9a2ed1[_0x33bc('0x23')]},'auth':_0x2526af,'json':!![]};return rp(_0x275d5e)[_0x33bc('0x19')](function(_0x192d79){logger[_0x33bc('0x10')]('['+[_0x20094c[_0x33bc('0x11')]()]+_0x33bc('0x26'),_0x192d79[_0x33bc('0xd')]);_0x9a2ed1[_0x33bc('0x27')]=_0x192d79[_0x33bc('0xd')][_0x33bc('0xf')];_0x4cc30b(_0x9a2ed1);})[_0x33bc('0x13')](function(_0x95aef2){logger[_0x33bc('0x14')]('['+[_0x20094c['toUpperCase']()]+']',_0x95aef2[_0x33bc('0x15')]);_0x43089c(_0x95aef2[_0x33bc('0x15')]);});});}function getEndUser(_0x58fcd0,_0x49c839,_0x3dc5d1,_0x260980,_0x4882c1){return function(_0x9eb4d9){logger['info']('['+[_0x58fcd0[_0x33bc('0x11')]()]+_0x33bc('0x28'),_0x9eb4d9);return new Promise(function(_0x1a5daf,_0x44b78d){var _0x7350a3={'method':_0x33bc('0xb'),'uri':_0x3dc5d1+_0x33bc('0x29')+_0x9eb4d9[_0x33bc('0x23')]+'&'+_0x260980+'&'+_0x4882c1,'auth':_0x49c839,'json':!![]};return rp(_0x7350a3)[_0x33bc('0x19')](function(_0x4eaca0){if(_0x4eaca0[_0x33bc('0xd')]['length']>0x0){_0x9eb4d9[_0x33bc('0x27')]=_0x4eaca0['result'][0x0][_0x33bc('0xf')];logger[_0x33bc('0x10')]('['+[_0x58fcd0[_0x33bc('0x11')]()]+_0x33bc('0x2a'),_0x9eb4d9);_0x1a5daf(_0x9eb4d9);}else{return createEndUser(_0x58fcd0,_0x49c839,_0x9eb4d9,_0x3dc5d1,_0x260980)['then'](function(_0x3dffca){logger[_0x33bc('0x10')]('['+[_0x58fcd0[_0x33bc('0x11')]()]+'],\x20createEndUser\x20crm',_0x3dffca);_0x1a5daf(_0x3dffca);});}})[_0x33bc('0x13')](function(_0x35130c){logger['error']('['+[_0x58fcd0[_0x33bc('0x11')]()]+']',_0x35130c['message']);_0x44b78d(_0x35130c['message']);});});};}function getCustomFields(_0x241315,_0xf8dcbb){var _0x4d0c40={};if(_0x241315[_0x33bc('0xe')]>0x0){_['forEach'](_0x241315,function(_0x1d4f5b){if(_[_0x33bc('0x2b')](['string',_0x33bc('0x2c')],_0x1d4f5b[_0x33bc('0x2d')])&&_0x1d4f5b['nameField']&&!_0x1d4f5b[_0x33bc('0x2e')]){_0x4d0c40[_0x1d4f5b['nameField'][_0x33bc('0x2f')]()]=_0x1d4f5b['content'][_0x33bc('0x30')]();}else if(_['includes']([_0x33bc('0x31'),_0x33bc('0x2c')],_0x1d4f5b['type'])&&_0x1d4f5b['idField']&&_0x1d4f5b[_0x33bc('0x2e')]){_0x4d0c40[_0x1d4f5b['idField'][_0x33bc('0x2f')]()]=_0x1d4f5b[_0x33bc('0x32')][_0x33bc('0x30')]();}else if(_0x1d4f5b[_0x33bc('0x2d')]==='variable'&&_0x1d4f5b[_0x33bc('0x33')]&&_0x1d4f5b[_0x33bc('0x34')]&&_0x1d4f5b['customField']){_0x4d0c40[_0x1d4f5b[_0x33bc('0x34')][_0x33bc('0x2f')]()]=_0xf8dcbb[_0x1d4f5b[_0x33bc('0x33')]]['toString']();}else if(_0x1d4f5b[_0x33bc('0x2d')]===_0x33bc('0x35')&&_0x1d4f5b[_0x33bc('0x36')]&&_0x1d4f5b[_0x33bc('0x36')][_0x33bc('0x37')]&&_0x1d4f5b['idField']&&_0x1d4f5b['customField']){_0x4d0c40[_0x1d4f5b[_0x33bc('0x34')]['toLowerCase']()]=_0xf8dcbb[_0x1d4f5b[_0x33bc('0x36')][_0x33bc('0x37')][_0x33bc('0x2f')]()]['toString']();}});}return _0x4d0c40;}function getTicket(_0x39443c,_0x45632f,_0x2ecf20,_0x2d6f53,_0x1ff84b,_0x3041e4){return function(_0x48f9f6){logger['info']('['+[_0x39443c[_0x33bc('0x11')]()]+_0x33bc('0x38'),_0x48f9f6);return new Promise(function(_0x31007f,_0x22c782){var _0x414899=_0x39443c[_0x33bc('0x2f')]()==='outbound'?_0x48f9f6[_0x33bc('0x1c')]:_0x48f9f6['endUserId'];var _0x397077={'method':_0x33bc('0x39'),'uri':_0x2ecf20+_0x33bc('0x3a')+'?'+_0x3041e4,'body':Object[_0x33bc('0x3b')]({},{'active':_0x33bc('0x1b'),'caller_id':_0x414899,'assigned_to':_0x48f9f6[_0x33bc('0x1c')],'short_description':intUtil[_0x33bc('0x3c')](_0x2d6f53[_0x33bc('0x3d')],_0x1ff84b,'\x20'),'description':intUtil[_0x33bc('0x3c')](_0x2d6f53[_0x33bc('0x3e')],_0x1ff84b,'\x0a')},getCustomFields(_0x2d6f53[_0x33bc('0x3f')],_0x1ff84b)),'auth':_0x45632f,'json':!![]};return rp(_0x397077)[_0x33bc('0x19')](function(_0x70a6ff){logger[_0x33bc('0x10')]('['+[_0x39443c[_0x33bc('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x70a6ff[_0x33bc('0xd')]);_0x48f9f6[_0x33bc('0x40')]=_0x70a6ff[_0x33bc('0xd')]['sys_id'];_0x48f9f6[_0x33bc('0x41')]=_0x70a6ff[_0x33bc('0xd')][_0x33bc('0x42')];logger['info']('['+[_0x39443c[_0x33bc('0x11')]()]+']\x20getTicket\x20crm',_0x48f9f6);_0x31007f(_0x48f9f6);})['catch'](function(_0xb3cfbb){logger['error']('['+[_0x39443c['toUpperCase']()]+']',_0xb3cfbb[_0x33bc('0x15')]);_0x22c782(_0xb3cfbb[_0x33bc('0x15')]);});});};}function createRemoteTag(_0x221af9,_0x6f94dc,_0x3d1f09,_0x13d36d){return new Promise(function(_0x42c058,_0x188f4c){var _0x1b047f={'method':_0x33bc('0x39'),'uri':_0x3d1f09+_0x33bc('0x43')+'?'+_0x13d36d,'body':{'short_description':_0x221af9,'global':!![],'active':!![],'name':_0x221af9},'auth':_0x6f94dc,'json':!![]};return rp(_0x1b047f)[_0x33bc('0x19')](function(_0x476662){var _0x9c427=_0x476662[_0x33bc('0xd')][_0x33bc('0xf')];_0x42c058(_0x9c427);});});}function getRemoteTag(_0x3813ea,_0x21a0cc,_0x371abf,_0xc8447d,_0x51c06d){return new Promise(function(_0x555d8f,_0x5b3147){var _0x4cadf7={'method':_0x33bc('0xb'),'uri':_0x371abf+'label'+_0x33bc('0x44')+_0x3813ea+'&'+_0xc8447d,'auth':_0x21a0cc,'json':!![]};return rp(_0x4cadf7)['then'](function(_0xb6cca7){if(_0xb6cca7['result'][_0x33bc('0xe')]>0x0){var _0xae4340=_0xb6cca7[_0x33bc('0xd')][0x0][_0x33bc('0xf')];_0x555d8f(_0xae4340);}else{return createRemoteTag(_0x3813ea,_0x21a0cc,_0x371abf,_0xc8447d)['then'](function(_0xb3dc7c){_0x555d8f(_0xb3dc7c);});}});});}function assignTagToIncident(_0x581fb2,_0x325506,_0xbc7282,_0x6a9e6a,_0x44b2e8){return new Promise(function(_0x2af7af,_0x24724f){var _0x4245ff={'method':_0x33bc('0x39'),'uri':_0xbc7282+_0x33bc('0x45')+'?'+_0x44b2e8,'body':{'label':_0x581fb2,'table':_0x33bc('0x3a'),'id_type':_0x33bc('0x46'),'table_key':_0x6a9e6a['ticketId'],'title':_0x33bc('0x47')+_0x6a9e6a[_0x33bc('0x41')],'id_display':_0x6a9e6a[_0x33bc('0x41')]},'auth':_0x325506,'json':!![]};return rp(_0x4245ff)[_0x33bc('0x19')](function(_0x30063a){_0x2af7af();})[_0x33bc('0x13')](function(){_0x2af7af();});});}function manageTags(_0x1ab94f,_0x54b326,_0x2cd576,_0x3a89ff,_0x3dd1d9,_0x5cf8cb,_0x1d75a0){return new Promise(function(_0x237fa8,_0x8da00a){var _0x9a7ece=[];_0x54b326[_0x33bc('0x48')](function(_0x1cdd9c){_0x9a7ece[_0x33bc('0x49')](getRemoteTag(_0x1cdd9c,_0x2cd576,_0x3a89ff,_0x5cf8cb,_0x1d75a0));});return Promise[_0x33bc('0x4a')](_0x9a7ece)[_0x33bc('0x19')](function(_0x2142fe){if(_0x2142fe[_0x33bc('0xe')]){logger[_0x33bc('0x10')]('['+[_0x1ab94f[_0x33bc('0x11')]()]+_0x33bc('0x4b'),_0x2142fe);var _0x14154d=[];_0x2142fe[_0x33bc('0x48')](function(_0x4093d4){_0x14154d['push'](assignTagToIncident(_0x4093d4,_0x2cd576,_0x3a89ff,_0x3dd1d9,_0x5cf8cb));});return Promise['all'](_0x14154d)['then'](function(){_0x237fa8();})[_0x33bc('0x13')](function(){_0x237fa8();});}else{_0x237fa8();}});});}function getTags(_0xac6e38,_0x293ced,_0x5270c5,_0x6acf8,_0x4f0c25,_0x2860ae){return function(_0xdf7e4c){return new Promise(function(_0x187f06,_0x5690f6){var _0x47a7ab=[];var _0x54764c=_0x6acf8['Tags'];if(_0x54764c&&_0x54764c['length']>0x0){_0x47a7ab=_['map'](_0x54764c,_0x33bc('0x37'));}if(_0x47a7ab[_0x33bc('0xe')]>0x0){return manageTags(_0xac6e38,_0x47a7ab,_0x293ced,_0x5270c5,_0xdf7e4c,_0x4f0c25,_0x2860ae)['then'](function(){_0x187f06(_0xdf7e4c);});}else{_0x187f06(_0xdf7e4c);}});};}function emit(_0x56df86,_0x5925d5,_0xfdc44d){var _0x493537=_0x33bc('0x4c')+_0x33bc('0x4d')+_0x33bc('0x4e')+'%255EORDERBYDESCnumber';var _0x5c146a={'uri':_0x56df86+'/nav_to.do?uri=incident.do?sys_id%3D'+_0xfdc44d+_0x493537};io['to'](util[_0x33bc('0x4f')](_0x33bc('0x50'),_0x5925d5))[_0x33bc('0x51')](_0x33bc('0x52'),_0x5c146a);}exports['cs']=function(_0x171e77,_0x4198b4,_0x4d970e,_0x419895,_0x533606,_0x99176e,_0xe08b07,_0x5984c3){var _0x9265ef={};var _0x174784={'user':_0x99176e['username'],'pass':_0x99176e[_0x33bc('0x53')]};var _0x289b72=_0x33bc('0x54');var _0x4d452d='sysparm_display_value=true';_0x99176e['remoteUri']=intUtil[_0x33bc('0x55')](_0x99176e[_0x33bc('0x56')]);_0x99176e[_0x33bc('0x57')]=intUtil['stripTrailingSlash'](_0x99176e[_0x33bc('0x57')]);var _0x3e8cec=util['format'](_0x33bc('0x58'),_0x99176e[_0x33bc('0x56')]);_0x9265ef[_0x33bc('0x17')]=!_[_0x33bc('0x59')](_0x419895)?_0x419895[_0x33bc('0x5a')]:null;_0x9265ef['adminEmail']=_0x99176e[_0x33bc('0x5a')];_0x9265ef[_0x33bc('0x23')]=_0x5984c3['toLowerCase']()===_0x33bc('0x5b')?_0x4198b4['destcalleridnum']:_0x4198b4[_0x33bc('0x5c')];_0x9265ef[_0x33bc('0x5d')]=_0x5984c3===_0x33bc('0x5e')||_0x5984c3===_0x33bc('0x5f')?_0x33bc('0x5e'):_0x33bc('0x5b');var _0x1b5ab3=util[_0x33bc('0x4f')](_0x33bc('0x60'),_0x99176e[_0x33bc('0x57')],_0x4198b4[_0x33bc('0x61')],md5(_0x4198b4[_0x33bc('0x61')]));if(_0x533606&&_0x533606[_0x33bc('0x62')]){logger[_0x33bc('0x10')](_0x33bc('0x63'),_0x33bc('0x64'));_0x4198b4[_0x33bc('0x65')]=_0x1b5ab3;}else if(_0xe08b07&&_0xe08b07['recordingFormat']&&_0xe08b07[_0x33bc('0x66')]!=='none'){logger['info']('[OUTBOUND]',_0x33bc('0x64'));_0x4198b4[_0x33bc('0x65')]=_0x1b5ab3;}else{_0x4198b4['recordingURL']='';}return getAdminUser(_0x5984c3,_0x174784,_0x9265ef,_0x3e8cec,_0x4d452d,_0x289b72)[_0x33bc('0x19')](getUser(_0x5984c3,_0x174784,_0x3e8cec,_0x4d452d,_0x289b72))[_0x33bc('0x19')](getEndUser(_0x5984c3,_0x174784,_0x3e8cec,_0x4d452d,_0x289b72))[_0x33bc('0x19')](getTicket(_0x5984c3,_0x174784,_0x3e8cec,_0x4d970e,_0x4198b4,_0x4d452d))['then'](function(_0x256c97){logger[_0x33bc('0x10')](util[_0x33bc('0x4f')](_0x33bc('0x67'),_0x256c97[_0x33bc('0x40')]));logger[_0x33bc('0x10')](util[_0x33bc('0x4f')](_0x33bc('0x68'),_0x5984c3));if(_0x5984c3!==_0x33bc('0x5f')){logger[_0x33bc('0x10')]('['+[_0x5984c3[_0x33bc('0x11')]()]+']',_0x33bc('0x69'));emit(_0x99176e['remoteUri'],_0x419895[_0x33bc('0x37')],_0x256c97['ticketId']);}})[_0x33bc('0x13')](function(_0x30bcf0){logger[_0x33bc('0x14')]('['+[_0x5984c3[_0x33bc('0x11')]()]+_0x33bc('0x6a'),util[_0x33bc('0x6b')](_0x30bcf0,{'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 d04dd1a..7b90415 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 _0xfd41=['Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','map','forEach','type','nameField','customField','content','string','custom_fields','customVariable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridname','destcalleridnum','unmanaged','monitor_format','lastevent','isNil','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','POST','emit','name','getString','assigned_user_id','description','slice','replace','duration_hours','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','get_server_info','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!'];(function(_0x1eec3a,_0x168828){var _0x133cf7=function(_0x1a0c97){while(--_0x1a0c97){_0x1eec3a['push'](_0x1eec3a['shift']());}};_0x133cf7(++_0x168828);}(_0xfd41,0xbb));var _0x1fd4=function(_0x4fa166,_0x58b7fb){_0x4fa166=_0x4fa166-0x0;var _0x5dd974=_0xfd41[_0x4fa166];return _0x5dd974;};'use strict';var _=require(_0x1fd4('0x0'));var rp=require(_0x1fd4('0x1'));var BPromise=require(_0x1fd4('0x2'));var md5=require(_0x1fd4('0x3'));var util=require(_0x1fd4('0x4'));var Redis=require(_0x1fd4('0x5'));var intUtil=require(_0x1fd4('0x6'));var config=require(_0x1fd4('0x7'));var logger=require(_0x1fd4('0x8'))(_0x1fd4('0x9'));config['redis']=_[_0x1fd4('0xa')](config[_0x1fd4('0xb')],{'host':_0x1fd4('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1fd4('0xb')]));var def={'method':_0x1fd4('0xd'),'json':!![]};function emit(_0x28033d,_0xd07df3,_0x1b326c){io['to'](_0x28033d)[_0x1fd4('0xe')](_0xd07df3,_0x1b326c);}function getTicket(_0x55c98d,_0x3d1b1b,_0x4ce5a1,_0x184229,_0x23cdcf,_0x214a65,_0x25e081,_0x460905){logger['info']('Creating\x20new\x20ticket...');var _0x2cc8fe=new Date();var _0x62bce0=[{'name':_0x1fd4('0xf'),'value':intUtil[_0x1fd4('0x10')](_0x184229['Subjects'],_0x23cdcf,'\x20')},{'name':_0x1fd4('0x11'),'value':_0x3d1b1b['id']},{'name':'created_by','value':_0x3d1b1b['id']},{'name':_0x1fd4('0x12'),'value':intUtil['getString'](_0x184229['Descriptions'],_0x23cdcf,'\x0a')},{'name':'date_start','value':_0x2cc8fe['toISOString']()[_0x1fd4('0x13')](0x0,0x13)[_0x1fd4('0x14')]('T','\x20')},{'name':_0x1fd4('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x1fd4('0x16'),'value':_0x4ce5a1['id']},{'name':_0x1fd4('0x17'),'value':_0x1fd4('0x18')},{'name':_0x1fd4('0x19'),'value':_0x4ce5a1[_0x1fd4('0xf')]},{'name':_0x1fd4('0x1a'),'value':_0x460905}];if(_0x214a65[_0x1fd4('0x1b')]){_['forEach'](_0x214a65,function(_0x289267){if(_0x23cdcf[_0x289267[_0x1fd4('0x1c')]]){_0x62bce0[_0x1fd4('0x1d')]({'name':_0x289267[_0x1fd4('0x1e')],'value':_0x23cdcf[_0x289267[_0x1fd4('0x1c')]]});}});}return request({'form':{'method':_0x1fd4('0x1f'),'input_type':_0x1fd4('0x20'),'response_type':_0x1fd4('0x20'),'rest_data':JSON[_0x1fd4('0x21')]({'session':_0x25e081['id'],'module_name':_0x1fd4('0x22'),'name_value_list':_0x62bce0})}});}function getAuth(_0x21a076){return util[_0x1fd4('0x23')]('Basic\x20%s',new Buffer(_0x21a076[_0x1fd4('0x24')]+':X')[_0x1fd4('0x25')]('base64'));}function getServerInfo(_0x8dcd6e){return request({'form':{'method':_0x1fd4('0x26'),'input_type':_0x1fd4('0x20'),'response_type':_0x1fd4('0x20'),'rest_data':JSON[_0x1fd4('0x21')]({'session':_0x8dcd6e['id']})}});}function getUser(_0x1df7cb,_0x42a707,_0xacf062){if(!_['isNil'](_0x42a707)){logger[_0x1fd4('0x27')](_0x1fd4('0x28'),_0x42a707);return request({'form':{'method':_0x1fd4('0x29'),'input_type':_0x1fd4('0x20'),'response_type':_0x1fd4('0x20'),'rest_data':JSON[_0x1fd4('0x21')]({'session':_0xacf062['id'],'module_name':_0x1fd4('0x2a'),'query':util['format'](_0x1fd4('0x2b'),_0x42a707),'order_by':'','offset':'0','select_fields':['id',_0x1fd4('0xf'),_0x1fd4('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1fd4('0x2d')](function(_0x4ee97e){if(_0x4ee97e[_0x1fd4('0x2e')][_0x1fd4('0x1b')]){var _0x2251a3=_[_0x1fd4('0x2f')](_0x4ee97e[_0x1fd4('0x2e')],function(_0x3003ea){return _0x3003ea[_0x1fd4('0x30')][_0x1fd4('0x2c')][_0x1fd4('0x31')]===_0x42a707;});if(_0x2251a3){logger['info'](_0x1fd4('0x32'));return BPromise['resolve']({'id':_0x2251a3['name_value_list']['id'][_0x1fd4('0x31')],'name':_0x2251a3[_0x1fd4('0x30')][_0x1fd4('0xf')][_0x1fd4('0x31')]});}}logger[_0x1fd4('0x27')](_0x1fd4('0x33'));return BPromise[_0x1fd4('0x34')]({'id':_0xacf062[_0x1fd4('0x30')][_0x1fd4('0x35')][_0x1fd4('0x31')],'name':_0xacf062[_0x1fd4('0x30')][_0x1fd4('0x2c')][_0x1fd4('0x31')]});});}else{logger[_0x1fd4('0x27')](_0x1fd4('0x36'));return BPromise['resolve']({'id':_0xacf062[_0x1fd4('0x30')][_0x1fd4('0x35')][_0x1fd4('0x31')],'name':_0xacf062['name_value_list'][_0x1fd4('0x2c')][_0x1fd4('0x31')]});}}function getEndUser(_0x517f2a,_0x35a44a,_0x4a7147,_0x28cd6f){logger[_0x1fd4('0x27')](_0x1fd4('0x37'),_0x4a7147);return request({'form':{'method':_0x1fd4('0x29'),'input_type':_0x1fd4('0x20'),'response_type':_0x1fd4('0x20'),'rest_data':JSON[_0x1fd4('0x21')]({'session':_0x28cd6f['id'],'module_name':'Contacts','query':util[_0x1fd4('0x23')](_0x1fd4('0x38'),_0x4a7147),'order_by':'','offset':'0','select_fields':['id',_0x1fd4('0xf'),_0x1fd4('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1fd4('0x2d')](function(_0x57d880){if(_0x57d880[_0x1fd4('0x2e')][_0x1fd4('0x1b')]){var _0x293691=_[_0x1fd4('0x2f')](_0x57d880[_0x1fd4('0x2e')],function(_0x30db4d){return _0x30db4d[_0x1fd4('0x30')][_0x1fd4('0x39')][_0x1fd4('0x31')]===_0x4a7147;});if(_0x293691){logger['info']('Enduser\x20found!');return BPromise[_0x1fd4('0x34')]({'id':_0x293691['name_value_list']['id'][_0x1fd4('0x31')],'name':_0x293691[_0x1fd4('0x30')][_0x1fd4('0xf')][_0x1fd4('0x31')],'phone':_0x293691[_0x1fd4('0x30')]['phone_home'][_0x1fd4('0x31')]});}}else{logger['info'](_0x1fd4('0x3a'));return request({'form':{'method':'set_entry','input_type':_0x1fd4('0x20'),'response_type':'JSON','rest_data':JSON[_0x1fd4('0x21')]({'session':_0x28cd6f['id'],'module_name':_0x1fd4('0x18'),'name_value_list':[{'name':_0x1fd4('0x3b'),'value':_0x35a44a!==_0x1fd4('0x3c')?_0x35a44a:util[_0x1fd4('0x23')](_0x1fd4('0x3d'),_0x4a7147)},{'name':_0x1fd4('0x39'),'value':_0x4a7147}]})}})[_0x1fd4('0x2d')](function(_0x8cd779){logger['info']('Enduser\x20created.');return BPromise[_0x1fd4('0x34')]({'id':_0x8cd779['id'],'name':_0x8cd779['entry_list'][_0x1fd4('0x3b')][_0x1fd4('0x31')],'phone':_0x8cd779[_0x1fd4('0x2e')][_0x1fd4('0x39')]['value']});});}});}function request(_0x41f542){logger[_0x1fd4('0x3e')](_0x1fd4('0x3f'),JSON[_0x1fd4('0x21')](_0x41f542));return rp(_['merge'](def,_0x41f542));}function getTags(_0x25a357,_0x5b2270){var _0x576447=[];if(_0x25a357&&_0x25a357[_0x1fd4('0x1b')]>0x0){_0x576447=_[_0x1fd4('0x40')](_0x25a357,_0x5b2270);}return _0x576447;}function getCustomFields(_0x5650f4,_0x339a35){var _0x2fc485=[];var _0x2da4ba={'custom_fields':[]};if(_0x5650f4[_0x1fd4('0x1b')]>0x0){_[_0x1fd4('0x41')](_0x5650f4,function(_0x5be5c8){if(_0x5be5c8[_0x1fd4('0x42')]==='string'&&_0x5be5c8[_0x1fd4('0x43')]&&!_0x5be5c8[_0x1fd4('0x44')]){_0x2da4ba[_0x5be5c8[_0x1fd4('0x43')]['toLowerCase']()]=_0x5be5c8[_0x1fd4('0x45')][_0x1fd4('0x25')]();}else if(_0x5be5c8[_0x1fd4('0x42')]===_0x1fd4('0x46')&&_0x5be5c8[_0x1fd4('0x1e')]&&_0x5be5c8[_0x1fd4('0x44')]){_0x2da4ba[_0x1fd4('0x47')][_0x1fd4('0x1d')]({'id':_0x5be5c8[_0x1fd4('0x1e')],'value':_0x5be5c8[_0x1fd4('0x45')][_0x1fd4('0x25')]()});}else if(_0x5be5c8[_0x1fd4('0x42')]==='variable'&&_0x5be5c8['variableName']&&_0x5be5c8[_0x1fd4('0x1e')]&&_0x5be5c8['customField']){_0x339a35[_0x5be5c8['variableName']]&&_0x2da4ba['custom_fields'][_0x1fd4('0x1d')]({'id':_0x5be5c8['idField'],'value':_0x339a35[_0x5be5c8[_0x1fd4('0x1c')]][_0x1fd4('0x25')]()});}else if(_0x5be5c8[_0x1fd4('0x42')]===_0x1fd4('0x48')&&_0x5be5c8[_0x1fd4('0x49')]&&_0x5be5c8[_0x1fd4('0x49')]['name']&&_0x5be5c8[_0x1fd4('0x1e')]&&_0x5be5c8[_0x1fd4('0x44')]){_0x339a35[_0x5be5c8['Variable'][_0x1fd4('0xf')][_0x1fd4('0x4a')]()]&&_0x2da4ba[_0x1fd4('0x47')]['push']({'id':_0x5be5c8[_0x1fd4('0x1e')],'value':_0x339a35[_0x5be5c8[_0x1fd4('0x49')]['name'][_0x1fd4('0x4a')]()]['toString']()});}});}return _0x2da4ba;}function getConnection(_0x2edeed){return request({'method':_0x1fd4('0xd'),'form':{'method':_0x1fd4('0x4b'),'input_type':_0x1fd4('0x20'),'response_type':_0x1fd4('0x20'),'rest_data':JSON[_0x1fd4('0x21')]({'user_auth':{'user_name':_0x2edeed[_0x1fd4('0x4c')],'password':_0x2edeed['password'],'encryption':_0x1fd4('0x4d')},'application':_0x1fd4('0x4e')})}})[_0x1fd4('0x2d')](function(_0x384a34){var _0x51035d=_0x384a34;if(_0x51035d['id']){def[_0x1fd4('0x4f')]=_0x51035d['id'];return BPromise[_0x1fd4('0x34')](_0x51035d);}else{throw new Error(util[_0x1fd4('0x23')](_0x1fd4('0x50'),_0x2edeed['id']));}});}function setRelationship(_0xe6639c,_0x4e9979,_0x5f1fb6,_0x154c3a){return request({'form':{'method':_0x1fd4('0x51'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0xe6639c['id'],'module_name':_0x1fd4('0x22'),'module_id':_0x5f1fb6['id'],'link_field_name':_0x154c3a,'related_ids':[_0x4e9979['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1fd4('0x52')]=function(_0x58073d,_0x1dedb0,_0x4e7232,_0x24e924,_0x328edd,_0x43d3ef){var _0x3def6f,_0x4b272d,_0x441d38,_0x17055f;_0x43d3ef['remoteUri']=intUtil[_0x1fd4('0x53')](_0x43d3ef[_0x1fd4('0x54')]);_0x43d3ef[_0x1fd4('0x55')]=intUtil[_0x1fd4('0x53')](_0x43d3ef[_0x1fd4('0x55')]);def[_0x1fd4('0x56')]=util[_0x1fd4('0x23')](_0x1fd4('0x57'),_0x43d3ef[_0x1fd4('0x54')]);if(_0x328edd&&_0x328edd['monitor_format']){logger[_0x1fd4('0x27')](_0x1fd4('0x58'),'Recording\x20is\x20enabled!');_0x1dedb0[_0x1fd4('0x59')]=util[_0x1fd4('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43d3ef['serverUrl'],_0x1dedb0['uniqueid'],md5(_0x1dedb0['uniqueid']));}else{_0x1dedb0[_0x1fd4('0x59')]='';}return getConnection(_0x43d3ef)[_0x1fd4('0x2d')](function(_0x17df9e){_0x17055f=_0x17df9e;return getUser(_0x43d3ef,_0x24e924['name'],_0x17055f);})[_0x1fd4('0x2d')](function(_0x7936d7){_0x3def6f=_0x7936d7;logger[_0x1fd4('0x27')](_0x1fd4('0x5a'),_0x3def6f['id']);return getEndUser(_0x43d3ef,_0x1dedb0[_0x1fd4('0x5b')],_0x1dedb0[_0x1fd4('0x5c')],_0x17055f);})[_0x1fd4('0x2d')](function(_0x3b61aa){_0x4b272d=_0x3b61aa;logger['info'](_0x1fd4('0x5d'),_0x4b272d['id']);return getTicket(_0x43d3ef,_0x3def6f,_0x4b272d,_0x4e7232,_0x1dedb0,_0x4e7232[_0x1fd4('0x5e')],_0x17055f,_0x1fd4('0x5f'));})[_0x1fd4('0x2d')](function(_0x3e7edd){_0x441d38=_0x3e7edd;logger[_0x1fd4('0x27')](_0x1fd4('0x60'));logger[_0x1fd4('0x27')](_0x1fd4('0x61'),_0x441d38['id']);return setRelationship(_0x17055f,_0x3def6f,_0x441d38,_0x1fd4('0x62'));})[_0x1fd4('0x2d')](function(){return setRelationship(_0x17055f,_0x4b272d,_0x441d38,_0x1fd4('0x63'));})[_0x1fd4('0x2d')](function(){return getServerInfo(_0x17055f);})[_0x1fd4('0x2d')](function(_0x2ab2cb){var _0x362083=parseInt(_0x2ab2cb[_0x1fd4('0x64')]['charAt'](0x0));var _0x1b2855=util['format'](_0x1fd4('0x65'),_0x43d3ef['remoteUri'],_0x441d38['id']);if(_0x362083>0x6){_0x1b2855=util[_0x1fd4('0x23')](_0x1fd4('0x66'),_0x43d3ef[_0x1fd4('0x54')],_0x441d38['id']);}logger[_0x1fd4('0x27')]('[QUEUE]',_0x1fd4('0x67'));emit(util[_0x1fd4('0x23')](_0x1fd4('0x68'),_0x24e924[_0x1fd4('0xf')]),_0x1fd4('0x69'),{'uri':_0x1b2855});})[_0x1fd4('0x6a')](function(_0xf72a24){logger[_0x1fd4('0x6b')](_0x1fd4('0x58'),JSON['stringify'](_0xf72a24));});};exports['outbound']=function(_0x386148,_0x315be9,_0x1a511d,_0x10a2b5,_0x3b627d,_0x4544a6,_0x598791){var _0x3af709,_0x405d49,_0x2f4279,_0x2090bf;_0x4544a6['remoteUri']=intUtil[_0x1fd4('0x53')](_0x4544a6[_0x1fd4('0x54')]);_0x4544a6[_0x1fd4('0x55')]=intUtil['stripTrailingSlash'](_0x4544a6['serverUrl']);def[_0x1fd4('0x56')]=util[_0x1fd4('0x23')]('%s/service/v4_1/rest.php',_0x4544a6[_0x1fd4('0x54')]);if(_0x598791&&_0x598791[_0x1fd4('0x6c')]&&_0x598791[_0x1fd4('0x6c')]!==_0x1fd4('0x6d')){logger[_0x1fd4('0x27')](_0x1fd4('0x6e'),_0x1fd4('0x6f'));_0x315be9[_0x1fd4('0x59')]=util[_0x1fd4('0x23')](_0x1fd4('0x70'),_0x4544a6[_0x1fd4('0x55')],_0x315be9[_0x1fd4('0x71')],md5(_0x315be9[_0x1fd4('0x71')]));}return getConnection(_0x4544a6)[_0x1fd4('0x2d')](function(_0xcde11){_0x2090bf=_0xcde11;return getUser(_0x4544a6,_0x10a2b5[_0x1fd4('0xf')],_0x2090bf);})[_0x1fd4('0x2d')](function(_0x19453a){_0x3af709=_0x19453a;logger[_0x1fd4('0x27')](_0x1fd4('0x5a'),_0x3af709['id']);return getEndUser(_0x4544a6,_0x315be9[_0x1fd4('0x72')],_0x315be9[_0x1fd4('0x73')],_0x2090bf);})[_0x1fd4('0x2d')](function(_0x270f3c){_0x405d49=_0x270f3c;logger['info'](_0x1fd4('0x5d'),_0x405d49['id']);return getTicket(_0x4544a6,_0x3af709,_0x405d49,_0x1a511d,_0x315be9,_0x1a511d[_0x1fd4('0x5e')],_0x2090bf,'Outbound');})[_0x1fd4('0x2d')](function(_0x5a3019){_0x2f4279=_0x5a3019;logger[_0x1fd4('0x27')](_0x1fd4('0x60'));logger[_0x1fd4('0x27')](_0x1fd4('0x61'),_0x2f4279['id']);return setRelationship(_0x2090bf,_0x3af709,_0x2f4279,'users');})[_0x1fd4('0x2d')](function(){return setRelationship(_0x2090bf,_0x405d49,_0x2f4279,'contacts');})[_0x1fd4('0x2d')](function(){return getServerInfo(_0x2090bf);})[_0x1fd4('0x2d')](function(_0x49e74e){var _0x32e350=parseInt(_0x49e74e[_0x1fd4('0x64')]['charAt'](0x0));var _0x7b6db8=util[_0x1fd4('0x23')](_0x1fd4('0x65'),_0x4544a6['remoteUri'],_0x2f4279['id']);if(_0x32e350>0x6){_0x7b6db8=util[_0x1fd4('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4544a6['remoteUri'],_0x2f4279['id']);}logger[_0x1fd4('0x27')]('[OUTBOUND]',_0x1fd4('0x67'));emit(util[_0x1fd4('0x23')]('user:%s',_0x10a2b5[_0x1fd4('0xf')]),_0x1fd4('0x69'),{'uri':_0x7b6db8});})[_0x1fd4('0x6a')](function(_0x16ca08){logger[_0x1fd4('0x6b')](_0x1fd4('0x6e'),JSON['stringify'](_0x16ca08));});};exports[_0x1fd4('0x74')]=function(_0x2d6798,_0x522a25,_0x284c1d,_0x50bfc9,_0x630204,_0xed5b3c){var _0x1db69c,_0x3e5a4a,_0x342942,_0x50d645;_0xed5b3c[_0x1fd4('0x54')]=intUtil[_0x1fd4('0x53')](_0xed5b3c['remoteUri']);_0xed5b3c[_0x1fd4('0x55')]=intUtil[_0x1fd4('0x53')](_0xed5b3c['serverUrl']);def[_0x1fd4('0x56')]=util['format'](_0x1fd4('0x57'),_0xed5b3c[_0x1fd4('0x54')]);if(_0x630204&&_0x630204[_0x1fd4('0x75')]){logger[_0x1fd4('0x27')]('['+_0x522a25[_0x1fd4('0x76')]['toUpperCase']()+']',_0x1fd4('0x6f'));_0x522a25[_0x1fd4('0x59')]=util[_0x1fd4('0x23')](_0x1fd4('0x70'),_0xed5b3c['serverUrl'],_0x522a25[_0x1fd4('0x71')],md5(_0x522a25[_0x1fd4('0x71')]));}else{_0x522a25['recordingURL']='';}return getConnection(_0xed5b3c)[_0x1fd4('0x2d')](function(_0x2d5dd2){_0x50d645=_0x2d5dd2;if(!_[_0x1fd4('0x77')](_0x50bfc9)){return getUser(_0xed5b3c,_0x50bfc9['name'],_0x50d645);}else{return getUser(_0xed5b3c,null,_0x50d645);}})[_0x1fd4('0x2d')](function(_0x5a654d){_0x1db69c=_0x5a654d;logger[_0x1fd4('0x27')](_0x1fd4('0x5a'),_0x1db69c['id']);return getEndUser(_0xed5b3c,_0x522a25[_0x1fd4('0x5b')],_0x522a25[_0x1fd4('0x5c')],_0x50d645);})['then'](function(_0x1189c6){_0x3e5a4a=_0x1189c6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3e5a4a['id']);return getTicket(_0xed5b3c,_0x1db69c,_0x3e5a4a,_0x284c1d,_0x522a25,_0x284c1d[_0x1fd4('0x5e')],_0x50d645,'Inbound');})['then'](function(_0x335381){_0x342942=_0x335381;logger['info'](_0x1fd4('0x60'));logger['info'](_0x1fd4('0x61'),_0x342942['id']);return setRelationship(_0x50d645,_0x1db69c,_0x342942,'users');})[_0x1fd4('0x2d')](function(){return setRelationship(_0x50d645,_0x3e5a4a,_0x342942,_0x1fd4('0x63'));})[_0x1fd4('0x2d')](function(){return getServerInfo(_0x50d645);})[_0x1fd4('0x6a')](function(_0xf43127){logger['error']('['+_0x522a25['lastevent'][_0x1fd4('0x78')]()+']',JSON[_0x1fd4('0x21')](_0xf43127));});}; \ No newline at end of file +var _0xdb85=['set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','Outbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','lastevent','toUpperCase','Inbound','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','info','Subjects','assigned_user_id','created_by','description','getString','Descriptions','toISOString','duration_hours','parent_id','parent_name','direction','forEach','variableName','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','custom_fields','push','content','customVariable','Variable','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid'];(function(_0x2816f5,_0x5cd8ed){var _0x13929a=function(_0x2dc8f1){while(--_0x2dc8f1){_0x2816f5['push'](_0x2816f5['shift']());}};_0x13929a(++_0x5cd8ed);}(_0xdb85,0x18d));var _0x5db8=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xdb85[_0x31172e];return _0x414ada;};'use strict';var _=require(_0x5db8('0x0'));var rp=require(_0x5db8('0x1'));var BPromise=require(_0x5db8('0x2'));var md5=require(_0x5db8('0x3'));var util=require(_0x5db8('0x4'));var Redis=require('ioredis');var intUtil=require(_0x5db8('0x5'));var config=require(_0x5db8('0x6'));var logger=require(_0x5db8('0x7'))('sugarcrm');config['redis']=_[_0x5db8('0x8')](config[_0x5db8('0x9')],{'host':_0x5db8('0xa'),'port':0x18eb});var io=require(_0x5db8('0xb'))(new Redis(config[_0x5db8('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x3ac882,_0x1090ba,_0x1f8d5c){io['to'](_0x3ac882)[_0x5db8('0xc')](_0x1090ba,_0x1f8d5c);}function getTicket(_0x2094cb,_0x1324f9,_0x217c8b,_0x26919b,_0x3e23f6,_0x254c70,_0x103cee,_0x198afa){logger[_0x5db8('0xd')]('Creating\x20new\x20ticket...');var _0x2e64e4=new Date();var _0x5934d2=[{'name':'name','value':intUtil['getString'](_0x26919b[_0x5db8('0xe')],_0x3e23f6,'\x20')},{'name':_0x5db8('0xf'),'value':_0x1324f9['id']},{'name':_0x5db8('0x10'),'value':_0x1324f9['id']},{'name':_0x5db8('0x11'),'value':intUtil[_0x5db8('0x12')](_0x26919b[_0x5db8('0x13')],_0x3e23f6,'\x0a')},{'name':'date_start','value':_0x2e64e4[_0x5db8('0x14')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x5db8('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x5db8('0x16'),'value':_0x217c8b['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x5db8('0x17'),'value':_0x217c8b['name']},{'name':_0x5db8('0x18'),'value':_0x198afa}];if(_0x254c70['length']){_[_0x5db8('0x19')](_0x254c70,function(_0xf2e9de){if(_0x3e23f6[_0xf2e9de[_0x5db8('0x1a')]]){_0x5934d2['push']({'name':_0xf2e9de[_0x5db8('0x1b')],'value':_0x3e23f6[_0xf2e9de['variableName']]});}});}return request({'form':{'method':_0x5db8('0x1c'),'input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON[_0x5db8('0x1e')]({'session':_0x103cee['id'],'module_name':_0x5db8('0x1f'),'name_value_list':_0x5934d2})}});}function getAuth(_0x3a9309){return util['format'](_0x5db8('0x20'),new Buffer(_0x3a9309['apiKey']+':X')[_0x5db8('0x21')](_0x5db8('0x22')));}function getServerInfo(_0x2f5018){return request({'form':{'method':_0x5db8('0x23'),'input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON['stringify']({'session':_0x2f5018['id']})}});}function getUser(_0x325d91,_0x4faedb,_0x211696){if(!_[_0x5db8('0x24')](_0x4faedb)){logger['info'](_0x5db8('0x25'),_0x4faedb);return request({'form':{'method':_0x5db8('0x26'),'input_type':_0x5db8('0x1d'),'response_type':'JSON','rest_data':JSON[_0x5db8('0x1e')]({'session':_0x211696['id'],'module_name':'Employees','query':util[_0x5db8('0x27')](_0x5db8('0x28'),_0x4faedb),'order_by':'','offset':'0','select_fields':['id','name',_0x5db8('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5db8('0x2a')](function(_0x7ca3bc){if(_0x7ca3bc[_0x5db8('0x2b')][_0x5db8('0x2c')]){var _0x216706=_[_0x5db8('0x2d')](_0x7ca3bc['entry_list'],function(_0x379b7d){return _0x379b7d[_0x5db8('0x2e')]['user_name'][_0x5db8('0x2f')]===_0x4faedb;});if(_0x216706){logger[_0x5db8('0xd')](_0x5db8('0x30'));return BPromise[_0x5db8('0x31')]({'id':_0x216706[_0x5db8('0x2e')]['id'][_0x5db8('0x2f')],'name':_0x216706['name_value_list'][_0x5db8('0x32')][_0x5db8('0x2f')]});}}logger['info'](_0x5db8('0x33'));return BPromise[_0x5db8('0x31')]({'id':_0x211696[_0x5db8('0x2e')][_0x5db8('0x34')][_0x5db8('0x2f')],'name':_0x211696['name_value_list'][_0x5db8('0x29')][_0x5db8('0x2f')]});});}else{logger['info'](_0x5db8('0x35'));return BPromise[_0x5db8('0x31')]({'id':_0x211696[_0x5db8('0x2e')][_0x5db8('0x34')][_0x5db8('0x2f')],'name':_0x211696[_0x5db8('0x2e')][_0x5db8('0x29')][_0x5db8('0x2f')]});}}function getEndUser(_0x7f8d3d,_0x21a017,_0x2a12b1,_0x6cf14){logger[_0x5db8('0xd')]('Searching\x20enduser\x20with\x20phone',_0x2a12b1);return request({'form':{'method':_0x5db8('0x26'),'input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON['stringify']({'session':_0x6cf14['id'],'module_name':_0x5db8('0x36'),'query':util[_0x5db8('0x27')](_0x5db8('0x37'),_0x2a12b1),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5db8('0x2a')](function(_0x25b55a){if(_0x25b55a['entry_list'][_0x5db8('0x2c')]){var _0xa12877=_[_0x5db8('0x2d')](_0x25b55a[_0x5db8('0x2b')],function(_0x4a6f45){return _0x4a6f45['name_value_list'][_0x5db8('0x38')][_0x5db8('0x2f')]===_0x2a12b1;});if(_0xa12877){logger['info'](_0x5db8('0x39'));return BPromise[_0x5db8('0x31')]({'id':_0xa12877[_0x5db8('0x2e')]['id'][_0x5db8('0x2f')],'name':_0xa12877[_0x5db8('0x2e')][_0x5db8('0x32')]['value'],'phone':_0xa12877[_0x5db8('0x2e')][_0x5db8('0x38')][_0x5db8('0x2f')]});}}else{logger['info'](_0x5db8('0x3a'));return request({'form':{'method':_0x5db8('0x1c'),'input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON[_0x5db8('0x1e')]({'session':_0x6cf14['id'],'module_name':'Contacts','name_value_list':[{'name':_0x5db8('0x3b'),'value':_0x21a017!==_0x5db8('0x3c')?_0x21a017:util['format']('Caller\x20-\x20%s',_0x2a12b1)},{'name':_0x5db8('0x38'),'value':_0x2a12b1}]})}})[_0x5db8('0x2a')](function(_0x38d7e2){logger['info'](_0x5db8('0x3d'));return BPromise[_0x5db8('0x31')]({'id':_0x38d7e2['id'],'name':_0x38d7e2[_0x5db8('0x2b')][_0x5db8('0x3b')][_0x5db8('0x2f')],'phone':_0x38d7e2[_0x5db8('0x2b')][_0x5db8('0x38')][_0x5db8('0x2f')]});});}});}function request(_0x24c026){logger[_0x5db8('0x3e')](_0x5db8('0x3f'),JSON['stringify'](_0x24c026));return rp(_[_0x5db8('0x40')](def,_0x24c026));}function getTags(_0x5005ae,_0x4d8565){var _0x39c6b2=[];if(_0x5005ae&&_0x5005ae['length']>0x0){_0x39c6b2=_['map'](_0x5005ae,_0x4d8565);}return _0x39c6b2;}function getCustomFields(_0x292937,_0x391cd3){var _0x5351c0=[];var _0x4aa6e7={'custom_fields':[]};if(_0x292937['length']>0x0){_[_0x5db8('0x19')](_0x292937,function(_0x22e845){if(_0x22e845[_0x5db8('0x41')]===_0x5db8('0x42')&&_0x22e845[_0x5db8('0x43')]&&!_0x22e845[_0x5db8('0x44')]){_0x4aa6e7[_0x22e845[_0x5db8('0x43')][_0x5db8('0x45')]()]=_0x22e845['content']['toString']();}else if(_0x22e845[_0x5db8('0x41')]===_0x5db8('0x42')&&_0x22e845[_0x5db8('0x1b')]&&_0x22e845[_0x5db8('0x44')]){_0x4aa6e7[_0x5db8('0x46')][_0x5db8('0x47')]({'id':_0x22e845[_0x5db8('0x1b')],'value':_0x22e845[_0x5db8('0x48')]['toString']()});}else if(_0x22e845['type']==='variable'&&_0x22e845[_0x5db8('0x1a')]&&_0x22e845['idField']&&_0x22e845['customField']){_0x391cd3[_0x22e845['variableName']]&&_0x4aa6e7[_0x5db8('0x46')]['push']({'id':_0x22e845[_0x5db8('0x1b')],'value':_0x391cd3[_0x22e845['variableName']][_0x5db8('0x21')]()});}else if(_0x22e845[_0x5db8('0x41')]===_0x5db8('0x49')&&_0x22e845[_0x5db8('0x4a')]&&_0x22e845[_0x5db8('0x4a')][_0x5db8('0x32')]&&_0x22e845[_0x5db8('0x1b')]&&_0x22e845['customField']){_0x391cd3[_0x22e845[_0x5db8('0x4a')][_0x5db8('0x32')][_0x5db8('0x45')]()]&&_0x4aa6e7[_0x5db8('0x46')][_0x5db8('0x47')]({'id':_0x22e845[_0x5db8('0x1b')],'value':_0x391cd3[_0x22e845['Variable'][_0x5db8('0x32')]['toLowerCase']()][_0x5db8('0x21')]()});}});}return _0x4aa6e7;}function getConnection(_0x33e9be){return request({'method':'POST','form':{'method':'login','input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON[_0x5db8('0x1e')]({'user_auth':{'user_name':_0x33e9be[_0x5db8('0x4b')],'password':_0x33e9be[_0x5db8('0x4c')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x5db8('0x2a')](function(_0x32e72d){var _0x2be228=_0x32e72d;if(_0x2be228['id']){def[_0x5db8('0x4d')]=_0x2be228['id'];return BPromise['resolve'](_0x2be228);}else{throw new Error(util['format'](_0x5db8('0x4e'),_0x33e9be['id']));}});}function setRelationship(_0x418731,_0x402ab1,_0x24540f,_0x426549){return request({'form':{'method':_0x5db8('0x4f'),'input_type':_0x5db8('0x1d'),'response_type':_0x5db8('0x1d'),'rest_data':JSON[_0x5db8('0x1e')]({'session':_0x418731['id'],'module_name':_0x5db8('0x1f'),'module_id':_0x24540f['id'],'link_field_name':_0x426549,'related_ids':[_0x402ab1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5db8('0x50')]=function(_0x547fb1,_0x156da0,_0x9f998b,_0x44fba0,_0x5bba81,_0x3235bb){var _0x3f5ac8,_0x29a85b,_0x417af9,_0x8d856e;_0x3235bb[_0x5db8('0x51')]=intUtil[_0x5db8('0x52')](_0x3235bb[_0x5db8('0x51')]);_0x3235bb[_0x5db8('0x53')]=intUtil[_0x5db8('0x52')](_0x3235bb[_0x5db8('0x53')]);def['uri']=util[_0x5db8('0x27')](_0x5db8('0x54'),_0x3235bb[_0x5db8('0x51')]);if(_0x5bba81&&_0x5bba81[_0x5db8('0x55')]){logger[_0x5db8('0xd')](_0x5db8('0x56'),_0x5db8('0x57'));_0x156da0[_0x5db8('0x58')]=util[_0x5db8('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3235bb['serverUrl'],_0x156da0[_0x5db8('0x59')],md5(_0x156da0[_0x5db8('0x59')]));}else{_0x156da0['recordingURL']='';}return getConnection(_0x3235bb)[_0x5db8('0x2a')](function(_0x2d99ff){_0x8d856e=_0x2d99ff;return getUser(_0x3235bb,_0x44fba0[_0x5db8('0x32')],_0x8d856e);})['then'](function(_0x289ad1){_0x3f5ac8=_0x289ad1;logger['info'](_0x5db8('0x5a'),_0x3f5ac8['id']);return getEndUser(_0x3235bb,_0x156da0[_0x5db8('0x5b')],_0x156da0[_0x5db8('0x5c')],_0x8d856e);})['then'](function(_0x5f08b7){_0x29a85b=_0x5f08b7;logger[_0x5db8('0xd')](_0x5db8('0x5d'),_0x29a85b['id']);return getTicket(_0x3235bb,_0x3f5ac8,_0x29a85b,_0x9f998b,_0x156da0,_0x9f998b['Fields'],_0x8d856e,'Inbound');})[_0x5db8('0x2a')](function(_0x11fe2f){_0x417af9=_0x11fe2f;logger[_0x5db8('0xd')](_0x5db8('0x5e'));logger[_0x5db8('0xd')]('The\x20Ticket\x20ID\x20is:',_0x417af9['id']);return setRelationship(_0x8d856e,_0x3f5ac8,_0x417af9,'users');})[_0x5db8('0x2a')](function(){return setRelationship(_0x8d856e,_0x29a85b,_0x417af9,_0x5db8('0x5f'));})['then'](function(){return getServerInfo(_0x8d856e);})[_0x5db8('0x2a')](function(_0x4e94bc){var _0x1900f5=parseInt(_0x4e94bc[_0x5db8('0x60')]['charAt'](0x0));var _0x4ed68b=util[_0x5db8('0x27')](_0x5db8('0x61'),_0x3235bb[_0x5db8('0x51')],_0x417af9['id']);if(_0x1900f5>0x6){_0x4ed68b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3235bb[_0x5db8('0x51')],_0x417af9['id']);}logger[_0x5db8('0xd')](_0x5db8('0x56'),_0x5db8('0x62'));emit(util[_0x5db8('0x27')]('user:%s',_0x44fba0[_0x5db8('0x32')]),_0x5db8('0x63'),{'uri':_0x4ed68b});})[_0x5db8('0x64')](function(_0x498294){logger[_0x5db8('0x65')]('[QUEUE]',JSON[_0x5db8('0x1e')](_0x498294));});};exports['outbound']=function(_0x449ab5,_0x5734cf,_0xa42559,_0x43da86,_0x5d3ddd,_0x5547fb,_0x20a934){var _0x105af3,_0x59d1d3,_0x58cca1,_0x382793;_0x5547fb['remoteUri']=intUtil[_0x5db8('0x52')](_0x5547fb['remoteUri']);_0x5547fb[_0x5db8('0x53')]=intUtil[_0x5db8('0x52')](_0x5547fb[_0x5db8('0x53')]);def[_0x5db8('0x66')]=util['format'](_0x5db8('0x54'),_0x5547fb['remoteUri']);if(_0x20a934&&_0x20a934['recordingFormat']&&_0x20a934[_0x5db8('0x67')]!==_0x5db8('0x68')){logger[_0x5db8('0xd')](_0x5db8('0x69'),_0x5db8('0x57'));_0x5734cf['recordingURL']=util['format'](_0x5db8('0x6a'),_0x5547fb[_0x5db8('0x53')],_0x5734cf[_0x5db8('0x59')],md5(_0x5734cf[_0x5db8('0x59')]));}return getConnection(_0x5547fb)['then'](function(_0x17e9f7){_0x382793=_0x17e9f7;return getUser(_0x5547fb,_0x43da86[_0x5db8('0x32')],_0x382793);})[_0x5db8('0x2a')](function(_0x1572b8){_0x105af3=_0x1572b8;logger[_0x5db8('0xd')](_0x5db8('0x5a'),_0x105af3['id']);return getEndUser(_0x5547fb,_0x5734cf[_0x5db8('0x6b')],_0x5734cf[_0x5db8('0x6c')],_0x382793);})[_0x5db8('0x2a')](function(_0x308bfb){_0x59d1d3=_0x308bfb;logger[_0x5db8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x59d1d3['id']);return getTicket(_0x5547fb,_0x105af3,_0x59d1d3,_0xa42559,_0x5734cf,_0xa42559[_0x5db8('0x6d')],_0x382793,_0x5db8('0x6e'));})[_0x5db8('0x2a')](function(_0x1cd53b){_0x58cca1=_0x1cd53b;logger[_0x5db8('0xd')]('Ticket\x20created!');logger[_0x5db8('0xd')](_0x5db8('0x6f'),_0x58cca1['id']);return setRelationship(_0x382793,_0x105af3,_0x58cca1,_0x5db8('0x70'));})['then'](function(){return setRelationship(_0x382793,_0x59d1d3,_0x58cca1,'contacts');})[_0x5db8('0x2a')](function(){return getServerInfo(_0x382793);})['then'](function(_0x1a17f9){var _0x41f334=parseInt(_0x1a17f9[_0x5db8('0x60')][_0x5db8('0x71')](0x0));var _0x4f0612=util[_0x5db8('0x27')](_0x5db8('0x61'),_0x5547fb[_0x5db8('0x51')],_0x58cca1['id']);if(_0x41f334>0x6){_0x4f0612=util[_0x5db8('0x27')](_0x5db8('0x72'),_0x5547fb['remoteUri'],_0x58cca1['id']);}logger[_0x5db8('0xd')](_0x5db8('0x69'),_0x5db8('0x62'));emit(util[_0x5db8('0x27')](_0x5db8('0x73'),_0x43da86[_0x5db8('0x32')]),'trigger:browser:url',{'uri':_0x4f0612});})['catch'](function(_0x205fe8){logger[_0x5db8('0x65')](_0x5db8('0x69'),JSON['stringify'](_0x205fe8));});};exports['unmanaged']=function(_0xdcb4b8,_0x5c2c5e,_0x3fa004,_0x5c5138,_0x3636b0,_0x5dd7ba){var _0x1bd587,_0x54cc4f,_0x4a2798,_0x2ee925;_0x5dd7ba[_0x5db8('0x51')]=intUtil[_0x5db8('0x52')](_0x5dd7ba[_0x5db8('0x51')]);_0x5dd7ba[_0x5db8('0x53')]=intUtil[_0x5db8('0x52')](_0x5dd7ba[_0x5db8('0x53')]);def[_0x5db8('0x66')]=util[_0x5db8('0x27')]('%s/service/v4_1/rest.php',_0x5dd7ba[_0x5db8('0x51')]);if(_0x3636b0&&_0x3636b0[_0x5db8('0x55')]){logger[_0x5db8('0xd')]('['+_0x5c2c5e[_0x5db8('0x74')][_0x5db8('0x75')]()+']',_0x5db8('0x57'));_0x5c2c5e[_0x5db8('0x58')]=util[_0x5db8('0x27')](_0x5db8('0x6a'),_0x5dd7ba[_0x5db8('0x53')],_0x5c2c5e['uniqueid'],md5(_0x5c2c5e[_0x5db8('0x59')]));}else{_0x5c2c5e['recordingURL']='';}return getConnection(_0x5dd7ba)['then'](function(_0x1e4778){_0x2ee925=_0x1e4778;if(!_[_0x5db8('0x24')](_0x5c5138)){return getUser(_0x5dd7ba,_0x5c5138[_0x5db8('0x32')],_0x2ee925);}else{return getUser(_0x5dd7ba,null,_0x2ee925);}})['then'](function(_0x1bfb1a){_0x1bd587=_0x1bfb1a;logger[_0x5db8('0xd')]('The\x20User\x20ID\x20is:',_0x1bd587['id']);return getEndUser(_0x5dd7ba,_0x5c2c5e[_0x5db8('0x5b')],_0x5c2c5e[_0x5db8('0x5c')],_0x2ee925);})['then'](function(_0x545c4e){_0x54cc4f=_0x545c4e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x54cc4f['id']);return getTicket(_0x5dd7ba,_0x1bd587,_0x54cc4f,_0x3fa004,_0x5c2c5e,_0x3fa004['Fields'],_0x2ee925,_0x5db8('0x76'));})['then'](function(_0x6bd83f){_0x4a2798=_0x6bd83f;logger['info']('Ticket\x20created!');logger[_0x5db8('0xd')](_0x5db8('0x6f'),_0x4a2798['id']);return setRelationship(_0x2ee925,_0x1bd587,_0x4a2798,_0x5db8('0x70'));})['then'](function(){return setRelationship(_0x2ee925,_0x54cc4f,_0x4a2798,_0x5db8('0x5f'));})[_0x5db8('0x2a')](function(){return getServerInfo(_0x2ee925);})['catch'](function(_0x1c234f){logger[_0x5db8('0x65')]('['+_0x5c2c5e[_0x5db8('0x74')][_0x5db8('0x75')]()+']',JSON[_0x5db8('0x1e')](_0x1c234f));});}; \ 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 3b6728b..41bfed8 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 _0xfd75=['isNil','test','lodash','util','getString','length','sortBy','type','string','content','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','key','%s:\x20%s','variable','format','join','stripTrailingSlash','substring','lastIndexOf','validateEmail'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0xfd75,0x17c));var _0x5fd7=function(_0x5a513c,_0x1ac679){_0x5a513c=_0x5a513c-0x0;var _0x323bc3=_0xfd75[_0x5a513c];return _0x323bc3;};'use strict';var _=require(_0x5fd7('0x0'));var util=require(_0x5fd7('0x1'));exports[_0x5fd7('0x2')]=function(_0x556363,_0xaca94c,_0x7d827){var _0x20fd87=[];if(_0x556363[_0x5fd7('0x3')]>0x0){var _0x1020ef=_[_0x5fd7('0x4')](_0x556363,['id']);for(var _0x41c30e=0x0;_0x41c30e<_0x1020ef[_0x5fd7('0x3')];_0x41c30e++){var _0x17ba6e=_0x1020ef[_0x41c30e];if(_0x17ba6e[_0x5fd7('0x5')]===_0x5fd7('0x6')){_0x20fd87['push'](_0x17ba6e[_0x5fd7('0x7')]);}else if(_0x17ba6e[_0x5fd7('0x5')]==='variable'&&_0x17ba6e[_0x5fd7('0x8')]){_0xaca94c[_0x17ba6e[_0x5fd7('0x8')]]&&_0x20fd87[_0x5fd7('0x9')](_0xaca94c[_0x17ba6e[_0x5fd7('0x8')]][_0x5fd7('0xa')]());}else if(_0x17ba6e['type']===_0x5fd7('0xb')&&_0x17ba6e[_0x5fd7('0xc')]&&_0x17ba6e[_0x5fd7('0xc')][_0x5fd7('0xd')]){_0xaca94c[_0x17ba6e[_0x5fd7('0xc')]['name'][_0x5fd7('0xe')]()]&&_0x20fd87[_0x5fd7('0x9')](_0xaca94c[_0x17ba6e[_0x5fd7('0xc')][_0x5fd7('0xd')][_0x5fd7('0xe')]()]['toString']());}else if(_0x17ba6e[_0x5fd7('0x5')]==='keyValue'){if(_0x17ba6e[_0x5fd7('0xf')]==='string'&&_0x17ba6e[_0x5fd7('0x10')]){_0x20fd87['push'](util['format'](_0x5fd7('0x11'),_0x17ba6e['key'],_0x17ba6e['keyContent']));}else if(_0x17ba6e[_0x5fd7('0xf')]===_0x5fd7('0x12')&&_0x17ba6e[_0x5fd7('0x8')]&&_0x17ba6e[_0x5fd7('0x10')]){_0xaca94c[_0x17ba6e[_0x5fd7('0x8')]]&&_0x20fd87[_0x5fd7('0x9')](util[_0x5fd7('0x13')]('%s:\x20%s',_0x17ba6e[_0x5fd7('0x10')],_0xaca94c[_0x17ba6e['variableName']]));}else if(_0x17ba6e[_0x5fd7('0xf')]==='customVariable'&&_0x17ba6e[_0x5fd7('0xc')]&&_0x17ba6e['Variable'][_0x5fd7('0xd')]&&_0x17ba6e[_0x5fd7('0x10')]){_0xaca94c[_0x17ba6e[_0x5fd7('0xc')]['name']['toLowerCase']()]&&_0x20fd87[_0x5fd7('0x9')](util[_0x5fd7('0x13')](_0x5fd7('0x11'),_0x17ba6e[_0x5fd7('0x10')],_0xaca94c[_0x17ba6e[_0x5fd7('0xc')][_0x5fd7('0xd')]['toLowerCase']()]));}}}}return _0x20fd87[_0x5fd7('0x14')](_0x7d827);};exports[_0x5fd7('0x15')]=function(_0x12872b){var _0x5a1166=_0x12872b['slice'](-0x1);if(_0x5a1166==='/'){_0x12872b=_0x12872b[_0x5fd7('0x16')](0x0,_0x12872b[_0x5fd7('0x17')](_0x5a1166));}return _0x12872b;};exports[_0x5fd7('0x18')]=function(_0x1f1c1d){if(!_[_0x5fd7('0x19')](_0x1f1c1d)&&_0x1f1c1d!==''){var _0x23aa7b=/^(([^<>()\[\]\\.,;:\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 _0x23aa7b[_0x5fd7('0x1a')](String(_0x1f1c1d)[_0x5fd7('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xf151=['slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent'];(function(_0x5e0049,_0x45196a){var _0x1ce0f5=function(_0x4c0fcf){while(--_0x4c0fcf){_0x5e0049['push'](_0x5e0049['shift']());}};_0x1ce0f5(++_0x45196a);}(_0xf151,0x1f4));var _0x1f15=function(_0x4925d0,_0xa820e){_0x4925d0=_0x4925d0-0x0;var _0x3b7b03=_0xf151[_0x4925d0];return _0x3b7b03;};'use strict';var _=require(_0x1f15('0x0'));var util=require(_0x1f15('0x1'));exports['getString']=function(_0x200573,_0x3b70f6,_0x258ac0){var _0xeb041f=[];if(_0x200573[_0x1f15('0x2')]>0x0){var _0x4df796=_[_0x1f15('0x3')](_0x200573,['id']);for(var _0x4d5647=0x0;_0x4d5647<_0x4df796[_0x1f15('0x2')];_0x4d5647++){var _0x22ec34=_0x4df796[_0x4d5647];if(_0x22ec34[_0x1f15('0x4')]===_0x1f15('0x5')){_0xeb041f['push'](_0x22ec34['content']);}else if(_0x22ec34[_0x1f15('0x4')]===_0x1f15('0x6')&&_0x22ec34[_0x1f15('0x7')]){_0x3b70f6[_0x22ec34['variableName']]&&_0xeb041f[_0x1f15('0x8')](_0x3b70f6[_0x22ec34['variableName']][_0x1f15('0x9')]());}else if(_0x22ec34[_0x1f15('0x4')]===_0x1f15('0xa')&&_0x22ec34[_0x1f15('0xb')]&&_0x22ec34['Variable'][_0x1f15('0xc')]){_0x3b70f6[_0x22ec34[_0x1f15('0xb')][_0x1f15('0xc')][_0x1f15('0xd')]()]&&_0xeb041f[_0x1f15('0x8')](_0x3b70f6[_0x22ec34[_0x1f15('0xb')]['name'][_0x1f15('0xd')]()][_0x1f15('0x9')]());}else if(_0x22ec34[_0x1f15('0x4')]===_0x1f15('0xe')){if(_0x22ec34[_0x1f15('0xf')]==='string'&&_0x22ec34['key']){_0xeb041f[_0x1f15('0x8')](util[_0x1f15('0x10')](_0x1f15('0x11'),_0x22ec34[_0x1f15('0x12')],_0x22ec34[_0x1f15('0x13')]));}else if(_0x22ec34[_0x1f15('0xf')]===_0x1f15('0x6')&&_0x22ec34[_0x1f15('0x7')]&&_0x22ec34[_0x1f15('0x12')]){_0x3b70f6[_0x22ec34[_0x1f15('0x7')]]&&_0xeb041f[_0x1f15('0x8')](util['format']('%s:\x20%s',_0x22ec34[_0x1f15('0x12')],_0x3b70f6[_0x22ec34['variableName']]));}else if(_0x22ec34[_0x1f15('0xf')]===_0x1f15('0xa')&&_0x22ec34['Variable']&&_0x22ec34[_0x1f15('0xb')][_0x1f15('0xc')]&&_0x22ec34[_0x1f15('0x12')]){_0x3b70f6[_0x22ec34[_0x1f15('0xb')]['name']['toLowerCase']()]&&_0xeb041f[_0x1f15('0x8')](util['format'](_0x1f15('0x11'),_0x22ec34[_0x1f15('0x12')],_0x3b70f6[_0x22ec34[_0x1f15('0xb')][_0x1f15('0xc')][_0x1f15('0xd')]()]));}}}}return _0xeb041f['join'](_0x258ac0);};exports['stripTrailingSlash']=function(_0x17769d){var _0x2c8f7f=_0x17769d[_0x1f15('0x14')](-0x1);if(_0x2c8f7f==='/'){_0x17769d=_0x17769d[_0x1f15('0x15')](0x0,_0x17769d[_0x1f15('0x16')](_0x2c8f7f));}return _0x17769d;};exports[_0x1f15('0x17')]=function(_0x34ecaa){if(!_[_0x1f15('0x18')](_0x34ecaa)&&_0x34ecaa!==''){var _0xeb53cf=/^(([^<>()\[\]\\.,;:\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 _0xeb53cf[_0x1f15('0x19')](String(_0x34ecaa)[_0x1f15('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index f3c4784..6a55392 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(_0x46b579,_0x566d72){var _0x373a12=function(_0xe47070){while(--_0xe47070){_0x46b579['push'](_0x46b579['shift']());}};_0x373a12(++_0x566d72);}(_0xe706,0xa3));var _0x6e70=function(_0x3ba748,_0x4b8fb9){_0x3ba748=_0x3ba748-0x0;var _0x5b04e2=_0xe706[_0x3ba748];return _0x5b04e2;};'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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x53455f,_0x50f4df){var _0x185dae=function(_0x4e8a7c){while(--_0x4e8a7c){_0x53455f['push'](_0x53455f['shift']());}};_0x185dae(++_0x50f4df);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 1ce9422..c8e9c67 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 _0x5b40=['%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','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','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5b40,0x1a5));var _0x05b4=function(_0x3b353a,_0x444b43){_0x3b353a=_0x3b353a-0x0;var _0x2ba8bf=_0x5b40[_0x3b353a];return _0x2ba8bf;};'use strict';var _=require(_0x05b4('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x05b4('0x1'));var Redis=require(_0x05b4('0x2'));var intUtil=require(_0x05b4('0x3'));var config=require(_0x05b4('0x4'));var logger=require(_0x05b4('0x5'))('zendesk');config[_0x05b4('0x6')]=_[_0x05b4('0x7')](config[_0x05b4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x05b4('0x8'))(new Redis(config[_0x05b4('0x6')]));function emit(_0x4cb604,_0x1a3fa1,_0x57e82e){io['to'](_0x4cb604)[_0x05b4('0x9')](_0x1a3fa1,_0x57e82e);}var headers={'Content-Type':_0x05b4('0xa'),'Accept':_0x05b4('0xa')};function getTicket(_0x44d283,_0x26310a,_0x557402,_0x5071da,_0xe4c4cd){logger[_0x05b4('0xb')](_0x05b4('0xc'));return request({'uri':util[_0x05b4('0xd')](_0x05b4('0xe'),_0x44d283[_0x05b4('0xf')]),'method':_0x05b4('0x10'),'body':{'ticket':_[_0x05b4('0x11')]({'requester_id':_0x557402['id'],'submitter_id':_0x26310a?_0x26310a['id']:undefined,'assignee_id':_0x26310a?_0x26310a['id']:undefined,'tags':getTags(_0x5071da[_0x05b4('0x12')],_0x05b4('0x13')),'subject':intUtil[_0x05b4('0x14')](_0x5071da[_0x05b4('0x15')],_0xe4c4cd,'\x20'),'description':intUtil[_0x05b4('0x14')](_0x5071da[_0x05b4('0x16')],_0xe4c4cd,'\x0a'),'comment':{'public':![],'body':intUtil[_0x05b4('0x14')](_0x5071da[_0x05b4('0x16')],_0xe4c4cd,'\x0a')}},getCustomFields(_0x5071da['Fields'],_0xe4c4cd))}})[_0x05b4('0x17')](function(_0x2bfa9c){logger[_0x05b4('0xb')](_0x05b4('0x18'));return _0x2bfa9c[_0x05b4('0x19')];});}function getUser(_0x295c66,_0x32e52c){if(intUtil['validateEmail'](_0x32e52c)){logger[_0x05b4('0xb')]('Getting\x20agent\x20with\x20email',_0x32e52c);return request({'uri':util[_0x05b4('0xd')]('%s/search.json',_0x295c66[_0x05b4('0xf')]),'qs':{'query':util[_0x05b4('0xd')]('type:user\x20role:agent\x20email:%s',_0x32e52c)}})['then'](function(_0x2a60d1){if(_0x2a60d1[_0x05b4('0x1a')]){logger[_0x05b4('0xb')](_0x05b4('0x1b'));return _[_0x05b4('0x1c')](_0x2a60d1[_0x05b4('0x1d')],{'email':_0x32e52c,'role':_0x05b4('0x1e')});}else{logger[_0x05b4('0xb')](_0x05b4('0x1f'));return request({'uri':util['format'](_0x05b4('0x20'),_0x295c66['remoteUri'])})[_0x05b4('0x17')](function(_0x31f7cb){logger[_0x05b4('0xb')]('Admin\x20account\x20selected.');return _0x31f7cb[_0x05b4('0x21')];});}});}else{logger[_0x05b4('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x05b4('0xd')](_0x05b4('0x20'),_0x295c66[_0x05b4('0xf')])})[_0x05b4('0x17')](function(_0x5a1fe7){logger[_0x05b4('0xb')](_0x05b4('0x22'));return _0x5a1fe7[_0x05b4('0x21')];});}}function getEndUser(_0x8ddf32,_0x23f6c6,_0x4717f5){logger['info'](_0x05b4('0x23'),_0x4717f5);return request({'uri':util[_0x05b4('0xd')](_0x05b4('0x24'),_0x8ddf32[_0x05b4('0xf')]),'qs':{'query':util[_0x05b4('0xd')](_0x05b4('0x25'),_0x4717f5)}})[_0x05b4('0x17')](function(_0x5b976e){var _0x4201a3;if(_0x5b976e[_0x05b4('0x1d')][_0x05b4('0x26')]){_0x5b976e[_0x05b4('0x1d')]=_[_0x05b4('0x27')](_0x5b976e[_0x05b4('0x1d')],{'suspended':![],'role':'end-user'});if(_0x5b976e[_0x05b4('0x1d')][_0x05b4('0x26')]){_0x4201a3=_[_0x05b4('0x28')](_0x5b976e[_0x05b4('0x1d')]);}}if(_0x4201a3){logger[_0x05b4('0xb')](_0x05b4('0x29'));return _0x4201a3;}else{logger[_0x05b4('0xb')](_0x05b4('0x2a'));return request({'uri':util[_0x05b4('0xd')](_0x05b4('0x2b'),_0x8ddf32[_0x05b4('0xf')]),'method':_0x05b4('0x10'),'body':{'user':{'role':'end-user','name':util['format'](_0x05b4('0x2c'),_0x23f6c6||_0x4717f5),'phone':_0x4717f5}}})['then'](function(_0x2c4f8a){logger['info'](_0x05b4('0x2d'));return _0x2c4f8a[_0x05b4('0x21')];});}});}function getAuth(_0x4a0661){var _0x52272a;if(_0x4a0661[_0x05b4('0x2e')]===_0x05b4('0x2f')){_0x52272a=util[_0x05b4('0xd')]('%s:%s',_0x4a0661[_0x05b4('0x30')],_0x4a0661[_0x05b4('0x2f')]);}else if(_0x4a0661[_0x05b4('0x2e')]===_0x05b4('0x31')){_0x52272a=util[_0x05b4('0xd')](_0x05b4('0x32'),_0x4a0661['username'],_0x4a0661['token']);}return util[_0x05b4('0xd')](_0x05b4('0x33'),new Buffer(_0x52272a)[_0x05b4('0x34')](_0x05b4('0x35')));}function request(_0x384212){logger[_0x05b4('0x36')](_0x05b4('0x37'),JSON[_0x05b4('0x38')](_0x384212));return rp(_[_0x05b4('0x7')](_0x384212,{'method':_0x05b4('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x1ca50e,_0x50da9f){var _0x2bf397=[];if(_0x1ca50e&&_0x1ca50e['length']>0x0){_0x2bf397=_[_0x05b4('0x3a')](_0x1ca50e,_0x50da9f);}return _0x2bf397;}function getCustomFields(_0x231899,_0x5a435b){var _0x4487d7=[];var _0x183d3b={'custom_fields':[]};if(_0x231899['length']>0x0){_[_0x05b4('0x3b')](_0x231899,function(_0xd4baa0){if(_[_0x05b4('0x3c')]([_0x05b4('0x3d'),_0x05b4('0x3e')],_0xd4baa0[_0x05b4('0x3f')])&&_0xd4baa0['nameField']&&!_0xd4baa0['customField']){_0x183d3b[_0xd4baa0[_0x05b4('0x40')][_0x05b4('0x41')]()]=_0xd4baa0[_0x05b4('0x42')][_0x05b4('0x34')]();}else if(_[_0x05b4('0x3c')]([_0x05b4('0x3d'),'picklist'],_0xd4baa0[_0x05b4('0x3f')])&&_0xd4baa0[_0x05b4('0x43')]&&_0xd4baa0[_0x05b4('0x44')]){_0x183d3b[_0x05b4('0x45')]['push']({'id':_0xd4baa0[_0x05b4('0x43')],'value':_0xd4baa0[_0x05b4('0x42')][_0x05b4('0x34')]()});}else if(_0xd4baa0[_0x05b4('0x3f')]===_0x05b4('0x46')&&_0xd4baa0[_0x05b4('0x47')]&&_0xd4baa0['idField']&&_0xd4baa0['customField']){_0x5a435b[_0xd4baa0['variableName']]&&_0x183d3b[_0x05b4('0x45')][_0x05b4('0x48')]({'id':_0xd4baa0['idField'],'value':_0x5a435b[_0xd4baa0[_0x05b4('0x47')]]['toString']()});}else if(_0xd4baa0[_0x05b4('0x3f')]===_0x05b4('0x49')&&_0xd4baa0[_0x05b4('0x4a')]&&_0xd4baa0[_0x05b4('0x4a')]['name']&&_0xd4baa0['idField']&&_0xd4baa0[_0x05b4('0x44')]){_0x5a435b[_0xd4baa0['Variable'][_0x05b4('0x13')][_0x05b4('0x41')]()]&&_0x183d3b[_0x05b4('0x45')][_0x05b4('0x48')]({'id':_0xd4baa0[_0x05b4('0x43')],'value':_0x5a435b[_0xd4baa0[_0x05b4('0x4a')][_0x05b4('0x13')][_0x05b4('0x41')]()][_0x05b4('0x34')]()});}});}return _0x183d3b;}exports[_0x05b4('0x4b')]=function(_0x5110eb,_0x2b0126,_0x2282f5,_0x40cf0b,_0x5b5482,_0x52c0ab){var _0x3da764,_0x33000f;_0x52c0ab[_0x05b4('0xf')]=intUtil[_0x05b4('0x4c')](_0x52c0ab['remoteUri']);_0x52c0ab[_0x05b4('0x4d')]=intUtil[_0x05b4('0x4c')](_0x52c0ab[_0x05b4('0x4d')]);if(_0x5b5482&&_0x5b5482[_0x05b4('0x4e')]){logger[_0x05b4('0xb')](_0x05b4('0x4f'),_0x05b4('0x50'));_0x2b0126['recordingURL']=util[_0x05b4('0xd')](_0x05b4('0x51'),_0x52c0ab[_0x05b4('0x4d')],_0x2b0126[_0x05b4('0x52')],md5(_0x2b0126[_0x05b4('0x52')]));}else{_0x2b0126[_0x05b4('0x53')]='';}headers[_0x05b4('0x54')]=getAuth(_0x52c0ab);return getUser(_0x52c0ab,_0x40cf0b[_0x05b4('0x55')])[_0x05b4('0x17')](function(_0x400253){_0x3da764=_0x400253;logger[_0x05b4('0xb')](_0x05b4('0x56'),_0x3da764['id']);return getEndUser(_0x52c0ab,_0x2b0126[_0x05b4('0x57')],_0x2b0126[_0x05b4('0x58')]);})[_0x05b4('0x17')](function(_0x678481){_0x33000f=_0x678481;logger['info'](_0x05b4('0x59'),_0x33000f['id']);return getTicket(_0x52c0ab,_0x3da764,_0x33000f,_0x2282f5,_0x2b0126);})[_0x05b4('0x17')](function(_0x275c10){if(_0x275c10){logger[_0x05b4('0xb')](_0x05b4('0x5a'),_0x275c10['id']);switch(_0x52c0ab[_0x05b4('0x3f')]){case _0x05b4('0x5b'):logger[_0x05b4('0xb')]('[QUEUE]',_0x05b4('0x5c'));return request({'uri':util[_0x05b4('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x52c0ab[_0x05b4('0xf')],_0x3da764['id'],_0x275c10['id']),'method':'POST'});case _0x05b4('0x5d'):logger[_0x05b4('0xb')]('[QUEUE]',_0x05b4('0x5e'));emit(util[_0x05b4('0xd')](_0x05b4('0x5f'),_0x40cf0b[_0x05b4('0x13')]),'trigger:browser:url',{'uri':util['format'](_0x05b4('0x60'),_0x52c0ab[_0x05b4('0xf')][_0x05b4('0x61')](_0x05b4('0x62'),''),_0x275c10['id'])});break;default:logger[_0x05b4('0x63')](_0x05b4('0x4f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x05b4('0x64')](function(_0x1b256e){logger[_0x05b4('0x63')](_0x05b4('0x65'),util[_0x05b4('0x66')](_0x1b256e,{'showHidden':!![],'depth':null}));});};exports[_0x05b4('0x67')]=function(_0x3e5eba,_0x542654,_0x58cc17,_0x3aca1f,_0x47a1de,_0xd9048f,_0x1f5858){var _0x275fbd,_0xe4b04b;_0xd9048f[_0x05b4('0xf')]=intUtil[_0x05b4('0x4c')](_0xd9048f['remoteUri']);_0xd9048f[_0x05b4('0x4d')]=intUtil['stripTrailingSlash'](_0xd9048f[_0x05b4('0x4d')]);if(_0x1f5858&&_0x1f5858[_0x05b4('0x68')]&&_0x1f5858[_0x05b4('0x68')]!==_0x05b4('0x69')){logger[_0x05b4('0xb')](_0x05b4('0x6a'),'Recording\x20is\x20enabled!');_0x542654[_0x05b4('0x53')]=util[_0x05b4('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd9048f[_0x05b4('0x4d')],_0x542654['uniqueid'],md5(_0x542654[_0x05b4('0x52')]));}headers[_0x05b4('0x54')]=getAuth(_0xd9048f);return getUser(_0xd9048f,_0x3aca1f[_0x05b4('0x55')])[_0x05b4('0x17')](function(_0x4a02f1){_0x275fbd=_0x4a02f1;logger[_0x05b4('0xb')](_0x05b4('0x56'),_0x275fbd['id']);return getEndUser(_0xd9048f,_0x542654[_0x05b4('0x6b')],_0x542654[_0x05b4('0x6c')]);})['then'](function(_0x2efa95){_0xe4b04b=_0x2efa95;logger[_0x05b4('0xb')]('The\x20Enduser\x20ID\x20is:',_0xe4b04b['id']);return getTicket(_0xd9048f,_0x275fbd,_0xe4b04b,_0x58cc17,_0x542654);})[_0x05b4('0x17')](function(_0x207abf){if(_0x207abf){logger[_0x05b4('0xb')](_0x05b4('0x5a'),_0x207abf['id']);switch(_0xd9048f[_0x05b4('0x3f')]){case _0x05b4('0x5b'):logger[_0x05b4('0xb')]('[OUTBOUND]',_0x05b4('0x5c'));return request({'uri':util[_0x05b4('0xd')](_0x05b4('0x6d'),_0xd9048f[_0x05b4('0xf')],_0x275fbd['id'],_0x207abf['id']),'method':_0x05b4('0x10')});case'newTab':logger[_0x05b4('0xb')](_0x05b4('0x6a'),_0x05b4('0x5e'));emit(util[_0x05b4('0xd')](_0x05b4('0x5f'),_0x3aca1f['name']),'trigger:browser:url',{'uri':util[_0x05b4('0xd')](_0x05b4('0x60'),_0xd9048f['remoteUri'][_0x05b4('0x61')](_0x05b4('0x62'),''),_0x207abf['id'])});break;default:logger['error'](_0x05b4('0x6a'),_0x05b4('0x6e'));}}})[_0x05b4('0x64')](function(_0x491787){logger[_0x05b4('0x63')](_0x05b4('0x6f'),util[_0x05b4('0x66')](_0x491787,{'showHidden':!![],'depth':null}));});};exports[_0x05b4('0x70')]=function(_0x475a51,_0x1a1616,_0x38d27f,_0x3837c7,_0xee7dc7,_0x13e57e){var _0x157c91,_0x24f145;_0x13e57e[_0x05b4('0xf')]=intUtil[_0x05b4('0x4c')](_0x13e57e[_0x05b4('0xf')]);_0x13e57e[_0x05b4('0x4d')]=intUtil[_0x05b4('0x4c')](_0x13e57e[_0x05b4('0x4d')]);if(_0xee7dc7&&_0xee7dc7[_0x05b4('0x4e')]){logger[_0x05b4('0xb')]('['+_0x1a1616[_0x05b4('0x71')][_0x05b4('0x72')]()+']',_0x05b4('0x50'));_0x1a1616['recordingURL']=util[_0x05b4('0xd')](_0x05b4('0x51'),_0x13e57e[_0x05b4('0x4d')],_0x1a1616[_0x05b4('0x52')],md5(_0x1a1616[_0x05b4('0x52')]));}else{_0x1a1616[_0x05b4('0x53')]='';}headers[_0x05b4('0x54')]=getAuth(_0x13e57e);return getUser(_0x13e57e)[_0x05b4('0x17')](function(_0x57c48b){_0x157c91=_0x57c48b;logger[_0x05b4('0xb')](_0x05b4('0x56'),_0x157c91['id']);return getEndUser(_0x13e57e,_0x1a1616[_0x05b4('0x57')],_0x1a1616['calleridnum']);})[_0x05b4('0x17')](function(_0xa95626){_0x24f145=_0xa95626;logger['info'](_0x05b4('0x59'),_0x24f145['id']);return getTicket(_0x13e57e,_0x157c91,_0x24f145,_0x38d27f,_0x1a1616);})[_0x05b4('0x17')](function(_0x30359a){if(_0x30359a){logger['info'](_0x05b4('0x5a'),_0x30359a['id']);}})[_0x05b4('0x64')](function(_0x763b62){logger[_0x05b4('0x63')]('['+_0x1a1616[_0x05b4('0x71')][_0x05b4('0x72')]()+']'+_0x05b4('0x73'),util[_0x05b4('0x66')](_0x763b62,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa36f=['newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','getString','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','forEach','string','picklist','customField','includes','type','idField','push','content','variable','variableName','custom_fields','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xa36f,0x161));var _0xfa36=function(_0x4287b0,_0x5e551c){_0x4287b0=_0x4287b0-0x0;var _0x1e6a1e=_0xa36f[_0x4287b0];return _0x1e6a1e;};'use strict';var _=require(_0xfa36('0x0'));var rp=require('request-promise');var md5=require(_0xfa36('0x1'));var util=require('util');var Redis=require(_0xfa36('0x2'));var intUtil=require(_0xfa36('0x3'));var config=require(_0xfa36('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0xfa36('0x5')]=_[_0xfa36('0x6')](config[_0xfa36('0x5')],{'host':_0xfa36('0x7'),'port':0x18eb});var io=require(_0xfa36('0x8'))(new Redis(config[_0xfa36('0x5')]));function emit(_0x498e89,_0xa6646d,_0xfb4f75){io['to'](_0x498e89)[_0xfa36('0x9')](_0xa6646d,_0xfb4f75);}var headers={'Content-Type':_0xfa36('0xa'),'Accept':_0xfa36('0xa')};function getTicket(_0x2b3f3a,_0x4faf13,_0x3f7fbe,_0x216b23,_0x33569f){logger[_0xfa36('0xb')](_0xfa36('0xc'));return request({'uri':util[_0xfa36('0xd')](_0xfa36('0xe'),_0x2b3f3a[_0xfa36('0xf')]),'method':_0xfa36('0x10'),'body':{'ticket':_[_0xfa36('0x11')]({'requester_id':_0x3f7fbe['id'],'submitter_id':_0x4faf13?_0x4faf13['id']:undefined,'assignee_id':_0x4faf13?_0x4faf13['id']:undefined,'tags':getTags(_0x216b23['Tags'],'name'),'subject':intUtil[_0xfa36('0x12')](_0x216b23['Subjects'],_0x33569f,'\x20'),'description':intUtil[_0xfa36('0x12')](_0x216b23['Descriptions'],_0x33569f,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfa36('0x12')](_0x216b23['Descriptions'],_0x33569f,'\x0a')}},getCustomFields(_0x216b23[_0xfa36('0x13')],_0x33569f))}})['then'](function(_0x59e522){logger[_0xfa36('0xb')](_0xfa36('0x14'));return _0x59e522[_0xfa36('0x15')];});}function getUser(_0x193207,_0x489dc4){if(intUtil['validateEmail'](_0x489dc4)){logger['info'](_0xfa36('0x16'),_0x489dc4);return request({'uri':util[_0xfa36('0xd')]('%s/search.json',_0x193207[_0xfa36('0xf')]),'qs':{'query':util[_0xfa36('0xd')](_0xfa36('0x17'),_0x489dc4)}})[_0xfa36('0x18')](function(_0x5e2a64){if(_0x5e2a64[_0xfa36('0x19')]){logger[_0xfa36('0xb')](_0xfa36('0x1a'));return _[_0xfa36('0x1b')](_0x5e2a64[_0xfa36('0x1c')],{'email':_0x489dc4,'role':'agent'});}else{logger['info'](_0xfa36('0x1d'));return request({'uri':util[_0xfa36('0xd')](_0xfa36('0x1e'),_0x193207[_0xfa36('0xf')])})[_0xfa36('0x18')](function(_0x17b3c3){logger[_0xfa36('0xb')]('Admin\x20account\x20selected.');return _0x17b3c3[_0xfa36('0x1f')];});}});}else{logger[_0xfa36('0xb')](_0xfa36('0x1d'));return request({'uri':util['format'](_0xfa36('0x1e'),_0x193207[_0xfa36('0xf')])})[_0xfa36('0x18')](function(_0x1d18f3){logger[_0xfa36('0xb')]('Admin\x20account\x20selected.');return _0x1d18f3[_0xfa36('0x1f')];});}}function getEndUser(_0x170594,_0x55ef4a,_0x43d95d){logger[_0xfa36('0xb')](_0xfa36('0x20'),_0x43d95d);return request({'uri':util[_0xfa36('0xd')](_0xfa36('0x21'),_0x170594[_0xfa36('0xf')]),'qs':{'query':util[_0xfa36('0xd')](_0xfa36('0x22'),_0x43d95d)}})[_0xfa36('0x18')](function(_0x5c611a){var _0x2e85ee;if(_0x5c611a['results'][_0xfa36('0x23')]){_0x5c611a[_0xfa36('0x1c')]=_[_0xfa36('0x24')](_0x5c611a[_0xfa36('0x1c')],{'suspended':![],'role':_0xfa36('0x25')});if(_0x5c611a[_0xfa36('0x1c')][_0xfa36('0x23')]){_0x2e85ee=_[_0xfa36('0x26')](_0x5c611a[_0xfa36('0x1c')]);}}if(_0x2e85ee){logger[_0xfa36('0xb')](_0xfa36('0x27'));return _0x2e85ee;}else{logger['info'](_0xfa36('0x28'));return request({'uri':util['format'](_0xfa36('0x29'),_0x170594[_0xfa36('0xf')]),'method':_0xfa36('0x10'),'body':{'user':{'role':_0xfa36('0x25'),'name':util[_0xfa36('0xd')](_0xfa36('0x2a'),_0x55ef4a||_0x43d95d),'phone':_0x43d95d}}})[_0xfa36('0x18')](function(_0x29533b){logger['info'](_0xfa36('0x2b'));return _0x29533b[_0xfa36('0x1f')];});}});}function getAuth(_0x3a16d2){var _0x74b7af;if(_0x3a16d2[_0xfa36('0x2c')]===_0xfa36('0x2d')){_0x74b7af=util[_0xfa36('0xd')](_0xfa36('0x2e'),_0x3a16d2[_0xfa36('0x2f')],_0x3a16d2[_0xfa36('0x2d')]);}else if(_0x3a16d2[_0xfa36('0x2c')]===_0xfa36('0x30')){_0x74b7af=util['format'](_0xfa36('0x31'),_0x3a16d2[_0xfa36('0x2f')],_0x3a16d2[_0xfa36('0x30')]);}return util[_0xfa36('0xd')]('Basic\x20%s',new Buffer(_0x74b7af)[_0xfa36('0x32')](_0xfa36('0x33')));}function request(_0x2fa654){logger[_0xfa36('0x34')](_0xfa36('0x35'),JSON[_0xfa36('0x36')](_0x2fa654));return rp(_['defaults'](_0x2fa654,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4af4e0,_0x56d93b){var _0x3b6ebc=[];if(_0x4af4e0&&_0x4af4e0[_0xfa36('0x23')]>0x0){_0x3b6ebc=_['map'](_0x4af4e0,_0x56d93b);}return _0x3b6ebc;}function getCustomFields(_0xcd5d19,_0x23a3f1){var _0x51fba7=[];var _0x5cd66b={'custom_fields':[]};if(_0xcd5d19[_0xfa36('0x23')]>0x0){_[_0xfa36('0x37')](_0xcd5d19,function(_0x2edf61){if(_['includes']([_0xfa36('0x38'),_0xfa36('0x39')],_0x2edf61['type'])&&_0x2edf61['nameField']&&!_0x2edf61[_0xfa36('0x3a')]){_0x5cd66b[_0x2edf61['nameField']['toLowerCase']()]=_0x2edf61['content'][_0xfa36('0x32')]();}else if(_[_0xfa36('0x3b')]([_0xfa36('0x38'),_0xfa36('0x39')],_0x2edf61[_0xfa36('0x3c')])&&_0x2edf61[_0xfa36('0x3d')]&&_0x2edf61[_0xfa36('0x3a')]){_0x5cd66b['custom_fields'][_0xfa36('0x3e')]({'id':_0x2edf61[_0xfa36('0x3d')],'value':_0x2edf61[_0xfa36('0x3f')][_0xfa36('0x32')]()});}else if(_0x2edf61[_0xfa36('0x3c')]===_0xfa36('0x40')&&_0x2edf61['variableName']&&_0x2edf61['idField']&&_0x2edf61[_0xfa36('0x3a')]){_0x23a3f1[_0x2edf61[_0xfa36('0x41')]]&&_0x5cd66b[_0xfa36('0x42')][_0xfa36('0x3e')]({'id':_0x2edf61[_0xfa36('0x3d')],'value':_0x23a3f1[_0x2edf61[_0xfa36('0x41')]][_0xfa36('0x32')]()});}else if(_0x2edf61[_0xfa36('0x3c')]===_0xfa36('0x43')&&_0x2edf61[_0xfa36('0x44')]&&_0x2edf61[_0xfa36('0x44')][_0xfa36('0x45')]&&_0x2edf61[_0xfa36('0x3d')]&&_0x2edf61[_0xfa36('0x3a')]){_0x23a3f1[_0x2edf61['Variable'][_0xfa36('0x45')][_0xfa36('0x46')]()]&&_0x5cd66b['custom_fields'][_0xfa36('0x3e')]({'id':_0x2edf61[_0xfa36('0x3d')],'value':_0x23a3f1[_0x2edf61['Variable'][_0xfa36('0x45')][_0xfa36('0x46')]()][_0xfa36('0x32')]()});}});}return _0x5cd66b;}exports[_0xfa36('0x47')]=function(_0x3906ff,_0x500020,_0x15fef8,_0x101877,_0x4389f8,_0x55019c){var _0x2a7eac,_0x535155;_0x55019c[_0xfa36('0xf')]=intUtil['stripTrailingSlash'](_0x55019c['remoteUri']);_0x55019c[_0xfa36('0x48')]=intUtil[_0xfa36('0x49')](_0x55019c['serverUrl']);if(_0x4389f8&&_0x4389f8[_0xfa36('0x4a')]){logger[_0xfa36('0xb')](_0xfa36('0x4b'),_0xfa36('0x4c'));_0x500020[_0xfa36('0x4d')]=util[_0xfa36('0xd')](_0xfa36('0x4e'),_0x55019c[_0xfa36('0x48')],_0x500020['uniqueid'],md5(_0x500020[_0xfa36('0x4f')]));}else{_0x500020[_0xfa36('0x4d')]='';}headers[_0xfa36('0x50')]=getAuth(_0x55019c);return getUser(_0x55019c,_0x101877['email'])[_0xfa36('0x18')](function(_0x3b2197){_0x2a7eac=_0x3b2197;logger[_0xfa36('0xb')](_0xfa36('0x51'),_0x2a7eac['id']);return getEndUser(_0x55019c,_0x500020[_0xfa36('0x52')],_0x500020['calleridnum']);})[_0xfa36('0x18')](function(_0x3f16a9){_0x535155=_0x3f16a9;logger['info'](_0xfa36('0x53'),_0x535155['id']);return getTicket(_0x55019c,_0x2a7eac,_0x535155,_0x15fef8,_0x500020);})['then'](function(_0x40796f){if(_0x40796f){logger['info'](_0xfa36('0x54'),_0x40796f['id']);switch(_0x55019c[_0xfa36('0x3c')]){case'integrationTab':logger[_0xfa36('0xb')]('[QUEUE]',_0xfa36('0x55'));return request({'uri':util[_0xfa36('0xd')](_0xfa36('0x56'),_0x55019c[_0xfa36('0xf')],_0x2a7eac['id'],_0x40796f['id']),'method':_0xfa36('0x10')});case _0xfa36('0x57'):logger['info'](_0xfa36('0x4b'),_0xfa36('0x58'));emit(util[_0xfa36('0xd')]('user:%s',_0x101877[_0xfa36('0x45')]),_0xfa36('0x59'),{'uri':util[_0xfa36('0xd')](_0xfa36('0x5a'),_0x55019c[_0xfa36('0xf')][_0xfa36('0x5b')](_0xfa36('0x5c'),''),_0x40796f['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1e82e7){logger[_0xfa36('0x5d')](_0xfa36('0x5e'),util[_0xfa36('0x5f')](_0x1e82e7,{'showHidden':!![],'depth':null}));});};exports[_0xfa36('0x60')]=function(_0x294ce5,_0x3c3690,_0x4e8c74,_0xb90b43,_0x3193cd,_0x3fc03c,_0x31da99){var _0x236a79,_0x3ebb0a;_0x3fc03c['remoteUri']=intUtil['stripTrailingSlash'](_0x3fc03c[_0xfa36('0xf')]);_0x3fc03c[_0xfa36('0x48')]=intUtil[_0xfa36('0x49')](_0x3fc03c[_0xfa36('0x48')]);if(_0x31da99&&_0x31da99[_0xfa36('0x61')]&&_0x31da99[_0xfa36('0x61')]!==_0xfa36('0x62')){logger['info'](_0xfa36('0x63'),_0xfa36('0x4c'));_0x3c3690['recordingURL']=util[_0xfa36('0xd')](_0xfa36('0x4e'),_0x3fc03c['serverUrl'],_0x3c3690['uniqueid'],md5(_0x3c3690[_0xfa36('0x4f')]));}headers['Authorization']=getAuth(_0x3fc03c);return getUser(_0x3fc03c,_0xb90b43[_0xfa36('0x64')])[_0xfa36('0x18')](function(_0x2abef4){_0x236a79=_0x2abef4;logger[_0xfa36('0xb')](_0xfa36('0x51'),_0x236a79['id']);return getEndUser(_0x3fc03c,_0x3c3690[_0xfa36('0x65')],_0x3c3690['destcalleridnum']);})[_0xfa36('0x18')](function(_0x5eadd4){_0x3ebb0a=_0x5eadd4;logger[_0xfa36('0xb')](_0xfa36('0x53'),_0x3ebb0a['id']);return getTicket(_0x3fc03c,_0x236a79,_0x3ebb0a,_0x4e8c74,_0x3c3690);})[_0xfa36('0x18')](function(_0x45e71b){if(_0x45e71b){logger[_0xfa36('0xb')]('The\x20Ticket\x20ID\x20is:',_0x45e71b['id']);switch(_0x3fc03c[_0xfa36('0x3c')]){case'integrationTab':logger['info'](_0xfa36('0x63'),_0xfa36('0x55'));return request({'uri':util[_0xfa36('0xd')](_0xfa36('0x56'),_0x3fc03c['remoteUri'],_0x236a79['id'],_0x45e71b['id']),'method':_0xfa36('0x10')});case'newTab':logger[_0xfa36('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfa36('0xd')](_0xfa36('0x66'),_0xb90b43[_0xfa36('0x45')]),_0xfa36('0x59'),{'uri':util[_0xfa36('0xd')](_0xfa36('0x5a'),_0x3fc03c[_0xfa36('0xf')][_0xfa36('0x5b')](_0xfa36('0x5c'),''),_0x45e71b['id'])});break;default:logger[_0xfa36('0x5d')](_0xfa36('0x63'),_0xfa36('0x67'));}}})[_0xfa36('0x68')](function(_0x549795){logger[_0xfa36('0x5d')](_0xfa36('0x69'),util['inspect'](_0x549795,{'showHidden':!![],'depth':null}));});};exports[_0xfa36('0x6a')]=function(_0x3f98a5,_0x2f7706,_0x1c3589,_0x40a973,_0x24230d,_0x41b718){var _0x3bfdba,_0x4b0fdf;_0x41b718['remoteUri']=intUtil[_0xfa36('0x49')](_0x41b718[_0xfa36('0xf')]);_0x41b718[_0xfa36('0x48')]=intUtil['stripTrailingSlash'](_0x41b718['serverUrl']);if(_0x24230d&&_0x24230d[_0xfa36('0x4a')]){logger['info']('['+_0x2f7706['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x2f7706[_0xfa36('0x4d')]=util['format'](_0xfa36('0x4e'),_0x41b718[_0xfa36('0x48')],_0x2f7706[_0xfa36('0x4f')],md5(_0x2f7706[_0xfa36('0x4f')]));}else{_0x2f7706[_0xfa36('0x4d')]='';}headers[_0xfa36('0x50')]=getAuth(_0x41b718);return getUser(_0x41b718)[_0xfa36('0x18')](function(_0x9353a9){_0x3bfdba=_0x9353a9;logger['info'](_0xfa36('0x51'),_0x3bfdba['id']);return getEndUser(_0x41b718,_0x2f7706[_0xfa36('0x52')],_0x2f7706[_0xfa36('0x6b')]);})[_0xfa36('0x18')](function(_0x2ac68f){_0x4b0fdf=_0x2ac68f;logger[_0xfa36('0xb')](_0xfa36('0x53'),_0x4b0fdf['id']);return getTicket(_0x41b718,_0x3bfdba,_0x4b0fdf,_0x1c3589,_0x2f7706);})['then'](function(_0x4bd876){if(_0x4bd876){logger[_0xfa36('0xb')](_0xfa36('0x54'),_0x4bd876['id']);}})[_0xfa36('0x68')](function(_0x2a0a8e){logger[_0xfa36('0x5d')]('['+_0x2f7706[_0xfa36('0x6c')]['toUpperCase']()+']'+_0xfa36('0x6d'),util[_0xfa36('0x5f')](_0x2a0a8e,{'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 58e30c6..70036eb 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 _0xece1=['includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','info','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','data','code','SUCCESS','details','moduleCreate','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Who_Id','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','Called','complete','connect','Call_Result','rejected','Rejected','abandoned','Abandoned','timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','log','err','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','stripTrailingSlash','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify'];(function(_0x5f24ed,_0x2e8ac3){var _0x524f8b=function(_0x1fe511){while(--_0x1fe511){_0x5f24ed['push'](_0x5f24ed['shift']());}};_0x524f8b(++_0x2e8ac3);}(_0xece1,0x8a));var _0x1ece=function(_0x238a66,_0x3a20a7){_0x238a66=_0x238a66-0x0;var _0x56f6f2=_0xece1[_0x238a66];return _0x56f6f2;};'use strict';var _=require(_0x1ece('0x0'));var rp=require(_0x1ece('0x1'));var md5=require(_0x1ece('0x2'));var util=require(_0x1ece('0x3'));var intUtil=require(_0x1ece('0x4'));var moment=require(_0x1ece('0x5'));var Redis=require(_0x1ece('0x6'));var BPromise=require(_0x1ece('0x7'));var config=require(_0x1ece('0x8'));var logger=require(_0x1ece('0x9'))(_0x1ece('0xa'));config[_0x1ece('0xb')]=_[_0x1ece('0xc')](config['redis'],{'host':_0x1ece('0xd'),'port':0x18eb});var io=require(_0x1ece('0xe'))(new Redis(config['redis']));function emit(_0x3642d2,_0x543542,_0x1fb751){io['to'](_0x3642d2)[_0x1ece('0xf')](_0x543542,_0x1fb751);}function request(_0x1dfb84){logger['debug'](_0x1ece('0x10'),JSON[_0x1ece('0x11')](_0x1dfb84));return rp(_0x1dfb84);}function getCustomFields(_0x228648,_0x36c995){var _0x29d106={};if(_0x228648['length']>0x0){_['forEach'](_0x228648,function(_0xfac7b3){if(_[_0x1ece('0x12')]([_0x1ece('0x13'),_0x1ece('0x14')],_0xfac7b3[_0x1ece('0x15')])&&_0xfac7b3[_0x1ece('0x16')]){_0x29d106[_0xfac7b3[_0x1ece('0x16')]]=_0xfac7b3[_0x1ece('0x17')][_0x1ece('0x18')]();}else if(_0xfac7b3[_0x1ece('0x15')]===_0x1ece('0x19')&&_0xfac7b3[_0x1ece('0x1a')]&&_0xfac7b3['idField']&&_0x36c995[_0xfac7b3['variableName']]){_0x29d106[_0xfac7b3[_0x1ece('0x16')]]=_0x36c995[_0xfac7b3['variableName']][_0x1ece('0x18')]();}else if(_0xfac7b3[_0x1ece('0x15')]===_0x1ece('0x1b')&&_0xfac7b3[_0x1ece('0x1c')]&&_0xfac7b3[_0x1ece('0x1c')][_0x1ece('0x1d')]&&_0xfac7b3['idField']&&_0x36c995[_0xfac7b3[_0x1ece('0x1c')]['name'][_0x1ece('0x1e')]()]){_0x29d106[_0xfac7b3[_0x1ece('0x16')]]=_0x36c995[_0xfac7b3[_0x1ece('0x1c')][_0x1ece('0x1d')][_0x1ece('0x1e')]()]['toString']();}});}return _0x29d106;}function getName(_0x1b8d90){if(_0x1b8d90[_0x1ece('0x1f')]('\x20')>0x0){var _0x2764f2=_0x1b8d90['split'](/ (.+)/);if(_0x2764f2[0x1]){return _0x2764f2;}}return[_0x1b8d90,_0x1b8d90];}var accountsTokens={};function getAccessToken(_0x517f26){return new Promise(function(_0x31ee4d,_0x28641d){if(!_[_0x1ece('0x20')](accountsTokens[_0x517f26['id']])&&!_['isNil'](accountsTokens[_0x517f26['id']][_0x1ece('0x21')])){if(moment()['isBefore'](accountsTokens[_0x517f26['id']]['expires_in'])){_0x31ee4d(accountsTokens[_0x517f26['id']][_0x1ece('0x21')]);}}var _0x444d5b;switch(_0x517f26[_0x1ece('0x22')]){case'US':_0x444d5b=_0x1ece('0x23');break;case'AU':_0x444d5b='https://accounts.zoho.com.au';break;case'EU':_0x444d5b=_0x1ece('0x24');break;case'IN':_0x444d5b=_0x1ece('0x25');break;case'CN':_0x444d5b=_0x1ece('0x26');break;default:_0x444d5b=_0x1ece('0x24');break;}var _0x1fd56b={'method':_0x1ece('0x27'),'uri':_0x444d5b+_0x1ece('0x28'),'qs':{'refresh_token':_0x517f26[_0x1ece('0x29')],'client_id':_0x517f26[_0x1ece('0x2a')],'client_secret':_0x517f26[_0x1ece('0x2b')],'grant_type':_0x1ece('0x2c')},'json':!![]};return rp(_0x1fd56b)[_0x1ece('0x2d')](function(_0x3b8f7b){accountsTokens[_0x517f26['id']]={'access_token':_0x3b8f7b[_0x1ece('0x21')],'expires_in':moment()[_0x1ece('0x2e')](_0x3b8f7b[_0x1ece('0x2f')],_0x1ece('0x30'))};_0x31ee4d(_0x3b8f7b[_0x1ece('0x21')]);})[_0x1ece('0x31')](function(_0x2ae79b){logger[_0x1ece('0x32')](_0x1ece('0x33'),_0x2ae79b['stack']);_0x28641d(_0x2ae79b);});});}function getUser(_0x3b0a41,_0xf90ae3,_0x2894ac,_0x452675){logger['info'](_0x1ece('0x34'));return request({'method':_0x1ece('0x35'),'uri':util[_0x1ece('0x36')](_0x1ece('0x37'),_0xf90ae3),'qs':{'type':_0x1ece('0x38')},'headers':{'Authorization':_0x1ece('0x39')+_0x3b0a41},'json':!![]})[_0x1ece('0x2d')](function(_0x3bb310){if(_0x3bb310[_0x1ece('0x3a')]){var _0x20460f=-0x1;if(_['isArrayLikeObject'](_0x3bb310[_0x1ece('0x3a')])){if(!_['isNil'](_0x452675)){_0x20460f=_[_0x1ece('0x3b')](_0x3bb310['users'],function(_0x24f607){return _0x24f607[_0x1ece('0x3c')]===_0x452675;});}if(_0x20460f>=0x0){logger['info'](_0x1ece('0x3d'));}else{logger[_0x1ece('0x3e')]('Using\x20the\x20admin\x20account!');_0x20460f=_[_0x1ece('0x3b')](_0x3bb310[_0x1ece('0x3a')],function(_0x2ee5a0){return _0x2ee5a0[_0x1ece('0x3f')][_0x1ece('0x1d')]===_0x1ece('0x40');});}return _0x3bb310[_0x1ece('0x3a')][_0x20460f];}else{if(_0x3bb310[_0x1ece('0x41')][_0x1ece('0x3f')]['name']==='Administrator'){logger[_0x1ece('0x3e')]('Using\x20the\x20admin\x20account!');user=_0x3bb310[_0x1ece('0x41')];return user;}else{logger[_0x1ece('0x32')](_0x1ece('0x42'),JSON[_0x1ece('0x11')](_0x3bb310));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x1ece('0x11')](_0x3bb310));}}}else{logger[_0x1ece('0x32')]('The\x20failing\x20result\x20is',JSON[_0x1ece('0x11')](_0x3bb310));throw new Error(_0x1ece('0x43')+JSON['stringify'](_0x3bb310));}})[_0x1ece('0x31')](function(_0x3aa1e2){console[_0x1ece('0x32')](_0x3aa1e2);});}function getZohoUser(_0x5843f0,_0xe8b465){return new BPromise(function(_0x5a5f04,_0x1001b0){request(_0x5843f0)[_0x1ece('0x2d')](function(_0x17c6b4){var _0x56f916=null;if(_0x17c6b4){_0x56f916=_0x17c6b4['data'][0x0];_0x56f916[_0x1ece('0x44')]=_0xe8b465;}_0x5a5f04(_0x56f916);})[_0x1ece('0x31')](function(_0xb7afda){_0x1001b0(_0xb7afda);});});}function createEndUser(_0x28d087,_0x5ab415,_0x36f6a9,_0x365751,_0x2090bb,_0x31150f){var _0x36f6a9=getName(_0x36f6a9);return request({'method':_0x1ece('0x27'),'uri':_0x1ece('0x45')+_0x5ab415+_0x1ece('0x46')+_[_0x1ece('0x47')](_0x31150f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x36f6a9[0x1],'First_Name':_0x36f6a9[0x0],'Phone':_0x365751,'Owner':{'name':!_[_0x1ece('0x20')](_0x2090bb[_0x1ece('0x48')][_0x1ece('0x1d')])?_0x2090bb[_0x1ece('0x48')]['name']:!_['isNil'](_0x2090bb[_0x1ece('0x49')])?_0x2090bb[_0x1ece('0x49')]+'\x20'+_0x2090bb['last_name']:_0x2090bb[_0x1ece('0x4a')],'id':_0x2090bb['id']}}]},'headers':{'Authorization':_0x1ece('0x39')+_0x28d087},'json':!![]})['then'](function(_0x55621a){if(_0x55621a&&_0x55621a[_0x1ece('0x4b')][0x0][_0x1ece('0x4c')]===_0x1ece('0x4d')){var _0x340c62=_0x55621a[_0x1ece('0x4b')][0x0][_0x1ece('0x4e')];_0x340c62[_0x1ece('0x44')]=_[_0x1ece('0x47')](_0x31150f[_0x1ece('0x4f')])+'s';return _0x340c62;}logger[_0x1ece('0x32')](_0x1ece('0x42'),JSON[_0x1ece('0x11')](data));throw new Error(_0x1ece('0x50')+JSON[_0x1ece('0x11')](data));})[_0x1ece('0x31')](function(_0x19a5b6){console['log'](_0x1ece('0x51'),_0x19a5b6);});}function getEndUser(_0xd2be23,_0x17f230,_0x3f691f,_0x15e0b6,_0x35ba5a,_0x189538,_0xfce9fc){var _0x41f996={'method':_0x1ece('0x35'),'uri':'','headers':{'Authorization':_0x1ece('0x39')+_0xd2be23},'json':!![]};switch(_0xfce9fc[_0x1ece('0x52')]){case _0x1ece('0x53'):_0x41f996[_0x1ece('0x54')]=_0x1ece('0x45')+_0x17f230+_0x1ece('0x55')+_0x35ba5a+'))';return getZohoUser(_0x41f996,_0x1ece('0x56'))['then'](function(_0x3fa837){if(_0x3fa837)return _0x3fa837;_0x41f996[_0x1ece('0x54')]=_0x1ece('0x45')+_0x17f230+_0x1ece('0x57')+_0x35ba5a+'))';return getZohoUser(_0x41f996,_0x1ece('0x58'))[_0x1ece('0x2d')](function(_0x1a2172){if(_0x1a2172)return _0x1a2172;if(_0xfce9fc['moduleCreate']!=_0x1ece('0x59')){return createEndUser(_0xd2be23,_0x17f230,_0x15e0b6,_0x35ba5a,_0x189538,_0xfce9fc);}else{return{};}});});break;case _0x1ece('0x5a'):_0x41f996[_0x1ece('0x54')]='https://www.zohoapis.'+_0x17f230+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x35ba5a+'))';return getZohoUser(_0x41f996,_0x1ece('0x56'))['then'](function(_0x14401c){if(_0x14401c)return _0x14401c;if(_0xfce9fc[_0x1ece('0x4f')]!=_0x1ece('0x59')){return createEndUser(_0xd2be23,_0x17f230,_0x15e0b6,_0x35ba5a,_0x189538,_0xfce9fc);}else{return{};}});break;case'lead':_0x41f996[_0x1ece('0x54')]='https://www.zohoapis.'+_0x17f230+_0x1ece('0x57')+_0x35ba5a+'))';return getZohoUser(_0x41f996,_0x1ece('0x58'))[_0x1ece('0x2d')](function(_0x558b16){if(_0x558b16)return _0x558b16;if(_0xfce9fc[_0x1ece('0x4f')]!=_0x1ece('0x59')){return createEndUser(_0xd2be23,_0x17f230,_0x15e0b6,_0x35ba5a,_0x189538,_0xfce9fc);}else{return{};}});break;}}function getCall(_0x299d27,_0x443b21,_0x3e1bed,_0x5bf306,_0x331c18,_0x573d6f,_0x3dc3ab,_0xc342d5){logger[_0x1ece('0x3e')](_0x1ece('0x5b'));var _0x1a6775={};_0x1a6775[_0x1ece('0x5c')]={'name':!_['isNil'](_0x5bf306[_0x1ece('0x48')][_0x1ece('0x1d')])&&!_['isNil'](_0x5bf306[_0x1ece('0x3f')][_0x1ece('0x1d')])&&_0x5bf306['profile'][_0x1ece('0x1d')]===_0x1ece('0x5d')?_0x5bf306[_0x1ece('0x48')]['name']:!_[_0x1ece('0x20')](_0x5bf306['first_name'])?_0x5bf306['first_name']+'\x20'+_0x5bf306['last_name']:_0x5bf306['last_name'],'id':_0x5bf306['id']};_0x1a6775[_0x1ece('0x5e')]=intUtil['getString'](_0x573d6f[_0x1ece('0x5f')],_0x3dc3ab,'\x20');_0x1a6775['Description']=intUtil['getString'](_0x573d6f['Descriptions'],_0x3dc3ab,'\x0a');if(_0x331c18[_0x1ece('0x44')]==='Contacts'){_0x1a6775[_0x1ece('0x60')]={'name':!_[_0x1ece('0x20')](_0x331c18[_0x1ece('0x61')])?_0x331c18[_0x1ece('0x61')]:!_[_0x1ece('0x20')](_0x331c18['First_Name'])?_0x331c18['First_Name']+'\x20'+_0x331c18[_0x1ece('0x62')]:_0x331c18[_0x1ece('0x62')],'id':_0x331c18['id']};}if(_0x331c18['enduserType']===_0x1ece('0x58')){_0x1a6775[_0x1ece('0x63')]={'name':!_[_0x1ece('0x20')](_0x331c18[_0x1ece('0x61')])?_0x331c18[_0x1ece('0x61')]:!_[_0x1ece('0x20')](_0x331c18[_0x1ece('0x64')])?_0x331c18[_0x1ece('0x64')]+'\x20'+_0x331c18[_0x1ece('0x62')]:_0x331c18[_0x1ece('0x62')],'id':_0x331c18['id']};_0x1a6775['$se_module']=_[_0x1ece('0x47')](_0x331c18['enduserType']);}if(_0x3dc3ab[_0x1ece('0x65')]){_0x1a6775[_0x1ece('0x66')]=moment[_0x1ece('0x67')](parseInt(_0x3dc3ab[_0x1ece('0x65')])*0x3e8)[_0x1ece('0x36')]('mm:ss');}else if(_0x3dc3ab[_0x1ece('0x68')]&&_0x3dc3ab[_0x1ece('0x69')]){_0x1a6775['Call_Duration']=moment[_0x1ece('0x67')](moment(_0x3dc3ab[_0x1ece('0x69')],_0x1ece('0x6a'))['diff'](moment(_0x3dc3ab[_0x1ece('0x6b')],'YYYY-MM-DDTHH:mm:ss')))[_0x1ece('0x36')](_0x1ece('0x6c'));}switch(_0x3dc3ab[_0x1ece('0x6d')]){case _0x1ece('0x6e'):_0x1a6775['Call_Result']=_0x1ece('0x6f');break;case _0x1ece('0x70'):case _0x1ece('0x71'):_0x1a6775[_0x1ece('0x72')]='Answered';break;case _0x1ece('0x73'):_0x1a6775[_0x1ece('0x72')]=_0x1ece('0x74');break;case _0x1ece('0x75'):_0x1a6775['Call_Result']=_0x1ece('0x76');break;case _0x1ece('0x77'):_0x1a6775['Call_Result']='Timeout';default:}_0x1a6775['Call_Start_Time']=(_0xc342d5===_0x1ece('0x78')?moment(_0x3dc3ab[_0x1ece('0x6b')])[_0x1ece('0x36')](_0x1ece('0x6a')):moment(_0x3dc3ab[_0x1ece('0x79')])[_0x1ece('0x36')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x1ece('0x36')](_0x1ece('0x6a'));_0x1a6775[_0x1ece('0x7a')]=_0xc342d5||_0x1ece('0x7b');_0x1a6775=_[_0x1ece('0x7c')](_0x1a6775,getCustomFields(_0x573d6f[_0x1ece('0x7d')],_0x3dc3ab));return request({'method':_0x1ece('0x27'),'uri':_0x1ece('0x45')+_0x443b21+_0x1ece('0x7e'),'headers':{'Authorization':_0x1ece('0x39')+_0x299d27},'body':{'data':[_0x1a6775]},'json':!![]})[_0x1ece('0x2d')](function(_0x8aafad){if(_0x8aafad&&_0x8aafad[_0x1ece('0x4b')][0x0][_0x1ece('0x4c')]==='SUCCESS'){logger[_0x1ece('0x3e')]('Call\x20created!');return{'id':_0x8aafad[_0x1ece('0x4b')][0x0][_0x1ece('0x4e')]['id']};}})[_0x1ece('0x31')](function(_0x475d08){logger[_0x1ece('0x3e')]('err',_0x475d08['stack']);console[_0x1ece('0x7f')](_0x1ece('0x80'),_0x475d08);});}exports['queue']=function(_0x4911cb,_0x5bde23,_0x13880f,_0x5ab450,_0xcb4553,_0x1d58e5){var _0x3132f5,_0x33d404,_0x4536d7;_0x1d58e5['host']=intUtil['stripTrailingSlash'](_0x1d58e5['host']);_0x1d58e5['serverUrl']=intUtil['stripTrailingSlash'](_0x1d58e5[_0x1ece('0x81')]);if(_0xcb4553&&_0xcb4553[_0x1ece('0x82')]){logger[_0x1ece('0x3e')](_0x1ece('0x83'),_0x1ece('0x84'));_0x5bde23[_0x1ece('0x85')]=_0x1d58e5[_0x1ece('0x81')]+_0x1ece('0x86')+_0x5bde23[_0x1ece('0x87')]+_0x1ece('0x88')+md5(_0x5bde23[_0x1ece('0x87')]);}else{_0x5bde23[_0x1ece('0x85')]='';}var _0x20a438=_0x1d58e5[_0x1ece('0x89')]===_0x1ece('0x8a')?'eu':'com';return getAccessToken(_0x1d58e5)[_0x1ece('0x2d')](function(_0x2e710d){_0x4536d7=_0x2e710d;return getUser(_0x4536d7,_0x20a438,_0x1d58e5,_0x5ab450['email']);})[_0x1ece('0x2d')](function(_0x52a820){_0x3132f5=_0x52a820;logger[_0x1ece('0x3e')](_0x1ece('0x8b'),_0x3132f5['id']);return getEndUser(_0x4536d7,_0x20a438,_0x1d58e5,_0x5bde23['calleridname'],_0x5bde23[_0x1ece('0x8c')],_0x3132f5,_0x13880f);})[_0x1ece('0x2d')](function(_0x2280bb){_0x33d404=_0x2280bb;return getCall(_0x4536d7,_0x20a438,_0x1d58e5,_0x3132f5,_0x33d404,_0x13880f,_0x5bde23,'Inbound');})[_0x1ece('0x2d')](function(_0x28cec6){if(_0x28cec6){logger['info'](_0x1ece('0x8d'),_0x28cec6['id']);logger[_0x1ece('0x3e')](_0x1ece('0x83'),_0x1ece('0x8e'));emit(util[_0x1ece('0x36')](_0x1ece('0x8f'),_0x5ab450['name']),'trigger:browser:url',{'uri':_0x1ece('0x90')+_0x1d58e5[_0x1ece('0x89')]+_0x1ece('0x91')+_0x28cec6['id']});}})[_0x1ece('0x31')](function(_0x483ac6){logger[_0x1ece('0x32')]('[QUEUE]',JSON[_0x1ece('0x11')](_0x483ac6));});};exports[_0x1ece('0x78')]=function(_0x1777e8,_0x46e4f0,_0x34a1b6,_0x5c52de,_0x548a4b,_0x59d735,_0x24bf43){var _0x289ce1,_0x388d3d,_0x23cae2;_0x59d735['host']=intUtil['stripTrailingSlash'](_0x59d735[_0x1ece('0x89')]);_0x59d735[_0x1ece('0x81')]=intUtil['stripTrailingSlash'](_0x59d735[_0x1ece('0x81')]);if(_0x24bf43&&_0x24bf43[_0x1ece('0x92')]&&_0x24bf43[_0x1ece('0x92')]!==_0x1ece('0x93')){logger['info'](_0x1ece('0x94'),'Recording\x20is\x20enabled!');_0x46e4f0[_0x1ece('0x85')]=_0x59d735[_0x1ece('0x81')]+'/api/voice/recordings/'+_0x46e4f0['uniqueid']+_0x1ece('0x88')+md5(_0x46e4f0[_0x1ece('0x87')]);}var _0x4ffc4e=_0x59d735[_0x1ece('0x89')]===_0x1ece('0x8a')?'eu':_0x1ece('0x95');return getAccessToken(_0x59d735)[_0x1ece('0x2d')](function(_0x209b50){_0x23cae2=_0x209b50;return getUser(_0x23cae2,_0x4ffc4e,_0x59d735,_0x5c52de['email']);})[_0x1ece('0x2d')](function(_0x2a55ff){_0x289ce1=_0x2a55ff;logger[_0x1ece('0x3e')](_0x1ece('0x8b'),_0x289ce1['id']);return getEndUser(_0x23cae2,_0x4ffc4e,_0x59d735,_0x46e4f0[_0x1ece('0x96')],_0x46e4f0[_0x1ece('0x97')],_0x289ce1,_0x34a1b6);})[_0x1ece('0x2d')](function(_0x1b0e9a){_0x388d3d=_0x1b0e9a;return getCall(_0x23cae2,_0x4ffc4e,_0x59d735,_0x289ce1,_0x388d3d,_0x34a1b6,_0x46e4f0,'Outbound');})[_0x1ece('0x2d')](function(_0x5046bd){if(_0x5046bd){logger[_0x1ece('0x3e')](_0x1ece('0x8d'),_0x5046bd['id']);logger['info'](_0x1ece('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x5c52de[_0x1ece('0x1d')]),_0x1ece('0x98'),{'uri':_0x1ece('0x90')+_0x59d735[_0x1ece('0x89')]+_0x1ece('0x91')+_0x5046bd['id']});}})[_0x1ece('0x31')](function(_0xd306d0){logger['error'](_0x1ece('0x94'),JSON[_0x1ece('0x11')](_0xd306d0));});};exports[_0x1ece('0x99')]=function(_0x368caf,_0x92fdf1,_0x112c46,_0xf93409,_0x2198a4,_0x431fd0){var _0x183194,_0x3b209a,_0x5e27da;_0x431fd0['host']=intUtil[_0x1ece('0x9a')](_0x431fd0['host']);_0x431fd0[_0x1ece('0x81')]=intUtil[_0x1ece('0x9a')](_0x431fd0[_0x1ece('0x81')]);if(_0x2198a4&&_0x2198a4[_0x1ece('0x82')]){logger['info']('['+_0x92fdf1[_0x1ece('0x6d')][_0x1ece('0x9b')]()+']',_0x1ece('0x84'));_0x92fdf1[_0x1ece('0x85')]=_0x431fd0[_0x1ece('0x81')]+_0x1ece('0x86')+_0x92fdf1[_0x1ece('0x87')]+_0x1ece('0x88')+md5(_0x92fdf1[_0x1ece('0x87')]);}else{_0x92fdf1[_0x1ece('0x85')]='';}var _0x5d91d4=_0x431fd0[_0x1ece('0x89')]===_0x1ece('0x8a')?'eu':_0x1ece('0x95');return getAccessToken(_0x431fd0)[_0x1ece('0x2d')](function(_0x3f21f2){_0x5e27da=_0x3f21f2;return getUser(_0x5e27da,_0x5d91d4,_0x431fd0);})[_0x1ece('0x2d')](function(_0x4eae8b){_0x183194=_0x4eae8b;logger[_0x1ece('0x3e')](_0x1ece('0x8b'),_0x183194['id']);return getEndUser(_0x5e27da,_0x5d91d4,_0x431fd0,_0x92fdf1['calleridname'],_0x92fdf1[_0x1ece('0x8c')],_0x183194,_0x112c46);})[_0x1ece('0x2d')](function(_0x5b4fd6){_0x3b209a=_0x5b4fd6;return getCall(_0x5e27da,_0x5d91d4,_0x431fd0,_0x183194,_0x3b209a,_0x112c46,_0x92fdf1,_0x1ece('0x7b'));})[_0x1ece('0x2d')](function(_0x2fe7aa){if(_0x2fe7aa){logger[_0x1ece('0x3e')]('The\x20Call\x20ID\x20is:',_0x2fe7aa['id']);}})['catch'](function(_0xe9e090){logger[_0x1ece('0x32')]('['+_0x92fdf1['lastevent'][_0x1ece('0x9b')]()+']',JSON[_0x1ece('0x11')](_0xe9e090));});}; \ No newline at end of file +var _0x16b7=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','unmanaged','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','add','seconds','catch','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x16b7,0x1e0));var _0x716b=function(_0x5e8eeb,_0x1eacfd){_0x5e8eeb=_0x5e8eeb-0x0;var _0x1815b8=_0x16b7[_0x5e8eeb];return _0x1815b8;};'use strict';var _=require('lodash');var rp=require(_0x716b('0x0'));var md5=require(_0x716b('0x1'));var util=require(_0x716b('0x2'));var intUtil=require(_0x716b('0x3'));var moment=require('moment');var Redis=require(_0x716b('0x4'));var BPromise=require(_0x716b('0x5'));var config=require('../../../../config/environment');var logger=require(_0x716b('0x6'))(_0x716b('0x7'));config[_0x716b('0x8')]=_[_0x716b('0x9')](config[_0x716b('0x8')],{'host':_0x716b('0xa'),'port':0x18eb});var io=require(_0x716b('0xb'))(new Redis(config['redis']));function emit(_0x4747c0,_0x3cfecd,_0x584e0f){io['to'](_0x4747c0)[_0x716b('0xc')](_0x3cfecd,_0x584e0f);}function request(_0x30aa76){logger[_0x716b('0xd')](_0x716b('0xe'),JSON['stringify'](_0x30aa76));return rp(_0x30aa76);}function getCustomFields(_0x5632ca,_0x419c14){var _0xf86d6={};if(_0x5632ca[_0x716b('0xf')]>0x0){_[_0x716b('0x10')](_0x5632ca,function(_0x45b166){if(_[_0x716b('0x11')]([_0x716b('0x12'),_0x716b('0x13')],_0x45b166[_0x716b('0x14')])&&_0x45b166[_0x716b('0x15')]){_0xf86d6[_0x45b166[_0x716b('0x15')]]=_0x45b166['content']['toString']();}else if(_0x45b166[_0x716b('0x14')]===_0x716b('0x16')&&_0x45b166[_0x716b('0x17')]&&_0x45b166[_0x716b('0x15')]&&_0x419c14[_0x45b166['variableName']]){_0xf86d6[_0x45b166[_0x716b('0x15')]]=_0x419c14[_0x45b166['variableName']][_0x716b('0x18')]();}else if(_0x45b166[_0x716b('0x14')]===_0x716b('0x19')&&_0x45b166['Variable']&&_0x45b166[_0x716b('0x1a')][_0x716b('0x1b')]&&_0x45b166[_0x716b('0x15')]&&_0x419c14[_0x45b166['Variable'][_0x716b('0x1b')][_0x716b('0x1c')]()]){_0xf86d6[_0x45b166['idField']]=_0x419c14[_0x45b166[_0x716b('0x1a')]['name']['toLowerCase']()]['toString']();}});}return _0xf86d6;}function getName(_0x58f099){if(_0x58f099['indexOf']('\x20')>0x0){var _0xd97aa8=_0x58f099[_0x716b('0x1d')](/ (.+)/);if(_0xd97aa8[0x1]){return _0xd97aa8;}}return[_0x58f099,_0x58f099];}var accountsTokens={};function getAccessToken(_0x25cb1e){return new Promise(function(_0x7784b3,_0x5515a4){if(!_[_0x716b('0x1e')](accountsTokens[_0x25cb1e['id']])&&!_[_0x716b('0x1e')](accountsTokens[_0x25cb1e['id']][_0x716b('0x1f')])){if(moment()[_0x716b('0x20')](accountsTokens[_0x25cb1e['id']][_0x716b('0x21')])){_0x7784b3(accountsTokens[_0x25cb1e['id']][_0x716b('0x1f')]);}}var _0x463d64;switch(_0x25cb1e[_0x716b('0x22')]){case'US':_0x463d64=_0x716b('0x23');break;case'AU':_0x463d64='https://accounts.zoho.com.au';break;case'EU':_0x463d64=_0x716b('0x24');break;case'IN':_0x463d64=_0x716b('0x25');break;case'CN':_0x463d64=_0x716b('0x26');break;default:_0x463d64=_0x716b('0x24');break;}var _0xe5ab9e={'method':_0x716b('0x27'),'uri':_0x463d64+'/oauth/v2/token','qs':{'refresh_token':_0x25cb1e[_0x716b('0x28')],'client_id':_0x25cb1e[_0x716b('0x29')],'client_secret':_0x25cb1e[_0x716b('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xe5ab9e)[_0x716b('0x2b')](function(_0x11c0cb){accountsTokens[_0x25cb1e['id']]={'access_token':_0x11c0cb[_0x716b('0x1f')],'expires_in':moment()[_0x716b('0x2c')](_0x11c0cb[_0x716b('0x21')],_0x716b('0x2d'))};_0x7784b3(_0x11c0cb[_0x716b('0x1f')]);})[_0x716b('0x2e')](function(_0x533dbf){logger['error']('Failing\x20creating\x20the\x20access_token',_0x533dbf[_0x716b('0x2f')]);_0x5515a4(_0x533dbf);});});}function getUser(_0x5d3a3f,_0x1cdd0d,_0x2dd8c3,_0x5753fe){logger[_0x716b('0x30')](_0x716b('0x31'));return request({'method':'GET','uri':util['format'](_0x716b('0x32'),_0x1cdd0d),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x716b('0x33')+_0x5d3a3f},'json':!![]})[_0x716b('0x2b')](function(_0x482379){if(_0x482379['users']){var _0x5ca0c7=-0x1;if(_[_0x716b('0x34')](_0x482379[_0x716b('0x35')])){if(!_[_0x716b('0x1e')](_0x5753fe)){_0x5ca0c7=_[_0x716b('0x36')](_0x482379[_0x716b('0x35')],function(_0x3001ef){return _0x3001ef['email']===_0x5753fe;});}if(_0x5ca0c7>=0x0){logger[_0x716b('0x30')](_0x716b('0x37'));}else{logger[_0x716b('0x30')](_0x716b('0x38'));_0x5ca0c7=_[_0x716b('0x36')](_0x482379[_0x716b('0x35')],function(_0xd041ca){return _0xd041ca[_0x716b('0x39')][_0x716b('0x1b')]===_0x716b('0x3a');});}return _0x482379[_0x716b('0x35')][_0x5ca0c7];}else{if(_0x482379[_0x716b('0x3b')][_0x716b('0x39')][_0x716b('0x1b')]===_0x716b('0x3a')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x482379[_0x716b('0x3b')];return user;}else{logger[_0x716b('0x3c')](_0x716b('0x3d'),JSON[_0x716b('0x3e')](_0x482379));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x716b('0x3e')](_0x482379));}}}else{logger[_0x716b('0x3c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x482379));throw new Error(_0x716b('0x3f')+JSON[_0x716b('0x3e')](_0x482379));}})[_0x716b('0x2e')](function(_0x4be649){console[_0x716b('0x3c')](_0x4be649);});}function getZohoUser(_0xf3e0c3,_0x14c5f1){return new BPromise(function(_0x475849,_0x5c86eb){request(_0xf3e0c3)['then'](function(_0x54c11a){var _0x2017f9=null;if(_0x54c11a){_0x2017f9=_0x54c11a[_0x716b('0x40')][0x0];_0x2017f9[_0x716b('0x41')]=_0x14c5f1;}_0x475849(_0x2017f9);})[_0x716b('0x2e')](function(_0x56b925){_0x5c86eb(_0x56b925);});});}function createEndUser(_0x256ddc,_0x4263c8,_0x288472,_0x4a994e,_0x2ff0f8,_0x3fee82){var _0x288472=getName(_0x288472);return request({'method':'POST','uri':_0x716b('0x42')+_0x4263c8+'/crm/v2/'+_[_0x716b('0x43')](_0x3fee82['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x288472[0x1],'First_Name':_0x288472[0x0],'Phone':_0x4a994e,'Owner':{'name':!_[_0x716b('0x1e')](_0x2ff0f8[_0x716b('0x44')][_0x716b('0x1b')])?_0x2ff0f8[_0x716b('0x44')][_0x716b('0x1b')]:!_[_0x716b('0x1e')](_0x2ff0f8[_0x716b('0x45')])?_0x2ff0f8[_0x716b('0x45')]+'\x20'+_0x2ff0f8[_0x716b('0x46')]:_0x2ff0f8['last_name'],'id':_0x2ff0f8['id']}}]},'headers':{'Authorization':_0x716b('0x33')+_0x256ddc},'json':!![]})['then'](function(_0x1c8152){if(_0x1c8152&&_0x1c8152[_0x716b('0x40')][0x0][_0x716b('0x47')]===_0x716b('0x48')){var _0x1cdc3a=_0x1c8152[_0x716b('0x40')][0x0][_0x716b('0x49')];_0x1cdc3a[_0x716b('0x41')]=_[_0x716b('0x43')](_0x3fee82[_0x716b('0x4a')])+'s';return _0x1cdc3a;}logger[_0x716b('0x3c')](_0x716b('0x3d'),JSON[_0x716b('0x3e')](data));throw new Error(_0x716b('0x4b')+JSON[_0x716b('0x3e')](data));})['catch'](function(_0x1fd5f8){console[_0x716b('0x4c')](_0x716b('0x4d'),_0x1fd5f8);});}function getEndUser(_0xbc3bc0,_0x1a1f59,_0x2ddd78,_0x277512,_0x58a50a,_0x1fa9a8,_0x508c39){var _0x12d5bb={'method':_0x716b('0x4e'),'uri':'','headers':{'Authorization':_0x716b('0x33')+_0xbc3bc0},'json':!![]};switch(_0x508c39[_0x716b('0x4f')]){case _0x716b('0x50'):_0x12d5bb[_0x716b('0x51')]=_0x716b('0x42')+_0x1a1f59+_0x716b('0x52')+_0x58a50a+'))';return getZohoUser(_0x12d5bb,_0x716b('0x53'))[_0x716b('0x2b')](function(_0x3fbe37){if(_0x3fbe37)return _0x3fbe37;_0x12d5bb[_0x716b('0x51')]='https://www.zohoapis.'+_0x1a1f59+_0x716b('0x54')+_0x58a50a+'))';return getZohoUser(_0x12d5bb,_0x716b('0x55'))[_0x716b('0x2b')](function(_0x26751f){if(_0x26751f)return _0x26751f;if(_0x508c39[_0x716b('0x4a')]!='nothing'){return createEndUser(_0xbc3bc0,_0x1a1f59,_0x277512,_0x58a50a,_0x1fa9a8,_0x508c39);}else{return{};}});});break;case'contact':_0x12d5bb[_0x716b('0x51')]='https://www.zohoapis.'+_0x1a1f59+_0x716b('0x52')+_0x58a50a+'))';return getZohoUser(_0x12d5bb,'Contacts')[_0x716b('0x2b')](function(_0x2ee3b9){if(_0x2ee3b9)return _0x2ee3b9;if(_0x508c39[_0x716b('0x4a')]!=_0x716b('0x56')){return createEndUser(_0xbc3bc0,_0x1a1f59,_0x277512,_0x58a50a,_0x1fa9a8,_0x508c39);}else{return{};}});break;case _0x716b('0x57'):_0x12d5bb[_0x716b('0x51')]=_0x716b('0x42')+_0x1a1f59+_0x716b('0x54')+_0x58a50a+'))';return getZohoUser(_0x12d5bb,'Leads')['then'](function(_0x1f9377){if(_0x1f9377)return _0x1f9377;if(_0x508c39[_0x716b('0x4a')]!=_0x716b('0x56')){return createEndUser(_0xbc3bc0,_0x1a1f59,_0x277512,_0x58a50a,_0x1fa9a8,_0x508c39);}else{return{};}});break;}}function getCall(_0x3f3502,_0x4f869c,_0x13c98f,_0x2dba80,_0x34de96,_0x3f55bb,_0x4990ce,_0x47d3c5){logger[_0x716b('0x30')](_0x716b('0x58'));var _0x7e51ff={};_0x7e51ff[_0x716b('0x59')]={'name':!_[_0x716b('0x1e')](_0x2dba80['role'][_0x716b('0x1b')])&&!_[_0x716b('0x1e')](_0x2dba80['profile'][_0x716b('0x1b')])&&_0x2dba80[_0x716b('0x39')][_0x716b('0x1b')]===_0x716b('0x5a')?_0x2dba80[_0x716b('0x44')][_0x716b('0x1b')]:!_['isNil'](_0x2dba80[_0x716b('0x45')])?_0x2dba80[_0x716b('0x45')]+'\x20'+_0x2dba80[_0x716b('0x46')]:_0x2dba80[_0x716b('0x46')],'id':_0x2dba80['id']};_0x7e51ff[_0x716b('0x5b')]=intUtil[_0x716b('0x5c')](_0x3f55bb[_0x716b('0x5d')],_0x4990ce,'\x20');_0x7e51ff[_0x716b('0x5e')]=intUtil[_0x716b('0x5c')](_0x3f55bb[_0x716b('0x5f')],_0x4990ce,'\x0a');if(_0x34de96[_0x716b('0x41')]===_0x716b('0x53')){_0x7e51ff[_0x716b('0x60')]={'name':!_[_0x716b('0x1e')](_0x34de96[_0x716b('0x61')])?_0x34de96['Full_Name']:!_['isNil'](_0x34de96['First_Name'])?_0x34de96['First_Name']+'\x20'+_0x34de96[_0x716b('0x62')]:_0x34de96[_0x716b('0x62')],'id':_0x34de96['id']};}if(_0x34de96[_0x716b('0x41')]===_0x716b('0x55')){_0x7e51ff[_0x716b('0x63')]={'name':!_[_0x716b('0x1e')](_0x34de96[_0x716b('0x61')])?_0x34de96[_0x716b('0x61')]:!_['isNil'](_0x34de96['First_Name'])?_0x34de96[_0x716b('0x64')]+'\x20'+_0x34de96[_0x716b('0x62')]:_0x34de96[_0x716b('0x62')],'id':_0x34de96['id']};_0x7e51ff[_0x716b('0x65')]=_[_0x716b('0x43')](_0x34de96['enduserType']);}if(_0x4990ce['talktime']){_0x7e51ff['Call_Duration']=moment[_0x716b('0x66')](parseInt(_0x4990ce['talktime'])*0x3e8)[_0x716b('0x67')](_0x716b('0x68'));}else if(_0x4990ce[_0x716b('0x69')]&&_0x4990ce[_0x716b('0x6a')]){_0x7e51ff['Call_Duration']=moment['utc'](moment(_0x4990ce[_0x716b('0x6a')],_0x716b('0x6b'))[_0x716b('0x6c')](moment(_0x4990ce[_0x716b('0x6d')],_0x716b('0x6b'))))[_0x716b('0x67')](_0x716b('0x68'));}switch(_0x4990ce[_0x716b('0x6e')]){case _0x716b('0x6f'):_0x7e51ff[_0x716b('0x70')]=_0x716b('0x71');break;case _0x716b('0x72'):case _0x716b('0x73'):_0x7e51ff[_0x716b('0x70')]=_0x716b('0x74');break;case'rejected':_0x7e51ff['Call_Result']=_0x716b('0x75');break;case _0x716b('0x76'):_0x7e51ff['Call_Result']=_0x716b('0x77');break;case _0x716b('0x78'):_0x7e51ff[_0x716b('0x70')]=_0x716b('0x79');default:}_0x7e51ff['Call_Start_Time']=(_0x47d3c5===_0x716b('0x7a')?moment(_0x4990ce[_0x716b('0x6d')])[_0x716b('0x67')](_0x716b('0x6b')):moment(_0x4990ce[_0x716b('0x7b')])[_0x716b('0x67')](_0x716b('0x6b')))||moment()[_0x716b('0x67')](_0x716b('0x6b'));_0x7e51ff[_0x716b('0x7c')]=_0x47d3c5||_0x716b('0x7d');_0x7e51ff=_[_0x716b('0x7e')](_0x7e51ff,getCustomFields(_0x3f55bb[_0x716b('0x7f')],_0x4990ce));return request({'method':_0x716b('0x27'),'uri':_0x716b('0x42')+_0x4f869c+'/crm/v2/Calls','headers':{'Authorization':_0x716b('0x33')+_0x3f3502},'body':{'data':[_0x7e51ff]},'json':!![]})[_0x716b('0x2b')](function(_0x3a23e2){if(_0x3a23e2&&_0x3a23e2[_0x716b('0x40')][0x0][_0x716b('0x47')]===_0x716b('0x48')){logger[_0x716b('0x30')]('Call\x20created!');return{'id':_0x3a23e2['data'][0x0]['details']['id']};}})['catch'](function(_0x1c23d7){logger[_0x716b('0x30')](_0x716b('0x80'),_0x1c23d7[_0x716b('0x2f')]);console['log'](_0x716b('0x80'),_0x1c23d7);});}exports[_0x716b('0x81')]=function(_0x483663,_0x27df1c,_0x511410,_0x531944,_0x4a74a1,_0x3b8774){var _0xfe3861,_0x5c5696,_0x4d1279;_0x3b8774['host']=intUtil[_0x716b('0x82')](_0x3b8774[_0x716b('0x83')]);_0x3b8774[_0x716b('0x84')]=intUtil[_0x716b('0x82')](_0x3b8774['serverUrl']);if(_0x4a74a1&&_0x4a74a1[_0x716b('0x85')]){logger[_0x716b('0x30')](_0x716b('0x86'),_0x716b('0x87'));_0x27df1c[_0x716b('0x88')]=_0x3b8774['serverUrl']+_0x716b('0x89')+_0x27df1c['uniqueid']+_0x716b('0x8a')+md5(_0x27df1c[_0x716b('0x8b')]);}else{_0x27df1c[_0x716b('0x88')]='';}var _0x3ff3a3=_0x3b8774[_0x716b('0x83')]===_0x716b('0x8c')?'eu':_0x716b('0x8d');return getAccessToken(_0x3b8774)['then'](function(_0x3443b3){_0x4d1279=_0x3443b3;return getUser(_0x4d1279,_0x3ff3a3,_0x3b8774,_0x531944['email']);})['then'](function(_0x270b9b){_0xfe3861=_0x270b9b;logger[_0x716b('0x30')](_0x716b('0x8e'),_0xfe3861['id']);return getEndUser(_0x4d1279,_0x3ff3a3,_0x3b8774,_0x27df1c[_0x716b('0x8f')],_0x27df1c[_0x716b('0x90')],_0xfe3861,_0x511410);})['then'](function(_0x7fc1b4){_0x5c5696=_0x7fc1b4;return getCall(_0x4d1279,_0x3ff3a3,_0x3b8774,_0xfe3861,_0x5c5696,_0x511410,_0x27df1c,_0x716b('0x7d'));})[_0x716b('0x2b')](function(_0x10c9d1){if(_0x10c9d1){logger[_0x716b('0x30')](_0x716b('0x91'),_0x10c9d1['id']);logger[_0x716b('0x30')](_0x716b('0x86'),_0x716b('0x92'));emit(util[_0x716b('0x67')](_0x716b('0x93'),_0x531944[_0x716b('0x1b')]),_0x716b('0x94'),{'uri':_0x716b('0x95')+_0x3b8774[_0x716b('0x83')]+_0x716b('0x96')+_0x10c9d1['id']});}})[_0x716b('0x2e')](function(_0x352eab){logger[_0x716b('0x3c')](_0x716b('0x86'),JSON[_0x716b('0x3e')](_0x352eab));});};exports[_0x716b('0x7a')]=function(_0x19b490,_0x1d771c,_0x551a60,_0x54596f,_0x1d3f2d,_0x381dc9,_0x500419){var _0x3be73f,_0x36a30a,_0x4cd4f9;_0x381dc9[_0x716b('0x83')]=intUtil[_0x716b('0x82')](_0x381dc9[_0x716b('0x83')]);_0x381dc9[_0x716b('0x84')]=intUtil['stripTrailingSlash'](_0x381dc9[_0x716b('0x84')]);if(_0x500419&&_0x500419['recordingFormat']&&_0x500419[_0x716b('0x97')]!==_0x716b('0x98')){logger[_0x716b('0x30')](_0x716b('0x99'),_0x716b('0x87'));_0x1d771c[_0x716b('0x88')]=_0x381dc9[_0x716b('0x84')]+_0x716b('0x89')+_0x1d771c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x1d771c[_0x716b('0x8b')]);}var _0x14c6f4=_0x381dc9[_0x716b('0x83')]===_0x716b('0x8c')?'eu':_0x716b('0x8d');return getAccessToken(_0x381dc9)[_0x716b('0x2b')](function(_0x4fb4d6){_0x4cd4f9=_0x4fb4d6;return getUser(_0x4cd4f9,_0x14c6f4,_0x381dc9,_0x54596f['email']);})['then'](function(_0x330855){_0x3be73f=_0x330855;logger[_0x716b('0x30')](_0x716b('0x8e'),_0x3be73f['id']);return getEndUser(_0x4cd4f9,_0x14c6f4,_0x381dc9,_0x1d771c[_0x716b('0x9a')],_0x1d771c['destcalleridnum'],_0x3be73f,_0x551a60);})[_0x716b('0x2b')](function(_0x364d13){_0x36a30a=_0x364d13;return getCall(_0x4cd4f9,_0x14c6f4,_0x381dc9,_0x3be73f,_0x36a30a,_0x551a60,_0x1d771c,_0x716b('0x9b'));})['then'](function(_0x1f526e){if(_0x1f526e){logger[_0x716b('0x30')](_0x716b('0x91'),_0x1f526e['id']);logger['info'](_0x716b('0x99'),_0x716b('0x92'));emit(util[_0x716b('0x67')](_0x716b('0x93'),_0x54596f[_0x716b('0x1b')]),_0x716b('0x94'),{'uri':_0x716b('0x95')+_0x381dc9[_0x716b('0x83')]+_0x716b('0x96')+_0x1f526e['id']});}})[_0x716b('0x2e')](function(_0xa06de2){logger['error']('[OUTBOUND]',JSON[_0x716b('0x3e')](_0xa06de2));});};exports[_0x716b('0x9c')]=function(_0x368bf3,_0x16ddb4,_0x4c4191,_0x4fd08f,_0x138aef,_0x2296b3){var _0xf81cbc,_0x4e3a17,_0x48ef9c;_0x2296b3[_0x716b('0x83')]=intUtil[_0x716b('0x82')](_0x2296b3['host']);_0x2296b3['serverUrl']=intUtil[_0x716b('0x82')](_0x2296b3[_0x716b('0x84')]);if(_0x138aef&&_0x138aef[_0x716b('0x85')]){logger[_0x716b('0x30')]('['+_0x16ddb4[_0x716b('0x6e')]['toUpperCase']()+']',_0x716b('0x87'));_0x16ddb4['recordingURL']=_0x2296b3[_0x716b('0x84')]+'/api/voice/recordings/'+_0x16ddb4[_0x716b('0x8b')]+_0x716b('0x8a')+md5(_0x16ddb4[_0x716b('0x8b')]);}else{_0x16ddb4['recordingURL']='';}var _0x25ba92=_0x2296b3[_0x716b('0x83')]===_0x716b('0x8c')?'eu':'com';return getAccessToken(_0x2296b3)[_0x716b('0x2b')](function(_0x159c1a){_0x48ef9c=_0x159c1a;return getUser(_0x48ef9c,_0x25ba92,_0x2296b3);})[_0x716b('0x2b')](function(_0x10b8f2){_0xf81cbc=_0x10b8f2;logger['info'](_0x716b('0x8e'),_0xf81cbc['id']);return getEndUser(_0x48ef9c,_0x25ba92,_0x2296b3,_0x16ddb4['calleridname'],_0x16ddb4[_0x716b('0x90')],_0xf81cbc,_0x4c4191);})[_0x716b('0x2b')](function(_0x27747a){_0x4e3a17=_0x27747a;return getCall(_0x48ef9c,_0x25ba92,_0x2296b3,_0xf81cbc,_0x4e3a17,_0x4c4191,_0x16ddb4,'Inbound');})[_0x716b('0x2b')](function(_0x410767){if(_0x410767){logger[_0x716b('0x30')](_0x716b('0x91'),_0x410767['id']);}})[_0x716b('0x2e')](function(_0x511e91){logger[_0x716b('0x3c')]('['+_0x16ddb4[_0x716b('0x6e')]['toUpperCase']()+']',JSON[_0x716b('0x3e')](_0x511e91));});}; \ 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 5669d58..a4007d3 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 _0x6f0e=['data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','Script'];(function(_0x157ce5,_0xfa6b87){var _0x359c0c=function(_0x403f22){while(--_0x403f22){_0x157ce5['push'](_0x157ce5['shift']());}};_0x359c0c(++_0xfa6b87);}(_0x6f0e,0x67));var _0xe6f0=function(_0x2ec7b2,_0x1d37af){_0x2ec7b2=_0x2ec7b2-0x0;var _0x3427a6=_0x6f0e[_0x2ec7b2];return _0x3427a6;};'use strict';var util=require(_0xe6f0('0x0'));var sh=require(_0xe6f0('0x1'));var Mustache=require('mustache');var logger=require(_0xe6f0('0x2'))(_0xe6f0('0x3'));exports['exec']=function(_0x8fbcf6,_0x55dd98){var _0x1037c7=_0x8fbcf6['data2']?_0x8fbcf6['data2']:_0xe6f0('0x4');var _0x581125=_0x8fbcf6[_0xe6f0('0x5')]?Mustache['render'](_0x8fbcf6['data3'],_0x55dd98):_0x55dd98;sh[_0xe6f0('0x6')](_0x581125,function(_0x33f76a,_0x48a4e0,_0x5d3f72){if(_0x33f76a!==0x0){logger[_0xe6f0('0x7')](util[_0xe6f0('0x8')](_0xe6f0('0x9'),_0x1037c7,_0x581125,_0x33f76a,_0x5d3f72));}else{logger[_0xe6f0('0xa')](util['format'](_0xe6f0('0xb'),_0x1037c7,_0x581125,_0x48a4e0));}});}; \ No newline at end of file +var _0x39b5=['../../../../config/logger','data2','Script','data3','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs'];(function(_0x3faf78,_0x5ba090){var _0x316556=function(_0x20d26b){while(--_0x20d26b){_0x3faf78['push'](_0x3faf78['shift']());}};_0x316556(++_0x5ba090);}(_0x39b5,0xda));var _0x539b=function(_0x4634c,_0x3fb0da){_0x4634c=_0x4634c-0x0;var _0x3f2685=_0x39b5[_0x4634c];return _0x3f2685;};'use strict';var util=require(_0x539b('0x0'));var sh=require(_0x539b('0x1'));var Mustache=require('mustache');var logger=require(_0x539b('0x2'))('trigger');exports['exec']=function(_0x31f1a7,_0x2c9d16){var _0x16b40b=_0x31f1a7[_0x539b('0x3')]?_0x31f1a7[_0x539b('0x3')]:_0x539b('0x4');var _0xa2679=_0x31f1a7[_0x539b('0x5')]?Mustache['render'](_0x31f1a7[_0x539b('0x5')],_0x2c9d16):_0x2c9d16;sh[_0x539b('0x6')](_0xa2679,function(_0x2ea3a0,_0x159727,_0x487241){if(_0x2ea3a0!==0x0){logger[_0x539b('0x7')](util[_0x539b('0x8')](_0x539b('0x9'),_0x16b40b,_0xa2679,_0x2ea3a0,_0x487241));}else{logger[_0x539b('0xa')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x16b40b,_0xa2679,_0x159727));}});}; \ 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 fd4753e..2e2b949 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 _0xcfec=['exec','data1','toUpperCase','render','data5','number','headers','data6','error','GET','POST','PUT','parse','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','lodash','../../../../config/logger','trigger'];(function(_0x12baed,_0x45a719){var _0x630772=function(_0x449242){while(--_0x449242){_0x12baed['push'](_0x12baed['shift']());}};_0x630772(++_0x45a719);}(_0xcfec,0xbc));var _0xccfe=function(_0x58adb2,_0xb66883){_0x58adb2=_0x58adb2-0x0;var _0x49564c=_0xcfec[_0x58adb2];return _0x49564c;};'use strict';var rp=require(_0xccfe('0x0'));var util=require('util');var _=require(_0xccfe('0x1'));var Mustache=require('mustache');var logger=require(_0xccfe('0x2'))(_0xccfe('0x3'));exports[_0xccfe('0x4')]=function(_0x53330c,_0x5c5ce9){var _0x228de9,_0x325a7b;var _0x3964b0={'method':_0x53330c[_0xccfe('0x5')][_0xccfe('0x6')](),'uri':Mustache[_0xccfe('0x7')](_0x53330c['data2'],_0x5c5ce9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x53330c[_0xccfe('0x8')])===_0xccfe('0x9')&&parseInt(_0x53330c[_0xccfe('0x8')])>=0x1&&parseInt(_0x53330c[_0xccfe('0x8')])<=0xa?parseInt(_0x53330c[_0xccfe('0x8')])*0x3e8:0x5*0x3e8};try{_0x3964b0[_0xccfe('0xa')]=_0x53330c[_0xccfe('0xb')]?JSON['parse'](Mustache[_0xccfe('0x7')](_0x53330c[_0xccfe('0xb')],_0x5c5ce9)):{};}catch(_0xf191f6){logger[_0xccfe('0xc')](_0xf191f6['stack']);}switch(_0x53330c[_0xccfe('0x5')][_0xccfe('0x6')]()){case _0xccfe('0xd'):case'DELETE':_0x228de9=null;_0x3964b0['qs']=_0x5c5ce9;break;case _0xccfe('0xe'):case _0xccfe('0xf'):if(_0x53330c['data7']){try{_0x228de9=JSON[_0xccfe('0x10')](Mustache[_0xccfe('0x7')](_0x53330c[_0xccfe('0x11')],_0x5c5ce9));_0x3964b0[_0xccfe('0x12')]=_0x228de9;}catch(_0x52a067){logger[_0xccfe('0xc')](_0x52a067[_0xccfe('0x13')]);logger[_0xccfe('0xc')](_0xccfe('0x14'));}}else{_0x228de9=_0x5c5ce9;_0x3964b0[_0xccfe('0x12')]=_0x228de9;}break;}logger[_0xccfe('0x15')](util[_0xccfe('0x16')](_0xccfe('0x17'),_0x53330c[_0xccfe('0x5')],_0x53330c[_0xccfe('0x18')],JSON[_0xccfe('0x19')](_0x3964b0)));rp(_0x3964b0)['then'](function(_0x514967){_0x228de9=!_['isNil'](_0x228de9)?_0xccfe('0x1a')+_0x228de9:'';_0x325a7b=typeof _0x514967[_0xccfe('0x12')]==='object'?JSON['stringify'](_0x514967[_0xccfe('0x12')]):_0x514967[_0xccfe('0x12')];logger[_0xccfe('0x15')](util[_0xccfe('0x16')](_0xccfe('0x1b'),_0x53330c[_0xccfe('0x5')],_0x53330c[_0xccfe('0x18')],_0x514967[_0xccfe('0x1c')],_0x325a7b));})[_0xccfe('0x1d')](function(_0x148e7a){logger[_0xccfe('0xc')](util[_0xccfe('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x53330c[_0xccfe('0x5')],_0x53330c[_0xccfe('0x18')],_0x148e7a[_0xccfe('0x1c')],_0x148e7a[_0xccfe('0x1e')],_0x148e7a[_0xccfe('0x1f')]));});}; \ No newline at end of file +var _0x55f4=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','GET','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','stringify','object'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x55f4,0x1c6));var _0x455f=function(_0xb1df1b,_0x3cc823){_0xb1df1b=_0xb1df1b-0x0;var _0x56863c=_0x55f4[_0xb1df1b];return _0x56863c;};'use strict';var rp=require('request-promise');var util=require(_0x455f('0x0'));var _=require(_0x455f('0x1'));var Mustache=require(_0x455f('0x2'));var logger=require(_0x455f('0x3'))('trigger');exports[_0x455f('0x4')]=function(_0x1c6579,_0x43cfc4){var _0x5179bf,_0x530342;var _0x3bb41d={'method':_0x1c6579['data1'][_0x455f('0x5')](),'uri':Mustache[_0x455f('0x6')](_0x1c6579[_0x455f('0x7')],_0x43cfc4),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1c6579['data5'])===_0x455f('0x8')&&parseInt(_0x1c6579[_0x455f('0x9')])>=0x1&&parseInt(_0x1c6579[_0x455f('0x9')])<=0xa?parseInt(_0x1c6579[_0x455f('0x9')])*0x3e8:0x5*0x3e8};try{_0x3bb41d[_0x455f('0xa')]=_0x1c6579[_0x455f('0xb')]?JSON[_0x455f('0xc')](Mustache[_0x455f('0x6')](_0x1c6579['data6'],_0x43cfc4)):{};}catch(_0x4b7ecf){logger[_0x455f('0xd')](_0x4b7ecf[_0x455f('0xe')]);}switch(_0x1c6579['data1'][_0x455f('0x5')]()){case _0x455f('0xf'):case'DELETE':_0x5179bf=null;_0x3bb41d['qs']=_0x43cfc4;break;case'POST':case _0x455f('0x10'):if(_0x1c6579[_0x455f('0x11')]){try{_0x5179bf=JSON['parse'](Mustache[_0x455f('0x6')](_0x1c6579[_0x455f('0x11')],_0x43cfc4));_0x3bb41d[_0x455f('0x12')]=_0x5179bf;}catch(_0x2c9c0c){logger[_0x455f('0xd')](_0x2c9c0c[_0x455f('0xe')]);logger[_0x455f('0xd')](_0x455f('0x13'));}}else{_0x5179bf=_0x43cfc4;_0x3bb41d[_0x455f('0x12')]=_0x5179bf;}break;}logger[_0x455f('0x14')](util[_0x455f('0x15')](_0x455f('0x16'),_0x1c6579[_0x455f('0x17')],_0x1c6579['data2'],JSON[_0x455f('0x18')](_0x3bb41d)));rp(_0x3bb41d)['then'](function(_0x170340){_0x5179bf=!_['isNil'](_0x5179bf)?',\x20request\x20body:\x20'+_0x5179bf:'';_0x530342=typeof _0x170340['body']===_0x455f('0x19')?JSON[_0x455f('0x18')](_0x170340[_0x455f('0x12')]):_0x170340[_0x455f('0x12')];logger[_0x455f('0x14')](util[_0x455f('0x15')](_0x455f('0x1a'),_0x1c6579['data1'],_0x1c6579[_0x455f('0x7')],_0x170340[_0x455f('0x1b')],_0x530342));})['catch'](function(_0x5deb00){logger[_0x455f('0xd')](util[_0x455f('0x15')](_0x455f('0x1c'),_0x1c6579['data1'],_0x1c6579[_0x455f('0x7')],_0x5deb00['statusCode'],_0x5deb00['name'],_0x5deb00[_0x455f('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 099c436..1db1e93 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 _0x7c95=['http','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x7c95,0x74));var _0x57c9=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x7c95[_0x263a74];return _0x2aa86c;};'use strict';var jayson=require(_0x57c9('0x0'));var BPromise=require(_0x57c9('0x1'));var logger=require(_0x57c9('0x2'))(_0x57c9('0x3'));var client=jayson['client'][_0x57c9('0x4')]({'port':0x2329});client[_0x57c9('0x5')]=function(_0xb4984d,_0x1b4bd4){return new BPromise(function(_0x3dfa40,_0x2d1e7d){return client[_0x57c9('0x6')](_0xb4984d,_0x1b4bd4)[_0x57c9('0x7')](function(_0x287654){logger[_0x57c9('0x8')](_0x57c9('0x9'),_0x57c9('0x3'),_0xb4984d,_0x1b4bd4,_0x287654);if(_0x287654[_0x57c9('0xa')]){logger['error']('rpc',_0x57c9('0x3'),_0xb4984d,_0x287654['error'][_0x57c9('0xb')],_0x1b4bd4);return _0x2d1e7d(_0x287654[_0x57c9('0xa')][_0x57c9('0xb')]);}else{return _0x3dfa40(_0x287654[_0x57c9('0xc')]);}})[_0x57c9('0xd')](function(_0x42bc31){logger[_0x57c9('0xa')](_0x57c9('0x9'),_0x57c9('0x3'),_0xb4984d,_0x42bc31,_0x1b4bd4);return _0x2d1e7d(_0x42bc31);});});};module[_0x57c9('0xe')]=client; \ No newline at end of file +var _0x163a=['error','message','catch','exports','bluebird','../../config/logger','routing','client','http','request','rpc'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x163a,0xf6));var _0xa163=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x163a[_0x334651];return _0x29657c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa163('0x0'));var logger=require(_0xa163('0x1'))(_0xa163('0x2'));var client=jayson[_0xa163('0x3')][_0xa163('0x4')]({'port':0x2329});client['Request']=function(_0x77ac46,_0x119084){return new BPromise(function(_0x1d8156,_0x28afe8){return client[_0xa163('0x5')](_0x77ac46,_0x119084)['then'](function(_0x25ba9c){logger['debug'](_0xa163('0x6'),_0xa163('0x2'),_0x77ac46,_0x119084,_0x25ba9c);if(_0x25ba9c[_0xa163('0x7')]){logger[_0xa163('0x7')](_0xa163('0x6'),_0xa163('0x2'),_0x77ac46,_0x25ba9c[_0xa163('0x7')][_0xa163('0x8')],_0x119084);return _0x28afe8(_0x25ba9c[_0xa163('0x7')][_0xa163('0x8')]);}else{return _0x1d8156(_0x25ba9c['result']);}})[_0xa163('0x9')](function(_0xde1903){logger[_0xa163('0x7')](_0xa163('0x6'),'routing',_0x77ac46,_0xde1903,_0x119084);return _0x28afe8(_0xde1903);});});};module[_0xa163('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d9f5423..b4639e2 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 _0xefe0=['mailAccounts','loginMailFrequency','catch','error','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe0,0x18a));var _0x0efe=function(_0x1a3917,_0x4f02ea){_0x1a3917=_0x1a3917-0x0;var _0x49172a=_0xefe0[_0x1a3917];return _0x49172a;};'use strict';var server=require('./server');var Realtime=require(_0x0efe('0x0'));var EmailChannel=require(_0x0efe('0x1'));var mailAccount=require(_0x0efe('0x2'));var setting=require(_0x0efe('0x3'));var logger=require(_0x0efe('0x4'))(_0x0efe('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0efe('0x6')]()['then'](mailAccount[_0x0efe('0x7')]())[_0x0efe('0x8')](realtime[_0x0efe('0x9')]())[_0x0efe('0x8')](function(){email[_0x0efe('0xa')](realtime[_0x0efe('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x0efe('0x8')](function(){return initRealtime();})[_0x0efe('0x8')](function(){return setting['getSettings']();})['then'](function(_0x52e6cd){return setInterval(initRealtime,_0x52e6cd[_0x0efe('0xc')]*0x3e8);})[_0x0efe('0xd')](function(_0x8af6f9){logger[_0x0efe('0xe')]('Email\x20service\x20initialization',_0x8af6f9);});}main(); \ No newline at end of file +var _0xe0e4=['email','then','refresh','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x291b70,_0x1bc6db){var _0x40770b=function(_0x4c3c94){while(--_0x4c3c94){_0x291b70['push'](_0x291b70['shift']());}};_0x40770b(++_0x1bc6db);}(_0xe0e4,0xec));var _0x4e0e=function(_0x3629da,_0x35b3d1){_0x3629da=_0x3629da-0x0;var _0x30d762=_0xe0e4[_0x3629da];return _0x30d762;};'use strict';var server=require('./server');var Realtime=require(_0x4e0e('0x0'));var EmailChannel=require(_0x4e0e('0x1'));var mailAccount=require(_0x4e0e('0x2'));var setting=require(_0x4e0e('0x3'));var logger=require('../../config/logger')(_0x4e0e('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x4e0e('0x5')](mailAccount['getMailAccounts']())[_0x4e0e('0x5')](realtime['initMailAccounts']())['then'](function(){email[_0x4e0e('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x4e0e('0x5')](function(){return initRealtime();})[_0x4e0e('0x5')](function(){return setting['getSettings']();})[_0x4e0e('0x5')](function(_0x29202b){return setInterval(initRealtime,_0x29202b['loginMailFrequency']*0x3e8);})[_0x4e0e('0x7')](function(_0x5cfd68){logger[_0x4e0e('0x8')](_0x4e0e('0x9'),_0x5cfd68);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index ddc1769..b768635 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 _0x9e58=['md5','../../../config/environment','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports'];(function(_0x414b18,_0x52bfdf){var _0x88d2d2=function(_0x5be4dc){while(--_0x5be4dc){_0x414b18['push'](_0x414b18['shift']());}};_0x88d2d2(++_0x52bfdf);}(_0x9e58,0x99));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x89e5('0x0'));var Redis=require('ioredis');var config=require(_0x89e5('0x1'));var logger=require(_0x89e5('0x2'))(_0x89e5('0x3'));config['redis']=_['defaults'](config[_0x89e5('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x89e5('0x5'))(new Redis(config[_0x89e5('0x4')]));var EmailImap=require(_0x89e5('0x6'));var EmailSmtp=require(_0x89e5('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x279e89){logger['info'](_0x89e5('0x8'));this[_0x89e5('0x9')]=_0x279e89['mailAccounts'];this[_0x89e5('0xa')]={};this[_0x89e5('0xb')]=new EmailSmtp();}EmailChannel[_0x89e5('0xc')][_0x89e5('0xd')]=function(_0xd4741f){var _0xf04180=this[_0x89e5('0x9')][_0xd4741f];var _0x1464c0={'id':_0xf04180['id'],'name':_0xf04180[_0x89e5('0xe')],'key':_0xf04180[_0x89e5('0xf')],'active':_0xf04180[_0x89e5('0x10')],'Imap':{'status':_0xf04180[_0x89e5('0x11')][_0x89e5('0x12')],'messageStatus':_0xf04180['Imap'][_0x89e5('0x13')],'total':_0xf04180[_0x89e5('0x11')][_0x89e5('0x14')]}};if(_[_0x89e5('0x15')](md5Accounts[_0xd4741f])){md5Accounts[_0xd4741f]={};}var _0x53a0d8=md5(JSON[_0x89e5('0x16')](_0x1464c0));if(md5Accounts[_0xd4741f]['md5']!==_0x53a0d8){md5Accounts[_0xd4741f][_0x89e5('0x0')]=_0x53a0d8;io['emit']('mailAccount:update',_0x1464c0);}};EmailChannel['prototype'][_0x89e5('0x17')]=function(_0x5ee88b){for(var _0x1373ac in _0x5ee88b){if(_0x5ee88b[_0x89e5('0x18')](_0x1373ac)){if(_0x5ee88b[_0x1373ac][_0x89e5('0x11')]&&_0x5ee88b[_0x1373ac]['active']){var _0x27e9df=_0x5ee88b[_0x1373ac]['Imap'];if(!_0x27e9df[_0x89e5('0x19')]&&_0x5ee88b[_0x1373ac][_0x89e5('0x1a')]!=='custom')_0x27e9df['service']=_0x5ee88b[_0x1373ac]['provider'];if(!this['imapAccounts']['hasOwnProperty'](_0x27e9df['id'])){this[_0x89e5('0xa')][_0x27e9df['id']]=new EmailImap(_0x27e9df,_0x5ee88b[_0x1373ac]['email']);this[_0x89e5('0xa')][_0x27e9df['id']]['on'](_0x89e5('0x1b'),this[_0x89e5('0x1c')][_0x89e5('0x1d')](this,_0x1373ac));this[_0x89e5('0xa')][_0x27e9df['id']]['on'](_0x89e5('0x3'),this[_0x89e5('0x1e')]['bind'](this,_0x1373ac));this[_0x89e5('0xa')][_0x27e9df['id']]['on'](_0x89e5('0x1f'),this[_0x89e5('0x20')]['bind'](this,_0x1373ac));this[_0x89e5('0xa')][_0x27e9df['id']]['on'](_0x89e5('0x21'),this[_0x89e5('0x22')][_0x89e5('0x1d')](this,_0x1373ac));}}else{if(_[_0x89e5('0x15')](this['mailAccounts'][_0x1373ac]['Imap'])){this[_0x89e5('0x9')][_0x1373ac][_0x89e5('0x11')]={};}this[_0x89e5('0x9')][_0x1373ac][_0x89e5('0x11')]['status']='disabled';this[_0x89e5('0x9')][_0x1373ac][_0x89e5('0x11')][_0x89e5('0x13')]='';this['emit'](_0x1373ac);}}}};EmailChannel[_0x89e5('0xc')][_0x89e5('0x1c')]=function(_0x2d544b,_0x43b986){if(this[_0x89e5('0x9')][_0x2d544b]){this[_0x89e5('0x9')][_0x2d544b][_0x89e5('0x11')][_0x89e5('0x12')]=_0x89e5('0x23');this['mailAccounts'][_0x2d544b][_0x89e5('0x11')]['messageStatus']=_0x43b986['name'];if(_0x43b986[_0x89e5('0x24')]){this[_0x89e5('0x9')][_0x2d544b]['Imap'][_0x89e5('0x14')]=_0x43b986[_0x89e5('0x24')]['total'];}return this['emit'](_0x2d544b);}};EmailChannel[_0x89e5('0xc')]['handleImapEmail']=function(_0x2bcb48,_0xb8e9a0){logger[_0x89e5('0x25')](_0x89e5('0x26'),_0xb8e9a0['firstName'],_0xb8e9a0['lastName'],_0xb8e9a0[_0x89e5('0x27')],_0x2bcb48);if(this[_0x89e5('0x9')][_0x2bcb48]){return mailAccount[_0x89e5('0x28')](_0x2bcb48,_0xb8e9a0)[_0x89e5('0x29')](function(_0x52d9ee){if(_0x52d9ee){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x89e5('0x2a')](function(_0x7bf8a){logger[_0x89e5('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x89e5('0x16')](_0x7bf8a));});}};EmailChannel[_0x89e5('0xc')][_0x89e5('0x20')]=function(_0x5402c2){if(this['mailAccounts'][_0x5402c2]&&this[_0x89e5('0x9')][_0x5402c2][_0x89e5('0x11')]){if(this[_0x89e5('0xa')][this['mailAccounts'][_0x5402c2]['Imap']['id']]){delete this[_0x89e5('0xa')][this[_0x89e5('0x9')][_0x5402c2]['Imap']['id']];}this[_0x89e5('0x9')][_0x5402c2][_0x89e5('0x11')][_0x89e5('0x2b')]=moment();this[_0x89e5('0xd')](_0x5402c2);}};EmailChannel['prototype'][_0x89e5('0x22')]=function(_0x1b36b6,_0x4f4c6d){if(this[_0x89e5('0x9')][_0x1b36b6]){this['mailAccounts'][_0x1b36b6][_0x89e5('0x11')][_0x89e5('0x12')]='error';this['mailAccounts'][_0x1b36b6][_0x89e5('0x11')][_0x89e5('0x13')]=_0x4f4c6d;return this['emit'](_0x1b36b6);}};EmailChannel[_0x89e5('0xc')][_0x89e5('0x2c')]=function(_0x6a1747,_0x5355c9){return this[_0x89e5('0xb')][_0x89e5('0x2d')](_0x6a1747,_0x5355c9);};EmailChannel[_0x89e5('0xc')][_0x89e5('0x2e')]=function(_0x1c7884){var _0x60c6ca=this;if(this[_0x89e5('0x9')][_0x1c7884['id']]){if(_[_0x89e5('0x15')](this[_0x89e5('0x9')][_0x1c7884['id']][_0x89e5('0x2f')])){this[_0x89e5('0x9')][_0x1c7884['id']][_0x89e5('0x2f')]={};}this['mailAccounts'][_0x1c7884['id']]['Smtp'][_0x89e5('0x2b')]=moment();return new BPromise(function(_0x5d9afe,_0x15b13e){return _0x60c6ca['smtp'][_0x89e5('0x30')](_0x1c7884)[_0x89e5('0x29')](function(_0x2c2021){_0x60c6ca[_0x89e5('0x9')][_0x1c7884['id']][_0x89e5('0x2f')][_0x89e5('0x12')]=_0x89e5('0x31');_0x60c6ca[_0x89e5('0x9')][_0x1c7884['id']]['Smtp'][_0x89e5('0x13')]='';_0x60c6ca[_0x89e5('0xd')](_0x1c7884['id']);_0x5d9afe(_0x2c2021);})[_0x89e5('0x2a')](function(_0x2488f9){_0x60c6ca[_0x89e5('0x9')][_0x1c7884['id']][_0x89e5('0x2f')][_0x89e5('0x12')]='error';_0x60c6ca[_0x89e5('0x9')][_0x1c7884['id']][_0x89e5('0x2f')][_0x89e5('0x13')]=_0x2488f9;_0x60c6ca[_0x89e5('0xd')](_0x1c7884['id']);_0x15b13e(_0x2488f9);});});}return this[_0x89e5('0xb')]['verify'](_0x1c7884);};module[_0x89e5('0x32')]=EmailChannel; \ No newline at end of file +var _0xd0b7=['Imap','status','total','stringify','emit','refresh','hasOwnProperty','service','provider','custom','handleImapBox','handleImapEmail','handleImapEnd','bind','error','isNil','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','handleImapError','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','../../../config/environment','email','defaults','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','name','key','active'];(function(_0x572ef2,_0x5c1281){var _0x3f74d6=function(_0x36e76c){while(--_0x36e76c){_0x572ef2['push'](_0x572ef2['shift']());}};_0x3f74d6(++_0x5c1281);}(_0xd0b7,0x83));var _0x7d0b=function(_0x58c2da,_0x595558){_0x58c2da=_0x58c2da-0x0;var _0x2ad118=_0xd0b7[_0x58c2da];return _0x2ad118;};'use strict';var _=require(_0x7d0b('0x0'));var moment=require('moment');var BPromise=require(_0x7d0b('0x1'));var md5=require(_0x7d0b('0x2'));var Redis=require('ioredis');var config=require(_0x7d0b('0x3'));var logger=require('../../../config/logger')(_0x7d0b('0x4'));config['redis']=_[_0x7d0b('0x5')](config[_0x7d0b('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7d0b('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x7d0b('0x8'));var EmailSmtp=require(_0x7d0b('0x9'));var mailAccount=require(_0x7d0b('0xa'));var md5Accounts={};function EmailChannel(_0x35552f){logger[_0x7d0b('0xb')]('start\x20email\x20channel');this[_0x7d0b('0xc')]=_0x35552f[_0x7d0b('0xc')];this[_0x7d0b('0xd')]={};this[_0x7d0b('0xe')]=new EmailSmtp();}EmailChannel[_0x7d0b('0xf')]['emit']=function(_0x378c1f){var _0x3696be=this[_0x7d0b('0xc')][_0x378c1f];var _0x3edfd1={'id':_0x3696be['id'],'name':_0x3696be[_0x7d0b('0x10')],'key':_0x3696be[_0x7d0b('0x11')],'active':_0x3696be[_0x7d0b('0x12')],'Imap':{'status':_0x3696be[_0x7d0b('0x13')][_0x7d0b('0x14')],'messageStatus':_0x3696be['Imap']['messageStatus'],'total':_0x3696be[_0x7d0b('0x13')][_0x7d0b('0x15')]}};if(_['isNil'](md5Accounts[_0x378c1f])){md5Accounts[_0x378c1f]={};}var _0x3e6a9d=md5(JSON[_0x7d0b('0x16')](_0x3edfd1));if(md5Accounts[_0x378c1f][_0x7d0b('0x2')]!==_0x3e6a9d){md5Accounts[_0x378c1f][_0x7d0b('0x2')]=_0x3e6a9d;io[_0x7d0b('0x17')]('mailAccount:update',_0x3edfd1);}};EmailChannel['prototype'][_0x7d0b('0x18')]=function(_0x17bb01){for(var _0x16183e in _0x17bb01){if(_0x17bb01[_0x7d0b('0x19')](_0x16183e)){if(_0x17bb01[_0x16183e][_0x7d0b('0x13')]&&_0x17bb01[_0x16183e][_0x7d0b('0x12')]){var _0x404e7d=_0x17bb01[_0x16183e][_0x7d0b('0x13')];if(!_0x404e7d[_0x7d0b('0x1a')]&&_0x17bb01[_0x16183e][_0x7d0b('0x1b')]!==_0x7d0b('0x1c'))_0x404e7d[_0x7d0b('0x1a')]=_0x17bb01[_0x16183e]['provider'];if(!this[_0x7d0b('0xd')][_0x7d0b('0x19')](_0x404e7d['id'])){this[_0x7d0b('0xd')][_0x404e7d['id']]=new EmailImap(_0x404e7d,_0x17bb01[_0x16183e][_0x7d0b('0x4')]);this['imapAccounts'][_0x404e7d['id']]['on']('box',this[_0x7d0b('0x1d')]['bind'](this,_0x16183e));this[_0x7d0b('0xd')][_0x404e7d['id']]['on'](_0x7d0b('0x4'),this[_0x7d0b('0x1e')]['bind'](this,_0x16183e));this[_0x7d0b('0xd')][_0x404e7d['id']]['on']('end',this[_0x7d0b('0x1f')][_0x7d0b('0x20')](this,_0x16183e));this['imapAccounts'][_0x404e7d['id']]['on'](_0x7d0b('0x21'),this['handleImapError'][_0x7d0b('0x20')](this,_0x16183e));}}else{if(_[_0x7d0b('0x22')](this['mailAccounts'][_0x16183e]['Imap'])){this[_0x7d0b('0xc')][_0x16183e]['Imap']={};}this[_0x7d0b('0xc')][_0x16183e]['Imap'][_0x7d0b('0x14')]='disabled';this['mailAccounts'][_0x16183e][_0x7d0b('0x13')][_0x7d0b('0x23')]='';this[_0x7d0b('0x17')](_0x16183e);}}}};EmailChannel[_0x7d0b('0xf')]['handleImapBox']=function(_0x143067,_0xc1efff){if(this[_0x7d0b('0xc')][_0x143067]){this[_0x7d0b('0xc')][_0x143067][_0x7d0b('0x13')][_0x7d0b('0x14')]='connected';this[_0x7d0b('0xc')][_0x143067][_0x7d0b('0x13')]['messageStatus']=_0xc1efff[_0x7d0b('0x10')];if(_0xc1efff[_0x7d0b('0x24')]){this[_0x7d0b('0xc')][_0x143067][_0x7d0b('0x13')][_0x7d0b('0x15')]=_0xc1efff['messages'][_0x7d0b('0x15')];}return this['emit'](_0x143067);}};EmailChannel[_0x7d0b('0xf')][_0x7d0b('0x1e')]=function(_0x1c7a30,_0x25dd59){logger[_0x7d0b('0xb')](_0x7d0b('0x25'),_0x25dd59[_0x7d0b('0x26')],_0x25dd59[_0x7d0b('0x27')],_0x25dd59['from'],_0x1c7a30);if(this['mailAccounts'][_0x1c7a30]){return mailAccount['notify'](_0x1c7a30,_0x25dd59)[_0x7d0b('0x28')](function(_0x37ebd9){if(_0x37ebd9){logger[_0x7d0b('0xb')](_0x7d0b('0x29'));}})[_0x7d0b('0x2a')](function(_0x101df3){logger[_0x7d0b('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x7d0b('0x16')](_0x101df3));});}};EmailChannel[_0x7d0b('0xf')][_0x7d0b('0x1f')]=function(_0x2d4439){if(this[_0x7d0b('0xc')][_0x2d4439]&&this['mailAccounts'][_0x2d4439]['Imap']){if(this[_0x7d0b('0xd')][this[_0x7d0b('0xc')][_0x2d4439][_0x7d0b('0x13')]['id']]){delete this[_0x7d0b('0xd')][this['mailAccounts'][_0x2d4439][_0x7d0b('0x13')]['id']];}this[_0x7d0b('0xc')][_0x2d4439][_0x7d0b('0x13')][_0x7d0b('0x2b')]=moment();this[_0x7d0b('0x17')](_0x2d4439);}};EmailChannel[_0x7d0b('0xf')][_0x7d0b('0x2c')]=function(_0x3ef025,_0x5dc6b1){if(this['mailAccounts'][_0x3ef025]){this['mailAccounts'][_0x3ef025][_0x7d0b('0x13')][_0x7d0b('0x14')]=_0x7d0b('0x21');this[_0x7d0b('0xc')][_0x3ef025][_0x7d0b('0x13')][_0x7d0b('0x23')]=_0x5dc6b1;return this[_0x7d0b('0x17')](_0x3ef025);}};EmailChannel[_0x7d0b('0xf')]['sendMail']=function(_0x35ce99,_0x40099f){return this['smtp'][_0x7d0b('0x2d')](_0x35ce99,_0x40099f);};EmailChannel[_0x7d0b('0xf')][_0x7d0b('0x2e')]=function(_0x337735){var _0x400a30=this;if(this[_0x7d0b('0xc')][_0x337735['id']]){if(_[_0x7d0b('0x22')](this[_0x7d0b('0xc')][_0x337735['id']]['Smtp'])){this[_0x7d0b('0xc')][_0x337735['id']][_0x7d0b('0x2f')]={};}this[_0x7d0b('0xc')][_0x337735['id']][_0x7d0b('0x2f')][_0x7d0b('0x2b')]=moment();return new BPromise(function(_0x318eae,_0x58ff7b){return _0x400a30[_0x7d0b('0xe')][_0x7d0b('0x30')](_0x337735)[_0x7d0b('0x28')](function(_0x488e2e){_0x400a30[_0x7d0b('0xc')][_0x337735['id']]['Smtp'][_0x7d0b('0x14')]=_0x7d0b('0x31');_0x400a30[_0x7d0b('0xc')][_0x337735['id']]['Smtp'][_0x7d0b('0x23')]='';_0x400a30[_0x7d0b('0x17')](_0x337735['id']);_0x318eae(_0x488e2e);})['catch'](function(_0x40a779){_0x400a30['mailAccounts'][_0x337735['id']]['Smtp'][_0x7d0b('0x14')]='error';_0x400a30['mailAccounts'][_0x337735['id']][_0x7d0b('0x2f')][_0x7d0b('0x23')]=_0x40a779;_0x400a30['emit'](_0x337735['id']);_0x58ff7b(_0x40a779);});});}return this[_0x7d0b('0xe')][_0x7d0b('0x30')](_0x337735);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b54bd35..496b381 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 _0x8119=['length','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','handleFetchError','handleEnd','stringify','textCode','upperFirst','lodash','util','imap','iconv','EventEmitter','email','mailbox','account','getAccount','once','handleReady','bind','end','error','handleError','inherits','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','prototype','handleOpenBox','emit','box','handleCloseBox','search','UNSEEN','handleReadUnseen'];(function(_0x3bacba,_0x262eaf){var _0x4cdb4c=function(_0x357846){while(--_0x357846){_0x3bacba['push'](_0x3bacba['shift']());}};_0x4cdb4c(++_0x262eaf);}(_0x8119,0xbe));var _0x9811=function(_0x348e31,_0x5713f4){_0x348e31=_0x348e31-0x0;var _0xd3fd8e=_0x8119[_0x348e31];return _0xd3fd8e;};'use strict';var _=require(_0x9811('0x0'));var util=require(_0x9811('0x1'));var Imap=require(_0x9811('0x2'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x9811('0x3'))['Iconv'];var EventEmitter=require('events')[_0x9811('0x4')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x9811('0x5'));function EmailImap(_0x1451f2,_0x38f896){this[_0x9811('0x6')]=_0x1451f2['mailbox'];this[_0x9811('0x7')]=this[_0x9811('0x8')](_0x1451f2,_0x38f896);this[_0x9811('0x2')]=new Imap(this[_0x9811('0x7')]);this[_0x9811('0x2')][_0x9811('0x9')]('ready',this[_0x9811('0xa')][_0x9811('0xb')](this));this[_0x9811('0x2')][_0x9811('0x9')](_0x9811('0xc'),this['handleEnd'][_0x9811('0xb')](this));this[_0x9811('0x2')]['on'](_0x9811('0xd'),this[_0x9811('0xe')][_0x9811('0xb')](this));this[_0x9811('0x2')]['connect']();}util[_0x9811('0xf')](EmailImap,EventEmitter);EmailImap['prototype'][_0x9811('0x8')]=function(_0xd7c1c6,_0x2614b1){var _0x386b37={'connTimeout':_0xd7c1c6[_0x9811('0x10')]?_0xd7c1c6[_0x9811('0x10')]*0x3e8:0x2710,'authTimeout':_0xd7c1c6[_0x9811('0x11')]?_0xd7c1c6[_0x9811('0x11')]*0x3e8:0x1388};if(_0xd7c1c6[_0x9811('0x12')]){_0x386b37['user']=_0xd7c1c6[_0x9811('0x13')];if(_0xd7c1c6[_0x9811('0x14')]){_0x386b37[_0x9811('0x15')]=utils[_0x9811('0x16')](_0xd7c1c6[_0x9811('0x17')][_0x9811('0x18')],_0xd7c1c6['user']);}else{_0x386b37[_0x9811('0x19')]=_0xd7c1c6[_0x9811('0x19')];}}else{if(_0xd7c1c6[_0x9811('0x1a')]){_0x386b37[_0x9811('0x13')]=_0xd7c1c6['user'];_0x386b37[_0x9811('0x19')]=_0xd7c1c6['password'];}}_0x386b37[_0x9811('0x5')]=_0x2614b1||_0xd7c1c6['user']||_0x9811('0x1b');_0x386b37[_0x9811('0x1c')]=_0xd7c1c6[_0x9811('0x1c')];_0x386b37[_0x9811('0x1d')]=_0xd7c1c6[_0x9811('0x1d')]||0x3e1;if(_0xd7c1c6['tls']){_0x386b37[_0x9811('0x1e')]=!![];}else{_0x386b37['tls']=![];_0x386b37[_0x9811('0x1f')]=_0x9811('0x20');}return _0x386b37;};EmailImap['prototype']['handleReady']=function(){this[_0x9811('0x2')][_0x9811('0x21')](this[_0x9811('0x6')],![],this['handleOpenBox'][_0x9811('0xb')](this));};EmailImap[_0x9811('0x22')][_0x9811('0x23')]=function(_0x2782cd,_0x1857af){if(_0x2782cd){this['handleError'](_0x2782cd,!![]);}else{this[_0x9811('0x24')](_0x9811('0x25'),_0x1857af);this['readUnseen']();}};EmailImap[_0x9811('0x22')][_0x9811('0x26')]=function(_0x3dcd53){if(_0x3dcd53){this[_0x9811('0xe')](_0x3dcd53,!![]);}else{this['imap']['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x9811('0x2')][_0x9811('0x27')]([_0x9811('0x28')],this[_0x9811('0x29')]['bind'](this));};EmailImap[_0x9811('0x22')][_0x9811('0x29')]=function(_0x86ed8f,_0x24c822){if(_0x86ed8f){this[_0x9811('0xe')](_0x86ed8f,!![]);}else{if(_0x24c822[_0x9811('0x2a')]){try{var _0x4eff84=this[_0x9811('0x2')]['fetch'](_0x24c822,{'bodies':'','markSeen':!![]});_0x4eff84['on'](_0x9811('0x2b'),this[_0x9811('0x2c')][_0x9811('0xb')](this));_0x4eff84[_0x9811('0x9')](_0x9811('0xd'),this['handleFetchError'][_0x9811('0xb')](this));_0x4eff84['once'](_0x9811('0xc'),this[_0x9811('0x2d')]['bind'](this));}catch(_0x5c30a5){logger['error'](_0x5c30a5);}}else{this[_0x9811('0x2')][_0x9811('0x2e')](!![],this[_0x9811('0x26')][_0x9811('0xb')](this));}}};EmailImap[_0x9811('0x22')][_0x9811('0x2c')]=function(_0x117304){_0x117304['on'](_0x9811('0x2f'),this[_0x9811('0x30')][_0x9811('0xb')](this));_0x117304[_0x9811('0x9')](_0x9811('0x31'),this[_0x9811('0x32')]['bind'](this));_0x117304[_0x9811('0x9')]('end',this[_0x9811('0x33')][_0x9811('0xb')](this));};EmailImap[_0x9811('0x22')][_0x9811('0x30')]=function(_0x12eaa4){simpleParser(_0x12eaa4,{'Iconv':Iconv},this['handleSimpleParser'][_0x9811('0xb')](this));};EmailImap['prototype'][_0x9811('0x32')]=function(){};EmailImap[_0x9811('0x22')][_0x9811('0x33')]=function(){};EmailImap[_0x9811('0x22')]['handleSimpleParser']=function(_0x4521ed,_0xd725e8){if(_0x4521ed){logger[_0x9811('0xd')](_0x4521ed);}else{var _0x3ff5f5=this;utils[_0x9811('0x34')](this[_0x9811('0x7')],_0xd725e8,function(_0x3fcfc1){_0x3ff5f5[_0x9811('0x24')](_0x9811('0x5'),_0x3fcfc1);});}};EmailImap[_0x9811('0x22')][_0x9811('0x2d')]=function(){this[_0x9811('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x9811('0x22')][_0x9811('0x35')]=function(_0x3b7669){this[_0x9811('0xe')](_0x3b7669);this['imap'][_0x9811('0x2e')](!![],this[_0x9811('0x26')][_0x9811('0xb')](this));};EmailImap['prototype'][_0x9811('0x36')]=function(){this['emit'](_0x9811('0xc'));};EmailImap['prototype'][_0x9811('0xe')]=function(_0x56bc0f,_0x3c57f0){logger[_0x9811('0xd')](_0x9811('0xe'),this[_0x9811('0x7')][_0x9811('0x5')],JSON[_0x9811('0x37')](_0x56bc0f));var _0x3ea6d6='';if(_0x56bc0f){if(_0x56bc0f[_0x9811('0x38')]){_0x3ea6d6=_0x56bc0f[_0x9811('0x38')];}else{for(var _0x1a0b47 in _0x56bc0f){if(_0x56bc0f['hasOwnProperty'](_0x1a0b47)){_0x3ea6d6+=_[_0x9811('0x39')](_0x1a0b47)+':\x20'+_0x56bc0f[_0x1a0b47]+'\x0a';}}}}if(_0x3c57f0){this[_0x9811('0x2')]['end']();}else{this[_0x9811('0x24')]('error',_0x3ea6d6);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x45ea=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleCloseBox','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd'];(function(_0x154f42,_0x4ab271){var _0x2157aa=function(_0x17a0ff){while(--_0x17a0ff){_0x154f42['push'](_0x154f42['shift']());}};_0x2157aa(++_0x4ab271);}(_0x45ea,0x160));var _0xa45e=function(_0x5c017e,_0x4b6eda){_0x5c017e=_0x5c017e-0x0;var _0x351ffa=_0x45ea[_0x5c017e];return _0x351ffa;};'use strict';var _=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var Imap=require(_0xa45e('0x2'));var simpleParser=require(_0xa45e('0x3'))[_0xa45e('0x4')];var Iconv=require(_0xa45e('0x5'))[_0xa45e('0x6')];var EventEmitter=require('events')[_0xa45e('0x7')];var utils=require(_0xa45e('0x8'));var logger=require(_0xa45e('0x9'))(_0xa45e('0xa'));function EmailImap(_0x1d5bce,_0x47ba89){this[_0xa45e('0xb')]=_0x1d5bce[_0xa45e('0xb')];this[_0xa45e('0xc')]=this[_0xa45e('0xd')](_0x1d5bce,_0x47ba89);this['imap']=new Imap(this[_0xa45e('0xc')]);this[_0xa45e('0x2')][_0xa45e('0xe')](_0xa45e('0xf'),this[_0xa45e('0x10')][_0xa45e('0x11')](this));this[_0xa45e('0x2')][_0xa45e('0xe')](_0xa45e('0x12'),this[_0xa45e('0x13')][_0xa45e('0x11')](this));this[_0xa45e('0x2')]['on'](_0xa45e('0x14'),this[_0xa45e('0x15')]['bind'](this));this[_0xa45e('0x2')][_0xa45e('0x16')]();}util[_0xa45e('0x17')](EmailImap,EventEmitter);EmailImap[_0xa45e('0x18')][_0xa45e('0xd')]=function(_0x1ae6b7,_0x5d118e){var _0x27344b={'connTimeout':_0x1ae6b7[_0xa45e('0x19')]?_0x1ae6b7[_0xa45e('0x19')]*0x3e8:0x2710,'authTimeout':_0x1ae6b7[_0xa45e('0x1a')]?_0x1ae6b7['authTimeout']*0x3e8:0x1388};if(_0x1ae6b7['service']){_0x27344b[_0xa45e('0x1b')]=_0x1ae6b7[_0xa45e('0x1b')];if(_0x1ae6b7['modernAuthentication']){_0x27344b[_0xa45e('0x1c')]=utils[_0xa45e('0x1d')](_0x1ae6b7[_0xa45e('0x1e')][_0xa45e('0x1f')],_0x1ae6b7[_0xa45e('0x1b')]);}else{_0x27344b[_0xa45e('0x20')]=_0x1ae6b7[_0xa45e('0x20')];}}else{if(_0x1ae6b7[_0xa45e('0x21')]){_0x27344b[_0xa45e('0x1b')]=_0x1ae6b7[_0xa45e('0x1b')];_0x27344b[_0xa45e('0x20')]=_0x1ae6b7[_0xa45e('0x20')];}}_0x27344b[_0xa45e('0xa')]=_0x5d118e||_0x1ae6b7['user']||'anonymous@xcally.com';_0x27344b[_0xa45e('0x22')]=_0x1ae6b7[_0xa45e('0x22')];_0x27344b[_0xa45e('0x23')]=_0x1ae6b7[_0xa45e('0x23')]||0x3e1;if(_0x1ae6b7[_0xa45e('0x24')]){_0x27344b[_0xa45e('0x24')]=!![];}else{_0x27344b[_0xa45e('0x24')]=![];_0x27344b[_0xa45e('0x25')]=_0xa45e('0x26');}return _0x27344b;};EmailImap['prototype'][_0xa45e('0x10')]=function(){this[_0xa45e('0x2')]['openBox'](this[_0xa45e('0xb')],![],this[_0xa45e('0x27')][_0xa45e('0x11')](this));};EmailImap[_0xa45e('0x18')][_0xa45e('0x27')]=function(_0xc8206c,_0xc4fb5e){if(_0xc8206c){this[_0xa45e('0x15')](_0xc8206c,!![]);}else{this[_0xa45e('0x28')](_0xa45e('0x29'),_0xc4fb5e);this[_0xa45e('0x2a')]();}};EmailImap[_0xa45e('0x18')]['handleCloseBox']=function(_0x1a7f33){if(_0x1a7f33){this[_0xa45e('0x15')](_0x1a7f33,!![]);}else{this[_0xa45e('0x2')][_0xa45e('0x12')]();}};EmailImap['prototype'][_0xa45e('0x2a')]=function(){this[_0xa45e('0x2')][_0xa45e('0x2b')]([_0xa45e('0x2c')],this[_0xa45e('0x2d')][_0xa45e('0x11')](this));};EmailImap[_0xa45e('0x18')]['handleReadUnseen']=function(_0x2b300f,_0x28c4e3){if(_0x2b300f){this[_0xa45e('0x15')](_0x2b300f,!![]);}else{if(_0x28c4e3['length']){try{var _0x3bf9ff=this['imap'][_0xa45e('0x2e')](_0x28c4e3,{'bodies':'','markSeen':!![]});_0x3bf9ff['on'](_0xa45e('0x2f'),this[_0xa45e('0x30')][_0xa45e('0x11')](this));_0x3bf9ff['once'](_0xa45e('0x14'),this[_0xa45e('0x31')]['bind'](this));_0x3bf9ff[_0xa45e('0xe')](_0xa45e('0x12'),this[_0xa45e('0x32')]['bind'](this));}catch(_0x33d576){logger[_0xa45e('0x14')](_0x33d576);}}else{this[_0xa45e('0x2')][_0xa45e('0x33')](!![],this['handleCloseBox'][_0xa45e('0x11')](this));}}};EmailImap[_0xa45e('0x18')][_0xa45e('0x30')]=function(_0x2fb593){_0x2fb593['on']('body',this[_0xa45e('0x34')][_0xa45e('0x11')](this));_0x2fb593[_0xa45e('0xe')](_0xa45e('0x35'),this[_0xa45e('0x36')]['bind'](this));_0x2fb593['once'](_0xa45e('0x12'),this[_0xa45e('0x37')][_0xa45e('0x11')](this));};EmailImap[_0xa45e('0x18')]['handleMessageBody']=function(_0x5f39dd){simpleParser(_0x5f39dd,{'Iconv':Iconv},this[_0xa45e('0x38')][_0xa45e('0x11')](this));};EmailImap[_0xa45e('0x18')][_0xa45e('0x36')]=function(){};EmailImap[_0xa45e('0x18')][_0xa45e('0x37')]=function(){};EmailImap[_0xa45e('0x18')]['handleSimpleParser']=function(_0x5b5032,_0x5ad390){if(_0x5b5032){logger[_0xa45e('0x14')](_0x5b5032);}else{var _0x56973b=this;utils[_0xa45e('0x39')](this[_0xa45e('0xc')],_0x5ad390,function(_0x2fef74){_0x56973b['emit'](_0xa45e('0xa'),_0x2fef74);});}};EmailImap[_0xa45e('0x18')][_0xa45e('0x32')]=function(){this[_0xa45e('0x2')][_0xa45e('0x33')](!![],this[_0xa45e('0x3a')][_0xa45e('0x11')](this));};EmailImap[_0xa45e('0x18')][_0xa45e('0x31')]=function(_0x1fa344){this[_0xa45e('0x15')](_0x1fa344);this[_0xa45e('0x2')]['closeBox'](!![],this[_0xa45e('0x3a')][_0xa45e('0x11')](this));};EmailImap['prototype'][_0xa45e('0x13')]=function(){this[_0xa45e('0x28')]('end');};EmailImap[_0xa45e('0x18')][_0xa45e('0x15')]=function(_0x5b5f69,_0x1b4fac){logger[_0xa45e('0x14')]('handleError',this[_0xa45e('0xc')][_0xa45e('0xa')],JSON['stringify'](_0x5b5f69));var _0x15463b='';if(_0x5b5f69){if(_0x5b5f69[_0xa45e('0x3b')]){_0x15463b=_0x5b5f69[_0xa45e('0x3b')];}else{for(var _0x568fe6 in _0x5b5f69){if(_0x5b5f69[_0xa45e('0x3c')](_0x568fe6)){_0x15463b+=_[_0xa45e('0x3d')](_0x568fe6)+':\x20'+_0x5b5f69[_0x568fe6]+'\x0a';}}}}if(_0x1b4fac){this['imap']['end']();}else{this['emit'](_0xa45e('0x14'),_0x15463b);this[_0xa45e('0x28')](_0xa45e('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 472ae6d..3da2b35 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 _0xe8be=['compile','sendMail','toString','Not\x20verifired','exports','nodemailer','prototype','send','createTransport'];(function(_0x52b7bd,_0x149c0d){var _0x4cdb98=function(_0xaf8294){while(--_0xaf8294){_0x52b7bd['push'](_0x52b7bd['shift']());}};_0x4cdb98(++_0x149c0d);}(_0xe8be,0xc2));var _0xee8b=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xe8be[_0x1fd675];return _0x16b554;};'use strict';var nodemailer=require(_0xee8b('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xee8b('0x1')][_0xee8b('0x2')]=function(_0x527c84,_0x42c130){return new Promise(function(_0x1ece06,_0x7ded87){var _0x3f27a3=nodemailer[_0xee8b('0x3')](_0x527c84);_0x3f27a3['use'](_0xee8b('0x4'),inlineBase64());_0x3f27a3[_0xee8b('0x5')](_0x42c130,function(_0x5a7a94,_0x12652f){if(_0x5a7a94){_0x7ded87(_0x5a7a94[_0xee8b('0x6')]());}else{_0x1ece06(_0x12652f);}});});};EmailSmtp['prototype']['verify']=function(_0x508a6a){return new Promise(function(_0xba3cd6,_0x2795b2){var _0x6c07dc=nodemailer[_0xee8b('0x3')](_0x508a6a);_0x6c07dc['verify'](function(_0x51d5ee,_0x3ad1b0){if(_0x51d5ee){_0x2795b2(_0x51d5ee['toString']());}else{if(_0x3ad1b0){_0xba3cd6(_0x3ad1b0);}else{_0x2795b2(_0xee8b('0x7'));}}});});};module[_0xee8b('0x8')]=EmailSmtp; \ No newline at end of file +var _0xbd7a=['send','createTransport','use','sendMail','toString','verify','exports','nodemailer','prototype'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0xbd7a,0x181));var _0xabd7=function(_0x464251,_0x41951f){_0x464251=_0x464251-0x0;var _0x47b041=_0xbd7a[_0x464251];return _0x47b041;};'use strict';var nodemailer=require(_0xabd7('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xabd7('0x1')][_0xabd7('0x2')]=function(_0x305a6,_0x1f6166){return new Promise(function(_0x170310,_0x12041c){var _0x4219b1=nodemailer[_0xabd7('0x3')](_0x305a6);_0x4219b1[_0xabd7('0x4')]('compile',inlineBase64());_0x4219b1[_0xabd7('0x5')](_0x1f6166,function(_0x3d6848,_0x52b953){if(_0x3d6848){_0x12041c(_0x3d6848[_0xabd7('0x6')]());}else{_0x170310(_0x52b953);}});});};EmailSmtp[_0xabd7('0x1')][_0xabd7('0x7')]=function(_0x4e1ae8){return new Promise(function(_0x15d7a0,_0x270e78){var _0x4e431a=nodemailer[_0xabd7('0x3')](_0x4e1ae8);_0x4e431a['verify'](function(_0x447d76,_0x2dec6e){if(_0x447d76){_0x270e78(_0x447d76[_0xabd7('0x6')]());}else{if(_0x2dec6e){_0x15d7a0(_0x2dec6e);}else{_0x270e78('Not\x20verifired');}}});});};module[_0xabd7('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 3de45b9..b2f35f7 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 _0xc896=['auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','util','../../../config/logger','email','../../../config/environment','head','value','address','generate','name','substring','indexOf','length','slice','join','pop','anonymous','@xcally.com','test','html','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user='];(function(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0xc896,0x123));var _0x6c89=function(_0x214c7e,_0x3d3093){_0x214c7e=_0x214c7e-0x0;var _0x226d54=_0xc896[_0x214c7e];return _0x226d54;};'use strict';var _=require(_0x6c89('0x0'));var moment=require(_0x6c89('0x1'));var random=require(_0x6c89('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x6c89('0x3'));var tnef=require('node-tnef');var logger=require(_0x6c89('0x4'))(_0x6c89('0x5'));var config=require(_0x6c89('0x6'));function getAddress(_0x4e19ef){var _0x29d334=_[_0x6c89('0x7')](_0x4e19ef[_0x6c89('0x8')]);return _0x29d334&&_0x29d334[_0x6c89('0x9')]?_0x29d334[_0x6c89('0x9')]:'anonymous'+random[_0x6c89('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x37a22f){var _0x220573=_[_0x6c89('0x7')](_0x37a22f[_0x6c89('0x8')]);if(_0x220573&&_0x220573[_0x6c89('0xb')]){if(_0x220573[_0x6c89('0xb')]==_0x220573[_0x6c89('0x9')]){return _0x220573[_0x6c89('0xb')][_0x6c89('0xc')](0x0,_0x220573[_0x6c89('0xb')][_0x6c89('0xd')]('@'));}var _0x4a2e17=_0x220573[_0x6c89('0xb')]['split'](/\s+/);return _0x4a2e17[_0x6c89('0xe')]>0x1?_0x4a2e17[_0x6c89('0xf')](0x0,-0x1)[_0x6c89('0x10')]('\x20'):_0x220573[_0x6c89('0xb')];}return'Anonymous';}function getLastName(_0x4670e9){var _0x5a0683=_[_0x6c89('0x7')](_0x4670e9[_0x6c89('0x8')]);if(_0x5a0683&&_0x5a0683[_0x6c89('0xb')]){var _0x53bc4b=_0x5a0683[_0x6c89('0xb')]['split'](/\s+/);return _0x53bc4b['length']>0x1?_0x53bc4b[_0x6c89('0x11')]():'';}return'';}function getMails(_0x2e11a9,_0x324c68){var _0x4678d7='';for(var _0x285a71=0x0;_0x285a71<_0x324c68[_0x6c89('0x8')][_0x6c89('0xe')];_0x285a71+=0x1){if(_0x324c68[_0x6c89('0x8')][_0x285a71][_0x6c89('0x9')]!==_0x2e11a9){if(!_['isEmpty'](_0x4678d7)){_0x4678d7+=',';}_0x4678d7+=_0x324c68[_0x6c89('0x8')][_0x285a71][_0x6c89('0xb')]||_0x324c68[_0x6c89('0x8')][_0x285a71]['address']||'';_0x4678d7+='\x20<';_0x4678d7+=_0x324c68[_0x6c89('0x8')][_0x285a71]['address']?_0x324c68[_0x6c89('0x8')][_0x285a71]['address']:_0x6c89('0x12')+random[_0x6c89('0xa')](0x6)+_0x6c89('0x13');_0x4678d7+='>';}}return _0x4678d7;}function parseEmail(_0x2f50de,_0x54a5a0,_0x5a14d3){if(_0x54a5a0['html']){var _0x717a73=/)<[^<]*)*<\/script>/gi;while(_0x717a73[_0x6c89('0x14')](_0x54a5a0[_0x6c89('0x15')])){_0x54a5a0['html']=_0x54a5a0[_0x6c89('0x15')]['replace'](_0x717a73,'');}if(_0x54a5a0['html'][_0x6c89('0x16')](_0x6c89('0x17'))){var _0x147a91=[];_0x54a5a0['attachments'][_0x6c89('0x18')](_0x43e787=>{_0x147a91['push'](_0x43e787[_0x6c89('0x19')]);});var _0x24e97f=/]+>/g;var _0x3c86d6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3bb9b7=_0x54a5a0['html']['replace'](_0x3c86d6,_0x6c89('0x1a'));var _0x5a66df=_0x3bb9b7['replace'](_0x24e97f,'_IMG');for(let _0x54a577=0x0;_0x54a577<_0x147a91['length'];_0x54a577++){var _0x515b64=_0x5a66df[_0x6c89('0x1b')](_0x6c89('0x1c'),_0x6c89('0x1d')+_0x147a91[_0x54a577]+_0x6c89('0x1e'));_0x5a66df=_0x515b64;}_0x54a5a0['html']=_0x5a66df;}_0x5a14d3[_0x6c89('0x1f')]=_0x54a5a0[_0x6c89('0x15')];}else{_0x5a14d3['body']=_0x54a5a0['textAsHtml'];}if(_0x5a14d3[_0x6c89('0x1f')]){_0x5a14d3[_0x6c89('0x1f')]=_0x5a14d3[_0x6c89('0x1f')]['replace'](/0x0){var _0x29ab26=['Auto-Submitted:\x20auto-replied',_0x6c89('0x31'),'Precedence:\x20auto_reply'];for(var _0x29c973=0x0;_0x29c973<_0x54a5a0[_0x6c89('0x30')][_0x6c89('0xe')];_0x29c973++){var _0x1cd0d5=_[_0x6c89('0xd')](_0x29ab26,_0x54a5a0[_0x6c89('0x30')][_0x29c973][_0x6c89('0x32')]);if(_0x1cd0d5>=0x0){_0x5a14d3[_0x6c89('0x33')]=!![];}}}return _0x5a14d3;}exports[_0x6c89('0x34')]=function(_0x4f0977,_0x400c31,_0xc34e0c){var _0x379f6b={'from':getAddress(_0x400c31[_0x6c89('0x35')]),'firstName':getFirstName(_0x400c31[_0x6c89('0x35')]),'lastName':getLastName(_0x400c31[_0x6c89('0x35')]),'mapKey':_0x6c89('0x5'),'message':{'from':getMails(_0x4f0977[_0x6c89('0x5')],_0x400c31['from']),'to':_0x4f0977['email'],'cc':'','subject':_0x400c31[_0x6c89('0x36')]||'','messageId':_0x400c31[_0x6c89('0x37')],'inReplyTo':_0x400c31[_0x6c89('0x38')],'sentAt':moment(_0x400c31[_0x6c89('0x39')])[_0x6c89('0x2a')](_0x6c89('0x3a')),'attach':![],'attachments':[]}};if(!_0x400c31[_0x6c89('0x15')]&&!_0x400c31[_0x6c89('0x3b')]){var _0x169c2b=_[_0x6c89('0x3c')](_0x400c31[_0x6c89('0x26')],{'contentType':_0x6c89('0x3d')});if(_0x169c2b['length']){logger[_0x6c89('0x3e')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x400c31[_0x6c89('0x37')]));tnef[_0x6c89('0x3f')](_['first'](_0x169c2b)[_0x6c89('0x2e')],function(_0x30e2d2,_0x245ba5){if(_0x245ba5){_0x400c31[_0x6c89('0x15')]=_0x245ba5['BodyHTML']||_0x6c89('0x40');if(_0x245ba5[_0x6c89('0x41')]){for(var _0x48bbc0=0x0;_0x48bbc0<_0x245ba5[_0x6c89('0x41')][_0x6c89('0xe')];_0x48bbc0++){var _0x398b30=_0x245ba5['Attachments'][_0x48bbc0];_0x379f6b['message'][_0x6c89('0x26')][_0x6c89('0x2f')]({'filename':_0x398b30['Title'],'content':Buffer[_0x6c89('0x35')](_0x398b30[_0x6c89('0x42')])});}}}_0xc34e0c(parseEmail(_0x4f0977,_0x400c31,_0x379f6b));});}else{_0x400c31[_0x6c89('0x15')]=_0x6c89('0x40');_0xc34e0c(parseEmail(_0x4f0977,_0x400c31,_0x379f6b));}}else{_0xc34e0c(parseEmail(_0x4f0977,_0x400c31,_0x379f6b));}};exports[_0x6c89('0x43')]=function(_0x22c7f8,_0x5c8fd3){var _0x279dce=[_0x6c89('0x44')+(_0x5c8fd3||''),_0x6c89('0x45')+_0x22c7f8,'',''];return Buffer[_0x6c89('0x35')](_0x279dce['join'](''),_0x6c89('0x46'))['toString'](_0x6c89('0x47'));}; \ No newline at end of file +var _0x2f49=['user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','email','../../../config/environment','value','address','@xcally.com','head','name','indexOf','split','length','slice','join','Anonymous','pop','anonymous','generate','html','test','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

'];(function(_0x59172a,_0x2826d2){var _0x43da11=function(_0x306e76){while(--_0x306e76){_0x59172a['push'](_0x59172a['shift']());}};_0x43da11(++_0x2826d2);}(_0x2f49,0x16d));var _0x92f4=function(_0x5c6eaa,_0x1a022f){_0x5c6eaa=_0x5c6eaa-0x0;var _0x516c44=_0x2f49[_0x5c6eaa];return _0x516c44;};'use strict';var _=require(_0x92f4('0x0'));var moment=require(_0x92f4('0x1'));var random=require(_0x92f4('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x92f4('0x3'));var tnef=require(_0x92f4('0x4'));var logger=require('../../../config/logger')(_0x92f4('0x5'));var config=require(_0x92f4('0x6'));function getAddress(_0x3fc90b){var _0x249982=_['head'](_0x3fc90b[_0x92f4('0x7')]);return _0x249982&&_0x249982[_0x92f4('0x8')]?_0x249982[_0x92f4('0x8')]:'anonymous'+random['generate'](0x6)+_0x92f4('0x9');}function getFirstName(_0x48ae39){var _0x419628=_[_0x92f4('0xa')](_0x48ae39[_0x92f4('0x7')]);if(_0x419628&&_0x419628[_0x92f4('0xb')]){if(_0x419628['name']==_0x419628['address']){return _0x419628[_0x92f4('0xb')]['substring'](0x0,_0x419628[_0x92f4('0xb')][_0x92f4('0xc')]('@'));}var _0x44eaa3=_0x419628['name'][_0x92f4('0xd')](/\s+/);return _0x44eaa3[_0x92f4('0xe')]>0x1?_0x44eaa3[_0x92f4('0xf')](0x0,-0x1)[_0x92f4('0x10')]('\x20'):_0x419628[_0x92f4('0xb')];}return _0x92f4('0x11');}function getLastName(_0x3d1193){var _0x3b5a33=_['head'](_0x3d1193[_0x92f4('0x7')]);if(_0x3b5a33&&_0x3b5a33[_0x92f4('0xb')]){var _0x75799b=_0x3b5a33[_0x92f4('0xb')][_0x92f4('0xd')](/\s+/);return _0x75799b[_0x92f4('0xe')]>0x1?_0x75799b[_0x92f4('0x12')]():'';}return'';}function getMails(_0x321347,_0x2c14dc){var _0x5cb2d9='';for(var _0x5baa2b=0x0;_0x5baa2b<_0x2c14dc[_0x92f4('0x7')][_0x92f4('0xe')];_0x5baa2b+=0x1){if(_0x2c14dc[_0x92f4('0x7')][_0x5baa2b][_0x92f4('0x8')]!==_0x321347){if(!_['isEmpty'](_0x5cb2d9)){_0x5cb2d9+=',';}_0x5cb2d9+=_0x2c14dc[_0x92f4('0x7')][_0x5baa2b][_0x92f4('0xb')]||_0x2c14dc[_0x92f4('0x7')][_0x5baa2b][_0x92f4('0x8')]||'';_0x5cb2d9+='\x20<';_0x5cb2d9+=_0x2c14dc[_0x92f4('0x7')][_0x5baa2b]['address']?_0x2c14dc['value'][_0x5baa2b][_0x92f4('0x8')]:_0x92f4('0x13')+random[_0x92f4('0x14')](0x6)+'@xcally.com';_0x5cb2d9+='>';}}return _0x5cb2d9;}function parseEmail(_0x137274,_0x22323e,_0x213a16){if(_0x22323e[_0x92f4('0x15')]){var _0x376316=/)<[^<]*)*<\/script>/gi;while(_0x376316[_0x92f4('0x16')](_0x22323e['html'])){_0x22323e[_0x92f4('0x15')]=_0x22323e[_0x92f4('0x15')]['replace'](_0x376316,'');}if(_0x22323e[_0x92f4('0x15')][_0x92f4('0x17')](_0x92f4('0x18'))){var _0x15bfec=[];_0x22323e[_0x92f4('0x19')][_0x92f4('0x1a')](_0x554a8e=>{_0x15bfec[_0x92f4('0x1b')](_0x554a8e['filename']);});var _0x114363=/]+>/g;var _0xa4572a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x397797=_0x22323e['html'][_0x92f4('0x1c')](_0xa4572a,_0x92f4('0x1d'));var _0x58bae0=_0x397797[_0x92f4('0x1c')](_0x114363,_0x92f4('0x1e'));for(let _0x18390a=0x0;_0x18390a<_0x15bfec[_0x92f4('0xe')];_0x18390a++){var _0x3b214b=_0x58bae0['replace'](_0x92f4('0x1e'),_0x92f4('0x1f')+_0x15bfec[_0x18390a]+_0x92f4('0x20'));_0x58bae0=_0x3b214b;}_0x22323e['html']=_0x58bae0;}_0x213a16[_0x92f4('0x21')]=_0x22323e[_0x92f4('0x15')];}else{_0x213a16[_0x92f4('0x21')]=_0x22323e['textAsHtml'];}if(_0x213a16[_0x92f4('0x21')]){_0x213a16['body']=_0x213a16[_0x92f4('0x21')][_0x92f4('0x1c')](/0x0){var _0x1cd47a=[_0x92f4('0x32'),'X-Auto-Response-Suppress:\x20All',_0x92f4('0x33')];for(var _0x3d3cde=0x0;_0x3d3cde<_0x22323e[_0x92f4('0x31')][_0x92f4('0xe')];_0x3d3cde++){var _0x4ceb54=_[_0x92f4('0xc')](_0x1cd47a,_0x22323e[_0x92f4('0x31')][_0x3d3cde][_0x92f4('0x34')]);if(_0x4ceb54>=0x0){_0x213a16['isAutoreply']=!![];}}}return _0x213a16;}exports[_0x92f4('0x35')]=function(_0x15028a,_0x5f5a3d,_0x5aea7f){var _0x23458b={'from':getAddress(_0x5f5a3d[_0x92f4('0x36')]),'firstName':getFirstName(_0x5f5a3d['from']),'lastName':getLastName(_0x5f5a3d[_0x92f4('0x36')]),'mapKey':'email','message':{'from':getMails(_0x15028a[_0x92f4('0x5')],_0x5f5a3d[_0x92f4('0x36')]),'to':_0x15028a['email'],'cc':'','subject':_0x5f5a3d[_0x92f4('0x37')]||'','messageId':_0x5f5a3d[_0x92f4('0x38')],'inReplyTo':_0x5f5a3d['inReplyTo'],'sentAt':moment(_0x5f5a3d['date'])[_0x92f4('0x2c')](_0x92f4('0x39')),'attach':![],'attachments':[]}};if(!_0x5f5a3d[_0x92f4('0x15')]&&!_0x5f5a3d[_0x92f4('0x3a')]){var _0x2f91cf=_[_0x92f4('0x3b')](_0x5f5a3d['attachments'],{'contentType':_0x92f4('0x3c')});if(_0x2f91cf[_0x92f4('0xe')]){logger['info'](util[_0x92f4('0x2c')](_0x92f4('0x3d'),_0x5f5a3d[_0x92f4('0x38')]));tnef[_0x92f4('0x3e')](_['first'](_0x2f91cf)[_0x92f4('0x2f')],function(_0x2e9c5a,_0x38f431){if(_0x38f431){_0x5f5a3d[_0x92f4('0x15')]=_0x38f431[_0x92f4('0x3f')]||'

Empty\x20message

';if(_0x38f431['Attachments']){for(var _0x542ce1=0x0;_0x542ce1<_0x38f431[_0x92f4('0x40')][_0x92f4('0xe')];_0x542ce1++){var _0x3db027=_0x38f431['Attachments'][_0x542ce1];_0x23458b['message'][_0x92f4('0x19')][_0x92f4('0x1b')]({'filename':_0x3db027[_0x92f4('0x41')],'content':Buffer[_0x92f4('0x36')](_0x3db027['Data'])});}}}_0x5aea7f(parseEmail(_0x15028a,_0x5f5a3d,_0x23458b));});}else{_0x5f5a3d[_0x92f4('0x15')]=_0x92f4('0x42');_0x5aea7f(parseEmail(_0x15028a,_0x5f5a3d,_0x23458b));}}else{_0x5aea7f(parseEmail(_0x15028a,_0x5f5a3d,_0x23458b));}};exports['generateXOAuth2Token']=function(_0xbb7d71,_0xd75712){var _0x5888dd=[_0x92f4('0x43')+(_0xd75712||''),_0x92f4('0x44')+_0xbb7d71,'',''];return Buffer['from'](_0x5888dd[_0x92f4('0x10')](''),_0x92f4('0x45'))[_0x92f4('0x46')](_0x92f4('0x47'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 85832f3..1f27ae8 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 _0xced0=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0x461835,_0x455d6c){var _0x50da20=function(_0x321c9c){while(--_0x321c9c){_0x461835['push'](_0x461835['shift']());}};_0x50da20(++_0x455d6c);}(_0xced0,0x82));var _0x0ced=function(_0x15ee41,_0x9275d8){_0x15ee41=_0x15ee41-0x0;var _0x2b2846=_0xced0[_0x15ee41];return _0x2b2846;};'use strict';var _=require(_0x0ced('0x0'));function MailAccount(_0x36d809){this['id']=_0x36d809['id']||0x0;this[_0x0ced('0x1')]=_0x36d809[_0x0ced('0x1')]||_0x0ced('0x2');this['key']=_0x36d809[_0x0ced('0x3')]||_0x0ced('0x4');this['active']=_0x36d809[_0x0ced('0x5')]||![];this[_0x0ced('0x6')]=_0x36d809[_0x0ced('0x6')]||[];this[_0x0ced('0x7')]=_0x36d809[_0x0ced('0x7')]||[];}module[_0x0ced('0x8')]=MailAccount; \ No newline at end of file +var _0x1236=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x1236,0x9d));var _0x6123=function(_0x2d83fa,_0x40d38f){_0x2d83fa=_0x2d83fa-0x0;var _0x5cf8af=_0x1236[_0x2d83fa];return _0x5cf8af;};'use strict';var _=require(_0x6123('0x0'));function MailAccount(_0x5393cf){this['id']=_0x5393cf['id']||0x0;this[_0x6123('0x1')]=_0x5393cf[_0x6123('0x1')]||_0x6123('0x2');this['key']=_0x5393cf[_0x6123('0x3')]||_0x6123('0x4');this['active']=_0x5393cf[_0x6123('0x5')]||![];this[_0x6123('0x6')]=_0x5393cf['Imap']||[];this[_0x6123('0x7')]=_0x5393cf[_0x6123('0x7')]||[];}module[_0x6123('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 bc5fcda..e726cfe 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 _0x2e5e=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined'];(function(_0xb935ec,_0x2e217e){var _0x309513=function(_0x20339f){while(--_0x20339f){_0xb935ec['push'](_0xb935ec['shift']());}};_0x309513(++_0x2e217e);}(_0x2e5e,0x1c5));var _0xe2e5=function(_0x59880c,_0x294cde){_0x59880c=_0x59880c-0x0;var _0x12c5a3=_0x2e5e[_0x59880c];return _0x12c5a3;};'use strict';var _=require(_0xe2e5('0x0'));var MailAccount=require(_0xe2e5('0x1'));var Realtime=function(){this[_0xe2e5('0x2')]={};};function freeIsNotKey(_0x2ce028,_0x1909ad,_0xe83a71){var _0x57490e=_[_0xe2e5('0x3')](_0x2ce028,function(_0x1e2729,_0x3b8898){return _0x1e2729[_0xe83a71];});for(var _0x290fb7 in _0x1909ad){if(_0x1909ad[_0xe2e5('0x4')](_0x290fb7)){if(!_0x57490e[_0x290fb7]){delete _0x1909ad[_0x290fb7];}}}}Realtime[_0xe2e5('0x5')][_0xe2e5('0x6')]=function(_0x4cf9ca,_0x2455ed){for(var _0x15fe6b in _0x2455ed){if(_0x4cf9ca['hasOwnProperty'](_0x15fe6b)){_0x4cf9ca[_0x15fe6b]=_0x2455ed[_0x15fe6b];}}};Realtime[_0xe2e5('0x5')][_0xe2e5('0x7')]=function(){var _0x389b22=this;return function(_0x5d488b){if(_0x5d488b){freeIsNotKey(_0x5d488b,_0x389b22['mailAccounts'],'id');for(var _0xe0d723=0x0,_0x519872={},_0x936d3a={};_0xe0d723<_0x5d488b['length'];_0xe0d723+=0x1){_0x519872=_0x5d488b[_0xe0d723];if(_[_0xe2e5('0x8')](_0x389b22[_0xe2e5('0x2')][_0x519872['id']])){_0x389b22[_0xe2e5('0x2')][_0x519872['id']]=new MailAccount(_0x519872);}else{_[_0xe2e5('0x9')](_0x389b22[_0xe2e5('0x2')][_0x519872['id']],_0x519872);}}}return _0x389b22['mailAccounts'];};};module[_0xe2e5('0xa')]=Realtime; \ No newline at end of file +var _0x56f3=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x58d4f0,_0x78cd7){var _0x28ff3c=function(_0x3518b9){while(--_0x3518b9){_0x58d4f0['push'](_0x58d4f0['shift']());}};_0x28ff3c(++_0x78cd7);}(_0x56f3,0x109));var _0x356f=function(_0x4b7215,_0x329f5f){_0x4b7215=_0x4b7215-0x0;var _0x3c0680=_0x56f3[_0x4b7215];return _0x3c0680;};'use strict';var _=require(_0x356f('0x0'));var MailAccount=require(_0x356f('0x1'));var Realtime=function(){this[_0x356f('0x2')]={};};function freeIsNotKey(_0x3f47c5,_0x1ff14c,_0x545690){var _0x168052=_[_0x356f('0x3')](_0x3f47c5,function(_0x22c19d,_0x223d01){return _0x22c19d[_0x545690];});for(var _0x425a3d in _0x1ff14c){if(_0x1ff14c[_0x356f('0x4')](_0x425a3d)){if(!_0x168052[_0x425a3d]){delete _0x1ff14c[_0x425a3d];}}}}Realtime[_0x356f('0x5')][_0x356f('0x6')]=function(_0x402a59,_0x461e09){for(var _0x330bd3 in _0x461e09){if(_0x402a59['hasOwnProperty'](_0x330bd3)){_0x402a59[_0x330bd3]=_0x461e09[_0x330bd3];}}};Realtime['prototype'][_0x356f('0x7')]=function(){var _0x582909=this;return function(_0x5898ef){if(_0x5898ef){freeIsNotKey(_0x5898ef,_0x582909['mailAccounts'],'id');for(var _0x4813d1=0x0,_0x20743={},_0x45d30e={};_0x4813d1<_0x5898ef[_0x356f('0x8')];_0x4813d1+=0x1){_0x20743=_0x5898ef[_0x4813d1];if(_[_0x356f('0x9')](_0x582909['mailAccounts'][_0x20743['id']])){_0x582909[_0x356f('0x2')][_0x20743['id']]=new MailAccount(_0x20743);}else{_['merge'](_0x582909[_0x356f('0x2')][_0x20743['id']],_0x20743);}}}return _0x582909[_0x356f('0x2')];};};module[_0x356f('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 8b2444c..b46993c 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 _0x27af=['CloudProvider','data5','MailServerOut','Smtp','service','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','active','key','ListId','TemplateId','MailServerIn','Imap'];(function(_0x58bf72,_0x270672){var _0x5ac3aa=function(_0x5b6191){while(--_0x5b6191){_0x58bf72['push'](_0x58bf72['shift']());}};_0x5ac3aa(++_0x270672);}(_0x27af,0x199));var _0xf27a=function(_0x144616,_0x1188de){_0x144616=_0x144616-0x0;var _0x100e2f=_0x27af[_0x144616];return _0x100e2f;};'use strict';var client=require(_0xf27a('0x0'));exports[_0xf27a('0x1')]=function(){return function(){return client[_0xf27a('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xf27a('0x3'),_0xf27a('0x4'),'service','email',_0xf27a('0x5'),_0xf27a('0x6'),_0xf27a('0x7'),_0xf27a('0x8')],'raw':![],'include':[{'model':_0xf27a('0x9'),'as':_0xf27a('0xa'),'include':[{'model':_0xf27a('0xb'),'attributes':['id',_0xf27a('0x3'),'service','type',_0xf27a('0xc')],'as':_0xf27a('0xb')}]},{'model':_0xf27a('0xd'),'as':_0xf27a('0xe'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xf27a('0xf'),_0xf27a('0x10'),_0xf27a('0xc')],'as':_0xf27a('0xb')}]}]},'log':_0xf27a('0x11')});};};exports[_0xf27a('0x12')]=function(_0x31152b,_0x327381){return client[_0xf27a('0x2')](_0xf27a('0x13'),{'account':{'id':_0x31152b},'body':_0x327381,'log':_0xf27a('0x13')});}; \ No newline at end of file +var _0xd991=['key','ListId','TemplateId','Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active'];(function(_0x43ba80,_0x291da8){var _0x11772b=function(_0x3a8217){while(--_0x3a8217){_0x43ba80['push'](_0x43ba80['shift']());}};_0x11772b(++_0x291da8);}(_0xd991,0x115));var _0x1d99=function(_0x49df6b,_0x5c70d6){_0x49df6b=_0x49df6b-0x0;var _0x3b4a60=_0xd991[_0x49df6b];return _0x3b4a60;};'use strict';var client=require(_0x1d99('0x0'));exports[_0x1d99('0x1')]=function(){return function(){return client[_0x1d99('0x2')](_0x1d99('0x3'),{'options':{'attributes':['id',_0x1d99('0x4'),'provider',_0x1d99('0x5'),_0x1d99('0x6'),_0x1d99('0x7'),_0x1d99('0x8'),_0x1d99('0x9'),_0x1d99('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':_0x1d99('0xb'),'include':[{'model':_0x1d99('0xc'),'attributes':['id','name',_0x1d99('0x5'),_0x1d99('0xd'),_0x1d99('0xe')],'as':_0x1d99('0xc')}]},{'model':_0x1d99('0xf'),'as':_0x1d99('0x10'),'include':[{'model':_0x1d99('0xc'),'attributes':['id',_0x1d99('0x4'),_0x1d99('0x5'),'type',_0x1d99('0xe')],'as':_0x1d99('0xc')}]}]},'log':'getMailAccount'});};};exports[_0x1d99('0x11')]=function(_0xa64b21,_0x38c1de){return client['Request'](_0x1d99('0x12'),{'account':{'id':_0xa64b21},'body':_0x38c1de,'log':_0x1d99('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index a71da38..8089de2 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 _0x921f=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x921f,0x18f));var _0xf921=function(_0x1ca7d1,_0x3c0176){_0x1ca7d1=_0x1ca7d1-0x0;var _0x52f447=_0x921f[_0x1ca7d1];return _0x52f447;};'use strict';var client=require(_0xf921('0x0'));exports[_0xf921('0x1')]=function(){return client['Request'](_0xf921('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf921('0x3')]},'log':_0xf921('0x4')});}; \ No newline at end of file +var _0x384e=['Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x562ec2,_0x33932b){var _0xd3a205=function(_0x21aac4){while(--_0x21aac4){_0x562ec2['push'](_0x562ec2['shift']());}};_0xd3a205(++_0x33932b);}(_0x384e,0x1c0));var _0xe384=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x384e[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xe384('0x0')](_0xe384('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe384('0x2')]},'log':_0xe384('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 86ee48f..81cb75b 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 2d8ac59..6edb39b 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 _0x6461=['../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','redis','defaults','localhost','../../config/triggers'];(function(_0x2379d1,_0x4fa156){var _0x4368b9=function(_0x6451ef){while(--_0x6451ef){_0x2379d1['push'](_0x2379d1['shift']());}};_0x4368b9(++_0x4fa156);}(_0x6461,0x82));var _0x1646=function(_0x233a82,_0x2d6b7f){_0x233a82=_0x233a82-0x0;var _0xd40a5f=_0x6461[_0x233a82];return _0xd40a5f;};'use strict';var _=require('lodash');var http=require(_0x1646('0x0'));var express=require(_0x1646('0x1'));var sticky=require(_0x1646('0x2'));var Redis=require(_0x1646('0x3'));var config=require(_0x1646('0x4'));var app=express();var server=http[_0x1646('0x5')](app);server[_0x1646('0x6')]=0xdbba0;if(sticky[_0x1646('0x7')](server,config['port'])){var socketio=require(_0x1646('0x8'))(server,{'transports':[_0x1646('0x9'),'polling']});config[_0x1646('0xa')]=_[_0x1646('0xb')](config['redis'],{'host':_0x1646('0xc'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x1646('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x1646('0xd'))['default']();require(_0x1646('0xe'))[_0x1646('0xf')](socketio);require(_0x1646('0x10'))[_0x1646('0xf')](app);require(_0x1646('0x11'))[_0x1646('0xf')](app);}else{server[_0x1646('0x12')](_0x1646('0x13'),function(){console[_0x1646('0x14')](_0x1646('0x15'),config[_0x1646('0x16')]);});}exports=module[_0x1646('0x17')]=app; \ No newline at end of file +var _0x6684=['../../config/express','../../routes','once','listening','log','exports','lodash','http','express','sticky-session','createServer','timeout','listen','port','socket.io','polling','localhost','adapter','socket.io-redis','redis','../../config/triggers','../../config/socketio','default'];(function(_0x4b6228,_0x3eb5a2){var _0x337693=function(_0x4ed545){while(--_0x4ed545){_0x4b6228['push'](_0x4b6228['shift']());}};_0x337693(++_0x3eb5a2);}(_0x6684,0x11a));var _0x4668=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x6684[_0x11a220];return _0x20d8fe;};'use strict';var _=require(_0x4668('0x0'));var http=require(_0x4668('0x1'));var express=require(_0x4668('0x2'));var sticky=require(_0x4668('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x4668('0x4')](app);server[_0x4668('0x5')]=0xdbba0;if(sticky[_0x4668('0x6')](server,config[_0x4668('0x7')])){var socketio=require(_0x4668('0x8'))(server,{'transports':['websocket',_0x4668('0x9')]});config['redis']=_['defaults'](config['redis'],{'host':_0x4668('0xa'),'port':0x18eb});socketio[_0x4668('0xb')](require(_0x4668('0xc'))({'pubClient':new Redis(config[_0x4668('0xd')]),'subClient':new Redis(config[_0x4668('0xd')])}));require(_0x4668('0xe'))['default']();require(_0x4668('0xf'))[_0x4668('0x10')](socketio);require(_0x4668('0x11'))[_0x4668('0x10')](app);require(_0x4668('0x12'))[_0x4668('0x10')](app);}else{server[_0x4668('0x13')](_0x4668('0x14'),function(){console[_0x4668('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x4668('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index edeb2e2..070e030 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 _0x549a=['catch','exports','jayson/promise','bluebird','routing','client','Request','request','then','debug','rpc','error','message','result'];(function(_0x55554a,_0x3a24d0){var _0x179793=function(_0x5e25b0){while(--_0x5e25b0){_0x55554a['push'](_0x55554a['shift']());}};_0x179793(++_0x3a24d0);}(_0x549a,0x80));var _0xa549=function(_0x3dc483,_0x30ccf8){_0x3dc483=_0x3dc483-0x0;var _0x22c712=_0x549a[_0x3dc483];return _0x22c712;};'use strict';var jayson=require(_0xa549('0x0'));var BPromise=require(_0xa549('0x1'));var logger=require('../../config/logger')(_0xa549('0x2'));var client=jayson[_0xa549('0x3')]['http']({'port':0x2329});client[_0xa549('0x4')]=function(_0x191497,_0x37e8a6){return new BPromise(function(_0x49cc94,_0xea52f2){return client[_0xa549('0x5')](_0x191497,_0x37e8a6)[_0xa549('0x6')](function(_0x4593a3){logger[_0xa549('0x7')](_0xa549('0x8'),_0xa549('0x2'),_0x191497,_0x37e8a6,_0x4593a3);if(_0x4593a3[_0xa549('0x9')]){logger[_0xa549('0x9')](_0xa549('0x8'),_0xa549('0x2'),_0x191497,_0x4593a3[_0xa549('0x9')][_0xa549('0xa')],_0x37e8a6);return _0xea52f2(_0x4593a3[_0xa549('0x9')][_0xa549('0xa')]);}else{return _0x49cc94(_0x4593a3[_0xa549('0xb')]);}})[_0xa549('0xc')](function(_0x5566fb){logger[_0xa549('0x9')](_0xa549('0x8'),_0xa549('0x2'),_0x191497,_0x5566fb,_0x37e8a6);return _0xea52f2(_0x5566fb);});});};module[_0xa549('0xd')]=client; \ No newline at end of file +var _0x341a=['debug','error','message','result','catch','rpc','jayson/promise','bluebird','routing','client','Request','request','then'];(function(_0x513789,_0x3d7067){var _0xbdc2f3=function(_0x4610ac){while(--_0x4610ac){_0x513789['push'](_0x513789['shift']());}};_0xbdc2f3(++_0x3d7067);}(_0x341a,0x6e));var _0xa341=function(_0x5680f5,_0x578208){_0x5680f5=_0x5680f5-0x0;var _0x5797b0=_0x341a[_0x5680f5];return _0x5797b0;};'use strict';var jayson=require(_0xa341('0x0'));var BPromise=require(_0xa341('0x1'));var logger=require('../../config/logger')(_0xa341('0x2'));var client=jayson[_0xa341('0x3')]['http']({'port':0x2329});client[_0xa341('0x4')]=function(_0x4c7331,_0x5bfd11){return new BPromise(function(_0x581d9b,_0x7eb419){return client[_0xa341('0x5')](_0x4c7331,_0x5bfd11)[_0xa341('0x6')](function(_0xeb9fa7){logger[_0xa341('0x7')]('rpc',_0xa341('0x2'),_0x4c7331,_0x5bfd11,_0xeb9fa7);if(_0xeb9fa7[_0xa341('0x8')]){logger[_0xa341('0x8')]('rpc',_0xa341('0x2'),_0x4c7331,_0xeb9fa7['error']['message'],_0x5bfd11);return _0x7eb419(_0xeb9fa7['error'][_0xa341('0x9')]);}else{return _0x581d9b(_0xeb9fa7[_0xa341('0xa')]);}})[_0xa341('0xb')](function(_0x3d1b99){logger[_0xa341('0x8')](_0xa341('0xc'),_0xa341('0x2'),_0x4c7331,_0x3d1b99,_0x5bfd11);return _0x7eb419(_0x3d1b99);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a1a9b5b..897834d 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 _0x97b0=['./rpc/faxQueue','resolve','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initChatQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0x97b0,0x1db));var _0x097b=function(_0x4af378,_0x32f59e){_0x4af378=_0x4af378-0x0;var _0x391814=_0x97b0[_0x4af378];return _0x391814;};'use strict';var BPromise=require(_0x097b('0x0'));var server=require(_0x097b('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x097b('0x2'));var openchannelQueue=require(_0x097b('0x3'));var chatQueue=require(_0x097b('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x097b('0x5'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x097b('0x6')]()[_0x097b('0x7')](user[_0x097b('0x8')]())['then'](realtime['initAgents']())[_0x097b('0x7')](interval[_0x097b('0x9')]())[_0x097b('0x7')](realtime[_0x097b('0xa')]())[_0x097b('0x7')](openchannelQueue[_0x097b('0xb')]())[_0x097b('0x7')](realtime['initOpenchannelQueues']())[_0x097b('0x7')](chatQueue['getChatQueues']())[_0x097b('0x7')](realtime[_0x097b('0xc')]())['then'](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x097b('0x7')](mailQueue[_0x097b('0xd')]())[_0x097b('0x7')](realtime[_0x097b('0xe')]())[_0x097b('0x7')](faxQueue['getFaxQueues']())['then'](realtime[_0x097b('0xf')]())[_0x097b('0x7')](whatsappQueue[_0x097b('0x10')]())[_0x097b('0x7')](realtime[_0x097b('0x11')]())[_0x097b('0x7')](function(){return realtime;});}function main(){return server[_0x097b('0x12')](realtime)['then'](function(_0x24b700){return initRealtime();})[_0x097b('0x7')](function(_0x279f4d){return setInterval(initRealtime,0x1388);})[_0x097b('0x13')](function(_0x3ceed8){console['log'](_0x3ceed8);});}main(); \ No newline at end of file +var _0x2921=['./rpc/smsQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/interval','./rpc/chatQueue'];(function(_0x33e981,_0x432df5){var _0x3e43ca=function(_0x279a35){while(--_0x279a35){_0x33e981['push'](_0x33e981['shift']());}};_0x3e43ca(++_0x432df5);}(_0x2921,0xc2));var _0x1292=function(_0x2fe80f,_0xfafbbe){_0x2fe80f=_0x2fe80f-0x0;var _0x589b68=_0x2921[_0x2fe80f];return _0x589b68;};'use strict';var BPromise=require('bluebird');var server=require(_0x1292('0x0'));var Realtime=require('./realtime');var user=require(_0x1292('0x1'));var interval=require(_0x1292('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x1292('0x3'));var smsQueue=require(_0x1292('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x1292('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1292('0x6')]()['then'](user[_0x1292('0x7')]())[_0x1292('0x8')](realtime[_0x1292('0x9')]())[_0x1292('0x8')](interval[_0x1292('0xa')]())[_0x1292('0x8')](realtime[_0x1292('0xb')]())[_0x1292('0x8')](openchannelQueue[_0x1292('0xc')]())[_0x1292('0x8')](realtime[_0x1292('0xd')]())[_0x1292('0x8')](chatQueue['getChatQueues']())[_0x1292('0x8')](realtime['initChatQueues']())['then'](smsQueue[_0x1292('0xe')]())['then'](realtime[_0x1292('0xf')]())[_0x1292('0x8')](mailQueue[_0x1292('0x10')]())[_0x1292('0x8')](realtime[_0x1292('0x11')]())[_0x1292('0x8')](faxQueue['getFaxQueues']())[_0x1292('0x8')](realtime['initFaxQueues']())[_0x1292('0x8')](whatsappQueue['getWhatsappQueues']())[_0x1292('0x8')](realtime[_0x1292('0x12')]())['then'](function(){return realtime;});}function main(){return server[_0x1292('0x13')](realtime)[_0x1292('0x8')](function(_0x251035){return initRealtime();})[_0x1292('0x8')](function(_0x12957f){return setInterval(initRealtime,0x1388);})[_0x1292('0x14')](function(_0x2db671){console[_0x1292('0x15')](_0x2db671);});}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 a583ad9..ed2c7dc 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x533c7f,_0x5c65fe){var _0x12921f=function(_0x264203){while(--_0x264203){_0x533c7f['push'](_0x533c7f['shift']());}};_0x12921f(++_0x5c65fe);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x2a0346,_0x2c1300){_0x2a0346=_0x2a0346-0x0;var _0x1f5232=_0x1261[_0x2a0346];return _0x1f5232;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d185c6e..eefca58 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 _0x68ed=['SendMail','jayson/promise','client','http','request','error','catch','sendMailMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68ed,0x151));var _0xd68e=function(_0x306081,_0x2cc909){_0x306081=_0x306081-0x0;var _0x5b4f09=_0x68ed[_0x306081];return _0x5b4f09;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xd68e('0x0'));var client=jayson[_0xd68e('0x1')][_0xd68e('0x2')]({'port':0x232b});function request(_0xf67992,_0x455122){return new BPromise(function(_0x4b5110,_0x1da8e3){return client[_0xd68e('0x3')](_0xf67992,_0x455122)['then'](function(_0x5e7958){if(_0x5e7958[_0xd68e('0x4')]){return _0x1da8e3(_0x5e7958[_0xd68e('0x4')]['message']);}else{return _0x4b5110(_0x5e7958['result']);}})[_0xd68e('0x5')](function(_0x71bbf6){return _0x1da8e3(_0x71bbf6);});});}exports[_0xd68e('0x6')]=function(_0x485719,_0x2a3e30){return request(_0xd68e('0x7'),{'account':_0x485719,'message':_0x2a3e30});}; \ No newline at end of file +var _0x9016=['message','result','sendMailMessage','SendMail','bluebird','client','http','request','then','error'];(function(_0xde2226,_0x192faf){var _0x1b6cf3=function(_0x3e8f10){while(--_0x3e8f10){_0xde2226['push'](_0xde2226['shift']());}};_0x1b6cf3(++_0x192faf);}(_0x9016,0xb8));var _0x6901=function(_0x2d49b9,_0x10b663){_0x2d49b9=_0x2d49b9-0x0;var _0x374c7b=_0x9016[_0x2d49b9];return _0x374c7b;};'use strict';var BPromise=require(_0x6901('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x6901('0x1')][_0x6901('0x2')]({'port':0x232b});function request(_0x135d6a,_0x309abb){return new BPromise(function(_0x2ad591,_0x4bdd6e){return client[_0x6901('0x3')](_0x135d6a,_0x309abb)[_0x6901('0x4')](function(_0x5653be){if(_0x5653be[_0x6901('0x5')]){return _0x4bdd6e(_0x5653be[_0x6901('0x5')][_0x6901('0x6')]);}else{return _0x2ad591(_0x5653be[_0x6901('0x7')]);}})['catch'](function(_0x20a729){return _0x4bdd6e(_0x20a729);});});}exports[_0x6901('0x8')]=function(_0x4a99c2,_0xe5b947){return request(_0x6901('0x9'),{'account':_0x4a99c2,'message':_0xe5b947});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 9bc0142..eee4763 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 _0x6a95=['Capacity','maxcapacity','idle','mail','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','Status','chatStatusTime','faxStatusTime','smsStatusTime','smsCurrentCapacity','busyQueue','smsWaitingInteractions','stringify','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity'];(function(_0x2976cb,_0xb3f89a){var _0x15eabf=function(_0x18d998){while(--_0x18d998){_0x2976cb['push'](_0x2976cb['shift']());}};_0x15eabf(++_0xb3f89a);}(_0x6a95,0x1db));var _0x56a9=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x6a95[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x56a9('0x0'));var md5=require(_0x56a9('0x1'));var moment=require(_0x56a9('0x2'));var Redis=require(_0x56a9('0x3'));var config=require(_0x56a9('0x4'));config[_0x56a9('0x5')]=_[_0x56a9('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x56a9('0x7'))(new Redis(config[_0x56a9('0x5')]));function Agent(_0x1b42ac){this['id']=_0x1b42ac['id']||0x0;this[_0x56a9('0x8')]=_0x1b42ac[_0x56a9('0x8')]||'';this[_0x56a9('0x9')]=_0x1b42ac[_0x56a9('0x9')]||!![];this['voicePause']=_0x1b42ac['voicePause']||![];this[_0x56a9('0xa')]=_0x1b42ac[_0x56a9('0xa')]||![];this['mailPause']=_0x1b42ac[_0x56a9('0xb')]||![];this[_0x56a9('0xc')]=_0x1b42ac[_0x56a9('0xc')]||![];this[_0x56a9('0xd')]=_0x1b42ac[_0x56a9('0xd')]||![];this[_0x56a9('0xe')]=_0x1b42ac[_0x56a9('0xe')]||![];this[_0x56a9('0xf')]=_0x56a9('0x10');this['chatStatusTime']=0x0;this[_0x56a9('0x11')]=_0x1b42ac['chatCapacity']||0x0;this[_0x56a9('0x12')]=0x0;this[_0x56a9('0x13')]=_0x56a9('0x10');this[_0x56a9('0x14')]=0x0;this[_0x56a9('0x15')]=_0x1b42ac[_0x56a9('0x15')]||0x0;this[_0x56a9('0x16')]=0x0;this[_0x56a9('0x17')]=_0x56a9('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x1b42ac[_0x56a9('0x18')]||0x0;this[_0x56a9('0x19')]=0x0;this[_0x56a9('0x1a')]=_0x56a9('0x10');this['smsStatusTime']=0x0;this[_0x56a9('0x1b')]=_0x1b42ac['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x56a9('0x10');this[_0x56a9('0x1c')]=0x0;this[_0x56a9('0x1d')]=_0x1b42ac[_0x56a9('0x1d')]||0x0;this[_0x56a9('0x1e')]=0x0;this[_0x56a9('0x1f')]=_0x56a9('0x10');this[_0x56a9('0x20')]=0x0;this[_0x56a9('0x21')]=_0x1b42ac[_0x56a9('0x21')]||0x0;this[_0x56a9('0x22')]=0x0;this[_0x56a9('0x23')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x56a9('0x24')]={};this[_0x56a9('0x25')]={};this[_0x56a9('0x26')]={};this[_0x56a9('0x27')]={};this['smsWaitingInteractions']={};this[_0x56a9('0x28')]={};this[_0x56a9('0x29')]();}Agent[_0x56a9('0x2a')][_0x56a9('0x2b')]=function(_0x5a82e0){if(this[_0x5a82e0+_0x56a9('0x2c')]>0x0){if(this[_0x5a82e0+_0x56a9('0x2d')]>0x0&&this[_0x5a82e0+_0x56a9('0x2c')]>=this[_0x5a82e0+_0x56a9('0x2d')]){return _0x56a9('0x2e');}else{return'working';}}else{return _0x56a9('0x2f');}};Agent[_0x56a9('0x2a')][_0x56a9('0x29')]=function(){var _0x5e3052=[_0x56a9('0x30'),'chat',_0x56a9('0x31'),_0x56a9('0x32'),_0x56a9('0x33'),_0x56a9('0x34')];for(var _0x45f38c=0x0;_0x45f38c<_0x5e3052[_0x56a9('0x35')];_0x45f38c+=0x1){var _0x1133e6=this[_0x56a9('0x2b')](_0x5e3052[_0x45f38c]);if(this[_0x5e3052[_0x45f38c]+'Status']!==_0x1133e6){this[_0x5e3052[_0x45f38c]+_0x56a9('0x36')]=_[_0x56a9('0x37')](moment()['format']('x'));}this[_0x5e3052[_0x45f38c]+_0x56a9('0x38')]=_0x1133e6;}var _0x4f9be1={'id':this['id'],'name':this['name'],'online':this[_0x56a9('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x56a9('0xa')],'mailPause':this[_0x56a9('0xb')],'smsPause':this[_0x56a9('0xd')],'faxPause':this[_0x56a9('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x56a9('0xf')],'chatStatusTime':this[_0x56a9('0x39')],'chatCapacity':this[_0x56a9('0x11')],'chatCurrentCapacity':this[_0x56a9('0x12')],'mailStatus':this[_0x56a9('0x13')],'mailStatusTime':this[_0x56a9('0x14')],'mailCapacity':this[_0x56a9('0x15')],'mailCurrentCapacity':this[_0x56a9('0x16')],'faxStatus':this[_0x56a9('0x17')],'faxStatusTime':this[_0x56a9('0x3a')],'faxCapacity':this[_0x56a9('0x18')],'faxCurrentCapacity':this[_0x56a9('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x56a9('0x3b')],'smsCapacity':this[_0x56a9('0x1b')],'smsCurrentCapacity':this[_0x56a9('0x3c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x56a9('0x1c')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x56a9('0x20')],'openchannelCapacity':this[_0x56a9('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x56a9('0x3d')],'chatWaitingInteractions':this[_0x56a9('0x24')],'faxWaitingInteractions':this[_0x56a9('0x25')],'mailWaitingInteractions':this[_0x56a9('0x26')],'openchannelWaitingInteractions':this[_0x56a9('0x27')],'smsWaitingInteractions':this[_0x56a9('0x3e')],'whatsappWaitingInteractions':this[_0x56a9('0x28')]};var _0x3f8bd0=md5(JSON[_0x56a9('0x3f')](_0x4f9be1));if(this[_0x56a9('0x1')]!==_0x3f8bd0){this['md5']=_0x3f8bd0;io['emit']('user:routing:update',_['omit'](_0x4f9be1,[_0x56a9('0x9')]));}};module[_0x56a9('0x40')]=Agent; \ No newline at end of file +var _0x0adf=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','unknown','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','faxStatusTime','openchannelCurrentCapacity','openchannelWaitingInteractions','stringify','emit','user:routing:update','exports','lodash','md5','moment'];(function(_0x5bd012,_0x2fd62b){var _0x1fccf7=function(_0x16e3cd){while(--_0x16e3cd){_0x5bd012['push'](_0x5bd012['shift']());}};_0x1fccf7(++_0x2fd62b);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x733dd9,_0x2d7bd9){_0x733dd9=_0x733dd9-0x0;var _0x5322ac=_0x0adf[_0x733dd9];return _0x5322ac;};'use strict';var _=require(_0xf0ad('0x0'));var md5=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var Redis=require('ioredis');var config=require(_0xf0ad('0x3'));config[_0xf0ad('0x4')]=_[_0xf0ad('0x5')](config[_0xf0ad('0x4')],{'host':_0xf0ad('0x6'),'port':0x18eb});var io=require(_0xf0ad('0x7'))(new Redis(config[_0xf0ad('0x4')]));function Agent(_0x59a588){this['id']=_0x59a588['id']||0x0;this[_0xf0ad('0x8')]=_0x59a588['name']||'';this[_0xf0ad('0x9')]=_0x59a588[_0xf0ad('0x9')]||!![];this[_0xf0ad('0xa')]=_0x59a588[_0xf0ad('0xa')]||![];this[_0xf0ad('0xb')]=_0x59a588[_0xf0ad('0xb')]||![];this[_0xf0ad('0xc')]=_0x59a588['mailPause']||![];this[_0xf0ad('0xd')]=_0x59a588['faxPause']||![];this[_0xf0ad('0xe')]=_0x59a588[_0xf0ad('0xe')]||![];this[_0xf0ad('0xf')]=_0x59a588[_0xf0ad('0xf')]||![];this[_0xf0ad('0x10')]='unknown';this['chatStatusTime']=0x0;this[_0xf0ad('0x11')]=_0x59a588[_0xf0ad('0x11')]||0x0;this[_0xf0ad('0x12')]=0x0;this[_0xf0ad('0x13')]='unknown';this[_0xf0ad('0x14')]=0x0;this[_0xf0ad('0x15')]=_0x59a588['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xf0ad('0x16');this['faxStatusTime']=0x0;this[_0xf0ad('0x17')]=_0x59a588[_0xf0ad('0x17')]||0x0;this[_0xf0ad('0x18')]=0x0;this[_0xf0ad('0x19')]=_0xf0ad('0x16');this['smsStatusTime']=0x0;this[_0xf0ad('0x1a')]=_0x59a588[_0xf0ad('0x1a')]||0x0;this[_0xf0ad('0x1b')]=0x0;this[_0xf0ad('0x1c')]='unknown';this['whatsappStatusTime']=0x0;this[_0xf0ad('0x1d')]=_0x59a588[_0xf0ad('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xf0ad('0x1e')]=_0xf0ad('0x16');this[_0xf0ad('0x1f')]=0x0;this[_0xf0ad('0x20')]=_0x59a588['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xf0ad('0x21')]=![];this[_0xf0ad('0x22')]=undefined;this[_0xf0ad('0x1')]='';this[_0xf0ad('0x23')]={};this[_0xf0ad('0x24')]={};this[_0xf0ad('0x25')]={};this['openchannelWaitingInteractions']={};this[_0xf0ad('0x26')]={};this[_0xf0ad('0x27')]={};this[_0xf0ad('0x28')]();}Agent[_0xf0ad('0x29')][_0xf0ad('0x2a')]=function(_0x88b47b){if(this[_0x88b47b+_0xf0ad('0x2b')]>0x0){if(this[_0x88b47b+_0xf0ad('0x2c')]>0x0&&this[_0x88b47b+_0xf0ad('0x2b')]>=this[_0x88b47b+_0xf0ad('0x2c')]){return _0xf0ad('0x2d');}else{return _0xf0ad('0x2e');}}else{return _0xf0ad('0x2f');}};Agent[_0xf0ad('0x29')][_0xf0ad('0x28')]=function(){var _0x557f90=[_0xf0ad('0x30'),_0xf0ad('0x31'),_0xf0ad('0x32'),_0xf0ad('0x33'),_0xf0ad('0x34'),_0xf0ad('0x35')];for(var _0x560417=0x0;_0x560417<_0x557f90[_0xf0ad('0x36')];_0x560417+=0x1){var _0x19a32a=this[_0xf0ad('0x2a')](_0x557f90[_0x560417]);if(this[_0x557f90[_0x560417]+_0xf0ad('0x37')]!==_0x19a32a){this[_0x557f90[_0x560417]+_0xf0ad('0x38')]=_[_0xf0ad('0x39')](moment()[_0xf0ad('0x3a')]('x'));}this[_0x557f90[_0x560417]+_0xf0ad('0x37')]=_0x19a32a;}var _0x2386e8={'id':this['id'],'name':this[_0xf0ad('0x8')],'online':this[_0xf0ad('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xf0ad('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xf0ad('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0xf0ad('0xf')],'chatStatus':this[_0xf0ad('0x10')],'chatStatusTime':this[_0xf0ad('0x3b')],'chatCapacity':this[_0xf0ad('0x11')],'chatCurrentCapacity':this[_0xf0ad('0x12')],'mailStatus':this[_0xf0ad('0x13')],'mailStatusTime':this[_0xf0ad('0x14')],'mailCapacity':this[_0xf0ad('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf0ad('0x3c')],'faxCapacity':this[_0xf0ad('0x17')],'faxCurrentCapacity':this[_0xf0ad('0x18')],'smsStatus':this[_0xf0ad('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xf0ad('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xf0ad('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xf0ad('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xf0ad('0x1e')],'openchannelStatusTime':this[_0xf0ad('0x1f')],'openchannelCapacity':this[_0xf0ad('0x20')],'openchannelCurrentCapacity':this[_0xf0ad('0x3d')],'busy':this[_0xf0ad('0x21')],'busyQueue':this[_0xf0ad('0x22')],'chatWaitingInteractions':this[_0xf0ad('0x23')],'faxWaitingInteractions':this[_0xf0ad('0x24')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xf0ad('0x3e')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xf0ad('0x27')]};var _0x506a56=md5(JSON[_0xf0ad('0x3f')](_0x2386e8));if(this[_0xf0ad('0x1')]!==_0x506a56){this[_0xf0ad('0x1')]=_0x506a56;io[_0xf0ad('0x40')](_0xf0ad('0x41'),_['omit'](_0x2386e8,[_0xf0ad('0x9')]));}};module[_0xf0ad('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c39dea9..f61e452 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 _0xa664=['available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','chatPause'];(function(_0x56d422,_0x332792){var _0x30d83c=function(_0x455d4d){while(--_0x455d4d){_0x56d422['push'](_0x56d422['shift']());}};_0x30d83c(++_0x332792);}(_0xa664,0x1e7));var _0x4a66=function(_0x42a3d3,_0x4252a7){_0x42a3d3=_0x42a3d3-0x0;var _0x2d434b=_0xa664[_0x42a3d3];return _0x2d434b;};'use strict';var _=require(_0x4a66('0x0'));var md5=require(_0x4a66('0x1'));var util=require(_0x4a66('0x2'));var Redis=require(_0x4a66('0x3'));var config=require(_0x4a66('0x4'));config[_0x4a66('0x5')]=_[_0x4a66('0x6')](config[_0x4a66('0x5')],{'host':_0x4a66('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a66('0x5')]));function ChatQueue(_0x29b9d9){this['id']=_0x29b9d9['id']||0x0;this['name']=_0x29b9d9[_0x4a66('0x8')]||'';this[_0x4a66('0x9')]=_0x29b9d9['timeout']||0xa;this['strategy']=_0x29b9d9[_0x4a66('0xa')]||_0x4a66('0xb');this[_0x4a66('0xc')]=_0x29b9d9[_0x4a66('0xc')];this[_0x4a66('0xd')]={};this['waiting']=0x0;this[_0x4a66('0x1')]='';this['updateRouting']();this[_0x4a66('0xe')]();}ChatQueue[_0x4a66('0xf')][_0x4a66('0x10')]=function(){var _0x32026d=this[_0x4a66('0xd')][_0x4a66('0x11')];this[_0x4a66('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x32026d;};ChatQueue[_0x4a66('0xf')][_0x4a66('0xe')]=function(){this[_0x4a66('0x12')]=0x0;this[_0x4a66('0x13')]=0x0;for(var _0x278983=0x0;_0x278983=0x0?this[_0x4a66('0x17')]:0x0;var _0x45aefc={'id':this['id'],'available':this[_0x4a66('0x17')],'loggedIn':this[_0x4a66('0x12')],'name':this['name'],'paused':this[_0x4a66('0x13')],'waiting':this[_0x4a66('0x18')]};var _0x12a9c3=md5(JSON[_0x4a66('0x19')](_0x45aefc));if(this['md5']!==_0x12a9c3){this['md5']=_0x12a9c3;io['to'](util[_0x4a66('0x1a')](_0x4a66('0x1b'),_0x45aefc[_0x4a66('0x8')]))[_0x4a66('0x1c')](_0x4a66('0x1d'),_0x45aefc);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x1489=['_rr','map','loggedIn','paused','length','chatPause','available','format','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1489,0x13f));var _0x9148=function(_0x102dc9,_0x419a5f){_0x102dc9=_0x102dc9-0x0;var _0x24f570=_0x1489[_0x102dc9];return _0x24f570;};'use strict';var _=require(_0x9148('0x0'));var md5=require(_0x9148('0x1'));var util=require(_0x9148('0x2'));var Redis=require('ioredis');var config=require(_0x9148('0x3'));config[_0x9148('0x4')]=_[_0x9148('0x5')](config[_0x9148('0x4')],{'host':_0x9148('0x6'),'port':0x18eb});var io=require(_0x9148('0x7'))(new Redis(config[_0x9148('0x4')]));function ChatQueue(_0x86e7e){this['id']=_0x86e7e['id']||0x0;this['name']=_0x86e7e[_0x9148('0x8')]||'';this[_0x9148('0x9')]=_0x86e7e['timeout']||0xa;this[_0x9148('0xa')]=_0x86e7e[_0x9148('0xa')]||'beepall';this[_0x9148('0xb')]=_0x86e7e[_0x9148('0xb')];this['mapAgentsId']={};this[_0x9148('0xc')]=0x0;this[_0x9148('0x1')]='';this[_0x9148('0xd')]();this[_0x9148('0xe')]();}ChatQueue[_0x9148('0xf')][_0x9148('0xd')]=function(){var _0x47c758=this[_0x9148('0x10')][_0x9148('0x11')];this[_0x9148('0x10')]=_[_0x9148('0x12')](this[_0x9148('0xb')],'id');this[_0x9148('0x10')][_0x9148('0x11')]=_0x47c758;};ChatQueue[_0x9148('0xf')][_0x9148('0xe')]=function(){this[_0x9148('0x13')]=0x0;this[_0x9148('0x14')]=0x0;for(var _0x146f88=0x0;_0x146f88=0x0?this[_0x9148('0x17')]:0x0;var _0x1458cd={'id':this['id'],'available':this[_0x9148('0x17')],'loggedIn':this[_0x9148('0x13')],'name':this[_0x9148('0x8')],'paused':this[_0x9148('0x14')],'waiting':this[_0x9148('0xc')]};var _0x1cbd79=md5(JSON['stringify'](_0x1458cd));if(this[_0x9148('0x1')]!==_0x1cbd79){this[_0x9148('0x1')]=_0x1cbd79;io['to'](util[_0x9148('0x18')]('chat:queue:%s',_0x1458cd[_0x9148('0x8')]))[_0x9148('0x19')](_0x9148('0x1a'),_0x1458cd);}};module[_0x9148('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index ab67aa8..f55cfd0 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 _0x084d=['prototype','updateRouting','mapAgentsId','map','_rr','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRealtime'];(function(_0x35b07d,_0x3d0ae7){var _0x2868bc=function(_0xd8ef42){while(--_0xd8ef42){_0x35b07d['push'](_0x35b07d['shift']());}};_0x2868bc(++_0x3d0ae7);}(_0x084d,0x67));var _0xd084=function(_0x39c474,_0x3ba182){_0x39c474=_0x39c474-0x0;var _0x4ce6db=_0x084d[_0x39c474];return _0x4ce6db;};'use strict';var _=require('lodash');var md5=require(_0xd084('0x0'));var util=require('util');var Redis=require(_0xd084('0x1'));var config=require(_0xd084('0x2'));config['redis']=_[_0xd084('0x3')](config[_0xd084('0x4')],{'host':_0xd084('0x5'),'port':0x18eb});var io=require(_0xd084('0x6'))(new Redis(config[_0xd084('0x4')]));function FaxQueue(_0x5a6e0){this['id']=_0x5a6e0['id']||0x0;this[_0xd084('0x7')]=_0x5a6e0['name']||'';this[_0xd084('0x8')]=_0x5a6e0[_0xd084('0x8')]||0xa;this[_0xd084('0x9')]=_0x5a6e0[_0xd084('0x9')]||'beepall';this[_0xd084('0xa')]=_0x5a6e0[_0xd084('0xa')];this['mapAgentsId']={};this[_0xd084('0xb')]=0x0;this[_0xd084('0x0')]='';this['updateRouting']();this[_0xd084('0xc')]();}FaxQueue[_0xd084('0xd')][_0xd084('0xe')]=function(){var _0xdaca78=this[_0xd084('0xf')]['_rr'];this[_0xd084('0xf')]=_[_0xd084('0x10')](this['Agents'],'id');this[_0xd084('0xf')][_0xd084('0x11')]=_0xdaca78;};FaxQueue[_0xd084('0xd')][_0xd084('0xc')]=function(){this[_0xd084('0x12')]=0x0;this[_0xd084('0x13')]=0x0;for(var _0x2e496f=0x0;_0x2e496f=0x0?this['available']:0x0;var _0x488397={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd084('0x12')],'name':this[_0xd084('0x7')],'paused':this[_0xd084('0x13')],'waiting':this[_0xd084('0xb')]};var _0x522132=md5(JSON[_0xd084('0x18')](_0x488397));if(this[_0xd084('0x0')]!==_0x522132){this['md5']=_0x522132;io['to'](util['format'](_0xd084('0x19'),_0x488397[_0xd084('0x7')]))[_0xd084('0x1a')](_0xd084('0x1b'),_0x488397);}};module[_0xd084('0x1c')]=FaxQueue; \ No newline at end of file +var _0xc31d=['faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','prototype','_rr','map','updateRealtime','loggedIn','paused','online'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xc31d,0x93));var _0xdc31=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xc31d[_0x5d88c0];return _0x1b40f0;};'use strict';var _=require(_0xdc31('0x0'));var md5=require(_0xdc31('0x1'));var util=require(_0xdc31('0x2'));var Redis=require(_0xdc31('0x3'));var config=require(_0xdc31('0x4'));config[_0xdc31('0x5')]=_[_0xdc31('0x6')](config[_0xdc31('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xdc31('0x7'))(new Redis(config[_0xdc31('0x5')]));function FaxQueue(_0x566ee1){this['id']=_0x566ee1['id']||0x0;this['name']=_0x566ee1[_0xdc31('0x8')]||'';this['timeout']=_0x566ee1['timeout']||0xa;this[_0xdc31('0x9')]=_0x566ee1[_0xdc31('0x9')]||_0xdc31('0xa');this[_0xdc31('0xb')]=_0x566ee1[_0xdc31('0xb')];this[_0xdc31('0xc')]={};this[_0xdc31('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xdc31('0xe')]['updateRouting']=function(){var _0x3559ff=this[_0xdc31('0xc')][_0xdc31('0xf')];this[_0xdc31('0xc')]=_[_0xdc31('0x10')](this[_0xdc31('0xb')],'id');this[_0xdc31('0xc')][_0xdc31('0xf')]=_0x3559ff;};FaxQueue[_0xdc31('0xe')][_0xdc31('0x11')]=function(){this[_0xdc31('0x12')]=0x0;this[_0xdc31('0x13')]=0x0;for(var _0xc1b78=0x0;_0xc1b78=0x0?this['available']:0x0;var _0x37af5c={'id':this['id'],'available':this[_0xdc31('0x16')],'loggedIn':this[_0xdc31('0x12')],'name':this[_0xdc31('0x8')],'paused':this[_0xdc31('0x13')],'waiting':this[_0xdc31('0xd')]};var _0x1c0f51=md5(JSON[_0xdc31('0x17')](_0x37af5c));if(this[_0xdc31('0x1')]!==_0x1c0f51){this[_0xdc31('0x1')]=_0x1c0f51;io['to'](util[_0xdc31('0x18')](_0xdc31('0x19'),_0x37af5c[_0xdc31('0x8')]))['emit'](_0xdc31('0x1a'),_0x37af5c);}};module[_0xdc31('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index a7fa4d9..a46e607 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 _0x80bd=['name','Intervals','exports'];(function(_0x2a7c9d,_0x5af019){var _0x294b9b=function(_0x3bf1a7){while(--_0x3bf1a7){_0x2a7c9d['push'](_0x2a7c9d['shift']());}};_0x294b9b(++_0x5af019);}(_0x80bd,0x1bf));var _0xd80b=function(_0x4a0e29,_0x22ec81){_0x4a0e29=_0x4a0e29-0x0;var _0x468f89=_0x80bd[_0x4a0e29];return _0x468f89;};'use strict';function Interval(_0x3bbc42){this['id']=_0x3bbc42['id']||0x0;this['name']=_0x3bbc42[_0xd80b('0x0')]||'';this[_0xd80b('0x1')]=_0x3bbc42[_0xd80b('0x1')]||{};}module[_0xd80b('0x2')]=Interval; \ No newline at end of file +var _0x966f=['exports','name','Intervals'];(function(_0x224067,_0x401dbf){var _0x1c1dfd=function(_0x4ba655){while(--_0x4ba655){_0x224067['push'](_0x224067['shift']());}};_0x1c1dfd(++_0x401dbf);}(_0x966f,0x178));var _0xf966=function(_0xc7648d,_0x497ba2){_0xc7648d=_0xc7648d-0x0;var _0x2594d2=_0x966f[_0xc7648d];return _0x2594d2;};'use strict';function Interval(_0x369618){this['id']=_0x369618['id']||0x0;this[_0xf966('0x0')]=_0x369618['name']||'';this['Intervals']=_0x369618[_0xf966('0x1')]||{};}module[_0xf966('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 c153274..12ed56f 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 _0x19a7=['mail_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit'];(function(_0x19c57a,_0x5c9c7c){var _0x576a08=function(_0x929c62){while(--_0x929c62){_0x19c57a['push'](_0x19c57a['shift']());}};_0x576a08(++_0x5c9c7c);}(_0x19a7,0x92));var _0x719a=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x19a7[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0x719a('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x719a('0x1'));var config=require(_0x719a('0x2'));config[_0x719a('0x3')]=_[_0x719a('0x4')](config['redis'],{'host':_0x719a('0x5'),'port':0x18eb});var io=require(_0x719a('0x6'))(new Redis(config['redis']));function MailQueue(_0x228a27){this['id']=_0x228a27['id']||0x0;this[_0x719a('0x7')]=_0x228a27[_0x719a('0x7')]||'';this[_0x719a('0x8')]=_0x228a27[_0x719a('0x8')]||0xa;this[_0x719a('0x9')]=_0x228a27[_0x719a('0x9')]||'beepall';this[_0x719a('0xa')]=_0x228a27[_0x719a('0xa')];this[_0x719a('0xb')]={};this[_0x719a('0xc')]=0x0;this[_0x719a('0xd')]='';this[_0x719a('0xe')]();this[_0x719a('0xf')]();}MailQueue[_0x719a('0x10')][_0x719a('0xe')]=function(){var _0x46d11b=this['mapAgentsId'][_0x719a('0x11')];this[_0x719a('0xb')]=_[_0x719a('0x12')](this[_0x719a('0xa')],'id');this[_0x719a('0xb')][_0x719a('0x11')]=_0x46d11b;};MailQueue[_0x719a('0x10')][_0x719a('0xf')]=function(){this[_0x719a('0x13')]=0x0;this[_0x719a('0x14')]=0x0;for(var _0x4bc6a5=0x0;_0x4bc6a5=0x0?this[_0x719a('0x17')]:0x0;var _0x57a323={'id':this['id'],'available':this[_0x719a('0x17')],'loggedIn':this[_0x719a('0x13')],'name':this[_0x719a('0x7')],'paused':this['paused'],'waiting':this[_0x719a('0xc')]};var _0x5ebff2=md5(JSON[_0x719a('0x18')](_0x57a323));if(this['md5']!==_0x5ebff2){this[_0x719a('0xd')]=_0x5ebff2;io['to'](util[_0x719a('0x19')](_0x719a('0x1a'),_0x57a323['name']))[_0x719a('0x1b')](_0x719a('0x1c'),_0x57a323);}};module['exports']=MailQueue; \ No newline at end of file +var _0x8cd9=['emit','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr','paused','length','online','loggedIn','available','waiting','format'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8cd9,0x1a3));var _0x98cd=function(_0x4fa421,_0x2b395d){_0x4fa421=_0x4fa421-0x0;var _0x3cf06f=_0x8cd9[_0x4fa421];return _0x3cf06f;};'use strict';var _=require(_0x98cd('0x0'));var md5=require(_0x98cd('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x98cd('0x2'));config[_0x98cd('0x3')]=_[_0x98cd('0x4')](config[_0x98cd('0x3')],{'host':_0x98cd('0x5'),'port':0x18eb});var io=require(_0x98cd('0x6'))(new Redis(config['redis']));function MailQueue(_0x1a83a1){this['id']=_0x1a83a1['id']||0x0;this[_0x98cd('0x7')]=_0x1a83a1[_0x98cd('0x7')]||'';this[_0x98cd('0x8')]=_0x1a83a1['timeout']||0xa;this['strategy']=_0x1a83a1['strategy']||'beepall';this[_0x98cd('0x9')]=_0x1a83a1['Agents'];this[_0x98cd('0xa')]={};this['waiting']=0x0;this[_0x98cd('0x1')]='';this['updateRouting']();this[_0x98cd('0xb')]();}MailQueue[_0x98cd('0xc')][_0x98cd('0xd')]=function(){var _0x39e31e=this['mapAgentsId']['_rr'];this[_0x98cd('0xa')]=_[_0x98cd('0xe')](this[_0x98cd('0x9')],'id');this[_0x98cd('0xa')][_0x98cd('0xf')]=_0x39e31e;};MailQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x98cd('0x10')]=0x0;for(var _0x5dfd93=0x0;_0x5dfd93=0x0?this['available']:0x0;var _0xf08c05={'id':this['id'],'available':this[_0x98cd('0x14')],'loggedIn':this[_0x98cd('0x13')],'name':this[_0x98cd('0x7')],'paused':this['paused'],'waiting':this[_0x98cd('0x15')]};var _0x297522=md5(JSON['stringify'](_0xf08c05));if(this[_0x98cd('0x1')]!==_0x297522){this[_0x98cd('0x1')]=_0x297522;io['to'](util[_0x98cd('0x16')]('mail:queue:%s',_0xf08c05['name']))[_0x98cd('0x17')](_0x98cd('0x18'),_0xf08c05);}};module[_0x98cd('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 35bb42e..90dbfc2 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(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x1261,0x144));var _0x1126=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x1261[_0x3dfea6];return _0x567aca;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('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 8c53f23..2e59b17 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 _0x9b67=['redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x3db75a,_0xaf6f8d){var _0x10d96d=function(_0x2ee206){while(--_0x2ee206){_0x3db75a['push'](_0x3db75a['shift']());}};_0x10d96d(++_0xaf6f8d);}(_0x9b67,0xf6));var _0x79b6=function(_0x546256,_0x87208){_0x546256=_0x546256-0x0;var _0x40eb74=_0x9b67[_0x546256];return _0x40eb74;};'use strict';var _=require(_0x79b6('0x0'));var md5=require(_0x79b6('0x1'));var util=require(_0x79b6('0x2'));var Redis=require(_0x79b6('0x3'));var config=require(_0x79b6('0x4'));config['redis']=_[_0x79b6('0x5')](config[_0x79b6('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x79b6('0x6')]));function SmsQueue(_0x174768){this['id']=_0x174768['id']||0x0;this[_0x79b6('0x7')]=_0x174768[_0x79b6('0x7')]||'';this[_0x79b6('0x8')]=_0x174768[_0x79b6('0x8')]||0xa;this[_0x79b6('0x9')]=_0x174768['strategy']||_0x79b6('0xa');this[_0x79b6('0xb')]=_0x174768[_0x79b6('0xb')];this[_0x79b6('0xc')]={};this[_0x79b6('0xd')]=0x0;this['md5']='';this[_0x79b6('0xe')]();this[_0x79b6('0xf')]();}SmsQueue[_0x79b6('0x10')][_0x79b6('0xe')]=function(){var _0x58a98b=this['mapAgentsId'][_0x79b6('0x11')];this[_0x79b6('0xc')]=_[_0x79b6('0x12')](this['Agents'],'id');this[_0x79b6('0xc')][_0x79b6('0x11')]=_0x58a98b;};SmsQueue[_0x79b6('0x10')][_0x79b6('0xf')]=function(){this[_0x79b6('0x13')]=0x0;this[_0x79b6('0x14')]=0x0;for(var _0x19d5b2=0x0;_0x19d5b2=0x0?this[_0x79b6('0x17')]:0x0;var _0x3123b8={'id':this['id'],'available':this[_0x79b6('0x17')],'loggedIn':this[_0x79b6('0x13')],'name':this[_0x79b6('0x7')],'paused':this[_0x79b6('0x14')],'waiting':this[_0x79b6('0xd')]};var _0x52a70f=md5(JSON[_0x79b6('0x18')](_0x3123b8));if(this['md5']!==_0x52a70f){this[_0x79b6('0x1')]=_0x52a70f;io['to'](util['format'](_0x79b6('0x19'),_0x3123b8[_0x79b6('0x7')]))[_0x79b6('0x1a')]('sms_queue:save',_0x3123b8);}};module[_0x79b6('0x1b')]=SmsQueue; \ No newline at end of file +var _0xf403=['sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','length','online','smsPause','paused','available','md5','format'];(function(_0x5c0cb5,_0x19d413){var _0x15952e=function(_0x124a97){while(--_0x124a97){_0x5c0cb5['push'](_0x5c0cb5['shift']());}};_0x15952e(++_0x19d413);}(_0xf403,0x1d3));var _0x3f40=function(_0x36a474,_0x5475ff){_0x36a474=_0x36a474-0x0;var _0x401139=_0xf403[_0x36a474];return _0x401139;};'use strict';var _=require(_0x3f40('0x0'));var md5=require('md5');var util=require(_0x3f40('0x1'));var Redis=require(_0x3f40('0x2'));var config=require(_0x3f40('0x3'));config[_0x3f40('0x4')]=_[_0x3f40('0x5')](config[_0x3f40('0x4')],{'host':_0x3f40('0x6'),'port':0x18eb});var io=require(_0x3f40('0x7'))(new Redis(config['redis']));function SmsQueue(_0x4e91bb){this['id']=_0x4e91bb['id']||0x0;this[_0x3f40('0x8')]=_0x4e91bb[_0x3f40('0x8')]||'';this[_0x3f40('0x9')]=_0x4e91bb[_0x3f40('0x9')]||0xa;this['strategy']=_0x4e91bb[_0x3f40('0xa')]||'beepall';this['Agents']=_0x4e91bb[_0x3f40('0xb')];this[_0x3f40('0xc')]={};this[_0x3f40('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x3f40('0xe')]();}SmsQueue[_0x3f40('0xf')][_0x3f40('0x10')]=function(){var _0x4e30e2=this[_0x3f40('0xc')][_0x3f40('0x11')];this[_0x3f40('0xc')]=_['map'](this[_0x3f40('0xb')],'id');this['mapAgentsId'][_0x3f40('0x11')]=_0x4e30e2;};SmsQueue[_0x3f40('0xf')][_0x3f40('0xe')]=function(){this[_0x3f40('0x12')]=0x0;this['paused']=0x0;for(var _0x2b2bfe=0x0;_0x2b2bfe=0x0?this[_0x3f40('0x17')]:0x0;var _0x374644={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3f40('0x12')],'name':this[_0x3f40('0x8')],'paused':this[_0x3f40('0x16')],'waiting':this[_0x3f40('0xd')]};var _0x3129e2=md5(JSON['stringify'](_0x374644));if(this[_0x3f40('0x18')]!==_0x3129e2){this['md5']=_0x3129e2;io['to'](util[_0x3f40('0x19')](_0x3f40('0x1a'),_0x374644[_0x3f40('0x8')]))[_0x3f40('0x1b')](_0x3f40('0x1c'),_0x374644);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4efa242..b6cb992 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 _0x23d9=['updateRealtime','prototype','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x23d9,0x13b));var _0x923d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x923d('0x0'));var md5=require(_0x923d('0x1'));var util=require(_0x923d('0x2'));var Redis=require(_0x923d('0x3'));var config=require(_0x923d('0x4'));config['redis']=_[_0x923d('0x5')](config[_0x923d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x923d('0x7'))(new Redis(config[_0x923d('0x6')]));function WhatsappQueue(_0x57bb3e){this['id']=_0x57bb3e['id']||0x0;this['name']=_0x57bb3e[_0x923d('0x8')]||'';this['timeout']=_0x57bb3e[_0x923d('0x9')]||0xa;this[_0x923d('0xa')]=_0x57bb3e[_0x923d('0xa')]||_0x923d('0xb');this[_0x923d('0xc')]=_0x57bb3e['Agents'];this[_0x923d('0xd')]={};this[_0x923d('0xe')]=0x0;this[_0x923d('0x1')]='';this['updateRouting']();this[_0x923d('0xf')]();}WhatsappQueue[_0x923d('0x10')]['updateRouting']=function(){var _0x5d2c1b=this[_0x923d('0xd')]['_rr'];this[_0x923d('0xd')]=_['map'](this[_0x923d('0xc')],'id');this[_0x923d('0xd')][_0x923d('0x11')]=_0x5d2c1b;};WhatsappQueue['prototype'][_0x923d('0xf')]=function(){this[_0x923d('0x12')]=0x0;this[_0x923d('0x13')]=0x0;for(var _0x28e4b5=0x0;_0x28e4b5=0x0?this[_0x923d('0x17')]:0x0;var _0x8732b9={'id':this['id'],'available':this[_0x923d('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x923d('0x8')],'paused':this['paused'],'waiting':this[_0x923d('0xe')]};var _0x55b550=md5(JSON[_0x923d('0x18')](_0x8732b9));if(this[_0x923d('0x1')]!==_0x55b550){this[_0x923d('0x1')]=_0x55b550;io['to'](util[_0x923d('0x19')](_0x923d('0x1a'),_0x8732b9['name']))[_0x923d('0x1b')](_0x923d('0x1c'),_0x8732b9);}};module[_0x923d('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x4096=['localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis'];(function(_0x4f3ee5,_0x38db22){var _0x5280c7=function(_0x43a850){while(--_0x43a850){_0x4f3ee5['push'](_0x4f3ee5['shift']());}};_0x5280c7(++_0x38db22);}(_0x4096,0x161));var _0x6409=function(_0x45ba20,_0x3062f9){_0x45ba20=_0x45ba20-0x0;var _0x8cff45=_0x4096[_0x45ba20];return _0x8cff45;};'use strict';var _=require(_0x6409('0x0'));var md5=require(_0x6409('0x1'));var util=require(_0x6409('0x2'));var Redis=require(_0x6409('0x3'));var config=require(_0x6409('0x4'));config['redis']=_[_0x6409('0x5')](config[_0x6409('0x6')],{'host':_0x6409('0x7'),'port':0x18eb});var io=require(_0x6409('0x8'))(new Redis(config[_0x6409('0x6')]));function WhatsappQueue(_0x36f511){this['id']=_0x36f511['id']||0x0;this['name']=_0x36f511[_0x6409('0x9')]||'';this[_0x6409('0xa')]=_0x36f511['timeout']||0xa;this['strategy']=_0x36f511[_0x6409('0xb')]||'beepall';this[_0x6409('0xc')]=_0x36f511[_0x6409('0xc')];this['mapAgentsId']={};this[_0x6409('0xd')]=0x0;this[_0x6409('0x1')]='';this[_0x6409('0xe')]();this[_0x6409('0xf')]();}WhatsappQueue[_0x6409('0x10')][_0x6409('0xe')]=function(){var _0x1b1e43=this[_0x6409('0x11')][_0x6409('0x12')];this[_0x6409('0x11')]=_[_0x6409('0x13')](this[_0x6409('0xc')],'id');this['mapAgentsId'][_0x6409('0x12')]=_0x1b1e43;};WhatsappQueue['prototype'][_0x6409('0xf')]=function(){this[_0x6409('0x14')]=0x0;this[_0x6409('0x15')]=0x0;for(var _0x10ec73=0x0;_0x10ec73=0x0?this[_0x6409('0x19')]:0x0;var _0x1ea9fd={'id':this['id'],'available':this[_0x6409('0x19')],'loggedIn':this[_0x6409('0x14')],'name':this[_0x6409('0x9')],'paused':this[_0x6409('0x15')],'waiting':this[_0x6409('0xd')]};var _0x2332e9=md5(JSON[_0x6409('0x1a')](_0x1ea9fd));if(this[_0x6409('0x1')]!==_0x2332e9){this[_0x6409('0x1')]=_0x2332e9;io['to'](util['format'](_0x6409('0x1b'),_0x1ea9fd[_0x6409('0x9')]))[_0x6409('0x1c')](_0x6409('0x1d'),_0x1ea9fd);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 8f8ad69..f83ca2b 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3b73fa,_0x63edc5){var _0x488e4b=function(_0x3a45e3){while(--_0x3a45e3){_0x3b73fa['push'](_0x3b73fa['shift']());}};_0x488e4b(++_0x63edc5);}(_0xb10b,0x12a));var _0xbb10=function(_0x24c39a,_0x48fc91){_0x24c39a=_0x24c39a-0x0;var _0x4c2fa6=_0xb10b[_0x24c39a];return _0x4c2fa6;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3c3136,_0x57ca26){var _0x1ecd6d=function(_0x48a627){while(--_0x48a627){_0x3c3136['push'](_0x3c3136['shift']());}};_0x1ecd6d(++_0x57ca26);}(_0xb10b,0x12a));var _0xbb10=function(_0x1abbaa,_0x1b7a38){_0x1abbaa=_0x1abbaa-0x0;var _0x40ed52=_0xb10b[_0x1abbaa];return _0x40ed52;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 9bf8ff0..8b83791 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 _0xbe94=['../client','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x78e522,_0x37c539){var _0x4a170d=function(_0x2ef664){while(--_0x2ef664){_0x78e522['push'](_0x78e522['shift']());}};_0x4a170d(++_0x37c539);}(_0xbe94,0xb6));var _0x4be9=function(_0x2109ff,_0x59366e){_0x2109ff=_0x2109ff-0x0;var _0x1b22e6=_0xbe94[_0x2109ff];return _0x1b22e6;};'use strict';var client=require(_0x4be9('0x0'));exports[_0x4be9('0x1')]=function(_0x1c72ee,_0x2ce900){return client['Request'](_0x4be9('0x2'),{'body':_0x2ce900,'options':{'where':{'id':_0x1c72ee}},'log':_0x4be9('0x3')});};exports[_0x4be9('0x4')]=function(_0x47927d,_0x58df5d){return client[_0x4be9('0x5')]('AddTagsToChatInteraction',{'body':_0x58df5d,'options':{'where':{'id':_0x47927d}},'log':_0x4be9('0x6')});}; \ No newline at end of file +var _0xd13d=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x431970,_0x3d390b){var _0x3a347a=function(_0x44cb66){while(--_0x44cb66){_0x431970['push'](_0x431970['shift']());}};_0x3a347a(++_0x3d390b);}(_0xd13d,0x8f));var _0xdd13=function(_0xdeb9e,_0x1b7a39){_0xdeb9e=_0xdeb9e-0x0;var _0x57b259=_0xd13d[_0xdeb9e];return _0x57b259;};'use strict';var client=require(_0xdd13('0x0'));exports[_0xdd13('0x1')]=function(_0x10f4ca,_0x179360){return client[_0xdd13('0x2')](_0xdd13('0x3'),{'body':_0x179360,'options':{'where':{'id':_0x10f4ca}},'log':_0xdd13('0x4')});};exports[_0xdd13('0x5')]=function(_0x2d960a,_0x2b2b26){return client['Request'](_0xdd13('0x6'),{'body':_0x2b2b26,'options':{'where':{'id':_0x2d960a}},'log':_0xdd13('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index e4be8a3..daff5ee 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 _0x6957=['Request','CreateChatMessage','../client','create'];(function(_0x11ecca,_0x55ff30){var _0xfdb50d=function(_0x229ec5){while(--_0x229ec5){_0x11ecca['push'](_0x11ecca['shift']());}};_0xfdb50d(++_0x55ff30);}(_0x6957,0xaa));var _0x7695=function(_0x38f709,_0x5adf17){_0x38f709=_0x38f709-0x0;var _0x4affe0=_0x6957[_0x38f709];return _0x4affe0;};'use strict';var client=require(_0x7695('0x0'));exports[_0x7695('0x1')]=function(_0x2ae3ef){return client[_0x7695('0x2')](_0x7695('0x3'),{'body':_0x2ae3ef,'log':'createChatMessage'});}; \ No newline at end of file +var _0x1c1e=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x2fac21,_0x35d264){var _0x37fc1a=function(_0x157772){while(--_0x157772){_0x2fac21['push'](_0x2fac21['shift']());}};_0x37fc1a(++_0x35d264);}(_0x1c1e,0x87));var _0xe1c1=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x1c1e[_0x435b2f];return _0x181648;};'use strict';var client=require(_0xe1c1('0x0'));exports[_0xe1c1('0x1')]=function(_0x30daae){return client[_0xe1c1('0x2')](_0xe1c1('0x3'),{'body':_0x30daae,'log':_0xe1c1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index cea16e0..f3720d7 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 _0x0c42=['name','User','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x208c01,_0x2dd63d){var _0x54a5fc=function(_0x35120d){while(--_0x35120d){_0x208c01['push'](_0x208c01['shift']());}};_0x54a5fc(++_0x2dd63d);}(_0x0c42,0x191));var _0x20c4=function(_0x110cde,_0x1afc5f){_0x110cde=_0x110cde-0x0;var _0x53c55f=_0x0c42[_0x110cde];return _0x53c55f;};'use strict';var client=require(_0x20c4('0x0'));exports[_0x20c4('0x1')]=function(){return function(){return client[_0x20c4('0x2')](_0x20c4('0x3'),{'options':{'raw':![],'attributes':['id',_0x20c4('0x4'),'timeout','strategy'],'include':[{'model':_0x20c4('0x5'),'as':_0x20c4('0x6'),'attributes':['id',_0x20c4('0x4'),_0x20c4('0x7'),_0x20c4('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x3fa4=['../client','name','timeout','strategy','User','Agents','online','getChatQueues'];(function(_0x4fe736,_0xb0474f){var _0x2fe9c3=function(_0x10d3ad){while(--_0x10d3ad){_0x4fe736['push'](_0x4fe736['shift']());}};_0x2fe9c3(++_0xb0474f);}(_0x3fa4,0xf0));var _0x43fa=function(_0x5f4c50,_0x1f96ef){_0x5f4c50=_0x5f4c50-0x0;var _0x41adf6=_0x3fa4[_0x5f4c50];return _0x41adf6;};'use strict';var client=require(_0x43fa('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x43fa('0x1'),_0x43fa('0x2'),_0x43fa('0x3')],'include':[{'model':_0x43fa('0x4'),'as':_0x43fa('0x5'),'attributes':['id',_0x43fa('0x1'),_0x43fa('0x6'),'chatPause']}]},'log':_0x43fa('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 328f83f..84674f9 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 _0x8c25=['../client','create','Request','CreateChatQueueReport','DESC'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x8c25,0x15e));var _0x58c2=function(_0x3b3931,_0x2aa0c1){_0x3b3931=_0x3b3931-0x0;var _0x9747e0=_0x8c25[_0x3b3931];return _0x9747e0;};'use strict';var client=require(_0x58c2('0x0'));exports[_0x58c2('0x1')]=function(_0x2c2f26){return client[_0x58c2('0x2')](_0x58c2('0x3'),{'body':_0x2c2f26,'log':_0x58c2('0x3')});};exports['update']=function(_0x2808d9,_0x4b834a){return client['Request']('UpdateChatQueueReport',{'body':_0x4b834a,'options':{'where':{'uniqueid':_0x2808d9},'order':[['id',_0x58c2('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x6f7f=['create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x54c805,_0xdb4a71){var _0x29ee73=function(_0x40bc17){while(--_0x40bc17){_0x54c805['push'](_0x54c805['shift']());}};_0x29ee73(++_0xdb4a71);}(_0x6f7f,0x177));var _0xf6f7=function(_0x42a263,_0x5ebe85){_0x42a263=_0x42a263-0x0;var _0x212dfa=_0x6f7f[_0x42a263];return _0x212dfa;};'use strict';var client=require('../client');exports[_0xf6f7('0x0')]=function(_0x2d025d){return client[_0xf6f7('0x1')](_0xf6f7('0x2'),{'body':_0x2d025d,'log':_0xf6f7('0x2')});};exports['update']=function(_0x1933e9,_0x52ca83){return client[_0xf6f7('0x1')](_0xf6f7('0x3'),{'body':_0x52ca83,'options':{'where':{'uniqueid':_0x1933e9},'order':[['id',_0xf6f7('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b8ae80e..1a4abba 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(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0x7a54,0x106));var _0x47a5=function(_0x40680d,_0x4f1bfb){_0x40680d=_0x40680d-0x0;var _0x4cfbc2=_0x7a54[_0x40680d];return _0x4cfbc2;};'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(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0x7a54,0x106));var _0x47a5=function(_0x304c76,_0x18e881){_0x304c76=_0x304c76-0x0;var _0x1a160b=_0x7a54[_0x304c76];return _0x1a160b;};'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 9d9918d..f588d61 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 _0x06fb=['Request','createFaxMessage','../client','create'];(function(_0x1a7e4b,_0x2fbd40){var _0x37a8fd=function(_0x4eaa73){while(--_0x4eaa73){_0x1a7e4b['push'](_0x1a7e4b['shift']());}};_0x37a8fd(++_0x2fbd40);}(_0x06fb,0x112));var _0xb06f=function(_0x42cd08,_0x2467dd){_0x42cd08=_0x42cd08-0x0;var _0x2ed9a7=_0x06fb[_0x42cd08];return _0x2ed9a7;};'use strict';var client=require(_0xb06f('0x0'));exports[_0xb06f('0x1')]=function(_0x3c1929){return client[_0xb06f('0x2')]('CreateFaxMessage',{'body':_0x3c1929,'log':_0xb06f('0x3')});}; \ No newline at end of file +var _0xfb03=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0xfb03,0xe4));var _0x3fb0=function(_0x29b118,_0x426f51){_0x29b118=_0x29b118-0x0;var _0x4e8622=_0xfb03[_0x29b118];return _0x4e8622;};'use strict';var client=require(_0x3fb0('0x0'));exports[_0x3fb0('0x1')]=function(_0x151498){return client[_0x3fb0('0x2')](_0x3fb0('0x3'),{'body':_0x151498,'log':_0x3fb0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index b4e42d0..4ee56ec 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 _0xd15e=['getFaxQueues','Request','GetFaxQueue','name','strategy','User','faxPause'];(function(_0x4fb51c,_0x4a4b6b){var _0x217373=function(_0x6e11d5){while(--_0x6e11d5){_0x4fb51c['push'](_0x4fb51c['shift']());}};_0x217373(++_0x4a4b6b);}(_0xd15e,0x1e3));var _0xed15=function(_0x5ba6d4,_0x5913d6){_0x5ba6d4=_0x5ba6d4-0x0;var _0x5af907=_0xd15e[_0x5ba6d4];return _0x5af907;};'use strict';var client=require('../client');exports[_0xed15('0x0')]=function(){return function(){return client[_0xed15('0x1')](_0xed15('0x2'),{'options':{'raw':![],'attributes':['id',_0xed15('0x3'),'timeout',_0xed15('0x4')],'include':[{'model':_0xed15('0x5'),'as':'Agents','attributes':['id',_0xed15('0x3'),'online',_0xed15('0x6')]}]},'log':_0xed15('0x0')});};}; \ No newline at end of file +var _0x28b3=['getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0xf9794a,_0x1c7a40){var _0x220483=function(_0x4d3ef6){while(--_0x4d3ef6){_0xf9794a['push'](_0xf9794a['shift']());}};_0x220483(++_0x1c7a40);}(_0x28b3,0x167));var _0x328b=function(_0x310c8a,_0x24b154){_0x310c8a=_0x310c8a-0x0;var _0x25a984=_0x28b3[_0x310c8a];return _0x25a984;};'use strict';var client=require(_0x328b('0x0'));exports[_0x328b('0x1')]=function(){return function(){return client[_0x328b('0x2')](_0x328b('0x3'),{'options':{'raw':![],'attributes':['id',_0x328b('0x4'),_0x328b('0x5'),_0x328b('0x6')],'include':[{'model':_0x328b('0x7'),'as':_0x328b('0x8'),'attributes':['id',_0x328b('0x4'),_0x328b('0x9'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 7784f36..3052061 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 _0x9096=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x28f982,_0x3d108c){var _0x4dfb7e=function(_0x54a345){while(--_0x54a345){_0x28f982['push'](_0x28f982['shift']());}};_0x4dfb7e(++_0x3d108c);}(_0x9096,0x117));var _0x6909=function(_0x6158cf,_0x58bbbc){_0x6158cf=_0x6158cf-0x0;var _0xe2accf=_0x9096[_0x6158cf];return _0xe2accf;};'use strict';var client=require(_0x6909('0x0'));exports[_0x6909('0x1')]=function(_0x54fcb1){return client[_0x6909('0x2')](_0x6909('0x3'),{'body':_0x54fcb1,'log':_0x6909('0x3')});};exports[_0x6909('0x4')]=function(_0x383821,_0x40fc90){return client[_0x6909('0x2')](_0x6909('0x5'),{'body':_0x40fc90,'options':{'where':{'uniqueid':_0x383821},'order':[['id',_0x6909('0x6')]],'limit':0x1},'log':_0x6909('0x5')});}; \ No newline at end of file +var _0x1cdf=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x15c336,_0x26ccbb){var _0x1196e0=function(_0x41d284){while(--_0x41d284){_0x15c336['push'](_0x15c336['shift']());}};_0x1196e0(++_0x26ccbb);}(_0x1cdf,0xc7));var _0xf1cd=function(_0x104f85,_0x5368d3){_0x104f85=_0x104f85-0x0;var _0xa8036b=_0x1cdf[_0x104f85];return _0xa8036b;};'use strict';var client=require(_0xf1cd('0x0'));exports['create']=function(_0x270b32){return client['Request'](_0xf1cd('0x1'),{'body':_0x270b32,'log':_0xf1cd('0x1')});};exports['update']=function(_0x4a7ac1,_0x45e76e){return client['Request'](_0xf1cd('0x2'),{'body':_0x45e76e,'options':{'where':{'uniqueid':_0x4a7ac1},'order':[['id',_0xf1cd('0x3')]],'limit':0x1},'log':_0xf1cd('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9c20ce9..a049c1d 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 _0x3999=['Intervals','interval','../client','getIntervals','name','Interval'];(function(_0xa38daf,_0x30406b){var _0x1b786a=function(_0x375bfd){while(--_0x375bfd){_0xa38daf['push'](_0xa38daf['shift']());}};_0x1b786a(++_0x30406b);}(_0x3999,0x12e));var _0x9399=function(_0xf3578c,_0x58f9aa){_0xf3578c=_0xf3578c-0x0;var _0x3a7275=_0x3999[_0xf3578c];return _0x3a7275;};'use strict';var client=require(_0x9399('0x0'));exports[_0x9399('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9399('0x2')],'include':[{'model':_0x9399('0x3'),'as':_0x9399('0x4'),'attributes':['id',_0x9399('0x2'),_0x9399('0x5')]}]},'log':_0x9399('0x1')});};}; \ No newline at end of file +var _0x7ed2=['../client','Request','GetInterval','name','Intervals','interval'];(function(_0xdbdb5f,_0x10f18b){var _0x4dfa9d=function(_0x20ce9c){while(--_0x20ce9c){_0xdbdb5f['push'](_0xdbdb5f['shift']());}};_0x4dfa9d(++_0x10f18b);}(_0x7ed2,0x1d4));var _0x27ed=function(_0x3503ca,_0x32bb78){_0x3503ca=_0x3503ca-0x0;var _0x593ae5=_0x7ed2[_0x3503ca];return _0x593ae5;};'use strict';var client=require(_0x27ed('0x0'));exports['getIntervals']=function(){return function(){return client[_0x27ed('0x1')](_0x27ed('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x27ed('0x3')],'include':[{'model':'Interval','as':_0x27ed('0x4'),'attributes':['id','name',_0x27ed('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b6b7937..b13495d 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 _0x77e6=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0x77e6,0x1a6));var _0x677e=function(_0xc1d5dd,_0x43ff14){_0xc1d5dd=_0xc1d5dd-0x0;var _0x1f2db2=_0x77e6[_0xc1d5dd];return _0x1f2db2;};'use strict';var client=require(_0x677e('0x0'));exports[_0x677e('0x1')]=function(_0x3855c7,_0xa48f0c){return client[_0x677e('0x2')](_0x677e('0x3'),{'body':_0xa48f0c,'options':{'where':{'id':_0x3855c7}},'log':_0x677e('0x4')});};exports[_0x677e('0x5')]=function(_0x50231c,_0x2f0307){return client[_0x677e('0x2')]('AddTagsToMailInteraction',{'body':_0x2f0307,'options':{'where':{'id':_0x50231c}},'log':_0x677e('0x6')});}; \ No newline at end of file +var _0x2da6=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x38ad8e,_0x33ebc2){var _0xe17df5=function(_0x235752){while(--_0x235752){_0x38ad8e['push'](_0x38ad8e['shift']());}};_0xe17df5(++_0x33ebc2);}(_0x2da6,0x1dd));var _0x62da=function(_0x4ff00d,_0x2e42ec){_0x4ff00d=_0x4ff00d-0x0;var _0x36f3cd=_0x2da6[_0x4ff00d];return _0x36f3cd;};'use strict';var client=require(_0x62da('0x0'));exports[_0x62da('0x1')]=function(_0x1d3698,_0xbbb39b){return client[_0x62da('0x2')](_0x62da('0x3'),{'body':_0xbbb39b,'options':{'where':{'id':_0x1d3698}},'log':_0x62da('0x4')});};exports[_0x62da('0x5')]=function(_0x4c079d,_0x4a8428){return client[_0x62da('0x2')](_0x62da('0x6'),{'body':_0x4a8428,'options':{'where':{'id':_0x4c079d}},'log':_0x62da('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 222abc3..19d4db2 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 _0x1ce2=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x5dca2b,_0x156511){var _0x22aab=function(_0x3eedcc){while(--_0x3eedcc){_0x5dca2b['push'](_0x5dca2b['shift']());}};_0x22aab(++_0x156511);}(_0x1ce2,0x77));var _0x21ce=function(_0x1f5d42,_0x1c5ece){_0x1f5d42=_0x1f5d42-0x0;var _0x1f9ebb=_0x1ce2[_0x1f5d42];return _0x1f9ebb;};'use strict';var client=require(_0x21ce('0x0'));exports[_0x21ce('0x1')]=function(_0x21b3a7){return client[_0x21ce('0x2')](_0x21ce('0x3'),{'body':_0x21b3a7,'log':_0x21ce('0x4')});}; \ No newline at end of file +var _0xed90=['createMailMessage'];(function(_0x59399a,_0x44cae6){var _0x41c108=function(_0x8fa218){while(--_0x8fa218){_0x59399a['push'](_0x59399a['shift']());}};_0x41c108(++_0x44cae6);}(_0xed90,0x97));var _0x0ed9=function(_0x101fe4,_0x3f8b9b){_0x101fe4=_0x101fe4-0x0;var _0x3f8d86=_0xed90[_0x101fe4];return _0x3f8d86;};'use strict';var client=require('../client');exports['create']=function(_0x352328){return client['Request']('CreateMailMessage',{'body':_0x352328,'log':_0x0ed9('0x0')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 58d5eb5..aab81b4 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 _0x92dd=['timeout','Agents','../client','Request','GetMailQueue','name'];(function(_0x3bab53,_0x46230f){var _0x1a969e=function(_0x15ecb1){while(--_0x15ecb1){_0x3bab53['push'](_0x3bab53['shift']());}};_0x1a969e(++_0x46230f);}(_0x92dd,0xbc));var _0xd92d=function(_0x4321a0,_0x1f0ee5){_0x4321a0=_0x4321a0-0x0;var _0x5d7f81=_0x92dd[_0x4321a0];return _0x5d7f81;};'use strict';var client=require(_0xd92d('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xd92d('0x1')](_0xd92d('0x2'),{'options':{'raw':![],'attributes':['id',_0xd92d('0x3'),_0xd92d('0x4'),'strategy'],'include':[{'model':'User','as':_0xd92d('0x5'),'attributes':['id',_0xd92d('0x3'),'online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xcdd3=['timeout','strategy','User','online','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x28d23b,_0x4d2b82){var _0x54a911=function(_0x192aec){while(--_0x192aec){_0x28d23b['push'](_0x28d23b['shift']());}};_0x54a911(++_0x4d2b82);}(_0xcdd3,0x109));var _0x3cdd=function(_0x3a359d,_0x23162f){_0x3a359d=_0x3a359d-0x0;var _0x459121=_0xcdd3[_0x3a359d];return _0x459121;};'use strict';var client=require(_0x3cdd('0x0'));exports[_0x3cdd('0x1')]=function(){return function(){return client[_0x3cdd('0x2')](_0x3cdd('0x3'),{'options':{'raw':![],'attributes':['id',_0x3cdd('0x4'),_0x3cdd('0x5'),_0x3cdd('0x6')],'include':[{'model':_0x3cdd('0x7'),'as':'Agents','attributes':['id','name',_0x3cdd('0x8'),'mailPause']}]},'log':_0x3cdd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index cb7e89b..fa053db 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 _0xdc5a=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc5a,0x17b));var _0xadc5=function(_0x2b3ce6,_0x2f6839){_0x2b3ce6=_0x2b3ce6-0x0;var _0x4fa551=_0xdc5a[_0x2b3ce6];return _0x4fa551;};'use strict';var client=require(_0xadc5('0x0'));exports[_0xadc5('0x1')]=function(_0x52c2ae){return client[_0xadc5('0x2')](_0xadc5('0x3'),{'body':_0x52c2ae,'log':_0xadc5('0x3')});};exports[_0xadc5('0x4')]=function(_0x5a3f53,_0x10d733){return client[_0xadc5('0x2')](_0xadc5('0x5'),{'body':_0x10d733,'options':{'where':{'uniqueid':_0x5a3f53},'order':[['id',_0xadc5('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xfeb1=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x54d9f6,_0x2ecf42){var _0x355986=function(_0x15ca12){while(--_0x15ca12){_0x54d9f6['push'](_0x54d9f6['shift']());}};_0x355986(++_0x2ecf42);}(_0xfeb1,0x17c));var _0x1feb=function(_0x360ba7,_0x3ffe53){_0x360ba7=_0x360ba7-0x0;var _0x2ceb9e=_0xfeb1[_0x360ba7];return _0x2ceb9e;};'use strict';var client=require(_0x1feb('0x0'));exports['create']=function(_0x216678){return client[_0x1feb('0x1')]('CreateMailQueueReport',{'body':_0x216678,'log':_0x1feb('0x2')});};exports[_0x1feb('0x3')]=function(_0xd0d554,_0xdf0911){return client[_0x1feb('0x1')](_0x1feb('0x4'),{'body':_0xdf0911,'options':{'where':{'uniqueid':_0xd0d554},'order':[['id',_0x1feb('0x5')]],'limit':0x1},'log':_0x1feb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d0324f2..635e5bd 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 _0x136e=['update','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x283e65,_0x5e5a81){var _0x1996c2=function(_0x3353fd){while(--_0x3353fd){_0x283e65['push'](_0x283e65['shift']());}};_0x1996c2(++_0x5e5a81);}(_0x136e,0x1e9));var _0xe136=function(_0x19ba34,_0x12bc3c){_0x19ba34=_0x19ba34-0x0;var _0x340938=_0x136e[_0x19ba34];return _0x340938;};'use strict';var client=require(_0xe136('0x0'));exports[_0xe136('0x1')]=function(_0x371727,_0x156b36){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x156b36,'options':{'where':{'id':_0x371727}},'log':_0xe136('0x2')});};exports[_0xe136('0x3')]=function(_0x5b8a39,_0x3bcf65){return client[_0xe136('0x4')](_0xe136('0x5'),{'body':_0x3bcf65,'options':{'where':{'id':_0x5b8a39}},'log':_0xe136('0x6')});}; \ No newline at end of file +var _0x54d4=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x54d4,0x1dd));var _0x454d=function(_0x183a54,_0x55b00b){_0x183a54=_0x183a54-0x0;var _0x58a000=_0x54d4[_0x183a54];return _0x58a000;};'use strict';var client=require(_0x454d('0x0'));exports['update']=function(_0x286142,_0x2bc9c5){return client[_0x454d('0x1')](_0x454d('0x2'),{'body':_0x2bc9c5,'options':{'where':{'id':_0x286142}},'log':_0x454d('0x3')});};exports[_0x454d('0x4')]=function(_0x2eeb23,_0x1086e0){return client[_0x454d('0x1')](_0x454d('0x5'),{'body':_0x1086e0,'options':{'where':{'id':_0x2eeb23}},'log':_0x454d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 89b7f07..3c67b93 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 _0xe49e=['../client','Request','CreateOpenchannelMessage'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe49e,0xf0));var _0xee49=function(_0x2f4dc4,_0x311d42){_0x2f4dc4=_0x2f4dc4-0x0;var _0x58e608=_0xe49e[_0x2f4dc4];return _0x58e608;};'use strict';var client=require(_0xee49('0x0'));exports['create']=function(_0x433cf0){return client[_0xee49('0x1')](_0xee49('0x2'),{'body':_0x433cf0,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xc4e7=['createOpenchannelMessage','create','CreateOpenchannelMessage'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xc4e7,0x1b7));var _0x7c4e=function(_0x4dde94,_0x52b903){_0x4dde94=_0x4dde94-0x0;var _0x30acf7=_0xc4e7[_0x4dde94];return _0x30acf7;};'use strict';var client=require('../client');exports[_0x7c4e('0x0')]=function(_0x19f161){return client['Request'](_0x7c4e('0x1'),{'body':_0x19f161,'log':_0x7c4e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1702f85..695cfe6 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 _0x7114=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','User'];(function(_0x1672b5,_0x3de7c1){var _0x34ab9a=function(_0x2837c8){while(--_0x2837c8){_0x1672b5['push'](_0x1672b5['shift']());}};_0x34ab9a(++_0x3de7c1);}(_0x7114,0xd2));var _0x4711=function(_0x231d66,_0x189630){_0x231d66=_0x231d66-0x0;var _0x48d0c3=_0x7114[_0x231d66];return _0x48d0c3;};'use strict';var client=require(_0x4711('0x0'));exports[_0x4711('0x1')]=function(){return function(){return client[_0x4711('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x4711('0x3'),_0x4711('0x4'),'strategy'],'include':[{'model':_0x4711('0x5'),'as':_0x4711('0x6'),'attributes':['id',_0x4711('0x3'),_0x4711('0x7'),_0x4711('0x8')]}]},'log':_0x4711('0x1')});};}; \ No newline at end of file +var _0x3b20=['online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','User','Agents'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x3b20,0x1de));var _0x03b2=function(_0x593a76,_0x3a25ef){_0x593a76=_0x593a76-0x0;var _0x24a453=_0x3b20[_0x593a76];return _0x24a453;};'use strict';var client=require(_0x03b2('0x0'));exports[_0x03b2('0x1')]=function(){return function(){return client[_0x03b2('0x2')](_0x03b2('0x3'),{'options':{'raw':![],'attributes':['id',_0x03b2('0x4'),_0x03b2('0x5'),'strategy'],'include':[{'model':_0x03b2('0x6'),'as':_0x03b2('0x7'),'attributes':['id',_0x03b2('0x4'),_0x03b2('0x8'),'openchannelPause']}]},'log':_0x03b2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index eb10fbe..12224ae 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 _0x7c47=['../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x585647,_0x47708f){var _0x334b4c=function(_0x137364){while(--_0x137364){_0x585647['push'](_0x585647['shift']());}};_0x334b4c(++_0x47708f);}(_0x7c47,0x1b8));var _0x77c4=function(_0x129bc3,_0x4590c6){_0x129bc3=_0x129bc3-0x0;var _0x128b08=_0x7c47[_0x129bc3];return _0x128b08;};'use strict';var client=require(_0x77c4('0x0'));exports['create']=function(_0x2b9e68){return client[_0x77c4('0x1')](_0x77c4('0x2'),{'body':_0x2b9e68,'log':_0x77c4('0x2')});};exports[_0x77c4('0x3')]=function(_0x39e7d0,_0x1b6f5d){return client['Request'](_0x77c4('0x4'),{'body':_0x1b6f5d,'options':{'where':{'uniqueid':_0x39e7d0},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xac5f=['DESC','../client','Request','CreateOpenchannelQueueReport'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xac5f,0x139));var _0xfac5=function(_0xef99,_0x590779){_0xef99=_0xef99-0x0;var _0x350c23=_0xac5f[_0xef99];return _0x350c23;};'use strict';var client=require(_0xfac5('0x0'));exports['create']=function(_0x5ad85c){return client[_0xfac5('0x1')](_0xfac5('0x2'),{'body':_0x5ad85c,'log':_0xfac5('0x2')});};exports['update']=function(_0x4ffedc,_0x187c4e){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x187c4e,'options':{'where':{'uniqueid':_0x4ffedc},'order':[['id',_0xfac5('0x3')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f39df81..ad02286 100644 --- a/server/services/routing/rpc/smsInteraction.js +++ b/server/services/routing/rpc/smsInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x782e=['AddTagsToSmsInteraction','UpdateSmsInteraction','updateSmsInteraction','Request'];(function(_0x36a241,_0x209d68){var _0x3b4bef=function(_0x453a2f){while(--_0x453a2f){_0x36a241['push'](_0x36a241['shift']());}};_0x3b4bef(++_0x209d68);}(_0x782e,0xb9));var _0xe782=function(_0x1a6264,_0x4ba686){_0x1a6264=_0x1a6264-0x0;var _0x29c464=_0x782e[_0x1a6264];return _0x29c464;};'use strict';var client=require('../client');exports['update']=function(_0x120c31,_0x15b01d){return client['Request'](_0xe782('0x0'),{'body':_0x15b01d,'options':{'where':{'id':_0x120c31}},'log':_0xe782('0x1')});};exports['addTags']=function(_0x26f960,_0x6726f){return client[_0xe782('0x2')](_0xe782('0x3'),{'body':_0x6726f,'options':{'where':{'id':_0x26f960}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x207d=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags'];(function(_0x4691cc,_0x16c9ce){var _0x204696=function(_0x59ac5b){while(--_0x59ac5b){_0x4691cc['push'](_0x4691cc['shift']());}};_0x204696(++_0x16c9ce);}(_0x207d,0x10d));var _0xd207=function(_0x560289,_0x245433){_0x560289=_0x560289-0x0;var _0x2a4290=_0x207d[_0x560289];return _0x2a4290;};'use strict';var client=require(_0xd207('0x0'));exports[_0xd207('0x1')]=function(_0x302062,_0x27a1dc){return client['Request'](_0xd207('0x2'),{'body':_0x27a1dc,'options':{'where':{'id':_0x302062}},'log':'updateSmsInteraction'});};exports[_0xd207('0x3')]=function(_0x422501,_0x5351ed){return client[_0xd207('0x4')](_0xd207('0x5'),{'body':_0x5351ed,'options':{'where':{'id':_0x422501}},'log':_0xd207('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 00f1431..aa65b1e 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 _0xb20b=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb20b,0x93));var _0xbb20=function(_0x10262a,_0x5330d3){_0x10262a=_0x10262a-0x0;var _0x1fae28=_0xb20b[_0x10262a];return _0x1fae28;};'use strict';var client=require(_0xbb20('0x0'));exports['create']=function(_0x17abe9){return client[_0xbb20('0x1')](_0xbb20('0x2'),{'body':_0x17abe9,'log':_0xbb20('0x3')});}; \ No newline at end of file +var _0x6462=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x18b8c7,_0x6ae826){var _0x5ec1e1=function(_0x503262){while(--_0x503262){_0x18b8c7['push'](_0x18b8c7['shift']());}};_0x5ec1e1(++_0x6ae826);}(_0x6462,0x16f));var _0x2646=function(_0x4a7995,_0x1b0149){_0x4a7995=_0x4a7995-0x0;var _0x46a6f9=_0x6462[_0x4a7995];return _0x46a6f9;};'use strict';var client=require('../client');exports[_0x2646('0x0')]=function(_0x4fef64){return client[_0x2646('0x1')](_0x2646('0x2'),{'body':_0x4fef64,'log':_0x2646('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6398aac..3488c67 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x3b5ad0,_0x223a13){var _0x53eb57=function(_0x53aded){while(--_0x53aded){_0x3b5ad0['push'](_0x3b5ad0['shift']());}};_0x53eb57(++_0x223a13);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'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 05c4834..e26132d 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0xf17841,_0x46e1e2){var _0x2803fd=function(_0x24038a){while(--_0x24038a){_0xf17841['push'](_0xf17841['shift']());}};_0x2803fd(++_0x46e1e2);}(_0x55ca,0x126));var _0xa55c=function(_0x514846,_0x34ac8d){_0x514846=_0x514846-0x0;var _0x2627a8=_0x55ca[_0x514846];return _0x2627a8;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x469c05,_0x34acad){var _0x5a733d=function(_0x2127c8){while(--_0x2127c8){_0x469c05['push'](_0x469c05['shift']());}};_0x5a733d(++_0x34acad);}(_0x3e74,0x175));var _0x43e7=function(_0x52a0f0,_0x3d35aa){_0x52a0f0=_0x52a0f0-0x0;var _0x4d4011=_0x3e74[_0x52a0f0];return _0x4d4011;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 0d8440c..9f94d4a 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(_0x268106,_0x15267b){var _0x2eacb7=function(_0x1d3f57){while(--_0x1d3f57){_0x268106['push'](_0x268106['shift']());}};_0x2eacb7(++_0x15267b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x228046,_0x14abd2){var _0x4ff467=function(_0x536af1){while(--_0x536af1){_0x228046['push'](_0x228046['shift']());}};_0x4ff467(++_0x14abd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 c1bbd10..9abbe7b 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 _0xdf55=['Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf55,0x83));var _0x5df5=function(_0x34eb0d,_0x43448b){_0x34eb0d=_0x34eb0d-0x0;var _0x309bb3=_0xdf55[_0x34eb0d];return _0x309bb3;};'use strict';var client=require(_0x5df5('0x0'));exports[_0x5df5('0x1')]=function(_0x4d02f3,_0x20db42){return client[_0x5df5('0x2')]('UpdateWhatsappInteraction',{'body':_0x20db42,'options':{'where':{'id':_0x4d02f3}},'log':_0x5df5('0x3')});};exports[_0x5df5('0x4')]=function(_0x381a4c,_0x521007){return client[_0x5df5('0x2')](_0x5df5('0x5'),{'body':_0x521007,'options':{'where':{'id':_0x381a4c}},'log':_0x5df5('0x6')});}; \ No newline at end of file +var _0x33af=['addTags','AddTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x33af,0xec));var _0xf33a=function(_0x3a36e4,_0x420a62){_0x3a36e4=_0x3a36e4-0x0;var _0x3e3628=_0x33af[_0x3a36e4];return _0x3e3628;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 2ae049d..be92d3a 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 _0x2658=['Request','createWhatsappMessage','../client','create'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2658,0x6e));var _0x8265=function(_0x14a3f1,_0x57d171){_0x14a3f1=_0x14a3f1-0x0;var _0x25e61e=_0x2658[_0x14a3f1];return _0x25e61e;};'use strict';var client=require(_0x8265('0x0'));exports[_0x8265('0x1')]=function(_0x4d0bfe){return client[_0x8265('0x2')]('CreateWhatsappMessage',{'body':_0x4d0bfe,'log':_0x8265('0x3')});}; \ No newline at end of file +var _0xb8ee=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0xb8ee,0x12f));var _0xeb8e=function(_0x2b5ee5,_0x3741bf){_0x2b5ee5=_0x2b5ee5-0x0;var _0x1c480b=_0xb8ee[_0x2b5ee5];return _0x1c480b;};'use strict';var client=require(_0xeb8e('0x0'));exports[_0xeb8e('0x1')]=function(_0x11f25b){return client['Request'](_0xeb8e('0x2'),{'body':_0x11f25b,'log':_0xeb8e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 6fac3a4..76c8cb7 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 _0x2486=['../client','GetWhatsappQueue','name','strategy','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x5411cb,_0x1cd69d){var _0x32727a=function(_0x22a762){while(--_0x22a762){_0x5411cb['push'](_0x5411cb['shift']());}};_0x32727a(++_0x1cd69d);}(_0x2486,0x1e8));var _0x6248=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2486[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6248('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x6248('0x1'),{'options':{'raw':![],'attributes':['id',_0x6248('0x2'),'timeout',_0x6248('0x3')],'include':[{'model':'User','as':_0x6248('0x4'),'attributes':['id',_0x6248('0x2'),_0x6248('0x5'),_0x6248('0x6')]}]},'log':_0x6248('0x7')});};}; \ No newline at end of file +var _0x44a2=['whatsappPause','../client','getWhatsappQueues','name','timeout','strategy','User','Agents','online'];(function(_0x301a6f,_0x5cfa45){var _0x3c750e=function(_0x483c0b){while(--_0x483c0b){_0x301a6f['push'](_0x301a6f['shift']());}};_0x3c750e(++_0x5cfa45);}(_0x44a2,0x1cc));var _0x244a=function(_0x43a3fd,_0x29e1ce){_0x43a3fd=_0x43a3fd-0x0;var _0x214d71=_0x44a2[_0x43a3fd];return _0x214d71;};'use strict';var client=require(_0x244a('0x0'));exports[_0x244a('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x244a('0x2'),_0x244a('0x3'),_0x244a('0x4')],'include':[{'model':_0x244a('0x5'),'as':_0x244a('0x6'),'attributes':['id','name',_0x244a('0x7'),_0x244a('0x8')]}]},'log':_0x244a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index b5b9ff7..ae0d489 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 _0x5309=['../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x5f2b0e,_0x11271c){var _0x2a3323=function(_0x1e26a4){while(--_0x1e26a4){_0x5f2b0e['push'](_0x5f2b0e['shift']());}};_0x2a3323(++_0x11271c);}(_0x5309,0x144));var _0x9530=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x5309[_0x521929];return _0x632436;};'use strict';var client=require(_0x9530('0x0'));exports[_0x9530('0x1')]=function(_0x2a4ecf){return client['Request'](_0x9530('0x2'),{'body':_0x2a4ecf,'log':'CreateWhatsappQueueReport'});};exports[_0x9530('0x3')]=function(_0x33f8f4,_0x256f50){return client[_0x9530('0x4')](_0x9530('0x5'),{'body':_0x256f50,'options':{'where':{'uniqueid':_0x33f8f4},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xdb83=['CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','../client','create'];(function(_0x3a85a6,_0x206848){var _0x5614bb=function(_0x4e1166){while(--_0x4e1166){_0x3a85a6['push'](_0x3a85a6['shift']());}};_0x5614bb(++_0x206848);}(_0xdb83,0x14e));var _0x3db8=function(_0x9feb15,_0x3d130f){_0x9feb15=_0x9feb15-0x0;var _0x4d6261=_0xdb83[_0x9feb15];return _0x4d6261;};'use strict';var client=require(_0x3db8('0x0'));exports[_0x3db8('0x1')]=function(_0x4d17f4){return client['Request'](_0x3db8('0x2'),{'body':_0x4d17f4,'log':_0x3db8('0x2')});};exports[_0x3db8('0x3')]=function(_0x641a66,_0x3c2e8b){return client[_0x3db8('0x4')](_0x3db8('0x5'),{'body':_0x3c2e8b,'options':{'where':{'uniqueid':_0x641a66},'order':[['id','DESC']],'limit':0x1},'log':_0x3db8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 380dac7..4b9e7b8 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 _0xf3ac=['rules','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','end','close'];(function(_0x40aec4,_0x1936c5){var _0xef8ac1=function(_0x4141d9){while(--_0x4141d9){_0x40aec4['push'](_0x40aec4['shift']());}};_0xef8ac1(++_0x1936c5);}(_0xf3ac,0x1b2));var _0xcf3a=function(_0x475170,_0x4a161f){_0x475170=_0x475170-0x0;var _0x243984=_0xf3ac[_0x475170];return _0x243984;};'use strict';var schema=require(_0xcf3a('0x0'));var _=require('lodash');var util=require(_0xcf3a('0x1'));var seqqueue=require(_0xcf3a('0x2'));var logger=require(_0xcf3a('0x3'))(_0xcf3a('0x4'));var strategy=require(_0xcf3a('0x5'));var queue=schema({'name':{'type':_0xcf3a('0x6'),'required':!![],'message':_0xcf3a('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x264a63,_0x273488,_0x117b79){return logger[_0xcf3a('0x8')](util[_0xcf3a('0x9')](_0xcf3a('0xa'),_0x264a63,_0x273488[_0xcf3a('0xb')],_0x117b79));}function handleFindAgent(_0x37774b){return function(_0x66ce8f){return _0x66ce8f['name']['toLowerCase']()===_0x37774b[_0xcf3a('0xc')]();};}exports['consequence']=function(_0x22a7ad,_0x47304d,_0x331fe2,_0x38657b){return function(_0x5e23b7){try{var _0x197f79={'name':_0x47304d[0x0],'timeout':_0x47304d[0x1]};var _0xc93b2d=queue['validate'](_0x197f79,{'typecast':!![]});if(_0xc93b2d[_0xcf3a('0xd')]){logger[_0xcf3a('0xe')](_0xcf3a('0xf'),_0x22a7ad,_[_0xcf3a('0x10')](_0xc93b2d,_0xcf3a('0x11'))[_0xcf3a('0x12')](',\x20'));_0x5e23b7[_0xcf3a('0x13')]();}else{var _0x443c16=_['find'](_0x331fe2[_0xcf3a('0x14')],handleFindAgent(_0x197f79[_0xcf3a('0xb')]));if(_0x443c16){var _0x53692f=(_0x197f79[_0xcf3a('0x15')]||0xa)*0x3e8;var _0x5a033d,_0x14bfb2;var _0x11e257=seqqueue[_0xcf3a('0x16')](_0x53692f);_0x11e257['id']=_0x22a7ad;_0x11e257[_0xcf3a('0x17')]=_0x53692f;_0x11e257[_0xcf3a('0x18')]=_0x38657b[_0xcf3a('0x18')];writeLog(_0x22a7ad,_0x443c16,util[_0xcf3a('0x9')](_0xcf3a('0x19'),_0x53692f));_0x331fe2['rules'][_0x22a7ad]['on'](_0xcf3a('0x1a'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x22a7ad);clearTimeout(_0x14bfb2);_0x14bfb2=undefined;_0x11e257[_0xcf3a('0x1b')]();if(_0x331fe2[_0xcf3a('0x1c')][_0x22a7ad]){delete _0x331fe2[_0xcf3a('0x1c')][_0x22a7ad];}_0x5e23b7['stop']();});_0x331fe2[_0xcf3a('0x1c')][_0x22a7ad]['on'](_0xcf3a('0x1d'),function(){if(_0x331fe2['rules'][_0x22a7ad]){delete _0x331fe2[_0xcf3a('0x1c')][_0x22a7ad];}});_0x14bfb2=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x22a7ad);clearTimeout(_0x14bfb2);_0x11e257[_0xcf3a('0x1b')]();_0x5e23b7[_0xcf3a('0x1e')]();},_0x53692f);strategy['agent'](_0x11e257,_0x443c16,_0x331fe2,_0x38657b);}else{logger[_0xcf3a('0xe')](_0xcf3a('0x1f'),_0x22a7ad,_0x197f79[_0xcf3a('0xb')]);_0x5e23b7[_0xcf3a('0x13')]();}}}catch(_0xc9f85d){console['log'](_0xc9f85d);logger[_0xcf3a('0xe')](_0xcf3a('0x20'),_0x22a7ad,_0xc9f85d['stack']);_0x5e23b7['stop']();}};}; \ No newline at end of file +var _0x0a9f=['[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a9f,0x191));var _0xf0a9=function(_0x5944e9,_0xf3da60){_0x5944e9=_0x5944e9-0x0;var _0x1098b8=_0x0a9f[_0x5944e9];return _0x1098b8;};'use strict';var schema=require('validate');var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var seqqueue=require(_0xf0a9('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xf0a9('0x3'));var queue=schema({'name':{'type':_0xf0a9('0x4'),'required':!![],'message':_0xf0a9('0x5')},'timeout':{'type':_0xf0a9('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3f38b4,_0x4db052,_0x3083d6){return logger[_0xf0a9('0x7')](util[_0xf0a9('0x8')](_0xf0a9('0x9'),_0x3f38b4,_0x4db052[_0xf0a9('0xa')],_0x3083d6));}function handleFindAgent(_0x5ebf87){return function(_0xf4548a){return _0xf4548a[_0xf0a9('0xa')][_0xf0a9('0xb')]()===_0x5ebf87[_0xf0a9('0xb')]();};}exports[_0xf0a9('0xc')]=function(_0x43ed05,_0x4eb539,_0x41506b,_0x1fafd8){return function(_0x1d5730){try{var _0x5b9952={'name':_0x4eb539[0x0],'timeout':_0x4eb539[0x1]};var _0x5ad950=queue[_0xf0a9('0xd')](_0x5b9952,{'typecast':!![]});if(_0x5ad950[_0xf0a9('0xe')]){logger[_0xf0a9('0xf')]('[%s][AGENT]\x20%s',_0x43ed05,_[_0xf0a9('0x10')](_0x5ad950,_0xf0a9('0x11'))[_0xf0a9('0x12')](',\x20'));_0x1d5730[_0xf0a9('0x13')]();}else{var _0xcc612c=_[_0xf0a9('0x14')](_0x41506b[_0xf0a9('0x15')],handleFindAgent(_0x5b9952[_0xf0a9('0xa')]));if(_0xcc612c){var _0x487d6e=(_0x5b9952[_0xf0a9('0x16')]||0xa)*0x3e8;var _0x49b9a9,_0x217b36;var _0x32732a=seqqueue[_0xf0a9('0x17')](_0x487d6e);_0x32732a['id']=_0x43ed05;_0x32732a['atimeout']=_0x487d6e;_0x32732a[_0xf0a9('0x18')]=_0x1fafd8['channel'];writeLog(_0x43ed05,_0xcc612c,util[_0xf0a9('0x8')](_0xf0a9('0x19'),_0x487d6e));_0x41506b[_0xf0a9('0x1a')][_0x43ed05]['on'](_0xf0a9('0x1b'),function(){logger[_0xf0a9('0x7')](_0xf0a9('0x1c'),_0x43ed05);clearTimeout(_0x217b36);_0x217b36=undefined;_0x32732a[_0xf0a9('0x1d')]();if(_0x41506b[_0xf0a9('0x1a')][_0x43ed05]){delete _0x41506b[_0xf0a9('0x1a')][_0x43ed05];}_0x1d5730[_0xf0a9('0x13')]();});_0x41506b[_0xf0a9('0x1a')][_0x43ed05]['on'](_0xf0a9('0x1e'),function(){if(_0x41506b[_0xf0a9('0x1a')][_0x43ed05]){delete _0x41506b['rules'][_0x43ed05];}});_0x217b36=setTimeout(function(){logger[_0xf0a9('0x7')](_0xf0a9('0x1f'),_0x43ed05);clearTimeout(_0x217b36);_0x32732a['close']();_0x1d5730[_0xf0a9('0x20')]();},_0x487d6e);strategy[_0xf0a9('0x21')](_0x32732a,_0xcc612c,_0x41506b,_0x1fafd8);}else{logger[_0xf0a9('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x43ed05,_0x5b9952[_0xf0a9('0xa')]);_0x1d5730[_0xf0a9('0x13')]();}}}catch(_0x44bc3d){console[_0xf0a9('0x22')](_0x44bc3d);logger[_0xf0a9('0xf')](_0xf0a9('0x23'),_0x43ed05,_0x44bc3d['stack']);_0x1d5730[_0xf0a9('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 480cf32..c31c0e0 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 _0xbfdd=['../../rpc/faxMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','Message','create','info','[%s][AMAZONLEX]\x20%s','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','next','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbfdd,0x1e0));var _0xdbfd=function(_0x4074d5,_0xa57194){_0x4074d5=_0x4074d5-0x0;var _0x502cfe=_0xbfdd[_0x4074d5];return _0x502cfe;};'use strict';var _=require(_0xdbfd('0x0'));var moment=require(_0xdbfd('0x1'));var AWS=require(_0xdbfd('0x2'));var utils=require(_0xdbfd('0x3'));var logger=require(_0xdbfd('0x4'))(_0xdbfd('0x5'));var rpc={'chatMessage':require(_0xdbfd('0x6')),'openchannelMessage':require(_0xdbfd('0x7')),'mailMessage':require(_0xdbfd('0x8')),'smsMessage':require(_0xdbfd('0x9')),'faxMessage':require(_0xdbfd('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdbfd('0xb')]=function(_0x6ff218,_0xf44b63){return function(_0x38a206){try{if(!_[_0xdbfd('0xc')](this[_0xdbfd('0xd')][_0xdbfd('0xe')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x6ff218,_0xdbfd('0xf'));return _0x38a206['next']();}var _0x55158f={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdbfd('0x10')](_0xdbfd('0x11')),'direction':'out'};if(this[_0xdbfd('0x12')]===_0xdbfd('0x13')||this[_0xdbfd('0x12')]===_0xdbfd('0x14')){_0x55158f[_0xdbfd('0x15')]=this[_0xdbfd('0xd')][_0xdbfd('0x15')];}var _0x39c77c=this['channel'];if(_0x39c77c===_0xdbfd('0x16')){_0x55158f[_0xdbfd('0x17')]=this['account']['id'];}else{_0x55158f[_['upperFirst'](_0x39c77c)+_0xdbfd('0x18')]=this[_0xdbfd('0x19')]['id'];}_0x55158f[_[_0xdbfd('0x1a')](_0x39c77c)+_0xdbfd('0x1b')]=this['interaction']['id'];if(this[_0xdbfd('0xd')][_0xdbfd('0x1c')]){var _0x5d5d7e=_0xf44b63[0x4];if(!_[_0xdbfd('0x1d')](_0x5d5d7e)){_0x55158f['body']=utils['getMustacheRender'](_0x5d5d7e,this);return rpc[_0x39c77c+_0xdbfd('0x1e')][_0xdbfd('0x1f')](_0x55158f)['then'](function(_0x4cfcc3){logger[_0xdbfd('0x20')](_0xdbfd('0x21'),_0x6ff218,_0x55158f[_0xdbfd('0x22')]);})[_0xdbfd('0x23')](function(_0x38ab2b){logger[_0xdbfd('0x24')](_0xdbfd('0x21'),_0x6ff218,JSON[_0xdbfd('0x25')](_0x38ab2b));})[_0xdbfd('0x26')](function(){logger[_0xdbfd('0x20')](_0xdbfd('0x27'),_0x6ff218);_0x38a206[_0xdbfd('0x28')]();});}else{logger[_0xdbfd('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x6ff218);_0x38a206[_0xdbfd('0x28')]();}}else{var _0x304022=this;var _0x9b3f06=new AWS[(_0xdbfd('0x29'))]({'accessKeyId':_0xf44b63[0x0],'secretAccessKey':_0xf44b63[0x1],'region':_0xf44b63[0x2]});var _0x6850f9={'botAlias':'$LATEST','botName':_0xf44b63[0x3],'inputText':this[_0xdbfd('0x2a')][_0xdbfd('0x22')],'userId':this['channel']+':'+this[_0xdbfd('0xd')]['id'][_0xdbfd('0x2b')]()};_0x9b3f06[_0xdbfd('0x2c')](_0x6850f9,function(_0x2c72b6,_0xd3ff02){if(_0x2c72b6){logger['error']('[%s][AMAZONLEX]\x20%s',_0x6ff218,_0x2c72b6[_0xdbfd('0x2a')]);_0x38a206[_0xdbfd('0x2d')]();}else if(_0xd3ff02&&_0xd3ff02[_0xdbfd('0x2a')]){_0x304022[_0xdbfd('0x22')]['amazonlex']=_0xd3ff02;_0x55158f[_0xdbfd('0x22')]=_0xd3ff02[_0xdbfd('0x2a')];_0x55158f['providerName']='amazonlex';_0x55158f[_0xdbfd('0x2e')]=JSON[_0xdbfd('0x25')](_0xd3ff02);return rpc[_0x39c77c+_0xdbfd('0x1e')][_0xdbfd('0x1f')](_0x55158f)['then'](function(_0x460987){logger[_0xdbfd('0x20')](_0xdbfd('0x21'),_0x6ff218,_0x55158f[_0xdbfd('0x22')]);if(_0xd3ff02[_0xdbfd('0x2f')]==_0xdbfd('0x30')){_0x38a206[_0xdbfd('0x2d')]();}else{_0x38a206[_0xdbfd('0x28')]();}})[_0xdbfd('0x23')](function(_0x50e0c3){logger['error'](_0xdbfd('0x21'),_0x6ff218,JSON[_0xdbfd('0x25')](_0x50e0c3));_0x38a206[_0xdbfd('0x2d')]();});}else{_0x38a206[_0xdbfd('0x2d')]();}});}}catch(_0x465f4b){logger[_0xdbfd('0x24')](_0xdbfd('0x21'),_0x6ff218,JSON[_0xdbfd('0x25')](_0x465f4b));_0x38a206[_0xdbfd('0x28')]();}};}; \ No newline at end of file +var _0x8311=['next','contact','format','sms','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','then','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','body','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x2a9ff9,_0x172c4d){var _0x2669d2=function(_0x15f61a){while(--_0x15f61a){_0x2a9ff9['push'](_0x2a9ff9['shift']());}};_0x2669d2(++_0x172c4d);}(_0x8311,0x1db));var _0x1831=function(_0x426ab4,_0x3aa799){_0x426ab4=_0x426ab4-0x0;var _0x290c07=_0x8311[_0x426ab4];return _0x290c07;};'use strict';var _=require(_0x1831('0x0'));var moment=require(_0x1831('0x1'));var AWS=require(_0x1831('0x2'));var utils=require(_0x1831('0x3'));var logger=require(_0x1831('0x4'))('routing');var rpc={'chatMessage':require(_0x1831('0x5')),'openchannelMessage':require(_0x1831('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1831('0x7')),'faxMessage':require(_0x1831('0x8')),'whatsappMessage':require(_0x1831('0x9'))};exports[_0x1831('0xa')]=function(_0x29b1a2,_0x4a5ffd){return function(_0x4d323a){try{if(!_['isNil'](this[_0x1831('0xb')]['UserId'])){logger[_0x1831('0xc')](_0x1831('0xd'),_0x29b1a2,_0x1831('0xe'));return _0x4d323a[_0x1831('0xf')]();}var _0x1b3f19={'ContactId':this[_0x1831('0x10')]['id'],'sentAt':moment()[_0x1831('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x1831('0x12')||this[_0x1831('0x13')]===_0x1831('0x14')){_0x1b3f19[_0x1831('0x15')]=this['interaction'][_0x1831('0x15')];}var _0x5d5ff5=this[_0x1831('0x13')];if(_0x5d5ff5===_0x1831('0x16')){_0x1b3f19['ChatWebsiteId']=this[_0x1831('0x17')]['id'];}else{_0x1b3f19[_[_0x1831('0x18')](_0x5d5ff5)+_0x1831('0x19')]=this[_0x1831('0x17')]['id'];}_0x1b3f19[_['upperFirst'](_0x5d5ff5)+_0x1831('0x1a')]=this[_0x1831('0xb')]['id'];if(this[_0x1831('0xb')][_0x1831('0x1b')]){var _0x4929a8=_0x4a5ffd[0x4];if(!_[_0x1831('0x1c')](_0x4929a8)){_0x1b3f19['body']=utils[_0x1831('0x1d')](_0x4929a8,this);return rpc[_0x5d5ff5+_0x1831('0x1e')]['create'](_0x1b3f19)[_0x1831('0x1f')](function(_0x22f71d){logger['info']('[%s][AMAZONLEX]\x20%s',_0x29b1a2,_0x1b3f19['body']);})['catch'](function(_0x3fb8b7){logger[_0x1831('0x20')](_0x1831('0xd'),_0x29b1a2,JSON[_0x1831('0x21')](_0x3fb8b7));})[_0x1831('0x22')](function(){logger[_0x1831('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x29b1a2);_0x4d323a[_0x1831('0x23')]();});}else{logger['info'](_0x1831('0x24'),_0x29b1a2);_0x4d323a[_0x1831('0x23')]();}}else{var _0x3669b1=this;var _0x189723=new AWS[(_0x1831('0x25'))]({'accessKeyId':_0x4a5ffd[0x0],'secretAccessKey':_0x4a5ffd[0x1],'region':_0x4a5ffd[0x2]});var _0x4c1e02={'botAlias':'$LATEST','botName':_0x4a5ffd[0x3],'inputText':this[_0x1831('0x26')][_0x1831('0x27')],'userId':this['channel']+':'+this[_0x1831('0xb')]['id'][_0x1831('0x28')]()};_0x189723[_0x1831('0x29')](_0x4c1e02,function(_0x1ce763,_0x1ca4aa){if(_0x1ce763){logger[_0x1831('0x20')]('[%s][AMAZONLEX]\x20%s',_0x29b1a2,_0x1ce763[_0x1831('0x26')]);_0x4d323a[_0x1831('0xf')]();}else if(_0x1ca4aa&&_0x1ca4aa[_0x1831('0x26')]){_0x3669b1['body'][_0x1831('0x2a')]=_0x1ca4aa;_0x1b3f19[_0x1831('0x27')]=_0x1ca4aa[_0x1831('0x26')];_0x1b3f19[_0x1831('0x2b')]=_0x1831('0x2a');_0x1b3f19[_0x1831('0x2c')]=JSON['stringify'](_0x1ca4aa);return rpc[_0x5d5ff5+_0x1831('0x1e')][_0x1831('0x2d')](_0x1b3f19)[_0x1831('0x1f')](function(_0x3d7be0){logger[_0x1831('0xc')](_0x1831('0xd'),_0x29b1a2,_0x1b3f19['body']);if(_0x1ca4aa[_0x1831('0x2e')]==_0x1831('0x2f')){_0x4d323a[_0x1831('0xf')]();}else{_0x4d323a[_0x1831('0x23')]();}})[_0x1831('0x30')](function(_0x4d0f8a){logger[_0x1831('0x20')]('[%s][AMAZONLEX]\x20%s',_0x29b1a2,JSON[_0x1831('0x21')](_0x4d0f8a));_0x4d323a[_0x1831('0xf')]();});}else{_0x4d323a[_0x1831('0xf')]();}});}}catch(_0x614e9b){logger[_0x1831('0x20')]('[%s][AMAZONLEX]\x20%s',_0x29b1a2,JSON[_0x1831('0x21')](_0x614e9b));_0x4d323a['stop']();}};}; \ 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 21eaa82..9e4dfb0 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 _0x8975=['[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','messageId','html','','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x8975,0x1bb));var _0x5897=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8975[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5897('0x0'));var moment=require(_0x5897('0x1'));var utils=require('./utils');var logger=require(_0x5897('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5897('0x3')),'mailMessage':require(_0x5897('0x4')),'smsMessage':require(_0x5897('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5897('0x6')),'chatInteraction':require(_0x5897('0x7')),'openchannelInteraction':require(_0x5897('0x8')),'mailInteraction':require(_0x5897('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x5897('0xa')),'whatsappInteraction':require(_0x5897('0xb'))};var mailRpc=require(_0x5897('0xc'));exports[_0x5897('0xd')]=function(_0x2d6f7a,_0xba2255,_0x4bdbfa,_0x22a6c2){return function(_0x27aa08){try{var _0x24f0a1=this[_0x5897('0xe')];if(_0x24f0a1===_0x5897('0xf')&&_0x22a6c2[_0x5897('0x10')][_0x5897('0x11')]){logger[_0x5897('0x12')](_0x5897('0x13'),_0x2d6f7a,_0x5897('0x14'));return _0x27aa08[_0x5897('0x15')]();}if(_0xba2255[0x0]==='1'&&(_[_0x5897('0x16')](this[_0x5897('0x17')]['created'])||!this[_0x5897('0x17')]['created'])){logger['info'](_0x5897('0x13'),_0x2d6f7a,'Autoreply\x20already\x20sent');return _0x27aa08[_0x5897('0x15')]();}if(_0xba2255[0x0]==='2'&&this[_0x5897('0x17')][_0x5897('0x18')]){logger[_0x5897('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2d6f7a,_0x5897('0x19'));return _0x27aa08['next']();}var _0x2fe024={'ContactId':this[_0x5897('0x1a')]['id'],'sentAt':moment()[_0x5897('0x1b')](_0x5897('0x1c')),'direction':'out'};if(this['channel']===_0x5897('0xf')){_0x2fe024[_0x5897('0x10')]=utils['getMustacheRender'](_0xba2255[0x2],this);}else{_0x2fe024[_0x5897('0x10')]=utils['getMustacheRender'](_0xba2255[0x1],this);}if(this[_0x5897('0x1d')]){_0x2fe024['to']=this[_0x5897('0x1d')][_0x5897('0x1e')]||'';if(this['channel']===_0x5897('0xf')&&_0xba2255[0x1]==='1'){_0x2fe024['cc']=this[_0x5897('0x1d')]['cc']||'';}_0x2fe024[_0x5897('0x1e')]=this[_0x5897('0x1d')]['to']||'';_0x2fe024[_0x5897('0x1f')]=this[_0x5897('0x1d')][_0x5897('0x1f')]||'';_0x2fe024['read']=!![];if(this['message'][_0x5897('0x20')]){_0x2fe024['subject']='';_0x2fe024[_0x5897('0x20')]+=_[_0x5897('0x21')](this['message']['subject'],_0x5897('0x22'))?'':_0x5897('0x23');_0x2fe024[_0x5897('0x20')]+=this[_0x5897('0x1d')]['subject'];}}if(this[_0x5897('0xe')]===_0x5897('0x24')){_0x2fe024['ChatWebsiteId']=this[_0x5897('0x25')]['id'];}else{_0x2fe024[_[_0x5897('0x26')](this['channel'])+_0x5897('0x27')]=this[_0x5897('0x25')]['id'];}_0x2fe024[_['upperFirst'](this['channel'])+_0x5897('0x28')]=this['interaction']['id'];var _0x15fb61=this['interaction'];if(rpc[this[_0x5897('0xe')]+'Message']){if(this[_0x5897('0xe')]==='mail'){_0x2fe024['inReplyTo']=this[_0x5897('0x1d')][_0x5897('0x29')];_0x2fe024[_0x5897('0x2a')]=_0x5897('0x2b')+_['replace'](_0x2fe024[_0x5897('0x10')],_0x5897('0x2c'),_0x5897('0x2d'))+_0x5897('0x2e');_0x2fe024[_0x5897('0x2f')]={'Auto-Submitted':_0x5897('0x30'),'X-Auto-Response-Suppress':_0x5897('0x31'),'Precedence':_0x5897('0x32')};return mailRpc[_0x5897('0x33')](this[_0x5897('0x25')][_0x5897('0x34')],_0x2fe024)[_0x5897('0x35')](function(_0x394ec7){logger['info'](_0x5897('0x36'),_0x2d6f7a);_0x2fe024[_0x5897('0x29')]=_0x394ec7[_0x5897('0x1d')][_0x5897('0x29')];return rpc[_0x24f0a1+'Message']['create'](_0x2fe024);})[_0x5897('0x35')](function(_0x15b94a){logger['info'](_0x5897('0x13'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x15b94a));})[_0x5897('0x38')](function(_0x31c260){logger[_0x5897('0x39')](_0x5897('0x3a'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x31c260));})['finally'](function(){Promise[_0x5897('0x3b')]()[_0x5897('0x35')](function(){if(_0xba2255[0x0]!=='2'||_0x15fb61[_0x5897('0x18')])return;return rpc[_0x24f0a1+_0x5897('0x3c')]['update'](_0x15fb61['id'],{'autoreplyExecuted':!![]})[_0x5897('0x35')](function(_0x2d1138){logger[_0x5897('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2d6f7a,JSON[_0x5897('0x37')](_0x2d1138));})[_0x5897('0x38')](function(_0x3cc6eb){logger[_0x5897('0x39')](_0x5897('0x3d'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x3cc6eb));});})['then'](function(){_0x27aa08[_0x5897('0x15')]();});});}else{return rpc[this[_0x5897('0xe')]+'Message']['create'](_0x2fe024)['then'](function(){logger[_0x5897('0x12')](_0x5897('0x13'),_0x2d6f7a,_0x2fe024[_0x5897('0x10')]);})[_0x5897('0x38')](function(_0xa08598){logger[_0x5897('0x39')]('[%s][AUTOREPLY]\x20%s',_0x2d6f7a,JSON[_0x5897('0x37')](_0xa08598));})[_0x5897('0x3e')](function(){Promise['resolve']()['then'](function(){if(_0xba2255[0x0]!=='2'||_0x15fb61[_0x5897('0x18')])return;return rpc[_0x24f0a1+_0x5897('0x3c')][_0x5897('0x3f')](_0x15fb61['id'],{'autoreplyExecuted':!![]})[_0x5897('0x35')](function(_0x54aae1){logger['info'](_0x5897('0x40'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x54aae1));})[_0x5897('0x38')](function(_0x5974fb){logger['error'](_0x5897('0x3d'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x5974fb));});})[_0x5897('0x35')](function(){_0x27aa08['next']();});});}}}catch(_0x5a1fe9){logger[_0x5897('0x39')](_0x5897('0x13'),_0x2d6f7a,JSON[_0x5897('0x37')](_0x5a1fe9));_0x27aa08[_0x5897('0x41')]();}};}; \ No newline at end of file +var _0xfef6=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','replace','';_0x1b0f37[_0x6fef('0x36')]={'Auto-Submitted':_0x6fef('0x37'),'X-Auto-Response-Suppress':'All','Precedence':_0x6fef('0x38')};return mailRpc['sendMailMessage'](this['account'][_0x6fef('0x39')],_0x1b0f37)[_0x6fef('0x3a')](function(_0x1c2e08){logger['info'](_0x6fef('0x3b'),_0x201e4c);_0x1b0f37['messageId']=_0x1c2e08[_0x6fef('0x21')][_0x6fef('0x30')];return rpc[_0x3778e8+'Message'][_0x6fef('0x3c')](_0x1b0f37);})[_0x6fef('0x3a')](function(_0x470cb7){logger['info'](_0x6fef('0x14'),_0x201e4c,JSON[_0x6fef('0x3d')](_0x470cb7));})[_0x6fef('0x3e')](function(_0x5e7486){logger[_0x6fef('0x3f')](_0x6fef('0x40'),_0x201e4c,JSON[_0x6fef('0x3d')](_0x5e7486));})[_0x6fef('0x41')](function(){Promise['resolve']()['then'](function(){if(_0x5c1673[0x0]!=='2'||_0x4a23d4[_0x6fef('0x1a')])return;return rpc[_0x3778e8+_0x6fef('0x42')][_0x6fef('0x43')](_0x4a23d4['id'],{'autoreplyExecuted':!![]})[_0x6fef('0x3a')](function(_0x575380){logger[_0x6fef('0x13')](_0x6fef('0x1b'),_0x201e4c,JSON[_0x6fef('0x3d')](_0x575380));})[_0x6fef('0x3e')](function(_0x45dcc8){logger[_0x6fef('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x201e4c,JSON[_0x6fef('0x3d')](_0x45dcc8));});})[_0x6fef('0x3a')](function(){_0x1607c3[_0x6fef('0x19')]();});});}else{return rpc[this[_0x6fef('0x1f')]+_0x6fef('0x2e')][_0x6fef('0x3c')](_0x1b0f37)[_0x6fef('0x3a')](function(){logger[_0x6fef('0x13')](_0x6fef('0x14'),_0x201e4c,_0x1b0f37[_0x6fef('0x11')]);})[_0x6fef('0x3e')](function(_0x275112){logger['error'](_0x6fef('0x14'),_0x201e4c,JSON[_0x6fef('0x3d')](_0x275112));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x5c1673[0x0]!=='2'||_0x4a23d4[_0x6fef('0x1a')])return;return rpc[_0x3778e8+_0x6fef('0x42')][_0x6fef('0x43')](_0x4a23d4['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1f9f84){logger[_0x6fef('0x13')](_0x6fef('0x1b'),_0x201e4c,JSON[_0x6fef('0x3d')](_0x1f9f84));})[_0x6fef('0x3e')](function(_0x38e564){logger[_0x6fef('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x201e4c,JSON[_0x6fef('0x3d')](_0x38e564));});})[_0x6fef('0x3a')](function(){_0x1607c3['next']();});});}}}catch(_0xb6c096){logger[_0x6fef('0x3f')]('[%s][AUTOREPLY]\x20%s',_0x201e4c,JSON[_0x6fef('0x3d')](_0xb6c096));_0x1607c3[_0x6fef('0x44')]();}};}; \ 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 da19024..570c86c 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 _0x5164=['../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x95e2c9,_0x230d15){var _0x3a687f=function(_0x26415a){while(--_0x26415a){_0x95e2c9['push'](_0x95e2c9['shift']());}};_0x3a687f(++_0x230d15);}(_0x5164,0x1da));var _0x4516=function(_0x4e9bf9,_0x1b68f8){_0x4e9bf9=_0x4e9bf9-0x0;var _0x556466=_0x5164[_0x4e9bf9];return _0x556466;};'use strict';var moment=require(_0x4516('0x0'));var logger=require(_0x4516('0x1'))('routing');var rpc={'chatInteraction':require(_0x4516('0x2')),'openchannelInteraction':require(_0x4516('0x3')),'smsInteraction':require(_0x4516('0x4')),'mailInteraction':require(_0x4516('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x4516('0x6'))};exports[_0x4516('0x7')]=function(_0x228f03,_0x4e595b,_0x55e975,_0x44630c){return function(_0x56c1f9){try{logger[_0x4516('0x8')](_0x4516('0x9'),_0x228f03,_0x4e595b[0x0]);var _0x2da918={'closed':0x1,'closedAt':moment()['format'](_0x4516('0xa')),'closeReason':_0x4516('0xb'),'disposition':_0x4e595b[0x0]};if(rpc[_0x44630c[_0x4516('0xc')]+_0x4516('0xd')]){rpc[_0x44630c['channel']+_0x4516('0xd')][_0x4516('0xe')](_0x44630c[_0x4516('0xf')]['id'],_0x2da918)[_0x4516('0x10')](function(_0x4ea6a0){logger[_0x4516('0x8')](_0x4516('0x11'),_0x228f03,_0x44630c[_0x4516('0xf')]['id']);})[_0x4516('0x12')](function(_0x9b1808){logger[_0x4516('0x13')](_0x4516('0x14'),_0x228f03,JSON[_0x4516('0x15')](_0x9b1808));})[_0x4516('0x16')](function(){_0x56c1f9[_0x4516('0x17')]();});}}catch(_0x350748){logger[_0x4516('0x13')](_0x4516('0x14'),_0x228f03,JSON[_0x4516('0x15')](_0x350748));_0x56c1f9[_0x4516('0x17')]();}};}; \ No newline at end of file +var _0x3969=['channel','Interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','[%s][CLOSE]\x20%s','stringify','finally','stop','error','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xb1ed15,_0x59423c){var _0x57bb67=function(_0x2eeb07){while(--_0x2eeb07){_0xb1ed15['push'](_0xb1ed15['shift']());}};_0x57bb67(++_0x59423c);}(_0x3969,0x1c2));var _0x9396=function(_0xac254b,_0x13af7e){_0xac254b=_0xac254b-0x0;var _0x54d336=_0x3969[_0xac254b];return _0x54d336;};'use strict';var moment=require('moment');var logger=require(_0x9396('0x0'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9396('0x1')),'smsInteraction':require(_0x9396('0x2')),'mailInteraction':require(_0x9396('0x3')),'faxInteraction':require(_0x9396('0x4')),'whatsappInteraction':require(_0x9396('0x5'))};exports[_0x9396('0x6')]=function(_0x241add,_0x3139bc,_0x23bc96,_0x15561e){return function(_0x24630f){try{logger[_0x9396('0x7')](_0x9396('0x8'),_0x241add,_0x3139bc[0x0]);var _0x334e47={'closed':0x1,'closedAt':moment()['format'](_0x9396('0x9')),'closeReason':'system','disposition':_0x3139bc[0x0]};if(rpc[_0x15561e[_0x9396('0xa')]+_0x9396('0xb')]){rpc[_0x15561e['channel']+_0x9396('0xb')]['update'](_0x15561e['interaction']['id'],_0x334e47)[_0x9396('0xc')](function(_0x3ad41c){logger['info'](_0x9396('0xd'),_0x241add,_0x15561e[_0x9396('0xe')]['id']);})['catch'](function(_0x336d9e){logger['error'](_0x9396('0xf'),_0x241add,JSON[_0x9396('0x10')](_0x336d9e));})[_0x9396('0x11')](function(){_0x24630f[_0x9396('0x12')]();});}}catch(_0x444bd3){logger[_0x9396('0x13')](_0x9396('0xf'),_0x241add,JSON[_0x9396('0x10')](_0x444bd3));_0x24630f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 4639354..0f0b411 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 _0x9a14=['AccountId','InteractionId','created','body','getMustacheRender','create','error','[%s][DIALOGFLOW]\x20%s','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','dialogflow','result','fulfillment','speech','providerName','stringify','Message','metadata','catch','message','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst'];(function(_0x18f21e,_0x175491){var _0x47f718=function(_0x31e354){while(--_0x31e354){_0x18f21e['push'](_0x18f21e['shift']());}};_0x47f718(++_0x175491);}(_0x9a14,0xa8));var _0x49a1=function(_0x4b743d,_0x59878d){_0x4b743d=_0x4b743d-0x0;var _0x4440e1=_0x9a14[_0x4b743d];return _0x4440e1;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x49a1('0x0'));var md5=require(_0x49a1('0x1'));var utils=require(_0x49a1('0x2'));var logger=require(_0x49a1('0x3'))(_0x49a1('0x4'));var rpc={'chatMessage':require(_0x49a1('0x5')),'openchannelMessage':require(_0x49a1('0x6')),'mailMessage':require(_0x49a1('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x9394fc,_0x2b210c){return function(_0x7ef1ba){try{if(!_['isNil'](this[_0x49a1('0x8')][_0x49a1('0x9')])){logger[_0x49a1('0xa')]('[%s][DIALOGFLOW]\x20%s',_0x9394fc,_0x49a1('0xb'));return _0x7ef1ba[_0x49a1('0xc')]();}var _0x572dea={'ContactId':this[_0x49a1('0xd')]['id'],'sentAt':moment()[_0x49a1('0xe')](_0x49a1('0xf')),'direction':_0x49a1('0x10')};if(this[_0x49a1('0x11')]==='sms'||this[_0x49a1('0x11')]===_0x49a1('0x12')){_0x572dea[_0x49a1('0x13')]=this[_0x49a1('0x8')][_0x49a1('0x13')];}var _0x420029=this[_0x49a1('0x11')];if(_0x420029===_0x49a1('0x14')){_0x572dea[_0x49a1('0x15')]=this[_0x49a1('0x16')]['id'];}else{_0x572dea[_[_0x49a1('0x17')](_0x420029)+_0x49a1('0x18')]=this[_0x49a1('0x16')]['id'];}_0x572dea[_[_0x49a1('0x17')](_0x420029)+_0x49a1('0x19')]=this['interaction']['id'];if(this[_0x49a1('0x8')][_0x49a1('0x1a')]){var _0x20aa5d=_0x2b210c[0x2];if(!_['isEmpty'](_0x20aa5d)){_0x572dea[_0x49a1('0x1b')]=utils[_0x49a1('0x1c')](_0x20aa5d,this);return rpc[_0x420029+'Message'][_0x49a1('0x1d')](_0x572dea)['then'](function(_0x3c1352){logger[_0x49a1('0xa')]('[%s][DIALOGFLOW]\x20%s',_0x9394fc,_0x572dea[_0x49a1('0x1b')]);})['catch'](function(_0x3578ec){logger[_0x49a1('0x1e')](_0x49a1('0x1f'),_0x9394fc,JSON['stringify'](_0x3578ec));})[_0x49a1('0x20')](function(){logger[_0x49a1('0xa')](_0x49a1('0x21'),_0x9394fc);_0x7ef1ba[_0x49a1('0x22')]();});}else{logger[_0x49a1('0xa')](_0x49a1('0x23'),_0x9394fc);_0x7ef1ba['stop']();}}else{var _0xe5c860=this;var _0x108d66=apiai(_0x2b210c[0x0],{'language':_0x2b210c[0x1]||'en'});return _0x108d66[_0x49a1('0x24')](this['message'][_0x49a1('0x1b')],{'sessionId':md5(this[_0x49a1('0x8')]['id'])})[_0x49a1('0x25')](function(_0x4b4bf3){_0xe5c860['body'][_0x49a1('0x26')]=_0x4b4bf3;_0x572dea[_0x49a1('0x1b')]=_0x4b4bf3[_0x49a1('0x27')][_0x49a1('0x28')][_0x49a1('0x29')];_0x572dea[_0x49a1('0x2a')]=_0x49a1('0x26');_0x572dea['providerResponse']=JSON[_0x49a1('0x2b')](_0x4b4bf3);return rpc[_0x420029+_0x49a1('0x2c')][_0x49a1('0x1d')](_0x572dea)[_0x49a1('0x25')](function(_0x20af10){logger[_0x49a1('0xa')](_0x49a1('0x1f'),_0x9394fc,_0x572dea[_0x49a1('0x1b')]);if(_0x4b4bf3['result'][_0x49a1('0x2d')]['endConversation']){_0x7ef1ba['next']();}else{_0x7ef1ba['stop']();}})[_0x49a1('0x2e')](function(_0x14f0a9){logger[_0x49a1('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x9394fc,JSON[_0x49a1('0x2b')](_0x14f0a9));_0x7ef1ba[_0x49a1('0xc')]();});})[_0x49a1('0x2e')](function(_0x330ec6){logger[_0x49a1('0x1e')](_0x49a1('0x1f'),_0x9394fc,_0x330ec6[_0x49a1('0x2f')]);_0x7ef1ba[_0x49a1('0xc')]();});}}catch(_0x3b6b86){logger[_0x49a1('0x1e')](_0x49a1('0x1f'),_0x9394fc,JSON[_0x49a1('0x2b')](_0x3b6b86));_0x7ef1ba[_0x49a1('0x22')]();}};}; \ No newline at end of file +var _0x91c6=['then','info','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','speech','providerName','providerResponse','catch','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','body','getMustacheRender','Message','create'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x91c6,0xf9));var _0x691c=function(_0x68410e,_0x592b35){_0x68410e=_0x68410e-0x0;var _0xa0bcbd=_0x91c6[_0x68410e];return _0xa0bcbd;};'use strict';var _=require(_0x691c('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x691c('0x1'));var utils=require(_0x691c('0x2'));var logger=require(_0x691c('0x3'))(_0x691c('0x4'));var rpc={'chatMessage':require(_0x691c('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x691c('0x6')),'smsMessage':require(_0x691c('0x7')),'faxMessage':require(_0x691c('0x8')),'whatsappMessage':require(_0x691c('0x9'))};exports[_0x691c('0xa')]=function(_0x29876a,_0x5ccbe0){return function(_0x93b7b0){try{if(!_[_0x691c('0xb')](this[_0x691c('0xc')][_0x691c('0xd')])){logger['info'](_0x691c('0xe'),_0x29876a,_0x691c('0xf'));return _0x93b7b0[_0x691c('0x10')]();}var _0x53c1eb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x691c('0x11')),'direction':_0x691c('0x12')};if(this[_0x691c('0x13')]===_0x691c('0x14')||this['channel']==='whatsapp'){_0x53c1eb[_0x691c('0x15')]=this[_0x691c('0xc')][_0x691c('0x15')];}var _0x445f33=this[_0x691c('0x13')];if(_0x445f33===_0x691c('0x16')){_0x53c1eb[_0x691c('0x17')]=this[_0x691c('0x18')]['id'];}else{_0x53c1eb[_['upperFirst'](_0x445f33)+_0x691c('0x19')]=this[_0x691c('0x18')]['id'];}_0x53c1eb[_[_0x691c('0x1a')](_0x445f33)+_0x691c('0x1b')]=this[_0x691c('0xc')]['id'];if(this[_0x691c('0xc')][_0x691c('0x1c')]){var _0x6b9f85=_0x5ccbe0[0x2];if(!_['isEmpty'](_0x6b9f85)){_0x53c1eb[_0x691c('0x1d')]=utils[_0x691c('0x1e')](_0x6b9f85,this);return rpc[_0x445f33+_0x691c('0x1f')][_0x691c('0x20')](_0x53c1eb)[_0x691c('0x21')](function(_0x522ad0){logger[_0x691c('0x22')](_0x691c('0xe'),_0x29876a,_0x53c1eb['body']);})['catch'](function(_0x5ae47e){logger[_0x691c('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x29876a,JSON[_0x691c('0x24')](_0x5ae47e));})['finally'](function(){logger['info'](_0x691c('0x25'),_0x29876a);_0x93b7b0[_0x691c('0x26')]();});}else{logger[_0x691c('0x22')](_0x691c('0x27'),_0x29876a);_0x93b7b0[_0x691c('0x26')]();}}else{var _0x59d3de=this;var _0xd1e967=apiai(_0x5ccbe0[0x0],{'language':_0x5ccbe0[0x1]||'en'});return _0xd1e967['textRequest'](this[_0x691c('0x28')]['body'],{'sessionId':md5(this[_0x691c('0xc')]['id'])})[_0x691c('0x21')](function(_0x63e21c){_0x59d3de[_0x691c('0x1d')][_0x691c('0x29')]=_0x63e21c;_0x53c1eb['body']=_0x63e21c[_0x691c('0x2a')]['fulfillment'][_0x691c('0x2b')];_0x53c1eb[_0x691c('0x2c')]=_0x691c('0x29');_0x53c1eb[_0x691c('0x2d')]=JSON[_0x691c('0x24')](_0x63e21c);return rpc[_0x445f33+_0x691c('0x1f')][_0x691c('0x20')](_0x53c1eb)[_0x691c('0x21')](function(_0x54a16d){logger[_0x691c('0x22')](_0x691c('0xe'),_0x29876a,_0x53c1eb[_0x691c('0x1d')]);if(_0x63e21c[_0x691c('0x2a')]['metadata']['endConversation']){_0x93b7b0[_0x691c('0x10')]();}else{_0x93b7b0[_0x691c('0x26')]();}})['catch'](function(_0x26dfb1){logger['error'](_0x691c('0xe'),_0x29876a,JSON['stringify'](_0x26dfb1));_0x93b7b0[_0x691c('0x10')]();});})[_0x691c('0x2e')](function(_0x21c531){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x29876a,_0x21c531[_0x691c('0x28')]);_0x93b7b0[_0x691c('0x10')]();});}}catch(_0x203e2e){logger[_0x691c('0x23')](_0x691c('0xe'),_0x29876a,JSON[_0x691c('0x24')](_0x203e2e));_0x93b7b0[_0x691c('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 a780085..991c352 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 _0xafff=['all','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','channel','sms','whatsapp','phone','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','body','error','finally','stop','replace','sessionPath','message','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','push','fulfillmentText'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0xafff,0x112));var _0xfaff=function(_0x368c3f,_0x215ba5){_0x368c3f=_0x368c3f-0x0;var _0x4abd7a=_0xafff[_0x368c3f];return _0x4abd7a;};'use strict';var _=require(_0xfaff('0x0'));var dialogflow=require(_0xfaff('0x1'));var md5=require(_0xfaff('0x2'));var moment=require('moment');var Promise=require(_0xfaff('0x3'));var logger=require(_0xfaff('0x4'))('routing');var utils=require(_0xfaff('0x5'));var rpc={'chatMessage':require(_0xfaff('0x6')),'openchannelMessage':require(_0xfaff('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfaff('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x5422e5,_0x4e2c20,_0x48e661,_0x510264){return new Promise(function(_0xf20981,_0x260c0b){var _0x232e3e=_[_0xfaff('0x9')](_0x48e661);_0x232e3e['body']=_0x510264;return rpc[_0x4e2c20+_0xfaff('0xa')][_0xfaff('0xb')](_0x232e3e)[_0xfaff('0xc')](function(){logger[_0xfaff('0xd')](_0xfaff('0xe'),_0x5422e5,_0x232e3e['body']);_0xf20981();})[_0xfaff('0xf')](function(_0x43e95){logger['error'](_0xfaff('0xe'),_0x5422e5,JSON[_0xfaff('0x10')](_0x43e95));_0x260c0b(_0x43e95);});});}exports[_0xfaff('0x11')]=function(_0x3b8be1,_0xf9d539){return function(_0x262e53){try{if(!_[_0xfaff('0x12')](this[_0xfaff('0x13')][_0xfaff('0x14')])){logger[_0xfaff('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x3b8be1,_0xfaff('0x15'));return _0x262e53[_0xfaff('0x16')]();}var _0x20e759={'ContactId':this[_0xfaff('0x17')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xfaff('0x18')]===_0xfaff('0x19')||this[_0xfaff('0x18')]===_0xfaff('0x1a')){_0x20e759[_0xfaff('0x1b')]=this[_0xfaff('0x13')]['phone'];}var _0x7a4c05=this[_0xfaff('0x18')];if(_0x7a4c05==='chat'){_0x20e759[_0xfaff('0x1c')]=this['account']['id'];}else{_0x20e759[_['upperFirst'](_0x7a4c05)+_0xfaff('0x1d')]=this['account']['id'];}_0x20e759[_[_0xfaff('0x1e')](_0x7a4c05)+_0xfaff('0x1f')]=this[_0xfaff('0x13')]['id'];if(this['interaction'][_0xfaff('0x20')]){var _0x2ab0e4=_0xf9d539[0x4];if(!_[_0xfaff('0x21')](_0x2ab0e4)){_0x20e759['body']=utils[_0xfaff('0x22')](_0x2ab0e4,this);return rpc[_0x7a4c05+_0xfaff('0xa')][_0xfaff('0xb')](_0x20e759)['then'](function(_0x3345d2){logger[_0xfaff('0xd')](_0xfaff('0xe'),_0x3b8be1,_0x20e759[_0xfaff('0x23')]);})[_0xfaff('0xf')](function(_0x376861){logger[_0xfaff('0x24')](_0xfaff('0xe'),_0x3b8be1,JSON[_0xfaff('0x10')](_0x376861));})[_0xfaff('0x25')](function(){logger[_0xfaff('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3b8be1);_0x262e53[_0xfaff('0x26')]();});}else{logger[_0xfaff('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3b8be1);_0x262e53[_0xfaff('0x26')]();}}else{var _0x2948f7=this;var _0x41c280=_0xf9d539[0x2][_0xfaff('0x27')](/\\n/g,'\x0a');var _0x39b4d0={'credentials':{'private_key':_0x41c280,'client_email':_0xf9d539[0x1]}};var _0x514018=new dialogflow['SessionsClient'](_0x39b4d0);var _0x2cb472=_0x514018[_0xfaff('0x28')](_0xf9d539[0x0],md5(_0x2948f7[_0xfaff('0x13')]['id']));var _0x573ec8={'session':_0x2cb472,'queryInput':{'text':{'text':_0x2948f7[_0xfaff('0x29')][_0xfaff('0x23')],'languageCode':_0xf9d539[0x3]||'en'}}};return _0x514018['detectIntent'](_0x573ec8)[_0xfaff('0xc')](function(_0x5cd9a4){if(_0x5cd9a4&&_0x5cd9a4[_0xfaff('0x2a')]){_0x2948f7[_0xfaff('0x23')][_0xfaff('0x2b')]=_0x5cd9a4;var _0xfd0140=_0x5cd9a4[0x0];var _0x1fd15f=_0xfd0140['queryResult'][_0xfaff('0x2c')]&&_0xfd0140[_0xfaff('0x2d')][_0xfaff('0x2c')][_0xfaff('0x2e')]?_0xfd0140['queryResult'][_0xfaff('0x2c')]['fields'][_0xfaff('0x2f')]['boolValue']:![];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x30')]=_0xfd0140['queryResult'][_0xfaff('0x31')];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x32')]=_0xfd0140[_0xfaff('0x2d')][_0xfaff('0x33')];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x34')]=_0xfd0140['queryResult']['diagnosticInfo']&&_0xfd0140[_0xfaff('0x2d')]['diagnosticInfo']['fields']?_0xfd0140[_0xfaff('0x2d')][_0xfaff('0x2c')][_0xfaff('0x2e')]['end_conversation'][_0xfaff('0x35')]:![];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x36')]=_0xfd0140[_0xfaff('0x2d')]['intent'][_0xfaff('0x37')];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x38')]=_0xfd0140[_0xfaff('0x2d')][_0xfaff('0x39')]['displayName'];_0x2948f7['body'][_0xfaff('0x3a')]=_0xfd0140[_0xfaff('0x2d')][_0xfaff('0x39')][_0xfaff('0x3b')];_0x2948f7[_0xfaff('0x23')][_0xfaff('0x3c')]=_0xfd0140[_0xfaff('0x2d')]['languageCode'];_0x2948f7[_0xfaff('0x23')]['DIALOGFLOWV2_QUERYTEXT']=_0xfd0140[_0xfaff('0x2d')]['queryText'];_0x2948f7['body'][_0xfaff('0x3d')]=_0xfd0140['queryResult'][_0xfaff('0x3e')];_0x20e759[_0xfaff('0x3f')]=_0xfaff('0x2b');_0x20e759['providerResponse']=JSON['stringify'](_0x5cd9a4);var _0x72ce6c=[];for(var _0x3da53a=0x0;_0x3da53a<_0x5cd9a4['length'];_0x3da53a++){var _0x162ab5=_0x5cd9a4[_0x3da53a];if(_0x162ab5&&_0x162ab5[_0xfaff('0x2d')]&&_0x162ab5['queryResult']['fulfillmentText']){_0x72ce6c[_0xfaff('0x40')](createMessage(_0x3b8be1,_0x7a4c05,_0x20e759,_0x162ab5[_0xfaff('0x2d')][_0xfaff('0x41')]));}}return Promise[_0xfaff('0x42')](_0x72ce6c)[_0xfaff('0xc')](function(){if(_0x1fd15f){_0x262e53[_0xfaff('0x16')]();}else{_0x262e53[_0xfaff('0x26')]();}})[_0xfaff('0xf')](function(_0x3417af){logger[_0xfaff('0x24')](_0xfaff('0xe'),_0x3b8be1,JSON[_0xfaff('0x10')](_0x3417af));_0x262e53[_0xfaff('0x16')]();});}})['catch'](function(_0x29b4e0){logger[_0xfaff('0x24')](_0xfaff('0xe'),_0x3b8be1,_0x29b4e0[_0xfaff('0x29')],_0x29b4e0[_0xfaff('0x43')]);_0x262e53['next']();});}}catch(_0x309705){logger[_0xfaff('0x24')](_0xfaff('0xe'),_0x3b8be1,JSON[_0xfaff('0x10')](_0x309705));_0x262e53[_0xfaff('0x26')]();}};}; \ No newline at end of file +var _0xe27a=['sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','all','message','lodash','dialogflow','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','interaction','UserId','info','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xe27a,0x184));var _0xae27=function(_0x3c2caa,_0x138dcf){_0x3c2caa=_0x3c2caa-0x0;var _0x164a9d=_0xe27a[_0x3c2caa];return _0x164a9d;};'use strict';var _=require(_0xae27('0x0'));var dialogflow=require(_0xae27('0x1'));var md5=require('md5');var moment=require(_0xae27('0x2'));var Promise=require('bluebird');var logger=require(_0xae27('0x3'))(_0xae27('0x4'));var utils=require(_0xae27('0x5'));var rpc={'chatMessage':require(_0xae27('0x6')),'openchannelMessage':require(_0xae27('0x7')),'mailMessage':require(_0xae27('0x8')),'smsMessage':require(_0xae27('0x9')),'faxMessage':require(_0xae27('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x30be4b,_0x5268d5,_0x4b5ec7,_0x5902bb){return new Promise(function(_0x307250,_0x861678){var _0x22d01b=_[_0xae27('0xb')](_0x4b5ec7);_0x22d01b[_0xae27('0xc')]=_0x5902bb;return rpc[_0x5268d5+'Message'][_0xae27('0xd')](_0x22d01b)[_0xae27('0xe')](function(){logger['info'](_0xae27('0xf'),_0x30be4b,_0x22d01b['body']);_0x307250();})[_0xae27('0x10')](function(_0x874121){logger[_0xae27('0x11')](_0xae27('0xf'),_0x30be4b,JSON[_0xae27('0x12')](_0x874121));_0x861678(_0x874121);});});}exports['consequence']=function(_0x358bc8,_0x21e23a){return function(_0x3d652f){try{if(!_[_0xae27('0x13')](this[_0xae27('0x14')][_0xae27('0x15')])){logger[_0xae27('0x16')](_0xae27('0xf'),_0x358bc8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3d652f[_0xae27('0x17')]();}var _0x54505e={'ContactId':this['contact']['id'],'sentAt':moment()[_0xae27('0x18')](_0xae27('0x19')),'direction':'out'};if(this[_0xae27('0x1a')]==='sms'||this[_0xae27('0x1a')]===_0xae27('0x1b')){_0x54505e[_0xae27('0x1c')]=this[_0xae27('0x14')][_0xae27('0x1c')];}var _0x53630e=this['channel'];if(_0x53630e===_0xae27('0x1d')){_0x54505e[_0xae27('0x1e')]=this[_0xae27('0x1f')]['id'];}else{_0x54505e[_['upperFirst'](_0x53630e)+_0xae27('0x20')]=this[_0xae27('0x1f')]['id'];}_0x54505e[_[_0xae27('0x21')](_0x53630e)+_0xae27('0x22')]=this['interaction']['id'];if(this[_0xae27('0x14')][_0xae27('0x23')]){var _0x414a59=_0x21e23a[0x4];if(!_[_0xae27('0x24')](_0x414a59)){_0x54505e[_0xae27('0xc')]=utils[_0xae27('0x25')](_0x414a59,this);return rpc[_0x53630e+_0xae27('0x26')][_0xae27('0xd')](_0x54505e)[_0xae27('0xe')](function(_0x550341){logger['info'](_0xae27('0xf'),_0x358bc8,_0x54505e[_0xae27('0xc')]);})[_0xae27('0x10')](function(_0x4bb88a){logger[_0xae27('0x11')](_0xae27('0xf'),_0x358bc8,JSON[_0xae27('0x12')](_0x4bb88a));})[_0xae27('0x27')](function(){logger['info'](_0xae27('0x28'),_0x358bc8);_0x3d652f[_0xae27('0x29')]();});}else{logger[_0xae27('0x16')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x358bc8);_0x3d652f[_0xae27('0x29')]();}}else{var _0x46030c=this;var _0x5c41fe=_0x21e23a[0x2][_0xae27('0x2a')](/\\n/g,'\x0a');var _0x340866={'credentials':{'private_key':_0x5c41fe,'client_email':_0x21e23a[0x1]}};var _0x1f8fee=new dialogflow[(_0xae27('0x2b'))](_0x340866);var _0xc99c13=_0x1f8fee[_0xae27('0x2c')](_0x21e23a[0x0],md5(_0x46030c['interaction']['id']));var _0x5c587f={'session':_0xc99c13,'queryInput':{'text':{'text':_0x46030c['message']['body'],'languageCode':_0x21e23a[0x3]||'en'}}};return _0x1f8fee[_0xae27('0x2d')](_0x5c587f)[_0xae27('0xe')](function(_0x3584c9){if(_0x3584c9&&_0x3584c9[_0xae27('0x2e')]){_0x46030c[_0xae27('0xc')][_0xae27('0x2f')]=_0x3584c9;var _0x3490e9=_0x3584c9[0x0];var _0x4dcd40=_0x3490e9[_0xae27('0x30')][_0xae27('0x31')]&&_0x3490e9[_0xae27('0x30')][_0xae27('0x31')]['fields']?_0x3490e9[_0xae27('0x30')][_0xae27('0x31')][_0xae27('0x32')][_0xae27('0x33')][_0xae27('0x34')]:![];_0x46030c[_0xae27('0xc')][_0xae27('0x35')]=_0x3490e9[_0xae27('0x30')][_0xae27('0x36')];_0x46030c['body'][_0xae27('0x37')]=_0x3490e9[_0xae27('0x30')][_0xae27('0x38')];_0x46030c['body'][_0xae27('0x39')]=_0x3490e9[_0xae27('0x30')][_0xae27('0x31')]&&_0x3490e9[_0xae27('0x30')][_0xae27('0x31')]['fields']?_0x3490e9[_0xae27('0x30')]['diagnosticInfo']['fields'][_0xae27('0x33')][_0xae27('0x34')]:![];_0x46030c[_0xae27('0xc')][_0xae27('0x3a')]=_0x3490e9[_0xae27('0x30')][_0xae27('0x3b')][_0xae27('0x3c')];_0x46030c[_0xae27('0xc')][_0xae27('0x3d')]=_0x3490e9[_0xae27('0x30')]['intent']['displayName'];_0x46030c[_0xae27('0xc')][_0xae27('0x3e')]=_0x3490e9['queryResult'][_0xae27('0x3b')][_0xae27('0x3f')];_0x46030c[_0xae27('0xc')][_0xae27('0x40')]=_0x3490e9[_0xae27('0x30')]['languageCode'];_0x46030c[_0xae27('0xc')]['DIALOGFLOWV2_QUERYTEXT']=_0x3490e9[_0xae27('0x30')][_0xae27('0x41')];_0x46030c[_0xae27('0xc')][_0xae27('0x42')]=_0x3490e9[_0xae27('0x30')][_0xae27('0x43')];_0x54505e[_0xae27('0x44')]=_0xae27('0x2f');_0x54505e['providerResponse']=JSON[_0xae27('0x12')](_0x3584c9);var _0x4838f0=[];for(var _0x3cffc7=0x0;_0x3cffc7<_0x3584c9['length'];_0x3cffc7++){var _0x36f740=_0x3584c9[_0x3cffc7];if(_0x36f740&&_0x36f740['queryResult']&&_0x36f740[_0xae27('0x30')]['fulfillmentText']){_0x4838f0['push'](createMessage(_0x358bc8,_0x53630e,_0x54505e,_0x36f740[_0xae27('0x30')][_0xae27('0x45')]));}}return Promise[_0xae27('0x46')](_0x4838f0)[_0xae27('0xe')](function(){if(_0x4dcd40){_0x3d652f[_0xae27('0x17')]();}else{_0x3d652f[_0xae27('0x29')]();}})[_0xae27('0x10')](function(_0xc55233){logger[_0xae27('0x11')](_0xae27('0xf'),_0x358bc8,JSON['stringify'](_0xc55233));_0x3d652f[_0xae27('0x17')]();});}})[_0xae27('0x10')](function(_0x25eed6){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x358bc8,_0x25eed6[_0xae27('0x47')],_0x25eed6['stack']);_0x3d652f[_0xae27('0x17')]();});}}catch(_0x2e91fd){logger[_0xae27('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x358bc8,JSON[_0xae27('0x12')](_0x2e91fd));_0x3d652f[_0xae27('0x29')]();}};}; \ 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 68fa756..75415f3 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 _0xe2ff=['[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','info','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','replace','length','error'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0xe2ff,0x160));var _0xfe2f=function(_0x638984,_0x24b52a){_0x638984=_0x638984-0x0;var _0x2c0f0e=_0xe2ff[_0x638984];return _0x2c0f0e;};'use strict';var schema=require(_0xfe2f('0x0'));var _=require(_0xfe2f('0x1'));var htmlToText=require(_0xfe2f('0x2'));var utils=require('./utils');var logger=require(_0xfe2f('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xfe2f('0x4')},'priorityTrue':{'type':_0xfe2f('0x5'),'message':_0xfe2f('0x6')},'priorityFalse':{'type':_0xfe2f('0x5'),'message':_0xfe2f('0x7')}});exports['consequence']=function(_0xfc41ae,_0x23a73c){return function(_0x188fed){try{var _0x31c4a0={'condition':htmlToText[_0xfe2f('0x8')](utils['getMustacheRender'](_0x23a73c[0x0],this),{'wordwrap':![]})[_0xfe2f('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x23a73c[0x1],'priorityFalse':_0x23a73c[0x2]};var _0x4613fd=gotoif[_0xfe2f('0x0')](_0x31c4a0,{'typecast':!![]});if(_0x4613fd[_0xfe2f('0xa')]){logger[_0xfe2f('0xb')](_0xfe2f('0xc'),_0xfc41ae,_[_0xfe2f('0xd')](_0x4613fd,'message')[_0xfe2f('0xe')](',\x20'));_0x188fed[_0xfe2f('0xf')]();}else{try{var _0x41ba22=eval('('+_0x31c4a0['condition']+')');var _0x37b8b1=_0x41ba22?_0x31c4a0[_0xfe2f('0x10')]:_0x31c4a0['priorityFalse'];logger[_0xfe2f('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xfc41ae,_0x31c4a0[_0xfe2f('0x12')],_0x41ba22,_0x37b8b1||_0xfe2f('0x13'));if(_0x37b8b1){var _0x44d963=_['findIndex'](_0x188fed[_0xfe2f('0x14')](),{'p':_0x37b8b1});if(_0x44d963>=0x0){logger[_0xfe2f('0x11')](_0xfe2f('0x15'),_0xfc41ae,_0x37b8b1||_0xfe2f('0x13'),_0x44d963);_0x188fed[_0xfe2f('0x13')](_0x44d963);}else{logger[_0xfe2f('0x11')](_0xfe2f('0x16'),_0xfc41ae,_0x37b8b1||_0xfe2f('0x13'));_0x188fed[_0xfe2f('0xf')]();}}else{_0x188fed[_0xfe2f('0x13')]();}}catch(_0x430502){logger[_0xfe2f('0xb')](_0xfe2f('0x17'),_0xfc41ae,_0x430502[_0xfe2f('0x18')]);_0x188fed[_0xfe2f('0xf')]();}}}catch(_0x4dbafc){logger['error'](_0xfe2f('0xc'),_0xfc41ae,JSON[_0xfe2f('0x19')](_0x4dbafc));_0x188fed[_0xfe2f('0xf')]();}};}; \ No newline at end of file +var _0x8f16=['replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString'];(function(_0x1f0529,_0x57e665){var _0x43bfe6=function(_0x26d886){while(--_0x26d886){_0x1f0529['push'](_0x1f0529['shift']());}};_0x43bfe6(++_0x57e665);}(_0x8f16,0x139));var _0x68f1=function(_0x5518cd,_0xa3de1d){_0x5518cd=_0x5518cd-0x0;var _0x227323=_0x8f16[_0x5518cd];return _0x227323;};'use strict';var schema=require('validate');var _=require(_0x68f1('0x0'));var htmlToText=require(_0x68f1('0x1'));var utils=require(_0x68f1('0x2'));var logger=require(_0x68f1('0x3'))(_0x68f1('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x68f1('0x5')},'priorityTrue':{'type':_0x68f1('0x6'),'message':_0x68f1('0x7')},'priorityFalse':{'type':_0x68f1('0x6'),'message':_0x68f1('0x8')}});exports[_0x68f1('0x9')]=function(_0x226f26,_0x6b5cf9){return function(_0x53e854){try{var _0x39b9bd={'condition':htmlToText[_0x68f1('0xa')](utils['getMustacheRender'](_0x6b5cf9[0x0],this),{'wordwrap':![]})[_0x68f1('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x6b5cf9[0x1],'priorityFalse':_0x6b5cf9[0x2]};var _0x307147=gotoif[_0x68f1('0xc')](_0x39b9bd,{'typecast':!![]});if(_0x307147[_0x68f1('0xd')]){logger[_0x68f1('0xe')](_0x68f1('0xf'),_0x226f26,_[_0x68f1('0x10')](_0x307147,_0x68f1('0x11'))[_0x68f1('0x12')](',\x20'));_0x53e854[_0x68f1('0x13')]();}else{try{var _0x461398=eval('('+_0x39b9bd[_0x68f1('0x14')]+')');var _0xfcebc9=_0x461398?_0x39b9bd['priorityTrue']:_0x39b9bd['priorityFalse'];logger[_0x68f1('0x15')](_0x68f1('0x16'),_0x226f26,_0x39b9bd[_0x68f1('0x14')],_0x461398,_0xfcebc9||_0x68f1('0x17'));if(_0xfcebc9){var _0x1ed3d8=_['findIndex'](_0x53e854[_0x68f1('0x18')](),{'p':_0xfcebc9});if(_0x1ed3d8>=0x0){logger[_0x68f1('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x226f26,_0xfcebc9||_0x68f1('0x17'),_0x1ed3d8);_0x53e854[_0x68f1('0x17')](_0x1ed3d8);}else{logger[_0x68f1('0x15')](_0x68f1('0x19'),_0x226f26,_0xfcebc9||_0x68f1('0x17'));_0x53e854['stop']();}}else{_0x53e854[_0x68f1('0x17')]();}}catch(_0x46bf20){logger[_0x68f1('0xe')](_0x68f1('0x1a'),_0x226f26,_0x46bf20['message']);_0x53e854[_0x68f1('0x13')]();}}}catch(_0x430120){logger['error'](_0x68f1('0xf'),_0x226f26,JSON['stringify'](_0x430120));_0x53e854[_0x68f1('0x13')]();}};}; \ 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 a6b415e..b207821 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 _0x3bda=['map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x41e614,_0x4d5713){var _0x547787=function(_0x134477){while(--_0x134477){_0x41e614['push'](_0x41e614['shift']());}};_0x547787(++_0x4d5713);}(_0x3bda,0x106));var _0xa3bd=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x3bda[_0x5ddaac];return _0x2a9c58;};'use strict';var schema=require(_0xa3bd('0x0'));var _=require(_0xa3bd('0x1'));var logger=require('../../../../config/logger')(_0xa3bd('0x2'));var gotop=schema({'priority':{'type':_0xa3bd('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xa3bd('0x4')]=function(_0x38f590,_0x2b64b3){return function(_0x4f3f5e){try{var _0x324f6e={'priority':_0x2b64b3[0x0]};var _0x346a82=gotop[_0xa3bd('0x0')](_0x324f6e,{'typecast':!![]});if(_0x346a82[_0xa3bd('0x5')]){logger[_0xa3bd('0x6')](_0xa3bd('0x7'),_0x38f590,_[_0xa3bd('0x8')](_0x346a82,'message')[_0xa3bd('0x9')](',\x20'));_0x4f3f5e[_0xa3bd('0xa')]();}else{logger[_0xa3bd('0xb')](_0xa3bd('0xc'),_0x38f590,_0x324f6e[_0xa3bd('0xd')]);if(_0x324f6e[_0xa3bd('0xd')]){var _0x2b5f3f=_[_0xa3bd('0xe')](_0x4f3f5e['rules'](),{'p':_0x324f6e[_0xa3bd('0xd')]});if(_0x2b5f3f>=0x0){logger[_0xa3bd('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x38f590,_0x324f6e[_0xa3bd('0xd')]||_0xa3bd('0xf'),_0x2b5f3f);_0x4f3f5e[_0xa3bd('0xf')](_0x2b5f3f);}else{logger[_0xa3bd('0xb')](_0xa3bd('0x10'),_0x38f590,_0x324f6e[_0xa3bd('0xd')]||_0xa3bd('0xf'));_0x4f3f5e[_0xa3bd('0xa')]();}}else{_0x4f3f5e['next']();}}}catch(_0x46e817){logger[_0xa3bd('0x6')](_0xa3bd('0x7'),_0x38f590,JSON[_0xa3bd('0x11')](_0x46e817));_0x4f3f5e['stop']();}};}; \ No newline at end of file +var _0xb62e=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','routing','number'];(function(_0x3185fa,_0x51be5a){var _0x395f28=function(_0xbad167){while(--_0xbad167){_0x3185fa['push'](_0x3185fa['shift']());}};_0x395f28(++_0x51be5a);}(_0xb62e,0x12d));var _0xeb62=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb62e[_0x501510];return _0x1e6ee5;};'use strict';var schema=require(_0xeb62('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0xeb62('0x1'));var gotop=schema({'priority':{'type':_0xeb62('0x2'),'required':!![],'message':_0xeb62('0x3')}});exports['consequence']=function(_0x5d5fde,_0x2037d5){return function(_0x104d45){try{var _0xf3266={'priority':_0x2037d5[0x0]};var _0x43a54e=gotop['validate'](_0xf3266,{'typecast':!![]});if(_0x43a54e[_0xeb62('0x4')]){logger[_0xeb62('0x5')](_0xeb62('0x6'),_0x5d5fde,_[_0xeb62('0x7')](_0x43a54e,_0xeb62('0x8'))[_0xeb62('0x9')](',\x20'));_0x104d45[_0xeb62('0xa')]();}else{logger['info'](_0xeb62('0xb'),_0x5d5fde,_0xf3266[_0xeb62('0xc')]);if(_0xf3266[_0xeb62('0xc')]){var _0x507e55=_[_0xeb62('0xd')](_0x104d45[_0xeb62('0xe')](),{'p':_0xf3266['priority']});if(_0x507e55>=0x0){logger[_0xeb62('0xf')](_0xeb62('0x10'),_0x5d5fde,_0xf3266[_0xeb62('0xc')]||_0xeb62('0x11'),_0x507e55);_0x104d45[_0xeb62('0x11')](_0x507e55);}else{logger[_0xeb62('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5d5fde,_0xf3266[_0xeb62('0xc')]||_0xeb62('0x11'));_0x104d45['stop']();}}else{_0x104d45['next']();}}}catch(_0xe69b8d){logger[_0xeb62('0x5')](_0xeb62('0x6'),_0x5d5fde,JSON[_0xeb62('0x12')](_0xe69b8d));_0x104d45['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 3b0a6a5..687e56d 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 _0x4ffe=['[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','then'];(function(_0x48a830,_0x200d85){var _0x1ad000=function(_0x11183e){while(--_0x11183e){_0x48a830['push'](_0x48a830['shift']());}};_0x1ad000(++_0x200d85);}(_0x4ffe,0x172));var _0xe4ff=function(_0x566342,_0x4a8a5d){_0x566342=_0x566342-0x0;var _0x1271e6=_0x4ffe[_0x566342];return _0x1271e6;};'use strict';var _=require(_0xe4ff('0x0'));var utils=require(_0xe4ff('0x1'));var logger=require(_0xe4ff('0x2'))('routing');var rpc={'chatMessage':require(_0xe4ff('0x3')),'openchannelMessage':require(_0xe4ff('0x4')),'mailMessage':require(_0xe4ff('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe4ff('0x6')),'whatsappMessage':require(_0xe4ff('0x7'))};exports[_0xe4ff('0x8')]=function(_0x33a19a,_0x68c0c7){return function(_0x50250d){try{var _0x5eed52={'body':utils[_0xe4ff('0x9')](_0x68c0c7[0x0],this),'ContactId':this[_0xe4ff('0xa')]['id']};if(this[_0xe4ff('0xb')]==='chat'){_0x5eed52[_0xe4ff('0xc')]=this['account']['id'];}else{_0x5eed52[_[_0xe4ff('0xd')](this[_0xe4ff('0xb')])+_0xe4ff('0xe')]=this[_0xe4ff('0xf')]['id'];}_0x5eed52[_['upperFirst'](this['channel'])+_0xe4ff('0x10')]=this[_0xe4ff('0x11')]['id'];if(rpc[this[_0xe4ff('0xb')]+_0xe4ff('0x12')]){return rpc[this[_0xe4ff('0xb')]+_0xe4ff('0x12')]['create'](_0x5eed52)[_0xe4ff('0x13')](function(_0x20c8c1){logger['info'](_0xe4ff('0x14'),_0x33a19a,_0x5eed52['body']);_0x50250d[_0xe4ff('0x15')]();})[_0xe4ff('0x16')](function(_0x5702dc){logger[_0xe4ff('0x17')](_0xe4ff('0x14'),_0x33a19a,JSON[_0xe4ff('0x18')](_0x5702dc));_0x50250d[_0xe4ff('0x19')]();});}}catch(_0x2b7212){logger[_0xe4ff('0x17')]('[%s][MESSAGE]\x20%s',_0x33a19a,JSON[_0xe4ff('0x18')](_0x2b7212));_0x50250d[_0xe4ff('0x19')]();}};}; \ No newline at end of file +var _0x30d3=['error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','next','catch'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x30d3,0x9f));var _0x330d=function(_0x1e66e1,_0x283405){_0x1e66e1=_0x1e66e1-0x0;var _0x1f51b0=_0x30d3[_0x1e66e1];return _0x1f51b0;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x330d('0x0'))(_0x330d('0x1'));var rpc={'chatMessage':require(_0x330d('0x2')),'openchannelMessage':require(_0x330d('0x3')),'mailMessage':require(_0x330d('0x4')),'smsMessage':require(_0x330d('0x5')),'faxMessage':require(_0x330d('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x330d('0x7')]=function(_0x3b3165,_0xd8503){return function(_0x2a330f){try{var _0x5ee451={'body':utils['getMustacheRender'](_0xd8503[0x0],this),'ContactId':this[_0x330d('0x8')]['id']};if(this[_0x330d('0x9')]===_0x330d('0xa')){_0x5ee451[_0x330d('0xb')]=this['account']['id'];}else{_0x5ee451[_['upperFirst'](this[_0x330d('0x9')])+_0x330d('0xc')]=this[_0x330d('0xd')]['id'];}_0x5ee451[_[_0x330d('0xe')](this[_0x330d('0x9')])+_0x330d('0xf')]=this[_0x330d('0x10')]['id'];if(rpc[this['channel']+_0x330d('0x11')]){return rpc[this[_0x330d('0x9')]+_0x330d('0x11')]['create'](_0x5ee451)[_0x330d('0x12')](function(_0xb093cd){logger[_0x330d('0x13')](_0x330d('0x14'),_0x3b3165,_0x5ee451['body']);_0x2a330f[_0x330d('0x15')]();})[_0x330d('0x16')](function(_0x528b86){logger[_0x330d('0x17')]('[%s][MESSAGE]\x20%s',_0x3b3165,JSON[_0x330d('0x18')](_0x528b86));_0x2a330f[_0x330d('0x19')]();});}}catch(_0x3801f4){logger['error']('[%s][MESSAGE]\x20%s',_0x3b3165,JSON[_0x330d('0x18')](_0x3801f4));_0x2a330f[_0x330d('0x19')]();}};}; \ 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 e3a1b5f..40e20b6 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 _0xbb19=['routing','consequence','info','next','[%s][NOOP]\x20%s','stringify','./utils'];(function(_0xa606b7,_0x565ca5){var _0x3e5f8b=function(_0x1705c8){while(--_0x1705c8){_0xa606b7['push'](_0xa606b7['shift']());}};_0x3e5f8b(++_0x565ca5);}(_0xbb19,0xd1));var _0x9bb1=function(_0x516ec5,_0x1da856){_0x516ec5=_0x516ec5-0x0;var _0x3e1681=_0xbb19[_0x516ec5];return _0x3e1681;};'use strict';var utils=require(_0x9bb1('0x0'));var logger=require('../../../../config/logger')(_0x9bb1('0x1'));exports[_0x9bb1('0x2')]=function(_0x5b93cf,_0x13b435){return function(_0x47e530){try{logger[_0x9bb1('0x3')]('[%s][NOOP]\x20%s',_0x5b93cf,utils['getMustacheRender'](_0x13b435[0x0],this));_0x47e530[_0x9bb1('0x4')]();}catch(_0x49c88d){logger['error'](_0x9bb1('0x5'),_0x5b93cf,JSON[_0x9bb1('0x6')](_0x49c88d));_0x47e530['stop']();}};}; \ No newline at end of file +var _0x45c6=['getMustacheRender','next','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x33b76e,_0x521078){var _0x3558fe=function(_0x127340){while(--_0x127340){_0x33b76e['push'](_0x33b76e['shift']());}};_0x3558fe(++_0x521078);}(_0x45c6,0x74));var _0x645c=function(_0x384858,_0x3a5c43){_0x384858=_0x384858-0x0;var _0x3a1d3b=_0x45c6[_0x384858];return _0x3a1d3b;};'use strict';var utils=require('./utils');var logger=require(_0x645c('0x0'))(_0x645c('0x1'));exports[_0x645c('0x2')]=function(_0x5e072c,_0x16cd2b){return function(_0x2a1724){try{logger['info'](_0x645c('0x3'),_0x5e072c,utils[_0x645c('0x4')](_0x16cd2b[0x0],this));_0x2a1724[_0x645c('0x5')]();}catch(_0x3a8962){logger['error'](_0x645c('0x3'),_0x5e072c,JSON['stringify'](_0x3a8962));_0x2a1724['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 a43b826..395712f 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 _0x3de3=['rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','account','from','joinAt','emit','queue','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','waiting','accepted','Interaction','interaction','then','update','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','join','find','qtimeout'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x3de3,0x1ce));var _0x33de=function(_0x4ed91b,_0x269d43){_0x4ed91b=_0x4ed91b-0x0;var _0x39b55f=_0x3de3[_0x4ed91b];return _0x39b55f;};'use strict';var schema=require(_0x33de('0x0'));var _=require('lodash');var util=require(_0x33de('0x1'));var seqqueue=require(_0x33de('0x2'));var moment=require('moment');var Redis=require(_0x33de('0x3'));var config=require(_0x33de('0x4'));var logger=require(_0x33de('0x5'))(_0x33de('0x6'));var strategy=require('./strategy');config[_0x33de('0x7')]=_[_0x33de('0x8')](config['redis'],{'host':_0x33de('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33de('0x7')]));var attributes=['id',_0x33de('0xa'),_0x33de('0xb'),'queue',_0x33de('0xc'),_0x33de('0xd')];function emit(_0x2e0419,_0x5e1be7,_0x2cbf35){io['to'](_0x2e0419)[_0x33de('0xe')](_0x5e1be7,_0x2cbf35);}function emitChannelQueueInteraction(_0x8b655d,_0x241211,_0x330047,_0x189634,_0x8dfa3b,_0x59db80,_0x1f02bd,_0x306efc){var _0x27d1d8=_['clone'](_0x330047);_0x27d1d8[_0x33de('0xa')]=_0x306efc;_0x27d1d8[_0x33de('0xf')]=_0x241211;_0x27d1d8['account']=_0x189634;_0x27d1d8['id']=_0x8dfa3b;if(_0x59db80){attributes['push'](_[_0x33de('0x10')](_0x8b655d)+_0x33de('0x11'));_0x1f02bd[util[_0x33de('0x12')](_0x33de('0x13'),_0x8b655d)][_0x8dfa3b]=_['pick'](_0x27d1d8,attributes);}else{delete _0x1f02bd[util[_0x33de('0x12')](_0x33de('0x13'),_0x8b655d)][_0x8dfa3b];}emit(util['format']('%s:queue:%s',_0x8b655d,_0x241211),util[_0x33de('0x12')](_0x33de('0x14'),_0x8b655d,_0x59db80?_0x33de('0x15'):'remove'),_[_0x33de('0x16')](_0x27d1d8,attributes));}var rpc={'openchannelQueueReport':require(_0x33de('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x33de('0x18')),'smsQueueReport':require(_0x33de('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0x33de('0x1a')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x33de('0x1b')),'openchannelInteraction':require(_0x33de('0x1c')),'smsInteraction':require(_0x33de('0x1d')),'whatsappInteraction':require(_0x33de('0x1e'))};var queue=schema({'name':{'type':_0x33de('0x1f'),'required':!![],'message':_0x33de('0x20')},'timeout':{'type':_0x33de('0x21'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x571086,_0x34e7ef,_0x5af3fa,_0x8acd8d){if(_0x571086&&_0x34e7ef&&_0x5af3fa){_0x34e7ef['waiting']+=0x1;var _0x28ed17={'uniqueid':_0x571086,'from':_0x5af3fa[_0x33de('0x22')]?_0x5af3fa['body'][_0x33de('0xc')]:'','joinAt':moment()['format'](_0x33de('0x23')),'ContactId':_0x5af3fa['contact']?_0x5af3fa[_0x33de('0x24')]['id']:null,'ListId':_0x5af3fa[_0x33de('0x25')]?_0x5af3fa[_0x33de('0x25')]['id']:null};_0x28ed17[_['upperFirst'](_0x5af3fa[_0x33de('0x26')])+_0x33de('0x27')]=_0x34e7ef['id']||null;_0x28ed17[_[_0x33de('0x28')](_0x5af3fa['channel'])+_0x33de('0x11')]=_0x5af3fa['interaction']?_0x5af3fa['interaction']['id']:null;_0x28ed17[_[_0x33de('0x28')](_0x5af3fa[_0x33de('0x26')])+_0x33de('0x29')]=_0x5af3fa[_0x33de('0x2a')]?_0x5af3fa[_0x33de('0x2a')]['id']:null;_0x28ed17[_[_0x33de('0x28')](_0x5af3fa[_0x33de('0x26')])+(_0x5af3fa[_0x33de('0x26')]!=='chat'?'AccountId':_0x33de('0x2b'))]=_0x5af3fa[_0x33de('0xb')]?_0x5af3fa[_0x33de('0xb')]['id']:null;logger[_0x33de('0x2c')](util[_0x33de('0x12')](_0x33de('0x2d'),_0x571086,_0x34e7ef[_0x33de('0x2e')]));emitChannelQueueInteraction(_0x5af3fa['channel'],_0x34e7ef[_0x33de('0x2e')],_0x28ed17,_0x5af3fa[_0x33de('0xb')][_0x33de('0x2e')],_0x5af3fa[_0x33de('0x2a')]['id'],!![],_0x8acd8d,_0x34e7ef['id']);if(rpc[_0x5af3fa['channel']+_0x33de('0x2f')]){return rpc[_0x5af3fa[_0x33de('0x26')]+'QueueReport']['create'](_0x28ed17)['catch'](function(_0x2dd46e){logger[_0x33de('0x30')]('create\x20queue\x20report',_0x2dd46e);});}}}function stopRouting(_0x1d0194,_0x4855e5,_0x532575,_0xe61fb9){if(_0x1d0194&&_0x4855e5){_0x4855e5[_0x33de('0x31')]-=0x1;var _0x42c57e={'leaveAt':moment()[_0x33de('0x12')](_0x33de('0x23')),'acceptAt':moment()[_0x33de('0x12')](_0x33de('0x23')),'reason':_0x33de('0x32')};logger['info'](util[_0x33de('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x1d0194,_0x4855e5[_0x33de('0x2e')]));emitChannelQueueInteraction(_0x532575['channel'],_0x4855e5['name'],_0x532575[_0x33de('0x22')],_0x532575[_0x33de('0xb')][_0x33de('0x2e')],_0x532575[_0x33de('0x2a')]['id'],![],_0xe61fb9,_0x4855e5['id']);return rpc[_0x532575[_0x33de('0x26')]+_0x33de('0x33')]['update'](_0x532575[_0x33de('0x34')]['id'],{'queueId':_0x4855e5['id']})[_0x33de('0x35')](function(){if(rpc[_0x532575[_0x33de('0x26')]+_0x33de('0x2f')]){return rpc[_0x532575[_0x33de('0x26')]+_0x33de('0x2f')][_0x33de('0x36')](_0x1d0194,_0x42c57e)['catch'](function(_0x4bd6f2){logger[_0x33de('0x30')](_0x33de('0x37'),_0x4bd6f2);});}});}}function endRouting(_0x3e11eb,_0x46ddfe,_0x35064e,_0x1126b6){if(_0x3e11eb&&_0x46ddfe){_0x46ddfe['waiting']-=0x1;var _0x2f663f={'leaveAt':moment()[_0x33de('0x12')](_0x33de('0x23')),'exitAt':moment()[_0x33de('0x12')](_0x33de('0x23')),'reason':_0x33de('0x38')};logger['info'](util[_0x33de('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x3e11eb,_0x46ddfe[_0x33de('0x2e')]));emitChannelQueueInteraction(_0x35064e[_0x33de('0x26')],_0x46ddfe['name'],_0x35064e[_0x33de('0x22')],_0x35064e[_0x33de('0xb')][_0x33de('0x2e')],_0x35064e[_0x33de('0x2a')]['id'],![],_0x1126b6);if(rpc[_0x35064e[_0x33de('0x26')]+_0x33de('0x2f')]){return rpc[_0x35064e[_0x33de('0x26')]+_0x33de('0x2f')][_0x33de('0x36')](_0x3e11eb,_0x2f663f)['catch'](function(_0x5101b9){logger[_0x33de('0x30')](_0x33de('0x37'),_0x5101b9);});}}}function handleFindQueue(_0x20d04f){return function(_0x376c55){return _0x376c55['name'][_0x33de('0x39')]()===_0x20d04f['toLowerCase']();};}exports['consequence']=function(_0x1f164c,_0x3caa1f,_0x384b12,_0x129e37){return function(_0x109894){try{var _0x29fe69={'name':_0x3caa1f[0x0],'timeout':_0x3caa1f[0x1]};var _0x105e10=queue['validate'](_0x29fe69,{'typecast':!![]});if(_0x105e10[_0x33de('0x3a')]){logger['error'](_0x33de('0x3b'),_0x1f164c,_['map'](_0x105e10,_0x33de('0x2a'))[_0x33de('0x3c')](',\x20'));_0x109894['stop']();}else{var _0x18db5e=_[_0x33de('0x3d')](_0x384b12[_0x129e37[_0x33de('0x26')]+'Queues'],handleFindQueue(_0x29fe69['name']));if(_0x18db5e){startRouting(_0x1f164c,_0x18db5e,_0x129e37,_0x384b12);var _0x24c440=(_0x18db5e[_0x33de('0x38')]||0xa)*0x3e8;var _0x4bf097=(_0x29fe69['timeout']||0x14)*0x3e8;var _0x44be7b;if(_0x24c440>_0x4bf097){_0x4bf097=_0x24c440;}var _0x5a161f=seqqueue['createQueue'](_0x24c440);_0x5a161f['id']=_0x1f164c;_0x5a161f['atimeout']=_0x24c440;_0x5a161f[_0x33de('0x3e')]=_0x4bf097;_0x5a161f[_0x33de('0x26')]=_0x129e37[_0x33de('0x26')];_0x384b12[_0x33de('0x3f')][_0x1f164c]['on']('end',function(){logger['info'](_0x33de('0x40'),_0x1f164c);stopRouting(_0x1f164c,_0x18db5e,_0x129e37,_0x384b12);clearTimeout(_0x44be7b);_0x44be7b=undefined;_0x5a161f[_0x33de('0x41')](!![]);if(_0x384b12['rules'][_0x1f164c]){delete _0x384b12[_0x33de('0x3f')][_0x1f164c];}_0x109894[_0x33de('0x42')]();});_0x384b12[_0x33de('0x3f')][_0x1f164c]['on'](_0x33de('0x43'),function(){if(_0x384b12[_0x33de('0x3f')][_0x1f164c]){delete _0x384b12['rules'][_0x1f164c];}});_0x44be7b=setTimeout(function(){logger[_0x33de('0x2c')](_0x33de('0x44'),_0x1f164c);endRouting(_0x1f164c,_0x18db5e,_0x129e37,_0x384b12);clearTimeout(_0x44be7b);_0x5a161f['close'](!![]);_0x109894[_0x33de('0x45')]();},_0x4bf097);switch(_0x18db5e[_0x33de('0x46')]){case _0x33de('0x47'):strategy[_0x33de('0x47')](_0x5a161f,_0x18db5e,_0x384b12,_0x129e37);break;default:strategy[_0x33de('0x48')](_0x5a161f,_0x18db5e,_0x384b12,_0x129e37);}}else{logger[_0x33de('0x30')](_0x33de('0x49'),_0x1f164c,_0x29fe69[_0x33de('0x2e')]);_0x109894[_0x33de('0x42')]();}}}catch(_0x1b4397){logger['error'](_0x33de('0x3b'),_0x1f164c,_0x1b4397[_0x33de('0x4a')]);_0x109894[_0x33de('0x42')]();}};}; \ No newline at end of file +var _0x31a3=['end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','stop','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','joinAt','emit','clone','queue','push','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x31a3,0x183));var _0x331a=function(_0x2ef9e2,_0x376185){_0x2ef9e2=_0x2ef9e2-0x0;var _0x2d4632=_0x31a3[_0x2ef9e2];return _0x2d4632;};'use strict';var schema=require(_0x331a('0x0'));var _=require(_0x331a('0x1'));var util=require(_0x331a('0x2'));var seqqueue=require(_0x331a('0x3'));var moment=require(_0x331a('0x4'));var Redis=require(_0x331a('0x5'));var config=require(_0x331a('0x6'));var logger=require(_0x331a('0x7'))(_0x331a('0x8'));var strategy=require(_0x331a('0x9'));config[_0x331a('0xa')]=_[_0x331a('0xb')](config[_0x331a('0xa')],{'host':_0x331a('0xc'),'port':0x18eb});var io=require(_0x331a('0xd'))(new Redis(config[_0x331a('0xa')]));var attributes=['id',_0x331a('0xe'),_0x331a('0xf'),'queue','from',_0x331a('0x10')];function emit(_0x27b061,_0xab84da,_0x7897f4){io['to'](_0x27b061)[_0x331a('0x11')](_0xab84da,_0x7897f4);}function emitChannelQueueInteraction(_0x375b2a,_0x27f46d,_0x1b976e,_0x4d5f29,_0x372e01,_0x1dc2b6,_0x212cdf,_0x159e51){var _0x226e0d=_[_0x331a('0x12')](_0x1b976e);_0x226e0d[_0x331a('0xe')]=_0x159e51;_0x226e0d[_0x331a('0x13')]=_0x27f46d;_0x226e0d[_0x331a('0xf')]=_0x4d5f29;_0x226e0d['id']=_0x372e01;if(_0x1dc2b6){attributes[_0x331a('0x14')](_['capitalize'](_0x375b2a)+_0x331a('0x15'));_0x212cdf[util[_0x331a('0x16')]('%sQueuesWaitingInteractions',_0x375b2a)][_0x372e01]=_[_0x331a('0x17')](_0x226e0d,attributes);}else{delete _0x212cdf[util['format'](_0x331a('0x18'),_0x375b2a)][_0x372e01];}emit(util[_0x331a('0x16')](_0x331a('0x19'),_0x375b2a,_0x27f46d),util[_0x331a('0x16')](_0x331a('0x1a'),_0x375b2a,_0x1dc2b6?_0x331a('0x1b'):_0x331a('0x1c')),_[_0x331a('0x17')](_0x226e0d,attributes));}var rpc={'openchannelQueueReport':require(_0x331a('0x1d')),'mailQueueReport':require(_0x331a('0x1e')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x331a('0x1f')),'faxQueueReport':require(_0x331a('0x20')),'whatsappQueueReport':require(_0x331a('0x21')),'chatInteraction':require(_0x331a('0x22')),'faxInteraction':require(_0x331a('0x23')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x331a('0x24')),'smsInteraction':require(_0x331a('0x25')),'whatsappInteraction':require(_0x331a('0x26'))};var queue=schema({'name':{'type':_0x331a('0x27'),'required':!![],'message':_0x331a('0x28')},'timeout':{'type':_0x331a('0x29'),'message':_0x331a('0x2a')}});function startRouting(_0x124fa5,_0x17b2d5,_0x1cb292,_0x194114){if(_0x124fa5&&_0x17b2d5&&_0x1cb292){_0x17b2d5[_0x331a('0x2b')]+=0x1;var _0x3558ca={'uniqueid':_0x124fa5,'from':_0x1cb292[_0x331a('0x2c')]?_0x1cb292[_0x331a('0x2c')][_0x331a('0x2d')]:'','joinAt':moment()[_0x331a('0x16')](_0x331a('0x2e')),'ContactId':_0x1cb292[_0x331a('0x2f')]?_0x1cb292[_0x331a('0x2f')]['id']:null,'ListId':_0x1cb292[_0x331a('0x30')]?_0x1cb292[_0x331a('0x30')]['id']:null};_0x3558ca[_[_0x331a('0x31')](_0x1cb292[_0x331a('0x32')])+_0x331a('0x33')]=_0x17b2d5['id']||null;_0x3558ca[_[_0x331a('0x31')](_0x1cb292[_0x331a('0x32')])+_0x331a('0x15')]=_0x1cb292[_0x331a('0x34')]?_0x1cb292[_0x331a('0x34')]['id']:null;_0x3558ca[_['upperFirst'](_0x1cb292[_0x331a('0x32')])+_0x331a('0x35')]=_0x1cb292[_0x331a('0x36')]?_0x1cb292[_0x331a('0x36')]['id']:null;_0x3558ca[_[_0x331a('0x31')](_0x1cb292[_0x331a('0x32')])+(_0x1cb292['channel']!==_0x331a('0x37')?_0x331a('0x38'):_0x331a('0x39'))]=_0x1cb292[_0x331a('0xf')]?_0x1cb292[_0x331a('0xf')]['id']:null;logger[_0x331a('0x3a')](util[_0x331a('0x16')]('[%s][START:QUEUE][NAME:%s]',_0x124fa5,_0x17b2d5[_0x331a('0x3b')]));emitChannelQueueInteraction(_0x1cb292[_0x331a('0x32')],_0x17b2d5['name'],_0x3558ca,_0x1cb292[_0x331a('0xf')][_0x331a('0x3b')],_0x1cb292[_0x331a('0x36')]['id'],!![],_0x194114,_0x17b2d5['id']);if(rpc[_0x1cb292[_0x331a('0x32')]+_0x331a('0x3c')]){return rpc[_0x1cb292[_0x331a('0x32')]+_0x331a('0x3c')][_0x331a('0x3d')](_0x3558ca)[_0x331a('0x3e')](function(_0x7a9aa7){logger[_0x331a('0x3f')](_0x331a('0x40'),_0x7a9aa7);});}}}function stopRouting(_0x3f2763,_0x503043,_0x18b08f,_0x20fd29){if(_0x3f2763&&_0x503043){_0x503043[_0x331a('0x2b')]-=0x1;var _0x154b06={'leaveAt':moment()[_0x331a('0x16')](_0x331a('0x2e')),'acceptAt':moment()[_0x331a('0x16')](_0x331a('0x2e')),'reason':_0x331a('0x41')};logger['info'](util['format'](_0x331a('0x42'),_0x3f2763,_0x503043[_0x331a('0x3b')]));emitChannelQueueInteraction(_0x18b08f[_0x331a('0x32')],_0x503043[_0x331a('0x3b')],_0x18b08f[_0x331a('0x2c')],_0x18b08f[_0x331a('0xf')][_0x331a('0x3b')],_0x18b08f[_0x331a('0x36')]['id'],![],_0x20fd29,_0x503043['id']);return rpc[_0x18b08f[_0x331a('0x32')]+_0x331a('0x43')][_0x331a('0x44')](_0x18b08f['interaction']['id'],{'queueId':_0x503043['id']})['then'](function(){if(rpc[_0x18b08f[_0x331a('0x32')]+_0x331a('0x3c')]){return rpc[_0x18b08f[_0x331a('0x32')]+_0x331a('0x3c')]['update'](_0x3f2763,_0x154b06)['catch'](function(_0x2c981f){logger[_0x331a('0x3f')](_0x331a('0x45'),_0x2c981f);});}});}}function endRouting(_0x1e9210,_0x415a7f,_0x17b9f5,_0xa3b7f){if(_0x1e9210&&_0x415a7f){_0x415a7f['waiting']-=0x1;var _0x23d17e={'leaveAt':moment()[_0x331a('0x16')](_0x331a('0x2e')),'exitAt':moment()[_0x331a('0x16')](_0x331a('0x2e')),'reason':_0x331a('0x46')};logger['info'](util[_0x331a('0x16')](_0x331a('0x47'),_0x1e9210,_0x415a7f[_0x331a('0x3b')]));emitChannelQueueInteraction(_0x17b9f5[_0x331a('0x32')],_0x415a7f['name'],_0x17b9f5[_0x331a('0x2c')],_0x17b9f5['account'][_0x331a('0x3b')],_0x17b9f5[_0x331a('0x36')]['id'],![],_0xa3b7f);if(rpc[_0x17b9f5[_0x331a('0x32')]+'QueueReport']){return rpc[_0x17b9f5[_0x331a('0x32')]+'QueueReport'][_0x331a('0x44')](_0x1e9210,_0x23d17e)[_0x331a('0x3e')](function(_0x674c45){logger['error'](_0x331a('0x45'),_0x674c45);});}}}function handleFindQueue(_0x209208){return function(_0x3b8b55){return _0x3b8b55[_0x331a('0x3b')][_0x331a('0x48')]()===_0x209208[_0x331a('0x48')]();};}exports[_0x331a('0x49')]=function(_0x58cf4a,_0x1f1956,_0x12a090,_0x14bb74){return function(_0x26613f){try{var _0x303dbf={'name':_0x1f1956[0x0],'timeout':_0x1f1956[0x1]};var _0xfe70b2=queue[_0x331a('0x0')](_0x303dbf,{'typecast':!![]});if(_0xfe70b2['length']){logger[_0x331a('0x3f')](_0x331a('0x4a'),_0x58cf4a,_[_0x331a('0x4b')](_0xfe70b2,_0x331a('0x36'))[_0x331a('0x4c')](',\x20'));_0x26613f['stop']();}else{var _0x4c5cc4=_[_0x331a('0x4d')](_0x12a090[_0x14bb74['channel']+_0x331a('0x4e')],handleFindQueue(_0x303dbf[_0x331a('0x3b')]));if(_0x4c5cc4){startRouting(_0x58cf4a,_0x4c5cc4,_0x14bb74,_0x12a090);var _0x19126a=(_0x4c5cc4[_0x331a('0x46')]||0xa)*0x3e8;var _0x171733=(_0x303dbf[_0x331a('0x46')]||0x14)*0x3e8;var _0x3e4393;if(_0x19126a>_0x171733){_0x171733=_0x19126a;}var _0x29fb4d=seqqueue[_0x331a('0x4f')](_0x19126a);_0x29fb4d['id']=_0x58cf4a;_0x29fb4d[_0x331a('0x50')]=_0x19126a;_0x29fb4d[_0x331a('0x51')]=_0x171733;_0x29fb4d[_0x331a('0x32')]=_0x14bb74['channel'];_0x12a090[_0x331a('0x52')][_0x58cf4a]['on'](_0x331a('0x53'),function(){logger[_0x331a('0x3a')](_0x331a('0x54'),_0x58cf4a);stopRouting(_0x58cf4a,_0x4c5cc4,_0x14bb74,_0x12a090);clearTimeout(_0x3e4393);_0x3e4393=undefined;_0x29fb4d['close'](!![]);if(_0x12a090[_0x331a('0x52')][_0x58cf4a]){delete _0x12a090[_0x331a('0x52')][_0x58cf4a];}_0x26613f['stop']();});_0x12a090[_0x331a('0x52')][_0x58cf4a]['on'](_0x331a('0x55'),function(){if(_0x12a090[_0x331a('0x52')][_0x58cf4a]){delete _0x12a090[_0x331a('0x52')][_0x58cf4a];}});_0x3e4393=setTimeout(function(){logger['info'](_0x331a('0x56'),_0x58cf4a);endRouting(_0x58cf4a,_0x4c5cc4,_0x14bb74,_0x12a090);clearTimeout(_0x3e4393);_0x29fb4d[_0x331a('0x57')](!![]);_0x26613f[_0x331a('0x58')]();},_0x171733);switch(_0x4c5cc4[_0x331a('0x59')]){case _0x331a('0x5a'):strategy['rrmemory'](_0x29fb4d,_0x4c5cc4,_0x12a090,_0x14bb74);break;default:strategy['beepall'](_0x29fb4d,_0x4c5cc4,_0x12a090,_0x14bb74);}}else{logger[_0x331a('0x3f')](_0x331a('0x5b'),_0x58cf4a,_0x303dbf[_0x331a('0x3b')]);_0x26613f['stop']();}}}catch(_0x3a838c){logger[_0x331a('0x3f')]('[%s][QUEUE]\x20%s',_0x58cf4a,_0x3a838c[_0x331a('0x5c')]);_0x26613f[_0x331a('0x5d')]();}};}; \ 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 03572bd..17f3c29 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 _0x34e5=['saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','handleTimeout','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x26095d,_0xda53ad){_0x26095d=_0x26095d-0x0;var _0x35e668=_0x34e5[_0x26095d];return _0x35e668;};'use strict';var _=require('lodash');var uuid=require(_0x534e('0x0'));var util=require('./util');var logger=require(_0x534e('0x1'))(_0x534e('0x2'));var Agent=function(_0x425ae8,_0x246650,_0x83eb2d,_0x50b790){this[_0x534e('0x3')]=uuid['v4']();this[_0x534e('0x4')]=_0x425ae8;this[_0x534e('0x5')]=_0x246650;this[_0x534e('0x6')]=_0x83eb2d;this[_0x534e('0x2')]=_0x50b790;this[_0x534e('0x4')][_0x534e('0x7')](this['handleRun'][_0x534e('0x8')](this),this[_0x534e('0x9')][_0x534e('0x8')](this));this['squeue']['on']('timeout',this[_0x534e('0x9')]['bind'](this));this[_0x534e('0x4')]['on']('drained',this[_0x534e('0xa')][_0x534e('0x8')](this));};Agent[_0x534e('0xb')]['push']=function(){this[_0x534e('0x4')][_0x534e('0x7')](this[_0x534e('0xc')][_0x534e('0x8')](this),this[_0x534e('0x9')]['bind'](this));};Agent[_0x534e('0xb')][_0x534e('0xa')]=function(){this[_0x534e('0x9')](!![]);};Agent[_0x534e('0xb')][_0x534e('0xc')]=function(){logger[_0x534e('0xd')](_0x534e('0xe'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);if(_['isNil'](this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']])){logger['debug'](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}else{if(this[_0x534e('0x2')][_0x534e('0x11')]||util['isAgentAvailable'](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],this[_0x534e('0x4')]['channel'],![])){this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=!![];this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x14')](this['realtime'],this[_0x534e('0x2')],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x16')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],null,this['routing']);util[_0x534e('0x17')](this[_0x534e('0x4')]['id'],this[_0x534e('0x6')][_0x534e('0xf')][this[_0x534e('0x5')]['id']],'RINGING'+(this[_0x534e('0x2')][_0x534e('0x11')]?':FORCED':''));}else{logger['debug'](_0x534e('0x18'),this['squeue']['id'],this[_0x534e('0x5')]['id']);setTimeout(this[_0x534e('0x7')][_0x534e('0x8')](this),0x3e8);}}};Agent[_0x534e('0xb')][_0x534e('0x9')]=function(_0x42119b){if(_[_0x534e('0x19')](this['realtime']['agents'][this[_0x534e('0x5')]['id']])){return logger[_0x534e('0xd')](_0x534e('0x10'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);}else{logger[_0x534e('0xd')](_0x534e('0x1a'),this[_0x534e('0x4')]['id'],this[_0x534e('0x5')]['id']);util[_0x534e('0x1b')](this[_0x534e('0x3')],this[_0x534e('0x4')]['id'],this['realtime'][_0x534e('0xf')][this[_0x534e('0x5')]['id']],null,this['routing']);this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']][_0x534e('0x12')]=![];this[_0x534e('0x6')][_0x534e('0xf')][this['agent']['id']][_0x534e('0x13')]=undefined;util[_0x534e('0x1c')](this['realtime'],this['routing'],this[_0x534e('0x5')],this[_0x534e('0x4')][_0x534e('0x15')]);util[_0x534e('0x17')](this['squeue']['id'],this[_0x534e('0x6')]['agents'][this[_0x534e('0x5')]['id']],_0x42119b?'STOP':_0x534e('0x1d'));}if(!_0x42119b){setTimeout(this[_0x534e('0x7')]['bind'](this),0x3e8);}};function agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40){return new Agent(_0x2f5cd1,_0x5c34a7,_0x593fb0,_0x519b40);}module['exports']=agent; \ No newline at end of file +var _0xd0bb=['RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','writeLog'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x47a491,_0x45e171){_0x47a491=_0x47a491-0x0;var _0x3b176b=_0xd0bb[_0x47a491];return _0x3b176b;};'use strict';var _=require(_0xbd0b('0x0'));var uuid=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var logger=require('../../../../../config/logger')(_0xbd0b('0x3'));var Agent=function(_0x4ab08f,_0x39b03a,_0x1f6ec3,_0x53e6ce){this[_0xbd0b('0x4')]=uuid['v4']();this['squeue']=_0x4ab08f;this[_0xbd0b('0x5')]=_0x39b03a;this[_0xbd0b('0x6')]=_0x1f6ec3;this[_0xbd0b('0x3')]=_0x53e6ce;this[_0xbd0b('0x7')][_0xbd0b('0x8')](this['handleRun'][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xb'),this['handleTimeout']['bind'](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xc'),this['handleDrained'][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')]['push']=function(){this[_0xbd0b('0x7')][_0xbd0b('0x8')](this[_0xbd0b('0xe')][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')][_0xbd0b('0xf')]=function(){this[_0xbd0b('0xa')](!![]);};Agent[_0xbd0b('0xd')][_0xbd0b('0xe')]=function(){logger['debug'](_0xbd0b('0x10'),this['squeue']['id'],this['agent']['id']);if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']])){logger[_0xbd0b('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xbd0b('0x5')]['id']);setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}else{if(this[_0xbd0b('0x3')][_0xbd0b('0x14')]||util[_0xbd0b('0x15')](this['squeue']['id'],this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']],this[_0xbd0b('0x7')][_0xbd0b('0x16')],![])){this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=!![];this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']]['busyQueue']=undefined;util[_0xbd0b('0x18')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x19')](this['notificationId'],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],null,this[_0xbd0b('0x3')]);util[_0xbd0b('0x1a')](this['squeue']['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xbd0b('0x1b')+(this[_0xbd0b('0x3')][_0xbd0b('0x14')]?':FORCED':''));}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1c'),this[_0xbd0b('0x7')]['id'],this['agent']['id']);setTimeout(this['push'][_0xbd0b('0x9')](this),0x3e8);}}};Agent[_0xbd0b('0xd')][_0xbd0b('0xa')]=function(_0xf4ba04){if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']])){return logger[_0xbd0b('0x13')](_0xbd0b('0x1d'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1e'),this['squeue']['id'],this[_0xbd0b('0x5')]['id']);util[_0xbd0b('0x1f')](this[_0xbd0b('0x4')],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']],null,this[_0xbd0b('0x3')]);this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=![];this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x20')]=undefined;util[_0xbd0b('0x21')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x1a')](this[_0xbd0b('0x7')]['id'],this['realtime'][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xf4ba04?_0xbd0b('0x22'):_0xbd0b('0x23'));}if(!_0xf4ba04){setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}};function agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098){return new Agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098);}module[_0xbd0b('0x24')]=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 3891e3c..ae572ca 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 _0x5709=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','routing','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','notificationId','squeue','queue','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','isNil','Agents','length','agents','debug'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5709,0xa6));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9570('0x0'));var uuid=require(_0x9570('0x1'));var util=require(_0x9570('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x268e55,_0x281b6e,_0x14868e,_0x283016){this[_0x9570('0x3')]=uuid['v4']();this[_0x9570('0x4')]=_0x268e55;this[_0x9570('0x5')]=_0x281b6e;this['realtime']=_0x14868e;this['routing']=_0x283016;this[_0x9570('0x4')]['push'](this[_0x9570('0x6')][_0x9570('0x7')](this),this[_0x9570('0x8')]['bind'](this));this[_0x9570('0x4')]['on'](_0x9570('0x9'),this[_0x9570('0x8')][_0x9570('0x7')](this));this[_0x9570('0x4')]['on'](_0x9570('0xa'),this['handleDrained']['bind'](this));};Beepall[_0x9570('0xb')][_0x9570('0xc')]=function(){this[_0x9570('0x4')][_0x9570('0xc')](this[_0x9570('0x6')][_0x9570('0x7')](this),this[_0x9570('0x8')][_0x9570('0x7')](this));};Beepall[_0x9570('0xb')][_0x9570('0xd')]=function(){this[_0x9570('0x8')](!![]);};Beepall['prototype'][_0x9570('0x6')]=function(){var _0x4fef75=!![];if(!_[_0x9570('0xe')](this['queue'])&&!_[_0x9570('0xe')](this['queue'][_0x9570('0xf')])&&this[_0x9570('0x5')][_0x9570('0xf')][_0x9570('0x10')]>0x0){for(var _0x3bc866=0x0,_0x88aa3e;_0x3bc8660x0){for(var _0x5ef12d=0x0,_0x38eb7f;_0x5ef12d0x0&&_0x4290bf[_0x3e5c47+_0x7810('0x20')]>=_0x4290bf[_0x3e5c47+'Capacity']){writeLog(_0x158dd8,_0x4290bf,_0x3e5c47[_0x7810('0x21')]()+_0x7810('0x22'));return![];}}return!![];};exports[_0x7810('0x23')]=function(_0x295ed5,_0x475538,_0x110db2,_0x106d8c,_0x560684){return sendNotification(!![],_0x295ed5,_0x475538,_0x110db2,_0x106d8c,_0x560684);};exports[_0x7810('0x24')]=function(_0x9b37c6,_0x598fb3,_0x1eef42,_0xe5c5d9,_0x180c10){return sendNotification(![],_0x9b37c6,_0x598fb3,_0x1eef42,_0xe5c5d9,_0x180c10);};exports[_0x7810('0x25')]=function(_0xd00cf6,_0x26425a,_0x35edd5){var _0x4a4dab=_0x26425a['interaction'][_0x7810('0x26')];if(!_0x4a4dab&&_0x35edd5){_0x4a4dab=_0x35edd5['id'];}var _0x3893a9=_[_0x7810('0x27')](_0xd00cf6[_0x26425a[_0x7810('0x28')]+_0x7810('0x29')],function(_0x171496){var _0x243f58=_[_0x7810('0x2a')](_0x26425a[_0x7810('0x28')])+_0x7810('0x2b');return _0x171496[_0x243f58]===_0x26425a[_0x7810('0x2c')]['id'];});if(!_0x3893a9&&_0x4a4dab&&_0xd00cf6['agents'][_0x4a4dab]){_0x3893a9=_[_0x7810('0x27')](_0xd00cf6[_0x7810('0x2d')][_0x4a4dab][_0x26425a['channel']+_0x7810('0x2e')],function(_0x164075){return _0x164075['id']===_0x26425a['interaction']['id'];});}return _0x3893a9;};exports[_0x7810('0x2f')]=function(_0x22f282,_0x1b3eff,_0x4ca18e,_0x440e17){if(_0x4ca18e&&_0x4ca18e['id']&&_0x22f282[_0x7810('0x2d')]&&_0x22f282[_0x7810('0x2d')][_0x4ca18e['id']]){_0x22f282[_0x7810('0x2d')][_0x4ca18e['id']][_0x440e17+_0x7810('0x2e')][_0x1b3eff[_0x7810('0x14')]['id']]={'id':_0x1b3eff['interaction']['id']};}};exports[_0x7810('0x30')]=function(_0x17919a,_0x5722ac,_0x3450fe,_0x1fcb2e){if(_0x3450fe&&_0x3450fe['id']&&_0x17919a[_0x7810('0x2d')]&&_0x17919a['agents'][_0x3450fe['id']]){delete _0x17919a[_0x7810('0x2d')][_0x3450fe['id']][_0x1fcb2e+_0x7810('0x2e')][_0x5722ac[_0x7810('0x14')]['id']];}};exports[_0x7810('0x31')]=writeLog; \ No newline at end of file +var _0x845a=['split','name','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','format','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','checkWaitingNotifications','interaction','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x845a,0x1af));var _0xa845=function(_0x41a07f,_0x2f06fb){_0x41a07f=_0x41a07f-0x0;var _0x2de0ed=_0x845a[_0x41a07f];return _0x2de0ed;};'use strict';var _=require(_0xa845('0x0'));var util=require(_0xa845('0x1'));var utils=require(_0xa845('0x2'));var Redis=require(_0xa845('0x3'));var config=require(_0xa845('0x4'));var logger=require(_0xa845('0x5'))(_0xa845('0x6'));config[_0xa845('0x7')]=_['defaults'](config[_0xa845('0x7')],{'host':_0xa845('0x8'),'port':0x18eb});var io=require(_0xa845('0x9'))(new Redis(config[_0xa845('0x7')]));function sendNotification(_0x11fdee,_0x5bc811,_0xa971f,_0x228c45,_0x5711bf,_0x591bd0){var _0x1333ca=_0x591bd0||{};var _0x49147d=_0xa971f[_0xa845('0xa')]('.');var _0x39eb10={'uniqueid':_0x5bc811,'channel':_0x49147d[0x0],'id':_0x49147d[0x1],'title':_0x49147d[0x0]+'\x20interaction','interactionId':_0x49147d[0x2],'queue':_0x5711bf?_0x5711bf[_0xa845('0xb')]:null,'sound':_0x1333ca[_0xa845('0xc')]['notificationSound'],'shake':_0x1333ca['account'][_0xa845('0xd')]};try{if(!_0x1333ca[_0xa845('0xe')]){_0x1333ca['body']={};}if(_0x5711bf){_0x1333ca[_0xa845('0xe')][_0xa845('0xf')]=_0x5711bf;}else if(_0x1333ca[_0xa845('0xe')]['queue']){delete _0x1333ca['body'][_0xa845('0xf')];}_0x39eb10[_0xa845('0x10')]=utils[_0xa845('0x11')](_0x1333ca[_0xa845('0xc')][_0xa845('0x12')],_0x1333ca);}catch(_0x163696){_0x39eb10[_0xa845('0x10')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0xa845('0x13')](_0xa845('0x14'),_0x5bc811,_0x163696[_0xa845('0x15')]));}io['to'](util[_0xa845('0x13')](_0xa845('0x16'),_0x228c45[_0xa845('0xb')]))[_0xa845('0x17')](util[_0xa845('0x13')](_0xa845('0x18'),_0x11fdee?_0xa845('0x19'):'remove'),_0x39eb10);}function writeLog(_0xdaa8ff,_0x32934c,_0x596423){return logger[_0xa845('0x1a')](util[_0xa845('0x13')](_0xa845('0x1b'),_0xdaa8ff,_0x32934c[_0xa845('0xb')],_0x596423));}exports[_0xa845('0x1c')]=function(_0x16f639,_0x1066a7,_0x29154e,_0x377cdb){if(_0x1066a7[_0xa845('0x1d')]){writeLog(_0x16f639,_0x1066a7,'BUSY');return![];}if(!_0x1066a7['online']){writeLog(_0x16f639,_0x1066a7,_0xa845('0x1e'));return![];}if(_0x1066a7[_0x29154e+'Pause']){writeLog(_0x16f639,_0x1066a7,_0xa845('0x1f'));return![];}if(_0x377cdb&&_0x1066a7[_0xa845('0x20')](_0x29154e+_0xa845('0x21'))&&_0x1066a7[_0xa845('0x20')](_0x29154e+_0xa845('0x22'))){if(_0x1066a7[_0x29154e+_0xa845('0x21')]>0x0&&_0x1066a7[_0x29154e+_0xa845('0x22')]>=_0x1066a7[_0x29154e+_0xa845('0x21')]){writeLog(_0x16f639,_0x1066a7,_0x29154e[_0xa845('0x23')]()+_0xa845('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x4e6a01,_0x5056b6,_0x4639ca,_0x3a88fe,_0x345a6f){return sendNotification(!![],_0x4e6a01,_0x5056b6,_0x4639ca,_0x3a88fe,_0x345a6f);};exports['hideNotification']=function(_0x5b0bfd,_0xece811,_0x4846ed,_0x8582c0,_0x22b31c){return sendNotification(![],_0x5b0bfd,_0xece811,_0x4846ed,_0x8582c0,_0x22b31c);};exports[_0xa845('0x25')]=function(_0x4f29af,_0x4606cb,_0x42b7cf){var _0x19df91=_0x4606cb[_0xa845('0x26')][_0xa845('0x27')];if(!_0x19df91&&_0x42b7cf){_0x19df91=_0x42b7cf['id'];}var _0x1cdeac=_['some'](_0x4f29af[_0x4606cb[_0xa845('0x28')]+_0xa845('0x29')],function(_0x1faa36){var _0x46fa03=_[_0xa845('0x2a')](_0x4606cb['channel'])+_0xa845('0x2b');return _0x1faa36[_0x46fa03]===_0x4606cb[_0xa845('0x26')]['id'];});if(!_0x1cdeac&&_0x19df91&&_0x4f29af[_0xa845('0x2c')][_0x19df91]){_0x1cdeac=_['some'](_0x4f29af[_0xa845('0x2c')][_0x19df91][_0x4606cb[_0xa845('0x28')]+'WaitingInteractions'],function(_0x524564){return _0x524564['id']===_0x4606cb['interaction']['id'];});}return _0x1cdeac;};exports[_0xa845('0x2d')]=function(_0x36a863,_0x29260d,_0xb49675,_0xa39f5e){if(_0xb49675&&_0xb49675['id']&&_0x36a863['agents']&&_0x36a863['agents'][_0xb49675['id']]){_0x36a863[_0xa845('0x2c')][_0xb49675['id']][_0xa39f5e+_0xa845('0x2e')][_0x29260d['message']['id']]={'id':_0x29260d[_0xa845('0x26')]['id']};}};exports[_0xa845('0x2f')]=function(_0x2f649b,_0x32a97a,_0x11a222,_0x3019ed){if(_0x11a222&&_0x11a222['id']&&_0x2f649b[_0xa845('0x2c')]&&_0x2f649b[_0xa845('0x2c')][_0x11a222['id']]){delete _0x2f649b[_0xa845('0x2c')][_0x11a222['id']][_0x3019ed+_0xa845('0x2e')][_0x32a97a[_0xa845('0x15')]['id']];}};exports[_0xa845('0x30')]=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 9460066..9a85b0e 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 _0xc9d4=['[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x16a84a,_0x135c8c){var _0x15df75=function(_0x2c6ab0){while(--_0x2c6ab0){_0x16a84a['push'](_0x16a84a['shift']());}};_0x15df75(++_0x135c8c);}(_0xc9d4,0xf0));var _0x4c9d=function(_0x32958b,_0x242da1){_0x32958b=_0x32958b-0x0;var _0xdfa3a3=_0xc9d4[_0x32958b];return _0xdfa3a3;};'use strict';var schema=require(_0x4c9d('0x0'));var sh=require(_0x4c9d('0x1'));var _=require(_0x4c9d('0x2'));var utils=require(_0x4c9d('0x3'));var logger=require(_0x4c9d('0x4'))(_0x4c9d('0x5'));var system=schema({'command':{'type':_0x4c9d('0x6'),'required':!![],'message':_0x4c9d('0x7')}});exports[_0x4c9d('0x8')]=function(_0x231e0e,_0x26ccfb){return function(_0x11c352){try{var _0x3c392a={'command':_0x26ccfb[0x0]};var _0x21d81d=system[_0x4c9d('0x0')](_0x3c392a,{'typecast':!![]});if(_0x21d81d[_0x4c9d('0x9')]){logger['error'](_0x4c9d('0xa'),_0x231e0e,_['map'](_0x21d81d,_0x4c9d('0xb'))[_0x4c9d('0xc')](',\x20'));logger[_0x4c9d('0xd')](_0x4c9d('0xe'),_0x231e0e);_0x11c352[_0x4c9d('0xf')]();}else{var _0x2cf51e=this;var _0x40e9ae=utils[_0x4c9d('0x10')](_0x26ccfb[0x0],this);logger[_0x4c9d('0xd')](_0x4c9d('0x11'),_0x231e0e,_0x40e9ae);sh['exec'](_['trim'](_0x40e9ae),function(_0x449d01,_0x3fea59){logger[_0x4c9d('0xd')](_0x4c9d('0x12'),_0x231e0e,_0x449d01);if(_0x449d01==0x0){var _0x2533d4=_0x3fea59['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x4c9d('0x13')](_0x26ccfb[0x1])||_[_0x4c9d('0x14')](_0x26ccfb[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x231e0e);_0x2cf51e[_0x4c9d('0x15')][_0x26ccfb[0x1]]=_0x2533d4;}else{logger[_0x4c9d('0xd')](_0x4c9d('0x16'),_0x231e0e,_0x26ccfb[0x1],_0x2533d4);_0x2cf51e[_0x4c9d('0x15')][_0x26ccfb[0x1]]=_0x2533d4;}}_0x11c352[_0x4c9d('0xf')]();});}}catch(_0x3d2980){logger['error'](_0x4c9d('0xa'),_0x231e0e,_[_0x4c9d('0x17')](_0x3d2980)?JSON[_0x4c9d('0x18')](_0x3d2980):_0x3d2980);logger[_0x4c9d('0xd')](_0x4c9d('0xe'),_0x231e0e);_0x11c352[_0x4c9d('0xf')]();}};}; \ No newline at end of file +var _0x3487=['message','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x3487,0xd8));var _0x7348=function(_0x3f55de,_0x3ae98f){_0x3f55de=_0x3f55de-0x0;var _0x2698de=_0x3487[_0x3f55de];return _0x2698de;};'use strict';var schema=require(_0x7348('0x0'));var sh=require(_0x7348('0x1'));var _=require(_0x7348('0x2'));var utils=require('./utils');var logger=require(_0x7348('0x3'))(_0x7348('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x7348('0x5')}});exports[_0x7348('0x6')]=function(_0x5bdefd,_0x209f16){return function(_0x31cd38){try{var _0x4157b9={'command':_0x209f16[0x0]};var _0x1b60d7=system['validate'](_0x4157b9,{'typecast':!![]});if(_0x1b60d7[_0x7348('0x7')]){logger['error']('[%s][SYSTEM]\x20%s',_0x5bdefd,_[_0x7348('0x8')](_0x1b60d7,_0x7348('0x9'))['join'](',\x20'));logger[_0x7348('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5bdefd);_0x31cd38[_0x7348('0xb')]();}else{var _0x46cd0b=this;var _0x313788=utils[_0x7348('0xc')](_0x209f16[0x0],this);logger['info'](_0x7348('0xd'),_0x5bdefd,_0x313788);sh[_0x7348('0xe')](_[_0x7348('0xf')](_0x313788),function(_0x9cd47e,_0x2b3f57){logger['info'](_0x7348('0x10'),_0x5bdefd,_0x9cd47e);if(_0x9cd47e==0x0){var _0x3099c3=_0x2b3f57['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x7348('0x11')](_0x209f16[0x1])||_[_0x7348('0x12')](_0x209f16[0x1])){logger['info'](_0x7348('0x13'),_0x5bdefd);_0x46cd0b[_0x7348('0x14')][_0x209f16[0x1]]=_0x3099c3;}else{logger[_0x7348('0xa')](_0x7348('0x15'),_0x5bdefd,_0x209f16[0x1],_0x3099c3);_0x46cd0b[_0x7348('0x14')][_0x209f16[0x1]]=_0x3099c3;}}_0x31cd38['next']();});}}catch(_0x5cc3){logger[_0x7348('0x16')]('[%s][SYSTEM]\x20%s',_0x5bdefd,_[_0x7348('0x17')](_0x5cc3)?JSON[_0x7348('0x18')](_0x5cc3):_0x5cc3);logger[_0x7348('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5bdefd);_0x31cd38[_0x7348('0xb')]();}};}; \ 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 8442b1d..826ad1f 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 _0xce2e=['channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','length','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next'];(function(_0x2c4214,_0x4a6057){var _0x175b15=function(_0x505641){while(--_0x505641){_0x2c4214['push'](_0x2c4214['shift']());}};_0x175b15(++_0x4a6057);}(_0xce2e,0x129));var _0xece2=function(_0x157ac7,_0x332e33){_0x157ac7=_0x157ac7-0x0;var _0x253f41=_0xce2e[_0x157ac7];return _0x253f41;};'use strict';var schema=require(_0xece2('0x0'));var _=require(_0xece2('0x1'));var rpc={'chatInteraction':require(_0xece2('0x2')),'openchannelInteraction':require(_0xece2('0x3')),'smsInteraction':require(_0xece2('0x4')),'mailInteraction':require(_0xece2('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xece2('0x6'))('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x3488c5,_0x1eb6e4,_0x3a0e1c,_0x4a3ba2){return function(_0x23dc75){try{var _0x44009d={'tag':_0x1eb6e4[0x0]};var _0x509ae2=tag[_0xece2('0x0')](_0x44009d,{'typecast':!![]});if(_0x509ae2[_0xece2('0x7')]){logger[_0xece2('0x8')](_0xece2('0x9'),_0x3488c5,_[_0xece2('0xa')](_0x509ae2,_0xece2('0xb'))['join'](',\x20'));logger[_0xece2('0xc')](_0xece2('0xd'),_0x3488c5);_0x23dc75[_0xece2('0xe')]();}else{var _0x54bdb8={'ids':[_0x1eb6e4[0x0]]};if(rpc[_0x4a3ba2['channel']+'Interaction']){rpc[_0x4a3ba2[_0xece2('0xf')]+_0xece2('0x10')]['addTags'](_0x4a3ba2[_0xece2('0x11')]['id'],_0x54bdb8)[_0xece2('0x12')](function(_0x25dcc5){logger['info'](_0xece2('0x13'),_0x3488c5,_0x1eb6e4[0x1],_0x4a3ba2[_0xece2('0xf')],_0x4a3ba2[_0xece2('0x11')]['id']);})[_0xece2('0x14')](function(_0x1a324c){logger[_0xece2('0x8')]('[%s][TAG]\x20%s',_0x3488c5,JSON[_0xece2('0x15')](_0x1a324c));logger[_0xece2('0xc')](_0xece2('0xd'),_0x3488c5);})[_0xece2('0x16')](function(){_0x23dc75[_0xece2('0xe')]();});}}}catch(_0x36ea79){logger['error'](_0xece2('0x9'),_0x3488c5,_[_0xece2('0x17')](_0x36ea79)?JSON[_0xece2('0x15')](_0x36ea79):_0x36ea79);logger[_0xece2('0xc')](_0xece2('0xd'),_0x3488c5);_0x23dc75['next']();}};}; \ No newline at end of file +var _0x4410=['catch','error','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','message','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction'];(function(_0x26d823,_0x3f2031){var _0x5c24b1=function(_0x205a09){while(--_0x205a09){_0x26d823['push'](_0x26d823['shift']());}};_0x5c24b1(++_0x3f2031);}(_0x4410,0x68));var _0x0441=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x4410[_0x3fc97b];return _0x3a0c82;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x0441('0x0')),'openchannelInteraction':require(_0x0441('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0441('0x2')),'faxInteraction':require(_0x0441('0x3')),'whatsappInteraction':require(_0x0441('0x4'))};var logger=require(_0x0441('0x5'))(_0x0441('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x0441('0x7')}});exports[_0x0441('0x8')]=function(_0x5dbdf5,_0x4dc83a,_0x21a1fd,_0x59e802){return function(_0xb376ff){try{var _0x62408f={'tag':_0x4dc83a[0x0]};var _0x3592de=tag[_0x0441('0x9')](_0x62408f,{'typecast':!![]});if(_0x3592de['length']){logger['error']('[%s][TAG]\x20%s',_0x5dbdf5,_['map'](_0x3592de,_0x0441('0xa'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5dbdf5);_0xb376ff['next']();}else{var _0x3d4f35={'ids':[_0x4dc83a[0x0]]};if(rpc[_0x59e802[_0x0441('0xb')]+'Interaction']){rpc[_0x59e802['channel']+_0x0441('0xc')][_0x0441('0xd')](_0x59e802['interaction']['id'],_0x3d4f35)['then'](function(_0x267e3d){logger['info'](_0x0441('0xe'),_0x5dbdf5,_0x4dc83a[0x1],_0x59e802[_0x0441('0xb')],_0x59e802[_0x0441('0xf')]['id']);})[_0x0441('0x10')](function(_0x28283d){logger[_0x0441('0x11')](_0x0441('0x12'),_0x5dbdf5,JSON[_0x0441('0x13')](_0x28283d));logger['info'](_0x0441('0x14'),_0x5dbdf5);})[_0x0441('0x15')](function(){_0xb376ff[_0x0441('0x16')]();});}}}catch(_0x20ff5b){logger[_0x0441('0x11')](_0x0441('0x12'),_0x5dbdf5,_[_0x0441('0x17')](_0x20ff5b)?JSON[_0x0441('0x13')](_0x20ff5b):_0x20ff5b);logger['info'](_0x0441('0x14'),_0x5dbdf5);_0xb376ff[_0x0441('0x16')]();}};}; \ 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 83b0abf..a335874 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 _0xe10a=['POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','stringify','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','?params=','urlOnRing','2.0','method','login','params'];(function(_0x3625dc,_0x58ccd2){var _0x4c29dc=function(_0x3d6568){while(--_0x3d6568){_0x3625dc['push'](_0x3625dc['shift']());}};_0x4c29dc(++_0x58ccd2);}(_0xe10a,0xd2));var _0xae10=function(_0x3be595,_0x264454){_0x3be595=_0x3be595-0x0;var _0x414585=_0xe10a[_0x3be595];return _0x414585;};'use strict';var rp=require('request-promise');var logger=require(_0xae10('0x0'))(_0xae10('0x1'));var _=require(_0xae10('0x2'));var arr=[];exports[_0xae10('0x3')]=function(_0x51539a,_0x2793f1){return function(_0x1c03a9){var _0x379e3f=_0x2793f1[0xa];var _0x4f5088=_0x2793f1[0xb];var _0x25d470=_0x2793f1[0xc];var _0x156f06=_0x2793f1[0xd];var _0x58a41e=_0x2793f1[0xe];var _0x5093f8=_0x2793f1[0xf][_0xae10('0x4')](/\n/g,_0xae10('0x5'));var _0x22eb85=_0x2793f1[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xae10('0x6')](_0x4f5088)){arr[_0xae10('0x7')](_0x4f5088);var _0x2150fa=_0x2793f1[0x3];var _0x3d202a=_0x2793f1[0x4];var _0x1721f6=_0x2793f1[0x1];var _0x1fed26=_0x2793f1[0x0];var _0x3627c3={};_0x3627c3['urlOnAnswer']=_0x2793f1[0x8]+_0xae10('0x8')+_0x25d470+'|'+_0x379e3f+'|'+_0x156f06+'|'+_0x4f5088+'|'+_0x58a41e;_0x3627c3[_0xae10('0x9')]=_0x2793f1[0x7]+_0xae10('0x8')+_0x25d470+'|'+_0x379e3f+'|'+_0x156f06+'|'+_0x4f5088+'|'+_0x58a41e+'|'+_0x5093f8+'|'+_0x22eb85;_0x3627c3['title']=_0x2793f1[0x9];var _0x44a9b3={};_0x44a9b3['jsonrpc']=_0xae10('0xa');_0x44a9b3[_0xae10('0xb')]=_0xae10('0xc');var _0x6668d3=[];_0x6668d3[_0xae10('0x7')](_0x2793f1[0x2]);_0x6668d3[_0xae10('0x7')](_0x2793f1[0x5]);_0x6668d3[_0xae10('0x7')](_0x2793f1[0x6]);_0x44a9b3[_0xae10('0xd')]=_0x6668d3;_0x44a9b3['id']=0x1;var _0x24d3ce=JSON['stringify'](_0x44a9b3);var _0x234566={'encoding':'utf8','method':_0xae10('0xe'),'timeout':0x2710,'url':_0x2150fa,'headers':{'Content-Type':_0xae10('0xf')},'body':_0x24d3ce};return rp(_0x234566)[_0xae10('0x10')](function(_0xc8efc3){const _0x1a6557=JSON[_0xae10('0x11')](_0xc8efc3);if(!_0x1a6557[_0xae10('0x12')][_0xae10('0x13')]){throw new Error(_0xae10('0x14'));}var _0x41f4e7=_0x4f5088;var _0xe96fe2=_0xae10('0x15')+_0x1721f6+_0xae10('0x16')+_0x1fed26+_0xae10('0x17')+_0x41f4e7+_0xae10('0x18')+JSON['stringify'](_0x3627c3);var _0x216c68=_0x3d202a+'?'+_0xe96fe2;return rp(_0x216c68);})[_0xae10('0x10')](function(_0x5de0f1){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x51539a,_0x5de0f1);_0x1c03a9[_0xae10('0x19')]();})[_0xae10('0x1a')](function(_0x4f6122){logger[_0xae10('0x1b')](_0xae10('0x1c'),_0x51539a,_[_0xae10('0x1d')](_0x4f6122)?JSON[_0xae10('0x1e')](_0x4f6122):_0x4f6122);_0x1c03a9['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x51539a);_0x1c03a9[_0xae10('0x1f')]();}};}; \ No newline at end of file +var _0x1249=['push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','login','stringify','utf8','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes'];(function(_0x24210f,_0x3510de){var _0x37b6db=function(_0x53a3ba){while(--_0x53a3ba){_0x24210f['push'](_0x24210f['shift']());}};_0x37b6db(++_0x3510de);}(_0x1249,0x1c7));var _0x9124=function(_0x1e1a04,_0x145339){_0x1e1a04=_0x1e1a04-0x0;var _0x8e1b87=_0x1249[_0x1e1a04];return _0x8e1b87;};'use strict';var rp=require('request-promise');var logger=require(_0x9124('0x0'))(_0x9124('0x1'));var _=require(_0x9124('0x2'));var arr=[];exports[_0x9124('0x3')]=function(_0x6c1139,_0x5b2dd2){return function(_0x4404da){var _0x19d7d9=_0x5b2dd2[0xa];var _0x2af81d=_0x5b2dd2[0xb];var _0x1529b3=_0x5b2dd2[0xc];var _0x34cff7=_0x5b2dd2[0xd];var _0x3d62ad=_0x5b2dd2[0xe];var _0x5b0de1=_0x5b2dd2[0xf][_0x9124('0x4')](/\n/g,_0x9124('0x5'));var _0x3b11b3=_0x5b2dd2[0x10][_0x9124('0x4')](/\n/g,'\x20');if(!arr[_0x9124('0x6')](_0x2af81d)){arr[_0x9124('0x7')](_0x2af81d);var _0x102d15=_0x5b2dd2[0x3];var _0x4b2c82=_0x5b2dd2[0x4];var _0x181504=_0x5b2dd2[0x1];var _0x288e56=_0x5b2dd2[0x0];var _0x31729e={};_0x31729e[_0x9124('0x8')]=_0x5b2dd2[0x8]+_0x9124('0x9')+_0x1529b3+'|'+_0x19d7d9+'|'+_0x34cff7+'|'+_0x2af81d+'|'+_0x3d62ad;_0x31729e[_0x9124('0xa')]=_0x5b2dd2[0x7]+_0x9124('0x9')+_0x1529b3+'|'+_0x19d7d9+'|'+_0x34cff7+'|'+_0x2af81d+'|'+_0x3d62ad+'|'+_0x5b0de1+'|'+_0x3b11b3;_0x31729e[_0x9124('0xb')]=_0x5b2dd2[0x9];var _0x3a5505={};_0x3a5505[_0x9124('0xc')]='2.0';_0x3a5505['method']=_0x9124('0xd');var _0x1bb656=[];_0x1bb656[_0x9124('0x7')](_0x5b2dd2[0x2]);_0x1bb656[_0x9124('0x7')](_0x5b2dd2[0x5]);_0x1bb656[_0x9124('0x7')](_0x5b2dd2[0x6]);_0x3a5505['params']=_0x1bb656;_0x3a5505['id']=0x1;var _0x2c6c36=JSON[_0x9124('0xe')](_0x3a5505);var _0x18ca28={'encoding':_0x9124('0xf'),'method':'POST','timeout':0x2710,'url':_0x102d15,'headers':{'Content-Type':_0x9124('0x10')},'body':_0x2c6c36};return rp(_0x18ca28)[_0x9124('0x11')](function(_0x3a32da){const _0x2d3c0c=JSON[_0x9124('0x12')](_0x3a32da);if(!_0x2d3c0c['result'][_0x9124('0x13')]){throw new Error(_0x9124('0x14'));}var _0x23a587=_0x2af81d;var _0x4b946b=_0x9124('0x15')+_0x181504+_0x9124('0x16')+_0x288e56+_0x9124('0x17')+_0x23a587+_0x9124('0x18')+JSON[_0x9124('0xe')](_0x31729e);var _0x48ccdc=_0x4b2c82+'?'+_0x4b946b;return rp(_0x48ccdc);})[_0x9124('0x11')](function(_0x3174a2){logger['info'](_0x9124('0x19'),_0x6c1139,_0x3174a2);_0x4404da[_0x9124('0x1a')]();})[_0x9124('0x1b')](function(_0x29f51f){logger[_0x9124('0x1c')](_0x9124('0x1d'),_0x6c1139,_['isObject'](_0x29f51f)?JSON[_0x9124('0xe')](_0x29f51f):_0x29f51f);_0x4404da[_0x9124('0x1a')]();});}else{logger[_0x9124('0x1e')](_0x9124('0x1f'),_0x6c1139);_0x4404da[_0x9124('0x20')]();}};}; \ 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 9bf8d98..1b205e1 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x34bb11,_0x45ae8c){var _0x2f4534=function(_0x3797cc){while(--_0x3797cc){_0x34bb11['push'](_0x34bb11['shift']());}};_0x2f4534(++_0x45ae8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x13a1f0,_0x509a26){var _0x88ae18=function(_0x53459b){while(--_0x53459b){_0x13a1f0['push'](_0x13a1f0['shift']());}};_0x88ae18(++_0x509a26);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3f23f33..2b0f999 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 _0x3c50=['hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','join','app','.js','toLowerCase','autoreply','appdata','mail','push','slice','dialogflow','split','amazonlex','tag','TagId','tvox','account','body','format','%s:%s:%s','./interval','intervals','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','matchPath','emit','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3c50,0x132));var _0x03c5=function(_0x451928,_0x4815ea){_0x451928=_0x451928-0x0;var _0x35a457=_0x3c50[_0x451928];return _0x35a457;};'use strict';var _=require(_0x03c5('0x0'));var util=require('util');var path=require(_0x03c5('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x03c5('0x2'));var utils=require(_0x03c5('0x3'));var sUtils=require(_0x03c5('0x4'));var logger=require(_0x03c5('0x5'))(_0x03c5('0x6'));var rpc={'openchannelQueueReport':require(_0x03c5('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x03c5('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x03c5('0x9')),'whatsappQueueReport':require(_0x03c5('0xa'))};var RuleEngine=require(_0x03c5('0xb'));function getId(_0x55c6a3,_0x3cc5ef,_0x4dadc4){return util['format'](_0x03c5('0xc'),_0x55c6a3,_0x3cc5ef||0x0,_0x4dadc4||0x0);}function getIntervals(_0x51cecb,_0x457ec8){var _0x5a3bed=[];if(!_[_0x03c5('0xd')](_0x457ec8[_0x03c5('0xe')])&&!_['isNil'](_0x51cecb[_0x457ec8[_0x03c5('0xe')]])&&!_[_0x03c5('0xd')](_0x51cecb[_0x457ec8[_0x03c5('0xe')]][_0x03c5('0xf')])){_0x5a3bed=_[_0x03c5('0x10')](_0x51cecb[_0x457ec8[_0x03c5('0xe')]]['Intervals'],_0x03c5('0x11'));}else if(!_[_0x03c5('0xd')](_0x457ec8[_0x03c5('0x11')])){_0x5a3bed=[_0x457ec8[_0x03c5('0x11')]];}return _0x5a3bed;}exports['listen']=function(_0x39bbb7){_0x39bbb7[_0x03c5('0x12')]={};return new BPromise(function(_0x4990c4,_0x4eccd8){var _0x19588f={'Start':function(_0x5a7113){var _0x4a46fe=this;return new Promise(function(_0x4ebb44,_0xc23735){if(_0x5a7113){try{var _0x4c71ed=[];var _0x2458fa=getId(_0x5a7113[_0x03c5('0x13')],_0x5a7113['message']?_0x5a7113[_0x03c5('0x14')]['id']:0x0,_0x5a7113[_0x03c5('0x15')]?_0x5a7113[_0x03c5('0x15')]['id']:0x0);var _0x47dd55=sUtils[_0x03c5('0x16')](_0x39bbb7,_0x5a7113);if(_0x5a7113[_0x03c5('0x17')]||!_0x47dd55&&_0x5a7113['applications']&&_['isArray'](_0x5a7113[_0x03c5('0x18')])&&_0x5a7113[_0x03c5('0x18')]['length']){for(var _0x57a601=0x0;_0x57a601<_0x5a7113[_0x03c5('0x18')][_0x03c5('0x19')];_0x57a601+=0x1){var _0x1af209=_0x5a7113[_0x03c5('0x18')][_0x57a601];if(fs['existsSync'](path[_0x03c5('0x1a')](__dirname,'applications',_0x1af209[_0x03c5('0x1b')]+_0x03c5('0x1c')))){var _0x5acdbb=[];switch(_0x1af209[_0x03c5('0x1b')][_0x03c5('0x1d')]()){case _0x03c5('0x1e'):var _0x114308=_0x1af209[_0x03c5('0x1f')]['split'](',');if(_0x5a7113['channel']===_0x03c5('0x20')){_0x5acdbb[_0x03c5('0x21')](_0x114308[0x0]);_0x5acdbb['push'](_0x114308[0x1]);_0x5acdbb[_0x03c5('0x21')](_0x114308[_0x03c5('0x22')](0x2,_0x114308['length'])['join'](','));}else{_0x5acdbb[_0x03c5('0x21')](_0x114308[0x0]);_0x5acdbb[_0x03c5('0x21')](_0x114308[_0x03c5('0x22')](0x1,_0x114308['length'])[_0x03c5('0x1a')](','));}break;case _0x03c5('0x23'):var _0xea7372=_0x1af209[_0x03c5('0x1f')][_0x03c5('0x24')](',');_0x5acdbb[_0x03c5('0x21')](_0xea7372[0x0]);_0x5acdbb[_0x03c5('0x21')](_0xea7372[0x1]);_0x5acdbb[_0x03c5('0x21')](_0xea7372['slice'](0x2,_0xea7372[_0x03c5('0x19')])[_0x03c5('0x1a')](','));break;case'dialogflowv2':var _0x2c2b3c=_0x1af209['appdata']['split'](',');_0x5acdbb['push'](_0x2c2b3c[0x0]);_0x5acdbb[_0x03c5('0x21')](_0x2c2b3c[0x1]);_0x5acdbb[_0x03c5('0x21')](_0x2c2b3c[0x2]);_0x5acdbb[_0x03c5('0x21')](_0x2c2b3c[0x3]);_0x5acdbb['push'](_0x2c2b3c['slice'](0x4,_0x2c2b3c[_0x03c5('0x19')])['join'](','));break;case _0x03c5('0x25'):var _0x5ec69e=_0x1af209['appdata'][_0x03c5('0x24')](',');_0x5acdbb[_0x03c5('0x21')](_0x5ec69e[0x0]);_0x5acdbb['push'](_0x5ec69e[0x1]);_0x5acdbb[_0x03c5('0x21')](_0x5ec69e[0x2]);_0x5acdbb['push'](_0x5ec69e[0x3]);_0x5acdbb[_0x03c5('0x21')](_0x5ec69e[_0x03c5('0x22')](0x4,_0x5ec69e[_0x03c5('0x19')])[_0x03c5('0x1a')](','));break;case _0x03c5('0x14'):_0x5acdbb[_0x03c5('0x21')](_0x1af209[_0x03c5('0x1f')]);break;case _0x03c5('0x26'):_0x5acdbb['push'](_0x1af209[_0x03c5('0x27')]);_0x5acdbb['push'](_0x1af209[_0x03c5('0x1f')]);break;case _0x03c5('0x28'):var _0x49f044=utils['getMustacheRender'](_0x5a7113[_0x03c5('0x29')]['notificationTemplate'],_0x5a7113);var _0x340a02=_0x1af209[_0x03c5('0x1f')][_0x03c5('0x24')](',');_0x5acdbb['push'](_0x340a02[0x0]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x1]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x2]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x3]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x4]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x5]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x6]);_0x5acdbb['push'](_0x340a02[0x7]);_0x5acdbb['push'](_0x340a02[0x8]);_0x5acdbb[_0x03c5('0x21')](_0x340a02[0x9]);_0x5acdbb['push'](_0x340a02[0xa]);_0x5acdbb[_0x03c5('0x21')](_0x5a7113['interaction']['id']);_0x5acdbb[_0x03c5('0x21')](_0x5a7113[_0x03c5('0x14')]['id']);_0x5acdbb[_0x03c5('0x21')](_0x1af209['ChatWebsiteId']);_0x5acdbb[_0x03c5('0x21')](_0x5a7113['interaction']['ContactId']);_0x5acdbb[_0x03c5('0x21')](_0x5a7113[_0x03c5('0x2a')]['body']);_0x5acdbb['push'](_0x49f044);break;default:_0x5acdbb=_['isNil'](_0x1af209['appdata'])?[]:_0x1af209['appdata'][_0x03c5('0x24')](',');}var _0x262ceb={'id':util[_0x03c5('0x2b')](_0x03c5('0x2c'),_0x2458fa,_0x1af209['id'],_0x1af209['app']),'condition':require(_0x03c5('0x2d'))['condition'](_0x2458fa,getIntervals(_0x39bbb7[_0x03c5('0x2e')],_0x1af209),_0x39bbb7),'consequence':require('./applications/'+_0x1af209[_0x03c5('0x1b')])['consequence'](_0x2458fa,_0x5acdbb,_0x39bbb7,_0x5a7113),'p':_0x1af209['priority']||0x0};logger['info'](_0x03c5('0x2f'),_0x262ceb['id'],'on\x20interval',getIntervals(_0x39bbb7['intervals'],_0x1af209)[_0x03c5('0x1a')](_0x03c5('0x30')));_0x4c71ed[_0x03c5('0x21')](_0x262ceb);}else{logger[_0x03c5('0x31')](_0x03c5('0x32'),path[_0x03c5('0x1a')](__dirname,_0x03c5('0x18'),_0x1af209[_0x03c5('0x1b')]+_0x03c5('0x1c')));}}_0x39bbb7[_0x03c5('0x12')][_0x2458fa]=new RuleEngine(_0x4c71ed);_0x39bbb7[_0x03c5('0x12')][_0x2458fa][_0x03c5('0x33')](_0x5a7113,function(_0x3aec6a){logger[_0x03c5('0x34')]('Applications\x20executed',JSON['stringify'](_0x3aec6a[_0x03c5('0x35')]));if(_0x39bbb7[_0x03c5('0x12')][_0x2458fa]){_0x39bbb7[_0x03c5('0x12')][_0x2458fa][_0x03c5('0x36')]('complete');}});return _0x4ebb44({'code':0xc8,'message':_0x5a7113});}else{if(_0x47dd55){logger[_0x03c5('0x34')](util['format'](_0x03c5('0x37'),_0x2458fa));}else{logger[_0x03c5('0x34')]('No\x20applications\x20to\x20execute');}return _0x4ebb44({'code':0xc8,'message':_0x5a7113});}}catch(_0x383b5a){logger[_0x03c5('0x31')](_0x383b5a[_0x03c5('0x38')]);return _0xc23735(_0x4a46fe['error'](0x1f4,_0x383b5a));}}return _0xc23735('routing\x20is\x20empty');});},'AcceptMessage':function(_0x248d24){var _0x1f4f81=this;return new Promise(function(_0x5a8fd6,_0x319da6){if(_0x248d24[_0x03c5('0x39')]&&_0x248d24[_0x03c5('0x39')]['id']){if(_0x39bbb7[_0x03c5('0x3a')][_0x248d24[_0x03c5('0x39')]['id']]){_0x39bbb7[_0x03c5('0x3a')][_0x248d24['agent']['id']][_0x03c5('0x3b')]=![];_0x39bbb7['agents'][_0x248d24[_0x03c5('0x39')]['id']][_0x03c5('0x3c')]=undefined;}}if(_0x248d24[_0x03c5('0x14')]&&_0x248d24['message']['id']){try{var _0x168d1c=getId(_0x248d24[_0x03c5('0x13')],_0x248d24['message']?_0x248d24['message']['id']:0x0,_0x248d24[_0x03c5('0x15')]?_0x248d24['interaction']['id']:0x0);if(_0x39bbb7['rules'][_0x168d1c]){_0x39bbb7[_0x03c5('0x12')][_0x168d1c][_0x03c5('0x36')](_0x03c5('0x3d'));if(rpc[_0x248d24[_0x03c5('0x13')]+_0x03c5('0x3e')]){rpc[_0x248d24[_0x03c5('0x13')]+'QueueReport'][_0x03c5('0x3f')](_0x168d1c,{'UserId':_0x248d24['message'][_0x03c5('0x40')]})['catch'](function(){logger[_0x03c5('0x31')]('error\x20update\x20queue\x20report');});}}return _0x5a8fd6({'code':0xc8,'message':_0x248d24});}catch(_0x565529){logger[_0x03c5('0x31')](_0x565529[_0x03c5('0x38')]);return _0x319da6(_0x1f4f81[_0x03c5('0x31')](0x1f4,_0x565529));}}logger[_0x03c5('0x31')](_0x03c5('0x41'));return _0x319da6(_0x1f4f81[_0x03c5('0x31')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4a0ab9){var _0x128f9c=this;return new Promise(function(_0x1344a3,_0x2b8eb1){if(_0x4a0ab9['agent']&&_0x4a0ab9[_0x03c5('0x39')]['id']){try{if(_0x39bbb7[_0x03c5('0x3a')][_0x4a0ab9[_0x03c5('0x39')]['id']]){_0x39bbb7[_0x03c5('0x3a')][_0x4a0ab9['agent']['id']][_0x03c5('0x3b')]=![];_0x39bbb7['agents'][_0x4a0ab9['agent']['id']][_0x03c5('0x3c')]=undefined;}return _0x1344a3({'code':0xc8,'message':_0x4a0ab9});}catch(_0x22b890){logger[_0x03c5('0x31')](_0x22b890[_0x03c5('0x38')]);return _0x2b8eb1(_0x128f9c[_0x03c5('0x31')](0x1f4,_0x22b890));}}logger[_0x03c5('0x31')](_0x03c5('0x41'));return _0x2b8eb1(_0x128f9c[_0x03c5('0x31')](0x1f4,_0x03c5('0x41')));});},'AbandonInteraction':function(_0x3f74fb){var _0x587ec5=this;return new Promise(function(_0x130d35,_0x3e8de2){if(_0x3f74fb['channel']&&_0x3f74fb['interaction']&&_0x3f74fb['interaction']['id']){try{var _0xd0101a=getId(_0x3f74fb[_0x03c5('0x13')],_0x3f74fb['message']?_0x3f74fb[_0x03c5('0x14')]['id']:0x0,_0x3f74fb['interaction']?_0x3f74fb[_0x03c5('0x15')]['id']:0x0);if(_0x39bbb7[_0x03c5('0x12')][_0xd0101a]){_0x39bbb7[_0x03c5('0x12')][_0xd0101a][_0x03c5('0x36')](_0x03c5('0x3d'));}return _0x130d35({'code':0xc8,'message':_0x3f74fb});}catch(_0xee76b1){logger[_0x03c5('0x31')](_0xee76b1[_0x03c5('0x38')]);return _0x3e8de2(_0x587ec5[_0x03c5('0x31')](0x1f4,_0xee76b1));}}logger['error']('message\x20is\x20empty');return _0x3e8de2(_0x587ec5[_0x03c5('0x31')](0x1f4,_0x03c5('0x41')));});},'AgentCapacity':function(_0x20b20f){var _0x49561b=this;return new Promise(function(_0xadce59,_0x14141b){if(_0x39bbb7[_0x03c5('0x3a')][_0x03c5('0x42')](_0x20b20f['id'])){for(var _0x4ba813 in _0x20b20f[_0x03c5('0x43')]){if(_0x20b20f[_0x03c5('0x43')][_0x03c5('0x42')](_0x4ba813)){if(_0x39bbb7[_0x03c5('0x3a')][_0x20b20f['id']]['hasOwnProperty'](_0x4ba813+_0x03c5('0x44'))){_0x39bbb7['agents'][_0x20b20f['id']][_0x4ba813+_0x03c5('0x44')]=parseInt(_0x20b20f[_0x03c5('0x43')][_0x4ba813],0xa);}}}_0x39bbb7[_0x03c5('0x3a')][_0x20b20f['id']][_0x03c5('0x45')]();return _0xadce59({'code':0xc8,'message':_0x39bbb7['agents'][_0x20b20f['id']]});}else{return _0x14141b(_0x49561b['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc956c){return new Promise(function(_0x4d62ca){var _0x4e4dd8=_[_0x03c5('0x46')](_0x39bbb7[_0x03c5('0x3a')]);if(_0xc956c&&_0xc956c['id']){var _0x9aa7e9=_[_0x03c5('0x47')](_0x4e4dd8,function(_0xb81021){return _0xb81021['id']===_0xc956c['id'];});_0x4d62ca(_0x9aa7e9);}else{_0x4d62ca({'count':_0x4e4dd8[_0x03c5('0x19')],'rows':_0x4e4dd8});}});},'ChatQueues':function(){return new Promise(function(_0x526a15){var _0x54d111=[];for(var _0x4904ae in _0x39bbb7[_0x03c5('0x48')]){if(_0x39bbb7[_0x03c5('0x48')]['hasOwnProperty'](_0x4904ae)){var _0x241374=_0x39bbb7['chatQueues'][_0x4904ae];var _0x470a36={'id':_0x241374['id'],'available':_0x241374[_0x03c5('0x49')],'loggedIn':_0x241374[_0x03c5('0x4a')],'name':_0x241374[_0x03c5('0x4b')],'paused':_0x241374[_0x03c5('0x4c')],'waiting':_0x241374['waiting']};_0x54d111[_0x03c5('0x21')](_0x470a36);}}_0x526a15({'count':_0x54d111['length'],'rows':_0x54d111});});},'MailQueues':function(){return new Promise(function(_0x3e783a){var _0x3ad4cf=[];for(var _0x4b337e in _0x39bbb7[_0x03c5('0x4d')]){if(_0x39bbb7['mailQueues'][_0x03c5('0x42')](_0x4b337e)){var _0xb822f9=_0x39bbb7[_0x03c5('0x4d')][_0x4b337e];var _0x30443c={'id':_0xb822f9['id'],'available':_0xb822f9['available'],'loggedIn':_0xb822f9[_0x03c5('0x4a')],'name':_0xb822f9[_0x03c5('0x4b')],'paused':_0xb822f9[_0x03c5('0x4c')],'waiting':_0xb822f9[_0x03c5('0x4e')]};_0x3ad4cf[_0x03c5('0x21')](_0x30443c);}}_0x3e783a({'count':_0x3ad4cf[_0x03c5('0x19')],'rows':_0x3ad4cf});});},'OpenchannelQueues':function(){return new Promise(function(_0x5217f2){var _0x4a66ad=[];for(var _0x31ac0c in _0x39bbb7[_0x03c5('0x4f')]){if(_0x39bbb7[_0x03c5('0x4f')]['hasOwnProperty'](_0x31ac0c)){var _0x455c6e=_0x39bbb7[_0x03c5('0x4f')][_0x31ac0c];var _0xf23795={'id':_0x455c6e['id'],'available':_0x455c6e['available'],'loggedIn':_0x455c6e['loggedIn'],'name':_0x455c6e[_0x03c5('0x4b')],'paused':_0x455c6e['paused'],'waiting':_0x455c6e[_0x03c5('0x4e')]};_0x4a66ad[_0x03c5('0x21')](_0xf23795);}}_0x5217f2({'count':_0x4a66ad[_0x03c5('0x19')],'rows':_0x4a66ad});});},'SmsQueues':function(){return new Promise(function(_0x122929){var _0x21c978=[];for(var _0x3e1b77 in _0x39bbb7[_0x03c5('0x50')]){if(_0x39bbb7[_0x03c5('0x50')][_0x03c5('0x42')](_0x3e1b77)){var _0x35545e=_0x39bbb7[_0x03c5('0x50')][_0x3e1b77];var _0x4307d1={'id':_0x35545e['id'],'available':_0x35545e[_0x03c5('0x49')],'loggedIn':_0x35545e['loggedIn'],'name':_0x35545e['name'],'paused':_0x35545e['paused'],'waiting':_0x35545e[_0x03c5('0x4e')]};_0x21c978[_0x03c5('0x21')](_0x4307d1);}}_0x122929({'count':_0x21c978[_0x03c5('0x19')],'rows':_0x21c978});});},'FaxQueues':function(){return new Promise(function(_0x31df8e){var _0x202242=[];for(var _0x4ac0f5 in _0x39bbb7[_0x03c5('0x51')]){if(_0x39bbb7[_0x03c5('0x51')][_0x03c5('0x42')](_0x4ac0f5)){var _0x23397b=_0x39bbb7['faxQueues'][_0x4ac0f5];var _0x5ddad9={'id':_0x23397b['id'],'available':_0x23397b[_0x03c5('0x49')],'loggedIn':_0x23397b[_0x03c5('0x4a')],'name':_0x23397b[_0x03c5('0x4b')],'paused':_0x23397b[_0x03c5('0x4c')],'waiting':_0x23397b[_0x03c5('0x4e')]};_0x202242[_0x03c5('0x21')](_0x5ddad9);}}_0x31df8e({'count':_0x202242[_0x03c5('0x19')],'rows':_0x202242});});},'WhatsappQueues':function(){return new Promise(function(_0x3c5694){var _0x34acc7=[];for(var _0x31be8d in _0x39bbb7['whatsappQueues']){if(_0x39bbb7['whatsappQueues'][_0x03c5('0x42')](_0x31be8d)){var _0x450ef6=_0x39bbb7['whatsappQueues'][_0x31be8d];var _0xde47cd={'id':_0x450ef6['id'],'available':_0x450ef6[_0x03c5('0x49')],'loggedIn':_0x450ef6[_0x03c5('0x4a')],'name':_0x450ef6[_0x03c5('0x4b')],'paused':_0x450ef6[_0x03c5('0x4c')],'waiting':_0x450ef6[_0x03c5('0x4e')]};_0x34acc7[_0x03c5('0x21')](_0xde47cd);}}_0x3c5694({'count':_0x34acc7[_0x03c5('0x19')],'rows':_0x34acc7});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x159fd0){var _0x2ecbdf=_[_0x03c5('0x46')](_0x39bbb7[_0x03c5('0x52')]);_0x159fd0({'count':_0x2ecbdf[_0x03c5('0x19')],'rows':_0x2ecbdf});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x61073c){var _0x1fedc0=_[_0x03c5('0x46')](_0x39bbb7[_0x03c5('0x53')]);_0x61073c({'count':_0x1fedc0[_0x03c5('0x19')],'rows':_0x1fedc0});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xec9bd3){var _0x130c6b=_['values'](_0x39bbb7[_0x03c5('0x54')]);_0xec9bd3({'count':_0x130c6b[_0x03c5('0x19')],'rows':_0x130c6b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x234d59){var _0x212bc8=_['values'](_0x39bbb7[_0x03c5('0x55')]);_0x234d59({'count':_0x212bc8[_0x03c5('0x19')],'rows':_0x212bc8});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1cda30){var _0x15b560=_[_0x03c5('0x46')](_0x39bbb7[_0x03c5('0x56')]);_0x1cda30({'count':_0x15b560[_0x03c5('0x19')],'rows':_0x15b560});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x36c366){var _0x49eb66=_[_0x03c5('0x46')](_0x39bbb7[_0x03c5('0x57')]);_0x36c366({'count':_0x49eb66[_0x03c5('0x19')],'rows':_0x49eb66});});}};var _0x2f9dee=jayson[_0x03c5('0x58')](_0x19588f)['http']();_0x2f9dee['on'](_0x03c5('0x31'),function(_0x1c6a75){logger[_0x03c5('0x31')](JSON['stringify'](_0x1c6a75));return _0x4eccd8(_0x1c6a75);});_0x2f9dee[_0x03c5('0x59')](0x232c,'127.0.0.1',function(){console[_0x03c5('0x5a')](_0x03c5('0x5b'),0x232c);return _0x4990c4(_0x03c5('0x5c')+0x232c);});});}; \ No newline at end of file +var _0xfb8a=['condition','intervals','consequence','priority','info','on\x20interval','\x20|\x20','error','.js','rules','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','transfer','applications','isArray','length','existsSync','app','toLowerCase','autoreply','appdata','split','push','join','dialogflow','slice','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body'];(function(_0x5288da,_0x2d77cc){var _0x2ac233=function(_0x57de57){while(--_0x57de57){_0x5288da['push'](_0x5288da['shift']());}};_0x2ac233(++_0x2d77cc);}(_0xfb8a,0x109));var _0xafb8=function(_0x2c76b2,_0x35fa8b){_0x2c76b2=_0x2c76b2-0x0;var _0x11b6f4=_0xfb8a[_0x2c76b2];return _0x11b6f4;};'use strict';var _=require(_0xafb8('0x0'));var util=require(_0xafb8('0x1'));var path=require(_0xafb8('0x2'));var fs=require('fs');var jayson=require(_0xafb8('0x3'));var BPromise=require('bluebird');var utils=require(_0xafb8('0x4'));var sUtils=require('./applications/strategy/util');var logger=require(_0xafb8('0x5'))(_0xafb8('0x6'));var rpc={'openchannelQueueReport':require(_0xafb8('0x7')),'mailQueueReport':require(_0xafb8('0x8')),'chatQueueReport':require(_0xafb8('0x9')),'smsQueueReport':require(_0xafb8('0xa')),'faxQueueReport':require(_0xafb8('0xb')),'whatsappQueueReport':require(_0xafb8('0xc'))};var RuleEngine=require(_0xafb8('0xd'));function getId(_0x694212,_0x1f3121,_0x3bf691){return util[_0xafb8('0xe')](_0xafb8('0xf'),_0x694212,_0x1f3121||0x0,_0x3bf691||0x0);}function getIntervals(_0x49a78d,_0x2b312e){var _0x5a77c6=[];if(!_[_0xafb8('0x10')](_0x2b312e[_0xafb8('0x11')])&&!_['isNil'](_0x49a78d[_0x2b312e['IntervalId']])&&!_['isNil'](_0x49a78d[_0x2b312e[_0xafb8('0x11')]][_0xafb8('0x12')])){_0x5a77c6=_[_0xafb8('0x13')](_0x49a78d[_0x2b312e['IntervalId']][_0xafb8('0x12')],'interval');}else if(!_[_0xafb8('0x10')](_0x2b312e[_0xafb8('0x14')])){_0x5a77c6=[_0x2b312e[_0xafb8('0x14')]];}return _0x5a77c6;}exports['listen']=function(_0x3010c5){_0x3010c5['rules']={};return new BPromise(function(_0x20efb8,_0x4579f2){var _0x2fe3b5={'Start':function(_0x4223a5){var _0x40e7d8=this;return new Promise(function(_0x1816aa,_0x322c81){if(_0x4223a5){try{var _0x166253=[];var _0x110b1d=getId(_0x4223a5[_0xafb8('0x15')],_0x4223a5[_0xafb8('0x16')]?_0x4223a5['message']['id']:0x0,_0x4223a5[_0xafb8('0x17')]?_0x4223a5['interaction']['id']:0x0);var _0x9dc30c=sUtils['checkWaitingNotifications'](_0x3010c5,_0x4223a5);if(_0x4223a5[_0xafb8('0x18')]||!_0x9dc30c&&_0x4223a5[_0xafb8('0x19')]&&_[_0xafb8('0x1a')](_0x4223a5[_0xafb8('0x19')])&&_0x4223a5['applications'][_0xafb8('0x1b')]){for(var _0x3a2d37=0x0;_0x3a2d37<_0x4223a5[_0xafb8('0x19')][_0xafb8('0x1b')];_0x3a2d37+=0x1){var _0x243810=_0x4223a5[_0xafb8('0x19')][_0x3a2d37];if(fs[_0xafb8('0x1c')](path['join'](__dirname,'applications',_0x243810[_0xafb8('0x1d')]+'.js'))){var _0x5e9e93=[];switch(_0x243810[_0xafb8('0x1d')][_0xafb8('0x1e')]()){case _0xafb8('0x1f'):var _0x1741ee=_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');if(_0x4223a5[_0xafb8('0x15')]==='mail'){_0x5e9e93[_0xafb8('0x22')](_0x1741ee[0x0]);_0x5e9e93['push'](_0x1741ee[0x1]);_0x5e9e93[_0xafb8('0x22')](_0x1741ee['slice'](0x2,_0x1741ee['length'])['join'](','));}else{_0x5e9e93[_0xafb8('0x22')](_0x1741ee[0x0]);_0x5e9e93['push'](_0x1741ee['slice'](0x1,_0x1741ee[_0xafb8('0x1b')])[_0xafb8('0x23')](','));}break;case _0xafb8('0x24'):var _0x117f43=_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');_0x5e9e93[_0xafb8('0x22')](_0x117f43[0x0]);_0x5e9e93[_0xafb8('0x22')](_0x117f43[0x1]);_0x5e9e93['push'](_0x117f43[_0xafb8('0x25')](0x2,_0x117f43[_0xafb8('0x1b')])[_0xafb8('0x23')](','));break;case _0xafb8('0x26'):var _0x1b777a=_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');_0x5e9e93[_0xafb8('0x22')](_0x1b777a[0x0]);_0x5e9e93['push'](_0x1b777a[0x1]);_0x5e9e93[_0xafb8('0x22')](_0x1b777a[0x2]);_0x5e9e93['push'](_0x1b777a[0x3]);_0x5e9e93[_0xafb8('0x22')](_0x1b777a[_0xafb8('0x25')](0x4,_0x1b777a[_0xafb8('0x1b')])[_0xafb8('0x23')](','));break;case _0xafb8('0x27'):var _0x13e35e=_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');_0x5e9e93['push'](_0x13e35e[0x0]);_0x5e9e93[_0xafb8('0x22')](_0x13e35e[0x1]);_0x5e9e93[_0xafb8('0x22')](_0x13e35e[0x2]);_0x5e9e93[_0xafb8('0x22')](_0x13e35e[0x3]);_0x5e9e93[_0xafb8('0x22')](_0x13e35e[_0xafb8('0x25')](0x4,_0x13e35e[_0xafb8('0x1b')])[_0xafb8('0x23')](','));break;case _0xafb8('0x16'):_0x5e9e93[_0xafb8('0x22')](_0x243810['appdata']);break;case _0xafb8('0x28'):_0x5e9e93[_0xafb8('0x22')](_0x243810[_0xafb8('0x29')]);_0x5e9e93['push'](_0x243810[_0xafb8('0x20')]);break;case'tvox':var _0x1b8ad8=utils[_0xafb8('0x2a')](_0x4223a5[_0xafb8('0x2b')][_0xafb8('0x2c')],_0x4223a5);var _0x12f4fa=_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');_0x5e9e93['push'](_0x12f4fa[0x0]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x1]);_0x5e9e93['push'](_0x12f4fa[0x2]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x3]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x4]);_0x5e9e93['push'](_0x12f4fa[0x5]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x6]);_0x5e9e93['push'](_0x12f4fa[0x7]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x8]);_0x5e9e93[_0xafb8('0x22')](_0x12f4fa[0x9]);_0x5e9e93['push'](_0x12f4fa[0xa]);_0x5e9e93['push'](_0x4223a5['interaction']['id']);_0x5e9e93[_0xafb8('0x22')](_0x4223a5[_0xafb8('0x16')]['id']);_0x5e9e93[_0xafb8('0x22')](_0x243810['ChatWebsiteId']);_0x5e9e93[_0xafb8('0x22')](_0x4223a5[_0xafb8('0x17')][_0xafb8('0x2d')]);_0x5e9e93[_0xafb8('0x22')](_0x4223a5[_0xafb8('0x2e')][_0xafb8('0x2e')]);_0x5e9e93['push'](_0x1b8ad8);break;default:_0x5e9e93=_[_0xafb8('0x10')](_0x243810[_0xafb8('0x20')])?[]:_0x243810[_0xafb8('0x20')][_0xafb8('0x21')](',');}var _0x303a20={'id':util[_0xafb8('0xe')]('%s:%s:%s',_0x110b1d,_0x243810['id'],_0x243810[_0xafb8('0x1d')]),'condition':require('./interval')[_0xafb8('0x2f')](_0x110b1d,getIntervals(_0x3010c5[_0xafb8('0x30')],_0x243810),_0x3010c5),'consequence':require('./applications/'+_0x243810[_0xafb8('0x1d')])[_0xafb8('0x31')](_0x110b1d,_0x5e9e93,_0x3010c5,_0x4223a5),'p':_0x243810[_0xafb8('0x32')]||0x0};logger[_0xafb8('0x33')]('Push\x20new\x20rule',_0x303a20['id'],_0xafb8('0x34'),getIntervals(_0x3010c5[_0xafb8('0x30')],_0x243810)[_0xafb8('0x23')](_0xafb8('0x35')));_0x166253[_0xafb8('0x22')](_0x303a20);}else{logger[_0xafb8('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xafb8('0x23')](__dirname,_0xafb8('0x19'),_0x243810[_0xafb8('0x1d')]+_0xafb8('0x37')));}}_0x3010c5[_0xafb8('0x38')][_0x110b1d]=new RuleEngine(_0x166253);_0x3010c5[_0xafb8('0x38')][_0x110b1d][_0xafb8('0x39')](_0x4223a5,function(_0x3e09d4){logger['info'](_0xafb8('0x3a'),JSON[_0xafb8('0x3b')](_0x3e09d4['matchPath']));if(_0x3010c5[_0xafb8('0x38')][_0x110b1d]){_0x3010c5[_0xafb8('0x38')][_0x110b1d][_0xafb8('0x3c')](_0xafb8('0x3d'));}});return _0x1816aa({'code':0xc8,'message':_0x4223a5});}else{if(_0x9dc30c){logger[_0xafb8('0x33')](util['format'](_0xafb8('0x3e'),_0x110b1d));}else{logger[_0xafb8('0x33')]('No\x20applications\x20to\x20execute');}return _0x1816aa({'code':0xc8,'message':_0x4223a5});}}catch(_0x28f699){logger[_0xafb8('0x36')](_0x28f699['stack']);return _0x322c81(_0x40e7d8[_0xafb8('0x36')](0x1f4,_0x28f699));}}return _0x322c81(_0xafb8('0x3f'));});},'AcceptMessage':function(_0xc2ba19){var _0x23df0c=this;return new Promise(function(_0x52d6b5,_0x21920f){if(_0xc2ba19[_0xafb8('0x40')]&&_0xc2ba19[_0xafb8('0x40')]['id']){if(_0x3010c5[_0xafb8('0x41')][_0xc2ba19[_0xafb8('0x40')]['id']]){_0x3010c5[_0xafb8('0x41')][_0xc2ba19['agent']['id']][_0xafb8('0x42')]=![];_0x3010c5[_0xafb8('0x41')][_0xc2ba19[_0xafb8('0x40')]['id']][_0xafb8('0x43')]=undefined;}}if(_0xc2ba19[_0xafb8('0x16')]&&_0xc2ba19[_0xafb8('0x16')]['id']){try{var _0x14d07=getId(_0xc2ba19[_0xafb8('0x15')],_0xc2ba19[_0xafb8('0x16')]?_0xc2ba19[_0xafb8('0x16')]['id']:0x0,_0xc2ba19[_0xafb8('0x17')]?_0xc2ba19[_0xafb8('0x17')]['id']:0x0);if(_0x3010c5[_0xafb8('0x38')][_0x14d07]){_0x3010c5['rules'][_0x14d07][_0xafb8('0x3c')](_0xafb8('0x44'));if(rpc[_0xc2ba19[_0xafb8('0x15')]+_0xafb8('0x45')]){rpc[_0xc2ba19[_0xafb8('0x15')]+_0xafb8('0x45')][_0xafb8('0x46')](_0x14d07,{'UserId':_0xc2ba19['message']['UserId']})[_0xafb8('0x47')](function(){logger[_0xafb8('0x36')](_0xafb8('0x48'));});}}return _0x52d6b5({'code':0xc8,'message':_0xc2ba19});}catch(_0x14dae7){logger[_0xafb8('0x36')](_0x14dae7[_0xafb8('0x49')]);return _0x21920f(_0x23df0c[_0xafb8('0x36')](0x1f4,_0x14dae7));}}logger[_0xafb8('0x36')](_0xafb8('0x4a'));return _0x21920f(_0x23df0c[_0xafb8('0x36')](0x1f4,_0xafb8('0x4a')));});},'RejectMessage':function(_0x5ea3e9){var _0xe31143=this;return new Promise(function(_0x44a376,_0x1a017b){if(_0x5ea3e9['agent']&&_0x5ea3e9[_0xafb8('0x40')]['id']){try{if(_0x3010c5[_0xafb8('0x41')][_0x5ea3e9[_0xafb8('0x40')]['id']]){_0x3010c5[_0xafb8('0x41')][_0x5ea3e9[_0xafb8('0x40')]['id']][_0xafb8('0x42')]=![];_0x3010c5[_0xafb8('0x41')][_0x5ea3e9['agent']['id']][_0xafb8('0x43')]=undefined;}return _0x44a376({'code':0xc8,'message':_0x5ea3e9});}catch(_0x19df8f){logger[_0xafb8('0x36')](_0x19df8f[_0xafb8('0x49')]);return _0x1a017b(_0xe31143[_0xafb8('0x36')](0x1f4,_0x19df8f));}}logger[_0xafb8('0x36')](_0xafb8('0x4a'));return _0x1a017b(_0xe31143['error'](0x1f4,_0xafb8('0x4a')));});},'AbandonInteraction':function(_0x9ff6b3){var _0x7b78ee=this;return new Promise(function(_0x1642b9,_0x24c99e){if(_0x9ff6b3[_0xafb8('0x15')]&&_0x9ff6b3[_0xafb8('0x17')]&&_0x9ff6b3['interaction']['id']){try{var _0x55f914=getId(_0x9ff6b3['channel'],_0x9ff6b3[_0xafb8('0x16')]?_0x9ff6b3[_0xafb8('0x16')]['id']:0x0,_0x9ff6b3[_0xafb8('0x17')]?_0x9ff6b3[_0xafb8('0x17')]['id']:0x0);if(_0x3010c5[_0xafb8('0x38')][_0x55f914]){_0x3010c5[_0xafb8('0x38')][_0x55f914]['emit'](_0xafb8('0x44'));}return _0x1642b9({'code':0xc8,'message':_0x9ff6b3});}catch(_0x56c8eb){logger['error'](_0x56c8eb['stack']);return _0x24c99e(_0x7b78ee[_0xafb8('0x36')](0x1f4,_0x56c8eb));}}logger['error']('message\x20is\x20empty');return _0x24c99e(_0x7b78ee[_0xafb8('0x36')](0x1f4,_0xafb8('0x4a')));});},'AgentCapacity':function(_0x2c2749){var _0x3119e3=this;return new Promise(function(_0x2a81c7,_0x47d0cb){if(_0x3010c5[_0xafb8('0x41')][_0xafb8('0x4b')](_0x2c2749['id'])){for(var _0x5c390a in _0x2c2749[_0xafb8('0x4c')]){if(_0x2c2749['capacity'][_0xafb8('0x4b')](_0x5c390a)){if(_0x3010c5[_0xafb8('0x41')][_0x2c2749['id']][_0xafb8('0x4b')](_0x5c390a+_0xafb8('0x4d'))){_0x3010c5[_0xafb8('0x41')][_0x2c2749['id']][_0x5c390a+_0xafb8('0x4d')]=parseInt(_0x2c2749['capacity'][_0x5c390a],0xa);}}}_0x3010c5[_0xafb8('0x41')][_0x2c2749['id']]['updateRealtime']();return _0x2a81c7({'code':0xc8,'message':_0x3010c5[_0xafb8('0x41')][_0x2c2749['id']]});}else{return _0x47d0cb(_0x3119e3[_0xafb8('0x36')](0x1f4,_0xafb8('0x4e')));}});},'Agents':function(_0x2d0cc0){return new Promise(function(_0x32d684){var _0x1efb9d=_['values'](_0x3010c5[_0xafb8('0x41')]);if(_0x2d0cc0&&_0x2d0cc0['id']){var _0x1e37c7=_[_0xafb8('0x4f')](_0x1efb9d,function(_0x241c22){return _0x241c22['id']===_0x2d0cc0['id'];});_0x32d684(_0x1e37c7);}else{_0x32d684({'count':_0x1efb9d['length'],'rows':_0x1efb9d});}});},'ChatQueues':function(){return new Promise(function(_0x179c4f){var _0x43a394=[];for(var _0x1ba6f9 in _0x3010c5[_0xafb8('0x50')]){if(_0x3010c5[_0xafb8('0x50')][_0xafb8('0x4b')](_0x1ba6f9)){var _0x39c68c=_0x3010c5[_0xafb8('0x50')][_0x1ba6f9];var _0x115072={'id':_0x39c68c['id'],'available':_0x39c68c[_0xafb8('0x51')],'loggedIn':_0x39c68c[_0xafb8('0x52')],'name':_0x39c68c[_0xafb8('0x53')],'paused':_0x39c68c['paused'],'waiting':_0x39c68c['waiting']};_0x43a394[_0xafb8('0x22')](_0x115072);}}_0x179c4f({'count':_0x43a394[_0xafb8('0x1b')],'rows':_0x43a394});});},'MailQueues':function(){return new Promise(function(_0x4fb794){var _0xcca3f7=[];for(var _0x55f825 in _0x3010c5['mailQueues']){if(_0x3010c5[_0xafb8('0x54')][_0xafb8('0x4b')](_0x55f825)){var _0x47f668=_0x3010c5['mailQueues'][_0x55f825];var _0xa67b2a={'id':_0x47f668['id'],'available':_0x47f668[_0xafb8('0x51')],'loggedIn':_0x47f668['loggedIn'],'name':_0x47f668[_0xafb8('0x53')],'paused':_0x47f668[_0xafb8('0x55')],'waiting':_0x47f668[_0xafb8('0x56')]};_0xcca3f7[_0xafb8('0x22')](_0xa67b2a);}}_0x4fb794({'count':_0xcca3f7[_0xafb8('0x1b')],'rows':_0xcca3f7});});},'OpenchannelQueues':function(){return new Promise(function(_0x10fa9d){var _0x940207=[];for(var _0x1bcd7a in _0x3010c5[_0xafb8('0x57')]){if(_0x3010c5['openchannelQueues']['hasOwnProperty'](_0x1bcd7a)){var _0x36e372=_0x3010c5[_0xafb8('0x57')][_0x1bcd7a];var _0x23352e={'id':_0x36e372['id'],'available':_0x36e372['available'],'loggedIn':_0x36e372['loggedIn'],'name':_0x36e372[_0xafb8('0x53')],'paused':_0x36e372[_0xafb8('0x55')],'waiting':_0x36e372[_0xafb8('0x56')]};_0x940207['push'](_0x23352e);}}_0x10fa9d({'count':_0x940207[_0xafb8('0x1b')],'rows':_0x940207});});},'SmsQueues':function(){return new Promise(function(_0x9e6c17){var _0xb2bfeb=[];for(var _0x2ba07b in _0x3010c5[_0xafb8('0x58')]){if(_0x3010c5[_0xafb8('0x58')][_0xafb8('0x4b')](_0x2ba07b)){var _0x1274fc=_0x3010c5[_0xafb8('0x58')][_0x2ba07b];var _0xe16e5e={'id':_0x1274fc['id'],'available':_0x1274fc['available'],'loggedIn':_0x1274fc[_0xafb8('0x52')],'name':_0x1274fc[_0xafb8('0x53')],'paused':_0x1274fc[_0xafb8('0x55')],'waiting':_0x1274fc['waiting']};_0xb2bfeb[_0xafb8('0x22')](_0xe16e5e);}}_0x9e6c17({'count':_0xb2bfeb[_0xafb8('0x1b')],'rows':_0xb2bfeb});});},'FaxQueues':function(){return new Promise(function(_0x1f5b2b){var _0x3f19fb=[];for(var _0x21d17a in _0x3010c5[_0xafb8('0x59')]){if(_0x3010c5[_0xafb8('0x59')]['hasOwnProperty'](_0x21d17a)){var _0x334453=_0x3010c5[_0xafb8('0x59')][_0x21d17a];var _0x39439c={'id':_0x334453['id'],'available':_0x334453[_0xafb8('0x51')],'loggedIn':_0x334453[_0xafb8('0x52')],'name':_0x334453['name'],'paused':_0x334453[_0xafb8('0x55')],'waiting':_0x334453[_0xafb8('0x56')]};_0x3f19fb['push'](_0x39439c);}}_0x1f5b2b({'count':_0x3f19fb[_0xafb8('0x1b')],'rows':_0x3f19fb});});},'WhatsappQueues':function(){return new Promise(function(_0x6bf82f){var _0x4e813b=[];for(var _0x59d6a3 in _0x3010c5[_0xafb8('0x5a')]){if(_0x3010c5[_0xafb8('0x5a')][_0xafb8('0x4b')](_0x59d6a3)){var _0x533e5a=_0x3010c5[_0xafb8('0x5a')][_0x59d6a3];var _0x509f4e={'id':_0x533e5a['id'],'available':_0x533e5a[_0xafb8('0x51')],'loggedIn':_0x533e5a[_0xafb8('0x52')],'name':_0x533e5a[_0xafb8('0x53')],'paused':_0x533e5a[_0xafb8('0x55')],'waiting':_0x533e5a[_0xafb8('0x56')]};_0x4e813b[_0xafb8('0x22')](_0x509f4e);}}_0x6bf82f({'count':_0x4e813b[_0xafb8('0x1b')],'rows':_0x4e813b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x882f01){var _0x3e3144=_[_0xafb8('0x5b')](_0x3010c5[_0xafb8('0x5c')]);_0x882f01({'count':_0x3e3144[_0xafb8('0x1b')],'rows':_0x3e3144});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x971cb8){var _0x579112=_[_0xafb8('0x5b')](_0x3010c5[_0xafb8('0x5d')]);_0x971cb8({'count':_0x579112[_0xafb8('0x1b')],'rows':_0x579112});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x300efa){var _0x20c479=_[_0xafb8('0x5b')](_0x3010c5[_0xafb8('0x5e')]);_0x300efa({'count':_0x20c479[_0xafb8('0x1b')],'rows':_0x20c479});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3744e1){var _0x11c42e=_[_0xafb8('0x5b')](_0x3010c5[_0xafb8('0x5f')]);_0x3744e1({'count':_0x11c42e[_0xafb8('0x1b')],'rows':_0x11c42e});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x28c359){var _0x18d449=_[_0xafb8('0x5b')](_0x3010c5[_0xafb8('0x60')]);_0x28c359({'count':_0x18d449[_0xafb8('0x1b')],'rows':_0x18d449});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2a1694){var _0x2b146b=_[_0xafb8('0x5b')](_0x3010c5['whatsappQueuesWaitingInteractions']);_0x2a1694({'count':_0x2b146b[_0xafb8('0x1b')],'rows':_0x2b146b});});}};var _0x4dba3b=jayson[_0xafb8('0x61')](_0x2fe3b5)[_0xafb8('0x62')]();_0x4dba3b['on']('error',function(_0x5c049e){logger[_0xafb8('0x36')](JSON[_0xafb8('0x3b')](_0x5c049e));return _0x4579f2(_0x5c049e);});_0x4dba3b[_0xafb8('0x63')](0x232c,_0xafb8('0x64'),function(){console[_0xafb8('0x65')](_0xafb8('0x66'),0x232c);return _0x20efb8(_0xafb8('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7a44a31..d5cc021 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 _0x2b88=['../../../config/logger','routing','condition','rules','info','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','\x20|\x20','lodash','../../../utils/iftime'];(function(_0x58473a,_0x207a8b){var _0x3f0ebc=function(_0x26c308){while(--_0x26c308){_0x58473a['push'](_0x58473a['shift']());}};_0x3f0ebc(++_0x207a8b);}(_0x2b88,0x1ed));var _0x82b8=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0x2b88[_0x13fcaf];return _0x4fa631;};'use strict';var _=require(_0x82b8('0x0'));var iftime=require(_0x82b8('0x1'))['iftime'];var logger=require(_0x82b8('0x2'))(_0x82b8('0x3'));exports[_0x82b8('0x4')]=function(_0xfb3b8f,_0x370f0a,_0x330f48){return function(_0x27a0b5){if(_0x330f48['rules']&&!_0x330f48[_0x82b8('0x5')][_0xfb3b8f]){logger[_0x82b8('0x6')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xfb3b8f);return _0x27a0b5[_0x82b8('0x7')]();}var _0x34f76c=_0x370f0a[_0x82b8('0x8')](function(_0x1b79c3){return iftime(_0x1b79c3);});var _0x3a96d1=_[_0x82b8('0x9')](_0x34f76c);if(_0x3a96d1){logger[_0x82b8('0x6')](_0x82b8('0xa'),_0xfb3b8f,_0x370f0a[_0x82b8('0xb')]('\x20|\x20'),_0x3a96d1);_0x27a0b5[_0x82b8('0xc')](_0x3a96d1);}else{logger[_0x82b8('0x6')](_0x82b8('0xd'),_0xfb3b8f,_0x370f0a[_0x82b8('0xb')](_0x82b8('0xe')));_0x27a0b5[_0x82b8('0x7')]();}};}; \ No newline at end of file +var _0xdec1=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing'];(function(_0x1f6958,_0x584893){var _0x1342ab=function(_0x4c17f9){while(--_0x4c17f9){_0x1f6958['push'](_0x1f6958['shift']());}};_0x1342ab(++_0x584893);}(_0xdec1,0x17b));var _0x1dec=function(_0x2f9661,_0x595a0b){_0x2f9661=_0x2f9661-0x0;var _0x9324de=_0xdec1[_0x2f9661];return _0x9324de;};'use strict';var _=require(_0x1dec('0x0'));var iftime=require(_0x1dec('0x1'))[_0x1dec('0x2')];var logger=require(_0x1dec('0x3'))(_0x1dec('0x4'));exports[_0x1dec('0x5')]=function(_0x1c9397,_0x1589d1,_0x147f23){return function(_0x5bd322){if(_0x147f23[_0x1dec('0x6')]&&!_0x147f23['rules'][_0x1c9397]){logger[_0x1dec('0x7')](_0x1dec('0x8'),_0x1c9397);return _0x5bd322[_0x1dec('0x9')]();}var _0x5c0c86=_0x1589d1[_0x1dec('0xa')](function(_0xef1c4b){return iftime(_0xef1c4b);});var _0x4f01f6=_[_0x1dec('0xb')](_0x5c0c86);if(_0x4f01f6){logger[_0x1dec('0x7')](_0x1dec('0xc'),_0x1c9397,_0x1589d1['join'](_0x1dec('0xd')),_0x4f01f6);_0x5bd322[_0x1dec('0xe')](_0x4f01f6);}else{logger['info'](_0x1dec('0xf'),_0x1c9397,_0x1589d1['join']('\x20|\x20'));_0x5bd322[_0x1dec('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 97d05da..4cb7229 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 _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xf45e,0x115));var _0xef45=function(_0x302a9e,_0x5df184){_0x302a9e=_0x302a9e-0x0;var _0x40a690=_0xf45e[_0x302a9e];return _0x40a690;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file +var _0xbc9d=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','lodash','util','./utils','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','talktime','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected'];(function(_0x59fdc6,_0x206a97){var _0x2517b1=function(_0x1d50de){while(--_0x1d50de){_0x59fdc6['push'](_0x59fdc6['shift']());}};_0x2517b1(++_0x206a97);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x59536b,_0x2630de){_0x59536b=_0x59536b-0x0;var _0x300afa=_0xbc9d[_0x59536b];return _0x300afa;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var utils=require(_0xdbc9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x434f6e,_0x35f89c){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x434f6e[_0xdbc9('0x3')],_0x434f6e[_0xdbc9('0x4')],_0x434f6e[_0xdbc9('0x5')],_0x434f6e[_0xdbc9('0x6')],_0x434f6e[_0xdbc9('0x7')],_0x434f6e[_0xdbc9('0x8')],_0x434f6e[_0xdbc9('0x9')],_0x434f6e['lastevent']));if(_0x434f6e[_0xdbc9('0x5')]){utils[_0xdbc9('0xa')](_0x434f6e[_0xdbc9('0x5')])['then'](function(_0x2c7ba5){if(_0x2c7ba5){_0x434f6e['type']=_0x2c7ba5['type'];_0x434f6e[_0xdbc9('0xb')]=_0x434f6e[_0xdbc9('0xc')]?_0x2c7ba5[_0xdbc9('0xd')]:![];_0x434f6e[_0xdbc9('0xe')]=_0x434f6e['agentacw']?_0x2c7ba5[_0xdbc9('0xf')]:0x0;}utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);});}else{utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);}if(_0x35f89c){delete transfers[_0x434f6e[_0xdbc9('0x3')]];}else{delete agents[_0x434f6e['destuniqueid']];}}exports['agentcalled']=function(_0x3d0fdd){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x3d0fdd);agents[_0x3d0fdd['destuniqueid']]=_0x3d0fdd;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x16')]=utils[_0xdbc9('0x17')]();agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x19');agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x9')]=null;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=null;utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x1c'),_0x3d0fdd[_0xdbc9('0x3')],agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x3d0fdd[_0xdbc9('0x15')]));}catch(_0x57a546){utils[_0xdbc9('0x1d')](util['format'](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x57a546);}};exports['agentringnoanswer']=function(_0x4408e9){try{if(!_['isNil'](agents[_0x4408e9['destuniqueid']])){utils['debug'](util['format'](_0xdbc9('0x1e'),_0x4408e9[_0xdbc9('0x3')]),_0x4408e9);utils['info'](util[_0xdbc9('0x13')](_0xdbc9('0x1f'),_0x4408e9['uniqueid'],agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x4408e9[_0xdbc9('0x15')]));agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x20')]=!![];agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();agents[_0x4408e9[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]]['holdtime']=_0x4408e9[_0xdbc9('0x24')]?parseInt(_0x4408e9[_0xdbc9('0x24')])/0x3e8:0x0;agents[_0x4408e9['destuniqueid']]['talktime']=0x0;unanswered[_0xdbc9('0x25')](_0x4408e9[_0xdbc9('0x15')]);}}catch(_0x473430){utils['error'](util[_0xdbc9('0x13')]('[%s][agents][agentringnoanswer]',_0x4408e9['uniqueid']),_0x473430);}};exports[_0xdbc9('0x26')]=function(_0x49da36){try{_['forIn'](agents,function(_0x417b17,_0x20eb4f){if(_0x417b17[_0xdbc9('0x3')]==_0x49da36['uniqueid']&&!_[_0xdbc9('0x27')](unanswered,_0x417b17[_0xdbc9('0x15')])){utils['debug'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x49da36);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x29'),_0x49da36[_0xdbc9('0x3')],_0x417b17[_0xdbc9('0x6')],_0x417b17['destuniqueid']));_0x417b17[_0xdbc9('0x20')]=!![];_0x417b17[_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();_0x417b17[_0xdbc9('0x18')]=_0xdbc9('0x2a');_0x417b17[_0xdbc9('0x23')]='abandoned';_0x417b17[_0xdbc9('0x2b')]=_0x49da36['holdtime'];_0x417b17['talktime']=0x0;writeDB(_0x417b17);}});}catch(_0x495c0e){utils['error'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x495c0e);}};exports[_0xdbc9('0x2c')]=function(_0x5527fc){try{if(agents[_0x5527fc[_0xdbc9('0x15')]]){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc[_0xdbc9('0x3')]),_0x5527fc);utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x2e'),_0x5527fc[_0xdbc9('0x3')],agents[_0x5527fc[_0xdbc9('0x15')]]['membername'],_0x5527fc[_0xdbc9('0x15')]));agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();agents[_0x5527fc['destuniqueid']]['connectedlinenum']=_0x5527fc[_0xdbc9('0x9')];agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=_0x5527fc[_0xdbc9('0x1a')];agents[_0x5527fc['destuniqueid']][_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];agents[_0x5527fc[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x30');_[_0xdbc9('0x31')](agents,function(_0x444219,_0x523c79){if(_0x444219[_0xdbc9('0x15')]!=_0x5527fc[_0xdbc9('0x15')]&&_0x444219['uniqueid']==_0x5527fc['uniqueid']){_0x444219[_0xdbc9('0x32')]=0x0;_0x444219[_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];_0x444219[_0xdbc9('0x20')]=!![];_0x444219['agentringnoanswerAt']=utils[_0xdbc9('0x17')]();_0x444219[_0xdbc9('0x18')]='answered_elsewhere';_0x444219[_0xdbc9('0x23')]=_0xdbc9('0x33');_0x444219['answeredelsewheredestinationuniqueid']=_0x5527fc[_0xdbc9('0x15')];_0x444219[_0xdbc9('0x34')]=_0x5527fc[_0xdbc9('0x6')];writeDB(_0x444219);}});}}catch(_0x3415c3){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc['uniqueid']),_0x3415c3);}};exports['agentcomplete']=function(_0x768856){try{if(!_[_0xdbc9('0x35')](agents[_0x768856[_0xdbc9('0x15')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x36'),_0x768856[_0xdbc9('0x3')]),_0x768856);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x37'),_0x768856[_0xdbc9('0x3')],agents[_0x768856['destuniqueid']]['membername'],_0x768856[_0xdbc9('0x15')]));agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0xc')]=!![];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x32')]=utils['diffTime'](agents[_0x768856['destuniqueid']][_0xdbc9('0x38')],agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x2f')]);agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0x768856[_0xdbc9('0x23')];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x18')]=_0xdbc9('0x39');writeDB(agents[_0x768856['destuniqueid']]);}}catch(_0x2c24a9){utils[_0xdbc9('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x768856[_0xdbc9('0x3')]),_0x2c24a9);}};exports[_0xdbc9('0x3a')]=function(_0x133a13){try{if(!_['isNil'](agents[_0x133a13[_0xdbc9('0x3b')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13['uniqueid']),_0x133a13);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x3d'),_0x133a13[_0xdbc9('0x3')],agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x6')],agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3')]));agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3e')]=!![];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3f')]=_0xdbc9('0x40');agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x41')]=_0x133a13['extension'];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x42')]=agents[_0x133a13['transfereruniqueid']]['uniqueid'];}}catch(_0xc7335d){utils['error'](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13[_0xdbc9('0x3')]),_0xc7335d);}};exports['attendedtransfer']=function(_0x32b38d){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x32b38d);if(_0x32b38d[_0xdbc9('0x44')]==_0x32b38d[_0xdbc9('0x45')]){if(!_[_0xdbc9('0x35')](agents[_0x32b38d['secondtransfereruniqueid']])){utils['info'](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d[_0xdbc9('0x47')]]['membername']));agents[_0x32b38d['secondtransfereruniqueid']][_0xdbc9('0x3e')]=!![];agents[_0x32b38d[_0xdbc9('0x47')]]['transfertype']='ATTENDED';agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x48')];agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x44')];}if(_0x32b38d['transfereeuniqueid']&&agents[_0x32b38d[_0xdbc9('0x49')]]){agents[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d['transfereeuniqueid']]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x49')]]);transfers[_0x32b38d[_0xdbc9('0x49')]]['calleridnum']=agents[_0x32b38d[_0xdbc9('0x47')]]['calleridnum'];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4c')]=agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x16')]=utils['now']();transfers[_0x32b38d[_0xdbc9('0x49')]]['agentconnectAt']=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x49')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x2;}}else if(_0x32b38d['secondtransfereruniqueid']==_0x32b38d['secondtransfererlinkedid']){if(!_[_0xdbc9('0x35')](agents[_0x32b38d[_0xdbc9('0x44')]])){utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x6')]));agents[_0x32b38d[_0xdbc9('0x44')]]['transfer']=!![];agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x3f')]=_0xdbc9('0x4d');agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x4e')];agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x47')];}if(_0x32b38d['transfertargetuniqueid']&&agents[_0x32b38d[_0xdbc9('0x4f')]]){agents[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d[_0xdbc9('0x4f')]]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x4f')]]);transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x8')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x8')];transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x4c')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x4f')]]['agentcalledAt']=utils['now']();transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x4f')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x2;}}}catch(_0x53843c){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x53843c);}};exports[_0xdbc9('0x50')]=function(_0xfdfb20){try{utils['debug'](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20['uniqueid']),_0xfdfb20);if(agents[_0xfdfb20['uniqueid']]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]===_0xdbc9('0x22')){if(_0xfdfb20[_0xdbc9('0x52')]==='21'){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]=_0xdbc9('0x53');agents[_0xfdfb20['uniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x53');}utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x54'),_0xfdfb20[_0xdbc9('0x3')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);var _0x1afbcd=unanswered[_0xdbc9('0x55')](_0xfdfb20[_0xdbc9('0x3')]);if(_0x1afbcd>-0x1){unanswered['splice'](_0x1afbcd,0x1);}}if(transfers[_0xfdfb20['uniqueid']]){transfers[_0xfdfb20[_0xdbc9('0x3')]]['agentcomplete']=!![];transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();transfers[_0xfdfb20[_0xdbc9('0x3')]]['talktime']=utils[_0xdbc9('0x56')](transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')],transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x2f')]);transfers[_0xfdfb20[_0xdbc9('0x3')]]['reason']=_0xdbc9('0x57');transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20[_0xdbc9('0x3')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['membername'],transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['lastevent']));writeDB(transfers[_0xfdfb20[_0xdbc9('0x3')]],!![]);}if(agents[_0xfdfb20[_0xdbc9('0x3')]]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x2f')]){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0xc')]=!![];agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')]=utils['now']();agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x32')]=utils[_0xdbc9('0x56')](agents[_0xfdfb20[_0xdbc9('0x3')]]['agentcompleteAt'],agents[_0xfdfb20[_0xdbc9('0x3')]]['agentconnectAt']);agents[_0xfdfb20['uniqueid']][_0xdbc9('0x23')]=agents[_0xfdfb20[_0xdbc9('0x3')]]['transfer']?_0xdbc9('0x3e'):_0xdbc9('0x57');agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20['uniqueid'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]]['reason'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);}}catch(_0x1839e4){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20[_0xdbc9('0x3')]),_0x1839e4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5f9d010..26b6862 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 _0x7d29=['[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','source','value','variable','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','set','toLowerCase','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','NO\x20ANSWER','FAILED','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','UserId','request','uniqueid','debug','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel'];(function(_0x5abdec,_0x4c8d8b){var _0xe86d72=function(_0x4f5030){while(--_0x4f5030){_0x5abdec['push'](_0x5abdec['shift']());}};_0xe86d72(++_0x4c8d8b);}(_0x7d29,0xf8));var _0x97d2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7d29[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x97d2('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x97d2('0x1'),_0x97d2('0x2'),_0x97d2('0x2'),_0x97d2('0x1'),_0x97d2('0x1'),_0x97d2('0x1'),'ANSWERED','BUSY',_0x97d2('0x2'),_0x97d2('0x2'),_0x97d2('0x2')];var channels={};function writeDB(_0x1b3e5d){utils[_0x97d2('0x3')](util['format'](_0x97d2('0x4'),_0x1b3e5d['uniqueid'],_0x1b3e5d['channel'],_0x1b3e5d['queue'],_0x1b3e5d['membername'],_0x1b3e5d[_0x97d2('0x5')],_0x1b3e5d[_0x97d2('0x6')],_0x1b3e5d[_0x97d2('0x7')],_0x1b3e5d['lastevent']));if(_0x1b3e5d[_0x97d2('0x8')]){utils[_0x97d2('0x9')](_0x1b3e5d[_0x97d2('0x8')])['then'](function(_0x3bdaae){if(_0x3bdaae){_0x1b3e5d[_0x97d2('0xa')]=_0x3bdaae['id'];}utils[_0x97d2('0xb')]('CreateVoiceCallReport',_0x1b3e5d);});}else{utils[_0x97d2('0xb')]('CreateVoiceCallReport',_0x1b3e5d);}if(channels[_0x1b3e5d[_0x97d2('0xc')]]){delete channels[_0x1b3e5d[_0x97d2('0xc')]];}}exports['newchannel']=function(_0x1763d6){try{utils[_0x97d2('0xd')](util[_0x97d2('0xe')](_0x97d2('0xf'),_0x1763d6['uniqueid']),_0x1763d6);if(_0x1763d6[_0x97d2('0xc')]==_0x1763d6[_0x97d2('0x10')]&&_0x1763d6[_0x97d2('0x11')]!=_0x97d2('0x12')){utils[_0x97d2('0x3')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1763d6[_0x97d2('0xc')],_0x1763d6[_0x97d2('0x13')],_0x1763d6[_0x97d2('0x14')]));channels[_0x1763d6[_0x97d2('0xc')]]={'uniqueid':_0x1763d6[_0x97d2('0xc')],'accountcode':_0x1763d6[_0x97d2('0x8')],'source':_0x1763d6[_0x97d2('0x6')],'destination':_0x1763d6[_0x97d2('0x14')],'destinationcontext':_0x1763d6[_0x97d2('0x13')],'channel':_0x1763d6[_0x97d2('0x11')],'starttime':utils[_0x97d2('0x15')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x97d2('0x1'),'amaflags':_0x97d2('0x16')};}}catch(_0x2e934d){utils[_0x97d2('0x17')](util['format'](_0x97d2('0xf'),_0x1763d6[_0x97d2('0xc')]),_0x2e934d);}};exports[_0x97d2('0x18')]=function(_0x6678b5){try{utils['debug'](util[_0x97d2('0xe')](_0x97d2('0x19'),_0x6678b5['uniqueid']),_0x6678b5);if(!_[_0x97d2('0x1a')](channels[_0x6678b5[_0x97d2('0xc')]])&&_0x6678b5[_0x97d2('0x1b')]==0x6){utils['info'](util[_0x97d2('0xe')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x6678b5['uniqueid'],_0x6678b5['context'],_0x6678b5['channel']));if(_[_0x97d2('0x1a')](channels[_0x6678b5['uniqueid']]['systemanswertime'])){channels[_0x6678b5['uniqueid']][_0x97d2('0x1c')]=utils[_0x97d2('0x15')]();}}else if(!_[_0x97d2('0x1a')](channels[_0x6678b5[_0x97d2('0x10')]])&&_0x6678b5['channelstate']==0x6&&_0x6678b5[_0x97d2('0x13')]!=_0x97d2('0x1d')){utils[_0x97d2('0x3')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x6678b5[_0x97d2('0xc')],_0x6678b5[_0x97d2('0x10')],_0x6678b5[_0x97d2('0x13')],_0x6678b5[_0x97d2('0x11')]));channels[_0x6678b5[_0x97d2('0x10')]]['accountcode']=_0x6678b5['accountcode'];channels[_0x6678b5[_0x97d2('0x10')]][_0x97d2('0x1e')]=_0x6678b5['channel'];if(_[_0x97d2('0x1a')](channels[_0x6678b5[_0x97d2('0x10')]][_0x97d2('0x1f')])){channels[_0x6678b5['linkedid']]['answertime']=utils[_0x97d2('0x15')]();}channels[_0x6678b5['linkedid']][_0x97d2('0x20')]=dispositions[_[_0x97d2('0x21')](_0x6678b5[_0x97d2('0x1b')])]||_0x97d2('0x22');}}catch(_0x1a4c94){utils['error'](util['format'](_0x97d2('0x19'),_0x6678b5[_0x97d2('0xc')]),_0x1a4c94);}};exports[_0x97d2('0x23')]=function(_0x270e8d){try{if(!_[_0x97d2('0x1a')](channels[_0x270e8d[_0x97d2('0xc')]])){utils[_0x97d2('0xd')](util[_0x97d2('0xe')](_0x97d2('0x24'),_0x270e8d['uniqueid']),_0x270e8d);if(_['isNil'](channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x25')])){channels[_0x270e8d[_0x97d2('0xc')]]['callerid']=_0x270e8d[_0x97d2('0x26')]+'\x20<'+_0x270e8d[_0x97d2('0x6')]+'>';}utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x27'),_0x270e8d[_0x97d2('0xc')],channels[_0x270e8d['uniqueid']]['callerid'],_0x270e8d[_0x97d2('0x28')]));channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x29')]=utils[_0x97d2('0x15')]();channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x2a')]=utils[_0x97d2('0x2b')](channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x29')],channels[_0x270e8d['uniqueid']]['starttime']);channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x2c')]=channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x1f')]?utils[_0x97d2('0x2b')](channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x29')],channels[_0x270e8d[_0x97d2('0xc')]][_0x97d2('0x1f')]):0x0;writeDB(channels[_0x270e8d[_0x97d2('0xc')]]);}}catch(_0x11f5a4){utils['error'](util[_0x97d2('0xe')](_0x97d2('0x24'),_0x270e8d[_0x97d2('0xc')]),_0x11f5a4);}};exports[_0x97d2('0x2d')]=function(_0x159ac8){try{if(!_[_0x97d2('0x1a')](channels[_0x159ac8[_0x97d2('0x2e')]])){utils[_0x97d2('0xd')](util[_0x97d2('0xe')](_0x97d2('0x2f'),_0x159ac8['origtransfereruniqueid']),_0x159ac8);if(channels[_0x159ac8[_0x97d2('0x2e')]][_0x97d2('0x11')]==_0x159ac8[_0x97d2('0x30')]){utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x31'),_0x159ac8[_0x97d2('0x32')],_0x159ac8['localtwolinkedid'],_0x159ac8[_0x97d2('0x33')]));channels[_0x159ac8[_0x97d2('0x2e')]][_0x97d2('0x1e')]=_0x159ac8[_0x97d2('0x33')];channels[_0x159ac8['localtwolinkedid']][_0x97d2('0x34')]=_0x97d2('0x35');}else if(channels[_0x159ac8[_0x97d2('0x2e')]][_0x97d2('0x11')]=_0x159ac8[_0x97d2('0x36')]){utils[_0x97d2('0x3')](util['format'](_0x97d2('0x31'),_0x159ac8[_0x97d2('0x32')],_0x159ac8[_0x97d2('0x2e')],_0x159ac8[_0x97d2('0x37')]));channels[_0x159ac8[_0x97d2('0x2e')]][_0x97d2('0x1e')]=_0x159ac8['origtransfererchannel'];channels[_0x159ac8['localtwolinkedid']][_0x97d2('0x34')]=_0x97d2('0x35');}}}catch(_0x352446){utils[_0x97d2('0x17')](util['format']('[%s][calls][attendedtransfer]',_0x159ac8[_0x97d2('0x32')]),_0x352446);}};exports[_0x97d2('0x38')]=function(_0x4f1c56){try{if(!_['isNil'](channels[_0x4f1c56[_0x97d2('0xc')]])){utils[_0x97d2('0xd')](util['format'](_0x97d2('0x39'),_0x4f1c56['uniqueid']),_0x4f1c56);channels[_0x4f1c56[_0x97d2('0xc')]][_0x97d2('0x3a')]=utils[_0x97d2('0x15')]();utils[_0x97d2('0x3')](util['format'](_0x97d2('0x3b'),_0x4f1c56['uniqueid'],channels[_0x4f1c56[_0x97d2('0xc')]][_0x97d2('0x3a')]));}}catch(_0x4ec39c){utils['error'](util[_0x97d2('0xe')]('[%s][calls][musiconholdstart]',_0x4f1c56['uniqueid']),_0x4ec39c);}};exports[_0x97d2('0x3c')]=function(_0x2630f7){try{if(!_[_0x97d2('0x1a')](channels[_0x2630f7[_0x97d2('0xc')]])){utils[_0x97d2('0xd')](util[_0x97d2('0xe')](_0x97d2('0x3d'),_0x2630f7['uniqueid']),_0x2630f7);if(!_['isNil'](channels[_0x2630f7[_0x97d2('0xc')]][_0x97d2('0x3a')])){channels[_0x2630f7[_0x97d2('0xc')]]['mohtime']+=utils[_0x97d2('0x2b')](utils[_0x97d2('0x15')](),channels[_0x2630f7[_0x97d2('0xc')]][_0x97d2('0x3a')]);utils['info'](util[_0x97d2('0xe')](_0x97d2('0x3e'),_0x2630f7['uniqueid'],channels[_0x2630f7[_0x97d2('0xc')]]['mohtime']));delete channels[_0x2630f7[_0x97d2('0xc')]][_0x97d2('0x3a')];}}}catch(_0x4e4b52){utils[_0x97d2('0x17')](util[_0x97d2('0xe')](_0x97d2('0x3d'),_0x2630f7['uniqueid']),_0x4e4b52);}};exports[_0x97d2('0x3f')]=function(_0x3759b3){try{if(!_[_0x97d2('0x1a')](channels[_0x3759b3[_0x97d2('0xc')]])){utils[_0x97d2('0xd')](util['format']('[%s][calls][varset]',_0x3759b3[_0x97d2('0xc')]),_0x3759b3);if(!_[_0x97d2('0x1a')](_0x3759b3['variable']['xmd-originatecalleridnum'])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3759b3[_0x97d2('0xc')],_0x3759b3['value']));channels[_0x3759b3['uniqueid']][_0x97d2('0x40')]=_0x3759b3[_0x97d2('0x41')];}if(!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x43')])){utils['info'](util[_0x97d2('0xe')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x3759b3[_0x97d2('0xc')],_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]]['destination']=_0x3759b3[_0x97d2('0x41')];channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x25')]='\x22'+_0x3759b3['value']+_0x97d2('0x44')+_0x3759b3['value']+'>';}if(!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x45')])||!_['isNil'](_0x3759b3['variable'][_0x97d2('0x46')])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x47'),_0x3759b3[_0x97d2('0xc')],!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x45')])?_0x97d2('0x45'):'xmd-callerid',_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x25')]=_0x3759b3[_0x97d2('0x41')];}if(!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x48')])||!_['isNil'](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x49')])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x47'),_0x3759b3[_0x97d2('0xc')],!_['isNil'](_0x3759b3['variable'][_0x97d2('0x48')])?_0x97d2('0x48'):'xmcs-queue',_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x4a')]='Queue';channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x4b')]=_0x3759b3[_0x97d2('0x41')];channels[_0x3759b3[_0x97d2('0xc')]]['queue']=!![];}if(!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x4c')])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x4d'),_0x3759b3['uniqueid'],_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x4e')]=_0x3759b3['value'];}if(!_[_0x97d2('0x1a')](_0x3759b3[_0x97d2('0x42')][_0x97d2('0x4f')])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3759b3[_0x97d2('0xc')],_0x3759b3['value']));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x50')]=_0x3759b3[_0x97d2('0x41')];}if(!_[_0x97d2('0x1a')](_0x3759b3['variable']['outboundrouteid'])){utils[_0x97d2('0x3')](util['format'](_0x97d2('0x51'),_0x3759b3[_0x97d2('0xc')],_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x52')]=_0x3759b3[_0x97d2('0x41')];}if(!_[_0x97d2('0x1a')](_0x3759b3['variable']['sipcallid'])){utils[_0x97d2('0x3')](util[_0x97d2('0xe')](_0x97d2('0x53'),_0x3759b3[_0x97d2('0xc')],_0x3759b3[_0x97d2('0x41')]));channels[_0x3759b3[_0x97d2('0xc')]][_0x97d2('0x54')]=_0x3759b3['value'];}}}catch(_0x4e783e){utils['error'](util['format'](_0x97d2('0x55'),_0x3759b3[_0x97d2('0xc')]),_0x4e783e);}};exports[_0x97d2('0x56')]=function(_0x29bd24){try{if(!_[_0x97d2('0x1a')](channels[_0x29bd24[_0x97d2('0xc')]])){utils[_0x97d2('0xd')](util[_0x97d2('0xe')](_0x97d2('0x57'),_0x29bd24[_0x97d2('0xc')]),_0x29bd24);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x29bd24[_0x97d2('0xc')],_0x29bd24[_0x97d2('0x58')],_0x29bd24[_0x97d2('0x59')]));if(_0x29bd24[_0x97d2('0x58')]['toLowerCase']()==_0x97d2('0x5a')&&_['startsWith'](_0x29bd24[_0x97d2('0x59')][_0x97d2('0x5b')](),'cdr')){var _0x5ac676=_0x29bd24['appdata'][_0x97d2('0x5c')]('=');var _0x370480=_0x5ac676[0x0][_0x97d2('0x5d')](_0x5ac676[0x0][_0x97d2('0x5e')]('(')+0x1,_0x5ac676[0x0]['lastIndexOf'](')'));var _0x678832=_0x5ac676[0x1];channels[_0x29bd24[_0x97d2('0xc')]][_0x370480]=_0x678832;}if(!_[_0x97d2('0x5f')]([_0x97d2('0x23'),_0x97d2('0x60'),_0x97d2('0x61'),'set',_0x97d2('0x62')],_0x29bd24[_0x97d2('0x58')][_0x97d2('0x5b')]())){channels[_0x29bd24['uniqueid']][_0x97d2('0x4a')]=_0x29bd24[_0x97d2('0x58')];channels[_0x29bd24['uniqueid']][_0x97d2('0x4b')]=_0x29bd24[_0x97d2('0x59')];}}}catch(_0x3861e1){utils[_0x97d2('0x17')](util[_0x97d2('0xe')](_0x97d2('0x57'),_0x29bd24[_0x97d2('0xc')]),_0x3861e1);}}; \ No newline at end of file +var _0xf27a=['xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','channel','queue','membername','interface','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','uniqueid','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','error','newstate','debug','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','lastdata'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0xf27a,0xea));var _0xaf27=function(_0x19965d,_0x157a68){_0x19965d=_0x19965d-0x0;var _0x1656d1=_0xf27a[_0x19965d];return _0x1656d1;};'use strict';var _=require(_0xaf27('0x0'));var util=require('util');var utils=require(_0xaf27('0x1'));var dispositions=[_0xaf27('0x2'),_0xaf27('0x3'),_0xaf27('0x3'),_0xaf27('0x2'),_0xaf27('0x2'),'NO\x20ANSWER',_0xaf27('0x4'),'BUSY',_0xaf27('0x3'),_0xaf27('0x3'),_0xaf27('0x3')];var channels={};function writeDB(_0x3b2871){utils[_0xaf27('0x5')](util[_0xaf27('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3b2871['uniqueid'],_0x3b2871[_0xaf27('0x7')],_0x3b2871[_0xaf27('0x8')],_0x3b2871[_0xaf27('0x9')],_0x3b2871[_0xaf27('0xa')],_0x3b2871['calleridnum'],_0x3b2871[_0xaf27('0xb')],_0x3b2871['lastevent']));if(_0x3b2871['accountcode']){utils['getUserByInternal'](_0x3b2871[_0xaf27('0xc')])[_0xaf27('0xd')](function(_0x17d46f){if(_0x17d46f){_0x3b2871[_0xaf27('0xe')]=_0x17d46f['id'];}utils[_0xaf27('0xf')]('CreateVoiceCallReport',_0x3b2871);});}else{utils[_0xaf27('0xf')](_0xaf27('0x10'),_0x3b2871);}if(channels[_0x3b2871[_0xaf27('0x11')]]){delete channels[_0x3b2871[_0xaf27('0x11')]];}}exports['newchannel']=function(_0x24075d){try{utils['debug'](util[_0xaf27('0x6')](_0xaf27('0x12'),_0x24075d[_0xaf27('0x11')]),_0x24075d);if(_0x24075d['uniqueid']==_0x24075d[_0xaf27('0x13')]&&_0x24075d[_0xaf27('0x7')]!=_0xaf27('0x14')){utils['info'](util[_0xaf27('0x6')](_0xaf27('0x15'),_0x24075d['uniqueid'],_0x24075d[_0xaf27('0x16')],_0x24075d[_0xaf27('0x17')]));channels[_0x24075d[_0xaf27('0x11')]]={'uniqueid':_0x24075d[_0xaf27('0x11')],'accountcode':_0x24075d[_0xaf27('0xc')],'source':_0x24075d[_0xaf27('0x18')],'destination':_0x24075d[_0xaf27('0x17')],'destinationcontext':_0x24075d[_0xaf27('0x16')],'channel':_0x24075d[_0xaf27('0x7')],'starttime':utils[_0xaf27('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x126664){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x12'),_0x24075d['uniqueid']),_0x126664);}};exports[_0xaf27('0x1b')]=function(_0x47b26f){try{utils[_0xaf27('0x1c')](util[_0xaf27('0x6')]('[%s][calls][newstate]',_0x47b26f[_0xaf27('0x11')]),_0x47b26f);if(!_[_0xaf27('0x1d')](channels[_0x47b26f[_0xaf27('0x11')]])&&_0x47b26f[_0xaf27('0x1e')]==0x6){utils[_0xaf27('0x5')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x47b26f['uniqueid'],_0x47b26f['context'],_0x47b26f[_0xaf27('0x7')]));if(_[_0xaf27('0x1d')](channels[_0x47b26f['uniqueid']][_0xaf27('0x1f')])){channels[_0x47b26f[_0xaf27('0x11')]][_0xaf27('0x1f')]=utils[_0xaf27('0x19')]();}}else if(!_['isNil'](channels[_0x47b26f[_0xaf27('0x13')]])&&_0x47b26f['channelstate']==0x6&&_0x47b26f[_0xaf27('0x16')]!=_0xaf27('0x20')){utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x21'),_0x47b26f[_0xaf27('0x11')],_0x47b26f['linkedid'],_0x47b26f[_0xaf27('0x16')],_0x47b26f['channel']));channels[_0x47b26f[_0xaf27('0x13')]][_0xaf27('0xc')]=_0x47b26f[_0xaf27('0xc')];channels[_0x47b26f[_0xaf27('0x13')]][_0xaf27('0x22')]=_0x47b26f['channel'];if(_['isNil'](channels[_0x47b26f[_0xaf27('0x13')]][_0xaf27('0x23')])){channels[_0x47b26f[_0xaf27('0x13')]][_0xaf27('0x23')]=utils['now']();}channels[_0x47b26f[_0xaf27('0x13')]]['disposition']=dispositions[_[_0xaf27('0x24')](_0x47b26f[_0xaf27('0x1e')])]||_0xaf27('0x4');}}catch(_0x7cc4cc){utils['error'](util[_0xaf27('0x6')](_0xaf27('0x25'),_0x47b26f[_0xaf27('0x11')]),_0x7cc4cc);}};exports[_0xaf27('0x26')]=function(_0x332bcc){try{if(!_[_0xaf27('0x1d')](channels[_0x332bcc[_0xaf27('0x11')]])){utils[_0xaf27('0x1c')](util[_0xaf27('0x6')](_0xaf27('0x27'),_0x332bcc[_0xaf27('0x11')]),_0x332bcc);if(_['isNil'](channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x28')])){channels[_0x332bcc[_0xaf27('0x11')]]['callerid']=_0x332bcc[_0xaf27('0x29')]+'\x20<'+_0x332bcc[_0xaf27('0x18')]+'>';}utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x2a'),_0x332bcc['uniqueid'],channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x28')],_0x332bcc['cause-txt']));channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x2b')]=utils['now']();channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x2c')]=utils[_0xaf27('0x2d')](channels[_0x332bcc['uniqueid']][_0xaf27('0x2b')],channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x2e')]);channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x2f')]=channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x23')]?utils[_0xaf27('0x2d')](channels[_0x332bcc[_0xaf27('0x11')]]['endtime'],channels[_0x332bcc[_0xaf27('0x11')]][_0xaf27('0x23')]):0x0;writeDB(channels[_0x332bcc[_0xaf27('0x11')]]);}}catch(_0x1d4493){utils[_0xaf27('0x1a')](util['format'](_0xaf27('0x27'),_0x332bcc[_0xaf27('0x11')]),_0x1d4493);}};exports[_0xaf27('0x30')]=function(_0x4584b0){try{if(!_['isNil'](channels[_0x4584b0[_0xaf27('0x31')]])){utils[_0xaf27('0x1c')](util[_0xaf27('0x6')]('[%s][calls][attendedtransfer]',_0x4584b0['origtransfereruniqueid']),_0x4584b0);if(channels[_0x4584b0['localtwolinkedid']]['channel']==_0x4584b0['transfereechannel']){utils[_0xaf27('0x5')](util['format'](_0xaf27('0x32'),_0x4584b0['origtransfereruniqueid'],_0x4584b0[_0xaf27('0x31')],_0x4584b0[_0xaf27('0x33')]));channels[_0x4584b0[_0xaf27('0x31')]][_0xaf27('0x22')]=_0x4584b0[_0xaf27('0x33')];channels[_0x4584b0['localtwolinkedid']][_0xaf27('0x34')]=_0xaf27('0x35');}else if(channels[_0x4584b0['localtwolinkedid']][_0xaf27('0x7')]=_0x4584b0[_0xaf27('0x36')]){utils[_0xaf27('0x5')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4584b0[_0xaf27('0x37')],_0x4584b0['localtwolinkedid'],_0x4584b0['origtransfererchannel']));channels[_0x4584b0['localtwolinkedid']][_0xaf27('0x22')]=_0x4584b0[_0xaf27('0x38')];channels[_0x4584b0[_0xaf27('0x31')]][_0xaf27('0x34')]=_0xaf27('0x35');}}}catch(_0x53b0d2){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x39'),_0x4584b0[_0xaf27('0x37')]),_0x53b0d2);}};exports[_0xaf27('0x3a')]=function(_0x532474){try{if(!_[_0xaf27('0x1d')](channels[_0x532474[_0xaf27('0x11')]])){utils[_0xaf27('0x1c')](util[_0xaf27('0x6')](_0xaf27('0x3b'),_0x532474['uniqueid']),_0x532474);channels[_0x532474[_0xaf27('0x11')]][_0xaf27('0x3c')]=utils[_0xaf27('0x19')]();utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x3d'),_0x532474['uniqueid'],channels[_0x532474[_0xaf27('0x11')]][_0xaf27('0x3c')]));}}catch(_0x26c1bf){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x3b'),_0x532474[_0xaf27('0x11')]),_0x26c1bf);}};exports[_0xaf27('0x3e')]=function(_0x53168b){try{if(!_[_0xaf27('0x1d')](channels[_0x53168b['uniqueid']])){utils[_0xaf27('0x1c')](util[_0xaf27('0x6')](_0xaf27('0x3f'),_0x53168b[_0xaf27('0x11')]),_0x53168b);if(!_['isNil'](channels[_0x53168b[_0xaf27('0x11')]][_0xaf27('0x3c')])){channels[_0x53168b[_0xaf27('0x11')]][_0xaf27('0x40')]+=utils[_0xaf27('0x2d')](utils[_0xaf27('0x19')](),channels[_0x53168b['uniqueid']]['musiconholdstartAt']);utils[_0xaf27('0x5')](util[_0xaf27('0x6')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x53168b[_0xaf27('0x11')],channels[_0x53168b[_0xaf27('0x11')]]['mohtime']));delete channels[_0x53168b[_0xaf27('0x11')]][_0xaf27('0x3c')];}}}catch(_0xc6e5d4){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x3f'),_0x53168b['uniqueid']),_0xc6e5d4);}};exports[_0xaf27('0x41')]=function(_0x16036a){try{if(!_['isNil'](channels[_0x16036a[_0xaf27('0x11')]])){utils[_0xaf27('0x1c')](util[_0xaf27('0x6')]('[%s][calls][varset]',_0x16036a['uniqueid']),_0x16036a);if(!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x42')])){utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x43'),_0x16036a[_0xaf27('0x11')],_0x16036a['value']));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x44')]=_0x16036a[_0xaf27('0x45')];}if(!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')]['xmd-phone'])){utils['info'](util[_0xaf27('0x6')](_0xaf27('0x47'),_0x16036a['uniqueid'],_0x16036a[_0xaf27('0x45')]));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x48')]=_0x16036a[_0xaf27('0x45')];channels[_0x16036a[_0xaf27('0x11')]]['callerid']='\x22'+_0x16036a['value']+_0xaf27('0x49')+_0x16036a['value']+'>';}if(!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x4a')])||!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x4b')])){utils[_0xaf27('0x5')](util['format'](_0xaf27('0x4c'),_0x16036a['uniqueid'],!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')][_0xaf27('0x4a')])?_0xaf27('0x4a'):_0xaf27('0x4b'),_0x16036a[_0xaf27('0x45')]));channels[_0x16036a['uniqueid']][_0xaf27('0x28')]=_0x16036a[_0xaf27('0x45')];}if(!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')]['xmd-queue'])||!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x4d')])){utils['info'](util[_0xaf27('0x6')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x16036a['uniqueid'],!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x4e')])?_0xaf27('0x4e'):'xmcs-queue',_0x16036a[_0xaf27('0x45')]));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x4f')]='Queue';channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x50')]=_0x16036a[_0xaf27('0x45')];channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x8')]=!![];}if(!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')][_0xaf27('0x51')])){utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x52'),_0x16036a['uniqueid'],_0x16036a[_0xaf27('0x45')]));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x53')]=_0x16036a['value'];}if(!_[_0xaf27('0x1d')](_0x16036a['variable'][_0xaf27('0x54')])){utils[_0xaf27('0x5')](util[_0xaf27('0x6')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x16036a[_0xaf27('0x11')],_0x16036a['value']));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x55')]=_0x16036a['value'];}if(!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')]['outboundrouteid'])){utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x56'),_0x16036a[_0xaf27('0x11')],_0x16036a[_0xaf27('0x45')]));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x57')]=_0x16036a['value'];}if(!_[_0xaf27('0x1d')](_0x16036a[_0xaf27('0x46')][_0xaf27('0x58')])){utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x59'),_0x16036a[_0xaf27('0x11')],_0x16036a[_0xaf27('0x45')]));channels[_0x16036a[_0xaf27('0x11')]][_0xaf27('0x58')]=_0x16036a[_0xaf27('0x45')];}}}catch(_0x90346a){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x5a'),_0x16036a['uniqueid']),_0x90346a);}};exports[_0xaf27('0x5b')]=function(_0x5d061a){try{if(!_['isNil'](channels[_0x5d061a[_0xaf27('0x11')]])){utils[_0xaf27('0x1c')](util['format'](_0xaf27('0x5c'),_0x5d061a[_0xaf27('0x11')]),_0x5d061a);utils[_0xaf27('0x5')](util[_0xaf27('0x6')](_0xaf27('0x5d'),_0x5d061a['uniqueid'],_0x5d061a[_0xaf27('0x5e')],_0x5d061a[_0xaf27('0x5f')]));if(_0x5d061a[_0xaf27('0x5e')][_0xaf27('0x60')]()==_0xaf27('0x61')&&_[_0xaf27('0x62')](_0x5d061a[_0xaf27('0x5f')][_0xaf27('0x60')](),_0xaf27('0x63'))){var _0x5dbd50=_0x5d061a[_0xaf27('0x5f')][_0xaf27('0x64')]('=');var _0x1a2f07=_0x5dbd50[0x0][_0xaf27('0x65')](_0x5dbd50[0x0][_0xaf27('0x66')]('(')+0x1,_0x5dbd50[0x0]['lastIndexOf'](')'));var _0x127738=_0x5dbd50[0x1];channels[_0x5d061a['uniqueid']][_0x1a2f07]=_0x127738;}if(!_['includes']([_0xaf27('0x26'),_0xaf27('0x67'),_0xaf27('0x68'),'set','gotoif'],_0x5d061a['application'][_0xaf27('0x60')]())){channels[_0x5d061a['uniqueid']][_0xaf27('0x4f')]=_0x5d061a[_0xaf27('0x5e')];channels[_0x5d061a[_0xaf27('0x11')]][_0xaf27('0x50')]=_0x5d061a[_0xaf27('0x5f')];}}}catch(_0xfc4d1a){utils[_0xaf27('0x1a')](util[_0xaf27('0x6')](_0xaf27('0x5c'),_0x5d061a[_0xaf27('0x11')]),_0xfc4d1a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index aaf25ad..5359b5c 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 _0x8d48=['[core]\x20close','managerevent','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0x8d48,0xc0));var _0x88d4=function(_0x4deff,_0x42c328){_0x4deff=_0x4deff-0x0;var _0x440123=_0x8d48[_0x4deff];return _0x440123;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x88d4('0x0')](_0x88d4('0x1'));};exports[_0x88d4('0x2')]=function(){utils[_0x88d4('0x0')](_0x88d4('0x3'));};exports[_0x88d4('0x4')]=function(){utils[_0x88d4('0x0')]('[core]\x20fullybooted');};exports[_0x88d4('0x5')]=function(_0x4b67d6){utils[_0x88d4('0x5')](_0x88d4('0x6'),_0x4b67d6);};exports[_0x88d4('0x7')]=function(){utils[_0x88d4('0x0')](_0x88d4('0x8'));};exports[_0x88d4('0x9')]=function(_0x22beca){}; \ No newline at end of file +var _0xbbec=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','error','[core]\x20error','close'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xbbec,0xad));var _0xcbbe=function(_0x4aa6f1,_0x4fc7e9){_0x4aa6f1=_0x4aa6f1-0x0;var _0x3b896e=_0xbbec[_0x4aa6f1];return _0x3b896e;};'use strict';var utils=require(_0xcbbe('0x0'));exports[_0xcbbe('0x1')]=function(){utils[_0xcbbe('0x2')](_0xcbbe('0x3'));};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports['fullybooted']=function(){utils['info']('[core]\x20fullybooted');};exports[_0xcbbe('0x4')]=function(_0x328fc4){utils[_0xcbbe('0x4')](_0xcbbe('0x5'),_0x328fc4);};exports[_0xcbbe('0x6')]=function(){utils[_0xcbbe('0x2')](_0xcbbe('0x7'));};exports[_0xcbbe('0x8')]=function(_0x580149){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 27e668f..f7cf58d 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 _0xdcd5=['calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]'];(function(_0x34b9c5,_0x42700f){var _0x10b193=function(_0x14df10){while(--_0x14df10){_0x34b9c5['push'](_0x34b9c5['shift']());}};_0x10b193(++_0x42700f);}(_0xdcd5,0xd7));var _0x5dcd=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0xdcd5[_0x2fa1c6];return _0x5f3257;};'use strict';var _=require(_0x5dcd('0x0'));var util=require(_0x5dcd('0x1'));var utils=require(_0x5dcd('0x2'));var dials={};function writeDB(_0x2a9677){utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')](_0x5dcd('0x5'),_0x2a9677[_0x5dcd('0x6')],_0x2a9677[_0x5dcd('0x7')],_0x2a9677['dialstring'],_0x2a9677[_0x5dcd('0x8')],_0x2a9677[_0x5dcd('0x9')],_0x2a9677[_0x5dcd('0xa')]));utils['request'](_0x5dcd('0xb'),_0x2a9677);delete dials[_0x2a9677[_0x5dcd('0x6')]];}exports[_0x5dcd('0xc')]=function(_0x48284d){try{utils[_0x5dcd('0xd')](util['format'](_0x5dcd('0xe'),_0x48284d[_0x5dcd('0x6')]),_0x48284d);utils[_0x5dcd('0x3')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x48284d[_0x5dcd('0x6')],_0x48284d['application'],_0x48284d['appdata']));if(_0x48284d[_0x5dcd('0xf')][_0x5dcd('0x10')]()=='set'&&_[_0x5dcd('0x11')](_0x48284d[_0x5dcd('0x12')]['toLowerCase'](),_0x5dcd('0x13'))){var _0x73ef97=_0x48284d[_0x5dcd('0x12')][_0x5dcd('0x14')]('=');dials[_0x48284d[_0x5dcd('0x6')]]={'routeId':_0x73ef97[0x1]};}}catch(_0x1edbcc){utils[_0x5dcd('0x15')](util[_0x5dcd('0x4')](_0x5dcd('0xe'),_0x48284d[_0x5dcd('0x6')]),_0x1edbcc);}};exports[_0x5dcd('0x16')]=function(_0x67104a){try{utils[_0x5dcd('0xd')](util['format'](_0x5dcd('0x17'),_0x67104a['uniqueid']),_0x67104a);if(!_[_0x5dcd('0x18')](_0x67104a[_0x5dcd('0x19')][_0x5dcd('0x1a')])){utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')](_0x5dcd('0x1b'),_0x67104a[_0x5dcd('0x6')],_0x67104a[_0x5dcd('0x1c')]));dials[_0x67104a['uniqueid']]={'routeId':_0x67104a['value']};}}catch(_0x4573ef){utils[_0x5dcd('0x15')](util['format']('[%s][dials][varset]',_0x67104a[_0x5dcd('0x6')]),_0x4573ef);}};exports[_0x5dcd('0x1d')]=function(_0x26f6bc){try{if(!_[_0x5dcd('0x18')](dials[_0x26f6bc[_0x5dcd('0x6')]])){utils[_0x5dcd('0xd')](util[_0x5dcd('0x4')](_0x5dcd('0x1e'),_0x26f6bc['uniqueid']),_0x26f6bc);dials[_0x26f6bc[_0x5dcd('0x6')]]=_['assign'](dials[_0x26f6bc[_0x5dcd('0x6')]],_0x26f6bc);dials[_0x26f6bc[_0x5dcd('0x6')]][_0x5dcd('0x1f')]=utils[_0x5dcd('0x20')]();dials[_0x26f6bc[_0x5dcd('0x6')]][_0x5dcd('0x21')]=_0x5dcd('0x22');utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')](_0x5dcd('0x23'),_0x26f6bc['uniqueid'],dials[_0x26f6bc[_0x5dcd('0x6')]][_0x5dcd('0x1f')]));}}catch(_0x55356e){utils[_0x5dcd('0x15')](util[_0x5dcd('0x4')]('[%s][dials][dialbegin]',_0x26f6bc[_0x5dcd('0x6')]),_0x55356e);}};exports[_0x5dcd('0x24')]=function(_0x198dc9){try{if(!_[_0x5dcd('0x18')](dials[_0x198dc9['uniqueid']])){utils[_0x5dcd('0xd')](util[_0x5dcd('0x4')](_0x5dcd('0x25'),_0x198dc9[_0x5dcd('0x6')]),_0x198dc9);dials[_0x198dc9['uniqueid']][_0x5dcd('0xa')]=_0x198dc9['dialstatus'];if(_0x198dc9[_0x5dcd('0xa')]==_0x5dcd('0x26')){dials[_0x198dc9[_0x5dcd('0x6')]]=_[_0x5dcd('0x27')](dials[_0x198dc9[_0x5dcd('0x6')]],_0x198dc9);dials[_0x198dc9[_0x5dcd('0x6')]][_0x5dcd('0x28')]=utils[_0x5dcd('0x20')]();dials[_0x198dc9['uniqueid']][_0x5dcd('0x21')]=_0x5dcd('0x29');utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x198dc9['uniqueid'],_0x198dc9[_0x5dcd('0xa')],dials[_0x198dc9[_0x5dcd('0x6')]][_0x5dcd('0x28')]));}else{utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')](_0x5dcd('0x2a'),_0x198dc9['uniqueid'],_0x198dc9['dialstatus']));}}}catch(_0xfd4dd6){utils[_0x5dcd('0x15')](util[_0x5dcd('0x4')]('[%s][dials][dialend]',_0x198dc9['uniqueid']),_0xfd4dd6);}};exports[_0x5dcd('0x2b')]=function(_0x4074c5){try{if(!_[_0x5dcd('0x18')](dials[_0x4074c5[_0x5dcd('0x6')]])){utils[_0x5dcd('0xd')](util[_0x5dcd('0x4')](_0x5dcd('0x2c'),_0x4074c5['uniqueid']),_0x4074c5);utils[_0x5dcd('0x3')](util[_0x5dcd('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4074c5[_0x5dcd('0x6')],_0x4074c5[_0x5dcd('0x8')],_0x4074c5[_0x5dcd('0x2d')],_0x4074c5[_0x5dcd('0x2e')]));dials[_0x4074c5[_0x5dcd('0x6')]]=_[_0x5dcd('0x27')](dials[_0x4074c5[_0x5dcd('0x6')]],{'endtime':utils[_0x5dcd('0x20')](),'lastevent':_0x5dcd('0x2f')});dials[_0x4074c5['uniqueid']][_0x5dcd('0x30')]=utils[_0x5dcd('0x31')](dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x32')],dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x1f')]);dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x33')]=utils['diffTime'](dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x28')]||dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x32')],dials[_0x4074c5['uniqueid']][_0x5dcd('0x1f')]);dials[_0x4074c5['uniqueid']]['billableseconds']=dials[_0x4074c5['uniqueid']][_0x5dcd('0x28')]?utils[_0x5dcd('0x31')](dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x32')],dials[_0x4074c5[_0x5dcd('0x6')]][_0x5dcd('0x28')]):0x0;writeDB(dials[_0x4074c5['uniqueid']]);}}catch(_0x3e200d){utils[_0x5dcd('0x15')](util[_0x5dcd('0x4')](_0x5dcd('0x2c'),_0x4074c5[_0x5dcd('0x6')]),_0x3e200d);}}; \ No newline at end of file +var _0x89fe=['[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','startsWith','appdata','toLowerCase','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','dialend','ANSWER','assign','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','endtime','holdtime','diffTime','[%s][dials][hangup]','lodash','util','./utils','format'];(function(_0x31f5b0,_0x3ceb60){var _0x25dfd3=function(_0x4f81da){while(--_0x4f81da){_0x31f5b0['push'](_0x31f5b0['shift']());}};_0x25dfd3(++_0x3ceb60);}(_0x89fe,0x13a));var _0xe89f=function(_0x10d6b9,_0x5961b3){_0x10d6b9=_0x10d6b9-0x0;var _0x3b2694=_0x89fe[_0x10d6b9];return _0x3b2694;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var utils=require(_0xe89f('0x2'));var dials={};function writeDB(_0x28bc90){utils['info'](util[_0xe89f('0x3')](_0xe89f('0x4'),_0x28bc90['uniqueid'],_0x28bc90[_0xe89f('0x5')],_0x28bc90[_0xe89f('0x6')],_0x28bc90[_0xe89f('0x7')],_0x28bc90[_0xe89f('0x8')],_0x28bc90[_0xe89f('0x9')]));utils[_0xe89f('0xa')](_0xe89f('0xb'),_0x28bc90);delete dials[_0x28bc90['uniqueid']];}exports[_0xe89f('0xc')]=function(_0x24212f){try{utils[_0xe89f('0xd')](util[_0xe89f('0x3')](_0xe89f('0xe'),_0x24212f[_0xe89f('0xf')]),_0x24212f);utils[_0xe89f('0x10')](util[_0xe89f('0x3')](_0xe89f('0x11'),_0x24212f[_0xe89f('0xf')],_0x24212f[_0xe89f('0x12')],_0x24212f['appdata']));if(_0x24212f['application']['toLowerCase']()=='set'&&_[_0xe89f('0x13')](_0x24212f[_0xe89f('0x14')][_0xe89f('0x15')](),'cdr(routeid)')){var _0x256c37=_0x24212f[_0xe89f('0x14')]['split']('=');dials[_0x24212f[_0xe89f('0xf')]]={'routeId':_0x256c37[0x1]};}}catch(_0x8b0009){utils[_0xe89f('0x16')](util[_0xe89f('0x3')]('[%s][dials][newexten]',_0x24212f[_0xe89f('0xf')]),_0x8b0009);}};exports[_0xe89f('0x17')]=function(_0x1498e7){try{utils['debug'](util['format']('[%s][dials][varset]',_0x1498e7[_0xe89f('0xf')]),_0x1498e7);if(!_[_0xe89f('0x18')](_0x1498e7[_0xe89f('0x19')][_0xe89f('0x1a')])){utils[_0xe89f('0x10')](util[_0xe89f('0x3')](_0xe89f('0x1b'),_0x1498e7['uniqueid'],_0x1498e7[_0xe89f('0x1c')]));dials[_0x1498e7[_0xe89f('0xf')]]={'routeId':_0x1498e7[_0xe89f('0x1c')]};}}catch(_0x30c0cf){utils[_0xe89f('0x16')](util[_0xe89f('0x3')](_0xe89f('0x1d'),_0x1498e7[_0xe89f('0xf')]),_0x30c0cf);}};exports[_0xe89f('0x1e')]=function(_0xffd4f6){try{if(!_['isNil'](dials[_0xffd4f6[_0xe89f('0xf')]])){utils[_0xe89f('0xd')](util[_0xe89f('0x3')](_0xe89f('0x1f'),_0xffd4f6[_0xe89f('0xf')]),_0xffd4f6);dials[_0xffd4f6['uniqueid']]=_['assign'](dials[_0xffd4f6[_0xe89f('0xf')]],_0xffd4f6);dials[_0xffd4f6[_0xe89f('0xf')]][_0xe89f('0x20')]=utils[_0xe89f('0x21')]();dials[_0xffd4f6[_0xe89f('0xf')]][_0xe89f('0x22')]=_0xe89f('0x23');utils[_0xe89f('0x10')](util[_0xe89f('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0xffd4f6[_0xe89f('0xf')],dials[_0xffd4f6['uniqueid']][_0xe89f('0x20')]));}}catch(_0x2a7774){utils[_0xe89f('0x16')](util[_0xe89f('0x3')]('[%s][dials][dialbegin]',_0xffd4f6[_0xe89f('0xf')]),_0x2a7774);}};exports[_0xe89f('0x24')]=function(_0xdde56d){try{if(!_[_0xe89f('0x18')](dials[_0xdde56d['uniqueid']])){utils[_0xe89f('0xd')](util[_0xe89f('0x3')]('[%s][dials][dialend]',_0xdde56d[_0xe89f('0xf')]),_0xdde56d);dials[_0xdde56d[_0xe89f('0xf')]]['dialstatus']=_0xdde56d[_0xe89f('0x9')];if(_0xdde56d[_0xe89f('0x9')]==_0xe89f('0x25')){dials[_0xdde56d[_0xe89f('0xf')]]=_[_0xe89f('0x26')](dials[_0xdde56d['uniqueid']],_0xdde56d);dials[_0xdde56d[_0xe89f('0xf')]]['answertime']=utils[_0xe89f('0x21')]();dials[_0xdde56d[_0xe89f('0xf')]][_0xe89f('0x22')]=_0xe89f('0x27');utils[_0xe89f('0x10')](util[_0xe89f('0x3')](_0xe89f('0x28'),_0xdde56d['uniqueid'],_0xdde56d[_0xe89f('0x9')],dials[_0xdde56d[_0xe89f('0xf')]][_0xe89f('0x29')]));}else{utils[_0xe89f('0x10')](util[_0xe89f('0x3')](_0xe89f('0x2a'),_0xdde56d[_0xe89f('0xf')],_0xdde56d['dialstatus']));}}}catch(_0x6039cf){utils['error'](util['format'](_0xe89f('0x2b'),_0xdde56d['uniqueid']),_0x6039cf);}};exports[_0xe89f('0x2c')]=function(_0x279414){try{if(!_[_0xe89f('0x18')](dials[_0x279414[_0xe89f('0xf')]])){utils[_0xe89f('0xd')](util['format']('[%s][dials][hangup]',_0x279414[_0xe89f('0xf')]),_0x279414);utils[_0xe89f('0x10')](util['format'](_0xe89f('0x2d'),_0x279414[_0xe89f('0xf')],_0x279414[_0xe89f('0x7')],_0x279414[_0xe89f('0x2e')],_0x279414[_0xe89f('0x2f')]));dials[_0x279414[_0xe89f('0xf')]]=_[_0xe89f('0x26')](dials[_0x279414[_0xe89f('0xf')]],{'endtime':utils[_0xe89f('0x21')](),'lastevent':'complete'});dials[_0x279414['uniqueid']][_0xe89f('0x30')]=utils['diffTime'](dials[_0x279414['uniqueid']][_0xe89f('0x31')],dials[_0x279414['uniqueid']][_0xe89f('0x20')]);dials[_0x279414[_0xe89f('0xf')]][_0xe89f('0x32')]=utils[_0xe89f('0x33')](dials[_0x279414[_0xe89f('0xf')]]['answertime']||dials[_0x279414['uniqueid']][_0xe89f('0x31')],dials[_0x279414[_0xe89f('0xf')]][_0xe89f('0x20')]);dials[_0x279414['uniqueid']]['billableseconds']=dials[_0x279414[_0xe89f('0xf')]]['answertime']?utils[_0xe89f('0x33')](dials[_0x279414['uniqueid']][_0xe89f('0x31')],dials[_0x279414[_0xe89f('0xf')]]['answertime']):0x0;writeDB(dials[_0x279414[_0xe89f('0xf')]]);}}catch(_0x12a663){utils[_0xe89f('0x16')](util['format'](_0xe89f('0x34'),_0x279414[_0xe89f('0xf')]),_0x12a663);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f1af7d4..a13fcb6 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 _0xf01c=['newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]'];(function(_0x58aa6d,_0x3faa2d){var _0x483794=function(_0x12ea99){while(--_0x12ea99){_0x58aa6d['push'](_0x58aa6d['shift']());}};_0x483794(++_0x3faa2d);}(_0xf01c,0x129));var _0xcf01=function(_0x189c67,_0x55f88d){_0x189c67=_0x189c67-0x0;var _0x406e91=_0xf01c[_0x189c67];return _0x406e91;};var AsteriskManager=require(_0xcf01('0x0'));var config=require(_0xcf01('0x1'));var utils=require('./utils');var util=require(_0xcf01('0x2'));var isXDREnabled=config[_0xcf01('0x3')]&&config[_0xcf01('0x3')][_0xcf01('0x4')]?!config[_0xcf01('0x3')][_0xcf01('0x4')]:!![];var isProduction=config[_0xcf01('0x5')]===_0xcf01('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0xcf01('0x3')][_0xcf01('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xcf01('0x8')][_0xcf01('0x9')],config[_0xcf01('0x8')]['ip'],config['asterisk'][_0xcf01('0xa')],config[_0xcf01('0x8')][_0xcf01('0xb')],!![]);ami[_0xcf01('0xc')]();if(!isXDREnabled){utils[_0xcf01('0xd')](_0xcf01('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xcf01('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xcf01('0xf'));var calls=require(_0xcf01('0x10'));var queues=require(_0xcf01('0x11'));var recordings=require(_0xcf01('0x12'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xcf01('0x13'));var core=require(_0xcf01('0x14'));ami['on'](_0xcf01('0x15'),core[_0xcf01('0x15')]);ami['on']('shutdown',core[_0xcf01('0x16')]);ami['on'](_0xcf01('0x17'),core[_0xcf01('0x17')]);ami['on'](_0xcf01('0x18'),core[_0xcf01('0x18')]);ami['on'](_0xcf01('0x19'),core['close']);ami['on'](_0xcf01('0x1a'),core[_0xcf01('0x1a')]);ami['on'](_0xcf01('0x1b'),function(_0x587682){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')]('[%s][index][devicestatechange]',_0x587682['device']),_0x587682);members[_0xcf01('0x1b')](_0x587682);}catch(_0x336727){utils['error'](util[_0xcf01('0x1d')](_0xcf01('0x1e'),_0x587682[_0xcf01('0x1f')]),_0x336727);}});ami['on'](_0xcf01('0x20'),function(_0x3e1948){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x21'),_0x3e1948['uniqueid']),_0x3e1948);agents['agentcalled'](_0x3e1948);}catch(_0x4fd450){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x21'),_0x3e1948['uniqueid']),_0x4fd450);}});ami['on'](_0xcf01('0x22'),function(_0x215bdd){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x23'),_0x215bdd['uniqueid']),_0x215bdd);agents[_0xcf01('0x22')](_0x215bdd);}catch(_0x3ad26c){utils['error'](util['format'](_0xcf01('0x23'),_0x215bdd[_0xcf01('0x24')]),_0x3ad26c);}});ami['on'](_0xcf01('0x25'),function(_0x13d976){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x26'),_0x13d976[_0xcf01('0x24')]),_0x13d976);agents[_0xcf01('0x25')](_0x13d976);queues[_0xcf01('0x25')](_0x13d976);}catch(_0x640eb2){utils['error'](util[_0xcf01('0x1d')](_0xcf01('0x26'),_0x13d976[_0xcf01('0x24')]),_0x640eb2);}});ami['on']('agentcomplete',function(_0x53381c){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x27'),_0x53381c[_0xcf01('0x24')]),_0x53381c);agents[_0xcf01('0x28')](_0x53381c);queues[_0xcf01('0x28')](_0x53381c);members[_0xcf01('0x28')](_0x53381c);}catch(_0x5c3f87){utils[_0xcf01('0x18')](util['format'](_0xcf01('0x27'),_0x53381c[_0xcf01('0x24')]),_0x5c3f87);}});ami['on'](_0xcf01('0x29'),function(_0x99b626){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x2a'),_0x99b626[_0xcf01('0x24')]),_0x99b626);agents['queuecallerabandon'](_0x99b626);queues[_0xcf01('0x29')](_0x99b626);}catch(_0x25f2f6){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x2a'),_0x99b626[_0xcf01('0x24')]),_0x25f2f6);}});ami['on']('queuecallerjoin',function(_0x3aa51c){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')]('[%s][index][queuecallerjoin]',_0x3aa51c[_0xcf01('0x24')]),_0x3aa51c);queues[_0xcf01('0x2b')](_0x3aa51c);recordings[_0xcf01('0x2b')](_0x3aa51c);}catch(_0x3aebb4){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')]('[%s][index][queuecallerjoin]',_0x3aa51c[_0xcf01('0x24')]),_0x3aebb4);}});ami['on'](_0xcf01('0x2c'),function(_0x4d85a0){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x2d'),_0x4d85a0['uniqueid']),_0x4d85a0);queues[_0xcf01('0x2c')](_0x4d85a0);}catch(_0x13c60e){utils['error'](util[_0xcf01('0x1d')]('[%s][index][queuecallerleave]',_0x4d85a0[_0xcf01('0x24')]),_0x13c60e);}});ami['on']('musiconholdstart',function(_0x38b768){try{utils['debug'](util['format'](_0xcf01('0x2e'),_0x38b768['uniqueid']),_0x38b768);queues[_0xcf01('0x2f')](_0x38b768);calls['musiconholdstart'](_0x38b768);}catch(_0x46c411){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x2e'),_0x38b768[_0xcf01('0x24')]),_0x46c411);}});ami['on']('musiconholdstop',function(_0x57ba91){try{utils['debug'](util[_0xcf01('0x1d')](_0xcf01('0x30'),_0x57ba91[_0xcf01('0x24')]),_0x57ba91);queues['musiconholdstop'](_0x57ba91);calls[_0xcf01('0x31')](_0x57ba91);}catch(_0x239cef){utils['error'](util[_0xcf01('0x1d')](_0xcf01('0x30'),_0x57ba91[_0xcf01('0x24')]),_0x239cef);}});ami['on'](_0xcf01('0x32'),function(_0x5c1676){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x33'),_0x5c1676[_0xcf01('0x24')]),_0x5c1676);calls['newstate'](_0x5c1676);recordings['newstate'](_0x5c1676);}catch(_0x2f23b6){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')]('[%s][index][newstate]',_0x5c1676[_0xcf01('0x24')]),_0x2f23b6);}});ami['on'](_0xcf01('0x34'),function(_0xe4e8de){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x35'),_0xe4e8de[_0xcf01('0x24')]),_0xe4e8de);calls[_0xcf01('0x34')](_0xe4e8de);recordings[_0xcf01('0x34')](_0xe4e8de);dials[_0xcf01('0x34')](_0xe4e8de);agents[_0xcf01('0x34')](_0xe4e8de);queues[_0xcf01('0x34')](_0xe4e8de);}catch(_0x5cf03f){utils[_0xcf01('0x18')](util['format'](_0xcf01('0x35'),_0xe4e8de[_0xcf01('0x24')]),_0x5cf03f);}});ami['on'](_0xcf01('0x36'),function(_0x4f8f30){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')]('[%s][index][cdr]',_0x4f8f30[_0xcf01('0x24')]),_0x4f8f30);members['cdr'](_0x4f8f30);}catch(_0x450fd4){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x37'),_0x4f8f30[_0xcf01('0x24')]),_0x450fd4);}});ami['on'](_0xcf01('0x38'),function(_0x50ff52){try{utils[_0xcf01('0x1c')](util['format']('[%s][index][blindtransfer]',_0x50ff52['uniqueid']),_0x50ff52);queues[_0xcf01('0x38')](_0x50ff52);agents[_0xcf01('0x38')](_0x50ff52);transfers[_0xcf01('0x38')](_0x50ff52);}catch(_0x3786a6){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x39'),_0x50ff52[_0xcf01('0x24')]),_0x3786a6);}});ami['on'](_0xcf01('0x3a'),function(_0x54ee4d){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x3b'),_0x54ee4d[_0xcf01('0x3c')]),_0x54ee4d);queues[_0xcf01('0x3a')](_0x54ee4d);transfers[_0xcf01('0x3a')](_0x54ee4d);agents['attendedtransfer'](_0x54ee4d);calls['attendedtransfer'](_0x54ee4d);}catch(_0x39c7e3){utils[_0xcf01('0x18')](util['format'](_0xcf01('0x3b'),_0x54ee4d[_0xcf01('0x3c')]),_0x39c7e3);}});ami['on'](_0xcf01('0x3d'),function(_0x4b920f){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x3e'),_0x4b920f['uniqueid']),_0x4b920f);queues['varset'](_0x4b920f);recordings['varset'](_0x4b920f);calls['varset'](_0x4b920f);dials['varset'](_0x4b920f);}catch(_0x2cf985){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')]('[%s][index][varset]',_0x4b920f['uniqueid']),_0x2cf985);}});ami['on'](_0xcf01('0x3f'),function(_0x5d644c){try{utils[_0xcf01('0x1c')](util['format'](_0xcf01('0x40'),_0x5d644c[_0xcf01('0x24')]),_0x5d644c);calls[_0xcf01('0x3f')](_0x5d644c);recordings[_0xcf01('0x3f')](_0x5d644c);dials[_0xcf01('0x3f')](_0x5d644c);}catch(_0x1789fe){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')]('[%s][index][newexten]',_0x5d644c[_0xcf01('0x24')]),_0x1789fe);}});ami['on']('newchannel',function(_0x6a84){try{utils['debug'](util[_0xcf01('0x1d')](_0xcf01('0x41'),_0x6a84[_0xcf01('0x24')]),_0x6a84);calls[_0xcf01('0x42')](_0x6a84);recordings['newchannel'](_0x6a84);}catch(_0x1109da){utils['error'](util[_0xcf01('0x1d')](_0xcf01('0x41'),_0x6a84[_0xcf01('0x24')]),_0x1109da);}});ami['on'](_0xcf01('0x43'),function(_0x47ee89){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x44'),_0x47ee89[_0xcf01('0x24')]),_0x47ee89);dials[_0xcf01('0x43')](_0x47ee89);}catch(_0x386417){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')](_0xcf01('0x45'),_0x47ee89[_0xcf01('0x24')]),_0x386417);}});ami['on']('dialend',function(_0x213d61){try{utils[_0xcf01('0x1c')](util[_0xcf01('0x1d')](_0xcf01('0x46'),_0x213d61[_0xcf01('0x24')]),_0x213d61);dials[_0xcf01('0x47')](_0x213d61);}catch(_0x2fa081){utils[_0xcf01('0x18')](util[_0xcf01('0x1d')]('[%s][index][dialend]',_0x213d61[_0xcf01('0x24')]),_0x2fa081);}});} \ No newline at end of file +var _0x4398=['close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','error','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x4aad79,_0x1849ae){var _0x33ab95=function(_0x29086c){while(--_0x29086c){_0x4aad79['push'](_0x4aad79['shift']());}};_0x33ab95(++_0x1849ae);}(_0x4398,0x10d));var _0x8439=function(_0x589b96,_0x2b9dbb){_0x589b96=_0x589b96-0x0;var _0x1f38cd=_0x4398[_0x589b96];return _0x1f38cd;};var AsteriskManager=require(_0x8439('0x0'));var config=require(_0x8439('0x1'));var utils=require(_0x8439('0x2'));var util=require('util');var isXDREnabled=config[_0x8439('0x3')]&&config[_0x8439('0x3')][_0x8439('0x4')]?!config[_0x8439('0x3')][_0x8439('0x4')]:!![];var isProduction=config[_0x8439('0x5')]===_0x8439('0x6')||![];var isLocalAsterisk=config[_0x8439('0x3')]&&config[_0x8439('0x3')][_0x8439('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x8439('0x8')],config['asterisk']['ip'],config[_0x8439('0x9')][_0x8439('0xa')],config[_0x8439('0x9')][_0x8439('0xb')],!![]);ami[_0x8439('0xc')]();if(!isXDREnabled){utils[_0x8439('0xd')](_0x8439('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8439('0xd')](_0x8439('0xf'));}else{var agents=require(_0x8439('0x10'));var calls=require(_0x8439('0x11'));var queues=require(_0x8439('0x12'));var recordings=require(_0x8439('0x13'));var members=require(_0x8439('0x14'));var dials=require(_0x8439('0x15'));var transfers=require(_0x8439('0x16'));var core=require(_0x8439('0x17'));ami['on'](_0x8439('0x18'),core[_0x8439('0x18')]);ami['on']('shutdown',core[_0x8439('0x19')]);ami['on'](_0x8439('0x1a'),core[_0x8439('0x1a')]);ami['on']('error',core['error']);ami['on'](_0x8439('0x1b'),core[_0x8439('0x1b')]);ami['on'](_0x8439('0x1c'),core[_0x8439('0x1c')]);ami['on'](_0x8439('0x1d'),function(_0x3fe3a4){try{utils[_0x8439('0x1e')](util['format'](_0x8439('0x1f'),_0x3fe3a4[_0x8439('0x20')]),_0x3fe3a4);members['devicestatechange'](_0x3fe3a4);}catch(_0x2892ba){utils[_0x8439('0x21')](util['format']('[%s][index][devicestatechange]',_0x3fe3a4[_0x8439('0x20')]),_0x2892ba);}});ami['on'](_0x8439('0x22'),function(_0x325688){try{utils['debug'](util[_0x8439('0x23')](_0x8439('0x24'),_0x325688[_0x8439('0x25')]),_0x325688);agents[_0x8439('0x22')](_0x325688);}catch(_0x39ed34){utils[_0x8439('0x21')](util[_0x8439('0x23')]('[%s][index][agentcalled]',_0x325688[_0x8439('0x25')]),_0x39ed34);}});ami['on'](_0x8439('0x26'),function(_0x4037b5){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')]('[%s][index][agentringnoanswer]',_0x4037b5[_0x8439('0x25')]),_0x4037b5);agents[_0x8439('0x26')](_0x4037b5);}catch(_0x1ad1c6){utils[_0x8439('0x21')](util['format'](_0x8439('0x27'),_0x4037b5[_0x8439('0x25')]),_0x1ad1c6);}});ami['on'](_0x8439('0x28'),function(_0x1ee1f9){try{utils[_0x8439('0x1e')](util['format']('[%s][index][agentconnect]',_0x1ee1f9[_0x8439('0x25')]),_0x1ee1f9);agents[_0x8439('0x28')](_0x1ee1f9);queues['agentconnect'](_0x1ee1f9);}catch(_0x2088d8){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x29'),_0x1ee1f9['uniqueid']),_0x2088d8);}});ami['on'](_0x8439('0x2a'),function(_0x322d1e){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x2b'),_0x322d1e[_0x8439('0x25')]),_0x322d1e);agents[_0x8439('0x2a')](_0x322d1e);queues[_0x8439('0x2a')](_0x322d1e);members[_0x8439('0x2a')](_0x322d1e);}catch(_0x33bd66){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x2b'),_0x322d1e[_0x8439('0x25')]),_0x33bd66);}});ami['on'](_0x8439('0x2c'),function(_0x31984e){try{utils[_0x8439('0x1e')](util['format'](_0x8439('0x2d'),_0x31984e[_0x8439('0x25')]),_0x31984e);agents[_0x8439('0x2c')](_0x31984e);queues['queuecallerabandon'](_0x31984e);}catch(_0x5a3767){utils[_0x8439('0x21')](util['format']('[%s][index][queuecallerabandon]',_0x31984e['uniqueid']),_0x5a3767);}});ami['on'](_0x8439('0x2e'),function(_0xcff554){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')]('[%s][index][queuecallerjoin]',_0xcff554['uniqueid']),_0xcff554);queues['queuecallerjoin'](_0xcff554);recordings['queuecallerjoin'](_0xcff554);}catch(_0x2fb486){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x2f'),_0xcff554[_0x8439('0x25')]),_0x2fb486);}});ami['on'](_0x8439('0x30'),function(_0x17b478){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x31'),_0x17b478[_0x8439('0x25')]),_0x17b478);queues[_0x8439('0x30')](_0x17b478);}catch(_0x3611b1){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x31'),_0x17b478[_0x8439('0x25')]),_0x3611b1);}});ami['on'](_0x8439('0x32'),function(_0x1fa1c3){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x33'),_0x1fa1c3[_0x8439('0x25')]),_0x1fa1c3);queues[_0x8439('0x32')](_0x1fa1c3);calls['musiconholdstart'](_0x1fa1c3);}catch(_0x415fab){utils[_0x8439('0x21')](util['format'](_0x8439('0x33'),_0x1fa1c3[_0x8439('0x25')]),_0x415fab);}});ami['on'](_0x8439('0x34'),function(_0x146d7b){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')]('[%s][index][musiconholdstop]',_0x146d7b[_0x8439('0x25')]),_0x146d7b);queues[_0x8439('0x34')](_0x146d7b);calls[_0x8439('0x34')](_0x146d7b);}catch(_0x2e514b){utils[_0x8439('0x21')](util['format']('[%s][index][musiconholdstop]',_0x146d7b['uniqueid']),_0x2e514b);}});ami['on'](_0x8439('0x35'),function(_0x340a14){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x36'),_0x340a14[_0x8439('0x25')]),_0x340a14);calls['newstate'](_0x340a14);recordings[_0x8439('0x35')](_0x340a14);}catch(_0x4b948f){utils[_0x8439('0x21')](util['format'](_0x8439('0x36'),_0x340a14[_0x8439('0x25')]),_0x4b948f);}});ami['on'](_0x8439('0x37'),function(_0x312540){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x38'),_0x312540[_0x8439('0x25')]),_0x312540);calls[_0x8439('0x37')](_0x312540);recordings[_0x8439('0x37')](_0x312540);dials[_0x8439('0x37')](_0x312540);agents['hangup'](_0x312540);queues[_0x8439('0x37')](_0x312540);}catch(_0x12132f){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x38'),_0x312540['uniqueid']),_0x12132f);}});ami['on'](_0x8439('0x39'),function(_0x28f1ab){try{utils[_0x8439('0x1e')](util['format']('[%s][index][cdr]',_0x28f1ab[_0x8439('0x25')]),_0x28f1ab);members['cdr'](_0x28f1ab);}catch(_0x1f4bc7){utils[_0x8439('0x21')](util['format'](_0x8439('0x3a'),_0x28f1ab['uniqueid']),_0x1f4bc7);}});ami['on'](_0x8439('0x3b'),function(_0x127528){try{utils['debug'](util[_0x8439('0x23')](_0x8439('0x3c'),_0x127528['uniqueid']),_0x127528);queues[_0x8439('0x3b')](_0x127528);agents['blindtransfer'](_0x127528);transfers['blindtransfer'](_0x127528);}catch(_0xa3dc35){utils['error'](util[_0x8439('0x23')](_0x8439('0x3c'),_0x127528[_0x8439('0x25')]),_0xa3dc35);}});ami['on'](_0x8439('0x3d'),function(_0x3212bc){try{utils[_0x8439('0x1e')](util['format']('[%s][index][attendedtransfer]',_0x3212bc[_0x8439('0x3e')]),_0x3212bc);queues['attendedtransfer'](_0x3212bc);transfers['attendedtransfer'](_0x3212bc);agents['attendedtransfer'](_0x3212bc);calls[_0x8439('0x3d')](_0x3212bc);}catch(_0x5c8dec){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x3f'),_0x3212bc[_0x8439('0x3e')]),_0x5c8dec);}});ami['on'](_0x8439('0x40'),function(_0x47e03c){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x41'),_0x47e03c[_0x8439('0x25')]),_0x47e03c);queues[_0x8439('0x40')](_0x47e03c);recordings['varset'](_0x47e03c);calls[_0x8439('0x40')](_0x47e03c);dials[_0x8439('0x40')](_0x47e03c);}catch(_0x5d47e3){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x41'),_0x47e03c['uniqueid']),_0x5d47e3);}});ami['on'](_0x8439('0x42'),function(_0x511871){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x43'),_0x511871[_0x8439('0x25')]),_0x511871);calls[_0x8439('0x42')](_0x511871);recordings[_0x8439('0x42')](_0x511871);dials[_0x8439('0x42')](_0x511871);}catch(_0x4b4ba2){utils['error'](util[_0x8439('0x23')](_0x8439('0x43'),_0x511871[_0x8439('0x25')]),_0x4b4ba2);}});ami['on'](_0x8439('0x44'),function(_0x492a02){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')]('[%s][index][newchannel]',_0x492a02[_0x8439('0x25')]),_0x492a02);calls[_0x8439('0x44')](_0x492a02);recordings[_0x8439('0x44')](_0x492a02);}catch(_0x12d520){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x45'),_0x492a02['uniqueid']),_0x12d520);}});ami['on'](_0x8439('0x46'),function(_0x97cf38){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')](_0x8439('0x47'),_0x97cf38[_0x8439('0x25')]),_0x97cf38);dials[_0x8439('0x46')](_0x97cf38);}catch(_0x1b86d7){utils[_0x8439('0x21')](util[_0x8439('0x23')]('[%s]dialbegin',_0x97cf38[_0x8439('0x25')]),_0x1b86d7);}});ami['on'](_0x8439('0x48'),function(_0x272fc8){try{utils[_0x8439('0x1e')](util[_0x8439('0x23')]('[%s][index][dialend]',_0x272fc8[_0x8439('0x25')]),_0x272fc8);dials[_0x8439('0x48')](_0x272fc8);}catch(_0x2b9ecf){utils[_0x8439('0x21')](util[_0x8439('0x23')](_0x8439('0x49'),_0x272fc8['uniqueid']),_0x2b9ecf);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 91f7774..c429040 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 _0xb88f=['interface','name','internal','CreateMemberReport','getUserByName','request','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','NOT_INUSE','isNil','exitAt','diffTime','debug','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','split','util','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xb88f,0x124));var _0xfb88=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xb88f[_0x152678];return _0x311a9;};'use strict';var _=require('lodash');var util=require(_0xfb88('0x0'));var utils=require('./utils');var members={};var exclude=[_0xfb88('0x1'),'Queue:'];function writeDB(_0x1b8b3e){utils[_0xfb88('0x2')](util[_0xfb88('0x3')](_0xfb88('0x4'),_0x1b8b3e[_0xfb88('0x5')],_0x1b8b3e['interface'],_0x1b8b3e[_0xfb88('0x6')],_0x1b8b3e[_0xfb88('0x7')],_0x1b8b3e[_0xfb88('0x8')],_0x1b8b3e['type']));if(_0x1b8b3e[_0xfb88('0x9')]){utils['getUserByInterface'](_0x1b8b3e[_0xfb88('0x9')])['then'](function(_0x4d6d92){if(_0x4d6d92){_0x1b8b3e[_0xfb88('0x8')]=_0x4d6d92[_0xfb88('0xa')];_0x1b8b3e[_0xfb88('0xb')]=_0x4d6d92['internal'];utils['request'](_0xfb88('0xc'),_0x1b8b3e);}else{utils[_0xfb88('0xd')](_0x1b8b3e[_0xfb88('0x9')]['split']('/')[0x1])['then'](function(_0x49e9b1){if(_0x49e9b1){_0x1b8b3e[_0xfb88('0x8')]=_0x49e9b1[_0xfb88('0xa')];_0x1b8b3e[_0xfb88('0xb')]=_0x49e9b1[_0xfb88('0xb')];utils[_0xfb88('0xe')](_0xfb88('0xc'),_0x1b8b3e);}});}})[_0xfb88('0xf')](function(_0x5c9ec7){utils[_0xfb88('0x10')](util[_0xfb88('0x3')](_0xfb88('0x11'),_0x1b8b3e[_0xfb88('0x5')]),_0x5c9ec7);});}delete members[_0x1b8b3e['interface']];}function startsWith(_0x5c595a,_0x7f6e25){return _['some'](_0x5c595a,function(_0x2d99c6){return _[_0xfb88('0x12')](_0x7f6e25,_0x2d99c6);});}exports[_0xfb88('0x13')]=function(_0x66fab){try{utils['debug'](util[_0xfb88('0x3')](_0xfb88('0x14'),members[_0x66fab[_0xfb88('0x15')]]?members[_0x66fab['device']]['uniqueid']:_0x66fab[_0xfb88('0x15')]),_0x66fab);utils[_0xfb88('0x2')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x66fab[_0xfb88('0x15')]]?members[_0x66fab['device']]['uniqueid']:_0x66fab[_0xfb88('0x15')],_0x66fab[_0xfb88('0x16')],_0x66fab[_0xfb88('0x15')]));switch(_0x66fab[_0xfb88('0x16')]){case _0xfb88('0x17'):case _0xfb88('0x18'):if(!startsWith(exclude,_0x66fab['device'])){members[_0x66fab[_0xfb88('0x15')]]={'channel':_0xfb88('0x19'),'interface':_0x66fab[_0xfb88('0x15')],'type':'TALKING','enterAt':utils['now'](),'role':'agent'};}break;case _0xfb88('0x1a'):if(!_[_0xfb88('0x1b')](members[_0x66fab[_0xfb88('0x15')]])){members[_0x66fab['device']][_0xfb88('0x1c')]=utils['now']();members[_0x66fab[_0xfb88('0x15')]]['duration']=utils[_0xfb88('0x1d')](members[_0x66fab[_0xfb88('0x15')]][_0xfb88('0x1c')],members[_0x66fab[_0xfb88('0x15')]]['enterAt']);if(members[_0x66fab[_0xfb88('0x15')]][_0xfb88('0x5')]){writeDB(members[_0x66fab[_0xfb88('0x15')]]);}}break;default:break;}}catch(_0x482018){utils[_0xfb88('0x10')](util[_0xfb88('0x3')](_0xfb88('0x14'),members[_0x66fab[_0xfb88('0x15')]]?members[_0x66fab[_0xfb88('0x15')]]['uniqueid']:_0x66fab['device']),_0x482018);}};exports['agentcomplete']=function(_0x5e6837){try{if(!_[_0xfb88('0x1b')](members[_0x5e6837[_0xfb88('0x9')]])){utils[_0xfb88('0x1e')](util['format']('[%s][members][agentcomplete]',_0x5e6837[_0xfb88('0x5')]),_0x5e6837);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x5e6837['uniqueid'],_0x5e6837[_0xfb88('0x9')],_0x5e6837[_0xfb88('0x1f')]));members[_0x5e6837[_0xfb88('0x9')]]=_[_0xfb88('0x20')](members[_0x5e6837[_0xfb88('0x9')]],{'data4':_0x5e6837[_0xfb88('0x1f')],'uniqueid':_0x5e6837[_0xfb88('0x5')]});}}catch(_0x167139){utils[_0xfb88('0x10')](util[_0xfb88('0x3')](_0xfb88('0x21'),_0x5e6837['uniqueid']),_0x167139);}};exports[_0xfb88('0x22')]=function(_0x530f86){try{utils[_0xfb88('0x1e')](util['format'](_0xfb88('0x23'),_0x530f86[_0xfb88('0x5')]),_0x530f86);if(_0x530f86[_0xfb88('0x6')]){var _0x5ec245=_0x530f86[_0xfb88('0x6')]['split']('-')[0x0];if(!_['isNil'](members[_0x5ec245])){members[_0x5ec245]=_[_0xfb88('0x20')](members[_0x5ec245],{'data1':members[_0x5ec245][_0xfb88('0x24')]||_0x530f86[_0xfb88('0x25')],'data2':members[_0x5ec245]['data2']||_0x530f86[_0xfb88('0x26')],'data3':members[_0x5ec245][_0xfb88('0x27')]||_0x530f86[_0xfb88('0x28')],'uniqueid':members[_0x5ec245][_0xfb88('0x5')]||_0x530f86[_0xfb88('0x5')]});utils[_0xfb88('0x2')](util[_0xfb88('0x3')](_0xfb88('0x29'),_0x530f86['uniqueid'],members[_0x5ec245]['data1'],members[_0x5ec245][_0xfb88('0x7')],members[_0x5ec245][_0xfb88('0x27')]));if(members[_0x5ec245]['exitAt']){writeDB(members[_0x5ec245]);}}}if(_0x530f86['destinationchannel']){var _0x4bf69d=_0x530f86['destinationchannel'][_0xfb88('0x2a')]('-')[0x0];if(!_[_0xfb88('0x1b')](members[_0x4bf69d])){members[_0x4bf69d]=_[_0xfb88('0x20')](members[_0x4bf69d],{'data1':members[_0x4bf69d]['data1']||_0x530f86['type'],'data2':members[_0x4bf69d][_0xfb88('0x7')]||_0x530f86[_0xfb88('0x26')],'data3':members[_0x4bf69d][_0xfb88('0x27')]||_0x530f86['destination'],'uniqueid':members[_0x4bf69d][_0xfb88('0x5')]||_0x530f86[_0xfb88('0x5')]});utils[_0xfb88('0x2')](util[_0xfb88('0x3')](_0xfb88('0x29'),_0x530f86[_0xfb88('0x5')],members[_0x4bf69d][_0xfb88('0x24')],members[_0x4bf69d][_0xfb88('0x7')],members[_0x4bf69d][_0xfb88('0x27')]));if(members[_0x4bf69d]['exitAt']){writeDB(members[_0x4bf69d]);}}}}catch(_0x2869fc){utils[_0xfb88('0x10')](util[_0xfb88('0x3')](_0xfb88('0x23'),_0x530f86[_0xfb88('0x5')]),_0x2869fc);}}; \ No newline at end of file +var _0x1d1b=['enterAt','queue','assign','[%s][members][agentcomplete]','channel','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','isNil','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','NOT_INUSE','exitAt','now','duration','diffTime'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x1d1b,0x110));var _0xb1d1=function(_0x22d598,_0x259d66){_0x22d598=_0x22d598-0x0;var _0x47477f=_0x1d1b[_0x22d598];return _0x47477f;};'use strict';var _=require(_0xb1d1('0x0'));var util=require(_0xb1d1('0x1'));var utils=require(_0xb1d1('0x2'));var members={};var exclude=[_0xb1d1('0x3'),_0xb1d1('0x4')];function writeDB(_0x4093d1){utils[_0xb1d1('0x5')](util['format'](_0xb1d1('0x6'),_0x4093d1[_0xb1d1('0x7')],_0x4093d1['interface'],_0x4093d1['channel'],_0x4093d1[_0xb1d1('0x8')],_0x4093d1[_0xb1d1('0x9')],_0x4093d1[_0xb1d1('0xa')]));if(_0x4093d1[_0xb1d1('0xb')]){utils[_0xb1d1('0xc')](_0x4093d1[_0xb1d1('0xb')])[_0xb1d1('0xd')](function(_0x4cb976){if(_0x4cb976){_0x4093d1[_0xb1d1('0x9')]=_0x4cb976[_0xb1d1('0xe')];_0x4093d1[_0xb1d1('0xf')]=_0x4cb976['internal'];utils[_0xb1d1('0x10')](_0xb1d1('0x11'),_0x4093d1);}else{utils[_0xb1d1('0x12')](_0x4093d1[_0xb1d1('0xb')][_0xb1d1('0x13')]('/')[0x1])[_0xb1d1('0xd')](function(_0x21fddb){if(_0x21fddb){_0x4093d1[_0xb1d1('0x9')]=_0x21fddb['name'];_0x4093d1[_0xb1d1('0xf')]=_0x21fddb[_0xb1d1('0xf')];utils['request']('CreateMemberReport',_0x4093d1);}});}})[_0xb1d1('0x14')](function(_0x575c09){utils[_0xb1d1('0x15')](util[_0xb1d1('0x16')](_0xb1d1('0x17'),_0x4093d1[_0xb1d1('0x7')]),_0x575c09);});}delete members[_0x4093d1['interface']];}function startsWith(_0x78c813,_0x2f8c8e){return _[_0xb1d1('0x18')](_0x78c813,function(_0x482703){return _[_0xb1d1('0x19')](_0x2f8c8e,_0x482703);});}exports[_0xb1d1('0x1a')]=function(_0x2fc136){try{utils[_0xb1d1('0x1b')](util[_0xb1d1('0x16')]('[%s][members][devicestatechange]',members[_0x2fc136[_0xb1d1('0x1c')]]?members[_0x2fc136[_0xb1d1('0x1c')]][_0xb1d1('0x7')]:_0x2fc136[_0xb1d1('0x1c')]),_0x2fc136);utils[_0xb1d1('0x5')](util[_0xb1d1('0x16')](_0xb1d1('0x1d'),members[_0x2fc136[_0xb1d1('0x1c')]]?members[_0x2fc136[_0xb1d1('0x1c')]]['uniqueid']:_0x2fc136['device'],_0x2fc136[_0xb1d1('0x1e')],_0x2fc136[_0xb1d1('0x1c')]));switch(_0x2fc136[_0xb1d1('0x1e')]){case _0xb1d1('0x1f'):case _0xb1d1('0x20'):if(!startsWith(exclude,_0x2fc136['device'])){members[_0x2fc136[_0xb1d1('0x1c')]]={'channel':_0xb1d1('0x21'),'interface':_0x2fc136['device'],'type':_0xb1d1('0x22'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xb1d1('0x23'):if(!_['isNil'](members[_0x2fc136[_0xb1d1('0x1c')]])){members[_0x2fc136[_0xb1d1('0x1c')]][_0xb1d1('0x24')]=utils[_0xb1d1('0x25')]();members[_0x2fc136[_0xb1d1('0x1c')]][_0xb1d1('0x26')]=utils[_0xb1d1('0x27')](members[_0x2fc136[_0xb1d1('0x1c')]]['exitAt'],members[_0x2fc136['device']][_0xb1d1('0x28')]);if(members[_0x2fc136[_0xb1d1('0x1c')]][_0xb1d1('0x7')]){writeDB(members[_0x2fc136[_0xb1d1('0x1c')]]);}}break;default:break;}}catch(_0x303cba){utils['error'](util[_0xb1d1('0x16')]('[%s][members][devicestatechange]',members[_0x2fc136[_0xb1d1('0x1c')]]?members[_0x2fc136[_0xb1d1('0x1c')]][_0xb1d1('0x7')]:_0x2fc136[_0xb1d1('0x1c')]),_0x303cba);}};exports['agentcomplete']=function(_0x27d019){try{if(!_['isNil'](members[_0x27d019[_0xb1d1('0xb')]])){utils[_0xb1d1('0x1b')](util[_0xb1d1('0x16')]('[%s][members][agentcomplete]',_0x27d019[_0xb1d1('0x7')]),_0x27d019);utils[_0xb1d1('0x5')](util[_0xb1d1('0x16')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x27d019[_0xb1d1('0x7')],_0x27d019[_0xb1d1('0xb')],_0x27d019[_0xb1d1('0x29')]));members[_0x27d019['interface']]=_[_0xb1d1('0x2a')](members[_0x27d019[_0xb1d1('0xb')]],{'data4':_0x27d019[_0xb1d1('0x29')],'uniqueid':_0x27d019[_0xb1d1('0x7')]});}}catch(_0x1bab69){utils[_0xb1d1('0x15')](util['format'](_0xb1d1('0x2b'),_0x27d019[_0xb1d1('0x7')]),_0x1bab69);}};exports['cdr']=function(_0x435671){try{utils[_0xb1d1('0x1b')](util['format']('[%s][members][cdr]',_0x435671[_0xb1d1('0x7')]),_0x435671);if(_0x435671[_0xb1d1('0x2c')]){var _0x4788e2=_0x435671[_0xb1d1('0x2c')][_0xb1d1('0x13')]('-')[0x0];if(!_['isNil'](members[_0x4788e2])){members[_0x4788e2]=_[_0xb1d1('0x2a')](members[_0x4788e2],{'data1':members[_0x4788e2][_0xb1d1('0x2d')]||_0x435671['type'],'data2':members[_0x4788e2]['data2']||_0x435671[_0xb1d1('0x2e')],'data3':members[_0x4788e2][_0xb1d1('0x2f')]||_0x435671['destination'],'uniqueid':members[_0x4788e2]['uniqueid']||_0x435671['uniqueid']});utils[_0xb1d1('0x5')](util[_0xb1d1('0x16')](_0xb1d1('0x30'),_0x435671[_0xb1d1('0x7')],members[_0x4788e2][_0xb1d1('0x2d')],members[_0x4788e2][_0xb1d1('0x8')],members[_0x4788e2][_0xb1d1('0x2f')]));if(members[_0x4788e2][_0xb1d1('0x24')]){writeDB(members[_0x4788e2]);}}}if(_0x435671['destinationchannel']){var _0x5054b6=_0x435671[_0xb1d1('0x31')][_0xb1d1('0x13')]('-')[0x0];if(!_[_0xb1d1('0x32')](members[_0x5054b6])){members[_0x5054b6]=_[_0xb1d1('0x2a')](members[_0x5054b6],{'data1':members[_0x5054b6][_0xb1d1('0x2d')]||_0x435671[_0xb1d1('0xa')],'data2':members[_0x5054b6][_0xb1d1('0x8')]||_0x435671[_0xb1d1('0x2e')],'data3':members[_0x5054b6]['data3']||_0x435671['destination'],'uniqueid':members[_0x5054b6][_0xb1d1('0x7')]||_0x435671[_0xb1d1('0x7')]});utils[_0xb1d1('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x435671[_0xb1d1('0x7')],members[_0x5054b6][_0xb1d1('0x2d')],members[_0x5054b6][_0xb1d1('0x8')],members[_0x5054b6][_0xb1d1('0x2f')]));if(members[_0x5054b6][_0xb1d1('0x24')]){writeDB(members[_0x5054b6]);}}}}catch(_0x885ab1){utils['error'](util['format'](_0xb1d1('0x33'),_0x435671[_0xb1d1('0x7')]),_0x885ab1);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 4ce5ecd..485b0d1 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 _0x526d=['transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','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','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','[%s][queues][queuecallerjoin]','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%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','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten'];(function(_0x1d96e5,_0x38fff6){var _0x345df0=function(_0x5c6b08){while(--_0x5c6b08){_0x1d96e5['push'](_0x1d96e5['shift']());}};_0x345df0(++_0x38fff6);}(_0x526d,0x198));var _0xd526=function(_0x31ffbd,_0x2b4998){_0x31ffbd=_0x31ffbd-0x0;var _0x436b5f=_0x526d[_0x31ffbd];return _0x436b5f;};'use strict';var _=require(_0xd526('0x0'));var util=require(_0xd526('0x1'));var utils=require(_0xd526('0x2'));var queues={};function writeDB(_0x4fee6a){utils[_0xd526('0x3')](util[_0xd526('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4fee6a[_0xd526('0x5')],_0x4fee6a[_0xd526('0x6')],_0x4fee6a[_0xd526('0x7')],_0x4fee6a[_0xd526('0x8')],_0x4fee6a[_0xd526('0x9')],_0x4fee6a[_0xd526('0xa')],_0x4fee6a[_0xd526('0xb')]));if(_0x4fee6a[_0xd526('0x7')]){utils[_0xd526('0xc')](_0x4fee6a[_0xd526('0x7')])[_0xd526('0xd')](function(_0x113e48){if(_0x113e48){_0x4fee6a['type']=_0x113e48['type'];}utils[_0xd526('0xe')](_0xd526('0xf'),_0x4fee6a);});}else{utils[_0xd526('0xe')](_0xd526('0xf'),_0x4fee6a);}if(_0x4fee6a[_0xd526('0x10')]){delete queues[_0x4fee6a[_0xd526('0x10')]];}else{delete queues[_0x4fee6a[_0xd526('0x5')]];}}exports[_0xd526('0x11')]=function(_0x5e4a14){try{utils['debug'](util[_0xd526('0x4')]('[%s][queues][queuecallerjoin]',_0x5e4a14[_0xd526('0x5')]),_0x5e4a14);utils[_0xd526('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x5e4a14[_0xd526('0x5')],_0x5e4a14[_0xd526('0x7')],_0x5e4a14['position']));queues[_0x5e4a14[_0xd526('0x5')]]=_[_0xd526('0x12')](_0x5e4a14,{'originalposition':_0x5e4a14[_0xd526('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x52ff5c){utils['error'](util[_0xd526('0x4')](_0xd526('0x14'),_0x5e4a14['uniqueid']),_0x52ff5c);}};exports[_0xd526('0x15')]=function(_0x261183){try{if(!_[_0xd526('0x16')](queues[_0x261183[_0xd526('0x5')]])){utils[_0xd526('0x17')](util[_0xd526('0x4')](_0xd526('0x18'),_0x261183[_0xd526('0x5')]),_0x261183);if(queues[_0x261183[_0xd526('0x5')]][_0xd526('0x19')]){if(!queues[_0x261183[_0xd526('0x5')]]['queuecallerabandon']&&!queues[_0x261183[_0xd526('0x5')]]['queuecallerexit']){queues[_0x261183[_0xd526('0x5')]][_0xd526('0x1a')]=!![];queues[_0x261183[_0xd526('0x5')]]['queuecallercompleteAt']=utils[_0xd526('0x1b')]();queues[_0x261183['uniqueid']]['queuecallerexitreason']=_0xd526('0x1c');}utils['info'](util[_0xd526('0x4')](_0xd526('0x1d'),_0x261183['uniqueid'],queues[_0x261183[_0xd526('0x5')]][_0xd526('0x1e')],queues[_0x261183[_0xd526('0x5')]][_0xd526('0xb')]));writeDB(queues[_0x261183[_0xd526('0x5')]]);}else if(queues[_0x261183[_0xd526('0x5')]][_0xd526('0x10')]){utils[_0xd526('0x3')](util[_0xd526('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x261183[_0xd526('0x5')],queues[_0x261183[_0xd526('0x5')]][_0xd526('0x1e')],queues[_0x261183[_0xd526('0x5')]][_0xd526('0x10')]));queues[queues[_0x261183['uniqueid']]['transfereduniqueid']]=queues[_0x261183['uniqueid']];queues[queues[_0x261183[_0xd526('0x5')]][_0xd526('0x10')]][_0xd526('0x1f')]=0x2;delete queues[_0x261183[_0xd526('0x5')]];}}}catch(_0x409bd1){utils[_0xd526('0x20')](util['format']('[%s][queues][hangup]',_0x261183[_0xd526('0x5')]),_0x409bd1);}};exports[_0xd526('0x21')]=function(_0x315a24){try{utils[_0xd526('0x17')](util['format'](_0xd526('0x22'),_0x315a24[_0xd526('0x5')]),_0x315a24);if(!_[_0xd526('0x16')](_0x315a24[_0xd526('0x23')]['queuestatus'])&&_0x315a24[_0xd526('0x24')][_0xd526('0x25')]()!==_0xd526('0x26')){if(!_[_0xd526('0x16')](queues[_0x315a24['uniqueid']])){queues[_0x315a24[_0xd526('0x5')]]['queuecallerabandon']=![];queues[_0x315a24['uniqueid']]['queuecallerabandonAt']=null;queues[_0x315a24[_0xd526('0x5')]][_0xd526('0x27')]=!![];queues[_0x315a24['uniqueid']]['queuecallerexitAt']=utils[_0xd526('0x1b')]();queues[_0x315a24[_0xd526('0x5')]][_0xd526('0xb')]=_0x315a24[_0xd526('0x24')][_0xd526('0x25')]();utils[_0xd526('0x3')](util[_0xd526('0x4')](_0xd526('0x28'),_0x315a24[_0xd526('0x5')],queues[_0x315a24[_0xd526('0x5')]][_0xd526('0x1e')],_0x315a24[_0xd526('0x24')],queues[_0x315a24[_0xd526('0x5')]][_0xd526('0xb')]));writeDB(queues[_0x315a24[_0xd526('0x5')]]);}}else if(!_[_0xd526('0x16')](_0x315a24[_0xd526('0x23')]['queueposition'])){if(!_[_0xd526('0x16')](queues[_0x315a24['uniqueid']])&&!queues[_0x315a24[_0xd526('0x5')]][_0xd526('0x29')]){queues[_0x315a24[_0xd526('0x5')]][_0xd526('0x29')]=![];queues[_0x315a24['uniqueid']][_0xd526('0x2a')]=null;queues[_0x315a24['uniqueid']][_0xd526('0x27')]=!![];queues[_0x315a24[_0xd526('0x5')]][_0xd526('0x2b')]=utils[_0xd526('0x1b')]();queues[_0x315a24[_0xd526('0x5')]]['queuecallerexitreason']=_0xd526('0x2c');utils[_0xd526('0x3')](util[_0xd526('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x315a24[_0xd526('0x5')],queues[_0x315a24['uniqueid']][_0xd526('0x1e')],_0x315a24[_0xd526('0x24')],queues[_0x315a24['uniqueid']][_0xd526('0xb')]));}}}catch(_0x1dd418){utils[_0xd526('0x20')](util[_0xd526('0x4')]('[%s][queues][varset]',_0x315a24['uniqueid']),_0x1dd418);}};exports['queuecallerabandon']=function(_0x358b39){try{if(!_[_0xd526('0x16')](queues[_0x358b39[_0xd526('0x5')]])){utils[_0xd526('0x17')](util['format']('[%s][queues][queuecallerabandon]',_0x358b39['uniqueid']),_0x358b39);queues[_0x358b39['uniqueid']]['queuecallerexit']=![];queues[_0x358b39[_0xd526('0x5')]][_0xd526('0x2b')]=null;queues[_0x358b39[_0xd526('0x5')]][_0xd526('0x29')]=!![];queues[_0x358b39['uniqueid']][_0xd526('0x2a')]=utils[_0xd526('0x1b')]();queues[_0x358b39[_0xd526('0x5')]]['queuecallerexitreason']=_0xd526('0x2d');utils['info'](util['format'](_0xd526('0x2e'),_0x358b39[_0xd526('0x5')],queues[_0x358b39['uniqueid']][_0xd526('0x1e')],queues[_0x358b39[_0xd526('0x5')]][_0xd526('0xb')]));}}catch(_0x5200ba){utils[_0xd526('0x20')](util[_0xd526('0x4')](_0xd526('0x2f'),_0x358b39[_0xd526('0x5')]),_0x5200ba);}};exports['queuecallerleave']=function(_0x482279){try{if(!_['isNil'](queues[_0x482279[_0xd526('0x5')]])){utils['debug'](util[_0xd526('0x4')](_0xd526('0x30'),_0x482279[_0xd526('0x5')]),_0x482279);utils['info'](util[_0xd526('0x4')](_0xd526('0x31'),_0x482279[_0xd526('0x5')],queues[_0x482279[_0xd526('0x5')]][_0xd526('0x1e')],_0x482279['connectedlinenum'],_0x482279[_0xd526('0x32')]));queues[_0x482279[_0xd526('0x5')]][_0xd526('0x33')]=!![];queues[_0x482279['uniqueid']][_0xd526('0x19')]=utils[_0xd526('0x1b')]();queues[_0x482279['uniqueid']][_0xd526('0x34')]=utils['diffTime'](queues[_0x482279[_0xd526('0x5')]][_0xd526('0x19')],queues[_0x482279[_0xd526('0x5')]][_0xd526('0x35')]);queues[_0x482279['uniqueid']]['position']=_0x482279['position'];queues[_0x482279['uniqueid']][_0xd526('0x36')]=_0x482279['count'];queues[_0x482279[_0xd526('0x5')]][_0xd526('0x37')]=_0x482279['connectedlinenum'];queues[_0x482279[_0xd526('0x5')]][_0xd526('0x32')]=_0x482279['connectedlinename'];}}catch(_0x27cc34){utils[_0xd526('0x20')](util[_0xd526('0x4')](_0xd526('0x30'),_0x482279['uniqueid']),_0x27cc34);}};exports[_0xd526('0x38')]=function(_0x50fccd){try{if(!_[_0xd526('0x16')](queues[_0x50fccd[_0xd526('0x5')]])){utils['debug'](util[_0xd526('0x4')](_0xd526('0x39'),_0x50fccd[_0xd526('0x5')]),_0x50fccd);utils[_0xd526('0x3')](util['format'](_0xd526('0x3a'),_0x50fccd[_0xd526('0x5')],queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x1e')],_0x50fccd[_0xd526('0x3b')],_0x50fccd[_0xd526('0x3c')]));queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x29')]=![];queues[_0x50fccd[_0xd526('0x5')]]['queuecallerabandon']=![];queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x2a')]=null;queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x27')]=![];queues[_0x50fccd['uniqueid']]['queuecallerexitreason']=null;queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x2b')]=null;queues[_0x50fccd[_0xd526('0x5')]]['assigned']=!![];queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0xa')]=_0x50fccd[_0xd526('0x3c')];queues[_0x50fccd[_0xd526('0x5')]][_0xd526('0x8')]=_0x50fccd['membername'];}}catch(_0x4a113e){utils[_0xd526('0x20')](util[_0xd526('0x4')](_0xd526('0x39'),_0x50fccd[_0xd526('0x5')]),_0x4a113e);}};exports[_0xd526('0x3d')]=function(_0x13eb14){try{if(!_[_0xd526('0x16')](queues[_0x13eb14['uniqueid']])){if(queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x19')]){utils[_0xd526('0x17')](util[_0xd526('0x4')](_0xd526('0x3e'),_0x13eb14[_0xd526('0x5')]),_0x13eb14);queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x29')]=![];queues[_0x13eb14['uniqueid']][_0xd526('0x29')]=![];queues[_0x13eb14[_0xd526('0x5')]]['queuecallerabandonAt']=null;queues[_0x13eb14['uniqueid']][_0xd526('0x27')]=![];queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x2b')]=null;queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x3f')]=!![];queues[_0x13eb14['uniqueid']][_0xd526('0x8')]=_0x13eb14[_0xd526('0x3b')];queues[_0x13eb14[_0xd526('0x5')]]['queuecallercomplete']=!![];queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x40')]=utils['now']();if(_0x13eb14[_0xd526('0x41')]==_0xd526('0x42')){if(!queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x42')]){queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0xb')]='TRANSFER';}}else{queues[_0x13eb14['uniqueid']][_0xd526('0xb')]='COMPLETEDBY'+_0x13eb14[_0xd526('0x41')][_0xd526('0x25')]();}utils['info'](util[_0xd526('0x4')](_0xd526('0x43'),_0x13eb14['uniqueid'],queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0x1e')],_0x13eb14[_0xd526('0x3b')],queues[_0x13eb14[_0xd526('0x5')]][_0xd526('0xb')]));writeDB(queues[_0x13eb14['uniqueid']]);}}}catch(_0x4cff5c){utils[_0xd526('0x20')](util[_0xd526('0x4')]('[%s][queues][agentcomplete]',_0x13eb14[_0xd526('0x5')]),_0x4cff5c);}};exports['blindtransfer']=function(_0x11f1de){try{if(!_[_0xd526('0x16')](queues[_0x11f1de[_0xd526('0x44')]])){utils[_0xd526('0x17')](util[_0xd526('0x4')](_0xd526('0x45'),_0x11f1de[_0xd526('0x5')]),_0x11f1de);queues[_0x11f1de['transfereeuniqueid']]['transfer']=!![];queues[_0x11f1de[_0xd526('0x44')]][_0xd526('0x46')]='BLIND';queues[_0x11f1de[_0xd526('0x44')]][_0xd526('0x47')]=_0x11f1de[_0xd526('0x48')];queues[_0x11f1de[_0xd526('0x44')]][_0xd526('0x49')]=_0x11f1de[_0xd526('0x44')];queues[_0x11f1de[_0xd526('0x44')]][_0xd526('0xb')]=_0xd526('0x4a');utils[_0xd526('0x3')](util[_0xd526('0x4')](_0xd526('0x4b'),_0x11f1de['uniqueid'],queues[_0x11f1de[_0xd526('0x44')]][_0xd526('0x1e')],_0x11f1de[_0xd526('0x44')],_0x11f1de[_0xd526('0x48')]));}}catch(_0x25e59a){utils['error'](util[_0xd526('0x4')](_0xd526('0x45'),_0x11f1de[_0xd526('0x5')]),_0x25e59a);}};exports['attendedtransfer']=function(_0xe1b895){try{utils['debug'](util[_0xd526('0x4')](_0xd526('0x4c'),_0xe1b895[_0xd526('0x4d')]),_0xe1b895);if(_0xe1b895[_0xd526('0x4d')]==_0xe1b895[_0xd526('0x4e')]){if(!_[_0xd526('0x16')](queues[_0xe1b895[_0xd526('0x4f')]])){utils[_0xd526('0x3')](util[_0xd526('0x4')](_0xd526('0x50'),_0xe1b895[_0xd526('0x4d')],queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x1e')],_0xe1b895['origtransfererexten']));queues[_0xe1b895[_0xd526('0x4f')]]['transfer']=!![];queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x46')]=_0xd526('0x51');queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x47')]=_0xe1b895[_0xd526('0x52')];queues[_0xe1b895['secondtransfererlinkedid']][_0xd526('0x49')]=_0xe1b895[_0xd526('0x4d')];queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0xb')]=_0xd526('0x53');}if(!_['isNil'](queues[_0xe1b895[_0xd526('0x4e')]])){if(_0xe1b895['transfereelinkedid']&&queues[_0xe1b895[_0xd526('0x54')]]){queues[_0xe1b895[_0xd526('0x54')]][_0xd526('0x1f')]=0x1;queues[_0xe1b895[_0xd526('0x44')]]=_[_0xd526('0x55')](queues[_0xe1b895['transfereelinkedid']]);queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x10')]=_0xe1b895[_0xd526('0x56')];queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x1f')]=0x2;queues[_0xe1b895['transfereeuniqueid']][_0xd526('0x9')]=queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x9')];queues[_0xe1b895['transfereeuniqueid']][_0xd526('0x57')]=queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x57')];queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x35')]=utils[_0xd526('0x1b')]();queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x19')]=utils[_0xd526('0x1b')]();queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x34')]=0x0;queues[_0xe1b895[_0xd526('0x44')]][_0xd526('0x58')]=0x0;utils[_0xd526('0x3')](util[_0xd526('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0xe1b895['origtransfereruniqueid'],queues[_0xe1b895[_0xd526('0x44')]]['name'],queues[_0xe1b895['transfereeuniqueid']][_0xd526('0x9')],queues[_0xe1b895['transfereeuniqueid']][_0xd526('0x57')]));}else{utils[_0xd526('0x3')](util['format'](_0xd526('0x59'),_0xe1b895[_0xd526('0x4d')],queues[_0xe1b895['origtransfererlinkedid']][_0xd526('0x1e')],_0xe1b895[_0xd526('0x4f')]));queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x10')]=_0xe1b895['secondtransfererlinkedid'];}}}else if(_0xe1b895[_0xd526('0x5a')]==_0xe1b895[_0xd526('0x4f')]){if(!_[_0xd526('0x16')](queues[_0xe1b895[_0xd526('0x4e')]])){utils[_0xd526('0x3')](util[_0xd526('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xe1b895[_0xd526('0x4d')],queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x1e')],_0xe1b895[_0xd526('0x5a')],_0xe1b895[_0xd526('0x5b')]));queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x42')]=!![];queues[_0xe1b895['origtransfererlinkedid']][_0xd526('0x46')]=_0xd526('0x51');queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x47')]=_0xe1b895[_0xd526('0x5b')];queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x49')]=_0xe1b895['secondtransfereruniqueid'];queues[_0xe1b895[_0xd526('0x4e')]]['queuecallerexitreason']=_0xd526('0x53');}if(!_[_0xd526('0x16')](queues[_0xe1b895[_0xd526('0x4f')]])){if(_0xe1b895['transfertargetlinkedid']&&queues[_0xe1b895[_0xd526('0x5c')]]){queues[_0xe1b895[_0xd526('0x5c')]][_0xd526('0x1f')]=0x1;queues[_0xe1b895['transfertargetuniqueid']]=_['clone'](queues[_0xe1b895[_0xd526('0x5c')]]);queues[_0xe1b895['transfertargetuniqueid']][_0xd526('0x10')]=_0xe1b895['transfertargetuniqueid'];queues[_0xe1b895['transfertargetuniqueid']][_0xd526('0x1f')]=0x2;queues[_0xe1b895['transfertargetuniqueid']][_0xd526('0x9')]=queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x9')];queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x57')]=queues[_0xe1b895[_0xd526('0x4e')]][_0xd526('0x57')];queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x35')]=utils['now']();queues[_0xe1b895['transfertargetuniqueid']][_0xd526('0x19')]=utils[_0xd526('0x1b')]();queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x34')]=0x0;queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x58')]=0x0;utils[_0xd526('0x3')](util['format'](_0xd526('0x5d'),_0xe1b895[_0xd526('0x4d')],queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x1e')],queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x10')],queues[_0xe1b895['transfertargetuniqueid']][_0xd526('0x9')],queues[_0xe1b895[_0xd526('0x56')]][_0xd526('0x57')]));}else{utils['info'](util[_0xd526('0x4')](_0xd526('0x59'),_0xe1b895[_0xd526('0x4d')],queues[_0xe1b895[_0xd526('0x4f')]][_0xd526('0x1e')],_0xe1b895[_0xd526('0x4e')]));queues[_0xe1b895[_0xd526('0x4f')]]['transfereduniqueid']=_0xe1b895[_0xd526('0x4e')];}}}}catch(_0xb6208a){utils['error'](util[_0xd526('0x4')]('[%s][queues][attendedtransfer]',_0xe1b895[_0xd526('0x4d')]),_0xb6208a);}};exports[_0xd526('0x5e')]=function(_0x332592){try{if(!_[_0xd526('0x16')](queues[_0x332592[_0xd526('0x5')]])){utils[_0xd526('0x17')](util[_0xd526('0x4')]('[%s][queues][musiconholdstart]',_0x332592[_0xd526('0x5')]),_0x332592);queues[_0x332592[_0xd526('0x5')]][_0xd526('0x5f')]=utils[_0xd526('0x1b')]();utils[_0xd526('0x3')](util[_0xd526('0x4')](_0xd526('0x60'),_0x332592[_0xd526('0x5')],queues[_0x332592[_0xd526('0x5')]][_0xd526('0x1e')],queues[_0x332592[_0xd526('0x5')]][_0xd526('0x5f')]));}}catch(_0x4303b5){utils[_0xd526('0x20')](util[_0xd526('0x4')]('[%s][queues][musiconholdstart]',_0x332592[_0xd526('0x5')]),_0x4303b5);}};exports[_0xd526('0x61')]=function(_0x17a78d){try{if(!_[_0xd526('0x16')](queues[_0x17a78d[_0xd526('0x5')]])){if(!_[_0xd526('0x16')](queues[_0x17a78d[_0xd526('0x5')]][_0xd526('0x5f')])){utils[_0xd526('0x17')](util[_0xd526('0x4')](_0xd526('0x62'),_0x17a78d[_0xd526('0x5')]),_0x17a78d);queues[_0x17a78d['uniqueid']][_0xd526('0x58')]+=utils['diffTime'](utils[_0xd526('0x1b')](),queues[_0x17a78d[_0xd526('0x5')]][_0xd526('0x5f')]);utils[_0xd526('0x3')](util[_0xd526('0x4')](_0xd526('0x63'),_0x17a78d[_0xd526('0x5')],queues[_0x17a78d[_0xd526('0x5')]][_0xd526('0x1e')],queues[_0x17a78d['uniqueid']]['mohtime']));delete queues[_0x17a78d[_0xd526('0x5')]][_0xd526('0x5f')];}}}catch(_0x83e256){utils['error'](util[_0xd526('0x4')]('[%s][queues][musiconholdstop]',_0x17a78d[_0xd526('0x5')]),_0x83e256);}}; \ No newline at end of file +var _0x5cd2=['TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstartAt','[%s][queues][musiconholdstart]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','varset','variable','value','toUpperCase','CONTINUE','isNil','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerjoinAt','[%s][queues][agentconnect]','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','lastAssignedTo','queuecallercompleteAt','reason','transfer'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x5cd2,0x1b0));var _0x25cd=function(_0x2ae51c,_0x35ee1b){_0x2ae51c=_0x2ae51c-0x0;var _0x27df57=_0x5cd2[_0x2ae51c];return _0x27df57;};'use strict';var _=require(_0x25cd('0x0'));var util=require(_0x25cd('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x4c97e5){utils['info'](util[_0x25cd('0x2')](_0x25cd('0x3'),_0x4c97e5[_0x25cd('0x4')],_0x4c97e5[_0x25cd('0x5')],_0x4c97e5[_0x25cd('0x6')],_0x4c97e5['lastAssignedTo'],_0x4c97e5['calleridnum'],_0x4c97e5[_0x25cd('0x7')],_0x4c97e5[_0x25cd('0x8')]));if(_0x4c97e5[_0x25cd('0x6')]){utils['getVoiceQueueByName'](_0x4c97e5[_0x25cd('0x6')])[_0x25cd('0x9')](function(_0x1fc96f){if(_0x1fc96f){_0x4c97e5[_0x25cd('0xa')]=_0x1fc96f[_0x25cd('0xa')];}utils['request']('CreateVoiceQueueReport',_0x4c97e5);});}else{utils[_0x25cd('0xb')](_0x25cd('0xc'),_0x4c97e5);}if(_0x4c97e5[_0x25cd('0xd')]){delete queues[_0x4c97e5[_0x25cd('0xd')]];}else{delete queues[_0x4c97e5[_0x25cd('0x4')]];}}exports[_0x25cd('0xe')]=function(_0x50531d){try{utils['debug'](util[_0x25cd('0x2')](_0x25cd('0xf'),_0x50531d[_0x25cd('0x4')]),_0x50531d);utils['info'](util[_0x25cd('0x2')](_0x25cd('0x10'),_0x50531d[_0x25cd('0x4')],_0x50531d[_0x25cd('0x6')],_0x50531d[_0x25cd('0x11')]));queues[_0x50531d[_0x25cd('0x4')]]=_[_0x25cd('0x12')](_0x50531d,{'originalposition':_0x50531d['position'],'queuecallerjoinAt':utils[_0x25cd('0x13')](),'mohtime':0x0});}catch(_0x14322b){utils[_0x25cd('0x14')](util['format'](_0x25cd('0xf'),_0x50531d[_0x25cd('0x4')]),_0x14322b);}};exports[_0x25cd('0x15')]=function(_0x2f39b8){try{if(!_['isNil'](queues[_0x2f39b8['uniqueid']])){utils[_0x25cd('0x16')](util['format'](_0x25cd('0x17'),_0x2f39b8[_0x25cd('0x4')]),_0x2f39b8);if(queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0x18')]){if(!queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0x19')]&&!queues[_0x2f39b8['uniqueid']][_0x25cd('0x1a')]){queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0x1b')]=!![];queues[_0x2f39b8[_0x25cd('0x4')]]['queuecallercompleteAt']=utils[_0x25cd('0x13')]();queues[_0x2f39b8['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x25cd('0x1c')](util['format'](_0x25cd('0x1d'),_0x2f39b8[_0x25cd('0x4')],queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0x1e')],queues[_0x2f39b8[_0x25cd('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x2f39b8[_0x25cd('0x4')]]);}else if(queues[_0x2f39b8['uniqueid']][_0x25cd('0xd')]){utils[_0x25cd('0x1c')](util[_0x25cd('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2f39b8[_0x25cd('0x4')],queues[_0x2f39b8['uniqueid']][_0x25cd('0x1e')],queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0xd')]));queues[queues[_0x2f39b8[_0x25cd('0x4')]][_0x25cd('0xd')]]=queues[_0x2f39b8[_0x25cd('0x4')]];queues[queues[_0x2f39b8[_0x25cd('0x4')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x2f39b8['uniqueid']];}}}catch(_0x231f83){utils['error'](util[_0x25cd('0x2')](_0x25cd('0x17'),_0x2f39b8[_0x25cd('0x4')]),_0x231f83);}};exports[_0x25cd('0x1f')]=function(_0x562eb9){try{utils[_0x25cd('0x16')](util[_0x25cd('0x2')]('[%s][queues][varset]',_0x562eb9[_0x25cd('0x4')]),_0x562eb9);if(!_['isNil'](_0x562eb9[_0x25cd('0x20')]['queuestatus'])&&_0x562eb9[_0x25cd('0x21')][_0x25cd('0x22')]()!==_0x25cd('0x23')){if(!_[_0x25cd('0x24')](queues[_0x562eb9['uniqueid']])){queues[_0x562eb9[_0x25cd('0x4')]]['queuecallerabandon']=![];queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x25')]=null;queues[_0x562eb9['uniqueid']][_0x25cd('0x1a')]=!![];queues[_0x562eb9[_0x25cd('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x8')]=_0x562eb9[_0x25cd('0x21')][_0x25cd('0x22')]();utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x26'),_0x562eb9['uniqueid'],queues[_0x562eb9['uniqueid']][_0x25cd('0x1e')],_0x562eb9[_0x25cd('0x21')],queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x8')]));writeDB(queues[_0x562eb9['uniqueid']]);}}else if(!_[_0x25cd('0x24')](_0x562eb9[_0x25cd('0x20')][_0x25cd('0x27')])){if(!_[_0x25cd('0x24')](queues[_0x562eb9[_0x25cd('0x4')]])&&!queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x19')]){queues[_0x562eb9[_0x25cd('0x4')]]['queuecallerabandon']=![];queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x25')]=null;queues[_0x562eb9['uniqueid']][_0x25cd('0x1a')]=!![];queues[_0x562eb9['uniqueid']][_0x25cd('0x28')]=utils['now']();queues[_0x562eb9['uniqueid']][_0x25cd('0x8')]='EXITWITHKEY';utils[_0x25cd('0x1c')](util[_0x25cd('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x562eb9['uniqueid'],queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x1e')],_0x562eb9[_0x25cd('0x21')],queues[_0x562eb9[_0x25cd('0x4')]][_0x25cd('0x8')]));}}}catch(_0x35b47c){utils[_0x25cd('0x14')](util['format']('[%s][queues][varset]',_0x562eb9[_0x25cd('0x4')]),_0x35b47c);}};exports[_0x25cd('0x19')]=function(_0x5b1701){try{if(!_['isNil'](queues[_0x5b1701[_0x25cd('0x4')]])){utils['debug'](util['format']('[%s][queues][queuecallerabandon]',_0x5b1701[_0x25cd('0x4')]),_0x5b1701);queues[_0x5b1701['uniqueid']][_0x25cd('0x1a')]=![];queues[_0x5b1701[_0x25cd('0x4')]][_0x25cd('0x28')]=null;queues[_0x5b1701[_0x25cd('0x4')]]['queuecallerabandon']=!![];queues[_0x5b1701[_0x25cd('0x4')]][_0x25cd('0x25')]=utils['now']();queues[_0x5b1701[_0x25cd('0x4')]]['queuecallerexitreason']=_0x25cd('0x29');utils[_0x25cd('0x1c')](util[_0x25cd('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x5b1701['uniqueid'],queues[_0x5b1701[_0x25cd('0x4')]][_0x25cd('0x1e')],queues[_0x5b1701[_0x25cd('0x4')]][_0x25cd('0x8')]));}}catch(_0x1137c9){utils['error'](util['format']('[%s][queues][queuecallerabandon]',_0x5b1701[_0x25cd('0x4')]),_0x1137c9);}};exports[_0x25cd('0x2a')]=function(_0x130115){try{if(!_[_0x25cd('0x24')](queues[_0x130115[_0x25cd('0x4')]])){utils[_0x25cd('0x16')](util[_0x25cd('0x2')](_0x25cd('0x2b'),_0x130115[_0x25cd('0x4')]),_0x130115);utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x2c'),_0x130115['uniqueid'],queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x1e')],_0x130115[_0x25cd('0x2d')],_0x130115[_0x25cd('0x2e')]));queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x2a')]=!![];queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x18')]=utils[_0x25cd('0x13')]();queues[_0x130115['uniqueid']]['holdtime']=utils['diffTime'](queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x18')],queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x2f')]);queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x11')]=_0x130115[_0x25cd('0x11')];queues[_0x130115['uniqueid']]['count']=_0x130115['count'];queues[_0x130115[_0x25cd('0x4')]][_0x25cd('0x2d')]=_0x130115[_0x25cd('0x2d')];queues[_0x130115[_0x25cd('0x4')]]['connectedlinename']=_0x130115[_0x25cd('0x2e')];}}catch(_0x4be0b8){utils[_0x25cd('0x14')](util['format']('[%s][queues][queuecallerleave]',_0x130115[_0x25cd('0x4')]),_0x4be0b8);}};exports['agentconnect']=function(_0x1e2fb5){try{if(!_[_0x25cd('0x24')](queues[_0x1e2fb5['uniqueid']])){utils['debug'](util[_0x25cd('0x2')](_0x25cd('0x30'),_0x1e2fb5[_0x25cd('0x4')]),_0x1e2fb5);utils[_0x25cd('0x1c')](util[_0x25cd('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1e2fb5[_0x25cd('0x4')],queues[_0x1e2fb5[_0x25cd('0x4')]]['name'],_0x1e2fb5[_0x25cd('0x31')],_0x1e2fb5[_0x25cd('0x32')]));queues[_0x1e2fb5[_0x25cd('0x4')]]['queuecallerabandon']=![];queues[_0x1e2fb5['uniqueid']][_0x25cd('0x19')]=![];queues[_0x1e2fb5[_0x25cd('0x4')]][_0x25cd('0x25')]=null;queues[_0x1e2fb5['uniqueid']][_0x25cd('0x1a')]=![];queues[_0x1e2fb5[_0x25cd('0x4')]][_0x25cd('0x8')]=null;queues[_0x1e2fb5[_0x25cd('0x4')]][_0x25cd('0x28')]=null;queues[_0x1e2fb5[_0x25cd('0x4')]]['assigned']=!![];queues[_0x1e2fb5['uniqueid']][_0x25cd('0x7')]=_0x1e2fb5[_0x25cd('0x32')];queues[_0x1e2fb5[_0x25cd('0x4')]]['lastAssignedTo']=_0x1e2fb5[_0x25cd('0x31')];}}catch(_0x21ae2d){utils[_0x25cd('0x14')](util[_0x25cd('0x2')](_0x25cd('0x30'),_0x1e2fb5[_0x25cd('0x4')]),_0x21ae2d);}};exports[_0x25cd('0x33')]=function(_0x1a77a0){try{if(!_['isNil'](queues[_0x1a77a0[_0x25cd('0x4')]])){if(queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x18')]){utils[_0x25cd('0x16')](util[_0x25cd('0x2')](_0x25cd('0x34'),_0x1a77a0[_0x25cd('0x4')]),_0x1a77a0);queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x19')]=![];queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x19')]=![];queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x25')]=null;queues[_0x1a77a0[_0x25cd('0x4')]]['queuecallerexit']=![];queues[_0x1a77a0['uniqueid']]['queuecallerexitAt']=null;queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x35')]=!![];queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x36')]=_0x1a77a0[_0x25cd('0x31')];queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x1b')]=!![];queues[_0x1a77a0['uniqueid']][_0x25cd('0x37')]=utils[_0x25cd('0x13')]();if(_0x1a77a0[_0x25cd('0x38')]==_0x25cd('0x39')){if(!queues[_0x1a77a0['uniqueid']][_0x25cd('0x39')]){queues[_0x1a77a0['uniqueid']][_0x25cd('0x8')]=_0x25cd('0x3a');}}else{queues[_0x1a77a0['uniqueid']]['queuecallerexitreason']=_0x25cd('0x3b')+_0x1a77a0[_0x25cd('0x38')]['toUpperCase']();}utils['info'](util[_0x25cd('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1a77a0['uniqueid'],queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x1e')],_0x1a77a0['membername'],queues[_0x1a77a0[_0x25cd('0x4')]][_0x25cd('0x8')]));writeDB(queues[_0x1a77a0['uniqueid']]);}}}catch(_0x16bd65){utils[_0x25cd('0x14')](util[_0x25cd('0x2')](_0x25cd('0x34'),_0x1a77a0[_0x25cd('0x4')]),_0x16bd65);}};exports[_0x25cd('0x3c')]=function(_0x14a00e){try{if(!_[_0x25cd('0x24')](queues[_0x14a00e[_0x25cd('0x3d')]])){utils[_0x25cd('0x16')](util[_0x25cd('0x2')](_0x25cd('0x3e'),_0x14a00e[_0x25cd('0x4')]),_0x14a00e);queues[_0x14a00e[_0x25cd('0x3d')]][_0x25cd('0x39')]=!![];queues[_0x14a00e[_0x25cd('0x3d')]][_0x25cd('0x3f')]=_0x25cd('0x40');queues[_0x14a00e[_0x25cd('0x3d')]][_0x25cd('0x41')]=_0x14a00e[_0x25cd('0x42')];queues[_0x14a00e[_0x25cd('0x3d')]]['transferuniqueid']=_0x14a00e[_0x25cd('0x3d')];queues[_0x14a00e[_0x25cd('0x3d')]][_0x25cd('0x8')]=_0x25cd('0x43');utils['info'](util['format'](_0x25cd('0x44'),_0x14a00e[_0x25cd('0x4')],queues[_0x14a00e['transfereeuniqueid']]['name'],_0x14a00e['transfereeuniqueid'],_0x14a00e[_0x25cd('0x42')]));}}catch(_0x424850){utils[_0x25cd('0x14')](util[_0x25cd('0x2')]('[%s][queues][blindtransfer]',_0x14a00e[_0x25cd('0x4')]),_0x424850);}};exports[_0x25cd('0x45')]=function(_0x19587d){try{utils['debug'](util['format']('[%s][queues][attendedtransfer]',_0x19587d[_0x25cd('0x46')]),_0x19587d);if(_0x19587d[_0x25cd('0x46')]==_0x19587d[_0x25cd('0x47')]){if(!_['isNil'](queues[_0x19587d['secondtransfererlinkedid']])){utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x48'),_0x19587d['origtransfereruniqueid'],queues[_0x19587d[_0x25cd('0x49')]]['name'],_0x19587d[_0x25cd('0x4a')]));queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x39')]=!![];queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x3f')]=_0x25cd('0x4b');queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x41')]=_0x19587d[_0x25cd('0x4a')];queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x4c')]=_0x19587d[_0x25cd('0x46')];queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x8')]=_0x25cd('0x4d');}if(!_[_0x25cd('0x24')](queues[_0x19587d[_0x25cd('0x47')]])){if(_0x19587d[_0x25cd('0x4e')]&&queues[_0x19587d[_0x25cd('0x4e')]]){queues[_0x19587d[_0x25cd('0x4e')]][_0x25cd('0x4f')]=0x1;queues[_0x19587d[_0x25cd('0x3d')]]=_[_0x25cd('0x50')](queues[_0x19587d[_0x25cd('0x4e')]]);queues[_0x19587d[_0x25cd('0x3d')]][_0x25cd('0xd')]=_0x19587d[_0x25cd('0x51')];queues[_0x19587d['transfereeuniqueid']][_0x25cd('0x4f')]=0x2;queues[_0x19587d['transfereeuniqueid']][_0x25cd('0x52')]=queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x52')];queues[_0x19587d[_0x25cd('0x3d')]]['calleridname']=queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x53')];queues[_0x19587d['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x25cd('0x13')]();queues[_0x19587d[_0x25cd('0x3d')]][_0x25cd('0x18')]=utils[_0x25cd('0x13')]();queues[_0x19587d[_0x25cd('0x3d')]][_0x25cd('0x54')]=0x0;queues[_0x19587d[_0x25cd('0x3d')]]['mohtime']=0x0;utils['info'](util[_0x25cd('0x2')](_0x25cd('0x55'),_0x19587d[_0x25cd('0x46')],queues[_0x19587d[_0x25cd('0x3d')]][_0x25cd('0x1e')],queues[_0x19587d[_0x25cd('0x3d')]]['calleridnum'],queues[_0x19587d['transfereeuniqueid']][_0x25cd('0x53')]));}else{utils[_0x25cd('0x1c')](util[_0x25cd('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x19587d[_0x25cd('0x46')],queues[_0x19587d[_0x25cd('0x47')]]['name'],_0x19587d[_0x25cd('0x49')]));queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0xd')]=_0x19587d[_0x25cd('0x49')];}}}else if(_0x19587d[_0x25cd('0x56')]==_0x19587d[_0x25cd('0x49')]){if(!_[_0x25cd('0x24')](queues[_0x19587d[_0x25cd('0x47')]])){utils[_0x25cd('0x1c')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x19587d[_0x25cd('0x46')],queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0x1e')],_0x19587d[_0x25cd('0x56')],_0x19587d[_0x25cd('0x57')]));queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0x39')]=!![];queues[_0x19587d[_0x25cd('0x47')]]['transfertype']=_0x25cd('0x4b');queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0x41')]=_0x19587d[_0x25cd('0x57')];queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0x4c')]=_0x19587d['secondtransfereruniqueid'];queues[_0x19587d['origtransfererlinkedid']][_0x25cd('0x8')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x19587d[_0x25cd('0x49')]])){if(_0x19587d[_0x25cd('0x58')]&&queues[_0x19587d[_0x25cd('0x58')]]){queues[_0x19587d[_0x25cd('0x58')]]['queuecallerenterreason']=0x1;queues[_0x19587d[_0x25cd('0x51')]]=_[_0x25cd('0x50')](queues[_0x19587d[_0x25cd('0x58')]]);queues[_0x19587d[_0x25cd('0x51')]][_0x25cd('0xd')]=_0x19587d[_0x25cd('0x51')];queues[_0x19587d[_0x25cd('0x51')]][_0x25cd('0x4f')]=0x2;queues[_0x19587d[_0x25cd('0x51')]][_0x25cd('0x52')]=queues[_0x19587d['origtransfererlinkedid']]['calleridnum'];queues[_0x19587d['transfertargetuniqueid']]['calleridname']=queues[_0x19587d[_0x25cd('0x47')]][_0x25cd('0x53')];queues[_0x19587d['transfertargetuniqueid']][_0x25cd('0x2f')]=utils[_0x25cd('0x13')]();queues[_0x19587d['transfertargetuniqueid']][_0x25cd('0x18')]=utils[_0x25cd('0x13')]();queues[_0x19587d['transfertargetuniqueid']][_0x25cd('0x54')]=0x0;queues[_0x19587d[_0x25cd('0x51')]][_0x25cd('0x59')]=0x0;utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x5a'),_0x19587d['origtransfereruniqueid'],queues[_0x19587d[_0x25cd('0x51')]]['name'],queues[_0x19587d['transfertargetuniqueid']][_0x25cd('0xd')],queues[_0x19587d['transfertargetuniqueid']]['calleridnum'],queues[_0x19587d[_0x25cd('0x51')]]['calleridname']));}else{utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x5b'),_0x19587d[_0x25cd('0x46')],queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0x1e')],_0x19587d['origtransfererlinkedid']));queues[_0x19587d[_0x25cd('0x49')]][_0x25cd('0xd')]=_0x19587d['origtransfererlinkedid'];}}}}catch(_0x514809){utils['error'](util[_0x25cd('0x2')](_0x25cd('0x5c'),_0x19587d[_0x25cd('0x46')]),_0x514809);}};exports['musiconholdstart']=function(_0x11db35){try{if(!_[_0x25cd('0x24')](queues[_0x11db35[_0x25cd('0x4')]])){utils[_0x25cd('0x16')](util[_0x25cd('0x2')]('[%s][queues][musiconholdstart]',_0x11db35[_0x25cd('0x4')]),_0x11db35);queues[_0x11db35[_0x25cd('0x4')]][_0x25cd('0x5d')]=utils[_0x25cd('0x13')]();utils[_0x25cd('0x1c')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x11db35[_0x25cd('0x4')],queues[_0x11db35[_0x25cd('0x4')]][_0x25cd('0x1e')],queues[_0x11db35[_0x25cd('0x4')]]['musiconholdstartAt']));}}catch(_0x227b1a){utils['error'](util['format'](_0x25cd('0x5e'),_0x11db35[_0x25cd('0x4')]),_0x227b1a);}};exports['musiconholdstop']=function(_0x109bad){try{if(!_['isNil'](queues[_0x109bad[_0x25cd('0x4')]])){if(!_[_0x25cd('0x24')](queues[_0x109bad[_0x25cd('0x4')]][_0x25cd('0x5d')])){utils[_0x25cd('0x16')](util['format']('[%s][queues][musiconholdstop]',_0x109bad[_0x25cd('0x4')]),_0x109bad);queues[_0x109bad[_0x25cd('0x4')]]['mohtime']+=utils[_0x25cd('0x5f')](utils[_0x25cd('0x13')](),queues[_0x109bad[_0x25cd('0x4')]][_0x25cd('0x5d')]);utils[_0x25cd('0x1c')](util[_0x25cd('0x2')](_0x25cd('0x60'),_0x109bad['uniqueid'],queues[_0x109bad['uniqueid']][_0x25cd('0x1e')],queues[_0x109bad[_0x25cd('0x4')]]['mohtime']));delete queues[_0x109bad['uniqueid']]['musiconholdstartAt'];}}}catch(_0x25e573){utils[_0x25cd('0x14')](util[_0x25cd('0x2')](_0x25cd('0x61'),_0x109bad['uniqueid']),_0x25e573);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 3c8e65d..c7938ca 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 _0x13f4=['request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','error','channelstate','context','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name'];(function(_0x4d4a06,_0x30289a){var _0x1dbcd8=function(_0x30ed6e){while(--_0x30ed6e){_0x4d4a06['push'](_0x4d4a06['shift']());}};_0x1dbcd8(++_0x30289a);}(_0x13f4,0x6b));var _0x413f=function(_0x4d183d,_0x123de0){_0x4d183d=_0x4d183d-0x0;var _0x431236=_0x13f4[_0x4d183d];return _0x431236;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x413f('0x0'));var recordings={};function writeDB(_0x20efc8){utils[_0x413f('0x1')](util[_0x413f('0x2')](_0x413f('0x3'),_0x20efc8[_0x413f('0x4')]));if(_0x20efc8[_0x413f('0x5')]){utils['getUserByInternal'](_0x20efc8[_0x413f('0x5')])[_0x413f('0x6')](function(_0x5f4c74){if(_0x5f4c74){_0x20efc8[_0x413f('0x7')]=_0x5f4c74[_0x413f('0x8')];_0x20efc8['UserId']=_0x5f4c74['id'];}utils[_0x413f('0x9')](_0x413f('0xa'),_0x20efc8);});}else{utils[_0x413f('0x9')](_0x413f('0xa'),_0x20efc8);}}exports[_0x413f('0xb')]=function(_0x15400a){try{utils[_0x413f('0xc')](util[_0x413f('0x2')](_0x413f('0xd'),_0x15400a[_0x413f('0x4')]),_0x15400a);if(_0x15400a[_0x413f('0x4')]==_0x15400a[_0x413f('0xe')]){utils[_0x413f('0x1')](util['format'](_0x413f('0xf'),_0x15400a[_0x413f('0x4')],_0x15400a['context'],_0x15400a[_0x413f('0x10')]));recordings[_0x15400a[_0x413f('0x4')]]={'uniqueid':_0x15400a[_0x413f('0x4')],'accountcode':_0x15400a[_0x413f('0x5')],'exten':_0x15400a[_0x413f('0x10')],'context':_0x15400a['context'],'channel':_0x15400a['channel'],'monitors':[]};}}catch(_0x6b7f52){utils[_0x413f('0x11')](util[_0x413f('0x2')](_0x413f('0xd'),_0x15400a[_0x413f('0x4')]),_0x6b7f52);}};exports['newstate']=function(_0x3ac16b){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x3ac16b['uniqueid']),_0x3ac16b);if(!_['isNil'](recordings[_0x3ac16b[_0x413f('0x4')]])&&_0x3ac16b[_0x413f('0x12')]==0x6){utils[_0x413f('0x1')](util[_0x413f('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3ac16b[_0x413f('0x4')],_0x3ac16b[_0x413f('0x13')],_0x3ac16b[_0x413f('0x14')]));}else if(!_['isNil'](recordings[_0x3ac16b[_0x413f('0xe')]])&&_0x3ac16b[_0x413f('0x12')]==0x6&&_0x3ac16b[_0x413f('0x13')]!=_0x413f('0x15')){utils['info'](util[_0x413f('0x2')](_0x413f('0x16'),_0x3ac16b[_0x413f('0x4')],_0x3ac16b[_0x413f('0xe')],_0x3ac16b[_0x413f('0x13')],_0x3ac16b['channel']));recordings[_0x3ac16b[_0x413f('0xe')]][_0x413f('0x5')]=_0x3ac16b[_0x413f('0x5')];}}catch(_0x4acc01){utils[_0x413f('0x11')](util[_0x413f('0x2')](_0x413f('0x17'),_0x3ac16b['uniqueid']),_0x4acc01);}};exports['varset']=function(_0x4021b3){try{if(!_[_0x413f('0x18')](_0x4021b3[_0x413f('0x19')])&&!_[_0x413f('0x18')](_0x4021b3[_0x413f('0x19')][_0x413f('0x1a')])){utils[_0x413f('0xc')](util[_0x413f('0x2')](_0x413f('0x1b'),_0x4021b3['uniqueid']),_0x4021b3);utils[_0x413f('0x1')](util[_0x413f('0x2')](_0x413f('0x1c'),_0x4021b3[_0x413f('0x4')],_0x4021b3['variable'],_0x4021b3[_0x413f('0x1d')]));if(_[_0x413f('0x1e')](_0x4021b3[_0x413f('0x1d')],'.wav49')){_0x4021b3[_0x413f('0x1d')]=_0x4021b3[_0x413f('0x1d')][_0x413f('0x1f')](_0x413f('0x20'),_0x413f('0x21'));}if(recordings[_0x4021b3[_0x413f('0xe')]]){var _0x167ced=_[_0x413f('0x22')](recordings[_0x4021b3[_0x413f('0xe')]][_0x413f('0x23')],{'value':_0x4021b3[_0x413f('0x1d')]});if(_['isNil'](_0x167ced)){recordings[_0x4021b3[_0x413f('0xe')]]['monitors'][_0x413f('0x24')]({'value':_0x4021b3[_0x413f('0x1d')]});}}}}catch(_0x52850d){utils['error'](util[_0x413f('0x2')]('[%s][recordings][varset]',_0x4021b3[_0x413f('0x4')]),_0x52850d);}};exports['hangup']=function(_0x42da6c){try{if(!_[_0x413f('0x18')](recordings[_0x42da6c['uniqueid']])){utils[_0x413f('0xc')](util[_0x413f('0x2')](_0x413f('0x25'),_0x42da6c[_0x413f('0x4')]),_0x42da6c);utils[_0x413f('0x1')](util[_0x413f('0x2')](_0x413f('0x26'),_0x42da6c[_0x413f('0x4')],_0x42da6c[_0x413f('0x27')],_0x42da6c[_0x413f('0x28')],_0x42da6c['cause-txt']));recordings[_0x42da6c[_0x413f('0x4')]][_0x413f('0x27')]=_0x42da6c[_0x413f('0x27')];recordings[_0x42da6c[_0x413f('0x4')]][_0x413f('0x28')]=_0x42da6c['calleridname'];recordings[_0x42da6c[_0x413f('0x4')]]['connectedlinenum']=_0x42da6c[_0x413f('0x29')];recordings[_0x42da6c['uniqueid']][_0x413f('0x2a')]=_0x42da6c[_0x413f('0x2a')];if(recordings[_0x42da6c['uniqueid']]['type']==_0x413f('0x2b')&&recordings[_0x42da6c['uniqueid']][_0x413f('0x5')]){recordings[_0x42da6c[_0x413f('0x4')]][_0x413f('0x29')]=recordings[_0x42da6c[_0x413f('0x4')]][_0x413f('0x5')];recordings[_0x42da6c[_0x413f('0x4')]][_0x413f('0x2a')]='';}recordings[_0x42da6c['uniqueid']][_0x413f('0x23')]['forEach'](function(_0x51d4da){var _0x4db0b6=_['clone'](recordings[_0x42da6c[_0x413f('0x4')]]);_0x4db0b6['value']=_0x51d4da[_0x413f('0x1d')];writeDB(_0x4db0b6);});delete recordings[_0x42da6c['uniqueid']];}}catch(_0x9c1712){utils[_0x413f('0x11')](util[_0x413f('0x2')]('[%s][recordings][hangup]',_0x42da6c['uniqueid']),_0x9c1712);}};exports[_0x413f('0x2c')]=function(_0x599c69){try{if(!_[_0x413f('0x18')](recordings[_0x599c69[_0x413f('0x4')]])){utils[_0x413f('0xc')](util[_0x413f('0x2')]('[%s][recordings][newexten]',_0x599c69[_0x413f('0x4')]),_0x599c69);utils[_0x413f('0x1')](util[_0x413f('0x2')](_0x413f('0x2d'),_0x599c69[_0x413f('0x4')],_0x599c69['application'],_0x599c69[_0x413f('0x2e')]));if(_0x599c69[_0x413f('0x2f')][_0x413f('0x30')]()=='set'&&_[_0x413f('0x31')](_0x599c69['appdata'][_0x413f('0x30')](),_0x413f('0x32'))){var _0x1a8621=_0x599c69[_0x413f('0x2e')][_0x413f('0x33')]('=');var _0x541174=_0x1a8621[0x0][_0x413f('0x34')](_0x1a8621[0x0][_0x413f('0x35')]('(')+0x1,_0x1a8621[0x0][_0x413f('0x35')](')'));var _0x5b63f7=_0x1a8621[0x1];recordings[_0x599c69[_0x413f('0x4')]][_0x541174]=_0x5b63f7;}}}catch(_0x1f74ae){utils[_0x413f('0x11')](util[_0x413f('0x2')]('[%s][recordings][newexten]',_0x599c69[_0x413f('0x4')]),_0x1f74ae);}};exports[_0x413f('0x36')]=function(_0x2cea3d){try{if(!_[_0x413f('0x18')](recordings[_0x2cea3d['uniqueid']])){utils[_0x413f('0xc')](util[_0x413f('0x2')]('[%s][recordings][queuecallerjoin]',_0x2cea3d[_0x413f('0x4')]),_0x2cea3d);utils[_0x413f('0x1')](util[_0x413f('0x2')](_0x413f('0x37'),_0x2cea3d[_0x413f('0x4')],_0x2cea3d[_0x413f('0x38')]));recordings[_0x2cea3d[_0x413f('0x4')]][_0x413f('0x38')]=_0x2cea3d[_0x413f('0x38')];}}catch(_0x3e1e6e){utils[_0x413f('0x11')](util[_0x413f('0x2')](_0x413f('0x39'),_0x2cea3d[_0x413f('0x4')]),_0x3e1e6e);}}; \ No newline at end of file +var _0xfb93=['.WAV','find','monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','format','context','exten','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith'];(function(_0x409a1,_0x2742ca){var _0x7dcf8c=function(_0x519b45){while(--_0x519b45){_0x409a1['push'](_0x409a1['shift']());}};_0x7dcf8c(++_0x2742ca);}(_0xfb93,0x118));var _0x3fb9=function(_0x52f59a,_0x12276b){_0x52f59a=_0x52f59a-0x0;var _0x3183c6=_0xfb93[_0x52f59a];return _0x3183c6;};'use strict';var _=require(_0x3fb9('0x0'));var util=require(_0x3fb9('0x1'));var utils=require(_0x3fb9('0x2'));var recordings={};function writeDB(_0x6be07){utils[_0x3fb9('0x3')](util['format'](_0x3fb9('0x4'),_0x6be07[_0x3fb9('0x5')]));if(_0x6be07[_0x3fb9('0x6')]){utils[_0x3fb9('0x7')](_0x6be07['accountcode'])[_0x3fb9('0x8')](function(_0x1228b1){if(_0x1228b1){_0x6be07[_0x3fb9('0x9')]=_0x1228b1['name'];_0x6be07[_0x3fb9('0xa')]=_0x1228b1['id'];}utils[_0x3fb9('0xb')](_0x3fb9('0xc'),_0x6be07);});}else{utils['request']('CreateVoiceRecording',_0x6be07);}}exports[_0x3fb9('0xd')]=function(_0x3eb1f2){try{utils[_0x3fb9('0xe')](util['format'](_0x3fb9('0xf'),_0x3eb1f2[_0x3fb9('0x5')]),_0x3eb1f2);if(_0x3eb1f2[_0x3fb9('0x5')]==_0x3eb1f2[_0x3fb9('0x10')]){utils[_0x3fb9('0x3')](util[_0x3fb9('0x11')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3eb1f2[_0x3fb9('0x5')],_0x3eb1f2[_0x3fb9('0x12')],_0x3eb1f2[_0x3fb9('0x13')]));recordings[_0x3eb1f2[_0x3fb9('0x5')]]={'uniqueid':_0x3eb1f2[_0x3fb9('0x5')],'accountcode':_0x3eb1f2[_0x3fb9('0x6')],'exten':_0x3eb1f2[_0x3fb9('0x13')],'context':_0x3eb1f2[_0x3fb9('0x12')],'channel':_0x3eb1f2[_0x3fb9('0x14')],'monitors':[]};}}catch(_0x369d8d){utils[_0x3fb9('0x15')](util[_0x3fb9('0x11')](_0x3fb9('0xf'),_0x3eb1f2[_0x3fb9('0x5')]),_0x369d8d);}};exports[_0x3fb9('0x16')]=function(_0x2589cf){try{utils[_0x3fb9('0xe')](util['format'](_0x3fb9('0x17'),_0x2589cf[_0x3fb9('0x5')]),_0x2589cf);if(!_['isNil'](recordings[_0x2589cf[_0x3fb9('0x5')]])&&_0x2589cf[_0x3fb9('0x18')]==0x6){utils[_0x3fb9('0x3')](util[_0x3fb9('0x11')](_0x3fb9('0x19'),_0x2589cf['uniqueid'],_0x2589cf[_0x3fb9('0x12')],_0x2589cf[_0x3fb9('0x14')]));}else if(!_[_0x3fb9('0x1a')](recordings[_0x2589cf[_0x3fb9('0x10')]])&&_0x2589cf[_0x3fb9('0x18')]==0x6&&_0x2589cf['context']!=_0x3fb9('0x1b')){utils[_0x3fb9('0x3')](util[_0x3fb9('0x11')](_0x3fb9('0x1c'),_0x2589cf[_0x3fb9('0x5')],_0x2589cf[_0x3fb9('0x10')],_0x2589cf[_0x3fb9('0x12')],_0x2589cf['channel']));recordings[_0x2589cf[_0x3fb9('0x10')]][_0x3fb9('0x6')]=_0x2589cf[_0x3fb9('0x6')];}}catch(_0x384287){utils[_0x3fb9('0x15')](util[_0x3fb9('0x11')](_0x3fb9('0x17'),_0x2589cf[_0x3fb9('0x5')]),_0x384287);}};exports[_0x3fb9('0x1d')]=function(_0x5d359f){try{if(!_[_0x3fb9('0x1a')](_0x5d359f[_0x3fb9('0x1e')])&&!_['isNil'](_0x5d359f[_0x3fb9('0x1e')][_0x3fb9('0x1f')])){utils[_0x3fb9('0xe')](util['format']('[%s][recordings][varset]',_0x5d359f[_0x3fb9('0x5')]),_0x5d359f);utils[_0x3fb9('0x3')](util[_0x3fb9('0x11')](_0x3fb9('0x20'),_0x5d359f[_0x3fb9('0x5')],_0x5d359f[_0x3fb9('0x1e')],_0x5d359f[_0x3fb9('0x21')]));if(_[_0x3fb9('0x22')](_0x5d359f['value'],'.wav49')){_0x5d359f[_0x3fb9('0x21')]=_0x5d359f[_0x3fb9('0x21')]['replace']('.wav49',_0x3fb9('0x23'));}if(recordings[_0x5d359f[_0x3fb9('0x10')]]){var _0x558e1c=_[_0x3fb9('0x24')](recordings[_0x5d359f[_0x3fb9('0x10')]][_0x3fb9('0x25')],{'value':_0x5d359f['value']});if(_[_0x3fb9('0x1a')](_0x558e1c)){recordings[_0x5d359f[_0x3fb9('0x10')]]['monitors']['push']({'value':_0x5d359f[_0x3fb9('0x21')]});}}}}catch(_0x2250df){utils[_0x3fb9('0x15')](util[_0x3fb9('0x11')](_0x3fb9('0x26'),_0x5d359f[_0x3fb9('0x5')]),_0x2250df);}};exports[_0x3fb9('0x27')]=function(_0x43b8ed){try{if(!_[_0x3fb9('0x1a')](recordings[_0x43b8ed[_0x3fb9('0x5')]])){utils[_0x3fb9('0xe')](util[_0x3fb9('0x11')](_0x3fb9('0x28'),_0x43b8ed[_0x3fb9('0x5')]),_0x43b8ed);utils['info'](util[_0x3fb9('0x11')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x43b8ed[_0x3fb9('0x5')],_0x43b8ed[_0x3fb9('0x29')],_0x43b8ed[_0x3fb9('0x2a')],_0x43b8ed[_0x3fb9('0x2b')]));recordings[_0x43b8ed['uniqueid']][_0x3fb9('0x29')]=_0x43b8ed[_0x3fb9('0x29')];recordings[_0x43b8ed[_0x3fb9('0x5')]]['calleridname']=_0x43b8ed[_0x3fb9('0x2a')];recordings[_0x43b8ed['uniqueid']][_0x3fb9('0x2c')]=_0x43b8ed['connectedlinenum'];recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x2d')]=_0x43b8ed['connectedlinename'];if(recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x2e')]==_0x3fb9('0x2f')&&recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x6')]){recordings[_0x43b8ed['uniqueid']][_0x3fb9('0x2c')]=recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x6')];recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x2d')]='';}recordings[_0x43b8ed[_0x3fb9('0x5')]][_0x3fb9('0x25')][_0x3fb9('0x30')](function(_0x514cb2){var _0x8ad9cd=_[_0x3fb9('0x31')](recordings[_0x43b8ed[_0x3fb9('0x5')]]);_0x8ad9cd[_0x3fb9('0x21')]=_0x514cb2['value'];writeDB(_0x8ad9cd);});delete recordings[_0x43b8ed[_0x3fb9('0x5')]];}}catch(_0x449b90){utils['error'](util[_0x3fb9('0x11')](_0x3fb9('0x28'),_0x43b8ed[_0x3fb9('0x5')]),_0x449b90);}};exports[_0x3fb9('0x32')]=function(_0x1fd98b){try{if(!_['isNil'](recordings[_0x1fd98b['uniqueid']])){utils['debug'](util[_0x3fb9('0x11')](_0x3fb9('0x33'),_0x1fd98b[_0x3fb9('0x5')]),_0x1fd98b);utils[_0x3fb9('0x3')](util[_0x3fb9('0x11')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1fd98b[_0x3fb9('0x5')],_0x1fd98b['application'],_0x1fd98b[_0x3fb9('0x34')]));if(_0x1fd98b[_0x3fb9('0x35')][_0x3fb9('0x36')]()=='set'&&_[_0x3fb9('0x37')](_0x1fd98b[_0x3fb9('0x34')][_0x3fb9('0x36')](),_0x3fb9('0x38'))){var _0x492794=_0x1fd98b[_0x3fb9('0x34')][_0x3fb9('0x39')]('=');var _0x5398ae=_0x492794[0x0]['substring'](_0x492794[0x0][_0x3fb9('0x3a')]('(')+0x1,_0x492794[0x0][_0x3fb9('0x3a')](')'));var _0x1e3d02=_0x492794[0x1];recordings[_0x1fd98b[_0x3fb9('0x5')]][_0x5398ae]=_0x1e3d02;}}}catch(_0x43f466){utils['error'](util[_0x3fb9('0x11')](_0x3fb9('0x33'),_0x1fd98b[_0x3fb9('0x5')]),_0x43f466);}};exports[_0x3fb9('0x3b')]=function(_0x196a6f){try{if(!_[_0x3fb9('0x1a')](recordings[_0x196a6f['uniqueid']])){utils[_0x3fb9('0xe')](util[_0x3fb9('0x11')](_0x3fb9('0x3c'),_0x196a6f[_0x3fb9('0x5')]),_0x196a6f);utils['info'](util['format'](_0x3fb9('0x3d'),_0x196a6f['uniqueid'],_0x196a6f[_0x3fb9('0x3e')]));recordings[_0x196a6f['uniqueid']]['queue']=_0x196a6f[_0x3fb9('0x3e')];}}catch(_0x267486){utils[_0x3fb9('0x15')](util['format'](_0x3fb9('0x3c'),_0x196a6f[_0x3fb9('0x5')]),_0x267486);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3c5c818..4609403 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 _0x6cdd=['transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cdd,0x137));var _0xd6cd=function(_0x4588fe,_0x3aa83c){_0x4588fe=_0x4588fe-0x0;var _0xd3a627=_0x6cdd[_0x4588fe];return _0xd3a627;};'use strict';var _=require(_0xd6cd('0x0'));var util=require(_0xd6cd('0x1'));var utils=require(_0xd6cd('0x2'));function writeDB(_0x5deb9f){utils[_0xd6cd('0x3')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x5deb9f[_0xd6cd('0x4')]===_0xd6cd('0x5')?_0x5deb9f[_0xd6cd('0x6')]:_0x5deb9f[_0xd6cd('0x7')],_0x5deb9f['type']));utils['request'](_0xd6cd('0x8'),_0x5deb9f);}exports['blindtransfer']=function(_0x2d1a89){try{utils[_0xd6cd('0x9')](util['format'](_0xd6cd('0xa'),_0x2d1a89[_0xd6cd('0x7')]),_0x2d1a89);utils[_0xd6cd('0x3')](util[_0xd6cd('0xb')](_0xd6cd('0xc'),_0x2d1a89[_0xd6cd('0x7')],_0x2d1a89[_0xd6cd('0xd')],_0x2d1a89[_0xd6cd('0xe')],_0x2d1a89[_0xd6cd('0xf')],_0x2d1a89['transfereecalleridname']));_0x2d1a89['type']=_0xd6cd('0x10');writeDB(_0x2d1a89);}catch(_0x179cca){utils['error'](util[_0xd6cd('0xb')]('[%s][transfers][blindtransfer]',_0x2d1a89[_0xd6cd('0x7')]),_0x179cca);}};exports[_0xd6cd('0x11')]=function(_0x55a4f0){try{utils[_0xd6cd('0x9')](util['format'](_0xd6cd('0x12'),_0x55a4f0[_0xd6cd('0x6')]),_0x55a4f0);utils[_0xd6cd('0x3')](util[_0xd6cd('0xb')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x55a4f0[_0xd6cd('0x6')],_0x55a4f0[_0xd6cd('0x13')],_0x55a4f0[_0xd6cd('0x14')],_0x55a4f0['transfertargetcalleridnum'],_0x55a4f0['transfertargetcalleridname']));_0x55a4f0=_[_0xd6cd('0x15')](_0x55a4f0,{'transfererchannel':_0x55a4f0[_0xd6cd('0x16')],'transferercalleridnum':_0x55a4f0[_0xd6cd('0x13')],'transferercalleridname':_0x55a4f0[_0xd6cd('0x14')],'transfererconnectedlinenum':_0x55a4f0[_0xd6cd('0x17')],'transfererconnectedlinename':_0x55a4f0['secondtransfererconnectedlinename'],'transfereraccountcode':_0x55a4f0[_0xd6cd('0x18')],'transferercontext':_0x55a4f0[_0xd6cd('0x19')],'transfererexten':_0x55a4f0['secondtransfererexten'],'transfererlinkedid':_0x55a4f0[_0xd6cd('0x1a')],'context':_0x55a4f0[_0xd6cd('0x1b')],'extension':_0x55a4f0['origtransfererexten'],'type':_0xd6cd('0x5')});if(_[_0xd6cd('0x1c')](_0x55a4f0[_0xd6cd('0x1d')])){_0x55a4f0=_['assign'](_0x55a4f0,{'transfereechannel':_0x55a4f0['transfertargetchannel'],'transfereecalleridnum':_0x55a4f0[_0xd6cd('0x1e')],'transfereecalleridname':_0x55a4f0[_0xd6cd('0x1f')],'transfereeconnectedlinenum':_0x55a4f0['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x55a4f0['transfertargetconnectedlinename'],'transfereeaccountcode':_0x55a4f0[_0xd6cd('0x20')],'transfereecontext':_0x55a4f0['transfertargetcontext'],'transfereeexten':_0x55a4f0[_0xd6cd('0x21')],'transfereelinkedid':_0x55a4f0[_0xd6cd('0x22')]});}writeDB(_0x55a4f0);}catch(_0x4a91ba){utils[_0xd6cd('0x23')](util[_0xd6cd('0xb')](_0xd6cd('0x12'),_0x55a4f0[_0xd6cd('0x6')]),_0x4a91ba);}}; \ No newline at end of file +var _0x6f33=['transfertargetcontext','transfertargetexten','util','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','type','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0xd94092,_0x457c9f){var _0x35e3b8=function(_0x1bf3b4){while(--_0x1bf3b4){_0xd94092['push'](_0xd94092['shift']());}};_0x35e3b8(++_0x457c9f);}(_0x6f33,0xca));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x36f3('0x0'));var utils=require('./utils');function writeDB(_0x3d94fe){utils[_0x36f3('0x1')](util[_0x36f3('0x2')](_0x36f3('0x3'),_0x3d94fe['type']==='attended'?_0x3d94fe[_0x36f3('0x4')]:_0x3d94fe['uniqueid'],_0x3d94fe[_0x36f3('0x5')]));utils[_0x36f3('0x6')](_0x36f3('0x7'),_0x3d94fe);}exports['blindtransfer']=function(_0x523b5e){try{utils[_0x36f3('0x8')](util[_0x36f3('0x2')](_0x36f3('0x9'),_0x523b5e[_0x36f3('0xa')]),_0x523b5e);utils['info'](util[_0x36f3('0x2')](_0x36f3('0xb'),_0x523b5e[_0x36f3('0xa')],_0x523b5e[_0x36f3('0xc')],_0x523b5e[_0x36f3('0xd')],_0x523b5e['transfereecalleridnum'],_0x523b5e[_0x36f3('0xe')]));_0x523b5e['type']=_0x36f3('0xf');writeDB(_0x523b5e);}catch(_0x465b8f){utils[_0x36f3('0x10')](util[_0x36f3('0x2')]('[%s][transfers][blindtransfer]',_0x523b5e[_0x36f3('0xa')]),_0x465b8f);}};exports[_0x36f3('0x11')]=function(_0x48d09d){try{utils[_0x36f3('0x8')](util['format'](_0x36f3('0x12'),_0x48d09d[_0x36f3('0x4')]),_0x48d09d);utils[_0x36f3('0x1')](util[_0x36f3('0x2')](_0x36f3('0x13'),_0x48d09d['origtransfereruniqueid'],_0x48d09d[_0x36f3('0x14')],_0x48d09d[_0x36f3('0x15')],_0x48d09d[_0x36f3('0x16')],_0x48d09d['transfertargetcalleridname']));_0x48d09d=_['assign'](_0x48d09d,{'transfererchannel':_0x48d09d[_0x36f3('0x17')],'transferercalleridnum':_0x48d09d[_0x36f3('0x14')],'transferercalleridname':_0x48d09d[_0x36f3('0x15')],'transfererconnectedlinenum':_0x48d09d[_0x36f3('0x18')],'transfererconnectedlinename':_0x48d09d[_0x36f3('0x19')],'transfereraccountcode':_0x48d09d[_0x36f3('0x1a')],'transferercontext':_0x48d09d[_0x36f3('0x1b')],'transfererexten':_0x48d09d['secondtransfererexten'],'transfererlinkedid':_0x48d09d[_0x36f3('0x1c')],'context':_0x48d09d['origtransferercontext'],'extension':_0x48d09d['origtransfererexten'],'type':_0x36f3('0x1d')});if(_[_0x36f3('0x1e')](_0x48d09d[_0x36f3('0x1f')])){_0x48d09d=_[_0x36f3('0x20')](_0x48d09d,{'transfereechannel':_0x48d09d[_0x36f3('0x21')],'transfereecalleridnum':_0x48d09d[_0x36f3('0x16')],'transfereecalleridname':_0x48d09d[_0x36f3('0x22')],'transfereeconnectedlinenum':_0x48d09d[_0x36f3('0x23')],'transfereeconnectedlinename':_0x48d09d[_0x36f3('0x24')],'transfereeaccountcode':_0x48d09d[_0x36f3('0x25')],'transfereecontext':_0x48d09d[_0x36f3('0x26')],'transfereeexten':_0x48d09d[_0x36f3('0x27')],'transfereelinkedid':_0x48d09d['transfertargetlinkedid']});}writeDB(_0x48d09d);}catch(_0x1e068a){utils[_0x36f3('0x10')](util['format'](_0x36f3('0x12'),_0x48d09d[_0x36f3('0x4')]),_0x1e068a);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 382dc3e..7b1a377 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 _0x4c60=['util','http','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','getUserByInterface','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','request','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4c60,0xc1));var _0x04c6=function(_0x3df631,_0x95f5a7){_0x3df631=_0x3df631-0x0;var _0x5f200f=_0x4c60[_0x3df631];return _0x5f200f;};'use strict';var BPromise=require(_0x04c6('0x0'));var jayson=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var util=require(_0x04c6('0x3'));var client=jayson['client'][_0x04c6('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x53ca7a,_0x3a9493){logger[_0x04c6('0x5')](_0x53ca7a,_0x3a9493?util[_0x04c6('0x6')](_0x3a9493,{'showHidden':![],'depth':null}):'');};exports[_0x04c6('0x7')]=function(_0x2b9041,_0x39be2d){logger[_0x04c6('0x7')](_0x2b9041,_0x39be2d?util['inspect'](_0x39be2d,{'showHidden':![],'depth':null}):'');};exports[_0x04c6('0x8')]=function(_0x43a27e,_0x207649){logger[_0x04c6('0x8')](_0x43a27e,_0x207649?util['inspect'](_0x207649,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5498a9,_0x376da8){return client['request'](_0x5498a9,{'body':_0x376da8})[_0x04c6('0x9')](function(_0x2772fa){logger['debug'](_0x04c6('0xa'),_0x5498a9,_0x2772fa?util[_0x04c6('0x6')](_0x2772fa,{'showHidden':![],'depth':null}):'');})[_0x04c6('0xb')](function(_0x4e5e6){logger['error'](_0x04c6('0xa'),_0x5498a9,_0x4e5e6?util[_0x04c6('0x6')](_0x4e5e6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4384ad){return client['request'](_0x04c6('0xc'),{'options':{'raw':!![],'attributes':['id',_0x04c6('0xd'),_0x04c6('0xe'),_0x04c6('0xf')],'where':_0x4384ad,'limit':0x1}})[_0x04c6('0x9')](function(_0x19a26f){logger[_0x04c6('0x7')](_0x04c6('0x10'),JSON['stringify'](_0x4384ad),_0x19a26f?util[_0x04c6('0x6')](_0x19a26f,{'showHidden':![],'depth':null}):'');return _0x19a26f[_0x04c6('0x11')][_0x04c6('0x12')]?_0x19a26f[_0x04c6('0x11')][0x0]:null;});}exports[_0x04c6('0x13')]=function(_0xfb4db5){return new BPromise(function(_0x21674a,_0x423ea9){if(_0xfb4db5){return getUser({'internal':_0xfb4db5})['then'](function(_0x142065){logger[_0x04c6('0x5')](_0x04c6('0x14'),_0xfb4db5,_0x142065?'found':'notfound');return _0x21674a(_0x142065);})['catch'](function(_0x41ad4f){logger[_0x04c6('0x8')]('[utils][getUserByInternal]',_0x41ad4f?util['inspect'](_0x41ad4f,{'showHidden':![],'depth':null}):'');return _0x21674a(null);});}return _0x21674a(null);});};exports[_0x04c6('0x15')]=function(_0x2eed94){return new BPromise(function(_0x3cd448,_0x5daa22){if(_0x2eed94){return getUser({'interface':_0x2eed94})[_0x04c6('0x9')](function(_0x13f2dc){logger[_0x04c6('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2eed94,_0x13f2dc?_0x04c6('0x16'):_0x04c6('0x17'));return _0x3cd448(_0x13f2dc);})['catch'](function(_0x54a8b0){logger['error'](_0x04c6('0x18'),_0x54a8b0?util[_0x04c6('0x6')](_0x54a8b0,{'showHidden':![],'depth':null}):'');return _0x3cd448(null);});}return _0x3cd448(null);});};exports[_0x04c6('0x19')]=function(_0x115e35){return new BPromise(function(_0x3e1328,_0x52e5f5){if(_0x115e35){return getUser({'name':_0x115e35})['then'](function(_0x383435){logger[_0x04c6('0x5')](_0x04c6('0x1a'),_0x115e35,_0x383435?_0x04c6('0x16'):_0x04c6('0x17'));return _0x3e1328(_0x383435);})[_0x04c6('0xb')](function(_0x47c69a){logger[_0x04c6('0x8')](_0x04c6('0x1b'),_0x47c69a?util['inspect'](_0x47c69a,{'showHidden':![],'depth':null}):'');return _0x3e1328(null);});}return _0x3e1328(null);});};exports[_0x04c6('0x1c')]=function(_0x1cd16a){return new BPromise(function(_0x5f1331,_0x5c9003){if(_0x1cd16a){return client[_0x04c6('0x1d')](_0x04c6('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x04c6('0xe'),_0x04c6('0x1f'),_0x04c6('0x20'),_0x04c6('0x21')],'where':{'name':_0x1cd16a},'limit':0x1}})['then'](function(_0x5d8c88){logger['debug'](_0x04c6('0x22'),_0x1cd16a,_0x5d8c88?util['inspect'](_0x5d8c88,{'showHidden':![],'depth':null}):'');logger[_0x04c6('0x5')](_0x04c6('0x23'),_0x1cd16a,_0x5d8c88?'found':_0x04c6('0x17'));return _0x5f1331(_0x5d8c88[_0x04c6('0x11')][_0x04c6('0x12')]?_0x5d8c88[_0x04c6('0x11')][0x0]:null);})['catch'](function(_0x7c3207){logger[_0x04c6('0x8')](_0x04c6('0x24'),_0x7c3207?util[_0x04c6('0x6')](_0x7c3207,{'showHidden':![],'depth':null}):'');return _0x5f1331(null);});}return _0x5f1331(null);});};exports[_0x04c6('0x25')]=function(_0x902e66,_0x3e59b2){return moment(_0x902e66)[_0x04c6('0x26')](_0x3e59b2,_0x04c6('0x27'))[_0x04c6('0x28')](_0x04c6('0x29'));};exports[_0x04c6('0x2a')]=function(_0x46eccb,_0x3d56ea){return moment(_0x46eccb)[_0x04c6('0x2b')](_0x3d56ea,'seconds')[_0x04c6('0x28')](_0x04c6('0x29'));};exports[_0x04c6('0x2c')]=function(_0x206e32,_0x5a2e6a){return moment(_0x206e32)[_0x04c6('0x2d')](moment(_0x5a2e6a),_0x04c6('0x27'));};exports['sumTime']=function(_0x59dad3,_0x4aac49){return parseInt(_0x59dad3,0xa)+parseInt(_0x4aac49,0xa);};exports[_0x04c6('0x2e')]=function(){return moment()[_0x04c6('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x04c6('0x2f')]=function(_0x4c8f4c,_0x15c270){if(_0x15c270){return moment(_0x4c8f4c)[_0x04c6('0x2f')](_0x15c270);}return!![];};exports[_0x04c6('0x30')]=function(_0x2b28cd,_0x5144f5){if(_0x5144f5){return moment(_0x2b28cd)['isBefore'](_0x5144f5);}else if(_0x2b28cd){return!![];}return![];}; \ No newline at end of file +var _0x576b=['[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','subtractTime','format','diffTime','diff','sumTime','now','YYYY-MM-DD\x20HH:mm:ss','isBefore','util','client','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw'];(function(_0x4adb02,_0x1d073b){var _0x181f1c=function(_0x212e9f){while(--_0x212e9f){_0x4adb02['push'](_0x4adb02['shift']());}};_0x181f1c(++_0x1d073b);}(_0x576b,0x1d9));var _0xb576=function(_0x4fb8b4,_0x10886e){_0x4fb8b4=_0x4fb8b4-0x0;var _0x45d897=_0x576b[_0x4fb8b4];return _0x45d897;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0xb576('0x0'));var client=jayson[_0xb576('0x1')]['http']({'port':0x2329});var logger=require(_0xb576('0x2'))(_0xb576('0x3'));exports['info']=function(_0x20cb85,_0x25bfec){logger[_0xb576('0x4')](_0x20cb85,_0x25bfec?util[_0xb576('0x5')](_0x25bfec,{'showHidden':![],'depth':null}):'');};exports[_0xb576('0x6')]=function(_0x22cbae,_0x42affb){logger[_0xb576('0x6')](_0x22cbae,_0x42affb?util[_0xb576('0x5')](_0x42affb,{'showHidden':![],'depth':null}):'');};exports[_0xb576('0x7')]=function(_0x1148c2,_0x1f7321){logger[_0xb576('0x7')](_0x1148c2,_0x1f7321?util[_0xb576('0x5')](_0x1f7321,{'showHidden':![],'depth':null}):'');};exports[_0xb576('0x8')]=function(_0x4b209b,_0x3e21fe){return client['request'](_0x4b209b,{'body':_0x3e21fe})[_0xb576('0x9')](function(_0x2a0f32){logger[_0xb576('0x6')]('[utils][request]\x20name:%s',_0x4b209b,_0x2a0f32?util['inspect'](_0x2a0f32,{'showHidden':![],'depth':null}):'');})[_0xb576('0xa')](function(_0x420041){logger[_0xb576('0x7')](_0xb576('0xb'),_0x4b209b,_0x420041?util[_0xb576('0x5')](_0x420041,{'showHidden':![],'depth':null}):'');});};function getUser(_0x47edcc){return client[_0xb576('0x8')](_0xb576('0xc'),{'options':{'raw':!![],'attributes':['id',_0xb576('0xd'),_0xb576('0xe'),'interface'],'where':_0x47edcc,'limit':0x1}})['then'](function(_0x5cf596){logger[_0xb576('0x6')](_0xb576('0xf'),JSON[_0xb576('0x10')](_0x47edcc),_0x5cf596?util[_0xb576('0x5')](_0x5cf596,{'showHidden':![],'depth':null}):'');return _0x5cf596[_0xb576('0x11')][_0xb576('0x12')]?_0x5cf596['result'][0x0]:null;});}exports[_0xb576('0x13')]=function(_0x2bf599){return new BPromise(function(_0x5406c9,_0x52a0ca){if(_0x2bf599){return getUser({'internal':_0x2bf599})[_0xb576('0x9')](function(_0x3da216){logger[_0xb576('0x4')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2bf599,_0x3da216?'found':'notfound');return _0x5406c9(_0x3da216);})[_0xb576('0xa')](function(_0x5a2ae9){logger['error'](_0xb576('0x14'),_0x5a2ae9?util[_0xb576('0x5')](_0x5a2ae9,{'showHidden':![],'depth':null}):'');return _0x5406c9(null);});}return _0x5406c9(null);});};exports[_0xb576('0x15')]=function(_0x2a95a3){return new BPromise(function(_0x52a6ef,_0x230e91){if(_0x2a95a3){return getUser({'interface':_0x2a95a3})[_0xb576('0x9')](function(_0xde0fb1){logger[_0xb576('0x4')](_0xb576('0x16'),_0x2a95a3,_0xde0fb1?_0xb576('0x17'):_0xb576('0x18'));return _0x52a6ef(_0xde0fb1);})[_0xb576('0xa')](function(_0x23d3e7){logger[_0xb576('0x7')](_0xb576('0x19'),_0x23d3e7?util[_0xb576('0x5')](_0x23d3e7,{'showHidden':![],'depth':null}):'');return _0x52a6ef(null);});}return _0x52a6ef(null);});};exports[_0xb576('0x1a')]=function(_0x1025bc){return new BPromise(function(_0x5c343f,_0x456648){if(_0x1025bc){return getUser({'name':_0x1025bc})[_0xb576('0x9')](function(_0x1e858d){logger[_0xb576('0x4')](_0xb576('0x1b'),_0x1025bc,_0x1e858d?_0xb576('0x17'):_0xb576('0x18'));return _0x5c343f(_0x1e858d);})['catch'](function(_0x30d966){logger[_0xb576('0x7')](_0xb576('0x1c'),_0x30d966?util[_0xb576('0x5')](_0x30d966,{'showHidden':![],'depth':null}):'');return _0x5c343f(null);});}return _0x5c343f(null);});};exports[_0xb576('0x1d')]=function(_0x592dfc){return new BPromise(function(_0x13d833,_0x5a7b3d){if(_0x592dfc){return client[_0xb576('0x8')](_0xb576('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb576('0xe'),_0xb576('0x1f'),_0xb576('0x20'),'acwTimeout'],'where':{'name':_0x592dfc},'limit':0x1}})[_0xb576('0x9')](function(_0x5e3860){logger[_0xb576('0x6')](_0xb576('0x21'),_0x592dfc,_0x5e3860?util['inspect'](_0x5e3860,{'showHidden':![],'depth':null}):'');logger[_0xb576('0x4')](_0xb576('0x22'),_0x592dfc,_0x5e3860?_0xb576('0x17'):'notfound');return _0x13d833(_0x5e3860['result']['length']?_0x5e3860[_0xb576('0x11')][0x0]:null);})[_0xb576('0xa')](function(_0xd053f1){logger[_0xb576('0x7')](_0xb576('0x23'),_0xd053f1?util[_0xb576('0x5')](_0xd053f1,{'showHidden':![],'depth':null}):'');return _0x13d833(null);});}return _0x13d833(null);});};exports[_0xb576('0x24')]=function(_0x38ce86,_0x1be7ab){return moment(_0x38ce86)['add'](_0x1be7ab,_0xb576('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb576('0x26')]=function(_0x42f8ea,_0x1e446a){return moment(_0x42f8ea)['subtract'](_0x1e446a,_0xb576('0x25'))[_0xb576('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb576('0x28')]=function(_0x453824,_0x84b663){return moment(_0x453824)[_0xb576('0x29')](moment(_0x84b663),_0xb576('0x25'));};exports[_0xb576('0x2a')]=function(_0xe4afbc,_0x368a80){return parseInt(_0xe4afbc,0xa)+parseInt(_0x368a80,0xa);};exports[_0xb576('0x2b')]=function(){return moment()[_0xb576('0x27')](_0xb576('0x2c'));};exports['isAfter']=function(_0x5b9f8d,_0x1c95a5){if(_0x1c95a5){return moment(_0x5b9f8d)['isAfter'](_0x1c95a5);}return!![];};exports[_0xb576('0x2d')]=function(_0x131ac5,_0x1c875f){if(_0x1c875f){return moment(_0x131ac5)[_0xb576('0x2d')](_0x1c875f);}else if(_0x131ac5){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 0f5d5c3..1cfec53 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 _0x35dc=['fs-extra','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','/var','join','client','name','then','catch','log','user','no-user','data','timestamp','api','set','client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','statusCode','device','other','agent_name','setupLoggers'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x35dc,0x1ae));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};var fs=require(_0xc35d('0x0'));var _=require('lodash');var ewinston=require(_0xc35d('0x1'));var path=require(_0xc35d('0x2'));var util=require(_0xc35d('0x3'));var fileLogger=require(_0xc35d('0x4'))[_0xc35d('0x5')];var safeTemplate=require(_0xc35d('0x6'))[_0xc35d('0x7')];var maskSensitiveData=require(_0xc35d('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x57053f(_0x2edd06){var _0x39f654=path['join'](_0xc35d('0x9'),'log','xcally');var _0x79514a=path[_0xc35d('0xa')](_0xc35d('0xb'),_0x2edd06['role']+'-'+_0x2edd06[_0xc35d('0xc')]);return fs['ensureDir'](path[_0xc35d('0xa')](_0x39f654,_0x79514a))[_0xc35d('0xd')](function(){var _0x5a33a5=fileLogger(_0xc35d('0xb'),path['join'](_0x39f654,_0x79514a));return _0x5a33a5;})[_0xc35d('0xe')](function(_0x24eae8){throw _0x24eae8;});}this[_0xc35d('0xf')]=function(_0x197927,_0x1d443a,_0x4d4979,_0x1d7f53){return _0x57053f(_0x197927['user'])['then'](function(_0x2f6acf){var _0x234230=_0x2f6acf[_0x1d443a];return _0x234230;})[_0xc35d('0xd')](function(_0x5134de){var _0x4c0319=_0x197927[_0xc35d('0x10')]?_0x197927[_0xc35d('0x10')]['id']:_0xc35d('0x11');var _0x5ea063=_0x1d7f53[_0xc35d('0x12')];var _0x2fb582=_0x1d7f53[_0xc35d('0x13')];var _0x4f670c=new Date(Number(_0x2fb582));return _0x5134de(_0x4c0319,_0x4f670c,_0x4d4979,_0x5ea063);})[_0xc35d('0xe')](function(_0x3e0d6b){fileLogger(_0xc35d('0xb'))['error'](_0x3e0d6b);});};}function setupLoggers(_0x4ede0e){return new Promise(function(_0x2e30b8){var _0x2ee4ef=new ClientSideLogger();var _0x757128=fileLogger(_0xc35d('0x14'));var _0x768a84=fileLogger('auth');_0x4ede0e[_0xc35d('0x15')](_0xc35d('0x16'),_0x2ee4ef);_0x4ede0e[_0xc35d('0x17')](ewinston['logger']({'winstonInstance':_0x757128,'meta':![],'statusLevels':!![],'msg':function(_0x8631a8,_0x23d604){var _0x2f5c80=_0xc35d('0x18');if(!_['isEmpty'](_0x8631a8['body'])){_0x2f5c80+=_0xc35d('0x19');var _0x48ab70=_0x8631a8['body'];maskSensitiveData(_0x48ab70);}return safeTemplate(util[_0xc35d('0x1a')](_0x2f5c80,_0x8631a8[_0xc35d('0x1b')],_0x8631a8[_0xc35d('0x1c')][_0xc35d('0x1d')]?_0x8631a8[_0xc35d('0x1c')][_0xc35d('0x1d')]:_0x8631a8[_0xc35d('0x1e')][_0xc35d('0x1f')]||_0x8631a8['ip'],_0x8631a8['url'],_0x23d604['statusCode'],_0x23d604['responseTime'],_0x8631a8[_0xc35d('0x10')]?_0x8631a8[_0xc35d('0x10')]['id']:null,_0x8631a8[_0xc35d('0x10')]?_0x8631a8[_0xc35d('0x10')]['name']:null,_0x8631a8[_0xc35d('0x10')]?_0x8631a8[_0xc35d('0x10')]['role']:null,_0x48ab70?util['inspect'](_0x48ab70,![],null):''));}}));_0x4ede0e[_0xc35d('0x17')](ewinston[_0xc35d('0x20')]({'winstonInstance':_0x768a84,'meta':![],'statusLevels':!![],'msg':function(_0x901126,_0x66bec4){var _0x531ca5=_0xc35d('0x21');if(_0x901126[_0xc35d('0x22')]&&_0x901126[_0xc35d('0x22')]['device']&&_0x901126[_0xc35d('0x22')][_0xc35d('0x23')]){_0x531ca5=_0xc35d('0x24');}return util[_0xc35d('0x1a')](_0x531ca5,_0x901126[_0xc35d('0x1b')],_0x901126[_0xc35d('0x1c')][_0xc35d('0x1d')]?_0x901126[_0xc35d('0x1c')][_0xc35d('0x1d')]:_0x901126[_0xc35d('0x1e')][_0xc35d('0x1f')]||_0x901126['ip'],_0x901126[_0xc35d('0x25')],_0x66bec4[_0xc35d('0x26')],_0x66bec4['responseTime'],_0x901126[_0xc35d('0x10')]?_0x901126[_0xc35d('0x10')]['id']:null,_0x901126[_0xc35d('0x10')]?_0x901126[_0xc35d('0x10')]['name']:null,_0x901126[_0xc35d('0x10')]?_0x901126[_0xc35d('0x10')]['role']:null,_0x901126['body']&&_0x901126[_0xc35d('0x22')][_0xc35d('0x27')]?_0x901126[_0xc35d('0x22')][_0xc35d('0x27')]:_0xc35d('0x28'),_0x901126[_0xc35d('0x22')]&&_0x901126[_0xc35d('0x22')][_0xc35d('0x23')]?_0x901126[_0xc35d('0x22')][_0xc35d('0x23')]:'',_0x901126[_0xc35d('0x22')]&&_0x901126[_0xc35d('0x22')][_0xc35d('0x29')]?_0x901126[_0xc35d('0x22')][_0xc35d('0x29')]:'');},'ignoreRoute':function(_0xc94e7d){var _0x466bd5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x466bd5['test'](_0xc94e7d['url']);}}));return _0x2e30b8();});}exports[_0xc35d('0x2a')]=setupLoggers; \ No newline at end of file +var _0x967d=['timestamp','catch','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','\x20body=%s','body','format','method','headers','x-forwarded-for','url','statusCode','responseTime','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','remoteAddress','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','/var','log','xcally','join','client','name','then','user','no-user','data'];(function(_0x66c591,_0x2e194f){var _0x1637fb=function(_0x3fbfb7){while(--_0x3fbfb7){_0x66c591['push'](_0x66c591['shift']());}};_0x1637fb(++_0x2e194f);}(_0x967d,0x78));var _0xd967=function(_0x4b36b7,_0x14659b){_0x4b36b7=_0x4b36b7-0x0;var _0x51f8ba=_0x967d[_0x4b36b7];return _0x51f8ba;};var fs=require(_0xd967('0x0'));var _=require(_0xd967('0x1'));var ewinston=require(_0xd967('0x2'));var path=require(_0xd967('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0xd967('0x4')];var safeTemplate=require(_0xd967('0x5'))[_0xd967('0x6')];var maskSensitiveData=require(_0xd967('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x308090(_0x27c15a){var _0xba1977=path['join'](_0xd967('0x8'),_0xd967('0x9'),_0xd967('0xa'));var _0x6296a1=path[_0xd967('0xb')](_0xd967('0xc'),_0x27c15a['role']+'-'+_0x27c15a[_0xd967('0xd')]);return fs['ensureDir'](path['join'](_0xba1977,_0x6296a1))[_0xd967('0xe')](function(){var _0x395e97=fileLogger(_0xd967('0xc'),path['join'](_0xba1977,_0x6296a1));return _0x395e97;})['catch'](function(_0x30bec2){throw _0x30bec2;});}this[_0xd967('0x9')]=function(_0xcbae5f,_0x46d65b,_0x4dcf7a,_0x4ddb82){return _0x308090(_0xcbae5f[_0xd967('0xf')])['then'](function(_0x3afc2e){var _0xe8e3e0=_0x3afc2e[_0x46d65b];return _0xe8e3e0;})[_0xd967('0xe')](function(_0x411ffa){var _0x24c0b1=_0xcbae5f[_0xd967('0xf')]?_0xcbae5f[_0xd967('0xf')]['id']:_0xd967('0x10');var _0x31f281=_0x4ddb82[_0xd967('0x11')];var _0x3ae437=_0x4ddb82[_0xd967('0x12')];var _0x27cbdf=new Date(Number(_0x3ae437));return _0x411ffa(_0x24c0b1,_0x27cbdf,_0x4dcf7a,_0x31f281);})[_0xd967('0x13')](function(_0x673148){fileLogger('client')[_0xd967('0x14')](_0x673148);});};}function setupLoggers(_0x16fc7e){return new Promise(function(_0x23026b){var _0x196d80=new ClientSideLogger();var _0x3c9424=fileLogger(_0xd967('0x15'));var _0x32652a=fileLogger(_0xd967('0x16'));_0x16fc7e['set'](_0xd967('0x17'),_0x196d80);_0x16fc7e[_0xd967('0x18')](ewinston[_0xd967('0x19')]({'winstonInstance':_0x3c9424,'meta':![],'statusLevels':!![],'msg':function(_0x5e0034,_0x386b23){var _0xb18447=_0xd967('0x1a');if(!_['isEmpty'](_0x5e0034['body'])){_0xb18447+=_0xd967('0x1b');var _0x39963b=_0x5e0034[_0xd967('0x1c')];maskSensitiveData(_0x39963b);}return safeTemplate(util[_0xd967('0x1d')](_0xb18447,_0x5e0034[_0xd967('0x1e')],_0x5e0034[_0xd967('0x1f')]['x-forwarded-for']?_0x5e0034['headers'][_0xd967('0x20')]:_0x5e0034['connection']['remoteAddress']||_0x5e0034['ip'],_0x5e0034[_0xd967('0x21')],_0x386b23[_0xd967('0x22')],_0x386b23[_0xd967('0x23')],_0x5e0034[_0xd967('0xf')]?_0x5e0034['user']['id']:null,_0x5e0034['user']?_0x5e0034[_0xd967('0xf')][_0xd967('0xd')]:null,_0x5e0034[_0xd967('0xf')]?_0x5e0034[_0xd967('0xf')][_0xd967('0x24')]:null,_0x39963b?util['inspect'](_0x39963b,![],null):''));}}));_0x16fc7e['use'](ewinston[_0xd967('0x19')]({'winstonInstance':_0x32652a,'meta':![],'statusLevels':!![],'msg':function(_0x5c5f97,_0x53e26c){var _0x3b10b9=_0xd967('0x25');if(_0x5c5f97['body']&&_0x5c5f97[_0xd967('0x1c')][_0xd967('0x26')]&&_0x5c5f97[_0xd967('0x1c')][_0xd967('0x27')]){_0x3b10b9=_0xd967('0x28');}return util['format'](_0x3b10b9,_0x5c5f97['method'],_0x5c5f97['headers']['x-forwarded-for']?_0x5c5f97[_0xd967('0x1f')]['x-forwarded-for']:_0x5c5f97[_0xd967('0x29')][_0xd967('0x2a')]||_0x5c5f97['ip'],_0x5c5f97[_0xd967('0x21')],_0x53e26c[_0xd967('0x22')],_0x53e26c['responseTime'],_0x5c5f97[_0xd967('0xf')]?_0x5c5f97[_0xd967('0xf')]['id']:null,_0x5c5f97[_0xd967('0xf')]?_0x5c5f97['user']['name']:null,_0x5c5f97[_0xd967('0xf')]?_0x5c5f97[_0xd967('0xf')][_0xd967('0x24')]:null,_0x5c5f97['body']&&_0x5c5f97['body']['device']?_0x5c5f97[_0xd967('0x1c')][_0xd967('0x26')]:'other',_0x5c5f97[_0xd967('0x1c')]&&_0x5c5f97[_0xd967('0x1c')][_0xd967('0x27')]?_0x5c5f97['body'][_0xd967('0x27')]:'',_0x5c5f97[_0xd967('0x1c')]&&_0x5c5f97[_0xd967('0x1c')][_0xd967('0x2b')]?_0x5c5f97['body'][_0xd967('0x2b')]:'');},'ignoreRoute':function(_0x1b8efa){var _0xe6c9e8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe6c9e8[_0xd967('0x2c')](_0x1b8efa[_0xd967('0x21')]);}}));return _0x23026b();});}exports[_0xd967('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 4205652..bbcf03d 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf09a=['length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','monthsShort','clone','hours','minutes','isBefore','startOf','endOf','day','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','min','domCompare','guess','test','isMoment','split'];(function(_0x4dede2,_0xbeb5c4){var _0x25f6c4=function(_0x4a34e6){while(--_0x4a34e6){_0x4dede2['push'](_0x4dede2['shift']());}};_0x25f6c4(++_0xbeb5c4);}(_0xf09a,0x199));var _0xaf09=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0xf09a[_0x470b0a];return _0x4463f6;};var _=require(_0xaf09('0x0'));var moment=require(_0xaf09('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xaf09('0x2')](function(_0x5d376a){return _0x5d376a[_0xaf09('0x3')];})[_0xaf09('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xaf09('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x505eeb){if(!_0x505eeb['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x132de2){var _0x2d018c=_0x132de2['split'](':')[_0xaf09('0x2')](function(_0x4e8a71){return parseInt(_0x4e8a71,0xa);});var _0x20441d=_0x2d018c[0x0];var _0x2c52ad=_0x2d018c[0x1];if(_0x20441d<0x0||_0x20441d>0x17||_0x2c52ad<0x0||_0x2c52ad>0x3b){throw new Error(EINVALID_DATE);}return[_0x20441d,_0x2c52ad];}function circularDoWInterval(_0x3c497f,_0x301de5){if(_0x3c497f===_0x301de5){return[_0x3c497f];}else{var _0x1a6a3b=moment[_0xaf09('0x6')]();moment[_0xaf09('0x6')]('en');var _0x3cc9d4=moment[_0xaf09('0x7')]()['map'](function(_0x34a778){return _0x34a778[_0xaf09('0x8')]();});moment[_0xaf09('0x6')](_0x1a6a3b);var _0x56bb04=_0x3cc9d4[_0xaf09('0x9')](_0x3c497f);var _0x192d89=_0x3cc9d4[_0xaf09('0x9')](_0x301de5);if(_0x192d89>_0x56bb04){return _0x3cc9d4[_0xaf09('0xa')](_0x56bb04,_0x192d89+0x1);}else{var _0x26021d=_0x3cc9d4['slice'](0x0,_0x192d89+0x1);var _0x246d3a=_0x3cc9d4[_0xaf09('0xa')](_0x56bb04);return _0x246d3a[_0xaf09('0xb')](_0x26021d);}}}module[_0xaf09('0xc')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x5bdf83,_0x1437c1){if(_0x5bdf83===_0x1437c1){return[_0x5bdf83];}else{var _0x2bc8bc=moment[_0xaf09('0x6')]();moment[_0xaf09('0x6')]('en');var _0xa32b07=moment[_0xaf09('0xd')]()[_0xaf09('0x2')](function(_0x448ccb){return _0x448ccb[_0xaf09('0x8')]();});moment[_0xaf09('0x6')](_0x2bc8bc);var _0x4daff8=_0xa32b07['indexOf'](_0x5bdf83);var _0x2bba4f=_0xa32b07[_0xaf09('0x9')](_0x1437c1);if(_0x2bba4f>_0x4daff8){return _0xa32b07[_0xaf09('0xa')](_0x4daff8,_0x2bba4f+0x1);}else{var _0x493c63=_0xa32b07['slice'](0x0,_0x2bba4f+0x1);var _0x42ea01=_0xa32b07[_0xaf09('0xa')](_0x4daff8);return _0x42ea01[_0xaf09('0xb')](_0x493c63);}}}module[_0xaf09('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x324f54){var _0x3f1f50=parseInt(_0x324f54,0xa);if(_0x3f1f50<0x1||_0x3f1f50>0x1f){throw new Error(EINVALID_DATE);}return _0x3f1f50;}function timeCompare(_0x60c0a4,_0x408b3c,_0x47925b){var _0x996b6c=_0x60c0a4[_0xaf09('0xe')]();var _0x5341c2=extractTime(_0x408b3c);var _0x418ee5=_0x5341c2[0x0];var _0x21b36a=_0x5341c2[0x1];var _0x281e48=_0x60c0a4['clone']()['hours'](_0x418ee5)['minutes'](_0x21b36a);throwIfDateNotValid(_0x281e48);var _0x29fb77=extractTime(_0x47925b);var _0x3fe9cf=_0x29fb77[0x0];var _0x5574c4=_0x29fb77[0x1];var _0x4f76d1=_0x60c0a4['clone']()[_0xaf09('0xf')](_0x3fe9cf)[_0xaf09('0x10')](_0x5574c4);throwIfDateNotValid(_0x4f76d1);if(_0x4f76d1[_0xaf09('0x11')](_0x281e48)){var _0xa854e4=_0x996b6c['clone']()[_0xaf09('0x12')]('day');var _0xa96d7c=_0x996b6c['clone']()[_0xaf09('0x13')](_0xaf09('0x14'));return _0x996b6c[_0xaf09('0x15')](_0x281e48,_0xa96d7c,undefined,'[]')||_0x996b6c['isBetween'](_0xa854e4,_0x4f76d1,undefined,'[]');}else{return _0x996b6c[_0xaf09('0x15')](_0x281e48,_0x4f76d1,undefined,'[]');}}module[_0xaf09('0xc')][_0xaf09('0x16')]=timeCompare;function dowCompare(_0x23df93,_0x21280b,_0x39e4e0){var _0x105eb3=_0x23df93[_0xaf09('0x6')]('en')[_0xaf09('0x17')](_0xaf09('0x18'))[_0xaf09('0x8')]();return circularDoWInterval(_0x21280b,_0x39e4e0)[_0xaf09('0x19')](_0x105eb3);}module[_0xaf09('0xc')][_0xaf09('0x1a')]=dowCompare;function domCompare(_0x2e2cea,_0x13c54e,_0x3668b8){var _0x3c43ee=_0x2e2cea[_0xaf09('0x1b')]();if(_0x13c54e===_0x3668b8){return _0x3c43ee===_0x13c54e;}else{var _0x409201=_0x2e2cea[_0xaf09('0x1c')]();var _0x1ddd24=_0x13c54e<_0x3668b8;let _0x235337=![];var _0x5c92c9=0x0;var _0x4dea8f=0x0;if(_0x1ddd24){_0x5c92c9=Math['max'](0x1,_0x13c54e);_0x4dea8f=Math[_0xaf09('0x1d')](_0x3668b8,_0x409201);_0x235337=_0x3c43ee>=_0x5c92c9&&_0x3c43ee<=_0x4dea8f;}else{_0x5c92c9=Math['min'](_0x13c54e,_0x409201);_0x4dea8f=Math['max'](0x1,_0x3668b8);_0x235337=_0x3c43ee>=_0x5c92c9||_0x3c43ee<=_0x4dea8f;}return _0x235337;}}module['exports'][_0xaf09('0x1e')]=domCompare;function monthCompare(_0x150c90,_0xc91031,_0x2406dc){var _0x4b5ddf=_0x150c90[_0xaf09('0x6')]('en')[_0xaf09('0x17')]('MMM')[_0xaf09('0x8')]();return circularMonthInterval(_0xc91031,_0x2406dc)[_0xaf09('0x19')](_0x4b5ddf);}module[_0xaf09('0xc')]['monthCompare']=monthCompare;function iftime(_0x56a82a,_0x4f9c11=moment['tz'][_0xaf09('0x1f')](),_0x2d354b=moment()){if(!validateRx[_0xaf09('0x20')](_0x56a82a)){throw new Error(EINVALID_STRING);}else{var _0x1bb5ce=(moment[_0xaf09('0x21')](_0x2d354b)?_0x2d354b['clone']():moment(_0x2d354b))['tz'](_0x4f9c11)[_0xaf09('0x6')]('en');throwIfDateNotValid(_0x1bb5ce);var _0x3df81c=_0x56a82a['split'](',');var _0x633ceb=_0x3df81c[0x0];var _0x53a607=_0x3df81c[0x1];var _0x2eec34=_0x3df81c[0x2];var _0x12a653=_0x3df81c[0x3];let _0x4ebdb9=!![];if(_0x633ceb!=='*'){var _0x5e722c=_0x633ceb[_0xaf09('0x22')]('-');var _0x2ebc34=_['padStart'](_0x5e722c[0x0],0x5,'0');var _0x133c3b=_0x5e722c[_0xaf09('0x23')]===0x2?_['padStart'](_0x5e722c[0x1],0x5,'0'):_0x2ebc34;_0x4ebdb9=timeCompare(_0x1bb5ce,_0x2ebc34,_0x133c3b);}let _0x316fc5=!![];if(_0x53a607!=='*'){var _0x487171=_0x53a607[_0xaf09('0x22')]('-');var _0x433993=_0x487171[0x0];var _0x389f78=_0x487171['length']===0x2?_0x487171[0x1]:_0x433993;_0x316fc5=dowCompare(_0x1bb5ce,_0x433993,_0x389f78);}let _0x3b51ff=!![];if(_0x2eec34!=='*'){var _0x25080b=_0x2eec34[_0xaf09('0x22')]('-');var _0x37ef35=parseDom(_0x25080b[0x0]);var _0x4bda63=_0x25080b[_0xaf09('0x23')]===0x2?parseDom(_0x25080b[0x1]):_0x37ef35;_0x3b51ff=domCompare(_0x1bb5ce,_0x37ef35,_0x4bda63);}let _0x2b2d4c=!![];if(_0x12a653!=='*'){var _0xe1eb81=_0x12a653[_0xaf09('0x22')]('-');var _0x108bf3=_0xe1eb81[0x0];var _0x6e4b59=_0xe1eb81[_0xaf09('0x23')]===0x2?_0xe1eb81[0x1]:_0xe1eb81[0x0];_0x2b2d4c=monthCompare(_0x1bb5ce,_0x108bf3,_0x6e4b59);}return _0x4ebdb9&&_0x316fc5&&_0x3b51ff&&_0x2b2d4c;}}module[_0xaf09('0xc')][_0xaf09('0x24')]=iftime; \ No newline at end of file +var _0x26df=['includes','dowCompare','date','max','min','domCompare','MMM','guess','padStart','length','iftime','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','exports','circularMonthInterval','clone','hours','minutes','isBefore','day','endOf','isBetween','format','ddd'];(function(_0x11844d,_0xb8b111){var _0x36f6bb=function(_0x4a7b72){while(--_0x4a7b72){_0x11844d['push'](_0x11844d['shift']());}};_0x36f6bb(++_0xb8b111);}(_0x26df,0x187));var _0xf26d=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x26df[_0x2a5b3b];return _0xae665a;};var _=require('lodash');var moment=require(_0xf26d('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xf26d('0x1')](function(_0x51b482){return _0x51b482[_0xf26d('0x2')];})[_0xf26d('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xf26d('0x4');var EINVALID_DATE=_0xf26d('0x5');function throwIfDateNotValid(_0x3966db){if(!_0x3966db[_0xf26d('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x42bef4){var _0xfdbf51=_0x42bef4[_0xf26d('0x7')](':')[_0xf26d('0x1')](function(_0x49cb77){return parseInt(_0x49cb77,0xa);});var _0x975b16=_0xfdbf51[0x0];var _0x35e516=_0xfdbf51[0x1];if(_0x975b16<0x0||_0x975b16>0x17||_0x35e516<0x0||_0x35e516>0x3b){throw new Error(EINVALID_DATE);}return[_0x975b16,_0x35e516];}function circularDoWInterval(_0x1296ca,_0x5395ca){if(_0x1296ca===_0x5395ca){return[_0x1296ca];}else{var _0xa8ccdd=moment[_0xf26d('0x8')]();moment[_0xf26d('0x8')]('en');var _0x47db5f=moment[_0xf26d('0x9')]()[_0xf26d('0x1')](function(_0x171d8a){return _0x171d8a[_0xf26d('0xa')]();});moment[_0xf26d('0x8')](_0xa8ccdd);var _0x52385d=_0x47db5f[_0xf26d('0xb')](_0x1296ca);var _0x48ea1a=_0x47db5f[_0xf26d('0xb')](_0x5395ca);if(_0x48ea1a>_0x52385d){return _0x47db5f[_0xf26d('0xc')](_0x52385d,_0x48ea1a+0x1);}else{var _0x3965b6=_0x47db5f[_0xf26d('0xc')](0x0,_0x48ea1a+0x1);var _0x50d75a=_0x47db5f[_0xf26d('0xc')](_0x52385d);return _0x50d75a[_0xf26d('0xd')](_0x3965b6);}}}module['exports'][_0xf26d('0xe')]=circularDoWInterval;function circularMonthInterval(_0x3af8b2,_0x21b095){if(_0x3af8b2===_0x21b095){return[_0x3af8b2];}else{var _0x1c8cae=moment[_0xf26d('0x8')]();moment[_0xf26d('0x8')]('en');var _0x2ece7d=moment[_0xf26d('0xf')]()['map'](function(_0x1af358){return _0x1af358[_0xf26d('0xa')]();});moment[_0xf26d('0x8')](_0x1c8cae);var _0x5856c3=_0x2ece7d[_0xf26d('0xb')](_0x3af8b2);var _0x5adf87=_0x2ece7d['indexOf'](_0x21b095);if(_0x5adf87>_0x5856c3){return _0x2ece7d[_0xf26d('0xc')](_0x5856c3,_0x5adf87+0x1);}else{var _0x6ddc5a=_0x2ece7d[_0xf26d('0xc')](0x0,_0x5adf87+0x1);var _0x545e6d=_0x2ece7d[_0xf26d('0xc')](_0x5856c3);return _0x545e6d[_0xf26d('0xd')](_0x6ddc5a);}}}module[_0xf26d('0x10')][_0xf26d('0x11')]=circularMonthInterval;function parseDom(_0x118485){var _0x2357db=parseInt(_0x118485,0xa);if(_0x2357db<0x1||_0x2357db>0x1f){throw new Error(EINVALID_DATE);}return _0x2357db;}function timeCompare(_0x6917ba,_0x1a0394,_0x297dd3){var _0x674b20=_0x6917ba[_0xf26d('0x12')]();var _0x13cae1=extractTime(_0x1a0394);var _0x2feb0e=_0x13cae1[0x0];var _0x1852b4=_0x13cae1[0x1];var _0x39fb15=_0x6917ba[_0xf26d('0x12')]()[_0xf26d('0x13')](_0x2feb0e)[_0xf26d('0x14')](_0x1852b4);throwIfDateNotValid(_0x39fb15);var _0x15d7df=extractTime(_0x297dd3);var _0x34bdcc=_0x15d7df[0x0];var _0x3d2b6d=_0x15d7df[0x1];var _0x10c082=_0x6917ba[_0xf26d('0x12')]()['hours'](_0x34bdcc)['minutes'](_0x3d2b6d);throwIfDateNotValid(_0x10c082);if(_0x10c082[_0xf26d('0x15')](_0x39fb15)){var _0x3b740d=_0x674b20[_0xf26d('0x12')]()['startOf'](_0xf26d('0x16'));var _0x3ada2f=_0x674b20[_0xf26d('0x12')]()[_0xf26d('0x17')](_0xf26d('0x16'));return _0x674b20[_0xf26d('0x18')](_0x39fb15,_0x3ada2f,undefined,'[]')||_0x674b20['isBetween'](_0x3b740d,_0x10c082,undefined,'[]');}else{return _0x674b20[_0xf26d('0x18')](_0x39fb15,_0x10c082,undefined,'[]');}}module[_0xf26d('0x10')]['timeCompare']=timeCompare;function dowCompare(_0x20b7a7,_0x14c041,_0x3cb626){var _0x261d94=_0x20b7a7[_0xf26d('0x8')]('en')[_0xf26d('0x19')](_0xf26d('0x1a'))[_0xf26d('0xa')]();return circularDoWInterval(_0x14c041,_0x3cb626)[_0xf26d('0x1b')](_0x261d94);}module['exports'][_0xf26d('0x1c')]=dowCompare;function domCompare(_0x40420f,_0x29b499,_0x2a9ddf){var _0xb8c2b0=_0x40420f[_0xf26d('0x1d')]();if(_0x29b499===_0x2a9ddf){return _0xb8c2b0===_0x29b499;}else{var _0x7552ae=_0x40420f['daysInMonth']();var _0x47c507=_0x29b499<_0x2a9ddf;let _0x370bc9=![];var _0x48d452=0x0;var _0x404959=0x0;if(_0x47c507){_0x48d452=Math[_0xf26d('0x1e')](0x1,_0x29b499);_0x404959=Math[_0xf26d('0x1f')](_0x2a9ddf,_0x7552ae);_0x370bc9=_0xb8c2b0>=_0x48d452&&_0xb8c2b0<=_0x404959;}else{_0x48d452=Math['min'](_0x29b499,_0x7552ae);_0x404959=Math['max'](0x1,_0x2a9ddf);_0x370bc9=_0xb8c2b0>=_0x48d452||_0xb8c2b0<=_0x404959;}return _0x370bc9;}}module[_0xf26d('0x10')][_0xf26d('0x20')]=domCompare;function monthCompare(_0x26503e,_0x5cd493,_0x4266c4){var _0x418b39=_0x26503e[_0xf26d('0x8')]('en')[_0xf26d('0x19')](_0xf26d('0x21'))[_0xf26d('0xa')]();return circularMonthInterval(_0x5cd493,_0x4266c4)[_0xf26d('0x1b')](_0x418b39);}module[_0xf26d('0x10')]['monthCompare']=monthCompare;function iftime(_0x1cea80,_0x5329e3=moment['tz'][_0xf26d('0x22')](),_0x3826d8=moment()){if(!validateRx['test'](_0x1cea80)){throw new Error(EINVALID_STRING);}else{var _0x2f982a=(moment['isMoment'](_0x3826d8)?_0x3826d8[_0xf26d('0x12')]():moment(_0x3826d8))['tz'](_0x5329e3)[_0xf26d('0x8')]('en');throwIfDateNotValid(_0x2f982a);var _0x50712a=_0x1cea80['split'](',');var _0x40a766=_0x50712a[0x0];var _0x824eba=_0x50712a[0x1];var _0x479570=_0x50712a[0x2];var _0x1b60dd=_0x50712a[0x3];let _0x1878b5=!![];if(_0x40a766!=='*'){var _0x42d8b5=_0x40a766[_0xf26d('0x7')]('-');var _0x9ade96=_[_0xf26d('0x23')](_0x42d8b5[0x0],0x5,'0');var _0x37def5=_0x42d8b5[_0xf26d('0x24')]===0x2?_['padStart'](_0x42d8b5[0x1],0x5,'0'):_0x9ade96;_0x1878b5=timeCompare(_0x2f982a,_0x9ade96,_0x37def5);}let _0x255794=!![];if(_0x824eba!=='*'){var _0x4f8218=_0x824eba['split']('-');var _0x1cf6ec=_0x4f8218[0x0];var _0x7727fc=_0x4f8218[_0xf26d('0x24')]===0x2?_0x4f8218[0x1]:_0x1cf6ec;_0x255794=dowCompare(_0x2f982a,_0x1cf6ec,_0x7727fc);}let _0x303224=!![];if(_0x479570!=='*'){var _0x16e570=_0x479570[_0xf26d('0x7')]('-');var _0x292544=parseDom(_0x16e570[0x0]);var _0x1414de=_0x16e570[_0xf26d('0x24')]===0x2?parseDom(_0x16e570[0x1]):_0x292544;_0x303224=domCompare(_0x2f982a,_0x292544,_0x1414de);}let _0x1b1a6c=!![];if(_0x1b60dd!=='*'){var _0x2924f2=_0x1b60dd['split']('-');var _0x547230=_0x2924f2[0x0];var _0x3cf8c9=_0x2924f2[_0xf26d('0x24')]===0x2?_0x2924f2[0x1]:_0x2924f2[0x0];_0x1b1a6c=monthCompare(_0x2f982a,_0x547230,_0x3cf8c9);}return _0x1878b5&&_0x255794&&_0x303224&&_0x1b1a6c;}}module[_0xf26d('0x10')][_0xf26d('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index dadd888..e39e9e8 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68f0=['length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta'];(function(_0x5256d8,_0x1f45be){var _0x163b69=function(_0x498efd){while(--_0x498efd){_0x5256d8['push'](_0x5256d8['shift']());}};_0x163b69(++_0x1f45be);}(_0x68f0,0x81));var _0x068f=function(_0x2301c1,_0x3c5a47){_0x2301c1=_0x2301c1-0x0;var _0x28f1eb=_0x68f0[_0x2301c1];return _0x28f1eb;};'use strict';var path=require(_0x068f('0x0'));var util=require(_0x068f('0x1'));var moment=require(_0x068f('0x2'));var winston=require('winston');var config=require(_0x068f('0x3'));var debugLevel=config['debugLevel']?config[_0x068f('0x4')][_0x068f('0x5')]():_0x068f('0x6');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':_0x068f('0x7'),'error':_0x068f('0x8'),'warn':_0x068f('0x9'),'info':'white','print':_0x068f('0xa'),'success':'bold\x20green','http':_0x068f('0xb'),'verbose':'bold\x20magenta','debug':_0x068f('0xc'),'silly':_0x068f('0xd')};winston[_0x068f('0xe')](XC_LOG_COLORS);function getLogFileName(_0x4b4211,_0x4e9137,_0x3dd84c){var _0x31cbad=_0x4b4211||_0x068f('0xf');return path[_0x068f('0x10')](_0x31cbad,util['format'](_0x068f('0x11'),_0x4e9137,_0x3dd84c));}function formatter(_0xfdaaa,_0x5289f6){_0x5289f6[_0x068f('0x12')]=_0x5289f6['message'][_0x068f('0x13')](/@@{/g,_0x068f('0x14'))[_0x068f('0x13')](/}@@/g,_0x068f('0x15'))[_0x068f('0x13')](/@{/g,'{{')[_0x068f('0x13')](/}@/g,'}}');return util[_0x068f('0x16')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x068f('0x17')),_0x5289f6[_0x068f('0x18')][_0x068f('0x19')](),_0xfdaaa,_0x5289f6[_0x068f('0x12')]);}function fileFormat(_0xe73fb8,_0x4f4383){_0x4f4383['message']=_0x4f4383[_0x068f('0x12')][_0x068f('0x13')](/@@{/g,_0x068f('0x14'))['replace'](/}@@/g,'}}}')[_0x068f('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5ad40f=_0x4f4383[_0x068f('0x1a')]&&Object['keys'](_0x4f4383['meta'])[_0x068f('0x1b')]?'\x0a\x09'+JSON[_0x068f('0x1c')](_0x4f4383[_0x068f('0x1a')]):'';return util[_0x068f('0x16')](_0x068f('0x1d'),moment()[_0x068f('0x16')](_0x068f('0x17')),_0x4f4383[_0x068f('0x18')][_0x068f('0x19')](),_0xe73fb8,_0x4f4383['message'],_0x5ad40f);}function consoleLogger(){var _0x31860d=new winston[(_0x068f('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x068f('0x1f'))][(_0x068f('0x20'))]({'level':'warn','json':![],'formatter':function(_0x35a497){return formatter('',_0x35a497);}})]});return _0x31860d;}function fileLogger(_0x424572,_0x256039){var _0x4f4ad0=new winston[(_0x068f('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x068f('0x1f'))][(_0x068f('0x21'))]({'name':util[_0x068f('0x16')](_0x068f('0x22'),_0x424572,_0x068f('0x23')),'filename':getLogFileName(_0x256039,_0x424572,_0x068f('0x23')),'level':_0x068f('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x242c9a){return fileFormat(_0x424572,_0x242c9a);}}),new winston[(_0x068f('0x1f'))][(_0x068f('0x21'))]({'name':util[_0x068f('0x16')](_0x068f('0x22'),_0x424572,debugLevel),'filename':getLogFileName(_0x256039,_0x424572,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x973f57){return fileFormat(_0x424572,_0x973f57);}}),new winston[(_0x068f('0x1f'))]['Console']({'level':_0x068f('0x24'),'json':![],'formatter':function(_0x218024){return fileFormat(_0x424572,_0x218024);}})]});return _0x4f4ad0;}exports[_0x068f('0x25')]=consoleLogger;exports[_0x068f('0x26')]=fileLogger; \ No newline at end of file +var _0xcc89=['length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','path','moment','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','{{{','replace','}}}','format','level','toUpperCase','meta'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xcc89,0x134));var _0x9cc8=function(_0x47da59,_0x2a4006){_0x47da59=_0x47da59-0x0;var _0x4c59ed=_0xcc89[_0x47da59];return _0x4c59ed;};'use strict';var path=require(_0x9cc8('0x0'));var util=require('util');var moment=require(_0x9cc8('0x1'));var winston=require('winston');var config=require(_0x9cc8('0x2'));var debugLevel=config[_0x9cc8('0x3')]?config[_0x9cc8('0x3')][_0x9cc8('0x4')]():'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':_0x9cc8('0x5'),'warn':_0x9cc8('0x6'),'info':_0x9cc8('0x7'),'print':_0x9cc8('0x8'),'success':_0x9cc8('0x9'),'http':'gray','verbose':_0x9cc8('0xa'),'debug':_0x9cc8('0xb'),'silly':_0x9cc8('0xc')};winston[_0x9cc8('0xd')](XC_LOG_COLORS);function getLogFileName(_0x58ade2,_0x36547d,_0x3a26c6){var _0x154855=_0x58ade2||_0x9cc8('0xe');return path[_0x9cc8('0xf')](_0x154855,util['format'](_0x9cc8('0x10'),_0x36547d,_0x3a26c6));}function formatter(_0x2817af,_0x667e5f){_0x667e5f[_0x9cc8('0x11')]=_0x667e5f[_0x9cc8('0x11')]['replace'](/@@{/g,_0x9cc8('0x12'))[_0x9cc8('0x13')](/}@@/g,_0x9cc8('0x14'))[_0x9cc8('0x13')](/@{/g,'{{')[_0x9cc8('0x13')](/}@/g,'}}');return util[_0x9cc8('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x9cc8('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),_0x667e5f[_0x9cc8('0x16')][_0x9cc8('0x17')](),_0x2817af,_0x667e5f[_0x9cc8('0x11')]);}function fileFormat(_0x151fd6,_0x570269){_0x570269[_0x9cc8('0x11')]=_0x570269[_0x9cc8('0x11')]['replace'](/@@{/g,_0x9cc8('0x12'))[_0x9cc8('0x13')](/}@@/g,_0x9cc8('0x14'))['replace'](/@{/g,'{{')[_0x9cc8('0x13')](/}@/g,'}}');var _0x1b1b71=_0x570269['meta']&&Object['keys'](_0x570269[_0x9cc8('0x18')])[_0x9cc8('0x19')]?'\x0a\x09'+JSON[_0x9cc8('0x1a')](_0x570269['meta']):'';return util[_0x9cc8('0x15')](_0x9cc8('0x1b'),moment()[_0x9cc8('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),_0x570269[_0x9cc8('0x16')][_0x9cc8('0x17')](),_0x151fd6,_0x570269[_0x9cc8('0x11')],_0x1b1b71);}function consoleLogger(){var _0x101ad1=new winston[(_0x9cc8('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9cc8('0x1d'))][(_0x9cc8('0x1e'))]({'level':_0x9cc8('0x1f'),'json':![],'formatter':function(_0x3e773a){return formatter('',_0x3e773a);}})]});return _0x101ad1;}function fileLogger(_0x40f229,_0x3f6d2f){var _0xcc76b3=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9cc8('0x1d'))][(_0x9cc8('0x20'))]({'name':util[_0x9cc8('0x15')]('%s-%s',_0x40f229,_0x9cc8('0x21')),'filename':getLogFileName(_0x3f6d2f,_0x40f229,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26d47d){return fileFormat(_0x40f229,_0x26d47d);}}),new winston[(_0x9cc8('0x1d'))]['File']({'name':util[_0x9cc8('0x15')](_0x9cc8('0x22'),_0x40f229,debugLevel),'filename':getLogFileName(_0x3f6d2f,_0x40f229,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xf1ab75){return fileFormat(_0x40f229,_0xf1ab75);}}),new winston[(_0x9cc8('0x1d'))][(_0x9cc8('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x2284cf){return fileFormat(_0x40f229,_0x2284cf);}})]});return _0xcc76b3;}exports[_0x9cc8('0x23')]=consoleLogger;exports[_0x9cc8('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 7d48869..b0e336c 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 _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x1a85,0x178));var _0x51a8=function(_0x168765,_0x534f44){_0x168765=_0x168765-0x0;var _0x3ee3a0=_0x1a85[_0x168765];return _0x3ee3a0;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0xb096ae,_0x439a75){var _0x1033eb=function(_0x4668e4){while(--_0x4668e4){_0xb096ae['push'](_0xb096ae['shift']());}};_0x1033eb(++_0x439a75);}(_0x2ef3,0xba));var _0x32ef=function(_0x194767,_0x1821ff){_0x194767=_0x194767-0x0;var _0xbb2abe=_0x2ef3[_0x194767];return _0xbb2abe;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 32257b4..40aa921 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 _0x14a0=['string','replace','isPlainObject','keys','exports','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x14a0,0x8e));var _0x014a=function(_0x2e75bc,_0x30666d){_0x2e75bc=_0x2e75bc-0x0;var _0x4216ec=_0x14a0[_0x2e75bc];return _0x4216ec;};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 +var _0xefda=['replace','isArray','map','isPlainObject','reduce','exports','lodash','\x20}\x20}','string'];(function(_0x402803,_0x484504){var _0x369837=function(_0x2449c3){while(--_0x2449c3){_0x402803['push'](_0x402803['shift']());}};_0x369837(++_0x484504);}(_0xefda,0x96));var _0xaefd=function(_0x41601d,_0x36ad17){_0x41601d=_0x41601d-0x0;var _0x1d5fb2=_0xefda[_0x41601d];return _0x1d5fb2;};var _=require(_0xaefd('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4ae616){return _0x4ae616==='{{'?'{\x20{\x20':_0xaefd('0x1');}function safeTemplate(_0x2ccc67){var _0x4ae272=_0x2ccc67;if(typeof _0x2ccc67===_0xaefd('0x2')){_0x4ae272=_0x2ccc67[_0xaefd('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xaefd('0x4')](_0x2ccc67)){_0x4ae272=_0x2ccc67[_0xaefd('0x5')](function(_0x1ef6b4){return safeTemplate(_0x1ef6b4);});}else if(_[_0xaefd('0x6')](_0x2ccc67)){_0x4ae272=Object['keys'](_0x2ccc67)[_0xaefd('0x7')](function(_0x3b9736,_0x24d10c){_0x3b9736[_0x24d10c]=safeTemplate(_0x2ccc67[_0x24d10c]);return _0x3b9736;},{});}return _0x4ae272;}module[_0xaefd('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 230896a..d25da1e 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x918c=['string','NODE_PATH','pathExists','then','info','writeJSON','exports','fs-extra','path','../config/environment','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env'];(function(_0x5d728f,_0xfbad5f){var _0x440b1a=function(_0x4260db){while(--_0x4260db){_0x5d728f['push'](_0x5d728f['shift']());}};_0x440b1a(++_0xfbad5f);}(_0x918c,0x111));var _0xc918=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x918c[_0xc8a931];return _0x28bd27;};var fs=require(_0xc918('0x0'));var path=require(_0xc918('0x1'));var config=require(_0xc918('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0xc918('0x3'));var NODEPATH=path[_0xc918('0x4')](root,_0xc918('0x5'));function setLegacyLibsNodeEnvPath(_0x3cccdd){let _0x59637d=![];if(Array[_0xc918('0x6')](_0x3cccdd[_0xc918('0x7')])){var _0x18bdc8=_0x3cccdd[_0xc918('0x7')][_0xc918('0x8')](function(_0x26fcdc){return _0x26fcdc[_0xc918('0x9')]===_0xc918('0xa');});if(_0x18bdc8>-0x1){var _0x44e88a=_0x3cccdd[_0xc918('0x7')][_0x18bdc8];if(typeof _0x44e88a[_0xc918('0xb')]['NODE_PATH']!==_0xc918('0xc')){_0x44e88a[_0xc918('0xb')][_0xc918('0xd')]=NODEPATH;_0x59637d=!![];}}return{'appConfig':_0x3cccdd,'updated':_0x59637d};}}function updateAppConfig(_0x5a2a67){return fs[_0xc918('0xe')](APP_JSON_PATH)['then'](function(_0x20390e){if(_0x20390e){return fs['readJSON'](APP_JSON_PATH)[_0xc918('0xf')](function(_0x2a05a6){var _0x3e11dd=setLegacyLibsNodeEnvPath(_0x2a05a6);if(_0x3e11dd['updated']){_0x5a2a67[_0xc918('0x10')]('Updating\x20app.json');return fs[_0xc918('0x11')](APP_JSON_PATH,_0x2a05a6,{'spaces':0x2});}else{return Promise[_0xc918('0x4')]();}});}else{return Promise[_0xc918('0x4')]();}});}module[_0xc918('0x12')]=updateAppConfig; \ No newline at end of file +var _0xe88b=['info','Updating\x20app.json','writeJSON','fs-extra','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','name','env','NODE_PATH','string','pathExists','then','readJSON','updated'];(function(_0x179914,_0x575a92){var _0x4a75af=function(_0x464432){while(--_0x464432){_0x179914['push'](_0x179914['shift']());}};_0x4a75af(++_0x575a92);}(_0xe88b,0x1cb));var _0xbe88=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0xe88b[_0x3e21f4];return _0x40fc49;};var fs=require(_0xbe88('0x0'));var path=require('path');var config=require(_0xbe88('0x1'));var root=config[_0xbe88('0x2')];var APP_JSON_PATH=path[_0xbe88('0x3')](root,_0xbe88('0x4'));var NODEPATH=path['resolve'](root,_0xbe88('0x5'));function setLegacyLibsNodeEnvPath(_0x5577b5){let _0x486678=![];if(Array[_0xbe88('0x6')](_0x5577b5[_0xbe88('0x7')])){var _0x319931=_0x5577b5[_0xbe88('0x7')]['findIndex'](function(_0x1e4074){return _0x1e4074[_0xbe88('0x8')]==='motion2';});if(_0x319931>-0x1){var _0xff07ec=_0x5577b5[_0xbe88('0x7')][_0x319931];if(typeof _0xff07ec[_0xbe88('0x9')][_0xbe88('0xa')]!==_0xbe88('0xb')){_0xff07ec['env'][_0xbe88('0xa')]=NODEPATH;_0x486678=!![];}}return{'appConfig':_0x5577b5,'updated':_0x486678};}}function updateAppConfig(_0x155b22){return fs[_0xbe88('0xc')](APP_JSON_PATH)[_0xbe88('0xd')](function(_0x35f361){if(_0x35f361){return fs[_0xbe88('0xe')](APP_JSON_PATH)[_0xbe88('0xd')](function(_0x3886d6){var _0xc197a5=setLegacyLibsNodeEnvPath(_0x3886d6);if(_0xc197a5[_0xbe88('0xf')]){_0x155b22[_0xbe88('0x10')](_0xbe88('0x11'));return fs[_0xbe88('0x12')](APP_JSON_PATH,_0x3886d6,{'spaces':0x2});}else{return Promise[_0xbe88('0x3')]();}});}else{return Promise[_0xbe88('0x3')]();}});}module['exports']=updateAppConfig; \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js b/snippet/3.5.0/scripts/chat.js deleted file mode 100644 index 49ad0c7..0000000 --- a/snippet/3.5.0/scripts/chat.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see chat.js.LICENSE.txt */ -(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(t){h.errors[e]=t.data,g()}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

Start Time: "+s()(a).format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write("

Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); -//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.8.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.8.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.8.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.8.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg b/snippet/3.8.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.8.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.5.0/index.html b/snippet/3.8.0/index.html similarity index 69% rename from snippet/3.5.0/index.html rename to snippet/3.8.0/index.html index c06e349..41ea1e2 100644 --- a/snippet/3.5.0/index.html +++ b/snippet/3.8.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
+ " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file diff --git a/snippet/3.5.0/scripts/app.js b/snippet/3.8.0/scripts/app.js similarity index 100% rename from snippet/3.5.0/scripts/app.js rename to snippet/3.8.0/scripts/app.js diff --git a/snippet/3.5.0/scripts/app.js.LICENSE.txt b/snippet/3.8.0/scripts/app.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/app.js.LICENSE.txt rename to snippet/3.8.0/scripts/app.js.LICENSE.txt diff --git a/snippet/3.8.0/scripts/chat.js b/snippet/3.8.0/scripts/chat.js new file mode 100644 index 0000000..188fe92 --- /dev/null +++ b/snippet/3.8.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0,forceDownload:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(n){var o,r,s;403===(null===(o=n.data)||void 0===o?void 0:o.code)&&"OutOfInterval"===(null===(r=n.data)||void 0===r||null===(s=r.details)||void 0===s?void 0:s.type)?(t.settings.online=!1,t.settings.outOfInterval=!0,a.go("app.offline",null,{location:"replace"})):(h.errors[e]=n.data,g())}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(n){const o=i.fields[n],a=s.find(".upload-item");if(a.length){const n=angular.element(a[0].querySelector(".upload-button")),s=angular.element(a[0].querySelector("input[type=file]")),d=n.find("label");d.length&&d.css("display","none"),n.on("click",(()=>{d.css("display","none"),"function"==typeof s.trigger?s.trigger("click"):s[0].click()})),s.on("change",(n=>{e.$apply((function(){"string"==typeof o.props.error&&(o.props.error=null);const e=Array.from(n.target.files),s=1048576*o.config.size;e.some((e=>e.size>=s))?(o.options=[],o.props.error=o.config.sizeErrMessage,function(e){i.errors={},t.$emit("hide");const n=r.simple().textContent("FILE TOO BIG: The max allowed size is "+e+"MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n)}(o.config.size)):o.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[o.props.title]=o.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)})).finally((function(){if(t.settings.outOfInterval){t.settings.outOfInterval=!1;const e=r.simple().textContent("Sorry, your message was not sent.\nWe are offline at the moment.").hideDelay(5e3).toastClass("md-warning-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){e.settings.online?e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"}):(e.settings.outOfInterval=!0,t.go("app.offline",null,{location:"replace"}))}function u(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>u()))}}else t.go("app.waiting",null,{location:"replace"});else u()},a.submit=function(){let t="New chat request \n";for(let n=0;n{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,d()})).catch((function(t){var n,o,r;a.disableItem=!1,403===(null===(n=t.data)||void 0===n?void 0:n.code)&&"OutOfInterval"===(null===(o=t.data)||void 0===o||null===(r=o.details)||void 0===r?void 0:r.type)?(e.settings.online=!1,d()):console.error(t)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){e.messages.length>0&&function(e){const t=document.createElement("div"),n=e.visitor,o=e.settings;let r;for(let a=0;a"+document.title+""),a.document.write(""),a.document.write("

Website: "+o.referer+"

"),a.document.write("

Start Time: "+s()(r).format("YYYY-MM-DD HH:mm:ss")+"

"),a.document.write("

Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"

"),a.document.write(t.innerHTML),a.document.write(""),a.document.close(),a.focus(),a.print(),a.close()}(e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/f4b04fc57c34408c2d9e.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/2444367602029f7ce07b.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/c1e929900f2af303341f.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/cd310ba2c496545551ae.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/c6696015a1b93372d614.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/66a0b4b6e8658e97c814.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js.LICENSE.txt b/snippet/3.8.0/scripts/chat.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/chat.js.LICENSE.txt rename to snippet/3.8.0/scripts/chat.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/chat.js.map b/snippet/3.8.0/scripts/chat.js.map similarity index 52% rename from snippet/3.5.0/scripts/chat.js.map rename to snippet/3.8.0/scripts/chat.js.map index 1f082e3..4fe6373 100644 --- a/snippet/3.5.0/scripts/chat.js.map +++ b/snippet/3.8.0/scripts/chat.js.map @@ -1 +1 @@ -{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/fabio/Work/Xenialab/MotionV3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","forceDownload","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","code","outOfInterval","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","hideDelay","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","goToIf","enableCustomerWriting","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/scripts/mobile.js b/snippet/3.8.0/scripts/mobile.js similarity index 100% rename from snippet/3.5.0/scripts/mobile.js rename to snippet/3.8.0/scripts/mobile.js diff --git a/snippet/3.5.0/scripts/runtime.js b/snippet/3.8.0/scripts/runtime.js similarity index 100% rename from snippet/3.5.0/scripts/runtime.js rename to snippet/3.8.0/scripts/runtime.js diff --git a/snippet/3.5.0/scripts/runtime.js.map b/snippet/3.8.0/scripts/runtime.js.map similarity index 100% rename from snippet/3.5.0/scripts/runtime.js.map rename to snippet/3.8.0/scripts/runtime.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-58d021f3.js b/snippet/3.8.0/scripts/vendor-angular-58d021f3.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-58d021f3.js rename to snippet/3.8.0/scripts/vendor-angular-58d021f3.js diff --git a/snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map b/snippet/3.8.0/scripts/vendor-angular-58d021f3.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map rename to snippet/3.8.0/scripts/vendor-angular-58d021f3.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js b/snippet/3.8.0/scripts/vendor-angular-76f2ed34.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js rename to snippet/3.8.0/scripts/vendor-angular-76f2ed34.js diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.map b/snippet/3.8.0/scripts/vendor-angular-76f2ed34.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.map rename to snippet/3.8.0/scripts/vendor-angular-76f2ed34.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js b/snippet/3.8.0/scripts/vendor-angular-animate.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js rename to snippet/3.8.0/scripts/vendor-angular-animate.js diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-animate.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-animate.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js.map b/snippet/3.8.0/scripts/vendor-angular-animate.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js.map rename to snippet/3.8.0/scripts/vendor-angular-animate.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js b/snippet/3.8.0/scripts/vendor-angular-local-storage.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js rename to snippet/3.8.0/scripts/vendor-angular-local-storage.js diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-local-storage.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-local-storage.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js.map b/snippet/3.8.0/scripts/vendor-angular-local-storage.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js.map rename to snippet/3.8.0/scripts/vendor-angular-local-storage.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js b/snippet/3.8.0/scripts/vendor-angular-material.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js rename to snippet/3.8.0/scripts/vendor-angular-material.js diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-material.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-material.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js.map b/snippet/3.8.0/scripts/vendor-angular-material.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js.map rename to snippet/3.8.0/scripts/vendor-angular-material.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js b/snippet/3.8.0/scripts/vendor-angular-messages.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js rename to snippet/3.8.0/scripts/vendor-angular-messages.js diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-messages.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-messages.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js.map b/snippet/3.8.0/scripts/vendor-angular-messages.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js.map rename to snippet/3.8.0/scripts/vendor-angular-messages.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js b/snippet/3.8.0/scripts/vendor-angular-resource.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js rename to snippet/3.8.0/scripts/vendor-angular-resource.js diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-resource.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-resource.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js.map b/snippet/3.8.0/scripts/vendor-angular-resource.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js.map rename to snippet/3.8.0/scripts/vendor-angular-resource.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js b/snippet/3.8.0/scripts/vendor-angular-sanitize.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js rename to snippet/3.8.0/scripts/vendor-angular-sanitize.js diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-angular-sanitize.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-angular-sanitize.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js.map b/snippet/3.8.0/scripts/vendor-angular-sanitize.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js.map rename to snippet/3.8.0/scripts/vendor-angular-sanitize.js.map diff --git a/snippet/3.5.0/scripts/vendor-emojione.js b/snippet/3.8.0/scripts/vendor-emojione.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojione.js rename to snippet/3.8.0/scripts/vendor-emojione.js diff --git a/snippet/3.5.0/scripts/vendor-emojione.js.map b/snippet/3.8.0/scripts/vendor-emojione.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojione.js.map rename to snippet/3.8.0/scripts/vendor-emojione.js.map diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js b/snippet/3.8.0/scripts/vendor-emojionearea.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js rename to snippet/3.8.0/scripts/vendor-emojionearea.js diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-emojionearea.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-emojionearea.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js.map b/snippet/3.8.0/scripts/vendor-emojionearea.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js.map rename to snippet/3.8.0/scripts/vendor-emojionearea.js.map diff --git a/snippet/3.5.0/scripts/vendor-flow.js b/snippet/3.8.0/scripts/vendor-flow.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js rename to snippet/3.8.0/scripts/vendor-flow.js diff --git a/snippet/3.5.0/scripts/vendor-flow.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-flow.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-flow.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-flow.js.map b/snippet/3.8.0/scripts/vendor-flow.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js.map rename to snippet/3.8.0/scripts/vendor-flow.js.map diff --git a/snippet/3.5.0/scripts/vendor-index.js b/snippet/3.8.0/scripts/vendor-index.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-index.js rename to snippet/3.8.0/scripts/vendor-index.js diff --git a/snippet/3.5.0/scripts/vendor-index.js.map b/snippet/3.8.0/scripts/vendor-index.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-index.js.map rename to snippet/3.8.0/scripts/vendor-index.js.map diff --git a/snippet/3.5.0/scripts/vendor-jquery.js b/snippet/3.8.0/scripts/vendor-jquery.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js rename to snippet/3.8.0/scripts/vendor-jquery.js diff --git a/snippet/3.5.0/scripts/vendor-jquery.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-jquery.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-jquery.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-jquery.js.map b/snippet/3.8.0/scripts/vendor-jquery.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js.map rename to snippet/3.8.0/scripts/vendor-jquery.js.map diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js b/snippet/3.8.0/scripts/vendor-jquery.textcomplete.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js rename to snippet/3.8.0/scripts/vendor-jquery.textcomplete.js diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.map b/snippet/3.8.0/scripts/vendor-jquery.textcomplete.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.map rename to snippet/3.8.0/scripts/vendor-jquery.textcomplete.js.map diff --git a/snippet/3.5.0/scripts/vendor-moment.js b/snippet/3.8.0/scripts/vendor-moment.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js rename to snippet/3.8.0/scripts/vendor-moment.js diff --git a/snippet/3.5.0/scripts/vendor-moment.js.LICENSE.txt b/snippet/3.8.0/scripts/vendor-moment.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js.LICENSE.txt rename to snippet/3.8.0/scripts/vendor-moment.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-moment.js.map b/snippet/3.8.0/scripts/vendor-moment.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js.map rename to snippet/3.8.0/scripts/vendor-moment.js.map diff --git a/snippet/3.5.0/scripts/vendor-ng-embed.js b/snippet/3.8.0/scripts/vendor-ng-embed.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-ng-embed.js rename to snippet/3.8.0/scripts/vendor-ng-embed.js diff --git a/snippet/3.5.0/scripts/vendor-ng-embed.js.map b/snippet/3.8.0/scripts/vendor-ng-embed.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-ng-embed.js.map rename to snippet/3.8.0/scripts/vendor-ng-embed.js.map diff --git a/snippet/3.5.0/scripts/vendor-stateDirectives.js b/snippet/3.8.0/scripts/vendor-stateDirectives.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateDirectives.js rename to snippet/3.8.0/scripts/vendor-stateDirectives.js diff --git a/snippet/3.5.0/scripts/vendor-stateDirectives.js.map b/snippet/3.8.0/scripts/vendor-stateDirectives.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateDirectives.js.map rename to snippet/3.8.0/scripts/vendor-stateDirectives.js.map diff --git a/snippet/3.5.0/scripts/vendor-stateService.js b/snippet/3.8.0/scripts/vendor-stateService.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateService.js rename to snippet/3.8.0/scripts/vendor-stateService.js diff --git a/snippet/3.5.0/scripts/vendor-stateService.js.map b/snippet/3.8.0/scripts/vendor-stateService.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateService.js.map rename to snippet/3.8.0/scripts/vendor-stateService.js.map diff --git a/snippet/3.5.0/scripts/vendor-transition.js b/snippet/3.8.0/scripts/vendor-transition.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-transition.js rename to snippet/3.8.0/scripts/vendor-transition.js diff --git a/snippet/3.5.0/scripts/vendor-transition.js.map b/snippet/3.8.0/scripts/vendor-transition.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-transition.js.map rename to snippet/3.8.0/scripts/vendor-transition.js.map diff --git a/snippet/3.5.0/scripts/vendor-urlMatcher.js b/snippet/3.8.0/scripts/vendor-urlMatcher.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-urlMatcher.js rename to snippet/3.8.0/scripts/vendor-urlMatcher.js diff --git a/snippet/3.5.0/scripts/vendor-urlMatcher.js.map b/snippet/3.8.0/scripts/vendor-urlMatcher.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-urlMatcher.js.map rename to snippet/3.8.0/scripts/vendor-urlMatcher.js.map diff --git a/snippet/3.5.0/styles/app.css b/snippet/3.8.0/styles/app.css similarity index 99% rename from snippet/3.5.0/styles/app.css rename to snippet/3.8.0/styles/app.css index eee3e31..289bcac 100644 --- a/snippet/3.5.0/styles/app.css +++ b/snippet/3.8.0/styles/app.css @@ -23,6 +23,6 @@ * https://github.com/angular/material * @license MIT * v1.2.3 - */html,body{height:100%;position:relative}body{margin:0;padding:0}[tabindex="-1"]:focus{outline:none}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:normal;background-color:inherit;text-align:left;border:none;padding:0;margin:0}select,button,textarea,input{vertical-align:baseline}input[type=reset],input[type=submit],html input[type=button],button{cursor:pointer;-webkit-appearance:button}input[type=reset][disabled],input[type=submit][disabled],html input[type=button][disabled],button[disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(0.4, 0, 0.2, 1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple{position:absolute;transform:translate(-50%, -50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(0.25, 0.8, 0.25, 1),border .9s cubic-bezier(0.25, 0.8, 0.25, 1),width .9s cubic-bezier(0.25, 0.8, 0.25, 1),height .9s cubic-bezier(0.25, 0.8, 0.25, 1),opacity .9s cubic-bezier(0.25, 0.8, 0.25, 1),transform .9s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple.md-ripple-scaled{transform:translate(-50%, -50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(0.25, 0.8, 0.25, 1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0px)}@media(min-width: 960px){.md-padding{padding:16px}}html[dir=rtl],html[dir=ltr],body[dir=rtl],body[dir=ltr]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}html,body{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:default;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-0.01em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-0.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.01em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.01em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.02em}.md-button{letter-spacing:.01em}button,select,html,textarea,input{font-family:Roboto,"Helvetica Neue",sans-serif}select,button,textarea,input{font-size:100%}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}.md-panel-inner-wrapper{position:fixed}._md-panel-offscreen{left:-9999px}._md-panel-hidden{display:none}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:relative}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(0.4, 0, 1, 1)}.md-panel._md-panel-animate-scale-out,.md-panel._md-panel-animate-fade-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:fixed;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(0.4, 0, 1, 1)}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:transparent;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] .md-show-clear-button button{display:block;position:absolute;right:0;top:20px;width:30px;height:30px}md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:30px}[dir=rtl] md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:0;padding-left:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap md-input-container,md-autocomplete md-autocomplete-wrap input{flex:1 1 0;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete .md-show-clear-button button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:transparent;margin:auto 5px}md-autocomplete .md-show-clear-button button:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-autocomplete .md-show-clear-button button:focus{outline:none}md-autocomplete .md-show-clear-button button:focus:after{transform:scale(1);opacity:1}md-autocomplete .md-show-clear-button button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0) scale(0.9)}md-autocomplete .md-show-clear-button button md-icon path{stroke-width:0}md-autocomplete .md-show-clear-button button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete .md-show-clear-button button.ng-leave{transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast: active){md-autocomplete input{border:1px solid #fff}md-autocomplete .md-autocomplete-suggestion:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container,.md-standard-list-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);z-index:100;height:100%}.md-virtual-repeat-container.md-autocomplete-suggestions-container .highlight,.md-standard-list-container.md-autocomplete-suggestions-container .highlight{font-weight:bold}.md-standard-list-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;overflow-y:auto;padding:0}.md-virtual-repeat-container.md-not-found,.md-standard-list-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions .md-autocomplete-suggestion{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions .md-autocomplete-suggestion:focus{outline:none}.md-autocomplete-suggestions .md-autocomplete-suggestion:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast: active){md-autocomplete,.md-autocomplete-suggestions{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed !important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity 400ms}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0, 80px, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0, 100%, 0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0, 80px, 0) !important}md-bottom-sheet.ng-leave-active{transform:translate3d(0, 100%, 0) !important;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:none}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media(max-width: 960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n + 1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media(min-width: 960px)and (max-width: 1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media(min-width: 1280px)and (max-width: 1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media(min-width: 1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast: active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:2px;box-sizing:border-box;user-select:none;outline:none;border:0;padding:0 8px;margin:6px 8px;background:transparent;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(0.25, 0.8, 0.25, 1),background-color .4s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){min-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){line-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){font-size:13px}.md-button:focus{outline:none}.md-button:hover,.md-button:focus{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:none}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button.md-fab[disabled]{box-shadow:none}.md-button:not([disabled]).md-raised.md-focused,.md-button:not([disabled]).md-fab.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-raised:active,.md-button:not([disabled]).md-fab:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:inherit;background-clip:padding-box;overflow:hidden;-webkit-transform:translateZ(0)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, 42px, 0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0, 41px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, -42px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0, -43px, 0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0px 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0px 0px 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0px 2px 2px 0px}@media screen and (-ms-high-contrast: active){.md-button.md-raised,.md-button.md-fab{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar md-icon>svg{height:inherit;width:inherit}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card>img,md-card>md-card-header img,md-card md-card-title-media img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card md-card-actions{margin:8px}md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast: active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-inline-form md-checkbox{margin-top:14px;margin-bottom:auto}md-checkbox{box-sizing:border-box;display:inline-block;white-space:nowrap;cursor:pointer;outline:none;user-select:none;position:relative;min-width:18px;min-height:48px}.md-dense>md-checkbox:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) md-checkbox:not(.md-dense-disabled){min-height:36px}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox .md-container{top:auto;left:auto;right:auto;margin:3px;margin-top:21px}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-top:10px;margin-bottom:auto;margin-left:36px}[dir=rtl] md-checkbox .md-label{margin-left:0;margin-right:36px}md-checkbox .md-label:empty{margin-left:24px;margin-right:0}[dir=rtl] md-checkbox .md-label:empty{margin-left:0}[dir=rtl] md-checkbox .md-label:empty{margin-right:24px}md-input-container .md-checkbox-link-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;cursor:pointer;top:-21px;margin-left:18px;margin-right:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-left:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-right:18px}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-name,.md-contact-suggestion .md-contact-email{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}md-chips{display:flex}.md-chips{display:flex;flex-wrap:wrap;flex-grow:1;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:13px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:"";display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:28px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:28px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:none}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:transparent;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;min-height:18px;min-width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;flex-grow:1;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input{width:100%}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=url],.md-chips .md-chip-input-container input[type=text]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=url]:focus,.md-chips .md-chip-input-container input[type=text]:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:transparent;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:transparent;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast: active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible !important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(0.25, 0.8, 0.25, 1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}.md-calendar-month-label.md-calendar-label-clickable{cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:normal}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;vertical-align:middle}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:none;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:"";speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-16px;top:13.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label .md-input{float:none}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}._md-datepicker-has-triangle-icon{padding-right:18px;margin-right:-18px}[dir=rtl] ._md-datepicker-has-triangle-icon{padding-right:0;padding-left:18px}[dir=rtl] ._md-datepicker-has-triangle-icon{margin-right:auto;margin-left:-18px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:transparent;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:transparent;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(0.5, 0, 0.25, 1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:none}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;bottom:-2.5px;transform:translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-value>label,.md-datepicker-open.md-input-has-placeholder>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(0.25, 0.8, 0.25, 1);transition-delay:.125s}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 100%) scale(0.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>*:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:none}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast: active){md-dialog{border:1px solid #fff}}@media(max-width: 959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-divider,.layout-gt-xs-row:not(.layout-sm-column)>md-divider,.layout-sm-row:not(.layout-sm-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-sm-row:not(.layout-md-column)>md-divider,.layout-md-row:not(.layout-md-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-md-row:not(.layout-lg-column)>md-divider,.layout-lg-row:not(.layout-lg-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) md-fab-trigger,md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible !important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all 200ms ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-0.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-0.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent !important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile>figure,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile-footer{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-header,md-grid-list md-grid-tile md-grid-tile-footer{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-footer h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast: active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0px;vertical-align:middle}md-input-container:after{content:"";display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container textarea,md-input-container input[type=text],md-input-container input[type=password],md-input-container input[type=datetime],md-input-container input[type=datetime-local],md-input-container input[type=date],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week],md-input-container input[type=number],md-input-container input[type=email],md-input-container input[type=url],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=color]{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:30px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:30px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:" *";font-size:13px;vertical-align:top}md-input-container label:not(.md-no-float):not(.md-container-ignore),md-input-container .md-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;padding-right:0;z-index:1;transform:translate3d(0, 28px, 0) scale(1);transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-left:0}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-right:2px}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{transform-origin:right top}md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-input-has-value .md-placeholder{padding-left:3px;padding-right:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-left:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-right:3px}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0, 30px, 0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0, 24px, 0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value):not(.md-input-has-placeholder) input:not(:focus){color:transparent}md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:none;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;transition:border-color .4s cubic-bezier(0.25, 0.8, 0.25, 1);width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{padding-left:2px}[dir=rtl] md-input-container .md-input{padding-right:0}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:none}md-input-container .md-input:invalid{outline:none;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none !important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-message-animation,md-input-container .md-char-counter{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);opacity:1;margin-top:0;padding-top:8px}md-input-container .md-input-message-animation:not(.md-char-counter),md-input-container .md-char-counter:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter-prepare{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter:not(.ng-enter-active){opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0, 6px, 0) scale(0.75);transition:transform cubic-bezier(0.25, 0.8, 0.25, 1) .4s,width cubic-bezier(0.25, 0.8, 0.25, 1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container.md-input-focused .md-input,md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}md-input-container .md-input[disabled],[disabled] md-input-container .md-input{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder{width:calc(100% - 36px);padding:0}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left.md-icon-right>label .md-placeholder{width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:"";display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:transparent;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast: active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0px 8px 0px}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:1.2em}md-list.md-dense:not(.md-dense-disabled) md-list-item,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner{min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item::before,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner::before{content:"";min-height:40px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner md-icon:first-child{width:20px;height:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:36px;margin-top:4px;margin-bottom:4px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px;margin-top:6px;margin-bottom:6px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container .md-secondary.md-button,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container .md-secondary.md-button{margin-top:4px;margin-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container md-checkbox:not(.md-dense-disabled),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container md-checkbox:not(.md-dense-disabled){min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px;padding-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style::before{content:"";min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style::before{content:"";min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}md-list.md-dense:not(.md-dense-disabled) .md-subheader-inner{padding-top:12px;padding-bottom:12px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0px 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner::before{content:"";min-height:inherit;visibility:hidden;display:inline-block}md-list-item.md-no-proxy,md-list-item .md-no-style{position:relative;padding:0px 16px;flex:1 1 auto}md-list-item.md-no-proxy.md-button,md-list-item .md-no-style.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item.md-no-proxy.md-button,[dir=rtl] md-list-item .md-no-style.md-button{text-align:right}md-list-item.md-no-proxy.md-button>.md-ripple-container,md-list-item .md-no-style.md-button>.md-ripple-container{border-radius:0}md-list-item.md-no-proxy:focus,md-list-item .md-no-style:focus{outline:none}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0 !important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item::before,md-list-item .md-list-item-inner::before{content:"";min-height:48px;visibility:hidden;display:inline-block}md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item .md-list-item-inner md-checkbox.md-secondary{align-self:center}md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label{display:none}md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item>md-checkbox,md-list-item .md-list-item-inner>md-checkbox{width:24px;min-height:40px;margin-left:0px;margin-right:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-left:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-right:0px}md-list-item .md-secondary-container,md-list-item .md-list-item-inner .md-secondary-container{display:flex;align-items:center;position:relative;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-left:0}md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-checkbox,md-list-item .md-list-item-inner .md-secondary-container md-checkbox{margin:0 6px;padding:0 8px;min-height:40px}md-list-item .md-secondary-container md-checkbox:last-child,md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{width:40px;margin-right:0}[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-switch,md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-secondary-container md-switch,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item>p,md-list-item>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item .md-list-item-inner>.md-list-item-inner>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.01em;margin:0 0 0 0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.01em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.01em;margin:0 0 0 0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:"";min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list-item.md-2-line>md-icon:first-child,md-list-item.md-2-line>.md-no-style>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:"";min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>md-icon:first-child,md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px;max-height:calc(100vh - 10px);overflow:auto}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:200ms}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:200ms;transition-delay:100ms}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:32px}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media(max-width: 959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media(min-width: 960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px}md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:right}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:right;margin:0 8px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:left}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:normal;border-radius:0px;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:"▼";position:absolute;top:0px;speak:none;transform:rotate(270deg) scaleY(0.45) scaleX(0.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(0.45) scaleX(0.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:none;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1)}.md-button._md-nav-button:focus{outline:none}md-nav-ink-bar{background-color:#000;position:absolute;bottom:0;left:0;width:100%;height:2px;transform-origin:left top;will-change:transform;transition:transform .125s cubic-bezier(0.35, 0, 0.25, 1)}md-nav-ink-bar.ng-animate{transition:none}md-nav-extra-content{min-height:48px;padding-right:12px}@keyframes indeterminate-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block;transform:scale(1, 1)}[dir=rtl] md-progress-circular{transform:scale(-1, 1)}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 1568.63ms linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0 !important;margin-bottom:0 !important;transform:scale(1, 1)}[dir=rtl] md-progress-linear{transform:scale(-1, 1)}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0, 0) scale(1, 1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px !important;background-position:0px -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent !important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(0.3, 1)}100%{opacity:0;transform:translateX(-50%) scale(0, 1)}}@keyframes buffer{0%{opacity:1;background-position:0px -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(0.1);animation-timing-function:linear}36.6%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.334731432, 0.124819821, 0.785843996, 1)}69.15%{transform:scaleX(0.83);animation-timing-function:cubic-bezier(0.225732004, 0, 0.233648906, 1.3709798)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.1666666667%;animation-timing-function:linear}20%{left:-105.1666666667%;animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(0.302435, 0.38135197, 0.55, 0.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.205028172, 0.057050836, 0.57660995, 0.453970841)}19.15%{transform:scaleX(0.57);animation-timing-function:cubic-bezier(0.152312994, 0.196431957, 0.648373778, 1.00431535)}44.15%{transform:scaleX(0.91);animation-timing-function:cubic-bezier(0.25775882, -0.003163357, 0.211761916, 1.38178961)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(0.15, 0, 0.5150584, 0.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(0.3103299, 0.284057684, 0.8, 0.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(0.4, 0.627034903, 0.6, 0.902025796)}100%{left:117.3888888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(0.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group:focus{outline:none}md-radio-group.md-focused.ng-not-empty .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group.md-focused.ng-empty>md-radio-button:first-child .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-radio-button,.layout-xs-row>md-radio-button{margin-bottom:0}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-radio-button,.layout-gt-xs-row:not(.layout-sm-column)>md-radio-button,.layout-sm-row:not(.layout-sm-column)>md-radio-button{margin-bottom:0}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-sm-row:not(.layout-md-column)>md-radio-button,.layout-md-row:not(.layout-md-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-md-row:not(.layout-lg-column)>md-radio-button,.layout-lg-row:not(.layout-lg-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button{margin-bottom:0}}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px 10px 2px 6px;box-sizing:border-box;margin-top:0;margin-bottom:0}.md-inline-form md-radio-group md-radio-button .md-label{top:4px}.md-inline-form md-radio-group md-radio-button .md-container{margin-top:2px}@media screen and (-ms-high-contrast: active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) md-select:not([placeholder]) .md-select-placeholder span:first-child{transform:translate(-2px, -22px) scale(0.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto !important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transition-delay:100ms}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}.md-inline-form md-select{margin-top:20px}md-input-container>md-select,.md-inline-form md-input-container>md-select{margin-top:0px}md-input-container>md-select{order:2}md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex}md-select[required].ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select.ng-required.ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;padding-bottom:2px;padding-top:1px;transform:translateY(1px)}md-select:focus{outline:none}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]):focus .md-select-value{border-bottom-style:solid;border-bottom-width:2px;padding-bottom:0px}md-input-container md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px}md-input-container md-select[disabled] .md-select-value{background-position:bottom -1px left 0}md-input-container md-select .md-select-value{min-height:26px;border-bottom-width:1px;padding-bottom:1px}md-input-container md-select .md-select-value.md-select-placeholder{padding-left:0;padding-right:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-left:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-right:0}.md-select-value{display:flex;align-items:center;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-bottom-width:1px;border-bottom-style:solid;background-color:rgba(0,0,0,0);position:relative;box-sizing:content-box;min-width:88px;min-height:26px;margin-bottom:auto;-ms-flex-item-align:start;flex-grow:1}[dir=rtl] .md-select-value{padding-left:2px}[dir=rtl] .md-select-value{padding-right:0}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:right;width:24px;transform:translateY(-2px);font-size:1.2rem}[dir=rtl] .md-select-value .md-select-icon{align-items:flex-start}[dir=rtl] .md-select-value .md-select-icon{text-align:left}.md-select-value .md-select-icon:after{display:block;content:"▼";position:relative;top:2px;right:-4px;left:auto;speak:none;font-size:13px;transform:scaleY(0.5)}[dir=rtl] .md-select-value .md-select-icon:after{right:auto}[dir=rtl] .md-select-value .md-select-icon:after{left:-4px}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:none}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast: active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open-remove.md-closed{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-closed.md-locked-open-add{position:static;display:flex;transform:translate3d(0%, 0, 0)}md-sidenav.md-closed.md-locked-open-add:not(.md-locked-open-add-active){transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0%, 0, 0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%, 0, 0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%, 0)}.md-sidenav-right.md-closed{transform:translate(0%, 0)}@media(min-width: 600px){md-sidenav{max-width:400px}}@media(max-width: 456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast: active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(0.7)}30%{transform:scale(1)}100%{transform:scale(0.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(0.7)}50%{transform:scale(0.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(0.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider *:after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:none;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%, -50%, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(0.7);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:"";position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(0.4) translate3d(0, 67.5px, 0);transition:all .3s cubic-bezier(0.35, 0, 0.25, 1)}md-slider .md-sign:after{position:absolute;content:"";left:0px;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0px}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(0.7);opacity:0;transition:all .35s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(0.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:none}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-track-ticks,md-slider:not([md-discrete]) .md-sign{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(0.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(0.35, 0, 0.25, 1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(0.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(0.4) translate3d(67.5px, 0, 0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>*:first-child:not(md-slider),md-slider-container>*:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:color,max-width}md-slider-container>*:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>*:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>*:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>*:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>*:first-child:not(md-slider),md-slider-container[md-vertical]>*:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast: active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute !important;transform:translate3d(-9999px, -9999px, 0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0, 0, 0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0 0 0 0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}[md-swipe-left],[md-swipe-right]{touch-action:pan-y}[md-swipe-up],[md-swipe-down]{touch-action:pan-x}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:none;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:0px;margin-left:8px}md-switch.md-inverted .md-container{margin-right:initial;margin-left:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-right:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-left:initial}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0, 0, 0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%, 0, 0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:none;height:20px;width:20px;border-radius:50%;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb-container,md-switch:not(.md-dragging) .md-thumb{transition:all .08s linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:.05s}@media screen and (-ms-high-contrast: active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom]>md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom]>md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate(0, 0)}md-tabs-wrapper md-prev-button,md-tabs-wrapper md-next-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(0.35, 0, 0.25, 1)}md-tabs-wrapper md-prev-button:focus,md-tabs-wrapper md-next-button:focus{outline:none}md-tabs-wrapper md-prev-button.md-disabled,md-tabs-wrapper md-next-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-prev-button.ng-leave,md-tabs-wrapper md-next-button.ng-leave{transition:none}md-tabs-wrapper md-prev-button md-icon,md-tabs-wrapper md-next-button md-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}[dir=rtl] md-tabs-wrapper md-prev-button,[dir=rtl] md-tabs-wrapper md-next-button{transform:rotateY(180deg) translateY(-50%)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate(-50%, -50%) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:"";display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:flex;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);position:absolute;left:0;transform:translate(0, 0)}md-pagination-wrapper:after{content:"";display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;justify-content:center}md-pagination-wrapper md-tab-item{min-width:72px}@media(min-width: 600px){md-pagination-wrapper md-tab-item{min-width:160px}}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:flex;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);overflow:auto;transform:translate(0, 0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.ng-leave,md-tab-content.md-no-transition{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div{flex:1 0 100%;min-width:0}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left .125s cubic-bezier(0.35, 0, 0.25, 1),right .25s cubic-bezier(0.35, 0, 0.25, 1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(0.35, 0, 0.25, 1),right .125s cubic-bezier(0.35, 0, 0.25, 1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused,.md-tab:focus{box-shadow:none;outline:none}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs,md-toolbar+md-dialog-content md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 8px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast .md-toast-content{display:flex;flex-direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 16px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0, 0, 0) rotateZ(0deg);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);justify-content:flex-start}md-toast .md-toast-content::before{content:"";min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content,md-toast.md-swipedown .md-toast-content{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0, 100%, 0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0, 0, 0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0, 100%, 0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:8px}[dir=rtl] md-toast .md-button{margin-right:8px}[dir=rtl] md-toast .md-button{margin-left:0}@media(max-width: 959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}}@media(min-width: 960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%, 0, 0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%, 0, 0)}}@media(min-width: 1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast: active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden !important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar *:before,md-toolbar *:after{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools md-checkbox{margin:inherit}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.ng-animate,.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast: active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media(min-width: 0)and (max-width: 959px)and (orientation: portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media(min-width: 0)and (max-width: 959px)and (orientation: landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}.md-tooltip{display:inline-block;pointer-events:none;border-radius:4px;overflow:hidden;opacity:0;font-weight:500;font-size:14px;white-space:nowrap;text-overflow:ellipsis;height:32px;line-height:32px;padding-right:16px;padding-left:16px}.md-tooltip.md-origin-top{transform-origin:center bottom;margin-top:-24px}.md-tooltip.md-origin-right{transform-origin:left center;margin-left:24px}.md-tooltip.md-origin-bottom{transform-origin:center top;margin-top:24px}.md-tooltip.md-origin-left{transform-origin:right center;margin-left:-24px}@media(min-width: 960px){.md-tooltip{font-size:10px;height:22px;line-height:22px;padding-right:8px;padding-left:8px}.md-tooltip.md-origin-top{margin-top:-14px}.md-tooltip.md-origin-right{margin-left:14px}.md-tooltip.md-origin-bottom{margin-top:14px}.md-tooltip.md-origin-left{margin-left:-14px}}.md-tooltip.md-show-add{transform:scale(0)}.md-tooltip.md-show{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms;transform:scale(1);opacity:.9}.md-tooltip.md-hide{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transform:scale(0);opacity:0}.md-truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.md-truncate.md-clip{text-overflow:clip}.md-truncate.flex{width:0}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0px 1px 5px 0px rgba(0,0,0,.2),0px 2px 2px 0px rgba(0,0,0,.14),0px 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0px 1px 8px 0px rgba(0,0,0,.2),0px 3px 4px 0px rgba(0,0,0,.14),0px 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0px 2px 4px -1px rgba(0,0,0,.2),0px 4px 5px 0px rgba(0,0,0,.14),0px 1px 10px 0px rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 5px 8px 0px rgba(0,0,0,.14),0px 1px 14px 0px rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 6px 10px 0px rgba(0,0,0,.14),0px 1px 18px 0px rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0px 4px 5px -2px rgba(0,0,0,.2),0px 7px 10px 1px rgba(0,0,0,.14),0px 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0px 5px 5px -3px rgba(0,0,0,.2),0px 8px 10px 1px rgba(0,0,0,.14),0px 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0px 5px 6px -3px rgba(0,0,0,.2),0px 9px 12px 1px rgba(0,0,0,.14),0px 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0px 6px 6px -3px rgba(0,0,0,.2),0px 10px 14px 1px rgba(0,0,0,.14),0px 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0px 6px 7px -4px rgba(0,0,0,.2),0px 11px 15px 1px rgba(0,0,0,.14),0px 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 12px 17px 2px rgba(0,0,0,.14),0px 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0px 7px 9px -4px rgba(0,0,0,.2),0px 14px 21px 2px rgba(0,0,0,.14),0px 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0px 8px 9px -5px rgba(0,0,0,.2),0px 15px 22px 2px rgba(0,0,0,.14),0px 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0px 8px 10px -5px rgba(0,0,0,.2),0px 16px 24px 2px rgba(0,0,0,.14),0px 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0px 8px 11px -5px rgba(0,0,0,.2),0px 17px 26px 2px rgba(0,0,0,.14),0px 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0px 9px 11px -5px rgba(0,0,0,.2),0px 18px 28px 2px rgba(0,0,0,.14),0px 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0px 9px 12px -6px rgba(0,0,0,.2),0px 19px 29px 2px rgba(0,0,0,.14),0px 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 20px 31px 3px rgba(0,0,0,.14),0px 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 21px 33px 3px rgba(0,0,0,.14),0px 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0px 10px 14px -6px rgba(0,0,0,.2),0px 22px 35px 3px rgba(0,0,0,.14),0px 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0px 11px 14px -7px rgba(0,0,0,.2),0px 23px 36px 3px rgba(0,0,0,.14),0px 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0px 11px 15px -7px rgba(0,0,0,.2),0px 24px 38px 3px rgba(0,0,0,.14),0px 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast: active){md-whiteframe{border:1px solid #fff}}@media print{md-whiteframe,[md-whiteframe]{background-color:#fff}}[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.offset-0,.flex-offset-0,.layout-margin .flex-offset-0,.layout-margin .offset-0{margin-left:0}[dir=rtl] .offset-0,[dir=rtl] .flex-offset-0,[dir=rtl] .layout-margin .flex-offset-0,[dir=rtl] .layout-margin .offset-0{margin-left:auto;margin-right:0}.offset-5,.flex-offset-5,.layout-margin .flex-offset-5,.layout-margin .offset-5{margin-left:5%}[dir=rtl] .offset-5,[dir=rtl] .flex-offset-5,[dir=rtl] .layout-margin .flex-offset-5,[dir=rtl] .layout-margin .offset-5{margin-left:auto;margin-right:5%}.offset-10,.flex-offset-10,.layout-margin .flex-offset-10,.layout-margin .offset-10{margin-left:10%}[dir=rtl] .offset-10,[dir=rtl] .flex-offset-10,[dir=rtl] .layout-margin .flex-offset-10,[dir=rtl] .layout-margin .offset-10{margin-left:auto;margin-right:10%}.offset-15,.flex-offset-15,.layout-margin .flex-offset-15,.layout-margin .offset-15{margin-left:15%}[dir=rtl] .offset-15,[dir=rtl] .flex-offset-15,[dir=rtl] .layout-margin .flex-offset-15,[dir=rtl] .layout-margin .offset-15{margin-left:auto;margin-right:15%}.offset-20,.flex-offset-20,.layout-margin .flex-offset-20,.layout-margin .offset-20{margin-left:20%}[dir=rtl] .offset-20,[dir=rtl] .flex-offset-20,[dir=rtl] .layout-margin .flex-offset-20,[dir=rtl] .layout-margin .offset-20{margin-left:auto;margin-right:20%}.offset-25,.flex-offset-25,.layout-margin .flex-offset-25,.layout-margin .offset-25{margin-left:25%}[dir=rtl] .offset-25,[dir=rtl] .flex-offset-25,[dir=rtl] .layout-margin .flex-offset-25,[dir=rtl] .layout-margin .offset-25{margin-left:auto;margin-right:25%}.offset-30,.flex-offset-30,.layout-margin .flex-offset-30,.layout-margin .offset-30{margin-left:30%}[dir=rtl] .offset-30,[dir=rtl] .flex-offset-30,[dir=rtl] .layout-margin .flex-offset-30,[dir=rtl] .layout-margin .offset-30{margin-left:auto;margin-right:30%}.offset-35,.flex-offset-35,.layout-margin .flex-offset-35,.layout-margin .offset-35{margin-left:35%}[dir=rtl] .offset-35,[dir=rtl] .flex-offset-35,[dir=rtl] .layout-margin .flex-offset-35,[dir=rtl] .layout-margin .offset-35{margin-left:auto;margin-right:35%}.offset-40,.flex-offset-40,.layout-margin .flex-offset-40,.layout-margin .offset-40{margin-left:40%}[dir=rtl] .offset-40,[dir=rtl] .flex-offset-40,[dir=rtl] .layout-margin .flex-offset-40,[dir=rtl] .layout-margin .offset-40{margin-left:auto;margin-right:40%}.offset-45,.flex-offset-45,.layout-margin .flex-offset-45,.layout-margin .offset-45{margin-left:45%}[dir=rtl] .offset-45,[dir=rtl] .flex-offset-45,[dir=rtl] .layout-margin .flex-offset-45,[dir=rtl] .layout-margin .offset-45{margin-left:auto;margin-right:45%}.offset-50,.flex-offset-50,.layout-margin .flex-offset-50,.layout-margin .offset-50{margin-left:50%}[dir=rtl] .offset-50,[dir=rtl] .flex-offset-50,[dir=rtl] .layout-margin .flex-offset-50,[dir=rtl] .layout-margin .offset-50{margin-left:auto;margin-right:50%}.offset-55,.flex-offset-55,.layout-margin .flex-offset-55,.layout-margin .offset-55{margin-left:55%}[dir=rtl] .offset-55,[dir=rtl] .flex-offset-55,[dir=rtl] .layout-margin .flex-offset-55,[dir=rtl] .layout-margin .offset-55{margin-left:auto;margin-right:55%}.offset-60,.flex-offset-60,.layout-margin .flex-offset-60,.layout-margin .offset-60{margin-left:60%}[dir=rtl] .offset-60,[dir=rtl] .flex-offset-60,[dir=rtl] .layout-margin .flex-offset-60,[dir=rtl] .layout-margin .offset-60{margin-left:auto;margin-right:60%}.offset-65,.flex-offset-65,.layout-margin .flex-offset-65,.layout-margin .offset-65{margin-left:65%}[dir=rtl] .offset-65,[dir=rtl] .flex-offset-65,[dir=rtl] .layout-margin .flex-offset-65,[dir=rtl] .layout-margin .offset-65{margin-left:auto;margin-right:65%}.offset-70,.flex-offset-70,.layout-margin .flex-offset-70,.layout-margin .offset-70{margin-left:70%}[dir=rtl] .offset-70,[dir=rtl] .flex-offset-70,[dir=rtl] .layout-margin .flex-offset-70,[dir=rtl] .layout-margin .offset-70{margin-left:auto;margin-right:70%}.offset-75,.flex-offset-75,.layout-margin .flex-offset-75,.layout-margin .offset-75{margin-left:75%}[dir=rtl] .offset-75,[dir=rtl] .flex-offset-75,[dir=rtl] .layout-margin .flex-offset-75,[dir=rtl] .layout-margin .offset-75{margin-left:auto;margin-right:75%}.offset-80,.flex-offset-80,.layout-margin .flex-offset-80,.layout-margin .offset-80{margin-left:80%}[dir=rtl] .offset-80,[dir=rtl] .flex-offset-80,[dir=rtl] .layout-margin .flex-offset-80,[dir=rtl] .layout-margin .offset-80{margin-left:auto;margin-right:80%}.offset-85,.flex-offset-85,.layout-margin .flex-offset-85,.layout-margin .offset-85{margin-left:85%}[dir=rtl] .offset-85,[dir=rtl] .flex-offset-85,[dir=rtl] .layout-margin .flex-offset-85,[dir=rtl] .layout-margin .offset-85{margin-left:auto;margin-right:85%}.offset-90,.flex-offset-90,.layout-margin .flex-offset-90,.layout-margin .offset-90{margin-left:90%}[dir=rtl] .offset-90,[dir=rtl] .flex-offset-90,[dir=rtl] .layout-margin .flex-offset-90,[dir=rtl] .layout-margin .offset-90{margin-left:auto;margin-right:90%}.offset-95,.flex-offset-95,.layout-margin .flex-offset-95,.layout-margin .offset-95{margin-left:95%}[dir=rtl] .offset-95,[dir=rtl] .flex-offset-95,[dir=rtl] .layout-margin .flex-offset-95,[dir=rtl] .layout-margin .offset-95{margin-left:auto;margin-right:95%}.offset-33,.flex-offset-33,.layout-margin .flex-offset-33,.layout-margin .offset-33{margin-left:33.3333333333%}.offset-66,.flex-offset-66,.layout-margin .flex-offset-66,.layout-margin .offset-66{margin-left:66.6666666667%}[dir=rtl] .offset-66,[dir=rtl] .flex-offset-66,[dir=rtl] .layout-margin .flex-offset-66,[dir=rtl] .layout-margin .offset-66{margin-left:auto;margin-right:66.6666666667%}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-start,.layout-align-center-center,.layout-align-center-end,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-start,.layout-align-end-center,.layout-align-end-end,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-start,.layout-align-space-around-end,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-start,.layout-align-space-between-end,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-start-start,.layout-align-center-start,.layout-align-end-start,.layout-align-space-between-start,.layout-align-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-start-center,.layout-align-center-center,.layout-align-end-center,.layout-align-space-between-center,.layout-align-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-start-center>*,.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-between-center>*,.layout-align-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-start-end,.layout-align-center-end,.layout-align-end-end,.layout-align-space-between-end,.layout-align-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-start-stretch,.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-between-stretch,.layout-align-space-around-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-md,.layout-padding>*,.layout-padding-gt-sm>*,.layout-padding-md>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding-gt-lg>*,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg,.layout-padding>.flex-lg,.layout-padding>.flex-gt-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-md,.layout-margin>*,.layout-margin-gt-sm>*,.layout-margin-md>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin-gt-lg>*,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg,.layout-margin>.flex-gt-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media(max-width: 599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.offset-xs-0,.flex-offset-xs-0,.layout-margin .flex-offset-xs-0,.layout-margin .offset-xs-0{margin-left:0}[dir=rtl] .offset-xs-0,[dir=rtl] .flex-offset-xs-0,[dir=rtl] .layout-margin .flex-offset-xs-0,[dir=rtl] .layout-margin .offset-xs-0{margin-left:auto;margin-right:0}.offset-xs-5,.flex-offset-xs-5,.layout-margin .flex-offset-xs-5,.layout-margin .offset-xs-5{margin-left:5%}[dir=rtl] .offset-xs-5,[dir=rtl] .flex-offset-xs-5,[dir=rtl] .layout-margin .flex-offset-xs-5,[dir=rtl] .layout-margin .offset-xs-5{margin-left:auto;margin-right:5%}.offset-xs-10,.flex-offset-xs-10,.layout-margin .flex-offset-xs-10,.layout-margin .offset-xs-10{margin-left:10%}[dir=rtl] .offset-xs-10,[dir=rtl] .flex-offset-xs-10,[dir=rtl] .layout-margin .flex-offset-xs-10,[dir=rtl] .layout-margin .offset-xs-10{margin-left:auto;margin-right:10%}.offset-xs-15,.flex-offset-xs-15,.layout-margin .flex-offset-xs-15,.layout-margin .offset-xs-15{margin-left:15%}[dir=rtl] .offset-xs-15,[dir=rtl] .flex-offset-xs-15,[dir=rtl] .layout-margin .flex-offset-xs-15,[dir=rtl] .layout-margin .offset-xs-15{margin-left:auto;margin-right:15%}.offset-xs-20,.flex-offset-xs-20,.layout-margin .flex-offset-xs-20,.layout-margin .offset-xs-20{margin-left:20%}[dir=rtl] .offset-xs-20,[dir=rtl] .flex-offset-xs-20,[dir=rtl] .layout-margin .flex-offset-xs-20,[dir=rtl] .layout-margin .offset-xs-20{margin-left:auto;margin-right:20%}.offset-xs-25,.flex-offset-xs-25,.layout-margin .flex-offset-xs-25,.layout-margin .offset-xs-25{margin-left:25%}[dir=rtl] .offset-xs-25,[dir=rtl] .flex-offset-xs-25,[dir=rtl] .layout-margin .flex-offset-xs-25,[dir=rtl] .layout-margin .offset-xs-25{margin-left:auto;margin-right:25%}.offset-xs-30,.flex-offset-xs-30,.layout-margin .flex-offset-xs-30,.layout-margin .offset-xs-30{margin-left:30%}[dir=rtl] .offset-xs-30,[dir=rtl] .flex-offset-xs-30,[dir=rtl] .layout-margin .flex-offset-xs-30,[dir=rtl] .layout-margin .offset-xs-30{margin-left:auto;margin-right:30%}.offset-xs-35,.flex-offset-xs-35,.layout-margin .flex-offset-xs-35,.layout-margin .offset-xs-35{margin-left:35%}[dir=rtl] .offset-xs-35,[dir=rtl] .flex-offset-xs-35,[dir=rtl] .layout-margin .flex-offset-xs-35,[dir=rtl] .layout-margin .offset-xs-35{margin-left:auto;margin-right:35%}.offset-xs-40,.flex-offset-xs-40,.layout-margin .flex-offset-xs-40,.layout-margin .offset-xs-40{margin-left:40%}[dir=rtl] .offset-xs-40,[dir=rtl] .flex-offset-xs-40,[dir=rtl] .layout-margin .flex-offset-xs-40,[dir=rtl] .layout-margin .offset-xs-40{margin-left:auto;margin-right:40%}.offset-xs-45,.flex-offset-xs-45,.layout-margin .flex-offset-xs-45,.layout-margin .offset-xs-45{margin-left:45%}[dir=rtl] .offset-xs-45,[dir=rtl] .flex-offset-xs-45,[dir=rtl] .layout-margin .flex-offset-xs-45,[dir=rtl] .layout-margin .offset-xs-45{margin-left:auto;margin-right:45%}.offset-xs-50,.flex-offset-xs-50,.layout-margin .flex-offset-xs-50,.layout-margin .offset-xs-50{margin-left:50%}[dir=rtl] .offset-xs-50,[dir=rtl] .flex-offset-xs-50,[dir=rtl] .layout-margin .flex-offset-xs-50,[dir=rtl] .layout-margin .offset-xs-50{margin-left:auto;margin-right:50%}.offset-xs-55,.flex-offset-xs-55,.layout-margin .flex-offset-xs-55,.layout-margin .offset-xs-55{margin-left:55%}[dir=rtl] .offset-xs-55,[dir=rtl] .flex-offset-xs-55,[dir=rtl] .layout-margin .flex-offset-xs-55,[dir=rtl] .layout-margin .offset-xs-55{margin-left:auto;margin-right:55%}.offset-xs-60,.flex-offset-xs-60,.layout-margin .flex-offset-xs-60,.layout-margin .offset-xs-60{margin-left:60%}[dir=rtl] .offset-xs-60,[dir=rtl] .flex-offset-xs-60,[dir=rtl] .layout-margin .flex-offset-xs-60,[dir=rtl] .layout-margin .offset-xs-60{margin-left:auto;margin-right:60%}.offset-xs-65,.flex-offset-xs-65,.layout-margin .flex-offset-xs-65,.layout-margin .offset-xs-65{margin-left:65%}[dir=rtl] .offset-xs-65,[dir=rtl] .flex-offset-xs-65,[dir=rtl] .layout-margin .flex-offset-xs-65,[dir=rtl] .layout-margin .offset-xs-65{margin-left:auto;margin-right:65%}.offset-xs-70,.flex-offset-xs-70,.layout-margin .flex-offset-xs-70,.layout-margin .offset-xs-70{margin-left:70%}[dir=rtl] .offset-xs-70,[dir=rtl] .flex-offset-xs-70,[dir=rtl] .layout-margin .flex-offset-xs-70,[dir=rtl] .layout-margin .offset-xs-70{margin-left:auto;margin-right:70%}.offset-xs-75,.flex-offset-xs-75,.layout-margin .flex-offset-xs-75,.layout-margin .offset-xs-75{margin-left:75%}[dir=rtl] .offset-xs-75,[dir=rtl] .flex-offset-xs-75,[dir=rtl] .layout-margin .flex-offset-xs-75,[dir=rtl] .layout-margin .offset-xs-75{margin-left:auto;margin-right:75%}.offset-xs-80,.flex-offset-xs-80,.layout-margin .flex-offset-xs-80,.layout-margin .offset-xs-80{margin-left:80%}[dir=rtl] .offset-xs-80,[dir=rtl] .flex-offset-xs-80,[dir=rtl] .layout-margin .flex-offset-xs-80,[dir=rtl] .layout-margin .offset-xs-80{margin-left:auto;margin-right:80%}.offset-xs-85,.flex-offset-xs-85,.layout-margin .flex-offset-xs-85,.layout-margin .offset-xs-85{margin-left:85%}[dir=rtl] .offset-xs-85,[dir=rtl] .flex-offset-xs-85,[dir=rtl] .layout-margin .flex-offset-xs-85,[dir=rtl] .layout-margin .offset-xs-85{margin-left:auto;margin-right:85%}.offset-xs-90,.flex-offset-xs-90,.layout-margin .flex-offset-xs-90,.layout-margin .offset-xs-90{margin-left:90%}[dir=rtl] .offset-xs-90,[dir=rtl] .flex-offset-xs-90,[dir=rtl] .layout-margin .flex-offset-xs-90,[dir=rtl] .layout-margin .offset-xs-90{margin-left:auto;margin-right:90%}.offset-xs-95,.flex-offset-xs-95,.layout-margin .flex-offset-xs-95,.layout-margin .offset-xs-95{margin-left:95%}[dir=rtl] .offset-xs-95,[dir=rtl] .flex-offset-xs-95,[dir=rtl] .layout-margin .flex-offset-xs-95,[dir=rtl] .layout-margin .offset-xs-95{margin-left:auto;margin-right:95%}.offset-xs-33,.flex-offset-xs-33,.layout-margin .flex-offset-xs-33,.layout-margin .offset-xs-33{margin-left:33.3333333333%}.offset-xs-66,.flex-offset-xs-66,.layout-margin .flex-offset-xs-66,.layout-margin .offset-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-xs-66,[dir=rtl] .flex-offset-xs-66,[dir=rtl] .layout-margin .flex-offset-xs-66,[dir=rtl] .layout-margin .offset-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-start,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-start,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-start,.layout-align-xs-space-around-end,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-start,.layout-align-xs-space-between-end,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-start-start,.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-between-start,.layout-align-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-start-center,.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-between-center,.layout-align-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-start-center>*,.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-start-end,.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-between-end,.layout-align-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-start-stretch,.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media(min-width: 600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.offset-gt-xs-0,.flex-offset-gt-xs-0,.layout-margin .flex-offset-gt-xs-0,.layout-margin .offset-gt-xs-0{margin-left:0}[dir=rtl] .offset-gt-xs-0,[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .offset-gt-xs-0{margin-left:auto;margin-right:0}.offset-gt-xs-5,.flex-offset-gt-xs-5,.layout-margin .flex-offset-gt-xs-5,.layout-margin .offset-gt-xs-5{margin-left:5%}[dir=rtl] .offset-gt-xs-5,[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .offset-gt-xs-5{margin-left:auto;margin-right:5%}.offset-gt-xs-10,.flex-offset-gt-xs-10,.layout-margin .flex-offset-gt-xs-10,.layout-margin .offset-gt-xs-10{margin-left:10%}[dir=rtl] .offset-gt-xs-10,[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .offset-gt-xs-10{margin-left:auto;margin-right:10%}.offset-gt-xs-15,.flex-offset-gt-xs-15,.layout-margin .flex-offset-gt-xs-15,.layout-margin .offset-gt-xs-15{margin-left:15%}[dir=rtl] .offset-gt-xs-15,[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .offset-gt-xs-15{margin-left:auto;margin-right:15%}.offset-gt-xs-20,.flex-offset-gt-xs-20,.layout-margin .flex-offset-gt-xs-20,.layout-margin .offset-gt-xs-20{margin-left:20%}[dir=rtl] .offset-gt-xs-20,[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .offset-gt-xs-20{margin-left:auto;margin-right:20%}.offset-gt-xs-25,.flex-offset-gt-xs-25,.layout-margin .flex-offset-gt-xs-25,.layout-margin .offset-gt-xs-25{margin-left:25%}[dir=rtl] .offset-gt-xs-25,[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .offset-gt-xs-25{margin-left:auto;margin-right:25%}.offset-gt-xs-30,.flex-offset-gt-xs-30,.layout-margin .flex-offset-gt-xs-30,.layout-margin .offset-gt-xs-30{margin-left:30%}[dir=rtl] .offset-gt-xs-30,[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .offset-gt-xs-30{margin-left:auto;margin-right:30%}.offset-gt-xs-35,.flex-offset-gt-xs-35,.layout-margin .flex-offset-gt-xs-35,.layout-margin .offset-gt-xs-35{margin-left:35%}[dir=rtl] .offset-gt-xs-35,[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .offset-gt-xs-35{margin-left:auto;margin-right:35%}.offset-gt-xs-40,.flex-offset-gt-xs-40,.layout-margin .flex-offset-gt-xs-40,.layout-margin .offset-gt-xs-40{margin-left:40%}[dir=rtl] .offset-gt-xs-40,[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .offset-gt-xs-40{margin-left:auto;margin-right:40%}.offset-gt-xs-45,.flex-offset-gt-xs-45,.layout-margin .flex-offset-gt-xs-45,.layout-margin .offset-gt-xs-45{margin-left:45%}[dir=rtl] .offset-gt-xs-45,[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .offset-gt-xs-45{margin-left:auto;margin-right:45%}.offset-gt-xs-50,.flex-offset-gt-xs-50,.layout-margin .flex-offset-gt-xs-50,.layout-margin .offset-gt-xs-50{margin-left:50%}[dir=rtl] .offset-gt-xs-50,[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .offset-gt-xs-50{margin-left:auto;margin-right:50%}.offset-gt-xs-55,.flex-offset-gt-xs-55,.layout-margin .flex-offset-gt-xs-55,.layout-margin .offset-gt-xs-55{margin-left:55%}[dir=rtl] .offset-gt-xs-55,[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .offset-gt-xs-55{margin-left:auto;margin-right:55%}.offset-gt-xs-60,.flex-offset-gt-xs-60,.layout-margin .flex-offset-gt-xs-60,.layout-margin .offset-gt-xs-60{margin-left:60%}[dir=rtl] .offset-gt-xs-60,[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .offset-gt-xs-60{margin-left:auto;margin-right:60%}.offset-gt-xs-65,.flex-offset-gt-xs-65,.layout-margin .flex-offset-gt-xs-65,.layout-margin .offset-gt-xs-65{margin-left:65%}[dir=rtl] .offset-gt-xs-65,[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .offset-gt-xs-65{margin-left:auto;margin-right:65%}.offset-gt-xs-70,.flex-offset-gt-xs-70,.layout-margin .flex-offset-gt-xs-70,.layout-margin .offset-gt-xs-70{margin-left:70%}[dir=rtl] .offset-gt-xs-70,[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .offset-gt-xs-70{margin-left:auto;margin-right:70%}.offset-gt-xs-75,.flex-offset-gt-xs-75,.layout-margin .flex-offset-gt-xs-75,.layout-margin .offset-gt-xs-75{margin-left:75%}[dir=rtl] .offset-gt-xs-75,[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .offset-gt-xs-75{margin-left:auto;margin-right:75%}.offset-gt-xs-80,.flex-offset-gt-xs-80,.layout-margin .flex-offset-gt-xs-80,.layout-margin .offset-gt-xs-80{margin-left:80%}[dir=rtl] .offset-gt-xs-80,[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .offset-gt-xs-80{margin-left:auto;margin-right:80%}.offset-gt-xs-85,.flex-offset-gt-xs-85,.layout-margin .flex-offset-gt-xs-85,.layout-margin .offset-gt-xs-85{margin-left:85%}[dir=rtl] .offset-gt-xs-85,[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .offset-gt-xs-85{margin-left:auto;margin-right:85%}.offset-gt-xs-90,.flex-offset-gt-xs-90,.layout-margin .flex-offset-gt-xs-90,.layout-margin .offset-gt-xs-90{margin-left:90%}[dir=rtl] .offset-gt-xs-90,[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .offset-gt-xs-90{margin-left:auto;margin-right:90%}.offset-gt-xs-95,.flex-offset-gt-xs-95,.layout-margin .flex-offset-gt-xs-95,.layout-margin .offset-gt-xs-95{margin-left:95%}[dir=rtl] .offset-gt-xs-95,[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .offset-gt-xs-95{margin-left:auto;margin-right:95%}.offset-gt-xs-33,.flex-offset-gt-xs-33,.layout-margin .flex-offset-gt-xs-33,.layout-margin .offset-gt-xs-33{margin-left:33.3333333333%}.offset-gt-xs-66,.flex-offset-gt-xs-66,.layout-margin .flex-offset-gt-xs-66,.layout-margin .offset-gt-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-xs-66,[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .offset-gt-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-start-start,.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-start-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-start-center>*,.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-start-end,.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-start-stretch,.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media(min-width: 600px)and (max-width: 959px){.hide:not(.show-gt-xs):not(.show-sm):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.offset-sm-0,.flex-offset-sm-0,.layout-margin .flex-offset-sm-0,.layout-margin .offset-sm-0{margin-left:0}[dir=rtl] .offset-sm-0,[dir=rtl] .flex-offset-sm-0,[dir=rtl] .layout-margin .flex-offset-sm-0,[dir=rtl] .layout-margin .offset-sm-0{margin-left:auto;margin-right:0}.offset-sm-5,.flex-offset-sm-5,.layout-margin .flex-offset-sm-5,.layout-margin .offset-sm-5{margin-left:5%}[dir=rtl] .offset-sm-5,[dir=rtl] .flex-offset-sm-5,[dir=rtl] .layout-margin .flex-offset-sm-5,[dir=rtl] .layout-margin .offset-sm-5{margin-left:auto;margin-right:5%}.offset-sm-10,.flex-offset-sm-10,.layout-margin .flex-offset-sm-10,.layout-margin .offset-sm-10{margin-left:10%}[dir=rtl] .offset-sm-10,[dir=rtl] .flex-offset-sm-10,[dir=rtl] .layout-margin .flex-offset-sm-10,[dir=rtl] .layout-margin .offset-sm-10{margin-left:auto;margin-right:10%}.offset-sm-15,.flex-offset-sm-15,.layout-margin .flex-offset-sm-15,.layout-margin .offset-sm-15{margin-left:15%}[dir=rtl] .offset-sm-15,[dir=rtl] .flex-offset-sm-15,[dir=rtl] .layout-margin .flex-offset-sm-15,[dir=rtl] .layout-margin .offset-sm-15{margin-left:auto;margin-right:15%}.offset-sm-20,.flex-offset-sm-20,.layout-margin .flex-offset-sm-20,.layout-margin .offset-sm-20{margin-left:20%}[dir=rtl] .offset-sm-20,[dir=rtl] .flex-offset-sm-20,[dir=rtl] .layout-margin .flex-offset-sm-20,[dir=rtl] .layout-margin .offset-sm-20{margin-left:auto;margin-right:20%}.offset-sm-25,.flex-offset-sm-25,.layout-margin .flex-offset-sm-25,.layout-margin .offset-sm-25{margin-left:25%}[dir=rtl] .offset-sm-25,[dir=rtl] .flex-offset-sm-25,[dir=rtl] .layout-margin .flex-offset-sm-25,[dir=rtl] .layout-margin .offset-sm-25{margin-left:auto;margin-right:25%}.offset-sm-30,.flex-offset-sm-30,.layout-margin .flex-offset-sm-30,.layout-margin .offset-sm-30{margin-left:30%}[dir=rtl] .offset-sm-30,[dir=rtl] .flex-offset-sm-30,[dir=rtl] .layout-margin .flex-offset-sm-30,[dir=rtl] .layout-margin .offset-sm-30{margin-left:auto;margin-right:30%}.offset-sm-35,.flex-offset-sm-35,.layout-margin .flex-offset-sm-35,.layout-margin .offset-sm-35{margin-left:35%}[dir=rtl] .offset-sm-35,[dir=rtl] .flex-offset-sm-35,[dir=rtl] .layout-margin .flex-offset-sm-35,[dir=rtl] .layout-margin .offset-sm-35{margin-left:auto;margin-right:35%}.offset-sm-40,.flex-offset-sm-40,.layout-margin .flex-offset-sm-40,.layout-margin .offset-sm-40{margin-left:40%}[dir=rtl] .offset-sm-40,[dir=rtl] .flex-offset-sm-40,[dir=rtl] .layout-margin .flex-offset-sm-40,[dir=rtl] .layout-margin .offset-sm-40{margin-left:auto;margin-right:40%}.offset-sm-45,.flex-offset-sm-45,.layout-margin .flex-offset-sm-45,.layout-margin .offset-sm-45{margin-left:45%}[dir=rtl] .offset-sm-45,[dir=rtl] .flex-offset-sm-45,[dir=rtl] .layout-margin .flex-offset-sm-45,[dir=rtl] .layout-margin .offset-sm-45{margin-left:auto;margin-right:45%}.offset-sm-50,.flex-offset-sm-50,.layout-margin .flex-offset-sm-50,.layout-margin .offset-sm-50{margin-left:50%}[dir=rtl] .offset-sm-50,[dir=rtl] .flex-offset-sm-50,[dir=rtl] .layout-margin .flex-offset-sm-50,[dir=rtl] .layout-margin .offset-sm-50{margin-left:auto;margin-right:50%}.offset-sm-55,.flex-offset-sm-55,.layout-margin .flex-offset-sm-55,.layout-margin .offset-sm-55{margin-left:55%}[dir=rtl] .offset-sm-55,[dir=rtl] .flex-offset-sm-55,[dir=rtl] .layout-margin .flex-offset-sm-55,[dir=rtl] .layout-margin .offset-sm-55{margin-left:auto;margin-right:55%}.offset-sm-60,.flex-offset-sm-60,.layout-margin .flex-offset-sm-60,.layout-margin .offset-sm-60{margin-left:60%}[dir=rtl] .offset-sm-60,[dir=rtl] .flex-offset-sm-60,[dir=rtl] .layout-margin .flex-offset-sm-60,[dir=rtl] .layout-margin .offset-sm-60{margin-left:auto;margin-right:60%}.offset-sm-65,.flex-offset-sm-65,.layout-margin .flex-offset-sm-65,.layout-margin .offset-sm-65{margin-left:65%}[dir=rtl] .offset-sm-65,[dir=rtl] .flex-offset-sm-65,[dir=rtl] .layout-margin .flex-offset-sm-65,[dir=rtl] .layout-margin .offset-sm-65{margin-left:auto;margin-right:65%}.offset-sm-70,.flex-offset-sm-70,.layout-margin .flex-offset-sm-70,.layout-margin .offset-sm-70{margin-left:70%}[dir=rtl] .offset-sm-70,[dir=rtl] .flex-offset-sm-70,[dir=rtl] .layout-margin .flex-offset-sm-70,[dir=rtl] .layout-margin .offset-sm-70{margin-left:auto;margin-right:70%}.offset-sm-75,.flex-offset-sm-75,.layout-margin .flex-offset-sm-75,.layout-margin .offset-sm-75{margin-left:75%}[dir=rtl] .offset-sm-75,[dir=rtl] .flex-offset-sm-75,[dir=rtl] .layout-margin .flex-offset-sm-75,[dir=rtl] .layout-margin .offset-sm-75{margin-left:auto;margin-right:75%}.offset-sm-80,.flex-offset-sm-80,.layout-margin .flex-offset-sm-80,.layout-margin .offset-sm-80{margin-left:80%}[dir=rtl] .offset-sm-80,[dir=rtl] .flex-offset-sm-80,[dir=rtl] .layout-margin .flex-offset-sm-80,[dir=rtl] .layout-margin .offset-sm-80{margin-left:auto;margin-right:80%}.offset-sm-85,.flex-offset-sm-85,.layout-margin .flex-offset-sm-85,.layout-margin .offset-sm-85{margin-left:85%}[dir=rtl] .offset-sm-85,[dir=rtl] .flex-offset-sm-85,[dir=rtl] .layout-margin .flex-offset-sm-85,[dir=rtl] .layout-margin .offset-sm-85{margin-left:auto;margin-right:85%}.offset-sm-90,.flex-offset-sm-90,.layout-margin .flex-offset-sm-90,.layout-margin .offset-sm-90{margin-left:90%}[dir=rtl] .offset-sm-90,[dir=rtl] .flex-offset-sm-90,[dir=rtl] .layout-margin .flex-offset-sm-90,[dir=rtl] .layout-margin .offset-sm-90{margin-left:auto;margin-right:90%}.offset-sm-95,.flex-offset-sm-95,.layout-margin .flex-offset-sm-95,.layout-margin .offset-sm-95{margin-left:95%}[dir=rtl] .offset-sm-95,[dir=rtl] .flex-offset-sm-95,[dir=rtl] .layout-margin .flex-offset-sm-95,[dir=rtl] .layout-margin .offset-sm-95{margin-left:auto;margin-right:95%}.offset-sm-33,.flex-offset-sm-33,.layout-margin .flex-offset-sm-33,.layout-margin .offset-sm-33{margin-left:33.3333333333%}.offset-sm-66,.flex-offset-sm-66,.layout-margin .flex-offset-sm-66,.layout-margin .offset-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-sm-66,[dir=rtl] .flex-offset-sm-66,[dir=rtl] .layout-margin .flex-offset-sm-66,[dir=rtl] .layout-margin .offset-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-start,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-start,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-start,.layout-align-sm-space-around-end,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-start,.layout-align-sm-space-between-end,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-start-start,.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-between-start,.layout-align-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-start-center,.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-between-center,.layout-align-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-start-center>*,.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-start-end,.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-between-end,.layout-align-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-start-stretch,.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media(min-width: 960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.offset-gt-sm-0,.flex-offset-gt-sm-0,.layout-margin .flex-offset-gt-sm-0,.layout-margin .offset-gt-sm-0{margin-left:0}[dir=rtl] .offset-gt-sm-0,[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .offset-gt-sm-0{margin-left:auto;margin-right:0}.offset-gt-sm-5,.flex-offset-gt-sm-5,.layout-margin .flex-offset-gt-sm-5,.layout-margin .offset-gt-sm-5{margin-left:5%}[dir=rtl] .offset-gt-sm-5,[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .offset-gt-sm-5{margin-left:auto;margin-right:5%}.offset-gt-sm-10,.flex-offset-gt-sm-10,.layout-margin .flex-offset-gt-sm-10,.layout-margin .offset-gt-sm-10{margin-left:10%}[dir=rtl] .offset-gt-sm-10,[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .offset-gt-sm-10{margin-left:auto;margin-right:10%}.offset-gt-sm-15,.flex-offset-gt-sm-15,.layout-margin .flex-offset-gt-sm-15,.layout-margin .offset-gt-sm-15{margin-left:15%}[dir=rtl] .offset-gt-sm-15,[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .offset-gt-sm-15{margin-left:auto;margin-right:15%}.offset-gt-sm-20,.flex-offset-gt-sm-20,.layout-margin .flex-offset-gt-sm-20,.layout-margin .offset-gt-sm-20{margin-left:20%}[dir=rtl] .offset-gt-sm-20,[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .offset-gt-sm-20{margin-left:auto;margin-right:20%}.offset-gt-sm-25,.flex-offset-gt-sm-25,.layout-margin .flex-offset-gt-sm-25,.layout-margin .offset-gt-sm-25{margin-left:25%}[dir=rtl] .offset-gt-sm-25,[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .offset-gt-sm-25{margin-left:auto;margin-right:25%}.offset-gt-sm-30,.flex-offset-gt-sm-30,.layout-margin .flex-offset-gt-sm-30,.layout-margin .offset-gt-sm-30{margin-left:30%}[dir=rtl] .offset-gt-sm-30,[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .offset-gt-sm-30{margin-left:auto;margin-right:30%}.offset-gt-sm-35,.flex-offset-gt-sm-35,.layout-margin .flex-offset-gt-sm-35,.layout-margin .offset-gt-sm-35{margin-left:35%}[dir=rtl] .offset-gt-sm-35,[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .offset-gt-sm-35{margin-left:auto;margin-right:35%}.offset-gt-sm-40,.flex-offset-gt-sm-40,.layout-margin .flex-offset-gt-sm-40,.layout-margin .offset-gt-sm-40{margin-left:40%}[dir=rtl] .offset-gt-sm-40,[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .offset-gt-sm-40{margin-left:auto;margin-right:40%}.offset-gt-sm-45,.flex-offset-gt-sm-45,.layout-margin .flex-offset-gt-sm-45,.layout-margin .offset-gt-sm-45{margin-left:45%}[dir=rtl] .offset-gt-sm-45,[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .offset-gt-sm-45{margin-left:auto;margin-right:45%}.offset-gt-sm-50,.flex-offset-gt-sm-50,.layout-margin .flex-offset-gt-sm-50,.layout-margin .offset-gt-sm-50{margin-left:50%}[dir=rtl] .offset-gt-sm-50,[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .offset-gt-sm-50{margin-left:auto;margin-right:50%}.offset-gt-sm-55,.flex-offset-gt-sm-55,.layout-margin .flex-offset-gt-sm-55,.layout-margin .offset-gt-sm-55{margin-left:55%}[dir=rtl] .offset-gt-sm-55,[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .offset-gt-sm-55{margin-left:auto;margin-right:55%}.offset-gt-sm-60,.flex-offset-gt-sm-60,.layout-margin .flex-offset-gt-sm-60,.layout-margin .offset-gt-sm-60{margin-left:60%}[dir=rtl] .offset-gt-sm-60,[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .offset-gt-sm-60{margin-left:auto;margin-right:60%}.offset-gt-sm-65,.flex-offset-gt-sm-65,.layout-margin .flex-offset-gt-sm-65,.layout-margin .offset-gt-sm-65{margin-left:65%}[dir=rtl] .offset-gt-sm-65,[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .offset-gt-sm-65{margin-left:auto;margin-right:65%}.offset-gt-sm-70,.flex-offset-gt-sm-70,.layout-margin .flex-offset-gt-sm-70,.layout-margin .offset-gt-sm-70{margin-left:70%}[dir=rtl] .offset-gt-sm-70,[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .offset-gt-sm-70{margin-left:auto;margin-right:70%}.offset-gt-sm-75,.flex-offset-gt-sm-75,.layout-margin .flex-offset-gt-sm-75,.layout-margin .offset-gt-sm-75{margin-left:75%}[dir=rtl] .offset-gt-sm-75,[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .offset-gt-sm-75{margin-left:auto;margin-right:75%}.offset-gt-sm-80,.flex-offset-gt-sm-80,.layout-margin .flex-offset-gt-sm-80,.layout-margin .offset-gt-sm-80{margin-left:80%}[dir=rtl] .offset-gt-sm-80,[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .offset-gt-sm-80{margin-left:auto;margin-right:80%}.offset-gt-sm-85,.flex-offset-gt-sm-85,.layout-margin .flex-offset-gt-sm-85,.layout-margin .offset-gt-sm-85{margin-left:85%}[dir=rtl] .offset-gt-sm-85,[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .offset-gt-sm-85{margin-left:auto;margin-right:85%}.offset-gt-sm-90,.flex-offset-gt-sm-90,.layout-margin .flex-offset-gt-sm-90,.layout-margin .offset-gt-sm-90{margin-left:90%}[dir=rtl] .offset-gt-sm-90,[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .offset-gt-sm-90{margin-left:auto;margin-right:90%}.offset-gt-sm-95,.flex-offset-gt-sm-95,.layout-margin .flex-offset-gt-sm-95,.layout-margin .offset-gt-sm-95{margin-left:95%}[dir=rtl] .offset-gt-sm-95,[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .offset-gt-sm-95{margin-left:auto;margin-right:95%}.offset-gt-sm-33,.flex-offset-gt-sm-33,.layout-margin .flex-offset-gt-sm-33,.layout-margin .offset-gt-sm-33{margin-left:33.3333333333%}.offset-gt-sm-66,.flex-offset-gt-sm-66,.layout-margin .flex-offset-gt-sm-66,.layout-margin .offset-gt-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-sm-66,[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .offset-gt-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-start-start,.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-start-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-start-center>*,.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-start-end,.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-start-stretch,.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media(min-width: 960px)and (max-width: 1279px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.offset-md-0,.flex-offset-md-0,.layout-margin .flex-offset-md-0,.layout-margin .offset-md-0{margin-left:0}[dir=rtl] .offset-md-0,[dir=rtl] .flex-offset-md-0,[dir=rtl] .layout-margin .flex-offset-md-0,[dir=rtl] .layout-margin .offset-md-0{margin-left:auto;margin-right:0}.offset-md-5,.flex-offset-md-5,.layout-margin .flex-offset-md-5,.layout-margin .offset-md-5{margin-left:5%}[dir=rtl] .offset-md-5,[dir=rtl] .flex-offset-md-5,[dir=rtl] .layout-margin .flex-offset-md-5,[dir=rtl] .layout-margin .offset-md-5{margin-left:auto;margin-right:5%}.offset-md-10,.flex-offset-md-10,.layout-margin .flex-offset-md-10,.layout-margin .offset-md-10{margin-left:10%}[dir=rtl] .offset-md-10,[dir=rtl] .flex-offset-md-10,[dir=rtl] .layout-margin .flex-offset-md-10,[dir=rtl] .layout-margin .offset-md-10{margin-left:auto;margin-right:10%}.offset-md-15,.flex-offset-md-15,.layout-margin .flex-offset-md-15,.layout-margin .offset-md-15{margin-left:15%}[dir=rtl] .offset-md-15,[dir=rtl] .flex-offset-md-15,[dir=rtl] .layout-margin .flex-offset-md-15,[dir=rtl] .layout-margin .offset-md-15{margin-left:auto;margin-right:15%}.offset-md-20,.flex-offset-md-20,.layout-margin .flex-offset-md-20,.layout-margin .offset-md-20{margin-left:20%}[dir=rtl] .offset-md-20,[dir=rtl] .flex-offset-md-20,[dir=rtl] .layout-margin .flex-offset-md-20,[dir=rtl] .layout-margin .offset-md-20{margin-left:auto;margin-right:20%}.offset-md-25,.flex-offset-md-25,.layout-margin .flex-offset-md-25,.layout-margin .offset-md-25{margin-left:25%}[dir=rtl] .offset-md-25,[dir=rtl] .flex-offset-md-25,[dir=rtl] .layout-margin .flex-offset-md-25,[dir=rtl] .layout-margin .offset-md-25{margin-left:auto;margin-right:25%}.offset-md-30,.flex-offset-md-30,.layout-margin .flex-offset-md-30,.layout-margin .offset-md-30{margin-left:30%}[dir=rtl] .offset-md-30,[dir=rtl] .flex-offset-md-30,[dir=rtl] .layout-margin .flex-offset-md-30,[dir=rtl] .layout-margin .offset-md-30{margin-left:auto;margin-right:30%}.offset-md-35,.flex-offset-md-35,.layout-margin .flex-offset-md-35,.layout-margin .offset-md-35{margin-left:35%}[dir=rtl] .offset-md-35,[dir=rtl] .flex-offset-md-35,[dir=rtl] .layout-margin .flex-offset-md-35,[dir=rtl] .layout-margin .offset-md-35{margin-left:auto;margin-right:35%}.offset-md-40,.flex-offset-md-40,.layout-margin .flex-offset-md-40,.layout-margin .offset-md-40{margin-left:40%}[dir=rtl] .offset-md-40,[dir=rtl] .flex-offset-md-40,[dir=rtl] .layout-margin .flex-offset-md-40,[dir=rtl] .layout-margin .offset-md-40{margin-left:auto;margin-right:40%}.offset-md-45,.flex-offset-md-45,.layout-margin .flex-offset-md-45,.layout-margin .offset-md-45{margin-left:45%}[dir=rtl] .offset-md-45,[dir=rtl] .flex-offset-md-45,[dir=rtl] .layout-margin .flex-offset-md-45,[dir=rtl] .layout-margin .offset-md-45{margin-left:auto;margin-right:45%}.offset-md-50,.flex-offset-md-50,.layout-margin .flex-offset-md-50,.layout-margin .offset-md-50{margin-left:50%}[dir=rtl] .offset-md-50,[dir=rtl] .flex-offset-md-50,[dir=rtl] .layout-margin .flex-offset-md-50,[dir=rtl] .layout-margin .offset-md-50{margin-left:auto;margin-right:50%}.offset-md-55,.flex-offset-md-55,.layout-margin .flex-offset-md-55,.layout-margin .offset-md-55{margin-left:55%}[dir=rtl] .offset-md-55,[dir=rtl] .flex-offset-md-55,[dir=rtl] .layout-margin .flex-offset-md-55,[dir=rtl] .layout-margin .offset-md-55{margin-left:auto;margin-right:55%}.offset-md-60,.flex-offset-md-60,.layout-margin .flex-offset-md-60,.layout-margin .offset-md-60{margin-left:60%}[dir=rtl] .offset-md-60,[dir=rtl] .flex-offset-md-60,[dir=rtl] .layout-margin .flex-offset-md-60,[dir=rtl] .layout-margin .offset-md-60{margin-left:auto;margin-right:60%}.offset-md-65,.flex-offset-md-65,.layout-margin .flex-offset-md-65,.layout-margin .offset-md-65{margin-left:65%}[dir=rtl] .offset-md-65,[dir=rtl] .flex-offset-md-65,[dir=rtl] .layout-margin .flex-offset-md-65,[dir=rtl] .layout-margin .offset-md-65{margin-left:auto;margin-right:65%}.offset-md-70,.flex-offset-md-70,.layout-margin .flex-offset-md-70,.layout-margin .offset-md-70{margin-left:70%}[dir=rtl] .offset-md-70,[dir=rtl] .flex-offset-md-70,[dir=rtl] .layout-margin .flex-offset-md-70,[dir=rtl] .layout-margin .offset-md-70{margin-left:auto;margin-right:70%}.offset-md-75,.flex-offset-md-75,.layout-margin .flex-offset-md-75,.layout-margin .offset-md-75{margin-left:75%}[dir=rtl] .offset-md-75,[dir=rtl] .flex-offset-md-75,[dir=rtl] .layout-margin .flex-offset-md-75,[dir=rtl] .layout-margin .offset-md-75{margin-left:auto;margin-right:75%}.offset-md-80,.flex-offset-md-80,.layout-margin .flex-offset-md-80,.layout-margin .offset-md-80{margin-left:80%}[dir=rtl] .offset-md-80,[dir=rtl] .flex-offset-md-80,[dir=rtl] .layout-margin .flex-offset-md-80,[dir=rtl] .layout-margin .offset-md-80{margin-left:auto;margin-right:80%}.offset-md-85,.flex-offset-md-85,.layout-margin .flex-offset-md-85,.layout-margin .offset-md-85{margin-left:85%}[dir=rtl] .offset-md-85,[dir=rtl] .flex-offset-md-85,[dir=rtl] .layout-margin .flex-offset-md-85,[dir=rtl] .layout-margin .offset-md-85{margin-left:auto;margin-right:85%}.offset-md-90,.flex-offset-md-90,.layout-margin .flex-offset-md-90,.layout-margin .offset-md-90{margin-left:90%}[dir=rtl] .offset-md-90,[dir=rtl] .flex-offset-md-90,[dir=rtl] .layout-margin .flex-offset-md-90,[dir=rtl] .layout-margin .offset-md-90{margin-left:auto;margin-right:90%}.offset-md-95,.flex-offset-md-95,.layout-margin .flex-offset-md-95,.layout-margin .offset-md-95{margin-left:95%}[dir=rtl] .offset-md-95,[dir=rtl] .flex-offset-md-95,[dir=rtl] .layout-margin .flex-offset-md-95,[dir=rtl] .layout-margin .offset-md-95{margin-left:auto;margin-right:95%}.offset-md-33,.flex-offset-md-33,.layout-margin .flex-offset-md-33,.layout-margin .offset-md-33{margin-left:33.3333333333%}.offset-md-66,.flex-offset-md-66,.layout-margin .flex-offset-md-66,.layout-margin .offset-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-md-66,[dir=rtl] .flex-offset-md-66,[dir=rtl] .layout-margin .flex-offset-md-66,[dir=rtl] .layout-margin .offset-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-start,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-start,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-start,.layout-align-md-space-around-end,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-start,.layout-align-md-space-between-end,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-start-start,.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-between-start,.layout-align-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-md-start-center,.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-between-center,.layout-align-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-start-center>*,.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-between-center>*,.layout-align-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-start-end,.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-between-end,.layout-align-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-md-start-stretch,.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-between-stretch,.layout-align-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media(min-width: 1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.offset-gt-md-0,.flex-offset-gt-md-0,.layout-margin .flex-offset-gt-md-0,.layout-margin .offset-gt-md-0{margin-left:0}[dir=rtl] .offset-gt-md-0,[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .layout-margin .flex-offset-gt-md-0,[dir=rtl] .layout-margin .offset-gt-md-0{margin-left:auto;margin-right:0}.offset-gt-md-5,.flex-offset-gt-md-5,.layout-margin .flex-offset-gt-md-5,.layout-margin .offset-gt-md-5{margin-left:5%}[dir=rtl] .offset-gt-md-5,[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .layout-margin .flex-offset-gt-md-5,[dir=rtl] .layout-margin .offset-gt-md-5{margin-left:auto;margin-right:5%}.offset-gt-md-10,.flex-offset-gt-md-10,.layout-margin .flex-offset-gt-md-10,.layout-margin .offset-gt-md-10{margin-left:10%}[dir=rtl] .offset-gt-md-10,[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .layout-margin .flex-offset-gt-md-10,[dir=rtl] .layout-margin .offset-gt-md-10{margin-left:auto;margin-right:10%}.offset-gt-md-15,.flex-offset-gt-md-15,.layout-margin .flex-offset-gt-md-15,.layout-margin .offset-gt-md-15{margin-left:15%}[dir=rtl] .offset-gt-md-15,[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .layout-margin .flex-offset-gt-md-15,[dir=rtl] .layout-margin .offset-gt-md-15{margin-left:auto;margin-right:15%}.offset-gt-md-20,.flex-offset-gt-md-20,.layout-margin .flex-offset-gt-md-20,.layout-margin .offset-gt-md-20{margin-left:20%}[dir=rtl] .offset-gt-md-20,[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .layout-margin .flex-offset-gt-md-20,[dir=rtl] .layout-margin .offset-gt-md-20{margin-left:auto;margin-right:20%}.offset-gt-md-25,.flex-offset-gt-md-25,.layout-margin .flex-offset-gt-md-25,.layout-margin .offset-gt-md-25{margin-left:25%}[dir=rtl] .offset-gt-md-25,[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .layout-margin .flex-offset-gt-md-25,[dir=rtl] .layout-margin .offset-gt-md-25{margin-left:auto;margin-right:25%}.offset-gt-md-30,.flex-offset-gt-md-30,.layout-margin .flex-offset-gt-md-30,.layout-margin .offset-gt-md-30{margin-left:30%}[dir=rtl] .offset-gt-md-30,[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .layout-margin .flex-offset-gt-md-30,[dir=rtl] .layout-margin .offset-gt-md-30{margin-left:auto;margin-right:30%}.offset-gt-md-35,.flex-offset-gt-md-35,.layout-margin .flex-offset-gt-md-35,.layout-margin .offset-gt-md-35{margin-left:35%}[dir=rtl] .offset-gt-md-35,[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .layout-margin .flex-offset-gt-md-35,[dir=rtl] .layout-margin .offset-gt-md-35{margin-left:auto;margin-right:35%}.offset-gt-md-40,.flex-offset-gt-md-40,.layout-margin .flex-offset-gt-md-40,.layout-margin .offset-gt-md-40{margin-left:40%}[dir=rtl] .offset-gt-md-40,[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .layout-margin .flex-offset-gt-md-40,[dir=rtl] .layout-margin .offset-gt-md-40{margin-left:auto;margin-right:40%}.offset-gt-md-45,.flex-offset-gt-md-45,.layout-margin .flex-offset-gt-md-45,.layout-margin .offset-gt-md-45{margin-left:45%}[dir=rtl] .offset-gt-md-45,[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .layout-margin .flex-offset-gt-md-45,[dir=rtl] .layout-margin .offset-gt-md-45{margin-left:auto;margin-right:45%}.offset-gt-md-50,.flex-offset-gt-md-50,.layout-margin .flex-offset-gt-md-50,.layout-margin .offset-gt-md-50{margin-left:50%}[dir=rtl] .offset-gt-md-50,[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .layout-margin .flex-offset-gt-md-50,[dir=rtl] .layout-margin .offset-gt-md-50{margin-left:auto;margin-right:50%}.offset-gt-md-55,.flex-offset-gt-md-55,.layout-margin .flex-offset-gt-md-55,.layout-margin .offset-gt-md-55{margin-left:55%}[dir=rtl] .offset-gt-md-55,[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .layout-margin .flex-offset-gt-md-55,[dir=rtl] .layout-margin .offset-gt-md-55{margin-left:auto;margin-right:55%}.offset-gt-md-60,.flex-offset-gt-md-60,.layout-margin .flex-offset-gt-md-60,.layout-margin .offset-gt-md-60{margin-left:60%}[dir=rtl] .offset-gt-md-60,[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .layout-margin .flex-offset-gt-md-60,[dir=rtl] .layout-margin .offset-gt-md-60{margin-left:auto;margin-right:60%}.offset-gt-md-65,.flex-offset-gt-md-65,.layout-margin .flex-offset-gt-md-65,.layout-margin .offset-gt-md-65{margin-left:65%}[dir=rtl] .offset-gt-md-65,[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .layout-margin .flex-offset-gt-md-65,[dir=rtl] .layout-margin .offset-gt-md-65{margin-left:auto;margin-right:65%}.offset-gt-md-70,.flex-offset-gt-md-70,.layout-margin .flex-offset-gt-md-70,.layout-margin .offset-gt-md-70{margin-left:70%}[dir=rtl] .offset-gt-md-70,[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .layout-margin .flex-offset-gt-md-70,[dir=rtl] .layout-margin .offset-gt-md-70{margin-left:auto;margin-right:70%}.offset-gt-md-75,.flex-offset-gt-md-75,.layout-margin .flex-offset-gt-md-75,.layout-margin .offset-gt-md-75{margin-left:75%}[dir=rtl] .offset-gt-md-75,[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .layout-margin .flex-offset-gt-md-75,[dir=rtl] .layout-margin .offset-gt-md-75{margin-left:auto;margin-right:75%}.offset-gt-md-80,.flex-offset-gt-md-80,.layout-margin .flex-offset-gt-md-80,.layout-margin .offset-gt-md-80{margin-left:80%}[dir=rtl] .offset-gt-md-80,[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .layout-margin .flex-offset-gt-md-80,[dir=rtl] .layout-margin .offset-gt-md-80{margin-left:auto;margin-right:80%}.offset-gt-md-85,.flex-offset-gt-md-85,.layout-margin .flex-offset-gt-md-85,.layout-margin .offset-gt-md-85{margin-left:85%}[dir=rtl] .offset-gt-md-85,[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .layout-margin .flex-offset-gt-md-85,[dir=rtl] .layout-margin .offset-gt-md-85{margin-left:auto;margin-right:85%}.offset-gt-md-90,.flex-offset-gt-md-90,.layout-margin .flex-offset-gt-md-90,.layout-margin .offset-gt-md-90{margin-left:90%}[dir=rtl] .offset-gt-md-90,[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .layout-margin .flex-offset-gt-md-90,[dir=rtl] .layout-margin .offset-gt-md-90{margin-left:auto;margin-right:90%}.offset-gt-md-95,.flex-offset-gt-md-95,.layout-margin .flex-offset-gt-md-95,.layout-margin .offset-gt-md-95{margin-left:95%}[dir=rtl] .offset-gt-md-95,[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .layout-margin .flex-offset-gt-md-95,[dir=rtl] .layout-margin .offset-gt-md-95{margin-left:auto;margin-right:95%}.offset-gt-md-33,.flex-offset-gt-md-33,.layout-margin .flex-offset-gt-md-33,.layout-margin .offset-gt-md-33{margin-left:33.3333333333%}.offset-gt-md-66,.flex-offset-gt-md-66,.layout-margin .flex-offset-gt-md-66,.layout-margin .offset-gt-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-md-66,[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .layout-margin .flex-offset-gt-md-66,[dir=rtl] .layout-margin .offset-gt-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-start,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-start-start,.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-start-center,.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-start-center>*,.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-start-end,.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-start-stretch,.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media(min-width: 1280px)and (max-width: 1919px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.offset-lg-0,.flex-offset-lg-0,.layout-margin .flex-offset-lg-0,.layout-margin .offset-lg-0{margin-left:0}[dir=rtl] .offset-lg-0,[dir=rtl] .flex-offset-lg-0,[dir=rtl] .layout-margin .flex-offset-lg-0,[dir=rtl] .layout-margin .offset-lg-0{margin-left:auto;margin-right:0}.offset-lg-5,.flex-offset-lg-5,.layout-margin .flex-offset-lg-5,.layout-margin .offset-lg-5{margin-left:5%}[dir=rtl] .offset-lg-5,[dir=rtl] .flex-offset-lg-5,[dir=rtl] .layout-margin .flex-offset-lg-5,[dir=rtl] .layout-margin .offset-lg-5{margin-left:auto;margin-right:5%}.offset-lg-10,.flex-offset-lg-10,.layout-margin .flex-offset-lg-10,.layout-margin .offset-lg-10{margin-left:10%}[dir=rtl] .offset-lg-10,[dir=rtl] .flex-offset-lg-10,[dir=rtl] .layout-margin .flex-offset-lg-10,[dir=rtl] .layout-margin .offset-lg-10{margin-left:auto;margin-right:10%}.offset-lg-15,.flex-offset-lg-15,.layout-margin .flex-offset-lg-15,.layout-margin .offset-lg-15{margin-left:15%}[dir=rtl] .offset-lg-15,[dir=rtl] .flex-offset-lg-15,[dir=rtl] .layout-margin .flex-offset-lg-15,[dir=rtl] .layout-margin .offset-lg-15{margin-left:auto;margin-right:15%}.offset-lg-20,.flex-offset-lg-20,.layout-margin .flex-offset-lg-20,.layout-margin .offset-lg-20{margin-left:20%}[dir=rtl] .offset-lg-20,[dir=rtl] .flex-offset-lg-20,[dir=rtl] .layout-margin .flex-offset-lg-20,[dir=rtl] .layout-margin .offset-lg-20{margin-left:auto;margin-right:20%}.offset-lg-25,.flex-offset-lg-25,.layout-margin .flex-offset-lg-25,.layout-margin .offset-lg-25{margin-left:25%}[dir=rtl] .offset-lg-25,[dir=rtl] .flex-offset-lg-25,[dir=rtl] .layout-margin .flex-offset-lg-25,[dir=rtl] .layout-margin .offset-lg-25{margin-left:auto;margin-right:25%}.offset-lg-30,.flex-offset-lg-30,.layout-margin .flex-offset-lg-30,.layout-margin .offset-lg-30{margin-left:30%}[dir=rtl] .offset-lg-30,[dir=rtl] .flex-offset-lg-30,[dir=rtl] .layout-margin .flex-offset-lg-30,[dir=rtl] .layout-margin .offset-lg-30{margin-left:auto;margin-right:30%}.offset-lg-35,.flex-offset-lg-35,.layout-margin .flex-offset-lg-35,.layout-margin .offset-lg-35{margin-left:35%}[dir=rtl] .offset-lg-35,[dir=rtl] .flex-offset-lg-35,[dir=rtl] .layout-margin .flex-offset-lg-35,[dir=rtl] .layout-margin .offset-lg-35{margin-left:auto;margin-right:35%}.offset-lg-40,.flex-offset-lg-40,.layout-margin .flex-offset-lg-40,.layout-margin .offset-lg-40{margin-left:40%}[dir=rtl] .offset-lg-40,[dir=rtl] .flex-offset-lg-40,[dir=rtl] .layout-margin .flex-offset-lg-40,[dir=rtl] .layout-margin .offset-lg-40{margin-left:auto;margin-right:40%}.offset-lg-45,.flex-offset-lg-45,.layout-margin .flex-offset-lg-45,.layout-margin .offset-lg-45{margin-left:45%}[dir=rtl] .offset-lg-45,[dir=rtl] .flex-offset-lg-45,[dir=rtl] .layout-margin .flex-offset-lg-45,[dir=rtl] .layout-margin .offset-lg-45{margin-left:auto;margin-right:45%}.offset-lg-50,.flex-offset-lg-50,.layout-margin .flex-offset-lg-50,.layout-margin .offset-lg-50{margin-left:50%}[dir=rtl] .offset-lg-50,[dir=rtl] .flex-offset-lg-50,[dir=rtl] .layout-margin .flex-offset-lg-50,[dir=rtl] .layout-margin .offset-lg-50{margin-left:auto;margin-right:50%}.offset-lg-55,.flex-offset-lg-55,.layout-margin .flex-offset-lg-55,.layout-margin .offset-lg-55{margin-left:55%}[dir=rtl] .offset-lg-55,[dir=rtl] .flex-offset-lg-55,[dir=rtl] .layout-margin .flex-offset-lg-55,[dir=rtl] .layout-margin .offset-lg-55{margin-left:auto;margin-right:55%}.offset-lg-60,.flex-offset-lg-60,.layout-margin .flex-offset-lg-60,.layout-margin .offset-lg-60{margin-left:60%}[dir=rtl] .offset-lg-60,[dir=rtl] .flex-offset-lg-60,[dir=rtl] .layout-margin .flex-offset-lg-60,[dir=rtl] .layout-margin .offset-lg-60{margin-left:auto;margin-right:60%}.offset-lg-65,.flex-offset-lg-65,.layout-margin .flex-offset-lg-65,.layout-margin .offset-lg-65{margin-left:65%}[dir=rtl] .offset-lg-65,[dir=rtl] .flex-offset-lg-65,[dir=rtl] .layout-margin .flex-offset-lg-65,[dir=rtl] .layout-margin .offset-lg-65{margin-left:auto;margin-right:65%}.offset-lg-70,.flex-offset-lg-70,.layout-margin .flex-offset-lg-70,.layout-margin .offset-lg-70{margin-left:70%}[dir=rtl] .offset-lg-70,[dir=rtl] .flex-offset-lg-70,[dir=rtl] .layout-margin .flex-offset-lg-70,[dir=rtl] .layout-margin .offset-lg-70{margin-left:auto;margin-right:70%}.offset-lg-75,.flex-offset-lg-75,.layout-margin .flex-offset-lg-75,.layout-margin .offset-lg-75{margin-left:75%}[dir=rtl] .offset-lg-75,[dir=rtl] .flex-offset-lg-75,[dir=rtl] .layout-margin .flex-offset-lg-75,[dir=rtl] .layout-margin .offset-lg-75{margin-left:auto;margin-right:75%}.offset-lg-80,.flex-offset-lg-80,.layout-margin .flex-offset-lg-80,.layout-margin .offset-lg-80{margin-left:80%}[dir=rtl] .offset-lg-80,[dir=rtl] .flex-offset-lg-80,[dir=rtl] .layout-margin .flex-offset-lg-80,[dir=rtl] .layout-margin .offset-lg-80{margin-left:auto;margin-right:80%}.offset-lg-85,.flex-offset-lg-85,.layout-margin .flex-offset-lg-85,.layout-margin .offset-lg-85{margin-left:85%}[dir=rtl] .offset-lg-85,[dir=rtl] .flex-offset-lg-85,[dir=rtl] .layout-margin .flex-offset-lg-85,[dir=rtl] .layout-margin .offset-lg-85{margin-left:auto;margin-right:85%}.offset-lg-90,.flex-offset-lg-90,.layout-margin .flex-offset-lg-90,.layout-margin .offset-lg-90{margin-left:90%}[dir=rtl] .offset-lg-90,[dir=rtl] .flex-offset-lg-90,[dir=rtl] .layout-margin .flex-offset-lg-90,[dir=rtl] .layout-margin .offset-lg-90{margin-left:auto;margin-right:90%}.offset-lg-95,.flex-offset-lg-95,.layout-margin .flex-offset-lg-95,.layout-margin .offset-lg-95{margin-left:95%}[dir=rtl] .offset-lg-95,[dir=rtl] .flex-offset-lg-95,[dir=rtl] .layout-margin .flex-offset-lg-95,[dir=rtl] .layout-margin .offset-lg-95{margin-left:auto;margin-right:95%}.offset-lg-33,.flex-offset-lg-33,.layout-margin .flex-offset-lg-33,.layout-margin .offset-lg-33{margin-left:33.3333333333%}.offset-lg-66,.flex-offset-lg-66,.layout-margin .flex-offset-lg-66,.layout-margin .offset-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-lg-66,[dir=rtl] .flex-offset-lg-66,[dir=rtl] .layout-margin .flex-offset-lg-66,[dir=rtl] .layout-margin .offset-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-start,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-start,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-start,.layout-align-lg-space-around-end,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-start,.layout-align-lg-space-between-end,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-start-start,.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-between-start,.layout-align-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-start-center,.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-between-center,.layout-align-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-start-center>*,.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-start-end,.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-between-end,.layout-align-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-start-stretch,.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media(min-width: 1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.offset-gt-lg-0,.flex-offset-gt-lg-0,.layout-margin .flex-offset-gt-lg-0,.layout-margin .offset-gt-lg-0{margin-left:0}[dir=rtl] .offset-gt-lg-0,[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .offset-gt-lg-0{margin-left:auto;margin-right:0}.offset-gt-lg-5,.flex-offset-gt-lg-5,.layout-margin .flex-offset-gt-lg-5,.layout-margin .offset-gt-lg-5{margin-left:5%}[dir=rtl] .offset-gt-lg-5,[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .offset-gt-lg-5{margin-left:auto;margin-right:5%}.offset-gt-lg-10,.flex-offset-gt-lg-10,.layout-margin .flex-offset-gt-lg-10,.layout-margin .offset-gt-lg-10{margin-left:10%}[dir=rtl] .offset-gt-lg-10,[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .offset-gt-lg-10{margin-left:auto;margin-right:10%}.offset-gt-lg-15,.flex-offset-gt-lg-15,.layout-margin .flex-offset-gt-lg-15,.layout-margin .offset-gt-lg-15{margin-left:15%}[dir=rtl] .offset-gt-lg-15,[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .offset-gt-lg-15{margin-left:auto;margin-right:15%}.offset-gt-lg-20,.flex-offset-gt-lg-20,.layout-margin .flex-offset-gt-lg-20,.layout-margin .offset-gt-lg-20{margin-left:20%}[dir=rtl] .offset-gt-lg-20,[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .offset-gt-lg-20{margin-left:auto;margin-right:20%}.offset-gt-lg-25,.flex-offset-gt-lg-25,.layout-margin .flex-offset-gt-lg-25,.layout-margin .offset-gt-lg-25{margin-left:25%}[dir=rtl] .offset-gt-lg-25,[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .offset-gt-lg-25{margin-left:auto;margin-right:25%}.offset-gt-lg-30,.flex-offset-gt-lg-30,.layout-margin .flex-offset-gt-lg-30,.layout-margin .offset-gt-lg-30{margin-left:30%}[dir=rtl] .offset-gt-lg-30,[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .offset-gt-lg-30{margin-left:auto;margin-right:30%}.offset-gt-lg-35,.flex-offset-gt-lg-35,.layout-margin .flex-offset-gt-lg-35,.layout-margin .offset-gt-lg-35{margin-left:35%}[dir=rtl] .offset-gt-lg-35,[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .offset-gt-lg-35{margin-left:auto;margin-right:35%}.offset-gt-lg-40,.flex-offset-gt-lg-40,.layout-margin .flex-offset-gt-lg-40,.layout-margin .offset-gt-lg-40{margin-left:40%}[dir=rtl] .offset-gt-lg-40,[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .offset-gt-lg-40{margin-left:auto;margin-right:40%}.offset-gt-lg-45,.flex-offset-gt-lg-45,.layout-margin .flex-offset-gt-lg-45,.layout-margin .offset-gt-lg-45{margin-left:45%}[dir=rtl] .offset-gt-lg-45,[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .offset-gt-lg-45{margin-left:auto;margin-right:45%}.offset-gt-lg-50,.flex-offset-gt-lg-50,.layout-margin .flex-offset-gt-lg-50,.layout-margin .offset-gt-lg-50{margin-left:50%}[dir=rtl] .offset-gt-lg-50,[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .offset-gt-lg-50{margin-left:auto;margin-right:50%}.offset-gt-lg-55,.flex-offset-gt-lg-55,.layout-margin .flex-offset-gt-lg-55,.layout-margin .offset-gt-lg-55{margin-left:55%}[dir=rtl] .offset-gt-lg-55,[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .offset-gt-lg-55{margin-left:auto;margin-right:55%}.offset-gt-lg-60,.flex-offset-gt-lg-60,.layout-margin .flex-offset-gt-lg-60,.layout-margin .offset-gt-lg-60{margin-left:60%}[dir=rtl] .offset-gt-lg-60,[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .offset-gt-lg-60{margin-left:auto;margin-right:60%}.offset-gt-lg-65,.flex-offset-gt-lg-65,.layout-margin .flex-offset-gt-lg-65,.layout-margin .offset-gt-lg-65{margin-left:65%}[dir=rtl] .offset-gt-lg-65,[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .offset-gt-lg-65{margin-left:auto;margin-right:65%}.offset-gt-lg-70,.flex-offset-gt-lg-70,.layout-margin .flex-offset-gt-lg-70,.layout-margin .offset-gt-lg-70{margin-left:70%}[dir=rtl] .offset-gt-lg-70,[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .offset-gt-lg-70{margin-left:auto;margin-right:70%}.offset-gt-lg-75,.flex-offset-gt-lg-75,.layout-margin .flex-offset-gt-lg-75,.layout-margin .offset-gt-lg-75{margin-left:75%}[dir=rtl] .offset-gt-lg-75,[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .offset-gt-lg-75{margin-left:auto;margin-right:75%}.offset-gt-lg-80,.flex-offset-gt-lg-80,.layout-margin .flex-offset-gt-lg-80,.layout-margin .offset-gt-lg-80{margin-left:80%}[dir=rtl] .offset-gt-lg-80,[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .offset-gt-lg-80{margin-left:auto;margin-right:80%}.offset-gt-lg-85,.flex-offset-gt-lg-85,.layout-margin .flex-offset-gt-lg-85,.layout-margin .offset-gt-lg-85{margin-left:85%}[dir=rtl] .offset-gt-lg-85,[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .offset-gt-lg-85{margin-left:auto;margin-right:85%}.offset-gt-lg-90,.flex-offset-gt-lg-90,.layout-margin .flex-offset-gt-lg-90,.layout-margin .offset-gt-lg-90{margin-left:90%}[dir=rtl] .offset-gt-lg-90,[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .offset-gt-lg-90{margin-left:auto;margin-right:90%}.offset-gt-lg-95,.flex-offset-gt-lg-95,.layout-margin .flex-offset-gt-lg-95,.layout-margin .offset-gt-lg-95{margin-left:95%}[dir=rtl] .offset-gt-lg-95,[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .offset-gt-lg-95{margin-left:auto;margin-right:95%}.offset-gt-lg-33,.flex-offset-gt-lg-33,.layout-margin .flex-offset-gt-lg-33,.layout-margin .offset-gt-lg-33{margin-left:33.3333333333%}.offset-gt-lg-66,.flex-offset-gt-lg-66,.layout-margin .flex-offset-gt-lg-66,.layout-margin .offset-gt-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-lg-66,[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .offset-gt-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-start-start,.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-start-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-start-center>*,.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-start-end,.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-start-stretch,.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.offset-xl-0,.flex-offset-xl-0,.layout-margin .flex-offset-xl-0,.layout-margin .offset-xl-0{margin-left:0}[dir=rtl] .offset-xl-0,[dir=rtl] .flex-offset-xl-0,[dir=rtl] .layout-margin .flex-offset-xl-0,[dir=rtl] .layout-margin .offset-xl-0{margin-left:auto;margin-right:0}.offset-xl-5,.flex-offset-xl-5,.layout-margin .flex-offset-xl-5,.layout-margin .offset-xl-5{margin-left:5%}[dir=rtl] .offset-xl-5,[dir=rtl] .flex-offset-xl-5,[dir=rtl] .layout-margin .flex-offset-xl-5,[dir=rtl] .layout-margin .offset-xl-5{margin-left:auto;margin-right:5%}.offset-xl-10,.flex-offset-xl-10,.layout-margin .flex-offset-xl-10,.layout-margin .offset-xl-10{margin-left:10%}[dir=rtl] .offset-xl-10,[dir=rtl] .flex-offset-xl-10,[dir=rtl] .layout-margin .flex-offset-xl-10,[dir=rtl] .layout-margin .offset-xl-10{margin-left:auto;margin-right:10%}.offset-xl-15,.flex-offset-xl-15,.layout-margin .flex-offset-xl-15,.layout-margin .offset-xl-15{margin-left:15%}[dir=rtl] .offset-xl-15,[dir=rtl] .flex-offset-xl-15,[dir=rtl] .layout-margin .flex-offset-xl-15,[dir=rtl] .layout-margin .offset-xl-15{margin-left:auto;margin-right:15%}.offset-xl-20,.flex-offset-xl-20,.layout-margin .flex-offset-xl-20,.layout-margin .offset-xl-20{margin-left:20%}[dir=rtl] .offset-xl-20,[dir=rtl] .flex-offset-xl-20,[dir=rtl] .layout-margin .flex-offset-xl-20,[dir=rtl] .layout-margin .offset-xl-20{margin-left:auto;margin-right:20%}.offset-xl-25,.flex-offset-xl-25,.layout-margin .flex-offset-xl-25,.layout-margin .offset-xl-25{margin-left:25%}[dir=rtl] .offset-xl-25,[dir=rtl] .flex-offset-xl-25,[dir=rtl] .layout-margin .flex-offset-xl-25,[dir=rtl] .layout-margin .offset-xl-25{margin-left:auto;margin-right:25%}.offset-xl-30,.flex-offset-xl-30,.layout-margin .flex-offset-xl-30,.layout-margin .offset-xl-30{margin-left:30%}[dir=rtl] .offset-xl-30,[dir=rtl] .flex-offset-xl-30,[dir=rtl] .layout-margin .flex-offset-xl-30,[dir=rtl] .layout-margin .offset-xl-30{margin-left:auto;margin-right:30%}.offset-xl-35,.flex-offset-xl-35,.layout-margin .flex-offset-xl-35,.layout-margin .offset-xl-35{margin-left:35%}[dir=rtl] .offset-xl-35,[dir=rtl] .flex-offset-xl-35,[dir=rtl] .layout-margin .flex-offset-xl-35,[dir=rtl] .layout-margin .offset-xl-35{margin-left:auto;margin-right:35%}.offset-xl-40,.flex-offset-xl-40,.layout-margin .flex-offset-xl-40,.layout-margin .offset-xl-40{margin-left:40%}[dir=rtl] .offset-xl-40,[dir=rtl] .flex-offset-xl-40,[dir=rtl] .layout-margin .flex-offset-xl-40,[dir=rtl] .layout-margin .offset-xl-40{margin-left:auto;margin-right:40%}.offset-xl-45,.flex-offset-xl-45,.layout-margin .flex-offset-xl-45,.layout-margin .offset-xl-45{margin-left:45%}[dir=rtl] .offset-xl-45,[dir=rtl] .flex-offset-xl-45,[dir=rtl] .layout-margin .flex-offset-xl-45,[dir=rtl] .layout-margin .offset-xl-45{margin-left:auto;margin-right:45%}.offset-xl-50,.flex-offset-xl-50,.layout-margin .flex-offset-xl-50,.layout-margin .offset-xl-50{margin-left:50%}[dir=rtl] .offset-xl-50,[dir=rtl] .flex-offset-xl-50,[dir=rtl] .layout-margin .flex-offset-xl-50,[dir=rtl] .layout-margin .offset-xl-50{margin-left:auto;margin-right:50%}.offset-xl-55,.flex-offset-xl-55,.layout-margin .flex-offset-xl-55,.layout-margin .offset-xl-55{margin-left:55%}[dir=rtl] .offset-xl-55,[dir=rtl] .flex-offset-xl-55,[dir=rtl] .layout-margin .flex-offset-xl-55,[dir=rtl] .layout-margin .offset-xl-55{margin-left:auto;margin-right:55%}.offset-xl-60,.flex-offset-xl-60,.layout-margin .flex-offset-xl-60,.layout-margin .offset-xl-60{margin-left:60%}[dir=rtl] .offset-xl-60,[dir=rtl] .flex-offset-xl-60,[dir=rtl] .layout-margin .flex-offset-xl-60,[dir=rtl] .layout-margin .offset-xl-60{margin-left:auto;margin-right:60%}.offset-xl-65,.flex-offset-xl-65,.layout-margin .flex-offset-xl-65,.layout-margin .offset-xl-65{margin-left:65%}[dir=rtl] .offset-xl-65,[dir=rtl] .flex-offset-xl-65,[dir=rtl] .layout-margin .flex-offset-xl-65,[dir=rtl] .layout-margin .offset-xl-65{margin-left:auto;margin-right:65%}.offset-xl-70,.flex-offset-xl-70,.layout-margin .flex-offset-xl-70,.layout-margin .offset-xl-70{margin-left:70%}[dir=rtl] .offset-xl-70,[dir=rtl] .flex-offset-xl-70,[dir=rtl] .layout-margin .flex-offset-xl-70,[dir=rtl] .layout-margin .offset-xl-70{margin-left:auto;margin-right:70%}.offset-xl-75,.flex-offset-xl-75,.layout-margin .flex-offset-xl-75,.layout-margin .offset-xl-75{margin-left:75%}[dir=rtl] .offset-xl-75,[dir=rtl] .flex-offset-xl-75,[dir=rtl] .layout-margin .flex-offset-xl-75,[dir=rtl] .layout-margin .offset-xl-75{margin-left:auto;margin-right:75%}.offset-xl-80,.flex-offset-xl-80,.layout-margin .flex-offset-xl-80,.layout-margin .offset-xl-80{margin-left:80%}[dir=rtl] .offset-xl-80,[dir=rtl] .flex-offset-xl-80,[dir=rtl] .layout-margin .flex-offset-xl-80,[dir=rtl] .layout-margin .offset-xl-80{margin-left:auto;margin-right:80%}.offset-xl-85,.flex-offset-xl-85,.layout-margin .flex-offset-xl-85,.layout-margin .offset-xl-85{margin-left:85%}[dir=rtl] .offset-xl-85,[dir=rtl] .flex-offset-xl-85,[dir=rtl] .layout-margin .flex-offset-xl-85,[dir=rtl] .layout-margin .offset-xl-85{margin-left:auto;margin-right:85%}.offset-xl-90,.flex-offset-xl-90,.layout-margin .flex-offset-xl-90,.layout-margin .offset-xl-90{margin-left:90%}[dir=rtl] .offset-xl-90,[dir=rtl] .flex-offset-xl-90,[dir=rtl] .layout-margin .flex-offset-xl-90,[dir=rtl] .layout-margin .offset-xl-90{margin-left:auto;margin-right:90%}.offset-xl-95,.flex-offset-xl-95,.layout-margin .flex-offset-xl-95,.layout-margin .offset-xl-95{margin-left:95%}[dir=rtl] .offset-xl-95,[dir=rtl] .flex-offset-xl-95,[dir=rtl] .layout-margin .flex-offset-xl-95,[dir=rtl] .layout-margin .offset-xl-95{margin-left:auto;margin-right:95%}.offset-xl-33,.flex-offset-xl-33,.layout-margin .flex-offset-xl-33,.layout-margin .offset-xl-33{margin-left:33.3333333333%}.offset-xl-66,.flex-offset-xl-66,.layout-margin .flex-offset-xl-66,.layout-margin .offset-xl-66{margin-left:66.6666666667%}[dir=rtl] .offset-xl-66,[dir=rtl] .flex-offset-xl-66,[dir=rtl] .layout-margin .flex-offset-xl-66,[dir=rtl] .layout-margin .offset-xl-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-start,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-start,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-start,.layout-align-xl-space-around-end,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-start,.layout-align-xl-space-between-end,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-start-start,.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-between-start,.layout-align-xl-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-start-center,.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-between-center,.layout-align-xl-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-start-center>*,.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-start-end,.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-between-end,.layout-align-xl-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-start-stretch,.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none !important}}:root{--xc-ws-div-color: #011f6a;--xc-ws-text-color: #ffffff;--xc-ws-text-button-color: #ffffff;--xc-ws-button-color: #011f6a;--xc-ws-background-color: #fafafa;--xc-ws-client-height: 450px;--xc-ws-client-width: 295px}span.ng-binding,span.field-description{user-select:none}.centered-text{text-align:center}::-webkit-scrollbar{width:0;background:transparent}::-webkit-scrollbar-thumb{background:transparent;border-radius:0px}.field-description{font-size:13px;line-height:14px;color:gray;padding:5px 0px 5px 0px}.field-description.error{color:#dd2c00}.md-button.upload-button{padding:0 16px;height:36px}md-icon.material-icons{color:inherit !important}.white-label,.md-toolbar-tools .title{user-select:none}.white-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.white-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-fab.upload-button,.md-fab.upload-button.md-button.md-default-theme.md-raised:not([disabled]) md-icon,.md-fab.upload-button.md-button.md-raised:not([disabled]) md-icon{color:var(--xc-ws-text-color) !important;background:var(--xc-ws-div-color) !important}.form-input-container span{word-break:break-all}.chat-online ::-webkit-scrollbar{width:5px;background:var(--xc-ws-div-color)}.chat-online ::-webkit-scrollbar-thumb{background:linear-gradient(13deg, var(--xc-ws-text-color), var(--xc-ws-div-color));border-radius:10px}.chat-online ::-webkit-scrollbar-thumb:hover{background:linear-gradient(13deg, var(--xc-ws-div-color), var(--xc-ws-text-color))}.chat-online form{display:flex;width:100%;height:calc(100% - 20px);overflow:auto;padding:1em 0px 40px 0px;position:relative;max-width:100%;overflow-x:hidden;margin-bottom:10px}.chat-online form .form-field{margin-right:10px;margin-left:10px}.chat-online form .form-input-container{width:100%;height:100%;overflow:auto;scrollbar-width:none}.chat-online form div[ng-switch-when=label] md-content{overflow:hidden}.chat-online form div[ng-switch-when=label] md-content span{overflow:hidden}.chat-online form div.online-button-wrapper,.chat-online form div.offline-button-wrapper{position:fixed;bottom:30px;left:0px;width:calc(100% - 40px);padding:0px 20px;display:flex;background:transparent;align-items:center;justify-content:center}.chat-online form div.online-button-wrapper button,.chat-online form div.offline-button-wrapper button{margin:8px 0px;padding:2px;width:100%}.chat-online form .layout-row,.chat-online form .layout-column{flex-wrap:wrap;justify-content:start}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button,.chat-online form .layout-column md-checkbox,.chat-online form .layout-column md-radio-button{padding:4px 0;margin-left:unset !important;word-break:break-all}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button{min-width:50%;max-width:50%}.chat-online form button.upload-button{margin:6px 8px 6px 0}.chat-online form button.upload-button md-icon{font-size:20px}.chat-unmanaged{display:flex;flex-direction:column}.chat-unmanaged form{flex-grow:1;max-width:100%;overflow-x:hidden}.chat-closing{height:100%;padding:20px;overflow:hidden;align-items:stretch;justify-content:space-between}.chat-closing>md-content,.chat-closing>form{max-width:100%;overflow-x:hidden}.chat-closing>md-content,.chat-closing>md-content span,.chat-closing>form,.chat-closing>form span{width:100%}.logo{width:32px}#attachmentButton:hover .mdi-attachment:before{color:#555 !important;opacity:.85 !important}#input_text{position:relative !important;width:100% !important;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}#input_text:focus-within{border-color:#66afe9;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}#attachmentButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}i.icon_color{color:red}#sendButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}.emojionearea,.emojionearea.form-control{display:block;position:relative !important;width:100%;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:0px solid #ccc !important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-webkit-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.mdi mdi-attachment mdi-24px mdi-light ng-scope::before{color:#a9a9a9}.mdi-attachment:hover{color:#555 !important}.mdi-24px.mdi-set,.mdi-24px.mdi:before{color:#a9a9a9}.md-button.md-fab.md-mini{line-height:20px !important;min-height:24px !important}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img{width:19px !important;height:19px !important;margin:0 1px !important}.emojionearea .emojionearea-picker{width:100% !important;right:0 !important;height:220px !important;top:0px !important}.emojionearea .emojionearea-picker .emojionearea-wrapper{position:relative;height:220px !important;width:100% !important}.emojionearea .emojionearea-picker.emojionearea-picker-position-top{margin-top:-100% !important}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top{margin-top:-236px !important;width:260px !important;min-width:260px !important}.emojionearea .emojionearea-picker .emojionearea-search>input{width:100px !important;min-width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search{width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area{height:70% !important}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block{padding:0 !important}.emojionearea .emojionearea-picker .emojionearea-filters{background:#f5f7f9;padding:0 !important;height:40px}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter{width:25px !important;padding:7px 3px 0}#id-row,#chat-app{max-width:100%;width:100%;max-height:100%;height:100%}#chat-app{background-color:transparent}#chat-app .header-button{padding:0;margin:0;font-size:18px;cursor:pointer}ui-view{display:block;width:100%;height:100%}#chat-app .chat-toolbar{height:56px;min-height:56px;cursor:pointer;outline:0}#chat-app .chat-content{flex-grow:1;height:calc(100% - 56px);background:#fff;border:1px solid #d3d3d3;-ms-overflow-style:none;overflow:hidden;box-sizing:border-box}#chat-app .chat-content .chat-messages{height:calc(100% - 60px);overflow:auto;border-bottom:1px solid #d3d3d3}#chat-app .chat-content .chat-online{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .chat-content .chat-unmanaged{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .avatar-wrapper{position:relative;bottom:-3px;right:5px}#chat-app .chat-content .message-row .bubble{word-wrap:break-word;position:relative;max-width:190px;padding:6px 7px 8px 9px;background-color:#fff;border-radius:6px}#chat-app .chat-content .message-row .bubble .message{white-space:pre-wrap}#chat-app .chat-content .message-row .bubble .message-done{color:#dcdcdc}#chat-app .chat-content .message-row .bubble .message-done-all{color:#00bfff}#chat-app .chat-content .message-row .bubble:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=);content:"";position:absolute;left:-11px;bottom:3px;width:12px;height:19px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain}#chat-app .chat-content .message-row .bubble .time{font-size:10px;text-align:right;margin-bottom:5px}#chat-app .chat-content .message-row.out .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.auto{align-items:flex-end;font-style:italic}#chat-app .chat-content .message-row.auto .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-size:17px;font-style:italic;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in{align-items:flex-end}#chat-app .chat-content .message-row.in2{align-items:flex-end}#chat-app .chat-content .message-row.out{align-items:flex-end}#chat-app .chat-content .message-row.in2 .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in2 .bubble{margin-right:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in2 .bubble:before{left:-11px;right:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=);-webkit-transform:rotate(180deg);transform:rotate(180deg)}#chat-app .chat-content .message-row.in .avatar{order:2;margin:0 0 0 16px;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in .bubble:before{right:-11px;left:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=)}#chat-app .chat-footer{width:100%}#waiting{overflow:visible;height:calc(100% - 64px);background:#fff;text-align:center;flex:1 0 auto;padding:32px}#waiting .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54)}.sk-fading-circle{width:40px;height:40px;position:relative}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:"";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}md-toast.md-success-toast .md-toast-content{background-color:green}md-toast.md-warning-toast .md-toast-content{background-color:#ffd103;color:#383838}md-toast.md-failure-toast .md-toast-content{background-color:red}md-toast.size .md-toast-content{font-weight:550;padding:0px;text-align:center;height:56px}md-toast.rounded .md-toast-content{border-radius:15px 15px 0px 0px}md-toast.squared .md-toast-content{border-radius:0px 0px 0px 0px}@media(min-device-width: 769px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:block}}@media(max-device-width: 768px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:none}}md-option .md-text{white-space:break-spaces}md-input-container{margin:0px 0px 8px 0px}.no-padding{padding:0 !important} + */html,body{height:100%;position:relative}body{margin:0;padding:0}[tabindex="-1"]:focus{outline:none}.inset{padding:10px}a.md-no-style,button.md-no-style{font-weight:normal;background-color:inherit;text-align:left;border:none;padding:0;margin:0}select,button,textarea,input{vertical-align:baseline}input[type=reset],input[type=submit],html input[type=button],button{cursor:pointer;-webkit-appearance:button}input[type=reset][disabled],input[type=submit][disabled],html input[type=button][disabled],button[disabled]{cursor:default}textarea{vertical-align:top;overflow:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box;-webkit-box-sizing:content-box}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none}input:-webkit-autofill{text-shadow:none}.md-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;text-transform:none;width:1px}.md-shadow{position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;pointer-events:none}.md-shadow-bottom-z-1{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-shadow-bottom-z-2{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-shadow-animated.md-shadow{transition:box-shadow .28s cubic-bezier(0.4, 0, 0.2, 1)}.md-ripple-container{pointer-events:none;position:absolute;overflow:hidden;left:0;top:0;width:100%;height:100%;transition:all .55s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple{position:absolute;transform:translate(-50%, -50%) scale(0);transform-origin:50% 50%;opacity:0;border-radius:50%}.md-ripple.md-ripple-placed{transition:margin .9s cubic-bezier(0.25, 0.8, 0.25, 1),border .9s cubic-bezier(0.25, 0.8, 0.25, 1),width .9s cubic-bezier(0.25, 0.8, 0.25, 1),height .9s cubic-bezier(0.25, 0.8, 0.25, 1),opacity .9s cubic-bezier(0.25, 0.8, 0.25, 1),transform .9s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-ripple.md-ripple-scaled{transform:translate(-50%, -50%) scale(1)}.md-ripple.md-ripple-active,.md-ripple.md-ripple-full,.md-ripple.md-ripple-visible{opacity:.2}.md-ripple.md-ripple-remove{animation:md-remove-ripple .9s cubic-bezier(0.25, 0.8, 0.25, 1)}@keyframes md-remove-ripple{0%{opacity:.15}100%{opacity:0}}.md-padding{padding:8px}.md-margin{margin:8px}.md-scroll-mask{position:absolute;background-color:transparent;top:0;right:0;bottom:0;left:0;z-index:50}.md-scroll-mask>.md-scroll-mask-bar{display:block;position:absolute;background-color:#fafafa;right:0;top:0;bottom:0;z-index:65;box-shadow:inset 0 0 1px rgba(0,0,0,.3)}.md-no-momentum{-webkit-overflow-scrolling:auto}.md-no-flicker{-webkit-filter:blur(0px)}@media(min-width: 960px){.md-padding{padding:16px}}html[dir=rtl],html[dir=ltr],body[dir=rtl],body[dir=ltr]{unicode-bidi:embed}bdo[dir=rtl]{direction:rtl;unicode-bidi:bidi-override}bdo[dir=ltr]{direction:ltr;unicode-bidi:bidi-override}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-xs-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xs-row>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),.layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-sm-row:not(.layout-sm-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),.layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-md-row:not(.layout-md-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),.layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-lg-row:not(.layout-lg-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:16px}[dir=rtl] .layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child),[dir=rtl] .layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>.md-auto-horizontal-margin:not(:first-child){margin-left:0;margin-right:16px}}html,body{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:default;min-height:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.md-display-4{font-size:112px;font-weight:300;letter-spacing:-0.01em;line-height:112px}.md-display-3{font-size:56px;font-weight:400;letter-spacing:-0.005em;line-height:56px}.md-display-2{font-size:45px;font-weight:400;line-height:64px}.md-display-1{font-size:34px;font-weight:400;line-height:40px}.md-headline{font-size:24px;font-weight:400;line-height:32px}.md-title{font-size:20px;font-weight:500;letter-spacing:.005em}.md-subhead{font-size:16px;font-weight:400;letter-spacing:.01em;line-height:24px}.md-body-1{font-size:14px;font-weight:400;letter-spacing:.01em;line-height:20px}.md-body-2{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:24px}.md-caption{font-size:12px;letter-spacing:.02em}.md-button{letter-spacing:.01em}button,select,html,textarea,input{font-family:Roboto,"Helvetica Neue",sans-serif}select,button,textarea,input{font-size:100%}.md-panel-outer-wrapper{height:100%;left:0;position:absolute;top:0;width:100%}.md-panel-inner-wrapper{position:fixed}._md-panel-offscreen{left:-9999px}._md-panel-hidden{display:none}._md-panel-shown .md-panel{opacity:1;transition:none}.md-panel{opacity:0;position:relative}.md-panel._md-panel-shown{opacity:1;transition:none}.md-panel._md-panel-animate-enter{opacity:1;transition:all .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-panel-animate-leave{opacity:1;transition:all .3s cubic-bezier(0.4, 0, 1, 1)}.md-panel._md-panel-animate-scale-out,.md-panel._md-panel-animate-fade-out{opacity:0}.md-panel._md-panel-backdrop{height:100%;position:fixed;width:100%}.md-panel._md-opaque-enter{opacity:.48;transition:opacity .3s cubic-bezier(0, 0, 0.2, 1)}.md-panel._md-opaque-leave{transition:opacity .3s cubic-bezier(0.4, 0, 1, 1)}._md-panel-fullscreen{border-radius:0;left:0;min-height:100%;min-width:100%;position:fixed;top:0}md-autocomplete{border-radius:2px;display:block;height:40px;position:relative;overflow:visible;min-width:190px}md-autocomplete[disabled] input{cursor:default}md-autocomplete[md-floating-label]{border-radius:0;background:transparent;height:auto}md-autocomplete[md-floating-label] md-input-container{padding-bottom:0}md-autocomplete[md-floating-label] md-autocomplete-wrap{height:auto}md-autocomplete[md-floating-label] .md-show-clear-button button{display:block;position:absolute;right:0;top:20px;width:30px;height:30px}md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:30px}[dir=rtl] md-autocomplete[md-floating-label] .md-show-clear-button input{padding-right:0;padding-left:30px}md-autocomplete md-autocomplete-wrap{display:flex;flex-direction:row;box-sizing:border-box;position:relative;overflow:visible;height:40px}md-autocomplete md-autocomplete-wrap.md-menu-showing{z-index:51}md-autocomplete md-autocomplete-wrap md-input-container,md-autocomplete md-autocomplete-wrap input{flex:1 1 0;box-sizing:border-box;min-width:0}md-autocomplete md-autocomplete-wrap md-progress-linear{position:absolute;bottom:-2px;left:0}md-autocomplete md-autocomplete-wrap md-progress-linear.md-inline{bottom:40px;right:2px;left:2px;width:auto}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate{position:absolute;top:0;left:0;width:100%;height:3px;transition:none}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container{transition:none;height:3px}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter.ng-enter-active{opacity:1}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave{transition:opacity .15s linear}md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave.ng-leave-active{opacity:0}md-autocomplete input:not(.md-input){font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;width:100%;padding:0 15px;line-height:40px;height:40px}md-autocomplete input:not(.md-input)::-ms-clear{display:none}md-autocomplete .md-show-clear-button button{position:relative;line-height:20px;text-align:center;width:30px;height:30px;cursor:pointer;border:none;border-radius:50%;padding:0;font-size:12px;background:transparent;margin:auto 5px}md-autocomplete .md-show-clear-button button:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border-radius:50%;transform:scale(0);opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-autocomplete .md-show-clear-button button:focus{outline:none}md-autocomplete .md-show-clear-button button:focus:after{transform:scale(1);opacity:1}md-autocomplete .md-show-clear-button button md-icon{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0) scale(0.9)}md-autocomplete .md-show-clear-button button md-icon path{stroke-width:0}md-autocomplete .md-show-clear-button button.ng-enter{transform:scale(0);transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-enter.ng-enter-active{transform:scale(1)}md-autocomplete .md-show-clear-button button.ng-leave{transition:transform .15s ease-out}md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active{transform:scale(0)}@media screen and (-ms-high-contrast: active){md-autocomplete input{border:1px solid #fff}md-autocomplete .md-autocomplete-suggestion:focus{color:#fff}}.md-virtual-repeat-container.md-autocomplete-suggestions-container,.md-standard-list-container.md-autocomplete-suggestions-container{position:absolute;box-shadow:0 2px 5px rgba(0,0,0,.25);z-index:100;height:100%}.md-virtual-repeat-container.md-autocomplete-suggestions-container .highlight,.md-standard-list-container.md-autocomplete-suggestions-container .highlight{font-weight:bold}.md-standard-list-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;overflow-y:auto;padding:0}.md-virtual-repeat-container.md-not-found,.md-standard-list-container.md-not-found{height:48px}.md-autocomplete-suggestions{margin:0;list-style:none;padding:0}.md-autocomplete-suggestions .md-autocomplete-suggestion{font-size:14px;overflow:hidden;padding:0 15px;line-height:48px;height:48px;transition:background .15s linear;margin:0;white-space:nowrap;text-overflow:ellipsis}.md-autocomplete-suggestions .md-autocomplete-suggestion:focus{outline:none}.md-autocomplete-suggestions .md-autocomplete-suggestion:not(.md-not-found-wrapper){cursor:pointer}@media screen and (-ms-high-contrast: active){md-autocomplete,.md-autocomplete-suggestions{border:1px solid #fff}}md-backdrop{transition:opacity 450ms;position:absolute;top:0;bottom:0;left:0;right:0;z-index:50}md-backdrop.md-menu-backdrop{position:fixed !important;z-index:99}md-backdrop.md-select-backdrop{z-index:81;transition-duration:0}md-backdrop.md-dialog-backdrop{z-index:79}md-backdrop.md-bottom-sheet-backdrop{z-index:69}md-backdrop.md-sidenav-backdrop{z-index:59}md-backdrop.md-click-catcher{position:absolute}md-backdrop.md-opaque{opacity:.48}md-backdrop.md-opaque.ng-enter{opacity:0}md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active{opacity:.48}md-backdrop.md-opaque.ng-leave{opacity:.48;transition:opacity 400ms}md-backdrop.md-opaque.ng-leave.md-opaque.ng-leave-active{opacity:0}md-bottom-sheet{position:absolute;left:0;right:0;bottom:0;padding:8px 16px 88px 16px;z-index:70;border-top-width:1px;border-top-style:solid;transform:translate3d(0, 80px, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform}md-bottom-sheet.md-has-header{padding-top:0}md-bottom-sheet.ng-enter{opacity:0;transform:translate3d(0, 100%, 0)}md-bottom-sheet.ng-enter-active{opacity:1;display:block;transform:translate3d(0, 80px, 0) !important}md-bottom-sheet.ng-leave-active{transform:translate3d(0, 100%, 0) !important;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-bottom-sheet .md-subheader{background-color:transparent;font-family:Roboto,"Helvetica Neue",sans-serif;line-height:56px;padding:0;white-space:nowrap}md-bottom-sheet md-inline-icon{display:inline-block;height:24px;width:24px;fill:#444}md-bottom-sheet md-list-item{display:flex;outline:none}md-bottom-sheet md-list-item:hover{cursor:pointer}md-bottom-sheet.md-list md-list-item{padding:0;align-items:center;height:48px}md-bottom-sheet.md-grid{padding-left:24px;padding-right:24px;padding-top:0}md-bottom-sheet.md-grid md-list{display:flex;flex-direction:row;flex-wrap:wrap;transition:all .5s;align-items:center}md-bottom-sheet.md-grid md-list-item{flex-direction:column;align-items:center;transition:all .5s;height:96px;margin-top:8px;margin-bottom:8px}@media(max-width: 960px){md-bottom-sheet.md-grid md-list-item{flex:1 1 33.3333333333%;max-width:33.3333333333%}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n + 1){align-items:flex-start}md-bottom-sheet.md-grid md-list-item:nth-of-type(3n){align-items:flex-end}}@media(min-width: 960px)and (max-width: 1279px){md-bottom-sheet.md-grid md-list-item{flex:1 1 25%;max-width:25%}}@media(min-width: 1280px)and (max-width: 1919px){md-bottom-sheet.md-grid md-list-item{flex:1 1 16.6666666667%;max-width:16.6666666667%}}@media(min-width: 1920px){md-bottom-sheet.md-grid md-list-item{flex:1 1 14.2857142857%;max-width:14.2857142857%}}md-bottom-sheet.md-grid md-list-item::before{display:none}md-bottom-sheet.md-grid md-list-item .md-list-item-content{display:flex;flex-direction:column;align-items:center;width:48px;padding-bottom:16px}md-bottom-sheet.md-grid md-list-item .md-grid-item-content{border:1px solid transparent;display:flex;flex-direction:column;align-items:center;width:80px}md-bottom-sheet.md-grid md-list-item .md-grid-text{font-weight:400;line-height:16px;font-size:13px;margin:0;white-space:nowrap;width:64px;text-align:center;text-transform:none;padding-top:8px}@media screen and (-ms-high-contrast: active){md-bottom-sheet{border:1px solid #fff}}button.md-button::-moz-focus-inner{border:0}.md-button{display:inline-block;position:relative;cursor:pointer;min-height:36px;min-width:88px;line-height:36px;vertical-align:middle;align-items:center;text-align:center;border-radius:2px;box-sizing:border-box;user-select:none;outline:none;border:0;padding:0 8px;margin:6px 8px;background:transparent;color:currentColor;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;font-style:inherit;font-variant:inherit;font-family:inherit;text-decoration:none;overflow:hidden;transition:box-shadow .4s cubic-bezier(0.25, 0.8, 0.25, 1),background-color .4s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){min-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){line-height:32px}.md-dense>.md-button:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) .md-button:not(.md-dense-disabled){font-size:13px}.md-button:focus{outline:none}.md-button:hover,.md-button:focus{text-decoration:none}.md-button.ng-hide,.md-button.ng-leave{transition:none}.md-button.md-cornered{border-radius:0}.md-button.md-icon{padding:0;background:none}.md-button.md-raised:not([disabled]){box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button.md-icon-button{margin:0 6px;height:40px;min-width:0;line-height:24px;padding:8px;width:40px;border-radius:50%}.md-button.md-fab{z-index:20;line-height:56px;min-width:0;width:56px;height:56px;vertical-align:middle;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:50%;background-clip:padding-box;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-property:background-color,box-shadow,transform}.md-button.md-fab.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}.md-button.md-fab.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}.md-button.md-fab.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}.md-button.md-fab.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}.md-button.md-fab.md-mini{line-height:40px;width:40px;height:40px}.md-button.md-fab.ng-hide,.md-button.md-fab.ng-leave{transition:none}.md-button.md-fab[disabled]{box-shadow:none}.md-button:not([disabled]).md-raised.md-focused,.md-button:not([disabled]).md-fab.md-focused{box-shadow:0 2px 5px 0 rgba(0,0,0,.26)}.md-button:not([disabled]).md-raised:active,.md-button:not([disabled]).md-fab:active{box-shadow:0 4px 8px 0 rgba(0,0,0,.4)}.md-button .md-ripple-container{border-radius:inherit;background-clip:padding-box;overflow:hidden;-webkit-transform:translateZ(0)}.md-button.md-icon-button md-icon,button.md-button.md-fab md-icon{display:block}.md-toast-open-top .md-button.md-fab-top-left,.md-toast-open-top .md-button.md-fab-top-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, 42px, 0)}.md-toast-open-top .md-button.md-fab-top-left:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-left:not([disabled]):hover,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]).md-focused,.md-toast-open-top .md-button.md-fab-top-right:not([disabled]):hover{transform:translate3d(0, 41px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left,.md-toast-open-bottom .md-button.md-fab-bottom-right{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate3d(0, -42px, 0)}.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-left:not([disabled]):hover,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]).md-focused,.md-toast-open-bottom .md-button.md-fab-bottom-right:not([disabled]):hover{transform:translate3d(0, -43px, 0)}.md-button-group{display:flex;flex:1;width:100%}.md-button-group>.md-button{flex:1;display:block;overflow:hidden;width:0;border-width:1px 0px 1px 1px;border-radius:0;text-align:center;text-overflow:ellipsis;white-space:nowrap}.md-button-group>.md-button:first-child{border-radius:2px 0px 0px 2px}.md-button-group>.md-button:last-child{border-right-width:1px;border-radius:0px 2px 2px 0px}@media screen and (-ms-high-contrast: active){.md-button.md-raised,.md-button.md-fab{border:1px solid #fff}}md-card{box-sizing:border-box;display:flex;flex-direction:column;margin:8px;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-card md-card-header{padding:16px;display:flex;flex-direction:row}md-card md-card-header:first-child md-card-avatar{margin-right:12px}[dir=rtl] md-card md-card-header:first-child md-card-avatar{margin-right:auto;margin-left:12px}md-card md-card-header:last-child md-card-avatar{margin-left:12px}[dir=rtl] md-card md-card-header:last-child md-card-avatar{margin-left:auto;margin-right:12px}md-card md-card-header md-card-avatar{width:40px;height:40px}md-card md-card-header md-card-avatar .md-user-avatar,md-card md-card-header md-card-avatar md-icon{border-radius:50%}md-card md-card-header md-card-avatar md-icon{padding:8px}md-card md-card-header md-card-avatar md-icon>svg{height:inherit;width:inherit}md-card md-card-header md-card-avatar+md-card-header-text{max-height:40px}md-card md-card-header md-card-avatar+md-card-header-text .md-title{font-size:14px}md-card md-card-header md-card-header-text{display:flex;flex:1;flex-direction:column}md-card md-card-header md-card-header-text .md-subhead{font-size:14px}md-card>img,md-card>md-card-header img,md-card md-card-title-media img{box-sizing:border-box;display:flex;flex:0 0 auto;width:100%;height:auto}md-card md-card-title{padding:24px 16px 16px;display:flex;flex:1 1 auto;flex-direction:row}md-card md-card-title+md-card-content{padding-top:0}md-card md-card-title md-card-title-text{flex:1;flex-direction:column;display:flex}md-card md-card-title md-card-title-text .md-subhead{padding-top:0;font-size:14px}md-card md-card-title md-card-title-text:only-child .md-subhead{padding-top:12px}md-card md-card-title md-card-title-media{margin-top:-8px}md-card md-card-title md-card-title-media .md-media-sm{height:80px;width:80px}md-card md-card-title md-card-title-media .md-media-md{height:112px;width:112px}md-card md-card-title md-card-title-media .md-media-lg{height:152px;width:152px}md-card md-card-content{display:block;padding:16px}md-card md-card-content>p:first-child{margin-top:0}md-card md-card-content>p:last-child{margin-bottom:0}md-card md-card-content .md-media-xl{height:240px;width:240px}md-card md-card-actions{margin:8px}md-card md-card-actions.layout-column .md-button:not(.md-icon-button){margin:2px 0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):first-of-type{margin-top:0}md-card md-card-actions.layout-column .md-button:not(.md-icon-button):last-of-type{margin-bottom:0}md-card md-card-actions.layout-column .md-button.md-icon-button{margin-top:6px;margin-bottom:6px}md-card md-card-actions md-card-icon-actions{flex:1;justify-content:flex-start;display:flex;flex-direction:row}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button){margin:0 4px}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):first-of-type{margin-left:auto;margin-right:0}md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:0}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button:not(.md-icon-button):last-of-type{margin-right:auto;margin-left:0}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button{margin-left:6px;margin-right:6px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:first-of-type{margin-left:auto;margin-right:12px}md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:12px}[dir=rtl] md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-type{margin-right:auto;margin-left:12px}md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions{flex:1;justify-content:flex-end;display:flex;flex-direction:row}md-card md-card-footer{margin-top:auto;padding:16px}@media screen and (-ms-high-contrast: active){md-card{border:1px solid #fff}}.md-image-no-fill>img{width:auto;height:auto}.md-inline-form md-checkbox{margin-top:14px;margin-bottom:auto}md-checkbox{box-sizing:border-box;display:inline-block;white-space:nowrap;cursor:pointer;outline:none;user-select:none;position:relative;min-width:18px;min-height:48px}.md-dense>md-checkbox:not(.md-dense-disabled),.md-dense :not(.md-dense-disabled) md-checkbox:not(.md-dense-disabled){min-height:36px}md-checkbox.md-focused:not([disabled]) .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-checkbox.md-focused:not([disabled]):not(.md-checked) .md-container:before{background-color:rgba(0,0,0,.12)}md-checkbox .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-checkbox .md-container{left:auto}[dir=rtl] md-checkbox .md-container{right:0}md-checkbox .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-checkbox .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-checkbox .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-checkbox .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-checkbox.md-checked .md-icon{border-color:transparent}md-checkbox.md-checked .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox[disabled]{cursor:default}md-checkbox.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-checkbox .md-container{top:auto;left:auto;right:auto;margin:3px;margin-top:21px}md-checkbox .md-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;margin-top:10px;margin-bottom:auto;margin-left:36px}[dir=rtl] md-checkbox .md-label{margin-left:0;margin-right:36px}md-checkbox .md-label:empty{margin-left:24px;margin-right:0}[dir=rtl] md-checkbox .md-label:empty{margin-left:0}[dir=rtl] md-checkbox .md-label:empty{margin-right:24px}md-input-container .md-checkbox-link-label{box-sizing:border-box;position:relative;display:inline-block;vertical-align:middle;white-space:normal;user-select:text;cursor:pointer;top:-21px;margin-left:18px;margin-right:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-left:0}[dir=rtl] md-input-container .md-checkbox-link-label{margin-right:18px}.md-contact-chips .md-chips md-chip{padding:0 25px 0 0}[dir=rtl] .md-contact-chips .md-chips md-chip{padding:0 0 0 25px}.md-contact-chips .md-chips md-chip .md-contact-avatar{float:left}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-avatar{float:right}.md-contact-chips .md-chips md-chip .md-contact-avatar img{height:32px;border-radius:16px}.md-contact-chips .md-chips md-chip .md-contact-name{display:inline-block;height:32px;margin-left:8px}[dir=rtl] .md-contact-chips .md-chips md-chip .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion{height:56px}.md-contact-suggestion img{height:40px;border-radius:20px;margin-top:8px}.md-contact-suggestion .md-contact-name{margin-left:8px;width:120px}[dir=rtl] .md-contact-suggestion .md-contact-name{margin-left:auto;margin-right:8px}.md-contact-suggestion .md-contact-name,.md-contact-suggestion .md-contact-email{display:inline-block;overflow:hidden;text-overflow:ellipsis}.md-contact-chips-suggestions li{height:100%}md-chips{display:flex}.md-chips{display:flex;flex-wrap:wrap;flex-grow:1;font-family:Roboto,"Helvetica Neue",sans-serif;font-size:13px;padding:0 0 8px 3px;vertical-align:middle}.md-chips:after{content:"";display:table;clear:both}[dir=rtl] .md-chips{padding:0 3px 8px 0}.md-chips.md-readonly .md-chip-input-container{min-height:32px}.md-chips:not(.md-readonly){cursor:text}.md-chips.md-removable md-chip{padding-right:28px}[dir=rtl] .md-chips.md-removable md-chip{padding-right:0;padding-left:28px}.md-chips.md-removable md-chip .md-chip-content{padding-right:4px}[dir=rtl] .md-chips.md-removable md-chip .md-chip-content{padding-right:0;padding-left:4px}.md-chips md-chip{cursor:default;border-radius:16px;display:block;height:32px;line-height:32px;margin:8px 8px 0 0;padding:0 12px 0 12px;float:left;box-sizing:border-box;max-width:100%;position:relative}[dir=rtl] .md-chips md-chip{margin:8px 0 0 8px}[dir=rtl] .md-chips md-chip{float:right}.md-chips md-chip .md-chip-content{display:block;float:left;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-chips md-chip .md-chip-content{float:right}.md-chips md-chip .md-chip-content:focus{outline:none}.md-chips md-chip._md-chip-content-edit-is-enabled{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;-ms-user-select:none}.md-chips md-chip .md-chip-remove-container{position:absolute;right:0;line-height:22px}[dir=rtl] .md-chips md-chip .md-chip-remove-container{right:auto;left:0}.md-chips md-chip .md-chip-remove{text-align:center;width:32px;height:32px;min-width:0;padding:0;background:transparent;border:none;box-shadow:none;margin:0;position:relative}.md-chips md-chip .md-chip-remove md-icon{height:18px;width:18px;min-height:18px;min-width:18px;position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.md-chips .md-chip-input-container{display:block;line-height:32px;margin:8px 8px 0 0;padding:0;flex-grow:1;float:left}[dir=rtl] .md-chips .md-chip-input-container{margin:8px 0 0 8px}[dir=rtl] .md-chips .md-chip-input-container{float:right}.md-chips .md-chip-input-container input{width:100%}.md-chips .md-chip-input-container input:not([type]),.md-chips .md-chip-input-container input[type=email],.md-chips .md-chip-input-container input[type=number],.md-chips .md-chip-input-container input[type=tel],.md-chips .md-chip-input-container input[type=url],.md-chips .md-chip-input-container input[type=text]{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:not([type]):focus,.md-chips .md-chip-input-container input[type=email]:focus,.md-chips .md-chip-input-container input[type=number]:focus,.md-chips .md-chip-input-container input[type=tel]:focus,.md-chips .md-chip-input-container input[type=url]:focus,.md-chips .md-chip-input-container input[type=text]:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{background:transparent;height:32px}.md-chips .md-chip-input-container md-autocomplete md-autocomplete-wrap{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container input{border:0;height:32px;line-height:32px;padding:0}.md-chips .md-chip-input-container input:focus{outline:none}.md-chips .md-chip-input-container md-autocomplete,.md-chips .md-chip-input-container md-autocomplete-wrap{height:32px}.md-chips .md-chip-input-container md-autocomplete{box-shadow:none}.md-chips .md-chip-input-container md-autocomplete input{position:relative}.md-chips .md-chip-input-container:not(:first-child){margin:8px 8px 0 0}[dir=rtl] .md-chips .md-chip-input-container:not(:first-child){margin:8px 0 0 8px}.md-chips .md-chip-input-container input{background:transparent;border-width:0}.md-chips md-autocomplete button{display:none}@media screen and (-ms-high-contrast: active){.md-chip-input-container,md-chip{border:1px solid #fff}.md-chip-input-container md-autocomplete{border:none}}md-content{display:block;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}md-content[md-scroll-y]{overflow-y:auto;overflow-x:hidden}md-content[md-scroll-x]{overflow-x:auto;overflow-y:hidden}@media print{md-content{overflow:visible !important}}md-calendar{font-size:13px;user-select:none}.md-calendar-scroll-mask{display:inline-block;overflow:hidden;height:308px}.md-calendar-scroll-mask .md-virtual-repeat-scroller{overflow-y:scroll;-webkit-overflow-scrolling:touch}.md-calendar-scroll-mask .md-virtual-repeat-scroller::-webkit-scrollbar{display:none}.md-calendar-scroll-mask .md-virtual-repeat-offsetter{width:100%}.md-calendar-scroll-container{box-shadow:inset -3px 3px 6px rgba(0,0,0,.2);display:inline-block;height:308px;width:346px}.md-calendar-date{height:44px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box}.md-calendar-date:first-child{padding-left:16px}[dir=rtl] .md-calendar-date:first-child{padding-left:0;padding-right:16px}.md-calendar-date:last-child{padding-right:16px}[dir=rtl] .md-calendar-date:last-child{padding-right:0;padding-left:16px}.md-calendar-date.md-calendar-date-disabled{cursor:default}.md-calendar-date-selection-indicator{transition:background-color,color .4s cubic-bezier(0.25, 0.8, 0.25, 1);border-radius:50%;display:inline-block;width:40px;height:40px;line-height:40px}.md-calendar-date:not(.md-disabled) .md-calendar-date-selection-indicator{cursor:pointer}.md-calendar-month-label{height:44px;font-size:14px;font-weight:500;padding:0 0 0 24px}[dir=rtl] .md-calendar-month-label{padding:0 24px 0 0}.md-calendar-month-label.md-calendar-label-clickable{cursor:pointer}.md-calendar-month-label md-icon{transform:rotate(180deg)}[dir=rtl] .md-calendar-month-label md-icon{transform:none}.md-calendar-month-label span{vertical-align:middle}.md-calendar-day-header{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar-day-header th{height:40px;width:44px;text-align:center;padding:0;border:none;box-sizing:content-box;font-weight:normal}.md-calendar-day-header th:first-child{padding-left:16px}[dir=rtl] .md-calendar-day-header th:first-child{padding-left:0;padding-right:16px}.md-calendar-day-header th:last-child{padding-right:16px}[dir=rtl] .md-calendar-day-header th:last-child{padding-right:0;padding-left:16px}.md-calendar{table-layout:fixed;border-spacing:0;border-collapse:collapse}.md-calendar tr:last-child td{border-bottom-width:1px;border-bottom-style:solid}.md-calendar:first-child{border-top:1px solid transparent}.md-calendar tbody,.md-calendar td,.md-calendar tr{vertical-align:middle;box-sizing:content-box}md-datepicker{white-space:nowrap;overflow:hidden;vertical-align:middle}.md-inline-form md-datepicker{margin-top:12px}.md-datepicker-button{display:inline-block;box-sizing:border-box;background:none;vertical-align:middle;position:relative}.md-datepicker-button:before{top:0;left:0;bottom:0;right:0;position:absolute;content:"";speak:none}.md-datepicker-input{font-size:14px;box-sizing:border-box;border:none;box-shadow:none;outline:none;background:transparent;min-width:120px;max-width:328px;padding:0 0 5px}.md-datepicker-input::-ms-clear{display:none}._md-datepicker-floating-label>md-datepicker{overflow:visible}._md-datepicker-floating-label>md-datepicker .md-datepicker-input-container{border:none}._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:left;margin-top:-16px;top:13.5px}[dir=rtl] ._md-datepicker-floating-label>md-datepicker .md-datepicker-button{float:right}._md-datepicker-floating-label .md-input{float:none}._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:18px;left:auto;width:calc(100% - 84px)}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){right:auto}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon>label:not(.md-no-float):not(.md-container-ignore){left:18px}._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:64px}[dir=rtl] ._md-datepicker-floating-label._md-datepicker-has-calendar-icon .md-input-message-animation{margin-left:auto;margin-right:64px}._md-datepicker-has-triangle-icon{padding-right:18px;margin-right:-18px}[dir=rtl] ._md-datepicker-has-triangle-icon{padding-right:0;padding-left:18px}[dir=rtl] ._md-datepicker-has-triangle-icon{margin-right:auto;margin-left:-18px}.md-datepicker-input-container{position:relative;border-bottom-width:1px;border-bottom-style:solid;display:inline-block;width:auto}.md-icon-button+.md-datepicker-input-container{margin-left:12px}[dir=rtl] .md-icon-button+.md-datepicker-input-container{margin-left:auto;margin-right:12px}.md-datepicker-input-container.md-datepicker-focused{border-bottom-width:2px}.md-datepicker-is-showing .md-scroll-mask{z-index:99}.md-datepicker-calendar-pane{position:absolute;top:0;left:-100%;z-index:100;border-width:1px;border-style:solid;background:transparent;transform:scale(0);transform-origin:0 0;transition:transform .2s cubic-bezier(0.25, 0.8, 0.25, 1)}.md-datepicker-calendar-pane.md-pane-open{transform:scale(1)}.md-datepicker-input-mask{height:40px;width:340px;position:relative;overflow:hidden;background:transparent;pointer-events:none;cursor:text}.md-datepicker-calendar{opacity:0;transition:opacity .2s cubic-bezier(0.5, 0, 0.25, 1)}.md-pane-open .md-datepicker-calendar{opacity:1}.md-datepicker-calendar md-calendar:focus{outline:none}.md-datepicker-expand-triangle{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid}.md-datepicker-triangle-button{position:absolute;right:0;bottom:-2.5px;transform:translateX(45%)}[dir=rtl] .md-datepicker-triangle-button{right:auto;left:0}[dir=rtl] .md-datepicker-triangle-button{transform:translateX(-45%)}.md-datepicker-triangle-button.md-button.md-icon-button{height:36px;width:36px;position:absolute;padding:8px}md-datepicker[disabled] .md-datepicker-input-container{border-bottom-color:transparent}md-datepicker[disabled] .md-datepicker-triangle-button{display:none}.md-datepicker-open{overflow:hidden}.md-datepicker-open .md-datepicker-input-container,.md-datepicker-open input.md-input{border-bottom-color:transparent}.md-datepicker-open .md-datepicker-triangle-button,.md-datepicker-open.md-input-has-value>label,.md-datepicker-open.md-input-has-placeholder>label{display:none}.md-datepicker-pos-adjusted .md-datepicker-input-mask{display:none}.md-datepicker-calendar-pane .md-calendar{transform:translateY(-85px);transition:transform .65s cubic-bezier(0.25, 0.8, 0.25, 1);transition-delay:.125s}.md-datepicker-calendar-pane.md-pane-open .md-calendar{transform:translateY(0)}.md-dialog-is-showing{max-height:100%}.md-dialog-container{display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;width:100%;height:100%;z-index:80;overflow:hidden}md-dialog{opacity:0;min-width:240px;max-width:80%;max-height:80%;position:relative;overflow:auto;box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12);display:flex;flex-direction:column}md-dialog.md-transition-in{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 0) scale(1)}md-dialog.md-transition-out{opacity:0;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform:translate(0, 100%) scale(0.2)}md-dialog>form{display:flex;flex-direction:column;overflow:auto}md-dialog .md-dialog-content{padding:24px}md-dialog md-dialog-content{order:1;flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}md-dialog md-dialog-content:not([layout=row])>*:first-child:not(.md-subheader){margin-top:0}md-dialog md-dialog-content:focus{outline:none}md-dialog md-dialog-content .md-subheader{margin:0}md-dialog md-dialog-content .md-dialog-content-body{width:100%}md-dialog md-dialog-content .md-prompt-input-container{width:100%;box-sizing:border-box}md-dialog md-dialog-actions{display:flex;order:2;box-sizing:border-box;align-items:center;justify-content:flex-end;margin-bottom:0;padding-right:8px;padding-left:16px;min-height:52px;overflow:hidden}[dir=rtl] md-dialog md-dialog-actions{padding-right:16px}[dir=rtl] md-dialog md-dialog-actions{padding-left:8px}md-dialog md-dialog-actions .md-button{margin-bottom:8px;margin-left:8px;margin-right:0;margin-top:8px}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-left:0}[dir=rtl] md-dialog md-dialog-actions .md-button{margin-right:8px}md-dialog.md-content-overflow md-dialog-actions{border-top-width:1px;border-top-style:solid}@media screen and (-ms-high-contrast: active){md-dialog{border:1px solid #fff}}@media(max-width: 959px){md-dialog.md-dialog-fullscreen{min-height:100%;min-width:100%;border-radius:0}}md-divider{display:block;border-top-width:1px;border-top-style:solid;margin:0}md-divider[md-inset]{margin-left:80px}[dir=rtl] md-divider[md-inset]{margin-left:auto;margin-right:80px}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-divider,.layout-xs-row>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-divider,.layout-gt-xs-row:not(.layout-sm-column)>md-divider,.layout-sm-row:not(.layout-sm-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-divider,.layout-gt-sm-row:not(.layout-md-column)>md-divider,.layout-md-row:not(.layout-md-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-divider,.layout-gt-md-row:not(.layout-lg-column)>md-divider,.layout-lg-row:not(.layout-lg-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-divider{border-top-width:0;border-right-width:1px;border-right-style:solid}}md-fab-speed-dial{position:relative;display:flex;align-items:center;z-index:20}md-fab-speed-dial.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-speed-dial.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-speed-dial.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-speed-dial.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-speed-dial:not(.md-hover-full){pointer-events:none}md-fab-speed-dial:not(.md-hover-full) md-fab-trigger,md-fab-speed-dial:not(.md-hover-full) .md-fab-action-item{pointer-events:auto}md-fab-speed-dial:not(.md-hover-full).md-is-open{pointer-events:auto}md-fab-speed-dial ._md-css-variables{z-index:20}md-fab-speed-dial.md-is-open .md-fab-action-item{align-items:center}md-fab-speed-dial md-fab-actions{display:flex;height:auto}md-fab-speed-dial md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-down{flex-direction:column}md-fab-speed-dial.md-down md-fab-trigger{order:1}md-fab-speed-dial.md-down md-fab-actions{flex-direction:column;order:2}md-fab-speed-dial.md-up{flex-direction:column}md-fab-speed-dial.md-up md-fab-trigger{order:2}md-fab-speed-dial.md-up md-fab-actions{flex-direction:column-reverse;order:1}md-fab-speed-dial.md-left{flex-direction:row}md-fab-speed-dial.md-left md-fab-trigger{order:2}md-fab-speed-dial.md-left md-fab-actions{flex-direction:row-reverse;order:1}md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-right{flex-direction:row}md-fab-speed-dial.md-right md-fab-trigger{order:1}md-fab-speed-dial.md-right md-fab-actions{flex-direction:row;order:2}md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-speed-dial.md-fling-remove .md-fab-action-item>*,md-fab-speed-dial.md-scale-remove .md-fab-action-item>*{visibility:hidden}md-fab-speed-dial.md-fling .md-fab-action-item{opacity:1}md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item{opacity:0;transition-duration:0s}md-fab-speed-dial.md-scale .md-fab-action-item{transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.1428571429s}md-fab-toolbar{display:block}md-fab-toolbar.md-fab-bottom-right{top:auto;right:20px;bottom:20px;left:auto;position:absolute}md-fab-toolbar.md-fab-bottom-left{top:auto;right:auto;bottom:20px;left:20px;position:absolute}md-fab-toolbar.md-fab-top-right{top:20px;right:20px;bottom:auto;left:auto;position:absolute}md-fab-toolbar.md-fab-top-left{top:20px;right:auto;bottom:auto;left:20px;position:absolute}md-fab-toolbar .md-fab-toolbar-wrapper{display:block;position:relative;overflow:hidden;height:68px}md-fab-toolbar md-fab-trigger{position:absolute;z-index:20}md-fab-toolbar md-fab-trigger button{overflow:visible !important}md-fab-toolbar md-fab-trigger .md-fab-toolbar-background{display:block;position:absolute;z-index:21;opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-fab-toolbar md-fab-trigger md-icon{position:relative;z-index:22;opacity:1;transition:all 200ms ease-in}md-fab-toolbar.md-left md-fab-trigger{right:0}[dir=rtl] md-fab-toolbar.md-left md-fab-trigger{right:auto;left:0}md-fab-toolbar.md-left .md-toolbar-tools{flex-direction:row-reverse}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:.6rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-right:auto;margin-left:.6rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:-0.8rem}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-0.8rem}md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:8px}[dir=rtl] md-fab-toolbar.md-left .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:8px}md-fab-toolbar.md-right md-fab-trigger{left:0}[dir=rtl] md-fab-toolbar.md-right md-fab-trigger{left:auto;right:0}md-fab-toolbar.md-right .md-toolbar-tools{flex-direction:row}md-fab-toolbar md-toolbar{background-color:transparent !important;pointer-events:none;z-index:23}md-fab-toolbar md-toolbar .md-toolbar-tools{padding:0 20px;margin-top:3px}md-fab-toolbar md-toolbar .md-fab-action-item{opacity:0;transform:scale(0);transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:.15s}md-fab-toolbar.md-is-open md-fab-trigger>button{box-shadow:none}md-fab-toolbar.md-is-open md-fab-trigger>button md-icon{opacity:0}md-fab-toolbar.md-is-open .md-fab-action-item{opacity:1;transform:scale(1)}md-grid-list{box-sizing:border-box;display:block;position:relative}md-grid-list md-grid-tile,md-grid-list md-grid-tile>figure,md-grid-list md-grid-tile-header,md-grid-list md-grid-tile-footer{box-sizing:border-box}md-grid-list md-grid-tile{display:block;position:absolute}md-grid-list md-grid-tile figure{display:flex;align-items:center;justify-content:center;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;padding:0;margin:0}md-grid-list md-grid-tile md-grid-tile-header,md-grid-list md-grid-tile md-grid-tile-footer{display:flex;flex-direction:row;align-items:center;height:48px;color:#fff;background:rgba(0,0,0,.18);overflow:hidden;position:absolute;left:0;right:0}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h3,md-grid-list md-grid-tile md-grid-tile-footer h4{font-weight:400;margin:0 0 0 16px}md-grid-list md-grid-tile md-grid-tile-header h3,md-grid-list md-grid-tile md-grid-tile-footer h3{font-size:14px}md-grid-list md-grid-tile md-grid-tile-header h4,md-grid-list md-grid-tile md-grid-tile-footer h4{font-size:12px}md-grid-list md-grid-tile md-grid-tile-header{top:0}md-grid-list md-grid-tile md-grid-tile-footer{bottom:0}@media screen and (-ms-high-contrast: active){md-grid-tile{border:1px solid #fff}md-grid-tile-footer{border-top:1px solid #fff}}md-icon{margin:auto;background-repeat:no-repeat no-repeat;display:inline-block;vertical-align:middle;fill:currentColor;height:24px;width:24px;min-height:24px;min-width:24px}md-icon svg{pointer-events:none;display:block}md-icon[md-font-icon]{line-height:24px;width:auto}md-input-container{display:inline-block;position:relative;padding:2px;margin:18px 0px;vertical-align:middle}md-input-container:after{content:"";display:table;clear:both}md-input-container.md-block{display:block}md-input-container .md-errors-spacer{float:right;min-height:24px;min-width:1px}[dir=rtl] md-input-container .md-errors-spacer{float:left}md-input-container>md-icon{position:absolute;top:8px;left:2px;right:auto}[dir=rtl] md-input-container>md-icon{left:auto}[dir=rtl] md-input-container>md-icon{right:2px}md-input-container textarea,md-input-container input[type=text],md-input-container input[type=password],md-input-container input[type=datetime],md-input-container input[type=datetime-local],md-input-container input[type=date],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week],md-input-container input[type=number],md-input-container input[type=email],md-input-container input[type=url],md-input-container input[type=search],md-input-container input[type=tel],md-input-container input[type=color]{-moz-appearance:none;-webkit-appearance:none}md-input-container input[type=date],md-input-container input[type=datetime-local],md-input-container input[type=month],md-input-container input[type=time],md-input-container input[type=week]{min-height:30px}md-input-container textarea{resize:none;overflow:hidden}md-input-container textarea.md-input{min-height:30px;-ms-flex-preferred-size:auto}md-input-container textarea[md-no-autogrow]{height:auto;overflow:auto}md-input-container label:not(.md-container-ignore){position:absolute;bottom:100%;left:0;right:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){left:auto}[dir=rtl] md-input-container label:not(.md-container-ignore){right:0}md-input-container label:not(.md-container-ignore).md-required:after{content:" *";font-size:13px;vertical-align:top}md-input-container label:not(.md-no-float):not(.md-container-ignore),md-input-container .md-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;padding-left:2px;padding-right:0;z-index:1;transform:translate3d(0, 28px, 0) scale(1);transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);max-width:100%;transform-origin:left top}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-left:0}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{padding-right:2px}[dir=rtl] md-input-container label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container .md-placeholder{transform-origin:right top}md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-input-has-value .md-placeholder{padding-left:3px;padding-right:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-left:0}[dir=rtl] md-input-container.md-input-has-value label:not(.md-no-float):not(.md-container-ignore),[dir=rtl] md-input-container.md-input-has-value .md-placeholder{padding-right:3px}md-input-container .md-placeholder{position:absolute;top:0;opacity:0;transition-property:opacity,transform;transform:translate3d(0, 30px, 0)}md-input-container.md-input-focused .md-placeholder{opacity:1;transform:translate3d(0, 24px, 0)}md-input-container.md-input-has-value .md-placeholder{transition:none;opacity:0}md-input-container:not(.md-input-has-value):not(.md-input-has-placeholder) input:not(:focus){color:transparent}md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-millisecond-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-minute-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-month-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-second-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-week-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-year-field,md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-text{color:transparent}md-input-container .md-input{order:2;display:block;margin-top:0;background:none;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-width:0 0 1px 0;line-height:26px;height:30px;-ms-flex-preferred-size:26px;border-radius:0;border-style:solid;transition:border-color .4s cubic-bezier(0.25, 0.8, 0.25, 1);width:100%;box-sizing:border-box;float:left}[dir=rtl] md-input-container .md-input{padding-left:2px}[dir=rtl] md-input-container .md-input{padding-right:0}[dir=rtl] md-input-container .md-input{float:right}md-input-container .md-input:focus{outline:none}md-input-container .md-input:invalid{outline:none;box-shadow:none}md-input-container .md-input.md-no-flex{flex:none !important}md-input-container .md-char-counter{text-align:right;padding-right:2px;padding-left:0}[dir=rtl] md-input-container .md-char-counter{text-align:left}[dir=rtl] md-input-container .md-char-counter{padding-right:0}[dir=rtl] md-input-container .md-char-counter{padding-left:2px}md-input-container .md-input-messages-animation{position:relative;order:4;overflow:hidden;clear:left}[dir=rtl] md-input-container .md-input-messages-animation{clear:right}md-input-container .md-input-message-animation,md-input-container .md-char-counter{font-size:12px;line-height:14px;overflow:hidden;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);opacity:1;margin-top:0;padding-top:8px}md-input-container .md-input-message-animation:not(.md-char-counter),md-input-container .md-char-counter:not(.md-char-counter){padding-right:5px;padding-left:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-right:0}[dir=rtl] md-input-container .md-input-message-animation:not(.md-char-counter),[dir=rtl] md-input-container .md-char-counter:not(.md-char-counter){padding-left:5px}md-input-container:not(.md-input-invalid) .md-auto-hide .md-input-message-animation{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter-prepare{opacity:0;margin-top:-100px}md-input-container .md-input-message-animation.ng-enter:not(.ng-enter-active){opacity:0;margin-top:-100px}md-input-container.md-input-focused label:not(.md-no-float),md-input-container.md-input-has-placeholder label:not(.md-no-float),md-input-container.md-input-has-value label:not(.md-no-float){transform:translate3d(0, 6px, 0) scale(0.75);transition:transform cubic-bezier(0.25, 0.8, 0.25, 1) .4s,width cubic-bezier(0.25, 0.8, 0.25, 1) .4s}md-input-container.md-input-has-value label{transition:none}md-input-container.md-input-focused .md-input,md-input-container .md-input.ng-invalid.ng-dirty,md-input-container.md-input-resized .md-input{padding-bottom:0;border-width:0 0 2px 0}md-input-container .md-input[disabled],[disabled] md-input-container .md-input{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x}md-input-container.md-icon-float{transition:margin-top .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-input-container.md-icon-float>label{pointer-events:none;position:absolute}md-input-container.md-icon-float>md-icon{top:8px;left:2px;right:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{left:auto}[dir=rtl] md-input-container.md-icon-float>md-icon{right:2px}md-input-container.md-icon-left>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left>label .md-placeholder,md-input-container.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-right>label .md-placeholder{width:calc(100% - 36px);padding:0}md-input-container.md-icon-left{padding-left:36px;padding-right:0}[dir=rtl] md-input-container.md-icon-left{padding-left:0}[dir=rtl] md-input-container.md-icon-left{padding-right:36px}md-input-container.md-icon-left>label{left:36px;right:auto}[dir=rtl] md-input-container.md-icon-left>label{left:auto}[dir=rtl] md-input-container.md-icon-left>label{right:36px}md-input-container.md-icon-right{padding-left:0;padding-right:36px}[dir=rtl] md-input-container.md-icon-right{padding-left:36px}[dir=rtl] md-input-container.md-icon-right{padding-right:0}md-input-container.md-icon-right>md-icon:last-of-type{margin:0;right:2px;left:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{right:auto}[dir=rtl] md-input-container.md-icon-right>md-icon:last-of-type{left:2px}md-input-container.md-icon-left.md-icon-right{padding-left:36px;padding-right:36px}md-input-container.md-icon-left.md-icon-right>label:not(.md-no-float):not(.md-container-ignore),md-input-container.md-icon-left.md-icon-right>label .md-placeholder{width:calc(100% - (36px * 2))}.md-resize-wrapper{position:relative}.md-resize-wrapper:after{content:"";display:table;clear:both}.md-resize-handle{position:absolute;bottom:-5px;left:0;height:10px;background:transparent;width:100%;cursor:ns-resize}@media screen and (-ms-high-contrast: active){md-input-container.md-default-theme>md-icon{fill:#fff}}md-list{display:block;padding:8px 0px 8px 0px}md-list .md-subheader{font-size:14px;font-weight:500;letter-spacing:.01em;line-height:1.2em}md-list.md-dense:not(.md-dense-disabled) md-list-item,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner{min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item::before,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner::before{content:"";min-height:40px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner md-icon:first-child{width:20px;height:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:36px;margin-top:4px;margin-bottom:4px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:20px;margin-top:6px;margin-bottom:6px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar-icon,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:20px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-avatar{flex:none;width:36px;height:36px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container .md-secondary.md-button,md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container .md-secondary.md-button{margin-top:4px;margin-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item .md-secondary-container md-checkbox:not(.md-dense-disabled),md-list.md-dense:not(.md-dense-disabled) md-list-item .md-list-item-inner .md-secondary-container md-checkbox:not(.md-dense-disabled){min-height:40px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text p,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h4,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text p{line-height:1.05;font-size:12px;padding-bottom:4px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line .md-list-item-text h3,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:13px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style{min-height:60px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style::before{content:"";min-height:60px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line .md-avatar-icon,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style{min-height:76px}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line::before,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style::before{content:"";min-height:76px;visibility:hidden;display:inline-block}md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-avatar,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list.md-dense:not(.md-dense-disabled) md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}md-list.md-dense:not(.md-dense-disabled) .md-subheader-inner{padding-top:12px;padding-bottom:12px}md-list-item{position:relative}md-list-item.md-proxy-focus.md-focused .md-no-style{transition:background-color .15s linear}md-list-item._md-button-wrap{position:relative}md-list-item._md-button-wrap>div.md-button:first-child{display:flex;align-items:center;justify-content:flex-start;padding:0px 16px;margin:0;font-weight:400;text-align:left;border:medium none}[dir=rtl] md-list-item._md-button-wrap>div.md-button:first-child{text-align:right}md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child{position:absolute;top:0;left:0;height:100%;margin:0;padding:0}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner{width:100%}md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner::before{content:"";min-height:inherit;visibility:hidden;display:inline-block}md-list-item.md-no-proxy,md-list-item .md-no-style{position:relative;padding:0px 16px;flex:1 1 auto}md-list-item.md-no-proxy.md-button,md-list-item .md-no-style.md-button{font-size:inherit;height:inherit;text-align:left;text-transform:none;width:100%;white-space:normal;flex-direction:inherit;align-items:inherit;border-radius:0;margin:0}[dir=rtl] md-list-item.md-no-proxy.md-button,[dir=rtl] md-list-item .md-no-style.md-button{text-align:right}md-list-item.md-no-proxy.md-button>.md-ripple-container,md-list-item .md-no-style.md-button>.md-ripple-container{border-radius:0}md-list-item.md-no-proxy:focus,md-list-item .md-no-style:focus{outline:none}md-list-item.md-clickable:hover{cursor:pointer}md-list-item md-divider{position:absolute;bottom:0;left:0;width:100%}[dir=rtl] md-list-item md-divider{left:auto;right:0}md-list-item md-divider[md-inset]{left:72px;width:calc(100% - 72px);margin:0 !important}[dir=rtl] md-list-item md-divider[md-inset]{left:auto;right:72px}md-list-item,md-list-item .md-list-item-inner{display:flex;justify-content:flex-start;align-items:center;min-height:48px;height:auto}md-list-item::before,md-list-item .md-list-item-inner::before{content:"";min-height:48px;visibility:hidden;display:inline-block}md-list-item>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item>md-icon.md-secondary:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-primary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>div.md-secondary>md-icon:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon.md-secondary:not(.md-avatar-icon){width:24px;margin-top:16px;margin-bottom:12px;box-sizing:content-box}md-list-item>div.md-primary>md-checkbox,md-list-item>div.md-secondary>md-checkbox,md-list-item>md-checkbox,md-list-item md-checkbox.md-secondary,md-list-item .md-list-item-inner>div.md-primary>md-checkbox,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox,md-list-item .md-list-item-inner>md-checkbox,md-list-item .md-list-item-inner md-checkbox.md-secondary{align-self:center}md-list-item>div.md-primary>md-checkbox .md-label,md-list-item>div.md-secondary>md-checkbox .md-label,md-list-item>md-checkbox .md-label,md-list-item md-checkbox.md-secondary .md-label,md-list-item .md-list-item-inner>div.md-primary>md-checkbox .md-label,md-list-item .md-list-item-inner>div.md-secondary>md-checkbox .md-label,md-list-item .md-list-item-inner>md-checkbox .md-label,md-list-item .md-list-item-inner md-checkbox.md-secondary .md-label{display:none}md-list-item>md-icon:first-child:not(.md-avatar-icon),md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:32px}[dir=rtl] md-list-item>md-icon:first-child:not(.md-avatar-icon),[dir=rtl] md-list-item .md-list-item-inner>md-icon:first-child:not(.md-avatar-icon){margin-right:auto;margin-left:32px}md-list-item .md-avatar,md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar,md-list-item .md-list-item-inner .md-avatar-icon{margin-top:8px;margin-bottom:8px;margin-right:16px;border-radius:50%;box-sizing:content-box}[dir=rtl] md-list-item .md-avatar,[dir=rtl] md-list-item .md-avatar-icon,[dir=rtl] md-list-item .md-list-item-inner .md-avatar,[dir=rtl] md-list-item .md-list-item-inner .md-avatar-icon{margin-right:auto;margin-left:16px}md-list-item .md-avatar,md-list-item .md-list-item-inner .md-avatar{flex:none;width:40px;height:40px}md-list-item .md-avatar-icon,md-list-item .md-list-item-inner .md-avatar-icon{padding:8px}md-list-item .md-avatar-icon svg,md-list-item .md-list-item-inner .md-avatar-icon svg{width:24px;height:24px}md-list-item>md-checkbox,md-list-item .md-list-item-inner>md-checkbox{width:24px;min-height:40px;margin-left:0px;margin-right:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-left:29px}[dir=rtl] md-list-item>md-checkbox,[dir=rtl] md-list-item .md-list-item-inner>md-checkbox{margin-right:0px}md-list-item .md-secondary-container,md-list-item .md-list-item-inner .md-secondary-container{display:flex;align-items:center;position:relative;flex-shrink:0;margin:auto;margin-right:0;margin-left:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-right:auto}[dir=rtl] md-list-item .md-secondary-container,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container{margin-left:0}md-list-item .md-secondary-container .md-button:last-of-type,md-list-item .md-secondary-container .md-icon-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:0}[dir=rtl] md-list-item .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-secondary-container .md-icon-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-button:last-of-type,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container .md-icon-button:last-of-type{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-checkbox,md-list-item .md-list-item-inner .md-secondary-container md-checkbox{margin:0 6px;padding:0 8px;min-height:40px}md-list-item .md-secondary-container md-checkbox:last-child,md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{width:40px;margin-right:0}[dir=rtl] md-list-item .md-secondary-container md-checkbox:last-child,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-checkbox:last-child{margin-right:auto;margin-left:0}md-list-item .md-secondary-container md-switch,md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-top:0;margin-bottom:0;margin-right:-6px}[dir=rtl] md-list-item .md-secondary-container md-switch,[dir=rtl] md-list-item .md-list-item-inner .md-secondary-container md-switch{margin-right:auto;margin-left:-6px}md-list-item>p,md-list-item>.md-list-item-inner>p,md-list-item .md-list-item-inner>p,md-list-item .md-list-item-inner>.md-list-item-inner>p{flex:1 1 auto;margin:0}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style,md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{align-items:flex-start;justify-content:center}md-list-item.md-2-line.md-long-text,md-list-item.md-2-line>.md-no-style.md-long-text,md-list-item.md-3-line.md-long-text,md-list-item.md-3-line>.md-no-style.md-long-text{margin-top:8px;margin-bottom:8px}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text,md-list-item.md-3-line .md-list-item-text,md-list-item.md-3-line>.md-no-style .md-list-item-text{flex:1 1 auto;margin:auto;text-overflow:ellipsis;overflow:hidden}md-list-item.md-2-line .md-list-item-text.md-offset,md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,md-list-item.md-3-line .md-list-item-text.md-offset,md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:56px}[dir=rtl] md-list-item.md-2-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-2-line>.md-no-style .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line .md-list-item-text.md-offset,[dir=rtl] md-list-item.md-3-line>.md-no-style .md-list-item-text.md-offset{margin-left:auto;margin-right:56px}md-list-item.md-2-line .md-list-item-text h3,md-list-item.md-2-line>.md-no-style .md-list-item-text h3,md-list-item.md-3-line .md-list-item-text h3,md-list-item.md-3-line>.md-no-style .md-list-item-text h3{font-size:16px;font-weight:400;letter-spacing:.01em;margin:0 0 0 0;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text h4,md-list-item.md-2-line>.md-no-style .md-list-item-text h4,md-list-item.md-3-line .md-list-item-text h4,md-list-item.md-3-line>.md-no-style .md-list-item-text h4{font-size:14px;letter-spacing:.01em;margin:3px 0 1px 0;font-weight:400;line-height:1.2em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}md-list-item.md-2-line .md-list-item-text p,md-list-item.md-2-line>.md-no-style .md-list-item-text p,md-list-item.md-3-line .md-list-item-text p,md-list-item.md-3-line>.md-no-style .md-list-item-text p{font-size:14px;font-weight:500;letter-spacing:.01em;margin:0 0 0 0;line-height:1.6em}md-list-item.md-2-line,md-list-item.md-2-line>.md-no-style{height:auto;min-height:72px}md-list-item.md-2-line::before,md-list-item.md-2-line>.md-no-style::before{content:"";min-height:72px;visibility:hidden;display:inline-block}md-list-item.md-2-line>.md-avatar,md-list-item.md-2-line .md-avatar-icon,md-list-item.md-2-line>.md-no-style>.md-avatar,md-list-item.md-2-line>.md-no-style .md-avatar-icon{margin-top:12px}md-list-item.md-2-line>md-icon:first-child,md-list-item.md-2-line>.md-no-style>md-icon:first-child{align-self:flex-start}md-list-item.md-2-line .md-list-item-text,md-list-item.md-2-line>.md-no-style .md-list-item-text{flex:1 1 auto}md-list-item.md-3-line,md-list-item.md-3-line>.md-no-style{height:auto;min-height:88px}md-list-item.md-3-line::before,md-list-item.md-3-line>.md-no-style::before{content:"";min-height:88px;visibility:hidden;display:inline-block}md-list-item.md-3-line>md-icon:first-child,md-list-item.md-3-line>.md-avatar,md-list-item.md-3-line>.md-no-style>md-icon:first-child,md-list-item.md-3-line>.md-no-style>.md-avatar{margin-top:16px}.md-open-menu-container{position:fixed;left:0;top:0;z-index:100;opacity:0;border-radius:2px;max-height:calc(100vh - 10px);overflow:auto}.md-open-menu-container md-menu-divider{margin-top:4px;margin-bottom:4px;height:1px;min-height:1px;max-height:1px;width:100%}.md-open-menu-container md-menu-content>*{opacity:0}.md-open-menu-container:not(.md-clickable){pointer-events:none}.md-open-menu-container.md-active{opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:200ms}.md-open-menu-container.md-active>md-menu-content>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:200ms;transition-delay:100ms}.md-open-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}md-menu-content{display:flex;flex-direction:column;padding:8px 0;max-height:304px;overflow-y:auto}md-menu-content.md-dense{max-height:208px}md-menu-content.md-dense md-menu-item{height:32px;min-height:32px}md-menu-item{display:flex;flex-direction:row;min-height:48px;height:48px;align-content:center;justify-content:flex-start}md-menu-item>*{width:100%;margin:auto 0;padding-left:16px;padding-right:16px}md-menu-item>a.md-button{padding-top:5px}md-menu-item>.md-button{text-align:left;display:inline-block;border-radius:0;margin:auto 0;font-size:15px;text-transform:none;font-weight:400;height:100%;padding-left:16px;padding-right:16px;width:100%}md-menu-item>.md-button::-moz-focus-inner{padding:0;border:0}[dir=rtl] md-menu-item>.md-button{text-align:right}md-menu-item>.md-button md-icon{margin:auto 16px auto 0}[dir=rtl] md-menu-item>.md-button md-icon{margin:auto 0 auto 16px}md-menu-item>.md-button p{display:inline-block;margin:auto}md-menu-item>.md-button span{margin-top:auto;margin-bottom:auto}md-menu-item>.md-button .md-ripple-container{border-radius:inherit}md-toolbar .md-menu{height:auto;margin:auto;padding:0}@media(max-width: 959px){md-menu-content{min-width:112px}md-menu-content[width="3"]{min-width:168px}md-menu-content[width="4"]{min-width:224px}md-menu-content[width="5"]{min-width:280px}md-menu-content[width="6"]{min-width:336px}md-menu-content[width="7"]{min-width:392px}}@media(min-width: 960px){md-menu-content{min-width:96px}md-menu-content[width="3"]{min-width:192px}md-menu-content[width="4"]{min-width:256px}md-menu-content[width="5"]{min-width:320px}md-menu-content[width="6"]{min-width:384px}md-menu-content[width="7"]{min-width:448px}}md-toolbar.md-menu-toolbar h2.md-toolbar-tools{line-height:1rem;height:auto;padding:28px;padding-bottom:12px}md-toolbar.md-has-open-menu{position:relative;z-index:100}md-menu-bar{padding:0 20px;display:block;position:relative;z-index:2}md-menu-bar .md-menu{display:inline-block;padding:0;position:relative}md-menu-bar button{font-size:14px;padding:0 10px;margin:0;border:0;background-color:transparent;height:40px}md-menu-bar md-backdrop.md-menu-backdrop{z-index:-2}md-menu-content.md-menu-bar-menu.md-dense{max-height:none;padding:16px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent{position:relative}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{position:absolute;padding:0;width:24px;top:6px;left:24px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>md-icon{left:auto;right:24px}md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 32px 0 64px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item.md-indent .md-menu>.md-button{padding:0 64px 0 32px}md-menu-content.md-menu-bar-menu.md-dense .md-button{min-height:0;height:32px}md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span{float:right}md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:right;margin:0 8px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-button span.md-alt-text{float:left}md-menu-content.md-menu-bar-menu.md-dense md-menu-divider{margin:8px 0}md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:left}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense md-menu-item>.md-button,[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{text-align:right}md-menu-content.md-menu-bar-menu.md-dense .md-menu{padding:0}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{position:relative;margin:0;width:100%;text-transform:none;font-weight:normal;border-radius:0px;padding-left:16px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button{padding-left:0;padding-right:16px}md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{display:block;content:"▼";position:absolute;top:0px;speak:none;transform:rotate(270deg) scaleY(0.45) scaleX(0.9);right:28px}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{transform:rotate(90deg) scaleY(0.45) scaleX(0.9)}[dir=rtl] md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after{right:auto;left:28px}.md-nav-bar{border-style:solid;border-width:0 0 1px;height:48px;position:relative}._md-nav-bar-list{outline:none;list-style:none;margin:0;padding:0;box-sizing:border-box;display:flex;flex-direction:row}.md-nav-item:first-of-type{margin-left:8px}.md-button._md-nav-button{line-height:24px;margin:0 4px;padding:12px 16px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1)}.md-button._md-nav-button:focus{outline:none}md-nav-ink-bar{background-color:#000;position:absolute;bottom:0;left:0;width:100%;height:2px;transform-origin:left top;will-change:transform;transition:transform .125s cubic-bezier(0.35, 0, 0.25, 1)}md-nav-ink-bar.ng-animate{transition:none}md-nav-extra-content{min-height:48px;padding-right:12px}@keyframes indeterminate-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}md-progress-circular{position:relative;display:block;transform:scale(1, 1)}[dir=rtl] md-progress-circular{transform:scale(-1, 1)}md-progress-circular._md-progress-circular-disabled{visibility:hidden}md-progress-circular.md-mode-indeterminate svg{animation:indeterminate-rotate 1568.63ms linear infinite}md-progress-circular svg{position:absolute;overflow:visible;top:0;left:0}md-progress-linear{display:block;position:relative;width:100%;height:5px;padding-top:0 !important;margin-bottom:0 !important;transform:scale(1, 1)}[dir=rtl] md-progress-linear{transform:scale(-1, 1)}md-progress-linear._md-progress-linear-disabled{visibility:hidden}md-progress-linear .md-container{display:block;position:relative;overflow:hidden;width:100%;height:5px;transform:translate(0, 0) scale(1, 1)}md-progress-linear .md-container .md-bar{position:absolute;left:0;top:0;bottom:0;width:100%;height:5px}md-progress-linear .md-container .md-dashed:before{content:"";display:none;position:absolute;margin-top:0;height:5px;width:100%;background-color:transparent;background-size:10px 10px !important;background-position:0px -23px}md-progress-linear .md-container .md-bar1,md-progress-linear .md-container .md-bar2{transition:transform .2s linear}md-progress-linear .md-container.md-mode-query .md-bar1{display:none}md-progress-linear .md-container.md-mode-query .md-bar2{transition:all .2s linear;animation:query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1)}md-progress-linear .md-container.md-mode-determinate .md-bar1{display:none}md-progress-linear .md-container.md-mode-indeterminate .md-bar1{animation:md-progress-linear-indeterminate-scale-1 4s infinite,md-progress-linear-indeterminate-1 4s infinite}md-progress-linear .md-container.md-mode-indeterminate .md-bar2{animation:md-progress-linear-indeterminate-scale-2 4s infinite,md-progress-linear-indeterminate-2 4s infinite}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container{animation:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar1{animation-name:none}md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progress-linear .md-container .md-bar2{animation-name:none}md-progress-linear .md-container.md-mode-buffer{background-color:transparent !important;transition:all .2s linear}md-progress-linear .md-container.md-mode-buffer .md-dashed:before{display:block;animation:buffer 3s infinite linear}@keyframes query{0%{opacity:1;transform:translateX(35%) scale(0.3, 1)}100%{opacity:0;transform:translateX(-50%) scale(0, 1)}}@keyframes buffer{0%{opacity:1;background-position:0px -23px}50%{opacity:0}100%{opacity:1;background-position:-200px -23px}}@keyframes md-progress-linear-indeterminate-scale-1{0%{transform:scaleX(0.1);animation-timing-function:linear}36.6%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.334731432, 0.124819821, 0.785843996, 1)}69.15%{transform:scaleX(0.83);animation-timing-function:cubic-bezier(0.225732004, 0, 0.233648906, 1.3709798)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-1{0%{left:-105.1666666667%;animation-timing-function:linear}20%{left:-105.1666666667%;animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495818703)}69.15%{left:21.5%;animation-timing-function:cubic-bezier(0.302435, 0.38135197, 0.55, 0.956352125)}100%{left:95.4444444444%}}@keyframes md-progress-linear-indeterminate-scale-2{0%{transform:scaleX(0.1);animation-timing-function:cubic-bezier(0.205028172, 0.057050836, 0.57660995, 0.453970841)}19.15%{transform:scaleX(0.57);animation-timing-function:cubic-bezier(0.152312994, 0.196431957, 0.648373778, 1.00431535)}44.15%{transform:scaleX(0.91);animation-timing-function:cubic-bezier(0.25775882, -0.003163357, 0.211761916, 1.38178961)}100%{transform:scaleX(0.1)}}@keyframes md-progress-linear-indeterminate-2{0%{left:-54.8888888889%;animation-timing-function:cubic-bezier(0.15, 0, 0.5150584, 0.409684966)}25%{left:-17.25%;animation-timing-function:cubic-bezier(0.3103299, 0.284057684, 0.8, 0.733718979)}48.35%{left:29.5%;animation-timing-function:cubic-bezier(0.4, 0.627034903, 0.6, 0.902025796)}100%{left:117.3888888889%}}md-radio-button{box-sizing:border-box;display:block;margin-bottom:16px;white-space:nowrap;cursor:pointer;position:relative}md-radio-button[disabled]{cursor:default}md-radio-button[disabled] .md-container{cursor:default}md-radio-button .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:20px;height:20px;cursor:pointer;left:0;right:auto}[dir=rtl] md-radio-button .md-container{left:auto}[dir=rtl] md-radio-button .md-container{right:0}md-radio-button .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-radio-button .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-radio-button.md-align-top-left>div.md-container{top:12px}md-radio-button .md-off{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-style:solid;border-width:2px;border-radius:50%;transition:border-color ease .28s}md-radio-button .md-on{box-sizing:border-box;position:absolute;top:0;left:0;width:20px;height:20px;border-radius:50%;transition:transform ease .28s;transform:scale(0)}md-radio-button.md-checked .md-on{transform:scale(0.5)}md-radio-button .md-label{box-sizing:border-box;position:relative;display:inline-block;margin-left:30px;margin-right:0;vertical-align:middle;white-space:normal;pointer-events:none;width:auto}[dir=rtl] md-radio-button .md-label{margin-left:0}[dir=rtl] md-radio-button .md-label{margin-right:30px}md-radio-group:focus{outline:none}md-radio-group.md-focused.ng-not-empty .md-checked .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group.md-focused.ng-empty>md-radio-button:first-child .md-container:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-radio-group[disabled] md-radio-button{cursor:default}md-radio-group[disabled] md-radio-button .md-container{cursor:default}@media(max-width: 599px){.layout-row:not(.layout-xs-column)>md-radio-button,.layout-xs-row>md-radio-button{margin-bottom:0}}@media(min-width: 600px)and (max-width: 959px){.layout-row:not(.layout-gt-xs-column):not(.layout-sm-column)>md-radio-button,.layout-gt-xs-row:not(.layout-sm-column)>md-radio-button,.layout-sm-row:not(.layout-sm-column)>md-radio-button{margin-bottom:0}}@media(min-width: 960px)and (max-width: 1279px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-md-column)>md-radio-button,.layout-gt-sm-row:not(.layout-md-column)>md-radio-button,.layout-md-row:not(.layout-md-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1280px)and (max-width: 1919px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-lg-column)>md-radio-button,.layout-gt-md-row:not(.layout-lg-column)>md-radio-button,.layout-lg-row:not(.layout-lg-column)>md-radio-button{margin-bottom:0}}@media(min-width: 1920px){.layout-row:not(.layout-gt-xs-column):not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-xs-row:not(.layout-gt-sm-column):not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-sm-row:not(.layout-gt-md-column):not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-md-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-gt-lg-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button,.layout-xl-row:not(.layout-gt-lg-column):not(.layout-xl-column)>md-radio-button{margin-bottom:0}}.md-inline-form md-radio-group{margin:18px 0 19px}.md-inline-form md-radio-group md-radio-button{display:inline-block;height:30px;padding:2px 10px 2px 6px;box-sizing:border-box;margin-top:0;margin-bottom:0}.md-inline-form md-radio-group md-radio-button .md-label{top:4px}.md-inline-form md-radio-group md-radio-button .md-container{margin-top:2px}@media screen and (-ms-high-contrast: active){md-radio-button.md-default-theme .md-on{background-color:#fff}}md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transition:transform .4s cubic-bezier(0.25, 0.8, 0.25, 1);transform-origin:left top}[dir=rtl] md-input-container:not([md-no-float]) .md-select-placeholder span:first-child{transform-origin:right top}md-input-container.md-input-focused:not([md-no-float]) md-select:not([placeholder]) .md-select-placeholder span:first-child{transform:translate(-2px, -22px) scale(0.75)}.md-select-menu-container{position:fixed;left:0;top:0;z-index:90;opacity:0;display:none;transform:translateY(-1px)}.md-select-menu-container:not(.md-clickable){pointer-events:none}.md-select-menu-container md-progress-circular{display:table;margin:24px auto !important}.md-select-menu-container.md-active{display:block;opacity:1}.md-select-menu-container.md-active md-select-menu{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms}.md-select-menu-container.md-active md-select-menu>*{opacity:1;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transition-delay:100ms}.md-select-menu-container.md-leave{opacity:0;transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:250ms}.md-inline-form md-select{margin-top:20px}md-input-container>md-select,.md-inline-form md-input-container>md-select{margin-top:0px}md-input-container>md-select{order:2}md-input-container:not(.md-input-has-value) md-select[required]:not(.md-no-asterisk) .md-select-value span:first-child:after,md-input-container:not(.md-input-has-value) md-select.ng-required:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-input-container.md-input-invalid md-select .md-select-value{border-bottom-style:solid;padding-bottom:1px}md-select{display:flex}md-select[required].ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,md-select.ng-required.ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after{content:" *";font-size:13px;vertical-align:top}md-select[disabled] .md-select-value{background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;padding-bottom:2px;padding-top:1px;transform:translateY(1px)}md-select:focus{outline:none}md-select[disabled]:hover{cursor:default}md-select:not([disabled]):hover{cursor:pointer}md-select:not([disabled]):focus .md-select-value{border-bottom-style:solid;border-bottom-width:2px;padding-bottom:0px}md-input-container md-select:not([disabled]):focus .md-select-value{border-bottom-width:2px}md-input-container md-select[disabled] .md-select-value{background-position:bottom -1px left 0}md-input-container md-select .md-select-value{min-height:26px;border-bottom-width:1px;padding-bottom:1px}md-input-container md-select .md-select-value.md-select-placeholder{padding-left:0;padding-right:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-left:2px}[dir=rtl] md-input-container md-select .md-select-value.md-select-placeholder{padding-right:0}.md-select-value{display:flex;align-items:center;padding-top:2px;padding-bottom:1px;padding-left:0;padding-right:2px;border-bottom-width:1px;border-bottom-style:solid;background-color:rgba(0,0,0,0);position:relative;box-sizing:content-box;min-width:88px;min-height:26px;margin-bottom:auto;-ms-flex-item-align:start;flex-grow:1}[dir=rtl] .md-select-value{padding-left:2px}[dir=rtl] .md-select-value{padding-right:0}.md-select-value>span:not(.md-select-icon){max-width:100%;flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-select-value>span:not(.md-select-icon) .md-text{display:inline}.md-select-value .md-select-icon{display:block;align-items:flex-end;text-align:right;width:24px;transform:translateY(-2px);font-size:1.2rem}[dir=rtl] .md-select-value .md-select-icon{align-items:flex-start}[dir=rtl] .md-select-value .md-select-icon{text-align:left}.md-select-value .md-select-icon:after{display:block;content:"▼";position:relative;top:2px;right:-4px;left:auto;speak:none;font-size:13px;transform:scaleY(0.5)}[dir=rtl] .md-select-value .md-select-icon:after{right:auto}[dir=rtl] .md-select-value .md-select-icon:after{left:-4px}.md-select-value.md-select-placeholder{display:flex;order:1;pointer-events:none;-webkit-font-smoothing:antialiased;z-index:1}md-select-menu{display:flex;flex-direction:column;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:hidden;transform-origin:left top;transform:scale(1)}md-select-menu.md-reverse{flex-direction:column-reverse}md-select-menu:not(.md-overflow) md-content{padding-top:8px;padding-bottom:8px}[dir=rtl] md-select-menu{transform-origin:right top}md-select-menu md-content{min-width:136px;min-height:48px;max-height:256px;overflow-y:auto}md-select-menu>*{opacity:0}md-option{cursor:pointer;position:relative;display:flex;align-items:center;width:auto;transition:background .15s linear;padding:0 16px 0 16px;height:48px}md-option[disabled]{cursor:default}md-option:focus{outline:none}md-option .md-text{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}md-optgroup{display:block}md-optgroup label{display:block;font-size:14px;text-transform:uppercase;padding:16px;font-weight:500}md-optgroup md-option{padding-left:32px;padding-right:32px}@media screen and (-ms-high-contrast: active){.md-select-backdrop{background-color:transparent}md-select-menu{border:1px solid #fff}}md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:40px;padding-right:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-left:16px}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled{padding-right:40px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{position:absolute;top:50%;transform:translateY(-50%);box-sizing:border-box;display:inline-block;width:18px;height:18px;left:0;right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{right:0}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before{box-sizing:border-box;background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:after{box-sizing:border-box;content:"";position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-15px;top:-15px;right:-15px;bottom:-15px}md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon{box-sizing:border-box;transition:240ms;position:absolute;top:0;left:0;width:18px;height:18px;border-width:2px;border-style:solid;border-radius:2px}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon{border-color:transparent}md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after{box-sizing:border-box;transform:rotate(45deg);position:absolute;left:4px;top:0px;display:table;width:6px;height:12px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled[disabled]{cursor:default}md-select-menu[multiple] md-option.md-checkbox-enabled.md-indeterminate .md-icon:after{box-sizing:border-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:table;width:10.8px;height:2px;border-width:2px;border-style:solid;border-top:0;border-left:0;content:""}md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:10.6666666667px;margin-right:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-left:auto}[dir=rtl] md-select-menu[multiple] md-option.md-checkbox-enabled .md-container{margin-right:10.6666666667px}md-sidenav{box-sizing:border-box;position:absolute;flex-direction:column;z-index:60;width:320px;max-width:320px;bottom:0;overflow:auto;-webkit-overflow-scrolling:touch}md-sidenav ul{list-style:none}md-sidenav.md-closed{display:none}md-sidenav.md-closed-add,md-sidenav.md-closed-remove{display:flex;transition:.2s ease-in all}md-sidenav.md-closed-add.md-closed-add-active,md-sidenav.md-closed-remove.md-closed-remove-active{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-sidenav.md-locked-open-add,md-sidenav.md-locked-open-remove{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open,md-sidenav.md-locked-open.md-closed,md-sidenav.md-locked-open.md-closed.md-sidenav-left,md-sidenav.md-locked-open.md-closed.md-sidenav-right{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-locked-open-remove.md-closed{position:static;display:flex;transform:translate3d(0, 0, 0)}md-sidenav.md-closed.md-locked-open-add{position:static;display:flex;transform:translate3d(0%, 0, 0)}md-sidenav.md-closed.md-locked-open-add:not(.md-locked-open-add-active){transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}md-sidenav.md-closed.md-locked-open-add-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-sidenav.md-locked-open-remove-active{transition:width .3s cubic-bezier(0.55, 0, 0.55, 0.2),min-width .3s cubic-bezier(0.55, 0, 0.55, 0.2);width:0 !important;min-width:0 !important}.md-sidenav-backdrop.md-locked-open{display:none}.md-sidenav-left,md-sidenav{left:0;top:0;transform:translate3d(0%, 0, 0)}.md-sidenav-left.md-closed,md-sidenav.md-closed{transform:translate3d(-100%, 0, 0)}.md-sidenav-right{left:100%;top:0;transform:translate(-100%, 0)}.md-sidenav-right.md-closed{transform:translate(0%, 0)}@media(min-width: 600px){md-sidenav{max-width:400px}}@media(max-width: 456px){md-sidenav{width:calc(100% - 56px);min-width:calc(100% - 56px);max-width:calc(100% - 56px)}}@media screen and (-ms-high-contrast: active){.md-sidenav-left,md-sidenav{border-right:1px solid #fff}.md-sidenav-right{border-left:1px solid #fff}}@keyframes sliderFocusThumb{0%{transform:scale(0.7)}30%{transform:scale(1)}100%{transform:scale(0.7)}}@keyframes sliderDiscreteFocusThumb{0%{transform:scale(0.7)}50%{transform:scale(0.8)}100%{transform:scale(0)}}@keyframes sliderDiscreteFocusRing{0%{transform:scale(0.7);opacity:0}50%{transform:scale(1);opacity:1}100%{transform:scale(0)}}md-slider{height:48px;min-width:128px;position:relative;margin-left:4px;margin-right:4px;padding:0;display:block;flex-direction:row}md-slider *,md-slider *:after{box-sizing:border-box}md-slider .md-slider-wrapper{outline:none;width:100%;height:100%}md-slider .md-slider-content{position:relative}md-slider .md-track-container{width:100%;position:absolute;top:23px;height:2px}md-slider .md-track{position:absolute;left:0;right:0;height:100%}md-slider .md-track-fill{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:width,height}md-slider .md-track-ticks{position:absolute;left:0;right:0;height:100%}md-slider .md-track-ticks canvas{width:100%;height:100%}md-slider .md-thumb-container{position:absolute;left:0;top:50%;transform:translate3d(-50%, -50%, 0);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:left,right,bottom}[dir=rtl] md-slider .md-thumb-container{left:auto;right:0}md-slider .md-thumb{z-index:1;position:absolute;left:-10px;top:14px;width:20px;height:20px;border-radius:20px;transform:scale(0.7);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}[dir=rtl] md-slider .md-thumb{left:auto;right:-10px}md-slider .md-thumb:after{content:"";position:absolute;width:20px;height:20px;border-radius:20px;border-width:3px;border-style:solid;transition:inherit}md-slider .md-sign{display:flex;align-items:center;justify-content:center;position:absolute;left:-14px;top:-17px;width:28px;height:28px;border-radius:28px;transform:scale(0.4) translate3d(0, 67.5px, 0);transition:all .3s cubic-bezier(0.35, 0, 0.25, 1)}md-slider .md-sign:after{position:absolute;content:"";left:0px;border-radius:16px;top:19px;border-left:14px solid transparent;border-right:14px solid transparent;border-top-width:16px;border-top-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-sign:after{left:auto;right:0px}md-slider .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider .md-focus-ring{position:absolute;left:-17px;top:7px;width:34px;height:34px;border-radius:34px;transform:scale(0.7);opacity:0;transition:all .35s cubic-bezier(0.35, 0, 0.25, 1)}[dir=rtl] md-slider .md-focus-ring{left:auto;right:-17px}md-slider .md-disabled-thumb{position:absolute;left:-14px;top:10px;width:28px;height:28px;border-radius:28px;transform:scale(0.5);border-width:4px;border-style:solid;display:none}[dir=rtl] md-slider .md-disabled-thumb{left:auto;right:-14px}md-slider.md-min .md-sign{opacity:0}md-slider:focus{outline:none}md-slider.md-dragging .md-thumb-container,md-slider.md-dragging .md-track-fill{transition:none}md-slider:not([md-discrete]) .md-track-ticks,md-slider:not([md-discrete]) .md-sign{display:none}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper .md-thumb:hover{transform:scale(0.8)}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(1);opacity:1}md-slider:not([md-discrete]):not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderFocusThumb .7s cubic-bezier(0.35, 0, 0.25, 1)}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb{transform:scale(1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-focus-ring{transform:scale(0);animation:sliderDiscreteFocusRing .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb{animation:sliderDiscreteFocusThumb .5s cubic-bezier(0.35, 0, 0.25, 1)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-thumb,md-slider[md-discrete]:not([disabled]).md-active .md-thumb{transform:scale(0)}md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign,md-slider[md-discrete]:not([disabled]) .md-slider-wrapper.md-focused .md-sign:after,md-slider[md-discrete]:not([disabled]).md-active .md-sign,md-slider[md-discrete]:not([disabled]).md-active .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-discrete][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-discrete][disabled][readonly] .md-sign,md-slider[md-discrete][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[disabled] .md-track-fill{display:none}md-slider[disabled] .md-track-ticks{opacity:0}md-slider[disabled]:not([readonly]) .md-sign{opacity:0}md-slider[disabled] .md-thumb{transform:scale(0.5)}md-slider[disabled] .md-disabled-thumb{display:block}md-slider[md-vertical]{flex-direction:column;min-height:128px;min-width:0}md-slider[md-vertical] .md-slider-wrapper{flex:1;padding-top:12px;padding-bottom:12px;width:48px;align-self:center;display:flex;justify-content:center}md-slider[md-vertical] .md-track-container{height:100%;width:2px;top:0;left:calc(50% - (2px / 2))}md-slider[md-vertical] .md-thumb-container{top:auto;margin-bottom:23px;left:calc(50% - 1px);bottom:0}md-slider[md-vertical] .md-thumb-container .md-thumb:after{left:1px}md-slider[md-vertical] .md-thumb-container .md-focus-ring{left:-16px}md-slider[md-vertical] .md-track-fill{bottom:0}md-slider[md-vertical][md-discrete] .md-sign{left:-40px;top:9.5px;transform:scale(0.4) translate3d(67.5px, 0, 0)}md-slider[md-vertical][md-discrete] .md-sign:after{top:9.5px;left:19px;border-top:14px solid transparent;border-right:0;border-bottom:14px solid transparent;border-left-width:16px;border-left-style:solid;opacity:0;transform:translate3d(0, -8px, 0);transition:all .2s ease-in-out}md-slider[md-vertical][md-discrete] .md-sign .md-thumb-text{z-index:1;font-size:12px;font-weight:bold}md-slider[md-vertical][md-discrete].md-active .md-sign:after,md-slider[md-vertical][md-discrete] .md-focused .md-sign:after,md-slider[md-vertical][md-discrete][disabled][readonly] .md-sign:after{top:0}md-slider[md-vertical][disabled][readonly] .md-thumb{transform:scale(0)}md-slider[md-vertical][disabled][readonly] .md-sign,md-slider[md-vertical][disabled][readonly] .md-sign:after{opacity:1;transform:translate3d(0, 0, 0) scale(1)}md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:auto;right:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{left:0}[dir=rtl] md-slider[md-invert]:not([md-vertical]) .md-track-fill{right:auto}md-slider[md-invert][md-vertical] .md-track-fill{bottom:auto;top:0}md-slider-container{display:flex;align-items:center;flex-direction:row}md-slider-container>*:first-child:not(md-slider),md-slider-container>*:last-child:not(md-slider){min-width:25px;max-width:42px;height:25px;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:color,max-width}md-slider-container>*:first-child:not(md-slider){margin-right:16px}[dir=rtl] md-slider-container>*:first-child:not(md-slider){margin-right:auto;margin-left:16px}md-slider-container>*:last-child:not(md-slider){margin-left:16px}[dir=rtl] md-slider-container>*:last-child:not(md-slider){margin-left:auto;margin-right:16px}md-slider-container[md-vertical]{flex-direction:column}md-slider-container[md-vertical]>*:first-child:not(md-slider),md-slider-container[md-vertical]>*:last-child:not(md-slider){margin-right:0;margin-left:0;text-align:center}md-slider-container md-input-container input[type=number]{text-align:center;padding-left:15px;height:50px;margin-top:-25px}[dir=rtl] md-slider-container md-input-container input[type=number]{padding-left:0;padding-right:15px}@media screen and (-ms-high-contrast: active){md-slider.md-default-theme .md-track{border-bottom:1px solid #fff}}.md-sticky-clone{z-index:2;top:0;left:0;right:0;position:absolute !important;transform:translate3d(-9999px, -9999px, 0)}.md-sticky-clone[sticky-state=active]{transform:translate3d(0, 0, 0)}.md-sticky-clone[sticky-state=active]:not(.md-sticky-no-effect) .md-subheader-inner{animation:subheaderStickyHoverIn .3s ease-out both}@keyframes subheaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}}@keyframes subheaderStickyHoverOut{0%{box-shadow:0px 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.md-subheader-wrapper:not(.md-sticky-no-effect){transition:.2s ease-out margin}.md-subheader-wrapper:not(.md-sticky-no-effect) .md-subheader{margin:0}.md-subheader-wrapper:not(.md-sticky-no-effect).md-sticky-clone{z-index:2}.md-subheader-wrapper:not(.md-sticky-no-effect)[sticky-state=active]{margin-top:-2px}.md-subheader-wrapper:not(.md-sticky-no-effect):not(.md-sticky-clone)[sticky-prev-state=active] .md-subheader-inner:after{animation:subheaderStickyHoverOut .3s ease-out both}.md-subheader{display:block;font-size:14px;font-weight:500;line-height:1em;margin:0 0 0 0;position:relative}.md-subheader .md-subheader-inner{display:block;padding:16px}.md-subheader .md-subheader-content{display:block;z-index:1;position:relative}[md-swipe-left],[md-swipe-right]{touch-action:pan-y}[md-swipe-up],[md-swipe-down]{touch-action:pan-x}.md-inline-form md-switch{margin-top:18px;margin-bottom:19px}md-switch{margin:16px 0;white-space:nowrap;cursor:pointer;outline:none;user-select:none;height:30px;line-height:28px;align-items:center;display:flex;margin-left:inherit;margin-right:16px}[dir=rtl] md-switch{margin-left:16px}[dir=rtl] md-switch{margin-right:inherit}md-switch:last-of-type{margin-left:inherit;margin-right:0}[dir=rtl] md-switch:last-of-type{margin-left:0}[dir=rtl] md-switch:last-of-type{margin-right:inherit}md-switch[disabled]{cursor:default}md-switch[disabled] .md-container{cursor:default}md-switch .md-container{cursor:grab;width:36px;height:24px;position:relative;user-select:none;margin-right:8px;float:left}[dir=rtl] md-switch .md-container{margin-right:0px;margin-left:8px}md-switch.md-inverted .md-container{margin-right:initial;margin-left:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-right:8px}[dir=rtl] md-switch.md-inverted .md-container{margin-left:initial}md-switch:not([disabled]) .md-dragging,md-switch:not([disabled]).md-dragging .md-container{cursor:grabbing}md-switch.md-focused .md-thumb:before{left:-8px;top:-8px;right:-8px;bottom:-8px}md-switch .md-label{border-color:transparent;border-width:0;float:left}md-switch .md-bar{left:1px;width:34px;top:5px;height:14px;border-radius:8px;position:absolute}md-switch .md-thumb-container{top:2px;left:0;width:16px;position:absolute;transform:translate3d(0, 0, 0);z-index:1}md-switch.md-checked .md-thumb-container{transform:translate3d(100%, 0, 0)}md-switch .md-thumb{position:absolute;margin:0;left:0;top:0;outline:none;height:20px;width:20px;border-radius:50%;box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}md-switch .md-thumb:before{background-color:transparent;border-radius:50%;content:"";position:absolute;display:block;height:auto;left:0;top:0;right:0;bottom:0;transition:all .5s;width:auto}md-switch .md-thumb .md-ripple-container{position:absolute;display:block;width:auto;height:auto;left:-20px;top:-20px;right:-20px;bottom:-20px}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb-container,md-switch:not(.md-dragging) .md-thumb{transition:all .08s linear;transition-property:transform,background-color}md-switch:not(.md-dragging) .md-bar,md-switch:not(.md-dragging) .md-thumb{transition-delay:.05s}@media screen and (-ms-high-contrast: active){md-switch.md-default-theme .md-bar{background-color:#666}md-switch.md-default-theme.md-checked .md-bar{background-color:#9e9e9e}md-switch.md-default-theme .md-thumb{background-color:#fff}}@keyframes md-tab-content-hide{0%{opacity:1}50%{opacity:1}100%{opacity:0}}md-tab-data{position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;opacity:0}md-tabs{display:block;margin:0;border-radius:2px;overflow:hidden;position:relative;flex-shrink:0}md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:248px}md-tabs[md-align-tabs=bottom]{padding-bottom:48px}md-tabs[md-align-tabs=bottom]>md-tabs-wrapper{position:absolute;bottom:0;left:0;right:0;height:48px;z-index:2}md-tabs[md-align-tabs=bottom]>md-tabs-content-wrapper{top:0;bottom:48px}md-tabs.md-dynamic-height md-tabs-content-wrapper{min-height:0;position:relative;top:auto;left:auto;right:auto;bottom:auto;overflow:visible}md-tabs.md-dynamic-height md-tab-content.md-active{position:relative}md-tabs[md-border-bottom] md-tabs-wrapper{border-width:0 0 1px;border-style:solid}md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper{top:49px}md-tabs-wrapper{display:block;position:relative;transform:translate(0, 0)}md-tabs-wrapper md-prev-button,md-tabs-wrapper md-next-button{height:100%;width:32px;position:absolute;top:50%;transform:translateY(-50%);line-height:1em;z-index:2;cursor:pointer;font-size:16px;background:transparent no-repeat center center;transition:all .5s cubic-bezier(0.35, 0, 0.25, 1)}md-tabs-wrapper md-prev-button:focus,md-tabs-wrapper md-next-button:focus{outline:none}md-tabs-wrapper md-prev-button.md-disabled,md-tabs-wrapper md-next-button.md-disabled{opacity:.25;cursor:default}md-tabs-wrapper md-prev-button.ng-leave,md-tabs-wrapper md-next-button.ng-leave{transition:none}md-tabs-wrapper md-prev-button md-icon,md-tabs-wrapper md-next-button md-icon{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}[dir=rtl] md-tabs-wrapper md-prev-button,[dir=rtl] md-tabs-wrapper md-next-button{transform:rotateY(180deg) translateY(-50%)}md-tabs-wrapper md-prev-button{left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMjA4IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyIAkJIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4gPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+IDwvZz4gPC9nPiA8ZyBpZD0iR3JpZCIgZGlzcGxheT0ibm9uZSI+IDxnIGRpc3BsYXk9ImlubGluZSI+IDwvZz4gPC9nPiA8L3N2Zz4NCg==)}[dir=rtl] md-tabs-wrapper md-prev-button{left:auto;right:0}md-tabs-wrapper md-next-button{right:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE3LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPiA8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPiA8c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIyNHB4IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPiA8ZyBpZD0iSGVhZGVyIj4gPGc+IDxyZWN0IHg9Ii02MTgiIHk9Ii0xMzM2IiBmaWxsPSJub25lIiB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAwIi8+IDwvZz4gPC9nPiA8ZyBpZD0iTGFiZWwiPiA8L2c+IDxnIGlkPSJJY29uIj4gPGc+IDxwb2x5Z29uIHBvaW50cz0iMTAsNiA4LjYsNy40IDEzLjIsMTIgOC42LDE2LjYgMTAsMTggMTYsMTIgCQkiIHN0eWxlPSJmaWxsOndoaXRlOyIvPiA8cmVjdCBmaWxsPSJub25lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiLz4gPC9nPiA8L2c+IDxnIGlkPSJHcmlkIiBkaXNwbGF5PSJub25lIj4gPGcgZGlzcGxheT0iaW5saW5lIj4gPC9nPiA8L2c+IDwvc3ZnPg0K)}[dir=rtl] md-tabs-wrapper md-next-button{right:auto;left:0}md-tabs-wrapper md-next-button md-icon{transform:translate(-50%, -50%) rotate(180deg)}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper{width:100%;flex-direction:row}md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item{flex-grow:1}md-tabs-canvas{position:relative;overflow:hidden;display:block;height:48px}md-tabs-canvas:after{content:"";display:table;clear:both}md-tabs-canvas .md-dummy-wrapper{position:absolute;top:0;left:0}[dir=rtl] md-tabs-canvas .md-dummy-wrapper{left:auto;right:0}md-tabs-canvas.md-paginated{margin:0 32px}md-tabs-canvas.md-center-tabs{display:flex;flex-direction:column;text-align:center}md-tabs-canvas.md-center-tabs .md-tab{float:none;display:inline-block}md-pagination-wrapper{height:48px;display:flex;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);position:absolute;left:0;transform:translate(0, 0)}md-pagination-wrapper:after{content:"";display:table;clear:both}[dir=rtl] md-pagination-wrapper{left:auto;right:0}md-pagination-wrapper.md-center-tabs{position:relative;justify-content:center}md-pagination-wrapper md-tab-item{min-width:72px}@media(min-width: 600px){md-pagination-wrapper md-tab-item{min-width:160px}}md-tabs-content-wrapper{display:block;position:absolute;top:48px;left:0;right:0;bottom:0;overflow:hidden}md-tab-content{display:flex;position:absolute;top:0;left:0;right:0;bottom:0;transition:transform .5s cubic-bezier(0.35, 0, 0.25, 1);overflow:auto;transform:translate(0, 0)}md-tab-content.md-no-scroll{bottom:auto;overflow:hidden}md-tab-content.ng-leave,md-tab-content.md-no-transition{transition:none}md-tab-content.md-left:not(.md-active){transform:translateX(-100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-left:not(.md-active){transform:translateX(100%)}md-tab-content.md-left:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content.md-right:not(.md-active){transform:translateX(100%);animation:1s md-tab-content-hide;visibility:hidden}[dir=rtl] md-tab-content.md-right:not(.md-active){transform:translateX(-100%)}md-tab-content.md-right:not(.md-active) *{transition:visibility 0s linear;transition-delay:.5s;visibility:hidden}md-tab-content>div{flex:1 0 100%;min-width:0}md-tab-content>div.ng-leave{animation:1s md-tab-content-hide}md-ink-bar{position:absolute;left:auto;right:auto;bottom:0;height:2px}md-ink-bar.md-left{transition:left .125s cubic-bezier(0.35, 0, 0.25, 1),right .25s cubic-bezier(0.35, 0, 0.25, 1)}md-ink-bar.md-right{transition:left .25s cubic-bezier(0.35, 0, 0.25, 1),right .125s cubic-bezier(0.35, 0, 0.25, 1)}md-tab{position:absolute;z-index:-1;left:-9999px}.md-tab{font-size:14px;text-align:center;line-height:24px;padding:12px;transition:background-color .35s cubic-bezier(0.35, 0, 0.25, 1);cursor:pointer;white-space:nowrap;position:relative;text-transform:uppercase;float:left;font-weight:500;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}[dir=rtl] .md-tab{float:right}.md-tab.md-focused,.md-tab:focus{box-shadow:none;outline:none}.md-tab.md-active{cursor:default}.md-tab.md-disabled{pointer-events:none;touch-action:pan-y;user-select:none;-webkit-user-drag:none;opacity:.5;cursor:default}.md-tab.ng-leave{transition:none}md-toolbar+md-tabs,md-toolbar+md-dialog-content md-tabs{border-top-left-radius:0;border-top-right-radius:0}.md-toast-text{padding:0 8px}md-toast{position:absolute;z-index:105;box-sizing:border-box;cursor:default;overflow:hidden;padding:8px;opacity:1;transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast .md-toast-content{display:flex;flex-direction:row;align-items:center;max-height:168px;max-width:100%;min-height:48px;padding:0 16px;box-shadow:0 2px 5px 0 rgba(0,0,0,.26);border-radius:2px;font-size:14px;overflow:hidden;transform:translate3d(0, 0, 0) rotateZ(0deg);transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);justify-content:flex-start}md-toast .md-toast-content::before{content:"";min-height:48px;visibility:hidden;display:inline-block}[dir=rtl] md-toast .md-toast-content{justify-content:flex-end}md-toast .md-toast-content span{flex:1 1 0%;box-sizing:border-box;min-width:0}md-toast.md-capsule{border-radius:24px}md-toast.md-capsule .md-toast-content{border-radius:24px}md-toast.ng-leave-active .md-toast-content{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2)}md-toast.md-swipeleft .md-toast-content,md-toast.md-swiperight .md-toast-content,md-toast.md-swipeup .md-toast-content,md-toast.md-swipedown .md-toast-content{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1)}md-toast.ng-enter{opacity:0}md-toast.ng-enter .md-toast-content{transform:translate3d(0, 100%, 0)}md-toast.ng-enter.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast.ng-enter.ng-enter-active{opacity:1}md-toast.ng-enter.ng-enter-active .md-toast-content{transform:translate3d(0, 0, 0)}md-toast.ng-leave.ng-leave-active .md-toast-content{opacity:0;transform:translate3d(0, 100%, 0)}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}md-toast.ng-leave.ng-leave-active.md-top .md-toast-content{transform:translate3d(0, -100%, 0)}md-toast .md-action{line-height:19px;margin-left:24px;margin-right:0;cursor:pointer;text-transform:uppercase;float:right}md-toast .md-button{min-width:0;margin-right:0;margin-left:8px}[dir=rtl] md-toast .md-button{margin-right:8px}[dir=rtl] md-toast .md-button{margin-left:0}@media(max-width: 959px){md-toast{left:0;right:0;width:100%;max-width:100%;min-width:0;border-radius:0;bottom:0;padding:0}md-toast.ng-leave.ng-leave-active.md-swipeup .md-toast-content{transform:translate3d(0, -50%, 0)}md-toast.ng-leave.ng-leave-active.md-swipedown .md-toast-content{transform:translate3d(0, 50%, 0)}}@media(min-width: 960px){md-toast{min-width:304px}md-toast.md-bottom{bottom:0}md-toast.md-left{left:0}md-toast.md-right{right:0}md-toast.md-top{top:0}md-toast._md-start{left:0}[dir=rtl] md-toast._md-start{left:auto;right:0}md-toast._md-end{right:0}[dir=rtl] md-toast._md-end{right:auto;left:0}md-toast.ng-leave.ng-leave-active.md-swipeleft .md-toast-content{transform:translate3d(-50%, 0, 0)}md-toast.ng-leave.ng-leave-active.md-swiperight .md-toast-content{transform:translate3d(50%, 0, 0)}}@media(min-width: 1920px){md-toast .md-toast-content{max-width:568px}}@media screen and (-ms-high-contrast: active){md-toast{border:1px solid #fff}}.md-toast-animating{overflow:hidden !important}md-toolbar{box-sizing:border-box;display:flex;flex-direction:column;position:relative;z-index:2;font-size:20px;min-height:64px;width:100%}md-toolbar._md-toolbar-transitions{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}md-toolbar.md-whiteframe-z1-add,md-toolbar.md-whiteframe-z1-remove{transition:box-shadow .5s linear}md-toolbar md-toolbar-filler{width:72px}md-toolbar *,md-toolbar *:before,md-toolbar *:after{box-sizing:border-box}md-toolbar.ng-animate{transition:none}md-toolbar.md-tall{height:128px;min-height:128px;max-height:128px}md-toolbar.md-medium-tall{height:88px;min-height:88px;max-height:88px}md-toolbar.md-medium-tall .md-toolbar-tools{height:48px;min-height:48px;max-height:48px}md-toolbar>.md-indent{margin-left:64px}[dir=rtl] md-toolbar>.md-indent{margin-left:auto;margin-right:64px}md-toolbar~md-content>md-list{padding:0}md-toolbar~md-content>md-list md-list-item:last-child md-divider{display:none}.md-toolbar-tools{font-size:20px;letter-spacing:.005em;box-sizing:border-box;font-weight:400;display:flex;align-items:center;flex-direction:row;width:100%;height:64px;max-height:64px;padding:0 16px;margin:0}.md-toolbar-tools h1,.md-toolbar-tools h2,.md-toolbar-tools h3{font-size:inherit;font-weight:inherit;margin:inherit}.md-toolbar-tools a{color:inherit;text-decoration:none}.md-toolbar-tools .fill-height{display:flex;align-items:center}.md-toolbar-tools md-checkbox{margin:inherit}.md-toolbar-tools .md-button{margin-top:0;margin-bottom:0}.md-toolbar-tools .md-button,.md-toolbar-tools .md-button.md-icon-button md-icon{transition-duration:.5s;transition-timing-function:cubic-bezier(0.35, 0, 0.25, 1);transition-property:background-color,fill,color}.md-toolbar-tools .md-button.ng-animate,.md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate{transition:none}.md-toolbar-tools>.md-button:first-child{margin-left:-8px}[dir=rtl] .md-toolbar-tools>.md-button:first-child{margin-left:auto;margin-right:-8px}.md-toolbar-tools>.md-button:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>.md-button:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child{margin-right:-8px}[dir=rtl] .md-toolbar-tools>md-menu:last-child{margin-right:auto;margin-left:-8px}.md-toolbar-tools>md-menu:last-child>.md-button{margin-right:0}[dir=rtl] .md-toolbar-tools>md-menu:last-child>.md-button{margin-right:auto;margin-left:0}@media screen and (-ms-high-contrast: active){.md-toolbar-tools{border-bottom:1px solid #fff}}@media(min-width: 0)and (max-width: 959px)and (orientation: portrait){md-toolbar{min-height:56px}.md-toolbar-tools{height:56px;max-height:56px}}@media(min-width: 0)and (max-width: 959px)and (orientation: landscape){md-toolbar{min-height:48px}.md-toolbar-tools{height:48px;max-height:48px}}.md-tooltip{display:inline-block;pointer-events:none;border-radius:4px;overflow:hidden;opacity:0;font-weight:500;font-size:14px;white-space:nowrap;text-overflow:ellipsis;height:32px;line-height:32px;padding-right:16px;padding-left:16px}.md-tooltip.md-origin-top{transform-origin:center bottom;margin-top:-24px}.md-tooltip.md-origin-right{transform-origin:left center;margin-left:24px}.md-tooltip.md-origin-bottom{transform-origin:center top;margin-top:24px}.md-tooltip.md-origin-left{transform-origin:right center;margin-left:-24px}@media(min-width: 960px){.md-tooltip{font-size:10px;height:22px;line-height:22px;padding-right:8px;padding-left:8px}.md-tooltip.md-origin-top{margin-top:-14px}.md-tooltip.md-origin-right{margin-left:14px}.md-tooltip.md-origin-bottom{margin-top:14px}.md-tooltip.md-origin-left{margin-left:-14px}}.md-tooltip.md-show-add{transform:scale(0)}.md-tooltip.md-show{transition:all .4s cubic-bezier(0.25, 0.8, 0.25, 1);transition-duration:150ms;transform:scale(1);opacity:.9}.md-tooltip.md-hide{transition:all .3s cubic-bezier(0.55, 0, 0.55, 0.2);transition-duration:150ms;transform:scale(0);opacity:0}.md-truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.md-truncate.md-clip{text-overflow:clip}.md-truncate.flex{width:0}.md-virtual-repeat-container{box-sizing:border-box;display:block;margin:0;overflow:hidden;padding:0;position:relative}.md-virtual-repeat-container .md-virtual-repeat-scroller{bottom:0;box-sizing:border-box;left:0;margin:0;overflow-x:hidden;padding:0;position:absolute;right:0;top:0;-webkit-overflow-scrolling:touch}.md-virtual-repeat-container .md-virtual-repeat-sizer{box-sizing:border-box;height:1px;display:block;margin:0;padding:0;width:1px}.md-virtual-repeat-container .md-virtual-repeat-offsetter{box-sizing:border-box;left:0;margin:0;padding:0;position:absolute;right:0;top:0}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-scroller{overflow-x:auto;overflow-y:hidden}.md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{bottom:16px;right:auto;white-space:nowrap}[dir=rtl] .md-virtual-repeat-container.md-orient-horizontal .md-virtual-repeat-offsetter{right:auto;left:auto}.md-whiteframe-1dp,.md-whiteframe-z1{box-shadow:0px 1px 3px 0px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 2px 1px -1px rgba(0,0,0,.12)}.md-whiteframe-2dp{box-shadow:0px 1px 5px 0px rgba(0,0,0,.2),0px 2px 2px 0px rgba(0,0,0,.14),0px 3px 1px -2px rgba(0,0,0,.12)}.md-whiteframe-3dp{box-shadow:0px 1px 8px 0px rgba(0,0,0,.2),0px 3px 4px 0px rgba(0,0,0,.14),0px 3px 3px -2px rgba(0,0,0,.12)}.md-whiteframe-4dp,.md-whiteframe-z2{box-shadow:0px 2px 4px -1px rgba(0,0,0,.2),0px 4px 5px 0px rgba(0,0,0,.14),0px 1px 10px 0px rgba(0,0,0,.12)}.md-whiteframe-5dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 5px 8px 0px rgba(0,0,0,.14),0px 1px 14px 0px rgba(0,0,0,.12)}.md-whiteframe-6dp{box-shadow:0px 3px 5px -1px rgba(0,0,0,.2),0px 6px 10px 0px rgba(0,0,0,.14),0px 1px 18px 0px rgba(0,0,0,.12)}.md-whiteframe-7dp,.md-whiteframe-z3{box-shadow:0px 4px 5px -2px rgba(0,0,0,.2),0px 7px 10px 1px rgba(0,0,0,.14),0px 2px 16px 1px rgba(0,0,0,.12)}.md-whiteframe-8dp{box-shadow:0px 5px 5px -3px rgba(0,0,0,.2),0px 8px 10px 1px rgba(0,0,0,.14),0px 3px 14px 2px rgba(0,0,0,.12)}.md-whiteframe-9dp{box-shadow:0px 5px 6px -3px rgba(0,0,0,.2),0px 9px 12px 1px rgba(0,0,0,.14),0px 3px 16px 2px rgba(0,0,0,.12)}.md-whiteframe-10dp,.md-whiteframe-z4{box-shadow:0px 6px 6px -3px rgba(0,0,0,.2),0px 10px 14px 1px rgba(0,0,0,.14),0px 4px 18px 3px rgba(0,0,0,.12)}.md-whiteframe-11dp{box-shadow:0px 6px 7px -4px rgba(0,0,0,.2),0px 11px 15px 1px rgba(0,0,0,.14),0px 4px 20px 3px rgba(0,0,0,.12)}.md-whiteframe-12dp{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 12px 17px 2px rgba(0,0,0,.14),0px 5px 22px 4px rgba(0,0,0,.12)}.md-whiteframe-13dp,.md-whiteframe-z5{box-shadow:0px 7px 8px -4px rgba(0,0,0,.2),0px 13px 19px 2px rgba(0,0,0,.14),0px 5px 24px 4px rgba(0,0,0,.12)}.md-whiteframe-14dp{box-shadow:0px 7px 9px -4px rgba(0,0,0,.2),0px 14px 21px 2px rgba(0,0,0,.14),0px 5px 26px 4px rgba(0,0,0,.12)}.md-whiteframe-15dp{box-shadow:0px 8px 9px -5px rgba(0,0,0,.2),0px 15px 22px 2px rgba(0,0,0,.14),0px 6px 28px 5px rgba(0,0,0,.12)}.md-whiteframe-16dp{box-shadow:0px 8px 10px -5px rgba(0,0,0,.2),0px 16px 24px 2px rgba(0,0,0,.14),0px 6px 30px 5px rgba(0,0,0,.12)}.md-whiteframe-17dp{box-shadow:0px 8px 11px -5px rgba(0,0,0,.2),0px 17px 26px 2px rgba(0,0,0,.14),0px 6px 32px 5px rgba(0,0,0,.12)}.md-whiteframe-18dp{box-shadow:0px 9px 11px -5px rgba(0,0,0,.2),0px 18px 28px 2px rgba(0,0,0,.14),0px 7px 34px 6px rgba(0,0,0,.12)}.md-whiteframe-19dp{box-shadow:0px 9px 12px -6px rgba(0,0,0,.2),0px 19px 29px 2px rgba(0,0,0,.14),0px 7px 36px 6px rgba(0,0,0,.12)}.md-whiteframe-20dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 20px 31px 3px rgba(0,0,0,.14),0px 8px 38px 7px rgba(0,0,0,.12)}.md-whiteframe-21dp{box-shadow:0px 10px 13px -6px rgba(0,0,0,.2),0px 21px 33px 3px rgba(0,0,0,.14),0px 8px 40px 7px rgba(0,0,0,.12)}.md-whiteframe-22dp{box-shadow:0px 10px 14px -6px rgba(0,0,0,.2),0px 22px 35px 3px rgba(0,0,0,.14),0px 8px 42px 7px rgba(0,0,0,.12)}.md-whiteframe-23dp{box-shadow:0px 11px 14px -7px rgba(0,0,0,.2),0px 23px 36px 3px rgba(0,0,0,.14),0px 9px 44px 8px rgba(0,0,0,.12)}.md-whiteframe-24dp{box-shadow:0px 11px 15px -7px rgba(0,0,0,.2),0px 24px 38px 3px rgba(0,0,0,.14),0px 9px 46px 8px rgba(0,0,0,.12)}@media screen and (-ms-high-contrast: active){md-whiteframe{border:1px solid #fff}}@media print{md-whiteframe,[md-whiteframe]{background-color:#fff}}[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important}@-moz-document url-prefix(){.layout-fill{margin:0;width:100%;min-height:100%;height:100%}}.flex-order{order:0}.flex-order--20{order:-20}.flex-order--19{order:-19}.flex-order--18{order:-18}.flex-order--17{order:-17}.flex-order--16{order:-16}.flex-order--15{order:-15}.flex-order--14{order:-14}.flex-order--13{order:-13}.flex-order--12{order:-12}.flex-order--11{order:-11}.flex-order--10{order:-10}.flex-order--9{order:-9}.flex-order--8{order:-8}.flex-order--7{order:-7}.flex-order--6{order:-6}.flex-order--5{order:-5}.flex-order--4{order:-4}.flex-order--3{order:-3}.flex-order--2{order:-2}.flex-order--1{order:-1}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-order-11{order:11}.flex-order-12{order:12}.flex-order-13{order:13}.flex-order-14{order:14}.flex-order-15{order:15}.flex-order-16{order:16}.flex-order-17{order:17}.flex-order-18{order:18}.flex-order-19{order:19}.flex-order-20{order:20}.offset-0,.flex-offset-0,.layout-margin .flex-offset-0,.layout-margin .offset-0{margin-left:0}[dir=rtl] .offset-0,[dir=rtl] .flex-offset-0,[dir=rtl] .layout-margin .flex-offset-0,[dir=rtl] .layout-margin .offset-0{margin-left:auto;margin-right:0}.offset-5,.flex-offset-5,.layout-margin .flex-offset-5,.layout-margin .offset-5{margin-left:5%}[dir=rtl] .offset-5,[dir=rtl] .flex-offset-5,[dir=rtl] .layout-margin .flex-offset-5,[dir=rtl] .layout-margin .offset-5{margin-left:auto;margin-right:5%}.offset-10,.flex-offset-10,.layout-margin .flex-offset-10,.layout-margin .offset-10{margin-left:10%}[dir=rtl] .offset-10,[dir=rtl] .flex-offset-10,[dir=rtl] .layout-margin .flex-offset-10,[dir=rtl] .layout-margin .offset-10{margin-left:auto;margin-right:10%}.offset-15,.flex-offset-15,.layout-margin .flex-offset-15,.layout-margin .offset-15{margin-left:15%}[dir=rtl] .offset-15,[dir=rtl] .flex-offset-15,[dir=rtl] .layout-margin .flex-offset-15,[dir=rtl] .layout-margin .offset-15{margin-left:auto;margin-right:15%}.offset-20,.flex-offset-20,.layout-margin .flex-offset-20,.layout-margin .offset-20{margin-left:20%}[dir=rtl] .offset-20,[dir=rtl] .flex-offset-20,[dir=rtl] .layout-margin .flex-offset-20,[dir=rtl] .layout-margin .offset-20{margin-left:auto;margin-right:20%}.offset-25,.flex-offset-25,.layout-margin .flex-offset-25,.layout-margin .offset-25{margin-left:25%}[dir=rtl] .offset-25,[dir=rtl] .flex-offset-25,[dir=rtl] .layout-margin .flex-offset-25,[dir=rtl] .layout-margin .offset-25{margin-left:auto;margin-right:25%}.offset-30,.flex-offset-30,.layout-margin .flex-offset-30,.layout-margin .offset-30{margin-left:30%}[dir=rtl] .offset-30,[dir=rtl] .flex-offset-30,[dir=rtl] .layout-margin .flex-offset-30,[dir=rtl] .layout-margin .offset-30{margin-left:auto;margin-right:30%}.offset-35,.flex-offset-35,.layout-margin .flex-offset-35,.layout-margin .offset-35{margin-left:35%}[dir=rtl] .offset-35,[dir=rtl] .flex-offset-35,[dir=rtl] .layout-margin .flex-offset-35,[dir=rtl] .layout-margin .offset-35{margin-left:auto;margin-right:35%}.offset-40,.flex-offset-40,.layout-margin .flex-offset-40,.layout-margin .offset-40{margin-left:40%}[dir=rtl] .offset-40,[dir=rtl] .flex-offset-40,[dir=rtl] .layout-margin .flex-offset-40,[dir=rtl] .layout-margin .offset-40{margin-left:auto;margin-right:40%}.offset-45,.flex-offset-45,.layout-margin .flex-offset-45,.layout-margin .offset-45{margin-left:45%}[dir=rtl] .offset-45,[dir=rtl] .flex-offset-45,[dir=rtl] .layout-margin .flex-offset-45,[dir=rtl] .layout-margin .offset-45{margin-left:auto;margin-right:45%}.offset-50,.flex-offset-50,.layout-margin .flex-offset-50,.layout-margin .offset-50{margin-left:50%}[dir=rtl] .offset-50,[dir=rtl] .flex-offset-50,[dir=rtl] .layout-margin .flex-offset-50,[dir=rtl] .layout-margin .offset-50{margin-left:auto;margin-right:50%}.offset-55,.flex-offset-55,.layout-margin .flex-offset-55,.layout-margin .offset-55{margin-left:55%}[dir=rtl] .offset-55,[dir=rtl] .flex-offset-55,[dir=rtl] .layout-margin .flex-offset-55,[dir=rtl] .layout-margin .offset-55{margin-left:auto;margin-right:55%}.offset-60,.flex-offset-60,.layout-margin .flex-offset-60,.layout-margin .offset-60{margin-left:60%}[dir=rtl] .offset-60,[dir=rtl] .flex-offset-60,[dir=rtl] .layout-margin .flex-offset-60,[dir=rtl] .layout-margin .offset-60{margin-left:auto;margin-right:60%}.offset-65,.flex-offset-65,.layout-margin .flex-offset-65,.layout-margin .offset-65{margin-left:65%}[dir=rtl] .offset-65,[dir=rtl] .flex-offset-65,[dir=rtl] .layout-margin .flex-offset-65,[dir=rtl] .layout-margin .offset-65{margin-left:auto;margin-right:65%}.offset-70,.flex-offset-70,.layout-margin .flex-offset-70,.layout-margin .offset-70{margin-left:70%}[dir=rtl] .offset-70,[dir=rtl] .flex-offset-70,[dir=rtl] .layout-margin .flex-offset-70,[dir=rtl] .layout-margin .offset-70{margin-left:auto;margin-right:70%}.offset-75,.flex-offset-75,.layout-margin .flex-offset-75,.layout-margin .offset-75{margin-left:75%}[dir=rtl] .offset-75,[dir=rtl] .flex-offset-75,[dir=rtl] .layout-margin .flex-offset-75,[dir=rtl] .layout-margin .offset-75{margin-left:auto;margin-right:75%}.offset-80,.flex-offset-80,.layout-margin .flex-offset-80,.layout-margin .offset-80{margin-left:80%}[dir=rtl] .offset-80,[dir=rtl] .flex-offset-80,[dir=rtl] .layout-margin .flex-offset-80,[dir=rtl] .layout-margin .offset-80{margin-left:auto;margin-right:80%}.offset-85,.flex-offset-85,.layout-margin .flex-offset-85,.layout-margin .offset-85{margin-left:85%}[dir=rtl] .offset-85,[dir=rtl] .flex-offset-85,[dir=rtl] .layout-margin .flex-offset-85,[dir=rtl] .layout-margin .offset-85{margin-left:auto;margin-right:85%}.offset-90,.flex-offset-90,.layout-margin .flex-offset-90,.layout-margin .offset-90{margin-left:90%}[dir=rtl] .offset-90,[dir=rtl] .flex-offset-90,[dir=rtl] .layout-margin .flex-offset-90,[dir=rtl] .layout-margin .offset-90{margin-left:auto;margin-right:90%}.offset-95,.flex-offset-95,.layout-margin .flex-offset-95,.layout-margin .offset-95{margin-left:95%}[dir=rtl] .offset-95,[dir=rtl] .flex-offset-95,[dir=rtl] .layout-margin .flex-offset-95,[dir=rtl] .layout-margin .offset-95{margin-left:auto;margin-right:95%}.offset-33,.flex-offset-33,.layout-margin .flex-offset-33,.layout-margin .offset-33{margin-left:33.3333333333%}.offset-66,.flex-offset-66,.layout-margin .flex-offset-66,.layout-margin .offset-66{margin-left:66.6666666667%}[dir=rtl] .offset-66,[dir=rtl] .flex-offset-66,[dir=rtl] .layout-margin .flex-offset-66,[dir=rtl] .layout-margin .offset-66{margin-left:auto;margin-right:66.6666666667%}.layout-align,.layout-align-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-start,.layout-align-start-start,.layout-align-start-center,.layout-align-start-end,.layout-align-start-stretch{justify-content:flex-start}.layout-align-center,.layout-align-center-start,.layout-align-center-center,.layout-align-center-end,.layout-align-center-stretch{justify-content:center}.layout-align-end,.layout-align-end-start,.layout-align-end-center,.layout-align-end-end,.layout-align-end-stretch{justify-content:flex-end}.layout-align-space-around,.layout-align-space-around-center,.layout-align-space-around-start,.layout-align-space-around-end,.layout-align-space-around-stretch{justify-content:space-around}.layout-align-space-between,.layout-align-space-between-center,.layout-align-space-between-start,.layout-align-space-between-end,.layout-align-space-between-stretch{justify-content:space-between}.layout-align-start-start,.layout-align-center-start,.layout-align-end-start,.layout-align-space-between-start,.layout-align-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-start-center,.layout-align-center-center,.layout-align-end-center,.layout-align-space-between-center,.layout-align-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-start-center>*,.layout-align-center-center>*,.layout-align-end-center>*,.layout-align-space-between-center>*,.layout-align-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-start-end,.layout-align-center-end,.layout-align-end-end,.layout-align-space-between-end,.layout-align-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-start-stretch,.layout-align-center-stretch,.layout-align-end-stretch,.layout-align-space-between-stretch,.layout-align-space-around-stretch{align-items:stretch;align-content:stretch}.flex{flex:1;box-sizing:border-box}.flex-grow{flex:1 1 100%;box-sizing:border-box}.flex-initial{flex:0 1 auto;box-sizing:border-box}.flex-auto{flex:1 1 auto;box-sizing:border-box}.flex-none{flex:0 0 auto;box-sizing:border-box}.flex-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-row>.flex-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-row>.flex{min-width:0}.layout-column>.flex-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-column>.flex{min-height:0}.layout,.layout-column,.layout-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-column{flex-direction:column}.layout-row{flex-direction:row}.layout-padding-sm>*,.layout-padding>.flex-sm{padding:4px}.layout-padding,.layout-padding-gt-sm,.layout-padding-md,.layout-padding>*,.layout-padding-gt-sm>*,.layout-padding-md>*,.layout-padding>.flex,.layout-padding>.flex-gt-sm,.layout-padding>.flex-md{padding:8px}.layout-padding-gt-md>*,.layout-padding-lg>*,.layout-padding-gt-lg>*,.layout-padding>.flex-gt-md,.layout-padding>.flex-lg,.layout-padding>.flex-lg,.layout-padding>.flex-gt-lg{padding:16px}.layout-margin-sm>*,.layout-margin>.flex-sm{margin:4px}.layout-margin,.layout-margin-gt-sm,.layout-margin-md,.layout-margin>*,.layout-margin-gt-sm>*,.layout-margin-md>*,.layout-margin>.flex,.layout-margin>.flex-gt-sm,.layout-margin>.flex-md{margin:8px}.layout-margin-gt-md>*,.layout-margin-lg>*,.layout-margin-gt-lg>*,.layout-margin>.flex-gt-md,.layout-margin>.flex-lg,.layout-margin>.flex-gt-lg{margin:16px}.layout-wrap{flex-wrap:wrap}.layout-nowrap{flex-wrap:nowrap}.layout-fill{margin:0;width:100%;min-height:100%;height:100%}@media(max-width: 599px){.hide-xs:not(.show-xs):not(.show),.hide:not(.show-xs):not(.show){display:none}.flex-order-xs--20{order:-20}.flex-order-xs--19{order:-19}.flex-order-xs--18{order:-18}.flex-order-xs--17{order:-17}.flex-order-xs--16{order:-16}.flex-order-xs--15{order:-15}.flex-order-xs--14{order:-14}.flex-order-xs--13{order:-13}.flex-order-xs--12{order:-12}.flex-order-xs--11{order:-11}.flex-order-xs--10{order:-10}.flex-order-xs--9{order:-9}.flex-order-xs--8{order:-8}.flex-order-xs--7{order:-7}.flex-order-xs--6{order:-6}.flex-order-xs--5{order:-5}.flex-order-xs--4{order:-4}.flex-order-xs--3{order:-3}.flex-order-xs--2{order:-2}.flex-order-xs--1{order:-1}.flex-order-xs-0{order:0}.flex-order-xs-1{order:1}.flex-order-xs-2{order:2}.flex-order-xs-3{order:3}.flex-order-xs-4{order:4}.flex-order-xs-5{order:5}.flex-order-xs-6{order:6}.flex-order-xs-7{order:7}.flex-order-xs-8{order:8}.flex-order-xs-9{order:9}.flex-order-xs-10{order:10}.flex-order-xs-11{order:11}.flex-order-xs-12{order:12}.flex-order-xs-13{order:13}.flex-order-xs-14{order:14}.flex-order-xs-15{order:15}.flex-order-xs-16{order:16}.flex-order-xs-17{order:17}.flex-order-xs-18{order:18}.flex-order-xs-19{order:19}.flex-order-xs-20{order:20}.offset-xs-0,.flex-offset-xs-0,.layout-margin .flex-offset-xs-0,.layout-margin .offset-xs-0{margin-left:0}[dir=rtl] .offset-xs-0,[dir=rtl] .flex-offset-xs-0,[dir=rtl] .layout-margin .flex-offset-xs-0,[dir=rtl] .layout-margin .offset-xs-0{margin-left:auto;margin-right:0}.offset-xs-5,.flex-offset-xs-5,.layout-margin .flex-offset-xs-5,.layout-margin .offset-xs-5{margin-left:5%}[dir=rtl] .offset-xs-5,[dir=rtl] .flex-offset-xs-5,[dir=rtl] .layout-margin .flex-offset-xs-5,[dir=rtl] .layout-margin .offset-xs-5{margin-left:auto;margin-right:5%}.offset-xs-10,.flex-offset-xs-10,.layout-margin .flex-offset-xs-10,.layout-margin .offset-xs-10{margin-left:10%}[dir=rtl] .offset-xs-10,[dir=rtl] .flex-offset-xs-10,[dir=rtl] .layout-margin .flex-offset-xs-10,[dir=rtl] .layout-margin .offset-xs-10{margin-left:auto;margin-right:10%}.offset-xs-15,.flex-offset-xs-15,.layout-margin .flex-offset-xs-15,.layout-margin .offset-xs-15{margin-left:15%}[dir=rtl] .offset-xs-15,[dir=rtl] .flex-offset-xs-15,[dir=rtl] .layout-margin .flex-offset-xs-15,[dir=rtl] .layout-margin .offset-xs-15{margin-left:auto;margin-right:15%}.offset-xs-20,.flex-offset-xs-20,.layout-margin .flex-offset-xs-20,.layout-margin .offset-xs-20{margin-left:20%}[dir=rtl] .offset-xs-20,[dir=rtl] .flex-offset-xs-20,[dir=rtl] .layout-margin .flex-offset-xs-20,[dir=rtl] .layout-margin .offset-xs-20{margin-left:auto;margin-right:20%}.offset-xs-25,.flex-offset-xs-25,.layout-margin .flex-offset-xs-25,.layout-margin .offset-xs-25{margin-left:25%}[dir=rtl] .offset-xs-25,[dir=rtl] .flex-offset-xs-25,[dir=rtl] .layout-margin .flex-offset-xs-25,[dir=rtl] .layout-margin .offset-xs-25{margin-left:auto;margin-right:25%}.offset-xs-30,.flex-offset-xs-30,.layout-margin .flex-offset-xs-30,.layout-margin .offset-xs-30{margin-left:30%}[dir=rtl] .offset-xs-30,[dir=rtl] .flex-offset-xs-30,[dir=rtl] .layout-margin .flex-offset-xs-30,[dir=rtl] .layout-margin .offset-xs-30{margin-left:auto;margin-right:30%}.offset-xs-35,.flex-offset-xs-35,.layout-margin .flex-offset-xs-35,.layout-margin .offset-xs-35{margin-left:35%}[dir=rtl] .offset-xs-35,[dir=rtl] .flex-offset-xs-35,[dir=rtl] .layout-margin .flex-offset-xs-35,[dir=rtl] .layout-margin .offset-xs-35{margin-left:auto;margin-right:35%}.offset-xs-40,.flex-offset-xs-40,.layout-margin .flex-offset-xs-40,.layout-margin .offset-xs-40{margin-left:40%}[dir=rtl] .offset-xs-40,[dir=rtl] .flex-offset-xs-40,[dir=rtl] .layout-margin .flex-offset-xs-40,[dir=rtl] .layout-margin .offset-xs-40{margin-left:auto;margin-right:40%}.offset-xs-45,.flex-offset-xs-45,.layout-margin .flex-offset-xs-45,.layout-margin .offset-xs-45{margin-left:45%}[dir=rtl] .offset-xs-45,[dir=rtl] .flex-offset-xs-45,[dir=rtl] .layout-margin .flex-offset-xs-45,[dir=rtl] .layout-margin .offset-xs-45{margin-left:auto;margin-right:45%}.offset-xs-50,.flex-offset-xs-50,.layout-margin .flex-offset-xs-50,.layout-margin .offset-xs-50{margin-left:50%}[dir=rtl] .offset-xs-50,[dir=rtl] .flex-offset-xs-50,[dir=rtl] .layout-margin .flex-offset-xs-50,[dir=rtl] .layout-margin .offset-xs-50{margin-left:auto;margin-right:50%}.offset-xs-55,.flex-offset-xs-55,.layout-margin .flex-offset-xs-55,.layout-margin .offset-xs-55{margin-left:55%}[dir=rtl] .offset-xs-55,[dir=rtl] .flex-offset-xs-55,[dir=rtl] .layout-margin .flex-offset-xs-55,[dir=rtl] .layout-margin .offset-xs-55{margin-left:auto;margin-right:55%}.offset-xs-60,.flex-offset-xs-60,.layout-margin .flex-offset-xs-60,.layout-margin .offset-xs-60{margin-left:60%}[dir=rtl] .offset-xs-60,[dir=rtl] .flex-offset-xs-60,[dir=rtl] .layout-margin .flex-offset-xs-60,[dir=rtl] .layout-margin .offset-xs-60{margin-left:auto;margin-right:60%}.offset-xs-65,.flex-offset-xs-65,.layout-margin .flex-offset-xs-65,.layout-margin .offset-xs-65{margin-left:65%}[dir=rtl] .offset-xs-65,[dir=rtl] .flex-offset-xs-65,[dir=rtl] .layout-margin .flex-offset-xs-65,[dir=rtl] .layout-margin .offset-xs-65{margin-left:auto;margin-right:65%}.offset-xs-70,.flex-offset-xs-70,.layout-margin .flex-offset-xs-70,.layout-margin .offset-xs-70{margin-left:70%}[dir=rtl] .offset-xs-70,[dir=rtl] .flex-offset-xs-70,[dir=rtl] .layout-margin .flex-offset-xs-70,[dir=rtl] .layout-margin .offset-xs-70{margin-left:auto;margin-right:70%}.offset-xs-75,.flex-offset-xs-75,.layout-margin .flex-offset-xs-75,.layout-margin .offset-xs-75{margin-left:75%}[dir=rtl] .offset-xs-75,[dir=rtl] .flex-offset-xs-75,[dir=rtl] .layout-margin .flex-offset-xs-75,[dir=rtl] .layout-margin .offset-xs-75{margin-left:auto;margin-right:75%}.offset-xs-80,.flex-offset-xs-80,.layout-margin .flex-offset-xs-80,.layout-margin .offset-xs-80{margin-left:80%}[dir=rtl] .offset-xs-80,[dir=rtl] .flex-offset-xs-80,[dir=rtl] .layout-margin .flex-offset-xs-80,[dir=rtl] .layout-margin .offset-xs-80{margin-left:auto;margin-right:80%}.offset-xs-85,.flex-offset-xs-85,.layout-margin .flex-offset-xs-85,.layout-margin .offset-xs-85{margin-left:85%}[dir=rtl] .offset-xs-85,[dir=rtl] .flex-offset-xs-85,[dir=rtl] .layout-margin .flex-offset-xs-85,[dir=rtl] .layout-margin .offset-xs-85{margin-left:auto;margin-right:85%}.offset-xs-90,.flex-offset-xs-90,.layout-margin .flex-offset-xs-90,.layout-margin .offset-xs-90{margin-left:90%}[dir=rtl] .offset-xs-90,[dir=rtl] .flex-offset-xs-90,[dir=rtl] .layout-margin .flex-offset-xs-90,[dir=rtl] .layout-margin .offset-xs-90{margin-left:auto;margin-right:90%}.offset-xs-95,.flex-offset-xs-95,.layout-margin .flex-offset-xs-95,.layout-margin .offset-xs-95{margin-left:95%}[dir=rtl] .offset-xs-95,[dir=rtl] .flex-offset-xs-95,[dir=rtl] .layout-margin .flex-offset-xs-95,[dir=rtl] .layout-margin .offset-xs-95{margin-left:auto;margin-right:95%}.offset-xs-33,.flex-offset-xs-33,.layout-margin .flex-offset-xs-33,.layout-margin .offset-xs-33{margin-left:33.3333333333%}.offset-xs-66,.flex-offset-xs-66,.layout-margin .flex-offset-xs-66,.layout-margin .offset-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-xs-66,[dir=rtl] .flex-offset-xs-66,[dir=rtl] .layout-margin .flex-offset-xs-66,[dir=rtl] .layout-margin .offset-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xs,.layout-align-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xs-start,.layout-align-xs-start-start,.layout-align-xs-start-center,.layout-align-xs-start-end,.layout-align-xs-start-stretch{justify-content:flex-start}.layout-align-xs-center,.layout-align-xs-center-start,.layout-align-xs-center-center,.layout-align-xs-center-end,.layout-align-xs-center-stretch{justify-content:center}.layout-align-xs-end,.layout-align-xs-end-start,.layout-align-xs-end-center,.layout-align-xs-end-end,.layout-align-xs-end-stretch{justify-content:flex-end}.layout-align-xs-space-around,.layout-align-xs-space-around-center,.layout-align-xs-space-around-start,.layout-align-xs-space-around-end,.layout-align-xs-space-around-stretch{justify-content:space-around}.layout-align-xs-space-between,.layout-align-xs-space-between-center,.layout-align-xs-space-between-start,.layout-align-xs-space-between-end,.layout-align-xs-space-between-stretch{justify-content:space-between}.layout-align-xs-start-start,.layout-align-xs-center-start,.layout-align-xs-end-start,.layout-align-xs-space-between-start,.layout-align-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xs-start-center,.layout-align-xs-center-center,.layout-align-xs-end-center,.layout-align-xs-space-between-center,.layout-align-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xs-start-center>*,.layout-align-xs-center-center>*,.layout-align-xs-end-center>*,.layout-align-xs-space-between-center>*,.layout-align-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xs-start-end,.layout-align-xs-center-end,.layout-align-xs-end-end,.layout-align-xs-space-between-end,.layout-align-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xs-start-stretch,.layout-align-xs-center-stretch,.layout-align-xs-end-stretch,.layout-align-xs-space-between-stretch,.layout-align-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xs{flex:1;box-sizing:border-box}.flex-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xs-row>.flex-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xs-column>.flex-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xs-row>.flex-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xs-row>.flex-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xs-row>.flex-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xs-row>.flex-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xs-row>.flex-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xs-row>.flex-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xs-row>.flex-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xs-row>.flex-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xs-row>.flex-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xs-row>.flex-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xs-row>.flex-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xs-row>.flex-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xs-row>.flex-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xs-row>.flex-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xs-row>.flex-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xs-row>.flex-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xs-row>.flex-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xs-row>.flex-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xs-row>.flex-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xs-column>.flex-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-row>.flex-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xs-row>.flex{min-width:0}.layout-xs-column>.flex-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xs-column>.flex-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xs-column>.flex{min-height:0}.layout-xs,.layout-xs-column,.layout-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xs-column{flex-direction:column}.layout-xs-row{flex-direction:row}}@media(min-width: 600px){.flex-order-gt-xs--20{order:-20}.flex-order-gt-xs--19{order:-19}.flex-order-gt-xs--18{order:-18}.flex-order-gt-xs--17{order:-17}.flex-order-gt-xs--16{order:-16}.flex-order-gt-xs--15{order:-15}.flex-order-gt-xs--14{order:-14}.flex-order-gt-xs--13{order:-13}.flex-order-gt-xs--12{order:-12}.flex-order-gt-xs--11{order:-11}.flex-order-gt-xs--10{order:-10}.flex-order-gt-xs--9{order:-9}.flex-order-gt-xs--8{order:-8}.flex-order-gt-xs--7{order:-7}.flex-order-gt-xs--6{order:-6}.flex-order-gt-xs--5{order:-5}.flex-order-gt-xs--4{order:-4}.flex-order-gt-xs--3{order:-3}.flex-order-gt-xs--2{order:-2}.flex-order-gt-xs--1{order:-1}.flex-order-gt-xs-0{order:0}.flex-order-gt-xs-1{order:1}.flex-order-gt-xs-2{order:2}.flex-order-gt-xs-3{order:3}.flex-order-gt-xs-4{order:4}.flex-order-gt-xs-5{order:5}.flex-order-gt-xs-6{order:6}.flex-order-gt-xs-7{order:7}.flex-order-gt-xs-8{order:8}.flex-order-gt-xs-9{order:9}.flex-order-gt-xs-10{order:10}.flex-order-gt-xs-11{order:11}.flex-order-gt-xs-12{order:12}.flex-order-gt-xs-13{order:13}.flex-order-gt-xs-14{order:14}.flex-order-gt-xs-15{order:15}.flex-order-gt-xs-16{order:16}.flex-order-gt-xs-17{order:17}.flex-order-gt-xs-18{order:18}.flex-order-gt-xs-19{order:19}.flex-order-gt-xs-20{order:20}.offset-gt-xs-0,.flex-offset-gt-xs-0,.layout-margin .flex-offset-gt-xs-0,.layout-margin .offset-gt-xs-0{margin-left:0}[dir=rtl] .offset-gt-xs-0,[dir=rtl] .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .flex-offset-gt-xs-0,[dir=rtl] .layout-margin .offset-gt-xs-0{margin-left:auto;margin-right:0}.offset-gt-xs-5,.flex-offset-gt-xs-5,.layout-margin .flex-offset-gt-xs-5,.layout-margin .offset-gt-xs-5{margin-left:5%}[dir=rtl] .offset-gt-xs-5,[dir=rtl] .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .flex-offset-gt-xs-5,[dir=rtl] .layout-margin .offset-gt-xs-5{margin-left:auto;margin-right:5%}.offset-gt-xs-10,.flex-offset-gt-xs-10,.layout-margin .flex-offset-gt-xs-10,.layout-margin .offset-gt-xs-10{margin-left:10%}[dir=rtl] .offset-gt-xs-10,[dir=rtl] .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .flex-offset-gt-xs-10,[dir=rtl] .layout-margin .offset-gt-xs-10{margin-left:auto;margin-right:10%}.offset-gt-xs-15,.flex-offset-gt-xs-15,.layout-margin .flex-offset-gt-xs-15,.layout-margin .offset-gt-xs-15{margin-left:15%}[dir=rtl] .offset-gt-xs-15,[dir=rtl] .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .flex-offset-gt-xs-15,[dir=rtl] .layout-margin .offset-gt-xs-15{margin-left:auto;margin-right:15%}.offset-gt-xs-20,.flex-offset-gt-xs-20,.layout-margin .flex-offset-gt-xs-20,.layout-margin .offset-gt-xs-20{margin-left:20%}[dir=rtl] .offset-gt-xs-20,[dir=rtl] .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .flex-offset-gt-xs-20,[dir=rtl] .layout-margin .offset-gt-xs-20{margin-left:auto;margin-right:20%}.offset-gt-xs-25,.flex-offset-gt-xs-25,.layout-margin .flex-offset-gt-xs-25,.layout-margin .offset-gt-xs-25{margin-left:25%}[dir=rtl] .offset-gt-xs-25,[dir=rtl] .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .flex-offset-gt-xs-25,[dir=rtl] .layout-margin .offset-gt-xs-25{margin-left:auto;margin-right:25%}.offset-gt-xs-30,.flex-offset-gt-xs-30,.layout-margin .flex-offset-gt-xs-30,.layout-margin .offset-gt-xs-30{margin-left:30%}[dir=rtl] .offset-gt-xs-30,[dir=rtl] .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .flex-offset-gt-xs-30,[dir=rtl] .layout-margin .offset-gt-xs-30{margin-left:auto;margin-right:30%}.offset-gt-xs-35,.flex-offset-gt-xs-35,.layout-margin .flex-offset-gt-xs-35,.layout-margin .offset-gt-xs-35{margin-left:35%}[dir=rtl] .offset-gt-xs-35,[dir=rtl] .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .flex-offset-gt-xs-35,[dir=rtl] .layout-margin .offset-gt-xs-35{margin-left:auto;margin-right:35%}.offset-gt-xs-40,.flex-offset-gt-xs-40,.layout-margin .flex-offset-gt-xs-40,.layout-margin .offset-gt-xs-40{margin-left:40%}[dir=rtl] .offset-gt-xs-40,[dir=rtl] .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .flex-offset-gt-xs-40,[dir=rtl] .layout-margin .offset-gt-xs-40{margin-left:auto;margin-right:40%}.offset-gt-xs-45,.flex-offset-gt-xs-45,.layout-margin .flex-offset-gt-xs-45,.layout-margin .offset-gt-xs-45{margin-left:45%}[dir=rtl] .offset-gt-xs-45,[dir=rtl] .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .flex-offset-gt-xs-45,[dir=rtl] .layout-margin .offset-gt-xs-45{margin-left:auto;margin-right:45%}.offset-gt-xs-50,.flex-offset-gt-xs-50,.layout-margin .flex-offset-gt-xs-50,.layout-margin .offset-gt-xs-50{margin-left:50%}[dir=rtl] .offset-gt-xs-50,[dir=rtl] .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .flex-offset-gt-xs-50,[dir=rtl] .layout-margin .offset-gt-xs-50{margin-left:auto;margin-right:50%}.offset-gt-xs-55,.flex-offset-gt-xs-55,.layout-margin .flex-offset-gt-xs-55,.layout-margin .offset-gt-xs-55{margin-left:55%}[dir=rtl] .offset-gt-xs-55,[dir=rtl] .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .flex-offset-gt-xs-55,[dir=rtl] .layout-margin .offset-gt-xs-55{margin-left:auto;margin-right:55%}.offset-gt-xs-60,.flex-offset-gt-xs-60,.layout-margin .flex-offset-gt-xs-60,.layout-margin .offset-gt-xs-60{margin-left:60%}[dir=rtl] .offset-gt-xs-60,[dir=rtl] .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .flex-offset-gt-xs-60,[dir=rtl] .layout-margin .offset-gt-xs-60{margin-left:auto;margin-right:60%}.offset-gt-xs-65,.flex-offset-gt-xs-65,.layout-margin .flex-offset-gt-xs-65,.layout-margin .offset-gt-xs-65{margin-left:65%}[dir=rtl] .offset-gt-xs-65,[dir=rtl] .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .flex-offset-gt-xs-65,[dir=rtl] .layout-margin .offset-gt-xs-65{margin-left:auto;margin-right:65%}.offset-gt-xs-70,.flex-offset-gt-xs-70,.layout-margin .flex-offset-gt-xs-70,.layout-margin .offset-gt-xs-70{margin-left:70%}[dir=rtl] .offset-gt-xs-70,[dir=rtl] .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .flex-offset-gt-xs-70,[dir=rtl] .layout-margin .offset-gt-xs-70{margin-left:auto;margin-right:70%}.offset-gt-xs-75,.flex-offset-gt-xs-75,.layout-margin .flex-offset-gt-xs-75,.layout-margin .offset-gt-xs-75{margin-left:75%}[dir=rtl] .offset-gt-xs-75,[dir=rtl] .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .flex-offset-gt-xs-75,[dir=rtl] .layout-margin .offset-gt-xs-75{margin-left:auto;margin-right:75%}.offset-gt-xs-80,.flex-offset-gt-xs-80,.layout-margin .flex-offset-gt-xs-80,.layout-margin .offset-gt-xs-80{margin-left:80%}[dir=rtl] .offset-gt-xs-80,[dir=rtl] .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .flex-offset-gt-xs-80,[dir=rtl] .layout-margin .offset-gt-xs-80{margin-left:auto;margin-right:80%}.offset-gt-xs-85,.flex-offset-gt-xs-85,.layout-margin .flex-offset-gt-xs-85,.layout-margin .offset-gt-xs-85{margin-left:85%}[dir=rtl] .offset-gt-xs-85,[dir=rtl] .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .flex-offset-gt-xs-85,[dir=rtl] .layout-margin .offset-gt-xs-85{margin-left:auto;margin-right:85%}.offset-gt-xs-90,.flex-offset-gt-xs-90,.layout-margin .flex-offset-gt-xs-90,.layout-margin .offset-gt-xs-90{margin-left:90%}[dir=rtl] .offset-gt-xs-90,[dir=rtl] .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .flex-offset-gt-xs-90,[dir=rtl] .layout-margin .offset-gt-xs-90{margin-left:auto;margin-right:90%}.offset-gt-xs-95,.flex-offset-gt-xs-95,.layout-margin .flex-offset-gt-xs-95,.layout-margin .offset-gt-xs-95{margin-left:95%}[dir=rtl] .offset-gt-xs-95,[dir=rtl] .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .flex-offset-gt-xs-95,[dir=rtl] .layout-margin .offset-gt-xs-95{margin-left:auto;margin-right:95%}.offset-gt-xs-33,.flex-offset-gt-xs-33,.layout-margin .flex-offset-gt-xs-33,.layout-margin .offset-gt-xs-33{margin-left:33.3333333333%}.offset-gt-xs-66,.flex-offset-gt-xs-66,.layout-margin .flex-offset-gt-xs-66,.layout-margin .offset-gt-xs-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-xs-66,[dir=rtl] .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .flex-offset-gt-xs-66,[dir=rtl] .layout-margin .offset-gt-xs-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-xs,.layout-align-gt-xs-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-xs-start,.layout-align-gt-xs-start-start,.layout-align-gt-xs-start-center,.layout-align-gt-xs-start-end,.layout-align-gt-xs-start-stretch{justify-content:flex-start}.layout-align-gt-xs-center,.layout-align-gt-xs-center-start,.layout-align-gt-xs-center-center,.layout-align-gt-xs-center-end,.layout-align-gt-xs-center-stretch{justify-content:center}.layout-align-gt-xs-end,.layout-align-gt-xs-end-start,.layout-align-gt-xs-end-center,.layout-align-gt-xs-end-end,.layout-align-gt-xs-end-stretch{justify-content:flex-end}.layout-align-gt-xs-space-around,.layout-align-gt-xs-space-around-center,.layout-align-gt-xs-space-around-start,.layout-align-gt-xs-space-around-end,.layout-align-gt-xs-space-around-stretch{justify-content:space-around}.layout-align-gt-xs-space-between,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-between-stretch{justify-content:space-between}.layout-align-gt-xs-start-start,.layout-align-gt-xs-center-start,.layout-align-gt-xs-end-start,.layout-align-gt-xs-space-between-start,.layout-align-gt-xs-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-xs-start-center,.layout-align-gt-xs-center-center,.layout-align-gt-xs-end-center,.layout-align-gt-xs-space-between-center,.layout-align-gt-xs-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-xs-start-center>*,.layout-align-gt-xs-center-center>*,.layout-align-gt-xs-end-center>*,.layout-align-gt-xs-space-between-center>*,.layout-align-gt-xs-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-xs-start-end,.layout-align-gt-xs-center-end,.layout-align-gt-xs-end-end,.layout-align-gt-xs-space-between-end,.layout-align-gt-xs-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-xs-start-stretch,.layout-align-gt-xs-center-stretch,.layout-align-gt-xs-end-stretch,.layout-align-gt-xs-space-between-stretch,.layout-align-gt-xs-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-xs{flex:1;box-sizing:border-box}.flex-gt-xs-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-xs-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-xs-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-xs-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-xs-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-xs-column>.flex-gt-xs-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-xs-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-xs-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-xs-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex-gt-xs-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-xs-row>.flex{min-width:0}.layout-gt-xs-column>.flex-gt-xs-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-xs-column>.flex-gt-xs-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-xs-column>.flex{min-height:0}.layout-gt-xs,.layout-gt-xs-column,.layout-gt-xs-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-xs-column{flex-direction:column}.layout-gt-xs-row{flex-direction:row}}@media(min-width: 600px)and (max-width: 959px){.hide:not(.show-gt-xs):not(.show-sm):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.hide-sm:not(.show-gt-xs):not(.show-sm):not(.show){display:none}.flex-order-sm--20{order:-20}.flex-order-sm--19{order:-19}.flex-order-sm--18{order:-18}.flex-order-sm--17{order:-17}.flex-order-sm--16{order:-16}.flex-order-sm--15{order:-15}.flex-order-sm--14{order:-14}.flex-order-sm--13{order:-13}.flex-order-sm--12{order:-12}.flex-order-sm--11{order:-11}.flex-order-sm--10{order:-10}.flex-order-sm--9{order:-9}.flex-order-sm--8{order:-8}.flex-order-sm--7{order:-7}.flex-order-sm--6{order:-6}.flex-order-sm--5{order:-5}.flex-order-sm--4{order:-4}.flex-order-sm--3{order:-3}.flex-order-sm--2{order:-2}.flex-order-sm--1{order:-1}.flex-order-sm-0{order:0}.flex-order-sm-1{order:1}.flex-order-sm-2{order:2}.flex-order-sm-3{order:3}.flex-order-sm-4{order:4}.flex-order-sm-5{order:5}.flex-order-sm-6{order:6}.flex-order-sm-7{order:7}.flex-order-sm-8{order:8}.flex-order-sm-9{order:9}.flex-order-sm-10{order:10}.flex-order-sm-11{order:11}.flex-order-sm-12{order:12}.flex-order-sm-13{order:13}.flex-order-sm-14{order:14}.flex-order-sm-15{order:15}.flex-order-sm-16{order:16}.flex-order-sm-17{order:17}.flex-order-sm-18{order:18}.flex-order-sm-19{order:19}.flex-order-sm-20{order:20}.offset-sm-0,.flex-offset-sm-0,.layout-margin .flex-offset-sm-0,.layout-margin .offset-sm-0{margin-left:0}[dir=rtl] .offset-sm-0,[dir=rtl] .flex-offset-sm-0,[dir=rtl] .layout-margin .flex-offset-sm-0,[dir=rtl] .layout-margin .offset-sm-0{margin-left:auto;margin-right:0}.offset-sm-5,.flex-offset-sm-5,.layout-margin .flex-offset-sm-5,.layout-margin .offset-sm-5{margin-left:5%}[dir=rtl] .offset-sm-5,[dir=rtl] .flex-offset-sm-5,[dir=rtl] .layout-margin .flex-offset-sm-5,[dir=rtl] .layout-margin .offset-sm-5{margin-left:auto;margin-right:5%}.offset-sm-10,.flex-offset-sm-10,.layout-margin .flex-offset-sm-10,.layout-margin .offset-sm-10{margin-left:10%}[dir=rtl] .offset-sm-10,[dir=rtl] .flex-offset-sm-10,[dir=rtl] .layout-margin .flex-offset-sm-10,[dir=rtl] .layout-margin .offset-sm-10{margin-left:auto;margin-right:10%}.offset-sm-15,.flex-offset-sm-15,.layout-margin .flex-offset-sm-15,.layout-margin .offset-sm-15{margin-left:15%}[dir=rtl] .offset-sm-15,[dir=rtl] .flex-offset-sm-15,[dir=rtl] .layout-margin .flex-offset-sm-15,[dir=rtl] .layout-margin .offset-sm-15{margin-left:auto;margin-right:15%}.offset-sm-20,.flex-offset-sm-20,.layout-margin .flex-offset-sm-20,.layout-margin .offset-sm-20{margin-left:20%}[dir=rtl] .offset-sm-20,[dir=rtl] .flex-offset-sm-20,[dir=rtl] .layout-margin .flex-offset-sm-20,[dir=rtl] .layout-margin .offset-sm-20{margin-left:auto;margin-right:20%}.offset-sm-25,.flex-offset-sm-25,.layout-margin .flex-offset-sm-25,.layout-margin .offset-sm-25{margin-left:25%}[dir=rtl] .offset-sm-25,[dir=rtl] .flex-offset-sm-25,[dir=rtl] .layout-margin .flex-offset-sm-25,[dir=rtl] .layout-margin .offset-sm-25{margin-left:auto;margin-right:25%}.offset-sm-30,.flex-offset-sm-30,.layout-margin .flex-offset-sm-30,.layout-margin .offset-sm-30{margin-left:30%}[dir=rtl] .offset-sm-30,[dir=rtl] .flex-offset-sm-30,[dir=rtl] .layout-margin .flex-offset-sm-30,[dir=rtl] .layout-margin .offset-sm-30{margin-left:auto;margin-right:30%}.offset-sm-35,.flex-offset-sm-35,.layout-margin .flex-offset-sm-35,.layout-margin .offset-sm-35{margin-left:35%}[dir=rtl] .offset-sm-35,[dir=rtl] .flex-offset-sm-35,[dir=rtl] .layout-margin .flex-offset-sm-35,[dir=rtl] .layout-margin .offset-sm-35{margin-left:auto;margin-right:35%}.offset-sm-40,.flex-offset-sm-40,.layout-margin .flex-offset-sm-40,.layout-margin .offset-sm-40{margin-left:40%}[dir=rtl] .offset-sm-40,[dir=rtl] .flex-offset-sm-40,[dir=rtl] .layout-margin .flex-offset-sm-40,[dir=rtl] .layout-margin .offset-sm-40{margin-left:auto;margin-right:40%}.offset-sm-45,.flex-offset-sm-45,.layout-margin .flex-offset-sm-45,.layout-margin .offset-sm-45{margin-left:45%}[dir=rtl] .offset-sm-45,[dir=rtl] .flex-offset-sm-45,[dir=rtl] .layout-margin .flex-offset-sm-45,[dir=rtl] .layout-margin .offset-sm-45{margin-left:auto;margin-right:45%}.offset-sm-50,.flex-offset-sm-50,.layout-margin .flex-offset-sm-50,.layout-margin .offset-sm-50{margin-left:50%}[dir=rtl] .offset-sm-50,[dir=rtl] .flex-offset-sm-50,[dir=rtl] .layout-margin .flex-offset-sm-50,[dir=rtl] .layout-margin .offset-sm-50{margin-left:auto;margin-right:50%}.offset-sm-55,.flex-offset-sm-55,.layout-margin .flex-offset-sm-55,.layout-margin .offset-sm-55{margin-left:55%}[dir=rtl] .offset-sm-55,[dir=rtl] .flex-offset-sm-55,[dir=rtl] .layout-margin .flex-offset-sm-55,[dir=rtl] .layout-margin .offset-sm-55{margin-left:auto;margin-right:55%}.offset-sm-60,.flex-offset-sm-60,.layout-margin .flex-offset-sm-60,.layout-margin .offset-sm-60{margin-left:60%}[dir=rtl] .offset-sm-60,[dir=rtl] .flex-offset-sm-60,[dir=rtl] .layout-margin .flex-offset-sm-60,[dir=rtl] .layout-margin .offset-sm-60{margin-left:auto;margin-right:60%}.offset-sm-65,.flex-offset-sm-65,.layout-margin .flex-offset-sm-65,.layout-margin .offset-sm-65{margin-left:65%}[dir=rtl] .offset-sm-65,[dir=rtl] .flex-offset-sm-65,[dir=rtl] .layout-margin .flex-offset-sm-65,[dir=rtl] .layout-margin .offset-sm-65{margin-left:auto;margin-right:65%}.offset-sm-70,.flex-offset-sm-70,.layout-margin .flex-offset-sm-70,.layout-margin .offset-sm-70{margin-left:70%}[dir=rtl] .offset-sm-70,[dir=rtl] .flex-offset-sm-70,[dir=rtl] .layout-margin .flex-offset-sm-70,[dir=rtl] .layout-margin .offset-sm-70{margin-left:auto;margin-right:70%}.offset-sm-75,.flex-offset-sm-75,.layout-margin .flex-offset-sm-75,.layout-margin .offset-sm-75{margin-left:75%}[dir=rtl] .offset-sm-75,[dir=rtl] .flex-offset-sm-75,[dir=rtl] .layout-margin .flex-offset-sm-75,[dir=rtl] .layout-margin .offset-sm-75{margin-left:auto;margin-right:75%}.offset-sm-80,.flex-offset-sm-80,.layout-margin .flex-offset-sm-80,.layout-margin .offset-sm-80{margin-left:80%}[dir=rtl] .offset-sm-80,[dir=rtl] .flex-offset-sm-80,[dir=rtl] .layout-margin .flex-offset-sm-80,[dir=rtl] .layout-margin .offset-sm-80{margin-left:auto;margin-right:80%}.offset-sm-85,.flex-offset-sm-85,.layout-margin .flex-offset-sm-85,.layout-margin .offset-sm-85{margin-left:85%}[dir=rtl] .offset-sm-85,[dir=rtl] .flex-offset-sm-85,[dir=rtl] .layout-margin .flex-offset-sm-85,[dir=rtl] .layout-margin .offset-sm-85{margin-left:auto;margin-right:85%}.offset-sm-90,.flex-offset-sm-90,.layout-margin .flex-offset-sm-90,.layout-margin .offset-sm-90{margin-left:90%}[dir=rtl] .offset-sm-90,[dir=rtl] .flex-offset-sm-90,[dir=rtl] .layout-margin .flex-offset-sm-90,[dir=rtl] .layout-margin .offset-sm-90{margin-left:auto;margin-right:90%}.offset-sm-95,.flex-offset-sm-95,.layout-margin .flex-offset-sm-95,.layout-margin .offset-sm-95{margin-left:95%}[dir=rtl] .offset-sm-95,[dir=rtl] .flex-offset-sm-95,[dir=rtl] .layout-margin .flex-offset-sm-95,[dir=rtl] .layout-margin .offset-sm-95{margin-left:auto;margin-right:95%}.offset-sm-33,.flex-offset-sm-33,.layout-margin .flex-offset-sm-33,.layout-margin .offset-sm-33{margin-left:33.3333333333%}.offset-sm-66,.flex-offset-sm-66,.layout-margin .flex-offset-sm-66,.layout-margin .offset-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-sm-66,[dir=rtl] .flex-offset-sm-66,[dir=rtl] .layout-margin .flex-offset-sm-66,[dir=rtl] .layout-margin .offset-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-sm,.layout-align-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-sm-start,.layout-align-sm-start-start,.layout-align-sm-start-center,.layout-align-sm-start-end,.layout-align-sm-start-stretch{justify-content:flex-start}.layout-align-sm-center,.layout-align-sm-center-start,.layout-align-sm-center-center,.layout-align-sm-center-end,.layout-align-sm-center-stretch{justify-content:center}.layout-align-sm-end,.layout-align-sm-end-start,.layout-align-sm-end-center,.layout-align-sm-end-end,.layout-align-sm-end-stretch{justify-content:flex-end}.layout-align-sm-space-around,.layout-align-sm-space-around-center,.layout-align-sm-space-around-start,.layout-align-sm-space-around-end,.layout-align-sm-space-around-stretch{justify-content:space-around}.layout-align-sm-space-between,.layout-align-sm-space-between-center,.layout-align-sm-space-between-start,.layout-align-sm-space-between-end,.layout-align-sm-space-between-stretch{justify-content:space-between}.layout-align-sm-start-start,.layout-align-sm-center-start,.layout-align-sm-end-start,.layout-align-sm-space-between-start,.layout-align-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-sm-start-center,.layout-align-sm-center-center,.layout-align-sm-end-center,.layout-align-sm-space-between-center,.layout-align-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-sm-start-center>*,.layout-align-sm-center-center>*,.layout-align-sm-end-center>*,.layout-align-sm-space-between-center>*,.layout-align-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-sm-start-end,.layout-align-sm-center-end,.layout-align-sm-end-end,.layout-align-sm-space-between-end,.layout-align-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-sm-start-stretch,.layout-align-sm-center-stretch,.layout-align-sm-end-stretch,.layout-align-sm-space-between-stretch,.layout-align-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-sm{flex:1;box-sizing:border-box}.flex-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-sm-row>.flex-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-sm-column>.flex-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-sm-row>.flex-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-sm-row>.flex-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-sm-row>.flex-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-sm-row>.flex-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-sm-row>.flex-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-sm-row>.flex-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-sm-row>.flex-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-sm-row>.flex-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-sm-row>.flex-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-sm-row>.flex-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-sm-row>.flex-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-sm-row>.flex-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-sm-row>.flex-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-sm-row>.flex-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-sm-row>.flex-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-sm-row>.flex-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-sm-row>.flex-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-sm-row>.flex-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-sm-row>.flex-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-sm-column>.flex-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-row>.flex-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-sm-row>.flex{min-width:0}.layout-sm-column>.flex-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-sm-column>.flex-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-sm-column>.flex{min-height:0}.layout-sm,.layout-sm-column,.layout-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-sm-column{flex-direction:column}.layout-sm-row{flex-direction:row}}@media(min-width: 960px){.flex-order-gt-sm--20{order:-20}.flex-order-gt-sm--19{order:-19}.flex-order-gt-sm--18{order:-18}.flex-order-gt-sm--17{order:-17}.flex-order-gt-sm--16{order:-16}.flex-order-gt-sm--15{order:-15}.flex-order-gt-sm--14{order:-14}.flex-order-gt-sm--13{order:-13}.flex-order-gt-sm--12{order:-12}.flex-order-gt-sm--11{order:-11}.flex-order-gt-sm--10{order:-10}.flex-order-gt-sm--9{order:-9}.flex-order-gt-sm--8{order:-8}.flex-order-gt-sm--7{order:-7}.flex-order-gt-sm--6{order:-6}.flex-order-gt-sm--5{order:-5}.flex-order-gt-sm--4{order:-4}.flex-order-gt-sm--3{order:-3}.flex-order-gt-sm--2{order:-2}.flex-order-gt-sm--1{order:-1}.flex-order-gt-sm-0{order:0}.flex-order-gt-sm-1{order:1}.flex-order-gt-sm-2{order:2}.flex-order-gt-sm-3{order:3}.flex-order-gt-sm-4{order:4}.flex-order-gt-sm-5{order:5}.flex-order-gt-sm-6{order:6}.flex-order-gt-sm-7{order:7}.flex-order-gt-sm-8{order:8}.flex-order-gt-sm-9{order:9}.flex-order-gt-sm-10{order:10}.flex-order-gt-sm-11{order:11}.flex-order-gt-sm-12{order:12}.flex-order-gt-sm-13{order:13}.flex-order-gt-sm-14{order:14}.flex-order-gt-sm-15{order:15}.flex-order-gt-sm-16{order:16}.flex-order-gt-sm-17{order:17}.flex-order-gt-sm-18{order:18}.flex-order-gt-sm-19{order:19}.flex-order-gt-sm-20{order:20}.offset-gt-sm-0,.flex-offset-gt-sm-0,.layout-margin .flex-offset-gt-sm-0,.layout-margin .offset-gt-sm-0{margin-left:0}[dir=rtl] .offset-gt-sm-0,[dir=rtl] .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .flex-offset-gt-sm-0,[dir=rtl] .layout-margin .offset-gt-sm-0{margin-left:auto;margin-right:0}.offset-gt-sm-5,.flex-offset-gt-sm-5,.layout-margin .flex-offset-gt-sm-5,.layout-margin .offset-gt-sm-5{margin-left:5%}[dir=rtl] .offset-gt-sm-5,[dir=rtl] .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .flex-offset-gt-sm-5,[dir=rtl] .layout-margin .offset-gt-sm-5{margin-left:auto;margin-right:5%}.offset-gt-sm-10,.flex-offset-gt-sm-10,.layout-margin .flex-offset-gt-sm-10,.layout-margin .offset-gt-sm-10{margin-left:10%}[dir=rtl] .offset-gt-sm-10,[dir=rtl] .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .flex-offset-gt-sm-10,[dir=rtl] .layout-margin .offset-gt-sm-10{margin-left:auto;margin-right:10%}.offset-gt-sm-15,.flex-offset-gt-sm-15,.layout-margin .flex-offset-gt-sm-15,.layout-margin .offset-gt-sm-15{margin-left:15%}[dir=rtl] .offset-gt-sm-15,[dir=rtl] .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .flex-offset-gt-sm-15,[dir=rtl] .layout-margin .offset-gt-sm-15{margin-left:auto;margin-right:15%}.offset-gt-sm-20,.flex-offset-gt-sm-20,.layout-margin .flex-offset-gt-sm-20,.layout-margin .offset-gt-sm-20{margin-left:20%}[dir=rtl] .offset-gt-sm-20,[dir=rtl] .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .flex-offset-gt-sm-20,[dir=rtl] .layout-margin .offset-gt-sm-20{margin-left:auto;margin-right:20%}.offset-gt-sm-25,.flex-offset-gt-sm-25,.layout-margin .flex-offset-gt-sm-25,.layout-margin .offset-gt-sm-25{margin-left:25%}[dir=rtl] .offset-gt-sm-25,[dir=rtl] .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .flex-offset-gt-sm-25,[dir=rtl] .layout-margin .offset-gt-sm-25{margin-left:auto;margin-right:25%}.offset-gt-sm-30,.flex-offset-gt-sm-30,.layout-margin .flex-offset-gt-sm-30,.layout-margin .offset-gt-sm-30{margin-left:30%}[dir=rtl] .offset-gt-sm-30,[dir=rtl] .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .flex-offset-gt-sm-30,[dir=rtl] .layout-margin .offset-gt-sm-30{margin-left:auto;margin-right:30%}.offset-gt-sm-35,.flex-offset-gt-sm-35,.layout-margin .flex-offset-gt-sm-35,.layout-margin .offset-gt-sm-35{margin-left:35%}[dir=rtl] .offset-gt-sm-35,[dir=rtl] .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .flex-offset-gt-sm-35,[dir=rtl] .layout-margin .offset-gt-sm-35{margin-left:auto;margin-right:35%}.offset-gt-sm-40,.flex-offset-gt-sm-40,.layout-margin .flex-offset-gt-sm-40,.layout-margin .offset-gt-sm-40{margin-left:40%}[dir=rtl] .offset-gt-sm-40,[dir=rtl] .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .flex-offset-gt-sm-40,[dir=rtl] .layout-margin .offset-gt-sm-40{margin-left:auto;margin-right:40%}.offset-gt-sm-45,.flex-offset-gt-sm-45,.layout-margin .flex-offset-gt-sm-45,.layout-margin .offset-gt-sm-45{margin-left:45%}[dir=rtl] .offset-gt-sm-45,[dir=rtl] .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .flex-offset-gt-sm-45,[dir=rtl] .layout-margin .offset-gt-sm-45{margin-left:auto;margin-right:45%}.offset-gt-sm-50,.flex-offset-gt-sm-50,.layout-margin .flex-offset-gt-sm-50,.layout-margin .offset-gt-sm-50{margin-left:50%}[dir=rtl] .offset-gt-sm-50,[dir=rtl] .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .flex-offset-gt-sm-50,[dir=rtl] .layout-margin .offset-gt-sm-50{margin-left:auto;margin-right:50%}.offset-gt-sm-55,.flex-offset-gt-sm-55,.layout-margin .flex-offset-gt-sm-55,.layout-margin .offset-gt-sm-55{margin-left:55%}[dir=rtl] .offset-gt-sm-55,[dir=rtl] .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .flex-offset-gt-sm-55,[dir=rtl] .layout-margin .offset-gt-sm-55{margin-left:auto;margin-right:55%}.offset-gt-sm-60,.flex-offset-gt-sm-60,.layout-margin .flex-offset-gt-sm-60,.layout-margin .offset-gt-sm-60{margin-left:60%}[dir=rtl] .offset-gt-sm-60,[dir=rtl] .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .flex-offset-gt-sm-60,[dir=rtl] .layout-margin .offset-gt-sm-60{margin-left:auto;margin-right:60%}.offset-gt-sm-65,.flex-offset-gt-sm-65,.layout-margin .flex-offset-gt-sm-65,.layout-margin .offset-gt-sm-65{margin-left:65%}[dir=rtl] .offset-gt-sm-65,[dir=rtl] .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .flex-offset-gt-sm-65,[dir=rtl] .layout-margin .offset-gt-sm-65{margin-left:auto;margin-right:65%}.offset-gt-sm-70,.flex-offset-gt-sm-70,.layout-margin .flex-offset-gt-sm-70,.layout-margin .offset-gt-sm-70{margin-left:70%}[dir=rtl] .offset-gt-sm-70,[dir=rtl] .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .flex-offset-gt-sm-70,[dir=rtl] .layout-margin .offset-gt-sm-70{margin-left:auto;margin-right:70%}.offset-gt-sm-75,.flex-offset-gt-sm-75,.layout-margin .flex-offset-gt-sm-75,.layout-margin .offset-gt-sm-75{margin-left:75%}[dir=rtl] .offset-gt-sm-75,[dir=rtl] .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .flex-offset-gt-sm-75,[dir=rtl] .layout-margin .offset-gt-sm-75{margin-left:auto;margin-right:75%}.offset-gt-sm-80,.flex-offset-gt-sm-80,.layout-margin .flex-offset-gt-sm-80,.layout-margin .offset-gt-sm-80{margin-left:80%}[dir=rtl] .offset-gt-sm-80,[dir=rtl] .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .flex-offset-gt-sm-80,[dir=rtl] .layout-margin .offset-gt-sm-80{margin-left:auto;margin-right:80%}.offset-gt-sm-85,.flex-offset-gt-sm-85,.layout-margin .flex-offset-gt-sm-85,.layout-margin .offset-gt-sm-85{margin-left:85%}[dir=rtl] .offset-gt-sm-85,[dir=rtl] .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .flex-offset-gt-sm-85,[dir=rtl] .layout-margin .offset-gt-sm-85{margin-left:auto;margin-right:85%}.offset-gt-sm-90,.flex-offset-gt-sm-90,.layout-margin .flex-offset-gt-sm-90,.layout-margin .offset-gt-sm-90{margin-left:90%}[dir=rtl] .offset-gt-sm-90,[dir=rtl] .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .flex-offset-gt-sm-90,[dir=rtl] .layout-margin .offset-gt-sm-90{margin-left:auto;margin-right:90%}.offset-gt-sm-95,.flex-offset-gt-sm-95,.layout-margin .flex-offset-gt-sm-95,.layout-margin .offset-gt-sm-95{margin-left:95%}[dir=rtl] .offset-gt-sm-95,[dir=rtl] .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .flex-offset-gt-sm-95,[dir=rtl] .layout-margin .offset-gt-sm-95{margin-left:auto;margin-right:95%}.offset-gt-sm-33,.flex-offset-gt-sm-33,.layout-margin .flex-offset-gt-sm-33,.layout-margin .offset-gt-sm-33{margin-left:33.3333333333%}.offset-gt-sm-66,.flex-offset-gt-sm-66,.layout-margin .flex-offset-gt-sm-66,.layout-margin .offset-gt-sm-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-sm-66,[dir=rtl] .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .flex-offset-gt-sm-66,[dir=rtl] .layout-margin .offset-gt-sm-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-sm,.layout-align-gt-sm-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-sm-start,.layout-align-gt-sm-start-start,.layout-align-gt-sm-start-center,.layout-align-gt-sm-start-end,.layout-align-gt-sm-start-stretch{justify-content:flex-start}.layout-align-gt-sm-center,.layout-align-gt-sm-center-start,.layout-align-gt-sm-center-center,.layout-align-gt-sm-center-end,.layout-align-gt-sm-center-stretch{justify-content:center}.layout-align-gt-sm-end,.layout-align-gt-sm-end-start,.layout-align-gt-sm-end-center,.layout-align-gt-sm-end-end,.layout-align-gt-sm-end-stretch{justify-content:flex-end}.layout-align-gt-sm-space-around,.layout-align-gt-sm-space-around-center,.layout-align-gt-sm-space-around-start,.layout-align-gt-sm-space-around-end,.layout-align-gt-sm-space-around-stretch{justify-content:space-around}.layout-align-gt-sm-space-between,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-between-stretch{justify-content:space-between}.layout-align-gt-sm-start-start,.layout-align-gt-sm-center-start,.layout-align-gt-sm-end-start,.layout-align-gt-sm-space-between-start,.layout-align-gt-sm-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-sm-start-center,.layout-align-gt-sm-center-center,.layout-align-gt-sm-end-center,.layout-align-gt-sm-space-between-center,.layout-align-gt-sm-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-sm-start-center>*,.layout-align-gt-sm-center-center>*,.layout-align-gt-sm-end-center>*,.layout-align-gt-sm-space-between-center>*,.layout-align-gt-sm-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-sm-start-end,.layout-align-gt-sm-center-end,.layout-align-gt-sm-end-end,.layout-align-gt-sm-space-between-end,.layout-align-gt-sm-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-sm-start-stretch,.layout-align-gt-sm-center-stretch,.layout-align-gt-sm-end-stretch,.layout-align-gt-sm-space-between-stretch,.layout-align-gt-sm-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-sm{flex:1;box-sizing:border-box}.flex-gt-sm-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-sm-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-sm-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-sm-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-sm-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-sm-column>.flex-gt-sm-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-sm-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-sm-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-sm-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex-gt-sm-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-sm-row>.flex{min-width:0}.layout-gt-sm-column>.flex-gt-sm-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-sm-column>.flex-gt-sm-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-sm-column>.flex{min-height:0}.layout-gt-sm,.layout-gt-sm-column,.layout-gt-sm-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-sm-column{flex-direction:column}.layout-gt-sm-row{flex-direction:row}}@media(min-width: 960px)and (max-width: 1279px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show){display:none}.hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-md--20{order:-20}.flex-order-md--19{order:-19}.flex-order-md--18{order:-18}.flex-order-md--17{order:-17}.flex-order-md--16{order:-16}.flex-order-md--15{order:-15}.flex-order-md--14{order:-14}.flex-order-md--13{order:-13}.flex-order-md--12{order:-12}.flex-order-md--11{order:-11}.flex-order-md--10{order:-10}.flex-order-md--9{order:-9}.flex-order-md--8{order:-8}.flex-order-md--7{order:-7}.flex-order-md--6{order:-6}.flex-order-md--5{order:-5}.flex-order-md--4{order:-4}.flex-order-md--3{order:-3}.flex-order-md--2{order:-2}.flex-order-md--1{order:-1}.flex-order-md-0{order:0}.flex-order-md-1{order:1}.flex-order-md-2{order:2}.flex-order-md-3{order:3}.flex-order-md-4{order:4}.flex-order-md-5{order:5}.flex-order-md-6{order:6}.flex-order-md-7{order:7}.flex-order-md-8{order:8}.flex-order-md-9{order:9}.flex-order-md-10{order:10}.flex-order-md-11{order:11}.flex-order-md-12{order:12}.flex-order-md-13{order:13}.flex-order-md-14{order:14}.flex-order-md-15{order:15}.flex-order-md-16{order:16}.flex-order-md-17{order:17}.flex-order-md-18{order:18}.flex-order-md-19{order:19}.flex-order-md-20{order:20}.offset-md-0,.flex-offset-md-0,.layout-margin .flex-offset-md-0,.layout-margin .offset-md-0{margin-left:0}[dir=rtl] .offset-md-0,[dir=rtl] .flex-offset-md-0,[dir=rtl] .layout-margin .flex-offset-md-0,[dir=rtl] .layout-margin .offset-md-0{margin-left:auto;margin-right:0}.offset-md-5,.flex-offset-md-5,.layout-margin .flex-offset-md-5,.layout-margin .offset-md-5{margin-left:5%}[dir=rtl] .offset-md-5,[dir=rtl] .flex-offset-md-5,[dir=rtl] .layout-margin .flex-offset-md-5,[dir=rtl] .layout-margin .offset-md-5{margin-left:auto;margin-right:5%}.offset-md-10,.flex-offset-md-10,.layout-margin .flex-offset-md-10,.layout-margin .offset-md-10{margin-left:10%}[dir=rtl] .offset-md-10,[dir=rtl] .flex-offset-md-10,[dir=rtl] .layout-margin .flex-offset-md-10,[dir=rtl] .layout-margin .offset-md-10{margin-left:auto;margin-right:10%}.offset-md-15,.flex-offset-md-15,.layout-margin .flex-offset-md-15,.layout-margin .offset-md-15{margin-left:15%}[dir=rtl] .offset-md-15,[dir=rtl] .flex-offset-md-15,[dir=rtl] .layout-margin .flex-offset-md-15,[dir=rtl] .layout-margin .offset-md-15{margin-left:auto;margin-right:15%}.offset-md-20,.flex-offset-md-20,.layout-margin .flex-offset-md-20,.layout-margin .offset-md-20{margin-left:20%}[dir=rtl] .offset-md-20,[dir=rtl] .flex-offset-md-20,[dir=rtl] .layout-margin .flex-offset-md-20,[dir=rtl] .layout-margin .offset-md-20{margin-left:auto;margin-right:20%}.offset-md-25,.flex-offset-md-25,.layout-margin .flex-offset-md-25,.layout-margin .offset-md-25{margin-left:25%}[dir=rtl] .offset-md-25,[dir=rtl] .flex-offset-md-25,[dir=rtl] .layout-margin .flex-offset-md-25,[dir=rtl] .layout-margin .offset-md-25{margin-left:auto;margin-right:25%}.offset-md-30,.flex-offset-md-30,.layout-margin .flex-offset-md-30,.layout-margin .offset-md-30{margin-left:30%}[dir=rtl] .offset-md-30,[dir=rtl] .flex-offset-md-30,[dir=rtl] .layout-margin .flex-offset-md-30,[dir=rtl] .layout-margin .offset-md-30{margin-left:auto;margin-right:30%}.offset-md-35,.flex-offset-md-35,.layout-margin .flex-offset-md-35,.layout-margin .offset-md-35{margin-left:35%}[dir=rtl] .offset-md-35,[dir=rtl] .flex-offset-md-35,[dir=rtl] .layout-margin .flex-offset-md-35,[dir=rtl] .layout-margin .offset-md-35{margin-left:auto;margin-right:35%}.offset-md-40,.flex-offset-md-40,.layout-margin .flex-offset-md-40,.layout-margin .offset-md-40{margin-left:40%}[dir=rtl] .offset-md-40,[dir=rtl] .flex-offset-md-40,[dir=rtl] .layout-margin .flex-offset-md-40,[dir=rtl] .layout-margin .offset-md-40{margin-left:auto;margin-right:40%}.offset-md-45,.flex-offset-md-45,.layout-margin .flex-offset-md-45,.layout-margin .offset-md-45{margin-left:45%}[dir=rtl] .offset-md-45,[dir=rtl] .flex-offset-md-45,[dir=rtl] .layout-margin .flex-offset-md-45,[dir=rtl] .layout-margin .offset-md-45{margin-left:auto;margin-right:45%}.offset-md-50,.flex-offset-md-50,.layout-margin .flex-offset-md-50,.layout-margin .offset-md-50{margin-left:50%}[dir=rtl] .offset-md-50,[dir=rtl] .flex-offset-md-50,[dir=rtl] .layout-margin .flex-offset-md-50,[dir=rtl] .layout-margin .offset-md-50{margin-left:auto;margin-right:50%}.offset-md-55,.flex-offset-md-55,.layout-margin .flex-offset-md-55,.layout-margin .offset-md-55{margin-left:55%}[dir=rtl] .offset-md-55,[dir=rtl] .flex-offset-md-55,[dir=rtl] .layout-margin .flex-offset-md-55,[dir=rtl] .layout-margin .offset-md-55{margin-left:auto;margin-right:55%}.offset-md-60,.flex-offset-md-60,.layout-margin .flex-offset-md-60,.layout-margin .offset-md-60{margin-left:60%}[dir=rtl] .offset-md-60,[dir=rtl] .flex-offset-md-60,[dir=rtl] .layout-margin .flex-offset-md-60,[dir=rtl] .layout-margin .offset-md-60{margin-left:auto;margin-right:60%}.offset-md-65,.flex-offset-md-65,.layout-margin .flex-offset-md-65,.layout-margin .offset-md-65{margin-left:65%}[dir=rtl] .offset-md-65,[dir=rtl] .flex-offset-md-65,[dir=rtl] .layout-margin .flex-offset-md-65,[dir=rtl] .layout-margin .offset-md-65{margin-left:auto;margin-right:65%}.offset-md-70,.flex-offset-md-70,.layout-margin .flex-offset-md-70,.layout-margin .offset-md-70{margin-left:70%}[dir=rtl] .offset-md-70,[dir=rtl] .flex-offset-md-70,[dir=rtl] .layout-margin .flex-offset-md-70,[dir=rtl] .layout-margin .offset-md-70{margin-left:auto;margin-right:70%}.offset-md-75,.flex-offset-md-75,.layout-margin .flex-offset-md-75,.layout-margin .offset-md-75{margin-left:75%}[dir=rtl] .offset-md-75,[dir=rtl] .flex-offset-md-75,[dir=rtl] .layout-margin .flex-offset-md-75,[dir=rtl] .layout-margin .offset-md-75{margin-left:auto;margin-right:75%}.offset-md-80,.flex-offset-md-80,.layout-margin .flex-offset-md-80,.layout-margin .offset-md-80{margin-left:80%}[dir=rtl] .offset-md-80,[dir=rtl] .flex-offset-md-80,[dir=rtl] .layout-margin .flex-offset-md-80,[dir=rtl] .layout-margin .offset-md-80{margin-left:auto;margin-right:80%}.offset-md-85,.flex-offset-md-85,.layout-margin .flex-offset-md-85,.layout-margin .offset-md-85{margin-left:85%}[dir=rtl] .offset-md-85,[dir=rtl] .flex-offset-md-85,[dir=rtl] .layout-margin .flex-offset-md-85,[dir=rtl] .layout-margin .offset-md-85{margin-left:auto;margin-right:85%}.offset-md-90,.flex-offset-md-90,.layout-margin .flex-offset-md-90,.layout-margin .offset-md-90{margin-left:90%}[dir=rtl] .offset-md-90,[dir=rtl] .flex-offset-md-90,[dir=rtl] .layout-margin .flex-offset-md-90,[dir=rtl] .layout-margin .offset-md-90{margin-left:auto;margin-right:90%}.offset-md-95,.flex-offset-md-95,.layout-margin .flex-offset-md-95,.layout-margin .offset-md-95{margin-left:95%}[dir=rtl] .offset-md-95,[dir=rtl] .flex-offset-md-95,[dir=rtl] .layout-margin .flex-offset-md-95,[dir=rtl] .layout-margin .offset-md-95{margin-left:auto;margin-right:95%}.offset-md-33,.flex-offset-md-33,.layout-margin .flex-offset-md-33,.layout-margin .offset-md-33{margin-left:33.3333333333%}.offset-md-66,.flex-offset-md-66,.layout-margin .flex-offset-md-66,.layout-margin .offset-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-md-66,[dir=rtl] .flex-offset-md-66,[dir=rtl] .layout-margin .flex-offset-md-66,[dir=rtl] .layout-margin .offset-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-md,.layout-align-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-md-start,.layout-align-md-start-start,.layout-align-md-start-center,.layout-align-md-start-end,.layout-align-md-start-stretch{justify-content:flex-start}.layout-align-md-center,.layout-align-md-center-start,.layout-align-md-center-center,.layout-align-md-center-end,.layout-align-md-center-stretch{justify-content:center}.layout-align-md-end,.layout-align-md-end-start,.layout-align-md-end-center,.layout-align-md-end-end,.layout-align-md-end-stretch{justify-content:flex-end}.layout-align-md-space-around,.layout-align-md-space-around-center,.layout-align-md-space-around-start,.layout-align-md-space-around-end,.layout-align-md-space-around-stretch{justify-content:space-around}.layout-align-md-space-between,.layout-align-md-space-between-center,.layout-align-md-space-between-start,.layout-align-md-space-between-end,.layout-align-md-space-between-stretch{justify-content:space-between}.layout-align-md-start-start,.layout-align-md-center-start,.layout-align-md-end-start,.layout-align-md-space-between-start,.layout-align-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-md-start-center,.layout-align-md-center-center,.layout-align-md-end-center,.layout-align-md-space-between-center,.layout-align-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-md-start-center>*,.layout-align-md-center-center>*,.layout-align-md-end-center>*,.layout-align-md-space-between-center>*,.layout-align-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-md-start-end,.layout-align-md-center-end,.layout-align-md-end-end,.layout-align-md-space-between-end,.layout-align-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-md-start-stretch,.layout-align-md-center-stretch,.layout-align-md-end-stretch,.layout-align-md-space-between-stretch,.layout-align-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-md{flex:1;box-sizing:border-box}.flex-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-md-none{flex:0 0 auto;box-sizing:border-box}.flex-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-md-row>.flex-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-md-column>.flex-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-md-row>.flex-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-md-row>.flex-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-md-row>.flex-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-md-row>.flex-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-md-row>.flex-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-md-row>.flex-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-md-row>.flex-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-md-row>.flex-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-md-row>.flex-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-md-row>.flex-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-md-row>.flex-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-md-row>.flex-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-md-row>.flex-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-md-row>.flex-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-md-row>.flex-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-md-row>.flex-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-md-row>.flex-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-md-row>.flex-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-md-row>.flex-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-md-column>.flex-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-row>.flex-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-md-row>.flex{min-width:0}.layout-md-column>.flex-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-md-column>.flex-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-md-column>.flex{min-height:0}.layout-md,.layout-md-column,.layout-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-md-column{flex-direction:column}.layout-md-row{flex-direction:row}}@media(min-width: 1280px){.flex-order-gt-md--20{order:-20}.flex-order-gt-md--19{order:-19}.flex-order-gt-md--18{order:-18}.flex-order-gt-md--17{order:-17}.flex-order-gt-md--16{order:-16}.flex-order-gt-md--15{order:-15}.flex-order-gt-md--14{order:-14}.flex-order-gt-md--13{order:-13}.flex-order-gt-md--12{order:-12}.flex-order-gt-md--11{order:-11}.flex-order-gt-md--10{order:-10}.flex-order-gt-md--9{order:-9}.flex-order-gt-md--8{order:-8}.flex-order-gt-md--7{order:-7}.flex-order-gt-md--6{order:-6}.flex-order-gt-md--5{order:-5}.flex-order-gt-md--4{order:-4}.flex-order-gt-md--3{order:-3}.flex-order-gt-md--2{order:-2}.flex-order-gt-md--1{order:-1}.flex-order-gt-md-0{order:0}.flex-order-gt-md-1{order:1}.flex-order-gt-md-2{order:2}.flex-order-gt-md-3{order:3}.flex-order-gt-md-4{order:4}.flex-order-gt-md-5{order:5}.flex-order-gt-md-6{order:6}.flex-order-gt-md-7{order:7}.flex-order-gt-md-8{order:8}.flex-order-gt-md-9{order:9}.flex-order-gt-md-10{order:10}.flex-order-gt-md-11{order:11}.flex-order-gt-md-12{order:12}.flex-order-gt-md-13{order:13}.flex-order-gt-md-14{order:14}.flex-order-gt-md-15{order:15}.flex-order-gt-md-16{order:16}.flex-order-gt-md-17{order:17}.flex-order-gt-md-18{order:18}.flex-order-gt-md-19{order:19}.flex-order-gt-md-20{order:20}.offset-gt-md-0,.flex-offset-gt-md-0,.layout-margin .flex-offset-gt-md-0,.layout-margin .offset-gt-md-0{margin-left:0}[dir=rtl] .offset-gt-md-0,[dir=rtl] .flex-offset-gt-md-0,[dir=rtl] .layout-margin .flex-offset-gt-md-0,[dir=rtl] .layout-margin .offset-gt-md-0{margin-left:auto;margin-right:0}.offset-gt-md-5,.flex-offset-gt-md-5,.layout-margin .flex-offset-gt-md-5,.layout-margin .offset-gt-md-5{margin-left:5%}[dir=rtl] .offset-gt-md-5,[dir=rtl] .flex-offset-gt-md-5,[dir=rtl] .layout-margin .flex-offset-gt-md-5,[dir=rtl] .layout-margin .offset-gt-md-5{margin-left:auto;margin-right:5%}.offset-gt-md-10,.flex-offset-gt-md-10,.layout-margin .flex-offset-gt-md-10,.layout-margin .offset-gt-md-10{margin-left:10%}[dir=rtl] .offset-gt-md-10,[dir=rtl] .flex-offset-gt-md-10,[dir=rtl] .layout-margin .flex-offset-gt-md-10,[dir=rtl] .layout-margin .offset-gt-md-10{margin-left:auto;margin-right:10%}.offset-gt-md-15,.flex-offset-gt-md-15,.layout-margin .flex-offset-gt-md-15,.layout-margin .offset-gt-md-15{margin-left:15%}[dir=rtl] .offset-gt-md-15,[dir=rtl] .flex-offset-gt-md-15,[dir=rtl] .layout-margin .flex-offset-gt-md-15,[dir=rtl] .layout-margin .offset-gt-md-15{margin-left:auto;margin-right:15%}.offset-gt-md-20,.flex-offset-gt-md-20,.layout-margin .flex-offset-gt-md-20,.layout-margin .offset-gt-md-20{margin-left:20%}[dir=rtl] .offset-gt-md-20,[dir=rtl] .flex-offset-gt-md-20,[dir=rtl] .layout-margin .flex-offset-gt-md-20,[dir=rtl] .layout-margin .offset-gt-md-20{margin-left:auto;margin-right:20%}.offset-gt-md-25,.flex-offset-gt-md-25,.layout-margin .flex-offset-gt-md-25,.layout-margin .offset-gt-md-25{margin-left:25%}[dir=rtl] .offset-gt-md-25,[dir=rtl] .flex-offset-gt-md-25,[dir=rtl] .layout-margin .flex-offset-gt-md-25,[dir=rtl] .layout-margin .offset-gt-md-25{margin-left:auto;margin-right:25%}.offset-gt-md-30,.flex-offset-gt-md-30,.layout-margin .flex-offset-gt-md-30,.layout-margin .offset-gt-md-30{margin-left:30%}[dir=rtl] .offset-gt-md-30,[dir=rtl] .flex-offset-gt-md-30,[dir=rtl] .layout-margin .flex-offset-gt-md-30,[dir=rtl] .layout-margin .offset-gt-md-30{margin-left:auto;margin-right:30%}.offset-gt-md-35,.flex-offset-gt-md-35,.layout-margin .flex-offset-gt-md-35,.layout-margin .offset-gt-md-35{margin-left:35%}[dir=rtl] .offset-gt-md-35,[dir=rtl] .flex-offset-gt-md-35,[dir=rtl] .layout-margin .flex-offset-gt-md-35,[dir=rtl] .layout-margin .offset-gt-md-35{margin-left:auto;margin-right:35%}.offset-gt-md-40,.flex-offset-gt-md-40,.layout-margin .flex-offset-gt-md-40,.layout-margin .offset-gt-md-40{margin-left:40%}[dir=rtl] .offset-gt-md-40,[dir=rtl] .flex-offset-gt-md-40,[dir=rtl] .layout-margin .flex-offset-gt-md-40,[dir=rtl] .layout-margin .offset-gt-md-40{margin-left:auto;margin-right:40%}.offset-gt-md-45,.flex-offset-gt-md-45,.layout-margin .flex-offset-gt-md-45,.layout-margin .offset-gt-md-45{margin-left:45%}[dir=rtl] .offset-gt-md-45,[dir=rtl] .flex-offset-gt-md-45,[dir=rtl] .layout-margin .flex-offset-gt-md-45,[dir=rtl] .layout-margin .offset-gt-md-45{margin-left:auto;margin-right:45%}.offset-gt-md-50,.flex-offset-gt-md-50,.layout-margin .flex-offset-gt-md-50,.layout-margin .offset-gt-md-50{margin-left:50%}[dir=rtl] .offset-gt-md-50,[dir=rtl] .flex-offset-gt-md-50,[dir=rtl] .layout-margin .flex-offset-gt-md-50,[dir=rtl] .layout-margin .offset-gt-md-50{margin-left:auto;margin-right:50%}.offset-gt-md-55,.flex-offset-gt-md-55,.layout-margin .flex-offset-gt-md-55,.layout-margin .offset-gt-md-55{margin-left:55%}[dir=rtl] .offset-gt-md-55,[dir=rtl] .flex-offset-gt-md-55,[dir=rtl] .layout-margin .flex-offset-gt-md-55,[dir=rtl] .layout-margin .offset-gt-md-55{margin-left:auto;margin-right:55%}.offset-gt-md-60,.flex-offset-gt-md-60,.layout-margin .flex-offset-gt-md-60,.layout-margin .offset-gt-md-60{margin-left:60%}[dir=rtl] .offset-gt-md-60,[dir=rtl] .flex-offset-gt-md-60,[dir=rtl] .layout-margin .flex-offset-gt-md-60,[dir=rtl] .layout-margin .offset-gt-md-60{margin-left:auto;margin-right:60%}.offset-gt-md-65,.flex-offset-gt-md-65,.layout-margin .flex-offset-gt-md-65,.layout-margin .offset-gt-md-65{margin-left:65%}[dir=rtl] .offset-gt-md-65,[dir=rtl] .flex-offset-gt-md-65,[dir=rtl] .layout-margin .flex-offset-gt-md-65,[dir=rtl] .layout-margin .offset-gt-md-65{margin-left:auto;margin-right:65%}.offset-gt-md-70,.flex-offset-gt-md-70,.layout-margin .flex-offset-gt-md-70,.layout-margin .offset-gt-md-70{margin-left:70%}[dir=rtl] .offset-gt-md-70,[dir=rtl] .flex-offset-gt-md-70,[dir=rtl] .layout-margin .flex-offset-gt-md-70,[dir=rtl] .layout-margin .offset-gt-md-70{margin-left:auto;margin-right:70%}.offset-gt-md-75,.flex-offset-gt-md-75,.layout-margin .flex-offset-gt-md-75,.layout-margin .offset-gt-md-75{margin-left:75%}[dir=rtl] .offset-gt-md-75,[dir=rtl] .flex-offset-gt-md-75,[dir=rtl] .layout-margin .flex-offset-gt-md-75,[dir=rtl] .layout-margin .offset-gt-md-75{margin-left:auto;margin-right:75%}.offset-gt-md-80,.flex-offset-gt-md-80,.layout-margin .flex-offset-gt-md-80,.layout-margin .offset-gt-md-80{margin-left:80%}[dir=rtl] .offset-gt-md-80,[dir=rtl] .flex-offset-gt-md-80,[dir=rtl] .layout-margin .flex-offset-gt-md-80,[dir=rtl] .layout-margin .offset-gt-md-80{margin-left:auto;margin-right:80%}.offset-gt-md-85,.flex-offset-gt-md-85,.layout-margin .flex-offset-gt-md-85,.layout-margin .offset-gt-md-85{margin-left:85%}[dir=rtl] .offset-gt-md-85,[dir=rtl] .flex-offset-gt-md-85,[dir=rtl] .layout-margin .flex-offset-gt-md-85,[dir=rtl] .layout-margin .offset-gt-md-85{margin-left:auto;margin-right:85%}.offset-gt-md-90,.flex-offset-gt-md-90,.layout-margin .flex-offset-gt-md-90,.layout-margin .offset-gt-md-90{margin-left:90%}[dir=rtl] .offset-gt-md-90,[dir=rtl] .flex-offset-gt-md-90,[dir=rtl] .layout-margin .flex-offset-gt-md-90,[dir=rtl] .layout-margin .offset-gt-md-90{margin-left:auto;margin-right:90%}.offset-gt-md-95,.flex-offset-gt-md-95,.layout-margin .flex-offset-gt-md-95,.layout-margin .offset-gt-md-95{margin-left:95%}[dir=rtl] .offset-gt-md-95,[dir=rtl] .flex-offset-gt-md-95,[dir=rtl] .layout-margin .flex-offset-gt-md-95,[dir=rtl] .layout-margin .offset-gt-md-95{margin-left:auto;margin-right:95%}.offset-gt-md-33,.flex-offset-gt-md-33,.layout-margin .flex-offset-gt-md-33,.layout-margin .offset-gt-md-33{margin-left:33.3333333333%}.offset-gt-md-66,.flex-offset-gt-md-66,.layout-margin .flex-offset-gt-md-66,.layout-margin .offset-gt-md-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-md-66,[dir=rtl] .flex-offset-gt-md-66,[dir=rtl] .layout-margin .flex-offset-gt-md-66,[dir=rtl] .layout-margin .offset-gt-md-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-md,.layout-align-gt-md-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-md-start,.layout-align-gt-md-start-start,.layout-align-gt-md-start-center,.layout-align-gt-md-start-end,.layout-align-gt-md-start-stretch{justify-content:flex-start}.layout-align-gt-md-center,.layout-align-gt-md-center-start,.layout-align-gt-md-center-center,.layout-align-gt-md-center-end,.layout-align-gt-md-center-stretch{justify-content:center}.layout-align-gt-md-end,.layout-align-gt-md-end-start,.layout-align-gt-md-end-center,.layout-align-gt-md-end-end,.layout-align-gt-md-end-stretch{justify-content:flex-end}.layout-align-gt-md-space-around,.layout-align-gt-md-space-around-center,.layout-align-gt-md-space-around-start,.layout-align-gt-md-space-around-end,.layout-align-gt-md-space-around-stretch{justify-content:space-around}.layout-align-gt-md-space-between,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-between-stretch{justify-content:space-between}.layout-align-gt-md-start-start,.layout-align-gt-md-center-start,.layout-align-gt-md-end-start,.layout-align-gt-md-space-between-start,.layout-align-gt-md-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-md-start-center,.layout-align-gt-md-center-center,.layout-align-gt-md-end-center,.layout-align-gt-md-space-between-center,.layout-align-gt-md-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-md-start-center>*,.layout-align-gt-md-center-center>*,.layout-align-gt-md-end-center>*,.layout-align-gt-md-space-between-center>*,.layout-align-gt-md-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-md-start-end,.layout-align-gt-md-center-end,.layout-align-gt-md-end-end,.layout-align-gt-md-space-between-end,.layout-align-gt-md-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-md-start-stretch,.layout-align-gt-md-center-stretch,.layout-align-gt-md-end-stretch,.layout-align-gt-md-space-between-stretch,.layout-align-gt-md-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-md{flex:1;box-sizing:border-box}.flex-gt-md-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-md-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-md-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-md-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-md-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-md-column>.flex-gt-md-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-md-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-md-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-md-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex-gt-md-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-md-row>.flex{min-width:0}.layout-gt-md-column>.flex-gt-md-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-md-column>.flex-gt-md-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-md-column>.flex{min-height:0}.layout-gt-md,.layout-gt-md-column,.layout-gt-md-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-md-column{flex-direction:column}.layout-gt-md-row{flex-direction:row}}@media(min-width: 1280px)and (max-width: 1919px){.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show){display:none}.hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}.flex-order-lg--20{order:-20}.flex-order-lg--19{order:-19}.flex-order-lg--18{order:-18}.flex-order-lg--17{order:-17}.flex-order-lg--16{order:-16}.flex-order-lg--15{order:-15}.flex-order-lg--14{order:-14}.flex-order-lg--13{order:-13}.flex-order-lg--12{order:-12}.flex-order-lg--11{order:-11}.flex-order-lg--10{order:-10}.flex-order-lg--9{order:-9}.flex-order-lg--8{order:-8}.flex-order-lg--7{order:-7}.flex-order-lg--6{order:-6}.flex-order-lg--5{order:-5}.flex-order-lg--4{order:-4}.flex-order-lg--3{order:-3}.flex-order-lg--2{order:-2}.flex-order-lg--1{order:-1}.flex-order-lg-0{order:0}.flex-order-lg-1{order:1}.flex-order-lg-2{order:2}.flex-order-lg-3{order:3}.flex-order-lg-4{order:4}.flex-order-lg-5{order:5}.flex-order-lg-6{order:6}.flex-order-lg-7{order:7}.flex-order-lg-8{order:8}.flex-order-lg-9{order:9}.flex-order-lg-10{order:10}.flex-order-lg-11{order:11}.flex-order-lg-12{order:12}.flex-order-lg-13{order:13}.flex-order-lg-14{order:14}.flex-order-lg-15{order:15}.flex-order-lg-16{order:16}.flex-order-lg-17{order:17}.flex-order-lg-18{order:18}.flex-order-lg-19{order:19}.flex-order-lg-20{order:20}.offset-lg-0,.flex-offset-lg-0,.layout-margin .flex-offset-lg-0,.layout-margin .offset-lg-0{margin-left:0}[dir=rtl] .offset-lg-0,[dir=rtl] .flex-offset-lg-0,[dir=rtl] .layout-margin .flex-offset-lg-0,[dir=rtl] .layout-margin .offset-lg-0{margin-left:auto;margin-right:0}.offset-lg-5,.flex-offset-lg-5,.layout-margin .flex-offset-lg-5,.layout-margin .offset-lg-5{margin-left:5%}[dir=rtl] .offset-lg-5,[dir=rtl] .flex-offset-lg-5,[dir=rtl] .layout-margin .flex-offset-lg-5,[dir=rtl] .layout-margin .offset-lg-5{margin-left:auto;margin-right:5%}.offset-lg-10,.flex-offset-lg-10,.layout-margin .flex-offset-lg-10,.layout-margin .offset-lg-10{margin-left:10%}[dir=rtl] .offset-lg-10,[dir=rtl] .flex-offset-lg-10,[dir=rtl] .layout-margin .flex-offset-lg-10,[dir=rtl] .layout-margin .offset-lg-10{margin-left:auto;margin-right:10%}.offset-lg-15,.flex-offset-lg-15,.layout-margin .flex-offset-lg-15,.layout-margin .offset-lg-15{margin-left:15%}[dir=rtl] .offset-lg-15,[dir=rtl] .flex-offset-lg-15,[dir=rtl] .layout-margin .flex-offset-lg-15,[dir=rtl] .layout-margin .offset-lg-15{margin-left:auto;margin-right:15%}.offset-lg-20,.flex-offset-lg-20,.layout-margin .flex-offset-lg-20,.layout-margin .offset-lg-20{margin-left:20%}[dir=rtl] .offset-lg-20,[dir=rtl] .flex-offset-lg-20,[dir=rtl] .layout-margin .flex-offset-lg-20,[dir=rtl] .layout-margin .offset-lg-20{margin-left:auto;margin-right:20%}.offset-lg-25,.flex-offset-lg-25,.layout-margin .flex-offset-lg-25,.layout-margin .offset-lg-25{margin-left:25%}[dir=rtl] .offset-lg-25,[dir=rtl] .flex-offset-lg-25,[dir=rtl] .layout-margin .flex-offset-lg-25,[dir=rtl] .layout-margin .offset-lg-25{margin-left:auto;margin-right:25%}.offset-lg-30,.flex-offset-lg-30,.layout-margin .flex-offset-lg-30,.layout-margin .offset-lg-30{margin-left:30%}[dir=rtl] .offset-lg-30,[dir=rtl] .flex-offset-lg-30,[dir=rtl] .layout-margin .flex-offset-lg-30,[dir=rtl] .layout-margin .offset-lg-30{margin-left:auto;margin-right:30%}.offset-lg-35,.flex-offset-lg-35,.layout-margin .flex-offset-lg-35,.layout-margin .offset-lg-35{margin-left:35%}[dir=rtl] .offset-lg-35,[dir=rtl] .flex-offset-lg-35,[dir=rtl] .layout-margin .flex-offset-lg-35,[dir=rtl] .layout-margin .offset-lg-35{margin-left:auto;margin-right:35%}.offset-lg-40,.flex-offset-lg-40,.layout-margin .flex-offset-lg-40,.layout-margin .offset-lg-40{margin-left:40%}[dir=rtl] .offset-lg-40,[dir=rtl] .flex-offset-lg-40,[dir=rtl] .layout-margin .flex-offset-lg-40,[dir=rtl] .layout-margin .offset-lg-40{margin-left:auto;margin-right:40%}.offset-lg-45,.flex-offset-lg-45,.layout-margin .flex-offset-lg-45,.layout-margin .offset-lg-45{margin-left:45%}[dir=rtl] .offset-lg-45,[dir=rtl] .flex-offset-lg-45,[dir=rtl] .layout-margin .flex-offset-lg-45,[dir=rtl] .layout-margin .offset-lg-45{margin-left:auto;margin-right:45%}.offset-lg-50,.flex-offset-lg-50,.layout-margin .flex-offset-lg-50,.layout-margin .offset-lg-50{margin-left:50%}[dir=rtl] .offset-lg-50,[dir=rtl] .flex-offset-lg-50,[dir=rtl] .layout-margin .flex-offset-lg-50,[dir=rtl] .layout-margin .offset-lg-50{margin-left:auto;margin-right:50%}.offset-lg-55,.flex-offset-lg-55,.layout-margin .flex-offset-lg-55,.layout-margin .offset-lg-55{margin-left:55%}[dir=rtl] .offset-lg-55,[dir=rtl] .flex-offset-lg-55,[dir=rtl] .layout-margin .flex-offset-lg-55,[dir=rtl] .layout-margin .offset-lg-55{margin-left:auto;margin-right:55%}.offset-lg-60,.flex-offset-lg-60,.layout-margin .flex-offset-lg-60,.layout-margin .offset-lg-60{margin-left:60%}[dir=rtl] .offset-lg-60,[dir=rtl] .flex-offset-lg-60,[dir=rtl] .layout-margin .flex-offset-lg-60,[dir=rtl] .layout-margin .offset-lg-60{margin-left:auto;margin-right:60%}.offset-lg-65,.flex-offset-lg-65,.layout-margin .flex-offset-lg-65,.layout-margin .offset-lg-65{margin-left:65%}[dir=rtl] .offset-lg-65,[dir=rtl] .flex-offset-lg-65,[dir=rtl] .layout-margin .flex-offset-lg-65,[dir=rtl] .layout-margin .offset-lg-65{margin-left:auto;margin-right:65%}.offset-lg-70,.flex-offset-lg-70,.layout-margin .flex-offset-lg-70,.layout-margin .offset-lg-70{margin-left:70%}[dir=rtl] .offset-lg-70,[dir=rtl] .flex-offset-lg-70,[dir=rtl] .layout-margin .flex-offset-lg-70,[dir=rtl] .layout-margin .offset-lg-70{margin-left:auto;margin-right:70%}.offset-lg-75,.flex-offset-lg-75,.layout-margin .flex-offset-lg-75,.layout-margin .offset-lg-75{margin-left:75%}[dir=rtl] .offset-lg-75,[dir=rtl] .flex-offset-lg-75,[dir=rtl] .layout-margin .flex-offset-lg-75,[dir=rtl] .layout-margin .offset-lg-75{margin-left:auto;margin-right:75%}.offset-lg-80,.flex-offset-lg-80,.layout-margin .flex-offset-lg-80,.layout-margin .offset-lg-80{margin-left:80%}[dir=rtl] .offset-lg-80,[dir=rtl] .flex-offset-lg-80,[dir=rtl] .layout-margin .flex-offset-lg-80,[dir=rtl] .layout-margin .offset-lg-80{margin-left:auto;margin-right:80%}.offset-lg-85,.flex-offset-lg-85,.layout-margin .flex-offset-lg-85,.layout-margin .offset-lg-85{margin-left:85%}[dir=rtl] .offset-lg-85,[dir=rtl] .flex-offset-lg-85,[dir=rtl] .layout-margin .flex-offset-lg-85,[dir=rtl] .layout-margin .offset-lg-85{margin-left:auto;margin-right:85%}.offset-lg-90,.flex-offset-lg-90,.layout-margin .flex-offset-lg-90,.layout-margin .offset-lg-90{margin-left:90%}[dir=rtl] .offset-lg-90,[dir=rtl] .flex-offset-lg-90,[dir=rtl] .layout-margin .flex-offset-lg-90,[dir=rtl] .layout-margin .offset-lg-90{margin-left:auto;margin-right:90%}.offset-lg-95,.flex-offset-lg-95,.layout-margin .flex-offset-lg-95,.layout-margin .offset-lg-95{margin-left:95%}[dir=rtl] .offset-lg-95,[dir=rtl] .flex-offset-lg-95,[dir=rtl] .layout-margin .flex-offset-lg-95,[dir=rtl] .layout-margin .offset-lg-95{margin-left:auto;margin-right:95%}.offset-lg-33,.flex-offset-lg-33,.layout-margin .flex-offset-lg-33,.layout-margin .offset-lg-33{margin-left:33.3333333333%}.offset-lg-66,.flex-offset-lg-66,.layout-margin .flex-offset-lg-66,.layout-margin .offset-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-lg-66,[dir=rtl] .flex-offset-lg-66,[dir=rtl] .layout-margin .flex-offset-lg-66,[dir=rtl] .layout-margin .offset-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-lg,.layout-align-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-lg-start,.layout-align-lg-start-start,.layout-align-lg-start-center,.layout-align-lg-start-end,.layout-align-lg-start-stretch{justify-content:flex-start}.layout-align-lg-center,.layout-align-lg-center-start,.layout-align-lg-center-center,.layout-align-lg-center-end,.layout-align-lg-center-stretch{justify-content:center}.layout-align-lg-end,.layout-align-lg-end-start,.layout-align-lg-end-center,.layout-align-lg-end-end,.layout-align-lg-end-stretch{justify-content:flex-end}.layout-align-lg-space-around,.layout-align-lg-space-around-center,.layout-align-lg-space-around-start,.layout-align-lg-space-around-end,.layout-align-lg-space-around-stretch{justify-content:space-around}.layout-align-lg-space-between,.layout-align-lg-space-between-center,.layout-align-lg-space-between-start,.layout-align-lg-space-between-end,.layout-align-lg-space-between-stretch{justify-content:space-between}.layout-align-lg-start-start,.layout-align-lg-center-start,.layout-align-lg-end-start,.layout-align-lg-space-between-start,.layout-align-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-lg-start-center,.layout-align-lg-center-center,.layout-align-lg-end-center,.layout-align-lg-space-between-center,.layout-align-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-lg-start-center>*,.layout-align-lg-center-center>*,.layout-align-lg-end-center>*,.layout-align-lg-space-between-center>*,.layout-align-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-lg-start-end,.layout-align-lg-center-end,.layout-align-lg-end-end,.layout-align-lg-space-between-end,.layout-align-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-lg-start-stretch,.layout-align-lg-center-stretch,.layout-align-lg-end-stretch,.layout-align-lg-space-between-stretch,.layout-align-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-lg{flex:1;box-sizing:border-box}.flex-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-lg-row>.flex-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-lg-column>.flex-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-lg-row>.flex-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-lg-row>.flex-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-lg-row>.flex-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-lg-row>.flex-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-lg-row>.flex-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-lg-row>.flex-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-lg-row>.flex-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-lg-row>.flex-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-lg-row>.flex-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-lg-row>.flex-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-lg-row>.flex-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-lg-row>.flex-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-lg-row>.flex-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-lg-row>.flex-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-lg-row>.flex-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-lg-row>.flex-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-lg-row>.flex-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-lg-row>.flex-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-lg-row>.flex-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-lg-column>.flex-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-row>.flex-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-lg-row>.flex{min-width:0}.layout-lg-column>.flex-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-lg-column>.flex-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-lg-column>.flex{min-height:0}.layout-lg,.layout-lg-column,.layout-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-lg-column{flex-direction:column}.layout-lg-row{flex-direction:row}}@media(min-width: 1920px){.flex-order-gt-lg--20{order:-20}.flex-order-gt-lg--19{order:-19}.flex-order-gt-lg--18{order:-18}.flex-order-gt-lg--17{order:-17}.flex-order-gt-lg--16{order:-16}.flex-order-gt-lg--15{order:-15}.flex-order-gt-lg--14{order:-14}.flex-order-gt-lg--13{order:-13}.flex-order-gt-lg--12{order:-12}.flex-order-gt-lg--11{order:-11}.flex-order-gt-lg--10{order:-10}.flex-order-gt-lg--9{order:-9}.flex-order-gt-lg--8{order:-8}.flex-order-gt-lg--7{order:-7}.flex-order-gt-lg--6{order:-6}.flex-order-gt-lg--5{order:-5}.flex-order-gt-lg--4{order:-4}.flex-order-gt-lg--3{order:-3}.flex-order-gt-lg--2{order:-2}.flex-order-gt-lg--1{order:-1}.flex-order-gt-lg-0{order:0}.flex-order-gt-lg-1{order:1}.flex-order-gt-lg-2{order:2}.flex-order-gt-lg-3{order:3}.flex-order-gt-lg-4{order:4}.flex-order-gt-lg-5{order:5}.flex-order-gt-lg-6{order:6}.flex-order-gt-lg-7{order:7}.flex-order-gt-lg-8{order:8}.flex-order-gt-lg-9{order:9}.flex-order-gt-lg-10{order:10}.flex-order-gt-lg-11{order:11}.flex-order-gt-lg-12{order:12}.flex-order-gt-lg-13{order:13}.flex-order-gt-lg-14{order:14}.flex-order-gt-lg-15{order:15}.flex-order-gt-lg-16{order:16}.flex-order-gt-lg-17{order:17}.flex-order-gt-lg-18{order:18}.flex-order-gt-lg-19{order:19}.flex-order-gt-lg-20{order:20}.offset-gt-lg-0,.flex-offset-gt-lg-0,.layout-margin .flex-offset-gt-lg-0,.layout-margin .offset-gt-lg-0{margin-left:0}[dir=rtl] .offset-gt-lg-0,[dir=rtl] .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .flex-offset-gt-lg-0,[dir=rtl] .layout-margin .offset-gt-lg-0{margin-left:auto;margin-right:0}.offset-gt-lg-5,.flex-offset-gt-lg-5,.layout-margin .flex-offset-gt-lg-5,.layout-margin .offset-gt-lg-5{margin-left:5%}[dir=rtl] .offset-gt-lg-5,[dir=rtl] .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .flex-offset-gt-lg-5,[dir=rtl] .layout-margin .offset-gt-lg-5{margin-left:auto;margin-right:5%}.offset-gt-lg-10,.flex-offset-gt-lg-10,.layout-margin .flex-offset-gt-lg-10,.layout-margin .offset-gt-lg-10{margin-left:10%}[dir=rtl] .offset-gt-lg-10,[dir=rtl] .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .flex-offset-gt-lg-10,[dir=rtl] .layout-margin .offset-gt-lg-10{margin-left:auto;margin-right:10%}.offset-gt-lg-15,.flex-offset-gt-lg-15,.layout-margin .flex-offset-gt-lg-15,.layout-margin .offset-gt-lg-15{margin-left:15%}[dir=rtl] .offset-gt-lg-15,[dir=rtl] .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .flex-offset-gt-lg-15,[dir=rtl] .layout-margin .offset-gt-lg-15{margin-left:auto;margin-right:15%}.offset-gt-lg-20,.flex-offset-gt-lg-20,.layout-margin .flex-offset-gt-lg-20,.layout-margin .offset-gt-lg-20{margin-left:20%}[dir=rtl] .offset-gt-lg-20,[dir=rtl] .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .flex-offset-gt-lg-20,[dir=rtl] .layout-margin .offset-gt-lg-20{margin-left:auto;margin-right:20%}.offset-gt-lg-25,.flex-offset-gt-lg-25,.layout-margin .flex-offset-gt-lg-25,.layout-margin .offset-gt-lg-25{margin-left:25%}[dir=rtl] .offset-gt-lg-25,[dir=rtl] .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .flex-offset-gt-lg-25,[dir=rtl] .layout-margin .offset-gt-lg-25{margin-left:auto;margin-right:25%}.offset-gt-lg-30,.flex-offset-gt-lg-30,.layout-margin .flex-offset-gt-lg-30,.layout-margin .offset-gt-lg-30{margin-left:30%}[dir=rtl] .offset-gt-lg-30,[dir=rtl] .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .flex-offset-gt-lg-30,[dir=rtl] .layout-margin .offset-gt-lg-30{margin-left:auto;margin-right:30%}.offset-gt-lg-35,.flex-offset-gt-lg-35,.layout-margin .flex-offset-gt-lg-35,.layout-margin .offset-gt-lg-35{margin-left:35%}[dir=rtl] .offset-gt-lg-35,[dir=rtl] .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .flex-offset-gt-lg-35,[dir=rtl] .layout-margin .offset-gt-lg-35{margin-left:auto;margin-right:35%}.offset-gt-lg-40,.flex-offset-gt-lg-40,.layout-margin .flex-offset-gt-lg-40,.layout-margin .offset-gt-lg-40{margin-left:40%}[dir=rtl] .offset-gt-lg-40,[dir=rtl] .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .flex-offset-gt-lg-40,[dir=rtl] .layout-margin .offset-gt-lg-40{margin-left:auto;margin-right:40%}.offset-gt-lg-45,.flex-offset-gt-lg-45,.layout-margin .flex-offset-gt-lg-45,.layout-margin .offset-gt-lg-45{margin-left:45%}[dir=rtl] .offset-gt-lg-45,[dir=rtl] .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .flex-offset-gt-lg-45,[dir=rtl] .layout-margin .offset-gt-lg-45{margin-left:auto;margin-right:45%}.offset-gt-lg-50,.flex-offset-gt-lg-50,.layout-margin .flex-offset-gt-lg-50,.layout-margin .offset-gt-lg-50{margin-left:50%}[dir=rtl] .offset-gt-lg-50,[dir=rtl] .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .flex-offset-gt-lg-50,[dir=rtl] .layout-margin .offset-gt-lg-50{margin-left:auto;margin-right:50%}.offset-gt-lg-55,.flex-offset-gt-lg-55,.layout-margin .flex-offset-gt-lg-55,.layout-margin .offset-gt-lg-55{margin-left:55%}[dir=rtl] .offset-gt-lg-55,[dir=rtl] .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .flex-offset-gt-lg-55,[dir=rtl] .layout-margin .offset-gt-lg-55{margin-left:auto;margin-right:55%}.offset-gt-lg-60,.flex-offset-gt-lg-60,.layout-margin .flex-offset-gt-lg-60,.layout-margin .offset-gt-lg-60{margin-left:60%}[dir=rtl] .offset-gt-lg-60,[dir=rtl] .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .flex-offset-gt-lg-60,[dir=rtl] .layout-margin .offset-gt-lg-60{margin-left:auto;margin-right:60%}.offset-gt-lg-65,.flex-offset-gt-lg-65,.layout-margin .flex-offset-gt-lg-65,.layout-margin .offset-gt-lg-65{margin-left:65%}[dir=rtl] .offset-gt-lg-65,[dir=rtl] .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .flex-offset-gt-lg-65,[dir=rtl] .layout-margin .offset-gt-lg-65{margin-left:auto;margin-right:65%}.offset-gt-lg-70,.flex-offset-gt-lg-70,.layout-margin .flex-offset-gt-lg-70,.layout-margin .offset-gt-lg-70{margin-left:70%}[dir=rtl] .offset-gt-lg-70,[dir=rtl] .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .flex-offset-gt-lg-70,[dir=rtl] .layout-margin .offset-gt-lg-70{margin-left:auto;margin-right:70%}.offset-gt-lg-75,.flex-offset-gt-lg-75,.layout-margin .flex-offset-gt-lg-75,.layout-margin .offset-gt-lg-75{margin-left:75%}[dir=rtl] .offset-gt-lg-75,[dir=rtl] .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .flex-offset-gt-lg-75,[dir=rtl] .layout-margin .offset-gt-lg-75{margin-left:auto;margin-right:75%}.offset-gt-lg-80,.flex-offset-gt-lg-80,.layout-margin .flex-offset-gt-lg-80,.layout-margin .offset-gt-lg-80{margin-left:80%}[dir=rtl] .offset-gt-lg-80,[dir=rtl] .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .flex-offset-gt-lg-80,[dir=rtl] .layout-margin .offset-gt-lg-80{margin-left:auto;margin-right:80%}.offset-gt-lg-85,.flex-offset-gt-lg-85,.layout-margin .flex-offset-gt-lg-85,.layout-margin .offset-gt-lg-85{margin-left:85%}[dir=rtl] .offset-gt-lg-85,[dir=rtl] .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .flex-offset-gt-lg-85,[dir=rtl] .layout-margin .offset-gt-lg-85{margin-left:auto;margin-right:85%}.offset-gt-lg-90,.flex-offset-gt-lg-90,.layout-margin .flex-offset-gt-lg-90,.layout-margin .offset-gt-lg-90{margin-left:90%}[dir=rtl] .offset-gt-lg-90,[dir=rtl] .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .flex-offset-gt-lg-90,[dir=rtl] .layout-margin .offset-gt-lg-90{margin-left:auto;margin-right:90%}.offset-gt-lg-95,.flex-offset-gt-lg-95,.layout-margin .flex-offset-gt-lg-95,.layout-margin .offset-gt-lg-95{margin-left:95%}[dir=rtl] .offset-gt-lg-95,[dir=rtl] .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .flex-offset-gt-lg-95,[dir=rtl] .layout-margin .offset-gt-lg-95{margin-left:auto;margin-right:95%}.offset-gt-lg-33,.flex-offset-gt-lg-33,.layout-margin .flex-offset-gt-lg-33,.layout-margin .offset-gt-lg-33{margin-left:33.3333333333%}.offset-gt-lg-66,.flex-offset-gt-lg-66,.layout-margin .flex-offset-gt-lg-66,.layout-margin .offset-gt-lg-66{margin-left:66.6666666667%}[dir=rtl] .offset-gt-lg-66,[dir=rtl] .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .flex-offset-gt-lg-66,[dir=rtl] .layout-margin .offset-gt-lg-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-gt-lg,.layout-align-gt-lg-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-gt-lg-start,.layout-align-gt-lg-start-start,.layout-align-gt-lg-start-center,.layout-align-gt-lg-start-end,.layout-align-gt-lg-start-stretch{justify-content:flex-start}.layout-align-gt-lg-center,.layout-align-gt-lg-center-start,.layout-align-gt-lg-center-center,.layout-align-gt-lg-center-end,.layout-align-gt-lg-center-stretch{justify-content:center}.layout-align-gt-lg-end,.layout-align-gt-lg-end-start,.layout-align-gt-lg-end-center,.layout-align-gt-lg-end-end,.layout-align-gt-lg-end-stretch{justify-content:flex-end}.layout-align-gt-lg-space-around,.layout-align-gt-lg-space-around-center,.layout-align-gt-lg-space-around-start,.layout-align-gt-lg-space-around-end,.layout-align-gt-lg-space-around-stretch{justify-content:space-around}.layout-align-gt-lg-space-between,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-between-stretch{justify-content:space-between}.layout-align-gt-lg-start-start,.layout-align-gt-lg-center-start,.layout-align-gt-lg-end-start,.layout-align-gt-lg-space-between-start,.layout-align-gt-lg-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-gt-lg-start-center,.layout-align-gt-lg-center-center,.layout-align-gt-lg-end-center,.layout-align-gt-lg-space-between-center,.layout-align-gt-lg-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-gt-lg-start-center>*,.layout-align-gt-lg-center-center>*,.layout-align-gt-lg-end-center>*,.layout-align-gt-lg-space-between-center>*,.layout-align-gt-lg-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-gt-lg-start-end,.layout-align-gt-lg-center-end,.layout-align-gt-lg-end-end,.layout-align-gt-lg-space-between-end,.layout-align-gt-lg-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-gt-lg-start-stretch,.layout-align-gt-lg-center-stretch,.layout-align-gt-lg-end-stretch,.layout-align-gt-lg-space-between-stretch,.layout-align-gt-lg-space-around-stretch{align-items:stretch;align-content:stretch}.flex-gt-lg{flex:1;box-sizing:border-box}.flex-gt-lg-grow{flex:1 1 100%;box-sizing:border-box}.flex-gt-lg-initial{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-auto{flex:1 1 auto;box-sizing:border-box}.flex-gt-lg-none{flex:0 0 auto;box-sizing:border-box}.flex-gt-lg-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-gt-lg-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-gt-lg-column>.flex-gt-lg-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-gt-lg-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-gt-lg-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-gt-lg-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex-gt-lg-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-gt-lg-row>.flex{min-width:0}.layout-gt-lg-column>.flex-gt-lg-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-gt-lg-column>.flex-gt-lg-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-gt-lg-column>.flex{min-height:0}.layout-gt-lg,.layout-gt-lg-column,.layout-gt-lg-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-gt-lg-column{flex-direction:column}.layout-gt-lg-row{flex-direction:row}.flex-order-xl--20{order:-20}.flex-order-xl--19{order:-19}.flex-order-xl--18{order:-18}.flex-order-xl--17{order:-17}.flex-order-xl--16{order:-16}.flex-order-xl--15{order:-15}.flex-order-xl--14{order:-14}.flex-order-xl--13{order:-13}.flex-order-xl--12{order:-12}.flex-order-xl--11{order:-11}.flex-order-xl--10{order:-10}.flex-order-xl--9{order:-9}.flex-order-xl--8{order:-8}.flex-order-xl--7{order:-7}.flex-order-xl--6{order:-6}.flex-order-xl--5{order:-5}.flex-order-xl--4{order:-4}.flex-order-xl--3{order:-3}.flex-order-xl--2{order:-2}.flex-order-xl--1{order:-1}.flex-order-xl-0{order:0}.flex-order-xl-1{order:1}.flex-order-xl-2{order:2}.flex-order-xl-3{order:3}.flex-order-xl-4{order:4}.flex-order-xl-5{order:5}.flex-order-xl-6{order:6}.flex-order-xl-7{order:7}.flex-order-xl-8{order:8}.flex-order-xl-9{order:9}.flex-order-xl-10{order:10}.flex-order-xl-11{order:11}.flex-order-xl-12{order:12}.flex-order-xl-13{order:13}.flex-order-xl-14{order:14}.flex-order-xl-15{order:15}.flex-order-xl-16{order:16}.flex-order-xl-17{order:17}.flex-order-xl-18{order:18}.flex-order-xl-19{order:19}.flex-order-xl-20{order:20}.offset-xl-0,.flex-offset-xl-0,.layout-margin .flex-offset-xl-0,.layout-margin .offset-xl-0{margin-left:0}[dir=rtl] .offset-xl-0,[dir=rtl] .flex-offset-xl-0,[dir=rtl] .layout-margin .flex-offset-xl-0,[dir=rtl] .layout-margin .offset-xl-0{margin-left:auto;margin-right:0}.offset-xl-5,.flex-offset-xl-5,.layout-margin .flex-offset-xl-5,.layout-margin .offset-xl-5{margin-left:5%}[dir=rtl] .offset-xl-5,[dir=rtl] .flex-offset-xl-5,[dir=rtl] .layout-margin .flex-offset-xl-5,[dir=rtl] .layout-margin .offset-xl-5{margin-left:auto;margin-right:5%}.offset-xl-10,.flex-offset-xl-10,.layout-margin .flex-offset-xl-10,.layout-margin .offset-xl-10{margin-left:10%}[dir=rtl] .offset-xl-10,[dir=rtl] .flex-offset-xl-10,[dir=rtl] .layout-margin .flex-offset-xl-10,[dir=rtl] .layout-margin .offset-xl-10{margin-left:auto;margin-right:10%}.offset-xl-15,.flex-offset-xl-15,.layout-margin .flex-offset-xl-15,.layout-margin .offset-xl-15{margin-left:15%}[dir=rtl] .offset-xl-15,[dir=rtl] .flex-offset-xl-15,[dir=rtl] .layout-margin .flex-offset-xl-15,[dir=rtl] .layout-margin .offset-xl-15{margin-left:auto;margin-right:15%}.offset-xl-20,.flex-offset-xl-20,.layout-margin .flex-offset-xl-20,.layout-margin .offset-xl-20{margin-left:20%}[dir=rtl] .offset-xl-20,[dir=rtl] .flex-offset-xl-20,[dir=rtl] .layout-margin .flex-offset-xl-20,[dir=rtl] .layout-margin .offset-xl-20{margin-left:auto;margin-right:20%}.offset-xl-25,.flex-offset-xl-25,.layout-margin .flex-offset-xl-25,.layout-margin .offset-xl-25{margin-left:25%}[dir=rtl] .offset-xl-25,[dir=rtl] .flex-offset-xl-25,[dir=rtl] .layout-margin .flex-offset-xl-25,[dir=rtl] .layout-margin .offset-xl-25{margin-left:auto;margin-right:25%}.offset-xl-30,.flex-offset-xl-30,.layout-margin .flex-offset-xl-30,.layout-margin .offset-xl-30{margin-left:30%}[dir=rtl] .offset-xl-30,[dir=rtl] .flex-offset-xl-30,[dir=rtl] .layout-margin .flex-offset-xl-30,[dir=rtl] .layout-margin .offset-xl-30{margin-left:auto;margin-right:30%}.offset-xl-35,.flex-offset-xl-35,.layout-margin .flex-offset-xl-35,.layout-margin .offset-xl-35{margin-left:35%}[dir=rtl] .offset-xl-35,[dir=rtl] .flex-offset-xl-35,[dir=rtl] .layout-margin .flex-offset-xl-35,[dir=rtl] .layout-margin .offset-xl-35{margin-left:auto;margin-right:35%}.offset-xl-40,.flex-offset-xl-40,.layout-margin .flex-offset-xl-40,.layout-margin .offset-xl-40{margin-left:40%}[dir=rtl] .offset-xl-40,[dir=rtl] .flex-offset-xl-40,[dir=rtl] .layout-margin .flex-offset-xl-40,[dir=rtl] .layout-margin .offset-xl-40{margin-left:auto;margin-right:40%}.offset-xl-45,.flex-offset-xl-45,.layout-margin .flex-offset-xl-45,.layout-margin .offset-xl-45{margin-left:45%}[dir=rtl] .offset-xl-45,[dir=rtl] .flex-offset-xl-45,[dir=rtl] .layout-margin .flex-offset-xl-45,[dir=rtl] .layout-margin .offset-xl-45{margin-left:auto;margin-right:45%}.offset-xl-50,.flex-offset-xl-50,.layout-margin .flex-offset-xl-50,.layout-margin .offset-xl-50{margin-left:50%}[dir=rtl] .offset-xl-50,[dir=rtl] .flex-offset-xl-50,[dir=rtl] .layout-margin .flex-offset-xl-50,[dir=rtl] .layout-margin .offset-xl-50{margin-left:auto;margin-right:50%}.offset-xl-55,.flex-offset-xl-55,.layout-margin .flex-offset-xl-55,.layout-margin .offset-xl-55{margin-left:55%}[dir=rtl] .offset-xl-55,[dir=rtl] .flex-offset-xl-55,[dir=rtl] .layout-margin .flex-offset-xl-55,[dir=rtl] .layout-margin .offset-xl-55{margin-left:auto;margin-right:55%}.offset-xl-60,.flex-offset-xl-60,.layout-margin .flex-offset-xl-60,.layout-margin .offset-xl-60{margin-left:60%}[dir=rtl] .offset-xl-60,[dir=rtl] .flex-offset-xl-60,[dir=rtl] .layout-margin .flex-offset-xl-60,[dir=rtl] .layout-margin .offset-xl-60{margin-left:auto;margin-right:60%}.offset-xl-65,.flex-offset-xl-65,.layout-margin .flex-offset-xl-65,.layout-margin .offset-xl-65{margin-left:65%}[dir=rtl] .offset-xl-65,[dir=rtl] .flex-offset-xl-65,[dir=rtl] .layout-margin .flex-offset-xl-65,[dir=rtl] .layout-margin .offset-xl-65{margin-left:auto;margin-right:65%}.offset-xl-70,.flex-offset-xl-70,.layout-margin .flex-offset-xl-70,.layout-margin .offset-xl-70{margin-left:70%}[dir=rtl] .offset-xl-70,[dir=rtl] .flex-offset-xl-70,[dir=rtl] .layout-margin .flex-offset-xl-70,[dir=rtl] .layout-margin .offset-xl-70{margin-left:auto;margin-right:70%}.offset-xl-75,.flex-offset-xl-75,.layout-margin .flex-offset-xl-75,.layout-margin .offset-xl-75{margin-left:75%}[dir=rtl] .offset-xl-75,[dir=rtl] .flex-offset-xl-75,[dir=rtl] .layout-margin .flex-offset-xl-75,[dir=rtl] .layout-margin .offset-xl-75{margin-left:auto;margin-right:75%}.offset-xl-80,.flex-offset-xl-80,.layout-margin .flex-offset-xl-80,.layout-margin .offset-xl-80{margin-left:80%}[dir=rtl] .offset-xl-80,[dir=rtl] .flex-offset-xl-80,[dir=rtl] .layout-margin .flex-offset-xl-80,[dir=rtl] .layout-margin .offset-xl-80{margin-left:auto;margin-right:80%}.offset-xl-85,.flex-offset-xl-85,.layout-margin .flex-offset-xl-85,.layout-margin .offset-xl-85{margin-left:85%}[dir=rtl] .offset-xl-85,[dir=rtl] .flex-offset-xl-85,[dir=rtl] .layout-margin .flex-offset-xl-85,[dir=rtl] .layout-margin .offset-xl-85{margin-left:auto;margin-right:85%}.offset-xl-90,.flex-offset-xl-90,.layout-margin .flex-offset-xl-90,.layout-margin .offset-xl-90{margin-left:90%}[dir=rtl] .offset-xl-90,[dir=rtl] .flex-offset-xl-90,[dir=rtl] .layout-margin .flex-offset-xl-90,[dir=rtl] .layout-margin .offset-xl-90{margin-left:auto;margin-right:90%}.offset-xl-95,.flex-offset-xl-95,.layout-margin .flex-offset-xl-95,.layout-margin .offset-xl-95{margin-left:95%}[dir=rtl] .offset-xl-95,[dir=rtl] .flex-offset-xl-95,[dir=rtl] .layout-margin .flex-offset-xl-95,[dir=rtl] .layout-margin .offset-xl-95{margin-left:auto;margin-right:95%}.offset-xl-33,.flex-offset-xl-33,.layout-margin .flex-offset-xl-33,.layout-margin .offset-xl-33{margin-left:33.3333333333%}.offset-xl-66,.flex-offset-xl-66,.layout-margin .flex-offset-xl-66,.layout-margin .offset-xl-66{margin-left:66.6666666667%}[dir=rtl] .offset-xl-66,[dir=rtl] .flex-offset-xl-66,[dir=rtl] .layout-margin .flex-offset-xl-66,[dir=rtl] .layout-margin .offset-xl-66{margin-left:auto;margin-right:66.6666666667%}.layout-align-xl,.layout-align-xl-start-stretch{justify-content:flex-start;align-content:stretch;align-items:stretch}.layout-align-xl-start,.layout-align-xl-start-start,.layout-align-xl-start-center,.layout-align-xl-start-end,.layout-align-xl-start-stretch{justify-content:flex-start}.layout-align-xl-center,.layout-align-xl-center-start,.layout-align-xl-center-center,.layout-align-xl-center-end,.layout-align-xl-center-stretch{justify-content:center}.layout-align-xl-end,.layout-align-xl-end-start,.layout-align-xl-end-center,.layout-align-xl-end-end,.layout-align-xl-end-stretch{justify-content:flex-end}.layout-align-xl-space-around,.layout-align-xl-space-around-center,.layout-align-xl-space-around-start,.layout-align-xl-space-around-end,.layout-align-xl-space-around-stretch{justify-content:space-around}.layout-align-xl-space-between,.layout-align-xl-space-between-center,.layout-align-xl-space-between-start,.layout-align-xl-space-between-end,.layout-align-xl-space-between-stretch{justify-content:space-between}.layout-align-xl-start-start,.layout-align-xl-center-start,.layout-align-xl-end-start,.layout-align-xl-space-between-start,.layout-align-xl-space-around-start{align-items:flex-start;align-content:flex-start}.layout-align-xl-start-center,.layout-align-xl-center-center,.layout-align-xl-end-center,.layout-align-xl-space-between-center,.layout-align-xl-space-around-center{align-items:center;align-content:center;max-width:100%}.layout-align-xl-start-center>*,.layout-align-xl-center-center>*,.layout-align-xl-end-center>*,.layout-align-xl-space-between-center>*,.layout-align-xl-space-around-center>*{max-width:100%;box-sizing:border-box}.layout-align-xl-start-end,.layout-align-xl-center-end,.layout-align-xl-end-end,.layout-align-xl-space-between-end,.layout-align-xl-space-around-end{align-items:flex-end;align-content:flex-end}.layout-align-xl-start-stretch,.layout-align-xl-center-stretch,.layout-align-xl-end-stretch,.layout-align-xl-space-between-stretch,.layout-align-xl-space-around-stretch{align-items:stretch;align-content:stretch}.flex-xl{flex:1;box-sizing:border-box}.flex-xl-grow{flex:1 1 100%;box-sizing:border-box}.flex-xl-initial{flex:0 1 auto;box-sizing:border-box}.flex-xl-auto{flex:1 1 auto;box-sizing:border-box}.flex-xl-none{flex:0 0 auto;box-sizing:border-box}.flex-xl-noshrink{flex:1 0 auto;box-sizing:border-box}.flex-xl-nogrow{flex:0 1 auto;box-sizing:border-box}.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box}.layout-xl-row>.flex-xl-0{flex:1 1 100%;max-width:0%;max-height:100%;box-sizing:border-box;min-width:0}.layout-xl-column>.flex-xl-0{flex:1 1 100%;max-width:100%;max-height:0%;box-sizing:border-box;min-height:0}.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.layout-xl-row>.flex-xl-5{flex:1 1 100%;max-width:5%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-5{flex:1 1 100%;max-width:100%;max-height:5%;box-sizing:border-box}.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.layout-xl-row>.flex-xl-10{flex:1 1 100%;max-width:10%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-10{flex:1 1 100%;max-width:100%;max-height:10%;box-sizing:border-box}.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.layout-xl-row>.flex-xl-15{flex:1 1 100%;max-width:15%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-15{flex:1 1 100%;max-width:100%;max-height:15%;box-sizing:border-box}.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.layout-xl-row>.flex-xl-20{flex:1 1 100%;max-width:20%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-20{flex:1 1 100%;max-width:100%;max-height:20%;box-sizing:border-box}.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.layout-xl-row>.flex-xl-25{flex:1 1 100%;max-width:25%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-25{flex:1 1 100%;max-width:100%;max-height:25%;box-sizing:border-box}.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.layout-xl-row>.flex-xl-30{flex:1 1 100%;max-width:30%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-30{flex:1 1 100%;max-width:100%;max-height:30%;box-sizing:border-box}.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.layout-xl-row>.flex-xl-35{flex:1 1 100%;max-width:35%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-35{flex:1 1 100%;max-width:100%;max-height:35%;box-sizing:border-box}.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.layout-xl-row>.flex-xl-40{flex:1 1 100%;max-width:40%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-40{flex:1 1 100%;max-width:100%;max-height:40%;box-sizing:border-box}.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.layout-xl-row>.flex-xl-45{flex:1 1 100%;max-width:45%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-45{flex:1 1 100%;max-width:100%;max-height:45%;box-sizing:border-box}.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.layout-xl-row>.flex-xl-50{flex:1 1 100%;max-width:50%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-50{flex:1 1 100%;max-width:100%;max-height:50%;box-sizing:border-box}.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.layout-xl-row>.flex-xl-55{flex:1 1 100%;max-width:55%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-55{flex:1 1 100%;max-width:100%;max-height:55%;box-sizing:border-box}.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.layout-xl-row>.flex-xl-60{flex:1 1 100%;max-width:60%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-60{flex:1 1 100%;max-width:100%;max-height:60%;box-sizing:border-box}.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.layout-xl-row>.flex-xl-65{flex:1 1 100%;max-width:65%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-65{flex:1 1 100%;max-width:100%;max-height:65%;box-sizing:border-box}.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.layout-xl-row>.flex-xl-70{flex:1 1 100%;max-width:70%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-70{flex:1 1 100%;max-width:100%;max-height:70%;box-sizing:border-box}.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.layout-xl-row>.flex-xl-75{flex:1 1 100%;max-width:75%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-75{flex:1 1 100%;max-width:100%;max-height:75%;box-sizing:border-box}.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.layout-xl-row>.flex-xl-80{flex:1 1 100%;max-width:80%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-80{flex:1 1 100%;max-width:100%;max-height:80%;box-sizing:border-box}.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.layout-xl-row>.flex-xl-85{flex:1 1 100%;max-width:85%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-85{flex:1 1 100%;max-width:100%;max-height:85%;box-sizing:border-box}.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.layout-xl-row>.flex-xl-90{flex:1 1 100%;max-width:90%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-90{flex:1 1 100%;max-width:100%;max-height:90%;box-sizing:border-box}.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.layout-xl-row>.flex-xl-95{flex:1 1 100%;max-width:95%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-95{flex:1 1 100%;max-width:100%;max-height:95%;box-sizing:border-box}.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-xl-column>.flex-xl-100{flex:1 1 100%;max-width:100%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-33{flex:1 1 33.33%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-row>.flex-xl-66{flex:1 1 66.66%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-column>.flex-xl-33{flex:1 1 33.33%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-column>.flex-xl-66{flex:1 1 66.66%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-row>.flex-xl-33{flex:1 1 100%;max-width:33.33%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex-xl-66{flex:1 1 100%;max-width:66.66%;max-height:100%;box-sizing:border-box}.layout-xl-row>.flex{min-width:0}.layout-xl-column>.flex-xl-33{flex:1 1 100%;max-width:100%;max-height:33.33%;box-sizing:border-box}.layout-xl-column>.flex-xl-66{flex:1 1 100%;max-width:100%;max-height:66.66%;box-sizing:border-box}.layout-xl-column>.flex{min-height:0}.layout-xl,.layout-xl-column,.layout-xl-row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.layout-xl-column{flex-direction:column}.layout-xl-row{flex-direction:row}.hide:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-xs:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-sm:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-md:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show),.hide-gt-lg:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show){display:none}.hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show){display:none}}@media print{.hide-print:not(.show-print):not(.show){display:none !important}}:root{--xc-ws-div-color: #011f6a;--xc-ws-text-color: #ffffff;--xc-ws-text-button-color: #ffffff;--xc-ws-button-color: #011f6a;--xc-ws-background-color: #fafafa;--xc-ws-client-height: 450px;--xc-ws-client-width: 295px}span.ng-binding,span.field-description{user-select:none}.centered-text{text-align:center}::-webkit-scrollbar{width:0;background:transparent}::-webkit-scrollbar-thumb{background:transparent;border-radius:0px}.field-description{font-size:13px;line-height:14px;color:gray;padding:5px 0px 5px 0px}.field-description.error{color:#dd2c00}.md-button.upload-button{padding:0 16px;height:36px}md-icon.material-icons{color:inherit !important}.white-label,.md-toolbar-tools .title{user-select:none}.white-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.white-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-fab.upload-button,.md-fab.upload-button.md-button.md-default-theme.md-raised:not([disabled]) md-icon,.md-fab.upload-button.md-button.md-raised:not([disabled]) md-icon{color:var(--xc-ws-text-color) !important;background:var(--xc-ws-div-color) !important}.form-input-container span{word-break:break-all}.chat-online ::-webkit-scrollbar{width:5px;background:var(--xc-ws-div-color)}.chat-online ::-webkit-scrollbar-thumb{background:linear-gradient(13deg, var(--xc-ws-text-color), var(--xc-ws-div-color));border-radius:10px}.chat-online ::-webkit-scrollbar-thumb:hover{background:linear-gradient(13deg, var(--xc-ws-div-color), var(--xc-ws-text-color))}.chat-online form{display:flex;width:100%;height:calc(100% - 20px);overflow:auto;padding:1em 0px 40px 0px;position:relative;max-width:100%;overflow-x:hidden;margin-bottom:10px}.chat-online form .form-field{margin-right:10px;margin-left:10px}.chat-online form .form-input-container{width:100%;height:100%;overflow:auto;scrollbar-width:none}.chat-online form div[ng-switch-when=label] md-content{overflow:hidden}.chat-online form div[ng-switch-when=label] md-content span{overflow:hidden}.chat-online form div.online-button-wrapper,.chat-online form div.offline-button-wrapper{position:fixed;bottom:30px;left:0px;width:calc(100% - 40px);padding:0px 20px;display:flex;background:transparent;align-items:center;justify-content:center}.chat-online form div.online-button-wrapper button,.chat-online form div.offline-button-wrapper button{margin:8px 0px;padding:2px;width:100%}.chat-online form .layout-row,.chat-online form .layout-column{flex-wrap:wrap;justify-content:start}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button,.chat-online form .layout-column md-checkbox,.chat-online form .layout-column md-radio-button{padding:4px 0;margin-left:unset !important;word-break:break-all}.chat-online form .layout-row md-checkbox,.chat-online form .layout-row md-radio-button{min-width:50%;max-width:50%}.chat-online form button.upload-button{margin:6px 8px 6px 0}.chat-online form button.upload-button md-icon{font-size:20px}.chat-unmanaged{display:flex;flex-direction:column}.chat-unmanaged form{flex-grow:1;max-width:100%;overflow-x:hidden}.chat-closing{height:100%;padding:20px;overflow:hidden;align-items:stretch;justify-content:space-between}.chat-closing>md-content,.chat-closing>form{max-width:100%;overflow-x:hidden}.chat-closing>md-content,.chat-closing>md-content span,.chat-closing>form,.chat-closing>form span{width:100%}.logo{width:32px}#attachmentButton:hover .mdi-attachment:before{color:#555 !important;opacity:.85 !important}#input_text{position:relative !important;width:100% !important;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}#input_text:focus-within{border-color:#66afe9;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}#attachmentButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}i.icon_color{color:red}#sendButton{background:transparent !important;box-shadow:0 0px 0px 0 rgba(0,0,0,.26) !important;margin:0px !important;padding-top:1px !important;-webkit-font-smoothing:none !important}.emojionearea,.emojionearea.form-control{display:block;position:relative !important;width:100%;height:auto;padding:0;font-size:14px;border:0;background-color:#fff;border:0px solid #ccc !important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-webkit-box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;box-shadow:inset 0 0px 0px rgba(0,0,0,.075) !important;-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.mdi mdi-attachment mdi-24px mdi-light ng-scope::before{color:#a9a9a9}.mdi-attachment:hover{color:#555 !important}.mdi-24px.mdi-set,.mdi-24px.mdi:before{color:#a9a9a9}.md-button.md-fab.md-mini{line-height:20px !important;min-height:24px !important}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img{width:19px !important;height:19px !important;margin:0 1px !important}.emojionearea .emojionearea-picker{width:100% !important;right:0 !important;height:220px !important;top:0px !important}.emojionearea .emojionearea-picker .emojionearea-wrapper{position:relative;height:220px !important;width:100% !important}.emojionearea .emojionearea-picker.emojionearea-picker-position-top{margin-top:-100% !important}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top{margin-top:-236px !important;width:260px !important;min-width:260px !important}.emojionearea .emojionearea-picker .emojionearea-search>input{width:100px !important;min-width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search{width:100px !important}.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area{height:70% !important}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block{padding:0 !important}.emojionearea .emojionearea-picker .emojionearea-filters{background:#f5f7f9;padding:0 !important;height:40px}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter{width:25px !important;padding:7px 3px 0}#id-row,#chat-app{max-width:100%;width:100%;max-height:100%;height:100%}#chat-app{background-color:transparent}#chat-app .header-button{padding:0;margin:0;font-size:18px;cursor:pointer}ui-view{display:block;width:100%;height:100%}#chat-app .chat-toolbar{height:56px;min-height:56px;cursor:pointer;outline:0}#chat-app .chat-content{flex-grow:1;height:calc(100% - 56px);background:#fff;border:1px solid #d3d3d3;-ms-overflow-style:none;overflow:hidden;box-sizing:border-box}#chat-app .chat-content .chat-messages{height:calc(100% - 60px);overflow:auto;border-bottom:1px solid #d3d3d3}#chat-app .chat-content .chat-online{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .chat-content .chat-unmanaged{height:calc(100% - 40px);width:calc(100% - 20px);padding:20px 10px;overflow:hidden}#chat-app .avatar-wrapper{position:relative;bottom:-3px;right:5px}#chat-app .chat-content .message-row .bubble{word-wrap:break-word;position:relative;max-width:190px;padding:6px 7px 8px 9px;background-color:#fff;border-radius:6px}#chat-app .chat-content .message-row .bubble .message{white-space:pre-wrap}#chat-app .chat-content .message-row .bubble .message-done{color:#dcdcdc}#chat-app .chat-content .message-row .bubble .message-done-all{color:#00bfff}#chat-app .chat-content .message-row .bubble:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=);content:"";position:absolute;left:-11px;bottom:3px;width:12px;height:19px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain}#chat-app .chat-content .message-row .bubble .time{font-size:10px;text-align:right;margin-bottom:5px}#chat-app .chat-content .message-row.out .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.auto{align-items:flex-end;font-style:italic}#chat-app .chat-content .message-row.auto .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-size:17px;font-style:italic;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in{align-items:flex-end}#chat-app .chat-content .message-row.in2{align-items:flex-end}#chat-app .chat-content .message-row.out{align-items:flex-end}#chat-app .chat-content .message-row.in2 .avatar{margin:0 16px 0 0;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in2 .bubble{margin-right:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in2 .bubble:before{left:-11px;right:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=);-webkit-transform:rotate(180deg);transform:rotate(180deg)}#chat-app .chat-content .message-row.in .avatar{order:2;margin:0 0 0 16px;width:40px;min-width:40px;height:40px;line-height:40px;border-radius:50%;font-weight:500;text-align:center;color:#fff}#chat-app .chat-content .message-row.in .bubble{margin-left:auto;background-color:#e8f5e9;border:1px solid #dfebe0;order:1}#chat-app .chat-content .message-row.in .bubble:before{right:-11px;left:auto;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=)}#chat-app .chat-footer{width:100%}#waiting{overflow:visible;height:calc(100% - 64px);background:#fff;text-align:center;flex:1 0 auto;padding:32px}#waiting .subtitle{margin:16px 0;max-width:300px;color:rgba(0,0,0,.54)}.sk-fading-circle{width:40px;height:40px;position:relative}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:"";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,100%,39%{opacity:0}40%{opacity:1}}md-toast.md-success-toast .md-toast-content{background-color:green}md-toast.md-warning-toast .md-toast-content{color:#000;background-color:#f0ad4e}md-toast.md-failure-toast .md-toast-content{background-color:red}md-toast .md-toast-text{white-space:pre-line}md-toast.size .md-toast-content{font-weight:550;padding:0px;text-align:center;height:56px}md-toast.rounded .md-toast-content{border-radius:15px 15px 0px 0px}md-toast.squared .md-toast-content{border-radius:0px 0px 0px 0px}@media(min-device-width: 769px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:block}}@media(max-device-width: 768px){#chat-toolbar .mdi-download,#chat-toolbar .mdi-printer{display:none}}md-option .md-text{white-space:break-spaces}md-input-container{margin:0px 0px 8px 0px}.no-padding{padding:0 !important} /*# sourceMappingURL=app.css.map*/ \ No newline at end of file diff --git a/snippet/3.5.0/styles/app.css.map b/snippet/3.8.0/styles/app.css.map similarity index 99% rename from snippet/3.5.0/styles/app.css.map rename to snippet/3.8.0/styles/app.css.map index 88a6983..16765cb 100644 --- a/snippet/3.5.0/styles/app.css.map +++ b/snippet/3.8.0/styles/app.css.map @@ -1 +1 @@ -{"version":3,"file":"styles/app.css","mappings":"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B,cACE,cA1yByB,CA2yBzB,gBACA,iBAEF,cACE,cA9yByB,CA+yBzB,gBACA,iBAEF,aACE,cAlzByB,CAmzBzB,gBACA,iBAEF,UA/kBE,cAtOyB,CAuOzB,gBACA,sBAglBF,YA9jBE,cAzPyB,CA0PzB,gBACA,qBACA,iBAikBF,WAllBE,cAzOyB,CA0OzB,gBACA,qBACA,iBAklBF,WA9kBE,cAhPyB,CAiPzB,gBACA,qBACA,iBA8kBF,YACE,cAj0ByB,CAk0BzB,qBAEF,WACE,qBAOF,kCAKE,8CAl2BY,CAq2Bd,6BAIE,eA2bF,wBACE,YACA,OACA,kBACA,MACA,WAGF,wBACE,eAGF,qBACE,aAGF,kBACE,aAIF,2BACE,UACA,gBAGF,UACE,UACA,kBAEA,0BAGE,UACA,gBAGF,kCACE,UACA,6CA7tCa,CAguCf,kCACE,UACA,6CA9tCa,CAiuCf,2EAEE,UAGF,6BACE,YACA,eACA,WAGF,2BACE,YACA,kDAGF,2BACE,kDAIJ,sBACE,gBACA,OACA,gBACA,eACA,eACA,MAQF,gBACE,kBACA,cACA,YACA,kBACA,iBACA,gBAEE,gCACE,eAGJ,mCACE,gBACA,uBACA,YAEA,sDACE,iBAEF,wDACE,YAIA,gEACE,cACA,kBACA,QACA,QA/BuB,CAgCvB,UAjCqB,CAkCrB,WAlCqB,CAqCvB,+DAtmCJ,kBAikC2B,CAhkC3B,yEACE,eAsmCgF,CArmChF,iBA8jCyB,CA2C3B,qCAEE,aACA,mBACA,sBAEA,kBACA,iBACA,YACA,qDACE,WAGF,mGAGE,WACA,sBACA,YAGF,wDACE,kBACA,YACA,OAEA,kEACE,YACA,UACA,SACA,WAEF,+EACE,kBACA,MACA,OACA,WACA,WACA,gBAEA,6FACE,gBACA,WAEF,wFACE,+BACA,wGACE,UAGJ,wFACE,+BACA,wGACE,UAMV,qCAvvCA,eAEA,sBACA,YACA,gBACA,aACA,uBAmvCE,WACA,eACA,iBACA,YAnvCF,gDACE,aAovCF,6CACE,kBACA,iBACA,kBACA,UAjHyB,CAkHzB,WAlHyB,CAmHzB,eACA,YACA,kBACA,UACA,eACA,uBACA,gBACA,mDACE,WACA,kBACA,SACA,WACA,YACA,UACA,kBACA,mBACA,UACA,mDAz5CW,CA25Cb,mDACE,aAEA,yDACE,mBACA,UAGJ,qDACE,kBACA,QACA,SACA,gDACA,0DACE,eAGJ,sDACE,mBACA,mCACA,sEACE,mBAGJ,sDACE,mCACA,sEACE,mBAKN,8CAGE,sBACE,sBAEF,kDACE,YAKN,qIAEE,kBACA,qCACA,WA79CgB,CAi+ChB,YAEA,2JACE,iBAIJ,4BACE,sBACA,cACA,SACA,gBACA,gBACA,UAGF,mFAEE,WA7M4B,CAgN9B,6BACE,SACA,gBACA,UAEA,yDACE,eACA,gBACA,eACA,gBAzN0B,CA0N1B,WA1N0B,CA2N1B,kCACA,SACA,mBACA,uBAEA,+DACE,aAGF,oFACE,eAMN,8CACE,6CAEE,uBAOJ,YACE,yBAEA,kBACA,MACA,SACA,OACA,QAEA,UA3hDiB,CA6hDjB,6BACE,0BACA,WAEF,+BACE,WACA,sBAEF,+BACE,WAEF,qCACE,WAEF,gCACE,WAIF,6BACE,kBAGF,sBAEE,YAEA,+BACE,UAEF,yDACE,YAEF,+BACE,YACA,yBAEF,yDACE,UAeN,gBACE,kBACA,OACA,QACA,SACA,2BACA,UA5lDqB,CA8lDrB,qBACA,uBAEA,kCACA,mDArlDe,CAslDf,8BAEA,8BACE,cAGF,yBACE,UACA,kCAGF,gCACE,UACA,cACA,6CAIF,gCACE,6CACA,mDAtmDY,CAymDd,8BACE,6BACA,8CA7sDU,CA8sDV,gBA1CyB,CA2CzB,UACA,mBAGF,+BACE,qBACA,YACA,WACA,UAGF,6BACE,aACA,aAEA,mCACE,eAKF,qCACE,UACA,mBACA,WArE0B,CA4E9B,wBACE,kBACA,mBACA,cAEA,gCACE,aACA,mBACA,eACA,mBACA,mBAGF,qCACE,sBACA,mBACA,mBAEA,YAEA,cA5uDqB,CA6uDrB,iBA7uDqB,CA+vDrB,yBA1BF,qCAaI,wBACA,wBAFQ,CAKN,yDACE,uBAEF,qDACE,sBASN,gDA9BF,qCAaI,aACA,aAFQ,EAsBV,iDAlCF,qCAaI,wBACA,wBAFQ,E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2BACE,gBADF,2BACE,iBAQF,+CACE,iBACA,YACA,aACA,oBAMJ,4BACE,kBACA,WAn9IW,CAu9If,YACE,eACA,cACA,kBACA,UACA,qBACE,qBACA,UACA,kBAEF,mBACE,eACA,eACA,SACA,SACA,6BACA,YAGF,yCACE,WAIJ,0CACE,gBACA,eACA,iEACE,kBACA,yEACE,kBACA,UACA,WACA,QAnxIJ,SAoxImC,CAnxInC,mFACE,SAkxIqD,CAjxIrD,UAixIiC,CAEjC,iKA7xIF,qBA8xI0B,CA7xI1B,qLACE,qBA4xImE,CAGrE,qDACE,aACA,YACA,0DApyIF,UAqyIwB,CApyIxB,oEACE,WAmyI4B,CAE5B,sEAvyIF,WAwyIwB,CACpB,aAxyIJ,gFACE,UAsyI6B,CAI/B,0DACE,aAGF,gIAhzIA,eAizI2B,CAhzI3B,oJACE,gBA+yI+B,CAGjC,mDACE,UACA,8DACE,kBACA,SACA,WACA,oBACA,mBACA,kBArzIJ,iBAszImD,CArzInD,wEACE,cAozIqE,CAnzIrE,kBAmzIiD,CAC/C,oEACE,cACA,YACA,kBACA,QACA,WAn0IN,iDAo0I8B,CA7zI9B,UA8zIqC,CAp0IrC,8EACE,gDAk0IqE,CA5zIvE,8EACE,UA4zIyD,CA3zIzD,SA2zImC,CASvC,YACE,mBACA,qBACA,WALkB,CAMlB,kBAGF,kBACE,aACA,gBACA,SACA,UAGA,sBACA,aACA,mBAGF,2BACE,gBAIF,0BACE,iBACA,aACA,kBACA,gEAEA,gCACE,aAIJ,eAGE,sBACA,kBACA,SACA,OACA,WACA,WACA,0BACA,sBACA,0DAKA,0BACE,gBAKJ,qBACE,gBACA,mBAKF,gCACI,0BACA,+BAIJ,qBACI,kBACA,cAt5IF,qBAw5I0B,CAv5I1B,+BACE,sBAs5IqC,CAErC,oDACI,kBAGJ,+CACI,yDAGJ,yBACI,kBACA,iBACA,MACA,OAMR,mBACE,cACA,kBACA,WACA,UAN2B,CAQ3B,yBACA,2BAn7IA,qBAq7IwB,CAp7IxB,6BACE,sBAm7ImC,CAErC,gDACE,kBAGF,iCACE,cACA,kBACA,gBAEA,WACA,UAvByB,CAyBzB,sCAEA,yCACE,kBAEA,OACA,MACA,SAEA,WACA,UAnCuB,CAsCzB,mDACE,WACA,aACA,kBAEA,aACA,UA5CuB,CA6CvB,WAEA,6BACA,qCACA,8BAGF,oFAKE,gCAQE,wDACE,aAEF,wDACE,0BACA,iEAKJ,8DACE,aAKF,gEACE,8GAGF,gEACE,8GAKJ,wGAEE,eAEA,iHACE,oBAEF,iHACE,oBAON,gDACE,wCAEA,0BAEA,kEACE,cACA,oCAKN,iBACE,GACE,UACA,wCAEF,KACE,UACA,wCAGJ,kBACE,GACE,UACA,8BAEF,IACE,UAEF,KACE,UACA,kCAGJ,oDACE,GACE,sBACA,iCAEF,MACE,sBACA,iFAEF,OACE,uBACA,+EAEF,KACE,uBAGJ,8CACE,GACE,sBACA,iCAEF,IACE,sBACA,sEAEF,OACE,WACA,gFAEF,KACE,qBAGJ,oDACE,GACE,sBACA,0FAEF,OACE,uBACA,0FAEF,OACE,uBACA,0FAEF,KACE,uBAGJ,8CACE,GACE,qBACA,wEAEF,IACE,aACA,iFAEF,OACE,WACA,2EAEF,KACE,sBAoBJ,gBACE,sBACA,cACA,kBAba,CAcb,mBACA,eACA,kBAGA,0BAhBA,eAEA,wCACE,eAiBF,8BACE,kBACA,QACA,2BACA,sBACA,qBACA,UAjCU,CAkCV,WAlCU,CAmCV,eAjqJF,MAkqJqB,CAlqJrB,UAmqJsB,CAlqJtB,wCACE,SAgqJsB,CAjqJxB,wCACE,OAiqJ0B,CAE1B,mDACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAGF,qCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAIJ,mDACG,QAjEY,CAoEf,wBACE,sBACA,kBACA,MACA,OACA,UA5EU,CA6EV,WA7EU,CA8EV,mBACA,iBACA,kBACA,kCAGF,uBACE,sBACA,kBACA,MACA,OACA,UAzFU,CA0FV,WA1FU,CA2FV,kBACA,+BACA,mBAGF,kCACE,qBAGF,0BACE,sBACA,kBACA,qBAruJF,gBAuuJ4B,CAvuJ5B,cAwuJ6B,CAE3B,sBACA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xRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,0EACE,yBAEA,gFACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,iEACE,eAIA,uFACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA0+JF,qEAtoKF,2BAuoK8B,CAvoK9B,iBAwoK+B,CAvoK/B,+EACE,gBAqoK8D,CAtoKhE,+EACE,4BAsoKmC,CASvC,WACE,sBACA,kBACA,sBACA,UA52KgB,CA82KhB,WAVqB,CAWrB,eAXqB,CAYrB,SACA,cACA,iCAEA,cACE,gBASF,qBACE,aAIF,qDAEE,aACA,2BAIF,kGAEE,mDAl4Ka,CAs4Kf,+DAEE,gBACA,aACA,+BAIF,uKAIE,gBACA,aACA,+BAIF,2CACE,gBACA,aACA,+BAIF,wCACE,gBACA,aACA,gCAIF,wEACE,qGAEA,mBACA,uBAIF,+CACE,qGAKF,wCACE,qGAEA,mBACA,uBAKJ,oCACE,aAGF,4BACE,OACA,MACA,gCACA,gDACE,mCAIJ,kBACE,UACA,MACA,8BACA,4BACE,2BAIJ,yBACE,WACE,eA1HoB,EA8HxB,yBACE,WACE,wBACA,4BACA,6BAKJ,8CACE,4BACE,4BAEF,kBACE,4BA8BJ,4BACE,GACE,qBAEF,IACE,mBAEF,KACE,sBAIJ,oCACE,GACE,qBAEF,IACE,qBAEF,KACE,oBAIJ,mCACE,GACE,qBACA,UAEF,IACE,mBACA,UAEF,KACE,oBAaJ,UACE,WAzEa,CA0Eb,eAzEiB,CA0EjB,kBACA,gBACA,iBACA,UACA,cACA,mBAEA,8BACE,sBAGF,6BACE,aACA,WACA,YAGF,6BACE,kBAMF,8BACE,WACA,kBACA,SACA,UApGmB,CAsGrB,oBACE,kBACA,OACA,QACA,YAEF,yBACE,oDACA,iCAEF,0BACE,kBACA,OACA,QACA,YAEF,iCAIE,WACA,YAMF,8BACE,kBA75KF,MA85KiC,CAC/B,QACA,qCACA,oDACA,sCAj6KF,wCACE,SA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,CAC7C,WAn5LF,kCACE,gBAi5LkD,CAh5LlD,eAg5L6C,CAI/C,oCA95LA,oBA+5L6B,CA/5L7B,eAg6L4B,CA/5L5B,8CACE,gBA65LoC,CA95LtC,8CACE,mBA85L+B,CAK/B,2FAEE,gBAKF,sCACE,UACA,SACA,WACA,YAIJ,oBACE,yBACA,eACA,WAGF,kBACE,SACA,WACA,QACA,WAhFgB,CAiFhB,kBACA,kBAGF,8BACE,QACA,OACA,WACA,kBACA,+BACA,UAEF,yCACE,kCAGF,oBACE,kBACA,SACA,OACA,MACA,aACA,WAtGgB,CAuGhB,UAvGgB,CAwGhB,kBACA,0GAptMoB,CAstMpB,2BACE,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,yCACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKF,0HAGE,0BA1rMS,CA2rMT,+CAEF,0EAEE,sBAMN,8CACE,mCACE,sBAEF,8CACE,yBAEF,qCACE,uBAQJ,+BACE,aACA,cACA,gBAGF,YACE,kBACA,MACA,OACA,QACA,SACA,WACA,UAGF,QACE,cACA,SACA,kBACA,gBACA,kBACA,cACA,wDACE,iBAEF,8BACE,mBA7BiB,CA+BjB,8CACE,kBACA,SACA,OACA,QACA,WApCe,CAqCf,UAEF,sDACE,MACA,WAzCe,CA6CjB,kDACE,aACA,kBACA,SACA,UACA,WACA,YACA,iBAGA,mDACE,kBAKJ,0CACE,qBACA,mBAGA,0EACE,SAMR,gBACE,cACA,kBAEA,0BACA,8DACE,YACA,UAlFmB,CAmFnB,kBACA,QACA,2BACA,gBACA,UACA,eACA,eACA,+CACA,iDAhzMgB,CAizMhB,0EACE,aAEF,sFACE,YACA,eAEF,gFACE,gBAEF,8EACE,kBACA,QACA,SACA,gCAIF,kFACE,2CAGJ,+BA3nMA,MA4nMiC,CAC/B,yDA5nMF,yCACE,SA0nMkC,CAznMlC,OAynM+B,CAGjC,+BA/nMA,OAgoMiC,CAC/B,yDAhoMF,yCACE,UA8nMkC,CA7nMlC,MA6nM+B,CAI/B,uCACE,+CAIF,sDACE,WACA,mBACA,kEACE,YAMR,eAEE,kBACA,gBACA,cACA,WA7ImB,CA7mMnB,qBACE,WACA,cACA,WAwvMF,iCACE,kBACA,MA3pMF,MA4pMiC,CA3pMjC,2CACE,SA0pMkC,CAzpMlC,OAypM+B,CAEjC,4BACE,cAEF,8BACE,aACA,sBACA,kBACA,sCACE,WACA,qBAKN,sBAEE,WAnKmB,CAoKnB,aACA,wDACA,kBAjrMA,MAkrM+B,CAC/B,0BArxMA,4BACE,WACA,cACA,WAgGF,gCACE,SAgrMgC,CA/qMhC,OA+qM6B,CAE/B,qCACE,kBACA,uBAEF,kCACE,eAEF,yBACE,kCACE,iBAKN,wBACE,cACA,kBACA,QA1LmB,CA2LnB,OACA,QACA,SACA,gBAGF,eACE,aACA,kBACA,MACA,OACA,QACA,SACA,wDACA,cAEA,0BACA,4BACE,YACA,gBAEF,wDACE,gBAEF,uCAruMA,2BAsuM0B,CACxB,iCACA,kBAvuMF,iDACE,0BAouM2C,CAG3C,yCACE,gCACA,oBAl7MuB,CAm7MvB,kBAGJ,wCA/uMA,0BAgvM0B,CACxB,iCACA,kBAjvMF,kDACE,2BA8uM0C,CAG1C,0CACE,gCACA,oBA57MuB,CA67MvB,kBAGJ,mBACE,cACA,YACA,4BACE,iCAKN,WAGE,kBACA,UACA,WACA,SACA,WACA,mBACE,+FAGF,oBACE,+FAKJ,OACE,kBACA,WACA,aAGF,QACE,eACA,kBACA,iBACA,aACA,gEACA,eACA,mBACA,kBACA,yBAnyMA,UAoyMoB,CACpB,gBACA,sBACA,gBACA,uBAvyMA,kBACE,WAkyMwB,CAK1B,iCACE,gBACA,aAEF,kBACE,eAEF,oBACE,oBACA,mBACA,iBACA,uBACA,WACA,eAEF,iBACE,gBAIJ,wDACE,yBACA,0BAUF,eACE,cAGF,SACE,kBACA,WA/iNc,CAijNd,sBACA,eACA,gBAGA,WA5lNa,CA+lNb,UACA,mDAviNe,CAyiNf,2BACE,aACA,mBACA,mBAEA,iBACA,eAEA,gBAKA,eAEA,uCACA,kBACA,eAEA,gBAGA,6CACA,mDAhkNa,CA6Mf,0BAq3MgC,CAj4MhC,m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u2NiC,CAC/B,mBAv2NF,yFACE,UAq2NqC,CAp2NrC,SAo2N+B,CAKnC,qCACE,0GAhnOsB,CAknOxB,mBACE,0GAlnOsB,CAonOxB,mBACE,0GApnOsB,CAsnOxB,qCACE,2GAtnOsB,CAwnOxB,mBACE,2GAxnOsB,CA0nOxB,mBACE,4GA1nOsB,CA4nOxB,qCACE,4GA5nOsB,CA8nOxB,mBACE,4GA9nOsB,CAgoOxB,mBACE,4GAhoOsB,CAkoOxB,sCACE,6GAloOuB,CAooOzB,oBACE,6GApoOuB,CAsoOzB,oBACE,6GAtoOuB,CAwoOzB,sCACE,6GAxoOuB,CA0oOzB,oBACE,6GA1oOuB,CA4oOzB,oBACE,6GA5oOuB,CA8oOzB,oBACE,8GA9oOuB,CAgpOzB,oBACE,8GAhpOuB,CAkpOzB,oBACE,8GAlpOuB,CAopOzB,oBACE,8GAppOuB,CAspOzB,oBACE,+GAtpOuB,CAwpOzB,oBACE,+GAxpOuB,CA0pOzB,oBACE,+GA1pOuB,CA4pOzB,oBACE,+GA5pOuB,CA8pOzB,oBACE,+GA9pOuB,CAiqOzB,8CACE,cACE,uBAIJ,aACE,8BACE,uBAOJ,0EACE,wBAaF,4BACE,aACE,SACA,WACA,gBACA,aA/4MA,YACC,QAeD,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SAmBF,gFA5mBF,aA8mByD,CA7mBzD,wHACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,gFA5mBF,cA6mB+D,CA5mB/D,wHACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,oFACE,2BAeF,oFA7oBF,0BA8oBiD,CA7oBjD,4HACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,0CAGE,2BACA,sBACA,oBAIF,6HAME,2BAIF,kIAME,uBAIF,mHAME,yBAIF,gKAME,6BAIF,qKAME,8BAUF,gJAME,uBACA,yBAIF,qJAME,mBACA,qBACA,eAIF,+JAME,eACA,sBAIF,sIAME,qBACA,uBAIF,0JAME,oBACA,sBA9NF,mCAEA,+CACA,kDACA,+CACA,+CACA,mDACA,iDAME,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAGe,YAGjB,uBACE,cACA,eACA,cACA,sBArBF,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAMF,uBACE,cACA,eACA,cACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,UACE,cACA,eACA,gBACA,sBAGF,sBACE,cACA,eACA,gBACA,sBAMF,yBACE,cACA,eACA,gBACA,sBA2BF,8EACA,8EAIA,4FACA,4FAIA,+FACA,+FAIA,0FACA,0FAGA,8BAIA,6FACA,6FAGA,kCA9GF,mCACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,qCACA,+BAkPA,8CAGE,YAGF,mMAaE,YAIF,+KASE,aAKF,4CAGE,WAGF,0LAaE,WAIF,gJAQE,YAGF,aACE,eAGF,eACI,iBAGJ,aACE,SACA,WACA,gBACA,YAwgMJ,yBAGI,iEACE,aAz5MF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,k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CE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGAC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BAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCA61MF,+CAEI,sGACE,aAGJ,mDACE,aA56MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA02MF,yBAl7MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAg3MF,gDAGI,+MACE,aAGJ,oEACE,aAh8MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA63MF,0BAr8MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF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ACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,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A,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAg5MF,0BAx9MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,qCAxEE,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,kCAs5ME,ugBACE,aAGJ,sGACE,cAMJ,aAEE,wCACE,yBN13OJ,MACE,2BACA,4BACA,mCACA,8BACA,kCACA,6BACA,4BAIA,uCAEE,iBAUJ,eACE,kBAIF,oBACE,QACA,uBAGF,0BACE,uBACA,kBAGF,mBACE,eACA,iBACA,WACA,wBAEA,yBACE,cAIJ,yBACE,eACA,YAGF,uBACE,yBAGF,sCAEE,iBAGF,aACE,mBACA,gBACA,uBAIA,kBACE,gBACA,uBACA,mBAKF,2KAGE,yCACA,6CAKF,2BACE,qBAKF,iCACE,UACA,kCAGF,uCACE,mFAKA,mBAEA,6CACE,mFAQJ,kBACE,aACA,WACA,yBACA,cACA,yBACA,kBACA,eACA,kBACA,mBAEA,8BACE,kBACA,iBAGF,wCACE,WACA,YACA,cAEA,qBAIF,uDACE,gBAEA,4DACE,gBAMJ,yFAEE,eACA,YACA,SACA,wBACA,iBACA,aACA,uBACA,mBACA,uBACA,uGACE,eACA,YACA,WAIJ,+DAEE,eACA,sBACA,sLAEE,cACA,6BACA,qBAKF,wFAEE,cACA,cAIJ,uCACE,qBACA,+CACE,eAMR,gBACE,aACA,sBACA,qBACE,YACA,eACA,kBAIJ,cACE,YACA,aACA,gBACA,oBACA,8BAEA,4CAEE,eACA,kBACA,kGAEE,WAKN,MACE,WAGF,+CACE,sBACA,uBAGF,YACE,6BACA,sBACA,YACA,UACA,eACA,SACA,sBACA,sBACA,uBACA,0BACA,kBACA,iDACA,oDACA,4CACA,+EAEA,wEACA,qFAEA,qEAGF,yBACE,qBACA,UACA,8EAEA,iFAEA,yEAIF,kBACE,kCACA,kDACA,sBACA,2BACA,uCAGF,aACE,UAGF,YACE,kCACA,kDACA,sBACA,2BACA,uCAGF,yCAEE,cACA,6BACA,WACA,YACA,UACA,eACA,SACA,sBACA,iCACA,uBACA,0BACA,kBACA,4DACA,+DACA,uDACA,+EAEA,wEACA,qFAEA,qEAGF,wDACE,cAGF,sBACE,sBAGF,uCAEE,cAGF,0BACE,4BAGA,2BAGF,kFAKE,sBACA,uBACA,wBAGF,mCACE,sBACA,mBACA,wBACA,mBAGF,yDACE,kBACA,wBACA,sBAGF,oEACE,4BAGF,4EACE,6BACA,uBACA,2BAGF,8DACE,uBACA,2BAGF,wDACE,uBAGF,wFAIE,sBAGF,0FAIE,qBAGF,yDACE,mBACA,qBACA,YAGF,8EACE,sBACA,kBAGF,kBAEE,eACA,WACA,gBACA,YAOF,UAGE,6BAGF,yBACE,UACA,SACA,eACA,eAIF,QACE,cACA,WACA,YAKF,wBAEE,WAJoB,CAKpB,eALoB,CAQpB,eACA,UAGF,wBAEE,YACA,yBAGA,gBAEA,yBACA,wBACA,gBACA,sBAGF,uCACE,yBACA,cACA,gCAGF,qCACE,yBACA,wBACA,kBACA,gBAGF,wCACE,yBACA,wBACA,kBACA,gBAGF,0BACE,kBACA,YACA,UAGF,6CACE,qBACA,kBACA,gBACA,wBACA,sBACA,kBAGF,sDACE,qBAGF,2DACE,cAGF,+DACE,cAEF,oDACE,yDACA,WACA,kBACA,WACA,WACA,WACA,YACA,4BACA,4BACA,wBAGF,mDACE,eACA,iBACA,kBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,0CACE,qBACA,kBAGF,kDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,eACA,kBACA,gBACA,kBACA,WAGF,wCACE,qBAGF,yCACE,qBAGF,yCACE,qBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,iDACE,kBACA,yBACA,yBACA,QAGF,wDACE,WACA,WACA,yDACA,iCACA,yBAGF,gDACE,QACA,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,gDACE,iBACA,yBACA,yBACA,QAGF,uDACE,YACA,UACA,yDAGF,uBACE,WAIF,SACE,iBACA,yBAEA,gBACA,kBACA,cACA,aAGF,mBACE,cACA,gBACA,sBAGF,kBACE,WACA,YACA,kBAGF,6BACE,WACA,YACA,kBACA,OACA,MAGF,oCACE,WACA,cACA,cACA,UACA,WACA,sBACA,mBACA,oEACA,4DAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,qCACE,8BACA,sBAGF,qCACE,4BACA,oBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,YAGE,UAGF,IACE,WAIJ,8BACE,YAGE,UAGF,IACE,WAIJ,4CACE,uBAGF,4CACE,yBACA,cAGF,4CACE,qBAGF,gCACE,gBACA,YACA,kBACA,YAGF,mCACE,gCAGF,mCACE,8BAGF,gCACE,uDAEE,eAIJ,gCACE,uDAEE,cAIJ,mBACE,yBAGF,mBACE,uBAGF,YACE","sources":["webpack://motion-chat/./src/styles/app.scss","webpack://motion-chat/./node_modules/mdi/scss/_path.scss","webpack://motion-chat/./node_modules/mdi/scss/_core.scss","webpack://motion-chat/./node_modules/mdi/scss/_icons.scss","webpack://motion-chat/./node_modules/mdi/scss/_extras.scss","webpack://motion-chat/./node_modules/mdi/scss/_animated.scss","webpack://motion-chat/./node_modules/angular-material/angular-material.scss"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"styles/app.css","mappings":"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B,cACE,cA1yByB,CA2yBzB,gBACA,iBAEF,cACE,cA9yByB,CA+yBzB,gBACA,iBAEF,aACE,cAlzByB,CAmzBzB,gBACA,iBAEF,UA/kBE,cAtOyB,CAuOzB,gBACA,sBAglBF,YA9jBE,cAzPyB,CA0PzB,gBACA,qBACA,iBAikBF,WAllBE,cAzOyB,CA0OzB,gBACA,qBACA,iBAklBF,WA9kBE,cAhPyB,CAiPzB,gBACA,qBACA,iBA8kBF,YACE,cAj0ByB,CAk0BzB,qBAEF,WACE,qBAOF,kCAKE,8CAl2BY,CAq2Bd,6BAIE,eA2bF,wBACE,YACA,OACA,kBACA,MACA,WAGF,wBACE,eAGF,qBACE,aAGF,kBACE,aAIF,2BACE,UACA,gBAGF,UACE,UACA,kBAEA,0BAGE,UACA,gBAGF,kCACE,UACA,6CA7tCa,CAguCf,kCACE,UACA,6CA9tCa,CAiuCf,2EAEE,UAGF,6BACE,YACA,eACA,WAGF,2BACE,YACA,kDAGF,2BACE,kDAIJ,sBACE,gBACA,OACA,gBACA,eACA,eACA,MAQF,gBACE,kBACA,cACA,YACA,kBACA,iBACA,gBAEE,gCACE,eAGJ,mCACE,gBACA,uBACA,YAEA,sDACE,iBAEF,wDACE,YAIA,gEACE,cACA,kBACA,QACA,QA/BuB,CAgCvB,UAjCqB,CAkCrB,WAlCqB,CAqCvB,+DAtmCJ,kBAikC2B,CAhkC3B,yEACE,eAsmCgF,CArmChF,iBA8jCyB,CA2C3B,qCAEE,aACA,mBACA,sBAEA,kBACA,iBACA,YACA,qDACE,WAGF,mGAGE,WACA,sBACA,YAGF,wDACE,kBACA,YACA,OAEA,kEACE,YACA,UACA,SACA,WAEF,+EACE,kBACA,MACA,OACA,WACA,WACA,gBAEA,6FACE,gBACA,WAEF,wFACE,+BACA,wGACE,UAGJ,wFACE,+BACA,wGACE,UAMV,qCAvvCA,eAEA,sBACA,YACA,gBACA,aACA,uBAmvCE,WACA,eACA,iBACA,YAnvCF,gDACE,aAovCF,6CACE,kBACA,iBACA,kBACA,UAjHyB,CAkHzB,WAlHyB,CAmHzB,eACA,YACA,kBACA,UACA,eACA,uBACA,gBACA,mDACE,WACA,kBACA,SACA,WACA,YACA,UACA,kBACA,mBACA,UACA,mDAz5CW,CA25Cb,mDACE,aAEA,yDACE,mBACA,UAGJ,qDACE,kBACA,QACA,SACA,gDACA,0DACE,eAGJ,sDACE,mBACA,mCACA,sEACE,mBAGJ,sDACE,mCACA,sEACE,mBAKN,8CAGE,sBACE,sBAEF,kDACE,YAKN,qIAEE,kBACA,qCACA,WA79CgB,CAi+ChB,YAEA,2JACE,iBAIJ,4BACE,sBACA,cACA,SACA,gBACA,gBACA,UAGF,mFAEE,WA7M4B,CAgN9B,6BACE,SACA,gBACA,UAEA,yDACE,eACA,gBACA,eACA,gBAzN0B,CA0N1B,WA1N0B,CA2N1B,kCACA,SACA,mBACA,uBAEA,+DACE,aAGF,oFACE,eAMN,8CACE,6CAEE,uBAOJ,YACE,yBAEA,kBACA,MACA,SACA,OACA,QAEA,UA3hDiB,CA6hDjB,6BACE,0BACA,WAEF,+BACE,WACA,sBAEF,+BACE,WAEF,qCACE,WAEF,gCACE,WAIF,6BACE,kBAGF,sBAEE,YAEA,+BACE,UAEF,yDACE,YAEF,+BACE,YACA,yBAEF,yDACE,UAeN,gBACE,kBACA,OACA,QACA,SACA,2BACA,UA5lDqB,CA8lDrB,qBACA,uBAEA,kCACA,mDArlDe,CAslDf,8BAEA,8BACE,cAGF,yBACE,UACA,kCAGF,gCACE,UACA,cACA,6CAIF,gCACE,6CACA,mDAtmDY,CAymDd,8BACE,6BACA,8CA7sDU,CA8sDV,gBA1CyB,CA2CzB,UACA,mBAGF,+BACE,qBACA,YACA,WACA,UAGF,6BACE,aACA,aAEA,mCACE,eAKF,qCACE,UACA,mBACA,WArE0B,CA4E9B,wBACE,kBACA,mBACA,cAEA,gCACE,aACA,mBACA,eACA,mBACA,mBAGF,qCACE,sBACA,mBACA,mBAEA,YAEA,cA5uDqB,CA6uDrB,iBA7uDqB,CA+vDrB,yBA1BF,qCAaI,wBACA,wBAFQ,CAKN,yDACE,uBAEF,qDACE,sBASN,gDA9BF,qCAaI,aACA,aAFQ,EAsBV,iDAlCF,qCAaI,wBACA,wBAFQ,E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2BACE,gBADF,2BACE,iBAQF,+CACE,iBACA,YACA,aACA,oBAMJ,4BACE,kBACA,WAn9IW,CAu9If,YACE,eACA,cACA,kBACA,UACA,qBACE,qBACA,UACA,kBAEF,mBACE,eACA,eACA,SACA,SACA,6BACA,YAGF,yCACE,WAIJ,0CACE,gBACA,eACA,iEACE,kBACA,yEACE,kBACA,UACA,WACA,QAnxIJ,SAoxImC,CAnxInC,mFACE,SAkxIqD,CAjxIrD,UAixIiC,CAEjC,iKA7xIF,qBA8xI0B,CA7xI1B,qLACE,qBA4xImE,CAGrE,qDACE,aACA,YACA,0DApyIF,UAqyIwB,CApyIxB,oEACE,WAmyI4B,CAE5B,sEAvyIF,WAwyIwB,CACpB,aAxyIJ,gFACE,UAsyI6B,CAI/B,0DACE,aAGF,gIAhzIA,eAizI2B,CAhzI3B,oJACE,gBA+yI+B,CAGjC,mDACE,UACA,8DACE,kBACA,SACA,WACA,oBACA,mBACA,kBArzIJ,iBAszImD,CArzInD,wEACE,cAozIqE,CAnzIrE,kBAmzIiD,CAC/C,oEACE,cACA,YACA,kBACA,QACA,WAn0IN,iDAo0I8B,CA7zI9B,UA8zIqC,CAp0IrC,8EACE,gDAk0IqE,CA5zIvE,8EACE,UA4zIyD,CA3zIzD,SA2zImC,CASvC,YACE,mBACA,qBACA,WALkB,CAMlB,kBAGF,kBACE,aACA,gBACA,SACA,UAGA,sBACA,aACA,mBAGF,2BACE,gBAIF,0BACE,iBACA,aACA,kBACA,gEAEA,gCACE,aAIJ,eAGE,sBACA,kBACA,SACA,OACA,WACA,WACA,0BACA,sBACA,0DAKA,0BACE,gBAKJ,qBACE,gBACA,mBAKF,gCACI,0BACA,+BAIJ,qBACI,kBACA,cAt5IF,qBAw5I0B,CAv5I1B,+BACE,sBAs5IqC,CAErC,oDACI,kBAGJ,+CACI,yDAGJ,yBACI,kBACA,iBACA,MACA,OAMR,mBACE,cACA,kBACA,WACA,UAN2B,CAQ3B,yBACA,2BAn7IA,qBAq7IwB,CAp7IxB,6BACE,sBAm7ImC,CAErC,gDACE,kBAGF,iCACE,cACA,kBACA,gBAEA,WACA,UAvByB,CAyBzB,sCAEA,yCACE,kBAEA,OACA,MACA,SAEA,WACA,UAnCuB,CAsCzB,mDACE,WACA,aACA,kBAEA,aACA,UA5CuB,CA6CvB,WAEA,6BACA,qCACA,8BAGF,oFAKE,gCAQE,wDACE,aAEF,wDACE,0BACA,iEAKJ,8DACE,aAKF,gEACE,8GAGF,gEACE,8GAKJ,wGAEE,eAEA,iHACE,oBAEF,iHACE,oBAON,gDACE,wCAEA,0BAEA,kEACE,cACA,oCAKN,iBACE,GACE,UACA,wCAEF,KACE,UACA,wCAGJ,kBACE,GACE,UACA,8BAEF,IACE,UAEF,KACE,UACA,kCAGJ,oDACE,GACE,sBACA,iCAEF,MACE,sBACA,iFAEF,OACE,uBACA,+EAEF,KACE,uBAGJ,8CACE,GACE,sBACA,iCAEF,IACE,sBACA,sEAEF,OACE,WACA,gFAEF,KACE,qBAGJ,oDACE,GACE,sBACA,0FAEF,OACE,uBACA,0FAEF,OACE,uBACA,0FAEF,KACE,uBAGJ,8CACE,GACE,qBACA,wEAEF,IACE,aACA,iFAEF,OACE,WACA,2EAEF,KACE,sBAoBJ,gBACE,sBACA,cACA,kBAba,CAcb,mBACA,eACA,kBAGA,0BAhBA,eAEA,wCACE,eAiBF,8BACE,kBACA,QACA,2BACA,sBACA,qBACA,UAjCU,CAkCV,WAlCU,CAmCV,eAjqJF,MAkqJqB,CAlqJrB,UAmqJsB,CAlqJtB,wCACE,SAgqJsB,CAjqJxB,wCACE,OAiqJ0B,CAE1B,mDACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAGF,qCACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAIJ,mDACG,QAjEY,CAoEf,wBACE,sBACA,kBACA,MACA,OACA,UA5EU,CA6EV,WA7EU,CA8EV,mBACA,iBACA,kBACA,kCAGF,uBACE,sBACA,kBACA,MACA,OACA,UAzFU,CA0FV,WA1FU,CA2FV,kBACA,+BACA,mBAGF,kCACE,qBAGF,0BACE,sBACA,kBACA,qBAruJF,gBAuuJ4B,CAvuJ5B,cAwuJ6B,CAE3B,sBACA,mBACA,oBACA,WA5uJF,oCACE,aAquJ6D,CAtuJ/D,oCACE,iBAsuJ8B,CAUhC,qBACE,aAIA,wEACE,UACA,SACA,WACA,YAIF,oFACE,UACA,SACA,WACA,YAIJ,yCAlIA,eAEA,uDACE,eA36IF,yBAGI,kFA6iJJ,iBA1iJA,+CAII,4LAsiJJ,iBAniJA,gDAKI,ySA8hJJ,iBA3hJA,iDAMI,gbAqhJJ,iBAlhJA,0BAOI,qoBA2gJJ,iBAIA,+BACE,mBACA,+CACE,qBACA,YACA,yBACA,sBACA,aACA,gBAEA,yDACE,QAEF,6DACE,eAMR,8CACE,wCACE,uBA0BA,8EACE,0DAl0JJ,yBAm0JmC,CAl0JnC,wFACE,0BAi0J2C,CAKzC,4HACE,6CAMR,0BACE,eACA,OACA,MACA,UA/iKe,CAgjKf,UACA,aAGA,2BAGA,6CACE,oBAGF,+CACE,cACA,4BAIF,oCACE,cACA,UACA,mDACE,mDAtjKW,CAujKX,0BACA,qDACE,UACA,mDAtjKQ,CAujKR,0BACA,uBAMN,mCACE,UACA,mDAhkKY,CAikKZ,0BAIJ,0BACE,eAnEoB,CAuEpB,0EAEE,cA3Ec,CA6EhB,6BACE,QAUA,4PACE,aACA,eACA,mBAOF,+DACE,0BACA,mBAKN,UACE,aAII,4MACE,aACA,eACA,mBAKN,qCAIE,uCAGA,wBACA,2BAIA,mBACA,gBACA,0BAGF,gBACE,aAEF,0BACE,eAGA,gCACE,eAGA,iDACE,0BACA,wBACA,mBASF,oEACE,uBA9mKqB,CAmnKzB,wDAIE,uCAGJ,8CACE,gBACA,uBA7nKyB,CA8nKzB,mBACA,oEAv+JF,cAw+J+B,CAx+J/B,iBAnKwB,CAoKxB,8EACE,gBArKsB,CAoKxB,8EACE,eAu+JwD,CAK5D,iBACE,aACA,mBACA,eA9LyB,CA+LzB,kBA9L4B,CApzJ5B,cAm/J2B,CAn/J3B,iBAnKwB,CAwpKxB,uBAxM4B,CAyM5B,0BACA,+BACA,kBACA,uBACA,eACA,gBACA,mBACA,0BACA,YA7/JA,2BACE,gBArKsB,CAoKxB,2BACE,eAk/JoD,CAYtD,2CACE,eACA,cACA,uBACA,mBACA,gBAEA,oDACE,eAIJ,iCACE,cA7gKF,oBA8gK4B,CA9gK5B,gBA+gK2B,CACzB,WACA,2BACA,iBAjhKF,2CACE,sBA4gKoC,CA7gKtC,2CACE,eA6gKgC,CAMlC,uCACE,cACA,YACA,kBACA,QAzhKF,UA0hKsB,CA1hKtB,SA2hKqB,CACnB,WACA,eACA,sBA7hKF,iDACE,UAwhK0B,CAzhK5B,iDACE,SAyhKyB,CAM3B,uCACE,aACA,QACA,oBACA,mCACA,UAIJ,eACE,aACA,sBAYA,0GApzKsB,CAqzKtB,iBACA,eA3QqB,CA4QrB,kBA3jKA,yBA6jK+B,CAE/B,mBAlBA,0BACE,8BAIA,4CACE,eAx0KqB,CAy0KrB,kBAz0KqB,CAsRzB,yBACE,0BA2jKuC,CAIzC,0BACE,gBACA,eApRmB,CAqRnB,iBACA,gBAEF,iBACE,UAIJ,UACE,eACA,kBACA,aACA,mBACA,WACA,kCAiBA,sBACA,WArTqB,CAqSrB,oBACE,eAGF,gBACE,aAGF,mBAxtKA,0BAD2B,CAE3B,wBAF2B,CAG3B,uBAH2B,CAI3B,qBAJ2B,CAK3B,oBAL2B,CAM3B,gBAN2B,CA2tKzB,WACA,mBACA,gBACA,uBAMJ,YACE,cACA,kBACE,cACA,eACA,yBACA,aACA,gBAEF,sBACE,kBACA,mBAIJ,8CACE,oBACE,6BAEF,eACE,uBAKF,uDAhoKA,iBAioK6B,CAjoK7B,kBAgzJsB,CA/yJtB,iEACE,iBA8yJoB,CA/yJtB,iEACE,kBAgoKoD,CA9kKtD,qEACE,kBACA,QACA,2BAEA,sBACA,qBAEA,UAvOa,CAwOb,WAxOa,CA2Kf,MA8DqB,CA9DrB,UA+DsB,CA9DtB,+EACE,SA4DsB,CA7DxB,+EACE,OA6D0B,CAE1B,4EACE,sBACA,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,2EACE,sBACA,WACA,kBACA,UACA,YACA,aACA,WAGF,0FACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKJ,gEACE,sBACA,iBACA,kBACA,MACA,OACA,UAzRa,CA0Rb,WA1Ra,CA2Rb,gBAxRoB,CAyRpB,mBACA,iBA3RqB,CA8RvB,0EACE,yBAEA,gFACE,sBACA,wBACA,kBACA,SACA,QACA,cACA,UACA,YACA,gBAzSkB,CA0SlB,mBACA,aACA,cACA,WAKJ,iEACE,eAIA,uFACE,sBACA,kBACA,QACA,SACA,gCACA,cACA,aACA,UA/TkB,CAgUlB,gBAhUkB,CAiUlB,mBACA,aACA,cACA,WA0+JF,qEAtoKF,2BAuoK8B,CAvoK9B,iBAwoK+B,CAvoK/B,+EACE,gBAqoK8D,CAtoKhE,+EACE,4BAsoKmC,CASvC,WACE,sBACA,kBACA,sBACA,UA52KgB,CA82KhB,WAVqB,CAWrB,eAXqB,CAYrB,SACA,cACA,iCAEA,cACE,gBASF,qBACE,aAIF,qDAEE,aACA,2BAIF,kGAEE,mDAl4Ka,CAs4Kf,+DAEE,gBACA,aACA,+BAIF,uKAIE,gBACA,aACA,+BAIF,2CACE,gBACA,aACA,+BAIF,wCACE,gBACA,aACA,gCAIF,wEACE,qGAEA,mBACA,uBAIF,+CACE,qGAKF,wCACE,qGAEA,mBACA,uBAKJ,oCACE,aAGF,4BACE,OACA,MACA,gCACA,gDACE,mCAIJ,kBACE,UACA,MACA,8BACA,4BACE,2BAIJ,yBACE,WACE,eA1HoB,EA8HxB,yBACE,WACE,wBACA,4BACA,6BAKJ,8CACE,4BACE,4BAEF,kBACE,4BA8BJ,4BACE,GACE,qBAEF,IACE,mBAEF,KACE,sBAIJ,oCACE,GACE,qBAEF,IACE,qBAEF,KACE,oBAIJ,mCACE,GACE,qBACA,UAEF,IACE,mBACA,UAEF,KACE,oBAaJ,UACE,WAzEa,CA0Eb,eAzEiB,CA0EjB,kBACA,gBACA,iBACA,UACA,cACA,mBAEA,8BACE,sBAGF,6BACE,aACA,WACA,YAGF,6BACE,kBAMF,8BACE,WACA,kBACA,SACA,UApGmB,CAsGrB,oBACE,kBACA,OACA,QACA,YAEF,yBACE,oDACA,iCAEF,0BACE,kBACA,OACA,QACA,YAEF,iCAIE,WACA,YAMF,8BACE,kBA75KF,MA85KiC,CAC/B,QACA,qCACA,oDACA,sCAj6KF,wCACE,SA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,CAC7C,WAn5LF,kCACE,gBAi5LkD,CAh5LlD,eAg5L6C,CAI/C,oCA95LA,oBA+5L6B,CA/5L7B,eAg6L4B,CA/5L5B,8CACE,gBA65LoC,CA95LtC,8CACE,mBA85L+B,CAK/B,2FAEE,gBAKF,sCACE,UACA,SACA,WACA,YAIJ,oBACE,yBACA,eACA,WAGF,kBACE,SACA,WACA,QACA,WAhFgB,CAiFhB,kBACA,kBAGF,8BACE,QACA,OACA,WACA,kBACA,+BACA,UAEF,yCACE,kCAGF,oBACE,kBACA,SACA,OACA,MACA,aACA,WAtGgB,CAuGhB,UAvGgB,CAwGhB,kBACA,0GAptMoB,CAstMpB,2BACE,6BACA,kBACA,WACA,kBACA,cACA,YACA,OACA,MACA,QACA,SACA,mBACA,WAGF,yCACE,kBACA,cACA,WACA,YACA,WACA,UACA,YACA,aAKF,0HAGE,0BA1rMS,CA2rMT,+CAEF,0EAEE,sBAMN,8CACE,mCACE,sBAEF,8CACE,yBAEF,qCACE,uBAQJ,+BACE,aACA,cACA,gBAGF,YACE,kBACA,MACA,OACA,QACA,SACA,WACA,UAGF,QACE,cACA,SACA,kBACA,gBACA,kBACA,cACA,wDACE,iBAEF,8BACE,mBA7BiB,CA+BjB,8CACE,kBACA,SACA,OACA,QACA,WApCe,CAqCf,UAEF,sDACE,MACA,WAzCe,CA6CjB,kDACE,aACA,kBACA,SACA,UACA,WACA,YACA,iBAGA,mDACE,kBAKJ,0CACE,qBACA,mBAGA,0EACE,SAMR,gBACE,cACA,kBAEA,0BACA,8DACE,YACA,UAlFmB,CAmFnB,kBACA,QACA,2BACA,gBACA,UACA,eACA,eACA,+CACA,iDAhzMgB,CAizMhB,0EACE,aAEF,sFACE,YACA,eAEF,gFACE,gBAEF,8EACE,kBACA,QACA,SACA,gCAIF,kFACE,2CAGJ,+BA3nMA,MA4nMiC,CAC/B,yDA5nMF,yCACE,SA0nMkC,CAznMlC,OAynM+B,CAGjC,+BA/nMA,OAgoMiC,CAC/B,yDAhoMF,yCACE,UA8nMkC,CA7nMlC,MA6nM+B,CAI/B,uCACE,+CAIF,sDACE,WACA,mBACA,kEACE,YAMR,eAEE,kBACA,gBACA,cACA,WA7ImB,CA7mMnB,qBACE,WACA,cACA,WAwvMF,iCACE,kBACA,MA3pMF,MA4pMiC,CA3pMjC,2CACE,SA0pMkC,CAzpMlC,OAypM+B,CAEjC,4BACE,cAEF,8BACE,aACA,sBACA,kBACA,sCACE,WACA,qBAKN,sBAEE,WAnKmB,CAoKnB,aACA,wDACA,kBAjrMA,MAkrM+B,CAC/B,0BArxMA,4BACE,WACA,cACA,WAgGF,gCACE,SAgrMgC,CA/qMhC,OA+qM6B,CAE/B,qCACE,kBACA,uBAEF,kCACE,eAEF,yBACE,kCACE,iBAKN,wBACE,cACA,kBACA,QA1LmB,CA2LnB,OACA,QACA,SACA,gBAGF,eACE,aACA,kBACA,MACA,OACA,QACA,SACA,wDACA,cAEA,0BACA,4BACE,YACA,gBAEF,wDACE,gBAEF,uCAruMA,2BAsuM0B,CACxB,iCACA,kBAvuMF,iDACE,0BAouM2C,CAG3C,yCACE,gCACA,oBAl7MuB,CAm7MvB,kBAGJ,wCA/uMA,0BAgvM0B,CACxB,iCACA,kBAjvMF,kDACE,2BA8uM0C,CAG1C,0CACE,gCACA,oBA57MuB,CA67MvB,kBAGJ,mBACE,cACA,YACA,4BACE,iCAKN,WAGE,kBACA,UACA,WACA,SACA,WACA,mBACE,+FAGF,oBACE,+FAKJ,OACE,kBACA,WACA,aAGF,QACE,eACA,kBACA,iBACA,aACA,gEACA,eACA,mBACA,kBACA,yBAnyMA,UAoyMoB,CACpB,gBACA,sBACA,gBACA,uBAvyMA,kBACE,WAkyMwB,CAK1B,iCACE,gBACA,aAEF,kBACE,eAEF,oBACE,oBACA,mBACA,iBACA,uBACA,WACA,eAEF,iBACE,gBAIJ,wDACE,yBACA,0BAUF,eACE,cAGF,SACE,kBACA,WA/iNc,CAijNd,sBACA,eACA,gBAGA,WA5lNa,CA+lNb,UACA,mDAviNe,CAyiNf,2BACE,aACA,mBACA,mBAEA,iBACA,eAEA,gBAKA,eAEA,uCACA,kBACA,eAEA,gBAGA,6CACA,mDAhkNa,CA6Mf,0BAq3MgC,CAj4MhC,m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u2NiC,CAC/B,mBAv2NF,yFACE,UAq2NqC,CAp2NrC,SAo2N+B,CAKnC,qCACE,0GAhnOsB,CAknOxB,mBACE,0GAlnOsB,CAonOxB,mBACE,0GApnOsB,CAsnOxB,qCACE,2GAtnOsB,CAwnOxB,mBACE,2GAxnOsB,CA0nOxB,mBACE,4GA1nOsB,CA4nOxB,qCACE,4GA5nOsB,CA8nOxB,mBACE,4GA9nOsB,CAgoOxB,mBACE,4GAhoOsB,CAkoOxB,sCACE,6GAloOuB,CAooOzB,oBACE,6GApoOuB,CAsoOzB,oBACE,6GAtoOuB,CAwoOzB,sCACE,6GAxoOuB,CA0oOzB,oBACE,6GA1oOuB,CA4oOzB,oBACE,6GA5oOuB,CA8oOzB,oBACE,8GA9oOuB,CAgpOzB,oBACE,8GAhpOuB,CAkpOzB,oBACE,8GAlpOuB,CAopOzB,oBACE,8GAppOuB,CAspOzB,oBACE,+GAtpOuB,CAwpOzB,oBACE,+GAxpOuB,CA0pOzB,oBACE,+GA1pOuB,CA4pOzB,oBACE,+GA5pOuB,CA8pOzB,oBACE,+GA9pOuB,CAiqOzB,8CACE,cACE,uBAIJ,aACE,8BACE,uBAOJ,0EACE,wBAaF,4BACE,aACE,SACA,WACA,gBACA,aA/4MA,YACC,QAeD,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,gBACE,UADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,cACE,QADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SADF,eACE,SAmBF,gFA5mBF,aA8mByD,CA7mBzD,wHACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,gFA5mBF,cA6mB+D,CA5mB/D,wHACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,oFA5mBF,eA6mB+D,CA5mB/D,4HACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,oFACE,2BAeF,oFA7oBF,0BA8oBiD,CA7oBjD,4HACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,0CAGE,2BACA,sBACA,oBAIF,6HAME,2BAIF,kIAME,uBAIF,mHAME,yBAIF,gKAME,6BAIF,qKAME,8BAUF,gJAME,uBACA,yBAIF,qJAME,mBACA,qBACA,eAIF,+JAME,eACA,sBAIF,sIAME,qBACA,uBAIF,0JAME,oBACA,sBA9NF,mCAEA,+CACA,kDACA,+CACA,+CACA,mDACA,iDAME,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAGe,YAGjB,uBACE,cACA,eACA,cACA,sBArBF,QACE,cACA,aACA,gBACA,sBAGF,oBACE,cACA,aACA,gBACA,sBAMF,uBACE,cACA,eACA,cACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,SACE,cACA,cACA,gBACA,sBAGF,qBACE,cACA,cACA,gBACA,sBAMF,wBACE,cACA,eACA,eACA,sBArBF,UACE,cACA,eACA,gBACA,sBAGF,sBACE,cACA,eACA,gBACA,sBAMF,yBACE,cACA,eACA,gBACA,sBA2BF,8EACA,8EAIA,4FACA,4FAIA,+FACA,+FAIA,0FACA,0FAGA,8BAIA,6FACA,6FAGA,kCA9GF,mCACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,qCACA,+BAkPA,8CAGE,YAGF,mMAaE,YAIF,+KASE,aAKF,4CAGE,WAGF,0LAaE,WAIF,gJAQE,YAGF,aACE,eAGF,eACI,iBAGJ,aACE,SACA,WACA,gBACA,YAwgMJ,yBAGI,iEACE,aAz5MF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,k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CE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAu1MF,yBA/5MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCA61MF,+CAEI,sGACE,aAGJ,mDACE,aA56MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA02MF,yBAl7MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,sCAg3MF,gDAGI,+MACE,aAGJ,oEACE,aAh8MA,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCA63MF,0BAr8MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF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ACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,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A,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,mCAg5MF,0BAx9MI,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,sBACE,UADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,oBACE,QADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SADF,qBACE,SAmBF,wGA5mBF,aA8mByD,CA7mBzD,gJACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,wGA5mBF,cA6mB+D,CA5mB/D,gJACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,4GA5mBF,eA6mB+D,CA5mB/D,oJACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,4GACE,2BAeF,4GA7oBF,0BA8oBiD,CA7oBjD,oJACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,sDAGE,2BACA,sBACA,oBAIF,2JAME,2BAIF,gKAME,uBAIF,iJAME,yBAIF,8LAME,6BAIF,mMAME,8BAUF,8KAME,uBACA,yBAIF,mLAME,mBACA,qBACA,eAIF,6LAME,eACA,sBAIF,oKAME,qBACA,uBAIF,wLAME,oBACA,sBA9NF,yCAEA,qDACA,wDACA,qDACA,qDACA,yDACA,uDAME,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAGe,YAGjB,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAGc,YAGhB,mCACE,cACA,eACA,cACA,sBAGc,aA1ClB,cACE,cACA,aACA,gBACA,sBAGF,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAIA,gCACE,cACA,aACA,gBACA,sBAMF,mCACE,cACA,eACA,cACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,eACE,cACA,cACA,gBACA,sBAGF,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAIA,iCACE,cACA,cACA,gBACA,sBAMF,oCACE,cACA,eACA,eACA,sBAvCJ,gBACE,cACA,eACA,gBACA,sBAGF,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAIA,kCACE,cACA,eACA,gBACA,sBAMF,qCACE,cACA,eACA,gBACA,sBAcJ,kGACA,kGAIA,qGACA,qGAIA,sGACA,sGAGA,oCAIA,yGACA,yGAGA,wCA9GF,qDACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,2CACA,qCAxEE,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,mBACE,UADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,iBACE,QADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SADF,kBACE,SAmBF,4FA5mBF,aA8mByD,CA7mBzD,oIACE,gBA4mB0D,CA3mB1D,cA2mBuD,CAFvD,4FA5mBF,cA6mB+D,CA5mB/D,oIACE,gBA2mB8E,CA1mB9E,eA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAD7D,gGA5mBF,eA6mB+D,CA5mB/D,wIACE,gBA2mB8E,CA1mB9E,gBA0mB6D,CAgB7D,gGACE,2BAeF,gGA7oBF,0BA8oBiD,CA7oBjD,wIACE,gBA4oB+D,CA3oB/D,2BA2oB+C,CAwIjD,gDAGE,2BACA,sBACA,oBAIF,4IAME,2BAIF,iJAME,uBAIF,kIAME,yBAIF,+KAME,6BAIF,oLAME,8BAUF,+JAME,uBACA,yBAIF,oKAME,mBACA,qBACA,eAIF,8KAME,eACA,sBAIF,qJAME,qBACA,uBAIF,yKAME,oBACA,sBA9NF,sCAEA,kDACA,qDACA,kDACA,kDACA,sDACA,oDAME,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAGe,YAGjB,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAGc,YAGhB,6BACE,cACA,eACA,cACA,sBAGc,aA1ClB,WACE,cACA,aACA,gBACA,sBAGF,uBACE,cACA,aACA,gBACA,sBAMF,0BACE,cACA,eACA,cACA,sBAIA,0BACE,cACA,aACA,gBACA,sBAMF,6BACE,cACA,eACA,cACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,YACE,cACA,cACA,gBACA,sBAGF,wBACE,cACA,cACA,gBACA,sBAMF,2BACE,cACA,eACA,eACA,sBAIA,2BACE,cACA,cACA,gBACA,sBAMF,8BACE,cACA,eACA,eACA,sBAvCJ,aACE,cACA,eACA,gBACA,sBAGF,yBACE,cACA,eACA,gBACA,sBAMF,4BACE,cACA,eACA,gBACA,sBAIA,4BACE,cACA,eACA,gBACA,sBAMF,+BACE,cACA,eACA,gBACA,sBAcJ,+FACA,+FAIA,kGACA,kGAIA,gGACA,gGAGA,iCAIA,mGACA,mGAGA,qCA9GF,4CACE,sBACA,oBACA,qBACA,iBACA,oBACA,aAEF,wCACA,kCAs5ME,ugBACE,aAGJ,sGACE,cAMJ,aAEE,wCACE,yBN13OJ,MACE,2BACA,4BACA,mCACA,8BACA,kCACA,6BACA,4BAIA,uCAEE,iBAUJ,eACE,kBAIF,oBACE,QACA,uBAGF,0BACE,uBACA,kBAGF,mBACE,eACA,iBACA,WACA,wBAEA,yBACE,cAIJ,yBACE,eACA,YAGF,uBACE,yBAGF,sCAEE,iBAGF,aACE,mBACA,gBACA,uBAIA,kBACE,gBACA,uBACA,mBAKF,2KAGE,yCACA,6CAKF,2BACE,qBAKF,iCACE,UACA,kCAGF,uCACE,mFAKA,mBAEA,6CACE,mFAQJ,kBACE,aACA,WACA,yBACA,cACA,yBACA,kBACA,eACA,kBACA,mBAEA,8BACE,kBACA,iBAGF,wCACE,WACA,YACA,cAEA,qBAIF,uDACE,gBAEA,4DACE,gBAMJ,yFAEE,eACA,YACA,SACA,wBACA,iBACA,aACA,uBACA,mBACA,uBACA,uGACE,eACA,YACA,WAIJ,+DAEE,eACA,sBACA,sLAEE,cACA,6BACA,qBAKF,wFAEE,cACA,cAIJ,uCACE,qBACA,+CACE,eAMR,gBACE,aACA,sBACA,qBACE,YACA,eACA,kBAIJ,cACE,YACA,aACA,gBACA,oBACA,8BAEA,4CAEE,eACA,kBACA,kGAEE,WAKN,MACE,WAGF,+CACE,sBACA,uBAGF,YACE,6BACA,sBACA,YACA,UACA,eACA,SACA,sBACA,sBACA,uBACA,0BACA,kBACA,iDACA,oDACA,4CACA,+EAEA,wEACA,qFAEA,qEAGF,yBACE,qBACA,UACA,8EAEA,iFAEA,yEAIF,kBACE,kCACA,kDACA,sBACA,2BACA,uCAGF,aACE,UAGF,YACE,kCACA,kDACA,sBACA,2BACA,uCAGF,yCAEE,cACA,6BACA,WACA,YACA,UACA,eACA,SACA,sBACA,iCACA,uBACA,0BACA,kBACA,4DACA,+DACA,uDACA,+EAEA,wEACA,qFAEA,qEAGF,wDACE,cAGF,sBACE,sBAGF,uCAEE,cAGF,0BACE,4BAGA,2BAGF,kFAKE,sBACA,uBACA,wBAGF,mCACE,sBACA,mBACA,wBACA,mBAGF,yDACE,kBACA,wBACA,sBAGF,oEACE,4BAGF,4EACE,6BACA,uBACA,2BAGF,8DACE,uBACA,2BAGF,wDACE,uBAGF,wFAIE,sBAGF,0FAIE,qBAGF,yDACE,mBACA,qBACA,YAGF,8EACE,sBACA,kBAGF,kBAEE,eACA,WACA,gBACA,YAOF,UAGE,6BAGF,yBACE,UACA,SACA,eACA,eAIF,QACE,cACA,WACA,YAKF,wBAEE,WAJoB,CAKpB,eALoB,CAQpB,eACA,UAGF,wBAEE,YACA,yBAGA,gBAEA,yBACA,wBACA,gBACA,sBAGF,uCACE,yBACA,cACA,gCAGF,qCACE,yBACA,wBACA,kBACA,gBAGF,wCACE,yBACA,wBACA,kBACA,gBAGF,0BACE,kBACA,YACA,UAGF,6CACE,qBACA,kBACA,gBACA,wBACA,sBACA,kBAGF,sDACE,qBAGF,2DACE,cAGF,+DACE,cAEF,oDACE,yDACA,WACA,kBACA,WACA,WACA,WACA,YACA,4BACA,4BACA,wBAGF,mDACE,eACA,iBACA,kBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,0CACE,qBACA,kBAGF,kDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,eACA,kBACA,gBACA,kBACA,WAGF,wCACE,qBAGF,yCACE,qBAGF,yCACE,qBAGF,iDACE,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,iDACE,kBACA,yBACA,yBACA,QAGF,wDACE,WACA,WACA,yDACA,iCACA,yBAGF,gDACE,QACA,kBACA,WACA,eACA,YACA,iBACA,kBACA,gBACA,kBACA,WAGF,gDACE,iBACA,yBACA,yBACA,QAGF,uDACE,YACA,UACA,yDAGF,uBACE,WAIF,SACE,iBACA,yBAEA,gBACA,kBACA,cACA,aAGF,mBACE,cACA,gBACA,sBAGF,kBACE,WACA,YACA,kBAGF,6BACE,WACA,YACA,kBACA,OACA,MAGF,oCACE,WACA,cACA,cACA,UACA,WACA,sBACA,mBACA,oEACA,4DAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,gCACA,4BACA,wBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,8BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,+BACE,iCACA,6BACA,yBAGF,qCACE,8BACA,sBAGF,qCACE,4BACA,oBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,qCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,8BACA,sBAGF,sCACE,YAGE,UAGF,IACE,WAIJ,8BACE,YAGE,UAGF,IACE,WAIJ,4CACE,uBAGF,4CACE,WACA,yBAGF,4CACE,qBAGF,wBACE,qBAGF,gCACE,gBACA,YACA,kBACA,YAGF,mCACE,gCAGF,mCACE,8BAGF,gCACE,uDAEE,eAIJ,gCACE,uDAEE,cAIJ,mBACE,yBAGF,mBACE,uBAGF,YACE","sources":["webpack://motion-chat/./src/styles/app.scss","webpack://motion-chat/./node_modules/mdi/scss/_path.scss","webpack://motion-chat/./node_modules/mdi/scss/_core.scss","webpack://motion-chat/./node_modules/mdi/scss/_icons.scss","webpack://motion-chat/./node_modules/mdi/scss/_extras.scss","webpack://motion-chat/./node_modules/mdi/scss/_animated.scss","webpack://motion-chat/./node_modules/angular-material/angular-material.scss"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/styles/mobile.css b/snippet/3.8.0/styles/mobile.css similarity index 100% rename from snippet/3.5.0/styles/mobile.css rename to snippet/3.8.0/styles/mobile.css diff --git a/snippet/3.5.0/styles/mobile.css.map b/snippet/3.8.0/styles/mobile.css.map similarity index 100% rename from snippet/3.5.0/styles/mobile.css.map rename to snippet/3.8.0/styles/mobile.css.map diff --git a/snippet/3.5.0/styles/vendor.css b/snippet/3.8.0/styles/vendor.css similarity index 100% rename from snippet/3.5.0/styles/vendor.css rename to snippet/3.8.0/styles/vendor.css diff --git a/snippet/3.5.0/styles/vendor.css.map b/snippet/3.8.0/styles/vendor.css.map similarity index 100% rename from snippet/3.5.0/styles/vendor.css.map rename to snippet/3.8.0/styles/vendor.css.map diff --git a/snippet/3.5.0/templates/00860aee362cdeeb1080.html b/snippet/3.8.0/templates/2444367602029f7ce07b.html similarity index 100% rename from snippet/3.5.0/templates/00860aee362cdeeb1080.html rename to snippet/3.8.0/templates/2444367602029f7ce07b.html diff --git a/snippet/3.5.0/templates/6043a16afdb829ba5934.html b/snippet/3.8.0/templates/66a0b4b6e8658e97c814.html similarity index 100% rename from snippet/3.5.0/templates/6043a16afdb829ba5934.html rename to snippet/3.8.0/templates/66a0b4b6e8658e97c814.html diff --git a/snippet/3.5.0/templates/9962474df74f9405ac72.html b/snippet/3.8.0/templates/c1e929900f2af303341f.html similarity index 100% rename from snippet/3.5.0/templates/9962474df74f9405ac72.html rename to snippet/3.8.0/templates/c1e929900f2af303341f.html diff --git a/snippet/3.5.0/templates/3f18dac5f545add792db.html b/snippet/3.8.0/templates/c6696015a1b93372d614.html similarity index 100% rename from snippet/3.5.0/templates/3f18dac5f545add792db.html rename to snippet/3.8.0/templates/c6696015a1b93372d614.html diff --git a/snippet/3.5.0/templates/caf0e553108b226443aa.html b/snippet/3.8.0/templates/cd310ba2c496545551ae.html similarity index 100% rename from snippet/3.5.0/templates/caf0e553108b226443aa.html rename to snippet/3.8.0/templates/cd310ba2c496545551ae.html diff --git a/snippet/3.5.0/templates/dc49a9ba939f8c099868.html b/snippet/3.8.0/templates/f4b04fc57c34408c2d9e.html similarity index 100% rename from snippet/3.5.0/templates/dc49a9ba939f8c099868.html rename to snippet/3.8.0/templates/f4b04fc57c34408c2d9e.html